From: support Date: Wed, 28 Dec 2022 10:45:46 +0000 (+0000) Subject: Built motion from commit c738b9ac.|2.6.25 X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg//%22%7B%7Blicense.messaging?a=commitdiff_plain;h=000e42fe41b93bc66d00f4098f3d42ea83af8c82;p=motion2.git Built motion from commit c738b9ac.|2.6.25 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 3e69736..17ae976 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-12-28T10:02:54.754Z", + "time": "2022-12-28T10:37:43.764Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 9b21adc..83c56a4 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-28T10:02:54.754Z", + "time": "2022-12-28T10:37:43.764Z", "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 7547df5..2fa31a7 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 _0xb1cf=['integration','urlForward','browser','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]','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]','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x3c7dd2,_0x5b0ade){var _0x138d50=function(_0x2e32ce){while(--_0x2e32ce){_0x3c7dd2['push'](_0x3c7dd2['shift']());}};_0x138d50(++_0x5b0ade);}(_0xb1cf,0x6a));var _0xfb1c=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0xb1cf[_0x3a0c4f];return _0x247049;};'use strict';var Sequelize=require(_0xfb1c('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb1c('0x1')],'get':function(_0x14dbda){return this[_0xfb1c('0x2')](_0xfb1c('0x3'));}},'action':{'type':Sequelize[_0xfb1c('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfb1c('0x5'),_0xfb1c('0x6'),'motionbar','jscripty',_0xfb1c('0x7'),_0xfb1c('0x8'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xfb1c('0x4')](0x1000),'comment':_0xfb1c('0x9')},'data2':{'type':Sequelize[_0xfb1c('0x4')](0x1000),'comment':_0xfb1c('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xfb1c('0xb')},'data4':{'type':Sequelize[_0xfb1c('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xfb1c('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xfb1c('0x4')],'comments':_0xfb1c('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0xfb1c('0xd')}}; \ No newline at end of file +var _0x0976=['jscripty','urlForward','browser','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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar'];(function(_0xb6ea0a,_0x483190){var _0x397ff4=function(_0x8a3ddd){while(--_0x8a3ddd){_0xb6ea0a['push'](_0xb6ea0a['shift']());}};_0x397ff4(++_0x483190);}(_0x0976,0xef));var _0x6097=function(_0xc45a28,_0x34c72d){_0xc45a28=_0xc45a28-0x0;var _0x3ce758=_0x0976[_0xc45a28];return _0x3ce758;};'use strict';var Sequelize=require(_0x6097('0x0'));module['exports']={'name':{'type':Sequelize[_0x6097('0x1')],'get':function(_0x456e85){return this[_0x6097('0x2')](_0x6097('0x3'));}},'action':{'type':Sequelize[_0x6097('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6097('0x5'),_0x6097('0x6'),_0x6097('0x7'),_0x6097('0x8'),_0x6097('0x9'),_0x6097('0xa'),'bot',_0x6097('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x6097('0xc')},'data1':{'type':Sequelize[_0x6097('0x4')](0x1000),'comment':_0x6097('0xd')},'data2':{'type':Sequelize[_0x6097('0x4')](0x1000),'comment':_0x6097('0xe')},'data3':{'type':Sequelize[_0x6097('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x6097('0x4')](0x1000),'comments':_0x6097('0xf')},'data5':{'type':Sequelize[_0x6097('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x6097('0x10')},'data7':{'type':Sequelize[_0x6097('0x11')],'comments':_0x6097('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 124c453..50421a9 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 _0xcb00=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','catch','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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'];(function(_0x40c1a9,_0x2b26c1){var _0x859fd2=function(_0x153d46){while(--_0x153d46){_0x40c1a9['push'](_0x40c1a9['shift']());}};_0x859fd2(++_0x2b26c1);}(_0xcb00,0x13c));var _0x0cb0=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0xcb00[_0x58c851];return _0x534d8a;};'use strict';var emlformat=require(_0x0cb0('0x0'));var rimraf=require(_0x0cb0('0x1'));var zipdir=require(_0x0cb0('0x2'));var jsonpatch=require(_0x0cb0('0x3'));var rp=require(_0x0cb0('0x4'));var moment=require(_0x0cb0('0x5'));var BPromise=require(_0x0cb0('0x6'));var Mustache=require(_0x0cb0('0x7'));var util=require(_0x0cb0('0x8'));var path=require(_0x0cb0('0x9'));var sox=require(_0x0cb0('0xa'));var csv=require(_0x0cb0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cb0('0xc'));var _=require(_0x0cb0('0xd'));var squel=require(_0x0cb0('0xe'));var crypto=require(_0x0cb0('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0cb0('0xb'));var querystring=require('querystring');var Papa=require(_0x0cb0('0x10'));var Redis=require('ioredis');var authService=require(_0x0cb0('0x11'));var qs=require(_0x0cb0('0x12'));var as=require(_0x0cb0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0cb0('0x14'))(_0x0cb0('0x15'));var utils=require(_0x0cb0('0x16'));var config=require(_0x0cb0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cb0('0x18'))['db'];function respondWithStatusCode(_0x4832d1,_0x48ccdc){_0x48ccdc=_0x48ccdc||0xcc;return function(_0xf9c379){if(_0xf9c379){return _0x4832d1[_0x0cb0('0x19')](_0x48ccdc);}return _0x4832d1[_0x0cb0('0x1a')](_0x48ccdc)[_0x0cb0('0x1b')]();};}function respondWithResult(_0x29bdb5,_0x7d90d2){_0x7d90d2=_0x7d90d2||0xc8;return function(_0x44720d){if(_0x44720d){return _0x29bdb5[_0x0cb0('0x1a')](_0x7d90d2)[_0x0cb0('0x1c')](_0x44720d);}};}function respondWithFilteredResult(_0x208d81,_0x3b7bcc){return function(_0x5d7590){if(_0x5d7590){var _0x1bee9a=typeof _0x3b7bcc[_0x0cb0('0x1d')]===_0x0cb0('0x1e')&&typeof _0x3b7bcc[_0x0cb0('0x1f')]===_0x0cb0('0x1e');var _0x4a65eb=_0x5d7590[_0x0cb0('0x20')];var _0x1bc89f=_0x1bee9a?0x0:_0x3b7bcc[_0x0cb0('0x1d')];var _0x4e24a7=_0x1bee9a?_0x5d7590[_0x0cb0('0x20')]:_0x3b7bcc['offset']+_0x3b7bcc[_0x0cb0('0x1f')];var _0x533b3c;if(_0x4e24a7>=_0x4a65eb){_0x4e24a7=_0x4a65eb;_0x533b3c=0xc8;}else{_0x533b3c=0xce;}_0x208d81[_0x0cb0('0x1a')](_0x533b3c);return _0x208d81['set'](_0x0cb0('0x21'),_0x1bc89f+'-'+_0x4e24a7+'/'+_0x4a65eb)[_0x0cb0('0x1c')](_0x5d7590);}return null;};}function patchUpdates(_0x5d7345){return function(_0x52fb4a){try{jsonpatch[_0x0cb0('0x22')](_0x52fb4a,_0x5d7345,!![]);}catch(_0x58119a){return BPromise[_0x0cb0('0x23')](_0x58119a);}return _0x52fb4a[_0x0cb0('0x24')]();};}function saveUpdates(_0x4c111e,_0x1848d2){return function(_0x2f1ece){if(_0x2f1ece){return _0x2f1ece[_0x0cb0('0x25')](_0x4c111e)[_0x0cb0('0x26')](function(_0x2da04c){return _0x2da04c;});}return null;};}function removeEntity(_0x5e9e6a,_0x194e73){return function(_0x1beb23){if(_0x1beb23){return _0x1beb23[_0x0cb0('0x27')]()[_0x0cb0('0x26')](function(){_0x5e9e6a['status'](0xcc)[_0x0cb0('0x1b')]();});}};}function handleEntityNotFound(_0x47de6a,_0x259797){return function(_0x1cc582){if(!_0x1cc582){_0x47de6a[_0x0cb0('0x19')](0x194);}return _0x1cc582;};}function handleError(_0x4f44bc,_0x2d364f){_0x2d364f=_0x2d364f||0x1f4;return function(_0x453985){logger[_0x0cb0('0x28')](_0x453985[_0x0cb0('0x29')]);if(_0x453985[_0x0cb0('0x2a')]){delete _0x453985[_0x0cb0('0x2a')];}_0x4f44bc[_0x0cb0('0x1a')](_0x2d364f)[_0x0cb0('0x2b')](_0x453985);};}exports[_0x0cb0('0x25')]=function(_0x5a11ad,_0x1656f4){if(_0x5a11ad[_0x0cb0('0x2c')]['id']){delete _0x5a11ad[_0x0cb0('0x2c')]['id'];}return db[_0x0cb0('0x2d')]['find']({'where':{'id':_0x5a11ad['params']['id']}})[_0x0cb0('0x26')](handleEntityNotFound(_0x1656f4,null))[_0x0cb0('0x26')](saveUpdates(_0x5a11ad[_0x0cb0('0x2c')],null))['then'](respondWithResult(_0x1656f4,null))[_0x0cb0('0x2e')](handleError(_0x1656f4,null));};exports[_0x0cb0('0x27')]=function(_0xee8209,_0x23eccf){return db[_0x0cb0('0x2d')][_0x0cb0('0x2f')]({'where':{'id':_0xee8209[_0x0cb0('0x30')]['id']}})[_0x0cb0('0x26')](handleEntityNotFound(_0x23eccf,null))['then'](removeEntity(_0x23eccf,null))[_0x0cb0('0x2e')](handleError(_0x23eccf,null));}; \ No newline at end of file +var _0x2bff=['set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit'];(function(_0x39283e,_0x81a14d){var _0x5f2a54=function(_0xf9d19b){while(--_0xf9d19b){_0x39283e['push'](_0x39283e['shift']());}};_0x5f2a54(++_0x81a14d);}(_0x2bff,0x100));var _0xf2bf=function(_0x4cb51f,_0x30fd19){_0x4cb51f=_0x4cb51f-0x0;var _0x2a9e7c=_0x2bff[_0x4cb51f];return _0x2a9e7c;};'use strict';var emlformat=require(_0xf2bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf2bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2bf('0x2'));var moment=require(_0xf2bf('0x3'));var BPromise=require(_0xf2bf('0x4'));var Mustache=require('mustache');var util=require(_0xf2bf('0x5'));var path=require(_0xf2bf('0x6'));var sox=require(_0xf2bf('0x7'));var csv=require(_0xf2bf('0x8'));var ejs=require(_0xf2bf('0x9'));var fs=require('fs');var fs_extra=require(_0xf2bf('0xa'));var _=require(_0xf2bf('0xb'));var squel=require(_0xf2bf('0xc'));var crypto=require(_0xf2bf('0xd'));var jsforce=require(_0xf2bf('0xe'));var deskjs=require(_0xf2bf('0xf'));var toCsv=require(_0xf2bf('0x8'));var querystring=require(_0xf2bf('0x10'));var Papa=require(_0xf2bf('0x11'));var Redis=require(_0xf2bf('0x12'));var authService=require(_0xf2bf('0x13'));var qs=require(_0xf2bf('0x14'));var as=require(_0xf2bf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2bf('0x16'))(_0xf2bf('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf2bf('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122e0c,_0x560b6c){_0x560b6c=_0x560b6c||0xcc;return function(_0x52cfc7){if(_0x52cfc7){return _0x122e0c[_0xf2bf('0x19')](_0x560b6c);}return _0x122e0c[_0xf2bf('0x1a')](_0x560b6c)[_0xf2bf('0x1b')]();};}function respondWithResult(_0x57917c,_0x56b209){_0x56b209=_0x56b209||0xc8;return function(_0x5d055c){if(_0x5d055c){return _0x57917c[_0xf2bf('0x1a')](_0x56b209)['json'](_0x5d055c);}};}function respondWithFilteredResult(_0x24f1b7,_0xf23c2c){return function(_0x23396d){if(_0x23396d){var _0x389774=typeof _0xf23c2c[_0xf2bf('0x1c')]===_0xf2bf('0x1d')&&typeof _0xf23c2c['limit']==='undefined';var _0x1c0798=_0x23396d['count'];var _0x1104e1=_0x389774?0x0:_0xf23c2c[_0xf2bf('0x1c')];var _0x263a31=_0x389774?_0x23396d[_0xf2bf('0x1e')]:_0xf23c2c['offset']+_0xf23c2c[_0xf2bf('0x1f')];var _0x3aa631;if(_0x263a31>=_0x1c0798){_0x263a31=_0x1c0798;_0x3aa631=0xc8;}else{_0x3aa631=0xce;}_0x24f1b7['status'](_0x3aa631);return _0x24f1b7[_0xf2bf('0x20')](_0xf2bf('0x21'),_0x1104e1+'-'+_0x263a31+'/'+_0x1c0798)[_0xf2bf('0x22')](_0x23396d);}return null;};}function patchUpdates(_0x458099){return function(_0x497438){try{jsonpatch[_0xf2bf('0x23')](_0x497438,_0x458099,!![]);}catch(_0x3b4c51){return BPromise['reject'](_0x3b4c51);}return _0x497438['save']();};}function saveUpdates(_0x55b4e3,_0xaaf6c7){return function(_0x555664){if(_0x555664){return _0x555664[_0xf2bf('0x24')](_0x55b4e3)[_0xf2bf('0x25')](function(_0xfcaf47){return _0xfcaf47;});}return null;};}function removeEntity(_0x25ecab,_0x3c7943){return function(_0x393639){if(_0x393639){return _0x393639[_0xf2bf('0x26')]()[_0xf2bf('0x25')](function(){_0x25ecab[_0xf2bf('0x1a')](0xcc)[_0xf2bf('0x1b')]();});}};}function handleEntityNotFound(_0x2fea14,_0x26d04d){return function(_0x251d7c){if(!_0x251d7c){_0x2fea14[_0xf2bf('0x19')](0x194);}return _0x251d7c;};}function handleError(_0xdc1e90,_0x4d7639){_0x4d7639=_0x4d7639||0x1f4;return function(_0x5377e3){logger[_0xf2bf('0x27')](_0x5377e3[_0xf2bf('0x28')]);if(_0x5377e3[_0xf2bf('0x29')]){delete _0x5377e3[_0xf2bf('0x29')];}_0xdc1e90['status'](_0x4d7639)[_0xf2bf('0x2a')](_0x5377e3);};}exports['update']=function(_0x51579b,_0x2a65b9){if(_0x51579b[_0xf2bf('0x2b')]['id']){delete _0x51579b[_0xf2bf('0x2b')]['id'];}return db[_0xf2bf('0x2c')][_0xf2bf('0x2d')]({'where':{'id':_0x51579b[_0xf2bf('0x2e')]['id']}})['then'](handleEntityNotFound(_0x2a65b9,null))['then'](saveUpdates(_0x51579b[_0xf2bf('0x2b')],null))[_0xf2bf('0x25')](respondWithResult(_0x2a65b9,null))[_0xf2bf('0x2f')](handleError(_0x2a65b9,null));};exports[_0xf2bf('0x26')]=function(_0x5762f3,_0x44f860){return db['Action']['find']({'where':{'id':_0x5762f3[_0xf2bf('0x2e')]['id']}})[_0xf2bf('0x25')](handleEntityNotFound(_0x44f860,null))[_0xf2bf('0x25')](removeEntity(_0x44f860,null))[_0xf2bf('0x2f')](handleError(_0x44f860,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 9e7804a..447c4cd 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 _0x92b3=['path','rimraf','../../config/environment','exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x180089,_0x4f77ba){var _0x44b105=function(_0x59a14d){while(--_0x59a14d){_0x180089['push'](_0x180089['shift']());}};_0x44b105(++_0x4f77ba);}(_0x92b3,0x97));var _0x392b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x92b3[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x392b('0x0'));var logger=require(_0x392b('0x1'))(_0x392b('0x2'));var moment=require(_0x392b('0x3'));var BPromise=require(_0x392b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x392b('0x5'));var rimraf=require(_0x392b('0x6'));var config=require(_0x392b('0x7'));var attributes=require('./action.attributes');module[_0x392b('0x8')]=function(_0x199ab5,_0x9383d1){return _0x199ab5[_0x392b('0x9')](_0x392b('0xa'),attributes,{'tableName':_0x392b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02a7=['Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3b5406,_0x4ed3b6){var _0xc6ad2a=function(_0x52785e){while(--_0x52785e){_0x3b5406['push'](_0x3b5406['shift']());}};_0xc6ad2a(++_0x4ed3b6);}(_0x02a7,0x1a6));var _0x702a=function(_0x17ebf6,_0x53a97d){_0x17ebf6=_0x17ebf6-0x0;var _0x77c12f=_0x02a7[_0x17ebf6];return _0x77c12f;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var logger=require(_0x702a('0x1'))(_0x702a('0x2'));var moment=require(_0x702a('0x3'));var BPromise=require(_0x702a('0x4'));var rp=require(_0x702a('0x5'));var fs=require('fs');var path=require(_0x702a('0x6'));var rimraf=require(_0x702a('0x7'));var config=require(_0x702a('0x8'));var attributes=require(_0x702a('0x9'));module['exports']=function(_0x4d3e8a,_0x804234){return _0x4d3e8a['define'](_0x702a('0xa'),attributes,{'tableName':_0x702a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index f529ff5..000078c 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\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(_0x2679e5,_0x123293){var _0x144631=function(_0xf32687){while(--_0xf32687){_0x2679e5['push'](_0x2679e5['shift']());}};_0x144631(++_0x123293);}(_0x1261,0x144));var _0x1126=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0x1261[_0x218ca4];return _0x1b3ff9;};'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')]('Action,\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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x17b0d4,_0x377add){var _0x2d02c7=function(_0x56e627){while(--_0x56e627){_0x17b0d4['push'](_0x17b0d4['shift']());}};_0x2d02c7(++_0x377add);}(_0xf494,0x1c6));var _0x4f49=function(_0x105553,_0x1bab86){_0x105553=_0x105553-0x0;var _0x216b4b=_0xf494[_0x105553];return _0x216b4b;};'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);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index f1e79d2..604e006 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 _0x4830=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4830,0x85));var _0x0483=function(_0x19cba3,_0x74f784){_0x19cba3=_0x19cba3-0x0;var _0x174b9c=_0x4830[_0x19cba3];return _0x174b9c;};'use strict';var multer=require(_0x0483('0x0'));var util=require(_0x0483('0x1'));var path=require(_0x0483('0x2'));var timeout=require(_0x0483('0x3'));var express=require(_0x0483('0x4'));var router=express[_0x0483('0x5')]();var fs_extra=require(_0x0483('0x6'));var auth=require(_0x0483('0x7'));var interaction=require(_0x0483('0x8'));var config=require(_0x0483('0x9'));var controller=require(_0x0483('0xa'));router[_0x0483('0xb')](_0x0483('0xc'),auth[_0x0483('0xd')](),controller['update']);router[_0x0483('0xe')](_0x0483('0xc'),auth[_0x0483('0xd')](),controller[_0x0483('0xf')]);module[_0x0483('0x10')]=router; \ No newline at end of file +var _0x07cf=['/:id','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x07cf,0x1e0));var _0xf07c=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0x07cf[_0x53a7a8];return _0x555f71;};'use strict';var multer=require(_0xf07c('0x0'));var util=require(_0xf07c('0x1'));var path=require(_0xf07c('0x2'));var timeout=require(_0xf07c('0x3'));var express=require(_0xf07c('0x4'));var router=express[_0xf07c('0x5')]();var fs_extra=require(_0xf07c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf07c('0x7'));var config=require(_0xf07c('0x8'));var controller=require(_0xf07c('0x9'));router['put'](_0xf07c('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf07c('0xb')](),controller[_0xf07c('0xc')]);module[_0xf07c('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 6e1477d..fda53ff 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x22ee0f,_0x22e6d2){_0x22ee0f=_0x22ee0f-0x0;var _0x204696=_0xfdbd[_0x22ee0f];return _0x204696;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file +var _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x5d76ff,_0x568618){var _0x3f1cb0=function(_0x57ba5a){while(--_0x57ba5a){_0x5d76ff['push'](_0x5d76ff['shift']());}};_0x3f1cb0(++_0x568618);}(_0xe14b,0x93));var _0xbe14=function(_0x56594c,_0x4d20af){_0x56594c=_0x56594c-0x0;var _0x2fe91c=_0xe14b[_0x56594c];return _0x2fe91c;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index b1aea0a..b84a6e7 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 _0x9861=['parse','output','web','%s-%s.%s','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','get','UserProfileResource','destroy','sendStatus','error','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','count','include','findAll','rows','show','params','includeAll','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','left_join','right_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)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NOT\x20NULL','keyBy','metric'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x9861,0x1f1));var _0x1986=function(_0x10700b,_0x48a185){_0x10700b=_0x10700b-0x0;var _0x48df0e=_0x9861[_0x10700b];return _0x48df0e;};'use strict';var emlformat=require(_0x1986('0x0'));var rimraf=require(_0x1986('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1986('0x2'));var BPromise=require(_0x1986('0x3'));var Mustache=require(_0x1986('0x4'));var util=require(_0x1986('0x5'));var path=require(_0x1986('0x6'));var sox=require(_0x1986('0x7'));var csv=require(_0x1986('0x8'));var ejs=require(_0x1986('0x9'));var fs=require('fs');var fs_extra=require(_0x1986('0xa'));var _=require(_0x1986('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1986('0xc'));var toCsv=require(_0x1986('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1986('0xd'));var authService=require(_0x1986('0xe'));var qs=require(_0x1986('0xf'));var as=require(_0x1986('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1986('0x11'))(_0x1986('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1986('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1986('0x14'))[_0x1986('0x15')];function respondWithStatusCode(_0x44c427,_0x8e393b){_0x8e393b=_0x8e393b||0xcc;return function(_0x31c291){if(_0x31c291){return _0x44c427['sendStatus'](_0x8e393b);}return _0x44c427[_0x1986('0x16')](_0x8e393b)['end']();};}function respondWithResult(_0x527b89,_0x43aa02){_0x43aa02=_0x43aa02||0xc8;return function(_0xbe1a95){if(_0xbe1a95){return _0x527b89[_0x1986('0x16')](_0x43aa02)[_0x1986('0x17')](_0xbe1a95);}};}function respondWithFilteredResult(_0x4e456a,_0x45d8ff){return function(_0x4f2735){if(_0x4f2735){var _0x3c34f8=typeof _0x45d8ff[_0x1986('0x18')]===_0x1986('0x19')&&typeof _0x45d8ff[_0x1986('0x1a')]===_0x1986('0x19');var _0x985894=_0x4f2735['count'];var _0x192824=_0x3c34f8?0x0:_0x45d8ff['offset'];var _0x529e2c=_0x3c34f8?_0x4f2735['count']:_0x45d8ff[_0x1986('0x18')]+_0x45d8ff[_0x1986('0x1a')];var _0x4c4e8b;if(_0x529e2c>=_0x985894){_0x529e2c=_0x985894;_0x4c4e8b=0xc8;}else{_0x4c4e8b=0xce;}_0x4e456a[_0x1986('0x16')](_0x4c4e8b);return _0x4e456a[_0x1986('0x1b')](_0x1986('0x1c'),_0x192824+'-'+_0x529e2c+'/'+_0x985894)[_0x1986('0x17')](_0x4f2735);}return null;};}function patchUpdates(_0x4716b3){return function(_0x2fdddb){try{jsonpatch[_0x1986('0x1d')](_0x2fdddb,_0x4716b3,!![]);}catch(_0x5961db){return BPromise['reject'](_0x5961db);}return _0x2fdddb['save']();};}function saveUpdates(_0x109555,_0x196cd5){return function(_0x571f11){if(_0x571f11){return _0x571f11[_0x1986('0x1e')](_0x109555)[_0x1986('0x1f')](function(_0x32ab60){return _0x32ab60;});}return null;};}function removeEntity(_0x2065ca,_0x3f4cc0){return function(_0x4d93e4){if(_0x4d93e4){return _0x4d93e4['destroy']()['then'](function(){var _0x530bf4=_0x4d93e4[_0x1986('0x20')]({'plain':!![]});var _0x41173d='CustomReports';return db[_0x1986('0x21')][_0x1986('0x22')]({'where':{'type':_0x41173d,'resourceId':_0x530bf4['id']}})[_0x1986('0x1f')](function(){return _0x4d93e4;});})[_0x1986('0x1f')](function(){_0x2065ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a29ec,_0x2ada59){return function(_0x5832b4){if(!_0x5832b4){_0x1a29ec[_0x1986('0x23')](0x194);}return _0x5832b4;};}function handleError(_0x13e302,_0x490619){_0x490619=_0x490619||0x1f4;return function(_0x31dca5){logger[_0x1986('0x24')](_0x31dca5['stack']);if(_0x31dca5[_0x1986('0x25')]){delete _0x31dca5[_0x1986('0x25')];}_0x13e302[_0x1986('0x16')](_0x490619)['send'](_0x31dca5);};}exports[_0x1986('0x26')]=function(_0xdce1a5,_0x4a5c4a){var _0x34b2cd={},_0xe30e9d={},_0x46be50={'count':0x0,'rows':[]};var _0x176221=_[_0x1986('0x27')](db[_0x1986('0x28')][_0x1986('0x29')],function(_0x972a83){return{'name':_0x972a83[_0x1986('0x2a')],'type':_0x972a83[_0x1986('0x2b')]['key']};});_0xe30e9d[_0x1986('0x2c')]=_['map'](_0x176221,_0x1986('0x25'));_0xe30e9d[_0x1986('0x2d')]=_[_0x1986('0x2e')](_0xdce1a5[_0x1986('0x2d')]);_0xe30e9d['filters']=_[_0x1986('0x2f')](_0xe30e9d[_0x1986('0x2c')],_0xe30e9d['query']);_0x34b2cd['attributes']=_[_0x1986('0x2f')](_0xe30e9d[_0x1986('0x2c')],qs[_0x1986('0x30')](_0xdce1a5[_0x1986('0x2d')][_0x1986('0x30')]));_0x34b2cd[_0x1986('0x31')]=_0x34b2cd['attributes'][_0x1986('0x32')]?_0x34b2cd[_0x1986('0x31')]:_0xe30e9d[_0x1986('0x2c')];if(!_0xdce1a5['query'][_0x1986('0x33')](_0x1986('0x34'))){_0x34b2cd[_0x1986('0x1a')]=qs[_0x1986('0x1a')](_0xdce1a5[_0x1986('0x2d')][_0x1986('0x1a')]);_0x34b2cd[_0x1986('0x18')]=qs[_0x1986('0x18')](_0xdce1a5[_0x1986('0x2d')][_0x1986('0x18')]);}_0x34b2cd[_0x1986('0x35')]=qs[_0x1986('0x36')](_0xdce1a5[_0x1986('0x2d')]['sort']);_0x34b2cd[_0x1986('0x37')]=qs[_0x1986('0x38')](_[_0x1986('0x39')](_0xdce1a5['query'],_0xe30e9d[_0x1986('0x38')]),_0x176221);if(_0xdce1a5['query'][_0x1986('0x3a')]){_0x34b2cd[_0x1986('0x37')]=_[_0x1986('0x3b')](_0x34b2cd[_0x1986('0x37')],{'$or':_['map'](_0x176221,function(_0x43c978){if(_0x43c978[_0x1986('0x2b')]!=='VIRTUAL'){var _0x139d11={};_0x139d11[_0x43c978['name']]={'$like':'%'+_0xdce1a5[_0x1986('0x2d')]['filter']+'%'};return _0x139d11;}})});}_0x34b2cd=_[_0x1986('0x3b')]({},_0x34b2cd,_0xdce1a5['options']);var _0x148596={'where':_0x34b2cd[_0x1986('0x37')]};return db[_0x1986('0x28')]['count'](_0x148596)[_0x1986('0x1f')](function(_0x4f8394){_0x46be50[_0x1986('0x3c')]=_0x4f8394;if(_0xdce1a5[_0x1986('0x2d')]['includeAll']){_0x34b2cd[_0x1986('0x3d')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x1986('0x3e')](_0x34b2cd);})[_0x1986('0x1f')](function(_0xaa62cf){_0x46be50[_0x1986('0x3f')]=_0xaa62cf;return _0x46be50;})[_0x1986('0x1f')](respondWithFilteredResult(_0x4a5c4a,_0x34b2cd))['catch'](handleError(_0x4a5c4a,null));};exports[_0x1986('0x40')]=function(_0xbe1567,_0x528721){var _0x401f5f={'raw':![],'where':{'id':_0xbe1567[_0x1986('0x41')]['id']}},_0x21f964={};_0x21f964[_0x1986('0x2c')]=_[_0x1986('0x2e')](db['AnalyticCustomReport'][_0x1986('0x29')]);_0x21f964[_0x1986('0x2d')]=_[_0x1986('0x2e')](_0xbe1567['query']);_0x21f964[_0x1986('0x38')]=_[_0x1986('0x2f')](_0x21f964['model'],_0x21f964[_0x1986('0x2d')]);_0x401f5f[_0x1986('0x31')]=_['intersection'](_0x21f964[_0x1986('0x2c')],qs[_0x1986('0x30')](_0xbe1567[_0x1986('0x2d')][_0x1986('0x30')]));_0x401f5f[_0x1986('0x31')]=_0x401f5f[_0x1986('0x31')]['length']?_0x401f5f[_0x1986('0x31')]:_0x21f964[_0x1986('0x2c')];if(_0xbe1567[_0x1986('0x2d')][_0x1986('0x42')]){_0x401f5f[_0x1986('0x3d')]=[{'all':!![]}];}_0x401f5f=_['merge']({},_0x401f5f,_0xbe1567[_0x1986('0x43')]);return db[_0x1986('0x28')]['find'](_0x401f5f)['then'](handleEntityNotFound(_0x528721,null))[_0x1986('0x1f')](respondWithResult(_0x528721,null))[_0x1986('0x44')](handleError(_0x528721,null));};exports[_0x1986('0x45')]=function(_0x5627da,_0x296580){return db[_0x1986('0x28')][_0x1986('0x45')](_0x5627da[_0x1986('0x46')],{})[_0x1986('0x1f')](function(_0x3fa67e){var _0x4ae63c=_0x5627da['user'][_0x1986('0x20')]({'plain':!![]});if(!_0x4ae63c)throw new Error(_0x1986('0x47'));if(_0x4ae63c[_0x1986('0x48')]===_0x1986('0x49')){var _0x25662d=_0x3fa67e[_0x1986('0x20')]({'plain':!![]});var _0x9ffd3=_0x1986('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x9ffd3,'userProfileId':_0x4ae63c['userProfileId']},'raw':!![]})[_0x1986('0x1f')](function(_0x4a8536){if(_0x4a8536&&_0x4a8536[_0x1986('0x4b')]===0x0){return db[_0x1986('0x21')][_0x1986('0x45')]({'name':_0x25662d[_0x1986('0x25')],'resourceId':_0x25662d['id'],'type':'CustomReports','sectionId':_0x4a8536['id']},{})[_0x1986('0x1f')](function(){return _0x3fa67e;});}else{return _0x3fa67e;}})[_0x1986('0x44')](function(_0x3385bc){logger[_0x1986('0x24')](_0x1986('0x4c'),_0x3385bc);throw _0x3385bc;});}return _0x3fa67e;})[_0x1986('0x1f')](respondWithResult(_0x296580,0xc9))['catch'](handleError(_0x296580,null));};exports[_0x1986('0x1e')]=function(_0x570ef8,_0x544a2d){if(_0x570ef8[_0x1986('0x46')]['id']){delete _0x570ef8[_0x1986('0x46')]['id'];}return db[_0x1986('0x28')]['find']({'where':{'id':_0x570ef8[_0x1986('0x41')]['id']}})['then'](handleEntityNotFound(_0x544a2d,null))[_0x1986('0x1f')](saveUpdates(_0x570ef8[_0x1986('0x46')],null))[_0x1986('0x1f')](respondWithResult(_0x544a2d,null))[_0x1986('0x44')](handleError(_0x544a2d,null));};exports[_0x1986('0x22')]=function(_0x2b9d9f,_0x29abe9){return db[_0x1986('0x28')][_0x1986('0x4d')]({'where':{'id':_0x2b9d9f['params']['id']}})[_0x1986('0x1f')](handleEntityNotFound(_0x29abe9,null))[_0x1986('0x1f')](removeEntity(_0x29abe9,null))[_0x1986('0x44')](handleError(_0x29abe9,null));};exports[_0x1986('0x4e')]=function(_0x53feff,_0x3d8df0){var _0x4505db=0xa;var _0x214327=['join',_0x1986('0x4f'),_0x1986('0x50'),_0x1986('0x51')];var _0xcec71f={'SUM':_0x1986('0x52'),'COUNT':_0x1986('0x53'),'COUNT DISTINCT':_0x1986('0x54'),'MAX':_0x1986('0x55'),'MIN':_0x1986('0x56'),'AVG':_0x1986('0x57'),'GROUP_CONCAT':_0x1986('0x58'),'GROUP_CONCAT ASC':_0x1986('0x59'),'GROUP_CONCAT DESC':_0x1986('0x5a')};var _0x1c844f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1986('0x5b'),'HOUR':_0x1986('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1986('0x5d')};var _0x5be64d=function(_0x5520a2){return!_[_0x1986('0x5e')]([_0x1986('0x5f'),'IS\x20NOT\x20NULL',_0x1986('0x60'),_0x1986('0x61')],_0x5520a2);};var _0xccbde8=function(_0x95bd27){if(!_0x95bd27||!_0x95bd27[_0x1986('0x62')][_0x1986('0x32')]){return'';}for(var _0xd7b63b='(',_0x5e8408=0x0;_0x5e8408<_0x95bd27[_0x1986('0x62')][_0x1986('0x32')];_0x5e8408+=0x1){_0x5e8408>0x0&&(_0xd7b63b+='\x20'+_0x95bd27[_0x1986('0x63')]+'\x20');_0xd7b63b+=_0x95bd27[_0x1986('0x62')][_0x5e8408][_0x1986('0x64')]?_0xccbde8(_0x95bd27[_0x1986('0x62')][_0x5e8408][_0x1986('0x64')]):_0x95bd27['rules'][_0x5e8408]['field']+'\x20'+_0x95bd27['rules'][_0x5e8408][_0x1986('0x65')]+(_0x5be64d(_0x95bd27[_0x1986('0x62')][_0x5e8408]['condition'])?'\x20'+_0x95bd27[_0x1986('0x62')][_0x5e8408][_0x1986('0x66')]:'');}return _0xd7b63b+')';};var _0x236795={'where':{'id':_0x53feff['params']['id']}},_0x494753,_0x5effef,_0x53294c,_0x5d5a66,_0x5464f8;_0x236795=_[_0x1986('0x3b')]({},_0x236795,_0x53feff['options']);return db[_0x1986('0x28')][_0x1986('0x4d')](_0x236795)[_0x1986('0x1f')](function(_0x3918ad){if(_0x3918ad){_0x494753=_0x3918ad;return _0x3918ad[_0x1986('0x67')]();}return null;})[_0x1986('0x1f')](function(_0x9a9db){if(_0x9a9db){if(!_0x9a9db[_0x1986('0x32')]){throw new db['Sequelize']['ValidationErrorItem'](_0x1986('0x68'),0x193);}_0x5effef=_0x9a9db;return db[_0x1986('0x69')][_0x1986('0x3e')]({'raw':!![]});}return null;})[_0x1986('0x1f')](function(_0x102de5){if(_0x102de5){_0x53294c=_['keyBy'](_0x102de5,'id');var _0x552461;var _0x4bd0dd=squel[_0x1986('0x6a')]();_0x4bd0dd[_0x1986('0x6b')](_0x494753[_0x1986('0x6c')]);for(var _0x37c4ce=0x0;_0x37c4ce<_0x5effef[_0x1986('0x32')];_0x37c4ce+=0x1){_0x552461=_0x5effef[_0x37c4ce]['MetricId']?_0x53294c[_0x5effef[_0x37c4ce][_0x1986('0x6d')]]['metric']:_0x5effef[_0x37c4ce][_0x1986('0x6e')];_0x552461=_0x5effef[_0x37c4ce][_0x1986('0x6f')]?_[_0x1986('0x70')](_0xcec71f[_0x5effef[_0x37c4ce][_0x1986('0x6f')]],'%s',_0x552461):_0x552461;_0x552461=_0x5effef[_0x37c4ce][_0x1986('0x71')]?_[_0x1986('0x70')](_0x1c844f[_0x5effef[_0x37c4ce]['format']],'%s',_0x552461):_0x552461;if(_0x5effef[_0x37c4ce][_0x1986('0x72')]){_0x4bd0dd[_0x1986('0x64')](_0x552461);}_0x5effef[_0x37c4ce][_0x1986('0x73')]&&_0x4bd0dd[_0x1986('0x35')](_0x552461,_0x5effef[_0x37c4ce][_0x1986('0x73')]===_0x1986('0x74')?![]:!![]);_0x4bd0dd[_0x1986('0x6e')](_0x552461,_0x5effef[_0x37c4ce][_0x1986('0x75')]||_0x552461);}if(_0x494753[_0x1986('0x76')]){_0x494753[_0x1986('0x76')]=JSON['parse'](_0x494753[_0x1986('0x76')]);for(var _0x47c8d9=0x0;_0x47c8d9<_0x494753['joins'][_0x1986('0x32')];_0x47c8d9+=0x1){if(_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x2b')]&&_[_0x1986('0x5e')](_0x214327,_0x494753['joins'][_0x47c8d9][_0x1986('0x2b')])&&_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x77')]&&_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x78')]&&_0x494753['joins'][_0x47c8d9][_0x1986('0x79')]){_0x4bd0dd[_0x494753['joins'][_0x47c8d9][_0x1986('0x2b')]](_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x78')],null,util[_0x1986('0x71')]('%s.%s\x20=\x20%s.%s',_0x494753[_0x1986('0x6c')],_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x77')],_0x494753[_0x1986('0x76')][_0x47c8d9][_0x1986('0x78')],_0x494753['joins'][_0x47c8d9][_0x1986('0x79')]));}}}if(_0x494753[_0x1986('0x7a')]){_0x494753['conditions']=JSON['parse'](_0x494753['conditions']);_0x4bd0dd['where'](_0xccbde8(_0x494753[_0x1986('0x7a')][_0x1986('0x64')]));}_0x5464f8=_0x4bd0dd[_0x1986('0x7b')]();_0x4bd0dd[_0x1986('0x1a')](_0x4505db);_0x4bd0dd[_0x1986('0x18')](0x0);logger['debug'](_0x1986('0x7c'),_0x4bd0dd[_0x1986('0x7d')]());return dbH[_0x1986('0x7e')][_0x1986('0x2d')](_0x4bd0dd[_0x1986('0x7d')](),{'type':dbH[_0x1986('0x7e')][_0x1986('0x7f')][_0x1986('0x80')]});}})[_0x1986('0x1f')](respondWithResult(_0x3d8df0,null))['catch'](handleError(_0x3d8df0,null));};function runReport(_0x393b2a,_0x294ba5,_0x42302d){var _0xb2827f=_0x294ba5['name'];var _0x4bd264=0xa;var _0x176e87=[_0x1986('0x81'),_0x1986('0x4f'),_0x1986('0x50'),_0x1986('0x51')];var _0x134c1c={'SUM':_0x1986('0x52'),'COUNT':_0x1986('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1986('0x55'),'MIN':'MIN(%s)','AVG':_0x1986('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1986('0x59'),'GROUP_CONCAT DESC':_0x1986('0x5a')};var _0x214ab6={'SEC_TO_TIME':_0x1986('0x82'),'DATE':_0x1986('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x1986('0x83'),'UNIX_TIMESTAMP':_0x1986('0x5d')};var _0x13d33f=function(_0x55fc83){return!_['includes']([_0x1986('0x5f'),_0x1986('0x84'),_0x1986('0x60'),_0x1986('0x61')],_0x55fc83);};var _0x59475d=function(_0x563b82){if(!_0x563b82||!_0x563b82['rules']['length']){return'';}for(var _0x2846af='(',_0x339b69=0x0;_0x339b69<_0x563b82[_0x1986('0x62')][_0x1986('0x32')];_0x339b69+=0x1){_0x339b69>0x0&&(_0x2846af+='\x20'+_0x563b82[_0x1986('0x63')]+'\x20');_0x2846af+=_0x563b82[_0x1986('0x62')][_0x339b69][_0x1986('0x64')]?_0x59475d(_0x563b82['rules'][_0x339b69][_0x1986('0x64')]):_0x563b82[_0x1986('0x62')][_0x339b69]['field']+'\x20'+_0x563b82[_0x1986('0x62')][_0x339b69][_0x1986('0x65')]+(_0x13d33f(_0x563b82[_0x1986('0x62')][_0x339b69]['condition'])?'\x20'+_0x563b82[_0x1986('0x62')][_0x339b69][_0x1986('0x66')]:'');}return _0x2846af+')';};var _0x3c0270={'where':{'id':_0x393b2a['id']}},_0x45b229,_0x215cc8,_0x4d3b77,_0x49f461,_0x2aba06;_0x3c0270=_[_0x1986('0x3b')]({},_0x3c0270,_0x42302d);return db[_0x1986('0x28')][_0x1986('0x4d')](_0x3c0270)[_0x1986('0x1f')](function(_0x15626b){if(_0x15626b){_0x45b229=_0x15626b;return _0x15626b[_0x1986('0x67')]();}return null;})['then'](function(_0x60eabe){if(_0x60eabe){if(!_0x60eabe[_0x1986('0x32')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x215cc8=_0x60eabe;return db[_0x1986('0x69')][_0x1986('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x4fdb58){if(_0x4fdb58){_0x4d3b77=_[_0x1986('0x85')](_0x4fdb58,'id');var _0x7c4461;var _0x53b79=squel[_0x1986('0x6a')]();_0x53b79['from'](_0x45b229[_0x1986('0x6c')]);for(var _0xd8f3af=0x0;_0xd8f3af<_0x215cc8[_0x1986('0x32')];_0xd8f3af+=0x1){_0x7c4461=_0x215cc8[_0xd8f3af][_0x1986('0x6d')]?_0x4d3b77[_0x215cc8[_0xd8f3af][_0x1986('0x6d')]][_0x1986('0x86')]:_0x215cc8[_0xd8f3af]['field'];_0x7c4461=_0x215cc8[_0xd8f3af][_0x1986('0x6f')]?_['replace'](_0x134c1c[_0x215cc8[_0xd8f3af][_0x1986('0x6f')]],'%s',_0x7c4461):_0x7c4461;_0x7c4461=_0x215cc8[_0xd8f3af]['format']?_[_0x1986('0x70')](_0x214ab6[_0x215cc8[_0xd8f3af][_0x1986('0x71')]],'%s',_0x7c4461):_0x7c4461;if(_0x215cc8[_0xd8f3af][_0x1986('0x72')]){_0x53b79[_0x1986('0x64')](_0x7c4461);}_0x215cc8[_0xd8f3af][_0x1986('0x73')]&&_0x53b79[_0x1986('0x35')](_0x7c4461,_0x215cc8[_0xd8f3af][_0x1986('0x73')]===_0x1986('0x74')?![]:!![]);_0x53b79[_0x1986('0x6e')](_0x7c4461,_0x215cc8[_0xd8f3af][_0x1986('0x75')]||_0x7c4461);}if(_0x45b229['joins']){_0x45b229[_0x1986('0x76')]=JSON['parse'](_0x45b229[_0x1986('0x76')]);for(var _0x38f0f8=0x0;_0x38f0f8<_0x45b229[_0x1986('0x76')][_0x1986('0x32')];_0x38f0f8+=0x1){if(_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x2b')]&&_[_0x1986('0x5e')](_0x176e87,_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x2b')])&&_0x45b229['joins'][_0x38f0f8][_0x1986('0x77')]&&_0x45b229[_0x1986('0x76')][_0x38f0f8]['foreignTable']&&_0x45b229[_0x1986('0x76')][_0x38f0f8]['foreignKey']){_0x53b79[_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x2b')]](_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x78')],null,util[_0x1986('0x71')]('%s.%s\x20=\x20%s.%s',_0x45b229[_0x1986('0x6c')],_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x77')],_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x78')],_0x45b229[_0x1986('0x76')][_0x38f0f8][_0x1986('0x79')]));}}}if(_0x45b229[_0x1986('0x7a')]){_0x45b229['conditions']=JSON[_0x1986('0x87')](_0x45b229['conditions']);_0x53b79['where'](_0x59475d(_0x45b229[_0x1986('0x7a')]['group']));}_0x2aba06=_0x53b79[_0x1986('0x7b')]();_0x53b79['limit'](_0x4bd264);_0x53b79['offset'](0x0);return;}})[_0x1986('0x1f')](function(){if(_0x294ba5[_0x1986('0x88')]===_0x1986('0x89')){return null;}var _0x4e1521=_[_0x1986('0x3b')](_0x294ba5,{'name':_0x294ba5['fullPath']||_0x294ba5[_0x1986('0x25')]||_0x45b229[_0x1986('0x25')],'basename':_0xb2827f,'savename':util[_0x1986('0x71')](_0x1986('0x8a'),_0x294ba5['name']||_0x45b229[_0x1986('0x25')],require('randomstring')[_0x1986('0x8b')](0x4),_0x294ba5['output']||_0x1986('0x8c')),'reportId':_0x45b229['id'],'reportType':_0x1986('0x8d')});return db['AnalyticExtractedReport']['create'](_0x4e1521,{'raw':!![]});})['then'](function(_0x3a91e3){if(_0x45b229['table']===_0x1986('0x8e')){_0x2aba06[_0x1986('0x37')](_0x45b229[_0x1986('0x6c')]+_0x1986('0x8f'),_0x294ba5['startDate'],_0x294ba5[_0x1986('0x90')]);}else{_0x2aba06[_0x1986('0x37')](_0x45b229[_0x1986('0x6c')]+_0x1986('0x91'),_0x294ba5[_0x1986('0x92')],_0x294ba5[_0x1986('0x90')]);}if(_0x3a91e3){logger['info'](_0x1986('0x93'),_0x2aba06['toString']());require(_0x1986('0x94'))[_0x1986('0x95')](path[_0x1986('0x81')](__dirname,_0x1986('0x96'),_0x3a91e3[_0x1986('0x88')]),[_0x3a91e3['id'],_0x2aba06[_0x1986('0x7d')](),path[_0x1986('0x81')](__dirname,_0x1986('0x97'),_0x3a91e3[_0x1986('0x98')]),_0xb2827f]);return _0x3a91e3;}else{var _0x45f007=squel[_0x1986('0x6a')]();_0x45f007[_0x1986('0x6b')]('('+_0x2aba06[_0x1986('0x7d')]()+')',_0x1986('0x99'));_0x45f007['field']('COUNT(*)',_0x1986('0x3c'));_0x2aba06['limit'](_0x294ba5['limit']||_0x4bd264);_0x2aba06[_0x1986('0x18')](_0x294ba5[_0x1986('0x18')]||0x0);return dbH['sequelize'][_0x1986('0x2d')](_0x45f007[_0x1986('0x7d')](),{'type':dbH['sequelize'][_0x1986('0x7f')][_0x1986('0x80')]})[_0x1986('0x1f')](function(_0x23a26d){if(!_0x23a26d[_0x1986('0x32')]){_0x49f461=0x0;}else{_0x49f461=_0x23a26d[0x0][_0x1986('0x3c')]||0x0;}return dbH[_0x1986('0x7e')][_0x1986('0x2d')](_0x2aba06[_0x1986('0x7d')](),{'type':dbH[_0x1986('0x7e')][_0x1986('0x7f')]['SELECT']});})['then'](function(_0x3a9326){return{'rows':_0x3a9326||[],'count':_0x49f461};});}});}exports[_0x1986('0x9a')]=function(_0x5e49cd,_0x336989){return runReport(_0x5e49cd['params'],_0x5e49cd[_0x1986('0x2d')],_0x5e49cd[_0x1986('0x43')])[_0x1986('0x1f')](respondWithResult(_0x336989,null))[_0x1986('0x44')](handleError(_0x336989,null));};exports[_0x1986('0x9b')]=runReport;exports['query']=function(_0x289f44,_0x2abb17){var _0x427436=0xa;var _0x4e5536=[_0x1986('0x81'),'left_join',_0x1986('0x50'),_0x1986('0x51')];var _0x3b5d94={'SUM':_0x1986('0x52'),'COUNT':_0x1986('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1986('0x55'),'MIN':_0x1986('0x56'),'AVG':_0x1986('0x57'),'GROUP_CONCAT':_0x1986('0x58'),'GROUP_CONCAT ASC':_0x1986('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x484921={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x1986('0x5c'),'ROUND':_0x1986('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a2fbf=function(_0x436ac7){return!_[_0x1986('0x5e')]([_0x1986('0x5f'),_0x1986('0x84'),_0x1986('0x60'),'IS\x20NOT\x20EMPTY'],_0x436ac7);};var _0x3e3954=function(_0xde0b36){if(!_0xde0b36||!_0xde0b36[_0x1986('0x62')][_0x1986('0x32')]){return'';}for(var _0xa8d027='(',_0x33ceb5=0x0;_0x33ceb5<_0xde0b36[_0x1986('0x62')]['length'];_0x33ceb5+=0x1){_0x33ceb5>0x0&&(_0xa8d027+='\x20'+_0xde0b36['operator']+'\x20');_0xa8d027+=_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x64')]?_0x3e3954(_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x64')]):_0xde0b36['rules'][_0x33ceb5]['field']+'\x20'+_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x65')]+(_0x5a2fbf(_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x65')])?'\x20'+_0xde0b36[_0x1986('0x62')][_0x33ceb5][_0x1986('0x66')]:'');}return _0xa8d027+')';};var _0x1f2bfd={'where':{'id':_0x289f44[_0x1986('0x41')]['id']}},_0x556a57,_0x23f651,_0x1c6829,_0x3904d0,_0x460101;_0x1f2bfd=_[_0x1986('0x3b')]({},_0x1f2bfd,_0x289f44[_0x1986('0x43')]);return db[_0x1986('0x28')]['find'](_0x1f2bfd)[_0x1986('0x1f')](function(_0x49ba23){if(_0x49ba23){_0x556a57=_0x49ba23;return _0x49ba23['getFields']();}return null;})[_0x1986('0x1f')](function(_0x477f69){if(_0x477f69){if(!_0x477f69[_0x1986('0x32')]){throw new db['Sequelize']['ValidationErrorItem'](_0x1986('0x68'),0x193);}_0x23f651=_0x477f69;return db[_0x1986('0x69')][_0x1986('0x3e')]({'raw':!![]});}return null;})[_0x1986('0x1f')](function(_0x32fd04){if(_0x32fd04){_0x1c6829=_['keyBy'](_0x32fd04,'id');var _0x2d42f5;var _0x509b86=squel[_0x1986('0x6a')]();_0x509b86['from'](_0x556a57[_0x1986('0x6c')]);for(var _0x43d860=0x0;_0x43d860<_0x23f651[_0x1986('0x32')];_0x43d860+=0x1){_0x2d42f5=_0x23f651[_0x43d860][_0x1986('0x6d')]?_0x1c6829[_0x23f651[_0x43d860]['MetricId']][_0x1986('0x86')]:_0x23f651[_0x43d860][_0x1986('0x6e')];_0x2d42f5=_0x23f651[_0x43d860]['function']?_[_0x1986('0x70')](_0x3b5d94[_0x23f651[_0x43d860][_0x1986('0x6f')]],'%s',_0x2d42f5):_0x2d42f5;_0x2d42f5=_0x23f651[_0x43d860]['format']?_[_0x1986('0x70')](_0x484921[_0x23f651[_0x43d860]['format']],'%s',_0x2d42f5):_0x2d42f5;if(_0x23f651[_0x43d860][_0x1986('0x72')]){_0x509b86['group'](_0x2d42f5);}_0x23f651[_0x43d860][_0x1986('0x73')]&&_0x509b86[_0x1986('0x35')](_0x2d42f5,_0x23f651[_0x43d860][_0x1986('0x73')]===_0x1986('0x74')?![]:!![]);_0x509b86['field'](_0x2d42f5,_0x23f651[_0x43d860][_0x1986('0x75')]||_0x2d42f5);}if(_0x556a57['joins']){_0x556a57[_0x1986('0x76')]=JSON['parse'](_0x556a57[_0x1986('0x76')]);for(var _0xf03ab=0x0;_0xf03ab<_0x556a57[_0x1986('0x76')][_0x1986('0x32')];_0xf03ab+=0x1){if(_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x2b')]&&_[_0x1986('0x5e')](_0x4e5536,_0x556a57[_0x1986('0x76')][_0xf03ab]['type'])&&_0x556a57[_0x1986('0x76')][_0xf03ab]['parentKey']&&_0x556a57['joins'][_0xf03ab]['foreignTable']&&_0x556a57[_0x1986('0x76')][_0xf03ab]['foreignKey']){_0x509b86[_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x2b')]](_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x78')],null,util[_0x1986('0x71')](_0x1986('0x9c'),_0x556a57['table'],_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x77')],_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x78')],_0x556a57[_0x1986('0x76')][_0xf03ab][_0x1986('0x79')]));}}}if(_0x556a57['conditions']){_0x556a57[_0x1986('0x7a')]=JSON['parse'](_0x556a57[_0x1986('0x7a')]);_0x509b86['where'](_0x3e3954(_0x556a57['conditions'][_0x1986('0x64')]));}_0x460101=_0x509b86[_0x1986('0x7b')]();_0x509b86[_0x1986('0x1a')](_0x427436);_0x509b86['offset'](0x0);logger[_0x1986('0x9d')](_0x1986('0x7c'),_0x509b86[_0x1986('0x7d')]());return dbH[_0x1986('0x7e')][_0x1986('0x2d')](_0x509b86[_0x1986('0x7d')](),{'type':dbH['sequelize'][_0x1986('0x7f')][_0x1986('0x80')]});}})[_0x1986('0x1f')](function(){return{'sql':_0x460101['toString']()};})['then'](respondWithResult(_0x2abb17,null))[_0x1986('0x44')](handleError(_0x2abb17,null));}; \ No newline at end of file +var _0x6f59=['rawAttributes','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','field','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','table','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','join','right_join','AVG(%s)','ROUND(%s)','keyBy','output','web','fullPath','generate','custom','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','SELECT','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../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','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x6f59,0x1be));var _0x96f5=function(_0x3105a9,_0x446acf){_0x3105a9=_0x3105a9-0x0;var _0xe366aa=_0x6f59[_0x3105a9];return _0xe366aa;};'use strict';var emlformat=require(_0x96f5('0x0'));var rimraf=require(_0x96f5('0x1'));var zipdir=require(_0x96f5('0x2'));var jsonpatch=require(_0x96f5('0x3'));var rp=require(_0x96f5('0x4'));var moment=require(_0x96f5('0x5'));var BPromise=require(_0x96f5('0x6'));var Mustache=require(_0x96f5('0x7'));var util=require(_0x96f5('0x8'));var path=require(_0x96f5('0x9'));var sox=require(_0x96f5('0xa'));var csv=require(_0x96f5('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96f5('0xc'));var _=require('lodash');var squel=require(_0x96f5('0xd'));var crypto=require('crypto');var jsforce=require(_0x96f5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x96f5('0xb'));var querystring=require(_0x96f5('0xf'));var Papa=require(_0x96f5('0x10'));var Redis=require(_0x96f5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x96f5('0x12'));var as=require(_0x96f5('0x13'));var hardwareService=require(_0x96f5('0x14'));var logger=require(_0x96f5('0x15'))(_0x96f5('0x16'));var utils=require(_0x96f5('0x17'));var config=require(_0x96f5('0x18'));var licenseUtil=require(_0x96f5('0x19'));var db=require(_0x96f5('0x1a'))['db'];var dbH=require(_0x96f5('0x1a'))[_0x96f5('0x1b')];function respondWithStatusCode(_0x24a490,_0x150149){_0x150149=_0x150149||0xcc;return function(_0x4c95f4){if(_0x4c95f4){return _0x24a490[_0x96f5('0x1c')](_0x150149);}return _0x24a490[_0x96f5('0x1d')](_0x150149)[_0x96f5('0x1e')]();};}function respondWithResult(_0x3c13fc,_0x410bf2){_0x410bf2=_0x410bf2||0xc8;return function(_0x1f40e6){if(_0x1f40e6){return _0x3c13fc['status'](_0x410bf2)[_0x96f5('0x1f')](_0x1f40e6);}};}function respondWithFilteredResult(_0x5b2017,_0x3f6dcf){return function(_0x397657){if(_0x397657){var _0x2006fb=typeof _0x3f6dcf[_0x96f5('0x20')]===_0x96f5('0x21')&&typeof _0x3f6dcf['limit']===_0x96f5('0x21');var _0x4f19c3=_0x397657[_0x96f5('0x22')];var _0x5b6d40=_0x2006fb?0x0:_0x3f6dcf[_0x96f5('0x20')];var _0x33f7d7=_0x2006fb?_0x397657['count']:_0x3f6dcf[_0x96f5('0x20')]+_0x3f6dcf['limit'];var _0xa14bca;if(_0x33f7d7>=_0x4f19c3){_0x33f7d7=_0x4f19c3;_0xa14bca=0xc8;}else{_0xa14bca=0xce;}_0x5b2017['status'](_0xa14bca);return _0x5b2017[_0x96f5('0x23')](_0x96f5('0x24'),_0x5b6d40+'-'+_0x33f7d7+'/'+_0x4f19c3)['json'](_0x397657);}return null;};}function patchUpdates(_0x6b17c0){return function(_0x1c1aa3){try{jsonpatch[_0x96f5('0x25')](_0x1c1aa3,_0x6b17c0,!![]);}catch(_0x470c5d){return BPromise[_0x96f5('0x26')](_0x470c5d);}return _0x1c1aa3[_0x96f5('0x27')]();};}function saveUpdates(_0x399f14,_0x416190){return function(_0x250287){if(_0x250287){return _0x250287[_0x96f5('0x28')](_0x399f14)[_0x96f5('0x29')](function(_0x4bac26){return _0x4bac26;});}return null;};}function removeEntity(_0x119fd3,_0x5619c9){return function(_0x89f78d){if(_0x89f78d){return _0x89f78d[_0x96f5('0x2a')]()[_0x96f5('0x29')](function(){var _0x314917=_0x89f78d[_0x96f5('0x2b')]({'plain':!![]});var _0x59535d=_0x96f5('0x2c');return db['UserProfileResource'][_0x96f5('0x2a')]({'where':{'type':_0x59535d,'resourceId':_0x314917['id']}})[_0x96f5('0x29')](function(){return _0x89f78d;});})[_0x96f5('0x29')](function(){_0x119fd3[_0x96f5('0x1d')](0xcc)[_0x96f5('0x1e')]();});}};}function handleEntityNotFound(_0x481328,_0x3222c1){return function(_0x2c2eca){if(!_0x2c2eca){_0x481328['sendStatus'](0x194);}return _0x2c2eca;};}function handleError(_0x5a8bb8,_0x53d715){_0x53d715=_0x53d715||0x1f4;return function(_0x55b641){logger[_0x96f5('0x2d')](_0x55b641[_0x96f5('0x2e')]);if(_0x55b641[_0x96f5('0x2f')]){delete _0x55b641['name'];}_0x5a8bb8['status'](_0x53d715)[_0x96f5('0x30')](_0x55b641);};}exports[_0x96f5('0x31')]=function(_0x381129,_0x2320e2){var _0x48ba78={},_0xf9910d={},_0x42b417={'count':0x0,'rows':[]};var _0x597294=_[_0x96f5('0x32')](db[_0x96f5('0x33')][_0x96f5('0x34')],function(_0x5145a6){return{'name':_0x5145a6['fieldName'],'type':_0x5145a6['type']['key']};});_0xf9910d['model']=_[_0x96f5('0x32')](_0x597294,_0x96f5('0x2f'));_0xf9910d[_0x96f5('0x35')]=_[_0x96f5('0x36')](_0x381129['query']);_0xf9910d['filters']=_[_0x96f5('0x37')](_0xf9910d['model'],_0xf9910d[_0x96f5('0x35')]);_0x48ba78[_0x96f5('0x38')]=_[_0x96f5('0x37')](_0xf9910d[_0x96f5('0x39')],qs['fields'](_0x381129['query'][_0x96f5('0x3a')]));_0x48ba78[_0x96f5('0x38')]=_0x48ba78[_0x96f5('0x38')][_0x96f5('0x3b')]?_0x48ba78[_0x96f5('0x38')]:_0xf9910d[_0x96f5('0x39')];if(!_0x381129[_0x96f5('0x35')][_0x96f5('0x3c')]('nolimit')){_0x48ba78[_0x96f5('0x3d')]=qs['limit'](_0x381129[_0x96f5('0x35')][_0x96f5('0x3d')]);_0x48ba78[_0x96f5('0x20')]=qs['offset'](_0x381129[_0x96f5('0x35')][_0x96f5('0x20')]);}_0x48ba78[_0x96f5('0x3e')]=qs[_0x96f5('0x3f')](_0x381129['query'][_0x96f5('0x3f')]);_0x48ba78[_0x96f5('0x40')]=qs['filters'](_['pick'](_0x381129[_0x96f5('0x35')],_0xf9910d[_0x96f5('0x41')]),_0x597294);if(_0x381129[_0x96f5('0x35')][_0x96f5('0x42')]){_0x48ba78[_0x96f5('0x40')]=_[_0x96f5('0x43')](_0x48ba78[_0x96f5('0x40')],{'$or':_[_0x96f5('0x32')](_0x597294,function(_0x104076){if(_0x104076[_0x96f5('0x44')]!==_0x96f5('0x45')){var _0xafe28d={};_0xafe28d[_0x104076[_0x96f5('0x2f')]]={'$like':'%'+_0x381129[_0x96f5('0x35')][_0x96f5('0x42')]+'%'};return _0xafe28d;}})});}_0x48ba78=_[_0x96f5('0x43')]({},_0x48ba78,_0x381129[_0x96f5('0x46')]);var _0x40a10f={'where':_0x48ba78['where']};return db[_0x96f5('0x33')][_0x96f5('0x22')](_0x40a10f)[_0x96f5('0x29')](function(_0x4980b1){_0x42b417['count']=_0x4980b1;if(_0x381129[_0x96f5('0x35')]['includeAll']){_0x48ba78[_0x96f5('0x47')]=[{'all':!![]}];}return db[_0x96f5('0x33')][_0x96f5('0x48')](_0x48ba78);})[_0x96f5('0x29')](function(_0x1b355d){_0x42b417[_0x96f5('0x49')]=_0x1b355d;return _0x42b417;})['then'](respondWithFilteredResult(_0x2320e2,_0x48ba78))[_0x96f5('0x4a')](handleError(_0x2320e2,null));};exports[_0x96f5('0x4b')]=function(_0x3aae10,_0x26bd56){var _0xc64b25={'raw':![],'where':{'id':_0x3aae10[_0x96f5('0x4c')]['id']}},_0x5a7fca={};_0x5a7fca['model']=_[_0x96f5('0x36')](db[_0x96f5('0x33')][_0x96f5('0x34')]);_0x5a7fca[_0x96f5('0x35')]=_[_0x96f5('0x36')](_0x3aae10['query']);_0x5a7fca[_0x96f5('0x41')]=_[_0x96f5('0x37')](_0x5a7fca[_0x96f5('0x39')],_0x5a7fca['query']);_0xc64b25[_0x96f5('0x38')]=_[_0x96f5('0x37')](_0x5a7fca[_0x96f5('0x39')],qs['fields'](_0x3aae10[_0x96f5('0x35')]['fields']));_0xc64b25['attributes']=_0xc64b25['attributes'][_0x96f5('0x3b')]?_0xc64b25[_0x96f5('0x38')]:_0x5a7fca[_0x96f5('0x39')];if(_0x3aae10[_0x96f5('0x35')][_0x96f5('0x4d')]){_0xc64b25[_0x96f5('0x47')]=[{'all':!![]}];}_0xc64b25=_[_0x96f5('0x43')]({},_0xc64b25,_0x3aae10[_0x96f5('0x46')]);return db['AnalyticCustomReport'][_0x96f5('0x4e')](_0xc64b25)[_0x96f5('0x29')](handleEntityNotFound(_0x26bd56,null))[_0x96f5('0x29')](respondWithResult(_0x26bd56,null))[_0x96f5('0x4a')](handleError(_0x26bd56,null));};exports[_0x96f5('0x4f')]=function(_0x50f7f9,_0x44f938){return db[_0x96f5('0x33')]['create'](_0x50f7f9[_0x96f5('0x50')],{})[_0x96f5('0x29')](function(_0x3d56c2){var _0x48fd29=_0x50f7f9[_0x96f5('0x51')][_0x96f5('0x2b')]({'plain':!![]});if(!_0x48fd29)throw new Error(_0x96f5('0x52'));if(_0x48fd29['role']==='user'){var _0x5cad59=_0x3d56c2[_0x96f5('0x2b')]({'plain':!![]});var _0xa6b6ec=_0x96f5('0x53');return db[_0x96f5('0x54')]['find']({'where':{'name':_0xa6b6ec,'userProfileId':_0x48fd29[_0x96f5('0x55')]},'raw':!![]})['then'](function(_0x219c8d){if(_0x219c8d&&_0x219c8d[_0x96f5('0x56')]===0x0){return db[_0x96f5('0x57')][_0x96f5('0x4f')]({'name':_0x5cad59[_0x96f5('0x2f')],'resourceId':_0x5cad59['id'],'type':_0x96f5('0x2c'),'sectionId':_0x219c8d['id']},{})[_0x96f5('0x29')](function(){return _0x3d56c2;});}else{return _0x3d56c2;}})['catch'](function(_0x1303de){logger[_0x96f5('0x2d')](_0x96f5('0x58'),_0x1303de);throw _0x1303de;});}return _0x3d56c2;})[_0x96f5('0x29')](respondWithResult(_0x44f938,0xc9))['catch'](handleError(_0x44f938,null));};exports['update']=function(_0x8a9d5c,_0x2360c0){if(_0x8a9d5c['body']['id']){delete _0x8a9d5c[_0x96f5('0x50')]['id'];}return db[_0x96f5('0x33')][_0x96f5('0x4e')]({'where':{'id':_0x8a9d5c['params']['id']}})['then'](handleEntityNotFound(_0x2360c0,null))['then'](saveUpdates(_0x8a9d5c['body'],null))[_0x96f5('0x29')](respondWithResult(_0x2360c0,null))['catch'](handleError(_0x2360c0,null));};exports[_0x96f5('0x2a')]=function(_0x40299f,_0x30a805){return db['AnalyticCustomReport']['find']({'where':{'id':_0x40299f[_0x96f5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x30a805,null))[_0x96f5('0x29')](removeEntity(_0x30a805,null))[_0x96f5('0x4a')](handleError(_0x30a805,null));};exports[_0x96f5('0x59')]=function(_0x1acb81,_0x432a3c){var _0x476a5e=0xa;var _0x584e47=['join',_0x96f5('0x5a'),'right_join',_0x96f5('0x5b')];var _0xff3aec={'SUM':_0x96f5('0x5c'),'COUNT':_0x96f5('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x96f5('0x5e'),'MIN':_0x96f5('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x96f5('0x60'),'GROUP_CONCAT ASC':_0x96f5('0x61'),'GROUP_CONCAT DESC':_0x96f5('0x62')};var _0x5471ff={'SEC_TO_TIME':_0x96f5('0x63'),'DATE':_0x96f5('0x64'),'HOUR':_0x96f5('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x96f5('0x66')};var _0x57df5f=function(_0x197998){return!_[_0x96f5('0x67')]([_0x96f5('0x68'),_0x96f5('0x69'),_0x96f5('0x6a'),_0x96f5('0x6b')],_0x197998);};var _0x436d1f=function(_0x212a43){if(!_0x212a43||!_0x212a43['rules'][_0x96f5('0x3b')]){return'';}for(var _0x4629f0='(',_0x345c74=0x0;_0x345c74<_0x212a43[_0x96f5('0x6c')][_0x96f5('0x3b')];_0x345c74+=0x1){_0x345c74>0x0&&(_0x4629f0+='\x20'+_0x212a43[_0x96f5('0x6d')]+'\x20');_0x4629f0+=_0x212a43[_0x96f5('0x6c')][_0x345c74][_0x96f5('0x6e')]?_0x436d1f(_0x212a43[_0x96f5('0x6c')][_0x345c74][_0x96f5('0x6e')]):_0x212a43[_0x96f5('0x6c')][_0x345c74]['field']+'\x20'+_0x212a43[_0x96f5('0x6c')][_0x345c74]['condition']+(_0x57df5f(_0x212a43[_0x96f5('0x6c')][_0x345c74][_0x96f5('0x6f')])?'\x20'+_0x212a43[_0x96f5('0x6c')][_0x345c74][_0x96f5('0x70')]:'');}return _0x4629f0+')';};var _0x4841b5={'where':{'id':_0x1acb81['params']['id']}},_0x47205b,_0xf58cd3,_0x43b600,_0x593181,_0x44f8f2;_0x4841b5=_['merge']({},_0x4841b5,_0x1acb81[_0x96f5('0x46')]);return db['AnalyticCustomReport']['find'](_0x4841b5)[_0x96f5('0x29')](function(_0x495f29){if(_0x495f29){_0x47205b=_0x495f29;return _0x495f29[_0x96f5('0x71')]();}return null;})['then'](function(_0x4f682f){if(_0x4f682f){if(!_0x4f682f['length']){throw new db[(_0x96f5('0x72'))][(_0x96f5('0x73'))](_0x96f5('0x74'),0x193);}_0xf58cd3=_0x4f682f;return db[_0x96f5('0x75')][_0x96f5('0x48')]({'raw':!![]});}return null;})[_0x96f5('0x29')](function(_0x460df9){if(_0x460df9){_0x43b600=_['keyBy'](_0x460df9,'id');var _0x5b26e2;var _0x1fccc1=squel[_0x96f5('0x76')]();_0x1fccc1[_0x96f5('0x77')](_0x47205b['table']);for(var _0x5491b4=0x0;_0x5491b4<_0xf58cd3[_0x96f5('0x3b')];_0x5491b4+=0x1){_0x5b26e2=_0xf58cd3[_0x5491b4][_0x96f5('0x78')]?_0x43b600[_0xf58cd3[_0x5491b4][_0x96f5('0x78')]][_0x96f5('0x79')]:_0xf58cd3[_0x5491b4][_0x96f5('0x7a')];_0x5b26e2=_0xf58cd3[_0x5491b4][_0x96f5('0x7b')]?_['replace'](_0xff3aec[_0xf58cd3[_0x5491b4][_0x96f5('0x7b')]],'%s',_0x5b26e2):_0x5b26e2;_0x5b26e2=_0xf58cd3[_0x5491b4][_0x96f5('0x7c')]?_[_0x96f5('0x7d')](_0x5471ff[_0xf58cd3[_0x5491b4][_0x96f5('0x7c')]],'%s',_0x5b26e2):_0x5b26e2;if(_0xf58cd3[_0x5491b4][_0x96f5('0x7e')]){_0x1fccc1[_0x96f5('0x6e')](_0x5b26e2);}_0xf58cd3[_0x5491b4][_0x96f5('0x7f')]&&_0x1fccc1['order'](_0x5b26e2,_0xf58cd3[_0x5491b4][_0x96f5('0x7f')]===_0x96f5('0x80')?![]:!![]);_0x1fccc1[_0x96f5('0x7a')](_0x5b26e2,_0xf58cd3[_0x5491b4][_0x96f5('0x81')]||_0x5b26e2);}if(_0x47205b[_0x96f5('0x82')]){_0x47205b['joins']=JSON[_0x96f5('0x83')](_0x47205b['joins']);for(var _0x21a25c=0x0;_0x21a25c<_0x47205b[_0x96f5('0x82')][_0x96f5('0x3b')];_0x21a25c+=0x1){if(_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x44')]&&_[_0x96f5('0x67')](_0x584e47,_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x44')])&&_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x84')]&&_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x85')]&&_0x47205b[_0x96f5('0x82')][_0x21a25c]['foreignKey']){_0x1fccc1[_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x44')]](_0x47205b['joins'][_0x21a25c][_0x96f5('0x85')],null,util[_0x96f5('0x7c')]('%s.%s\x20=\x20%s.%s',_0x47205b[_0x96f5('0x86')],_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x84')],_0x47205b[_0x96f5('0x82')][_0x21a25c]['foreignTable'],_0x47205b[_0x96f5('0x82')][_0x21a25c][_0x96f5('0x87')]));}}}if(_0x47205b[_0x96f5('0x88')]){_0x47205b[_0x96f5('0x88')]=JSON[_0x96f5('0x83')](_0x47205b[_0x96f5('0x88')]);_0x1fccc1[_0x96f5('0x40')](_0x436d1f(_0x47205b[_0x96f5('0x88')][_0x96f5('0x6e')]));}_0x44f8f2=_0x1fccc1[_0x96f5('0x89')]();_0x1fccc1[_0x96f5('0x3d')](_0x476a5e);_0x1fccc1[_0x96f5('0x20')](0x0);logger[_0x96f5('0x8a')](_0x96f5('0x8b'),_0x1fccc1[_0x96f5('0x8c')]());return dbH[_0x96f5('0x8d')][_0x96f5('0x35')](_0x1fccc1[_0x96f5('0x8c')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x432a3c,null))[_0x96f5('0x4a')](handleError(_0x432a3c,null));};function runReport(_0x4cddf5,_0x35b447,_0xcda127){var _0xd42075=_0x35b447[_0x96f5('0x2f')];var _0x5c96e9=0xa;var _0x5cd842=[_0x96f5('0x8e'),_0x96f5('0x5a'),_0x96f5('0x8f'),_0x96f5('0x5b')];var _0x5f061a={'SUM':_0x96f5('0x5c'),'COUNT':_0x96f5('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x96f5('0x5e'),'MIN':_0x96f5('0x5f'),'AVG':_0x96f5('0x90'),'GROUP_CONCAT':_0x96f5('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1496c1={'SEC_TO_TIME':_0x96f5('0x63'),'DATE':_0x96f5('0x64'),'HOUR':_0x96f5('0x65'),'ROUND':_0x96f5('0x91'),'UNIX_TIMESTAMP':_0x96f5('0x66')};var _0x3677fb=function(_0x54ba78){return!_[_0x96f5('0x67')](['IS\x20NULL',_0x96f5('0x69'),'IS\x20EMPTY',_0x96f5('0x6b')],_0x54ba78);};var _0x1253cb=function(_0x42729d){if(!_0x42729d||!_0x42729d['rules'][_0x96f5('0x3b')]){return'';}for(var _0x6a7a1='(',_0xe973da=0x0;_0xe973da<_0x42729d[_0x96f5('0x6c')]['length'];_0xe973da+=0x1){_0xe973da>0x0&&(_0x6a7a1+='\x20'+_0x42729d[_0x96f5('0x6d')]+'\x20');_0x6a7a1+=_0x42729d[_0x96f5('0x6c')][_0xe973da]['group']?_0x1253cb(_0x42729d['rules'][_0xe973da][_0x96f5('0x6e')]):_0x42729d[_0x96f5('0x6c')][_0xe973da][_0x96f5('0x7a')]+'\x20'+_0x42729d[_0x96f5('0x6c')][_0xe973da][_0x96f5('0x6f')]+(_0x3677fb(_0x42729d[_0x96f5('0x6c')][_0xe973da]['condition'])?'\x20'+_0x42729d[_0x96f5('0x6c')][_0xe973da]['value']:'');}return _0x6a7a1+')';};var _0x318070={'where':{'id':_0x4cddf5['id']}},_0xf45bae,_0x31feb6,_0x27749f,_0x1ffd03,_0x5ad0af;_0x318070=_['merge']({},_0x318070,_0xcda127);return db[_0x96f5('0x33')][_0x96f5('0x4e')](_0x318070)[_0x96f5('0x29')](function(_0x2812a8){if(_0x2812a8){_0xf45bae=_0x2812a8;return _0x2812a8[_0x96f5('0x71')]();}return null;})[_0x96f5('0x29')](function(_0xa904a7){if(_0xa904a7){if(!_0xa904a7['length']){throw new db[(_0x96f5('0x72'))][(_0x96f5('0x73'))](_0x96f5('0x74'),0x193);}_0x31feb6=_0xa904a7;return db[_0x96f5('0x75')][_0x96f5('0x48')]({'raw':!![]});}return null;})[_0x96f5('0x29')](function(_0x521ce4){if(_0x521ce4){_0x27749f=_[_0x96f5('0x92')](_0x521ce4,'id');var _0x47fd50;var _0x27d085=squel[_0x96f5('0x76')]();_0x27d085[_0x96f5('0x77')](_0xf45bae[_0x96f5('0x86')]);for(var _0x1ee826=0x0;_0x1ee826<_0x31feb6['length'];_0x1ee826+=0x1){_0x47fd50=_0x31feb6[_0x1ee826][_0x96f5('0x78')]?_0x27749f[_0x31feb6[_0x1ee826][_0x96f5('0x78')]][_0x96f5('0x79')]:_0x31feb6[_0x1ee826][_0x96f5('0x7a')];_0x47fd50=_0x31feb6[_0x1ee826]['function']?_['replace'](_0x5f061a[_0x31feb6[_0x1ee826]['function']],'%s',_0x47fd50):_0x47fd50;_0x47fd50=_0x31feb6[_0x1ee826][_0x96f5('0x7c')]?_[_0x96f5('0x7d')](_0x1496c1[_0x31feb6[_0x1ee826][_0x96f5('0x7c')]],'%s',_0x47fd50):_0x47fd50;if(_0x31feb6[_0x1ee826][_0x96f5('0x7e')]){_0x27d085[_0x96f5('0x6e')](_0x47fd50);}_0x31feb6[_0x1ee826][_0x96f5('0x7f')]&&_0x27d085[_0x96f5('0x3e')](_0x47fd50,_0x31feb6[_0x1ee826][_0x96f5('0x7f')]===_0x96f5('0x80')?![]:!![]);_0x27d085[_0x96f5('0x7a')](_0x47fd50,_0x31feb6[_0x1ee826][_0x96f5('0x81')]||_0x47fd50);}if(_0xf45bae[_0x96f5('0x82')]){_0xf45bae[_0x96f5('0x82')]=JSON[_0x96f5('0x83')](_0xf45bae[_0x96f5('0x82')]);for(var _0x3f00d3=0x0;_0x3f00d3<_0xf45bae[_0x96f5('0x82')]['length'];_0x3f00d3+=0x1){if(_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x44')]&&_[_0x96f5('0x67')](_0x5cd842,_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x44')])&&_0xf45bae['joins'][_0x3f00d3][_0x96f5('0x84')]&&_0xf45bae['joins'][_0x3f00d3]['foreignTable']&&_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x87')]){_0x27d085[_0xf45bae[_0x96f5('0x82')][_0x3f00d3]['type']](_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x85')],null,util[_0x96f5('0x7c')]('%s.%s\x20=\x20%s.%s',_0xf45bae[_0x96f5('0x86')],_0xf45bae['joins'][_0x3f00d3][_0x96f5('0x84')],_0xf45bae[_0x96f5('0x82')][_0x3f00d3]['foreignTable'],_0xf45bae[_0x96f5('0x82')][_0x3f00d3][_0x96f5('0x87')]));}}}if(_0xf45bae[_0x96f5('0x88')]){_0xf45bae[_0x96f5('0x88')]=JSON[_0x96f5('0x83')](_0xf45bae[_0x96f5('0x88')]);_0x27d085[_0x96f5('0x40')](_0x1253cb(_0xf45bae[_0x96f5('0x88')][_0x96f5('0x6e')]));}_0x5ad0af=_0x27d085[_0x96f5('0x89')]();_0x27d085['limit'](_0x5c96e9);_0x27d085[_0x96f5('0x20')](0x0);return;}})[_0x96f5('0x29')](function(){if(_0x35b447[_0x96f5('0x93')]===_0x96f5('0x94')){return null;}var _0x2bb8a6=_[_0x96f5('0x43')](_0x35b447,{'name':_0x35b447[_0x96f5('0x95')]||_0x35b447[_0x96f5('0x2f')]||_0xf45bae[_0x96f5('0x2f')],'basename':_0xd42075,'savename':util['format']('%s-%s.%s',_0x35b447[_0x96f5('0x2f')]||_0xf45bae['name'],require('randomstring')[_0x96f5('0x96')](0x4),_0x35b447[_0x96f5('0x93')]||'csv'),'reportId':_0xf45bae['id'],'reportType':_0x96f5('0x97')});return db[_0x96f5('0x98')][_0x96f5('0x4f')](_0x2bb8a6,{'raw':!![]});})[_0x96f5('0x29')](function(_0x1bd0af){if(_0xf45bae[_0x96f5('0x86')]===_0x96f5('0x99')){_0x5ad0af[_0x96f5('0x40')](_0xf45bae[_0x96f5('0x86')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x35b447['startDate'],_0x35b447[_0x96f5('0x9a')]);}else{_0x5ad0af[_0x96f5('0x40')](_0xf45bae[_0x96f5('0x86')]+_0x96f5('0x9b'),_0x35b447[_0x96f5('0x9c')],_0x35b447['endDate']);}if(_0x1bd0af){logger['info'](_0x96f5('0x9d'),_0x5ad0af['toString']());require(_0x96f5('0x9e'))['fork'](path[_0x96f5('0x8e')](__dirname,_0x96f5('0x9f'),_0x1bd0af[_0x96f5('0x93')]),[_0x1bd0af['id'],_0x5ad0af[_0x96f5('0x8c')](),path[_0x96f5('0x8e')](__dirname,_0x96f5('0xa0'),_0x1bd0af['savename']),_0xd42075]);return _0x1bd0af;}else{var _0x14b477=squel['select']();_0x14b477[_0x96f5('0x77')]('('+_0x5ad0af[_0x96f5('0x8c')]()+')',_0x96f5('0xa1'));_0x14b477['field'](_0x96f5('0xa2'),'count');_0x5ad0af[_0x96f5('0x3d')](_0x35b447['limit']||_0x5c96e9);_0x5ad0af[_0x96f5('0x20')](_0x35b447['offset']||0x0);return dbH['sequelize'][_0x96f5('0x35')](_0x14b477[_0x96f5('0x8c')](),{'type':dbH[_0x96f5('0x8d')][_0x96f5('0xa3')][_0x96f5('0xa4')]})[_0x96f5('0x29')](function(_0x17733c){if(!_0x17733c[_0x96f5('0x3b')]){_0x1ffd03=0x0;}else{_0x1ffd03=_0x17733c[0x0][_0x96f5('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5ad0af['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x96f5('0x29')](function(_0x27409d){return{'rows':_0x27409d||[],'count':_0x1ffd03};});}});}exports['run']=function(_0xd1e20c,_0x4e48cf){return runReport(_0xd1e20c['params'],_0xd1e20c['query'],_0xd1e20c[_0x96f5('0x46')])['then'](respondWithResult(_0x4e48cf,null))[_0x96f5('0x4a')](handleError(_0x4e48cf,null));};exports[_0x96f5('0xa5')]=runReport;exports['query']=function(_0x12ec3b,_0x5b4809){var _0x2a1bd6=0xa;var _0x1560a3=[_0x96f5('0x8e'),'left_join',_0x96f5('0x8f'),'cross_join'];var _0x1b149f={'SUM':_0x96f5('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x96f5('0x5e'),'MIN':_0x96f5('0x5f'),'AVG':_0x96f5('0x90'),'GROUP_CONCAT':_0x96f5('0x60'),'GROUP_CONCAT ASC':_0x96f5('0x61'),'GROUP_CONCAT DESC':_0x96f5('0x62')};var _0x1b90eb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x96f5('0x64'),'HOUR':_0x96f5('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ae7c3=function(_0x39f9b6){return!_[_0x96f5('0x67')]([_0x96f5('0x68'),_0x96f5('0x69'),_0x96f5('0x6a'),'IS\x20NOT\x20EMPTY'],_0x39f9b6);};var _0x1ebee7=function(_0x82259d){if(!_0x82259d||!_0x82259d['rules'][_0x96f5('0x3b')]){return'';}for(var _0x1ec2f1='(',_0x3dbb90=0x0;_0x3dbb90<_0x82259d[_0x96f5('0x6c')][_0x96f5('0x3b')];_0x3dbb90+=0x1){_0x3dbb90>0x0&&(_0x1ec2f1+='\x20'+_0x82259d['operator']+'\x20');_0x1ec2f1+=_0x82259d[_0x96f5('0x6c')][_0x3dbb90]['group']?_0x1ebee7(_0x82259d['rules'][_0x3dbb90][_0x96f5('0x6e')]):_0x82259d['rules'][_0x3dbb90][_0x96f5('0x7a')]+'\x20'+_0x82259d[_0x96f5('0x6c')][_0x3dbb90][_0x96f5('0x6f')]+(_0x2ae7c3(_0x82259d[_0x96f5('0x6c')][_0x3dbb90]['condition'])?'\x20'+_0x82259d[_0x96f5('0x6c')][_0x3dbb90][_0x96f5('0x70')]:'');}return _0x1ec2f1+')';};var _0x5b775b={'where':{'id':_0x12ec3b['params']['id']}},_0x17c8bb,_0x481177,_0x12fd84,_0x4e001f,_0x14cb3d;_0x5b775b=_[_0x96f5('0x43')]({},_0x5b775b,_0x12ec3b[_0x96f5('0x46')]);return db[_0x96f5('0x33')]['find'](_0x5b775b)[_0x96f5('0x29')](function(_0x5dd03f){if(_0x5dd03f){_0x17c8bb=_0x5dd03f;return _0x5dd03f[_0x96f5('0x71')]();}return null;})[_0x96f5('0x29')](function(_0x3323f1){if(_0x3323f1){if(!_0x3323f1[_0x96f5('0x3b')]){throw new db[(_0x96f5('0x72'))][(_0x96f5('0x73'))](_0x96f5('0x74'),0x193);}_0x481177=_0x3323f1;return db[_0x96f5('0x75')][_0x96f5('0x48')]({'raw':!![]});}return null;})['then'](function(_0x4191d9){if(_0x4191d9){_0x12fd84=_[_0x96f5('0x92')](_0x4191d9,'id');var _0x42579d;var _0x289e9e=squel[_0x96f5('0x76')]();_0x289e9e['from'](_0x17c8bb['table']);for(var _0x285dd7=0x0;_0x285dd7<_0x481177[_0x96f5('0x3b')];_0x285dd7+=0x1){_0x42579d=_0x481177[_0x285dd7][_0x96f5('0x78')]?_0x12fd84[_0x481177[_0x285dd7][_0x96f5('0x78')]][_0x96f5('0x79')]:_0x481177[_0x285dd7][_0x96f5('0x7a')];_0x42579d=_0x481177[_0x285dd7][_0x96f5('0x7b')]?_[_0x96f5('0x7d')](_0x1b149f[_0x481177[_0x285dd7]['function']],'%s',_0x42579d):_0x42579d;_0x42579d=_0x481177[_0x285dd7][_0x96f5('0x7c')]?_[_0x96f5('0x7d')](_0x1b90eb[_0x481177[_0x285dd7][_0x96f5('0x7c')]],'%s',_0x42579d):_0x42579d;if(_0x481177[_0x285dd7][_0x96f5('0x7e')]){_0x289e9e[_0x96f5('0x6e')](_0x42579d);}_0x481177[_0x285dd7][_0x96f5('0x7f')]&&_0x289e9e[_0x96f5('0x3e')](_0x42579d,_0x481177[_0x285dd7][_0x96f5('0x7f')]==='DESC'?![]:!![]);_0x289e9e[_0x96f5('0x7a')](_0x42579d,_0x481177[_0x285dd7][_0x96f5('0x81')]||_0x42579d);}if(_0x17c8bb[_0x96f5('0x82')]){_0x17c8bb[_0x96f5('0x82')]=JSON[_0x96f5('0x83')](_0x17c8bb[_0x96f5('0x82')]);for(var _0xcaa43=0x0;_0xcaa43<_0x17c8bb['joins'][_0x96f5('0x3b')];_0xcaa43+=0x1){if(_0x17c8bb[_0x96f5('0x82')][_0xcaa43]['type']&&_[_0x96f5('0x67')](_0x1560a3,_0x17c8bb[_0x96f5('0x82')][_0xcaa43]['type'])&&_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x84')]&&_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x85')]&&_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x87')]){_0x289e9e[_0x17c8bb[_0x96f5('0x82')][_0xcaa43]['type']](_0x17c8bb['joins'][_0xcaa43][_0x96f5('0x85')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x17c8bb[_0x96f5('0x86')],_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x84')],_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x85')],_0x17c8bb[_0x96f5('0x82')][_0xcaa43][_0x96f5('0x87')]));}}}if(_0x17c8bb[_0x96f5('0x88')]){_0x17c8bb[_0x96f5('0x88')]=JSON[_0x96f5('0x83')](_0x17c8bb[_0x96f5('0x88')]);_0x289e9e['where'](_0x1ebee7(_0x17c8bb[_0x96f5('0x88')][_0x96f5('0x6e')]));}_0x14cb3d=_0x289e9e['clone']();_0x289e9e[_0x96f5('0x3d')](_0x2a1bd6);_0x289e9e['offset'](0x0);logger[_0x96f5('0x8a')](_0x96f5('0x8b'),_0x289e9e[_0x96f5('0x8c')]());return dbH[_0x96f5('0x8d')][_0x96f5('0x35')](_0x289e9e['toString'](),{'type':dbH[_0x96f5('0x8d')][_0x96f5('0xa3')][_0x96f5('0xa4')]});}})[_0x96f5('0x29')](function(){return{'sql':_0x14cb3d['toString']()};})['then'](respondWithResult(_0x5b4809,null))[_0x96f5('0x4a')](handleError(_0x5b4809,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 85963c3..7442291 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 _0x3cd2=['rimraf','./analyticCustomReport.attributes','analytics_custom_reports','lodash','util','api','bluebird','request-promise','path'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x3cd2,0x123));var _0x23cd=function(_0x484801,_0x4d274b){_0x484801=_0x484801-0x0;var _0x1b9cab=_0x3cd2[_0x484801];return _0x1b9cab;};'use strict';var _=require(_0x23cd('0x0'));var util=require(_0x23cd('0x1'));var logger=require('../../config/logger')(_0x23cd('0x2'));var moment=require('moment');var BPromise=require(_0x23cd('0x3'));var rp=require(_0x23cd('0x4'));var fs=require('fs');var path=require(_0x23cd('0x5'));var rimraf=require(_0x23cd('0x6'));var config=require('../../config/environment');var attributes=require(_0x23cd('0x7'));module['exports']=function(_0x38e02d,_0x1f8855){return _0x38e02d['define']('AnalyticCustomReport',attributes,{'tableName':_0x23cd('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe469=['exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','bluebird','path','../../config/environment','./analyticCustomReport.attributes'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xe469,0xed));var _0x9e46=function(_0x5986b5,_0x3e5444){_0x5986b5=_0x5986b5-0x0;var _0x4d8e00=_0xe469[_0x5986b5];return _0x4d8e00;};'use strict';var _=require(_0x9e46('0x0'));var util=require(_0x9e46('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9e46('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e46('0x3'));var rimraf=require('rimraf');var config=require(_0x9e46('0x4'));var attributes=require(_0x9e46('0x5'));module[_0x9e46('0x6')]=function(_0xf7edc8,_0x3198c5){return _0xf7edc8['define'](_0x9e46('0x7'),attributes,{'tableName':_0x9e46('0x8'),'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 6db8e31..6506d64 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 _0x8530=['error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x16aa51,_0x52542d){var _0xb84348=function(_0x2af546){while(--_0x2af546){_0x16aa51['push'](_0x16aa51['shift']());}};_0xb84348(++_0x52542d);}(_0x8530,0x87));var _0x0853=function(_0x344d81,_0x12ee66){_0x344d81=_0x344d81-0x0;var _0x491c16=_0x8530[_0x344d81];return _0x491c16;};'use strict';var _=require(_0x0853('0x0'));var util=require(_0x0853('0x1'));var moment=require(_0x0853('0x2'));var BPromise=require(_0x0853('0x3'));var rs=require(_0x0853('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0853('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0853('0x6'))(_0x0853('0x7'));var config=require(_0x0853('0x8'));var jayson=require(_0x0853('0x9'));var client=jayson[_0x0853('0xa')][_0x0853('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c5718,_0x328fde,_0x237a7d){return new BPromise(function(_0x1da2a7,_0x1ace24){return client[_0x0853('0xc')](_0x3c5718,_0x237a7d)[_0x0853('0xd')](function(_0x4d6df7){logger[_0x0853('0xe')](_0x0853('0xf'),_0x328fde,'request\x20sent');logger[_0x0853('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x328fde,_0x0853('0x11'),JSON[_0x0853('0x12')](_0x4d6df7));if(_0x4d6df7[_0x0853('0x13')]){if(_0x4d6df7[_0x0853('0x13')]['code']===0x1f4){logger['error'](_0x0853('0xf'),_0x328fde,_0x4d6df7[_0x0853('0x13')][_0x0853('0x14')]);return _0x1ace24(_0x4d6df7[_0x0853('0x13')]['message']);}logger[_0x0853('0x13')](_0x0853('0xf'),_0x328fde,_0x4d6df7[_0x0853('0x13')]['message']);return _0x1da2a7(_0x4d6df7['error'][_0x0853('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x328fde,_0x0853('0x11'));_0x1da2a7(_0x4d6df7['result'][_0x0853('0x14')]);}})[_0x0853('0x15')](function(_0x547542){logger[_0x0853('0x13')](_0x0853('0xf'),_0x328fde,_0x547542);_0x1ace24(_0x547542);});});} \ No newline at end of file +var _0x0a1d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','code','error','AnalyticCustomReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x0a1d,0x1ca));var _0xd0a1=function(_0x541f4f,_0xe378b3){_0x541f4f=_0x541f4f-0x0;var _0x24f033=_0x0a1d[_0x541f4f];return _0x24f033;};'use strict';var _=require('lodash');var util=require(_0xd0a1('0x0'));var moment=require(_0xd0a1('0x1'));var BPromise=require(_0xd0a1('0x2'));var rs=require(_0xd0a1('0x3'));var fs=require('fs');var Redis=require(_0xd0a1('0x4'));var db=require(_0xd0a1('0x5'))['db'];var utils=require(_0xd0a1('0x6'));var logger=require(_0xd0a1('0x7'))('rpc');var config=require(_0xd0a1('0x8'));var jayson=require(_0xd0a1('0x9'));var client=jayson[_0xd0a1('0xa')][_0xd0a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b8118,_0x4a8eeb,_0x130cf0){return new BPromise(function(_0x5824b3,_0x2d6954){return client[_0xd0a1('0xc')](_0x5b8118,_0x130cf0)['then'](function(_0x490011){logger[_0xd0a1('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4a8eeb,_0xd0a1('0xe'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4a8eeb,_0xd0a1('0xe'),JSON[_0xd0a1('0xf')](_0x490011));if(_0x490011['error']){if(_0x490011['error'][_0xd0a1('0x10')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4a8eeb,_0x490011['error']['message']);return _0x2d6954(_0x490011[_0xd0a1('0x11')]['message']);}logger[_0xd0a1('0x11')](_0xd0a1('0x12'),_0x4a8eeb,_0x490011[_0xd0a1('0x11')]['message']);return _0x5824b3(_0x490011[_0xd0a1('0x11')][_0xd0a1('0x13')]);}else{logger[_0xd0a1('0xd')](_0xd0a1('0x12'),_0x4a8eeb,_0xd0a1('0xe'));_0x5824b3(_0x490011['result'][_0xd0a1('0x13')]);}})[_0xd0a1('0x14')](function(_0x2b692a){logger['error'](_0xd0a1('0x12'),_0x4a8eeb,_0x2b692a);_0x2d6954(_0x2b692a);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 04c7051..2a4ab3b 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 _0x2654=['./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x5716a4,_0x376355){var _0x5fca0c=function(_0x57b67b){while(--_0x57b67b){_0x5716a4['push'](_0x5716a4['shift']());}};_0x5fca0c(++_0x376355);}(_0x2654,0x1de));var _0x4265=function(_0x489250,_0x5e9468){_0x489250=_0x489250-0x0;var _0x1283e5=_0x2654[_0x489250];return _0x1283e5;};'use strict';var multer=require(_0x4265('0x0'));var util=require(_0x4265('0x1'));var path=require('path');var timeout=require(_0x4265('0x2'));var express=require(_0x4265('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4265('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4265('0x5'));var controller=require(_0x4265('0x6'));router[_0x4265('0x7')]('/',auth[_0x4265('0x8')](),controller[_0x4265('0x9')]);router[_0x4265('0x7')](_0x4265('0xa'),auth[_0x4265('0x8')](),controller[_0x4265('0xb')]);router[_0x4265('0x7')](_0x4265('0xc'),auth[_0x4265('0x8')](),controller[_0x4265('0xd')]);router[_0x4265('0x7')](_0x4265('0xe'),auth[_0x4265('0x8')](),controller['run']);router[_0x4265('0x7')](_0x4265('0xf'),auth[_0x4265('0x8')](),controller[_0x4265('0x10')]);router[_0x4265('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4265('0x12')](_0x4265('0xa'),auth[_0x4265('0x8')](),controller[_0x4265('0x13')]);router[_0x4265('0x14')]('/:id',auth[_0x4265('0x8')](),controller[_0x4265('0x15')]);module['exports']=router; \ No newline at end of file +var _0x64ed=['destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete'];(function(_0x20b9c5,_0x309ac5){var _0x427a52=function(_0x24e1c0){while(--_0x24e1c0){_0x20b9c5['push'](_0x20b9c5['shift']());}};_0x427a52(++_0x309ac5);}(_0x64ed,0x136));var _0xd64e=function(_0x5c9e2d,_0x24a20a){_0x5c9e2d=_0x5c9e2d-0x0;var _0x2ed1a2=_0x64ed[_0x5c9e2d];return _0x2ed1a2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd64e('0x0'));var express=require('express');var router=express[_0xd64e('0x1')]();var fs_extra=require(_0xd64e('0x2'));var auth=require(_0xd64e('0x3'));var interaction=require(_0xd64e('0x4'));var config=require(_0xd64e('0x5'));var controller=require(_0xd64e('0x6'));router[_0xd64e('0x7')]('/',auth[_0xd64e('0x8')](),controller['index']);router[_0xd64e('0x7')]('/:id',auth[_0xd64e('0x8')](),controller[_0xd64e('0x9')]);router[_0xd64e('0x7')]('/:id/preview',auth[_0xd64e('0x8')](),controller[_0xd64e('0xa')]);router[_0xd64e('0x7')](_0xd64e('0xb'),auth[_0xd64e('0x8')](),controller[_0xd64e('0xc')]);router[_0xd64e('0x7')](_0xd64e('0xd'),auth[_0xd64e('0x8')](),controller[_0xd64e('0xe')]);router[_0xd64e('0xf')]('/',auth[_0xd64e('0x8')](),controller[_0xd64e('0x10')]);router[_0xd64e('0x11')]('/:id',auth[_0xd64e('0x8')](),controller[_0xd64e('0x12')]);router[_0xd64e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd64e('0x14')]);module[_0xd64e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 4f3ec99..8a737f4 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 _0x7c09=['exports','STRING','TEXT'];(function(_0x20dff6,_0x59f029){var _0x291097=function(_0xee329a){while(--_0xee329a){_0x20dff6['push'](_0x20dff6['shift']());}};_0x291097(++_0x59f029);}(_0x7c09,0x102));var _0x97c0=function(_0x548482,_0x1c13f9){_0x548482=_0x548482-0x0;var _0x5eb4f3=_0x7c09[_0x548482];return _0x5eb4f3;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file +var _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x40963d,_0x46b6f8){_0x40963d=_0x40963d-0x0;var _0x4d3959=_0x1cb9[_0x40963d];return _0x4d3959;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b72d2ff..5af4c17 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 _0xdbf5=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20EMPTY','ValidationErrorItem','metric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','run','Sequelize','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','end','status','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','update','join','left_join','right_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x28300e,_0x2fc7d7){_0x28300e=_0x28300e-0x0;var _0x53f3b1=_0xdbf5[_0x28300e];return _0x53f3b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5dbf('0x16'))[_0x5dbf('0x17')];function respondWithStatusCode(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xcc;return function(_0x14493a){if(_0x14493a){return _0x1453a9['sendStatus'](_0x7cb848);}return _0x1453a9['status'](_0x7cb848)[_0x5dbf('0x18')]();};}function respondWithResult(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xc8;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x19')](_0x48e7fd)[_0x5dbf('0x1a')](_0x19624e);}};}function respondWithFilteredResult(_0x2dfa44,_0x181816){return function(_0x472eb9){if(_0x472eb9){var _0x2d32cc=typeof _0x181816['offset']==='undefined'&&typeof _0x181816[_0x5dbf('0x1b')]===_0x5dbf('0x1c');var _0x39c7aa=_0x472eb9[_0x5dbf('0x1d')];var _0x20c2b0=_0x2d32cc?0x0:_0x181816['offset'];var _0x11cd00=_0x2d32cc?_0x472eb9['count']:_0x181816['offset']+_0x181816['limit'];var _0x23d1e7;if(_0x11cd00>=_0x39c7aa){_0x11cd00=_0x39c7aa;_0x23d1e7=0xc8;}else{_0x23d1e7=0xce;}_0x2dfa44[_0x5dbf('0x19')](_0x23d1e7);return _0x2dfa44[_0x5dbf('0x1e')](_0x5dbf('0x1f'),_0x20c2b0+'-'+_0x11cd00+'/'+_0x39c7aa)[_0x5dbf('0x1a')](_0x472eb9);}return null;};}function patchUpdates(_0x5b2518){return function(_0x2764ea){try{jsonpatch['apply'](_0x2764ea,_0x5b2518,!![]);}catch(_0xb68f92){return BPromise[_0x5dbf('0x20')](_0xb68f92);}return _0x2764ea[_0x5dbf('0x21')]();};}function saveUpdates(_0x43a612,_0x3b763c){return function(_0x2f154e){if(_0x2f154e){return _0x2f154e['update'](_0x43a612)[_0x5dbf('0x22')](function(_0x3e3a2d){return _0x3e3a2d;});}return null;};}function removeEntity(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x23')]()[_0x5dbf('0x22')](function(){var _0x20ab1b=_0x2763ec[_0x5dbf('0x24')]({'plain':!![]});var _0x15a790=_0x5dbf('0x25');return db[_0x5dbf('0x26')][_0x5dbf('0x23')]({'where':{'type':_0x15a790,'resourceId':_0x20ab1b['id']}})[_0x5dbf('0x22')](function(){return _0x2763ec;});})[_0x5dbf('0x22')](function(){_0x2d3e1b[_0x5dbf('0x19')](0xcc)[_0x5dbf('0x18')]();});}};}function handleEntityNotFound(_0x3f8341,_0x159e61){return function(_0x22ec42){if(!_0x22ec42){_0x3f8341[_0x5dbf('0x27')](0x194);}return _0x22ec42;};}function handleError(_0x471027,_0x21cd00){_0x21cd00=_0x21cd00||0x1f4;return function(_0x5768b7){logger[_0x5dbf('0x28')](_0x5768b7[_0x5dbf('0x29')]);if(_0x5768b7[_0x5dbf('0x2a')]){delete _0x5768b7[_0x5dbf('0x2a')];}_0x471027[_0x5dbf('0x19')](_0x21cd00)[_0x5dbf('0x2b')](_0x5768b7);};}exports[_0x5dbf('0x2c')]=function(_0x31d57a,_0x406ce6){var _0x273b63={},_0x294dd7={},_0x50a307={'count':0x0,'rows':[]};var _0x4c1587=_[_0x5dbf('0x2d')](db[_0x5dbf('0x2e')][_0x5dbf('0x2f')],function(_0x3b73ad){return{'name':_0x3b73ad[_0x5dbf('0x30')],'type':_0x3b73ad['type']['key']};});_0x294dd7[_0x5dbf('0x31')]=_[_0x5dbf('0x2d')](_0x4c1587,'name');_0x294dd7[_0x5dbf('0x32')]=_[_0x5dbf('0x33')](_0x31d57a[_0x5dbf('0x32')]);_0x294dd7[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x294dd7['model'],_0x294dd7[_0x5dbf('0x32')]);_0x273b63[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x294dd7[_0x5dbf('0x31')],qs[_0x5dbf('0x37')](_0x31d57a['query'][_0x5dbf('0x37')]));_0x273b63[_0x5dbf('0x36')]=_0x273b63[_0x5dbf('0x36')][_0x5dbf('0x38')]?_0x273b63['attributes']:_0x294dd7[_0x5dbf('0x31')];if(!_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x39')](_0x5dbf('0x3a'))){_0x273b63[_0x5dbf('0x1b')]=qs[_0x5dbf('0x1b')](_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x1b')]);_0x273b63[_0x5dbf('0x3b')]=qs[_0x5dbf('0x3b')](_0x31d57a[_0x5dbf('0x32')]['offset']);}_0x273b63[_0x5dbf('0x3c')]=qs[_0x5dbf('0x3d')](_0x31d57a[_0x5dbf('0x32')]['sort']);_0x273b63[_0x5dbf('0x3e')]=qs[_0x5dbf('0x34')](_[_0x5dbf('0x3f')](_0x31d57a['query'],_0x294dd7[_0x5dbf('0x34')]),_0x4c1587);if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x40')]){_0x273b63['where']=_[_0x5dbf('0x41')](_0x273b63[_0x5dbf('0x3e')],{'$or':_[_0x5dbf('0x2d')](_0x4c1587,function(_0x260c9f){if(_0x260c9f[_0x5dbf('0x42')]!==_0x5dbf('0x43')){var _0x321ae3={};_0x321ae3[_0x260c9f[_0x5dbf('0x2a')]]={'$like':'%'+_0x31d57a['query']['filter']+'%'};return _0x321ae3;}})});}_0x273b63=_['merge']({},_0x273b63,_0x31d57a['options']);var _0x28b28f={'where':_0x273b63[_0x5dbf('0x3e')]};return db['AnalyticDefaultReport'][_0x5dbf('0x1d')](_0x28b28f)[_0x5dbf('0x22')](function(_0x5a60e8){_0x50a307[_0x5dbf('0x1d')]=_0x5a60e8;if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x44')]){_0x273b63[_0x5dbf('0x45')]=[{'all':!![]}];}return db[_0x5dbf('0x2e')][_0x5dbf('0x46')](_0x273b63);})[_0x5dbf('0x22')](function(_0x1c020a){_0x50a307[_0x5dbf('0x47')]=_0x1c020a;return _0x50a307;})[_0x5dbf('0x22')](respondWithFilteredResult(_0x406ce6,_0x273b63))['catch'](handleError(_0x406ce6,null));};exports[_0x5dbf('0x48')]=function(_0x22f958,_0xec1d28){var _0x50880d={'raw':!![],'where':{'id':_0x22f958[_0x5dbf('0x49')]['id']}},_0x16b0ff={};_0x16b0ff[_0x5dbf('0x31')]=_[_0x5dbf('0x33')](db['AnalyticDefaultReport'][_0x5dbf('0x2f')]);_0x16b0ff['query']=_[_0x5dbf('0x33')](_0x22f958[_0x5dbf('0x32')]);_0x16b0ff[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x16b0ff['model'],_0x16b0ff['query']);_0x50880d[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x16b0ff[_0x5dbf('0x31')],qs['fields'](_0x22f958[_0x5dbf('0x32')]['fields']));_0x50880d['attributes']=_0x50880d['attributes']['length']?_0x50880d[_0x5dbf('0x36')]:_0x16b0ff[_0x5dbf('0x31')];if(_0x22f958['query'][_0x5dbf('0x44')]){_0x50880d[_0x5dbf('0x45')]=[{'all':!![]}];}_0x50880d=_['merge']({},_0x50880d,_0x22f958[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')]['find'](_0x50880d)[_0x5dbf('0x22')](handleEntityNotFound(_0xec1d28,null))['then'](respondWithResult(_0xec1d28,null))['catch'](handleError(_0xec1d28,null));};exports[_0x5dbf('0x4b')]=function(_0x2a3d30,_0x17a1c0){return db['AnalyticDefaultReport']['create'](_0x2a3d30[_0x5dbf('0x4c')],{})[_0x5dbf('0x22')](function(_0x21f477){var _0x307a00=_0x2a3d30[_0x5dbf('0x4d')][_0x5dbf('0x24')]({'plain':!![]});if(!_0x307a00)throw new Error(_0x5dbf('0x4e'));if(_0x307a00[_0x5dbf('0x4f')]==='user'){var _0x3f38a0=_0x21f477[_0x5dbf('0x24')]({'plain':!![]});var _0x2927a3=_0x5dbf('0x50');return db[_0x5dbf('0x51')][_0x5dbf('0x52')]({'where':{'name':_0x2927a3,'userProfileId':_0x307a00[_0x5dbf('0x53')]},'raw':!![]})['then'](function(_0x1b0b13){if(_0x1b0b13&&_0x1b0b13['autoAssociation']===0x0){return db[_0x5dbf('0x26')][_0x5dbf('0x4b')]({'name':_0x3f38a0[_0x5dbf('0x2a')],'resourceId':_0x3f38a0['id'],'type':_0x5dbf('0x25'),'sectionId':_0x1b0b13['id']},{})[_0x5dbf('0x22')](function(){return _0x21f477;});}else{return _0x21f477;}})[_0x5dbf('0x54')](function(_0x353d0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353d0f);throw _0x353d0f;});}return _0x21f477;})['then'](respondWithResult(_0x17a1c0,0xc9))[_0x5dbf('0x54')](handleError(_0x17a1c0,null));};exports[_0x5dbf('0x55')]=function(_0x36a787,_0x56c8b2){if(_0x36a787['body']['id']){delete _0x36a787[_0x5dbf('0x4c')]['id'];}return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x36a787['params']['id']}})[_0x5dbf('0x22')](handleEntityNotFound(_0x56c8b2,null))['then'](saveUpdates(_0x36a787[_0x5dbf('0x4c')],null))[_0x5dbf('0x22')](respondWithResult(_0x56c8b2,null))[_0x5dbf('0x54')](handleError(_0x56c8b2,null));};exports['destroy']=function(_0x55fd51,_0x1b316d){return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x55fd51[_0x5dbf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b316d,null))[_0x5dbf('0x22')](removeEntity(_0x1b316d,null))[_0x5dbf('0x54')](handleError(_0x1b316d,null));};exports['preview']=function(_0x5485f3,_0x19ec03){var _0x14bdb1=0xa;var _0x197e8c=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),'cross_join'];var _0x4107f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5dbf('0x59'),'MIN':'MIN(%s)','AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x461ffb={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x3a84c2=function(_0x2ca889){return!_[_0x5dbf('0x63')]([_0x5dbf('0x64'),_0x5dbf('0x65'),'IS\x20EMPTY',_0x5dbf('0x66')],_0x2ca889);};var _0x553be4=function(_0xb0a9bf){if(!_0xb0a9bf||!_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x110224='(',_0x5a975a=0x0;_0x5a975a<_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')];_0x5a975a+=0x1){_0x5a975a>0x0&&(_0x110224+='\x20'+_0xb0a9bf[_0x5dbf('0x68')]+'\x20');_0x110224+=_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x69')]?_0x553be4(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a]['group']):_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6a')]+'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')]+(_0x3a84c2(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')])?'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6c')]:'');}return _0x110224+')';};var _0x12d69b={'where':{'id':_0x5485f3[_0x5dbf('0x49')]['id']}},_0x3b53da,_0x13c8ab,_0x2997a8,_0x5d7a37,_0x52109d;_0x12d69b=_[_0x5dbf('0x41')]({},_0x12d69b,_0x5485f3[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x12d69b)[_0x5dbf('0x22')](function(_0x1b42cf){if(_0x1b42cf){_0x3b53da=_0x1b42cf;return _0x1b42cf[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x57c568){if(_0x57c568){if(!_0x57c568['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5dbf('0x6e'),0x193);}_0x13c8ab=_0x57c568;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x29c4d9){if(_0x29c4d9){_0x2997a8=_[_0x5dbf('0x70')](_0x29c4d9,'id');var _0x5331ff;var _0x5bb990=squel[_0x5dbf('0x71')]();_0x5bb990[_0x5dbf('0x72')](_0x3b53da['table']);for(var _0x1728b9=0x0;_0x1728b9<_0x13c8ab[_0x5dbf('0x38')];_0x1728b9+=0x1){_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]?_0x2997a8[_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]]['metric']:_0x13c8ab[_0x1728b9][_0x5dbf('0x6a')];_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4107f1[_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]],'%s',_0x5331ff):_0x5331ff;_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]?_['replace'](_0x461ffb[_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]],'%s',_0x5331ff):_0x5331ff;if(_0x13c8ab[_0x1728b9][_0x5dbf('0x77')]){_0x5bb990[_0x5dbf('0x69')](_0x5331ff);}_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]&&_0x5bb990['order'](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]==='DESC'?![]:!![]);_0x5bb990[_0x5dbf('0x6a')](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x79')]||_0x5331ff);}if(_0x3b53da[_0x5dbf('0x7a')]){_0x3b53da['joins']=JSON[_0x5dbf('0x7b')](_0x3b53da[_0x5dbf('0x7a')]);for(var _0x4166ce=0x0;_0x4166ce<_0x3b53da[_0x5dbf('0x7a')]['length'];_0x4166ce+=0x1){if(_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x197e8c,_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')])&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce]['parentKey']&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')]&&_0x3b53da['joins'][_0x4166ce][_0x5dbf('0x7d')]){_0x5bb990[_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]](_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')](_0x5dbf('0x7e'),_0x3b53da[_0x5dbf('0x7f')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x80')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7d')]));}}}if(_0x3b53da[_0x5dbf('0x81')]){_0x3b53da[_0x5dbf('0x81')]=JSON['parse'](_0x3b53da[_0x5dbf('0x81')]);_0x5bb990[_0x5dbf('0x3e')](_0x553be4(_0x3b53da[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x52109d=_0x5bb990['clone']();_0x5bb990[_0x5dbf('0x1b')](_0x14bdb1);_0x5bb990[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')](_0x5dbf('0x83'),_0x5bb990[_0x5dbf('0x84')]());return dbH['sequelize'][_0x5dbf('0x32')](_0x5bb990[_0x5dbf('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x5dbf('0x85')]});}})[_0x5dbf('0x22')](respondWithResult(_0x19ec03,null))[_0x5dbf('0x54')](handleError(_0x19ec03,null));};function runReport(_0x8ca7de,_0x14b21b,_0x23ec75){var _0x22339b=_0x14b21b['name'];var _0x310078=0xa;var _0x3b01c0=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x4cceb1={'SUM':_0x5dbf('0x87'),'COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5924d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x4333db=function(_0x4cb92d){return!_['includes']([_0x5dbf('0x64'),'IS\x20NOT\x20NULL',_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x4cb92d);};var _0x541241=function(_0x3c7eaa){if(!_0x3c7eaa||!_0x3c7eaa['rules'][_0x5dbf('0x38')]){return'';}for(var _0x24d90a='(',_0xa3e94f=0x0;_0xa3e94f<_0x3c7eaa[_0x5dbf('0x67')][_0x5dbf('0x38')];_0xa3e94f+=0x1){_0xa3e94f>0x0&&(_0x24d90a+='\x20'+_0x3c7eaa['operator']+'\x20');_0x24d90a+=_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]?_0x541241(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]):_0x3c7eaa['rules'][_0xa3e94f][_0x5dbf('0x6a')]+'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')]+(_0x4333db(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')])?'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6c')]:'');}return _0x24d90a+')';};var _0x334f63={'where':{'id':_0x8ca7de['id']}},_0x5ac29f,_0x533fdd,_0x5bf068,_0x1bd06b,_0x274497;_0x334f63=_['merge']({},_0x334f63,_0x23ec75);return db['AnalyticDefaultReport']['find'](_0x334f63)[_0x5dbf('0x22')](function(_0x20bda9){if(_0x20bda9){_0x5ac29f=_0x20bda9;return _0x20bda9[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x12757d){if(_0x12757d){if(!_0x12757d[_0x5dbf('0x38')]){throw new db['Sequelize'][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x533fdd=_0x12757d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x5722b3){if(_0x5722b3){_0x5bf068=_['keyBy'](_0x5722b3,'id');var _0x3a27c4;var _0x3620d2=squel[_0x5dbf('0x71')]();_0x3620d2['from'](_0x5ac29f[_0x5dbf('0x7f')]);for(var _0x447259=0x0;_0x447259<_0x533fdd['length'];_0x447259+=0x1){_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x73')]?_0x5bf068[_0x533fdd[_0x447259][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x533fdd[_0x447259][_0x5dbf('0x6a')];_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4cceb1[_0x533fdd[_0x447259][_0x5dbf('0x74')]],'%s',_0x3a27c4):_0x3a27c4;_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x76')]?_['replace'](_0x5924d2[_0x533fdd[_0x447259]['format']],'%s',_0x3a27c4):_0x3a27c4;if(_0x533fdd[_0x447259]['groupBy']){_0x3620d2[_0x5dbf('0x69')](_0x3a27c4);}_0x533fdd[_0x447259][_0x5dbf('0x78')]&&_0x3620d2[_0x5dbf('0x3c')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x78')]===_0x5dbf('0x8e')?![]:!![]);_0x3620d2[_0x5dbf('0x6a')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x79')]||_0x3a27c4);}if(_0x5ac29f[_0x5dbf('0x7a')]){_0x5ac29f[_0x5dbf('0x7a')]=JSON[_0x5dbf('0x7b')](_0x5ac29f['joins']);for(var _0x2ded2b=0x0;_0x2ded2b<_0x5ac29f[_0x5dbf('0x7a')][_0x5dbf('0x38')];_0x2ded2b+=0x1){if(_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x3b01c0,_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')])&&_0x5ac29f['joins'][_0x2ded2b]['parentKey']&&_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b]['foreignTable']&&_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7d')]){_0x3620d2[_0x5ac29f['joins'][_0x2ded2b]['type']](_0x5ac29f['joins'][_0x2ded2b]['foreignTable'],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x5ac29f[_0x5dbf('0x7f')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x80')],_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7c')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x7d')]));}}}if(_0x5ac29f['conditions']){_0x5ac29f[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x5ac29f[_0x5dbf('0x81')]);_0x3620d2['where'](_0x541241(_0x5ac29f[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x274497=_0x3620d2[_0x5dbf('0x8f')]();_0x3620d2['limit'](_0x310078);_0x3620d2[_0x5dbf('0x3b')](0x0);return;}})[_0x5dbf('0x22')](function(){if(_0x14b21b[_0x5dbf('0x90')]==='web'){return null;}var _0x48a8c5=_['merge'](_0x14b21b,{'name':_0x14b21b[_0x5dbf('0x91')]||_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f[_0x5dbf('0x2a')],'basename':_0x22339b,'savename':util[_0x5dbf('0x76')](_0x5dbf('0x92'),_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f['name'],require(_0x5dbf('0x93'))[_0x5dbf('0x94')](0x4),_0x14b21b[_0x5dbf('0x90')]||'csv'),'reportId':_0x5ac29f['id'],'reportType':_0x5dbf('0x95')});return db[_0x5dbf('0x96')][_0x5dbf('0x4b')](_0x48a8c5,{'raw':!![]});})[_0x5dbf('0x22')](function(_0x2afbd4){if(_0x5ac29f[_0x5dbf('0x7f')]===_0x5dbf('0x97')){_0x274497['where'](_0x5ac29f[_0x5dbf('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b[_0x5dbf('0x98')],_0x14b21b[_0x5dbf('0x99')]);}else{_0x274497[_0x5dbf('0x3e')](_0x5ac29f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b['startDate'],_0x14b21b[_0x5dbf('0x99')]);}if(_0x2afbd4){logger[_0x5dbf('0x9a')]('Run\x20Query:',_0x274497[_0x5dbf('0x84')]());require('child_process')[_0x5dbf('0x9b')](path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9c'),_0x2afbd4['output']),[_0x2afbd4['id'],_0x274497[_0x5dbf('0x84')](),path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9d'),_0x2afbd4[_0x5dbf('0x9e')]),_0x22339b]);return _0x2afbd4;}else{var _0x4bc5af=squel[_0x5dbf('0x71')]();_0x4bc5af[_0x5dbf('0x72')]('('+_0x274497['toString']()+')',_0x5dbf('0x9f'));_0x4bc5af['field'](_0x5dbf('0xa0'),_0x5dbf('0x1d'));_0x274497[_0x5dbf('0x1b')](_0x14b21b['limit']||_0x310078);_0x274497[_0x5dbf('0x3b')](_0x14b21b[_0x5dbf('0x3b')]||0x0);return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x4bc5af[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')]['QueryTypes'][_0x5dbf('0x85')]})['then'](function(_0x6cfb82){if(!_0x6cfb82[_0x5dbf('0x38')]){_0x1bd06b=0x0;}else{_0x1bd06b=_0x6cfb82[0x0][_0x5dbf('0x1d')]||0x0;}return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x274497[_0x5dbf('0x84')](),{'type':dbH['sequelize'][_0x5dbf('0xa2')][_0x5dbf('0x85')]});})[_0x5dbf('0x22')](function(_0x4d68f6){return{'rows':_0x4d68f6||[],'count':_0x1bd06b};});}});}exports[_0x5dbf('0xa3')]=function(_0x47ac95,_0x51b241){return runReport(_0x47ac95[_0x5dbf('0x49')],_0x47ac95[_0x5dbf('0x32')],_0x47ac95[_0x5dbf('0x4a')])[_0x5dbf('0x22')](respondWithResult(_0x51b241,null))[_0x5dbf('0x54')](handleError(_0x51b241,null));};exports['runReport']=runReport;exports['query']=function(_0x4f38a0,_0x144300){var _0x1da1e3=0xa;var _0x25e681=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x236754={'SUM':'SUM(%s)','COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x191a16={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x51b0df=function(_0x48ea8a){return!_['includes']([_0x5dbf('0x64'),_0x5dbf('0x65'),_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x48ea8a);};var _0x3de263=function(_0x4f8dde){if(!_0x4f8dde||!_0x4f8dde[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x19effa='(',_0x29177e=0x0;_0x29177e<_0x4f8dde[_0x5dbf('0x67')]['length'];_0x29177e+=0x1){_0x29177e>0x0&&(_0x19effa+='\x20'+_0x4f8dde[_0x5dbf('0x68')]+'\x20');_0x19effa+=_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x69')]?_0x3de263(_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['group']):_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6a')]+'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')]+(_0x51b0df(_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')])?'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['value']:'');}return _0x19effa+')';};var _0x4899ac={'where':{'id':_0x4f38a0['params']['id']}},_0x51864c,_0x4562a4,_0x240304,_0x5df275,_0xc588a2;_0x4899ac=_[_0x5dbf('0x41')]({},_0x4899ac,_0x4f38a0['options']);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x4899ac)[_0x5dbf('0x22')](function(_0x2eafe0){if(_0x2eafe0){_0x51864c=_0x2eafe0;return _0x2eafe0[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x414859){if(_0x414859){if(!_0x414859['length']){throw new db[(_0x5dbf('0xa4'))][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x4562a4=_0x414859;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x153401){if(_0x153401){_0x240304=_[_0x5dbf('0x70')](_0x153401,'id');var _0xbe0ca0;var _0x521c72=squel[_0x5dbf('0x71')]();_0x521c72[_0x5dbf('0x72')](_0x51864c[_0x5dbf('0x7f')]);for(var _0x6b4262=0x0;_0x6b4262<_0x4562a4[_0x5dbf('0x38')];_0x6b4262+=0x1){_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x73')]?_0x240304[_0x4562a4[_0x6b4262][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x4562a4[_0x6b4262][_0x5dbf('0x6a')];_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x236754[_0x4562a4[_0x6b4262][_0x5dbf('0x74')]],'%s',_0xbe0ca0):_0xbe0ca0;_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x76')]?_[_0x5dbf('0x75')](_0x191a16[_0x4562a4[_0x6b4262][_0x5dbf('0x76')]],'%s',_0xbe0ca0):_0xbe0ca0;if(_0x4562a4[_0x6b4262][_0x5dbf('0x77')]){_0x521c72[_0x5dbf('0x69')](_0xbe0ca0);}_0x4562a4[_0x6b4262][_0x5dbf('0x78')]&&_0x521c72[_0x5dbf('0x3c')](_0xbe0ca0,_0x4562a4[_0x6b4262]['orderBy']===_0x5dbf('0x8e')?![]:!![]);_0x521c72['field'](_0xbe0ca0,_0x4562a4[_0x6b4262][_0x5dbf('0x79')]||_0xbe0ca0);}if(_0x51864c['joins']){_0x51864c[_0x5dbf('0x7a')]=JSON['parse'](_0x51864c[_0x5dbf('0x7a')]);for(var _0x417869=0x0;_0x417869<_0x51864c[_0x5dbf('0x7a')]['length'];_0x417869+=0x1){if(_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x25e681,_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')])&&_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x80')]&&_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')]&&_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignKey']){_0x521c72[_0x51864c[_0x5dbf('0x7a')][_0x417869]['type']](_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x51864c[_0x5dbf('0x7f')],_0x51864c['joins'][_0x417869]['parentKey'],_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignTable'],_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x7d')]));}}}if(_0x51864c[_0x5dbf('0x81')]){_0x51864c[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x51864c[_0x5dbf('0x81')]);_0x521c72[_0x5dbf('0x3e')](_0x3de263(_0x51864c[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0xc588a2=_0x521c72[_0x5dbf('0x8f')]();_0x521c72[_0x5dbf('0x1b')](_0x1da1e3);_0x521c72[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')]('Limited\x20Query:',_0x521c72[_0x5dbf('0x84')]());return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x521c72[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')][_0x5dbf('0xa2')]['SELECT']});}})[_0x5dbf('0x22')](function(){return{'sql':_0xc588a2[_0x5dbf('0x84')]()};})[_0x5dbf('0x22')](respondWithResult(_0x144300,null))[_0x5dbf('0x54')](handleError(_0x144300,null));}; \ No newline at end of file +var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xabce[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 53819b7..ea35387 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 _0x0c84=['exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x0c84,0x16c));var _0x40c8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0c84[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x40c8('0x0'));var logger=require(_0x40c8('0x1'))(_0x40c8('0x2'));var moment=require(_0x40c8('0x3'));var BPromise=require(_0x40c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40c8('0x5'));var rimraf=require('rimraf');var config=require(_0x40c8('0x6'));var attributes=require(_0x40c8('0x7'));module[_0x40c8('0x8')]=function(_0x24c7a1,_0x4126b0){return _0x24c7a1[_0x40c8('0x9')](_0x40c8('0xa'),attributes,{'tableName':_0x40c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd002=['rimraf','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x213093,_0x3f2f31){var _0x13e6cc=function(_0x5f2093){while(--_0x5f2093){_0x213093['push'](_0x213093['shift']());}};_0x13e6cc(++_0x3f2f31);}(_0xd002,0xea));var _0x2d00=function(_0x20775b,_0x365709){_0x20775b=_0x20775b-0x0;var _0x2cb639=_0xd002[_0x20775b];return _0x2cb639;};'use strict';var _=require(_0x2d00('0x0'));var util=require(_0x2d00('0x1'));var logger=require(_0x2d00('0x2'))(_0x2d00('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d00('0x4'));var fs=require('fs');var path=require(_0x2d00('0x5'));var rimraf=require(_0x2d00('0x6'));var config=require('../../config/environment');var attributes=require(_0x2d00('0x7'));module[_0x2d00('0x8')]=function(_0x39485f,_0x3dd2e8){return _0x39485f['define'](_0x2d00('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 2d05542..6bde175 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 _0x743c=['code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3b0fc5,_0x34d617){var _0x44aa86=function(_0x21a067){while(--_0x21a067){_0x3b0fc5['push'](_0x3b0fc5['shift']());}};_0x44aa86(++_0x34d617);}(_0x743c,0xac));var _0xc743=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0x743c[_0x2e986d];return _0x351c79;};'use strict';var _=require(_0xc743('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc743('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc743('0x2'));var db=require(_0xc743('0x3'))['db'];var utils=require(_0xc743('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc743('0x5'));var jayson=require(_0xc743('0x6'));var client=jayson[_0xc743('0x7')][_0xc743('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x514246,_0x55a12b,_0x3b4865){return new BPromise(function(_0x1d1732,_0x66e95a){return client[_0xc743('0x9')](_0x514246,_0x3b4865)[_0xc743('0xa')](function(_0x3a42c5){logger['info'](_0xc743('0xb'),_0x55a12b,_0xc743('0xc'));logger[_0xc743('0xd')](_0xc743('0xe'),_0x55a12b,_0xc743('0xc'),JSON[_0xc743('0xf')](_0x3a42c5));if(_0x3a42c5[_0xc743('0x10')]){if(_0x3a42c5['error'][_0xc743('0x11')]===0x1f4){logger[_0xc743('0x10')](_0xc743('0xb'),_0x55a12b,_0x3a42c5[_0xc743('0x10')][_0xc743('0x12')]);return _0x66e95a(_0x3a42c5[_0xc743('0x10')][_0xc743('0x12')]);}logger['error'](_0xc743('0xb'),_0x55a12b,_0x3a42c5[_0xc743('0x10')][_0xc743('0x12')]);return _0x1d1732(_0x3a42c5[_0xc743('0x10')]['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x55a12b,_0xc743('0xc'));_0x1d1732(_0x3a42c5[_0xc743('0x13')][_0xc743('0x12')]);}})[_0xc743('0x14')](function(_0x1210d8){logger['error'](_0xc743('0xb'),_0x55a12b,_0x1210d8);_0x66e95a(_0x1210d8);});});} \ No newline at end of file +var _0x4eda=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis'];(function(_0x335fb7,_0x130f68){var _0x2c360b=function(_0x231be){while(--_0x231be){_0x335fb7['push'](_0x335fb7['shift']());}};_0x2c360b(++_0x130f68);}(_0x4eda,0x13d));var _0xa4ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4eda[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa4ed('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa4ed('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4ed('0x2'));var db=require(_0xa4ed('0x3'))['db'];var utils=require(_0xa4ed('0x4'));var logger=require(_0xa4ed('0x5'))(_0xa4ed('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa4ed('0x7')][_0xa4ed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32cbc4,_0x1cb682,_0x2c02e2){return new BPromise(function(_0xfe2adc,_0xa3a7){return client['request'](_0x32cbc4,_0x2c02e2)[_0xa4ed('0x9')](function(_0x3e79c5){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1cb682,_0xa4ed('0xa'));logger[_0xa4ed('0xb')](_0xa4ed('0xc'),_0x1cb682,_0xa4ed('0xa'),JSON[_0xa4ed('0xd')](_0x3e79c5));if(_0x3e79c5[_0xa4ed('0xe')]){if(_0x3e79c5['error'][_0xa4ed('0xf')]===0x1f4){logger[_0xa4ed('0xe')](_0xa4ed('0x10'),_0x1cb682,_0x3e79c5['error'][_0xa4ed('0x11')]);return _0xa3a7(_0x3e79c5[_0xa4ed('0xe')][_0xa4ed('0x11')]);}logger[_0xa4ed('0xe')](_0xa4ed('0x10'),_0x1cb682,_0x3e79c5['error']['message']);return _0xfe2adc(_0x3e79c5['error']['message']);}else{logger['info'](_0xa4ed('0x10'),_0x1cb682,'request\x20sent');_0xfe2adc(_0x3e79c5[_0xa4ed('0x12')]['message']);}})[_0xa4ed('0x13')](function(_0x120594){logger[_0xa4ed('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1cb682,_0x120594);_0xa3a7(_0x120594);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 41d6748..81dc71a 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 _0xd1b2=['preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview'];(function(_0x3a8506,_0x1f7fe9){var _0x5d9a8c=function(_0xb7d413){while(--_0xb7d413){_0x3a8506['push'](_0x3a8506['shift']());}};_0x5d9a8c(++_0x1f7fe9);}(_0xd1b2,0x10f));var _0x2d1b=function(_0x1eb90b,_0x4c65d5){_0x1eb90b=_0x1eb90b-0x0;var _0x579757=_0xd1b2[_0x1eb90b];return _0x579757;};'use strict';var multer=require('multer');var util=require(_0x2d1b('0x0'));var path=require(_0x2d1b('0x1'));var timeout=require(_0x2d1b('0x2'));var express=require(_0x2d1b('0x3'));var router=express[_0x2d1b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2d1b('0x5'));var interaction=require(_0x2d1b('0x6'));var config=require(_0x2d1b('0x7'));var controller=require(_0x2d1b('0x8'));router['get']('/',auth[_0x2d1b('0x9')](),controller[_0x2d1b('0xa')]);router[_0x2d1b('0xb')](_0x2d1b('0xc'),auth[_0x2d1b('0x9')](),controller[_0x2d1b('0xd')]);router[_0x2d1b('0xb')](_0x2d1b('0xe'),auth['isAuthenticated'](),controller[_0x2d1b('0xf')]);router[_0x2d1b('0xb')](_0x2d1b('0x10'),auth[_0x2d1b('0x9')](),controller['run']);router[_0x2d1b('0xb')](_0x2d1b('0x11'),auth['isAuthenticated'](),controller[_0x2d1b('0x12')]);router[_0x2d1b('0x13')]('/',auth[_0x2d1b('0x9')](),controller[_0x2d1b('0x14')]);router[_0x2d1b('0x15')](_0x2d1b('0xc'),auth[_0x2d1b('0x9')](),controller[_0x2d1b('0x16')]);router[_0x2d1b('0x17')](_0x2d1b('0xc'),auth[_0x2d1b('0x9')](),controller[_0x2d1b('0x18')]);module[_0x2d1b('0x19')]=router; \ No newline at end of file +var _0xbdbf=['./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','query','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x16fb10,_0x3eb824){var _0x390e86=function(_0x1e25a0){while(--_0x1e25a0){_0x16fb10['push'](_0x16fb10['shift']());}};_0x390e86(++_0x3eb824);}(_0xbdbf,0x177));var _0xfbdb=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0xbdbf[_0x5eef05];return _0x56d4b8;};'use strict';var multer=require(_0xfbdb('0x0'));var util=require(_0xfbdb('0x1'));var path=require(_0xfbdb('0x2'));var timeout=require(_0xfbdb('0x3'));var express=require('express');var router=express[_0xfbdb('0x4')]();var fs_extra=require(_0xfbdb('0x5'));var auth=require(_0xfbdb('0x6'));var interaction=require(_0xfbdb('0x7'));var config=require(_0xfbdb('0x8'));var controller=require(_0xfbdb('0x9'));router[_0xfbdb('0xa')]('/',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0xc')]);router[_0xfbdb('0xa')]('/:id',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0xd')]);router[_0xfbdb('0xa')](_0xfbdb('0xe'),auth[_0xfbdb('0xb')](),controller[_0xfbdb('0xf')]);router['get']('/:id/run',auth[_0xfbdb('0xb')](),controller['run']);router[_0xfbdb('0xa')]('/:id/query',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0x10')]);router[_0xfbdb('0x11')]('/',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0x12')]);router[_0xfbdb('0x13')](_0xfbdb('0x14'),auth[_0xfbdb('0xb')](),controller[_0xfbdb('0x15')]);router[_0xfbdb('0x16')]('/:id',auth[_0xfbdb('0xb')](),controller[_0xfbdb('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8a1be5e..517128e 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 _0xca82=['INTEGER','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','manual','scheduled'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0xca82,0x187));var _0x2ca8=function(_0x30a86a,_0x20c777){_0x30a86a=_0x30a86a-0x0;var _0x569a62=_0xca82[_0x30a86a];return _0x569a62;};'use strict';var Sequelize=require(_0x2ca8('0x0'));var moment=require(_0x2ca8('0x1'));module['exports']={'name':{'type':Sequelize[_0x2ca8('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x2ca8('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x2ca8('0x3')](_0x2ca8('0x4'),_0x2ca8('0x5'),_0x2ca8('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x2ca8('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x2ca8('0x3')](_0x2ca8('0x7'),_0x2ca8('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x2ca8('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x2ca8('0x2')]}}; \ No newline at end of file +var _0xf193=['moment','exports','STRING','ENUM','pdf','xlsx','csv','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0xf193,0x197));var _0x3f19=function(_0x31cd8a,_0x19eb97){_0x31cd8a=_0x31cd8a-0x0;var _0x1e7d93=_0xf193[_0x31cd8a];return _0x1e7d93;};'use strict';var Sequelize=require(_0x3f19('0x0'));var moment=require(_0x3f19('0x1'));module[_0x3f19('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x3f19('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3f19('0x4')]('csv',_0x3f19('0x5'),_0x3f19('0x6')),'allowNull':![],'defaultValue':_0x3f19('0x7')},'savename':{'type':Sequelize[_0x3f19('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x3f19('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3f19('0x4')](_0x3f19('0x8'),_0x3f19('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x3f19('0xa')](0xb)[_0x3f19('0xb')]},'reportType':{'type':Sequelize[_0x3f19('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 49b3492..d49d9de 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 _0xd998=['map','rawAttributes','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','rows','catch','show','params','find','body','user','role','ExtractedReports','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','output','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send'];(function(_0x27d8bc,_0x19e010){var _0x4b04cb=function(_0x524568){while(--_0x524568){_0x27d8bc['push'](_0x27d8bc['shift']());}};_0x4b04cb(++_0x19e010);}(_0xd998,0xea));var _0x8d99=function(_0x1e18e9,_0x35b870){_0x1e18e9=_0x1e18e9-0x0;var _0x5ae326=_0xd998[_0x1e18e9];return _0x5ae326;};'use strict';var emlformat=require(_0x8d99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d99('0x1'));var jsonpatch=require(_0x8d99('0x2'));var rp=require(_0x8d99('0x3'));var moment=require(_0x8d99('0x4'));var BPromise=require(_0x8d99('0x5'));var Mustache=require('mustache');var util=require(_0x8d99('0x6'));var path=require(_0x8d99('0x7'));var sox=require('sox');var csv=require(_0x8d99('0x8'));var ejs=require(_0x8d99('0x9'));var fs=require('fs');var fs_extra=require(_0x8d99('0xa'));var _=require('lodash');var squel=require(_0x8d99('0xb'));var crypto=require(_0x8d99('0xc'));var jsforce=require(_0x8d99('0xd'));var deskjs=require(_0x8d99('0xe'));var toCsv=require(_0x8d99('0x8'));var querystring=require('querystring');var Papa=require(_0x8d99('0xf'));var Redis=require(_0x8d99('0x10'));var authService=require(_0x8d99('0x11'));var qs=require(_0x8d99('0x12'));var as=require(_0x8d99('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d99('0x14'))(_0x8d99('0x15'));var utils=require('../../config/utils');var config=require(_0x8d99('0x16'));var licenseUtil=require(_0x8d99('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2df38d,_0x5998bf){_0x5998bf=_0x5998bf||0xcc;return function(_0x3cf205){if(_0x3cf205){return _0x2df38d[_0x8d99('0x18')](_0x5998bf);}return _0x2df38d['status'](_0x5998bf)['end']();};}function respondWithResult(_0x5d098d,_0x129573){_0x129573=_0x129573||0xc8;return function(_0x2fbb60){if(_0x2fbb60){return _0x5d098d[_0x8d99('0x19')](_0x129573)[_0x8d99('0x1a')](_0x2fbb60);}};}function respondWithFilteredResult(_0x32839d,_0x15c060){return function(_0x4bd349){if(_0x4bd349){var _0x3ecb35=typeof _0x15c060[_0x8d99('0x1b')]===_0x8d99('0x1c')&&typeof _0x15c060[_0x8d99('0x1d')]==='undefined';var _0x4f2399=_0x4bd349['count'];var _0x400db6=_0x3ecb35?0x0:_0x15c060[_0x8d99('0x1b')];var _0x18d205=_0x3ecb35?_0x4bd349[_0x8d99('0x1e')]:_0x15c060[_0x8d99('0x1b')]+_0x15c060[_0x8d99('0x1d')];var _0x353547;if(_0x18d205>=_0x4f2399){_0x18d205=_0x4f2399;_0x353547=0xc8;}else{_0x353547=0xce;}_0x32839d[_0x8d99('0x19')](_0x353547);return _0x32839d['set'](_0x8d99('0x1f'),_0x400db6+'-'+_0x18d205+'/'+_0x4f2399)[_0x8d99('0x1a')](_0x4bd349);}return null;};}function patchUpdates(_0x1fdc80){return function(_0xe43b15){try{jsonpatch[_0x8d99('0x20')](_0xe43b15,_0x1fdc80,!![]);}catch(_0x2cab19){return BPromise[_0x8d99('0x21')](_0x2cab19);}return _0xe43b15[_0x8d99('0x22')]();};}function saveUpdates(_0x97af8d,_0x6f308f){return function(_0x44d858){if(_0x44d858){return _0x44d858[_0x8d99('0x23')](_0x97af8d)[_0x8d99('0x24')](function(_0x5f1e97){return _0x5f1e97;});}return null;};}function removeEntity(_0x539f40,_0x15ee01){return function(_0x356412){if(_0x356412){return _0x356412['destroy']()[_0x8d99('0x24')](function(){var _0x54c5ab=_0x356412[_0x8d99('0x25')]({'plain':!![]});var _0x576e7c='ExtractedReports';return db[_0x8d99('0x26')][_0x8d99('0x27')]({'where':{'type':_0x576e7c,'resourceId':_0x54c5ab['id']}})[_0x8d99('0x24')](function(){return _0x356412;});})[_0x8d99('0x24')](function(){_0x539f40['status'](0xcc)[_0x8d99('0x28')]();});}};}function handleEntityNotFound(_0x892a59,_0x474c36){return function(_0x2c6a35){if(!_0x2c6a35){_0x892a59[_0x8d99('0x18')](0x194);}return _0x2c6a35;};}function handleError(_0x1e5a90,_0x4fd5e3){_0x4fd5e3=_0x4fd5e3||0x1f4;return function(_0x4d1b14){logger[_0x8d99('0x29')](_0x4d1b14[_0x8d99('0x2a')]);if(_0x4d1b14[_0x8d99('0x2b')]){delete _0x4d1b14[_0x8d99('0x2b')];}_0x1e5a90[_0x8d99('0x19')](_0x4fd5e3)[_0x8d99('0x2c')](_0x4d1b14);};}exports['index']=function(_0x3a3545,_0x129fe4){var _0x3b2fc5={},_0x25e5c9={},_0x49685d={'count':0x0,'rows':[]};var _0x5a829c=_[_0x8d99('0x2d')](db['AnalyticExtractedReport'][_0x8d99('0x2e')],function(_0x3b2e60){return{'name':_0x3b2e60['fieldName'],'type':_0x3b2e60['type'][_0x8d99('0x2f')]};});_0x25e5c9['model']=_[_0x8d99('0x2d')](_0x5a829c,'name');_0x25e5c9[_0x8d99('0x30')]=_[_0x8d99('0x31')](_0x3a3545['query']);_0x25e5c9['filters']=_['intersection'](_0x25e5c9[_0x8d99('0x32')],_0x25e5c9[_0x8d99('0x30')]);_0x3b2fc5['attributes']=_[_0x8d99('0x33')](_0x25e5c9[_0x8d99('0x32')],qs['fields'](_0x3a3545[_0x8d99('0x30')][_0x8d99('0x34')]));_0x3b2fc5[_0x8d99('0x35')]=_0x3b2fc5[_0x8d99('0x35')][_0x8d99('0x36')]?_0x3b2fc5[_0x8d99('0x35')]:_0x25e5c9['model'];if(!_0x3a3545[_0x8d99('0x30')][_0x8d99('0x37')]('nolimit')){_0x3b2fc5['limit']=qs[_0x8d99('0x1d')](_0x3a3545[_0x8d99('0x30')][_0x8d99('0x1d')]);_0x3b2fc5[_0x8d99('0x1b')]=qs[_0x8d99('0x1b')](_0x3a3545[_0x8d99('0x30')][_0x8d99('0x1b')]);}_0x3b2fc5['order']=qs[_0x8d99('0x38')](_0x3a3545[_0x8d99('0x30')][_0x8d99('0x38')]);_0x3b2fc5['where']=qs[_0x8d99('0x39')](_[_0x8d99('0x3a')](_0x3a3545[_0x8d99('0x30')],_0x25e5c9[_0x8d99('0x39')]),_0x5a829c);if(_0x3a3545['query'][_0x8d99('0x3b')]){_0x3b2fc5[_0x8d99('0x3c')]=_[_0x8d99('0x3d')](_0x3b2fc5[_0x8d99('0x3c')],{'$or':_[_0x8d99('0x2d')](_0x5a829c,function(_0x20a684){if(_0x20a684[_0x8d99('0x3e')]!==_0x8d99('0x3f')){var _0x2bfaab={};_0x2bfaab[_0x20a684[_0x8d99('0x2b')]]={'$like':'%'+_0x3a3545[_0x8d99('0x30')][_0x8d99('0x3b')]+'%'};return _0x2bfaab;}})});}_0x3b2fc5=_[_0x8d99('0x3d')]({},_0x3b2fc5,_0x3a3545[_0x8d99('0x40')]);var _0x5d0ea8={'where':_0x3b2fc5['where']};return db[_0x8d99('0x41')]['count'](_0x5d0ea8)[_0x8d99('0x24')](function(_0x4dd8a5){_0x49685d[_0x8d99('0x1e')]=_0x4dd8a5;if(_0x3a3545[_0x8d99('0x30')][_0x8d99('0x42')]){_0x3b2fc5[_0x8d99('0x43')]=[{'all':!![]}];}return db[_0x8d99('0x41')]['findAll'](_0x3b2fc5);})[_0x8d99('0x24')](function(_0x2dd297){_0x49685d[_0x8d99('0x44')]=_0x2dd297;return _0x49685d;})[_0x8d99('0x24')](respondWithFilteredResult(_0x129fe4,_0x3b2fc5))[_0x8d99('0x45')](handleError(_0x129fe4,null));};exports[_0x8d99('0x46')]=function(_0x4b560d,_0x35f4e1){var _0x377d67={'raw':!![],'where':{'id':_0x4b560d[_0x8d99('0x47')]['id']}},_0x52b6e9={};_0x52b6e9[_0x8d99('0x32')]=_['keys'](db[_0x8d99('0x41')]['rawAttributes']);_0x52b6e9['query']=_[_0x8d99('0x31')](_0x4b560d[_0x8d99('0x30')]);_0x52b6e9[_0x8d99('0x39')]=_[_0x8d99('0x33')](_0x52b6e9[_0x8d99('0x32')],_0x52b6e9[_0x8d99('0x30')]);_0x377d67[_0x8d99('0x35')]=_['intersection'](_0x52b6e9[_0x8d99('0x32')],qs[_0x8d99('0x34')](_0x4b560d[_0x8d99('0x30')][_0x8d99('0x34')]));_0x377d67[_0x8d99('0x35')]=_0x377d67[_0x8d99('0x35')]['length']?_0x377d67[_0x8d99('0x35')]:_0x52b6e9[_0x8d99('0x32')];if(_0x4b560d[_0x8d99('0x30')][_0x8d99('0x42')]){_0x377d67[_0x8d99('0x43')]=[{'all':!![]}];}_0x377d67=_[_0x8d99('0x3d')]({},_0x377d67,_0x4b560d[_0x8d99('0x40')]);return db['AnalyticExtractedReport'][_0x8d99('0x48')](_0x377d67)[_0x8d99('0x24')](handleEntityNotFound(_0x35f4e1,null))[_0x8d99('0x24')](respondWithResult(_0x35f4e1,null))[_0x8d99('0x45')](handleError(_0x35f4e1,null));};exports['create']=function(_0x530613,_0x20fef0){return db['AnalyticExtractedReport']['create'](_0x530613[_0x8d99('0x49')],{})['then'](function(_0x32dba0){var _0x23bb72=_0x530613[_0x8d99('0x4a')][_0x8d99('0x25')]({'plain':!![]});if(!_0x23bb72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23bb72[_0x8d99('0x4b')]===_0x8d99('0x4a')){var _0x277731=_0x32dba0[_0x8d99('0x25')]({'plain':!![]});var _0x386c02=_0x8d99('0x4c');return db['UserProfileSection'][_0x8d99('0x48')]({'where':{'name':_0x386c02,'userProfileId':_0x23bb72['userProfileId']},'raw':!![]})[_0x8d99('0x24')](function(_0x1ebd15){if(_0x1ebd15&&_0x1ebd15[_0x8d99('0x4d')]===0x0){return db[_0x8d99('0x26')][_0x8d99('0x4e')]({'name':_0x277731['name'],'resourceId':_0x277731['id'],'type':_0x1ebd15[_0x8d99('0x2b')],'sectionId':_0x1ebd15['id']},{})[_0x8d99('0x24')](function(){return _0x32dba0;});}else{return _0x32dba0;}})[_0x8d99('0x45')](function(_0x19daf6){logger['error'](_0x8d99('0x4f'),_0x19daf6);throw _0x19daf6;});}return _0x32dba0;})[_0x8d99('0x24')](respondWithResult(_0x20fef0,0xc9))[_0x8d99('0x45')](handleError(_0x20fef0,null));};exports[_0x8d99('0x23')]=function(_0x1624e3,_0x547f46){if(_0x1624e3[_0x8d99('0x49')]['id']){delete _0x1624e3[_0x8d99('0x49')]['id'];}return db[_0x8d99('0x41')][_0x8d99('0x48')]({'where':{'id':_0x1624e3[_0x8d99('0x47')]['id']}})[_0x8d99('0x24')](handleEntityNotFound(_0x547f46,null))[_0x8d99('0x24')](saveUpdates(_0x1624e3['body'],null))[_0x8d99('0x24')](respondWithResult(_0x547f46,null))[_0x8d99('0x45')](handleError(_0x547f46,null));};exports[_0x8d99('0x27')]=function(_0x5af3f9,_0x4baa1d){return db[_0x8d99('0x41')]['find']({'where':{'id':_0x5af3f9['params']['id']}})['then'](handleEntityNotFound(_0x4baa1d,null))[_0x8d99('0x24')](removeEntity(_0x4baa1d,null))[_0x8d99('0x45')](handleError(_0x4baa1d,null));};exports[_0x8d99('0x50')]=function(_0x39c7bd,_0x5bb9b5,_0x2287a0){return db[_0x8d99('0x41')][_0x8d99('0x48')]({'where':{'id':_0x39c7bd[_0x8d99('0x47')]['id']},'attributes':[_0x8d99('0x2b'),_0x8d99('0x51'),_0x8d99('0x52'),'output'],'raw':!![]})[_0x8d99('0x24')](handleEntityNotFound(_0x5bb9b5,null))[_0x8d99('0x24')](function(_0xe622){if(_0xe622){if(!fs[_0x8d99('0x53')](path[_0x8d99('0x54')](config[_0x8d99('0x55')],_0x8d99('0x56'),_0xe622[_0x8d99('0x52')]))){throw new db[(_0x8d99('0x57'))]['ValidationError'](_0x8d99('0x58'));}if(_0x39c7bd[_0x8d99('0x30')][_0x8d99('0x59')]){return _0x5bb9b5['sendStatus'](0xc8);}return _0x5bb9b5['download'](path[_0x8d99('0x54')](config[_0x8d99('0x55')],'server/files/reports',_0xe622[_0x8d99('0x52')]),util[_0x8d99('0x5a')](_0x8d99('0x5b'),_0xe622[_0x8d99('0x51')]||_0xe622[_0x8d99('0x2b')],_0xe622[_0x8d99('0x5c')]['toLowerCase']()));}})[_0x8d99('0x45')](handleError(_0x5bb9b5,null));}; \ No newline at end of file +var _0xf75e=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','merge','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','body','params','download','basename','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','output','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x420942,_0x3b810b){var _0xbed944=function(_0xe92908){while(--_0xe92908){_0x420942['push'](_0x420942['shift']());}};_0xbed944(++_0x3b810b);}(_0xf75e,0x1e5));var _0xef75=function(_0x1a145c,_0x5f396b){_0x1a145c=_0x1a145c-0x0;var _0x47f634=_0xf75e[_0x1a145c];return _0x47f634;};'use strict';var emlformat=require(_0xef75('0x0'));var rimraf=require(_0xef75('0x1'));var zipdir=require(_0xef75('0x2'));var jsonpatch=require(_0xef75('0x3'));var rp=require(_0xef75('0x4'));var moment=require('moment');var BPromise=require(_0xef75('0x5'));var Mustache=require(_0xef75('0x6'));var util=require('util');var path=require(_0xef75('0x7'));var sox=require(_0xef75('0x8'));var csv=require(_0xef75('0x9'));var ejs=require(_0xef75('0xa'));var fs=require('fs');var fs_extra=require(_0xef75('0xb'));var _=require(_0xef75('0xc'));var squel=require('squel');var crypto=require(_0xef75('0xd'));var jsforce=require(_0xef75('0xe'));var deskjs=require(_0xef75('0xf'));var toCsv=require(_0xef75('0x9'));var querystring=require(_0xef75('0x10'));var Papa=require(_0xef75('0x11'));var Redis=require(_0xef75('0x12'));var authService=require(_0xef75('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xef75('0x14'));var hardwareService=require(_0xef75('0x15'));var logger=require(_0xef75('0x16'))('api');var utils=require(_0xef75('0x17'));var config=require(_0xef75('0x18'));var licenseUtil=require(_0xef75('0x19'));var db=require(_0xef75('0x1a'))['db'];function respondWithStatusCode(_0x5410f2,_0x21c19a){_0x21c19a=_0x21c19a||0xcc;return function(_0xf49289){if(_0xf49289){return _0x5410f2[_0xef75('0x1b')](_0x21c19a);}return _0x5410f2[_0xef75('0x1c')](_0x21c19a)[_0xef75('0x1d')]();};}function respondWithResult(_0x5e3951,_0x2d8efd){_0x2d8efd=_0x2d8efd||0xc8;return function(_0x4beae6){if(_0x4beae6){return _0x5e3951[_0xef75('0x1c')](_0x2d8efd)[_0xef75('0x1e')](_0x4beae6);}};}function respondWithFilteredResult(_0x24c6ff,_0x54f561){return function(_0x5162d0){if(_0x5162d0){var _0x38f0ee=typeof _0x54f561['offset']===_0xef75('0x1f')&&typeof _0x54f561['limit']==='undefined';var _0xc71927=_0x5162d0[_0xef75('0x20')];var _0x222d8b=_0x38f0ee?0x0:_0x54f561[_0xef75('0x21')];var _0x220eea=_0x38f0ee?_0x5162d0[_0xef75('0x20')]:_0x54f561[_0xef75('0x21')]+_0x54f561[_0xef75('0x22')];var _0x386b6c;if(_0x220eea>=_0xc71927){_0x220eea=_0xc71927;_0x386b6c=0xc8;}else{_0x386b6c=0xce;}_0x24c6ff['status'](_0x386b6c);return _0x24c6ff['set'](_0xef75('0x23'),_0x222d8b+'-'+_0x220eea+'/'+_0xc71927)[_0xef75('0x1e')](_0x5162d0);}return null;};}function patchUpdates(_0x988870){return function(_0x204e77){try{jsonpatch[_0xef75('0x24')](_0x204e77,_0x988870,!![]);}catch(_0x3bea97){return BPromise[_0xef75('0x25')](_0x3bea97);}return _0x204e77['save']();};}function saveUpdates(_0x42688f,_0x1205cf){return function(_0x36dac3){if(_0x36dac3){return _0x36dac3[_0xef75('0x26')](_0x42688f)[_0xef75('0x27')](function(_0xae9acb){return _0xae9acb;});}return null;};}function removeEntity(_0x4392fb,_0x1c26a3){return function(_0x4d3539){if(_0x4d3539){return _0x4d3539['destroy']()[_0xef75('0x27')](function(){var _0x442ddb=_0x4d3539['get']({'plain':!![]});var _0x173203='ExtractedReports';return db[_0xef75('0x28')][_0xef75('0x29')]({'where':{'type':_0x173203,'resourceId':_0x442ddb['id']}})[_0xef75('0x27')](function(){return _0x4d3539;});})[_0xef75('0x27')](function(){_0x4392fb[_0xef75('0x1c')](0xcc)[_0xef75('0x1d')]();});}};}function handleEntityNotFound(_0xf80516,_0x3cdaec){return function(_0x2d022d){if(!_0x2d022d){_0xf80516[_0xef75('0x1b')](0x194);}return _0x2d022d;};}function handleError(_0x3bbff2,_0x84eb41){_0x84eb41=_0x84eb41||0x1f4;return function(_0xbab714){logger[_0xef75('0x2a')](_0xbab714[_0xef75('0x2b')]);if(_0xbab714[_0xef75('0x2c')]){delete _0xbab714['name'];}_0x3bbff2[_0xef75('0x1c')](_0x84eb41)[_0xef75('0x2d')](_0xbab714);};}exports[_0xef75('0x2e')]=function(_0x239a4b,_0x1a60b7){var _0x11b2f4={},_0x5a0e55={},_0x2019e3={'count':0x0,'rows':[]};var _0x4a1430=_[_0xef75('0x2f')](db[_0xef75('0x30')][_0xef75('0x31')],function(_0x8e602a){return{'name':_0x8e602a[_0xef75('0x32')],'type':_0x8e602a[_0xef75('0x33')][_0xef75('0x34')]};});_0x5a0e55[_0xef75('0x35')]=_[_0xef75('0x2f')](_0x4a1430,_0xef75('0x2c'));_0x5a0e55[_0xef75('0x36')]=_[_0xef75('0x37')](_0x239a4b[_0xef75('0x36')]);_0x5a0e55['filters']=_[_0xef75('0x38')](_0x5a0e55[_0xef75('0x35')],_0x5a0e55[_0xef75('0x36')]);_0x11b2f4['attributes']=_['intersection'](_0x5a0e55['model'],qs[_0xef75('0x39')](_0x239a4b['query'][_0xef75('0x39')]));_0x11b2f4[_0xef75('0x3a')]=_0x11b2f4[_0xef75('0x3a')][_0xef75('0x3b')]?_0x11b2f4[_0xef75('0x3a')]:_0x5a0e55[_0xef75('0x35')];if(!_0x239a4b[_0xef75('0x36')][_0xef75('0x3c')]('nolimit')){_0x11b2f4[_0xef75('0x22')]=qs['limit'](_0x239a4b['query'][_0xef75('0x22')]);_0x11b2f4[_0xef75('0x21')]=qs['offset'](_0x239a4b[_0xef75('0x36')][_0xef75('0x21')]);}_0x11b2f4['order']=qs[_0xef75('0x3d')](_0x239a4b[_0xef75('0x36')][_0xef75('0x3d')]);_0x11b2f4[_0xef75('0x3e')]=qs[_0xef75('0x3f')](_[_0xef75('0x40')](_0x239a4b[_0xef75('0x36')],_0x5a0e55['filters']),_0x4a1430);if(_0x239a4b[_0xef75('0x36')][_0xef75('0x41')]){_0x11b2f4['where']=_['merge'](_0x11b2f4['where'],{'$or':_[_0xef75('0x2f')](_0x4a1430,function(_0x4e4ce8){if(_0x4e4ce8[_0xef75('0x33')]!==_0xef75('0x42')){var _0x4cdf4d={};_0x4cdf4d[_0x4e4ce8[_0xef75('0x2c')]]={'$like':'%'+_0x239a4b['query'][_0xef75('0x41')]+'%'};return _0x4cdf4d;}})});}_0x11b2f4=_['merge']({},_0x11b2f4,_0x239a4b[_0xef75('0x43')]);var _0x10d5f3={'where':_0x11b2f4[_0xef75('0x3e')]};return db[_0xef75('0x30')]['count'](_0x10d5f3)[_0xef75('0x27')](function(_0x39cf2d){_0x2019e3['count']=_0x39cf2d;if(_0x239a4b[_0xef75('0x36')][_0xef75('0x44')]){_0x11b2f4[_0xef75('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xef75('0x46')](_0x11b2f4);})[_0xef75('0x27')](function(_0x43d5d9){_0x2019e3['rows']=_0x43d5d9;return _0x2019e3;})[_0xef75('0x27')](respondWithFilteredResult(_0x1a60b7,_0x11b2f4))[_0xef75('0x47')](handleError(_0x1a60b7,null));};exports[_0xef75('0x48')]=function(_0x50a157,_0x54fa12){var _0x295390={'raw':!![],'where':{'id':_0x50a157['params']['id']}},_0x29b21d={};_0x29b21d[_0xef75('0x35')]=_[_0xef75('0x37')](db[_0xef75('0x30')][_0xef75('0x31')]);_0x29b21d[_0xef75('0x36')]=_[_0xef75('0x37')](_0x50a157[_0xef75('0x36')]);_0x29b21d[_0xef75('0x3f')]=_[_0xef75('0x38')](_0x29b21d[_0xef75('0x35')],_0x29b21d[_0xef75('0x36')]);_0x295390[_0xef75('0x3a')]=_[_0xef75('0x38')](_0x29b21d[_0xef75('0x35')],qs[_0xef75('0x39')](_0x50a157['query'][_0xef75('0x39')]));_0x295390[_0xef75('0x3a')]=_0x295390['attributes'][_0xef75('0x3b')]?_0x295390[_0xef75('0x3a')]:_0x29b21d['model'];if(_0x50a157[_0xef75('0x36')]['includeAll']){_0x295390[_0xef75('0x45')]=[{'all':!![]}];}_0x295390=_[_0xef75('0x49')]({},_0x295390,_0x50a157[_0xef75('0x43')]);return db['AnalyticExtractedReport'][_0xef75('0x4a')](_0x295390)[_0xef75('0x27')](handleEntityNotFound(_0x54fa12,null))[_0xef75('0x27')](respondWithResult(_0x54fa12,null))['catch'](handleError(_0x54fa12,null));};exports[_0xef75('0x4b')]=function(_0x57babe,_0x15a06a){return db[_0xef75('0x30')][_0xef75('0x4b')](_0x57babe['body'],{})[_0xef75('0x27')](function(_0x564aff){var _0x22ccf6=_0x57babe[_0xef75('0x4c')][_0xef75('0x4d')]({'plain':!![]});if(!_0x22ccf6)throw new Error(_0xef75('0x4e'));if(_0x22ccf6[_0xef75('0x4f')]===_0xef75('0x4c')){var _0x54efe9=_0x564aff[_0xef75('0x4d')]({'plain':!![]});var _0x208bf0=_0xef75('0x50');return db[_0xef75('0x51')][_0xef75('0x4a')]({'where':{'name':_0x208bf0,'userProfileId':_0x22ccf6[_0xef75('0x52')]},'raw':!![]})[_0xef75('0x27')](function(_0x436917){if(_0x436917&&_0x436917[_0xef75('0x53')]===0x0){return db[_0xef75('0x28')][_0xef75('0x4b')]({'name':_0x54efe9['name'],'resourceId':_0x54efe9['id'],'type':_0x436917[_0xef75('0x2c')],'sectionId':_0x436917['id']},{})[_0xef75('0x27')](function(){return _0x564aff;});}else{return _0x564aff;}})['catch'](function(_0x4d14de){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d14de);throw _0x4d14de;});}return _0x564aff;})['then'](respondWithResult(_0x15a06a,0xc9))[_0xef75('0x47')](handleError(_0x15a06a,null));};exports[_0xef75('0x26')]=function(_0x34e795,_0x2c4fb9){if(_0x34e795[_0xef75('0x54')]['id']){delete _0x34e795['body']['id'];}return db['AnalyticExtractedReport'][_0xef75('0x4a')]({'where':{'id':_0x34e795[_0xef75('0x55')]['id']}})[_0xef75('0x27')](handleEntityNotFound(_0x2c4fb9,null))[_0xef75('0x27')](saveUpdates(_0x34e795[_0xef75('0x54')],null))['then'](respondWithResult(_0x2c4fb9,null))[_0xef75('0x47')](handleError(_0x2c4fb9,null));};exports[_0xef75('0x29')]=function(_0x527508,_0x16a5ce){return db[_0xef75('0x30')]['find']({'where':{'id':_0x527508[_0xef75('0x55')]['id']}})[_0xef75('0x27')](handleEntityNotFound(_0x16a5ce,null))['then'](removeEntity(_0x16a5ce,null))[_0xef75('0x47')](handleError(_0x16a5ce,null));};exports[_0xef75('0x56')]=function(_0xf13e76,_0x32df01,_0x2700a2){return db['AnalyticExtractedReport']['find']({'where':{'id':_0xf13e76[_0xef75('0x55')]['id']},'attributes':['name',_0xef75('0x57'),'savename','output'],'raw':!![]})[_0xef75('0x27')](handleEntityNotFound(_0x32df01,null))[_0xef75('0x27')](function(_0x2fcdd3){if(_0x2fcdd3){if(!fs['existsSync'](path[_0xef75('0x58')](config[_0xef75('0x59')],_0xef75('0x5a'),_0x2fcdd3[_0xef75('0x5b')]))){throw new db[(_0xef75('0x5c'))][(_0xef75('0x5d'))](_0xef75('0x5e'));}if(_0xf13e76[_0xef75('0x36')][_0xef75('0x5f')]){return _0x32df01[_0xef75('0x1b')](0xc8);}return _0x32df01[_0xef75('0x56')](path[_0xef75('0x58')](config[_0xef75('0x59')],_0xef75('0x5a'),_0x2fcdd3['savename']),util['format'](_0xef75('0x60'),_0x2fcdd3[_0xef75('0x57')]||_0x2fcdd3[_0xef75('0x2c')],_0x2fcdd3[_0xef75('0x61')]['toLowerCase']()));}})[_0xef75('0x47')](handleError(_0x32df01,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 0b3ee12..c8586f3 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 _0x9573=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','util','api'];(function(_0x580f74,_0x41be70){var _0x137281=function(_0xb9eae0){while(--_0xb9eae0){_0x580f74['push'](_0x580f74['shift']());}};_0x137281(++_0x41be70);}(_0x9573,0x98));var _0x3957=function(_0x3a3835,_0x19e486){_0x3a3835=_0x3a3835-0x0;var _0x4efba5=_0x9573[_0x3a3835];return _0x4efba5;};'use strict';var _=require('lodash');var util=require(_0x3957('0x0'));var logger=require('../../config/logger')(_0x3957('0x1'));var moment=require(_0x3957('0x2'));var BPromise=require(_0x3957('0x3'));var rp=require(_0x3957('0x4'));var fs=require('fs');var path=require(_0x3957('0x5'));var rimraf=require(_0x3957('0x6'));var config=require(_0x3957('0x7'));var attributes=require(_0x3957('0x8'));module['exports']=function(_0x179c66,_0x2a6a31){return _0x179c66['define'](_0x3957('0x9'),attributes,{'tableName':_0x3957('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6316=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash'];(function(_0x2490cd,_0x1737a7){var _0x3733d4=function(_0x254ba0){while(--_0x254ba0){_0x2490cd['push'](_0x2490cd['shift']());}};_0x3733d4(++_0x1737a7);}(_0x6316,0x1bb));var _0x6631=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6316[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x6631('0x0'));var util=require('util');var logger=require(_0x6631('0x1'))(_0x6631('0x2'));var moment=require(_0x6631('0x3'));var BPromise=require(_0x6631('0x4'));var rp=require(_0x6631('0x5'));var fs=require('fs');var path=require(_0x6631('0x6'));var rimraf=require(_0x6631('0x7'));var config=require('../../config/environment');var attributes=require(_0x6631('0x8'));module[_0x6631('0x9')]=function(_0x343ad3,_0x9552f5){return _0x343ad3[_0x6631('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x6631('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 3490b5d..268affa 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 _0xc35f=['AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3865fe,_0x46fe8a){var _0x3cf462=function(_0x5921e3){while(--_0x5921e3){_0x3865fe['push'](_0x3865fe['shift']());}};_0x3cf462(++_0x46fe8a);}(_0xc35f,0xeb));var _0xfc35=function(_0x22396c,_0x22e4b0){_0x22396c=_0x22396c-0x0;var _0x3a9ede=_0xc35f[_0x22396c];return _0x3a9ede;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc35('0x0'));var BPromise=require('bluebird');var rs=require(_0xfc35('0x1'));var fs=require('fs');var Redis=require(_0xfc35('0x2'));var db=require(_0xfc35('0x3'))['db'];var utils=require(_0xfc35('0x4'));var logger=require(_0xfc35('0x5'))(_0xfc35('0x6'));var config=require('../../config/environment');var jayson=require(_0xfc35('0x7'));var client=jayson['client'][_0xfc35('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x293a82,_0x1d048f,_0x23add9){return new BPromise(function(_0x32a68a,_0x15c1fb){return client[_0xfc35('0x9')](_0x293a82,_0x23add9)[_0xfc35('0xa')](function(_0x4467fd){logger[_0xfc35('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d048f,_0xfc35('0xc'));logger[_0xfc35('0xd')](_0xfc35('0xe'),_0x1d048f,_0xfc35('0xc'),JSON[_0xfc35('0xf')](_0x4467fd));if(_0x4467fd['error']){if(_0x4467fd[_0xfc35('0x10')]['code']===0x1f4){logger[_0xfc35('0x10')](_0xfc35('0x11'),_0x1d048f,_0x4467fd[_0xfc35('0x10')][_0xfc35('0x12')]);return _0x15c1fb(_0x4467fd[_0xfc35('0x10')][_0xfc35('0x12')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d048f,_0x4467fd['error'][_0xfc35('0x12')]);return _0x32a68a(_0x4467fd[_0xfc35('0x10')]['message']);}else{logger[_0xfc35('0xb')](_0xfc35('0x11'),_0x1d048f,'request\x20sent');_0x32a68a(_0x4467fd[_0xfc35('0x13')]['message']);}})[_0xfc35('0x14')](function(_0xa8e2df){logger[_0xfc35('0x10')](_0xfc35('0x11'),_0x1d048f,_0xa8e2df);_0x15c1fb(_0xa8e2df);});});} \ No newline at end of file +var _0x49a2=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x24f7bc,_0x13d9df){var _0x4ef727=function(_0x26d4ed){while(--_0x26d4ed){_0x24f7bc['push'](_0x24f7bc['shift']());}};_0x4ef727(++_0x13d9df);}(_0x49a2,0xf3));var _0x249a=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x49a2[_0x18b5e8];return _0x25baed;};'use strict';var _=require(_0x249a('0x0'));var util=require('util');var moment=require(_0x249a('0x1'));var BPromise=require(_0x249a('0x2'));var rs=require(_0x249a('0x3'));var fs=require('fs');var Redis=require(_0x249a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x249a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x249a('0x6'));var client=jayson[_0x249a('0x7')][_0x249a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c3032,_0x43ba88,_0xf04c00){return new BPromise(function(_0x16a5a9,_0x50d906){return client[_0x249a('0x9')](_0x2c3032,_0xf04c00)[_0x249a('0xa')](function(_0x350dfc){logger[_0x249a('0xb')](_0x249a('0xc'),_0x43ba88,_0x249a('0xd'));logger[_0x249a('0xe')](_0x249a('0xf'),_0x43ba88,_0x249a('0xd'),JSON[_0x249a('0x10')](_0x350dfc));if(_0x350dfc[_0x249a('0x11')]){if(_0x350dfc[_0x249a('0x11')][_0x249a('0x12')]===0x1f4){logger[_0x249a('0x11')](_0x249a('0xc'),_0x43ba88,_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);return _0x50d906(_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);}logger[_0x249a('0x11')](_0x249a('0xc'),_0x43ba88,_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);return _0x16a5a9(_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);}else{logger[_0x249a('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x43ba88,_0x249a('0xd'));_0x16a5a9(_0x350dfc[_0x249a('0x14')]['message']);}})[_0x249a('0x15')](function(_0x1d9f30){logger[_0x249a('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x43ba88,_0x1d9f30);_0x50d906(_0x1d9f30);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c0e36a9..f24162b 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 _0xfe05=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download'];(function(_0x5bfabc,_0x3be1d){var _0x5563a3=function(_0x3e8844){while(--_0x3e8844){_0x5bfabc['push'](_0x5bfabc['shift']());}};_0x5563a3(++_0x3be1d);}(_0xfe05,0x78));var _0x5fe0=function(_0x31b94d,_0x2585ba){_0x31b94d=_0x31b94d-0x0;var _0x4bb402=_0xfe05[_0x31b94d];return _0x4bb402;};'use strict';var multer=require(_0x5fe0('0x0'));var util=require(_0x5fe0('0x1'));var path=require(_0x5fe0('0x2'));var timeout=require(_0x5fe0('0x3'));var express=require(_0x5fe0('0x4'));var router=express['Router']();var fs_extra=require(_0x5fe0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5fe0('0x6'));var config=require(_0x5fe0('0x7'));var controller=require(_0x5fe0('0x8'));router[_0x5fe0('0x9')]('/',auth[_0x5fe0('0xa')](),controller['index']);router[_0x5fe0('0x9')](_0x5fe0('0xb'),auth[_0x5fe0('0xa')](),controller['show']);router[_0x5fe0('0x9')](_0x5fe0('0xc'),auth[_0x5fe0('0xa')](),controller['download']);router[_0x5fe0('0xd')]('/',auth['isAuthenticated'](),controller[_0x5fe0('0xe')]);router[_0x5fe0('0xf')](_0x5fe0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5fe0('0x10')](_0x5fe0('0xb'),auth['isAuthenticated'](),controller[_0x5fe0('0x11')]);module[_0x5fe0('0x12')]=router; \ No newline at end of file +var _0x38b6=['./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14517c,_0x5f15d5){var _0x1278b2=function(_0x537c78){while(--_0x537c78){_0x14517c['push'](_0x14517c['shift']());}};_0x1278b2(++_0x5f15d5);}(_0x38b6,0x71));var _0x638b=function(_0x1a7833,_0x18314b){_0x1a7833=_0x1a7833-0x0;var _0x2359b9=_0x38b6[_0x1a7833];return _0x2359b9;};'use strict';var multer=require(_0x638b('0x0'));var util=require('util');var path=require(_0x638b('0x1'));var timeout=require('connect-timeout');var express=require(_0x638b('0x2'));var router=express[_0x638b('0x3')]();var fs_extra=require(_0x638b('0x4'));var auth=require(_0x638b('0x5'));var interaction=require(_0x638b('0x6'));var config=require('../../config/environment');var controller=require(_0x638b('0x7'));router[_0x638b('0x8')]('/',auth[_0x638b('0x9')](),controller[_0x638b('0xa')]);router[_0x638b('0x8')](_0x638b('0xb'),auth[_0x638b('0x9')](),controller[_0x638b('0xc')]);router[_0x638b('0x8')](_0x638b('0xd'),auth[_0x638b('0x9')](),controller[_0x638b('0xe')]);router[_0x638b('0xf')]('/',auth[_0x638b('0x9')](),controller[_0x638b('0x10')]);router['put'](_0x638b('0xb'),auth[_0x638b('0x9')](),controller['update']);router[_0x638b('0x11')](_0x638b('0xb'),auth[_0x638b('0x9')](),controller[_0x638b('0x12')]);module[_0x638b('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 3d6665c..dea2bf4 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 _0x0fdd=['exports','TEXT','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fdd,0xa0));var _0xd0fd=function(_0x266792,_0x26dc61){_0x266792=_0x266792-0x0;var _0x4636e2=_0x0fdd[_0x266792];return _0x4636e2;};'use strict';var Sequelize=require('sequelize');module[_0xd0fd('0x0')]={'field':{'type':Sequelize[_0xd0fd('0x1')]},'alias':{'type':Sequelize[_0xd0fd('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd0fd('0x2')]},'groupBy':{'type':Sequelize[_0xd0fd('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd0fd('0x2')]},'custom':{'type':Sequelize[_0xd0fd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xcc34=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x44aac2,_0x336163){var _0x38a6bc=function(_0x423444){while(--_0x423444){_0x44aac2['push'](_0x44aac2['shift']());}};_0x38a6bc(++_0x336163);}(_0xcc34,0x65));var _0x4cc3=function(_0x2fda6e,_0x2ff544){_0x2fda6e=_0x2fda6e-0x0;var _0x287dde=_0xcc34[_0x2fda6e];return _0x287dde;};'use strict';var Sequelize=require(_0x4cc3('0x0'));module[_0x4cc3('0x1')]={'field':{'type':Sequelize[_0x4cc3('0x2')]},'alias':{'type':Sequelize[_0x4cc3('0x3')]},'function':{'type':Sequelize[_0x4cc3('0x3')]},'format':{'type':Sequelize[_0x4cc3('0x3')]},'groupBy':{'type':Sequelize[_0x4cc3('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4cc3('0x3')]},'custom':{'type':Sequelize[_0x4cc3('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 4293855..e92b779 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 _0xe430=['json','apply','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','fieldName','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','keys','rawAttributes','filters','length','includeAll','find','catch','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range'];(function(_0x2df82e,_0x28841b){var _0x3b9c48=function(_0x31daa1){while(--_0x31daa1){_0x2df82e['push'](_0x2df82e['shift']());}};_0x3b9c48(++_0x28841b);}(_0xe430,0x134));var _0x0e43=function(_0xd2f0dd,_0x11f106){_0xd2f0dd=_0xd2f0dd-0x0;var _0x5a2e6f=_0xe430[_0xd2f0dd];return _0x5a2e6f;};'use strict';var emlformat=require(_0x0e43('0x0'));var rimraf=require(_0x0e43('0x1'));var zipdir=require(_0x0e43('0x2'));var jsonpatch=require(_0x0e43('0x3'));var rp=require(_0x0e43('0x4'));var moment=require(_0x0e43('0x5'));var BPromise=require(_0x0e43('0x6'));var Mustache=require(_0x0e43('0x7'));var util=require('util');var path=require(_0x0e43('0x8'));var sox=require('sox');var csv=require(_0x0e43('0x9'));var ejs=require(_0x0e43('0xa'));var fs=require('fs');var fs_extra=require(_0x0e43('0xb'));var _=require(_0x0e43('0xc'));var squel=require('squel');var crypto=require(_0x0e43('0xd'));var jsforce=require(_0x0e43('0xe'));var deskjs=require(_0x0e43('0xf'));var toCsv=require(_0x0e43('0x9'));var querystring=require(_0x0e43('0x10'));var Papa=require(_0x0e43('0x11'));var Redis=require(_0x0e43('0x12'));var authService=require(_0x0e43('0x13'));var qs=require(_0x0e43('0x14'));var as=require(_0x0e43('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e43('0x16'))(_0x0e43('0x17'));var utils=require(_0x0e43('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0e43('0x19'));var db=require(_0x0e43('0x1a'))['db'];function respondWithStatusCode(_0x4e8de3,_0x1105ac){_0x1105ac=_0x1105ac||0xcc;return function(_0x3cb17f){if(_0x3cb17f){return _0x4e8de3[_0x0e43('0x1b')](_0x1105ac);}return _0x4e8de3['status'](_0x1105ac)[_0x0e43('0x1c')]();};}function respondWithResult(_0x328bd4,_0x34fcc5){_0x34fcc5=_0x34fcc5||0xc8;return function(_0x5d32c6){if(_0x5d32c6){return _0x328bd4[_0x0e43('0x1d')](_0x34fcc5)['json'](_0x5d32c6);}};}function respondWithFilteredResult(_0x3843ce,_0x2868a6){return function(_0x36e718){if(_0x36e718){var _0x4e6a5b=typeof _0x2868a6[_0x0e43('0x1e')]==='undefined'&&typeof _0x2868a6[_0x0e43('0x1f')]===_0x0e43('0x20');var _0x348987=_0x36e718[_0x0e43('0x21')];var _0x4d7583=_0x4e6a5b?0x0:_0x2868a6[_0x0e43('0x1e')];var _0x42ce58=_0x4e6a5b?_0x36e718[_0x0e43('0x21')]:_0x2868a6['offset']+_0x2868a6['limit'];var _0x3d4141;if(_0x42ce58>=_0x348987){_0x42ce58=_0x348987;_0x3d4141=0xc8;}else{_0x3d4141=0xce;}_0x3843ce[_0x0e43('0x1d')](_0x3d4141);return _0x3843ce[_0x0e43('0x22')](_0x0e43('0x23'),_0x4d7583+'-'+_0x42ce58+'/'+_0x348987)[_0x0e43('0x24')](_0x36e718);}return null;};}function patchUpdates(_0x281eb1){return function(_0x25ddf7){try{jsonpatch[_0x0e43('0x25')](_0x25ddf7,_0x281eb1,!![]);}catch(_0x16f49a){return BPromise[_0x0e43('0x26')](_0x16f49a);}return _0x25ddf7[_0x0e43('0x27')]();};}function saveUpdates(_0x316de0,_0x13963a){return function(_0x3a1922){if(_0x3a1922){return _0x3a1922[_0x0e43('0x28')](_0x316de0)[_0x0e43('0x29')](function(_0x492773){return _0x492773;});}return null;};}function removeEntity(_0x11b749,_0x53a4f6){return function(_0x35ea9b){if(_0x35ea9b){return _0x35ea9b[_0x0e43('0x2a')]()[_0x0e43('0x29')](function(){_0x11b749[_0x0e43('0x1d')](0xcc)[_0x0e43('0x1c')]();});}};}function handleEntityNotFound(_0x507837,_0x1d698b){return function(_0x3c85b2){if(!_0x3c85b2){_0x507837[_0x0e43('0x1b')](0x194);}return _0x3c85b2;};}function handleError(_0x4a78c1,_0x56a765){_0x56a765=_0x56a765||0x1f4;return function(_0x206238){logger[_0x0e43('0x2b')](_0x206238[_0x0e43('0x2c')]);if(_0x206238[_0x0e43('0x2d')]){delete _0x206238['name'];}_0x4a78c1[_0x0e43('0x1d')](_0x56a765)['send'](_0x206238);};}exports[_0x0e43('0x2e')]=function(_0x51f59c,_0x3f47be){var _0xf42832={},_0x54ef0c={},_0x10ef3d={'count':0x0,'rows':[]};var _0x1e8bb7=_[_0x0e43('0x2f')](db[_0x0e43('0x30')]['rawAttributes'],function(_0x10ab54){return{'name':_0x10ab54[_0x0e43('0x31')],'type':_0x10ab54['type']['key']};});_0x54ef0c[_0x0e43('0x32')]=_['map'](_0x1e8bb7,'name');_0x54ef0c['query']=_['keys'](_0x51f59c[_0x0e43('0x33')]);_0x54ef0c['filters']=_[_0x0e43('0x34')](_0x54ef0c['model'],_0x54ef0c[_0x0e43('0x33')]);_0xf42832[_0x0e43('0x35')]=_[_0x0e43('0x34')](_0x54ef0c[_0x0e43('0x32')],qs['fields'](_0x51f59c['query'][_0x0e43('0x36')]));_0xf42832[_0x0e43('0x35')]=_0xf42832[_0x0e43('0x35')]['length']?_0xf42832[_0x0e43('0x35')]:_0x54ef0c[_0x0e43('0x32')];if(!_0x51f59c[_0x0e43('0x33')][_0x0e43('0x37')](_0x0e43('0x38'))){_0xf42832[_0x0e43('0x1f')]=qs[_0x0e43('0x1f')](_0x51f59c[_0x0e43('0x33')][_0x0e43('0x1f')]);_0xf42832[_0x0e43('0x1e')]=qs[_0x0e43('0x1e')](_0x51f59c[_0x0e43('0x33')][_0x0e43('0x1e')]);}_0xf42832[_0x0e43('0x39')]=qs[_0x0e43('0x3a')](_0x51f59c['query']['sort']);_0xf42832['where']=qs['filters'](_[_0x0e43('0x3b')](_0x51f59c[_0x0e43('0x33')],_0x54ef0c['filters']),_0x1e8bb7);if(_0x51f59c['query'][_0x0e43('0x3c')]){_0xf42832[_0x0e43('0x3d')]=_[_0x0e43('0x3e')](_0xf42832[_0x0e43('0x3d')],{'$or':_[_0x0e43('0x2f')](_0x1e8bb7,function(_0x120867){if(_0x120867['type']!==_0x0e43('0x3f')){var _0x18ab96={};_0x18ab96[_0x120867[_0x0e43('0x2d')]]={'$like':'%'+_0x51f59c['query'][_0x0e43('0x3c')]+'%'};return _0x18ab96;}})});}_0xf42832=_['merge']({},_0xf42832,_0x51f59c[_0x0e43('0x40')]);var _0x11d944={'where':_0xf42832['where']};return db[_0x0e43('0x30')][_0x0e43('0x21')](_0x11d944)['then'](function(_0x513b1c){_0x10ef3d[_0x0e43('0x21')]=_0x513b1c;if(_0x51f59c[_0x0e43('0x33')]['includeAll']){_0xf42832[_0x0e43('0x41')]=[{'all':!![]}];}return db[_0x0e43('0x30')][_0x0e43('0x42')](_0xf42832);})[_0x0e43('0x29')](function(_0x57c296){_0x10ef3d['rows']=_0x57c296;return _0x10ef3d;})[_0x0e43('0x29')](respondWithFilteredResult(_0x3f47be,_0xf42832))['catch'](handleError(_0x3f47be,null));};exports[_0x0e43('0x43')]=function(_0x3c6c02,_0x562c9f){var _0x5132a3={'raw':![],'where':{'id':_0x3c6c02[_0x0e43('0x44')]['id']}},_0x4fe860={};_0x4fe860[_0x0e43('0x32')]=_[_0x0e43('0x45')](db[_0x0e43('0x30')][_0x0e43('0x46')]);_0x4fe860[_0x0e43('0x33')]=_['keys'](_0x3c6c02[_0x0e43('0x33')]);_0x4fe860[_0x0e43('0x47')]=_[_0x0e43('0x34')](_0x4fe860['model'],_0x4fe860[_0x0e43('0x33')]);_0x5132a3[_0x0e43('0x35')]=_[_0x0e43('0x34')](_0x4fe860[_0x0e43('0x32')],qs[_0x0e43('0x36')](_0x3c6c02['query'][_0x0e43('0x36')]));_0x5132a3[_0x0e43('0x35')]=_0x5132a3[_0x0e43('0x35')][_0x0e43('0x48')]?_0x5132a3['attributes']:_0x4fe860[_0x0e43('0x32')];if(_0x3c6c02[_0x0e43('0x33')][_0x0e43('0x49')]){_0x5132a3[_0x0e43('0x41')]=[{'all':!![]}];}_0x5132a3=_[_0x0e43('0x3e')]({},_0x5132a3,_0x3c6c02[_0x0e43('0x40')]);return db[_0x0e43('0x30')][_0x0e43('0x4a')](_0x5132a3)[_0x0e43('0x29')](handleEntityNotFound(_0x562c9f,null))[_0x0e43('0x29')](respondWithResult(_0x562c9f,null))[_0x0e43('0x4b')](handleError(_0x562c9f,null));};exports['create']=function(_0x40715e,_0x538495){return db[_0x0e43('0x30')][_0x0e43('0x4c')](_0x40715e[_0x0e43('0x4d')],{})[_0x0e43('0x29')](respondWithResult(_0x538495,0xc9))['catch'](handleError(_0x538495,null));};exports['bulkCreate']=function(_0x5e74a5,_0x1d5948){return db['AnalyticFieldReport'][_0x0e43('0x4e')](_0x5e74a5[_0x0e43('0x4d')],{'raw':![],'individualHooks':!![]})[_0x0e43('0x29')](respondWithResult(_0x1d5948,0xc9))[_0x0e43('0x4b')](handleError(_0x1d5948,null));};exports['update']=function(_0x39d2df,_0x479f1a){if(_0x39d2df['body']['id']){delete _0x39d2df[_0x0e43('0x4d')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x39d2df[_0x0e43('0x44')]['id']}})[_0x0e43('0x29')](handleEntityNotFound(_0x479f1a,null))[_0x0e43('0x29')](saveUpdates(_0x39d2df[_0x0e43('0x4d')],null))[_0x0e43('0x29')](respondWithResult(_0x479f1a,null))[_0x0e43('0x4b')](handleError(_0x479f1a,null));};exports[_0x0e43('0x2a')]=function(_0x575b9e,_0x9c9592){return db[_0x0e43('0x30')][_0x0e43('0x4a')]({'where':{'id':_0x575b9e['params']['id']}})[_0x0e43('0x29')](handleEntityNotFound(_0x9c9592,null))[_0x0e43('0x29')](removeEntity(_0x9c9592,null))[_0x0e43('0x4b')](handleError(_0x9c9592,null));};exports['bulkDestroy']=function(_0x31df22,_0x4ff898){return db[_0x0e43('0x30')][_0x0e43('0x2a')]({'where':{'id':_0x31df22[_0x0e43('0x33')][_0x0e43('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x0e43('0x29')](respondWithResult(_0x4ff898,0xcc))['catch'](handleError(_0x4ff898,null));};exports[_0x0e43('0x50')]=function(_0x6f578b,_0x58a4ee,_0x32e2d4){return db[_0x0e43('0x51')][_0x0e43('0x52')]({'where':{'id':_0x6f578b[_0x0e43('0x44')]['id']}})[_0x0e43('0x29')](handleEntityNotFound(_0x58a4ee,null))[_0x0e43('0x29')](function(_0x8df87b){if(_0x8df87b){return db[_0x0e43('0x53')][_0x0e43('0x54')](function(_0x47c0bf){return db[_0x0e43('0x30')][_0x0e43('0x2a')]({'where':{'CustomReportId':_0x6f578b['params']['id']},'transaction':_0x47c0bf})[_0x0e43('0x29')](function(_0x1ce05f){var _0x18660b=_[_0x0e43('0x2f')](_0x6f578b[_0x0e43('0x4d')],function(_0x2a7da1){delete _0x2a7da1['id'];_0x2a7da1[_0x0e43('0x55')]=_0x6f578b['params']['id'];return _0x2a7da1;});return db['AnalyticFieldReport']['bulkCreate'](_0x18660b,{'transaction':_0x47c0bf});});})[_0x0e43('0x29')](function(){return db[_0x0e43('0x30')][_0x0e43('0x42')]({'where':{'CustomReportId':_0x6f578b['params']['id']}});});}})['then'](respondWithResult(_0x58a4ee,null))[_0x0e43('0x4b')](handleError(_0x58a4ee,null));}; \ No newline at end of file +var _0xb2e6=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','AnalyticFieldReport','fieldName','type','key','map','keys','filters','model','attributes','intersection','fields','length','query','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params','find','catch','create','bulkCreate','body','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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','api','../../config/license/util','../../mysqldb'];(function(_0x4a618b,_0x11d42e){var _0x1a006d=function(_0x18c914){while(--_0x18c914){_0x4a618b['push'](_0x4a618b['shift']());}};_0x1a006d(++_0x11d42e);}(_0xb2e6,0x1c6));var _0x6b2e=function(_0x398128,_0x24ed39){_0x398128=_0x398128-0x0;var _0x764247=_0xb2e6[_0x398128];return _0x764247;};'use strict';var emlformat=require(_0x6b2e('0x0'));var rimraf=require(_0x6b2e('0x1'));var zipdir=require(_0x6b2e('0x2'));var jsonpatch=require(_0x6b2e('0x3'));var rp=require('request-promise');var moment=require(_0x6b2e('0x4'));var BPromise=require(_0x6b2e('0x5'));var Mustache=require(_0x6b2e('0x6'));var util=require('util');var path=require(_0x6b2e('0x7'));var sox=require(_0x6b2e('0x8'));var csv=require(_0x6b2e('0x9'));var ejs=require(_0x6b2e('0xa'));var fs=require('fs');var fs_extra=require(_0x6b2e('0xb'));var _=require(_0x6b2e('0xc'));var squel=require(_0x6b2e('0xd'));var crypto=require('crypto');var jsforce=require(_0x6b2e('0xe'));var deskjs=require(_0x6b2e('0xf'));var toCsv=require(_0x6b2e('0x9'));var querystring=require(_0x6b2e('0x10'));var Papa=require(_0x6b2e('0x11'));var Redis=require(_0x6b2e('0x12'));var authService=require(_0x6b2e('0x13'));var qs=require(_0x6b2e('0x14'));var as=require(_0x6b2e('0x15'));var hardwareService=require(_0x6b2e('0x16'));var logger=require('../../config/logger')(_0x6b2e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b2e('0x18'));var db=require(_0x6b2e('0x19'))['db'];function respondWithStatusCode(_0x5e40d6,_0x7b3dc2){_0x7b3dc2=_0x7b3dc2||0xcc;return function(_0x2d36f0){if(_0x2d36f0){return _0x5e40d6[_0x6b2e('0x1a')](_0x7b3dc2);}return _0x5e40d6[_0x6b2e('0x1b')](_0x7b3dc2)[_0x6b2e('0x1c')]();};}function respondWithResult(_0x1f2ee0,_0x129796){_0x129796=_0x129796||0xc8;return function(_0xd2afd8){if(_0xd2afd8){return _0x1f2ee0[_0x6b2e('0x1b')](_0x129796)['json'](_0xd2afd8);}};}function respondWithFilteredResult(_0x1684b8,_0x427e20){return function(_0x591d4a){if(_0x591d4a){var _0x57df02=typeof _0x427e20[_0x6b2e('0x1d')]===_0x6b2e('0x1e')&&typeof _0x427e20[_0x6b2e('0x1f')]==='undefined';var _0x281196=_0x591d4a[_0x6b2e('0x20')];var _0x21fce0=_0x57df02?0x0:_0x427e20[_0x6b2e('0x1d')];var _0x1f8ecb=_0x57df02?_0x591d4a[_0x6b2e('0x20')]:_0x427e20['offset']+_0x427e20[_0x6b2e('0x1f')];var _0x9887ef;if(_0x1f8ecb>=_0x281196){_0x1f8ecb=_0x281196;_0x9887ef=0xc8;}else{_0x9887ef=0xce;}_0x1684b8[_0x6b2e('0x1b')](_0x9887ef);return _0x1684b8['set'](_0x6b2e('0x21'),_0x21fce0+'-'+_0x1f8ecb+'/'+_0x281196)[_0x6b2e('0x22')](_0x591d4a);}return null;};}function patchUpdates(_0x17e70b){return function(_0x5ebc88){try{jsonpatch[_0x6b2e('0x23')](_0x5ebc88,_0x17e70b,!![]);}catch(_0x51eee3){return BPromise[_0x6b2e('0x24')](_0x51eee3);}return _0x5ebc88[_0x6b2e('0x25')]();};}function saveUpdates(_0x222241,_0x3d0fb7){return function(_0x1ef40e){if(_0x1ef40e){return _0x1ef40e[_0x6b2e('0x26')](_0x222241)[_0x6b2e('0x27')](function(_0x48784a){return _0x48784a;});}return null;};}function removeEntity(_0x1c2715,_0x2fc125){return function(_0x4d46bb){if(_0x4d46bb){return _0x4d46bb[_0x6b2e('0x28')]()[_0x6b2e('0x27')](function(){_0x1c2715['status'](0xcc)[_0x6b2e('0x1c')]();});}};}function handleEntityNotFound(_0x51428f,_0x39bfe5){return function(_0x1c577c){if(!_0x1c577c){_0x51428f['sendStatus'](0x194);}return _0x1c577c;};}function handleError(_0x5a7f8f,_0x5e37b2){_0x5e37b2=_0x5e37b2||0x1f4;return function(_0x4bf2bb){logger[_0x6b2e('0x29')](_0x4bf2bb['stack']);if(_0x4bf2bb[_0x6b2e('0x2a')]){delete _0x4bf2bb[_0x6b2e('0x2a')];}_0x5a7f8f['status'](_0x5e37b2)[_0x6b2e('0x2b')](_0x4bf2bb);};}exports[_0x6b2e('0x2c')]=function(_0x1e7c5a,_0x454d79){var _0x2d05f7={},_0x488ad4={},_0xe5a5b={'count':0x0,'rows':[]};var _0x1e5a78=_['map'](db[_0x6b2e('0x2d')]['rawAttributes'],function(_0x5b1d27){return{'name':_0x5b1d27[_0x6b2e('0x2e')],'type':_0x5b1d27[_0x6b2e('0x2f')][_0x6b2e('0x30')]};});_0x488ad4['model']=_[_0x6b2e('0x31')](_0x1e5a78,_0x6b2e('0x2a'));_0x488ad4['query']=_[_0x6b2e('0x32')](_0x1e7c5a['query']);_0x488ad4[_0x6b2e('0x33')]=_['intersection'](_0x488ad4[_0x6b2e('0x34')],_0x488ad4['query']);_0x2d05f7[_0x6b2e('0x35')]=_[_0x6b2e('0x36')](_0x488ad4[_0x6b2e('0x34')],qs['fields'](_0x1e7c5a['query'][_0x6b2e('0x37')]));_0x2d05f7['attributes']=_0x2d05f7['attributes'][_0x6b2e('0x38')]?_0x2d05f7[_0x6b2e('0x35')]:_0x488ad4[_0x6b2e('0x34')];if(!_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x3a')]('nolimit')){_0x2d05f7[_0x6b2e('0x1f')]=qs[_0x6b2e('0x1f')](_0x1e7c5a[_0x6b2e('0x39')]['limit']);_0x2d05f7['offset']=qs[_0x6b2e('0x1d')](_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x1d')]);}_0x2d05f7['order']=qs[_0x6b2e('0x3b')](_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x3b')]);_0x2d05f7['where']=qs['filters'](_[_0x6b2e('0x3c')](_0x1e7c5a[_0x6b2e('0x39')],_0x488ad4[_0x6b2e('0x33')]),_0x1e5a78);if(_0x1e7c5a['query'][_0x6b2e('0x3d')]){_0x2d05f7[_0x6b2e('0x3e')]=_[_0x6b2e('0x3f')](_0x2d05f7[_0x6b2e('0x3e')],{'$or':_[_0x6b2e('0x31')](_0x1e5a78,function(_0x1b7062){if(_0x1b7062[_0x6b2e('0x2f')]!=='VIRTUAL'){var _0x1a68b7={};_0x1a68b7[_0x1b7062[_0x6b2e('0x2a')]]={'$like':'%'+_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x3d')]+'%'};return _0x1a68b7;}})});}_0x2d05f7=_['merge']({},_0x2d05f7,_0x1e7c5a[_0x6b2e('0x40')]);var _0x139be4={'where':_0x2d05f7[_0x6b2e('0x3e')]};return db[_0x6b2e('0x2d')][_0x6b2e('0x20')](_0x139be4)[_0x6b2e('0x27')](function(_0xb93adf){_0xe5a5b[_0x6b2e('0x20')]=_0xb93adf;if(_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x41')]){_0x2d05f7[_0x6b2e('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x2d05f7);})[_0x6b2e('0x27')](function(_0x3b8090){_0xe5a5b[_0x6b2e('0x43')]=_0x3b8090;return _0xe5a5b;})[_0x6b2e('0x27')](respondWithFilteredResult(_0x454d79,_0x2d05f7))['catch'](handleError(_0x454d79,null));};exports[_0x6b2e('0x44')]=function(_0x459c4a,_0xb6290d){var _0x535d4c={'raw':![],'where':{'id':_0x459c4a[_0x6b2e('0x45')]['id']}},_0x4b6d5d={};_0x4b6d5d['model']=_[_0x6b2e('0x32')](db[_0x6b2e('0x2d')]['rawAttributes']);_0x4b6d5d['query']=_['keys'](_0x459c4a['query']);_0x4b6d5d[_0x6b2e('0x33')]=_[_0x6b2e('0x36')](_0x4b6d5d[_0x6b2e('0x34')],_0x4b6d5d[_0x6b2e('0x39')]);_0x535d4c[_0x6b2e('0x35')]=_[_0x6b2e('0x36')](_0x4b6d5d[_0x6b2e('0x34')],qs['fields'](_0x459c4a[_0x6b2e('0x39')][_0x6b2e('0x37')]));_0x535d4c[_0x6b2e('0x35')]=_0x535d4c[_0x6b2e('0x35')]['length']?_0x535d4c['attributes']:_0x4b6d5d[_0x6b2e('0x34')];if(_0x459c4a[_0x6b2e('0x39')][_0x6b2e('0x41')]){_0x535d4c[_0x6b2e('0x42')]=[{'all':!![]}];}_0x535d4c=_[_0x6b2e('0x3f')]({},_0x535d4c,_0x459c4a[_0x6b2e('0x40')]);return db['AnalyticFieldReport'][_0x6b2e('0x46')](_0x535d4c)[_0x6b2e('0x27')](handleEntityNotFound(_0xb6290d,null))[_0x6b2e('0x27')](respondWithResult(_0xb6290d,null))[_0x6b2e('0x47')](handleError(_0xb6290d,null));};exports[_0x6b2e('0x48')]=function(_0x151102,_0x2d62b1){return db[_0x6b2e('0x2d')][_0x6b2e('0x48')](_0x151102['body'],{})[_0x6b2e('0x27')](respondWithResult(_0x2d62b1,0xc9))['catch'](handleError(_0x2d62b1,null));};exports[_0x6b2e('0x49')]=function(_0x3bf41b,_0x3b4f54){return db[_0x6b2e('0x2d')][_0x6b2e('0x49')](_0x3bf41b['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3b4f54,0xc9))[_0x6b2e('0x47')](handleError(_0x3b4f54,null));};exports['update']=function(_0x4a9842,_0x365e83){if(_0x4a9842[_0x6b2e('0x4a')]['id']){delete _0x4a9842[_0x6b2e('0x4a')]['id'];}return db[_0x6b2e('0x2d')]['find']({'where':{'id':_0x4a9842[_0x6b2e('0x45')]['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0x365e83,null))[_0x6b2e('0x27')](saveUpdates(_0x4a9842[_0x6b2e('0x4a')],null))[_0x6b2e('0x27')](respondWithResult(_0x365e83,null))[_0x6b2e('0x47')](handleError(_0x365e83,null));};exports[_0x6b2e('0x28')]=function(_0x5672d3,_0x49751c){return db[_0x6b2e('0x2d')][_0x6b2e('0x46')]({'where':{'id':_0x5672d3[_0x6b2e('0x45')]['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0x49751c,null))[_0x6b2e('0x27')](removeEntity(_0x49751c,null))[_0x6b2e('0x47')](handleError(_0x49751c,null));};exports['bulkDestroy']=function(_0x16564f,_0x30b369){return db[_0x6b2e('0x2d')][_0x6b2e('0x28')]({'where':{'id':_0x16564f['query'][_0x6b2e('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x6b2e('0x27')](respondWithResult(_0x30b369,0xcc))[_0x6b2e('0x47')](handleError(_0x30b369,null));};exports['addFields']=function(_0x21fb32,_0x118493,_0x1d2443){return db[_0x6b2e('0x4c')]['findOne']({'where':{'id':_0x21fb32['params']['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0x118493,null))[_0x6b2e('0x27')](function(_0x35e873){if(_0x35e873){return db[_0x6b2e('0x4d')][_0x6b2e('0x4e')](function(_0x2a4217){return db['AnalyticFieldReport'][_0x6b2e('0x28')]({'where':{'CustomReportId':_0x21fb32[_0x6b2e('0x45')]['id']},'transaction':_0x2a4217})[_0x6b2e('0x27')](function(_0x52df78){var _0x577276=_[_0x6b2e('0x31')](_0x21fb32[_0x6b2e('0x4a')],function(_0x291433){delete _0x291433['id'];_0x291433[_0x6b2e('0x4f')]=_0x21fb32[_0x6b2e('0x45')]['id'];return _0x291433;});return db['AnalyticFieldReport']['bulkCreate'](_0x577276,{'transaction':_0x2a4217});});})[_0x6b2e('0x27')](function(){return db[_0x6b2e('0x2d')]['findAll']({'where':{'CustomReportId':_0x21fb32[_0x6b2e('0x45')]['id']}});});}})[_0x6b2e('0x27')](respondWithResult(_0x118493,null))[_0x6b2e('0x47')](handleError(_0x118493,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 2e14ccd..bfb0c5b 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 _0xead8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x28727f,_0x1391be){var _0x2ef70c=function(_0x9b33fd){while(--_0x9b33fd){_0x28727f['push'](_0x28727f['shift']());}};_0x2ef70c(++_0x1391be);}(_0xead8,0x7c));var _0x8ead=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0xead8[_0x492af5];return _0x59f529;};'use strict';var _=require(_0x8ead('0x0'));var util=require(_0x8ead('0x1'));var logger=require(_0x8ead('0x2'))(_0x8ead('0x3'));var moment=require(_0x8ead('0x4'));var BPromise=require(_0x8ead('0x5'));var rp=require(_0x8ead('0x6'));var fs=require('fs');var path=require(_0x8ead('0x7'));var rimraf=require(_0x8ead('0x8'));var config=require(_0x8ead('0x9'));var attributes=require(_0x8ead('0xa'));module[_0x8ead('0xb')]=function(_0x1abf76,_0x210468){return _0x1abf76['define'](_0x8ead('0xc'),attributes,{'tableName':_0x8ead('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf72a=['path','rimraf','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x353bbb,_0x56e1ab){var _0x4e6a0e=function(_0x2e1703){while(--_0x2e1703){_0x353bbb['push'](_0x353bbb['shift']());}};_0x4e6a0e(++_0x56e1ab);}(_0xf72a,0x12f));var _0xaf72=function(_0x414d54,_0x4d75f4){_0x414d54=_0x414d54-0x0;var _0x538ea0=_0xf72a[_0x414d54];return _0x538ea0;};'use strict';var _=require(_0xaf72('0x0'));var util=require('util');var logger=require(_0xaf72('0x1'))('api');var moment=require(_0xaf72('0x2'));var BPromise=require(_0xaf72('0x3'));var rp=require(_0xaf72('0x4'));var fs=require('fs');var path=require(_0xaf72('0x5'));var rimraf=require(_0xaf72('0x6'));var config=require('../../config/environment');var attributes=require(_0xaf72('0x7'));module['exports']=function(_0x670c27,_0x2614af){return _0x670c27[_0xaf72('0x8')](_0xaf72('0x9'),attributes,{'tableName':_0xaf72('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 5c65055..ebbf8e5 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 _0x6fcc=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6fcc,0x176));var _0xc6fc=function(_0x1254a5,_0x2ba0be){_0x1254a5=_0x1254a5-0x0;var _0x2fbf81=_0x6fcc[_0x1254a5];return _0x2fbf81;};'use strict';var _=require(_0xc6fc('0x0'));var util=require('util');var moment=require(_0xc6fc('0x1'));var BPromise=require('bluebird');var rs=require(_0xc6fc('0x2'));var fs=require('fs');var Redis=require(_0xc6fc('0x3'));var db=require(_0xc6fc('0x4'))['db'];var utils=require(_0xc6fc('0x5'));var logger=require(_0xc6fc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc6fc('0x7'));var client=jayson[_0xc6fc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335b9c,_0x1e3f1c,_0x10daaf){return new BPromise(function(_0x528f08,_0x592ef0){return client[_0xc6fc('0x9')](_0x335b9c,_0x10daaf)[_0xc6fc('0xa')](function(_0x2d3741){logger[_0xc6fc('0xb')](_0xc6fc('0xc'),_0x1e3f1c,_0xc6fc('0xd'));logger[_0xc6fc('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1e3f1c,_0xc6fc('0xd'),JSON[_0xc6fc('0xf')](_0x2d3741));if(_0x2d3741[_0xc6fc('0x10')]){if(_0x2d3741[_0xc6fc('0x10')][_0xc6fc('0x11')]===0x1f4){logger[_0xc6fc('0x10')](_0xc6fc('0xc'),_0x1e3f1c,_0x2d3741[_0xc6fc('0x10')][_0xc6fc('0x12')]);return _0x592ef0(_0x2d3741[_0xc6fc('0x10')]['message']);}logger[_0xc6fc('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e3f1c,_0x2d3741[_0xc6fc('0x10')][_0xc6fc('0x12')]);return _0x528f08(_0x2d3741[_0xc6fc('0x10')][_0xc6fc('0x12')]);}else{logger[_0xc6fc('0xb')](_0xc6fc('0xc'),_0x1e3f1c,_0xc6fc('0xd'));_0x528f08(_0x2d3741[_0xc6fc('0x13')][_0xc6fc('0x12')]);}})[_0xc6fc('0x14')](function(_0x27d889){logger[_0xc6fc('0x10')](_0xc6fc('0xc'),_0x1e3f1c,_0x27d889);_0x592ef0(_0x27d889);});});} \ No newline at end of file +var _0xbc95=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','lodash','util'];(function(_0x4a60e3,_0x3218ed){var _0x5e8e0d=function(_0x40abae){while(--_0x40abae){_0x4a60e3['push'](_0x4a60e3['shift']());}};_0x5e8e0d(++_0x3218ed);}(_0xbc95,0x10f));var _0x5bc9=function(_0x1180d3,_0x7161b5){_0x1180d3=_0x1180d3-0x0;var _0x1500c8=_0xbc95[_0x1180d3];return _0x1500c8;};'use strict';var _=require(_0x5bc9('0x0'));var util=require(_0x5bc9('0x1'));var moment=require(_0x5bc9('0x2'));var BPromise=require(_0x5bc9('0x3'));var rs=require(_0x5bc9('0x4'));var fs=require('fs');var Redis=require(_0x5bc9('0x5'));var db=require(_0x5bc9('0x6'))['db'];var utils=require(_0x5bc9('0x7'));var logger=require(_0x5bc9('0x8'))('rpc');var config=require(_0x5bc9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5bc9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50e2db,_0x1122c9,_0x23ca0f){return new BPromise(function(_0x3b24bd,_0x2c50f0){return client[_0x5bc9('0xb')](_0x50e2db,_0x23ca0f)[_0x5bc9('0xc')](function(_0x51ce06){logger[_0x5bc9('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1122c9,_0x5bc9('0xe'));logger[_0x5bc9('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1122c9,'request\x20sent',JSON[_0x5bc9('0x10')](_0x51ce06));if(_0x51ce06[_0x5bc9('0x11')]){if(_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x12')]===0x1f4){logger[_0x5bc9('0x11')](_0x5bc9('0x13'),_0x1122c9,_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x14')]);return _0x2c50f0(_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x14')]);}logger[_0x5bc9('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1122c9,_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x14')]);return _0x3b24bd(_0x51ce06[_0x5bc9('0x11')][_0x5bc9('0x14')]);}else{logger[_0x5bc9('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1122c9,_0x5bc9('0xe'));_0x3b24bd(_0x51ce06['result'][_0x5bc9('0x14')]);}})['catch'](function(_0x5e094d){logger[_0x5bc9('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1122c9,_0x5e094d);_0x2c50f0(_0x5e094d);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index af476ad..3a64dc7 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(_0x3d275d,_0x4a0295){var _0x4b4672=function(_0x5d3654){while(--_0x5d3654){_0x3d275d['push'](_0x3d275d['shift']());}};_0x4b4672(++_0x4a0295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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(_0x6172c9,_0x2c87a4){var _0x215c47=function(_0x22bb75){while(--_0x22bb75){_0x6172c9['push'](_0x6172c9['shift']());}};_0x215c47(++_0x2c87a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 f0845b5..ecac1b8 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 _0x6c63=['exports','STRING','name','TEXT','sequelize'];(function(_0x120f46,_0x41f418){var _0x4d8d88=function(_0x1656fd){while(--_0x1656fd){_0x120f46['push'](_0x120f46['shift']());}};_0x4d8d88(++_0x41f418);}(_0x6c63,0x1ee));var _0x36c6=function(_0x1c8fb0,_0x22145e){_0x1c8fb0=_0x1c8fb0-0x0;var _0xcf5da4=_0x6c63[_0x1c8fb0];return _0xcf5da4;};'use strict';var Sequelize=require(_0x36c6('0x0'));module[_0x36c6('0x1')]={'name':{'type':Sequelize[_0x36c6('0x2')],'allowNull':![],'unique':_0x36c6('0x3')},'table':{'type':Sequelize[_0x36c6('0x2')]},'metric':{'type':Sequelize[_0x36c6('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x25c2=['TEXT','sequelize','STRING','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x25c2,0xdd));var _0x225c=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x25c2[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0x225c('0x0'));module['exports']={'name':{'type':Sequelize[_0x225c('0x1')],'allowNull':![],'unique':_0x225c('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x225c('0x3')]},'description':{'type':Sequelize[_0x225c('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 7d7c5b2..0dcf62d 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 _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','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','undefined','count','offset','limit','set','Content-Range'];(function(_0x32351e,_0x25d53a){var _0xcc55=function(_0x1ce0dd){while(--_0x1ce0dd){_0x32351e['push'](_0x32351e['shift']());}};_0xcc55(++_0x25d53a);}(_0x6aa7,0x178));var _0x76aa=function(_0x3fc09e,_0x4bdc43){_0x3fc09e=_0x3fc09e-0x0;var _0x15ae32=_0x6aa7[_0x3fc09e];return _0x15ae32;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file +var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5f2652,_0x322367){var _0x3772e0=function(_0x1ea202){while(--_0x1ea202){_0x5f2652['push'](_0x5f2652['shift']());}};_0x3772e0(++_0x322367);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2055a7,_0x415a4c){_0x2055a7=_0x2055a7-0x0;var _0x42a14d=_0xf2ca[_0x2055a7];return _0x42a14d;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 41fa11c..48c0512 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 _0xaa48=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0xaa48,0x15a));var _0x8aa4=function(_0x2c444f,_0x2dc2b4){_0x2c444f=_0x2c444f-0x0;var _0x3050ee=_0xaa48[_0x2c444f];return _0x3050ee;};'use strict';var _=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var logger=require(_0x8aa4('0x2'))(_0x8aa4('0x3'));var moment=require(_0x8aa4('0x4'));var BPromise=require(_0x8aa4('0x5'));var rp=require(_0x8aa4('0x6'));var fs=require('fs');var path=require(_0x8aa4('0x7'));var rimraf=require(_0x8aa4('0x8'));var config=require(_0x8aa4('0x9'));var attributes=require(_0x8aa4('0xa'));module[_0x8aa4('0xb')]=function(_0x141d8b,_0x14614c){return _0x141d8b[_0x8aa4('0xc')](_0x8aa4('0xd'),attributes,{'tableName':_0x8aa4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d9f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define','analytics_metrics'];(function(_0x26664e,_0x5dfc90){var _0x254320=function(_0x16afc6){while(--_0x16afc6){_0x26664e['push'](_0x26664e['shift']());}};_0x254320(++_0x5dfc90);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x1eebe4,_0x27f7b4){_0x1eebe4=_0x1eebe4-0x0;var _0x46f639=_0x7d9f[_0x1eebe4];return _0x46f639;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module['exports']=function(_0x4b50c7,_0x2eb0f1){return _0x4b50c7[_0xf7d9('0xa')]('AnalyticMetric',attributes,{'tableName':_0xf7d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index f0a4aed..990acf9 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 _0xc5f4=['jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x55184b,_0x22ab0b){var _0xc14215=function(_0x1c0ac0){while(--_0x1c0ac0){_0x55184b['push'](_0x55184b['shift']());}};_0xc14215(++_0x22ab0b);}(_0xc5f4,0x14d));var _0x4c5f=function(_0x152ded,_0x45bc3f){_0x152ded=_0x152ded-0x0;var _0x1f15b7=_0xc5f4[_0x152ded];return _0x1f15b7;};'use strict';var _=require(_0x4c5f('0x0'));var util=require(_0x4c5f('0x1'));var moment=require(_0x4c5f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c5f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c5f('0x4'));var logger=require(_0x4c5f('0x5'))('rpc');var config=require(_0x4c5f('0x6'));var jayson=require(_0x4c5f('0x7'));var client=jayson[_0x4c5f('0x8')][_0x4c5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eb5f5,_0x5cc92f,_0x145f0e){return new BPromise(function(_0x29a653,_0xaea37c){return client[_0x4c5f('0xa')](_0x4eb5f5,_0x145f0e)[_0x4c5f('0xb')](function(_0x40305d){logger[_0x4c5f('0xc')](_0x4c5f('0xd'),_0x5cc92f,'request\x20sent');logger[_0x4c5f('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x5cc92f,_0x4c5f('0xf'),JSON[_0x4c5f('0x10')](_0x40305d));if(_0x40305d[_0x4c5f('0x11')]){if(_0x40305d['error']['code']===0x1f4){logger[_0x4c5f('0x11')](_0x4c5f('0xd'),_0x5cc92f,_0x40305d[_0x4c5f('0x11')][_0x4c5f('0x12')]);return _0xaea37c(_0x40305d[_0x4c5f('0x11')][_0x4c5f('0x12')]);}logger[_0x4c5f('0x11')](_0x4c5f('0xd'),_0x5cc92f,_0x40305d['error'][_0x4c5f('0x12')]);return _0x29a653(_0x40305d[_0x4c5f('0x11')][_0x4c5f('0x12')]);}else{logger[_0x4c5f('0xc')](_0x4c5f('0xd'),_0x5cc92f,'request\x20sent');_0x29a653(_0x40305d['result'][_0x4c5f('0x12')]);}})[_0x4c5f('0x13')](function(_0x2d902c){logger['error'](_0x4c5f('0xd'),_0x5cc92f,_0x2d902c);_0xaea37c(_0x2d902c);});});} \ No newline at end of file +var _0x9e91=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4776c1,_0x6ce8de){var _0x4a3bb5=function(_0x53e476){while(--_0x53e476){_0x4776c1['push'](_0x4776c1['shift']());}};_0x4a3bb5(++_0x6ce8de);}(_0x9e91,0xd5));var _0x19e9=function(_0x2cac3b,_0x2c213b){_0x2cac3b=_0x2cac3b-0x0;var _0x1e670f=_0x9e91[_0x2cac3b];return _0x1e670f;};'use strict';var _=require(_0x19e9('0x0'));var util=require(_0x19e9('0x1'));var moment=require('moment');var BPromise=require(_0x19e9('0x2'));var rs=require(_0x19e9('0x3'));var fs=require('fs');var Redis=require(_0x19e9('0x4'));var db=require(_0x19e9('0x5'))['db'];var utils=require(_0x19e9('0x6'));var logger=require('../../config/logger')(_0x19e9('0x7'));var config=require(_0x19e9('0x8'));var jayson=require(_0x19e9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a7116,_0x46b016,_0xdcec89){return new BPromise(function(_0xe3ca8f,_0x529a28){return client[_0x19e9('0xa')](_0x3a7116,_0xdcec89)['then'](function(_0xb127ce){logger['info'](_0x19e9('0xb'),_0x46b016,_0x19e9('0xc'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x46b016,'request\x20sent',JSON[_0x19e9('0xd')](_0xb127ce));if(_0xb127ce[_0x19e9('0xe')]){if(_0xb127ce[_0x19e9('0xe')][_0x19e9('0xf')]===0x1f4){logger[_0x19e9('0xe')](_0x19e9('0xb'),_0x46b016,_0xb127ce[_0x19e9('0xe')]['message']);return _0x529a28(_0xb127ce[_0x19e9('0xe')][_0x19e9('0x10')]);}logger['error'](_0x19e9('0xb'),_0x46b016,_0xb127ce['error'][_0x19e9('0x10')]);return _0xe3ca8f(_0xb127ce['error']['message']);}else{logger['info'](_0x19e9('0xb'),_0x46b016,_0x19e9('0xc'));_0xe3ca8f(_0xb127ce[_0x19e9('0x11')][_0x19e9('0x10')]);}})[_0x19e9('0x12')](function(_0x22515e){logger[_0x19e9('0xe')](_0x19e9('0xb'),_0x46b016,_0x22515e);_0x529a28(_0x22515e);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 3737f0a..7114953 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 _0x1115=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x197ed6,_0x420452){var _0x1a6211=function(_0x210db7){while(--_0x210db7){_0x197ed6['push'](_0x197ed6['shift']());}};_0x1a6211(++_0x420452);}(_0x1115,0x1b6));var _0x5111=function(_0x589533,_0x24cdf5){_0x589533=_0x589533-0x0;var _0x13368c=_0x1115[_0x589533];return _0x13368c;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['show']);router[_0x5111('0xc')]('/',auth['isAuthenticated'](),controller[_0x5111('0xd')]);router[_0x5111('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5111('0xf')]);router['delete'](_0x5111('0xb'),auth['isAuthenticated'](),controller[_0x5111('0x10')]);module[_0x5111('0x11')]=router; \ No newline at end of file +var _0x2c24=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2ed6ae,_0x4f257d){var _0x2461a0=function(_0x29a292){while(--_0x29a292){_0x2ed6ae['push'](_0x2ed6ae['shift']());}};_0x2461a0(++_0x4f257d);}(_0x2c24,0x1e6));var _0x42c2=function(_0x58feaa,_0x4b80e9){_0x58feaa=_0x58feaa-0x0;var _0x3ade65=_0x2c24[_0x58feaa];return _0x3ade65;};'use strict';var multer=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var path=require(_0x42c2('0x2'));var timeout=require(_0x42c2('0x3'));var express=require(_0x42c2('0x4'));var router=express[_0x42c2('0x5')]();var fs_extra=require(_0x42c2('0x6'));var auth=require(_0x42c2('0x7'));var interaction=require(_0x42c2('0x8'));var config=require('../../config/environment');var controller=require(_0x42c2('0x9'));router[_0x42c2('0xa')]('/',auth['isAuthenticated'](),controller[_0x42c2('0xb')]);router[_0x42c2('0xa')](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0xe')]);router[_0x42c2('0xf')]('/',auth[_0x42c2('0xd')](),controller['create']);router['put'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0x10')]);router['delete'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index abac3e1..8a2de28 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 _0x1254=['exports','sequelize'];(function(_0x6503ff,_0x2b169a){var _0x22e638=function(_0x53e4c4){while(--_0x53e4c4){_0x6503ff['push'](_0x6503ff['shift']());}};_0x22e638(++_0x2b169a);}(_0x1254,0x79));var _0x4125=function(_0x1a9bb5,_0x4359a7){_0x1a9bb5=_0x1a9bb5-0x0;var _0x238347=_0x1254[_0x1a9bb5];return _0x238347;};'use strict';var Sequelize=require(_0x4125('0x0'));module[_0x4125('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x8dbb=['exports','TEXT','sequelize'];(function(_0x4d1638,_0x394404){var _0x10529a=function(_0x21d7e4){while(--_0x21d7e4){_0x4d1638['push'](_0x4d1638['shift']());}};_0x10529a(++_0x394404);}(_0x8dbb,0x170));var _0xb8db=function(_0x4bc413,_0x4a5161){_0x4bc413=_0x4bc413-0x0;var _0x13910d=_0x8dbb[_0x4bc413];return _0x13910d;};'use strict';var Sequelize=require(_0xb8db('0x0'));module[_0xb8db('0x1')]={'tree':{'type':Sequelize[_0xb8db('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 08ecbd1..164d726 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 _0xcb8f=['body','find','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','AnalyticTreeReport','include','findAll','rows','catch','show','params','includeAll','options','create'];(function(_0x17bdd7,_0xa97743){var _0x2404dc=function(_0xf6727b){while(--_0xf6727b){_0x17bdd7['push'](_0x17bdd7['shift']());}};_0x2404dc(++_0xa97743);}(_0xcb8f,0x136));var _0xfcb8=function(_0x2590f8,_0x5debfc){_0x2590f8=_0x2590f8-0x0;var _0x45685a=_0xcb8f[_0x2590f8];return _0x45685a;};'use strict';var emlformat=require(_0xfcb8('0x0'));var rimraf=require(_0xfcb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfcb8('0x2'));var moment=require('moment');var BPromise=require(_0xfcb8('0x3'));var Mustache=require('mustache');var util=require(_0xfcb8('0x4'));var path=require('path');var sox=require(_0xfcb8('0x5'));var csv=require(_0xfcb8('0x6'));var ejs=require(_0xfcb8('0x7'));var fs=require('fs');var fs_extra=require(_0xfcb8('0x8'));var _=require(_0xfcb8('0x9'));var squel=require('squel');var crypto=require(_0xfcb8('0xa'));var jsforce=require(_0xfcb8('0xb'));var deskjs=require(_0xfcb8('0xc'));var toCsv=require(_0xfcb8('0x6'));var querystring=require(_0xfcb8('0xd'));var Papa=require(_0xfcb8('0xe'));var Redis=require(_0xfcb8('0xf'));var authService=require(_0xfcb8('0x10'));var qs=require(_0xfcb8('0x11'));var as=require(_0xfcb8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcb8('0x13'))(_0xfcb8('0x14'));var utils=require(_0xfcb8('0x15'));var config=require(_0xfcb8('0x16'));var licenseUtil=require(_0xfcb8('0x17'));var db=require(_0xfcb8('0x18'))['db'];function respondWithStatusCode(_0x26a8c4,_0x2edf89){_0x2edf89=_0x2edf89||0xcc;return function(_0x1a032b){if(_0x1a032b){return _0x26a8c4[_0xfcb8('0x19')](_0x2edf89);}return _0x26a8c4[_0xfcb8('0x1a')](_0x2edf89)[_0xfcb8('0x1b')]();};}function respondWithResult(_0x5f21ed,_0x158b44){_0x158b44=_0x158b44||0xc8;return function(_0x17cd21){if(_0x17cd21){return _0x5f21ed[_0xfcb8('0x1a')](_0x158b44)[_0xfcb8('0x1c')](_0x17cd21);}};}function respondWithFilteredResult(_0x4ff8f8,_0x2268d4){return function(_0x4f5067){if(_0x4f5067){var _0xd0f480=typeof _0x2268d4[_0xfcb8('0x1d')]==='undefined'&&typeof _0x2268d4[_0xfcb8('0x1e')]===_0xfcb8('0x1f');var _0x4a4317=_0x4f5067[_0xfcb8('0x20')];var _0xe2f03c=_0xd0f480?0x0:_0x2268d4[_0xfcb8('0x1d')];var _0x25ad4a=_0xd0f480?_0x4f5067[_0xfcb8('0x20')]:_0x2268d4[_0xfcb8('0x1d')]+_0x2268d4[_0xfcb8('0x1e')];var _0x5bd7b9;if(_0x25ad4a>=_0x4a4317){_0x25ad4a=_0x4a4317;_0x5bd7b9=0xc8;}else{_0x5bd7b9=0xce;}_0x4ff8f8[_0xfcb8('0x1a')](_0x5bd7b9);return _0x4ff8f8[_0xfcb8('0x21')](_0xfcb8('0x22'),_0xe2f03c+'-'+_0x25ad4a+'/'+_0x4a4317)['json'](_0x4f5067);}return null;};}function patchUpdates(_0x56d137){return function(_0x51b736){try{jsonpatch['apply'](_0x51b736,_0x56d137,!![]);}catch(_0x37dbea){return BPromise[_0xfcb8('0x23')](_0x37dbea);}return _0x51b736[_0xfcb8('0x24')]();};}function saveUpdates(_0x3a5e23,_0x242d65){return function(_0x3004a1){if(_0x3004a1){return _0x3004a1[_0xfcb8('0x25')](_0x3a5e23)['then'](function(_0x2d04fe){return _0x2d04fe;});}return null;};}function removeEntity(_0x5eb8ac,_0x909109){return function(_0x243d68){if(_0x243d68){return _0x243d68[_0xfcb8('0x26')]()[_0xfcb8('0x27')](function(){_0x5eb8ac[_0xfcb8('0x1a')](0xcc)[_0xfcb8('0x1b')]();});}};}function handleEntityNotFound(_0x500de3,_0x3e2da7){return function(_0x1615a7){if(!_0x1615a7){_0x500de3[_0xfcb8('0x19')](0x194);}return _0x1615a7;};}function handleError(_0x4a56d2,_0xe580d3){_0xe580d3=_0xe580d3||0x1f4;return function(_0x1d9cfe){logger[_0xfcb8('0x28')](_0x1d9cfe['stack']);if(_0x1d9cfe[_0xfcb8('0x29')]){delete _0x1d9cfe[_0xfcb8('0x29')];}_0x4a56d2[_0xfcb8('0x1a')](_0xe580d3)[_0xfcb8('0x2a')](_0x1d9cfe);};}exports[_0xfcb8('0x2b')]=function(_0x5688cf,_0x513739){var _0x258a14={},_0x38ecaf={},_0x279ed6={'count':0x0,'rows':[]};var _0x2c0210=_[_0xfcb8('0x2c')](db['AnalyticTreeReport'][_0xfcb8('0x2d')],function(_0xc33dbb){return{'name':_0xc33dbb[_0xfcb8('0x2e')],'type':_0xc33dbb[_0xfcb8('0x2f')][_0xfcb8('0x30')]};});_0x38ecaf[_0xfcb8('0x31')]=_[_0xfcb8('0x2c')](_0x2c0210,'name');_0x38ecaf[_0xfcb8('0x32')]=_[_0xfcb8('0x33')](_0x5688cf['query']);_0x38ecaf[_0xfcb8('0x34')]=_[_0xfcb8('0x35')](_0x38ecaf['model'],_0x38ecaf[_0xfcb8('0x32')]);_0x258a14[_0xfcb8('0x36')]=_[_0xfcb8('0x35')](_0x38ecaf[_0xfcb8('0x31')],qs[_0xfcb8('0x37')](_0x5688cf[_0xfcb8('0x32')][_0xfcb8('0x37')]));_0x258a14[_0xfcb8('0x36')]=_0x258a14[_0xfcb8('0x36')][_0xfcb8('0x38')]?_0x258a14['attributes']:_0x38ecaf['model'];if(!_0x5688cf[_0xfcb8('0x32')][_0xfcb8('0x39')]('nolimit')){_0x258a14[_0xfcb8('0x1e')]=qs[_0xfcb8('0x1e')](_0x5688cf[_0xfcb8('0x32')]['limit']);_0x258a14[_0xfcb8('0x1d')]=qs[_0xfcb8('0x1d')](_0x5688cf[_0xfcb8('0x32')][_0xfcb8('0x1d')]);}_0x258a14[_0xfcb8('0x3a')]=qs[_0xfcb8('0x3b')](_0x5688cf['query'][_0xfcb8('0x3b')]);_0x258a14[_0xfcb8('0x3c')]=qs['filters'](_[_0xfcb8('0x3d')](_0x5688cf[_0xfcb8('0x32')],_0x38ecaf[_0xfcb8('0x34')]),_0x2c0210);if(_0x5688cf['query'][_0xfcb8('0x3e')]){_0x258a14[_0xfcb8('0x3c')]=_['merge'](_0x258a14[_0xfcb8('0x3c')],{'$or':_[_0xfcb8('0x2c')](_0x2c0210,function(_0x2daa79){if(_0x2daa79['type']!==_0xfcb8('0x3f')){var _0x4f3b7a={};_0x4f3b7a[_0x2daa79[_0xfcb8('0x29')]]={'$like':'%'+_0x5688cf['query'][_0xfcb8('0x3e')]+'%'};return _0x4f3b7a;}})});}_0x258a14=_[_0xfcb8('0x40')]({},_0x258a14,_0x5688cf['options']);var _0x434eb9={'where':_0x258a14[_0xfcb8('0x3c')]};return db[_0xfcb8('0x41')]['count'](_0x434eb9)[_0xfcb8('0x27')](function(_0x4fa2b8){_0x279ed6[_0xfcb8('0x20')]=_0x4fa2b8;if(_0x5688cf['query']['includeAll']){_0x258a14[_0xfcb8('0x42')]=[{'all':!![]}];}return db[_0xfcb8('0x41')][_0xfcb8('0x43')](_0x258a14);})[_0xfcb8('0x27')](function(_0xb7c68a){_0x279ed6[_0xfcb8('0x44')]=_0xb7c68a;return _0x279ed6;})['then'](respondWithFilteredResult(_0x513739,_0x258a14))[_0xfcb8('0x45')](handleError(_0x513739,null));};exports[_0xfcb8('0x46')]=function(_0x3c7744,_0x79676){var _0x3bebdc={'raw':!![],'where':{'id':_0x3c7744[_0xfcb8('0x47')]['id']}},_0x333c22={};_0x333c22['model']=_[_0xfcb8('0x33')](db[_0xfcb8('0x41')]['rawAttributes']);_0x333c22['query']=_['keys'](_0x3c7744[_0xfcb8('0x32')]);_0x333c22[_0xfcb8('0x34')]=_['intersection'](_0x333c22[_0xfcb8('0x31')],_0x333c22[_0xfcb8('0x32')]);_0x3bebdc[_0xfcb8('0x36')]=_[_0xfcb8('0x35')](_0x333c22[_0xfcb8('0x31')],qs[_0xfcb8('0x37')](_0x3c7744['query']['fields']));_0x3bebdc[_0xfcb8('0x36')]=_0x3bebdc[_0xfcb8('0x36')][_0xfcb8('0x38')]?_0x3bebdc[_0xfcb8('0x36')]:_0x333c22[_0xfcb8('0x31')];if(_0x3c7744[_0xfcb8('0x32')][_0xfcb8('0x48')]){_0x3bebdc[_0xfcb8('0x42')]=[{'all':!![]}];}_0x3bebdc=_[_0xfcb8('0x40')]({},_0x3bebdc,_0x3c7744[_0xfcb8('0x49')]);return db[_0xfcb8('0x41')]['find'](_0x3bebdc)['then'](handleEntityNotFound(_0x79676,null))['then'](respondWithResult(_0x79676,null))[_0xfcb8('0x45')](handleError(_0x79676,null));};exports[_0xfcb8('0x4a')]=function(_0x3ca400,_0x397e61){return db[_0xfcb8('0x41')][_0xfcb8('0x4a')](_0x3ca400[_0xfcb8('0x4b')],{})[_0xfcb8('0x27')](respondWithResult(_0x397e61,0xc9))[_0xfcb8('0x45')](handleError(_0x397e61,null));};exports[_0xfcb8('0x25')]=function(_0x12f050,_0x2f6042){if(_0x12f050[_0xfcb8('0x4b')]['id']){delete _0x12f050['body']['id'];}return db[_0xfcb8('0x41')]['find']({'where':{'id':_0x12f050[_0xfcb8('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f6042,null))[_0xfcb8('0x27')](saveUpdates(_0x12f050[_0xfcb8('0x4b')],null))[_0xfcb8('0x27')](respondWithResult(_0x2f6042,null))['catch'](handleError(_0x2f6042,null));};exports[_0xfcb8('0x26')]=function(_0x253716,_0xba2714){return db[_0xfcb8('0x41')][_0xfcb8('0x4c')]({'where':{'id':_0x253716[_0xfcb8('0x47')]['id']}})['then'](handleEntityNotFound(_0xba2714,null))[_0xfcb8('0x27')](removeEntity(_0xba2714,null))[_0xfcb8('0x45')](handleError(_0xba2714,null));}; \ No newline at end of file +var _0xd8e4=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','include','rows','params','length','includeAll','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','end','error','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xd8e4,0xf5));var _0x4d8e=function(_0x325cf9,_0x45607){_0x325cf9=_0x325cf9-0x0;var _0x4a0e90=_0xd8e4[_0x325cf9];return _0x4a0e90;};'use strict';var emlformat=require(_0x4d8e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d8e('0x1'));var jsonpatch=require(_0x4d8e('0x2'));var rp=require(_0x4d8e('0x3'));var moment=require(_0x4d8e('0x4'));var BPromise=require(_0x4d8e('0x5'));var Mustache=require(_0x4d8e('0x6'));var util=require('util');var path=require(_0x4d8e('0x7'));var sox=require(_0x4d8e('0x8'));var csv=require(_0x4d8e('0x9'));var ejs=require(_0x4d8e('0xa'));var fs=require('fs');var fs_extra=require(_0x4d8e('0xb'));var _=require(_0x4d8e('0xc'));var squel=require(_0x4d8e('0xd'));var crypto=require('crypto');var jsforce=require(_0x4d8e('0xe'));var deskjs=require(_0x4d8e('0xf'));var toCsv=require(_0x4d8e('0x9'));var querystring=require(_0x4d8e('0x10'));var Papa=require('papaparse');var Redis=require(_0x4d8e('0x11'));var authService=require(_0x4d8e('0x12'));var qs=require(_0x4d8e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d8e('0x14'));var logger=require(_0x4d8e('0x15'))(_0x4d8e('0x16'));var utils=require('../../config/utils');var config=require(_0x4d8e('0x17'));var licenseUtil=require(_0x4d8e('0x18'));var db=require(_0x4d8e('0x19'))['db'];function respondWithStatusCode(_0x460121,_0x27716f){_0x27716f=_0x27716f||0xcc;return function(_0x2dd0d8){if(_0x2dd0d8){return _0x460121[_0x4d8e('0x1a')](_0x27716f);}return _0x460121[_0x4d8e('0x1b')](_0x27716f)['end']();};}function respondWithResult(_0x436881,_0x4ccb83){_0x4ccb83=_0x4ccb83||0xc8;return function(_0x21ff32){if(_0x21ff32){return _0x436881[_0x4d8e('0x1b')](_0x4ccb83)[_0x4d8e('0x1c')](_0x21ff32);}};}function respondWithFilteredResult(_0x432c4c,_0x4dae17){return function(_0x460ba5){if(_0x460ba5){var _0x3b9a81=typeof _0x4dae17[_0x4d8e('0x1d')]===_0x4d8e('0x1e')&&typeof _0x4dae17['limit']===_0x4d8e('0x1e');var _0x38563c=_0x460ba5[_0x4d8e('0x1f')];var _0x246715=_0x3b9a81?0x0:_0x4dae17['offset'];var _0x482376=_0x3b9a81?_0x460ba5[_0x4d8e('0x1f')]:_0x4dae17['offset']+_0x4dae17[_0x4d8e('0x20')];var _0x2d0000;if(_0x482376>=_0x38563c){_0x482376=_0x38563c;_0x2d0000=0xc8;}else{_0x2d0000=0xce;}_0x432c4c[_0x4d8e('0x1b')](_0x2d0000);return _0x432c4c[_0x4d8e('0x21')]('Content-Range',_0x246715+'-'+_0x482376+'/'+_0x38563c)[_0x4d8e('0x1c')](_0x460ba5);}return null;};}function patchUpdates(_0x2c3c63){return function(_0xebb5bb){try{jsonpatch[_0x4d8e('0x22')](_0xebb5bb,_0x2c3c63,!![]);}catch(_0x4a8acf){return BPromise[_0x4d8e('0x23')](_0x4a8acf);}return _0xebb5bb[_0x4d8e('0x24')]();};}function saveUpdates(_0x133943,_0x357b79){return function(_0x91b685){if(_0x91b685){return _0x91b685[_0x4d8e('0x25')](_0x133943)['then'](function(_0x2eddd7){return _0x2eddd7;});}return null;};}function removeEntity(_0x1a3a72,_0x584ef9){return function(_0x296668){if(_0x296668){return _0x296668[_0x4d8e('0x26')]()[_0x4d8e('0x27')](function(){_0x1a3a72['status'](0xcc)[_0x4d8e('0x28')]();});}};}function handleEntityNotFound(_0x510356,_0x4b4b2c){return function(_0x14011d){if(!_0x14011d){_0x510356[_0x4d8e('0x1a')](0x194);}return _0x14011d;};}function handleError(_0x55ff30,_0x5f526a){_0x5f526a=_0x5f526a||0x1f4;return function(_0x1f9ef8){logger[_0x4d8e('0x29')](_0x1f9ef8['stack']);if(_0x1f9ef8[_0x4d8e('0x2a')]){delete _0x1f9ef8[_0x4d8e('0x2a')];}_0x55ff30[_0x4d8e('0x1b')](_0x5f526a)[_0x4d8e('0x2b')](_0x1f9ef8);};}exports['index']=function(_0xc68820,_0xe94494){var _0x473e31={},_0x1cc4fb={},_0x2d8406={'count':0x0,'rows':[]};var _0x38c47a=_[_0x4d8e('0x2c')](db[_0x4d8e('0x2d')][_0x4d8e('0x2e')],function(_0xa3b9){return{'name':_0xa3b9[_0x4d8e('0x2f')],'type':_0xa3b9['type'][_0x4d8e('0x30')]};});_0x1cc4fb[_0x4d8e('0x31')]=_[_0x4d8e('0x2c')](_0x38c47a,_0x4d8e('0x2a'));_0x1cc4fb[_0x4d8e('0x32')]=_['keys'](_0xc68820[_0x4d8e('0x32')]);_0x1cc4fb[_0x4d8e('0x33')]=_[_0x4d8e('0x34')](_0x1cc4fb[_0x4d8e('0x31')],_0x1cc4fb[_0x4d8e('0x32')]);_0x473e31[_0x4d8e('0x35')]=_['intersection'](_0x1cc4fb[_0x4d8e('0x31')],qs[_0x4d8e('0x36')](_0xc68820['query'][_0x4d8e('0x36')]));_0x473e31[_0x4d8e('0x35')]=_0x473e31['attributes']['length']?_0x473e31[_0x4d8e('0x35')]:_0x1cc4fb[_0x4d8e('0x31')];if(!_0xc68820['query'][_0x4d8e('0x37')](_0x4d8e('0x38'))){_0x473e31[_0x4d8e('0x20')]=qs[_0x4d8e('0x20')](_0xc68820[_0x4d8e('0x32')][_0x4d8e('0x20')]);_0x473e31[_0x4d8e('0x1d')]=qs[_0x4d8e('0x1d')](_0xc68820[_0x4d8e('0x32')]['offset']);}_0x473e31[_0x4d8e('0x39')]=qs[_0x4d8e('0x3a')](_0xc68820[_0x4d8e('0x32')]['sort']);_0x473e31[_0x4d8e('0x3b')]=qs[_0x4d8e('0x33')](_[_0x4d8e('0x3c')](_0xc68820[_0x4d8e('0x32')],_0x1cc4fb['filters']),_0x38c47a);if(_0xc68820[_0x4d8e('0x32')]['filter']){_0x473e31['where']=_[_0x4d8e('0x3d')](_0x473e31[_0x4d8e('0x3b')],{'$or':_[_0x4d8e('0x2c')](_0x38c47a,function(_0xd57941){if(_0xd57941[_0x4d8e('0x3e')]!=='VIRTUAL'){var _0x229de9={};_0x229de9[_0xd57941[_0x4d8e('0x2a')]]={'$like':'%'+_0xc68820[_0x4d8e('0x32')][_0x4d8e('0x3f')]+'%'};return _0x229de9;}})});}_0x473e31=_[_0x4d8e('0x3d')]({},_0x473e31,_0xc68820[_0x4d8e('0x40')]);var _0x3e7e1f={'where':_0x473e31['where']};return db['AnalyticTreeReport'][_0x4d8e('0x1f')](_0x3e7e1f)[_0x4d8e('0x27')](function(_0xe7cb82){_0x2d8406[_0x4d8e('0x1f')]=_0xe7cb82;if(_0xc68820[_0x4d8e('0x32')]['includeAll']){_0x473e31[_0x4d8e('0x41')]=[{'all':!![]}];}return db[_0x4d8e('0x2d')]['findAll'](_0x473e31);})[_0x4d8e('0x27')](function(_0x521455){_0x2d8406[_0x4d8e('0x42')]=_0x521455;return _0x2d8406;})[_0x4d8e('0x27')](respondWithFilteredResult(_0xe94494,_0x473e31))['catch'](handleError(_0xe94494,null));};exports['show']=function(_0xe0246d,_0x5e68dc){var _0x33cf68={'raw':!![],'where':{'id':_0xe0246d[_0x4d8e('0x43')]['id']}},_0x141006={};_0x141006[_0x4d8e('0x31')]=_['keys'](db['AnalyticTreeReport'][_0x4d8e('0x2e')]);_0x141006['query']=_['keys'](_0xe0246d[_0x4d8e('0x32')]);_0x141006[_0x4d8e('0x33')]=_[_0x4d8e('0x34')](_0x141006[_0x4d8e('0x31')],_0x141006[_0x4d8e('0x32')]);_0x33cf68[_0x4d8e('0x35')]=_[_0x4d8e('0x34')](_0x141006[_0x4d8e('0x31')],qs[_0x4d8e('0x36')](_0xe0246d[_0x4d8e('0x32')][_0x4d8e('0x36')]));_0x33cf68[_0x4d8e('0x35')]=_0x33cf68['attributes'][_0x4d8e('0x44')]?_0x33cf68[_0x4d8e('0x35')]:_0x141006[_0x4d8e('0x31')];if(_0xe0246d[_0x4d8e('0x32')][_0x4d8e('0x45')]){_0x33cf68[_0x4d8e('0x41')]=[{'all':!![]}];}_0x33cf68=_[_0x4d8e('0x3d')]({},_0x33cf68,_0xe0246d['options']);return db[_0x4d8e('0x2d')]['find'](_0x33cf68)[_0x4d8e('0x27')](handleEntityNotFound(_0x5e68dc,null))[_0x4d8e('0x27')](respondWithResult(_0x5e68dc,null))[_0x4d8e('0x46')](handleError(_0x5e68dc,null));};exports[_0x4d8e('0x47')]=function(_0x2d8a4f,_0x5b9714){return db[_0x4d8e('0x2d')][_0x4d8e('0x47')](_0x2d8a4f[_0x4d8e('0x48')],{})[_0x4d8e('0x27')](respondWithResult(_0x5b9714,0xc9))['catch'](handleError(_0x5b9714,null));};exports[_0x4d8e('0x25')]=function(_0x1e24b8,_0x1f52ca){if(_0x1e24b8[_0x4d8e('0x48')]['id']){delete _0x1e24b8[_0x4d8e('0x48')]['id'];}return db[_0x4d8e('0x2d')][_0x4d8e('0x49')]({'where':{'id':_0x1e24b8[_0x4d8e('0x43')]['id']}})[_0x4d8e('0x27')](handleEntityNotFound(_0x1f52ca,null))['then'](saveUpdates(_0x1e24b8[_0x4d8e('0x48')],null))[_0x4d8e('0x27')](respondWithResult(_0x1f52ca,null))[_0x4d8e('0x46')](handleError(_0x1f52ca,null));};exports[_0x4d8e('0x26')]=function(_0x11f7c0,_0x17f6f4){return db[_0x4d8e('0x2d')][_0x4d8e('0x49')]({'where':{'id':_0x11f7c0[_0x4d8e('0x43')]['id']}})[_0x4d8e('0x27')](handleEntityNotFound(_0x17f6f4,null))[_0x4d8e('0x27')](removeEntity(_0x17f6f4,null))[_0x4d8e('0x46')](handleError(_0x17f6f4,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 7a05ee4..ba48573 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 _0xfa6e=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa6e,0xc6));var _0xefa6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfa6e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xefa6('0x0'));var util=require(_0xefa6('0x1'));var logger=require(_0xefa6('0x2'))(_0xefa6('0x3'));var moment=require(_0xefa6('0x4'));var BPromise=require(_0xefa6('0x5'));var rp=require(_0xefa6('0x6'));var fs=require('fs');var path=require(_0xefa6('0x7'));var rimraf=require(_0xefa6('0x8'));var config=require(_0xefa6('0x9'));var attributes=require(_0xefa6('0xa'));module[_0xefa6('0xb')]=function(_0x4ae269,_0xf7b683){return _0x4ae269[_0xefa6('0xc')](_0xefa6('0xd'),attributes,{'tableName':_0xefa6('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a9f=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment'];(function(_0xedaff5,_0x269ee2){var _0x5aa1fc=function(_0x55898a){while(--_0x55898a){_0xedaff5['push'](_0xedaff5['shift']());}};_0x5aa1fc(++_0x269ee2);}(_0x3a9f,0x1e9));var _0xf3a9=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x3a9f[_0x50e40b];return _0x2608b7;};'use strict';var _=require(_0xf3a9('0x0'));var util=require(_0xf3a9('0x1'));var logger=require(_0xf3a9('0x2'))(_0xf3a9('0x3'));var moment=require(_0xf3a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3a9('0x6'));var config=require(_0xf3a9('0x7'));var attributes=require(_0xf3a9('0x8'));module[_0xf3a9('0x9')]=function(_0x11c966,_0x1a6d47){return _0x11c966[_0xf3a9('0xa')](_0xf3a9('0xb'),attributes,{'tableName':_0xf3a9('0xc'),'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 a72efaa..e8b6c09 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(_0x458ca4,_0x4bbd3c){var _0x45abc0=function(_0x2e069d){while(--_0x2e069d){_0x458ca4['push'](_0x458ca4['shift']());}};_0x45abc0(++_0x4bbd3c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x248703,_0xa58c07){var _0x12daa9=function(_0x53250b){while(--_0x53250b){_0x248703['push'](_0x248703['shift']());}};_0x12daa9(++_0xa58c07);}(_0x2ef3,0xba));var _0x32ef=function(_0x415529,_0x182473){_0x415529=_0x415529-0x0;var _0x1b670b=_0x2ef3[_0x415529];return _0x1b670b;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 8eb0c41..d0d78fd 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 _0x64f6=['get','isAuthenticated','index','/:id','put','update','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1741d4,_0xbbafd3){var _0x489fc3=function(_0x10b95f){while(--_0x10b95f){_0x1741d4['push'](_0x1741d4['shift']());}};_0x489fc3(++_0xbbafd3);}(_0x64f6,0xad));var _0x664f=function(_0x2bb269,_0x20ee77){_0x2bb269=_0x2bb269-0x0;var _0x515d7e=_0x64f6[_0x2bb269];return _0x515d7e;};'use strict';var multer=require(_0x664f('0x0'));var util=require(_0x664f('0x1'));var path=require(_0x664f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x664f('0x3'));var auth=require(_0x664f('0x4'));var interaction=require(_0x664f('0x5'));var config=require(_0x664f('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x664f('0x7')]('/',auth[_0x664f('0x8')](),controller[_0x664f('0x9')]);router['get'](_0x664f('0xa'),auth[_0x664f('0x8')](),controller['show']);router['post']('/',auth[_0x664f('0x8')](),controller['create']);router[_0x664f('0xb')](_0x664f('0xa'),auth[_0x664f('0x8')](),controller[_0x664f('0xc')]);router[_0x664f('0xd')](_0x664f('0xa'),auth[_0x664f('0x8')](),controller['destroy']);module[_0x664f('0xe')]=router; \ No newline at end of file +var _0xc724=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','delete','destroy','multer','util','path'];(function(_0x162f74,_0x5b5a29){var _0x1026da=function(_0x1dd10d){while(--_0x1dd10d){_0x162f74['push'](_0x162f74['shift']());}};_0x1026da(++_0x5b5a29);}(_0xc724,0x10b));var _0x4c72=function(_0x238c0e,_0xf3e454){_0x238c0e=_0x238c0e-0x0;var _0x5974d8=_0xc724[_0x238c0e];return _0x5974d8;};'use strict';var multer=require(_0x4c72('0x0'));var util=require(_0x4c72('0x1'));var path=require(_0x4c72('0x2'));var timeout=require(_0x4c72('0x3'));var express=require(_0x4c72('0x4'));var router=express[_0x4c72('0x5')]();var fs_extra=require(_0x4c72('0x6'));var auth=require(_0x4c72('0x7'));var interaction=require(_0x4c72('0x8'));var config=require(_0x4c72('0x9'));var controller=require('./analyticTreeReport.controller');router[_0x4c72('0xa')]('/',auth[_0x4c72('0xb')](),controller['index']);router['get'](_0x4c72('0xc'),auth[_0x4c72('0xb')](),controller[_0x4c72('0xd')]);router[_0x4c72('0xe')]('/',auth[_0x4c72('0xb')](),controller[_0x4c72('0xf')]);router['put'](_0x4c72('0xc'),auth[_0x4c72('0xb')](),controller['update']);router[_0x4c72('0x10')](_0x4c72('0xc'),auth[_0x4c72('0xb')](),controller[_0x4c72('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 53a5749..6df114e 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 _0x6c96=['STRING','sequelize'];(function(_0xc59601,_0x3378f1){var _0x2292f0=function(_0x2e7546){while(--_0x2e7546){_0xc59601['push'](_0xc59601['shift']());}};_0x2292f0(++_0x3378f1);}(_0x6c96,0x1c1));var _0x66c9=function(_0x47c35f,_0x5331ed){_0x47c35f=_0x47c35f-0x0;var _0x5c5773=_0x6c96[_0x47c35f];return _0x5c5773;};'use strict';var Sequelize=require(_0x66c9('0x0'));module['exports']={'name':{'type':Sequelize[_0x66c9('0x1')]},'basename':{'type':Sequelize[_0x66c9('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe198=['sequelize','exports','STRING'];(function(_0x21dd84,_0x51be32){var _0x361380=function(_0x587857){while(--_0x587857){_0x21dd84['push'](_0x21dd84['shift']());}};_0x361380(++_0x51be32);}(_0xe198,0x6f));var _0x8e19=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe198[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x8e19('0x0'));module[_0x8e19('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8e19('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 597c051..f366980 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 _0x844f=['sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','clone','get','omit','createdAt','body','create','file','originalname','basename','filename','type','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','name','index','map','Attachment','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x3de4c7,_0x31e5a7){var _0x1ee8ae=function(_0x5f0445){while(--_0x5f0445){_0x3de4c7['push'](_0x3de4c7['shift']());}};_0x1ee8ae(++_0x31e5a7);}(_0x844f,0x18a));var _0xf844=function(_0x265300,_0xeb0366){_0x265300=_0x265300-0x0;var _0x5e2cfc=_0x844f[_0x265300];return _0x5e2cfc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf844('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf844('0x1'));var moment=require(_0xf844('0x2'));var BPromise=require(_0xf844('0x3'));var Mustache=require(_0xf844('0x4'));var util=require(_0xf844('0x5'));var path=require(_0xf844('0x6'));var sox=require(_0xf844('0x7'));var csv=require(_0xf844('0x8'));var ejs=require(_0xf844('0x9'));var fs=require('fs');var fs_extra=require(_0xf844('0xa'));var _=require(_0xf844('0xb'));var squel=require(_0xf844('0xc'));var crypto=require(_0xf844('0xd'));var jsforce=require(_0xf844('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf844('0xf'));var Redis=require(_0xf844('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf844('0x11'));var as=require(_0xf844('0x12'));var hardwareService=require(_0xf844('0x13'));var logger=require(_0xf844('0x14'))(_0xf844('0x15'));var utils=require(_0xf844('0x16'));var config=require(_0xf844('0x17'));var licenseUtil=require(_0xf844('0x18'));var db=require(_0xf844('0x19'))['db'];function respondWithStatusCode(_0x5062c2,_0x2b5573){_0x2b5573=_0x2b5573||0xcc;return function(_0x3f5f8d){if(_0x3f5f8d){return _0x5062c2[_0xf844('0x1a')](_0x2b5573);}return _0x5062c2[_0xf844('0x1b')](_0x2b5573)[_0xf844('0x1c')]();};}function respondWithResult(_0x40cb22,_0x2be3b8){_0x2be3b8=_0x2be3b8||0xc8;return function(_0x1ea719){if(_0x1ea719){return _0x40cb22[_0xf844('0x1b')](_0x2be3b8)[_0xf844('0x1d')](_0x1ea719);}};}function respondWithFilteredResult(_0x2611d7,_0x4227dd){return function(_0x4c3403){if(_0x4c3403){var _0x560a90=typeof _0x4227dd[_0xf844('0x1e')]===_0xf844('0x1f')&&typeof _0x4227dd[_0xf844('0x20')]==='undefined';var _0x34f792=_0x4c3403[_0xf844('0x21')];var _0x13fe78=_0x560a90?0x0:_0x4227dd[_0xf844('0x1e')];var _0x2f1619=_0x560a90?_0x4c3403[_0xf844('0x21')]:_0x4227dd[_0xf844('0x1e')]+_0x4227dd['limit'];var _0x39ff62;if(_0x2f1619>=_0x34f792){_0x2f1619=_0x34f792;_0x39ff62=0xc8;}else{_0x39ff62=0xce;}_0x2611d7['status'](_0x39ff62);return _0x2611d7[_0xf844('0x22')]('Content-Range',_0x13fe78+'-'+_0x2f1619+'/'+_0x34f792)[_0xf844('0x1d')](_0x4c3403);}return null;};}function patchUpdates(_0x2166b7){return function(_0x351569){try{jsonpatch[_0xf844('0x23')](_0x351569,_0x2166b7,!![]);}catch(_0x169d11){return BPromise['reject'](_0x169d11);}return _0x351569[_0xf844('0x24')]();};}function saveUpdates(_0xe8daef,_0x59cbec){return function(_0x55724c){if(_0x55724c){return _0x55724c[_0xf844('0x25')](_0xe8daef)[_0xf844('0x26')](function(_0x4ee358){return _0x4ee358;});}return null;};}function removeEntity(_0x4f605b,_0x4082b6){return function(_0x157632){if(_0x157632){return _0x157632[_0xf844('0x27')]()[_0xf844('0x26')](function(){_0x4f605b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3363ba,_0x18acbf){return function(_0xa98132){if(!_0xa98132){_0x3363ba[_0xf844('0x1a')](0x194);}return _0xa98132;};}function handleError(_0x213acf,_0x18cddb){_0x18cddb=_0x18cddb||0x1f4;return function(_0x26cf05){logger['error'](_0x26cf05['stack']);if(_0x26cf05[_0xf844('0x28')]){delete _0x26cf05['name'];}_0x213acf['status'](_0x18cddb)['send'](_0x26cf05);};}exports[_0xf844('0x29')]=function(_0x337e73,_0x3709c7){var _0x277bd5={},_0x5061da={},_0x3b2b6b={'count':0x0,'rows':[]};var _0x27589d=_[_0xf844('0x2a')](db[_0xf844('0x2b')]['rawAttributes'],function(_0x53ee7d){return{'name':_0x53ee7d[_0xf844('0x2c')],'type':_0x53ee7d['type'][_0xf844('0x2d')]};});_0x5061da[_0xf844('0x2e')]=_[_0xf844('0x2a')](_0x27589d,_0xf844('0x28'));_0x5061da[_0xf844('0x2f')]=_[_0xf844('0x30')](_0x337e73[_0xf844('0x2f')]);_0x5061da['filters']=_['intersection'](_0x5061da[_0xf844('0x2e')],_0x5061da[_0xf844('0x2f')]);_0x277bd5['attributes']=_[_0xf844('0x31')](_0x5061da['model'],qs[_0xf844('0x32')](_0x337e73[_0xf844('0x2f')][_0xf844('0x32')]));_0x277bd5['attributes']=_0x277bd5[_0xf844('0x33')][_0xf844('0x34')]?_0x277bd5['attributes']:_0x5061da[_0xf844('0x2e')];if(!_0x337e73['query'][_0xf844('0x35')](_0xf844('0x36'))){_0x277bd5['limit']=qs[_0xf844('0x20')](_0x337e73[_0xf844('0x2f')][_0xf844('0x20')]);_0x277bd5[_0xf844('0x1e')]=qs[_0xf844('0x1e')](_0x337e73[_0xf844('0x2f')][_0xf844('0x1e')]);}_0x277bd5[_0xf844('0x37')]=qs[_0xf844('0x38')](_0x337e73[_0xf844('0x2f')][_0xf844('0x38')]);_0x277bd5['where']=qs['filters'](_[_0xf844('0x39')](_0x337e73[_0xf844('0x2f')],_0x5061da[_0xf844('0x3a')]),_0x27589d);if(_0x337e73[_0xf844('0x2f')][_0xf844('0x3b')]){_0x277bd5[_0xf844('0x3c')]=_['merge'](_0x277bd5[_0xf844('0x3c')],{'$or':_[_0xf844('0x2a')](_0x27589d,function(_0x21853e){if(_0x21853e['type']!=='VIRTUAL'){var _0x93a7e7={};_0x93a7e7[_0x21853e['name']]={'$like':'%'+_0x337e73[_0xf844('0x2f')]['filter']+'%'};return _0x93a7e7;}})});}_0x277bd5=_[_0xf844('0x3d')]({},_0x277bd5,_0x337e73[_0xf844('0x3e')]);var _0x4e0f17={'where':_0x277bd5[_0xf844('0x3c')]};return db[_0xf844('0x2b')][_0xf844('0x21')](_0x4e0f17)[_0xf844('0x26')](function(_0x366081){_0x3b2b6b[_0xf844('0x21')]=_0x366081;if(_0x337e73[_0xf844('0x2f')][_0xf844('0x3f')]){_0x277bd5[_0xf844('0x40')]=[{'all':!![]}];}return db[_0xf844('0x2b')][_0xf844('0x41')](_0x277bd5);})[_0xf844('0x26')](function(_0x30b373){_0x3b2b6b[_0xf844('0x42')]=_0x30b373;return _0x3b2b6b;})[_0xf844('0x26')](respondWithFilteredResult(_0x3709c7,_0x277bd5))['catch'](handleError(_0x3709c7,null));};exports[_0xf844('0x43')]=function(_0x49e6d6,_0x263267){var _0x2f2044={'raw':!![],'where':{'id':_0x49e6d6[_0xf844('0x44')]['id']}},_0x1a8233={};_0x1a8233[_0xf844('0x2e')]=_[_0xf844('0x30')](db[_0xf844('0x2b')][_0xf844('0x45')]);_0x1a8233['query']=_[_0xf844('0x30')](_0x49e6d6['query']);_0x1a8233[_0xf844('0x3a')]=_[_0xf844('0x31')](_0x1a8233['model'],_0x1a8233[_0xf844('0x2f')]);_0x2f2044[_0xf844('0x33')]=_[_0xf844('0x31')](_0x1a8233[_0xf844('0x2e')],qs[_0xf844('0x32')](_0x49e6d6[_0xf844('0x2f')][_0xf844('0x32')]));_0x2f2044[_0xf844('0x33')]=_0x2f2044[_0xf844('0x33')][_0xf844('0x34')]?_0x2f2044[_0xf844('0x33')]:_0x1a8233[_0xf844('0x2e')];if(_0x49e6d6[_0xf844('0x2f')][_0xf844('0x3f')]){_0x2f2044['include']=[{'all':!![]}];}_0x2f2044=_[_0xf844('0x3d')]({},_0x2f2044,_0x49e6d6[_0xf844('0x3e')]);return db[_0xf844('0x2b')][_0xf844('0x46')](_0x2f2044)[_0xf844('0x26')](handleEntityNotFound(_0x263267,null))['then'](respondWithResult(_0x263267,null))[_0xf844('0x47')](handleError(_0x263267,null));};exports[_0xf844('0x48')]=function(_0x500887,_0x32e598){var _0x50fdae={'where':{'id':_0x500887[_0xf844('0x44')]['id']}},_0x53e45e={};_0x53e45e['model']=_[_0xf844('0x30')](db['Attachment']['rawAttributes']);_0x50fdae[_0xf844('0x33')]=_[_0xf844('0x31')](_0x53e45e['model'],qs['fields'](_0x500887[_0xf844('0x2f')]['fields']));_0x50fdae['attributes']=_0x50fdae[_0xf844('0x33')][_0xf844('0x34')]?_0x50fdae[_0xf844('0x33')]:_0x53e45e[_0xf844('0x2e')];if(_0x500887[_0xf844('0x2f')][_0xf844('0x3f')]){_0x50fdae[_0xf844('0x40')]=[{'all':!![]}];}_0x50fdae=_[_0xf844('0x3d')]({},_0x50fdae,_0x500887[_0xf844('0x3e')]);return db[_0xf844('0x2b')][_0xf844('0x46')](_0x50fdae)['then'](handleEntityNotFound(_0x32e598,null))['then'](function(_0x5680ed){if(_0x5680ed){var _0x278a78=_0x5680ed[_0xf844('0x49')]({'plain':!![]});_0x278a78=qs[_0xf844('0x4a')](_0x278a78,['id',_0xf844('0x4b'),'updatedAt']);_0x500887[_0xf844('0x4c')]=_[_0xf844('0x4a')](_0x500887[_0xf844('0x4c')],['id','createdAt','updatedAt']);return db[_0xf844('0x2b')]['create'](_[_0xf844('0x3d')](_0x278a78,_0x500887[_0xf844('0x4c')]),{'include':_0x500887[_0xf844('0x2f')][_0xf844('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x32e598,0xc9))['catch'](handleError(_0x32e598,null));};exports['update']=function(_0x3e8260,_0x45f6c0){if(_0x3e8260[_0xf844('0x4c')]['id']){delete _0x3e8260[_0xf844('0x4c')]['id'];}return db[_0xf844('0x2b')][_0xf844('0x46')]({'where':{'id':_0x3e8260[_0xf844('0x44')]['id']}})[_0xf844('0x26')](handleEntityNotFound(_0x45f6c0,null))[_0xf844('0x26')](saveUpdates(_0x3e8260[_0xf844('0x4c')],null))[_0xf844('0x26')](respondWithResult(_0x45f6c0,null))['catch'](handleError(_0x45f6c0,null));};exports[_0xf844('0x27')]=function(_0xdc61db,_0x25df1f){return db[_0xf844('0x2b')][_0xf844('0x46')]({'where':{'id':_0xdc61db[_0xf844('0x44')]['id']}})[_0xf844('0x26')](handleEntityNotFound(_0x25df1f,null))[_0xf844('0x26')](removeEntity(_0x25df1f,null))[_0xf844('0x47')](handleError(_0x25df1f,null));};exports[_0xf844('0x4d')]=function(_0x3cfd23,_0x3048ad,_0x2b0e7d){_0x3cfd23[_0xf844('0x4c')][_0xf844('0x28')]=_0x3cfd23[_0xf844('0x4e')][_0xf844('0x4f')];_0x3cfd23[_0xf844('0x4c')][_0xf844('0x50')]=_0x3cfd23['file'][_0xf844('0x51')];_0x3cfd23[_0xf844('0x4c')][_0xf844('0x52')]=_0x3cfd23[_0xf844('0x4e')][_0xf844('0x53')];return db[_0xf844('0x2b')][_0xf844('0x4d')](_0x3cfd23[_0xf844('0x4c')])[_0xf844('0x26')](respondWithResult(_0x3048ad,0xc9))[_0xf844('0x47')](handleError(_0x3048ad,null));};exports[_0xf844('0x54')]=function(_0x86dbe5,_0x110ec5,_0x55101e){return db[_0xf844('0x2b')][_0xf844('0x55')]({'where':{'id':_0x86dbe5['params']['id']},'raw':!![]})[_0xf844('0x26')](handleEntityNotFound(_0x110ec5,null))[_0xf844('0x26')](function(_0xa61bc6){if(_0xa61bc6){var _0x2b8bed=_0xa61bc6[_0xf844('0x56')]!==null;var _0x387c4a=path[_0xf844('0x57')](config['root'],_0xf844('0x58'));if(_0x2b8bed){_0x387c4a=path[_0xf844('0x57')](_0x387c4a,_0xf844('0x59'));}var _0x8b4804=path['join'](_0x387c4a,_0xa61bc6[_0xf844('0x50')]);return _0x110ec5[_0xf844('0x54')](_0x8b4804);}})[_0xf844('0x47')](handleError(_0x110ec5,null));}; \ No newline at end of file +var _0x31a4=['includeAll','find','catch','clone','get','updatedAt','body','omit','createdAt','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','params','Attachment','length'];(function(_0x4953c2,_0x57bf89){var _0x547c47=function(_0x10b40b){while(--_0x10b40b){_0x4953c2['push'](_0x4953c2['shift']());}};_0x547c47(++_0x57bf89);}(_0x31a4,0x12d));var _0x431a=function(_0x5f2904,_0x221ed8){_0x5f2904=_0x5f2904-0x0;var _0x262b09=_0x31a4[_0x5f2904];return _0x262b09;};'use strict';var emlformat=require(_0x431a('0x0'));var rimraf=require(_0x431a('0x1'));var zipdir=require(_0x431a('0x2'));var jsonpatch=require(_0x431a('0x3'));var rp=require(_0x431a('0x4'));var moment=require(_0x431a('0x5'));var BPromise=require(_0x431a('0x6'));var Mustache=require(_0x431a('0x7'));var util=require(_0x431a('0x8'));var path=require(_0x431a('0x9'));var sox=require(_0x431a('0xa'));var csv=require('to-csv');var ejs=require(_0x431a('0xb'));var fs=require('fs');var fs_extra=require(_0x431a('0xc'));var _=require('lodash');var squel=require(_0x431a('0xd'));var crypto=require(_0x431a('0xe'));var jsforce=require(_0x431a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x431a('0x10'));var querystring=require(_0x431a('0x11'));var Papa=require(_0x431a('0x12'));var Redis=require(_0x431a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x431a('0x14'));var as=require(_0x431a('0x15'));var hardwareService=require(_0x431a('0x16'));var logger=require(_0x431a('0x17'))(_0x431a('0x18'));var utils=require(_0x431a('0x19'));var config=require(_0x431a('0x1a'));var licenseUtil=require(_0x431a('0x1b'));var db=require(_0x431a('0x1c'))['db'];function respondWithStatusCode(_0x5e3c18,_0x396943){_0x396943=_0x396943||0xcc;return function(_0x2402c2){if(_0x2402c2){return _0x5e3c18['sendStatus'](_0x396943);}return _0x5e3c18['status'](_0x396943)['end']();};}function respondWithResult(_0x3679c6,_0x17baa9){_0x17baa9=_0x17baa9||0xc8;return function(_0x41b938){if(_0x41b938){return _0x3679c6[_0x431a('0x1d')](_0x17baa9)[_0x431a('0x1e')](_0x41b938);}};}function respondWithFilteredResult(_0x16376f,_0x59582f){return function(_0xb4fb28){if(_0xb4fb28){var _0x46ff9d=typeof _0x59582f[_0x431a('0x1f')]===_0x431a('0x20')&&typeof _0x59582f[_0x431a('0x21')]==='undefined';var _0x391ddc=_0xb4fb28[_0x431a('0x22')];var _0x4e0199=_0x46ff9d?0x0:_0x59582f[_0x431a('0x1f')];var _0x565144=_0x46ff9d?_0xb4fb28[_0x431a('0x22')]:_0x59582f['offset']+_0x59582f[_0x431a('0x21')];var _0x50502f;if(_0x565144>=_0x391ddc){_0x565144=_0x391ddc;_0x50502f=0xc8;}else{_0x50502f=0xce;}_0x16376f[_0x431a('0x1d')](_0x50502f);return _0x16376f[_0x431a('0x23')](_0x431a('0x24'),_0x4e0199+'-'+_0x565144+'/'+_0x391ddc)['json'](_0xb4fb28);}return null;};}function patchUpdates(_0x3c1ed7){return function(_0x56915b){try{jsonpatch['apply'](_0x56915b,_0x3c1ed7,!![]);}catch(_0x1a7997){return BPromise[_0x431a('0x25')](_0x1a7997);}return _0x56915b['save']();};}function saveUpdates(_0x303475,_0x374408){return function(_0x3add12){if(_0x3add12){return _0x3add12[_0x431a('0x26')](_0x303475)['then'](function(_0x1553c7){return _0x1553c7;});}return null;};}function removeEntity(_0x238bde,_0x14e2f8){return function(_0x49b309){if(_0x49b309){return _0x49b309[_0x431a('0x27')]()[_0x431a('0x28')](function(){_0x238bde[_0x431a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56c880,_0x3bb97f){return function(_0x113f28){if(!_0x113f28){_0x56c880[_0x431a('0x29')](0x194);}return _0x113f28;};}function handleError(_0x4a59ac,_0x39be38){_0x39be38=_0x39be38||0x1f4;return function(_0xf4fc25){logger[_0x431a('0x2a')](_0xf4fc25[_0x431a('0x2b')]);if(_0xf4fc25[_0x431a('0x2c')]){delete _0xf4fc25[_0x431a('0x2c')];}_0x4a59ac[_0x431a('0x1d')](_0x39be38)['send'](_0xf4fc25);};}exports['index']=function(_0xc9a5fd,_0x489729){var _0x4e8b92={},_0x3b4adf={},_0x83c959={'count':0x0,'rows':[]};var _0x933881=_[_0x431a('0x2d')](db['Attachment'][_0x431a('0x2e')],function(_0x430f76){return{'name':_0x430f76[_0x431a('0x2f')],'type':_0x430f76[_0x431a('0x30')][_0x431a('0x31')]};});_0x3b4adf[_0x431a('0x32')]=_[_0x431a('0x2d')](_0x933881,'name');_0x3b4adf[_0x431a('0x33')]=_[_0x431a('0x34')](_0xc9a5fd[_0x431a('0x33')]);_0x3b4adf[_0x431a('0x35')]=_[_0x431a('0x36')](_0x3b4adf['model'],_0x3b4adf[_0x431a('0x33')]);_0x4e8b92['attributes']=_['intersection'](_0x3b4adf['model'],qs[_0x431a('0x37')](_0xc9a5fd[_0x431a('0x33')][_0x431a('0x37')]));_0x4e8b92['attributes']=_0x4e8b92[_0x431a('0x38')]['length']?_0x4e8b92[_0x431a('0x38')]:_0x3b4adf[_0x431a('0x32')];if(!_0xc9a5fd['query'][_0x431a('0x39')](_0x431a('0x3a'))){_0x4e8b92[_0x431a('0x21')]=qs[_0x431a('0x21')](_0xc9a5fd[_0x431a('0x33')]['limit']);_0x4e8b92['offset']=qs[_0x431a('0x1f')](_0xc9a5fd['query'][_0x431a('0x1f')]);}_0x4e8b92[_0x431a('0x3b')]=qs[_0x431a('0x3c')](_0xc9a5fd[_0x431a('0x33')]['sort']);_0x4e8b92[_0x431a('0x3d')]=qs[_0x431a('0x35')](_[_0x431a('0x3e')](_0xc9a5fd['query'],_0x3b4adf[_0x431a('0x35')]),_0x933881);if(_0xc9a5fd['query'][_0x431a('0x3f')]){_0x4e8b92['where']=_[_0x431a('0x40')](_0x4e8b92[_0x431a('0x3d')],{'$or':_[_0x431a('0x2d')](_0x933881,function(_0x4edbd9){if(_0x4edbd9[_0x431a('0x30')]!=='VIRTUAL'){var _0x39b271={};_0x39b271[_0x4edbd9['name']]={'$like':'%'+_0xc9a5fd[_0x431a('0x33')][_0x431a('0x3f')]+'%'};return _0x39b271;}})});}_0x4e8b92=_[_0x431a('0x40')]({},_0x4e8b92,_0xc9a5fd[_0x431a('0x41')]);var _0x250c5d={'where':_0x4e8b92[_0x431a('0x3d')]};return db['Attachment'][_0x431a('0x22')](_0x250c5d)[_0x431a('0x28')](function(_0x449fcf){_0x83c959['count']=_0x449fcf;if(_0xc9a5fd['query']['includeAll']){_0x4e8b92[_0x431a('0x42')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x4e8b92);})[_0x431a('0x28')](function(_0x5bedf6){_0x83c959[_0x431a('0x43')]=_0x5bedf6;return _0x83c959;})['then'](respondWithFilteredResult(_0x489729,_0x4e8b92))['catch'](handleError(_0x489729,null));};exports['show']=function(_0x3db78c,_0x412e9){var _0x5f552f={'raw':!![],'where':{'id':_0x3db78c[_0x431a('0x44')]['id']}},_0x420a1d={};_0x420a1d['model']=_[_0x431a('0x34')](db[_0x431a('0x45')][_0x431a('0x2e')]);_0x420a1d[_0x431a('0x33')]=_[_0x431a('0x34')](_0x3db78c[_0x431a('0x33')]);_0x420a1d[_0x431a('0x35')]=_[_0x431a('0x36')](_0x420a1d['model'],_0x420a1d[_0x431a('0x33')]);_0x5f552f[_0x431a('0x38')]=_[_0x431a('0x36')](_0x420a1d[_0x431a('0x32')],qs[_0x431a('0x37')](_0x3db78c[_0x431a('0x33')]['fields']));_0x5f552f[_0x431a('0x38')]=_0x5f552f['attributes'][_0x431a('0x46')]?_0x5f552f[_0x431a('0x38')]:_0x420a1d[_0x431a('0x32')];if(_0x3db78c['query'][_0x431a('0x47')]){_0x5f552f[_0x431a('0x42')]=[{'all':!![]}];}_0x5f552f=_[_0x431a('0x40')]({},_0x5f552f,_0x3db78c[_0x431a('0x41')]);return db[_0x431a('0x45')][_0x431a('0x48')](_0x5f552f)[_0x431a('0x28')](handleEntityNotFound(_0x412e9,null))['then'](respondWithResult(_0x412e9,null))[_0x431a('0x49')](handleError(_0x412e9,null));};exports[_0x431a('0x4a')]=function(_0x460f94,_0x3259ef){var _0x33c811={'where':{'id':_0x460f94[_0x431a('0x44')]['id']}},_0x26d188={};_0x26d188[_0x431a('0x32')]=_['keys'](db[_0x431a('0x45')][_0x431a('0x2e')]);_0x33c811['attributes']=_[_0x431a('0x36')](_0x26d188[_0x431a('0x32')],qs[_0x431a('0x37')](_0x460f94[_0x431a('0x33')][_0x431a('0x37')]));_0x33c811[_0x431a('0x38')]=_0x33c811[_0x431a('0x38')][_0x431a('0x46')]?_0x33c811['attributes']:_0x26d188[_0x431a('0x32')];if(_0x460f94['query'][_0x431a('0x47')]){_0x33c811[_0x431a('0x42')]=[{'all':!![]}];}_0x33c811=_[_0x431a('0x40')]({},_0x33c811,_0x460f94[_0x431a('0x41')]);return db[_0x431a('0x45')]['find'](_0x33c811)[_0x431a('0x28')](handleEntityNotFound(_0x3259ef,null))[_0x431a('0x28')](function(_0x22bd31){if(_0x22bd31){var _0x2ce8ce=_0x22bd31[_0x431a('0x4b')]({'plain':!![]});_0x2ce8ce=qs['omit'](_0x2ce8ce,['id','createdAt',_0x431a('0x4c')]);_0x460f94[_0x431a('0x4d')]=_[_0x431a('0x4e')](_0x460f94['body'],['id',_0x431a('0x4f'),'updatedAt']);return db[_0x431a('0x45')][_0x431a('0x50')](_['merge'](_0x2ce8ce,_0x460f94[_0x431a('0x4d')]),{'include':_0x460f94[_0x431a('0x33')][_0x431a('0x47')]?[{'all':!![]}]:undefined});}})[_0x431a('0x28')](respondWithResult(_0x3259ef,0xc9))[_0x431a('0x49')](handleError(_0x3259ef,null));};exports[_0x431a('0x26')]=function(_0x5bb774,_0x76e81a){if(_0x5bb774[_0x431a('0x4d')]['id']){delete _0x5bb774[_0x431a('0x4d')]['id'];}return db[_0x431a('0x45')]['find']({'where':{'id':_0x5bb774[_0x431a('0x44')]['id']}})['then'](handleEntityNotFound(_0x76e81a,null))['then'](saveUpdates(_0x5bb774[_0x431a('0x4d')],null))[_0x431a('0x28')](respondWithResult(_0x76e81a,null))['catch'](handleError(_0x76e81a,null));};exports[_0x431a('0x27')]=function(_0x196b75,_0xa06401){return db['Attachment'][_0x431a('0x48')]({'where':{'id':_0x196b75[_0x431a('0x44')]['id']}})[_0x431a('0x28')](handleEntityNotFound(_0xa06401,null))[_0x431a('0x28')](removeEntity(_0xa06401,null))[_0x431a('0x49')](handleError(_0xa06401,null));};exports[_0x431a('0x50')]=function(_0x6c054e,_0x506db1,_0x4658b2){_0x6c054e[_0x431a('0x4d')][_0x431a('0x2c')]=_0x6c054e['file'][_0x431a('0x51')];_0x6c054e[_0x431a('0x4d')][_0x431a('0x52')]=_0x6c054e[_0x431a('0x53')][_0x431a('0x54')];_0x6c054e[_0x431a('0x4d')][_0x431a('0x30')]=_0x6c054e[_0x431a('0x53')][_0x431a('0x55')];return db['Attachment'][_0x431a('0x50')](_0x6c054e['body'])[_0x431a('0x28')](respondWithResult(_0x506db1,0xc9))[_0x431a('0x49')](handleError(_0x506db1,null));};exports[_0x431a('0x56')]=function(_0x1c8575,_0x2f7d6f,_0x40abfe){return db['Attachment'][_0x431a('0x57')]({'where':{'id':_0x1c8575[_0x431a('0x44')]['id']},'raw':!![]})[_0x431a('0x28')](handleEntityNotFound(_0x2f7d6f,null))[_0x431a('0x28')](function(_0x555cbd){if(_0x555cbd){var _0x2ded56=_0x555cbd[_0x431a('0x58')]!==null;var _0x4ca073=path[_0x431a('0x59')](config[_0x431a('0x5a')],_0x431a('0x5b'));if(_0x2ded56){_0x4ca073=path[_0x431a('0x59')](_0x4ca073,_0x431a('0x5c'));}var _0xe05e2c=path[_0x431a('0x59')](_0x4ca073,_0x555cbd[_0x431a('0x52')]);return _0x2f7d6f[_0x431a('0x56')](_0xe05e2c);}})[_0x431a('0x49')](handleError(_0x2f7d6f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index a6d433c..a05a254 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 _0xfc85=['lodash','util','bluebird','path','rimraf','../../config/environment','exports','define','Attachment'];(function(_0x410327,_0x247739){var _0x210778=function(_0x547357){while(--_0x547357){_0x410327['push'](_0x410327['shift']());}};_0x210778(++_0x247739);}(_0xfc85,0x120));var _0x5fc8=function(_0xfbec2b,_0x221f4a){_0xfbec2b=_0xfbec2b-0x0;var _0x36e4d5=_0xfc85[_0xfbec2b];return _0x36e4d5;};'use strict';var _=require(_0x5fc8('0x0'));var util=require(_0x5fc8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5fc8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fc8('0x3'));var rimraf=require(_0x5fc8('0x4'));var config=require(_0x5fc8('0x5'));var attributes=require('./attachment.attributes');module[_0x5fc8('0x6')]=function(_0x1dc111,_0x52e7b6){return _0x1dc111[_0x5fc8('0x7')](_0x5fc8('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc43c=['Attachment','attachments','lodash','util','../../config/logger','api','moment','path','../../config/environment','./attachment.attributes','exports','define'];(function(_0x4f01a9,_0x4a0d3a){var _0x5f5ade=function(_0xbd7ca6){while(--_0xbd7ca6){_0x4f01a9['push'](_0x4f01a9['shift']());}};_0x5f5ade(++_0x4a0d3a);}(_0xc43c,0x7a));var _0xcc43=function(_0x472671,_0x5e6565){_0x472671=_0x472671-0x0;var _0x15b050=_0xc43c[_0x472671];return _0x15b050;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))(_0xcc43('0x3'));var moment=require(_0xcc43('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc43('0x5'));var rimraf=require('rimraf');var config=require(_0xcc43('0x6'));var attributes=require(_0xcc43('0x7'));module[_0xcc43('0x8')]=function(_0x5af4c9,_0x1bb2fb){return _0x5af4c9[_0xcc43('0x9')](_0xcc43('0xa'),attributes,{'tableName':_0xcc43('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 bd9d411..0cfa10b 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 _0x6658=['then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request'];(function(_0x3016fb,_0x159c85){var _0x2c5a14=function(_0x19247f){while(--_0x19247f){_0x3016fb['push'](_0x3016fb['shift']());}};_0x2c5a14(++_0x159c85);}(_0x6658,0x198));var _0x8665=function(_0x454162,_0x4ecb89){_0x454162=_0x454162-0x0;var _0x245bbc=_0x6658[_0x454162];return _0x245bbc;};'use strict';var _=require(_0x8665('0x0'));var util=require(_0x8665('0x1'));var moment=require(_0x8665('0x2'));var BPromise=require(_0x8665('0x3'));var rs=require(_0x8665('0x4'));var fs=require('fs');var Redis=require(_0x8665('0x5'));var db=require(_0x8665('0x6'))['db'];var utils=require(_0x8665('0x7'));var logger=require('../../config/logger')(_0x8665('0x8'));var config=require(_0x8665('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8665('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x290df7,_0x24c89f,_0x242f58){return new BPromise(function(_0xe73687,_0x861e11){return client[_0x8665('0xb')](_0x290df7,_0x242f58)[_0x8665('0xc')](function(_0x5c25bf){logger[_0x8665('0xd')](_0x8665('0xe'),_0x24c89f,_0x8665('0xf'));logger[_0x8665('0x10')](_0x8665('0x11'),_0x24c89f,_0x8665('0xf'),JSON[_0x8665('0x12')](_0x5c25bf));if(_0x5c25bf[_0x8665('0x13')]){if(_0x5c25bf[_0x8665('0x13')][_0x8665('0x14')]===0x1f4){logger[_0x8665('0x13')](_0x8665('0xe'),_0x24c89f,_0x5c25bf[_0x8665('0x13')][_0x8665('0x15')]);return _0x861e11(_0x5c25bf['error'][_0x8665('0x15')]);}logger['error'](_0x8665('0xe'),_0x24c89f,_0x5c25bf[_0x8665('0x13')][_0x8665('0x15')]);return _0xe73687(_0x5c25bf[_0x8665('0x13')][_0x8665('0x15')]);}else{logger[_0x8665('0xd')]('Attachment,\x20%s,\x20%s',_0x24c89f,_0x8665('0xf'));_0xe73687(_0x5c25bf[_0x8665('0x16')]['message']);}})[_0x8665('0x17')](function(_0x53dcb5){logger[_0x8665('0x13')](_0x8665('0xe'),_0x24c89f,_0x53dcb5);_0x861e11(_0x53dcb5);});});}exports[_0x8665('0x18')]=function(_0x50ba7d){var _0x331e01=this;return new Promise(function(_0x235617,_0x5b7984){return db[_0x8665('0x19')][_0x8665('0x1a')](_0x50ba7d[_0x8665('0x1b')],{'raw':_0x50ba7d['options']?_0x50ba7d[_0x8665('0x1c')][_0x8665('0x1d')]===undefined?!![]:![]:!![]})[_0x8665('0xc')](function(_0x549a0a){logger['info']('CreateAttachment',_0x50ba7d);logger[_0x8665('0x10')]('CreateAttachment',_0x50ba7d,JSON[_0x8665('0x12')](_0x549a0a));_0x235617(_0x549a0a);})['catch'](function(_0x34b622){logger['error']('CreateAttachment',_0x34b622[_0x8665('0x15')],_0x50ba7d);_0x5b7984(_0x331e01[_0x8665('0x13')](0x1f4,_0x34b622['message']));});});}; \ No newline at end of file +var _0x20ce=['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','body','options','raw','lodash'];(function(_0x2e13e1,_0x14f172){var _0x40a370=function(_0x4f59b9){while(--_0x4f59b9){_0x2e13e1['push'](_0x2e13e1['shift']());}};_0x40a370(++_0x14f172);}(_0x20ce,0x10d));var _0xe20c=function(_0x578612,_0x3de60d){_0x578612=_0x578612-0x0;var _0xfc9b34=_0x20ce[_0x578612];return _0xfc9b34;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x893e48,_0x26b9be,_0x2d88b5){return new BPromise(function(_0x8f79ad,_0x290fb5){return client[_0xe20c('0xd')](_0x893e48,_0x2d88b5)[_0xe20c('0xe')](function(_0x385d61){logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,_0xe20c('0x11'));logger[_0xe20c('0x12')](_0xe20c('0x13'),_0x26b9be,_0xe20c('0x11'),JSON['stringify'](_0x385d61));if(_0x385d61[_0xe20c('0x14')]){if(_0x385d61[_0xe20c('0x14')][_0xe20c('0x15')]===0x1f4){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61['error'][_0xe20c('0x16')]);return _0x290fb5(_0x385d61[_0xe20c('0x14')]['message']);}logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61[_0xe20c('0x14')]['message']);return _0x8f79ad(_0x385d61[_0xe20c('0x14')][_0xe20c('0x16')]);}else{logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,'request\x20sent');_0x8f79ad(_0x385d61[_0xe20c('0x17')]['message']);}})[_0xe20c('0x18')](function(_0x4061ed){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x4061ed);_0x290fb5(_0x4061ed);});});}exports[_0xe20c('0x19')]=function(_0x2d58a7){var _0x2a4292=this;return new Promise(function(_0x3d8df5,_0x305f2f){return db[_0xe20c('0x1a')]['create'](_0x2d58a7[_0xe20c('0x1b')],{'raw':_0x2d58a7[_0xe20c('0x1c')]?_0x2d58a7[_0xe20c('0x1c')][_0xe20c('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x563070){logger[_0xe20c('0xf')](_0xe20c('0x19'),_0x2d58a7);logger[_0xe20c('0x12')]('CreateAttachment',_0x2d58a7,JSON['stringify'](_0x563070));_0x3d8df5(_0x563070);})[_0xe20c('0x18')](function(_0x281449){logger[_0xe20c('0x14')](_0xe20c('0x19'),_0x281449['message'],_0x2d58a7);_0x305f2f(_0x2a4292[_0xe20c('0x14')](0x1f4,_0x281449['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d56a6aa..def6f14 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'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('./attachment.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['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x0b0e,0x187));var _0xe0b0=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x0b0e[_0x519756];return _0x37047e;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index e13c549..ba93240 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 _0xe485=['url','activedirectory','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','online','admin','user','agent','then','domain','disabled','blockedAt','add','blockDuration','clearBlockUser','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','Strategy','moment','activedirectory2','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','undefined','baseDN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe485,0x114));var _0x5e48=function(_0x4473b6,_0x4630cc){_0x4473b6=_0x4473b6-0x0;var _0x3de8c7=_0xe485[_0x4473b6];return _0x3de8c7;};'use strict';var passport=require(_0x5e48('0x0'));var LocalStrategy=require('passport-local')[_0x5e48('0x1')];var moment=require(_0x5e48('0x2'));var ActiveDirectory=require(_0x5e48('0x3'));var BPromise=require('bluebird');var util=require(_0x5e48('0x4'));var db=require(_0x5e48('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x5e48('0x6'));var config=require(_0x5e48('0x7'));var logger=require(_0x5e48('0x8'))(_0x5e48('0x9'));function isActiveDirectoryConfigured(_0x2cc5b0){var _0x49006d=![];if(typeof _0x2cc5b0['activedirectory']!==_0x5e48('0xa')){_0x49006d=_0x2cc5b0['activedirectory'][_0x5e48('0xb')]&&_0x2cc5b0['activedirectory'][_0x5e48('0xc')]&&_0x2cc5b0[_0x5e48('0xd')]['domain'];}return _0x49006d;}function adAuthenticate(_0x2ac2f6,_0x2cf654,_0x3fd04e){return new BPromise(function(_0x406075,_0x1a42ff){try{var _0x25ac7f=new ActiveDirectory(_0x2ac2f6);_0x25ac7f[_0x5e48('0xe')](_0x2cf654,_0x3fd04e,function(_0x510d22,_0x2017c2){if(_0x510d22){logger[_0x5e48('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x2cf654,util[_0x5e48('0x10')](_0x510d22,{'showHidden':![],'depth':null}));_0x1a42ff('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2017c2){logger[_0x5e48('0xf')](_0x5e48('0x11'),_0x2cf654);_0x1a42ff(_0x5e48('0x12'));}else{_0x406075(_0x2017c2);}});}catch(_0x2b6f32){_0x1a42ff(_0x2b6f32);}});}function ActiveDirectoryAuthenticate(_0x4a61ae,_0x18176b,_0x5134b5,_0x3e02fe){var _0x8b2e45,_0x15ba1f;if(!isActiveDirectoryConfigured(config)){logger[_0x5e48('0xf')](_0x5e48('0x13'),_0x18176b);return _0x3e02fe(null,![],{'message':_0x5e48('0x12')});}return db['Setting'][_0x5e48('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})['then'](function(_0x627d9){_0x8b2e45=_0x627d9;if(!_0x8b2e45[_0x5e48('0x15')]){logger[_0x5e48('0xf')](_0x5e48('0x16'),_0x18176b);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x4a61ae[_0x5e48('0x14')]({'attributes':['id',_0x5e48('0x17'),_0x5e48('0x18'),_0x5e48('0x19'),_0x5e48('0x1a'),'disabled',_0x5e48('0x1b'),'blockedAt',_0x5e48('0x1c')],'where':{'name':_0x18176b,'role':{'$or':[_0x5e48('0x1d'),_0x5e48('0x1e'),_0x5e48('0x1f')]},'adSsoEnabled':!![]}});})[_0x5e48('0x20')](function(_0x4f46b1){if(!_0x4f46b1||_0x4f46b1&&_0x4f46b1['name']!==_0x18176b){throw new Error(_0x5e48('0x12'));}_0x15ba1f=_0x4f46b1;var _0x3cc894=_0x15ba1f[_0x5e48('0x17')]+'@'+config[_0x5e48('0xd')][_0x5e48('0x21')];return adAuthenticate(config[_0x5e48('0xd')],_0x3cc894,_0x5134b5);})[_0x5e48('0x20')](function(_0x2e5342){if(_0x15ba1f[_0x5e48('0x22')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x8b2e45['blockDuration']>0x0){if(_0x15ba1f[_0x5e48('0x1b')]){if(moment(_0x15ba1f[_0x5e48('0x23')])[_0x5e48('0x24')](_0x8b2e45[_0x5e48('0x25')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x5e48('0x26')](_0x15ba1f,0x0,![],null)[_0x5e48('0x20')](function(){return utils['getLicense'](_0x15ba1f);})[_0x5e48('0x20')](function(){return _0x3e02fe(null,_0x15ba1f);});}else{return utils['getLicense'](_0x15ba1f)['then'](function(){return _0x3e02fe(null,_0x15ba1f);});}}else{return utils['getLicense'](_0x15ba1f)[_0x5e48('0x20')](function(){return _0x3e02fe(null,_0x15ba1f);});}})[_0x5e48('0x27')](function(_0x53868e){return _0x3e02fe(null,![],_0x53868e);});}function handleError(_0x5d2d3c,_0x50b3da,_0x470667){return _0x5d2d3c['status'](_0x50b3da||0x1f4)[_0x5e48('0x28')]({'message':_0x470667?_0x470667[_0x5e48('0x29')]||_0x470667:''});}exports[_0x5e48('0x2a')]=function(_0x4ecbd9,_0x4c4c8d,_0x29b7cf){passport[_0x5e48('0xe')](_0x5e48('0x2b'),function(_0x2bd6d2,_0x3eb3bc,_0x1f09f4){var _0x135215=_0x2bd6d2||_0x1f09f4;if(_0x135215){return handleError(_0x4c4c8d,0x191,_0x135215);}if(!_0x3eb3bc){return handleError(_0x4c4c8d,0x194,{'message':_0x5e48('0x2c')});}else{var _0x593476={'payload':{'id':_0x3eb3bc['id'],'role':_0x3eb3bc[_0x5e48('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x5e48('0x2d')](_0x593476)[_0x5e48('0x20')](function(_0x14787f){_0x4c4c8d['json']({'id':_0x3eb3bc['id'],'token':_0x14787f,'statusCall':'','isAlreadyLogged':_0x3eb3bc[_0x5e48('0x1c')]});});}})(_0x4ecbd9,_0x4c4c8d,_0x29b7cf);};passport[_0x5e48('0x2e')](_0x5e48('0x2b'),new LocalStrategy({'usernameField':_0x5e48('0x17'),'passwordField':'password'},function(_0x2037ef,_0x516417,_0x193052){return ActiveDirectoryAuthenticate(db[_0x5e48('0x2f')],_0x2037ef,_0x516417,_0x193052);})); \ No newline at end of file +var _0x2f3e=['error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','name','salt','role','blocked','blockedAt','online','admin','user','agent','domain','add','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','activedirectory','undefined','baseDN','url','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x2f3e,0x1d6));var _0xe2f3=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0x2f3e[_0x38ff1e];return _0x3755d4;};'use strict';var passport=require(_0xe2f3('0x0'));var LocalStrategy=require(_0xe2f3('0x1'))[_0xe2f3('0x2')];var moment=require(_0xe2f3('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xe2f3('0x4'));var util=require('util');var db=require(_0xe2f3('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xe2f3('0x6'));var config=require(_0xe2f3('0x7'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x151eb3){var _0x5ccbf3=![];if(typeof _0x151eb3[_0xe2f3('0x8')]!==_0xe2f3('0x9')){_0x5ccbf3=_0x151eb3['activedirectory'][_0xe2f3('0xa')]&&_0x151eb3[_0xe2f3('0x8')][_0xe2f3('0xb')]&&_0x151eb3[_0xe2f3('0x8')]['domain'];}return _0x5ccbf3;}function adAuthenticate(_0x220a3f,_0x296027,_0x3d0d1d){return new BPromise(function(_0x249edd,_0x3538cd){try{var _0x1a24c6=new ActiveDirectory(_0x220a3f);_0x1a24c6['authenticate'](_0x296027,_0x3d0d1d,function(_0x59a911,_0x54d4ff){if(_0x59a911){logger['error'](_0xe2f3('0xc'),_0x296027,util['inspect'](_0x59a911,{'showHidden':![],'depth':null}));_0x3538cd(_0xe2f3('0xd'));}else if(!_0x54d4ff){logger[_0xe2f3('0xe')](_0xe2f3('0xf'),_0x296027);_0x3538cd(_0xe2f3('0xd'));}else{_0x249edd(_0x54d4ff);}});}catch(_0x10c07c){_0x3538cd(_0x10c07c);}});}function ActiveDirectoryAuthenticate(_0xbd76b,_0x461c73,_0x2310cc,_0x31b968){var _0x33cb0e,_0x3eb022;if(!isActiveDirectoryConfigured(config)){logger[_0xe2f3('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x461c73);return _0x31b968(null,![],{'message':_0xe2f3('0xd')});}return db[_0xe2f3('0x10')][_0xe2f3('0x11')]({'where':{'id':0x1},'attributes':[_0xe2f3('0x12'),_0xe2f3('0x13')],'raw':!![]})[_0xe2f3('0x14')](function(_0x3e1460){_0x33cb0e=_0x3e1460;if(!_0x33cb0e[_0xe2f3('0x12')]){logger[_0xe2f3('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x461c73);throw new Error(_0xe2f3('0xd'));}return _0xbd76b[_0xe2f3('0x11')]({'attributes':['id',_0xe2f3('0x15'),'password',_0xe2f3('0x16'),_0xe2f3('0x17'),'disabled',_0xe2f3('0x18'),_0xe2f3('0x19'),_0xe2f3('0x1a')],'where':{'name':_0x461c73,'role':{'$or':[_0xe2f3('0x1b'),_0xe2f3('0x1c'),_0xe2f3('0x1d')]},'adSsoEnabled':!![]}});})[_0xe2f3('0x14')](function(_0x1fe35f){if(!_0x1fe35f||_0x1fe35f&&_0x1fe35f[_0xe2f3('0x15')]!==_0x461c73){throw new Error(_0xe2f3('0xd'));}_0x3eb022=_0x1fe35f;var _0x394563=_0x3eb022['name']+'@'+config[_0xe2f3('0x8')][_0xe2f3('0x1e')];return adAuthenticate(config[_0xe2f3('0x8')],_0x394563,_0x2310cc);})[_0xe2f3('0x14')](function(_0x2c9882){if(_0x3eb022['disabled']){throw new Error(_0xe2f3('0xd'));}if(_0x33cb0e[_0xe2f3('0x13')]>0x0){if(_0x3eb022[_0xe2f3('0x18')]){if(moment(_0x3eb022[_0xe2f3('0x19')])[_0xe2f3('0x1f')](_0x33cb0e['blockDuration'],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xe2f3('0x20')](_0x3eb022,0x0,![],null)[_0xe2f3('0x14')](function(){return utils['getLicense'](_0x3eb022);})[_0xe2f3('0x14')](function(){return _0x31b968(null,_0x3eb022);});}else{return utils[_0xe2f3('0x21')](_0x3eb022)[_0xe2f3('0x14')](function(){return _0x31b968(null,_0x3eb022);});}}else{return utils[_0xe2f3('0x21')](_0x3eb022)['then'](function(){return _0x31b968(null,_0x3eb022);});}})['catch'](function(_0x1ebb45){return _0x31b968(null,![],_0x1ebb45);});}function handleError(_0x3b9e44,_0x3d9062,_0x4225b1){return _0x3b9e44[_0xe2f3('0x22')](_0x3d9062||0x1f4)[_0xe2f3('0x23')]({'message':_0x4225b1?_0x4225b1[_0xe2f3('0x24')]||_0x4225b1:''});}exports[_0xe2f3('0x25')]=function(_0x2e06ee,_0x2827f4,_0x1e6f67){passport['authenticate'](_0xe2f3('0x26'),function(_0x33f2ef,_0xc20eb9,_0x19eb25){var _0xae7b85=_0x33f2ef||_0x19eb25;if(_0xae7b85){return handleError(_0x2827f4,0x191,_0xae7b85);}if(!_0xc20eb9){return handleError(_0x2827f4,0x194,{'message':_0xe2f3('0x27')});}else{var _0x1572d8={'payload':{'id':_0xc20eb9['id'],'role':_0xc20eb9[_0xe2f3('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0xe2f3('0x28')](_0x1572d8)['then'](function(_0x2f73a5){_0x2827f4[_0xe2f3('0x29')]({'id':_0xc20eb9['id'],'token':_0x2f73a5,'statusCall':'','isAlreadyLogged':_0xc20eb9[_0xe2f3('0x1a')]});});}})(_0x2e06ee,_0x2827f4,_0x1e6f67);};passport[_0xe2f3('0x2a')](_0xe2f3('0x26'),new LocalStrategy({'usernameField':_0xe2f3('0x15'),'passwordField':'password'},function(_0x99cc3b,_0x133707,_0x562d47){return ActiveDirectoryAuthenticate(db[_0xe2f3('0x2b')],_0x99cc3b,_0x133707,_0x562d47);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 663385d..8ffd396 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 _0xfcaf=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xfcaf,0x125));var _0xffca=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xfcaf[_0x46e363];return _0x3fb059;};'use strict';var express=require(_0xffca('0x0'));var router=express[_0xffca('0x1')]();var controller=require(_0xffca('0x2'));router[_0xffca('0x3')]('/',controller[_0xffca('0x4')]);module[_0xffca('0x5')]=router; \ No newline at end of file +var _0x2064=['login','exports','Router','post'];(function(_0xec6d0e,_0x540c91){var _0x204f5a=function(_0x4a5ab8){while(--_0x4a5ab8){_0xec6d0e['push'](_0xec6d0e['shift']());}};_0x204f5a(++_0x540c91);}(_0x2064,0x1da));var _0x4206=function(_0x241f06,_0x3c7ef8){_0x241f06=_0x241f06-0x0;var _0x2ec3a1=_0x2064[_0x241f06];return _0x2ec3a1;};'use strict';var express=require('express');var router=express[_0x4206('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0x4206('0x1')]('/',controller[_0x4206('0x2')]);module[_0x4206('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 28fa29e..f1d4dba 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(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x7a54,0x106));var _0x47a5=function(_0x253337,_0x1f1a74){_0x253337=_0x253337-0x0;var _0x543785=_0x7a54[_0x253337];return _0x543785;};'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 _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(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7a54,0x106));var _0x47a5=function(_0x10ed70,_0x22609d){_0x10ed70=_0x10ed70-0x0;var _0x53886=_0x7a54[_0x10ed70];return _0x53886;};'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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 1ecca44..08b1146 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 _0x854e=['login','/callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x6552bc,_0x3ac19e){var _0x39011b=function(_0x2a1c78){while(--_0x2a1c78){_0x6552bc['push'](_0x6552bc['shift']());}};_0x39011b(++_0x3ac19e);}(_0x854e,0xdd));var _0xe854=function(_0x2e36a8,_0x4adb6e){_0x2e36a8=_0x2e36a8-0x0;var _0x74aaa2=_0x854e[_0x2e36a8];return _0x74aaa2;};'use strict';var express=require(_0xe854('0x0'));var passport=require(_0xe854('0x1'));var router=express[_0xe854('0x2')]();var controller=require(_0xe854('0x3'));var userController=require(_0xe854('0x4'));var authService=require(_0xe854('0x5'));router[_0xe854('0x6')]('/',controller[_0xe854('0x7')]);router[_0xe854('0x6')](_0xe854('0x8'),controller['callback'],authService[_0xe854('0x9')],userController['login'],authService[_0xe854('0xa')]);module[_0xe854('0xb')]=router; \ No newline at end of file +var _0x134d=['isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x134d,0x1b3));var _0xd134=function(_0x2d01ce,_0x3ab31a){_0x2d01ce=_0x2d01ce-0x0;var _0x5d86cd=_0x134d[_0x2d01ce];return _0x5d86cd;};'use strict';var express=require('express');var passport=require(_0xd134('0x0'));var router=express[_0xd134('0x1')]();var controller=require(_0xd134('0x2'));var userController=require(_0xd134('0x3'));var authService=require(_0xd134('0x4'));router['get']('/',controller[_0xd134('0x5')]);router[_0xd134('0x6')](_0xd134('0x7'),controller[_0xd134('0x8')],authService[_0xd134('0x9')],userController['login'],authService[_0xd134('0xa')]);module[_0xd134('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 8963901..f346b59 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 _0xbf94=['body','email','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','status','send','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','salt','role','blocked','blockedAt','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','local-login','signToken','json','online'];(function(_0xf9b20f,_0x23866c){var _0x3c99d6=function(_0x4215ec){while(--_0x4215ec){_0xf9b20f['push'](_0xf9b20f['shift']());}};_0x3c99d6(++_0x23866c);}(_0xbf94,0x1b0));var _0x4bf9=function(_0xf5b449,_0x5e8938){_0xf5b449=_0xf5b449-0x0;var _0x4d13cb=_0xbf94[_0xf5b449];return _0x4d13cb;};'use strict';var util=require(_0x4bf9('0x0'));var passport=require(_0x4bf9('0x1'));var LocalStrategy=require('passport-local')[_0x4bf9('0x2')];var jayson=require(_0x4bf9('0x3'));var _=require(_0x4bf9('0x4'));var rs=require(_0x4bf9('0x5'));var moment=require(_0x4bf9('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x4bf9('0x7'));var utils=require(_0x4bf9('0x8'));var client=jayson['client'][_0x4bf9('0x9')]({'port':0x232b});function localAuthenticate(_0x217c16,_0x340bcc,_0x3c80d4,_0x589210){var _0x581324,_0x2505bd;return db[_0x4bf9('0xa')][_0x4bf9('0xb')]({'where':{'id':0x1},'attributes':[_0x4bf9('0xc'),_0x4bf9('0xd')],'raw':!![]})[_0x4bf9('0xe')](function(_0x37d1d1){_0x581324=_0x37d1d1;return _0x217c16[_0x4bf9('0xb')]({'attributes':['id','name','password',_0x4bf9('0xf'),_0x4bf9('0x10'),'disabled',_0x4bf9('0x11'),_0x4bf9('0x12'),'loginAttempts'],'where':{'name':_0x340bcc,'role':{'$or':['admin',_0x4bf9('0x13'),'agent']}}});})['then'](function(_0xbebdcb){if(!_0xbebdcb||_0xbebdcb&&_0xbebdcb[_0x4bf9('0x14')]!==_0x340bcc){throw new Error(_0x4bf9('0x15'));}else{_0x2505bd=_0xbebdcb;return _0x2505bd;}})[_0x4bf9('0xe')](function(){_0x2505bd[_0x4bf9('0x16')](_0x3c80d4,function(_0x4ed5ca,_0x24a20a){var _0x50f078=_0x2505bd[_0x4bf9('0x17')]+0x1;if(_0x4ed5ca){return _0x589210(_0x4ed5ca);}else if(!_0x24a20a){if(_0x2505bd[_0x4bf9('0x18')]){return _0x589210(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x581324[_0x4bf9('0xc')]>0x0){if(_0x2505bd[_0x4bf9('0x11')]){if(_0x581324[_0x4bf9('0xd')]>0x0){if(moment(_0x2505bd[_0x4bf9('0x12')])['add'](_0x581324['blockDuration'],_0x4bf9('0x19'))>moment()){return _0x589210(null,![],{'message':_0x4bf9('0x15')});}else{return utils['clearBlockUser'](_0x2505bd,_0x50f078,![],null)['then'](function(){return _0x589210(null,![],{'message':_0x4bf9('0x15')});});}}else{return _0x589210(null,![],{'message':_0x4bf9('0x15')});}}else{if(_0x50f078>=_0x581324[_0x4bf9('0xc')]){return utils[_0x4bf9('0x1a')](_0x2505bd,0x0,!![],moment())[_0x4bf9('0xe')](function(){return _0x589210(null,![],{'message':_0x4bf9('0x15')});});}else{return utils[_0x4bf9('0x1a')](_0x2505bd,_0x50f078,![],null)[_0x4bf9('0xe')](function(){return _0x589210(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x589210(null,![],{'message':_0x4bf9('0x15')});}}else{if(_0x2505bd['disabled']){return _0x589210(null,![],{'message':_0x4bf9('0x15')});}else if(_0x581324[_0x4bf9('0xc')]>0x0){if(_0x2505bd[_0x4bf9('0x11')]){if(_0x581324['blockDuration']>0x0){if(moment(_0x2505bd[_0x4bf9('0x12')])[_0x4bf9('0x1b')](_0x581324[_0x4bf9('0xd')],_0x4bf9('0x19'))>moment()){return _0x589210(null,![],{'message':_0x4bf9('0x15')});}else{return utils[_0x4bf9('0x1a')](_0x2505bd,0x0,![],null)[_0x4bf9('0xe')](function(){return utils[_0x4bf9('0x1c')](_0x2505bd);})[_0x4bf9('0xe')](function(){return _0x589210(null,_0x2505bd);});}}else{return _0x589210(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x4bf9('0x1a')](_0x2505bd,0x0,![],null)[_0x4bf9('0xe')](function(){return utils[_0x4bf9('0x1c')](_0x2505bd);})[_0x4bf9('0xe')](function(){return _0x589210(null,_0x2505bd);})[_0x4bf9('0x1d')](function(_0x727e6b){return _0x589210(null,![],_0x727e6b);});}}else{if(_0x2505bd[_0x4bf9('0x11')]){return _0x589210(null,![],{'message':_0x4bf9('0x15')});}else{return utils[_0x4bf9('0x1c')](_0x2505bd)[_0x4bf9('0xe')](function(){return _0x589210(null,_0x2505bd);});}}}});})['catch'](function(_0x41b957){return _0x589210(null,![],_0x41b957);});}function sendServiceMail(_0xe0467e){return db[_0x4bf9('0x1e')][_0x4bf9('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x4bf9('0x14'),'email'],'include':[{'model':db[_0x4bf9('0x20')],'as':_0x4bf9('0x21'),'include':[{'model':db[_0x4bf9('0x22')],'as':_0x4bf9('0x22')}]}]})[_0x4bf9('0xe')](function(_0x3eccdb){if(!_0x3eccdb){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5d4fb1=_0x3eccdb[_0x4bf9('0x23')]();var _0x4520d0={'account':_0x5d4fb1,'message':_[_0x4bf9('0x24')]({'from':util[_0x4bf9('0x25')](_0x4bf9('0x26'),_0x3eccdb[_0x4bf9('0x14')],_0x3eccdb['email']||_0x3eccdb['Smtp'][_0x4bf9('0x13')])},_0xe0467e)};return client[_0x4bf9('0x27')](_0x4bf9('0x28'),_0x4520d0);})[_0x4bf9('0xe')](function(_0x2333d4){if(_0x2333d4[_0x4bf9('0x29')]){throw new Error(util[_0x4bf9('0x25')](_0x4bf9('0x2a'),_0x2333d4[_0x4bf9('0x29')][_0x4bf9('0x2b')]||JSON['stringify'](_0x2333d4[_0x4bf9('0x29')])));}return!![];});}function handleError(_0x28c3eb,_0x537842,_0x1edd6f){return _0x28c3eb['status'](_0x537842||0x1f4)['send']({'message':_0x1edd6f?_0x1edd6f['message']||_0x1edd6f:''});}exports['login']=function(_0x10f446,_0x35db7e,_0x306c28){passport[_0x4bf9('0x16')](_0x4bf9('0x2c'),function(_0x3c341d,_0x282fbf,_0x2c43de){var _0x20ed21=_0x3c341d||_0x2c43de;if(_0x20ed21){return handleError(_0x35db7e,0x191,_0x20ed21);}if(!_0x282fbf){return handleError(_0x35db7e,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5a6b24={'payload':{'id':_0x282fbf['id'],'role':_0x282fbf['role']},'options':{'expiresIn':0x15180}};return authService[_0x4bf9('0x2d')](_0x5a6b24)[_0x4bf9('0xe')](function(_0x13a112){_0x35db7e[_0x4bf9('0x2e')]({'id':_0x282fbf['id'],'token':_0x13a112,'statusCall':'','isAlreadyLogged':_0x282fbf[_0x4bf9('0x2f')]});});}})(_0x10f446,_0x35db7e,_0x306c28);};exports['forgot']=function(_0x3bb6b,_0x513c34){if(!_0x3bb6b[_0x4bf9('0x30')][_0x4bf9('0x31')]){return handleError(_0x513c34,0x1f4,{'message':_0x4bf9('0x32')});}var _0x280c64=rs[_0x4bf9('0x33')]();_0x3bb6b['body'][_0x4bf9('0x31')]=_0x3bb6b[_0x4bf9('0x30')][_0x4bf9('0x31')][_0x4bf9('0x34')]()['toLowerCase']();var _0x3fcea2;return db['Setting'][_0x4bf9('0xb')]({'where':{'id':0x1},'attributes':[_0x4bf9('0xc'),_0x4bf9('0xd')],'raw':!![]})['then'](function(_0x1c49c1){_0x3fcea2=_0x1c49c1;return db[_0x4bf9('0x35')][_0x4bf9('0x1f')]({'where':{'email':_0x3bb6b[_0x4bf9('0x30')][_0x4bf9('0x31')]}});})[_0x4bf9('0xe')](function(_0x356feb){if(!_0x356feb){throw new Error(_0x4bf9('0x36'));}if(_0x356feb[_0x4bf9('0x18')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x356feb['blocked']){if(moment(_0x356feb[_0x4bf9('0x12')])[_0x4bf9('0x1b')](_0x3fcea2[_0x4bf9('0xd')],_0x4bf9('0x19'))>moment()){throw new Error(_0x4bf9('0x37'));}else{_0x356feb[_0x4bf9('0x11')]=![];_0x356feb['blockedAt']=null;}}_0x356feb[_0x4bf9('0x38')]=_0x280c64;_0x356feb[_0x4bf9('0x39')]=Date['now']()+0x36ee80;return _0x356feb[_0x4bf9('0x3a')]();})[_0x4bf9('0xe')](function(){return sendServiceMail({'to':_0x3bb6b['body'][_0x4bf9('0x31')],'subject':_0x4bf9('0x3b'),'text':_0x4bf9('0x3c')+_0x4bf9('0x3d')+_0x4bf9('0x3e')+_0x3bb6b[_0x4bf9('0x3f')][_0x4bf9('0x40')]+'/reset/'+_0x280c64+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x4bf9('0xe')](function(){_0x513c34['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x4bf9('0x1d')](function(_0x15862b){return handleError(_0x513c34,0x1f4,_0x15862b);});};exports[_0x4bf9('0x41')]=function(_0x57a97a,_0xa248db){return db['User'][_0x4bf9('0x1f')]({'where':{'resetPasswordToken':_0x57a97a[_0x4bf9('0x42')][_0x4bf9('0x43')],'resetPasswordExpires':{'$gt':Date[_0x4bf9('0x44')]()}}})['then'](function(_0x38f6e3){if(!_0x38f6e3){throw new Error(_0x4bf9('0x45'));}return db[_0x4bf9('0xa')][_0x4bf9('0xb')]({'attributes':['id',_0x4bf9('0x46'),_0x4bf9('0x47'),_0x4bf9('0x48')]})[_0x4bf9('0xe')](function(_0x5cfa8d){if(_0x5cfa8d[_0x4bf9('0x46')])authService[_0x4bf9('0x49')](_0x57a97a[_0x4bf9('0x30')][_0x4bf9('0x4a')]);if(!_0x5cfa8d['enforcePasswordHistory']||!_0x38f6e3[_0x4bf9('0x4b')])return _0x38f6e3;authService['validatePasswordHistory'](_0x57a97a[_0x4bf9('0x30')]['password'],_0x38f6e3[_0x4bf9('0x4b')],_0x5cfa8d[_0x4bf9('0x48')]);return _0x38f6e3;})[_0x4bf9('0xe')](function(){_0x38f6e3[_0x4bf9('0x4a')]=_0x57a97a[_0x4bf9('0x30')][_0x4bf9('0x4a')];_0x38f6e3[_0x4bf9('0x38')]=null;_0x38f6e3['resetPasswordExpires']=null;return _0x38f6e3[_0x4bf9('0x3a')]();});})[_0x4bf9('0xe')](function(){_0xa248db[_0x4bf9('0x4c')](0xc8)[_0x4bf9('0x4d')]({'message':_0x4bf9('0x4e')});})[_0x4bf9('0x1d')](function(_0x2478e7){return handleError(_0xa248db,0x1f4,_0x2478e7);});};passport[_0x4bf9('0x4f')](_0x4bf9('0x2c'),new LocalStrategy({'usernameField':_0x4bf9('0x14'),'passwordField':_0x4bf9('0x4a')},function(_0xdc9ef5,_0x597297,_0x8a7872){return localAuthenticate(db['User'],_0xdc9ef5,_0x597297,_0x8a7872);})); \ No newline at end of file +var _0x9f45=['use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','disabled','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','user','SendMail','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f45,0x1a5));var _0x59f4=function(_0x105445,_0xa23907){_0x105445=_0x105445-0x0;var _0x119ce1=_0x9f45[_0x105445];return _0x119ce1;};'use strict';var util=require(_0x59f4('0x0'));var passport=require(_0x59f4('0x1'));var LocalStrategy=require(_0x59f4('0x2'))[_0x59f4('0x3')];var jayson=require(_0x59f4('0x4'));var _=require('lodash');var rs=require(_0x59f4('0x5'));var moment=require(_0x59f4('0x6'));var db=require(_0x59f4('0x7'))['db'];var authService=require(_0x59f4('0x8'));var utils=require(_0x59f4('0x9'));var client=jayson[_0x59f4('0xa')][_0x59f4('0xb')]({'port':0x232b});function localAuthenticate(_0x5a98ad,_0x47e078,_0x8f889c,_0x18890e){var _0x3988f3,_0x8f3826;return db[_0x59f4('0xc')][_0x59f4('0xd')]({'where':{'id':0x1},'attributes':[_0x59f4('0xe'),_0x59f4('0xf')],'raw':!![]})[_0x59f4('0x10')](function(_0x14de6a){_0x3988f3=_0x14de6a;return _0x5a98ad['findOne']({'attributes':['id',_0x59f4('0x11'),_0x59f4('0x12'),'salt','role','disabled',_0x59f4('0x13'),_0x59f4('0x14'),_0x59f4('0x15')],'where':{'name':_0x47e078,'role':{'$or':[_0x59f4('0x16'),'user',_0x59f4('0x17')]}}});})[_0x59f4('0x10')](function(_0x1ed49e){if(!_0x1ed49e||_0x1ed49e&&_0x1ed49e[_0x59f4('0x11')]!==_0x47e078){throw new Error(_0x59f4('0x18'));}else{_0x8f3826=_0x1ed49e;return _0x8f3826;}})[_0x59f4('0x10')](function(){_0x8f3826[_0x59f4('0x19')](_0x8f889c,function(_0x32935e,_0x35caa3){var _0x4857dc=_0x8f3826[_0x59f4('0x15')]+0x1;if(_0x32935e){return _0x18890e(_0x32935e);}else if(!_0x35caa3){if(_0x8f3826['disabled']){return _0x18890e(null,![],{'message':_0x59f4('0x18')});}else if(_0x3988f3[_0x59f4('0xe')]>0x0){if(_0x8f3826[_0x59f4('0x13')]){if(_0x3988f3[_0x59f4('0xf')]>0x0){if(moment(_0x8f3826[_0x59f4('0x14')])['add'](_0x3988f3[_0x59f4('0xf')],_0x59f4('0x1a'))>moment()){return _0x18890e(null,![],{'message':_0x59f4('0x18')});}else{return utils[_0x59f4('0x1b')](_0x8f3826,_0x4857dc,![],null)[_0x59f4('0x10')](function(){return _0x18890e(null,![],{'message':_0x59f4('0x18')});});}}else{return _0x18890e(null,![],{'message':_0x59f4('0x18')});}}else{if(_0x4857dc>=_0x3988f3[_0x59f4('0xe')]){return utils[_0x59f4('0x1b')](_0x8f3826,0x0,!![],moment())[_0x59f4('0x10')](function(){return _0x18890e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x59f4('0x1b')](_0x8f3826,_0x4857dc,![],null)[_0x59f4('0x10')](function(){return _0x18890e(null,![],{'message':_0x59f4('0x18')});});}}}else{return _0x18890e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x8f3826[_0x59f4('0x1c')]){return _0x18890e(null,![],{'message':_0x59f4('0x18')});}else if(_0x3988f3[_0x59f4('0xe')]>0x0){if(_0x8f3826[_0x59f4('0x13')]){if(_0x3988f3['blockDuration']>0x0){if(moment(_0x8f3826[_0x59f4('0x14')])[_0x59f4('0x1d')](_0x3988f3[_0x59f4('0xf')],'minutes')>moment()){return _0x18890e(null,![],{'message':_0x59f4('0x18')});}else{return utils[_0x59f4('0x1b')](_0x8f3826,0x0,![],null)['then'](function(){return utils[_0x59f4('0x1e')](_0x8f3826);})[_0x59f4('0x10')](function(){return _0x18890e(null,_0x8f3826);});}}else{return _0x18890e(null,![],{'message':_0x59f4('0x18')});}}else{return utils[_0x59f4('0x1b')](_0x8f3826,0x0,![],null)[_0x59f4('0x10')](function(){return utils[_0x59f4('0x1e')](_0x8f3826);})['then'](function(){return _0x18890e(null,_0x8f3826);})['catch'](function(_0x3a7b89){return _0x18890e(null,![],_0x3a7b89);});}}else{if(_0x8f3826[_0x59f4('0x13')]){return _0x18890e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x59f4('0x1e')](_0x8f3826)['then'](function(){return _0x18890e(null,_0x8f3826);});}}}});})[_0x59f4('0x1f')](function(_0x14d216){return _0x18890e(null,![],_0x14d216);});}function sendServiceMail(_0x5ce7c3){return db['MailAccount'][_0x59f4('0x20')]({'where':{'service':!![]},'attributes':['id',_0x59f4('0x11'),_0x59f4('0x21')],'include':[{'model':db[_0x59f4('0x22')],'as':_0x59f4('0x23'),'include':[{'model':db[_0x59f4('0x24')],'as':_0x59f4('0x24')}]}]})['then'](function(_0x518c3d){if(!_0x518c3d){throw new Error(_0x59f4('0x25'));}var _0x758629=_0x518c3d[_0x59f4('0x26')]();var _0x367a40={'account':_0x758629,'message':_[_0x59f4('0x27')]({'from':util[_0x59f4('0x28')](_0x59f4('0x29'),_0x518c3d[_0x59f4('0x11')],_0x518c3d[_0x59f4('0x21')]||_0x518c3d[_0x59f4('0x23')][_0x59f4('0x2a')])},_0x5ce7c3)};return client['request'](_0x59f4('0x2b'),_0x367a40);})['then'](function(_0x10540f){if(_0x10540f['error']){throw new Error(util[_0x59f4('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x10540f[_0x59f4('0x2c')][_0x59f4('0x2d')]||JSON[_0x59f4('0x2e')](_0x10540f[_0x59f4('0x2c')])));}return!![];});}function handleError(_0x1082d0,_0x2012e6,_0x2099b1){return _0x1082d0[_0x59f4('0x2f')](_0x2012e6||0x1f4)[_0x59f4('0x30')]({'message':_0x2099b1?_0x2099b1[_0x59f4('0x2d')]||_0x2099b1:''});}exports[_0x59f4('0x31')]=function(_0x26d283,_0x679408,_0x164f7a){passport['authenticate']('local-login',function(_0x367f10,_0x4ef0e1,_0x410aaa){var _0x5ae607=_0x367f10||_0x410aaa;if(_0x5ae607){return handleError(_0x679408,0x191,_0x5ae607);}if(!_0x4ef0e1){return handleError(_0x679408,0x194,{'message':_0x59f4('0x32')});}else{var _0x44af9f={'payload':{'id':_0x4ef0e1['id'],'role':_0x4ef0e1[_0x59f4('0x33')]},'options':{'expiresIn':0x15180}};return authService[_0x59f4('0x34')](_0x44af9f)[_0x59f4('0x10')](function(_0x40c86f){_0x679408[_0x59f4('0x35')]({'id':_0x4ef0e1['id'],'token':_0x40c86f,'statusCall':'','isAlreadyLogged':_0x4ef0e1[_0x59f4('0x36')]});});}})(_0x26d283,_0x679408,_0x164f7a);};exports['forgot']=function(_0x537319,_0x549950){if(!_0x537319[_0x59f4('0x37')][_0x59f4('0x21')]){return handleError(_0x549950,0x1f4,{'message':_0x59f4('0x38')});}var _0x26012d=rs[_0x59f4('0x39')]();_0x537319['body'][_0x59f4('0x21')]=_0x537319[_0x59f4('0x37')]['email']['trim']()[_0x59f4('0x3a')]();var _0x50a3da;return db[_0x59f4('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x59f4('0xe'),_0x59f4('0xf')],'raw':!![]})[_0x59f4('0x10')](function(_0x514aa7){_0x50a3da=_0x514aa7;return db[_0x59f4('0x3b')]['find']({'where':{'email':_0x537319[_0x59f4('0x37')][_0x59f4('0x21')]}});})[_0x59f4('0x10')](function(_0x25e015){if(!_0x25e015){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x25e015[_0x59f4('0x1c')]){throw new Error(_0x59f4('0x3c'));}if(_0x25e015[_0x59f4('0x13')]){if(moment(_0x25e015[_0x59f4('0x14')])[_0x59f4('0x1d')](_0x50a3da[_0x59f4('0xf')],'minutes')>moment()){throw new Error(_0x59f4('0x3d'));}else{_0x25e015['blocked']=![];_0x25e015[_0x59f4('0x14')]=null;}}_0x25e015[_0x59f4('0x3e')]=_0x26012d;_0x25e015['resetPasswordExpires']=Date[_0x59f4('0x3f')]()+0x36ee80;return _0x25e015[_0x59f4('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x537319[_0x59f4('0x37')][_0x59f4('0x21')],'subject':_0x59f4('0x41'),'text':_0x59f4('0x42')+_0x59f4('0x43')+'https://'+_0x537319[_0x59f4('0x44')][_0x59f4('0x45')]+_0x59f4('0x46')+_0x26012d+'\x0a\x0a'+_0x59f4('0x47')});})[_0x59f4('0x10')](function(){_0x549950[_0x59f4('0x2f')](0xc8)[_0x59f4('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0x59f4('0x1f')](function(_0x12d4b1){return handleError(_0x549950,0x1f4,_0x12d4b1);});};exports[_0x59f4('0x48')]=function(_0x309bb1,_0x384fcb){return db[_0x59f4('0x3b')]['find']({'where':{'resetPasswordToken':_0x309bb1[_0x59f4('0x49')][_0x59f4('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x59f4('0x10')](function(_0x2dfdec){if(!_0x2dfdec){throw new Error(_0x59f4('0x4b'));}return db[_0x59f4('0xc')][_0x59f4('0xd')]({'attributes':['id','securePassword',_0x59f4('0x4c'),'passwordHistoryLimit']})[_0x59f4('0x10')](function(_0x4f904d){if(_0x4f904d[_0x59f4('0x4d')])authService[_0x59f4('0x4e')](_0x309bb1[_0x59f4('0x37')][_0x59f4('0x12')]);if(!_0x4f904d[_0x59f4('0x4c')]||!_0x2dfdec[_0x59f4('0x4f')])return _0x2dfdec;authService[_0x59f4('0x50')](_0x309bb1[_0x59f4('0x37')][_0x59f4('0x12')],_0x2dfdec['previousPasswords'],_0x4f904d['passwordHistoryLimit']);return _0x2dfdec;})[_0x59f4('0x10')](function(){_0x2dfdec[_0x59f4('0x12')]=_0x309bb1[_0x59f4('0x37')][_0x59f4('0x12')];_0x2dfdec[_0x59f4('0x3e')]=null;_0x2dfdec[_0x59f4('0x51')]=null;return _0x2dfdec[_0x59f4('0x40')]();});})[_0x59f4('0x10')](function(){_0x384fcb[_0x59f4('0x2f')](0xc8)['send']({'message':_0x59f4('0x52')});})[_0x59f4('0x1f')](function(_0x2586d4){return handleError(_0x384fcb,0x1f4,_0x2586d4);});};passport[_0x59f4('0x53')]('local-login',new LocalStrategy({'usernameField':_0x59f4('0x11'),'passwordField':'password'},function(_0x18f1ff,_0x5cdf9b,_0x4426ef){return localAuthenticate(db[_0x59f4('0x3b')],_0x18f1ff,_0x5cdf9b,_0x4426ef);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 69106e3..b375385 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 _0x58ea=['exports','post','/forgot','/reset/:token'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x58ea,0x12d));var _0xa58e=function(_0x451347,_0x196f7c){_0x451347=_0x451347-0x0;var _0x1d53a1=_0x58ea[_0x451347];return _0x1d53a1;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0xa58e('0x0')](_0xa58e('0x1'),controller['forgot']);router[_0xa58e('0x0')](_0xa58e('0x2'),controller['reset']);module[_0xa58e('0x3')]=router; \ No newline at end of file +var _0x8622=['./authLocal.controller','login','post','/forgot','forgot','/reset/:token','exports','express'];(function(_0x28a079,_0x2536f3){var _0x38aacd=function(_0x5e8374){while(--_0x5e8374){_0x28a079['push'](_0x28a079['shift']());}};_0x38aacd(++_0x2536f3);}(_0x8622,0x14f));var _0x2862=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8622[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x2862('0x0'));var router=express['Router']();var controller=require(_0x2862('0x1'));router['post']('/',controller[_0x2862('0x2')]);router[_0x2862('0x3')](_0x2862('0x4'),controller[_0x2862('0x5')]);router[_0x2862('0x3')](_0x2862('0x6'),controller['reset']);module[_0x2862('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 50bca9f..3536b87 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 _0x80c1=['sequelize','exports','STRING'];(function(_0x347662,_0x2d97b8){var _0x19b722=function(_0x419573){while(--_0x419573){_0x347662['push'](_0x347662['shift']());}};_0x19b722(++_0x2d97b8);}(_0x80c1,0x1e3));var _0x180c=function(_0x58309a,_0x593226){_0x58309a=_0x58309a-0x0;var _0x598182=_0x80c1[_0x58309a];return _0x598182;};'use strict';var Sequelize=require(_0x180c('0x0'));module[_0x180c('0x1')]={'name':{'type':Sequelize[_0x180c('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x180c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x5631=['sequelize','exports','STRING'];(function(_0x3e5e95,_0x45c08b){var _0x320db0=function(_0x47e5a6){while(--_0x47e5a6){_0x3e5e95['push'](_0x3e5e95['shift']());}};_0x320db0(++_0x45c08b);}(_0x5631,0x114));var _0x1563=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x5631[_0x30cd7e];return _0x462a02;};'use strict';var Sequelize=require(_0x1563('0x0'));module[_0x1563('0x1')]={'name':{'type':Sequelize[_0x1563('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1563('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 4dc0430..2263020 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 _0xca6a=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','filter','Automation','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','Condition','addConditions','ids','omit','findOne','pick','getConditions','addActions','getActions','Action','hasOwnProperty','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0xa25862,_0x27f1a4){var _0x5b9b0a=function(_0x300346){while(--_0x300346){_0xa25862['push'](_0xa25862['shift']());}};_0x5b9b0a(++_0x27f1a4);}(_0xca6a,0x194));var _0xaca6=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xca6a[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaca6('0x0'));var rp=require(_0xaca6('0x1'));var moment=require(_0xaca6('0x2'));var BPromise=require(_0xaca6('0x3'));var Mustache=require(_0xaca6('0x4'));var util=require(_0xaca6('0x5'));var path=require(_0xaca6('0x6'));var sox=require(_0xaca6('0x7'));var csv=require(_0xaca6('0x8'));var ejs=require(_0xaca6('0x9'));var fs=require('fs');var fs_extra=require(_0xaca6('0xa'));var _=require(_0xaca6('0xb'));var squel=require(_0xaca6('0xc'));var crypto=require(_0xaca6('0xd'));var jsforce=require(_0xaca6('0xe'));var deskjs=require(_0xaca6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaca6('0x10'));var Papa=require(_0xaca6('0x11'));var Redis=require('ioredis');var authService=require(_0xaca6('0x12'));var qs=require(_0xaca6('0x13'));var as=require(_0xaca6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xaca6('0x15'));var config=require(_0xaca6('0x16'));var licenseUtil=require(_0xaca6('0x17'));var db=require(_0xaca6('0x18'))['db'];function respondWithStatusCode(_0x375289,_0x3f9cc7){_0x3f9cc7=_0x3f9cc7||0xcc;return function(_0x2a6b18){if(_0x2a6b18){return _0x375289[_0xaca6('0x19')](_0x3f9cc7);}return _0x375289[_0xaca6('0x1a')](_0x3f9cc7)[_0xaca6('0x1b')]();};}function respondWithResult(_0xe45ccc,_0x13666c){_0x13666c=_0x13666c||0xc8;return function(_0x1013ed){if(_0x1013ed){return _0xe45ccc[_0xaca6('0x1a')](_0x13666c)['json'](_0x1013ed);}};}function respondWithFilteredResult(_0x244e5d,_0x4c8ac9){return function(_0x2acf7d){if(_0x2acf7d){var _0x4cc31d=typeof _0x4c8ac9[_0xaca6('0x1c')]==='undefined'&&typeof _0x4c8ac9[_0xaca6('0x1d')]===_0xaca6('0x1e');var _0xc79974=_0x2acf7d['count'];var _0x11dcb3=_0x4cc31d?0x0:_0x4c8ac9[_0xaca6('0x1c')];var _0x18a0ca=_0x4cc31d?_0x2acf7d[_0xaca6('0x1f')]:_0x4c8ac9['offset']+_0x4c8ac9[_0xaca6('0x1d')];var _0x3d74db;if(_0x18a0ca>=_0xc79974){_0x18a0ca=_0xc79974;_0x3d74db=0xc8;}else{_0x3d74db=0xce;}_0x244e5d[_0xaca6('0x1a')](_0x3d74db);return _0x244e5d['set'](_0xaca6('0x20'),_0x11dcb3+'-'+_0x18a0ca+'/'+_0xc79974)['json'](_0x2acf7d);}return null;};}function patchUpdates(_0xac8ea1){return function(_0x21d4bb){try{jsonpatch['apply'](_0x21d4bb,_0xac8ea1,!![]);}catch(_0x2cc5c6){return BPromise[_0xaca6('0x21')](_0x2cc5c6);}return _0x21d4bb[_0xaca6('0x22')]();};}function saveUpdates(_0x22ec0e,_0x463187){return function(_0x40110a){if(_0x40110a){return _0x40110a[_0xaca6('0x23')](_0x22ec0e)[_0xaca6('0x24')](function(_0x56a03a){return _0x56a03a;});}return null;};}function removeEntity(_0x263aa7,_0x337235){return function(_0x5d80e9){if(_0x5d80e9){return _0x5d80e9[_0xaca6('0x25')]()[_0xaca6('0x24')](function(){_0x263aa7['status'](0xcc)[_0xaca6('0x1b')]();});}};}function handleEntityNotFound(_0x3d6133,_0x191a07){return function(_0x3996b2){if(!_0x3996b2){_0x3d6133['sendStatus'](0x194);}return _0x3996b2;};}function handleError(_0x629db,_0x3ff653){_0x3ff653=_0x3ff653||0x1f4;return function(_0x545a62){logger[_0xaca6('0x26')](_0x545a62['stack']);if(_0x545a62[_0xaca6('0x27')]){delete _0x545a62[_0xaca6('0x27')];}_0x629db[_0xaca6('0x1a')](_0x3ff653)[_0xaca6('0x28')](_0x545a62);};}exports[_0xaca6('0x29')]=function(_0x2b99a8,_0x3be9d2){var _0x41ac73={},_0x589e8b={},_0x33dc6f={'count':0x0,'rows':[]};var _0xc70d1=_[_0xaca6('0x2a')](db['Automation']['rawAttributes'],function(_0x10167b){return{'name':_0x10167b[_0xaca6('0x2b')],'type':_0x10167b['type'][_0xaca6('0x2c')]};});_0x589e8b[_0xaca6('0x2d')]=_['map'](_0xc70d1,_0xaca6('0x27'));_0x589e8b[_0xaca6('0x2e')]=_[_0xaca6('0x2f')](_0x2b99a8[_0xaca6('0x2e')]);_0x589e8b[_0xaca6('0x30')]=_[_0xaca6('0x31')](_0x589e8b[_0xaca6('0x2d')],_0x589e8b[_0xaca6('0x2e')]);_0x41ac73[_0xaca6('0x32')]=_[_0xaca6('0x31')](_0x589e8b[_0xaca6('0x2d')],qs[_0xaca6('0x33')](_0x2b99a8[_0xaca6('0x2e')][_0xaca6('0x33')]));_0x41ac73[_0xaca6('0x32')]=_0x41ac73[_0xaca6('0x32')][_0xaca6('0x34')]?_0x41ac73[_0xaca6('0x32')]:_0x589e8b[_0xaca6('0x2d')];if(!_0x2b99a8[_0xaca6('0x2e')]['hasOwnProperty'](_0xaca6('0x35'))){_0x41ac73['limit']=qs[_0xaca6('0x1d')](_0x2b99a8[_0xaca6('0x2e')][_0xaca6('0x1d')]);_0x41ac73[_0xaca6('0x1c')]=qs[_0xaca6('0x1c')](_0x2b99a8[_0xaca6('0x2e')][_0xaca6('0x1c')]);}_0x41ac73[_0xaca6('0x36')]=qs[_0xaca6('0x37')](_0x2b99a8['query'][_0xaca6('0x37')]);_0x41ac73[_0xaca6('0x38')]=qs[_0xaca6('0x30')](_['pick'](_0x2b99a8[_0xaca6('0x2e')],_0x589e8b['filters']),_0xc70d1);if(_0x2b99a8[_0xaca6('0x2e')]['filter']){_0x41ac73['where']=_[_0xaca6('0x39')](_0x41ac73[_0xaca6('0x38')],{'$or':_[_0xaca6('0x2a')](_0xc70d1,function(_0x434e91){if(_0x434e91['type']!=='VIRTUAL'){var _0x4ce815={};_0x4ce815[_0x434e91[_0xaca6('0x27')]]={'$like':'%'+_0x2b99a8[_0xaca6('0x2e')][_0xaca6('0x3a')]+'%'};return _0x4ce815;}})});}_0x41ac73=_['merge']({},_0x41ac73,_0x2b99a8['options']);var _0x56ad87={'where':_0x41ac73[_0xaca6('0x38')]};return db[_0xaca6('0x3b')][_0xaca6('0x1f')](_0x56ad87)['then'](function(_0x4cf499){_0x33dc6f[_0xaca6('0x1f')]=_0x4cf499;if(_0x2b99a8[_0xaca6('0x2e')]['includeAll']){_0x41ac73[_0xaca6('0x3c')]=[{'all':!![]}];}return db[_0xaca6('0x3b')][_0xaca6('0x3d')](_0x41ac73);})['then'](function(_0x380005){_0x33dc6f[_0xaca6('0x3e')]=_0x380005;return _0x33dc6f;})[_0xaca6('0x24')](respondWithFilteredResult(_0x3be9d2,_0x41ac73))[_0xaca6('0x3f')](handleError(_0x3be9d2,null));};exports[_0xaca6('0x40')]=function(_0x58a77f,_0x206a73){var _0x3e3fc8={'raw':![],'where':{'id':_0x58a77f[_0xaca6('0x41')]['id']}},_0x2f0f8f={};_0x2f0f8f[_0xaca6('0x2d')]=_[_0xaca6('0x2f')](db[_0xaca6('0x3b')][_0xaca6('0x42')]);_0x2f0f8f[_0xaca6('0x2e')]=_[_0xaca6('0x2f')](_0x58a77f[_0xaca6('0x2e')]);_0x2f0f8f[_0xaca6('0x30')]=_['intersection'](_0x2f0f8f[_0xaca6('0x2d')],_0x2f0f8f['query']);_0x3e3fc8[_0xaca6('0x32')]=_[_0xaca6('0x31')](_0x2f0f8f[_0xaca6('0x2d')],qs[_0xaca6('0x33')](_0x58a77f[_0xaca6('0x2e')]['fields']));_0x3e3fc8['attributes']=_0x3e3fc8[_0xaca6('0x32')][_0xaca6('0x34')]?_0x3e3fc8[_0xaca6('0x32')]:_0x2f0f8f[_0xaca6('0x2d')];if(_0x58a77f[_0xaca6('0x2e')][_0xaca6('0x43')]){_0x3e3fc8[_0xaca6('0x3c')]=[{'all':!![]}];}_0x3e3fc8=_['merge']({},_0x3e3fc8,_0x58a77f[_0xaca6('0x44')]);return db[_0xaca6('0x3b')][_0xaca6('0x45')](_0x3e3fc8)[_0xaca6('0x24')](handleEntityNotFound(_0x206a73,null))[_0xaca6('0x24')](respondWithResult(_0x206a73,null))[_0xaca6('0x3f')](handleError(_0x206a73,null));};exports[_0xaca6('0x46')]=function(_0xe54ef4,_0x44dda2){return db[_0xaca6('0x3b')][_0xaca6('0x46')](_0xe54ef4[_0xaca6('0x47')],{})['then'](respondWithResult(_0x44dda2,0xc9))['catch'](handleError(_0x44dda2,null));};exports['update']=function(_0x54a1e2,_0x1a9728){if(_0x54a1e2['body']['id']){delete _0x54a1e2[_0xaca6('0x47')]['id'];}return db[_0xaca6('0x3b')][_0xaca6('0x45')]({'where':{'id':_0x54a1e2['params']['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x1a9728,null))[_0xaca6('0x24')](saveUpdates(_0x54a1e2[_0xaca6('0x47')],null))[_0xaca6('0x24')](respondWithResult(_0x1a9728,null))[_0xaca6('0x3f')](handleError(_0x1a9728,null));};exports['destroy']=function(_0x318422,_0x46d0fb){return db[_0xaca6('0x3b')][_0xaca6('0x45')]({'where':{'id':_0x318422[_0xaca6('0x41')]['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x46d0fb,null))[_0xaca6('0x24')](removeEntity(_0x46d0fb,null))[_0xaca6('0x3f')](handleError(_0x46d0fb,null));};exports['addConditions']=function(_0x357313,_0x3ff5d3,_0x269751){return db[_0xaca6('0x48')]['find']({'where':{'id':_0x357313[_0xaca6('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ff5d3,null))[_0xaca6('0x24')](function(_0x35ff2c){if(_0x35ff2c){return _0x35ff2c[_0xaca6('0x49')](_0x357313['body'][_0xaca6('0x4a')],_[_0xaca6('0x4b')](_0x357313[_0xaca6('0x47')],[_0xaca6('0x4a'),'id'])||{});}})[_0xaca6('0x24')](respondWithResult(_0x3ff5d3,null))[_0xaca6('0x3f')](handleError(_0x3ff5d3,null));};exports['getConditions']=function(_0x4269ce,_0x118c9b,_0x1a6fac){var _0x4eb01b={};var _0x3c575c={};var _0xe1a5b4;var _0x2f3f08;return db[_0xaca6('0x3b')][_0xaca6('0x4c')]({'where':{'id':_0x4269ce[_0xaca6('0x41')]['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x118c9b,null))[_0xaca6('0x24')](function(_0x3cada7){if(_0x3cada7){_0xe1a5b4=_0x3cada7;_0x3c575c['model']=_['keys'](db[_0xaca6('0x48')][_0xaca6('0x42')]);_0x3c575c[_0xaca6('0x2e')]=_['keys'](_0x4269ce[_0xaca6('0x2e')]);_0x3c575c[_0xaca6('0x30')]=_[_0xaca6('0x31')](_0x3c575c[_0xaca6('0x2d')],_0x3c575c[_0xaca6('0x2e')]);_0x4eb01b[_0xaca6('0x32')]=_['intersection'](_0x3c575c[_0xaca6('0x2d')],qs[_0xaca6('0x33')](_0x4269ce[_0xaca6('0x2e')][_0xaca6('0x33')]));_0x4eb01b[_0xaca6('0x32')]=_0x4eb01b[_0xaca6('0x32')][_0xaca6('0x34')]?_0x4eb01b[_0xaca6('0x32')]:_0x3c575c[_0xaca6('0x2d')];_0x4eb01b[_0xaca6('0x36')]=qs[_0xaca6('0x37')](_0x4269ce['query'][_0xaca6('0x37')]);_0x4eb01b['where']=qs[_0xaca6('0x30')](_[_0xaca6('0x4d')](_0x4269ce[_0xaca6('0x2e')],_0x3c575c[_0xaca6('0x30')]));if(_0x4269ce[_0xaca6('0x2e')]['filter']){_0x4eb01b['where']=_[_0xaca6('0x39')](_0x4eb01b['where'],{'$or':_[_0xaca6('0x2a')](_0x4eb01b['attributes'],function(_0x1e9026){var _0x231628={};_0x231628[_0x1e9026]={'$like':'%'+_0x4269ce[_0xaca6('0x2e')]['filter']+'%'};return _0x231628;})});}_0x4eb01b=_[_0xaca6('0x39')]({},_0x4eb01b,_0x4269ce[_0xaca6('0x44')]);return _0xe1a5b4['getConditions'](_0x4eb01b);}})[_0xaca6('0x24')](function(_0x3d6691){if(_0x3d6691){_0x2f3f08=_0x3d6691[_0xaca6('0x34')];if(!_0x4269ce[_0xaca6('0x2e')]['hasOwnProperty'](_0xaca6('0x35'))){_0x4eb01b['limit']=qs[_0xaca6('0x1d')](_0x4269ce['query'][_0xaca6('0x1d')]);_0x4eb01b['offset']=qs[_0xaca6('0x1c')](_0x4269ce[_0xaca6('0x2e')][_0xaca6('0x1c')]);}return _0xe1a5b4[_0xaca6('0x4e')](_0x4eb01b);}})[_0xaca6('0x24')](function(_0x43353c){if(_0x43353c){return _0x43353c?{'count':_0x2f3f08,'rows':_0x43353c}:null;}})[_0xaca6('0x24')](respondWithResult(_0x118c9b,null))[_0xaca6('0x3f')](handleError(_0x118c9b,null));};exports[_0xaca6('0x4f')]=function(_0x5169f5,_0x5ccbd7,_0x88df54){return db['Action'][_0xaca6('0x45')]({'where':{'id':_0x5169f5[_0xaca6('0x41')]['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x5ccbd7,null))[_0xaca6('0x24')](function(_0x2b0382){if(_0x2b0382){return _0x2b0382[_0xaca6('0x4f')](_0x5169f5[_0xaca6('0x47')][_0xaca6('0x4a')],_['omit'](_0x5169f5[_0xaca6('0x47')],['ids','id'])||{});}})[_0xaca6('0x24')](respondWithResult(_0x5ccbd7,null))['catch'](handleError(_0x5ccbd7,null));};exports[_0xaca6('0x50')]=function(_0x5edd39,_0x69645a,_0x13aca3){var _0x17d6b0={};var _0x30add2={};var _0x1a417e;var _0x5a0180;return db['Automation'][_0xaca6('0x4c')]({'where':{'id':_0x5edd39[_0xaca6('0x41')]['id']}})[_0xaca6('0x24')](handleEntityNotFound(_0x69645a,null))[_0xaca6('0x24')](function(_0x5a3362){if(_0x5a3362){_0x1a417e=_0x5a3362;_0x30add2[_0xaca6('0x2d')]=_[_0xaca6('0x2f')](db[_0xaca6('0x51')][_0xaca6('0x42')]);_0x30add2['query']=_['keys'](_0x5edd39[_0xaca6('0x2e')]);_0x30add2[_0xaca6('0x30')]=_['intersection'](_0x30add2['model'],_0x30add2[_0xaca6('0x2e')]);_0x17d6b0[_0xaca6('0x32')]=_[_0xaca6('0x31')](_0x30add2[_0xaca6('0x2d')],qs[_0xaca6('0x33')](_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x33')]));_0x17d6b0[_0xaca6('0x32')]=_0x17d6b0[_0xaca6('0x32')][_0xaca6('0x34')]?_0x17d6b0['attributes']:_0x30add2[_0xaca6('0x2d')];_0x17d6b0['order']=qs[_0xaca6('0x37')](_0x5edd39['query'][_0xaca6('0x37')]);_0x17d6b0[_0xaca6('0x38')]=qs['filters'](_[_0xaca6('0x4d')](_0x5edd39[_0xaca6('0x2e')],_0x30add2[_0xaca6('0x30')]));if(_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x3a')]){_0x17d6b0[_0xaca6('0x38')]=_[_0xaca6('0x39')](_0x17d6b0[_0xaca6('0x38')],{'$or':_['map'](_0x17d6b0[_0xaca6('0x32')],function(_0x263916){var _0x474300={};_0x474300[_0x263916]={'$like':'%'+_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x3a')]+'%'};return _0x474300;})});}_0x17d6b0=_['merge']({},_0x17d6b0,_0x5edd39[_0xaca6('0x44')]);return _0x1a417e[_0xaca6('0x50')](_0x17d6b0);}})[_0xaca6('0x24')](function(_0x2a238f){if(_0x2a238f){_0x5a0180=_0x2a238f['length'];if(!_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x52')](_0xaca6('0x35'))){_0x17d6b0['limit']=qs[_0xaca6('0x1d')](_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x1d')]);_0x17d6b0[_0xaca6('0x1c')]=qs['offset'](_0x5edd39[_0xaca6('0x2e')][_0xaca6('0x1c')]);}return _0x1a417e[_0xaca6('0x50')](_0x17d6b0);}})['then'](function(_0x5e01db){if(_0x5e01db){return _0x5e01db?{'count':_0x5a0180,'rows':_0x5e01db}:null;}})['then'](respondWithResult(_0x69645a,null))[_0xaca6('0x3f')](handleError(_0x69645a,null));}; \ No newline at end of file +var _0xae58=['intersection','attributes','fields','length','nolimit','sort','where','filters','merge','VIRTUAL','options','findAll','params','include','find','catch','create','body','update','addConditions','Condition','ids','omit','findOne','order','pick','filter','hasOwnProperty','getConditions','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xae58,0x1bf));var _0x8ae5=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xae58[_0x2dd390];return _0x3afe47;};'use strict';var emlformat=require(_0x8ae5('0x0'));var rimraf=require(_0x8ae5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ae5('0x2'));var rp=require(_0x8ae5('0x3'));var moment=require('moment');var BPromise=require(_0x8ae5('0x4'));var Mustache=require(_0x8ae5('0x5'));var util=require(_0x8ae5('0x6'));var path=require(_0x8ae5('0x7'));var sox=require(_0x8ae5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ae5('0x9'));var squel=require('squel');var crypto=require(_0x8ae5('0xa'));var jsforce=require(_0x8ae5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8ae5('0xc'));var querystring=require(_0x8ae5('0xd'));var Papa=require(_0x8ae5('0xe'));var Redis=require(_0x8ae5('0xf'));var authService=require(_0x8ae5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ae5('0x11'));var hardwareService=require(_0x8ae5('0x12'));var logger=require(_0x8ae5('0x13'))('api');var utils=require(_0x8ae5('0x14'));var config=require(_0x8ae5('0x15'));var licenseUtil=require(_0x8ae5('0x16'));var db=require(_0x8ae5('0x17'))['db'];function respondWithStatusCode(_0x3f3745,_0x494d4c){_0x494d4c=_0x494d4c||0xcc;return function(_0x2017e5){if(_0x2017e5){return _0x3f3745[_0x8ae5('0x18')](_0x494d4c);}return _0x3f3745[_0x8ae5('0x19')](_0x494d4c)['end']();};}function respondWithResult(_0x53ec57,_0x44939d){_0x44939d=_0x44939d||0xc8;return function(_0x327fcd){if(_0x327fcd){return _0x53ec57[_0x8ae5('0x19')](_0x44939d)[_0x8ae5('0x1a')](_0x327fcd);}};}function respondWithFilteredResult(_0x26f434,_0x4d5f6a){return function(_0x5af92f){if(_0x5af92f){var _0xcfa5d=typeof _0x4d5f6a[_0x8ae5('0x1b')]===_0x8ae5('0x1c')&&typeof _0x4d5f6a[_0x8ae5('0x1d')]===_0x8ae5('0x1c');var _0x391808=_0x5af92f[_0x8ae5('0x1e')];var _0x33b592=_0xcfa5d?0x0:_0x4d5f6a['offset'];var _0x1c927e=_0xcfa5d?_0x5af92f[_0x8ae5('0x1e')]:_0x4d5f6a['offset']+_0x4d5f6a[_0x8ae5('0x1d')];var _0xaa10f;if(_0x1c927e>=_0x391808){_0x1c927e=_0x391808;_0xaa10f=0xc8;}else{_0xaa10f=0xce;}_0x26f434['status'](_0xaa10f);return _0x26f434[_0x8ae5('0x1f')](_0x8ae5('0x20'),_0x33b592+'-'+_0x1c927e+'/'+_0x391808)[_0x8ae5('0x1a')](_0x5af92f);}return null;};}function patchUpdates(_0x42867d){return function(_0x235e88){try{jsonpatch[_0x8ae5('0x21')](_0x235e88,_0x42867d,!![]);}catch(_0x4a2ca0){return BPromise[_0x8ae5('0x22')](_0x4a2ca0);}return _0x235e88['save']();};}function saveUpdates(_0x3736e0,_0x18545f){return function(_0x5bbebe){if(_0x5bbebe){return _0x5bbebe['update'](_0x3736e0)[_0x8ae5('0x23')](function(_0x2e00d4){return _0x2e00d4;});}return null;};}function removeEntity(_0x51ce71,_0xb285c2){return function(_0x443f94){if(_0x443f94){return _0x443f94[_0x8ae5('0x24')]()['then'](function(){_0x51ce71[_0x8ae5('0x19')](0xcc)[_0x8ae5('0x25')]();});}};}function handleEntityNotFound(_0x29904b,_0x1397e6){return function(_0x35b269){if(!_0x35b269){_0x29904b['sendStatus'](0x194);}return _0x35b269;};}function handleError(_0x3ada9a,_0x4a5fd6){_0x4a5fd6=_0x4a5fd6||0x1f4;return function(_0x46b380){logger[_0x8ae5('0x26')](_0x46b380['stack']);if(_0x46b380['name']){delete _0x46b380[_0x8ae5('0x27')];}_0x3ada9a[_0x8ae5('0x19')](_0x4a5fd6)[_0x8ae5('0x28')](_0x46b380);};}exports[_0x8ae5('0x29')]=function(_0x12b408,_0x2dfedc){var _0x29d1aa={},_0x4a4ae5={},_0x22fda8={'count':0x0,'rows':[]};var _0x33ca9e=_[_0x8ae5('0x2a')](db[_0x8ae5('0x2b')][_0x8ae5('0x2c')],function(_0x48328d){return{'name':_0x48328d[_0x8ae5('0x2d')],'type':_0x48328d[_0x8ae5('0x2e')][_0x8ae5('0x2f')]};});_0x4a4ae5[_0x8ae5('0x30')]=_['map'](_0x33ca9e,_0x8ae5('0x27'));_0x4a4ae5[_0x8ae5('0x31')]=_[_0x8ae5('0x32')](_0x12b408['query']);_0x4a4ae5['filters']=_[_0x8ae5('0x33')](_0x4a4ae5['model'],_0x4a4ae5['query']);_0x29d1aa[_0x8ae5('0x34')]=_['intersection'](_0x4a4ae5[_0x8ae5('0x30')],qs[_0x8ae5('0x35')](_0x12b408[_0x8ae5('0x31')]['fields']));_0x29d1aa[_0x8ae5('0x34')]=_0x29d1aa[_0x8ae5('0x34')][_0x8ae5('0x36')]?_0x29d1aa[_0x8ae5('0x34')]:_0x4a4ae5[_0x8ae5('0x30')];if(!_0x12b408[_0x8ae5('0x31')]['hasOwnProperty'](_0x8ae5('0x37'))){_0x29d1aa['limit']=qs[_0x8ae5('0x1d')](_0x12b408[_0x8ae5('0x31')][_0x8ae5('0x1d')]);_0x29d1aa[_0x8ae5('0x1b')]=qs['offset'](_0x12b408[_0x8ae5('0x31')]['offset']);}_0x29d1aa['order']=qs['sort'](_0x12b408[_0x8ae5('0x31')][_0x8ae5('0x38')]);_0x29d1aa[_0x8ae5('0x39')]=qs[_0x8ae5('0x3a')](_['pick'](_0x12b408[_0x8ae5('0x31')],_0x4a4ae5[_0x8ae5('0x3a')]),_0x33ca9e);if(_0x12b408['query']['filter']){_0x29d1aa[_0x8ae5('0x39')]=_[_0x8ae5('0x3b')](_0x29d1aa[_0x8ae5('0x39')],{'$or':_['map'](_0x33ca9e,function(_0x233339){if(_0x233339['type']!==_0x8ae5('0x3c')){var _0x22b821={};_0x22b821[_0x233339[_0x8ae5('0x27')]]={'$like':'%'+_0x12b408[_0x8ae5('0x31')]['filter']+'%'};return _0x22b821;}})});}_0x29d1aa=_['merge']({},_0x29d1aa,_0x12b408[_0x8ae5('0x3d')]);var _0x9dcc14={'where':_0x29d1aa[_0x8ae5('0x39')]};return db[_0x8ae5('0x2b')]['count'](_0x9dcc14)[_0x8ae5('0x23')](function(_0x351005){_0x22fda8[_0x8ae5('0x1e')]=_0x351005;if(_0x12b408[_0x8ae5('0x31')]['includeAll']){_0x29d1aa['include']=[{'all':!![]}];}return db['Automation'][_0x8ae5('0x3e')](_0x29d1aa);})['then'](function(_0x4d3424){_0x22fda8['rows']=_0x4d3424;return _0x22fda8;})[_0x8ae5('0x23')](respondWithFilteredResult(_0x2dfedc,_0x29d1aa))['catch'](handleError(_0x2dfedc,null));};exports['show']=function(_0x55e92a,_0x1a9dac){var _0x1b41ad={'raw':![],'where':{'id':_0x55e92a[_0x8ae5('0x3f')]['id']}},_0x28ecba={};_0x28ecba[_0x8ae5('0x30')]=_['keys'](db[_0x8ae5('0x2b')][_0x8ae5('0x2c')]);_0x28ecba['query']=_[_0x8ae5('0x32')](_0x55e92a[_0x8ae5('0x31')]);_0x28ecba[_0x8ae5('0x3a')]=_[_0x8ae5('0x33')](_0x28ecba[_0x8ae5('0x30')],_0x28ecba[_0x8ae5('0x31')]);_0x1b41ad[_0x8ae5('0x34')]=_['intersection'](_0x28ecba[_0x8ae5('0x30')],qs[_0x8ae5('0x35')](_0x55e92a[_0x8ae5('0x31')][_0x8ae5('0x35')]));_0x1b41ad[_0x8ae5('0x34')]=_0x1b41ad[_0x8ae5('0x34')][_0x8ae5('0x36')]?_0x1b41ad[_0x8ae5('0x34')]:_0x28ecba[_0x8ae5('0x30')];if(_0x55e92a['query']['includeAll']){_0x1b41ad[_0x8ae5('0x40')]=[{'all':!![]}];}_0x1b41ad=_[_0x8ae5('0x3b')]({},_0x1b41ad,_0x55e92a[_0x8ae5('0x3d')]);return db[_0x8ae5('0x2b')][_0x8ae5('0x41')](_0x1b41ad)[_0x8ae5('0x23')](handleEntityNotFound(_0x1a9dac,null))['then'](respondWithResult(_0x1a9dac,null))[_0x8ae5('0x42')](handleError(_0x1a9dac,null));};exports[_0x8ae5('0x43')]=function(_0x5b4dbe,_0x4e2616){return db[_0x8ae5('0x2b')][_0x8ae5('0x43')](_0x5b4dbe[_0x8ae5('0x44')],{})[_0x8ae5('0x23')](respondWithResult(_0x4e2616,0xc9))[_0x8ae5('0x42')](handleError(_0x4e2616,null));};exports[_0x8ae5('0x45')]=function(_0x4bd649,_0x5d1502){if(_0x4bd649['body']['id']){delete _0x4bd649['body']['id'];}return db['Automation']['find']({'where':{'id':_0x4bd649[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x5d1502,null))[_0x8ae5('0x23')](saveUpdates(_0x4bd649[_0x8ae5('0x44')],null))[_0x8ae5('0x23')](respondWithResult(_0x5d1502,null))['catch'](handleError(_0x5d1502,null));};exports[_0x8ae5('0x24')]=function(_0x258348,_0x388185){return db[_0x8ae5('0x2b')][_0x8ae5('0x41')]({'where':{'id':_0x258348[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x388185,null))[_0x8ae5('0x23')](removeEntity(_0x388185,null))[_0x8ae5('0x42')](handleError(_0x388185,null));};exports[_0x8ae5('0x46')]=function(_0x5a3530,_0x26ff87,_0x59b7c0){return db[_0x8ae5('0x47')][_0x8ae5('0x41')]({'where':{'id':_0x5a3530[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x26ff87,null))['then'](function(_0x4b06f4){if(_0x4b06f4){return _0x4b06f4[_0x8ae5('0x46')](_0x5a3530[_0x8ae5('0x44')][_0x8ae5('0x48')],_[_0x8ae5('0x49')](_0x5a3530[_0x8ae5('0x44')],[_0x8ae5('0x48'),'id'])||{});}})[_0x8ae5('0x23')](respondWithResult(_0x26ff87,null))[_0x8ae5('0x42')](handleError(_0x26ff87,null));};exports['getConditions']=function(_0x5637d4,_0x4357d8,_0x4923e1){var _0x182941={};var _0x255783={};var _0x2a2007;var _0x4d5ee1;return db['Automation'][_0x8ae5('0x4a')]({'where':{'id':_0x5637d4[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x4357d8,null))[_0x8ae5('0x23')](function(_0x2a96b1){if(_0x2a96b1){_0x2a2007=_0x2a96b1;_0x255783[_0x8ae5('0x30')]=_[_0x8ae5('0x32')](db[_0x8ae5('0x47')][_0x8ae5('0x2c')]);_0x255783[_0x8ae5('0x31')]=_['keys'](_0x5637d4[_0x8ae5('0x31')]);_0x255783[_0x8ae5('0x3a')]=_[_0x8ae5('0x33')](_0x255783['model'],_0x255783[_0x8ae5('0x31')]);_0x182941[_0x8ae5('0x34')]=_[_0x8ae5('0x33')](_0x255783['model'],qs['fields'](_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x35')]));_0x182941[_0x8ae5('0x34')]=_0x182941[_0x8ae5('0x34')][_0x8ae5('0x36')]?_0x182941['attributes']:_0x255783['model'];_0x182941[_0x8ae5('0x4b')]=qs['sort'](_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x38')]);_0x182941[_0x8ae5('0x39')]=qs[_0x8ae5('0x3a')](_[_0x8ae5('0x4c')](_0x5637d4[_0x8ae5('0x31')],_0x255783[_0x8ae5('0x3a')]));if(_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x4d')]){_0x182941['where']=_['merge'](_0x182941['where'],{'$or':_['map'](_0x182941[_0x8ae5('0x34')],function(_0x3cce89){var _0x52c28e={};_0x52c28e[_0x3cce89]={'$like':'%'+_0x5637d4['query'][_0x8ae5('0x4d')]+'%'};return _0x52c28e;})});}_0x182941=_[_0x8ae5('0x3b')]({},_0x182941,_0x5637d4[_0x8ae5('0x3d')]);return _0x2a2007['getConditions'](_0x182941);}})['then'](function(_0x303afb){if(_0x303afb){_0x4d5ee1=_0x303afb[_0x8ae5('0x36')];if(!_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x4e')](_0x8ae5('0x37'))){_0x182941[_0x8ae5('0x1d')]=qs['limit'](_0x5637d4[_0x8ae5('0x31')][_0x8ae5('0x1d')]);_0x182941[_0x8ae5('0x1b')]=qs[_0x8ae5('0x1b')](_0x5637d4['query'][_0x8ae5('0x1b')]);}return _0x2a2007[_0x8ae5('0x4f')](_0x182941);}})['then'](function(_0x225b9d){if(_0x225b9d){return _0x225b9d?{'count':_0x4d5ee1,'rows':_0x225b9d}:null;}})['then'](respondWithResult(_0x4357d8,null))[_0x8ae5('0x42')](handleError(_0x4357d8,null));};exports[_0x8ae5('0x50')]=function(_0x34c5e8,_0x34b0b5,_0x45fff4){return db[_0x8ae5('0x51')]['find']({'where':{'id':_0x34c5e8[_0x8ae5('0x3f')]['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x34b0b5,null))[_0x8ae5('0x23')](function(_0x4e5569){if(_0x4e5569){return _0x4e5569[_0x8ae5('0x50')](_0x34c5e8[_0x8ae5('0x44')][_0x8ae5('0x48')],_[_0x8ae5('0x49')](_0x34c5e8[_0x8ae5('0x44')],[_0x8ae5('0x48'),'id'])||{});}})[_0x8ae5('0x23')](respondWithResult(_0x34b0b5,null))[_0x8ae5('0x42')](handleError(_0x34b0b5,null));};exports[_0x8ae5('0x52')]=function(_0x136480,_0x398a09,_0x467d0d){var _0x5f3644={};var _0x157470={};var _0x2c7526;var _0x30ca2a;return db[_0x8ae5('0x2b')][_0x8ae5('0x4a')]({'where':{'id':_0x136480['params']['id']}})[_0x8ae5('0x23')](handleEntityNotFound(_0x398a09,null))['then'](function(_0x10433b){if(_0x10433b){_0x2c7526=_0x10433b;_0x157470[_0x8ae5('0x30')]=_[_0x8ae5('0x32')](db['Action'][_0x8ae5('0x2c')]);_0x157470[_0x8ae5('0x31')]=_[_0x8ae5('0x32')](_0x136480[_0x8ae5('0x31')]);_0x157470[_0x8ae5('0x3a')]=_['intersection'](_0x157470[_0x8ae5('0x30')],_0x157470[_0x8ae5('0x31')]);_0x5f3644[_0x8ae5('0x34')]=_[_0x8ae5('0x33')](_0x157470[_0x8ae5('0x30')],qs[_0x8ae5('0x35')](_0x136480[_0x8ae5('0x31')]['fields']));_0x5f3644['attributes']=_0x5f3644[_0x8ae5('0x34')]['length']?_0x5f3644[_0x8ae5('0x34')]:_0x157470['model'];_0x5f3644[_0x8ae5('0x4b')]=qs[_0x8ae5('0x38')](_0x136480[_0x8ae5('0x31')][_0x8ae5('0x38')]);_0x5f3644[_0x8ae5('0x39')]=qs[_0x8ae5('0x3a')](_[_0x8ae5('0x4c')](_0x136480['query'],_0x157470[_0x8ae5('0x3a')]));if(_0x136480[_0x8ae5('0x31')][_0x8ae5('0x4d')]){_0x5f3644[_0x8ae5('0x39')]=_['merge'](_0x5f3644[_0x8ae5('0x39')],{'$or':_[_0x8ae5('0x2a')](_0x5f3644['attributes'],function(_0x150a49){var _0x2bc910={};_0x2bc910[_0x150a49]={'$like':'%'+_0x136480['query'][_0x8ae5('0x4d')]+'%'};return _0x2bc910;})});}_0x5f3644=_[_0x8ae5('0x3b')]({},_0x5f3644,_0x136480[_0x8ae5('0x3d')]);return _0x2c7526[_0x8ae5('0x52')](_0x5f3644);}})[_0x8ae5('0x23')](function(_0x4f5120){if(_0x4f5120){_0x30ca2a=_0x4f5120['length'];if(!_0x136480['query'][_0x8ae5('0x4e')](_0x8ae5('0x37'))){_0x5f3644['limit']=qs[_0x8ae5('0x1d')](_0x136480[_0x8ae5('0x31')]['limit']);_0x5f3644[_0x8ae5('0x1b')]=qs['offset'](_0x136480[_0x8ae5('0x31')][_0x8ae5('0x1b')]);}return _0x2c7526['getActions'](_0x5f3644);}})[_0x8ae5('0x23')](function(_0x15c981){if(_0x15c981){return _0x15c981?{'count':_0x30ca2a,'rows':_0x15c981}:null;}})[_0x8ae5('0x23')](respondWithResult(_0x398a09,null))[_0x8ae5('0x42')](handleError(_0x398a09,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index e01288d..5ef236b 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 _0x26a1=['../../config/environment','./automation.attributes','define','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x26a1,0xf6));var _0x126a=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x26a1[_0x1d9aa0];return _0x226868;};'use strict';var _=require('lodash');var util=require(_0x126a('0x0'));var logger=require(_0x126a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x126a('0x2'));var rp=require(_0x126a('0x3'));var fs=require('fs');var path=require(_0x126a('0x4'));var rimraf=require(_0x126a('0x5'));var config=require(_0x126a('0x6'));var attributes=require(_0x126a('0x7'));module['exports']=function(_0x18c0c3,_0x1f279d){return _0x18c0c3[_0x126a('0x8')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88b4=['api','bluebird','request-promise','rimraf','../../config/environment','Automation','lodash','../../config/logger'];(function(_0x3d4ada,_0x726df2){var _0x220e63=function(_0x1e959e){while(--_0x1e959e){_0x3d4ada['push'](_0x3d4ada['shift']());}};_0x220e63(++_0x726df2);}(_0x88b4,0x6e));var _0x488b=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x88b4[_0x16938f];return _0x5c66e9;};'use strict';var _=require(_0x488b('0x0'));var util=require('util');var logger=require(_0x488b('0x1'))(_0x488b('0x2'));var moment=require('moment');var BPromise=require(_0x488b('0x3'));var rp=require(_0x488b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x488b('0x5'));var config=require(_0x488b('0x6'));var attributes=require('./automation.attributes');module['exports']=function(_0xf14419,_0x4e0559){return _0xf14419['define'](_0x488b('0x7'),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 856e97d..08a3260 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 _0x1e82=['Automation,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x70b86,_0x11358c){var _0x45953b=function(_0x436304){while(--_0x436304){_0x70b86['push'](_0x70b86['shift']());}};_0x45953b(++_0x11358c);}(_0x1e82,0x8b));var _0x21e8=function(_0x687fa6,_0x2ccb8a){_0x687fa6=_0x687fa6-0x0;var _0x2d07e2=_0x1e82[_0x687fa6];return _0x2d07e2;};'use strict';var _=require(_0x21e8('0x0'));var util=require(_0x21e8('0x1'));var moment=require(_0x21e8('0x2'));var BPromise=require(_0x21e8('0x3'));var rs=require(_0x21e8('0x4'));var fs=require('fs');var Redis=require(_0x21e8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x21e8('0x6'));var logger=require(_0x21e8('0x7'))('rpc');var config=require(_0x21e8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x21e8('0x9')][_0x21e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38c3d0,_0x22cbd4,_0x47b3b3){return new BPromise(function(_0x45e5c1,_0x3754c9){return client[_0x21e8('0xb')](_0x38c3d0,_0x47b3b3)['then'](function(_0x31b6c2){logger[_0x21e8('0xc')](_0x21e8('0xd'),_0x22cbd4,_0x21e8('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x22cbd4,_0x21e8('0xe'),JSON['stringify'](_0x31b6c2));if(_0x31b6c2[_0x21e8('0xf')]){if(_0x31b6c2[_0x21e8('0xf')]['code']===0x1f4){logger[_0x21e8('0xf')]('Automation,\x20%s,\x20%s',_0x22cbd4,_0x31b6c2[_0x21e8('0xf')][_0x21e8('0x10')]);return _0x3754c9(_0x31b6c2[_0x21e8('0xf')]['message']);}logger[_0x21e8('0xf')]('Automation,\x20%s,\x20%s',_0x22cbd4,_0x31b6c2[_0x21e8('0xf')][_0x21e8('0x10')]);return _0x45e5c1(_0x31b6c2[_0x21e8('0xf')]['message']);}else{logger['info'](_0x21e8('0xd'),_0x22cbd4,_0x21e8('0xe'));_0x45e5c1(_0x31b6c2[_0x21e8('0x11')][_0x21e8('0x10')]);}})[_0x21e8('0x12')](function(_0x13da4f){logger[_0x21e8('0xf')](_0x21e8('0xd'),_0x22cbd4,_0x13da4f);_0x3754c9(_0x13da4f);});});} \ No newline at end of file +var _0x4201=['debug','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','request\x20sent'];(function(_0xe655f4,_0x363d23){var _0x2702b2=function(_0x3c2f7f){while(--_0x3c2f7f){_0xe655f4['push'](_0xe655f4['shift']());}};_0x2702b2(++_0x363d23);}(_0x4201,0x71));var _0x1420=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x4201[_0x319cb9];return _0x1735fc;};'use strict';var _=require(_0x1420('0x0'));var util=require(_0x1420('0x1'));var moment=require('moment');var BPromise=require(_0x1420('0x2'));var rs=require(_0x1420('0x3'));var fs=require('fs');var Redis=require(_0x1420('0x4'));var db=require(_0x1420('0x5'))['db'];var utils=require(_0x1420('0x6'));var logger=require(_0x1420('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1420('0x8'));var client=jayson[_0x1420('0x9')][_0x1420('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a8ba,_0x239e16,_0x59ddc5){return new BPromise(function(_0x5a925c,_0x46d303){return client[_0x1420('0xb')](_0x35a8ba,_0x59ddc5)['then'](function(_0x1d52ff){logger['info']('Automation,\x20%s,\x20%s',_0x239e16,_0x1420('0xc'));logger[_0x1420('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x239e16,_0x1420('0xc'),JSON[_0x1420('0xe')](_0x1d52ff));if(_0x1d52ff[_0x1420('0xf')]){if(_0x1d52ff[_0x1420('0xf')][_0x1420('0x10')]===0x1f4){logger[_0x1420('0xf')](_0x1420('0x11'),_0x239e16,_0x1d52ff[_0x1420('0xf')]['message']);return _0x46d303(_0x1d52ff['error']['message']);}logger['error'](_0x1420('0x11'),_0x239e16,_0x1d52ff[_0x1420('0xf')][_0x1420('0x12')]);return _0x5a925c(_0x1d52ff[_0x1420('0xf')][_0x1420('0x12')]);}else{logger[_0x1420('0x13')]('Automation,\x20%s,\x20%s',_0x239e16,'request\x20sent');_0x5a925c(_0x1d52ff[_0x1420('0x14')]['message']);}})['catch'](function(_0x231659){logger[_0x1420('0xf')](_0x1420('0x11'),_0x239e16,_0x231659);_0x46d303(_0x231659);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index ee75b64..1c06cd7 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 _0xa9bb=['/:id','show','/:id/conditions','getActions','post','create','addConditions','addActions','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xa9bb,0x1bc));var _0xba9b=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xa9bb[_0x176329];return _0x31997c;};'use strict';var multer=require('multer');var util=require(_0xba9b('0x0'));var path=require(_0xba9b('0x1'));var timeout=require(_0xba9b('0x2'));var express=require(_0xba9b('0x3'));var router=express[_0xba9b('0x4')]();var fs_extra=require(_0xba9b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xba9b('0x6'));var config=require(_0xba9b('0x7'));var controller=require(_0xba9b('0x8'));router[_0xba9b('0x9')]('/',auth[_0xba9b('0xa')](),controller[_0xba9b('0xb')]);router[_0xba9b('0x9')](_0xba9b('0xc'),auth[_0xba9b('0xa')](),controller[_0xba9b('0xd')]);router[_0xba9b('0x9')](_0xba9b('0xe'),auth[_0xba9b('0xa')](),controller['getConditions']);router[_0xba9b('0x9')]('/:id/actions',auth[_0xba9b('0xa')](),controller[_0xba9b('0xf')]);router[_0xba9b('0x10')]('/',auth[_0xba9b('0xa')](),controller[_0xba9b('0x11')]);router[_0xba9b('0x10')](_0xba9b('0xe'),auth[_0xba9b('0xa')](),controller[_0xba9b('0x12')]);router['post']('/:id/actions',auth[_0xba9b('0xa')](),controller[_0xba9b('0x13')]);router['put']('/:id',auth[_0xba9b('0xa')](),controller[_0xba9b('0x14')]);router[_0xba9b('0x15')]('/:id',auth[_0xba9b('0xa')](),controller[_0xba9b('0x16')]);module[_0xba9b('0x17')]=router; \ No newline at end of file +var _0xa101=['../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addActions','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5bf332,_0x178189){var _0x492a7e=function(_0x5c176e){while(--_0x5c176e){_0x5bf332['push'](_0x5bf332['shift']());}};_0x492a7e(++_0x178189);}(_0xa101,0x15f));var _0x1a10=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0xa101[_0x2c534a];return _0x3f5c99;};'use strict';var multer=require(_0x1a10('0x0'));var util=require(_0x1a10('0x1'));var path=require('path');var timeout=require(_0x1a10('0x2'));var express=require(_0x1a10('0x3'));var router=express['Router']();var fs_extra=require(_0x1a10('0x4'));var auth=require(_0x1a10('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a10('0x6'));var controller=require(_0x1a10('0x7'));router[_0x1a10('0x8')]('/',auth[_0x1a10('0x9')](),controller[_0x1a10('0xa')]);router[_0x1a10('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1a10('0xb')]);router[_0x1a10('0x8')](_0x1a10('0xc'),auth[_0x1a10('0x9')](),controller[_0x1a10('0xd')]);router[_0x1a10('0x8')](_0x1a10('0xe'),auth['isAuthenticated'](),controller[_0x1a10('0xf')]);router[_0x1a10('0x10')]('/',auth[_0x1a10('0x9')](),controller['create']);router[_0x1a10('0x10')](_0x1a10('0xc'),auth[_0x1a10('0x9')](),controller['addConditions']);router[_0x1a10('0x10')](_0x1a10('0xe'),auth[_0x1a10('0x9')](),controller[_0x1a10('0x11')]);router[_0x1a10('0x12')]('/:id',auth[_0x1a10('0x9')](),controller['update']);router['delete']('/:id',auth[_0x1a10('0x9')](),controller[_0x1a10('0x13')]);module[_0x1a10('0x14')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index ae1f5d2..9736f9a 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 _0x81d4=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','STRING','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x81d4,0xa7));var _0x481d=function(_0x4b2e96,_0x1db27a){_0x4b2e96=_0x4b2e96-0x0;var _0x974cb8=_0x81d4[_0x4b2e96];return _0x974cb8;};'use strict';var Sequelize=require(_0x481d('0x0'));module[_0x481d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x481d('0x2')](_0x481d('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x481d('0x4')],'defaultValue':0x0,'comment':_0x481d('0x5')},'limitCalls':{'type':Sequelize[_0x481d('0x6')](0x4)[_0x481d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x481d('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x481d('0x6')](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x481d('0x6')](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x481d('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x481d('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x481d('0x2')](_0x481d('0xf'),'never',_0x481d('0x10')),'defaultValue':_0x481d('0xf')},'dialAMDActive':{'type':Sequelize[_0x481d('0x4')],'defaultValue':0x0,'comment':_0x481d('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x481d('0x6')](0x9)[_0x481d('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x481d('0x12')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x481d('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x481d('0x6')](0x9)[_0x481d('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x481d('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x481d('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x481d('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x481d('0x6')](0x9)[_0x481d('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x481d('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x481d('0x6')](0x9)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x481d('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x481d('0x6')](0x5)[_0x481d('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x481d('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x481d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x481d('0x2')]('DESC',_0x481d('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x481d('0x19')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x481d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x481d('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x481d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x481d('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x481d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x481d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x481d('0x6')](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x481d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x481d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x24')}}; \ No newline at end of file +var _0x9606=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','ENUM','ivr','BOOLEAN'];(function(_0x19b4f1,_0x5d2735){var _0x3cddd8=function(_0x55bbc4){while(--_0x55bbc4){_0x19b4f1['push'](_0x19b4f1['shift']());}};_0x3cddd8(++_0x5d2735);}(_0x9606,0x1af));var _0x6960=function(_0x2aad68,_0x4d1a19){_0x2aad68=_0x2aad68-0x0;var _0x498b48=_0x9606[_0x2aad68];return _0x498b48;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6960('0x0')](_0x6960('0x1')),'allowNull':![],'defaultValue':_0x6960('0x1')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6960('0x2')],'defaultValue':0x0,'comment':_0x6960('0x3')},'limitCalls':{'type':Sequelize[_0x6960('0x4')](0x4)[_0x6960('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6960('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6960('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6960('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6960('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6960('0x7')],'defaultValue':_0x6960('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x6960('0x0')](_0x6960('0xe'),_0x6960('0xf'),_0x6960('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x6960('0x2')],'defaultValue':0x0,'comment':_0x6960('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6960('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x6960('0x4')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6960('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6960('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6960('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6960('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6960('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6960('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6960('0x4')](0x9)[_0x6960('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6960('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6960('0x0')]('DESC',_0x6960('0x17')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x6960('0x7')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6960('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6960('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0x19')},'dialDropMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0x1a')},'dialDropRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x6960('0x4')](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6960('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6960('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6960('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6960('0x4')](0x5)[_0x6960('0x5')],'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 b909ad0..4bee2a7 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 _0xaf23=['request-promise','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','catch','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','rawAttributes','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','update','getHoppers','CmHopper','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','zip-dir','fast-json-patch'];(function(_0x5b8155,_0x51c636){var _0x1d6f07=function(_0x206950){while(--_0x206950){_0x5b8155['push'](_0x5b8155['shift']());}};_0x1d6f07(++_0x51c636);}(_0xaf23,0x11a));var _0x3af2=function(_0x151321,_0x437d1a){_0x151321=_0x151321-0x0;var _0x152cb6=_0xaf23[_0x151321];return _0x152cb6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3af2('0x0'));var jsonpatch=require(_0x3af2('0x1'));var rp=require(_0x3af2('0x2'));var moment=require('moment');var BPromise=require(_0x3af2('0x3'));var Mustache=require(_0x3af2('0x4'));var util=require('util');var path=require(_0x3af2('0x5'));var sox=require('sox');var csv=require(_0x3af2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3af2('0x7'));var squel=require(_0x3af2('0x8'));var crypto=require(_0x3af2('0x9'));var jsforce=require(_0x3af2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3af2('0x6'));var querystring=require('querystring');var Papa=require(_0x3af2('0xb'));var Redis=require('ioredis');var authService=require(_0x3af2('0xc'));var qs=require(_0x3af2('0xd'));var as=require(_0x3af2('0xe'));var hardwareService=require(_0x3af2('0xf'));var logger=require(_0x3af2('0x10'))(_0x3af2('0x11'));var utils=require(_0x3af2('0x12'));var config=require(_0x3af2('0x13'));var licenseUtil=require(_0x3af2('0x14'));var db=require(_0x3af2('0x15'))['db'];function respondWithStatusCode(_0x5d1640,_0x34dd34){_0x34dd34=_0x34dd34||0xcc;return function(_0x308943){if(_0x308943){return _0x5d1640[_0x3af2('0x16')](_0x34dd34);}return _0x5d1640['status'](_0x34dd34)['end']();};}function respondWithResult(_0x76ecd9,_0x2ed531){_0x2ed531=_0x2ed531||0xc8;return function(_0x3f5667){if(_0x3f5667){return _0x76ecd9[_0x3af2('0x17')](_0x2ed531)['json'](_0x3f5667);}};}function respondWithFilteredResult(_0x17400e,_0x11f086){return function(_0x821374){if(_0x821374){var _0x5a8f5f=typeof _0x11f086[_0x3af2('0x18')]===_0x3af2('0x19')&&typeof _0x11f086[_0x3af2('0x1a')]===_0x3af2('0x19');var _0x57ced3=_0x821374['count'];var _0x3303b3=_0x5a8f5f?0x0:_0x11f086[_0x3af2('0x18')];var _0x4c2c56=_0x5a8f5f?_0x821374[_0x3af2('0x1b')]:_0x11f086[_0x3af2('0x18')]+_0x11f086[_0x3af2('0x1a')];var _0x294f89;if(_0x4c2c56>=_0x57ced3){_0x4c2c56=_0x57ced3;_0x294f89=0xc8;}else{_0x294f89=0xce;}_0x17400e['status'](_0x294f89);return _0x17400e['set'](_0x3af2('0x1c'),_0x3303b3+'-'+_0x4c2c56+'/'+_0x57ced3)[_0x3af2('0x1d')](_0x821374);}return null;};}function patchUpdates(_0x14ab6f){return function(_0x27a7ad){try{jsonpatch[_0x3af2('0x1e')](_0x27a7ad,_0x14ab6f,!![]);}catch(_0x54c6ce){return BPromise['reject'](_0x54c6ce);}return _0x27a7ad[_0x3af2('0x1f')]();};}function saveUpdates(_0x43f8e1,_0x1c1a21){return function(_0x1f10d9){if(_0x1f10d9){return _0x1f10d9['update'](_0x43f8e1)[_0x3af2('0x20')](function(_0x2f2776){return _0x2f2776;});}return null;};}function removeEntity(_0x24535b,_0x1487ec){return function(_0x5248cc){if(_0x5248cc){return _0x5248cc[_0x3af2('0x21')]()[_0x3af2('0x20')](function(){var _0x49a09b=_0x5248cc[_0x3af2('0x22')]({'plain':!![]});var _0x394218=_0x3af2('0x23');return db[_0x3af2('0x24')][_0x3af2('0x21')]({'where':{'type':_0x394218,'resourceId':_0x49a09b['id']}})[_0x3af2('0x20')](function(){return _0x5248cc;});})[_0x3af2('0x20')](function(){_0x24535b[_0x3af2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe07fa,_0x5a0a90){return function(_0x24aa22){if(!_0x24aa22){_0xe07fa[_0x3af2('0x16')](0x194);}return _0x24aa22;};}function handleError(_0x4923fa,_0x204fff){_0x204fff=_0x204fff||0x1f4;return function(_0x54318b){logger[_0x3af2('0x25')](_0x54318b['stack']);if(_0x54318b[_0x3af2('0x26')]){delete _0x54318b[_0x3af2('0x26')];}_0x4923fa[_0x3af2('0x17')](_0x204fff)[_0x3af2('0x27')](_0x54318b);};}exports[_0x3af2('0x28')]=function(_0x2a347a,_0x344413){var _0x1a981c={},_0xfcd2a8={},_0x2fcc14={'count':0x0,'rows':[]};var _0x575b6f=_[_0x3af2('0x29')](db[_0x3af2('0x2a')]['rawAttributes'],function(_0x50821e){return{'name':_0x50821e['fieldName'],'type':_0x50821e[_0x3af2('0x2b')][_0x3af2('0x2c')]};});_0xfcd2a8[_0x3af2('0x2d')]=_[_0x3af2('0x29')](_0x575b6f,'name');_0xfcd2a8['query']=_[_0x3af2('0x2e')](_0x2a347a['query']);_0xfcd2a8[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0xfcd2a8[_0x3af2('0x2d')],_0xfcd2a8[_0x3af2('0x31')]);_0x1a981c[_0x3af2('0x32')]=_['intersection'](_0xfcd2a8[_0x3af2('0x2d')],qs['fields'](_0x2a347a[_0x3af2('0x31')][_0x3af2('0x33')]));_0x1a981c[_0x3af2('0x32')]=_0x1a981c[_0x3af2('0x32')][_0x3af2('0x34')]?_0x1a981c['attributes']:_0xfcd2a8[_0x3af2('0x2d')];if(!_0x2a347a[_0x3af2('0x31')][_0x3af2('0x35')](_0x3af2('0x36'))){_0x1a981c[_0x3af2('0x1a')]=qs[_0x3af2('0x1a')](_0x2a347a[_0x3af2('0x31')]['limit']);_0x1a981c[_0x3af2('0x18')]=qs['offset'](_0x2a347a[_0x3af2('0x31')][_0x3af2('0x18')]);}_0x1a981c[_0x3af2('0x37')]=qs['sort'](_0x2a347a['query'][_0x3af2('0x38')]);_0x1a981c[_0x3af2('0x39')]=qs['filters'](_[_0x3af2('0x3a')](_0x2a347a['query'],_0xfcd2a8[_0x3af2('0x2f')]),_0x575b6f);if(_0x2a347a['query'][_0x3af2('0x3b')]){_0x1a981c['where']=_[_0x3af2('0x3c')](_0x1a981c[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x575b6f,function(_0xebce14){if(_0xebce14[_0x3af2('0x2b')]!==_0x3af2('0x3d')){var _0x4987db={};_0x4987db[_0xebce14[_0x3af2('0x26')]]={'$like':'%'+_0x2a347a['query'][_0x3af2('0x3b')]+'%'};return _0x4987db;}})});}_0x1a981c=_['merge']({},_0x1a981c,_0x2a347a[_0x3af2('0x3e')]);var _0x389f9a={'where':_0x1a981c[_0x3af2('0x39')]};return db[_0x3af2('0x2a')]['count'](_0x389f9a)[_0x3af2('0x20')](function(_0x517714){_0x2fcc14[_0x3af2('0x1b')]=_0x517714;if(_0x2a347a[_0x3af2('0x31')]['includeAll']){_0x1a981c[_0x3af2('0x3f')]=[{'all':!![]}];}return db[_0x3af2('0x2a')][_0x3af2('0x40')](_0x1a981c);})[_0x3af2('0x20')](function(_0x3780e9){_0x2fcc14[_0x3af2('0x41')]=_0x3780e9;return _0x2fcc14;})[_0x3af2('0x20')](respondWithFilteredResult(_0x344413,_0x1a981c))['catch'](handleError(_0x344413,null));};exports[_0x3af2('0x42')]=function(_0x33a438,_0x4a7afd){var _0xd38c78={'raw':![],'where':{'id':_0x33a438['params']['id']}},_0x192108={};_0x192108[_0x3af2('0x2d')]=_[_0x3af2('0x2e')](db[_0x3af2('0x2a')]['rawAttributes']);_0x192108[_0x3af2('0x31')]=_[_0x3af2('0x2e')](_0x33a438[_0x3af2('0x31')]);_0x192108['filters']=_[_0x3af2('0x30')](_0x192108[_0x3af2('0x2d')],_0x192108['query']);_0xd38c78[_0x3af2('0x32')]=_[_0x3af2('0x30')](_0x192108[_0x3af2('0x2d')],qs[_0x3af2('0x33')](_0x33a438[_0x3af2('0x31')][_0x3af2('0x33')]));_0xd38c78[_0x3af2('0x32')]=_0xd38c78[_0x3af2('0x32')][_0x3af2('0x34')]?_0xd38c78[_0x3af2('0x32')]:_0x192108[_0x3af2('0x2d')];if(_0x33a438[_0x3af2('0x31')][_0x3af2('0x43')]){_0xd38c78[_0x3af2('0x3f')]=[{'all':!![]}];}_0xd38c78=_['merge']({},_0xd38c78,_0x33a438['options']);return db[_0x3af2('0x2a')][_0x3af2('0x44')](_0xd38c78)[_0x3af2('0x20')](handleEntityNotFound(_0x4a7afd,null))['then'](respondWithResult(_0x4a7afd,null))[_0x3af2('0x45')](handleError(_0x4a7afd,null));};exports[_0x3af2('0x46')]=function(_0x7a549,_0x52a0f9){return db[_0x3af2('0x2a')]['create'](_0x7a549[_0x3af2('0x47')],{})[_0x3af2('0x20')](function(_0x13cc1a){var _0x3da7ba=_0x7a549[_0x3af2('0x48')]['get']({'plain':!![]});if(!_0x3da7ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3da7ba[_0x3af2('0x49')]===_0x3af2('0x48')){var _0x34f9b7=_0x13cc1a[_0x3af2('0x22')]({'plain':!![]});var _0x5a66a8=_0x3af2('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x5a66a8,'userProfileId':_0x3da7ba['userProfileId']},'raw':!![]})[_0x3af2('0x20')](function(_0xf72d98){if(_0xf72d98&&_0xf72d98[_0x3af2('0x4a')]===0x0){return db[_0x3af2('0x24')][_0x3af2('0x46')]({'name':_0x34f9b7['name'],'resourceId':_0x34f9b7['id'],'type':_0xf72d98[_0x3af2('0x26')],'sectionId':_0xf72d98['id']},{})[_0x3af2('0x20')](function(){return _0x13cc1a;});}else{return _0x13cc1a;}})[_0x3af2('0x45')](function(_0x1f132b){logger[_0x3af2('0x25')](_0x3af2('0x4b'),_0x1f132b);throw _0x1f132b;});}return _0x13cc1a;})[_0x3af2('0x20')](respondWithResult(_0x52a0f9,0xc9))[_0x3af2('0x45')](handleError(_0x52a0f9,null));};exports[_0x3af2('0x4c')]=function(_0x38f960,_0xe71c98){var _0x9e6bfa={'where':{'id':_0x38f960[_0x3af2('0x4d')]['id']}},_0x521007={};_0x521007['model']=_[_0x3af2('0x2e')](db[_0x3af2('0x2a')][_0x3af2('0x4e')]);_0x9e6bfa[_0x3af2('0x32')]=_['intersection'](_0x521007[_0x3af2('0x2d')],qs['fields'](_0x38f960[_0x3af2('0x31')][_0x3af2('0x33')]));_0x9e6bfa[_0x3af2('0x32')]=_0x9e6bfa['attributes'][_0x3af2('0x34')]?_0x9e6bfa[_0x3af2('0x32')]:_0x521007['model'];if(_0x38f960['query'][_0x3af2('0x43')]){_0x9e6bfa[_0x3af2('0x3f')]=[{'all':!![]}];}_0x9e6bfa=_[_0x3af2('0x3c')]({},_0x9e6bfa,_0x38f960[_0x3af2('0x3e')]);return db['Campaign']['find'](_0x9e6bfa)[_0x3af2('0x20')](handleEntityNotFound(_0xe71c98,null))[_0x3af2('0x20')](function(_0x42e8a1){if(_0x42e8a1){var _0x55bf78=_0x42e8a1[_0x3af2('0x22')]({'plain':!![]});_0x55bf78=qs[_0x3af2('0x4f')](_0x55bf78,['id',_0x3af2('0x50'),'updatedAt']);_0x38f960['body']=_[_0x3af2('0x4f')](_0x38f960[_0x3af2('0x47')],['id',_0x3af2('0x50'),_0x3af2('0x51')]);return db['Campaign'][_0x3af2('0x46')](_['merge'](_0x55bf78,_0x38f960[_0x3af2('0x47')]),{'include':_0x38f960[_0x3af2('0x31')][_0x3af2('0x43')]?[{'all':!![]}]:undefined})[_0x3af2('0x20')](function(_0x35faee){var _0x47b563=_0x38f960[_0x3af2('0x48')][_0x3af2('0x22')]({'plain':!![]});if(!_0x47b563)throw new Error(_0x3af2('0x52'));if(_0x47b563['role']===_0x3af2('0x48')){var _0x131f90=_0x35faee[_0x3af2('0x22')]({'plain':!![]});var _0x16c9c9=_0x3af2('0x23');return db[_0x3af2('0x53')]['find']({'where':{'name':_0x16c9c9,'userProfileId':_0x47b563[_0x3af2('0x54')]},'raw':!![]})['then'](function(_0x55c9e5){if(_0x55c9e5&&_0x55c9e5[_0x3af2('0x4a')]===0x0){return db[_0x3af2('0x24')]['create']({'name':_0x131f90[_0x3af2('0x26')],'resourceId':_0x131f90['id'],'type':_0x55c9e5['name'],'sectionId':_0x55c9e5['id']},{})[_0x3af2('0x20')](function(){return _0x35faee;});}else{return _0x35faee;}})['catch'](function(_0x5eefd1){logger['error'](_0x3af2('0x4b'),_0x5eefd1);throw _0x5eefd1;});}return _0x35faee;});}})[_0x3af2('0x20')](respondWithResult(_0xe71c98,0xc9))[_0x3af2('0x45')](handleError(_0xe71c98,null));};exports[_0x3af2('0x55')]=function(_0xd62e18,_0x5a342c){if(_0xd62e18['body']['id']){delete _0xd62e18['body']['id'];}return db[_0x3af2('0x2a')][_0x3af2('0x44')]({'where':{'id':_0xd62e18[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x5a342c,null))[_0x3af2('0x20')](saveUpdates(_0xd62e18['body'],null))[_0x3af2('0x20')](respondWithResult(_0x5a342c,null))[_0x3af2('0x45')](handleError(_0x5a342c,null));};exports[_0x3af2('0x21')]=function(_0x3804a3,_0x4e77c5){return db[_0x3af2('0x2a')][_0x3af2('0x44')]({'where':{'id':_0x3804a3['params']['id']}})['then'](handleEntityNotFound(_0x4e77c5,null))[_0x3af2('0x20')](removeEntity(_0x4e77c5,null))[_0x3af2('0x45')](handleError(_0x4e77c5,null));};exports[_0x3af2('0x56')]=function(_0x301eff,_0x438cbd,_0x4df66c){var _0x3a47c1={'raw':!![],'where':{}};var _0x2f5942={};var _0x18f6cc={'count':0x0,'rows':[]};return db[_0x3af2('0x2a')]['findOne']({'where':{'id':_0x301eff['params']['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x438cbd,null))[_0x3af2('0x20')](function(_0x494573){if(_0x494573){_0x2f5942['model']=_['keys'](db[_0x3af2('0x57')][_0x3af2('0x4e')]);_0x2f5942['query']=_[_0x3af2('0x2e')](_0x301eff[_0x3af2('0x31')]);_0x2f5942[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x2f5942[_0x3af2('0x2d')],_0x2f5942[_0x3af2('0x31')]);_0x3a47c1[_0x3af2('0x32')]=_[_0x3af2('0x30')](_0x2f5942[_0x3af2('0x2d')],qs['fields'](_0x301eff['query'][_0x3af2('0x33')]));_0x3a47c1[_0x3af2('0x32')]=_0x3a47c1[_0x3af2('0x32')][_0x3af2('0x34')]?_0x3a47c1[_0x3af2('0x32')]:_0x2f5942[_0x3af2('0x2d')];if(!_0x301eff[_0x3af2('0x31')]['hasOwnProperty'](_0x3af2('0x36'))){_0x3a47c1['limit']=qs[_0x3af2('0x1a')](_0x301eff[_0x3af2('0x31')]['limit']);_0x3a47c1[_0x3af2('0x18')]=qs['offset'](_0x301eff[_0x3af2('0x31')][_0x3af2('0x18')]);}_0x3a47c1['order']=qs[_0x3af2('0x38')](_0x301eff[_0x3af2('0x31')][_0x3af2('0x38')]);_0x3a47c1[_0x3af2('0x39')]=qs['filters'](_[_0x3af2('0x3a')](_0x301eff[_0x3af2('0x31')],_0x2f5942[_0x3af2('0x2f')]));_0x3a47c1[_0x3af2('0x39')]['CampaignId']=_0x494573['id'];if(_0x301eff[_0x3af2('0x31')]['filter']){_0x3a47c1[_0x3af2('0x39')]=_['merge'](_0x3a47c1[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x3a47c1[_0x3af2('0x32')],function(_0x33663d){var _0x9794c2={};_0x9794c2[_0x33663d]={'$like':'%'+_0x301eff['query']['filter']+'%'};return _0x9794c2;})});}_0x3a47c1=_[_0x3af2('0x3c')]({},_0x3a47c1,_0x301eff[_0x3af2('0x3e')]);return db['CmHopper']['count']({'where':_0x3a47c1[_0x3af2('0x39')]})[_0x3af2('0x20')](function(_0x487c8c){_0x18f6cc[_0x3af2('0x1b')]=_0x487c8c;if(_0x301eff[_0x3af2('0x31')][_0x3af2('0x43')]){_0x3a47c1[_0x3af2('0x3f')]=[{'all':!![]}];}return db[_0x3af2('0x57')][_0x3af2('0x40')](_0x3a47c1);})[_0x3af2('0x20')](function(_0xd1fc9d){_0x18f6cc[_0x3af2('0x41')]=_0xd1fc9d;return _0x18f6cc;});}})[_0x3af2('0x20')](respondWithFilteredResult(_0x438cbd,_0x3a47c1))[_0x3af2('0x45')](handleError(_0x438cbd,null));};exports[_0x3af2('0x58')]=function(_0xd0ae5d,_0x5c875b,_0x597902){var _0x1871ba={'raw':!![],'where':{}};var _0x258fa6={};var _0x12ba5a={'count':0x0,'rows':[]};return db[_0x3af2('0x2a')][_0x3af2('0x59')]({'where':{'id':_0xd0ae5d['params']['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x5c875b,null))[_0x3af2('0x20')](function(_0x557938){if(_0x557938){_0x258fa6['model']=_[_0x3af2('0x2e')](db[_0x3af2('0x5a')][_0x3af2('0x4e')]);_0x258fa6['query']=_[_0x3af2('0x2e')](_0xd0ae5d['query']);_0x258fa6[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x258fa6[_0x3af2('0x2d')],_0x258fa6[_0x3af2('0x31')]);_0x1871ba[_0x3af2('0x32')]=_[_0x3af2('0x30')](_0x258fa6[_0x3af2('0x2d')],qs[_0x3af2('0x33')](_0xd0ae5d[_0x3af2('0x31')][_0x3af2('0x33')]));_0x1871ba[_0x3af2('0x32')]=_0x1871ba['attributes'][_0x3af2('0x34')]?_0x1871ba[_0x3af2('0x32')]:_0x258fa6[_0x3af2('0x2d')];if(!_0xd0ae5d[_0x3af2('0x31')][_0x3af2('0x35')](_0x3af2('0x36'))){_0x1871ba[_0x3af2('0x1a')]=qs['limit'](_0xd0ae5d['query'][_0x3af2('0x1a')]);_0x1871ba['offset']=qs[_0x3af2('0x18')](_0xd0ae5d['query']['offset']);}_0x1871ba[_0x3af2('0x37')]=qs['sort'](_0xd0ae5d[_0x3af2('0x31')][_0x3af2('0x38')]);_0x1871ba['where']=qs[_0x3af2('0x2f')](_[_0x3af2('0x3a')](_0xd0ae5d[_0x3af2('0x31')],_0x258fa6[_0x3af2('0x2f')]));_0x1871ba['where'][_0x3af2('0x5b')]=_0x557938['id'];if(_0xd0ae5d[_0x3af2('0x31')]['filter']){_0x1871ba['where']=_[_0x3af2('0x3c')](_0x1871ba[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x1871ba[_0x3af2('0x32')],function(_0x418cf7){var _0x263226={};_0x263226[_0x418cf7]={'$like':'%'+_0xd0ae5d['query'][_0x3af2('0x3b')]+'%'};return _0x263226;})});}_0x1871ba=_[_0x3af2('0x3c')]({},_0x1871ba,_0xd0ae5d[_0x3af2('0x3e')]);return db[_0x3af2('0x5a')][_0x3af2('0x1b')]({'where':_0x1871ba[_0x3af2('0x39')]})[_0x3af2('0x20')](function(_0x5b5873){_0x12ba5a[_0x3af2('0x1b')]=_0x5b5873;if(_0xd0ae5d[_0x3af2('0x31')][_0x3af2('0x43')]){_0x1871ba[_0x3af2('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3af2('0x40')](_0x1871ba);})[_0x3af2('0x20')](function(_0x2999d7){_0x12ba5a[_0x3af2('0x41')]=_0x2999d7;return _0x12ba5a;});}})[_0x3af2('0x20')](respondWithFilteredResult(_0x5c875b,_0x1871ba))[_0x3af2('0x45')](handleError(_0x5c875b,null));};exports[_0x3af2('0x5c')]=function(_0x419028,_0x2776cd,_0x47b7f0){var _0x283dcc={'raw':!![],'where':{}};var _0x250e0d={};var _0x1cdea2={'count':0x0,'rows':[]};return db[_0x3af2('0x2a')][_0x3af2('0x59')]({'where':{'id':_0x419028['params']['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x2776cd,null))[_0x3af2('0x20')](function(_0x5a429c){if(_0x5a429c){_0x250e0d[_0x3af2('0x2d')]=_[_0x3af2('0x2e')](db[_0x3af2('0x5d')]['rawAttributes']);_0x250e0d[_0x3af2('0x31')]=_['keys'](_0x419028['query']);_0x250e0d['filters']=_[_0x3af2('0x30')](_0x250e0d[_0x3af2('0x2d')],_0x250e0d[_0x3af2('0x31')]);_0x283dcc[_0x3af2('0x32')]=_['intersection'](_0x250e0d['model'],qs[_0x3af2('0x33')](_0x419028[_0x3af2('0x31')][_0x3af2('0x33')]));_0x283dcc[_0x3af2('0x32')]=_0x283dcc['attributes'][_0x3af2('0x34')]?_0x283dcc[_0x3af2('0x32')]:_0x250e0d['model'];if(!_0x419028['query'][_0x3af2('0x35')](_0x3af2('0x36'))){_0x283dcc[_0x3af2('0x1a')]=qs[_0x3af2('0x1a')](_0x419028[_0x3af2('0x31')]['limit']);_0x283dcc[_0x3af2('0x18')]=qs[_0x3af2('0x18')](_0x419028[_0x3af2('0x31')][_0x3af2('0x18')]);}_0x283dcc[_0x3af2('0x37')]=qs[_0x3af2('0x38')](_0x419028[_0x3af2('0x31')]['sort']);_0x283dcc[_0x3af2('0x39')]=qs[_0x3af2('0x2f')](_[_0x3af2('0x3a')](_0x419028[_0x3af2('0x31')],_0x250e0d[_0x3af2('0x2f')]));_0x283dcc['where'][_0x3af2('0x5b')]=_0x5a429c['id'];if(_0x419028[_0x3af2('0x31')][_0x3af2('0x3b')]){_0x283dcc[_0x3af2('0x39')]=_[_0x3af2('0x3c')](_0x283dcc[_0x3af2('0x39')],{'$or':_['map'](_0x283dcc['attributes'],function(_0x42d577){var _0x58efd2={};_0x58efd2[_0x42d577]={'$like':'%'+_0x419028[_0x3af2('0x31')][_0x3af2('0x3b')]+'%'};return _0x58efd2;})});}_0x283dcc=_[_0x3af2('0x3c')]({},_0x283dcc,_0x419028[_0x3af2('0x3e')]);return db[_0x3af2('0x5d')]['count']({'where':_0x283dcc[_0x3af2('0x39')]})[_0x3af2('0x20')](function(_0x565953){_0x1cdea2[_0x3af2('0x1b')]=_0x565953;if(_0x419028[_0x3af2('0x31')][_0x3af2('0x43')]){_0x283dcc[_0x3af2('0x3f')]=[{'all':!![]}];}return db[_0x3af2('0x5d')]['findAll'](_0x283dcc);})[_0x3af2('0x20')](function(_0x27b6f2){_0x1cdea2[_0x3af2('0x41')]=_0x27b6f2;return _0x1cdea2;});}})[_0x3af2('0x20')](respondWithFilteredResult(_0x2776cd,_0x283dcc))['catch'](handleError(_0x2776cd,null));};exports['getHopperBlacks']=function(_0x5a9ac2,_0x371b1c,_0x45a02c){var _0x3cde5e={'raw':!![],'where':{}};var _0x615c47={};var _0x1b98d4={'count':0x0,'rows':[]};return db[_0x3af2('0x2a')]['findOne']({'where':{'id':_0x5a9ac2[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x371b1c,null))[_0x3af2('0x20')](function(_0x40bb47){if(_0x40bb47){_0x615c47[_0x3af2('0x2d')]=_[_0x3af2('0x2e')](db[_0x3af2('0x5e')][_0x3af2('0x4e')]);_0x615c47[_0x3af2('0x31')]=_[_0x3af2('0x2e')](_0x5a9ac2['query']);_0x615c47[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x615c47['model'],_0x615c47[_0x3af2('0x31')]);_0x3cde5e[_0x3af2('0x32')]=_['intersection'](_0x615c47[_0x3af2('0x2d')],qs['fields'](_0x5a9ac2[_0x3af2('0x31')]['fields']));_0x3cde5e[_0x3af2('0x32')]=_0x3cde5e[_0x3af2('0x32')][_0x3af2('0x34')]?_0x3cde5e[_0x3af2('0x32')]:_0x615c47[_0x3af2('0x2d')];if(!_0x5a9ac2['query'][_0x3af2('0x35')](_0x3af2('0x36'))){_0x3cde5e[_0x3af2('0x1a')]=qs['limit'](_0x5a9ac2[_0x3af2('0x31')]['limit']);_0x3cde5e[_0x3af2('0x18')]=qs[_0x3af2('0x18')](_0x5a9ac2[_0x3af2('0x31')][_0x3af2('0x18')]);}_0x3cde5e[_0x3af2('0x37')]=qs[_0x3af2('0x38')](_0x5a9ac2[_0x3af2('0x31')][_0x3af2('0x38')]);_0x3cde5e['where']=qs['filters'](_['pick'](_0x5a9ac2['query'],_0x615c47[_0x3af2('0x2f')]));_0x3cde5e[_0x3af2('0x39')]['CampaignId']=_0x40bb47['id'];if(_0x5a9ac2[_0x3af2('0x31')]['filter']){_0x3cde5e[_0x3af2('0x39')]=_[_0x3af2('0x3c')](_0x3cde5e[_0x3af2('0x39')],{'$or':_['map'](_0x3cde5e[_0x3af2('0x32')],function(_0x2b0355){var _0x47fb9e={};_0x47fb9e[_0x2b0355]={'$like':'%'+_0x5a9ac2[_0x3af2('0x31')][_0x3af2('0x3b')]+'%'};return _0x47fb9e;})});}_0x3cde5e=_[_0x3af2('0x3c')]({},_0x3cde5e,_0x5a9ac2[_0x3af2('0x3e')]);return db[_0x3af2('0x5e')]['count']({'where':_0x3cde5e[_0x3af2('0x39')]})['then'](function(_0x2b8275){_0x1b98d4['count']=_0x2b8275;if(_0x5a9ac2['query'][_0x3af2('0x43')]){_0x3cde5e[_0x3af2('0x3f')]=[{'all':!![]}];}return db[_0x3af2('0x5e')]['findAll'](_0x3cde5e);})[_0x3af2('0x20')](function(_0x47769){_0x1b98d4[_0x3af2('0x41')]=_0x47769;return _0x1b98d4;});}})[_0x3af2('0x20')](respondWithFilteredResult(_0x371b1c,_0x3cde5e))['catch'](handleError(_0x371b1c,null));};exports[_0x3af2('0x5f')]=function(_0x570044,_0x12bcf0,_0x56db97){var _0x50668b={};var _0x546314={};var _0x592c71;var _0x30dc02;return db[_0x3af2('0x2a')]['findOne']({'where':{'id':_0x570044[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x12bcf0,null))['then'](function(_0x136c87){if(_0x136c87){_0x592c71=_0x136c87;_0x546314[_0x3af2('0x2d')]=_[_0x3af2('0x2e')](db[_0x3af2('0x60')][_0x3af2('0x4e')]);_0x546314[_0x3af2('0x31')]=_['keys'](_0x570044['query']);_0x546314[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x546314[_0x3af2('0x2d')],_0x546314[_0x3af2('0x31')]);_0x50668b[_0x3af2('0x32')]=_['intersection'](_0x546314[_0x3af2('0x2d')],qs[_0x3af2('0x33')](_0x570044[_0x3af2('0x31')]['fields']));_0x50668b[_0x3af2('0x32')]=_0x50668b['attributes'][_0x3af2('0x34')]?_0x50668b[_0x3af2('0x32')]:_0x546314[_0x3af2('0x2d')];_0x50668b[_0x3af2('0x37')]=qs['sort'](_0x570044['query'][_0x3af2('0x38')]);_0x50668b[_0x3af2('0x39')]=qs[_0x3af2('0x2f')](_[_0x3af2('0x3a')](_0x570044[_0x3af2('0x31')],_0x546314[_0x3af2('0x2f')]));if(_0x570044[_0x3af2('0x31')][_0x3af2('0x3b')]){_0x50668b[_0x3af2('0x39')]=_[_0x3af2('0x3c')](_0x50668b[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x50668b[_0x3af2('0x32')],function(_0x12954d){var _0x362952={};_0x362952[_0x12954d]={'$like':'%'+_0x570044[_0x3af2('0x31')][_0x3af2('0x3b')]+'%'};return _0x362952;})});}_0x50668b=_[_0x3af2('0x3c')]({},_0x50668b,_0x570044[_0x3af2('0x3e')]);return _0x592c71[_0x3af2('0x5f')](_0x50668b);}})[_0x3af2('0x20')](function(_0x463813){if(_0x463813){_0x30dc02=_0x463813['length'];if(!_0x570044['query'][_0x3af2('0x35')](_0x3af2('0x36'))){_0x50668b[_0x3af2('0x1a')]=qs[_0x3af2('0x1a')](_0x570044[_0x3af2('0x31')][_0x3af2('0x1a')]);_0x50668b[_0x3af2('0x18')]=qs[_0x3af2('0x18')](_0x570044[_0x3af2('0x31')]['offset']);}return _0x592c71[_0x3af2('0x5f')](_0x50668b);}})['then'](function(_0x2a4526){if(_0x2a4526){return _0x2a4526?{'count':_0x30dc02,'rows':_0x2a4526}:null;}})['then'](respondWithResult(_0x12bcf0,null))[_0x3af2('0x45')](handleError(_0x12bcf0,null));};exports[_0x3af2('0x61')]=function(_0x2e816f,_0x1bb59,_0x1ee672){var _0x3e9e61,_0x37b7fb;var _0x53dd4d=[];var _0xb78ed=moment()[_0x3af2('0x62')](_0x3af2('0x63'));return db[_0x3af2('0x2a')]['find']({'where':{'id':_0x2e816f[_0x3af2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1bb59,null))[_0x3af2('0x20')](function(_0x3778cd){if(_0x3778cd){_0x37b7fb=_0x3778cd;return _0x3778cd[_0x3af2('0x61')](_0x2e816f['body'][_0x3af2('0x64')],_[_0x3af2('0x4f')](_0x2e816f[_0x3af2('0x47')],[_0x3af2('0x64'),'id'])||{});}return null;})[_0x3af2('0x65')](function(_0x174428){var _0x29f839;var _0x2ae748;_0x3e9e61=_0x174428||[];var _0x4c924a=[];if(_0x174428){for(var _0x4ba6bb=0x0;_0x4ba6bb<_0x174428['length'];_0x4ba6bb+=0x1){var _0x3880d1=_0x174428[_0x4ba6bb][_0x3af2('0x22')]({'plain':!![]});_0x37b7fb[_0x3af2('0x66')]=_0x2e816f[_0x3af2('0x47')][_0x3af2('0x66')]?_0x2e816f[_0x3af2('0x47')][_0x3af2('0x66')]:_0x37b7fb[_0x3af2('0x66')];switch(_0x37b7fb[_0x3af2('0x66')]){case _0x3af2('0x67'):_0x29f839=squel[_0x3af2('0x68')]()[_0x3af2('0x69')](_0x3af2('0x6a'))[_0x3af2('0x6b')]([_0x3af2('0x6c'),_0x3af2('0x6d'),_0x3af2('0x6e'),_0x3af2('0x6f'),_0x3af2('0x5b'),'createdAt',_0x3af2('0x51')],squel[_0x3af2('0x70')]()['field']('phone',_0x3af2('0x6c'))['field'](_0x3af2('0x71'),_0x3af2('0x6d'))[_0x3af2('0x72')]('id',_0x3af2('0x6e'))['field'](_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')](),_0x3af2('0x6f'))['field'](_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')](),_0x3af2('0x5b'))[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x50'))['field']('\x27'+_0xb78ed+'\x27','updatedAt')[_0x3af2('0x75')](_0x3af2('0x76'))['where'](_0x3af2('0x77'))['where'](_0x3af2('0x78'),_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')]())['where'](_0x3af2('0x79'))[_0x3af2('0x39')](_0x3af2('0x7a'),squel[_0x3af2('0x70')]()[_0x3af2('0x72')](_0x3af2('0x7b'))[_0x3af2('0x75')]('cm_hopper_final')[_0x3af2('0x39')]('CampaignId\x20=\x20?',_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')]()))['where'](_0x3af2('0x7a'),squel[_0x3af2('0x70')]()[_0x3af2('0x72')](_0x3af2('0x7c'))[_0x3af2('0x75')](_0x3af2('0x6a'))[_0x3af2('0x39')]('CampaignId\x20=\x20?',_0x2e816f['params']['id'][_0x3af2('0x74')]())))[_0x3af2('0x74')]();break;case _0x3af2('0x7d'):_0x29f839=squel[_0x3af2('0x68')]()['into'](_0x3af2('0x6a'))[_0x3af2('0x6b')]([_0x3af2('0x6c'),_0x3af2('0x6d'),_0x3af2('0x6e'),_0x3af2('0x6f'),'CampaignId',_0x3af2('0x50'),_0x3af2('0x51')],squel['select']()['field']('phone',_0x3af2('0x6c'))[_0x3af2('0x72')]('NOW()',_0x3af2('0x6d'))[_0x3af2('0x72')]('id',_0x3af2('0x6e'))[_0x3af2('0x72')](_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')](),_0x3af2('0x6f'))[_0x3af2('0x72')](_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')](),'CampaignId')[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27','createdAt')[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x51'))['from'](_0x3af2('0x76'))[_0x3af2('0x39')]('deletedAt\x20IS\x20NULL')[_0x3af2('0x39')](_0x3af2('0x78'),_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')]())[_0x3af2('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x3af2('0x39')](_0x3af2('0x7a'),squel[_0x3af2('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x3af2('0x75')]('cm_hopper')['where'](_0x3af2('0x7e'),_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')]())))[_0x3af2('0x74')]();break;default:_0x29f839=squel[_0x3af2('0x68')]()['into'](_0x3af2('0x6a'))['fromQuery']([_0x3af2('0x6c'),_0x3af2('0x6d'),'ContactId',_0x3af2('0x6f'),_0x3af2('0x5b'),_0x3af2('0x50'),_0x3af2('0x51')],squel[_0x3af2('0x70')]()[_0x3af2('0x72')](_0x3af2('0x6c'),_0x3af2('0x6c'))[_0x3af2('0x72')](_0x3af2('0x71'),_0x3af2('0x6d'))[_0x3af2('0x72')]('id',_0x3af2('0x6e'))[_0x3af2('0x72')](_0x3880d1[_0x3af2('0x73')]['toString'](),_0x3af2('0x6f'))[_0x3af2('0x72')](_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')](),'CampaignId')['field']('\x27'+_0xb78ed+'\x27',_0x3af2('0x50'))[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x51'))[_0x3af2('0x75')](_0x3af2('0x76'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x3af2('0x78'),_0x3880d1[_0x3af2('0x73')][_0x3af2('0x74')]())[_0x3af2('0x39')](_0x3af2('0x79')))[_0x3af2('0x74')]();}_0x2ae748=squel['insert']()['into'](_0x3af2('0x7f'))[_0x3af2('0x6b')]([_0x3af2('0x80'),_0x3af2('0x6d'),_0x3af2('0x6c'),_0x3af2('0x81'),'createdAt',_0x3af2('0x51')],squel[_0x3af2('0x70')]()[_0x3af2('0x72')]('h.id','id')['field']('NOW()',_0x3af2('0x6d'))[_0x3af2('0x72')](_0x3af2('0x82'),_0x3af2('0x6c'))[_0x3af2('0x72')](_0x3af2('0x83'),_0x3af2('0x81'))[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x50'))[_0x3af2('0x72')]('\x27'+_0xb78ed+'\x27',_0x3af2('0x51'))[_0x3af2('0x75')]('cm_contact_has_items','ci')['join'](_0x3af2('0x6a'),'h',_0x3af2('0x84'))[_0x3af2('0x39')](_0x3af2('0x85'),_0x3880d1['CmListId'][_0x3af2('0x74')]())[_0x3af2('0x39')]('h.CampaignId=?',_0x2e816f[_0x3af2('0x4d')]['id'][_0x3af2('0x74')]())[_0x3af2('0x39')](_0x3af2('0x86'),_0xb78ed))[_0x3af2('0x74')]();_0x4c924a[_0x3af2('0x87')](db[_0x3af2('0x88')][_0x3af2('0x31')](_0x29f839));_0x53dd4d[_0x3af2('0x87')](db[_0x3af2('0x88')][_0x3af2('0x31')](_0x2ae748));}return BPromise[_0x3af2('0x89')](_0x4c924a);}})['then'](function(){return BPromise['all'](_0x53dd4d);})[_0x3af2('0x20')](function(){return _0x3e9e61;})['then'](respondWithResult(_0x1bb59,null))[_0x3af2('0x45')](handleError(_0x1bb59,null));};exports['removeLists']=function(_0x11f98c,_0xb0bb71,_0x41c1fa){return db[_0x3af2('0x2a')][_0x3af2('0x44')]({'where':{'id':_0x11f98c[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0xb0bb71,null))[_0x3af2('0x20')](function(_0x141512){if(_0x141512){return _0x141512[_0x3af2('0x8a')](_0x11f98c[_0x3af2('0x31')][_0x3af2('0x64')]);}})['then'](function(_0x56fb5c){if(_0x56fb5c){return db['CmHopper'][_0x3af2('0x21')]({'where':{'ListId':_0x11f98c[_0x3af2('0x31')]['ids'],'CampaignId':_0x11f98c[_0x3af2('0x4d')]['id']}})['then'](function(){return _0x56fb5c;});}})[_0x3af2('0x20')](respondWithStatusCode(_0xb0bb71,null))[_0x3af2('0x45')](handleError(_0xb0bb71,null));};exports['getBlackLists']=function(_0x16cd27,_0x4ab66a,_0x2793fd){var _0x29dd53={};var _0x4733ca={};var _0x238b75;var _0x35a144;return db['Campaign'][_0x3af2('0x59')]({'where':{'id':_0x16cd27[_0x3af2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ab66a,null))[_0x3af2('0x20')](function(_0x10f97d){if(_0x10f97d){_0x238b75=_0x10f97d;_0x4733ca['model']=_[_0x3af2('0x2e')](db[_0x3af2('0x60')][_0x3af2('0x4e')]);_0x4733ca['query']=_[_0x3af2('0x2e')](_0x16cd27[_0x3af2('0x31')]);_0x4733ca[_0x3af2('0x2f')]=_[_0x3af2('0x30')](_0x4733ca[_0x3af2('0x2d')],_0x4733ca['query']);_0x29dd53[_0x3af2('0x32')]=_[_0x3af2('0x30')](_0x4733ca[_0x3af2('0x2d')],qs[_0x3af2('0x33')](_0x16cd27[_0x3af2('0x31')][_0x3af2('0x33')]));_0x29dd53[_0x3af2('0x32')]=_0x29dd53[_0x3af2('0x32')]['length']?_0x29dd53[_0x3af2('0x32')]:_0x4733ca[_0x3af2('0x2d')];_0x29dd53['order']=qs[_0x3af2('0x38')](_0x16cd27[_0x3af2('0x31')][_0x3af2('0x38')]);_0x29dd53['where']=qs[_0x3af2('0x2f')](_['pick'](_0x16cd27[_0x3af2('0x31')],_0x4733ca[_0x3af2('0x2f')]));if(_0x16cd27[_0x3af2('0x31')][_0x3af2('0x3b')]){_0x29dd53[_0x3af2('0x39')]=_[_0x3af2('0x3c')](_0x29dd53[_0x3af2('0x39')],{'$or':_[_0x3af2('0x29')](_0x29dd53['attributes'],function(_0x52eba6){var _0x5bedd2={};_0x5bedd2[_0x52eba6]={'$like':'%'+_0x16cd27['query'][_0x3af2('0x3b')]+'%'};return _0x5bedd2;})});}_0x29dd53=_['merge']({},_0x29dd53,_0x16cd27['options']);return _0x238b75['getBlackLists'](_0x29dd53);}})['then'](function(_0xc6016){if(_0xc6016){_0x35a144=_0xc6016[_0x3af2('0x34')];if(!_0x16cd27[_0x3af2('0x31')][_0x3af2('0x35')](_0x3af2('0x36'))){_0x29dd53[_0x3af2('0x1a')]=qs[_0x3af2('0x1a')](_0x16cd27[_0x3af2('0x31')]['limit']);_0x29dd53[_0x3af2('0x18')]=qs['offset'](_0x16cd27['query'][_0x3af2('0x18')]);}return _0x238b75[_0x3af2('0x8b')](_0x29dd53);}})[_0x3af2('0x20')](function(_0x3f4374){if(_0x3f4374){return _0x3f4374?{'count':_0x35a144,'rows':_0x3f4374}:null;}})[_0x3af2('0x20')](respondWithResult(_0x4ab66a,null))[_0x3af2('0x45')](handleError(_0x4ab66a,null));};exports[_0x3af2('0x8c')]=function(_0x5ee024,_0x594b7f,_0x390ef1){var _0x2acaa7,_0x4c7c79;var _0x286ee5=[];var _0x36fd1c=moment()[_0x3af2('0x62')](_0x3af2('0x63'));return db[_0x3af2('0x2a')][_0x3af2('0x44')]({'where':{'id':_0x5ee024[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](handleEntityNotFound(_0x594b7f,null))[_0x3af2('0x20')](function(_0x28aa8e){if(_0x28aa8e){_0x4c7c79=_0x28aa8e;return _0x28aa8e[_0x3af2('0x8c')](_0x5ee024[_0x3af2('0x47')]['ids'],_[_0x3af2('0x4f')](_0x5ee024[_0x3af2('0x47')],[_0x3af2('0x64'),'id'])||{});}return null;})[_0x3af2('0x65')](function(_0x3363f8){var _0x15891e;var _0x4dd8eb;_0x2acaa7=_0x3363f8||[];var _0x7aed82=[];if(_0x3363f8){for(var _0x191f91=0x0;_0x191f91<_0x3363f8[_0x3af2('0x34')];_0x191f91+=0x1){var _0x2b5e27=_0x3363f8[_0x191f91]['get']({'plain':!![]});_0x15891e=squel[_0x3af2('0x68')]()[_0x3af2('0x69')]('cm_hopper_black')[_0x3af2('0x6b')]([_0x3af2('0x6c'),_0x3af2('0x6e'),_0x3af2('0x6f'),_0x3af2('0x5b'),_0x3af2('0x50'),'updatedAt'],squel[_0x3af2('0x70')]()[_0x3af2('0x72')](_0x3af2('0x6c'),'phone')[_0x3af2('0x72')]('id',_0x3af2('0x6e'))[_0x3af2('0x72')](_0x2b5e27[_0x3af2('0x73')][_0x3af2('0x74')](),_0x3af2('0x6f'))[_0x3af2('0x72')](_0x5ee024[_0x3af2('0x4d')]['id']['toString'](),_0x3af2('0x5b'))[_0x3af2('0x72')](_0x3af2('0x71'),_0x3af2('0x50'))[_0x3af2('0x72')]('NOW()','updatedAt')[_0x3af2('0x75')]('cm_contacts')[_0x3af2('0x39')](_0x3af2('0x77'))[_0x3af2('0x39')](_0x3af2('0x78'),_0x2b5e27['CmListId']['toString']())[_0x3af2('0x39')](_0x3af2('0x79')))[_0x3af2('0x74')]();_0x7aed82[_0x3af2('0x87')](db[_0x3af2('0x88')][_0x3af2('0x31')](_0x15891e));}return BPromise['all'](_0x7aed82);}})[_0x3af2('0x20')](function(){return _0x2acaa7;})['then'](respondWithResult(_0x594b7f,null))[_0x3af2('0x45')](handleError(_0x594b7f,null));};exports['removeBlackLists']=function(_0x38365a,_0x5db0fc,_0x8f4fee){return db['Campaign'][_0x3af2('0x44')]({'where':{'id':_0x38365a[_0x3af2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5db0fc,null))[_0x3af2('0x20')](function(_0x172c91){if(_0x172c91){return _0x172c91[_0x3af2('0x8d')](_0x38365a['query']['ids']);}})['then'](function(_0x4c7d20){if(_0x4c7d20){return db[_0x3af2('0x5e')][_0x3af2('0x21')]({'where':{'ListId':_0x38365a[_0x3af2('0x31')][_0x3af2('0x64')],'CampaignId':_0x38365a[_0x3af2('0x4d')]['id']}})[_0x3af2('0x20')](function(){return _0x4c7d20;});}})['then'](respondWithStatusCode(_0x5db0fc,null))['catch'](handleError(_0x5db0fc,null));}; \ No newline at end of file +var _0xfa12=['format','push','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../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','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','UserProfileSection','findOne','CmHopper','CampaignId','getHopperHistories','sort','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0xfa12,0x1b2));var _0x2fa1=function(_0xa7a094,_0x4b5f74){_0xa7a094=_0xa7a094-0x0;var _0x4f0eae=_0xfa12[_0xa7a094];return _0x4f0eae;};'use strict';var emlformat=require(_0x2fa1('0x0'));var rimraf=require(_0x2fa1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2fa1('0x2'));var rp=require(_0x2fa1('0x3'));var moment=require(_0x2fa1('0x4'));var BPromise=require(_0x2fa1('0x5'));var Mustache=require('mustache');var util=require(_0x2fa1('0x6'));var path=require(_0x2fa1('0x7'));var sox=require(_0x2fa1('0x8'));var csv=require(_0x2fa1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fa1('0xa'));var _=require(_0x2fa1('0xb'));var squel=require('squel');var crypto=require(_0x2fa1('0xc'));var jsforce=require(_0x2fa1('0xd'));var deskjs=require(_0x2fa1('0xe'));var toCsv=require(_0x2fa1('0x9'));var querystring=require('querystring');var Papa=require(_0x2fa1('0xf'));var Redis=require(_0x2fa1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2fa1('0x11'));var as=require(_0x2fa1('0x12'));var hardwareService=require(_0x2fa1('0x13'));var logger=require(_0x2fa1('0x14'))(_0x2fa1('0x15'));var utils=require(_0x2fa1('0x16'));var config=require(_0x2fa1('0x17'));var licenseUtil=require(_0x2fa1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x305bb3,_0x4198e1){_0x4198e1=_0x4198e1||0xcc;return function(_0x311441){if(_0x311441){return _0x305bb3[_0x2fa1('0x19')](_0x4198e1);}return _0x305bb3[_0x2fa1('0x1a')](_0x4198e1)[_0x2fa1('0x1b')]();};}function respondWithResult(_0x567bc5,_0xf81957){_0xf81957=_0xf81957||0xc8;return function(_0x409ea0){if(_0x409ea0){return _0x567bc5[_0x2fa1('0x1a')](_0xf81957)[_0x2fa1('0x1c')](_0x409ea0);}};}function respondWithFilteredResult(_0x5e7ed0,_0x3c79b6){return function(_0x3d6647){if(_0x3d6647){var _0x59aa4d=typeof _0x3c79b6[_0x2fa1('0x1d')]===_0x2fa1('0x1e')&&typeof _0x3c79b6[_0x2fa1('0x1f')]===_0x2fa1('0x1e');var _0xaf39c7=_0x3d6647[_0x2fa1('0x20')];var _0x21004a=_0x59aa4d?0x0:_0x3c79b6[_0x2fa1('0x1d')];var _0x4d16ac=_0x59aa4d?_0x3d6647[_0x2fa1('0x20')]:_0x3c79b6['offset']+_0x3c79b6['limit'];var _0x18d225;if(_0x4d16ac>=_0xaf39c7){_0x4d16ac=_0xaf39c7;_0x18d225=0xc8;}else{_0x18d225=0xce;}_0x5e7ed0[_0x2fa1('0x1a')](_0x18d225);return _0x5e7ed0[_0x2fa1('0x21')](_0x2fa1('0x22'),_0x21004a+'-'+_0x4d16ac+'/'+_0xaf39c7)[_0x2fa1('0x1c')](_0x3d6647);}return null;};}function patchUpdates(_0x5c451e){return function(_0x23f0d2){try{jsonpatch['apply'](_0x23f0d2,_0x5c451e,!![]);}catch(_0x22e15f){return BPromise[_0x2fa1('0x23')](_0x22e15f);}return _0x23f0d2[_0x2fa1('0x24')]();};}function saveUpdates(_0x245898,_0x24fe15){return function(_0x3fa70d){if(_0x3fa70d){return _0x3fa70d[_0x2fa1('0x25')](_0x245898)[_0x2fa1('0x26')](function(_0x2e95f0){return _0x2e95f0;});}return null;};}function removeEntity(_0x15037c,_0x5021fb){return function(_0x1eaa57){if(_0x1eaa57){return _0x1eaa57['destroy']()['then'](function(){var _0x5e255a=_0x1eaa57[_0x2fa1('0x27')]({'plain':!![]});var _0x5c89fc='IvrCampaigns';return db[_0x2fa1('0x28')][_0x2fa1('0x29')]({'where':{'type':_0x5c89fc,'resourceId':_0x5e255a['id']}})[_0x2fa1('0x26')](function(){return _0x1eaa57;});})[_0x2fa1('0x26')](function(){_0x15037c[_0x2fa1('0x1a')](0xcc)[_0x2fa1('0x1b')]();});}};}function handleEntityNotFound(_0x294c29,_0x39d083){return function(_0x255974){if(!_0x255974){_0x294c29[_0x2fa1('0x19')](0x194);}return _0x255974;};}function handleError(_0x28f35e,_0x28300d){_0x28300d=_0x28300d||0x1f4;return function(_0x16c050){logger[_0x2fa1('0x2a')](_0x16c050[_0x2fa1('0x2b')]);if(_0x16c050[_0x2fa1('0x2c')]){delete _0x16c050[_0x2fa1('0x2c')];}_0x28f35e[_0x2fa1('0x1a')](_0x28300d)['send'](_0x16c050);};}exports[_0x2fa1('0x2d')]=function(_0x1860a0,_0x4bf6b5){var _0x1bf81b={},_0x489cbe={},_0x33eff1={'count':0x0,'rows':[]};var _0x2da397=_[_0x2fa1('0x2e')](db['Campaign'][_0x2fa1('0x2f')],function(_0x345b81){return{'name':_0x345b81[_0x2fa1('0x30')],'type':_0x345b81[_0x2fa1('0x31')]['key']};});_0x489cbe[_0x2fa1('0x32')]=_[_0x2fa1('0x2e')](_0x2da397,'name');_0x489cbe[_0x2fa1('0x33')]=_['keys'](_0x1860a0[_0x2fa1('0x33')]);_0x489cbe[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x489cbe[_0x2fa1('0x32')],_0x489cbe[_0x2fa1('0x33')]);_0x1bf81b[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x489cbe[_0x2fa1('0x32')],qs['fields'](_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x1bf81b['attributes']=_0x1bf81b[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x1bf81b[_0x2fa1('0x36')]:_0x489cbe[_0x2fa1('0x32')];if(!_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x1bf81b[_0x2fa1('0x1f')]=qs['limit'](_0x1860a0['query']['limit']);_0x1bf81b[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x1860a0['query']['offset']);}_0x1bf81b[_0x2fa1('0x3b')]=qs['sort'](_0x1860a0[_0x2fa1('0x33')]['sort']);_0x1bf81b[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x1860a0[_0x2fa1('0x33')],_0x489cbe['filters']),_0x2da397);if(_0x1860a0['query'][_0x2fa1('0x3e')]){_0x1bf81b[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x1bf81b[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x2da397,function(_0x119db6){if(_0x119db6[_0x2fa1('0x31')]!==_0x2fa1('0x40')){var _0x50a769={};_0x50a769[_0x119db6[_0x2fa1('0x2c')]]={'$like':'%'+_0x1860a0[_0x2fa1('0x33')]['filter']+'%'};return _0x50a769;}})});}_0x1bf81b=_[_0x2fa1('0x3f')]({},_0x1bf81b,_0x1860a0[_0x2fa1('0x41')]);var _0x2c2bcb={'where':_0x1bf81b[_0x2fa1('0x3c')]};return db[_0x2fa1('0x42')][_0x2fa1('0x20')](_0x2c2bcb)[_0x2fa1('0x26')](function(_0x5154b7){_0x33eff1[_0x2fa1('0x20')]=_0x5154b7;if(_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x1bf81b[_0x2fa1('0x44')]=[{'all':!![]}];}return db['Campaign'][_0x2fa1('0x45')](_0x1bf81b);})[_0x2fa1('0x26')](function(_0x1180eb){_0x33eff1[_0x2fa1('0x46')]=_0x1180eb;return _0x33eff1;})['then'](respondWithFilteredResult(_0x4bf6b5,_0x1bf81b))[_0x2fa1('0x47')](handleError(_0x4bf6b5,null));};exports[_0x2fa1('0x48')]=function(_0x8d92b6,_0x197dcf){var _0x422807={'raw':![],'where':{'id':_0x8d92b6[_0x2fa1('0x49')]['id']}},_0x2c4453={};_0x2c4453[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db[_0x2fa1('0x42')]['rawAttributes']);_0x2c4453['query']=_['keys'](_0x8d92b6[_0x2fa1('0x33')]);_0x2c4453['filters']=_['intersection'](_0x2c4453['model'],_0x2c4453[_0x2fa1('0x33')]);_0x422807[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x2c4453[_0x2fa1('0x32')],qs['fields'](_0x8d92b6[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x422807[_0x2fa1('0x36')]=_0x422807[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x422807[_0x2fa1('0x36')]:_0x2c4453[_0x2fa1('0x32')];if(_0x8d92b6[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x422807[_0x2fa1('0x44')]=[{'all':!![]}];}_0x422807=_['merge']({},_0x422807,_0x8d92b6[_0x2fa1('0x41')]);return db[_0x2fa1('0x42')][_0x2fa1('0x4b')](_0x422807)[_0x2fa1('0x26')](handleEntityNotFound(_0x197dcf,null))[_0x2fa1('0x26')](respondWithResult(_0x197dcf,null))['catch'](handleError(_0x197dcf,null));};exports[_0x2fa1('0x4c')]=function(_0x2410e4,_0x1b8556){return db[_0x2fa1('0x42')]['create'](_0x2410e4['body'],{})[_0x2fa1('0x26')](function(_0x4c5562){var _0x2a4fc7=_0x2410e4[_0x2fa1('0x4d')][_0x2fa1('0x27')]({'plain':!![]});if(!_0x2a4fc7)throw new Error(_0x2fa1('0x4e'));if(_0x2a4fc7[_0x2fa1('0x4f')]===_0x2fa1('0x4d')){var _0x5198b1=_0x4c5562['get']({'plain':!![]});var _0x4ca733='IvrCampaigns';return db['UserProfileSection'][_0x2fa1('0x4b')]({'where':{'name':_0x4ca733,'userProfileId':_0x2a4fc7[_0x2fa1('0x50')]},'raw':!![]})[_0x2fa1('0x26')](function(_0x367c2e){if(_0x367c2e&&_0x367c2e[_0x2fa1('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5198b1['name'],'resourceId':_0x5198b1['id'],'type':_0x367c2e[_0x2fa1('0x2c')],'sectionId':_0x367c2e['id']},{})[_0x2fa1('0x26')](function(){return _0x4c5562;});}else{return _0x4c5562;}})['catch'](function(_0x129b9b){logger[_0x2fa1('0x2a')](_0x2fa1('0x52'),_0x129b9b);throw _0x129b9b;});}return _0x4c5562;})[_0x2fa1('0x26')](respondWithResult(_0x1b8556,0xc9))[_0x2fa1('0x47')](handleError(_0x1b8556,null));};exports['clone']=function(_0x3b1923,_0x38c5ac){var _0x4b78e2={'where':{'id':_0x3b1923[_0x2fa1('0x49')]['id']}},_0x499840={};_0x499840[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db['Campaign'][_0x2fa1('0x2f')]);_0x4b78e2[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x499840[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x3b1923['query'][_0x2fa1('0x37')]));_0x4b78e2[_0x2fa1('0x36')]=_0x4b78e2['attributes'][_0x2fa1('0x38')]?_0x4b78e2[_0x2fa1('0x36')]:_0x499840[_0x2fa1('0x32')];if(_0x3b1923[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x4b78e2[_0x2fa1('0x44')]=[{'all':!![]}];}_0x4b78e2=_['merge']({},_0x4b78e2,_0x3b1923[_0x2fa1('0x41')]);return db['Campaign']['find'](_0x4b78e2)['then'](handleEntityNotFound(_0x38c5ac,null))[_0x2fa1('0x26')](function(_0x54da3f){if(_0x54da3f){var _0x57f47c=_0x54da3f[_0x2fa1('0x27')]({'plain':!![]});_0x57f47c=qs[_0x2fa1('0x53')](_0x57f47c,['id',_0x2fa1('0x54'),_0x2fa1('0x55')]);_0x3b1923[_0x2fa1('0x56')]=_[_0x2fa1('0x53')](_0x3b1923['body'],['id','createdAt','updatedAt']);return db[_0x2fa1('0x42')]['create'](_[_0x2fa1('0x3f')](_0x57f47c,_0x3b1923[_0x2fa1('0x56')]),{'include':_0x3b1923[_0x2fa1('0x33')][_0x2fa1('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x31bfe1){var _0xfa7a69=_0x3b1923['user'][_0x2fa1('0x27')]({'plain':!![]});if(!_0xfa7a69)throw new Error(_0x2fa1('0x4e'));if(_0xfa7a69[_0x2fa1('0x4f')]===_0x2fa1('0x4d')){var _0x5e8938=_0x31bfe1[_0x2fa1('0x27')]({'plain':!![]});var _0x52694c='IvrCampaigns';return db[_0x2fa1('0x57')][_0x2fa1('0x4b')]({'where':{'name':_0x52694c,'userProfileId':_0xfa7a69['userProfileId']},'raw':!![]})['then'](function(_0x59d74f){if(_0x59d74f&&_0x59d74f[_0x2fa1('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e8938[_0x2fa1('0x2c')],'resourceId':_0x5e8938['id'],'type':_0x59d74f[_0x2fa1('0x2c')],'sectionId':_0x59d74f['id']},{})[_0x2fa1('0x26')](function(){return _0x31bfe1;});}else{return _0x31bfe1;}})[_0x2fa1('0x47')](function(_0x14c829){logger['error'](_0x2fa1('0x52'),_0x14c829);throw _0x14c829;});}return _0x31bfe1;});}})[_0x2fa1('0x26')](respondWithResult(_0x38c5ac,0xc9))[_0x2fa1('0x47')](handleError(_0x38c5ac,null));};exports[_0x2fa1('0x25')]=function(_0x4e8d81,_0x91bd89){if(_0x4e8d81[_0x2fa1('0x56')]['id']){delete _0x4e8d81[_0x2fa1('0x56')]['id'];}return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x4e8d81[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x91bd89,null))[_0x2fa1('0x26')](saveUpdates(_0x4e8d81[_0x2fa1('0x56')],null))[_0x2fa1('0x26')](respondWithResult(_0x91bd89,null))['catch'](handleError(_0x91bd89,null));};exports['destroy']=function(_0x859f00,_0x2de879){return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x859f00['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x2de879,null))[_0x2fa1('0x26')](removeEntity(_0x2de879,null))[_0x2fa1('0x47')](handleError(_0x2de879,null));};exports['getHoppers']=function(_0x53c36e,_0x35b9a7,_0x4d292e){var _0x521fa9={'raw':!![],'where':{}};var _0x3e919e={};var _0x424ebc={'count':0x0,'rows':[]};return db[_0x2fa1('0x42')][_0x2fa1('0x58')]({'where':{'id':_0x53c36e['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x35b9a7,null))['then'](function(_0x4df9d8){if(_0x4df9d8){_0x3e919e[_0x2fa1('0x32')]=_['keys'](db[_0x2fa1('0x59')][_0x2fa1('0x2f')]);_0x3e919e['query']=_[_0x2fa1('0x4a')](_0x53c36e[_0x2fa1('0x33')]);_0x3e919e[_0x2fa1('0x34')]=_['intersection'](_0x3e919e['model'],_0x3e919e[_0x2fa1('0x33')]);_0x521fa9['attributes']=_[_0x2fa1('0x35')](_0x3e919e[_0x2fa1('0x32')],qs['fields'](_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x521fa9[_0x2fa1('0x36')]=_0x521fa9[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x521fa9[_0x2fa1('0x36')]:_0x3e919e[_0x2fa1('0x32')];if(!_0x53c36e['query'][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x521fa9[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x53c36e['query'][_0x2fa1('0x1f')]);_0x521fa9[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0x521fa9[_0x2fa1('0x3b')]=qs['sort'](_0x53c36e[_0x2fa1('0x33')]['sort']);_0x521fa9[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_['pick'](_0x53c36e[_0x2fa1('0x33')],_0x3e919e[_0x2fa1('0x34')]));_0x521fa9[_0x2fa1('0x3c')][_0x2fa1('0x5a')]=_0x4df9d8['id'];if(_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x521fa9[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x521fa9['where'],{'$or':_[_0x2fa1('0x2e')](_0x521fa9[_0x2fa1('0x36')],function(_0x504759){var _0x31cc1c={};_0x31cc1c[_0x504759]={'$like':'%'+_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x31cc1c;})});}_0x521fa9=_[_0x2fa1('0x3f')]({},_0x521fa9,_0x53c36e[_0x2fa1('0x41')]);return db['CmHopper'][_0x2fa1('0x20')]({'where':_0x521fa9['where']})[_0x2fa1('0x26')](function(_0x73d040){_0x424ebc[_0x2fa1('0x20')]=_0x73d040;if(_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x521fa9[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x2fa1('0x45')](_0x521fa9);})[_0x2fa1('0x26')](function(_0x2acb1e){_0x424ebc['rows']=_0x2acb1e;return _0x424ebc;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x35b9a7,_0x521fa9))[_0x2fa1('0x47')](handleError(_0x35b9a7,null));};exports[_0x2fa1('0x5b')]=function(_0x1eb73,_0x36dbbb,_0x29f6f5){var _0x100fc4={'raw':!![],'where':{}};var _0x77fa71={};var _0x57479b={'count':0x0,'rows':[]};return db['Campaign'][_0x2fa1('0x58')]({'where':{'id':_0x1eb73['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x36dbbb,null))['then'](function(_0x2ba1f5){if(_0x2ba1f5){_0x77fa71[_0x2fa1('0x32')]=_['keys'](db['CmHopperHistory'][_0x2fa1('0x2f')]);_0x77fa71[_0x2fa1('0x33')]=_['keys'](_0x1eb73[_0x2fa1('0x33')]);_0x77fa71[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x77fa71[_0x2fa1('0x32')],_0x77fa71['query']);_0x100fc4['attributes']=_[_0x2fa1('0x35')](_0x77fa71[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x1eb73[_0x2fa1('0x33')]['fields']));_0x100fc4['attributes']=_0x100fc4['attributes'][_0x2fa1('0x38')]?_0x100fc4['attributes']:_0x77fa71[_0x2fa1('0x32')];if(!_0x1eb73[_0x2fa1('0x33')]['hasOwnProperty'](_0x2fa1('0x3a'))){_0x100fc4[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x100fc4[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0x100fc4[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0x100fc4[_0x2fa1('0x3c')]=qs['filters'](_[_0x2fa1('0x3d')](_0x1eb73[_0x2fa1('0x33')],_0x77fa71[_0x2fa1('0x34')]));_0x100fc4['where']['CampaignId']=_0x2ba1f5['id'];if(_0x1eb73[_0x2fa1('0x33')]['filter']){_0x100fc4[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x100fc4[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x100fc4['attributes'],function(_0x3fb815){var _0x42d027={};_0x42d027[_0x3fb815]={'$like':'%'+_0x1eb73['query']['filter']+'%'};return _0x42d027;})});}_0x100fc4=_[_0x2fa1('0x3f')]({},_0x100fc4,_0x1eb73['options']);return db[_0x2fa1('0x5d')]['count']({'where':_0x100fc4[_0x2fa1('0x3c')]})[_0x2fa1('0x26')](function(_0x4f446c){_0x57479b[_0x2fa1('0x20')]=_0x4f446c;if(_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x100fc4[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x100fc4);})[_0x2fa1('0x26')](function(_0x3f02ef){_0x57479b[_0x2fa1('0x46')]=_0x3f02ef;return _0x57479b;});}})['then'](respondWithFilteredResult(_0x36dbbb,_0x100fc4))[_0x2fa1('0x47')](handleError(_0x36dbbb,null));};exports[_0x2fa1('0x5e')]=function(_0x4b2686,_0x33f181,_0x511aeb){var _0x268fea={'raw':!![],'where':{}};var _0x40021f={};var _0x56b98b={'count':0x0,'rows':[]};return db[_0x2fa1('0x42')]['findOne']({'where':{'id':_0x4b2686[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x33f181,null))[_0x2fa1('0x26')](function(_0x160733){if(_0x160733){_0x40021f['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x40021f['query']=_['keys'](_0x4b2686['query']);_0x40021f[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x40021f[_0x2fa1('0x32')],_0x40021f[_0x2fa1('0x33')]);_0x268fea['attributes']=_[_0x2fa1('0x35')](_0x40021f[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x268fea['attributes']=_0x268fea[_0x2fa1('0x36')]['length']?_0x268fea[_0x2fa1('0x36')]:_0x40021f[_0x2fa1('0x32')];if(!_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x268fea['limit']=qs['limit'](_0x4b2686['query'][_0x2fa1('0x1f')]);_0x268fea[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x4b2686['query'][_0x2fa1('0x1d')]);}_0x268fea[_0x2fa1('0x3b')]=qs['sort'](_0x4b2686['query'][_0x2fa1('0x5c')]);_0x268fea[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x4b2686['query'],_0x40021f[_0x2fa1('0x34')]));_0x268fea['where'][_0x2fa1('0x5a')]=_0x160733['id'];if(_0x4b2686['query'][_0x2fa1('0x3e')]){_0x268fea[_0x2fa1('0x3c')]=_['merge'](_0x268fea[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x268fea[_0x2fa1('0x36')],function(_0xfd138e){var _0x34084f={};_0x34084f[_0xfd138e]={'$like':'%'+_0x4b2686[_0x2fa1('0x33')]['filter']+'%'};return _0x34084f;})});}_0x268fea=_['merge']({},_0x268fea,_0x4b2686[_0x2fa1('0x41')]);return db[_0x2fa1('0x5f')]['count']({'where':_0x268fea[_0x2fa1('0x3c')]})[_0x2fa1('0x26')](function(_0x546c02){_0x56b98b[_0x2fa1('0x20')]=_0x546c02;if(_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x268fea[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x2fa1('0x45')](_0x268fea);})[_0x2fa1('0x26')](function(_0x4e6e0a){_0x56b98b[_0x2fa1('0x46')]=_0x4e6e0a;return _0x56b98b;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x33f181,_0x268fea))['catch'](handleError(_0x33f181,null));};exports[_0x2fa1('0x60')]=function(_0x281ab0,_0x41f5ad,_0x3f6dc6){var _0xbf35f2={'raw':!![],'where':{}};var _0xc1562c={};var _0x2e057e={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x281ab0[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x41f5ad,null))[_0x2fa1('0x26')](function(_0x3e8c84){if(_0x3e8c84){_0xc1562c[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db[_0x2fa1('0x61')]['rawAttributes']);_0xc1562c[_0x2fa1('0x33')]=_[_0x2fa1('0x4a')](_0x281ab0[_0x2fa1('0x33')]);_0xc1562c['filters']=_[_0x2fa1('0x35')](_0xc1562c[_0x2fa1('0x32')],_0xc1562c['query']);_0xbf35f2[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0xc1562c[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0xbf35f2[_0x2fa1('0x36')]=_0xbf35f2[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0xbf35f2[_0x2fa1('0x36')]:_0xc1562c[_0x2fa1('0x32')];if(!_0x281ab0[_0x2fa1('0x33')]['hasOwnProperty'](_0x2fa1('0x3a'))){_0xbf35f2[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0xbf35f2[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0xbf35f2[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0xbf35f2[_0x2fa1('0x3c')]=qs['filters'](_['pick'](_0x281ab0[_0x2fa1('0x33')],_0xc1562c['filters']));_0xbf35f2[_0x2fa1('0x3c')]['CampaignId']=_0x3e8c84['id'];if(_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0xbf35f2['where']=_[_0x2fa1('0x3f')](_0xbf35f2[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0xbf35f2[_0x2fa1('0x36')],function(_0x4d46f6){var _0x534331={};_0x534331[_0x4d46f6]={'$like':'%'+_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x534331;})});}_0xbf35f2=_[_0x2fa1('0x3f')]({},_0xbf35f2,_0x281ab0['options']);return db[_0x2fa1('0x61')][_0x2fa1('0x20')]({'where':_0xbf35f2['where']})[_0x2fa1('0x26')](function(_0xc761a1){_0x2e057e[_0x2fa1('0x20')]=_0xc761a1;if(_0x281ab0['query'][_0x2fa1('0x43')]){_0xbf35f2[_0x2fa1('0x44')]=[{'all':!![]}];}return db[_0x2fa1('0x61')][_0x2fa1('0x45')](_0xbf35f2);})[_0x2fa1('0x26')](function(_0x40f293){_0x2e057e[_0x2fa1('0x46')]=_0x40f293;return _0x2e057e;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x41f5ad,_0xbf35f2))[_0x2fa1('0x47')](handleError(_0x41f5ad,null));};exports['getLists']=function(_0xec70d9,_0x58f7db,_0xdc7f5d){var _0x49c8d3={};var _0x3572f9={};var _0xd68af4;var _0x181772;return db[_0x2fa1('0x42')][_0x2fa1('0x58')]({'where':{'id':_0xec70d9[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x58f7db,null))[_0x2fa1('0x26')](function(_0x357e19){if(_0x357e19){_0xd68af4=_0x357e19;_0x3572f9['model']=_[_0x2fa1('0x4a')](db[_0x2fa1('0x62')][_0x2fa1('0x2f')]);_0x3572f9[_0x2fa1('0x33')]=_['keys'](_0xec70d9[_0x2fa1('0x33')]);_0x3572f9[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x3572f9[_0x2fa1('0x32')],_0x3572f9[_0x2fa1('0x33')]);_0x49c8d3[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x3572f9[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x49c8d3[_0x2fa1('0x36')]=_0x49c8d3['attributes'][_0x2fa1('0x38')]?_0x49c8d3[_0x2fa1('0x36')]:_0x3572f9['model'];_0x49c8d3[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0x49c8d3['where']=qs['filters'](_[_0x2fa1('0x3d')](_0xec70d9[_0x2fa1('0x33')],_0x3572f9[_0x2fa1('0x34')]));if(_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x49c8d3['where']=_[_0x2fa1('0x3f')](_0x49c8d3[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x49c8d3[_0x2fa1('0x36')],function(_0x28d67b){var _0x2697bd={};_0x2697bd[_0x28d67b]={'$like':'%'+_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x2697bd;})});}_0x49c8d3=_[_0x2fa1('0x3f')]({},_0x49c8d3,_0xec70d9[_0x2fa1('0x41')]);return _0xd68af4[_0x2fa1('0x63')](_0x49c8d3);}})['then'](function(_0x3f178d){if(_0x3f178d){_0x181772=_0x3f178d['length'];if(!_0xec70d9['query']['hasOwnProperty'](_0x2fa1('0x3a'))){_0x49c8d3[_0x2fa1('0x1f')]=qs['limit'](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x49c8d3[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0xec70d9[_0x2fa1('0x33')]['offset']);}return _0xd68af4[_0x2fa1('0x63')](_0x49c8d3);}})[_0x2fa1('0x26')](function(_0x1136da){if(_0x1136da){return _0x1136da?{'count':_0x181772,'rows':_0x1136da}:null;}})['then'](respondWithResult(_0x58f7db,null))[_0x2fa1('0x47')](handleError(_0x58f7db,null));};exports[_0x2fa1('0x64')]=function(_0x514c96,_0x50a1f0,_0x317e71){var _0x112ad6,_0x57d3e0;var _0x1a0a85=[];var _0x1a07b6=moment()['format'](_0x2fa1('0x65'));return db['Campaign'][_0x2fa1('0x4b')]({'where':{'id':_0x514c96[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x50a1f0,null))['then'](function(_0x4b4a98){if(_0x4b4a98){_0x57d3e0=_0x4b4a98;return _0x4b4a98[_0x2fa1('0x64')](_0x514c96[_0x2fa1('0x56')]['ids'],_[_0x2fa1('0x53')](_0x514c96[_0x2fa1('0x56')],[_0x2fa1('0x66'),'id'])||{});}return null;})[_0x2fa1('0x67')](function(_0x4c2f9b){var _0x420fe8;var _0x30fd19;_0x112ad6=_0x4c2f9b||[];var _0xf9d8d1=[];if(_0x4c2f9b){for(var _0x541964=0x0;_0x541964<_0x4c2f9b['length'];_0x541964+=0x1){var _0x227c57=_0x4c2f9b[_0x541964][_0x2fa1('0x27')]({'plain':!![]});_0x57d3e0['dialCheckDuplicateType']=_0x514c96[_0x2fa1('0x56')][_0x2fa1('0x68')]?_0x514c96[_0x2fa1('0x56')]['dialCheckDuplicateType']:_0x57d3e0[_0x2fa1('0x68')];switch(_0x57d3e0[_0x2fa1('0x68')]){case _0x2fa1('0x69'):_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper')[_0x2fa1('0x6c')](['phone',_0x2fa1('0x6d'),_0x2fa1('0x6e'),_0x2fa1('0x6f'),_0x2fa1('0x5a'),'createdAt','updatedAt'],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')](_0x2fa1('0x72'),'phone')['field'](_0x2fa1('0x73'),'scheduledAt')[_0x2fa1('0x71')]('id',_0x2fa1('0x6e'))[_0x2fa1('0x71')](_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))[_0x2fa1('0x71')](_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')](),_0x2fa1('0x5a'))['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27','updatedAt')[_0x2fa1('0x76')](_0x2fa1('0x77'))[_0x2fa1('0x3c')](_0x2fa1('0x78'))[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')](_0x2fa1('0x7b'))['from']('cm_hopper_final')[_0x2fa1('0x3c')](_0x2fa1('0x7c'),_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')]()))[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel[_0x2fa1('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x2fa1('0x76')](_0x2fa1('0x7d'))[_0x2fa1('0x3c')]('CampaignId\x20=\x20?',_0x514c96[_0x2fa1('0x49')]['id']['toString']())))[_0x2fa1('0x75')]();break;case _0x2fa1('0x7e'):_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')](_0x2fa1('0x7d'))['fromQuery'](['phone','scheduledAt',_0x2fa1('0x6e'),_0x2fa1('0x6f'),_0x2fa1('0x5a'),'createdAt',_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()['field'](_0x2fa1('0x72'),_0x2fa1('0x72'))[_0x2fa1('0x71')]('NOW()',_0x2fa1('0x6d'))[_0x2fa1('0x71')]('id',_0x2fa1('0x6e'))['field'](_0x227c57[_0x2fa1('0x74')]['toString'](),'ListId')[_0x2fa1('0x71')](_0x514c96['params']['id']['toString'](),_0x2fa1('0x5a'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x55'))['from']('cm_contacts')['where'](_0x2fa1('0x78'))[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')]())['where'](_0x2fa1('0x7f'))[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel['select']()[_0x2fa1('0x71')](_0x2fa1('0x80'))['from'](_0x2fa1('0x7d'))[_0x2fa1('0x3c')](_0x2fa1('0x7c'),_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')]())))[_0x2fa1('0x75')]();break;default:_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')](_0x2fa1('0x7d'))[_0x2fa1('0x6c')]([_0x2fa1('0x72'),'scheduledAt',_0x2fa1('0x6e'),'ListId','CampaignId',_0x2fa1('0x54'),_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')]('phone',_0x2fa1('0x72'))[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x6d'))['field']('id',_0x2fa1('0x6e'))[_0x2fa1('0x71')](_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))[_0x2fa1('0x71')](_0x514c96['params']['id']['toString'](),_0x2fa1('0x5a'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x55'))[_0x2fa1('0x76')](_0x2fa1('0x77'))[_0x2fa1('0x3c')]('deletedAt\x20IS\x20NULL')[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57[_0x2fa1('0x74')]['toString']())[_0x2fa1('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x2fa1('0x75')]();}_0x30fd19=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper_additional_phones')[_0x2fa1('0x6c')]([_0x2fa1('0x81'),_0x2fa1('0x6d'),_0x2fa1('0x72'),_0x2fa1('0x82'),'createdAt',_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')]('h.id','id')[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x6d'))[_0x2fa1('0x71')](_0x2fa1('0x83'),_0x2fa1('0x72'))['field'](_0x2fa1('0x84'),'OrderBy')['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27','updatedAt')['from'](_0x2fa1('0x85'),'ci')[_0x2fa1('0x86')](_0x2fa1('0x7d'),'h',_0x2fa1('0x87'))[_0x2fa1('0x3c')]('h.ListId\x20=\x20?',_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')]())['where']('h.CampaignId=?',_0x514c96[_0x2fa1('0x49')]['id']['toString']())[_0x2fa1('0x3c')](_0x2fa1('0x88'),_0x1a07b6))[_0x2fa1('0x75')]();_0xf9d8d1['push'](db['sequelize'][_0x2fa1('0x33')](_0x420fe8));_0x1a0a85['push'](db[_0x2fa1('0x89')][_0x2fa1('0x33')](_0x30fd19));}return BPromise[_0x2fa1('0x8a')](_0xf9d8d1);}})[_0x2fa1('0x26')](function(){return BPromise[_0x2fa1('0x8a')](_0x1a0a85);})[_0x2fa1('0x26')](function(){return _0x112ad6;})[_0x2fa1('0x26')](respondWithResult(_0x50a1f0,null))['catch'](handleError(_0x50a1f0,null));};exports[_0x2fa1('0x8b')]=function(_0x51f490,_0xdabaa9,_0x56a7ae){return db['Campaign'][_0x2fa1('0x4b')]({'where':{'id':_0x51f490[_0x2fa1('0x49')]['id']}})['then'](handleEntityNotFound(_0xdabaa9,null))[_0x2fa1('0x26')](function(_0x3bc618){if(_0x3bc618){return _0x3bc618[_0x2fa1('0x8b')](_0x51f490[_0x2fa1('0x33')][_0x2fa1('0x66')]);}})['then'](function(_0x217644){if(_0x217644){return db[_0x2fa1('0x59')][_0x2fa1('0x29')]({'where':{'ListId':_0x51f490[_0x2fa1('0x33')][_0x2fa1('0x66')],'CampaignId':_0x51f490['params']['id']}})['then'](function(){return _0x217644;});}})[_0x2fa1('0x26')](respondWithStatusCode(_0xdabaa9,null))[_0x2fa1('0x47')](handleError(_0xdabaa9,null));};exports['getBlackLists']=function(_0x2588b9,_0x16aa12,_0x9f0835){var _0x10eb99={};var _0x39a45a={};var _0x398d4e;var _0x1abedd;return db['Campaign'][_0x2fa1('0x58')]({'where':{'id':_0x2588b9[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x16aa12,null))[_0x2fa1('0x26')](function(_0x4bdf1e){if(_0x4bdf1e){_0x398d4e=_0x4bdf1e;_0x39a45a['model']=_['keys'](db['CmList']['rawAttributes']);_0x39a45a[_0x2fa1('0x33')]=_['keys'](_0x2588b9[_0x2fa1('0x33')]);_0x39a45a['filters']=_[_0x2fa1('0x35')](_0x39a45a[_0x2fa1('0x32')],_0x39a45a[_0x2fa1('0x33')]);_0x10eb99[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x39a45a[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x10eb99[_0x2fa1('0x36')]=_0x10eb99[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x10eb99[_0x2fa1('0x36')]:_0x39a45a[_0x2fa1('0x32')];_0x10eb99[_0x2fa1('0x3b')]=qs['sort'](_0x2588b9[_0x2fa1('0x33')]['sort']);_0x10eb99['where']=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x2588b9[_0x2fa1('0x33')],_0x39a45a[_0x2fa1('0x34')]));if(_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x10eb99[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x10eb99['where'],{'$or':_[_0x2fa1('0x2e')](_0x10eb99[_0x2fa1('0x36')],function(_0x17ae92){var _0x942423={};_0x942423[_0x17ae92]={'$like':'%'+_0x2588b9[_0x2fa1('0x33')]['filter']+'%'};return _0x942423;})});}_0x10eb99=_[_0x2fa1('0x3f')]({},_0x10eb99,_0x2588b9[_0x2fa1('0x41')]);return _0x398d4e[_0x2fa1('0x8c')](_0x10eb99);}})[_0x2fa1('0x26')](function(_0x3eddf0){if(_0x3eddf0){_0x1abedd=_0x3eddf0['length'];if(!_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x10eb99[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x10eb99[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x2588b9['query']['offset']);}return _0x398d4e['getBlackLists'](_0x10eb99);}})[_0x2fa1('0x26')](function(_0x3fdbf1){if(_0x3fdbf1){return _0x3fdbf1?{'count':_0x1abedd,'rows':_0x3fdbf1}:null;}})[_0x2fa1('0x26')](respondWithResult(_0x16aa12,null))[_0x2fa1('0x47')](handleError(_0x16aa12,null));};exports[_0x2fa1('0x8d')]=function(_0x388317,_0x413113,_0x2770fb){var _0x3e7dfd,_0x35e40b;var _0x53a5c7=[];var _0x10cbfb=moment()[_0x2fa1('0x8e')](_0x2fa1('0x65'));return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x388317[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x413113,null))['then'](function(_0x51b9e4){if(_0x51b9e4){_0x35e40b=_0x51b9e4;return _0x51b9e4[_0x2fa1('0x8d')](_0x388317['body']['ids'],_['omit'](_0x388317[_0x2fa1('0x56')],[_0x2fa1('0x66'),'id'])||{});}return null;})['spread'](function(_0x442806){var _0x3365a9;var _0xae739d;_0x3e7dfd=_0x442806||[];var _0x17fcaf=[];if(_0x442806){for(var _0xe3fa13=0x0;_0xe3fa13<_0x442806[_0x2fa1('0x38')];_0xe3fa13+=0x1){var _0x431f49=_0x442806[_0xe3fa13][_0x2fa1('0x27')]({'plain':!![]});_0x3365a9=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper_black')[_0x2fa1('0x6c')]([_0x2fa1('0x72'),'ContactId',_0x2fa1('0x6f'),_0x2fa1('0x5a'),_0x2fa1('0x54'),_0x2fa1('0x55')],squel['select']()[_0x2fa1('0x71')](_0x2fa1('0x72'),_0x2fa1('0x72'))['field']('id','ContactId')['field'](_0x431f49[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))['field'](_0x388317[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')](),_0x2fa1('0x5a'))[_0x2fa1('0x71')](_0x2fa1('0x73'),'createdAt')[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x55'))[_0x2fa1('0x76')](_0x2fa1('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x2fa1('0x3c')]('ListId\x20=\x20?',_0x431f49[_0x2fa1('0x74')][_0x2fa1('0x75')]())[_0x2fa1('0x3c')](_0x2fa1('0x7f')))[_0x2fa1('0x75')]();_0x17fcaf[_0x2fa1('0x8f')](db[_0x2fa1('0x89')][_0x2fa1('0x33')](_0x3365a9));}return BPromise[_0x2fa1('0x8a')](_0x17fcaf);}})['then'](function(){return _0x3e7dfd;})[_0x2fa1('0x26')](respondWithResult(_0x413113,null))[_0x2fa1('0x47')](handleError(_0x413113,null));};exports['removeBlackLists']=function(_0x5e1947,_0x2f19c6,_0x379950){return db[_0x2fa1('0x42')]['find']({'where':{'id':_0x5e1947[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x2f19c6,null))['then'](function(_0x3b7a83){if(_0x3b7a83){return _0x3b7a83['removeBlackLists'](_0x5e1947[_0x2fa1('0x33')]['ids']);}})['then'](function(_0x10c626){if(_0x10c626){return db[_0x2fa1('0x61')]['destroy']({'where':{'ListId':_0x5e1947[_0x2fa1('0x33')][_0x2fa1('0x66')],'CampaignId':_0x5e1947[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](function(){return _0x10c626;});}})[_0x2fa1('0x26')](respondWithStatusCode(_0x2f19c6,null))[_0x2fa1('0x47')](handleError(_0x2f19c6,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3e8ae0c..9015a93 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x69d88,_0x290f5c){var _0x321cc4=function(_0x302640){while(--_0x302640){_0x69d88['push'](_0x69d88['shift']());}};_0x321cc4(++_0x290f5c);}(_0x7a54,0x106));var _0x47a5=function(_0x4d5707,_0x13bf3c){_0x4d5707=_0x4d5707-0x0;var _0x152f64=_0x7a54[_0x4d5707];return _0x152f64;};'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 fd35680..4accee4 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 _0xf021=['randomstring','../../mysqldb','../../config/logger','rpc','client','then','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','Campaign,\x20%s,\x20%s','result','catch','Campaign','findAll','options','where','attributes','limit','include','map','model','GetCampaign','lodash','util','moment','bluebird'];(function(_0x4ec10b,_0x8e72c0){var _0x2dd0fd=function(_0x22b9ad){while(--_0x22b9ad){_0x4ec10b['push'](_0x4ec10b['shift']());}};_0x2dd0fd(++_0x8e72c0);}(_0xf021,0x18f));var _0x1f02=function(_0x155a36,_0x4bf39){_0x155a36=_0x155a36-0x0;var _0x3c99d0=_0xf021[_0x155a36];return _0x3c99d0;};'use strict';var _=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var moment=require(_0x1f02('0x2'));var BPromise=require(_0x1f02('0x3'));var rs=require(_0x1f02('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f02('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f02('0x6'))(_0x1f02('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f02('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x383d0b,_0x257d6a,_0x2a6c50){return new BPromise(function(_0x4193d2,_0x1f1cec){return client['request'](_0x383d0b,_0x2a6c50)[_0x1f02('0x9')](function(_0x5dc295){logger['info']('Campaign,\x20%s,\x20%s',_0x257d6a,_0x1f02('0xa'));logger[_0x1f02('0xb')](_0x1f02('0xc'),_0x257d6a,_0x1f02('0xa'),JSON[_0x1f02('0xd')](_0x5dc295));if(_0x5dc295['error']){if(_0x5dc295[_0x1f02('0xe')][_0x1f02('0xf')]===0x1f4){logger[_0x1f02('0xe')]('Campaign,\x20%s,\x20%s',_0x257d6a,_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);return _0x1f1cec(_0x5dc295[_0x1f02('0xe')]['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x257d6a,_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);return _0x4193d2(_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);}else{logger[_0x1f02('0x11')](_0x1f02('0x12'),_0x257d6a,_0x1f02('0xa'));_0x4193d2(_0x5dc295[_0x1f02('0x13')]['message']);}})[_0x1f02('0x14')](function(_0x5cca16){logger['error']('Campaign,\x20%s,\x20%s',_0x257d6a,_0x5cca16);_0x1f1cec(_0x5cca16);});});}exports['GetCampaign']=function(_0x4d1e4f){var _0x2cd7db=this;return new Promise(function(_0x3033a2,_0x5f1f30){return db[_0x1f02('0x15')][_0x1f02('0x16')]({'raw':_0x4d1e4f[_0x1f02('0x17')]?_0x4d1e4f[_0x1f02('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4d1e4f['options']?_0x4d1e4f[_0x1f02('0x17')][_0x1f02('0x18')]||null:null,'attributes':_0x4d1e4f['options']?_0x4d1e4f['options'][_0x1f02('0x19')]||null:null,'limit':_0x4d1e4f[_0x1f02('0x17')]?_0x4d1e4f[_0x1f02('0x17')][_0x1f02('0x1a')]||null:null,'include':_0x4d1e4f['options']?_0x4d1e4f[_0x1f02('0x17')][_0x1f02('0x1b')]?_[_0x1f02('0x1c')](_0x4d1e4f[_0x1f02('0x17')][_0x1f02('0x1b')],function(_0x134398){return{'model':db[_0x134398[_0x1f02('0x1d')]],'as':_0x134398['as'],'attributes':_0x134398['attributes'],'include':_0x134398[_0x1f02('0x1b')]?_[_0x1f02('0x1c')](_0x134398['include'],function(_0x25a8d1){return{'model':db[_0x25a8d1[_0x1f02('0x1d')]],'as':_0x25a8d1['as'],'attributes':_0x25a8d1['attributes'],'include':_0x25a8d1['include']?_[_0x1f02('0x1c')](_0x25a8d1[_0x1f02('0x1b')],function(_0x3c3fda){return{'model':db[_0x3c3fda[_0x1f02('0x1d')]],'as':_0x3c3fda['as'],'attributes':_0x3c3fda[_0x1f02('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1f02('0x9')](function(_0x297cf4){logger['info']('GetCampaign',_0x4d1e4f);logger['debug'](_0x1f02('0x1e'),_0x4d1e4f,JSON[_0x1f02('0xd')](_0x297cf4));_0x3033a2(_0x297cf4);})[_0x1f02('0x14')](function(_0x496afd){logger['error'](_0x1f02('0x1e'),_0x496afd[_0x1f02('0x10')],_0x4d1e4f);_0x5f1f30(_0x2cd7db[_0x1f02('0xe')](0x1f4,_0x496afd[_0x1f02('0x10')]));});});}; \ No newline at end of file +var _0x00b3=['../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetCampaign','findAll','options','raw','where','attributes','limit','map','include','model','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x248a56,_0x5bfa53){var _0x46075d=function(_0x531a9e){while(--_0x531a9e){_0x248a56['push'](_0x248a56['shift']());}};_0x46075d(++_0x5bfa53);}(_0x00b3,0x17a));var _0x300b=function(_0x3cad87,_0x13bce4){_0x3cad87=_0x3cad87-0x0;var _0x333173=_0x00b3[_0x3cad87];return _0x333173;};'use strict';var _=require('lodash');var util=require(_0x300b('0x0'));var moment=require(_0x300b('0x1'));var BPromise=require(_0x300b('0x2'));var rs=require(_0x300b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x300b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x300b('0x5'))('rpc');var config=require(_0x300b('0x6'));var jayson=require(_0x300b('0x7'));var client=jayson[_0x300b('0x8')][_0x300b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af470,_0x5dabb9,_0x30b3fe){return new BPromise(function(_0x590c4d,_0x5e283c){return client[_0x300b('0xa')](_0x5af470,_0x30b3fe)[_0x300b('0xb')](function(_0x457aa3){logger['info'](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));logger[_0x300b('0xe')](_0x300b('0xf'),_0x5dabb9,'request\x20sent',JSON[_0x300b('0x10')](_0x457aa3));if(_0x457aa3[_0x300b('0x11')]){if(_0x457aa3[_0x300b('0x11')]['code']===0x1f4){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);return _0x5e283c(_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);}logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3['error']['message']);return _0x590c4d(_0x457aa3['error']['message']);}else{logger[_0x300b('0x13')](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));_0x590c4d(_0x457aa3[_0x300b('0x14')]['message']);}})['catch'](function(_0x35b1d7){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x35b1d7);_0x5e283c(_0x35b1d7);});});}exports[_0x300b('0x15')]=function(_0x4d2024){var _0x1fbf16=this;return new Promise(function(_0x2a7d96,_0xb4b3fa){return db['Campaign'][_0x300b('0x16')]({'raw':_0x4d2024[_0x300b('0x17')]?_0x4d2024[_0x300b('0x17')][_0x300b('0x18')]===undefined?!![]:![]:!![],'where':_0x4d2024['options']?_0x4d2024[_0x300b('0x17')][_0x300b('0x19')]||null:null,'attributes':_0x4d2024[_0x300b('0x17')]?_0x4d2024['options'][_0x300b('0x1a')]||null:null,'limit':_0x4d2024[_0x300b('0x17')]?_0x4d2024[_0x300b('0x17')][_0x300b('0x1b')]||null:null,'include':_0x4d2024[_0x300b('0x17')]?_0x4d2024['options']['include']?_[_0x300b('0x1c')](_0x4d2024[_0x300b('0x17')][_0x300b('0x1d')],function(_0x3ea40b){return{'model':db[_0x3ea40b[_0x300b('0x1e')]],'as':_0x3ea40b['as'],'attributes':_0x3ea40b[_0x300b('0x1a')],'include':_0x3ea40b[_0x300b('0x1d')]?_[_0x300b('0x1c')](_0x3ea40b[_0x300b('0x1d')],function(_0x544658){return{'model':db[_0x544658[_0x300b('0x1e')]],'as':_0x544658['as'],'attributes':_0x544658[_0x300b('0x1a')],'include':_0x544658[_0x300b('0x1d')]?_[_0x300b('0x1c')](_0x544658['include'],function(_0x4f50b0){return{'model':db[_0x4f50b0['model']],'as':_0x4f50b0['as'],'attributes':_0x4f50b0[_0x300b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1241c7){logger[_0x300b('0x13')](_0x300b('0x15'),_0x4d2024);logger[_0x300b('0xe')](_0x300b('0x15'),_0x4d2024,JSON[_0x300b('0x10')](_0x1241c7));_0x2a7d96(_0x1241c7);})[_0x300b('0x1f')](function(_0x159b63){logger[_0x300b('0x11')](_0x300b('0x15'),_0x159b63['message'],_0x4d2024);_0xb4b3fa(_0x1fbf16['error'](0x1f4,_0x159b63[_0x300b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index cad3bed..7e14072 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 _0xaced=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','update','delete','removeLists','removeBlackLists','exports'];(function(_0x2dc5cb,_0xed18ba){var _0x671bf3=function(_0x104071){while(--_0x104071){_0x2dc5cb['push'](_0x2dc5cb['shift']());}};_0x671bf3(++_0xed18ba);}(_0xaced,0x18c));var _0xdace=function(_0x5d78b0,_0x28ae16){_0x5d78b0=_0x5d78b0-0x0;var _0x91ec7b=_0xaced[_0x5d78b0];return _0x91ec7b;};'use strict';var multer=require(_0xdace('0x0'));var util=require(_0xdace('0x1'));var path=require(_0xdace('0x2'));var timeout=require(_0xdace('0x3'));var express=require(_0xdace('0x4'));var router=express['Router']();var fs_extra=require(_0xdace('0x5'));var auth=require(_0xdace('0x6'));var interaction=require(_0xdace('0x7'));var config=require(_0xdace('0x8'));var controller=require('./campaign.controller');router[_0xdace('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdace('0x9')](_0xdace('0xa'),auth[_0xdace('0xb')](),controller[_0xdace('0xc')]);router['get']('/:id/hoppers',auth[_0xdace('0xb')](),controller[_0xdace('0xd')]);router[_0xdace('0x9')](_0xdace('0xe'),auth['isAuthenticated'](),controller[_0xdace('0xf')]);router[_0xdace('0x9')](_0xdace('0x10'),auth[_0xdace('0xb')](),controller['getHopperFinals']);router[_0xdace('0x9')](_0xdace('0x11'),auth['isAuthenticated'](),controller['getHopperBlacks']);router['get'](_0xdace('0x12'),auth['isAuthenticated'](),controller[_0xdace('0x13')]);router[_0xdace('0x9')](_0xdace('0x14'),auth[_0xdace('0xb')](),controller[_0xdace('0x15')]);router[_0xdace('0x16')]('/',auth['isAuthenticated'](),controller[_0xdace('0x17')]);router['post'](_0xdace('0x18'),auth[_0xdace('0xb')](),controller[_0xdace('0x19')]);router[_0xdace('0x16')](_0xdace('0x12'),auth[_0xdace('0xb')](),controller[_0xdace('0x1a')]);router[_0xdace('0x16')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0xdace('0x1b')]('/:id',auth[_0xdace('0xb')](),controller[_0xdace('0x1c')]);router[_0xdace('0x1d')](_0xdace('0xa'),auth[_0xdace('0xb')](),controller['destroy']);router['delete'](_0xdace('0x12'),auth[_0xdace('0xb')](),controller[_0xdace('0x1e')]);router[_0xdace('0x1d')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xdace('0x1f')]);module[_0xdace('0x20')]=router; \ No newline at end of file +var _0x8e4c=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','/:id/clone','clone','post','addLists','/:id/blacklists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x1b21ff,_0x217fcb){var _0xd3cb46=function(_0x1e4f94){while(--_0x1e4f94){_0x1b21ff['push'](_0x1b21ff['shift']());}};_0xd3cb46(++_0x217fcb);}(_0x8e4c,0x69));var _0xc8e4=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x8e4c[_0x31eb67];return _0x2a8cb8;};'use strict';var multer=require('multer');var util=require(_0xc8e4('0x0'));var path=require(_0xc8e4('0x1'));var timeout=require(_0xc8e4('0x2'));var express=require(_0xc8e4('0x3'));var router=express[_0xc8e4('0x4')]();var fs_extra=require(_0xc8e4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc8e4('0x6'));var config=require(_0xc8e4('0x7'));var controller=require(_0xc8e4('0x8'));router['get']('/',auth[_0xc8e4('0x9')](),controller['index']);router[_0xc8e4('0xa')](_0xc8e4('0xb'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0xc')]);router[_0xc8e4('0xa')](_0xc8e4('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xc8e4('0xa')](_0xc8e4('0xe'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0xf')]);router['get'](_0xc8e4('0x10'),auth[_0xc8e4('0x9')](),controller['getHopperFinals']);router[_0xc8e4('0xa')](_0xc8e4('0x11'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x12')]);router[_0xc8e4('0xa')](_0xc8e4('0x13'),auth['isAuthenticated'](),controller[_0xc8e4('0x14')]);router[_0xc8e4('0xa')]('/:id/blacklists',auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x15')]);router['post']('/',auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x16')]);router['post'](_0xc8e4('0x17'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x18')]);router[_0xc8e4('0x19')]('/:id/lists',auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x1a')]);router[_0xc8e4('0x19')](_0xc8e4('0x1b'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x1c')]);router['put'](_0xc8e4('0xb'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x1d')]);router[_0xc8e4('0x1e')](_0xc8e4('0xb'),auth['isAuthenticated'](),controller[_0xc8e4('0x1f')]);router[_0xc8e4('0x1e')](_0xc8e4('0x13'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x20')]);router[_0xc8e4('0x1e')](_0xc8e4('0x1b'),auth[_0xc8e4('0x9')](),controller[_0xc8e4('0x21')]);module[_0xc8e4('0x22')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 17733a1..42a78d0 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 _0x9cdb=['exports','STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x9cdb,0x11f));var _0xb9cd=function(_0x45dc60,_0x5b6ac7){_0x45dc60=_0x45dc60-0x0;var _0x3765ba=_0x9cdb[_0x45dc60];return _0x3765ba;};'use strict';var Sequelize=require(_0xb9cd('0x0'));module[_0xb9cd('0x1')]={'key':{'type':Sequelize[_0xb9cd('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb9cd('0x3')],'length':_0xb9cd('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb9cd('0x2')]},'name':{'type':Sequelize[_0xb9cd('0x5')],'get':function(){return this[_0xb9cd('0x6')](_0xb9cd('0x7'));}}}; \ No newline at end of file +var _0xab76=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x5b3740,_0x110dd2){var _0x3a2f03=function(_0x590610){while(--_0x590610){_0x5b3740['push'](_0x5b3740['shift']());}};_0x3a2f03(++_0x110dd2);}(_0xab76,0x75));var _0x6ab7=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xab76[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x6ab7('0x0'));module[_0x6ab7('0x1')]={'key':{'type':Sequelize[_0x6ab7('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x6ab7('0x2')]},'name':{'type':Sequelize[_0x6ab7('0x3')],'get':function(){return this[_0x6ab7('0x4')](_0x6ab7('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 4dcdf66..b45dbee 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 _0xf5f4=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','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','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','CannedAnswers','end','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','pick','where','filter','merge','options','includeAll','include','show','params','keys','rawAttributes','find','catch','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create'];(function(_0x18e3a1,_0xd51faa){var _0x69b4a1=function(_0x2509a8){while(--_0x2509a8){_0x18e3a1['push'](_0x18e3a1['shift']());}};_0x69b4a1(++_0xd51faa);}(_0xf5f4,0xb2));var _0x4f5f=function(_0x1ef09c,_0x3ddecb){_0x1ef09c=_0x1ef09c-0x0;var _0x838ef4=_0xf5f4[_0x1ef09c];return _0x838ef4;};'use strict';var emlformat=require(_0x4f5f('0x0'));var rimraf=require(_0x4f5f('0x1'));var zipdir=require(_0x4f5f('0x2'));var jsonpatch=require(_0x4f5f('0x3'));var rp=require('request-promise');var moment=require(_0x4f5f('0x4'));var BPromise=require(_0x4f5f('0x5'));var Mustache=require(_0x4f5f('0x6'));var util=require(_0x4f5f('0x7'));var path=require(_0x4f5f('0x8'));var sox=require(_0x4f5f('0x9'));var csv=require('to-csv');var ejs=require(_0x4f5f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f5f('0xb'));var squel=require('squel');var crypto=require(_0x4f5f('0xc'));var jsforce=require(_0x4f5f('0xd'));var deskjs=require(_0x4f5f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4f5f('0xf'));var Papa=require('papaparse');var Redis=require(_0x4f5f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f5f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4f5f('0x12'));var utils=require(_0x4f5f('0x13'));var config=require(_0x4f5f('0x14'));var licenseUtil=require(_0x4f5f('0x15'));var db=require(_0x4f5f('0x16'))['db'];function respondWithStatusCode(_0x3f57c8,_0xafe2f1){_0xafe2f1=_0xafe2f1||0xcc;return function(_0x58a33a){if(_0x58a33a){return _0x3f57c8[_0x4f5f('0x17')](_0xafe2f1);}return _0x3f57c8['status'](_0xafe2f1)['end']();};}function respondWithResult(_0x23aa63,_0x461334){_0x461334=_0x461334||0xc8;return function(_0x2f7570){if(_0x2f7570){return _0x23aa63[_0x4f5f('0x18')](_0x461334)[_0x4f5f('0x19')](_0x2f7570);}};}function respondWithFilteredResult(_0x1df0a0,_0x396cad){return function(_0x4bda25){if(_0x4bda25){var _0x20d48f=typeof _0x396cad[_0x4f5f('0x1a')]===_0x4f5f('0x1b')&&typeof _0x396cad[_0x4f5f('0x1c')]===_0x4f5f('0x1b');var _0x423279=_0x4bda25[_0x4f5f('0x1d')];var _0x3defc6=_0x20d48f?0x0:_0x396cad[_0x4f5f('0x1a')];var _0x57e12d=_0x20d48f?_0x4bda25['count']:_0x396cad[_0x4f5f('0x1a')]+_0x396cad[_0x4f5f('0x1c')];var _0x7f5696;if(_0x57e12d>=_0x423279){_0x57e12d=_0x423279;_0x7f5696=0xc8;}else{_0x7f5696=0xce;}_0x1df0a0['status'](_0x7f5696);return _0x1df0a0[_0x4f5f('0x1e')]('Content-Range',_0x3defc6+'-'+_0x57e12d+'/'+_0x423279)[_0x4f5f('0x19')](_0x4bda25);}return null;};}function patchUpdates(_0x142b3c){return function(_0x1e6ceb){try{jsonpatch[_0x4f5f('0x1f')](_0x1e6ceb,_0x142b3c,!![]);}catch(_0x24bf02){return BPromise['reject'](_0x24bf02);}return _0x1e6ceb[_0x4f5f('0x20')]();};}function saveUpdates(_0x2b1d35,_0x49ec15){return function(_0x354895){if(_0x354895){return _0x354895['update'](_0x2b1d35)[_0x4f5f('0x21')](function(_0x451a98){return _0x451a98;});}return null;};}function removeEntity(_0x302938,_0x5f42ac){return function(_0x1e79de){if(_0x1e79de){return _0x1e79de[_0x4f5f('0x22')]()['then'](function(){var _0x4b64d3=_0x1e79de[_0x4f5f('0x23')]({'plain':!![]});var _0x1a2758=_0x4f5f('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a2758,'resourceId':_0x4b64d3['id']}})[_0x4f5f('0x21')](function(){return _0x1e79de;});})['then'](function(){_0x302938[_0x4f5f('0x18')](0xcc)[_0x4f5f('0x25')]();});}};}function handleEntityNotFound(_0x349da6,_0x11166c){return function(_0x596e79){if(!_0x596e79){_0x349da6[_0x4f5f('0x17')](0x194);}return _0x596e79;};}function handleError(_0x1643fe,_0x3afd6d){_0x3afd6d=_0x3afd6d||0x1f4;return function(_0x5a3c4a){logger[_0x4f5f('0x26')](_0x5a3c4a[_0x4f5f('0x27')]);if(_0x5a3c4a[_0x4f5f('0x28')]){delete _0x5a3c4a['name'];}_0x1643fe['status'](_0x3afd6d)[_0x4f5f('0x29')](_0x5a3c4a);};}exports[_0x4f5f('0x2a')]=function(_0x353cf9,_0x127457){var _0x271cbf={},_0x4f4e15={},_0x353d3a={'count':0x0,'rows':[]};var _0x45abaf=_[_0x4f5f('0x2b')](db[_0x4f5f('0x2c')]['rawAttributes'],function(_0x5c9742){return{'name':_0x5c9742[_0x4f5f('0x2d')],'type':_0x5c9742[_0x4f5f('0x2e')][_0x4f5f('0x2f')]};});_0x4f4e15[_0x4f5f('0x30')]=_['map'](_0x45abaf,'name');_0x4f4e15[_0x4f5f('0x31')]=_['keys'](_0x353cf9[_0x4f5f('0x31')]);_0x4f4e15[_0x4f5f('0x32')]=_[_0x4f5f('0x33')](_0x4f4e15[_0x4f5f('0x30')],_0x4f4e15[_0x4f5f('0x31')]);_0x271cbf['attributes']=_['intersection'](_0x4f4e15[_0x4f5f('0x30')],qs[_0x4f5f('0x34')](_0x353cf9[_0x4f5f('0x31')]['fields']));_0x271cbf[_0x4f5f('0x35')]=_0x271cbf['attributes'][_0x4f5f('0x36')]?_0x271cbf[_0x4f5f('0x35')]:_0x4f4e15[_0x4f5f('0x30')];if(!_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x37')](_0x4f5f('0x38'))){_0x271cbf['limit']=qs[_0x4f5f('0x1c')](_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x1c')]);_0x271cbf[_0x4f5f('0x1a')]=qs[_0x4f5f('0x1a')](_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x1a')]);}_0x271cbf['order']=qs['sort'](_0x353cf9['query']['sort']);_0x271cbf['where']=qs[_0x4f5f('0x32')](_[_0x4f5f('0x39')](_0x353cf9[_0x4f5f('0x31')],_0x4f4e15[_0x4f5f('0x32')]),_0x45abaf);if(_0x353cf9[_0x4f5f('0x31')]['filter']){_0x271cbf[_0x4f5f('0x3a')]=_['merge'](_0x271cbf['where'],{'$or':[{'key':{'$like':'%'+_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x3b')]+'%'}},{'value':{'$like':'%'+_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x3b')]+'%'}}]});}_0x271cbf=_[_0x4f5f('0x3c')]({},_0x271cbf,_0x353cf9[_0x4f5f('0x3d')]);var _0x123582={'where':_0x271cbf[_0x4f5f('0x3a')]};return db[_0x4f5f('0x2c')][_0x4f5f('0x1d')](_0x123582)[_0x4f5f('0x21')](function(_0xa63246){_0x353d3a[_0x4f5f('0x1d')]=_0xa63246;if(_0x353cf9[_0x4f5f('0x31')][_0x4f5f('0x3e')]){_0x271cbf[_0x4f5f('0x3f')]=[{'all':!![]}];}return db[_0x4f5f('0x2c')]['findAll'](_0x271cbf);})[_0x4f5f('0x21')](function(_0x2549a6){_0x353d3a['rows']=_0x2549a6;return _0x353d3a;})[_0x4f5f('0x21')](respondWithFilteredResult(_0x127457,_0x271cbf))['catch'](handleError(_0x127457,null));};exports[_0x4f5f('0x40')]=function(_0xbc6b59,_0x3d66ce){var _0x23385a={'raw':!![],'where':{'id':_0xbc6b59[_0x4f5f('0x41')]['id']}},_0x16ae3d={};_0x16ae3d[_0x4f5f('0x30')]=_[_0x4f5f('0x42')](db['CannedAnswer'][_0x4f5f('0x43')]);_0x16ae3d[_0x4f5f('0x31')]=_[_0x4f5f('0x42')](_0xbc6b59[_0x4f5f('0x31')]);_0x16ae3d[_0x4f5f('0x32')]=_[_0x4f5f('0x33')](_0x16ae3d[_0x4f5f('0x30')],_0x16ae3d[_0x4f5f('0x31')]);_0x23385a['attributes']=_[_0x4f5f('0x33')](_0x16ae3d[_0x4f5f('0x30')],qs[_0x4f5f('0x34')](_0xbc6b59[_0x4f5f('0x31')][_0x4f5f('0x34')]));_0x23385a[_0x4f5f('0x35')]=_0x23385a['attributes'][_0x4f5f('0x36')]?_0x23385a['attributes']:_0x16ae3d['model'];if(_0xbc6b59[_0x4f5f('0x31')][_0x4f5f('0x3e')]){_0x23385a[_0x4f5f('0x3f')]=[{'all':!![]}];}_0x23385a=_['merge']({},_0x23385a,_0xbc6b59['options']);return db['CannedAnswer'][_0x4f5f('0x44')](_0x23385a)[_0x4f5f('0x21')](handleEntityNotFound(_0x3d66ce,null))[_0x4f5f('0x21')](respondWithResult(_0x3d66ce,null))[_0x4f5f('0x45')](handleError(_0x3d66ce,null));};exports[_0x4f5f('0x46')]=function(_0x1a729f,_0x2bfa3d){if(_0x1a729f[_0x4f5f('0x47')]['id']){delete _0x1a729f[_0x4f5f('0x47')]['id'];}return db[_0x4f5f('0x2c')][_0x4f5f('0x44')]({'where':{'id':_0x1a729f[_0x4f5f('0x41')]['id']}})[_0x4f5f('0x21')](handleEntityNotFound(_0x2bfa3d,null))['then'](saveUpdates(_0x1a729f['body'],null))['then'](respondWithResult(_0x2bfa3d,null))['catch'](handleError(_0x2bfa3d,null));};exports[_0x4f5f('0x22')]=function(_0x14e2a3,_0x166fc6){return db['CannedAnswer'][_0x4f5f('0x44')]({'where':{'id':_0x14e2a3['params']['id']}})[_0x4f5f('0x21')](handleEntityNotFound(_0x166fc6,null))[_0x4f5f('0x21')](removeEntity(_0x166fc6,null))[_0x4f5f('0x45')](handleError(_0x166fc6,null));};exports['create']=function(_0x1d5d62,_0x1662f2){var _0x3d84eb={'key':_0x1d5d62['body'][_0x4f5f('0x2f')]};if(_0x1d5d62[_0x4f5f('0x47')]['MailAccountId']){_0x3d84eb['MailAccountId']=_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x48')];}else if(_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x49')]){_0x3d84eb['SmsAccountId']=_0x1d5d62['body']['SmsAccountId'];}else if(_0x1d5d62['body'][_0x4f5f('0x4a')]){_0x3d84eb[_0x4f5f('0x4a')]=_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x4a')];}else if(_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x4b')]){_0x3d84eb[_0x4f5f('0x4b')]=_0x1d5d62[_0x4f5f('0x47')][_0x4f5f('0x4b')];}return db[_0x4f5f('0x2c')][_0x4f5f('0x44')]({'where':_0x3d84eb})['then'](function(_0x32cc3b){if(_0x32cc3b){throw new db[(_0x4f5f('0x4c'))][(_0x4f5f('0x4d'))](_0x4f5f('0x4e'));}return db[_0x4f5f('0x2c')][_0x4f5f('0x4f')](_0x1d5d62[_0x4f5f('0x47')]);})[_0x4f5f('0x21')](function(_0x122811){var _0x2d8d1d=_0x1d5d62[_0x4f5f('0x50')][_0x4f5f('0x23')]({'plain':!![]});if(!_0x2d8d1d)throw new Error(_0x4f5f('0x51'));if(_0x2d8d1d[_0x4f5f('0x52')]===_0x4f5f('0x50')){var _0x5d0bc2=_0x122811[_0x4f5f('0x23')]({'plain':!![]});return db[_0x4f5f('0x53')]['find']({'where':{'name':_0x4f5f('0x24'),'userProfileId':_0x2d8d1d['userProfileId']},'raw':!![]})[_0x4f5f('0x21')](function(_0x35a7de){if(_0x35a7de&&_0x35a7de[_0x4f5f('0x54')]===0x0){return db['UserProfileResource'][_0x4f5f('0x4f')]({'name':_0x5d0bc2[_0x4f5f('0x28')],'resourceId':_0x5d0bc2['id'],'type':_0x35a7de[_0x4f5f('0x28')],'sectionId':_0x35a7de['id']},{})['then'](function(){return _0x122811;});}else{return _0x122811;}})[_0x4f5f('0x45')](function(_0x4b437a){logger[_0x4f5f('0x26')](_0x4f5f('0x55'),_0x4b437a);throw _0x4b437a;});}return _0x122811;})[_0x4f5f('0x21')](respondWithResult(_0x1662f2,0xc9))[_0x4f5f('0x45')](handleError(_0x1662f2,null));}; \ No newline at end of file +var _0x8510=['sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','apply','save','then','destroy','CannedAnswers','UserProfileResource','error','name','send','index','map','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','CannedAnswer','findAll','rows','catch','show','params','rawAttributes','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x19c37a,_0x26827a){var _0x38fae9=function(_0x1b558f){while(--_0x1b558f){_0x19c37a['push'](_0x19c37a['shift']());}};_0x38fae9(++_0x26827a);}(_0x8510,0x14f));var _0x0851=function(_0x3e9787,_0x4b4cf6){_0x3e9787=_0x3e9787-0x0;var _0x3d33c7=_0x8510[_0x3e9787];return _0x3d33c7;};'use strict';var emlformat=require(_0x0851('0x0'));var rimraf=require(_0x0851('0x1'));var zipdir=require(_0x0851('0x2'));var jsonpatch=require(_0x0851('0x3'));var rp=require(_0x0851('0x4'));var moment=require('moment');var BPromise=require(_0x0851('0x5'));var Mustache=require(_0x0851('0x6'));var util=require(_0x0851('0x7'));var path=require(_0x0851('0x8'));var sox=require(_0x0851('0x9'));var csv=require(_0x0851('0xa'));var ejs=require(_0x0851('0xb'));var fs=require('fs');var fs_extra=require(_0x0851('0xc'));var _=require(_0x0851('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0851('0xe'));var deskjs=require(_0x0851('0xf'));var toCsv=require(_0x0851('0xa'));var querystring=require(_0x0851('0x10'));var Papa=require(_0x0851('0x11'));var Redis=require(_0x0851('0x12'));var authService=require(_0x0851('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0851('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0851('0x15'))('api');var utils=require(_0x0851('0x16'));var config=require(_0x0851('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x449533,_0x2258b3){_0x2258b3=_0x2258b3||0xcc;return function(_0x17ad87){if(_0x17ad87){return _0x449533[_0x0851('0x18')](_0x2258b3);}return _0x449533[_0x0851('0x19')](_0x2258b3)[_0x0851('0x1a')]();};}function respondWithResult(_0x53e999,_0x346cfa){_0x346cfa=_0x346cfa||0xc8;return function(_0x1b060a){if(_0x1b060a){return _0x53e999[_0x0851('0x19')](_0x346cfa)[_0x0851('0x1b')](_0x1b060a);}};}function respondWithFilteredResult(_0x3b3a39,_0x2ce544){return function(_0x25a305){if(_0x25a305){var _0x263ba0=typeof _0x2ce544['offset']===_0x0851('0x1c')&&typeof _0x2ce544[_0x0851('0x1d')]==='undefined';var _0x3f82e9=_0x25a305[_0x0851('0x1e')];var _0x2d5dbb=_0x263ba0?0x0:_0x2ce544[_0x0851('0x1f')];var _0x24880b=_0x263ba0?_0x25a305['count']:_0x2ce544[_0x0851('0x1f')]+_0x2ce544[_0x0851('0x1d')];var _0xd5548b;if(_0x24880b>=_0x3f82e9){_0x24880b=_0x3f82e9;_0xd5548b=0xc8;}else{_0xd5548b=0xce;}_0x3b3a39[_0x0851('0x19')](_0xd5548b);return _0x3b3a39['set']('Content-Range',_0x2d5dbb+'-'+_0x24880b+'/'+_0x3f82e9)[_0x0851('0x1b')](_0x25a305);}return null;};}function patchUpdates(_0xd5a1b){return function(_0x319ea6){try{jsonpatch[_0x0851('0x20')](_0x319ea6,_0xd5a1b,!![]);}catch(_0x4feb60){return BPromise['reject'](_0x4feb60);}return _0x319ea6[_0x0851('0x21')]();};}function saveUpdates(_0x177764,_0x5a34aa){return function(_0x326140){if(_0x326140){return _0x326140['update'](_0x177764)[_0x0851('0x22')](function(_0x447b80){return _0x447b80;});}return null;};}function removeEntity(_0x2409e9,_0xd2b319){return function(_0x585f10){if(_0x585f10){return _0x585f10[_0x0851('0x23')]()[_0x0851('0x22')](function(){var _0x28e52f=_0x585f10['get']({'plain':!![]});var _0xbd518b=_0x0851('0x24');return db[_0x0851('0x25')][_0x0851('0x23')]({'where':{'type':_0xbd518b,'resourceId':_0x28e52f['id']}})[_0x0851('0x22')](function(){return _0x585f10;});})[_0x0851('0x22')](function(){_0x2409e9[_0x0851('0x19')](0xcc)[_0x0851('0x1a')]();});}};}function handleEntityNotFound(_0x3edae7,_0x12a428){return function(_0x1a0154){if(!_0x1a0154){_0x3edae7[_0x0851('0x18')](0x194);}return _0x1a0154;};}function handleError(_0x4fbf61,_0x268908){_0x268908=_0x268908||0x1f4;return function(_0x42e95e){logger[_0x0851('0x26')](_0x42e95e['stack']);if(_0x42e95e['name']){delete _0x42e95e[_0x0851('0x27')];}_0x4fbf61[_0x0851('0x19')](_0x268908)[_0x0851('0x28')](_0x42e95e);};}exports[_0x0851('0x29')]=function(_0x53c8ea,_0x568f2d){var _0x56d20e={},_0x2f1785={},_0x40c230={'count':0x0,'rows':[]};var _0x20856d=_[_0x0851('0x2a')](db['CannedAnswer']['rawAttributes'],function(_0x576872){return{'name':_0x576872[_0x0851('0x2b')],'type':_0x576872[_0x0851('0x2c')][_0x0851('0x2d')]};});_0x2f1785['model']=_[_0x0851('0x2a')](_0x20856d,_0x0851('0x27'));_0x2f1785[_0x0851('0x2e')]=_['keys'](_0x53c8ea['query']);_0x2f1785[_0x0851('0x2f')]=_[_0x0851('0x30')](_0x2f1785['model'],_0x2f1785['query']);_0x56d20e[_0x0851('0x31')]=_[_0x0851('0x30')](_0x2f1785[_0x0851('0x32')],qs[_0x0851('0x33')](_0x53c8ea['query'][_0x0851('0x33')]));_0x56d20e['attributes']=_0x56d20e[_0x0851('0x31')][_0x0851('0x34')]?_0x56d20e['attributes']:_0x2f1785[_0x0851('0x32')];if(!_0x53c8ea[_0x0851('0x2e')][_0x0851('0x35')](_0x0851('0x36'))){_0x56d20e['limit']=qs[_0x0851('0x1d')](_0x53c8ea[_0x0851('0x2e')][_0x0851('0x1d')]);_0x56d20e[_0x0851('0x1f')]=qs['offset'](_0x53c8ea[_0x0851('0x2e')][_0x0851('0x1f')]);}_0x56d20e['order']=qs[_0x0851('0x37')](_0x53c8ea[_0x0851('0x2e')]['sort']);_0x56d20e[_0x0851('0x38')]=qs[_0x0851('0x2f')](_[_0x0851('0x39')](_0x53c8ea[_0x0851('0x2e')],_0x2f1785[_0x0851('0x2f')]),_0x20856d);if(_0x53c8ea[_0x0851('0x2e')][_0x0851('0x3a')]){_0x56d20e[_0x0851('0x38')]=_[_0x0851('0x3b')](_0x56d20e[_0x0851('0x38')],{'$or':[{'key':{'$like':'%'+_0x53c8ea[_0x0851('0x2e')][_0x0851('0x3a')]+'%'}},{'value':{'$like':'%'+_0x53c8ea['query'][_0x0851('0x3a')]+'%'}}]});}_0x56d20e=_[_0x0851('0x3b')]({},_0x56d20e,_0x53c8ea[_0x0851('0x3c')]);var _0x24e118={'where':_0x56d20e[_0x0851('0x38')]};return db['CannedAnswer'][_0x0851('0x1e')](_0x24e118)['then'](function(_0x1eb34c){_0x40c230[_0x0851('0x1e')]=_0x1eb34c;if(_0x53c8ea[_0x0851('0x2e')][_0x0851('0x3d')]){_0x56d20e['include']=[{'all':!![]}];}return db[_0x0851('0x3e')][_0x0851('0x3f')](_0x56d20e);})[_0x0851('0x22')](function(_0x70bee9){_0x40c230[_0x0851('0x40')]=_0x70bee9;return _0x40c230;})[_0x0851('0x22')](respondWithFilteredResult(_0x568f2d,_0x56d20e))[_0x0851('0x41')](handleError(_0x568f2d,null));};exports[_0x0851('0x42')]=function(_0x586ed1,_0xf5ef38){var _0x1d5669={'raw':!![],'where':{'id':_0x586ed1[_0x0851('0x43')]['id']}},_0x3b108c={};_0x3b108c['model']=_['keys'](db[_0x0851('0x3e')][_0x0851('0x44')]);_0x3b108c[_0x0851('0x2e')]=_['keys'](_0x586ed1[_0x0851('0x2e')]);_0x3b108c[_0x0851('0x2f')]=_[_0x0851('0x30')](_0x3b108c[_0x0851('0x32')],_0x3b108c[_0x0851('0x2e')]);_0x1d5669[_0x0851('0x31')]=_[_0x0851('0x30')](_0x3b108c[_0x0851('0x32')],qs[_0x0851('0x33')](_0x586ed1['query'][_0x0851('0x33')]));_0x1d5669[_0x0851('0x31')]=_0x1d5669[_0x0851('0x31')][_0x0851('0x34')]?_0x1d5669[_0x0851('0x31')]:_0x3b108c[_0x0851('0x32')];if(_0x586ed1[_0x0851('0x2e')][_0x0851('0x3d')]){_0x1d5669[_0x0851('0x45')]=[{'all':!![]}];}_0x1d5669=_['merge']({},_0x1d5669,_0x586ed1[_0x0851('0x3c')]);return db[_0x0851('0x3e')][_0x0851('0x46')](_0x1d5669)['then'](handleEntityNotFound(_0xf5ef38,null))['then'](respondWithResult(_0xf5ef38,null))['catch'](handleError(_0xf5ef38,null));};exports['update']=function(_0x459d9a,_0x4bba1a){if(_0x459d9a[_0x0851('0x47')]['id']){delete _0x459d9a[_0x0851('0x47')]['id'];}return db[_0x0851('0x3e')][_0x0851('0x46')]({'where':{'id':_0x459d9a[_0x0851('0x43')]['id']}})['then'](handleEntityNotFound(_0x4bba1a,null))[_0x0851('0x22')](saveUpdates(_0x459d9a[_0x0851('0x47')],null))[_0x0851('0x22')](respondWithResult(_0x4bba1a,null))['catch'](handleError(_0x4bba1a,null));};exports[_0x0851('0x23')]=function(_0x465b70,_0x46ea7e){return db[_0x0851('0x3e')][_0x0851('0x46')]({'where':{'id':_0x465b70[_0x0851('0x43')]['id']}})[_0x0851('0x22')](handleEntityNotFound(_0x46ea7e,null))[_0x0851('0x22')](removeEntity(_0x46ea7e,null))[_0x0851('0x41')](handleError(_0x46ea7e,null));};exports[_0x0851('0x48')]=function(_0x101ba5,_0x5fec36){var _0x6d40c3={'key':_0x101ba5['body'][_0x0851('0x2d')]};if(_0x101ba5['body'][_0x0851('0x49')]){_0x6d40c3[_0x0851('0x49')]=_0x101ba5[_0x0851('0x47')][_0x0851('0x49')];}else if(_0x101ba5[_0x0851('0x47')]['SmsAccountId']){_0x6d40c3[_0x0851('0x4a')]=_0x101ba5['body'][_0x0851('0x4a')];}else if(_0x101ba5[_0x0851('0x47')][_0x0851('0x4b')]){_0x6d40c3['OpenchannelAccountId']=_0x101ba5[_0x0851('0x47')][_0x0851('0x4b')];}else if(_0x101ba5[_0x0851('0x47')][_0x0851('0x4c')]){_0x6d40c3[_0x0851('0x4c')]=_0x101ba5[_0x0851('0x47')][_0x0851('0x4c')];}return db['CannedAnswer'][_0x0851('0x46')]({'where':_0x6d40c3})['then'](function(_0x4a0f24){if(_0x4a0f24){throw new db[(_0x0851('0x4d'))]['ValidationError'](_0x0851('0x4e'));}return db[_0x0851('0x3e')][_0x0851('0x48')](_0x101ba5[_0x0851('0x47')]);})[_0x0851('0x22')](function(_0x369f7d){var _0xc7ab27=_0x101ba5[_0x0851('0x4f')][_0x0851('0x50')]({'plain':!![]});if(!_0xc7ab27)throw new Error(_0x0851('0x51'));if(_0xc7ab27[_0x0851('0x52')]==='user'){var _0x121b38=_0x369f7d['get']({'plain':!![]});return db[_0x0851('0x53')][_0x0851('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0xc7ab27[_0x0851('0x54')]},'raw':!![]})[_0x0851('0x22')](function(_0x6726a){if(_0x6726a&&_0x6726a[_0x0851('0x55')]===0x0){return db[_0x0851('0x25')]['create']({'name':_0x121b38[_0x0851('0x27')],'resourceId':_0x121b38['id'],'type':_0x6726a[_0x0851('0x27')],'sectionId':_0x6726a['id']},{})['then'](function(){return _0x369f7d;});}else{return _0x369f7d;}})[_0x0851('0x41')](function(_0x4ac9b8){logger[_0x0851('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ac9b8);throw _0x4ac9b8;});}return _0x369f7d;})[_0x0851('0x22')](respondWithResult(_0x5fec36,0xc9))[_0x0851('0x41')](handleError(_0x5fec36,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 738b93c..47a1b4f 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 _0xaef4=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xaef4,0xfb));var _0x4aef=function(_0x449882,_0x501eda){_0x449882=_0x449882-0x0;var _0x446149=_0xaef4[_0x449882];return _0x446149;};'use strict';var _=require(_0x4aef('0x0'));var util=require(_0x4aef('0x1'));var logger=require(_0x4aef('0x2'))('api');var moment=require(_0x4aef('0x3'));var BPromise=require(_0x4aef('0x4'));var rp=require(_0x4aef('0x5'));var fs=require('fs');var path=require(_0x4aef('0x6'));var rimraf=require('rimraf');var config=require(_0x4aef('0x7'));var attributes=require(_0x4aef('0x8'));module['exports']=function(_0x9e0364,_0x4f63de){return _0x9e0364[_0x4aef('0x9')](_0x4aef('0xa'),attributes,{'tableName':_0x4aef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4aef('0xc'),'collate':_0x4aef('0xd')});}; \ No newline at end of file +var _0x4559=['api','moment','bluebird','path','rimraf','exports','define','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x569020,_0x4d7f3a){var _0x42bed8=function(_0x381acd){while(--_0x381acd){_0x569020['push'](_0x569020['shift']());}};_0x42bed8(++_0x4d7f3a);}(_0x4559,0x18f));var _0x9455=function(_0x5130aa,_0x441b77){_0x5130aa=_0x5130aa-0x0;var _0x125ec6=_0x4559[_0x5130aa];return _0x125ec6;};'use strict';var _=require('lodash');var util=require(_0x9455('0x0'));var logger=require('../../config/logger')(_0x9455('0x1'));var moment=require(_0x9455('0x2'));var BPromise=require(_0x9455('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9455('0x4'));var rimraf=require(_0x9455('0x5'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x9455('0x6')]=function(_0xee44aa,_0x374563){return _0xee44aa[_0x9455('0x7')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9455('0x8'),'collate':_0x9455('0x9')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 1e435b1..737f84f 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(_0x26e7ca,_0x480535){var _0xa1fe3d=function(_0xf9530c){while(--_0xf9530c){_0x26e7ca['push'](_0x26e7ca['shift']());}};_0xa1fe3d(++_0x480535);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0xffdd7d,_0x232967){var _0x4eff6e=function(_0x50628d){while(--_0x50628d){_0xffdd7d['push'](_0xffdd7d['shift']());}};_0x4eff6e(++_0x232967);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 27e051c..12ab02b 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 _0xde80=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','show','create','update','delete'];(function(_0x5ba5e3,_0x5dd00d){var _0x293e9a=function(_0x44b40b){while(--_0x44b40b){_0x5ba5e3['push'](_0x5ba5e3['shift']());}};_0x293e9a(++_0x5dd00d);}(_0xde80,0x1ca));var _0x0de8=function(_0x8f6fa5,_0x320980){_0x8f6fa5=_0x8f6fa5-0x0;var _0x2e1201=_0xde80[_0x8f6fa5];return _0x2e1201;};'use strict';var multer=require(_0x0de8('0x0'));var util=require(_0x0de8('0x1'));var path=require(_0x0de8('0x2'));var timeout=require(_0x0de8('0x3'));var express=require('express');var router=express[_0x0de8('0x4')]();var fs_extra=require(_0x0de8('0x5'));var auth=require(_0x0de8('0x6'));var interaction=require(_0x0de8('0x7'));var config=require(_0x0de8('0x8'));var controller=require(_0x0de8('0x9'));router['get']('/',auth[_0x0de8('0xa')](),controller[_0x0de8('0xb')]);router['get'](_0x0de8('0xc'),auth['isAuthenticated'](),controller[_0x0de8('0xd')]);router['post']('/',auth[_0x0de8('0xa')](),controller[_0x0de8('0xe')]);router['put'](_0x0de8('0xc'),auth[_0x0de8('0xa')](),controller[_0x0de8('0xf')]);router[_0x0de8('0x10')]('/:id',auth[_0x0de8('0xa')](),controller[_0x0de8('0x11')]);module[_0x0de8('0x12')]=router; \ No newline at end of file +var _0xf193=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','exports'];(function(_0x2741d1,_0x501426){var _0x521e37=function(_0x31b546){while(--_0x31b546){_0x2741d1['push'](_0x2741d1['shift']());}};_0x521e37(++_0x501426);}(_0xf193,0x165));var _0x3f19=function(_0x18947c,_0xa391b){_0x18947c=_0x18947c-0x0;var _0x5ed660=_0xf193[_0x18947c];return _0x5ed660;};'use strict';var multer=require(_0x3f19('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3f19('0x1'));var express=require(_0x3f19('0x2'));var router=express[_0x3f19('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3f19('0x4'));var interaction=require(_0x3f19('0x5'));var config=require('../../config/environment');var controller=require(_0x3f19('0x6'));router[_0x3f19('0x7')]('/',auth[_0x3f19('0x8')](),controller[_0x3f19('0x9')]);router[_0x3f19('0x7')]('/:id',auth[_0x3f19('0x8')](),controller[_0x3f19('0xa')]);router[_0x3f19('0xb')]('/',auth[_0x3f19('0x8')](),controller['create']);router[_0x3f19('0xc')](_0x3f19('0xd'),auth[_0x3f19('0x8')](),controller['update']);router[_0x3f19('0xe')]('/:id',auth[_0x3f19('0x8')](),controller[_0x3f19('0xf')]);module[_0x3f19('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b69af11..cc15be1 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 _0x66f4=['INTEGER','exports','STRING'];(function(_0x27c192,_0x2a13c2){var _0x6e788d=function(_0x19ca31){while(--_0x19ca31){_0x27c192['push'](_0x27c192['shift']());}};_0x6e788d(++_0x2a13c2);}(_0x66f4,0x7f));var _0x466f=function(_0xb90630,_0xbaa470){_0xb90630=_0xb90630-0x0;var _0x296c55=_0x66f4[_0xb90630];return _0x296c55;};'use strict';var Sequelize=require('sequelize');module[_0x466f('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x466f('0x1')]},'src':{'type':Sequelize[_0x466f('0x1')]},'dst':{'type':Sequelize[_0x466f('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x466f('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x466f('0x1')]},'amaflags':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x466f('0x1')]},'uniqueid':{'type':Sequelize[_0x466f('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x466f('0x1')]},'tag':{'type':Sequelize[_0x466f('0x1')]}}; \ No newline at end of file +var _0x33e5=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x372532,_0x525498){var _0x30c2e3=function(_0x3041ea){while(--_0x3041ea){_0x372532['push'](_0x372532['shift']());}};_0x30c2e3(++_0x525498);}(_0x33e5,0x13a));var _0x533e=function(_0x4df960,_0x102a92){_0x4df960=_0x4df960-0x0;var _0x320f40=_0x33e5[_0x4df960];return _0x320f40;};'use strict';var Sequelize=require(_0x533e('0x0'));module[_0x533e('0x1')]={'calldate':{'type':Sequelize[_0x533e('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x533e('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x533e('0x3')]},'dcontext':{'type':Sequelize[_0x533e('0x3')]},'channel':{'type':Sequelize[_0x533e('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x533e('0x3')]},'duration':{'type':Sequelize[_0x533e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x533e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x533e('0x3')]},'amaflags':{'type':Sequelize[_0x533e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x533e('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x533e('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x533e('0x3')]},'peeraccount':{'type':Sequelize[_0x533e('0x3')]},'type':{'type':Sequelize[_0x533e('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 63b08b2..3fa214e 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 _0x3fa4=['model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','intersection','length','find','create','body','params','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key'];(function(_0x2204dd,_0x185cc1){var _0x2911a0=function(_0xf6de05){while(--_0xf6de05){_0x2204dd['push'](_0x2204dd['shift']());}};_0x2911a0(++_0x185cc1);}(_0x3fa4,0xf0));var _0x43fa=function(_0x659961,_0x258530){_0x659961=_0x659961-0x0;var _0xa0f7f7=_0x3fa4[_0x659961];return _0xa0f7f7;};'use strict';var emlformat=require(_0x43fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var BPromise=require(_0x43fa('0x3'));var Mustache=require(_0x43fa('0x4'));var util=require(_0x43fa('0x5'));var path=require(_0x43fa('0x6'));var sox=require(_0x43fa('0x7'));var csv=require('to-csv');var ejs=require(_0x43fa('0x8'));var fs=require('fs');var fs_extra=require(_0x43fa('0x9'));var _=require(_0x43fa('0xa'));var squel=require('squel');var crypto=require(_0x43fa('0xb'));var jsforce=require(_0x43fa('0xc'));var deskjs=require(_0x43fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x43fa('0xe'));var Papa=require(_0x43fa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43fa('0x10'));var as=require(_0x43fa('0x11'));var hardwareService=require(_0x43fa('0x12'));var logger=require(_0x43fa('0x13'))(_0x43fa('0x14'));var utils=require('../../config/utils');var config=require(_0x43fa('0x15'));var licenseUtil=require(_0x43fa('0x16'));var db=require(_0x43fa('0x17'))['db'];function respondWithStatusCode(_0x582ec2,_0xfbf89e){_0xfbf89e=_0xfbf89e||0xcc;return function(_0x4353c1){if(_0x4353c1){return _0x582ec2[_0x43fa('0x18')](_0xfbf89e);}return _0x582ec2['status'](_0xfbf89e)[_0x43fa('0x19')]();};}function respondWithResult(_0x4bb4b0,_0x5bc292){_0x5bc292=_0x5bc292||0xc8;return function(_0x4fba54){if(_0x4fba54){return _0x4bb4b0[_0x43fa('0x1a')](_0x5bc292)['json'](_0x4fba54);}};}function respondWithFilteredResult(_0x1a898a,_0x12ae9e){return function(_0x4a07b5){if(_0x4a07b5){var _0x27b87f=typeof _0x12ae9e[_0x43fa('0x1b')]===_0x43fa('0x1c')&&typeof _0x12ae9e[_0x43fa('0x1d')]===_0x43fa('0x1c');var _0x53c04c=_0x4a07b5['count'];var _0x479d81=_0x27b87f?0x0:_0x12ae9e[_0x43fa('0x1b')];var _0x29b8aa=_0x27b87f?_0x4a07b5[_0x43fa('0x1e')]:_0x12ae9e[_0x43fa('0x1b')]+_0x12ae9e[_0x43fa('0x1d')];var _0x15e594;if(_0x29b8aa>=_0x53c04c){_0x29b8aa=_0x53c04c;_0x15e594=0xc8;}else{_0x15e594=0xce;}_0x1a898a[_0x43fa('0x1a')](_0x15e594);return _0x1a898a[_0x43fa('0x1f')](_0x43fa('0x20'),_0x479d81+'-'+_0x29b8aa+'/'+_0x53c04c)['json'](_0x4a07b5);}return null;};}function patchUpdates(_0xfd8d3){return function(_0x551528){try{jsonpatch[_0x43fa('0x21')](_0x551528,_0xfd8d3,!![]);}catch(_0x319cfd){return BPromise[_0x43fa('0x22')](_0x319cfd);}return _0x551528['save']();};}function saveUpdates(_0x2c6075,_0x3c78fb){return function(_0x2db3dd){if(_0x2db3dd){return _0x2db3dd[_0x43fa('0x23')](_0x2c6075)[_0x43fa('0x24')](function(_0x1d3328){return _0x1d3328;});}return null;};}function removeEntity(_0x3b8cb9,_0x241948){return function(_0x427426){if(_0x427426){return _0x427426['destroy']()['then'](function(){_0x3b8cb9[_0x43fa('0x1a')](0xcc)[_0x43fa('0x19')]();});}};}function handleEntityNotFound(_0x28f695,_0x78f105){return function(_0x40969a){if(!_0x40969a){_0x28f695[_0x43fa('0x18')](0x194);}return _0x40969a;};}function handleError(_0x5014fb,_0x4f6101){_0x4f6101=_0x4f6101||0x1f4;return function(_0x1fa077){logger[_0x43fa('0x25')](_0x1fa077[_0x43fa('0x26')]);if(_0x1fa077[_0x43fa('0x27')]){delete _0x1fa077['name'];}_0x5014fb[_0x43fa('0x1a')](_0x4f6101)[_0x43fa('0x28')](_0x1fa077);};}exports[_0x43fa('0x29')]=function(_0x186249,_0x4d6c8c){var _0x3d5abd={},_0x44fdef={},_0x398c44={'count':0x0,'rows':[]};var _0x28b833=_[_0x43fa('0x2a')](db[_0x43fa('0x2b')][_0x43fa('0x2c')],function(_0x41a3cf){return{'name':_0x41a3cf[_0x43fa('0x2d')],'type':_0x41a3cf[_0x43fa('0x2e')][_0x43fa('0x2f')]};});_0x44fdef[_0x43fa('0x30')]=_['map'](_0x28b833,'name');_0x44fdef[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x186249[_0x43fa('0x31')]);_0x44fdef[_0x43fa('0x33')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],_0x44fdef[_0x43fa('0x31')]);_0x3d5abd[_0x43fa('0x34')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0x186249[_0x43fa('0x31')][_0x43fa('0x35')]));_0x3d5abd['attributes']=_0x3d5abd[_0x43fa('0x34')]['length']?_0x3d5abd[_0x43fa('0x34')]:_0x44fdef[_0x43fa('0x30')];if(!_0x186249[_0x43fa('0x31')]['hasOwnProperty'](_0x43fa('0x36'))){_0x3d5abd['limit']=qs['limit'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1d')]);_0x3d5abd[_0x43fa('0x1b')]=qs['offset'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1b')]);}_0x3d5abd[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0x186249[_0x43fa('0x31')]['sort']);_0x3d5abd[_0x43fa('0x39')]=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0x186249[_0x43fa('0x31')],_0x44fdef['filters']),_0x28b833);if(_0x186249['query'][_0x43fa('0x3b')]){_0x3d5abd[_0x43fa('0x39')]=_[_0x43fa('0x3c')](_0x3d5abd[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x28b833,function(_0x595d49){if(_0x595d49[_0x43fa('0x2e')]!=='VIRTUAL'){var _0x4cb1bd={};_0x4cb1bd[_0x595d49[_0x43fa('0x27')]]={'$like':'%'+_0x186249['query'][_0x43fa('0x3b')]+'%'};return _0x4cb1bd;}})});}_0x3d5abd=_[_0x43fa('0x3c')]({},_0x3d5abd,_0x186249[_0x43fa('0x3d')]);var _0x17403c={'where':_0x3d5abd['where']};return db['Cdr']['count'](_0x17403c)[_0x43fa('0x24')](function(_0x15ef49){_0x398c44['count']=_0x15ef49;if(_0x186249[_0x43fa('0x31')][_0x43fa('0x3e')]){_0x3d5abd[_0x43fa('0x3f')]=[{'all':!![]}];}return db[_0x43fa('0x2b')]['findAll'](_0x3d5abd);})[_0x43fa('0x24')](function(_0x23e156){_0x398c44['rows']=_0x23e156;return _0x398c44;})['then'](respondWithFilteredResult(_0x4d6c8c,_0x3d5abd))[_0x43fa('0x40')](handleError(_0x4d6c8c,null));};exports['show']=function(_0x3a6d39,_0x137ef){var _0x5cef1e={'raw':!![],'where':{'id':_0x3a6d39['params']['id']}},_0x4735d1={};_0x4735d1[_0x43fa('0x30')]=_[_0x43fa('0x32')](db[_0x43fa('0x2b')]['rawAttributes']);_0x4735d1[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x3a6d39[_0x43fa('0x31')]);_0x4735d1[_0x43fa('0x33')]=_[_0x43fa('0x41')](_0x4735d1[_0x43fa('0x30')],_0x4735d1['query']);_0x5cef1e[_0x43fa('0x34')]=_['intersection'](_0x4735d1[_0x43fa('0x30')],qs['fields'](_0x3a6d39[_0x43fa('0x31')][_0x43fa('0x35')]));_0x5cef1e[_0x43fa('0x34')]=_0x5cef1e[_0x43fa('0x34')][_0x43fa('0x42')]?_0x5cef1e['attributes']:_0x4735d1[_0x43fa('0x30')];if(_0x3a6d39['query']['includeAll']){_0x5cef1e['include']=[{'all':!![]}];}_0x5cef1e=_[_0x43fa('0x3c')]({},_0x5cef1e,_0x3a6d39[_0x43fa('0x3d')]);return db[_0x43fa('0x2b')][_0x43fa('0x43')](_0x5cef1e)[_0x43fa('0x24')](handleEntityNotFound(_0x137ef,null))['then'](respondWithResult(_0x137ef,null))[_0x43fa('0x40')](handleError(_0x137ef,null));};exports[_0x43fa('0x44')]=function(_0x305e90,_0x19b0f0){return db[_0x43fa('0x2b')][_0x43fa('0x44')](_0x305e90[_0x43fa('0x45')],{})[_0x43fa('0x24')](respondWithResult(_0x19b0f0,0xc9))[_0x43fa('0x40')](handleError(_0x19b0f0,null));};exports[_0x43fa('0x23')]=function(_0x1ae6e0,_0x52d66f){if(_0x1ae6e0[_0x43fa('0x45')]['id']){delete _0x1ae6e0[_0x43fa('0x45')]['id'];}return db['Cdr'][_0x43fa('0x43')]({'where':{'id':_0x1ae6e0['params']['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x52d66f,null))[_0x43fa('0x24')](saveUpdates(_0x1ae6e0[_0x43fa('0x45')],null))[_0x43fa('0x24')](respondWithResult(_0x52d66f,null))[_0x43fa('0x40')](handleError(_0x52d66f,null));};exports['destroy']=function(_0x1bbae4,_0x4a24f1){return db[_0x43fa('0x2b')][_0x43fa('0x43')]({'where':{'id':_0x1bbae4[_0x43fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a24f1,null))['then'](removeEntity(_0x4a24f1,null))[_0x43fa('0x40')](handleError(_0x4a24f1,null));};exports['describe']=function(_0x2ca431,_0x574076){return db['Cdr'][_0x43fa('0x47')]()[_0x43fa('0x24')](respondWithResult(_0x574076,null))['catch'](handleError(_0x574076,null));}; \ No newline at end of file +var _0x7bae=['hasOwnProperty','order','sort','where','filter','type','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','Cdr','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x7bae,0x13b));var _0xe7ba=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x7bae[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['map'](_0x587c7d,_0xe7ba('0x29'));_0x369451['query']=_['keys'](_0x48c869[_0xe7ba('0x31')]);_0x369451[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7['attributes']=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x34')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x92fe7['attributes']=_0x92fe7[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x92fe7['attributes']:_0x369451[_0xe7ba('0x30')];if(!_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x37')]('nolimit')){_0x92fe7[_0xe7ba('0x1e')]=qs[_0xe7ba('0x1e')](_0x48c869['query'][_0xe7ba('0x1e')]);_0x92fe7[_0xe7ba('0x20')]=qs[_0xe7ba('0x20')](_0x48c869['query'][_0xe7ba('0x20')]);}_0x92fe7[_0xe7ba('0x38')]=qs['sort'](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x39')]);_0x92fe7[_0xe7ba('0x3a')]=qs['filters'](_['pick'](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x32')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]){_0x92fe7[_0xe7ba('0x3a')]=_['merge'](_0x92fe7[_0xe7ba('0x3a')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x3139a6){if(_0x3139a6[_0xe7ba('0x3c')]!=='VIRTUAL'){var _0xe67917={};_0xe67917[_0x3139a6[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]+'%'};return _0xe67917;}})});}_0x92fe7=_[_0xe7ba('0x3d')]({},_0x92fe7,_0x48c869[_0xe7ba('0x3e')]);var _0x124cc4={'where':_0x92fe7['where']};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x124cc4)[_0xe7ba('0x26')](function(_0x401b0a){_0x4bf5f9[_0xe7ba('0x1f')]=_0x401b0a;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x92fe7[_0xe7ba('0x40')]=[{'all':!![]}];}return db[_0xe7ba('0x2c')]['findAll'](_0x92fe7);})[_0xe7ba('0x26')](function(_0x417734){_0x4bf5f9['rows']=_0x417734;return _0x4bf5f9;})['then'](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x41')](handleError(_0x102925,null));};exports[_0xe7ba('0x42')]=function(_0x368af2,_0x5589c4){var _0x249e1d={'raw':!![],'where':{'id':_0x368af2[_0xe7ba('0x43')]['id']}},_0x82246e={};_0x82246e[_0xe7ba('0x30')]=_[_0xe7ba('0x44')](db['Cdr'][_0xe7ba('0x2d')]);_0x82246e['query']=_[_0xe7ba('0x44')](_0x368af2[_0xe7ba('0x31')]);_0x82246e[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x82246e[_0xe7ba('0x30')],_0x82246e[_0xe7ba('0x31')]);_0x249e1d[_0xe7ba('0x35')]=_[_0xe7ba('0x33')](_0x82246e['model'],qs[_0xe7ba('0x34')](_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x249e1d[_0xe7ba('0x35')]=_0x249e1d[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x249e1d[_0xe7ba('0x35')]:_0x82246e[_0xe7ba('0x30')];if(_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x249e1d['include']=[{'all':!![]}];}_0x249e1d=_[_0xe7ba('0x3d')]({},_0x249e1d,_0x368af2['options']);return db[_0xe7ba('0x2c')][_0xe7ba('0x45')](_0x249e1d)[_0xe7ba('0x26')](handleEntityNotFound(_0x5589c4,null))[_0xe7ba('0x26')](respondWithResult(_0x5589c4,null))[_0xe7ba('0x41')](handleError(_0x5589c4,null));};exports[_0xe7ba('0x46')]=function(_0x48ae57,_0x271592){return db[_0xe7ba('0x2c')][_0xe7ba('0x46')](_0x48ae57[_0xe7ba('0x47')],{})[_0xe7ba('0x26')](respondWithResult(_0x271592,0xc9))[_0xe7ba('0x41')](handleError(_0x271592,null));};exports[_0xe7ba('0x25')]=function(_0x266ace,_0x272cb9){if(_0x266ace[_0xe7ba('0x47')]['id']){delete _0x266ace[_0xe7ba('0x47')]['id'];}return db['Cdr'][_0xe7ba('0x45')]({'where':{'id':_0x266ace[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x272cb9,null))[_0xe7ba('0x26')](saveUpdates(_0x266ace[_0xe7ba('0x47')],null))[_0xe7ba('0x26')](respondWithResult(_0x272cb9,null))['catch'](handleError(_0x272cb9,null));};exports[_0xe7ba('0x48')]=function(_0x3ee828,_0x520477){return db[_0xe7ba('0x2c')][_0xe7ba('0x45')]({'where':{'id':_0x3ee828[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x520477,null))['then'](removeEntity(_0x520477,null))['catch'](handleError(_0x520477,null));};exports[_0xe7ba('0x49')]=function(_0x2cfdc3,_0x285743){return db['Cdr'][_0xe7ba('0x49')]()[_0xe7ba('0x26')](respondWithResult(_0x285743,null))[_0xe7ba('0x41')](handleError(_0x285743,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index e75292b..90a6866 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(_0x2dea87,_0x40cf31){var _0x165943=function(_0x496b39){while(--_0x496b39){_0x2dea87['push'](_0x2dea87['shift']());}};_0x165943(++_0x40cf31);}(_0x7a54,0x106));var _0x47a5=function(_0x13383c,_0x1671e8){_0x13383c=_0x13383c-0x0;var _0x28a44=_0x7a54[_0x13383c];return _0x28a44;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2a82f1,_0x4098c9){var _0x530c67=function(_0x4e685d){while(--_0x4e685d){_0x2a82f1['push'](_0x2a82f1['shift']());}};_0x530c67(++_0x4098c9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 1552dc6..dc8beda 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 _0x7630=['jayson/promise','client','request','then','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x526f34,_0x2f9ebf){var _0xfb5838=function(_0xbfea5d){while(--_0xbfea5d){_0x526f34['push'](_0x526f34['shift']());}};_0xfb5838(++_0x2f9ebf);}(_0x7630,0x80));var _0x0763=function(_0x2e5d27,_0x3ef9ca){_0x2e5d27=_0x2e5d27-0x0;var _0x3a6a53=_0x7630[_0x2e5d27];return _0x3a6a53;};'use strict';var _=require(_0x0763('0x0'));var util=require(_0x0763('0x1'));var moment=require(_0x0763('0x2'));var BPromise=require(_0x0763('0x3'));var rs=require(_0x0763('0x4'));var fs=require('fs');var Redis=require(_0x0763('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0763('0x6'));var logger=require(_0x0763('0x7'))(_0x0763('0x8'));var config=require(_0x0763('0x9'));var jayson=require(_0x0763('0xa'));var client=jayson[_0x0763('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x165e14,_0xf39894,_0x44e958){return new BPromise(function(_0x2330c3,_0x17c79c){return client[_0x0763('0xc')](_0x165e14,_0x44e958)[_0x0763('0xd')](function(_0x4f9997){logger['info']('Cdr,\x20%s,\x20%s',_0xf39894,'request\x20sent');logger[_0x0763('0xe')](_0x0763('0xf'),_0xf39894,'request\x20sent',JSON[_0x0763('0x10')](_0x4f9997));if(_0x4f9997[_0x0763('0x11')]){if(_0x4f9997[_0x0763('0x11')][_0x0763('0x12')]===0x1f4){logger[_0x0763('0x11')]('Cdr,\x20%s,\x20%s',_0xf39894,_0x4f9997['error'][_0x0763('0x13')]);return _0x17c79c(_0x4f9997[_0x0763('0x11')][_0x0763('0x13')]);}logger['error'](_0x0763('0x14'),_0xf39894,_0x4f9997[_0x0763('0x11')]['message']);return _0x2330c3(_0x4f9997[_0x0763('0x11')][_0x0763('0x13')]);}else{logger['info'](_0x0763('0x14'),_0xf39894,_0x0763('0x15'));_0x2330c3(_0x4f9997['result'][_0x0763('0x13')]);}})[_0x0763('0x16')](function(_0x3286c3){logger['error']('Cdr,\x20%s,\x20%s',_0xf39894,_0x3286c3);_0x17c79c(_0x3286c3);});});} \ No newline at end of file +var _0x2221=['bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','moment'];(function(_0x5e6cea,_0x24b02a){var _0x55a315=function(_0x395b80){while(--_0x395b80){_0x5e6cea['push'](_0x5e6cea['shift']());}};_0x55a315(++_0x24b02a);}(_0x2221,0xb2));var _0x1222=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x2221[_0x31bab3];return _0x4fd382;};'use strict';var _=require(_0x1222('0x0'));var util=require('util');var moment=require(_0x1222('0x1'));var BPromise=require(_0x1222('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1222('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1222('0x4'))('rpc');var config=require(_0x1222('0x5'));var jayson=require(_0x1222('0x6'));var client=jayson[_0x1222('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a8081,_0x2480b5,_0x47def2){return new BPromise(function(_0x5964c7,_0x4d6245){return client[_0x1222('0x8')](_0x4a8081,_0x47def2)[_0x1222('0x9')](function(_0x1ef8e9){logger[_0x1222('0xa')]('Cdr,\x20%s,\x20%s',_0x2480b5,_0x1222('0xb'));logger[_0x1222('0xc')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2480b5,_0x1222('0xb'),JSON[_0x1222('0xd')](_0x1ef8e9));if(_0x1ef8e9[_0x1222('0xe')]){if(_0x1ef8e9[_0x1222('0xe')][_0x1222('0xf')]===0x1f4){logger[_0x1222('0xe')]('Cdr,\x20%s,\x20%s',_0x2480b5,_0x1ef8e9[_0x1222('0xe')][_0x1222('0x10')]);return _0x4d6245(_0x1ef8e9[_0x1222('0xe')][_0x1222('0x10')]);}logger[_0x1222('0xe')](_0x1222('0x11'),_0x2480b5,_0x1ef8e9[_0x1222('0xe')]['message']);return _0x5964c7(_0x1ef8e9['error']['message']);}else{logger[_0x1222('0xa')](_0x1222('0x11'),_0x2480b5,_0x1222('0xb'));_0x5964c7(_0x1ef8e9[_0x1222('0x12')]['message']);}})[_0x1222('0x13')](function(_0x206adf){logger[_0x1222('0xe')](_0x1222('0x11'),_0x2480b5,_0x206adf);_0x4d6245(_0x206adf);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 0e60f56..9e1bf0d 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('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(_0x7ad6cb,_0xffee6c){var _0x22a0ba=function(_0x47f291){while(--_0x47f291){_0x7ad6cb['push'](_0x7ad6cb['shift']());}};_0x22a0ba(++_0xffee6c);}(_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'));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 ad293b6..f485c55 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 _0xdd67=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0xdd67,0x188));var _0x7dd6=function(_0x3917ed,_0x19008e){_0x3917ed=_0x3917ed-0x0;var _0x154025=_0xdd67[_0x3917ed];return _0x154025;};'use strict';var Sequelize=require('sequelize');module[_0x7dd6('0x0')]={'priority':{'type':Sequelize[_0x7dd6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7dd6('0x2')],'allowNull':![],'defaultValue':_0x7dd6('0x3')},'appdata':{'type':Sequelize[_0x7dd6('0x4')]()},'description':{'type':Sequelize[_0x7dd6('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7dd6('0x5')}}; \ No newline at end of file +var _0x586b=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x232719,_0x37a326){var _0x21ee88=function(_0x4494ff){while(--_0x4494ff){_0x232719['push'](_0x232719['shift']());}};_0x21ee88(++_0x37a326);}(_0x586b,0x1d6));var _0xb586=function(_0xb51316,_0x48f9cb){_0xb51316=_0xb51316-0x0;var _0x365404=_0x586b[_0xb51316];return _0x365404;};'use strict';var Sequelize=require(_0xb586('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb586('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb586('0x2')],'allowNull':![],'defaultValue':_0xb586('0x3')},'appdata':{'type':Sequelize[_0xb586('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb586('0x2')],'defaultValue':_0xb586('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index af4d6ab..d13d5ee 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 _0xa1b9=['to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','stack','name','send','show','keys','ChatApplication','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x38cd9c,_0x139622){var _0x4e8ef3=function(_0x497049){while(--_0x497049){_0x38cd9c['push'](_0x38cd9c['shift']());}};_0x4e8ef3(++_0x139622);}(_0xa1b9,0x71));var _0x9a1b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa1b9[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0x9a1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a1b('0x1'));var jsonpatch=require(_0x9a1b('0x2'));var rp=require(_0x9a1b('0x3'));var moment=require(_0x9a1b('0x4'));var BPromise=require(_0x9a1b('0x5'));var Mustache=require(_0x9a1b('0x6'));var util=require(_0x9a1b('0x7'));var path=require('path');var sox=require(_0x9a1b('0x8'));var csv=require(_0x9a1b('0x9'));var ejs=require(_0x9a1b('0xa'));var fs=require('fs');var fs_extra=require(_0x9a1b('0xb'));var _=require('lodash');var squel=require(_0x9a1b('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a1b('0xd'));var deskjs=require(_0x9a1b('0xe'));var toCsv=require(_0x9a1b('0x9'));var querystring=require(_0x9a1b('0xf'));var Papa=require(_0x9a1b('0x10'));var Redis=require('ioredis');var authService=require(_0x9a1b('0x11'));var qs=require(_0x9a1b('0x12'));var as=require(_0x9a1b('0x13'));var hardwareService=require(_0x9a1b('0x14'));var logger=require(_0x9a1b('0x15'))(_0x9a1b('0x16'));var utils=require(_0x9a1b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a1b('0x18'));var db=require(_0x9a1b('0x19'))['db'];function respondWithStatusCode(_0x27062b,_0x5ee9d3){_0x5ee9d3=_0x5ee9d3||0xcc;return function(_0x1d016d){if(_0x1d016d){return _0x27062b[_0x9a1b('0x1a')](_0x5ee9d3);}return _0x27062b[_0x9a1b('0x1b')](_0x5ee9d3)[_0x9a1b('0x1c')]();};}function respondWithResult(_0x390ad9,_0x157b6f){_0x157b6f=_0x157b6f||0xc8;return function(_0x3fe388){if(_0x3fe388){return _0x390ad9[_0x9a1b('0x1b')](_0x157b6f)[_0x9a1b('0x1d')](_0x3fe388);}};}function respondWithFilteredResult(_0x101622,_0x5c397f){return function(_0x357cd9){if(_0x357cd9){var _0x2440fc=typeof _0x5c397f['offset']===_0x9a1b('0x1e')&&typeof _0x5c397f[_0x9a1b('0x1f')]===_0x9a1b('0x1e');var _0x1a7324=_0x357cd9[_0x9a1b('0x20')];var _0x478626=_0x2440fc?0x0:_0x5c397f[_0x9a1b('0x21')];var _0x599325=_0x2440fc?_0x357cd9[_0x9a1b('0x20')]:_0x5c397f[_0x9a1b('0x21')]+_0x5c397f[_0x9a1b('0x1f')];var _0x1f1dea;if(_0x599325>=_0x1a7324){_0x599325=_0x1a7324;_0x1f1dea=0xc8;}else{_0x1f1dea=0xce;}_0x101622[_0x9a1b('0x1b')](_0x1f1dea);return _0x101622['set'](_0x9a1b('0x22'),_0x478626+'-'+_0x599325+'/'+_0x1a7324)[_0x9a1b('0x1d')](_0x357cd9);}return null;};}function patchUpdates(_0x36c95c){return function(_0x1977a7){try{jsonpatch['apply'](_0x1977a7,_0x36c95c,!![]);}catch(_0x2ccb02){return BPromise[_0x9a1b('0x23')](_0x2ccb02);}return _0x1977a7[_0x9a1b('0x24')]();};}function saveUpdates(_0x13f828,_0x1c9ab3){return function(_0x327cac){if(_0x327cac){return _0x327cac[_0x9a1b('0x25')](_0x13f828)[_0x9a1b('0x26')](function(_0xb6b23a){return _0xb6b23a;});}return null;};}function removeEntity(_0x37971c,_0x5841c1){return function(_0x2439e9){if(_0x2439e9){return _0x2439e9[_0x9a1b('0x27')]()[_0x9a1b('0x26')](function(){_0x37971c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b0ff3,_0x52fce9){return function(_0x17704b){if(!_0x17704b){_0x3b0ff3['sendStatus'](0x194);}return _0x17704b;};}function handleError(_0x5e65ce,_0x48e736){_0x48e736=_0x48e736||0x1f4;return function(_0x432a3d){logger['error'](_0x432a3d[_0x9a1b('0x28')]);if(_0x432a3d[_0x9a1b('0x29')]){delete _0x432a3d[_0x9a1b('0x29')];}_0x5e65ce[_0x9a1b('0x1b')](_0x48e736)[_0x9a1b('0x2a')](_0x432a3d);};}exports[_0x9a1b('0x2b')]=function(_0x1c13d6,_0x1453c4){var _0x4070aa={'raw':!![],'where':{'id':_0x1c13d6['params']['id']}},_0x2d9ca8={};_0x2d9ca8['model']=_[_0x9a1b('0x2c')](db[_0x9a1b('0x2d')]['rawAttributes']);_0x2d9ca8[_0x9a1b('0x2e')]=_[_0x9a1b('0x2c')](_0x1c13d6[_0x9a1b('0x2e')]);_0x2d9ca8[_0x9a1b('0x2f')]=_[_0x9a1b('0x30')](_0x2d9ca8[_0x9a1b('0x31')],_0x2d9ca8[_0x9a1b('0x2e')]);_0x4070aa[_0x9a1b('0x32')]=_[_0x9a1b('0x30')](_0x2d9ca8['model'],qs[_0x9a1b('0x33')](_0x1c13d6['query'][_0x9a1b('0x33')]));_0x4070aa[_0x9a1b('0x32')]=_0x4070aa[_0x9a1b('0x32')][_0x9a1b('0x34')]?_0x4070aa['attributes']:_0x2d9ca8[_0x9a1b('0x31')];if(_0x1c13d6[_0x9a1b('0x2e')][_0x9a1b('0x35')]){_0x4070aa[_0x9a1b('0x36')]=[{'all':!![]}];}_0x4070aa=_[_0x9a1b('0x37')]({},_0x4070aa,_0x1c13d6[_0x9a1b('0x38')]);return db[_0x9a1b('0x2d')][_0x9a1b('0x39')](_0x4070aa)[_0x9a1b('0x26')](handleEntityNotFound(_0x1453c4,null))['then'](respondWithResult(_0x1453c4,null))[_0x9a1b('0x3a')](handleError(_0x1453c4,null));};exports[_0x9a1b('0x25')]=function(_0x3b0637,_0x46c4e5){if(_0x3b0637[_0x9a1b('0x3b')]['id']){delete _0x3b0637[_0x9a1b('0x3b')]['id'];}return db[_0x9a1b('0x2d')]['find']({'where':{'id':_0x3b0637[_0x9a1b('0x3c')]['id']}})[_0x9a1b('0x26')](handleEntityNotFound(_0x46c4e5,null))[_0x9a1b('0x26')](saveUpdates(_0x3b0637[_0x9a1b('0x3b')],null))[_0x9a1b('0x26')](respondWithResult(_0x46c4e5,null))[_0x9a1b('0x3a')](handleError(_0x46c4e5,null));};exports[_0x9a1b('0x27')]=function(_0x446dc6,_0x41b987){return db['ChatApplication'][_0x9a1b('0x39')]({'where':{'id':_0x446dc6[_0x9a1b('0x3c')]['id']}})['then'](handleEntityNotFound(_0x41b987,null))[_0x9a1b('0x26')](removeEntity(_0x41b987,null))[_0x9a1b('0x3a')](handleError(_0x41b987,null));}; \ No newline at end of file +var _0x2504=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','show','params','keys','query','filters','model','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','catch','update','body','eml-format','rimraf'];(function(_0xb8d3aa,_0x526563){var _0x2851ed=function(_0x4deaab){while(--_0x4deaab){_0xb8d3aa['push'](_0xb8d3aa['shift']());}};_0x2851ed(++_0x526563);}(_0x2504,0xee));var _0x4250=function(_0x208ebb,_0x1b2acc){_0x208ebb=_0x208ebb-0x0;var _0x224658=_0x2504[_0x208ebb];return _0x224658;};'use strict';var emlformat=require(_0x4250('0x0'));var rimraf=require(_0x4250('0x1'));var zipdir=require(_0x4250('0x2'));var jsonpatch=require(_0x4250('0x3'));var rp=require(_0x4250('0x4'));var moment=require(_0x4250('0x5'));var BPromise=require(_0x4250('0x6'));var Mustache=require(_0x4250('0x7'));var util=require(_0x4250('0x8'));var path=require(_0x4250('0x9'));var sox=require(_0x4250('0xa'));var csv=require(_0x4250('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4250('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4250('0xd'));var jsforce=require(_0x4250('0xe'));var deskjs=require(_0x4250('0xf'));var toCsv=require(_0x4250('0xb'));var querystring=require(_0x4250('0x10'));var Papa=require('papaparse');var Redis=require(_0x4250('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4250('0x12'));var as=require(_0x4250('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4250('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4250('0x15'));var licenseUtil=require(_0x4250('0x16'));var db=require(_0x4250('0x17'))['db'];function respondWithStatusCode(_0x3c1e7e,_0x2a496b){_0x2a496b=_0x2a496b||0xcc;return function(_0x5d62a0){if(_0x5d62a0){return _0x3c1e7e[_0x4250('0x18')](_0x2a496b);}return _0x3c1e7e[_0x4250('0x19')](_0x2a496b)[_0x4250('0x1a')]();};}function respondWithResult(_0x2c8a75,_0xfa4d8a){_0xfa4d8a=_0xfa4d8a||0xc8;return function(_0x33f317){if(_0x33f317){return _0x2c8a75['status'](_0xfa4d8a)[_0x4250('0x1b')](_0x33f317);}};}function respondWithFilteredResult(_0x46ba15,_0x1b0c66){return function(_0x3cff02){if(_0x3cff02){var _0x2979cd=typeof _0x1b0c66[_0x4250('0x1c')]===_0x4250('0x1d')&&typeof _0x1b0c66['limit']===_0x4250('0x1d');var _0x35d232=_0x3cff02[_0x4250('0x1e')];var _0x17a8a9=_0x2979cd?0x0:_0x1b0c66[_0x4250('0x1c')];var _0x30e48c=_0x2979cd?_0x3cff02[_0x4250('0x1e')]:_0x1b0c66['offset']+_0x1b0c66[_0x4250('0x1f')];var _0x4f0154;if(_0x30e48c>=_0x35d232){_0x30e48c=_0x35d232;_0x4f0154=0xc8;}else{_0x4f0154=0xce;}_0x46ba15['status'](_0x4f0154);return _0x46ba15[_0x4250('0x20')](_0x4250('0x21'),_0x17a8a9+'-'+_0x30e48c+'/'+_0x35d232)[_0x4250('0x1b')](_0x3cff02);}return null;};}function patchUpdates(_0x42c331){return function(_0x242cf1){try{jsonpatch[_0x4250('0x22')](_0x242cf1,_0x42c331,!![]);}catch(_0x1ba772){return BPromise[_0x4250('0x23')](_0x1ba772);}return _0x242cf1[_0x4250('0x24')]();};}function saveUpdates(_0x3818c0,_0x728862){return function(_0x30e2ae){if(_0x30e2ae){return _0x30e2ae['update'](_0x3818c0)[_0x4250('0x25')](function(_0x171df4){return _0x171df4;});}return null;};}function removeEntity(_0x1feb98,_0x523053){return function(_0x5d1a74){if(_0x5d1a74){return _0x5d1a74[_0x4250('0x26')]()[_0x4250('0x25')](function(){_0x1feb98[_0x4250('0x19')](0xcc)[_0x4250('0x1a')]();});}};}function handleEntityNotFound(_0x328ffb,_0x5cb4fe){return function(_0x431d01){if(!_0x431d01){_0x328ffb[_0x4250('0x18')](0x194);}return _0x431d01;};}function handleError(_0x3f40dd,_0x559d06){_0x559d06=_0x559d06||0x1f4;return function(_0x5b155e){logger[_0x4250('0x27')](_0x5b155e['stack']);if(_0x5b155e[_0x4250('0x28')]){delete _0x5b155e[_0x4250('0x28')];}_0x3f40dd[_0x4250('0x19')](_0x559d06)[_0x4250('0x29')](_0x5b155e);};}exports[_0x4250('0x2a')]=function(_0x501c5f,_0x395926){var _0x11ca22={'raw':!![],'where':{'id':_0x501c5f[_0x4250('0x2b')]['id']}},_0x48252b={};_0x48252b['model']=_[_0x4250('0x2c')](db['ChatApplication']['rawAttributes']);_0x48252b[_0x4250('0x2d')]=_['keys'](_0x501c5f[_0x4250('0x2d')]);_0x48252b[_0x4250('0x2e')]=_['intersection'](_0x48252b[_0x4250('0x2f')],_0x48252b[_0x4250('0x2d')]);_0x11ca22['attributes']=_[_0x4250('0x30')](_0x48252b[_0x4250('0x2f')],qs['fields'](_0x501c5f[_0x4250('0x2d')][_0x4250('0x31')]));_0x11ca22[_0x4250('0x32')]=_0x11ca22[_0x4250('0x32')][_0x4250('0x33')]?_0x11ca22[_0x4250('0x32')]:_0x48252b[_0x4250('0x2f')];if(_0x501c5f[_0x4250('0x2d')][_0x4250('0x34')]){_0x11ca22[_0x4250('0x35')]=[{'all':!![]}];}_0x11ca22=_[_0x4250('0x36')]({},_0x11ca22,_0x501c5f[_0x4250('0x37')]);return db[_0x4250('0x38')]['find'](_0x11ca22)[_0x4250('0x25')](handleEntityNotFound(_0x395926,null))['then'](respondWithResult(_0x395926,null))[_0x4250('0x39')](handleError(_0x395926,null));};exports[_0x4250('0x3a')]=function(_0x5c30fc,_0xf14c4e){if(_0x5c30fc[_0x4250('0x3b')]['id']){delete _0x5c30fc[_0x4250('0x3b')]['id'];}return db[_0x4250('0x38')]['find']({'where':{'id':_0x5c30fc['params']['id']}})['then'](handleEntityNotFound(_0xf14c4e,null))[_0x4250('0x25')](saveUpdates(_0x5c30fc[_0x4250('0x3b')],null))['then'](respondWithResult(_0xf14c4e,null))[_0x4250('0x39')](handleError(_0xf14c4e,null));};exports[_0x4250('0x26')]=function(_0x3f2ef7,_0x13d997){return db[_0x4250('0x38')]['find']({'where':{'id':_0x3f2ef7[_0x4250('0x2b')]['id']}})['then'](handleEntityNotFound(_0x13d997,null))['then'](removeEntity(_0x13d997,null))[_0x4250('0x39')](handleError(_0x13d997,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index c716c20..2c7c216 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 _0xf2bc=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0xf2bc,0x134));var _0xcf2b=function(_0x56c37d,_0x486618){_0x56c37d=_0x56c37d-0x0;var _0x120476=_0xf2bc[_0x56c37d];return _0x120476;};'use strict';var _=require('lodash');var util=require(_0xcf2b('0x0'));var logger=require(_0xcf2b('0x1'))('api');var moment=require(_0xcf2b('0x2'));var BPromise=require('bluebird');var rp=require(_0xcf2b('0x3'));var fs=require('fs');var path=require(_0xcf2b('0x4'));var rimraf=require(_0xcf2b('0x5'));var config=require(_0xcf2b('0x6'));var attributes=require('./chatApplication.attributes');module[_0xcf2b('0x7')]=function(_0x34615a,_0x5ed704){return _0x34615a[_0xcf2b('0x8')](_0xcf2b('0x9'),attributes,{'tableName':_0xcf2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9515=['lodash','api','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci'];(function(_0x301211,_0x52c741){var _0x1cb0e6=function(_0x5424f8){while(--_0x5424f8){_0x301211['push'](_0x301211['shift']());}};_0x1cb0e6(++_0x52c741);}(_0x9515,0xe7));var _0x5951=function(_0x44d902,_0x376b4e){_0x44d902=_0x44d902-0x0;var _0x27aa72=_0x9515[_0x44d902];return _0x27aa72;};'use strict';var _=require(_0x5951('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5951('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5951('0x2'));var fs=require('fs');var path=require(_0x5951('0x3'));var rimraf=require(_0x5951('0x4'));var config=require(_0x5951('0x5'));var attributes=require('./chatApplication.attributes');module[_0x5951('0x6')]=function(_0xa35d0f,_0x2bb252){return _0xa35d0f[_0x5951('0x7')](_0x5951('0x8'),attributes,{'tableName':_0x5951('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5951('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index aeb4bb8..e532bf0 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 _0x513d=['client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x513d,0xb4));var _0xd513=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x513d[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xd513('0x0'));var util=require('util');var moment=require(_0xd513('0x1'));var BPromise=require(_0xd513('0x2'));var rs=require(_0xd513('0x3'));var fs=require('fs');var Redis=require(_0xd513('0x4'));var db=require(_0xd513('0x5'))['db'];var utils=require(_0xd513('0x6'));var logger=require(_0xd513('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd513('0x8'));var client=jayson[_0xd513('0x9')][_0xd513('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf5e4e5,_0xff6459,_0x3d8cf4){return new BPromise(function(_0x2795a3,_0x2b7bba){return client['request'](_0xf5e4e5,_0x3d8cf4)[_0xd513('0xb')](function(_0x5bafeb){logger[_0xd513('0xc')](_0xd513('0xd'),_0xff6459,_0xd513('0xe'));logger['debug'](_0xd513('0xf'),_0xff6459,_0xd513('0xe'),JSON[_0xd513('0x10')](_0x5bafeb));if(_0x5bafeb[_0xd513('0x11')]){if(_0x5bafeb[_0xd513('0x11')][_0xd513('0x12')]===0x1f4){logger['error'](_0xd513('0xd'),_0xff6459,_0x5bafeb[_0xd513('0x11')]['message']);return _0x2b7bba(_0x5bafeb[_0xd513('0x11')]['message']);}logger[_0xd513('0x11')](_0xd513('0xd'),_0xff6459,_0x5bafeb[_0xd513('0x11')][_0xd513('0x13')]);return _0x2795a3(_0x5bafeb['error'][_0xd513('0x13')]);}else{logger[_0xd513('0xc')]('ChatApplication,\x20%s,\x20%s',_0xff6459,_0xd513('0xe'));_0x2795a3(_0x5bafeb['result'][_0xd513('0x13')]);}})[_0xd513('0x14')](function(_0x3ca702){logger[_0xd513('0x11')](_0xd513('0xd'),_0xff6459,_0x3ca702);_0x2b7bba(_0x3ca702);});});} \ No newline at end of file +var _0xe788=['message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xe788,0x158));var _0x8e78=function(_0x1dc5d4,_0x25ec81){_0x1dc5d4=_0x1dc5d4-0x0;var _0x56b0a3=_0xe788[_0x1dc5d4];return _0x56b0a3;};'use strict';var _=require('lodash');var util=require(_0x8e78('0x0'));var moment=require('moment');var BPromise=require(_0x8e78('0x1'));var rs=require(_0x8e78('0x2'));var fs=require('fs');var Redis=require(_0x8e78('0x3'));var db=require(_0x8e78('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8e78('0x5'));var jayson=require(_0x8e78('0x6'));var client=jayson[_0x8e78('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c306a,_0x495730,_0x10bc3d){return new BPromise(function(_0x44a523,_0x2d7759){return client['request'](_0x4c306a,_0x10bc3d)[_0x8e78('0x8')](function(_0x44849f){logger[_0x8e78('0x9')]('ChatApplication,\x20%s,\x20%s',_0x495730,_0x8e78('0xa'));logger[_0x8e78('0xb')](_0x8e78('0xc'),_0x495730,_0x8e78('0xa'),JSON[_0x8e78('0xd')](_0x44849f));if(_0x44849f[_0x8e78('0xe')]){if(_0x44849f['error'][_0x8e78('0xf')]===0x1f4){logger[_0x8e78('0xe')](_0x8e78('0x10'),_0x495730,_0x44849f[_0x8e78('0xe')]['message']);return _0x2d7759(_0x44849f[_0x8e78('0xe')][_0x8e78('0x11')]);}logger[_0x8e78('0xe')](_0x8e78('0x10'),_0x495730,_0x44849f[_0x8e78('0xe')][_0x8e78('0x11')]);return _0x44a523(_0x44849f['error'][_0x8e78('0x11')]);}else{logger['info'](_0x8e78('0x10'),_0x495730,_0x8e78('0xa'));_0x44a523(_0x44849f[_0x8e78('0x12')][_0x8e78('0x11')]);}})['catch'](function(_0x4d3529){logger[_0x8e78('0xe')](_0x8e78('0x10'),_0x495730,_0x4d3529);_0x2d7759(_0x4d3529);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index db4c249..3a036e5 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 _0x2cd7=['util','path','connect-timeout','fs-extra','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','exports','multer'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0x2cd7,0x141));var _0x72cd=function(_0x1923f2,_0x47e87a){_0x1923f2=_0x1923f2-0x0;var _0x123fde=_0x2cd7[_0x1923f2];return _0x123fde;};'use strict';var multer=require(_0x72cd('0x0'));var util=require(_0x72cd('0x1'));var path=require(_0x72cd('0x2'));var timeout=require(_0x72cd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x72cd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x72cd('0x5'));var controller=require('./chatApplication.controller');router[_0x72cd('0x6')](_0x72cd('0x7'),auth[_0x72cd('0x8')](),controller[_0x72cd('0x9')]);router[_0x72cd('0xa')](_0x72cd('0x7'),auth[_0x72cd('0x8')](),controller[_0x72cd('0xb')]);router[_0x72cd('0xc')](_0x72cd('0x7'),auth[_0x72cd('0x8')](),controller['destroy']);module[_0x72cd('0xd')]=router; \ No newline at end of file +var _0x61cb=['multer','util','path','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','exports'];(function(_0x595a21,_0x24790f){var _0x50df84=function(_0x3c7188){while(--_0x3c7188){_0x595a21['push'](_0x595a21['shift']());}};_0x50df84(++_0x24790f);}(_0x61cb,0x1c7));var _0xb61c=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0x61cb[_0x4bfade];return _0x272465;};'use strict';var multer=require(_0xb61c('0x0'));var util=require(_0xb61c('0x1'));var path=require(_0xb61c('0x2'));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(_0xb61c('0x3'));var config=require(_0xb61c('0x4'));var controller=require(_0xb61c('0x5'));router[_0xb61c('0x6')](_0xb61c('0x7'),auth['isAuthenticated'](),controller[_0xb61c('0x8')]);router[_0xb61c('0x9')]('/:id',auth[_0xb61c('0xa')](),controller[_0xb61c('0xb')]);router['delete']('/:id',auth[_0xb61c('0xa')](),controller['destroy']);module[_0xb61c('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index bff1cd2..d6ea66e 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 _0xf424=['BOOLEAN','exports','STRING'];(function(_0x563df9,_0x3b43e5){var _0x22807f=function(_0x20ef5f){while(--_0x20ef5f){_0x563df9['push'](_0x563df9['shift']());}};_0x22807f(++_0x3b43e5);}(_0xf424,0x15d));var _0x4f42=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0xf424[_0x585d09];return _0x7d9a14;};'use strict';var Sequelize=require('sequelize');module[_0x4f42('0x0')]={'name':{'type':Sequelize[_0x4f42('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4f42('0x1')]},'write':{'type':Sequelize[_0x4f42('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3f54=['sequelize','exports','STRING','BOOLEAN'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x3f54,0xe4));var _0x43f5=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x3f54[_0x3ae2b2];return _0x1dbf00;};'use strict';var Sequelize=require(_0x43f5('0x0'));module[_0x43f5('0x1')]={'name':{'type':Sequelize[_0x43f5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x43f5('0x2')]},'write':{'type':Sequelize[_0x43f5('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 301122f..e84a826 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 _0x388a=['format','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','name','send','map','ChatGroup','fieldName','type','model','keys','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','rows','catch','rawAttributes','includeAll','create','body','find','params','describe','getUnread','user','toInteger','addMembers','ids','omit','findOne','User','length','getMembers','removeMembers','ChatGroupId','ChatInternalMessage','$gte','split'];(function(_0x508b21,_0x44aaf5){var _0x5cdc61=function(_0x3ba63d){while(--_0x3ba63d){_0x508b21['push'](_0x508b21['shift']());}};_0x5cdc61(++_0x44aaf5);}(_0x388a,0x1d3));var _0xa388=function(_0x14700a,_0x150952){_0x14700a=_0x14700a-0x0;var _0x1e6155=_0x388a[_0x14700a];return _0x1e6155;};'use strict';var emlformat=require(_0xa388('0x0'));var rimraf=require(_0xa388('0x1'));var zipdir=require(_0xa388('0x2'));var jsonpatch=require(_0xa388('0x3'));var rp=require(_0xa388('0x4'));var moment=require('moment');var BPromise=require(_0xa388('0x5'));var Mustache=require(_0xa388('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa388('0x7'));var csv=require(_0xa388('0x8'));var ejs=require(_0xa388('0x9'));var fs=require('fs');var fs_extra=require(_0xa388('0xa'));var _=require(_0xa388('0xb'));var squel=require(_0xa388('0xc'));var crypto=require(_0xa388('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa388('0xe'));var toCsv=require(_0xa388('0x8'));var querystring=require(_0xa388('0xf'));var Papa=require('papaparse');var Redis=require(_0xa388('0x10'));var authService=require(_0xa388('0x11'));var qs=require(_0xa388('0x12'));var as=require(_0xa388('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa388('0x14'));var licenseUtil=require(_0xa388('0x15'));var db=require(_0xa388('0x16'))['db'];config['redis']=_[_0xa388('0x17')](config[_0xa388('0x18')],{'host':_0xa388('0x19'),'port':0x18eb});var socket=require(_0xa388('0x1a'))(new Redis(config['redis']));require(_0xa388('0x1b'))[_0xa388('0x1c')](socket);function respondWithStatusCode(_0x3b5e5e,_0x1cd3ea){_0x1cd3ea=_0x1cd3ea||0xcc;return function(_0x57f7cd){if(_0x57f7cd){return _0x3b5e5e['sendStatus'](_0x1cd3ea);}return _0x3b5e5e[_0xa388('0x1d')](_0x1cd3ea)['end']();};}function respondWithResult(_0x483803,_0x249bec){_0x249bec=_0x249bec||0xc8;return function(_0x297e40){if(_0x297e40){return _0x483803[_0xa388('0x1d')](_0x249bec)[_0xa388('0x1e')](_0x297e40);}};}function respondWithFilteredResult(_0x377455,_0x46b64a){return function(_0x3da9b2){if(_0x3da9b2){var _0x4a60f7=typeof _0x46b64a[_0xa388('0x1f')]==='undefined'&&typeof _0x46b64a[_0xa388('0x20')]===_0xa388('0x21');var _0x1a05cb=_0x3da9b2[_0xa388('0x22')];var _0x5a8ee8=_0x4a60f7?0x0:_0x46b64a[_0xa388('0x1f')];var _0x8aef43=_0x4a60f7?_0x3da9b2[_0xa388('0x22')]:_0x46b64a[_0xa388('0x1f')]+_0x46b64a['limit'];var _0x54096a;if(_0x8aef43>=_0x1a05cb){_0x8aef43=_0x1a05cb;_0x54096a=0xc8;}else{_0x54096a=0xce;}_0x377455[_0xa388('0x1d')](_0x54096a);return _0x377455['set'](_0xa388('0x23'),_0x5a8ee8+'-'+_0x8aef43+'/'+_0x1a05cb)['json'](_0x3da9b2);}return null;};}function patchUpdates(_0x509e87){return function(_0x347f04){try{jsonpatch['apply'](_0x347f04,_0x509e87,!![]);}catch(_0x3e4cca){return BPromise[_0xa388('0x24')](_0x3e4cca);}return _0x347f04[_0xa388('0x25')]();};}function saveUpdates(_0x2fc963,_0x14beac){return function(_0x270443){if(_0x270443){return _0x270443[_0xa388('0x26')](_0x2fc963)[_0xa388('0x27')](function(_0x31eed6){return _0x31eed6;});}return null;};}function removeEntity(_0x25ac6d,_0xa345c7){return function(_0x28ebfe){if(_0x28ebfe){return _0x28ebfe[_0xa388('0x28')]()[_0xa388('0x27')](function(){_0x25ac6d[_0xa388('0x1d')](0xcc)[_0xa388('0x29')]();});}};}function handleEntityNotFound(_0x347c32,_0x368bd5){return function(_0x374670){if(!_0x374670){_0x347c32[_0xa388('0x2a')](0x194);}return _0x374670;};}function handleError(_0x1c36f5,_0x408670){_0x408670=_0x408670||0x1f4;return function(_0x549e1c){logger[_0xa388('0x2b')](_0x549e1c['stack']);if(_0x549e1c['name']){delete _0x549e1c[_0xa388('0x2c')];}_0x1c36f5[_0xa388('0x1d')](_0x408670)[_0xa388('0x2d')](_0x549e1c);};}exports['index']=function(_0x5c02d0,_0x4e967a){var _0x2f0727={},_0x2c1808={},_0x44a574={'count':0x0,'rows':[]};var _0x3a2add=_[_0xa388('0x2e')](db[_0xa388('0x2f')]['rawAttributes'],function(_0x3cb5fc){return{'name':_0x3cb5fc[_0xa388('0x30')],'type':_0x3cb5fc[_0xa388('0x31')]['key']};});_0x2c1808[_0xa388('0x32')]=_[_0xa388('0x2e')](_0x3a2add,_0xa388('0x2c'));_0x2c1808['query']=_[_0xa388('0x33')](_0x5c02d0['query']);_0x2c1808['filters']=_[_0xa388('0x34')](_0x2c1808[_0xa388('0x32')],_0x2c1808['query']);_0x2f0727[_0xa388('0x35')]=_[_0xa388('0x34')](_0x2c1808[_0xa388('0x32')],qs[_0xa388('0x36')](_0x5c02d0[_0xa388('0x37')]['fields']));_0x2f0727[_0xa388('0x35')]=_0x2f0727['attributes']['length']?_0x2f0727[_0xa388('0x35')]:_0x2c1808['model'];if(!_0x5c02d0[_0xa388('0x37')][_0xa388('0x38')](_0xa388('0x39'))){_0x2f0727['limit']=qs[_0xa388('0x20')](_0x5c02d0['query'][_0xa388('0x20')]);_0x2f0727[_0xa388('0x1f')]=qs[_0xa388('0x1f')](_0x5c02d0[_0xa388('0x37')][_0xa388('0x1f')]);}_0x2f0727[_0xa388('0x3a')]=qs['sort'](_0x5c02d0[_0xa388('0x37')][_0xa388('0x3b')]);_0x2f0727[_0xa388('0x3c')]=qs[_0xa388('0x3d')](_[_0xa388('0x3e')](_0x5c02d0['query'],_0x2c1808[_0xa388('0x3d')]),_0x3a2add);if(_0x5c02d0[_0xa388('0x37')][_0xa388('0x3f')]){_0x2f0727[_0xa388('0x3c')]=_[_0xa388('0x40')](_0x2f0727[_0xa388('0x3c')],{'$or':_[_0xa388('0x2e')](_0x3a2add,function(_0x2c8e84){if(_0x2c8e84['type']!=='VIRTUAL'){var _0x4f933e={};_0x4f933e[_0x2c8e84['name']]={'$like':'%'+_0x5c02d0[_0xa388('0x37')]['filter']+'%'};return _0x4f933e;}})});}_0x2f0727=_[_0xa388('0x40')]({},_0x2f0727,_0x5c02d0[_0xa388('0x41')]);var _0x56382a={'where':_0x2f0727['where']};return db[_0xa388('0x2f')]['count'](_0x56382a)['then'](function(_0x1775bb){_0x44a574[_0xa388('0x22')]=_0x1775bb;if(_0x5c02d0[_0xa388('0x37')]['includeAll']){_0x2f0727[_0xa388('0x42')]=[{'all':!![]}];}return db[_0xa388('0x2f')]['findAll'](_0x2f0727);})['then'](function(_0x203b5d){_0x44a574[_0xa388('0x43')]=_0x203b5d;return _0x44a574;})['then'](respondWithFilteredResult(_0x4e967a,_0x2f0727))[_0xa388('0x44')](handleError(_0x4e967a,null));};exports['show']=function(_0x39b2b1,_0x538e90){var _0x1779d8={'raw':!![],'where':{'id':_0x39b2b1['params']['id']}},_0x2ae844={};_0x2ae844['model']=_[_0xa388('0x33')](db[_0xa388('0x2f')][_0xa388('0x45')]);_0x2ae844[_0xa388('0x37')]=_[_0xa388('0x33')](_0x39b2b1['query']);_0x2ae844[_0xa388('0x3d')]=_[_0xa388('0x34')](_0x2ae844[_0xa388('0x32')],_0x2ae844['query']);_0x1779d8[_0xa388('0x35')]=_[_0xa388('0x34')](_0x2ae844[_0xa388('0x32')],qs[_0xa388('0x36')](_0x39b2b1[_0xa388('0x37')][_0xa388('0x36')]));_0x1779d8[_0xa388('0x35')]=_0x1779d8['attributes']['length']?_0x1779d8[_0xa388('0x35')]:_0x2ae844[_0xa388('0x32')];if(_0x39b2b1[_0xa388('0x37')][_0xa388('0x46')]){_0x1779d8[_0xa388('0x42')]=[{'all':!![]}];}_0x1779d8=_[_0xa388('0x40')]({},_0x1779d8,_0x39b2b1['options']);return db['ChatGroup']['find'](_0x1779d8)[_0xa388('0x27')](handleEntityNotFound(_0x538e90,null))[_0xa388('0x27')](respondWithResult(_0x538e90,null))[_0xa388('0x44')](handleError(_0x538e90,null));};exports[_0xa388('0x47')]=function(_0x2c5ba6,_0x471d2d){return db[_0xa388('0x2f')][_0xa388('0x47')](_0x2c5ba6['body'],{})[_0xa388('0x27')](respondWithResult(_0x471d2d,0xc9))[_0xa388('0x44')](handleError(_0x471d2d,null));};exports[_0xa388('0x26')]=function(_0x159bde,_0x34f47c){if(_0x159bde['body']['id']){delete _0x159bde[_0xa388('0x48')]['id'];}return db['ChatGroup'][_0xa388('0x49')]({'where':{'id':_0x159bde[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x34f47c,null))[_0xa388('0x27')](saveUpdates(_0x159bde[_0xa388('0x48')],null))[_0xa388('0x27')](respondWithResult(_0x34f47c,null))[_0xa388('0x44')](handleError(_0x34f47c,null));};exports[_0xa388('0x28')]=function(_0x32b4d5,_0x3759e0){return db[_0xa388('0x2f')][_0xa388('0x49')]({'where':{'id':_0x32b4d5[_0xa388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3759e0,null))[_0xa388('0x27')](removeEntity(_0x3759e0,null))[_0xa388('0x44')](handleError(_0x3759e0,null));};exports[_0xa388('0x4b')]=function(_0x5101fc,_0x411dac){return db[_0xa388('0x2f')][_0xa388('0x4b')]()[_0xa388('0x27')](respondWithResult(_0x411dac,null))[_0xa388('0x44')](handleError(_0x411dac,null));};exports[_0xa388('0x4c')]=function(_0x199577,_0xc69b71,_0x4a8523){return db['ChatInternalMessage'][_0xa388('0x22')]({'where':{'ChatGroupId':_0x199577['params']['id'],'ToId':_0x199577[_0xa388('0x4d')]['id'],'read':![]}})[_0xa388('0x27')](function(_0x3eeb03){return{'id':_[_0xa388('0x4e')](_0x199577[_0xa388('0x4a')]['id']),'count':_0x3eeb03};})[_0xa388('0x27')](respondWithResult(_0xc69b71,null))['catch'](handleError(_0xc69b71,null));};exports[_0xa388('0x4f')]=function(_0x53e1f6,_0x53b4ab,_0x5acd71){return db['ChatGroup'][_0xa388('0x49')]({'where':{'id':_0x53e1f6[_0xa388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53b4ab,null))[_0xa388('0x27')](function(_0x4517a5){if(_0x4517a5){return _0x4517a5[_0xa388('0x4f')](_0x53e1f6[_0xa388('0x48')][_0xa388('0x50')],_[_0xa388('0x51')](_0x53e1f6[_0xa388('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x53b4ab,null))['catch'](handleError(_0x53b4ab,null));};exports['getMembers']=function(_0x3cc146,_0x484dc1,_0x165348){var _0x27bbeb={};var _0x2981c5={};var _0x3839f2;var _0x4523fa;return db[_0xa388('0x2f')][_0xa388('0x52')]({'where':{'id':_0x3cc146[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x484dc1,null))[_0xa388('0x27')](function(_0x2475a3){if(_0x2475a3){_0x3839f2=_0x2475a3;_0x2981c5[_0xa388('0x32')]=_[_0xa388('0x33')](db[_0xa388('0x53')]['rawAttributes']);_0x2981c5[_0xa388('0x37')]=_['keys'](_0x3cc146['query']);_0x2981c5['filters']=_[_0xa388('0x34')](_0x2981c5['model'],_0x2981c5[_0xa388('0x37')]);_0x27bbeb[_0xa388('0x35')]=_[_0xa388('0x34')](_0x2981c5[_0xa388('0x32')],qs[_0xa388('0x36')](_0x3cc146[_0xa388('0x37')][_0xa388('0x36')]));_0x27bbeb[_0xa388('0x35')]=_0x27bbeb[_0xa388('0x35')][_0xa388('0x54')]?_0x27bbeb['attributes']:_0x2981c5[_0xa388('0x32')];_0x27bbeb[_0xa388('0x3a')]=qs['sort'](_0x3cc146['query']['sort']);_0x27bbeb[_0xa388('0x3c')]=qs[_0xa388('0x3d')](_[_0xa388('0x3e')](_0x3cc146[_0xa388('0x37')],_0x2981c5[_0xa388('0x3d')]));if(_0x3cc146[_0xa388('0x37')][_0xa388('0x3f')]){_0x27bbeb[_0xa388('0x3c')]=_[_0xa388('0x40')](_0x27bbeb[_0xa388('0x3c')],{'$or':_[_0xa388('0x2e')](_0x27bbeb[_0xa388('0x35')],function(_0x4b1707){var _0xfa6859={};_0xfa6859[_0x4b1707]={'$like':'%'+_0x3cc146['query']['filter']+'%'};return _0xfa6859;})});}_0x27bbeb=_[_0xa388('0x40')]({},_0x27bbeb,_0x3cc146[_0xa388('0x41')]);return _0x3839f2[_0xa388('0x55')](_0x27bbeb);}})[_0xa388('0x27')](function(_0x23bc98){if(_0x23bc98){_0x4523fa=_0x23bc98[_0xa388('0x54')];if(!_0x3cc146[_0xa388('0x37')][_0xa388('0x38')]('nolimit')){_0x27bbeb[_0xa388('0x20')]=qs[_0xa388('0x20')](_0x3cc146[_0xa388('0x37')]['limit']);_0x27bbeb['offset']=qs[_0xa388('0x1f')](_0x3cc146[_0xa388('0x37')][_0xa388('0x1f')]);}return _0x3839f2['getMembers'](_0x27bbeb);}})[_0xa388('0x27')](function(_0x21daa1){if(_0x21daa1){return _0x21daa1?{'count':_0x4523fa,'rows':_0x21daa1}:null;}})[_0xa388('0x27')](respondWithResult(_0x484dc1,null))['catch'](handleError(_0x484dc1,null));};exports[_0xa388('0x56')]=function(_0x5e72fe,_0x3051e0,_0x4c6331){return db[_0xa388('0x2f')][_0xa388('0x49')]({'where':{'id':_0x5e72fe[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x3051e0,null))[_0xa388('0x27')](function(_0x1da61b){if(_0x1da61b){return _0x1da61b[_0xa388('0x56')](_0x5e72fe[_0xa388('0x37')][_0xa388('0x50')]);}})[_0xa388('0x27')](respondWithStatusCode(_0x3051e0,null))['catch'](handleError(_0x3051e0,null));};exports['addMessage']=function(_0x420d7f,_0x3e8e61,_0x39396f){if(_0x420d7f[_0xa388('0x48')]['id']){delete _0x420d7f[_0xa388('0x48')]['id'];}return db[_0xa388('0x2f')][_0xa388('0x49')]({'where':{'id':_0x420d7f[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x3e8e61,null))[_0xa388('0x27')](function(_0x358c01){if(_0x358c01){_0x420d7f['body'][_0xa388('0x57')]=_0x358c01['id'];return db[_0xa388('0x58')][_0xa388('0x47')](_0x420d7f[_0xa388('0x48')]);}})['then'](respondWithResult(_0x3e8e61,null))[_0xa388('0x44')](handleError(_0x3e8e61,null));};exports['getMessages']=function(_0x5c5bfd,_0x4239f6,_0x359cc7){var _0x9b57b7={};var _0x163ae1={};var _0x444ca3;var _0x3ef598;return db[_0xa388('0x2f')][_0xa388('0x52')]({'where':{'id':_0x5c5bfd[_0xa388('0x4a')]['id']}})[_0xa388('0x27')](handleEntityNotFound(_0x4239f6,null))['then'](function(_0x46fc14){if(_0x46fc14){_0x444ca3=_0x46fc14;_0x163ae1[_0xa388('0x32')]=_['keys'](db[_0xa388('0x58')][_0xa388('0x45')]);_0x163ae1[_0xa388('0x37')]=_['keys'](_0x5c5bfd[_0xa388('0x37')]);_0x163ae1[_0xa388('0x3d')]=_['intersection'](_0x163ae1['model'],_0x163ae1['query']);_0x9b57b7[_0xa388('0x35')]=_[_0xa388('0x34')](_0x163ae1['model'],qs[_0xa388('0x36')](_0x5c5bfd[_0xa388('0x37')][_0xa388('0x36')]));_0x9b57b7[_0xa388('0x35')]=_0x9b57b7[_0xa388('0x35')][_0xa388('0x54')]?_0x9b57b7[_0xa388('0x35')]:_0x163ae1[_0xa388('0x32')];_0x9b57b7[_0xa388('0x3a')]=qs[_0xa388('0x3b')](_0x5c5bfd[_0xa388('0x37')][_0xa388('0x3b')]);_0x9b57b7[_0xa388('0x3c')]=qs[_0xa388('0x3d')](_[_0xa388('0x3e')](_0x5c5bfd[_0xa388('0x37')],_0x163ae1['filters']));if(_0x5c5bfd[_0xa388('0x37')][_0xa388('0x3f')]){_0x9b57b7[_0xa388('0x3c')]=_[_0xa388('0x40')](_0x9b57b7[_0xa388('0x3c')],{'$or':_[_0xa388('0x2e')](_0x9b57b7[_0xa388('0x35')],function(_0x338604){var _0xf9435a={};_0xf9435a[_0x338604]={'$like':'%'+_0x5c5bfd[_0xa388('0x37')][_0xa388('0x3f')]+'%'};return _0xf9435a;})});}if(_0x5c5bfd['query'][_0xa388('0x59')]){var _0xd4e99=_0x5c5bfd['query'][_0xa388('0x59')][_0xa388('0x5a')](',');var _0x457bac={};_0x457bac[_0xd4e99[0x0]]={'$gte':moment(_0xd4e99[0x1])[_0xa388('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x9b57b7[_0xa388('0x3c')]=_[_0xa388('0x40')](_0x9b57b7[_0xa388('0x3c')],_0x457bac);}_0x9b57b7=_[_0xa388('0x40')]({},_0x9b57b7,_0x5c5bfd[_0xa388('0x41')]);return _0x444ca3[_0xa388('0x5c')](_0x9b57b7);}})[_0xa388('0x27')](function(_0x295dff){if(_0x295dff){_0x3ef598=_0x295dff[_0xa388('0x54')];if(!_0x5c5bfd[_0xa388('0x37')][_0xa388('0x38')](_0xa388('0x39'))){_0x9b57b7[_0xa388('0x20')]=qs['limit'](_0x5c5bfd[_0xa388('0x37')][_0xa388('0x20')]);_0x9b57b7[_0xa388('0x1f')]=qs[_0xa388('0x1f')](_0x5c5bfd[_0xa388('0x37')][_0xa388('0x1f')]);}return _0x444ca3[_0xa388('0x5c')](_0x9b57b7);}})[_0xa388('0x27')](function(_0xd0e5a9){if(_0xd0e5a9){return _0xd0e5a9?{'count':_0x3ef598,'rows':_0xd0e5a9}:null;}})[_0xa388('0x27')](respondWithResult(_0x4239f6,null))[_0xa388('0x44')](handleError(_0x4239f6,null));}; \ No newline at end of file +var _0x8fe6=['nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','destroy','describe','getUnread','addMembers','ids','omit','findOne','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','ChatInternalMessage','order','$gte','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0xae22fb,_0x3c6a6a){var _0x4d3f13=function(_0x42c642){while(--_0x42c642){_0xae22fb['push'](_0xae22fb['shift']());}};_0x4d3f13(++_0x3c6a6a);}(_0x8fe6,0x7e));var _0x68fe=function(_0x509a14,_0x4fff5e){_0x509a14=_0x509a14-0x0;var _0x868244=_0x8fe6[_0x509a14];return _0x868244;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x68fe('0x0'));var zipdir=require(_0x68fe('0x1'));var jsonpatch=require(_0x68fe('0x2'));var rp=require(_0x68fe('0x3'));var moment=require(_0x68fe('0x4'));var BPromise=require(_0x68fe('0x5'));var Mustache=require(_0x68fe('0x6'));var util=require(_0x68fe('0x7'));var path=require('path');var sox=require(_0x68fe('0x8'));var csv=require(_0x68fe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68fe('0xa'));var _=require(_0x68fe('0xb'));var squel=require(_0x68fe('0xc'));var crypto=require(_0x68fe('0xd'));var jsforce=require(_0x68fe('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x68fe('0xf'));var Papa=require('papaparse');var Redis=require(_0x68fe('0x10'));var authService=require(_0x68fe('0x11'));var qs=require(_0x68fe('0x12'));var as=require(_0x68fe('0x13'));var hardwareService=require(_0x68fe('0x14'));var logger=require(_0x68fe('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x68fe('0x16'));var db=require(_0x68fe('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x68fe('0x18'),'port':0x18eb});var socket=require(_0x68fe('0x19'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x68fe('0x1a')](socket);function respondWithStatusCode(_0x3bcced,_0x227867){_0x227867=_0x227867||0xcc;return function(_0x507e98){if(_0x507e98){return _0x3bcced[_0x68fe('0x1b')](_0x227867);}return _0x3bcced[_0x68fe('0x1c')](_0x227867)[_0x68fe('0x1d')]();};}function respondWithResult(_0x12068a,_0x163be3){_0x163be3=_0x163be3||0xc8;return function(_0x186bbe){if(_0x186bbe){return _0x12068a[_0x68fe('0x1c')](_0x163be3)[_0x68fe('0x1e')](_0x186bbe);}};}function respondWithFilteredResult(_0x17059f,_0x3a4c43){return function(_0x1f524b){if(_0x1f524b){var _0x4efe7e=typeof _0x3a4c43[_0x68fe('0x1f')]===_0x68fe('0x20')&&typeof _0x3a4c43[_0x68fe('0x21')]===_0x68fe('0x20');var _0x4055f3=_0x1f524b[_0x68fe('0x22')];var _0x1332e9=_0x4efe7e?0x0:_0x3a4c43[_0x68fe('0x1f')];var _0x54adcb=_0x4efe7e?_0x1f524b[_0x68fe('0x22')]:_0x3a4c43[_0x68fe('0x1f')]+_0x3a4c43['limit'];var _0x31dbbb;if(_0x54adcb>=_0x4055f3){_0x54adcb=_0x4055f3;_0x31dbbb=0xc8;}else{_0x31dbbb=0xce;}_0x17059f['status'](_0x31dbbb);return _0x17059f[_0x68fe('0x23')]('Content-Range',_0x1332e9+'-'+_0x54adcb+'/'+_0x4055f3)[_0x68fe('0x1e')](_0x1f524b);}return null;};}function patchUpdates(_0x46c854){return function(_0x3a6f5c){try{jsonpatch['apply'](_0x3a6f5c,_0x46c854,!![]);}catch(_0x201000){return BPromise[_0x68fe('0x24')](_0x201000);}return _0x3a6f5c[_0x68fe('0x25')]();};}function saveUpdates(_0x186a66,_0x1ab2a6){return function(_0x6b5510){if(_0x6b5510){return _0x6b5510[_0x68fe('0x26')](_0x186a66)[_0x68fe('0x27')](function(_0x1d4663){return _0x1d4663;});}return null;};}function removeEntity(_0x3104d5,_0x275ff7){return function(_0x24ee4c){if(_0x24ee4c){return _0x24ee4c['destroy']()[_0x68fe('0x27')](function(){_0x3104d5[_0x68fe('0x1c')](0xcc)[_0x68fe('0x1d')]();});}};}function handleEntityNotFound(_0x34f99c,_0x47d628){return function(_0x583519){if(!_0x583519){_0x34f99c['sendStatus'](0x194);}return _0x583519;};}function handleError(_0x13b953,_0x2b1d19){_0x2b1d19=_0x2b1d19||0x1f4;return function(_0x5cd08a){logger[_0x68fe('0x28')](_0x5cd08a[_0x68fe('0x29')]);if(_0x5cd08a[_0x68fe('0x2a')]){delete _0x5cd08a['name'];}_0x13b953['status'](_0x2b1d19)[_0x68fe('0x2b')](_0x5cd08a);};}exports['index']=function(_0x35fffb,_0x391416){var _0x2cb444={},_0x15b068={},_0x158c87={'count':0x0,'rows':[]};var _0x4c559a=_[_0x68fe('0x2c')](db[_0x68fe('0x2d')][_0x68fe('0x2e')],function(_0x3f80a7){return{'name':_0x3f80a7[_0x68fe('0x2f')],'type':_0x3f80a7[_0x68fe('0x30')][_0x68fe('0x31')]};});_0x15b068['model']=_[_0x68fe('0x2c')](_0x4c559a,_0x68fe('0x2a'));_0x15b068[_0x68fe('0x32')]=_[_0x68fe('0x33')](_0x35fffb[_0x68fe('0x32')]);_0x15b068[_0x68fe('0x34')]=_[_0x68fe('0x35')](_0x15b068[_0x68fe('0x36')],_0x15b068[_0x68fe('0x32')]);_0x2cb444[_0x68fe('0x37')]=_[_0x68fe('0x35')](_0x15b068[_0x68fe('0x36')],qs['fields'](_0x35fffb['query'][_0x68fe('0x38')]));_0x2cb444[_0x68fe('0x37')]=_0x2cb444[_0x68fe('0x37')][_0x68fe('0x39')]?_0x2cb444['attributes']:_0x15b068['model'];if(!_0x35fffb['query']['hasOwnProperty'](_0x68fe('0x3a'))){_0x2cb444[_0x68fe('0x21')]=qs[_0x68fe('0x21')](_0x35fffb['query'][_0x68fe('0x21')]);_0x2cb444[_0x68fe('0x1f')]=qs[_0x68fe('0x1f')](_0x35fffb['query'][_0x68fe('0x1f')]);}_0x2cb444['order']=qs[_0x68fe('0x3b')](_0x35fffb[_0x68fe('0x32')][_0x68fe('0x3b')]);_0x2cb444['where']=qs[_0x68fe('0x34')](_[_0x68fe('0x3c')](_0x35fffb[_0x68fe('0x32')],_0x15b068[_0x68fe('0x34')]),_0x4c559a);if(_0x35fffb['query'][_0x68fe('0x3d')]){_0x2cb444[_0x68fe('0x3e')]=_[_0x68fe('0x3f')](_0x2cb444[_0x68fe('0x3e')],{'$or':_[_0x68fe('0x2c')](_0x4c559a,function(_0x5d166e){if(_0x5d166e[_0x68fe('0x30')]!==_0x68fe('0x40')){var _0x2f0206={};_0x2f0206[_0x5d166e[_0x68fe('0x2a')]]={'$like':'%'+_0x35fffb['query'][_0x68fe('0x3d')]+'%'};return _0x2f0206;}})});}_0x2cb444=_['merge']({},_0x2cb444,_0x35fffb[_0x68fe('0x41')]);var _0x74e0fd={'where':_0x2cb444['where']};return db[_0x68fe('0x2d')]['count'](_0x74e0fd)['then'](function(_0x2f39a0){_0x158c87[_0x68fe('0x22')]=_0x2f39a0;if(_0x35fffb[_0x68fe('0x32')][_0x68fe('0x42')]){_0x2cb444[_0x68fe('0x43')]=[{'all':!![]}];}return db[_0x68fe('0x2d')]['findAll'](_0x2cb444);})[_0x68fe('0x27')](function(_0x25406e){_0x158c87[_0x68fe('0x44')]=_0x25406e;return _0x158c87;})['then'](respondWithFilteredResult(_0x391416,_0x2cb444))[_0x68fe('0x45')](handleError(_0x391416,null));};exports['show']=function(_0x389e84,_0x2e530f){var _0x389c7d={'raw':!![],'where':{'id':_0x389e84[_0x68fe('0x46')]['id']}},_0x476859={};_0x476859[_0x68fe('0x36')]=_[_0x68fe('0x33')](db['ChatGroup'][_0x68fe('0x2e')]);_0x476859[_0x68fe('0x32')]=_[_0x68fe('0x33')](_0x389e84[_0x68fe('0x32')]);_0x476859[_0x68fe('0x34')]=_[_0x68fe('0x35')](_0x476859[_0x68fe('0x36')],_0x476859[_0x68fe('0x32')]);_0x389c7d[_0x68fe('0x37')]=_[_0x68fe('0x35')](_0x476859[_0x68fe('0x36')],qs[_0x68fe('0x38')](_0x389e84[_0x68fe('0x32')][_0x68fe('0x38')]));_0x389c7d[_0x68fe('0x37')]=_0x389c7d[_0x68fe('0x37')][_0x68fe('0x39')]?_0x389c7d[_0x68fe('0x37')]:_0x476859[_0x68fe('0x36')];if(_0x389e84[_0x68fe('0x32')][_0x68fe('0x42')]){_0x389c7d[_0x68fe('0x43')]=[{'all':!![]}];}_0x389c7d=_[_0x68fe('0x3f')]({},_0x389c7d,_0x389e84['options']);return db['ChatGroup']['find'](_0x389c7d)[_0x68fe('0x27')](handleEntityNotFound(_0x2e530f,null))[_0x68fe('0x27')](respondWithResult(_0x2e530f,null))[_0x68fe('0x45')](handleError(_0x2e530f,null));};exports[_0x68fe('0x47')]=function(_0x2b14bd,_0x495dac){return db[_0x68fe('0x2d')][_0x68fe('0x47')](_0x2b14bd[_0x68fe('0x48')],{})[_0x68fe('0x27')](respondWithResult(_0x495dac,0xc9))[_0x68fe('0x45')](handleError(_0x495dac,null));};exports[_0x68fe('0x26')]=function(_0xd465f0,_0x11e66a){if(_0xd465f0[_0x68fe('0x48')]['id']){delete _0xd465f0[_0x68fe('0x48')]['id'];}return db[_0x68fe('0x2d')][_0x68fe('0x49')]({'where':{'id':_0xd465f0[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x11e66a,null))['then'](saveUpdates(_0xd465f0['body'],null))[_0x68fe('0x27')](respondWithResult(_0x11e66a,null))[_0x68fe('0x45')](handleError(_0x11e66a,null));};exports[_0x68fe('0x4a')]=function(_0x51b249,_0x405609){return db[_0x68fe('0x2d')][_0x68fe('0x49')]({'where':{'id':_0x51b249['params']['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x405609,null))[_0x68fe('0x27')](removeEntity(_0x405609,null))['catch'](handleError(_0x405609,null));};exports[_0x68fe('0x4b')]=function(_0x40f1f3,_0x19d0f1){return db[_0x68fe('0x2d')]['describe']()[_0x68fe('0x27')](respondWithResult(_0x19d0f1,null))[_0x68fe('0x45')](handleError(_0x19d0f1,null));};exports[_0x68fe('0x4c')]=function(_0x2a8961,_0x3de6aa,_0x295374){return db['ChatInternalMessage'][_0x68fe('0x22')]({'where':{'ChatGroupId':_0x2a8961[_0x68fe('0x46')]['id'],'ToId':_0x2a8961['user']['id'],'read':![]}})[_0x68fe('0x27')](function(_0x3188e4){return{'id':_['toInteger'](_0x2a8961[_0x68fe('0x46')]['id']),'count':_0x3188e4};})[_0x68fe('0x27')](respondWithResult(_0x3de6aa,null))[_0x68fe('0x45')](handleError(_0x3de6aa,null));};exports['addMembers']=function(_0x288123,_0x468cb3,_0x418714){return db[_0x68fe('0x2d')][_0x68fe('0x49')]({'where':{'id':_0x288123[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x468cb3,null))[_0x68fe('0x27')](function(_0x44556c){if(_0x44556c){return _0x44556c[_0x68fe('0x4d')](_0x288123['body'][_0x68fe('0x4e')],_[_0x68fe('0x4f')](_0x288123[_0x68fe('0x48')],['ids','id'])||{});}})[_0x68fe('0x27')](respondWithResult(_0x468cb3,null))['catch'](handleError(_0x468cb3,null));};exports['getMembers']=function(_0x58a3dc,_0x54996f,_0x49a5f6){var _0x5eeeeb={};var _0x5982de={};var _0xb8f67f;var _0x3707d0;return db[_0x68fe('0x2d')][_0x68fe('0x50')]({'where':{'id':_0x58a3dc[_0x68fe('0x46')]['id']}})['then'](handleEntityNotFound(_0x54996f,null))[_0x68fe('0x27')](function(_0x2a5813){if(_0x2a5813){_0xb8f67f=_0x2a5813;_0x5982de[_0x68fe('0x36')]=_[_0x68fe('0x33')](db['User'][_0x68fe('0x2e')]);_0x5982de['query']=_[_0x68fe('0x33')](_0x58a3dc['query']);_0x5982de['filters']=_[_0x68fe('0x35')](_0x5982de['model'],_0x5982de[_0x68fe('0x32')]);_0x5eeeeb[_0x68fe('0x37')]=_[_0x68fe('0x35')](_0x5982de[_0x68fe('0x36')],qs[_0x68fe('0x38')](_0x58a3dc[_0x68fe('0x32')][_0x68fe('0x38')]));_0x5eeeeb['attributes']=_0x5eeeeb['attributes'][_0x68fe('0x39')]?_0x5eeeeb['attributes']:_0x5982de[_0x68fe('0x36')];_0x5eeeeb['order']=qs[_0x68fe('0x3b')](_0x58a3dc[_0x68fe('0x32')]['sort']);_0x5eeeeb[_0x68fe('0x3e')]=qs['filters'](_[_0x68fe('0x3c')](_0x58a3dc[_0x68fe('0x32')],_0x5982de['filters']));if(_0x58a3dc[_0x68fe('0x32')][_0x68fe('0x3d')]){_0x5eeeeb[_0x68fe('0x3e')]=_[_0x68fe('0x3f')](_0x5eeeeb[_0x68fe('0x3e')],{'$or':_[_0x68fe('0x2c')](_0x5eeeeb['attributes'],function(_0x392804){var _0x122785={};_0x122785[_0x392804]={'$like':'%'+_0x58a3dc['query'][_0x68fe('0x3d')]+'%'};return _0x122785;})});}_0x5eeeeb=_[_0x68fe('0x3f')]({},_0x5eeeeb,_0x58a3dc[_0x68fe('0x41')]);return _0xb8f67f[_0x68fe('0x51')](_0x5eeeeb);}})[_0x68fe('0x27')](function(_0x2c94f3){if(_0x2c94f3){_0x3707d0=_0x2c94f3[_0x68fe('0x39')];if(!_0x58a3dc['query']['hasOwnProperty']('nolimit')){_0x5eeeeb[_0x68fe('0x21')]=qs['limit'](_0x58a3dc[_0x68fe('0x32')]['limit']);_0x5eeeeb['offset']=qs['offset'](_0x58a3dc['query'][_0x68fe('0x1f')]);}return _0xb8f67f[_0x68fe('0x51')](_0x5eeeeb);}})[_0x68fe('0x27')](function(_0x46ba10){if(_0x46ba10){return _0x46ba10?{'count':_0x3707d0,'rows':_0x46ba10}:null;}})[_0x68fe('0x27')](respondWithResult(_0x54996f,null))[_0x68fe('0x45')](handleError(_0x54996f,null));};exports[_0x68fe('0x52')]=function(_0x486f0f,_0x8e6a79,_0x2677da){return db[_0x68fe('0x2d')][_0x68fe('0x49')]({'where':{'id':_0x486f0f[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x8e6a79,null))[_0x68fe('0x27')](function(_0x1249d8){if(_0x1249d8){return _0x1249d8[_0x68fe('0x52')](_0x486f0f[_0x68fe('0x32')][_0x68fe('0x4e')]);}})[_0x68fe('0x27')](respondWithStatusCode(_0x8e6a79,null))[_0x68fe('0x45')](handleError(_0x8e6a79,null));};exports[_0x68fe('0x53')]=function(_0x218fc0,_0x38382b,_0x5f00ce){if(_0x218fc0[_0x68fe('0x48')]['id']){delete _0x218fc0[_0x68fe('0x48')]['id'];}return db[_0x68fe('0x2d')]['find']({'where':{'id':_0x218fc0[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x38382b,null))[_0x68fe('0x27')](function(_0x578c1f){if(_0x578c1f){_0x218fc0[_0x68fe('0x48')][_0x68fe('0x54')]=_0x578c1f['id'];return db['ChatInternalMessage'][_0x68fe('0x47')](_0x218fc0[_0x68fe('0x48')]);}})[_0x68fe('0x27')](respondWithResult(_0x38382b,null))[_0x68fe('0x45')](handleError(_0x38382b,null));};exports[_0x68fe('0x55')]=function(_0x1235aa,_0x2a368f,_0x598b14){var _0x1d9bbc={};var _0x437fb1={};var _0x4d6584;var _0x9a6f88;return db[_0x68fe('0x2d')][_0x68fe('0x50')]({'where':{'id':_0x1235aa[_0x68fe('0x46')]['id']}})[_0x68fe('0x27')](handleEntityNotFound(_0x2a368f,null))[_0x68fe('0x27')](function(_0xbc6187){if(_0xbc6187){_0x4d6584=_0xbc6187;_0x437fb1[_0x68fe('0x36')]=_[_0x68fe('0x33')](db[_0x68fe('0x56')][_0x68fe('0x2e')]);_0x437fb1[_0x68fe('0x32')]=_[_0x68fe('0x33')](_0x1235aa[_0x68fe('0x32')]);_0x437fb1[_0x68fe('0x34')]=_[_0x68fe('0x35')](_0x437fb1[_0x68fe('0x36')],_0x437fb1[_0x68fe('0x32')]);_0x1d9bbc[_0x68fe('0x37')]=_[_0x68fe('0x35')](_0x437fb1[_0x68fe('0x36')],qs[_0x68fe('0x38')](_0x1235aa['query'][_0x68fe('0x38')]));_0x1d9bbc[_0x68fe('0x37')]=_0x1d9bbc[_0x68fe('0x37')][_0x68fe('0x39')]?_0x1d9bbc['attributes']:_0x437fb1[_0x68fe('0x36')];_0x1d9bbc[_0x68fe('0x57')]=qs[_0x68fe('0x3b')](_0x1235aa['query'][_0x68fe('0x3b')]);_0x1d9bbc[_0x68fe('0x3e')]=qs['filters'](_[_0x68fe('0x3c')](_0x1235aa['query'],_0x437fb1[_0x68fe('0x34')]));if(_0x1235aa[_0x68fe('0x32')][_0x68fe('0x3d')]){_0x1d9bbc[_0x68fe('0x3e')]=_[_0x68fe('0x3f')](_0x1d9bbc['where'],{'$or':_[_0x68fe('0x2c')](_0x1d9bbc['attributes'],function(_0x5a8a83){var _0x52471c={};_0x52471c[_0x5a8a83]={'$like':'%'+_0x1235aa[_0x68fe('0x32')][_0x68fe('0x3d')]+'%'};return _0x52471c;})});}if(_0x1235aa[_0x68fe('0x32')][_0x68fe('0x58')]){var _0x51dbe2=_0x1235aa[_0x68fe('0x32')]['$gte']['split'](',');var _0x2ec602={};_0x2ec602[_0x51dbe2[0x0]]={'$gte':moment(_0x51dbe2[0x1])[_0x68fe('0x59')](_0x68fe('0x5a'))};_0x1d9bbc[_0x68fe('0x3e')]=_[_0x68fe('0x3f')](_0x1d9bbc[_0x68fe('0x3e')],_0x2ec602);}_0x1d9bbc=_[_0x68fe('0x3f')]({},_0x1d9bbc,_0x1235aa[_0x68fe('0x41')]);return _0x4d6584[_0x68fe('0x55')](_0x1d9bbc);}})[_0x68fe('0x27')](function(_0x4ac3ae){if(_0x4ac3ae){_0x9a6f88=_0x4ac3ae[_0x68fe('0x39')];if(!_0x1235aa[_0x68fe('0x32')][_0x68fe('0x5b')](_0x68fe('0x3a'))){_0x1d9bbc[_0x68fe('0x21')]=qs['limit'](_0x1235aa[_0x68fe('0x32')][_0x68fe('0x21')]);_0x1d9bbc[_0x68fe('0x1f')]=qs[_0x68fe('0x1f')](_0x1235aa[_0x68fe('0x32')]['offset']);}return _0x4d6584[_0x68fe('0x55')](_0x1d9bbc);}})[_0x68fe('0x27')](function(_0x3be3e3){if(_0x3be3e3){return _0x3be3e3?{'count':_0x9a6f88,'rows':_0x3be3e3}:null;}})[_0x68fe('0x27')](respondWithResult(_0x2a368f,null))[_0x68fe('0x45')](handleError(_0x2a368f,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 9f95b50..90901d1 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 _0x4e47=['setMaxListeners','save','update','remove','emit','hook','exports','ChatGroup'];(function(_0x260054,_0x2ba4d1){var _0x1b5d6d=function(_0x31c2b7){while(--_0x31c2b7){_0x260054['push'](_0x260054['shift']());}};_0x1b5d6d(++_0x2ba4d1);}(_0x4e47,0x17f));var _0x74e4=function(_0x2b4d34,_0x3c2f3b){_0x2b4d34=_0x2b4d34-0x0;var _0x30f287=_0x4e47[_0x2b4d34];return _0x30f287;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x74e4('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x74e4('0x1')](0x0);var events={'afterCreate':_0x74e4('0x2'),'afterUpdate':_0x74e4('0x3'),'afterDestroy':_0x74e4('0x4')};function emitEvent(_0x239ba1){return function(_0xd2cf98,_0x452a4f,_0x5d03b8){ChatGroupEvents[_0x74e4('0x5')](_0x239ba1+':'+_0xd2cf98['id'],_0xd2cf98);ChatGroupEvents[_0x74e4('0x5')](_0x239ba1,_0xd2cf98);_0x5d03b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x74e4('0x6')](e,emitEvent(event));}}module[_0x74e4('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x1107=['events','../../mysqldb','ChatGroup','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x874f1,_0x32397f){var _0x44f921=function(_0x16e2a3){while(--_0x16e2a3){_0x874f1['push'](_0x874f1['shift']());}};_0x44f921(++_0x32397f);}(_0x1107,0xd8));var _0x7110=function(_0xf3c3f8,_0x275cec){_0xf3c3f8=_0xf3c3f8-0x0;var _0x38c047=_0x1107[_0xf3c3f8];return _0x38c047;};'use strict';var EventEmitter=require(_0x7110('0x0'));var ChatGroup=require(_0x7110('0x1'))['db'][_0x7110('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7110('0x3'),'afterDestroy':_0x7110('0x4')};function emitEvent(_0x5a5e14){return function(_0x250d85,_0x422095,_0x436cc3){ChatGroupEvents[_0x7110('0x5')](_0x5a5e14+':'+_0x250d85['id'],_0x250d85);ChatGroupEvents[_0x7110('0x5')](_0x5a5e14,_0x250d85);_0x436cc3(null);};}for(var e in events){if(events[_0x7110('0x6')](e)){var event=events[e];ChatGroup[_0x7110('0x7')](e,emitEvent(event));}}module[_0x7110('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 5990036..b7fc061 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 _0x4608=['lodash','api','moment','bluebird','request-promise','rimraf','exports','chat_groups'];(function(_0x4ba3de,_0x44d777){var _0x32c87a=function(_0x13eb81){while(--_0x13eb81){_0x4ba3de['push'](_0x4ba3de['shift']());}};_0x32c87a(++_0x44d777);}(_0x4608,0xb0));var _0x8460=function(_0x497c82,_0x1a9e1f){_0x497c82=_0x497c82-0x0;var _0x334e0f=_0x4608[_0x497c82];return _0x334e0f;};'use strict';var _=require(_0x8460('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8460('0x1'));var moment=require(_0x8460('0x2'));var BPromise=require(_0x8460('0x3'));var rp=require(_0x8460('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8460('0x5'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x8460('0x6')]=function(_0x33c6e5,_0x59da3b){return _0x33c6e5['define']('ChatGroup',attributes,{'tableName':_0x8460('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5558=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x4eb3e0,_0x38407a){var _0xf2c893=function(_0x476298){while(--_0x476298){_0x4eb3e0['push'](_0x4eb3e0['shift']());}};_0xf2c893(++_0x38407a);}(_0x5558,0x176));var _0x8555=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5558[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x8555('0x0'));var util=require(_0x8555('0x1'));var logger=require(_0x8555('0x2'))(_0x8555('0x3'));var moment=require(_0x8555('0x4'));var BPromise=require(_0x8555('0x5'));var rp=require(_0x8555('0x6'));var fs=require('fs');var path=require(_0x8555('0x7'));var rimraf=require(_0x8555('0x8'));var config=require(_0x8555('0x9'));var attributes=require(_0x8555('0xa'));module[_0x8555('0xb')]=function(_0x2cda66,_0x42f4a6){return _0x2cda66[_0x8555('0xc')](_0x8555('0xd'),attributes,{'tableName':_0x8555('0xe'),'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 83c47c4..529a5df 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 _0x35e2=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x213ea2,_0x4a4405){var _0x579151=function(_0x4e723f){while(--_0x4e723f){_0x213ea2['push'](_0x213ea2['shift']());}};_0x579151(++_0x4a4405);}(_0x35e2,0x1ed));var _0x235e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x35e2[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x235e('0x0'));var util=require('util');var moment=require(_0x235e('0x1'));var BPromise=require(_0x235e('0x2'));var rs=require(_0x235e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x235e('0x4'))['db'];var utils=require(_0x235e('0x5'));var logger=require(_0x235e('0x6'))(_0x235e('0x7'));var config=require(_0x235e('0x8'));var jayson=require(_0x235e('0x9'));var client=jayson[_0x235e('0xa')][_0x235e('0xb')]({'port':0x232a});config[_0x235e('0xc')]=_[_0x235e('0xd')](config[_0x235e('0xc')],{'host':_0x235e('0xe'),'port':0x18eb});var socket=require(_0x235e('0xf'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x235e('0x10')](socket);function respondWithRpcPromise(_0x41f1c8,_0x4a3ec7,_0x40dc4d){return new BPromise(function(_0x22a10d,_0x247da6){return client[_0x235e('0x11')](_0x41f1c8,_0x40dc4d)[_0x235e('0x12')](function(_0x1a85f6){logger[_0x235e('0x13')](_0x235e('0x14'),_0x4a3ec7,_0x235e('0x15'));logger[_0x235e('0x16')](_0x235e('0x17'),_0x4a3ec7,_0x235e('0x15'),JSON[_0x235e('0x18')](_0x1a85f6));if(_0x1a85f6[_0x235e('0x19')]){if(_0x1a85f6['error']['code']===0x1f4){logger[_0x235e('0x19')](_0x235e('0x14'),_0x4a3ec7,_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);return _0x247da6(_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4a3ec7,_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);return _0x22a10d(_0x1a85f6[_0x235e('0x19')][_0x235e('0x1a')]);}else{logger[_0x235e('0x13')](_0x235e('0x14'),_0x4a3ec7,_0x235e('0x15'));_0x22a10d(_0x1a85f6['result'][_0x235e('0x1a')]);}})['catch'](function(_0x3b4ce9){logger[_0x235e('0x19')](_0x235e('0x14'),_0x4a3ec7,_0x3b4ce9);_0x247da6(_0x3b4ce9);});});} \ No newline at end of file +var _0xb26e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','randomstring','ioredis'];(function(_0x19d9f0,_0x38706c){var _0x162a69=function(_0x53bc8d){while(--_0x53bc8d){_0x19d9f0['push'](_0x19d9f0['shift']());}};_0x162a69(++_0x38706c);}(_0xb26e,0x11d));var _0xeb26=function(_0x291589,_0x394acd){_0x291589=_0x291589-0x0;var _0x304d5d=_0xb26e[_0x291589];return _0x304d5d;};'use strict';var _=require(_0xeb26('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeb26('0x1'));var fs=require('fs');var Redis=require(_0xeb26('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb26('0x3'));var logger=require(_0xeb26('0x4'))(_0xeb26('0x5'));var config=require(_0xeb26('0x6'));var jayson=require(_0xeb26('0x7'));var client=jayson[_0xeb26('0x8')][_0xeb26('0x9')]({'port':0x232a});config[_0xeb26('0xa')]=_[_0xeb26('0xb')](config[_0xeb26('0xa')],{'host':_0xeb26('0xc'),'port':0x18eb});var socket=require(_0xeb26('0xd'))(new Redis(config[_0xeb26('0xa')]));require('./chatGroup.socket')[_0xeb26('0xe')](socket);function respondWithRpcPromise(_0x53a63a,_0x54d28d,_0x380b53){return new BPromise(function(_0x28aee6,_0x5f084b){return client[_0xeb26('0xf')](_0x53a63a,_0x380b53)['then'](function(_0x2febcc){logger[_0xeb26('0x10')](_0xeb26('0x11'),_0x54d28d,_0xeb26('0x12'));logger[_0xeb26('0x13')](_0xeb26('0x14'),_0x54d28d,_0xeb26('0x12'),JSON['stringify'](_0x2febcc));if(_0x2febcc[_0xeb26('0x15')]){if(_0x2febcc[_0xeb26('0x15')]['code']===0x1f4){logger[_0xeb26('0x15')](_0xeb26('0x11'),_0x54d28d,_0x2febcc[_0xeb26('0x15')][_0xeb26('0x16')]);return _0x5f084b(_0x2febcc['error'][_0xeb26('0x16')]);}logger[_0xeb26('0x15')](_0xeb26('0x11'),_0x54d28d,_0x2febcc[_0xeb26('0x15')][_0xeb26('0x16')]);return _0x28aee6(_0x2febcc[_0xeb26('0x15')][_0xeb26('0x16')]);}else{logger[_0xeb26('0x10')]('ChatGroup,\x20%s,\x20%s',_0x54d28d,_0xeb26('0x12'));_0x28aee6(_0x2febcc['result'][_0xeb26('0x16')]);}})[_0xeb26('0x17')](function(_0x703d48){logger['error'](_0xeb26('0x11'),_0x54d28d,_0x703d48);_0x5f084b(_0x703d48);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index c5e3cf2..c6938c2 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 _0xe124=['chatGroup:','save','remove','update','emit','removeListener','register','length'];(function(_0x3e7e57,_0x83cf4a){var _0x111008=function(_0xfdd188){while(--_0xfdd188){_0x3e7e57['push'](_0x3e7e57['shift']());}};_0x111008(++_0x83cf4a);}(_0xe124,0x81));var _0x4e12=function(_0x2f87c0,_0x291f45){_0x2f87c0=_0x2f87c0-0x0;var _0x400576=_0xe124[_0x2f87c0];return _0x400576;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x4e12('0x0'),_0x4e12('0x1'),_0x4e12('0x2')];function createListener(_0x4c6edc,_0x110e17){return function(_0x5e255a){_0x110e17[_0x4e12('0x3')](_0x4c6edc,_0x5e255a);};}function removeListener(_0x11c669,_0x406129){return function(){ChatGroupEvents[_0x4e12('0x4')](_0x11c669,_0x406129);};}exports[_0x4e12('0x5')]=function(_0x3705c5){for(var _0x2b0ea7=0x0,_0x27f2c0=events[_0x4e12('0x6')];_0x2b0ea7<_0x27f2c0;_0x2b0ea7++){var _0x261621=events[_0x2b0ea7];var _0x73b2d6=createListener(_0x4e12('0x7')+_0x261621,_0x3705c5);ChatGroupEvents['on'](_0x261621,_0x73b2d6);}}; \ No newline at end of file +var _0x017f=['chatGroup:','./chatGroup.events','remove','update','emit','register'];(function(_0x58bda9,_0x1d7931){var _0x9ba053=function(_0x5e4e77){while(--_0x5e4e77){_0x58bda9['push'](_0x58bda9['shift']());}};_0x9ba053(++_0x1d7931);}(_0x017f,0xcd));var _0xf017=function(_0x30859f,_0x3cf1c9){_0x30859f=_0x30859f-0x0;var _0x548564=_0x017f[_0x30859f];return _0x548564;};'use strict';var ChatGroupEvents=require(_0xf017('0x0'));var events=['save',_0xf017('0x1'),_0xf017('0x2')];function createListener(_0x67b7d6,_0x5b5a3f){return function(_0x340d8e){_0x5b5a3f[_0xf017('0x3')](_0x67b7d6,_0x340d8e);};}function removeListener(_0x59407e,_0x4e36c0){return function(){ChatGroupEvents['removeListener'](_0x59407e,_0x4e36c0);};}exports[_0xf017('0x4')]=function(_0x171f7c){for(var _0x2ab5b5=0x0,_0x2f951c=events['length'];_0x2ab5b5<_0x2f951c;_0x2ab5b5++){var _0x2637fa=events[_0x2ab5b5];var _0x16093c=createListener(_0xf017('0x5')+_0x2637fa,_0x171f7c);ChatGroupEvents['on'](_0x2637fa,_0x16093c);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index d8ab793..410504c 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 _0x0704=['create','addMembers','/:id/messages','addMessage','put','update','destroy','delete','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getUnread','/:id/members','getMessages','post'];(function(_0x2416e8,_0x3343fb){var _0x3c56a4=function(_0x2b840a){while(--_0x2b840a){_0x2416e8['push'](_0x2416e8['shift']());}};_0x3c56a4(++_0x3343fb);}(_0x0704,0xa9));var _0x4070=function(_0x25b78d,_0x347586){_0x25b78d=_0x25b78d-0x0;var _0x3d04f5=_0x0704[_0x25b78d];return _0x3d04f5;};'use strict';var multer=require(_0x4070('0x0'));var util=require('util');var path=require(_0x4070('0x1'));var timeout=require(_0x4070('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4070('0x3'));var auth=require(_0x4070('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4070('0x5'));var controller=require('./chatGroup.controller');router[_0x4070('0x6')]('/',auth[_0x4070('0x7')](),controller[_0x4070('0x8')]);router['get']('/describe',auth[_0x4070('0x7')](),controller['describe']);router[_0x4070('0x6')](_0x4070('0x9'),auth[_0x4070('0x7')](),controller[_0x4070('0xa')]);router[_0x4070('0x6')]('/:id/unread',auth[_0x4070('0x7')](),controller[_0x4070('0xb')]);router[_0x4070('0x6')](_0x4070('0xc'),auth[_0x4070('0x7')](),controller['getMembers']);router[_0x4070('0x6')]('/:id/messages',auth[_0x4070('0x7')](),controller[_0x4070('0xd')]);router[_0x4070('0xe')]('/',auth[_0x4070('0x7')](),controller[_0x4070('0xf')]);router[_0x4070('0xe')]('/:id/members',auth[_0x4070('0x7')](),controller[_0x4070('0x10')]);router[_0x4070('0xe')](_0x4070('0x11'),auth[_0x4070('0x7')](),controller[_0x4070('0x12')]);router[_0x4070('0x13')](_0x4070('0x9'),auth[_0x4070('0x7')](),controller[_0x4070('0x14')]);router['delete'](_0x4070('0x9'),auth[_0x4070('0x7')](),controller[_0x4070('0x15')]);router[_0x4070('0x16')](_0x4070('0xc'),auth[_0x4070('0x7')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0x8653=['getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','multer','util','connect-timeout','express','Router','fs-extra','get','index','/describe','isAuthenticated','/:id','show','/:id/unread'];(function(_0x2ba88e,_0x44d544){var _0x29d316=function(_0x5d70b6){while(--_0x5d70b6){_0x2ba88e['push'](_0x2ba88e['shift']());}};_0x29d316(++_0x44d544);}(_0x8653,0x1ce));var _0x3865=function(_0x84e332,_0x4b41dc){_0x84e332=_0x84e332-0x0;var _0x8001be=_0x8653[_0x84e332];return _0x8001be;};'use strict';var multer=require(_0x3865('0x0'));var util=require(_0x3865('0x1'));var path=require('path');var timeout=require(_0x3865('0x2'));var express=require(_0x3865('0x3'));var router=express[_0x3865('0x4')]();var fs_extra=require(_0x3865('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x3865('0x6')]('/',auth['isAuthenticated'](),controller[_0x3865('0x7')]);router[_0x3865('0x6')](_0x3865('0x8'),auth[_0x3865('0x9')](),controller['describe']);router[_0x3865('0x6')](_0x3865('0xa'),auth[_0x3865('0x9')](),controller[_0x3865('0xb')]);router[_0x3865('0x6')](_0x3865('0xc'),auth[_0x3865('0x9')](),controller[_0x3865('0xd')]);router[_0x3865('0x6')](_0x3865('0xe'),auth[_0x3865('0x9')](),controller['getMembers']);router[_0x3865('0x6')](_0x3865('0xf'),auth[_0x3865('0x9')](),controller[_0x3865('0x10')]);router[_0x3865('0x11')]('/',auth[_0x3865('0x9')](),controller[_0x3865('0x12')]);router[_0x3865('0x11')](_0x3865('0xe'),auth['isAuthenticated'](),controller[_0x3865('0x13')]);router[_0x3865('0x11')](_0x3865('0xf'),auth[_0x3865('0x9')](),controller[_0x3865('0x14')]);router[_0x3865('0x15')](_0x3865('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x3865('0x16')](_0x3865('0xa'),auth[_0x3865('0x9')](),controller['destroy']);router[_0x3865('0x16')]('/:id/members',auth[_0x3865('0x9')](),controller[_0x3865('0x17')]);module[_0x3865('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index b358cea..66b0813 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 _0x7c9e=['exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','ENUM','out','sequelize'];(function(_0x2710a1,_0x7844a0){var _0x1bd388=function(_0x2d08cd){while(--_0x2d08cd){_0x2710a1['push'](_0x2710a1['shift']());}};_0x1bd388(++_0x7844a0);}(_0x7c9e,0x1a1));var _0xe7c9=function(_0x2fc379,_0x1084e0){_0x2fc379=_0x2fc379-0x0;var _0x4b1b25=_0x7c9e[_0x2fc379];return _0x4b1b25;};'use strict';var Sequelize=require(_0xe7c9('0x0'));module[_0xe7c9('0x1')]={'closed':{'type':Sequelize[_0xe7c9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xe7c9('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xe7c9('0x4'),_0xe7c9('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xe7c9('0x6')]},'pathTranscript':{'type':Sequelize[_0xe7c9('0x6')]},'mailTranscript':{'type':Sequelize[_0xe7c9('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe7c9('0x8')]},'disposition':{'type':Sequelize[_0xe7c9('0x7')]},'secondDisposition':{'type':Sequelize[_0xe7c9('0x7')]},'thirdDisposition':{'type':Sequelize[_0xe7c9('0x7')]},'note':{'type':Sequelize[_0xe7c9('0x7')]},'browserName':{'type':Sequelize[_0xe7c9('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xe7c9('0x7')]},'osVersion':{'type':Sequelize[_0xe7c9('0x7')]},'deviceModel':{'type':Sequelize[_0xe7c9('0x7')]},'deviceVendor':{'type':Sequelize[_0xe7c9('0x7')]},'deviceType':{'type':Sequelize[_0xe7c9('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xe7c9('0x7')]},'formData':{'type':Sequelize[_0xe7c9('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xe7c9('0x8')]},'lastMsgAt':{'type':Sequelize[_0xe7c9('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xe7c9('0x9')]('in',_0xe7c9('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe7c9('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xe7c9('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xe7c9('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe7c9('0x3')]}}; \ No newline at end of file +var _0xb072=['thumb','TEXT','STRING','DATE','long','ENUM','sequelize','exports','BOOLEAN','INTEGER','star'];(function(_0x9b5afc,_0x4360fd){var _0x15295e=function(_0x959ec2){while(--_0x959ec2){_0x9b5afc['push'](_0x9b5afc['shift']());}};_0x15295e(++_0x4360fd);}(_0xb072,0x15b));var _0x2b07=function(_0x89c2cf,_0x37f922){_0x89c2cf=_0x89c2cf-0x0;var _0x1df382=_0xb072[_0x89c2cf];return _0x1df382;};'use strict';var Sequelize=require(_0x2b07('0x0'));module[_0x2b07('0x1')]={'closed':{'type':Sequelize[_0x2b07('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2b07('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x2b07('0x4'),_0x2b07('0x5')),'defaultValue':_0x2b07('0x4')},'ratingMessage':{'type':Sequelize[_0x2b07('0x6')]},'pathTranscript':{'type':Sequelize[_0x2b07('0x6')]},'mailTranscript':{'type':Sequelize[_0x2b07('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2b07('0x8')]},'disposition':{'type':Sequelize[_0x2b07('0x7')]},'secondDisposition':{'type':Sequelize[_0x2b07('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2b07('0x7')]},'browserVersion':{'type':Sequelize[_0x2b07('0x7')]},'osName':{'type':Sequelize[_0x2b07('0x7')]},'osVersion':{'type':Sequelize[_0x2b07('0x7')]},'deviceModel':{'type':Sequelize[_0x2b07('0x7')]},'deviceVendor':{'type':Sequelize[_0x2b07('0x7')]},'deviceType':{'type':Sequelize[_0x2b07('0x7')]},'referer':{'type':Sequelize[_0x2b07('0x6')]},'customerIp':{'type':Sequelize[_0x2b07('0x7')]},'formData':{'type':Sequelize[_0x2b07('0x6')](_0x2b07('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x2b07('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x2b07('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2b07('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x2b07('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x2b07('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2b07('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 53809f2..7a153fb 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 _0x5c3c=['ContactId','agentAlias','System','customer','format','%s%d','agentIdentifier','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','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','intersection','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','include','includeAgent','push','User','spread','Tag','color','emit','removeTags','unix','toString','server','files','tmp','Contact','lastName','attachments','createdAt','ChatWebsite','Account','Owner','mkdirSync','N.A.','customerPort','tail','existsSync','createReadStream','pipe','firstName','read','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','request-promise','moment','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','destroy','stack','name','render','merge','body','interaction','account','map','ChatInteraction','rawAttributes','fieldName','key','findAll','chat','user','show','params','model','keys','query','filters','attributes','fields','length','includeAll','options','find','create','update','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','type','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','pathTranscript','Messages'];(function(_0x140c4d,_0x35ead0){var _0x229255=function(_0x58f2b4){while(--_0x58f2b4){_0x140c4d['push'](_0x140c4d['shift']());}};_0x229255(++_0x35ead0);}(_0x5c3c,0x118));var _0xc5c3=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x5c3c[_0x2a6809];return _0x11c371;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0xc5c3('0x0'));var moment=require(_0xc5c3('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xc5c3('0x2'));var util=require(_0xc5c3('0x3'));var path=require(_0xc5c3('0x4'));var ejs=require(_0xc5c3('0x5'));var fs=require('fs');var _=require(_0xc5c3('0x6'));var Redis=require(_0xc5c3('0x7'));var interaction=require(_0xc5c3('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0xc5c3('0x9'));var logger=require(_0xc5c3('0xa'))(_0xc5c3('0xb'));var config=require(_0xc5c3('0xc'));var db=require(_0xc5c3('0xd'))['db'];config[_0xc5c3('0xe')]=_[_0xc5c3('0xf')](config[_0xc5c3('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5c3('0x10'))(new Redis(config[_0xc5c3('0xe')]));require(_0xc5c3('0x11'))[_0xc5c3('0x12')](socket);var jayson=require(_0xc5c3('0x13'));var client=jayson[_0xc5c3('0x14')][_0xc5c3('0x15')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1187e1,_0x28eeeb,_0x501dc1,_0x50ca75){return new BPromise(function(_0x4c1b74,_0x5c63c9){var _0x57f88e=_0x50ca75||client;return _0x57f88e[_0xc5c3('0x16')](_0x1187e1,_0x501dc1)[_0xc5c3('0x17')](function(_0x57f372){logger[_0xc5c3('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x28eeeb,_0xc5c3('0x19'));logger['debug'](_0xc5c3('0x1a'),_0x28eeeb,_0xc5c3('0x19'),JSON[_0xc5c3('0x1b')](_0x57f372));if(_0x57f372[_0xc5c3('0x1c')]){if(_0x57f372[_0xc5c3('0x1c')][_0xc5c3('0x1d')]===0x1f4){logger[_0xc5c3('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x28eeeb,_0x57f372['error'][_0xc5c3('0x1e')]);return _0x5c63c9(_0x57f372[_0xc5c3('0x1c')][_0xc5c3('0x1e')]);}logger['error'](_0xc5c3('0x1f'),_0x28eeeb,_0x57f372[_0xc5c3('0x1c')]['message']);return _0x4c1b74(_0x57f372['error'][_0xc5c3('0x1e')]);}else{logger[_0xc5c3('0x18')](_0xc5c3('0x1f'),_0x28eeeb,_0xc5c3('0x19'));_0x4c1b74(_0x57f372[_0xc5c3('0x20')][_0xc5c3('0x1e')]);}})[_0xc5c3('0x21')](function(_0x20c83e){logger[_0xc5c3('0x1c')](_0xc5c3('0x1f'),_0x28eeeb,_0x20c83e);_0x5c63c9(_0x20c83e);});});}function respondWithStatusCode(_0xdf93a0,_0x2f2048){_0x2f2048=_0x2f2048||0xcc;return function(_0x2a18ad){if(_0x2a18ad){return _0xdf93a0[_0xc5c3('0x22')](_0x2f2048);}return _0xdf93a0[_0xc5c3('0x23')](_0x2f2048)['end']();};}function respondWithResult(_0xaeeabb,_0x5c260){_0x5c260=_0x5c260||0xc8;return function(_0x2d7776){if(_0x2d7776){return _0xaeeabb['status'](_0x5c260)['json'](_0x2d7776);}};}function respondWithFilteredResult(_0x599883,_0x53eddd){return function(_0x3b2b82){if(_0x3b2b82){var _0x2ee69a=typeof _0x53eddd['offset']===_0xc5c3('0x24')&&typeof _0x53eddd[_0xc5c3('0x25')]==='undefined';var _0x203d96=_0x3b2b82[_0xc5c3('0x26')];var _0x36a703=_0x2ee69a?0x0:_0x53eddd[_0xc5c3('0x27')];var _0x248859=_0x2ee69a?_0x3b2b82[_0xc5c3('0x26')]:_0x53eddd[_0xc5c3('0x27')]+_0x53eddd[_0xc5c3('0x25')];var _0x17d120;if(_0x248859>=_0x203d96){_0x248859=_0x203d96;_0x17d120=0xc8;}else{_0x17d120=0xce;}_0x599883[_0xc5c3('0x23')](_0x17d120);return _0x599883[_0xc5c3('0x28')](_0xc5c3('0x29'),_0x36a703+'-'+_0x248859+'/'+_0x203d96)[_0xc5c3('0x2a')](_0x3b2b82);}return null;};}function saveUpdates(_0x4f710c){return function(_0x4758be){if(_0x4758be){return _0x4758be['update'](_0x4f710c)['then'](function(_0x207506){return _0x207506;});}return null;};}function removeEntity(_0x3c4d24){return function(_0x212bfd){if(_0x212bfd){return _0x212bfd[_0xc5c3('0x2b')]()[_0xc5c3('0x17')](function(){_0x3c4d24['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34f685){return function(_0x1e0acd){if(!_0x1e0acd){_0x34f685[_0xc5c3('0x22')](0x194);}return _0x1e0acd;};}function handleError(_0x3ed779,_0x341da8){_0x341da8=_0x341da8||0x1f4;return function(_0x3167de){logger[_0xc5c3('0x1c')](_0x3167de[_0xc5c3('0x2c')]);if(_0x3167de[_0xc5c3('0x2d')]){delete _0x3167de[_0xc5c3('0x2d')];}_0x3ed779[_0xc5c3('0x23')](_0x341da8)['send'](_0x3167de);};}function getMustacheRender(_0x2e8bb3,_0x5c4e42){return Mustache[_0xc5c3('0x2e')](_0x2e8bb3,_[_0xc5c3('0x2f')](_0x5c4e42[_0xc5c3('0x30')],{'contact':_0x5c4e42['contact'],'message':_0x5c4e42['message'],'agent':_0x5c4e42['agent'],'interaction':_0x5c4e42[_0xc5c3('0x31')],'account':_0x5c4e42[_0xc5c3('0x32')]}))||'';}exports['index']=function(_0x5bff72,_0x59b4d4){var _0x142104={};var _0x642520=_[_0xc5c3('0x33')](db[_0xc5c3('0x34')][_0xc5c3('0x35')],function(_0x3fc046){return{'name':_0x3fc046[_0xc5c3('0x36')],'type':_0x3fc046['type'][_0xc5c3('0x37')]};});_0x142104=qs['getOptions'](_0x642520,_0x5bff72);return interaction[_0xc5c3('0x38')](_0xc5c3('0x39'),_0x5bff72['query'],_0x5bff72[_0xc5c3('0x3a')],_0x142104,_0x642520)[_0xc5c3('0x17')](respondWithFilteredResult(_0x59b4d4,_0x142104))[_0xc5c3('0x21')](handleError(_0x59b4d4,null));};exports[_0xc5c3('0x3b')]=function(_0xbd3f62,_0x439c29){var _0x47a1cc={'raw':![],'where':{'id':_0xbd3f62[_0xc5c3('0x3c')]['id']}},_0x151ebd={};_0x151ebd[_0xc5c3('0x3d')]=_[_0xc5c3('0x3e')](db[_0xc5c3('0x34')][_0xc5c3('0x35')]);_0x151ebd[_0xc5c3('0x3f')]=_[_0xc5c3('0x3e')](_0xbd3f62[_0xc5c3('0x3f')]);_0x151ebd[_0xc5c3('0x40')]=_['intersection'](_0x151ebd[_0xc5c3('0x3d')],_0x151ebd['query']);_0x47a1cc[_0xc5c3('0x41')]=_['intersection'](_0x151ebd[_0xc5c3('0x3d')],qs[_0xc5c3('0x42')](_0xbd3f62[_0xc5c3('0x3f')][_0xc5c3('0x42')]));_0x47a1cc[_0xc5c3('0x41')]=_0x47a1cc[_0xc5c3('0x41')][_0xc5c3('0x43')]?_0x47a1cc[_0xc5c3('0x41')]:_0x151ebd[_0xc5c3('0x3d')];if(_0xbd3f62[_0xc5c3('0x3f')][_0xc5c3('0x44')]){_0x47a1cc['include']=[{'all':!![]}];}_0x47a1cc=_[_0xc5c3('0x2f')]({},_0x47a1cc,_0xbd3f62[_0xc5c3('0x45')]);return db[_0xc5c3('0x34')][_0xc5c3('0x46')](_0x47a1cc)[_0xc5c3('0x17')](handleEntityNotFound(_0x439c29,null))[_0xc5c3('0x17')](respondWithResult(_0x439c29,null))[_0xc5c3('0x21')](handleError(_0x439c29,null));};exports[_0xc5c3('0x47')]=function(_0x4e6187,_0x55b07b){return db[_0xc5c3('0x34')]['create'](_0x4e6187[_0xc5c3('0x30')],{})[_0xc5c3('0x17')](respondWithResult(_0x55b07b,0xc9))[_0xc5c3('0x21')](handleError(_0x55b07b,null));};exports[_0xc5c3('0x48')]=function(_0x27a92e,_0x30bd71){if(_0x27a92e[_0xc5c3('0x30')]['id']){delete _0x27a92e[_0xc5c3('0x30')]['id'];}return db[_0xc5c3('0x34')]['find']({'where':{'id':_0x27a92e[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x30bd71,null))[_0xc5c3('0x17')](saveUpdates(_0x27a92e[_0xc5c3('0x30')],null))[_0xc5c3('0x17')](respondWithResult(_0x30bd71,null))[_0xc5c3('0x21')](handleError(_0x30bd71,null));};exports[_0xc5c3('0x2b')]=function(_0x41c481,_0x41a822){return db['ChatInteraction'][_0xc5c3('0x46')]({'where':{'id':_0x41c481[_0xc5c3('0x3c')]['id']}})['then'](handleEntityNotFound(_0x41a822,null))['then'](removeEntity(_0x41a822,null))[_0xc5c3('0x21')](handleError(_0x41a822,null));};exports[_0xc5c3('0x49')]=function(_0x200fa2,_0x115f5a){return db[_0xc5c3('0x34')][_0xc5c3('0x49')]()['then'](respondWithResult(_0x115f5a,null))[_0xc5c3('0x21')](handleError(_0x115f5a,null));};exports[_0xc5c3('0x4a')]=function(_0xaecb7e,_0xb7bbe9){var _0x7e5151=_0xaecb7e['params']['id'];var _0x2eba88;var _0x196273;var _0x4cc500;return db['ChatInteraction'][_0xc5c3('0x4b')]({'where':{'id':_0x7e5151}})[_0xc5c3('0x17')](function(_0x1566a6){_0x2eba88=_0x1566a6;return db['ChatWebsite'][_0xc5c3('0x4b')]({'where':{'id':_0x1566a6['ChatWebsiteId']},'attributes':['id',_0xc5c3('0x4c'),_0xc5c3('0x4d'),'vidaooTopic',_0xc5c3('0x4e'),_0xc5c3('0x4f')],'raw':!![]});})['then'](function(_0x211177){if(_0x211177&&_0x211177[_0xc5c3('0x4c')]&&_0x211177[_0xc5c3('0x4d')]){_0x196273=_0x211177;var _0x447783={'interaction':{'id':_0x7e5151},'agent':{'id':_0xaecb7e[_0xc5c3('0x3a')]['id'],'name':_0xaecb7e['user'][_0xc5c3('0x2d')],'fullname':_0xaecb7e[_0xc5c3('0x3a')][_0xc5c3('0x50')],'email':_0xaecb7e['user'][_0xc5c3('0x51')]},'contact':_0xaecb7e[_0xc5c3('0x30')][_0xc5c3('0x52')],'account':_0xaecb7e['body'][_0xc5c3('0x32')]};var _0x5c16cc={'rejectUnauthorized':![],'method':_0xc5c3('0x53'),'url':_0xc5c3('0x54'),'headers':{'X-APIKEY':_0x211177['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0xaecb7e[_0xc5c3('0x3a')][_0xc5c3('0x51')]],'buttons':null,'topic':_0x196273[_0xc5c3('0x55')],'note':_['isNull'](_0x196273['vidaooNote'])?null:getMustacheRender(_0x196273[_0xc5c3('0x4e')],_0x447783),'metadata':null},'redirect':_0xc5c3('0x56'),'json':!![]};try{if(!_[_0xc5c3('0x57')](_0x196273['vidaooMetadata'])){var _0x56f3a8=getMustacheRender(_0x196273[_0xc5c3('0x4f')],_0x447783);var _0x3463c4=JSON['parse'](_0x56f3a8);_0x5c16cc[_0xc5c3('0x30')][_0xc5c3('0x58')]=_0x3463c4;}}catch(_0x31c14d){throw new db[(_0xc5c3('0x59'))][(_0xc5c3('0x5a'))](_0xc5c3('0x5b'));}return rp(_0x5c16cc);}else{throw new db[(_0xc5c3('0x59'))]['ValidationError'](_0xc5c3('0x5c'));}})[_0xc5c3('0x17')](function(_0x49c049){_0x4cc500=_0x49c049;if(_0x4cc500['id']){var _0x16a0bc={'body':_0x4cc500[_0xc5c3('0x5d')],'ChatWebsiteId':_0x196273['id'],'ChatInteractionId':_0x2eba88['id'],'direction':_0xc5c3('0x5e'),'UserId':_0xaecb7e[_0xc5c3('0x3a')]['id']};return db[_0xc5c3('0x5f')]['create'](_0x16a0bc,{});}else{throw new db[(_0xc5c3('0x59'))]['ValidationError'](_0xc5c3('0x60'));}})[_0xc5c3('0x17')](function(){return _0x2eba88[_0xc5c3('0x61')]({'vidaooSessionId':_0x4cc500['id']});})[_0xc5c3('0x17')](respondWithResult(_0xb7bbe9,null))['catch'](handleError(_0xb7bbe9,null));};exports[_0xc5c3('0x62')]=function(_0xe3238f,_0x45a50c){if(_0xe3238f[_0xc5c3('0x30')]['id']){delete _0xe3238f[_0xc5c3('0x30')]['id'];}return db[_0xc5c3('0x34')][_0xc5c3('0x46')]({'where':{'id':_0xe3238f[_0xc5c3('0x3c')]['id']},'include':[{'model':db[_0xc5c3('0x63')],'as':'Contact'}]})[_0xc5c3('0x17')](handleEntityNotFound(_0x45a50c,null))['then'](saveUpdates(_0xe3238f[_0xc5c3('0x30')],null))[_0xc5c3('0x17')](respondWithResult(_0x45a50c,null))[_0xc5c3('0x21')](handleError(_0x45a50c,null));};exports[_0xc5c3('0x64')]=function(_0x119d00,_0x125bb7){if(_0x119d00[_0xc5c3('0x30')]['id']){delete _0x119d00['body']['id'];}return db[_0xc5c3('0x34')]['find']({'where':{'id':_0x119d00['params']['id']}})[_0xc5c3('0x17')](function(_0x4f7631){if(!_0x4f7631){logger[_0xc5c3('0x1c')](_0xc5c3('0x65'),_0xc5c3('0x64'),0x194,'entity\x20not\x20found');_0x125bb7[_0xc5c3('0x22')](0x194);}else{if(_0x4f7631[_0xc5c3('0x66')]){throw new db['Sequelize'][(_0xc5c3('0x5a'))](_0xc5c3('0x67'));}}return _0x4f7631;})[_0xc5c3('0x17')](function(_0x116af5){if(_0x116af5){return _0x116af5[_0xc5c3('0x48')]({'closed':_0x119d00[_0xc5c3('0x30')]['closed'],'disposition':_0x119d00[_0xc5c3('0x30')][_0xc5c3('0x68')]})['then'](function(_0x4c1530){return _0x4c1530;});}})[_0xc5c3('0x17')](function(){return respondWithRpcPromise(_0xc5c3('0x69'),'abandon',_0x119d00[_0xc5c3('0x30')],client9004);})[_0xc5c3('0x17')](respondWithResult(_0x125bb7,null))[_0xc5c3('0x21')](handleError(_0x125bb7,null));};exports['attachmentUpload']=function(_0x41b88b,_0x2f43cd){_0x41b88b[_0xc5c3('0x30')][_0xc5c3('0x2d')]=_0x41b88b[_0xc5c3('0x6a')]['originalname'];_0x41b88b[_0xc5c3('0x30')]['basename']=_0x41b88b['file']['filename'];_0x41b88b[_0xc5c3('0x30')][_0xc5c3('0x6b')]=_0x41b88b[_0xc5c3('0x6a')]['mimetype'];return db['Attachment'][_0xc5c3('0x47')](_0x41b88b[_0xc5c3('0x30')])[_0xc5c3('0x17')](respondWithResult(_0x2f43cd,0xc9))['catch'](handleError(_0x2f43cd,null));};exports[_0xc5c3('0x6c')]=function(_0x515652,_0x1b18c8){return db[_0xc5c3('0x34')][_0xc5c3('0x4b')]({'where':{'id':_0x515652[_0xc5c3('0x3c')]['id']},'raw':!![]})[_0xc5c3('0x17')](handleEntityNotFound(_0x1b18c8,null))['then'](function(_0x42cbd0){if(_0x42cbd0){if(_0x42cbd0[_0xc5c3('0x6d')]){return _0x1b18c8[_0xc5c3('0x23')](0x193)[_0xc5c3('0x2a')]({'status':0x193,'message':_0xc5c3('0x6e')});}return db[_0xc5c3('0x6f')]['findOne']({'where':{'id':_0x515652[_0xc5c3('0x3f')][_0xc5c3('0x70')]},'raw':!![]})[_0xc5c3('0x17')](handleEntityNotFound(_0x1b18c8,null));}})[_0xc5c3('0x17')](function(_0x4b89d0){if(_0x4b89d0){var _0x15e771=_0x4b89d0[_0xc5c3('0x71')]!==null;var _0x1a72ec=path[_0xc5c3('0x72')](config[_0xc5c3('0x73')],_0xc5c3('0x74'));if(_0x15e771){_0x1a72ec=path[_0xc5c3('0x72')](_0x1a72ec,_0xc5c3('0x75'));}var _0x13abd7=path[_0xc5c3('0x72')](_0x1a72ec,_0x4b89d0[_0xc5c3('0x76')]);return _0x1b18c8[_0xc5c3('0x77')](_0x13abd7);}})[_0xc5c3('0x21')](handleError(_0x1b18c8,null));};exports[_0xc5c3('0x78')]=function(_0xfe7b7c,_0x62503){var _0x22214a=null;var _0xc26b1e=null;var _0xc599cd=null;if(_0xfe7b7c[_0xc5c3('0x30')]['id']){delete _0xfe7b7c['body']['id'];}if(_0xfe7b7c['body'][_0xc5c3('0x79')]){_0xc599cd=path[_0xc5c3('0x72')](config[_0xc5c3('0x73')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date['now']()));_0xfe7b7c[_0xc5c3('0x30')][_0xc5c3('0x7a')]=_0xc599cd;}return db[_0xc5c3('0x34')][_0xc5c3('0x46')]({'where':{'id':_0xfe7b7c[_0xc5c3('0x3c')]['id']},'include':[{'model':db[_0xc5c3('0x5f')],'as':_0xc5c3('0x7b'),'include':[{'model':db['User'],'as':'User'}]}]})[_0xc5c3('0x17')](handleEntityNotFound(_0x62503,null))[_0xc5c3('0x17')](saveUpdates(_0xfe7b7c[_0xc5c3('0x30')],null))[_0xc5c3('0x17')](function(_0x22f98a){if(_0x22f98a){_0x22214a=_0x22f98a;return db['ChatWebsite'][_0xc5c3('0x46')]({'where':{'id':_0x22214a['ChatWebsiteId']}});}})[_0xc5c3('0x17')](function(_0x46c60d){if(_0x46c60d){_0xc26b1e=_0x46c60d;return db['CmContact'][_0xc5c3('0x46')]({'where':{'id':_0x22214a[_0xc5c3('0x7c')]}});}})[_0xc5c3('0x17')](function(_0x19c2ab){if(_0x19c2ab){if(_0xc599cd){var _0x36f25d=null;for(var _0x484920=0x1;_0x484920<_0x22214a['Messages']['length'];++_0x484920){_0x36f25d=_0x22214a['Messages'][_0x484920];var _0x3ff376=_0x36f25d[_0xc5c3('0x66')]?util['format']('%s%d',_0xc26b1e[_0xc5c3('0x7d')],_0x36f25d['UserId']):_0xc5c3('0x7e');var _0x202d0f=_0xfe7b7c['body'][_0xc5c3('0x7f')]||util[_0xc5c3('0x80')](_0xc5c3('0x81'),'Visitor',_0x36f25d[_0xc5c3('0x7c')]);switch(_0xc26b1e[_0xc5c3('0x82')]){case'website_alias':_0x3ff376=_0x36f25d[_0xc5c3('0x66')]?util[_0xc5c3('0x80')]('%s%d',_0xc26b1e[_0xc5c3('0x7d')],_0x36f25d['UserId']):'System';break;case'agent_alias':_0x3ff376=_0x36f25d[_0xc5c3('0x66')]?_0x36f25d['User'][_0xc5c3('0x83')]||_0x36f25d['User'][_0xc5c3('0x50')]:'System';break;case _0xc5c3('0x84'):_0x3ff376=_0x36f25d[_0xc5c3('0x66')]?_0x36f25d['User']['fullname']:_0xc5c3('0x7e');break;default:_0x3ff376=_0x36f25d[_0xc5c3('0x66')]?util[_0xc5c3('0x80')](_0xc5c3('0x81'),_0xc26b1e[_0xc5c3('0x7d')],_0x36f25d['UserId']):_0xc5c3('0x7e');}var _0x5d0a42=util[_0xc5c3('0x80')](_0xc5c3('0x85'),moment(_0x36f25d['createdAt'])[_0xc5c3('0x80')](_0xc5c3('0x86')),_0x36f25d[_0xc5c3('0x87')]==='in'?_0x202d0f:_0x3ff376,_0x36f25d[_0xc5c3('0x30')]);if(!_0x36f25d[_0xc5c3('0x88')]){fs[_0xc5c3('0x89')](_0xc599cd,_0x5d0a42);}}return db['MailAccount'][_0xc5c3('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0xc5c3('0x8a')],'as':_0xc5c3('0x8b'),'raw':!![],'include':[{'model':db[_0xc5c3('0x8c')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xc5c3('0x17')](function(_0x3f0a05){if(!_0x3f0a05||!_0x3f0a05[_0xc5c3('0x8b')]||!_0xfe7b7c[_0xc5c3('0x30')])return _0x22214a;var _0xc171f4=_0x3f0a05[_0xc5c3('0x8d')]();return respondWithRpcPromise(_0xc5c3('0x8e'),'sendMail',{'account':_0xc171f4,'message':{'from':util['format'](_0xc5c3('0x8f'),_0x3f0a05['name'],_0x3f0a05['email']||_0x3f0a05['Smtp'][_0xc5c3('0x3a')]),'to':_0xfe7b7c[_0xc5c3('0x30')][_0xc5c3('0x79')],'subject':_0xc5c3('0x90'),'text':util['format'](_0xc5c3('0x91'),_0xfe7b7c['body']['mailTranscript']),'attachments':[{'path':_0xc599cd}]}})['then'](function(){return _0x22214a;})['catch'](function(_0x509d6c){logger['error'](_0x509d6c);});})[_0xc5c3('0x17')](respondWithStatusCode(_0x62503,0xc8))[_0xc5c3('0x21')](handleError(_0x62503,null));};exports[_0xc5c3('0x92')]=function(_0x29d344,_0x4189bd){return db['ChatMessage'][_0xc5c3('0x46')]({'where':{'id':_0x29d344[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x4189bd,null))[_0xc5c3('0x17')](function(_0x47e7b6){if(_0x47e7b6){return _0x47e7b6[_0xc5c3('0x92')](_0x29d344[_0xc5c3('0x30')][_0xc5c3('0x93')],_[_0xc5c3('0x94')](_0x29d344[_0xc5c3('0x30')],[_0xc5c3('0x93'),'id'])||{});}})[_0xc5c3('0x17')](respondWithResult(_0x4189bd,null))['catch'](handleError(_0x4189bd,null));};exports[_0xc5c3('0x95')]=function(_0x1fbcfb,_0x9a3955){var _0x3ac1b9={'raw':![],'where':{}};var _0x42c7fc={};var _0x3b1e64={'count':0x0,'rows':[]};return db[_0xc5c3('0x34')][_0xc5c3('0x4b')]({'where':{'id':_0x1fbcfb[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x9a3955,null))['then'](function(_0x335b85){if(_0x335b85){_0x42c7fc[_0xc5c3('0x3d')]=_[_0xc5c3('0x3e')](db[_0xc5c3('0x5f')][_0xc5c3('0x35')]);_0x42c7fc['query']=_[_0xc5c3('0x3e')](_0x1fbcfb[_0xc5c3('0x3f')]);_0x42c7fc[_0xc5c3('0x40')]=_[_0xc5c3('0x96')](_0x42c7fc[_0xc5c3('0x3d')],_0x42c7fc[_0xc5c3('0x3f')]);_0x3ac1b9[_0xc5c3('0x41')]=_[_0xc5c3('0x96')](_0x42c7fc[_0xc5c3('0x3d')],qs[_0xc5c3('0x42')](_0x1fbcfb['query'][_0xc5c3('0x42')]));_0x3ac1b9['attributes']=_0x3ac1b9[_0xc5c3('0x41')]['length']?_0x3ac1b9['attributes']:_0x42c7fc[_0xc5c3('0x3d')];if(!_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x97')](_0xc5c3('0x98'))){_0x3ac1b9[_0xc5c3('0x25')]=qs['limit'](_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x25')]);_0x3ac1b9['offset']=qs['offset'](_0x1fbcfb['query']['offset']);}_0x3ac1b9[_0xc5c3('0x99')]=qs[_0xc5c3('0x9a')](_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x9a')]);_0x3ac1b9[_0xc5c3('0x9b')]=qs[_0xc5c3('0x40')](_[_0xc5c3('0x9c')](_0x1fbcfb[_0xc5c3('0x3f')],_0x42c7fc[_0xc5c3('0x40')]));_0x3ac1b9[_0xc5c3('0x9b')][_0xc5c3('0x9d')]=_0x335b85['id'];if(_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x9e')]){_0x3ac1b9[_0xc5c3('0x9b')]=_[_0xc5c3('0x2f')](_0x3ac1b9['where'],{'$or':_[_0xc5c3('0x33')](_0x3ac1b9[_0xc5c3('0x41')],function(_0x310c0c){var _0x3d0d01={};_0x3d0d01[_0x310c0c]={'$like':'%'+_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x9e')]+'%'};return _0x3d0d01;})});}if(_0x1fbcfb[_0xc5c3('0x3f')]['$gte']){var _0x1ac92b=_0x1fbcfb[_0xc5c3('0x3f')][_0xc5c3('0x9f')][_0xc5c3('0xa0')](',');var _0x2674cb={};_0x2674cb[_0x1ac92b[0x0]]={'$gte':moment(_0x1ac92b[0x1])['format'](_0xc5c3('0xa1'))};_0x3ac1b9[_0xc5c3('0x9b')]=_[_0xc5c3('0x2f')](_0x3ac1b9[_0xc5c3('0x9b')],_0x2674cb);}_0x3ac1b9=_[_0xc5c3('0x2f')]({},_0x3ac1b9,_0x1fbcfb[_0xc5c3('0x45')]);return db['ChatMessage'][_0xc5c3('0x26')]({'where':_0x3ac1b9[_0xc5c3('0x9b')]})['then'](function(_0x1c8443){_0x3b1e64[_0xc5c3('0x26')]=_0x1c8443;if(_0x1fbcfb[_0xc5c3('0x3f')]['includeAll']){_0x3ac1b9['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x3ac1b9);})[_0xc5c3('0x17')](function(_0x32c108){_0x3b1e64[_0xc5c3('0xa2')]=_0x32c108;return _0x3b1e64;});}})['then'](respondWithFilteredResult(_0x9a3955,_0x3ac1b9))[_0xc5c3('0x21')](handleError(_0x9a3955,null));};exports[_0xc5c3('0xa3')]=function(_0x17cb0c,_0x2074e9){var _0x2f19b8={'where':{}},_0x4320d3={},_0x371161={'count':0x0,'rows':[]};return db[_0xc5c3('0x34')][_0xc5c3('0x4b')]({'where':{'id':_0x17cb0c[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x2074e9,null))[_0xc5c3('0x17')](function(_0x118393){if(_0x118393){_0x4320d3['model']=_[_0xc5c3('0x3e')](db[_0xc5c3('0x5f')][_0xc5c3('0x35')]);_0x4320d3[_0xc5c3('0x3f')]=_[_0xc5c3('0x3e')](_0x17cb0c['query']);_0x4320d3['filters']=_[_0xc5c3('0x96')](_0x4320d3[_0xc5c3('0x3d')],_0x4320d3[_0xc5c3('0x3f')]);_0x2f19b8['attributes']=_[_0xc5c3('0x96')](_0x4320d3['model'],qs[_0xc5c3('0x42')](_0x17cb0c[_0xc5c3('0x3f')]['fields']));_0x2f19b8[_0xc5c3('0x41')]=_0x2f19b8['attributes'][_0xc5c3('0x43')]?_0x2f19b8[_0xc5c3('0x41')]:_0x4320d3['model'];if(!_0x17cb0c[_0xc5c3('0x3f')]['hasOwnProperty'](_0xc5c3('0x98'))){_0x2f19b8['limit']=qs[_0xc5c3('0x25')](_0x17cb0c[_0xc5c3('0x3f')]['limit']);_0x2f19b8[_0xc5c3('0x27')]=qs[_0xc5c3('0x27')](_0x17cb0c['query'][_0xc5c3('0x27')]);}_0x2f19b8[_0xc5c3('0x99')]=qs[_0xc5c3('0x9a')](_0x17cb0c[_0xc5c3('0x3f')][_0xc5c3('0x9a')]);_0x2f19b8[_0xc5c3('0x9b')]=qs[_0xc5c3('0x40')](_[_0xc5c3('0x9c')](_0x17cb0c[_0xc5c3('0x3f')],_0x4320d3[_0xc5c3('0x40')]));_0x2f19b8[_0xc5c3('0x9b')][_0xc5c3('0x9d')]=_0x118393['id'];if(_0x17cb0c[_0xc5c3('0x3f')]['filter']){_0x2f19b8['where']=_[_0xc5c3('0x2f')](_0x2f19b8[_0xc5c3('0x9b')],{'$or':_[_0xc5c3('0x33')](_0x2f19b8[_0xc5c3('0x41')],function(_0x32377d){var _0x233643={};_0x233643[_0x32377d]={'$like':'%'+_0x17cb0c[_0xc5c3('0x3f')][_0xc5c3('0x9e')]+'%'};return _0x233643;})});}_0x2f19b8[_0xc5c3('0x9b')][_0xc5c3('0x88')]=![];if(_0x17cb0c[_0xc5c3('0x3f')]['id']){_0x2f19b8[_0xc5c3('0x9b')]['id']={'$gt':_0x17cb0c['query']['id']};}_0x2f19b8=_[_0xc5c3('0x2f')]({},_0x2f19b8,_0x17cb0c['options']);return db[_0xc5c3('0x5f')][_0xc5c3('0x26')]({'where':_0x2f19b8[_0xc5c3('0x9b')]})['then'](function(_0x352d2f){_0x371161[_0xc5c3('0x26')]=_0x352d2f;_0x2f19b8[_0xc5c3('0xa4')]=[];if(_0x17cb0c[_0xc5c3('0x3f')][_0xc5c3('0xa5')]){_0x2f19b8[_0xc5c3('0xa4')][_0xc5c3('0xa6')]({'model':db[_0xc5c3('0xa7')],'as':_0xc5c3('0xa7'),'attributes':['id',_0xc5c3('0x50'),_0xc5c3('0x83')]});}if(_0x17cb0c['query'][_0xc5c3('0x44')]){_0x2f19b8[_0xc5c3('0xa4')]=[{'all':!![]}];}return db[_0xc5c3('0x5f')][_0xc5c3('0x38')](_0x2f19b8);})[_0xc5c3('0x17')](function(_0x5ec128){_0x371161[_0xc5c3('0xa2')]=_0x5ec128;return _0x371161;});}})[_0xc5c3('0x17')](respondWithFilteredResult(_0x2074e9,_0x2f19b8))[_0xc5c3('0x21')](handleError(_0x2074e9,null));};exports['addTags']=function(_0x4ee192,_0x33b492){return db[_0xc5c3('0x34')][_0xc5c3('0x46')]({'where':{'id':_0x4ee192[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x33b492,null))[_0xc5c3('0x17')](function(_0x58e5c9){if(_0x58e5c9){return _0x58e5c9['setTags'](_0x4ee192[_0xc5c3('0x30')]['ids'],_[_0xc5c3('0x94')](_0x4ee192[_0xc5c3('0x30')],[_0xc5c3('0x93'),'id'])||{})[_0xc5c3('0xa8')](function(){return db[_0xc5c3('0xa9')][_0xc5c3('0x38')]({'attributes':['id',_0xc5c3('0x2d'),_0xc5c3('0xaa')],'where':{'id':_0x4ee192[_0xc5c3('0x30')][_0xc5c3('0x93')]}});})[_0xc5c3('0x17')](function(_0x34d60f){socket[_0xc5c3('0xab')]('chatInteractionTags:save',{'id':Number(_0x4ee192['params']['id']),'tags':_0x34d60f||[]});return{'id':Number(_0x4ee192[_0xc5c3('0x3c')]['id']),'tags':_0x34d60f||[]};});}})[_0xc5c3('0x17')](respondWithResult(_0x33b492,null))[_0xc5c3('0x21')](handleError(_0x33b492,null));};exports[_0xc5c3('0xac')]=function(_0x851091,_0x54e9ce){return db[_0xc5c3('0x34')]['find']({'where':{'id':_0x851091[_0xc5c3('0x3c')]['id']}})[_0xc5c3('0x17')](handleEntityNotFound(_0x54e9ce,null))[_0xc5c3('0x17')](function(_0x55232c){if(_0x55232c){return _0x55232c[_0xc5c3('0xac')](_0x851091[_0xc5c3('0x3f')][_0xc5c3('0x93')]);}})[_0xc5c3('0x17')](respondWithStatusCode(_0x54e9ce,null))[_0xc5c3('0x21')](handleError(_0x54e9ce,null));};exports[_0xc5c3('0x77')]=function(_0x42fef7,_0xf492ff){var _0xd9de79=moment()[_0xc5c3('0xad')]()[_0xc5c3('0xae')]();var _0x409b27=path[_0xc5c3('0x72')](config[_0xc5c3('0x73')],_0xc5c3('0xaf'),_0xc5c3('0xb0'),_0xc5c3('0xb1'));var _0x19ce94=path[_0xc5c3('0x72')](config[_0xc5c3('0x73')],_0xc5c3('0xaf'),_0xc5c3('0xb0'),'attachments');var _0x55247a=path[_0xc5c3('0x72')](_0x409b27,_0xd9de79);var _0x428b4e=util['format']('transcript-%d-%s.zip',_0x42fef7[_0xc5c3('0x3c')]['id'],_0xd9de79);var _0x529187=path['join'](_0x409b27,_0x428b4e);var _0x346842=[];_0x346842[_0xc5c3('0xa6')]({'model':db['User'],'as':'User','attributes':['id',_0xc5c3('0x50')],'raw':!![]});_0x346842[_0xc5c3('0xa6')]({'model':db[_0xc5c3('0x63')],'as':_0xc5c3('0xb2'),'attributes':['id','firstName',_0xc5c3('0xb3')],'raw':!![]});if(_0x42fef7[_0xc5c3('0x3f')][_0xc5c3('0xb4')]){_0x346842['push']({'model':db[_0xc5c3('0x6f')],'as':'Attachment','raw':!![]});}var _0x9b2bb8=[{'model':db[_0xc5c3('0x5f')],'as':_0xc5c3('0x7b'),'attributes':['id',_0xc5c3('0x30'),_0xc5c3('0xb5'),'direction','secret','read'],'include':_0x346842}];_0x9b2bb8[_0xc5c3('0xa6')]({'model':db[_0xc5c3('0xb6')],'as':_0xc5c3('0xb7'),'attributes':['id','name']});_0x9b2bb8[_0xc5c3('0xa6')]({'model':db[_0xc5c3('0xa7')],'as':_0xc5c3('0xb8'),'attributes':['id',_0xc5c3('0x50')]});return db[_0xc5c3('0x34')][_0xc5c3('0x46')]({'where':{'id':_0x42fef7[_0xc5c3('0x3c')]['id']},'include':_0x9b2bb8})[_0xc5c3('0x17')](handleEntityNotFound(_0xf492ff,null))[_0xc5c3('0x17')](function(_0x485b52){if(_0x485b52){var _0x5d39eb=_0x485b52['get']({'plain':!![]});fs[_0xc5c3('0xb9')](_0x55247a);var _0x29e62f={'channel':'Chat','account':_0x5d39eb['Account'][_0xc5c3('0x2d')],'agent':_0x5d39eb[_0xc5c3('0xb8')]?_0x5d39eb[_0xc5c3('0xb8')][_0xc5c3('0x50')]:_0xc5c3('0xba'),'createdAt':moment(_0x5d39eb[_0xc5c3('0xb5')])[_0xc5c3('0x80')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc5c3('0xae')](),'closedAt':_0x5d39eb[_0xc5c3('0x6d')]?moment(_0x5d39eb['closedAt'])[_0xc5c3('0x80')](_0xc5c3('0xa1'))[_0xc5c3('0xae')]():'','disposition':_0x5d39eb[_0xc5c3('0x68')],'chatInfo':{'browser':_0x5d39eb['browserName'],'os':_0x5d39eb['osName'],'referer':_0x5d39eb['referer'],'customerIp':_0x5d39eb['customerIp'],'customerPort':_0x5d39eb[_0xc5c3('0xbb')]?_0x5d39eb['customerPort']:_0xc5c3('0xba')},'messages':_(_0x5d39eb[_0xc5c3('0x7b')])[_0xc5c3('0xbc')]()[_0xc5c3('0x9e')]({'secret':![]})[_0xc5c3('0x33')](function(_0x1986a1){if(_0x1986a1['Attachment']){var _0x13bac0=path[_0xc5c3('0x72')](_0x19ce94,_0x1986a1[_0xc5c3('0x6f')][_0xc5c3('0x76')]);if(fs[_0xc5c3('0xbd')](_0x13bac0)){fs[_0xc5c3('0xbe')](_0x13bac0)[_0xc5c3('0xbf')](fs['createWriteStream'](path[_0xc5c3('0x72')](_0x55247a,_0x1986a1[_0xc5c3('0x6f')]['basename'])));}}return{'date':moment(_0x1986a1[_0xc5c3('0xb5')])['format'](_0xc5c3('0xa1'))[_0xc5c3('0xae')](),'sender':_0x1986a1[_0xc5c3('0x87')]==='out'?_0x1986a1[_0xc5c3('0xa7')]?_0x1986a1[_0xc5c3('0xa7')][_0xc5c3('0x50')]:_0xc5c3('0x7e'):_0x1986a1['Contact'][_0xc5c3('0xc0')]+(_0x1986a1[_0xc5c3('0xb2')][_0xc5c3('0xb3')]?'\x20'+_0x1986a1['Contact'][_0xc5c3('0xb3')]:''),'body':_0x1986a1[_0xc5c3('0x6f')]?_0x1986a1[_0xc5c3('0x6f')][_0xc5c3('0x76')]:_0x1986a1['body'],'direction':_0x1986a1['direction']===_0xc5c3('0x5e')?'A':'C','secret':_0x1986a1[_0xc5c3('0x88')],'read':_0x1986a1[_0xc5c3('0xc1')],'attachment':_0x1986a1[_0xc5c3('0x6f')]};})[_0xc5c3('0xc2')]()};return ejs[_0xc5c3('0xc3')](path['join'](config[_0xc5c3('0x73')],_0xc5c3('0xaf'),'views',_0xc5c3('0xc4')),{'interaction':_0x29e62f})[_0xc5c3('0x17')](function(_0x33ea45){var _0x4be354=path[_0xc5c3('0x72')](_0x55247a,_0xc5c3('0xc5')+_0x5d39eb['id']+'-'+_0xd9de79+_0xc5c3('0xc6'));var _0x21df1={'path':_0x4be354,'channel':'Chat','interactionId':_0x5d39eb['id']};return pdf[_0xc5c3('0xc7')](_0x33ea45,_0x21df1);})[_0xc5c3('0x17')](function(){return new Promise(function(_0x546c2b,_0x256302){zipdir(_0x55247a,{'saveTo':_0x529187},function(_0x554308,_0x7a5063){if(_0x554308)return _0x256302(_0x554308);return _0x546c2b(_0x7a5063);});})[_0xc5c3('0x17')](function(){return new BPromise(function(_0x3af260,_0x366a14){rimraf(_0x55247a,function(_0x8899ff){if(_0x8899ff)_0x366a14(_0x8899ff);return _0x3af260();});});})[_0xc5c3('0x17')](function(){return _0xf492ff[_0xc5c3('0x77')](_0x529187,_0x428b4e,function(_0x58d3f9){if(_0x58d3f9){logger['error'](_0xc5c3('0xc8'),_0x58d3f9);}else{fs[_0xc5c3('0xc9')](_0x529187);}});});});}else{return _0xf492ff[_0xc5c3('0x22')](0xc8);}})[_0xc5c3('0x21')](handleError(_0xf492ff,null));}; \ No newline at end of file +var _0x34cf=['read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','value','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','path','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','stack','name','send','merge','body','contact','interaction','account','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','chat','query','user','show','params','model','keys','filters','attributes','intersection','fields','options','find','create','update','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','originalname','basename','filename','file','Attachment','attachmentDownload','findOne','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','download','close','root','format','now','Messages','User','CmContact','ContactId','length','%s%d','agentAlias','System','customer','website_alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','order','sort','pick','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','nolimit','ChatInteractionId','include','push','alias','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','attachments','firstName','lastName'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x34cf,0x1b0));var _0xf34c=function(_0xc63e1e,_0x26094e){_0xc63e1e=_0xc63e1e-0x0;var _0x195a00=_0x34cf[_0xc63e1e];return _0x195a00;};'use strict';var rimraf=require(_0xf34c('0x0'));var zipdir=require('zip-dir');var rp=require(_0xf34c('0x1'));var moment=require(_0xf34c('0x2'));var BPromise=require(_0xf34c('0x3'));var Mustache=require(_0xf34c('0x4'));var util=require('util');var path=require(_0xf34c('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xf34c('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0xf34c('0x7'));var logger=require(_0xf34c('0x8'))(_0xf34c('0x9'));var config=require(_0xf34c('0xa'));var db=require(_0xf34c('0xb'))['db'];config[_0xf34c('0xc')]=_[_0xf34c('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf34c('0xe'))(new Redis(config[_0xf34c('0xc')]));require(_0xf34c('0xf'))['register'](socket);var jayson=require(_0xf34c('0x10'));var client=jayson['client'][_0xf34c('0x11')]({'port':0x232b});var client9004=jayson[_0xf34c('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3a1b70,_0x3f0821,_0x299fe9,_0x1d6fe6){return new BPromise(function(_0x15f81a,_0x208ffc){var _0x2d8848=_0x1d6fe6||client;return _0x2d8848[_0xf34c('0x13')](_0x3a1b70,_0x299fe9)[_0xf34c('0x14')](function(_0x1bdf3e){logger[_0xf34c('0x15')](_0xf34c('0x16'),_0x3f0821,_0xf34c('0x17'));logger[_0xf34c('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3f0821,_0xf34c('0x17'),JSON[_0xf34c('0x19')](_0x1bdf3e));if(_0x1bdf3e[_0xf34c('0x1a')]){if(_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1b')]===0x1f4){logger[_0xf34c('0x1a')](_0xf34c('0x16'),_0x3f0821,_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1c')]);return _0x208ffc(_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1c')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3f0821,_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1c')]);return _0x15f81a(_0x1bdf3e[_0xf34c('0x1a')][_0xf34c('0x1c')]);}else{logger[_0xf34c('0x15')](_0xf34c('0x16'),_0x3f0821,_0xf34c('0x17'));_0x15f81a(_0x1bdf3e[_0xf34c('0x1d')][_0xf34c('0x1c')]);}})[_0xf34c('0x1e')](function(_0x47017e){logger['error'](_0xf34c('0x16'),_0x3f0821,_0x47017e);_0x208ffc(_0x47017e);});});}function respondWithStatusCode(_0x4838f0,_0x8c8f97){_0x8c8f97=_0x8c8f97||0xcc;return function(_0x11ea88){if(_0x11ea88){return _0x4838f0[_0xf34c('0x1f')](_0x8c8f97);}return _0x4838f0[_0xf34c('0x20')](_0x8c8f97)['end']();};}function respondWithResult(_0x141486,_0x44ecaa){_0x44ecaa=_0x44ecaa||0xc8;return function(_0x4f19ad){if(_0x4f19ad){return _0x141486['status'](_0x44ecaa)[_0xf34c('0x21')](_0x4f19ad);}};}function respondWithFilteredResult(_0x8e29d1,_0x1967b8){return function(_0x5df1b8){if(_0x5df1b8){var _0x37c5fa=typeof _0x1967b8[_0xf34c('0x22')]===_0xf34c('0x23')&&typeof _0x1967b8[_0xf34c('0x24')]===_0xf34c('0x23');var _0x3b61ab=_0x5df1b8[_0xf34c('0x25')];var _0x4a3369=_0x37c5fa?0x0:_0x1967b8[_0xf34c('0x22')];var _0x38a168=_0x37c5fa?_0x5df1b8[_0xf34c('0x25')]:_0x1967b8[_0xf34c('0x22')]+_0x1967b8[_0xf34c('0x24')];var _0x3c93c3;if(_0x38a168>=_0x3b61ab){_0x38a168=_0x3b61ab;_0x3c93c3=0xc8;}else{_0x3c93c3=0xce;}_0x8e29d1['status'](_0x3c93c3);return _0x8e29d1[_0xf34c('0x26')](_0xf34c('0x27'),_0x4a3369+'-'+_0x38a168+'/'+_0x3b61ab)[_0xf34c('0x21')](_0x5df1b8);}return null;};}function saveUpdates(_0x2ba2f6){return function(_0x2ecc54){if(_0x2ecc54){return _0x2ecc54['update'](_0x2ba2f6)[_0xf34c('0x14')](function(_0x46223f){return _0x46223f;});}return null;};}function removeEntity(_0x23fbee){return function(_0x775836){if(_0x775836){return _0x775836[_0xf34c('0x28')]()[_0xf34c('0x14')](function(){_0x23fbee['status'](0xcc)[_0xf34c('0x29')]();});}};}function handleEntityNotFound(_0x681dc4){return function(_0x437287){if(!_0x437287){_0x681dc4['sendStatus'](0x194);}return _0x437287;};}function handleError(_0x115b8e,_0xf782){_0xf782=_0xf782||0x1f4;return function(_0x1e6bf4){logger[_0xf34c('0x1a')](_0x1e6bf4[_0xf34c('0x2a')]);if(_0x1e6bf4[_0xf34c('0x2b')]){delete _0x1e6bf4[_0xf34c('0x2b')];}_0x115b8e[_0xf34c('0x20')](_0xf782)[_0xf34c('0x2c')](_0x1e6bf4);};}function getMustacheRender(_0x58e16d,_0x1fc113){return Mustache['render'](_0x58e16d,_[_0xf34c('0x2d')](_0x1fc113[_0xf34c('0x2e')],{'contact':_0x1fc113[_0xf34c('0x2f')],'message':_0x1fc113[_0xf34c('0x1c')],'agent':_0x1fc113['agent'],'interaction':_0x1fc113[_0xf34c('0x30')],'account':_0x1fc113[_0xf34c('0x31')]}))||'';}exports[_0xf34c('0x32')]=function(_0xb48db0,_0x1f5503){var _0x472414={};var _0x420936=_[_0xf34c('0x33')](db[_0xf34c('0x34')][_0xf34c('0x35')],function(_0x3869b2){return{'name':_0x3869b2['fieldName'],'type':_0x3869b2[_0xf34c('0x36')]['key']};});_0x472414=qs[_0xf34c('0x37')](_0x420936,_0xb48db0);return interaction[_0xf34c('0x38')](_0xf34c('0x39'),_0xb48db0[_0xf34c('0x3a')],_0xb48db0[_0xf34c('0x3b')],_0x472414,_0x420936)[_0xf34c('0x14')](respondWithFilteredResult(_0x1f5503,_0x472414))[_0xf34c('0x1e')](handleError(_0x1f5503,null));};exports[_0xf34c('0x3c')]=function(_0x5710da,_0x3f6bc7){var _0x34b315={'raw':![],'where':{'id':_0x5710da[_0xf34c('0x3d')]['id']}},_0x9c8518={};_0x9c8518[_0xf34c('0x3e')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x9c8518[_0xf34c('0x3a')]=_[_0xf34c('0x3f')](_0x5710da['query']);_0x9c8518[_0xf34c('0x40')]=_['intersection'](_0x9c8518[_0xf34c('0x3e')],_0x9c8518[_0xf34c('0x3a')]);_0x34b315[_0xf34c('0x41')]=_[_0xf34c('0x42')](_0x9c8518[_0xf34c('0x3e')],qs[_0xf34c('0x43')](_0x5710da[_0xf34c('0x3a')][_0xf34c('0x43')]));_0x34b315['attributes']=_0x34b315[_0xf34c('0x41')]['length']?_0x34b315[_0xf34c('0x41')]:_0x9c8518[_0xf34c('0x3e')];if(_0x5710da['query']['includeAll']){_0x34b315['include']=[{'all':!![]}];}_0x34b315=_[_0xf34c('0x2d')]({},_0x34b315,_0x5710da[_0xf34c('0x44')]);return db[_0xf34c('0x34')][_0xf34c('0x45')](_0x34b315)['then'](handleEntityNotFound(_0x3f6bc7,null))[_0xf34c('0x14')](respondWithResult(_0x3f6bc7,null))[_0xf34c('0x1e')](handleError(_0x3f6bc7,null));};exports[_0xf34c('0x46')]=function(_0x510ece,_0xbb27fc){return db[_0xf34c('0x34')][_0xf34c('0x46')](_0x510ece[_0xf34c('0x2e')],{})[_0xf34c('0x14')](respondWithResult(_0xbb27fc,0xc9))[_0xf34c('0x1e')](handleError(_0xbb27fc,null));};exports[_0xf34c('0x47')]=function(_0x3eae1e,_0x3bc34d){if(_0x3eae1e[_0xf34c('0x2e')]['id']){delete _0x3eae1e[_0xf34c('0x2e')]['id'];}return db[_0xf34c('0x34')]['find']({'where':{'id':_0x3eae1e['params']['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0x3bc34d,null))[_0xf34c('0x14')](saveUpdates(_0x3eae1e['body'],null))[_0xf34c('0x14')](respondWithResult(_0x3bc34d,null))[_0xf34c('0x1e')](handleError(_0x3bc34d,null));};exports[_0xf34c('0x28')]=function(_0xdce1a3,_0x20efc6){return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0xdce1a3['params']['id']}})['then'](handleEntityNotFound(_0x20efc6,null))['then'](removeEntity(_0x20efc6,null))[_0xf34c('0x1e')](handleError(_0x20efc6,null));};exports['describe']=function(_0xe8afdb,_0x4201e4){return db[_0xf34c('0x34')][_0xf34c('0x48')]()['then'](respondWithResult(_0x4201e4,null))[_0xf34c('0x1e')](handleError(_0x4201e4,null));};exports[_0xf34c('0x49')]=function(_0x55bf10,_0xb866ff){var _0x3d4a96=_0x55bf10[_0xf34c('0x3d')]['id'];var _0x52da29;var _0x5d4168;var _0x52851a;return db[_0xf34c('0x34')]['findOne']({'where':{'id':_0x3d4a96}})[_0xf34c('0x14')](function(_0x15890f){_0x52da29=_0x15890f;return db[_0xf34c('0x4a')]['findOne']({'where':{'id':_0x15890f[_0xf34c('0x4b')]},'attributes':['id',_0xf34c('0x4c'),_0xf34c('0x4d'),'vidaooTopic',_0xf34c('0x4e'),_0xf34c('0x4f')],'raw':!![]});})[_0xf34c('0x14')](function(_0x3cdc9f){if(_0x3cdc9f&&_0x3cdc9f[_0xf34c('0x4c')]&&_0x3cdc9f[_0xf34c('0x4d')]){_0x5d4168=_0x3cdc9f;var _0x1ce20b={'interaction':{'id':_0x3d4a96},'agent':{'id':_0x55bf10[_0xf34c('0x3b')]['id'],'name':_0x55bf10[_0xf34c('0x3b')][_0xf34c('0x2b')],'fullname':_0x55bf10[_0xf34c('0x3b')][_0xf34c('0x50')],'email':_0x55bf10[_0xf34c('0x3b')][_0xf34c('0x51')]},'contact':_0x55bf10['body']['contact'],'account':_0x55bf10[_0xf34c('0x2e')]['account']};var _0x5a91ba={'rejectUnauthorized':![],'method':_0xf34c('0x52'),'url':_0xf34c('0x53'),'headers':{'X-APIKEY':_0x3cdc9f[_0xf34c('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x55bf10[_0xf34c('0x3b')]['email']],'buttons':null,'topic':_0x5d4168[_0xf34c('0x54')],'note':_['isNull'](_0x5d4168[_0xf34c('0x4e')])?null:getMustacheRender(_0x5d4168[_0xf34c('0x4e')],_0x1ce20b),'metadata':null},'redirect':_0xf34c('0x55'),'json':!![]};try{if(!_['isNull'](_0x5d4168[_0xf34c('0x4f')])){var _0x3bc968=getMustacheRender(_0x5d4168[_0xf34c('0x4f')],_0x1ce20b);var _0x11a3fe=JSON[_0xf34c('0x56')](_0x3bc968);_0x5a91ba[_0xf34c('0x2e')][_0xf34c('0x57')]=_0x11a3fe;}}catch(_0x2c6d5e){throw new db[(_0xf34c('0x58'))][(_0xf34c('0x59'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5a91ba);}else{throw new db[(_0xf34c('0x58'))]['ValidationError'](_0xf34c('0x5a'));}})[_0xf34c('0x14')](function(_0x86cc29){_0x52851a=_0x86cc29;if(_0x52851a['id']){var _0x302c3e={'body':_0x52851a[_0xf34c('0x5b')],'ChatWebsiteId':_0x5d4168['id'],'ChatInteractionId':_0x52da29['id'],'direction':_0xf34c('0x5c'),'UserId':_0x55bf10[_0xf34c('0x3b')]['id']};return db[_0xf34c('0x5d')]['create'](_0x302c3e,{});}else{throw new db[(_0xf34c('0x58'))][(_0xf34c('0x59'))](_0xf34c('0x5e'));}})[_0xf34c('0x14')](function(){return _0x52da29[_0xf34c('0x5f')]({'vidaooSessionId':_0x52851a['id']});})['then'](respondWithResult(_0xb866ff,null))[_0xf34c('0x1e')](handleError(_0xb866ff,null));};exports['customUpdate']=function(_0x3b5e0b,_0x2e1348){if(_0x3b5e0b[_0xf34c('0x2e')]['id']){delete _0x3b5e0b[_0xf34c('0x2e')]['id'];}return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0x3b5e0b[_0xf34c('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':_0xf34c('0x60')}]})[_0xf34c('0x14')](handleEntityNotFound(_0x2e1348,null))[_0xf34c('0x14')](saveUpdates(_0x3b5e0b[_0xf34c('0x2e')],null))[_0xf34c('0x14')](respondWithResult(_0x2e1348,null))[_0xf34c('0x1e')](handleError(_0x2e1348,null));};exports[_0xf34c('0x61')]=function(_0x36d901,_0x37dccc){if(_0x36d901[_0xf34c('0x2e')]['id']){delete _0x36d901[_0xf34c('0x2e')]['id'];}return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0x36d901[_0xf34c('0x3d')]['id']}})['then'](function(_0xb02417){if(!_0xb02417){logger[_0xf34c('0x1a')](_0xf34c('0x62'),_0xf34c('0x61'),0x194,'entity\x20not\x20found');_0x37dccc[_0xf34c('0x1f')](0x194);}else{if(_0xb02417[_0xf34c('0x63')]){throw new db['Sequelize'][(_0xf34c('0x59'))](_0xf34c('0x64'));}}return _0xb02417;})[_0xf34c('0x14')](function(_0x2df1e9){if(_0x2df1e9){return _0x2df1e9['update']({'closed':_0x36d901[_0xf34c('0x2e')][_0xf34c('0x65')],'disposition':_0x36d901[_0xf34c('0x2e')]['disposition']})[_0xf34c('0x14')](function(_0x1dd780){return _0x1dd780;});}})[_0xf34c('0x14')](function(){return respondWithRpcPromise(_0xf34c('0x66'),_0xf34c('0x61'),_0x36d901['body'],client9004);})[_0xf34c('0x14')](respondWithResult(_0x37dccc,null))[_0xf34c('0x1e')](handleError(_0x37dccc,null));};exports['attachmentUpload']=function(_0x5c1aa5,_0x47b2cc){_0x5c1aa5[_0xf34c('0x2e')]['name']=_0x5c1aa5['file'][_0xf34c('0x67')];_0x5c1aa5[_0xf34c('0x2e')][_0xf34c('0x68')]=_0x5c1aa5['file'][_0xf34c('0x69')];_0x5c1aa5[_0xf34c('0x2e')][_0xf34c('0x36')]=_0x5c1aa5[_0xf34c('0x6a')]['mimetype'];return db[_0xf34c('0x6b')][_0xf34c('0x46')](_0x5c1aa5[_0xf34c('0x2e')])[_0xf34c('0x14')](respondWithResult(_0x47b2cc,0xc9))[_0xf34c('0x1e')](handleError(_0x47b2cc,null));};exports[_0xf34c('0x6c')]=function(_0x46cc27,_0x2c6d6a){return db[_0xf34c('0x34')][_0xf34c('0x6d')]({'where':{'id':_0x46cc27['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2c6d6a,null))['then'](function(_0x292924){if(_0x292924){if(_0x292924[_0xf34c('0x65')]){return _0x2c6d6a[_0xf34c('0x20')](0x193)[_0xf34c('0x21')]({'status':0x193,'message':_0xf34c('0x6e')});}return db['Attachment'][_0xf34c('0x6d')]({'where':{'id':_0x46cc27[_0xf34c('0x3a')][_0xf34c('0x6f')]},'raw':!![]})[_0xf34c('0x14')](handleEntityNotFound(_0x2c6d6a,null));}})['then'](function(_0x164882){if(_0x164882){var _0x50156a=_0x164882[_0xf34c('0x70')]!==null;var _0x156a25=path[_0xf34c('0x71')](config['root'],'server/files/attachments/');if(_0x50156a){_0x156a25=path[_0xf34c('0x71')](_0x156a25,_0xf34c('0x72'));}var _0x4b5efb=path['join'](_0x156a25,_0x164882[_0xf34c('0x68')]);return _0x2c6d6a[_0xf34c('0x73')](_0x4b5efb);}})[_0xf34c('0x1e')](handleError(_0x2c6d6a,null));};exports[_0xf34c('0x74')]=function(_0x17fb64,_0xf874c6){var _0x1e8695=null;var _0x3dfbee=null;var _0x3b5c88=null;if(_0x17fb64[_0xf34c('0x2e')]['id']){delete _0x17fb64['body']['id'];}if(_0x17fb64['body']['mailTranscript']){_0x3b5c88=path[_0xf34c('0x71')](config[_0xf34c('0x75')],'server/files/chat/upload/',util[_0xf34c('0x76')]('transcript-%s.txt',Date[_0xf34c('0x77')]()));_0x17fb64[_0xf34c('0x2e')]['pathTranscript']=_0x3b5c88;}return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0x17fb64[_0xf34c('0x3d')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xf34c('0x78'),'include':[{'model':db[_0xf34c('0x79')],'as':_0xf34c('0x79')}]}]})[_0xf34c('0x14')](handleEntityNotFound(_0xf874c6,null))[_0xf34c('0x14')](saveUpdates(_0x17fb64[_0xf34c('0x2e')],null))[_0xf34c('0x14')](function(_0x122864){if(_0x122864){_0x1e8695=_0x122864;return db['ChatWebsite'][_0xf34c('0x45')]({'where':{'id':_0x1e8695[_0xf34c('0x4b')]}});}})['then'](function(_0x5e1456){if(_0x5e1456){_0x3dfbee=_0x5e1456;return db[_0xf34c('0x7a')][_0xf34c('0x45')]({'where':{'id':_0x1e8695[_0xf34c('0x7b')]}});}})['then'](function(_0x4a5187){if(_0x4a5187){if(_0x3b5c88){var _0x18e7d8=null;for(var _0x18a1e3=0x1;_0x18a1e3<_0x1e8695[_0xf34c('0x78')][_0xf34c('0x7c')];++_0x18a1e3){_0x18e7d8=_0x1e8695[_0xf34c('0x78')][_0x18a1e3];var _0x54c194=_0x18e7d8[_0xf34c('0x63')]?util[_0xf34c('0x76')](_0xf34c('0x7d'),_0x3dfbee[_0xf34c('0x7e')],_0x18e7d8['UserId']):_0xf34c('0x7f');var _0xb00471=_0x17fb64['body'][_0xf34c('0x80')]||util[_0xf34c('0x76')](_0xf34c('0x7d'),'Visitor',_0x18e7d8['ContactId']);switch(_0x3dfbee['agentIdentifier']){case _0xf34c('0x81'):_0x54c194=_0x18e7d8[_0xf34c('0x63')]?util[_0xf34c('0x76')]('%s%d',_0x3dfbee[_0xf34c('0x7e')],_0x18e7d8[_0xf34c('0x63')]):_0xf34c('0x7f');break;case'agent_alias':_0x54c194=_0x18e7d8[_0xf34c('0x63')]?_0x18e7d8[_0xf34c('0x79')]['alias']||_0x18e7d8[_0xf34c('0x79')]['fullname']:'System';break;case _0xf34c('0x82'):_0x54c194=_0x18e7d8[_0xf34c('0x63')]?_0x18e7d8[_0xf34c('0x79')][_0xf34c('0x50')]:'System';break;default:_0x54c194=_0x18e7d8[_0xf34c('0x63')]?util[_0xf34c('0x76')](_0xf34c('0x7d'),_0x3dfbee['agentAlias'],_0x18e7d8[_0xf34c('0x63')]):'System';}var _0x26a7e4=util[_0xf34c('0x76')]('[%s]\x20%s:\x20%s\x0a',moment(_0x18e7d8[_0xf34c('0x83')])[_0xf34c('0x76')](_0xf34c('0x84')),_0x18e7d8[_0xf34c('0x85')]==='in'?_0xb00471:_0x54c194,_0x18e7d8[_0xf34c('0x2e')]);if(!_0x18e7d8[_0xf34c('0x86')]){fs[_0xf34c('0x87')](_0x3b5c88,_0x26a7e4);}}return db[_0xf34c('0x88')][_0xf34c('0x6d')]({'where':{'service':!![]},'include':[{'model':db[_0xf34c('0x89')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xf34c('0x8a'),'raw':!![]}]}]});}}})[_0xf34c('0x14')](function(_0x35afb9){if(!_0x35afb9||!_0x35afb9[_0xf34c('0x8b')]||!_0x17fb64[_0xf34c('0x2e')])return _0x1e8695;var _0x445eb3=_0x35afb9[_0xf34c('0x8c')]();return respondWithRpcPromise(_0xf34c('0x8d'),_0xf34c('0x8e'),{'account':_0x445eb3,'message':{'from':util[_0xf34c('0x76')](_0xf34c('0x8f'),_0x35afb9['name'],_0x35afb9[_0xf34c('0x51')]||_0x35afb9[_0xf34c('0x8b')][_0xf34c('0x3b')]),'to':_0x17fb64[_0xf34c('0x2e')][_0xf34c('0x90')],'subject':_0xf34c('0x91'),'text':util[_0xf34c('0x76')](_0xf34c('0x92'),_0x17fb64[_0xf34c('0x2e')][_0xf34c('0x90')]),'attachments':[{'path':_0x3b5c88}]}})[_0xf34c('0x14')](function(){return _0x1e8695;})[_0xf34c('0x1e')](function(_0x48d5fd){logger[_0xf34c('0x1a')](_0x48d5fd);});})[_0xf34c('0x14')](respondWithStatusCode(_0xf874c6,0xc8))[_0xf34c('0x1e')](handleError(_0xf874c6,null));};exports[_0xf34c('0x93')]=function(_0x5210cd,_0x4e2fe1){return db['ChatMessage'][_0xf34c('0x45')]({'where':{'id':_0x5210cd[_0xf34c('0x3d')]['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0x4e2fe1,null))['then'](function(_0x2c6d6e){if(_0x2c6d6e){return _0x2c6d6e[_0xf34c('0x93')](_0x5210cd[_0xf34c('0x2e')][_0xf34c('0x94')],_[_0xf34c('0x95')](_0x5210cd[_0xf34c('0x2e')],[_0xf34c('0x94'),'id'])||{});}})[_0xf34c('0x14')](respondWithResult(_0x4e2fe1,null))[_0xf34c('0x1e')](handleError(_0x4e2fe1,null));};exports[_0xf34c('0x96')]=function(_0xe9dfdf,_0x45b301){var _0x165e28={'raw':![],'where':{}};var _0x516923={};var _0x55ec30={'count':0x0,'rows':[]};return db[_0xf34c('0x34')]['findOne']({'where':{'id':_0xe9dfdf[_0xf34c('0x3d')]['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0x45b301,null))[_0xf34c('0x14')](function(_0x25fbcd){if(_0x25fbcd){_0x516923[_0xf34c('0x3e')]=_['keys'](db[_0xf34c('0x5d')][_0xf34c('0x35')]);_0x516923[_0xf34c('0x3a')]=_[_0xf34c('0x3f')](_0xe9dfdf[_0xf34c('0x3a')]);_0x516923[_0xf34c('0x40')]=_[_0xf34c('0x42')](_0x516923[_0xf34c('0x3e')],_0x516923[_0xf34c('0x3a')]);_0x165e28['attributes']=_[_0xf34c('0x42')](_0x516923[_0xf34c('0x3e')],qs[_0xf34c('0x43')](_0xe9dfdf['query']['fields']));_0x165e28[_0xf34c('0x41')]=_0x165e28['attributes'][_0xf34c('0x7c')]?_0x165e28[_0xf34c('0x41')]:_0x516923[_0xf34c('0x3e')];if(!_0xe9dfdf['query'][_0xf34c('0x97')]('nolimit')){_0x165e28[_0xf34c('0x24')]=qs[_0xf34c('0x24')](_0xe9dfdf[_0xf34c('0x3a')]['limit']);_0x165e28[_0xf34c('0x22')]=qs[_0xf34c('0x22')](_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x22')]);}_0x165e28[_0xf34c('0x98')]=qs[_0xf34c('0x99')](_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x99')]);_0x165e28['where']=qs['filters'](_[_0xf34c('0x9a')](_0xe9dfdf[_0xf34c('0x3a')],_0x516923[_0xf34c('0x40')]));_0x165e28[_0xf34c('0x9b')]['ChatInteractionId']=_0x25fbcd['id'];if(_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x9c')]){_0x165e28[_0xf34c('0x9b')]=_[_0xf34c('0x2d')](_0x165e28[_0xf34c('0x9b')],{'$or':_['map'](_0x165e28[_0xf34c('0x41')],function(_0x589f48){var _0x311dce={};_0x311dce[_0x589f48]={'$like':'%'+_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x9c')]+'%'};return _0x311dce;})});}if(_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0x9d')]){var _0x401754=_0xe9dfdf['query'][_0xf34c('0x9d')][_0xf34c('0x9e')](',');var _0x14f404={};_0x14f404[_0x401754[0x0]]={'$gte':moment(_0x401754[0x1])[_0xf34c('0x76')](_0xf34c('0x9f'))};_0x165e28[_0xf34c('0x9b')]=_[_0xf34c('0x2d')](_0x165e28['where'],_0x14f404);}_0x165e28=_[_0xf34c('0x2d')]({},_0x165e28,_0xe9dfdf['options']);return db['ChatMessage'][_0xf34c('0x25')]({'where':_0x165e28['where']})[_0xf34c('0x14')](function(_0x501dc9){_0x55ec30[_0xf34c('0x25')]=_0x501dc9;if(_0xe9dfdf[_0xf34c('0x3a')][_0xf34c('0xa0')]){_0x165e28['include']=[{'all':!![]}];}return db[_0xf34c('0x5d')]['findAll'](_0x165e28);})[_0xf34c('0x14')](function(_0x2d4446){_0x55ec30['rows']=_0x2d4446;return _0x55ec30;});}})[_0xf34c('0x14')](respondWithFilteredResult(_0x45b301,_0x165e28))[_0xf34c('0x1e')](handleError(_0x45b301,null));};exports[_0xf34c('0xa1')]=function(_0x12cda0,_0xce3f9c){var _0x252b9e={'where':{}},_0x17e067={},_0x21b942={'count':0x0,'rows':[]};return db[_0xf34c('0x34')][_0xf34c('0x6d')]({'where':{'id':_0x12cda0['params']['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0xce3f9c,null))[_0xf34c('0x14')](function(_0x4ee96d){if(_0x4ee96d){_0x17e067[_0xf34c('0x3e')]=_[_0xf34c('0x3f')](db[_0xf34c('0x5d')][_0xf34c('0x35')]);_0x17e067[_0xf34c('0x3a')]=_[_0xf34c('0x3f')](_0x12cda0[_0xf34c('0x3a')]);_0x17e067[_0xf34c('0x40')]=_[_0xf34c('0x42')](_0x17e067[_0xf34c('0x3e')],_0x17e067['query']);_0x252b9e[_0xf34c('0x41')]=_[_0xf34c('0x42')](_0x17e067[_0xf34c('0x3e')],qs[_0xf34c('0x43')](_0x12cda0[_0xf34c('0x3a')]['fields']));_0x252b9e[_0xf34c('0x41')]=_0x252b9e[_0xf34c('0x41')][_0xf34c('0x7c')]?_0x252b9e['attributes']:_0x17e067[_0xf34c('0x3e')];if(!_0x12cda0[_0xf34c('0x3a')][_0xf34c('0x97')](_0xf34c('0xa2'))){_0x252b9e[_0xf34c('0x24')]=qs[_0xf34c('0x24')](_0x12cda0['query'][_0xf34c('0x24')]);_0x252b9e[_0xf34c('0x22')]=qs['offset'](_0x12cda0[_0xf34c('0x3a')]['offset']);}_0x252b9e['order']=qs[_0xf34c('0x99')](_0x12cda0[_0xf34c('0x3a')][_0xf34c('0x99')]);_0x252b9e[_0xf34c('0x9b')]=qs[_0xf34c('0x40')](_[_0xf34c('0x9a')](_0x12cda0[_0xf34c('0x3a')],_0x17e067['filters']));_0x252b9e[_0xf34c('0x9b')][_0xf34c('0xa3')]=_0x4ee96d['id'];if(_0x12cda0[_0xf34c('0x3a')][_0xf34c('0x9c')]){_0x252b9e[_0xf34c('0x9b')]=_[_0xf34c('0x2d')](_0x252b9e[_0xf34c('0x9b')],{'$or':_[_0xf34c('0x33')](_0x252b9e[_0xf34c('0x41')],function(_0x124758){var _0x5b9711={};_0x5b9711[_0x124758]={'$like':'%'+_0x12cda0[_0xf34c('0x3a')][_0xf34c('0x9c')]+'%'};return _0x5b9711;})});}_0x252b9e[_0xf34c('0x9b')][_0xf34c('0x86')]=![];if(_0x12cda0['query']['id']){_0x252b9e[_0xf34c('0x9b')]['id']={'$gt':_0x12cda0[_0xf34c('0x3a')]['id']};}_0x252b9e=_['merge']({},_0x252b9e,_0x12cda0['options']);return db[_0xf34c('0x5d')][_0xf34c('0x25')]({'where':_0x252b9e['where']})[_0xf34c('0x14')](function(_0x3fdfa1){_0x21b942[_0xf34c('0x25')]=_0x3fdfa1;_0x252b9e['include']=[];if(_0x12cda0[_0xf34c('0x3a')]['includeAgent']){_0x252b9e[_0xf34c('0xa4')][_0xf34c('0xa5')]({'model':db[_0xf34c('0x79')],'as':_0xf34c('0x79'),'attributes':['id','fullname',_0xf34c('0xa6')]});}if(_0x12cda0[_0xf34c('0x3a')][_0xf34c('0xa0')]){_0x252b9e[_0xf34c('0xa4')]=[{'all':!![]}];}return db[_0xf34c('0x5d')][_0xf34c('0x38')](_0x252b9e);})['then'](function(_0x426268){_0x21b942['rows']=_0x426268;return _0x21b942;});}})[_0xf34c('0x14')](respondWithFilteredResult(_0xce3f9c,_0x252b9e))[_0xf34c('0x1e')](handleError(_0xce3f9c,null));};exports['addTags']=function(_0xdefcd9,_0x35aeb1){return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0xdefcd9[_0xf34c('0x3d')]['id']}})[_0xf34c('0x14')](handleEntityNotFound(_0x35aeb1,null))[_0xf34c('0x14')](function(_0x56f631){if(_0x56f631){return _0x56f631[_0xf34c('0xa7')](_0xdefcd9[_0xf34c('0x2e')]['ids'],_[_0xf34c('0x95')](_0xdefcd9[_0xf34c('0x2e')],[_0xf34c('0x94'),'id'])||{})[_0xf34c('0xa8')](function(){return db[_0xf34c('0xa9')][_0xf34c('0x38')]({'attributes':['id',_0xf34c('0x2b'),_0xf34c('0xaa')],'where':{'id':_0xdefcd9[_0xf34c('0x2e')][_0xf34c('0x94')]}});})[_0xf34c('0x14')](function(_0x4d41aa){socket[_0xf34c('0xab')](_0xf34c('0xac'),{'id':Number(_0xdefcd9[_0xf34c('0x3d')]['id']),'tags':_0x4d41aa||[]});return{'id':Number(_0xdefcd9[_0xf34c('0x3d')]['id']),'tags':_0x4d41aa||[]};});}})[_0xf34c('0x14')](respondWithResult(_0x35aeb1,null))['catch'](handleError(_0x35aeb1,null));};exports['removeTags']=function(_0x949126,_0x23b696){return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0x949126[_0xf34c('0x3d')]['id']}})['then'](handleEntityNotFound(_0x23b696,null))['then'](function(_0x343471){if(_0x343471){return _0x343471[_0xf34c('0xad')](_0x949126['query'][_0xf34c('0x94')]);}})[_0xf34c('0x14')](respondWithStatusCode(_0x23b696,null))[_0xf34c('0x1e')](handleError(_0x23b696,null));};exports[_0xf34c('0x73')]=function(_0xf982ac,_0x3589cd){var _0x5d8cf0=moment()[_0xf34c('0xae')]()[_0xf34c('0xaf')]();var _0x3bf060=path[_0xf34c('0x71')](config[_0xf34c('0x75')],'server','files','tmp');var _0x39b382=path[_0xf34c('0x71')](config['root'],_0xf34c('0xb0'),'files',_0xf34c('0xb1'));var _0x4cebf2=path[_0xf34c('0x71')](_0x3bf060,_0x5d8cf0);var _0x225747=util['format']('transcript-%d-%s.zip',_0xf982ac[_0xf34c('0x3d')]['id'],_0x5d8cf0);var _0x2c1819=path[_0xf34c('0x71')](_0x3bf060,_0x225747);var _0x3a7cc3=[];_0x3a7cc3[_0xf34c('0xa5')]({'model':db[_0xf34c('0x79')],'as':_0xf34c('0x79'),'attributes':['id',_0xf34c('0x50')],'raw':!![]});_0x3a7cc3[_0xf34c('0xa5')]({'model':db[_0xf34c('0x7a')],'as':_0xf34c('0x60'),'attributes':['id',_0xf34c('0xb2'),_0xf34c('0xb3')],'raw':!![]});if(_0xf982ac[_0xf34c('0x3a')][_0xf34c('0xb1')]){_0x3a7cc3[_0xf34c('0xa5')]({'model':db[_0xf34c('0x6b')],'as':_0xf34c('0x6b'),'raw':!![]});}var _0x5c896e=[{'model':db[_0xf34c('0x5d')],'as':_0xf34c('0x78'),'attributes':['id','body',_0xf34c('0x83'),_0xf34c('0x85'),_0xf34c('0x86'),_0xf34c('0xb4')],'include':_0x3a7cc3}];_0x5c896e[_0xf34c('0xa5')]({'model':db[_0xf34c('0x4a')],'as':_0xf34c('0xb5'),'attributes':['id',_0xf34c('0x2b')]});_0x5c896e['push']({'model':db[_0xf34c('0x79')],'as':_0xf34c('0xb6'),'attributes':['id',_0xf34c('0x50')]});return db[_0xf34c('0x34')][_0xf34c('0x45')]({'where':{'id':_0xf982ac[_0xf34c('0x3d')]['id']},'include':_0x5c896e})[_0xf34c('0x14')](handleEntityNotFound(_0x3589cd,null))[_0xf34c('0x14')](function(_0x2c1485){if(_0x2c1485){var _0xe1a492=_0x2c1485[_0xf34c('0xb7')]({'plain':!![]});fs[_0xf34c('0xb8')](_0x4cebf2);var _0x34897a={'channel':_0xf34c('0xb9'),'account':_0xe1a492['Account'][_0xf34c('0x2b')],'agent':_0xe1a492[_0xf34c('0xb6')]?_0xe1a492['Owner'][_0xf34c('0x50')]:_0xf34c('0xba'),'createdAt':moment(_0xe1a492[_0xf34c('0x83')])[_0xf34c('0x76')](_0xf34c('0x9f'))[_0xf34c('0xaf')](),'closedAt':_0xe1a492['closed']?moment(_0xe1a492[_0xf34c('0xbb')])['format'](_0xf34c('0x9f'))[_0xf34c('0xaf')]():'','disposition':_0xe1a492[_0xf34c('0xbc')],'chatInfo':{'browser':_0xe1a492[_0xf34c('0xbd')],'os':_0xe1a492['osName'],'referer':_0xe1a492[_0xf34c('0xbe')],'customerIp':_0xe1a492[_0xf34c('0xbf')],'customerPort':_0xe1a492[_0xf34c('0xc0')]?_0xe1a492['customerPort']:_0xf34c('0xba')},'messages':_(_0xe1a492[_0xf34c('0x78')])[_0xf34c('0xc1')]()['filter']({'secret':![]})[_0xf34c('0x33')](function(_0x2469ab){if(_0x2469ab[_0xf34c('0x6b')]){var _0x4d0d13=path['join'](_0x39b382,_0x2469ab['Attachment'][_0xf34c('0x68')]);if(fs[_0xf34c('0xc2')](_0x4d0d13)){fs[_0xf34c('0xc3')](_0x4d0d13)['pipe'](fs[_0xf34c('0xc4')](path[_0xf34c('0x71')](_0x4cebf2,_0x2469ab[_0xf34c('0x6b')][_0xf34c('0x68')])));}}return{'date':moment(_0x2469ab[_0xf34c('0x83')])[_0xf34c('0x76')](_0xf34c('0x9f'))[_0xf34c('0xaf')](),'sender':_0x2469ab[_0xf34c('0x85')]==='out'?_0x2469ab[_0xf34c('0x79')]?_0x2469ab[_0xf34c('0x79')][_0xf34c('0x50')]:'System':_0x2469ab[_0xf34c('0x60')][_0xf34c('0xb2')]+(_0x2469ab[_0xf34c('0x60')][_0xf34c('0xb3')]?'\x20'+_0x2469ab['Contact'][_0xf34c('0xb3')]:''),'body':_0x2469ab['Attachment']?_0x2469ab['Attachment']['basename']:_0x2469ab[_0xf34c('0x2e')],'direction':_0x2469ab['direction']===_0xf34c('0x5c')?'A':'C','secret':_0x2469ab[_0xf34c('0x86')],'read':_0x2469ab['read'],'attachment':_0x2469ab[_0xf34c('0x6b')]};})[_0xf34c('0xc5')]()};return ejs['renderFile'](path['join'](config[_0xf34c('0x75')],_0xf34c('0xb0'),_0xf34c('0xc6'),'downloadInteraction.ejs'),{'interaction':_0x34897a})[_0xf34c('0x14')](function(_0x3c8309){var _0x250977=path[_0xf34c('0x71')](_0x4cebf2,_0xf34c('0xc7')+_0xe1a492['id']+'-'+_0x5d8cf0+_0xf34c('0xc8'));var _0x11f927={'path':_0x250977,'channel':_0xf34c('0xb9'),'interactionId':_0xe1a492['id']};return pdf[_0xf34c('0xc9')](_0x3c8309,_0x11f927);})['then'](function(){return new Promise(function(_0x1d21b0,_0x17a23a){zipdir(_0x4cebf2,{'saveTo':_0x2c1819},function(_0x3c0582,_0x8d354d){if(_0x3c0582)return _0x17a23a(_0x3c0582);return _0x1d21b0(_0x8d354d);});})[_0xf34c('0x14')](function(){return new BPromise(function(_0x251c17,_0x3ba208){rimraf(_0x4cebf2,function(_0x3c027f){if(_0x3c027f)_0x3ba208(_0x3c027f);return _0x251c17();});});})['then'](function(){return _0x3589cd['download'](_0x2c1819,_0x225747,function(_0x35a804){if(_0x35a804){logger['error'](_0xf34c('0xca'),_0x35a804);}else{fs[_0xf34c('0xcb')](_0x2c1819);}});});});}else{return _0x3589cd['sendStatus'](0xc8);}})[_0xf34c('0x1e')](handleError(_0x3589cd,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 4c4b2ff..bdc8ebf 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 _0xba3f=['ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','unreadMessages','emit','catch','hook','exports','events'];(function(_0x2a4249,_0xae8e83){var _0x4242b7=function(_0x560164){while(--_0x560164){_0x2a4249['push'](_0x2a4249['shift']());}};_0x4242b7(++_0xae8e83);}(_0xba3f,0x1e5));var _0xfba3=function(_0x4ac955,_0x213752){_0x4ac955=_0x4ac955-0x0;var _0xe5f809=_0xba3f[_0x4ac955];return _0xe5f809;};'use strict';var EventEmitter=require(_0xfba3('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xfba3('0x1')];var ChatMessage=require(_0xfba3('0x2'))['db'][_0xfba3('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xfba3('0x4')](0x0);var events={'afterCreate':_0xfba3('0x5'),'afterUpdate':_0xfba3('0x6'),'afterDestroy':_0xfba3('0x7')};function emitEvent(_0x370081){return function(_0x18ab8d,_0x3b67c9,_0x1893d4){_0x18ab8d[_0xfba3('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x49e323){_0x18ab8d['setDataValue'](_0xfba3('0x9'),_0x49e323[_0xfba3('0xa')](function(_0x2d4775){return{'id':_0x2d4775['id']};}));return ChatMessage[_0xfba3('0xb')]({'where':{'ChatInteractionId':_0x18ab8d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfba3('0xc')](function(_0x475735){_0x18ab8d['setDataValue'](_0xfba3('0xd'),_0x475735['length']);ChatInteractionEvents['emit'](_0x370081+':'+_0x18ab8d['id'],_0x18ab8d);ChatInteractionEvents[_0xfba3('0xe')](_0x370081,_0x18ab8d);_0x1893d4(null);})[_0xfba3('0xf')](_0x1893d4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xfba3('0x10')](e,emitEvent(event));}}module[_0xfba3('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x51b9=['map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','getUsers','then','setDataValue','Users'];(function(_0x1d3754,_0x826730){var _0x57f960=function(_0x4bc427){while(--_0x4bc427){_0x1d3754['push'](_0x1d3754['shift']());}};_0x57f960(++_0x826730);}(_0x51b9,0x8e));var _0x951b=function(_0x287c3a,_0x1b39e0){_0x287c3a=_0x287c3a-0x0;var _0x129cfd=_0x51b9[_0x287c3a];return _0x129cfd;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x951b('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x951b('0x1')](0x0);var events={'afterCreate':_0x951b('0x2'),'afterUpdate':_0x951b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x14e696){return function(_0x56050e,_0x327132,_0x434c0a){_0x56050e[_0x951b('0x4')]({'attributes':['id'],'raw':!![]})[_0x951b('0x5')](function(_0x137d6b){_0x56050e[_0x951b('0x6')](_0x951b('0x7'),_0x137d6b[_0x951b('0x8')](function(_0x1514ce){return{'id':_0x1514ce['id']};}));return ChatMessage[_0x951b('0x9')]({'where':{'ChatInteractionId':_0x56050e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x951b('0x5')](function(_0x20bede){_0x56050e[_0x951b('0x6')](_0x951b('0xa'),_0x20bede[_0x951b('0xb')]);ChatInteractionEvents[_0x951b('0xc')](_0x14e696+':'+_0x56050e['id'],_0x56050e);ChatInteractionEvents[_0x951b('0xc')](_0x14e696,_0x56050e);_0x434c0a(null);})['catch'](_0x434c0a(null));};}for(var e in events){if(events[_0x951b('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x951b('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 6ee2012..8bfdca9 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 _0x81eb=['format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closed'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0x81eb,0x91));var _0xb81e=function(_0x4646ed,_0x207e40){_0x4646ed=_0x4646ed-0x0;var _0x3b2b1a=_0x81eb[_0x4646ed];return _0x3b2b1a;};'use strict';var _=require(_0xb81e('0x0'));var util=require(_0xb81e('0x1'));var logger=require(_0xb81e('0x2'))(_0xb81e('0x3'));var moment=require(_0xb81e('0x4'));var BPromise=require(_0xb81e('0x5'));var rp=require(_0xb81e('0x6'));var fs=require('fs');var path=require(_0xb81e('0x7'));var rimraf=require(_0xb81e('0x8'));var config=require(_0xb81e('0x9'));var attributes=require(_0xb81e('0xa'));module[_0xb81e('0xb')]=function(_0x4bc44a,_0x16cc12){return _0x4bc44a['define'](_0xb81e('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c4309,_0x42a955,_0x14136c){if(_0x5c4309[_0xb81e('0xd')](_0xb81e('0xe'))){_0x5c4309['closedAt']=moment()[_0xb81e('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x14136c(null,_0x5c4309);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xaa3b=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed'];(function(_0x33dcbd,_0x5a5db6){var _0x280783=function(_0x2f16f0){while(--_0x2f16f0){_0x33dcbd['push'](_0x33dcbd['shift']());}};_0x280783(++_0x5a5db6);}(_0xaa3b,0x124));var _0xbaa3=function(_0x32017c,_0x3991d4){_0x32017c=_0x32017c-0x0;var _0xca9140=_0xaa3b[_0x32017c];return _0xca9140;};'use strict';var _=require(_0xbaa3('0x0'));var util=require(_0xbaa3('0x1'));var logger=require(_0xbaa3('0x2'))(_0xbaa3('0x3'));var moment=require(_0xbaa3('0x4'));var BPromise=require('bluebird');var rp=require(_0xbaa3('0x5'));var fs=require('fs');var path=require(_0xbaa3('0x6'));var rimraf=require('rimraf');var config=require(_0xbaa3('0x7'));var attributes=require(_0xbaa3('0x8'));module[_0xbaa3('0x9')]=function(_0x3e5491,_0x1d2652){return _0x3e5491[_0xbaa3('0xa')](_0xbaa3('0xb'),attributes,{'tableName':_0xbaa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x409904,_0x13b373,_0x13517a){if(_0x409904['changed'](_0xbaa3('0xd'))){_0x409904[_0xbaa3('0xe')]=moment()[_0xbaa3('0xf')](_0xbaa3('0x10'));}_0x13517a(null,_0x409904);}},'charset':_0xbaa3('0x11'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index ae224f2..b5c1116 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 _0x71be=['addTags','omit','AddTags','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','update','body','options','raw','attributes','UpdateChatInteraction','AddTagsToChatInteraction','find','where'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x71be,0x17f));var _0xe71b=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x71be[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0xe71b('0x0'));var util=require(_0xe71b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe71b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe71b('0x3'))['db'];var utils=require(_0xe71b('0x4'));var logger=require(_0xe71b('0x5'))(_0xe71b('0x6'));var config=require('../../config/environment');var jayson=require(_0xe71b('0x7'));var client=jayson[_0xe71b('0x8')]['http']({'port':0x232a});config[_0xe71b('0x9')]=_['defaults'](config[_0xe71b('0x9')],{'host':_0xe71b('0xa'),'port':0x18eb});var socket=require(_0xe71b('0xb'))(new Redis(config[_0xe71b('0x9')]));require(_0xe71b('0xc'))[_0xe71b('0xd')](socket);function respondWithRpcPromise(_0x2794ba,_0x142ef8,_0x57edda){return new BPromise(function(_0x46c000,_0x4a3be1){return client[_0xe71b('0xe')](_0x2794ba,_0x57edda)[_0xe71b('0xf')](function(_0x31858b){logger[_0xe71b('0x10')](_0xe71b('0x11'),_0x142ef8,_0xe71b('0x12'));logger[_0xe71b('0x13')](_0xe71b('0x14'),_0x142ef8,'request\x20sent',JSON[_0xe71b('0x15')](_0x31858b));if(_0x31858b['error']){if(_0x31858b[_0xe71b('0x16')][_0xe71b('0x17')]===0x1f4){logger[_0xe71b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x142ef8,_0x31858b['error']['message']);return _0x4a3be1(_0x31858b[_0xe71b('0x16')][_0xe71b('0x18')]);}logger[_0xe71b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x142ef8,_0x31858b[_0xe71b('0x16')]['message']);return _0x46c000(_0x31858b['error']['message']);}else{logger['info'](_0xe71b('0x11'),_0x142ef8,_0xe71b('0x12'));_0x46c000(_0x31858b['result'][_0xe71b('0x18')]);}})[_0xe71b('0x19')](function(_0x422a6c){logger[_0xe71b('0x16')](_0xe71b('0x11'),_0x142ef8,_0x422a6c);_0x4a3be1(_0x422a6c);});});}exports['UpdateChatInteraction']=function(_0x38a9ba){var _0x2da49d=this;return new Promise(function(_0x1a00f0,_0xcbde4b){return db['ChatInteraction'][_0xe71b('0x1a')](_0x38a9ba[_0xe71b('0x1b')],{'raw':_0x38a9ba[_0xe71b('0x1c')]?_0x38a9ba['options'][_0xe71b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38a9ba['options']?_0x38a9ba[_0xe71b('0x1c')]['where']||null:null,'attributes':_0x38a9ba['options']?_0x38a9ba['options'][_0xe71b('0x1e')]||null:null,'limit':_0x38a9ba[_0xe71b('0x1c')]?_0x38a9ba['options']['limit']||null:null})['then'](function(_0x5c7fdd){logger[_0xe71b('0x10')](_0xe71b('0x1f'),_0x38a9ba);logger[_0xe71b('0x13')](_0xe71b('0x1f'),_0x38a9ba,JSON[_0xe71b('0x15')](_0x5c7fdd));_0x1a00f0(_0x5c7fdd);})[_0xe71b('0x19')](function(_0x5748eb){logger[_0xe71b('0x16')]('UpdateChatInteraction',_0x5748eb['message'],_0x38a9ba);_0xcbde4b(_0x2da49d[_0xe71b('0x16')](0x1f4,_0x5748eb['message']));});});};exports[_0xe71b('0x20')]=function(_0x11b37c){return new Promise(function(_0x560aaa,_0x481a53){return db['ChatInteraction'][_0xe71b('0x21')]({'where':_0x11b37c[_0xe71b('0x1c')]?_0x11b37c[_0xe71b('0x1c')][_0xe71b('0x22')]||null:null})['then'](function(_0xf40616){if(_0xf40616){return _0xf40616[_0xe71b('0x23')](_0x11b37c['body']['ids'],_[_0xe71b('0x24')](_0x11b37c[_0xe71b('0x1b')],['ids','id'])||{});}})['spread'](function(_0x348bf9){logger[_0xe71b('0x10')](_0xe71b('0x25'),_0x11b37c);logger[_0xe71b('0x13')](_0xe71b('0x25'),_0x11b37c,JSON[_0xe71b('0x15')](_0x348bf9));_0x560aaa(_0x348bf9);})[_0xe71b('0x19')](function(_0x300cef){logger[_0xe71b('0x16')](_0xe71b('0x25'),_0x300cef[_0xe71b('0x18')],_0x11b37c);_0x481a53(_this[_0xe71b('0x16')](0x1f4,_0x300cef[_0xe71b('0x18')]));});});}; \ No newline at end of file +var _0x2825=['where','attributes','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','then','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','catch','ChatInteraction','update','body','options','raw'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x2825,0xb0));var _0x5282=function(_0x5c5d59,_0x2879e5){_0x5c5d59=_0x5c5d59-0x0;var _0x18c8b4=_0x2825[_0x5c5d59];return _0x18c8b4;};'use strict';var _=require(_0x5282('0x0'));var util=require(_0x5282('0x1'));var moment=require('moment');var BPromise=require(_0x5282('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5282('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5282('0x4'));var logger=require(_0x5282('0x5'))(_0x5282('0x6'));var config=require(_0x5282('0x7'));var jayson=require(_0x5282('0x8'));var client=jayson['client'][_0x5282('0x9')]({'port':0x232a});config['redis']=_[_0x5282('0xa')](config['redis'],{'host':_0x5282('0xb'),'port':0x18eb});var socket=require(_0x5282('0xc'))(new Redis(config[_0x5282('0xd')]));require(_0x5282('0xe'))['register'](socket);function respondWithRpcPromise(_0x48347e,_0x2d4646,_0x107083){return new BPromise(function(_0x33d372,_0x5a3484){return client[_0x5282('0xf')](_0x48347e,_0x107083)['then'](function(_0x43d541){logger[_0x5282('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2d4646,_0x5282('0x11'));logger[_0x5282('0x12')](_0x5282('0x13'),_0x2d4646,_0x5282('0x11'),JSON['stringify'](_0x43d541));if(_0x43d541['error']){if(_0x43d541['error']['code']===0x1f4){logger[_0x5282('0x14')](_0x5282('0x15'),_0x2d4646,_0x43d541[_0x5282('0x14')]['message']);return _0x5a3484(_0x43d541[_0x5282('0x14')][_0x5282('0x16')]);}logger[_0x5282('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2d4646,_0x43d541[_0x5282('0x14')]['message']);return _0x33d372(_0x43d541[_0x5282('0x14')][_0x5282('0x16')]);}else{logger[_0x5282('0x10')](_0x5282('0x15'),_0x2d4646,_0x5282('0x11'));_0x33d372(_0x43d541['result'][_0x5282('0x16')]);}})[_0x5282('0x17')](function(_0x56aaeb){logger[_0x5282('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2d4646,_0x56aaeb);_0x5a3484(_0x56aaeb);});});}exports['UpdateChatInteraction']=function(_0xf9c809){var _0x1d63e5=this;return new Promise(function(_0x4579d9,_0xef6fee){return db[_0x5282('0x18')][_0x5282('0x19')](_0xf9c809[_0x5282('0x1a')],{'raw':_0xf9c809[_0x5282('0x1b')]?_0xf9c809[_0x5282('0x1b')][_0x5282('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf9c809[_0x5282('0x1b')]?_0xf9c809[_0x5282('0x1b')][_0x5282('0x1d')]||null:null,'attributes':_0xf9c809[_0x5282('0x1b')]?_0xf9c809[_0x5282('0x1b')][_0x5282('0x1e')]||null:null,'limit':_0xf9c809[_0x5282('0x1b')]?_0xf9c809[_0x5282('0x1b')][_0x5282('0x1f')]||null:null})['then'](function(_0x4f4ffa){logger[_0x5282('0x10')](_0x5282('0x20'),_0xf9c809);logger[_0x5282('0x12')](_0x5282('0x20'),_0xf9c809,JSON[_0x5282('0x21')](_0x4f4ffa));_0x4579d9(_0x4f4ffa);})['catch'](function(_0x17dca4){logger[_0x5282('0x14')](_0x5282('0x20'),_0x17dca4['message'],_0xf9c809);_0xef6fee(_0x1d63e5[_0x5282('0x14')](0x1f4,_0x17dca4[_0x5282('0x16')]));});});};exports[_0x5282('0x22')]=function(_0xa9a4db){return new Promise(function(_0x225423,_0x4277b7){return db['ChatInteraction']['find']({'where':_0xa9a4db[_0x5282('0x1b')]?_0xa9a4db[_0x5282('0x1b')]['where']||null:null})[_0x5282('0x23')](function(_0x38eb54){if(_0x38eb54){return _0x38eb54[_0x5282('0x24')](_0xa9a4db[_0x5282('0x1a')][_0x5282('0x25')],_[_0x5282('0x26')](_0xa9a4db[_0x5282('0x1a')],[_0x5282('0x25'),'id'])||{});}})[_0x5282('0x27')](function(_0x3b34fd){logger[_0x5282('0x10')](_0x5282('0x28'),_0xa9a4db);logger[_0x5282('0x12')]('AddTags',_0xa9a4db,JSON[_0x5282('0x21')](_0x3b34fd));_0x225423(_0x3b34fd);})[_0x5282('0x17')](function(_0x1ac601){logger[_0x5282('0x14')](_0x5282('0x28'),_0x1ac601[_0x5282('0x16')],_0xa9a4db);_0x4277b7(_this[_0x5282('0x14')](0x1f4,_0x1ac601['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 07a6dec..456b121 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 _0xb33f=['chatInteraction:','./chatInteraction.events','save','emit','removeListener','register'];(function(_0xfffa3c,_0x421a7f){var _0x332ce4=function(_0x3006a2){while(--_0x3006a2){_0xfffa3c['push'](_0xfffa3c['shift']());}};_0x332ce4(++_0x421a7f);}(_0xb33f,0x169));var _0xfb33=function(_0xbba988,_0x81e842){_0xbba988=_0xbba988-0x0;var _0x2f9b8b=_0xb33f[_0xbba988];return _0x2f9b8b;};'use strict';var ChatInteractionEvents=require(_0xfb33('0x0'));var events=[_0xfb33('0x1'),'remove','update'];function createListener(_0x55ded3,_0x52186c){return function(_0x5cf4a6){_0x52186c[_0xfb33('0x2')](_0x55ded3,_0x5cf4a6);};}function removeListener(_0x2cc437,_0x27ebe0){return function(){ChatInteractionEvents[_0xfb33('0x3')](_0x2cc437,_0x27ebe0);};}exports[_0xfb33('0x4')]=function(_0x309369){for(var _0x25e560=0x0,_0x56b07c=events['length'];_0x25e560<_0x56b07c;_0x25e560++){var _0x453ae3=events[_0x25e560];var _0x3d7a67=createListener(_0xfb33('0x5')+_0x453ae3,_0x309369);ChatInteractionEvents['on'](_0x453ae3,_0x3d7a67);}}; \ No newline at end of file +var _0x53a4=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x2d2006,_0x2d27b3){var _0x442661=function(_0x4838ea){while(--_0x4838ea){_0x2d2006['push'](_0x2d2006['shift']());}};_0x442661(++_0x2d27b3);}(_0x53a4,0xed));var _0x453a=function(_0x1d8623,_0x58eb8b){_0x1d8623=_0x1d8623-0x0;var _0x13395f=_0x53a4[_0x1d8623];return _0x13395f;};'use strict';var ChatInteractionEvents=require(_0x453a('0x0'));var events=[_0x453a('0x1'),_0x453a('0x2'),_0x453a('0x3')];function createListener(_0x500b23,_0x19a181){return function(_0x35ee4e){_0x19a181['emit'](_0x500b23,_0x35ee4e);};}function removeListener(_0x4e21c9,_0x2125cf){return function(){ChatInteractionEvents[_0x453a('0x4')](_0x4e21c9,_0x2125cf);};}exports[_0x453a('0x5')]=function(_0xb1c38b){for(var _0x472c96=0x0,_0x1295fd=events[_0x453a('0x6')];_0x472c96<_0x1295fd;_0x472c96++){var _0x1e9bd5=events[_0x472c96];var _0x3b86d5=createListener(_0x453a('0x7')+_0x1e9bd5,_0xb1c38b);ChatInteractionEvents['on'](_0x1e9bd5,_0x3b86d5);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 6d49c65..60c0033 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 _0x09ad=['download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','/:id','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chat','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x3daf1a,_0x3094ea){var _0x28210d=function(_0x29e615){while(--_0x29e615){_0x3daf1a['push'](_0x3daf1a['shift']());}};_0x28210d(++_0x3094ea);}(_0x09ad,0x1d9));var _0xd09a=function(_0x1b6984,_0x49a66b){_0x1b6984=_0x1b6984-0x0;var _0x199a4a=_0x09ad[_0x1b6984];return _0x199a4a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd09a('0x0'));var express=require('express');var router=express[_0xd09a('0x1')]();var fs_extra=require(_0xd09a('0x2'));var auth=require(_0xd09a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd09a('0x4'));router[_0xd09a('0x5')]('/',auth[_0xd09a('0x6')](),controller[_0xd09a('0x7')]);router[_0xd09a('0x5')](_0xd09a('0x8'),auth[_0xd09a('0x6')](),controller['describe']);router['get']('/:id',auth[_0xd09a('0x9')](),controller[_0xd09a('0xa')]);router[_0xd09a('0x5')](_0xd09a('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xd09a('0xc')]);router[_0xd09a('0x5')](_0xd09a('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd09a('0x5')](_0xd09a('0xe'),auth[_0xd09a('0x9')](),controller[_0xd09a('0xf')]);router[_0xd09a('0x5')](_0xd09a('0x10'),auth[_0xd09a('0x6')](),controller[_0xd09a('0x11')]);router[_0xd09a('0x12')]('/',auth[_0xd09a('0x6')](),controller[_0xd09a('0x13')]);router[_0xd09a('0x12')](_0xd09a('0x14'),auth[_0xd09a('0x6')](),controller[_0xd09a('0x15')]);var upload=multer({'storage':multer[_0xd09a('0x16')]({'destination':function(_0x3daa9f,_0x44ec81,_0x11b113){_0x11b113(null,path['join'](config['root'],_0xd09a('0x17')));},'filename':function(_0x247b6e,_0x5546cf,_0x4cc60f){_0x4cc60f(null,util[_0xd09a('0x18')](_0xd09a('0x19'),Date[_0xd09a('0x1a')](),_0x5546cf[_0xd09a('0x1b')][_0xd09a('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd09a('0x12')](_0xd09a('0x1d'),upload[_0xd09a('0x1e')](_0xd09a('0x1f')),controller['attachmentUpload']);router[_0xd09a('0x12')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xd09a('0x20')]);router[_0xd09a('0x12')](_0xd09a('0x21'),auth[_0xd09a('0x6')](),interaction[_0xd09a('0x22')]('chat',_0xd09a('0x23')),controller[_0xd09a('0x24')]);router['put'](_0xd09a('0x25'),auth[_0xd09a('0x6')](),interaction[_0xd09a('0x22')]('chat',_0xd09a('0x26')),controller[_0xd09a('0x27')]);router[_0xd09a('0x28')](_0xd09a('0x29'),controller['customUpdate']);router['put'](_0xd09a('0x2a'),auth[_0xd09a('0x9')](),controller['abandon']);router[_0xd09a('0x28')](_0xd09a('0x2b'),controller[_0xd09a('0x2c')]);router[_0xd09a('0x2d')](_0xd09a('0x25'),auth[_0xd09a('0x6')](),interaction['tracked'](_0xd09a('0x2e'),'chatinteraction:destroy'),controller[_0xd09a('0x2f')]);router[_0xd09a('0x2d')](_0xd09a('0x21'),auth[_0xd09a('0x6')](),controller['removeTags']);module[_0xd09a('0x30')]=router; \ No newline at end of file +var _0xa57d=['chat','chatinteraction:addtags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','index','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','post','create','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','addMessage','/:id/tags'];(function(_0x3f4bef,_0x359a87){var _0x1989b7=function(_0xe0ffca){while(--_0xe0ffca){_0x3f4bef['push'](_0x3f4bef['shift']());}};_0x1989b7(++_0x359a87);}(_0xa57d,0x75));var _0xda57=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0xa57d[_0x1b5080];return _0x195c87;};'use strict';var multer=require('multer');var util=require(_0xda57('0x0'));var path=require(_0xda57('0x1'));var timeout=require(_0xda57('0x2'));var express=require('express');var router=express[_0xda57('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda57('0x4'));var interaction=require(_0xda57('0x5'));var config=require('../../config/environment');var controller=require(_0xda57('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xda57('0x7')]);router['get']('/describe',auth[_0xda57('0x8')](),controller[_0xda57('0x9')]);router[_0xda57('0xa')](_0xda57('0xb'),auth[_0xda57('0xc')](),controller[_0xda57('0xd')]);router[_0xda57('0xa')](_0xda57('0xe'),auth[_0xda57('0xc')](),controller[_0xda57('0xf')]);router['get'](_0xda57('0x10'),auth[_0xda57('0x8')](),controller['getMessages']);router[_0xda57('0xa')](_0xda57('0x11'),auth[_0xda57('0xc')](),controller['getMyMessages']);router[_0xda57('0xa')](_0xda57('0x12'),auth[_0xda57('0x8')](),controller['download']);router[_0xda57('0x13')]('/',auth[_0xda57('0x8')](),controller[_0xda57('0x14')]);router[_0xda57('0x13')](_0xda57('0x15'),auth[_0xda57('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xda57('0x16')]({'destination':function(_0x58f0e2,_0x4ec5c9,_0x4dec6a){_0x4dec6a(null,path[_0xda57('0x17')](config['root'],_0xda57('0x18')));},'filename':function(_0x19775a,_0x17043e,_0x2938f4){_0x2938f4(null,util[_0xda57('0x19')](_0xda57('0x1a'),Date['now'](),_0x17043e[_0xda57('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xda57('0x1c'),upload[_0xda57('0x1d')](_0xda57('0x1e')),controller['attachmentUpload']);router[_0xda57('0x13')](_0xda57('0x10'),auth[_0xda57('0xc')](),controller[_0xda57('0x1f')]);router[_0xda57('0x13')](_0xda57('0x20'),auth['isAuthenticated'](),interaction['tracked'](_0xda57('0x21'),_0xda57('0x22')),controller['addTags']);router[_0xda57('0x23')](_0xda57('0xb'),auth[_0xda57('0x8')](),interaction[_0xda57('0x24')](_0xda57('0x21'),_0xda57('0x25')),controller[_0xda57('0x26')]);router[_0xda57('0x23')](_0xda57('0x27'),controller[_0xda57('0x28')]);router[_0xda57('0x23')](_0xda57('0x29'),auth[_0xda57('0xc')](),controller[_0xda57('0x2a')]);router[_0xda57('0x23')](_0xda57('0x2b'),controller[_0xda57('0x2c')]);router[_0xda57('0x2d')](_0xda57('0xb'),auth[_0xda57('0x8')](),interaction[_0xda57('0x24')]('chat',_0xda57('0x2e')),controller[_0xda57('0x2f')]);router[_0xda57('0x2d')]('/:id/tags',auth[_0xda57('0x8')](),controller[_0xda57('0x30')]);module[_0xda57('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ce73035..0243cd7 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 _0xa7f0=['INTEGER','exports','BOOLEAN'];(function(_0x449c5c,_0x5f33f5){var _0x2fac5a=function(_0x434491){while(--_0x434491){_0x449c5c['push'](_0x449c5c['shift']());}};_0x2fac5a(++_0x5f33f5);}(_0xa7f0,0x1cc));var _0x0a7f=function(_0x310dbc,_0xc25dc6){_0x310dbc=_0x310dbc-0x0;var _0x1991a1=_0xa7f0[_0x310dbc];return _0x1991a1;};'use strict';var Sequelize=require('sequelize');module[_0x0a7f('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0a7f('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0a7f('0x2')]}}; \ No newline at end of file +var _0x03d5=['sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x5a9a99,_0x368f7f){var _0x20b713=function(_0x3e73bb){while(--_0x3e73bb){_0x5a9a99['push'](_0x5a9a99['shift']());}};_0x20b713(++_0x368f7f);}(_0x03d5,0xb9));var _0x503d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03d5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x503d('0x0'));module[_0x503d('0x1')]={'body':{'type':Sequelize[_0x503d('0x2')](_0x503d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x503d('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 5ccd103..90e1949 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 _0x7e70=['-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','lodash','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','ChatInternalMessage','include','findAll','catch','show','find','create','body','describe','get','createdAt','lastMessage','lastMessageAt','format','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','push','messages','FromId','read'];(function(_0x59a001,_0x31e2f){var _0x2a5b72=function(_0x883ed8){while(--_0x883ed8){_0x59a001['push'](_0x59a001['shift']());}};_0x2a5b72(++_0x31e2f);}(_0x7e70,0x67));var _0x07e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e70[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x07e7('0x0'));var jsonpatch=require(_0x07e7('0x1'));var rp=require(_0x07e7('0x2'));var moment=require(_0x07e7('0x3'));var BPromise=require(_0x07e7('0x4'));var Mustache=require(_0x07e7('0x5'));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(_0x07e7('0x6'));var _=require(_0x07e7('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x07e7('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x07e7('0x9'));var querystring=require(_0x07e7('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x07e7('0xb'));var qs=require(_0x07e7('0xc'));var as=require(_0x07e7('0xd'));var hardwareService=require(_0x07e7('0xe'));var logger=require(_0x07e7('0xf'))(_0x07e7('0x10'));var utils=require('../../config/utils');var config=require(_0x07e7('0x11'));var licenseUtil=require(_0x07e7('0x12'));var db=require(_0x07e7('0x13'))['db'];config[_0x07e7('0x14')]=_[_0x07e7('0x15')](config[_0x07e7('0x14')],{'host':_0x07e7('0x16'),'port':0x18eb});var socket=require(_0x07e7('0x17'))(new Redis(config[_0x07e7('0x14')]));require(_0x07e7('0x18'))[_0x07e7('0x19')](socket);function respondWithStatusCode(_0x353214,_0x4be42f){_0x4be42f=_0x4be42f||0xcc;return function(_0x1e45d3){if(_0x1e45d3){return _0x353214[_0x07e7('0x1a')](_0x4be42f);}return _0x353214[_0x07e7('0x1b')](_0x4be42f)[_0x07e7('0x1c')]();};}function respondWithResult(_0x1f7baf,_0x2ed6f1){_0x2ed6f1=_0x2ed6f1||0xc8;return function(_0x2fcb18){if(_0x2fcb18){return _0x1f7baf[_0x07e7('0x1b')](_0x2ed6f1)[_0x07e7('0x1d')](_0x2fcb18);}};}function respondWithFilteredResult(_0x846ce6,_0x8aabb3){return function(_0x307abb){if(_0x307abb){var _0x40002f=typeof _0x8aabb3[_0x07e7('0x1e')]===_0x07e7('0x1f')&&typeof _0x8aabb3[_0x07e7('0x20')]===_0x07e7('0x1f');var _0x2bf162=_0x307abb[_0x07e7('0x21')];var _0x2583e=_0x40002f?0x0:_0x8aabb3['offset'];var _0x5df345=_0x40002f?_0x307abb[_0x07e7('0x21')]:_0x8aabb3['offset']+_0x8aabb3[_0x07e7('0x20')];var _0x2b2ea6;if(_0x5df345>=_0x2bf162){_0x5df345=_0x2bf162;_0x2b2ea6=0xc8;}else{_0x2b2ea6=0xce;}_0x846ce6[_0x07e7('0x1b')](_0x2b2ea6);return _0x846ce6[_0x07e7('0x22')](_0x07e7('0x23'),_0x2583e+'-'+_0x5df345+'/'+_0x2bf162)[_0x07e7('0x1d')](_0x307abb);}return null;};}function patchUpdates(_0x5c532b){return function(_0x32d2a9){try{jsonpatch['apply'](_0x32d2a9,_0x5c532b,!![]);}catch(_0x5abf13){return BPromise[_0x07e7('0x24')](_0x5abf13);}return _0x32d2a9['save']();};}function saveUpdates(_0x4f6824,_0x1bd0cb){return function(_0x506e8e){if(_0x506e8e){return _0x506e8e[_0x07e7('0x25')](_0x4f6824)[_0x07e7('0x26')](function(_0x511010){return _0x511010;});}return null;};}function removeEntity(_0x1e8006,_0xd6104a){return function(_0x283b40){if(_0x283b40){return _0x283b40['destroy']()[_0x07e7('0x26')](function(){_0x1e8006[_0x07e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14fc69,_0x33c6e8){return function(_0x532015){if(!_0x532015){_0x14fc69[_0x07e7('0x1a')](0x194);}return _0x532015;};}function handleError(_0x1b00cc,_0x5c04a3){_0x5c04a3=_0x5c04a3||0x1f4;return function(_0x12cc65){logger['error'](_0x12cc65[_0x07e7('0x27')]);if(_0x12cc65['name']){delete _0x12cc65[_0x07e7('0x28')];}_0x1b00cc[_0x07e7('0x1b')](_0x5c04a3)[_0x07e7('0x29')](_0x12cc65);};}exports['index']=function(_0x174ec7,_0x4e69cb){var _0x22d9c8={},_0x43243f={},_0x5e5ca5={'count':0x0,'rows':[]};var _0x3ef98b=_[_0x07e7('0x2a')](db['ChatInternalMessage']['rawAttributes'],function(_0x1c4691){return{'name':_0x1c4691[_0x07e7('0x2b')],'type':_0x1c4691['type'][_0x07e7('0x2c')]};});_0x43243f[_0x07e7('0x2d')]=_['map'](_0x3ef98b,_0x07e7('0x28'));_0x43243f[_0x07e7('0x2e')]=_[_0x07e7('0x2f')](_0x174ec7[_0x07e7('0x2e')]);_0x43243f[_0x07e7('0x30')]=_[_0x07e7('0x31')](_0x43243f[_0x07e7('0x2d')],_0x43243f['query']);_0x22d9c8[_0x07e7('0x32')]=_[_0x07e7('0x31')](_0x43243f[_0x07e7('0x2d')],qs['fields'](_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x33')]));_0x22d9c8[_0x07e7('0x32')]=_0x22d9c8[_0x07e7('0x32')][_0x07e7('0x34')]?_0x22d9c8[_0x07e7('0x32')]:_0x43243f['model'];if(!_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x35')](_0x07e7('0x36'))){_0x22d9c8[_0x07e7('0x20')]=qs[_0x07e7('0x20')](_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x20')]);_0x22d9c8[_0x07e7('0x1e')]=qs[_0x07e7('0x1e')](_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x1e')]);}_0x22d9c8[_0x07e7('0x37')]=qs[_0x07e7('0x38')](_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x38')]);_0x22d9c8[_0x07e7('0x39')]=qs[_0x07e7('0x30')](_['pick'](_0x174ec7[_0x07e7('0x2e')],_0x43243f['filters']),_0x3ef98b);if(_0x174ec7[_0x07e7('0x2e')]['filter']){_0x22d9c8[_0x07e7('0x39')]=_['merge'](_0x22d9c8[_0x07e7('0x39')],{'$or':_['map'](_0x3ef98b,function(_0x313b53){if(_0x313b53[_0x07e7('0x3a')]!==_0x07e7('0x3b')){var _0x3632fe={};_0x3632fe[_0x313b53['name']]={'$like':'%'+_0x174ec7[_0x07e7('0x2e')][_0x07e7('0x3c')]+'%'};return _0x3632fe;}})});}_0x22d9c8=_[_0x07e7('0x3d')]({},_0x22d9c8,_0x174ec7[_0x07e7('0x3e')]);var _0x9a7544={'where':_0x22d9c8[_0x07e7('0x39')]};return db[_0x07e7('0x3f')][_0x07e7('0x21')](_0x9a7544)['then'](function(_0xf330bf){_0x5e5ca5[_0x07e7('0x21')]=_0xf330bf;if(_0x174ec7[_0x07e7('0x2e')]['includeAll']){_0x22d9c8[_0x07e7('0x40')]=[{'all':!![]}];}return db[_0x07e7('0x3f')][_0x07e7('0x41')](_0x22d9c8);})[_0x07e7('0x26')](function(_0x1ea58d){_0x5e5ca5['rows']=_0x1ea58d;return _0x5e5ca5;})[_0x07e7('0x26')](respondWithFilteredResult(_0x4e69cb,_0x22d9c8))[_0x07e7('0x42')](handleError(_0x4e69cb,null));};exports[_0x07e7('0x43')]=function(_0x200ed2,_0x1e9502){var _0x1693cc={'raw':!![],'where':{'id':_0x200ed2['params']['id']}},_0xc957d7={};_0xc957d7[_0x07e7('0x2d')]=_[_0x07e7('0x2f')](db[_0x07e7('0x3f')]['rawAttributes']);_0xc957d7['query']=_[_0x07e7('0x2f')](_0x200ed2[_0x07e7('0x2e')]);_0xc957d7[_0x07e7('0x30')]=_[_0x07e7('0x31')](_0xc957d7[_0x07e7('0x2d')],_0xc957d7[_0x07e7('0x2e')]);_0x1693cc[_0x07e7('0x32')]=_['intersection'](_0xc957d7[_0x07e7('0x2d')],qs['fields'](_0x200ed2[_0x07e7('0x2e')][_0x07e7('0x33')]));_0x1693cc[_0x07e7('0x32')]=_0x1693cc[_0x07e7('0x32')][_0x07e7('0x34')]?_0x1693cc[_0x07e7('0x32')]:_0xc957d7[_0x07e7('0x2d')];if(_0x200ed2['query']['includeAll']){_0x1693cc[_0x07e7('0x40')]=[{'all':!![]}];}_0x1693cc=_['merge']({},_0x1693cc,_0x200ed2['options']);return db[_0x07e7('0x3f')][_0x07e7('0x44')](_0x1693cc)['then'](handleEntityNotFound(_0x1e9502,null))['then'](respondWithResult(_0x1e9502,null))[_0x07e7('0x42')](handleError(_0x1e9502,null));};exports[_0x07e7('0x45')]=function(_0x25b8fe,_0x116a1f){return db[_0x07e7('0x3f')][_0x07e7('0x45')](_0x25b8fe['body'],{})[_0x07e7('0x26')](respondWithResult(_0x116a1f,0xc9))[_0x07e7('0x42')](handleError(_0x116a1f,null));};exports[_0x07e7('0x25')]=function(_0x18df76,_0x1a6051){if(_0x18df76[_0x07e7('0x46')]['id']){delete _0x18df76[_0x07e7('0x46')]['id'];}return db[_0x07e7('0x3f')][_0x07e7('0x44')]({'where':{'id':_0x18df76['params']['id']}})[_0x07e7('0x26')](handleEntityNotFound(_0x1a6051,null))['then'](saveUpdates(_0x18df76[_0x07e7('0x46')],null))[_0x07e7('0x26')](respondWithResult(_0x1a6051,null))['catch'](handleError(_0x1a6051,null));};exports['destroy']=function(_0x3ff2f4,_0x8794de){return db[_0x07e7('0x3f')][_0x07e7('0x44')]({'where':{'id':_0x3ff2f4['params']['id']}})['then'](handleEntityNotFound(_0x8794de,null))[_0x07e7('0x26')](removeEntity(_0x8794de,null))[_0x07e7('0x42')](handleError(_0x8794de,null));};exports[_0x07e7('0x47')]=function(_0x17a64e,_0x59bf82){return db[_0x07e7('0x3f')][_0x07e7('0x47')]()['then'](respondWithResult(_0x59bf82,null))[_0x07e7('0x42')](handleError(_0x59bf82,null));};function wrapUser(_0x91c5fc){return function(_0x2d3c1c){var _0x444cd4=_0x91c5fc[_0x07e7('0x48')]({'plain':!![]});_0x444cd4['messages']=[];if(_0x2d3c1c){_0x444cd4['lastMessageAt']=_0x2d3c1c[_0x07e7('0x49')];_0x444cd4[_0x07e7('0x4a')]=_0x2d3c1c;}else{_0x444cd4[_0x07e7('0x4b')]=moment(0x0)[_0x07e7('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x444cd4[_0x07e7('0x4a')]={};}return _0x444cd4;};}exports['getUsers']=function(_0x4d75aa,_0x49e13b,_0x5d6143){var _0x118dac=[];return db[_0x07e7('0x4d')][_0x07e7('0x41')]({'where':{'role':[_0x07e7('0x4e'),_0x07e7('0x4f'),_0x07e7('0x50')]},'attributes':['id','fullname',_0x07e7('0x28'),_0x07e7('0x51'),_0x07e7('0x52'),_0x07e7('0x53'),_0x07e7('0x54'),_0x07e7('0x55'),'allowmessenger',_0x07e7('0x56')],'order':qs['sort'](_0x07e7('0x57')),'include':[{'model':db['VoiceQueue'],'as':_0x07e7('0x58'),'attributes':['id',_0x07e7('0x28'),_0x07e7('0x3a')],'through':{'attributes':[]}}]})[_0x07e7('0x26')](function(_0x28bc48){if(_0x28bc48){var _0x19a5bc=_0x4d75aa['user'][_0x07e7('0x48')]({'plain':!![]});if(!_0x19a5bc)throw new Error(_0x07e7('0x59'));if(_0x19a5bc[_0x07e7('0x51')]===_0x07e7('0x50')){return db[_0x07e7('0x5a')][_0x07e7('0x44')]({'where':{'name':_0x07e7('0x5b'),'userProfileId':_0x19a5bc[_0x07e7('0x5c')]},'raw':!![]})['then'](function(_0x12ff0f){if(_0x12ff0f){if(_0x12ff0f[_0x07e7('0x5d')]===0x0){return db[_0x07e7('0x5e')][_0x07e7('0x41')]({'where':{'sectionId':_0x12ff0f['id']},'raw':!![]})[_0x07e7('0x26')](function(_0x451209){var _0x37a8c7=[];if(_['isEmpty'](_0x451209)){_0x37a8c7=_[_0x07e7('0x3c')](_0x28bc48,function(_0x238815){if(_0x238815['role']!==_0x07e7('0x4e')){return _0x238815;}});return _0x37a8c7;}else{for(var _0x3e7de1=0x0;_0x3e7de1<_0x28bc48[_0x07e7('0x34')];_0x3e7de1++){var _0x3460f1=_0x28bc48[_0x3e7de1];if(_0x3460f1[_0x07e7('0x51')]===_0x07e7('0x4e')){var _0x58e66c=_[_0x07e7('0x44')](_0x451209,function(_0x523ef0){return _0x523ef0['resourceId']===_0x3460f1['id'];});if(_0x58e66c)_0x37a8c7['push'](_0x3460f1);}else{_0x37a8c7[_0x07e7('0x5f')](_0x3460f1);}}return _0x37a8c7;}});}else{return _0x28bc48;}}else{var _0x21b7b3=_[_0x07e7('0x3c')](_0x28bc48,function(_0x4885ee){if(_0x4885ee[_0x07e7('0x51')]!=='agent'){return _0x4885ee;}});return _0x21b7b3;}});}else{return _0x28bc48;}}})[_0x07e7('0x26')](function(_0x5ed745){var _0x15c026=[];if(_0x5ed745){_0x118dac=_0x5ed745;for(var _0x234c74=0x0;_0x234c74<_0x5ed745[_0x07e7('0x34')];_0x234c74+=0x1){_0x118dac[_0x234c74][_0x07e7('0x60')]=[];_0x15c026['push'](db[_0x07e7('0x3f')][_0x07e7('0x44')]({'where':{'FromId':[_0x4d75aa[_0x07e7('0x50')]['id'],_0x5ed745[_0x234c74]['id']],'ToId':[_0x4d75aa[_0x07e7('0x50')]['id'],_0x5ed745[_0x234c74]['id']],'ChatGroupId':null},'attributes':['id',_0x07e7('0x49'),_0x07e7('0x61'),'ToId',_0x07e7('0x62'),'body'],'order':qs[_0x07e7('0x38')](_0x07e7('0x63')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x07e7('0x26')](wrapUser(_0x5ed745[_0x234c74])));}return BPromise[_0x07e7('0x64')](_0x15c026);}return[];})[_0x07e7('0x26')](function(_0x24f91c){return{'rows':_0x24f91c,'count':_0x24f91c['length']};})[_0x07e7('0x26')](respondWithResult(_0x49e13b,null))[_0x07e7('0x42')](handleError(_0x49e13b,null));}; \ No newline at end of file +var _0xacb3=['push','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','destroy','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','isEmpty','resourceId'];(function(_0x12f57f,_0x459a93){var _0x4bd519=function(_0x429f08){while(--_0x429f08){_0x12f57f['push'](_0x12f57f['shift']());}};_0x4bd519(++_0x459a93);}(_0xacb3,0xe6));var _0x3acb=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xacb3[_0x597484];return _0x218e64;};'use strict';var emlformat=require(_0x3acb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3acb('0x1'));var jsonpatch=require(_0x3acb('0x2'));var rp=require(_0x3acb('0x3'));var moment=require('moment');var BPromise=require(_0x3acb('0x4'));var Mustache=require(_0x3acb('0x5'));var util=require(_0x3acb('0x6'));var path=require(_0x3acb('0x7'));var sox=require('sox');var csv=require(_0x3acb('0x8'));var ejs=require(_0x3acb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3acb('0xa'));var crypto=require(_0x3acb('0xb'));var jsforce=require(_0x3acb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3acb('0x8'));var querystring=require(_0x3acb('0xd'));var Papa=require(_0x3acb('0xe'));var Redis=require(_0x3acb('0xf'));var authService=require(_0x3acb('0x10'));var qs=require(_0x3acb('0x11'));var as=require(_0x3acb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3acb('0x13'))(_0x3acb('0x14'));var utils=require(_0x3acb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3acb('0x16'));var db=require(_0x3acb('0x17'))['db'];config[_0x3acb('0x18')]=_[_0x3acb('0x19')](config['redis'],{'host':_0x3acb('0x1a'),'port':0x18eb});var socket=require(_0x3acb('0x1b'))(new Redis(config['redis']));require(_0x3acb('0x1c'))['register'](socket);function respondWithStatusCode(_0x5aa404,_0x3027f9){_0x3027f9=_0x3027f9||0xcc;return function(_0x1822f9){if(_0x1822f9){return _0x5aa404[_0x3acb('0x1d')](_0x3027f9);}return _0x5aa404[_0x3acb('0x1e')](_0x3027f9)[_0x3acb('0x1f')]();};}function respondWithResult(_0xc1ad8d,_0x2f147b){_0x2f147b=_0x2f147b||0xc8;return function(_0x1959be){if(_0x1959be){return _0xc1ad8d[_0x3acb('0x1e')](_0x2f147b)['json'](_0x1959be);}};}function respondWithFilteredResult(_0x3d4fc6,_0xa89a4e){return function(_0x5b07d8){if(_0x5b07d8){var _0x5f3b04=typeof _0xa89a4e[_0x3acb('0x20')]===_0x3acb('0x21')&&typeof _0xa89a4e[_0x3acb('0x22')]===_0x3acb('0x21');var _0x4c79cc=_0x5b07d8[_0x3acb('0x23')];var _0x17d92f=_0x5f3b04?0x0:_0xa89a4e[_0x3acb('0x20')];var _0x4a0219=_0x5f3b04?_0x5b07d8[_0x3acb('0x23')]:_0xa89a4e[_0x3acb('0x20')]+_0xa89a4e[_0x3acb('0x22')];var _0x195548;if(_0x4a0219>=_0x4c79cc){_0x4a0219=_0x4c79cc;_0x195548=0xc8;}else{_0x195548=0xce;}_0x3d4fc6[_0x3acb('0x1e')](_0x195548);return _0x3d4fc6[_0x3acb('0x24')]('Content-Range',_0x17d92f+'-'+_0x4a0219+'/'+_0x4c79cc)[_0x3acb('0x25')](_0x5b07d8);}return null;};}function patchUpdates(_0x34272e){return function(_0x9d347c){try{jsonpatch[_0x3acb('0x26')](_0x9d347c,_0x34272e,!![]);}catch(_0x286cbf){return BPromise[_0x3acb('0x27')](_0x286cbf);}return _0x9d347c[_0x3acb('0x28')]();};}function saveUpdates(_0x17fb35,_0x49b76a){return function(_0x3307e9){if(_0x3307e9){return _0x3307e9[_0x3acb('0x29')](_0x17fb35)[_0x3acb('0x2a')](function(_0x174365){return _0x174365;});}return null;};}function removeEntity(_0x15991e,_0x27f5a8){return function(_0x76f114){if(_0x76f114){return _0x76f114['destroy']()['then'](function(){_0x15991e[_0x3acb('0x1e')](0xcc)[_0x3acb('0x1f')]();});}};}function handleEntityNotFound(_0x1fc94e,_0x352d17){return function(_0x560a85){if(!_0x560a85){_0x1fc94e[_0x3acb('0x1d')](0x194);}return _0x560a85;};}function handleError(_0x2d2574,_0x591ba0){_0x591ba0=_0x591ba0||0x1f4;return function(_0x499453){logger[_0x3acb('0x2b')](_0x499453[_0x3acb('0x2c')]);if(_0x499453[_0x3acb('0x2d')]){delete _0x499453[_0x3acb('0x2d')];}_0x2d2574[_0x3acb('0x1e')](_0x591ba0)['send'](_0x499453);};}exports[_0x3acb('0x2e')]=function(_0x4f5934,_0x54293f){var _0x1ffc32={},_0x857aa7={},_0x2aa02b={'count':0x0,'rows':[]};var _0x389535=_[_0x3acb('0x2f')](db[_0x3acb('0x30')][_0x3acb('0x31')],function(_0x4d3687){return{'name':_0x4d3687[_0x3acb('0x32')],'type':_0x4d3687[_0x3acb('0x33')][_0x3acb('0x34')]};});_0x857aa7[_0x3acb('0x35')]=_[_0x3acb('0x2f')](_0x389535,_0x3acb('0x2d'));_0x857aa7[_0x3acb('0x36')]=_[_0x3acb('0x37')](_0x4f5934[_0x3acb('0x36')]);_0x857aa7[_0x3acb('0x38')]=_[_0x3acb('0x39')](_0x857aa7[_0x3acb('0x35')],_0x857aa7[_0x3acb('0x36')]);_0x1ffc32['attributes']=_[_0x3acb('0x39')](_0x857aa7['model'],qs['fields'](_0x4f5934['query'][_0x3acb('0x3a')]));_0x1ffc32[_0x3acb('0x3b')]=_0x1ffc32[_0x3acb('0x3b')][_0x3acb('0x3c')]?_0x1ffc32['attributes']:_0x857aa7['model'];if(!_0x4f5934[_0x3acb('0x36')][_0x3acb('0x3d')](_0x3acb('0x3e'))){_0x1ffc32[_0x3acb('0x22')]=qs['limit'](_0x4f5934[_0x3acb('0x36')][_0x3acb('0x22')]);_0x1ffc32[_0x3acb('0x20')]=qs[_0x3acb('0x20')](_0x4f5934[_0x3acb('0x36')][_0x3acb('0x20')]);}_0x1ffc32[_0x3acb('0x3f')]=qs[_0x3acb('0x40')](_0x4f5934[_0x3acb('0x36')]['sort']);_0x1ffc32[_0x3acb('0x41')]=qs[_0x3acb('0x38')](_[_0x3acb('0x42')](_0x4f5934['query'],_0x857aa7[_0x3acb('0x38')]),_0x389535);if(_0x4f5934[_0x3acb('0x36')][_0x3acb('0x43')]){_0x1ffc32[_0x3acb('0x41')]=_[_0x3acb('0x44')](_0x1ffc32['where'],{'$or':_[_0x3acb('0x2f')](_0x389535,function(_0x36d072){if(_0x36d072['type']!==_0x3acb('0x45')){var _0x3b84a1={};_0x3b84a1[_0x36d072[_0x3acb('0x2d')]]={'$like':'%'+_0x4f5934[_0x3acb('0x36')][_0x3acb('0x43')]+'%'};return _0x3b84a1;}})});}_0x1ffc32=_['merge']({},_0x1ffc32,_0x4f5934[_0x3acb('0x46')]);var _0x5b9805={'where':_0x1ffc32[_0x3acb('0x41')]};return db[_0x3acb('0x30')][_0x3acb('0x23')](_0x5b9805)[_0x3acb('0x2a')](function(_0xa4203a){_0x2aa02b['count']=_0xa4203a;if(_0x4f5934[_0x3acb('0x36')][_0x3acb('0x47')]){_0x1ffc32['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x3acb('0x48')](_0x1ffc32);})[_0x3acb('0x2a')](function(_0x360ab9){_0x2aa02b[_0x3acb('0x49')]=_0x360ab9;return _0x2aa02b;})[_0x3acb('0x2a')](respondWithFilteredResult(_0x54293f,_0x1ffc32))[_0x3acb('0x4a')](handleError(_0x54293f,null));};exports[_0x3acb('0x4b')]=function(_0x363e6d,_0x1bca18){var _0xbdae39={'raw':!![],'where':{'id':_0x363e6d[_0x3acb('0x4c')]['id']}},_0x3268df={};_0x3268df[_0x3acb('0x35')]=_[_0x3acb('0x37')](db['ChatInternalMessage'][_0x3acb('0x31')]);_0x3268df[_0x3acb('0x36')]=_[_0x3acb('0x37')](_0x363e6d[_0x3acb('0x36')]);_0x3268df['filters']=_['intersection'](_0x3268df['model'],_0x3268df[_0x3acb('0x36')]);_0xbdae39[_0x3acb('0x3b')]=_['intersection'](_0x3268df[_0x3acb('0x35')],qs[_0x3acb('0x3a')](_0x363e6d[_0x3acb('0x36')][_0x3acb('0x3a')]));_0xbdae39['attributes']=_0xbdae39[_0x3acb('0x3b')][_0x3acb('0x3c')]?_0xbdae39[_0x3acb('0x3b')]:_0x3268df['model'];if(_0x363e6d[_0x3acb('0x36')][_0x3acb('0x47')]){_0xbdae39[_0x3acb('0x4d')]=[{'all':!![]}];}_0xbdae39=_['merge']({},_0xbdae39,_0x363e6d[_0x3acb('0x46')]);return db[_0x3acb('0x30')]['find'](_0xbdae39)[_0x3acb('0x2a')](handleEntityNotFound(_0x1bca18,null))[_0x3acb('0x2a')](respondWithResult(_0x1bca18,null))[_0x3acb('0x4a')](handleError(_0x1bca18,null));};exports['create']=function(_0x4c5134,_0x791b6f){return db[_0x3acb('0x30')][_0x3acb('0x4e')](_0x4c5134[_0x3acb('0x4f')],{})[_0x3acb('0x2a')](respondWithResult(_0x791b6f,0xc9))[_0x3acb('0x4a')](handleError(_0x791b6f,null));};exports[_0x3acb('0x29')]=function(_0x1e342d,_0x422f0b){if(_0x1e342d[_0x3acb('0x4f')]['id']){delete _0x1e342d[_0x3acb('0x4f')]['id'];}return db[_0x3acb('0x30')][_0x3acb('0x50')]({'where':{'id':_0x1e342d[_0x3acb('0x4c')]['id']}})[_0x3acb('0x2a')](handleEntityNotFound(_0x422f0b,null))['then'](saveUpdates(_0x1e342d[_0x3acb('0x4f')],null))[_0x3acb('0x2a')](respondWithResult(_0x422f0b,null))[_0x3acb('0x4a')](handleError(_0x422f0b,null));};exports[_0x3acb('0x51')]=function(_0x2ab8b6,_0x568ad0){return db[_0x3acb('0x30')][_0x3acb('0x50')]({'where':{'id':_0x2ab8b6[_0x3acb('0x4c')]['id']}})[_0x3acb('0x2a')](handleEntityNotFound(_0x568ad0,null))[_0x3acb('0x2a')](removeEntity(_0x568ad0,null))[_0x3acb('0x4a')](handleError(_0x568ad0,null));};exports[_0x3acb('0x52')]=function(_0x48970b,_0xe30f11){return db[_0x3acb('0x30')]['describe']()[_0x3acb('0x2a')](respondWithResult(_0xe30f11,null))['catch'](handleError(_0xe30f11,null));};function wrapUser(_0x3ed9cc){return function(_0x2ac295){var _0x5203a8=_0x3ed9cc[_0x3acb('0x53')]({'plain':!![]});_0x5203a8[_0x3acb('0x54')]=[];if(_0x2ac295){_0x5203a8['lastMessageAt']=_0x2ac295[_0x3acb('0x55')];_0x5203a8[_0x3acb('0x56')]=_0x2ac295;}else{_0x5203a8[_0x3acb('0x57')]=moment(0x0)[_0x3acb('0x58')](_0x3acb('0x59'));_0x5203a8[_0x3acb('0x56')]={};}return _0x5203a8;};}exports['getUsers']=function(_0x187c7b,_0x9a682d,_0x205bc8){var _0x483c06=[];return db[_0x3acb('0x5a')][_0x3acb('0x48')]({'where':{'role':[_0x3acb('0x5b'),_0x3acb('0x5c'),_0x3acb('0x5d')]},'attributes':['id',_0x3acb('0x5e'),'name',_0x3acb('0x5f'),'userpic',_0x3acb('0x60'),_0x3acb('0x61'),_0x3acb('0x62'),_0x3acb('0x63'),_0x3acb('0x64')],'order':qs[_0x3acb('0x40')](_0x3acb('0x65')),'include':[{'model':db['VoiceQueue'],'as':_0x3acb('0x66'),'attributes':['id',_0x3acb('0x2d'),_0x3acb('0x33')],'through':{'attributes':[]}}]})[_0x3acb('0x2a')](function(_0x2d51c9){if(_0x2d51c9){var _0x3ee854=_0x187c7b['user']['get']({'plain':!![]});if(!_0x3ee854)throw new Error(_0x3acb('0x67'));if(_0x3ee854['role']===_0x3acb('0x5d')){return db[_0x3acb('0x68')][_0x3acb('0x50')]({'where':{'name':_0x3acb('0x69'),'userProfileId':_0x3ee854['userProfileId']},'raw':!![]})[_0x3acb('0x2a')](function(_0x5359c2){if(_0x5359c2){if(_0x5359c2[_0x3acb('0x6a')]===0x0){return db['UserProfileResource'][_0x3acb('0x48')]({'where':{'sectionId':_0x5359c2['id']},'raw':!![]})[_0x3acb('0x2a')](function(_0x4f9dfe){var _0x49f2c9=[];if(_[_0x3acb('0x6b')](_0x4f9dfe)){_0x49f2c9=_['filter'](_0x2d51c9,function(_0x2ed033){if(_0x2ed033[_0x3acb('0x5f')]!==_0x3acb('0x5b')){return _0x2ed033;}});return _0x49f2c9;}else{for(var _0x49ab4c=0x0;_0x49ab4c<_0x2d51c9['length'];_0x49ab4c++){var _0x42747e=_0x2d51c9[_0x49ab4c];if(_0x42747e['role']===_0x3acb('0x5b')){var _0x11d670=_[_0x3acb('0x50')](_0x4f9dfe,function(_0x42b7fc){return _0x42b7fc[_0x3acb('0x6c')]===_0x42747e['id'];});if(_0x11d670)_0x49f2c9[_0x3acb('0x6d')](_0x42747e);}else{_0x49f2c9[_0x3acb('0x6d')](_0x42747e);}}return _0x49f2c9;}});}else{return _0x2d51c9;}}else{var _0x525b39=_[_0x3acb('0x43')](_0x2d51c9,function(_0x3ecb4e){if(_0x3ecb4e[_0x3acb('0x5f')]!==_0x3acb('0x5b')){return _0x3ecb4e;}});return _0x525b39;}});}else{return _0x2d51c9;}}})['then'](function(_0x562ed4){var _0x30f179=[];if(_0x562ed4){_0x483c06=_0x562ed4;for(var _0x2562d9=0x0;_0x2562d9<_0x562ed4[_0x3acb('0x3c')];_0x2562d9+=0x1){_0x483c06[_0x2562d9][_0x3acb('0x54')]=[];_0x30f179['push'](db[_0x3acb('0x30')][_0x3acb('0x50')]({'where':{'FromId':[_0x187c7b[_0x3acb('0x5d')]['id'],_0x562ed4[_0x2562d9]['id']],'ToId':[_0x187c7b[_0x3acb('0x5d')]['id'],_0x562ed4[_0x2562d9]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId',_0x3acb('0x6e'),'body'],'order':qs[_0x3acb('0x40')](_0x3acb('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3acb('0x2a')](wrapUser(_0x562ed4[_0x2562d9])));}return BPromise[_0x3acb('0x70')](_0x30f179);}return[];})['then'](function(_0xa94880){return{'rows':_0xa94880,'count':_0xa94880['length']};})[_0x3acb('0x2a')](respondWithResult(_0x9a682d,null))[_0x3acb('0x4a')](handleError(_0x9a682d,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 619d98b..3b47bb0 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 _0x50e4=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x129071,_0x360dba){var _0x4edaab=function(_0x12c4b8){while(--_0x12c4b8){_0x129071['push'](_0x129071['shift']());}};_0x4edaab(++_0x360dba);}(_0x50e4,0x1c5));var _0x450e=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x50e4[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require(_0x450e('0x0'));var ChatInternalMessage=require(_0x450e('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x450e('0x2'),'afterUpdate':_0x450e('0x3'),'afterDestroy':_0x450e('0x4')};function emitEvent(_0x884f61){return function(_0x51cd35,_0x448c96,_0x5a0981){ChatInternalMessageEvents[_0x450e('0x5')](_0x884f61+':'+_0x51cd35['id'],_0x51cd35);ChatInternalMessageEvents[_0x450e('0x5')](_0x884f61,_0x51cd35);_0x5a0981(null);};}for(var e in events){if(events[_0x450e('0x6')](e)){var event=events[e];ChatInternalMessage[_0x450e('0x7')](e,emitEvent(event));}}module[_0x450e('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xffcd=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','save'];(function(_0x24ceda,_0x268b86){var _0x5f1616=function(_0x322fc9){while(--_0x322fc9){_0x24ceda['push'](_0x24ceda['shift']());}};_0x5f1616(++_0x268b86);}(_0xffcd,0xbd));var _0xdffc=function(_0xb72479,_0x5939fd){_0xb72479=_0xb72479-0x0;var _0x2ef029=_0xffcd[_0xb72479];return _0x2ef029;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xdffc('0x0'))['db'][_0xdffc('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdffc('0x2'),'afterUpdate':_0xdffc('0x3'),'afterDestroy':_0xdffc('0x4')};function emitEvent(_0xd642c0){return function(_0x47b783,_0x3689a3,_0x1c5919){ChatInternalMessageEvents['emit'](_0xd642c0+':'+_0x47b783['id'],_0x47b783);ChatInternalMessageEvents[_0xdffc('0x5')](_0xd642c0,_0x47b783);_0x1c5919(null);};}for(var e in events){if(events[_0xdffc('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xdffc('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index d903a95..6fa05a6 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 _0xc35a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x14022a,_0x4ca101){var _0x12b439=function(_0x9f5f11){while(--_0x9f5f11){_0x14022a['push'](_0x14022a['shift']());}};_0x12b439(++_0x4ca101);}(_0xc35a,0x1c0));var _0xac35=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc35a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xac35('0x0'))(_0xac35('0x1'));var moment=require(_0xac35('0x2'));var BPromise=require(_0xac35('0x3'));var rp=require(_0xac35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac35('0x5'));var config=require(_0xac35('0x6'));var attributes=require(_0xac35('0x7'));module[_0xac35('0x8')]=function(_0x49943a,_0x3642e6){return _0x49943a[_0xac35('0x9')](_0xac35('0xa'),attributes,{'tableName':_0xac35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac35('0xc'),'collate':_0xac35('0xd')});}; \ No newline at end of file +var _0xa466=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa466,0x127));var _0x6a46=function(_0x2fd88e,_0x51ff8f){_0x2fd88e=_0x2fd88e-0x0;var _0x29d093=_0xa466[_0x2fd88e];return _0x29d093;};'use strict';var _=require(_0x6a46('0x0'));var util=require(_0x6a46('0x1'));var logger=require(_0x6a46('0x2'))(_0x6a46('0x3'));var moment=require(_0x6a46('0x4'));var BPromise=require(_0x6a46('0x5'));var rp=require(_0x6a46('0x6'));var fs=require('fs');var path=require(_0x6a46('0x7'));var rimraf=require('rimraf');var config=require(_0x6a46('0x8'));var attributes=require(_0x6a46('0x9'));module[_0x6a46('0xa')]=function(_0x500c70,_0x35bb6a){return _0x500c70[_0x6a46('0xb')](_0x6a46('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a46('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index e0dab78..624f31d 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 _0xf864=['catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result'];(function(_0x30d5f8,_0x39ef3f){var _0x1c05da=function(_0x5437ef){while(--_0x5437ef){_0x30d5f8['push'](_0x30d5f8['shift']());}};_0x1c05da(++_0x39ef3f);}(_0xf864,0x11f));var _0x4f86=function(_0x4acde9,_0x2f2a6b){_0x4acde9=_0x4acde9-0x0;var _0x9d771d=_0xf864[_0x4acde9];return _0x9d771d;};'use strict';var _=require(_0x4f86('0x0'));var util=require('util');var moment=require(_0x4f86('0x1'));var BPromise=require(_0x4f86('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f86('0x3'));var logger=require(_0x4f86('0x4'))(_0x4f86('0x5'));var config=require(_0x4f86('0x6'));var jayson=require(_0x4f86('0x7'));var client=jayson[_0x4f86('0x8')][_0x4f86('0x9')]({'port':0x232a});config[_0x4f86('0xa')]=_[_0x4f86('0xb')](config['redis'],{'host':_0x4f86('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f86('0xa')]));require(_0x4f86('0xd'))[_0x4f86('0xe')](socket);function respondWithRpcPromise(_0x1ef1e9,_0x1026cb,_0x332584){return new BPromise(function(_0x9cdb82,_0x2220d5){return client[_0x4f86('0xf')](_0x1ef1e9,_0x332584)['then'](function(_0x1a0f57){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x1026cb,_0x4f86('0x10'));logger[_0x4f86('0x11')](_0x4f86('0x12'),_0x1026cb,_0x4f86('0x10'),JSON[_0x4f86('0x13')](_0x1a0f57));if(_0x1a0f57['error']){if(_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x15')]===0x1f4){logger['error'](_0x4f86('0x16'),_0x1026cb,_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x17')]);return _0x2220d5(_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x17')]);}logger[_0x4f86('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1026cb,_0x1a0f57['error'][_0x4f86('0x17')]);return _0x9cdb82(_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x17')]);}else{logger['info'](_0x4f86('0x16'),_0x1026cb,_0x4f86('0x10'));_0x9cdb82(_0x1a0f57[_0x4f86('0x18')]['message']);}})[_0x4f86('0x19')](function(_0x1a102a){logger[_0x4f86('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1026cb,_0x1a102a);_0x2220d5(_0x1a102a);});});} \ No newline at end of file +var _0x3fa4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./chatInternalMessage.socket','register','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x50ee01,_0x1ec86d){var _0x18ee89=function(_0x642eb){while(--_0x642eb){_0x50ee01['push'](_0x50ee01['shift']());}};_0x18ee89(++_0x1ec86d);}(_0x3fa4,0x87));var _0x43fa=function(_0x27ece6,_0x2181eb){_0x27ece6=_0x27ece6-0x0;var _0x215508=_0x3fa4[_0x27ece6];return _0x215508;};'use strict';var _=require('lodash');var util=require(_0x43fa('0x0'));var moment=require(_0x43fa('0x1'));var BPromise=require(_0x43fa('0x2'));var rs=require(_0x43fa('0x3'));var fs=require('fs');var Redis=require(_0x43fa('0x4'));var db=require(_0x43fa('0x5'))['db'];var utils=require(_0x43fa('0x6'));var logger=require(_0x43fa('0x7'))(_0x43fa('0x8'));var config=require(_0x43fa('0x9'));var jayson=require(_0x43fa('0xa'));var client=jayson[_0x43fa('0xb')]['http']({'port':0x232a});config[_0x43fa('0xc')]=_[_0x43fa('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43fa('0xc')]));require(_0x43fa('0xe'))[_0x43fa('0xf')](socket);function respondWithRpcPromise(_0x117f2f,_0x7e9635,_0x48966b){return new BPromise(function(_0x4a3aea,_0x270275){return client['request'](_0x117f2f,_0x48966b)['then'](function(_0x2f4e4e){logger[_0x43fa('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x7e9635,'request\x20sent');logger[_0x43fa('0x11')](_0x43fa('0x12'),_0x7e9635,_0x43fa('0x13'),JSON[_0x43fa('0x14')](_0x2f4e4e));if(_0x2f4e4e[_0x43fa('0x15')]){if(_0x2f4e4e[_0x43fa('0x15')][_0x43fa('0x16')]===0x1f4){logger[_0x43fa('0x15')](_0x43fa('0x17'),_0x7e9635,_0x2f4e4e[_0x43fa('0x15')][_0x43fa('0x18')]);return _0x270275(_0x2f4e4e['error'][_0x43fa('0x18')]);}logger[_0x43fa('0x15')](_0x43fa('0x17'),_0x7e9635,_0x2f4e4e[_0x43fa('0x15')][_0x43fa('0x18')]);return _0x4a3aea(_0x2f4e4e[_0x43fa('0x15')]['message']);}else{logger[_0x43fa('0x10')](_0x43fa('0x17'),_0x7e9635,_0x43fa('0x13'));_0x4a3aea(_0x2f4e4e[_0x43fa('0x19')][_0x43fa('0x18')]);}})[_0x43fa('0x1a')](function(_0x28e616){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x7e9635,_0x28e616);_0x270275(_0x28e616);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 6fd357c..bb692f6 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 _0x3e90=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','emit'];(function(_0x241430,_0x3de3a0){var _0x18cb73=function(_0x572768){while(--_0x572768){_0x241430['push'](_0x241430['shift']());}};_0x18cb73(++_0x3de3a0);}(_0x3e90,0xfc));var _0x03e9=function(_0x4d1ac9,_0x37e63a){_0x4d1ac9=_0x4d1ac9-0x0;var _0x41c2d9=_0x3e90[_0x4d1ac9];return _0x41c2d9;};'use strict';var ChatInternalMessageEvents=require(_0x03e9('0x0'));var events=[_0x03e9('0x1'),_0x03e9('0x2'),'update'];function createListener(_0x7eb69d,_0x5edda9){return function(_0x517534){_0x5edda9[_0x03e9('0x3')](_0x7eb69d,_0x517534);};}function removeListener(_0xa4e773,_0x553f11){return function(){ChatInternalMessageEvents[_0x03e9('0x4')](_0xa4e773,_0x553f11);};}exports[_0x03e9('0x5')]=function(_0x4af048){for(var _0x584db7=0x0,_0x1ddb10=events[_0x03e9('0x6')];_0x584db7<_0x1ddb10;_0x584db7++){var _0x4dc786=events[_0x584db7];var _0x3524f4=createListener(_0x03e9('0x7')+_0x4dc786,_0x4af048);ChatInternalMessageEvents['on'](_0x4dc786,_0x3524f4);}}; \ No newline at end of file +var _0x2f06=['chatInternalMessage:','save','remove','update','register','length'];(function(_0x207d76,_0x2bca29){var _0x447d0e=function(_0x2581b8){while(--_0x2581b8){_0x207d76['push'](_0x207d76['shift']());}};_0x447d0e(++_0x2bca29);}(_0x2f06,0x157));var _0x62f0=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2f06[_0x160c73];return _0xd9302;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x62f0('0x0'),_0x62f0('0x1'),_0x62f0('0x2')];function createListener(_0x58e25c,_0x1a0109){return function(_0x47c5a7){_0x1a0109['emit'](_0x58e25c,_0x47c5a7);};}function removeListener(_0x3efcdc,_0x2e6911){return function(){ChatInternalMessageEvents['removeListener'](_0x3efcdc,_0x2e6911);};}exports[_0x62f0('0x3')]=function(_0x1ecabf){for(var _0xb4611=0x0,_0x33fb2c=events[_0x62f0('0x4')];_0xb4611<_0x33fb2c;_0xb4611++){var _0x399811=events[_0xb4611];var _0x2fa80b=createListener(_0x62f0('0x5')+_0x399811,_0x1ecabf);ChatInternalMessageEvents['on'](_0x399811,_0x2fa80b);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index fc07fba..ada52c0 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 _0xd605=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','put'];(function(_0x2e6006,_0x314c29){var _0x701665=function(_0x219014){while(--_0x219014){_0x2e6006['push'](_0x2e6006['shift']());}};_0x701665(++_0x314c29);}(_0xd605,0x117));var _0x5d60=function(_0x2bbc90,_0x1e6a76){_0x2bbc90=_0x2bbc90-0x0;var _0x2a1aec=_0xd605[_0x2bbc90];return _0x2a1aec;};'use strict';var multer=require(_0x5d60('0x0'));var util=require(_0x5d60('0x1'));var path=require(_0x5d60('0x2'));var timeout=require(_0x5d60('0x3'));var express=require(_0x5d60('0x4'));var router=express[_0x5d60('0x5')]();var fs_extra=require(_0x5d60('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5d60('0x7'));var config=require(_0x5d60('0x8'));var controller=require(_0x5d60('0x9'));router[_0x5d60('0xa')]('/',auth[_0x5d60('0xb')](),controller[_0x5d60('0xc')]);router[_0x5d60('0xa')](_0x5d60('0xd'),auth['isAuthenticated'](),controller[_0x5d60('0xe')]);router[_0x5d60('0xa')](_0x5d60('0xf'),auth['isAuthenticated'](),controller[_0x5d60('0x10')]);router[_0x5d60('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5d60('0x11')]);router[_0x5d60('0x12')]('/',auth[_0x5d60('0xb')](),controller['create']);router[_0x5d60('0x13')]('/:id',controller[_0x5d60('0x14')]);router['delete']('/:id',auth[_0x5d60('0xb')](),controller[_0x5d60('0x15')]);module[_0x5d60('0x16')]=router; \ No newline at end of file +var _0xf51b=['/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x1764cb,_0x306994){var _0x47af88=function(_0xb90b64){while(--_0xb90b64){_0x1764cb['push'](_0x1764cb['shift']());}};_0x47af88(++_0x306994);}(_0xf51b,0xa0));var _0xbf51=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf51b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf51('0x0'));var timeout=require(_0xbf51('0x1'));var express=require(_0xbf51('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbf51('0x3'));var interaction=require(_0xbf51('0x4'));var config=require(_0xbf51('0x5'));var controller=require(_0xbf51('0x6'));router[_0xbf51('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbf51('0x7')](_0xbf51('0x8'),auth[_0xbf51('0x9')](),controller[_0xbf51('0xa')]);router[_0xbf51('0x7')](_0xbf51('0xb'),auth[_0xbf51('0x9')](),controller[_0xbf51('0xc')]);router['get'](_0xbf51('0xd'),auth[_0xbf51('0x9')](),controller[_0xbf51('0xe')]);router[_0xbf51('0xf')]('/',auth['isAuthenticated'](),controller[_0xbf51('0x10')]);router[_0xbf51('0x11')](_0xbf51('0xd'),controller[_0xbf51('0x12')]);router['delete'](_0xbf51('0xd'),auth[_0xbf51('0x9')](),controller[_0xbf51('0x13')]);module[_0xbf51('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 8035da9..c1bebe2 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 _0xd523=['medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x1a858a,_0x2ab7a6){var _0x307d43=function(_0x41ad91){while(--_0x41ad91){_0x1a858a['push'](_0x1a858a['shift']());}};_0x307d43(++_0x2ab7a6);}(_0xd523,0x153));var _0x3d52=function(_0x4336fc,_0x1ddb83){_0x4336fc=_0x4336fc-0x0;var _0x54c6d8=_0xd523[_0x4336fc];return _0x54c6d8;};'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 _0x4bde=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x1fc5e4,_0xfdb368){var _0x5b9ccf=function(_0x3046cd){while(--_0x3046cd){_0x1fc5e4['push'](_0x1fc5e4['shift']());}};_0x5b9ccf(++_0xfdb368);}(_0x4bde,0x1b1));var _0xe4bd=function(_0xc478d9,_0x290265){_0xc478d9=_0xc478d9-0x0;var _0x5b2dbf=_0x4bde[_0xc478d9];return _0x5b2dbf;};'use strict';var Sequelize=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]={'body':{'type':Sequelize[_0xe4bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe4bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe4bd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe4bd('0x4')]('in',_0xe4bd('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe4bd('0x6')]},'providerName':{'type':Sequelize[_0xe4bd('0x7')]},'providerResponse':{'type':Sequelize[_0xe4bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index acde294..d2a6837 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 _0x1583=['Content-Range','save','update','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','ChatMessage','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','User','fullname','internal','event','rejectmessage','parse','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x564975,_0xfd42e){var _0x3dc18f=function(_0x46b2b5){while(--_0x46b2b5){_0x564975['push'](_0x564975['shift']());}};_0x3dc18f(++_0xfd42e);}(_0x1583,0x1e8));var _0x3158=function(_0x4a89df,_0x180ff4){_0x4a89df=_0x4a89df-0x0;var _0x13fef8=_0x1583[_0x4a89df];return _0x13fef8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3158('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3158('0x1'));var BPromise=require(_0x3158('0x2'));var Mustache=require(_0x3158('0x3'));var util=require(_0x3158('0x4'));var path=require(_0x3158('0x5'));var sox=require(_0x3158('0x6'));var csv=require('to-csv');var ejs=require(_0x3158('0x7'));var fs=require('fs');var fs_extra=require(_0x3158('0x8'));var _=require('lodash');var squel=require(_0x3158('0x9'));var crypto=require('crypto');var jsforce=require(_0x3158('0xa'));var deskjs=require(_0x3158('0xb'));var toCsv=require(_0x3158('0xc'));var querystring=require(_0x3158('0xd'));var Papa=require(_0x3158('0xe'));var Redis=require(_0x3158('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3158('0x10'));var as=require(_0x3158('0x11'));var hardwareService=require(_0x3158('0x12'));var logger=require(_0x3158('0x13'))(_0x3158('0x14'));var utils=require(_0x3158('0x15'));var config=require(_0x3158('0x16'));var licenseUtil=require(_0x3158('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3158('0x18')](config[_0x3158('0x19')],{'host':_0x3158('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3158('0x19')]));require(_0x3158('0x1b'))[_0x3158('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3158('0x1d')][_0x3158('0x1e')]({'port':0x232c});var client9002=jayson[_0x3158('0x1d')][_0x3158('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x45da6a,_0x5d49b8,_0x4a4d53,_0x25582b){return new BPromise(function(_0x3c8f96,_0x527005){var _0x263dc9=_0x25582b||client;return _0x263dc9[_0x3158('0x1f')](_0x45da6a,_0x4a4d53)[_0x3158('0x20')](function(_0x40afaf){logger[_0x3158('0x21')](_0x3158('0x22'),_0x5d49b8,_0x3158('0x23'));logger[_0x3158('0x24')](_0x3158('0x25'),_0x5d49b8,_0x3158('0x23'),JSON['stringify'](_0x40afaf));if(_0x40afaf[_0x3158('0x26')]){if(_0x40afaf[_0x3158('0x26')][_0x3158('0x27')]===0x1f4){logger['error'](_0x3158('0x22'),_0x5d49b8,_0x40afaf['error'][_0x3158('0x28')]);return _0x527005(_0x40afaf['error'][_0x3158('0x28')]);}logger[_0x3158('0x26')](_0x3158('0x22'),_0x5d49b8,_0x40afaf[_0x3158('0x26')][_0x3158('0x28')]);return _0x3c8f96(_0x40afaf['error'][_0x3158('0x28')]);}else{logger[_0x3158('0x21')](_0x3158('0x22'),_0x5d49b8,_0x3158('0x23'));_0x3c8f96(_0x40afaf[_0x3158('0x29')][_0x3158('0x28')]);}})[_0x3158('0x2a')](function(_0x343c21){logger[_0x3158('0x26')](_0x3158('0x22'),_0x5d49b8,_0x343c21);_0x527005(_0x343c21);});});}function respondWithStatusCode(_0x399b42,_0x373021){_0x373021=_0x373021||0xcc;return function(_0x4b3841){if(_0x4b3841){return _0x399b42[_0x3158('0x2b')](_0x373021);}return _0x399b42[_0x3158('0x2c')](_0x373021)[_0x3158('0x2d')]();};}function respondWithResult(_0x140b11,_0x5d719b){_0x5d719b=_0x5d719b||0xc8;return function(_0x47f261){if(_0x47f261){return _0x140b11['status'](_0x5d719b)[_0x3158('0x2e')](_0x47f261);}};}function respondWithFilteredResult(_0x3183e6,_0x492db4){return function(_0xbecda8){if(_0xbecda8){var _0x550099=typeof _0x492db4[_0x3158('0x2f')]==='undefined'&&typeof _0x492db4[_0x3158('0x30')]===_0x3158('0x31');var _0x4a684d=_0xbecda8[_0x3158('0x32')];var _0x22b31c=_0x550099?0x0:_0x492db4[_0x3158('0x2f')];var _0xd63395=_0x550099?_0xbecda8[_0x3158('0x32')]:_0x492db4[_0x3158('0x2f')]+_0x492db4[_0x3158('0x30')];var _0x40c55f;if(_0xd63395>=_0x4a684d){_0xd63395=_0x4a684d;_0x40c55f=0xc8;}else{_0x40c55f=0xce;}_0x3183e6[_0x3158('0x2c')](_0x40c55f);return _0x3183e6[_0x3158('0x33')](_0x3158('0x34'),_0x22b31c+'-'+_0xd63395+'/'+_0x4a684d)['json'](_0xbecda8);}return null;};}function patchUpdates(_0x886538){return function(_0x55a22a){try{jsonpatch['apply'](_0x55a22a,_0x886538,!![]);}catch(_0x4b4058){return BPromise['reject'](_0x4b4058);}return _0x55a22a[_0x3158('0x35')]();};}function saveUpdates(_0x46274c,_0xa1e748){return function(_0x51031e){if(_0x51031e){return _0x51031e[_0x3158('0x36')](_0x46274c)['then'](function(_0x7933b){return _0x7933b;});}return null;};}function removeEntity(_0x40d6c8,_0x52d57c){return function(_0xfd7b00){if(_0xfd7b00){return _0xfd7b00[_0x3158('0x37')]()[_0x3158('0x20')](function(){_0x40d6c8['status'](0xcc)[_0x3158('0x2d')]();});}};}function handleEntityNotFound(_0x280286,_0x186eea){return function(_0x6649a9){if(!_0x6649a9){_0x280286['sendStatus'](0x194);}return _0x6649a9;};}function handleError(_0x4dae01,_0x4e4fd9){_0x4e4fd9=_0x4e4fd9||0x1f4;return function(_0x18f15f){logger[_0x3158('0x26')](_0x18f15f[_0x3158('0x38')]);if(_0x18f15f['name']){delete _0x18f15f[_0x3158('0x39')];}_0x4dae01[_0x3158('0x2c')](_0x4e4fd9)[_0x3158('0x3a')](_0x18f15f);};}exports['index']=function(_0x195908,_0x43c001){var _0x2f490d={},_0x1ecba8={},_0x51ca5b={'count':0x0,'rows':[]};var _0x34b1e2=_[_0x3158('0x3b')](db['ChatMessage'][_0x3158('0x3c')],function(_0x4f860d){return{'name':_0x4f860d['fieldName'],'type':_0x4f860d[_0x3158('0x3d')][_0x3158('0x3e')]};});_0x1ecba8[_0x3158('0x3f')]=_[_0x3158('0x3b')](_0x34b1e2,_0x3158('0x39'));_0x1ecba8[_0x3158('0x40')]=_[_0x3158('0x41')](_0x195908[_0x3158('0x40')]);_0x1ecba8[_0x3158('0x42')]=_[_0x3158('0x43')](_0x1ecba8[_0x3158('0x3f')],_0x1ecba8[_0x3158('0x40')]);_0x2f490d['attributes']=_[_0x3158('0x43')](_0x1ecba8['model'],qs[_0x3158('0x44')](_0x195908['query']['fields']));_0x2f490d['attributes']=_0x2f490d['attributes'][_0x3158('0x45')]?_0x2f490d[_0x3158('0x46')]:_0x1ecba8[_0x3158('0x3f')];if(!_0x195908['query'][_0x3158('0x47')](_0x3158('0x48'))){_0x2f490d[_0x3158('0x30')]=qs[_0x3158('0x30')](_0x195908[_0x3158('0x40')][_0x3158('0x30')]);_0x2f490d['offset']=qs[_0x3158('0x2f')](_0x195908[_0x3158('0x40')][_0x3158('0x2f')]);}_0x2f490d[_0x3158('0x49')]=qs['sort'](_0x195908[_0x3158('0x40')]['sort']);_0x2f490d[_0x3158('0x4a')]=qs[_0x3158('0x42')](_[_0x3158('0x4b')](_0x195908[_0x3158('0x40')],_0x1ecba8[_0x3158('0x42')]),_0x34b1e2);if(_0x195908[_0x3158('0x40')][_0x3158('0x4c')]){_0x2f490d['where']=_[_0x3158('0x4d')](_0x2f490d[_0x3158('0x4a')],{'$or':_[_0x3158('0x3b')](_0x34b1e2,function(_0x3c7e92){if(_0x3c7e92[_0x3158('0x3d')]!=='VIRTUAL'){var _0x288b3f={};_0x288b3f[_0x3c7e92[_0x3158('0x39')]]={'$like':'%'+_0x195908[_0x3158('0x40')]['filter']+'%'};return _0x288b3f;}})});}_0x2f490d=_[_0x3158('0x4d')]({},_0x2f490d,_0x195908[_0x3158('0x4e')]);var _0x23f987={'where':_0x2f490d[_0x3158('0x4a')]};return db['ChatMessage'][_0x3158('0x32')](_0x23f987)[_0x3158('0x20')](function(_0x4ad1a3){_0x51ca5b[_0x3158('0x32')]=_0x4ad1a3;if(_0x195908[_0x3158('0x40')][_0x3158('0x4f')]){_0x2f490d[_0x3158('0x50')]=[{'all':!![]}];}return db[_0x3158('0x51')][_0x3158('0x52')](_0x2f490d);})[_0x3158('0x20')](function(_0x1efc26){_0x51ca5b[_0x3158('0x53')]=_0x1efc26;return _0x51ca5b;})['then'](respondWithFilteredResult(_0x43c001,_0x2f490d))['catch'](handleError(_0x43c001,null));};exports[_0x3158('0x54')]=function(_0x5ce949,_0x12ff44){var _0x20c2e4={'raw':!![],'where':{'id':_0x5ce949[_0x3158('0x55')]['id']}},_0x32bc6e={};_0x32bc6e['model']=_[_0x3158('0x41')](db['ChatMessage']['rawAttributes']);_0x32bc6e['query']=_[_0x3158('0x41')](_0x5ce949[_0x3158('0x40')]);_0x32bc6e[_0x3158('0x42')]=_[_0x3158('0x43')](_0x32bc6e[_0x3158('0x3f')],_0x32bc6e[_0x3158('0x40')]);_0x20c2e4['attributes']=_[_0x3158('0x43')](_0x32bc6e['model'],qs[_0x3158('0x44')](_0x5ce949[_0x3158('0x40')][_0x3158('0x44')]));_0x20c2e4[_0x3158('0x46')]=_0x20c2e4[_0x3158('0x46')][_0x3158('0x45')]?_0x20c2e4[_0x3158('0x46')]:_0x32bc6e['model'];if(_0x5ce949[_0x3158('0x40')]['includeAll']){_0x20c2e4[_0x3158('0x50')]=[{'all':!![]}];}_0x20c2e4=_[_0x3158('0x4d')]({},_0x20c2e4,_0x5ce949[_0x3158('0x4e')]);return db['ChatMessage'][_0x3158('0x56')](_0x20c2e4)['then'](handleEntityNotFound(_0x12ff44,null))[_0x3158('0x20')](respondWithResult(_0x12ff44,null))[_0x3158('0x2a')](handleError(_0x12ff44,null));};exports[_0x3158('0x57')]=function(_0x1cdeb6,_0x26a4c1){return db[_0x3158('0x51')][_0x3158('0x57')](_0x1cdeb6[_0x3158('0x58')],{})['then'](respondWithResult(_0x26a4c1,0xc9))['catch'](handleError(_0x26a4c1,null));};exports['update']=function(_0xa44873,_0x493383){if(_0xa44873['body']['id']){delete _0xa44873[_0x3158('0x58')]['id'];}return db['ChatMessage'][_0x3158('0x56')]({'where':{'id':_0xa44873['params']['id']}})[_0x3158('0x20')](handleEntityNotFound(_0x493383,null))['then'](saveUpdates(_0xa44873[_0x3158('0x58')],null))['then'](respondWithResult(_0x493383,null))[_0x3158('0x2a')](handleError(_0x493383,null));};exports[_0x3158('0x37')]=function(_0x2723a9,_0x1de65d){return db[_0x3158('0x51')][_0x3158('0x56')]({'where':{'id':_0x2723a9['params']['id']}})['then'](handleEntityNotFound(_0x1de65d,null))['then'](removeEntity(_0x1de65d,null))['catch'](handleError(_0x1de65d,null));};exports['describe']=function(_0xa808d6,_0x282d2a){return db[_0x3158('0x51')][_0x3158('0x59')]()[_0x3158('0x20')](respondWithResult(_0x282d2a,null))[_0x3158('0x2a')](handleError(_0x282d2a,null));};var interaction_log=require(_0x3158('0x13'))(_0x3158('0x5a'));exports[_0x3158('0x5b')]=function(_0x163d4d,_0x5ee45f,_0x1d9d8a){var _0x2a17d5={'agent':{},'channel':_0x3158('0x5c')};if(_0x163d4d[_0x3158('0x58')]['id']){delete _0x163d4d[_0x3158('0x58')]['id'];}_0x163d4d[_0x3158('0x58')][_0x3158('0x5d')]=!![];_0x163d4d[_0x3158('0x58')][_0x3158('0x5e')]=moment()['format'](_0x3158('0x5f'));_0x163d4d[_0x3158('0x58')][_0x3158('0x60')]=_0x163d4d['body'][_0x3158('0x60')]||_0x163d4d[_0x3158('0x61')]['id'];_0x2a17d5[_0x3158('0x62')]['id']=_0x163d4d[_0x3158('0x58')][_0x3158('0x60')];return db[_0x3158('0x51')]['find']({'where':{'id':_0x163d4d[_0x3158('0x55')]['id'],'UserId':null}})[_0x3158('0x20')](handleEntityNotFound(_0x5ee45f,null))[_0x3158('0x20')](saveUpdates(_0x163d4d[_0x3158('0x58')],null))[_0x3158('0x20')](function(_0x106574){if(_0x106574){_0x2a17d5['message']=_0x106574[_0x3158('0x63')]({'plain':!![]});return db[_0x3158('0x64')][_0x3158('0x56')]({'where':{'id':_0x106574[_0x3158('0x65')]}});}return null;})[_0x3158('0x20')](handleEntityNotFound(_0x5ee45f,null))['then'](function(_0x251394){if(_0x251394){return _0x251394[_0x3158('0x36')]({'UserId':_0x163d4d['body'][_0x3158('0x60')],'read1stAt':_[_0x3158('0x66')](_0x251394['read1stAt'])?moment()[_0x3158('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3158('0x20')](function(_0x3c4198){if(_0x3c4198){_0x2a17d5[_0x3158('0x68')]=_0x3c4198[_0x3158('0x63')]({'plain':!![]});interaction_log['info'](_0x3158('0x69'),_0x163d4d[_0x3158('0x61')]['id'],_0x163d4d[_0x3158('0x61')]['name'],_0x163d4d[_0x3158('0x61')][_0x3158('0x6a')],_0x2a17d5[_0x3158('0x68')]['id'],_0x163d4d[_0x3158('0x58')]?JSON[_0x3158('0x6b')](_0x163d4d[_0x3158('0x58')]):'null');return respondWithRpcPromise(_0x3158('0x6c'),_0x3158('0x6d'),_0x2a17d5);}return null;})[_0x3158('0x20')](function(_0x2bcefb){var _0x56dd87=_0x3158('0x6e')+_0x2bcefb[_0x3158('0x28')]['ContactId'];return db[_0x3158('0x6f')][_0x3158('0x40')](_0x56dd87,{'type':db[_0x3158('0x70')][_0x3158('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x5d9f9f){return _0x5d9f9f;});})['then'](function(_0x25df30){if(_0x25df30){_0x2a17d5[_0x3158('0x28')][_0x3158('0x72')]=_0x25df30[0x0];if(!_0x163d4d[_0x3158('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x163d4d[_0x3158('0x58')][_0x3158('0x60')],'role':_0x3158('0x62')},'attributes':['id','name','fullname',_0x3158('0x73'),'internal'],'raw':!![]});}return null;})[_0x3158('0x20')](function(_0x549ccf){if(!_0x549ccf)return null;_0x2a17d5['message'][_0x3158('0x62')]=_0x549ccf;return _0x2a17d5;})[_0x3158('0x20')](function(_0x366206){if(_0x366206){if(_0x163d4d[_0x3158('0x58')][_0x3158('0x74')]){_0x2a17d5[_0x3158('0x28')][_0x3158('0x75')]=util[_0x3158('0x67')](_0x3158('0x76'),_0x163d4d[_0x3158('0x61')][_0x3158('0x39')]);_0x2a17d5[_0x3158('0x28')][_0x3158('0x77')]=_0x2a17d5[_0x3158('0x77')];_0x2a17d5[_0x3158('0x28')][_0x3158('0x78')]=_0x2a17d5[_0x3158('0x77')];_0x2a17d5[_0x3158('0x28')]['event']=_0x3158('0x5b');return respondWithRpcPromise(_0x3158('0x79'),_0x3158('0x79'),{'event':_0x3158('0x7a'),'message':_[_0x3158('0x4d')](_0x2a17d5[_0x3158('0x28')],JSON['parse'](_0x2a17d5[_0x3158('0x68')]['formData']))},client9002)['then'](function(){return _0x2a17d5;});}return _0x2a17d5;}return null;})[_0x3158('0x20')](respondWithResult(_0x5ee45f,null))[_0x3158('0x2a')](handleError(_0x5ee45f,null));};var interaction_log=require(_0x3158('0x13'))(_0x3158('0x5a'));exports[_0x3158('0x7b')]=function(_0x1abd6b,_0x45211d,_0x1cba8b){var _0x29a322={'agent':{},'channel':_0x3158('0x5c')};if(_0x1abd6b[_0x3158('0x58')]['id']){delete _0x1abd6b['body']['id'];}_0x1abd6b[_0x3158('0x58')][_0x3158('0x60')]=_0x1abd6b[_0x3158('0x58')][_0x3158('0x60')]||_0x1abd6b[_0x3158('0x61')]['id'];_0x29a322[_0x3158('0x62')]['id']=_0x1abd6b[_0x3158('0x58')]['UserId'];return db[_0x3158('0x51')]['find']({'where':{'id':_0x1abd6b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x45211d,null))[_0x3158('0x20')](function(_0x11134d){if(_0x11134d){_0x29a322['message']=_0x11134d['get']({'plain':!![]});return db[_0x3158('0x64')][_0x3158('0x56')]({'where':{'id':_0x11134d[_0x3158('0x65')]}});}return null;})[_0x3158('0x20')](handleEntityNotFound(_0x45211d,null))['then'](function(_0x57f851){if(_0x57f851){_0x29a322[_0x3158('0x68')]=_0x57f851[_0x3158('0x63')]({'plain':!![]});interaction_log[_0x3158('0x21')](_0x3158('0x7c'),_0x1abd6b[_0x3158('0x61')]['id'],_0x1abd6b[_0x3158('0x61')][_0x3158('0x39')],_0x1abd6b['user'][_0x3158('0x6a')],_0x29a322[_0x3158('0x68')]['id'],_0x1abd6b['body']?JSON[_0x3158('0x6b')](_0x1abd6b[_0x3158('0x58')]):_0x3158('0x7d'));return respondWithRpcPromise(_0x3158('0x7e'),_0x3158('0x7f'),_0x29a322);}return null;})[_0x3158('0x20')](function(_0x46bf4f){var _0x8812b3=_0x3158('0x6e')+_0x46bf4f[_0x3158('0x28')][_0x3158('0x80')];return db[_0x3158('0x6f')][_0x3158('0x40')](_0x8812b3,{'type':db[_0x3158('0x70')][_0x3158('0x71')]['SELECT'],'raw':!![]})[_0x3158('0x20')](function(_0xfb0695){return _0xfb0695;});})['then'](function(_0x32c180){if(_0x32c180){_0x29a322['message'][_0x3158('0x72')]=_0x32c180[0x0];if(!_0x1abd6b[_0x3158('0x58')]['UserId'])return;return db[_0x3158('0x81')][_0x3158('0x56')]({'where':{'id':_0x1abd6b[_0x3158('0x58')][_0x3158('0x60')],'role':_0x3158('0x62')},'attributes':['id','name',_0x3158('0x82'),_0x3158('0x73'),_0x3158('0x83')],'raw':!![]});}return null;})[_0x3158('0x20')](function(_0x7a56e){if(!_0x7a56e)return null;_0x29a322[_0x3158('0x28')][_0x3158('0x62')]=_0x7a56e;return _0x29a322;})[_0x3158('0x20')](function(_0x3b6fc2){if(_0x3b6fc2){_0x3b6fc2[_0x3158('0x28')]['interface']=util[_0x3158('0x67')]('SIP/%s',_0x1abd6b[_0x3158('0x61')][_0x3158('0x39')]);_0x3b6fc2[_0x3158('0x28')]['channel']=_0x29a322['channel'];_0x3b6fc2['message'][_0x3158('0x78')]=_0x29a322[_0x3158('0x77')];_0x3b6fc2['message'][_0x3158('0x84')]=_0x3158('0x7b');respondWithRpcPromise('EventManager',_0x3158('0x79'),{'event':_0x3158('0x85'),'message':_[_0x3158('0x4d')](_0x29a322[_0x3158('0x28')],JSON[_0x3158('0x86')](_0x29a322[_0x3158('0x68')]['formData']))},client9002);return _0x29a322;}return null;})[_0x3158('0x20')](respondWithResult(_0x45211d,null))[_0x3158('0x2a')](handleError(_0x45211d,null));}; \ No newline at end of file +var _0x545c=['name','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','fields','length','find','body','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','ChatInteractionId','RejectMessage','rejectMessage','QueryTypes','format','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','undefined','limit','count','offset','set','apply','update','then','destroy','sendStatus','stack'];(function(_0x3de497,_0xe7b89c){var _0xe24328=function(_0x2a3bc9){while(--_0x2a3bc9){_0x3de497['push'](_0x3de497['shift']());}};_0xe24328(++_0xe7b89c);}(_0x545c,0x1c0));var _0xc545=function(_0x2e78e9,_0x42957c){_0x2e78e9=_0x2e78e9-0x0;var _0x35aad4=_0x545c[_0x2e78e9];return _0x35aad4;};'use strict';var emlformat=require(_0xc545('0x0'));var rimraf=require(_0xc545('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc545('0x2'));var rp=require('request-promise');var moment=require(_0xc545('0x3'));var BPromise=require(_0xc545('0x4'));var Mustache=require(_0xc545('0x5'));var util=require(_0xc545('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc545('0x7'));var fs=require('fs');var fs_extra=require(_0xc545('0x8'));var _=require(_0xc545('0x9'));var squel=require(_0xc545('0xa'));var crypto=require(_0xc545('0xb'));var jsforce=require(_0xc545('0xc'));var deskjs=require(_0xc545('0xd'));var toCsv=require(_0xc545('0xe'));var querystring=require(_0xc545('0xf'));var Papa=require('papaparse');var Redis=require(_0xc545('0x10'));var authService=require(_0xc545('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc545('0x12'));var logger=require(_0xc545('0x13'))('api');var utils=require(_0xc545('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc545('0x15'))['db'];config[_0xc545('0x16')]=_[_0xc545('0x17')](config[_0xc545('0x16')],{'host':_0xc545('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc545('0x19'))['register'](socket);var jayson=require(_0xc545('0x1a'));var client=jayson[_0xc545('0x1b')][_0xc545('0x1c')]({'port':0x232c});var client9002=jayson[_0xc545('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16f045,_0x97bc58,_0x522a39,_0x5652c1){return new BPromise(function(_0x5828fb,_0x26aab5){var _0x34f6cd=_0x5652c1||client;return _0x34f6cd[_0xc545('0x1d')](_0x16f045,_0x522a39)['then'](function(_0x3c9581){logger[_0xc545('0x1e')](_0xc545('0x1f'),_0x97bc58,_0xc545('0x20'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x97bc58,_0xc545('0x20'),JSON[_0xc545('0x21')](_0x3c9581));if(_0x3c9581[_0xc545('0x22')]){if(_0x3c9581[_0xc545('0x22')][_0xc545('0x23')]===0x1f4){logger['error'](_0xc545('0x1f'),_0x97bc58,_0x3c9581[_0xc545('0x22')][_0xc545('0x24')]);return _0x26aab5(_0x3c9581[_0xc545('0x22')]['message']);}logger[_0xc545('0x22')](_0xc545('0x1f'),_0x97bc58,_0x3c9581[_0xc545('0x22')][_0xc545('0x24')]);return _0x5828fb(_0x3c9581['error'][_0xc545('0x24')]);}else{logger['info'](_0xc545('0x1f'),_0x97bc58,_0xc545('0x20'));_0x5828fb(_0x3c9581['result'][_0xc545('0x24')]);}})[_0xc545('0x25')](function(_0xe31616){logger[_0xc545('0x22')](_0xc545('0x1f'),_0x97bc58,_0xe31616);_0x26aab5(_0xe31616);});});}function respondWithStatusCode(_0x43abd0,_0x188074){_0x188074=_0x188074||0xcc;return function(_0x2d2eed){if(_0x2d2eed){return _0x43abd0['sendStatus'](_0x188074);}return _0x43abd0[_0xc545('0x26')](_0x188074)[_0xc545('0x27')]();};}function respondWithResult(_0x456a9f,_0x5582ad){_0x5582ad=_0x5582ad||0xc8;return function(_0x439493){if(_0x439493){return _0x456a9f[_0xc545('0x26')](_0x5582ad)[_0xc545('0x28')](_0x439493);}};}function respondWithFilteredResult(_0x504ffb,_0x2cef35){return function(_0x1c7c96){if(_0x1c7c96){var _0x1b66e9=typeof _0x2cef35['offset']===_0xc545('0x29')&&typeof _0x2cef35[_0xc545('0x2a')]==='undefined';var _0xebe122=_0x1c7c96[_0xc545('0x2b')];var _0x59045a=_0x1b66e9?0x0:_0x2cef35[_0xc545('0x2c')];var _0xde0229=_0x1b66e9?_0x1c7c96[_0xc545('0x2b')]:_0x2cef35[_0xc545('0x2c')]+_0x2cef35['limit'];var _0x4b6b29;if(_0xde0229>=_0xebe122){_0xde0229=_0xebe122;_0x4b6b29=0xc8;}else{_0x4b6b29=0xce;}_0x504ffb[_0xc545('0x26')](_0x4b6b29);return _0x504ffb[_0xc545('0x2d')]('Content-Range',_0x59045a+'-'+_0xde0229+'/'+_0xebe122)[_0xc545('0x28')](_0x1c7c96);}return null;};}function patchUpdates(_0x15774b){return function(_0x4f1ad6){try{jsonpatch[_0xc545('0x2e')](_0x4f1ad6,_0x15774b,!![]);}catch(_0xed60a1){return BPromise['reject'](_0xed60a1);}return _0x4f1ad6['save']();};}function saveUpdates(_0x40ea6e,_0x1ebb65){return function(_0x5cc22c){if(_0x5cc22c){return _0x5cc22c[_0xc545('0x2f')](_0x40ea6e)[_0xc545('0x30')](function(_0x3877d7){return _0x3877d7;});}return null;};}function removeEntity(_0x41545b,_0x384581){return function(_0x374750){if(_0x374750){return _0x374750[_0xc545('0x31')]()['then'](function(){_0x41545b[_0xc545('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fc877,_0x5caecd){return function(_0x1b0720){if(!_0x1b0720){_0x1fc877[_0xc545('0x32')](0x194);}return _0x1b0720;};}function handleError(_0x13a30b,_0x2d2c69){_0x2d2c69=_0x2d2c69||0x1f4;return function(_0x4f351f){logger[_0xc545('0x22')](_0x4f351f[_0xc545('0x33')]);if(_0x4f351f[_0xc545('0x34')]){delete _0x4f351f[_0xc545('0x34')];}_0x13a30b[_0xc545('0x26')](_0x2d2c69)['send'](_0x4f351f);};}exports[_0xc545('0x35')]=function(_0x197255,_0x305a2b){var _0x44119a={},_0x4491f8={},_0x42cd52={'count':0x0,'rows':[]};var _0x2c2ff2=_[_0xc545('0x36')](db[_0xc545('0x37')][_0xc545('0x38')],function(_0x318d69){return{'name':_0x318d69[_0xc545('0x39')],'type':_0x318d69[_0xc545('0x3a')]['key']};});_0x4491f8[_0xc545('0x3b')]=_[_0xc545('0x36')](_0x2c2ff2,_0xc545('0x34'));_0x4491f8[_0xc545('0x3c')]=_[_0xc545('0x3d')](_0x197255[_0xc545('0x3c')]);_0x4491f8[_0xc545('0x3e')]=_[_0xc545('0x3f')](_0x4491f8[_0xc545('0x3b')],_0x4491f8['query']);_0x44119a[_0xc545('0x40')]=_[_0xc545('0x3f')](_0x4491f8[_0xc545('0x3b')],qs['fields'](_0x197255[_0xc545('0x3c')]['fields']));_0x44119a[_0xc545('0x40')]=_0x44119a[_0xc545('0x40')]['length']?_0x44119a['attributes']:_0x4491f8[_0xc545('0x3b')];if(!_0x197255[_0xc545('0x3c')][_0xc545('0x41')](_0xc545('0x42'))){_0x44119a[_0xc545('0x2a')]=qs[_0xc545('0x2a')](_0x197255[_0xc545('0x3c')][_0xc545('0x2a')]);_0x44119a[_0xc545('0x2c')]=qs['offset'](_0x197255[_0xc545('0x3c')]['offset']);}_0x44119a[_0xc545('0x43')]=qs[_0xc545('0x44')](_0x197255[_0xc545('0x3c')][_0xc545('0x44')]);_0x44119a['where']=qs['filters'](_['pick'](_0x197255['query'],_0x4491f8[_0xc545('0x3e')]),_0x2c2ff2);if(_0x197255[_0xc545('0x3c')][_0xc545('0x45')]){_0x44119a[_0xc545('0x46')]=_[_0xc545('0x47')](_0x44119a[_0xc545('0x46')],{'$or':_[_0xc545('0x36')](_0x2c2ff2,function(_0x15e97a){if(_0x15e97a[_0xc545('0x3a')]!==_0xc545('0x48')){var _0x2aedf3={};_0x2aedf3[_0x15e97a['name']]={'$like':'%'+_0x197255[_0xc545('0x3c')][_0xc545('0x45')]+'%'};return _0x2aedf3;}})});}_0x44119a=_[_0xc545('0x47')]({},_0x44119a,_0x197255[_0xc545('0x49')]);var _0x78308d={'where':_0x44119a['where']};return db[_0xc545('0x37')][_0xc545('0x2b')](_0x78308d)[_0xc545('0x30')](function(_0x4ed7a1){_0x42cd52[_0xc545('0x2b')]=_0x4ed7a1;if(_0x197255[_0xc545('0x3c')][_0xc545('0x4a')]){_0x44119a[_0xc545('0x4b')]=[{'all':!![]}];}return db[_0xc545('0x37')]['findAll'](_0x44119a);})['then'](function(_0x25a15c){_0x42cd52[_0xc545('0x4c')]=_0x25a15c;return _0x42cd52;})[_0xc545('0x30')](respondWithFilteredResult(_0x305a2b,_0x44119a))['catch'](handleError(_0x305a2b,null));};exports['show']=function(_0x1e3adb,_0xe68f88){var _0x37be5d={'raw':!![],'where':{'id':_0x1e3adb[_0xc545('0x4d')]['id']}},_0x16bd0a={};_0x16bd0a[_0xc545('0x3b')]=_[_0xc545('0x3d')](db[_0xc545('0x37')][_0xc545('0x38')]);_0x16bd0a[_0xc545('0x3c')]=_[_0xc545('0x3d')](_0x1e3adb[_0xc545('0x3c')]);_0x16bd0a['filters']=_['intersection'](_0x16bd0a[_0xc545('0x3b')],_0x16bd0a[_0xc545('0x3c')]);_0x37be5d['attributes']=_[_0xc545('0x3f')](_0x16bd0a['model'],qs[_0xc545('0x4e')](_0x1e3adb[_0xc545('0x3c')]['fields']));_0x37be5d[_0xc545('0x40')]=_0x37be5d['attributes'][_0xc545('0x4f')]?_0x37be5d[_0xc545('0x40')]:_0x16bd0a[_0xc545('0x3b')];if(_0x1e3adb[_0xc545('0x3c')][_0xc545('0x4a')]){_0x37be5d['include']=[{'all':!![]}];}_0x37be5d=_[_0xc545('0x47')]({},_0x37be5d,_0x1e3adb['options']);return db[_0xc545('0x37')][_0xc545('0x50')](_0x37be5d)[_0xc545('0x30')](handleEntityNotFound(_0xe68f88,null))[_0xc545('0x30')](respondWithResult(_0xe68f88,null))[_0xc545('0x25')](handleError(_0xe68f88,null));};exports['create']=function(_0x1c3979,_0x208217){return db[_0xc545('0x37')]['create'](_0x1c3979[_0xc545('0x51')],{})['then'](respondWithResult(_0x208217,0xc9))[_0xc545('0x25')](handleError(_0x208217,null));};exports[_0xc545('0x2f')]=function(_0x4de42f,_0x39b2ef){if(_0x4de42f['body']['id']){delete _0x4de42f[_0xc545('0x51')]['id'];}return db[_0xc545('0x37')][_0xc545('0x50')]({'where':{'id':_0x4de42f[_0xc545('0x4d')]['id']}})['then'](handleEntityNotFound(_0x39b2ef,null))[_0xc545('0x30')](saveUpdates(_0x4de42f[_0xc545('0x51')],null))['then'](respondWithResult(_0x39b2ef,null))['catch'](handleError(_0x39b2ef,null));};exports[_0xc545('0x31')]=function(_0xc3ed67,_0x410908){return db[_0xc545('0x37')]['find']({'where':{'id':_0xc3ed67[_0xc545('0x4d')]['id']}})[_0xc545('0x30')](handleEntityNotFound(_0x410908,null))[_0xc545('0x30')](removeEntity(_0x410908,null))[_0xc545('0x25')](handleError(_0x410908,null));};exports[_0xc545('0x52')]=function(_0x463e60,_0x4d64b9){return db[_0xc545('0x37')][_0xc545('0x52')]()[_0xc545('0x30')](respondWithResult(_0x4d64b9,null))[_0xc545('0x25')](handleError(_0x4d64b9,null));};var interaction_log=require(_0xc545('0x13'))(_0xc545('0x53'));exports[_0xc545('0x54')]=function(_0x272d7f,_0x3a6cf7,_0x28efc0){var _0xd3d92a={'agent':{},'channel':_0xc545('0x55')};if(_0x272d7f[_0xc545('0x51')]['id']){delete _0x272d7f[_0xc545('0x51')]['id'];}_0x272d7f[_0xc545('0x51')][_0xc545('0x56')]=!![];_0x272d7f[_0xc545('0x51')]['readAt']=moment()['format'](_0xc545('0x57'));_0x272d7f[_0xc545('0x51')][_0xc545('0x58')]=_0x272d7f[_0xc545('0x51')]['UserId']||_0x272d7f[_0xc545('0x59')]['id'];_0xd3d92a[_0xc545('0x5a')]['id']=_0x272d7f[_0xc545('0x51')][_0xc545('0x58')];return db['ChatMessage'][_0xc545('0x50')]({'where':{'id':_0x272d7f[_0xc545('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a6cf7,null))[_0xc545('0x30')](saveUpdates(_0x272d7f['body'],null))[_0xc545('0x30')](function(_0x4db2cd){if(_0x4db2cd){_0xd3d92a[_0xc545('0x24')]=_0x4db2cd[_0xc545('0x5b')]({'plain':!![]});return db[_0xc545('0x5c')][_0xc545('0x50')]({'where':{'id':_0x4db2cd['ChatInteractionId']}});}return null;})[_0xc545('0x30')](handleEntityNotFound(_0x3a6cf7,null))[_0xc545('0x30')](function(_0x4c057f){if(_0x4c057f){return _0x4c057f['update']({'UserId':_0x272d7f[_0xc545('0x51')][_0xc545('0x58')],'read1stAt':_['isNil'](_0x4c057f['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc545('0x30')](function(_0x9366a9){if(_0x9366a9){_0xd3d92a[_0xc545('0x5d')]=_0x9366a9[_0xc545('0x5b')]({'plain':!![]});interaction_log[_0xc545('0x1e')](_0xc545('0x5e'),_0x272d7f[_0xc545('0x59')]['id'],_0x272d7f['user'][_0xc545('0x34')],_0x272d7f[_0xc545('0x59')][_0xc545('0x5f')],_0xd3d92a['interaction']['id'],_0x272d7f['body']?JSON[_0xc545('0x21')](_0x272d7f[_0xc545('0x51')]):_0xc545('0x60'));return respondWithRpcPromise(_0xc545('0x61'),_0xc545('0x62'),_0xd3d92a);}return null;})[_0xc545('0x30')](function(_0x203249){var _0x37f9e2=_0xc545('0x63')+_0x203249[_0xc545('0x24')][_0xc545('0x64')];return db[_0xc545('0x65')][_0xc545('0x3c')](_0x37f9e2,{'type':db[_0xc545('0x66')]['QueryTypes'][_0xc545('0x67')],'raw':!![]})['then'](function(_0x22037b){return _0x22037b;});})[_0xc545('0x30')](function(_0x22c04f){if(_0x22c04f){_0xd3d92a[_0xc545('0x24')][_0xc545('0x68')]=_0x22c04f[0x0];if(!_0x272d7f[_0xc545('0x51')][_0xc545('0x58')])return;return db[_0xc545('0x69')]['find']({'where':{'id':_0x272d7f[_0xc545('0x51')][_0xc545('0x58')],'role':_0xc545('0x5a')},'attributes':['id','name',_0xc545('0x6a'),_0xc545('0x6b'),_0xc545('0x6c')],'raw':!![]});}return null;})[_0xc545('0x30')](function(_0xe0764d){if(!_0xe0764d)return null;_0xd3d92a['message']['agent']=_0xe0764d;return _0xd3d92a;})[_0xc545('0x30')](function(_0x77f329){if(_0x77f329){if(_0x272d7f['body'][_0xc545('0x6d')]){_0xd3d92a[_0xc545('0x24')][_0xc545('0x6e')]=util['format'](_0xc545('0x6f'),_0x272d7f['user']['name']);_0xd3d92a[_0xc545('0x24')][_0xc545('0x70')]=_0xd3d92a[_0xc545('0x70')];_0xd3d92a[_0xc545('0x24')][_0xc545('0x71')]=_0xd3d92a['channel'];_0xd3d92a[_0xc545('0x24')][_0xc545('0x72')]=_0xc545('0x54');return respondWithRpcPromise(_0xc545('0x73'),_0xc545('0x73'),{'event':_0xc545('0x74'),'message':_[_0xc545('0x47')](_0xd3d92a[_0xc545('0x24')],JSON[_0xc545('0x75')](_0xd3d92a['interaction'][_0xc545('0x76')]))},client9002)[_0xc545('0x30')](function(){return _0xd3d92a;});}return _0xd3d92a;}return null;})[_0xc545('0x30')](respondWithResult(_0x3a6cf7,null))[_0xc545('0x25')](handleError(_0x3a6cf7,null));};var interaction_log=require(_0xc545('0x13'))(_0xc545('0x53'));exports[_0xc545('0x77')]=function(_0x14d438,_0x363a53,_0x6234ba){var _0x23b720={'agent':{},'channel':_0xc545('0x55')};if(_0x14d438[_0xc545('0x51')]['id']){delete _0x14d438[_0xc545('0x51')]['id'];}_0x14d438[_0xc545('0x51')]['UserId']=_0x14d438['body']['UserId']||_0x14d438[_0xc545('0x59')]['id'];_0x23b720[_0xc545('0x5a')]['id']=_0x14d438[_0xc545('0x51')][_0xc545('0x58')];return db[_0xc545('0x37')][_0xc545('0x50')]({'where':{'id':_0x14d438[_0xc545('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x363a53,null))[_0xc545('0x30')](function(_0x246041){if(_0x246041){_0x23b720[_0xc545('0x24')]=_0x246041[_0xc545('0x5b')]({'plain':!![]});return db[_0xc545('0x5c')][_0xc545('0x50')]({'where':{'id':_0x246041[_0xc545('0x78')]}});}return null;})['then'](handleEntityNotFound(_0x363a53,null))[_0xc545('0x30')](function(_0x24e659){if(_0x24e659){_0x23b720[_0xc545('0x5d')]=_0x24e659[_0xc545('0x5b')]({'plain':!![]});interaction_log[_0xc545('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x14d438[_0xc545('0x59')]['id'],_0x14d438[_0xc545('0x59')][_0xc545('0x34')],_0x14d438['user'][_0xc545('0x5f')],_0x23b720[_0xc545('0x5d')]['id'],_0x14d438[_0xc545('0x51')]?JSON['stringify'](_0x14d438[_0xc545('0x51')]):'null');return respondWithRpcPromise(_0xc545('0x79'),_0xc545('0x7a'),_0x23b720);}return null;})['then'](function(_0xafd398){var _0x599c06='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xafd398[_0xc545('0x24')][_0xc545('0x64')];return db['sequelize'][_0xc545('0x3c')](_0x599c06,{'type':db['Sequelize'][_0xc545('0x7b')]['SELECT'],'raw':!![]})[_0xc545('0x30')](function(_0x2971a8){return _0x2971a8;});})['then'](function(_0x4351f0){if(_0x4351f0){_0x23b720[_0xc545('0x24')]['contact']=_0x4351f0[0x0];if(!_0x14d438['body'][_0xc545('0x58')])return;return db[_0xc545('0x69')][_0xc545('0x50')]({'where':{'id':_0x14d438['body']['UserId'],'role':_0xc545('0x5a')},'attributes':['id','name',_0xc545('0x6a'),_0xc545('0x6b'),_0xc545('0x6c')],'raw':!![]});}return null;})[_0xc545('0x30')](function(_0x484839){if(!_0x484839)return null;_0x23b720[_0xc545('0x24')]['agent']=_0x484839;return _0x23b720;})['then'](function(_0x4efb91){if(_0x4efb91){_0x4efb91[_0xc545('0x24')][_0xc545('0x6e')]=util[_0xc545('0x7c')](_0xc545('0x6f'),_0x14d438[_0xc545('0x59')][_0xc545('0x34')]);_0x4efb91[_0xc545('0x24')][_0xc545('0x70')]=_0x23b720[_0xc545('0x70')];_0x4efb91[_0xc545('0x24')][_0xc545('0x71')]=_0x23b720[_0xc545('0x70')];_0x4efb91[_0xc545('0x24')]['event']=_0xc545('0x77');respondWithRpcPromise('EventManager',_0xc545('0x73'),{'event':'rejectmessage','message':_[_0xc545('0x47')](_0x23b720[_0xc545('0x24')],JSON[_0xc545('0x75')](_0x23b720[_0xc545('0x5d')][_0xc545('0x76')]))},client9002);return _0x23b720;}return null;})['then'](respondWithResult(_0x363a53,null))['catch'](handleError(_0x363a53,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 94144d4..7a2a6f0 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 _0x4de3=['remove','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x50579e,_0x418d31){var _0x567618=function(_0x9dc1ca){while(--_0x9dc1ca){_0x50579e['push'](_0x50579e['shift']());}};_0x567618(++_0x418d31);}(_0x4de3,0x1d0));var _0x34de=function(_0x3ba338,_0xeef784){_0x3ba338=_0x3ba338-0x0;var _0xf3b7ec=_0x4de3[_0x3ba338];return _0xf3b7ec;};'use strict';var EventEmitter=require(_0x34de('0x0'));var ChatMessage=require(_0x34de('0x1'))['db'][_0x34de('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x34de('0x3')](0x0);var events={'afterCreate':_0x34de('0x4'),'afterUpdate':_0x34de('0x5'),'afterDestroy':_0x34de('0x6')};function emitEvent(_0x2e2299){return function(_0xb32b2f,_0xfa734d,_0x5eeaee){ChatMessageEvents[_0x34de('0x7')](_0x2e2299+':'+_0xb32b2f['id'],_0xb32b2f);ChatMessageEvents[_0x34de('0x7')](_0x2e2299,_0xb32b2f);_0x5eeaee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x34de('0x8')](e,emitEvent(event));}}module[_0x34de('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0xc8c3=['update','remove','emit','hasOwnProperty','exports','events','ChatMessage','setMaxListeners','save'];(function(_0x2cbe6d,_0x526a5f){var _0x4c9c87=function(_0x17cdc1){while(--_0x17cdc1){_0x2cbe6d['push'](_0x2cbe6d['shift']());}};_0x4c9c87(++_0x526a5f);}(_0xc8c3,0x1f4));var _0x3c8c=function(_0x8b631b,_0x386724){_0x8b631b=_0x8b631b-0x0;var _0x3e6832=_0xc8c3[_0x8b631b];return _0x3e6832;};'use strict';var EventEmitter=require(_0x3c8c('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x3c8c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3c8c('0x2')](0x0);var events={'afterCreate':_0x3c8c('0x3'),'afterUpdate':_0x3c8c('0x4'),'afterDestroy':_0x3c8c('0x5')};function emitEvent(_0x20f075){return function(_0x2ab59f,_0x4a7d4a,_0x2f0d40){ChatMessageEvents['emit'](_0x20f075+':'+_0x2ab59f['id'],_0x2ab59f);ChatMessageEvents[_0x3c8c('0x6')](_0x20f075,_0x2ab59f);_0x2f0d40(null);};}for(var e in events){if(events[_0x3c8c('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x3c8c('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index b308ae7..a94a752 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 _0x9ac5=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','toLowerCase','direction','secret','isNil','findOne','ChatInteractionId','then','update'];(function(_0x45e224,_0x46be44){var _0x5d7c1a=function(_0x3f2aa7){while(--_0x3f2aa7){_0x45e224['push'](_0x45e224['shift']());}};_0x5d7c1a(++_0x46be44);}(_0x9ac5,0xdd));var _0x59ac=function(_0x473260,_0x1f8cbb){_0x473260=_0x473260-0x0;var _0x1e4f8e=_0x9ac5[_0x473260];return _0x1e4f8e;};'use strict';var _=require(_0x59ac('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x59ac('0x1'));var moment=require(_0x59ac('0x2'));var BPromise=require('bluebird');var rp=require(_0x59ac('0x3'));var fs=require('fs');var path=require(_0x59ac('0x4'));var rimraf=require(_0x59ac('0x5'));var config=require(_0x59ac('0x6'));var attributes=require(_0x59ac('0x7'));module['exports']=function(_0x5ddf93,_0x54dc93){return _0x5ddf93[_0x59ac('0x8')](_0x59ac('0x9'),attributes,{'tableName':_0x59ac('0xa'),'paranoid':![],'indexes':[{'name':_0x59ac('0xb'),'fields':[_0x59ac('0xc')],'type':_0x59ac('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5751c5,_0x89f343,_0x3df8da){var _0x59fca4=_0x5ddf93['models'];var _0x18c033=_0x5751c5['get']({'plain':!![]});if(_0x18c033['direction'][_0x59ac('0xe')]()==='in'||_0x18c033[_0x59ac('0xf')][_0x59ac('0xe')]()==='out'&&!_0x18c033[_0x59ac('0x10')]&&!_[_0x59ac('0x11')](_0x18c033['UserId'])){_0x59fca4['ChatInteraction'][_0x59ac('0x12')]({'where':{'id':_0x18c033[_0x59ac('0x13')]}})[_0x59ac('0x14')](function(_0x53b70a){if(_0x53b70a){_0x53b70a[_0x59ac('0x15')]({'lastMsgAt':_0x18c033[_0x59ac('0x16')],'lastMsgDirection':_0x18c033[_0x59ac('0xf')][_0x59ac('0xe')]()});}})[_0x59ac('0x17')](function(_0x1af180){console[_0x59ac('0x18')](_0x1af180);});}_0x3df8da();}},'charset':_0x59ac('0x19'),'collate':_0x59ac('0x1a')});}; \ No newline at end of file +var _0xe623=['body','FULLTEXT','direction','out','secret','UserId','findOne','ChatInteractionId','then','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','../../config/environment','./chatMessage.attributes','exports','fti_chat_messages'];(function(_0x35653e,_0x49e23c){var _0x169ed8=function(_0x3b46a0){while(--_0x3b46a0){_0x35653e['push'](_0x35653e['shift']());}};_0x169ed8(++_0x49e23c);}(_0xe623,0x10a));var _0x3e62=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xe623[_0x474bc0];return _0x4b24cf;};'use strict';var _=require('lodash');var util=require(_0x3e62('0x0'));var logger=require(_0x3e62('0x1'))(_0x3e62('0x2'));var moment=require(_0x3e62('0x3'));var BPromise=require('bluebird');var rp=require(_0x3e62('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e62('0x5'));var attributes=require(_0x3e62('0x6'));module[_0x3e62('0x7')]=function(_0x23c216,_0x55b10b){return _0x23c216['define']('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x3e62('0x8'),'fields':[_0x3e62('0x9')],'type':_0x3e62('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41c2c1,_0x46e16a,_0x1f9e3b){var _0x312c86=_0x23c216['models'];var _0x4d25c9=_0x41c2c1['get']({'plain':!![]});if(_0x4d25c9[_0x3e62('0xb')]['toLowerCase']()==='in'||_0x4d25c9[_0x3e62('0xb')]['toLowerCase']()===_0x3e62('0xc')&&!_0x4d25c9[_0x3e62('0xd')]&&!_['isNil'](_0x4d25c9[_0x3e62('0xe')])){_0x312c86['ChatInteraction'][_0x3e62('0xf')]({'where':{'id':_0x4d25c9[_0x3e62('0x10')]}})[_0x3e62('0x11')](function(_0x350e39){if(_0x350e39){_0x350e39[_0x3e62('0x12')]({'lastMsgAt':_0x4d25c9[_0x3e62('0x13')],'lastMsgDirection':_0x4d25c9[_0x3e62('0xb')][_0x3e62('0x14')]()});}})[_0x3e62('0x15')](function(_0x553028){console[_0x3e62('0x16')](_0x553028);});}_0x1f9e3b();}},'charset':_0x3e62('0x17'),'collate':_0x3e62('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e364ebb..00d0842 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 _0x2f66=['../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','ChatMessage','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f66,0x1ea));var _0x62f6=function(_0x44d9e8,_0x2f0bc2){_0x44d9e8=_0x44d9e8-0x0;var _0x64816e=_0x2f66[_0x44d9e8];return _0x64816e;};'use strict';var _=require(_0x62f6('0x0'));var util=require(_0x62f6('0x1'));var moment=require(_0x62f6('0x2'));var BPromise=require(_0x62f6('0x3'));var rs=require(_0x62f6('0x4'));var fs=require('fs');var Redis=require(_0x62f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x62f6('0x6'));var logger=require('../../config/logger')(_0x62f6('0x7'));var config=require(_0x62f6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x62f6('0x9')][_0x62f6('0xa')]({'port':0x232a});config[_0x62f6('0xb')]=_[_0x62f6('0xc')](config[_0x62f6('0xb')],{'host':_0x62f6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x135d80,_0x4fda36,_0x23e57c){return new BPromise(function(_0x1181b2,_0x37fbb5){return client[_0x62f6('0xe')](_0x135d80,_0x23e57c)[_0x62f6('0xf')](function(_0x563d0e){logger[_0x62f6('0x10')](_0x62f6('0x11'),_0x4fda36,_0x62f6('0x12'));logger[_0x62f6('0x13')](_0x62f6('0x14'),_0x4fda36,_0x62f6('0x12'),JSON[_0x62f6('0x15')](_0x563d0e));if(_0x563d0e['error']){if(_0x563d0e[_0x62f6('0x16')][_0x62f6('0x17')]===0x1f4){logger[_0x62f6('0x16')](_0x62f6('0x11'),_0x4fda36,_0x563d0e['error'][_0x62f6('0x18')]);return _0x37fbb5(_0x563d0e[_0x62f6('0x16')][_0x62f6('0x18')]);}logger['error'](_0x62f6('0x11'),_0x4fda36,_0x563d0e['error'][_0x62f6('0x18')]);return _0x1181b2(_0x563d0e[_0x62f6('0x16')][_0x62f6('0x18')]);}else{logger[_0x62f6('0x10')](_0x62f6('0x11'),_0x4fda36,_0x62f6('0x12'));_0x1181b2(_0x563d0e[_0x62f6('0x19')][_0x62f6('0x18')]);}})['catch'](function(_0x355575){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4fda36,_0x355575);_0x37fbb5(_0x355575);});});}exports[_0x62f6('0x1a')]=function(_0x275e8d){var _0x30fa8b=this;return new Promise(function(_0x89dd9e,_0x38bff2){return db[_0x62f6('0x1b')]['create'](_0x275e8d['body'],{'raw':_0x275e8d[_0x62f6('0x1c')]?_0x275e8d['options'][_0x62f6('0x1d')]===undefined?!![]:![]:!![]})[_0x62f6('0xf')](function(_0x20d784){logger[_0x62f6('0x10')](_0x62f6('0x1a'),_0x275e8d);logger['debug']('CreateChatMessage',_0x275e8d,JSON[_0x62f6('0x15')](_0x20d784));_0x89dd9e(_0x20d784);})[_0x62f6('0x1e')](function(_0x2369e7){logger['error']('CreateChatMessage',_0x2369e7[_0x62f6('0x18')],_0x275e8d);_0x38bff2(_0x30fa8b['error'](0x1f4,_0x2369e7['message']));});});}; \ No newline at end of file +var _0x19b5=['ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2dc520,_0x562e06){var _0x4e3c28=function(_0x1610d7){while(--_0x1610d7){_0x2dc520['push'](_0x2dc520['shift']());}};_0x4e3c28(++_0x562e06);}(_0x19b5,0x1b7));var _0x519b=function(_0x4c8221,_0x323847){_0x4c8221=_0x4c8221-0x0;var _0x5aeff1=_0x19b5[_0x4c8221];return _0x5aeff1;};'use strict';var _=require(_0x519b('0x0'));var util=require(_0x519b('0x1'));var moment=require(_0x519b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x519b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x519b('0x4'));var logger=require(_0x519b('0x5'))(_0x519b('0x6'));var config=require(_0x519b('0x7'));var jayson=require(_0x519b('0x8'));var client=jayson[_0x519b('0x9')][_0x519b('0xa')]({'port':0x232a});config['redis']=_[_0x519b('0xb')](config[_0x519b('0xc')],{'host':_0x519b('0xd'),'port':0x18eb});var socket=require(_0x519b('0xe'))(new Redis(config['redis']));require(_0x519b('0xf'))['register'](socket);function respondWithRpcPromise(_0x206f16,_0x265396,_0x5a64db){return new BPromise(function(_0x9c621c,_0x3d929d){return client['request'](_0x206f16,_0x5a64db)[_0x519b('0x10')](function(_0x39902c){logger[_0x519b('0x11')]('ChatMessage,\x20%s,\x20%s',_0x265396,_0x519b('0x12'));logger[_0x519b('0x13')](_0x519b('0x14'),_0x265396,_0x519b('0x12'),JSON['stringify'](_0x39902c));if(_0x39902c[_0x519b('0x15')]){if(_0x39902c[_0x519b('0x15')][_0x519b('0x16')]===0x1f4){logger[_0x519b('0x15')](_0x519b('0x17'),_0x265396,_0x39902c[_0x519b('0x15')][_0x519b('0x18')]);return _0x3d929d(_0x39902c['error'][_0x519b('0x18')]);}logger['error'](_0x519b('0x17'),_0x265396,_0x39902c[_0x519b('0x15')][_0x519b('0x18')]);return _0x9c621c(_0x39902c['error']['message']);}else{logger[_0x519b('0x11')](_0x519b('0x17'),_0x265396,_0x519b('0x12'));_0x9c621c(_0x39902c[_0x519b('0x19')][_0x519b('0x18')]);}})[_0x519b('0x1a')](function(_0x32b57a){logger['error'](_0x519b('0x17'),_0x265396,_0x32b57a);_0x3d929d(_0x32b57a);});});}exports[_0x519b('0x1b')]=function(_0x5eac1d){var _0x3fc242=this;return new Promise(function(_0x4fec03,_0x2bfc46){return db[_0x519b('0x1c')][_0x519b('0x1d')](_0x5eac1d[_0x519b('0x1e')],{'raw':_0x5eac1d[_0x519b('0x1f')]?_0x5eac1d['options'][_0x519b('0x20')]===undefined?!![]:![]:!![]})[_0x519b('0x10')](function(_0x41f9b2){logger[_0x519b('0x11')](_0x519b('0x1b'),_0x5eac1d);logger['debug'](_0x519b('0x1b'),_0x5eac1d,JSON['stringify'](_0x41f9b2));_0x4fec03(_0x41f9b2);})[_0x519b('0x1a')](function(_0x9f6bfa){logger[_0x519b('0x15')](_0x519b('0x1b'),_0x9f6bfa['message'],_0x5eac1d);_0x2bfc46(_0x3fc242['error'](0x1f4,_0x9f6bfa[_0x519b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 4a8c54f..a17ff6b 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 _0xc474=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','emit'];(function(_0x248011,_0x360f48){var _0x33eaa7=function(_0x17b801){while(--_0x17b801){_0x248011['push'](_0x248011['shift']());}};_0x33eaa7(++_0x360f48);}(_0xc474,0xfc));var _0x4c47=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc474[_0x413feb];return _0x40ee88;};'use strict';var ChatMessageEvents=require(_0x4c47('0x0'));var events=[_0x4c47('0x1'),_0x4c47('0x2'),'update'];function createListener(_0x29e5bf,_0x15bc09){return function(_0x1703cd){_0x15bc09[_0x4c47('0x3')](_0x29e5bf,_0x1703cd);};}function removeListener(_0x2b2443,_0x40b979){return function(){ChatMessageEvents[_0x4c47('0x4')](_0x2b2443,_0x40b979);};}exports[_0x4c47('0x5')]=function(_0x58db78){for(var _0x5aaf0e=0x0,_0x6aeef8=events[_0x4c47('0x6')];_0x5aaf0e<_0x6aeef8;_0x5aaf0e++){var _0x275a64=events[_0x5aaf0e];var _0x35a093=createListener(_0x4c47('0x7')+_0x275a64,_0x58db78);ChatMessageEvents['on'](_0x275a64,_0x35a093);}}; \ No newline at end of file +var _0x37c5=['remove','update','emit','removeListener','chatMessage:','save'];(function(_0xd5100c,_0x3be25b){var _0x50589e=function(_0x138318){while(--_0x138318){_0xd5100c['push'](_0xd5100c['shift']());}};_0x50589e(++_0x3be25b);}(_0x37c5,0xa7));var _0x537c=function(_0x80ed8b,_0x31e626){_0x80ed8b=_0x80ed8b-0x0;var _0x5c4d63=_0x37c5[_0x80ed8b];return _0x5c4d63;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x537c('0x0'),_0x537c('0x1'),_0x537c('0x2')];function createListener(_0x11f076,_0x1c5b5f){return function(_0x183b59){_0x1c5b5f[_0x537c('0x3')](_0x11f076,_0x183b59);};}function removeListener(_0x42bd15,_0x2c0854){return function(){ChatMessageEvents[_0x537c('0x4')](_0x42bd15,_0x2c0854);};}exports['register']=function(_0x42c86a){for(var _0x1156f4=0x0,_0x336920=events['length'];_0x1156f4<_0x336920;_0x1156f4++){var _0x36bf4a=events[_0x1156f4];var _0x67f986=createListener(_0x537c('0x5')+_0x36bf4a,_0x42c86a);ChatMessageEvents['on'](_0x36bf4a,_0x67f986);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a0b00ea..af7a823 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 _0xf775=['create','put','/:id','/:id/accept','accept','reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chat','chatmessage:create'];(function(_0x1103c4,_0x562d1d){var _0x1c19ab=function(_0x10e254){while(--_0x10e254){_0x1103c4['push'](_0x1103c4['shift']());}};_0x1c19ab(++_0x562d1d);}(_0xf775,0x1ee));var _0x5f77=function(_0x5db1e8,_0x1e03b2){_0x5db1e8=_0x5db1e8-0x0;var _0x140383=_0xf775[_0x5db1e8];return _0x140383;};'use strict';var multer=require(_0x5f77('0x0'));var util=require('util');var path=require(_0x5f77('0x1'));var timeout=require(_0x5f77('0x2'));var express=require(_0x5f77('0x3'));var router=express[_0x5f77('0x4')]();var fs_extra=require(_0x5f77('0x5'));var auth=require(_0x5f77('0x6'));var interaction=require(_0x5f77('0x7'));var config=require(_0x5f77('0x8'));var controller=require(_0x5f77('0x9'));router[_0x5f77('0xa')]('/',auth[_0x5f77('0xb')](),controller['index']);router['get'](_0x5f77('0xc'),auth[_0x5f77('0xb')](),controller[_0x5f77('0xd')]);router[_0x5f77('0xa')]('/:id',auth[_0x5f77('0xb')](),controller[_0x5f77('0xe')]);router[_0x5f77('0xf')]('/',auth[_0x5f77('0xb')](),interaction[_0x5f77('0x10')](_0x5f77('0x11'),_0x5f77('0x12')),controller[_0x5f77('0x13')]);router[_0x5f77('0x14')](_0x5f77('0x15'),controller['update']);router['put'](_0x5f77('0x16'),auth[_0x5f77('0xb')](),controller[_0x5f77('0x17')]);router[_0x5f77('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x5f77('0x18')]);router['delete'](_0x5f77('0x15'),auth[_0x5f77('0xb')](),controller[_0x5f77('0x19')]);module[_0x5f77('0x1a')]=router; \ No newline at end of file +var _0xeef8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','describe','/:id','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','path'];(function(_0x57eed4,_0x1884f8){var _0x548da5=function(_0xe0a730){while(--_0xe0a730){_0x57eed4['push'](_0x57eed4['shift']());}};_0x548da5(++_0x1884f8);}(_0xeef8,0x186));var _0x8eef=function(_0x134a6f,_0x18a3c3){_0x134a6f=_0x134a6f-0x0;var _0x4e89a0=_0xeef8[_0x134a6f];return _0x4e89a0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8eef('0x0'));var timeout=require('connect-timeout');var express=require(_0x8eef('0x1'));var router=express[_0x8eef('0x2')]();var fs_extra=require(_0x8eef('0x3'));var auth=require(_0x8eef('0x4'));var interaction=require(_0x8eef('0x5'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth[_0x8eef('0x6')](),controller['index']);router[_0x8eef('0x7')]('/describe',auth[_0x8eef('0x6')](),controller[_0x8eef('0x8')]);router[_0x8eef('0x7')](_0x8eef('0x9'),auth[_0x8eef('0x6')](),controller['show']);router[_0x8eef('0xa')]('/',auth[_0x8eef('0x6')](),interaction[_0x8eef('0xb')](_0x8eef('0xc'),_0x8eef('0xd')),controller[_0x8eef('0xe')]);router['put'](_0x8eef('0x9'),controller[_0x8eef('0xf')]);router[_0x8eef('0x10')](_0x8eef('0x11'),auth[_0x8eef('0x6')](),controller[_0x8eef('0x12')]);router[_0x8eef('0x10')](_0x8eef('0x13'),auth[_0x8eef('0x6')](),controller[_0x8eef('0x14')]);router[_0x8eef('0x15')](_0x8eef('0x9'),auth[_0x8eef('0x6')](),controller[_0x8eef('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 2a5700c..c116cd6 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 _0x5f66=['medium','TEXT','exports'];(function(_0x135bb5,_0x417a28){var _0x4eef70=function(_0x9e29bd){while(--_0x9e29bd){_0x135bb5['push'](_0x135bb5['shift']());}};_0x4eef70(++_0x417a28);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0b0e,0x187));var _0xe0b0=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x0b0e[_0x51ec61];return _0x223200;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 4f01d23..2740c0e 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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x32a3f2,_0xc81d9){_0x32a3f2=_0x32a3f2-0x0;var _0x2c27b6=_0x7a54[_0x32a3f2];return _0x2c27b6;};'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(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x30e986,_0x1e9c93){_0x30e986=_0x30e986-0x0;var _0x1728e9=_0x7a54[_0x30e986];return _0x1728e9;};'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 4ff361b..8f510c3 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 _0xeb24=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x1c06a4,_0x35340d){var _0x2f19fb=function(_0x5b66cd){while(--_0x5b66cd){_0x1c06a4['push'](_0x1c06a4['shift']());}};_0x2f19fb(++_0x35340d);}(_0xeb24,0xd8));var _0x4eb2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xeb24[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x4eb2('0x0'));var ChatOfflineMessage=require(_0x4eb2('0x1'))['db'][_0x4eb2('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4eb2('0x3')](0x0);var events={'afterCreate':_0x4eb2('0x4'),'afterUpdate':'update','afterDestroy':_0x4eb2('0x5')};function emitEvent(_0x24bb04){return function(_0x59bb67,_0x4d1d51,_0x1938e9){ChatOfflineMessageEvents[_0x4eb2('0x6')](_0x24bb04+':'+_0x59bb67['id'],_0x59bb67);ChatOfflineMessageEvents[_0x4eb2('0x6')](_0x24bb04,_0x59bb67);_0x1938e9(null);};}for(var e in events){if(events[_0x4eb2('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x4eb2('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x9000=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9000,0x173));var _0x0900=function(_0x2c8afe,_0x100f80){_0x2c8afe=_0x2c8afe-0x0;var _0x982977=_0x9000[_0x2c8afe];return _0x982977;};'use strict';var EventEmitter=require(_0x0900('0x0'));var ChatOfflineMessage=require(_0x0900('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x0900('0x2')](0x0);var events={'afterCreate':_0x0900('0x3'),'afterUpdate':_0x0900('0x4'),'afterDestroy':_0x0900('0x5')};function emitEvent(_0x2f3c6a){return function(_0x12fdbb,_0x52d338,_0x3e19dc){ChatOfflineMessageEvents['emit'](_0x2f3c6a+':'+_0x12fdbb['id'],_0x12fdbb);ChatOfflineMessageEvents[_0x0900('0x6')](_0x2f3c6a,_0x12fdbb);_0x3e19dc(null);};}for(var e in events){if(events[_0x0900('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x0900('0x8')](e,emitEvent(event));}}module[_0x0900('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index ba40302..e16954c 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 _0x75de=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x75de,0xe6));var _0xe75d=function(_0x13b294,_0x26b5e8){_0x13b294=_0x13b294-0x0;var _0x46c2a4=_0x75de[_0x13b294];return _0x46c2a4;};'use strict';var attributes=require(_0xe75d('0x0'));module['exports']=function(_0x11a0d2){return _0x11a0d2[_0xe75d('0x1')](_0xe75d('0x2'),attributes,{'tableName':_0xe75d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe75d('0x4'),'collate':_0xe75d('0x5')});}; \ No newline at end of file +var _0xb891=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x507f17,_0x4a05b6){var _0x52a662=function(_0x31b4b8){while(--_0x31b4b8){_0x507f17['push'](_0x507f17['shift']());}};_0x52a662(++_0x4a05b6);}(_0xb891,0xec));var _0x1b89=function(_0x175d7c,_0x4fae84){_0x175d7c=_0x175d7c-0x0;var _0x414e8e=_0xb891[_0x175d7c];return _0x414e8e;};'use strict';var attributes=require(_0x1b89('0x0'));module['exports']=function(_0x19c7c9){return _0x19c7c9[_0x1b89('0x1')](_0x1b89('0x2'),attributes,{'tableName':_0x1b89('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1b89('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 4e5bda2..37b40fe 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 _0xc651=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc651,0x16a));var _0x1c65=function(_0x49c39b,_0x42d688){_0x49c39b=_0x49c39b-0x0;var _0xf1067f=_0xc651[_0x49c39b];return _0xf1067f;};'use strict';var _=require(_0x1c65('0x0'));var util=require(_0x1c65('0x1'));var moment=require(_0x1c65('0x2'));var BPromise=require(_0x1c65('0x3'));var rs=require(_0x1c65('0x4'));var fs=require('fs');var Redis=require(_0x1c65('0x5'));var db=require(_0x1c65('0x6'))['db'];var utils=require(_0x1c65('0x7'));var logger=require(_0x1c65('0x8'))(_0x1c65('0x9'));var config=require(_0x1c65('0xa'));var jayson=require(_0x1c65('0xb'));var client=jayson[_0x1c65('0xc')][_0x1c65('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x43d02d,_0x192e55,_0x3c8d3d){return new BPromise(function(_0x22b414,_0x106d60){return client[_0x1c65('0xe')](_0x43d02d,_0x3c8d3d)[_0x1c65('0xf')](function(_0x390514){logger[_0x1c65('0x10')](_0x1c65('0x11'),_0x192e55,_0x1c65('0x12'));logger[_0x1c65('0x13')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x192e55,_0x1c65('0x12'),JSON[_0x1c65('0x14')](_0x390514));if(_0x390514['error']){if(_0x390514[_0x1c65('0x15')]['code']===0x1f4){logger[_0x1c65('0x15')](_0x1c65('0x11'),_0x192e55,_0x390514[_0x1c65('0x15')][_0x1c65('0x16')]);return _0x106d60(_0x390514['error'][_0x1c65('0x16')]);}logger[_0x1c65('0x15')](_0x1c65('0x11'),_0x192e55,_0x390514[_0x1c65('0x15')]['message']);return _0x22b414(_0x390514[_0x1c65('0x15')][_0x1c65('0x16')]);}else{logger['info'](_0x1c65('0x11'),_0x192e55,_0x1c65('0x12'));_0x22b414(_0x390514[_0x1c65('0x17')][_0x1c65('0x16')]);}})[_0x1c65('0x18')](function(_0x2879b5){logger[_0x1c65('0x15')](_0x1c65('0x11'),_0x192e55,_0x2879b5);_0x106d60(_0x2879b5);});});} \ No newline at end of file +var _0x612a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring'];(function(_0x1ec4b8,_0x3a727f){var _0x35498b=function(_0x2aebaa){while(--_0x2aebaa){_0x1ec4b8['push'](_0x1ec4b8['shift']());}};_0x35498b(++_0x3a727f);}(_0x612a,0xa4));var _0xa612=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x612a[_0x17406e];return _0x2bfc5a;};'use strict';var _=require('lodash');var util=require(_0xa612('0x0'));var moment=require(_0xa612('0x1'));var BPromise=require(_0xa612('0x2'));var rs=require(_0xa612('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa612('0x4'))['db'];var utils=require(_0xa612('0x5'));var logger=require(_0xa612('0x6'))(_0xa612('0x7'));var config=require(_0xa612('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa612('0x9')][_0xa612('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1549e4,_0x350d13,_0x45a0b6){return new BPromise(function(_0x17b168,_0x4e0629){return client['request'](_0x1549e4,_0x45a0b6)['then'](function(_0x1a11db){logger[_0xa612('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x350d13,_0xa612('0xc'));logger[_0xa612('0xd')](_0xa612('0xe'),_0x350d13,_0xa612('0xc'),JSON[_0xa612('0xf')](_0x1a11db));if(_0x1a11db['error']){if(_0x1a11db[_0xa612('0x10')][_0xa612('0x11')]===0x1f4){logger[_0xa612('0x10')](_0xa612('0x12'),_0x350d13,_0x1a11db[_0xa612('0x10')][_0xa612('0x13')]);return _0x4e0629(_0x1a11db[_0xa612('0x10')][_0xa612('0x13')]);}logger[_0xa612('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x350d13,_0x1a11db[_0xa612('0x10')]['message']);return _0x17b168(_0x1a11db[_0xa612('0x10')]['message']);}else{logger[_0xa612('0xb')](_0xa612('0x12'),_0x350d13,_0xa612('0xc'));_0x17b168(_0x1a11db[_0xa612('0x14')][_0xa612('0x13')]);}})['catch'](function(_0x5a28d1){logger[_0xa612('0x10')](_0xa612('0x12'),_0x350d13,_0x5a28d1);_0x4e0629(_0x5a28d1);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 37c237e..697465e 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 _0xbcf0=['describe','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbcf0,0x71));var _0x0bcf=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xbcf0[_0x50007c];return _0x5c1ec7;};'use strict';var multer=require(_0x0bcf('0x0'));var util=require(_0x0bcf('0x1'));var path=require(_0x0bcf('0x2'));var timeout=require(_0x0bcf('0x3'));var express=require(_0x0bcf('0x4'));var router=express[_0x0bcf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0bcf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0bcf('0x7'));var controller=require(_0x0bcf('0x8'));router[_0x0bcf('0x9')]('/',auth['isAuthenticated'](),controller[_0x0bcf('0xa')]);router['get'](_0x0bcf('0xb'),auth[_0x0bcf('0xc')](),controller[_0x0bcf('0xd')]);router[_0x0bcf('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0bcf('0xe')]('/',auth[_0x0bcf('0xc')](),controller[_0x0bcf('0xf')]);router['put'](_0x0bcf('0x10'),auth[_0x0bcf('0xc')](),controller[_0x0bcf('0x11')]);router[_0x0bcf('0x12')](_0x0bcf('0x10'),auth['isAuthenticated'](),controller[_0x0bcf('0x13')]);module[_0x0bcf('0x14')]=router; \ No newline at end of file +var _0xf088=['exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy'];(function(_0x183c71,_0x526d3f){var _0x4d4c0f=function(_0x19b56d){while(--_0x19b56d){_0x183c71['push'](_0x183c71['shift']());}};_0x4d4c0f(++_0x526d3f);}(_0xf088,0x10b));var _0x8f08=function(_0x4e5212,_0x5e08b7){_0x4e5212=_0x4e5212-0x0;var _0x53116b=_0xf088[_0x4e5212];return _0x53116b;};'use strict';var multer=require(_0x8f08('0x0'));var util=require(_0x8f08('0x1'));var path=require(_0x8f08('0x2'));var timeout=require(_0x8f08('0x3'));var express=require(_0x8f08('0x4'));var router=express[_0x8f08('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8f08('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x8f08('0x7')]('/',auth[_0x8f08('0x8')](),controller['index']);router['get'](_0x8f08('0x9'),auth[_0x8f08('0x8')](),controller[_0x8f08('0xa')]);router['get'](_0x8f08('0xb'),auth['isAuthenticated'](),controller[_0x8f08('0xc')]);router[_0x8f08('0xd')]('/',auth['isAuthenticated'](),controller[_0x8f08('0xe')]);router[_0x8f08('0xf')](_0x8f08('0xb'),auth[_0x8f08('0x8')](),controller[_0x8f08('0x10')]);router['delete']('/:id',auth[_0x8f08('0x8')](),controller[_0x8f08('0x11')]);module[_0x8f08('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index f4bebcc..860481d 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 _0x9387=['sequelize','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x29afe3,_0x166eb4){var _0x4ce435=function(_0x476014){while(--_0x476014){_0x29afe3['push'](_0x29afe3['shift']());}};_0x4ce435(++_0x166eb4);}(_0x9387,0xae));var _0x7938=function(_0x2cd054,_0x1e643f){_0x2cd054=_0x2cd054-0x0;var _0x1c5ce5=_0x9387[_0x2cd054];return _0x1c5ce5;};'use strict';var Sequelize=require(_0x7938('0x0'));module['exports']={'name':{'type':Sequelize[_0x7938('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7938('0x2')](_0x7938('0x3'),_0x7938('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x7938('0x1')]},'timeout':{'type':Sequelize[_0x7938('0x5')]}}; \ No newline at end of file +var _0x2951=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x4dd7b4,_0x44d3ff){var _0x1ef845=function(_0x433b23){while(--_0x433b23){_0x4dd7b4['push'](_0x4dd7b4['shift']());}};_0x1ef845(++_0x44d3ff);}(_0x2951,0x14c));var _0x1295=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x2951[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require(_0x1295('0x0'));module[_0x1295('0x1')]={'name':{'type':Sequelize[_0x1295('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1295('0x3'),_0x1295('0x4')),'defaultValue':_0x1295('0x3')},'selector':{'type':Sequelize[_0x1295('0x2')]},'timeout':{'type':Sequelize[_0x1295('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 3669a2d..615fc3b 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 _0xe7de=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','show','params','model','ChatProactiveAction','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','include','catch','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x7c9f82,_0x987708){var _0x1a72ac=function(_0x246d59){while(--_0x246d59){_0x7c9f82['push'](_0x7c9f82['shift']());}};_0x1a72ac(++_0x987708);}(_0xe7de,0x165));var _0xee7d=function(_0x37dbb5,_0x90a90c){_0x37dbb5=_0x37dbb5-0x0;var _0x1b9829=_0xe7de[_0x37dbb5];return _0x1b9829;};'use strict';var emlformat=require(_0xee7d('0x0'));var rimraf=require(_0xee7d('0x1'));var zipdir=require(_0xee7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xee7d('0x3'));var BPromise=require(_0xee7d('0x4'));var Mustache=require(_0xee7d('0x5'));var util=require(_0xee7d('0x6'));var path=require(_0xee7d('0x7'));var sox=require(_0xee7d('0x8'));var csv=require(_0xee7d('0x9'));var ejs=require(_0xee7d('0xa'));var fs=require('fs');var fs_extra=require(_0xee7d('0xb'));var _=require(_0xee7d('0xc'));var squel=require(_0xee7d('0xd'));var crypto=require(_0xee7d('0xe'));var jsforce=require(_0xee7d('0xf'));var deskjs=require(_0xee7d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xee7d('0x11'));var Papa=require(_0xee7d('0x12'));var Redis=require(_0xee7d('0x13'));var authService=require(_0xee7d('0x14'));var qs=require(_0xee7d('0x15'));var as=require(_0xee7d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee7d('0x17'))('api');var utils=require(_0xee7d('0x18'));var config=require(_0xee7d('0x19'));var licenseUtil=require(_0xee7d('0x1a'));var db=require(_0xee7d('0x1b'))['db'];function respondWithStatusCode(_0xdfb04b,_0xb4c933){_0xb4c933=_0xb4c933||0xcc;return function(_0x3e9daa){if(_0x3e9daa){return _0xdfb04b[_0xee7d('0x1c')](_0xb4c933);}return _0xdfb04b[_0xee7d('0x1d')](_0xb4c933)[_0xee7d('0x1e')]();};}function respondWithResult(_0x41ca24,_0x47eb16){_0x47eb16=_0x47eb16||0xc8;return function(_0x4bfdab){if(_0x4bfdab){return _0x41ca24[_0xee7d('0x1d')](_0x47eb16)[_0xee7d('0x1f')](_0x4bfdab);}};}function respondWithFilteredResult(_0x4ab8a6,_0x1211a1){return function(_0x1a2976){if(_0x1a2976){var _0x1dc47c=typeof _0x1211a1['offset']===_0xee7d('0x20')&&typeof _0x1211a1[_0xee7d('0x21')]===_0xee7d('0x20');var _0x62d1ec=_0x1a2976[_0xee7d('0x22')];var _0x25f3e0=_0x1dc47c?0x0:_0x1211a1['offset'];var _0x152dd6=_0x1dc47c?_0x1a2976[_0xee7d('0x22')]:_0x1211a1[_0xee7d('0x23')]+_0x1211a1['limit'];var _0x277738;if(_0x152dd6>=_0x62d1ec){_0x152dd6=_0x62d1ec;_0x277738=0xc8;}else{_0x277738=0xce;}_0x4ab8a6['status'](_0x277738);return _0x4ab8a6[_0xee7d('0x24')](_0xee7d('0x25'),_0x25f3e0+'-'+_0x152dd6+'/'+_0x62d1ec)[_0xee7d('0x1f')](_0x1a2976);}return null;};}function patchUpdates(_0x4f6445){return function(_0x113a05){try{jsonpatch['apply'](_0x113a05,_0x4f6445,!![]);}catch(_0x20aeaa){return BPromise[_0xee7d('0x26')](_0x20aeaa);}return _0x113a05[_0xee7d('0x27')]();};}function saveUpdates(_0xed4f9f,_0x52eaf4){return function(_0x32ad6e){if(_0x32ad6e){return _0x32ad6e[_0xee7d('0x28')](_0xed4f9f)[_0xee7d('0x29')](function(_0x136a7b){return _0x136a7b;});}return null;};}function removeEntity(_0x33613a,_0x4d0efb){return function(_0x172850){if(_0x172850){return _0x172850[_0xee7d('0x2a')]()[_0xee7d('0x29')](function(){_0x33613a['status'](0xcc)[_0xee7d('0x1e')]();});}};}function handleEntityNotFound(_0x293382,_0x379de9){return function(_0x576d56){if(!_0x576d56){_0x293382[_0xee7d('0x1c')](0x194);}return _0x576d56;};}function handleError(_0x38e6a6,_0x4532cb){_0x4532cb=_0x4532cb||0x1f4;return function(_0x2b9482){logger[_0xee7d('0x2b')](_0x2b9482[_0xee7d('0x2c')]);if(_0x2b9482[_0xee7d('0x2d')]){delete _0x2b9482[_0xee7d('0x2d')];}_0x38e6a6[_0xee7d('0x1d')](_0x4532cb)['send'](_0x2b9482);};}exports[_0xee7d('0x2e')]=function(_0x4e1bf5,_0x5ca947){var _0x2a5b06={'raw':!![],'where':{'id':_0x4e1bf5[_0xee7d('0x2f')]['id']}},_0x4d4ff0={};_0x4d4ff0[_0xee7d('0x30')]=_['keys'](db[_0xee7d('0x31')][_0xee7d('0x32')]);_0x4d4ff0[_0xee7d('0x33')]=_[_0xee7d('0x34')](_0x4e1bf5[_0xee7d('0x33')]);_0x4d4ff0['filters']=_[_0xee7d('0x35')](_0x4d4ff0[_0xee7d('0x30')],_0x4d4ff0[_0xee7d('0x33')]);_0x2a5b06[_0xee7d('0x36')]=_[_0xee7d('0x35')](_0x4d4ff0[_0xee7d('0x30')],qs[_0xee7d('0x37')](_0x4e1bf5[_0xee7d('0x33')]['fields']));_0x2a5b06[_0xee7d('0x36')]=_0x2a5b06[_0xee7d('0x36')][_0xee7d('0x38')]?_0x2a5b06['attributes']:_0x4d4ff0[_0xee7d('0x30')];if(_0x4e1bf5['query'][_0xee7d('0x39')]){_0x2a5b06[_0xee7d('0x3a')]=[{'all':!![]}];}_0x2a5b06=_['merge']({},_0x2a5b06,_0x4e1bf5['options']);return db[_0xee7d('0x31')]['find'](_0x2a5b06)[_0xee7d('0x29')](handleEntityNotFound(_0x5ca947,null))[_0xee7d('0x29')](respondWithResult(_0x5ca947,null))[_0xee7d('0x3b')](handleError(_0x5ca947,null));};exports[_0xee7d('0x3c')]=function(_0x140e4a,_0x53de17){return db['ChatProactiveAction'][_0xee7d('0x3c')](_0x140e4a['body'],{})[_0xee7d('0x29')](respondWithResult(_0x53de17,0xc9))[_0xee7d('0x3b')](handleError(_0x53de17,null));};exports[_0xee7d('0x28')]=function(_0x1decf2,_0xf7ed45){if(_0x1decf2[_0xee7d('0x3d')]['id']){delete _0x1decf2[_0xee7d('0x3d')]['id'];}return db[_0xee7d('0x31')][_0xee7d('0x3e')]({'where':{'id':_0x1decf2[_0xee7d('0x2f')]['id']}})[_0xee7d('0x29')](handleEntityNotFound(_0xf7ed45,null))[_0xee7d('0x29')](saveUpdates(_0x1decf2['body'],null))[_0xee7d('0x29')](respondWithResult(_0xf7ed45,null))['catch'](handleError(_0xf7ed45,null));};exports[_0xee7d('0x2a')]=function(_0x4a6a5f,_0x13f7d2){return db['ChatProactiveAction'][_0xee7d('0x3e')]({'where':{'id':_0x4a6a5f[_0xee7d('0x2f')]['id']}})[_0xee7d('0x29')](handleEntityNotFound(_0x13f7d2,null))['then'](removeEntity(_0x13f7d2,null))[_0xee7d('0x3b')](handleError(_0x13f7d2,null));}; \ No newline at end of file +var _0x3663=['to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','include','options','find','create','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0xa8284d,_0x40bcef){var _0x5b801b=function(_0x316c99){while(--_0x316c99){_0xa8284d['push'](_0xa8284d['shift']());}};_0x5b801b(++_0x40bcef);}(_0x3663,0x1cf));var _0x3366=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0x3663[_0x2c18a8];return _0x1e009a;};'use strict';var emlformat=require(_0x3366('0x0'));var rimraf=require(_0x3366('0x1'));var zipdir=require(_0x3366('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3366('0x3'));var moment=require(_0x3366('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3366('0x5'));var util=require(_0x3366('0x6'));var path=require(_0x3366('0x7'));var sox=require(_0x3366('0x8'));var csv=require(_0x3366('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3366('0xa'));var _=require(_0x3366('0xb'));var squel=require('squel');var crypto=require(_0x3366('0xc'));var jsforce=require(_0x3366('0xd'));var deskjs=require(_0x3366('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3366('0xf'));var Papa=require(_0x3366('0x10'));var Redis=require(_0x3366('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3366('0x12'));var as=require(_0x3366('0x13'));var hardwareService=require(_0x3366('0x14'));var logger=require(_0x3366('0x15'))(_0x3366('0x16'));var utils=require(_0x3366('0x17'));var config=require(_0x3366('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16917f,_0x783695){_0x783695=_0x783695||0xcc;return function(_0x693c7d){if(_0x693c7d){return _0x16917f[_0x3366('0x19')](_0x783695);}return _0x16917f[_0x3366('0x1a')](_0x783695)[_0x3366('0x1b')]();};}function respondWithResult(_0x5b4063,_0x58e02a){_0x58e02a=_0x58e02a||0xc8;return function(_0x27753e){if(_0x27753e){return _0x5b4063['status'](_0x58e02a)[_0x3366('0x1c')](_0x27753e);}};}function respondWithFilteredResult(_0x293f69,_0x190524){return function(_0x334d91){if(_0x334d91){var _0xb5d3e4=typeof _0x190524['offset']===_0x3366('0x1d')&&typeof _0x190524[_0x3366('0x1e')]===_0x3366('0x1d');var _0x8529a5=_0x334d91[_0x3366('0x1f')];var _0x25d56c=_0xb5d3e4?0x0:_0x190524['offset'];var _0x581cf9=_0xb5d3e4?_0x334d91[_0x3366('0x1f')]:_0x190524['offset']+_0x190524[_0x3366('0x1e')];var _0x117796;if(_0x581cf9>=_0x8529a5){_0x581cf9=_0x8529a5;_0x117796=0xc8;}else{_0x117796=0xce;}_0x293f69[_0x3366('0x1a')](_0x117796);return _0x293f69[_0x3366('0x20')](_0x3366('0x21'),_0x25d56c+'-'+_0x581cf9+'/'+_0x8529a5)[_0x3366('0x1c')](_0x334d91);}return null;};}function patchUpdates(_0x50bbc9){return function(_0x3471ab){try{jsonpatch[_0x3366('0x22')](_0x3471ab,_0x50bbc9,!![]);}catch(_0x597d9b){return BPromise[_0x3366('0x23')](_0x597d9b);}return _0x3471ab[_0x3366('0x24')]();};}function saveUpdates(_0x485a70,_0x5a9bb0){return function(_0x239872){if(_0x239872){return _0x239872[_0x3366('0x25')](_0x485a70)[_0x3366('0x26')](function(_0x57e900){return _0x57e900;});}return null;};}function removeEntity(_0x5328dd,_0x32e25c){return function(_0x4760ff){if(_0x4760ff){return _0x4760ff[_0x3366('0x27')]()['then'](function(){_0x5328dd[_0x3366('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271c15,_0x1eec67){return function(_0x240e8c){if(!_0x240e8c){_0x271c15[_0x3366('0x19')](0x194);}return _0x240e8c;};}function handleError(_0x3266da,_0x436468){_0x436468=_0x436468||0x1f4;return function(_0x3303f1){logger[_0x3366('0x28')](_0x3303f1[_0x3366('0x29')]);if(_0x3303f1[_0x3366('0x2a')]){delete _0x3303f1['name'];}_0x3266da[_0x3366('0x1a')](_0x436468)[_0x3366('0x2b')](_0x3303f1);};}exports['show']=function(_0x320866,_0x1826e5){var _0x1354c6={'raw':!![],'where':{'id':_0x320866[_0x3366('0x2c')]['id']}},_0x280fda={};_0x280fda[_0x3366('0x2d')]=_[_0x3366('0x2e')](db[_0x3366('0x2f')][_0x3366('0x30')]);_0x280fda[_0x3366('0x31')]=_[_0x3366('0x2e')](_0x320866['query']);_0x280fda['filters']=_[_0x3366('0x32')](_0x280fda[_0x3366('0x2d')],_0x280fda[_0x3366('0x31')]);_0x1354c6[_0x3366('0x33')]=_['intersection'](_0x280fda[_0x3366('0x2d')],qs[_0x3366('0x34')](_0x320866['query'][_0x3366('0x34')]));_0x1354c6[_0x3366('0x33')]=_0x1354c6[_0x3366('0x33')]['length']?_0x1354c6[_0x3366('0x33')]:_0x280fda[_0x3366('0x2d')];if(_0x320866[_0x3366('0x31')]['includeAll']){_0x1354c6[_0x3366('0x35')]=[{'all':!![]}];}_0x1354c6=_['merge']({},_0x1354c6,_0x320866[_0x3366('0x36')]);return db[_0x3366('0x2f')][_0x3366('0x37')](_0x1354c6)[_0x3366('0x26')](handleEntityNotFound(_0x1826e5,null))['then'](respondWithResult(_0x1826e5,null))['catch'](handleError(_0x1826e5,null));};exports[_0x3366('0x38')]=function(_0x19c81a,_0x2996e0){return db[_0x3366('0x2f')][_0x3366('0x38')](_0x19c81a['body'],{})[_0x3366('0x26')](respondWithResult(_0x2996e0,0xc9))[_0x3366('0x39')](handleError(_0x2996e0,null));};exports[_0x3366('0x25')]=function(_0x2a12fc,_0x15b499){if(_0x2a12fc[_0x3366('0x3a')]['id']){delete _0x2a12fc[_0x3366('0x3a')]['id'];}return db['ChatProactiveAction'][_0x3366('0x37')]({'where':{'id':_0x2a12fc[_0x3366('0x2c')]['id']}})['then'](handleEntityNotFound(_0x15b499,null))[_0x3366('0x26')](saveUpdates(_0x2a12fc[_0x3366('0x3a')],null))['then'](respondWithResult(_0x15b499,null))['catch'](handleError(_0x15b499,null));};exports[_0x3366('0x27')]=function(_0x38c5cd,_0x669544){return db[_0x3366('0x2f')]['find']({'where':{'id':_0x38c5cd['params']['id']}})[_0x3366('0x26')](handleEntityNotFound(_0x669544,null))[_0x3366('0x26')](removeEntity(_0x669544,null))[_0x3366('0x39')](handleError(_0x669544,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c21c4b8..afd00bb 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 _0xcd4f=['define','ChatProactiveAction','chat_proactive_actions','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x44e322,_0x17d909){var _0x486a1a=function(_0x35ea09){while(--_0x35ea09){_0x44e322['push'](_0x44e322['shift']());}};_0x486a1a(++_0x17d909);}(_0xcd4f,0x9d));var _0xfcd4=function(_0x282b6d,_0x22a326){_0x282b6d=_0x282b6d-0x0;var _0x4a797e=_0xcd4f[_0x282b6d];return _0x4a797e;};'use strict';var _=require(_0xfcd4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfcd4('0x1'));var BPromise=require(_0xfcd4('0x2'));var rp=require(_0xfcd4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcd4('0x4'));var config=require(_0xfcd4('0x5'));var attributes=require(_0xfcd4('0x6'));module[_0xfcd4('0x7')]=function(_0x44ca6e,_0x378cac){return _0x44ca6e[_0xfcd4('0x8')](_0xfcd4('0x9'),attributes,{'tableName':_0xfcd4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x588d=['chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0xe7146a,_0x1d7c91){var _0xd86b6e=function(_0x56b417){while(--_0x56b417){_0xe7146a['push'](_0xe7146a['shift']());}};_0xd86b6e(++_0x1d7c91);}(_0x588d,0x1f0));var _0xd588=function(_0x707e78,_0x3a7bcb){_0x707e78=_0x707e78-0x0;var _0x579b2e=_0x588d[_0x707e78];return _0x579b2e;};'use strict';var _=require('lodash');var util=require(_0xd588('0x0'));var logger=require(_0xd588('0x1'))(_0xd588('0x2'));var moment=require(_0xd588('0x3'));var BPromise=require(_0xd588('0x4'));var rp=require(_0xd588('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd588('0x6'));var config=require('../../config/environment');var attributes=require(_0xd588('0x7'));module['exports']=function(_0xb22362,_0x431e5d){return _0xb22362[_0xd588('0x8')](_0xd588('0x9'),attributes,{'tableName':_0xd588('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 33befa2..33fceb1 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 _0x9ac9=['util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9ac9,0x18b));var _0x99ac=function(_0x28b321,_0x528c3d){_0x28b321=_0x28b321-0x0;var _0x4de923=_0x9ac9[_0x28b321];return _0x4de923;};'use strict';var _=require(_0x99ac('0x0'));var util=require(_0x99ac('0x1'));var moment=require(_0x99ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x99ac('0x3'));var fs=require('fs');var Redis=require(_0x99ac('0x4'));var db=require(_0x99ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x99ac('0x6'));var config=require(_0x99ac('0x7'));var jayson=require(_0x99ac('0x8'));var client=jayson[_0x99ac('0x9')][_0x99ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1776ca,_0x58f8a9,_0x3a0059){return new BPromise(function(_0x2c9ba9,_0x557982){return client['request'](_0x1776ca,_0x3a0059)[_0x99ac('0xb')](function(_0x426c76){logger[_0x99ac('0xc')](_0x99ac('0xd'),_0x58f8a9,_0x99ac('0xe'));logger[_0x99ac('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x58f8a9,_0x99ac('0xe'),JSON[_0x99ac('0x10')](_0x426c76));if(_0x426c76['error']){if(_0x426c76[_0x99ac('0x11')][_0x99ac('0x12')]===0x1f4){logger[_0x99ac('0x11')](_0x99ac('0xd'),_0x58f8a9,_0x426c76[_0x99ac('0x11')][_0x99ac('0x13')]);return _0x557982(_0x426c76[_0x99ac('0x11')]['message']);}logger[_0x99ac('0x11')](_0x99ac('0xd'),_0x58f8a9,_0x426c76[_0x99ac('0x11')][_0x99ac('0x13')]);return _0x2c9ba9(_0x426c76[_0x99ac('0x11')][_0x99ac('0x13')]);}else{logger[_0x99ac('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x58f8a9,'request\x20sent');_0x2c9ba9(_0x426c76[_0x99ac('0x14')]['message']);}})[_0x99ac('0x15')](function(_0x485257){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x58f8a9,_0x485257);_0x557982(_0x485257);});});} \ No newline at end of file +var _0x2cc4=['jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment'];(function(_0x255b71,_0x54816f){var _0xa78704=function(_0x5ebc66){while(--_0x5ebc66){_0x255b71['push'](_0x255b71['shift']());}};_0xa78704(++_0x54816f);}(_0x2cc4,0x1f3));var _0x42cc=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x2cc4[_0x4f431d];return _0x4f31e1;};'use strict';var _=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var moment=require(_0x42cc('0x2'));var BPromise=require(_0x42cc('0x3'));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(_0x42cc('0x4'))(_0x42cc('0x5'));var config=require(_0x42cc('0x6'));var jayson=require(_0x42cc('0x7'));var client=jayson[_0x42cc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51b75c,_0x11d7b8,_0x10b0bb){return new BPromise(function(_0x2ea2cf,_0x100c03){return client[_0x42cc('0x9')](_0x51b75c,_0x10b0bb)[_0x42cc('0xa')](function(_0x491fe7){logger['info'](_0x42cc('0xb'),_0x11d7b8,_0x42cc('0xc'));logger[_0x42cc('0xd')](_0x42cc('0xe'),_0x11d7b8,'request\x20sent',JSON[_0x42cc('0xf')](_0x491fe7));if(_0x491fe7[_0x42cc('0x10')]){if(_0x491fe7[_0x42cc('0x10')][_0x42cc('0x11')]===0x1f4){logger[_0x42cc('0x10')](_0x42cc('0xb'),_0x11d7b8,_0x491fe7[_0x42cc('0x10')][_0x42cc('0x12')]);return _0x100c03(_0x491fe7[_0x42cc('0x10')]['message']);}logger['error'](_0x42cc('0xb'),_0x11d7b8,_0x491fe7[_0x42cc('0x10')][_0x42cc('0x12')]);return _0x2ea2cf(_0x491fe7[_0x42cc('0x10')][_0x42cc('0x12')]);}else{logger[_0x42cc('0x13')](_0x42cc('0xb'),_0x11d7b8,_0x42cc('0xc'));_0x2ea2cf(_0x491fe7[_0x42cc('0x14')]['message']);}})[_0x42cc('0x15')](function(_0x970d8f){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x11d7b8,_0x970d8f);_0x100c03(_0x970d8f);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 7e855d0..060c8a6 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 _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(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x426572,_0x350da0){_0x426572=_0x426572-0x0;var _0x1d8ece=_0xb4c7[_0x426572];return _0x1d8ece;};'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 +var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xeff8,0x186));var _0x8eff=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0xeff8[_0x172133];return _0x2460e5;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 240921c..8db0d64 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 _0x02c4=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x5d2e60,_0xa8a270){var _0xc02ae8=function(_0x22817b){while(--_0x22817b){_0x5d2e60['push'](_0x5d2e60['shift']());}};_0xc02ae8(++_0xa8a270);}(_0x02c4,0xf6));var _0x402c=function(_0x2aa68a,_0x413c7d){_0x2aa68a=_0x2aa68a-0x0;var _0xc11d64=_0x02c4[_0x2aa68a];return _0xc11d64;};'use strict';var Sequelize=require(_0x402c('0x0'));module[_0x402c('0x1')]={'name':{'type':Sequelize[_0x402c('0x2')],'unique':_0x402c('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x402c('0x2')]},'timeout':{'type':Sequelize[_0x402c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x402c('0x5')]('rrmemory',_0x402c('0x6'),_0x402c('0x7'))}}; \ No newline at end of file +var _0x7ff7=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x591de6,_0x1572c2){var _0x3e05f5=function(_0xe6b815){while(--_0xe6b815){_0x591de6['push'](_0x591de6['shift']());}};_0x3e05f5(++_0x1572c2);}(_0x7ff7,0x120));var _0x77ff=function(_0xd40f44,_0x100211){_0xd40f44=_0xd40f44-0x0;var _0x4f9627=_0x7ff7[_0xd40f44];return _0x4f9627;};'use strict';var Sequelize=require(_0x77ff('0x0'));module[_0x77ff('0x1')]={'name':{'type':Sequelize[_0x77ff('0x2')],'unique':_0x77ff('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x77ff('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x77ff('0x5')](_0x77ff('0x6'),_0x77ff('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index b147e10..2d170bd 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 _0x703d=['socket.io-emitter','./chatQueue.socket','end','json','offset','undefined','count','limit','status','set','Content-Range','then','destroy','ChatQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','findAll','rows','show','params','keys','query','intersection','attributes','fields','length','model','includeAll','merge','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filters','nolimit','order','sort','pick','filter','options','User','findAndCountAll','UserId','agent','chatPause','createdAt','format','SIP','updatedAt','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','all','value','userChatQueue:remove','addAgents','omit','removeAgents','getAgents','bluebird','util','lodash','../../config/logger','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x3648e7,_0x408571){var _0x282a09=function(_0x26cee0){while(--_0x26cee0){_0x3648e7['push'](_0x3648e7['shift']());}};_0x282a09(++_0x408571);}(_0x703d,0x1bc));var _0xd703=function(_0x4b846c,_0x1b0065){_0x4b846c=_0x4b846c-0x0;var _0x2dfa6f=_0x703d[_0x4b846c];return _0x2dfa6f;};'use strict';var BPromise=require(_0xd703('0x0'));var util=require(_0xd703('0x1'));var _=require(_0xd703('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xd703('0x3'))('api');var config=require(_0xd703('0x4'));var db=require(_0xd703('0x5'))['db'];config[_0xd703('0x6')]=_[_0xd703('0x7')](config[_0xd703('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xd703('0x8'))(new Redis(config[_0xd703('0x6')]));require(_0xd703('0x9'))['register'](socket);function respondWithStatusCode(_0x41e369,_0x370f45){_0x370f45=_0x370f45||0xcc;return function(_0x4c37fb){if(_0x4c37fb){return _0x41e369['sendStatus'](_0x370f45);}return _0x41e369['status'](_0x370f45)[_0xd703('0xa')]();};}function respondWithResult(_0x211aa9,_0x3ca0a1){_0x3ca0a1=_0x3ca0a1||0xc8;return function(_0x29b863){if(_0x29b863){return _0x211aa9['status'](_0x3ca0a1)[_0xd703('0xb')](_0x29b863);}};}function respondWithFilteredResult(_0x2ffbcb,_0x2e5e67){return function(_0x19b2f9){if(_0x19b2f9){var _0x5ef5ab=typeof _0x2e5e67[_0xd703('0xc')]===_0xd703('0xd')&&typeof _0x2e5e67['limit']==='undefined';var _0xca1659=_0x19b2f9[_0xd703('0xe')];var _0x5333b3=_0x5ef5ab?0x0:_0x2e5e67[_0xd703('0xc')];var _0x268c99=_0x5ef5ab?_0x19b2f9['count']:_0x2e5e67[_0xd703('0xc')]+_0x2e5e67[_0xd703('0xf')];var _0x170410;if(_0x268c99>=_0xca1659){_0x268c99=_0xca1659;_0x170410=0xc8;}else{_0x170410=0xce;}_0x2ffbcb[_0xd703('0x10')](_0x170410);return _0x2ffbcb[_0xd703('0x11')](_0xd703('0x12'),_0x5333b3+'-'+_0x268c99+'/'+_0xca1659)[_0xd703('0xb')](_0x19b2f9);}return null;};}function saveUpdates(_0x5a2263){return function(_0x5057ac){if(_0x5057ac){return _0x5057ac['update'](_0x5a2263)[_0xd703('0x13')](function(_0x5b3e09){return _0x5b3e09;});}return null;};}function removeEntity(_0x500033){return function(_0x7ad222){if(_0x7ad222){return _0x7ad222[_0xd703('0x14')]()[_0xd703('0x13')](function(){var _0x366d95=_0x7ad222['get']({'plain':!![]});var _0x333afd=_0xd703('0x15');return db[_0xd703('0x16')][_0xd703('0x14')]({'where':{'type':_0x333afd,'resourceId':_0x366d95['id']}})['then'](function(){return _0x7ad222;});})['then'](function(){_0x500033[_0xd703('0x10')](0xcc)[_0xd703('0xa')]();});}};}function handleEntityNotFound(_0x2d0a4a){return function(_0x3b5334){if(!_0x3b5334){_0x2d0a4a[_0xd703('0x17')](0x194);}return _0x3b5334;};}function handleError(_0x26e733,_0x53fc79){_0x53fc79=_0x53fc79||0x1f4;return function(_0x3de2b2){logger[_0xd703('0x18')](_0x3de2b2[_0xd703('0x19')]);if(_0x3de2b2[_0xd703('0x1a')]){delete _0x3de2b2[_0xd703('0x1a')];}_0x26e733[_0xd703('0x10')](_0x53fc79)[_0xd703('0x1b')](_0x3de2b2);};}exports[_0xd703('0x1c')]=function(_0x40896f,_0x17d5f9){var _0x14525d={};var _0x2c13e4={'count':0x0,'rows':[]};var _0x1153f0=_[_0xd703('0x1d')](db[_0xd703('0x1e')][_0xd703('0x1f')],function(_0x58b093){return{'name':_0x58b093[_0xd703('0x20')],'type':_0x58b093['type'][_0xd703('0x21')]};});_0x14525d=qs[_0xd703('0x22')](_0x1153f0,_0x40896f);var _0x5cfd02={'where':_0x14525d[_0xd703('0x23')]};return db['ChatQueue'][_0xd703('0xe')](_0x5cfd02)[_0xd703('0x13')](function(_0x5ca50c){_0x2c13e4[_0xd703('0xe')]=_0x5ca50c;_0x14525d[_0xd703('0x24')]=qs[_0xd703('0x24')](_0x40896f['query']);return db[_0xd703('0x1e')][_0xd703('0x25')](_0x14525d);})[_0xd703('0x13')](function(_0x5ef11c){_0x2c13e4[_0xd703('0x26')]=_0x5ef11c;return _0x2c13e4;})[_0xd703('0x13')](respondWithFilteredResult(_0x17d5f9,_0x14525d))['catch'](handleError(_0x17d5f9,null));};exports[_0xd703('0x27')]=function(_0x5e6949,_0x1bf996){var _0x567587={'raw':!![],'where':{'id':_0x5e6949[_0xd703('0x28')]['id']}},_0x5bf031={};_0x5bf031['model']=_[_0xd703('0x29')](db[_0xd703('0x1e')][_0xd703('0x1f')]);_0x5bf031[_0xd703('0x2a')]=_['keys'](_0x5e6949[_0xd703('0x2a')]);_0x5bf031['filters']=_[_0xd703('0x2b')](_0x5bf031['model'],_0x5bf031[_0xd703('0x2a')]);_0x567587[_0xd703('0x2c')]=_[_0xd703('0x2b')](_0x5bf031['model'],qs[_0xd703('0x2d')](_0x5e6949[_0xd703('0x2a')][_0xd703('0x2d')]));_0x567587[_0xd703('0x2c')]=_0x567587['attributes'][_0xd703('0x2e')]?_0x567587[_0xd703('0x2c')]:_0x5bf031[_0xd703('0x2f')];if(_0x5e6949[_0xd703('0x2a')][_0xd703('0x30')]){_0x567587[_0xd703('0x24')]=[{'all':!![]}];}_0x567587=_[_0xd703('0x31')]({},_0x567587,_0x5e6949['options']);return db['ChatQueue']['find'](_0x567587)[_0xd703('0x13')](handleEntityNotFound(_0x1bf996,null))[_0xd703('0x13')](respondWithResult(_0x1bf996,null))[_0xd703('0x32')](handleError(_0x1bf996,null));};exports[_0xd703('0x33')]=function(_0x1d3933,_0x315b97){return db[_0xd703('0x1e')][_0xd703('0x33')](_0x1d3933[_0xd703('0x34')],{})['then'](function(_0x3aa5fe){var _0xc10a5=_0x1d3933['user'][_0xd703('0x35')]({'plain':!![]});if(!_0xc10a5)throw new Error(_0xd703('0x36'));if(_0xc10a5[_0xd703('0x37')]==='user'){var _0x128bc7=_0x3aa5fe['get']({'plain':!![]});var _0x191b52='ChatQueues';return db['UserProfileSection'][_0xd703('0x38')]({'where':{'name':_0x191b52,'userProfileId':_0xc10a5['userProfileId']},'raw':!![]})[_0xd703('0x13')](function(_0x208857){if(_0x208857&&_0x208857[_0xd703('0x39')]===0x0){return db['UserProfileResource'][_0xd703('0x33')]({'name':_0x128bc7[_0xd703('0x1a')],'resourceId':_0x128bc7['id'],'type':_0x208857[_0xd703('0x1a')],'sectionId':_0x208857['id']},{})[_0xd703('0x13')](function(){return _0x3aa5fe;});}else{return _0x3aa5fe;}})[_0xd703('0x32')](function(_0x5b5e69){logger[_0xd703('0x18')](_0xd703('0x3a'),_0x5b5e69);throw _0x5b5e69;});}return _0x3aa5fe;})[_0xd703('0x13')](respondWithResult(_0x315b97,0xc9))[_0xd703('0x32')](handleError(_0x315b97,null));};exports['update']=function(_0x3c7047,_0x394cc0){if(_0x3c7047['body']['id']){delete _0x3c7047[_0xd703('0x34')]['id'];}return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x3c7047[_0xd703('0x28')]['id']}})[_0xd703('0x13')](handleEntityNotFound(_0x394cc0,null))['then'](saveUpdates(_0x3c7047[_0xd703('0x34')],null))[_0xd703('0x13')](respondWithResult(_0x394cc0,null))[_0xd703('0x32')](handleError(_0x394cc0,null));};exports[_0xd703('0x14')]=function(_0x3719fb,_0xabc8eb){return db['ChatQueue']['find']({'where':{'id':_0x3719fb[_0xd703('0x28')]['id']}})[_0xd703('0x13')](handleEntityNotFound(_0xabc8eb,null))[_0xd703('0x13')](removeEntity(_0xabc8eb,null))['catch'](handleError(_0xabc8eb,null));};exports[_0xd703('0x3b')]=function(_0x2d4cb9,_0x41bf46){return db[_0xd703('0x1e')]['describe']()['then'](respondWithResult(_0x41bf46,null))[_0xd703('0x32')](handleError(_0x41bf46,null));};exports[_0xd703('0x3c')]=function(_0x4a8cda,_0x1d19cf){var _0x52885f={'raw':!![],'where':{}},_0x5c9eee={},_0x156288;return db[_0xd703('0x1e')][_0xd703('0x3d')]({'where':{'id':_0x4a8cda[_0xd703('0x28')]['id']}})['then'](handleEntityNotFound(_0x1d19cf,null))[_0xd703('0x13')](function(_0x1e1fcd){if(_0x1e1fcd){_0x156288=_0x1e1fcd[_0xd703('0x35')]({'plain':!![]});_0x5c9eee[_0xd703('0x2f')]=_[_0xd703('0x29')](db[_0xd703('0x3e')][_0xd703('0x1f')]);_0x5c9eee[_0xd703('0x2a')]=_[_0xd703('0x29')](_0x4a8cda[_0xd703('0x2a')]);_0x5c9eee[_0xd703('0x3f')]=_[_0xd703('0x2b')](_0x5c9eee[_0xd703('0x2f')],_0x5c9eee[_0xd703('0x2a')]);_0x52885f[_0xd703('0x2c')]=_[_0xd703('0x2b')](_0x5c9eee[_0xd703('0x2f')],qs[_0xd703('0x2d')](_0x4a8cda[_0xd703('0x2a')]['fields']));_0x52885f[_0xd703('0x2c')]=_0x52885f[_0xd703('0x2c')]['length']?_0x52885f[_0xd703('0x2c')]:_0x5c9eee['model'];if(!_0x4a8cda['query']['hasOwnProperty'](_0xd703('0x40'))){_0x52885f['limit']=qs[_0xd703('0xf')](_0x4a8cda['query']['limit']);_0x52885f['offset']=qs['offset'](_0x4a8cda['query'][_0xd703('0xc')]);}_0x52885f[_0xd703('0x41')]=qs[_0xd703('0x42')](_0x4a8cda[_0xd703('0x2a')][_0xd703('0x42')]);_0x52885f[_0xd703('0x23')]=qs[_0xd703('0x3f')](_[_0xd703('0x43')](_0x4a8cda[_0xd703('0x2a')],_0x5c9eee[_0xd703('0x3f')]));_0x52885f['where']['ChatQueueId']=_0x1e1fcd['id'];if(_0x4a8cda['query']['filter']){_0x52885f[_0xd703('0x23')]=_[_0xd703('0x31')](_0x52885f['where'],{'$or':_[_0xd703('0x1d')](_0x52885f[_0xd703('0x2c')],function(_0x5be779){var _0x292cb8={};_0x292cb8[_0x5be779]={'$like':'%'+_0x4a8cda[_0xd703('0x2a')][_0xd703('0x44')]+'%'};return _0x292cb8;})});}_0x52885f=_[_0xd703('0x31')]({},_0x52885f,_0x4a8cda[_0xd703('0x45')]);return db['UserChatQueue'][_0xd703('0x25')](_0x52885f);}})[_0xd703('0x13')](function(_0x3b79ea){if(_0x3b79ea){return db[_0xd703('0x46')][_0xd703('0x47')]({'where':{'id':_[_0xd703('0x1d')](_0x3b79ea,_0xd703('0x48')),'role':_0xd703('0x49')},'attributes':['id',_0xd703('0x1a'),_0xd703('0x4a'),'updatedAt',_0xd703('0x4b')]});}})[_0xd703('0x13')](function(_0x2149cd){if(_0x2149cd){return{'count':_0x2149cd[_0xd703('0xe')],'rows':_[_0xd703('0x1d')](_0x2149cd['rows'],function(_0x42816f){return{'membername':_0x42816f[_0xd703('0x1a')],'UserId':_0x42816f['id'],'queue_name':_0x156288[_0xd703('0x1a')],'ChatQueueId':_0x156288['id'],'interface':util[_0xd703('0x4c')]('%s/%s',_0xd703('0x4d'),_0x42816f['name']),'penalty':0x0,'paused':_0x42816f[_0xd703('0x4a')],'createdAt':_0x42816f[_0xd703('0x4b')],'updatedAt':_0x42816f[_0xd703('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd703('0x13')](respondWithFilteredResult(_0x1d19cf,_0x52885f))['catch'](handleError(_0x1d19cf,null));};exports[_0xd703('0x4f')]=function(_0x6ea950,_0x3aede3){var _0xb8e50c={};var _0x39ed3a={};var _0x41e393;var _0x1ff3fe;return db[_0xd703('0x1e')][_0xd703('0x3d')]({'where':{'id':_0x6ea950['params']['id']}})['then'](handleEntityNotFound(_0x3aede3,null))['then'](function(_0x3884f3){if(_0x3884f3){_0x41e393=_0x3884f3;_0x39ed3a[_0xd703('0x2f')]=_[_0xd703('0x29')](db[_0xd703('0x50')][_0xd703('0x1f')]);_0x39ed3a[_0xd703('0x2a')]=_[_0xd703('0x29')](_0x6ea950[_0xd703('0x2a')]);_0x39ed3a[_0xd703('0x3f')]=_[_0xd703('0x2b')](_0x39ed3a[_0xd703('0x2f')],_0x39ed3a[_0xd703('0x2a')]);_0xb8e50c['attributes']=_['intersection'](_0x39ed3a['model'],qs[_0xd703('0x2d')](_0x6ea950[_0xd703('0x2a')][_0xd703('0x2d')]));_0xb8e50c['attributes']=_0xb8e50c['attributes'][_0xd703('0x2e')]?_0xb8e50c[_0xd703('0x2c')]:_0x39ed3a[_0xd703('0x2f')];_0xb8e50c[_0xd703('0x41')]=qs[_0xd703('0x42')](_0x6ea950[_0xd703('0x2a')]['sort']);_0xb8e50c[_0xd703('0x23')]=qs[_0xd703('0x3f')](_[_0xd703('0x43')](_0x6ea950[_0xd703('0x2a')],_0x39ed3a[_0xd703('0x3f')]));if(_0x6ea950[_0xd703('0x2a')][_0xd703('0x44')]){_0xb8e50c[_0xd703('0x23')]=_[_0xd703('0x31')](_0xb8e50c[_0xd703('0x23')],{'$or':_[_0xd703('0x1d')](_0xb8e50c[_0xd703('0x2c')],function(_0x569a50){var _0x20c67c={};_0x20c67c[_0x569a50]={'$like':'%'+_0x6ea950['query'][_0xd703('0x44')]+'%'};return _0x20c67c;})});}_0xb8e50c=_[_0xd703('0x31')]({},_0xb8e50c,_0x6ea950[_0xd703('0x45')]);return _0x41e393[_0xd703('0x4f')](_0xb8e50c);}})['then'](function(_0x9d4050){if(_0x9d4050){_0x1ff3fe=_0x9d4050[_0xd703('0x2e')];if(!_0x6ea950[_0xd703('0x2a')][_0xd703('0x51')](_0xd703('0x40'))){_0xb8e50c['limit']=qs[_0xd703('0xf')](_0x6ea950[_0xd703('0x2a')][_0xd703('0xf')]);_0xb8e50c[_0xd703('0xc')]=qs[_0xd703('0xc')](_0x6ea950['query'][_0xd703('0xc')]);}return _0x41e393[_0xd703('0x4f')](_0xb8e50c);}})[_0xd703('0x13')](function(_0x8ae2fb){if(_0x8ae2fb){return _0x8ae2fb?{'count':_0x1ff3fe,'rows':_0x8ae2fb}:null;}})[_0xd703('0x13')](respondWithResult(_0x3aede3,null))['catch'](handleError(_0x3aede3,null));};exports[_0xd703('0x52')]=function(_0x2ed0d0,_0x1a0f47){var _0x5d9dbe=_0x2ed0d0['body'][_0xd703('0x53')];return db[_0xd703('0x50')]['findAll']({'where':{'id':_0x5d9dbe},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd703('0x54'),'attributes':['id',_0xd703('0x1a'),_0xd703('0x55'),_0xd703('0x56'),'interface'],'raw':!![]}]})[_0xd703('0x13')](function(_0x152d5b){if(_0x152d5b){var _0x143063=_[_0xd703('0x57')](_0x152d5b,function(_0x2d4a5f){var _0x44c1cb=_0x2d4a5f[_0xd703('0x35')]({'plain':!![]});return _0x44c1cb[_0xd703('0x54')];});return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x2ed0d0['params']['id']}})[_0xd703('0x13')](function(_0x2c70c3){return db[_0xd703('0x58')][_0xd703('0x59')](function(_0x25ec62){return _0x2c70c3[_0xd703('0x52')](_0x5d9dbe,{'transaction':_0x25ec62})[_0xd703('0x13')](function(){return BPromise[_0xd703('0x5a')](_0x143063,function(_0x1c5551){return db[_0xd703('0x3e')][_0xd703('0x5b')]({'where':{'UserId':_0x1c5551['id'],'ChatQueueId':_0x2ed0d0['params']['id']},'transaction':_0x25ec62});});})[_0xd703('0x13')](function(){_0x143063[_0xd703('0x5c')](function(_0x2d871c){socket[_0xd703('0x5d')](_0xd703('0x5e'),{'UserId':_0x2d871c['id'],'ChatQueueId':_0x2c70c3['id']});});});});});}})[_0xd703('0x13')](respondWithStatusCode(_0x1a0f47,null))[_0xd703('0x32')](handleError(_0x1a0f47,null));};exports[_0xd703('0x5f')]=function(_0x294b3f,_0x508835){return db[_0xd703('0x50')][_0xd703('0x25')]({'where':{'id':_0x294b3f['query'][_0xd703('0x53')]},'attributes':['id'],'include':[{'model':db[_0xd703('0x46')],'as':_0xd703('0x54'),'attributes':['id'],'raw':!![]}]})[_0xd703('0x13')](handleEntityNotFound(_0x508835,null))[_0xd703('0x13')](function(_0x503628){var _0x1b6223=_[_0xd703('0x1d')](_0x503628,'id');var _0x4a6f83=[];var _0x574262=[];var _0x492604=squel[_0xd703('0x60')]();_0x492604['field'](_0xd703('0x61'))['from'](_0xd703('0x62'),'tq')[_0xd703('0x63')](_0xd703('0x64'),'ut',_0xd703('0x65'))[_0xd703('0x23')](_0xd703('0x66'),_0x294b3f[_0xd703('0x28')]['id']);for(var _0x18f55e=0x0;_0x18f55e<_0x503628['length'];_0x18f55e+=0x1){let _0x38d4d6=_0x503628[_0x18f55e];for(var _0x44a5cf=0x0;_0x44a5cf<_0x38d4d6[_0xd703('0x54')][_0xd703('0x2e')];_0x44a5cf+=0x1){let _0x1b9ab5=_0x38d4d6[_0xd703('0x54')][_0x44a5cf];var _0x71b5be=_0x492604[_0xd703('0x67')]();_0x71b5be[_0xd703('0x23')](_0xd703('0x68'),_0x1b9ab5['id']);_0x574262['push'](db['sequelize']['query'](_0x71b5be['toString'](),{'type':db['sequelize']['QueryTypes'][_0xd703('0x69')]})[_0xd703('0x13')](function(_0xfae1c4){if(_0xfae1c4['length']===0x1){return _0x1b9ab5['id'];}else{var _0x1c0045=_['every'](_[_0xd703('0x1d')](_0xfae1c4,'TeamId'),function(_0x4679de){return _['includes'](_0x1b6223,_0x4679de);});if(_0x1c0045){return _0x1b9ab5['id'];}}}));}}return BPromise[_0xd703('0x6a')](_0x574262)[_0xd703('0x13')](function(_0x1cd00b){_0x4a6f83=_(_0x4a6f83)['union'](_0x1cd00b)['compact']()[_0xd703('0x6b')]();return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x294b3f[_0xd703('0x28')]['id']}})['then'](function(_0x44fe52){return db[_0xd703('0x58')][_0xd703('0x59')](function(_0x5a34bd){return _0x44fe52['removeTeams'](_0x294b3f[_0xd703('0x2a')][_0xd703('0x53')],{'transaction':_0x5a34bd})[_0xd703('0x13')](function(){if(!_['isEmpty'](_0x4a6f83)){return _0x44fe52['removeAgents'](_0x4a6f83,{'transaction':_0x5a34bd});}})[_0xd703('0x13')](function(){_0x4a6f83[_0xd703('0x5c')](function(_0x42273a){socket[_0xd703('0x5d')](_0xd703('0x6c'),{'UserId':_0x42273a,'ChatQueueId':_0x44fe52['id']});});});});});});})[_0xd703('0x13')](respondWithStatusCode(_0x508835,null))['catch'](handleError(_0x508835,null));};exports[_0xd703('0x6d')]=function(_0x4645e9,_0x30402f){return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x4645e9[_0xd703('0x28')]['id']}})[_0xd703('0x13')](handleEntityNotFound(_0x30402f,null))[_0xd703('0x13')](function(_0x562d26){if(_0x562d26){return _0x562d26['addAgents'](_0x4645e9[_0xd703('0x34')][_0xd703('0x53')],_[_0xd703('0x6e')](_0x4645e9['body'],[_0xd703('0x53'),'id'])||{})['spread'](function(_0x1d6569){for(var _0xd4dffe=0x0;_0xd4dffe<_0x4645e9[_0xd703('0x34')][_0xd703('0x53')][_0xd703('0x2e')];_0xd4dffe+=0x1){socket['emit'](_0xd703('0x5e'),{'UserId':Number(_0x4645e9[_0xd703('0x34')][_0xd703('0x53')][_0xd4dffe]),'ChatQueueId':Number(_0x4645e9[_0xd703('0x28')]['id'])});}return _0x1d6569;});}})[_0xd703('0x13')](respondWithResult(_0x30402f,null))[_0xd703('0x32')](handleError(_0x30402f,null));};exports[_0xd703('0x6f')]=function(_0x8e2584,_0x3602c2){return db[_0xd703('0x1e')][_0xd703('0x38')]({'where':{'id':_0x8e2584[_0xd703('0x28')]['id']}})[_0xd703('0x13')](handleEntityNotFound(_0x3602c2,null))[_0xd703('0x13')](function(_0x17c183){if(_0x17c183){return _0x17c183[_0xd703('0x6f')](_0x8e2584[_0xd703('0x2a')][_0xd703('0x53')])['then'](function(){if(_['isArray'](_0x8e2584[_0xd703('0x2a')]['ids'])){for(var _0x1afee5=0x0;_0x1afee5<_0x8e2584[_0xd703('0x2a')][_0xd703('0x53')][_0xd703('0x2e')];_0x1afee5+=0x1){socket[_0xd703('0x5d')](_0xd703('0x6c'),{'UserId':Number(_0x8e2584[_0xd703('0x2a')][_0xd703('0x53')][_0x1afee5]),'ChatQueueId':Number(_0x8e2584['params']['id'])});}}else{socket[_0xd703('0x5d')](_0xd703('0x6c'),{'UserId':Number(_0x8e2584[_0xd703('0x2a')][_0xd703('0x53')]),'ChatQueueId':Number(_0x8e2584[_0xd703('0x28')]['id'])});}});}})[_0xd703('0x13')](respondWithStatusCode(_0x3602c2,null))[_0xd703('0x32')](handleError(_0x3602c2,null));};exports['getAgents']=function(_0x3d7bb6,_0x4bad90){var _0x1a5942={};var _0x2d7df4={};var _0x3e654b;var _0x1a87af;return db['ChatQueue']['findOne']({'where':{'id':_0x3d7bb6[_0xd703('0x28')]['id']}})['then'](handleEntityNotFound(_0x4bad90,null))[_0xd703('0x13')](function(_0x379806){if(_0x379806){_0x3e654b=_0x379806;_0x2d7df4['model']=_['keys'](db[_0xd703('0x46')][_0xd703('0x1f')]);_0x2d7df4[_0xd703('0x2a')]=_['keys'](_0x3d7bb6[_0xd703('0x2a')]);_0x2d7df4[_0xd703('0x3f')]=_[_0xd703('0x2b')](_0x2d7df4[_0xd703('0x2f')],_0x2d7df4[_0xd703('0x2a')]);_0x1a5942[_0xd703('0x2c')]=_[_0xd703('0x2b')](_0x2d7df4[_0xd703('0x2f')],qs[_0xd703('0x2d')](_0x3d7bb6[_0xd703('0x2a')]['fields']));_0x1a5942[_0xd703('0x2c')]=_0x1a5942[_0xd703('0x2c')][_0xd703('0x2e')]?_0x1a5942[_0xd703('0x2c')]:_0x2d7df4[_0xd703('0x2f')];_0x1a5942[_0xd703('0x41')]=qs[_0xd703('0x42')](_0x3d7bb6[_0xd703('0x2a')]['sort']);_0x1a5942['where']=qs[_0xd703('0x3f')](_[_0xd703('0x43')](_0x3d7bb6['query'],_0x2d7df4[_0xd703('0x3f')]));if(_0x3d7bb6['query'][_0xd703('0x44')]){_0x1a5942[_0xd703('0x23')]=_[_0xd703('0x31')](_0x1a5942[_0xd703('0x23')],{'$or':_[_0xd703('0x1d')](_0x1a5942[_0xd703('0x2c')],function(_0x5e4427){var _0x37bccb={};_0x37bccb[_0x5e4427]={'$like':'%'+_0x3d7bb6[_0xd703('0x2a')][_0xd703('0x44')]+'%'};return _0x37bccb;})});}_0x1a5942=_[_0xd703('0x31')]({},_0x1a5942,_0x3d7bb6['options']);return _0x3e654b[_0xd703('0x70')](_0x1a5942);}})['then'](function(_0x222fe8){if(_0x222fe8){_0x1a87af=_0x222fe8[_0xd703('0x2e')];if(!_0x3d7bb6[_0xd703('0x2a')]['hasOwnProperty'](_0xd703('0x40'))){_0x1a5942[_0xd703('0xf')]=qs[_0xd703('0xf')](_0x3d7bb6['query'][_0xd703('0xf')]);_0x1a5942[_0xd703('0xc')]=qs['offset'](_0x3d7bb6['query'][_0xd703('0xc')]);}return _0x3e654b[_0xd703('0x70')](_0x1a5942);}})['then'](function(_0x261f25){if(_0x261f25){return _0x261f25?{'count':_0x1a87af,'rows':_0x261f25}:null;}})[_0xd703('0x13')](respondWithResult(_0x4bad90,null))['catch'](handleError(_0x4bad90,null));}; \ No newline at end of file +var _0x90ff=['socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','update','destroy','ChatQueues','UserProfileResource','then','error','stack','send','map','ChatQueue','rawAttributes','fieldName','type','getOptions','count','include','findAll','rows','catch','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','UserChatQueue','hasOwnProperty','nolimit','order','sort','where','pick','ChatQueueId','filter','User','UserId','chatPause','updatedAt','createdAt','name','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','removeAgents','emit','getAgents','findOne','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost'];(function(_0x5f5157,_0x365533){var _0x155157=function(_0x323347){while(--_0x323347){_0x5f5157['push'](_0x5f5157['shift']());}};_0x155157(++_0x365533);}(_0x90ff,0x1bf));var _0xf90f=function(_0x38b183,_0x162437){_0x38b183=_0x38b183-0x0;var _0x4caf6b=_0x90ff[_0x38b183];return _0x4caf6b;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require(_0xf90f('0x0'));var Redis=require(_0xf90f('0x1'));var qs=require(_0xf90f('0x2'));var logger=require('../../config/logger')(_0xf90f('0x3'));var config=require(_0xf90f('0x4'));var db=require(_0xf90f('0x5'))['db'];config['redis']=_[_0xf90f('0x6')](config[_0xf90f('0x7')],{'host':_0xf90f('0x8'),'port':0x18eb});var socket=require(_0xf90f('0x9'))(new Redis(config[_0xf90f('0x7')]));require('./chatQueue.socket')[_0xf90f('0xa')](socket);function respondWithStatusCode(_0x293106,_0x4a119a){_0x4a119a=_0x4a119a||0xcc;return function(_0x407b2e){if(_0x407b2e){return _0x293106[_0xf90f('0xb')](_0x4a119a);}return _0x293106[_0xf90f('0xc')](_0x4a119a)[_0xf90f('0xd')]();};}function respondWithResult(_0x381511,_0x4589f2){_0x4589f2=_0x4589f2||0xc8;return function(_0x338bda){if(_0x338bda){return _0x381511[_0xf90f('0xc')](_0x4589f2)[_0xf90f('0xe')](_0x338bda);}};}function respondWithFilteredResult(_0x156c36,_0x44afc0){return function(_0x5f1525){if(_0x5f1525){var _0x1e79d3=typeof _0x44afc0[_0xf90f('0xf')]===_0xf90f('0x10')&&typeof _0x44afc0['limit']===_0xf90f('0x10');var _0x43b42c=_0x5f1525['count'];var _0x244379=_0x1e79d3?0x0:_0x44afc0[_0xf90f('0xf')];var _0x1dc03c=_0x1e79d3?_0x5f1525['count']:_0x44afc0[_0xf90f('0xf')]+_0x44afc0[_0xf90f('0x11')];var _0x4ca5e4;if(_0x1dc03c>=_0x43b42c){_0x1dc03c=_0x43b42c;_0x4ca5e4=0xc8;}else{_0x4ca5e4=0xce;}_0x156c36[_0xf90f('0xc')](_0x4ca5e4);return _0x156c36['set']('Content-Range',_0x244379+'-'+_0x1dc03c+'/'+_0x43b42c)[_0xf90f('0xe')](_0x5f1525);}return null;};}function saveUpdates(_0x126a32){return function(_0x5de73b){if(_0x5de73b){return _0x5de73b[_0xf90f('0x12')](_0x126a32)['then'](function(_0x4eabbc){return _0x4eabbc;});}return null;};}function removeEntity(_0x50cc07){return function(_0x97a4a3){if(_0x97a4a3){return _0x97a4a3[_0xf90f('0x13')]()['then'](function(){var _0x20a69b=_0x97a4a3['get']({'plain':!![]});var _0x5b5e84=_0xf90f('0x14');return db[_0xf90f('0x15')][_0xf90f('0x13')]({'where':{'type':_0x5b5e84,'resourceId':_0x20a69b['id']}})[_0xf90f('0x16')](function(){return _0x97a4a3;});})['then'](function(){_0x50cc07['status'](0xcc)[_0xf90f('0xd')]();});}};}function handleEntityNotFound(_0x12b70c){return function(_0x1fe40a){if(!_0x1fe40a){_0x12b70c['sendStatus'](0x194);}return _0x1fe40a;};}function handleError(_0x10b0d3,_0x3faa7b){_0x3faa7b=_0x3faa7b||0x1f4;return function(_0x134299){logger[_0xf90f('0x17')](_0x134299[_0xf90f('0x18')]);if(_0x134299['name']){delete _0x134299['name'];}_0x10b0d3[_0xf90f('0xc')](_0x3faa7b)[_0xf90f('0x19')](_0x134299);};}exports['index']=function(_0x35d12c,_0x34425e){var _0x5ec8a9={};var _0x36af88={'count':0x0,'rows':[]};var _0x51c60f=_[_0xf90f('0x1a')](db[_0xf90f('0x1b')][_0xf90f('0x1c')],function(_0x596cc0){return{'name':_0x596cc0[_0xf90f('0x1d')],'type':_0x596cc0[_0xf90f('0x1e')]['key']};});_0x5ec8a9=qs[_0xf90f('0x1f')](_0x51c60f,_0x35d12c);var _0x53497a={'where':_0x5ec8a9['where']};return db['ChatQueue']['count'](_0x53497a)['then'](function(_0x15cfd8){_0x36af88[_0xf90f('0x20')]=_0x15cfd8;_0x5ec8a9[_0xf90f('0x21')]=qs[_0xf90f('0x21')](_0x35d12c['query']);return db[_0xf90f('0x1b')][_0xf90f('0x22')](_0x5ec8a9);})[_0xf90f('0x16')](function(_0x4cd9b6){_0x36af88[_0xf90f('0x23')]=_0x4cd9b6;return _0x36af88;})['then'](respondWithFilteredResult(_0x34425e,_0x5ec8a9))[_0xf90f('0x24')](handleError(_0x34425e,null));};exports['show']=function(_0x361430,_0x18aae8){var _0x21e931={'raw':!![],'where':{'id':_0x361430[_0xf90f('0x25')]['id']}},_0x13ad40={};_0x13ad40[_0xf90f('0x26')]=_[_0xf90f('0x27')](db[_0xf90f('0x1b')]['rawAttributes']);_0x13ad40[_0xf90f('0x28')]=_[_0xf90f('0x27')](_0x361430[_0xf90f('0x28')]);_0x13ad40[_0xf90f('0x29')]=_[_0xf90f('0x2a')](_0x13ad40['model'],_0x13ad40[_0xf90f('0x28')]);_0x21e931[_0xf90f('0x2b')]=_[_0xf90f('0x2a')](_0x13ad40[_0xf90f('0x26')],qs['fields'](_0x361430[_0xf90f('0x28')][_0xf90f('0x2c')]));_0x21e931[_0xf90f('0x2b')]=_0x21e931[_0xf90f('0x2b')][_0xf90f('0x2d')]?_0x21e931[_0xf90f('0x2b')]:_0x13ad40['model'];if(_0x361430[_0xf90f('0x28')][_0xf90f('0x2e')]){_0x21e931[_0xf90f('0x21')]=[{'all':!![]}];}_0x21e931=_[_0xf90f('0x2f')]({},_0x21e931,_0x361430[_0xf90f('0x30')]);return db[_0xf90f('0x1b')][_0xf90f('0x31')](_0x21e931)[_0xf90f('0x16')](handleEntityNotFound(_0x18aae8,null))['then'](respondWithResult(_0x18aae8,null))[_0xf90f('0x24')](handleError(_0x18aae8,null));};exports['create']=function(_0xa11271,_0x59237b){return db[_0xf90f('0x1b')][_0xf90f('0x32')](_0xa11271['body'],{})[_0xf90f('0x16')](function(_0xf73424){var _0x4fa013=_0xa11271[_0xf90f('0x33')][_0xf90f('0x34')]({'plain':!![]});if(!_0x4fa013)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fa013['role']===_0xf90f('0x33')){var _0x3a451f=_0xf73424[_0xf90f('0x34')]({'plain':!![]});var _0x4da451='ChatQueues';return db[_0xf90f('0x35')]['find']({'where':{'name':_0x4da451,'userProfileId':_0x4fa013['userProfileId']},'raw':!![]})[_0xf90f('0x16')](function(_0x12ea6f){if(_0x12ea6f&&_0x12ea6f[_0xf90f('0x36')]===0x0){return db['UserProfileResource'][_0xf90f('0x32')]({'name':_0x3a451f['name'],'resourceId':_0x3a451f['id'],'type':_0x12ea6f['name'],'sectionId':_0x12ea6f['id']},{})[_0xf90f('0x16')](function(){return _0xf73424;});}else{return _0xf73424;}})[_0xf90f('0x24')](function(_0x4b88ba){logger[_0xf90f('0x17')](_0xf90f('0x37'),_0x4b88ba);throw _0x4b88ba;});}return _0xf73424;})[_0xf90f('0x16')](respondWithResult(_0x59237b,0xc9))[_0xf90f('0x24')](handleError(_0x59237b,null));};exports[_0xf90f('0x12')]=function(_0x505608,_0x526e1a){if(_0x505608[_0xf90f('0x38')]['id']){delete _0x505608['body']['id'];}return db[_0xf90f('0x1b')][_0xf90f('0x31')]({'where':{'id':_0x505608['params']['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x526e1a,null))['then'](saveUpdates(_0x505608['body'],null))[_0xf90f('0x16')](respondWithResult(_0x526e1a,null))[_0xf90f('0x24')](handleError(_0x526e1a,null));};exports[_0xf90f('0x13')]=function(_0x31bcdd,_0x1aa3ab){return db[_0xf90f('0x1b')][_0xf90f('0x31')]({'where':{'id':_0x31bcdd[_0xf90f('0x25')]['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x1aa3ab,null))[_0xf90f('0x16')](removeEntity(_0x1aa3ab,null))[_0xf90f('0x24')](handleError(_0x1aa3ab,null));};exports['describe']=function(_0x460505,_0x569937){return db[_0xf90f('0x1b')][_0xf90f('0x39')]()[_0xf90f('0x16')](respondWithResult(_0x569937,null))[_0xf90f('0x24')](handleError(_0x569937,null));};exports['getMembers']=function(_0x24af74,_0x474f22){var _0x4e0043={'raw':!![],'where':{}},_0x67bb2d={},_0x572ecc;return db[_0xf90f('0x1b')]['findOne']({'where':{'id':_0x24af74[_0xf90f('0x25')]['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x474f22,null))[_0xf90f('0x16')](function(_0x3aeacd){if(_0x3aeacd){_0x572ecc=_0x3aeacd[_0xf90f('0x34')]({'plain':!![]});_0x67bb2d[_0xf90f('0x26')]=_['keys'](db[_0xf90f('0x3a')][_0xf90f('0x1c')]);_0x67bb2d[_0xf90f('0x28')]=_[_0xf90f('0x27')](_0x24af74[_0xf90f('0x28')]);_0x67bb2d[_0xf90f('0x29')]=_['intersection'](_0x67bb2d[_0xf90f('0x26')],_0x67bb2d[_0xf90f('0x28')]);_0x4e0043['attributes']=_[_0xf90f('0x2a')](_0x67bb2d[_0xf90f('0x26')],qs['fields'](_0x24af74[_0xf90f('0x28')][_0xf90f('0x2c')]));_0x4e0043[_0xf90f('0x2b')]=_0x4e0043['attributes']['length']?_0x4e0043[_0xf90f('0x2b')]:_0x67bb2d[_0xf90f('0x26')];if(!_0x24af74[_0xf90f('0x28')][_0xf90f('0x3b')](_0xf90f('0x3c'))){_0x4e0043[_0xf90f('0x11')]=qs[_0xf90f('0x11')](_0x24af74[_0xf90f('0x28')]['limit']);_0x4e0043[_0xf90f('0xf')]=qs[_0xf90f('0xf')](_0x24af74[_0xf90f('0x28')][_0xf90f('0xf')]);}_0x4e0043[_0xf90f('0x3d')]=qs[_0xf90f('0x3e')](_0x24af74[_0xf90f('0x28')][_0xf90f('0x3e')]);_0x4e0043[_0xf90f('0x3f')]=qs[_0xf90f('0x29')](_[_0xf90f('0x40')](_0x24af74[_0xf90f('0x28')],_0x67bb2d[_0xf90f('0x29')]));_0x4e0043[_0xf90f('0x3f')][_0xf90f('0x41')]=_0x3aeacd['id'];if(_0x24af74[_0xf90f('0x28')]['filter']){_0x4e0043[_0xf90f('0x3f')]=_[_0xf90f('0x2f')](_0x4e0043[_0xf90f('0x3f')],{'$or':_['map'](_0x4e0043['attributes'],function(_0x377479){var _0xa56af9={};_0xa56af9[_0x377479]={'$like':'%'+_0x24af74['query'][_0xf90f('0x42')]+'%'};return _0xa56af9;})});}_0x4e0043=_[_0xf90f('0x2f')]({},_0x4e0043,_0x24af74[_0xf90f('0x30')]);return db['UserChatQueue'][_0xf90f('0x22')](_0x4e0043);}})[_0xf90f('0x16')](function(_0x24b411){if(_0x24b411){return db[_0xf90f('0x43')]['findAndCountAll']({'where':{'id':_['map'](_0x24b411,_0xf90f('0x44')),'role':'agent'},'attributes':['id','name',_0xf90f('0x45'),_0xf90f('0x46'),_0xf90f('0x47')]});}})[_0xf90f('0x16')](function(_0xf0a8af){if(_0xf0a8af){return{'count':_0xf0a8af[_0xf90f('0x20')],'rows':_[_0xf90f('0x1a')](_0xf0a8af[_0xf90f('0x23')],function(_0x5787a7){return{'membername':_0x5787a7[_0xf90f('0x48')],'UserId':_0x5787a7['id'],'queue_name':_0x572ecc[_0xf90f('0x48')],'ChatQueueId':_0x572ecc['id'],'interface':util[_0xf90f('0x49')](_0xf90f('0x4a'),_0xf90f('0x4b'),_0x5787a7[_0xf90f('0x48')]),'penalty':0x0,'paused':_0x5787a7['chatPause'],'createdAt':_0x5787a7[_0xf90f('0x47')],'updatedAt':_0x5787a7[_0xf90f('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf90f('0x16')](respondWithFilteredResult(_0x474f22,_0x4e0043))['catch'](handleError(_0x474f22,null));};exports[_0xf90f('0x4c')]=function(_0x22914f,_0x1c7a2f){var _0x428805={};var _0x267a80={};var _0x33ec76;var _0x47c791;return db[_0xf90f('0x1b')]['findOne']({'where':{'id':_0x22914f[_0xf90f('0x25')]['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x1c7a2f,null))[_0xf90f('0x16')](function(_0x5d6112){if(_0x5d6112){_0x33ec76=_0x5d6112;_0x267a80[_0xf90f('0x26')]=_['keys'](db[_0xf90f('0x4d')][_0xf90f('0x1c')]);_0x267a80['query']=_['keys'](_0x22914f[_0xf90f('0x28')]);_0x267a80[_0xf90f('0x29')]=_[_0xf90f('0x2a')](_0x267a80[_0xf90f('0x26')],_0x267a80[_0xf90f('0x28')]);_0x428805[_0xf90f('0x2b')]=_[_0xf90f('0x2a')](_0x267a80[_0xf90f('0x26')],qs[_0xf90f('0x2c')](_0x22914f[_0xf90f('0x28')][_0xf90f('0x2c')]));_0x428805['attributes']=_0x428805[_0xf90f('0x2b')]['length']?_0x428805[_0xf90f('0x2b')]:_0x267a80[_0xf90f('0x26')];_0x428805['order']=qs[_0xf90f('0x3e')](_0x22914f[_0xf90f('0x28')][_0xf90f('0x3e')]);_0x428805['where']=qs[_0xf90f('0x29')](_[_0xf90f('0x40')](_0x22914f[_0xf90f('0x28')],_0x267a80[_0xf90f('0x29')]));if(_0x22914f[_0xf90f('0x28')][_0xf90f('0x42')]){_0x428805[_0xf90f('0x3f')]=_[_0xf90f('0x2f')](_0x428805[_0xf90f('0x3f')],{'$or':_[_0xf90f('0x1a')](_0x428805[_0xf90f('0x2b')],function(_0x312373){var _0x33140f={};_0x33140f[_0x312373]={'$like':'%'+_0x22914f[_0xf90f('0x28')][_0xf90f('0x42')]+'%'};return _0x33140f;})});}_0x428805=_[_0xf90f('0x2f')]({},_0x428805,_0x22914f[_0xf90f('0x30')]);return _0x33ec76[_0xf90f('0x4c')](_0x428805);}})[_0xf90f('0x16')](function(_0x31003f){if(_0x31003f){_0x47c791=_0x31003f['length'];if(!_0x22914f[_0xf90f('0x28')][_0xf90f('0x3b')]('nolimit')){_0x428805['limit']=qs[_0xf90f('0x11')](_0x22914f[_0xf90f('0x28')][_0xf90f('0x11')]);_0x428805[_0xf90f('0xf')]=qs[_0xf90f('0xf')](_0x22914f['query']['offset']);}return _0x33ec76['getTeams'](_0x428805);}})['then'](function(_0x56e8ff){if(_0x56e8ff){return _0x56e8ff?{'count':_0x47c791,'rows':_0x56e8ff}:null;}})['then'](respondWithResult(_0x1c7a2f,null))[_0xf90f('0x24')](handleError(_0x1c7a2f,null));};exports[_0xf90f('0x4e')]=function(_0xa3d01a,_0x2669fb){var _0x36d4ae=_0xa3d01a[_0xf90f('0x38')][_0xf90f('0x4f')];return db[_0xf90f('0x4d')][_0xf90f('0x22')]({'where':{'id':_0x36d4ae},'attributes':['id'],'include':[{'model':db[_0xf90f('0x43')],'as':'Agents','attributes':['id','name',_0xf90f('0x50'),'voicePause',_0xf90f('0x51')],'raw':!![]}]})[_0xf90f('0x16')](function(_0x470aec){if(_0x470aec){var _0x556cb7=_[_0xf90f('0x52')](_0x470aec,function(_0xb7478a){var _0x508442=_0xb7478a[_0xf90f('0x34')]({'plain':!![]});return _0x508442['Agents'];});return db['ChatQueue'][_0xf90f('0x31')]({'where':{'id':_0xa3d01a[_0xf90f('0x25')]['id']}})['then'](function(_0x313dd5){return db[_0xf90f('0x53')][_0xf90f('0x54')](function(_0x4df2fb){return _0x313dd5[_0xf90f('0x4e')](_0x36d4ae,{'transaction':_0x4df2fb})['then'](function(){return BPromise[_0xf90f('0x55')](_0x556cb7,function(_0x3277f1){return db['UserChatQueue'][_0xf90f('0x56')]({'where':{'UserId':_0x3277f1['id'],'ChatQueueId':_0xa3d01a[_0xf90f('0x25')]['id']},'transaction':_0x4df2fb});});})[_0xf90f('0x16')](function(){_0x556cb7[_0xf90f('0x57')](function(_0x326c62){socket['emit'](_0xf90f('0x58'),{'UserId':_0x326c62['id'],'ChatQueueId':_0x313dd5['id']});});});});});}})['then'](respondWithStatusCode(_0x2669fb,null))['catch'](handleError(_0x2669fb,null));};exports[_0xf90f('0x59')]=function(_0x53f777,_0x466dcd){return db['Team'][_0xf90f('0x22')]({'where':{'id':_0x53f777[_0xf90f('0x28')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf90f('0x43')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf90f('0x16')](handleEntityNotFound(_0x466dcd,null))[_0xf90f('0x16')](function(_0x40fe60){var _0x1d343e=_['map'](_0x40fe60,'id');var _0x2b056d=[];var _0x402907=[];var _0x3d6600=squel['select']();_0x3d6600[_0xf90f('0x5a')]('tq.TeamId')[_0xf90f('0x5b')](_0xf90f('0x5c'),'tq')[_0xf90f('0x5d')](_0xf90f('0x5e'),'ut',_0xf90f('0x5f'))['where']('ChatQueueId\x20=\x20?',_0x53f777[_0xf90f('0x25')]['id']);for(var _0x282b64=0x0;_0x282b64<_0x40fe60[_0xf90f('0x2d')];_0x282b64+=0x1){let _0x49ae39=_0x40fe60[_0x282b64];for(var _0xbf2b4b=0x0;_0xbf2b4b<_0x49ae39[_0xf90f('0x60')]['length'];_0xbf2b4b+=0x1){let _0x5b0ba0=_0x49ae39[_0xf90f('0x60')][_0xbf2b4b];var _0x5b5416=_0x3d6600['clone']();_0x5b5416[_0xf90f('0x3f')]('ut.UserId\x20=\x20?',_0x5b0ba0['id']);_0x402907[_0xf90f('0x61')](db['sequelize'][_0xf90f('0x28')](_0x5b5416[_0xf90f('0x62')](),{'type':db[_0xf90f('0x53')]['QueryTypes'][_0xf90f('0x63')]})[_0xf90f('0x16')](function(_0xe5de64){if(_0xe5de64[_0xf90f('0x2d')]===0x1){return _0x5b0ba0['id'];}else{var _0x4a14d0=_[_0xf90f('0x64')](_[_0xf90f('0x1a')](_0xe5de64,_0xf90f('0x65')),function(_0x32168b){return _[_0xf90f('0x66')](_0x1d343e,_0x32168b);});if(_0x4a14d0){return _0x5b0ba0['id'];}}}));}}return BPromise[_0xf90f('0x67')](_0x402907)['then'](function(_0x49d4d6){_0x2b056d=_(_0x2b056d)[_0xf90f('0x68')](_0x49d4d6)[_0xf90f('0x69')]()[_0xf90f('0x6a')]();return db[_0xf90f('0x1b')][_0xf90f('0x31')]({'where':{'id':_0x53f777['params']['id']}})[_0xf90f('0x16')](function(_0x35e344){return db['sequelize'][_0xf90f('0x54')](function(_0x1d7016){return _0x35e344[_0xf90f('0x59')](_0x53f777['query']['ids'],{'transaction':_0x1d7016})[_0xf90f('0x16')](function(){if(!_[_0xf90f('0x6b')](_0x2b056d)){return _0x35e344['removeAgents'](_0x2b056d,{'transaction':_0x1d7016});}})[_0xf90f('0x16')](function(){_0x2b056d['forEach'](function(_0x5a36c9){socket['emit'](_0xf90f('0x6c'),{'UserId':_0x5a36c9,'ChatQueueId':_0x35e344['id']});});});});});});})[_0xf90f('0x16')](respondWithStatusCode(_0x466dcd,null))[_0xf90f('0x24')](handleError(_0x466dcd,null));};exports[_0xf90f('0x6d')]=function(_0x1dc45c,_0x2445a6){return db['ChatQueue'][_0xf90f('0x31')]({'where':{'id':_0x1dc45c[_0xf90f('0x25')]['id']}})['then'](handleEntityNotFound(_0x2445a6,null))[_0xf90f('0x16')](function(_0x5439d2){if(_0x5439d2){return _0x5439d2[_0xf90f('0x6d')](_0x1dc45c[_0xf90f('0x38')][_0xf90f('0x4f')],_['omit'](_0x1dc45c['body'],[_0xf90f('0x4f'),'id'])||{})['spread'](function(_0x54402b){for(var _0x26f3bc=0x0;_0x26f3bc<_0x1dc45c[_0xf90f('0x38')]['ids'][_0xf90f('0x2d')];_0x26f3bc+=0x1){socket['emit'](_0xf90f('0x58'),{'UserId':Number(_0x1dc45c[_0xf90f('0x38')][_0xf90f('0x4f')][_0x26f3bc]),'ChatQueueId':Number(_0x1dc45c[_0xf90f('0x25')]['id'])});}return _0x54402b;});}})['then'](respondWithResult(_0x2445a6,null))[_0xf90f('0x24')](handleError(_0x2445a6,null));};exports[_0xf90f('0x6e')]=function(_0x97a19c,_0x2c129e){return db[_0xf90f('0x1b')][_0xf90f('0x31')]({'where':{'id':_0x97a19c[_0xf90f('0x25')]['id']}})[_0xf90f('0x16')](handleEntityNotFound(_0x2c129e,null))[_0xf90f('0x16')](function(_0x2e1c67){if(_0x2e1c67){return _0x2e1c67[_0xf90f('0x6e')](_0x97a19c[_0xf90f('0x28')][_0xf90f('0x4f')])[_0xf90f('0x16')](function(){if(_['isArray'](_0x97a19c['query'][_0xf90f('0x4f')])){for(var _0x31431f=0x0;_0x31431f<_0x97a19c['query'][_0xf90f('0x4f')][_0xf90f('0x2d')];_0x31431f+=0x1){socket[_0xf90f('0x6f')](_0xf90f('0x6c'),{'UserId':Number(_0x97a19c['query'][_0xf90f('0x4f')][_0x31431f]),'ChatQueueId':Number(_0x97a19c[_0xf90f('0x25')]['id'])});}}else{socket[_0xf90f('0x6f')](_0xf90f('0x6c'),{'UserId':Number(_0x97a19c[_0xf90f('0x28')][_0xf90f('0x4f')]),'ChatQueueId':Number(_0x97a19c[_0xf90f('0x25')]['id'])});}});}})[_0xf90f('0x16')](respondWithStatusCode(_0x2c129e,null))[_0xf90f('0x24')](handleError(_0x2c129e,null));};exports[_0xf90f('0x70')]=function(_0x311cb9,_0x53a64f){var _0x337bdf={};var _0x4a9293={};var _0x240b35;var _0x1d048f;return db[_0xf90f('0x1b')][_0xf90f('0x71')]({'where':{'id':_0x311cb9[_0xf90f('0x25')]['id']}})['then'](handleEntityNotFound(_0x53a64f,null))['then'](function(_0x30922d){if(_0x30922d){_0x240b35=_0x30922d;_0x4a9293['model']=_[_0xf90f('0x27')](db['User'][_0xf90f('0x1c')]);_0x4a9293[_0xf90f('0x28')]=_[_0xf90f('0x27')](_0x311cb9[_0xf90f('0x28')]);_0x4a9293[_0xf90f('0x29')]=_[_0xf90f('0x2a')](_0x4a9293[_0xf90f('0x26')],_0x4a9293[_0xf90f('0x28')]);_0x337bdf['attributes']=_['intersection'](_0x4a9293[_0xf90f('0x26')],qs[_0xf90f('0x2c')](_0x311cb9[_0xf90f('0x28')][_0xf90f('0x2c')]));_0x337bdf[_0xf90f('0x2b')]=_0x337bdf[_0xf90f('0x2b')][_0xf90f('0x2d')]?_0x337bdf[_0xf90f('0x2b')]:_0x4a9293[_0xf90f('0x26')];_0x337bdf[_0xf90f('0x3d')]=qs['sort'](_0x311cb9[_0xf90f('0x28')]['sort']);_0x337bdf[_0xf90f('0x3f')]=qs[_0xf90f('0x29')](_[_0xf90f('0x40')](_0x311cb9['query'],_0x4a9293[_0xf90f('0x29')]));if(_0x311cb9[_0xf90f('0x28')][_0xf90f('0x42')]){_0x337bdf[_0xf90f('0x3f')]=_[_0xf90f('0x2f')](_0x337bdf[_0xf90f('0x3f')],{'$or':_[_0xf90f('0x1a')](_0x337bdf['attributes'],function(_0x11bb00){var _0x178892={};_0x178892[_0x11bb00]={'$like':'%'+_0x311cb9[_0xf90f('0x28')][_0xf90f('0x42')]+'%'};return _0x178892;})});}_0x337bdf=_[_0xf90f('0x2f')]({},_0x337bdf,_0x311cb9[_0xf90f('0x30')]);return _0x240b35[_0xf90f('0x70')](_0x337bdf);}})[_0xf90f('0x16')](function(_0x37d727){if(_0x37d727){_0x1d048f=_0x37d727[_0xf90f('0x2d')];if(!_0x311cb9[_0xf90f('0x28')][_0xf90f('0x3b')]('nolimit')){_0x337bdf['limit']=qs['limit'](_0x311cb9[_0xf90f('0x28')][_0xf90f('0x11')]);_0x337bdf[_0xf90f('0xf')]=qs['offset'](_0x311cb9[_0xf90f('0x28')][_0xf90f('0xf')]);}return _0x240b35[_0xf90f('0x70')](_0x337bdf);}})[_0xf90f('0x16')](function(_0x2d9773){if(_0x2d9773){return _0x2d9773?{'count':_0x1d048f,'rows':_0x2d9773}:null;}})['then'](respondWithResult(_0x53a64f,null))[_0xf90f('0x24')](handleError(_0x53a64f,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 10ef9d7..538d476 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 _0x5e4c=['update','remove','emit','hook','exports','../../mysqldb','ChatQueue','save'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x5e4c,0x95));var _0xc5e4=function(_0x3bb445,_0x429745){_0x3bb445=_0x3bb445-0x0;var _0x5b520f=_0x5e4c[_0x3bb445];return _0x5b520f;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xc5e4('0x0'))['db'][_0xc5e4('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc5e4('0x2'),'afterUpdate':_0xc5e4('0x3'),'afterDestroy':_0xc5e4('0x4')};function emitEvent(_0x113467){return function(_0x2dc992,_0x458e00,_0x37afc2){ChatQueueEvents[_0xc5e4('0x5')](_0x113467+':'+_0x2dc992['id'],_0x2dc992);ChatQueueEvents['emit'](_0x113467,_0x2dc992);_0x37afc2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xc5e4('0x6')](e,emitEvent(event));}}module[_0xc5e4('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0xe524=['../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x23aadf,_0x34eba6){var _0x2f13fd=function(_0x2ee75b){while(--_0x2ee75b){_0x23aadf['push'](_0x23aadf['shift']());}};_0x2f13fd(++_0x34eba6);}(_0xe524,0x1d8));var _0x4e52=function(_0x5376f6,_0x12646a){_0x5376f6=_0x5376f6-0x0;var _0x4a0325=_0xe524[_0x5376f6];return _0x4a0325;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4e52('0x0'))['db'][_0x4e52('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4e52('0x2')](0x0);var events={'afterCreate':_0x4e52('0x3'),'afterUpdate':_0x4e52('0x4'),'afterDestroy':'remove'};function emitEvent(_0x23bee6){return function(_0xfb6ebb,_0x8c5913,_0x1d896d){ChatQueueEvents[_0x4e52('0x5')](_0x23bee6+':'+_0xfb6ebb['id'],_0xfb6ebb);ChatQueueEvents[_0x4e52('0x5')](_0x23bee6,_0xfb6ebb);_0x1d896d(null);};}for(var e in events){if(events[_0x4e52('0x6')](e)){var event=events[e];ChatQueue[_0x4e52('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index fc1bfb5..61f425c 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 _0xc58f=['moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xc58f,0xb2));var _0xfc58=function(_0x28e28b,_0x340c0f){_0x28e28b=_0x28e28b-0x0;var _0x40a4e1=_0xc58f[_0x28e28b];return _0x40a4e1;};'use strict';var _=require(_0xfc58('0x0'));var util=require(_0xfc58('0x1'));var logger=require(_0xfc58('0x2'))(_0xfc58('0x3'));var moment=require(_0xfc58('0x4'));var BPromise=require(_0xfc58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc58('0x6'));var rimraf=require(_0xfc58('0x7'));var config=require(_0xfc58('0x8'));var attributes=require(_0xfc58('0x9'));module[_0xfc58('0xa')]=function(_0x4274f1,_0x52db8b){return _0x4274f1[_0xfc58('0xb')](_0xfc58('0xc'),attributes,{'tableName':_0xfc58('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae5b=['./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xf39e84,_0x825c93){var _0x58e41f=function(_0x3f2b03){while(--_0x3f2b03){_0xf39e84['push'](_0xf39e84['shift']());}};_0x58e41f(++_0x825c93);}(_0xae5b,0x1cc));var _0xbae5=function(_0x3c3690,_0x457ae0){_0x3c3690=_0x3c3690-0x0;var _0xd962b6=_0xae5b[_0x3c3690];return _0xd962b6;};'use strict';var _=require(_0xbae5('0x0'));var util=require(_0xbae5('0x1'));var logger=require(_0xbae5('0x2'))('api');var moment=require(_0xbae5('0x3'));var BPromise=require(_0xbae5('0x4'));var rp=require(_0xbae5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbae5('0x6'));var config=require(_0xbae5('0x7'));var attributes=require(_0xbae5('0x8'));module[_0xbae5('0x9')]=function(_0x29df14,_0x47b380){return _0x29df14[_0xbae5('0xa')](_0xbae5('0xb'),attributes,{'tableName':'chat_queues','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 0cfd7a6..1d024b0 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 _0xb0d4=['redis','defaults','localhost','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','model','map','ShowChatQueue','find','where','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x32d9fe,_0x213473){var _0x1b8f8e=function(_0x39c16c){while(--_0x39c16c){_0x32d9fe['push'](_0x32d9fe['shift']());}};_0x1b8f8e(++_0x213473);}(_0xb0d4,0x1e1));var _0x4b0d=function(_0xd2b2de,_0xdd507a){_0xd2b2de=_0xd2b2de-0x0;var _0x5026a0=_0xb0d4[_0xd2b2de];return _0x5026a0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b0d('0x0'));var BPromise=require(_0x4b0d('0x1'));var rs=require(_0x4b0d('0x2'));var fs=require('fs');var Redis=require(_0x4b0d('0x3'));var db=require(_0x4b0d('0x4'))['db'];var utils=require(_0x4b0d('0x5'));var logger=require(_0x4b0d('0x6'))('rpc');var config=require(_0x4b0d('0x7'));var jayson=require(_0x4b0d('0x8'));var client=jayson[_0x4b0d('0x9')][_0x4b0d('0xa')]({'port':0x232a});config[_0x4b0d('0xb')]=_[_0x4b0d('0xc')](config[_0x4b0d('0xb')],{'host':_0x4b0d('0xd'),'port':0x18eb});var socket=require(_0x4b0d('0xe'))(new Redis(config[_0x4b0d('0xb')]));require('./chatQueue.socket')[_0x4b0d('0xf')](socket);function respondWithRpcPromise(_0x5f4d47,_0x148a89,_0x3743d6){return new BPromise(function(_0x5e851f,_0x318b69){return client[_0x4b0d('0x10')](_0x5f4d47,_0x3743d6)['then'](function(_0xcf4bf5){logger[_0x4b0d('0x11')](_0x4b0d('0x12'),_0x148a89,_0x4b0d('0x13'));logger[_0x4b0d('0x14')](_0x4b0d('0x15'),_0x148a89,'request\x20sent',JSON[_0x4b0d('0x16')](_0xcf4bf5));if(_0xcf4bf5[_0x4b0d('0x17')]){if(_0xcf4bf5['error'][_0x4b0d('0x18')]===0x1f4){logger[_0x4b0d('0x17')](_0x4b0d('0x12'),_0x148a89,_0xcf4bf5[_0x4b0d('0x17')][_0x4b0d('0x19')]);return _0x318b69(_0xcf4bf5['error']['message']);}logger['error'](_0x4b0d('0x12'),_0x148a89,_0xcf4bf5['error'][_0x4b0d('0x19')]);return _0x5e851f(_0xcf4bf5[_0x4b0d('0x17')][_0x4b0d('0x19')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x148a89,_0x4b0d('0x13'));_0x5e851f(_0xcf4bf5[_0x4b0d('0x1a')]['message']);}})[_0x4b0d('0x1b')](function(_0x487ab4){logger[_0x4b0d('0x17')](_0x4b0d('0x12'),_0x148a89,_0x487ab4);_0x318b69(_0x487ab4);});});}exports[_0x4b0d('0x1c')]=function(_0x2bd70f){var _0x34154f=this;return new Promise(function(_0x136eef,_0x227c25){return db[_0x4b0d('0x1d')][_0x4b0d('0x1e')]({'raw':_0x2bd70f[_0x4b0d('0x1f')]?_0x2bd70f[_0x4b0d('0x1f')][_0x4b0d('0x20')]===undefined?!![]:![]:!![],'where':_0x2bd70f['options']?_0x2bd70f['options']['where']||null:null,'attributes':_0x2bd70f[_0x4b0d('0x1f')]?_0x2bd70f[_0x4b0d('0x1f')][_0x4b0d('0x21')]||null:null,'limit':_0x2bd70f[_0x4b0d('0x1f')]?_0x2bd70f[_0x4b0d('0x1f')]['limit']||null:null,'include':_0x2bd70f['options']?_0x2bd70f[_0x4b0d('0x1f')][_0x4b0d('0x22')]?_['map'](_0x2bd70f[_0x4b0d('0x1f')][_0x4b0d('0x22')],function(_0x168243){return{'model':db[_0x168243[_0x4b0d('0x23')]],'as':_0x168243['as'],'attributes':_0x168243['attributes'],'include':_0x168243[_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x168243['include'],function(_0x3a8ffc){return{'model':db[_0x3a8ffc[_0x4b0d('0x23')]],'as':_0x3a8ffc['as'],'attributes':_0x3a8ffc[_0x4b0d('0x21')],'include':_0x3a8ffc[_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x3a8ffc[_0x4b0d('0x22')],function(_0x1a4ca4){return{'model':db[_0x1a4ca4['model']],'as':_0x1a4ca4['as'],'attributes':_0x1a4ca4[_0x4b0d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33a570){logger[_0x4b0d('0x11')]('GetChatQueue',_0x2bd70f);logger[_0x4b0d('0x14')]('GetChatQueue',_0x2bd70f,JSON[_0x4b0d('0x16')](_0x33a570));_0x136eef(_0x33a570);})[_0x4b0d('0x1b')](function(_0x33d94b){logger[_0x4b0d('0x17')](_0x4b0d('0x1c'),_0x33d94b['message'],_0x2bd70f);_0x227c25(_0x34154f[_0x4b0d('0x17')](0x1f4,_0x33d94b[_0x4b0d('0x19')]));});});};exports[_0x4b0d('0x25')]=function(_0x451e4d){var _0x109fc6=this;return new Promise(function(_0x1e9eef,_0x4904ef){return db[_0x4b0d('0x1d')][_0x4b0d('0x26')]({'raw':_0x451e4d[_0x4b0d('0x1f')]?_0x451e4d['options'][_0x4b0d('0x20')]===undefined?!![]:![]:!![],'where':_0x451e4d[_0x4b0d('0x1f')]?_0x451e4d['options'][_0x4b0d('0x27')]||null:null,'attributes':_0x451e4d[_0x4b0d('0x1f')]?_0x451e4d[_0x4b0d('0x1f')][_0x4b0d('0x21')]||null:null,'include':_0x451e4d['options']?_0x451e4d[_0x4b0d('0x1f')][_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x451e4d['options'][_0x4b0d('0x22')],function(_0x4b9bed){return{'model':db[_0x4b9bed[_0x4b0d('0x23')]],'as':_0x4b9bed['as'],'attributes':_0x4b9bed[_0x4b0d('0x21')],'include':_0x4b9bed[_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x4b9bed[_0x4b0d('0x22')],function(_0x4cd53b){return{'model':db[_0x4cd53b[_0x4b0d('0x23')]],'as':_0x4cd53b['as'],'attributes':_0x4cd53b[_0x4b0d('0x21')],'include':_0x4cd53b[_0x4b0d('0x22')]?_[_0x4b0d('0x24')](_0x4cd53b[_0x4b0d('0x22')],function(_0x3e71e4){return{'model':db[_0x3e71e4[_0x4b0d('0x23')]],'as':_0x3e71e4['as'],'attributes':_0x3e71e4[_0x4b0d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4b0d('0x28')](function(_0x3c7c4c){logger['info'](_0x4b0d('0x25'),_0x451e4d);logger[_0x4b0d('0x14')](_0x4b0d('0x25'),_0x451e4d,JSON['stringify'](_0x3c7c4c));_0x1e9eef(_0x3c7c4c);})[_0x4b0d('0x1b')](function(_0x487be2){logger[_0x4b0d('0x17')](_0x4b0d('0x25'),_0x487be2['message'],_0x451e4d);_0x4904ef(_0x109fc6[_0x4b0d('0x17')](0x1f4,_0x487be2['message']));});});}; \ No newline at end of file +var _0x682b=['lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','debug'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x682b,0x1e1));var _0xb682=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x682b[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xb682('0x0'));var util=require(_0xb682('0x1'));var moment=require('moment');var BPromise=require(_0xb682('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb682('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb682('0x4'));var logger=require('../../config/logger')(_0xb682('0x5'));var config=require(_0xb682('0x6'));var jayson=require(_0xb682('0x7'));var client=jayson[_0xb682('0x8')]['http']({'port':0x232a});config[_0xb682('0x9')]=_[_0xb682('0xa')](config[_0xb682('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb682('0xb'))(new Redis(config[_0xb682('0x9')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x40b489,_0x5734c9,_0x25d75b){return new BPromise(function(_0x341c35,_0x29c6ff){return client[_0xb682('0xc')](_0x40b489,_0x25d75b)[_0xb682('0xd')](function(_0x36d029){logger[_0xb682('0xe')](_0xb682('0xf'),_0x5734c9,_0xb682('0x10'));logger['debug'](_0xb682('0x11'),_0x5734c9,_0xb682('0x10'),JSON[_0xb682('0x12')](_0x36d029));if(_0x36d029[_0xb682('0x13')]){if(_0x36d029[_0xb682('0x13')][_0xb682('0x14')]===0x1f4){logger[_0xb682('0x13')](_0xb682('0xf'),_0x5734c9,_0x36d029['error']['message']);return _0x29c6ff(_0x36d029[_0xb682('0x13')][_0xb682('0x15')]);}logger[_0xb682('0x13')](_0xb682('0xf'),_0x5734c9,_0x36d029[_0xb682('0x13')][_0xb682('0x15')]);return _0x341c35(_0x36d029[_0xb682('0x13')]['message']);}else{logger[_0xb682('0xe')](_0xb682('0xf'),_0x5734c9,'request\x20sent');_0x341c35(_0x36d029[_0xb682('0x16')][_0xb682('0x15')]);}})[_0xb682('0x17')](function(_0x4976ed){logger[_0xb682('0x13')](_0xb682('0xf'),_0x5734c9,_0x4976ed);_0x29c6ff(_0x4976ed);});});}exports[_0xb682('0x18')]=function(_0x4aec63){var _0x259616=this;return new Promise(function(_0xf76ab6,_0x1dc174){return db['ChatQueue'][_0xb682('0x19')]({'raw':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1b')]===undefined?!![]:![]:!![],'where':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1c')]||null:null,'attributes':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1d')]||null:null,'limit':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1e')]||null:null,'include':_0x4aec63[_0xb682('0x1a')]?_0x4aec63[_0xb682('0x1a')][_0xb682('0x1f')]?_[_0xb682('0x20')](_0x4aec63['options'][_0xb682('0x1f')],function(_0x427cfa){return{'model':db[_0x427cfa[_0xb682('0x21')]],'as':_0x427cfa['as'],'attributes':_0x427cfa['attributes'],'include':_0x427cfa['include']?_[_0xb682('0x20')](_0x427cfa['include'],function(_0x2a40dc){return{'model':db[_0x2a40dc[_0xb682('0x21')]],'as':_0x2a40dc['as'],'attributes':_0x2a40dc[_0xb682('0x1d')],'include':_0x2a40dc[_0xb682('0x1f')]?_[_0xb682('0x20')](_0x2a40dc[_0xb682('0x1f')],function(_0x2dc8e4){return{'model':db[_0x2dc8e4['model']],'as':_0x2dc8e4['as'],'attributes':_0x2dc8e4['attributes']};}):[]};}):[]};}):[]:[]})[_0xb682('0xd')](function(_0x1948ee){logger[_0xb682('0xe')]('GetChatQueue',_0x4aec63);logger['debug'](_0xb682('0x18'),_0x4aec63,JSON[_0xb682('0x12')](_0x1948ee));_0xf76ab6(_0x1948ee);})[_0xb682('0x17')](function(_0x307f17){logger[_0xb682('0x13')]('GetChatQueue',_0x307f17[_0xb682('0x15')],_0x4aec63);_0x1dc174(_0x259616[_0xb682('0x13')](0x1f4,_0x307f17[_0xb682('0x15')]));});});};exports[_0xb682('0x22')]=function(_0xa1ab80){var _0x3a958b=this;return new Promise(function(_0x46d1c1,_0x402f56){return db['ChatQueue'][_0xb682('0x23')]({'raw':_0xa1ab80[_0xb682('0x1a')]?_0xa1ab80[_0xb682('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xa1ab80[_0xb682('0x1a')]?_0xa1ab80[_0xb682('0x1a')][_0xb682('0x1c')]||null:null,'attributes':_0xa1ab80[_0xb682('0x1a')]?_0xa1ab80[_0xb682('0x1a')]['attributes']||null:null,'include':_0xa1ab80[_0xb682('0x1a')]?_0xa1ab80[_0xb682('0x1a')][_0xb682('0x1f')]?_[_0xb682('0x20')](_0xa1ab80[_0xb682('0x1a')][_0xb682('0x1f')],function(_0x1ecc1c){return{'model':db[_0x1ecc1c[_0xb682('0x21')]],'as':_0x1ecc1c['as'],'attributes':_0x1ecc1c['attributes'],'include':_0x1ecc1c[_0xb682('0x1f')]?_[_0xb682('0x20')](_0x1ecc1c['include'],function(_0x38aa3b){return{'model':db[_0x38aa3b[_0xb682('0x21')]],'as':_0x38aa3b['as'],'attributes':_0x38aa3b[_0xb682('0x1d')],'include':_0x38aa3b[_0xb682('0x1f')]?_[_0xb682('0x20')](_0x38aa3b['include'],function(_0x1b7202){return{'model':db[_0x1b7202[_0xb682('0x21')]],'as':_0x1b7202['as'],'attributes':_0x1b7202[_0xb682('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb682('0xd')](function(_0x3143ca){logger[_0xb682('0xe')](_0xb682('0x22'),_0xa1ab80);logger[_0xb682('0x24')](_0xb682('0x22'),_0xa1ab80,JSON[_0xb682('0x12')](_0x3143ca));_0x46d1c1(_0x3143ca);})[_0xb682('0x17')](function(_0x3219f5){logger[_0xb682('0x13')](_0xb682('0x22'),_0x3219f5['message'],_0xa1ab80);_0x402f56(_0x3a958b[_0xb682('0x13')](0x1f4,_0x3219f5[_0xb682('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 6fdd7a8..7094436 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 _0x55e0=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x55e0,0xdc));var _0x055e=function(_0x15cfa2,_0x23b1e1){_0x15cfa2=_0x15cfa2-0x0;var _0x2b04f2=_0x55e0[_0x15cfa2];return _0x2b04f2;};'use strict';var ChatQueueEvents=require(_0x055e('0x0'));var events=[_0x055e('0x1'),_0x055e('0x2'),_0x055e('0x3')];function createListener(_0x5b82b9,_0x578882){return function(_0x3a2ee6){_0x578882[_0x055e('0x4')](_0x5b82b9,_0x3a2ee6);};}function removeListener(_0x33cd7b,_0x2773e4){return function(){ChatQueueEvents[_0x055e('0x5')](_0x33cd7b,_0x2773e4);};}exports[_0x055e('0x6')]=function(_0x490ee1){for(var _0x5239f6=0x0,_0x4384ff=events['length'];_0x5239f6<_0x4384ff;_0x5239f6++){var _0x8e7824=events[_0x5239f6];var _0x3c4cf=createListener(_0x055e('0x7')+_0x8e7824,_0x490ee1);ChatQueueEvents['on'](_0x8e7824,_0x3c4cf);}}; \ No newline at end of file +var _0xbb53=['length','./chatQueue.events','save','remove','update','emit'];(function(_0x1f8735,_0x284929){var _0x17e393=function(_0x3883b1){while(--_0x3883b1){_0x1f8735['push'](_0x1f8735['shift']());}};_0x17e393(++_0x284929);}(_0xbb53,0x121));var _0x3bb5=function(_0x1300ec,_0x3ff267){_0x1300ec=_0x1300ec-0x0;var _0x2c13c9=_0xbb53[_0x1300ec];return _0x2c13c9;};'use strict';var ChatQueueEvents=require(_0x3bb5('0x0'));var events=[_0x3bb5('0x1'),_0x3bb5('0x2'),_0x3bb5('0x3')];function createListener(_0x20c8b6,_0x226d39){return function(_0x414da7){_0x226d39[_0x3bb5('0x4')](_0x20c8b6,_0x414da7);};}function removeListener(_0x83e44b,_0x450d9e){return function(){ChatQueueEvents['removeListener'](_0x83e44b,_0x450d9e);};}exports['register']=function(_0x23f11e){for(var _0x2460b0=0x0,_0x28aa7d=events[_0x3bb5('0x5')];_0x2460b0<_0x28aa7d;_0x2460b0++){var _0x22f92f=events[_0x2460b0];var _0x480f9c=createListener('chatQueue:'+_0x22f92f,_0x23f11e);ChatQueueEvents['on'](_0x22f92f,_0x480f9c);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index fde7086..85fbaa9 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 _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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3e74,0x175));var _0x43e7=function(_0x1103df,_0x2cbaae){_0x1103df=_0x1103df-0x0;var _0x240409=_0x3e74[_0x1103df];return _0x240409;};'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 +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(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x5fc3,0xa8));var _0x35fc=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x5fc3[_0x119b3e];return _0x1169ae;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 219f772..aff91a9 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 _0xc0f9=['DATE','moment','sequelize','exports','STRING'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0xc0f9,0x119));var _0x9c0f=function(_0x1b5a05,_0x2c80de){_0x1b5a05=_0x1b5a05-0x0;var _0x347931=_0xc0f9[_0x1b5a05];return _0x347931;};'use strict';var moment=require(_0x9c0f('0x0'));var Sequelize=require(_0x9c0f('0x1'));module[_0x9c0f('0x2')]={'uniqueid':{'type':Sequelize[_0x9c0f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9c0f('0x3')]},'joinAt':{'type':Sequelize[_0x9c0f('0x4')]},'leaveAt':{'type':Sequelize[_0x9c0f('0x4')]},'acceptAt':{'type':Sequelize[_0x9c0f('0x4')]},'exitAt':{'type':Sequelize[_0x9c0f('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc7c5=['moment','sequelize','exports','STRING','DATE'];(function(_0x30a204,_0x48370f){var _0x1a1350=function(_0x5844db){while(--_0x5844db){_0x30a204['push'](_0x30a204['shift']());}};_0x1a1350(++_0x48370f);}(_0xc7c5,0x1ea));var _0x5c7c=function(_0x1b2705,_0x87e381){_0x1b2705=_0x1b2705-0x0;var _0x12301f=_0xc7c5[_0x1b2705];return _0x12301f;};'use strict';var moment=require(_0x5c7c('0x0'));var Sequelize=require(_0x5c7c('0x1'));module[_0x5c7c('0x2')]={'uniqueid':{'type':Sequelize[_0x5c7c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5c7c('0x3')]},'joinAt':{'type':Sequelize[_0x5c7c('0x4')]},'leaveAt':{'type':Sequelize[_0x5c7c('0x4')]},'acceptAt':{'type':Sequelize[_0x5c7c('0x4')]},'exitAt':{'type':Sequelize[_0x5c7c('0x4')]},'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 dd0dcaa..3761148 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 _0x7524=['../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x7524,0xce));var _0x4752=function(_0x21b77f,_0x5654b0){_0x21b77f=_0x21b77f-0x0;var _0x175712=_0x7524[_0x21b77f];return _0x175712;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4752('0x0'));var zipdir=require(_0x4752('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4752('0x2'));var moment=require(_0x4752('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4752('0x4'));var path=require('path');var sox=require(_0x4752('0x5'));var csv=require(_0x4752('0x6'));var ejs=require(_0x4752('0x7'));var fs=require('fs');var fs_extra=require(_0x4752('0x8'));var _=require(_0x4752('0x9'));var squel=require('squel');var crypto=require(_0x4752('0xa'));var jsforce=require(_0x4752('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4752('0xc'));var Papa=require(_0x4752('0xd'));var Redis=require(_0x4752('0xe'));var authService=require(_0x4752('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4752('0x10'));var hardwareService=require(_0x4752('0x11'));var logger=require(_0x4752('0x12'))(_0x4752('0x13'));var utils=require(_0x4752('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4752('0x15'));var db=require(_0x4752('0x16'))['db'];function respondWithStatusCode(_0x404e5a,_0x2724dd){_0x2724dd=_0x2724dd||0xcc;return function(_0xe6023b){if(_0xe6023b){return _0x404e5a[_0x4752('0x17')](_0x2724dd);}return _0x404e5a[_0x4752('0x18')](_0x2724dd)['end']();};}function respondWithResult(_0xefacbb,_0x479a02){_0x479a02=_0x479a02||0xc8;return function(_0x38e6bb){if(_0x38e6bb){return _0xefacbb[_0x4752('0x18')](_0x479a02)[_0x4752('0x19')](_0x38e6bb);}};}function respondWithFilteredResult(_0x17a8b8,_0x2e53e4){return function(_0x33131a){if(_0x33131a){var _0x410f88=typeof _0x2e53e4['offset']===_0x4752('0x1a')&&typeof _0x2e53e4[_0x4752('0x1b')]==='undefined';var _0x2b80b7=_0x33131a['count'];var _0x1429f4=_0x410f88?0x0:_0x2e53e4[_0x4752('0x1c')];var _0x516f3e=_0x410f88?_0x33131a[_0x4752('0x1d')]:_0x2e53e4['offset']+_0x2e53e4['limit'];var _0x285688;if(_0x516f3e>=_0x2b80b7){_0x516f3e=_0x2b80b7;_0x285688=0xc8;}else{_0x285688=0xce;}_0x17a8b8[_0x4752('0x18')](_0x285688);return _0x17a8b8[_0x4752('0x1e')](_0x4752('0x1f'),_0x1429f4+'-'+_0x516f3e+'/'+_0x2b80b7)[_0x4752('0x19')](_0x33131a);}return null;};}function patchUpdates(_0x3142b){return function(_0x55c67c){try{jsonpatch[_0x4752('0x20')](_0x55c67c,_0x3142b,!![]);}catch(_0x2d2f9e){return BPromise[_0x4752('0x21')](_0x2d2f9e);}return _0x55c67c[_0x4752('0x22')]();};}function saveUpdates(_0x3facf5,_0xaa95a4){return function(_0x593c2d){if(_0x593c2d){return _0x593c2d[_0x4752('0x23')](_0x3facf5)[_0x4752('0x24')](function(_0x54a0bd){return _0x54a0bd;});}return null;};}function removeEntity(_0x11725c,_0x403005){return function(_0x1e4e86){if(_0x1e4e86){return _0x1e4e86[_0x4752('0x25')]()[_0x4752('0x24')](function(){_0x11725c[_0x4752('0x18')](0xcc)[_0x4752('0x26')]();});}};}function handleEntityNotFound(_0x45c557,_0xca8dd1){return function(_0x2c259a){if(!_0x2c259a){_0x45c557['sendStatus'](0x194);}return _0x2c259a;};}function handleError(_0x113cd5,_0x560df8){_0x560df8=_0x560df8||0x1f4;return function(_0x4b2635){logger['error'](_0x4b2635[_0x4752('0x27')]);if(_0x4b2635[_0x4752('0x28')]){delete _0x4b2635[_0x4752('0x28')];}_0x113cd5[_0x4752('0x18')](_0x560df8)[_0x4752('0x29')](_0x4b2635);};}exports[_0x4752('0x2a')]=function(_0xd27309,_0x1dbba0){var _0x486c11={},_0x5745c0={},_0x2e0811={'count':0x0,'rows':[]};var _0x2c3d6d=_[_0x4752('0x2b')](db[_0x4752('0x2c')][_0x4752('0x2d')],function(_0xf8c5f9){return{'name':_0xf8c5f9[_0x4752('0x2e')],'type':_0xf8c5f9[_0x4752('0x2f')][_0x4752('0x30')]};});_0x5745c0[_0x4752('0x31')]=_[_0x4752('0x2b')](_0x2c3d6d,_0x4752('0x28'));_0x5745c0[_0x4752('0x32')]=_[_0x4752('0x33')](_0xd27309[_0x4752('0x32')]);_0x5745c0[_0x4752('0x34')]=_['intersection'](_0x5745c0['model'],_0x5745c0[_0x4752('0x32')]);_0x486c11[_0x4752('0x35')]=_[_0x4752('0x36')](_0x5745c0[_0x4752('0x31')],qs[_0x4752('0x37')](_0xd27309[_0x4752('0x32')][_0x4752('0x37')]));_0x486c11[_0x4752('0x35')]=_0x486c11[_0x4752('0x35')][_0x4752('0x38')]?_0x486c11['attributes']:_0x5745c0[_0x4752('0x31')];if(!_0xd27309['query'][_0x4752('0x39')](_0x4752('0x3a'))){_0x486c11[_0x4752('0x1b')]=qs[_0x4752('0x1b')](_0xd27309[_0x4752('0x32')]['limit']);_0x486c11[_0x4752('0x1c')]=qs['offset'](_0xd27309[_0x4752('0x32')][_0x4752('0x1c')]);}_0x486c11[_0x4752('0x3b')]=qs[_0x4752('0x3c')](_0xd27309[_0x4752('0x32')][_0x4752('0x3c')]);_0x486c11[_0x4752('0x3d')]=qs[_0x4752('0x34')](_[_0x4752('0x3e')](_0xd27309[_0x4752('0x32')],_0x5745c0['filters']),_0x2c3d6d);if(_0xd27309[_0x4752('0x32')][_0x4752('0x3f')]){_0x486c11[_0x4752('0x3d')]=_[_0x4752('0x40')](_0x486c11[_0x4752('0x3d')],{'$or':_[_0x4752('0x2b')](_0x2c3d6d,function(_0x317547){if(_0x317547[_0x4752('0x2f')]!=='VIRTUAL'){var _0x2f6928={};_0x2f6928[_0x317547['name']]={'$like':'%'+_0xd27309[_0x4752('0x32')][_0x4752('0x3f')]+'%'};return _0x2f6928;}})});}_0x486c11=_[_0x4752('0x40')]({},_0x486c11,_0xd27309[_0x4752('0x41')]);var _0x5e32c4={'where':_0x486c11['where']};return db['ChatQueueReport']['count'](_0x5e32c4)[_0x4752('0x24')](function(_0x81303e){_0x2e0811['count']=_0x81303e;if(_0xd27309[_0x4752('0x32')][_0x4752('0x42')]){_0x486c11[_0x4752('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x4752('0x44')](_0x486c11);})[_0x4752('0x24')](function(_0x1ad9d2){_0x2e0811[_0x4752('0x45')]=_0x1ad9d2;return _0x2e0811;})[_0x4752('0x24')](respondWithFilteredResult(_0x1dbba0,_0x486c11))['catch'](handleError(_0x1dbba0,null));};exports['show']=function(_0x3fdbff,_0x31cef5){var _0x828534={'raw':!![],'where':{'id':_0x3fdbff[_0x4752('0x46')]['id']}},_0x222f82={};_0x222f82[_0x4752('0x31')]=_[_0x4752('0x33')](db[_0x4752('0x2c')][_0x4752('0x2d')]);_0x222f82[_0x4752('0x32')]=_[_0x4752('0x33')](_0x3fdbff[_0x4752('0x32')]);_0x222f82['filters']=_[_0x4752('0x36')](_0x222f82['model'],_0x222f82[_0x4752('0x32')]);_0x828534[_0x4752('0x35')]=_['intersection'](_0x222f82[_0x4752('0x31')],qs[_0x4752('0x37')](_0x3fdbff[_0x4752('0x32')][_0x4752('0x37')]));_0x828534[_0x4752('0x35')]=_0x828534[_0x4752('0x35')]['length']?_0x828534[_0x4752('0x35')]:_0x222f82[_0x4752('0x31')];if(_0x3fdbff[_0x4752('0x32')][_0x4752('0x42')]){_0x828534[_0x4752('0x43')]=[{'all':!![]}];}_0x828534=_[_0x4752('0x40')]({},_0x828534,_0x3fdbff['options']);return db[_0x4752('0x2c')][_0x4752('0x47')](_0x828534)[_0x4752('0x24')](handleEntityNotFound(_0x31cef5,null))[_0x4752('0x24')](respondWithResult(_0x31cef5,null))[_0x4752('0x48')](handleError(_0x31cef5,null));};exports[_0x4752('0x49')]=function(_0x47d096,_0x335912){return db['ChatQueueReport']['create'](_0x47d096[_0x4752('0x4a')],{})[_0x4752('0x24')](respondWithResult(_0x335912,0xc9))[_0x4752('0x48')](handleError(_0x335912,null));};exports['update']=function(_0x1a92c6,_0x1ebb03){if(_0x1a92c6['body']['id']){delete _0x1a92c6[_0x4752('0x4a')]['id'];}return db[_0x4752('0x2c')][_0x4752('0x47')]({'where':{'id':_0x1a92c6['params']['id']}})[_0x4752('0x24')](handleEntityNotFound(_0x1ebb03,null))[_0x4752('0x24')](saveUpdates(_0x1a92c6[_0x4752('0x4a')],null))[_0x4752('0x24')](respondWithResult(_0x1ebb03,null))[_0x4752('0x48')](handleError(_0x1ebb03,null));};exports[_0x4752('0x25')]=function(_0x54389f,_0x3b7db0){return db['ChatQueueReport'][_0x4752('0x47')]({'where':{'id':_0x54389f[_0x4752('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b7db0,null))['then'](removeEntity(_0x3b7db0,null))['catch'](handleError(_0x3b7db0,null));};exports['describe']=function(_0x4cf5ac,_0x3ebf27){return db[_0x4752('0x2c')][_0x4752('0x4b')]()[_0x4752('0x24')](respondWithResult(_0x3ebf27,null))['catch'](handleError(_0x3ebf27,null));}; \ No newline at end of file +var _0xa6bb=['nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','include','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','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','undefined','offset','count','limit','Content-Range','apply','reject','update','then','error','stack','name','index','ChatQueueReport','type','model','map','query','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xa6bb,0x12c));var _0xba6b=function(_0x116df7,_0x117a43){_0x116df7=_0x116df7-0x0;var _0x2ab3a4=_0xa6bb[_0x116df7];return _0x2ab3a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba6b('0x0'));var zipdir=require(_0xba6b('0x1'));var jsonpatch=require(_0xba6b('0x2'));var rp=require(_0xba6b('0x3'));var moment=require(_0xba6b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba6b('0x5'));var path=require(_0xba6b('0x6'));var sox=require(_0xba6b('0x7'));var csv=require(_0xba6b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba6b('0x9'));var squel=require(_0xba6b('0xa'));var crypto=require(_0xba6b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba6b('0x8'));var querystring=require(_0xba6b('0xc'));var Papa=require(_0xba6b('0xd'));var Redis=require(_0xba6b('0xe'));var authService=require(_0xba6b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xba6b('0x10'));var hardwareService=require(_0xba6b('0x11'));var logger=require(_0xba6b('0x12'))('api');var utils=require(_0xba6b('0x13'));var config=require(_0xba6b('0x14'));var licenseUtil=require(_0xba6b('0x15'));var db=require(_0xba6b('0x16'))['db'];function respondWithStatusCode(_0x55b6ab,_0x1e8473){_0x1e8473=_0x1e8473||0xcc;return function(_0x5b1d28){if(_0x5b1d28){return _0x55b6ab[_0xba6b('0x17')](_0x1e8473);}return _0x55b6ab[_0xba6b('0x18')](_0x1e8473)[_0xba6b('0x19')]();};}function respondWithResult(_0x15d4e2,_0x32144e){_0x32144e=_0x32144e||0xc8;return function(_0x53ec00){if(_0x53ec00){return _0x15d4e2[_0xba6b('0x18')](_0x32144e)[_0xba6b('0x1a')](_0x53ec00);}};}function respondWithFilteredResult(_0x50b58a,_0x16c3d0){return function(_0x1d280e){if(_0x1d280e){var _0x52b2ff=typeof _0x16c3d0['offset']===_0xba6b('0x1b')&&typeof _0x16c3d0['limit']==='undefined';var _0x5a553c=_0x1d280e['count'];var _0x4be059=_0x52b2ff?0x0:_0x16c3d0[_0xba6b('0x1c')];var _0x34aa97=_0x52b2ff?_0x1d280e[_0xba6b('0x1d')]:_0x16c3d0[_0xba6b('0x1c')]+_0x16c3d0[_0xba6b('0x1e')];var _0x15d1d2;if(_0x34aa97>=_0x5a553c){_0x34aa97=_0x5a553c;_0x15d1d2=0xc8;}else{_0x15d1d2=0xce;}_0x50b58a[_0xba6b('0x18')](_0x15d1d2);return _0x50b58a['set'](_0xba6b('0x1f'),_0x4be059+'-'+_0x34aa97+'/'+_0x5a553c)['json'](_0x1d280e);}return null;};}function patchUpdates(_0x54a392){return function(_0x13beca){try{jsonpatch[_0xba6b('0x20')](_0x13beca,_0x54a392,!![]);}catch(_0x3905ae){return BPromise[_0xba6b('0x21')](_0x3905ae);}return _0x13beca['save']();};}function saveUpdates(_0xa632cb,_0x436623){return function(_0x548c1b){if(_0x548c1b){return _0x548c1b[_0xba6b('0x22')](_0xa632cb)[_0xba6b('0x23')](function(_0x82b68f){return _0x82b68f;});}return null;};}function removeEntity(_0x12e4e6,_0x426641){return function(_0x5c2845){if(_0x5c2845){return _0x5c2845['destroy']()['then'](function(){_0x12e4e6['status'](0xcc)[_0xba6b('0x19')]();});}};}function handleEntityNotFound(_0x2525f8,_0x2f5343){return function(_0x39f052){if(!_0x39f052){_0x2525f8[_0xba6b('0x17')](0x194);}return _0x39f052;};}function handleError(_0x32375c,_0x591102){_0x591102=_0x591102||0x1f4;return function(_0x876e58){logger[_0xba6b('0x24')](_0x876e58[_0xba6b('0x25')]);if(_0x876e58['name']){delete _0x876e58[_0xba6b('0x26')];}_0x32375c[_0xba6b('0x18')](_0x591102)['send'](_0x876e58);};}exports[_0xba6b('0x27')]=function(_0x25d5e6,_0xea9fbc){var _0x41a0e0={},_0x506f14={},_0x506447={'count':0x0,'rows':[]};var _0x18a4c1=_['map'](db[_0xba6b('0x28')]['rawAttributes'],function(_0x1a6b93){return{'name':_0x1a6b93['fieldName'],'type':_0x1a6b93[_0xba6b('0x29')]['key']};});_0x506f14[_0xba6b('0x2a')]=_[_0xba6b('0x2b')](_0x18a4c1,_0xba6b('0x26'));_0x506f14[_0xba6b('0x2c')]=_['keys'](_0x25d5e6[_0xba6b('0x2c')]);_0x506f14['filters']=_['intersection'](_0x506f14[_0xba6b('0x2a')],_0x506f14[_0xba6b('0x2c')]);_0x41a0e0['attributes']=_[_0xba6b('0x2d')](_0x506f14['model'],qs['fields'](_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x2e')]));_0x41a0e0[_0xba6b('0x2f')]=_0x41a0e0[_0xba6b('0x2f')][_0xba6b('0x30')]?_0x41a0e0['attributes']:_0x506f14[_0xba6b('0x2a')];if(!_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x31')](_0xba6b('0x32'))){_0x41a0e0[_0xba6b('0x1e')]=qs[_0xba6b('0x1e')](_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x1e')]);_0x41a0e0[_0xba6b('0x1c')]=qs['offset'](_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x1c')]);}_0x41a0e0[_0xba6b('0x33')]=qs[_0xba6b('0x34')](_0x25d5e6['query']['sort']);_0x41a0e0[_0xba6b('0x35')]=qs[_0xba6b('0x36')](_[_0xba6b('0x37')](_0x25d5e6[_0xba6b('0x2c')],_0x506f14['filters']),_0x18a4c1);if(_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x38')]){_0x41a0e0['where']=_[_0xba6b('0x39')](_0x41a0e0['where'],{'$or':_[_0xba6b('0x2b')](_0x18a4c1,function(_0x36df21){if(_0x36df21[_0xba6b('0x29')]!=='VIRTUAL'){var _0x26c479={};_0x26c479[_0x36df21[_0xba6b('0x26')]]={'$like':'%'+_0x25d5e6['query'][_0xba6b('0x38')]+'%'};return _0x26c479;}})});}_0x41a0e0=_['merge']({},_0x41a0e0,_0x25d5e6[_0xba6b('0x3a')]);var _0x5cc07e={'where':_0x41a0e0[_0xba6b('0x35')]};return db['ChatQueueReport'][_0xba6b('0x1d')](_0x5cc07e)['then'](function(_0x37dcb6){_0x506447[_0xba6b('0x1d')]=_0x37dcb6;if(_0x25d5e6[_0xba6b('0x2c')][_0xba6b('0x3b')]){_0x41a0e0['include']=[{'all':!![]}];}return db[_0xba6b('0x28')][_0xba6b('0x3c')](_0x41a0e0);})[_0xba6b('0x23')](function(_0x31fe5a){_0x506447[_0xba6b('0x3d')]=_0x31fe5a;return _0x506447;})['then'](respondWithFilteredResult(_0xea9fbc,_0x41a0e0))[_0xba6b('0x3e')](handleError(_0xea9fbc,null));};exports['show']=function(_0x1f229b,_0x7cb298){var _0x5b710a={'raw':!![],'where':{'id':_0x1f229b[_0xba6b('0x3f')]['id']}},_0x57e9b5={};_0x57e9b5[_0xba6b('0x2a')]=_[_0xba6b('0x40')](db[_0xba6b('0x28')]['rawAttributes']);_0x57e9b5[_0xba6b('0x2c')]=_[_0xba6b('0x40')](_0x1f229b[_0xba6b('0x2c')]);_0x57e9b5[_0xba6b('0x36')]=_['intersection'](_0x57e9b5[_0xba6b('0x2a')],_0x57e9b5[_0xba6b('0x2c')]);_0x5b710a[_0xba6b('0x2f')]=_[_0xba6b('0x2d')](_0x57e9b5[_0xba6b('0x2a')],qs[_0xba6b('0x2e')](_0x1f229b['query'][_0xba6b('0x2e')]));_0x5b710a[_0xba6b('0x2f')]=_0x5b710a[_0xba6b('0x2f')]['length']?_0x5b710a[_0xba6b('0x2f')]:_0x57e9b5[_0xba6b('0x2a')];if(_0x1f229b[_0xba6b('0x2c')][_0xba6b('0x3b')]){_0x5b710a[_0xba6b('0x41')]=[{'all':!![]}];}_0x5b710a=_[_0xba6b('0x39')]({},_0x5b710a,_0x1f229b[_0xba6b('0x3a')]);return db[_0xba6b('0x28')]['find'](_0x5b710a)[_0xba6b('0x23')](handleEntityNotFound(_0x7cb298,null))[_0xba6b('0x23')](respondWithResult(_0x7cb298,null))[_0xba6b('0x3e')](handleError(_0x7cb298,null));};exports['create']=function(_0x2d231e,_0x37172b){return db[_0xba6b('0x28')][_0xba6b('0x42')](_0x2d231e[_0xba6b('0x43')],{})[_0xba6b('0x23')](respondWithResult(_0x37172b,0xc9))[_0xba6b('0x3e')](handleError(_0x37172b,null));};exports[_0xba6b('0x22')]=function(_0x2dea62,_0x5035b3){if(_0x2dea62[_0xba6b('0x43')]['id']){delete _0x2dea62[_0xba6b('0x43')]['id'];}return db[_0xba6b('0x28')][_0xba6b('0x44')]({'where':{'id':_0x2dea62[_0xba6b('0x3f')]['id']}})[_0xba6b('0x23')](handleEntityNotFound(_0x5035b3,null))[_0xba6b('0x23')](saveUpdates(_0x2dea62[_0xba6b('0x43')],null))[_0xba6b('0x23')](respondWithResult(_0x5035b3,null))[_0xba6b('0x3e')](handleError(_0x5035b3,null));};exports['destroy']=function(_0x40c0ea,_0x36d3db){return db['ChatQueueReport'][_0xba6b('0x44')]({'where':{'id':_0x40c0ea[_0xba6b('0x3f')]['id']}})[_0xba6b('0x23')](handleEntityNotFound(_0x36d3db,null))['then'](removeEntity(_0x36d3db,null))[_0xba6b('0x3e')](handleError(_0x36d3db,null));};exports[_0xba6b('0x45')]=function(_0x2a44de,_0x586255){return db[_0xba6b('0x28')]['describe']()['then'](respondWithResult(_0x586255,null))['catch'](handleError(_0x586255,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 24f9788..518e06a 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x230d6d,_0x32fcdc){var _0x3e36a2=function(_0x35a9ae){while(--_0x35a9ae){_0x230d6d['push'](_0x230d6d['shift']());}};_0x3e36a2(++_0x32fcdc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb7e7[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_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 diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f4cefe0..7dd25bd 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 _0x0738=['body','options','then','debug','UpdateChatQueueReport','ChatQueueReport','update','raw','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0738,0x1d2));var _0x8073=function(_0x51ab33,_0x71a8a8){_0x51ab33=_0x51ab33-0x0;var _0x5e1298=_0x0738[_0x51ab33];return _0x5e1298;};'use strict';var _=require(_0x8073('0x0'));var util=require(_0x8073('0x1'));var moment=require(_0x8073('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8073('0x3'));var db=require(_0x8073('0x4'))['db'];var utils=require(_0x8073('0x5'));var logger=require(_0x8073('0x6'))(_0x8073('0x7'));var config=require(_0x8073('0x8'));var jayson=require(_0x8073('0x9'));var client=jayson[_0x8073('0xa')][_0x8073('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x129331,_0xe6b2bf,_0x475d00){return new BPromise(function(_0x75e4c3,_0x13d5d5){return client['request'](_0x129331,_0x475d00)['then'](function(_0x247788){logger[_0x8073('0xc')](_0x8073('0xd'),_0xe6b2bf,_0x8073('0xe'));logger['debug'](_0x8073('0xf'),_0xe6b2bf,_0x8073('0xe'),JSON[_0x8073('0x10')](_0x247788));if(_0x247788[_0x8073('0x11')]){if(_0x247788[_0x8073('0x11')][_0x8073('0x12')]===0x1f4){logger[_0x8073('0x11')](_0x8073('0xd'),_0xe6b2bf,_0x247788[_0x8073('0x11')]['message']);return _0x13d5d5(_0x247788[_0x8073('0x11')][_0x8073('0x13')]);}logger[_0x8073('0x11')](_0x8073('0xd'),_0xe6b2bf,_0x247788[_0x8073('0x11')][_0x8073('0x13')]);return _0x75e4c3(_0x247788[_0x8073('0x11')][_0x8073('0x13')]);}else{logger[_0x8073('0xc')](_0x8073('0xd'),_0xe6b2bf,'request\x20sent');_0x75e4c3(_0x247788[_0x8073('0x14')][_0x8073('0x13')]);}})[_0x8073('0x15')](function(_0x1fbc72){logger[_0x8073('0x11')](_0x8073('0xd'),_0xe6b2bf,_0x1fbc72);_0x13d5d5(_0x1fbc72);});});}exports[_0x8073('0x16')]=function(_0x148502){var _0x4d07ef=this;return new Promise(function(_0x16ba69,_0x340649){return db['ChatQueueReport'][_0x8073('0x17')](_0x148502[_0x8073('0x18')],{'raw':_0x148502[_0x8073('0x19')]?_0x148502['options']['raw']===undefined?!![]:![]:!![]})[_0x8073('0x1a')](function(_0x49c546){logger['info']('CreateChatQueueReport',_0x148502);logger[_0x8073('0x1b')](_0x8073('0x16'),_0x148502,JSON[_0x8073('0x10')](_0x49c546));_0x16ba69(_0x49c546);})['catch'](function(_0x28f43a){logger['error']('CreateChatQueueReport',_0x28f43a['message'],_0x148502);_0x340649(_0x4d07ef[_0x8073('0x11')](0x1f4,_0x28f43a[_0x8073('0x13')]));});});};exports[_0x8073('0x1c')]=function(_0x441649){var _0x3e4c60=this;return new Promise(function(_0xa4d73,_0x25d7ef){return db[_0x8073('0x1d')][_0x8073('0x1e')](_0x441649[_0x8073('0x18')],{'raw':_0x441649['options']?_0x441649[_0x8073('0x19')][_0x8073('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x441649['options']?_0x441649[_0x8073('0x19')][_0x8073('0x20')]||null:null,'attributes':_0x441649[_0x8073('0x19')]?_0x441649[_0x8073('0x19')][_0x8073('0x21')]||null:null,'limit':_0x441649[_0x8073('0x19')]?_0x441649['options'][_0x8073('0x22')]||null:null})[_0x8073('0x1a')](function(_0x2f1387){logger[_0x8073('0xc')](_0x8073('0x1c'),_0x441649);logger['debug'](_0x8073('0x1c'),_0x441649,JSON[_0x8073('0x10')](_0x2f1387));_0xa4d73(_0x2f1387);})['catch'](function(_0x4265f4){logger[_0x8073('0x11')](_0x8073('0x1c'),_0x4265f4[_0x8073('0x13')],_0x441649);_0x25d7ef(_0x3e4c60['error'](0x1f4,_0x4265f4['message']));});});}; \ No newline at end of file +var _0x0cde=['stringify','error','code','message','info','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','where','attributes','limit','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x6c4231,_0x31f3d1){var _0x208f97=function(_0x21944e){while(--_0x21944e){_0x6c4231['push'](_0x6c4231['shift']());}};_0x208f97(++_0x31f3d1);}(_0x0cde,0x1d0));var _0xe0cd=function(_0x1ba95f,_0x75454b){_0x1ba95f=_0x1ba95f-0x0;var _0x217f9b=_0x0cde[_0x1ba95f];return _0x217f9b;};'use strict';var _=require('lodash');var util=require(_0xe0cd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe0cd('0x1'));var fs=require('fs');var Redis=require(_0xe0cd('0x2'));var db=require(_0xe0cd('0x3'))['db'];var utils=require(_0xe0cd('0x4'));var logger=require(_0xe0cd('0x5'))(_0xe0cd('0x6'));var config=require(_0xe0cd('0x7'));var jayson=require(_0xe0cd('0x8'));var client=jayson[_0xe0cd('0x9')][_0xe0cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4965d0,_0x3ce05a,_0xf7a918){return new BPromise(function(_0x4de8c0,_0x5cdc94){return client[_0xe0cd('0xb')](_0x4965d0,_0xf7a918)[_0xe0cd('0xc')](function(_0x38d92c){logger['info'](_0xe0cd('0xd'),_0x3ce05a,_0xe0cd('0xe'));logger['debug'](_0xe0cd('0xf'),_0x3ce05a,_0xe0cd('0xe'),JSON[_0xe0cd('0x10')](_0x38d92c));if(_0x38d92c[_0xe0cd('0x11')]){if(_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x12')]===0x1f4){logger[_0xe0cd('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x3ce05a,_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x13')]);return _0x5cdc94(_0x38d92c['error'][_0xe0cd('0x13')]);}logger[_0xe0cd('0x11')](_0xe0cd('0xd'),_0x3ce05a,_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x13')]);return _0x4de8c0(_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x13')]);}else{logger[_0xe0cd('0x14')](_0xe0cd('0xd'),_0x3ce05a,_0xe0cd('0xe'));_0x4de8c0(_0x38d92c['result'][_0xe0cd('0x13')]);}})['catch'](function(_0x52f05f){logger[_0xe0cd('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x3ce05a,_0x52f05f);_0x5cdc94(_0x52f05f);});});}exports[_0xe0cd('0x15')]=function(_0x49c072){var _0x1be8e5=this;return new Promise(function(_0x2d2576,_0x1e9c9f){return db[_0xe0cd('0x16')][_0xe0cd('0x17')](_0x49c072['body'],{'raw':_0x49c072[_0xe0cd('0x18')]?_0x49c072['options'][_0xe0cd('0x19')]===undefined?!![]:![]:!![]})[_0xe0cd('0xc')](function(_0x1a5163){logger['info'](_0xe0cd('0x15'),_0x49c072);logger['debug'](_0xe0cd('0x15'),_0x49c072,JSON[_0xe0cd('0x10')](_0x1a5163));_0x2d2576(_0x1a5163);})['catch'](function(_0x16d580){logger[_0xe0cd('0x11')]('CreateChatQueueReport',_0x16d580[_0xe0cd('0x13')],_0x49c072);_0x1e9c9f(_0x1be8e5[_0xe0cd('0x11')](0x1f4,_0x16d580[_0xe0cd('0x13')]));});});};exports[_0xe0cd('0x1a')]=function(_0x21577f){var _0x26db42=this;return new Promise(function(_0x22c616,_0x3f039e){return db['ChatQueueReport'][_0xe0cd('0x1b')](_0x21577f['body'],{'raw':_0x21577f[_0xe0cd('0x18')]?_0x21577f['options'][_0xe0cd('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21577f[_0xe0cd('0x18')]?_0x21577f[_0xe0cd('0x18')][_0xe0cd('0x1c')]||null:null,'attributes':_0x21577f[_0xe0cd('0x18')]?_0x21577f['options'][_0xe0cd('0x1d')]||null:null,'limit':_0x21577f[_0xe0cd('0x18')]?_0x21577f['options'][_0xe0cd('0x1e')]||null:null})[_0xe0cd('0xc')](function(_0xb9ce54){logger[_0xe0cd('0x14')](_0xe0cd('0x1a'),_0x21577f);logger[_0xe0cd('0x1f')](_0xe0cd('0x1a'),_0x21577f,JSON['stringify'](_0xb9ce54));_0x22c616(_0xb9ce54);})['catch'](function(_0x5f2a65){logger[_0xe0cd('0x11')](_0xe0cd('0x1a'),_0x5f2a65['message'],_0x21577f);_0x3f039e(_0x26db42[_0xe0cd('0x11')](0x1f4,_0x5f2a65[_0xe0cd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 317bba7..8050e12 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 _0x9d5d=['get','/describe','describe','/:id','isAuthenticated','show','post','create','update','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatQueueReport.controller'];(function(_0x16098b,_0x47a450){var _0x59002=function(_0x2abc24){while(--_0x2abc24){_0x16098b['push'](_0x16098b['shift']());}};_0x59002(++_0x47a450);}(_0x9d5d,0x13c));var _0xd9d5=function(_0x18f48e,_0x49efe5){_0x18f48e=_0x18f48e-0x0;var _0x30d921=_0x9d5d[_0x18f48e];return _0x30d921;};'use strict';var multer=require(_0xd9d5('0x0'));var util=require(_0xd9d5('0x1'));var path=require(_0xd9d5('0x2'));var timeout=require(_0xd9d5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd9d5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd9d5('0x5'));var controller=require(_0xd9d5('0x6'));router[_0xd9d5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd9d5('0x7')](_0xd9d5('0x8'),auth['isAuthenticated'](),controller[_0xd9d5('0x9')]);router[_0xd9d5('0x7')](_0xd9d5('0xa'),auth[_0xd9d5('0xb')](),controller[_0xd9d5('0xc')]);router[_0xd9d5('0xd')]('/',auth[_0xd9d5('0xb')](),controller[_0xd9d5('0xe')]);router['put']('/:id',auth[_0xd9d5('0xb')](),controller[_0xd9d5('0xf')]);router['delete']('/:id',auth[_0xd9d5('0xb')](),controller['destroy']);module[_0xd9d5('0x10')]=router; \ No newline at end of file +var _0x6c2f=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','post','create','put','/:id','update'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6c2f,0xe6));var _0xf6c2=function(_0x5129b5,_0x1e226c){_0x5129b5=_0x5129b5-0x0;var _0x58ccfa=_0x6c2f[_0x5129b5];return _0x58ccfa;};'use strict';var multer=require('multer');var util=require(_0xf6c2('0x0'));var path=require(_0xf6c2('0x1'));var timeout=require(_0xf6c2('0x2'));var express=require(_0xf6c2('0x3'));var router=express[_0xf6c2('0x4')]();var fs_extra=require(_0xf6c2('0x5'));var auth=require(_0xf6c2('0x6'));var interaction=require(_0xf6c2('0x7'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xf6c2('0x8')]('/',auth[_0xf6c2('0x9')](),controller['index']);router['get'](_0xf6c2('0xa'),auth[_0xf6c2('0x9')](),controller[_0xf6c2('0xb')]);router[_0xf6c2('0x8')]('/:id',auth[_0xf6c2('0x9')](),controller['show']);router[_0xf6c2('0xc')]('/',auth['isAuthenticated'](),controller[_0xf6c2('0xd')]);router[_0xf6c2('0xe')](_0xf6c2('0xf'),auth[_0xf6c2('0x9')](),controller[_0xf6c2('0x10')]);router[_0xf6c2('0x11')](_0xf6c2('0xf'),auth['isAuthenticated'](),controller[_0xf6c2('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 098079a..2cf05bc 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4c1f1f,_0x3aa18d){var _0x4f9e3c=function(_0x1a94cb){while(--_0x1a94cb){_0x4c1f1f['push'](_0x4c1f1f['shift']());}};_0x4f9e3c(++_0x3aa18d);}(_0x54ef,0x112));var _0xf54e=function(_0x19448e,_0x4c1c00){_0x19448e=_0x19448e-0x0;var _0x3d2c2b=_0x54ef[_0x19448e];return _0x3d2c2b;};'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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x142864,_0x11acee){var _0x485126=function(_0x5ef671){while(--_0x5ef671){_0x142864['push'](_0x142864['shift']());}};_0x485126(++_0x11acee);}(_0xe706,0xa3));var _0x6e70=function(_0x3116d6,_0x2d574f){_0x3116d6=_0x3116d6-0x0;var _0x18729d=_0xe706[_0x3116d6];return _0x18729d;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 710f3a8..fa64ca2 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 _0xc459=['name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','params','keys','fields','includeAll','options','catch','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','stack'];(function(_0x2af9c2,_0x5a930e){var _0x1a5276=function(_0x4fd323){while(--_0x4fd323){_0x2af9c2['push'](_0x2af9c2['shift']());}};_0x1a5276(++_0x5a930e);}(_0xc459,0x6d));var _0x9c45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc459[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c45('0x0'));var zipdir=require(_0x9c45('0x1'));var jsonpatch=require(_0x9c45('0x2'));var rp=require(_0x9c45('0x3'));var moment=require(_0x9c45('0x4'));var BPromise=require(_0x9c45('0x5'));var Mustache=require(_0x9c45('0x6'));var util=require(_0x9c45('0x7'));var path=require('path');var sox=require(_0x9c45('0x8'));var csv=require('to-csv');var ejs=require(_0x9c45('0x9'));var fs=require('fs');var fs_extra=require(_0x9c45('0xa'));var _=require(_0x9c45('0xb'));var squel=require(_0x9c45('0xc'));var crypto=require(_0x9c45('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9c45('0xe'));var Papa=require(_0x9c45('0xf'));var Redis=require(_0x9c45('0x10'));var authService=require(_0x9c45('0x11'));var qs=require(_0x9c45('0x12'));var as=require(_0x9c45('0x13'));var hardwareService=require(_0x9c45('0x14'));var logger=require(_0x9c45('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9c45('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24315b,_0x4cf5d8){_0x4cf5d8=_0x4cf5d8||0xcc;return function(_0x2b7ca8){if(_0x2b7ca8){return _0x24315b['sendStatus'](_0x4cf5d8);}return _0x24315b[_0x9c45('0x17')](_0x4cf5d8)['end']();};}function respondWithResult(_0x165c6f,_0x4dcf6a){_0x4dcf6a=_0x4dcf6a||0xc8;return function(_0xb39a90){if(_0xb39a90){return _0x165c6f[_0x9c45('0x17')](_0x4dcf6a)[_0x9c45('0x18')](_0xb39a90);}};}function respondWithFilteredResult(_0x2367f7,_0x5532df){return function(_0x45fca0){if(_0x45fca0){var _0x5a8ee3=typeof _0x5532df[_0x9c45('0x19')]==='undefined'&&typeof _0x5532df[_0x9c45('0x1a')]===_0x9c45('0x1b');var _0xf39528=_0x45fca0[_0x9c45('0x1c')];var _0x1286f3=_0x5a8ee3?0x0:_0x5532df[_0x9c45('0x19')];var _0x156ef0=_0x5a8ee3?_0x45fca0['count']:_0x5532df[_0x9c45('0x19')]+_0x5532df[_0x9c45('0x1a')];var _0x3c85c2;if(_0x156ef0>=_0xf39528){_0x156ef0=_0xf39528;_0x3c85c2=0xc8;}else{_0x3c85c2=0xce;}_0x2367f7[_0x9c45('0x17')](_0x3c85c2);return _0x2367f7[_0x9c45('0x1d')](_0x9c45('0x1e'),_0x1286f3+'-'+_0x156ef0+'/'+_0xf39528)[_0x9c45('0x18')](_0x45fca0);}return null;};}function patchUpdates(_0x5efb66){return function(_0x3e1ac1){try{jsonpatch[_0x9c45('0x1f')](_0x3e1ac1,_0x5efb66,!![]);}catch(_0x4ad94f){return BPromise[_0x9c45('0x20')](_0x4ad94f);}return _0x3e1ac1[_0x9c45('0x21')]();};}function saveUpdates(_0x4dc774,_0x3d6854){return function(_0x2e472a){if(_0x2e472a){return _0x2e472a['update'](_0x4dc774)[_0x9c45('0x22')](function(_0x47ef33){return _0x47ef33;});}return null;};}function removeEntity(_0x37ce88,_0x36ba25){return function(_0x1b94bb){if(_0x1b94bb){return _0x1b94bb[_0x9c45('0x23')]()[_0x9c45('0x22')](function(){_0x37ce88[_0x9c45('0x17')](0xcc)[_0x9c45('0x24')]();});}};}function handleEntityNotFound(_0x5353d4,_0x324dde){return function(_0x517603){if(!_0x517603){_0x5353d4[_0x9c45('0x25')](0x194);}return _0x517603;};}function handleError(_0x3b0567,_0x33ac4a){_0x33ac4a=_0x33ac4a||0x1f4;return function(_0x31fc81){logger['error'](_0x31fc81[_0x9c45('0x26')]);if(_0x31fc81[_0x9c45('0x27')]){delete _0x31fc81[_0x9c45('0x27')];}_0x3b0567[_0x9c45('0x17')](_0x33ac4a)[_0x9c45('0x28')](_0x31fc81);};}exports[_0x9c45('0x29')]=function(_0x316886,_0xdd3e95){var _0x2a4d7a={},_0x23e3c8={},_0x3e4e08={'count':0x0,'rows':[]};var _0x464609=_['map'](db[_0x9c45('0x2a')][_0x9c45('0x2b')],function(_0x74f56b){return{'name':_0x74f56b[_0x9c45('0x2c')],'type':_0x74f56b[_0x9c45('0x2d')][_0x9c45('0x2e')]};});_0x23e3c8['model']=_[_0x9c45('0x2f')](_0x464609,_0x9c45('0x27'));_0x23e3c8[_0x9c45('0x30')]=_['keys'](_0x316886[_0x9c45('0x30')]);_0x23e3c8[_0x9c45('0x31')]=_[_0x9c45('0x32')](_0x23e3c8[_0x9c45('0x33')],_0x23e3c8['query']);_0x2a4d7a[_0x9c45('0x34')]=_['intersection'](_0x23e3c8['model'],qs['fields'](_0x316886[_0x9c45('0x30')]['fields']));_0x2a4d7a[_0x9c45('0x34')]=_0x2a4d7a[_0x9c45('0x34')][_0x9c45('0x35')]?_0x2a4d7a[_0x9c45('0x34')]:_0x23e3c8[_0x9c45('0x33')];if(!_0x316886[_0x9c45('0x30')][_0x9c45('0x36')](_0x9c45('0x37'))){_0x2a4d7a[_0x9c45('0x1a')]=qs[_0x9c45('0x1a')](_0x316886['query'][_0x9c45('0x1a')]);_0x2a4d7a['offset']=qs[_0x9c45('0x19')](_0x316886[_0x9c45('0x30')][_0x9c45('0x19')]);}_0x2a4d7a[_0x9c45('0x38')]=qs[_0x9c45('0x39')](_0x316886[_0x9c45('0x30')][_0x9c45('0x39')]);_0x2a4d7a[_0x9c45('0x3a')]=qs[_0x9c45('0x31')](_[_0x9c45('0x3b')](_0x316886[_0x9c45('0x30')],_0x23e3c8[_0x9c45('0x31')]),_0x464609);if(_0x316886[_0x9c45('0x30')][_0x9c45('0x3c')]){_0x2a4d7a['where']=_['merge'](_0x2a4d7a[_0x9c45('0x3a')],{'$or':_[_0x9c45('0x2f')](_0x464609,function(_0x4a31ff){if(_0x4a31ff[_0x9c45('0x2d')]!==_0x9c45('0x3d')){var _0x2b7422={};_0x2b7422[_0x4a31ff[_0x9c45('0x27')]]={'$like':'%'+_0x316886[_0x9c45('0x30')]['filter']+'%'};return _0x2b7422;}})});}_0x2a4d7a=_[_0x9c45('0x3e')]({},_0x2a4d7a,_0x316886['options']);var _0x1d5fbb={'where':_0x2a4d7a[_0x9c45('0x3a')]};return db['ChatTransferReport'][_0x9c45('0x1c')](_0x1d5fbb)['then'](function(_0x467cf){_0x3e4e08[_0x9c45('0x1c')]=_0x467cf;if(_0x316886['query']['includeAll']){_0x2a4d7a['include']=[{'all':!![]}];}return db[_0x9c45('0x2a')][_0x9c45('0x3f')](_0x2a4d7a);})[_0x9c45('0x22')](function(_0x80e06d){_0x3e4e08['rows']=_0x80e06d;return _0x3e4e08;})[_0x9c45('0x22')](respondWithFilteredResult(_0xdd3e95,_0x2a4d7a))['catch'](handleError(_0xdd3e95,null));};exports['show']=function(_0x39c87d,_0x6ad2d5){var _0x3051be={'raw':!![],'where':{'id':_0x39c87d[_0x9c45('0x40')]['id']}},_0x10e15a={};_0x10e15a[_0x9c45('0x33')]=_['keys'](db[_0x9c45('0x2a')][_0x9c45('0x2b')]);_0x10e15a['query']=_[_0x9c45('0x41')](_0x39c87d[_0x9c45('0x30')]);_0x10e15a[_0x9c45('0x31')]=_[_0x9c45('0x32')](_0x10e15a[_0x9c45('0x33')],_0x10e15a[_0x9c45('0x30')]);_0x3051be[_0x9c45('0x34')]=_[_0x9c45('0x32')](_0x10e15a[_0x9c45('0x33')],qs[_0x9c45('0x42')](_0x39c87d[_0x9c45('0x30')][_0x9c45('0x42')]));_0x3051be[_0x9c45('0x34')]=_0x3051be[_0x9c45('0x34')]['length']?_0x3051be[_0x9c45('0x34')]:_0x10e15a['model'];if(_0x39c87d[_0x9c45('0x30')][_0x9c45('0x43')]){_0x3051be['include']=[{'all':!![]}];}_0x3051be=_[_0x9c45('0x3e')]({},_0x3051be,_0x39c87d[_0x9c45('0x44')]);return db[_0x9c45('0x2a')]['find'](_0x3051be)[_0x9c45('0x22')](handleEntityNotFound(_0x6ad2d5,null))[_0x9c45('0x22')](respondWithResult(_0x6ad2d5,null))[_0x9c45('0x45')](handleError(_0x6ad2d5,null));};exports[_0x9c45('0x46')]=function(_0x2c59ce,_0x3005c5){return db['ChatTransferReport'][_0x9c45('0x46')](_0x2c59ce[_0x9c45('0x47')],{})['then'](respondWithResult(_0x3005c5,0xc9))[_0x9c45('0x45')](handleError(_0x3005c5,null));};exports['update']=function(_0x5b8ee2,_0x46e664){if(_0x5b8ee2[_0x9c45('0x47')]['id']){delete _0x5b8ee2[_0x9c45('0x47')]['id'];}return db[_0x9c45('0x2a')][_0x9c45('0x48')]({'where':{'id':_0x5b8ee2[_0x9c45('0x40')]['id']}})[_0x9c45('0x22')](handleEntityNotFound(_0x46e664,null))[_0x9c45('0x22')](saveUpdates(_0x5b8ee2[_0x9c45('0x47')],null))['then'](respondWithResult(_0x46e664,null))[_0x9c45('0x45')](handleError(_0x46e664,null));};exports['destroy']=function(_0x108d27,_0x3970f4){return db[_0x9c45('0x2a')][_0x9c45('0x48')]({'where':{'id':_0x108d27[_0x9c45('0x40')]['id']}})[_0x9c45('0x22')](handleEntityNotFound(_0x3970f4,null))[_0x9c45('0x22')](removeEntity(_0x3970f4,null))[_0x9c45('0x45')](handleError(_0x3970f4,null));};exports[_0x9c45('0x49')]=function(_0x1d9262,_0x1e12cc){return db[_0x9c45('0x2a')][_0x9c45('0x49')]()['then'](respondWithResult(_0x1e12cc,null))[_0x9c45('0x45')](handleError(_0x1e12cc,null));}; \ No newline at end of file +var _0x071c=['ChatTransferReport','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map'];(function(_0x34d66a,_0xa9ee0d){var _0x49dd14=function(_0x30223f){while(--_0x30223f){_0x34d66a['push'](_0x34d66a['shift']());}};_0x49dd14(++_0xa9ee0d);}(_0x071c,0x6e));var _0xc071=function(_0x48b0d5,_0x5ae74a){_0x48b0d5=_0x48b0d5-0x0;var _0x36fdab=_0x071c[_0x48b0d5];return _0x36fdab;};'use strict';var emlformat=require(_0xc071('0x0'));var rimraf=require(_0xc071('0x1'));var zipdir=require(_0xc071('0x2'));var jsonpatch=require(_0xc071('0x3'));var rp=require(_0xc071('0x4'));var moment=require('moment');var BPromise=require(_0xc071('0x5'));var Mustache=require(_0xc071('0x6'));var util=require(_0xc071('0x7'));var path=require(_0xc071('0x8'));var sox=require(_0xc071('0x9'));var csv=require(_0xc071('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc071('0xb'));var _=require(_0xc071('0xc'));var squel=require(_0xc071('0xd'));var crypto=require(_0xc071('0xe'));var jsforce=require(_0xc071('0xf'));var deskjs=require(_0xc071('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc071('0x11'));var Papa=require(_0xc071('0x12'));var Redis=require(_0xc071('0x13'));var authService=require(_0xc071('0x14'));var qs=require(_0xc071('0x15'));var as=require(_0xc071('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc071('0x17'))(_0xc071('0x18'));var utils=require('../../config/utils');var config=require(_0xc071('0x19'));var licenseUtil=require(_0xc071('0x1a'));var db=require(_0xc071('0x1b'))['db'];function respondWithStatusCode(_0x4ef13a,_0x225aa4){_0x225aa4=_0x225aa4||0xcc;return function(_0x1291e0){if(_0x1291e0){return _0x4ef13a[_0xc071('0x1c')](_0x225aa4);}return _0x4ef13a['status'](_0x225aa4)[_0xc071('0x1d')]();};}function respondWithResult(_0x301744,_0x5a5d27){_0x5a5d27=_0x5a5d27||0xc8;return function(_0x4ae765){if(_0x4ae765){return _0x301744[_0xc071('0x1e')](_0x5a5d27)[_0xc071('0x1f')](_0x4ae765);}};}function respondWithFilteredResult(_0xca95e9,_0x21099a){return function(_0x2e6bc5){if(_0x2e6bc5){var _0x33cbd9=typeof _0x21099a[_0xc071('0x20')]===_0xc071('0x21')&&typeof _0x21099a['limit']===_0xc071('0x21');var _0x1d6f37=_0x2e6bc5[_0xc071('0x22')];var _0x1ac169=_0x33cbd9?0x0:_0x21099a[_0xc071('0x20')];var _0x26143a=_0x33cbd9?_0x2e6bc5[_0xc071('0x22')]:_0x21099a[_0xc071('0x20')]+_0x21099a[_0xc071('0x23')];var _0x18c0d2;if(_0x26143a>=_0x1d6f37){_0x26143a=_0x1d6f37;_0x18c0d2=0xc8;}else{_0x18c0d2=0xce;}_0xca95e9[_0xc071('0x1e')](_0x18c0d2);return _0xca95e9[_0xc071('0x24')](_0xc071('0x25'),_0x1ac169+'-'+_0x26143a+'/'+_0x1d6f37)[_0xc071('0x1f')](_0x2e6bc5);}return null;};}function patchUpdates(_0x1fe932){return function(_0x801dce){try{jsonpatch[_0xc071('0x26')](_0x801dce,_0x1fe932,!![]);}catch(_0x5c2391){return BPromise[_0xc071('0x27')](_0x5c2391);}return _0x801dce[_0xc071('0x28')]();};}function saveUpdates(_0x82405,_0x4a7280){return function(_0x38f08f){if(_0x38f08f){return _0x38f08f[_0xc071('0x29')](_0x82405)[_0xc071('0x2a')](function(_0x9b92cb){return _0x9b92cb;});}return null;};}function removeEntity(_0x17eb50,_0x59c09e){return function(_0x53915a){if(_0x53915a){return _0x53915a[_0xc071('0x2b')]()['then'](function(){_0x17eb50[_0xc071('0x1e')](0xcc)[_0xc071('0x1d')]();});}};}function handleEntityNotFound(_0x1877f5,_0x35a127){return function(_0x41d247){if(!_0x41d247){_0x1877f5['sendStatus'](0x194);}return _0x41d247;};}function handleError(_0x7a449a,_0xeb197d){_0xeb197d=_0xeb197d||0x1f4;return function(_0x247ba1){logger[_0xc071('0x2c')](_0x247ba1['stack']);if(_0x247ba1[_0xc071('0x2d')]){delete _0x247ba1[_0xc071('0x2d')];}_0x7a449a[_0xc071('0x1e')](_0xeb197d)[_0xc071('0x2e')](_0x247ba1);};}exports['index']=function(_0x318fa2,_0x41b852){var _0x46f9a8={},_0x119998={},_0x2162e1={'count':0x0,'rows':[]};var _0x3ac4d2=_[_0xc071('0x2f')](db[_0xc071('0x30')][_0xc071('0x31')],function(_0x1ff48d){return{'name':_0x1ff48d[_0xc071('0x32')],'type':_0x1ff48d['type']['key']};});_0x119998[_0xc071('0x33')]=_['map'](_0x3ac4d2,_0xc071('0x2d'));_0x119998[_0xc071('0x34')]=_[_0xc071('0x35')](_0x318fa2[_0xc071('0x34')]);_0x119998['filters']=_[_0xc071('0x36')](_0x119998[_0xc071('0x33')],_0x119998[_0xc071('0x34')]);_0x46f9a8[_0xc071('0x37')]=_['intersection'](_0x119998[_0xc071('0x33')],qs[_0xc071('0x38')](_0x318fa2[_0xc071('0x34')]['fields']));_0x46f9a8[_0xc071('0x37')]=_0x46f9a8[_0xc071('0x37')]['length']?_0x46f9a8[_0xc071('0x37')]:_0x119998[_0xc071('0x33')];if(!_0x318fa2['query'][_0xc071('0x39')](_0xc071('0x3a'))){_0x46f9a8[_0xc071('0x23')]=qs[_0xc071('0x23')](_0x318fa2[_0xc071('0x34')][_0xc071('0x23')]);_0x46f9a8[_0xc071('0x20')]=qs['offset'](_0x318fa2[_0xc071('0x34')][_0xc071('0x20')]);}_0x46f9a8[_0xc071('0x3b')]=qs['sort'](_0x318fa2[_0xc071('0x34')][_0xc071('0x3c')]);_0x46f9a8[_0xc071('0x3d')]=qs['filters'](_[_0xc071('0x3e')](_0x318fa2['query'],_0x119998[_0xc071('0x3f')]),_0x3ac4d2);if(_0x318fa2[_0xc071('0x34')][_0xc071('0x40')]){_0x46f9a8[_0xc071('0x3d')]=_[_0xc071('0x41')](_0x46f9a8['where'],{'$or':_['map'](_0x3ac4d2,function(_0x21cd44){if(_0x21cd44['type']!==_0xc071('0x42')){var _0x3ffcbc={};_0x3ffcbc[_0x21cd44[_0xc071('0x2d')]]={'$like':'%'+_0x318fa2[_0xc071('0x34')]['filter']+'%'};return _0x3ffcbc;}})});}_0x46f9a8=_['merge']({},_0x46f9a8,_0x318fa2[_0xc071('0x43')]);var _0x3fb76e={'where':_0x46f9a8[_0xc071('0x3d')]};return db['ChatTransferReport'][_0xc071('0x22')](_0x3fb76e)[_0xc071('0x2a')](function(_0x850be7){_0x2162e1[_0xc071('0x22')]=_0x850be7;if(_0x318fa2['query']['includeAll']){_0x46f9a8[_0xc071('0x44')]=[{'all':!![]}];}return db[_0xc071('0x30')][_0xc071('0x45')](_0x46f9a8);})[_0xc071('0x2a')](function(_0x1e8dc0){_0x2162e1[_0xc071('0x46')]=_0x1e8dc0;return _0x2162e1;})[_0xc071('0x2a')](respondWithFilteredResult(_0x41b852,_0x46f9a8))[_0xc071('0x47')](handleError(_0x41b852,null));};exports['show']=function(_0x3d492f,_0x1768c5){var _0x21da89={'raw':!![],'where':{'id':_0x3d492f['params']['id']}},_0x1119d8={};_0x1119d8[_0xc071('0x33')]=_[_0xc071('0x35')](db[_0xc071('0x30')][_0xc071('0x31')]);_0x1119d8[_0xc071('0x34')]=_[_0xc071('0x35')](_0x3d492f[_0xc071('0x34')]);_0x1119d8['filters']=_['intersection'](_0x1119d8[_0xc071('0x33')],_0x1119d8[_0xc071('0x34')]);_0x21da89[_0xc071('0x37')]=_[_0xc071('0x36')](_0x1119d8['model'],qs[_0xc071('0x38')](_0x3d492f[_0xc071('0x34')][_0xc071('0x38')]));_0x21da89[_0xc071('0x37')]=_0x21da89[_0xc071('0x37')][_0xc071('0x48')]?_0x21da89['attributes']:_0x1119d8['model'];if(_0x3d492f[_0xc071('0x34')][_0xc071('0x49')]){_0x21da89['include']=[{'all':!![]}];}_0x21da89=_[_0xc071('0x41')]({},_0x21da89,_0x3d492f['options']);return db['ChatTransferReport'][_0xc071('0x4a')](_0x21da89)[_0xc071('0x2a')](handleEntityNotFound(_0x1768c5,null))[_0xc071('0x2a')](respondWithResult(_0x1768c5,null))[_0xc071('0x47')](handleError(_0x1768c5,null));};exports[_0xc071('0x4b')]=function(_0x5a7b23,_0x1596e9){return db['ChatTransferReport'][_0xc071('0x4b')](_0x5a7b23['body'],{})['then'](respondWithResult(_0x1596e9,0xc9))[_0xc071('0x47')](handleError(_0x1596e9,null));};exports[_0xc071('0x29')]=function(_0x36e802,_0x519ed5){if(_0x36e802[_0xc071('0x4c')]['id']){delete _0x36e802[_0xc071('0x4c')]['id'];}return db['ChatTransferReport'][_0xc071('0x4a')]({'where':{'id':_0x36e802['params']['id']}})[_0xc071('0x2a')](handleEntityNotFound(_0x519ed5,null))[_0xc071('0x2a')](saveUpdates(_0x36e802[_0xc071('0x4c')],null))[_0xc071('0x2a')](respondWithResult(_0x519ed5,null))[_0xc071('0x47')](handleError(_0x519ed5,null));};exports[_0xc071('0x2b')]=function(_0x5924f4,_0x586b5f){return db['ChatTransferReport'][_0xc071('0x4a')]({'where':{'id':_0x5924f4[_0xc071('0x4d')]['id']}})['then'](handleEntityNotFound(_0x586b5f,null))[_0xc071('0x2a')](removeEntity(_0x586b5f,null))['catch'](handleError(_0x586b5f,null));};exports[_0xc071('0x4e')]=function(_0x3c3bcc,_0x246b0f){return db[_0xc071('0x30')][_0xc071('0x4e')]()['then'](respondWithResult(_0x246b0f,null))[_0xc071('0x47')](handleError(_0x246b0f,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 8945c85..d120e1a 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 _0xab35=['path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','lodash','util','../../config/logger','moment','request-promise'];(function(_0x21899c,_0x4c0d98){var _0x5e895e=function(_0x5d6df9){while(--_0x5d6df9){_0x21899c['push'](_0x21899c['shift']());}};_0x5e895e(++_0x4c0d98);}(_0xab35,0x1db));var _0x5ab3=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0xab35[_0x2543d6];return _0x55213c;};'use strict';var _=require(_0x5ab3('0x0'));var util=require(_0x5ab3('0x1'));var logger=require(_0x5ab3('0x2'))('api');var moment=require(_0x5ab3('0x3'));var BPromise=require('bluebird');var rp=require(_0x5ab3('0x4'));var fs=require('fs');var path=require(_0x5ab3('0x5'));var rimraf=require('rimraf');var config=require(_0x5ab3('0x6'));var attributes=require(_0x5ab3('0x7'));module[_0x5ab3('0x8')]=function(_0x3cdb70,_0x5594dd){return _0x3cdb70[_0x5ab3('0x9')](_0x5ab3('0xa'),attributes,{'tableName':_0x5ab3('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b2c=['api','moment','bluebird','path','../../config/environment','ChatTransferReport','uniqueid','lodash','../../config/logger'];(function(_0x84c858,_0x32c06a){var _0x566333=function(_0x21489d){while(--_0x21489d){_0x84c858['push'](_0x84c858['shift']());}};_0x566333(++_0x32c06a);}(_0x4b2c,0xdf));var _0xc4b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc4b2('0x0'));var util=require('util');var logger=require(_0xc4b2('0x1'))(_0xc4b2('0x2'));var moment=require(_0xc4b2('0x3'));var BPromise=require(_0xc4b2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4b2('0x5'));var rimraf=require('rimraf');var config=require(_0xc4b2('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x37c8de,_0x5f329d){return _0x37c8de['define'](_0xc4b2('0x7'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xc4b2('0x8'),'fields':[_0xc4b2('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 9f6d25d..01411be 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 _0x64af=['error','code','message','result','catch','ChatTransferReport,\x20%s,\x20%s','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','stringify'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0x64af,0x1aa));var _0xf64a=function(_0x12130b,_0x1e5d98){_0x12130b=_0x12130b-0x0;var _0x398370=_0x64af[_0x12130b];return _0x398370;};'use strict';var _=require(_0xf64a('0x0'));var util=require(_0xf64a('0x1'));var moment=require('moment');var BPromise=require(_0xf64a('0x2'));var rs=require(_0xf64a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf64a('0x4'))['db'];var utils=require(_0xf64a('0x5'));var logger=require(_0xf64a('0x6'))(_0xf64a('0x7'));var config=require('../../config/environment');var jayson=require(_0xf64a('0x8'));var client=jayson['client'][_0xf64a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x253e9b,_0x553af0,_0x25c002){return new BPromise(function(_0x5ebab4,_0x5713b9){return client['request'](_0x253e9b,_0x25c002)[_0xf64a('0xa')](function(_0x14c47c){logger[_0xf64a('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x553af0,_0xf64a('0xc'));logger[_0xf64a('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x553af0,_0xf64a('0xc'),JSON[_0xf64a('0xe')](_0x14c47c));if(_0x14c47c[_0xf64a('0xf')]){if(_0x14c47c[_0xf64a('0xf')][_0xf64a('0x10')]===0x1f4){logger[_0xf64a('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x553af0,_0x14c47c[_0xf64a('0xf')]['message']);return _0x5713b9(_0x14c47c[_0xf64a('0xf')][_0xf64a('0x11')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x553af0,_0x14c47c[_0xf64a('0xf')]['message']);return _0x5ebab4(_0x14c47c['error'][_0xf64a('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x553af0,_0xf64a('0xc'));_0x5ebab4(_0x14c47c[_0xf64a('0x12')][_0xf64a('0x11')]);}})[_0xf64a('0x13')](function(_0x5bfe4f){logger[_0xf64a('0xf')](_0xf64a('0x14'),_0x553af0,_0x5bfe4f);_0x5713b9(_0x5bfe4f);});});} \ No newline at end of file +var _0xbdb1=['request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x418bfe,_0x5c9e57){var _0x4aafe5=function(_0x3a667e){while(--_0x3a667e){_0x418bfe['push'](_0x418bfe['shift']());}};_0x4aafe5(++_0x5c9e57);}(_0xbdb1,0x1ee));var _0x1bdb=function(_0x4014e5,_0x125e6a){_0x4014e5=_0x4014e5-0x0;var _0x4ee8b7=_0xbdb1[_0x4014e5];return _0x4ee8b7;};'use strict';var _=require(_0x1bdb('0x0'));var util=require(_0x1bdb('0x1'));var moment=require(_0x1bdb('0x2'));var BPromise=require(_0x1bdb('0x3'));var rs=require(_0x1bdb('0x4'));var fs=require('fs');var Redis=require(_0x1bdb('0x5'));var db=require(_0x1bdb('0x6'))['db'];var utils=require(_0x1bdb('0x7'));var logger=require(_0x1bdb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1bdb('0x9'));var client=jayson[_0x1bdb('0xa')][_0x1bdb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e0cb0,_0x2a6bb8,_0x4f22cc){return new BPromise(function(_0x33ade1,_0x475529){return client[_0x1bdb('0xc')](_0x4e0cb0,_0x4f22cc)[_0x1bdb('0xd')](function(_0xd0db04){logger['info'](_0x1bdb('0xe'),_0x2a6bb8,_0x1bdb('0xf'));logger[_0x1bdb('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2a6bb8,_0x1bdb('0xf'),JSON[_0x1bdb('0x11')](_0xd0db04));if(_0xd0db04[_0x1bdb('0x12')]){if(_0xd0db04[_0x1bdb('0x12')][_0x1bdb('0x13')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2a6bb8,_0xd0db04[_0x1bdb('0x12')][_0x1bdb('0x14')]);return _0x475529(_0xd0db04[_0x1bdb('0x12')]['message']);}logger[_0x1bdb('0x12')](_0x1bdb('0xe'),_0x2a6bb8,_0xd0db04[_0x1bdb('0x12')]['message']);return _0x33ade1(_0xd0db04[_0x1bdb('0x12')][_0x1bdb('0x14')]);}else{logger[_0x1bdb('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x2a6bb8,_0x1bdb('0xf'));_0x33ade1(_0xd0db04[_0x1bdb('0x16')]['message']);}})['catch'](function(_0x2886b7){logger['error'](_0x1bdb('0xe'),_0x2a6bb8,_0x2886b7);_0x475529(_0x2886b7);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 8c9077b..49fffdb 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 _0x5e61=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','/describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','Router','fs-extra'];(function(_0xbce261,_0x5bf87e){var _0x23848f=function(_0x582169){while(--_0x582169){_0xbce261['push'](_0xbce261['shift']());}};_0x23848f(++_0x5bf87e);}(_0x5e61,0x114));var _0x15e6=function(_0x305052,_0x472254){_0x305052=_0x305052-0x0;var _0x33b40d=_0x5e61[_0x305052];return _0x33b40d;};'use strict';var multer=require(_0x15e6('0x0'));var util=require(_0x15e6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x15e6('0x2')]();var fs_extra=require(_0x15e6('0x3'));var auth=require(_0x15e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x15e6('0x5'));var controller=require(_0x15e6('0x6'));router['get']('/',auth[_0x15e6('0x7')](),controller[_0x15e6('0x8')]);router['get'](_0x15e6('0x9'),auth[_0x15e6('0x7')](),controller['describe']);router[_0x15e6('0xa')](_0x15e6('0xb'),auth[_0x15e6('0x7')](),controller[_0x15e6('0xc')]);router[_0x15e6('0xd')]('/',auth['isAuthenticated'](),controller[_0x15e6('0xe')]);router[_0x15e6('0xf')](_0x15e6('0xb'),auth[_0x15e6('0x7')](),controller[_0x15e6('0x10')]);router[_0x15e6('0x11')](_0x15e6('0xb'),auth['isAuthenticated'](),controller[_0x15e6('0x12')]);module[_0x15e6('0x13')]=router; \ No newline at end of file +var _0x5655=['index','describe','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x227cfe,_0x4a8ce1){var _0x3c03f0=function(_0x43ee69){while(--_0x43ee69){_0x227cfe['push'](_0x227cfe['shift']());}};_0x3c03f0(++_0x4a8ce1);}(_0x5655,0x15e));var _0x5565=function(_0x9cc068,_0x7e41c5){_0x9cc068=_0x9cc068-0x0;var _0x2b183f=_0x5655[_0x9cc068];return _0x2b183f;};'use strict';var multer=require(_0x5565('0x0'));var util=require(_0x5565('0x1'));var path=require(_0x5565('0x2'));var timeout=require(_0x5565('0x3'));var express=require(_0x5565('0x4'));var router=express[_0x5565('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5565('0x6'));var config=require('../../config/environment');var controller=require(_0x5565('0x7'));router[_0x5565('0x8')]('/',auth[_0x5565('0x9')](),controller[_0x5565('0xa')]);router[_0x5565('0x8')]('/describe',auth[_0x5565('0x9')](),controller[_0x5565('0xb')]);router[_0x5565('0x8')](_0x5565('0xc'),auth[_0x5565('0x9')](),controller[_0x5565('0xd')]);router['post']('/',auth[_0x5565('0x9')](),controller[_0x5565('0xe')]);router['put']('/:id',auth[_0x5565('0x9')](),controller[_0x5565('0xf')]);router['delete']('/:id',auth[_0x5565('0x9')](),controller[_0x5565('0x10')]);module[_0x5565('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 23e4c65..5c5697b 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 _0x6eb9=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','name','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','squared','We\x20are\x20here!','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x6eb9,0x1ba));var _0x96eb=function(_0x3b3127,_0x51cdc5){_0x3b3127=_0x3b3127-0x0;var _0x19c58f=_0x6eb9[_0x3b3127];return _0x19c58f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x96eb('0x0'));module[_0x96eb('0x1')]={'name':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x3')},'mapKeyOffline':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x3')},'key':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x4')},'customerAlias':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![],'defaultValue':_0x96eb('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x96eb('0x2')],'allowNull':![],'defaultValue':_0x96eb('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x96eb('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x96eb('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x96eb('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x96eb('0x8')]('rounded',_0x96eb('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0xc')},'header_offline':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x96eb('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x96eb('0xf')]},'closingQuestion':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x13')},'closingMessageButton':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0xc')},'skipMessageButton':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x14')},'conditionAgreement':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x15')},'ratingType':{'type':Sequelize[_0x96eb('0x8')](_0x96eb('0x16'),_0x96eb('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x96eb('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x96eb('0xf')],'defaultValue':function(){return JSON[_0x96eb('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x96eb('0x19'),'type':'text','required':!![]},'props':{'title':_0x96eb('0x19'),'helpText':''}},{'type':_0x96eb('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x96eb('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x96eb('0x1b')](_0x96eb('0x1c'))?JSON[_0x96eb('0x1d')](this[_0x96eb('0x1b')](_0x96eb('0x1c'))):{};},'set':function(_0x311683){return this[_0x96eb('0x1e')]('onlineForm',JSON[_0x96eb('0x18')](_0x311683));}},'offlineForm':{'type':Sequelize[_0x96eb('0xf')],'defaultValue':function(){return JSON[_0x96eb('0x18')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x96eb('0x3')},'variable':null},{'type':_0x96eb('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x96eb('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x96eb('0x1b')](_0x96eb('0x21'))?JSON[_0x96eb('0x1d')](this[_0x96eb('0x1b')](_0x96eb('0x21'))):{};},'set':function(_0xd3b968){return this[_0x96eb('0x1e')](_0x96eb('0x21'),JSON['stringify'](_0xd3b968));}},'token':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':function(){return rs[_0x96eb('0x22')]();}},'autoclose':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x96eb('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x23')},'waitingMessage':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x24')},'offlineMessageBody':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x14')},'sendUnmanaged':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x96eb('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x96eb('0xf')],'defaultValue':function(){return _0x96eb('0x25');}},'notificationSound':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x96eb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x96eb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x26')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x96eb('0x27')},'messagesAlignment':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':_0x96eb('0x28')},'defaultTitle':{'type':Sequelize[_0x96eb('0x2')]},'customerAvatar':{'type':Sequelize[_0x96eb('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x96eb('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x96eb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x96eb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x96eb('0x2a'),'set':function(_0x28c526){if(!_0x28c526)this['setDataValue'](_0x96eb('0x2b'),null);this[_0x96eb('0x1e')](_0x96eb('0x2c'),_0x28c526);}},'vidaooEscalation':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x96eb('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x96eb('0x2d')},'vidaooNote':{'type':Sequelize[_0x96eb('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x96eb('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x96eb('0xf')]}}; \ No newline at end of file +var _0x9714=['thumb','stringify','name','text','input','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','ENUM','star'];(function(_0x262a0b,_0x20d859){var _0x15f521=function(_0x317318){while(--_0x317318){_0x262a0b['push'](_0x262a0b['shift']());}};_0x15f521(++_0x20d859);}(_0x9714,0x120));var _0x4971=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x9714[_0xba1760];return _0x1f3143;};'use strict';var Sequelize=require(_0x4971('0x0'));var rs=require(_0x4971('0x1'));module['exports']={'name':{'type':Sequelize[_0x4971('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'unique':_0x4971('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x4')},'mapKeyOffline':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x4971('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x5')},'customerAlias':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4971('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':_0x4971('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x4971('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4971('0x2')]},'animation':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0xb')},'offline_chat_button':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0xc')},'header_offline':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0xd')},'download_transcript':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x4971('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4971('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0x10')},'noteTitle':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x11')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x4971('0x12')](_0x4971('0x13'),_0x4971('0x14')),'defaultValue':_0x4971('0x13')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4971('0xe')],'defaultValue':function(){return JSON[_0x4971('0x15')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x4971('0x16'),'type':_0x4971('0x17'),'required':!![]},'props':{'title':_0x4971('0x16'),'helpText':''}},{'type':_0x4971('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x4971('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4971('0x19')](_0x4971('0x1a'))?JSON[_0x4971('0x1b')](this['getDataValue'](_0x4971('0x1a'))):{};},'set':function(_0x49d8c5){return this[_0x4971('0x1c')]('onlineForm',JSON[_0x4971('0x15')](_0x49d8c5));}},'offlineForm':{'type':Sequelize[_0x4971('0xe')],'defaultValue':function(){return JSON[_0x4971('0x15')]({'items':[{'type':_0x4971('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4971('0x4'),'type':_0x4971('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x4971('0x1d')},'props':{'title':_0x4971('0x1d'),'helpText':_0x4971('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x4971('0x19')](_0x4971('0x1f'))?JSON[_0x4971('0x1b')](this[_0x4971('0x19')](_0x4971('0x1f'))):{};},'set':function(_0x3b45f6){return this[_0x4971('0x1c')](_0x4971('0x1f'),JSON[_0x4971('0x15')](_0x3b45f6));}},'token':{'type':Sequelize[_0x4971('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4971('0x2')]},'forwardOffline':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4971('0x2')]},'waitingTitle':{'type':Sequelize[_0x4971('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x20')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0x22')},'skipUnmanaged':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x23')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x4971('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4971('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4971('0xe')],'defaultValue':function(){return _0x4971('0x24');}},'notificationSound':{'type':Sequelize[_0x4971('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x25')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4971('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x26')},'verticalAlignment':{'type':Sequelize[_0x4971('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x27')},'messagesAlignment':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x4971('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4971('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4971('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4971('0x2')],'defaultValue':_0x4971('0x29')},'systemAvatar':{'type':Sequelize[_0x4971('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4971('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1243ba){if(!_0x1243ba)this['setDataValue'](_0x4971('0x2a'),null);this[_0x4971('0x1c')]('mandatoryDisposition',_0x1243ba);}},'vidaooEscalation':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4971('0x2')]},'vidaooTopic':{'type':Sequelize[_0x4971('0x2')],'allowNull':![],'defaultValue':_0x4971('0x2b')},'vidaooNote':{'type':Sequelize[_0x4971('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x4971('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4971('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index cec4a57..b929345 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 _0xe74a=['find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','chat','MapKey\x20is\x20mandatory','isEmpty','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','mapKey','CmList','List','Contacts','ChatApplication','Applications','Interval','Intervals','interval','timezone','ifTime','account','list','applications','priority','asc','from','ListId','CmContact','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','files','ValidationError','difference','send','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','Attachment','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','URL','address','origin','3.8.1','remote','x-real-ip','connection','remoteAddress','replace','alignment','labelText','textButtonColor','color_button','backgroundColor','IntervalId','transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','online','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','APIConflictError','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','limit','undefined','offset','count','set','update','destroy','get','ChatWebsites','name','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','%s\x20%s\x20%s','model','vendor','type','index','Pause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','mandatoryDispositionPause','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x4d61fc,_0x4d0593){var _0x5f1852=function(_0x4877ae){while(--_0x4877ae){_0x4d61fc['push'](_0x4d61fc['shift']());}};_0x5f1852(++_0x4d0593);}(_0xe74a,0xcc));var _0xae74=function(_0x25b8b1,_0xe0b951){_0x25b8b1=_0x25b8b1-0x0;var _0x2d04f7=_0xe74a[_0x25b8b1];return _0x2d04f7;};'use strict';var Mustache=require('mustache');var util=require(_0xae74('0x0'));var path=require(_0xae74('0x1'));var ejs=require(_0xae74('0x2'));var fs=require('fs');var fs_extra=require(_0xae74('0x3'));var _=require(_0xae74('0x4'));var querystring=require('querystring');var htmlToText=require(_0xae74('0x5'));var Redis=require(_0xae74('0x6'));var jayson=require(_0xae74('0x7'));var url=require(_0xae74('0x8'));var qs=require(_0xae74('0x9'));var logger=require(_0xae74('0xa'))('api');var config=require(_0xae74('0xb'));var APIBadRequestError=require(_0xae74('0xc'))[_0xae74('0xd')];var APINotFoundError=require(_0xae74('0xc'))[_0xae74('0xe')];var APIOutOfIntervalError=require(_0xae74('0xc'))[_0xae74('0xf')];var APIHandleError=require(_0xae74('0xc'))['handleError'];var APIConflictError=require(_0xae74('0xc'))[_0xae74('0x10')];var db=require(_0xae74('0x11'))['db'];config['redis']=_[_0xae74('0x12')](config[_0xae74('0x13')],{'host':_0xae74('0x14'),'port':0x18eb});var socket=require(_0xae74('0x15'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xae74('0x16')](socket);var client=jayson[_0xae74('0x17')][_0xae74('0x18')]({'port':0x232c});var client9002=jayson['client'][_0xae74('0x18')]({'port':0x232a});var client9003=jayson[_0xae74('0x17')][_0xae74('0x18')]({'port':0x232b});var client9001=jayson[_0xae74('0x17')][_0xae74('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x457a90,_0x50cd59,_0x295a41,_0x2b5133){return new Promise(function(_0x1962ee,_0x148dae){var _0x1550ad=_0x2b5133||client;return _0x1550ad[_0xae74('0x19')](_0x457a90,_0x295a41)[_0xae74('0x1a')](function(_0x23108d){logger['info'](_0xae74('0x1b'),_0x50cd59,_0xae74('0x1c'));logger[_0xae74('0x1d')](_0xae74('0x1e'),_0x50cd59,_0xae74('0x1c'),JSON[_0xae74('0x1f')](_0x23108d));if(_0x23108d[_0xae74('0x20')]){if(_0x23108d[_0xae74('0x20')][_0xae74('0x21')]===0x1f4){logger[_0xae74('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x50cd59,_0x23108d[_0xae74('0x20')][_0xae74('0x22')]);return _0x148dae(_0x23108d['error']['message']);}logger[_0xae74('0x20')](_0xae74('0x1b'),_0x50cd59,_0x23108d[_0xae74('0x20')][_0xae74('0x22')]);return _0x1962ee(_0x23108d[_0xae74('0x20')][_0xae74('0x22')]);}else{logger[_0xae74('0x23')](_0xae74('0x1b'),_0x50cd59,_0xae74('0x1c'));_0x1962ee(_0x23108d[_0xae74('0x24')]['message']);}})['catch'](function(_0x469c96){logger[_0xae74('0x20')](_0xae74('0x1b'),_0x50cd59,_0x469c96);_0x148dae(_0x469c96);});});}function respondWithStatusCode(_0x323d15,_0x3b07b6){_0x3b07b6=_0x3b07b6||0xcc;return function(_0x32f750){if(_0x32f750){return _0x323d15[_0xae74('0x25')](_0x3b07b6);}return _0x323d15[_0xae74('0x26')](_0x3b07b6)[_0xae74('0x27')]();};}function respondWithResult(_0x265ce0,_0x4d1b06){_0x4d1b06=_0x4d1b06||0xc8;return function(_0x5e4401){if(_0x5e4401){return _0x265ce0[_0xae74('0x26')](_0x4d1b06)[_0xae74('0x28')](_0x5e4401);}};}function respondWithFilteredResult(_0xdf143e,_0x4c442f){return function(_0x1b48d7){if(_0x1b48d7){var _0x627882=typeof _0x4c442f['offset']==='undefined'&&typeof _0x4c442f[_0xae74('0x29')]===_0xae74('0x2a');var _0x1b9346=_0x1b48d7['count'];var _0x268f96=_0x627882?0x0:_0x4c442f[_0xae74('0x2b')];var _0x416eba=_0x627882?_0x1b48d7[_0xae74('0x2c')]:_0x4c442f[_0xae74('0x2b')]+_0x4c442f['limit'];var _0x4d70b2;if(_0x416eba>=_0x1b9346){_0x416eba=_0x1b9346;_0x4d70b2=0xc8;}else{_0x4d70b2=0xce;}_0xdf143e[_0xae74('0x26')](_0x4d70b2);return _0xdf143e[_0xae74('0x2d')]('Content-Range',_0x268f96+'-'+_0x416eba+'/'+_0x1b9346)[_0xae74('0x28')](_0x1b48d7);}return null;};}function saveUpdates(_0x11c8e5){return function(_0x47eb03){if(_0x47eb03){return _0x47eb03[_0xae74('0x2e')](_0x11c8e5)['then'](function(_0x42edc8){return _0x42edc8;});}return null;};}function removeEntity(_0x170ab6){return function(_0x1f1681){if(_0x1f1681){return _0x1f1681[_0xae74('0x2f')]()[_0xae74('0x1a')](function(){var _0x20d774=_0x1f1681[_0xae74('0x30')]({'plain':!![]});var _0x47d3ff=_0xae74('0x31');return db['UserProfileResource'][_0xae74('0x2f')]({'where':{'type':_0x47d3ff,'resourceId':_0x20d774['id']}})['then'](function(){return _0x1f1681;});})[_0xae74('0x1a')](function(){_0x170ab6['status'](0xcc)[_0xae74('0x27')]();});}};}function handleEntityNotFound(_0x52f79a){return function(_0x5728c9){if(!_0x5728c9){_0x52f79a[_0xae74('0x25')](0x194);}return _0x5728c9;};}function handleError(_0x4f6579,_0x3a556f){_0x3a556f=_0x3a556f||0x1f4;return function(_0x3f1b2b){logger[_0xae74('0x20')](_0x3f1b2b['stack']);if(_0x3f1b2b[_0xae74('0x32')]){delete _0x3f1b2b[_0xae74('0x32')];}_0x4f6579['status'](_0x3a556f)['send'](_0x3f1b2b);};}function createInteractionObject(_0x9ee076,_0xb59f35,_0x1cda59,_0x124df8){var _0x38fb68=require(_0xae74('0x33'));var _0x2f6d28=new _0x38fb68();var _0x1c4cba=_0x2f6d28[_0xae74('0x34')](_0x1cda59['user-agent'])[_0xae74('0x35')]();var _0x50c1ec=_0xb59f35[_0xae74('0x36')];if(_0x1cda59['cf-connecting-ip']){_0x50c1ec=_0x1cda59[_0xae74('0x37')];}else if(_0x1cda59['x-forwarded-for']){_0x50c1ec=_[_0xae74('0x38')](_0x1cda59[_0xae74('0x39')][_0xae74('0x3a')](','));}return{'ContactId':_0x124df8['id'],'ChatWebsiteId':_0x9ee076,'from':(_0x124df8['firstName']||'')+'\x20'+(_0x124df8[_0xae74('0x3b')]||''),'customerIp':_0x50c1ec,'customerPort':_0x1cda59[_0xae74('0x3c')]?_0x1cda59[_0xae74('0x3c')]:null,'referer':_0xb59f35[_0xae74('0x3d')],'browserName':_0x1c4cba[_0xae74('0x3e')][_0xae74('0x32')]&&_0x1c4cba[_0xae74('0x3e')]['version']?util[_0xae74('0x3f')](_0xae74('0x40'),_0x1c4cba[_0xae74('0x3e')][_0xae74('0x32')],_0x1c4cba[_0xae74('0x3e')][_0xae74('0x41')]):'unknown','browserVersion':_0x1c4cba[_0xae74('0x3e')][_0xae74('0x41')]||_0xae74('0x42'),'osName':util[_0xae74('0x3f')]('%s\x20%s',_0x1c4cba['os']['name'],_0x1c4cba['os'][_0xae74('0x41')]),'osVersion':_0x1c4cba['os'][_0xae74('0x41')],'deviceModel':_0x1c4cba[_0xae74('0x43')]['model']&&_0x1c4cba[_0xae74('0x43')]['vendor']?util['format'](_0xae74('0x44'),_0x1c4cba[_0xae74('0x43')][_0xae74('0x45')],_0x1c4cba[_0xae74('0x43')][_0xae74('0x46')],_0x1c4cba[_0xae74('0x43')][_0xae74('0x47')]):null,'deviceVendor':_0x1c4cba[_0xae74('0x43')][_0xae74('0x46')],'deviceType':_0x1c4cba[_0xae74('0x43')]['type'],'formData':JSON[_0xae74('0x1f')](_0xb59f35)};}exports[_0xae74('0x48')]=function(_0x39a5ec,_0x55e506){var _0x31c4c7={'include':[{'model':db[_0xae74('0x49')],'as':'mandatoryDispositionPause'}]},_0x3d03bc={},_0x35907e={'count':0x0,'rows':[]};var _0x131a09=_[_0xae74('0x4a')](db[_0xae74('0x4b')][_0xae74('0x4c')],function(_0x2044d7){return{'name':_0x2044d7[_0xae74('0x4d')],'type':_0x2044d7[_0xae74('0x47')][_0xae74('0x4e')]};});_0x3d03bc['model']=_[_0xae74('0x4a')](_0x131a09,'name');_0x3d03bc[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x39a5ec['query']);_0x3d03bc[_0xae74('0x51')]=_[_0xae74('0x52')](_0x3d03bc[_0xae74('0x45')],_0x3d03bc[_0xae74('0x4f')]);_0x31c4c7[_0xae74('0x53')]=_[_0xae74('0x52')](_0x3d03bc[_0xae74('0x45')],qs[_0xae74('0x54')](_0x39a5ec[_0xae74('0x4f')][_0xae74('0x54')]));_0x31c4c7[_0xae74('0x53')]=_0x31c4c7[_0xae74('0x53')]['length']?_0x31c4c7['attributes']:_0x3d03bc[_0xae74('0x45')];if(!_0x39a5ec[_0xae74('0x4f')][_0xae74('0x55')]('nolimit')){_0x31c4c7[_0xae74('0x29')]=qs[_0xae74('0x29')](_0x39a5ec[_0xae74('0x4f')]['limit']);_0x31c4c7[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x39a5ec[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x31c4c7['order']=qs[_0xae74('0x56')](_0x39a5ec[_0xae74('0x4f')][_0xae74('0x56')]);_0x31c4c7[_0xae74('0x57')]=qs[_0xae74('0x51')](_['pick'](_0x39a5ec[_0xae74('0x4f')],_0x3d03bc[_0xae74('0x51')]),_0x131a09);if(_0x39a5ec[_0xae74('0x4f')][_0xae74('0x58')]){_0x31c4c7['where']=_['merge'](_0x31c4c7[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x131a09,function(_0x41ccc9){if(_0x41ccc9[_0xae74('0x47')]!==_0xae74('0x59')){var _0x1e510a={};_0x1e510a[_0x41ccc9['name']]={'$like':'%'+_0x39a5ec[_0xae74('0x4f')]['filter']+'%'};return _0x1e510a;}})});}_0x31c4c7=_[_0xae74('0x5a')]({},_0x31c4c7,_0x39a5ec['options']);var _0x20d268={'where':_0x31c4c7[_0xae74('0x57')]};return db[_0xae74('0x4b')][_0xae74('0x2c')](_0x20d268)['then'](function(_0x2b72d9){_0x35907e[_0xae74('0x2c')]=_0x2b72d9;if(_0x39a5ec['query'][_0xae74('0x5b')]){_0x31c4c7[_0xae74('0x5c')]=[{'all':!![]}];}return db[_0xae74('0x4b')][_0xae74('0x5d')](_0x31c4c7);})[_0xae74('0x1a')](function(_0x391e18){_0x35907e[_0xae74('0x5e')]=_0x391e18;return _0x35907e;})[_0xae74('0x1a')](respondWithFilteredResult(_0x55e506,_0x31c4c7))[_0xae74('0x5f')](handleError(_0x55e506,null));};exports[_0xae74('0x60')]=function(_0x2b87f2,_0x5a2f42){var _0x5e0c9a={'raw':![],'where':{'id':_0x2b87f2['params']['id']},'include':[{'model':db[_0xae74('0x49')],'as':_0xae74('0x61')}]},_0x5156ae={};_0x5156ae[_0xae74('0x45')]=_[_0xae74('0x50')](db[_0xae74('0x4b')][_0xae74('0x4c')]);_0x5156ae[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x2b87f2[_0xae74('0x4f')]);_0x5156ae[_0xae74('0x51')]=_['intersection'](_0x5156ae[_0xae74('0x45')],_0x5156ae[_0xae74('0x4f')]);_0x5e0c9a[_0xae74('0x53')]=_[_0xae74('0x52')](_0x5156ae[_0xae74('0x45')],qs['fields'](_0x2b87f2[_0xae74('0x4f')]['fields']));_0x5e0c9a[_0xae74('0x53')]=_0x5e0c9a['attributes'][_0xae74('0x62')]?_0x5e0c9a[_0xae74('0x53')]:_0x5156ae[_0xae74('0x45')];if(_0x2b87f2[_0xae74('0x4f')][_0xae74('0x5b')]){_0x5e0c9a[_0xae74('0x5c')]=[{'all':!![]}];}_0x5e0c9a=_[_0xae74('0x5a')]({},_0x5e0c9a,_0x2b87f2[_0xae74('0x63')]);return db['ChatWebsite']['find'](_0x5e0c9a)[_0xae74('0x1a')](handleEntityNotFound(_0x5a2f42,null))['then'](respondWithResult(_0x5a2f42,null))[_0xae74('0x5f')](handleError(_0x5a2f42,null));};exports[_0xae74('0x64')]=function(_0x321f07,_0xebf918){return db['ChatWebsite'][_0xae74('0x64')](_0x321f07[_0xae74('0x65')],{})['then'](function(_0x198b23){var _0x29927a=_0x321f07[_0xae74('0x66')][_0xae74('0x30')]({'plain':!![]});if(!_0x29927a)throw new Error(_0xae74('0x67'));if(_0x29927a[_0xae74('0x68')]===_0xae74('0x66')){var _0x5c4d2f=_0x198b23[_0xae74('0x30')]({'plain':!![]});var _0x3cc7ab=_0xae74('0x31');return db[_0xae74('0x69')][_0xae74('0x6a')]({'where':{'name':_0x3cc7ab,'userProfileId':_0x29927a[_0xae74('0x6b')]},'raw':!![]})[_0xae74('0x1a')](function(_0x1d81bc){if(_0x1d81bc&&_0x1d81bc[_0xae74('0x6c')]===0x0){return db[_0xae74('0x6d')][_0xae74('0x64')]({'name':_0x5c4d2f[_0xae74('0x32')],'resourceId':_0x5c4d2f['id'],'type':_0x1d81bc[_0xae74('0x32')],'sectionId':_0x1d81bc['id']},{})['then'](function(){return _0x198b23;});}else{return _0x198b23;}})[_0xae74('0x5f')](function(_0x3987aa){logger[_0xae74('0x20')](_0xae74('0x6e'),_0x3987aa);throw _0x3987aa;});}return _0x198b23;})[_0xae74('0x1a')](respondWithResult(_0xebf918,0xc9))[_0xae74('0x5f')](handleError(_0xebf918,null));};exports[_0xae74('0x2e')]=function(_0x4fa017,_0xa0e302){if(_0x4fa017['body']['id']){delete _0x4fa017['body']['id'];}return db[_0xae74('0x4b')]['find']({'where':{'id':_0x4fa017[_0xae74('0x6f')]['id']},'include':[{'model':db[_0xae74('0x49')],'as':_0xae74('0x61')}]})[_0xae74('0x1a')](handleEntityNotFound(_0xa0e302,null))['then'](saveUpdates(_0x4fa017['body'],null))['then'](respondWithResult(_0xa0e302,null))['catch'](handleError(_0xa0e302,null));};exports[_0xae74('0x2f')]=function(_0x448b9e,_0x415513){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x448b9e['params']['id']}})['then'](handleEntityNotFound(_0x415513,null))['then'](removeEntity(_0x415513,null))[_0xae74('0x5f')](handleError(_0x415513,null));};exports[_0xae74('0x70')]=function(_0x350841,_0x329b22){return db[_0xae74('0x4b')][_0xae74('0x70')]()[_0xae74('0x1a')](respondWithResult(_0x329b22,null))[_0xae74('0x5f')](handleError(_0x329b22,null));};exports['addDisposition']=function(_0x40e0a3,_0x16ed5c){if(_0x40e0a3[_0xae74('0x65')]['id']){delete _0x40e0a3[_0xae74('0x65')]['id'];}return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x40e0a3[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x16ed5c,null))[_0xae74('0x1a')](function(_0x45084d){if(_0x45084d){_0x40e0a3[_0xae74('0x65')][_0xae74('0x71')]=_0x45084d['id'];return db[_0xae74('0x72')][_0xae74('0x64')](_0x40e0a3['body']);}})['then'](respondWithResult(_0x16ed5c,null))[_0xae74('0x5f')](handleError(_0x16ed5c,null));};exports[_0xae74('0x73')]=function(_0x1cefe4,_0x17b6ac){var _0x3ca005={'raw':![],'where':{}};var _0x34d9ab={};var _0x586e6b={'count':0x0,'rows':[]};return db[_0xae74('0x4b')][_0xae74('0x74')]({'where':{'id':_0x1cefe4[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x17b6ac,null))[_0xae74('0x1a')](function(_0x289274){if(_0x289274){_0x34d9ab[_0xae74('0x45')]=_['keys'](db[_0xae74('0x72')]['rawAttributes']);_0x34d9ab[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x1cefe4[_0xae74('0x4f')]);_0x34d9ab[_0xae74('0x51')]=_[_0xae74('0x52')](_0x34d9ab[_0xae74('0x45')],_0x34d9ab[_0xae74('0x4f')]);_0x3ca005[_0xae74('0x53')]=_[_0xae74('0x52')](_0x34d9ab[_0xae74('0x45')],qs[_0xae74('0x54')](_0x1cefe4[_0xae74('0x4f')][_0xae74('0x54')]));_0x3ca005[_0xae74('0x53')]=_0x3ca005[_0xae74('0x53')]['length']?_0x3ca005[_0xae74('0x53')]:_0x34d9ab['model'];if(!_0x1cefe4[_0xae74('0x4f')][_0xae74('0x55')](_0xae74('0x75'))){_0x3ca005['limit']=qs[_0xae74('0x29')](_0x1cefe4[_0xae74('0x4f')][_0xae74('0x29')]);_0x3ca005[_0xae74('0x2b')]=qs['offset'](_0x1cefe4[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x3ca005[_0xae74('0x76')]=qs['sort'](_0x1cefe4[_0xae74('0x4f')][_0xae74('0x56')]);_0x3ca005[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x1cefe4[_0xae74('0x4f')],_0x34d9ab[_0xae74('0x51')]));_0x3ca005[_0xae74('0x57')][_0xae74('0x71')]=_0x289274['id'];if(_0x1cefe4[_0xae74('0x4f')]['filter']){_0x3ca005['where']=_[_0xae74('0x5a')](_0x3ca005[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x3ca005[_0xae74('0x53')],function(_0x28cfbd){var _0x55195a={};_0x55195a[_0x28cfbd]={'$like':'%'+_0x1cefe4[_0xae74('0x4f')][_0xae74('0x58')]+'%'};return _0x55195a;})});}_0x3ca005=_[_0xae74('0x5a')]({},_0x3ca005,_0x1cefe4['options']);return db['Disposition'][_0xae74('0x2c')]({'where':_0x3ca005[_0xae74('0x57')]})['then'](function(_0x48d6f6){_0x586e6b['count']=_0x48d6f6;if(_0x1cefe4['query'][_0xae74('0x5b')]){_0x3ca005[_0xae74('0x5c')]=[{'all':!![]}];}return db[_0xae74('0x72')][_0xae74('0x5d')](_0x3ca005);})['then'](function(_0x34446f){_0x586e6b[_0xae74('0x5e')]=_0x34446f;return _0x586e6b;});}})['then'](respondWithFilteredResult(_0x17b6ac,_0x3ca005))[_0xae74('0x5f')](handleError(_0x17b6ac,null));};exports[_0xae74('0x78')]=function(_0x170a40,_0x557d0e){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x170a40['params']['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x557d0e,null))[_0xae74('0x1a')](function(_0x11f915){if(_0x11f915){return _0x11f915['removeDispositions'](_0x170a40[_0xae74('0x4f')][_0xae74('0x79')]);}})[_0xae74('0x1a')](respondWithStatusCode(_0x557d0e,null))[_0xae74('0x5f')](handleError(_0x557d0e,null));};exports[_0xae74('0x7a')]=function(_0x41a36a,_0x14f630){if(_0x41a36a['body']['id']){delete _0x41a36a[_0xae74('0x65')]['id'];}return db[_0xae74('0x4b')]['find']({'where':{'id':_0x41a36a[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x14f630,null))[_0xae74('0x1a')](function(_0x111161){if(_0x111161){_0x41a36a[_0xae74('0x65')]['ChatWebsiteId']=_0x111161['id'];return db[_0xae74('0x7b')][_0xae74('0x64')](_0x41a36a[_0xae74('0x65')]);}})[_0xae74('0x1a')](respondWithResult(_0x14f630,null))[_0xae74('0x5f')](handleError(_0x14f630,null));};exports[_0xae74('0x7c')]=function(_0x1b9059,_0x513bb1){var _0x47e9c9={'raw':![],'where':{}};var _0x5ccc48={};var _0x798cb6={'count':0x0,'rows':[]};return db[_0xae74('0x4b')]['findOne']({'where':{'id':_0x1b9059[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x513bb1,null))[_0xae74('0x1a')](function(_0x4a85a0){if(_0x4a85a0){_0x5ccc48['model']=_['keys'](db['CannedAnswer']['rawAttributes']);_0x5ccc48[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x1b9059['query']);_0x5ccc48[_0xae74('0x51')]=_[_0xae74('0x52')](_0x5ccc48[_0xae74('0x45')],_0x5ccc48[_0xae74('0x4f')]);_0x47e9c9[_0xae74('0x53')]=_[_0xae74('0x52')](_0x5ccc48[_0xae74('0x45')],qs['fields'](_0x1b9059[_0xae74('0x4f')][_0xae74('0x54')]));_0x47e9c9[_0xae74('0x53')]=_0x47e9c9['attributes'][_0xae74('0x62')]?_0x47e9c9[_0xae74('0x53')]:_0x5ccc48[_0xae74('0x45')];if(!_0x1b9059[_0xae74('0x4f')][_0xae74('0x55')](_0xae74('0x75'))){_0x47e9c9['limit']=qs[_0xae74('0x29')](_0x1b9059[_0xae74('0x4f')][_0xae74('0x29')]);_0x47e9c9['offset']=qs[_0xae74('0x2b')](_0x1b9059[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x47e9c9['order']=qs[_0xae74('0x56')](_0x1b9059[_0xae74('0x4f')]['sort']);_0x47e9c9[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x1b9059[_0xae74('0x4f')],_0x5ccc48[_0xae74('0x51')]));_0x47e9c9[_0xae74('0x57')][_0xae74('0x71')]=_0x4a85a0['id'];if(_0x1b9059[_0xae74('0x4f')][_0xae74('0x58')]){_0x47e9c9[_0xae74('0x57')]=_[_0xae74('0x5a')](_0x47e9c9[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x47e9c9[_0xae74('0x53')],function(_0x319cf7){var _0x1d314f={};_0x1d314f[_0x319cf7]={'$like':'%'+_0x1b9059[_0xae74('0x4f')][_0xae74('0x58')]+'%'};return _0x1d314f;})});}_0x47e9c9=_['merge']({},_0x47e9c9,_0x1b9059[_0xae74('0x63')]);return db[_0xae74('0x7b')][_0xae74('0x2c')]({'where':_0x47e9c9[_0xae74('0x57')]})[_0xae74('0x1a')](function(_0x48a83c){_0x798cb6['count']=_0x48a83c;if(_0x1b9059[_0xae74('0x4f')][_0xae74('0x5b')]){_0x47e9c9[_0xae74('0x5c')]=[{'all':!![]}];}return db[_0xae74('0x7b')][_0xae74('0x5d')](_0x47e9c9);})[_0xae74('0x1a')](function(_0x145f97){_0x798cb6[_0xae74('0x5e')]=_0x145f97;return _0x798cb6;});}})[_0xae74('0x1a')](respondWithFilteredResult(_0x513bb1,_0x47e9c9))[_0xae74('0x5f')](handleError(_0x513bb1,null));};exports[_0xae74('0x7d')]=function(_0x4549fc,_0x2dec6b){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x4549fc['params']['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x2dec6b,null))[_0xae74('0x1a')](function(_0x1161bd){if(_0x1161bd){return _0x1161bd[_0xae74('0x7d')](_0x4549fc['query'][_0xae74('0x79')]);}})[_0xae74('0x1a')](respondWithStatusCode(_0x2dec6b,null))[_0xae74('0x5f')](handleError(_0x2dec6b,null));};exports[_0xae74('0x7e')]=function(_0x72466a,_0x2f534d){_0x72466a['body'][_0xae74('0x7f')]=_0x72466a[_0xae74('0x80')][_0xae74('0x81')];return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x72466a[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x2f534d,null))[_0xae74('0x1a')](saveUpdates(_0x72466a[_0xae74('0x65')],null))[_0xae74('0x1a')](respondWithResult(_0x2f534d,null))[_0xae74('0x5f')](handleError(_0x2f534d,null));};exports[_0xae74('0x82')]=function(_0x359538,_0x34b76e){_0x359538[_0xae74('0x65')][_0xae74('0x83')]=_0x359538[_0xae74('0x80')][_0xae74('0x81')];return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x359538['params']['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x34b76e,null))[_0xae74('0x1a')](saveUpdates(_0x359538[_0xae74('0x65')],null))[_0xae74('0x1a')](respondWithResult(_0x34b76e,null))[_0xae74('0x5f')](handleError(_0x34b76e,null));};exports[_0xae74('0x84')]=function(_0xbd8a7f,_0x57d619){_0xbd8a7f[_0xae74('0x65')][_0xae74('0x85')]=_0xbd8a7f[_0xae74('0x80')][_0xae74('0x81')];return db[_0xae74('0x4b')]['find']({'where':{'id':_0xbd8a7f[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x57d619,null))['then'](saveUpdates(_0xbd8a7f[_0xae74('0x65')],null))[_0xae74('0x1a')](respondWithResult(_0x57d619,null))[_0xae74('0x5f')](handleError(_0x57d619,null));};exports[_0xae74('0x86')]=function(_0x1a01ca,_0x326a76){_0x1a01ca[_0xae74('0x65')][_0xae74('0x87')]=_0x1a01ca[_0xae74('0x80')][_0xae74('0x81')];return db['ChatWebsite'][_0xae74('0x6a')]({'where':{'id':_0x1a01ca[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x326a76,null))['then'](saveUpdates(_0x1a01ca[_0xae74('0x65')],null))[_0xae74('0x1a')](respondWithResult(_0x326a76,null))[_0xae74('0x5f')](handleError(_0x326a76,null));};exports['getLogo']=function(_0x33eea9,_0x77f068){var _0x57b4cc=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0x8a'));var _0x18f51d={'where':{'id':_0x33eea9['params']['id']},'attributes':['id',_0xae74('0x7f')],'raw':!![]};var _0x1cf4b9=![];return require(_0xae74('0x8b'))[_0xae74('0x8c')]()['then'](function(_0x2e01cd){if(_0x2e01cd){_0x1cf4b9=_0x2e01cd[_0xae74('0x8d')];}})['then'](function(){return db[_0xae74('0x4b')][_0xae74('0x6a')](_0x18f51d);})[_0xae74('0x1a')](handleEntityNotFound(_0x77f068,null))['then'](function(_0x334ac2){if(_0x334ac2){if(!_[_0xae74('0x8e')](_0x334ac2[_0xae74('0x7f')])){if(fs[_0xae74('0x8f')](path['join'](config[_0xae74('0x89')],_0xae74('0x90'),_0x334ac2['sitepic']))&&_0x1cf4b9){_0x57b4cc=path['join'](config['root'],_0xae74('0x90'),_0x334ac2['sitepic']);}}return _0x77f068[_0xae74('0x91')](_0x57b4cc);}})[_0xae74('0x5f')](handleError(_0x77f068,null));};exports[_0xae74('0x92')]=function(_0x5ea494,_0x25ab80){var _0x449afc=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0x93'));var _0x3b4224={'where':{'id':_0x5ea494[_0xae74('0x6f')]['id']},'attributes':['id',_0xae74('0x83')],'raw':!![]};return db[_0xae74('0x4b')][_0xae74('0x6a')](_0x3b4224)[_0xae74('0x1a')](handleEntityNotFound(_0x25ab80,null))['then'](function(_0x32d452){if(_0x32d452){if(!_[_0xae74('0x8e')](_0x32d452[_0xae74('0x83')])){if(fs[_0xae74('0x8f')](path[_0xae74('0x88')](config[_0xae74('0x89')],'server/files/images/avatars/',_0x32d452['agentAvatar']))){_0x449afc=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0x94'),_0x32d452[_0xae74('0x83')]);}}return _0x25ab80['download'](_0x449afc);}})[_0xae74('0x5f')](handleError(_0x25ab80,null));};exports['getCustomerAvatar']=function(_0x4589b0,_0x3179e2){var _0x4f2c23=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0x95'));var _0x4b621c={'where':{'id':_0x4589b0['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xae74('0x4b')][_0xae74('0x6a')](_0x4b621c)[_0xae74('0x1a')](handleEntityNotFound(_0x3179e2,null))[_0xae74('0x1a')](function(_0x44d20b){if(_0x44d20b){if(!_[_0xae74('0x8e')](_0x44d20b[_0xae74('0x85')])){if(fs[_0xae74('0x8f')](path['join'](config[_0xae74('0x89')],_0xae74('0x94'),_0x44d20b[_0xae74('0x85')]))&&_0x44d20b[_0xae74('0x96')]){_0x4f2c23=path['join'](config[_0xae74('0x89')],'server/files/images/avatars/',_0x44d20b[_0xae74('0x85')]);}}return _0x3179e2[_0xae74('0x91')](_0x4f2c23);}})[_0xae74('0x5f')](handleError(_0x3179e2,null));};exports['getSystemAvatar']=function(_0x2ab85b,_0x5d01a6){var _0x3624e9=path['join'](config[_0xae74('0x89')],_0xae74('0x97'));var _0x2214a2={'where':{'id':_0x2ab85b[_0xae74('0x6f')]['id']},'attributes':['id',_0xae74('0x87')],'raw':!![]};return db[_0xae74('0x4b')]['find'](_0x2214a2)['then'](handleEntityNotFound(_0x5d01a6,null))['then'](function(_0x247496){if(_0x247496){if(!_[_0xae74('0x8e')](_0x247496[_0xae74('0x87')])){if(fs['existsSync'](path[_0xae74('0x88')](config['root'],_0xae74('0x94'),_0x247496[_0xae74('0x87')]))){_0x3624e9=path['join'](config[_0xae74('0x89')],_0xae74('0x94'),_0x247496[_0xae74('0x87')]);}}return _0x5d01a6[_0xae74('0x91')](_0x3624e9);}})[_0xae74('0x5f')](handleError(_0x5d01a6,null));};exports[_0xae74('0x98')]=function(_0x4b9faa,_0x1ec753){var _0x455532={'body':_0x4b9faa[_0xae74('0x65')],'channel':_0xae74('0x99')};var _0x40238d=[];var _0x511669=[];var _0x380769={};var _0x59e419=![];if(_0x4b9faa[_0xae74('0x65')]['id']){delete _0x4b9faa[_0xae74('0x65')]['id'];}if(_[_0xae74('0x8e')](_0x4b9faa['body']['from'])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xae74('0x8e')](_0x4b9faa[_0xae74('0x65')]['mapKey'])){throw new APIBadRequestError(_0xae74('0x9a'));}if(_[_0xae74('0x9b')](_0x4b9faa[_0xae74('0x65')][_0xae74('0x65')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}return db['CmContact'][_0xae74('0x70')]()[_0xae74('0x1a')](function(_0x581fa4){if(!_0x581fa4){throw new Error(_0xae74('0x9c'));}_0x40238d=Object[_0xae74('0x50')](_0x581fa4)[_0xae74('0x58')](function(_0x5b5b9a){return![_0xae74('0x9d'),_0xae74('0x9e')][_0xae74('0x9f')](_0x5b5b9a);});_0x511669=Object[_0xae74('0x50')](_0x581fa4)[_0xae74('0x58')](function(_0x567c6b){return!['createdAt',_0xae74('0x9e'),_0xae74('0xa0'),'ListId'][_0xae74('0x9f')](_0x567c6b);});if(!_[_0xae74('0x9f')](_0x511669,_0x4b9faa['body'][_0xae74('0xa1')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x511669[_0xae74('0x88')](',\x20'));}_0x380769[_0x4b9faa[_0xae74('0x65')][_0xae74('0xa1')]]=_0x4b9faa[_0xae74('0x65')]['from'];})[_0xae74('0x1a')](function(){return db['ChatWebsite'][_0xae74('0x6a')]({'where':{'id':_0x4b9faa[_0xae74('0x6f')]['id']},'include':[{'model':db[_0xae74('0xa2')],'as':_0xae74('0xa3'),'include':[{'model':db['CmContact'],'as':_0xae74('0xa4'),'where':_0x380769,'limit':0x1,'order':[[_0xae74('0x9e'),'DESC']]}]},{'model':db[_0xae74('0xa5')],'as':_0xae74('0xa6')},{'model':db['Interval'],'as':_0xae74('0xa7'),'include':[{'model':db[_0xae74('0xa7')],'as':_0xae74('0xa8'),'attributes':['id',_0xae74('0xa9')],'raw':!![]}]}]});})[_0xae74('0x1a')](function(_0x4cce7d){if(!_0x4cce7d){throw new APINotFoundError(util[_0xae74('0x3f')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x4b9faa['params']['id']));}var _0x309bc9=_0x4cce7d['Interval'];if(_0x309bc9){var _0x55f0c0=_0x4cce7d[_0xae74('0xaa')]||undefined;return _0x309bc9[_0xae74('0xab')](_0x55f0c0)[_0xae74('0x1a')](function(_0x36516f){if(!_0x36516f){throw new APIOutOfIntervalError();}return _0x4cce7d;});}else{return _0x4cce7d;}})[_0xae74('0x1a')](function(_0x36e193){if(!_0x36e193['List']){return;}_0x455532[_0xae74('0xac')]=_0x36e193;_0x455532[_0xae74('0xad')]=_0x36e193[_0xae74('0xa3')];_0x455532[_0xae74('0xae')]=_['orderBy'](_0x36e193[_0xae74('0xa6')],[_0xae74('0xaf')],[_0xae74('0xb0')]);if(_0x455532[_0xae74('0xac')]['Applications']){delete _0x455532[_0xae74('0xac')][_0xae74('0xa6')];}if(_0x455532[_0xae74('0xac')][_0xae74('0xa3')]&&_0x455532['account'][_0xae74('0xa3')][_0xae74('0xa4')][_0xae74('0x62')]){return _0x455532['account'][_0xae74('0xa3')][_0xae74('0xa4')][0x0];}var _0x5b19e7=_[_0xae74('0x12')](_0x4b9faa['body'],{'firstName':_0x4b9faa['body'][_0xae74('0xb1')],'ListId':_0x36e193[_0xae74('0xb2')]});_0x5b19e7[_0x4b9faa[_0xae74('0x65')]['mapKey']]=_0x4b9faa[_0xae74('0x65')][_0xae74('0xb1')];return db[_0xae74('0xb3')][_0xae74('0x64')](_0x5b19e7,{'fields':_0x40238d,'raw':!![]});})['then'](function(_0x2241f4){_0x455532[_0xae74('0xb4')]=_0x2241f4;var _0x2f1727=createInteractionObject(_0x4b9faa[_0xae74('0x6f')]['id'],_0x4b9faa[_0xae74('0x65')],_0x4b9faa[_0xae74('0xb5')],_0x2241f4);var _0x2dac8a={'ChatWebsiteId':_0x4b9faa['params']['id']};if(_0x4b9faa[_0xae74('0x65')][_0xae74('0xb6')]){_0x2dac8a[_0xae74('0xb6')]=_0x4b9faa[_0xae74('0x65')][_0xae74('0xb6')];_0x2dac8a[_0xae74('0xb7')]=![];return db[_0xae74('0xb8')][_0xae74('0x6a')]({'where':_0x2dac8a})['then'](function(_0x242a37){var _0x5ebcfd=_0x4b9faa[_0xae74('0x65')][_0xae74('0x36')]&&_0x4b9faa[_0xae74('0x65')][_0xae74('0x3d')];if(_0x242a37){_0x59e419=!![];return _0x242a37;}else if(!_0x5ebcfd&&_0x242a37&&_0x242a37['closed']){throw new APIConflictError(_0xae74('0xb9'));}_0x2f1727['threadId']=_0x4b9faa[_0xae74('0x65')][_0xae74('0xb6')];_0x2f1727[_0xae74('0xba')]=_0x4b9faa[_0xae74('0x65')][_0xae74('0xba')];return db[_0xae74('0xb8')][_0xae74('0x64')](_0x2f1727);});}_0x2dac8a[_0xae74('0xbb')]=_0x2241f4['id'];if(_0x4b9faa[_0xae74('0x65')]['interaction']&&_0x4b9faa['body'][_0xae74('0xbc')]['id']){_0x2dac8a['id']=_0x4b9faa['body']['interaction']['id'];return db[_0xae74('0xb8')]['find']({'where':_0x2dac8a})['then'](function(_0x3180f6){var _0x1c47a5=_0x4b9faa[_0xae74('0x65')]['customerIp']&&_0x4b9faa['body'][_0xae74('0x3d')];if(!_0x1c47a5&&_0x3180f6&&_0x3180f6[_0xae74('0xb7')]){throw new APIConflictError(_0xae74('0xb9'));}else if(_0x3180f6){_0x59e419=!![];return _0x3180f6;}else{return db[_0xae74('0xb8')][_0xae74('0x64')](_0x2f1727);}});}return db['ChatInteraction'][_0xae74('0x64')](_0x2f1727);})[_0xae74('0x1a')](function(_0x29d9e4){if(!_0x59e419){return _0x29d9e4;}var _0x8c9b8b={'from':(_0x455532[_0xae74('0xb4')][_0xae74('0xbd')]||'')+'\x20'+(_0x455532[_0xae74('0xb4')][_0xae74('0x3b')]||'')};if(_0x4b9faa[_0xae74('0x65')]['threadId']&&_0x4b9faa[_0xae74('0x65')]['messageId']&&_0x4b9faa['body'][_0xae74('0xb6')]!=_0x4b9faa[_0xae74('0x65')]['messageId']){_0x8c9b8b[_0xae74('0xb6')]=_0x4b9faa[_0xae74('0x65')][_0xae74('0xbe')];}return _0x29d9e4['update'](_0x8c9b8b);})[_0xae74('0x1a')](function(_0x2e497a){_0x455532['interaction']=_0x2e497a['get']({'plain':!![]});_0x455532[_0xae74('0xbc')][_0xae74('0xbf')]=!_0x59e419;if(_0x455532[_0xae74('0xbc')]['created']){if(_0x455532[_0xae74('0xac')][_0xae74('0xc0')]){_0x455532[_0xae74('0xae')][_0xae74('0xc1')]({'id':0x0,'priority':_0x455532[_0xae74('0xae')][_0xae74('0x62')]+0x1,'app':_0xae74('0xc2'),'appdata':_0xae74('0xc3'),'interval':_0xae74('0xc4')});}}return db[_0xae74('0xc5')][_0xae74('0x64')]({'body':_0x4b9faa[_0xae74('0x65')][_0xae74('0x65')],'ChatWebsiteId':_0x4b9faa[_0xae74('0x6f')]['id'],'ChatInteractionId':_0x2e497a['id'],'direction':'in','ContactId':_0x455532[_0xae74('0xb4')]['id'],'AttachmentId':_0x4b9faa[_0xae74('0x65')][_0xae74('0xc6')]});})[_0xae74('0x1a')](function(_0x14bace){_0x455532['message']=_0x14bace;if(!_0x455532[_0xae74('0xbc')][_0xae74('0xc7')]){return;}return db[_0xae74('0xc8')][_0xae74('0x6a')]({'attributes':['id',_0xae74('0x32')],'where':{'id':_0x455532['interaction'][_0xae74('0xc7')]}});})[_0xae74('0x1a')](function(_0x23a851){if(_0x23a851){_0x455532[_0xae74('0xae')]['unshift']({'id':0x0,'priority':0x0,'app':_0xae74('0xc9'),'appdata':_0x23a851[_0xae74('0x32')]+','+(_0x455532['account'][_0xae74('0xca')]||0xa),'interval':_0xae74('0xc4')});_0x455532[_0xae74('0xcb')]=!![];}if(!_0x455532[_0xae74('0xbc')][_0xae74('0xcc')]){return;}return db[_0xae74('0xcd')]['find']({'attributes':['id',_0xae74('0x32')],'where':{'id':_0x455532[_0xae74('0xbc')][_0xae74('0xcc')]}});})[_0xae74('0x1a')](function(_0x379da8){if(_0x379da8){_0x455532[_0xae74('0xae')]['unshift']({'id':0x0,'priority':0x1,'app':_0xae74('0xce'),'appdata':_0x379da8[_0xae74('0x32')]+','+(_0x455532['account'][_0xae74('0xcf')]||0x12c),'interval':_0xae74('0xc4')});}return respondWithRpcPromise(_0xae74('0xd0'),'startRouting',_0x455532);})[_0xae74('0x1a')](function(_0x29cabb){respondWithRpcPromise(_0xae74('0xd1'),_0xae74('0xd1'),{'event':'notify','message':_0x29cabb},client9002);return _0x29cabb;})[_0xae74('0x1a')](respondWithResult(_0x1ec753,null))[_0xae74('0x5f')](APIHandleError(_0x1ec753));};exports['offline']=function(_0x12b743,_0x287f4e){var _0x59fd0e,_0x30e5b4,_0x3914d8;var _0x512a12=[];var _0x27111c={};var _0x2aa8f1=_0x12b743[_0xae74('0xd2')]||[];var _0x1c291b=[];var _0x5d96b3;return db['CmContact']['describe']()[_0xae74('0x1a')](function(_0x2a8769){if(!_0x2a8769){throw new db['Sequelize'][(_0xae74('0xd3'))]('no\x20available\x20attributes');}_0x512a12=_[_0xae74('0xd4')](_[_0xae74('0x50')](_0x2a8769),[_0xae74('0x9d'),'updatedAt',_0xae74('0xa0'),'ListId']);if(_0x12b743['body']['id']){delete _0x12b743[_0xae74('0x65')]['id'];}if(_[_0xae74('0x8e')](_0x12b743[_0xae74('0x65')][_0xae74('0xb1')])){throw _0x287f4e[_0xae74('0x26')](0x1f4)[_0xae74('0xd5')](new db[(_0xae74('0xd6'))][(_0xae74('0xd3'))](_0xae74('0xd7')));}if(_[_0xae74('0x8e')](_0x12b743['body']['body'])||_0x12b743[_0xae74('0x65')][_0xae74('0x65')]===''){throw _0x287f4e['status'](0x1f4)[_0xae74('0xd5')](new db[(_0xae74('0xd6'))]['ValidationError'](_0xae74('0xd8')));}if(_[_0xae74('0x8e')](_0x12b743[_0xae74('0x65')][_0xae74('0xd9')])){throw _0x287f4e[_0xae74('0x26')](0x1f4)[_0xae74('0xd5')](new db[(_0xae74('0xd6'))][(_0xae74('0xd3'))](_0xae74('0xda')+_0x512a12));}if(!_['includes'](_0x512a12,_0x12b743['body']['mapKeyOffline'])){throw _0x287f4e[_0xae74('0x26')](0x1f4)[_0xae74('0xd5')](new db[(_0xae74('0xd6'))][(_0xae74('0xd3'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x512a12));}_0x27111c[_0x12b743[_0xae74('0x65')][_0xae74('0xd9')]]=_0x12b743[_0xae74('0x65')]['from'];})[_0xae74('0x1a')](function(){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x12b743['params']['id']},'include':[{'model':db[_0xae74('0xa2')],'as':_0xae74('0xa3')},{'model':db[_0xae74('0xdb')],'as':_0xae74('0xdb')}]});})['then'](handleEntityNotFound(_0x287f4e,null))[_0xae74('0x1a')](function(_0x28b24c){if(_0x28b24c&&_0x28b24c['List']){_0x30e5b4=_0x28b24c;var _0x34c879=_['defaults'](_0x12b743['body'],{'firstName':_0x12b743[_0xae74('0x65')]['from'],'phone':_0x12b743[_0xae74('0x65')][_0xae74('0xb1')],'ListId':_0x28b24c[_0xae74('0xb2')]});_0x34c879[_0x12b743['body'][_0xae74('0xd9')]]=_0x12b743['body'][_0xae74('0xb1')];return db['CmContact'][_0xae74('0xdc')]({'where':_0x27111c,'defaults':_0x34c879});}})[_0xae74('0xdd')](function(_0x9fc67f){if(_0x9fc67f){_0x3914d8=_0x9fc67f;var _0x2409e8=fs[_0xae74('0xde')](path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0xdf')),_0xae74('0xe0'));var _0x100e6d=ejs[_0xae74('0xe1')](_0x2409e8,{'body':_['toPairs'](_0x12b743[_0xae74('0x65')][_0xae74('0x65')]),'bodyTitle':_0x30e5b4[_0xae74('0xe2')]});return db['ChatOfflineMessage']['create']({'body':_0x100e6d,'plainBody':htmlToText[_0xae74('0xe3')](_0x100e6d),'ContactId':_0x9fc67f['id'],'ChatWebsiteId':_0x30e5b4['id']});}})[_0xae74('0x1a')](function(_0x4633be){_0x5d96b3=_0x4633be;if(_0x2aa8f1['length']){var _0x2a4ba6=_0x2aa8f1['map'](function(_0x567430){return{'name':_0x567430[_0xae74('0xe4')],'basename':_0x567430['filename'],'type':_0x567430[_0xae74('0xe5')],'ChatOfflineMessageId':_0x4633be['id']};});_0x1c291b=_0x2a4ba6[_0xae74('0x4a')](_0x4c93d5=>{var _0x35496e={'filename':_0x4c93d5[_0xae74('0x32')],'path':path[_0xae74('0x88')](config['root'],'server','files','attachments',_0xae74('0xe6'),_0x4c93d5[_0xae74('0xe7')])};return _0x35496e;});if(!_0x30e5b4[_0xae74('0xe8')]){return db[_0xae74('0xe9')]['transaction'](function(_0x260b36){return db[_0xae74('0xea')]['bulkCreate'](_0x2a4ba6,{'transaction':_0x260b36});});}}})[_0xae74('0x1a')](function(){if(_0x5d96b3){_0x59fd0e=_0x5d96b3;return db[_0xae74('0xdb')][_0xae74('0x74')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xae74('0xeb'),'raw':!![],'include':[{'model':db[_0xae74('0xec')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x1f12c8){if(_0x1f12c8&&_0x1f12c8[_0xae74('0xeb')]&&_0x30e5b4[_0xae74('0xed')]&&_0x30e5b4[_0xae74('0xee')]){var _0x237c71=_0x1f12c8[_0xae74('0xef')]();return respondWithRpcPromise('SendMail',_0xae74('0xf0'),{'account':_0x237c71,'message':{'from':util[_0xae74('0x3f')](_0xae74('0xf1'),_0x1f12c8['name'],_0x1f12c8[_0xae74('0xf2')]||_0x1f12c8[_0xae74('0xeb')][_0xae74('0x66')]),'to':_0x30e5b4[_0xae74('0xee')],'subject':_0x30e5b4['offlineMessageSubject'],'html':_0x59fd0e[_0xae74('0x65')],'attachments':_0x1c291b}},client9003)['then'](function(){return _0x59fd0e;})[_0xae74('0x5f')](function(_0x5c5c62){logger[_0xae74('0x20')](_0x5c5c62);});}})['then'](function(){if(_0x30e5b4&&_0x30e5b4['openNewInteraction']&&_0x30e5b4['MailAccountId']){var _0x243641=[];if(_0x2aa8f1[_0xae74('0x62')]){_0x243641=_0x2aa8f1[_0xae74('0x4a')](function(_0x14e30e){return{'name':_0x14e30e['originalname'],'basename':_0x14e30e[_0xae74('0x81')],'type':_0x14e30e['mimetype'],'ChatOfflineMessageId':_0x5d96b3['id']};});}var _0x4c6df1;if(!_[_0xae74('0x8e')](_0x30e5b4[_0xae74('0xf3')])){var _0x17a381=_['map'](_0x12b743['body'],function(_0x54798d){return _0x54798d;});var _0xcb2242=_[_0xae74('0xf4')](_0x17a381)[0x0];var _0xbac381=_[_0xae74('0xf5')](_0xcb2242,function(_0xa7c81f){return _0xa7c81f;});_0x4c6df1=_0xbac381[0x1][_0x30e5b4[_0xae74('0xf3')]];}var _0x382e8b={'from':_0x3914d8[_0xae74('0xf2')],'firstName':_0x3914d8['firstName'],'lastName':_0x3914d8[_0xae74('0x3b')],'mapKey':_0xae74('0xf2'),'message':{'from':_0x3914d8[_0xae74('0xf2')],'to':_0x30e5b4[_0xae74('0xdb')][_0xae74('0xf2')],'cc':'','subject':_[_0xae74('0x8e')](_0x4c6df1)?_0x30e5b4[_0xae74('0xf6')]:_0x4c6df1,'messageId':'','sentAt':new Date(),'attach':_0x243641['length'],'attachments':_0x243641,'originChannel':_0xae74('0xf7'),'ChatWebsiteId':_0x30e5b4['id'],'ChatOfflineMessageId':_0x59fd0e['id'],'originTo':_0x30e5b4['MailAccount'][_0xae74('0xf2')]},'body':_0x59fd0e[_0xae74('0x65')]};var _0x2a26a5={'account':{'id':_0x30e5b4[_0xae74('0xf8')]},'body':_0x382e8b,'log':_0xae74('0xf9')};return respondWithRpcPromise(_0xae74('0xf9'),_0xae74('0xfa'),_0x2a26a5,client9001)[_0xae74('0x1a')](function(){return _0x59fd0e;})[_0xae74('0x5f')](function(_0x31938c){logger[_0xae74('0x20')](_0x31938c);});}return;})[_0xae74('0x1a')](function(){if(_0x59fd0e){return _0x59fd0e;}})[_0xae74('0x1a')](respondWithResult(_0x287f4e,null))['catch'](function(){for(var _0x5db03b of _0x2aa8f1){var _0x4cebd8=path[_0xae74('0x88')](config[_0xae74('0x89')],_0xae74('0xfb'),'files',_0xae74('0xfc'),_0xae74('0xe6'),_0x5db03b[_0xae74('0x81')]);fs_extra[_0xae74('0xfd')](_0x4cebd8)['catch'](function(_0x577fb7){logger[_0xae74('0x20')](_0xae74('0xfe'),_0x4cebd8,_0x577fb7);});}});};exports[_0xae74('0xff')]=function(_0x130421,_0x519e3d){return db[_0xae74('0xb8')][_0xae74('0x6a')]({'where':{'id':_0x130421[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x519e3d,null))[_0xae74('0x1a')](function(_0x24c8ab){if(_0x24c8ab){return _0x24c8ab[_0xae74('0xff')](_0x130421[_0xae74('0x65')][_0xae74('0x79')],_[_0xae74('0x100')](_0x130421['body'],[_0xae74('0x79'),'id'])||{});}})[_0xae74('0x1a')](respondWithResult(_0x519e3d,null))[_0xae74('0x5f')](handleError(_0x519e3d,null));};exports[_0xae74('0x101')]=function(_0x4c2a28,_0x486f4f){var _0x243813={'raw':![],'where':{}};var _0x203220={};var _0x5001bd={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x4c2a28[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x486f4f,null))['then'](function(_0x5b37fe){if(_0x5b37fe){_0x203220['model']=_[_0xae74('0x50')](db[_0xae74('0xb8')]['rawAttributes']);_0x203220[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x4c2a28[_0xae74('0x4f')]);_0x203220[_0xae74('0x51')]=_[_0xae74('0x52')](_0x203220[_0xae74('0x45')],_0x203220[_0xae74('0x4f')]);_0x243813[_0xae74('0x53')]=_[_0xae74('0x52')](_0x203220['model'],qs[_0xae74('0x54')](_0x4c2a28[_0xae74('0x4f')][_0xae74('0x54')]));_0x243813[_0xae74('0x53')]=_0x243813[_0xae74('0x53')][_0xae74('0x62')]?_0x243813['attributes']:_0x203220[_0xae74('0x45')];if(!_0x4c2a28[_0xae74('0x4f')][_0xae74('0x55')]('nolimit')){_0x243813[_0xae74('0x29')]=qs['limit'](_0x4c2a28[_0xae74('0x4f')][_0xae74('0x29')]);_0x243813['offset']=qs['offset'](_0x4c2a28[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x243813[_0xae74('0x76')]=qs[_0xae74('0x56')](_0x4c2a28[_0xae74('0x4f')][_0xae74('0x56')]);_0x243813[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x4c2a28[_0xae74('0x4f')],_0x203220[_0xae74('0x51')]));_0x243813[_0xae74('0x57')][_0xae74('0x71')]=_0x5b37fe['id'];if(_0x4c2a28[_0xae74('0x4f')]['filter']){_0x243813[_0xae74('0x57')]=_['merge'](_0x243813[_0xae74('0x57')],{'$or':_['map'](_0x243813[_0xae74('0x53')],function(_0x127f76){var _0x478e26={};_0x478e26[_0x127f76]={'$like':'%'+_0x4c2a28[_0xae74('0x4f')][_0xae74('0x58')]+'%'};return _0x478e26;})});}_0x243813=_[_0xae74('0x5a')]({},_0x243813,_0x4c2a28[_0xae74('0x63')]);return db['ChatInteraction'][_0xae74('0x2c')]({'where':_0x243813[_0xae74('0x57')]})['then'](function(_0x33f421){_0x5001bd[_0xae74('0x2c')]=_0x33f421;if(_0x4c2a28['query']['includeAll']){_0x243813[_0xae74('0x5c')]=[{'model':db[_0xae74('0xb3')],'as':'Contact','required':![]},{'model':db[_0xae74('0xc8')],'as':_0xae74('0x102'),'attributes':[_0xae74('0x32'),_0xae74('0x103'),_0xae74('0x104')],'required':![]},{'model':db[_0xae74('0x105')],'as':_0xae74('0x106'),'attributes':['id','name',_0xae74('0x107')],'where':_0x4c2a28[_0xae74('0x4f')][_0xae74('0x108')]?{'id':_0x4c2a28[_0xae74('0x4f')][_0xae74('0x108')]}:undefined,'required':_0x4c2a28[_0xae74('0x4f')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0xae74('0x5d')](_0x243813);})[_0xae74('0x1a')](function(_0x262bdb){_0x5001bd['rows']=_0x262bdb;return _0x5001bd;});}})[_0xae74('0x1a')](respondWithFilteredResult(_0x486f4f,_0x243813))[_0xae74('0x5f')](handleError(_0x486f4f,null));};exports[_0xae74('0x109')]=function(_0x4539b8,_0x1197fe){var _0x5920ea=0x0;var _0xf304a3=0x0;var _0x32d22b=![];var _0x4fb15e;var _0x13b4a7;return db['ChatWebsite'][_0xae74('0x6a')]({'where':{'id':_0x4539b8[_0xae74('0x6f')]['id']},'include':[{'model':db[_0xae74('0xa7')],'as':_0xae74('0xa7'),'include':[{'model':db[_0xae74('0xa7')],'as':_0xae74('0xa8'),'attributes':['id',_0xae74('0xa9')]}]}]})[_0xae74('0x1a')](handleEntityNotFound(_0x1197fe,null))['then'](function(_0x2c46d1){if(_0x2c46d1){_0x4fb15e=_0x2c46d1;return _0x2c46d1[_0xae74('0x10a')]({'raw':!![]});}})[_0xae74('0x1a')](function(_0x140122){if(_0x4fb15e){if(_0x140122){_0x13b4a7=_0x140122;}}return require(_0xae74('0x8b'))[_0xae74('0x8c')]();})[_0xae74('0x1a')](function(_0x5f4fd5){if(_0x5f4fd5){_0xf304a3=_0x5f4fd5[_0xae74('0x10b')];_0x32d22b=_0x5f4fd5[_0xae74('0x8d')];}})[_0xae74('0x1a')](function(){return db[_0xae74('0xb8')]['count']({'where':{'closed':![]}});})[_0xae74('0x1a')](function(_0x2f9572){_0x5920ea=_0x2f9572;if(_0xf304a3&&_0x2f9572>_0xf304a3){return db[_0xae74('0x10c')]['findOne']({'where':{'id':0x1}})['then'](function(_0x5555ea){if(_0x5555ea){_0x5555ea[_0xae74('0x10d')]('chatLicenseExceeded');}});}})[_0xae74('0x1a')](function(){var _0x517b9c=_0x4fb15e['Interval'];var _0x48f74d=_0x4fb15e[_0xae74('0xaa')]||undefined;return _0x517b9c?_0x517b9c[_0xae74('0xab')](_0x48f74d):!![];})[_0xae74('0x1a')](function(_0x2bc9f3){var _0x4dd62c=fs[_0xae74('0xde')](path['join'](config[_0xae74('0x89')],_0xae74('0x10e')),_0xae74('0xe0'));var _0x4f9beb=new url[(_0xae74('0x10f'))](_0x4fb15e[_0xae74('0x110')])[_0xae74('0x111')];var _0x4fde0d=_0xae74('0x112');var _0x4543fe=![];var _0x36f01b={'chatVersion':_0x4fde0d,'chatWebsiteAddressOrigin':_0x4f9beb,'remote':_0x4fb15e[_0xae74('0x113')],'query':querystring['stringify'](_[_0xae74('0x5a')](_0x4fb15e[_0xae74('0x30')]({'plain':!![]}),{'customerIp':_0x4539b8[_0xae74('0xb5')][_0xae74('0x39')]||_0x4539b8[_0xae74('0xb5')][_0xae74('0x114')]||_0x4539b8[_0xae74('0x115')][_0xae74('0x116')]||_0x4539b8['ip'],'referer':_0x4539b8['headers'][_0xae74('0x3d')],'openedInteractions':_0x5920ea,'maxInteractions':_0xf304a3,'virtual':_0x32d22b['virtual'],'online':_0x2bc9f3,'custom':_0x32d22b}))[_0xae74('0x117')](/'/g,'\x5c\x27')};_0x1197fe[_0xae74('0xd5')](ejs['render'](Mustache[_0xae74('0xe1')](_0x4dd62c,_0x36f01b),{'proactiveActions':_0x13b4a7,'alignment':_0x4fb15e[_0xae74('0x118')],'verticalAlignment':_0x4fb15e['verticalAlignment'],'div_color':_0x4fb15e[_0xae74('0x107')],'labelText':_0x4fb15e[_0xae74('0x119')],'text_color':_0x4fb15e['textColor'],'text_button_color':_0x4fb15e[_0xae74('0x11a')],'button_color':_0x4fb15e[_0xae74('0x11b')],'background_color':_0x4fb15e[_0xae74('0x11c')],'hideWhenOffline':_0x4fb15e['hideWhenOffline'],'intervalId':_0x4fb15e[_0xae74('0x11d')],'isDevelopment':_0x4543fe,'chatVersion':_0x4fde0d}));})[_0xae74('0x5f')](handleError(_0x1197fe,null));};exports['addApplications']=function(_0x2ac04b,_0x82425a){var _0x5f21dd=_0x2ac04b[_0xae74('0x6f')]['id'];var _0x3a3429=_0x2ac04b[_0xae74('0x65')];var _0x287fbd=0xc8;var _0x495bb3=null;return db[_0xae74('0xe9')][_0xae74('0x11e')]({'isolationLevel':db[_0xae74('0xe9')]['Transaction'][_0xae74('0x11f')]['READ_COMMITTED']},function(_0x4df064){return db['ChatWebsite']['findOne']({'where':{'id':_0x5f21dd},'transaction':_0x4df064})[_0xae74('0x1a')](function(_0x594ba1){if(_0x594ba1){return db[_0xae74('0xa5')][_0xae74('0x2f')]({'where':{'ChatWebsiteId':_0x5f21dd},'transaction':_0x4df064})[_0xae74('0x1a')](function(){var _0x32612f=_[_0xae74('0x4a')](_0x3a3429,function(_0x49b82a){_0x49b82a[_0xae74('0x71')]=_0x5f21dd;return _0x49b82a;});return db['ChatApplication'][_0xae74('0x120')](_0x32612f,{'transaction':_0x4df064});});}else{_0x287fbd=0x194;_0x495bb3=[];}});})['then'](function(){if(_0x287fbd!==0x194){return db['ChatApplication'][_0xae74('0x121')]({'where':{'ChatWebsiteId':_0x5f21dd},'order':_0xae74('0xaf')})[_0xae74('0x1a')](function(_0x24158c){_0x495bb3=_0x24158c;});}})[_0xae74('0x5f')](function(_0x14bbd7){_0x287fbd=0x1f4;logger[_0xae74('0x20')](_0x14bbd7[_0xae74('0x122')]);if(_0x14bbd7[_0xae74('0x32')]){delete _0x14bbd7[_0xae74('0x32')];}_0x495bb3=_0x14bbd7;})[_0xae74('0x123')](function(){if(_0x495bb3===null){_0x82425a[_0xae74('0x25')](_0x287fbd);}else{if(_0x287fbd===0x1f4){_0x82425a['status'](_0x287fbd)[_0xae74('0xd5')](_0x495bb3);}else{_0x82425a[_0xae74('0x26')](_0x287fbd)[_0xae74('0x28')](_0x495bb3);}}});};exports[_0xae74('0x124')]=function(_0x24336c,_0x45b809){var _0x2259dc={};var _0x397578={};var _0x356b05;var _0x2de15e;return db[_0xae74('0x4b')]['findOne']({'where':{'id':_0x24336c[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x45b809,null))[_0xae74('0x1a')](function(_0xe0010d){if(_0xe0010d){_0x356b05=_0xe0010d;_0x397578[_0xae74('0x45')]=_[_0xae74('0x50')](db['ChatApplication']['rawAttributes']);_0x397578[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x24336c[_0xae74('0x4f')]);_0x397578[_0xae74('0x51')]=_['intersection'](_0x397578[_0xae74('0x45')],_0x397578[_0xae74('0x4f')]);_0x2259dc['attributes']=_[_0xae74('0x52')](_0x397578[_0xae74('0x45')],qs[_0xae74('0x54')](_0x24336c[_0xae74('0x4f')][_0xae74('0x54')]));_0x2259dc['attributes']=_0x2259dc[_0xae74('0x53')][_0xae74('0x62')]?_0x2259dc['attributes']:_0x397578['model'];_0x2259dc[_0xae74('0x76')]=qs[_0xae74('0x56')](_0x24336c[_0xae74('0x4f')][_0xae74('0x56')]);_0x2259dc[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x24336c[_0xae74('0x4f')],_0x397578[_0xae74('0x51')]));if(_0x24336c[_0xae74('0x4f')]['filter']){_0x2259dc[_0xae74('0x57')]=_[_0xae74('0x5a')](_0x2259dc[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x2259dc['attributes'],function(_0x525870){var _0x3743e6={};_0x3743e6[_0x525870]={'$like':'%'+_0x24336c[_0xae74('0x4f')]['filter']+'%'};return _0x3743e6;})});}_0x2259dc=_[_0xae74('0x5a')]({},_0x2259dc,_0x24336c['options']);return _0x356b05[_0xae74('0x124')](_0x2259dc);}})[_0xae74('0x1a')](function(_0x21532c){if(_0x21532c){_0x2de15e=_0x21532c[_0xae74('0x62')];if(!_0x24336c['query'][_0xae74('0x55')](_0xae74('0x75'))){_0x2259dc[_0xae74('0x29')]=qs[_0xae74('0x29')](_0x24336c[_0xae74('0x4f')][_0xae74('0x29')]);_0x2259dc[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x24336c[_0xae74('0x4f')][_0xae74('0x2b')]);}return _0x356b05['getApplications'](_0x2259dc);}})['then'](function(_0x34b822){if(_0x34b822){return _0x34b822?{'count':_0x2de15e,'rows':_0x34b822}:null;}})[_0xae74('0x1a')](respondWithResult(_0x45b809,null))[_0xae74('0x5f')](handleError(_0x45b809,null));};exports[_0xae74('0x125')]=function(_0x319004,_0x2faa7b){return db[_0xae74('0x126')][_0xae74('0x6a')]({'where':{'id':_0x319004[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x2faa7b,null))[_0xae74('0x1a')](function(_0x286467){if(_0x286467){return _0x286467[_0xae74('0x125')](_0x319004[_0xae74('0x65')][_0xae74('0x79')],_[_0xae74('0x100')](_0x319004[_0xae74('0x65')],[_0xae74('0x79'),'id'])||{});}})['then'](respondWithResult(_0x2faa7b,null))[_0xae74('0x5f')](handleError(_0x2faa7b,null));};exports['getProactiveActions']=function(_0x5dccdd,_0x5af48c){var _0x3169ec={};var _0x1e1b41={};var _0x3533b4;var _0x261039;return db[_0xae74('0x4b')][_0xae74('0x74')]({'where':{'id':_0x5dccdd[_0xae74('0x6f')]['id']}})['then'](handleEntityNotFound(_0x5af48c,null))[_0xae74('0x1a')](function(_0x2081ca){if(_0x2081ca){_0x3533b4=_0x2081ca;_0x1e1b41[_0xae74('0x45')]=_[_0xae74('0x50')](db['ChatProactiveAction'][_0xae74('0x4c')]);_0x1e1b41[_0xae74('0x4f')]=_[_0xae74('0x50')](_0x5dccdd[_0xae74('0x4f')]);_0x1e1b41[_0xae74('0x51')]=_[_0xae74('0x52')](_0x1e1b41['model'],_0x1e1b41[_0xae74('0x4f')]);_0x3169ec['attributes']=_[_0xae74('0x52')](_0x1e1b41['model'],qs[_0xae74('0x54')](_0x5dccdd[_0xae74('0x4f')][_0xae74('0x54')]));_0x3169ec['attributes']=_0x3169ec[_0xae74('0x53')][_0xae74('0x62')]?_0x3169ec[_0xae74('0x53')]:_0x1e1b41[_0xae74('0x45')];_0x3169ec['order']=qs[_0xae74('0x56')](_0x5dccdd[_0xae74('0x4f')]['sort']);_0x3169ec[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x5dccdd[_0xae74('0x4f')],_0x1e1b41[_0xae74('0x51')]));if(_0x5dccdd[_0xae74('0x4f')][_0xae74('0x58')]){_0x3169ec['where']=_[_0xae74('0x5a')](_0x3169ec[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x3169ec['attributes'],function(_0x225d58){var _0x3deb23={};_0x3deb23[_0x225d58]={'$like':'%'+_0x5dccdd[_0xae74('0x4f')]['filter']+'%'};return _0x3deb23;})});}_0x3169ec=_['merge']({},_0x3169ec,_0x5dccdd[_0xae74('0x63')]);return _0x3533b4['getProactiveActions'](_0x3169ec);}})['then'](function(_0x40ae23){if(_0x40ae23){_0x261039=_0x40ae23[_0xae74('0x62')];if(!_0x5dccdd[_0xae74('0x4f')][_0xae74('0x55')]('nolimit')){_0x3169ec['limit']=qs[_0xae74('0x29')](_0x5dccdd['query'][_0xae74('0x29')]);_0x3169ec[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x5dccdd['query']['offset']);}return _0x3533b4['getProactiveActions'](_0x3169ec);}})[_0xae74('0x1a')](function(_0x5bc3fa){if(_0x5bc3fa){return _0x5bc3fa?{'count':_0x261039,'rows':_0x5bc3fa}:null;}})[_0xae74('0x1a')](respondWithResult(_0x5af48c,null))[_0xae74('0x5f')](handleError(_0x5af48c,null));};exports['getFields']=function(_0x4b3f0a,_0x566200){var _0x52dc85=_0x4b3f0a[_0xae74('0x4f')][_0xae74('0x127')]==='false'?_0xae74('0x128'):_0xae74('0x129');return db[_0xae74('0x4b')][_0xae74('0x6a')]({'attributes':['id',_0x52dc85],'where':{'id':_0x4b3f0a[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x566200,null))[_0xae74('0x1a')](function(_0x5d9cc9){if(_0x5d9cc9){var _0x1e2699=_0x5d9cc9[_0x52dc85];var _0x58a0a8=_0x1e2699&&_0x1e2699[_0xae74('0x12a')]?_0x1e2699[_0xae74('0x12a')]:[];_0x566200[_0xae74('0xd5')]({'fromKey':_[_0xae74('0x8e')](_0x1e2699[_0xae74('0x12b')])?undefined:_0x1e2699['fromKey'],'count':_0x58a0a8[_0xae74('0x62')],'rows':_0x58a0a8});}})[_0xae74('0x5f')](handleError(_0x566200,null));};exports['getOfflineMessages']=function(_0x350f94,_0x266b20){var _0x2ded7e={'raw':![],'where':{}};var _0x339aff={};var _0x1d1c39={'count':0x0,'rows':[]};return db[_0xae74('0x4b')]['findOne']({'where':{'id':_0x350f94[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x266b20,null))[_0xae74('0x1a')](function(_0x5ba1a9){if(_0x5ba1a9){_0x339aff[_0xae74('0x45')]=_['keys'](db['ChatOfflineMessage'][_0xae74('0x4c')]);_0x339aff['query']=_[_0xae74('0x50')](_0x350f94[_0xae74('0x4f')]);_0x339aff[_0xae74('0x51')]=_['intersection'](_0x339aff[_0xae74('0x45')],_0x339aff[_0xae74('0x4f')]);_0x2ded7e[_0xae74('0x53')]=_[_0xae74('0x52')](_0x339aff[_0xae74('0x45')],qs[_0xae74('0x54')](_0x350f94[_0xae74('0x4f')][_0xae74('0x54')]));_0x2ded7e[_0xae74('0x53')]=_0x2ded7e['attributes'][_0xae74('0x62')]?_0x2ded7e[_0xae74('0x53')]:_0x339aff[_0xae74('0x45')];if(!_0x350f94[_0xae74('0x4f')][_0xae74('0x55')](_0xae74('0x75'))){_0x2ded7e[_0xae74('0x29')]=qs[_0xae74('0x29')](_0x350f94['query']['limit']);_0x2ded7e[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x350f94[_0xae74('0x4f')][_0xae74('0x2b')]);}_0x2ded7e['order']=qs[_0xae74('0x56')](_0x350f94['query']['sort']);_0x2ded7e[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x350f94[_0xae74('0x4f')],_0x339aff[_0xae74('0x51')]));_0x2ded7e[_0xae74('0x57')][_0xae74('0x71')]=_0x5ba1a9['id'];if(_0x350f94[_0xae74('0x4f')][_0xae74('0x58')]){_0x2ded7e[_0xae74('0x57')]=_[_0xae74('0x5a')](_0x2ded7e[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x2ded7e['attributes'],function(_0x573a2a){var _0x4caca3={};_0x4caca3[_0x573a2a]={'$like':'%'+_0x350f94[_0xae74('0x4f')][_0xae74('0x58')]+'%'};return _0x4caca3;})});}_0x2ded7e=_[_0xae74('0x5a')]({},_0x2ded7e,_0x350f94[_0xae74('0x63')]);return db[_0xae74('0x12c')]['count']({'where':_0x2ded7e['where']})[_0xae74('0x1a')](function(_0x1b99a6){_0x1d1c39[_0xae74('0x2c')]=_0x1b99a6;if(_0x350f94[_0xae74('0x4f')][_0xae74('0x5b')]){_0x2ded7e[_0xae74('0x5c')]=[{'all':!![]}];}else{_0x2ded7e[_0xae74('0x5c')]=[{'model':db[_0xae74('0xb3')],'as':_0xae74('0x12d'),'required':![]},{'model':db['Attachment'],'as':_0xae74('0x12e'),'required':![]}];}return db[_0xae74('0x12c')][_0xae74('0x5d')](_0x2ded7e);})[_0xae74('0x1a')](function(_0x224092){_0x1d1c39['rows']=_0x224092;return _0x1d1c39;});}})[_0xae74('0x1a')](respondWithFilteredResult(_0x266b20,_0x2ded7e))[_0xae74('0x5f')](handleError(_0x266b20,null));};exports['addAgents']=function(_0x17406e,_0xb4dce2){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x17406e['params']['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0xb4dce2,null))[_0xae74('0x1a')](function(_0x1a2756){if(_0x1a2756){return _0x1a2756[_0xae74('0x12f')](_0x17406e[_0xae74('0x65')]['ids'],_[_0xae74('0x100')](_0x17406e[_0xae74('0x65')],[_0xae74('0x79'),'id'])||{})[_0xae74('0xdd')](function(_0x1de58f){for(var _0x41b959=0x0;_0x41b959<_0x17406e[_0xae74('0x65')][_0xae74('0x79')][_0xae74('0x62')];_0x41b959+=0x1){socket[_0xae74('0x130')](_0xae74('0x131'),{'UserId':Number(_0x17406e[_0xae74('0x65')][_0xae74('0x79')][_0x41b959]),'ChatWebsiteId':Number(_0x17406e[_0xae74('0x6f')]['id'])});}return _0x1de58f;});}})[_0xae74('0x1a')](respondWithResult(_0xb4dce2,null))[_0xae74('0x5f')](handleError(_0xb4dce2,null));};exports[_0xae74('0x132')]=function(_0x14f1eb,_0x320e80){return db[_0xae74('0x4b')][_0xae74('0x6a')]({'where':{'id':_0x14f1eb[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x320e80,null))[_0xae74('0x1a')](function(_0x33c053){if(_0x33c053){return _0x33c053['removeAgents'](_0x14f1eb['query'][_0xae74('0x79')])[_0xae74('0x1a')](function(){if(_[_0xae74('0x133')](_0x14f1eb[_0xae74('0x4f')][_0xae74('0x79')])){for(var _0x294d0e=0x0;_0x294d0e<_0x14f1eb[_0xae74('0x4f')][_0xae74('0x79')][_0xae74('0x62')];_0x294d0e+=0x1){socket['emit'](_0xae74('0x134'),{'UserId':Number(_0x14f1eb['query'][_0xae74('0x79')][_0x294d0e]),'ChatWebsiteId':Number(_0x14f1eb['params']['id'])});}}else{socket['emit'](_0xae74('0x134'),{'UserId':Number(_0x14f1eb['query'][_0xae74('0x79')]),'ChatWebsiteId':Number(_0x14f1eb[_0xae74('0x6f')]['id'])});}});}})[_0xae74('0x1a')](respondWithStatusCode(_0x320e80,null))['catch'](handleError(_0x320e80,null));};exports[_0xae74('0x135')]=function(_0x1de629,_0x13eb28){var _0x2d72fa={};var _0x1c7f83={};var _0x5637d7;var _0x5df077;return db[_0xae74('0x4b')][_0xae74('0x74')]({'where':{'id':_0x1de629[_0xae74('0x6f')]['id']}})[_0xae74('0x1a')](handleEntityNotFound(_0x13eb28,null))[_0xae74('0x1a')](function(_0x3d362c){if(_0x3d362c){_0x5637d7=_0x3d362c;_0x1c7f83[_0xae74('0x45')]=_[_0xae74('0x50')](db[_0xae74('0xc8')][_0xae74('0x4c')]);_0x1c7f83['query']=_[_0xae74('0x50')](_0x1de629[_0xae74('0x4f')]);_0x1c7f83['filters']=_[_0xae74('0x52')](_0x1c7f83[_0xae74('0x45')],_0x1c7f83['query']);_0x2d72fa['attributes']=_[_0xae74('0x52')](_0x1c7f83['model'],qs[_0xae74('0x54')](_0x1de629[_0xae74('0x4f')][_0xae74('0x54')]));_0x2d72fa[_0xae74('0x53')]=_0x2d72fa[_0xae74('0x53')][_0xae74('0x62')]?_0x2d72fa['attributes']:_0x1c7f83['model'];_0x2d72fa[_0xae74('0x76')]=qs[_0xae74('0x56')](_0x1de629[_0xae74('0x4f')][_0xae74('0x56')]);_0x2d72fa[_0xae74('0x57')]=qs[_0xae74('0x51')](_[_0xae74('0x77')](_0x1de629['query'],_0x1c7f83[_0xae74('0x51')]));if(_0x1de629['query']['filter']){_0x2d72fa[_0xae74('0x57')]=_[_0xae74('0x5a')](_0x2d72fa[_0xae74('0x57')],{'$or':_[_0xae74('0x4a')](_0x2d72fa[_0xae74('0x53')],function(_0x57399a){var _0x3b0e75={};_0x3b0e75[_0x57399a]={'$like':'%'+_0x1de629[_0xae74('0x4f')]['filter']+'%'};return _0x3b0e75;})});}_0x2d72fa=_[_0xae74('0x5a')]({},_0x2d72fa,_0x1de629[_0xae74('0x63')]);return _0x5637d7[_0xae74('0x135')](_0x2d72fa);}})[_0xae74('0x1a')](function(_0x2924fa){if(_0x2924fa){_0x5df077=_0x2924fa[_0xae74('0x62')];if(!_0x1de629[_0xae74('0x4f')][_0xae74('0x55')](_0xae74('0x75'))){_0x2d72fa[_0xae74('0x29')]=qs[_0xae74('0x29')](_0x1de629[_0xae74('0x4f')][_0xae74('0x29')]);_0x2d72fa[_0xae74('0x2b')]=qs[_0xae74('0x2b')](_0x1de629[_0xae74('0x4f')]['offset']);}return _0x5637d7[_0xae74('0x135')](_0x2d72fa);}})['then'](function(_0x36b6ed){if(_0x36b6ed){return _0x36b6ed?{'count':_0x5df077,'rows':_0x36b6ed}:null;}})[_0xae74('0x1a')](respondWithResult(_0x13eb28,null))[_0xae74('0x5f')](handleError(_0x13eb28,null));}; \ No newline at end of file +var _0x229b=['Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','ifTime','account','orderBy','priority','asc','Contacts','ListId','contact','headers','threadId','ChatInteraction','referer','closed','externalUrl','ContactId','Writing\x20on\x20closed\x20interaction','firstName','messageId','interaction','created','autoclose','applications','close','*,*,*,*','ChatMessage','AttachmentId','waitForTheAssignedAgent','forcedOwnership','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','user','offlineMessageSubject','openNewInteraction','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','Tag','Tags','tag','getSnippet','getProactiveActions','getLicense','virtual','License','increment','readFileSync','server/files/chat/iframe.ejs','utf8','URL','origin','3.8.1','remote','stringify','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','color','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','User','mustache','util','path','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','limit','count','offset','set','destroy','ChatWebsites','stack','name','send','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','%s\x20%s','version','unknown','format','model','device','vendor','%s\x20%s\x20%s','type','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','include','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','CompanyId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','DESC','ChatApplication','Applications','Interval','Intervals'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0x229b,0x1c1));var _0xb229=function(_0x49296e,_0x226f1e){_0x49296e=_0x49296e-0x0;var _0x1cb7af=_0x229b[_0x49296e];return _0x1cb7af;};'use strict';var Mustache=require(_0xb229('0x0'));var util=require(_0xb229('0x1'));var path=require(_0xb229('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb229('0x3'));var _=require(_0xb229('0x4'));var querystring=require(_0xb229('0x5'));var htmlToText=require(_0xb229('0x6'));var Redis=require(_0xb229('0x7'));var jayson=require(_0xb229('0x8'));var url=require(_0xb229('0x9'));var qs=require(_0xb229('0xa'));var logger=require(_0xb229('0xb'))(_0xb229('0xc'));var config=require(_0xb229('0xd'));var APIBadRequestError=require(_0xb229('0xe'))[_0xb229('0xf')];var APINotFoundError=require('../../errors/api')[_0xb229('0x10')];var APIOutOfIntervalError=require(_0xb229('0xe'))['APIOutOfIntervalError'];var APIHandleError=require('../../errors/api')[_0xb229('0x11')];var APIConflictError=require(_0xb229('0xe'))['APIConflictError'];var db=require(_0xb229('0x12'))['db'];config[_0xb229('0x13')]=_[_0xb229('0x14')](config[_0xb229('0x13')],{'host':_0xb229('0x15'),'port':0x18eb});var socket=require(_0xb229('0x16'))(new Redis(config[_0xb229('0x13')]));require('./chatWebsite.socket')[_0xb229('0x17')](socket);var client=jayson[_0xb229('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xb229('0x18')][_0xb229('0x19')]({'port':0x232a});var client9003=jayson[_0xb229('0x18')]['http']({'port':0x232b});var client9001=jayson[_0xb229('0x18')][_0xb229('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x278bfa,_0x53ccd3,_0x24de9c,_0x4cd5dd){return new Promise(function(_0x285d6c,_0x31d66d){var _0x1af737=_0x4cd5dd||client;return _0x1af737[_0xb229('0x1a')](_0x278bfa,_0x24de9c)[_0xb229('0x1b')](function(_0x575c4a){logger[_0xb229('0x1c')](_0xb229('0x1d'),_0x53ccd3,_0xb229('0x1e'));logger['debug'](_0xb229('0x1f'),_0x53ccd3,'request\x20sent',JSON['stringify'](_0x575c4a));if(_0x575c4a['error']){if(_0x575c4a['error']['code']===0x1f4){logger[_0xb229('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x53ccd3,_0x575c4a[_0xb229('0x20')]['message']);return _0x31d66d(_0x575c4a[_0xb229('0x20')][_0xb229('0x21')]);}logger[_0xb229('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x53ccd3,_0x575c4a['error']['message']);return _0x285d6c(_0x575c4a['error'][_0xb229('0x21')]);}else{logger[_0xb229('0x1c')](_0xb229('0x1d'),_0x53ccd3,_0xb229('0x1e'));_0x285d6c(_0x575c4a[_0xb229('0x22')]['message']);}})[_0xb229('0x23')](function(_0xfedc22){logger[_0xb229('0x20')](_0xb229('0x1d'),_0x53ccd3,_0xfedc22);_0x31d66d(_0xfedc22);});});}function respondWithStatusCode(_0x5ff469,_0x240b18){_0x240b18=_0x240b18||0xcc;return function(_0x35103a){if(_0x35103a){return _0x5ff469[_0xb229('0x24')](_0x240b18);}return _0x5ff469[_0xb229('0x25')](_0x240b18)[_0xb229('0x26')]();};}function respondWithResult(_0x57e635,_0x2e26fc){_0x2e26fc=_0x2e26fc||0xc8;return function(_0x25a28b){if(_0x25a28b){return _0x57e635[_0xb229('0x25')](_0x2e26fc)[_0xb229('0x27')](_0x25a28b);}};}function respondWithFilteredResult(_0x4cdd86,_0x1f6bb0){return function(_0x4dd7ea){if(_0x4dd7ea){var _0x4d5c5d=typeof _0x1f6bb0['offset']==='undefined'&&typeof _0x1f6bb0[_0xb229('0x28')]==='undefined';var _0x27c8b8=_0x4dd7ea[_0xb229('0x29')];var _0x213043=_0x4d5c5d?0x0:_0x1f6bb0[_0xb229('0x2a')];var _0x2cc562=_0x4d5c5d?_0x4dd7ea[_0xb229('0x29')]:_0x1f6bb0['offset']+_0x1f6bb0[_0xb229('0x28')];var _0x2f1295;if(_0x2cc562>=_0x27c8b8){_0x2cc562=_0x27c8b8;_0x2f1295=0xc8;}else{_0x2f1295=0xce;}_0x4cdd86['status'](_0x2f1295);return _0x4cdd86[_0xb229('0x2b')]('Content-Range',_0x213043+'-'+_0x2cc562+'/'+_0x27c8b8)['json'](_0x4dd7ea);}return null;};}function saveUpdates(_0x23b01e){return function(_0x28c7fb){if(_0x28c7fb){return _0x28c7fb['update'](_0x23b01e)['then'](function(_0x17813e){return _0x17813e;});}return null;};}function removeEntity(_0x228a67){return function(_0x4366ba){if(_0x4366ba){return _0x4366ba[_0xb229('0x2c')]()[_0xb229('0x1b')](function(){var _0x40b7fb=_0x4366ba['get']({'plain':!![]});var _0x4225f7=_0xb229('0x2d');return db['UserProfileResource'][_0xb229('0x2c')]({'where':{'type':_0x4225f7,'resourceId':_0x40b7fb['id']}})[_0xb229('0x1b')](function(){return _0x4366ba;});})[_0xb229('0x1b')](function(){_0x228a67['status'](0xcc)[_0xb229('0x26')]();});}};}function handleEntityNotFound(_0x82a350){return function(_0x5f115f){if(!_0x5f115f){_0x82a350['sendStatus'](0x194);}return _0x5f115f;};}function handleError(_0x46717c,_0x4f719e){_0x4f719e=_0x4f719e||0x1f4;return function(_0x4eb895){logger[_0xb229('0x20')](_0x4eb895[_0xb229('0x2e')]);if(_0x4eb895[_0xb229('0x2f')]){delete _0x4eb895[_0xb229('0x2f')];}_0x46717c[_0xb229('0x25')](_0x4f719e)[_0xb229('0x30')](_0x4eb895);};}function createInteractionObject(_0x14f22f,_0xc51f2a,_0x1f572b,_0x5d1d76){var _0x298fa8=require(_0xb229('0x31'));var _0x2db185=new _0x298fa8();var _0x11fb6e=_0x2db185[_0xb229('0x32')](_0x1f572b['user-agent'])[_0xb229('0x33')]();var _0x5d3d75=_0xc51f2a[_0xb229('0x34')];if(_0x1f572b[_0xb229('0x35')]){_0x5d3d75=_0x1f572b[_0xb229('0x35')];}else if(_0x1f572b[_0xb229('0x36')]){_0x5d3d75=_[_0xb229('0x37')](_0x1f572b[_0xb229('0x36')][_0xb229('0x38')](','));}return{'ContactId':_0x5d1d76['id'],'ChatWebsiteId':_0x14f22f,'from':(_0x5d1d76['firstName']||'')+'\x20'+(_0x5d1d76[_0xb229('0x39')]||''),'customerIp':_0x5d3d75,'customerPort':_0x1f572b['x-real-port']?_0x1f572b[_0xb229('0x3a')]:null,'referer':_0xc51f2a['referer'],'browserName':_0x11fb6e[_0xb229('0x3b')][_0xb229('0x2f')]&&_0x11fb6e[_0xb229('0x3b')]['version']?util['format'](_0xb229('0x3c'),_0x11fb6e['browser'][_0xb229('0x2f')],_0x11fb6e[_0xb229('0x3b')][_0xb229('0x3d')]):_0xb229('0x3e'),'browserVersion':_0x11fb6e['browser']['version']||_0xb229('0x3e'),'osName':util[_0xb229('0x3f')](_0xb229('0x3c'),_0x11fb6e['os'][_0xb229('0x2f')],_0x11fb6e['os']['version']),'osVersion':_0x11fb6e['os'][_0xb229('0x3d')],'deviceModel':_0x11fb6e['device'][_0xb229('0x40')]&&_0x11fb6e[_0xb229('0x41')][_0xb229('0x42')]?util[_0xb229('0x3f')](_0xb229('0x43'),_0x11fb6e[_0xb229('0x41')][_0xb229('0x40')],_0x11fb6e[_0xb229('0x41')][_0xb229('0x42')],_0x11fb6e[_0xb229('0x41')][_0xb229('0x44')]):null,'deviceVendor':_0x11fb6e[_0xb229('0x41')][_0xb229('0x42')],'deviceType':_0x11fb6e[_0xb229('0x41')][_0xb229('0x44')],'formData':JSON['stringify'](_0xc51f2a)};}exports['index']=function(_0x4c0855,_0xe38fbc){var _0x4bcd43={'include':[{'model':db[_0xb229('0x45')],'as':_0xb229('0x46')}]},_0x460ffe={},_0xd69718={'count':0x0,'rows':[]};var _0x23fcbc=_[_0xb229('0x47')](db[_0xb229('0x48')]['rawAttributes'],function(_0x2f008e){return{'name':_0x2f008e[_0xb229('0x49')],'type':_0x2f008e[_0xb229('0x44')]['key']};});_0x460ffe[_0xb229('0x40')]=_[_0xb229('0x47')](_0x23fcbc,'name');_0x460ffe['query']=_[_0xb229('0x4a')](_0x4c0855[_0xb229('0x4b')]);_0x460ffe[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x460ffe[_0xb229('0x40')],_0x460ffe['query']);_0x4bcd43['attributes']=_[_0xb229('0x4d')](_0x460ffe[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x4c0855[_0xb229('0x4b')]['fields']));_0x4bcd43[_0xb229('0x4f')]=_0x4bcd43[_0xb229('0x4f')][_0xb229('0x50')]?_0x4bcd43[_0xb229('0x4f')]:_0x460ffe[_0xb229('0x40')];if(!_0x4c0855[_0xb229('0x4b')][_0xb229('0x51')](_0xb229('0x52'))){_0x4bcd43[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x4c0855[_0xb229('0x4b')]['limit']);_0x4bcd43[_0xb229('0x2a')]=qs['offset'](_0x4c0855[_0xb229('0x4b')][_0xb229('0x2a')]);}_0x4bcd43[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x4c0855[_0xb229('0x4b')][_0xb229('0x54')]);_0x4bcd43[_0xb229('0x55')]=qs['filters'](_[_0xb229('0x56')](_0x4c0855['query'],_0x460ffe[_0xb229('0x4c')]),_0x23fcbc);if(_0x4c0855[_0xb229('0x4b')][_0xb229('0x57')]){_0x4bcd43[_0xb229('0x55')]=_['merge'](_0x4bcd43[_0xb229('0x55')],{'$or':_[_0xb229('0x47')](_0x23fcbc,function(_0x2e03cb){if(_0x2e03cb['type']!==_0xb229('0x58')){var _0x170d77={};_0x170d77[_0x2e03cb['name']]={'$like':'%'+_0x4c0855[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x170d77;}})});}_0x4bcd43=_[_0xb229('0x59')]({},_0x4bcd43,_0x4c0855[_0xb229('0x5a')]);var _0x372ccc={'where':_0x4bcd43[_0xb229('0x55')]};return db['ChatWebsite'][_0xb229('0x29')](_0x372ccc)['then'](function(_0xc9c909){_0xd69718[_0xb229('0x29')]=_0xc9c909;if(_0x4c0855[_0xb229('0x4b')][_0xb229('0x5b')]){_0x4bcd43['include']=[{'all':!![]}];}return db[_0xb229('0x48')][_0xb229('0x5c')](_0x4bcd43);})[_0xb229('0x1b')](function(_0x252b4d){_0xd69718[_0xb229('0x5d')]=_0x252b4d;return _0xd69718;})[_0xb229('0x1b')](respondWithFilteredResult(_0xe38fbc,_0x4bcd43))[_0xb229('0x23')](handleError(_0xe38fbc,null));};exports[_0xb229('0x5e')]=function(_0x70fda8,_0x205793){var _0x5873ae={'raw':![],'where':{'id':_0x70fda8[_0xb229('0x5f')]['id']},'include':[{'model':db[_0xb229('0x45')],'as':_0xb229('0x46')}]},_0x17d7d4={};_0x17d7d4[_0xb229('0x40')]=_[_0xb229('0x4a')](db['ChatWebsite'][_0xb229('0x60')]);_0x17d7d4[_0xb229('0x4b')]=_[_0xb229('0x4a')](_0x70fda8[_0xb229('0x4b')]);_0x17d7d4[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x17d7d4[_0xb229('0x40')],_0x17d7d4[_0xb229('0x4b')]);_0x5873ae[_0xb229('0x4f')]=_[_0xb229('0x4d')](_0x17d7d4[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x70fda8[_0xb229('0x4b')][_0xb229('0x4e')]));_0x5873ae[_0xb229('0x4f')]=_0x5873ae[_0xb229('0x4f')][_0xb229('0x50')]?_0x5873ae[_0xb229('0x4f')]:_0x17d7d4[_0xb229('0x40')];if(_0x70fda8[_0xb229('0x4b')]['includeAll']){_0x5873ae['include']=[{'all':!![]}];}_0x5873ae=_[_0xb229('0x59')]({},_0x5873ae,_0x70fda8['options']);return db['ChatWebsite'][_0xb229('0x61')](_0x5873ae)[_0xb229('0x1b')](handleEntityNotFound(_0x205793,null))['then'](respondWithResult(_0x205793,null))[_0xb229('0x23')](handleError(_0x205793,null));};exports[_0xb229('0x62')]=function(_0x5e826f,_0xdd76c){return db['ChatWebsite']['create'](_0x5e826f[_0xb229('0x63')],{})[_0xb229('0x1b')](function(_0x3f324a){var _0x5f249e=_0x5e826f['user'][_0xb229('0x64')]({'plain':!![]});if(!_0x5f249e)throw new Error(_0xb229('0x65'));if(_0x5f249e['role']==='user'){var _0x2e3863=_0x3f324a[_0xb229('0x64')]({'plain':!![]});var _0x33d263=_0xb229('0x2d');return db[_0xb229('0x66')]['find']({'where':{'name':_0x33d263,'userProfileId':_0x5f249e[_0xb229('0x67')]},'raw':!![]})['then'](function(_0x1d321d){if(_0x1d321d&&_0x1d321d[_0xb229('0x68')]===0x0){return db[_0xb229('0x69')][_0xb229('0x62')]({'name':_0x2e3863[_0xb229('0x2f')],'resourceId':_0x2e3863['id'],'type':_0x1d321d[_0xb229('0x2f')],'sectionId':_0x1d321d['id']},{})[_0xb229('0x1b')](function(){return _0x3f324a;});}else{return _0x3f324a;}})[_0xb229('0x23')](function(_0x57363b){logger['error'](_0xb229('0x6a'),_0x57363b);throw _0x57363b;});}return _0x3f324a;})[_0xb229('0x1b')](respondWithResult(_0xdd76c,0xc9))[_0xb229('0x23')](handleError(_0xdd76c,null));};exports[_0xb229('0x6b')]=function(_0x17ae7f,_0x540904){if(_0x17ae7f['body']['id']){delete _0x17ae7f[_0xb229('0x63')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x17ae7f[_0xb229('0x5f')]['id']},'include':[{'model':db[_0xb229('0x45')],'as':_0xb229('0x46')}]})[_0xb229('0x1b')](handleEntityNotFound(_0x540904,null))[_0xb229('0x1b')](saveUpdates(_0x17ae7f['body'],null))['then'](respondWithResult(_0x540904,null))[_0xb229('0x23')](handleError(_0x540904,null));};exports[_0xb229('0x2c')]=function(_0x2b27a5,_0x2dbbda){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x2b27a5[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x2dbbda,null))['then'](removeEntity(_0x2dbbda,null))['catch'](handleError(_0x2dbbda,null));};exports['describe']=function(_0x338242,_0x1871bb){return db['ChatWebsite'][_0xb229('0x6c')]()[_0xb229('0x1b')](respondWithResult(_0x1871bb,null))['catch'](handleError(_0x1871bb,null));};exports[_0xb229('0x6d')]=function(_0x573fff,_0x85fcc3){if(_0x573fff[_0xb229('0x63')]['id']){delete _0x573fff['body']['id'];}return db[_0xb229('0x48')]['find']({'where':{'id':_0x573fff[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x85fcc3,null))[_0xb229('0x1b')](function(_0x3ecb01){if(_0x3ecb01){_0x573fff[_0xb229('0x63')]['ChatWebsiteId']=_0x3ecb01['id'];return db[_0xb229('0x6e')][_0xb229('0x62')](_0x573fff['body']);}})[_0xb229('0x1b')](respondWithResult(_0x85fcc3,null))[_0xb229('0x23')](handleError(_0x85fcc3,null));};exports[_0xb229('0x6f')]=function(_0x30ea8f,_0x1c780d){var _0x3c0919={'raw':![],'where':{}};var _0x596123={};var _0x4ff9a3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb229('0x70')]({'where':{'id':_0x30ea8f['params']['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x1c780d,null))[_0xb229('0x1b')](function(_0x2e4d71){if(_0x2e4d71){_0x596123[_0xb229('0x40')]=_[_0xb229('0x4a')](db['Disposition'][_0xb229('0x60')]);_0x596123[_0xb229('0x4b')]=_[_0xb229('0x4a')](_0x30ea8f[_0xb229('0x4b')]);_0x596123[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x596123[_0xb229('0x40')],_0x596123[_0xb229('0x4b')]);_0x3c0919[_0xb229('0x4f')]=_['intersection'](_0x596123['model'],qs[_0xb229('0x4e')](_0x30ea8f[_0xb229('0x4b')]['fields']));_0x3c0919[_0xb229('0x4f')]=_0x3c0919[_0xb229('0x4f')][_0xb229('0x50')]?_0x3c0919[_0xb229('0x4f')]:_0x596123['model'];if(!_0x30ea8f[_0xb229('0x4b')][_0xb229('0x51')]('nolimit')){_0x3c0919[_0xb229('0x28')]=qs['limit'](_0x30ea8f[_0xb229('0x4b')]['limit']);_0x3c0919[_0xb229('0x2a')]=qs['offset'](_0x30ea8f['query']['offset']);}_0x3c0919[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x30ea8f['query'][_0xb229('0x54')]);_0x3c0919[_0xb229('0x55')]=qs[_0xb229('0x4c')](_[_0xb229('0x56')](_0x30ea8f['query'],_0x596123[_0xb229('0x4c')]));_0x3c0919[_0xb229('0x55')]['ChatWebsiteId']=_0x2e4d71['id'];if(_0x30ea8f[_0xb229('0x4b')][_0xb229('0x57')]){_0x3c0919['where']=_[_0xb229('0x59')](_0x3c0919['where'],{'$or':_[_0xb229('0x47')](_0x3c0919[_0xb229('0x4f')],function(_0x5e63fc){var _0x3c5f0f={};_0x3c5f0f[_0x5e63fc]={'$like':'%'+_0x30ea8f[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x3c5f0f;})});}_0x3c0919=_['merge']({},_0x3c0919,_0x30ea8f[_0xb229('0x5a')]);return db['Disposition'][_0xb229('0x29')]({'where':_0x3c0919[_0xb229('0x55')]})['then'](function(_0x109791){_0x4ff9a3[_0xb229('0x29')]=_0x109791;if(_0x30ea8f['query'][_0xb229('0x5b')]){_0x3c0919[_0xb229('0x71')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3c0919);})[_0xb229('0x1b')](function(_0x3df6eb){_0x4ff9a3['rows']=_0x3df6eb;return _0x4ff9a3;});}})[_0xb229('0x1b')](respondWithFilteredResult(_0x1c780d,_0x3c0919))[_0xb229('0x23')](handleError(_0x1c780d,null));};exports[_0xb229('0x72')]=function(_0x364a81,_0x210dc1){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x364a81['params']['id']}})['then'](handleEntityNotFound(_0x210dc1,null))[_0xb229('0x1b')](function(_0x23b5dd){if(_0x23b5dd){return _0x23b5dd['removeDispositions'](_0x364a81[_0xb229('0x4b')][_0xb229('0x73')]);}})[_0xb229('0x1b')](respondWithStatusCode(_0x210dc1,null))[_0xb229('0x23')](handleError(_0x210dc1,null));};exports[_0xb229('0x74')]=function(_0x2396da,_0x235207){if(_0x2396da[_0xb229('0x63')]['id']){delete _0x2396da[_0xb229('0x63')]['id'];}return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x2396da[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x235207,null))['then'](function(_0x416217){if(_0x416217){_0x2396da['body'][_0xb229('0x75')]=_0x416217['id'];return db[_0xb229('0x76')]['create'](_0x2396da['body']);}})[_0xb229('0x1b')](respondWithResult(_0x235207,null))['catch'](handleError(_0x235207,null));};exports['getAnswers']=function(_0x4cec51,_0x38fb4f){var _0x49d08d={'raw':![],'where':{}};var _0xe8f785={};var _0x18ccaa={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb229('0x70')]({'where':{'id':_0x4cec51[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x38fb4f,null))['then'](function(_0x110728){if(_0x110728){_0xe8f785[_0xb229('0x40')]=_[_0xb229('0x4a')](db[_0xb229('0x76')][_0xb229('0x60')]);_0xe8f785[_0xb229('0x4b')]=_[_0xb229('0x4a')](_0x4cec51['query']);_0xe8f785[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0xe8f785[_0xb229('0x40')],_0xe8f785[_0xb229('0x4b')]);_0x49d08d['attributes']=_[_0xb229('0x4d')](_0xe8f785['model'],qs[_0xb229('0x4e')](_0x4cec51['query'][_0xb229('0x4e')]));_0x49d08d[_0xb229('0x4f')]=_0x49d08d[_0xb229('0x4f')][_0xb229('0x50')]?_0x49d08d[_0xb229('0x4f')]:_0xe8f785[_0xb229('0x40')];if(!_0x4cec51[_0xb229('0x4b')][_0xb229('0x51')](_0xb229('0x52'))){_0x49d08d[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x4cec51[_0xb229('0x4b')]['limit']);_0x49d08d['offset']=qs[_0xb229('0x2a')](_0x4cec51[_0xb229('0x4b')]['offset']);}_0x49d08d[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x4cec51[_0xb229('0x4b')]['sort']);_0x49d08d[_0xb229('0x55')]=qs['filters'](_[_0xb229('0x56')](_0x4cec51[_0xb229('0x4b')],_0xe8f785[_0xb229('0x4c')]));_0x49d08d[_0xb229('0x55')]['ChatWebsiteId']=_0x110728['id'];if(_0x4cec51[_0xb229('0x4b')]['filter']){_0x49d08d['where']=_[_0xb229('0x59')](_0x49d08d[_0xb229('0x55')],{'$or':_['map'](_0x49d08d[_0xb229('0x4f')],function(_0xe8027a){var _0x460d7d={};_0x460d7d[_0xe8027a]={'$like':'%'+_0x4cec51[_0xb229('0x4b')]['filter']+'%'};return _0x460d7d;})});}_0x49d08d=_[_0xb229('0x59')]({},_0x49d08d,_0x4cec51[_0xb229('0x5a')]);return db[_0xb229('0x76')][_0xb229('0x29')]({'where':_0x49d08d[_0xb229('0x55')]})['then'](function(_0x125226){_0x18ccaa[_0xb229('0x29')]=_0x125226;if(_0x4cec51[_0xb229('0x4b')]['includeAll']){_0x49d08d[_0xb229('0x71')]=[{'all':!![]}];}return db[_0xb229('0x76')]['findAll'](_0x49d08d);})[_0xb229('0x1b')](function(_0x437c29){_0x18ccaa[_0xb229('0x5d')]=_0x437c29;return _0x18ccaa;});}})[_0xb229('0x1b')](respondWithFilteredResult(_0x38fb4f,_0x49d08d))[_0xb229('0x23')](handleError(_0x38fb4f,null));};exports[_0xb229('0x77')]=function(_0x14e968,_0x4456e5){return db[_0xb229('0x48')]['find']({'where':{'id':_0x14e968[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x4456e5,null))[_0xb229('0x1b')](function(_0x124116){if(_0x124116){return _0x124116[_0xb229('0x77')](_0x14e968[_0xb229('0x4b')][_0xb229('0x73')]);}})[_0xb229('0x1b')](respondWithStatusCode(_0x4456e5,null))['catch'](handleError(_0x4456e5,null));};exports[_0xb229('0x78')]=function(_0xd267b9,_0x5f2fb7){_0xd267b9['body'][_0xb229('0x79')]=_0xd267b9[_0xb229('0x7a')][_0xb229('0x7b')];return db[_0xb229('0x48')]['find']({'where':{'id':_0xd267b9[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x5f2fb7,null))['then'](saveUpdates(_0xd267b9['body'],null))[_0xb229('0x1b')](respondWithResult(_0x5f2fb7,null))[_0xb229('0x23')](handleError(_0x5f2fb7,null));};exports[_0xb229('0x7c')]=function(_0x378eea,_0x27526d){_0x378eea[_0xb229('0x63')][_0xb229('0x7d')]=_0x378eea['file'][_0xb229('0x7b')];return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x378eea[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x27526d,null))['then'](saveUpdates(_0x378eea['body'],null))[_0xb229('0x1b')](respondWithResult(_0x27526d,null))['catch'](handleError(_0x27526d,null));};exports[_0xb229('0x7e')]=function(_0x52e3c9,_0x2549f7){_0x52e3c9[_0xb229('0x63')][_0xb229('0x7f')]=_0x52e3c9['file']['filename'];return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x52e3c9['params']['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x2549f7,null))['then'](saveUpdates(_0x52e3c9[_0xb229('0x63')],null))['then'](respondWithResult(_0x2549f7,null))[_0xb229('0x23')](handleError(_0x2549f7,null));};exports[_0xb229('0x80')]=function(_0x2713d7,_0x14c773){_0x2713d7[_0xb229('0x63')][_0xb229('0x81')]=_0x2713d7['file'][_0xb229('0x7b')];return db['ChatWebsite'][_0xb229('0x61')]({'where':{'id':_0x2713d7[_0xb229('0x5f')]['id']}})['then'](handleEntityNotFound(_0x14c773,null))['then'](saveUpdates(_0x2713d7[_0xb229('0x63')],null))['then'](respondWithResult(_0x14c773,null))['catch'](handleError(_0x14c773,null));};exports[_0xb229('0x82')]=function(_0x2172e5,_0x419946){var _0x1dfedd=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x85'));var _0xc8d9f7={'where':{'id':_0x2172e5[_0xb229('0x5f')]['id']},'attributes':['id',_0xb229('0x79')],'raw':!![]};var _0x7bc47e=![];return require(_0xb229('0x86'))['getLicense']()['then'](function(_0x38dcd2){if(_0x38dcd2){_0x7bc47e=_0x38dcd2[_0xb229('0x87')];}})['then'](function(){return db[_0xb229('0x48')][_0xb229('0x61')](_0xc8d9f7);})[_0xb229('0x1b')](handleEntityNotFound(_0x419946,null))[_0xb229('0x1b')](function(_0x23605f){if(_0x23605f){if(!_['isNil'](_0x23605f[_0xb229('0x79')])){if(fs[_0xb229('0x88')](path[_0xb229('0x83')](config['root'],_0xb229('0x89'),_0x23605f['sitepic']))&&_0x7bc47e){_0x1dfedd=path['join'](config['root'],'server/files/images/logos/',_0x23605f['sitepic']);}}return _0x419946[_0xb229('0x8a')](_0x1dfedd);}})[_0xb229('0x23')](handleError(_0x419946,null));};exports[_0xb229('0x8b')]=function(_0x221504,_0x15020d){var _0xb84eec=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x8c'));var _0x5412c3={'where':{'id':_0x221504[_0xb229('0x5f')]['id']},'attributes':['id',_0xb229('0x7d')],'raw':!![]};return db[_0xb229('0x48')][_0xb229('0x61')](_0x5412c3)[_0xb229('0x1b')](handleEntityNotFound(_0x15020d,null))['then'](function(_0x573321){if(_0x573321){if(!_[_0xb229('0x8d')](_0x573321[_0xb229('0x7d')])){if(fs['existsSync'](path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x8e'),_0x573321[_0xb229('0x7d')]))){_0xb84eec=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x8e'),_0x573321[_0xb229('0x7d')]);}}return _0x15020d['download'](_0xb84eec);}})[_0xb229('0x23')](handleError(_0x15020d,null));};exports[_0xb229('0x8f')]=function(_0xfe8139,_0x479ec1){var _0x67371c=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x90'));var _0xa75674={'where':{'id':_0xfe8139[_0xb229('0x5f')]['id']},'attributes':['id',_0xb229('0x7f'),_0xb229('0x91')],'raw':!![]};return db['ChatWebsite'][_0xb229('0x61')](_0xa75674)[_0xb229('0x1b')](handleEntityNotFound(_0x479ec1,null))[_0xb229('0x1b')](function(_0x579b12){if(_0x579b12){if(!_[_0xb229('0x8d')](_0x579b12[_0xb229('0x7f')])){if(fs[_0xb229('0x88')](path['join'](config[_0xb229('0x84')],'server/files/images/avatars/',_0x579b12[_0xb229('0x7f')]))&&_0x579b12['showCustomerAvatar']){_0x67371c=path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x8e'),_0x579b12[_0xb229('0x7f')]);}}return _0x479ec1['download'](_0x67371c);}})['catch'](handleError(_0x479ec1,null));};exports['getSystemAvatar']=function(_0x4aa23f,_0x59f018){var _0xec5f54=path[_0xb229('0x83')](config['root'],_0xb229('0x92'));var _0x48fbd6={'where':{'id':_0x4aa23f[_0xb229('0x5f')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xb229('0x48')]['find'](_0x48fbd6)['then'](handleEntityNotFound(_0x59f018,null))[_0xb229('0x1b')](function(_0x5c541d){if(_0x5c541d){if(!_[_0xb229('0x8d')](_0x5c541d['systemAvatar'])){if(fs['existsSync'](path[_0xb229('0x83')](config[_0xb229('0x84')],'server/files/images/avatars/',_0x5c541d[_0xb229('0x81')]))){_0xec5f54=path[_0xb229('0x83')](config['root'],_0xb229('0x8e'),_0x5c541d['systemAvatar']);}}return _0x59f018[_0xb229('0x8a')](_0xec5f54);}})[_0xb229('0x23')](handleError(_0x59f018,null));};exports[_0xb229('0x93')]=function(_0x4f5afd,_0x910fb6){var _0x2018b5={'body':_0x4f5afd[_0xb229('0x63')],'channel':_0xb229('0x94')};var _0x468a70=[];var _0x517295=[];var _0x4fd7d1={};var _0x59a507=![];if(_0x4f5afd[_0xb229('0x63')]['id']){delete _0x4f5afd['body']['id'];}if(_[_0xb229('0x8d')](_0x4f5afd[_0xb229('0x63')][_0xb229('0x95')])){throw new APIBadRequestError(_0xb229('0x96'));}if(_[_0xb229('0x8d')](_0x4f5afd[_0xb229('0x63')][_0xb229('0x97')])){throw new APIBadRequestError(_0xb229('0x98'));}if(_['isEmpty'](_0x4f5afd[_0xb229('0x63')][_0xb229('0x63')])){throw new APIBadRequestError(_0xb229('0x99'));}return db[_0xb229('0x9a')][_0xb229('0x6c')]()[_0xb229('0x1b')](function(_0x53b6dc){if(!_0x53b6dc){throw new Error('No\x20available\x20attributes');}_0x468a70=Object['keys'](_0x53b6dc)['filter'](function(_0x397796){return![_0xb229('0x9b'),_0xb229('0x9c')][_0xb229('0x9d')](_0x397796);});_0x517295=Object[_0xb229('0x4a')](_0x53b6dc)['filter'](function(_0x449a6f){return![_0xb229('0x9b'),_0xb229('0x9c'),_0xb229('0x9e'),'ListId']['includes'](_0x449a6f);});if(!_['includes'](_0x517295,_0x4f5afd['body']['mapKey'])){throw new APIBadRequestError(_0xb229('0x9f')+_0x517295[_0xb229('0x83')](',\x20'));}_0x4fd7d1[_0x4f5afd[_0xb229('0x63')][_0xb229('0x97')]]=_0x4f5afd[_0xb229('0x63')][_0xb229('0x95')];})[_0xb229('0x1b')](function(){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x4f5afd[_0xb229('0x5f')]['id']},'include':[{'model':db[_0xb229('0xa0')],'as':_0xb229('0xa1'),'include':[{'model':db[_0xb229('0x9a')],'as':'Contacts','where':_0x4fd7d1,'limit':0x1,'order':[[_0xb229('0x9c'),_0xb229('0xa2')]]}]},{'model':db[_0xb229('0xa3')],'as':_0xb229('0xa4')},{'model':db[_0xb229('0xa5')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xb229('0xa6'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xb229('0x1b')](function(_0xbc5681){if(!_0xbc5681){throw new APINotFoundError(util['format'](_0xb229('0xa7'),_0x4f5afd[_0xb229('0x5f')]['id']));}var _0x28a00a=_0xbc5681['Interval'];if(_0x28a00a){var _0x48d168=_0xbc5681[_0xb229('0xa8')]||undefined;return _0x28a00a[_0xb229('0xa9')](_0x48d168)[_0xb229('0x1b')](function(_0x5a053a){if(!_0x5a053a){throw new APIOutOfIntervalError();}return _0xbc5681;});}else{return _0xbc5681;}})[_0xb229('0x1b')](function(_0x418391){if(!_0x418391[_0xb229('0xa1')]){return;}_0x2018b5[_0xb229('0xaa')]=_0x418391;_0x2018b5['list']=_0x418391[_0xb229('0xa1')];_0x2018b5['applications']=_[_0xb229('0xab')](_0x418391['Applications'],[_0xb229('0xac')],[_0xb229('0xad')]);if(_0x2018b5[_0xb229('0xaa')][_0xb229('0xa4')]){delete _0x2018b5[_0xb229('0xaa')][_0xb229('0xa4')];}if(_0x2018b5['account'][_0xb229('0xa1')]&&_0x2018b5['account'][_0xb229('0xa1')][_0xb229('0xae')]['length']){return _0x2018b5[_0xb229('0xaa')][_0xb229('0xa1')][_0xb229('0xae')][0x0];}var _0x35ebfc=_['defaults'](_0x4f5afd[_0xb229('0x63')],{'firstName':_0x4f5afd[_0xb229('0x63')][_0xb229('0x95')],'ListId':_0x418391[_0xb229('0xaf')]});_0x35ebfc[_0x4f5afd[_0xb229('0x63')][_0xb229('0x97')]]=_0x4f5afd[_0xb229('0x63')][_0xb229('0x95')];return db[_0xb229('0x9a')][_0xb229('0x62')](_0x35ebfc,{'fields':_0x468a70,'raw':!![]});})[_0xb229('0x1b')](function(_0x129f81){_0x2018b5[_0xb229('0xb0')]=_0x129f81;var _0x48dae3=createInteractionObject(_0x4f5afd[_0xb229('0x5f')]['id'],_0x4f5afd[_0xb229('0x63')],_0x4f5afd[_0xb229('0xb1')],_0x129f81);var _0x636531={'ChatWebsiteId':_0x4f5afd['params']['id']};if(_0x4f5afd[_0xb229('0x63')][_0xb229('0xb2')]){_0x636531[_0xb229('0xb2')]=_0x4f5afd[_0xb229('0x63')]['threadId'];_0x636531['closed']=![];return db[_0xb229('0xb3')][_0xb229('0x61')]({'where':_0x636531})[_0xb229('0x1b')](function(_0x3ff3ff){var _0xa53cbb=_0x4f5afd['body'][_0xb229('0x34')]&&_0x4f5afd[_0xb229('0x63')][_0xb229('0xb4')];if(_0x3ff3ff){_0x59a507=!![];return _0x3ff3ff;}else if(!_0xa53cbb&&_0x3ff3ff&&_0x3ff3ff[_0xb229('0xb5')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x48dae3[_0xb229('0xb2')]=_0x4f5afd['body'][_0xb229('0xb2')];_0x48dae3[_0xb229('0xb6')]=_0x4f5afd['body'][_0xb229('0xb6')];return db[_0xb229('0xb3')][_0xb229('0x62')](_0x48dae3);});}_0x636531[_0xb229('0xb7')]=_0x129f81['id'];if(_0x4f5afd[_0xb229('0x63')]['interaction']&&_0x4f5afd['body']['interaction']['id']){_0x636531['id']=_0x4f5afd[_0xb229('0x63')]['interaction']['id'];return db[_0xb229('0xb3')][_0xb229('0x61')]({'where':_0x636531})[_0xb229('0x1b')](function(_0x4a8bbc){var _0x4c18c4=_0x4f5afd['body']['customerIp']&&_0x4f5afd[_0xb229('0x63')][_0xb229('0xb4')];if(!_0x4c18c4&&_0x4a8bbc&&_0x4a8bbc[_0xb229('0xb5')]){throw new APIConflictError(_0xb229('0xb8'));}else if(_0x4a8bbc){_0x59a507=!![];return _0x4a8bbc;}else{return db[_0xb229('0xb3')][_0xb229('0x62')](_0x48dae3);}});}return db['ChatInteraction'][_0xb229('0x62')](_0x48dae3);})[_0xb229('0x1b')](function(_0x2610c0){if(!_0x59a507){return _0x2610c0;}var _0x539e77={'from':(_0x2018b5[_0xb229('0xb0')][_0xb229('0xb9')]||'')+'\x20'+(_0x2018b5[_0xb229('0xb0')]['lastName']||'')};if(_0x4f5afd[_0xb229('0x63')][_0xb229('0xb2')]&&_0x4f5afd[_0xb229('0x63')][_0xb229('0xba')]&&_0x4f5afd[_0xb229('0x63')][_0xb229('0xb2')]!=_0x4f5afd[_0xb229('0x63')]['messageId']){_0x539e77['threadId']=_0x4f5afd[_0xb229('0x63')][_0xb229('0xba')];}return _0x2610c0[_0xb229('0x6b')](_0x539e77);})[_0xb229('0x1b')](function(_0x2ae435){_0x2018b5[_0xb229('0xbb')]=_0x2ae435[_0xb229('0x64')]({'plain':!![]});_0x2018b5['interaction'][_0xb229('0xbc')]=!_0x59a507;if(_0x2018b5['interaction'][_0xb229('0xbc')]){if(_0x2018b5['account'][_0xb229('0xbd')]){_0x2018b5[_0xb229('0xbe')]['push']({'id':0x0,'priority':_0x2018b5[_0xb229('0xbe')]['length']+0x1,'app':_0xb229('0xbf'),'appdata':'unmanaged','interval':_0xb229('0xc0')});}}return db[_0xb229('0xc1')][_0xb229('0x62')]({'body':_0x4f5afd[_0xb229('0x63')][_0xb229('0x63')],'ChatWebsiteId':_0x4f5afd[_0xb229('0x5f')]['id'],'ChatInteractionId':_0x2ae435['id'],'direction':'in','ContactId':_0x2018b5['contact']['id'],'AttachmentId':_0x4f5afd[_0xb229('0x63')][_0xb229('0xc2')]});})['then'](function(_0x15662d){_0x2018b5[_0xb229('0x21')]=_0x15662d;if(!_0x2018b5[_0xb229('0xbb')]['UserId']){return;}return db['User']['find']({'attributes':['id',_0xb229('0x2f')],'where':{'id':_0x2018b5['interaction']['UserId']}});})[_0xb229('0x1b')](function(_0x157622){if(_0x157622){_0x2018b5['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x157622[_0xb229('0x2f')]+','+(_0x2018b5[_0xb229('0xaa')][_0xb229('0xc3')]||0xa),'interval':_0xb229('0xc0')});_0x2018b5[_0xb229('0xc4')]=!![];}if(!_0x2018b5[_0xb229('0xbb')][_0xb229('0xc5')]){return;}return db['ChatQueue'][_0xb229('0x61')]({'attributes':['id',_0xb229('0x2f')],'where':{'id':_0x2018b5[_0xb229('0xbb')][_0xb229('0xc5')]}});})['then'](function(_0x555bca){if(_0x555bca){_0x2018b5[_0xb229('0xbe')][_0xb229('0xc6')]({'id':0x0,'priority':0x1,'app':_0xb229('0xc7'),'appdata':_0x555bca['name']+','+(_0x2018b5[_0xb229('0xaa')][_0xb229('0xc8')]||0x12c),'interval':_0xb229('0xc0')});}return respondWithRpcPromise(_0xb229('0xc9'),_0xb229('0xca'),_0x2018b5);})[_0xb229('0x1b')](function(_0xa7b4c7){respondWithRpcPromise(_0xb229('0xcb'),_0xb229('0xcb'),{'event':'notify','message':_0xa7b4c7},client9002);return _0xa7b4c7;})[_0xb229('0x1b')](respondWithResult(_0x910fb6,null))[_0xb229('0x23')](APIHandleError(_0x910fb6));};exports[_0xb229('0xcc')]=function(_0x3d4300,_0x444570){var _0x5d245e,_0x175470,_0x269683;var _0x42ef23=[];var _0x1e4ae6={};var _0x575b39=_0x3d4300[_0xb229('0xcd')]||[];var _0x25d97b=[];var _0x4a1d92;return db[_0xb229('0x9a')]['describe']()[_0xb229('0x1b')](function(_0x16c045){if(!_0x16c045){throw new db[(_0xb229('0xce'))][(_0xb229('0xcf'))](_0xb229('0xd0'));}_0x42ef23=_[_0xb229('0xd1')](_[_0xb229('0x4a')](_0x16c045),['createdAt',_0xb229('0x9c'),_0xb229('0x9e'),_0xb229('0xaf')]);if(_0x3d4300[_0xb229('0x63')]['id']){delete _0x3d4300['body']['id'];}if(_['isNil'](_0x3d4300[_0xb229('0x63')][_0xb229('0x95')])){throw _0x444570[_0xb229('0x25')](0x1f4)[_0xb229('0x30')](new db[(_0xb229('0xce'))]['ValidationError'](_0xb229('0xd2')));}if(_[_0xb229('0x8d')](_0x3d4300[_0xb229('0x63')][_0xb229('0x63')])||_0x3d4300[_0xb229('0x63')][_0xb229('0x63')]===''){throw _0x444570['status'](0x1f4)[_0xb229('0x30')](new db['Sequelize']['ValidationError'](_0xb229('0xd3')));}if(_[_0xb229('0x8d')](_0x3d4300['body'][_0xb229('0xd4')])){throw _0x444570[_0xb229('0x25')](0x1f4)[_0xb229('0x30')](new db[(_0xb229('0xce'))][(_0xb229('0xcf'))](_0xb229('0xd5')+_0x42ef23));}if(!_[_0xb229('0x9d')](_0x42ef23,_0x3d4300['body'][_0xb229('0xd4')])){throw _0x444570[_0xb229('0x25')](0x1f4)['send'](new db[(_0xb229('0xce'))][(_0xb229('0xcf'))](_0xb229('0xd6')+_0x42ef23));}_0x1e4ae6[_0x3d4300[_0xb229('0x63')][_0xb229('0xd4')]]=_0x3d4300[_0xb229('0x63')]['from'];})[_0xb229('0x1b')](function(){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x3d4300[_0xb229('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xb229('0xa1')},{'model':db[_0xb229('0xd7')],'as':_0xb229('0xd7')}]});})[_0xb229('0x1b')](handleEntityNotFound(_0x444570,null))[_0xb229('0x1b')](function(_0x50c862){if(_0x50c862&&_0x50c862[_0xb229('0xa1')]){_0x175470=_0x50c862;var _0x5c73ca=_[_0xb229('0x14')](_0x3d4300[_0xb229('0x63')],{'firstName':_0x3d4300[_0xb229('0x63')][_0xb229('0x95')],'phone':_0x3d4300['body'][_0xb229('0x95')],'ListId':_0x50c862[_0xb229('0xaf')]});_0x5c73ca[_0x3d4300[_0xb229('0x63')][_0xb229('0xd4')]]=_0x3d4300['body'][_0xb229('0x95')];return db[_0xb229('0x9a')]['findOrCreate']({'where':_0x1e4ae6,'defaults':_0x5c73ca});}})[_0xb229('0xd8')](function(_0x262a35){if(_0x262a35){_0x269683=_0x262a35;var _0x397e22=fs['readFileSync'](path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0xd9')),'utf8');var _0xc4fa78=ejs[_0xb229('0xda')](_0x397e22,{'body':_[_0xb229('0xdb')](_0x3d4300[_0xb229('0x63')][_0xb229('0x63')]),'bodyTitle':_0x175470[_0xb229('0xdc')]});return db[_0xb229('0xdd')][_0xb229('0x62')]({'body':_0xc4fa78,'plainBody':htmlToText[_0xb229('0xde')](_0xc4fa78),'ContactId':_0x262a35['id'],'ChatWebsiteId':_0x175470['id']});}})['then'](function(_0x32c2a3){_0x4a1d92=_0x32c2a3;if(_0x575b39[_0xb229('0x50')]){var _0x3c10ef=_0x575b39[_0xb229('0x47')](function(_0x21c8de){return{'name':_0x21c8de[_0xb229('0xdf')],'basename':_0x21c8de[_0xb229('0x7b')],'type':_0x21c8de[_0xb229('0xe0')],'ChatOfflineMessageId':_0x32c2a3['id']};});_0x25d97b=_0x3c10ef[_0xb229('0x47')](_0x24e10c=>{var _0x14694c={'filename':_0x24e10c[_0xb229('0x2f')],'path':path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0xe1'),_0xb229('0xcd'),_0xb229('0xe2'),_0xb229('0xe3'),_0x24e10c[_0xb229('0xe4')])};return _0x14694c;});if(!_0x175470['openNewInteraction']){return db[_0xb229('0xe5')][_0xb229('0xe6')](function(_0xddcbef){return db[_0xb229('0xe7')]['bulkCreate'](_0x3c10ef,{'transaction':_0xddcbef});});}}})['then'](function(){if(_0x4a1d92){_0x5d245e=_0x4a1d92;return db[_0xb229('0xd7')][_0xb229('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0xb229('0xe8')],'as':_0xb229('0xe9'),'raw':!![],'include':[{'model':db[_0xb229('0xea')],'as':_0xb229('0xea'),'raw':!![]}]}]});}})[_0xb229('0x1b')](function(_0x46d067){if(_0x46d067&&_0x46d067[_0xb229('0xe9')]&&_0x175470[_0xb229('0xeb')]&&_0x175470['forwardOfflineAddress']){var _0x4bcf77=_0x46d067[_0xb229('0xec')]();return respondWithRpcPromise('SendMail',_0xb229('0xed'),{'account':_0x4bcf77,'message':{'from':util['format'](_0xb229('0xee'),_0x46d067[_0xb229('0x2f')],_0x46d067[_0xb229('0xef')]||_0x46d067['Smtp'][_0xb229('0xf0')]),'to':_0x175470['forwardOfflineAddress'],'subject':_0x175470[_0xb229('0xf1')],'html':_0x5d245e['body'],'attachments':_0x25d97b}},client9003)[_0xb229('0x1b')](function(){return _0x5d245e;})[_0xb229('0x23')](function(_0x69eccb){logger[_0xb229('0x20')](_0x69eccb);});}})[_0xb229('0x1b')](function(){if(_0x175470&&_0x175470[_0xb229('0xf2')]&&_0x175470['MailAccountId']){var _0x8b0c2=[];if(_0x575b39[_0xb229('0x50')]){_0x8b0c2=_0x575b39[_0xb229('0x47')](function(_0x1d4be6){return{'name':_0x1d4be6[_0xb229('0xdf')],'basename':_0x1d4be6[_0xb229('0x7b')],'type':_0x1d4be6[_0xb229('0xe0')],'ChatOfflineMessageId':_0x4a1d92['id']};});}var _0x5d19c7;if(!_[_0xb229('0x8d')](_0x175470[_0xb229('0xf3')])){var _0x5d993a=_['map'](_0x3d4300[_0xb229('0x63')],function(_0x16e602){return _0x16e602;});var _0x45287a=_[_0xb229('0xf4')](_0x5d993a)[0x0];var _0x3ce9bb=_[_0xb229('0xf5')](_0x45287a,function(_0x36fd0f){return _0x36fd0f;});_0x5d19c7=_0x3ce9bb[0x1][_0x175470[_0xb229('0xf3')]];}var _0x24dce1={'from':_0x269683['email'],'firstName':_0x269683[_0xb229('0xb9')],'lastName':_0x269683[_0xb229('0x39')],'mapKey':'email','message':{'from':_0x269683[_0xb229('0xef')],'to':_0x175470[_0xb229('0xd7')][_0xb229('0xef')],'cc':'','subject':_[_0xb229('0x8d')](_0x5d19c7)?_0x175470[_0xb229('0xf1')]:_0x5d19c7,'messageId':'','sentAt':new Date(),'attach':_0x8b0c2[_0xb229('0x50')],'attachments':_0x8b0c2,'originChannel':_0xb229('0xf6'),'ChatWebsiteId':_0x175470['id'],'ChatOfflineMessageId':_0x5d245e['id'],'originTo':_0x175470[_0xb229('0xd7')]['email']},'body':_0x5d245e[_0xb229('0x63')]};var _0x2a18cf={'account':{'id':_0x175470[_0xb229('0xf7')]},'body':_0x24dce1,'log':_0xb229('0xf8')};return respondWithRpcPromise(_0xb229('0xf8'),'notifyMail',_0x2a18cf,client9001)[_0xb229('0x1b')](function(){return _0x5d245e;})['catch'](function(_0x437c6a){logger[_0xb229('0x20')](_0x437c6a);});}return;})[_0xb229('0x1b')](function(){if(_0x5d245e){return _0x5d245e;}})[_0xb229('0x1b')](respondWithResult(_0x444570,null))[_0xb229('0x23')](function(){for(var _0x3f2140 of _0x575b39){var _0x476deb=path[_0xb229('0x83')](config[_0xb229('0x84')],'server','files',_0xb229('0xe2'),'offline-chat',_0x3f2140[_0xb229('0x7b')]);fs_extra[_0xb229('0xf9')](_0x476deb)[_0xb229('0x23')](function(_0x17d2ec){logger[_0xb229('0x20')](_0xb229('0xfa'),_0x476deb,_0x17d2ec);});}});};exports[_0xb229('0xfb')]=function(_0x3105c6,_0x70d67c){return db[_0xb229('0xb3')]['find']({'where':{'id':_0x3105c6[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x70d67c,null))[_0xb229('0x1b')](function(_0x213208){if(_0x213208){return _0x213208[_0xb229('0xfb')](_0x3105c6[_0xb229('0x63')][_0xb229('0x73')],_[_0xb229('0xfc')](_0x3105c6[_0xb229('0x63')],[_0xb229('0x73'),'id'])||{});}})[_0xb229('0x1b')](respondWithResult(_0x70d67c,null))[_0xb229('0x23')](handleError(_0x70d67c,null));};exports['getInteractions']=function(_0x1b2ce4,_0x17c277){var _0xb6d3fe={'raw':![],'where':{}};var _0x5b1c8b={};var _0x57ae42={'count':0x0,'rows':[]};return db[_0xb229('0x48')]['findOne']({'where':{'id':_0x1b2ce4['params']['id']}})['then'](handleEntityNotFound(_0x17c277,null))[_0xb229('0x1b')](function(_0x2b366c){if(_0x2b366c){_0x5b1c8b[_0xb229('0x40')]=_[_0xb229('0x4a')](db['ChatInteraction'][_0xb229('0x60')]);_0x5b1c8b[_0xb229('0x4b')]=_['keys'](_0x1b2ce4[_0xb229('0x4b')]);_0x5b1c8b['filters']=_[_0xb229('0x4d')](_0x5b1c8b['model'],_0x5b1c8b[_0xb229('0x4b')]);_0xb6d3fe[_0xb229('0x4f')]=_[_0xb229('0x4d')](_0x5b1c8b[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x1b2ce4['query'][_0xb229('0x4e')]));_0xb6d3fe['attributes']=_0xb6d3fe['attributes'][_0xb229('0x50')]?_0xb6d3fe[_0xb229('0x4f')]:_0x5b1c8b[_0xb229('0x40')];if(!_0x1b2ce4['query'][_0xb229('0x51')](_0xb229('0x52'))){_0xb6d3fe[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x28')]);_0xb6d3fe['offset']=qs[_0xb229('0x2a')](_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x2a')]);}_0xb6d3fe['order']=qs[_0xb229('0x54')](_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x54')]);_0xb6d3fe[_0xb229('0x55')]=qs[_0xb229('0x4c')](_[_0xb229('0x56')](_0x1b2ce4['query'],_0x5b1c8b['filters']));_0xb6d3fe[_0xb229('0x55')]['ChatWebsiteId']=_0x2b366c['id'];if(_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x57')]){_0xb6d3fe[_0xb229('0x55')]=_[_0xb229('0x59')](_0xb6d3fe['where'],{'$or':_['map'](_0xb6d3fe[_0xb229('0x4f')],function(_0x650dd8){var _0x53af19={};_0x53af19[_0x650dd8]={'$like':'%'+_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x53af19;})});}_0xb6d3fe=_[_0xb229('0x59')]({},_0xb6d3fe,_0x1b2ce4[_0xb229('0x5a')]);return db[_0xb229('0xb3')]['count']({'where':_0xb6d3fe[_0xb229('0x55')]})[_0xb229('0x1b')](function(_0x4753ba){_0x57ae42[_0xb229('0x29')]=_0x4753ba;if(_0x1b2ce4[_0xb229('0x4b')]['includeAll']){_0xb6d3fe[_0xb229('0x71')]=[{'model':db[_0xb229('0x9a')],'as':_0xb229('0xfd'),'required':![]},{'model':db['User'],'as':_0xb229('0xfe'),'attributes':[_0xb229('0x2f'),_0xb229('0xff'),'internal'],'required':![]},{'model':db[_0xb229('0x100')],'as':_0xb229('0x101'),'attributes':['id',_0xb229('0x2f'),'color'],'where':_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x102')]?{'id':_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x102')]}:undefined,'required':_0x1b2ce4[_0xb229('0x4b')][_0xb229('0x102')]?!![]:![]}];}return db[_0xb229('0xb3')][_0xb229('0x5c')](_0xb6d3fe);})[_0xb229('0x1b')](function(_0x46df5b){_0x57ae42['rows']=_0x46df5b;return _0x57ae42;});}})[_0xb229('0x1b')](respondWithFilteredResult(_0x17c277,_0xb6d3fe))[_0xb229('0x23')](handleError(_0x17c277,null));};exports[_0xb229('0x103')]=function(_0x15fc66,_0x4c51a0){var _0x57e0e1=0x0;var _0xdb1e07=0x0;var _0x5352c8=![];var _0x390766;var _0x112f6b;return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x15fc66[_0xb229('0x5f')]['id']},'include':[{'model':db['Interval'],'as':_0xb229('0xa5'),'include':[{'model':db[_0xb229('0xa5')],'as':_0xb229('0xa6'),'attributes':['id','interval']}]}]})[_0xb229('0x1b')](handleEntityNotFound(_0x4c51a0,null))[_0xb229('0x1b')](function(_0x3da5b8){if(_0x3da5b8){_0x390766=_0x3da5b8;return _0x3da5b8[_0xb229('0x104')]({'raw':!![]});}})[_0xb229('0x1b')](function(_0x42b601){if(_0x390766){if(_0x42b601){_0x112f6b=_0x42b601;}}return require(_0xb229('0x86'))[_0xb229('0x105')]();})[_0xb229('0x1b')](function(_0x482c43){if(_0x482c43){_0xdb1e07=_0x482c43[_0xb229('0x106')];_0x5352c8=_0x482c43[_0xb229('0x87')];}})['then'](function(){return db[_0xb229('0xb3')][_0xb229('0x29')]({'where':{'closed':![]}});})[_0xb229('0x1b')](function(_0x39eaf5){_0x57e0e1=_0x39eaf5;if(_0xdb1e07&&_0x39eaf5>_0xdb1e07){return db[_0xb229('0x107')][_0xb229('0x70')]({'where':{'id':0x1}})[_0xb229('0x1b')](function(_0x54bf87){if(_0x54bf87){_0x54bf87[_0xb229('0x108')]('chatLicenseExceeded');}});}})[_0xb229('0x1b')](function(){var _0x404a3f=_0x390766[_0xb229('0xa5')];var _0xba86dc=_0x390766[_0xb229('0xa8')]||undefined;return _0x404a3f?_0x404a3f['ifTime'](_0xba86dc):!![];})['then'](function(_0x577083){var _0x13d788=fs[_0xb229('0x109')](path[_0xb229('0x83')](config[_0xb229('0x84')],_0xb229('0x10a')),_0xb229('0x10b'));var _0x4de797=new url[(_0xb229('0x10c'))](_0x390766['address'])[_0xb229('0x10d')];var _0xe0cfa8=_0xb229('0x10e');var _0x11b54a=![];var _0x23e12d={'chatVersion':_0xe0cfa8,'chatWebsiteAddressOrigin':_0x4de797,'remote':_0x390766[_0xb229('0x10f')],'query':querystring[_0xb229('0x110')](_[_0xb229('0x59')](_0x390766['get']({'plain':!![]}),{'customerIp':_0x15fc66[_0xb229('0xb1')][_0xb229('0x36')]||_0x15fc66[_0xb229('0xb1')][_0xb229('0x111')]||_0x15fc66[_0xb229('0x112')][_0xb229('0x113')]||_0x15fc66['ip'],'referer':_0x15fc66['headers'][_0xb229('0xb4')],'openedInteractions':_0x57e0e1,'maxInteractions':_0xdb1e07,'virtual':_0x5352c8[_0xb229('0x106')],'online':_0x577083,'custom':_0x5352c8}))[_0xb229('0x114')](/'/g,'\x5c\x27')};_0x4c51a0[_0xb229('0x30')](ejs[_0xb229('0xda')](Mustache[_0xb229('0xda')](_0x13d788,_0x23e12d),{'proactiveActions':_0x112f6b,'alignment':_0x390766[_0xb229('0x115')],'verticalAlignment':_0x390766[_0xb229('0x116')],'div_color':_0x390766[_0xb229('0x117')],'labelText':_0x390766['labelText'],'text_color':_0x390766[_0xb229('0x118')],'text_button_color':_0x390766[_0xb229('0x119')],'button_color':_0x390766['color_button'],'background_color':_0x390766[_0xb229('0x11a')],'hideWhenOffline':_0x390766[_0xb229('0x11b')],'intervalId':_0x390766[_0xb229('0x11c')],'isDevelopment':_0x11b54a,'chatVersion':_0xe0cfa8}));})[_0xb229('0x23')](handleError(_0x4c51a0,null));};exports[_0xb229('0x11d')]=function(_0x103e4b,_0x5c48a5){var _0x26354d=_0x103e4b[_0xb229('0x5f')]['id'];var _0x475d2f=_0x103e4b[_0xb229('0x63')];var _0x532bf1=0xc8;var _0x2e933d=null;return db['sequelize'][_0xb229('0xe6')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x451369){return db[_0xb229('0x48')][_0xb229('0x70')]({'where':{'id':_0x26354d},'transaction':_0x451369})['then'](function(_0x17c782){if(_0x17c782){return db['ChatApplication'][_0xb229('0x2c')]({'where':{'ChatWebsiteId':_0x26354d},'transaction':_0x451369})['then'](function(){var _0x45b0b4=_[_0xb229('0x47')](_0x475d2f,function(_0xb6c3eb){_0xb6c3eb[_0xb229('0x75')]=_0x26354d;return _0xb6c3eb;});return db[_0xb229('0xa3')][_0xb229('0x11e')](_0x45b0b4,{'transaction':_0x451369});});}else{_0x532bf1=0x194;_0x2e933d=[];}});})[_0xb229('0x1b')](function(){if(_0x532bf1!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x26354d},'order':_0xb229('0xac')})[_0xb229('0x1b')](function(_0x23d8ef){_0x2e933d=_0x23d8ef;});}})[_0xb229('0x23')](function(_0x1eec46){_0x532bf1=0x1f4;logger[_0xb229('0x20')](_0x1eec46[_0xb229('0x2e')]);if(_0x1eec46[_0xb229('0x2f')]){delete _0x1eec46[_0xb229('0x2f')];}_0x2e933d=_0x1eec46;})[_0xb229('0x11f')](function(){if(_0x2e933d===null){_0x5c48a5[_0xb229('0x24')](_0x532bf1);}else{if(_0x532bf1===0x1f4){_0x5c48a5[_0xb229('0x25')](_0x532bf1)[_0xb229('0x30')](_0x2e933d);}else{_0x5c48a5['status'](_0x532bf1)[_0xb229('0x27')](_0x2e933d);}}});};exports['getApplications']=function(_0x553b65,_0x57dcd6){var _0x2f37f6={};var _0x597727={};var _0x11fdbc;var _0x47a315;return db[_0xb229('0x48')]['findOne']({'where':{'id':_0x553b65[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x57dcd6,null))[_0xb229('0x1b')](function(_0x3d6b68){if(_0x3d6b68){_0x11fdbc=_0x3d6b68;_0x597727['model']=_[_0xb229('0x4a')](db[_0xb229('0xa3')][_0xb229('0x60')]);_0x597727['query']=_['keys'](_0x553b65[_0xb229('0x4b')]);_0x597727[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x597727[_0xb229('0x40')],_0x597727[_0xb229('0x4b')]);_0x2f37f6[_0xb229('0x4f')]=_[_0xb229('0x4d')](_0x597727[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x553b65[_0xb229('0x4b')][_0xb229('0x4e')]));_0x2f37f6[_0xb229('0x4f')]=_0x2f37f6[_0xb229('0x4f')]['length']?_0x2f37f6[_0xb229('0x4f')]:_0x597727[_0xb229('0x40')];_0x2f37f6[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x553b65[_0xb229('0x4b')]['sort']);_0x2f37f6['where']=qs[_0xb229('0x4c')](_['pick'](_0x553b65[_0xb229('0x4b')],_0x597727[_0xb229('0x4c')]));if(_0x553b65['query'][_0xb229('0x57')]){_0x2f37f6[_0xb229('0x55')]=_['merge'](_0x2f37f6['where'],{'$or':_['map'](_0x2f37f6[_0xb229('0x4f')],function(_0x5e5048){var _0x3f6fd3={};_0x3f6fd3[_0x5e5048]={'$like':'%'+_0x553b65[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x3f6fd3;})});}_0x2f37f6=_['merge']({},_0x2f37f6,_0x553b65['options']);return _0x11fdbc[_0xb229('0x120')](_0x2f37f6);}})[_0xb229('0x1b')](function(_0x5f44da){if(_0x5f44da){_0x47a315=_0x5f44da[_0xb229('0x50')];if(!_0x553b65[_0xb229('0x4b')][_0xb229('0x51')](_0xb229('0x52'))){_0x2f37f6[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x553b65[_0xb229('0x4b')][_0xb229('0x28')]);_0x2f37f6[_0xb229('0x2a')]=qs[_0xb229('0x2a')](_0x553b65['query'][_0xb229('0x2a')]);}return _0x11fdbc[_0xb229('0x120')](_0x2f37f6);}})['then'](function(_0x55fb69){if(_0x55fb69){return _0x55fb69?{'count':_0x47a315,'rows':_0x55fb69}:null;}})[_0xb229('0x1b')](respondWithResult(_0x57dcd6,null))[_0xb229('0x23')](handleError(_0x57dcd6,null));};exports[_0xb229('0x121')]=function(_0x29f340,_0x48a121){return db[_0xb229('0x122')]['find']({'where':{'id':_0x29f340['params']['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x48a121,null))[_0xb229('0x1b')](function(_0x1fde72){if(_0x1fde72){return _0x1fde72[_0xb229('0x121')](_0x29f340['body']['ids'],_[_0xb229('0xfc')](_0x29f340[_0xb229('0x63')],[_0xb229('0x73'),'id'])||{});}})[_0xb229('0x1b')](respondWithResult(_0x48a121,null))['catch'](handleError(_0x48a121,null));};exports[_0xb229('0x104')]=function(_0x3148fa,_0x3cb7e2){var _0x562b6a={};var _0x180621={};var _0xd19b91;var _0x122022;return db['ChatWebsite'][_0xb229('0x70')]({'where':{'id':_0x3148fa[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x3cb7e2,null))['then'](function(_0x1caeae){if(_0x1caeae){_0xd19b91=_0x1caeae;_0x180621[_0xb229('0x40')]=_[_0xb229('0x4a')](db[_0xb229('0x123')][_0xb229('0x60')]);_0x180621[_0xb229('0x4b')]=_['keys'](_0x3148fa['query']);_0x180621[_0xb229('0x4c')]=_[_0xb229('0x4d')](_0x180621[_0xb229('0x40')],_0x180621[_0xb229('0x4b')]);_0x562b6a['attributes']=_[_0xb229('0x4d')](_0x180621[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x3148fa[_0xb229('0x4b')][_0xb229('0x4e')]));_0x562b6a['attributes']=_0x562b6a[_0xb229('0x4f')]['length']?_0x562b6a[_0xb229('0x4f')]:_0x180621[_0xb229('0x40')];_0x562b6a[_0xb229('0x53')]=qs['sort'](_0x3148fa[_0xb229('0x4b')]['sort']);_0x562b6a['where']=qs[_0xb229('0x4c')](_[_0xb229('0x56')](_0x3148fa[_0xb229('0x4b')],_0x180621[_0xb229('0x4c')]));if(_0x3148fa[_0xb229('0x4b')][_0xb229('0x57')]){_0x562b6a[_0xb229('0x55')]=_['merge'](_0x562b6a['where'],{'$or':_[_0xb229('0x47')](_0x562b6a[_0xb229('0x4f')],function(_0x2fb71d){var _0x259550={};_0x259550[_0x2fb71d]={'$like':'%'+_0x3148fa[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x259550;})});}_0x562b6a=_[_0xb229('0x59')]({},_0x562b6a,_0x3148fa[_0xb229('0x5a')]);return _0xd19b91[_0xb229('0x104')](_0x562b6a);}})[_0xb229('0x1b')](function(_0x36fc3f){if(_0x36fc3f){_0x122022=_0x36fc3f[_0xb229('0x50')];if(!_0x3148fa[_0xb229('0x4b')][_0xb229('0x51')]('nolimit')){_0x562b6a[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x3148fa['query'][_0xb229('0x28')]);_0x562b6a[_0xb229('0x2a')]=qs[_0xb229('0x2a')](_0x3148fa['query'][_0xb229('0x2a')]);}return _0xd19b91[_0xb229('0x104')](_0x562b6a);}})[_0xb229('0x1b')](function(_0x5a9251){if(_0x5a9251){return _0x5a9251?{'count':_0x122022,'rows':_0x5a9251}:null;}})[_0xb229('0x1b')](respondWithResult(_0x3cb7e2,null))[_0xb229('0x23')](handleError(_0x3cb7e2,null));};exports[_0xb229('0x124')]=function(_0xd2b450,_0x119135){var _0x1fcf72=_0xd2b450[_0xb229('0x4b')][_0xb229('0x125')]===_0xb229('0x126')?_0xb229('0x127'):_0xb229('0x128');return db['ChatWebsite'][_0xb229('0x61')]({'attributes':['id',_0x1fcf72],'where':{'id':_0xd2b450[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x119135,null))[_0xb229('0x1b')](function(_0x2db17f){if(_0x2db17f){var _0x597c98=_0x2db17f[_0x1fcf72];var _0x3d28a2=_0x597c98&&_0x597c98[_0xb229('0x129')]?_0x597c98[_0xb229('0x129')]:[];_0x119135[_0xb229('0x30')]({'fromKey':_[_0xb229('0x8d')](_0x597c98[_0xb229('0x12a')])?undefined:_0x597c98[_0xb229('0x12a')],'count':_0x3d28a2[_0xb229('0x50')],'rows':_0x3d28a2});}})[_0xb229('0x23')](handleError(_0x119135,null));};exports[_0xb229('0x12b')]=function(_0x225290,_0x1ee701){var _0x21562f={'raw':![],'where':{}};var _0x4039fa={};var _0x371cc2={'count':0x0,'rows':[]};return db[_0xb229('0x48')][_0xb229('0x70')]({'where':{'id':_0x225290[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x1ee701,null))[_0xb229('0x1b')](function(_0x3ceb0c){if(_0x3ceb0c){_0x4039fa[_0xb229('0x40')]=_[_0xb229('0x4a')](db['ChatOfflineMessage'][_0xb229('0x60')]);_0x4039fa['query']=_[_0xb229('0x4a')](_0x225290['query']);_0x4039fa[_0xb229('0x4c')]=_['intersection'](_0x4039fa[_0xb229('0x40')],_0x4039fa[_0xb229('0x4b')]);_0x21562f[_0xb229('0x4f')]=_[_0xb229('0x4d')](_0x4039fa[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x225290[_0xb229('0x4b')][_0xb229('0x4e')]));_0x21562f[_0xb229('0x4f')]=_0x21562f['attributes'][_0xb229('0x50')]?_0x21562f[_0xb229('0x4f')]:_0x4039fa[_0xb229('0x40')];if(!_0x225290[_0xb229('0x4b')][_0xb229('0x51')]('nolimit')){_0x21562f[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x225290['query'][_0xb229('0x28')]);_0x21562f['offset']=qs['offset'](_0x225290['query']['offset']);}_0x21562f[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x225290['query']['sort']);_0x21562f['where']=qs['filters'](_['pick'](_0x225290[_0xb229('0x4b')],_0x4039fa['filters']));_0x21562f[_0xb229('0x55')][_0xb229('0x75')]=_0x3ceb0c['id'];if(_0x225290[_0xb229('0x4b')][_0xb229('0x57')]){_0x21562f[_0xb229('0x55')]=_[_0xb229('0x59')](_0x21562f[_0xb229('0x55')],{'$or':_[_0xb229('0x47')](_0x21562f[_0xb229('0x4f')],function(_0x444194){var _0x2325d3={};_0x2325d3[_0x444194]={'$like':'%'+_0x225290[_0xb229('0x4b')]['filter']+'%'};return _0x2325d3;})});}_0x21562f=_[_0xb229('0x59')]({},_0x21562f,_0x225290['options']);return db[_0xb229('0xdd')][_0xb229('0x29')]({'where':_0x21562f[_0xb229('0x55')]})[_0xb229('0x1b')](function(_0x49af8a){_0x371cc2['count']=_0x49af8a;if(_0x225290[_0xb229('0x4b')][_0xb229('0x5b')]){_0x21562f[_0xb229('0x71')]=[{'all':!![]}];}else{_0x21562f[_0xb229('0x71')]=[{'model':db[_0xb229('0x9a')],'as':_0xb229('0xfd'),'required':![]},{'model':db['Attachment'],'as':_0xb229('0x12c'),'required':![]}];}return db[_0xb229('0xdd')][_0xb229('0x5c')](_0x21562f);})[_0xb229('0x1b')](function(_0x344cf4){_0x371cc2[_0xb229('0x5d')]=_0x344cf4;return _0x371cc2;});}})[_0xb229('0x1b')](respondWithFilteredResult(_0x1ee701,_0x21562f))[_0xb229('0x23')](handleError(_0x1ee701,null));};exports[_0xb229('0x12d')]=function(_0x1a2e17,_0x58cf67){return db[_0xb229('0x48')][_0xb229('0x61')]({'where':{'id':_0x1a2e17[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x58cf67,null))[_0xb229('0x1b')](function(_0x5d02fb){if(_0x5d02fb){return _0x5d02fb[_0xb229('0x12d')](_0x1a2e17[_0xb229('0x63')]['ids'],_[_0xb229('0xfc')](_0x1a2e17[_0xb229('0x63')],[_0xb229('0x73'),'id'])||{})['spread'](function(_0x59dc58){for(var _0x1a92de=0x0;_0x1a92de<_0x1a2e17['body'][_0xb229('0x73')][_0xb229('0x50')];_0x1a92de+=0x1){socket[_0xb229('0x12e')]('userChatWebsite:save',{'UserId':Number(_0x1a2e17[_0xb229('0x63')][_0xb229('0x73')][_0x1a92de]),'ChatWebsiteId':Number(_0x1a2e17['params']['id'])});}return _0x59dc58;});}})['then'](respondWithResult(_0x58cf67,null))[_0xb229('0x23')](handleError(_0x58cf67,null));};exports[_0xb229('0x12f')]=function(_0x67fa1e,_0x2b8025){return db[_0xb229('0x48')]['find']({'where':{'id':_0x67fa1e['params']['id']}})['then'](handleEntityNotFound(_0x2b8025,null))[_0xb229('0x1b')](function(_0x491df3){if(_0x491df3){return _0x491df3[_0xb229('0x12f')](_0x67fa1e[_0xb229('0x4b')][_0xb229('0x73')])[_0xb229('0x1b')](function(){if(_[_0xb229('0x130')](_0x67fa1e['query'][_0xb229('0x73')])){for(var _0x11c342=0x0;_0x11c342<_0x67fa1e[_0xb229('0x4b')]['ids'][_0xb229('0x50')];_0x11c342+=0x1){socket['emit'](_0xb229('0x131'),{'UserId':Number(_0x67fa1e['query'][_0xb229('0x73')][_0x11c342]),'ChatWebsiteId':Number(_0x67fa1e[_0xb229('0x5f')]['id'])});}}else{socket[_0xb229('0x12e')](_0xb229('0x131'),{'UserId':Number(_0x67fa1e[_0xb229('0x4b')][_0xb229('0x73')]),'ChatWebsiteId':Number(_0x67fa1e[_0xb229('0x5f')]['id'])});}});}})[_0xb229('0x1b')](respondWithStatusCode(_0x2b8025,null))[_0xb229('0x23')](handleError(_0x2b8025,null));};exports[_0xb229('0x132')]=function(_0x415bd5,_0x5206e8){var _0x56cb4d={};var _0x1533a7={};var _0x3e6cff;var _0x465300;return db[_0xb229('0x48')]['findOne']({'where':{'id':_0x415bd5[_0xb229('0x5f')]['id']}})[_0xb229('0x1b')](handleEntityNotFound(_0x5206e8,null))['then'](function(_0x40aae4){if(_0x40aae4){_0x3e6cff=_0x40aae4;_0x1533a7[_0xb229('0x40')]=_[_0xb229('0x4a')](db[_0xb229('0x133')][_0xb229('0x60')]);_0x1533a7[_0xb229('0x4b')]=_['keys'](_0x415bd5[_0xb229('0x4b')]);_0x1533a7['filters']=_[_0xb229('0x4d')](_0x1533a7[_0xb229('0x40')],_0x1533a7[_0xb229('0x4b')]);_0x56cb4d['attributes']=_[_0xb229('0x4d')](_0x1533a7[_0xb229('0x40')],qs[_0xb229('0x4e')](_0x415bd5[_0xb229('0x4b')][_0xb229('0x4e')]));_0x56cb4d[_0xb229('0x4f')]=_0x56cb4d['attributes'][_0xb229('0x50')]?_0x56cb4d[_0xb229('0x4f')]:_0x1533a7[_0xb229('0x40')];_0x56cb4d[_0xb229('0x53')]=qs[_0xb229('0x54')](_0x415bd5['query'][_0xb229('0x54')]);_0x56cb4d[_0xb229('0x55')]=qs[_0xb229('0x4c')](_[_0xb229('0x56')](_0x415bd5[_0xb229('0x4b')],_0x1533a7[_0xb229('0x4c')]));if(_0x415bd5[_0xb229('0x4b')][_0xb229('0x57')]){_0x56cb4d['where']=_['merge'](_0x56cb4d[_0xb229('0x55')],{'$or':_[_0xb229('0x47')](_0x56cb4d[_0xb229('0x4f')],function(_0x4e6272){var _0x9cc80b={};_0x9cc80b[_0x4e6272]={'$like':'%'+_0x415bd5[_0xb229('0x4b')][_0xb229('0x57')]+'%'};return _0x9cc80b;})});}_0x56cb4d=_[_0xb229('0x59')]({},_0x56cb4d,_0x415bd5[_0xb229('0x5a')]);return _0x3e6cff[_0xb229('0x132')](_0x56cb4d);}})[_0xb229('0x1b')](function(_0x56ea7e){if(_0x56ea7e){_0x465300=_0x56ea7e[_0xb229('0x50')];if(!_0x415bd5[_0xb229('0x4b')]['hasOwnProperty'](_0xb229('0x52'))){_0x56cb4d[_0xb229('0x28')]=qs[_0xb229('0x28')](_0x415bd5[_0xb229('0x4b')][_0xb229('0x28')]);_0x56cb4d[_0xb229('0x2a')]=qs[_0xb229('0x2a')](_0x415bd5[_0xb229('0x4b')][_0xb229('0x2a')]);}return _0x3e6cff[_0xb229('0x132')](_0x56cb4d);}})['then'](function(_0x3a1b1b){if(_0x3a1b1b){return _0x3a1b1b?{'count':_0x465300,'rows':_0x3a1b1b}:null;}})[_0xb229('0x1b')](respondWithResult(_0x5206e8,null))[_0xb229('0x23')](handleError(_0x5206e8,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index dcd60f6..f250358 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 _0x12c9=['ChatWebsite','setMaxListeners','save','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x34145e,_0x689e31){var _0x27ed04=function(_0x297fc7){while(--_0x297fc7){_0x34145e['push'](_0x34145e['shift']());}};_0x27ed04(++_0x689e31);}(_0x12c9,0x1c9));var _0x912c=function(_0x38859b,_0x3f19f6){_0x38859b=_0x38859b-0x0;var _0x169c75=_0x12c9[_0x38859b];return _0x169c75;};'use strict';var EventEmitter=require(_0x912c('0x0'));var ChatWebsite=require(_0x912c('0x1'))['db'][_0x912c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x912c('0x3')](0x0);var events={'afterCreate':_0x912c('0x4'),'afterUpdate':'update','afterDestroy':_0x912c('0x5')};function emitEvent(_0xcb7adc){return function(_0x2c8059,_0x298dcc,_0x1732a0){ChatWebsiteEvents['emit'](_0xcb7adc+':'+_0x2c8059['id'],_0x2c8059);ChatWebsiteEvents['emit'](_0xcb7adc,_0x2c8059);_0x1732a0(null);};}for(var e in events){if(events[_0x912c('0x6')](e)){var event=events[e];ChatWebsite[_0x912c('0x7')](e,emitEvent(event));}}module[_0x912c('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x2029=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4c8c8d,_0x58f40a){var _0x4cb761=function(_0x2cbbb3){while(--_0x2cbbb3){_0x4c8c8d['push'](_0x4c8c8d['shift']());}};_0x4cb761(++_0x58f40a);}(_0x2029,0x171));var _0x9202=function(_0x3943ab,_0x1bd654){_0x3943ab=_0x3943ab-0x0;var _0x47a4cb=_0x2029[_0x3943ab];return _0x47a4cb;};'use strict';var EventEmitter=require(_0x9202('0x0'));var ChatWebsite=require(_0x9202('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9202('0x2')](0x0);var events={'afterCreate':_0x9202('0x3'),'afterUpdate':_0x9202('0x4'),'afterDestroy':_0x9202('0x5')};function emitEvent(_0x39fa99){return function(_0x81709f,_0x858200,_0x45d53d){ChatWebsiteEvents[_0x9202('0x6')](_0x39fa99+':'+_0x81709f['id'],_0x81709f);ChatWebsiteEvents[_0x9202('0x6')](_0x39fa99,_0x81709f);_0x45d53d(null);};}for(var e in events){if(events[_0x9202('0x7')](e)){var event=events[e];ChatWebsite[_0x9202('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 9d21e99..6d75979 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 _0xff5a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','util'];(function(_0x2ead29,_0x137342){var _0xe45568=function(_0x1d3e4d){while(--_0x1d3e4d){_0x2ead29['push'](_0x2ead29['shift']());}};_0xe45568(++_0x137342);}(_0xff5a,0x10d));var _0xaff5=function(_0x4dbce0,_0x414a7e){_0x4dbce0=_0x4dbce0-0x0;var _0x5b166c=_0xff5a[_0x4dbce0];return _0x5b166c;};'use strict';var _=require('lodash');var util=require(_0xaff5('0x0'));var logger=require(_0xaff5('0x1'))(_0xaff5('0x2'));var moment=require(_0xaff5('0x3'));var BPromise=require(_0xaff5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaff5('0x5'));var rimraf=require(_0xaff5('0x6'));var config=require(_0xaff5('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xaff5('0x8')]=function(_0x382207,_0x43cedf){return _0x382207[_0xaff5('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e40=['define','chat_websites','lodash','util','moment','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x25b192,_0x1c2c94){var _0x4a780f=function(_0x457df7){while(--_0x457df7){_0x25b192['push'](_0x25b192['shift']());}};_0x4a780f(++_0x1c2c94);}(_0x1e40,0x6e));var _0x01e4=function(_0x4f256a,_0x590e09){_0x4f256a=_0x4f256a-0x0;var _0x4554e8=_0x1e40[_0x4f256a];return _0x4554e8;};'use strict';var _=require(_0x01e4('0x0'));var util=require(_0x01e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x01e4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x01e4('0x3'));var rimraf=require('rimraf');var config=require(_0x01e4('0x4'));var attributes=require(_0x01e4('0x5'));module[_0x01e4('0x6')]=function(_0x26e36f,_0x3b3d5f){return _0x26e36f[_0x01e4('0x7')]('ChatWebsite',attributes,{'tableName':_0x01e4('0x8'),'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 beefa24..24e48d8 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 _0xb281=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','then'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xb281,0x177));var _0x1b28=function(_0x412324,_0x4c66d9){_0x412324=_0x412324-0x0;var _0x3b7bfe=_0xb281[_0x412324];return _0x3b7bfe;};'use strict';var _=require(_0x1b28('0x0'));var util=require(_0x1b28('0x1'));var moment=require(_0x1b28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b28('0x3'));var logger=require(_0x1b28('0x4'))(_0x1b28('0x5'));var config=require('../../config/environment');var jayson=require(_0x1b28('0x6'));var client=jayson[_0x1b28('0x7')][_0x1b28('0x8')]({'port':0x232a});config[_0x1b28('0x9')]=_[_0x1b28('0xa')](config[_0x1b28('0x9')],{'host':_0x1b28('0xb'),'port':0x18eb});var socket=require(_0x1b28('0xc'))(new Redis(config['redis']));require(_0x1b28('0xd'))['register'](socket);function respondWithRpcPromise(_0x46fd8f,_0x300270,_0x51920e){return new BPromise(function(_0x1eb5a3,_0x5cea24){return client['request'](_0x46fd8f,_0x51920e)[_0x1b28('0xe')](function(_0x4d2b0d){logger[_0x1b28('0xf')](_0x1b28('0x10'),_0x300270,_0x1b28('0x11'));logger[_0x1b28('0x12')](_0x1b28('0x13'),_0x300270,_0x1b28('0x11'),JSON[_0x1b28('0x14')](_0x4d2b0d));if(_0x4d2b0d[_0x1b28('0x15')]){if(_0x4d2b0d[_0x1b28('0x15')][_0x1b28('0x16')]===0x1f4){logger[_0x1b28('0x15')](_0x1b28('0x10'),_0x300270,_0x4d2b0d[_0x1b28('0x15')][_0x1b28('0x17')]);return _0x5cea24(_0x4d2b0d[_0x1b28('0x15')]['message']);}logger[_0x1b28('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x300270,_0x4d2b0d[_0x1b28('0x15')][_0x1b28('0x17')]);return _0x1eb5a3(_0x4d2b0d[_0x1b28('0x15')][_0x1b28('0x17')]);}else{logger[_0x1b28('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x300270,'request\x20sent');_0x1eb5a3(_0x4d2b0d[_0x1b28('0x18')]['message']);}})[_0x1b28('0x19')](function(_0x119dd4){logger[_0x1b28('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x300270,_0x119dd4);_0x5cea24(_0x119dd4);});});} \ No newline at end of file +var _0xc4b0=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','util'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0xc4b0,0xdf));var _0x0c4b=function(_0x3c3128,_0x117d7d){_0x3c3128=_0x3c3128-0x0;var _0x26b55e=_0xc4b0[_0x3c3128];return _0x26b55e;};'use strict';var _=require('lodash');var util=require(_0x0c4b('0x0'));var moment=require(_0x0c4b('0x1'));var BPromise=require(_0x0c4b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c4b('0x3'));var db=require(_0x0c4b('0x4'))['db'];var utils=require(_0x0c4b('0x5'));var logger=require(_0x0c4b('0x6'))(_0x0c4b('0x7'));var config=require(_0x0c4b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0c4b('0x9')]['http']({'port':0x232a});config[_0x0c4b('0xa')]=_[_0x0c4b('0xb')](config['redis'],{'host':_0x0c4b('0xc'),'port':0x18eb});var socket=require(_0x0c4b('0xd'))(new Redis(config['redis']));require(_0x0c4b('0xe'))[_0x0c4b('0xf')](socket);function respondWithRpcPromise(_0x4ef964,_0x5bdaa2,_0x583bb2){return new BPromise(function(_0x4ee589,_0x3d815c){return client[_0x0c4b('0x10')](_0x4ef964,_0x583bb2)[_0x0c4b('0x11')](function(_0x4ecc85){logger[_0x0c4b('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x5bdaa2,_0x0c4b('0x13'));logger[_0x0c4b('0x14')](_0x0c4b('0x15'),_0x5bdaa2,'request\x20sent',JSON[_0x0c4b('0x16')](_0x4ecc85));if(_0x4ecc85['error']){if(_0x4ecc85['error']['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5bdaa2,_0x4ecc85[_0x0c4b('0x17')]['message']);return _0x3d815c(_0x4ecc85[_0x0c4b('0x17')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5bdaa2,_0x4ecc85[_0x0c4b('0x17')][_0x0c4b('0x18')]);return _0x4ee589(_0x4ecc85[_0x0c4b('0x17')][_0x0c4b('0x18')]);}else{logger[_0x0c4b('0x12')](_0x0c4b('0x19'),_0x5bdaa2,_0x0c4b('0x13'));_0x4ee589(_0x4ecc85[_0x0c4b('0x1a')][_0x0c4b('0x18')]);}})[_0x0c4b('0x1b')](function(_0xdc5778){logger[_0x0c4b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5bdaa2,_0xdc5778);_0x3d815c(_0xdc5778);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 19a01d5..632d781 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 _0x02c3=['./chatWebsite.events','save','emit','removeListener','register','chatWebsite:'];(function(_0x56951d,_0x3f44d7){var _0x34b8ef=function(_0xa06d52){while(--_0xa06d52){_0x56951d['push'](_0x56951d['shift']());}};_0x34b8ef(++_0x3f44d7);}(_0x02c3,0xb4));var _0x302c=function(_0x5d5f94,_0x431a4e){_0x5d5f94=_0x5d5f94-0x0;var _0x185540=_0x02c3[_0x5d5f94];return _0x185540;};'use strict';var ChatWebsiteEvents=require(_0x302c('0x0'));var events=[_0x302c('0x1'),'remove','update'];function createListener(_0x2d1f48,_0x2f4656){return function(_0x2f53c5){_0x2f4656[_0x302c('0x2')](_0x2d1f48,_0x2f53c5);};}function removeListener(_0x377fc7,_0x62285e){return function(){ChatWebsiteEvents[_0x302c('0x3')](_0x377fc7,_0x62285e);};}exports[_0x302c('0x4')]=function(_0x44d8b9){for(var _0x74e606=0x0,_0x1db92c=events['length'];_0x74e606<_0x1db92c;_0x74e606++){var _0x330ec3=events[_0x74e606];var _0x5587d3=createListener(_0x302c('0x5')+_0x330ec3,_0x44d8b9);ChatWebsiteEvents['on'](_0x330ec3,_0x5587d3);}}; \ No newline at end of file +var _0xa0bf=['register','length','chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0xa0bf,0xdb));var _0xfa0b=function(_0x233e90,_0x3af3b6){_0x233e90=_0x233e90-0x0;var _0x31d6d7=_0xa0bf[_0x233e90];return _0x31d6d7;};'use strict';var ChatWebsiteEvents=require(_0xfa0b('0x0'));var events=[_0xfa0b('0x1'),_0xfa0b('0x2'),'update'];function createListener(_0x33e922,_0x47dcd2){return function(_0x4c39b3){_0x47dcd2[_0xfa0b('0x3')](_0x33e922,_0x4c39b3);};}function removeListener(_0x251971,_0x47ca51){return function(){ChatWebsiteEvents[_0xfa0b('0x4')](_0x251971,_0x47ca51);};}exports[_0xfa0b('0x5')]=function(_0x36693b){for(var _0x314724=0x0,_0x3f56f3=events[_0xfa0b('0x6')];_0x314724<_0x3f56f3;_0x314724++){var _0x523ef4=events[_0x314724];var _0x5a4d09=createListener(_0xfa0b('0x7')+_0x523ef4,_0x36693b);ChatWebsiteEvents['on'](_0x523ef4,_0x5a4d09);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 5814840..721c786 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 _0x28a6=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','single','addSystemAvatar','notify','server/files','attachments','offline-chat','replace','extname','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','path'];(function(_0x358eef,_0x32e338){var _0x8ed2af=function(_0x5e26c1){while(--_0x5e26c1){_0x358eef['push'](_0x358eef['shift']());}};_0x8ed2af(++_0x32e338);}(_0x28a6,0xd3));var _0x628a=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x28a6[_0x31ced5];return _0x10d9e5;};'use strict';var multer=require(_0x628a('0x0'));var util=require('util');var path=require(_0x628a('0x1'));var timeout=require(_0x628a('0x2'));var express=require('express');var router=express[_0x628a('0x3')]();var fs_extra=require(_0x628a('0x4'));var auth=require(_0x628a('0x5'));var interaction=require(_0x628a('0x6'));var config=require(_0x628a('0x7'));var controller=require('./chatWebsite.controller');router[_0x628a('0x8')]('/',auth[_0x628a('0x9')](),controller['index']);router[_0x628a('0x8')](_0x628a('0xa'),auth[_0x628a('0x9')](),controller['describe']);router[_0x628a('0x8')](_0x628a('0xb'),auth[_0x628a('0x9')](),controller[_0x628a('0xc')]);router['get']('/:id/dispositions',auth[_0x628a('0x9')](),controller[_0x628a('0xd')]);router['get'](_0x628a('0xe'),auth[_0x628a('0x9')](),controller[_0x628a('0xf')]);router[_0x628a('0x8')](_0x628a('0x10'),controller[_0x628a('0x11')]);router[_0x628a('0x8')](_0x628a('0x12'),controller['getAvatar']);router['get'](_0x628a('0x13'),controller[_0x628a('0x14')]);router[_0x628a('0x8')](_0x628a('0x15'),controller[_0x628a('0x16')]);router[_0x628a('0x8')]('/:id/interactions',auth[_0x628a('0x9')](),controller[_0x628a('0x17')]);router[_0x628a('0x8')](_0x628a('0x18'),controller[_0x628a('0x19')]);router[_0x628a('0x8')](_0x628a('0x1a'),auth[_0x628a('0x9')](),controller[_0x628a('0x1b')]);router['get'](_0x628a('0x1c'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x628a('0x8')](_0x628a('0x1d'),controller[_0x628a('0x1e')]);router['get'](_0x628a('0x1f'),auth[_0x628a('0x9')](),controller[_0x628a('0x20')]);router['get'](_0x628a('0x21'),auth[_0x628a('0x9')](),controller[_0x628a('0x22')]);router[_0x628a('0x23')]('/',auth[_0x628a('0x9')](),controller[_0x628a('0x24')]);router[_0x628a('0x23')](_0x628a('0x25'),auth[_0x628a('0x9')](),controller[_0x628a('0x26')]);router[_0x628a('0x23')]('/:id/canned_answers',auth[_0x628a('0x9')](),controller[_0x628a('0x27')]);var upload=multer({'storage':multer[_0x628a('0x28')]({'destination':function(_0x44895b,_0x5cc5b5,_0x1a963a){_0x1a963a(null,path[_0x628a('0x29')](config[_0x628a('0x2a')],_0x628a('0x2b')));},'filename':function(_0x90453e,_0x5ec9f5,_0x3eb08f){_0x3eb08f(null,util[_0x628a('0x2c')]('%s-%s',Date[_0x628a('0x2d')](),_0x5ec9f5[_0x628a('0x2e')]));}})});router['post'](_0x628a('0x10'),upload['single'](_0x628a('0x2f')),controller[_0x628a('0x30')]);var upload=multer({'storage':multer[_0x628a('0x28')]({'destination':function(_0x5c4c58,_0x1a246c,_0x251cc1){_0x251cc1(null,path[_0x628a('0x29')](config[_0x628a('0x2a')],_0x628a('0x31')));},'filename':function(_0x49c42d,_0x143258,_0xaa0f0c){_0xaa0f0c(null,util['format'](_0x628a('0x32'),Date[_0x628a('0x2d')](),_0x143258[_0x628a('0x2e')]));}})});router[_0x628a('0x23')](_0x628a('0x12'),upload['single'](_0x628a('0x2f')),controller[_0x628a('0x33')]);var upload=multer({'storage':multer[_0x628a('0x28')]({'destination':function(_0x2d5858,_0x124755,_0x3ea988){_0x3ea988(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x40587a,_0x1bca9f,_0x421dfa){_0x421dfa(null,util[_0x628a('0x2c')]('%s-%s',Date[_0x628a('0x2d')](),_0x1bca9f[_0x628a('0x2e')]));}})});router[_0x628a('0x23')](_0x628a('0x13'),upload[_0x628a('0x34')](_0x628a('0x2f')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa9222d,_0x5c5544,_0x9c90ff){_0x9c90ff(null,path['join'](config[_0x628a('0x2a')],_0x628a('0x31')));},'filename':function(_0x1d134a,_0x9ee8bc,_0x5e4a32){_0x5e4a32(null,util[_0x628a('0x2c')](_0x628a('0x32'),Date[_0x628a('0x2d')](),_0x9ee8bc[_0x628a('0x2e')]));}})});router[_0x628a('0x23')]('/:id/system_avatar',upload[_0x628a('0x34')](_0x628a('0x2f')),controller[_0x628a('0x35')]);router['post']('/:id/notify',controller[_0x628a('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x628a('0x28')]({'destination':function(_0x16d1fc,_0x406b06,_0x4c4d77){const _0x336e57=path[_0x628a('0x29')](config[_0x628a('0x2a')],_0x628a('0x37'),_0x628a('0x38'),_0x628a('0x39'));fs_extra['ensureDir'](_0x336e57,function(){_0x4c4d77(null,_0x336e57);});},'filename':function(_0xba7e13,_0x5bcf58,_0x6f33e2){const _0x123804=_0x5bcf58['originalname'][_0x628a('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2db184=path[_0x628a('0x3b')](_0x123804);const _0x164394=Date[_0x628a('0x2d')]()+'-'+_0x123804[_0x628a('0x3a')](_0x2db184,'')+_0x2db184;_0x6f33e2(null,_0x164394);}})});router['post']('/:id/offline',offlineUploadMulter[_0x628a('0x3c')](),controller[_0x628a('0x3d')]);router[_0x628a('0x23')]('/:id/interactions',auth[_0x628a('0x9')](),controller[_0x628a('0x3e')]);router[_0x628a('0x23')](_0x628a('0x1a'),auth['isAuthenticated'](),controller['addApplications']);router[_0x628a('0x23')](_0x628a('0x1c'),auth[_0x628a('0x9')](),controller[_0x628a('0x3f')]);router[_0x628a('0x23')](_0x628a('0x21'),auth[_0x628a('0x9')](),controller[_0x628a('0x40')]);router[_0x628a('0x41')](_0x628a('0xb'),auth[_0x628a('0x9')](),controller[_0x628a('0x42')]);router[_0x628a('0x43')](_0x628a('0xb'),auth[_0x628a('0x9')](),controller['destroy']);router['delete'](_0x628a('0x25'),auth[_0x628a('0x9')](),controller[_0x628a('0x44')]);router['delete'](_0x628a('0xe'),auth[_0x628a('0x9')](),controller[_0x628a('0x45')]);router[_0x628a('0x43')](_0x628a('0x21'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x628a('0x46')]=router; \ No newline at end of file +var _0xc000=['root','server/files/images/logos/','format','now','/:id/logo','file','addLogo','server/files/images/avatars/','%s-%s','originalname','/:id/avatar','addAvatar','/:id/customer_avatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','delete','removeAnswers','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join'];(function(_0x4cecc6,_0x757c68){var _0x214206=function(_0x1ce2ce){while(--_0x1ce2ce){_0x4cecc6['push'](_0x4cecc6['shift']());}};_0x214206(++_0x757c68);}(_0xc000,0xb0));var _0x0c00=function(_0x3786e9,_0xc9ed5a){_0x3786e9=_0x3786e9-0x0;var _0x2431ac=_0xc000[_0x3786e9];return _0x2431ac;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0c00('0x0'));var express=require(_0x0c00('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0c00('0x2'));var interaction=require(_0x0c00('0x3'));var config=require('../../config/environment');var controller=require(_0x0c00('0x4'));router['get']('/',auth[_0x0c00('0x5')](),controller[_0x0c00('0x6')]);router[_0x0c00('0x7')]('/describe',auth[_0x0c00('0x5')](),controller[_0x0c00('0x8')]);router['get'](_0x0c00('0x9'),auth[_0x0c00('0x5')](),controller[_0x0c00('0xa')]);router[_0x0c00('0x7')](_0x0c00('0xb'),auth['isAuthenticated'](),controller[_0x0c00('0xc')]);router[_0x0c00('0x7')](_0x0c00('0xd'),auth[_0x0c00('0x5')](),controller[_0x0c00('0xe')]);router[_0x0c00('0x7')]('/:id/logo',controller[_0x0c00('0xf')]);router[_0x0c00('0x7')]('/:id/avatar',controller[_0x0c00('0x10')]);router['get']('/:id/customer_avatar',controller[_0x0c00('0x11')]);router[_0x0c00('0x7')](_0x0c00('0x12'),controller[_0x0c00('0x13')]);router[_0x0c00('0x7')](_0x0c00('0x14'),auth[_0x0c00('0x5')](),controller[_0x0c00('0x15')]);router['get'](_0x0c00('0x16'),controller[_0x0c00('0x17')]);router[_0x0c00('0x7')](_0x0c00('0x18'),auth['isAuthenticated'](),controller[_0x0c00('0x19')]);router[_0x0c00('0x7')](_0x0c00('0x1a'),auth[_0x0c00('0x5')](),controller[_0x0c00('0x1b')]);router[_0x0c00('0x7')](_0x0c00('0x1c'),controller['getFields']);router[_0x0c00('0x7')](_0x0c00('0x1d'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x0c00('0x7')](_0x0c00('0x1e'),auth[_0x0c00('0x5')](),controller[_0x0c00('0x1f')]);router[_0x0c00('0x20')]('/',auth[_0x0c00('0x5')](),controller['create']);router[_0x0c00('0x20')](_0x0c00('0xb'),auth['isAuthenticated'](),controller[_0x0c00('0x21')]);router[_0x0c00('0x20')](_0x0c00('0xd'),auth['isAuthenticated'](),controller[_0x0c00('0x22')]);var upload=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x36c3c6,_0x24ce13,_0x2c945c){_0x2c945c(null,path[_0x0c00('0x24')](config[_0x0c00('0x25')],_0x0c00('0x26')));},'filename':function(_0x38d260,_0x46f4d8,_0x14712d){_0x14712d(null,util[_0x0c00('0x27')]('%s-%s',Date[_0x0c00('0x28')](),_0x46f4d8['originalname']));}})});router[_0x0c00('0x20')](_0x0c00('0x29'),upload['single'](_0x0c00('0x2a')),controller[_0x0c00('0x2b')]);var upload=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x1454cc,_0x2c5855,_0x51e073){_0x51e073(null,path['join'](config['root'],_0x0c00('0x2c')));},'filename':function(_0x2fa536,_0x362fa2,_0x4ac45f){_0x4ac45f(null,util[_0x0c00('0x27')](_0x0c00('0x2d'),Date[_0x0c00('0x28')](),_0x362fa2[_0x0c00('0x2e')]));}})});router[_0x0c00('0x20')](_0x0c00('0x2f'),upload['single']('file'),controller[_0x0c00('0x30')]);var upload=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x15b92e,_0x2ca71a,_0x422c2d){_0x422c2d(null,path[_0x0c00('0x24')](config[_0x0c00('0x25')],_0x0c00('0x2c')));},'filename':function(_0x40932d,_0x27e2ae,_0x281722){_0x281722(null,util[_0x0c00('0x27')](_0x0c00('0x2d'),Date[_0x0c00('0x28')](),_0x27e2ae['originalname']));}})});router['post'](_0x0c00('0x31'),upload[_0x0c00('0x32')](_0x0c00('0x2a')),controller[_0x0c00('0x33')]);var upload=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x4d5580,_0x14f8be,_0x3f613d){_0x3f613d(null,path[_0x0c00('0x24')](config[_0x0c00('0x25')],_0x0c00('0x2c')));},'filename':function(_0x477acc,_0x22ff31,_0x187c4d){_0x187c4d(null,util[_0x0c00('0x27')]('%s-%s',Date[_0x0c00('0x28')](),_0x22ff31[_0x0c00('0x2e')]));}})});router['post']('/:id/system_avatar',upload[_0x0c00('0x32')](_0x0c00('0x2a')),controller[_0x0c00('0x34')]);router[_0x0c00('0x20')](_0x0c00('0x35'),controller[_0x0c00('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x0c00('0x23')]({'destination':function(_0x44ee6a,_0x42a3ac,_0x37c2e8){const _0x3ca8bd=path[_0x0c00('0x24')](config['root'],_0x0c00('0x37'),_0x0c00('0x38'),_0x0c00('0x39'));fs_extra[_0x0c00('0x3a')](_0x3ca8bd,function(){_0x37c2e8(null,_0x3ca8bd);});},'filename':function(_0x5ea35e,_0x2fabf7,_0x2f69c7){const _0x12e668=_0x2fabf7[_0x0c00('0x2e')][_0x0c00('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x512403=path[_0x0c00('0x3c')](_0x12e668);const _0x14b6d9=Date[_0x0c00('0x28')]()+'-'+_0x12e668['replace'](_0x512403,'')+_0x512403;_0x2f69c7(null,_0x14b6d9);}})});router['post'](_0x0c00('0x3d'),offlineUploadMulter[_0x0c00('0x3e')](),controller[_0x0c00('0x3f')]);router['post'](_0x0c00('0x14'),auth[_0x0c00('0x5')](),controller[_0x0c00('0x40')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x0c00('0x41')]);router['post'](_0x0c00('0x1a'),auth[_0x0c00('0x5')](),controller['addProactiveActions']);router[_0x0c00('0x20')]('/:id/users',auth[_0x0c00('0x5')](),controller[_0x0c00('0x42')]);router[_0x0c00('0x43')]('/:id',auth[_0x0c00('0x5')](),controller['update']);router[_0x0c00('0x44')](_0x0c00('0x9'),auth[_0x0c00('0x5')](),controller['destroy']);router[_0x0c00('0x44')](_0x0c00('0xb'),auth[_0x0c00('0x5')](),controller['removeDispositions']);router[_0x0c00('0x44')](_0x0c00('0xd'),auth['isAuthenticated'](),controller[_0x0c00('0x45')]);router[_0x0c00('0x44')](_0x0c00('0x1e'),auth[_0x0c00('0x5')](),controller['removeAgents']);module[_0x0c00('0x46')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index c5171ad..42ab572 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 _0xc4d3=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated'];(function(_0x533d4d,_0x10b512){var _0x584b19=function(_0x32b525){while(--_0x32b525){_0x533d4d['push'](_0x533d4d['shift']());}};_0x584b19(++_0x10b512);}(_0xc4d3,0x1b3));var _0x3c4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4d3[_0x3dd15e];return _0x231fd0;};var beaverLogger=require(_0x3c4d('0x0'));var express=require(_0x3c4d('0x1'));var auth=require(_0x3c4d('0x2'));var config=require(_0x3c4d('0x3'));var router=express['Router']();var isProduction=config[_0x3c4d('0x4')]===_0x3c4d('0x5')||![];function clientSideLogs(_0x3dfb84,_0x502f12,_0x1b769b){var _0x38beb0=_0x3dfb84[_0x3c4d('0x6')][_0x3c4d('0x7')](_0x3c4d('0x8'));if(!_0x38beb0){throw new Error(_0x3c4d('0x9'));}return beaverLogger[_0x3c4d('0xa')]({'uri':_0x3c4d('0xb'),'logger':_0x38beb0,'enableCors':!isProduction})(_0x3dfb84,_0x502f12,_0x1b769b);}router['use'](auth[_0x3c4d('0xc')](),clientSideLogs);module[_0x3c4d('0xd')]=router; \ No newline at end of file +var _0xefb3=['express','../components/auth/service','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','beaver-logger/server'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0xefb3,0x11f));var _0x3efb=function(_0x580482,_0x31edac){_0x580482=_0x580482-0x0;var _0x2bbc06=_0xefb3[_0x580482];return _0x2bbc06;};var beaverLogger=require(_0x3efb('0x0'));var express=require(_0x3efb('0x1'));var auth=require(_0x3efb('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0xd6994e,_0x10b95f,_0x3ef879){var _0x453d2c=_0xd6994e[_0x3efb('0x3')][_0x3efb('0x4')]('client-side-logger');if(!_0x453d2c){throw new Error(_0x3efb('0x5'));}return beaverLogger[_0x3efb('0x6')]({'uri':'/client-logs','logger':_0x453d2c,'enableCors':!isProduction})(_0xd6994e,_0x10b95f,_0x3ef879);}router[_0x3efb('0x7')](auth[_0x3efb('0x8')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 4726259..987ed2b 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 _0x3879=['Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x30d1be,_0x92eeb3){var _0x26aa17=function(_0x34b038){while(--_0x34b038){_0x30d1be['push'](_0x30d1be['shift']());}};_0x26aa17(++_0x92eeb3);}(_0x3879,0xfa));var _0x9387=function(_0x33ec7e,_0x2c62ee){_0x33ec7e=_0x33ec7e-0x0;var _0x1dac17=_0x3879[_0x33ec7e];return _0x1dac17;};'use strict';var Sequelize=require(_0x9387('0x0'));module[_0x9387('0x1')]={'name':{'type':Sequelize[_0x9387('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9387('0x3')](_0x9387('0x4'),_0x9387('0x5'),_0x9387('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9387('0x3')](_0x9387('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x9387('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x9387('0x8')},'data3':{'type':Sequelize[_0x9387('0x2')],'comment':_0x9387('0x9')},'data4':{'type':Sequelize[_0x9387('0x2')],'comment':_0x9387('0xa')},'data5':{'type':Sequelize[_0x9387('0xb')],'comment':_0x9387('0xc')},'data6':{'type':Sequelize[_0x9387('0xb')],'comment':_0x9387('0xd')},'data7':{'type':Sequelize[_0x9387('0xb')],'comment':_0x9387('0xe')}}; \ No newline at end of file +var _0x44be=['Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','AmazonAWS'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x44be,0x17d));var _0xe44b=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0x44be[_0xdf3db6];return _0x4b7a65;};'use strict';var Sequelize=require('sequelize');module[_0xe44b('0x0')]={'name':{'type':Sequelize[_0xe44b('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xe44b('0x2'),_0xe44b('0x3'),_0xe44b('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe44b('0x5')](_0xe44b('0x6'),_0xe44b('0x7'))},'data1':{'type':Sequelize[_0xe44b('0x1')],'comment':_0xe44b('0x8')},'data2':{'type':Sequelize[_0xe44b('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xe44b('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xe44b('0x9')],'comment':_0xe44b('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xe44b('0x9')],'comment':_0xe44b('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index e626032..8f825b5 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 _0x1b65=['Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','Content-Range','then','destroy','sendStatus','error','stack','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Name\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error'];(function(_0x96d8bb,_0x59e193){var _0x296ef2=function(_0x1735cc){while(--_0x1735cc){_0x96d8bb['push'](_0x96d8bb['shift']());}};_0x296ef2(++_0x59e193);}(_0x1b65,0x66));var _0x51b6=function(_0x46ad9e,_0x203184){_0x46ad9e=_0x46ad9e-0x0;var _0x5727cb=_0x1b65[_0x46ad9e];return _0x5727cb;};'use strict';var _=require('lodash');var Redis=require(_0x51b6('0x0'));var qs=require(_0x51b6('0x1'));var encryptor=require(_0x51b6('0x2'));var config=require(_0x51b6('0x3'));var logger=require('../../config/logger')(_0x51b6('0x4'));var db=require(_0x51b6('0x5'))['db'];var oauth=require(_0x51b6('0x6'));config['redis']=_[_0x51b6('0x7')](config[_0x51b6('0x8')],{'host':_0x51b6('0x9'),'port':0x18eb});var socket=require(_0x51b6('0xa'))(new Redis(config[_0x51b6('0x8')]));var redis=new Redis(config[_0x51b6('0x8')]);function respondWithStatusCode(_0x450285,_0x2fad95){_0x2fad95=_0x2fad95||0xcc;return function(_0x118054){if(_0x118054){return _0x450285['sendStatus'](_0x2fad95);}return _0x450285[_0x51b6('0xb')](_0x2fad95)[_0x51b6('0xc')]();};}function respondWithResult(_0x4144ce,_0x4dd8a9){_0x4dd8a9=_0x4dd8a9||0xc8;return function(_0x2d5c35){if(_0x2d5c35){return _0x4144ce[_0x51b6('0xb')](_0x4dd8a9)[_0x51b6('0xd')](_0x2d5c35);}};}function respondWithFilteredResult(_0x35e1d0,_0x54917f){return function(_0x233556){if(_0x233556){var _0x5a448b=typeof _0x54917f[_0x51b6('0xe')]===_0x51b6('0xf')&&typeof _0x54917f[_0x51b6('0x10')]==='undefined';var _0x38ba32=_0x233556[_0x51b6('0x11')];var _0xd6eec2=_0x5a448b?0x0:_0x54917f['offset'];var _0x117cbd=_0x5a448b?_0x233556[_0x51b6('0x11')]:_0x54917f[_0x51b6('0xe')]+_0x54917f[_0x51b6('0x10')];var _0x1f7c48;if(_0x117cbd>=_0x38ba32){_0x117cbd=_0x38ba32;_0x1f7c48=0xc8;}else{_0x1f7c48=0xce;}_0x35e1d0['status'](_0x1f7c48);return _0x35e1d0['set'](_0x51b6('0x12'),_0xd6eec2+'-'+_0x117cbd+'/'+_0x38ba32)['json'](_0x233556);}return null;};}function saveUpdates(_0x3f22ec){return function(_0x5107be){if(_0x5107be){return _0x5107be['update'](_0x3f22ec)[_0x51b6('0x13')](function(_0x8461da){return _0x8461da;});}return null;};}function removeEntity(_0x322975){return function(_0x33b6ed){if(_0x33b6ed){return _0x33b6ed[_0x51b6('0x14')]()[_0x51b6('0x13')](function(){_0x322975[_0x51b6('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d0bd){return function(_0x383f8f){if(!_0x383f8f){_0x16d0bd[_0x51b6('0x15')](0x194);}return _0x383f8f;};}function handleError(_0x4e6a6d,_0x9c21c1){_0x9c21c1=_0x9c21c1||0x1f4;return function(_0x4c8616){logger[_0x51b6('0x16')](_0x4c8616[_0x51b6('0x17')]);if(_0x4c8616[_0x51b6('0x18')]){delete _0x4c8616[_0x51b6('0x18')];}_0x4e6a6d['status'](_0x9c21c1)['send'](_0x4c8616);};}function maskClientSecret(_0x316afe){return _['padEnd'](_0x316afe[_0x51b6('0x19')](0x0,0x3),0x14,'*');}exports[_0x51b6('0x1a')]=function(_0x4ad645,_0x36ad42){var _0x449352={},_0x1b9310={},_0x2e455e={'count':0x0,'rows':[]};var _0x4f96e4=_[_0x51b6('0x1b')](db[_0x51b6('0x1c')][_0x51b6('0x1d')],function(_0x3c523a){return{'name':_0x3c523a[_0x51b6('0x1e')],'type':_0x3c523a[_0x51b6('0x1f')][_0x51b6('0x20')]};});_0x1b9310[_0x51b6('0x21')]=_[_0x51b6('0x1b')](_0x4f96e4,_0x51b6('0x18'));_0x1b9310['query']=_[_0x51b6('0x22')](_0x4ad645['query']);_0x1b9310[_0x51b6('0x23')]=_[_0x51b6('0x24')](_0x1b9310[_0x51b6('0x21')],_0x1b9310['query']);_0x449352[_0x51b6('0x25')]=_[_0x51b6('0x24')](_0x1b9310[_0x51b6('0x21')],qs[_0x51b6('0x26')](_0x4ad645[_0x51b6('0x27')]['fields']));_0x449352[_0x51b6('0x25')]=_0x449352[_0x51b6('0x25')][_0x51b6('0x28')]?_0x449352[_0x51b6('0x25')]:_0x1b9310[_0x51b6('0x21')];if(!_0x4ad645[_0x51b6('0x27')][_0x51b6('0x29')](_0x51b6('0x2a'))){_0x449352[_0x51b6('0x10')]=qs[_0x51b6('0x10')](_0x4ad645[_0x51b6('0x27')][_0x51b6('0x10')]);_0x449352[_0x51b6('0xe')]=qs[_0x51b6('0xe')](_0x4ad645[_0x51b6('0x27')][_0x51b6('0xe')]);}_0x449352[_0x51b6('0x2b')]=qs[_0x51b6('0x2c')](_0x4ad645[_0x51b6('0x27')][_0x51b6('0x2c')]);_0x449352[_0x51b6('0x2d')]=qs[_0x51b6('0x23')](_[_0x51b6('0x2e')](_0x4ad645['query'],_0x1b9310[_0x51b6('0x23')]),_0x4f96e4);if(_0x4ad645[_0x51b6('0x27')][_0x51b6('0x2f')]){_0x449352['where']=_[_0x51b6('0x30')](_0x449352[_0x51b6('0x2d')],{'$or':_[_0x51b6('0x1b')](_0x4f96e4,function(_0x54f82e){if(_0x54f82e[_0x51b6('0x1f')]!==_0x51b6('0x31')){var _0x5e3424={};_0x5e3424[_0x54f82e[_0x51b6('0x18')]]={'$like':'%'+_0x4ad645[_0x51b6('0x27')]['filter']+'%'};return _0x5e3424;}})});}_0x449352=_[_0x51b6('0x30')]({},_0x449352,_0x4ad645[_0x51b6('0x32')]);var _0x10198e={'where':_0x449352[_0x51b6('0x2d')]};return db['CloudProvider'][_0x51b6('0x11')](_0x10198e)['then'](function(_0x121c06){_0x2e455e[_0x51b6('0x11')]=_0x121c06;if(_0x4ad645[_0x51b6('0x27')][_0x51b6('0x33')]){_0x449352[_0x51b6('0x34')]=[{'all':!![]}];}return db[_0x51b6('0x1c')][_0x51b6('0x35')](_0x449352);})[_0x51b6('0x13')](function(_0x4e3bef){_0x2e455e[_0x51b6('0x36')]=_['map'](_0x4e3bef,function(_0x2de5ca){if(_0x2de5ca[_0x51b6('0x37')]===_0x51b6('0x38')){var _0xd177b8=encryptor[_0x51b6('0x39')](_0x2de5ca[_0x51b6('0x3a')]);_0x2de5ca[_0x51b6('0x3a')]=maskClientSecret(_0xd177b8);}return _0x2de5ca;});return _0x2e455e;})[_0x51b6('0x13')](respondWithFilteredResult(_0x36ad42,_0x449352))[_0x51b6('0x3b')](handleError(_0x36ad42,null));};exports[_0x51b6('0x3c')]=function(_0x3a3837,_0x416dcf){var _0x30c7ca={'raw':!![],'where':{'id':_0x3a3837[_0x51b6('0x3d')]['id']}},_0x4d22ef={};_0x4d22ef[_0x51b6('0x21')]=_[_0x51b6('0x22')](db['CloudProvider']['rawAttributes']);_0x4d22ef[_0x51b6('0x27')]=_[_0x51b6('0x22')](_0x3a3837['query']);_0x4d22ef[_0x51b6('0x23')]=_[_0x51b6('0x24')](_0x4d22ef[_0x51b6('0x21')],_0x4d22ef[_0x51b6('0x27')]);_0x30c7ca[_0x51b6('0x25')]=_[_0x51b6('0x24')](_0x4d22ef[_0x51b6('0x21')],qs[_0x51b6('0x26')](_0x3a3837[_0x51b6('0x27')][_0x51b6('0x26')]));_0x30c7ca[_0x51b6('0x25')]=_0x30c7ca['attributes'][_0x51b6('0x28')]?_0x30c7ca[_0x51b6('0x25')]:_0x4d22ef[_0x51b6('0x21')];if(_0x3a3837['query'][_0x51b6('0x33')]){_0x30c7ca['include']=[{'all':!![]}];}_0x30c7ca=_['merge']({},_0x30c7ca,_0x3a3837['options']);return db['CloudProvider'][_0x51b6('0x3e')](_0x30c7ca)[_0x51b6('0x13')](handleEntityNotFound(_0x416dcf,null))[_0x51b6('0x13')](function(_0x9b1236){if(_0x9b1236['service']===_0x51b6('0x38')){var _0x460206=encryptor[_0x51b6('0x39')](_0x9b1236['data3']);_0x9b1236[_0x51b6('0x3a')]=maskClientSecret(_0x460206);}return _0x9b1236;})[_0x51b6('0x13')](respondWithResult(_0x416dcf,null))[_0x51b6('0x3b')](handleError(_0x416dcf,null));};exports[_0x51b6('0x3f')]=function(_0xbd2775,_0x38ec68){if(!_0xbd2775[_0x51b6('0x40')][_0x51b6('0x18')])throw new Error(_0x51b6('0x41'));if(!_0xbd2775[_0x51b6('0x40')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4c35ec=db[_0x51b6('0x1c')][_0x51b6('0x1d')][_0x51b6('0x37')][_0x51b6('0x42')];if(!_0x4c35ec['includes'](_0xbd2775[_0x51b6('0x40')][_0x51b6('0x37')]))throw new Error(_0x51b6('0x43')+_0x4c35ec[_0x51b6('0x44')](',\x20'));if(_0xbd2775[_0x51b6('0x40')][_0x51b6('0x37')]===_0x51b6('0x38')&&_0xbd2775[_0x51b6('0x40')][_0x51b6('0x3a')]){_0xbd2775[_0x51b6('0x40')][_0x51b6('0x3a')]=encryptor[_0x51b6('0x45')](_0xbd2775[_0x51b6('0x40')][_0x51b6('0x3a')]);}return db[_0x51b6('0x1c')]['create'](_0xbd2775['body'],{})[_0x51b6('0x13')](respondWithResult(_0x38ec68,0xc9))['catch'](handleError(_0x38ec68,null));};exports[_0x51b6('0x46')]=function(_0x21d4ad,_0x35d9bf){if(_0x21d4ad[_0x51b6('0x40')]['id']){delete _0x21d4ad[_0x51b6('0x40')]['id'];}return db[_0x51b6('0x1c')]['find']({'where':{'id':_0x21d4ad['params']['id']}})['then'](handleEntityNotFound(_0x35d9bf,null))['then'](function(_0x50cce1){if(_0x50cce1['service']===_0x51b6('0x38')&&_0x21d4ad[_0x51b6('0x40')][_0x51b6('0x3a')]){_0x21d4ad[_0x51b6('0x40')][_0x51b6('0x3a')]=encryptor[_0x51b6('0x45')](_0x21d4ad[_0x51b6('0x40')]['data3']);}return _0x50cce1;})[_0x51b6('0x13')](saveUpdates(_0x21d4ad['body'],null))[_0x51b6('0x13')](respondWithResult(_0x35d9bf,null))[_0x51b6('0x3b')](handleError(_0x35d9bf,null));};exports['destroy']=function(_0x58e5c9,_0x9f5e18){return db['CloudProvider'][_0x51b6('0x3e')]({'where':{'id':_0x58e5c9['params']['id']}})[_0x51b6('0x13')](handleEntityNotFound(_0x9f5e18,null))[_0x51b6('0x13')](removeEntity(_0x9f5e18,null))['catch'](handleError(_0x9f5e18,null));};exports[_0x51b6('0x47')]=function(_0xba466a,_0x94cffa){return db[_0x51b6('0x1c')][_0x51b6('0x48')]({'where':{'id':_0xba466a['params']['id']},'raw':!![]})[_0x51b6('0x13')](function(_0x3715bf){if(!_0x3715bf)return _0x94cffa[_0x51b6('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3715bf,_0xba466a[_0x51b6('0x49')]['id'])};})['then'](respondWithResult(_0x94cffa,null))[_0x51b6('0x3b')](handleError(_0x94cffa,null));};exports[_0x51b6('0x4a')]=function(_0x5f4dbb,_0x45bfe9){var _0x5e22e4=_0x5f4dbb[_0x51b6('0x40')];var _0xcdfa57;var _0x47075b;if(_0x5e22e4[_0x51b6('0x16')])throw _0x5e22e4;redis['get'](_0x5e22e4[_0x51b6('0x4b')])[_0x51b6('0x13')](function(_0x383af2){if(!_0x383af2)throw new Error(_0x51b6('0x4c'));_0xcdfa57=JSON[_0x51b6('0x4d')](_0x383af2);var _0x29eb97=Buffer[_0x51b6('0x4e')](_0x5e22e4[_0x51b6('0x4b')],_0x51b6('0x4f'))[_0x51b6('0x50')](_0x51b6('0x51'));_0x47075b=JSON['parse'](_0x29eb97);if(!oauth[_0x51b6('0x52')](_0x5e22e4[_0x51b6('0x53')],_0xcdfa57[_0x51b6('0x54')]))throw new Error(_0x51b6('0x55'));redis[_0x51b6('0x56')](_0x5e22e4['state']);return oauth[_0x51b6('0x57')](_0x5e22e4[_0x51b6('0x58')],_0xcdfa57);})[_0x51b6('0x13')](function(_0x548ada){_0xcdfa57[_0x51b6('0x59')]=_0x548ada['access_token'];_0xcdfa57[_0x51b6('0x5a')]=_0x548ada[_0x51b6('0x5b')];return db['CloudProvider'][_0x51b6('0x46')]({'data5':_0xcdfa57[_0x51b6('0x59')],'data6':_0xcdfa57['data6']},{'where':{'id':_0xcdfa57['id']}});})['then'](function(){oauth[_0x51b6('0x5c')](_0xcdfa57);socket[_0x51b6('0x5d')](_0x51b6('0x5e'),{'id':_0x47075b['id']});return;})[_0x51b6('0x13')](respondWithStatusCode(_0x45bfe9,null))[_0x51b6('0x3b')](function(_0x5456ea){if(_0x47075b){socket[_0x51b6('0x5d')](_0x51b6('0x5f'),{'id':_0x47075b['id']});}if(!_0xcdfa57){logger[_0x51b6('0x16')](_0x51b6('0x60'),_0x5456ea);return _0x45bfe9[_0x51b6('0xb')](0x1f4)['send'](_0x5456ea[_0x51b6('0x61')]);}logger[_0x51b6('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0xcdfa57['id'],JSON[_0x51b6('0x62')](_0x5456ea));});}; \ No newline at end of file +var _0xf38c=['microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','set','update','then','destroy','stack','name','slice','index','CloudProvider','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','merge','options','where','count','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','access_token','data6','refresh_token','data5','startRefreshInterval','emit'];(function(_0x4c67b8,_0x571e13){var _0xbc26e=function(_0x16e9ac){while(--_0x16e9ac){_0x4c67b8['push'](_0x4c67b8['shift']());}};_0xbc26e(++_0x571e13);}(_0xf38c,0x185));var _0xcf38=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf38c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var Redis=require(_0xcf38('0x0'));var qs=require(_0xcf38('0x1'));var encryptor=require(_0xcf38('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xcf38('0x3'));var db=require(_0xcf38('0x4'))['db'];var oauth=require(_0xcf38('0x5'));config[_0xcf38('0x6')]=_[_0xcf38('0x7')](config[_0xcf38('0x6')],{'host':_0xcf38('0x8'),'port':0x18eb});var socket=require(_0xcf38('0x9'))(new Redis(config[_0xcf38('0x6')]));var redis=new Redis(config[_0xcf38('0x6')]);function respondWithStatusCode(_0x26b374,_0x5f2f82){_0x5f2f82=_0x5f2f82||0xcc;return function(_0x184a64){if(_0x184a64){return _0x26b374[_0xcf38('0xa')](_0x5f2f82);}return _0x26b374[_0xcf38('0xb')](_0x5f2f82)[_0xcf38('0xc')]();};}function respondWithResult(_0xced83c,_0x26b32f){_0x26b32f=_0x26b32f||0xc8;return function(_0x57d22d){if(_0x57d22d){return _0xced83c['status'](_0x26b32f)[_0xcf38('0xd')](_0x57d22d);}};}function respondWithFilteredResult(_0x22e33d,_0x13858a){return function(_0x5992dd){if(_0x5992dd){var _0x32e304=typeof _0x13858a[_0xcf38('0xe')]===_0xcf38('0xf')&&typeof _0x13858a[_0xcf38('0x10')]===_0xcf38('0xf');var _0x5698f9=_0x5992dd['count'];var _0x28417d=_0x32e304?0x0:_0x13858a[_0xcf38('0xe')];var _0x4cac3b=_0x32e304?_0x5992dd['count']:_0x13858a[_0xcf38('0xe')]+_0x13858a['limit'];var _0x3e4e0d;if(_0x4cac3b>=_0x5698f9){_0x4cac3b=_0x5698f9;_0x3e4e0d=0xc8;}else{_0x3e4e0d=0xce;}_0x22e33d[_0xcf38('0xb')](_0x3e4e0d);return _0x22e33d[_0xcf38('0x11')]('Content-Range',_0x28417d+'-'+_0x4cac3b+'/'+_0x5698f9)[_0xcf38('0xd')](_0x5992dd);}return null;};}function saveUpdates(_0x20a251){return function(_0x3056d4){if(_0x3056d4){return _0x3056d4[_0xcf38('0x12')](_0x20a251)[_0xcf38('0x13')](function(_0x58c571){return _0x58c571;});}return null;};}function removeEntity(_0x39ad93){return function(_0x291a2c){if(_0x291a2c){return _0x291a2c[_0xcf38('0x14')]()['then'](function(){_0x39ad93[_0xcf38('0xb')](0xcc)[_0xcf38('0xc')]();});}};}function handleEntityNotFound(_0x20eb29){return function(_0x90c41d){if(!_0x90c41d){_0x20eb29[_0xcf38('0xa')](0x194);}return _0x90c41d;};}function handleError(_0x284b24,_0x926835){_0x926835=_0x926835||0x1f4;return function(_0x33d55f){logger['error'](_0x33d55f[_0xcf38('0x15')]);if(_0x33d55f[_0xcf38('0x16')]){delete _0x33d55f[_0xcf38('0x16')];}_0x284b24[_0xcf38('0xb')](_0x926835)['send'](_0x33d55f);};}function maskClientSecret(_0x543cb9){return _['padEnd'](_0x543cb9[_0xcf38('0x17')](0x0,0x3),0x14,'*');}exports[_0xcf38('0x18')]=function(_0x4059ad,_0x3dccc9){var _0x1835ff={},_0x5ad9bb={},_0x491923={'count':0x0,'rows':[]};var _0x2a677c=_['map'](db[_0xcf38('0x19')]['rawAttributes'],function(_0x375f70){return{'name':_0x375f70[_0xcf38('0x1a')],'type':_0x375f70[_0xcf38('0x1b')]['key']};});_0x5ad9bb['model']=_[_0xcf38('0x1c')](_0x2a677c,_0xcf38('0x16'));_0x5ad9bb[_0xcf38('0x1d')]=_[_0xcf38('0x1e')](_0x4059ad[_0xcf38('0x1d')]);_0x5ad9bb[_0xcf38('0x1f')]=_['intersection'](_0x5ad9bb[_0xcf38('0x20')],_0x5ad9bb[_0xcf38('0x1d')]);_0x1835ff[_0xcf38('0x21')]=_[_0xcf38('0x22')](_0x5ad9bb[_0xcf38('0x20')],qs[_0xcf38('0x23')](_0x4059ad[_0xcf38('0x1d')][_0xcf38('0x23')]));_0x1835ff[_0xcf38('0x21')]=_0x1835ff[_0xcf38('0x21')][_0xcf38('0x24')]?_0x1835ff[_0xcf38('0x21')]:_0x5ad9bb[_0xcf38('0x20')];if(!_0x4059ad[_0xcf38('0x1d')][_0xcf38('0x25')](_0xcf38('0x26'))){_0x1835ff[_0xcf38('0x10')]=qs['limit'](_0x4059ad[_0xcf38('0x1d')]['limit']);_0x1835ff[_0xcf38('0xe')]=qs['offset'](_0x4059ad[_0xcf38('0x1d')]['offset']);}_0x1835ff[_0xcf38('0x27')]=qs[_0xcf38('0x28')](_0x4059ad[_0xcf38('0x1d')][_0xcf38('0x28')]);_0x1835ff['where']=qs[_0xcf38('0x1f')](_[_0xcf38('0x29')](_0x4059ad[_0xcf38('0x1d')],_0x5ad9bb[_0xcf38('0x1f')]),_0x2a677c);if(_0x4059ad[_0xcf38('0x1d')]['filter']){_0x1835ff['where']=_['merge'](_0x1835ff['where'],{'$or':_['map'](_0x2a677c,function(_0x3d490f){if(_0x3d490f['type']!==_0xcf38('0x2a')){var _0x86672={};_0x86672[_0x3d490f['name']]={'$like':'%'+_0x4059ad[_0xcf38('0x1d')][_0xcf38('0x2b')]+'%'};return _0x86672;}})});}_0x1835ff=_[_0xcf38('0x2c')]({},_0x1835ff,_0x4059ad[_0xcf38('0x2d')]);var _0x7f7c47={'where':_0x1835ff[_0xcf38('0x2e')]};return db['CloudProvider'][_0xcf38('0x2f')](_0x7f7c47)[_0xcf38('0x13')](function(_0x40ae1a){_0x491923['count']=_0x40ae1a;if(_0x4059ad['query'][_0xcf38('0x30')]){_0x1835ff[_0xcf38('0x31')]=[{'all':!![]}];}return db[_0xcf38('0x19')][_0xcf38('0x32')](_0x1835ff);})['then'](function(_0x33d90e){_0x491923[_0xcf38('0x33')]=_[_0xcf38('0x1c')](_0x33d90e,function(_0x554d4e){if(_0x554d4e[_0xcf38('0x34')]===_0xcf38('0x35')){var _0x81dea1=encryptor[_0xcf38('0x36')](_0x554d4e[_0xcf38('0x37')]);_0x554d4e[_0xcf38('0x37')]=maskClientSecret(_0x81dea1);}return _0x554d4e;});return _0x491923;})[_0xcf38('0x13')](respondWithFilteredResult(_0x3dccc9,_0x1835ff))[_0xcf38('0x38')](handleError(_0x3dccc9,null));};exports[_0xcf38('0x39')]=function(_0x44bcab,_0x36207e){var _0x457a1d={'raw':!![],'where':{'id':_0x44bcab[_0xcf38('0x3a')]['id']}},_0x1bec91={};_0x1bec91['model']=_[_0xcf38('0x1e')](db[_0xcf38('0x19')][_0xcf38('0x3b')]);_0x1bec91[_0xcf38('0x1d')]=_[_0xcf38('0x1e')](_0x44bcab['query']);_0x1bec91[_0xcf38('0x1f')]=_[_0xcf38('0x22')](_0x1bec91[_0xcf38('0x20')],_0x1bec91[_0xcf38('0x1d')]);_0x457a1d[_0xcf38('0x21')]=_[_0xcf38('0x22')](_0x1bec91[_0xcf38('0x20')],qs[_0xcf38('0x23')](_0x44bcab[_0xcf38('0x1d')]['fields']));_0x457a1d[_0xcf38('0x21')]=_0x457a1d['attributes']['length']?_0x457a1d[_0xcf38('0x21')]:_0x1bec91['model'];if(_0x44bcab[_0xcf38('0x1d')][_0xcf38('0x30')]){_0x457a1d[_0xcf38('0x31')]=[{'all':!![]}];}_0x457a1d=_[_0xcf38('0x2c')]({},_0x457a1d,_0x44bcab[_0xcf38('0x2d')]);return db[_0xcf38('0x19')][_0xcf38('0x3c')](_0x457a1d)[_0xcf38('0x13')](handleEntityNotFound(_0x36207e,null))[_0xcf38('0x13')](function(_0xda174a){if(_0xda174a[_0xcf38('0x34')]===_0xcf38('0x35')){var _0x41dec3=encryptor[_0xcf38('0x36')](_0xda174a[_0xcf38('0x37')]);_0xda174a[_0xcf38('0x37')]=maskClientSecret(_0x41dec3);}return _0xda174a;})['then'](respondWithResult(_0x36207e,null))[_0xcf38('0x38')](handleError(_0x36207e,null));};exports[_0xcf38('0x3d')]=function(_0x1ffc55,_0x9702b2){if(!_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x16')])throw new Error(_0xcf38('0x3f'));if(!_0x1ffc55['body'][_0xcf38('0x34')])throw new Error(_0xcf38('0x40'));var _0x3dcb88=db['CloudProvider'][_0xcf38('0x3b')][_0xcf38('0x34')][_0xcf38('0x41')];if(!_0x3dcb88['includes'](_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x34')]))throw new Error(_0xcf38('0x42')+_0x3dcb88['join'](',\x20'));if(_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x34')]===_0xcf38('0x35')&&_0x1ffc55['body']['data3']){_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x37')]=encryptor[_0xcf38('0x43')](_0x1ffc55[_0xcf38('0x3e')][_0xcf38('0x37')]);}return db['CloudProvider'][_0xcf38('0x3d')](_0x1ffc55[_0xcf38('0x3e')],{})[_0xcf38('0x13')](respondWithResult(_0x9702b2,0xc9))[_0xcf38('0x38')](handleError(_0x9702b2,null));};exports[_0xcf38('0x12')]=function(_0x59b515,_0x48a26d){if(_0x59b515[_0xcf38('0x3e')]['id']){delete _0x59b515[_0xcf38('0x3e')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x59b515['params']['id']}})[_0xcf38('0x13')](handleEntityNotFound(_0x48a26d,null))[_0xcf38('0x13')](function(_0x26579b){if(_0x26579b[_0xcf38('0x34')]===_0xcf38('0x35')&&_0x59b515[_0xcf38('0x3e')][_0xcf38('0x37')]){_0x59b515['body']['data3']=encryptor[_0xcf38('0x43')](_0x59b515['body']['data3']);}return _0x26579b;})[_0xcf38('0x13')](saveUpdates(_0x59b515[_0xcf38('0x3e')],null))[_0xcf38('0x13')](respondWithResult(_0x48a26d,null))['catch'](handleError(_0x48a26d,null));};exports[_0xcf38('0x14')]=function(_0x72f78e,_0x2e0cb5){return db[_0xcf38('0x19')][_0xcf38('0x3c')]({'where':{'id':_0x72f78e['params']['id']}})['then'](handleEntityNotFound(_0x2e0cb5,null))[_0xcf38('0x13')](removeEntity(_0x2e0cb5,null))[_0xcf38('0x38')](handleError(_0x2e0cb5,null));};exports[_0xcf38('0x44')]=function(_0xf2108e,_0x127487){return db[_0xcf38('0x19')][_0xcf38('0x45')]({'where':{'id':_0xf2108e[_0xcf38('0x3a')]['id']},'raw':!![]})[_0xcf38('0x13')](function(_0x16a9e5){if(!_0x16a9e5)return _0x127487[_0xcf38('0xa')](0x194);return{'url':oauth[_0xcf38('0x46')](_0x16a9e5,_0xf2108e[_0xcf38('0x47')]['id'])};})[_0xcf38('0x13')](respondWithResult(_0x127487,null))[_0xcf38('0x38')](handleError(_0x127487,null));};exports['oauth2MicrosoftCallback']=function(_0x7a94af,_0x56961b){var _0x2e05a4=_0x7a94af[_0xcf38('0x3e')];var _0x778892;var _0x417379;if(_0x2e05a4[_0xcf38('0x48')])throw _0x2e05a4;redis[_0xcf38('0x49')](_0x2e05a4[_0xcf38('0x4a')])[_0xcf38('0x13')](function(_0xf14e7a){if(!_0xf14e7a)throw new Error(_0xcf38('0x4b'));_0x778892=JSON[_0xcf38('0x4c')](_0xf14e7a);var _0x4c0100=Buffer[_0xcf38('0x4d')](_0x2e05a4[_0xcf38('0x4a')],'base64')[_0xcf38('0x4e')](_0xcf38('0x4f'));_0x417379=JSON[_0xcf38('0x4c')](_0x4c0100);if(!oauth[_0xcf38('0x50')](_0x2e05a4['id_token'],_0x778892[_0xcf38('0x51')]))throw new Error(_0xcf38('0x52'));redis[_0xcf38('0x53')](_0x2e05a4[_0xcf38('0x4a')]);return oauth[_0xcf38('0x54')](_0x2e05a4['code'],_0x778892);})['then'](function(_0xec4941){_0x778892['data5']=_0xec4941[_0xcf38('0x55')];_0x778892[_0xcf38('0x56')]=_0xec4941[_0xcf38('0x57')];return db[_0xcf38('0x19')]['update']({'data5':_0x778892[_0xcf38('0x58')],'data6':_0x778892[_0xcf38('0x56')]},{'where':{'id':_0x778892['id']}});})[_0xcf38('0x13')](function(){oauth[_0xcf38('0x59')](_0x778892);socket[_0xcf38('0x5a')](_0xcf38('0x5b'),{'id':_0x417379['id']});return;})[_0xcf38('0x13')](respondWithStatusCode(_0x56961b,null))['catch'](function(_0x5c361c){if(_0x417379){socket['emit'](_0xcf38('0x5c'),{'id':_0x417379['id']});}if(!_0x778892){logger[_0xcf38('0x48')](_0xcf38('0x5d'),_0x5c361c);return _0x56961b[_0xcf38('0xb')](0x1f4)['send'](_0x5c361c['message']);}logger[_0xcf38('0x48')](_0xcf38('0x5e'),_0x778892['id'],JSON[_0xcf38('0x5f')](_0x5c361c));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 4d2b4cd..e392ed7 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 _0x00ad=['moment','bluebird','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api'];(function(_0x55eb57,_0x1011e2){var _0x55ca29=function(_0xad5a1d){while(--_0xad5a1d){_0x55eb57['push'](_0x55eb57['shift']());}};_0x55ca29(++_0x1011e2);}(_0x00ad,0x105));var _0xd00a=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00ad[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xd00a('0x0'));var util=require(_0xd00a('0x1'));var logger=require('../../config/logger')(_0xd00a('0x2'));var moment=require(_0xd00a('0x3'));var BPromise=require(_0xd00a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd00a('0x5'));var config=require(_0xd00a('0x6'));var attributes=require(_0xd00a('0x7'));module[_0xd00a('0x8')]=function(_0x5a18ed,_0x238601){return _0x5a18ed[_0xd00a('0x9')](_0xd00a('0xa'),attributes,{'tableName':_0xd00a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb50f=['moment','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x2e5636,_0x2b9540){var _0x4d7371=function(_0x28e14c){while(--_0x28e14c){_0x2e5636['push'](_0x2e5636['shift']());}};_0x4d7371(++_0x2b9540);}(_0xb50f,0xe6));var _0xfb50=function(_0xd40536,_0xd6f24){_0xd40536=_0xd40536-0x0;var _0x4ac571=_0xb50f[_0xd40536];return _0x4ac571;};'use strict';var _=require(_0xfb50('0x0'));var util=require(_0xfb50('0x1'));var logger=require(_0xfb50('0x2'))(_0xfb50('0x3'));var moment=require(_0xfb50('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb50('0x5'));var fs=require('fs');var path=require(_0xfb50('0x6'));var rimraf=require('rimraf');var config=require(_0xfb50('0x7'));var attributes=require(_0xfb50('0x8'));module[_0xfb50('0x9')]=function(_0xb0dbb6,_0xab2fa5){return _0xb0dbb6[_0xfb50('0xa')](_0xfb50('0xb'),attributes,{'tableName':_0xfb50('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 23d6a2f..5e6d10f 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 _0x5367=['../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','offline_access','/authorize','map','type','Dynamics365','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','randomBytes','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','refresh_token','data6','decryptString','POST','data5','access_token','CloudProvider','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','util','../../components/encryptor','../../config/environment','api'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x5367,0xe0));var _0x7536=function(_0x4d1bee,_0xc46ad5){_0x4d1bee=_0x4d1bee-0x0;var _0x262dfc=_0x5367[_0x4d1bee];return _0x262dfc;};'use strict';var _=require(_0x7536('0x0'));var crypto=require(_0x7536('0x1'));var jwt=require(_0x7536('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x7536('0x3'));var encryptor=require(_0x7536('0x4'));var config=require(_0x7536('0x5'));var logger=require('../../config/logger')(_0x7536('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x7536('0x7'))['db'];config[_0x7536('0x8')]=_[_0x7536('0x9')](config[_0x7536('0x8')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x7536('0x8')]);var MICROSOFT_AUTH_URL=_0x7536('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7536('0xb'),_0x7536('0xc'),_0x7536('0xd'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x7536('0xe'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid',_0x7536('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x7536('0x10');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x140c4a){var _0x455863=_[_0x7536('0x11')](AZURE_AUTH_SCOPES[_0x140c4a[_0x7536('0x12')]]);if(_0x140c4a['type']===_0x7536('0x13'))_0x455863['push'](_0x140c4a[_0x7536('0x14')]+_0x7536('0x15'));return _0x455863[_0x7536('0x16')]('\x20');}function getAccessTokenScope(_0x5ab38d){if(_0x5ab38d[_0x7536('0x12')]===_0x7536('0x17'))return _0x7536('0x18');if(_0x5ab38d[_0x7536('0x12')]===_0x7536('0x13'))return _0x5ab38d[_0x7536('0x14')]+_0x7536('0x15');}function generateMicrosoftAuthorizationUrl(_0x18a3fe,_0x3880cd){var _0x18b2b6=MICROSOFT_AUTH_URL[_0x7536('0x19')](_0x7536('0x1a'),_0x18a3fe[_0x7536('0x1b')]);var _0x360159=[_0x7536('0x1c'),_0x7536('0x1d')];var _0x178111=Buffer['from'](JSON[_0x7536('0x1e')]({'id':_0x3880cd}))[_0x7536('0x1f')](_0x7536('0x20'));var _0xf74e14=crypto[_0x7536('0x21')](0x10)[_0x7536('0x1f')]('hex');var _0x4953fd=getAuthorizationScopes(_0x18a3fe);var _0x5857df=[{'key':'client_id','value':_0x18a3fe[_0x7536('0x22')]},{'key':_0x7536('0x23'),'value':encodeURIComponent(_0x360159[_0x7536('0x16')]('\x20'))},{'key':_0x7536('0x24'),'value':_0x18a3fe[_0x7536('0x25')]},{'key':_0x7536('0x26'),'value':_0x7536('0x27')},{'key':_0x7536('0x28'),'value':encodeURIComponent(_0x4953fd)},{'key':_0x7536('0x29'),'value':_0x178111},{'key':_0x7536('0x2a'),'value':_0xf74e14},{'key':_0x7536('0x2b'),'value':_0x7536('0x2c')}];var _0x267108=_0x18b2b6+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x5857df,function(_0x45f87d){return _0x45f87d[_0x7536('0x2d')]+'='+_0x45f87d[_0x7536('0x2e')];})['join']('&');_0x18a3fe[_0x7536('0x2f')]={'issuer':_0x18b2b6['replace'](_0x7536('0x30'),''),'audience':_0x18a3fe[_0x7536('0x22')],'state':_0x178111,'nonce':_0xf74e14};redis[_0x7536('0x31')](_0x178111,JSON['stringify'](_0x18a3fe));return _0x267108;}function isValidIdToken(_0x576f6e,_0x2e0d33){try{var _0x4677e5=jwt['decode'](_0x576f6e,{'complete':!![]});var _0x4981a2=_0x4677e5[_0x7536('0x32')];if(_0x4981a2['iss']!==_0x2e0d33[_0x7536('0x33')])return![];if(_0x4981a2[_0x7536('0x34')]!==_0x2e0d33[_0x7536('0x35')])return![];if(_0x4981a2[_0x7536('0x2a')]!==_0x2e0d33[_0x7536('0x2a')])return![];if(moment()[_0x7536('0x36')](moment[_0x7536('0x37')](_0x4981a2[_0x7536('0x38')])))return![];return!![];}catch(_0x2c9640){throw _0x2c9640;}}function refreshOauth2MicrosoftAccessToken(_0x4f9315){return Promise[_0x7536('0x39')]()[_0x7536('0x3a')](function(){if(_0x4f9315[_0x7536('0x3b')])return _0x4f9315;return db['CloudProvider']['findOne']({'where':{'id':_0x4f9315['id']},'raw':!![]});})[_0x7536('0x3a')](function(_0x42e4ae){var _0x33093b={'grant_type':_0x7536('0x3c'),'refresh_token':_0x42e4ae[_0x7536('0x3d')],'scope':getAccessTokenScope(_0x42e4ae),'redirect_uri':_0x42e4ae[_0x7536('0x25')],'client_id':_0x42e4ae[_0x7536('0x22')],'client_secret':encryptor[_0x7536('0x3e')](_0x42e4ae[_0x7536('0x3b')])};var _0xe91d57={'method':_0x7536('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x7536('0x19')](_0x7536('0x1a'),_0x42e4ae[_0x7536('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x33093b,'json':!![]};return rp(_0xe91d57);})['then'](function(_0x536158){_0x4f9315[_0x7536('0x40')]=_0x536158[_0x7536('0x41')];_0x4f9315[_0x7536('0x3d')]=_0x536158[_0x7536('0x3c')];return db[_0x7536('0x42')]['update']({'data5':_0x4f9315[_0x7536('0x40')],'data6':_0x4f9315['data6']},{'where':{'id':_0x4f9315['id']}});})[_0x7536('0x3a')](function(){return _0x4f9315;})[_0x7536('0x43')](function(_0x31c22d){logger[_0x7536('0x44')](_0x7536('0x45'),_0x4f9315['id'],_0x31c22d);});}function getOauth2MicrosoftAccessToken(_0x3b17c0,_0x225d06){var _0x586ccb={'grant_type':_0x7536('0x46'),'code':_0x3b17c0,'scope':getAccessTokenScope(_0x225d06),'redirect_uri':_0x225d06[_0x7536('0x25')],'client_id':_0x225d06[_0x7536('0x22')],'client_secret':encryptor['decryptString'](_0x225d06['data3'])};var _0x418751={'method':_0x7536('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x7536('0x19')](_0x7536('0x1a'),_0x225d06[_0x7536('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x586ccb,'json':!![]};return rp(_0x418751);}function startRefreshInterval(_0x46de05){var _0xdb399c=schedule[_0x7536('0x47')];if(_0xdb399c[_0x46de05['id']])clearInterval(_0xdb399c[_0x46de05['id']]);_0xdb399c[_0x46de05['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7536('0x48')](this,{'id':_0x46de05['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7536('0x47')]=_0xdb399c;}function startAllRefreshIntervals(){return db[_0x7536('0x42')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7536('0x3a')](function(_0x211c4a){var _0x38a128=_0x211c4a[_0x7536('0x11')](function(_0x31c822){return refreshOauth2MicrosoftAccessToken(_0x31c822)['then'](function(_0x5827c2){startRefreshInterval(_0x5827c2);});});return Promise[_0x7536('0x49')](_0x38a128);})[_0x7536('0x43')](function(_0x319d34){var _0x2e80b1=_0x319d34?util[_0x7536('0x4a')](_0x319d34,{'showHidden':![],'depth':null}):'';logger['error'](_0x7536('0x4b'),_0x2e80b1);});}module[_0x7536('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x7500=['oauth2Claims','oauth2/','set','decode','payload','iss','audience','isAfter','unix','CloudProvider','findOne','then','refresh_token','data6','decryptString','data3','POST','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','map','type','push','data7','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','data1','response_type','data4','response_mode','scope','state','nonce','prompt','key','value'];(function(_0x25eb70,_0x13e0a4){var _0x28d574=function(_0x39d05b){while(--_0x39d05b){_0x25eb70['push'](_0x25eb70['shift']());}};_0x28d574(++_0x13e0a4);}(_0x7500,0x156));var _0x0750=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7500[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x0750('0x0'));var crypto=require(_0x0750('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x0750('0x2'));var Redis=require('ioredis');var rp=require(_0x0750('0x3'));var util=require(_0x0750('0x4'));var encryptor=require(_0x0750('0x5'));var config=require(_0x0750('0x6'));var logger=require(_0x0750('0x7'))('api');var schedule=require(_0x0750('0x8'));var db=require(_0x0750('0x9'))['db'];config[_0x0750('0xa')]=_[_0x0750('0xb')](config[_0x0750('0xa')],{'host':_0x0750('0xc'),'port':0x18eb});var redis=new Redis(config[_0x0750('0xa')]);var MICROSOFT_AUTH_URL=_0x0750('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x0750('0xe'),_0x0750('0xf'),_0x0750('0x10'),'offline_access',_0x0750('0x11'),_0x0750('0x12'),_0x0750('0x13')],'Dynamics365':[_0x0750('0xe'),_0x0750('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0x0750('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x32cf29){var _0xd0c51=_[_0x0750('0x16')](AZURE_AUTH_SCOPES[_0x32cf29[_0x0750('0x17')]]);if(_0x32cf29[_0x0750('0x17')]==='Dynamics365')_0xd0c51[_0x0750('0x18')](_0x32cf29[_0x0750('0x19')]+'/.default');return _0xd0c51[_0x0750('0x1a')]('\x20');}function getAccessTokenScope(_0x1032a4){if(_0x1032a4[_0x0750('0x17')]===_0x0750('0x1b'))return _0x0750('0x11');if(_0x1032a4[_0x0750('0x17')]==='Dynamics365')return _0x1032a4[_0x0750('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x5f0599,_0x420c18){var _0x530f9b=MICROSOFT_AUTH_URL[_0x0750('0x1c')](_0x0750('0x1d'),_0x5f0599[_0x0750('0x1e')]);var _0x57fd6b=[_0x0750('0x1f'),_0x0750('0x20')];var _0x5b5650=Buffer[_0x0750('0x21')](JSON[_0x0750('0x22')]({'id':_0x420c18}))[_0x0750('0x23')]('base64');var _0x5b8307=crypto[_0x0750('0x24')](0x10)['toString'](_0x0750('0x25'));var _0x50f22f=getAuthorizationScopes(_0x5f0599);var _0x32d202=[{'key':'client_id','value':_0x5f0599[_0x0750('0x26')]},{'key':_0x0750('0x27'),'value':encodeURIComponent(_0x57fd6b[_0x0750('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0x5f0599[_0x0750('0x28')]},{'key':_0x0750('0x29'),'value':'form_post'},{'key':_0x0750('0x2a'),'value':encodeURIComponent(_0x50f22f)},{'key':_0x0750('0x2b'),'value':_0x5b5650},{'key':_0x0750('0x2c'),'value':_0x5b8307},{'key':_0x0750('0x2d'),'value':'login'}];var _0x51a655=_0x530f9b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x0750('0x16')](_0x32d202,function(_0x2f34aa){return _0x2f34aa[_0x0750('0x2e')]+'='+_0x2f34aa[_0x0750('0x2f')];})['join']('&');_0x5f0599[_0x0750('0x30')]={'issuer':_0x530f9b[_0x0750('0x1c')](_0x0750('0x31'),''),'audience':_0x5f0599[_0x0750('0x26')],'state':_0x5b5650,'nonce':_0x5b8307};redis[_0x0750('0x32')](_0x5b5650,JSON[_0x0750('0x22')](_0x5f0599));return _0x51a655;}function isValidIdToken(_0x50933c,_0x22f2e0){try{var _0x5339a8=jwt[_0x0750('0x33')](_0x50933c,{'complete':!![]});var _0x3a39b6=_0x5339a8[_0x0750('0x34')];if(_0x3a39b6[_0x0750('0x35')]!==_0x22f2e0['issuer'])return![];if(_0x3a39b6['aud']!==_0x22f2e0[_0x0750('0x36')])return![];if(_0x3a39b6['nonce']!==_0x22f2e0[_0x0750('0x2c')])return![];if(moment()[_0x0750('0x37')](moment[_0x0750('0x38')](_0x3a39b6['exp'])))return![];return!![];}catch(_0x43dccd){throw _0x43dccd;}}function refreshOauth2MicrosoftAccessToken(_0x18cdff){return Promise['resolve']()['then'](function(){if(_0x18cdff['data3'])return _0x18cdff;return db[_0x0750('0x39')][_0x0750('0x3a')]({'where':{'id':_0x18cdff['id']},'raw':!![]});})[_0x0750('0x3b')](function(_0x434c78){var _0x2c649f={'grant_type':_0x0750('0x3c'),'refresh_token':_0x434c78[_0x0750('0x3d')],'scope':getAccessTokenScope(_0x434c78),'redirect_uri':_0x434c78['data4'],'client_id':_0x434c78['data1'],'client_secret':encryptor[_0x0750('0x3e')](_0x434c78[_0x0750('0x3f')])};var _0x2790e2={'method':_0x0750('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0x0750('0x1d'),_0x434c78['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2c649f,'json':!![]};return rp(_0x2790e2);})[_0x0750('0x3b')](function(_0x2c43ee){_0x18cdff[_0x0750('0x41')]=_0x2c43ee[_0x0750('0x42')];_0x18cdff[_0x0750('0x3d')]=_0x2c43ee[_0x0750('0x3c')];return db[_0x0750('0x39')][_0x0750('0x43')]({'data5':_0x18cdff[_0x0750('0x41')],'data6':_0x18cdff['data6']},{'where':{'id':_0x18cdff['id']}});})['then'](function(){return _0x18cdff;})[_0x0750('0x44')](function(_0x4a3f63){logger['error'](_0x0750('0x45'),_0x18cdff['id'],_0x4a3f63);});}function getOauth2MicrosoftAccessToken(_0x30729,_0x49c528){var _0x7cbcb3={'grant_type':'authorization_code','code':_0x30729,'scope':getAccessTokenScope(_0x49c528),'redirect_uri':_0x49c528[_0x0750('0x28')],'client_id':_0x49c528[_0x0750('0x26')],'client_secret':encryptor['decryptString'](_0x49c528[_0x0750('0x3f')])};var _0x22a77c={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x0750('0x1c')](_0x0750('0x1d'),_0x49c528[_0x0750('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x7cbcb3,'json':!![]};return rp(_0x22a77c);}function startRefreshInterval(_0x54402d){var _0x210412=schedule[_0x0750('0x46')];if(_0x210412[_0x54402d['id']])clearInterval(_0x210412[_0x54402d['id']]);_0x210412[_0x54402d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x0750('0x47')](this,{'id':_0x54402d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x210412;}function startAllRefreshIntervals(){return db[_0x0750('0x39')][_0x0750('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x0750('0x3b')](function(_0x10e9be){var _0xaa9dfd=_0x10e9be[_0x0750('0x16')](function(_0x27912a){return refreshOauth2MicrosoftAccessToken(_0x27912a)[_0x0750('0x3b')](function(_0x177c48){startRefreshInterval(_0x177c48);});});return Promise[_0x0750('0x49')](_0xaa9dfd);})[_0x0750('0x44')](function(_0x110145){var _0x3810bb=_0x110145?util[_0x0750('0x4a')](_0x110145,{'showHidden':![],'depth':null}):'';logger[_0x0750('0x4b')](_0x0750('0x4c'),_0x3810bb);});}module[_0x0750('0x4d')]={'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 81a66e1..47d99ca 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 _0x1681=['../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1681,0x12c));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1168('0x0'));var BPromise=require(_0x1168('0x1'));var rs=require(_0x1168('0x2'));var fs=require('fs');var Redis=require(_0x1168('0x3'));var db=require(_0x1168('0x4'))['db'];var utils=require(_0x1168('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1168('0x6'));var jayson=require(_0x1168('0x7'));var client=jayson['client'][_0x1168('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d0634,_0x5e6752,_0x27309b){return new BPromise(function(_0x53baca,_0x262f80){return client[_0x1168('0x9')](_0x1d0634,_0x27309b)['then'](function(_0x38096f){logger[_0x1168('0xa')]('CloudProvider,\x20%s,\x20%s',_0x5e6752,_0x1168('0xb'));logger[_0x1168('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5e6752,'request\x20sent',JSON[_0x1168('0xd')](_0x38096f));if(_0x38096f[_0x1168('0xe')]){if(_0x38096f[_0x1168('0xe')][_0x1168('0xf')]===0x1f4){logger[_0x1168('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5e6752,_0x38096f[_0x1168('0xe')][_0x1168('0x10')]);return _0x262f80(_0x38096f[_0x1168('0xe')][_0x1168('0x10')]);}logger[_0x1168('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5e6752,_0x38096f[_0x1168('0xe')]['message']);return _0x53baca(_0x38096f[_0x1168('0xe')][_0x1168('0x10')]);}else{logger['info'](_0x1168('0x11'),_0x5e6752,_0x1168('0xb'));_0x53baca(_0x38096f['result'][_0x1168('0x10')]);}})['catch'](function(_0x45e07e){logger[_0x1168('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5e6752,_0x45e07e);_0x262f80(_0x45e07e);});});} \ No newline at end of file +var _0x3c91=['client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4baac8,_0x5f1dc7){var _0x56ebc5=function(_0x23d717){while(--_0x23d717){_0x4baac8['push'](_0x4baac8['shift']());}};_0x56ebc5(++_0x5f1dc7);}(_0x3c91,0x1af));var _0x13c9=function(_0x116ede,_0x1d1faf){_0x116ede=_0x116ede-0x0;var _0x3d9593=_0x3c91[_0x116ede];return _0x3d9593;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x3'));var db=require(_0x13c9('0x4'))['db'];var utils=require(_0x13c9('0x5'));var logger=require('../../config/logger')(_0x13c9('0x6'));var config=require(_0x13c9('0x7'));var jayson=require(_0x13c9('0x8'));var client=jayson[_0x13c9('0x9')][_0x13c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c4332,_0x58b610,_0x44243f){return new BPromise(function(_0x196c2a,_0x5fd23){return client[_0x13c9('0xb')](_0x4c4332,_0x44243f)[_0x13c9('0xc')](function(_0x5370dd){logger['info'](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58b610,_0x13c9('0xe'),JSON[_0x13c9('0xf')](_0x5370dd));if(_0x5370dd[_0x13c9('0x10')]){if(_0x5370dd[_0x13c9('0x10')][_0x13c9('0x11')]===0x1f4){logger[_0x13c9('0x10')](_0x13c9('0xd'),_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x5fd23(_0x5370dd['error']['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x196c2a(_0x5370dd[_0x13c9('0x10')]['message']);}else{logger[_0x13c9('0x13')](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));_0x196c2a(_0x5370dd[_0x13c9('0x14')][_0x13c9('0x12')]);}})[_0x13c9('0x15')](function(_0x238952){logger['error']('CloudProvider,\x20%s,\x20%s',_0x58b610,_0x238952);_0x5fd23(_0x238952);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 5ae29c3..1a2e16f 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0xee2847,_0x5e5235){var _0x29bb86=function(_0x2de703){while(--_0x2de703){_0xee2847['push'](_0xee2847['shift']());}};_0x29bb86(++_0x5e5235);}(_0xadb5,0xad));var _0x5adb=function(_0xcdbb76,_0x30bd05){_0xcdbb76=_0xcdbb76-0x0;var _0x2e6fdb=_0xadb5[_0xcdbb76];return _0x2e6fdb;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x41a59d,_0x3447bd){var _0x53157e=function(_0x523f2d){while(--_0x523f2d){_0x41a59d['push'](_0x41a59d['shift']());}};_0x53157e(++_0x3447bd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 3ed5a16..c68db71 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 _0x1be3=['sequelize','STRING'];(function(_0x58af69,_0x35708f){var _0x298ad5=function(_0x413a13){while(--_0x413a13){_0x58af69['push'](_0x58af69['shift']());}};_0x298ad5(++_0x35708f);}(_0x1be3,0x13c));var _0x31be=function(_0x56cc0e,_0x48430b){_0x56cc0e=_0x56cc0e-0x0;var _0xecc2d1=_0x1be3[_0x56cc0e];return _0xecc2d1;};'use strict';var Sequelize=require(_0x31be('0x0'));module['exports']={'name':{'type':Sequelize[_0x31be('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x31be('0x1')]},'companyId':{'type':Sequelize[_0x31be('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x31be('0x1')]},'street':{'type':Sequelize[_0x31be('0x1')]},'postalCode':{'type':Sequelize[_0x31be('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x31be('0x1')]},'email':{'type':Sequelize[_0x31be('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x31be('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x31be('0x1')]},'sCity':{'type':Sequelize[_0x31be('0x1')]},'sCountry':{'type':Sequelize[_0x31be('0x1')]},'description':{'type':Sequelize[_0x31be('0x1')]}}; \ No newline at end of file +var _0xf35b=['exports','STRING','sequelize'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xf35b,0x1e5));var _0xbf35=function(_0x5f2240,_0x2c4c7f){_0x5f2240=_0x5f2240-0x0;var _0x3c2d78=_0xf35b[_0x5f2240];return _0x3c2d78;};'use strict';var Sequelize=require(_0xbf35('0x0'));module[_0xbf35('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xbf35('0x2')]},'website':{'type':Sequelize[_0xbf35('0x2')]},'phone':{'type':Sequelize[_0xbf35('0x2')]},'fax':{'type':Sequelize[_0xbf35('0x2')]},'type':{'type':Sequelize[_0xbf35('0x2')]},'street':{'type':Sequelize[_0xbf35('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xbf35('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xbf35('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbf35('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xbf35('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xbf35('0x2')]},'description':{'type':Sequelize[_0xbf35('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index f44ffac..89071cc 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 _0xa260=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','omit','ids','CmContact','pick','options','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','get','Companies','UserProfileResource','sendStatus','stack','name','status','index','CmCompany','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','filter','includeAll','include','rows','catch','show','params','rawAttributes'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xa260,0x16d));var _0x0a26=function(_0xd7ab6,_0x345707){_0xd7ab6=_0xd7ab6-0x0;var _0x176d05=_0xa260[_0xd7ab6];return _0x176d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a26('0x0'));var zipdir=require(_0x0a26('0x1'));var jsonpatch=require(_0x0a26('0x2'));var rp=require(_0x0a26('0x3'));var moment=require('moment');var BPromise=require(_0x0a26('0x4'));var Mustache=require(_0x0a26('0x5'));var util=require(_0x0a26('0x6'));var path=require('path');var sox=require(_0x0a26('0x7'));var csv=require(_0x0a26('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a26('0x9'));var _=require(_0x0a26('0xa'));var squel=require(_0x0a26('0xb'));var crypto=require(_0x0a26('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0a26('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0a26('0xe'));var Papa=require(_0x0a26('0xf'));var Redis=require(_0x0a26('0x10'));var authService=require(_0x0a26('0x11'));var qs=require(_0x0a26('0x12'));var as=require(_0x0a26('0x13'));var hardwareService=require(_0x0a26('0x14'));var logger=require(_0x0a26('0x15'))('api');var utils=require(_0x0a26('0x16'));var config=require(_0x0a26('0x17'));var licenseUtil=require(_0x0a26('0x18'));var db=require(_0x0a26('0x19'))['db'];function respondWithStatusCode(_0x5b2717,_0x13004c){_0x13004c=_0x13004c||0xcc;return function(_0x53f7af){if(_0x53f7af){return _0x5b2717['sendStatus'](_0x13004c);}return _0x5b2717['status'](_0x13004c)[_0x0a26('0x1a')]();};}function respondWithResult(_0x1a8cef,_0x21129e){_0x21129e=_0x21129e||0xc8;return function(_0x2b9840){if(_0x2b9840){return _0x1a8cef['status'](_0x21129e)[_0x0a26('0x1b')](_0x2b9840);}};}function respondWithFilteredResult(_0x486cf5,_0x30bc47){return function(_0x81a4e9){if(_0x81a4e9){var _0x789d87=typeof _0x30bc47[_0x0a26('0x1c')]===_0x0a26('0x1d')&&typeof _0x30bc47[_0x0a26('0x1e')]===_0x0a26('0x1d');var _0x512854=_0x81a4e9[_0x0a26('0x1f')];var _0x186a10=_0x789d87?0x0:_0x30bc47[_0x0a26('0x1c')];var _0x3c2688=_0x789d87?_0x81a4e9[_0x0a26('0x1f')]:_0x30bc47[_0x0a26('0x1c')]+_0x30bc47[_0x0a26('0x1e')];var _0x4d3cae;if(_0x3c2688>=_0x512854){_0x3c2688=_0x512854;_0x4d3cae=0xc8;}else{_0x4d3cae=0xce;}_0x486cf5['status'](_0x4d3cae);return _0x486cf5[_0x0a26('0x20')](_0x0a26('0x21'),_0x186a10+'-'+_0x3c2688+'/'+_0x512854)[_0x0a26('0x1b')](_0x81a4e9);}return null;};}function patchUpdates(_0x3cdddd){return function(_0x4e8f90){try{jsonpatch['apply'](_0x4e8f90,_0x3cdddd,!![]);}catch(_0x554dc7){return BPromise['reject'](_0x554dc7);}return _0x4e8f90[_0x0a26('0x22')]();};}function saveUpdates(_0x194e58,_0x24fb7f){return function(_0x12914e){if(_0x12914e){return _0x12914e[_0x0a26('0x23')](_0x194e58)['then'](function(_0x5a3eb2){return _0x5a3eb2;});}return null;};}function removeEntity(_0xcb6a9d,_0x4b113f){return function(_0x511c61){if(_0x511c61){return _0x511c61[_0x0a26('0x24')]()[_0x0a26('0x25')](function(){var _0xc1cb1e=_0x511c61[_0x0a26('0x26')]({'plain':!![]});var _0x1e76a8=_0x0a26('0x27');return db[_0x0a26('0x28')]['destroy']({'where':{'type':_0x1e76a8,'resourceId':_0xc1cb1e['id']}})[_0x0a26('0x25')](function(){return _0x511c61;});})['then'](function(){_0xcb6a9d['status'](0xcc)[_0x0a26('0x1a')]();});}};}function handleEntityNotFound(_0x1c41c4,_0x189b3d){return function(_0x66a96d){if(!_0x66a96d){_0x1c41c4[_0x0a26('0x29')](0x194);}return _0x66a96d;};}function handleError(_0x53bcb3,_0x5a95d7){_0x5a95d7=_0x5a95d7||0x1f4;return function(_0x845bfe){logger['error'](_0x845bfe[_0x0a26('0x2a')]);if(_0x845bfe[_0x0a26('0x2b')]){delete _0x845bfe['name'];}_0x53bcb3[_0x0a26('0x2c')](_0x5a95d7)['send'](_0x845bfe);};}exports[_0x0a26('0x2d')]=function(_0x2bd007,_0x5c5e6a){var _0x304912={},_0x4d1bf7={},_0x33fc1c={'count':0x0,'rows':[]};return db[_0x0a26('0x2e')]['describe']()[_0x0a26('0x25')](function(_0x56bf02){_0x4d1bf7['model']=_[_0x0a26('0x2f')](_0x56bf02);_0x4d1bf7['query']=_[_0x0a26('0x2f')](_0x2bd007[_0x0a26('0x30')]);_0x4d1bf7[_0x0a26('0x31')]=_[_0x0a26('0x32')](_0x4d1bf7[_0x0a26('0x33')],_0x4d1bf7[_0x0a26('0x30')]);_0x304912[_0x0a26('0x34')]=_[_0x0a26('0x32')](_0x4d1bf7[_0x0a26('0x33')],qs['fields'](_0x2bd007[_0x0a26('0x30')][_0x0a26('0x35')]));_0x304912[_0x0a26('0x34')]=_0x304912[_0x0a26('0x34')][_0x0a26('0x36')]?_0x304912['attributes']:_0x4d1bf7[_0x0a26('0x33')];if(!_0x2bd007[_0x0a26('0x30')][_0x0a26('0x37')](_0x0a26('0x38'))){_0x304912[_0x0a26('0x1e')]=qs['limit'](_0x2bd007[_0x0a26('0x30')][_0x0a26('0x1e')]);_0x304912['offset']=qs[_0x0a26('0x1c')](_0x2bd007[_0x0a26('0x30')]['offset']);}_0x304912[_0x0a26('0x39')]=qs[_0x0a26('0x3a')](_0x2bd007[_0x0a26('0x30')][_0x0a26('0x3a')]);_0x304912[_0x0a26('0x3b')]=qs[_0x0a26('0x31')](_['pick'](_0x2bd007[_0x0a26('0x30')],_0x4d1bf7['filters']),_0x56bf02);if(_0x2bd007[_0x0a26('0x30')]['filter']){_0x304912[_0x0a26('0x3b')]=_[_0x0a26('0x3c')](_0x304912[_0x0a26('0x3b')],{'$or':_[_0x0a26('0x3d')](_0x304912[_0x0a26('0x34')],function(_0xeef75d){var _0x58904c={};_0x58904c[_0xeef75d]={'$like':'%'+_0x2bd007[_0x0a26('0x30')][_0x0a26('0x3e')]+'%'};return _0x58904c;})});}_0x304912=_['merge']({},_0x304912,_0x2bd007['options']);var _0x1d4d95={'where':_0x304912['where']};return db[_0x0a26('0x2e')]['count'](_0x1d4d95)[_0x0a26('0x25')](function(_0x3bb194){_0x33fc1c[_0x0a26('0x1f')]=_0x3bb194;if(_0x2bd007['query'][_0x0a26('0x3f')]){_0x304912[_0x0a26('0x40')]=[{'all':!![]}];}return db[_0x0a26('0x2e')]['findAll'](_0x304912);})['then'](function(_0x5d3735){_0x33fc1c[_0x0a26('0x41')]=_0x5d3735;return _0x33fc1c;})['then'](respondWithFilteredResult(_0x5c5e6a,_0x304912))[_0x0a26('0x42')](handleError(_0x5c5e6a,null));})[_0x0a26('0x42')](handleError(_0x5c5e6a,null));};exports[_0x0a26('0x43')]=function(_0x2e872e,_0x26cb94){var _0x169c30={'raw':![],'where':{'id':_0x2e872e[_0x0a26('0x44')]['id']}},_0x372f2a={};_0x372f2a[_0x0a26('0x33')]=_[_0x0a26('0x2f')](db[_0x0a26('0x2e')][_0x0a26('0x45')]);_0x372f2a[_0x0a26('0x30')]=_[_0x0a26('0x2f')](_0x2e872e[_0x0a26('0x30')]);_0x372f2a[_0x0a26('0x31')]=_[_0x0a26('0x32')](_0x372f2a['model'],_0x372f2a[_0x0a26('0x30')]);_0x169c30['attributes']=_['intersection'](_0x372f2a['model'],qs[_0x0a26('0x35')](_0x2e872e[_0x0a26('0x30')][_0x0a26('0x35')]));_0x169c30['attributes']=_0x169c30[_0x0a26('0x34')][_0x0a26('0x36')]?_0x169c30['attributes']:_0x372f2a[_0x0a26('0x33')];if(_0x2e872e[_0x0a26('0x30')][_0x0a26('0x3f')]){_0x169c30[_0x0a26('0x40')]=[{'all':!![]}];}_0x169c30=_[_0x0a26('0x3c')]({},_0x169c30,_0x2e872e['options']);return db[_0x0a26('0x2e')][_0x0a26('0x46')](_0x169c30)[_0x0a26('0x25')](handleEntityNotFound(_0x26cb94,null))[_0x0a26('0x25')](respondWithResult(_0x26cb94,null))[_0x0a26('0x42')](handleError(_0x26cb94,null));};exports[_0x0a26('0x47')]=function(_0x546f9c,_0x35ec24){return db['CmCompany'][_0x0a26('0x47')](_0x546f9c['body'],{})['then'](function(_0x3647e9){var _0x432284=_0x546f9c[_0x0a26('0x48')][_0x0a26('0x26')]({'plain':!![]});if(!_0x432284)throw new Error(_0x0a26('0x49'));if(_0x432284['role']===_0x0a26('0x48')){var _0x2c8689=_0x3647e9[_0x0a26('0x26')]({'plain':!![]});var _0xded0ab=_0x0a26('0x27');return db[_0x0a26('0x4a')][_0x0a26('0x46')]({'where':{'name':_0xded0ab,'userProfileId':_0x432284[_0x0a26('0x4b')]},'raw':!![]})[_0x0a26('0x25')](function(_0x5d3b34){if(_0x5d3b34&&_0x5d3b34[_0x0a26('0x4c')]===0x0){return db[_0x0a26('0x28')][_0x0a26('0x47')]({'name':_0x2c8689[_0x0a26('0x2b')],'resourceId':_0x2c8689['id'],'type':_0x5d3b34['name'],'sectionId':_0x5d3b34['id']},{})[_0x0a26('0x25')](function(){return _0x3647e9;});}else{return _0x3647e9;}})['catch'](function(_0x3204b4){logger['error'](_0x0a26('0x4d'),_0x3204b4);throw _0x3204b4;});}return _0x3647e9;})['then'](respondWithResult(_0x35ec24,0xc9))[_0x0a26('0x42')](handleError(_0x35ec24,null));};exports['update']=function(_0x1195c2,_0x3d1219){if(_0x1195c2['body']['id']){delete _0x1195c2[_0x0a26('0x4e')]['id'];}return db[_0x0a26('0x2e')][_0x0a26('0x46')]({'where':{'id':_0x1195c2[_0x0a26('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d1219,null))['then'](saveUpdates(_0x1195c2[_0x0a26('0x4e')],null))[_0x0a26('0x25')](respondWithResult(_0x3d1219,null))['catch'](handleError(_0x3d1219,null));};exports[_0x0a26('0x24')]=function(_0x5e0172,_0x281e27){return db['CmCompany'][_0x0a26('0x46')]({'where':{'id':_0x5e0172['params']['id']}})['then'](handleEntityNotFound(_0x281e27,null))[_0x0a26('0x25')](removeEntity(_0x281e27,null))[_0x0a26('0x42')](handleError(_0x281e27,null));};exports[_0x0a26('0x4f')]=function(_0x5ef76d,_0x11b755){return db[_0x0a26('0x2e')][_0x0a26('0x4f')]()[_0x0a26('0x25')](respondWithResult(_0x11b755,null))['catch'](handleError(_0x11b755,null));};exports['addContacts']=function(_0x5701b3,_0x290972,_0x2cae9a){return db['CmContact'][_0x0a26('0x46')]({'where':{'id':_0x5701b3[_0x0a26('0x44')]['id']}})[_0x0a26('0x25')](handleEntityNotFound(_0x290972,null))[_0x0a26('0x25')](function(_0xc6fb5c){if(_0xc6fb5c){return _0xc6fb5c[_0x0a26('0x50')](_0x5701b3[_0x0a26('0x4e')]['ids'],_[_0x0a26('0x51')](_0x5701b3['body'],[_0x0a26('0x52'),'id'])||{});}})['then'](respondWithResult(_0x290972,null))[_0x0a26('0x42')](handleError(_0x290972,null));};exports['getContacts']=function(_0x3aba58,_0x1b5cca,_0x2dfb95){var _0x3f0b51={};var _0x4671c8={};var _0x15b9e7;var _0x484acb;return db['CmCompany']['findOne']({'where':{'id':_0x3aba58[_0x0a26('0x44')]['id']}})[_0x0a26('0x25')](handleEntityNotFound(_0x1b5cca,null))[_0x0a26('0x25')](function(_0x48559f){if(_0x48559f){_0x15b9e7=_0x48559f;_0x4671c8[_0x0a26('0x33')]=_[_0x0a26('0x2f')](db[_0x0a26('0x53')]['rawAttributes']);_0x4671c8['query']=_[_0x0a26('0x2f')](_0x3aba58[_0x0a26('0x30')]);_0x4671c8[_0x0a26('0x31')]=_[_0x0a26('0x32')](_0x4671c8[_0x0a26('0x33')],_0x4671c8['query']);_0x3f0b51[_0x0a26('0x34')]=_[_0x0a26('0x32')](_0x4671c8['model'],qs[_0x0a26('0x35')](_0x3aba58[_0x0a26('0x30')][_0x0a26('0x35')]));_0x3f0b51[_0x0a26('0x34')]=_0x3f0b51[_0x0a26('0x34')][_0x0a26('0x36')]?_0x3f0b51[_0x0a26('0x34')]:_0x4671c8[_0x0a26('0x33')];_0x3f0b51[_0x0a26('0x39')]=qs[_0x0a26('0x3a')](_0x3aba58[_0x0a26('0x30')]['sort']);_0x3f0b51[_0x0a26('0x3b')]=qs[_0x0a26('0x31')](_[_0x0a26('0x54')](_0x3aba58[_0x0a26('0x30')],_0x4671c8[_0x0a26('0x31')]));if(_0x3aba58[_0x0a26('0x30')]['filter']){_0x3f0b51[_0x0a26('0x3b')]=_[_0x0a26('0x3c')](_0x3f0b51[_0x0a26('0x3b')],{'$or':_[_0x0a26('0x3d')](_0x3f0b51[_0x0a26('0x34')],function(_0x6feca8){var _0x1b60d7={};_0x1b60d7[_0x6feca8]={'$like':'%'+_0x3aba58['query'][_0x0a26('0x3e')]+'%'};return _0x1b60d7;})});}_0x3f0b51=_[_0x0a26('0x3c')]({},_0x3f0b51,_0x3aba58[_0x0a26('0x55')]);return _0x15b9e7[_0x0a26('0x56')](_0x3f0b51);}})['then'](function(_0x1208a4){if(_0x1208a4){_0x484acb=_0x1208a4[_0x0a26('0x36')];if(!_0x3aba58[_0x0a26('0x30')][_0x0a26('0x37')](_0x0a26('0x38'))){_0x3f0b51[_0x0a26('0x1e')]=qs[_0x0a26('0x1e')](_0x3aba58[_0x0a26('0x30')][_0x0a26('0x1e')]);_0x3f0b51[_0x0a26('0x1c')]=qs[_0x0a26('0x1c')](_0x3aba58[_0x0a26('0x30')]['offset']);}return _0x15b9e7[_0x0a26('0x56')](_0x3f0b51);}})[_0x0a26('0x25')](function(_0xb644b5){if(_0xb644b5){return _0xb644b5?{'count':_0x484acb,'rows':_0xb644b5}:null;}})[_0x0a26('0x25')](respondWithResult(_0x1b5cca,null))['catch'](handleError(_0x1b5cca,null));}; \ No newline at end of file +var _0xb339=['save','update','destroy','then','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','fields','attributes','length','limit','order','sort','filters','filter','where','merge','options','includeAll','include','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','body','addContacts','CmContact','ids','getContacts','findOne','pick','map','hasOwnProperty','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','apply'];(function(_0x152a59,_0x5c33ba){var _0x3e5cb4=function(_0x198336){while(--_0x198336){_0x152a59['push'](_0x152a59['shift']());}};_0x3e5cb4(++_0x5c33ba);}(_0xb339,0xdb));var _0x9b33=function(_0x36fe46,_0x40010c){_0x36fe46=_0x36fe46-0x0;var _0x4d2e9c=_0xb339[_0x36fe46];return _0x4d2e9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b33('0x0'));var zipdir=require(_0x9b33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b33('0x2'));var BPromise=require(_0x9b33('0x3'));var Mustache=require('mustache');var util=require(_0x9b33('0x4'));var path=require(_0x9b33('0x5'));var sox=require(_0x9b33('0x6'));var csv=require('to-csv');var ejs=require(_0x9b33('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b33('0x8'));var squel=require(_0x9b33('0x9'));var crypto=require(_0x9b33('0xa'));var jsforce=require(_0x9b33('0xb'));var deskjs=require(_0x9b33('0xc'));var toCsv=require(_0x9b33('0xd'));var querystring=require(_0x9b33('0xe'));var Papa=require(_0x9b33('0xf'));var Redis=require(_0x9b33('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9b33('0x11'));var as=require(_0x9b33('0x12'));var hardwareService=require(_0x9b33('0x13'));var logger=require(_0x9b33('0x14'))('api');var utils=require(_0x9b33('0x15'));var config=require(_0x9b33('0x16'));var licenseUtil=require(_0x9b33('0x17'));var db=require(_0x9b33('0x18'))['db'];function respondWithStatusCode(_0x257d1c,_0x4c38cd){_0x4c38cd=_0x4c38cd||0xcc;return function(_0x2e3087){if(_0x2e3087){return _0x257d1c['sendStatus'](_0x4c38cd);}return _0x257d1c[_0x9b33('0x19')](_0x4c38cd)[_0x9b33('0x1a')]();};}function respondWithResult(_0x543ab2,_0x471f87){_0x471f87=_0x471f87||0xc8;return function(_0x58318){if(_0x58318){return _0x543ab2[_0x9b33('0x19')](_0x471f87)[_0x9b33('0x1b')](_0x58318);}};}function respondWithFilteredResult(_0x3a036d,_0x477ee1){return function(_0x15b9ff){if(_0x15b9ff){var _0x3dda88=typeof _0x477ee1['offset']==='undefined'&&typeof _0x477ee1['limit']===_0x9b33('0x1c');var _0x3733ca=_0x15b9ff[_0x9b33('0x1d')];var _0x1fd3c1=_0x3dda88?0x0:_0x477ee1[_0x9b33('0x1e')];var _0x248d57=_0x3dda88?_0x15b9ff[_0x9b33('0x1d')]:_0x477ee1[_0x9b33('0x1e')]+_0x477ee1['limit'];var _0x397b8e;if(_0x248d57>=_0x3733ca){_0x248d57=_0x3733ca;_0x397b8e=0xc8;}else{_0x397b8e=0xce;}_0x3a036d[_0x9b33('0x19')](_0x397b8e);return _0x3a036d[_0x9b33('0x1f')]('Content-Range',_0x1fd3c1+'-'+_0x248d57+'/'+_0x3733ca)[_0x9b33('0x1b')](_0x15b9ff);}return null;};}function patchUpdates(_0x269203){return function(_0x5d2780){try{jsonpatch[_0x9b33('0x20')](_0x5d2780,_0x269203,!![]);}catch(_0x2b99bc){return BPromise['reject'](_0x2b99bc);}return _0x5d2780[_0x9b33('0x21')]();};}function saveUpdates(_0x1176c9,_0x100914){return function(_0x35baa4){if(_0x35baa4){return _0x35baa4[_0x9b33('0x22')](_0x1176c9)['then'](function(_0x18197a){return _0x18197a;});}return null;};}function removeEntity(_0x40fe46,_0x39b853){return function(_0x2ded8a){if(_0x2ded8a){return _0x2ded8a[_0x9b33('0x23')]()[_0x9b33('0x24')](function(){var _0x4dcf8d=_0x2ded8a[_0x9b33('0x25')]({'plain':!![]});var _0x3bddc2=_0x9b33('0x26');return db['UserProfileResource'][_0x9b33('0x23')]({'where':{'type':_0x3bddc2,'resourceId':_0x4dcf8d['id']}})[_0x9b33('0x24')](function(){return _0x2ded8a;});})[_0x9b33('0x24')](function(){_0x40fe46[_0x9b33('0x19')](0xcc)[_0x9b33('0x1a')]();});}};}function handleEntityNotFound(_0x45e629,_0x520580){return function(_0x4d334b){if(!_0x4d334b){_0x45e629[_0x9b33('0x27')](0x194);}return _0x4d334b;};}function handleError(_0x13b580,_0x29d33b){_0x29d33b=_0x29d33b||0x1f4;return function(_0x4fd438){logger[_0x9b33('0x28')](_0x4fd438[_0x9b33('0x29')]);if(_0x4fd438['name']){delete _0x4fd438[_0x9b33('0x2a')];}_0x13b580[_0x9b33('0x19')](_0x29d33b)[_0x9b33('0x2b')](_0x4fd438);};}exports[_0x9b33('0x2c')]=function(_0x2aca74,_0x1bbc0e){var _0x1201bc={},_0x36e878={},_0x4684ae={'count':0x0,'rows':[]};return db[_0x9b33('0x2d')][_0x9b33('0x2e')]()[_0x9b33('0x24')](function(_0x4d6788){_0x36e878[_0x9b33('0x2f')]=_[_0x9b33('0x30')](_0x4d6788);_0x36e878[_0x9b33('0x31')]=_[_0x9b33('0x30')](_0x2aca74['query']);_0x36e878['filters']=_[_0x9b33('0x32')](_0x36e878[_0x9b33('0x2f')],_0x36e878[_0x9b33('0x31')]);_0x1201bc['attributes']=_[_0x9b33('0x32')](_0x36e878['model'],qs[_0x9b33('0x33')](_0x2aca74[_0x9b33('0x31')][_0x9b33('0x33')]));_0x1201bc['attributes']=_0x1201bc[_0x9b33('0x34')][_0x9b33('0x35')]?_0x1201bc['attributes']:_0x36e878[_0x9b33('0x2f')];if(!_0x2aca74['query']['hasOwnProperty']('nolimit')){_0x1201bc[_0x9b33('0x36')]=qs['limit'](_0x2aca74[_0x9b33('0x31')]['limit']);_0x1201bc[_0x9b33('0x1e')]=qs[_0x9b33('0x1e')](_0x2aca74['query'][_0x9b33('0x1e')]);}_0x1201bc[_0x9b33('0x37')]=qs[_0x9b33('0x38')](_0x2aca74[_0x9b33('0x31')][_0x9b33('0x38')]);_0x1201bc['where']=qs[_0x9b33('0x39')](_['pick'](_0x2aca74['query'],_0x36e878[_0x9b33('0x39')]),_0x4d6788);if(_0x2aca74[_0x9b33('0x31')][_0x9b33('0x3a')]){_0x1201bc[_0x9b33('0x3b')]=_[_0x9b33('0x3c')](_0x1201bc[_0x9b33('0x3b')],{'$or':_['map'](_0x1201bc[_0x9b33('0x34')],function(_0x49dffa){var _0xa85df0={};_0xa85df0[_0x49dffa]={'$like':'%'+_0x2aca74[_0x9b33('0x31')]['filter']+'%'};return _0xa85df0;})});}_0x1201bc=_[_0x9b33('0x3c')]({},_0x1201bc,_0x2aca74[_0x9b33('0x3d')]);var _0x2c3517={'where':_0x1201bc[_0x9b33('0x3b')]};return db[_0x9b33('0x2d')][_0x9b33('0x1d')](_0x2c3517)[_0x9b33('0x24')](function(_0x546591){_0x4684ae[_0x9b33('0x1d')]=_0x546591;if(_0x2aca74['query'][_0x9b33('0x3e')]){_0x1201bc[_0x9b33('0x3f')]=[{'all':!![]}];}return db[_0x9b33('0x2d')]['findAll'](_0x1201bc);})[_0x9b33('0x24')](function(_0xf5bba1){_0x4684ae[_0x9b33('0x40')]=_0xf5bba1;return _0x4684ae;})[_0x9b33('0x24')](respondWithFilteredResult(_0x1bbc0e,_0x1201bc))[_0x9b33('0x41')](handleError(_0x1bbc0e,null));})['catch'](handleError(_0x1bbc0e,null));};exports['show']=function(_0x2d8c20,_0xcbf7c){var _0x109a74={'raw':![],'where':{'id':_0x2d8c20[_0x9b33('0x42')]['id']}},_0x2acd4b={};_0x2acd4b[_0x9b33('0x2f')]=_[_0x9b33('0x30')](db[_0x9b33('0x2d')]['rawAttributes']);_0x2acd4b['query']=_[_0x9b33('0x30')](_0x2d8c20[_0x9b33('0x31')]);_0x2acd4b[_0x9b33('0x39')]=_[_0x9b33('0x32')](_0x2acd4b[_0x9b33('0x2f')],_0x2acd4b[_0x9b33('0x31')]);_0x109a74[_0x9b33('0x34')]=_[_0x9b33('0x32')](_0x2acd4b[_0x9b33('0x2f')],qs[_0x9b33('0x33')](_0x2d8c20[_0x9b33('0x31')][_0x9b33('0x33')]));_0x109a74[_0x9b33('0x34')]=_0x109a74[_0x9b33('0x34')][_0x9b33('0x35')]?_0x109a74[_0x9b33('0x34')]:_0x2acd4b[_0x9b33('0x2f')];if(_0x2d8c20[_0x9b33('0x31')][_0x9b33('0x3e')]){_0x109a74[_0x9b33('0x3f')]=[{'all':!![]}];}_0x109a74=_[_0x9b33('0x3c')]({},_0x109a74,_0x2d8c20[_0x9b33('0x3d')]);return db[_0x9b33('0x2d')][_0x9b33('0x43')](_0x109a74)[_0x9b33('0x24')](handleEntityNotFound(_0xcbf7c,null))[_0x9b33('0x24')](respondWithResult(_0xcbf7c,null))[_0x9b33('0x41')](handleError(_0xcbf7c,null));};exports['create']=function(_0x1b22b9,_0x4bf7d5){return db[_0x9b33('0x2d')][_0x9b33('0x44')](_0x1b22b9['body'],{})['then'](function(_0x616a8c){var _0x5259e7=_0x1b22b9[_0x9b33('0x45')][_0x9b33('0x25')]({'plain':!![]});if(!_0x5259e7)throw new Error(_0x9b33('0x46'));if(_0x5259e7[_0x9b33('0x47')]===_0x9b33('0x45')){var _0x371d37=_0x616a8c[_0x9b33('0x25')]({'plain':!![]});var _0x1ea138=_0x9b33('0x26');return db[_0x9b33('0x48')][_0x9b33('0x43')]({'where':{'name':_0x1ea138,'userProfileId':_0x5259e7['userProfileId']},'raw':!![]})[_0x9b33('0x24')](function(_0x18e5d1){if(_0x18e5d1&&_0x18e5d1[_0x9b33('0x49')]===0x0){return db[_0x9b33('0x4a')][_0x9b33('0x44')]({'name':_0x371d37['name'],'resourceId':_0x371d37['id'],'type':_0x18e5d1['name'],'sectionId':_0x18e5d1['id']},{})[_0x9b33('0x24')](function(){return _0x616a8c;});}else{return _0x616a8c;}})[_0x9b33('0x41')](function(_0x237856){logger[_0x9b33('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x237856);throw _0x237856;});}return _0x616a8c;})['then'](respondWithResult(_0x4bf7d5,0xc9))['catch'](handleError(_0x4bf7d5,null));};exports[_0x9b33('0x22')]=function(_0xc99319,_0x5319a9){if(_0xc99319[_0x9b33('0x4b')]['id']){delete _0xc99319['body']['id'];}return db['CmCompany'][_0x9b33('0x43')]({'where':{'id':_0xc99319[_0x9b33('0x42')]['id']}})[_0x9b33('0x24')](handleEntityNotFound(_0x5319a9,null))[_0x9b33('0x24')](saveUpdates(_0xc99319[_0x9b33('0x4b')],null))[_0x9b33('0x24')](respondWithResult(_0x5319a9,null))[_0x9b33('0x41')](handleError(_0x5319a9,null));};exports[_0x9b33('0x23')]=function(_0xcd9825,_0x438fba){return db[_0x9b33('0x2d')]['find']({'where':{'id':_0xcd9825[_0x9b33('0x42')]['id']}})[_0x9b33('0x24')](handleEntityNotFound(_0x438fba,null))[_0x9b33('0x24')](removeEntity(_0x438fba,null))[_0x9b33('0x41')](handleError(_0x438fba,null));};exports[_0x9b33('0x2e')]=function(_0x480bd8,_0x2fecaa){return db[_0x9b33('0x2d')][_0x9b33('0x2e')]()[_0x9b33('0x24')](respondWithResult(_0x2fecaa,null))[_0x9b33('0x41')](handleError(_0x2fecaa,null));};exports[_0x9b33('0x4c')]=function(_0x198560,_0x54baa3,_0x2627b8){return db[_0x9b33('0x4d')][_0x9b33('0x43')]({'where':{'id':_0x198560[_0x9b33('0x42')]['id']}})[_0x9b33('0x24')](handleEntityNotFound(_0x54baa3,null))[_0x9b33('0x24')](function(_0x219557){if(_0x219557){return _0x219557[_0x9b33('0x4c')](_0x198560[_0x9b33('0x4b')][_0x9b33('0x4e')],_['omit'](_0x198560[_0x9b33('0x4b')],[_0x9b33('0x4e'),'id'])||{});}})[_0x9b33('0x24')](respondWithResult(_0x54baa3,null))[_0x9b33('0x41')](handleError(_0x54baa3,null));};exports[_0x9b33('0x4f')]=function(_0x14e3b2,_0x1b833c,_0x585145){var _0x327dac={};var _0x52f9eb={};var _0xfecb32;var _0x3f4c6d;return db[_0x9b33('0x2d')][_0x9b33('0x50')]({'where':{'id':_0x14e3b2[_0x9b33('0x42')]['id']}})[_0x9b33('0x24')](handleEntityNotFound(_0x1b833c,null))[_0x9b33('0x24')](function(_0x130ee3){if(_0x130ee3){_0xfecb32=_0x130ee3;_0x52f9eb['model']=_[_0x9b33('0x30')](db[_0x9b33('0x4d')]['rawAttributes']);_0x52f9eb[_0x9b33('0x31')]=_[_0x9b33('0x30')](_0x14e3b2[_0x9b33('0x31')]);_0x52f9eb[_0x9b33('0x39')]=_[_0x9b33('0x32')](_0x52f9eb[_0x9b33('0x2f')],_0x52f9eb['query']);_0x327dac[_0x9b33('0x34')]=_[_0x9b33('0x32')](_0x52f9eb[_0x9b33('0x2f')],qs['fields'](_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x33')]));_0x327dac[_0x9b33('0x34')]=_0x327dac[_0x9b33('0x34')][_0x9b33('0x35')]?_0x327dac['attributes']:_0x52f9eb['model'];_0x327dac[_0x9b33('0x37')]=qs[_0x9b33('0x38')](_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x38')]);_0x327dac['where']=qs[_0x9b33('0x39')](_[_0x9b33('0x51')](_0x14e3b2['query'],_0x52f9eb['filters']));if(_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x3a')]){_0x327dac[_0x9b33('0x3b')]=_['merge'](_0x327dac[_0x9b33('0x3b')],{'$or':_[_0x9b33('0x52')](_0x327dac['attributes'],function(_0x441b0e){var _0x522f24={};_0x522f24[_0x441b0e]={'$like':'%'+_0x14e3b2['query']['filter']+'%'};return _0x522f24;})});}_0x327dac=_[_0x9b33('0x3c')]({},_0x327dac,_0x14e3b2['options']);return _0xfecb32[_0x9b33('0x4f')](_0x327dac);}})[_0x9b33('0x24')](function(_0x32a8ab){if(_0x32a8ab){_0x3f4c6d=_0x32a8ab[_0x9b33('0x35')];if(!_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x53')]('nolimit')){_0x327dac[_0x9b33('0x36')]=qs[_0x9b33('0x36')](_0x14e3b2[_0x9b33('0x31')][_0x9b33('0x36')]);_0x327dac[_0x9b33('0x1e')]=qs[_0x9b33('0x1e')](_0x14e3b2[_0x9b33('0x31')]['offset']);}return _0xfecb32[_0x9b33('0x4f')](_0x327dac);}})[_0x9b33('0x24')](function(_0x20473f){if(_0x20473f){return _0x20473f?{'count':_0x3f4c6d,'rows':_0x20473f}:null;}})[_0x9b33('0x24')](respondWithResult(_0x1b833c,null))[_0x9b33('0x41')](handleError(_0x1b833c,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ce1e254..ac3f5e4 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 _0x3d1f=['../../config/environment','./cmCompany.attributes','define','cm_companies','lodash','api','moment','request-promise','path','rimraf'];(function(_0x30e913,_0x126626){var _0x3b02ac=function(_0x2efe93){while(--_0x2efe93){_0x30e913['push'](_0x30e913['shift']());}};_0x3b02ac(++_0x126626);}(_0x3d1f,0x176));var _0xf3d1=function(_0x2b90b8,_0x2d2fa4){_0x2b90b8=_0x2b90b8-0x0;var _0x3b2fe9=_0x3d1f[_0x2b90b8];return _0x3b2fe9;};'use strict';var _=require(_0xf3d1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf3d1('0x1'));var moment=require(_0xf3d1('0x2'));var BPromise=require('bluebird');var rp=require(_0xf3d1('0x3'));var fs=require('fs');var path=require(_0xf3d1('0x4'));var rimraf=require(_0xf3d1('0x5'));var config=require(_0xf3d1('0x6'));var attributes=require(_0xf3d1('0x7'));module['exports']=function(_0x38a4d1,_0x3b0c8c){return _0x38a4d1[_0xf3d1('0x8')]('CmCompany',attributes,{'tableName':_0xf3d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5996=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0xfc5a04,_0xb77332){var _0x24b690=function(_0x544d54){while(--_0x544d54){_0xfc5a04['push'](_0xfc5a04['shift']());}};_0x24b690(++_0xb77332);}(_0x5996,0x132));var _0x6599=function(_0x4535f8,_0x4719fb){_0x4535f8=_0x4535f8-0x0;var _0x5abdad=_0x5996[_0x4535f8];return _0x5abdad;};'use strict';var _=require(_0x6599('0x0'));var util=require(_0x6599('0x1'));var logger=require('../../config/logger')(_0x6599('0x2'));var moment=require('moment');var BPromise=require(_0x6599('0x3'));var rp=require(_0x6599('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6599('0x5'));var config=require(_0x6599('0x6'));var attributes=require(_0x6599('0x7'));module[_0x6599('0x8')]=function(_0x4dc22c,_0x222da1){return _0x4dc22c[_0x6599('0x9')](_0x6599('0xa'),attributes,{'tableName':_0x6599('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 2258509..5302bb8 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 _0x69d5=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x240c87,_0x50d230){var _0x9e99d8=function(_0x17c4df){while(--_0x17c4df){_0x240c87['push'](_0x240c87['shift']());}};_0x9e99d8(++_0x50d230);}(_0x69d5,0xb7));var _0x569d=function(_0x53e2e1,_0x2d5806){_0x53e2e1=_0x53e2e1-0x0;var _0x5bbafb=_0x69d5[_0x53e2e1];return _0x5bbafb;};'use strict';var _=require(_0x569d('0x0'));var util=require(_0x569d('0x1'));var moment=require('moment');var BPromise=require(_0x569d('0x2'));var rs=require(_0x569d('0x3'));var fs=require('fs');var Redis=require(_0x569d('0x4'));var db=require(_0x569d('0x5'))['db'];var utils=require(_0x569d('0x6'));var logger=require(_0x569d('0x7'))(_0x569d('0x8'));var config=require(_0x569d('0x9'));var jayson=require(_0x569d('0xa'));var client=jayson[_0x569d('0xb')][_0x569d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x221c29,_0x330a50,_0x4ced10){return new BPromise(function(_0x21547e,_0x445954){return client[_0x569d('0xd')](_0x221c29,_0x4ced10)[_0x569d('0xe')](function(_0x27a97f){logger[_0x569d('0xf')](_0x569d('0x10'),_0x330a50,_0x569d('0x11'));logger[_0x569d('0x12')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x330a50,'request\x20sent',JSON[_0x569d('0x13')](_0x27a97f));if(_0x27a97f[_0x569d('0x14')]){if(_0x27a97f['error'][_0x569d('0x15')]===0x1f4){logger[_0x569d('0x14')]('CmCompany,\x20%s,\x20%s',_0x330a50,_0x27a97f[_0x569d('0x14')][_0x569d('0x16')]);return _0x445954(_0x27a97f['error']['message']);}logger[_0x569d('0x14')]('CmCompany,\x20%s,\x20%s',_0x330a50,_0x27a97f[_0x569d('0x14')][_0x569d('0x16')]);return _0x21547e(_0x27a97f[_0x569d('0x14')][_0x569d('0x16')]);}else{logger[_0x569d('0xf')](_0x569d('0x10'),_0x330a50,_0x569d('0x11'));_0x21547e(_0x27a97f[_0x569d('0x17')][_0x569d('0x16')]);}})[_0x569d('0x18')](function(_0x540e93){logger[_0x569d('0x14')](_0x569d('0x10'),_0x330a50,_0x540e93);_0x445954(_0x540e93);});});} \ No newline at end of file +var _0x8e53=['rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x13e9c8,_0xe8a262){var _0x231ac7=function(_0x778af6){while(--_0x778af6){_0x13e9c8['push'](_0x13e9c8['shift']());}};_0x231ac7(++_0xe8a262);}(_0x8e53,0xae));var _0x38e5=function(_0x16d50f,_0x39b589){_0x16d50f=_0x16d50f-0x0;var _0x60218d=_0x8e53[_0x16d50f];return _0x60218d;};'use strict';var _=require(_0x38e5('0x0'));var util=require('util');var moment=require(_0x38e5('0x1'));var BPromise=require(_0x38e5('0x2'));var rs=require(_0x38e5('0x3'));var fs=require('fs');var Redis=require(_0x38e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x38e5('0x5'))(_0x38e5('0x6'));var config=require('../../config/environment');var jayson=require(_0x38e5('0x7'));var client=jayson['client'][_0x38e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x158a82,_0x1e2814,_0xaf92bb){return new BPromise(function(_0x50c186,_0x11f985){return client[_0x38e5('0x9')](_0x158a82,_0xaf92bb)[_0x38e5('0xa')](function(_0x12afbc){logger[_0x38e5('0xb')](_0x38e5('0xc'),_0x1e2814,'request\x20sent');logger[_0x38e5('0xd')](_0x38e5('0xe'),_0x1e2814,_0x38e5('0xf'),JSON[_0x38e5('0x10')](_0x12afbc));if(_0x12afbc[_0x38e5('0x11')]){if(_0x12afbc['error']['code']===0x1f4){logger[_0x38e5('0x11')]('CmCompany,\x20%s,\x20%s',_0x1e2814,_0x12afbc[_0x38e5('0x11')][_0x38e5('0x12')]);return _0x11f985(_0x12afbc['error']['message']);}logger['error'](_0x38e5('0xc'),_0x1e2814,_0x12afbc[_0x38e5('0x11')][_0x38e5('0x12')]);return _0x50c186(_0x12afbc[_0x38e5('0x11')][_0x38e5('0x12')]);}else{logger['info'](_0x38e5('0xc'),_0x1e2814,_0x38e5('0xf'));_0x50c186(_0x12afbc['result'][_0x38e5('0x12')]);}})[_0x38e5('0x13')](function(_0xb81fc3){logger[_0x38e5('0x11')](_0x38e5('0xc'),_0x1e2814,_0xb81fc3);_0x11f985(_0xb81fc3);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 52fa532..9684d7f 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 _0x6b80=['index','/describe','describe','isAuthenticated','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0x6b80,0x177));var _0x06b8=function(_0x35e54a,_0x46953a){_0x35e54a=_0x35e54a-0x0;var _0x35c2b0=_0x6b80[_0x35e54a];return _0x35c2b0;};'use strict';var multer=require(_0x06b8('0x0'));var util=require(_0x06b8('0x1'));var path=require('path');var timeout=require(_0x06b8('0x2'));var express=require('express');var router=express[_0x06b8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x06b8('0x4'));var interaction=require(_0x06b8('0x5'));var config=require(_0x06b8('0x6'));var controller=require(_0x06b8('0x7'));router[_0x06b8('0x8')]('/',auth['isAuthenticated'](),controller[_0x06b8('0x9')]);router[_0x06b8('0x8')](_0x06b8('0xa'),auth['isAuthenticated'](),controller[_0x06b8('0xb')]);router[_0x06b8('0x8')]('/:id',auth[_0x06b8('0xc')](),controller[_0x06b8('0xd')]);router[_0x06b8('0x8')](_0x06b8('0xe'),auth[_0x06b8('0xc')](),controller[_0x06b8('0xf')]);router[_0x06b8('0x10')]('/',auth[_0x06b8('0xc')](),controller[_0x06b8('0x11')]);router[_0x06b8('0x10')]('/:id/contacts',auth[_0x06b8('0xc')](),controller[_0x06b8('0x12')]);router[_0x06b8('0x13')](_0x06b8('0x14'),auth[_0x06b8('0xc')](),controller[_0x06b8('0x15')]);router[_0x06b8('0x16')]('/:id',auth[_0x06b8('0xc')](),controller['destroy']);module[_0x06b8('0x17')]=router; \ No newline at end of file +var _0xd668=['path','connect-timeout','express','Router','fs-extra','isAuthenticated','index','/describe','describe','get','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','multer'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd668,0x18e));var _0x8d66=function(_0x3e49bc,_0x5c7f4b){_0x3e49bc=_0x3e49bc-0x0;var _0x4a1e40=_0xd668[_0x3e49bc];return _0x4a1e40;};'use strict';var multer=require(_0x8d66('0x0'));var util=require('util');var path=require(_0x8d66('0x1'));var timeout=require(_0x8d66('0x2'));var express=require(_0x8d66('0x3'));var router=express[_0x8d66('0x4')]();var fs_extra=require(_0x8d66('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0x8d66('0x6')](),controller[_0x8d66('0x7')]);router['get'](_0x8d66('0x8'),auth['isAuthenticated'](),controller[_0x8d66('0x9')]);router[_0x8d66('0xa')](_0x8d66('0xb'),auth[_0x8d66('0x6')](),controller['show']);router[_0x8d66('0xa')](_0x8d66('0xc'),auth[_0x8d66('0x6')](),controller[_0x8d66('0xd')]);router[_0x8d66('0xe')]('/',auth[_0x8d66('0x6')](),controller[_0x8d66('0xf')]);router['post'](_0x8d66('0xc'),auth[_0x8d66('0x6')](),controller[_0x8d66('0x10')]);router[_0x8d66('0x11')](_0x8d66('0xb'),auth[_0x8d66('0x6')](),controller[_0x8d66('0x12')]);router[_0x8d66('0x13')](_0x8d66('0xb'),auth['isAuthenticated'](),controller[_0x8d66('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 9b09850..212b058 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 _0x7e87=['DATE','NOW','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x231795,_0x5a2a61){var _0x265c4f=function(_0x26d1d3){while(--_0x26d1d3){_0x231795['push'](_0x231795['shift']());}};_0x265c4f(++_0x5a2a61);}(_0x7e87,0xa3));var _0x77e8=function(_0x20c8d0,_0x218a35){_0x20c8d0=_0x20c8d0-0x0;var _0x37d967=_0x7e87[_0x20c8d0];return _0x37d967;};'use strict';var _=require(_0x77e8('0x0'));var Sequelize=require('sequelize');module[_0x77e8('0x1')]={'firstName':{'type':Sequelize[_0x77e8('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x77e8('0x2')]},'street':{'type':Sequelize[_0x77e8('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x77e8('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77e8('0x3')]},'phone':{'type':Sequelize[_0x77e8('0x2')]},'mobile':{'type':Sequelize[_0x77e8('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x77e8('0x2')]},'url':{'type':Sequelize[_0x77e8('0x2')]},'facebook':{'type':Sequelize[_0x77e8('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x77e8('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x77e8('0x2')]},'line':{'type':Sequelize[_0x77e8('0x2')]},'wechat':{'type':Sequelize[_0x77e8('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x77e8('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x77e8('0x5')],'defaultValue':Sequelize[_0x77e8('0x6')]},'dialTimezone':{'type':Sequelize[_0x77e8('0x2')]},'utcOffset':{'type':Sequelize[_0x77e8('0x4')]}}; \ No newline at end of file +var _0x5baf=['lodash','STRING','INTEGER','DATE','NOW'];(function(_0x27c0af,_0x5b1b2a){var _0x5efc42=function(_0x30fe18){while(--_0x30fe18){_0x27c0af['push'](_0x27c0af['shift']());}};_0x5efc42(++_0x5b1b2a);}(_0x5baf,0x91));var _0xf5ba=function(_0x216f7b,_0x44ad02){_0x216f7b=_0x216f7b-0x0;var _0xe6ed1a=_0x5baf[_0x216f7b];return _0xe6ed1a;};'use strict';var _=require(_0xf5ba('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf5ba('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xf5ba('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf5ba('0x1')]},'url':{'type':Sequelize[_0xf5ba('0x1')]},'facebook':{'type':Sequelize[_0xf5ba('0x1')]},'fb_data':{'type':Sequelize[_0xf5ba('0x1')]},'twitter':{'type':Sequelize[_0xf5ba('0x1')]},'skype':{'type':Sequelize[_0xf5ba('0x1')]},'teams':{'type':Sequelize[_0xf5ba('0x1')]},'viber':{'type':Sequelize[_0xf5ba('0x1')]},'line':{'type':Sequelize[_0xf5ba('0x1')]},'wechat':{'type':Sequelize[_0xf5ba('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xf5ba('0x2')]},'AdditionalPhones':{'type':Sequelize[_0xf5ba('0x1')]},'priority':{'type':Sequelize[_0xf5ba('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf5ba('0x3')],'defaultValue':Sequelize[_0xf5ba('0x4')]},'dialTimezone':{'type':Sequelize['STRING']},'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 e2a146d..e236dc7 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 _0x2689=['MailInteraction','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','spread','contact','all','show','Tags','color','tag','Phones','ItemType','sequelize','literal','format','cf_%d','$and','omit','pickBy','map','isEmpty','table','cm_contacts','setFields','toParam','text','phone','model','Tag','filters','intersection','fields','attributes','order','sort','filter','getTags','nolimit','setTags','findOne','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','ContactItemType','CmHopperId','item','ItemType.OrderBy','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','rawAttributes','pick','include','getHopperHistories','includeAll','rows','getHopperFinals','ContactId','options','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','createReadStream','file','meta','User','agent','binding','../../components/import/cm/csv2','stringify','message','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','type','source','destination','callerid','starttime','endtime','createdAt','userDisposition','userSecondDisposition','UserId','range','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','key','Owner','DESC','browserName','customerIp','customerPort','deviceModel','osName','ratingValue','subject','substatus','openchannel','threadId','Interaction','flatten','reverse','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../config/logger','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','status','set','Content-Range','then','destroy','error','stack','name','send','index','getOptions','findAll','query','user','catch','find','params','describe','keys','length','startsWith','cf_','columnName','displayName','analytics','CmCustomField','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','CmContact','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatMessage','update','ChatOfflineMessage','MailMessage'];(function(_0x2fbbbf,_0x12ea46){var _0x2a9d83=function(_0x1e2ad8){while(--_0x1e2ad8){_0x2fbbbf['push'](_0x2fbbbf['shift']());}};_0x2a9d83(++_0x12ea46);}(_0x2689,0xb8));var _0x9268=function(_0x305a4f,_0x4a73ba){_0x305a4f=_0x305a4f-0x0;var _0x4bf541=_0x2689[_0x305a4f];return _0x4bf541;};'use strict';var moment=require(_0x9268('0x0'));var BPromise=require(_0x9268('0x1'));var util=require(_0x9268('0x2'));var path=require(_0x9268('0x3'));var fs=require('fs');var _=require(_0x9268('0x4'));var squel=require(_0x9268('0x5'));var Papa=require(_0x9268('0x6'));var Redis=require(_0x9268('0x7'));var contacts=require(_0x9268('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x9268('0x9'))('api');var config=require('../../config/environment');var shared=require(_0x9268('0xa'));var db=require(_0x9268('0xb'))['db'];config[_0x9268('0xc')]=_[_0x9268('0xd')](config[_0x9268('0xc')],{'host':_0x9268('0xe'),'port':0x18eb});var socket=require(_0x9268('0xf'))(new Redis(config[_0x9268('0xc')]));require(_0x9268('0x10'))[_0x9268('0x11')](socket);function respondWithResult(_0x4a380d,_0x26ec81){_0x26ec81=_0x26ec81||0xc8;return function(_0xd4b06e){if(_0xd4b06e){return _0x4a380d['status'](_0x26ec81)[_0x9268('0x12')](_0xd4b06e);}};}function respondWithFilteredResult(_0x1419d9,_0x65c628){return function(_0x24c90a){if(_0x24c90a){var _0x257958=typeof _0x65c628[_0x9268('0x13')]===_0x9268('0x14')&&typeof _0x65c628[_0x9268('0x15')]===_0x9268('0x14');var _0x3db36f=_0x24c90a[_0x9268('0x16')];var _0x37c009=_0x257958?0x0:_0x65c628[_0x9268('0x13')];var _0x6a2721=_0x257958?_0x24c90a['count']:_0x65c628[_0x9268('0x13')]+_0x65c628['limit'];var _0x54ed42;if(_0x6a2721>=_0x3db36f){_0x6a2721=_0x3db36f;_0x54ed42=0xc8;}else{_0x54ed42=0xce;}_0x1419d9[_0x9268('0x17')](_0x54ed42);return _0x1419d9[_0x9268('0x18')](_0x9268('0x19'),_0x37c009+'-'+_0x6a2721+'/'+_0x3db36f)[_0x9268('0x12')](_0x24c90a);}return null;};}function saveUpdates(_0x384019){return function(_0x336eea){if(_0x336eea){return _0x336eea['update'](_0x384019)[_0x9268('0x1a')](function(_0x4882cf){return _0x4882cf;});}return null;};}function removeEntity(_0x249662){return function(_0x176de2){if(_0x176de2){return _0x176de2[_0x9268('0x1b')]()[_0x9268('0x1a')](function(){_0x249662[_0x9268('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ac4d){return function(_0x245bee){if(!_0x245bee){_0x41ac4d['sendStatus'](0x194);}return _0x245bee;};}function handleError(_0x16ab48,_0x1ac363){_0x1ac363=_0x1ac363||0x1f4;return function(_0x12e1c9){logger[_0x9268('0x1c')](_0x12e1c9[_0x9268('0x1d')]);if(_0x12e1c9['name']){delete _0x12e1c9[_0x9268('0x1e')];}_0x16ab48[_0x9268('0x17')](_0x1ac363)[_0x9268('0x1f')](_0x12e1c9);};}exports[_0x9268('0x20')]=function(_0x1e5547,_0x1abe53){var _0x3c27eb={};return contacts['describe']()[_0x9268('0x1a')](function(_0x2734d7){_0x3c27eb=qs[_0x9268('0x21')](_0x2734d7,_0x1e5547);return contacts[_0x9268('0x22')](_0x1e5547[_0x9268('0x23')],_0x1e5547[_0x9268('0x24')],_0x3c27eb,_0x2734d7);})[_0x9268('0x1a')](respondWithFilteredResult(_0x1abe53,_0x3c27eb))[_0x9268('0x25')](handleError(_0x1abe53,null));};exports[_0x9268('0x1b')]=function(_0x4ef6ce,_0x11c19e){return db['CmContact'][_0x9268('0x26')]({'where':{'id':_0x4ef6ce[_0x9268('0x27')]['id']}})['then'](handleEntityNotFound(_0x11c19e,null))[_0x9268('0x1a')](removeEntity(_0x11c19e,null))[_0x9268('0x25')](handleError(_0x11c19e,null));};exports['describe']=function(_0x1c58bb,_0x59ffc9){return db['CmContact'][_0x9268('0x28')]()[_0x9268('0x1a')](function(_0x2d27eb){delete _0x2d27eb['tags'];for(var _0x2fcb31=0x0;_0x2fcb310x0){return new Promise(function(_0x57968e){var _0x2fede7=[];for(var _0x44f9c2=0x0;_0x44f9c2<_0x6d9034['length'];_0x44f9c2++){_0x2fede7[_0x9268('0x63')](insertAdditionalPhones(_0x6d9034[_0x44f9c2][_0x9268('0x66')],_0x6d9034[_0x44f9c2]['additionalPhones']));}Promise[_0x9268('0x67')](_0x2fede7)['then'](function(){_0x57968e(0x1);});})['then'](function(){return{'success':_0x5e44c7,'failure':_0x48539a,'duplicates':_0x5f5a34};});}else{return{'success':_0x5e44c7,'failure':_0x48539a,'duplicates':_0x5f5a34};}}})[_0x9268('0x1a')](respondWithResult(_0x2a40f7,0xc9))[_0x9268('0x25')](handleError(_0x2a40f7,null));};exports[_0x9268('0x68')]=function(_0x10ffb5,_0x372793){var _0x13831e;return db[_0x9268('0x3a')][_0x9268('0x28')]()[_0x9268('0x1a')](function(_0x2ae87d){return db['CmContact'][_0x9268('0x26')]({'where':{'id':_0x10ffb5[_0x9268('0x27')]['id']},'include':[{'model':db['Tag'],'as':_0x9268('0x69'),'attributes':['id',_0x9268('0x1e'),_0x9268('0x6a')],'required':_0x10ffb5[_0x9268('0x23')][_0x9268('0x6b')]?!![]:![]},{'model':db[_0x9268('0x4f')],'as':_0x9268('0x6c'),'where':{'CmContactId':_0x10ffb5[_0x9268('0x27')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x9268('0x6d')}]}],'order':[db[_0x9268('0x6e')][_0x9268('0x6f')]('Phones.OrderBy')],'attributes':_[_0x9268('0x29')](_0x2ae87d)});})[_0x9268('0x1a')](function(_0x43f09b){if(!_[_0x9268('0x5a')](_0x43f09b)){_0x13831e=_0x43f09b[_0x9268('0x3b')]({'plain':!![]});var _0x257aa7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x43f09b&&_0x43f09b[_0x9268('0x64')]){if(_0x43f09b[_0x9268('0x64')]){_0x257aa7['where']['$and'][_0x9268('0x63')]({'ListId':{'$ne':_0x43f09b[_0x9268('0x64')]}});}}return db[_0x9268('0x30')]['findAll'](_0x257aa7);}})[_0x9268('0x1a')](function(_0x604a18){if(!_[_0x9268('0x5a')](_0x604a18)){return _['omit'](_0x13831e,_['map'](_0x604a18,function(_0xfaa1f0){return util[_0x9268('0x70')](_0x9268('0x71'),_0xfaa1f0['id']);}));}})[_0x9268('0x1a')](handleEntityNotFound(_0x372793,null))['then'](respondWithResult(_0x372793,null))[_0x9268('0x25')](handleError(_0x372793,null));};exports['update']=function(_0x3d94ae,_0x186ce3){var _0x586cd6;if(_0x3d94ae['body']['id']){delete _0x3d94ae[_0x9268('0x39')]['id'];}if(!_[_0x9268('0x5a')](_0x3d94ae[_0x9268('0x39')][_0x9268('0x5b')])){var _0x96643d=_0x3d94ae[_0x9268('0x39')][_0x9268('0x5b')];if(!_[_0x9268('0x5a')](shared[_0x9268('0x5c')][_0x96643d]))_0x3d94ae[_0x9268('0x39')]['utcOffset']=shared[_0x9268('0x5c')][_0x96643d]['utcOffset'];}return db[_0x9268('0x3a')][_0x9268('0x26')]({'where':{'id':_0x3d94ae[_0x9268('0x27')]['id']}})[_0x9268('0x1a')](handleEntityNotFound(_0x186ce3,null))[_0x9268('0x1a')](saveUpdates(_0x3d94ae[_0x9268('0x39')],null))[_0x9268('0x1a')](function(_0x318ffe){_0x586cd6=_0x318ffe;var _0x33aba3={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x318ffe&&_0x318ffe['ListId']){if(_0x318ffe[_0x9268('0x64')]){_0x33aba3[_0x9268('0x61')][_0x9268('0x72')][_0x9268('0x63')]({'ListId':{'$ne':_0x318ffe['ListId']}});}}return db['CmCustomField'][_0x9268('0x22')](_0x33aba3);})[_0x9268('0x1a')](function(_0x447e66){if(_0x447e66){return _[_0x9268('0x73')](_[_0x9268('0x74')](_0x3d94ae[_0x9268('0x39')],function(_0x54487d,_0x3b19dd){return _[_0x9268('0x2b')](_0x3b19dd,'cf_');}),_[_0x9268('0x75')](_0x447e66,function(_0x86123d){return util['format'](_0x9268('0x71'),_0x86123d['id']);}));}})[_0x9268('0x1a')](function(_0x5e790b){if(_0x5e790b&&!_[_0x9268('0x76')](_0x5e790b)){var _0x4bdaaf=squel['update']()[_0x9268('0x77')](_0x9268('0x78'))[_0x9268('0x79')](_0x5e790b)[_0x9268('0x61')]('id\x20=\x20?',_0x3d94ae[_0x9268('0x27')]['id'])[_0x9268('0x7a')]();return db[_0x9268('0x6e')][_0x9268('0x23')](_0x4bdaaf[_0x9268('0x7b')],{'replacements':_0x4bdaaf[_0x9268('0x33')]});}})[_0x9268('0x1a')](function(){if(_0x3d94ae[_0x9268('0x39')]['phone']&&_0x586cd6){return db[_0x9268('0x42')][_0x9268('0x47')]({'phone':_0x3d94ae[_0x9268('0x39')][_0x9268('0x7c')],'OrderBy':0x0},{'where':{'ContactId':_0x586cd6['id']}});}})[_0x9268('0x1a')](function(){return _0x586cd6;})[_0x9268('0x1a')](respondWithResult(_0x186ce3,null))[_0x9268('0x25')](handleError(_0x186ce3,null));};exports['getTags']=function(_0x417d44,_0x288407){var _0x345c97={};var _0x4a9eec={};var _0x45a341;var _0x3f22dd;return db['CmContact']['findOne']({'where':{'id':_0x417d44[_0x9268('0x27')]['id']}})['then'](handleEntityNotFound(_0x288407,null))[_0x9268('0x1a')](function(_0x4a26ad){if(_0x4a26ad){_0x45a341=_0x4a26ad;_0x4a9eec[_0x9268('0x7d')]=_[_0x9268('0x29')](db[_0x9268('0x7e')]['rawAttributes']);_0x4a9eec[_0x9268('0x23')]=_['keys'](_0x417d44[_0x9268('0x23')]);_0x4a9eec[_0x9268('0x7f')]=_[_0x9268('0x80')](_0x4a9eec[_0x9268('0x7d')],_0x4a9eec[_0x9268('0x23')]);_0x345c97['attributes']=_[_0x9268('0x80')](_0x4a9eec['model'],qs[_0x9268('0x81')](_0x417d44[_0x9268('0x23')]['fields']));_0x345c97[_0x9268('0x82')]=_0x345c97[_0x9268('0x82')][_0x9268('0x2a')]?_0x345c97[_0x9268('0x82')]:_0x4a9eec[_0x9268('0x7d')];_0x345c97[_0x9268('0x83')]=qs[_0x9268('0x84')](_0x417d44[_0x9268('0x23')][_0x9268('0x84')]);_0x345c97['where']=qs[_0x9268('0x7f')](_['pick'](_0x417d44[_0x9268('0x23')],_0x4a9eec[_0x9268('0x7f')]));if(_0x417d44[_0x9268('0x23')][_0x9268('0x85')]){_0x345c97[_0x9268('0x61')]=_[_0x9268('0x38')](_0x345c97[_0x9268('0x61')],{'$or':_[_0x9268('0x75')](_0x345c97[_0x9268('0x82')],function(_0x1bee80){var _0x502074={};_0x502074[_0x1bee80]={'$like':'%'+_0x417d44[_0x9268('0x23')][_0x9268('0x85')]+'%'};return _0x502074;})});}_0x345c97=_['merge']({},_0x345c97,_0x417d44['options']);return _0x45a341[_0x9268('0x86')](_0x345c97);}})['then'](function(_0x345a16){if(_0x345a16){_0x3f22dd=_0x345a16[_0x9268('0x2a')];if(!_0x417d44[_0x9268('0x23')][_0x9268('0x37')](_0x9268('0x87'))){_0x345c97['limit']=qs[_0x9268('0x15')](_0x417d44[_0x9268('0x23')][_0x9268('0x15')]);_0x345c97[_0x9268('0x13')]=qs[_0x9268('0x13')](_0x417d44['query'][_0x9268('0x13')]);}return _0x45a341['getTags'](_0x345c97);}})[_0x9268('0x1a')](function(_0x54683b){if(_0x54683b){return _0x54683b?{'count':_0x3f22dd,'rows':_0x54683b}:null;}})[_0x9268('0x1a')](respondWithResult(_0x288407,null))[_0x9268('0x25')](handleError(_0x288407,null));};exports[_0x9268('0x88')]=function(_0x166a7d,_0x4a4d8d){if(_0x166a7d['body']['id']){delete _0x166a7d['body']['id'];}return db[_0x9268('0x3a')][_0x9268('0x89')]({'where':{'id':_0x166a7d['params']['id']}})[_0x9268('0x1a')](handleEntityNotFound(_0x4a4d8d,null))['then'](function(_0x302445){if(_0x302445){return _0x302445[_0x9268('0x88')](_0x166a7d[_0x9268('0x39')]['ids']||[]);}return null;})[_0x9268('0x1a')](respondWithResult(_0x4a4d8d,null))[_0x9268('0x25')](handleError(_0x4a4d8d,null));};exports['setAdditionalPhones']=function(_0x5a8951,_0x55288c){var _0x2d1a9f=[];_0x2d1a9f[_0x9268('0x63')](addAdditionalPhones(_0x5a8951['body']));Promise['all'](_0x2d1a9f)[_0x9268('0x1a')](function(){_0x2d1a9f=[];_0x2d1a9f[_0x9268('0x63')](deleteCmHopperPhones(_0x5a8951['body']['id']));_0x2d1a9f['push'](addCmHopperPhones(_0x5a8951['body']['id']));Promise[_0x9268('0x67')](_0x2d1a9f)[_0x9268('0x1a')](function(){return[0x1];})['then'](respondWithResult(_0x55288c,null));});};function addAdditionalPhones(_0x4e4894){var _0x348bd1;return new Promise(function(_0x32cceb){return db['CmContactHasItem'][_0x9268('0x1b')]({'where':{'CmContactId':_0x4e4894['id']}})[_0x9268('0x1a')](function(){db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x9268('0x8a')]})[_0x9268('0x1a')](function(_0x2d5e52){var _0x577e5d=[];for(var _0x319579=0x0;_0x319579<_0x4e4894[_0x9268('0x8b')][_0x9268('0x2a')];_0x319579++){var _0x2c75d2=_0x4e4894['item_types']?_[_0x9268('0x5a')](_0x4e4894[_0x9268('0x8c')][_0x319579])?'':_0x4e4894['item_types'][_0x319579]:_0x4e4894[_0x9268('0x8b')][_0x319579][_0x9268('0x8d')]?_0x4e4894[_0x9268('0x8b')][_0x319579][_0x9268('0x8d')]:'';var _0x3442f0=_[_0x9268('0x5a')](_0x4e4894['items'][_0x319579][_0x9268('0x8e')])?'':_0x4e4894[_0x9268('0x8b')][_0x319579]['description'];var _0x30ae9d=_0x2c75d2+':'+_0x4e4894['items'][_0x319579]['phone']+'§'+_0x3442f0;if(_[_0x9268('0x5a')](_0x348bd1))_0x348bd1=_0x30ae9d;else _0x348bd1+=';'+_0x30ae9d;var _0x3a2d92=null;var _0x1d2324=null;if(_0x4e4894[_0x9268('0x8c')]){if(!_[_0x9268('0x5a')](_0x4e4894['item_types'][_0x319579])){_0x1d2324=_['find'](_0x2d5e52,function(_0x565338){return _0x565338['id']===_0x4e4894[_0x9268('0x8c')][_0x319579];});if(!_['isNil'](_0x1d2324)){_0x3a2d92=_0x1d2324['OrderBy'];}}}else{if(!_[_0x9268('0x5a')](_0x4e4894[_0x9268('0x8b')][_0x319579])){_0x1d2324=_[_0x9268('0x26')](_0x2d5e52,function(_0x3d12f7){return _0x3d12f7['id']===_0x4e4894['items'][_0x319579]['ItemTypeId'];});if(!_[_0x9268('0x5a')](_0x1d2324)){_0x3a2d92=_0x319579;}}}if(_[_0x9268('0x5a')](_0x3a2d92)){_0x3a2d92=0x64;}_0x577e5d['push'](addAdditionalPhone(_0x4e4894['id'],_0x4e4894[_0x9268('0x8b')][_0x319579][_0x9268('0x7c')],_0x4e4894[_0x9268('0x8c')]?_['isNil'](_0x4e4894[_0x9268('0x8c')][_0x319579])?null:_0x4e4894[_0x9268('0x8c')][_0x319579]:_0x4e4894['items'][_0x319579][_0x9268('0x8d')]?_0x4e4894[_0x9268('0x8b')][_0x319579][_0x9268('0x8d')]:null,_0x3a2d92,_0x3442f0));}Promise[_0x9268('0x67')](_0x577e5d)[_0x9268('0x1a')](function(){db[_0x9268('0x3a')][_0x9268('0x47')]({'AdditionalPhones':_0x348bd1},{'where':{'id':_0x4e4894['id']}})[_0x9268('0x1a')](function(){_0x32cceb(0x1);});});});});});}function addAdditionalPhone(_0x4995a5,_0x345148,_0x2127b7,_0x4c0e3e,_0x5a5c84){return db[_0x9268('0x4f')][_0x9268('0x26')]({'where':{'CmContactId':_0x4995a5,'item':_0x345148}})['then'](function(_0x4c273f){if(_0x4c273f)logger[_0x9268('0x34')](_0x9268('0x8f'),_0x4c273f);else{db['CmContactHasItem']['create']({'CmContactId':_0x4995a5,'item':_0x345148,'ItemTypeId':_0x2127b7,'OrderBy':_0x4c0e3e,'ItemClass':_0x9268('0x90'),'description':_0x5a5c84});}});}function deleteCmHopperPhones(_0x2fc0b7){return new Promise(function(_0x4e58e9){return db[_0x9268('0x42')][_0x9268('0x22')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2fc0b7}})[_0x9268('0x1a')](function(_0x1ce15d){db[_0x9268('0x91')][_0x9268('0x1b')]({'where':{'CmHopperId':{'$in':_[_0x9268('0x75')](_0x1ce15d,'id')}}});})[_0x9268('0x1a')](function(){_0x4e58e9(0x1);});});}function addCmHopperPhones(_0x1f5e17){return new Promise(function(_0x3dcd59){return db['CmHopper'][_0x9268('0x22')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1f5e17}})[_0x9268('0x1a')](function(_0x4b1dc1){var _0x59427f=[];_[_0x9268('0x75')](_0x4b1dc1,function(_0x37a221){_0x59427f[_0x9268('0x63')](createCmHopperPhone(_0x1f5e17,_0x37a221['id']));});Promise[_0x9268('0x67')](_0x59427f)[_0x9268('0x1a')](function(){_0x3dcd59(0x1);});});});}function createCmHopperPhone(_0x1b2246,_0x18fe96){return new Promise(function(_0x2451e5){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':['item',_0x9268('0x8a')],'where':{'CmContactId':_0x1b2246,'ItemClass':_0x9268('0x90')},'include':[{'model':db[_0x9268('0x92')],'attributes':[_0x9268('0x8a')],'as':_0x9268('0x6d')}],'order':[_0x9268('0x8a'),db[_0x9268('0x6e')][_0x9268('0x6f')]('`ItemType`.OrderBy')]})[_0x9268('0x1a')](function(_0x421a51){var _0x221c2c=0x1;var _0x3e90c0=_[_0x9268('0x75')](_0x421a51,function(_0x3ae8fb){_0x3ae8fb[_0x9268('0x93')]=_0x18fe96;_0x3ae8fb[_0x9268('0x7c')]=_0x3ae8fb[_0x9268('0x94')];_0x3ae8fb['OrderBy']=_0x221c2c;delete _0x3ae8fb[_0x9268('0x95')];_0x221c2c=_0x221c2c+0x1;return _0x3ae8fb;});return db[_0x9268('0x91')][_0x9268('0x5f')](_0x3e90c0,{});})['then'](function(){_0x2451e5(0x1);});});}function insertAdditionalPhones(_0x51a78a,_0x53805b){return new Promise(function(_0x2ebbeb){var _0x21e8e8=[];for(var _0x293f69=0x0;_0x293f69<_0x53805b[_0x9268('0x2a')];_0x293f69++){var _0x10d0c6=_0x53805b[_0x293f69];_0x21e8e8[_0x9268('0x63')](parseContactItemType(_0x10d0c6));}Promise[_0x9268('0x67')](_0x21e8e8)['then'](function(){var _0x2cac5c={'id':_0x51a78a['id'],'items':_0x53805b};return addAdditionalPhones(_0x2cac5c)['then'](function(){return addCmHopperPhones(_0x51a78a['id']);});})[_0x9268('0x1a')](function(){_0x2ebbeb(_0x51a78a);});});}function parseContactItemType(_0x1fb976){return new Promise(function(_0xb5025d){if(_0x1fb976[_0x9268('0x37')]('ItemTypeId')){_0xb5025d(_0x1fb976);}else{return db[_0x9268('0x92')][_0x9268('0x26')]({'where':{'name':_0x1fb976[_0x9268('0x6d')]}})[_0x9268('0x1a')](function(_0x298bf3){if(_[_0x9268('0x5a')](_0x298bf3))_0x1fb976[_0x9268('0x8d')]=null;else _0x1fb976[_0x9268('0x8d')]=_0x298bf3['id'];_0xb5025d(_0x1fb976);});}});}exports[_0x9268('0x96')]=function(_0x420de5,_0x26e425){return db[_0x9268('0x4f')]['findAll']({'raw':!![],'where':{'CmContactId':_0x420de5[_0x9268('0x27')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x9268('0x92')],'as':_0x9268('0x6d')}],'order':[[_0x9268('0x8a')],[db['sequelize'][_0x9268('0x6f')](_0x9268('0x97'))]]})[_0x9268('0x1a')](function(_0x332e6e){return _0x332e6e;})[_0x9268('0x1a')](respondWithResult(_0x26e425,null))[_0x9268('0x25')](handleError(_0x26e425,null));};exports[_0x9268('0x98')]=function(_0x559fc1,_0x485233){return db['CmContactHasItem'][_0x9268('0x22')]({'raw':!![],'where':{'CmContactId':_0x559fc1['body'][_0x9268('0x99')]}})[_0x9268('0x1a')](function(_0x25193e){var _0x482db0=_['map'](_0x25193e,function(_0x4851f7){_0x4851f7[_0x9268('0x9a')]=_0x559fc1['body'][_0x9268('0x9b')];return _0x4851f7;});return db[_0x9268('0x4f')][_0x9268('0x5f')](_0x482db0,{});})[_0x9268('0x1a')](function(){return addCmHopperPhones(_0x559fc1[_0x9268('0x39')][_0x9268('0x9b')]);})['then'](function(){return['ok'];})[_0x9268('0x1a')](respondWithResult(_0x485233,null))[_0x9268('0x25')](handleError(_0x485233,null));};exports[_0x9268('0x9c')]=function(_0xd538f9,_0x43a27a){var _0x5aacaa=[];_0x5aacaa[_0x9268('0x63')](createCmHopperPhone(_0xd538f9['body']['id'],_0xd538f9[_0x9268('0x39')]['hopperId']));Promise[_0x9268('0x67')](_0x5aacaa)[_0x9268('0x1a')](function(){return[0x1];})['then'](respondWithResult(_0x43a27a,null));};exports['getHoppers']=function(_0x21a9c6,_0x4dd1cf){var _0x485c4a={'raw':![],'where':{}};var _0x59075d={};var _0x3a5052={'count':0x0,'rows':[]};return db[_0x9268('0x3a')]['findOne']({'where':{'id':_0x21a9c6['params']['id']}})[_0x9268('0x1a')](handleEntityNotFound(_0x4dd1cf,null))['then'](function(_0x54f648){if(_0x54f648){_0x59075d['model']=_[_0x9268('0x29')](db[_0x9268('0x42')][_0x9268('0x9d')]);_0x59075d[_0x9268('0x23')]=_[_0x9268('0x29')](_0x21a9c6[_0x9268('0x23')]);_0x59075d[_0x9268('0x7f')]=_[_0x9268('0x80')](_0x59075d['model'],_0x59075d['query']);_0x485c4a[_0x9268('0x82')]=_[_0x9268('0x80')](_0x59075d['model'],qs[_0x9268('0x81')](_0x21a9c6[_0x9268('0x23')][_0x9268('0x81')]));_0x485c4a[_0x9268('0x82')]=_0x485c4a[_0x9268('0x82')][_0x9268('0x2a')]?_0x485c4a[_0x9268('0x82')]:_0x59075d[_0x9268('0x7d')];if(!_0x21a9c6[_0x9268('0x23')][_0x9268('0x37')](_0x9268('0x87'))){_0x485c4a['limit']=qs['limit'](_0x21a9c6['query'][_0x9268('0x15')]);_0x485c4a[_0x9268('0x13')]=qs[_0x9268('0x13')](_0x21a9c6[_0x9268('0x23')][_0x9268('0x13')]);}_0x485c4a[_0x9268('0x83')]=qs[_0x9268('0x84')](_0x21a9c6[_0x9268('0x23')]['sort']);_0x485c4a[_0x9268('0x61')]=qs[_0x9268('0x7f')](_[_0x9268('0x9e')](_0x21a9c6[_0x9268('0x23')],_0x59075d[_0x9268('0x7f')]));_0x485c4a['where']['ContactId']=_0x54f648['id'];if(_0x21a9c6[_0x9268('0x23')]['filter']){_0x485c4a[_0x9268('0x61')]=_[_0x9268('0x38')](_0x485c4a[_0x9268('0x61')],{'$or':_[_0x9268('0x75')](_0x485c4a['attributes'],function(_0x3de097){var _0x2f5426={};_0x2f5426[_0x3de097]={'$like':'%'+_0x21a9c6['query']['filter']+'%'};return _0x2f5426;})});}_0x485c4a=_[_0x9268('0x38')]({},_0x485c4a,_0x21a9c6['options']);return db[_0x9268('0x42')][_0x9268('0x16')]({'where':_0x485c4a[_0x9268('0x61')]})[_0x9268('0x1a')](function(_0xeea32){_0x3a5052[_0x9268('0x16')]=_0xeea32;if(_0x21a9c6[_0x9268('0x23')]['includeAll']){_0x485c4a[_0x9268('0x9f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x485c4a);})[_0x9268('0x1a')](function(_0x2be8e5){_0x3a5052['rows']=_0x2be8e5;return _0x3a5052;});}})['then'](respondWithFilteredResult(_0x4dd1cf,_0x485c4a))[_0x9268('0x25')](handleError(_0x4dd1cf,null));};exports[_0x9268('0xa0')]=function(_0xd6d291,_0xecd1ce){var _0xa9d1bc={'raw':!![],'where':{}};var _0x54ea90={};var _0x53fcd1={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0xd6d291[_0x9268('0x27')]['id']}})[_0x9268('0x1a')](handleEntityNotFound(_0xecd1ce,null))[_0x9268('0x1a')](function(_0x5cfc4c){if(_0x5cfc4c){_0x54ea90['model']=_[_0x9268('0x29')](db[_0x9268('0x51')][_0x9268('0x9d')]);_0x54ea90[_0x9268('0x23')]=_[_0x9268('0x29')](_0xd6d291[_0x9268('0x23')]);_0x54ea90[_0x9268('0x7f')]=_[_0x9268('0x80')](_0x54ea90[_0x9268('0x7d')],_0x54ea90['query']);_0xa9d1bc[_0x9268('0x82')]=_[_0x9268('0x80')](_0x54ea90[_0x9268('0x7d')],qs[_0x9268('0x81')](_0xd6d291[_0x9268('0x23')][_0x9268('0x81')]));_0xa9d1bc['attributes']=_0xa9d1bc[_0x9268('0x82')][_0x9268('0x2a')]?_0xa9d1bc['attributes']:_0x54ea90[_0x9268('0x7d')];if(!_0xd6d291[_0x9268('0x23')]['hasOwnProperty']('nolimit')){_0xa9d1bc['limit']=qs[_0x9268('0x15')](_0xd6d291[_0x9268('0x23')]['limit']);_0xa9d1bc['offset']=qs[_0x9268('0x13')](_0xd6d291[_0x9268('0x23')][_0x9268('0x13')]);}_0xa9d1bc[_0x9268('0x83')]=qs[_0x9268('0x84')](_0xd6d291[_0x9268('0x23')][_0x9268('0x84')]);_0xa9d1bc[_0x9268('0x61')]=qs['filters'](_[_0x9268('0x9e')](_0xd6d291[_0x9268('0x23')],_0x54ea90[_0x9268('0x7f')]));_0xa9d1bc[_0x9268('0x61')]['ContactId']=_0x5cfc4c['id'];if(_0xd6d291[_0x9268('0x23')][_0x9268('0x85')]){_0xa9d1bc['where']=_['merge'](_0xa9d1bc[_0x9268('0x61')],{'$or':_[_0x9268('0x75')](_0xa9d1bc[_0x9268('0x82')],function(_0x71fff5){var _0x18c315={};_0x18c315[_0x71fff5]={'$like':'%'+_0xd6d291['query'][_0x9268('0x85')]+'%'};return _0x18c315;})});}_0xa9d1bc=_[_0x9268('0x38')]({},_0xa9d1bc,_0xd6d291['options']);return db[_0x9268('0x51')]['count']({'where':_0xa9d1bc[_0x9268('0x61')]})[_0x9268('0x1a')](function(_0x510435){_0x53fcd1[_0x9268('0x16')]=_0x510435;if(_0xd6d291[_0x9268('0x23')][_0x9268('0xa1')]){_0xa9d1bc[_0x9268('0x9f')]=[{'all':!![]}];}return db[_0x9268('0x51')][_0x9268('0x22')](_0xa9d1bc);})[_0x9268('0x1a')](function(_0x54df5f){_0x53fcd1[_0x9268('0xa2')]=_0x54df5f;return _0x53fcd1;});}})[_0x9268('0x1a')](respondWithFilteredResult(_0xecd1ce,_0xa9d1bc))[_0x9268('0x25')](handleError(_0xecd1ce,null));};exports[_0x9268('0xa3')]=function(_0x2dd589,_0x4ab31b){var _0x4ad450={'raw':!![],'where':{}};var _0x57175d={};var _0x433a60={'count':0x0,'rows':[]};return db[_0x9268('0x3a')][_0x9268('0x89')]({'where':{'id':_0x2dd589[_0x9268('0x27')]['id']}})['then'](handleEntityNotFound(_0x4ab31b,null))['then'](function(_0x8189fd){if(_0x8189fd){_0x57175d['model']=_[_0x9268('0x29')](db['CmHopperFinal'][_0x9268('0x9d')]);_0x57175d['query']=_['keys'](_0x2dd589[_0x9268('0x23')]);_0x57175d[_0x9268('0x7f')]=_[_0x9268('0x80')](_0x57175d['model'],_0x57175d['query']);_0x4ad450['attributes']=_[_0x9268('0x80')](_0x57175d['model'],qs[_0x9268('0x81')](_0x2dd589[_0x9268('0x23')]['fields']));_0x4ad450[_0x9268('0x82')]=_0x4ad450[_0x9268('0x82')][_0x9268('0x2a')]?_0x4ad450['attributes']:_0x57175d[_0x9268('0x7d')];if(!_0x2dd589[_0x9268('0x23')]['hasOwnProperty']('nolimit')){_0x4ad450['limit']=qs[_0x9268('0x15')](_0x2dd589[_0x9268('0x23')][_0x9268('0x15')]);_0x4ad450[_0x9268('0x13')]=qs[_0x9268('0x13')](_0x2dd589[_0x9268('0x23')][_0x9268('0x13')]);}_0x4ad450['order']=qs['sort'](_0x2dd589[_0x9268('0x23')]['sort']);_0x4ad450[_0x9268('0x61')]=qs['filters'](_[_0x9268('0x9e')](_0x2dd589[_0x9268('0x23')],_0x57175d[_0x9268('0x7f')]));_0x4ad450[_0x9268('0x61')][_0x9268('0xa4')]=_0x8189fd['id'];if(_0x2dd589[_0x9268('0x23')]['filter']){_0x4ad450[_0x9268('0x61')]=_['merge'](_0x4ad450[_0x9268('0x61')],{'$or':_[_0x9268('0x75')](_0x4ad450[_0x9268('0x82')],function(_0x3cff2e){var _0x1500ec={};_0x1500ec[_0x3cff2e]={'$like':'%'+_0x2dd589[_0x9268('0x23')][_0x9268('0x85')]+'%'};return _0x1500ec;})});}_0x4ad450=_[_0x9268('0x38')]({},_0x4ad450,_0x2dd589[_0x9268('0xa5')]);return db[_0x9268('0x50')][_0x9268('0x16')]({'where':_0x4ad450['where']})['then'](function(_0x5bb6bf){_0x433a60['count']=_0x5bb6bf;if(_0x2dd589[_0x9268('0x23')][_0x9268('0xa1')]){_0x4ad450[_0x9268('0x9f')]=[{'all':!![]}];}return db[_0x9268('0x50')][_0x9268('0x22')](_0x4ad450);})[_0x9268('0x1a')](function(_0x267e4c){_0x433a60[_0x9268('0xa2')]=_0x267e4c;return _0x433a60;});}})[_0x9268('0x1a')](respondWithFilteredResult(_0x4ab31b,_0x4ad450))[_0x9268('0x25')](handleError(_0x4ab31b,null));};exports[_0x9268('0xa6')]=function(_0x27a061,_0x3d3e31){var _0xb07852={'raw':!![],'where':{}};var _0x4d152b={};var _0x1f10aa={'count':0x0,'rows':[]};return db[_0x9268('0x3a')][_0x9268('0x89')]({'where':{'id':_0x27a061[_0x9268('0x27')]['id']}})[_0x9268('0x1a')](handleEntityNotFound(_0x3d3e31,null))[_0x9268('0x1a')](function(_0x497867){if(_0x497867){_0x4d152b[_0x9268('0x7d')]=_[_0x9268('0x29')](db[_0x9268('0x56')]['rawAttributes']);_0x4d152b[_0x9268('0x23')]=_[_0x9268('0x29')](_0x27a061['query']);_0x4d152b[_0x9268('0x7f')]=_[_0x9268('0x80')](_0x4d152b[_0x9268('0x7d')],_0x4d152b[_0x9268('0x23')]);_0xb07852[_0x9268('0x82')]=_['intersection'](_0x4d152b['model'],qs['fields'](_0x27a061[_0x9268('0x23')][_0x9268('0x81')]));_0xb07852[_0x9268('0x82')]=_0xb07852['attributes']['length']?_0xb07852[_0x9268('0x82')]:_0x4d152b[_0x9268('0x7d')];if(!_0x27a061['query']['hasOwnProperty'](_0x9268('0x87'))){_0xb07852[_0x9268('0x15')]=qs[_0x9268('0x15')](_0x27a061[_0x9268('0x23')][_0x9268('0x15')]);_0xb07852[_0x9268('0x13')]=qs['offset'](_0x27a061[_0x9268('0x23')][_0x9268('0x13')]);}_0xb07852[_0x9268('0x83')]=qs[_0x9268('0x84')](_0x27a061[_0x9268('0x23')][_0x9268('0x84')]);_0xb07852[_0x9268('0x61')]=qs[_0x9268('0x7f')](_[_0x9268('0x9e')](_0x27a061['query'],_0x4d152b[_0x9268('0x7f')]));_0xb07852[_0x9268('0x61')][_0x9268('0xa4')]=_0x497867['id'];if(_0x27a061[_0x9268('0x23')][_0x9268('0x85')]){_0xb07852[_0x9268('0x61')]=_[_0x9268('0x38')](_0xb07852[_0x9268('0x61')],{'$or':_[_0x9268('0x75')](_0xb07852['attributes'],function(_0x38b3d2){var _0x8f5d8={};_0x8f5d8[_0x38b3d2]={'$like':'%'+_0x27a061[_0x9268('0x23')][_0x9268('0x85')]+'%'};return _0x8f5d8;})});}_0xb07852=_[_0x9268('0x38')]({},_0xb07852,_0x27a061[_0x9268('0xa5')]);return db['JscriptySessionReport'][_0x9268('0x16')]({'where':_0xb07852['where']})[_0x9268('0x1a')](function(_0x480eea){_0x1f10aa[_0x9268('0x16')]=_0x480eea;if(_0x27a061['query'][_0x9268('0xa1')]){_0xb07852[_0x9268('0x9f')]=[{'all':!![]}];}return db[_0x9268('0x56')][_0x9268('0x22')](_0xb07852);})[_0x9268('0x1a')](function(_0x16fff5){_0x1f10aa[_0x9268('0xa2')]=_0x16fff5;return _0x1f10aa;});}})['then'](respondWithFilteredResult(_0x3d3e31,_0xb07852))[_0x9268('0x25')](handleError(_0x3d3e31,null));};exports[_0x9268('0xa7')]=function(_0x1f292f,_0x2b9ffe){try{if(!_0x1f292f[_0x9268('0x39')][_0x9268('0x64')]){throw new Error(_0x9268('0xa8'));}if(!_0x1f292f[_0x9268('0x39')][_0x9268('0xa9')]){throw new Error(_0x9268('0xaa'));}if(!_0x1f292f['body'][_0x9268('0xab')]){throw new Error(_0x9268('0xac'));}if(!_0x1f292f[_0x9268('0x39')][_0x9268('0xad')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x5b7e30=_0x1f292f[_0x9268('0x39')][_0x9268('0xa9')][_0x9268('0xae')](',');var _0x43b47a=_0x1f292f[_0x9268('0x39')]['binding_values'][_0x9268('0xae')](',');if(!_0x5b7e30['length']||!_0x43b47a[_0x9268('0x2a')]||_0x5b7e30['length']!==_0x43b47a[_0x9268('0x2a')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x1f292f[_0x9268('0x39')]['fields']=_[_0x9268('0xaf')](_0x5b7e30,_0x43b47a);if(!_0x1f292f[_0x9268('0x39')][_0x9268('0x81')]['phone']){throw new Error(_0x9268('0xb0'));}if(!_0x1f292f['body'][_0x9268('0x81')][_0x9268('0xb1')]){throw new Error(_0x9268('0xb2'));}var _0x5259f7=path[_0x9268('0x3f')](config[_0x9268('0xb3')],_0x9268('0xb4'),_0x1f292f['file'][_0x9268('0xb5')]);fs['chmodSync'](_0x5259f7,parseInt(_0x9268('0xb6'),0x8));var _0x290fbd=require(_0x9268('0xb7'))[_0x9268('0xb8')](path[_0x9268('0x3f')](__dirname,_0x9268('0xb9')),[_0x5259f7,_0x1f292f[_0x9268('0x39')][_0x9268('0xa9')],_0x1f292f[_0x9268('0x39')][_0x9268('0xab')],_0x1f292f[_0x9268('0x39')]['ListId'],_0x1f292f[_0x9268('0x39')][_0x9268('0xba')],_0x1f292f['body'][_0x9268('0x60')],_0x1f292f[_0x9268('0x39')][_0x9268('0xad')]]);return _0x2b9ffe[_0x9268('0x17')](0xc8)[_0x9268('0x12')]({'message':_0x9268('0xbb'),'pid':_0x290fbd['pid']});}catch(_0x11f022){return _0x2b9ffe['status'](0x1f4)[_0x9268('0x1f')](_0x11f022);}};exports['upload']=function(_0x30d748,_0x1cc7fb){var _0x28316f=fs[_0x9268('0xbc')](_0x30d748['file'][_0x9268('0x3')]);Papa['parse'](_0x28316f,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x57c946){return _0x1cc7fb[_0x9268('0x17')](0xc8)[_0x9268('0x12')]({'file':_0x30d748[_0x9268('0xbd')],'fields':_0x57c946[_0x9268('0xbe')][_0x9268('0x81')]});}});};exports['import']=function(_0x33e6f1,_0x31f59d){return db[_0x9268('0xbf')][_0x9268('0x22')]({'raw':!![],'attributes':['id'],'where':{'role':_0x9268('0xc0')}})[_0x9268('0x1a')](function(_0x1efca1){var _0x34d574=![];if(!_0x33e6f1['body']['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x33e6f1[_0x9268('0x39')]['binding'][_0x9268('0x7c')]){throw new Error(_0x9268('0xb0'));}if(!_0x33e6f1[_0x9268('0x39')][_0x9268('0xc1')][_0x9268('0xb1')]){throw new Error(_0x9268('0xb2'));}if(!_0x33e6f1[_0x9268('0x39')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x5d75a2=require(_0x9268('0xb7'))[_0x9268('0xb8')](path['join'](__dirname,_0x9268('0xc2')),[_0x33e6f1[_0x9268('0x27')]['id'],JSON[_0x9268('0xc3')](_0x33e6f1[_0x9268('0x39')]),JSON[_0x9268('0xc3')](_0x1efca1)]);_0x5d75a2['on'](_0x9268('0xc4'),function(){_0x34d574=!![];return _0x31f59d[_0x9268('0x17')](0xc8)[_0x9268('0x12')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x5d75a2[_0x9268('0xc5')]});});_0x5d75a2['on'](_0x9268('0xc6'),function(_0x33d2ad){if(_0x33d2ad&&!_0x34d574){return _0x31f59d[_0x9268('0x17')](0x1f4)['json']({'message':_0x9268('0xc7'),'pid':_0x5d75a2[_0x9268('0xc5')]});}});})[_0x9268('0x25')](handleError(_0x31f59d,null));};exports[_0x9268('0xc8')]=function(_0x40d35,_0x4746f4){return db[_0x9268('0xbf')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x9268('0xc0')}})[_0x9268('0x1a')](function(_0x513291){var _0x2f512b=![];if(!_0x40d35['body'][_0x9268('0x64')]){throw new Error('No\x20ListId\x20specified');}if(!_0x40d35[_0x9268('0x39')][_0x9268('0xc1')][_0x9268('0x7c')]){throw new Error(_0x9268('0xb0'));}if(!_0x40d35['body'][_0x9268('0xc1')][_0x9268('0xb1')]){throw new Error(_0x9268('0xb2'));}if(!_0x40d35[_0x9268('0x39')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1ae9ac=require('child_process')[_0x9268('0xb8')](path[_0x9268('0x3f')](__dirname,_0x9268('0xc9')),[_0x40d35[_0x9268('0x27')]['id'],JSON[_0x9268('0xc3')](_0x40d35[_0x9268('0x39')]),JSON[_0x9268('0xc3')](_0x513291)]);_0x1ae9ac['on'](_0x9268('0xc4'),function(){_0x2f512b=!![];return _0x4746f4[_0x9268('0x17')](0xc8)[_0x9268('0x12')]({'message':_0x9268('0xca'),'pid':_0x1ae9ac[_0x9268('0xc5')]});});_0x1ae9ac['on']('exit',function(_0x3a8649){if(_0x3a8649&&!_0x2f512b){return _0x4746f4[_0x9268('0x17')](0x1f4)['json']({'message':_0x9268('0xc7'),'pid':_0x1ae9ac[_0x9268('0xc5')]});}});})[_0x9268('0x25')](handleError(_0x4746f4,null));};exports[_0x9268('0xcb')]=function(_0x257e3b,_0x13e703){var _0x24f792=[_0x9268('0xcc'),_0x9268('0xcd'),_0x9268('0xce'),'openchannel',_0x9268('0xcf'),_0x9268('0xd0'),_0x9268('0xd1')];var _0x4b3435={'offset':0x0,'order':qs['sort'](_0x9268('0xd2'))},_0x4c2f66={'count':0x0,'rows':[]};Promise[_0x9268('0xd3')]()[_0x9268('0x1a')](function(){if(_0x257e3b[_0x9268('0x23')][_0x9268('0xd4')]){if(!_[_0x9268('0xd5')](_0x24f792,_0x257e3b[_0x9268('0x23')][_0x9268('0xd4')][_0x9268('0xd6')]())){throw new Error('Invalid\x20channel');}_0x24f792=[_0x257e3b[_0x9268('0x23')][_0x9268('0xd4')][_0x9268('0xd6')]()];}if(_0x257e3b[_0x9268('0x23')]['range']){try{var _0x1f26bd=JSON[_0x9268('0xd7')](_0x257e3b[_0x9268('0x23')]['range']);if(!moment(_0x1f26bd[_0x9268('0x41')])[_0x9268('0xd8')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x1f26bd['to'])[_0x9268('0xd8')]()){throw new Error(_0x9268('0xd9'));}}catch(_0x1e3f07){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x257e3b[_0x9268('0x23')][_0x9268('0x37')](_0x9268('0x87'))){_0x4b3435['limit']=qs[_0x9268('0x15')](_0x257e3b[_0x9268('0x23')]['limit']||0xa);_0x4b3435['offset']=qs[_0x9268('0x13')](_0x257e3b['query'][_0x9268('0x13')]);}var _0x346c94=_0x24f792[_0x9268('0x75')](function(_0x4157c7){if(_0x4157c7===_0x9268('0xd1')){var _0x16735a={'attributes':['id',_0x9268('0xda'),_0x9268('0xdb'),_0x9268('0xdc'),_0x9268('0xdd'),_0x9268('0xde'),_0x9268('0xdf'),_0x9268('0xe0'),'duration','note',_0x9268('0xe1'),_0x9268('0xe2'),_0x9268('0xe3'),'userThirdDisposition',_0x9268('0xe4')],'where':{'ContactId':_0x257e3b[_0x9268('0x27')]['id']},'include':[{'model':db[_0x9268('0xbf')],'as':_0x9268('0xbf'),'attributes':['id',_0x9268('0x1e'),'fullname',_0x9268('0x31')]}],'order':[[_0x9268('0xe1'),'DESC']]};if(_0x257e3b['query'][_0x9268('0xe5')]){_0x16735a[_0x9268('0x61')]['createdAt']={'$gte':_0x1f26bd['from'],'$lte':_0x1f26bd['to']};}return db['VoiceCallReport'][_0x9268('0xe6')](_0x16735a)[_0x9268('0x1a')](function(_0x473cf7){_0x4c2f66['count']+=_0x473cf7[_0x9268('0x16')];return _[_0x9268('0x75')](_0x473cf7[_0x9268('0xa2')],function(_0x5d38b5){var _0x4244cd=_0x5d38b5[_0x9268('0x3b')]({'plain':!![]});_0x4244cd[_0x9268('0xd4')]=_0x4157c7;if(_0x4244cd['User']){_0x4244cd['User']={'id':_0x4244cd[_0x9268('0xbf')]['id'],'name':_0x4244cd['User'][_0x9268('0x1e')],'fullname':_0x4244cd['User'][_0x9268('0xe7')],'alias':_0x4244cd[_0x9268('0xbf')]['alias']};}return _0x4244cd;});});}else{var _0x19e63c=_[_0x9268('0xe8')](_0x4157c7)+(_0x4157c7==='chat'?_0x9268('0xe9'):_0x9268('0xea'));var _0x23cb33={'attributes':['id',_0x9268('0xeb'),_0x9268('0xec'),_0x9268('0xe1'),_0x9268('0xed'),_0x9268('0xee'),_0x9268('0xef'),_0x9268('0xf0'),'UserId',_0x19e63c+'Id'],'where':{'ContactId':_0x257e3b['params']['id']},'include':[{'model':db[_0x19e63c],'as':_0x9268('0xea'),'attributes':['id','name',_0x9268('0xf1')]},{'model':db['User'],'as':_0x9268('0xf2'),'attributes':['id',_0x9268('0x1e'),_0x9268('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9268('0x1e'),_0x9268('0x6a')],'through':{'attributes':[]}}],'order':[[_0x9268('0xe1'),_0x9268('0xf3')]]};if(_0x257e3b[_0x9268('0x23')][_0x9268('0xe5')]){_0x23cb33[_0x9268('0x61')][_0x9268('0xe1')]={'$gte':_0x1f26bd[_0x9268('0x41')],'$lte':_0x1f26bd['to']};}switch(_0x4157c7){case _0x9268('0xcd'):_0x23cb33['attributes'][_0x9268('0x63')](_0x9268('0xf4'),_0x9268('0xf5'),_0x9268('0xf6'),_0x9268('0xf7'),_0x9268('0xf8'),'ratingMessage','ratingType',_0x9268('0xf9'),'referer');break;case _0x9268('0xcc'):_0x23cb33[_0x9268('0x82')][_0x9268('0x63')](_0x9268('0xfa'),_0x9268('0xfb'));break;case _0x9268('0xfc'):_0x23cb33[_0x9268('0x82')][_0x9268('0x63')]('externalUrl',_0x9268('0xfd'));break;}return db[_[_0x9268('0xe8')](_0x4157c7)+_0x9268('0xfe')][_0x9268('0xe6')](_0x23cb33)['then'](function(_0x4345c9){_0x4c2f66[_0x9268('0x16')]+=_0x4345c9[_0x9268('0x16')];return _[_0x9268('0x75')](_0x4345c9[_0x9268('0xa2')],function(_0x1e01d6){var _0x157c06=_0x1e01d6[_0x9268('0x3b')]({'plain':!![]});_0x157c06[_0x9268('0xd4')]=_0x4157c7;if(_0x157c06[_0x9268('0xf2')]){_0x157c06[_0x9268('0xf2')]={'id':_0x157c06[_0x9268('0xf2')]['id'],'name':_0x157c06[_0x9268('0xf2')][_0x9268('0x1e')],'fullname':_0x157c06[_0x9268('0xf2')][_0x9268('0xe7')]};}return _0x157c06;});});}});return Promise['all'](_0x346c94);})['then'](function(_0x48c4d2){return _(_0x48c4d2)[_0x9268('0xff')]()['sortBy'](_0x9268('0xe1'))[_0x9268('0x100')]()['value']();})['then'](function(_0x427062){_0x4c2f66[_0x9268('0xa2')]=_0x4b3435[_0x9268('0x15')]?_0x427062[_0x9268('0x101')](_0x4b3435[_0x9268('0x13')],_0x4b3435[_0x9268('0x13')]+_0x4b3435[_0x9268('0x15')]):_0x427062;return _0x4c2f66;})[_0x9268('0x1a')](respondWithFilteredResult(_0x13e703,_0x4b3435))[_0x9268('0x25')](handleError(_0x13e703,null));}; \ No newline at end of file +var _0xab4c=['Tag','color','tag','Phones','params','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','ListId','pickBy','startsWith','isEmpty','table','cm_contacts','id\x20=\x20?','toParam','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','filter','setTags','findOne','ids','setAdditionalPhones','CmContactHasItem','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','nolimit','includeAll','include','rows','getHopperHistories','pick','ContactId','options','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','fork','../../components/import/cm/csv','parse','meta','import','User','agent','binding','No\x20phone\x20column\x20specified','socket_timestamp','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','type','source','callerid','note','userSecondDisposition','userThirdDisposition','UserId','createdAt','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','secondDisposition','thirdDisposition','key','Owner','Tags','DESC','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','referer','mail','substatus','externalUrl','threadId','Interaction','flatten','sortBy','slice','bluebird','util','path','lodash','papaparse','ioredis','../../components/contacts','../../config/logger','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','then','destroy','end','error','stack','name','send','index','describe','findAll','user','CmContact','tags','keys','length','columnName','displayName','analytics','query','CmCustomField','cf_','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','catch','merge','body','from','get','mergeWith','isArray','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','spread','contact','all','show','find'];(function(_0x246767,_0x52315f){var _0x527cef=function(_0x1bcb6a){while(--_0x1bcb6a){_0x246767['push'](_0x246767['shift']());}};_0x527cef(++_0x52315f);}(_0xab4c,0x193));var _0xcab4=function(_0x5c47d8,_0x47eff2){_0x5c47d8=_0x5c47d8-0x0;var _0x5988c7=_0xab4c[_0x5c47d8];return _0x5988c7;};'use strict';var moment=require('moment');var BPromise=require(_0xcab4('0x0'));var util=require(_0xcab4('0x1'));var path=require(_0xcab4('0x2'));var fs=require('fs');var _=require(_0xcab4('0x3'));var squel=require('squel');var Papa=require(_0xcab4('0x4'));var Redis=require(_0xcab4('0x5'));var contacts=require(_0xcab4('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xcab4('0x7'))('api');var config=require('../../config/environment');var shared=require(_0xcab4('0x8'));var db=require(_0xcab4('0x9'))['db'];config[_0xcab4('0xa')]=_[_0xcab4('0xb')](config['redis'],{'host':_0xcab4('0xc'),'port':0x18eb});var socket=require(_0xcab4('0xd'))(new Redis(config[_0xcab4('0xa')]));require(_0xcab4('0xe'))[_0xcab4('0xf')](socket);function respondWithResult(_0x43c4b3,_0x510fad){_0x510fad=_0x510fad||0xc8;return function(_0x354d6d){if(_0x354d6d){return _0x43c4b3[_0xcab4('0x10')](_0x510fad)[_0xcab4('0x11')](_0x354d6d);}};}function respondWithFilteredResult(_0x3d0721,_0x33a7e8){return function(_0x4efaa9){if(_0x4efaa9){var _0x5d995c=typeof _0x33a7e8[_0xcab4('0x12')]===_0xcab4('0x13')&&typeof _0x33a7e8[_0xcab4('0x14')]===_0xcab4('0x13');var _0x302b1e=_0x4efaa9[_0xcab4('0x15')];var _0x3a5603=_0x5d995c?0x0:_0x33a7e8[_0xcab4('0x12')];var _0x55bfeb=_0x5d995c?_0x4efaa9[_0xcab4('0x15')]:_0x33a7e8[_0xcab4('0x12')]+_0x33a7e8[_0xcab4('0x14')];var _0x1f637b;if(_0x55bfeb>=_0x302b1e){_0x55bfeb=_0x302b1e;_0x1f637b=0xc8;}else{_0x1f637b=0xce;}_0x3d0721[_0xcab4('0x10')](_0x1f637b);return _0x3d0721['set'](_0xcab4('0x16'),_0x3a5603+'-'+_0x55bfeb+'/'+_0x302b1e)[_0xcab4('0x11')](_0x4efaa9);}return null;};}function saveUpdates(_0x239537){return function(_0x49bc26){if(_0x49bc26){return _0x49bc26['update'](_0x239537)[_0xcab4('0x17')](function(_0x5d7399){return _0x5d7399;});}return null;};}function removeEntity(_0x16c16c){return function(_0x43e8c8){if(_0x43e8c8){return _0x43e8c8[_0xcab4('0x18')]()[_0xcab4('0x17')](function(){_0x16c16c[_0xcab4('0x10')](0xcc)[_0xcab4('0x19')]();});}};}function handleEntityNotFound(_0x17fa14){return function(_0x4a71bd){if(!_0x4a71bd){_0x17fa14['sendStatus'](0x194);}return _0x4a71bd;};}function handleError(_0x593db9,_0x5c9836){_0x5c9836=_0x5c9836||0x1f4;return function(_0x99d525){logger[_0xcab4('0x1a')](_0x99d525[_0xcab4('0x1b')]);if(_0x99d525[_0xcab4('0x1c')]){delete _0x99d525['name'];}_0x593db9['status'](_0x5c9836)[_0xcab4('0x1d')](_0x99d525);};}exports[_0xcab4('0x1e')]=function(_0x37788a,_0x263699){var _0x4298d2={};return contacts[_0xcab4('0x1f')]()['then'](function(_0xccafdc){_0x4298d2=qs['getOptions'](_0xccafdc,_0x37788a);return contacts[_0xcab4('0x20')](_0x37788a['query'],_0x37788a[_0xcab4('0x21')],_0x4298d2,_0xccafdc);})[_0xcab4('0x17')](respondWithFilteredResult(_0x263699,_0x4298d2))['catch'](handleError(_0x263699,null));};exports[_0xcab4('0x18')]=function(_0xcf7092,_0x27505d){return db[_0xcab4('0x22')]['find']({'where':{'id':_0xcf7092['params']['id']}})[_0xcab4('0x17')](handleEntityNotFound(_0x27505d,null))[_0xcab4('0x17')](removeEntity(_0x27505d,null))['catch'](handleError(_0x27505d,null));};exports[_0xcab4('0x1f')]=function(_0x3b7ea9,_0x3fd8f5){return db[_0xcab4('0x22')][_0xcab4('0x1f')]()[_0xcab4('0x17')](function(_0x5ae84f){delete _0x5ae84f[_0xcab4('0x23')];for(var _0x5d24c7=0x0;_0x5d24c70x0){return new Promise(function(_0x3705f1){var _0x163ec6=[];for(var _0x2394db=0x0;_0x2394db<_0x31d267['length'];_0x2394db++){_0x163ec6[_0xcab4('0x5d')](insertAdditionalPhones(_0x31d267[_0x2394db][_0xcab4('0x5f')],_0x31d267[_0x2394db][_0xcab4('0x57')]));}Promise[_0xcab4('0x60')](_0x163ec6)[_0xcab4('0x17')](function(){_0x3705f1(0x1);});})['then'](function(){return{'success':_0x4baa39,'failure':_0x4ba443,'duplicates':_0x4e55ed};});}else{return{'success':_0x4baa39,'failure':_0x4ba443,'duplicates':_0x4e55ed};}}})[_0xcab4('0x17')](respondWithResult(_0x1e6921,0xc9))['catch'](handleError(_0x1e6921,null));};exports[_0xcab4('0x61')]=function(_0xb35ab8,_0x3404f3){var _0x35946b;return db[_0xcab4('0x22')][_0xcab4('0x1f')]()[_0xcab4('0x17')](function(_0xf7fc32){return db[_0xcab4('0x22')][_0xcab4('0x62')]({'where':{'id':_0xb35ab8['params']['id']},'include':[{'model':db[_0xcab4('0x63')],'as':'Tags','attributes':['id',_0xcab4('0x1c'),_0xcab4('0x64')],'required':_0xb35ab8[_0xcab4('0x29')][_0xcab4('0x65')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0xcab4('0x66'),'where':{'CmContactId':_0xb35ab8[_0xcab4('0x67')]['id']},'required':![],'include':[{'model':db[_0xcab4('0x68')],'as':_0xcab4('0x69')}]}],'order':[db[_0xcab4('0x6a')][_0xcab4('0x6b')](_0xcab4('0x6c'))],'attributes':_[_0xcab4('0x24')](_0xf7fc32)});})[_0xcab4('0x17')](function(_0x515e8c){if(!_['isNil'](_0x515e8c)){_0x35946b=_0x515e8c[_0xcab4('0x37')]({'plain':!![]});var _0x2e7049={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x515e8c&&_0x515e8c['ListId']){if(_0x515e8c['ListId']){_0x2e7049['where'][_0xcab4('0x6d')]['push']({'ListId':{'$ne':_0x515e8c['ListId']}});}}return db[_0xcab4('0x2a')][_0xcab4('0x20')](_0x2e7049);}})[_0xcab4('0x17')](function(_0x26462e){if(!_[_0xcab4('0x53')](_0x26462e)){return _[_0xcab4('0x6e')](_0x35946b,_[_0xcab4('0x6f')](_0x26462e,function(_0x3ce70a){return util[_0xcab4('0x70')]('cf_%d',_0x3ce70a['id']);}));}})[_0xcab4('0x17')](handleEntityNotFound(_0x3404f3,null))[_0xcab4('0x17')](respondWithResult(_0x3404f3,null))[_0xcab4('0x33')](handleError(_0x3404f3,null));};exports[_0xcab4('0x3d')]=function(_0x1540e4,_0x3e8a6e){var _0x5246c0;if(_0x1540e4['body']['id']){delete _0x1540e4['body']['id'];}if(!_[_0xcab4('0x53')](_0x1540e4[_0xcab4('0x35')][_0xcab4('0x54')])){var _0x4723e5=_0x1540e4[_0xcab4('0x35')][_0xcab4('0x54')];if(!_[_0xcab4('0x53')](shared['timezones'][_0x4723e5]))_0x1540e4[_0xcab4('0x35')][_0xcab4('0x56')]=shared['timezones'][_0x4723e5][_0xcab4('0x56')];}return db['CmContact']['find']({'where':{'id':_0x1540e4[_0xcab4('0x67')]['id']}})[_0xcab4('0x17')](handleEntityNotFound(_0x3e8a6e,null))['then'](saveUpdates(_0x1540e4['body'],null))[_0xcab4('0x17')](function(_0x3acba8){_0x5246c0=_0x3acba8;var _0x4d0b63={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3acba8&&_0x3acba8['ListId']){if(_0x3acba8[_0xcab4('0x71')]){_0x4d0b63[_0xcab4('0x5b')]['$and']['push']({'ListId':{'$ne':_0x3acba8[_0xcab4('0x71')]}});}}return db[_0xcab4('0x2a')][_0xcab4('0x20')](_0x4d0b63);})[_0xcab4('0x17')](function(_0x512787){if(_0x512787){return _[_0xcab4('0x6e')](_[_0xcab4('0x72')](_0x1540e4[_0xcab4('0x35')],function(_0x39fad0,_0x94a499){return _[_0xcab4('0x73')](_0x94a499,_0xcab4('0x2b'));}),_[_0xcab4('0x6f')](_0x512787,function(_0x30e841){return util['format']('cf_%d',_0x30e841['id']);}));}})['then'](function(_0x4f03d3){if(_0x4f03d3&&!_[_0xcab4('0x74')](_0x4f03d3)){var _0xd4a339=squel[_0xcab4('0x3d')]()[_0xcab4('0x75')](_0xcab4('0x76'))['setFields'](_0x4f03d3)['where'](_0xcab4('0x77'),_0x1540e4['params']['id'])[_0xcab4('0x78')]();return db[_0xcab4('0x6a')][_0xcab4('0x29')](_0xd4a339['text'],{'replacements':_0xd4a339[_0xcab4('0x2e')]});}})['then'](function(){if(_0x1540e4['body'][_0xcab4('0x79')]&&_0x5246c0){return db[_0xcab4('0x3a')][_0xcab4('0x3d')]({'phone':_0x1540e4[_0xcab4('0x35')][_0xcab4('0x79')],'OrderBy':0x0},{'where':{'ContactId':_0x5246c0['id']}});}})['then'](function(){return _0x5246c0;})[_0xcab4('0x17')](respondWithResult(_0x3e8a6e,null))[_0xcab4('0x33')](handleError(_0x3e8a6e,null));};exports[_0xcab4('0x7a')]=function(_0x1f7041,_0x33c5ab){var _0x55a4b6={};var _0x582a82={};var _0x269875;var _0x35fabf;return db[_0xcab4('0x22')]['findOne']({'where':{'id':_0x1f7041[_0xcab4('0x67')]['id']}})['then'](handleEntityNotFound(_0x33c5ab,null))[_0xcab4('0x17')](function(_0x1bbb79){if(_0x1bbb79){_0x269875=_0x1bbb79;_0x582a82[_0xcab4('0x7b')]=_['keys'](db[_0xcab4('0x63')][_0xcab4('0x7c')]);_0x582a82['query']=_[_0xcab4('0x24')](_0x1f7041[_0xcab4('0x29')]);_0x582a82[_0xcab4('0x7d')]=_[_0xcab4('0x7e')](_0x582a82['model'],_0x582a82['query']);_0x55a4b6[_0xcab4('0x7f')]=_[_0xcab4('0x7e')](_0x582a82[_0xcab4('0x7b')],qs['fields'](_0x1f7041[_0xcab4('0x29')][_0xcab4('0x80')]));_0x55a4b6[_0xcab4('0x7f')]=_0x55a4b6['attributes'][_0xcab4('0x25')]?_0x55a4b6[_0xcab4('0x7f')]:_0x582a82[_0xcab4('0x7b')];_0x55a4b6[_0xcab4('0x81')]=qs[_0xcab4('0x82')](_0x1f7041['query'][_0xcab4('0x82')]);_0x55a4b6[_0xcab4('0x5b')]=qs[_0xcab4('0x7d')](_['pick'](_0x1f7041['query'],_0x582a82[_0xcab4('0x7d')]));if(_0x1f7041[_0xcab4('0x29')]['filter']){_0x55a4b6[_0xcab4('0x5b')]=_[_0xcab4('0x34')](_0x55a4b6[_0xcab4('0x5b')],{'$or':_[_0xcab4('0x6f')](_0x55a4b6[_0xcab4('0x7f')],function(_0x49a6df){var _0x189232={};_0x189232[_0x49a6df]={'$like':'%'+_0x1f7041[_0xcab4('0x29')][_0xcab4('0x83')]+'%'};return _0x189232;})});}_0x55a4b6=_[_0xcab4('0x34')]({},_0x55a4b6,_0x1f7041['options']);return _0x269875[_0xcab4('0x7a')](_0x55a4b6);}})[_0xcab4('0x17')](function(_0x3345e0){if(_0x3345e0){_0x35fabf=_0x3345e0[_0xcab4('0x25')];if(!_0x1f7041['query'][_0xcab4('0x32')]('nolimit')){_0x55a4b6[_0xcab4('0x14')]=qs[_0xcab4('0x14')](_0x1f7041[_0xcab4('0x29')][_0xcab4('0x14')]);_0x55a4b6[_0xcab4('0x12')]=qs['offset'](_0x1f7041['query'][_0xcab4('0x12')]);}return _0x269875[_0xcab4('0x7a')](_0x55a4b6);}})[_0xcab4('0x17')](function(_0x708b0e){if(_0x708b0e){return _0x708b0e?{'count':_0x35fabf,'rows':_0x708b0e}:null;}})[_0xcab4('0x17')](respondWithResult(_0x33c5ab,null))[_0xcab4('0x33')](handleError(_0x33c5ab,null));};exports[_0xcab4('0x84')]=function(_0x473000,_0x5264eb){if(_0x473000['body']['id']){delete _0x473000[_0xcab4('0x35')]['id'];}return db[_0xcab4('0x22')][_0xcab4('0x85')]({'where':{'id':_0x473000[_0xcab4('0x67')]['id']}})[_0xcab4('0x17')](handleEntityNotFound(_0x5264eb,null))['then'](function(_0x49128f){if(_0x49128f){return _0x49128f[_0xcab4('0x84')](_0x473000[_0xcab4('0x35')][_0xcab4('0x86')]||[]);}return null;})[_0xcab4('0x17')](respondWithResult(_0x5264eb,null))[_0xcab4('0x33')](handleError(_0x5264eb,null));};exports[_0xcab4('0x87')]=function(_0x4f4d65,_0x49ee88){var _0x57e7c7=[];_0x57e7c7['push'](addAdditionalPhones(_0x4f4d65['body']));Promise['all'](_0x57e7c7)['then'](function(){_0x57e7c7=[];_0x57e7c7[_0xcab4('0x5d')](deleteCmHopperPhones(_0x4f4d65[_0xcab4('0x35')]['id']));_0x57e7c7[_0xcab4('0x5d')](addCmHopperPhones(_0x4f4d65['body']['id']));Promise[_0xcab4('0x60')](_0x57e7c7)[_0xcab4('0x17')](function(){return[0x1];})[_0xcab4('0x17')](respondWithResult(_0x49ee88,null));});};function addAdditionalPhones(_0x5afb8f){var _0x4db238;return new Promise(function(_0x49e800){return db[_0xcab4('0x88')]['destroy']({'where':{'CmContactId':_0x5afb8f['id']}})[_0xcab4('0x17')](function(){db[_0xcab4('0x68')]['findAll']({'raw':!![],'attributes':['id',_0xcab4('0x89')]})[_0xcab4('0x17')](function(_0x264d37){var _0x428042=[];for(var _0x1e67d9=0x0;_0x1e67d9<_0x5afb8f[_0xcab4('0x8a')][_0xcab4('0x25')];_0x1e67d9++){var _0x24348e=_0x5afb8f[_0xcab4('0x8b')]?_[_0xcab4('0x53')](_0x5afb8f['item_types'][_0x1e67d9])?'':_0x5afb8f[_0xcab4('0x8b')][_0x1e67d9]:_0x5afb8f[_0xcab4('0x8a')][_0x1e67d9][_0xcab4('0x8c')]?_0x5afb8f['items'][_0x1e67d9][_0xcab4('0x8c')]:'';var _0x53b3f5=_[_0xcab4('0x53')](_0x5afb8f['items'][_0x1e67d9][_0xcab4('0x8d')])?'':_0x5afb8f[_0xcab4('0x8a')][_0x1e67d9][_0xcab4('0x8d')];var _0x3790a7=_0x24348e+':'+_0x5afb8f[_0xcab4('0x8a')][_0x1e67d9][_0xcab4('0x79')]+'§'+_0x53b3f5;if(_[_0xcab4('0x53')](_0x4db238))_0x4db238=_0x3790a7;else _0x4db238+=';'+_0x3790a7;var _0x2f29fa=null;var _0x17c3e6=null;if(_0x5afb8f[_0xcab4('0x8b')]){if(!_[_0xcab4('0x53')](_0x5afb8f[_0xcab4('0x8b')][_0x1e67d9])){_0x17c3e6=_[_0xcab4('0x62')](_0x264d37,function(_0x2174dd){return _0x2174dd['id']===_0x5afb8f['item_types'][_0x1e67d9];});if(!_[_0xcab4('0x53')](_0x17c3e6)){_0x2f29fa=_0x17c3e6[_0xcab4('0x89')];}}}else{if(!_[_0xcab4('0x53')](_0x5afb8f['items'][_0x1e67d9])){_0x17c3e6=_['find'](_0x264d37,function(_0x100223){return _0x100223['id']===_0x5afb8f[_0xcab4('0x8a')][_0x1e67d9][_0xcab4('0x8c')];});if(!_[_0xcab4('0x53')](_0x17c3e6)){_0x2f29fa=_0x1e67d9;}}}if(_[_0xcab4('0x53')](_0x2f29fa)){_0x2f29fa=0x64;}_0x428042[_0xcab4('0x5d')](addAdditionalPhone(_0x5afb8f['id'],_0x5afb8f['items'][_0x1e67d9]['phone'],_0x5afb8f[_0xcab4('0x8b')]?_[_0xcab4('0x53')](_0x5afb8f['item_types'][_0x1e67d9])?null:_0x5afb8f[_0xcab4('0x8b')][_0x1e67d9]:_0x5afb8f[_0xcab4('0x8a')][_0x1e67d9][_0xcab4('0x8c')]?_0x5afb8f[_0xcab4('0x8a')][_0x1e67d9][_0xcab4('0x8c')]:null,_0x2f29fa,_0x53b3f5));}Promise[_0xcab4('0x60')](_0x428042)[_0xcab4('0x17')](function(){db['CmContact']['update']({'AdditionalPhones':_0x4db238},{'where':{'id':_0x5afb8f['id']}})['then'](function(){_0x49e800(0x1);});});});});});}function addAdditionalPhone(_0x430ccc,_0x5dacff,_0x3f950c,_0x53b612,_0x1fa68b){return db['CmContactHasItem'][_0xcab4('0x62')]({'where':{'CmContactId':_0x430ccc,'item':_0x5dacff}})[_0xcab4('0x17')](function(_0x4ed4f9){if(_0x4ed4f9)logger[_0xcab4('0x2f')](_0xcab4('0x8e'),_0x4ed4f9);else{db[_0xcab4('0x88')][_0xcab4('0x51')]({'CmContactId':_0x430ccc,'item':_0x5dacff,'ItemTypeId':_0x3f950c,'OrderBy':_0x53b612,'ItemClass':_0xcab4('0x8f'),'description':_0x1fa68b});}});}function deleteCmHopperPhones(_0x4f546d){return new Promise(function(_0x5a34f5){return db[_0xcab4('0x3a')][_0xcab4('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4f546d}})[_0xcab4('0x17')](function(_0x31a37d){db[_0xcab4('0x90')][_0xcab4('0x18')]({'where':{'CmHopperId':{'$in':_[_0xcab4('0x6f')](_0x31a37d,'id')}}});})[_0xcab4('0x17')](function(){_0x5a34f5(0x1);});});}function addCmHopperPhones(_0x43bed6){return new Promise(function(_0x3333d0){return db[_0xcab4('0x3a')][_0xcab4('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x43bed6}})[_0xcab4('0x17')](function(_0x3e2c65){var _0x2fcd93=[];_[_0xcab4('0x6f')](_0x3e2c65,function(_0x42b431){_0x2fcd93['push'](createCmHopperPhone(_0x43bed6,_0x42b431['id']));});Promise[_0xcab4('0x60')](_0x2fcd93)[_0xcab4('0x17')](function(){_0x3333d0(0x1);});});});}function createCmHopperPhone(_0x190eaa,_0x4a2bf8){return new Promise(function(_0x124be3){db[_0xcab4('0x88')][_0xcab4('0x20')]({'raw':!![],'attributes':[_0xcab4('0x91'),'OrderBy'],'where':{'CmContactId':_0x190eaa,'ItemClass':_0xcab4('0x8f')},'include':[{'model':db[_0xcab4('0x68')],'attributes':[_0xcab4('0x89')],'as':'ItemType'}],'order':[_0xcab4('0x89'),db[_0xcab4('0x6a')][_0xcab4('0x6b')](_0xcab4('0x92'))]})[_0xcab4('0x17')](function(_0x110242){var _0x21ef85=0x1;var _0x5ed4c1=_['map'](_0x110242,function(_0x490e4c){_0x490e4c[_0xcab4('0x93')]=_0x4a2bf8;_0x490e4c[_0xcab4('0x79')]=_0x490e4c[_0xcab4('0x91')];_0x490e4c[_0xcab4('0x89')]=_0x21ef85;delete _0x490e4c[_0xcab4('0x94')];_0x21ef85=_0x21ef85+0x1;return _0x490e4c;});return db[_0xcab4('0x90')][_0xcab4('0x58')](_0x5ed4c1,{});})[_0xcab4('0x17')](function(){_0x124be3(0x1);});});}function insertAdditionalPhones(_0x3fa025,_0x3cd9b7){return new Promise(function(_0x16d5fd){var _0x405006=[];for(var _0x519e6c=0x0;_0x519e6c<_0x3cd9b7[_0xcab4('0x25')];_0x519e6c++){var _0x56a29d=_0x3cd9b7[_0x519e6c];_0x405006[_0xcab4('0x5d')](parseContactItemType(_0x56a29d));}Promise['all'](_0x405006)[_0xcab4('0x17')](function(){var _0x35f3c9={'id':_0x3fa025['id'],'items':_0x3cd9b7};return addAdditionalPhones(_0x35f3c9)[_0xcab4('0x17')](function(){return addCmHopperPhones(_0x3fa025['id']);});})[_0xcab4('0x17')](function(){_0x16d5fd(_0x3fa025);});});}function parseContactItemType(_0x4f1f70){return new Promise(function(_0x5886ed){if(_0x4f1f70[_0xcab4('0x32')](_0xcab4('0x8c'))){_0x5886ed(_0x4f1f70);}else{return db[_0xcab4('0x68')]['find']({'where':{'name':_0x4f1f70[_0xcab4('0x69')]}})[_0xcab4('0x17')](function(_0x157154){if(_[_0xcab4('0x53')](_0x157154))_0x4f1f70['ItemTypeId']=null;else _0x4f1f70[_0xcab4('0x8c')]=_0x157154['id'];_0x5886ed(_0x4f1f70);});}});}exports[_0xcab4('0x95')]=function(_0x2f686,_0xd36886){return db['CmContactHasItem'][_0xcab4('0x20')]({'raw':!![],'where':{'CmContactId':_0x2f686[_0xcab4('0x67')]['id'],'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'as':'ItemType'}],'order':[[_0xcab4('0x89')],[db['sequelize']['literal'](_0xcab4('0x92'))]]})[_0xcab4('0x17')](function(_0x9f136f){return _0x9f136f;})[_0xcab4('0x17')](respondWithResult(_0xd36886,null))['catch'](handleError(_0xd36886,null));};exports[_0xcab4('0x96')]=function(_0x1b3dc4,_0x8e7329){return db[_0xcab4('0x88')]['findAll']({'raw':!![],'where':{'CmContactId':_0x1b3dc4[_0xcab4('0x35')]['fromContactId']}})[_0xcab4('0x17')](function(_0x26d883){var _0x4ec9c3=_['map'](_0x26d883,function(_0x233559){_0x233559[_0xcab4('0x97')]=_0x1b3dc4[_0xcab4('0x35')]['toContactId'];return _0x233559;});return db[_0xcab4('0x88')]['bulkCreate'](_0x4ec9c3,{});})[_0xcab4('0x17')](function(){return addCmHopperPhones(_0x1b3dc4[_0xcab4('0x35')][_0xcab4('0x98')]);})[_0xcab4('0x17')](function(){return['ok'];})[_0xcab4('0x17')](respondWithResult(_0x8e7329,null))[_0xcab4('0x33')](handleError(_0x8e7329,null));};exports[_0xcab4('0x99')]=function(_0x4d1376,_0x4e2ef3){var _0x52ec5f=[];_0x52ec5f[_0xcab4('0x5d')](createCmHopperPhone(_0x4d1376[_0xcab4('0x35')]['id'],_0x4d1376['body'][_0xcab4('0x9a')]));Promise['all'](_0x52ec5f)[_0xcab4('0x17')](function(){return[0x1];})[_0xcab4('0x17')](respondWithResult(_0x4e2ef3,null));};exports['getHoppers']=function(_0x3d15e7,_0x346582){var _0x3def9f={'raw':![],'where':{}};var _0x47ee56={};var _0x478e64={'count':0x0,'rows':[]};return db['CmContact'][_0xcab4('0x85')]({'where':{'id':_0x3d15e7[_0xcab4('0x67')]['id']}})[_0xcab4('0x17')](handleEntityNotFound(_0x346582,null))[_0xcab4('0x17')](function(_0x418039){if(_0x418039){_0x47ee56[_0xcab4('0x7b')]=_['keys'](db['CmHopper']['rawAttributes']);_0x47ee56[_0xcab4('0x29')]=_['keys'](_0x3d15e7[_0xcab4('0x29')]);_0x47ee56[_0xcab4('0x7d')]=_[_0xcab4('0x7e')](_0x47ee56[_0xcab4('0x7b')],_0x47ee56['query']);_0x3def9f[_0xcab4('0x7f')]=_[_0xcab4('0x7e')](_0x47ee56[_0xcab4('0x7b')],qs['fields'](_0x3d15e7[_0xcab4('0x29')][_0xcab4('0x80')]));_0x3def9f[_0xcab4('0x7f')]=_0x3def9f[_0xcab4('0x7f')][_0xcab4('0x25')]?_0x3def9f[_0xcab4('0x7f')]:_0x47ee56[_0xcab4('0x7b')];if(!_0x3d15e7[_0xcab4('0x29')]['hasOwnProperty'](_0xcab4('0x9b'))){_0x3def9f['limit']=qs[_0xcab4('0x14')](_0x3d15e7[_0xcab4('0x29')][_0xcab4('0x14')]);_0x3def9f[_0xcab4('0x12')]=qs[_0xcab4('0x12')](_0x3d15e7[_0xcab4('0x29')]['offset']);}_0x3def9f[_0xcab4('0x81')]=qs[_0xcab4('0x82')](_0x3d15e7[_0xcab4('0x29')][_0xcab4('0x82')]);_0x3def9f['where']=qs['filters'](_['pick'](_0x3d15e7[_0xcab4('0x29')],_0x47ee56[_0xcab4('0x7d')]));_0x3def9f[_0xcab4('0x5b')]['ContactId']=_0x418039['id'];if(_0x3d15e7['query'][_0xcab4('0x83')]){_0x3def9f[_0xcab4('0x5b')]=_['merge'](_0x3def9f['where'],{'$or':_[_0xcab4('0x6f')](_0x3def9f['attributes'],function(_0x9081c0){var _0x41d0af={};_0x41d0af[_0x9081c0]={'$like':'%'+_0x3d15e7[_0xcab4('0x29')][_0xcab4('0x83')]+'%'};return _0x41d0af;})});}_0x3def9f=_[_0xcab4('0x34')]({},_0x3def9f,_0x3d15e7['options']);return db[_0xcab4('0x3a')][_0xcab4('0x15')]({'where':_0x3def9f['where']})[_0xcab4('0x17')](function(_0x8208d3){_0x478e64['count']=_0x8208d3;if(_0x3d15e7['query'][_0xcab4('0x9c')]){_0x3def9f[_0xcab4('0x9d')]=[{'all':!![]}];}return db['CmHopper'][_0xcab4('0x20')](_0x3def9f);})['then'](function(_0x3517d0){_0x478e64[_0xcab4('0x9e')]=_0x3517d0;return _0x478e64;});}})[_0xcab4('0x17')](respondWithFilteredResult(_0x346582,_0x3def9f))['catch'](handleError(_0x346582,null));};exports[_0xcab4('0x9f')]=function(_0x114bdb,_0x2596ad){var _0x559399={'raw':!![],'where':{}};var _0x2c3f07={};var _0x352733={'count':0x0,'rows':[]};return db[_0xcab4('0x22')][_0xcab4('0x85')]({'where':{'id':_0x114bdb[_0xcab4('0x67')]['id']}})['then'](handleEntityNotFound(_0x2596ad,null))[_0xcab4('0x17')](function(_0x49bacc){if(_0x49bacc){_0x2c3f07[_0xcab4('0x7b')]=_[_0xcab4('0x24')](db[_0xcab4('0x47')][_0xcab4('0x7c')]);_0x2c3f07[_0xcab4('0x29')]=_[_0xcab4('0x24')](_0x114bdb[_0xcab4('0x29')]);_0x2c3f07['filters']=_[_0xcab4('0x7e')](_0x2c3f07[_0xcab4('0x7b')],_0x2c3f07[_0xcab4('0x29')]);_0x559399['attributes']=_[_0xcab4('0x7e')](_0x2c3f07[_0xcab4('0x7b')],qs[_0xcab4('0x80')](_0x114bdb[_0xcab4('0x29')][_0xcab4('0x80')]));_0x559399['attributes']=_0x559399[_0xcab4('0x7f')]['length']?_0x559399[_0xcab4('0x7f')]:_0x2c3f07[_0xcab4('0x7b')];if(!_0x114bdb[_0xcab4('0x29')][_0xcab4('0x32')](_0xcab4('0x9b'))){_0x559399[_0xcab4('0x14')]=qs[_0xcab4('0x14')](_0x114bdb['query'][_0xcab4('0x14')]);_0x559399[_0xcab4('0x12')]=qs[_0xcab4('0x12')](_0x114bdb[_0xcab4('0x29')][_0xcab4('0x12')]);}_0x559399['order']=qs['sort'](_0x114bdb[_0xcab4('0x29')]['sort']);_0x559399[_0xcab4('0x5b')]=qs[_0xcab4('0x7d')](_[_0xcab4('0xa0')](_0x114bdb[_0xcab4('0x29')],_0x2c3f07[_0xcab4('0x7d')]));_0x559399['where'][_0xcab4('0xa1')]=_0x49bacc['id'];if(_0x114bdb[_0xcab4('0x29')][_0xcab4('0x83')]){_0x559399[_0xcab4('0x5b')]=_[_0xcab4('0x34')](_0x559399[_0xcab4('0x5b')],{'$or':_['map'](_0x559399[_0xcab4('0x7f')],function(_0x214296){var _0x2e0f05={};_0x2e0f05[_0x214296]={'$like':'%'+_0x114bdb['query'][_0xcab4('0x83')]+'%'};return _0x2e0f05;})});}_0x559399=_[_0xcab4('0x34')]({},_0x559399,_0x114bdb[_0xcab4('0xa2')]);return db[_0xcab4('0x47')][_0xcab4('0x15')]({'where':_0x559399[_0xcab4('0x5b')]})['then'](function(_0x2dc14a){_0x352733[_0xcab4('0x15')]=_0x2dc14a;if(_0x114bdb['query']['includeAll']){_0x559399[_0xcab4('0x9d')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x559399);})[_0xcab4('0x17')](function(_0x2e20d3){_0x352733[_0xcab4('0x9e')]=_0x2e20d3;return _0x352733;});}})[_0xcab4('0x17')](respondWithFilteredResult(_0x2596ad,_0x559399))[_0xcab4('0x33')](handleError(_0x2596ad,null));};exports[_0xcab4('0xa3')]=function(_0x2d9654,_0x149b9a){var _0x29ee7f={'raw':!![],'where':{}};var _0x2d473d={};var _0x3cde1c={'count':0x0,'rows':[]};return db[_0xcab4('0x22')][_0xcab4('0x85')]({'where':{'id':_0x2d9654[_0xcab4('0x67')]['id']}})[_0xcab4('0x17')](handleEntityNotFound(_0x149b9a,null))[_0xcab4('0x17')](function(_0x25d6c2){if(_0x25d6c2){_0x2d473d[_0xcab4('0x7b')]=_['keys'](db[_0xcab4('0x46')][_0xcab4('0x7c')]);_0x2d473d[_0xcab4('0x29')]=_[_0xcab4('0x24')](_0x2d9654[_0xcab4('0x29')]);_0x2d473d[_0xcab4('0x7d')]=_['intersection'](_0x2d473d[_0xcab4('0x7b')],_0x2d473d[_0xcab4('0x29')]);_0x29ee7f[_0xcab4('0x7f')]=_[_0xcab4('0x7e')](_0x2d473d[_0xcab4('0x7b')],qs[_0xcab4('0x80')](_0x2d9654[_0xcab4('0x29')][_0xcab4('0x80')]));_0x29ee7f[_0xcab4('0x7f')]=_0x29ee7f[_0xcab4('0x7f')][_0xcab4('0x25')]?_0x29ee7f['attributes']:_0x2d473d['model'];if(!_0x2d9654[_0xcab4('0x29')]['hasOwnProperty'](_0xcab4('0x9b'))){_0x29ee7f[_0xcab4('0x14')]=qs[_0xcab4('0x14')](_0x2d9654['query'][_0xcab4('0x14')]);_0x29ee7f[_0xcab4('0x12')]=qs['offset'](_0x2d9654[_0xcab4('0x29')][_0xcab4('0x12')]);}_0x29ee7f['order']=qs[_0xcab4('0x82')](_0x2d9654['query']['sort']);_0x29ee7f[_0xcab4('0x5b')]=qs['filters'](_[_0xcab4('0xa0')](_0x2d9654['query'],_0x2d473d[_0xcab4('0x7d')]));_0x29ee7f[_0xcab4('0x5b')]['ContactId']=_0x25d6c2['id'];if(_0x2d9654[_0xcab4('0x29')][_0xcab4('0x83')]){_0x29ee7f[_0xcab4('0x5b')]=_[_0xcab4('0x34')](_0x29ee7f[_0xcab4('0x5b')],{'$or':_[_0xcab4('0x6f')](_0x29ee7f[_0xcab4('0x7f')],function(_0x87ff46){var _0x23ed9f={};_0x23ed9f[_0x87ff46]={'$like':'%'+_0x2d9654[_0xcab4('0x29')][_0xcab4('0x83')]+'%'};return _0x23ed9f;})});}_0x29ee7f=_['merge']({},_0x29ee7f,_0x2d9654['options']);return db[_0xcab4('0x46')]['count']({'where':_0x29ee7f['where']})[_0xcab4('0x17')](function(_0x37423d){_0x3cde1c[_0xcab4('0x15')]=_0x37423d;if(_0x2d9654[_0xcab4('0x29')][_0xcab4('0x9c')]){_0x29ee7f['include']=[{'all':!![]}];}return db[_0xcab4('0x46')][_0xcab4('0x20')](_0x29ee7f);})[_0xcab4('0x17')](function(_0x5e8de8){_0x3cde1c[_0xcab4('0x9e')]=_0x5e8de8;return _0x3cde1c;});}})[_0xcab4('0x17')](respondWithFilteredResult(_0x149b9a,_0x29ee7f))[_0xcab4('0x33')](handleError(_0x149b9a,null));};exports[_0xcab4('0xa4')]=function(_0x1d0716,_0x305c8c){var _0x20a672={'raw':!![],'where':{}};var _0x4ec7a9={};var _0x4d051c={'count':0x0,'rows':[]};return db[_0xcab4('0x22')][_0xcab4('0x85')]({'where':{'id':_0x1d0716[_0xcab4('0x67')]['id']}})[_0xcab4('0x17')](handleEntityNotFound(_0x305c8c,null))[_0xcab4('0x17')](function(_0x2605fc){if(_0x2605fc){_0x4ec7a9[_0xcab4('0x7b')]=_['keys'](db[_0xcab4('0x4e')][_0xcab4('0x7c')]);_0x4ec7a9['query']=_[_0xcab4('0x24')](_0x1d0716[_0xcab4('0x29')]);_0x4ec7a9[_0xcab4('0x7d')]=_['intersection'](_0x4ec7a9[_0xcab4('0x7b')],_0x4ec7a9[_0xcab4('0x29')]);_0x20a672[_0xcab4('0x7f')]=_[_0xcab4('0x7e')](_0x4ec7a9[_0xcab4('0x7b')],qs[_0xcab4('0x80')](_0x1d0716[_0xcab4('0x29')][_0xcab4('0x80')]));_0x20a672['attributes']=_0x20a672[_0xcab4('0x7f')][_0xcab4('0x25')]?_0x20a672[_0xcab4('0x7f')]:_0x4ec7a9[_0xcab4('0x7b')];if(!_0x1d0716[_0xcab4('0x29')][_0xcab4('0x32')](_0xcab4('0x9b'))){_0x20a672['limit']=qs[_0xcab4('0x14')](_0x1d0716['query'][_0xcab4('0x14')]);_0x20a672['offset']=qs[_0xcab4('0x12')](_0x1d0716[_0xcab4('0x29')][_0xcab4('0x12')]);}_0x20a672[_0xcab4('0x81')]=qs[_0xcab4('0x82')](_0x1d0716[_0xcab4('0x29')][_0xcab4('0x82')]);_0x20a672[_0xcab4('0x5b')]=qs[_0xcab4('0x7d')](_[_0xcab4('0xa0')](_0x1d0716[_0xcab4('0x29')],_0x4ec7a9[_0xcab4('0x7d')]));_0x20a672[_0xcab4('0x5b')][_0xcab4('0xa1')]=_0x2605fc['id'];if(_0x1d0716['query'][_0xcab4('0x83')]){_0x20a672[_0xcab4('0x5b')]=_[_0xcab4('0x34')](_0x20a672[_0xcab4('0x5b')],{'$or':_[_0xcab4('0x6f')](_0x20a672[_0xcab4('0x7f')],function(_0x15897b){var _0x9daf2d={};_0x9daf2d[_0x15897b]={'$like':'%'+_0x1d0716['query'][_0xcab4('0x83')]+'%'};return _0x9daf2d;})});}_0x20a672=_['merge']({},_0x20a672,_0x1d0716['options']);return db[_0xcab4('0x4e')]['count']({'where':_0x20a672['where']})[_0xcab4('0x17')](function(_0x41bd1c){_0x4d051c[_0xcab4('0x15')]=_0x41bd1c;if(_0x1d0716[_0xcab4('0x29')][_0xcab4('0x9c')]){_0x20a672[_0xcab4('0x9d')]=[{'all':!![]}];}return db[_0xcab4('0x4e')][_0xcab4('0x20')](_0x20a672);})['then'](function(_0x34ace2){_0x4d051c[_0xcab4('0x9e')]=_0x34ace2;return _0x4d051c;});}})[_0xcab4('0x17')](respondWithFilteredResult(_0x305c8c,_0x20a672))[_0xcab4('0x33')](handleError(_0x305c8c,null));};exports['uploadCsv']=function(_0x505b90,_0x6f53b6){try{if(!_0x505b90[_0xcab4('0x35')]['ListId']){throw new Error(_0xcab4('0xa5'));}if(!_0x505b90[_0xcab4('0x35')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x505b90[_0xcab4('0x35')][_0xcab4('0xa6')]){throw new Error(_0xcab4('0xa7'));}if(!_0x505b90[_0xcab4('0x35')]['socket_timestamp']){throw new Error(_0xcab4('0xa8'));}var _0x3b4f71=_0x505b90[_0xcab4('0x35')][_0xcab4('0xa9')][_0xcab4('0xaa')](',');var _0x1afe5b=_0x505b90[_0xcab4('0x35')][_0xcab4('0xa6')][_0xcab4('0xaa')](',');if(!_0x3b4f71['length']||!_0x1afe5b[_0xcab4('0x25')]||_0x3b4f71[_0xcab4('0x25')]!==_0x1afe5b[_0xcab4('0x25')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x505b90['body'][_0xcab4('0x80')]=_[_0xcab4('0xab')](_0x3b4f71,_0x1afe5b);if(!_0x505b90[_0xcab4('0x35')]['fields'][_0xcab4('0x79')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x505b90[_0xcab4('0x35')]['fields'][_0xcab4('0xac')]){throw new Error(_0xcab4('0xad'));}var _0x368ab0=path[_0xcab4('0x52')](config[_0xcab4('0xae')],_0xcab4('0xaf'),_0x505b90[_0xcab4('0xb0')][_0xcab4('0xb1')]);fs['chmodSync'](_0x368ab0,parseInt(_0xcab4('0xb2'),0x8));var _0x467741=require('child_process')[_0xcab4('0xb3')](path[_0xcab4('0x52')](__dirname,_0xcab4('0xb4')),[_0x368ab0,_0x505b90[_0xcab4('0x35')][_0xcab4('0xa9')],_0x505b90[_0xcab4('0x35')]['binding_values'],_0x505b90[_0xcab4('0x35')]['ListId'],_0x505b90['body']['CompanyId'],_0x505b90[_0xcab4('0x35')]['duplicates'],_0x505b90[_0xcab4('0x35')]['socket_timestamp']]);return _0x6f53b6['status'](0xc8)[_0xcab4('0x11')]({'message':'File\x20uploaded\x20correctly!','pid':_0x467741['pid']});}catch(_0x176918){return _0x6f53b6['status'](0x1f4)['send'](_0x176918);}};exports['upload']=function(_0x467433,_0x59d4d2){var _0x314ee5=fs['createReadStream'](_0x467433[_0xcab4('0xb0')]['path']);Papa[_0xcab4('0xb5')](_0x314ee5,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x475696){return _0x59d4d2['status'](0xc8)['json']({'file':_0x467433[_0xcab4('0xb0')],'fields':_0x475696[_0xcab4('0xb6')][_0xcab4('0x80')]});}});};exports[_0xcab4('0xb7')]=function(_0x4fb937,_0xa9062f){return db[_0xcab4('0xb8')][_0xcab4('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0xcab4('0xb9')}})[_0xcab4('0x17')](function(_0x2e1163){var _0x46c967=![];if(!_0x4fb937['body'][_0xcab4('0x71')]){throw new Error(_0xcab4('0xa5'));}if(!_0x4fb937[_0xcab4('0x35')][_0xcab4('0xba')][_0xcab4('0x79')]){throw new Error(_0xcab4('0xbb'));}if(!_0x4fb937['body'][_0xcab4('0xba')][_0xcab4('0xac')]){throw new Error(_0xcab4('0xad'));}if(!_0x4fb937['body'][_0xcab4('0xbc')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x49b54f=require(_0xcab4('0xbd'))[_0xcab4('0xb3')](path[_0xcab4('0x52')](__dirname,_0xcab4('0xbe')),[_0x4fb937[_0xcab4('0x67')]['id'],JSON[_0xcab4('0xbf')](_0x4fb937['body']),JSON['stringify'](_0x2e1163)]);_0x49b54f['on'](_0xcab4('0xc0'),function(){_0x46c967=!![];return _0xa9062f[_0xcab4('0x10')](0xc8)[_0xcab4('0x11')]({'message':_0xcab4('0xc1'),'pid':_0x49b54f[_0xcab4('0xc2')]});});_0x49b54f['on'](_0xcab4('0xc3'),function(_0x4ba7b3){if(_0x4ba7b3&&!_0x46c967){return _0xa9062f[_0xcab4('0x10')](0x1f4)[_0xcab4('0x11')]({'message':_0xcab4('0xc4'),'pid':_0x49b54f['pid']});}});})[_0xcab4('0x33')](handleError(_0xa9062f,null));};exports[_0xcab4('0xc5')]=function(_0x1a7265,_0x3003c6){return db['User'][_0xcab4('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xcab4('0x17')](function(_0x801a61){var _0x1f7d1a=![];if(!_0x1a7265[_0xcab4('0x35')][_0xcab4('0x71')]){throw new Error(_0xcab4('0xa5'));}if(!_0x1a7265[_0xcab4('0x35')][_0xcab4('0xba')][_0xcab4('0x79')]){throw new Error(_0xcab4('0xbb'));}if(!_0x1a7265[_0xcab4('0x35')][_0xcab4('0xba')]['firstName']){throw new Error(_0xcab4('0xad'));}if(!_0x1a7265[_0xcab4('0x35')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x179826=require(_0xcab4('0xbd'))[_0xcab4('0xb3')](path[_0xcab4('0x52')](__dirname,_0xcab4('0xc6')),[_0x1a7265[_0xcab4('0x67')]['id'],JSON[_0xcab4('0xbf')](_0x1a7265[_0xcab4('0x35')]),JSON[_0xcab4('0xbf')](_0x801a61)]);_0x179826['on'](_0xcab4('0xc0'),function(){_0x1f7d1a=!![];return _0x3003c6[_0xcab4('0x10')](0xc8)[_0xcab4('0x11')]({'message':_0xcab4('0xc1'),'pid':_0x179826[_0xcab4('0xc2')]});});_0x179826['on'](_0xcab4('0xc3'),function(_0x10ac4b){if(_0x10ac4b&&!_0x1f7d1a){return _0x3003c6[_0xcab4('0x10')](0x1f4)['json']({'message':_0xcab4('0xc4'),'pid':_0x179826[_0xcab4('0xc2')]});}});})[_0xcab4('0x33')](handleError(_0x3003c6,null));};exports[_0xcab4('0xc7')]=function(_0x2c418e,_0x30fccc){var _0x1d1878=['mail',_0xcab4('0xc8'),_0xcab4('0xc9'),_0xcab4('0xca'),_0xcab4('0xcb'),_0xcab4('0xcc'),_0xcab4('0xcd')];var _0x25ecf8={'offset':0x0,'order':qs[_0xcab4('0x82')](_0xcab4('0xce'))},_0x15ab4b={'count':0x0,'rows':[]};Promise['resolve']()[_0xcab4('0x17')](function(){if(_0x2c418e[_0xcab4('0x29')][_0xcab4('0xcf')]){if(!_[_0xcab4('0xd0')](_0x1d1878,_0x2c418e['query']['channel'][_0xcab4('0xd1')]())){throw new Error('Invalid\x20channel');}_0x1d1878=[_0x2c418e[_0xcab4('0x29')][_0xcab4('0xcf')][_0xcab4('0xd1')]()];}if(_0x2c418e[_0xcab4('0x29')][_0xcab4('0xd2')]){try{var _0x431048=JSON[_0xcab4('0xb5')](_0x2c418e[_0xcab4('0x29')][_0xcab4('0xd2')]);if(!moment(_0x431048[_0xcab4('0x36')])[_0xcab4('0xd3')]()){throw new Error(_0xcab4('0xd4'));}if(!moment(_0x431048['to'])[_0xcab4('0xd3')]()){throw new Error(_0xcab4('0xd5'));}}catch(_0x4c61b0){throw new Error(_0xcab4('0xd6'));}}if(!_0x2c418e[_0xcab4('0x29')][_0xcab4('0x32')](_0xcab4('0x9b'))){_0x25ecf8['limit']=qs[_0xcab4('0x14')](_0x2c418e[_0xcab4('0x29')]['limit']||0xa);_0x25ecf8['offset']=qs[_0xcab4('0x12')](_0x2c418e[_0xcab4('0x29')]['offset']);}var _0x6473a9=_0x1d1878[_0xcab4('0x6f')](function(_0xf8e47b){if(_0xf8e47b===_0xcab4('0xcd')){var _0x502d34={'attributes':['id','uniqueid',_0xcab4('0xd7'),_0xcab4('0xd8'),'destination',_0xcab4('0xd9'),'starttime','endtime','duration',_0xcab4('0xda'),'createdAt','userDisposition',_0xcab4('0xdb'),_0xcab4('0xdc'),_0xcab4('0xdd')],'where':{'ContactId':_0x2c418e[_0xcab4('0x67')]['id']},'include':[{'model':db['User'],'as':_0xcab4('0xb8'),'attributes':['id',_0xcab4('0x1c'),'fullname',_0xcab4('0x2c')]}],'order':[[_0xcab4('0xde'),'DESC']]};if(_0x2c418e[_0xcab4('0x29')][_0xcab4('0xd2')]){_0x502d34['where'][_0xcab4('0xde')]={'$gte':_0x431048['from'],'$lte':_0x431048['to']};}return db['VoiceCallReport'][_0xcab4('0xdf')](_0x502d34)['then'](function(_0x56c75d){_0x15ab4b['count']+=_0x56c75d[_0xcab4('0x15')];return _[_0xcab4('0x6f')](_0x56c75d[_0xcab4('0x9e')],function(_0x179657){var _0x523131=_0x179657[_0xcab4('0x37')]({'plain':!![]});_0x523131[_0xcab4('0xcf')]=_0xf8e47b;if(_0x523131['User']){_0x523131['User']={'id':_0x523131[_0xcab4('0xb8')]['id'],'name':_0x523131[_0xcab4('0xb8')][_0xcab4('0x1c')],'fullname':_0x523131[_0xcab4('0xb8')][_0xcab4('0xe0')],'alias':_0x523131[_0xcab4('0xb8')][_0xcab4('0x2c')]};}return _0x523131;});});}else{var _0x5e2816=_[_0xcab4('0xe1')](_0xf8e47b)+(_0xf8e47b===_0xcab4('0xc8')?_0xcab4('0xe2'):_0xcab4('0xe3'));var _0x1652f1={'attributes':['id',_0xcab4('0xe4'),_0xcab4('0xe5'),_0xcab4('0xde'),'note','disposition',_0xcab4('0xe6'),_0xcab4('0xe7'),_0xcab4('0xdd'),_0x5e2816+'Id'],'where':{'ContactId':_0x2c418e[_0xcab4('0x67')]['id']},'include':[{'model':db[_0x5e2816],'as':_0xcab4('0xe3'),'attributes':['id',_0xcab4('0x1c'),_0xcab4('0xe8')]},{'model':db['User'],'as':_0xcab4('0xe9'),'attributes':['id',_0xcab4('0x1c'),'fullname']},{'model':db[_0xcab4('0x63')],'as':_0xcab4('0xea'),'attributes':['id',_0xcab4('0x1c'),_0xcab4('0x64')],'through':{'attributes':[]}}],'order':[[_0xcab4('0xde'),_0xcab4('0xeb')]]};if(_0x2c418e[_0xcab4('0x29')][_0xcab4('0xd2')]){_0x1652f1[_0xcab4('0x5b')][_0xcab4('0xde')]={'$gte':_0x431048[_0xcab4('0x36')],'$lte':_0x431048['to']};}switch(_0xf8e47b){case'chat':_0x1652f1['attributes']['push'](_0xcab4('0xec'),_0xcab4('0xed'),_0xcab4('0xee'),_0xcab4('0xef'),'osName',_0xcab4('0xf0'),_0xcab4('0xf1'),'ratingValue',_0xcab4('0xf2'));break;case _0xcab4('0xf3'):_0x1652f1[_0xcab4('0x7f')][_0xcab4('0x5d')]('subject',_0xcab4('0xf4'));break;case'openchannel':_0x1652f1[_0xcab4('0x7f')][_0xcab4('0x5d')](_0xcab4('0xf5'),_0xcab4('0xf6'));break;}return db[_[_0xcab4('0xe1')](_0xf8e47b)+_0xcab4('0xf7')][_0xcab4('0xdf')](_0x1652f1)['then'](function(_0x1ee1a3){_0x15ab4b['count']+=_0x1ee1a3[_0xcab4('0x15')];return _['map'](_0x1ee1a3['rows'],function(_0x3d7641){var _0xf3f000=_0x3d7641[_0xcab4('0x37')]({'plain':!![]});_0xf3f000[_0xcab4('0xcf')]=_0xf8e47b;if(_0xf3f000[_0xcab4('0xe9')]){_0xf3f000[_0xcab4('0xe9')]={'id':_0xf3f000[_0xcab4('0xe9')]['id'],'name':_0xf3f000['Owner']['name'],'fullname':_0xf3f000[_0xcab4('0xe9')]['fullname']};}return _0xf3f000;});});}});return Promise[_0xcab4('0x60')](_0x6473a9);})['then'](function(_0x49c224){return _(_0x49c224)[_0xcab4('0xf8')]()[_0xcab4('0xf9')](_0xcab4('0xde'))['reverse']()['value']();})['then'](function(_0x26e3e1){_0x15ab4b[_0xcab4('0x9e')]=_0x25ecf8[_0xcab4('0x14')]?_0x26e3e1[_0xcab4('0xfa')](_0x25ecf8['offset'],_0x25ecf8[_0xcab4('0x12')]+_0x25ecf8[_0xcab4('0x14')]):_0x26e3e1;return _0x15ab4b;})[_0xcab4('0x17')](respondWithFilteredResult(_0x30fccc,_0x25ecf8))[_0xcab4('0x33')](handleError(_0x30fccc,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index ac98184..772240b 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 _0x72db=['emit','hook','events','../../mysqldb','CmContact','save','update'];(function(_0x2a3511,_0x5acdb3){var _0x5b4744=function(_0x8a9ee4){while(--_0x8a9ee4){_0x2a3511['push'](_0x2a3511['shift']());}};_0x5b4744(++_0x5acdb3);}(_0x72db,0x12f));var _0xb72d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72db[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xb72d('0x0'));var CmContact=require(_0xb72d('0x1'))['db'][_0xb72d('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb72d('0x3'),'afterUpdate':_0xb72d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x55c1be){return function(_0x23fb34,_0x10b42b,_0x268e16){CmContactEvents[_0xb72d('0x5')](_0x55c1be+':'+_0x23fb34['id'],_0x23fb34);CmContactEvents[_0xb72d('0x5')](_0x55c1be,_0x23fb34);_0x268e16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xb72d('0x6')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0xd79a=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x40c34f,_0x1a76e7){var _0x119337=function(_0x283c02){while(--_0x283c02){_0x40c34f['push'](_0x40c34f['shift']());}};_0x119337(++_0x1a76e7);}(_0xd79a,0x13d));var _0xad79=function(_0x3afa98,_0x3f8fe8){_0x3afa98=_0x3afa98-0x0;var _0xd01b39=_0xd79a[_0x3afa98];return _0xd01b39;};'use strict';var EventEmitter=require(_0xad79('0x0'));var CmContact=require(_0xad79('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xad79('0x2')](0x0);var events={'afterCreate':_0xad79('0x3'),'afterUpdate':_0xad79('0x4'),'afterDestroy':_0xad79('0x5')};function emitEvent(_0x51d721){return function(_0x9fba,_0x37ccb9,_0x18d649){CmContactEvents['emit'](_0x51d721+':'+_0x9fba['id'],_0x9fba);CmContactEvents[_0xad79('0x6')](_0x51d721,_0x9fba);_0x18d649(null);};}for(var e in events){if(events[_0xad79('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xad79('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index eb06d35..359fe01 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 _0xcac8=['utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','VoiceQueue','isNil','dialTimezone','timezones','utcOffset','minutes','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','then','\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','Campaign','add','\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','findAll','outbound','Lists','length','get','always','onlyIfOpen','CmList','BlackLists','cmContact,\x20%s,\x20%s','message','dialCheckDuplicateType','CmHopperBlack','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','bluebird','../../config/environment','./cmContact.attributes','exports','define','CmContact','phone','firstName','lastName','fax','email','FULLTEXT'];(function(_0x4e0560,_0x2841c4){var _0x1b34df=function(_0x241842){while(--_0x241842){_0x4e0560['push'](_0x4e0560['shift']());}};_0x1b34df(++_0x2841c4);}(_0xcac8,0x1a0));var _0x8cac=function(_0x37d0f7,_0x41f91a){_0x37d0f7=_0x37d0f7-0x0;var _0x820b84=_0xcac8[_0x37d0f7];return _0x820b84;};'use strict';var _=require('lodash');var util=require(_0x8cac('0x0'));var logger=require(_0x8cac('0x1'))(_0x8cac('0x2'));var moment=require(_0x8cac('0x3'));var BPromise=require(_0x8cac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8cac('0x5'));var shared=require('../../config/environment/shared');var attributes=require(_0x8cac('0x6'));module[_0x8cac('0x7')]=function(_0x111f2b,_0x50517a){return _0x111f2b[_0x8cac('0x8')](_0x8cac('0x9'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':[_0x8cac('0xa')]},{'name':'fti_cm_contacts','fields':[_0x8cac('0xb'),_0x8cac('0xc'),_0x8cac('0xa'),'mobile',_0x8cac('0xd'),_0x8cac('0xe')],'type':_0x8cac('0xf')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x8cac('0x10'),'hooks':{'afterCreate':function(_0x46698d,_0x5f337f,_0x4bb680){var _0x33fa3f=_0x111f2b[_0x8cac('0x11')];var _0x5f49fc=_0x46698d['get']({'plain':!![]});function _0xe959d8(){return function(_0x33ce26){logger[_0x8cac('0x12')](_0x8cac('0x13'),_0x8cac('0x14'),util[_0x8cac('0x15')](_0x33ce26,{'showHidden':![],'depth':null}));};}function _0x2859ea(_0x469d45,_0x2773d2){var _0x7b9314=_0x2773d2[_0x8cac('0x16')]?_0x2773d2['scheduledat']:moment()[_0x8cac('0x17')](_0x8cac('0x18'));return new BPromise(function(_0x37ae20,_0x56335e){if(_['isNil'](_0x2773d2['dialTimezone'])){_0x37ae20({'ret':_0x7b9314});}else{_0x33fa3f[_0x8cac('0x19')]['findOne']({'where':{'id':_0x469d45['id']}})['then'](function(_0x2853d4){if(!_[_0x8cac('0x1a')](_0x2853d4)){var _0x48857b=_0x2853d4[_0x8cac('0x1b')];if(!_[_0x8cac('0x1a')](_0x48857b)){var _0x5f588a=shared[_0x8cac('0x1c')];var _0x48516e=_0x5f588a[_0x48857b];var _0x22b10a=_0x5f588a[_0x2773d2['dialTimezone']];if(!_[_0x8cac('0x1a')](_0x48516e)&&!_[_0x8cac('0x1a')](_0x22b10a)){var _0x2bd154=_0x48516e[_0x8cac('0x1d')]-_0x22b10a[_0x8cac('0x1d')];_0x7b9314=_0x2773d2['scheduledat']?_0x2773d2[_0x8cac('0x16')]:moment();var _0xd20369=moment(_0x7b9314)['add'](_0x2bd154,_0x8cac('0x1e'));_0x37ae20({'ret':_0xd20369[_0x8cac('0x17')](_0x8cac('0x18'))});}else _0x37ae20({'ret':_0x7b9314});}else _0x37ae20({'ret':_0x7b9314});}else{_0x37ae20({'ret':_0x7b9314});}});}});return 0xa;}var _0x258aea=function(_0x55c82a){return new BPromise(function(_0x537dcb,_0x3b3811){_0x2859ea(_0x55c82a,_0x5f49fc)['then'](function(_0x430132){_0x5f49fc['scheduledat']=_0x430132[_0x8cac('0x1f')];_0x33fa3f[_0x8cac('0x20')][_0x8cac('0x21')]({'where':{'phone':_0x5f49fc['phone'],'VoiceQueueId':_0x55c82a['id']}})['then'](function(_0x478969){if(!_['isNil'](_0x478969)){throw new Error(_0x8cac('0x22')+_0x5f49fc[_0x8cac('0xa')]+_0x8cac('0x23')+_0x55c82a['id']);}return _0x33fa3f[_0x8cac('0x20')]['create']({'phone':_0x5f49fc[_0x8cac('0xa')],'ContactId':_0x5f49fc['id'],'ListId':_0x5f49fc[_0x8cac('0x24')],'priority':_0x5f49fc[_0x8cac('0x25')]?_0x5f49fc[_0x8cac('0x25')]:0x2,'scheduledat':_0x5f49fc[_0x8cac('0x16')]?_0x5f49fc[_0x8cac('0x16')]:moment()[_0x8cac('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5f49fc[_0x8cac('0x26')]?!![]:![],'callbackuniqueid':_0x5f49fc[_0x8cac('0x26')]?_0x5f49fc['callbackUniqueid']:undefined,'callbackat':_0x5f49fc[_0x8cac('0x26')]?moment()[_0x8cac('0x17')](_0x8cac('0x18')):undefined,'VoiceQueueId':_0x55c82a['id']});})[_0x8cac('0x27')](function(_0x34ed37){_0x3b3811(_0x34ed37);});});});};var _0x32ec35=function(_0x30f88b){return new BPromise(function(_0x291df3,_0x5a9d00){_0x2859ea(_0x30f88b,_0x5f49fc)[_0x8cac('0x28')](function(_0x2abf1a){_0x5f49fc[_0x8cac('0x16')]=_0x2abf1a[_0x8cac('0x1f')];_0x33fa3f['CmHopper'][_0x8cac('0x21')]({'where':{'phone':_0x5f49fc[_0x8cac('0xa')],'VoiceQueueId':_0x30f88b['id']}})[_0x8cac('0x28')](function(_0x2cc49b){if(!_[_0x8cac('0x1a')](_0x2cc49b)){throw new Error(_0x8cac('0x22')+_0x5f49fc[_0x8cac('0xa')]+_0x8cac('0x29')+_0x30f88b['id']);}return _0x33fa3f[_0x8cac('0x2a')][_0x8cac('0x21')]({'where':{'calleridnum':_0x5f49fc['phone'],'VoiceQueueId':_0x30f88b['id']}});})[_0x8cac('0x28')](function(_0x154f97){if(!_[_0x8cac('0x1a')](_0x154f97)){throw new Error(_0x8cac('0x2b')+_0x5f49fc[_0x8cac('0xa')]+_0x8cac('0x2c')+_0x30f88b['id']);}return _0x33fa3f['CmHopper'][_0x8cac('0x2d')]({'phone':_0x5f49fc['phone'],'ContactId':_0x5f49fc['id'],'ListId':_0x5f49fc[_0x8cac('0x24')],'priority':_0x5f49fc[_0x8cac('0x25')]?_0x5f49fc[_0x8cac('0x25')]:0x2,'scheduledat':_0x5f49fc['scheduledat']?_0x5f49fc['scheduledat']:moment()['format'](_0x8cac('0x18')),'callback':_0x5f49fc[_0x8cac('0x26')]?!![]:![],'callbackuniqueid':_0x5f49fc['callbackUniqueid']?_0x5f49fc[_0x8cac('0x26')]:undefined,'callbackat':_0x5f49fc[_0x8cac('0x26')]?moment()[_0x8cac('0x17')](_0x8cac('0x18')):undefined,'VoiceQueueId':_0x30f88b['id']});})['catch'](function(_0x334f44){_0x5a9d00(_0x334f44);});});});};function _0x2f24be(){return function(_0x5469b1){logger[_0x8cac('0x12')](_0x8cac('0x13'),_0x8cac('0x14'),util[_0x8cac('0x15')](_0x5469b1,{'showHidden':![],'depth':null}));};}function _0x5ae2de(_0x46ed9b,_0xae855f){var _0x2e7b42=_0xae855f[_0x8cac('0x16')]?_0xae855f['scheduledat']:moment()[_0x8cac('0x17')](_0x8cac('0x18'));return new BPromise(function(_0x54a81f,_0x42c8ca){if(_[_0x8cac('0x1a')](_0xae855f['dialTimezone'])){_0x54a81f({'ret':_0x2e7b42});}else{_0x33fa3f[_0x8cac('0x2e')][_0x8cac('0x21')]({'where':{'id':_0x46ed9b['id']}})[_0x8cac('0x28')](function(_0x199e1e){if(!_[_0x8cac('0x1a')](_0x199e1e)){var _0x163845=_0x199e1e['dialTimezone'];if(!_['isNil'](_0x163845)){var _0x1a411a=shared[_0x8cac('0x1c')];var _0x22342f=_0x1a411a[_0x163845];var _0x42a1a4=_0x1a411a[_0xae855f[_0x8cac('0x1b')]];if(!_[_0x8cac('0x1a')](_0x22342f)&&!_[_0x8cac('0x1a')](_0x42a1a4)){var _0x3e00bb=_0x22342f[_0x8cac('0x1d')]-_0x42a1a4[_0x8cac('0x1d')];_0x2e7b42=_0xae855f[_0x8cac('0x16')]?_0xae855f[_0x8cac('0x16')]:moment();var _0x2c4b9e=moment(_0x2e7b42)[_0x8cac('0x2f')](_0x3e00bb,_0x8cac('0x1e'));_0x54a81f({'ret':_0x2c4b9e[_0x8cac('0x17')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x54a81f({'ret':_0x2e7b42});}else _0x54a81f({'ret':_0x2e7b42});}else{_0x54a81f({'ret':_0x2e7b42});}});}});return 0xa;}var _0x352303=function(_0x5b9251){return new BPromise(function(_0x2bd4d6,_0x3df253){_0x5ae2de(_0x5b9251,_0x5f49fc)[_0x8cac('0x28')](function(_0x6f0510){_0x5f49fc['scheduledat']=_0x6f0510[_0x8cac('0x1f')];_0x33fa3f['CmHopper']['findOne']({'where':{'phone':_0x5f49fc['phone'],'CampaignId':_0x5b9251['id']}})[_0x8cac('0x28')](function(_0x55369b){if(!_[_0x8cac('0x1a')](_0x55369b)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5f49fc['phone']+_0x8cac('0x30')+_0x5b9251['id']);}return _0x33fa3f[_0x8cac('0x20')][_0x8cac('0x2d')]({'phone':_0x5f49fc['phone'],'ContactId':_0x5f49fc['id'],'ListId':_0x5f49fc[_0x8cac('0x24')],'priority':_0x5f49fc['priority']?_0x5f49fc[_0x8cac('0x25')]:0x2,'scheduledat':_0x5f49fc[_0x8cac('0x16')]?_0x5f49fc[_0x8cac('0x16')]:moment()[_0x8cac('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5f49fc[_0x8cac('0x26')]?!![]:![],'callbackuniqueid':_0x5f49fc['callbackUniqueid']?_0x5f49fc[_0x8cac('0x26')]:undefined,'callbackat':_0x5f49fc['callbackUniqueid']?moment()['format'](_0x8cac('0x18')):undefined,'CampaignId':_0x5b9251['id']});})[_0x8cac('0x27')](function(_0xc66b74){_0x3df253(_0xc66b74);});});});};var _0x5e63e3=function(_0x22ea74){return new BPromise(function(_0x3cca63,_0x19217e){_0x5ae2de(_0x22ea74,_0x5f49fc)[_0x8cac('0x28')](function(_0x27b4b3){_0x5f49fc['scheduledat']=_0x27b4b3['ret'];_0x33fa3f['CmHopper']['findOne']({'where':{'phone':_0x5f49fc['phone'],'CampaignId':_0x22ea74['id']}})['then'](function(_0x5c91f7){if(!_[_0x8cac('0x1a')](_0x5c91f7)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5f49fc[_0x8cac('0xa')]+_0x8cac('0x31')+_0x22ea74['id']);}return _0x33fa3f[_0x8cac('0x2a')]['findOne']({'where':{'calleridnum':_0x5f49fc[_0x8cac('0xa')],'CampaignId':_0x22ea74['id']}});})['then'](function(_0x3ea0a9){if(!_['isNil'](_0x3ea0a9)){throw new Error(_0x8cac('0x2b')+_0x5f49fc['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x22ea74['id']);}return _0x33fa3f[_0x8cac('0x20')][_0x8cac('0x2d')]({'phone':_0x5f49fc[_0x8cac('0xa')],'ContactId':_0x5f49fc['id'],'ListId':_0x5f49fc['ListId'],'priority':_0x5f49fc[_0x8cac('0x25')]?_0x5f49fc[_0x8cac('0x25')]:0x2,'scheduledat':_0x5f49fc[_0x8cac('0x16')]?_0x5f49fc[_0x8cac('0x16')]:moment()[_0x8cac('0x17')](_0x8cac('0x18')),'callback':_0x5f49fc['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5f49fc['callbackUniqueid']?_0x5f49fc[_0x8cac('0x26')]:undefined,'callbackat':_0x5f49fc[_0x8cac('0x26')]?moment()[_0x8cac('0x17')](_0x8cac('0x18')):undefined,'CampaignId':_0x22ea74['id']});})[_0x8cac('0x27')](function(_0x2498af){_0x19217e(_0x2498af);});});});};if(_0x5f49fc[_0x8cac('0x24')]){_0x33fa3f[_0x8cac('0x19')][_0x8cac('0x32')]({'where':{'type':_0x8cac('0x33')},'attributes':['id','dialCheckDuplicateType',_0x8cac('0x1b')],'include':[{'model':_0x33fa3f['CmList'],'as':_0x8cac('0x34'),'where':{'id':_0x5f49fc[_0x8cac('0x24')]}}]})['then'](function(_0x4cd5e0){if(_0x4cd5e0){var _0x26cfb6=[];for(var _0x5298bf=0x0,_0x1e36f7;_0x5298bf<_0x4cd5e0[_0x8cac('0x35')];_0x5298bf+=0x1){_0x1e36f7=_0x4cd5e0[_0x5298bf][_0x8cac('0x36')]({'plain':!![]});switch(_0x1e36f7['dialCheckDuplicateType']){case _0x8cac('0x37'):_0x32ec35(_0x1e36f7)[_0x8cac('0x27')](_0xe959d8());break;case _0x8cac('0x38'):_0x258aea(_0x1e36f7)['catch'](_0xe959d8());break;default:_0x5ae2de(_0x1e36f7,_0x5f49fc)[_0x8cac('0x28')](function(_0x2e8e0f){_0x5f49fc['scheduledat']=_0x2e8e0f[_0x8cac('0x1f')];_0x33fa3f[_0x8cac('0x20')][_0x8cac('0x2d')]({'phone':_0x5f49fc[_0x8cac('0xa')],'ContactId':_0x5f49fc['id'],'ListId':_0x5f49fc['ListId'],'scheduledat':_0x5f49fc['scheduledat']?_0x5f49fc[_0x8cac('0x16')]:moment()[_0x8cac('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x5f49fc[_0x8cac('0x25')]?_0x5f49fc[_0x8cac('0x25')]:0x2,'callback':_0x5f49fc[_0x8cac('0x26')]?!![]:![],'callbackuniqueid':_0x5f49fc['callbackUniqueid']?_0x5f49fc[_0x8cac('0x26')]:undefined,'callbackat':_0x5f49fc[_0x8cac('0x26')]?moment()[_0x8cac('0x17')](_0x8cac('0x18')):undefined,'VoiceQueueId':_0x1e36f7['id']})[_0x8cac('0x27')](_0xe959d8());});}}}})[_0x8cac('0x28')](function(){return _0x33fa3f[_0x8cac('0x19')][_0x8cac('0x32')]({'where':{'type':_0x8cac('0x33')},'attributes':['id'],'include':[{'model':_0x33fa3f[_0x8cac('0x39')],'as':_0x8cac('0x3a'),'where':{'id':_0x5f49fc[_0x8cac('0x24')]}}]})[_0x8cac('0x28')](function(_0x1fef70){if(_0x1fef70){var _0x2d4bf5=[];for(var _0x338122=0x0,_0x58de88;_0x338122<_0x1fef70[_0x8cac('0x35')];_0x338122+=0x1){_0x58de88=_0x1fef70[_0x338122][_0x8cac('0x36')]({'plain':!![]});_0x33fa3f['CmHopperBlack'][_0x8cac('0x2d')]({'phone':_0x5f49fc[_0x8cac('0xa')],'ContactId':_0x5f49fc['id'],'ListId':_0x5f49fc[_0x8cac('0x24')],'VoiceQueueId':_0x58de88['id']})[_0x8cac('0x27')](function(_0x3571ce){logger[_0x8cac('0x12')](_0x8cac('0x3b'),'afterCreate',_0x3571ce[_0x8cac('0x3c')]);});}}});})[_0x8cac('0x28')](function(){return _0x33fa3f['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType',_0x8cac('0x1b')],'include':[{'model':_0x33fa3f['CmList'],'as':_0x8cac('0x34'),'where':{'id':_0x5f49fc['ListId']}}]})[_0x8cac('0x28')](function(_0x267aea){if(_0x267aea){var _0x557afd=[];for(var _0x5e953f=0x0,_0x25fd06;_0x5e953f<_0x267aea[_0x8cac('0x35')];_0x5e953f+=0x1){_0x25fd06=_0x267aea[_0x5e953f][_0x8cac('0x36')]({'plain':!![]});switch(_0x25fd06[_0x8cac('0x3d')]){case _0x8cac('0x37'):_0x5e63e3(_0x25fd06)[_0x8cac('0x27')](_0x2f24be());break;case _0x8cac('0x38'):_0x352303(_0x25fd06)[_0x8cac('0x27')](_0x2f24be());break;default:_0x33fa3f[_0x8cac('0x20')][_0x8cac('0x2d')]({'phone':_0x5f49fc[_0x8cac('0xa')],'ContactId':_0x5f49fc['id'],'ListId':_0x5f49fc[_0x8cac('0x24')],'scheduledat':_0x5f49fc[_0x8cac('0x16')]?_0x5f49fc[_0x8cac('0x16')]:moment()[_0x8cac('0x17')](_0x8cac('0x18')),'priority':_0x5f49fc[_0x8cac('0x25')]?_0x5f49fc[_0x8cac('0x25')]:0x2,'callback':_0x5f49fc[_0x8cac('0x26')]?!![]:![],'callbackuniqueid':_0x5f49fc[_0x8cac('0x26')]?_0x5f49fc[_0x8cac('0x26')]:undefined,'callbackat':_0x5f49fc[_0x8cac('0x26')]?moment()[_0x8cac('0x17')](_0x8cac('0x18')):undefined,'CampaignId':_0x25fd06['id']})[_0x8cac('0x27')](_0x2f24be());}}}});})[_0x8cac('0x28')](function(){return _0x33fa3f[_0x8cac('0x2e')]['findAll']({'attributes':['id'],'include':[{'model':_0x33fa3f[_0x8cac('0x39')],'as':_0x8cac('0x3a'),'where':{'id':_0x5f49fc[_0x8cac('0x24')]}}]})['then'](function(_0x3079c1){if(_0x3079c1){var _0x149129=[];for(var _0x375c2d=0x0,_0x5d04b5;_0x375c2d<_0x3079c1[_0x8cac('0x35')];_0x375c2d+=0x1){_0x5d04b5=_0x3079c1[_0x375c2d][_0x8cac('0x36')]({'plain':!![]});_0x33fa3f[_0x8cac('0x3e')]['create']({'phone':_0x5f49fc['phone'],'ContactId':_0x5f49fc['id'],'ListId':_0x5f49fc['ListId'],'CampaignId':_0x5d04b5['id']})[_0x8cac('0x27')](function(_0x36bba4){logger[_0x8cac('0x12')]('cmContact,\x20%s,\x20%s',_0x8cac('0x14'),_0x36bba4[_0x8cac('0x3c')]);});}}});})[_0x8cac('0x28')](function(){_0x4bb680();})[_0x8cac('0x27')](function(_0x1b20f4){logger[_0x8cac('0x12')](_0x8cac('0x3b'),'afterCreate',_0x1b20f4[_0x8cac('0x3c')]);_0x4bb680(_0x1b20f4);});}else{_0x4bb680(new Error(_0x8cac('0x3f')));}},'afterDestroy':function(_0x35666d,_0x1a310e,_0x27b5b0){var _0x470698=_0x111f2b[_0x8cac('0x11')];var _0x29ee01=_0x35666d['get']({'plain':!![]});return _0x470698[_0x8cac('0x20')][_0x8cac('0x32')]({'raw':!![],'where':{'ListId':_0x29ee01['ListId'],'ContactId':_0x29ee01['id']}})[_0x8cac('0x28')](function(_0x225fa0){if(!_[_0x8cac('0x40')](_0x225fa0)){var _0x3e4aa6=[];for(var _0x47890f=0x0;_0x47890f<_0x225fa0['length'];_0x47890f+=0x1){var _0x568e9c=_0x470698[_0x8cac('0x20')]['destroy']({'where':{'ListId':_0x225fa0[_0x47890f][_0x8cac('0x24')],'ContactId':_0x225fa0[_0x47890f][_0x8cac('0x41')],'VoiceQueueId':_0x225fa0[_0x47890f][_0x8cac('0x42')],'CampaignId':_0x225fa0[_0x47890f][_0x8cac('0x43')]}});_0x3e4aa6['push'](_0x568e9c);}return BPromise[_0x8cac('0x44')](_0x3e4aa6);}})[_0x8cac('0x28')](function(_0x2ccb0d){logger[_0x8cac('0x45')](_0x8cac('0x46'),util[_0x8cac('0x15')](_0x2ccb0d,{'showHidden':![],'depth':null}));_0x27b5b0();})[_0x8cac('0x27')](function(_0x2845d2){logger[_0x8cac('0x12')](_0x8cac('0x47'),util[_0x8cac('0x15')](_0x2845d2,{'showHidden':![],'depth':null}));_0x27b5b0(_0x2845d2);});}}});}; \ No newline at end of file +var _0xbb23=['outbound','dialCheckDuplicateType','CmList','Lists','length','onlyIfOpen','BlackLists','message','always','CmHopperBlack','cmContact,\x20%s,\x20%s','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','fti_cm_contacts','phone','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','get','error','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','format','CmHopper','cmContact,\x20afterCreate\x20','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','cmContact','afterCreate','Campaign','create','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll'];(function(_0x1fb095,_0x3fb31b){var _0xfca6ed=function(_0x58730f){while(--_0x58730f){_0x1fb095['push'](_0x1fb095['shift']());}};_0xfca6ed(++_0x3fb31b);}(_0xbb23,0xf1));var _0x3bb2=function(_0x485725,_0x135d6b){_0x485725=_0x485725-0x0;var _0x55d981=_0xbb23[_0x485725];return _0x55d981;};'use strict';var _=require(_0x3bb2('0x0'));var util=require(_0x3bb2('0x1'));var logger=require('../../config/logger')(_0x3bb2('0x2'));var moment=require(_0x3bb2('0x3'));var BPromise=require(_0x3bb2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3bb2('0x5'));var config=require(_0x3bb2('0x6'));var shared=require(_0x3bb2('0x7'));var attributes=require(_0x3bb2('0x8'));module['exports']=function(_0x3e5867,_0x51174d){return _0x3e5867[_0x3bb2('0x9')](_0x3bb2('0xa'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x3bb2('0xb'),'fields':['firstName','lastName',_0x3bb2('0xc'),_0x3bb2('0xd'),_0x3bb2('0xe'),_0x3bb2('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x3bb2('0x10'),'collate':_0x3bb2('0x11'),'hooks':{'afterCreate':function(_0x391e64,_0xb36fa6,_0x37aa18){var _0x249681=_0x3e5867['models'];var _0x1930a7=_0x391e64[_0x3bb2('0x12')]({'plain':!![]});function _0x2d0970(){return function(_0x28de03){logger[_0x3bb2('0x13')]('cmContact','afterCreate',util[_0x3bb2('0x14')](_0x28de03,{'showHidden':![],'depth':null}));};}function _0x300e55(_0x468ba9,_0x5b75bf){var _0x2011a1=_0x5b75bf[_0x3bb2('0x15')]?_0x5b75bf[_0x3bb2('0x15')]:moment()['format'](_0x3bb2('0x16'));return new BPromise(function(_0x25c238,_0x362ec7){if(_[_0x3bb2('0x17')](_0x5b75bf[_0x3bb2('0x18')])){_0x25c238({'ret':_0x2011a1});}else{_0x249681[_0x3bb2('0x19')][_0x3bb2('0x1a')]({'where':{'id':_0x468ba9['id']}})[_0x3bb2('0x1b')](function(_0x5ed4ca){if(!_[_0x3bb2('0x17')](_0x5ed4ca)){var _0x25d567=_0x5ed4ca[_0x3bb2('0x18')];if(!_[_0x3bb2('0x17')](_0x25d567)){var _0x4e32a4=shared[_0x3bb2('0x1c')];var _0x2c1402=_0x4e32a4[_0x25d567];var _0x165a89=_0x4e32a4[_0x5b75bf[_0x3bb2('0x18')]];if(!_[_0x3bb2('0x17')](_0x2c1402)&&!_[_0x3bb2('0x17')](_0x165a89)){var _0x46512f=_0x2c1402[_0x3bb2('0x1d')]-_0x165a89[_0x3bb2('0x1d')];_0x2011a1=_0x5b75bf[_0x3bb2('0x15')]?_0x5b75bf[_0x3bb2('0x15')]:moment();var _0x4cd976=moment(_0x2011a1)[_0x3bb2('0x1e')](_0x46512f,_0x3bb2('0x1f'));_0x25c238({'ret':_0x4cd976[_0x3bb2('0x20')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x25c238({'ret':_0x2011a1});}else _0x25c238({'ret':_0x2011a1});}else{_0x25c238({'ret':_0x2011a1});}});}});return 0xa;}var _0x54e912=function(_0x46d6be){return new BPromise(function(_0x2d1e5b,_0x37934d){_0x300e55(_0x46d6be,_0x1930a7)[_0x3bb2('0x1b')](function(_0x3c6e75){_0x1930a7[_0x3bb2('0x15')]=_0x3c6e75['ret'];_0x249681[_0x3bb2('0x21')][_0x3bb2('0x1a')]({'where':{'phone':_0x1930a7[_0x3bb2('0xc')],'VoiceQueueId':_0x46d6be['id']}})[_0x3bb2('0x1b')](function(_0xcaaa2e){if(!_[_0x3bb2('0x17')](_0xcaaa2e)){throw new Error(_0x3bb2('0x22')+_0x1930a7[_0x3bb2('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x46d6be['id']);}return _0x249681['CmHopper']['create']({'phone':_0x1930a7['phone'],'ContactId':_0x1930a7['id'],'ListId':_0x1930a7['ListId'],'priority':_0x1930a7[_0x3bb2('0x23')]?_0x1930a7[_0x3bb2('0x23')]:0x2,'scheduledat':_0x1930a7[_0x3bb2('0x15')]?_0x1930a7[_0x3bb2('0x15')]:moment()[_0x3bb2('0x20')](_0x3bb2('0x16')),'callback':_0x1930a7[_0x3bb2('0x24')]?!![]:![],'callbackuniqueid':_0x1930a7[_0x3bb2('0x24')]?_0x1930a7['callbackUniqueid']:undefined,'callbackat':_0x1930a7[_0x3bb2('0x24')]?moment()[_0x3bb2('0x20')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x46d6be['id']});})[_0x3bb2('0x25')](function(_0x173dc7){_0x37934d(_0x173dc7);});});});};var _0x404431=function(_0x594177){return new BPromise(function(_0x132dde,_0x4c93be){_0x300e55(_0x594177,_0x1930a7)[_0x3bb2('0x1b')](function(_0x33c2bd){_0x1930a7['scheduledat']=_0x33c2bd[_0x3bb2('0x26')];_0x249681[_0x3bb2('0x21')][_0x3bb2('0x1a')]({'where':{'phone':_0x1930a7[_0x3bb2('0xc')],'VoiceQueueId':_0x594177['id']}})['then'](function(_0x24f53e){if(!_[_0x3bb2('0x17')](_0x24f53e)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1930a7['phone']+_0x3bb2('0x27')+_0x594177['id']);}return _0x249681['CmHopperFinal'][_0x3bb2('0x1a')]({'where':{'calleridnum':_0x1930a7[_0x3bb2('0xc')],'VoiceQueueId':_0x594177['id']}});})[_0x3bb2('0x1b')](function(_0x344010){if(!_[_0x3bb2('0x17')](_0x344010)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1930a7[_0x3bb2('0xc')]+_0x3bb2('0x28')+_0x594177['id']);}return _0x249681[_0x3bb2('0x21')]['create']({'phone':_0x1930a7[_0x3bb2('0xc')],'ContactId':_0x1930a7['id'],'ListId':_0x1930a7[_0x3bb2('0x29')],'priority':_0x1930a7['priority']?_0x1930a7[_0x3bb2('0x23')]:0x2,'scheduledat':_0x1930a7[_0x3bb2('0x15')]?_0x1930a7[_0x3bb2('0x15')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1930a7[_0x3bb2('0x24')]?!![]:![],'callbackuniqueid':_0x1930a7['callbackUniqueid']?_0x1930a7[_0x3bb2('0x24')]:undefined,'callbackat':_0x1930a7[_0x3bb2('0x24')]?moment()[_0x3bb2('0x20')](_0x3bb2('0x16')):undefined,'VoiceQueueId':_0x594177['id']});})['catch'](function(_0x16e7eb){_0x4c93be(_0x16e7eb);});});});};function _0x5b7e14(){return function(_0x36a054){logger[_0x3bb2('0x13')](_0x3bb2('0x2a'),_0x3bb2('0x2b'),util[_0x3bb2('0x14')](_0x36a054,{'showHidden':![],'depth':null}));};}function _0x4b433e(_0x1d8057,_0x4682b6){var _0x18db60=_0x4682b6[_0x3bb2('0x15')]?_0x4682b6[_0x3bb2('0x15')]:moment()[_0x3bb2('0x20')](_0x3bb2('0x16'));return new BPromise(function(_0x54a22f,_0x2ca5ad){if(_['isNil'](_0x4682b6[_0x3bb2('0x18')])){_0x54a22f({'ret':_0x18db60});}else{_0x249681[_0x3bb2('0x2c')]['findOne']({'where':{'id':_0x1d8057['id']}})['then'](function(_0x4bdb98){if(!_['isNil'](_0x4bdb98)){var _0x12d62f=_0x4bdb98[_0x3bb2('0x18')];if(!_[_0x3bb2('0x17')](_0x12d62f)){var _0x593f86=shared[_0x3bb2('0x1c')];var _0x163c3a=_0x593f86[_0x12d62f];var _0xde876a=_0x593f86[_0x4682b6[_0x3bb2('0x18')]];if(!_[_0x3bb2('0x17')](_0x163c3a)&&!_['isNil'](_0xde876a)){var _0xd2627b=_0x163c3a[_0x3bb2('0x1d')]-_0xde876a[_0x3bb2('0x1d')];_0x18db60=_0x4682b6[_0x3bb2('0x15')]?_0x4682b6[_0x3bb2('0x15')]:moment();var _0x358c86=moment(_0x18db60)[_0x3bb2('0x1e')](_0xd2627b,_0x3bb2('0x1f'));_0x54a22f({'ret':_0x358c86[_0x3bb2('0x20')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x54a22f({'ret':_0x18db60});}else _0x54a22f({'ret':_0x18db60});}else{_0x54a22f({'ret':_0x18db60});}});}});return 0xa;}var _0x43d947=function(_0x1b913e){return new BPromise(function(_0x18ec4c,_0x3a85c6){_0x4b433e(_0x1b913e,_0x1930a7)[_0x3bb2('0x1b')](function(_0x58581b){_0x1930a7[_0x3bb2('0x15')]=_0x58581b[_0x3bb2('0x26')];_0x249681[_0x3bb2('0x21')][_0x3bb2('0x1a')]({'where':{'phone':_0x1930a7[_0x3bb2('0xc')],'CampaignId':_0x1b913e['id']}})[_0x3bb2('0x1b')](function(_0x57c28f){if(!_[_0x3bb2('0x17')](_0x57c28f)){throw new Error(_0x3bb2('0x22')+_0x1930a7['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1b913e['id']);}return _0x249681[_0x3bb2('0x21')][_0x3bb2('0x2d')]({'phone':_0x1930a7['phone'],'ContactId':_0x1930a7['id'],'ListId':_0x1930a7[_0x3bb2('0x29')],'priority':_0x1930a7['priority']?_0x1930a7[_0x3bb2('0x23')]:0x2,'scheduledat':_0x1930a7[_0x3bb2('0x15')]?_0x1930a7[_0x3bb2('0x15')]:moment()[_0x3bb2('0x20')](_0x3bb2('0x16')),'callback':_0x1930a7['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1930a7[_0x3bb2('0x24')]?_0x1930a7[_0x3bb2('0x24')]:undefined,'callbackat':_0x1930a7[_0x3bb2('0x24')]?moment()[_0x3bb2('0x20')](_0x3bb2('0x16')):undefined,'CampaignId':_0x1b913e['id']});})['catch'](function(_0x27fa08){_0x3a85c6(_0x27fa08);});});});};var _0x415bba=function(_0x330291){return new BPromise(function(_0x3bcf08,_0x3414ec){_0x4b433e(_0x330291,_0x1930a7)['then'](function(_0x1ff855){_0x1930a7[_0x3bb2('0x15')]=_0x1ff855[_0x3bb2('0x26')];_0x249681['CmHopper'][_0x3bb2('0x1a')]({'where':{'phone':_0x1930a7[_0x3bb2('0xc')],'CampaignId':_0x330291['id']}})[_0x3bb2('0x1b')](function(_0x19049b){if(!_[_0x3bb2('0x17')](_0x19049b)){throw new Error(_0x3bb2('0x22')+_0x1930a7[_0x3bb2('0xc')]+_0x3bb2('0x2e')+_0x330291['id']);}return _0x249681[_0x3bb2('0x2f')][_0x3bb2('0x1a')]({'where':{'calleridnum':_0x1930a7[_0x3bb2('0xc')],'CampaignId':_0x330291['id']}});})['then'](function(_0x1b2fe4){if(!_[_0x3bb2('0x17')](_0x1b2fe4)){throw new Error(_0x3bb2('0x30')+_0x1930a7[_0x3bb2('0xc')]+_0x3bb2('0x31')+_0x330291['id']);}return _0x249681['CmHopper']['create']({'phone':_0x1930a7[_0x3bb2('0xc')],'ContactId':_0x1930a7['id'],'ListId':_0x1930a7['ListId'],'priority':_0x1930a7[_0x3bb2('0x23')]?_0x1930a7[_0x3bb2('0x23')]:0x2,'scheduledat':_0x1930a7[_0x3bb2('0x15')]?_0x1930a7[_0x3bb2('0x15')]:moment()[_0x3bb2('0x20')](_0x3bb2('0x16')),'callback':_0x1930a7[_0x3bb2('0x24')]?!![]:![],'callbackuniqueid':_0x1930a7[_0x3bb2('0x24')]?_0x1930a7[_0x3bb2('0x24')]:undefined,'callbackat':_0x1930a7[_0x3bb2('0x24')]?moment()[_0x3bb2('0x20')](_0x3bb2('0x16')):undefined,'CampaignId':_0x330291['id']});})[_0x3bb2('0x25')](function(_0x9f3b98){_0x3414ec(_0x9f3b98);});});});};if(_0x1930a7[_0x3bb2('0x29')]){_0x249681[_0x3bb2('0x19')][_0x3bb2('0x32')]({'where':{'type':_0x3bb2('0x33')},'attributes':['id',_0x3bb2('0x34'),_0x3bb2('0x18')],'include':[{'model':_0x249681[_0x3bb2('0x35')],'as':_0x3bb2('0x36'),'where':{'id':_0x1930a7[_0x3bb2('0x29')]}}]})[_0x3bb2('0x1b')](function(_0x8c697d){if(_0x8c697d){var _0x137ac5=[];for(var _0x490b63=0x0,_0x579375;_0x490b63<_0x8c697d[_0x3bb2('0x37')];_0x490b63+=0x1){_0x579375=_0x8c697d[_0x490b63][_0x3bb2('0x12')]({'plain':!![]});switch(_0x579375[_0x3bb2('0x34')]){case'always':_0x404431(_0x579375)[_0x3bb2('0x25')](_0x2d0970());break;case _0x3bb2('0x38'):_0x54e912(_0x579375)[_0x3bb2('0x25')](_0x2d0970());break;default:_0x4b433e(_0x579375,_0x1930a7)[_0x3bb2('0x1b')](function(_0x34a90c){_0x1930a7['scheduledat']=_0x34a90c[_0x3bb2('0x26')];_0x249681[_0x3bb2('0x21')][_0x3bb2('0x2d')]({'phone':_0x1930a7[_0x3bb2('0xc')],'ContactId':_0x1930a7['id'],'ListId':_0x1930a7['ListId'],'scheduledat':_0x1930a7[_0x3bb2('0x15')]?_0x1930a7[_0x3bb2('0x15')]:moment()[_0x3bb2('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x1930a7[_0x3bb2('0x23')]?_0x1930a7[_0x3bb2('0x23')]:0x2,'callback':_0x1930a7[_0x3bb2('0x24')]?!![]:![],'callbackuniqueid':_0x1930a7[_0x3bb2('0x24')]?_0x1930a7[_0x3bb2('0x24')]:undefined,'callbackat':_0x1930a7[_0x3bb2('0x24')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x579375['id']})[_0x3bb2('0x25')](_0x2d0970());});}}}})[_0x3bb2('0x1b')](function(){return _0x249681[_0x3bb2('0x19')][_0x3bb2('0x32')]({'where':{'type':_0x3bb2('0x33')},'attributes':['id'],'include':[{'model':_0x249681[_0x3bb2('0x35')],'as':_0x3bb2('0x39'),'where':{'id':_0x1930a7[_0x3bb2('0x29')]}}]})[_0x3bb2('0x1b')](function(_0x4412eb){if(_0x4412eb){var _0x28c27f=[];for(var _0x2b890a=0x0,_0x32e4a6;_0x2b890a<_0x4412eb[_0x3bb2('0x37')];_0x2b890a+=0x1){_0x32e4a6=_0x4412eb[_0x2b890a][_0x3bb2('0x12')]({'plain':!![]});_0x249681['CmHopperBlack'][_0x3bb2('0x2d')]({'phone':_0x1930a7[_0x3bb2('0xc')],'ContactId':_0x1930a7['id'],'ListId':_0x1930a7['ListId'],'VoiceQueueId':_0x32e4a6['id']})['catch'](function(_0x271aa9){logger[_0x3bb2('0x13')]('cmContact,\x20%s,\x20%s','afterCreate',_0x271aa9[_0x3bb2('0x3a')]);});}}});})['then'](function(){return _0x249681[_0x3bb2('0x2c')]['findAll']({'attributes':['id',_0x3bb2('0x34'),_0x3bb2('0x18')],'include':[{'model':_0x249681[_0x3bb2('0x35')],'as':_0x3bb2('0x36'),'where':{'id':_0x1930a7['ListId']}}]})[_0x3bb2('0x1b')](function(_0x261231){if(_0x261231){var _0x378c2e=[];for(var _0x4be4a6=0x0,_0x20e6f1;_0x4be4a6<_0x261231['length'];_0x4be4a6+=0x1){_0x20e6f1=_0x261231[_0x4be4a6][_0x3bb2('0x12')]({'plain':!![]});switch(_0x20e6f1[_0x3bb2('0x34')]){case _0x3bb2('0x3b'):_0x415bba(_0x20e6f1)[_0x3bb2('0x25')](_0x5b7e14());break;case _0x3bb2('0x38'):_0x43d947(_0x20e6f1)['catch'](_0x5b7e14());break;default:_0x249681[_0x3bb2('0x21')][_0x3bb2('0x2d')]({'phone':_0x1930a7[_0x3bb2('0xc')],'ContactId':_0x1930a7['id'],'ListId':_0x1930a7[_0x3bb2('0x29')],'scheduledat':_0x1930a7[_0x3bb2('0x15')]?_0x1930a7[_0x3bb2('0x15')]:moment()[_0x3bb2('0x20')](_0x3bb2('0x16')),'priority':_0x1930a7[_0x3bb2('0x23')]?_0x1930a7[_0x3bb2('0x23')]:0x2,'callback':_0x1930a7[_0x3bb2('0x24')]?!![]:![],'callbackuniqueid':_0x1930a7[_0x3bb2('0x24')]?_0x1930a7['callbackUniqueid']:undefined,'callbackat':_0x1930a7['callbackUniqueid']?moment()[_0x3bb2('0x20')](_0x3bb2('0x16')):undefined,'CampaignId':_0x20e6f1['id']})[_0x3bb2('0x25')](_0x5b7e14());}}}});})[_0x3bb2('0x1b')](function(){return _0x249681['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x249681[_0x3bb2('0x35')],'as':_0x3bb2('0x39'),'where':{'id':_0x1930a7[_0x3bb2('0x29')]}}]})[_0x3bb2('0x1b')](function(_0x36042c){if(_0x36042c){var _0x4c1612=[];for(var _0x4e9633=0x0,_0x169c33;_0x4e9633<_0x36042c['length'];_0x4e9633+=0x1){_0x169c33=_0x36042c[_0x4e9633]['get']({'plain':!![]});_0x249681[_0x3bb2('0x3c')][_0x3bb2('0x2d')]({'phone':_0x1930a7[_0x3bb2('0xc')],'ContactId':_0x1930a7['id'],'ListId':_0x1930a7[_0x3bb2('0x29')],'CampaignId':_0x169c33['id']})['catch'](function(_0x29c2a2){logger[_0x3bb2('0x13')](_0x3bb2('0x3d'),_0x3bb2('0x2b'),_0x29c2a2[_0x3bb2('0x3a')]);});}}});})[_0x3bb2('0x1b')](function(){_0x37aa18();})['catch'](function(_0x3fe1f5){logger[_0x3bb2('0x13')]('cmContact,\x20%s,\x20%s',_0x3bb2('0x2b'),_0x3fe1f5[_0x3bb2('0x3a')]);_0x37aa18(_0x3fe1f5);});}else{_0x37aa18(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x26b8a3,_0x3b5e0f,_0x327252){var _0x3b7a5d=_0x3e5867[_0x3bb2('0x3e')];var _0xfc60aa=_0x26b8a3[_0x3bb2('0x12')]({'plain':!![]});return _0x3b7a5d[_0x3bb2('0x21')][_0x3bb2('0x32')]({'raw':!![],'where':{'ListId':_0xfc60aa[_0x3bb2('0x29')],'ContactId':_0xfc60aa['id']}})[_0x3bb2('0x1b')](function(_0xb47cb){if(!_[_0x3bb2('0x3f')](_0xb47cb)){var _0x19664b=[];for(var _0x4c1d9c=0x0;_0x4c1d9c<_0xb47cb[_0x3bb2('0x37')];_0x4c1d9c+=0x1){var _0x4a454d=_0x3b7a5d[_0x3bb2('0x21')][_0x3bb2('0x40')]({'where':{'ListId':_0xb47cb[_0x4c1d9c][_0x3bb2('0x29')],'ContactId':_0xb47cb[_0x4c1d9c][_0x3bb2('0x41')],'VoiceQueueId':_0xb47cb[_0x4c1d9c][_0x3bb2('0x42')],'CampaignId':_0xb47cb[_0x4c1d9c][_0x3bb2('0x43')]}});_0x19664b[_0x3bb2('0x44')](_0x4a454d);}return BPromise[_0x3bb2('0x45')](_0x19664b);}})[_0x3bb2('0x1b')](function(_0x3a73cf){logger[_0x3bb2('0x46')](_0x3bb2('0x47'),util['inspect'](_0x3a73cf,{'showHidden':![],'depth':null}));_0x327252();})[_0x3bb2('0x25')](function(_0x3a61b0){logger[_0x3bb2('0x13')](_0x3bb2('0x48'),util['inspect'](_0x3a61b0,{'showHidden':![],'depth':null}));_0x327252(_0x3a61b0);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index c01c833..187a393 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 _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x4a56e1,_0x5222e1){var _0x46c676=function(_0x31a111){while(--_0x31a111){_0x4a56e1['push'](_0x4a56e1['shift']());}};_0x46c676(++_0x5222e1);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\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(_0x5a9550,_0x287fc7){var _0x28e1ee=function(_0x456b49){while(--_0x456b49){_0x5a9550['push'](_0x5a9550['shift']());}};_0x28e1ee(++_0x287fc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 515ca13..1bb0266 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 _0x5825=['sequelize','exports','INTEGER','STRING'];(function(_0x54b4d8,_0x5f0a35){var _0x1e87dd=function(_0x4374b4){while(--_0x4374b4){_0x54b4d8['push'](_0x54b4d8['shift']());}};_0x1e87dd(++_0x5f0a35);}(_0x5825,0x78));var _0x5582=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5825[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x5582('0x0'));module[_0x5582('0x1')]={'CmContactId':{'type':Sequelize[_0x5582('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x5582('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x5582('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x5582('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x5582('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x7846=['exports','INTEGER','STRING','PHONE'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x7846,0xf4));var _0x6784=function(_0x5e8282,_0x1f2962){_0x5e8282=_0x5e8282-0x0;var _0x5cd37d=_0x7846[_0x5e8282];return _0x5cd37d;};'use strict';var Sequelize=require('sequelize');module[_0x6784('0x0')]={'CmContactId':{'type':Sequelize[_0x6784('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x6784('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x6784('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x6784('0x2')],'defaultValue':_0x6784('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x6784('0x2')],'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 14c6828..0f96a28 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 _0x9c88=['Content-Range','apply','reject','update','then','get','destroy','error','name','index','map','CmContactHasItem','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','autoAssociation','UserProfileResource','body','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count'];(function(_0x48ed3a,_0xd90d91){var _0x527f33=function(_0x1c5e5c){while(--_0x1c5e5c){_0x48ed3a['push'](_0x48ed3a['shift']());}};_0x527f33(++_0xd90d91);}(_0x9c88,0xd1));var _0x89c8=function(_0x2d36a6,_0x2f8cd0){_0x2d36a6=_0x2d36a6-0x0;var _0x59cec0=_0x9c88[_0x2d36a6];return _0x59cec0;};'use strict';var emlformat=require(_0x89c8('0x0'));var rimraf=require(_0x89c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x89c8('0x2'));var rp=require('request-promise');var moment=require(_0x89c8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x89c8('0x4'));var util=require(_0x89c8('0x5'));var path=require(_0x89c8('0x6'));var sox=require(_0x89c8('0x7'));var csv=require(_0x89c8('0x8'));var ejs=require(_0x89c8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89c8('0xa'));var squel=require(_0x89c8('0xb'));var crypto=require(_0x89c8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x89c8('0xd'));var Papa=require(_0x89c8('0xe'));var Redis=require(_0x89c8('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x89c8('0x10'));var hardwareService=require(_0x89c8('0x11'));var logger=require(_0x89c8('0x12'))(_0x89c8('0x13'));var utils=require(_0x89c8('0x14'));var config=require(_0x89c8('0x15'));var licenseUtil=require(_0x89c8('0x16'));var db=require(_0x89c8('0x17'))['db'];function respondWithStatusCode(_0x3b9a57,_0x427ca3){_0x427ca3=_0x427ca3||0xcc;return function(_0x20b682){if(_0x20b682){return _0x3b9a57['sendStatus'](_0x427ca3);}return _0x3b9a57['status'](_0x427ca3)[_0x89c8('0x18')]();};}function respondWithResult(_0x1596b0,_0x3604a4){_0x3604a4=_0x3604a4||0xc8;return function(_0x157afc){if(_0x157afc){return _0x1596b0[_0x89c8('0x19')](_0x3604a4)[_0x89c8('0x1a')](_0x157afc);}};}function respondWithFilteredResult(_0xe175a8,_0x4a7308){return function(_0x33cf31){if(_0x33cf31){var _0x2ae99d=typeof _0x4a7308[_0x89c8('0x1b')]===_0x89c8('0x1c')&&typeof _0x4a7308[_0x89c8('0x1d')]===_0x89c8('0x1c');var _0x24bca8=_0x33cf31[_0x89c8('0x1e')];var _0x15a702=_0x2ae99d?0x0:_0x4a7308[_0x89c8('0x1b')];var _0xada0b2=_0x2ae99d?_0x33cf31[_0x89c8('0x1e')]:_0x4a7308[_0x89c8('0x1b')]+_0x4a7308[_0x89c8('0x1d')];var _0x4e6683;if(_0xada0b2>=_0x24bca8){_0xada0b2=_0x24bca8;_0x4e6683=0xc8;}else{_0x4e6683=0xce;}_0xe175a8['status'](_0x4e6683);return _0xe175a8['set'](_0x89c8('0x1f'),_0x15a702+'-'+_0xada0b2+'/'+_0x24bca8)['json'](_0x33cf31);}return null;};}function patchUpdates(_0x21bc2f){return function(_0x485881){try{jsonpatch[_0x89c8('0x20')](_0x485881,_0x21bc2f,!![]);}catch(_0x2007ba){return BPromise[_0x89c8('0x21')](_0x2007ba);}return _0x485881['save']();};}function saveUpdates(_0x154ea9,_0x44c938){return function(_0x31c5b6){if(_0x31c5b6){return _0x31c5b6[_0x89c8('0x22')](_0x154ea9)[_0x89c8('0x23')](function(_0x5ddc71){return _0x5ddc71;});}return null;};}function removeEntity(_0x35b720,_0x4cc53c){return function(_0x2ff0cd){if(_0x2ff0cd){return _0x2ff0cd['destroy']()[_0x89c8('0x23')](function(){var _0x5b6edb=_0x2ff0cd[_0x89c8('0x24')]({'plain':!![]});var _0x50058c='CmContactHasItems';return db['UserProfileResource'][_0x89c8('0x25')]({'where':{'type':_0x50058c,'resourceId':_0x5b6edb['id']}})['then'](function(){return _0x2ff0cd;});})[_0x89c8('0x23')](function(){_0x35b720[_0x89c8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fbdd4,_0x3d5258){return function(_0x4f4e9f){if(!_0x4f4e9f){_0x1fbdd4['sendStatus'](0x194);}return _0x4f4e9f;};}function handleError(_0x4c5ba9,_0x1caedb){_0x1caedb=_0x1caedb||0x1f4;return function(_0x453d97){logger[_0x89c8('0x26')](_0x453d97['stack']);if(_0x453d97['name']){delete _0x453d97[_0x89c8('0x27')];}_0x4c5ba9[_0x89c8('0x19')](_0x1caedb)['send'](_0x453d97);};}exports[_0x89c8('0x28')]=function(_0x25bd11,_0x52f081){var _0x3f61d3={},_0x4098da={},_0xe1bd9c={'count':0x0,'rows':[]};var _0x2e9c21=_[_0x89c8('0x29')](db[_0x89c8('0x2a')][_0x89c8('0x2b')],function(_0x32ebce){return{'name':_0x32ebce['fieldName'],'type':_0x32ebce[_0x89c8('0x2c')][_0x89c8('0x2d')]};});_0x4098da[_0x89c8('0x2e')]=_['map'](_0x2e9c21,_0x89c8('0x27'));_0x4098da['query']=_['keys'](_0x25bd11[_0x89c8('0x2f')]);_0x4098da[_0x89c8('0x30')]=_[_0x89c8('0x31')](_0x4098da[_0x89c8('0x2e')],_0x4098da[_0x89c8('0x2f')]);_0x3f61d3['attributes']=_['intersection'](_0x4098da['model'],qs[_0x89c8('0x32')](_0x25bd11[_0x89c8('0x2f')]['fields']));_0x3f61d3[_0x89c8('0x33')]=_0x3f61d3[_0x89c8('0x33')]['length']?_0x3f61d3[_0x89c8('0x33')]:_0x4098da['model'];if(!_0x25bd11[_0x89c8('0x2f')][_0x89c8('0x34')](_0x89c8('0x35'))){_0x3f61d3[_0x89c8('0x1d')]=qs[_0x89c8('0x1d')](_0x25bd11['query']['limit']);_0x3f61d3[_0x89c8('0x1b')]=qs[_0x89c8('0x1b')](_0x25bd11[_0x89c8('0x2f')][_0x89c8('0x1b')]);}_0x3f61d3[_0x89c8('0x36')]=qs[_0x89c8('0x37')](_0x25bd11[_0x89c8('0x2f')]['sort']);_0x3f61d3[_0x89c8('0x38')]=qs[_0x89c8('0x30')](_[_0x89c8('0x39')](_0x25bd11[_0x89c8('0x2f')],_0x4098da[_0x89c8('0x30')]),_0x2e9c21);if(_0x25bd11['query'][_0x89c8('0x3a')]){_0x3f61d3[_0x89c8('0x38')]=_['merge'](_0x3f61d3[_0x89c8('0x38')],{'$or':_['map'](_0x2e9c21,function(_0x4d5924){if(_0x4d5924[_0x89c8('0x2c')]!=='VIRTUAL'){var _0x461b7b={};_0x461b7b[_0x4d5924['name']]={'$like':'%'+_0x25bd11[_0x89c8('0x2f')]['filter']+'%'};return _0x461b7b;}})});}_0x3f61d3=_[_0x89c8('0x3b')]({},_0x3f61d3,_0x25bd11[_0x89c8('0x3c')]);var _0x2385a6={'where':_0x3f61d3[_0x89c8('0x38')]};return db[_0x89c8('0x2a')][_0x89c8('0x1e')](_0x2385a6)['then'](function(_0x2aa079){_0xe1bd9c[_0x89c8('0x1e')]=_0x2aa079;if(_0x25bd11[_0x89c8('0x2f')][_0x89c8('0x3d')]){_0x3f61d3[_0x89c8('0x3e')]=[{'all':!![]}];}return db[_0x89c8('0x2a')][_0x89c8('0x3f')](_0x3f61d3);})[_0x89c8('0x23')](function(_0x7ff405){_0xe1bd9c[_0x89c8('0x40')]=_0x7ff405;return _0xe1bd9c;})['then'](respondWithFilteredResult(_0x52f081,_0x3f61d3))[_0x89c8('0x41')](handleError(_0x52f081,null));};exports[_0x89c8('0x42')]=function(_0x5012ef,_0x4945f6){var _0x1fb4e0={'raw':!![],'where':{'id':_0x5012ef[_0x89c8('0x43')]['id']}},_0x47b0bc={};_0x47b0bc[_0x89c8('0x2e')]=_[_0x89c8('0x44')](db[_0x89c8('0x2a')][_0x89c8('0x2b')]);_0x47b0bc[_0x89c8('0x2f')]=_[_0x89c8('0x44')](_0x5012ef[_0x89c8('0x2f')]);_0x47b0bc[_0x89c8('0x30')]=_['intersection'](_0x47b0bc[_0x89c8('0x2e')],_0x47b0bc[_0x89c8('0x2f')]);_0x1fb4e0[_0x89c8('0x33')]=_['intersection'](_0x47b0bc[_0x89c8('0x2e')],qs[_0x89c8('0x32')](_0x5012ef['query'][_0x89c8('0x32')]));_0x1fb4e0[_0x89c8('0x33')]=_0x1fb4e0[_0x89c8('0x33')][_0x89c8('0x45')]?_0x1fb4e0[_0x89c8('0x33')]:_0x47b0bc['model'];if(_0x5012ef[_0x89c8('0x2f')]['includeAll']){_0x1fb4e0[_0x89c8('0x3e')]=[{'all':!![]}];}_0x1fb4e0=_[_0x89c8('0x3b')]({},_0x1fb4e0,_0x5012ef['options']);return db[_0x89c8('0x2a')][_0x89c8('0x46')](_0x1fb4e0)[_0x89c8('0x23')](handleEntityNotFound(_0x4945f6,null))[_0x89c8('0x23')](respondWithResult(_0x4945f6,null))[_0x89c8('0x41')](handleError(_0x4945f6,null));};exports[_0x89c8('0x47')]=function(_0x2b1863,_0x4de047){return db[_0x89c8('0x2a')][_0x89c8('0x47')](_0x2b1863['body'],{})[_0x89c8('0x23')](function(_0x28bf56){var _0x2414da=_0x2b1863[_0x89c8('0x48')]['get']({'plain':!![]});if(!_0x2414da)throw new Error(_0x89c8('0x49'));if(_0x2414da[_0x89c8('0x4a')]==='user'){var _0x4b0ecc=_0x28bf56[_0x89c8('0x24')]({'plain':!![]});var _0xb8428f=_0x89c8('0x4b');return db[_0x89c8('0x4c')][_0x89c8('0x46')]({'where':{'name':_0xb8428f,'userProfileId':_0x2414da['userProfileId']},'raw':!![]})[_0x89c8('0x23')](function(_0x5587ed){if(_0x5587ed&&_0x5587ed[_0x89c8('0x4d')]===0x0){return db[_0x89c8('0x4e')][_0x89c8('0x47')]({'name':_0x4b0ecc[_0x89c8('0x27')],'resourceId':_0x4b0ecc['id'],'type':_0x5587ed['name'],'sectionId':_0x5587ed['id']},{})[_0x89c8('0x23')](function(){return _0x28bf56;});}else{return _0x28bf56;}})[_0x89c8('0x41')](function(_0x34dadd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34dadd);throw _0x34dadd;});}return _0x28bf56;})[_0x89c8('0x23')](respondWithResult(_0x4de047,0xc9))['catch'](handleError(_0x4de047,null));};exports['update']=function(_0x26533c,_0x25cbd2){if(_0x26533c[_0x89c8('0x4f')]['id']){delete _0x26533c[_0x89c8('0x4f')]['id'];}return db[_0x89c8('0x2a')][_0x89c8('0x46')]({'where':{'id':_0x26533c[_0x89c8('0x43')]['id']}})['then'](handleEntityNotFound(_0x25cbd2,null))[_0x89c8('0x23')](saveUpdates(_0x26533c[_0x89c8('0x4f')],null))[_0x89c8('0x23')](respondWithResult(_0x25cbd2,null))[_0x89c8('0x41')](handleError(_0x25cbd2,null));};exports[_0x89c8('0x25')]=function(_0x255fcd,_0x578a86){return db[_0x89c8('0x2a')][_0x89c8('0x46')]({'where':{'id':_0x255fcd[_0x89c8('0x43')]['id']}})[_0x89c8('0x23')](handleEntityNotFound(_0x578a86,null))[_0x89c8('0x23')](removeEntity(_0x578a86,null))['catch'](handleError(_0x578a86,null));}; \ No newline at end of file +var _0xec86=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','apply','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','params','find','create','body','user'];(function(_0x1c2dc2,_0x16fb70){var _0x222bf1=function(_0x593f9e){while(--_0x593f9e){_0x1c2dc2['push'](_0x1c2dc2['shift']());}};_0x222bf1(++_0x16fb70);}(_0xec86,0x14e));var _0x6ec8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xec86[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0x6ec8('0x0'));var rimraf=require(_0x6ec8('0x1'));var zipdir=require(_0x6ec8('0x2'));var jsonpatch=require(_0x6ec8('0x3'));var rp=require(_0x6ec8('0x4'));var moment=require(_0x6ec8('0x5'));var BPromise=require(_0x6ec8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6ec8('0x7'));var csv=require(_0x6ec8('0x8'));var ejs=require(_0x6ec8('0x9'));var fs=require('fs');var fs_extra=require(_0x6ec8('0xa'));var _=require('lodash');var squel=require(_0x6ec8('0xb'));var crypto=require(_0x6ec8('0xc'));var jsforce=require(_0x6ec8('0xd'));var deskjs=require(_0x6ec8('0xe'));var toCsv=require(_0x6ec8('0x8'));var querystring=require(_0x6ec8('0xf'));var Papa=require('papaparse');var Redis=require(_0x6ec8('0x10'));var authService=require(_0x6ec8('0x11'));var qs=require(_0x6ec8('0x12'));var as=require(_0x6ec8('0x13'));var hardwareService=require(_0x6ec8('0x14'));var logger=require(_0x6ec8('0x15'))(_0x6ec8('0x16'));var utils=require(_0x6ec8('0x17'));var config=require(_0x6ec8('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e9088,_0x1aa72a){_0x1aa72a=_0x1aa72a||0xcc;return function(_0x3f335d){if(_0x3f335d){return _0x4e9088[_0x6ec8('0x19')](_0x1aa72a);}return _0x4e9088[_0x6ec8('0x1a')](_0x1aa72a)[_0x6ec8('0x1b')]();};}function respondWithResult(_0x57d9ef,_0x2a0f17){_0x2a0f17=_0x2a0f17||0xc8;return function(_0x4a37ff){if(_0x4a37ff){return _0x57d9ef[_0x6ec8('0x1a')](_0x2a0f17)[_0x6ec8('0x1c')](_0x4a37ff);}};}function respondWithFilteredResult(_0x51d33c,_0x15295c){return function(_0x2ab2ab){if(_0x2ab2ab){var _0x3b009d=typeof _0x15295c['offset']===_0x6ec8('0x1d')&&typeof _0x15295c[_0x6ec8('0x1e')]==='undefined';var _0x5378d7=_0x2ab2ab[_0x6ec8('0x1f')];var _0x5f0dc0=_0x3b009d?0x0:_0x15295c['offset'];var _0x529844=_0x3b009d?_0x2ab2ab[_0x6ec8('0x1f')]:_0x15295c['offset']+_0x15295c['limit'];var _0x51deb4;if(_0x529844>=_0x5378d7){_0x529844=_0x5378d7;_0x51deb4=0xc8;}else{_0x51deb4=0xce;}_0x51d33c['status'](_0x51deb4);return _0x51d33c['set']('Content-Range',_0x5f0dc0+'-'+_0x529844+'/'+_0x5378d7)[_0x6ec8('0x1c')](_0x2ab2ab);}return null;};}function patchUpdates(_0x1d0b54){return function(_0x55fa45){try{jsonpatch[_0x6ec8('0x20')](_0x55fa45,_0x1d0b54,!![]);}catch(_0x12da83){return BPromise['reject'](_0x12da83);}return _0x55fa45[_0x6ec8('0x21')]();};}function saveUpdates(_0x1a2458,_0x38ca88){return function(_0x373d88){if(_0x373d88){return _0x373d88[_0x6ec8('0x22')](_0x1a2458)[_0x6ec8('0x23')](function(_0x3e429c){return _0x3e429c;});}return null;};}function removeEntity(_0xdf6b09,_0xd8901){return function(_0x838bd0){if(_0x838bd0){return _0x838bd0[_0x6ec8('0x24')]()['then'](function(){var _0x488442=_0x838bd0[_0x6ec8('0x25')]({'plain':!![]});var _0x17f227=_0x6ec8('0x26');return db[_0x6ec8('0x27')][_0x6ec8('0x24')]({'where':{'type':_0x17f227,'resourceId':_0x488442['id']}})[_0x6ec8('0x23')](function(){return _0x838bd0;});})[_0x6ec8('0x23')](function(){_0xdf6b09[_0x6ec8('0x1a')](0xcc)[_0x6ec8('0x1b')]();});}};}function handleEntityNotFound(_0x54f16d,_0x43d250){return function(_0x29aa50){if(!_0x29aa50){_0x54f16d['sendStatus'](0x194);}return _0x29aa50;};}function handleError(_0x147523,_0x2fe749){_0x2fe749=_0x2fe749||0x1f4;return function(_0x1f740b){logger[_0x6ec8('0x28')](_0x1f740b[_0x6ec8('0x29')]);if(_0x1f740b[_0x6ec8('0x2a')]){delete _0x1f740b[_0x6ec8('0x2a')];}_0x147523[_0x6ec8('0x1a')](_0x2fe749)[_0x6ec8('0x2b')](_0x1f740b);};}exports[_0x6ec8('0x2c')]=function(_0x9c0558,_0x4cfbed){var _0x25bbe7={},_0x18fd7e={},_0x219360={'count':0x0,'rows':[]};var _0x1fb018=_[_0x6ec8('0x2d')](db[_0x6ec8('0x2e')][_0x6ec8('0x2f')],function(_0x1125b6){return{'name':_0x1125b6[_0x6ec8('0x30')],'type':_0x1125b6['type'][_0x6ec8('0x31')]};});_0x18fd7e[_0x6ec8('0x32')]=_[_0x6ec8('0x2d')](_0x1fb018,'name');_0x18fd7e[_0x6ec8('0x33')]=_[_0x6ec8('0x34')](_0x9c0558[_0x6ec8('0x33')]);_0x18fd7e[_0x6ec8('0x35')]=_[_0x6ec8('0x36')](_0x18fd7e[_0x6ec8('0x32')],_0x18fd7e[_0x6ec8('0x33')]);_0x25bbe7[_0x6ec8('0x37')]=_['intersection'](_0x18fd7e[_0x6ec8('0x32')],qs['fields'](_0x9c0558[_0x6ec8('0x33')][_0x6ec8('0x38')]));_0x25bbe7[_0x6ec8('0x37')]=_0x25bbe7[_0x6ec8('0x37')][_0x6ec8('0x39')]?_0x25bbe7[_0x6ec8('0x37')]:_0x18fd7e[_0x6ec8('0x32')];if(!_0x9c0558['query']['hasOwnProperty'](_0x6ec8('0x3a'))){_0x25bbe7[_0x6ec8('0x1e')]=qs[_0x6ec8('0x1e')](_0x9c0558[_0x6ec8('0x33')][_0x6ec8('0x1e')]);_0x25bbe7[_0x6ec8('0x3b')]=qs['offset'](_0x9c0558[_0x6ec8('0x33')]['offset']);}_0x25bbe7[_0x6ec8('0x3c')]=qs[_0x6ec8('0x3d')](_0x9c0558['query']['sort']);_0x25bbe7[_0x6ec8('0x3e')]=qs[_0x6ec8('0x35')](_['pick'](_0x9c0558[_0x6ec8('0x33')],_0x18fd7e['filters']),_0x1fb018);if(_0x9c0558[_0x6ec8('0x33')][_0x6ec8('0x3f')]){_0x25bbe7[_0x6ec8('0x3e')]=_[_0x6ec8('0x40')](_0x25bbe7[_0x6ec8('0x3e')],{'$or':_[_0x6ec8('0x2d')](_0x1fb018,function(_0x563828){if(_0x563828[_0x6ec8('0x41')]!=='VIRTUAL'){var _0x2b707c={};_0x2b707c[_0x563828[_0x6ec8('0x2a')]]={'$like':'%'+_0x9c0558[_0x6ec8('0x33')][_0x6ec8('0x3f')]+'%'};return _0x2b707c;}})});}_0x25bbe7=_[_0x6ec8('0x40')]({},_0x25bbe7,_0x9c0558[_0x6ec8('0x42')]);var _0x2110fd={'where':_0x25bbe7[_0x6ec8('0x3e')]};return db['CmContactHasItem'][_0x6ec8('0x1f')](_0x2110fd)[_0x6ec8('0x23')](function(_0x9b61e2){_0x219360['count']=_0x9b61e2;if(_0x9c0558[_0x6ec8('0x33')][_0x6ec8('0x43')]){_0x25bbe7[_0x6ec8('0x44')]=[{'all':!![]}];}return db[_0x6ec8('0x2e')][_0x6ec8('0x45')](_0x25bbe7);})[_0x6ec8('0x23')](function(_0x165c65){_0x219360['rows']=_0x165c65;return _0x219360;})[_0x6ec8('0x23')](respondWithFilteredResult(_0x4cfbed,_0x25bbe7))[_0x6ec8('0x46')](handleError(_0x4cfbed,null));};exports['show']=function(_0x58ee1c,_0x1f3bb4){var _0x517aba={'raw':!![],'where':{'id':_0x58ee1c[_0x6ec8('0x47')]['id']}},_0x1a3571={};_0x1a3571['model']=_[_0x6ec8('0x34')](db['CmContactHasItem'][_0x6ec8('0x2f')]);_0x1a3571[_0x6ec8('0x33')]=_['keys'](_0x58ee1c[_0x6ec8('0x33')]);_0x1a3571[_0x6ec8('0x35')]=_[_0x6ec8('0x36')](_0x1a3571[_0x6ec8('0x32')],_0x1a3571['query']);_0x517aba['attributes']=_[_0x6ec8('0x36')](_0x1a3571[_0x6ec8('0x32')],qs[_0x6ec8('0x38')](_0x58ee1c[_0x6ec8('0x33')][_0x6ec8('0x38')]));_0x517aba[_0x6ec8('0x37')]=_0x517aba[_0x6ec8('0x37')]['length']?_0x517aba[_0x6ec8('0x37')]:_0x1a3571[_0x6ec8('0x32')];if(_0x58ee1c[_0x6ec8('0x33')][_0x6ec8('0x43')]){_0x517aba['include']=[{'all':!![]}];}_0x517aba=_[_0x6ec8('0x40')]({},_0x517aba,_0x58ee1c[_0x6ec8('0x42')]);return db[_0x6ec8('0x2e')][_0x6ec8('0x48')](_0x517aba)['then'](handleEntityNotFound(_0x1f3bb4,null))['then'](respondWithResult(_0x1f3bb4,null))[_0x6ec8('0x46')](handleError(_0x1f3bb4,null));};exports[_0x6ec8('0x49')]=function(_0xc3b83a,_0x494522){return db['CmContactHasItem'][_0x6ec8('0x49')](_0xc3b83a[_0x6ec8('0x4a')],{})[_0x6ec8('0x23')](function(_0x5769e7){var _0x5abe46=_0xc3b83a[_0x6ec8('0x4b')]['get']({'plain':!![]});if(!_0x5abe46)throw new Error(_0x6ec8('0x4c'));if(_0x5abe46[_0x6ec8('0x4d')]===_0x6ec8('0x4b')){var _0x3c2361=_0x5769e7['get']({'plain':!![]});var _0xc9876e=_0x6ec8('0x26');return db[_0x6ec8('0x4e')]['find']({'where':{'name':_0xc9876e,'userProfileId':_0x5abe46[_0x6ec8('0x4f')]},'raw':!![]})[_0x6ec8('0x23')](function(_0x136194){if(_0x136194&&_0x136194[_0x6ec8('0x50')]===0x0){return db[_0x6ec8('0x27')]['create']({'name':_0x3c2361[_0x6ec8('0x2a')],'resourceId':_0x3c2361['id'],'type':_0x136194[_0x6ec8('0x2a')],'sectionId':_0x136194['id']},{})[_0x6ec8('0x23')](function(){return _0x5769e7;});}else{return _0x5769e7;}})['catch'](function(_0xba5a3){logger[_0x6ec8('0x28')](_0x6ec8('0x51'),_0xba5a3);throw _0xba5a3;});}return _0x5769e7;})['then'](respondWithResult(_0x494522,0xc9))[_0x6ec8('0x46')](handleError(_0x494522,null));};exports[_0x6ec8('0x22')]=function(_0x149503,_0x522330){if(_0x149503[_0x6ec8('0x4a')]['id']){delete _0x149503[_0x6ec8('0x4a')]['id'];}return db[_0x6ec8('0x2e')][_0x6ec8('0x48')]({'where':{'id':_0x149503[_0x6ec8('0x47')]['id']}})[_0x6ec8('0x23')](handleEntityNotFound(_0x522330,null))[_0x6ec8('0x23')](saveUpdates(_0x149503['body'],null))['then'](respondWithResult(_0x522330,null))['catch'](handleError(_0x522330,null));};exports[_0x6ec8('0x24')]=function(_0x1d90b1,_0x266e50){return db[_0x6ec8('0x2e')][_0x6ec8('0x48')]({'where':{'id':_0x1d90b1[_0x6ec8('0x47')]['id']}})['then'](handleEntityNotFound(_0x266e50,null))['then'](removeEntity(_0x266e50,null))[_0x6ec8('0x46')](handleError(_0x266e50,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 25cfed6..a983d96 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 _0xd90a=['exports','cm_contact_has_items','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x1ad0ba,_0x122b20){var _0x4a6065=function(_0x3daead){while(--_0x3daead){_0x1ad0ba['push'](_0x1ad0ba['shift']());}};_0x4a6065(++_0x122b20);}(_0xd90a,0x1c5));var _0xad90=function(_0x4b7bad,_0x135acf){_0x4b7bad=_0x4b7bad-0x0;var _0x4da111=_0xd90a[_0x4b7bad];return _0x4da111;};'use strict';var _=require(_0xad90('0x0'));var util=require(_0xad90('0x1'));var logger=require(_0xad90('0x2'))(_0xad90('0x3'));var moment=require(_0xad90('0x4'));var BPromise=require('bluebird');var rp=require(_0xad90('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad90('0x6'));var config=require(_0xad90('0x7'));var attributes=require(_0xad90('0x8'));module[_0xad90('0x9')]=function(_0x8ce7dc,_0x236550){return _0x8ce7dc['define']('CmContactHasItem',attributes,{'tableName':_0xad90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4da=['moment','bluebird','request-promise','path','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api'];(function(_0x271648,_0x2da8df){var _0x37440d=function(_0x5ef531){while(--_0x5ef531){_0x271648['push'](_0x271648['shift']());}};_0x37440d(++_0x2da8df);}(_0xb4da,0xb2));var _0xab4d=function(_0x1a6bdf,_0x3d21fc){_0x1a6bdf=_0x1a6bdf-0x0;var _0x14eb6e=_0xb4da[_0x1a6bdf];return _0x14eb6e;};'use strict';var _=require(_0xab4d('0x0'));var util=require(_0xab4d('0x1'));var logger=require(_0xab4d('0x2'))(_0xab4d('0x3'));var moment=require(_0xab4d('0x4'));var BPromise=require(_0xab4d('0x5'));var rp=require(_0xab4d('0x6'));var fs=require('fs');var path=require(_0xab4d('0x7'));var rimraf=require('rimraf');var config=require(_0xab4d('0x8'));var attributes=require(_0xab4d('0x9'));module[_0xab4d('0xa')]=function(_0x3e03f2,_0x5cac48){return _0x3e03f2['define'](_0xab4d('0xb'),attributes,{'tableName':_0xab4d('0xc'),'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 d9bf0b0..5941031 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 _0x124c=['then','info','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x330bc7,_0x448e0a){var _0x4db2ab=function(_0x441b07){while(--_0x441b07){_0x330bc7['push'](_0x330bc7['shift']());}};_0x4db2ab(++_0x448e0a);}(_0x124c,0x66));var _0xc124=function(_0x3e0c99,_0x366270){_0x3e0c99=_0x3e0c99-0x0;var _0x2ae22d=_0x124c[_0x3e0c99];return _0x2ae22d;};'use strict';var _=require(_0xc124('0x0'));var util=require(_0xc124('0x1'));var moment=require(_0xc124('0x2'));var BPromise=require(_0xc124('0x3'));var rs=require(_0xc124('0x4'));var fs=require('fs');var Redis=require(_0xc124('0x5'));var db=require(_0xc124('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc124('0x7'))(_0xc124('0x8'));var config=require(_0xc124('0x9'));var jayson=require(_0xc124('0xa'));var client=jayson[_0xc124('0xb')][_0xc124('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f3be6,_0x252fa9,_0x3da5c7){return new BPromise(function(_0x3cd15d,_0x3b7a36){return client['request'](_0x1f3be6,_0x3da5c7)[_0xc124('0xd')](function(_0x10541c){logger[_0xc124('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x252fa9,'request\x20sent');logger['debug'](_0xc124('0xf'),_0x252fa9,'request\x20sent',JSON[_0xc124('0x10')](_0x10541c));if(_0x10541c[_0xc124('0x11')]){if(_0x10541c[_0xc124('0x11')][_0xc124('0x12')]===0x1f4){logger[_0xc124('0x11')](_0xc124('0x13'),_0x252fa9,_0x10541c[_0xc124('0x11')][_0xc124('0x14')]);return _0x3b7a36(_0x10541c[_0xc124('0x11')][_0xc124('0x14')]);}logger[_0xc124('0x11')](_0xc124('0x13'),_0x252fa9,_0x10541c[_0xc124('0x11')][_0xc124('0x14')]);return _0x3cd15d(_0x10541c[_0xc124('0x11')][_0xc124('0x14')]);}else{logger[_0xc124('0xe')](_0xc124('0x13'),_0x252fa9,_0xc124('0x15'));_0x3cd15d(_0x10541c['result'][_0xc124('0x14')]);}})[_0xc124('0x16')](function(_0xd1a61d){logger[_0xc124('0x11')](_0xc124('0x13'),_0x252fa9,_0xd1a61d);_0x3b7a36(_0xd1a61d);});});} \ No newline at end of file +var _0x861b=['client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x861b,0x1e9));var _0xb861=function(_0x251ae7,_0xa8af83){_0x251ae7=_0x251ae7-0x0;var _0x38aed7=_0x861b[_0x251ae7];return _0x38aed7;};'use strict';var _=require(_0xb861('0x0'));var util=require(_0xb861('0x1'));var moment=require('moment');var BPromise=require(_0xb861('0x2'));var rs=require(_0xb861('0x3'));var fs=require('fs');var Redis=require(_0xb861('0x4'));var db=require(_0xb861('0x5'))['db'];var utils=require(_0xb861('0x6'));var logger=require(_0xb861('0x7'))(_0xb861('0x8'));var config=require(_0xb861('0x9'));var jayson=require(_0xb861('0xa'));var client=jayson[_0xb861('0xb')][_0xb861('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e0365,_0x5e8e67,_0x2e8070){return new BPromise(function(_0x5a0fd1,_0x3af76f){return client[_0xb861('0xd')](_0x4e0365,_0x2e8070)[_0xb861('0xe')](function(_0xc5bd62){logger[_0xb861('0xf')](_0xb861('0x10'),_0x5e8e67,'request\x20sent');logger[_0xb861('0x11')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x5e8e67,_0xb861('0x12'),JSON[_0xb861('0x13')](_0xc5bd62));if(_0xc5bd62[_0xb861('0x14')]){if(_0xc5bd62[_0xb861('0x14')][_0xb861('0x15')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x5e8e67,_0xc5bd62['error']['message']);return _0x3af76f(_0xc5bd62[_0xb861('0x14')][_0xb861('0x16')]);}logger['error'](_0xb861('0x10'),_0x5e8e67,_0xc5bd62[_0xb861('0x14')][_0xb861('0x16')]);return _0x5a0fd1(_0xc5bd62['error'][_0xb861('0x16')]);}else{logger[_0xb861('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x5e8e67,_0xb861('0x12'));_0x5a0fd1(_0xc5bd62[_0xb861('0x17')]['message']);}})[_0xb861('0x18')](function(_0x4ae43a){logger[_0xb861('0x14')]('CmContactHasItem,\x20%s,\x20%s',_0x5e8e67,_0x4ae43a);_0x3af76f(_0x4ae43a);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 4d6b84c..c47d8da 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 _0x8b4c=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0x22d2f4,_0x6da5e5){var _0x29c4c1=function(_0x1d6864){while(--_0x1d6864){_0x22d2f4['push'](_0x22d2f4['shift']());}};_0x29c4c1(++_0x6da5e5);}(_0x8b4c,0x120));var _0xc8b4=function(_0x490502,_0x5359cc){_0x490502=_0x490502-0x0;var _0x28ccbf=_0x8b4c[_0x490502];return _0x28ccbf;};'use strict';var multer=require(_0xc8b4('0x0'));var util=require('util');var path=require(_0xc8b4('0x1'));var timeout=require(_0xc8b4('0x2'));var express=require('express');var router=express[_0xc8b4('0x3')]();var fs_extra=require(_0xc8b4('0x4'));var auth=require(_0xc8b4('0x5'));var interaction=require(_0xc8b4('0x6'));var config=require(_0xc8b4('0x7'));var controller=require('./cmContactHasItem.controller');router[_0xc8b4('0x8')]('/',auth[_0xc8b4('0x9')](),controller[_0xc8b4('0xa')]);router[_0xc8b4('0x8')](_0xc8b4('0xb'),auth[_0xc8b4('0x9')](),controller[_0xc8b4('0xc')]);router['post']('/',auth[_0xc8b4('0x9')](),controller[_0xc8b4('0xd')]);router[_0xc8b4('0xe')](_0xc8b4('0xb'),auth['isAuthenticated'](),controller[_0xc8b4('0xf')]);router[_0xc8b4('0x10')](_0xc8b4('0xb'),auth['isAuthenticated'](),controller[_0xc8b4('0x11')]);module['exports']=router; \ No newline at end of file +var _0x80e4=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x3e1c37,_0x433fc7){var _0x29d262=function(_0x1f9490){while(--_0x1f9490){_0x3e1c37['push'](_0x3e1c37['shift']());}};_0x29d262(++_0x433fc7);}(_0x80e4,0x103));var _0x480e=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0x80e4[_0x1ba43c];return _0x2f60eb;};'use strict';var multer=require(_0x480e('0x0'));var util=require(_0x480e('0x1'));var path=require(_0x480e('0x2'));var timeout=require('connect-timeout');var express=require(_0x480e('0x3'));var router=express[_0x480e('0x4')]();var fs_extra=require(_0x480e('0x5'));var auth=require(_0x480e('0x6'));var interaction=require(_0x480e('0x7'));var config=require('../../config/environment');var controller=require(_0x480e('0x8'));router[_0x480e('0x9')]('/',auth[_0x480e('0xa')](),controller[_0x480e('0xb')]);router[_0x480e('0x9')](_0x480e('0xc'),auth[_0x480e('0xa')](),controller[_0x480e('0xd')]);router[_0x480e('0xe')]('/',auth[_0x480e('0xa')](),controller[_0x480e('0xf')]);router[_0x480e('0x10')]('/:id',auth[_0x480e('0xa')](),controller[_0x480e('0x11')]);router[_0x480e('0x12')](_0x480e('0xc'),auth[_0x480e('0xa')](),controller[_0x480e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index ba7ef3a..438759a 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 _0xc17a=['ENUM','voice','sequelize','exports','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type','select','values','isArray','stringify','BOOLEAN'];(function(_0x153843,_0x2771e7){var _0x4dffe1=function(_0x824238){while(--_0x824238){_0x153843['push'](_0x153843['shift']());}};_0x4dffe1(++_0x2771e7);}(_0xc17a,0x123));var _0xac17=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc17a[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xac17('0x0'));var _=require('lodash');module[_0xac17('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x52a463){return this[_0xac17('0x2')](_0xac17('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x48f33c){this[_0xac17('0x4')](_0xac17('0x3'),_0x48f33c?_0x48f33c:this['getDataValue'](_0xac17('0x5')));}},'type':{'type':Sequelize[_0xac17('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xac17('0x7')](_0xac17('0x8')),'get':function(){if(this[_0xac17('0x2')](_0xac17('0x9'))===_0xac17('0xa')){return JSON['parse'](this['getDataValue']('values'));}else{return this[_0xac17('0x2')](_0xac17('0xb'));}},'set':function(_0x1cc322){if(Array[_0xac17('0xc')](_0x1cc322)){this['setDataValue'](_0xac17('0xb'),JSON[_0xac17('0xd')](_0x1cc322));}else{this[_0xac17('0x4')](_0xac17('0xb'),_0x1cc322);}}},'required':{'type':Sequelize[_0xac17('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xac17('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xac17('0xf')](_0xac17('0x10'))}}; \ No newline at end of file +var _0x5909=['TEXT','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','getDataValue','alias','setDataValue','name'];(function(_0x3957dc,_0x525687){var _0x107bc4=function(_0x59ab60){while(--_0x59ab60){_0x3957dc['push'](_0x3957dc['shift']());}};_0x107bc4(++_0x525687);}(_0x5909,0x16f));var _0x9590=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x5909[_0x562f3b];return _0x1edd55;};'use strict';var Sequelize=require(_0x9590('0x0'));var _=require('lodash');module[_0x9590('0x1')]={'name':{'type':Sequelize[_0x9590('0x2')],'get':function(_0x170542){return this[_0x9590('0x3')](_0x9590('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x144d03){this[_0x9590('0x5')]('alias',_0x144d03?_0x144d03:this[_0x9590('0x3')](_0x9590('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x9590('0x7')]('long'),'get':function(){if(this[_0x9590('0x3')](_0x9590('0x8'))===_0x9590('0x9')){return JSON[_0x9590('0xa')](this[_0x9590('0x3')]('values'));}else{return this[_0x9590('0x3')](_0x9590('0xb'));}},'set':function(_0x319847){if(Array[_0x9590('0xc')](_0x319847)){this['setDataValue'](_0x9590('0xb'),JSON[_0x9590('0xd')](_0x319847));}else{this['setDataValue'](_0x9590('0xb'),_0x319847);}}},'required':{'type':Sequelize[_0x9590('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x9590('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x9590('0xf')](_0x9590('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index c6c89cd..b1f7b06 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 _0x6dce=['offset','limit','undefined','count','apply','reject','update','then','destroy','error','stack','name','map','CmCustomField','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','rawAttributes','includeAll','body','find','params','sequelize','create','TEXT','text','Sequelize','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x3f2ae8,_0x1e8db2){var _0x1f3159=function(_0x107f51){while(--_0x107f51){_0x3f2ae8['push'](_0x3f2ae8['shift']());}};_0x1f3159(++_0x1e8db2);}(_0x6dce,0xe7));var _0xe6dc=function(_0x2c71f4,_0x4525d4){_0x2c71f4=_0x2c71f4-0x0;var _0x4565dd=_0x6dce[_0x2c71f4];return _0x4565dd;};'use strict';var emlformat=require(_0xe6dc('0x0'));var rimraf=require(_0xe6dc('0x1'));var zipdir=require(_0xe6dc('0x2'));var jsonpatch=require(_0xe6dc('0x3'));var rp=require(_0xe6dc('0x4'));var moment=require(_0xe6dc('0x5'));var BPromise=require(_0xe6dc('0x6'));var Mustache=require(_0xe6dc('0x7'));var util=require(_0xe6dc('0x8'));var path=require(_0xe6dc('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe6dc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6dc('0xb'));var squel=require(_0xe6dc('0xc'));var crypto=require(_0xe6dc('0xd'));var jsforce=require(_0xe6dc('0xe'));var deskjs=require(_0xe6dc('0xf'));var toCsv=require(_0xe6dc('0x10'));var querystring=require('querystring');var Papa=require(_0xe6dc('0x11'));var Redis=require(_0xe6dc('0x12'));var authService=require(_0xe6dc('0x13'));var qs=require(_0xe6dc('0x14'));var as=require(_0xe6dc('0x15'));var hardwareService=require(_0xe6dc('0x16'));var logger=require('../../config/logger')(_0xe6dc('0x17'));var utils=require(_0xe6dc('0x18'));var config=require(_0xe6dc('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c2c47,_0x4e1731){_0x4e1731=_0x4e1731||0xcc;return function(_0x276396){if(_0x276396){return _0x3c2c47[_0xe6dc('0x1a')](_0x4e1731);}return _0x3c2c47[_0xe6dc('0x1b')](_0x4e1731)[_0xe6dc('0x1c')]();};}function respondWithResult(_0x2dc656,_0x3f424b){_0x3f424b=_0x3f424b||0xc8;return function(_0x3aa173){if(_0x3aa173){return _0x2dc656[_0xe6dc('0x1b')](_0x3f424b)[_0xe6dc('0x1d')](_0x3aa173);}};}function respondWithFilteredResult(_0x35686e,_0x3cad25){return function(_0x291c0b){if(_0x291c0b){var _0x5bd04d=typeof _0x3cad25[_0xe6dc('0x1e')]==='undefined'&&typeof _0x3cad25[_0xe6dc('0x1f')]===_0xe6dc('0x20');var _0x51506b=_0x291c0b[_0xe6dc('0x21')];var _0x3119dc=_0x5bd04d?0x0:_0x3cad25['offset'];var _0x309541=_0x5bd04d?_0x291c0b[_0xe6dc('0x21')]:_0x3cad25[_0xe6dc('0x1e')]+_0x3cad25[_0xe6dc('0x1f')];var _0xdf9699;if(_0x309541>=_0x51506b){_0x309541=_0x51506b;_0xdf9699=0xc8;}else{_0xdf9699=0xce;}_0x35686e[_0xe6dc('0x1b')](_0xdf9699);return _0x35686e['set']('Content-Range',_0x3119dc+'-'+_0x309541+'/'+_0x51506b)[_0xe6dc('0x1d')](_0x291c0b);}return null;};}function patchUpdates(_0x4c0d13){return function(_0x19bf79){try{jsonpatch[_0xe6dc('0x22')](_0x19bf79,_0x4c0d13,!![]);}catch(_0x55aed1){return BPromise[_0xe6dc('0x23')](_0x55aed1);}return _0x19bf79['save']();};}function saveUpdates(_0x165b28,_0xe93266){return function(_0x158fe5){if(_0x158fe5){return _0x158fe5[_0xe6dc('0x24')](_0x165b28)[_0xe6dc('0x25')](function(_0x5ab36b){return _0x5ab36b;});}return null;};}function removeEntity(_0x3e736a,_0x4f8cd1){return function(_0x38c468){if(_0x38c468){return _0x38c468[_0xe6dc('0x26')]()[_0xe6dc('0x25')](function(){_0x3e736a[_0xe6dc('0x1b')](0xcc)[_0xe6dc('0x1c')]();});}};}function handleEntityNotFound(_0x5b15c3,_0x1b5243){return function(_0x574241){if(!_0x574241){_0x5b15c3[_0xe6dc('0x1a')](0x194);}return _0x574241;};}function handleError(_0x1f5c95,_0x4284dd){_0x4284dd=_0x4284dd||0x1f4;return function(_0x164f8e){logger[_0xe6dc('0x27')](_0x164f8e[_0xe6dc('0x28')]);if(_0x164f8e[_0xe6dc('0x29')]){delete _0x164f8e[_0xe6dc('0x29')];}_0x1f5c95[_0xe6dc('0x1b')](_0x4284dd)['send'](_0x164f8e);};}exports['index']=function(_0x2a63a8,_0x5eb3a4){var _0x7e841d={},_0x5c40af={},_0x17b0bf={'count':0x0,'rows':[]};var _0x4af582=_[_0xe6dc('0x2a')](db[_0xe6dc('0x2b')]['rawAttributes'],function(_0x3c810d){return{'name':_0x3c810d[_0xe6dc('0x2c')],'type':_0x3c810d[_0xe6dc('0x2d')]['key']};});_0x5c40af['model']=_['differenceBy'](_[_0xe6dc('0x2a')](_0x4af582,'name'),[_0xe6dc('0x29')]);_0x5c40af['query']=_[_0xe6dc('0x2e')](_0x2a63a8[_0xe6dc('0x2f')]);_0x5c40af['filters']=_[_0xe6dc('0x30')](_0x5c40af[_0xe6dc('0x31')],_0x5c40af['query']);_0x7e841d[_0xe6dc('0x32')]=_[_0xe6dc('0x30')](_0x5c40af[_0xe6dc('0x31')],qs[_0xe6dc('0x33')](_0x2a63a8[_0xe6dc('0x2f')][_0xe6dc('0x33')]));_0x7e841d[_0xe6dc('0x32')]=_0x7e841d[_0xe6dc('0x32')][_0xe6dc('0x34')]?_0x7e841d[_0xe6dc('0x32')]:_0x5c40af['model'];if(!_0x2a63a8[_0xe6dc('0x2f')][_0xe6dc('0x35')](_0xe6dc('0x36'))){_0x7e841d[_0xe6dc('0x1f')]=qs[_0xe6dc('0x1f')](_0x2a63a8['query'][_0xe6dc('0x1f')]);_0x7e841d[_0xe6dc('0x1e')]=qs[_0xe6dc('0x1e')](_0x2a63a8[_0xe6dc('0x2f')][_0xe6dc('0x1e')]);}_0x7e841d[_0xe6dc('0x37')]=qs['sort'](_0x2a63a8[_0xe6dc('0x2f')][_0xe6dc('0x38')]);_0x7e841d['where']=qs[_0xe6dc('0x39')](_['pick'](_0x2a63a8[_0xe6dc('0x2f')],_0x5c40af[_0xe6dc('0x39')]),_0x4af582);if(_0x2a63a8['query']['filter']){_0x7e841d[_0xe6dc('0x3a')]=_['merge'](_0x7e841d[_0xe6dc('0x3a')],{'$or':_[_0xe6dc('0x2a')](_0x4af582,function(_0xe8c36){if(_0xe8c36[_0xe6dc('0x2d')]!==_0xe6dc('0x3b')){var _0x5f1579={};_0x5f1579[_0xe8c36[_0xe6dc('0x29')]]={'$like':'%'+_0x2a63a8['query'][_0xe6dc('0x3c')]+'%'};return _0x5f1579;}})});}_0x7e841d=_[_0xe6dc('0x3d')]({},_0x7e841d,_0x2a63a8[_0xe6dc('0x3e')]);var _0x691534={'where':_0x7e841d[_0xe6dc('0x3a')]};return db['CmCustomField'][_0xe6dc('0x21')](_0x691534)[_0xe6dc('0x25')](function(_0x16d132){_0x17b0bf[_0xe6dc('0x21')]=_0x16d132;if(_0x2a63a8[_0xe6dc('0x2f')]['includeAll']){_0x7e841d[_0xe6dc('0x3f')]=[{'all':!![]}];}return db[_0xe6dc('0x2b')][_0xe6dc('0x40')](_0x7e841d);})[_0xe6dc('0x25')](function(_0x194d32){_0x17b0bf[_0xe6dc('0x41')]=_0x194d32;return _0x17b0bf;})[_0xe6dc('0x25')](respondWithFilteredResult(_0x5eb3a4,_0x7e841d))[_0xe6dc('0x42')](handleError(_0x5eb3a4,null));};exports[_0xe6dc('0x43')]=function(_0x6d92ef,_0x384de4){var _0x517e0f={'raw':!![],'where':{'id':_0x6d92ef['params']['id']}},_0x3e7a07={};_0x3e7a07[_0xe6dc('0x31')]=_[_0xe6dc('0x2e')](db[_0xe6dc('0x2b')][_0xe6dc('0x44')]);_0x3e7a07[_0xe6dc('0x2f')]=_['keys'](_0x6d92ef[_0xe6dc('0x2f')]);_0x3e7a07[_0xe6dc('0x39')]=_[_0xe6dc('0x30')](_0x3e7a07['model'],_0x3e7a07['query']);_0x517e0f[_0xe6dc('0x32')]=_['intersection'](_0x3e7a07[_0xe6dc('0x31')],qs[_0xe6dc('0x33')](_0x6d92ef[_0xe6dc('0x2f')][_0xe6dc('0x33')]));_0x517e0f[_0xe6dc('0x32')]=_0x517e0f[_0xe6dc('0x32')][_0xe6dc('0x34')]?_0x517e0f[_0xe6dc('0x32')]:_0x3e7a07[_0xe6dc('0x31')];if(_0x6d92ef[_0xe6dc('0x2f')][_0xe6dc('0x45')]){_0x517e0f[_0xe6dc('0x3f')]=[{'all':!![]}];}_0x517e0f=_[_0xe6dc('0x3d')]({},_0x517e0f,_0x6d92ef['options']);return db[_0xe6dc('0x2b')]['find'](_0x517e0f)[_0xe6dc('0x25')](handleEntityNotFound(_0x384de4,null))['then'](respondWithResult(_0x384de4,null))[_0xe6dc('0x42')](handleError(_0x384de4,null));};exports[_0xe6dc('0x24')]=function(_0x279bde,_0x371a6c){if(_0x279bde['body']['id']){delete _0x279bde[_0xe6dc('0x46')]['id'];}return db[_0xe6dc('0x2b')][_0xe6dc('0x47')]({'where':{'id':_0x279bde[_0xe6dc('0x48')]['id']}})['then'](handleEntityNotFound(_0x371a6c,null))[_0xe6dc('0x25')](saveUpdates(_0x279bde[_0xe6dc('0x46')],null))['then'](respondWithResult(_0x371a6c,null))[_0xe6dc('0x42')](handleError(_0x371a6c,null));};exports[_0xe6dc('0x26')]=function(_0x279b80,_0x31f74f){return db[_0xe6dc('0x2b')][_0xe6dc('0x47')]({'where':{'id':_0x279b80[_0xe6dc('0x48')]['id']}})[_0xe6dc('0x25')](handleEntityNotFound(_0x31f74f,null))[_0xe6dc('0x25')](removeEntity(_0x31f74f,null))[_0xe6dc('0x42')](handleError(_0x31f74f,null));};exports['create']=function(_0x4e47e1,_0x5b030c){var _0x1a2317;return db[_0xe6dc('0x49')]['transaction'](function(_0x4b2f59){return db[_0xe6dc('0x2b')][_0xe6dc('0x4a')](_0x4e47e1[_0xe6dc('0x46')],{'transaction':_0x4b2f59})[_0xe6dc('0x25')](function(_0x532732){_0x1a2317=_0x532732;var _0x1e0697={'type':db['Sequelize'][_0xe6dc('0x4b')],'transaction':_0x4b2f59};switch(_0x4e47e1[_0xe6dc('0x46')][_0xe6dc('0x2d')]){case _0xe6dc('0x4c'):_0x1e0697[_0xe6dc('0x2d')]=db[_0xe6dc('0x4d')][_0xe6dc('0x4b')];break;case _0xe6dc('0x4e'):_0x1e0697[_0xe6dc('0x2d')]=db[_0xe6dc('0x4d')][_0xe6dc('0x4f')];break;case _0xe6dc('0x50'):_0x1e0697['type']=db[_0xe6dc('0x4d')]['BOOLEAN'];_0x1e0697[_0xe6dc('0x51')]=![];break;default:}return db[_0xe6dc('0x49')][_0xe6dc('0x52')][_0xe6dc('0x53')](_0xe6dc('0x54'),util[_0xe6dc('0x55')](_0xe6dc('0x56'),_0x1a2317['id']),_0x1e0697);})[_0xe6dc('0x25')](function(){return _0x1a2317;});})[_0xe6dc('0x25')](respondWithResult(_0x5b030c,0xc9))[_0xe6dc('0x42')](handleError(_0x5b030c,null));}; \ No newline at end of file +var _0xdd55=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','update','body','destroy','params','sequelize','transaction','create','Sequelize','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%d','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end'];(function(_0x543369,_0x2edbcd){var _0x49e248=function(_0x578f72){while(--_0x578f72){_0x543369['push'](_0x543369['shift']());}};_0x49e248(++_0x2edbcd);}(_0xdd55,0x1e9));var _0x5dd5=function(_0x218d38,_0x78ea52){_0x218d38=_0x218d38-0x0;var _0x127c8a=_0xdd55[_0x218d38];return _0x127c8a;};'use strict';var emlformat=require(_0x5dd5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5dd5('0x1'));var rp=require(_0x5dd5('0x2'));var moment=require(_0x5dd5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5dd5('0x4'));var path=require(_0x5dd5('0x5'));var sox=require(_0x5dd5('0x6'));var csv=require(_0x5dd5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5dd5('0x8'));var crypto=require(_0x5dd5('0x9'));var jsforce=require(_0x5dd5('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5dd5('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5dd5('0xc'));var qs=require(_0x5dd5('0xd'));var as=require(_0x5dd5('0xe'));var hardwareService=require(_0x5dd5('0xf'));var logger=require('../../config/logger')(_0x5dd5('0x10'));var utils=require(_0x5dd5('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x5dd5('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3799f5,_0x2e3308){_0x2e3308=_0x2e3308||0xcc;return function(_0x3a0a8b){if(_0x3a0a8b){return _0x3799f5[_0x5dd5('0x13')](_0x2e3308);}return _0x3799f5['status'](_0x2e3308)[_0x5dd5('0x14')]();};}function respondWithResult(_0x4cd1ff,_0x46ad1a){_0x46ad1a=_0x46ad1a||0xc8;return function(_0x1b664e){if(_0x1b664e){return _0x4cd1ff[_0x5dd5('0x15')](_0x46ad1a)[_0x5dd5('0x16')](_0x1b664e);}};}function respondWithFilteredResult(_0x591bcf,_0x196539){return function(_0x80697e){if(_0x80697e){var _0x1f132e=typeof _0x196539[_0x5dd5('0x17')]===_0x5dd5('0x18')&&typeof _0x196539['limit']==='undefined';var _0x551705=_0x80697e[_0x5dd5('0x19')];var _0x2d89b7=_0x1f132e?0x0:_0x196539[_0x5dd5('0x17')];var _0x354149=_0x1f132e?_0x80697e[_0x5dd5('0x19')]:_0x196539['offset']+_0x196539[_0x5dd5('0x1a')];var _0x23aaac;if(_0x354149>=_0x551705){_0x354149=_0x551705;_0x23aaac=0xc8;}else{_0x23aaac=0xce;}_0x591bcf[_0x5dd5('0x15')](_0x23aaac);return _0x591bcf[_0x5dd5('0x1b')](_0x5dd5('0x1c'),_0x2d89b7+'-'+_0x354149+'/'+_0x551705)[_0x5dd5('0x16')](_0x80697e);}return null;};}function patchUpdates(_0x5c51a1){return function(_0x2de37f){try{jsonpatch[_0x5dd5('0x1d')](_0x2de37f,_0x5c51a1,!![]);}catch(_0x17724c){return BPromise[_0x5dd5('0x1e')](_0x17724c);}return _0x2de37f[_0x5dd5('0x1f')]();};}function saveUpdates(_0x1fbf07,_0xb6acb7){return function(_0x20963d){if(_0x20963d){return _0x20963d['update'](_0x1fbf07)[_0x5dd5('0x20')](function(_0x5941a7){return _0x5941a7;});}return null;};}function removeEntity(_0x1db9ad,_0x4780a1){return function(_0x568c77){if(_0x568c77){return _0x568c77['destroy']()[_0x5dd5('0x20')](function(){_0x1db9ad[_0x5dd5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e545c,_0x35ba0a){return function(_0x255a51){if(!_0x255a51){_0x1e545c[_0x5dd5('0x13')](0x194);}return _0x255a51;};}function handleError(_0x3da52a,_0x522f63){_0x522f63=_0x522f63||0x1f4;return function(_0x1c846a){logger[_0x5dd5('0x21')](_0x1c846a[_0x5dd5('0x22')]);if(_0x1c846a['name']){delete _0x1c846a[_0x5dd5('0x23')];}_0x3da52a[_0x5dd5('0x15')](_0x522f63)[_0x5dd5('0x24')](_0x1c846a);};}exports[_0x5dd5('0x25')]=function(_0x15d35e,_0x595f9a){var _0x52d620={},_0x3aa657={},_0x538ad8={'count':0x0,'rows':[]};var _0x3fe6e3=_[_0x5dd5('0x26')](db[_0x5dd5('0x27')][_0x5dd5('0x28')],function(_0x40386b){return{'name':_0x40386b[_0x5dd5('0x29')],'type':_0x40386b[_0x5dd5('0x2a')][_0x5dd5('0x2b')]};});_0x3aa657[_0x5dd5('0x2c')]=_[_0x5dd5('0x2d')](_[_0x5dd5('0x26')](_0x3fe6e3,_0x5dd5('0x23')),[_0x5dd5('0x23')]);_0x3aa657['query']=_[_0x5dd5('0x2e')](_0x15d35e[_0x5dd5('0x2f')]);_0x3aa657[_0x5dd5('0x30')]=_['intersection'](_0x3aa657[_0x5dd5('0x2c')],_0x3aa657['query']);_0x52d620[_0x5dd5('0x31')]=_[_0x5dd5('0x32')](_0x3aa657[_0x5dd5('0x2c')],qs['fields'](_0x15d35e[_0x5dd5('0x2f')][_0x5dd5('0x33')]));_0x52d620[_0x5dd5('0x31')]=_0x52d620[_0x5dd5('0x31')][_0x5dd5('0x34')]?_0x52d620['attributes']:_0x3aa657[_0x5dd5('0x2c')];if(!_0x15d35e[_0x5dd5('0x2f')][_0x5dd5('0x35')]('nolimit')){_0x52d620[_0x5dd5('0x1a')]=qs[_0x5dd5('0x1a')](_0x15d35e[_0x5dd5('0x2f')][_0x5dd5('0x1a')]);_0x52d620[_0x5dd5('0x17')]=qs[_0x5dd5('0x17')](_0x15d35e[_0x5dd5('0x2f')][_0x5dd5('0x17')]);}_0x52d620[_0x5dd5('0x36')]=qs['sort'](_0x15d35e[_0x5dd5('0x2f')][_0x5dd5('0x37')]);_0x52d620[_0x5dd5('0x38')]=qs[_0x5dd5('0x30')](_[_0x5dd5('0x39')](_0x15d35e[_0x5dd5('0x2f')],_0x3aa657['filters']),_0x3fe6e3);if(_0x15d35e[_0x5dd5('0x2f')][_0x5dd5('0x3a')]){_0x52d620[_0x5dd5('0x38')]=_[_0x5dd5('0x3b')](_0x52d620[_0x5dd5('0x38')],{'$or':_[_0x5dd5('0x26')](_0x3fe6e3,function(_0x486373){if(_0x486373[_0x5dd5('0x2a')]!==_0x5dd5('0x3c')){var _0x361f40={};_0x361f40[_0x486373[_0x5dd5('0x23')]]={'$like':'%'+_0x15d35e[_0x5dd5('0x2f')][_0x5dd5('0x3a')]+'%'};return _0x361f40;}})});}_0x52d620=_['merge']({},_0x52d620,_0x15d35e[_0x5dd5('0x3d')]);var _0x2836ba={'where':_0x52d620[_0x5dd5('0x38')]};return db['CmCustomField'][_0x5dd5('0x19')](_0x2836ba)['then'](function(_0x488bac){_0x538ad8[_0x5dd5('0x19')]=_0x488bac;if(_0x15d35e[_0x5dd5('0x2f')][_0x5dd5('0x3e')]){_0x52d620[_0x5dd5('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x5dd5('0x40')](_0x52d620);})['then'](function(_0x2ae665){_0x538ad8[_0x5dd5('0x41')]=_0x2ae665;return _0x538ad8;})['then'](respondWithFilteredResult(_0x595f9a,_0x52d620))[_0x5dd5('0x42')](handleError(_0x595f9a,null));};exports[_0x5dd5('0x43')]=function(_0x430cce,_0x1b5b81){var _0x1b1364={'raw':!![],'where':{'id':_0x430cce['params']['id']}},_0x282cdc={};_0x282cdc[_0x5dd5('0x2c')]=_[_0x5dd5('0x2e')](db[_0x5dd5('0x27')][_0x5dd5('0x28')]);_0x282cdc['query']=_[_0x5dd5('0x2e')](_0x430cce[_0x5dd5('0x2f')]);_0x282cdc[_0x5dd5('0x30')]=_[_0x5dd5('0x32')](_0x282cdc['model'],_0x282cdc['query']);_0x1b1364['attributes']=_[_0x5dd5('0x32')](_0x282cdc[_0x5dd5('0x2c')],qs[_0x5dd5('0x33')](_0x430cce[_0x5dd5('0x2f')][_0x5dd5('0x33')]));_0x1b1364['attributes']=_0x1b1364['attributes'][_0x5dd5('0x34')]?_0x1b1364[_0x5dd5('0x31')]:_0x282cdc[_0x5dd5('0x2c')];if(_0x430cce[_0x5dd5('0x2f')][_0x5dd5('0x3e')]){_0x1b1364[_0x5dd5('0x3f')]=[{'all':!![]}];}_0x1b1364=_[_0x5dd5('0x3b')]({},_0x1b1364,_0x430cce[_0x5dd5('0x3d')]);return db['CmCustomField'][_0x5dd5('0x44')](_0x1b1364)[_0x5dd5('0x20')](handleEntityNotFound(_0x1b5b81,null))[_0x5dd5('0x20')](respondWithResult(_0x1b5b81,null))['catch'](handleError(_0x1b5b81,null));};exports[_0x5dd5('0x45')]=function(_0xc0f887,_0x1d1c41){if(_0xc0f887[_0x5dd5('0x46')]['id']){delete _0xc0f887[_0x5dd5('0x46')]['id'];}return db[_0x5dd5('0x27')][_0x5dd5('0x44')]({'where':{'id':_0xc0f887['params']['id']}})[_0x5dd5('0x20')](handleEntityNotFound(_0x1d1c41,null))['then'](saveUpdates(_0xc0f887[_0x5dd5('0x46')],null))[_0x5dd5('0x20')](respondWithResult(_0x1d1c41,null))[_0x5dd5('0x42')](handleError(_0x1d1c41,null));};exports[_0x5dd5('0x47')]=function(_0x3ac51c,_0x5d8a9f){return db['CmCustomField'][_0x5dd5('0x44')]({'where':{'id':_0x3ac51c[_0x5dd5('0x48')]['id']}})[_0x5dd5('0x20')](handleEntityNotFound(_0x5d8a9f,null))['then'](removeEntity(_0x5d8a9f,null))[_0x5dd5('0x42')](handleError(_0x5d8a9f,null));};exports['create']=function(_0x2e6834,_0x43eac4){var _0x2d51e0;return db[_0x5dd5('0x49')][_0x5dd5('0x4a')](function(_0x2fb3c5){return db[_0x5dd5('0x27')][_0x5dd5('0x4b')](_0x2e6834[_0x5dd5('0x46')],{'transaction':_0x2fb3c5})[_0x5dd5('0x20')](function(_0x186cc1){_0x2d51e0=_0x186cc1;var _0x53f6b6={'type':db[_0x5dd5('0x4c')]['TEXT'],'transaction':_0x2fb3c5};switch(_0x2e6834[_0x5dd5('0x46')][_0x5dd5('0x2a')]){case _0x5dd5('0x4d'):_0x53f6b6['type']=db['Sequelize']['TEXT'];break;case _0x5dd5('0x4e'):_0x53f6b6[_0x5dd5('0x2a')]=db[_0x5dd5('0x4c')][_0x5dd5('0x4f')];break;case'switch':_0x53f6b6[_0x5dd5('0x2a')]=db[_0x5dd5('0x4c')][_0x5dd5('0x50')];_0x53f6b6[_0x5dd5('0x51')]=![];break;default:}return db[_0x5dd5('0x49')][_0x5dd5('0x52')][_0x5dd5('0x53')]('cm_contacts',util['format'](_0x5dd5('0x54'),_0x2d51e0['id']),_0x53f6b6);})['then'](function(){return _0x2d51e0;});})[_0x5dd5('0x20')](respondWithResult(_0x43eac4,0xc9))['catch'](handleError(_0x43eac4,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index f2fc4c1..611424f 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 _0x3144=['exports','CmCustomField','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmCustomField.attributes'];(function(_0x4e1234,_0x36d85e){var _0x439630=function(_0x31870e){while(--_0x31870e){_0x4e1234['push'](_0x4e1234['shift']());}};_0x439630(++_0x36d85e);}(_0x3144,0x8e));var _0x4314=function(_0x3966c7,_0x3ba255){_0x3966c7=_0x3966c7-0x0;var _0x4779ff=_0x3144[_0x3966c7];return _0x4779ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4314('0x0'))(_0x4314('0x1'));var moment=require(_0x4314('0x2'));var BPromise=require(_0x4314('0x3'));var rp=require(_0x4314('0x4'));var fs=require('fs');var path=require(_0x4314('0x5'));var rimraf=require(_0x4314('0x6'));var config=require('../../config/environment');var attributes=require(_0x4314('0x7'));module[_0x4314('0x8')]=function(_0x584ed4,_0x4d3097){return _0x584ed4['define'](_0x4314('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x121e=['../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2a5575,_0x24f1f0){var _0x12ea85=function(_0x8124d1){while(--_0x8124d1){_0x2a5575['push'](_0x2a5575['shift']());}};_0x12ea85(++_0x24f1f0);}(_0x121e,0xa0));var _0xe121=function(_0x45cd9e,_0x5f02b6){_0x45cd9e=_0x45cd9e-0x0;var _0x1ccd54=_0x121e[_0x45cd9e];return _0x1ccd54;};'use strict';var _=require(_0xe121('0x0'));var util=require(_0xe121('0x1'));var logger=require(_0xe121('0x2'))(_0xe121('0x3'));var moment=require('moment');var BPromise=require(_0xe121('0x4'));var rp=require(_0xe121('0x5'));var fs=require('fs');var path=require(_0xe121('0x6'));var rimraf=require(_0xe121('0x7'));var config=require(_0xe121('0x8'));var attributes=require(_0xe121('0x9'));module[_0xe121('0xa')]=function(_0x38afb7,_0x16a0fa){return _0x38afb7[_0xe121('0xb')](_0xe121('0xc'),attributes,{'tableName':_0xe121('0xd'),'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 f9b5f24..f255022 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 _0x0f09=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCustomField,\x20%s,\x20%s','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x36ad8c,_0x2f6eb5){var _0x55e041=function(_0x30c86d){while(--_0x30c86d){_0x36ad8c['push'](_0x36ad8c['shift']());}};_0x55e041(++_0x2f6eb5);}(_0x0f09,0x10a));var _0x90f0=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x0f09[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x90f0('0x0'));var util=require('util');var moment=require(_0x90f0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90f0('0x2'));var db=require(_0x90f0('0x3'))['db'];var utils=require(_0x90f0('0x4'));var logger=require(_0x90f0('0x5'))('rpc');var config=require(_0x90f0('0x6'));var jayson=require(_0x90f0('0x7'));var client=jayson[_0x90f0('0x8')][_0x90f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbd33bc,_0x1198fc,_0x54ce17){return new BPromise(function(_0x5fb0cc,_0x2a4e87){return client[_0x90f0('0xa')](_0xbd33bc,_0x54ce17)[_0x90f0('0xb')](function(_0x2e1401){logger[_0x90f0('0xc')]('CmCustomField,\x20%s,\x20%s',_0x1198fc,_0x90f0('0xd'));logger['debug'](_0x90f0('0xe'),_0x1198fc,_0x90f0('0xd'),JSON[_0x90f0('0xf')](_0x2e1401));if(_0x2e1401[_0x90f0('0x10')]){if(_0x2e1401[_0x90f0('0x10')][_0x90f0('0x11')]===0x1f4){logger[_0x90f0('0x10')]('CmCustomField,\x20%s,\x20%s',_0x1198fc,_0x2e1401[_0x90f0('0x10')][_0x90f0('0x12')]);return _0x2a4e87(_0x2e1401[_0x90f0('0x10')][_0x90f0('0x12')]);}logger[_0x90f0('0x10')](_0x90f0('0x13'),_0x1198fc,_0x2e1401[_0x90f0('0x10')][_0x90f0('0x12')]);return _0x5fb0cc(_0x2e1401[_0x90f0('0x10')][_0x90f0('0x12')]);}else{logger[_0x90f0('0xc')](_0x90f0('0x13'),_0x1198fc,_0x90f0('0xd'));_0x5fb0cc(_0x2e1401['result'][_0x90f0('0x12')]);}})['catch'](function(_0x110a88){logger[_0x90f0('0x10')](_0x90f0('0x13'),_0x1198fc,_0x110a88);_0x2a4e87(_0x110a88);});});} \ No newline at end of file +var _0xa467=['error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa467,0x1bd));var _0x7a46=function(_0xce8e12,_0x599647){_0xce8e12=_0xce8e12-0x0;var _0x205c00=_0xa467[_0xce8e12];return _0x205c00;};'use strict';var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var moment=require(_0x7a46('0x2'));var BPromise=require(_0x7a46('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a46('0x4'));var db=require(_0x7a46('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a46('0x6'))('rpc');var config=require(_0x7a46('0x7'));var jayson=require(_0x7a46('0x8'));var client=jayson[_0x7a46('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x63cc8e,_0x4490ea,_0x5f282c){return new BPromise(function(_0xbdaad,_0x2f0a49){return client[_0x7a46('0xa')](_0x63cc8e,_0x5f282c)[_0x7a46('0xb')](function(_0x5c0476){logger[_0x7a46('0xc')]('CmCustomField,\x20%s,\x20%s',_0x4490ea,_0x7a46('0xd'));logger['debug'](_0x7a46('0xe'),_0x4490ea,_0x7a46('0xd'),JSON['stringify'](_0x5c0476));if(_0x5c0476[_0x7a46('0xf')]){if(_0x5c0476[_0x7a46('0xf')]['code']===0x1f4){logger['error'](_0x7a46('0x10'),_0x4490ea,_0x5c0476[_0x7a46('0xf')][_0x7a46('0x11')]);return _0x2f0a49(_0x5c0476['error'][_0x7a46('0x11')]);}logger[_0x7a46('0xf')](_0x7a46('0x10'),_0x4490ea,_0x5c0476[_0x7a46('0xf')]['message']);return _0xbdaad(_0x5c0476[_0x7a46('0xf')][_0x7a46('0x11')]);}else{logger[_0x7a46('0xc')](_0x7a46('0x10'),_0x4490ea,_0x7a46('0xd'));_0xbdaad(_0x5c0476[_0x7a46('0x12')]['message']);}})[_0x7a46('0x13')](function(_0x1a1816){logger[_0x7a46('0xf')]('CmCustomField,\x20%s,\x20%s',_0x4490ea,_0x1a1816);_0x2f0a49(_0x1a1816);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 0bdf824..0cbebf7 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 _0x0845=['./cmCustomField.controller','get','isAuthenticated','show','post','put','/:id','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x341eca,_0x3b58aa){var _0x18c18a=function(_0x148874){while(--_0x148874){_0x341eca['push'](_0x341eca['shift']());}};_0x18c18a(++_0x3b58aa);}(_0x0845,0x125));var _0x5084=function(_0x91cb11,_0x43b479){_0x91cb11=_0x91cb11-0x0;var _0x198397=_0x0845[_0x91cb11];return _0x198397;};'use strict';var multer=require(_0x5084('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5084('0x1'));var express=require(_0x5084('0x2'));var router=express[_0x5084('0x3')]();var fs_extra=require(_0x5084('0x4'));var auth=require(_0x5084('0x5'));var interaction=require(_0x5084('0x6'));var config=require('../../config/environment');var controller=require(_0x5084('0x7'));router[_0x5084('0x8')]('/',auth[_0x5084('0x9')](),controller['index']);router['get']('/:id',auth[_0x5084('0x9')](),controller[_0x5084('0xa')]);router[_0x5084('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5084('0xc')](_0x5084('0xd'),auth[_0x5084('0x9')](),controller['update']);router[_0x5084('0xe')](_0x5084('0xd'),auth[_0x5084('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa7be=['destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x55dd5d,_0x5270e2){var _0x5ada93=function(_0x2adefd){while(--_0x2adefd){_0x55dd5d['push'](_0x55dd5d['shift']());}};_0x5ada93(++_0x5270e2);}(_0xa7be,0xfd));var _0xea7b=function(_0x10ef2e,_0x4ffb57){_0x10ef2e=_0x10ef2e-0x0;var _0x336053=_0xa7be[_0x10ef2e];return _0x336053;};'use strict';var multer=require(_0xea7b('0x0'));var util=require(_0xea7b('0x1'));var path=require(_0xea7b('0x2'));var timeout=require(_0xea7b('0x3'));var express=require(_0xea7b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xea7b('0x5'));var interaction=require(_0xea7b('0x6'));var config=require(_0xea7b('0x7'));var controller=require('./cmCustomField.controller');router[_0xea7b('0x8')]('/',auth[_0xea7b('0x9')](),controller[_0xea7b('0xa')]);router[_0xea7b('0x8')](_0xea7b('0xb'),auth[_0xea7b('0x9')](),controller[_0xea7b('0xc')]);router[_0xea7b('0xd')]('/',auth[_0xea7b('0x9')](),controller[_0xea7b('0xe')]);router['put'](_0xea7b('0xb'),auth[_0xea7b('0x9')](),controller[_0xea7b('0xf')]);router[_0xea7b('0x10')]('/:id',auth[_0xea7b('0x9')](),controller[_0xea7b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 08a85c2..3b81d13 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 _0x4d56=['contactListQueue','moment','sequelize','exports','STRING','format','INTEGER','DATE','UNSIGNED'];(function(_0x3120dd,_0x2602f7){var _0x377850=function(_0x35d6cc){while(--_0x35d6cc){_0x3120dd['push'](_0x3120dd['shift']());}};_0x377850(++_0x2602f7);}(_0x4d56,0x76));var _0x64d5=function(_0x2422be,_0x35efad){_0x2422be=_0x2422be-0x0;var _0x48ef89=_0x4d56[_0x2422be];return _0x48ef89;};'use strict';var moment=require(_0x64d5('0x0'));var Sequelize=require(_0x64d5('0x1'));module[_0x64d5('0x2')]={'phone':{'type':Sequelize[_0x64d5('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x64d5('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x64d5('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x64d5('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x64d5('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x64d5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x64d5('0x6')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x64d5('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x64d5('0x5')],'unique':_0x64d5('0x8')},'ListId':{'type':Sequelize[_0x64d5('0x5')],'unique':_0x64d5('0x8')},'UserId':{'type':Sequelize[_0x64d5('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x64d5('0x5')],'unique':_0x64d5('0x8')},'CampaignId':{'type':Sequelize[_0x64d5('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x64d5('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x64d5('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x64d5('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x64d5('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x64d5('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x64d5('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x64d5('0x6')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x5661=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','STRING','UNSIGNED','contactListQueue','moment','sequelize','exports','DATE','format'];(function(_0x22cdda,_0x35cf94){var _0x307321=function(_0x20796a){while(--_0x20796a){_0x22cdda['push'](_0x22cdda['shift']());}};_0x307321(++_0x35cf94);}(_0x5661,0x103));var _0x1566=function(_0x1a1131,_0x404e25){_0x1a1131=_0x1a1131-0x0;var _0x2a73ee=_0x5661[_0x1a1131];return _0x2a73ee;};'use strict';var moment=require(_0x1566('0x0'));var Sequelize=require(_0x1566('0x1'));module[_0x1566('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1566('0x3')],'defaultValue':moment()[_0x1566('0x4')](_0x1566('0x5'))},'countbusyretry':{'type':Sequelize[_0x1566('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1566('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1566('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1566('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1566('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x1566('0x6')](0x2)[_0x1566('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1566('0x6')],'unique':_0x1566('0xa')},'ListId':{'type':Sequelize[_0x1566('0x6')],'unique':_0x1566('0xa')},'UserId':{'type':Sequelize[_0x1566('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x1566('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1566('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1566('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1566('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x1566('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1566('0x8')]},'recallmeNotifiedDate':{'type':Sequelize[_0x1566('0x3')],'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 cc4cb97..cad3f1c 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 _0x6f47=['VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ContactId','isNil','firstName','calleridname','lastName','CmHopperFinal','create','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','body','direction','prev','isEmpty','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','hopperIds','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','phone','recallme','LOCK','UPDATE','Contact','CmCompany','Company','List','dialActive','getPreviewRecall','CmContact','CmList','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','timezones','push','getTimezone','lodash','../../components/parsers/qs','api','../../mysqldb','status','json','undefined','limit','count','set','Content-Range','update','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','model','query','keys','filters','concat','$and','$or','$lt','$ne','$notBetween','$in','$notIn','$like','$notLike','$iLike','$any','attributes','intersection','length','nolimit','offset','order','sort','filter','where','VIRTUAL','merge','options','then','includeAll','include','show','params','fields','find','catch','describe','destroy','VoiceQueueId'];(function(_0x4ab3b8,_0x1d5595){var _0x4416d8=function(_0x3f3945){while(--_0x3f3945){_0x4ab3b8['push'](_0x4ab3b8['shift']());}};_0x4416d8(++_0x1d5595);}(_0x6f47,0xc7));var _0x76f4=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x6f47[_0x2faddb];return _0x273c05;};'use strict';var moment=require('moment');var _=require(_0x76f4('0x0'));var qs=require(_0x76f4('0x1'));var logger=require('../../config/logger')(_0x76f4('0x2'));var shared=require('../../config/environment');var db=require(_0x76f4('0x3'))['db'];function respondWithResult(_0x47d3e1,_0xe214ad){_0xe214ad=_0xe214ad||0xc8;return function(_0xc5dddc){if(_0xc5dddc){return _0x47d3e1[_0x76f4('0x4')](_0xe214ad)[_0x76f4('0x5')](_0xc5dddc);}};}function respondWithFilteredResult(_0x5754ca,_0x35602f){return function(_0xfc2405){if(_0xfc2405){var _0x2176a7=typeof _0x35602f['offset']===_0x76f4('0x6')&&typeof _0x35602f[_0x76f4('0x7')]===_0x76f4('0x6');var _0xf9b468=_0xfc2405[_0x76f4('0x8')];var _0x4c6b5c=_0x2176a7?0x0:_0x35602f['offset'];var _0x3347ef=_0x2176a7?_0xfc2405[_0x76f4('0x8')]:_0x35602f['offset']+_0x35602f['limit'];var _0x3d8554;if(_0x3347ef>=_0xf9b468){_0x3347ef=_0xf9b468;_0x3d8554=0xc8;}else{_0x3d8554=0xce;}_0x5754ca[_0x76f4('0x4')](_0x3d8554);return _0x5754ca[_0x76f4('0x9')](_0x76f4('0xa'),_0x4c6b5c+'-'+_0x3347ef+'/'+_0xf9b468)[_0x76f4('0x5')](_0xfc2405);}return null;};}function saveUpdates(_0xafd21e,_0xf7e347){return function(_0x3ec740){if(_0x3ec740){return _0x3ec740[_0x76f4('0xb')](_0xafd21e)['then'](function(_0x41ba00){return _0x41ba00;});}return null;};}function handleEntityNotFound(_0x30dabf,_0x5da1ff){return function(_0x4b6021){if(!_0x4b6021){_0x30dabf['sendStatus'](0x194);}return _0x4b6021;};}function handleError(_0x1d7755,_0x3dd240){_0x3dd240=_0x3dd240||0x1f4;return function(_0x979946){logger[_0x76f4('0xc')](_0x979946[_0x76f4('0xd')]);if(_0x979946[_0x76f4('0xe')]){delete _0x979946[_0x76f4('0xe')];}_0x1d7755[_0x76f4('0x4')](_0x3dd240)[_0x76f4('0xf')](_0x979946);};}exports[_0x76f4('0x10')]=function(_0x672960,_0x2d4bd1){var _0x214bef={},_0x38450e={},_0x17625e={'count':0x0,'rows':[]};var _0x397360=_[_0x76f4('0x11')](db[_0x76f4('0x12')][_0x76f4('0x13')],function(_0x35b406){return{'name':_0x35b406[_0x76f4('0x14')],'type':_0x35b406[_0x76f4('0x15')]['key']};});_0x38450e[_0x76f4('0x16')]=_['map'](_0x397360,_0x76f4('0xe'));_0x38450e[_0x76f4('0x17')]=_[_0x76f4('0x18')](_0x672960['query']);_0x38450e['filters']=_['intersection'](_0x38450e[_0x76f4('0x16')],_0x38450e[_0x76f4('0x17')]);_0x38450e[_0x76f4('0x19')]=_[_0x76f4('0x1a')](_0x38450e[_0x76f4('0x19')],[_0x76f4('0x1b'),_0x76f4('0x1c'),'$gt','$gte',_0x76f4('0x1d'),'$lte',_0x76f4('0x1e'),'$eq','$not','$between',_0x76f4('0x1f'),_0x76f4('0x20'),_0x76f4('0x21'),_0x76f4('0x22'),_0x76f4('0x23'),_0x76f4('0x24'),'$notILike',_0x76f4('0x22'),'$overlap','$contains','$contained',_0x76f4('0x25')]);_0x214bef[_0x76f4('0x26')]=_[_0x76f4('0x27')](_0x38450e[_0x76f4('0x16')],qs['fields'](_0x672960[_0x76f4('0x17')]['fields']));_0x214bef[_0x76f4('0x26')]=_0x214bef[_0x76f4('0x26')][_0x76f4('0x28')]?_0x214bef[_0x76f4('0x26')]:_0x38450e[_0x76f4('0x16')];if(!_0x672960['query']['hasOwnProperty'](_0x76f4('0x29'))){_0x214bef[_0x76f4('0x7')]=qs[_0x76f4('0x7')](_0x672960[_0x76f4('0x17')][_0x76f4('0x7')]);_0x214bef[_0x76f4('0x2a')]=qs[_0x76f4('0x2a')](_0x672960[_0x76f4('0x17')][_0x76f4('0x2a')]);}_0x214bef[_0x76f4('0x2b')]=qs[_0x76f4('0x2c')](_0x672960[_0x76f4('0x17')]['sort']);_0x214bef['where']=qs['filters'](_['pick'](_0x672960[_0x76f4('0x17')],_0x38450e[_0x76f4('0x19')]),_0x397360);if(_0x672960[_0x76f4('0x17')][_0x76f4('0x2d')]){_0x214bef[_0x76f4('0x2e')]=_['merge'](_0x214bef[_0x76f4('0x2e')],{'$or':_[_0x76f4('0x11')](_0x397360,function(_0x37a233){if(_0x37a233[_0x76f4('0x15')]!==_0x76f4('0x2f')){var _0x23278f={};_0x23278f[_0x37a233[_0x76f4('0xe')]]={'$like':'%'+_0x672960[_0x76f4('0x17')][_0x76f4('0x2d')]+'%'};return _0x23278f;}})});}_0x214bef=_[_0x76f4('0x30')]({},_0x214bef,_0x672960[_0x76f4('0x31')]);var _0x244607={'where':_0x214bef[_0x76f4('0x2e')]};return db[_0x76f4('0x12')][_0x76f4('0x8')](_0x244607)[_0x76f4('0x32')](function(_0x3308e3){_0x17625e[_0x76f4('0x8')]=_0x3308e3;if(_0x672960['query'][_0x76f4('0x33')]){_0x214bef[_0x76f4('0x34')]=[{'all':!![]}];}return db[_0x76f4('0x12')]['findAll'](_0x214bef);})['then'](function(_0x237fba){_0x17625e['rows']=_0x237fba;return _0x17625e;})[_0x76f4('0x32')](respondWithFilteredResult(_0x2d4bd1,_0x214bef))['catch'](handleError(_0x2d4bd1,null));};exports[_0x76f4('0x35')]=function(_0x16f36d,_0x312243){var _0x378675={'raw':!![],'where':{'id':_0x16f36d[_0x76f4('0x36')]['id']}},_0x2c0b76={};_0x2c0b76[_0x76f4('0x16')]=_[_0x76f4('0x18')](db[_0x76f4('0x12')][_0x76f4('0x13')]);_0x2c0b76['query']=_['keys'](_0x16f36d[_0x76f4('0x17')]);_0x2c0b76[_0x76f4('0x19')]=_[_0x76f4('0x27')](_0x2c0b76[_0x76f4('0x16')],_0x2c0b76[_0x76f4('0x17')]);_0x378675[_0x76f4('0x26')]=_[_0x76f4('0x27')](_0x2c0b76[_0x76f4('0x16')],qs[_0x76f4('0x37')](_0x16f36d['query'][_0x76f4('0x37')]));_0x378675[_0x76f4('0x26')]=_0x378675['attributes']['length']?_0x378675[_0x76f4('0x26')]:_0x2c0b76[_0x76f4('0x16')];if(_0x16f36d[_0x76f4('0x17')][_0x76f4('0x33')]){_0x378675[_0x76f4('0x34')]=[{'all':!![]}];}_0x378675=_['merge']({},_0x378675,_0x16f36d[_0x76f4('0x31')]);return db[_0x76f4('0x12')][_0x76f4('0x38')](_0x378675)[_0x76f4('0x32')](handleEntityNotFound(_0x312243,null))[_0x76f4('0x32')](respondWithResult(_0x312243,null))[_0x76f4('0x39')](handleError(_0x312243,null));};exports['create']=function(_0x317c91,_0x2795db){return db[_0x76f4('0x12')]['create'](_0x317c91['body'],{})[_0x76f4('0x32')](respondWithResult(_0x2795db,0xc9))[_0x76f4('0x39')](handleError(_0x2795db,null));};exports[_0x76f4('0xb')]=function(_0x2bea6d,_0x36fa03){if(_0x2bea6d['body']['id']){delete _0x2bea6d['body']['id'];}return db[_0x76f4('0x12')]['find']({'where':{'id':_0x2bea6d[_0x76f4('0x36')]['id']}})[_0x76f4('0x32')](handleEntityNotFound(_0x36fa03,null))['then'](saveUpdates(_0x2bea6d['body'],null))[_0x76f4('0x32')](respondWithResult(_0x36fa03,null))[_0x76f4('0x39')](handleError(_0x36fa03,null));};exports[_0x76f4('0x3a')]=function(_0x217d3a,_0x55e4cc){return db[_0x76f4('0x12')][_0x76f4('0x3a')]()[_0x76f4('0x32')](respondWithResult(_0x55e4cc,null))['catch'](handleError(_0x55e4cc,null));};exports[_0x76f4('0x3b')]=function(_0x6bbcf2,_0x535eca){var _0x56d905;var _0x4ab620=_0x6bbcf2[_0x76f4('0x36')]['id'];return db[_0x76f4('0x12')][_0x76f4('0x38')]({'where':{'id':_0x6bbcf2[_0x76f4('0x36')]['id']}})['then'](handleEntityNotFound(_0x535eca,null))[_0x76f4('0x32')](function(_0x597de5){if(_0x597de5){return _0x597de5[_0x76f4('0x3b')]()[_0x76f4('0x32')](function(_0x270baf){return _0x270baf;});}})['then'](function(_0x312319){_0x56d905=_0x312319;if(_0x312319){if(_0x312319[_0x76f4('0x3c')]||_0x312319['CampaignId']){return db[_0x312319[_0x76f4('0x3c')]?_0x76f4('0x3d'):_0x76f4('0x3e')][_0x76f4('0x38')]({'where':{'id':_0x312319[_0x76f4('0x3c')]?_0x312319['VoiceQueueId']:_0x312319[_0x76f4('0x3f')]},'attributes':['id','name'],'raw':!![]});}}})[_0x76f4('0x32')](function(_0x38dc69){var _0x154ba={};if(_0x38dc69){_['merge'](_0x154ba,_[_0x76f4('0x40')](_0x56d905[_0x76f4('0x41')],[_0x76f4('0x42'),_0x76f4('0x43'),'id']));_0x154ba['state']=0x15;_0x154ba[_0x76f4('0x44')]=_0x76f4('0x45');_0x154ba[_0x76f4('0x46')]=_0x38dc69[_0x76f4('0xe')];_0x154ba['membername']=_0x6bbcf2[_0x76f4('0x47')]['name'];_0x154ba[_0x76f4('0x48')]=_0x6bbcf2[_0x76f4('0x47')]['id'];_0x154ba['deleted']=!![];_0x154ba['deletedat']=moment()[_0x76f4('0x49')](_0x76f4('0x4a'));_0x154ba[_0x76f4('0x4b')]=_0x56d905['phone'];_0x154ba[_0x76f4('0x4c')]=_0x56d905[_0x76f4('0x3c')]?_0x76f4('0x4d'):'ivr';return db['CmContact'][_0x76f4('0x38')]({'where':{'id':_0x154ba[_0x76f4('0x4e')]},'attributes':['firstName','lastName']})[_0x76f4('0x32')](function(_0x34a5d1){if(!_[_0x76f4('0x4f')](_0x535eca)&&!_[_0x76f4('0x4f')](_0x34a5d1[_0x76f4('0x50')])){_0x154ba[_0x76f4('0x51')]=_0x34a5d1[_0x76f4('0x50')];if(!_[_0x76f4('0x4f')](_0x34a5d1[_0x76f4('0x52')])){_0x154ba['calleridname']+='\x20'+_0x34a5d1['lastName'];}}})['finally'](function(){return db[_0x76f4('0x53')][_0x76f4('0x54')](_0x154ba);});}})[_0x76f4('0x32')](function(_0x3b6c16){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0x4ab620}});})[_0x76f4('0x32')](function(){return _0x535eca['status'](0xcc)[_0x76f4('0x55')]();})['catch'](handleError(_0x535eca,null));};exports[_0x76f4('0x56')]=function(_0x25e510,_0x3984d3){var _0x3317a4=[];return db['CmContact'][_0x76f4('0x3a')]()[_0x76f4('0x32')](function(_0x22a0cc){_0x3317a4=_[_0x76f4('0x18')](_0x22a0cc);return _0x25e510[_0x76f4('0x47')][_0x76f4('0x57')]({'where':{'type':_0x76f4('0x58'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x76f4('0x59'),_0x76f4('0x5a')],'raw':!![]});})[_0x76f4('0x32')](function(_0x320a87){if(_0x320a87&&_0x320a87[_0x76f4('0x28')]){return db[_0x76f4('0x5b')][_0x76f4('0x5c')](function(_0x551d38){var _0x5724c3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x76f4('0x4a'))},'VoiceQueueId':{'$in':_[_0x76f4('0x11')](_0x320a87,'id')},'$or':[{'UserId':null},{'UserId':_0x25e510[_0x76f4('0x47')]['id']}]};var _0x5f0dc2={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x320a87)[_0x76f4('0x2d')](['dialPreviewAutoRecallMe',0x0])[_0x76f4('0x11')]('id')[_0x76f4('0x5d')]()},'$or':[{'UserId':null},{'UserId':_0x25e510['user']['id']}]};var _0xda0ac2={'$or':[_0x5724c3,_0x5f0dc2]};var _0x37b7f7=[];if(_0x25e510[_0x76f4('0x5e')][_0x76f4('0x5f')]&&_0x25e510[_0x76f4('0x5e')][_0x76f4('0x5f')]===_0x76f4('0x60')){if(!_[_0x76f4('0x61')](_0x25e510[_0x76f4('0x5e')]['hopperIds'])){_0xda0ac2['id']={'$in':_0x25e510[_0x76f4('0x5e')]['hopperIds']};}_0x37b7f7=[[_0x76f4('0x62'),_0x76f4('0x63')],[_0x76f4('0x64'),_0x320a87[0x0][_0x76f4('0x59')]===_0x76f4('0x63')?_0x76f4('0x65'):_0x76f4('0x63')],db[_0x76f4('0x5b')][_0x76f4('0x66')](_0x76f4('0x67')),['id','DESC']];}else{if(!_[_0x76f4('0x61')](_0x25e510[_0x76f4('0x5e')]['hopperIds'])){_0xda0ac2['id']={'$notIn':_0x25e510[_0x76f4('0x5e')][_0x76f4('0x68')]};}_0x37b7f7=[[_0x76f4('0x62'),'DESC'],[_0x76f4('0x64'),_0x320a87[0x0][_0x76f4('0x59')]],db[_0x76f4('0x5b')]['literal'](_0x76f4('0x69')),['id',_0x76f4('0x63')]];}return db[_0x76f4('0x12')][_0x76f4('0x6a')]({'attributes':['id',_0x76f4('0x6b'),_0x76f4('0x6c'),_0x76f4('0x6d')],'where':_0xda0ac2,'order':_0x37b7f7,'transaction':_0x551d38,'lock':_0x551d38[_0x76f4('0x6e')][_0x76f4('0x6f')],'include':[{'model':db['CmContact'],'as':_0x76f4('0x70'),'attributes':_0x3317a4,'include':[{'model':db[_0x76f4('0x71')],'as':_0x76f4('0x72'),'attributes':['id',_0x76f4('0xe')]}]},{'model':db['CmList'],'as':_0x76f4('0x73'),'attributes':['id',_0x76f4('0xe')]},{'model':db[_0x76f4('0x3d')],'as':'Queue','attributes':['id',_0x76f4('0xe'),_0x76f4('0x74')]}]})[_0x76f4('0x32')](function(_0x99fbd6){if(_0x99fbd6){return _0x99fbd6[_0x76f4('0xb')]({'UserId':_0x25e510['user']['id']},{'transaction':_0x551d38});}});});}})[_0x76f4('0x32')](handleEntityNotFound(_0x3984d3,null))['then'](respondWithResult(_0x3984d3,null))[_0x76f4('0x39')](handleError(_0x3984d3,null));};exports[_0x76f4('0x75')]=function(_0x5e6df9,_0x53cb70,_0x58251e){var _0x3aa958=[];var _0x462f3e=_0x5e6df9[_0x76f4('0x36')]['id'];var _0x3e2a07=_0x5e6df9[_0x76f4('0x47')]['id'];return db[_0x76f4('0x76')]['describe']()[_0x76f4('0x32')](function(_0x1bb9b3){_0x3aa958=_[_0x76f4('0x18')](_0x1bb9b3);return db[_0x76f4('0x5b')][_0x76f4('0x5c')](function(_0x1c8973){const _0x307060={'id':_0x462f3e};return db[_0x76f4('0x12')]['findOne']({'attributes':['id',_0x76f4('0x6b'),'recallme'],'where':_0x307060,'transaction':_0x1c8973,'lock':_0x1c8973[_0x76f4('0x6e')][_0x76f4('0x6f')],'include':[{'model':db[_0x76f4('0x76')],'as':_0x76f4('0x70'),'attributes':_0x3aa958,'include':[{'model':db[_0x76f4('0x71')],'as':_0x76f4('0x72'),'attributes':['id',_0x76f4('0xe')]}]},{'model':db[_0x76f4('0x77')],'as':'List','attributes':['id',_0x76f4('0xe')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x76f4('0x74')]}]})[_0x76f4('0x32')](function(_0x279040){if(_0x279040){return _0x279040[_0x76f4('0xb')]({'UserId':_0x3e2a07},{'transaction':_0x1c8973});}});});})['then'](handleEntityNotFound(_0x53cb70,null))[_0x76f4('0x32')](respondWithResult(_0x53cb70,null))[_0x76f4('0x39')](handleError(_0x53cb70,null));};exports[_0x76f4('0x78')]=function(_0x5f5c24,_0x12f16e){return _0x5f5c24[_0x76f4('0x47')][_0x76f4('0x57')]({'where':{'type':_0x76f4('0x58'),'dialActive':!![],'dialMethod':_0x76f4('0x79')},'attributes':['id'],'raw':!![]})[_0x76f4('0x32')](function(_0x3b5e15){if(_0x3b5e15&&_0x3b5e15['length']){return db[_0x76f4('0x12')][_0x76f4('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x76f4('0x4a'))},'VoiceQueueId':{'$in':_[_0x76f4('0x11')](_0x3b5e15,'id')},'$or':[{'UserId':null},{'UserId':_0x5f5c24[_0x76f4('0x47')]['id']}]}});}return 0x0;})[_0x76f4('0x32')](function(_0x36d95c){if(!_[_0x76f4('0x4f')](_0x36d95c)&&_[_0x76f4('0x7a')](_0x36d95c)){return _0x12f16e[_0x76f4('0x4')](0xc8)[_0x76f4('0x5')]({'contacts':_0x36d95c});}else{logger['error'](_0x76f4('0x7b'),_0x76f4('0x78'),0x194,_0x76f4('0x7c'));_0x12f16e[_0x76f4('0x7d')](0x194);}})['catch'](handleError(_0x12f16e,null));};exports[_0x76f4('0x7e')]=function(_0x5df706,_0x420281){var _0x4a7a98=shared[_0x76f4('0x7f')];var _0x7380f=[];_['map'](_0x4a7a98,function(_0x5a3239){_0x7380f[_0x76f4('0x80')]({'id':_0x5a3239[_0x76f4('0xe')],'name':_0x5a3239[_0x76f4('0xe')],'utcOffset':_0x5a3239['utcOffset']});});return _0x420281['status'](0xc8)[_0x76f4('0x5')]({'tz':_0x7380f});};exports[_0x76f4('0x81')]=function(_0x52453,_0x36ab57){var _0x291b87=shared[_0x76f4('0x7f')];var _0x98a269={};if(!_[_0x76f4('0x4f')](_0x291b87[_0x52453['body']['id']]))_0x98a269=_0x291b87[_0x52453['body']['id']];return _0x36ab57[_0x76f4('0x4')](0xc8)[_0x76f4('0x5')](_0x98a269);}; \ No newline at end of file +var _0xe0c3=['$contained','$any','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Contact','Company','CmList','List','Queue','dialActive','getPreviewRecall','LOCK','CmCompany','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','update','then','sendStatus','error','stack','name','CmHopper','rawAttributes','type','map','query','keys','intersection','filters','concat','$or','$gt','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$notLike','$like','$overlap'];(function(_0x1fef18,_0x59a8e6){var _0x122b0d=function(_0x3bd155){while(--_0x3bd155){_0x1fef18['push'](_0x1fef18['shift']());}};_0x122b0d(++_0x59a8e6);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x3e0c('0x0'));var _=require('lodash');var qs=require(_0x3e0c('0x1'));var logger=require(_0x3e0c('0x2'))(_0x3e0c('0x3'));var shared=require(_0x3e0c('0x4'));var db=require(_0x3e0c('0x5'))['db'];function respondWithResult(_0x410ec4,_0x31851c){_0x31851c=_0x31851c||0xc8;return function(_0x26c964){if(_0x26c964){return _0x410ec4[_0x3e0c('0x6')](_0x31851c)['json'](_0x26c964);}};}function respondWithFilteredResult(_0x530ebf,_0x163adf){return function(_0x1e339a){if(_0x1e339a){var _0x3f6607=typeof _0x163adf[_0x3e0c('0x7')]===_0x3e0c('0x8')&&typeof _0x163adf[_0x3e0c('0x9')]===_0x3e0c('0x8');var _0x448907=_0x1e339a[_0x3e0c('0xa')];var _0x35d56f=_0x3f6607?0x0:_0x163adf[_0x3e0c('0x7')];var _0x4f7e71=_0x3f6607?_0x1e339a['count']:_0x163adf[_0x3e0c('0x7')]+_0x163adf[_0x3e0c('0x9')];var _0x13ce3e;if(_0x4f7e71>=_0x448907){_0x4f7e71=_0x448907;_0x13ce3e=0xc8;}else{_0x13ce3e=0xce;}_0x530ebf[_0x3e0c('0x6')](_0x13ce3e);return _0x530ebf[_0x3e0c('0xb')](_0x3e0c('0xc'),_0x35d56f+'-'+_0x4f7e71+'/'+_0x448907)[_0x3e0c('0xd')](_0x1e339a);}return null;};}function saveUpdates(_0x5dc732,_0x38b416){return function(_0x491432){if(_0x491432){return _0x491432[_0x3e0c('0xe')](_0x5dc732)[_0x3e0c('0xf')](function(_0x5d0ab7){return _0x5d0ab7;});}return null;};}function handleEntityNotFound(_0x5f2654,_0x6d9c61){return function(_0x409b2c){if(!_0x409b2c){_0x5f2654[_0x3e0c('0x10')](0x194);}return _0x409b2c;};}function handleError(_0xea4ed,_0x15a269){_0x15a269=_0x15a269||0x1f4;return function(_0x24fcf9){logger[_0x3e0c('0x11')](_0x24fcf9[_0x3e0c('0x12')]);if(_0x24fcf9[_0x3e0c('0x13')]){delete _0x24fcf9[_0x3e0c('0x13')];}_0xea4ed[_0x3e0c('0x6')](_0x15a269)['send'](_0x24fcf9);};}exports['index']=function(_0x20db28,_0x216993){var _0x1b2e17={},_0x41b19f={},_0x108d4a={'count':0x0,'rows':[]};var _0x8825b7=_['map'](db[_0x3e0c('0x14')][_0x3e0c('0x15')],function(_0x95ce16){return{'name':_0x95ce16['fieldName'],'type':_0x95ce16[_0x3e0c('0x16')]['key']};});_0x41b19f['model']=_[_0x3e0c('0x17')](_0x8825b7,_0x3e0c('0x13'));_0x41b19f[_0x3e0c('0x18')]=_[_0x3e0c('0x19')](_0x20db28['query']);_0x41b19f['filters']=_[_0x3e0c('0x1a')](_0x41b19f['model'],_0x41b19f['query']);_0x41b19f[_0x3e0c('0x1b')]=_[_0x3e0c('0x1c')](_0x41b19f[_0x3e0c('0x1b')],['$and',_0x3e0c('0x1d'),_0x3e0c('0x1e'),'$gte',_0x3e0c('0x1f'),_0x3e0c('0x20'),_0x3e0c('0x21'),_0x3e0c('0x22'),'$not',_0x3e0c('0x23'),_0x3e0c('0x24'),_0x3e0c('0x25'),_0x3e0c('0x26'),'$like',_0x3e0c('0x27'),'$iLike','$notILike',_0x3e0c('0x28'),_0x3e0c('0x29'),'$contains',_0x3e0c('0x2a'),_0x3e0c('0x2b')]);_0x1b2e17[_0x3e0c('0x2c')]=_['intersection'](_0x41b19f[_0x3e0c('0x2d')],qs[_0x3e0c('0x2e')](_0x20db28['query'][_0x3e0c('0x2e')]));_0x1b2e17[_0x3e0c('0x2c')]=_0x1b2e17[_0x3e0c('0x2c')][_0x3e0c('0x2f')]?_0x1b2e17['attributes']:_0x41b19f[_0x3e0c('0x2d')];if(!_0x20db28[_0x3e0c('0x18')][_0x3e0c('0x30')]('nolimit')){_0x1b2e17[_0x3e0c('0x9')]=qs[_0x3e0c('0x9')](_0x20db28[_0x3e0c('0x18')]['limit']);_0x1b2e17[_0x3e0c('0x7')]=qs[_0x3e0c('0x7')](_0x20db28[_0x3e0c('0x18')][_0x3e0c('0x7')]);}_0x1b2e17[_0x3e0c('0x31')]=qs[_0x3e0c('0x32')](_0x20db28[_0x3e0c('0x18')][_0x3e0c('0x32')]);_0x1b2e17[_0x3e0c('0x33')]=qs[_0x3e0c('0x1b')](_[_0x3e0c('0x34')](_0x20db28[_0x3e0c('0x18')],_0x41b19f[_0x3e0c('0x1b')]),_0x8825b7);if(_0x20db28[_0x3e0c('0x18')]['filter']){_0x1b2e17[_0x3e0c('0x33')]=_[_0x3e0c('0x35')](_0x1b2e17[_0x3e0c('0x33')],{'$or':_[_0x3e0c('0x17')](_0x8825b7,function(_0xd89af9){if(_0xd89af9[_0x3e0c('0x16')]!==_0x3e0c('0x36')){var _0x2ef238={};_0x2ef238[_0xd89af9['name']]={'$like':'%'+_0x20db28['query'][_0x3e0c('0x37')]+'%'};return _0x2ef238;}})});}_0x1b2e17=_[_0x3e0c('0x35')]({},_0x1b2e17,_0x20db28[_0x3e0c('0x38')]);var _0x319cd4={'where':_0x1b2e17[_0x3e0c('0x33')]};return db[_0x3e0c('0x14')]['count'](_0x319cd4)[_0x3e0c('0xf')](function(_0x168784){_0x108d4a['count']=_0x168784;if(_0x20db28['query']['includeAll']){_0x1b2e17[_0x3e0c('0x39')]=[{'all':!![]}];}return db[_0x3e0c('0x14')][_0x3e0c('0x3a')](_0x1b2e17);})[_0x3e0c('0xf')](function(_0x320bf1){_0x108d4a[_0x3e0c('0x3b')]=_0x320bf1;return _0x108d4a;})[_0x3e0c('0xf')](respondWithFilteredResult(_0x216993,_0x1b2e17))[_0x3e0c('0x3c')](handleError(_0x216993,null));};exports[_0x3e0c('0x3d')]=function(_0xb38f09,_0x427207){var _0x20135d={'raw':!![],'where':{'id':_0xb38f09['params']['id']}},_0x4f0e6c={};_0x4f0e6c['model']=_[_0x3e0c('0x19')](db[_0x3e0c('0x14')]['rawAttributes']);_0x4f0e6c['query']=_[_0x3e0c('0x19')](_0xb38f09[_0x3e0c('0x18')]);_0x4f0e6c[_0x3e0c('0x1b')]=_[_0x3e0c('0x1a')](_0x4f0e6c['model'],_0x4f0e6c[_0x3e0c('0x18')]);_0x20135d[_0x3e0c('0x2c')]=_[_0x3e0c('0x1a')](_0x4f0e6c[_0x3e0c('0x2d')],qs[_0x3e0c('0x2e')](_0xb38f09['query'][_0x3e0c('0x2e')]));_0x20135d['attributes']=_0x20135d[_0x3e0c('0x2c')][_0x3e0c('0x2f')]?_0x20135d['attributes']:_0x4f0e6c['model'];if(_0xb38f09[_0x3e0c('0x18')][_0x3e0c('0x3e')]){_0x20135d['include']=[{'all':!![]}];}_0x20135d=_[_0x3e0c('0x35')]({},_0x20135d,_0xb38f09[_0x3e0c('0x38')]);return db[_0x3e0c('0x14')][_0x3e0c('0x3f')](_0x20135d)[_0x3e0c('0xf')](handleEntityNotFound(_0x427207,null))[_0x3e0c('0xf')](respondWithResult(_0x427207,null))['catch'](handleError(_0x427207,null));};exports[_0x3e0c('0x40')]=function(_0x20a85f,_0xec802a){return db[_0x3e0c('0x14')][_0x3e0c('0x40')](_0x20a85f[_0x3e0c('0x41')],{})['then'](respondWithResult(_0xec802a,0xc9))[_0x3e0c('0x3c')](handleError(_0xec802a,null));};exports[_0x3e0c('0xe')]=function(_0x323246,_0x563251){if(_0x323246[_0x3e0c('0x41')]['id']){delete _0x323246[_0x3e0c('0x41')]['id'];}return db['CmHopper'][_0x3e0c('0x3f')]({'where':{'id':_0x323246[_0x3e0c('0x42')]['id']}})[_0x3e0c('0xf')](handleEntityNotFound(_0x563251,null))['then'](saveUpdates(_0x323246[_0x3e0c('0x41')],null))[_0x3e0c('0xf')](respondWithResult(_0x563251,null))[_0x3e0c('0x3c')](handleError(_0x563251,null));};exports[_0x3e0c('0x43')]=function(_0x109078,_0x2e0a90){return db[_0x3e0c('0x14')][_0x3e0c('0x43')]()[_0x3e0c('0xf')](respondWithResult(_0x2e0a90,null))[_0x3e0c('0x3c')](handleError(_0x2e0a90,null));};exports[_0x3e0c('0x44')]=function(_0x4efbf2,_0x20c9df){var _0x58dac7;var _0x4b2062=_0x4efbf2[_0x3e0c('0x42')]['id'];return db['CmHopper'][_0x3e0c('0x3f')]({'where':{'id':_0x4efbf2[_0x3e0c('0x42')]['id']}})['then'](handleEntityNotFound(_0x20c9df,null))[_0x3e0c('0xf')](function(_0x14b718){if(_0x14b718){return _0x14b718['destroy']()[_0x3e0c('0xf')](function(_0x3e04c9){return _0x3e04c9;});}})[_0x3e0c('0xf')](function(_0x20b0bc){_0x58dac7=_0x20b0bc;if(_0x20b0bc){if(_0x20b0bc[_0x3e0c('0x45')]||_0x20b0bc[_0x3e0c('0x46')]){return db[_0x20b0bc[_0x3e0c('0x45')]?_0x3e0c('0x47'):_0x3e0c('0x48')][_0x3e0c('0x3f')]({'where':{'id':_0x20b0bc['VoiceQueueId']?_0x20b0bc[_0x3e0c('0x45')]:_0x20b0bc[_0x3e0c('0x46')]},'attributes':['id',_0x3e0c('0x13')],'raw':!![]});}}})[_0x3e0c('0xf')](function(_0x1a2cf2){var _0x14299c={};if(_0x1a2cf2){_[_0x3e0c('0x35')](_0x14299c,_[_0x3e0c('0x49')](_0x58dac7[_0x3e0c('0x4a')],[_0x3e0c('0x4b'),_0x3e0c('0x4c'),'id']));_0x14299c[_0x3e0c('0x4d')]=0x15;_0x14299c[_0x3e0c('0x4e')]=_0x3e0c('0x4f');_0x14299c['campaign']=_0x1a2cf2[_0x3e0c('0x13')];_0x14299c[_0x3e0c('0x50')]=_0x4efbf2[_0x3e0c('0x51')]['name'];_0x14299c[_0x3e0c('0x52')]=_0x4efbf2[_0x3e0c('0x51')]['id'];_0x14299c[_0x3e0c('0x4f')]=!![];_0x14299c[_0x3e0c('0x53')]=moment()[_0x3e0c('0x54')](_0x3e0c('0x55'));_0x14299c[_0x3e0c('0x56')]=_0x58dac7[_0x3e0c('0x57')];_0x14299c[_0x3e0c('0x58')]=_0x58dac7[_0x3e0c('0x45')]?'queue':_0x3e0c('0x59');return db[_0x3e0c('0x5a')]['find']({'where':{'id':_0x14299c[_0x3e0c('0x5b')]},'attributes':['firstName',_0x3e0c('0x5c')]})[_0x3e0c('0xf')](function(_0x28b2d5){if(!_[_0x3e0c('0x5d')](_0x20c9df)&&!_[_0x3e0c('0x5d')](_0x28b2d5[_0x3e0c('0x5e')])){_0x14299c[_0x3e0c('0x5f')]=_0x28b2d5[_0x3e0c('0x5e')];if(!_[_0x3e0c('0x5d')](_0x28b2d5[_0x3e0c('0x5c')])){_0x14299c[_0x3e0c('0x5f')]+='\x20'+_0x28b2d5[_0x3e0c('0x5c')];}}})[_0x3e0c('0x60')](function(){return db[_0x3e0c('0x61')][_0x3e0c('0x40')](_0x14299c);});}})[_0x3e0c('0xf')](function(_0x117e2f){return db[_0x3e0c('0x62')][_0x3e0c('0x44')]({'where':{'CmHopperId':_0x4b2062}});})[_0x3e0c('0xf')](function(){return _0x20c9df[_0x3e0c('0x6')](0xcc)[_0x3e0c('0x63')]();})[_0x3e0c('0x3c')](handleError(_0x20c9df,null));};exports[_0x3e0c('0x64')]=function(_0x2f6666,_0xcc965b){var _0x58aa5d=[];return db[_0x3e0c('0x5a')][_0x3e0c('0x43')]()[_0x3e0c('0xf')](function(_0x874b04){_0x58aa5d=_['keys'](_0x874b04);return _0x2f6666[_0x3e0c('0x51')][_0x3e0c('0x65')]({'where':{'type':_0x3e0c('0x66'),'dialActive':!![],'dialMethod':_0x3e0c('0x67')},'attributes':['id',_0x3e0c('0x68'),_0x3e0c('0x69')],'raw':!![]});})['then'](function(_0x3e1c8a){if(_0x3e1c8a&&_0x3e1c8a[_0x3e0c('0x2f')]){return db['sequelize'][_0x3e0c('0x6a')](function(_0x368b04){var _0x2b0eae={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3e0c('0x54')](_0x3e0c('0x55'))},'VoiceQueueId':{'$in':_['map'](_0x3e1c8a,'id')},'$or':[{'UserId':null},{'UserId':_0x2f6666['user']['id']}]};var _0x1b57dd={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3e1c8a)[_0x3e0c('0x37')](['dialPreviewAutoRecallMe',0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x2f6666[_0x3e0c('0x51')]['id']}]};var _0x274fcc={'$or':[_0x2b0eae,_0x1b57dd]};var _0x10e951=[];if(_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6b')]&&_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6b')]===_0x3e0c('0x6c')){if(!_[_0x3e0c('0x6d')](_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6e')])){_0x274fcc['id']={'$in':_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6e')]};}_0x10e951=[[_0x3e0c('0x6f'),_0x3e0c('0x70')],[_0x3e0c('0x71'),_0x3e1c8a[0x0][_0x3e0c('0x68')]==='ASC'?_0x3e0c('0x72'):_0x3e0c('0x70')],db[_0x3e0c('0x73')]['literal'](_0x3e0c('0x74')),['id',_0x3e0c('0x72')]];}else{if(!_[_0x3e0c('0x6d')](_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6e')])){_0x274fcc['id']={'$notIn':_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6e')]};}_0x10e951=[[_0x3e0c('0x6f'),'DESC'],[_0x3e0c('0x71'),_0x3e1c8a[0x0][_0x3e0c('0x68')]],db[_0x3e0c('0x73')]['literal'](_0x3e0c('0x75')),['id',_0x3e0c('0x70')]];}return db['CmHopper'][_0x3e0c('0x76')]({'attributes':['id',_0x3e0c('0x77'),'phone',_0x3e0c('0x78')],'where':_0x274fcc,'order':_0x10e951,'transaction':_0x368b04,'lock':_0x368b04['LOCK'][_0x3e0c('0x79')],'include':[{'model':db[_0x3e0c('0x5a')],'as':_0x3e0c('0x7a'),'attributes':_0x58aa5d,'include':[{'model':db['CmCompany'],'as':_0x3e0c('0x7b'),'attributes':['id',_0x3e0c('0x13')]}]},{'model':db[_0x3e0c('0x7c')],'as':_0x3e0c('0x7d'),'attributes':['id','name']},{'model':db[_0x3e0c('0x47')],'as':_0x3e0c('0x7e'),'attributes':['id','name',_0x3e0c('0x7f')]}]})[_0x3e0c('0xf')](function(_0x13cca3){if(_0x13cca3){return _0x13cca3[_0x3e0c('0xe')]({'UserId':_0x2f6666['user']['id']},{'transaction':_0x368b04});}});});}})[_0x3e0c('0xf')](handleEntityNotFound(_0xcc965b,null))['then'](respondWithResult(_0xcc965b,null))[_0x3e0c('0x3c')](handleError(_0xcc965b,null));};exports[_0x3e0c('0x80')]=function(_0x32f787,_0x7a867b,_0xe2533b){var _0x1474f5=[];var _0x345108=_0x32f787[_0x3e0c('0x42')]['id'];var _0x518f39=_0x32f787['user']['id'];return db[_0x3e0c('0x5a')]['describe']()[_0x3e0c('0xf')](function(_0x573576){_0x1474f5=_[_0x3e0c('0x19')](_0x573576);return db['sequelize'][_0x3e0c('0x6a')](function(_0x2ad053){const _0x383387={'id':_0x345108};return db['CmHopper'][_0x3e0c('0x76')]({'attributes':['id',_0x3e0c('0x77'),_0x3e0c('0x78')],'where':_0x383387,'transaction':_0x2ad053,'lock':_0x2ad053[_0x3e0c('0x81')][_0x3e0c('0x79')],'include':[{'model':db[_0x3e0c('0x5a')],'as':_0x3e0c('0x7a'),'attributes':_0x1474f5,'include':[{'model':db[_0x3e0c('0x82')],'as':_0x3e0c('0x7b'),'attributes':['id','name']}]},{'model':db[_0x3e0c('0x7c')],'as':_0x3e0c('0x7d'),'attributes':['id',_0x3e0c('0x13')]},{'model':db[_0x3e0c('0x47')],'as':'Queue','attributes':['id',_0x3e0c('0x13'),_0x3e0c('0x7f')]}]})[_0x3e0c('0xf')](function(_0x234fae){if(_0x234fae){return _0x234fae['update']({'UserId':_0x518f39},{'transaction':_0x2ad053});}});});})[_0x3e0c('0xf')](handleEntityNotFound(_0x7a867b,null))[_0x3e0c('0xf')](respondWithResult(_0x7a867b,null))[_0x3e0c('0x3c')](handleError(_0x7a867b,null));};exports[_0x3e0c('0x83')]=function(_0x15fc4b,_0xed0325){return _0x15fc4b[_0x3e0c('0x51')][_0x3e0c('0x65')]({'where':{'type':_0x3e0c('0x66'),'dialActive':!![],'dialMethod':_0x3e0c('0x67')},'attributes':['id'],'raw':!![]})[_0x3e0c('0xf')](function(_0x2eec6a){if(_0x2eec6a&&_0x2eec6a[_0x3e0c('0x2f')]){return db[_0x3e0c('0x14')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3e0c('0x54')](_0x3e0c('0x55'))},'VoiceQueueId':{'$in':_[_0x3e0c('0x17')](_0x2eec6a,'id')},'$or':[{'UserId':null},{'UserId':_0x15fc4b[_0x3e0c('0x51')]['id']}]}});}return 0x0;})[_0x3e0c('0xf')](function(_0x11b2d0){if(!_['isNil'](_0x11b2d0)&&_['isNumber'](_0x11b2d0)){return _0xed0325[_0x3e0c('0x6')](0xc8)['json']({'contacts':_0x11b2d0});}else{logger[_0x3e0c('0x11')](_0x3e0c('0x84'),_0x3e0c('0x83'),0x194,_0x3e0c('0x85'));_0xed0325[_0x3e0c('0x10')](0x194);}})[_0x3e0c('0x3c')](handleError(_0xed0325,null));};exports[_0x3e0c('0x86')]=function(_0x4cd2d0,_0x3283d0){var _0x1efb21=shared[_0x3e0c('0x87')];var _0x20dc9c=[];_[_0x3e0c('0x17')](_0x1efb21,function(_0x373b81){_0x20dc9c['push']({'id':_0x373b81[_0x3e0c('0x13')],'name':_0x373b81[_0x3e0c('0x13')],'utcOffset':_0x373b81[_0x3e0c('0x88')]});});return _0x3283d0[_0x3e0c('0x6')](0xc8)['json']({'tz':_0x20dc9c});};exports[_0x3e0c('0x89')]=function(_0x489b45,_0x5f56e9){var _0x181bd8=shared[_0x3e0c('0x87')];var _0xd83a3c={};if(!_[_0x3e0c('0x5d')](_0x181bd8[_0x489b45['body']['id']]))_0xd83a3c=_0x181bd8[_0x489b45['body']['id']];return _0x5f56e9[_0x3e0c('0x6')](0xc8)[_0x3e0c('0xd')](_0xd83a3c);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index a0720e6..00bd452 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 _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x480f48,_0x141be5){var _0x52674a=function(_0x4681ce){while(--_0x4681ce){_0x480f48['push'](_0x480f48['shift']());}};_0x52674a(++_0x141be5);}(_0xeff8,0x186));var _0x8eff=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeff8[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8eff('0xb'),'fields':[_0x8eff('0xb')]},{'name':_0x8eff('0xc'),'fields':[_0x8eff('0xc')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x4d82a5,_0x926eb9){_0x4d82a5=_0x4d82a5-0x0;var _0x2d88cb=_0xbd51[_0x4d82a5];return _0x2d88cb;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[{'name':_0x1bd5('0xa'),'fields':[_0x1bd5('0xa')]},{'name':'phone','fields':[_0x1bd5('0xb')]},{'name':'priority','fields':[_0x1bd5('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 038717b..6e7222c 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 _0x92d7=['findAll','options','raw','where','attributes','limit','include','model','map','info','debug','message','error','ShowCmHopper','CmHopper','find','then','catch','create','body','CreateCmHopper','stringify','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','CmContact','keys','User','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','CountReScheduled','format','\x20,\x201,\x20null','GetContactRecallMe','GetCmHopperPreview','Contact','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','Agent','lodash','util','bluebird','../../mysqldb','rpc','GetCmHopper'];(function(_0x46e369,_0x5b73ec){var _0x58fbba=function(_0x13bde2){while(--_0x13bde2){_0x46e369['push'](_0x46e369['shift']());}};_0x58fbba(++_0x5b73ec);}(_0x92d7,0x12a));var _0x792d=function(_0x16a1d5,_0x885088){_0x16a1d5=_0x16a1d5-0x0;var _0x2f0f26=_0x92d7[_0x16a1d5];return _0x2f0f26;};'use strict';var _=require(_0x792d('0x0'));var util=require(_0x792d('0x1'));var moment=require('moment');var BPromise=require(_0x792d('0x2'));var db=require(_0x792d('0x3'))['db'];var logger=require('../../config/logger')(_0x792d('0x4'));exports[_0x792d('0x5')]=function(_0x41b2e8){var _0xaa7a37=this;return new Promise(function(_0x1b6910,_0x13b8af){return db['CmHopper'][_0x792d('0x6')]({'raw':_0x41b2e8[_0x792d('0x7')]?_0x41b2e8['options'][_0x792d('0x8')]===undefined?!![]:![]:!![],'where':_0x41b2e8[_0x792d('0x7')]?_0x41b2e8[_0x792d('0x7')][_0x792d('0x9')]||null:null,'attributes':_0x41b2e8[_0x792d('0x7')]?_0x41b2e8[_0x792d('0x7')][_0x792d('0xa')]||null:null,'limit':_0x41b2e8['options']?_0x41b2e8[_0x792d('0x7')][_0x792d('0xb')]||null:null,'include':_0x41b2e8['options']?_0x41b2e8[_0x792d('0x7')][_0x792d('0xc')]?_['map'](_0x41b2e8['options'][_0x792d('0xc')],function(_0x33f5e2){return{'model':db[_0x33f5e2[_0x792d('0xd')]],'as':_0x33f5e2['as'],'attributes':_0x33f5e2[_0x792d('0xa')],'include':_0x33f5e2['include']?_[_0x792d('0xe')](_0x33f5e2['include'],function(_0x196bd8){return{'model':db[_0x196bd8[_0x792d('0xd')]],'as':_0x196bd8['as'],'attributes':_0x196bd8[_0x792d('0xa')],'include':_0x196bd8[_0x792d('0xc')]?_[_0x792d('0xe')](_0x196bd8[_0x792d('0xc')],function(_0x5c4ce6){return{'model':db[_0x5c4ce6[_0x792d('0xd')]],'as':_0x5c4ce6['as'],'attributes':_0x5c4ce6[_0x792d('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x206be5){logger[_0x792d('0xf')](_0x792d('0x5'),_0x41b2e8);logger[_0x792d('0x10')](_0x792d('0x5'),_0x41b2e8,JSON['stringify'](_0x206be5));_0x1b6910(_0x206be5);})['catch'](function(_0x4a0d42){logger['error'](_0x792d('0x5'),_0x4a0d42[_0x792d('0x11')],_0x41b2e8);_0x13b8af(_0xaa7a37[_0x792d('0x12')](0x1f4,_0x4a0d42['message']));});});};exports[_0x792d('0x13')]=function(_0x43de90){var _0x413161=this;return new Promise(function(_0x26529f,_0x25317d){return db[_0x792d('0x14')][_0x792d('0x15')]({'raw':_0x43de90[_0x792d('0x7')]?_0x43de90[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'where':_0x43de90['options']?_0x43de90['options'][_0x792d('0x9')]||null:null,'attributes':_0x43de90['options']?_0x43de90[_0x792d('0x7')][_0x792d('0xa')]||null:null,'include':_0x43de90[_0x792d('0x7')]?_0x43de90[_0x792d('0x7')][_0x792d('0xc')]?_[_0x792d('0xe')](_0x43de90[_0x792d('0x7')][_0x792d('0xc')],function(_0x10c6b3){return{'model':db[_0x10c6b3[_0x792d('0xd')]],'as':_0x10c6b3['as'],'attributes':_0x10c6b3[_0x792d('0xa')],'include':_0x10c6b3['include']?_['map'](_0x10c6b3[_0x792d('0xc')],function(_0x1011f9){return{'model':db[_0x1011f9[_0x792d('0xd')]],'as':_0x1011f9['as'],'attributes':_0x1011f9[_0x792d('0xa')],'include':_0x1011f9[_0x792d('0xc')]?_['map'](_0x1011f9['include'],function(_0xe70291){return{'model':db[_0xe70291['model']],'as':_0xe70291['as'],'attributes':_0xe70291[_0x792d('0xa')]};}):[]};}):[]};}):[]:[]})[_0x792d('0x16')](function(_0x1ef07b){logger[_0x792d('0xf')]('ShowCmHopper',_0x43de90);logger['debug'](_0x792d('0x13'),_0x43de90,JSON['stringify'](_0x1ef07b));_0x26529f(_0x1ef07b);})[_0x792d('0x17')](function(_0x3c3b09){logger[_0x792d('0x12')](_0x792d('0x13'),_0x3c3b09[_0x792d('0x11')],_0x43de90);_0x25317d(_0x413161['error'](0x1f4,_0x3c3b09['message']));});});};exports['CreateCmHopper']=function(_0x414dd3){var _0x127cc1=this;return new Promise(function(_0x1c4818,_0x5a1ed4){return db[_0x792d('0x14')][_0x792d('0x18')](_0x414dd3[_0x792d('0x19')],{'raw':_0x414dd3[_0x792d('0x7')]?_0x414dd3['options']['raw']===undefined?!![]:![]:!![]})[_0x792d('0x16')](function(_0xdcd18a){logger[_0x792d('0xf')](_0x792d('0x1a'),_0x414dd3);logger[_0x792d('0x10')](_0x792d('0x1a'),_0x414dd3,JSON[_0x792d('0x1b')](_0xdcd18a));_0x1c4818(_0xdcd18a);})[_0x792d('0x17')](function(_0x3831c6){logger[_0x792d('0x12')](_0x792d('0x1a'),_0x3831c6[_0x792d('0x11')],_0x414dd3);_0x5a1ed4(_0x127cc1['error'](0x1f4,_0x3831c6['message']));});});};exports[_0x792d('0x1c')]=function(_0x2110ea){var _0xa83355=this;return new Promise(function(_0x314716,_0x16410b){return db[_0x792d('0x14')][_0x792d('0x1d')](_0x2110ea[_0x792d('0x19')],{'raw':_0x2110ea[_0x792d('0x7')]?_0x2110ea[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2110ea['options']?_0x2110ea[_0x792d('0x7')][_0x792d('0x9')]||null:null,'attributes':_0x2110ea[_0x792d('0x7')]?_0x2110ea[_0x792d('0x7')][_0x792d('0xa')]||null:null,'limit':_0x2110ea[_0x792d('0x7')]?_0x2110ea[_0x792d('0x7')][_0x792d('0xb')]||null:null})[_0x792d('0x16')](function(_0x2f3674){logger[_0x792d('0xf')]('UpdateCmHopper',_0x2110ea);logger[_0x792d('0xf')](_0x792d('0x1e'),JSON['stringify'](_0x2110ea['options'][_0x792d('0x9')]),_0x2110ea['body']['active']);logger[_0x792d('0x10')]('UpdateCmHopper',_0x2110ea,JSON[_0x792d('0x1b')](_0x2f3674));_0x314716(_0x2f3674);})['catch'](function(_0x20ea85){logger[_0x792d('0x12')]('UpdateCmHopper',_0x20ea85[_0x792d('0x11')],_0x2110ea);_0x16410b(_0xa83355[_0x792d('0x12')](0x1f4,_0x20ea85[_0x792d('0x11')]));});});};exports[_0x792d('0x1f')]=function(_0x52b076){var _0x218af4=this;return new Promise(function(_0x1bc0ec,_0x2902dc){return db[_0x792d('0x14')]['destroy']({'where':_0x52b076['options']?_0x52b076['options'][_0x792d('0x9')]||null:null})[_0x792d('0x16')](function(_0x34ef98){logger[_0x792d('0xf')](_0x792d('0x1f'),_0x52b076);logger[_0x792d('0x10')](_0x792d('0x1f'),_0x52b076,JSON[_0x792d('0x1b')](_0x34ef98));_0x1bc0ec(_0x34ef98);})[_0x792d('0x17')](function(_0x44df3d){logger[_0x792d('0x12')](_0x792d('0x1f'),_0x44df3d[_0x792d('0x11')],_0x52b076);_0x2902dc(_0x218af4[_0x792d('0x12')](0x1f4,_0x44df3d[_0x792d('0x11')]));});});};exports[_0x792d('0x20')]=function(_0x233fa6){var _0x5ed0e4=this;return new Promise(function(_0xacc1e7,_0x14b87b){return db['CmContact'][_0x792d('0x21')]()[_0x792d('0x16')](function(_0x281734){return db[_0x792d('0x22')][_0x792d('0x23')](function(_0x1ed320){return db[_0x792d('0x14')][_0x792d('0x6')]({'where':_0x233fa6[_0x792d('0x7')]?_0x233fa6['options'][_0x792d('0x9')]||null:null,'attributes':_0x233fa6[_0x792d('0x7')]?_0x233fa6[_0x792d('0x7')][_0x792d('0xa')]||null:null,'limit':_0x233fa6[_0x792d('0x7')]?_0x233fa6[_0x792d('0x7')][_0x792d('0xb')]||null:null,'order':_0x233fa6[_0x792d('0x7')]?_0x233fa6[_0x792d('0x7')][_0x792d('0x24')]||null:null,'transaction':_0x1ed320,'lock':_0x1ed320[_0x792d('0x25')][_0x792d('0x26')],'include':[{'model':db[_0x792d('0x27')],'as':'Contact','attributes':_[_0x792d('0x28')](_0x281734)},{'model':db[_0x792d('0x29')],'as':'Agent','attributes':['id',_0x792d('0x2a'),_0x792d('0x2b')]}]})['then'](function(_0x484f8b){var _0x2b2b61=[];var _0x3e7948=[];for(var _0x35f256=0x0;_0x35f256<_0x484f8b[_0x792d('0x2c')];_0x35f256+=0x1){var _0x5d5498=_0x484f8b[_0x35f256][_0x792d('0x2d')];if(_0x5d5498===null){_0x2b2b61[_0x792d('0x2e')](_0x484f8b[_0x35f256]['update'](_0x233fa6[_0x792d('0x19')],{'transaction':_0x1ed320}));}else if(!_0x3e7948[_0x792d('0x2f')](_0x5d5498)){_0x3e7948['push'](_0x5d5498);_0x2b2b61[_0x792d('0x2e')](_0x484f8b[_0x35f256]['update'](_0x233fa6['body'],{'transaction':_0x1ed320}));}}return BPromise[_0x792d('0x30')](_0x2b2b61);});})[_0x792d('0x16')](function(_0x3b70e3){logger[_0x792d('0xf')]('GetContactDialer',_0x233fa6);if(_0x3b70e3[_0x792d('0x2c')]>0x0){logger[_0x792d('0xf')](_0x792d('0x31'),_0x3b70e3[0x0]['dataValues']['id'],_0x3b70e3[0x0][_0x792d('0x32')]['ContactId'],_0x3b70e3[0x0]['dataValues']['active']);}logger[_0x792d('0x10')](_0x792d('0x20'),_0x233fa6,JSON[_0x792d('0x1b')](_0x3b70e3));_0xacc1e7(_0x3b70e3);})['catch'](function(_0x1075c2){logger['error'](_0x792d('0x20'),_0x1075c2[_0x792d('0x11')],_0x233fa6);_0x14b87b(_0x5ed0e4[_0x792d('0x12')](0x1f4,_0x1075c2['message']));});});});};exports[_0x792d('0x33')]=function(_0x4e1bb1){var _0x406b43=this;return new Promise(function(_0x43b52f,_0x3e0988){return db[_0x792d('0x22')][_0x792d('0x23')](function(_0x3ab2b4){return db[_0x792d('0x34')][_0x792d('0x18')](_0x4e1bb1[_0x792d('0x19')],{'raw':_0x4e1bb1['options']?_0x4e1bb1[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'transaction':_0x3ab2b4})['then'](function(){logger['info'](_0x792d('0x35'),JSON[_0x792d('0x1b')](_0x4e1bb1[_0x792d('0x7')]['where']),_0x4e1bb1['options'][_0x792d('0x9')][_0x792d('0x36')]);return db[_0x792d('0x14')][_0x792d('0x37')]({'where':_0x4e1bb1[_0x792d('0x7')]?_0x4e1bb1[_0x792d('0x7')]['where']||null:null,'transaction':_0x3ab2b4});});})[_0x792d('0x16')](function(_0x25ec64){logger[_0x792d('0xf')](_0x792d('0x33'),_0x4e1bb1);logger[_0x792d('0x10')](_0x792d('0x33'),_0x4e1bb1,JSON['stringify'](_0x25ec64));_0x43b52f(_0x25ec64);})[_0x792d('0x17')](function(_0x407095){logger[_0x792d('0x12')](_0x792d('0x33'),_0x407095['message'],_0x4e1bb1);_0x3e0988(_0x406b43[_0x792d('0x12')](0x1f4,_0x407095['message']));});});};exports[_0x792d('0x38')]=function(_0x553679){var _0x56e4ce=this;return new Promise(function(_0x526ec8,_0x184245){return db[_0x792d('0x14')][_0x792d('0x6')]({'raw':_0x553679['options']?_0x553679[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'where':_0x553679[_0x792d('0x7')]?_0x553679[_0x792d('0x7')][_0x792d('0x9')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x792d('0x22')]['fn']('IF',db[_0x792d('0x22')]['literal']('`scheduledat`\x20>=\x20'+util[_0x792d('0x39')]('\x22%s\x22',moment()[_0x792d('0x39')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x792d('0x3a')))),'contactsRescheduled']]})[_0x792d('0x16')](function(_0x143465){logger[_0x792d('0xf')](_0x792d('0x38'),_0x553679);logger[_0x792d('0x10')](_0x792d('0x38'),_0x553679,JSON[_0x792d('0x1b')](_0x143465));_0x526ec8(_0x143465);})[_0x792d('0x17')](function(_0x45480c){logger[_0x792d('0x12')](_0x792d('0x38'),_0x45480c['message'],_0x553679);_0x184245(_0x56e4ce[_0x792d('0x12')](0x1f4,_0x45480c[_0x792d('0x11')]));});});};exports[_0x792d('0x3b')]=function(_0x19ce0c){var _0x1063b6=this;return new Promise(function(_0x3ffff2,_0x2238d7){return db[_0x792d('0x27')][_0x792d('0x21')]()[_0x792d('0x16')](function(){return db[_0x792d('0x22')][_0x792d('0x23')](function(_0x50a394){return db[_0x792d('0x14')]['findAll']({'where':_0x19ce0c[_0x792d('0x7')]?_0x19ce0c[_0x792d('0x7')][_0x792d('0x9')]||null:null,'attributes':_0x19ce0c[_0x792d('0x7')]?_0x19ce0c[_0x792d('0x7')][_0x792d('0xa')]||null:null,'limit':0x1,'order':_0x19ce0c['options']?_0x19ce0c[_0x792d('0x7')][_0x792d('0x24')]||null:null,'group':db[_0x792d('0x14')][_0x792d('0x2d')],'transaction':_0x50a394,'lock':_0x50a394[_0x792d('0x25')][_0x792d('0x26')],'include':_0x19ce0c[_0x792d('0x7')]?_0x19ce0c[_0x792d('0x7')]['include']?_[_0x792d('0xe')](_0x19ce0c[_0x792d('0x7')]['include'],function(_0x3e634a){return{'model':db[_0x3e634a['model']],'as':_0x3e634a['as'],'attributes':_0x3e634a[_0x792d('0xa')],'include':_0x3e634a[_0x792d('0xc')]?_[_0x792d('0xe')](_0x3e634a[_0x792d('0xc')],function(_0x3fe55b){return{'model':db[_0x3fe55b[_0x792d('0xd')]],'as':_0x3fe55b['as'],'attributes':_0x3fe55b['attributes'],'include':_0x3fe55b[_0x792d('0xc')]?_['map'](_0x3fe55b['include'],function(_0xf070d){return{'model':db[_0xf070d[_0x792d('0xd')]],'as':_0xf070d['as'],'attributes':_0xf070d[_0x792d('0xa')]};}):[]};}):[]};}):[]:[]})[_0x792d('0x16')](function(_0x195047){var _0x386e1a=[];for(var _0x159e46=0x0;_0x159e46<_0x195047[_0x792d('0x2c')];_0x159e46+=0x1){_0x386e1a[_0x792d('0x2e')](_0x195047[_0x159e46]['update'](_0x19ce0c[_0x792d('0x19')],{'transaction':_0x50a394}));}return BPromise[_0x792d('0x30')](_0x386e1a);});})[_0x792d('0x16')](function(_0x10bbf8){logger[_0x792d('0xf')](_0x792d('0x3b'),_0x19ce0c);logger['debug'](_0x792d('0x3b'),_0x19ce0c,JSON[_0x792d('0x1b')](_0x10bbf8));_0x3ffff2(_0x10bbf8);})[_0x792d('0x17')](function(_0x5ec648){logger['error']('GetContactRecallMe',_0x5ec648[_0x792d('0x11')],_0x19ce0c);_0x2238d7(_0x1063b6[_0x792d('0x12')](0x1f4,_0x5ec648[_0x792d('0x11')]));});});});};exports[_0x792d('0x3c')]=function(_0x178bf4){var _0x1e22d8=this;return new Promise(function(_0x189e5f,_0x26a8c3){db['CmContact']['describe']()[_0x792d('0x16')](function(_0xe3493e){return db[_0x792d('0x14')][_0x792d('0x6')]({'raw':_0x178bf4[_0x792d('0x7')]?_0x178bf4[_0x792d('0x7')][_0x792d('0x8')]===undefined?!![]:![]:!![],'where':_0x178bf4['options']?_0x178bf4[_0x792d('0x7')]['where']||null:null,'attributes':_0x178bf4[_0x792d('0x7')]?_0x178bf4['options']['attributes']||null:null,'limit':_0x178bf4['options']?_0x178bf4[_0x792d('0x7')]['limit']||null:null,'include':_0x178bf4[_0x792d('0x7')]?_0x178bf4['options']['include']?_[_0x792d('0xe')](_0x178bf4['options'][_0x792d('0xc')],function(_0x3f733a){return{'model':db[_0x3f733a[_0x792d('0xd')]],'as':_0x3f733a['as'],'attributes':_0x3f733a['as']===_0x792d('0x3d')?_['keys'](_0xe3493e):_0x3f733a[_0x792d('0xa')],'include':_0x3f733a['include']?_['map'](_0x3f733a[_0x792d('0xc')],function(_0x5eda51){return{'model':db[_0x5eda51[_0x792d('0xd')]],'as':_0x5eda51['as'],'attributes':_0x5eda51[_0x792d('0xa')],'include':_0x5eda51[_0x792d('0xc')]?_[_0x792d('0xe')](_0x5eda51[_0x792d('0xc')],function(_0x6352c7){return{'model':db[_0x6352c7[_0x792d('0xd')]],'as':_0x6352c7['as'],'attributes':_0x6352c7[_0x792d('0xa')]};}):[]};}):[]};}):[]:[]})[_0x792d('0x16')](function(_0x49498e){logger[_0x792d('0xf')](_0x792d('0x5'),_0x178bf4);logger[_0x792d('0x10')](_0x792d('0x5'),_0x178bf4,JSON[_0x792d('0x1b')](_0x49498e));_0x189e5f(_0x49498e);})[_0x792d('0x17')](function(_0x4fe9ce){logger['error'](_0x792d('0x5'),_0x4fe9ce[_0x792d('0x11')],_0x178bf4);_0x26a8c3(_0x1e22d8[_0x792d('0x12')](0x1f4,_0x4fe9ce[_0x792d('0x11')]));});});});};exports['GetContactByPhone']=function(_0x372c8d){var _0x53e03e=this;return new Promise(function(_0xb6fc20,_0x15040c){return db[_0x792d('0x27')][_0x792d('0x3e')]({'raw':!![],'where':{'phone':_0x372c8d[_0x792d('0x7')][_0x792d('0x9')][_0x792d('0x3f')]},'attributes':['id',_0x792d('0x40')],'order':[['id',_0x792d('0x41')]]})[_0x792d('0x16')](function(_0x184b96){logger['info']('getContactByPhone',_0x372c8d);logger[_0x792d('0x10')](_0x792d('0x42'),_0x372c8d,JSON['stringify'](_0x184b96));_0xb6fc20(_0x184b96);})['catch'](function(_0x2b9432){logger['error'](_0x792d('0x42'),_0x2b9432[_0x792d('0x11')],_0x372c8d);_0x15040c(_0x53e03e[_0x792d('0x12')](0x1f4,_0x2b9432['message']));});});};exports['ResetActiveCalls']=function(_0x44a24e){var _0x199e1d=this;return new Promise(function(_0x3eb3b5,_0x2ae679){return db[_0x792d('0x22')][_0x792d('0x23')](function(_0x4a5102){var _0x388de8=_0x44a24e[_0x792d('0x7')]&&_0x44a24e[_0x792d('0x7')][_0x792d('0x9')]?_0x44a24e['options'][_0x792d('0x9')]:{};return db['CmHopper'][_0x792d('0x1d')](_0x44a24e[_0x792d('0x19')],{'where':_0x388de8,'transaction':_0x4a5102})[_0x792d('0x16')](function(_0x36fd06){logger[_0x792d('0xf')](_0x792d('0x43'),_0x44a24e);logger[_0x792d('0x10')](_0x792d('0x43'),_0x44a24e,JSON[_0x792d('0x1b')](_0x36fd06));_0x3eb3b5(_0x36fd06);})[_0x792d('0x17')](function(_0x5dbc24){logger[_0x792d('0x12')](_0x792d('0x43'),_0x5dbc24[_0x792d('0x11')],_0x44a24e);_0x2ae679(_0x199e1d[_0x792d('0x12')](0x1f4,_0x5dbc24['message']));});});});};exports[_0x792d('0x44')]=function(_0xc060d){var _0x147c56=this;var _0x4a18ca=_0xc060d[_0x792d('0x19')][_0x792d('0x9')][_0x792d('0x45')];var _0x21b0dc=_0xc060d[_0x792d('0x19')]['where'][_0x792d('0x46')];var _0x2277f6=_0xc060d['body']['where'][_0x792d('0x47')];return new Promise(function(_0x2d6641,_0x1a5111){return db[_0x792d('0x14')]['findAll']({'where':{'voiceQueueId':{'$in':_0x4a18ca},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x792d('0x22')][_0x792d('0x48')](_0x792d('0x49')+_0x21b0dc+_0x792d('0x4a')),'$gt':db[_0x792d('0x22')]['literal']('NOW()')}},'UserId':{'$in':_0x2277f6}},'include':[{'model':db[_0x792d('0x27')],'as':_0x792d('0x3d')},{'model':db[_0x792d('0x29')],'as':_0x792d('0x4b'),'attributes':['id','name','voicePause']},{'model':db['CmList'],'as':'List'}]})[_0x792d('0x16')](function(_0x2ff85a){if(_0x2ff85a['length']>0x0){return db['sequelize'][_0x792d('0x23')](function(_0x342930){return db[_0x792d('0x14')][_0x792d('0x1d')]({'recallmeNotifiedDate':db['sequelize'][_0x792d('0x48')]('NOW()')},{'where':{'id':{'$in':_[_0x792d('0xe')](_0x2ff85a,'id')}},'transaction':_0x342930})[_0x792d('0x16')](function(){_0x2d6641(_0x2ff85a);})[_0x792d('0x17')](function(_0x3671f0){logger[_0x792d('0x12')](_0x792d('0x44'),_0x3671f0[_0x792d('0x11')],_0xc060d);_0x1a5111(_0x147c56[_0x792d('0x12')](0x1f4,_0x3671f0[_0x792d('0x11')]));});})['catch'](function(_0x599437){logger[_0x792d('0x12')](_0x792d('0x44'),_0x599437[_0x792d('0x11')],_0xc060d);_0x1a5111(_0x147c56['error'](0x1f4,_0x599437[_0x792d('0x11')]));});}else{_0x2d6641(_0x2ff85a);}});});}; \ No newline at end of file +var _0x2567=['CmList','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','Contact','User','Agent','name','length','UserId','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','describe','GetContactRecallMe','GetCmHopperPreview','keys','GetContactByPhone','findOne','DESC','getContactByPhone','ResetActiveCalls','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','voicePause'];(function(_0x2bfc17,_0x1c5126){var _0x25d51c=function(_0x5f103a){while(--_0x5f103a){_0x2bfc17['push'](_0x2bfc17['shift']());}};_0x25d51c(++_0x1c5126);}(_0x2567,0x14a));var _0x7256=function(_0x324a49,_0x205ed5){_0x324a49=_0x324a49-0x0;var _0x43307b=_0x2567[_0x324a49];return _0x43307b;};'use strict';var _=require(_0x7256('0x0'));var util=require(_0x7256('0x1'));var moment=require(_0x7256('0x2'));var BPromise=require(_0x7256('0x3'));var db=require(_0x7256('0x4'))['db'];var logger=require(_0x7256('0x5'))(_0x7256('0x6'));exports[_0x7256('0x7')]=function(_0x13255f){var _0x35afdb=this;return new Promise(function(_0x3e55d6,_0x1f8086){return db[_0x7256('0x8')][_0x7256('0x9')]({'raw':_0x13255f[_0x7256('0xa')]?_0x13255f['options'][_0x7256('0xb')]===undefined?!![]:![]:!![],'where':_0x13255f[_0x7256('0xa')]?_0x13255f['options'][_0x7256('0xc')]||null:null,'attributes':_0x13255f[_0x7256('0xa')]?_0x13255f[_0x7256('0xa')][_0x7256('0xd')]||null:null,'limit':_0x13255f[_0x7256('0xa')]?_0x13255f[_0x7256('0xa')][_0x7256('0xe')]||null:null,'include':_0x13255f[_0x7256('0xa')]?_0x13255f[_0x7256('0xa')][_0x7256('0xf')]?_[_0x7256('0x10')](_0x13255f[_0x7256('0xa')][_0x7256('0xf')],function(_0xf27c31){return{'model':db[_0xf27c31['model']],'as':_0xf27c31['as'],'attributes':_0xf27c31['attributes'],'include':_0xf27c31[_0x7256('0xf')]?_[_0x7256('0x10')](_0xf27c31[_0x7256('0xf')],function(_0x21eb0f){return{'model':db[_0x21eb0f['model']],'as':_0x21eb0f['as'],'attributes':_0x21eb0f[_0x7256('0xd')],'include':_0x21eb0f[_0x7256('0xf')]?_['map'](_0x21eb0f[_0x7256('0xf')],function(_0x64cfb4){return{'model':db[_0x64cfb4[_0x7256('0x11')]],'as':_0x64cfb4['as'],'attributes':_0x64cfb4[_0x7256('0xd')]};}):[]};}):[]};}):[]:[]})[_0x7256('0x12')](function(_0x5c6081){logger[_0x7256('0x13')](_0x7256('0x7'),_0x13255f);logger[_0x7256('0x14')](_0x7256('0x7'),_0x13255f,JSON[_0x7256('0x15')](_0x5c6081));_0x3e55d6(_0x5c6081);})[_0x7256('0x16')](function(_0x13277a){logger[_0x7256('0x17')](_0x7256('0x7'),_0x13277a[_0x7256('0x18')],_0x13255f);_0x1f8086(_0x35afdb[_0x7256('0x17')](0x1f4,_0x13277a[_0x7256('0x18')]));});});};exports[_0x7256('0x19')]=function(_0x4a6916){var _0x3e9f3d=this;return new Promise(function(_0x2bddef,_0x46c337){return db[_0x7256('0x8')][_0x7256('0x1a')]({'raw':_0x4a6916[_0x7256('0xa')]?_0x4a6916[_0x7256('0xa')][_0x7256('0xb')]===undefined?!![]:![]:!![],'where':_0x4a6916[_0x7256('0xa')]?_0x4a6916[_0x7256('0xa')][_0x7256('0xc')]||null:null,'attributes':_0x4a6916[_0x7256('0xa')]?_0x4a6916[_0x7256('0xa')][_0x7256('0xd')]||null:null,'include':_0x4a6916[_0x7256('0xa')]?_0x4a6916[_0x7256('0xa')][_0x7256('0xf')]?_['map'](_0x4a6916[_0x7256('0xa')][_0x7256('0xf')],function(_0xae0874){return{'model':db[_0xae0874[_0x7256('0x11')]],'as':_0xae0874['as'],'attributes':_0xae0874[_0x7256('0xd')],'include':_0xae0874[_0x7256('0xf')]?_[_0x7256('0x10')](_0xae0874['include'],function(_0x47f78d){return{'model':db[_0x47f78d[_0x7256('0x11')]],'as':_0x47f78d['as'],'attributes':_0x47f78d[_0x7256('0xd')],'include':_0x47f78d[_0x7256('0xf')]?_[_0x7256('0x10')](_0x47f78d['include'],function(_0x35070a){return{'model':db[_0x35070a['model']],'as':_0x35070a['as'],'attributes':_0x35070a[_0x7256('0xd')]};}):[]};}):[]};}):[]:[]})[_0x7256('0x12')](function(_0x5a6659){logger[_0x7256('0x13')](_0x7256('0x19'),_0x4a6916);logger[_0x7256('0x14')](_0x7256('0x19'),_0x4a6916,JSON[_0x7256('0x15')](_0x5a6659));_0x2bddef(_0x5a6659);})[_0x7256('0x16')](function(_0x3c7c6b){logger[_0x7256('0x17')](_0x7256('0x19'),_0x3c7c6b[_0x7256('0x18')],_0x4a6916);_0x46c337(_0x3e9f3d['error'](0x1f4,_0x3c7c6b[_0x7256('0x18')]));});});};exports[_0x7256('0x1b')]=function(_0x4209d0){var _0x3eb620=this;return new Promise(function(_0x4bd27d,_0x3d75a8){return db[_0x7256('0x8')][_0x7256('0x1c')](_0x4209d0['body'],{'raw':_0x4209d0[_0x7256('0xa')]?_0x4209d0[_0x7256('0xa')][_0x7256('0xb')]===undefined?!![]:![]:!![]})[_0x7256('0x12')](function(_0x25fd41){logger[_0x7256('0x13')]('CreateCmHopper',_0x4209d0);logger[_0x7256('0x14')](_0x7256('0x1b'),_0x4209d0,JSON[_0x7256('0x15')](_0x25fd41));_0x4bd27d(_0x25fd41);})[_0x7256('0x16')](function(_0x1a425c){logger[_0x7256('0x17')](_0x7256('0x1b'),_0x1a425c['message'],_0x4209d0);_0x3d75a8(_0x3eb620[_0x7256('0x17')](0x1f4,_0x1a425c[_0x7256('0x18')]));});});};exports[_0x7256('0x1d')]=function(_0x327582){var _0x205a37=this;return new Promise(function(_0xdf18e5,_0xa00550){return db[_0x7256('0x8')]['update'](_0x327582[_0x7256('0x1e')],{'raw':_0x327582[_0x7256('0xa')]?_0x327582[_0x7256('0xa')][_0x7256('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x327582[_0x7256('0xa')]?_0x327582['options'][_0x7256('0xc')]||null:null,'attributes':_0x327582[_0x7256('0xa')]?_0x327582[_0x7256('0xa')]['attributes']||null:null,'limit':_0x327582[_0x7256('0xa')]?_0x327582[_0x7256('0xa')][_0x7256('0xe')]||null:null})[_0x7256('0x12')](function(_0x19ab65){logger[_0x7256('0x13')]('UpdateCmHopper',_0x327582);logger[_0x7256('0x13')](_0x7256('0x1f'),JSON['stringify'](_0x327582[_0x7256('0xa')][_0x7256('0xc')]),_0x327582['body'][_0x7256('0x20')]);logger['debug']('UpdateCmHopper',_0x327582,JSON[_0x7256('0x15')](_0x19ab65));_0xdf18e5(_0x19ab65);})[_0x7256('0x16')](function(_0x47949d){logger['error'](_0x7256('0x1d'),_0x47949d[_0x7256('0x18')],_0x327582);_0xa00550(_0x205a37[_0x7256('0x17')](0x1f4,_0x47949d['message']));});});};exports[_0x7256('0x21')]=function(_0x3bded0){var _0x201a03=this;return new Promise(function(_0x4cdf3d,_0x164ebe){return db[_0x7256('0x8')][_0x7256('0x22')]({'where':_0x3bded0[_0x7256('0xa')]?_0x3bded0[_0x7256('0xa')]['where']||null:null})['then'](function(_0x2f6aec){logger[_0x7256('0x13')](_0x7256('0x21'),_0x3bded0);logger[_0x7256('0x14')](_0x7256('0x21'),_0x3bded0,JSON['stringify'](_0x2f6aec));_0x4cdf3d(_0x2f6aec);})[_0x7256('0x16')](function(_0x91e05c){logger[_0x7256('0x17')](_0x7256('0x21'),_0x91e05c[_0x7256('0x18')],_0x3bded0);_0x164ebe(_0x201a03['error'](0x1f4,_0x91e05c[_0x7256('0x18')]));});});};exports[_0x7256('0x23')]=function(_0x7f8086){var _0x4a4b80=this;return new Promise(function(_0x487381,_0x6b69fa){return db[_0x7256('0x24')]['describe']()[_0x7256('0x12')](function(_0x394071){return db[_0x7256('0x25')][_0x7256('0x26')](function(_0x1bf702){return db[_0x7256('0x8')][_0x7256('0x9')]({'where':_0x7f8086[_0x7256('0xa')]?_0x7f8086[_0x7256('0xa')]['where']||null:null,'attributes':_0x7f8086[_0x7256('0xa')]?_0x7f8086['options'][_0x7256('0xd')]||null:null,'limit':_0x7f8086['options']?_0x7f8086[_0x7256('0xa')][_0x7256('0xe')]||null:null,'order':_0x7f8086[_0x7256('0xa')]?_0x7f8086[_0x7256('0xa')][_0x7256('0x27')]||null:null,'transaction':_0x1bf702,'lock':_0x1bf702[_0x7256('0x28')][_0x7256('0x29')],'include':[{'model':db['CmContact'],'as':_0x7256('0x2a'),'attributes':_['keys'](_0x394071)},{'model':db[_0x7256('0x2b')],'as':_0x7256('0x2c'),'attributes':['id',_0x7256('0x2d'),'voicePause']}]})[_0x7256('0x12')](function(_0x52281b){var _0x1dd65b=[];var _0x258eb2=[];for(var _0x25143b=0x0;_0x25143b<_0x52281b[_0x7256('0x2e')];_0x25143b+=0x1){var _0x348113=_0x52281b[_0x25143b][_0x7256('0x2f')];if(_0x348113===null){_0x1dd65b[_0x7256('0x30')](_0x52281b[_0x25143b][_0x7256('0x31')](_0x7f8086['body'],{'transaction':_0x1bf702}));}else if(!_0x258eb2[_0x7256('0x32')](_0x348113)){_0x258eb2[_0x7256('0x30')](_0x348113);_0x1dd65b[_0x7256('0x30')](_0x52281b[_0x25143b]['update'](_0x7f8086[_0x7256('0x1e')],{'transaction':_0x1bf702}));}}return BPromise[_0x7256('0x33')](_0x1dd65b);});})['then'](function(_0x1b0718){logger[_0x7256('0x13')](_0x7256('0x23'),_0x7f8086);if(_0x1b0718[_0x7256('0x2e')]>0x0){logger[_0x7256('0x13')](_0x7256('0x34'),_0x1b0718[0x0][_0x7256('0x35')]['id'],_0x1b0718[0x0][_0x7256('0x35')]['ContactId'],_0x1b0718[0x0][_0x7256('0x35')][_0x7256('0x20')]);}logger['debug']('GetContactDialer',_0x7f8086,JSON[_0x7256('0x15')](_0x1b0718));_0x487381(_0x1b0718);})[_0x7256('0x16')](function(_0x564ef6){logger[_0x7256('0x17')](_0x7256('0x23'),_0x564ef6[_0x7256('0x18')],_0x7f8086);_0x6b69fa(_0x4a4b80['error'](0x1f4,_0x564ef6[_0x7256('0x18')]));});});});};exports[_0x7256('0x36')]=function(_0x298d71){var _0x875862=this;return new Promise(function(_0x5d5a04,_0x59e19e){return db[_0x7256('0x25')]['transaction'](function(_0x4d7f61){return db[_0x7256('0x37')]['create'](_0x298d71[_0x7256('0x1e')],{'raw':_0x298d71[_0x7256('0xa')]?_0x298d71[_0x7256('0xa')][_0x7256('0xb')]===undefined?!![]:![]:!![],'transaction':_0x4d7f61})[_0x7256('0x12')](function(){logger['info'](_0x7256('0x38'),JSON[_0x7256('0x15')](_0x298d71[_0x7256('0xa')][_0x7256('0xc')]),_0x298d71[_0x7256('0xa')]['where'][_0x7256('0x20')]);return db[_0x7256('0x8')][_0x7256('0x22')]({'where':_0x298d71['options']?_0x298d71[_0x7256('0xa')][_0x7256('0xc')]||null:null,'transaction':_0x4d7f61});});})['then'](function(_0x52ce3a){logger[_0x7256('0x13')](_0x7256('0x36'),_0x298d71);logger[_0x7256('0x14')](_0x7256('0x36'),_0x298d71,JSON[_0x7256('0x15')](_0x52ce3a));_0x5d5a04(_0x52ce3a);})[_0x7256('0x16')](function(_0x56b687){logger[_0x7256('0x17')](_0x7256('0x36'),_0x56b687['message'],_0x298d71);_0x59e19e(_0x875862[_0x7256('0x17')](0x1f4,_0x56b687[_0x7256('0x18')]));});});};exports[_0x7256('0x39')]=function(_0x40cbbe){var _0x1dde99=this;return new Promise(function(_0xc91ab1,_0x49ecbc){return db[_0x7256('0x8')][_0x7256('0x9')]({'raw':_0x40cbbe['options']?_0x40cbbe[_0x7256('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x40cbbe['options']?_0x40cbbe[_0x7256('0xa')][_0x7256('0xc')]||null:null,'attributes':[[db[_0x7256('0x25')]['fn'](_0x7256('0x3a'),db[_0x7256('0x25')]['fn']('IF',db[_0x7256('0x25')][_0x7256('0x3b')](_0x7256('0x3c')+util[_0x7256('0x3d')]('\x22%s\x22',moment()[_0x7256('0x3d')](_0x7256('0x3e')))+_0x7256('0x3f')))),_0x7256('0x40')]]})[_0x7256('0x12')](function(_0x59aeca){logger[_0x7256('0x13')](_0x7256('0x39'),_0x40cbbe);logger[_0x7256('0x14')]('CountReScheduled',_0x40cbbe,JSON['stringify'](_0x59aeca));_0xc91ab1(_0x59aeca);})[_0x7256('0x16')](function(_0x32976f){logger[_0x7256('0x17')](_0x7256('0x39'),_0x32976f['message'],_0x40cbbe);_0x49ecbc(_0x1dde99[_0x7256('0x17')](0x1f4,_0x32976f[_0x7256('0x18')]));});});};exports['GetContactRecallMe']=function(_0xcc0df1){var _0x2db158=this;return new Promise(function(_0x4a441e,_0xe9f20c){return db['CmContact'][_0x7256('0x41')]()['then'](function(){return db[_0x7256('0x25')][_0x7256('0x26')](function(_0x52ff9e){return db[_0x7256('0x8')][_0x7256('0x9')]({'where':_0xcc0df1[_0x7256('0xa')]?_0xcc0df1[_0x7256('0xa')][_0x7256('0xc')]||null:null,'attributes':_0xcc0df1[_0x7256('0xa')]?_0xcc0df1[_0x7256('0xa')][_0x7256('0xd')]||null:null,'limit':0x1,'order':_0xcc0df1[_0x7256('0xa')]?_0xcc0df1['options'][_0x7256('0x27')]||null:null,'group':db[_0x7256('0x8')][_0x7256('0x2f')],'transaction':_0x52ff9e,'lock':_0x52ff9e[_0x7256('0x28')]['UPDATE'],'include':_0xcc0df1['options']?_0xcc0df1['options']['include']?_[_0x7256('0x10')](_0xcc0df1[_0x7256('0xa')][_0x7256('0xf')],function(_0x242302){return{'model':db[_0x242302[_0x7256('0x11')]],'as':_0x242302['as'],'attributes':_0x242302[_0x7256('0xd')],'include':_0x242302[_0x7256('0xf')]?_[_0x7256('0x10')](_0x242302['include'],function(_0xdcb751){return{'model':db[_0xdcb751['model']],'as':_0xdcb751['as'],'attributes':_0xdcb751[_0x7256('0xd')],'include':_0xdcb751['include']?_[_0x7256('0x10')](_0xdcb751[_0x7256('0xf')],function(_0x4bcb6f){return{'model':db[_0x4bcb6f[_0x7256('0x11')]],'as':_0x4bcb6f['as'],'attributes':_0x4bcb6f[_0x7256('0xd')]};}):[]};}):[]};}):[]:[]})[_0x7256('0x12')](function(_0x193e80){var _0x40dcff=[];for(var _0x2ccb5e=0x0;_0x2ccb5e<_0x193e80['length'];_0x2ccb5e+=0x1){_0x40dcff[_0x7256('0x30')](_0x193e80[_0x2ccb5e][_0x7256('0x31')](_0xcc0df1['body'],{'transaction':_0x52ff9e}));}return BPromise[_0x7256('0x33')](_0x40dcff);});})['then'](function(_0x37affb){logger[_0x7256('0x13')](_0x7256('0x42'),_0xcc0df1);logger[_0x7256('0x14')](_0x7256('0x42'),_0xcc0df1,JSON[_0x7256('0x15')](_0x37affb));_0x4a441e(_0x37affb);})[_0x7256('0x16')](function(_0x262527){logger['error'](_0x7256('0x42'),_0x262527[_0x7256('0x18')],_0xcc0df1);_0xe9f20c(_0x2db158[_0x7256('0x17')](0x1f4,_0x262527[_0x7256('0x18')]));});});});};exports[_0x7256('0x43')]=function(_0x3e550b){var _0x53ed45=this;return new Promise(function(_0x14018d,_0x58f596){db['CmContact'][_0x7256('0x41')]()[_0x7256('0x12')](function(_0x5ae2dc){return db[_0x7256('0x8')][_0x7256('0x9')]({'raw':_0x3e550b[_0x7256('0xa')]?_0x3e550b['options'][_0x7256('0xb')]===undefined?!![]:![]:!![],'where':_0x3e550b[_0x7256('0xa')]?_0x3e550b[_0x7256('0xa')]['where']||null:null,'attributes':_0x3e550b[_0x7256('0xa')]?_0x3e550b[_0x7256('0xa')]['attributes']||null:null,'limit':_0x3e550b[_0x7256('0xa')]?_0x3e550b[_0x7256('0xa')][_0x7256('0xe')]||null:null,'include':_0x3e550b[_0x7256('0xa')]?_0x3e550b[_0x7256('0xa')][_0x7256('0xf')]?_[_0x7256('0x10')](_0x3e550b['options']['include'],function(_0x8b72bc){return{'model':db[_0x8b72bc[_0x7256('0x11')]],'as':_0x8b72bc['as'],'attributes':_0x8b72bc['as']===_0x7256('0x2a')?_[_0x7256('0x44')](_0x5ae2dc):_0x8b72bc[_0x7256('0xd')],'include':_0x8b72bc[_0x7256('0xf')]?_['map'](_0x8b72bc[_0x7256('0xf')],function(_0xedf33b){return{'model':db[_0xedf33b[_0x7256('0x11')]],'as':_0xedf33b['as'],'attributes':_0xedf33b[_0x7256('0xd')],'include':_0xedf33b[_0x7256('0xf')]?_[_0x7256('0x10')](_0xedf33b['include'],function(_0x36c5d3){return{'model':db[_0x36c5d3[_0x7256('0x11')]],'as':_0x36c5d3['as'],'attributes':_0x36c5d3['attributes']};}):[]};}):[]};}):[]:[]})[_0x7256('0x12')](function(_0xae19fc){logger[_0x7256('0x13')](_0x7256('0x7'),_0x3e550b);logger[_0x7256('0x14')](_0x7256('0x7'),_0x3e550b,JSON[_0x7256('0x15')](_0xae19fc));_0x14018d(_0xae19fc);})[_0x7256('0x16')](function(_0x48d6a9){logger['error'](_0x7256('0x7'),_0x48d6a9['message'],_0x3e550b);_0x58f596(_0x53ed45[_0x7256('0x17')](0x1f4,_0x48d6a9[_0x7256('0x18')]));});});});};exports[_0x7256('0x45')]=function(_0x8b5ab0){var _0x5d1c40=this;return new Promise(function(_0xb5dac5,_0x2e7a88){return db[_0x7256('0x24')][_0x7256('0x46')]({'raw':!![],'where':{'phone':_0x8b5ab0['options'][_0x7256('0xc')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0x7256('0x47')]]})['then'](function(_0x18e1ce){logger[_0x7256('0x13')](_0x7256('0x48'),_0x8b5ab0);logger[_0x7256('0x14')]('getContactByPhone',_0x8b5ab0,JSON[_0x7256('0x15')](_0x18e1ce));_0xb5dac5(_0x18e1ce);})[_0x7256('0x16')](function(_0x123605){logger[_0x7256('0x17')](_0x7256('0x48'),_0x123605[_0x7256('0x18')],_0x8b5ab0);_0x2e7a88(_0x5d1c40[_0x7256('0x17')](0x1f4,_0x123605[_0x7256('0x18')]));});});};exports['ResetActiveCalls']=function(_0x4c31b3){var _0x159bd8=this;return new Promise(function(_0x289b2f,_0x23ed38){return db['sequelize']['transaction'](function(_0xc0083f){var _0x31f4dc=_0x4c31b3['options']&&_0x4c31b3[_0x7256('0xa')][_0x7256('0xc')]?_0x4c31b3['options'][_0x7256('0xc')]:{};return db[_0x7256('0x8')][_0x7256('0x31')](_0x4c31b3[_0x7256('0x1e')],{'where':_0x31f4dc,'transaction':_0xc0083f})[_0x7256('0x12')](function(_0x3248cd){logger[_0x7256('0x13')](_0x7256('0x49'),_0x4c31b3);logger['debug'](_0x7256('0x49'),_0x4c31b3,JSON['stringify'](_0x3248cd));_0x289b2f(_0x3248cd);})[_0x7256('0x16')](function(_0x454abe){logger[_0x7256('0x17')](_0x7256('0x49'),_0x454abe['message'],_0x4c31b3);_0x23ed38(_0x159bd8[_0x7256('0x17')](0x1f4,_0x454abe[_0x7256('0x18')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x134175){var _0x21715d=this;var _0x57a117=_0x134175[_0x7256('0x1e')][_0x7256('0xc')]['voiceQueueIds'];var _0x2a17fd=_0x134175[_0x7256('0x1e')][_0x7256('0xc')][_0x7256('0x4a')];var _0x4b6c88=_0x134175['body']['where'][_0x7256('0x4b')];return new Promise(function(_0x17dcb1,_0x1d7063){return db[_0x7256('0x8')][_0x7256('0x9')]({'where':{'voiceQueueId':{'$in':_0x57a117},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x7256('0x25')][_0x7256('0x3b')](_0x7256('0x4c')+_0x2a17fd+_0x7256('0x4d')),'$gt':db[_0x7256('0x25')][_0x7256('0x3b')](_0x7256('0x4e'))}},'UserId':{'$in':_0x4b6c88}},'include':[{'model':db[_0x7256('0x24')],'as':_0x7256('0x2a')},{'model':db[_0x7256('0x2b')],'as':_0x7256('0x2c'),'attributes':['id','name',_0x7256('0x4f')]},{'model':db[_0x7256('0x50')],'as':'List'}]})[_0x7256('0x12')](function(_0x4edad6){if(_0x4edad6[_0x7256('0x2e')]>0x0){return db[_0x7256('0x25')]['transaction'](function(_0x7a4f32){return db[_0x7256('0x8')][_0x7256('0x31')]({'recallmeNotifiedDate':db[_0x7256('0x25')][_0x7256('0x3b')]('NOW()')},{'where':{'id':{'$in':_['map'](_0x4edad6,'id')}},'transaction':_0x7a4f32})[_0x7256('0x12')](function(){_0x17dcb1(_0x4edad6);})['catch'](function(_0x436bb5){logger[_0x7256('0x17')](_0x7256('0x51'),_0x436bb5[_0x7256('0x18')],_0x134175);_0x1d7063(_0x21715d['error'](0x1f4,_0x436bb5['message']));});})[_0x7256('0x16')](function(_0x153012){logger[_0x7256('0x17')](_0x7256('0x51'),_0x153012[_0x7256('0x18')],_0x134175);_0x1d7063(_0x21715d['error'](0x1f4,_0x153012[_0x7256('0x18')]));});}else{_0x17dcb1(_0x4edad6);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index fdd8de5..1ccef95 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 _0x5d9a=['express','get','isAuthenticated','index','/describe','describe','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','create','post','/preview','getPreview','/timezone','getTimezone','update','exports'];(function(_0x56948b,_0x2bb78f){var _0x34e02e=function(_0x36c33d){while(--_0x36c33d){_0x56948b['push'](_0x56948b['shift']());}};_0x34e02e(++_0x2bb78f);}(_0x5d9a,0xfc));var _0xa5d9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5d9a[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0xa5d9('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0xa5d9('0x1')]('/',auth[_0xa5d9('0x2')](),controller[_0xa5d9('0x3')]);router[_0xa5d9('0x1')](_0xa5d9('0x4'),auth[_0xa5d9('0x2')](),controller[_0xa5d9('0x5')]);router[_0xa5d9('0x1')]('/opencontacts',auth[_0xa5d9('0x2')](),controller[_0xa5d9('0x6')]);router[_0xa5d9('0x1')](_0xa5d9('0x7'),auth['isAuthenticated'](),controller[_0xa5d9('0x8')]);router['get'](_0xa5d9('0x9'),auth[_0xa5d9('0x2')](),controller[_0xa5d9('0xa')]);router[_0xa5d9('0x1')](_0xa5d9('0xb'),auth[_0xa5d9('0x2')](),controller[_0xa5d9('0xc')]);router['post']('/',auth[_0xa5d9('0x2')](),controller[_0xa5d9('0xd')]);router[_0xa5d9('0xe')](_0xa5d9('0xf'),auth['isAuthenticated'](),controller[_0xa5d9('0x10')]);router[_0xa5d9('0xe')](_0xa5d9('0x11'),auth['isAuthenticated'](),controller[_0xa5d9('0x12')]);router['put'](_0xa5d9('0x9'),auth['isAuthenticated'](),controller[_0xa5d9('0x13')]);router['delete'](_0xa5d9('0x9'),auth[_0xa5d9('0x2')](),controller['destroy']);module[_0xa5d9('0x14')]=router; \ No newline at end of file +var _0xb70d=['getOpenContacts','/timezones','/:id','getPreviewRecall','create','/preview','post','getTimezone','put','update','destroy','exports','express','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts'];(function(_0x1dc630,_0x2e5472){var _0x287da3=function(_0x362647){while(--_0x362647){_0x1dc630['push'](_0x1dc630['shift']());}};_0x287da3(++_0x2e5472);}(_0xb70d,0x108));var _0xdb70=function(_0x17041a,_0x2e9838){_0x17041a=_0x17041a-0x0;var _0x1909db=_0xb70d[_0x17041a];return _0x1909db;};'use strict';var express=require(_0xdb70('0x0'));var router=express['Router']();var auth=require(_0xdb70('0x1'));var controller=require(_0xdb70('0x2'));router['get']('/',auth[_0xdb70('0x3')](),controller[_0xdb70('0x4')]);router[_0xdb70('0x5')](_0xdb70('0x6'),auth[_0xdb70('0x3')](),controller[_0xdb70('0x7')]);router[_0xdb70('0x5')](_0xdb70('0x8'),auth[_0xdb70('0x3')](),controller[_0xdb70('0x9')]);router[_0xdb70('0x5')](_0xdb70('0xa'),auth['isAuthenticated'](),controller['getTimezones']);router[_0xdb70('0x5')](_0xdb70('0xb'),auth[_0xdb70('0x3')](),controller['show']);router[_0xdb70('0x5')]('/:id/previewrecall',auth[_0xdb70('0x3')](),controller[_0xdb70('0xc')]);router['post']('/',auth[_0xdb70('0x3')](),controller[_0xdb70('0xd')]);router['post'](_0xdb70('0xe'),auth[_0xdb70('0x3')](),controller['getPreview']);router[_0xdb70('0xf')]('/timezone',auth[_0xdb70('0x3')](),controller[_0xdb70('0x10')]);router[_0xdb70('0x11')](_0xdb70('0xb'),auth[_0xdb70('0x3')](),controller[_0xdb70('0x12')]);router['delete']('/:id',auth[_0xdb70('0x3')](),controller[_0xdb70('0x13')]);module[_0xdb70('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index a275322..95c26f4 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 _0x0836=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','INTEGER','DATE','format'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x0836,0x1e1));var _0x6083=function(_0x30e414,_0x4c5a98){_0x30e414=_0x30e414-0x0;var _0x195833=_0x0836[_0x30e414];return _0x195833;};'use strict';var moment=require('moment');var Sequelize=require(_0x6083('0x0'));module[_0x6083('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6083('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x6083('0x3')],'defaultValue':moment()[_0x6083('0x4')](_0x6083('0x5'))},'countbusyretry':{'type':Sequelize[_0x6083('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6083('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6083('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6083('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6083('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7496=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','INTEGER','DATE'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x7496,0x147));var _0x6749=function(_0x308fb6,_0x118356){_0x308fb6=_0x308fb6-0x0;var _0x430f05=_0x7496[_0x308fb6];return _0x430f05;};'use strict';var moment=require('moment');var Sequelize=require(_0x6749('0x0'));module['exports']={'CmHopperId':{'type':Sequelize[_0x6749('0x1')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6749('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x6749('0x2')],'defaultValue':moment()[_0x6749('0x3')](_0x6749('0x4'))},'countbusyretry':{'type':Sequelize[_0x6749('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6749('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6749('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x6749('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6749('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6749('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6749('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6749('0x1')],'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 038046e..069522a 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 _0x756f=['catch','create','user','get','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','CmHopperAdditionalPhones','UserProfileResource','status','sendStatus','stack','name','send','index','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','CmHopperAdditionalPhone','includeAll','include','findAll','show','params','rawAttributes','find'];(function(_0x2a74a6,_0x10592f){var _0xc2e34a=function(_0x8497c9){while(--_0x8497c9){_0x2a74a6['push'](_0x2a74a6['shift']());}};_0xc2e34a(++_0x10592f);}(_0x756f,0x14f));var _0xf756=function(_0x2c7303,_0x1078d0){_0x2c7303=_0x2c7303-0x0;var _0x13e564=_0x756f[_0x2c7303];return _0x13e564;};'use strict';var emlformat=require(_0xf756('0x0'));var rimraf=require(_0xf756('0x1'));var zipdir=require(_0xf756('0x2'));var jsonpatch=require(_0xf756('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf756('0x4'));var Mustache=require(_0xf756('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf756('0x6'));var csv=require(_0xf756('0x7'));var ejs=require(_0xf756('0x8'));var fs=require('fs');var fs_extra=require(_0xf756('0x9'));var _=require(_0xf756('0xa'));var squel=require('squel');var crypto=require(_0xf756('0xb'));var jsforce=require(_0xf756('0xc'));var deskjs=require(_0xf756('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf756('0xe'));var Redis=require(_0xf756('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf756('0x10'));var as=require(_0xf756('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf756('0x12'))(_0xf756('0x13'));var utils=require(_0xf756('0x14'));var config=require(_0xf756('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf756('0x16'))['db'];function respondWithStatusCode(_0x985c7b,_0x57520a){_0x57520a=_0x57520a||0xcc;return function(_0x52572a){if(_0x52572a){return _0x985c7b['sendStatus'](_0x57520a);}return _0x985c7b['status'](_0x57520a)[_0xf756('0x17')]();};}function respondWithResult(_0x7c8ed3,_0xcfa6b0){_0xcfa6b0=_0xcfa6b0||0xc8;return function(_0x127b9b){if(_0x127b9b){return _0x7c8ed3['status'](_0xcfa6b0)[_0xf756('0x18')](_0x127b9b);}};}function respondWithFilteredResult(_0x233631,_0x174a84){return function(_0x21560c){if(_0x21560c){var _0x109550=typeof _0x174a84[_0xf756('0x19')]===_0xf756('0x1a')&&typeof _0x174a84['limit']==='undefined';var _0x2fdec0=_0x21560c[_0xf756('0x1b')];var _0x4e29b9=_0x109550?0x0:_0x174a84[_0xf756('0x19')];var _0x43bdd8=_0x109550?_0x21560c[_0xf756('0x1b')]:_0x174a84[_0xf756('0x19')]+_0x174a84[_0xf756('0x1c')];var _0x5d1a47;if(_0x43bdd8>=_0x2fdec0){_0x43bdd8=_0x2fdec0;_0x5d1a47=0xc8;}else{_0x5d1a47=0xce;}_0x233631['status'](_0x5d1a47);return _0x233631['set'](_0xf756('0x1d'),_0x4e29b9+'-'+_0x43bdd8+'/'+_0x2fdec0)[_0xf756('0x18')](_0x21560c);}return null;};}function patchUpdates(_0x1ea5bd){return function(_0x16679d){try{jsonpatch['apply'](_0x16679d,_0x1ea5bd,!![]);}catch(_0x59b17b){return BPromise[_0xf756('0x1e')](_0x59b17b);}return _0x16679d[_0xf756('0x1f')]();};}function saveUpdates(_0x14ba61,_0x703605){return function(_0x3b1c35){if(_0x3b1c35){return _0x3b1c35['update'](_0x14ba61)[_0xf756('0x20')](function(_0x4a0055){return _0x4a0055;});}return null;};}function removeEntity(_0x7d754e,_0x159ef9){return function(_0x1be4f9){if(_0x1be4f9){return _0x1be4f9[_0xf756('0x21')]()['then'](function(){var _0xd9bfcd=_0x1be4f9['get']({'plain':!![]});var _0x23edbf=_0xf756('0x22');return db[_0xf756('0x23')]['destroy']({'where':{'type':_0x23edbf,'resourceId':_0xd9bfcd['id']}})[_0xf756('0x20')](function(){return _0x1be4f9;});})['then'](function(){_0x7d754e[_0xf756('0x24')](0xcc)[_0xf756('0x17')]();});}};}function handleEntityNotFound(_0x94d546,_0x173ca8){return function(_0x5c392c){if(!_0x5c392c){_0x94d546[_0xf756('0x25')](0x194);}return _0x5c392c;};}function handleError(_0x14ec29,_0x4fd50a){_0x4fd50a=_0x4fd50a||0x1f4;return function(_0x19a4da){logger['error'](_0x19a4da[_0xf756('0x26')]);if(_0x19a4da[_0xf756('0x27')]){delete _0x19a4da['name'];}_0x14ec29[_0xf756('0x24')](_0x4fd50a)[_0xf756('0x28')](_0x19a4da);};}exports[_0xf756('0x29')]=function(_0x53d5fe,_0x122d56){var _0x113969={},_0x14bd0e={},_0x3f8804={'count':0x0,'rows':[]};var _0x1c54b3=_['map'](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x352757){return{'name':_0x352757['fieldName'],'type':_0x352757[_0xf756('0x2a')][_0xf756('0x2b')]};});_0x14bd0e[_0xf756('0x2c')]=_[_0xf756('0x2d')](_0x1c54b3,_0xf756('0x27'));_0x14bd0e[_0xf756('0x2e')]=_[_0xf756('0x2f')](_0x53d5fe['query']);_0x14bd0e[_0xf756('0x30')]=_['intersection'](_0x14bd0e[_0xf756('0x2c')],_0x14bd0e[_0xf756('0x2e')]);_0x113969[_0xf756('0x31')]=_[_0xf756('0x32')](_0x14bd0e[_0xf756('0x2c')],qs[_0xf756('0x33')](_0x53d5fe['query']['fields']));_0x113969['attributes']=_0x113969['attributes'][_0xf756('0x34')]?_0x113969[_0xf756('0x31')]:_0x14bd0e[_0xf756('0x2c')];if(!_0x53d5fe['query'][_0xf756('0x35')](_0xf756('0x36'))){_0x113969['limit']=qs['limit'](_0x53d5fe['query'][_0xf756('0x1c')]);_0x113969['offset']=qs['offset'](_0x53d5fe[_0xf756('0x2e')][_0xf756('0x19')]);}_0x113969[_0xf756('0x37')]=qs[_0xf756('0x38')](_0x53d5fe[_0xf756('0x2e')]['sort']);_0x113969[_0xf756('0x39')]=qs[_0xf756('0x30')](_[_0xf756('0x3a')](_0x53d5fe[_0xf756('0x2e')],_0x14bd0e['filters']),_0x1c54b3);if(_0x53d5fe['query']['filter']){_0x113969[_0xf756('0x39')]=_[_0xf756('0x3b')](_0x113969[_0xf756('0x39')],{'$or':_[_0xf756('0x2d')](_0x1c54b3,function(_0x25ef9e){if(_0x25ef9e[_0xf756('0x2a')]!=='VIRTUAL'){var _0x4883ad={};_0x4883ad[_0x25ef9e[_0xf756('0x27')]]={'$like':'%'+_0x53d5fe['query'][_0xf756('0x3c')]+'%'};return _0x4883ad;}})});}_0x113969=_[_0xf756('0x3b')]({},_0x113969,_0x53d5fe[_0xf756('0x3d')]);var _0x41ae0d={'where':_0x113969[_0xf756('0x39')]};return db[_0xf756('0x3e')][_0xf756('0x1b')](_0x41ae0d)[_0xf756('0x20')](function(_0x450fde){_0x3f8804[_0xf756('0x1b')]=_0x450fde;if(_0x53d5fe[_0xf756('0x2e')][_0xf756('0x3f')]){_0x113969[_0xf756('0x40')]=[{'all':!![]}];}return db[_0xf756('0x3e')][_0xf756('0x41')](_0x113969);})[_0xf756('0x20')](function(_0x3d3f7d){_0x3f8804['rows']=_0x3d3f7d;return _0x3f8804;})['then'](respondWithFilteredResult(_0x122d56,_0x113969))['catch'](handleError(_0x122d56,null));};exports[_0xf756('0x42')]=function(_0x5d2709,_0x5aad95){var _0x48c905={'raw':!![],'where':{'id':_0x5d2709[_0xf756('0x43')]['id']}},_0x4bab46={};_0x4bab46[_0xf756('0x2c')]=_['keys'](db['CmHopperAdditionalPhone'][_0xf756('0x44')]);_0x4bab46[_0xf756('0x2e')]=_[_0xf756('0x2f')](_0x5d2709['query']);_0x4bab46[_0xf756('0x30')]=_[_0xf756('0x32')](_0x4bab46['model'],_0x4bab46[_0xf756('0x2e')]);_0x48c905[_0xf756('0x31')]=_[_0xf756('0x32')](_0x4bab46[_0xf756('0x2c')],qs['fields'](_0x5d2709['query'][_0xf756('0x33')]));_0x48c905['attributes']=_0x48c905[_0xf756('0x31')][_0xf756('0x34')]?_0x48c905['attributes']:_0x4bab46[_0xf756('0x2c')];if(_0x5d2709['query'][_0xf756('0x3f')]){_0x48c905[_0xf756('0x40')]=[{'all':!![]}];}_0x48c905=_['merge']({},_0x48c905,_0x5d2709['options']);return db[_0xf756('0x3e')][_0xf756('0x45')](_0x48c905)[_0xf756('0x20')](handleEntityNotFound(_0x5aad95,null))[_0xf756('0x20')](respondWithResult(_0x5aad95,null))[_0xf756('0x46')](handleError(_0x5aad95,null));};exports[_0xf756('0x47')]=function(_0x4d40bf,_0x251d72){return db[_0xf756('0x3e')]['create'](_0x4d40bf['body'],{})[_0xf756('0x20')](function(_0x385aba){var _0x2f8106=_0x4d40bf[_0xf756('0x48')][_0xf756('0x49')]({'plain':!![]});if(!_0x2f8106)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8106[_0xf756('0x4a')]==='user'){var _0x258af4=_0x385aba[_0xf756('0x49')]({'plain':!![]});var _0x452fb0='CmHopperAdditionalPhones';return db['UserProfileSection']['find']({'where':{'name':_0x452fb0,'userProfileId':_0x2f8106[_0xf756('0x4b')]},'raw':!![]})[_0xf756('0x20')](function(_0x122c76){if(_0x122c76&&_0x122c76[_0xf756('0x4c')]===0x0){return db['UserProfileResource'][_0xf756('0x47')]({'name':_0x258af4[_0xf756('0x27')],'resourceId':_0x258af4['id'],'type':_0x122c76['name'],'sectionId':_0x122c76['id']},{})['then'](function(){return _0x385aba;});}else{return _0x385aba;}})[_0xf756('0x46')](function(_0x37a3f6){logger[_0xf756('0x4d')](_0xf756('0x4e'),_0x37a3f6);throw _0x37a3f6;});}return _0x385aba;})[_0xf756('0x20')](respondWithResult(_0x251d72,0xc9))[_0xf756('0x46')](handleError(_0x251d72,null));};exports[_0xf756('0x4f')]=function(_0x4937f5,_0x200776){if(_0x4937f5[_0xf756('0x50')]['id']){delete _0x4937f5['body']['id'];}return db['CmHopperAdditionalPhone'][_0xf756('0x45')]({'where':{'id':_0x4937f5[_0xf756('0x43')]['id']}})['then'](handleEntityNotFound(_0x200776,null))[_0xf756('0x20')](saveUpdates(_0x4937f5['body'],null))[_0xf756('0x20')](respondWithResult(_0x200776,null))[_0xf756('0x46')](handleError(_0x200776,null));};exports[_0xf756('0x21')]=function(_0x53a736,_0x5c272f){return db[_0xf756('0x3e')]['find']({'where':{'id':_0x53a736['params']['id']}})[_0xf756('0x20')](handleEntityNotFound(_0x5c272f,null))[_0xf756('0x20')](removeEntity(_0x5c272f,null))[_0xf756('0x46')](handleError(_0x5c272f,null));}; \ No newline at end of file +var _0xaa88=['includeAll','include','findAll','catch','params','length','find','body','user','role','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','reject','save','update','then','get','UserProfileResource','destroy','end','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','options'];(function(_0x423549,_0x242e63){var _0xdcb104=function(_0x6bff59){while(--_0x6bff59){_0x423549['push'](_0x423549['shift']());}};_0xdcb104(++_0x242e63);}(_0xaa88,0xb4));var _0x8aa8=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xaa88[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8aa8('0x2'));var moment=require(_0x8aa8('0x3'));var BPromise=require(_0x8aa8('0x4'));var Mustache=require('mustache');var util=require(_0x8aa8('0x5'));var path=require(_0x8aa8('0x6'));var sox=require(_0x8aa8('0x7'));var csv=require(_0x8aa8('0x8'));var ejs=require(_0x8aa8('0x9'));var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require(_0x8aa8('0x8'));var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require('ioredis');var authService=require(_0x8aa8('0x11'));var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8aa8('0x14'));var utils=require(_0x8aa8('0x15'));var config=require(_0x8aa8('0x16'));var licenseUtil=require(_0x8aa8('0x17'));var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0x12610d,_0x403431){_0x403431=_0x403431||0xcc;return function(_0x15b1f2){if(_0x15b1f2){return _0x12610d[_0x8aa8('0x19')](_0x403431);}return _0x12610d[_0x8aa8('0x1a')](_0x403431)['end']();};}function respondWithResult(_0x49ddf8,_0xa6d443){_0xa6d443=_0xa6d443||0xc8;return function(_0x6bce85){if(_0x6bce85){return _0x49ddf8[_0x8aa8('0x1a')](_0xa6d443)[_0x8aa8('0x1b')](_0x6bce85);}};}function respondWithFilteredResult(_0x51eb95,_0x32c611){return function(_0x1c16c9){if(_0x1c16c9){var _0x122d6e=typeof _0x32c611['offset']==='undefined'&&typeof _0x32c611[_0x8aa8('0x1c')]===_0x8aa8('0x1d');var _0x248216=_0x1c16c9[_0x8aa8('0x1e')];var _0x41ca92=_0x122d6e?0x0:_0x32c611[_0x8aa8('0x1f')];var _0x335f12=_0x122d6e?_0x1c16c9[_0x8aa8('0x1e')]:_0x32c611[_0x8aa8('0x1f')]+_0x32c611['limit'];var _0x2321b4;if(_0x335f12>=_0x248216){_0x335f12=_0x248216;_0x2321b4=0xc8;}else{_0x2321b4=0xce;}_0x51eb95[_0x8aa8('0x1a')](_0x2321b4);return _0x51eb95[_0x8aa8('0x20')]('Content-Range',_0x41ca92+'-'+_0x335f12+'/'+_0x248216)[_0x8aa8('0x1b')](_0x1c16c9);}return null;};}function patchUpdates(_0x4e72e8){return function(_0x4613ad){try{jsonpatch['apply'](_0x4613ad,_0x4e72e8,!![]);}catch(_0x5bd866){return BPromise[_0x8aa8('0x21')](_0x5bd866);}return _0x4613ad[_0x8aa8('0x22')]();};}function saveUpdates(_0x482f80,_0x75c4b3){return function(_0xfd45cd){if(_0xfd45cd){return _0xfd45cd[_0x8aa8('0x23')](_0x482f80)[_0x8aa8('0x24')](function(_0x33b333){return _0x33b333;});}return null;};}function removeEntity(_0x29a6b0,_0x48747c){return function(_0x1ac700){if(_0x1ac700){return _0x1ac700['destroy']()[_0x8aa8('0x24')](function(){var _0x27e105=_0x1ac700[_0x8aa8('0x25')]({'plain':!![]});var _0x5baad1='CmHopperAdditionalPhones';return db[_0x8aa8('0x26')][_0x8aa8('0x27')]({'where':{'type':_0x5baad1,'resourceId':_0x27e105['id']}})[_0x8aa8('0x24')](function(){return _0x1ac700;});})[_0x8aa8('0x24')](function(){_0x29a6b0[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x28')]();});}};}function handleEntityNotFound(_0x59291c,_0x62675d){return function(_0x54bb1c){if(!_0x54bb1c){_0x59291c[_0x8aa8('0x19')](0x194);}return _0x54bb1c;};}function handleError(_0x38ea0e,_0x4d587d){_0x4d587d=_0x4d587d||0x1f4;return function(_0x21ae91){logger['error'](_0x21ae91[_0x8aa8('0x29')]);if(_0x21ae91['name']){delete _0x21ae91[_0x8aa8('0x2a')];}_0x38ea0e['status'](_0x4d587d)[_0x8aa8('0x2b')](_0x21ae91);};}exports[_0x8aa8('0x2c')]=function(_0x2d3373,_0x455966){var _0x2cc641={},_0x3bedc9={},_0xe23f74={'count':0x0,'rows':[]};var _0xab24e2=_[_0x8aa8('0x2d')](db[_0x8aa8('0x2e')][_0x8aa8('0x2f')],function(_0x16a0e1){return{'name':_0x16a0e1[_0x8aa8('0x30')],'type':_0x16a0e1['type'][_0x8aa8('0x31')]};});_0x3bedc9[_0x8aa8('0x32')]=_[_0x8aa8('0x2d')](_0xab24e2,'name');_0x3bedc9[_0x8aa8('0x33')]=_[_0x8aa8('0x34')](_0x2d3373['query']);_0x3bedc9[_0x8aa8('0x35')]=_[_0x8aa8('0x36')](_0x3bedc9['model'],_0x3bedc9[_0x8aa8('0x33')]);_0x2cc641[_0x8aa8('0x37')]=_['intersection'](_0x3bedc9[_0x8aa8('0x32')],qs[_0x8aa8('0x38')](_0x2d3373[_0x8aa8('0x33')][_0x8aa8('0x38')]));_0x2cc641[_0x8aa8('0x37')]=_0x2cc641['attributes']['length']?_0x2cc641['attributes']:_0x3bedc9[_0x8aa8('0x32')];if(!_0x2d3373[_0x8aa8('0x33')][_0x8aa8('0x39')]('nolimit')){_0x2cc641[_0x8aa8('0x1c')]=qs[_0x8aa8('0x1c')](_0x2d3373[_0x8aa8('0x33')][_0x8aa8('0x1c')]);_0x2cc641[_0x8aa8('0x1f')]=qs[_0x8aa8('0x1f')](_0x2d3373[_0x8aa8('0x33')][_0x8aa8('0x1f')]);}_0x2cc641[_0x8aa8('0x3a')]=qs[_0x8aa8('0x3b')](_0x2d3373[_0x8aa8('0x33')]['sort']);_0x2cc641[_0x8aa8('0x3c')]=qs[_0x8aa8('0x35')](_[_0x8aa8('0x3d')](_0x2d3373['query'],_0x3bedc9[_0x8aa8('0x35')]),_0xab24e2);if(_0x2d3373['query'][_0x8aa8('0x3e')]){_0x2cc641[_0x8aa8('0x3c')]=_[_0x8aa8('0x3f')](_0x2cc641[_0x8aa8('0x3c')],{'$or':_['map'](_0xab24e2,function(_0x326837){if(_0x326837[_0x8aa8('0x40')]!=='VIRTUAL'){var _0x44b5ec={};_0x44b5ec[_0x326837[_0x8aa8('0x2a')]]={'$like':'%'+_0x2d3373[_0x8aa8('0x33')]['filter']+'%'};return _0x44b5ec;}})});}_0x2cc641=_[_0x8aa8('0x3f')]({},_0x2cc641,_0x2d3373[_0x8aa8('0x41')]);var _0x1013fe={'where':_0x2cc641[_0x8aa8('0x3c')]};return db[_0x8aa8('0x2e')][_0x8aa8('0x1e')](_0x1013fe)['then'](function(_0x6e00ab){_0xe23f74['count']=_0x6e00ab;if(_0x2d3373[_0x8aa8('0x33')][_0x8aa8('0x42')]){_0x2cc641[_0x8aa8('0x43')]=[{'all':!![]}];}return db[_0x8aa8('0x2e')][_0x8aa8('0x44')](_0x2cc641);})[_0x8aa8('0x24')](function(_0x4f2fde){_0xe23f74['rows']=_0x4f2fde;return _0xe23f74;})[_0x8aa8('0x24')](respondWithFilteredResult(_0x455966,_0x2cc641))[_0x8aa8('0x45')](handleError(_0x455966,null));};exports['show']=function(_0x46a17e,_0x41f180){var _0x596268={'raw':!![],'where':{'id':_0x46a17e[_0x8aa8('0x46')]['id']}},_0x33a510={};_0x33a510[_0x8aa8('0x32')]=_['keys'](db[_0x8aa8('0x2e')][_0x8aa8('0x2f')]);_0x33a510['query']=_[_0x8aa8('0x34')](_0x46a17e[_0x8aa8('0x33')]);_0x33a510[_0x8aa8('0x35')]=_[_0x8aa8('0x36')](_0x33a510[_0x8aa8('0x32')],_0x33a510[_0x8aa8('0x33')]);_0x596268[_0x8aa8('0x37')]=_['intersection'](_0x33a510['model'],qs[_0x8aa8('0x38')](_0x46a17e[_0x8aa8('0x33')][_0x8aa8('0x38')]));_0x596268['attributes']=_0x596268['attributes'][_0x8aa8('0x47')]?_0x596268['attributes']:_0x33a510[_0x8aa8('0x32')];if(_0x46a17e[_0x8aa8('0x33')]['includeAll']){_0x596268[_0x8aa8('0x43')]=[{'all':!![]}];}_0x596268=_[_0x8aa8('0x3f')]({},_0x596268,_0x46a17e['options']);return db[_0x8aa8('0x2e')][_0x8aa8('0x48')](_0x596268)['then'](handleEntityNotFound(_0x41f180,null))[_0x8aa8('0x24')](respondWithResult(_0x41f180,null))[_0x8aa8('0x45')](handleError(_0x41f180,null));};exports['create']=function(_0x33c290,_0x362bf6){return db['CmHopperAdditionalPhone']['create'](_0x33c290[_0x8aa8('0x49')],{})[_0x8aa8('0x24')](function(_0x27f9ab){var _0x3d4d1a=_0x33c290[_0x8aa8('0x4a')]['get']({'plain':!![]});if(!_0x3d4d1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d4d1a[_0x8aa8('0x4b')]===_0x8aa8('0x4a')){var _0x603f03=_0x27f9ab[_0x8aa8('0x25')]({'plain':!![]});var _0x5e5fb4=_0x8aa8('0x4c');return db[_0x8aa8('0x4d')]['find']({'where':{'name':_0x5e5fb4,'userProfileId':_0x3d4d1a[_0x8aa8('0x4e')]},'raw':!![]})[_0x8aa8('0x24')](function(_0x1b86b7){if(_0x1b86b7&&_0x1b86b7[_0x8aa8('0x4f')]===0x0){return db[_0x8aa8('0x26')]['create']({'name':_0x603f03[_0x8aa8('0x2a')],'resourceId':_0x603f03['id'],'type':_0x1b86b7['name'],'sectionId':_0x1b86b7['id']},{})[_0x8aa8('0x24')](function(){return _0x27f9ab;});}else{return _0x27f9ab;}})[_0x8aa8('0x45')](function(_0x37c203){logger[_0x8aa8('0x50')](_0x8aa8('0x51'),_0x37c203);throw _0x37c203;});}return _0x27f9ab;})[_0x8aa8('0x24')](respondWithResult(_0x362bf6,0xc9))[_0x8aa8('0x45')](handleError(_0x362bf6,null));};exports[_0x8aa8('0x23')]=function(_0x2aaabf,_0x37e560){if(_0x2aaabf['body']['id']){delete _0x2aaabf[_0x8aa8('0x49')]['id'];}return db[_0x8aa8('0x2e')][_0x8aa8('0x48')]({'where':{'id':_0x2aaabf[_0x8aa8('0x46')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x37e560,null))[_0x8aa8('0x24')](saveUpdates(_0x2aaabf[_0x8aa8('0x49')],null))[_0x8aa8('0x24')](respondWithResult(_0x37e560,null))[_0x8aa8('0x45')](handleError(_0x37e560,null));};exports['destroy']=function(_0x87c4c3,_0x108517){return db[_0x8aa8('0x2e')][_0x8aa8('0x48')]({'where':{'id':_0x87c4c3[_0x8aa8('0x46')]['id']}})['then'](handleEntityNotFound(_0x108517,null))[_0x8aa8('0x24')](removeEntity(_0x108517,null))[_0x8aa8('0x45')](handleError(_0x108517,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index ab50f10..f851540 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 _0xc635=['define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x395723,_0x1553a2){var _0x9b7073=function(_0x3ec8e8){while(--_0x3ec8e8){_0x395723['push'](_0x395723['shift']());}};_0x9b7073(++_0x1553a2);}(_0xc635,0x1b3));var _0x5c63=function(_0x4b1a63,_0x16a0ca){_0x4b1a63=_0x4b1a63-0x0;var _0x5c7412=_0xc635[_0x4b1a63];return _0x5c7412;};'use strict';var _=require(_0x5c63('0x0'));var util=require(_0x5c63('0x1'));var logger=require(_0x5c63('0x2'))(_0x5c63('0x3'));var moment=require(_0x5c63('0x4'));var BPromise=require('bluebird');var rp=require(_0x5c63('0x5'));var fs=require('fs');var path=require(_0x5c63('0x6'));var rimraf=require(_0x5c63('0x7'));var config=require(_0x5c63('0x8'));var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x549ce4,_0x548c56){return _0x549ce4[_0x5c63('0x9')](_0x5c63('0xa'),attributes,{'tableName':_0x5c63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80c9=['request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a7d09,_0x2fcff2){var _0x48a26d=function(_0x36df44){while(--_0x36df44){_0x4a7d09['push'](_0x4a7d09['shift']());}};_0x48a26d(++_0x2fcff2);}(_0x80c9,0xba));var _0x980c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x80c9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x980c('0x0'));var util=require(_0x980c('0x1'));var logger=require(_0x980c('0x2'))(_0x980c('0x3'));var moment=require(_0x980c('0x4'));var BPromise=require(_0x980c('0x5'));var rp=require(_0x980c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x980c('0x7'));var config=require(_0x980c('0x8'));var attributes=require(_0x980c('0x9'));module[_0x980c('0xa')]=function(_0x375480,_0x2982d8){return _0x375480['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0x980c('0xb'),'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 74b4a6f..fae46b3 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 _0xfcb9=['countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','countdropretry','countagentrejectretry','CmHopper','ListId','duration','waitTime','isNil','scheduledat','add','minutes','phone','updatedAt','createdAt','transaction','IncrementPreviewCounters','lodash','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','VerifyAdditionalPhones','findOne','ContactId','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xfcb9,0x188));var _0x9fcb=function(_0x36ea9a,_0x6da0ce){_0x36ea9a=_0x36ea9a-0x0;var _0xda74b3=_0xfcb9[_0x36ea9a];return _0xda74b3;};'use strict';var _=require(_0x9fcb('0x0'));var util=require(_0x9fcb('0x1'));var moment=require('moment');var BPromise=require(_0x9fcb('0x2'));var rs=require(_0x9fcb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9fcb('0x4'))(_0x9fcb('0x5'));var config=require('../../config/environment');var jayson=require(_0x9fcb('0x6'));var client=jayson[_0x9fcb('0x7')][_0x9fcb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe05772,_0x4db54f,_0x5bec97){return new BPromise(function(_0x370d69,_0x43fd3d){return client[_0x9fcb('0x9')](_0xe05772,_0x5bec97)[_0x9fcb('0xa')](function(_0x8e6b68){logger[_0x9fcb('0xb')](_0x9fcb('0xc'),_0x4db54f,'request\x20sent');logger[_0x9fcb('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x4db54f,_0x9fcb('0xe'),JSON[_0x9fcb('0xf')](_0x8e6b68));if(_0x8e6b68['error']){if(_0x8e6b68[_0x9fcb('0x10')][_0x9fcb('0x11')]===0x1f4){logger[_0x9fcb('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4db54f,_0x8e6b68[_0x9fcb('0x10')][_0x9fcb('0x12')]);return _0x43fd3d(_0x8e6b68[_0x9fcb('0x10')]['message']);}logger[_0x9fcb('0x10')](_0x9fcb('0xc'),_0x4db54f,_0x8e6b68[_0x9fcb('0x10')][_0x9fcb('0x12')]);return _0x370d69(_0x8e6b68[_0x9fcb('0x10')][_0x9fcb('0x12')]);}else{logger[_0x9fcb('0xb')](_0x9fcb('0xc'),_0x4db54f,_0x9fcb('0xe'));_0x370d69(_0x8e6b68[_0x9fcb('0x13')][_0x9fcb('0x12')]);}})[_0x9fcb('0x14')](function(_0x366184){logger[_0x9fcb('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4db54f,_0x366184);_0x43fd3d(_0x366184);});});}exports[_0x9fcb('0x15')]=function(_0x569cdd){var _0x140b00=this;return new Promise(function(_0xd9ddbd,_0x4440c0){return db['CmHopper'][_0x9fcb('0x16')]({'raw':!![],'where':{'ContactId':_0x569cdd['body'][_0x9fcb('0x17')],'ListId':_0x569cdd[_0x9fcb('0x18')]['ListId'],'VoiceQueueId':_0x569cdd[_0x9fcb('0x18')][_0x9fcb('0x19')]===undefined?null:_0x569cdd[_0x9fcb('0x18')][_0x9fcb('0x19')],'CampaignId':_0x569cdd[_0x9fcb('0x18')][_0x9fcb('0x1a')]===undefined?null:_0x569cdd['body'][_0x9fcb('0x1a')]}})[_0x9fcb('0xa')](function(_0x282eae){if(_0x282eae!=null){return db[_0x9fcb('0x1b')][_0x9fcb('0x16')]({'raw':!![],'where':{'CmHopperId':_0x282eae['id'],'OrderBy':{'$gt':_0x282eae[_0x9fcb('0x1c')]}},'order':[[_0x9fcb('0x1c'),_0x9fcb('0x1d')]]})['then'](function(_0x34cd82){var _0x14e1b4=0x0;if(_0x34cd82){if(_0x34cd82[_0x9fcb('0x1e')]+_0x34cd82[_0x9fcb('0x1f')]+_0x34cd82[_0x9fcb('0x20')]+_0x34cd82[_0x9fcb('0x21')]+_0x34cd82['countdropretry']+_0x34cd82[_0x9fcb('0x22')]+_0x34cd82[_0x9fcb('0x23')]+_0x34cd82['countagentrejectretry']<_0x569cdd[_0x9fcb('0x24')][_0x9fcb('0x25')])_0x14e1b4=0x1;_0xd9ddbd({'additional':_0x14e1b4});}else{return db[_0x9fcb('0x1b')][_0x9fcb('0x16')]({'raw':!![],'where':{'CmHopperId':_0x282eae['id']},'order':[[_0x9fcb('0x1c'),_0x9fcb('0x1d')]]})[_0x9fcb('0xa')](function(_0x164d61){var _0x272d91=0x0;if(_0x164d61){if(_0x164d61[_0x9fcb('0x1e')]+_0x164d61[_0x9fcb('0x1f')]+_0x164d61[_0x9fcb('0x20')]+_0x164d61[_0x9fcb('0x21')]+_0x164d61[_0x9fcb('0x26')]+_0x164d61[_0x9fcb('0x22')]+_0x164d61[_0x9fcb('0x23')]+_0x164d61[_0x9fcb('0x27')]<_0x569cdd[_0x9fcb('0x24')][_0x9fcb('0x25')])_0x272d91=0x1;_0xd9ddbd({'additional':_0x272d91});}else{_0xd9ddbd({'additional':0x0});}})[_0x9fcb('0x14')](function(_0x5bcc33){logger[_0x9fcb('0x10')](_0x9fcb('0x15'),_0x5bcc33[_0x9fcb('0x12')]);_0x4440c0(_0x140b00[_0x9fcb('0x10')](0x1f4,_0x5bcc33[_0x9fcb('0x12')]));});}})[_0x9fcb('0x14')](function(_0x30ea0d){logger[_0x9fcb('0x10')](_0x9fcb('0x15'),_0x30ea0d[_0x9fcb('0x12')]);_0x4440c0(_0x140b00[_0x9fcb('0x10')](0x1f4,_0x30ea0d['message']));});}else _0xd9ddbd({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x2410d9){var _0x2fc705=this;return new Promise(function(_0x8e2e1f,_0x30a31d){return db[_0x9fcb('0x28')]['findOne']({'raw':!![],'where':{'ContactId':_0x2410d9[_0x9fcb('0x18')][_0x9fcb('0x17')],'ListId':_0x2410d9[_0x9fcb('0x18')][_0x9fcb('0x29')],'VoiceQueueId':_0x2410d9[_0x9fcb('0x18')][_0x9fcb('0x19')]===undefined?null:_0x2410d9['body'][_0x9fcb('0x19')],'CampaignId':_0x2410d9['body']['CampaignId']===undefined?null:_0x2410d9['body'][_0x9fcb('0x1a')]}})['then'](function(_0x1806df){if(_0x1806df!=null){return db[_0x9fcb('0x1b')][_0x9fcb('0x16')]({'raw':!![],'where':{'CmHopperId':_0x1806df['id'],'OrderBy':{'$gte':_0x1806df[_0x9fcb('0x1c')]}},'order':[[_0x9fcb('0x1c'),_0x9fcb('0x1d')]]})[_0x9fcb('0xa')](function(_0x151ed5){if(_0x151ed5)return activateAdditionalPhone(_0x1806df,_0x2410d9['body'],_0x151ed5,_0x2410d9[_0x9fcb('0x2a')],_0x2410d9[_0x9fcb('0x2b')])[_0x9fcb('0xa')](function(_0x248a43){_0x8e2e1f(_0x248a43);});else{return db[_0x9fcb('0x1b')][_0x9fcb('0x16')]({'raw':!![],'where':{'CmHopperId':_0x1806df['id']},'order':[[_0x9fcb('0x1c'),_0x9fcb('0x1d')]]})['then'](function(_0x2f0407){if(_0x2f0407)return activateAdditionalPhone(_0x1806df,_0x2410d9[_0x9fcb('0x18')],_0x2f0407,_0x2410d9['duration'],_0x2410d9[_0x9fcb('0x2b')])[_0x9fcb('0xa')](function(_0x1264a6){_0x8e2e1f(_0x1264a6);});else{_0x8e2e1f({'id':_0x1806df['id'],'phone':''});}})[_0x9fcb('0x14')](function(_0x431076){logger[_0x9fcb('0x10')](_0x9fcb('0x15'),_0x431076[_0x9fcb('0x12')]);_0x30a31d(_0x2fc705['error'](0x1f4,_0x431076[_0x9fcb('0x12')]));});}})['catch'](function(_0x2b169e){logger[_0x9fcb('0x10')](_0x9fcb('0x15'),_0x2b169e[_0x9fcb('0x12')]);_0x30a31d(_0x2fc705[_0x9fcb('0x10')](0x1f4,_0x2b169e[_0x9fcb('0x12')]));});}else _0x8e2e1f(0x1);});});};function activateAdditionalPhone(_0x2f88df,_0x2381de,_0x2862c9,_0x2defe3,_0xc76f4d){return new Promise(function(_0x3d68cd,_0x41a23c){var _0x5f07d4;if(_[_0x9fcb('0x2c')](_0x2862c9[_0x9fcb('0x2d')])){_0x2862c9[_0x9fcb('0x2d')]=moment();}if(moment()>moment(_0x2862c9[_0x9fcb('0x2d')])){_0x5f07d4=moment()[_0x9fcb('0x2e')](_0xc76f4d||0x3,_0x9fcb('0x2f'));}else{if(_0x2862c9[_0x9fcb('0x1c')]==0x0){_0x5f07d4=moment(_0x2862c9[_0x9fcb('0x2d')]);}else{_0x5f07d4=moment()[_0x9fcb('0x2e')](_0xc76f4d||0x3,'minutes');}}if(_['isNil'](_0x5f07d4)){_0x5f07d4=moment()['add'](_0xc76f4d||0x3,_0x9fcb('0x2f'));}var _0x37e0a7={'phone':_0x2f88df[_0x9fcb('0x30')],'active':0x0,'OrderBy':_['isNil'](_0x2f88df[_0x9fcb('0x1c')])?0x0:_0x2f88df['OrderBy'],'scheduledat':moment()['add'](_0x2defe3||0x1,_0x9fcb('0x2f')),'countbusyretry':_0x2381de[_0x9fcb('0x1e')],'countcongestionretry':_0x2381de[_0x9fcb('0x1f')],'countnoanswerretry':_0x2381de[_0x9fcb('0x20')],'countnosuchnumberretry':_0x2381de['countnosuchnumberretry'],'countdropretry':_0x2381de[_0x9fcb('0x26')],'countabandonedretry':_0x2381de[_0x9fcb('0x22')],'countmachineretry':_0x2381de[_0x9fcb('0x23')],'countagentrejectretry':_0x2381de['countagentrejectretry'],'createdAt':_0x2381de['createdAt'],'updatedAt':_0x2381de[_0x9fcb('0x31')]};var _0x11699e={'CmHopperId':_0x2f88df['id'],'phone':_0x2862c9['phone'],'active':0x0,'OrderBy':_[_0x9fcb('0x2c')](_0x2862c9[_0x9fcb('0x1c')])?0x0:_0x2862c9[_0x9fcb('0x1c')],'scheduledat':_0x5f07d4,'countbusyretry':_0x2862c9['countbusyretry'],'countcongestionretry':_0x2862c9[_0x9fcb('0x1f')],'countnoanswerretry':_0x2862c9[_0x9fcb('0x20')],'countnosuchnumberretry':_0x2862c9[_0x9fcb('0x21')],'countdropretry':_0x2862c9['countdropretry'],'countabandonedretry':_0x2862c9[_0x9fcb('0x22')],'countmachineretry':_0x2862c9[_0x9fcb('0x23')],'countagentrejectretry':_0x2862c9[_0x9fcb('0x27')],'createdAt':_0x2862c9[_0x9fcb('0x32')],'updatedAt':_0x2862c9['updatedAt']};return db['sequelize'][_0x9fcb('0x33')](function(_0x12fd6e){return db['CmHopperAdditionalPhone']['update'](_0x37e0a7,{'where':{'id':_0x2862c9['id']}},{'transaction':_0x12fd6e})[_0x9fcb('0xa')](function(){return db[_0x9fcb('0x28')]['update'](_0x11699e,{'where':{'id':_0x2f88df['id']}},{'transaction':_0x12fd6e});});})[_0x9fcb('0xa')](function(_0x39e0f8){_0x3d68cd({'id':_0x2f88df['id'],'phone':_0x2862c9[_0x9fcb('0x30')]});})['catch'](function(_0x462af2){logger[_0x9fcb('0x10')]('activateAdditionalPhone',_0x462af2[_0x9fcb('0x12')]);_0x41a23c({'error':_0x462af2[_0x9fcb('0x12')]});});});}exports['IncrementPreviewCounters']=function(_0x400332){var _0xd15dd9=this;return new Promise(function(_0xd382bc,_0x117fb7){return db['CmHopper']['update'](_0x400332[_0x9fcb('0x18')]['field'],{'where':{'id':_0x400332[_0x9fcb('0x18')]['id']}})[_0x9fcb('0xa')](function(_0x331c07){_0xd382bc(_0x331c07);})[_0x9fcb('0x14')](function(_0x4ad8c2){logger[_0x9fcb('0x10')](_0x9fcb('0x34'),_0x4ad8c2[_0x9fcb('0x12')]);_0x117fb7(_0xd15dd9[_0x9fcb('0x10')](0x1f4,_0x4ad8c2[_0x9fcb('0x12')]));});});}; \ No newline at end of file +var _0x475e=['countagentrejectretry','dialGlobalMaxRetry','countcongestionretry','countnoanswerretry','entity','VerifyAdditionalPhones','SwapAdditionalPhones','CampaignId','duration','waitTime','isNil','scheduledat','add','minutes','phone','countnosuchnumberretry','countdropretry','createdAt','updatedAt','sequelize','transaction','update','field','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperAdditionalPhone,\x20%s,\x20%s','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countabandonedretry','countmachineretry'];(function(_0x106214,_0x454b8d){var _0x5f5cea=function(_0x247841){while(--_0x247841){_0x106214['push'](_0x106214['shift']());}};_0x5f5cea(++_0x454b8d);}(_0x475e,0x1d7));var _0xe475=function(_0x16070e,_0x4f77a6){_0x16070e=_0x16070e-0x0;var _0x27de8e=_0x475e[_0x16070e];return _0x27de8e;};'use strict';var _=require(_0xe475('0x0'));var util=require(_0xe475('0x1'));var moment=require(_0xe475('0x2'));var BPromise=require(_0xe475('0x3'));var rs=require(_0xe475('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe475('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe475('0x6'))(_0xe475('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe475('0x8')][_0xe475('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21fd1a,_0x289a66,_0x627686){return new BPromise(function(_0x526798,_0x41f3e5){return client[_0xe475('0xa')](_0x21fd1a,_0x627686)[_0xe475('0xb')](function(_0x837a3){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x289a66,_0xe475('0xc'));logger[_0xe475('0xd')](_0xe475('0xe'),_0x289a66,'request\x20sent',JSON[_0xe475('0xf')](_0x837a3));if(_0x837a3[_0xe475('0x10')]){if(_0x837a3[_0xe475('0x10')][_0xe475('0x11')]===0x1f4){logger[_0xe475('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x289a66,_0x837a3[_0xe475('0x10')][_0xe475('0x12')]);return _0x41f3e5(_0x837a3['error'][_0xe475('0x12')]);}logger[_0xe475('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x289a66,_0x837a3[_0xe475('0x10')]['message']);return _0x526798(_0x837a3[_0xe475('0x10')][_0xe475('0x12')]);}else{logger['info'](_0xe475('0x13'),_0x289a66,_0xe475('0xc'));_0x526798(_0x837a3['result']['message']);}})[_0xe475('0x14')](function(_0x3c4e73){logger['error'](_0xe475('0x13'),_0x289a66,_0x3c4e73);_0x41f3e5(_0x3c4e73);});});}exports['VerifyAdditionalPhones']=function(_0x4dc553){var _0x25a74f=this;return new Promise(function(_0x4ecca6,_0x5d9c48){return db[_0xe475('0x15')][_0xe475('0x16')]({'raw':!![],'where':{'ContactId':_0x4dc553[_0xe475('0x17')][_0xe475('0x18')],'ListId':_0x4dc553[_0xe475('0x17')][_0xe475('0x19')],'VoiceQueueId':_0x4dc553['body'][_0xe475('0x1a')]===undefined?null:_0x4dc553['body'][_0xe475('0x1a')],'CampaignId':_0x4dc553[_0xe475('0x17')]['CampaignId']===undefined?null:_0x4dc553[_0xe475('0x17')]['CampaignId']}})['then'](function(_0x11f19d){if(_0x11f19d!=null){return db[_0xe475('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x11f19d['id'],'OrderBy':{'$gt':_0x11f19d[_0xe475('0x1c')]}},'order':[[_0xe475('0x1c'),_0xe475('0x1d')]]})[_0xe475('0xb')](function(_0x52b9f5){var _0x2dc197=0x0;if(_0x52b9f5){if(_0x52b9f5[_0xe475('0x1e')]+_0x52b9f5['countcongestionretry']+_0x52b9f5['countnoanswerretry']+_0x52b9f5['countnosuchnumberretry']+_0x52b9f5['countdropretry']+_0x52b9f5[_0xe475('0x1f')]+_0x52b9f5[_0xe475('0x20')]+_0x52b9f5[_0xe475('0x21')]<_0x4dc553['entity'][_0xe475('0x22')])_0x2dc197=0x1;_0x4ecca6({'additional':_0x2dc197});}else{return db['CmHopperAdditionalPhone'][_0xe475('0x16')]({'raw':!![],'where':{'CmHopperId':_0x11f19d['id']},'order':[[_0xe475('0x1c'),_0xe475('0x1d')]]})[_0xe475('0xb')](function(_0x1ef779){var _0x1072af=0x0;if(_0x1ef779){if(_0x1ef779[_0xe475('0x1e')]+_0x1ef779[_0xe475('0x23')]+_0x1ef779[_0xe475('0x24')]+_0x1ef779['countnosuchnumberretry']+_0x1ef779['countdropretry']+_0x1ef779[_0xe475('0x1f')]+_0x1ef779['countmachineretry']+_0x1ef779[_0xe475('0x21')]<_0x4dc553[_0xe475('0x25')][_0xe475('0x22')])_0x1072af=0x1;_0x4ecca6({'additional':_0x1072af});}else{_0x4ecca6({'additional':0x0});}})['catch'](function(_0x525a25){logger['error'](_0xe475('0x26'),_0x525a25[_0xe475('0x12')]);_0x5d9c48(_0x25a74f[_0xe475('0x10')](0x1f4,_0x525a25[_0xe475('0x12')]));});}})['catch'](function(_0x3ef8c5){logger['error']('VerifyAdditionalPhones',_0x3ef8c5['message']);_0x5d9c48(_0x25a74f[_0xe475('0x10')](0x1f4,_0x3ef8c5[_0xe475('0x12')]));});}else _0x4ecca6({'additional':0x0});});});};exports[_0xe475('0x27')]=function(_0x8950f9){var _0x556c7b=this;return new Promise(function(_0x4ba761,_0xbfe40c){return db[_0xe475('0x15')][_0xe475('0x16')]({'raw':!![],'where':{'ContactId':_0x8950f9[_0xe475('0x17')][_0xe475('0x18')],'ListId':_0x8950f9['body']['ListId'],'VoiceQueueId':_0x8950f9[_0xe475('0x17')][_0xe475('0x1a')]===undefined?null:_0x8950f9['body']['VoiceQueueId'],'CampaignId':_0x8950f9['body'][_0xe475('0x28')]===undefined?null:_0x8950f9[_0xe475('0x17')]['CampaignId']}})['then'](function(_0x5b5f62){if(_0x5b5f62!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x5b5f62['id'],'OrderBy':{'$gte':_0x5b5f62[_0xe475('0x1c')]}},'order':[[_0xe475('0x1c'),'ASC']]})[_0xe475('0xb')](function(_0x58c70d){if(_0x58c70d)return activateAdditionalPhone(_0x5b5f62,_0x8950f9[_0xe475('0x17')],_0x58c70d,_0x8950f9[_0xe475('0x29')],_0x8950f9['waitTime'])[_0xe475('0xb')](function(_0x34c537){_0x4ba761(_0x34c537);});else{return db[_0xe475('0x1b')][_0xe475('0x16')]({'raw':!![],'where':{'CmHopperId':_0x5b5f62['id']},'order':[[_0xe475('0x1c'),_0xe475('0x1d')]]})[_0xe475('0xb')](function(_0x3ad034){if(_0x3ad034)return activateAdditionalPhone(_0x5b5f62,_0x8950f9['body'],_0x3ad034,_0x8950f9[_0xe475('0x29')],_0x8950f9[_0xe475('0x2a')])['then'](function(_0x5cd700){_0x4ba761(_0x5cd700);});else{_0x4ba761({'id':_0x5b5f62['id'],'phone':''});}})[_0xe475('0x14')](function(_0x212855){logger[_0xe475('0x10')](_0xe475('0x26'),_0x212855['message']);_0xbfe40c(_0x556c7b[_0xe475('0x10')](0x1f4,_0x212855[_0xe475('0x12')]));});}})[_0xe475('0x14')](function(_0x20de8d){logger[_0xe475('0x10')](_0xe475('0x26'),_0x20de8d['message']);_0xbfe40c(_0x556c7b[_0xe475('0x10')](0x1f4,_0x20de8d[_0xe475('0x12')]));});}else _0x4ba761(0x1);});});};function activateAdditionalPhone(_0x272042,_0x23800e,_0x46f340,_0x59505b,_0xb96146){return new Promise(function(_0x3b9564,_0xf52765){var _0x2709f6;if(_[_0xe475('0x2b')](_0x46f340[_0xe475('0x2c')])){_0x46f340[_0xe475('0x2c')]=moment();}if(moment()>moment(_0x46f340[_0xe475('0x2c')])){_0x2709f6=moment()[_0xe475('0x2d')](_0xb96146||0x3,_0xe475('0x2e'));}else{if(_0x46f340['OrderBy']==0x0){_0x2709f6=moment(_0x46f340['scheduledat']);}else{_0x2709f6=moment()[_0xe475('0x2d')](_0xb96146||0x3,_0xe475('0x2e'));}}if(_[_0xe475('0x2b')](_0x2709f6)){_0x2709f6=moment()['add'](_0xb96146||0x3,_0xe475('0x2e'));}var _0x12180f={'phone':_0x272042[_0xe475('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x272042[_0xe475('0x1c')])?0x0:_0x272042['OrderBy'],'scheduledat':moment()[_0xe475('0x2d')](_0x59505b||0x1,_0xe475('0x2e')),'countbusyretry':_0x23800e[_0xe475('0x1e')],'countcongestionretry':_0x23800e[_0xe475('0x23')],'countnoanswerretry':_0x23800e[_0xe475('0x24')],'countnosuchnumberretry':_0x23800e[_0xe475('0x30')],'countdropretry':_0x23800e[_0xe475('0x31')],'countabandonedretry':_0x23800e[_0xe475('0x1f')],'countmachineretry':_0x23800e[_0xe475('0x20')],'countagentrejectretry':_0x23800e['countagentrejectretry'],'createdAt':_0x23800e[_0xe475('0x32')],'updatedAt':_0x23800e[_0xe475('0x33')]};var _0x5f4ee1={'CmHopperId':_0x272042['id'],'phone':_0x46f340[_0xe475('0x2f')],'active':0x0,'OrderBy':_[_0xe475('0x2b')](_0x46f340['OrderBy'])?0x0:_0x46f340[_0xe475('0x1c')],'scheduledat':_0x2709f6,'countbusyretry':_0x46f340[_0xe475('0x1e')],'countcongestionretry':_0x46f340[_0xe475('0x23')],'countnoanswerretry':_0x46f340[_0xe475('0x24')],'countnosuchnumberretry':_0x46f340[_0xe475('0x30')],'countdropretry':_0x46f340[_0xe475('0x31')],'countabandonedretry':_0x46f340[_0xe475('0x1f')],'countmachineretry':_0x46f340[_0xe475('0x20')],'countagentrejectretry':_0x46f340[_0xe475('0x21')],'createdAt':_0x46f340[_0xe475('0x32')],'updatedAt':_0x46f340[_0xe475('0x33')]};return db[_0xe475('0x34')][_0xe475('0x35')](function(_0x10e354){return db[_0xe475('0x1b')][_0xe475('0x36')](_0x12180f,{'where':{'id':_0x46f340['id']}},{'transaction':_0x10e354})[_0xe475('0xb')](function(){return db['CmHopper'][_0xe475('0x36')](_0x5f4ee1,{'where':{'id':_0x272042['id']}},{'transaction':_0x10e354});});})[_0xe475('0xb')](function(_0x5d8fb2){_0x3b9564({'id':_0x272042['id'],'phone':_0x46f340[_0xe475('0x2f')]});})[_0xe475('0x14')](function(_0x5cd0d1){logger[_0xe475('0x10')]('activateAdditionalPhone',_0x5cd0d1[_0xe475('0x12')]);_0xf52765({'error':_0x5cd0d1[_0xe475('0x12')]});});});}exports['IncrementPreviewCounters']=function(_0x21fc06){var _0x5bff1e=this;return new Promise(function(_0x4f3c07,_0x209b70){return db['CmHopper'][_0xe475('0x36')](_0x21fc06[_0xe475('0x17')][_0xe475('0x37')],{'where':{'id':_0x21fc06[_0xe475('0x17')]['id']}})[_0xe475('0xb')](function(_0x5a79a0){_0x4f3c07(_0x5a79a0);})[_0xe475('0x14')](function(_0x5ee739){logger[_0xe475('0x10')]('IncrementPreviewCounters',_0x5ee739[_0xe475('0x12')]);_0x209b70(_0x5bff1e[_0xe475('0x10')](0x1f4,_0x5ee739[_0xe475('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 83bb9d4..42f55be 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 _0x93e6=['multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','delete'];(function(_0x483b02,_0xdae220){var _0x32bac7=function(_0x8b1818){while(--_0x8b1818){_0x483b02['push'](_0x483b02['shift']());}};_0x32bac7(++_0xdae220);}(_0x93e6,0x11e));var _0x693e=function(_0x207106,_0x4dcac4){_0x207106=_0x207106-0x0;var _0x50b6e3=_0x93e6[_0x207106];return _0x50b6e3;};'use strict';var multer=require(_0x693e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x693e('0x1'));var express=require('express');var router=express[_0x693e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x693e('0x3'));var interaction=require(_0x693e('0x4'));var config=require(_0x693e('0x5'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x693e('0x6')]('/',auth[_0x693e('0x7')](),controller[_0x693e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x693e('0x9')]);router['post']('/',auth[_0x693e('0x7')](),controller[_0x693e('0xa')]);router[_0x693e('0xb')]('/:id',auth[_0x693e('0x7')](),controller['update']);router[_0x693e('0xc')]('/:id',auth[_0x693e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xef91=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xef91,0x1a1));var _0x1ef9=function(_0x4507be,_0x12721b){_0x4507be=_0x4507be-0x0;var _0x545f80=_0xef91[_0x4507be];return _0x545f80;};'use strict';var multer=require(_0x1ef9('0x0'));var util=require(_0x1ef9('0x1'));var path=require(_0x1ef9('0x2'));var timeout=require(_0x1ef9('0x3'));var express=require(_0x1ef9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1ef9('0x5'));var interaction=require(_0x1ef9('0x6'));var config=require(_0x1ef9('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x1ef9('0x8')]('/',auth['isAuthenticated'](),controller[_0x1ef9('0x9')]);router[_0x1ef9('0x8')](_0x1ef9('0xa'),auth[_0x1ef9('0xb')](),controller[_0x1ef9('0xc')]);router[_0x1ef9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1ef9('0xe')](_0x1ef9('0xa'),auth[_0x1ef9('0xb')](),controller[_0x1ef9('0xf')]);router[_0x1ef9('0x10')](_0x1ef9('0xa'),auth[_0x1ef9('0xb')](),controller[_0x1ef9('0x11')]);module[_0x1ef9('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 87d029c..616a9a8 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 _0x9388=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x55f94a,_0x320f6d){var _0x5c67d9=function(_0x1ffdea){while(--_0x1ffdea){_0x55f94a['push'](_0x55f94a['shift']());}};_0x5c67d9(++_0x320f6d);}(_0x9388,0x13f));var _0x8938=function(_0x271ad6,_0x36acdf){_0x271ad6=_0x271ad6-0x0;var _0x47ba79=_0x9388[_0x271ad6];return _0x47ba79;};'use strict';var moment=require(_0x8938('0x0'));var Sequelize=require(_0x8938('0x1'));module[_0x8938('0x2')]={'phone':{'type':Sequelize[_0x8938('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8938('0x4')],'unique':_0x8938('0x5')},'ListId':{'type':Sequelize[_0x8938('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x8938('0x4')],'unique':_0x8938('0x5')}}; \ No newline at end of file +var _0x5581=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5581,0x115));var _0x1558=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x5581[_0x5cb1af];return _0x8d7940;};'use strict';var moment=require(_0x1558('0x0'));var Sequelize=require('sequelize');module[_0x1558('0x1')]={'phone':{'type':Sequelize[_0x1558('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1558('0x3')],'unique':_0x1558('0x4')},'ListId':{'type':Sequelize[_0x1558('0x3')],'unique':_0x1558('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x1558('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 91c9d1b..52d002f 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 _0x060a=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','sendStatus','error','stack','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','name','keys','query','attributes','fields','length','nolimit','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x43b6f6,_0x3ceab7){var _0x5512f=function(_0x17addb){while(--_0x17addb){_0x43b6f6['push'](_0x43b6f6['shift']());}};_0x5512f(++_0x3ceab7);}(_0x060a,0x192));var _0xa060=function(_0x10bf0f,_0x16b9d5){_0x10bf0f=_0x10bf0f-0x0;var _0x59cd89=_0x060a[_0x10bf0f];return _0x59cd89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa060('0x0'));var zipdir=require(_0xa060('0x1'));var jsonpatch=require(_0xa060('0x2'));var rp=require(_0xa060('0x3'));var moment=require('moment');var BPromise=require(_0xa060('0x4'));var Mustache=require('mustache');var util=require(_0xa060('0x5'));var path=require(_0xa060('0x6'));var sox=require('sox');var csv=require(_0xa060('0x7'));var ejs=require(_0xa060('0x8'));var fs=require('fs');var fs_extra=require(_0xa060('0x9'));var _=require(_0xa060('0xa'));var squel=require('squel');var crypto=require(_0xa060('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa060('0x7'));var querystring=require('querystring');var Papa=require(_0xa060('0xc'));var Redis=require(_0xa060('0xd'));var authService=require(_0xa060('0xe'));var qs=require(_0xa060('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa060('0x10'));var logger=require('../../config/logger')(_0xa060('0x11'));var utils=require(_0xa060('0x12'));var config=require(_0xa060('0x13'));var licenseUtil=require(_0xa060('0x14'));var db=require(_0xa060('0x15'))['db'];function respondWithStatusCode(_0x58e682,_0x39a2a9){_0x39a2a9=_0x39a2a9||0xcc;return function(_0x1e5c0b){if(_0x1e5c0b){return _0x58e682['sendStatus'](_0x39a2a9);}return _0x58e682[_0xa060('0x16')](_0x39a2a9)[_0xa060('0x17')]();};}function respondWithResult(_0x17f253,_0x9599b7){_0x9599b7=_0x9599b7||0xc8;return function(_0x2a04f5){if(_0x2a04f5){return _0x17f253[_0xa060('0x16')](_0x9599b7)[_0xa060('0x18')](_0x2a04f5);}};}function respondWithFilteredResult(_0x33d58b,_0x309153){return function(_0x2b4747){if(_0x2b4747){var _0x1f7655=typeof _0x309153[_0xa060('0x19')]===_0xa060('0x1a')&&typeof _0x309153[_0xa060('0x1b')]==='undefined';var _0x5c9f70=_0x2b4747[_0xa060('0x1c')];var _0x238491=_0x1f7655?0x0:_0x309153[_0xa060('0x19')];var _0x19465a=_0x1f7655?_0x2b4747['count']:_0x309153[_0xa060('0x19')]+_0x309153[_0xa060('0x1b')];var _0x1041da;if(_0x19465a>=_0x5c9f70){_0x19465a=_0x5c9f70;_0x1041da=0xc8;}else{_0x1041da=0xce;}_0x33d58b['status'](_0x1041da);return _0x33d58b['set'](_0xa060('0x1d'),_0x238491+'-'+_0x19465a+'/'+_0x5c9f70)[_0xa060('0x18')](_0x2b4747);}return null;};}function patchUpdates(_0x4e0b36){return function(_0x41e29c){try{jsonpatch['apply'](_0x41e29c,_0x4e0b36,!![]);}catch(_0x248f50){return BPromise[_0xa060('0x1e')](_0x248f50);}return _0x41e29c['save']();};}function saveUpdates(_0x1c5038,_0x58a2a0){return function(_0x544481){if(_0x544481){return _0x544481[_0xa060('0x1f')](_0x1c5038)[_0xa060('0x20')](function(_0x47a6f1){return _0x47a6f1;});}return null;};}function removeEntity(_0x2f21b3,_0x247dad){return function(_0x36dc11){if(_0x36dc11){return _0x36dc11[_0xa060('0x21')]()[_0xa060('0x20')](function(){_0x2f21b3[_0xa060('0x16')](0xcc)[_0xa060('0x17')]();});}};}function handleEntityNotFound(_0x2b7249,_0x2b702f){return function(_0x3d0305){if(!_0x3d0305){_0x2b7249[_0xa060('0x22')](0x194);}return _0x3d0305;};}function handleError(_0x531b16,_0xeaa5af){_0xeaa5af=_0xeaa5af||0x1f4;return function(_0xc2bdbd){logger[_0xa060('0x23')](_0xc2bdbd[_0xa060('0x24')]);if(_0xc2bdbd['name']){delete _0xc2bdbd['name'];}_0x531b16[_0xa060('0x16')](_0xeaa5af)[_0xa060('0x25')](_0xc2bdbd);};}exports[_0xa060('0x26')]=function(_0x5a407b,_0x55b403){var _0xa7a08a={},_0x528231={},_0x5519df={'count':0x0,'rows':[]};var _0x5e69cf=_[_0xa060('0x27')](db[_0xa060('0x28')][_0xa060('0x29')],function(_0x4a657d){return{'name':_0x4a657d[_0xa060('0x2a')],'type':_0x4a657d[_0xa060('0x2b')][_0xa060('0x2c')]};});_0x528231[_0xa060('0x2d')]=_[_0xa060('0x27')](_0x5e69cf,_0xa060('0x2e'));_0x528231['query']=_[_0xa060('0x2f')](_0x5a407b[_0xa060('0x30')]);_0x528231['filters']=_['intersection'](_0x528231[_0xa060('0x2d')],_0x528231[_0xa060('0x30')]);_0xa7a08a[_0xa060('0x31')]=_['intersection'](_0x528231[_0xa060('0x2d')],qs[_0xa060('0x32')](_0x5a407b[_0xa060('0x30')][_0xa060('0x32')]));_0xa7a08a[_0xa060('0x31')]=_0xa7a08a[_0xa060('0x31')][_0xa060('0x33')]?_0xa7a08a['attributes']:_0x528231[_0xa060('0x2d')];if(!_0x5a407b[_0xa060('0x30')]['hasOwnProperty'](_0xa060('0x34'))){_0xa7a08a[_0xa060('0x1b')]=qs[_0xa060('0x1b')](_0x5a407b[_0xa060('0x30')][_0xa060('0x1b')]);_0xa7a08a['offset']=qs[_0xa060('0x19')](_0x5a407b[_0xa060('0x30')]['offset']);}_0xa7a08a['order']=qs['sort'](_0x5a407b[_0xa060('0x30')]['sort']);_0xa7a08a[_0xa060('0x35')]=qs[_0xa060('0x36')](_['pick'](_0x5a407b[_0xa060('0x30')],_0x528231[_0xa060('0x36')]),_0x5e69cf);if(_0x5a407b[_0xa060('0x30')][_0xa060('0x37')]){_0xa7a08a['where']=_[_0xa060('0x38')](_0xa7a08a[_0xa060('0x35')],{'$or':_['map'](_0x5e69cf,function(_0xaa555c){if(_0xaa555c[_0xa060('0x2b')]!==_0xa060('0x39')){var _0x9e9d74={};_0x9e9d74[_0xaa555c[_0xa060('0x2e')]]={'$like':'%'+_0x5a407b[_0xa060('0x30')][_0xa060('0x37')]+'%'};return _0x9e9d74;}})});}_0xa7a08a=_['merge']({},_0xa7a08a,_0x5a407b[_0xa060('0x3a')]);var _0x280c8c={'where':_0xa7a08a[_0xa060('0x35')]};return db['CmHopperBlack'][_0xa060('0x1c')](_0x280c8c)[_0xa060('0x20')](function(_0x4cb28c){_0x5519df['count']=_0x4cb28c;if(_0x5a407b[_0xa060('0x30')]['includeAll']){_0xa7a08a[_0xa060('0x3b')]=[{'all':!![]}];}return db[_0xa060('0x28')][_0xa060('0x3c')](_0xa7a08a);})[_0xa060('0x20')](function(_0x1cbe22){_0x5519df[_0xa060('0x3d')]=_0x1cbe22;return _0x5519df;})[_0xa060('0x20')](respondWithFilteredResult(_0x55b403,_0xa7a08a))[_0xa060('0x3e')](handleError(_0x55b403,null));};exports[_0xa060('0x3f')]=function(_0x3fafa4,_0x20afc1){var _0x46f0b7={'raw':!![],'where':{'id':_0x3fafa4[_0xa060('0x40')]['id']}},_0x2ae28c={};_0x2ae28c[_0xa060('0x2d')]=_[_0xa060('0x2f')](db[_0xa060('0x28')]['rawAttributes']);_0x2ae28c['query']=_['keys'](_0x3fafa4[_0xa060('0x30')]);_0x2ae28c[_0xa060('0x36')]=_[_0xa060('0x41')](_0x2ae28c[_0xa060('0x2d')],_0x2ae28c[_0xa060('0x30')]);_0x46f0b7[_0xa060('0x31')]=_[_0xa060('0x41')](_0x2ae28c['model'],qs[_0xa060('0x32')](_0x3fafa4['query'][_0xa060('0x32')]));_0x46f0b7[_0xa060('0x31')]=_0x46f0b7['attributes'][_0xa060('0x33')]?_0x46f0b7[_0xa060('0x31')]:_0x2ae28c[_0xa060('0x2d')];if(_0x3fafa4[_0xa060('0x30')][_0xa060('0x42')]){_0x46f0b7['include']=[{'all':!![]}];}_0x46f0b7=_[_0xa060('0x38')]({},_0x46f0b7,_0x3fafa4[_0xa060('0x3a')]);return db[_0xa060('0x28')][_0xa060('0x43')](_0x46f0b7)[_0xa060('0x20')](handleEntityNotFound(_0x20afc1,null))[_0xa060('0x20')](respondWithResult(_0x20afc1,null))[_0xa060('0x3e')](handleError(_0x20afc1,null));};exports[_0xa060('0x1f')]=function(_0x351890,_0x5d79cd){if(_0x351890[_0xa060('0x44')]['id']){delete _0x351890['body']['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x351890[_0xa060('0x40')]['id']}})['then'](handleEntityNotFound(_0x5d79cd,null))[_0xa060('0x20')](saveUpdates(_0x351890[_0xa060('0x44')],null))[_0xa060('0x20')](respondWithResult(_0x5d79cd,null))[_0xa060('0x3e')](handleError(_0x5d79cd,null));};exports['destroy']=function(_0x2311c6,_0x47785c){return db[_0xa060('0x28')]['find']({'where':{'id':_0x2311c6[_0xa060('0x40')]['id']}})[_0xa060('0x20')](handleEntityNotFound(_0x47785c,null))[_0xa060('0x20')](removeEntity(_0x47785c,null))['catch'](handleError(_0x47785c,null));};exports[_0xa060('0x45')]=function(_0x2fa3e2,_0x52f75a){return db[_0xa060('0x28')]['describe']()[_0xa060('0x20')](respondWithResult(_0x52f75a,null))[_0xa060('0x3e')](handleError(_0x52f75a,null));}; \ No newline at end of file +var _0x444e=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','CmHopperBlack','include','rows','catch','rawAttributes','includeAll','options','find','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x444e,0xd4));var _0xe444=function(_0x5401bf,_0xdbd697){_0x5401bf=_0x5401bf-0x0;var _0x5305dc=_0x444e[_0x5401bf];return _0x5305dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe444('0x0'));var zipdir=require(_0xe444('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe444('0x2'));var moment=require(_0xe444('0x3'));var BPromise=require(_0xe444('0x4'));var Mustache=require(_0xe444('0x5'));var util=require(_0xe444('0x6'));var path=require(_0xe444('0x7'));var sox=require(_0xe444('0x8'));var csv=require(_0xe444('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe444('0xa'));var _=require(_0xe444('0xb'));var squel=require(_0xe444('0xc'));var crypto=require(_0xe444('0xd'));var jsforce=require(_0xe444('0xe'));var deskjs=require(_0xe444('0xf'));var toCsv=require(_0xe444('0x9'));var querystring=require('querystring');var Papa=require(_0xe444('0x10'));var Redis=require(_0xe444('0x11'));var authService=require(_0xe444('0x12'));var qs=require(_0xe444('0x13'));var as=require(_0xe444('0x14'));var hardwareService=require(_0xe444('0x15'));var logger=require('../../config/logger')(_0xe444('0x16'));var utils=require('../../config/utils');var config=require(_0xe444('0x17'));var licenseUtil=require(_0xe444('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d8a00,_0x544a39){_0x544a39=_0x544a39||0xcc;return function(_0xb5bd72){if(_0xb5bd72){return _0x4d8a00[_0xe444('0x19')](_0x544a39);}return _0x4d8a00[_0xe444('0x1a')](_0x544a39)[_0xe444('0x1b')]();};}function respondWithResult(_0x213a3a,_0x5a6e51){_0x5a6e51=_0x5a6e51||0xc8;return function(_0x47cbfb){if(_0x47cbfb){return _0x213a3a[_0xe444('0x1a')](_0x5a6e51)[_0xe444('0x1c')](_0x47cbfb);}};}function respondWithFilteredResult(_0x1242cc,_0xf790fb){return function(_0x4b0a8f){if(_0x4b0a8f){var _0xd65e1b=typeof _0xf790fb['offset']===_0xe444('0x1d')&&typeof _0xf790fb[_0xe444('0x1e')]===_0xe444('0x1d');var _0x124ea9=_0x4b0a8f[_0xe444('0x1f')];var _0x36b9a2=_0xd65e1b?0x0:_0xf790fb[_0xe444('0x20')];var _0x3b8c25=_0xd65e1b?_0x4b0a8f[_0xe444('0x1f')]:_0xf790fb[_0xe444('0x20')]+_0xf790fb[_0xe444('0x1e')];var _0x5b788d;if(_0x3b8c25>=_0x124ea9){_0x3b8c25=_0x124ea9;_0x5b788d=0xc8;}else{_0x5b788d=0xce;}_0x1242cc['status'](_0x5b788d);return _0x1242cc[_0xe444('0x21')](_0xe444('0x22'),_0x36b9a2+'-'+_0x3b8c25+'/'+_0x124ea9)['json'](_0x4b0a8f);}return null;};}function patchUpdates(_0x1022b6){return function(_0x49daeb){try{jsonpatch[_0xe444('0x23')](_0x49daeb,_0x1022b6,!![]);}catch(_0x308ac2){return BPromise['reject'](_0x308ac2);}return _0x49daeb[_0xe444('0x24')]();};}function saveUpdates(_0x3908d8,_0x4a86f8){return function(_0x24ad66){if(_0x24ad66){return _0x24ad66[_0xe444('0x25')](_0x3908d8)[_0xe444('0x26')](function(_0x4b920a){return _0x4b920a;});}return null;};}function removeEntity(_0xdf75bb,_0x4f152e){return function(_0xc4d0ac){if(_0xc4d0ac){return _0xc4d0ac['destroy']()[_0xe444('0x26')](function(){_0xdf75bb[_0xe444('0x1a')](0xcc)[_0xe444('0x1b')]();});}};}function handleEntityNotFound(_0x1df5f7,_0xdc84a8){return function(_0x4f2974){if(!_0x4f2974){_0x1df5f7['sendStatus'](0x194);}return _0x4f2974;};}function handleError(_0x2cf74b,_0x3c5359){_0x3c5359=_0x3c5359||0x1f4;return function(_0x514973){logger['error'](_0x514973[_0xe444('0x27')]);if(_0x514973[_0xe444('0x28')]){delete _0x514973[_0xe444('0x28')];}_0x2cf74b[_0xe444('0x1a')](_0x3c5359)[_0xe444('0x29')](_0x514973);};}exports[_0xe444('0x2a')]=function(_0x384933,_0x182849){var _0x3699fa={},_0x44a91a={},_0x2df4b6={'count':0x0,'rows':[]};var _0x79796f=_[_0xe444('0x2b')](db['CmHopperBlack']['rawAttributes'],function(_0x14aa5f){return{'name':_0x14aa5f[_0xe444('0x2c')],'type':_0x14aa5f[_0xe444('0x2d')][_0xe444('0x2e')]};});_0x44a91a[_0xe444('0x2f')]=_['map'](_0x79796f,'name');_0x44a91a[_0xe444('0x30')]=_[_0xe444('0x31')](_0x384933[_0xe444('0x30')]);_0x44a91a[_0xe444('0x32')]=_[_0xe444('0x33')](_0x44a91a[_0xe444('0x2f')],_0x44a91a[_0xe444('0x30')]);_0x3699fa[_0xe444('0x34')]=_[_0xe444('0x33')](_0x44a91a[_0xe444('0x2f')],qs['fields'](_0x384933[_0xe444('0x30')][_0xe444('0x35')]));_0x3699fa[_0xe444('0x34')]=_0x3699fa[_0xe444('0x34')][_0xe444('0x36')]?_0x3699fa['attributes']:_0x44a91a[_0xe444('0x2f')];if(!_0x384933['query'][_0xe444('0x37')](_0xe444('0x38'))){_0x3699fa[_0xe444('0x1e')]=qs[_0xe444('0x1e')](_0x384933['query'][_0xe444('0x1e')]);_0x3699fa[_0xe444('0x20')]=qs[_0xe444('0x20')](_0x384933[_0xe444('0x30')][_0xe444('0x20')]);}_0x3699fa[_0xe444('0x39')]=qs[_0xe444('0x3a')](_0x384933[_0xe444('0x30')][_0xe444('0x3a')]);_0x3699fa['where']=qs[_0xe444('0x32')](_['pick'](_0x384933['query'],_0x44a91a['filters']),_0x79796f);if(_0x384933['query'][_0xe444('0x3b')]){_0x3699fa[_0xe444('0x3c')]=_[_0xe444('0x3d')](_0x3699fa[_0xe444('0x3c')],{'$or':_['map'](_0x79796f,function(_0x4b1f29){if(_0x4b1f29[_0xe444('0x2d')]!=='VIRTUAL'){var _0x4c02d1={};_0x4c02d1[_0x4b1f29[_0xe444('0x28')]]={'$like':'%'+_0x384933[_0xe444('0x30')][_0xe444('0x3b')]+'%'};return _0x4c02d1;}})});}_0x3699fa=_[_0xe444('0x3d')]({},_0x3699fa,_0x384933['options']);var _0x419343={'where':_0x3699fa['where']};return db[_0xe444('0x3e')][_0xe444('0x1f')](_0x419343)[_0xe444('0x26')](function(_0x519f3e){_0x2df4b6[_0xe444('0x1f')]=_0x519f3e;if(_0x384933['query']['includeAll']){_0x3699fa[_0xe444('0x3f')]=[{'all':!![]}];}return db[_0xe444('0x3e')]['findAll'](_0x3699fa);})[_0xe444('0x26')](function(_0x315d73){_0x2df4b6[_0xe444('0x40')]=_0x315d73;return _0x2df4b6;})[_0xe444('0x26')](respondWithFilteredResult(_0x182849,_0x3699fa))[_0xe444('0x41')](handleError(_0x182849,null));};exports['show']=function(_0x5ae9fe,_0x569c41){var _0x2daa31={'raw':!![],'where':{'id':_0x5ae9fe['params']['id']}},_0x43bf11={};_0x43bf11[_0xe444('0x2f')]=_['keys'](db[_0xe444('0x3e')][_0xe444('0x42')]);_0x43bf11[_0xe444('0x30')]=_[_0xe444('0x31')](_0x5ae9fe['query']);_0x43bf11['filters']=_['intersection'](_0x43bf11[_0xe444('0x2f')],_0x43bf11['query']);_0x2daa31[_0xe444('0x34')]=_[_0xe444('0x33')](_0x43bf11[_0xe444('0x2f')],qs[_0xe444('0x35')](_0x5ae9fe[_0xe444('0x30')][_0xe444('0x35')]));_0x2daa31['attributes']=_0x2daa31[_0xe444('0x34')]['length']?_0x2daa31[_0xe444('0x34')]:_0x43bf11['model'];if(_0x5ae9fe[_0xe444('0x30')][_0xe444('0x43')]){_0x2daa31[_0xe444('0x3f')]=[{'all':!![]}];}_0x2daa31=_['merge']({},_0x2daa31,_0x5ae9fe[_0xe444('0x44')]);return db[_0xe444('0x3e')][_0xe444('0x45')](_0x2daa31)['then'](handleEntityNotFound(_0x569c41,null))[_0xe444('0x26')](respondWithResult(_0x569c41,null))[_0xe444('0x41')](handleError(_0x569c41,null));};exports['update']=function(_0x2790b7,_0x5de390){if(_0x2790b7[_0xe444('0x46')]['id']){delete _0x2790b7['body']['id'];}return db['CmHopperBlack'][_0xe444('0x45')]({'where':{'id':_0x2790b7['params']['id']}})[_0xe444('0x26')](handleEntityNotFound(_0x5de390,null))[_0xe444('0x26')](saveUpdates(_0x2790b7[_0xe444('0x46')],null))['then'](respondWithResult(_0x5de390,null))['catch'](handleError(_0x5de390,null));};exports[_0xe444('0x47')]=function(_0x1e9506,_0x542166){return db['CmHopperBlack'][_0xe444('0x45')]({'where':{'id':_0x1e9506['params']['id']}})[_0xe444('0x26')](handleEntityNotFound(_0x542166,null))[_0xe444('0x26')](removeEntity(_0x542166,null))['catch'](handleError(_0x542166,null));};exports[_0xe444('0x48')]=function(_0x3b3380,_0x2626cc){return db[_0xe444('0x3e')]['describe']()['then'](respondWithResult(_0x2626cc,null))[_0xe444('0x41')](handleError(_0x2626cc,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 514bb9a..13f4f2a 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 _0x43ce=['api','moment','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','util','../../config/logger'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x43ce,0xb9));var _0xe43c=function(_0x234971,_0x52009a){_0x234971=_0x234971-0x0;var _0x566a0b=_0x43ce[_0x234971];return _0x566a0b;};'use strict';var _=require('lodash');var util=require(_0xe43c('0x0'));var logger=require(_0xe43c('0x1'))(_0xe43c('0x2'));var moment=require(_0xe43c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe43c('0x4'));var rimraf=require(_0xe43c('0x5'));var config=require(_0xe43c('0x6'));var attributes=require(_0xe43c('0x7'));module['exports']=function(_0x1a583a,_0x3837aa){return _0x1a583a[_0xe43c('0x8')](_0xe43c('0x9'),attributes,{'tableName':_0xe43c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bc0=['util','api','moment','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0xc4c1bc,_0x736edd){var _0x548722=function(_0x38db6e){while(--_0x38db6e){_0xc4c1bc['push'](_0xc4c1bc['shift']());}};_0x548722(++_0x736edd);}(_0x0bc0,0x113));var _0x00bc=function(_0x1498dd,_0x3155dd){_0x1498dd=_0x1498dd-0x0;var _0x46b1a7=_0x0bc0[_0x1498dd];return _0x46b1a7;};'use strict';var _=require(_0x00bc('0x0'));var util=require(_0x00bc('0x1'));var logger=require('../../config/logger')(_0x00bc('0x2'));var moment=require(_0x00bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x00bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00bc('0x5'));var config=require(_0x00bc('0x6'));var attributes=require(_0x00bc('0x7'));module[_0x00bc('0x8')]=function(_0x1e934e,_0x1f8755){return _0x1e934e[_0x00bc('0x9')](_0x00bc('0xa'),attributes,{'tableName':_0x00bc('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 c36955d..d7a11e8 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 _0xa3dc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CmHopperBlack','findAll','options','raw','attributes','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','body','limit','destroy','where','DestroyCmHopperBlack','lodash'];(function(_0x2481c7,_0x2c6bcc){var _0x174f3b=function(_0x17326d){while(--_0x17326d){_0x2481c7['push'](_0x2481c7['shift']());}};_0x174f3b(++_0x2c6bcc);}(_0xa3dc,0x1ed));var _0xca3d=function(_0x1fed31,_0x1a2daf){_0x1fed31=_0x1fed31-0x0;var _0x1b412d=_0xa3dc[_0x1fed31];return _0x1b412d;};'use strict';var _=require(_0xca3d('0x0'));var util=require(_0xca3d('0x1'));var moment=require(_0xca3d('0x2'));var BPromise=require(_0xca3d('0x3'));var rs=require(_0xca3d('0x4'));var fs=require('fs');var Redis=require(_0xca3d('0x5'));var db=require(_0xca3d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xca3d('0x7'))(_0xca3d('0x8'));var config=require('../../config/environment');var jayson=require(_0xca3d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ff64e,_0x3ad66a,_0x402af5){return new BPromise(function(_0x43407e,_0x1de9ac){return client[_0xca3d('0xa')](_0x1ff64e,_0x402af5)[_0xca3d('0xb')](function(_0x1c28f3){logger[_0xca3d('0xc')](_0xca3d('0xd'),_0x3ad66a,_0xca3d('0xe'));logger[_0xca3d('0xf')](_0xca3d('0x10'),_0x3ad66a,_0xca3d('0xe'),JSON[_0xca3d('0x11')](_0x1c28f3));if(_0x1c28f3[_0xca3d('0x12')]){if(_0x1c28f3[_0xca3d('0x12')]['code']===0x1f4){logger[_0xca3d('0x12')](_0xca3d('0xd'),_0x3ad66a,_0x1c28f3[_0xca3d('0x12')][_0xca3d('0x13')]);return _0x1de9ac(_0x1c28f3[_0xca3d('0x12')][_0xca3d('0x13')]);}logger['error'](_0xca3d('0xd'),_0x3ad66a,_0x1c28f3[_0xca3d('0x12')][_0xca3d('0x13')]);return _0x43407e(_0x1c28f3['error']['message']);}else{logger[_0xca3d('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x3ad66a,_0xca3d('0xe'));_0x43407e(_0x1c28f3[_0xca3d('0x14')]['message']);}})[_0xca3d('0x15')](function(_0x5974c2){logger[_0xca3d('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x3ad66a,_0x5974c2);_0x1de9ac(_0x5974c2);});});}exports['GetCmHopperBlack']=function(_0x2bec64){var _0x15a942=this;return new Promise(function(_0x40efd3,_0x4fa36f){return db[_0xca3d('0x16')][_0xca3d('0x17')]({'raw':_0x2bec64[_0xca3d('0x18')]?_0x2bec64[_0xca3d('0x18')][_0xca3d('0x19')]===undefined?!![]:![]:!![],'where':_0x2bec64[_0xca3d('0x18')]?_0x2bec64[_0xca3d('0x18')]['where']||null:null,'attributes':_0x2bec64['options']?_0x2bec64[_0xca3d('0x18')][_0xca3d('0x1a')]||null:null,'limit':_0x2bec64['options']?_0x2bec64['options']['limit']||null:null,'include':_0x2bec64[_0xca3d('0x18')]?_0x2bec64[_0xca3d('0x18')][_0xca3d('0x1b')]?_[_0xca3d('0x1c')](_0x2bec64[_0xca3d('0x18')][_0xca3d('0x1b')],function(_0xc73de4){return{'model':db[_0xc73de4[_0xca3d('0x1d')]],'as':_0xc73de4['as'],'attributes':_0xc73de4[_0xca3d('0x1a')],'include':_0xc73de4[_0xca3d('0x1b')]?_[_0xca3d('0x1c')](_0xc73de4['include'],function(_0x26348f){return{'model':db[_0x26348f[_0xca3d('0x1d')]],'as':_0x26348f['as'],'attributes':_0x26348f[_0xca3d('0x1a')],'include':_0x26348f[_0xca3d('0x1b')]?_['map'](_0x26348f[_0xca3d('0x1b')],function(_0x136a63){return{'model':db[_0x136a63[_0xca3d('0x1d')]],'as':_0x136a63['as'],'attributes':_0x136a63[_0xca3d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10d3d3){logger[_0xca3d('0xc')](_0xca3d('0x1e'),_0x2bec64);logger[_0xca3d('0xf')](_0xca3d('0x1e'),_0x2bec64,JSON[_0xca3d('0x11')](_0x10d3d3));_0x40efd3(_0x10d3d3);})[_0xca3d('0x15')](function(_0xd40e8){logger[_0xca3d('0x12')](_0xca3d('0x1e'),_0xd40e8[_0xca3d('0x13')],_0x2bec64);_0x4fa36f(_0x15a942[_0xca3d('0x12')](0x1f4,_0xd40e8[_0xca3d('0x13')]));});});};exports[_0xca3d('0x1f')]=function(_0x37f4bd){var _0x37aa79=this;return new Promise(function(_0x3b797c,_0x1757db){return db['CmHopperBlack'][_0xca3d('0x20')](_0x37f4bd[_0xca3d('0x21')],{'raw':_0x37f4bd[_0xca3d('0x18')]?_0x37f4bd[_0xca3d('0x18')][_0xca3d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37f4bd[_0xca3d('0x18')]?_0x37f4bd[_0xca3d('0x18')]['where']||null:null,'attributes':_0x37f4bd[_0xca3d('0x18')]?_0x37f4bd['options'][_0xca3d('0x1a')]||null:null,'limit':_0x37f4bd['options']?_0x37f4bd[_0xca3d('0x18')][_0xca3d('0x22')]||null:null})[_0xca3d('0xb')](function(_0x2b1294){logger[_0xca3d('0xc')](_0xca3d('0x1f'),_0x37f4bd);logger[_0xca3d('0xf')](_0xca3d('0x1f'),_0x37f4bd,JSON['stringify'](_0x2b1294));_0x3b797c(_0x2b1294);})[_0xca3d('0x15')](function(_0x226270){logger['error'](_0xca3d('0x1f'),_0x226270[_0xca3d('0x13')],_0x37f4bd);_0x1757db(_0x37aa79[_0xca3d('0x12')](0x1f4,_0x226270['message']));});});};exports['DestroyCmHopperBlack']=function(_0x4f2f7a){var _0x1dd21e=this;return new Promise(function(_0x3188ef,_0x120722){return db[_0xca3d('0x16')][_0xca3d('0x23')]({'where':_0x4f2f7a[_0xca3d('0x18')]?_0x4f2f7a['options'][_0xca3d('0x24')]||null:null})[_0xca3d('0xb')](function(_0x300484){logger[_0xca3d('0xc')](_0xca3d('0x25'),_0x4f2f7a);logger['debug'](_0xca3d('0x25'),_0x4f2f7a,JSON[_0xca3d('0x11')](_0x300484));_0x3188ef(_0x300484);})['catch'](function(_0x22ab6c){logger['error'](_0xca3d('0x25'),_0x22ab6c[_0xca3d('0x13')],_0x4f2f7a);_0x120722(_0x1dd21e['error'](0x1f4,_0x22ab6c[_0xca3d('0x13')]));});});}; \ No newline at end of file +var _0xa73d=['include','model','UpdateCmHopperBlack','update','body','raw','where','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','CmHopperBlack,\x20%s,\x20%s','result','catch','GetCmHopperBlack','CmHopperBlack','options','attributes','limit','map'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0xa73d,0x129));var _0xda73=function(_0x32a26a,_0x169cc8){_0x32a26a=_0x32a26a-0x0;var _0x269ab1=_0xa73d[_0x32a26a];return _0x269ab1;};'use strict';var _=require(_0xda73('0x0'));var util=require('util');var moment=require(_0xda73('0x1'));var BPromise=require(_0xda73('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda73('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xda73('0x4'));var logger=require(_0xda73('0x5'))(_0xda73('0x6'));var config=require(_0xda73('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xda73('0x8')][_0xda73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x60f45e,_0x143ddb,_0x3662c0){return new BPromise(function(_0xca3783,_0xa49889){return client[_0xda73('0xa')](_0x60f45e,_0x3662c0)[_0xda73('0xb')](function(_0x19781){logger[_0xda73('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x143ddb,'request\x20sent');logger[_0xda73('0xd')](_0xda73('0xe'),_0x143ddb,'request\x20sent',JSON[_0xda73('0xf')](_0x19781));if(_0x19781[_0xda73('0x10')]){if(_0x19781[_0xda73('0x10')]['code']===0x1f4){logger[_0xda73('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x143ddb,_0x19781[_0xda73('0x10')][_0xda73('0x11')]);return _0xa49889(_0x19781[_0xda73('0x10')][_0xda73('0x11')]);}logger[_0xda73('0x10')](_0xda73('0x12'),_0x143ddb,_0x19781[_0xda73('0x10')][_0xda73('0x11')]);return _0xca3783(_0x19781[_0xda73('0x10')]['message']);}else{logger[_0xda73('0xc')](_0xda73('0x12'),_0x143ddb,'request\x20sent');_0xca3783(_0x19781[_0xda73('0x13')]['message']);}})[_0xda73('0x14')](function(_0x46d56b){logger[_0xda73('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x143ddb,_0x46d56b);_0xa49889(_0x46d56b);});});}exports[_0xda73('0x15')]=function(_0xe4c784){var _0x5a6ad8=this;return new Promise(function(_0x3894e9,_0x26d73c){return db[_0xda73('0x16')]['findAll']({'raw':_0xe4c784[_0xda73('0x17')]?_0xe4c784['options']['raw']===undefined?!![]:![]:!![],'where':_0xe4c784[_0xda73('0x17')]?_0xe4c784[_0xda73('0x17')]['where']||null:null,'attributes':_0xe4c784[_0xda73('0x17')]?_0xe4c784[_0xda73('0x17')][_0xda73('0x18')]||null:null,'limit':_0xe4c784[_0xda73('0x17')]?_0xe4c784[_0xda73('0x17')][_0xda73('0x19')]||null:null,'include':_0xe4c784[_0xda73('0x17')]?_0xe4c784[_0xda73('0x17')]['include']?_[_0xda73('0x1a')](_0xe4c784[_0xda73('0x17')][_0xda73('0x1b')],function(_0xc4e95c){return{'model':db[_0xc4e95c['model']],'as':_0xc4e95c['as'],'attributes':_0xc4e95c[_0xda73('0x18')],'include':_0xc4e95c[_0xda73('0x1b')]?_['map'](_0xc4e95c[_0xda73('0x1b')],function(_0x52ce00){return{'model':db[_0x52ce00['model']],'as':_0x52ce00['as'],'attributes':_0x52ce00[_0xda73('0x18')],'include':_0x52ce00['include']?_[_0xda73('0x1a')](_0x52ce00[_0xda73('0x1b')],function(_0x136ec6){return{'model':db[_0x136ec6[_0xda73('0x1c')]],'as':_0x136ec6['as'],'attributes':_0x136ec6[_0xda73('0x18')]};}):[]};}):[]};}):[]:[]})[_0xda73('0xb')](function(_0x4b7316){logger['info'](_0xda73('0x15'),_0xe4c784);logger[_0xda73('0xd')]('GetCmHopperBlack',_0xe4c784,JSON[_0xda73('0xf')](_0x4b7316));_0x3894e9(_0x4b7316);})['catch'](function(_0x57bd1a){logger[_0xda73('0x10')]('GetCmHopperBlack',_0x57bd1a[_0xda73('0x11')],_0xe4c784);_0x26d73c(_0x5a6ad8['error'](0x1f4,_0x57bd1a['message']));});});};exports[_0xda73('0x1d')]=function(_0x385af6){var _0x4d79ab=this;return new Promise(function(_0x4ce981,_0x4e3b77){return db[_0xda73('0x16')][_0xda73('0x1e')](_0x385af6[_0xda73('0x1f')],{'raw':_0x385af6[_0xda73('0x17')]?_0x385af6['options'][_0xda73('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x385af6['options']?_0x385af6[_0xda73('0x17')][_0xda73('0x21')]||null:null,'attributes':_0x385af6[_0xda73('0x17')]?_0x385af6[_0xda73('0x17')]['attributes']||null:null,'limit':_0x385af6[_0xda73('0x17')]?_0x385af6[_0xda73('0x17')][_0xda73('0x19')]||null:null})[_0xda73('0xb')](function(_0x512d73){logger[_0xda73('0xc')](_0xda73('0x1d'),_0x385af6);logger[_0xda73('0xd')]('UpdateCmHopperBlack',_0x385af6,JSON[_0xda73('0xf')](_0x512d73));_0x4ce981(_0x512d73);})[_0xda73('0x14')](function(_0x4c30e2){logger[_0xda73('0x10')](_0xda73('0x1d'),_0x4c30e2[_0xda73('0x11')],_0x385af6);_0x4e3b77(_0x4d79ab[_0xda73('0x10')](0x1f4,_0x4c30e2[_0xda73('0x11')]));});});};exports[_0xda73('0x22')]=function(_0x2a943b){var _0x3259d4=this;return new Promise(function(_0xb86e06,_0x585ec1){return db['CmHopperBlack'][_0xda73('0x23')]({'where':_0x2a943b[_0xda73('0x17')]?_0x2a943b[_0xda73('0x17')][_0xda73('0x21')]||null:null})[_0xda73('0xb')](function(_0x2387fb){logger[_0xda73('0xc')](_0xda73('0x22'),_0x2a943b);logger[_0xda73('0xd')](_0xda73('0x22'),_0x2a943b,JSON[_0xda73('0xf')](_0x2387fb));_0xb86e06(_0x2387fb);})['catch'](function(_0x23cc2e){logger[_0xda73('0x10')](_0xda73('0x22'),_0x23cc2e[_0xda73('0x11')],_0x2a943b);_0x585ec1(_0x3259d4[_0xda73('0x10')](0x1f4,_0x23cc2e[_0xda73('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 6b6cf8d..35e7e19 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 _0xafb9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','show','put','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x48d6aa,_0xa16c32){var _0xcda4c8=function(_0x1b1632){while(--_0x1b1632){_0x48d6aa['push'](_0x48d6aa['shift']());}};_0xcda4c8(++_0xa16c32);}(_0xafb9,0x68));var _0x9afb=function(_0x39aefb,_0x4912db){_0x39aefb=_0x39aefb-0x0;var _0x31ac69=_0xafb9[_0x39aefb];return _0x31ac69;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var fs_extra=require(_0x9afb('0x6'));var auth=require(_0x9afb('0x7'));var interaction=require(_0x9afb('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x9afb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9afb('0xa')]);router['get']('/describe',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0x9')]('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0xd')]);router[_0x9afb('0xe')](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller['update']);router['delete'](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x10')]);module[_0x9afb('0x11')]=router; \ No newline at end of file +var _0x781d=['isAuthenticated','index','/describe','describe','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x781d,0x14a));var _0xd781=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x781d[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd781('0x2'));var router=express[_0xd781('0x3')]();var fs_extra=require(_0xd781('0x4'));var auth=require(_0xd781('0x5'));var interaction=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var controller=require(_0xd781('0x8'));router[_0xd781('0x9')]('/',auth[_0xd781('0xa')](),controller[_0xd781('0xb')]);router['get'](_0xd781('0xc'),auth[_0xd781('0xa')](),controller[_0xd781('0xd')]);router[_0xd781('0x9')]('/:id',auth[_0xd781('0xa')](),controller['show']);router[_0xd781('0xe')](_0xd781('0xf'),auth['isAuthenticated'](),controller[_0xd781('0x10')]);router[_0xd781('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd781('0x12')]);module[_0xd781('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 3cf4881..643ed68 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 _0xca7b=['diff','seconds','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x213065,_0x3afd09){var _0x50a790=function(_0x5705dd){while(--_0x5705dd){_0x213065['push'](_0x213065['shift']());}};_0x50a790(++_0x3afd09);}(_0xca7b,0x16b));var _0xbca7=function(_0x36ae89,_0x4a3819){_0x36ae89=_0x36ae89-0x0;var _0x3ca164=_0xca7b[_0x36ae89];return _0x3ca164;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbca7('0x0'));module[_0xbca7('0x1')]={'state':{'type':Sequelize[_0xbca7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xbca7('0x3')]},'scheduledat':{'type':Sequelize[_0xbca7('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbca7('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xbca7('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xbca7('0x3')]},'originatecalleridname':{'type':Sequelize[_0xbca7('0x3')]},'calleridnum':{'type':Sequelize[_0xbca7('0x3')]},'calleridname':{'type':Sequelize[_0xbca7('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xbca7('0x4')]},'answertime':{'type':Sequelize[_0xbca7('0x4')]},'droptime':{'type':Sequelize[_0xbca7('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xbca7('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xbca7('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xbca7('0x3')]},'membername':{'type':Sequelize[_0xbca7('0x3')]},'reason':{'type':Sequelize[_0xbca7('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xbca7('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xbca7('0x4')],'set':function(_0x4e768f){var _0x45e6c0=this[_0xbca7('0x5')]('endtime');if(_0x45e6c0&&_0x4e768f){this[_0xbca7('0x6')]('followuptime',moment(_0x4e768f)[_0xbca7('0x7')](moment(_0x45e6c0),_0xbca7('0x8')));}}},'amd':{'type':Sequelize[_0xbca7('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xbca7('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xbca7('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xbca7('0x4')]},'callback':{'type':Sequelize[_0xbca7('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbca7('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xbca7('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xbca7('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xbca7('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbca7('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbca7('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbca7('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbca7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9d26=['sequelize','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','BOOLEAN'];(function(_0x1e2671,_0x4cf90a){var _0x492489=function(_0x1440b6){while(--_0x1440b6){_0x1e2671['push'](_0x1e2671['shift']());}};_0x492489(++_0x4cf90a);}(_0x9d26,0x113));var _0x69d2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9d26[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x69d2('0x0'));var moment=require('moment');module[_0x69d2('0x1')]={'state':{'type':Sequelize[_0x69d2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x69d2('0x3')]},'scheduledat':{'type':Sequelize[_0x69d2('0x4')]},'countbusyretry':{'type':Sequelize[_0x69d2('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x69d2('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x69d2('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x69d2('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x69d2('0x3')]},'originatecalleridname':{'type':Sequelize[_0x69d2('0x3')]},'calleridnum':{'type':Sequelize[_0x69d2('0x3')]},'calleridname':{'type':Sequelize[_0x69d2('0x3')]},'starttime':{'type':Sequelize[_0x69d2('0x4')]},'responsetime':{'type':Sequelize[_0x69d2('0x4')]},'answertime':{'type':Sequelize[_0x69d2('0x4')]},'droptime':{'type':Sequelize[_0x69d2('0x4')]},'endtime':{'type':Sequelize[_0x69d2('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x69d2('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x69d2('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x69d2('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x69d2('0x3')]},'reason':{'type':Sequelize[_0x69d2('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x69d2('0x4')],'set':function(_0x4fdfb2){var _0x3e7c4b=this[_0x69d2('0x5')](_0x69d2('0x6'));if(_0x3e7c4b&&_0x4fdfb2){this[_0x69d2('0x7')](_0x69d2('0x8'),moment(_0x4fdfb2)[_0x69d2('0x9')](moment(_0x3e7c4b),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x69d2('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x69d2('0x4')]},'callback':{'type':Sequelize[_0x69d2('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x69d2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x69d2('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x69d2('0x4')]},'recallme':{'type':Sequelize[_0x69d2('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x69d2('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x69d2('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x69d2('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x69d2('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 7df022f..62bb8b1 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 _0x4c60=['include','findAll','rows','catch','show','includeAll','find','describe','update','uniqueid','body','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','VoiceQueue','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','CmHopperFinal','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x41cd34,_0x32cd0c){var _0x1273e8=function(_0x34f4f6){while(--_0x34f4f6){_0x41cd34['push'](_0x41cd34['shift']());}};_0x1273e8(++_0x32cd0c);}(_0x4c60,0xc1));var _0x04c6=function(_0x36336d,_0x57742b){_0x36336d=_0x36336d-0x0;var _0xdc6130=_0x4c60[_0x36336d];return _0xdc6130;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['CmHopperFinal'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':!![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['CmHopperFinal'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['CmHopperFinal'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')]()['then'](respondWithResult(_0x4ef366,null))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0x2472ed,_0xee2822){if(_0x2472ed['body'][_0x04c6('0x44')]){delete _0x2472ed[_0x04c6('0x45')][_0x04c6('0x44')];}return db[_0x04c6('0x27')]['find']({'where':{'uniqueid':_0x2472ed[_0x04c6('0x46')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0xee2822,null))[_0x04c6('0x1f')](saveUpdates(_0x2472ed[_0x04c6('0x45')],null))['then'](respondWithResult(_0xee2822,null))[_0x04c6('0x3e')](handleError(_0xee2822,null));};exports[_0x04c6('0x47')]=function(_0x15ec61,_0x489361,_0x3119f0){return db[_0x04c6('0x27')][_0x04c6('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x15ec61[_0x04c6('0x46')]['id']},'attributes':[[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4b')))),_0x04c6('0x4c')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),_0x04c6('0x55')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x56')))),'answeringMachine']]})[_0x04c6('0x1f')](handleEntityNotFound(_0x489361,null))[_0x04c6('0x1f')](respondWithResult(_0x489361,null))[_0x04c6('0x3e')](handleError(_0x489361,null));};exports[_0x04c6('0x57')]=function(_0x28299e,_0x5b536f,_0xf073a8){return db[_0x04c6('0x27')]['findAll']({'raw':![],'where':{'CampaignId':_0x28299e[_0x04c6('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize']['literal'](_0x04c6('0x4b')))),'noSuchContacts'],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x04c6('0x58')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x59')))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),'reCallContacts'],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x56')))),_0x04c6('0x5a')]]})[_0x04c6('0x1f')](handleEntityNotFound(_0x5b536f,null))[_0x04c6('0x1f')](respondWithResult(_0x5b536f,null))[_0x04c6('0x3e')](handleError(_0x5b536f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x31cc93,_0x1b6242,_0x1f5b9a){return db[_0x04c6('0x5b')][_0x04c6('0x41')]({'where':{'id':_0x31cc93['params']['id']}})['then'](handleEntityNotFound(_0x1b6242,null))[_0x04c6('0x1f')](function(_0x598941){var _0x2df63b;if(_0x598941){_0x2df63b=squel['insert']()[_0x04c6('0x5c')](_0x04c6('0x5d'))['fromQuery']([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x62'),_0x04c6('0x63'),_0x04c6('0x64')],squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),'scheduledAt')[_0x04c6('0x66')](_0x04c6('0x69'),'ContactId')[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))[_0x04c6('0x66')](_0x04c6('0x6b'),'VoiceQueueId')[_0x04c6('0x66')]('NOW()',_0x04c6('0x63'))['field'](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())[_0x04c6('0x35')]('state\x20=\x20?',_0x31cc93[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x04c6('0x35')](_0x04c6('0x71'),squel['select']()[_0x04c6('0x66')](_0x04c6('0x5e'))['from'](_0x04c6('0x5d'))[_0x04c6('0x35')]('VoiceQueueId\x20=\x20?',_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()['field']('calleridnum')['from'](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where'](_0x04c6('0x72')))[_0x04c6('0x73')](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db[_0x04c6('0x48')][_0x04c6('0x2b')](_0x2df63b);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x1b6242,null))['catch'](handleError(_0x1b6242,null));};exports[_0x04c6('0x74')]=function(_0x4f258c,_0x202761,_0x480c74){return db['Campaign'][_0x04c6('0x41')]({'where':{'id':_0x4f258c['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x202761,null))[_0x04c6('0x1f')](function(_0x174de6){var _0x425d01;if(_0x174de6){_0x425d01=squel[_0x04c6('0x75')]()['into']('cm_hopper')[_0x04c6('0x76')]([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x77'),'createdAt',_0x04c6('0x64')],squel['select']()['field'](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x5f'))[_0x04c6('0x66')](_0x04c6('0x69'),_0x04c6('0x60'))[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))['field'](_0x04c6('0x78'),'CampaignId')['field'](_0x04c6('0x68'),_0x04c6('0x63'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x20?',_0x4f258c[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')](_0x04c6('0x7a'))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x5e'))[_0x04c6('0x6c')](_0x04c6('0x5d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c['params']['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x7b'))[_0x04c6('0x6c')](_0x04c6('0x6d'))['where'](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x204'))['group'](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db['sequelize'][_0x04c6('0x2b')](_0x425d01);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x202761,null))[_0x04c6('0x3e')](handleError(_0x202761,null));};exports['checkContactHopper']=function(_0x343c1f,_0x485457,_0x1c0c74){return db[_0x04c6('0x7c')][_0x04c6('0x7d')]({'where':{'VoiceQueueId':_0x343c1f['body']['VoiceQueueId'],'CampaignId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x77')],'ContactId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x60')]}})['then'](handleEntityNotFound(_0x485457,null))['then'](function(_0x3e12a4){if(_0x3e12a4){return _0x3e12a4;}return null;})[_0x04c6('0x1f')](respondWithResult(_0x485457,null))[_0x04c6('0x3e')](handleError(_0x485457,null));}; \ No newline at end of file +var _0x1261=['attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','describe','catch','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','cm_hopper','fromQuery','phone','scheduledAt','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','into','ListId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','CmHopperFinal','model','map','name','keys','query','intersection'];(function(_0xd7d4eb,_0x2c62df){var _0x217382=function(_0x6b9fd8){while(--_0x6b9fd8){_0xd7d4eb['push'](_0xd7d4eb['shift']());}};_0x217382(++_0x2c62df);}(_0x1261,0x144));var _0x1126=function(_0x284bc3,_0x22dffe){_0x284bc3=_0x284bc3-0x0;var _0x41ac81=_0x1261[_0x284bc3];return _0x41ac81;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['CmHopperFinal'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':!![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['CmHopperFinal']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')]()['then'](respondWithResult(_0x5111d3,null))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports[_0x1126('0x24')]=function(_0x518e0a,_0x3e4eeb){if(_0x518e0a[_0x1126('0x44')][_0x1126('0x45')]){delete _0x518e0a['body'][_0x1126('0x45')];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'uniqueid':_0x518e0a[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x3e4eeb,null))[_0x1126('0x25')](saveUpdates(_0x518e0a[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0x3e4eeb,null))['catch'](handleError(_0x3e4eeb,null));};exports[_0x1126('0x46')]=function(_0x5a2287,_0x40168e,_0x2ad118){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x5a2287[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4a')))),_0x1126('0x4b')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x4e')))),_0x1126('0x4f')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x1126('0x50')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1126('0x51')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),_0x1126('0x53')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x40168e,null))[_0x1126('0x25')](respondWithResult(_0x40168e,null))[_0x1126('0x43')](handleError(_0x40168e,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xcc1a95,_0x315386,_0x5e0ea1){return db[_0x1126('0x29')]['findAll']({'raw':![],'where':{'CampaignId':_0xcc1a95[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x1126('0x4b')],[db['sequelize']['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x56')))),_0x1126('0x57')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x4e')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x58')))),'dropContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x59')))),_0x1126('0x51')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x315386,null))[_0x1126('0x25')](respondWithResult(_0x315386,null))[_0x1126('0x43')](handleError(_0x315386,null));};exports[_0x1126('0x5a')]=function(_0x247f12,_0xd20fbe,_0x3d5e15){return db[_0x1126('0x5b')][_0x1126('0x41')]({'where':{'id':_0x247f12[_0x1126('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd20fbe,null))[_0x1126('0x25')](function(_0x274343){var _0x2b61ae;if(_0x274343){_0x2b61ae=squel['insert']()['into'](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),'ContactId','ListId','VoiceQueueId',_0x1126('0x60'),_0x1126('0x61')],squel[_0x1126('0x62')]()[_0x1126('0x63')]('ANY_VALUE(calleridnum)',_0x1126('0x5e'))['field'](_0x1126('0x64'),_0x1126('0x5f'))[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),'ListId')[_0x1126('0x63')]('ANY_VALUE(VoiceQueueId)',_0x1126('0x68'))[_0x1126('0x63')]('NOW()',_0x1126('0x60'))[_0x1126('0x63')]('NOW()',_0x1126('0x61'))[_0x1126('0x69')]('cm_hopper_final')['where'](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())['where']('state\x20=\x20?',_0x247f12['body'][_0x1126('0x6c')]['toString']())['where'](_0x1126('0x6d'))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()['field'](_0x1126('0x5e'))[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12['params']['id'][_0x1126('0x6b')]()))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')](_0x1126('0x71')))[_0x1126('0x72')](_0x1126('0x66')))[_0x1126('0x6b')]();return db[_0x1126('0x47')][_0x1126('0x2e')](_0x2b61ae);}return[];})['then'](respondWithResult(_0xd20fbe,null))[_0x1126('0x43')](handleError(_0xd20fbe,null));};exports[_0x1126('0x73')]=function(_0x33cccf,_0x1483f4,_0x3be5bf){return db['Campaign'][_0x1126('0x41')]({'where':{'id':_0x33cccf['params']['id']}})['then'](handleEntityNotFound(_0x1483f4,null))[_0x1126('0x25')](function(_0x2b1884){var _0x55f366;if(_0x2b1884){_0x55f366=squel['insert']()[_0x1126('0x74')](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),_0x1126('0x66'),_0x1126('0x75'),_0x1126('0x76'),_0x1126('0x60'),'updatedAt'],squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x77'),_0x1126('0x5e'))[_0x1126('0x63')](_0x1126('0x64'),'scheduledAt')[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),_0x1126('0x75'))[_0x1126('0x63')](_0x1126('0x78'),_0x1126('0x76'))[_0x1126('0x63')]('NOW()','createdAt')[_0x1126('0x63')]('NOW()',_0x1126('0x61'))['from'](_0x1126('0x70'))['where'](_0x1126('0x79'),_0x33cccf['params']['id']['toString']())['where'](_0x1126('0x7a'),_0x33cccf[_0x1126('0x44')]['state']['toString']())[_0x1126('0x37')](_0x1126('0x6d'))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x1126('0x63')]('phone')[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id']['toString']()))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')]('state\x20=\x204'))[_0x1126('0x72')]('ContactId'))[_0x1126('0x6b')]();return db['sequelize'][_0x1126('0x2e')](_0x55f366);}return[];})[_0x1126('0x25')](respondWithResult(_0x1483f4,null))[_0x1126('0x43')](handleError(_0x1483f4,null));};exports[_0x1126('0x7b')]=function(_0x59c04b,_0x429183,_0x834360){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x59c04b[_0x1126('0x44')][_0x1126('0x68')],'CampaignId':_0x59c04b[_0x1126('0x44')]['CampaignId'],'ContactId':_0x59c04b[_0x1126('0x44')]['ContactId']}})[_0x1126('0x25')](handleEntityNotFound(_0x429183,null))[_0x1126('0x25')](function(_0x4d6bb2){if(_0x4d6bb2){return _0x4d6bb2;}return null;})[_0x1126('0x25')](respondWithResult(_0x429183,null))[_0x1126('0x43')](handleError(_0x429183,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index eba0f32..cd41223 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 _0xd02e=['moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger'];(function(_0x2d7e17,_0x4d5677){var _0x4299d8=function(_0x56e3bd){while(--_0x56e3bd){_0x2d7e17['push'](_0x2d7e17['shift']());}};_0x4299d8(++_0x4d5677);}(_0xd02e,0x1cb));var _0xed02=function(_0x4658bb,_0x31f608){_0x4658bb=_0x4658bb-0x0;var _0x33110b=_0xd02e[_0x4658bb];return _0x33110b;};'use strict';var _=require(_0xed02('0x0'));var util=require(_0xed02('0x1'));var logger=require(_0xed02('0x2'))('api');var moment=require(_0xed02('0x3'));var BPromise=require(_0xed02('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed02('0x5'));var rimraf=require(_0xed02('0x6'));var config=require(_0xed02('0x7'));var attributes=require(_0xed02('0x8'));module[_0xed02('0x9')]=function(_0x4f9bbf,_0x5a89c1){return _0x4f9bbf[_0xed02('0xa')]('CmHopperFinal',attributes,{'tableName':_0xed02('0xb'),'paranoid':![],'indexes':[{'name':_0xed02('0xc'),'fields':['calleridnum']},{'name':_0xed02('0xd'),'fields':[_0xed02('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x370b=['../../config/logger','api','moment','request-promise','path','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x22332b,_0x48b936){var _0x3e5564=function(_0x559ab3){while(--_0x559ab3){_0x22332b['push'](_0x22332b['shift']());}};_0x3e5564(++_0x48b936);}(_0x370b,0x108));var _0xb370=function(_0x326863,_0x48bc96){_0x326863=_0x326863-0x0;var _0x3cc1e9=_0x370b[_0x326863];return _0x3cc1e9;};'use strict';var _=require(_0xb370('0x0'));var util=require(_0xb370('0x1'));var logger=require(_0xb370('0x2'))(_0xb370('0x3'));var moment=require(_0xb370('0x4'));var BPromise=require('bluebird');var rp=require(_0xb370('0x5'));var fs=require('fs');var path=require(_0xb370('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb370('0x7'));module[_0xb370('0x8')]=function(_0x4ebef0,_0x4c16c8){return _0x4ebef0[_0xb370('0x9')](_0xb370('0xa'),attributes,{'tableName':_0xb370('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xb370('0xc')]},{'name':_0xb370('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index af5be47..af399ad 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 _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(_0x8204e0,_0x4f96fe){var _0x1b1921=function(_0x3566db){while(--_0x3566db){_0x8204e0['push'](_0x8204e0['shift']());}};_0x1b1921(++_0x4f96fe);}(_0x7a54,0x106));var _0x47a5=function(_0x500d0a,_0x46bcb6){_0x500d0a=_0x500d0a-0x0;var _0x6c262b=_0x7a54[_0x500d0a];return _0x6c262b;};'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 +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(_0x171b62,_0x13b544){var _0x5d62cd=function(_0x581259){while(--_0x581259){_0x171b62['push'](_0x171b62['shift']());}};_0x5d62cd(++_0x13b544);}(_0xb10b,0x12a));var _0xbb10=function(_0x1876c7,_0x379202){_0x1876c7=_0x1876c7-0x0;var _0x2b9572=_0xb10b[_0x1876c7];return _0x2b9572;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index d112106..19f17c2 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 _0x28a0=['Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','index','get','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','checkContactHopper','put','exports','multer','path','connect-timeout','express'];(function(_0x2c9985,_0x2975c1){var _0x5e1bea=function(_0x7761a8){while(--_0x7761a8){_0x2c9985['push'](_0x2c9985['shift']());}};_0x5e1bea(++_0x2975c1);}(_0x28a0,0x155));var _0x028a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x28a0[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x028a('0x0'));var util=require('util');var path=require(_0x028a('0x1'));var timeout=require(_0x028a('0x2'));var express=require(_0x028a('0x3'));var router=express[_0x028a('0x4')]();var fs_extra=require(_0x028a('0x5'));var auth=require(_0x028a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x028a('0x7'));var controller=require(_0x028a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x028a('0x9')]);router[_0x028a('0xa')]('/describe',auth[_0x028a('0xb')](),controller['describe']);router[_0x028a('0xa')](_0x028a('0xc'),auth[_0x028a('0xb')](),controller[_0x028a('0xd')]);router[_0x028a('0xa')](_0x028a('0xe'),auth['isAuthenticated'](),controller[_0x028a('0xf')]);router[_0x028a('0xa')](_0x028a('0x10'),auth[_0x028a('0xb')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x028a('0x11')](_0x028a('0x12'),auth[_0x028a('0xb')](),controller[_0x028a('0x13')]);router[_0x028a('0x11')]('/voice/campaign/moveContacts/:id',auth[_0x028a('0xb')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x028a('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x028a('0x14')]);router[_0x028a('0x15')]('/:id',auth[_0x028a('0xb')](),controller['update']);module[_0x028a('0x16')]=router; \ No newline at end of file +var _0x7e4b=['index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','checkContactHopper','put','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated'];(function(_0x44d96a,_0x13c76b){var _0x5dc456=function(_0x66c0ca){while(--_0x66c0ca){_0x44d96a['push'](_0x44d96a['shift']());}};_0x5dc456(++_0x13c76b);}(_0x7e4b,0x85));var _0xb7e4=function(_0x138903,_0x2dae37){_0x138903=_0x138903-0x0;var _0x273530=_0x7e4b[_0x138903];return _0x273530;};'use strict';var multer=require('multer');var util=require(_0xb7e4('0x0'));var path=require(_0xb7e4('0x1'));var timeout=require(_0xb7e4('0x2'));var express=require(_0xb7e4('0x3'));var router=express[_0xb7e4('0x4')]();var fs_extra=require(_0xb7e4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb7e4('0x6'));var config=require(_0xb7e4('0x7'));var controller=require(_0xb7e4('0x8'));router[_0xb7e4('0x9')]('/',auth[_0xb7e4('0xa')](),controller[_0xb7e4('0xb')]);router[_0xb7e4('0x9')](_0xb7e4('0xc'),auth[_0xb7e4('0xa')](),controller[_0xb7e4('0xd')]);router[_0xb7e4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb7e4('0xe')]);router[_0xb7e4('0x9')](_0xb7e4('0xf'),auth[_0xb7e4('0xa')](),controller[_0xb7e4('0x10')]);router[_0xb7e4('0x9')]('/campaign/countAttributes/:id',auth[_0xb7e4('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xb7e4('0x11')](_0xb7e4('0x12'),auth[_0xb7e4('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0xb7e4('0x13'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xb7e4('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xb7e4('0x14')]);router[_0xb7e4('0x15')](_0xb7e4('0x16'),auth[_0xb7e4('0xa')](),controller['update']);module[_0xb7e4('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5c800bd..b5c9b0d 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 _0xef0d=['sequelize','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x300bfb,_0x3cae51){var _0x353a12=function(_0x183ab6){while(--_0x183ab6){_0x300bfb['push'](_0x300bfb['shift']());}};_0x353a12(++_0x3cae51);}(_0xef0d,0xdc));var _0xdef0=function(_0x581295,_0x2ede59){_0x581295=_0x581295-0x0;var _0x2a427f=_0xef0d[_0x581295];return _0x2a427f;};'use strict';var Sequelize=require(_0xdef0('0x0'));module['exports']={'state':{'type':Sequelize[_0xdef0('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xdef0('0x2')]},'scheduledat':{'type':Sequelize[_0xdef0('0x3')]},'countbusyretry':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdef0('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xdef0('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xdef0('0x2')]},'calleridname':{'type':Sequelize[_0xdef0('0x2')]},'starttime':{'type':Sequelize[_0xdef0('0x3')]},'responsetime':{'type':Sequelize[_0xdef0('0x3')]},'answertime':{'type':Sequelize[_0xdef0('0x3')]},'droptime':{'type':Sequelize[_0xdef0('0x3')]},'endtime':{'type':Sequelize[_0xdef0('0x3')]},'ringtime':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdef0('0x2')]},'campaign':{'type':Sequelize[_0xdef0('0x2')]},'campaigntype':{'type':Sequelize[_0xdef0('0x2')]},'membername':{'type':Sequelize[_0xdef0('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xdef0('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdef0('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdef0('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdef0('0x3')]},'recallme':{'type':Sequelize[_0xdef0('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xdef0('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdef0('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xdef0('0x2')]}}; \ No newline at end of file +var _0xaf30=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x49b4f8,_0x3354e2){var _0x3bdfda=function(_0x4062bf){while(--_0x4062bf){_0x49b4f8['push'](_0x49b4f8['shift']());}};_0x3bdfda(++_0x3354e2);}(_0xaf30,0xd0));var _0x0af3=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xaf30[_0xaa6a4];return _0xdc31a4;};'use strict';var Sequelize=require('sequelize');module[_0x0af3('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0af3('0x1')]},'scheduledat':{'type':Sequelize[_0x0af3('0x2')]},'countbusyretry':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0af3('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x0af3('0x1')]},'originatecalleridname':{'type':Sequelize[_0x0af3('0x1')]},'calleridnum':{'type':Sequelize[_0x0af3('0x1')]},'calleridname':{'type':Sequelize[_0x0af3('0x1')]},'starttime':{'type':Sequelize[_0x0af3('0x2')]},'responsetime':{'type':Sequelize[_0x0af3('0x2')]},'answertime':{'type':Sequelize[_0x0af3('0x2')]},'droptime':{'type':Sequelize[_0x0af3('0x2')]},'endtime':{'type':Sequelize[_0x0af3('0x2')]},'ringtime':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0af3('0x1')]},'campaign':{'type':Sequelize[_0x0af3('0x1')]},'campaigntype':{'type':Sequelize[_0x0af3('0x1')]},'membername':{'type':Sequelize[_0x0af3('0x1')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x0af3('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0af3('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0af3('0x2')]},'recallme':{'type':Sequelize[_0x0af3('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0af3('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0af3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0af3('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 6c7d942..10675e3 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 _0xd51d=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','name','send','index','CmHopperHistory','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','include','find','catch','create','body','uniqueid','params'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xd51d,0x168));var _0xdd51=function(_0x55334a,_0x37bd17){_0x55334a=_0x55334a-0x0;var _0xf5452e=_0xd51d[_0x55334a];return _0xf5452e;};'use strict';var emlformat=require(_0xdd51('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd51('0x1'));var jsonpatch=require(_0xdd51('0x2'));var rp=require(_0xdd51('0x3'));var moment=require('moment');var BPromise=require(_0xdd51('0x4'));var Mustache=require(_0xdd51('0x5'));var util=require(_0xdd51('0x6'));var path=require(_0xdd51('0x7'));var sox=require(_0xdd51('0x8'));var csv=require('to-csv');var ejs=require(_0xdd51('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd51('0xa'));var squel=require(_0xdd51('0xb'));var crypto=require(_0xdd51('0xc'));var jsforce=require(_0xdd51('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdd51('0xe'));var Redis=require(_0xdd51('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdd51('0x10'));var as=require(_0xdd51('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdd51('0x12'));var utils=require(_0xdd51('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xdd51('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13d880,_0x52b86e){_0x52b86e=_0x52b86e||0xcc;return function(_0xd286e9){if(_0xd286e9){return _0x13d880[_0xdd51('0x15')](_0x52b86e);}return _0x13d880[_0xdd51('0x16')](_0x52b86e)[_0xdd51('0x17')]();};}function respondWithResult(_0x16ab9f,_0x2ac235){_0x2ac235=_0x2ac235||0xc8;return function(_0x287128){if(_0x287128){return _0x16ab9f[_0xdd51('0x16')](_0x2ac235)[_0xdd51('0x18')](_0x287128);}};}function respondWithFilteredResult(_0x3ad596,_0x39b614){return function(_0x41626e){if(_0x41626e){var _0x4b7f31=typeof _0x39b614[_0xdd51('0x19')]===_0xdd51('0x1a')&&typeof _0x39b614[_0xdd51('0x1b')]===_0xdd51('0x1a');var _0x180c4b=_0x41626e[_0xdd51('0x1c')];var _0x139691=_0x4b7f31?0x0:_0x39b614[_0xdd51('0x19')];var _0x30ee25=_0x4b7f31?_0x41626e[_0xdd51('0x1c')]:_0x39b614[_0xdd51('0x19')]+_0x39b614['limit'];var _0x1d535f;if(_0x30ee25>=_0x180c4b){_0x30ee25=_0x180c4b;_0x1d535f=0xc8;}else{_0x1d535f=0xce;}_0x3ad596[_0xdd51('0x16')](_0x1d535f);return _0x3ad596[_0xdd51('0x1d')](_0xdd51('0x1e'),_0x139691+'-'+_0x30ee25+'/'+_0x180c4b)[_0xdd51('0x18')](_0x41626e);}return null;};}function patchUpdates(_0x44f8f2){return function(_0x404265){try{jsonpatch['apply'](_0x404265,_0x44f8f2,!![]);}catch(_0x4c145e){return BPromise[_0xdd51('0x1f')](_0x4c145e);}return _0x404265['save']();};}function saveUpdates(_0x411b56,_0x3eb2c4){return function(_0x7c2ef2){if(_0x7c2ef2){return _0x7c2ef2[_0xdd51('0x20')](_0x411b56)['then'](function(_0x172ceb){return _0x172ceb;});}return null;};}function removeEntity(_0x38558f,_0x253837){return function(_0x577539){if(_0x577539){return _0x577539[_0xdd51('0x21')]()[_0xdd51('0x22')](function(){_0x38558f['status'](0xcc)[_0xdd51('0x17')]();});}};}function handleEntityNotFound(_0x4a80d1,_0x585cb2){return function(_0x5e58b7){if(!_0x5e58b7){_0x4a80d1[_0xdd51('0x15')](0x194);}return _0x5e58b7;};}function handleError(_0x4d7b1a,_0x565b02){_0x565b02=_0x565b02||0x1f4;return function(_0x2b3580){logger[_0xdd51('0x23')](_0x2b3580['stack']);if(_0x2b3580[_0xdd51('0x24')]){delete _0x2b3580['name'];}_0x4d7b1a['status'](_0x565b02)[_0xdd51('0x25')](_0x2b3580);};}exports[_0xdd51('0x26')]=function(_0x76443f,_0x561c72){var _0x32105a={},_0x320a5c={},_0x116ab0={'count':0x0,'rows':[]};var _0x105853=_['map'](db[_0xdd51('0x27')][_0xdd51('0x28')],function(_0x2346b9){return{'name':_0x2346b9['fieldName'],'type':_0x2346b9[_0xdd51('0x29')][_0xdd51('0x2a')]};});_0x320a5c[_0xdd51('0x2b')]=_[_0xdd51('0x2c')](_0x105853,_0xdd51('0x24'));_0x320a5c['query']=_[_0xdd51('0x2d')](_0x76443f[_0xdd51('0x2e')]);_0x320a5c[_0xdd51('0x2f')]=_[_0xdd51('0x30')](_0x320a5c['model'],_0x320a5c['query']);_0x32105a['attributes']=_[_0xdd51('0x30')](_0x320a5c[_0xdd51('0x2b')],qs[_0xdd51('0x31')](_0x76443f[_0xdd51('0x2e')][_0xdd51('0x31')]));_0x32105a[_0xdd51('0x32')]=_0x32105a[_0xdd51('0x32')][_0xdd51('0x33')]?_0x32105a[_0xdd51('0x32')]:_0x320a5c[_0xdd51('0x2b')];if(!_0x76443f[_0xdd51('0x2e')][_0xdd51('0x34')](_0xdd51('0x35'))){_0x32105a['limit']=qs['limit'](_0x76443f[_0xdd51('0x2e')][_0xdd51('0x1b')]);_0x32105a[_0xdd51('0x19')]=qs[_0xdd51('0x19')](_0x76443f['query'][_0xdd51('0x19')]);}_0x32105a[_0xdd51('0x36')]=qs[_0xdd51('0x37')](_0x76443f['query']['sort']);_0x32105a['where']=qs['filters'](_[_0xdd51('0x38')](_0x76443f['query'],_0x320a5c[_0xdd51('0x2f')]),_0x105853);if(_0x76443f[_0xdd51('0x2e')]['filter']){_0x32105a[_0xdd51('0x39')]=_[_0xdd51('0x3a')](_0x32105a[_0xdd51('0x39')],{'$or':_[_0xdd51('0x2c')](_0x105853,function(_0x352214){if(_0x352214['type']!==_0xdd51('0x3b')){var _0x5ce597={};_0x5ce597[_0x352214[_0xdd51('0x24')]]={'$like':'%'+_0x76443f['query'][_0xdd51('0x3c')]+'%'};return _0x5ce597;}})});}_0x32105a=_[_0xdd51('0x3a')]({},_0x32105a,_0x76443f[_0xdd51('0x3d')]);var _0x31c117={'where':_0x32105a[_0xdd51('0x39')]};return db[_0xdd51('0x27')][_0xdd51('0x1c')](_0x31c117)[_0xdd51('0x22')](function(_0x141366){_0x116ab0[_0xdd51('0x1c')]=_0x141366;if(_0x76443f[_0xdd51('0x2e')][_0xdd51('0x3e')]){_0x32105a['include']=[{'all':!![]}];}return db[_0xdd51('0x27')][_0xdd51('0x3f')](_0x32105a);})['then'](function(_0x17484f){_0x116ab0['rows']=_0x17484f;return _0x116ab0;})['then'](respondWithFilteredResult(_0x561c72,_0x32105a))['catch'](handleError(_0x561c72,null));};exports[_0xdd51('0x40')]=function(_0xb90142,_0x39bd4c){var _0x2c6375={'raw':!![],'where':{'id':_0xb90142['params']['id']}},_0x15130c={};_0x15130c['model']=_[_0xdd51('0x2d')](db[_0xdd51('0x27')]['rawAttributes']);_0x15130c['query']=_[_0xdd51('0x2d')](_0xb90142[_0xdd51('0x2e')]);_0x15130c['filters']=_[_0xdd51('0x30')](_0x15130c[_0xdd51('0x2b')],_0x15130c[_0xdd51('0x2e')]);_0x2c6375['attributes']=_[_0xdd51('0x30')](_0x15130c['model'],qs['fields'](_0xb90142[_0xdd51('0x2e')][_0xdd51('0x31')]));_0x2c6375['attributes']=_0x2c6375[_0xdd51('0x32')][_0xdd51('0x33')]?_0x2c6375[_0xdd51('0x32')]:_0x15130c['model'];if(_0xb90142[_0xdd51('0x2e')][_0xdd51('0x3e')]){_0x2c6375[_0xdd51('0x41')]=[{'all':!![]}];}_0x2c6375=_[_0xdd51('0x3a')]({},_0x2c6375,_0xb90142[_0xdd51('0x3d')]);return db[_0xdd51('0x27')][_0xdd51('0x42')](_0x2c6375)['then'](handleEntityNotFound(_0x39bd4c,null))[_0xdd51('0x22')](respondWithResult(_0x39bd4c,null))[_0xdd51('0x43')](handleError(_0x39bd4c,null));};exports['create']=function(_0x390b09,_0x1c250e){return db[_0xdd51('0x27')][_0xdd51('0x44')](_0x390b09[_0xdd51('0x45')],{})[_0xdd51('0x22')](respondWithResult(_0x1c250e,0xc9))[_0xdd51('0x43')](handleError(_0x1c250e,null));};exports['describe']=function(_0x559a02,_0x2ade9a){return db[_0xdd51('0x27')]['describe']()[_0xdd51('0x22')](respondWithResult(_0x2ade9a,null))['catch'](handleError(_0x2ade9a,null));};exports['update']=function(_0x5a6f63,_0x39a79e){if(_0x5a6f63[_0xdd51('0x45')]['uniqueid']){delete _0x5a6f63[_0xdd51('0x45')][_0xdd51('0x46')];}return db[_0xdd51('0x27')][_0xdd51('0x42')]({'where':{'uniqueid':_0x5a6f63[_0xdd51('0x47')]['id']}})[_0xdd51('0x22')](handleEntityNotFound(_0x39a79e,null))[_0xdd51('0x22')](saveUpdates(_0x5a6f63[_0xdd51('0x45')],null))[_0xdd51('0x22')](respondWithResult(_0x39a79e,null))[_0xdd51('0x43')](handleError(_0x39a79e,null));}; \ No newline at end of file +var _0x8761=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','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','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model'];(function(_0x5aacc7,_0x59da7f){var _0x1bed9e=function(_0x1fabce){while(--_0x1fabce){_0x5aacc7['push'](_0x5aacc7['shift']());}};_0x1bed9e(++_0x59da7f);}(_0x8761,0x68));var _0x1876=function(_0x5b1a8d,_0x44bf26){_0x5b1a8d=_0x5b1a8d-0x0;var _0xe2cc25=_0x8761[_0x5b1a8d];return _0xe2cc25;};'use strict';var emlformat=require(_0x1876('0x0'));var rimraf=require(_0x1876('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1876('0x2'));var rp=require('request-promise');var moment=require(_0x1876('0x3'));var BPromise=require(_0x1876('0x4'));var Mustache=require(_0x1876('0x5'));var util=require(_0x1876('0x6'));var path=require(_0x1876('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1876('0x8'));var fs=require('fs');var fs_extra=require(_0x1876('0x9'));var _=require(_0x1876('0xa'));var squel=require(_0x1876('0xb'));var crypto=require(_0x1876('0xc'));var jsforce=require(_0x1876('0xd'));var deskjs=require(_0x1876('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1876('0xf'));var Papa=require('papaparse');var Redis=require(_0x1876('0x10'));var authService=require(_0x1876('0x11'));var qs=require(_0x1876('0x12'));var as=require(_0x1876('0x13'));var hardwareService=require(_0x1876('0x14'));var logger=require(_0x1876('0x15'))(_0x1876('0x16'));var utils=require('../../config/utils');var config=require(_0x1876('0x17'));var licenseUtil=require(_0x1876('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ee39f,_0x5bab21){_0x5bab21=_0x5bab21||0xcc;return function(_0x2a2fe2){if(_0x2a2fe2){return _0x5ee39f['sendStatus'](_0x5bab21);}return _0x5ee39f[_0x1876('0x19')](_0x5bab21)[_0x1876('0x1a')]();};}function respondWithResult(_0x1f6f69,_0x315fe8){_0x315fe8=_0x315fe8||0xc8;return function(_0x3ef7c9){if(_0x3ef7c9){return _0x1f6f69[_0x1876('0x19')](_0x315fe8)[_0x1876('0x1b')](_0x3ef7c9);}};}function respondWithFilteredResult(_0x414f75,_0x22b2da){return function(_0x4b42e5){if(_0x4b42e5){var _0x27b872=typeof _0x22b2da['offset']===_0x1876('0x1c')&&typeof _0x22b2da['limit']===_0x1876('0x1c');var _0x13001a=_0x4b42e5[_0x1876('0x1d')];var _0x2e724b=_0x27b872?0x0:_0x22b2da[_0x1876('0x1e')];var _0xa862d8=_0x27b872?_0x4b42e5[_0x1876('0x1d')]:_0x22b2da[_0x1876('0x1e')]+_0x22b2da[_0x1876('0x1f')];var _0x4ea5f3;if(_0xa862d8>=_0x13001a){_0xa862d8=_0x13001a;_0x4ea5f3=0xc8;}else{_0x4ea5f3=0xce;}_0x414f75[_0x1876('0x19')](_0x4ea5f3);return _0x414f75[_0x1876('0x20')](_0x1876('0x21'),_0x2e724b+'-'+_0xa862d8+'/'+_0x13001a)[_0x1876('0x1b')](_0x4b42e5);}return null;};}function patchUpdates(_0x5c715d){return function(_0x5cb0dd){try{jsonpatch[_0x1876('0x22')](_0x5cb0dd,_0x5c715d,!![]);}catch(_0x52ead2){return BPromise[_0x1876('0x23')](_0x52ead2);}return _0x5cb0dd['save']();};}function saveUpdates(_0x30cbc0,_0x3f1368){return function(_0x5d8e58){if(_0x5d8e58){return _0x5d8e58['update'](_0x30cbc0)[_0x1876('0x24')](function(_0x499f69){return _0x499f69;});}return null;};}function removeEntity(_0x3ba86d,_0x4f59a1){return function(_0x603604){if(_0x603604){return _0x603604['destroy']()[_0x1876('0x24')](function(){_0x3ba86d[_0x1876('0x19')](0xcc)[_0x1876('0x1a')]();});}};}function handleEntityNotFound(_0x5c1bb2,_0x37b13c){return function(_0x29dd55){if(!_0x29dd55){_0x5c1bb2['sendStatus'](0x194);}return _0x29dd55;};}function handleError(_0xf89b14,_0x12fdcf){_0x12fdcf=_0x12fdcf||0x1f4;return function(_0x3846af){logger['error'](_0x3846af[_0x1876('0x25')]);if(_0x3846af[_0x1876('0x26')]){delete _0x3846af[_0x1876('0x26')];}_0xf89b14[_0x1876('0x19')](_0x12fdcf)[_0x1876('0x27')](_0x3846af);};}exports[_0x1876('0x28')]=function(_0x2a6fce,_0x1a9f1d){var _0x56a41f={},_0x45b495={},_0x127cd2={'count':0x0,'rows':[]};var _0x38d25e=_[_0x1876('0x29')](db[_0x1876('0x2a')][_0x1876('0x2b')],function(_0x55fa96){return{'name':_0x55fa96[_0x1876('0x2c')],'type':_0x55fa96[_0x1876('0x2d')][_0x1876('0x2e')]};});_0x45b495[_0x1876('0x2f')]=_[_0x1876('0x29')](_0x38d25e,_0x1876('0x26'));_0x45b495[_0x1876('0x30')]=_[_0x1876('0x31')](_0x2a6fce[_0x1876('0x30')]);_0x45b495[_0x1876('0x32')]=_['intersection'](_0x45b495[_0x1876('0x2f')],_0x45b495[_0x1876('0x30')]);_0x56a41f['attributes']=_[_0x1876('0x33')](_0x45b495[_0x1876('0x2f')],qs['fields'](_0x2a6fce['query'][_0x1876('0x34')]));_0x56a41f[_0x1876('0x35')]=_0x56a41f[_0x1876('0x35')][_0x1876('0x36')]?_0x56a41f[_0x1876('0x35')]:_0x45b495['model'];if(!_0x2a6fce['query'][_0x1876('0x37')](_0x1876('0x38'))){_0x56a41f[_0x1876('0x1f')]=qs[_0x1876('0x1f')](_0x2a6fce[_0x1876('0x30')]['limit']);_0x56a41f[_0x1876('0x1e')]=qs[_0x1876('0x1e')](_0x2a6fce[_0x1876('0x30')]['offset']);}_0x56a41f[_0x1876('0x39')]=qs['sort'](_0x2a6fce[_0x1876('0x30')][_0x1876('0x3a')]);_0x56a41f[_0x1876('0x3b')]=qs[_0x1876('0x32')](_[_0x1876('0x3c')](_0x2a6fce[_0x1876('0x30')],_0x45b495[_0x1876('0x32')]),_0x38d25e);if(_0x2a6fce[_0x1876('0x30')]['filter']){_0x56a41f['where']=_[_0x1876('0x3d')](_0x56a41f['where'],{'$or':_[_0x1876('0x29')](_0x38d25e,function(_0x91baf){if(_0x91baf[_0x1876('0x2d')]!==_0x1876('0x3e')){var _0x184353={};_0x184353[_0x91baf[_0x1876('0x26')]]={'$like':'%'+_0x2a6fce[_0x1876('0x30')][_0x1876('0x3f')]+'%'};return _0x184353;}})});}_0x56a41f=_[_0x1876('0x3d')]({},_0x56a41f,_0x2a6fce[_0x1876('0x40')]);var _0x5131db={'where':_0x56a41f['where']};return db[_0x1876('0x2a')][_0x1876('0x1d')](_0x5131db)[_0x1876('0x24')](function(_0x2d9b14){_0x127cd2['count']=_0x2d9b14;if(_0x2a6fce[_0x1876('0x30')][_0x1876('0x41')]){_0x56a41f[_0x1876('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x1876('0x43')](_0x56a41f);})['then'](function(_0x574db5){_0x127cd2['rows']=_0x574db5;return _0x127cd2;})['then'](respondWithFilteredResult(_0x1a9f1d,_0x56a41f))[_0x1876('0x44')](handleError(_0x1a9f1d,null));};exports[_0x1876('0x45')]=function(_0x6eb5d1,_0x360e02){var _0x1789cc={'raw':!![],'where':{'id':_0x6eb5d1[_0x1876('0x46')]['id']}},_0x254cef={};_0x254cef[_0x1876('0x2f')]=_[_0x1876('0x31')](db[_0x1876('0x2a')][_0x1876('0x2b')]);_0x254cef['query']=_[_0x1876('0x31')](_0x6eb5d1[_0x1876('0x30')]);_0x254cef[_0x1876('0x32')]=_[_0x1876('0x33')](_0x254cef[_0x1876('0x2f')],_0x254cef['query']);_0x1789cc[_0x1876('0x35')]=_[_0x1876('0x33')](_0x254cef[_0x1876('0x2f')],qs[_0x1876('0x34')](_0x6eb5d1[_0x1876('0x30')][_0x1876('0x34')]));_0x1789cc[_0x1876('0x35')]=_0x1789cc[_0x1876('0x35')][_0x1876('0x36')]?_0x1789cc[_0x1876('0x35')]:_0x254cef['model'];if(_0x6eb5d1[_0x1876('0x30')][_0x1876('0x41')]){_0x1789cc[_0x1876('0x42')]=[{'all':!![]}];}_0x1789cc=_[_0x1876('0x3d')]({},_0x1789cc,_0x6eb5d1['options']);return db[_0x1876('0x2a')][_0x1876('0x47')](_0x1789cc)[_0x1876('0x24')](handleEntityNotFound(_0x360e02,null))['then'](respondWithResult(_0x360e02,null))[_0x1876('0x44')](handleError(_0x360e02,null));};exports[_0x1876('0x48')]=function(_0x39b783,_0x25892e){return db['CmHopperHistory']['create'](_0x39b783[_0x1876('0x49')],{})[_0x1876('0x24')](respondWithResult(_0x25892e,0xc9))[_0x1876('0x44')](handleError(_0x25892e,null));};exports[_0x1876('0x4a')]=function(_0x279781,_0x23d607){return db[_0x1876('0x2a')][_0x1876('0x4a')]()['then'](respondWithResult(_0x23d607,null))[_0x1876('0x44')](handleError(_0x23d607,null));};exports[_0x1876('0x4b')]=function(_0x3b5f77,_0x9dba2a){if(_0x3b5f77['body']['uniqueid']){delete _0x3b5f77[_0x1876('0x49')]['uniqueid'];}return db[_0x1876('0x2a')]['find']({'where':{'uniqueid':_0x3b5f77[_0x1876('0x46')]['id']}})[_0x1876('0x24')](handleEntityNotFound(_0x9dba2a,null))[_0x1876('0x24')](saveUpdates(_0x3b5f77[_0x1876('0x49')],null))[_0x1876('0x24')](respondWithResult(_0x9dba2a,null))[_0x1876('0x44')](handleError(_0x9dba2a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index aae1ae7..1b74a73 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 _0xdbc6=['cm_hopper_history','endtime','uniqueid','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperHistory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x5d4e4f,_0x32cba9){_0x5d4e4f=_0x5d4e4f-0x0;var _0x25ff11=_0xdbc6[_0x5d4e4f];return _0x25ff11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6dbc('0x0'))('api');var moment=require(_0x6dbc('0x1'));var BPromise=require(_0x6dbc('0x2'));var rp=require(_0x6dbc('0x3'));var fs=require('fs');var path=require(_0x6dbc('0x4'));var rimraf=require(_0x6dbc('0x5'));var config=require(_0x6dbc('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0x6dbc('0x7')]=function(_0x434e1a,_0x5ebe85){return _0x434e1a[_0x6dbc('0x8')](_0x6dbc('0x9'),attributes,{'tableName':_0x6dbc('0xa'),'paranoid':![],'indexes':[{'name':_0x6dbc('0xb'),'fields':[_0x6dbc('0xb')]},{'name':'uniqueid','fields':[_0x6dbc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad40=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0xad40,0xfa));var _0x0ad4=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xad40[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0ad4('0x0'));var util=require(_0x0ad4('0x1'));var logger=require(_0x0ad4('0x2'))(_0x0ad4('0x3'));var moment=require('moment');var BPromise=require(_0x0ad4('0x4'));var rp=require(_0x0ad4('0x5'));var fs=require('fs');var path=require(_0x0ad4('0x6'));var rimraf=require(_0x0ad4('0x7'));var config=require(_0x0ad4('0x8'));var attributes=require(_0x0ad4('0x9'));module[_0x0ad4('0xa')]=function(_0x4ec948,_0x1a074c){return _0x4ec948[_0x0ad4('0xb')](_0x0ad4('0xc'),attributes,{'tableName':_0x0ad4('0xd'),'paranoid':![],'indexes':[{'name':_0x0ad4('0xe'),'fields':[_0x0ad4('0xe')]},{'name':_0x0ad4('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d3f7977..fbe9e09 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 _0x153f=['../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','catch','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x153f,0x15b));var _0xf153=function(_0x282440,_0x4f57fc){_0x282440=_0x282440-0x0;var _0x17272c=_0x153f[_0x282440];return _0x17272c;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});}exports[_0xf153('0x17')]=function(_0x138dbe){var _0x44272e=this;return new Promise(function(_0x4e790d,_0x357d57){return db[_0xf153('0x18')][_0xf153('0x19')](_0x138dbe[_0xf153('0x1a')],{'raw':_0x138dbe[_0xf153('0x1b')]?_0x138dbe[_0xf153('0x1b')][_0xf153('0x1c')]===undefined?!![]:![]:!![]})[_0xf153('0xd')](function(_0x3735a7){logger[_0xf153('0xe')](_0xf153('0x17'),_0x138dbe);logger[_0xf153('0x11')]('CreateCmHopperHistory',_0x138dbe,JSON[_0xf153('0x12')](_0x3735a7));_0x4e790d(_0x3735a7);})[_0xf153('0x1d')](function(_0x3d3e41){logger[_0xf153('0x13')](_0xf153('0x17'),_0x3d3e41[_0xf153('0x15')],_0x138dbe);_0x357d57(_0x44272e[_0xf153('0x13')](0x1f4,_0x3d3e41[_0xf153('0x15')]));});});};exports[_0xf153('0x1e')]=function(_0x38190c){var _0x1570fc=this;return new Promise(function(_0x39f3ed,_0x35cfe3){return db[_0xf153('0x18')][_0xf153('0x1f')]({'raw':_0x38190c[_0xf153('0x1b')]?_0x38190c[_0xf153('0x1b')][_0xf153('0x1c')]===undefined?!![]:![]:!![],'where':_0x38190c[_0xf153('0x1b')]?_0x38190c[_0xf153('0x1b')]['where']||null:null,'attributes':[[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db['sequelize'][_0xf153('0x22')]('id')),_0xf153('0x23')],[db['sequelize']['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x25')))),_0xf153('0x26')],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0xf153('0x28')],[db['sequelize']['fn']('AVG',db[_0xf153('0x20')]['fn']('IF',db['sequelize'][_0xf153('0x24')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xf153('0x29')],[db[_0xf153('0x20')]['fn']('AVG',db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x2a')))),_0xf153('0x2b')]]})[_0xf153('0xd')](function(_0x4ab69c){logger[_0xf153('0xe')]('AvgHandleTime',_0x38190c);logger[_0xf153('0x11')](_0xf153('0x1e'),_0x38190c,JSON[_0xf153('0x12')](_0x4ab69c));_0x39f3ed(_0x4ab69c);})[_0xf153('0x1d')](function(_0x274bcc){logger[_0xf153('0x13')]('AvgHandleTime',_0x274bcc[_0xf153('0x15')],_0x38190c);_0x35cfe3(_0x1570fc[_0xf153('0x13')](0x1f4,_0x274bcc[_0xf153('0x15')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x244172){var _0x17d60c=this;return new Promise(function(_0xd2a763,_0x254692){return db[_0xf153('0x18')][_0xf153('0x1f')]({'raw':_0x244172['options']?_0x244172[_0xf153('0x1b')][_0xf153('0x1c')]===undefined?!![]:![]:!![],'where':_0x244172['options']?_0x244172[_0xf153('0x1b')][_0xf153('0x2c')]||null:null,'attributes':[[_0xf153('0x2d'),_0xf153('0x2e')],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db['sequelize'][_0xf153('0x24')](_0xf153('0x2f')))),_0xf153('0x30')],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db['sequelize']['literal'](_0xf153('0x31')))),'outboundNoAnswerCallsDay'],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x25')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db['sequelize'][_0xf153('0x24')](_0xf153('0x32')))),_0xf153('0x33')],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x34')))),_0xf153('0x35')],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db['sequelize']['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x36')))),'outboundDropCallsDayTimeout'],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db['sequelize']['fn']('IF',db[_0xf153('0x20')]['literal'](_0xf153('0x37')))),_0xf153('0x38')],[db[_0xf153('0x20')]['fn']('COUNT',db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x39')))),_0xf153('0x3a')],[db['sequelize']['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db['sequelize'][_0xf153('0x24')](_0xf153('0x3b')))),_0xf153('0x3c')],[db['sequelize']['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x3d')))),_0xf153('0x3e')],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db['sequelize'][_0xf153('0x24')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db['sequelize'][_0xf153('0x24')](_0xf153('0x3f')))),'outboundAnswerAgiCallsDay'],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x40')))),'outboundRejectCallsDay'],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0xf153('0x24')](_0xf153('0x41')))),_0xf153('0x42')]],'group':[_0xf153('0x2d')]})[_0xf153('0xd')](function(_0x1e1c33){logger['info'](_0xf153('0x43'),_0x244172);logger['debug'](_0xf153('0x43'),_0x244172,JSON[_0xf153('0x12')](_0x1e1c33));_0xd2a763(_0x1e1c33);})[_0xf153('0x1d')](function(_0x5cc697){logger[_0xf153('0x13')](_0xf153('0x43'),_0x5cc697[_0xf153('0x15')],_0x244172);_0x254692(_0x17d60c[_0xf153('0x13')](0x1f4,_0x5cc697[_0xf153('0x15')]));});});};exports[_0xf153('0x44')]=function(_0x17f594){var _0x49b1f8=this;return new Promise(function(_0x84e55,_0x150892){return db[_0xf153('0x18')]['findAll']({'raw':_0x17f594[_0xf153('0x1b')]?_0x17f594[_0xf153('0x1b')][_0xf153('0x1c')]===undefined?!![]:![]:!![],'where':_0x17f594[_0xf153('0x1b')]?_0x17f594[_0xf153('0x1b')][_0xf153('0x2c')]||null:null,'attributes':[[_0xf153('0x2d'),_0xf153('0x2e')],[db['sequelize']['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['col']('id')),_0xf153('0x45')],[db[_0xf153('0x20')]['fn'](_0xf153('0x21'),db[_0xf153('0x20')]['fn']('IF',db[_0xf153('0x20')][_0xf153('0x24')](_0xf153('0x25')))),_0xf153('0x46')]],'group':[_0xf153('0x2d')]})[_0xf153('0xd')](function(_0xca7bec){logger['info'](_0xf153('0x44'),_0x17f594);logger[_0xf153('0x11')]('GetCampaignHopperHistory',_0x17f594,JSON[_0xf153('0x12')](_0xca7bec));_0x84e55(_0xca7bec);})[_0xf153('0x1d')](function(_0x249cd6){logger[_0xf153('0x13')](_0xf153('0x44'),_0x249cd6[_0xf153('0x15')],_0x17f594);_0x150892(_0x49b1f8[_0xf153('0x13')](0x1f4,_0x249cd6['message']));});});}; \ No newline at end of file +var _0x7daf=['`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`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','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','code','error','message','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','catch','findAll','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','name'];(function(_0x48cf9f,_0x22c0bb){var _0x4166d4=function(_0x336c9c){while(--_0x336c9c){_0x48cf9f['push'](_0x48cf9f['shift']());}};_0x4166d4(++_0x22c0bb);}(_0x7daf,0xaa));var _0xf7da=function(_0x22422c,_0x239a7d){_0x22422c=_0x22422c-0x0;var _0x39be5c=_0x7daf[_0x22422c];return _0x39be5c;};'use strict';var _=require('lodash');var util=require(_0xf7da('0x0'));var moment=require('moment');var BPromise=require(_0xf7da('0x1'));var rs=require(_0xf7da('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7da('0x3'))['db'];var utils=require(_0xf7da('0x4'));var logger=require(_0xf7da('0x5'))(_0xf7da('0x6'));var config=require(_0xf7da('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf7da('0x8')][_0xf7da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b35ec,_0x110cad,_0x2c70ad){return new BPromise(function(_0x468ca3,_0x53d71f){return client[_0xf7da('0xa')](_0x1b35ec,_0x2c70ad)[_0xf7da('0xb')](function(_0x326ff5){logger[_0xf7da('0xc')](_0xf7da('0xd'),_0x110cad,_0xf7da('0xe'));logger[_0xf7da('0xf')](_0xf7da('0x10'),_0x110cad,_0xf7da('0xe'),JSON[_0xf7da('0x11')](_0x326ff5));if(_0x326ff5['error']){if(_0x326ff5['error'][_0xf7da('0x12')]===0x1f4){logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x326ff5[_0xf7da('0x13')][_0xf7da('0x14')]);return _0x53d71f(_0x326ff5[_0xf7da('0x13')]['message']);}logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x326ff5['error'][_0xf7da('0x14')]);return _0x468ca3(_0x326ff5[_0xf7da('0x13')][_0xf7da('0x14')]);}else{logger[_0xf7da('0xc')](_0xf7da('0xd'),_0x110cad,_0xf7da('0xe'));_0x468ca3(_0x326ff5['result']['message']);}})['catch'](function(_0x39d9c0){logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x39d9c0);_0x53d71f(_0x39d9c0);});});}exports[_0xf7da('0x15')]=function(_0x336fca){var _0x1f3d53=this;return new Promise(function(_0xb75a2c,_0x13cd4a){return db[_0xf7da('0x16')][_0xf7da('0x17')](_0x336fca[_0xf7da('0x18')],{'raw':_0x336fca[_0xf7da('0x19')]?_0x336fca[_0xf7da('0x19')][_0xf7da('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3f5f58){logger[_0xf7da('0xc')](_0xf7da('0x15'),_0x336fca);logger[_0xf7da('0xf')](_0xf7da('0x15'),_0x336fca,JSON[_0xf7da('0x11')](_0x3f5f58));_0xb75a2c(_0x3f5f58);})[_0xf7da('0x1b')](function(_0x35ac94){logger[_0xf7da('0x13')]('CreateCmHopperHistory',_0x35ac94[_0xf7da('0x14')],_0x336fca);_0x13cd4a(_0x1f3d53[_0xf7da('0x13')](0x1f4,_0x35ac94[_0xf7da('0x14')]));});});};exports['AvgHandleTime']=function(_0x3bf5d1){var _0x1e3d68=this;return new Promise(function(_0xd18ee6,_0x4630ae){return db[_0xf7da('0x16')][_0xf7da('0x1c')]({'raw':_0x3bf5d1['options']?_0x3bf5d1[_0xf7da('0x19')][_0xf7da('0x1a')]===undefined?!![]:![]:!![],'where':_0x3bf5d1[_0xf7da('0x19')]?_0x3bf5d1['options'][_0xf7da('0x1d')]||null:null,'attributes':[[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')][_0xf7da('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0xf7da('0x1e')]['fn']('COUNT',db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x23')))),_0xf7da('0x24')],[db[_0xf7da('0x1e')]['fn']('COUNT',db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x25')))),_0xf7da('0x26')],[db['sequelize']['fn'](_0xf7da('0x27'),db[_0xf7da('0x1e')]['fn']('IF',db['sequelize'][_0xf7da('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xf7da('0x28')],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x27'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xf7da('0x29')]]})[_0xf7da('0xb')](function(_0x46bb35){logger['info']('AvgHandleTime',_0x3bf5d1);logger[_0xf7da('0xf')]('AvgHandleTime',_0x3bf5d1,JSON['stringify'](_0x46bb35));_0xd18ee6(_0x46bb35);})['catch'](function(_0x4fb928){logger[_0xf7da('0x13')]('AvgHandleTime',_0x4fb928[_0xf7da('0x14')],_0x3bf5d1);_0x4630ae(_0x1e3d68['error'](0x1f4,_0x4fb928[_0xf7da('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x1db7a4){var _0x4f032c=this;return new Promise(function(_0x2f2eea,_0x281fd4){return db[_0xf7da('0x16')]['findAll']({'raw':_0x1db7a4[_0xf7da('0x19')]?_0x1db7a4[_0xf7da('0x19')][_0xf7da('0x1a')]===undefined?!![]:![]:!![],'where':_0x1db7a4[_0xf7da('0x19')]?_0x1db7a4[_0xf7da('0x19')][_0xf7da('0x1d')]||null:null,'attributes':[['campaign',_0xf7da('0x2a')],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')]['literal'](_0xf7da('0x2b')))),_0xf7da('0x2c')],[db[_0xf7da('0x1e')]['fn']('COUNT',db[_0xf7da('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xf7da('0x2d')],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x22')))),_0xf7da('0x2e')],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x2f')))),_0xf7da('0x30')],[db['sequelize']['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db['sequelize'][_0xf7da('0x21')](_0xf7da('0x31')))),_0xf7da('0x32')],[db[_0xf7da('0x1e')]['fn']('COUNT',db[_0xf7da('0x1e')]['fn']('IF',db['sequelize'][_0xf7da('0x21')](_0xf7da('0x33')))),_0xf7da('0x34')],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x35')))),_0xf7da('0x36')],[db['sequelize']['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db['sequelize'][_0xf7da('0x21')](_0xf7da('0x37')))),_0xf7da('0x38')],[db[_0xf7da('0x1e')]['fn']('COUNT',db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x39')))),_0xf7da('0x3a')],[db['sequelize']['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x3b')))),_0xf7da('0x3c')],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x3d')))),'outboundRejectCallsDay'],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db['sequelize']['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x3e')))),'outboundAnswerAgiCallsDay'],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x3f')))),_0xf7da('0x40')],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x41')))),_0xf7da('0x42')]],'group':['campaign']})[_0xf7da('0xb')](function(_0x6a3b1f){logger[_0xf7da('0xc')](_0xf7da('0x43'),_0x1db7a4);logger[_0xf7da('0xf')]('GetVoiceQueueHopperHistory',_0x1db7a4,JSON[_0xf7da('0x11')](_0x6a3b1f));_0x2f2eea(_0x6a3b1f);})[_0xf7da('0x1b')](function(_0x1da66e){logger['error'](_0xf7da('0x43'),_0x1da66e[_0xf7da('0x14')],_0x1db7a4);_0x281fd4(_0x4f032c['error'](0x1f4,_0x1da66e['message']));});});};exports[_0xf7da('0x44')]=function(_0x503f06){var _0x2893fc=this;return new Promise(function(_0x4b7168,_0x5545bf){return db[_0xf7da('0x16')][_0xf7da('0x1c')]({'raw':_0x503f06[_0xf7da('0x19')]?_0x503f06[_0xf7da('0x19')][_0xf7da('0x1a')]===undefined?!![]:![]:!![],'where':_0x503f06[_0xf7da('0x19')]?_0x503f06[_0xf7da('0x19')][_0xf7da('0x1d')]||null:null,'attributes':[['campaign',_0xf7da('0x2a')],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db[_0xf7da('0x1e')]['col']('id')),_0xf7da('0x45')],[db[_0xf7da('0x1e')]['fn'](_0xf7da('0x1f'),db['sequelize']['fn']('IF',db[_0xf7da('0x1e')][_0xf7da('0x21')](_0xf7da('0x22')))),_0xf7da('0x46')]],'group':['campaign']})[_0xf7da('0xb')](function(_0x348bf2){logger[_0xf7da('0xc')](_0xf7da('0x44'),_0x503f06);logger['debug']('GetCampaignHopperHistory',_0x503f06,JSON[_0xf7da('0x11')](_0x348bf2));_0x4b7168(_0x348bf2);})['catch'](function(_0x5cc83a){logger[_0xf7da('0x13')](_0xf7da('0x44'),_0x5cc83a[_0xf7da('0x14')],_0x503f06);_0x5545bf(_0x2893fc[_0xf7da('0x13')](0x1f4,_0x5cc83a['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 1051c00..415a197 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 _0xc98e=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','get','post','create','put','/:id','update','exports','multer'];(function(_0x317afc,_0xc51135){var _0x28d22a=function(_0x31356b){while(--_0x31356b){_0x317afc['push'](_0x317afc['shift']());}};_0x28d22a(++_0xc51135);}(_0xc98e,0x6b));var _0xec98=function(_0x148e95,_0x379c15){_0x148e95=_0x148e95-0x0;var _0x343521=_0xc98e[_0x148e95];return _0x343521;};'use strict';var multer=require(_0xec98('0x0'));var util=require(_0xec98('0x1'));var path=require('path');var timeout=require(_0xec98('0x2'));var express=require(_0xec98('0x3'));var router=express[_0xec98('0x4')]();var fs_extra=require(_0xec98('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xec98('0x6'));var config=require(_0xec98('0x7'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0xec98('0x8')](),controller[_0xec98('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xec98('0xa')]);router[_0xec98('0xb')]('/:id',auth[_0xec98('0x8')](),controller['show']);router[_0xec98('0xc')]('/',auth[_0xec98('0x8')](),controller[_0xec98('0xd')]);router[_0xec98('0xe')](_0xec98('0xf'),auth[_0xec98('0x8')](),controller[_0xec98('0x10')]);module[_0xec98('0x11')]=router; \ No newline at end of file +var _0xca75=['fs-extra','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x11f0fe,_0x3862a3){var _0x2eefff=function(_0x6546de){while(--_0x6546de){_0x11f0fe['push'](_0x11f0fe['shift']());}};_0x2eefff(++_0x3862a3);}(_0xca75,0x13b));var _0x5ca7=function(_0x313a00,_0x107929){_0x313a00=_0x313a00-0x0;var _0x46d07b=_0xca75[_0x313a00];return _0x46d07b;};'use strict';var multer=require(_0x5ca7('0x0'));var util=require(_0x5ca7('0x1'));var path=require(_0x5ca7('0x2'));var timeout=require(_0x5ca7('0x3'));var express=require('express');var router=express[_0x5ca7('0x4')]();var fs_extra=require(_0x5ca7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5ca7('0x6'));var controller=require(_0x5ca7('0x7'));router['get']('/',auth[_0x5ca7('0x8')](),controller[_0x5ca7('0x9')]);router[_0x5ca7('0xa')](_0x5ca7('0xb'),auth[_0x5ca7('0x8')](),controller[_0x5ca7('0xc')]);router[_0x5ca7('0xa')]('/:id',auth[_0x5ca7('0x8')](),controller[_0x5ca7('0xd')]);router[_0x5ca7('0xe')]('/',auth[_0x5ca7('0x8')](),controller[_0x5ca7('0xf')]);router[_0x5ca7('0x10')](_0x5ca7('0x11'),auth[_0x5ca7('0x8')](),controller[_0x5ca7('0x12')]);module[_0x5ca7('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index c2f63c7..1b7086a 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 _0xd6d6=['STRING','name','sequelize','exports'];(function(_0x4f80ec,_0x422f5b){var _0x5147d6=function(_0x162fce){while(--_0x162fce){_0x4f80ec['push'](_0x4f80ec['shift']());}};_0x5147d6(++_0x422f5b);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x58eaad,_0x4f7774){_0x58eaad=_0x58eaad-0x0;var _0x5fd9d1=_0xd6d6[_0x58eaad];return _0x5fd9d1;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'name':{'type':Sequelize[_0x6d6d('0x2')],'unique':_0x6d6d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x6d6d('0x2')]}}; \ No newline at end of file +var _0x43fd=['exports','STRING'];(function(_0x3c1bf0,_0x296b93){var _0x522947=function(_0x4c7e95){while(--_0x4c7e95){_0x3c1bf0['push'](_0x3c1bf0['shift']());}};_0x522947(++_0x296b93);}(_0x43fd,0x1ec));var _0xd43f=function(_0x50556d,_0x45c38e){_0x50556d=_0x50556d-0x0;var _0x5d92c=_0x43fd[_0x50556d];return _0x5d92c;};'use strict';var Sequelize=require('sequelize');module[_0xd43f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd43f('0x1')]},'dialPrefix':{'type':Sequelize[_0xd43f('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index a490987..60d7e89 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 _0x4321=['User','getAgents','info','eml-format','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','localhost','redis','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','Lists','destroy','end','error','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','merge','VIRTUAL','filter','options','CmList','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','sort','pick','removeDispositions','ids','addContacts','tags','isArray','each','CmContact','omit','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','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','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','download','addCustomField','sequelize','CmCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','cm_contacts','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents'];(function(_0x502b93,_0x25b04b){var _0x337691=function(_0x4b16e1){while(--_0x4b16e1){_0x502b93['push'](_0x502b93['shift']());}};_0x337691(++_0x25b04b);}(_0x4321,0x13d));var _0x1432=function(_0x3f1a86,_0x1f0dcc){_0x3f1a86=_0x3f1a86-0x0;var _0x518844=_0x4321[_0x3f1a86];return _0x518844;};'use strict';var emlformat=require(_0x1432('0x0'));var rimraf=require(_0x1432('0x1'));var zipdir=require(_0x1432('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1432('0x3'));var moment=require(_0x1432('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1432('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1432('0x6'));var ejs=require(_0x1432('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1432('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x1432('0x9'));var toCsv=require(_0x1432('0x6'));var querystring=require('querystring');var Papa=require(_0x1432('0xa'));var Redis=require(_0x1432('0xb'));var authService=require(_0x1432('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x1432('0xd'));var hardwareService=require(_0x1432('0xe'));var logger=require('../../config/logger')(_0x1432('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1432('0x10'));var db=require(_0x1432('0x11'))['db'];var csv_results;config['redis']=_[_0x1432('0x12')](config['redis'],{'host':_0x1432('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1432('0x14')]));require(_0x1432('0x15'))[_0x1432('0x16')](socket);function respondWithStatusCode(_0x4a9973,_0x557e20){_0x557e20=_0x557e20||0xcc;return function(_0x5ada0d){if(_0x5ada0d){return _0x4a9973[_0x1432('0x17')](_0x557e20);}return _0x4a9973[_0x1432('0x18')](_0x557e20)['end']();};}function respondWithResult(_0xcd826f,_0x33c43b){_0x33c43b=_0x33c43b||0xc8;return function(_0xa7bf6a){if(_0xa7bf6a){return _0xcd826f['status'](_0x33c43b)[_0x1432('0x19')](_0xa7bf6a);}};}function respondWithFilteredResult(_0x3f6a5d,_0x169742){return function(_0x13dc6){if(_0x13dc6){var _0x26a552=typeof _0x169742[_0x1432('0x1a')]===_0x1432('0x1b')&&typeof _0x169742[_0x1432('0x1c')]===_0x1432('0x1b');var _0x2cf899=_0x13dc6[_0x1432('0x1d')];var _0x126bbd=_0x26a552?0x0:_0x169742['offset'];var _0x142f91=_0x26a552?_0x13dc6[_0x1432('0x1d')]:_0x169742[_0x1432('0x1a')]+_0x169742[_0x1432('0x1c')];var _0x2208b2;if(_0x142f91>=_0x2cf899){_0x142f91=_0x2cf899;_0x2208b2=0xc8;}else{_0x2208b2=0xce;}_0x3f6a5d[_0x1432('0x18')](_0x2208b2);return _0x3f6a5d['set'](_0x1432('0x1e'),_0x126bbd+'-'+_0x142f91+'/'+_0x2cf899)[_0x1432('0x19')](_0x13dc6);}return null;};}function patchUpdates(_0x482914){return function(_0x1c71ed){try{jsonpatch[_0x1432('0x1f')](_0x1c71ed,_0x482914,!![]);}catch(_0x190fca){return BPromise[_0x1432('0x20')](_0x190fca);}return _0x1c71ed[_0x1432('0x21')]();};}function saveUpdates(_0xa1c73a,_0x25f468){return function(_0x5dc41c){if(_0x5dc41c){return _0x5dc41c['update'](_0xa1c73a)[_0x1432('0x22')](function(_0x469505){return _0x469505;});}return null;};}function removeEntity(_0x3aefb1,_0x75b796){return function(_0xb84d31){if(_0xb84d31){return _0xb84d31['destroy']()['then'](function(){var _0x26197f=_0xb84d31[_0x1432('0x23')]({'plain':!![]});var _0x3c76ca=_0x1432('0x24');return db['UserProfileResource'][_0x1432('0x25')]({'where':{'type':_0x3c76ca,'resourceId':_0x26197f['id']}})[_0x1432('0x22')](function(){return _0xb84d31;});})[_0x1432('0x22')](function(){_0x3aefb1['status'](0xcc)[_0x1432('0x26')]();});}};}function handleEntityNotFound(_0x3212c4,_0x3c24eb){return function(_0x477cbd){if(!_0x477cbd){_0x3212c4[_0x1432('0x17')](0x194);}return _0x477cbd;};}function handleError(_0x49ff25,_0x42128e){_0x42128e=_0x42128e||0x1f4;return function(_0x59046f){logger[_0x1432('0x27')](_0x59046f['stack']);if(_0x59046f[_0x1432('0x28')]){delete _0x59046f['name'];}_0x49ff25[_0x1432('0x18')](_0x42128e)[_0x1432('0x29')](_0x59046f);};}exports[_0x1432('0x2a')]=function(_0x353a3d,_0x398f57){var _0x497a6b={},_0x527241={},_0x391a3c={'count':0x0,'rows':[]};var _0x3175d2=_[_0x1432('0x2b')](db['CmList'][_0x1432('0x2c')],function(_0x174786){return{'name':_0x174786['fieldName'],'type':_0x174786[_0x1432('0x2d')][_0x1432('0x2e')]};});_0x527241[_0x1432('0x2f')]=_['map'](_0x3175d2,_0x1432('0x28'));_0x527241['query']=_['keys'](_0x353a3d[_0x1432('0x30')]);_0x527241['filters']=_[_0x1432('0x31')](_0x527241[_0x1432('0x2f')],_0x527241[_0x1432('0x30')]);_0x497a6b[_0x1432('0x32')]=_[_0x1432('0x31')](_0x527241[_0x1432('0x2f')],qs[_0x1432('0x33')](_0x353a3d[_0x1432('0x30')]['fields']));_0x497a6b[_0x1432('0x32')]=_0x497a6b[_0x1432('0x32')][_0x1432('0x34')]?_0x497a6b[_0x1432('0x32')]:_0x527241[_0x1432('0x2f')];if(!_0x353a3d[_0x1432('0x30')][_0x1432('0x35')]('nolimit')){_0x497a6b['limit']=qs[_0x1432('0x1c')](_0x353a3d[_0x1432('0x30')][_0x1432('0x1c')]);_0x497a6b[_0x1432('0x1a')]=qs[_0x1432('0x1a')](_0x353a3d[_0x1432('0x30')][_0x1432('0x1a')]);}_0x497a6b[_0x1432('0x36')]=qs['sort'](_0x353a3d[_0x1432('0x30')]['sort']);_0x497a6b[_0x1432('0x37')]=qs[_0x1432('0x38')](_['pick'](_0x353a3d[_0x1432('0x30')],_0x527241['filters']),_0x3175d2);if(_0x353a3d['query']['filter']){_0x497a6b[_0x1432('0x37')]=_[_0x1432('0x39')](_0x497a6b[_0x1432('0x37')],{'$or':_[_0x1432('0x2b')](_0x3175d2,function(_0x5367cb){if(_0x5367cb[_0x1432('0x2d')]!==_0x1432('0x3a')){var _0x33e6e6={};_0x33e6e6[_0x5367cb[_0x1432('0x28')]]={'$like':'%'+_0x353a3d['query'][_0x1432('0x3b')]+'%'};return _0x33e6e6;}})});}_0x497a6b=_[_0x1432('0x39')]({},_0x497a6b,_0x353a3d[_0x1432('0x3c')]);var _0x5dd679={'where':_0x497a6b[_0x1432('0x37')]};return db[_0x1432('0x3d')][_0x1432('0x1d')](_0x5dd679)[_0x1432('0x22')](function(_0xda864d){_0x391a3c[_0x1432('0x1d')]=_0xda864d;if(_0x353a3d['query'][_0x1432('0x3e')]){_0x497a6b[_0x1432('0x3f')]=[{'all':!![]}];}return db[_0x1432('0x3d')][_0x1432('0x40')](_0x497a6b);})[_0x1432('0x22')](function(_0x11e6dc){_0x391a3c[_0x1432('0x41')]=_0x11e6dc;return _0x391a3c;})[_0x1432('0x22')](respondWithFilteredResult(_0x398f57,_0x497a6b))[_0x1432('0x42')](handleError(_0x398f57,null));};exports[_0x1432('0x43')]=function(_0x66726c,_0x1d7eae){var _0x1e6639={'raw':![],'where':{'id':_0x66726c['params']['id']}},_0x2525d2={};_0x2525d2[_0x1432('0x2f')]=_['keys'](db['CmList'][_0x1432('0x2c')]);_0x2525d2['query']=_[_0x1432('0x44')](_0x66726c[_0x1432('0x30')]);_0x2525d2['filters']=_[_0x1432('0x31')](_0x2525d2[_0x1432('0x2f')],_0x2525d2['query']);_0x1e6639[_0x1432('0x32')]=_[_0x1432('0x31')](_0x2525d2[_0x1432('0x2f')],qs[_0x1432('0x33')](_0x66726c[_0x1432('0x30')][_0x1432('0x33')]));_0x1e6639[_0x1432('0x32')]=_0x1e6639[_0x1432('0x32')][_0x1432('0x34')]?_0x1e6639[_0x1432('0x32')]:_0x2525d2['model'];if(_0x66726c['query'][_0x1432('0x3e')]){_0x1e6639[_0x1432('0x3f')]=[{'all':!![]}];}_0x1e6639=_[_0x1432('0x39')]({},_0x1e6639,_0x66726c[_0x1432('0x3c')]);return db[_0x1432('0x3d')][_0x1432('0x45')](_0x1e6639)[_0x1432('0x22')](handleEntityNotFound(_0x1d7eae,null))['then'](respondWithResult(_0x1d7eae,null))[_0x1432('0x42')](handleError(_0x1d7eae,null));};exports['create']=function(_0x907fbb,_0x5bb6db){return db[_0x1432('0x3d')][_0x1432('0x46')](_0x907fbb[_0x1432('0x47')],{})['then'](function(_0x50ebfd){var _0x34f244=_0x907fbb[_0x1432('0x48')][_0x1432('0x23')]({'plain':!![]});if(!_0x34f244)throw new Error(_0x1432('0x49'));if(_0x34f244[_0x1432('0x4a')]===_0x1432('0x48')){var _0x3f882f=_0x50ebfd[_0x1432('0x23')]({'plain':!![]});var _0x395631=_0x1432('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x395631,'userProfileId':_0x34f244[_0x1432('0x4b')]},'raw':!![]})[_0x1432('0x22')](function(_0x4395c0){if(_0x4395c0&&_0x4395c0[_0x1432('0x4c')]===0x0){return db[_0x1432('0x4d')][_0x1432('0x46')]({'name':_0x3f882f[_0x1432('0x28')],'resourceId':_0x3f882f['id'],'type':_0x4395c0['name'],'sectionId':_0x4395c0['id']},{})[_0x1432('0x22')](function(){return _0x50ebfd;});}else{return _0x50ebfd;}})[_0x1432('0x42')](function(_0x12e7c2){logger[_0x1432('0x27')](_0x1432('0x4e'),_0x12e7c2);throw _0x12e7c2;});}return _0x50ebfd;})[_0x1432('0x22')](respondWithResult(_0x5bb6db,0xc9))['catch'](handleError(_0x5bb6db,null));};exports['update']=function(_0x117b76,_0x2f970f){if(_0x117b76['body']['id']){delete _0x117b76[_0x1432('0x47')]['id'];}return db[_0x1432('0x3d')]['find']({'where':{'id':_0x117b76['params']['id']}})['then'](handleEntityNotFound(_0x2f970f,null))[_0x1432('0x22')](saveUpdates(_0x117b76[_0x1432('0x47')],null))[_0x1432('0x22')](respondWithResult(_0x2f970f,null))[_0x1432('0x42')](handleError(_0x2f970f,null));};exports[_0x1432('0x25')]=function(_0x2c1550,_0x184dfe){return db[_0x1432('0x3d')][_0x1432('0x45')]({'where':{'id':_0x2c1550[_0x1432('0x4f')]['id']}})[_0x1432('0x22')](handleEntityNotFound(_0x184dfe,null))[_0x1432('0x22')](removeEntity(_0x184dfe,null))[_0x1432('0x42')](handleError(_0x184dfe,null));};exports['describe']=function(_0x262730,_0x47c4fe){return db['CmList'][_0x1432('0x50')]()[_0x1432('0x22')](respondWithResult(_0x47c4fe,null))['catch'](handleError(_0x47c4fe,null));};exports[_0x1432('0x51')]=function(_0x27bc8d,_0x2bdc25,_0x1ec924){if(_0x27bc8d['body']['id']){delete _0x27bc8d[_0x1432('0x47')]['id'];}return db[_0x1432('0x3d')]['find']({'where':{'id':_0x27bc8d['params']['id']}})['then'](handleEntityNotFound(_0x2bdc25,null))[_0x1432('0x22')](function(_0x32c5f0){if(_0x32c5f0){_0x27bc8d['body'][_0x1432('0x52')]=_0x32c5f0['id'];return db[_0x1432('0x53')][_0x1432('0x46')](_0x27bc8d[_0x1432('0x47')]);}})[_0x1432('0x22')](respondWithResult(_0x2bdc25,null))[_0x1432('0x42')](handleError(_0x2bdc25,null));};exports[_0x1432('0x54')]=function(_0x23c04a,_0x3ee5f6,_0x271941){var _0x394711={'raw':![],'where':{}};var _0x3b7bb8={};var _0x1fbe0e={'count':0x0,'rows':[]};return db[_0x1432('0x3d')][_0x1432('0x55')]({'where':{'id':_0x23c04a[_0x1432('0x4f')]['id']}})[_0x1432('0x22')](handleEntityNotFound(_0x3ee5f6,null))[_0x1432('0x22')](function(_0x49fd01){if(_0x49fd01){_0x3b7bb8['model']=_[_0x1432('0x44')](db[_0x1432('0x53')][_0x1432('0x2c')]);_0x3b7bb8[_0x1432('0x30')]=_[_0x1432('0x44')](_0x23c04a[_0x1432('0x30')]);_0x3b7bb8[_0x1432('0x38')]=_['intersection'](_0x3b7bb8[_0x1432('0x2f')],_0x3b7bb8[_0x1432('0x30')]);_0x394711[_0x1432('0x32')]=_[_0x1432('0x31')](_0x3b7bb8[_0x1432('0x2f')],qs[_0x1432('0x33')](_0x23c04a[_0x1432('0x30')]['fields']));_0x394711['attributes']=_0x394711[_0x1432('0x32')]['length']?_0x394711[_0x1432('0x32')]:_0x3b7bb8[_0x1432('0x2f')];if(!_0x23c04a[_0x1432('0x30')]['hasOwnProperty'](_0x1432('0x56'))){_0x394711[_0x1432('0x1c')]=qs[_0x1432('0x1c')](_0x23c04a[_0x1432('0x30')][_0x1432('0x1c')]);_0x394711[_0x1432('0x1a')]=qs[_0x1432('0x1a')](_0x23c04a[_0x1432('0x30')][_0x1432('0x1a')]);}_0x394711['order']=qs[_0x1432('0x57')](_0x23c04a['query'][_0x1432('0x57')]);_0x394711['where']=qs[_0x1432('0x38')](_[_0x1432('0x58')](_0x23c04a[_0x1432('0x30')],_0x3b7bb8[_0x1432('0x38')]));_0x394711[_0x1432('0x37')][_0x1432('0x52')]=_0x49fd01['id'];if(_0x23c04a[_0x1432('0x30')]['filter']){_0x394711['where']=_[_0x1432('0x39')](_0x394711[_0x1432('0x37')],{'$or':_[_0x1432('0x2b')](_0x394711[_0x1432('0x32')],function(_0xc39784){var _0x4da697={};_0x4da697[_0xc39784]={'$like':'%'+_0x23c04a[_0x1432('0x30')][_0x1432('0x3b')]+'%'};return _0x4da697;})});}_0x394711=_['merge']({},_0x394711,_0x23c04a['options']);return db[_0x1432('0x53')][_0x1432('0x1d')]({'where':_0x394711['where']})[_0x1432('0x22')](function(_0x33b6e3){_0x1fbe0e[_0x1432('0x1d')]=_0x33b6e3;if(_0x23c04a[_0x1432('0x30')][_0x1432('0x3e')]){_0x394711['include']=[{'all':!![]}];}return db['Disposition'][_0x1432('0x40')](_0x394711);})['then'](function(_0x57958b){_0x1fbe0e[_0x1432('0x41')]=_0x57958b;return _0x1fbe0e;});}})[_0x1432('0x22')](respondWithFilteredResult(_0x3ee5f6,_0x394711))['catch'](handleError(_0x3ee5f6,null));};exports[_0x1432('0x59')]=function(_0x8252c3,_0x1124a2,_0x5729ab){return db[_0x1432('0x3d')][_0x1432('0x45')]({'where':{'id':_0x8252c3['params']['id']}})[_0x1432('0x22')](handleEntityNotFound(_0x1124a2,null))['then'](function(_0x320d36){if(_0x320d36){return _0x320d36[_0x1432('0x59')](_0x8252c3[_0x1432('0x30')][_0x1432('0x5a')]);}})[_0x1432('0x22')](respondWithStatusCode(_0x1124a2,null))['catch'](handleError(_0x1124a2,null));};exports[_0x1432('0x5b')]=function(_0x362ab1,_0x185f8e,_0x4db5eb){return db[_0x1432('0x3d')][_0x1432('0x45')]({'where':{'id':_0x362ab1[_0x1432('0x4f')]['id']}})[_0x1432('0x22')](handleEntityNotFound(_0x185f8e,null))['then'](function(_0xc7e25e){if(_0xc7e25e){var _0x343cbc=[];var _0x275161={'success':[],'errors':[]};return db['CmContact'][_0x1432('0x50')]()[_0x1432('0x22')](function(_0x1e3259){if(_0x362ab1[_0x1432('0x47')][_0x1432('0x5c')]&&_[_0x1432('0x5d')](_0x362ab1[_0x1432('0x47')][_0x1432('0x5c')])){if(_0x362ab1['body'][_0x1432('0x5c')][_0x1432('0x34')]){_0x362ab1['body']['tags']=_0x362ab1[_0x1432('0x47')][_0x1432('0x5c')]['join'](';')+';';}else{_0x362ab1['body'][_0x1432('0x5c')]=null;}}else{_0x362ab1[_0x1432('0x47')][_0x1432('0x5c')]=null;}if(_0x362ab1[_0x1432('0x47')]&&_[_0x1432('0x5d')](_0x362ab1[_0x1432('0x47')])){for(var _0x16eab1=0x0;_0x16eab1<_0x362ab1[_0x1432('0x47')]['length'];_0x16eab1+=0x1){_0x362ab1[_0x1432('0x47')][_0x16eab1][_0x1432('0x52')]=_0x362ab1['params']['id'];_0x343cbc['push'](_0x362ab1[_0x1432('0x47')][_0x16eab1]);}return BPromise[_0x1432('0x5e')](_0x343cbc,function(_0x100aca){return db[_0x1432('0x5f')][_0x1432('0x46')](_[_0x1432('0x60')](_0x100aca,['ids','id'])||{},{'fields':_['keys'](_0x1e3259),'raw':!![]})['then'](function(_0x116229){_0x275161['success'][_0x1432('0x61')](_0x116229[_0x1432('0x62')]);})[_0x1432('0x42')](function(_0x1c5fc2){_0x275161[_0x1432('0x63')][_0x1432('0x61')]({'data':_0x100aca,'error':_0x1c5fc2[_0x1432('0x64')]});});})[_0x1432('0x22')](function(_0x14f0c3){return _0x275161;})[_0x1432('0x42')](function(_0xcbc846){return _0xcbc846;});}else{_0x185f8e[_0x1432('0x18')](0x190)['json']({'message':_0x1432('0x65')});}});}})[_0x1432('0x22')](respondWithResult(_0x185f8e,null))[_0x1432('0x42')](handleError(_0x185f8e,null));};exports[_0x1432('0x66')]=function(_0x51d93f,_0x402a5c,_0x17b4e0){var _0x3e4010;return db[_0x1432('0x3d')][_0x1432('0x45')]({'where':{'id':_0x51d93f[_0x1432('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x1432('0x67')}]})[_0x1432('0x22')](handleEntityNotFound(_0x402a5c,null))[_0x1432('0x22')](function(_0x5d720a){if(_0x5d720a){_0x3e4010=_0x5d720a;return db['CmContact']['rawAttributes'];}})[_0x1432('0x22')](function(_0x559426){if(_0x559426){var _0x5bef2c={};var _0xaa073e={};_0xaa073e[_0x1432('0x2f')]=_[_0x1432('0x68')](_[_0x1432('0x44')](_0x559426),_[_0x1432('0x2b')](_0x3e4010['CustomFields'],function(_0x36c275){return util[_0x1432('0x69')](_0x1432('0x6a'),_0x36c275['id']);}));_0xaa073e['query']=_[_0x1432('0x44')](_0x51d93f[_0x1432('0x30')]);_0xaa073e[_0x1432('0x38')]=_['intersection'](_0xaa073e['model'],_0xaa073e[_0x1432('0x30')]);_0x5bef2c[_0x1432('0x32')]=_[_0x1432('0x31')](_0xaa073e['model'],qs[_0x1432('0x33')](_0x51d93f['query'][_0x1432('0x33')]));_0x5bef2c[_0x1432('0x32')]=_0x5bef2c[_0x1432('0x32')][_0x1432('0x34')]?_0x5bef2c[_0x1432('0x32')]:_0xaa073e['model'];if(!_0x51d93f['query'][_0x1432('0x35')]('nolimit')){_0x5bef2c[_0x1432('0x1c')]=qs['limit'](_0x51d93f['query'][_0x1432('0x1c')]);_0x5bef2c['offset']=qs[_0x1432('0x1a')](_0x51d93f[_0x1432('0x30')][_0x1432('0x1a')]);}_0x5bef2c['order']=qs['sort'](_0x51d93f[_0x1432('0x30')]['sort']);_0x5bef2c[_0x1432('0x37')]=qs[_0x1432('0x38')](_[_0x1432('0x58')](_0x51d93f[_0x1432('0x30')],_0xaa073e[_0x1432('0x38')]));_0x5bef2c[_0x1432('0x6b')]=!![];if(_0x51d93f[_0x1432('0x30')]['filter']){_0x5bef2c[_0x1432('0x37')]=_['merge'](_0x5bef2c['where'],{'$or':_['map'](_0x5bef2c['attributes'],function(_0x63d195){var _0x36d5df={};_0x36d5df[_0x63d195]={'$like':'%'+_0x51d93f['query'][_0x1432('0x3b')]+'%'};return _0x36d5df;})});}_0x5bef2c=_[_0x1432('0x39')]({},_0x5bef2c,_0x51d93f[_0x1432('0x3c')]);return _0x3e4010[_0x1432('0x66')](_0x5bef2c);}})['then'](respondWithResult(_0x402a5c,null))[_0x1432('0x42')](handleError(_0x402a5c,null));};exports[_0x1432('0x6c')]=function(_0x490c95,_0x5cab93,_0x5cecc8){var _0x5b829d;var _0x1e05d9;var _0x5b455e;var _0x176689=_0x490c95[_0x1432('0x4f')]['id'];csv_results=[];return db[_0x1432('0x6d')][_0x1432('0x40')]({'attributes':['id',_0x1432('0x28')],'raw':!![],'order':[_0x1432('0x6e')]})[_0x1432('0x22')](function(_0x15f78f){_0x5b829d=_0x15f78f;var _0x10333e=_[_0x1432('0x44')](db[_0x1432('0x5f')]['rawAttributes']);return db['CmCustomField'][_0x1432('0x40')]({'raw':!![],'attributes':['id',_0x1432('0x6f')]})[_0x1432('0x22')](function(_0x5eb062){_0x1e05d9=_0x5eb062;var _0x265954=squel[_0x1432('0x70')]()[_0x1432('0x33')](_0x10333e)[_0x1432('0x71')]('cm_contacts','c')[_0x1432('0x37')](_0x1432('0x72'),_0x176689)[_0x1432('0x37')](_0x1432('0x73'))[_0x1432('0x74')]();for(var _0x2d8361=0x0;_0x2d8361<_0x1e05d9[_0x1432('0x34')];_0x2d8361++){_0x265954[_0x1432('0x75')](_0x1432('0x76')+_0x1e05d9[_0x2d8361]['id'],_0x1432('0x77')+_0x1e05d9[_0x2d8361]['alias']);}for(var _0x2d8361=0x0;_0x2d8361<_0x5b829d[_0x1432('0x34')];_0x2d8361++){_0x265954[_0x1432('0x75')](squel[_0x1432('0x70')]()[_0x1432('0x75')](_0x1432('0x78'))[_0x1432('0x71')](_0x1432('0x79'))[_0x1432('0x37')](_0x1432('0x7a'),_0x5b829d[_0x2d8361]['id'])[_0x1432('0x37')](_0x1432('0x7b')),'additionalPhone_'+_0x5b829d[_0x2d8361][_0x1432('0x28')]);_0x265954[_0x1432('0x75')](squel[_0x1432('0x70')]()['field']('description')['from']('cm_contact_has_items')[_0x1432('0x37')](_0x1432('0x7a'),_0x5b829d[_0x2d8361]['id'])[_0x1432('0x37')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x5b829d[_0x2d8361][_0x1432('0x28')]);}var _0x43caa4=[];_0x43caa4['push'](_0x265954[_0x1432('0x7c')]());BPromise[_0x1432('0x5e')](_0x43caa4,handleQuery)['then'](function(_0x55c1aa){handleQuery(_0x265954[_0x1432('0x7c')]());var _0x2ca3f8=csv_results[0x0];if(!_['isEmpty'](_0x2ca3f8)){var _0x2182e7=toCsv(_0x2ca3f8);var _0x39d623=Date[_0x1432('0x7d')]();fs[_0x1432('0x7e')](util[_0x1432('0x69')](_0x1432('0x7f'),_0x176689,_0x39d623),_0x2182e7);_0x5cab93[_0x1432('0x80')](_0x1432('0x81'),_0x1432('0x82')+util[_0x1432('0x69')](_0x1432('0x83'),_0x176689,_0x39d623));_0x5cab93[_0x1432('0x80')]('Content-type','text/csv');return _0x5cab93[_0x1432('0x84')](util[_0x1432('0x69')](_0x1432('0x7f'),_0x176689,_0x39d623));}else{return _0x5cab93[_0x1432('0x17')](0xcc);}});});});};exports[_0x1432('0x85')]=function(_0x205c98,_0x13238a,_0x1f61f7){var _0x4db282;delete _0x205c98[_0x1432('0x47')]['id'];return db[_0x1432('0x3d')][_0x1432('0x55')]({'where':{'id':_0x205c98[_0x1432('0x4f')]['id']}})[_0x1432('0x22')](handleEntityNotFound(_0x13238a,null))[_0x1432('0x22')](function(_0x397428){if(_0x397428){return db[_0x1432('0x86')]['transaction'](function(_0x28986c){return db[_0x1432('0x87')]['create'](_0x205c98['body'],{'transaction':_0x28986c})[_0x1432('0x22')](function(_0x1c5d88){_0x4db282=_0x1c5d88;return _0x397428[_0x1432('0x88')](_0x1c5d88,{'transaction':_0x28986c});})[_0x1432('0x22')](function(){var _0x5f2237={'type':db[_0x1432('0x89')][_0x1432('0x8a')],'transaction':_0x28986c};switch(_0x205c98[_0x1432('0x47')][_0x1432('0x2d')]){case _0x1432('0x8b'):_0x5f2237[_0x1432('0x2d')]=db[_0x1432('0x89')][_0x1432('0x8a')];break;case _0x1432('0x8c'):_0x5f2237[_0x1432('0x2d')]=db['Sequelize'][_0x1432('0x8d')];break;case _0x1432('0x8e'):_0x5f2237[_0x1432('0x2d')]=db['Sequelize'][_0x1432('0x8f')];_0x5f2237['defaultValue']=![];break;default:}return db['sequelize'][_0x1432('0x90')]['addColumn'](_0x1432('0x91'),util[_0x1432('0x69')]('cf_%s',_0x4db282['id']),_0x5f2237);})[_0x1432('0x22')](function(){return _0x4db282;});});}})[_0x1432('0x22')](respondWithResult(_0x13238a,null))[_0x1432('0x42')](handleError(_0x13238a,null));};exports[_0x1432('0x92')]=function(_0x25cc4a,_0x2f5d08,_0x5a3a71){var _0x2b6e08={};var _0x469adf={};var _0x4f7db8;var _0x5d084f;return db['CmList'][_0x1432('0x55')]({'where':{'id':_0x25cc4a[_0x1432('0x4f')]['id']}})[_0x1432('0x22')](handleEntityNotFound(_0x2f5d08,null))['then'](function(_0x2384bc){if(_0x2384bc){_0x4f7db8=_0x2384bc;_0x469adf[_0x1432('0x2f')]=_[_0x1432('0x44')](db[_0x1432('0x87')][_0x1432('0x2c')]);_0x469adf[_0x1432('0x30')]=_[_0x1432('0x44')](_0x25cc4a[_0x1432('0x30')]);_0x469adf[_0x1432('0x38')]=_[_0x1432('0x31')](_0x469adf[_0x1432('0x2f')],_0x469adf[_0x1432('0x30')]);_0x2b6e08[_0x1432('0x32')]=_[_0x1432('0x31')](_0x469adf['model'],qs['fields'](_0x25cc4a[_0x1432('0x30')][_0x1432('0x33')]));_0x2b6e08[_0x1432('0x32')]=_0x2b6e08[_0x1432('0x32')][_0x1432('0x34')]?_0x2b6e08['attributes']:_0x469adf[_0x1432('0x2f')];_0x2b6e08['order']=qs['sort'](_0x25cc4a[_0x1432('0x30')][_0x1432('0x57')]);_0x2b6e08[_0x1432('0x37')]=qs['filters'](_[_0x1432('0x58')](_0x25cc4a[_0x1432('0x30')],_0x469adf[_0x1432('0x38')]));_0x2b6e08[_0x1432('0x37')]=_[_0x1432('0x39')](_0x2b6e08['where'],{'$or':[{'ListId':_0x2384bc['id']},{'ListId':null}]});if(_0x25cc4a['query'][_0x1432('0x3b')]){_0x2b6e08[_0x1432('0x37')]=_[_0x1432('0x39')](_0x2b6e08[_0x1432('0x37')],{'$or':_[_0x1432('0x2b')](_0x2b6e08['attributes'],function(_0x441fe0){var _0x131777={};_0x131777[_0x441fe0]={'$like':'%'+_0x25cc4a[_0x1432('0x30')][_0x1432('0x3b')]+'%'};return _0x131777;})});}_0x2b6e08=_['merge']({},_0x2b6e08,_0x25cc4a['options']);return db[_0x1432('0x87')][_0x1432('0x93')](_0x2b6e08);}})[_0x1432('0x22')](respondWithResult(_0x2f5d08,null))[_0x1432('0x42')](handleError(_0x2f5d08,null));};exports[_0x1432('0x94')]=function(_0x1eb3f7,_0x1b8244){return db[_0x1432('0x87')][_0x1432('0x93')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x1b8244,null))[_0x1432('0x22')](function(_0x2c46e7){return _0x2c46e7;})[_0x1432('0x22')](respondWithResult(_0x1b8244,null))[_0x1432('0x42')](handleError(_0x1b8244,null));};exports[_0x1432('0x95')]=function(_0x3028d3,_0x19c4eb,_0x54a34f){return db[_0x1432('0x3d')][_0x1432('0x45')]({'where':{'id':_0x3028d3[_0x1432('0x4f')]['id']}})['then'](handleEntityNotFound(_0x19c4eb,null))[_0x1432('0x22')](function(_0x2e80d4){if(_0x2e80d4){return _0x2e80d4['addAgents'](_0x3028d3[_0x1432('0x47')][_0x1432('0x5a')],_[_0x1432('0x60')](_0x3028d3[_0x1432('0x47')],[_0x1432('0x5a'),'id'])||{})[_0x1432('0x96')](function(_0x4177f9){for(var _0x159841=0x0;_0x159841<_0x3028d3[_0x1432('0x47')][_0x1432('0x5a')][_0x1432('0x34')];_0x159841+=0x1){socket[_0x1432('0x97')](_0x1432('0x98'),{'UserId':Number(_0x3028d3[_0x1432('0x47')]['ids'][_0x159841]),'CmListId':Number(_0x3028d3[_0x1432('0x4f')]['id'])});}return _0x4177f9;});}})[_0x1432('0x22')](respondWithResult(_0x19c4eb,null))['catch'](handleError(_0x19c4eb,null));};exports['removeAgents']=function(_0x37303c,_0x177cc6,_0x20fa6e){return db['CmList'][_0x1432('0x45')]({'where':{'id':_0x37303c[_0x1432('0x4f')]['id']}})[_0x1432('0x22')](handleEntityNotFound(_0x177cc6,null))['then'](function(_0x4d0213){if(_0x4d0213){return _0x4d0213[_0x1432('0x99')](_0x37303c[_0x1432('0x30')][_0x1432('0x5a')])[_0x1432('0x22')](function(){if(_[_0x1432('0x5d')](_0x37303c[_0x1432('0x30')][_0x1432('0x5a')])){for(var _0xcf46fd=0x0;_0xcf46fd<_0x37303c['query'][_0x1432('0x5a')][_0x1432('0x34')];_0xcf46fd+=0x1){socket[_0x1432('0x97')]('userCmList:remove',{'UserId':Number(_0x37303c['query']['ids'][_0xcf46fd]),'CmListId':Number(_0x37303c['params']['id'])});}}else{socket[_0x1432('0x97')]('userCmList:remove',{'UserId':Number(_0x37303c[_0x1432('0x30')][_0x1432('0x5a')]),'CmListId':Number(_0x37303c['params']['id'])});}});}})[_0x1432('0x22')](respondWithStatusCode(_0x177cc6,null))[_0x1432('0x42')](handleError(_0x177cc6,null));};exports['getAgents']=function(_0x54af69,_0x512761,_0x25d0c5){var _0x260f91={};var _0x77c995={};var _0x1ec92c;var _0x516a4d;return db[_0x1432('0x3d')][_0x1432('0x55')]({'where':{'id':_0x54af69[_0x1432('0x4f')]['id']}})[_0x1432('0x22')](handleEntityNotFound(_0x512761,null))[_0x1432('0x22')](function(_0x107c91){if(_0x107c91){_0x1ec92c=_0x107c91;_0x77c995['model']=_['keys'](db[_0x1432('0x9a')][_0x1432('0x2c')]);_0x77c995[_0x1432('0x30')]=_[_0x1432('0x44')](_0x54af69[_0x1432('0x30')]);_0x77c995[_0x1432('0x38')]=_['intersection'](_0x77c995[_0x1432('0x2f')],_0x77c995[_0x1432('0x30')]);_0x260f91['attributes']=_[_0x1432('0x31')](_0x77c995[_0x1432('0x2f')],qs[_0x1432('0x33')](_0x54af69[_0x1432('0x30')][_0x1432('0x33')]));_0x260f91[_0x1432('0x32')]=_0x260f91['attributes'][_0x1432('0x34')]?_0x260f91['attributes']:_0x77c995[_0x1432('0x2f')];_0x260f91['order']=qs['sort'](_0x54af69['query']['sort']);_0x260f91[_0x1432('0x37')]=qs[_0x1432('0x38')](_[_0x1432('0x58')](_0x54af69[_0x1432('0x30')],_0x77c995[_0x1432('0x38')]));if(_0x54af69[_0x1432('0x30')][_0x1432('0x3b')]){_0x260f91[_0x1432('0x37')]=_[_0x1432('0x39')](_0x260f91[_0x1432('0x37')],{'$or':_[_0x1432('0x2b')](_0x260f91['attributes'],function(_0x3971fb){var _0x277ea9={};_0x277ea9[_0x3971fb]={'$like':'%'+_0x54af69['query']['filter']+'%'};return _0x277ea9;})});}_0x260f91=_['merge']({},_0x260f91,_0x54af69['options']);return _0x1ec92c[_0x1432('0x9b')](_0x260f91);}})[_0x1432('0x22')](function(_0x8a2611){if(_0x8a2611){_0x516a4d=_0x8a2611[_0x1432('0x34')];if(!_0x54af69[_0x1432('0x30')][_0x1432('0x35')](_0x1432('0x56'))){_0x260f91[_0x1432('0x1c')]=qs[_0x1432('0x1c')](_0x54af69[_0x1432('0x30')][_0x1432('0x1c')]);_0x260f91['offset']=qs[_0x1432('0x1a')](_0x54af69['query'][_0x1432('0x1a')]);}return _0x1ec92c[_0x1432('0x9b')](_0x260f91);}})['then'](function(_0x37f0a1){if(_0x37f0a1){return _0x37f0a1?{'count':_0x516a4d,'rows':_0x37f0a1}:null;}})[_0x1432('0x22')](respondWithResult(_0x512761,null))[_0x1432('0x42')](handleError(_0x512761,null));};function handleQuery(_0x3c0e11){logger[_0x1432('0x9c')](_0x3c0e11);return db['sequelize']['query'](_0x3c0e11)[_0x1432('0x96')](function(_0x3f4838){csv_results[_0x1432('0x61')](_0x3f4838);})[_0x1432('0x42')](function(_0x3d383a){logger['error'](_0x3d383a[_0x1432('0x64')]);});} \ No newline at end of file +var _0x4578=['list_%d_%s.csv','Content-type','download','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','removeAgents','userCmList:remove','emit','getAgents','info','spread','message','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','get','Lists','destroy','error','stack','name','index','map','CmList','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','removeDispositions','addContacts','CmContact','tags','isArray','push','each','ids','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','getContactsCsv','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename='];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4578,0x1f3));var _0x8457=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x4578[_0x4c0622];return _0x1799d8;};'use strict';var emlformat=require(_0x8457('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8457('0x1'));var jsonpatch=require(_0x8457('0x2'));var rp=require(_0x8457('0x3'));var moment=require('moment');var BPromise=require(_0x8457('0x4'));var Mustache=require(_0x8457('0x5'));var util=require(_0x8457('0x6'));var path=require('path');var sox=require(_0x8457('0x7'));var csv=require('to-csv');var ejs=require(_0x8457('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8457('0x9'));var squel=require(_0x8457('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8457('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8457('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8457('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x8457('0xe'));var hardwareService=require(_0x8457('0xf'));var logger=require(_0x8457('0x10'))(_0x8457('0x11'));var utils=require(_0x8457('0x12'));var config=require(_0x8457('0x13'));var licenseUtil=require(_0x8457('0x14'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x8457('0x15')]=_[_0x8457('0x16')](config[_0x8457('0x15')],{'host':_0x8457('0x17'),'port':0x18eb});var socket=require(_0x8457('0x18'))(new Redis(config[_0x8457('0x15')]));require(_0x8457('0x19'))[_0x8457('0x1a')](socket);function respondWithStatusCode(_0x56e93f,_0x3362d3){_0x3362d3=_0x3362d3||0xcc;return function(_0x8ff3b0){if(_0x8ff3b0){return _0x56e93f[_0x8457('0x1b')](_0x3362d3);}return _0x56e93f[_0x8457('0x1c')](_0x3362d3)[_0x8457('0x1d')]();};}function respondWithResult(_0x4e85b9,_0x38cdd2){_0x38cdd2=_0x38cdd2||0xc8;return function(_0x121014){if(_0x121014){return _0x4e85b9[_0x8457('0x1c')](_0x38cdd2)[_0x8457('0x1e')](_0x121014);}};}function respondWithFilteredResult(_0x78334b,_0x3d82c3){return function(_0x694b6b){if(_0x694b6b){var _0x4c9c88=typeof _0x3d82c3[_0x8457('0x1f')]===_0x8457('0x20')&&typeof _0x3d82c3[_0x8457('0x21')]===_0x8457('0x20');var _0x3f8a36=_0x694b6b['count'];var _0x1dc753=_0x4c9c88?0x0:_0x3d82c3['offset'];var _0x4d885d=_0x4c9c88?_0x694b6b[_0x8457('0x22')]:_0x3d82c3['offset']+_0x3d82c3[_0x8457('0x21')];var _0x2878f2;if(_0x4d885d>=_0x3f8a36){_0x4d885d=_0x3f8a36;_0x2878f2=0xc8;}else{_0x2878f2=0xce;}_0x78334b[_0x8457('0x1c')](_0x2878f2);return _0x78334b[_0x8457('0x23')]('Content-Range',_0x1dc753+'-'+_0x4d885d+'/'+_0x3f8a36)['json'](_0x694b6b);}return null;};}function patchUpdates(_0x1fdd72){return function(_0x213708){try{jsonpatch[_0x8457('0x24')](_0x213708,_0x1fdd72,!![]);}catch(_0x2960da){return BPromise[_0x8457('0x25')](_0x2960da);}return _0x213708['save']();};}function saveUpdates(_0x1e0904,_0x308e11){return function(_0x3e47a8){if(_0x3e47a8){return _0x3e47a8[_0x8457('0x26')](_0x1e0904)[_0x8457('0x27')](function(_0x3b08d1){return _0x3b08d1;});}return null;};}function removeEntity(_0x37f1e1,_0x1a6045){return function(_0x2ccf05){if(_0x2ccf05){return _0x2ccf05['destroy']()[_0x8457('0x27')](function(){var _0x584b65=_0x2ccf05[_0x8457('0x28')]({'plain':!![]});var _0x4dccd6=_0x8457('0x29');return db['UserProfileResource'][_0x8457('0x2a')]({'where':{'type':_0x4dccd6,'resourceId':_0x584b65['id']}})['then'](function(){return _0x2ccf05;});})[_0x8457('0x27')](function(){_0x37f1e1['status'](0xcc)[_0x8457('0x1d')]();});}};}function handleEntityNotFound(_0x5d6a47,_0x119c27){return function(_0x3c1d3f){if(!_0x3c1d3f){_0x5d6a47[_0x8457('0x1b')](0x194);}return _0x3c1d3f;};}function handleError(_0x355a1f,_0x4663fc){_0x4663fc=_0x4663fc||0x1f4;return function(_0x4eb0d3){logger[_0x8457('0x2b')](_0x4eb0d3[_0x8457('0x2c')]);if(_0x4eb0d3[_0x8457('0x2d')]){delete _0x4eb0d3[_0x8457('0x2d')];}_0x355a1f[_0x8457('0x1c')](_0x4663fc)['send'](_0x4eb0d3);};}exports[_0x8457('0x2e')]=function(_0x39098c,_0x255e28){var _0x26b952={},_0x563bb4={},_0xf7a5ad={'count':0x0,'rows':[]};var _0x22f3c0=_[_0x8457('0x2f')](db[_0x8457('0x30')]['rawAttributes'],function(_0xcdf9a6){return{'name':_0xcdf9a6[_0x8457('0x31')],'type':_0xcdf9a6[_0x8457('0x32')]['key']};});_0x563bb4[_0x8457('0x33')]=_['map'](_0x22f3c0,_0x8457('0x2d'));_0x563bb4['query']=_[_0x8457('0x34')](_0x39098c[_0x8457('0x35')]);_0x563bb4[_0x8457('0x36')]=_[_0x8457('0x37')](_0x563bb4[_0x8457('0x33')],_0x563bb4[_0x8457('0x35')]);_0x26b952[_0x8457('0x38')]=_[_0x8457('0x37')](_0x563bb4[_0x8457('0x33')],qs['fields'](_0x39098c[_0x8457('0x35')][_0x8457('0x39')]));_0x26b952['attributes']=_0x26b952[_0x8457('0x38')][_0x8457('0x3a')]?_0x26b952['attributes']:_0x563bb4['model'];if(!_0x39098c[_0x8457('0x35')][_0x8457('0x3b')]('nolimit')){_0x26b952[_0x8457('0x21')]=qs[_0x8457('0x21')](_0x39098c[_0x8457('0x35')][_0x8457('0x21')]);_0x26b952[_0x8457('0x1f')]=qs['offset'](_0x39098c['query'][_0x8457('0x1f')]);}_0x26b952[_0x8457('0x3c')]=qs['sort'](_0x39098c[_0x8457('0x35')][_0x8457('0x3d')]);_0x26b952[_0x8457('0x3e')]=qs[_0x8457('0x36')](_[_0x8457('0x3f')](_0x39098c[_0x8457('0x35')],_0x563bb4[_0x8457('0x36')]),_0x22f3c0);if(_0x39098c['query'][_0x8457('0x40')]){_0x26b952['where']=_[_0x8457('0x41')](_0x26b952['where'],{'$or':_[_0x8457('0x2f')](_0x22f3c0,function(_0x45b8f1){if(_0x45b8f1[_0x8457('0x32')]!=='VIRTUAL'){var _0x3b8193={};_0x3b8193[_0x45b8f1[_0x8457('0x2d')]]={'$like':'%'+_0x39098c['query'][_0x8457('0x40')]+'%'};return _0x3b8193;}})});}_0x26b952=_['merge']({},_0x26b952,_0x39098c[_0x8457('0x42')]);var _0x1289ee={'where':_0x26b952[_0x8457('0x3e')]};return db['CmList'][_0x8457('0x22')](_0x1289ee)[_0x8457('0x27')](function(_0x22d78b){_0xf7a5ad[_0x8457('0x22')]=_0x22d78b;if(_0x39098c[_0x8457('0x35')][_0x8457('0x43')]){_0x26b952['include']=[{'all':!![]}];}return db['CmList'][_0x8457('0x44')](_0x26b952);})[_0x8457('0x27')](function(_0x2d12de){_0xf7a5ad[_0x8457('0x45')]=_0x2d12de;return _0xf7a5ad;})[_0x8457('0x27')](respondWithFilteredResult(_0x255e28,_0x26b952))[_0x8457('0x46')](handleError(_0x255e28,null));};exports['show']=function(_0x241bb9,_0x23c6a5){var _0x551150={'raw':![],'where':{'id':_0x241bb9['params']['id']}},_0x3ff552={};_0x3ff552[_0x8457('0x33')]=_[_0x8457('0x34')](db[_0x8457('0x30')][_0x8457('0x47')]);_0x3ff552[_0x8457('0x35')]=_['keys'](_0x241bb9[_0x8457('0x35')]);_0x3ff552[_0x8457('0x36')]=_[_0x8457('0x37')](_0x3ff552['model'],_0x3ff552['query']);_0x551150[_0x8457('0x38')]=_[_0x8457('0x37')](_0x3ff552[_0x8457('0x33')],qs['fields'](_0x241bb9[_0x8457('0x35')][_0x8457('0x39')]));_0x551150[_0x8457('0x38')]=_0x551150[_0x8457('0x38')][_0x8457('0x3a')]?_0x551150['attributes']:_0x3ff552[_0x8457('0x33')];if(_0x241bb9[_0x8457('0x35')][_0x8457('0x43')]){_0x551150[_0x8457('0x48')]=[{'all':!![]}];}_0x551150=_[_0x8457('0x41')]({},_0x551150,_0x241bb9[_0x8457('0x42')]);return db[_0x8457('0x30')]['find'](_0x551150)['then'](handleEntityNotFound(_0x23c6a5,null))[_0x8457('0x27')](respondWithResult(_0x23c6a5,null))[_0x8457('0x46')](handleError(_0x23c6a5,null));};exports['create']=function(_0x55360d,_0xd0c5bd){return db[_0x8457('0x30')][_0x8457('0x49')](_0x55360d[_0x8457('0x4a')],{})[_0x8457('0x27')](function(_0x279e95){var _0x436780=_0x55360d[_0x8457('0x4b')]['get']({'plain':!![]});if(!_0x436780)throw new Error(_0x8457('0x4c'));if(_0x436780['role']==='user'){var _0x315d0b=_0x279e95[_0x8457('0x28')]({'plain':!![]});var _0x4ffb41=_0x8457('0x29');return db[_0x8457('0x4d')][_0x8457('0x4e')]({'where':{'name':_0x4ffb41,'userProfileId':_0x436780[_0x8457('0x4f')]},'raw':!![]})['then'](function(_0x41c26b){if(_0x41c26b&&_0x41c26b['autoAssociation']===0x0){return db[_0x8457('0x50')][_0x8457('0x49')]({'name':_0x315d0b[_0x8457('0x2d')],'resourceId':_0x315d0b['id'],'type':_0x41c26b['name'],'sectionId':_0x41c26b['id']},{})[_0x8457('0x27')](function(){return _0x279e95;});}else{return _0x279e95;}})[_0x8457('0x46')](function(_0x37cac1){logger[_0x8457('0x2b')](_0x8457('0x51'),_0x37cac1);throw _0x37cac1;});}return _0x279e95;})[_0x8457('0x27')](respondWithResult(_0xd0c5bd,0xc9))[_0x8457('0x46')](handleError(_0xd0c5bd,null));};exports[_0x8457('0x26')]=function(_0x1b1968,_0x27a23c){if(_0x1b1968[_0x8457('0x4a')]['id']){delete _0x1b1968[_0x8457('0x4a')]['id'];}return db[_0x8457('0x30')][_0x8457('0x4e')]({'where':{'id':_0x1b1968[_0x8457('0x52')]['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x27a23c,null))[_0x8457('0x27')](saveUpdates(_0x1b1968[_0x8457('0x4a')],null))[_0x8457('0x27')](respondWithResult(_0x27a23c,null))[_0x8457('0x46')](handleError(_0x27a23c,null));};exports[_0x8457('0x2a')]=function(_0x49c337,_0x3c285e){return db[_0x8457('0x30')][_0x8457('0x4e')]({'where':{'id':_0x49c337[_0x8457('0x52')]['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x3c285e,null))['then'](removeEntity(_0x3c285e,null))['catch'](handleError(_0x3c285e,null));};exports[_0x8457('0x53')]=function(_0x226f77,_0x970c2d){return db['CmList'][_0x8457('0x53')]()[_0x8457('0x27')](respondWithResult(_0x970c2d,null))['catch'](handleError(_0x970c2d,null));};exports[_0x8457('0x54')]=function(_0x5a22fb,_0x35dc79,_0x2f37a2){if(_0x5a22fb[_0x8457('0x4a')]['id']){delete _0x5a22fb[_0x8457('0x4a')]['id'];}return db['CmList'][_0x8457('0x4e')]({'where':{'id':_0x5a22fb[_0x8457('0x52')]['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x35dc79,null))[_0x8457('0x27')](function(_0x29c1c1){if(_0x29c1c1){_0x5a22fb[_0x8457('0x4a')][_0x8457('0x55')]=_0x29c1c1['id'];return db[_0x8457('0x56')][_0x8457('0x49')](_0x5a22fb[_0x8457('0x4a')]);}})[_0x8457('0x27')](respondWithResult(_0x35dc79,null))[_0x8457('0x46')](handleError(_0x35dc79,null));};exports[_0x8457('0x57')]=function(_0x2787c5,_0x458342,_0x3a2fe9){var _0x12af1a={'raw':![],'where':{}};var _0x23d0d0={};var _0x3efaf2={'count':0x0,'rows':[]};return db[_0x8457('0x30')][_0x8457('0x58')]({'where':{'id':_0x2787c5[_0x8457('0x52')]['id']}})['then'](handleEntityNotFound(_0x458342,null))[_0x8457('0x27')](function(_0x33fcda){if(_0x33fcda){_0x23d0d0[_0x8457('0x33')]=_['keys'](db['Disposition'][_0x8457('0x47')]);_0x23d0d0['query']=_[_0x8457('0x34')](_0x2787c5[_0x8457('0x35')]);_0x23d0d0[_0x8457('0x36')]=_[_0x8457('0x37')](_0x23d0d0[_0x8457('0x33')],_0x23d0d0[_0x8457('0x35')]);_0x12af1a[_0x8457('0x38')]=_[_0x8457('0x37')](_0x23d0d0[_0x8457('0x33')],qs['fields'](_0x2787c5['query']['fields']));_0x12af1a['attributes']=_0x12af1a[_0x8457('0x38')]['length']?_0x12af1a[_0x8457('0x38')]:_0x23d0d0['model'];if(!_0x2787c5['query'][_0x8457('0x3b')](_0x8457('0x59'))){_0x12af1a[_0x8457('0x21')]=qs[_0x8457('0x21')](_0x2787c5[_0x8457('0x35')][_0x8457('0x21')]);_0x12af1a['offset']=qs[_0x8457('0x1f')](_0x2787c5['query'][_0x8457('0x1f')]);}_0x12af1a['order']=qs[_0x8457('0x3d')](_0x2787c5[_0x8457('0x35')][_0x8457('0x3d')]);_0x12af1a[_0x8457('0x3e')]=qs[_0x8457('0x36')](_['pick'](_0x2787c5[_0x8457('0x35')],_0x23d0d0[_0x8457('0x36')]));_0x12af1a['where']['ListId']=_0x33fcda['id'];if(_0x2787c5[_0x8457('0x35')][_0x8457('0x40')]){_0x12af1a['where']=_[_0x8457('0x41')](_0x12af1a[_0x8457('0x3e')],{'$or':_[_0x8457('0x2f')](_0x12af1a['attributes'],function(_0x17eaa2){var _0x3ed229={};_0x3ed229[_0x17eaa2]={'$like':'%'+_0x2787c5[_0x8457('0x35')]['filter']+'%'};return _0x3ed229;})});}_0x12af1a=_[_0x8457('0x41')]({},_0x12af1a,_0x2787c5[_0x8457('0x42')]);return db[_0x8457('0x56')][_0x8457('0x22')]({'where':_0x12af1a[_0x8457('0x3e')]})['then'](function(_0xa91a0e){_0x3efaf2[_0x8457('0x22')]=_0xa91a0e;if(_0x2787c5[_0x8457('0x35')][_0x8457('0x43')]){_0x12af1a['include']=[{'all':!![]}];}return db['Disposition'][_0x8457('0x44')](_0x12af1a);})[_0x8457('0x27')](function(_0x596354){_0x3efaf2[_0x8457('0x45')]=_0x596354;return _0x3efaf2;});}})[_0x8457('0x27')](respondWithFilteredResult(_0x458342,_0x12af1a))[_0x8457('0x46')](handleError(_0x458342,null));};exports[_0x8457('0x5a')]=function(_0x16d5ad,_0x5c6e25,_0x4a4a3c){return db[_0x8457('0x30')][_0x8457('0x4e')]({'where':{'id':_0x16d5ad[_0x8457('0x52')]['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x5c6e25,null))[_0x8457('0x27')](function(_0x3fce29){if(_0x3fce29){return _0x3fce29[_0x8457('0x5a')](_0x16d5ad[_0x8457('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x5c6e25,null))[_0x8457('0x46')](handleError(_0x5c6e25,null));};exports[_0x8457('0x5b')]=function(_0x883f59,_0x2ee2b3,_0x544ac6){return db['CmList'][_0x8457('0x4e')]({'where':{'id':_0x883f59[_0x8457('0x52')]['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x2ee2b3,null))['then'](function(_0x1ca226){if(_0x1ca226){var _0x2720d0=[];var _0x599b07={'success':[],'errors':[]};return db[_0x8457('0x5c')][_0x8457('0x53')]()[_0x8457('0x27')](function(_0x5ce44c){if(_0x883f59[_0x8457('0x4a')][_0x8457('0x5d')]&&_[_0x8457('0x5e')](_0x883f59[_0x8457('0x4a')][_0x8457('0x5d')])){if(_0x883f59[_0x8457('0x4a')][_0x8457('0x5d')][_0x8457('0x3a')]){_0x883f59[_0x8457('0x4a')][_0x8457('0x5d')]=_0x883f59[_0x8457('0x4a')][_0x8457('0x5d')]['join'](';')+';';}else{_0x883f59[_0x8457('0x4a')][_0x8457('0x5d')]=null;}}else{_0x883f59['body'][_0x8457('0x5d')]=null;}if(_0x883f59[_0x8457('0x4a')]&&_[_0x8457('0x5e')](_0x883f59[_0x8457('0x4a')])){for(var _0x4049d8=0x0;_0x4049d8<_0x883f59[_0x8457('0x4a')][_0x8457('0x3a')];_0x4049d8+=0x1){_0x883f59[_0x8457('0x4a')][_0x4049d8][_0x8457('0x55')]=_0x883f59[_0x8457('0x52')]['id'];_0x2720d0[_0x8457('0x5f')](_0x883f59[_0x8457('0x4a')][_0x4049d8]);}return BPromise[_0x8457('0x60')](_0x2720d0,function(_0x276360){return db[_0x8457('0x5c')][_0x8457('0x49')](_['omit'](_0x276360,[_0x8457('0x61'),'id'])||{},{'fields':_['keys'](_0x5ce44c),'raw':!![]})[_0x8457('0x27')](function(_0x3b1f72){_0x599b07[_0x8457('0x62')][_0x8457('0x5f')](_0x3b1f72[_0x8457('0x63')]);})[_0x8457('0x46')](function(_0x253056){_0x599b07[_0x8457('0x64')]['push']({'data':_0x276360,'error':_0x253056['message']});});})['then'](function(_0x3fb658){return _0x599b07;})[_0x8457('0x46')](function(_0x1e3492){return _0x1e3492;});}else{_0x2ee2b3[_0x8457('0x1c')](0x190)[_0x8457('0x1e')]({'message':_0x8457('0x65')});}});}})['then'](respondWithResult(_0x2ee2b3,null))['catch'](handleError(_0x2ee2b3,null));};exports[_0x8457('0x66')]=function(_0x2fcc34,_0x3cc62d,_0x40aee8){var _0x49f02d;return db[_0x8457('0x30')]['find']({'where':{'id':_0x2fcc34[_0x8457('0x52')]['id']},'include':[{'model':db[_0x8457('0x67')],'as':'CustomFields'}]})[_0x8457('0x27')](handleEntityNotFound(_0x3cc62d,null))[_0x8457('0x27')](function(_0x471f55){if(_0x471f55){_0x49f02d=_0x471f55;return db['CmContact'][_0x8457('0x47')];}})[_0x8457('0x27')](function(_0xc8a6e){if(_0xc8a6e){var _0x1fa5c7={};var _0x10ddc6={};_0x10ddc6['model']=_['concat'](_[_0x8457('0x34')](_0xc8a6e),_[_0x8457('0x2f')](_0x49f02d[_0x8457('0x68')],function(_0x382af3){return util[_0x8457('0x69')](_0x8457('0x6a'),_0x382af3['id']);}));_0x10ddc6['query']=_[_0x8457('0x34')](_0x2fcc34[_0x8457('0x35')]);_0x10ddc6[_0x8457('0x36')]=_[_0x8457('0x37')](_0x10ddc6[_0x8457('0x33')],_0x10ddc6[_0x8457('0x35')]);_0x1fa5c7[_0x8457('0x38')]=_[_0x8457('0x37')](_0x10ddc6[_0x8457('0x33')],qs[_0x8457('0x39')](_0x2fcc34[_0x8457('0x35')][_0x8457('0x39')]));_0x1fa5c7[_0x8457('0x38')]=_0x1fa5c7[_0x8457('0x38')][_0x8457('0x3a')]?_0x1fa5c7['attributes']:_0x10ddc6['model'];if(!_0x2fcc34[_0x8457('0x35')][_0x8457('0x3b')](_0x8457('0x59'))){_0x1fa5c7[_0x8457('0x21')]=qs[_0x8457('0x21')](_0x2fcc34[_0x8457('0x35')][_0x8457('0x21')]);_0x1fa5c7[_0x8457('0x1f')]=qs[_0x8457('0x1f')](_0x2fcc34[_0x8457('0x35')][_0x8457('0x1f')]);}_0x1fa5c7[_0x8457('0x3c')]=qs[_0x8457('0x3d')](_0x2fcc34[_0x8457('0x35')][_0x8457('0x3d')]);_0x1fa5c7[_0x8457('0x3e')]=qs[_0x8457('0x36')](_[_0x8457('0x3f')](_0x2fcc34[_0x8457('0x35')],_0x10ddc6['filters']));_0x1fa5c7['raw']=!![];if(_0x2fcc34[_0x8457('0x35')][_0x8457('0x40')]){_0x1fa5c7[_0x8457('0x3e')]=_[_0x8457('0x41')](_0x1fa5c7[_0x8457('0x3e')],{'$or':_[_0x8457('0x2f')](_0x1fa5c7[_0x8457('0x38')],function(_0x52cce7){var _0xc71e57={};_0xc71e57[_0x52cce7]={'$like':'%'+_0x2fcc34[_0x8457('0x35')][_0x8457('0x40')]+'%'};return _0xc71e57;})});}_0x1fa5c7=_['merge']({},_0x1fa5c7,_0x2fcc34['options']);return _0x49f02d[_0x8457('0x66')](_0x1fa5c7);}})[_0x8457('0x27')](respondWithResult(_0x3cc62d,null))[_0x8457('0x46')](handleError(_0x3cc62d,null));};exports[_0x8457('0x6b')]=function(_0x20f473,_0x334f2b,_0x59de6d){var _0x4ba7a2;var _0x3f56c1;var _0x220619;var _0x2da070=_0x20f473['params']['id'];csv_results=[];return db['ContactItemType'][_0x8457('0x44')]({'attributes':['id',_0x8457('0x2d')],'raw':!![],'order':[_0x8457('0x6c')]})[_0x8457('0x27')](function(_0x5c3160){_0x4ba7a2=_0x5c3160;var _0x36d7fd=_[_0x8457('0x34')](db[_0x8457('0x5c')][_0x8457('0x47')]);return db[_0x8457('0x67')][_0x8457('0x44')]({'raw':!![],'attributes':['id',_0x8457('0x6d')]})[_0x8457('0x27')](function(_0x3d1a1c){_0x3f56c1=_0x3d1a1c;var _0x33c432=squel[_0x8457('0x6e')]()['fields'](_0x36d7fd)[_0x8457('0x6f')](_0x8457('0x70'),'c')[_0x8457('0x3e')](_0x8457('0x71'),_0x2da070)[_0x8457('0x3e')](_0x8457('0x72'))['distinct']();for(var _0x17a950=0x0;_0x17a950<_0x3f56c1[_0x8457('0x3a')];_0x17a950++){_0x33c432[_0x8457('0x73')](_0x8457('0x74')+_0x3f56c1[_0x17a950]['id'],_0x8457('0x75')+_0x3f56c1[_0x17a950][_0x8457('0x6d')]);}for(var _0x17a950=0x0;_0x17a950<_0x4ba7a2['length'];_0x17a950++){_0x33c432[_0x8457('0x73')](squel[_0x8457('0x6e')]()[_0x8457('0x73')](_0x8457('0x76'))['from']('cm_contact_has_items')['where'](_0x8457('0x77'),_0x4ba7a2[_0x17a950]['id'])[_0x8457('0x3e')](_0x8457('0x78')),_0x8457('0x79')+_0x4ba7a2[_0x17a950][_0x8457('0x2d')]);_0x33c432['field'](squel['select']()[_0x8457('0x73')](_0x8457('0x7a'))[_0x8457('0x6f')](_0x8457('0x7b'))[_0x8457('0x3e')](_0x8457('0x77'),_0x4ba7a2[_0x17a950]['id'])['where']('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x4ba7a2[_0x17a950][_0x8457('0x2d')]);}var _0x5ebd78=[];_0x5ebd78['push'](_0x33c432['toString']());BPromise['each'](_0x5ebd78,handleQuery)[_0x8457('0x27')](function(_0x1c2518){handleQuery(_0x33c432['toString']());var _0x1348a2=csv_results[0x0];if(!_[_0x8457('0x7c')](_0x1348a2)){var _0x324273=toCsv(_0x1348a2);var _0x36f488=Date[_0x8457('0x7d')]();fs['writeFileSync'](util[_0x8457('0x69')](_0x8457('0x7e'),_0x2da070,_0x36f488),_0x324273);_0x334f2b[_0x8457('0x7f')]('Content-disposition',_0x8457('0x80')+util[_0x8457('0x69')](_0x8457('0x81'),_0x2da070,_0x36f488));_0x334f2b[_0x8457('0x7f')](_0x8457('0x82'),'text/csv');return _0x334f2b[_0x8457('0x83')](util[_0x8457('0x69')](_0x8457('0x7e'),_0x2da070,_0x36f488));}else{return _0x334f2b[_0x8457('0x1b')](0xcc);}});});});};exports['addCustomField']=function(_0x56fe0a,_0x355e61,_0x261cf9){var _0x44f4cb;delete _0x56fe0a[_0x8457('0x4a')]['id'];return db[_0x8457('0x30')][_0x8457('0x58')]({'where':{'id':_0x56fe0a[_0x8457('0x52')]['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x355e61,null))[_0x8457('0x27')](function(_0x20bd2e){if(_0x20bd2e){return db[_0x8457('0x84')][_0x8457('0x85')](function(_0x5d75d0){return db['CmCustomField'][_0x8457('0x49')](_0x56fe0a[_0x8457('0x4a')],{'transaction':_0x5d75d0})[_0x8457('0x27')](function(_0x3d4b6b){_0x44f4cb=_0x3d4b6b;return _0x20bd2e[_0x8457('0x86')](_0x3d4b6b,{'transaction':_0x5d75d0});})[_0x8457('0x27')](function(){var _0x3e2f1f={'type':db['Sequelize'][_0x8457('0x87')],'transaction':_0x5d75d0};switch(_0x56fe0a[_0x8457('0x4a')][_0x8457('0x32')]){case _0x8457('0x88'):_0x3e2f1f[_0x8457('0x32')]=db['Sequelize'][_0x8457('0x87')];break;case'number':_0x3e2f1f['type']=db[_0x8457('0x89')][_0x8457('0x8a')];break;case _0x8457('0x8b'):_0x3e2f1f['type']=db[_0x8457('0x89')][_0x8457('0x8c')];_0x3e2f1f[_0x8457('0x8d')]=![];break;default:}return db[_0x8457('0x84')][_0x8457('0x8e')][_0x8457('0x8f')](_0x8457('0x70'),util[_0x8457('0x69')](_0x8457('0x90'),_0x44f4cb['id']),_0x3e2f1f);})['then'](function(){return _0x44f4cb;});});}})[_0x8457('0x27')](respondWithResult(_0x355e61,null))[_0x8457('0x46')](handleError(_0x355e61,null));};exports[_0x8457('0x91')]=function(_0x94d1a7,_0x5a6ab1,_0x45ff9f){var _0xb06f2c={};var _0x23b3c1={};var _0x4450e4;var _0x42840a;return db[_0x8457('0x30')]['findOne']({'where':{'id':_0x94d1a7[_0x8457('0x52')]['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x5a6ab1,null))[_0x8457('0x27')](function(_0x1cccd8){if(_0x1cccd8){_0x4450e4=_0x1cccd8;_0x23b3c1['model']=_[_0x8457('0x34')](db[_0x8457('0x67')][_0x8457('0x47')]);_0x23b3c1[_0x8457('0x35')]=_[_0x8457('0x34')](_0x94d1a7[_0x8457('0x35')]);_0x23b3c1[_0x8457('0x36')]=_[_0x8457('0x37')](_0x23b3c1[_0x8457('0x33')],_0x23b3c1[_0x8457('0x35')]);_0xb06f2c['attributes']=_[_0x8457('0x37')](_0x23b3c1[_0x8457('0x33')],qs[_0x8457('0x39')](_0x94d1a7[_0x8457('0x35')][_0x8457('0x39')]));_0xb06f2c[_0x8457('0x38')]=_0xb06f2c[_0x8457('0x38')]['length']?_0xb06f2c[_0x8457('0x38')]:_0x23b3c1['model'];_0xb06f2c['order']=qs[_0x8457('0x3d')](_0x94d1a7['query']['sort']);_0xb06f2c[_0x8457('0x3e')]=qs[_0x8457('0x36')](_[_0x8457('0x3f')](_0x94d1a7[_0x8457('0x35')],_0x23b3c1['filters']));_0xb06f2c[_0x8457('0x3e')]=_[_0x8457('0x41')](_0xb06f2c[_0x8457('0x3e')],{'$or':[{'ListId':_0x1cccd8['id']},{'ListId':null}]});if(_0x94d1a7[_0x8457('0x35')][_0x8457('0x40')]){_0xb06f2c[_0x8457('0x3e')]=_[_0x8457('0x41')](_0xb06f2c[_0x8457('0x3e')],{'$or':_['map'](_0xb06f2c[_0x8457('0x38')],function(_0x2356f9){var _0x460cf4={};_0x460cf4[_0x2356f9]={'$like':'%'+_0x94d1a7[_0x8457('0x35')]['filter']+'%'};return _0x460cf4;})});}_0xb06f2c=_[_0x8457('0x41')]({},_0xb06f2c,_0x94d1a7[_0x8457('0x42')]);return db[_0x8457('0x67')][_0x8457('0x92')](_0xb06f2c);}})['then'](respondWithResult(_0x5a6ab1,null))[_0x8457('0x46')](handleError(_0x5a6ab1,null));};exports[_0x8457('0x93')]=function(_0x19b85d,_0x3502cd){return db['CmCustomField'][_0x8457('0x92')]({'where':{'ListId':null}})[_0x8457('0x27')](handleEntityNotFound(_0x3502cd,null))[_0x8457('0x27')](function(_0x44fcb6){return _0x44fcb6;})['then'](respondWithResult(_0x3502cd,null))[_0x8457('0x46')](handleError(_0x3502cd,null));};exports['addAgents']=function(_0x56a055,_0x5910af,_0x302fc5){return db['CmList']['find']({'where':{'id':_0x56a055['params']['id']}})['then'](handleEntityNotFound(_0x5910af,null))[_0x8457('0x27')](function(_0x35243b){if(_0x35243b){return _0x35243b[_0x8457('0x94')](_0x56a055[_0x8457('0x4a')][_0x8457('0x61')],_[_0x8457('0x95')](_0x56a055[_0x8457('0x4a')],[_0x8457('0x61'),'id'])||{})['spread'](function(_0x3b4b69){for(var _0x1d1f7c=0x0;_0x1d1f7c<_0x56a055[_0x8457('0x4a')][_0x8457('0x61')]['length'];_0x1d1f7c+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x56a055[_0x8457('0x4a')][_0x8457('0x61')][_0x1d1f7c]),'CmListId':Number(_0x56a055['params']['id'])});}return _0x3b4b69;});}})[_0x8457('0x27')](respondWithResult(_0x5910af,null))[_0x8457('0x46')](handleError(_0x5910af,null));};exports[_0x8457('0x96')]=function(_0x3e83f5,_0x389a31,_0x4bc703){return db['CmList']['find']({'where':{'id':_0x3e83f5['params']['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x389a31,null))[_0x8457('0x27')](function(_0x17f7ed){if(_0x17f7ed){return _0x17f7ed[_0x8457('0x96')](_0x3e83f5[_0x8457('0x35')]['ids'])['then'](function(){if(_[_0x8457('0x5e')](_0x3e83f5['query']['ids'])){for(var _0xd7940e=0x0;_0xd7940e<_0x3e83f5[_0x8457('0x35')][_0x8457('0x61')][_0x8457('0x3a')];_0xd7940e+=0x1){socket['emit'](_0x8457('0x97'),{'UserId':Number(_0x3e83f5[_0x8457('0x35')][_0x8457('0x61')][_0xd7940e]),'CmListId':Number(_0x3e83f5[_0x8457('0x52')]['id'])});}}else{socket[_0x8457('0x98')]('userCmList:remove',{'UserId':Number(_0x3e83f5['query']['ids']),'CmListId':Number(_0x3e83f5[_0x8457('0x52')]['id'])});}});}})[_0x8457('0x27')](respondWithStatusCode(_0x389a31,null))[_0x8457('0x46')](handleError(_0x389a31,null));};exports[_0x8457('0x99')]=function(_0x386886,_0x567e42,_0x475177){var _0x590007={};var _0x125793={};var _0x2ab9cd;var _0x1fdc4d;return db[_0x8457('0x30')][_0x8457('0x58')]({'where':{'id':_0x386886['params']['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x567e42,null))[_0x8457('0x27')](function(_0x2a0826){if(_0x2a0826){_0x2ab9cd=_0x2a0826;_0x125793[_0x8457('0x33')]=_[_0x8457('0x34')](db['User']['rawAttributes']);_0x125793[_0x8457('0x35')]=_[_0x8457('0x34')](_0x386886[_0x8457('0x35')]);_0x125793[_0x8457('0x36')]=_['intersection'](_0x125793[_0x8457('0x33')],_0x125793[_0x8457('0x35')]);_0x590007[_0x8457('0x38')]=_[_0x8457('0x37')](_0x125793['model'],qs[_0x8457('0x39')](_0x386886[_0x8457('0x35')][_0x8457('0x39')]));_0x590007[_0x8457('0x38')]=_0x590007['attributes'][_0x8457('0x3a')]?_0x590007[_0x8457('0x38')]:_0x125793['model'];_0x590007['order']=qs[_0x8457('0x3d')](_0x386886[_0x8457('0x35')][_0x8457('0x3d')]);_0x590007[_0x8457('0x3e')]=qs[_0x8457('0x36')](_['pick'](_0x386886[_0x8457('0x35')],_0x125793[_0x8457('0x36')]));if(_0x386886[_0x8457('0x35')][_0x8457('0x40')]){_0x590007[_0x8457('0x3e')]=_[_0x8457('0x41')](_0x590007[_0x8457('0x3e')],{'$or':_['map'](_0x590007['attributes'],function(_0x3f3cbc){var _0x5fa3fe={};_0x5fa3fe[_0x3f3cbc]={'$like':'%'+_0x386886[_0x8457('0x35')][_0x8457('0x40')]+'%'};return _0x5fa3fe;})});}_0x590007=_[_0x8457('0x41')]({},_0x590007,_0x386886[_0x8457('0x42')]);return _0x2ab9cd['getAgents'](_0x590007);}})[_0x8457('0x27')](function(_0x5e4dc5){if(_0x5e4dc5){_0x1fdc4d=_0x5e4dc5[_0x8457('0x3a')];if(!_0x386886[_0x8457('0x35')][_0x8457('0x3b')](_0x8457('0x59'))){_0x590007[_0x8457('0x21')]=qs[_0x8457('0x21')](_0x386886[_0x8457('0x35')][_0x8457('0x21')]);_0x590007[_0x8457('0x1f')]=qs[_0x8457('0x1f')](_0x386886[_0x8457('0x35')][_0x8457('0x1f')]);}return _0x2ab9cd['getAgents'](_0x590007);}})[_0x8457('0x27')](function(_0x1737c4){if(_0x1737c4){return _0x1737c4?{'count':_0x1fdc4d,'rows':_0x1737c4}:null;}})[_0x8457('0x27')](respondWithResult(_0x567e42,null))[_0x8457('0x46')](handleError(_0x567e42,null));};function handleQuery(_0x18875c){logger[_0x8457('0x9a')](_0x18875c);return db[_0x8457('0x84')][_0x8457('0x35')](_0x18875c)[_0x8457('0x9b')](function(_0x2aee34){csv_results[_0x8457('0x5f')](_0x2aee34);})[_0x8457('0x46')](function(_0x5afd1d){logger[_0x8457('0x2b')](_0x5afd1d[_0x8457('0x9c')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 3731748..2f1d612 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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe14b,0x93));var _0xbe14=function(_0x1d767c,_0x129161){_0x1d767c=_0x1d767c-0x0;var _0x1d51dd=_0xe14b[_0x1d767c];return _0x1d51dd;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x101cd1,_0x9e28ef){var _0x2e50b0=function(_0x5988d2){while(--_0x5988d2){_0x101cd1['push'](_0x101cd1['shift']());}};_0x2e50b0(++_0x9e28ef);}(_0x814b,0x1a2));var _0xb814=function(_0x1352f0,_0x4cd565){_0x1352f0=_0x1352f0-0x0;var _0x1c2a82=_0x814b[_0x1352f0];return _0x1c2a82;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 5134801..64113b9 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 _0xd2ea=['cm_lists','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList'];(function(_0x349148,_0x31eabb){var _0x2f2b0f=function(_0x44726e){while(--_0x44726e){_0x349148['push'](_0x349148['shift']());}};_0x2f2b0f(++_0x31eabb);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2259df,_0xf688f){_0x2259df=_0x2259df-0x0;var _0x118d5c=_0xd2ea[_0x2259df];return _0x118d5c;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x1da8d4,_0x36fb41){var _0x3b9c91=function(_0x2bd764){while(--_0x2bd764){_0x1da8d4['push'](_0x1da8d4['shift']());}};_0x3b9c91(++_0x36fb41);}(_0xee5b,0x1f4));var _0xbee5=function(_0x26cb1f,_0x1f053d){_0x26cb1f=_0x26cb1f-0x0;var _0x17b417=_0xee5b[_0x26cb1f];return _0x17b417;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('CmList',attributes,{'tableName':'cm_lists','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 21ac13d..aa808d9 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 _0x23fd=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','request','then','info','debug','request\x20sent','error','message','CmList,\x20%s,\x20%s','result','catch','moment','bluebird'];(function(_0x4cd4e4,_0x1857a2){var _0x18cf3b=function(_0x27ea45){while(--_0x27ea45){_0x4cd4e4['push'](_0x4cd4e4['shift']());}};_0x18cf3b(++_0x1857a2);}(_0x23fd,0x111));var _0xd23f=function(_0x4f62c9,_0x5e5b63){_0x4f62c9=_0x4f62c9-0x0;var _0x4dca96=_0x23fd[_0x4f62c9];return _0x4dca96;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd23f('0x0'));var BPromise=require(_0xd23f('0x1'));var rs=require(_0xd23f('0x2'));var fs=require('fs');var Redis=require(_0xd23f('0x3'));var db=require(_0xd23f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd23f('0x5'))(_0xd23f('0x6'));var config=require(_0xd23f('0x7'));var jayson=require(_0xd23f('0x8'));var client=jayson[_0xd23f('0x9')][_0xd23f('0xa')]({'port':0x232a});config[_0xd23f('0xb')]=_['defaults'](config[_0xd23f('0xb')],{'host':_0xd23f('0xc'),'port':0x18eb});var socket=require(_0xd23f('0xd'))(new Redis(config['redis']));require(_0xd23f('0xe'))['register'](socket);function respondWithRpcPromise(_0x15c97d,_0x2e2811,_0x231806){return new BPromise(function(_0x21673a,_0x2fcac3){return client[_0xd23f('0xf')](_0x15c97d,_0x231806)[_0xd23f('0x10')](function(_0x311b67){logger[_0xd23f('0x11')]('CmList,\x20%s,\x20%s',_0x2e2811,'request\x20sent');logger[_0xd23f('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x2e2811,_0xd23f('0x13'),JSON['stringify'](_0x311b67));if(_0x311b67[_0xd23f('0x14')]){if(_0x311b67[_0xd23f('0x14')]['code']===0x1f4){logger[_0xd23f('0x14')]('CmList,\x20%s,\x20%s',_0x2e2811,_0x311b67['error'][_0xd23f('0x15')]);return _0x2fcac3(_0x311b67[_0xd23f('0x14')]['message']);}logger[_0xd23f('0x14')](_0xd23f('0x16'),_0x2e2811,_0x311b67['error'][_0xd23f('0x15')]);return _0x21673a(_0x311b67[_0xd23f('0x14')][_0xd23f('0x15')]);}else{logger[_0xd23f('0x11')](_0xd23f('0x16'),_0x2e2811,'request\x20sent');_0x21673a(_0x311b67[_0xd23f('0x17')]['message']);}})[_0xd23f('0x18')](function(_0x1f35cd){logger[_0xd23f('0x14')](_0xd23f('0x16'),_0x2e2811,_0x1f35cd);_0x2fcac3(_0x1f35cd);});});} \ No newline at end of file +var _0xebaf=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1d801d,_0x2136a1){var _0x4f81ff=function(_0x4bb819){while(--_0x4bb819){_0x1d801d['push'](_0x1d801d['shift']());}};_0x4f81ff(++_0x2136a1);}(_0xebaf,0x1cf));var _0xfeba=function(_0x4ebfa7,_0x23a53f){_0x4ebfa7=_0x4ebfa7-0x0;var _0x3c0a97=_0xebaf[_0x4ebfa7];return _0x3c0a97;};'use strict';var _=require(_0xfeba('0x0'));var util=require(_0xfeba('0x1'));var moment=require(_0xfeba('0x2'));var BPromise=require(_0xfeba('0x3'));var rs=require(_0xfeba('0x4'));var fs=require('fs');var Redis=require(_0xfeba('0x5'));var db=require(_0xfeba('0x6'))['db'];var utils=require(_0xfeba('0x7'));var logger=require('../../config/logger')(_0xfeba('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfeba('0x9')][_0xfeba('0xa')]({'port':0x232a});config[_0xfeba('0xb')]=_[_0xfeba('0xc')](config[_0xfeba('0xb')],{'host':_0xfeba('0xd'),'port':0x18eb});var socket=require(_0xfeba('0xe'))(new Redis(config[_0xfeba('0xb')]));require(_0xfeba('0xf'))['register'](socket);function respondWithRpcPromise(_0x5dc5ea,_0x431e0c,_0x17de00){return new BPromise(function(_0x1fa5ed,_0x222d18){return client[_0xfeba('0x10')](_0x5dc5ea,_0x17de00)[_0xfeba('0x11')](function(_0x57bad3){logger[_0xfeba('0x12')](_0xfeba('0x13'),_0x431e0c,_0xfeba('0x14'));logger[_0xfeba('0x15')](_0xfeba('0x16'),_0x431e0c,'request\x20sent',JSON[_0xfeba('0x17')](_0x57bad3));if(_0x57bad3[_0xfeba('0x18')]){if(_0x57bad3[_0xfeba('0x18')][_0xfeba('0x19')]===0x1f4){logger[_0xfeba('0x18')](_0xfeba('0x13'),_0x431e0c,_0x57bad3[_0xfeba('0x18')]['message']);return _0x222d18(_0x57bad3[_0xfeba('0x18')][_0xfeba('0x1a')]);}logger['error'](_0xfeba('0x13'),_0x431e0c,_0x57bad3['error']['message']);return _0x1fa5ed(_0x57bad3[_0xfeba('0x18')][_0xfeba('0x1a')]);}else{logger[_0xfeba('0x12')](_0xfeba('0x13'),_0x431e0c,'request\x20sent');_0x1fa5ed(_0x57bad3[_0xfeba('0x1b')][_0xfeba('0x1a')]);}})[_0xfeba('0x1c')](function(_0x162228){logger[_0xfeba('0x18')](_0xfeba('0x13'),_0x431e0c,_0x162228);_0x222d18(_0x162228);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 97e20e7..eacafbf 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 _0x0e61=['emit','removeListener','register','length','cmList:','save','remove','update'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x0e61,0xbd));var _0x10e6=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0x0e61[_0x3c858f];return _0x198090;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x10e6('0x0'),_0x10e6('0x1'),_0x10e6('0x2')];function createListener(_0x160ddb,_0x17c60f){return function(_0x31f861){_0x17c60f[_0x10e6('0x3')](_0x160ddb,_0x31f861);};}function removeListener(_0x34f467,_0x786989){return function(){CmListEvents[_0x10e6('0x4')](_0x34f467,_0x786989);};}exports[_0x10e6('0x5')]=function(_0x24df1a){for(var _0x213578=0x0,_0x39904d=events[_0x10e6('0x6')];_0x213578<_0x39904d;_0x213578++){var _0x41d208=events[_0x213578];var _0x2db637=createListener(_0x10e6('0x7')+_0x41d208,_0x24df1a);CmListEvents['on'](_0x41d208,_0x2db637);}}; \ No newline at end of file +var _0x8211=['./cmList.events','save','update','removeListener','register','length'];(function(_0x21b89e,_0x3d5f66){var _0x4e02cc=function(_0x2aa6f3){while(--_0x2aa6f3){_0x21b89e['push'](_0x21b89e['shift']());}};_0x4e02cc(++_0x3d5f66);}(_0x8211,0x78));var _0x1821=function(_0x376593,_0x5cdd4a){_0x376593=_0x376593-0x0;var _0x1dba8d=_0x8211[_0x376593];return _0x1dba8d;};'use strict';var CmListEvents=require(_0x1821('0x0'));var events=[_0x1821('0x1'),'remove',_0x1821('0x2')];function createListener(_0xb3f8ce,_0x15d9b6){return function(_0x568333){_0x15d9b6['emit'](_0xb3f8ce,_0x568333);};}function removeListener(_0xbb87d4,_0x33398d){return function(){CmListEvents[_0x1821('0x3')](_0xbb87d4,_0x33398d);};}exports[_0x1821('0x4')]=function(_0x8eb94c){for(var _0x2731b8=0x0,_0x5ccd61=events[_0x1821('0x5')];_0x2731b8<_0x5ccd61;_0x2731b8++){var _0x41ff1b=events[_0x2731b8];var _0x5848b8=createListener('cmList:'+_0x41ff1b,_0x8eb94c);CmListEvents['on'](_0x41ff1b,_0x5848b8);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 940a21d..446b6d6 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 _0x24ab=['addAgents','delete','destroy','removeDispositions','removeAgents','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','/:id/fields','getCustomFields','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','/:id/users'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x24ab,0x13c));var _0xb24a=function(_0x52917e,_0x23ebac){_0x52917e=_0x52917e-0x0;var _0x6ac3da=_0x24ab[_0x52917e];return _0x6ac3da;};'use strict';var multer=require(_0xb24a('0x0'));var util=require('util');var path=require(_0xb24a('0x1'));var timeout=require('connect-timeout');var express=require(_0xb24a('0x2'));var router=express['Router']();var fs_extra=require(_0xb24a('0x3'));var auth=require(_0xb24a('0x4'));var interaction=require(_0xb24a('0x5'));var config=require(_0xb24a('0x6'));var controller=require(_0xb24a('0x7'));router[_0xb24a('0x8')]('/',auth[_0xb24a('0x9')](),controller['index']);router[_0xb24a('0x8')](_0xb24a('0xa'),auth[_0xb24a('0x9')](),controller[_0xb24a('0xb')]);router[_0xb24a('0x8')](_0xb24a('0xc'),auth[_0xb24a('0x9')](),controller[_0xb24a('0xd')]);router[_0xb24a('0x8')](_0xb24a('0xe'),auth[_0xb24a('0x9')](),controller['show']);router[_0xb24a('0x8')](_0xb24a('0xf'),auth[_0xb24a('0x9')](),controller['getDispositions']);router[_0xb24a('0x8')]('/:id/contacts',auth[_0xb24a('0x9')](),controller['getContacts']);router[_0xb24a('0x8')]('/:id/contacts/csv',auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xb24a('0x8')](_0xb24a('0x10'),auth['isAuthenticated'](),controller[_0xb24a('0x11')]);router[_0xb24a('0x8')]('/:id/users',auth[_0xb24a('0x9')](),controller['getAgents']);router[_0xb24a('0x12')]('/',auth[_0xb24a('0x9')](),controller[_0xb24a('0x13')]);router[_0xb24a('0x12')](_0xb24a('0xf'),auth['isAuthenticated'](),controller[_0xb24a('0x14')]);router[_0xb24a('0x12')](_0xb24a('0x15'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x16')]);router['post']('/:id/fields',auth[_0xb24a('0x9')](),controller[_0xb24a('0x17')]);router[_0xb24a('0x12')](_0xb24a('0x18'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x19')]);router['put'](_0xb24a('0xe'),auth[_0xb24a('0x9')](),controller['update']);router[_0xb24a('0x1a')](_0xb24a('0xe'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x1b')]);router[_0xb24a('0x1a')](_0xb24a('0xf'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x1c')]);router[_0xb24a('0x1a')](_0xb24a('0x18'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x1d')]);module[_0xb24a('0x1e')]=router; \ No newline at end of file +var _0xec02=['util','path','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','/:id/contacts','/:id/fields','addCustomField','put','delete','destroy','removeDispositions','removeAgents','exports'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xec02,0x1ef));var _0x2ec0=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xec02[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require(_0x2ec0('0x0'));var path=require(_0x2ec0('0x1'));var timeout=require('connect-timeout');var express=require(_0x2ec0('0x2'));var router=express[_0x2ec0('0x3')]();var fs_extra=require(_0x2ec0('0x4'));var auth=require(_0x2ec0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmList.controller');router['get']('/',auth[_0x2ec0('0x6')](),controller[_0x2ec0('0x7')]);router[_0x2ec0('0x8')](_0x2ec0('0x9'),auth[_0x2ec0('0x6')](),controller[_0x2ec0('0xa')]);router[_0x2ec0('0x8')](_0x2ec0('0xb'),auth['isAuthenticated'](),controller[_0x2ec0('0xc')]);router[_0x2ec0('0x8')](_0x2ec0('0xd'),auth[_0x2ec0('0x6')](),controller[_0x2ec0('0xe')]);router[_0x2ec0('0x8')](_0x2ec0('0xf'),auth[_0x2ec0('0x6')](),controller['getDispositions']);router[_0x2ec0('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x2ec0('0x10')]);router[_0x2ec0('0x8')](_0x2ec0('0x11'),auth['isAuthenticated'](),controller[_0x2ec0('0x12')]);router[_0x2ec0('0x8')]('/:id/fields',auth[_0x2ec0('0x6')](),controller[_0x2ec0('0x13')]);router['get'](_0x2ec0('0x14'),auth[_0x2ec0('0x6')](),controller[_0x2ec0('0x15')]);router[_0x2ec0('0x16')]('/',auth[_0x2ec0('0x6')](),controller[_0x2ec0('0x17')]);router[_0x2ec0('0x16')](_0x2ec0('0xf'),auth[_0x2ec0('0x6')](),controller['addDisposition']);router['post'](_0x2ec0('0x18'),auth[_0x2ec0('0x6')](),controller['addContacts']);router['post'](_0x2ec0('0x19'),auth['isAuthenticated'](),controller[_0x2ec0('0x1a')]);router[_0x2ec0('0x16')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x2ec0('0x1b')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2ec0('0x1c')](_0x2ec0('0xd'),auth['isAuthenticated'](),controller[_0x2ec0('0x1d')]);router['delete']('/:id/dispositions',auth[_0x2ec0('0x6')](),controller[_0x2ec0('0x1e')]);router[_0x2ec0('0x1c')](_0x2ec0('0x14'),auth[_0x2ec0('0x6')](),controller[_0x2ec0('0x1f')]);module[_0x2ec0('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index c97abf7..beb4fa6 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 _0xc165=['getDataValue','field','STRING','sequelize','exports','VIRTUAL'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0xc165,0xab));var _0x5c16=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xc165[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x5c16('0x0'));module[_0x5c16('0x1')]={'name':{'type':Sequelize[_0x5c16('0x2')],'get':function(_0x4293f1){return this[_0x5c16('0x3')](_0x5c16('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x5c16('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x5c16('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x6171=['exports','VIRTUAL','field','STRING'];(function(_0xfed299,_0x21b8d0){var _0x4ef1f2=function(_0x347a84){while(--_0x347a84){_0xfed299['push'](_0xfed299['shift']());}};_0x4ef1f2(++_0x21b8d0);}(_0x6171,0x11c));var _0x1617=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x6171[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require('sequelize');module[_0x1617('0x0')]={'name':{'type':Sequelize[_0x1617('0x1')],'get':function(_0x1e411b){return this['getDataValue'](_0x1617('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x1617('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x1617('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 7b1d281..14122ce 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(_0x541306,_0x5210ac){var _0x257c9f=function(_0x4bb8a5){while(--_0x4bb8a5){_0x541306['push'](_0x541306['shift']());}};_0x257c9f(++_0x5210ac);}(_0x7a54,0x106));var _0x47a5=function(_0x147b9b,_0x15670b){_0x147b9b=_0x147b9b-0x0;var _0x9c7ac5=_0x7a54[_0x147b9b];return _0x9c7ac5;};'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(_0x4ef272,_0x4d3343){var _0x45463a=function(_0xa08ef0){while(--_0xa08ef0){_0x4ef272['push'](_0x4ef272['shift']());}};_0x45463a(++_0x4d3343);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 4e90b3c..0968855 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 _0xe1a3=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xe1a3,0x1ab));var _0x3e1a=function(_0x592df2,_0x613eae){_0x592df2=_0x592df2-0x0;var _0x40b754=_0xe1a3[_0x592df2];return _0x40b754;};'use strict';var _=require(_0x3e1a('0x0'));var util=require(_0x3e1a('0x1'));var logger=require(_0x3e1a('0x2'))(_0x3e1a('0x3'));var moment=require(_0x3e1a('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e1a('0x5'));var fs=require('fs');var path=require(_0x3e1a('0x6'));var rimraf=require(_0x3e1a('0x7'));var config=require(_0x3e1a('0x8'));var attributes=require(_0x3e1a('0x9'));module[_0x3e1a('0xa')]=function(_0x457c83,_0x19b337){return _0x457c83[_0x3e1a('0xb')](_0x3e1a('0xc'),attributes,{'tableName':_0x3e1a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd14=['request-promise','path','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','../../config/logger','api','moment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xfd14,0x15d));var _0x4fd1=function(_0x193afa,_0x58cd72){_0x193afa=_0x193afa-0x0;var _0x2cf7d4=_0xfd14[_0x193afa];return _0x2cf7d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4fd1('0x0'))(_0x4fd1('0x1'));var moment=require(_0x4fd1('0x2'));var BPromise=require('bluebird');var rp=require(_0x4fd1('0x3'));var fs=require('fs');var path=require(_0x4fd1('0x4'));var rimraf=require('rimraf');var config=require(_0x4fd1('0x5'));var attributes=require(_0x4fd1('0x6'));module[_0x4fd1('0x7')]=function(_0x1a5ae5,_0x24dc90){return _0x1a5ae5[_0x4fd1('0x8')](_0x4fd1('0x9'),attributes,{'tableName':_0x4fd1('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 81eaf73..8f19833 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 _0x5fb0=['jayson/promise','client','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1dced7,_0x2f6417){var _0x1f2b69=function(_0x1c1f45){while(--_0x1c1f45){_0x1dced7['push'](_0x1dced7['shift']());}};_0x1f2b69(++_0x2f6417);}(_0x5fb0,0x1b1));var _0x05fb=function(_0x14d99c,_0xa1b029){_0x14d99c=_0x14d99c-0x0;var _0x2a8f65=_0x5fb0[_0x14d99c];return _0x2a8f65;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x05fb('0x0'));var BPromise=require('bluebird');var rs=require(_0x05fb('0x1'));var fs=require('fs');var Redis=require(_0x05fb('0x2'));var db=require(_0x05fb('0x3'))['db'];var utils=require(_0x05fb('0x4'));var logger=require(_0x05fb('0x5'))(_0x05fb('0x6'));var config=require(_0x05fb('0x7'));var jayson=require(_0x05fb('0x8'));var client=jayson[_0x05fb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27b865,_0x2a04bf,_0x47277f){return new BPromise(function(_0x3c2169,_0x5133b8){return client[_0x05fb('0xa')](_0x27b865,_0x47277f)['then'](function(_0x4bc2c5){logger[_0x05fb('0xb')](_0x05fb('0xc'),_0x2a04bf,_0x05fb('0xd'));logger[_0x05fb('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x2a04bf,'request\x20sent',JSON[_0x05fb('0xf')](_0x4bc2c5));if(_0x4bc2c5[_0x05fb('0x10')]){if(_0x4bc2c5['error'][_0x05fb('0x11')]===0x1f4){logger[_0x05fb('0x10')](_0x05fb('0xc'),_0x2a04bf,_0x4bc2c5[_0x05fb('0x10')]['message']);return _0x5133b8(_0x4bc2c5[_0x05fb('0x10')][_0x05fb('0x12')]);}logger['error']('Condition,\x20%s,\x20%s',_0x2a04bf,_0x4bc2c5[_0x05fb('0x10')]['message']);return _0x3c2169(_0x4bc2c5[_0x05fb('0x10')]['message']);}else{logger['info'](_0x05fb('0xc'),_0x2a04bf,_0x05fb('0xd'));_0x3c2169(_0x4bc2c5[_0x05fb('0x13')][_0x05fb('0x12')]);}})[_0x05fb('0x14')](function(_0x140f5d){logger['error']('Condition,\x20%s,\x20%s',_0x2a04bf,_0x140f5d);_0x5133b8(_0x140f5d);});});} \ No newline at end of file +var _0xf064=['lodash','util','moment','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x2c64a0,_0x52f641){var _0x1c1ba3=function(_0x3b7c97){while(--_0x3b7c97){_0x2c64a0['push'](_0x2c64a0['shift']());}};_0x1c1ba3(++_0x52f641);}(_0xf064,0x1ee));var _0x4f06=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xf064[_0x39cf70];return _0x580424;};'use strict';var _=require(_0x4f06('0x0'));var util=require(_0x4f06('0x1'));var moment=require(_0x4f06('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f06('0x3'));var logger=require(_0x4f06('0x4'))(_0x4f06('0x5'));var config=require('../../config/environment');var jayson=require(_0x4f06('0x6'));var client=jayson['client'][_0x4f06('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x533aa4,_0x159a9d,_0x44b5f4){return new BPromise(function(_0x55c3fa,_0x454b3f){return client[_0x4f06('0x8')](_0x533aa4,_0x44b5f4)[_0x4f06('0x9')](function(_0x444399){logger[_0x4f06('0xa')](_0x4f06('0xb'),_0x159a9d,_0x4f06('0xc'));logger['debug'](_0x4f06('0xd'),_0x159a9d,'request\x20sent',JSON['stringify'](_0x444399));if(_0x444399[_0x4f06('0xe')]){if(_0x444399[_0x4f06('0xe')][_0x4f06('0xf')]===0x1f4){logger[_0x4f06('0xe')](_0x4f06('0xb'),_0x159a9d,_0x444399[_0x4f06('0xe')][_0x4f06('0x10')]);return _0x454b3f(_0x444399[_0x4f06('0xe')]['message']);}logger[_0x4f06('0xe')](_0x4f06('0xb'),_0x159a9d,_0x444399[_0x4f06('0xe')][_0x4f06('0x10')]);return _0x55c3fa(_0x444399[_0x4f06('0xe')][_0x4f06('0x10')]);}else{logger[_0x4f06('0xa')](_0x4f06('0xb'),_0x159a9d,_0x4f06('0xc'));_0x55c3fa(_0x444399[_0x4f06('0x11')][_0x4f06('0x10')]);}})[_0x4f06('0x12')](function(_0x2fca57){logger[_0x4f06('0xe')](_0x4f06('0xb'),_0x159a9d,_0x2fca57);_0x454b3f(_0x2fca57);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index d64e9c1..0e8e2a2 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 _0x8158=['./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8158,0x167));var _0x8815=function(_0x456404,_0x2aaf71){_0x456404=_0x456404-0x0;var _0x4e030d=_0x8158[_0x456404];return _0x4e030d;};'use strict';var multer=require('multer');var util=require(_0x8815('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8815('0x1'));var router=express[_0x8815('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8815('0x3'));var interaction=require(_0x8815('0x4'));var config=require('../../config/environment');var controller=require(_0x8815('0x5'));router[_0x8815('0x6')](_0x8815('0x7'),auth['isAuthenticated'](),controller[_0x8815('0x8')]);router[_0x8815('0x9')](_0x8815('0x7'),auth[_0x8815('0xa')](),controller[_0x8815('0xb')]);module[_0x8815('0xc')]=router; \ No newline at end of file +var _0x22f7=['put','/:id','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x56b04e,_0x471ebc){var _0x4149b9=function(_0x591220){while(--_0x591220){_0x56b04e['push'](_0x56b04e['shift']());}};_0x4149b9(++_0x471ebc);}(_0x22f7,0xf6));var _0x722f=function(_0x308134,_0x1a5b81){_0x308134=_0x308134-0x0;var _0x148164=_0x22f7[_0x308134];return _0x148164;};'use strict';var multer=require(_0x722f('0x0'));var util=require(_0x722f('0x1'));var path=require(_0x722f('0x2'));var timeout=require(_0x722f('0x3'));var express=require(_0x722f('0x4'));var router=express['Router']();var fs_extra=require(_0x722f('0x5'));var auth=require(_0x722f('0x6'));var interaction=require(_0x722f('0x7'));var config=require(_0x722f('0x8'));var controller=require('./condition.controller');router[_0x722f('0x9')](_0x722f('0xa'),auth[_0x722f('0xb')](),controller[_0x722f('0xc')]);router[_0x722f('0xd')](_0x722f('0xa'),auth['isAuthenticated'](),controller[_0x722f('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 025e60e..e4b3b87 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 _0x4576=['STRING','name','INTEGER','exports'];(function(_0x507ac5,_0x33aaee){var _0x12c1bc=function(_0x5c953c){while(--_0x5c953c){_0x507ac5['push'](_0x507ac5['shift']());}};_0x12c1bc(++_0x33aaee);}(_0x4576,0x17f));var _0x6457=function(_0x4722e3,_0x1828df){_0x4722e3=_0x4722e3-0x0;var _0x36e4b4=_0x4576[_0x4722e3];return _0x36e4b4;};'use strict';var Sequelize=require('sequelize');module[_0x6457('0x0')]={'name':{'type':Sequelize[_0x6457('0x1')],'allowNull':![],'unique':_0x6457('0x2')},'OrderBy':{'type':Sequelize[_0x6457('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x6457('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x6824=['name','INTEGER','sequelize','exports','STRING'];(function(_0x344357,_0x484651){var _0x1aaa49=function(_0x8392f0){while(--_0x8392f0){_0x344357['push'](_0x344357['shift']());}};_0x1aaa49(++_0x484651);}(_0x6824,0x98));var _0x4682=function(_0x27a012,_0x154c10){_0x27a012=_0x27a012-0x0;var _0x4592ce=_0x6824[_0x27a012];return _0x4592ce;};'use strict';var Sequelize=require(_0x4682('0x0'));module[_0x4682('0x1')]={'name':{'type':Sequelize[_0x4682('0x2')],'allowNull':![],'unique':_0x4682('0x3')},'OrderBy':{'type':Sequelize[_0x4682('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x4682('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 91fc328..17392d5 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 _0x93e9=['send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','ContactItemType','includeAll','include','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93e9,0xcc));var _0x993e=function(_0x5b55c4,_0x2a95dc){_0x5b55c4=_0x5b55c4-0x0;var _0x468c6a=_0x93e9[_0x5b55c4];return _0x468c6a;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];function respondWithStatusCode(_0x5d5c0d,_0x4c2707){_0x4c2707=_0x4c2707||0xcc;return function(_0x31ece2){if(_0x31ece2){return _0x5d5c0d[_0x993e('0x19')](_0x4c2707);}return _0x5d5c0d[_0x993e('0x1a')](_0x4c2707)[_0x993e('0x1b')]();};}function respondWithResult(_0x3e082b,_0x397b42){_0x397b42=_0x397b42||0xc8;return function(_0x34ddda){if(_0x34ddda){return _0x3e082b[_0x993e('0x1a')](_0x397b42)[_0x993e('0x1c')](_0x34ddda);}};}function respondWithFilteredResult(_0xa43a4e,_0x1a7726){return function(_0x135771){if(_0x135771){var _0x3df0e7=typeof _0x1a7726[_0x993e('0x1d')]===_0x993e('0x1e')&&typeof _0x1a7726[_0x993e('0x1f')]===_0x993e('0x1e');var _0x526e06=_0x135771[_0x993e('0x20')];var _0x1acd21=_0x3df0e7?0x0:_0x1a7726[_0x993e('0x1d')];var _0x3d6109=_0x3df0e7?_0x135771[_0x993e('0x20')]:_0x1a7726[_0x993e('0x1d')]+_0x1a7726['limit'];var _0x11cd41;if(_0x3d6109>=_0x526e06){_0x3d6109=_0x526e06;_0x11cd41=0xc8;}else{_0x11cd41=0xce;}_0xa43a4e[_0x993e('0x1a')](_0x11cd41);return _0xa43a4e[_0x993e('0x21')](_0x993e('0x22'),_0x1acd21+'-'+_0x3d6109+'/'+_0x526e06)[_0x993e('0x1c')](_0x135771);}return null;};}function patchUpdates(_0x425ab4){return function(_0x29e48d){try{jsonpatch[_0x993e('0x23')](_0x29e48d,_0x425ab4,!![]);}catch(_0x4bbe9c){return BPromise[_0x993e('0x24')](_0x4bbe9c);}return _0x29e48d['save']();};}function saveUpdates(_0x11f6f4,_0x37ff57){return function(_0x32b09e){if(_0x32b09e){return _0x32b09e['update'](_0x11f6f4)[_0x993e('0x25')](function(_0x13db4e){return _0x13db4e;});}return null;};}function removeEntity(_0xfba00f,_0x1c52fd){return function(_0x3b45ef){if(_0x3b45ef){return _0x3b45ef[_0x993e('0x26')]()[_0x993e('0x25')](function(){var _0x3ad96f=_0x3b45ef[_0x993e('0x27')]({'plain':!![]});var _0x18f6ac=_0x993e('0x28');return db[_0x993e('0x29')]['destroy']({'where':{'type':_0x18f6ac,'resourceId':_0x3ad96f['id']}})[_0x993e('0x25')](function(){return _0x3b45ef;});})[_0x993e('0x25')](function(){_0xfba00f['status'](0xcc)[_0x993e('0x1b')]();});}};}function handleEntityNotFound(_0x4f5cc1,_0x14a0c7){return function(_0xa03fbd){if(!_0xa03fbd){_0x4f5cc1[_0x993e('0x19')](0x194);}return _0xa03fbd;};}function handleError(_0x2ff973,_0x5c7507){_0x5c7507=_0x5c7507||0x1f4;return function(_0x48d457){logger[_0x993e('0x2a')](_0x48d457[_0x993e('0x2b')]);if(_0x48d457['name']){delete _0x48d457[_0x993e('0x2c')];}_0x2ff973[_0x993e('0x1a')](_0x5c7507)[_0x993e('0x2d')](_0x48d457);};}exports['index']=function(_0x2495b7,_0x9e0309){var _0x1f5d51={},_0x1fa8a5={},_0x2599ec={'count':0x0,'rows':[]};var _0x54da4e=_[_0x993e('0x2e')](db['ContactItemType'][_0x993e('0x2f')],function(_0x5ba163){return{'name':_0x5ba163[_0x993e('0x30')],'type':_0x5ba163['type'][_0x993e('0x31')]};});_0x1fa8a5[_0x993e('0x32')]=_[_0x993e('0x2e')](_0x54da4e,_0x993e('0x2c'));_0x1fa8a5[_0x993e('0x33')]=_[_0x993e('0x34')](_0x2495b7['query']);_0x1fa8a5[_0x993e('0x35')]=_['intersection'](_0x1fa8a5['model'],_0x1fa8a5[_0x993e('0x33')]);_0x1f5d51['attributes']=_[_0x993e('0x36')](_0x1fa8a5[_0x993e('0x32')],qs[_0x993e('0x37')](_0x2495b7[_0x993e('0x33')][_0x993e('0x37')]));_0x1f5d51[_0x993e('0x38')]=_0x1f5d51[_0x993e('0x38')][_0x993e('0x39')]?_0x1f5d51[_0x993e('0x38')]:_0x1fa8a5[_0x993e('0x32')];if(!_0x2495b7[_0x993e('0x33')][_0x993e('0x3a')](_0x993e('0x3b'))){_0x1f5d51[_0x993e('0x1f')]=qs[_0x993e('0x1f')](_0x2495b7['query'][_0x993e('0x1f')]);_0x1f5d51[_0x993e('0x1d')]=qs[_0x993e('0x1d')](_0x2495b7[_0x993e('0x33')][_0x993e('0x1d')]);}_0x1f5d51[_0x993e('0x3c')]=qs[_0x993e('0x3d')](_0x2495b7[_0x993e('0x33')][_0x993e('0x3d')]);_0x1f5d51['where']=qs[_0x993e('0x35')](_['pick'](_0x2495b7[_0x993e('0x33')],_0x1fa8a5[_0x993e('0x35')]),_0x54da4e);if(_0x2495b7[_0x993e('0x33')][_0x993e('0x3e')]){_0x1f5d51[_0x993e('0x3f')]=_[_0x993e('0x40')](_0x1f5d51[_0x993e('0x3f')],{'$or':_[_0x993e('0x2e')](_0x54da4e,function(_0x4f057e){if(_0x4f057e[_0x993e('0x41')]!=='VIRTUAL'){var _0x180ad4={};_0x180ad4[_0x4f057e['name']]={'$like':'%'+_0x2495b7[_0x993e('0x33')][_0x993e('0x3e')]+'%'};return _0x180ad4;}})});}_0x1f5d51=_[_0x993e('0x40')]({},_0x1f5d51,_0x2495b7[_0x993e('0x42')]);var _0x39424a={'where':_0x1f5d51[_0x993e('0x3f')]};return db[_0x993e('0x43')][_0x993e('0x20')](_0x39424a)['then'](function(_0xe64c){_0x2599ec['count']=_0xe64c;if(_0x2495b7['query'][_0x993e('0x44')]){_0x1f5d51[_0x993e('0x45')]=[{'all':!![]}];}return db[_0x993e('0x43')]['findAll'](_0x1f5d51);})[_0x993e('0x25')](function(_0x40719d){_0x2599ec[_0x993e('0x46')]=_0x40719d;return _0x2599ec;})['then'](respondWithFilteredResult(_0x9e0309,_0x1f5d51))['catch'](handleError(_0x9e0309,null));};exports['show']=function(_0x3f29c8,_0x1adb09){var _0x254f74={'raw':!![],'where':{'id':_0x3f29c8[_0x993e('0x47')]['id']}},_0x539c9d={};_0x539c9d[_0x993e('0x32')]=_['keys'](db[_0x993e('0x43')][_0x993e('0x2f')]);_0x539c9d['query']=_[_0x993e('0x34')](_0x3f29c8[_0x993e('0x33')]);_0x539c9d[_0x993e('0x35')]=_['intersection'](_0x539c9d['model'],_0x539c9d['query']);_0x254f74[_0x993e('0x38')]=_[_0x993e('0x36')](_0x539c9d[_0x993e('0x32')],qs[_0x993e('0x37')](_0x3f29c8['query'][_0x993e('0x37')]));_0x254f74[_0x993e('0x38')]=_0x254f74[_0x993e('0x38')][_0x993e('0x39')]?_0x254f74[_0x993e('0x38')]:_0x539c9d[_0x993e('0x32')];if(_0x3f29c8['query']['includeAll']){_0x254f74[_0x993e('0x45')]=[{'all':!![]}];}_0x254f74=_[_0x993e('0x40')]({},_0x254f74,_0x3f29c8['options']);return db['ContactItemType'][_0x993e('0x48')](_0x254f74)[_0x993e('0x25')](handleEntityNotFound(_0x1adb09,null))[_0x993e('0x25')](respondWithResult(_0x1adb09,null))[_0x993e('0x49')](handleError(_0x1adb09,null));};exports[_0x993e('0x4a')]=function(_0x256ce3,_0x5b18e3){return db[_0x993e('0x43')]['create'](_0x256ce3[_0x993e('0x4b')],{})[_0x993e('0x25')](function(_0x28cf3b){var _0x402e37=_0x256ce3[_0x993e('0x4c')][_0x993e('0x27')]({'plain':!![]});if(!_0x402e37)throw new Error(_0x993e('0x4d'));if(_0x402e37[_0x993e('0x4e')]==='user'){var _0x23f09c=_0x28cf3b[_0x993e('0x27')]({'plain':!![]});var _0x8b1516='ContactItemTypes';return db[_0x993e('0x4f')]['find']({'where':{'name':_0x8b1516,'userProfileId':_0x402e37[_0x993e('0x50')]},'raw':!![]})[_0x993e('0x25')](function(_0x5cd41a){if(_0x5cd41a&&_0x5cd41a[_0x993e('0x51')]===0x0){return db[_0x993e('0x29')]['create']({'name':_0x23f09c[_0x993e('0x2c')],'resourceId':_0x23f09c['id'],'type':_0x5cd41a[_0x993e('0x2c')],'sectionId':_0x5cd41a['id']},{})[_0x993e('0x25')](function(){return _0x28cf3b;});}else{return _0x28cf3b;}})[_0x993e('0x49')](function(_0x2e368e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e368e);throw _0x2e368e;});}return _0x28cf3b;})['then'](respondWithResult(_0x5b18e3,0xc9))[_0x993e('0x49')](handleError(_0x5b18e3,null));};exports[_0x993e('0x52')]=function(_0x42af4f,_0x2c3df7){if(_0x42af4f[_0x993e('0x4b')]['id']){delete _0x42af4f[_0x993e('0x4b')]['id'];}return db['ContactItemType'][_0x993e('0x48')]({'where':{'id':_0x42af4f[_0x993e('0x47')]['id']}})[_0x993e('0x25')](handleEntityNotFound(_0x2c3df7,null))['then'](saveUpdates(_0x42af4f[_0x993e('0x4b')],null))['then'](respondWithResult(_0x2c3df7,null))['catch'](handleError(_0x2c3df7,null));};exports[_0x993e('0x26')]=function(_0x37d7b1,_0x511641){return db[_0x993e('0x43')]['find']({'where':{'id':_0x37d7b1[_0x993e('0x47')]['id']}})[_0x993e('0x25')](handleEntityNotFound(_0x511641,null))['then'](db['CmContactHasItem'][_0x993e('0x52')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x37d7b1[_0x993e('0x47')]['id']}}))[_0x993e('0x25')](removeEntity(_0x511641,null))[_0x993e('0x49')](handleError(_0x511641,null));}; \ No newline at end of file +var _0x4888=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ContactItemType','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x596284,_0x1cd02b){var _0x5313c6=function(_0x77db49){while(--_0x77db49){_0x596284['push'](_0x596284['shift']());}};_0x5313c6(++_0x1cd02b);}(_0x4888,0x198));var _0x8488=function(_0x4ce15c,_0x1bbcbd){_0x4ce15c=_0x4ce15c-0x0;var _0x5ee259=_0x4888[_0x4ce15c];return _0x5ee259;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){var _0x5b8885=_0x290b33['get']({'plain':!![]});var _0x472624='ContactItemTypes';return db['UserProfileResource'][_0x8488('0x22')]({'where':{'type':_0x472624,'resourceId':_0x5b8885['id']}})[_0x8488('0x21')](function(){return _0x290b33;});})[_0x8488('0x21')](function(){_0x140b0b[_0x8488('0x17')](0xcc)[_0x8488('0x23')]();});}};}function handleEntityNotFound(_0x503b83,_0x1b0519){return function(_0x38c137){if(!_0x38c137){_0x503b83[_0x8488('0x24')](0x194);}return _0x38c137;};}function handleError(_0x3df1f9,_0x460001){_0x460001=_0x460001||0x1f4;return function(_0x27f5cf){logger[_0x8488('0x25')](_0x27f5cf[_0x8488('0x26')]);if(_0x27f5cf[_0x8488('0x27')]){delete _0x27f5cf[_0x8488('0x27')];}_0x3df1f9[_0x8488('0x17')](_0x460001)['send'](_0x27f5cf);};}exports['index']=function(_0x4e3fe2,_0x292fe8){var _0x408c36={},_0x19cf42={},_0x121dcc={'count':0x0,'rows':[]};var _0x117321=_[_0x8488('0x28')](db['ContactItemType'][_0x8488('0x29')],function(_0x14f378){return{'name':_0x14f378[_0x8488('0x2a')],'type':_0x14f378[_0x8488('0x2b')][_0x8488('0x2c')]};});_0x19cf42['model']=_[_0x8488('0x28')](_0x117321,_0x8488('0x27'));_0x19cf42['query']=_[_0x8488('0x2d')](_0x4e3fe2[_0x8488('0x2e')]);_0x19cf42[_0x8488('0x2f')]=_[_0x8488('0x30')](_0x19cf42[_0x8488('0x31')],_0x19cf42['query']);_0x408c36[_0x8488('0x32')]=_[_0x8488('0x30')](_0x19cf42[_0x8488('0x31')],qs['fields'](_0x4e3fe2[_0x8488('0x2e')]['fields']));_0x408c36[_0x8488('0x32')]=_0x408c36[_0x8488('0x32')][_0x8488('0x33')]?_0x408c36[_0x8488('0x32')]:_0x19cf42['model'];if(!_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x34')](_0x8488('0x35'))){_0x408c36['limit']=qs[_0x8488('0x1a')](_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x1a')]);_0x408c36[_0x8488('0x19')]=qs[_0x8488('0x19')](_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x19')]);}_0x408c36[_0x8488('0x36')]=qs[_0x8488('0x37')](_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x37')]);_0x408c36['where']=qs['filters'](_[_0x8488('0x38')](_0x4e3fe2[_0x8488('0x2e')],_0x19cf42[_0x8488('0x2f')]),_0x117321);if(_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x39')]){_0x408c36[_0x8488('0x3a')]=_[_0x8488('0x3b')](_0x408c36[_0x8488('0x3a')],{'$or':_[_0x8488('0x28')](_0x117321,function(_0x5f561c){if(_0x5f561c[_0x8488('0x2b')]!==_0x8488('0x3c')){var _0x11a258={};_0x11a258[_0x5f561c['name']]={'$like':'%'+_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x39')]+'%'};return _0x11a258;}})});}_0x408c36=_[_0x8488('0x3b')]({},_0x408c36,_0x4e3fe2[_0x8488('0x3d')]);var _0x44d5f2={'where':_0x408c36[_0x8488('0x3a')]};return db[_0x8488('0x3e')]['count'](_0x44d5f2)[_0x8488('0x21')](function(_0x1c33a1){_0x121dcc[_0x8488('0x1c')]=_0x1c33a1;if(_0x4e3fe2['query'][_0x8488('0x3f')]){_0x408c36['include']=[{'all':!![]}];}return db[_0x8488('0x3e')][_0x8488('0x40')](_0x408c36);})['then'](function(_0x22a3f3){_0x121dcc[_0x8488('0x41')]=_0x22a3f3;return _0x121dcc;})[_0x8488('0x21')](respondWithFilteredResult(_0x292fe8,_0x408c36))[_0x8488('0x42')](handleError(_0x292fe8,null));};exports[_0x8488('0x43')]=function(_0x4e5c83,_0x3724be){var _0x50c31d={'raw':!![],'where':{'id':_0x4e5c83[_0x8488('0x44')]['id']}},_0x3440ae={};_0x3440ae[_0x8488('0x31')]=_[_0x8488('0x2d')](db[_0x8488('0x3e')][_0x8488('0x29')]);_0x3440ae[_0x8488('0x2e')]=_[_0x8488('0x2d')](_0x4e5c83[_0x8488('0x2e')]);_0x3440ae[_0x8488('0x2f')]=_[_0x8488('0x30')](_0x3440ae[_0x8488('0x31')],_0x3440ae[_0x8488('0x2e')]);_0x50c31d[_0x8488('0x32')]=_[_0x8488('0x30')](_0x3440ae[_0x8488('0x31')],qs[_0x8488('0x45')](_0x4e5c83['query'][_0x8488('0x45')]));_0x50c31d[_0x8488('0x32')]=_0x50c31d[_0x8488('0x32')][_0x8488('0x33')]?_0x50c31d['attributes']:_0x3440ae[_0x8488('0x31')];if(_0x4e5c83[_0x8488('0x2e')][_0x8488('0x3f')]){_0x50c31d[_0x8488('0x46')]=[{'all':!![]}];}_0x50c31d=_['merge']({},_0x50c31d,_0x4e5c83[_0x8488('0x3d')]);return db[_0x8488('0x3e')][_0x8488('0x47')](_0x50c31d)[_0x8488('0x21')](handleEntityNotFound(_0x3724be,null))[_0x8488('0x21')](respondWithResult(_0x3724be,null))[_0x8488('0x42')](handleError(_0x3724be,null));};exports[_0x8488('0x48')]=function(_0x299d8e,_0x1bc2e1){return db[_0x8488('0x3e')][_0x8488('0x48')](_0x299d8e[_0x8488('0x49')],{})[_0x8488('0x21')](function(_0x58b319){var _0x56bc65=_0x299d8e[_0x8488('0x4a')][_0x8488('0x4b')]({'plain':!![]});if(!_0x56bc65)throw new Error(_0x8488('0x4c'));if(_0x56bc65[_0x8488('0x4d')]===_0x8488('0x4a')){var _0x22d22c=_0x58b319[_0x8488('0x4b')]({'plain':!![]});var _0x27dfd2=_0x8488('0x4e');return db['UserProfileSection'][_0x8488('0x47')]({'where':{'name':_0x27dfd2,'userProfileId':_0x56bc65[_0x8488('0x4f')]},'raw':!![]})['then'](function(_0x35e08a){if(_0x35e08a&&_0x35e08a[_0x8488('0x50')]===0x0){return db[_0x8488('0x51')][_0x8488('0x48')]({'name':_0x22d22c['name'],'resourceId':_0x22d22c['id'],'type':_0x35e08a[_0x8488('0x27')],'sectionId':_0x35e08a['id']},{})[_0x8488('0x21')](function(){return _0x58b319;});}else{return _0x58b319;}})[_0x8488('0x42')](function(_0x5c55bf){logger[_0x8488('0x25')](_0x8488('0x52'),_0x5c55bf);throw _0x5c55bf;});}return _0x58b319;})[_0x8488('0x21')](respondWithResult(_0x1bc2e1,0xc9))[_0x8488('0x42')](handleError(_0x1bc2e1,null));};exports['update']=function(_0x2eff23,_0x574bf1){if(_0x2eff23['body']['id']){delete _0x2eff23[_0x8488('0x49')]['id'];}return db['ContactItemType'][_0x8488('0x47')]({'where':{'id':_0x2eff23[_0x8488('0x44')]['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x574bf1,null))[_0x8488('0x21')](saveUpdates(_0x2eff23[_0x8488('0x49')],null))[_0x8488('0x21')](respondWithResult(_0x574bf1,null))['catch'](handleError(_0x574bf1,null));};exports[_0x8488('0x22')]=function(_0x693741,_0x21765b){return db[_0x8488('0x3e')][_0x8488('0x47')]({'where':{'id':_0x693741['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x21765b,null))['then'](db[_0x8488('0x53')][_0x8488('0x54')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x693741['params']['id']}}))[_0x8488('0x21')](removeEntity(_0x21765b,null))[_0x8488('0x42')](handleError(_0x21765b,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 2d69277..bd23e29 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 _0x911a=['util','api','moment','bluebird','request-promise','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash'];(function(_0x22459f,_0x55fa7c){var _0x16e389=function(_0x4d3da6){while(--_0x4d3da6){_0x22459f['push'](_0x22459f['shift']());}};_0x16e389(++_0x55fa7c);}(_0x911a,0xd0));var _0xa911=function(_0xf60236,_0x22096d){_0xf60236=_0xf60236-0x0;var _0x1b113f=_0x911a[_0xf60236];return _0x1b113f;};'use strict';var _=require(_0xa911('0x0'));var util=require(_0xa911('0x1'));var logger=require('../../config/logger')(_0xa911('0x2'));var moment=require(_0xa911('0x3'));var BPromise=require(_0xa911('0x4'));var rp=require(_0xa911('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa911('0x6'));module[_0xa911('0x7')]=function(_0x32c588,_0x4ecde6){return _0x32c588[_0xa911('0x8')](_0xa911('0x9'),attributes,{'tableName':_0xa911('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf326=['api','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger'];(function(_0x2d8641,_0x593656){var _0x6428dd=function(_0x2215a6){while(--_0x2215a6){_0x2d8641['push'](_0x2d8641['shift']());}};_0x6428dd(++_0x593656);}(_0xf326,0x14d));var _0x6f32=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xf326[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x6f32('0x0'));var util=require(_0x6f32('0x1'));var logger=require(_0x6f32('0x2'))(_0x6f32('0x3'));var moment=require('moment');var BPromise=require(_0x6f32('0x4'));var rp=require(_0x6f32('0x5'));var fs=require('fs');var path=require(_0x6f32('0x6'));var rimraf=require(_0x6f32('0x7'));var config=require(_0x6f32('0x8'));var attributes=require(_0x6f32('0x9'));module[_0x6f32('0xa')]=function(_0x5f0c27,_0x29f6a7){return _0x5f0c27[_0x6f32('0xb')](_0x6f32('0xc'),attributes,{'tableName':_0x6f32('0xd'),'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 4484286..8672820 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 _0x9af1=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x9af1,0x149));var _0x19af=function(_0x38e177,_0x59ec9f){_0x38e177=_0x38e177-0x0;var _0x1faf15=_0x9af1[_0x38e177];return _0x1faf15;};'use strict';var _=require(_0x19af('0x0'));var util=require('util');var moment=require(_0x19af('0x1'));var BPromise=require(_0x19af('0x2'));var rs=require(_0x19af('0x3'));var fs=require('fs');var Redis=require(_0x19af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x19af('0x5'));var logger=require(_0x19af('0x6'))(_0x19af('0x7'));var config=require(_0x19af('0x8'));var jayson=require(_0x19af('0x9'));var client=jayson[_0x19af('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bd9ae,_0x2ae9f2,_0x386b1b){return new BPromise(function(_0x13bb7c,_0x19624f){return client[_0x19af('0xb')](_0x5bd9ae,_0x386b1b)[_0x19af('0xc')](function(_0x3234ac){logger[_0x19af('0xd')](_0x19af('0xe'),_0x2ae9f2,_0x19af('0xf'));logger[_0x19af('0x10')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x2ae9f2,'request\x20sent',JSON[_0x19af('0x11')](_0x3234ac));if(_0x3234ac['error']){if(_0x3234ac[_0x19af('0x12')][_0x19af('0x13')]===0x1f4){logger[_0x19af('0x12')](_0x19af('0xe'),_0x2ae9f2,_0x3234ac['error'][_0x19af('0x14')]);return _0x19624f(_0x3234ac[_0x19af('0x12')]['message']);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x2ae9f2,_0x3234ac[_0x19af('0x12')][_0x19af('0x14')]);return _0x13bb7c(_0x3234ac['error'][_0x19af('0x14')]);}else{logger[_0x19af('0xd')]('ContactItemType,\x20%s,\x20%s',_0x2ae9f2,_0x19af('0xf'));_0x13bb7c(_0x3234ac[_0x19af('0x15')]['message']);}})['catch'](function(_0x3ce3ac){logger['error'](_0x19af('0xe'),_0x2ae9f2,_0x3ce3ac);_0x19624f(_0x3ce3ac);});});} \ No newline at end of file +var _0x0dac=['result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x536d2b,_0x574095){var _0x21235f=function(_0x15b38f){while(--_0x15b38f){_0x536d2b['push'](_0x536d2b['shift']());}};_0x21235f(++_0x574095);}(_0x0dac,0x151));var _0xc0da=function(_0x1e3296,_0x595b52){_0x1e3296=_0x1e3296-0x0;var _0x2b8261=_0x0dac[_0x1e3296];return _0x2b8261;};'use strict';var _=require(_0xc0da('0x0'));var util=require(_0xc0da('0x1'));var moment=require(_0xc0da('0x2'));var BPromise=require(_0xc0da('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0da('0x4'))['db'];var utils=require(_0xc0da('0x5'));var logger=require(_0xc0da('0x6'))(_0xc0da('0x7'));var config=require(_0xc0da('0x8'));var jayson=require(_0xc0da('0x9'));var client=jayson[_0xc0da('0xa')][_0xc0da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1845,_0x3cb192,_0x1ee5e9){return new BPromise(function(_0x281b19,_0x46511c){return client[_0xc0da('0xc')](_0x4b1845,_0x1ee5e9)[_0xc0da('0xd')](function(_0x47eb76){logger[_0xc0da('0xe')](_0xc0da('0xf'),_0x3cb192,'request\x20sent');logger[_0xc0da('0x10')](_0xc0da('0x11'),_0x3cb192,'request\x20sent',JSON[_0xc0da('0x12')](_0x47eb76));if(_0x47eb76[_0xc0da('0x13')]){if(_0x47eb76[_0xc0da('0x13')][_0xc0da('0x14')]===0x1f4){logger[_0xc0da('0x13')](_0xc0da('0xf'),_0x3cb192,_0x47eb76[_0xc0da('0x13')][_0xc0da('0x15')]);return _0x46511c(_0x47eb76['error'][_0xc0da('0x15')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x3cb192,_0x47eb76[_0xc0da('0x13')]['message']);return _0x281b19(_0x47eb76[_0xc0da('0x13')]['message']);}else{logger[_0xc0da('0xe')]('ContactItemType,\x20%s,\x20%s',_0x3cb192,_0xc0da('0x16'));_0x281b19(_0x47eb76[_0xc0da('0x17')]['message']);}})['catch'](function(_0x4db6a7){logger[_0xc0da('0x13')](_0xc0da('0xf'),_0x3cb192,_0x4db6a7);_0x46511c(_0x4db6a7);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index ac3592a..f7761b5 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 _0xe94e=['post','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','/:id','isAuthenticated','show'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xe94e,0x1e0));var _0xee94=function(_0x412ae9,_0x13f88c){_0x412ae9=_0x412ae9-0x0;var _0x5ec05e=_0xe94e[_0x412ae9];return _0x5ec05e;};'use strict';var multer=require(_0xee94('0x0'));var util=require(_0xee94('0x1'));var path=require(_0xee94('0x2'));var timeout=require('connect-timeout');var express=require(_0xee94('0x3'));var router=express[_0xee94('0x4')]();var fs_extra=require(_0xee94('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xee94('0x6'));var config=require(_0xee94('0x7'));var controller=require(_0xee94('0x8'));router[_0xee94('0x9')]('/',auth['isAuthenticated'](),controller[_0xee94('0xa')]);router[_0xee94('0x9')](_0xee94('0xb'),auth[_0xee94('0xc')](),controller[_0xee94('0xd')]);router[_0xee94('0xe')]('/',auth['isAuthenticated'](),controller[_0xee94('0xf')]);router['put'](_0xee94('0xb'),auth[_0xee94('0xc')](),controller[_0xee94('0x10')]);router['delete'](_0xee94('0xb'),auth[_0xee94('0xc')](),controller[_0xee94('0x11')]);module[_0xee94('0x12')]=router; \ No newline at end of file +var _0xbb9d=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express'];(function(_0x43b9af,_0x2c8316){var _0x1df62e=function(_0x2b2e79){while(--_0x2b2e79){_0x43b9af['push'](_0x43b9af['shift']());}};_0x1df62e(++_0x2c8316);}(_0xbb9d,0x151));var _0xdbb9=function(_0x17fb6f,_0x2e0d57){_0x17fb6f=_0x17fb6f-0x0;var _0x476c7c=_0xbb9d[_0x17fb6f];return _0x476c7c;};'use strict';var multer=require('multer');var util=require(_0xdbb9('0x0'));var path=require(_0xdbb9('0x1'));var timeout=require('connect-timeout');var express=require(_0xdbb9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdbb9('0x3'));var interaction=require(_0xdbb9('0x4'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router['get']('/',auth[_0xdbb9('0x5')](),controller[_0xdbb9('0x6')]);router[_0xdbb9('0x7')](_0xdbb9('0x8'),auth[_0xdbb9('0x5')](),controller[_0xdbb9('0x9')]);router[_0xdbb9('0xa')]('/',auth[_0xdbb9('0x5')](),controller[_0xdbb9('0xb')]);router[_0xdbb9('0xc')](_0xdbb9('0x8'),auth[_0xdbb9('0x5')](),controller[_0xdbb9('0xd')]);router[_0xdbb9('0xe')](_0xdbb9('0x8'),auth[_0xdbb9('0x5')](),controller[_0xdbb9('0xf')]);module[_0xdbb9('0x10')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index f8f7250..1871503 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 _0xd8b0=['exports','sequelize'];(function(_0x3ee487,_0x3e1a08){var _0x12be90=function(_0x2e458b){while(--_0x2e458b){_0x3ee487['push'](_0x3ee487['shift']());}};_0x12be90(++_0x3e1a08);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe706,0xa3));var _0x6e70=function(_0x3bd3d2,_0x413068){_0x3bd3d2=_0x3bd3d2-0x0;var _0x569624=_0xe706[_0x3bd3d2];return _0x569624;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 3316dc9..ba83c18 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 _0x1872=['error','name','send','index','map','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','keys','rawAttributes','omit','updatedAt','UserProfileSection','update','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie3','attrSmsAccounts','web-report','attrReport','reportType','attrRefresh','addItem','DashboardId','DashboardItem','findOne','nolimit','getItems','zip-dir','request-promise','moment','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','../../config/license/util','../../mysqldb','redis','defaults','./dashboard.socket','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','CustomDashboards','UserProfileResource','destroy'];(function(_0x4c8a3d,_0x174bd2){var _0xbf1010=function(_0x2f94ea){while(--_0x2f94ea){_0x4c8a3d['push'](_0x4c8a3d['shift']());}};_0xbf1010(++_0x174bd2);}(_0x1872,0x157));var _0x2187=function(_0xda127b,_0x3792b4){_0xda127b=_0xda127b-0x0;var _0x4f9ddb=_0x1872[_0xda127b];return _0x4f9ddb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2187('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2187('0x1'));var moment=require(_0x2187('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2187('0x3'));var util=require(_0x2187('0x4'));var path=require(_0x2187('0x5'));var sox=require(_0x2187('0x6'));var csv=require(_0x2187('0x7'));var ejs=require(_0x2187('0x8'));var fs=require('fs');var fs_extra=require(_0x2187('0x9'));var _=require(_0x2187('0xa'));var squel=require('squel');var crypto=require(_0x2187('0xb'));var jsforce=require(_0x2187('0xc'));var deskjs=require(_0x2187('0xd'));var toCsv=require(_0x2187('0x7'));var querystring=require(_0x2187('0xe'));var Papa=require(_0x2187('0xf'));var Redis=require(_0x2187('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2187('0x11'));var as=require(_0x2187('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2187('0x13'))(_0x2187('0x14'));var utils=require(_0x2187('0x15'));var config=require(_0x2187('0x16'));var licenseUtil=require(_0x2187('0x17'));var db=require(_0x2187('0x18'))['db'];config[_0x2187('0x19')]=_[_0x2187('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2187('0x19')]));require(_0x2187('0x1b'))['register'](socket);function respondWithStatusCode(_0x535474,_0x12736f){_0x12736f=_0x12736f||0xcc;return function(_0x59a641){if(_0x59a641){return _0x535474[_0x2187('0x1c')](_0x12736f);}return _0x535474[_0x2187('0x1d')](_0x12736f)[_0x2187('0x1e')]();};}function respondWithResult(_0x684ca5,_0x30311e){_0x30311e=_0x30311e||0xc8;return function(_0x5ff2d){if(_0x5ff2d){return _0x684ca5[_0x2187('0x1d')](_0x30311e)[_0x2187('0x1f')](_0x5ff2d);}};}function respondWithFilteredResult(_0x321f99,_0x548796){return function(_0x13c8bb){if(_0x13c8bb){var _0x2022aa=typeof _0x548796['offset']==='undefined'&&typeof _0x548796[_0x2187('0x20')]==='undefined';var _0x43cb1f=_0x13c8bb[_0x2187('0x21')];var _0x2fe4dc=_0x2022aa?0x0:_0x548796[_0x2187('0x22')];var _0x5c603d=_0x2022aa?_0x13c8bb[_0x2187('0x21')]:_0x548796['offset']+_0x548796['limit'];var _0x5e1437;if(_0x5c603d>=_0x43cb1f){_0x5c603d=_0x43cb1f;_0x5e1437=0xc8;}else{_0x5e1437=0xce;}_0x321f99[_0x2187('0x1d')](_0x5e1437);return _0x321f99[_0x2187('0x23')](_0x2187('0x24'),_0x2fe4dc+'-'+_0x5c603d+'/'+_0x43cb1f)[_0x2187('0x1f')](_0x13c8bb);}return null;};}function patchUpdates(_0xd9f554){return function(_0x20b939){try{jsonpatch[_0x2187('0x25')](_0x20b939,_0xd9f554,!![]);}catch(_0x314f1b){return BPromise[_0x2187('0x26')](_0x314f1b);}return _0x20b939[_0x2187('0x27')]();};}function saveUpdates(_0x6d5093,_0x1d02b2){return function(_0x240ef5){if(_0x240ef5){return _0x240ef5['update'](_0x6d5093)[_0x2187('0x28')](function(_0x2fc675){return _0x2fc675;});}return null;};}function removeEntity(_0x4c0af0,_0x4fc023){return function(_0x3926c2){if(_0x3926c2){return _0x3926c2['destroy']()[_0x2187('0x28')](function(){var _0x593c9b=_0x3926c2['get']({'plain':!![]});var _0x270c87=_0x2187('0x29');return db[_0x2187('0x2a')][_0x2187('0x2b')]({'where':{'type':_0x270c87,'resourceId':_0x593c9b['id']}})[_0x2187('0x28')](function(){return _0x3926c2;});})['then'](function(){_0x4c0af0[_0x2187('0x1d')](0xcc)[_0x2187('0x1e')]();});}};}function handleEntityNotFound(_0x575e42,_0x46e8ef){return function(_0x2aaf70){if(!_0x2aaf70){_0x575e42['sendStatus'](0x194);}return _0x2aaf70;};}function handleError(_0x50f3f6,_0xcde8a9){_0xcde8a9=_0xcde8a9||0x1f4;return function(_0x15709a){logger[_0x2187('0x2c')](_0x15709a['stack']);if(_0x15709a['name']){delete _0x15709a[_0x2187('0x2d')];}_0x50f3f6[_0x2187('0x1d')](_0xcde8a9)[_0x2187('0x2e')](_0x15709a);};}exports[_0x2187('0x2f')]=function(_0x1ae885,_0x33e327){var _0x255df0={},_0x23ff4d={},_0x16ddbc={'count':0x0,'rows':[]};var _0x222cd7=_[_0x2187('0x30')](db['Dashboard']['rawAttributes'],function(_0x578549){return{'name':_0x578549[_0x2187('0x31')],'type':_0x578549[_0x2187('0x32')][_0x2187('0x33')]};});_0x23ff4d[_0x2187('0x34')]=_[_0x2187('0x30')](_0x222cd7,_0x2187('0x2d'));_0x23ff4d['query']=_['keys'](_0x1ae885[_0x2187('0x35')]);_0x23ff4d['filters']=_['intersection'](_0x23ff4d[_0x2187('0x34')],_0x23ff4d[_0x2187('0x35')]);_0x255df0[_0x2187('0x36')]=_[_0x2187('0x37')](_0x23ff4d[_0x2187('0x34')],qs[_0x2187('0x38')](_0x1ae885[_0x2187('0x35')][_0x2187('0x38')]));_0x255df0[_0x2187('0x36')]=_0x255df0['attributes'][_0x2187('0x39')]?_0x255df0[_0x2187('0x36')]:_0x23ff4d[_0x2187('0x34')];if(!_0x1ae885[_0x2187('0x35')][_0x2187('0x3a')]('nolimit')){_0x255df0['limit']=qs[_0x2187('0x20')](_0x1ae885[_0x2187('0x35')]['limit']);_0x255df0[_0x2187('0x22')]=qs[_0x2187('0x22')](_0x1ae885[_0x2187('0x35')][_0x2187('0x22')]);}_0x255df0[_0x2187('0x3b')]=qs['sort'](_0x1ae885[_0x2187('0x35')][_0x2187('0x3c')]);_0x255df0['where']=qs[_0x2187('0x3d')](_[_0x2187('0x3e')](_0x1ae885[_0x2187('0x35')],_0x23ff4d['filters']),_0x222cd7);if(_0x1ae885[_0x2187('0x35')][_0x2187('0x3f')]){_0x255df0['where']=_[_0x2187('0x40')](_0x255df0[_0x2187('0x41')],{'$or':_[_0x2187('0x30')](_0x222cd7,function(_0x260b94){if(_0x260b94['type']!==_0x2187('0x42')){var _0x7568ae={};_0x7568ae[_0x260b94[_0x2187('0x2d')]]={'$like':'%'+_0x1ae885[_0x2187('0x35')]['filter']+'%'};return _0x7568ae;}})});}_0x255df0=_[_0x2187('0x40')]({},_0x255df0,_0x1ae885[_0x2187('0x43')]);var _0x2402fb={'where':_0x255df0[_0x2187('0x41')]};return db[_0x2187('0x44')][_0x2187('0x21')](_0x2402fb)[_0x2187('0x28')](function(_0x2a9354){_0x16ddbc[_0x2187('0x21')]=_0x2a9354;if(_0x1ae885['query'][_0x2187('0x45')]){_0x255df0[_0x2187('0x46')]=[{'all':!![]}];}return db[_0x2187('0x44')][_0x2187('0x47')](_0x255df0);})[_0x2187('0x28')](function(_0xeb8047){_0x16ddbc[_0x2187('0x48')]=_0xeb8047;return _0x16ddbc;})['then'](respondWithFilteredResult(_0x33e327,_0x255df0))[_0x2187('0x49')](handleError(_0x33e327,null));};exports[_0x2187('0x4a')]=function(_0x3eebb6,_0x5a7203){var _0x364c4f={'raw':![],'where':{'id':_0x3eebb6['params']['id']}},_0x3ba3ef={};_0x3ba3ef[_0x2187('0x34')]=_['keys'](db[_0x2187('0x44')]['rawAttributes']);_0x3ba3ef[_0x2187('0x35')]=_['keys'](_0x3eebb6[_0x2187('0x35')]);_0x3ba3ef['filters']=_[_0x2187('0x37')](_0x3ba3ef[_0x2187('0x34')],_0x3ba3ef[_0x2187('0x35')]);_0x364c4f[_0x2187('0x36')]=_[_0x2187('0x37')](_0x3ba3ef[_0x2187('0x34')],qs[_0x2187('0x38')](_0x3eebb6[_0x2187('0x35')]['fields']));_0x364c4f[_0x2187('0x36')]=_0x364c4f[_0x2187('0x36')][_0x2187('0x39')]?_0x364c4f[_0x2187('0x36')]:_0x3ba3ef[_0x2187('0x34')];if(_0x3eebb6[_0x2187('0x35')]['includeAll']){_0x364c4f['include']=[{'all':!![]}];}_0x364c4f=_[_0x2187('0x40')]({},_0x364c4f,_0x3eebb6[_0x2187('0x43')]);return db[_0x2187('0x44')][_0x2187('0x4b')](_0x364c4f)[_0x2187('0x28')](handleEntityNotFound(_0x5a7203,null))[_0x2187('0x28')](respondWithResult(_0x5a7203,null))[_0x2187('0x49')](handleError(_0x5a7203,null));};exports[_0x2187('0x4c')]=function(_0x514548,_0x2a3c40){return db[_0x2187('0x44')]['create'](_0x514548[_0x2187('0x4d')],{})['then'](function(_0x32308a){var _0x2e87e1=_0x514548[_0x2187('0x4e')]['get']({'plain':!![]});if(!_0x2e87e1)throw new Error(_0x2187('0x4f'));if(_0x2e87e1[_0x2187('0x50')]===_0x2187('0x4e')){var _0x448af7=_0x32308a[_0x2187('0x51')]({'plain':!![]});var _0x12cb5a=_0x2187('0x29');return db['UserProfileSection'][_0x2187('0x4b')]({'where':{'name':_0x12cb5a,'userProfileId':_0x2e87e1['userProfileId']},'raw':!![]})[_0x2187('0x28')](function(_0x2bf747){if(_0x2bf747&&_0x2bf747['autoAssociation']===0x0){return db[_0x2187('0x2a')]['create']({'name':_0x448af7[_0x2187('0x2d')],'resourceId':_0x448af7['id'],'type':_0x2bf747[_0x2187('0x2d')],'sectionId':_0x2bf747['id']},{})[_0x2187('0x28')](function(){return _0x32308a;});}else{return _0x32308a;}})[_0x2187('0x49')](function(_0x375e83){logger[_0x2187('0x2c')](_0x2187('0x52'),_0x375e83);throw _0x375e83;});}return _0x32308a;})['then'](respondWithResult(_0x2a3c40,0xc9))[_0x2187('0x49')](handleError(_0x2a3c40,null));};exports[_0x2187('0x53')]=function(_0x2705b9,_0x25fc44){var _0x356815={'where':{'id':_0x2705b9[_0x2187('0x54')]['id']}},_0x25b91d={};_0x25b91d['model']=_[_0x2187('0x55')](db[_0x2187('0x44')][_0x2187('0x56')]);_0x356815[_0x2187('0x36')]=_[_0x2187('0x37')](_0x25b91d[_0x2187('0x34')],qs['fields'](_0x2705b9['query'][_0x2187('0x38')]));_0x356815[_0x2187('0x36')]=_0x356815[_0x2187('0x36')][_0x2187('0x39')]?_0x356815['attributes']:_0x25b91d[_0x2187('0x34')];if(_0x2705b9[_0x2187('0x35')][_0x2187('0x45')]){_0x356815['include']=[{'all':!![]}];}_0x356815=_[_0x2187('0x40')]({},_0x356815,_0x2705b9[_0x2187('0x43')]);return db[_0x2187('0x44')]['find'](_0x356815)[_0x2187('0x28')](handleEntityNotFound(_0x25fc44,null))[_0x2187('0x28')](function(_0x75a5c){if(_0x75a5c){var _0x15d9f0=_0x75a5c['get']({'plain':!![]});_0x15d9f0=qs[_0x2187('0x57')](_0x15d9f0,['id','createdAt',_0x2187('0x58')]);_0x2705b9[_0x2187('0x4d')]=_[_0x2187('0x57')](_0x2705b9['body'],['id','createdAt',_0x2187('0x58')]);return db[_0x2187('0x44')][_0x2187('0x4c')](_[_0x2187('0x40')](_0x15d9f0,_0x2705b9[_0x2187('0x4d')]),{'include':_0x2705b9['query']['includeAll']?[{'all':!![]}]:undefined})[_0x2187('0x28')](function(_0x6dd886){var _0x426f5d=_0x2705b9[_0x2187('0x4e')]['get']({'plain':!![]});if(!_0x426f5d)throw new Error(_0x2187('0x4f'));if(_0x426f5d[_0x2187('0x50')]===_0x2187('0x4e')){var _0x5f54cd=_0x6dd886[_0x2187('0x51')]({'plain':!![]});var _0x255687=_0x2187('0x29');return db[_0x2187('0x59')][_0x2187('0x4b')]({'where':{'name':_0x255687,'userProfileId':_0x426f5d['userProfileId']},'raw':!![]})[_0x2187('0x28')](function(_0x23f17a){if(_0x23f17a&&_0x23f17a['autoAssociation']===0x0){return db[_0x2187('0x2a')][_0x2187('0x4c')]({'name':_0x5f54cd[_0x2187('0x2d')],'resourceId':_0x5f54cd['id'],'type':_0x23f17a[_0x2187('0x2d')],'sectionId':_0x23f17a['id']},{})['then'](function(){return _0x6dd886;});}else{return _0x6dd886;}})[_0x2187('0x49')](function(_0x540bbc){logger[_0x2187('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x540bbc);throw _0x540bbc;});}return _0x6dd886;});}})[_0x2187('0x28')](respondWithResult(_0x25fc44,0xc9))[_0x2187('0x49')](handleError(_0x25fc44,null));};exports[_0x2187('0x5a')]=function(_0x2a42e2,_0x22fe76){if(_0x2a42e2[_0x2187('0x4d')]['id']){delete _0x2a42e2['body']['id'];}return db['Dashboard'][_0x2187('0x4b')]({'where':{'id':_0x2a42e2['params']['id']}})[_0x2187('0x28')](handleEntityNotFound(_0x22fe76,null))[_0x2187('0x28')](saveUpdates(_0x2a42e2[_0x2187('0x4d')],null))['then'](respondWithResult(_0x22fe76,null))[_0x2187('0x49')](handleError(_0x22fe76,null));};exports['destroy']=function(_0x3b5c72,_0x212fab){return db[_0x2187('0x44')][_0x2187('0x4b')]({'where':{'id':_0x3b5c72[_0x2187('0x54')]['id']}})[_0x2187('0x28')](handleEntityNotFound(_0x212fab,null))[_0x2187('0x28')](removeEntity(_0x212fab,null))['catch'](handleError(_0x212fab,null));};function widgetAttributes(_0x537223){try{switch(_0x537223['type']){case _0x2187('0x5b'):return[{'name':_0x2187('0x5c'),'value':_0x537223[_0x2187('0x5c')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x0]?_0x537223[_0x2187('0x5d')][0x0][_0x2187('0x5e')]:undefined)||'https://'}];case _0x2187('0x5f'):return[{'name':_0x2187('0x60'),'value':_0x537223[_0x2187('0x60')]||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x0]?_0x537223[_0x2187('0x5d')][0x0][_0x2187('0x5e')]:undefined)||''}];case _0x2187('0x61'):return[{'name':_0x2187('0x62'),'value':_0x537223['attrHourFormat']||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x0]?_0x537223[_0x2187('0x5d')][0x0][_0x2187('0x5e')]:undefined)||_0x2187('0x63')},{'name':_0x2187('0x64'),'value':_0x537223['attrTimezone']||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x1]?_0x537223[_0x2187('0x5d')][0x1][_0x2187('0x5e')]:undefined)||_0x2187('0x65')},{'name':_0x2187('0x66'),'value':_0x537223[_0x2187('0x66')]||(_0x537223['attrs']&&_0x537223[_0x2187('0x5d')][0x2]?_0x537223['attrs'][0x2]['value']:undefined)||0xc}];case _0x2187('0x67'):return[{'name':_0x2187('0x68'),'value':_0x537223[_0x2187('0x68')]||(_0x537223['attrs']&&_0x537223['attrs'][0x0]?_0x537223['attrs'][0x0][_0x2187('0x5e')]:undefined)||'total'},{'name':_0x2187('0x69'),'value':_0x537223[_0x2187('0x69')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x1]?_0x537223[_0x2187('0x5d')][0x1][_0x2187('0x5e')]:undefined)||[]},{'name':_0x2187('0x66'),'value':_0x537223[_0x2187('0x66')]||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x2]?_0x537223[_0x2187('0x5d')][0x2][_0x2187('0x5e')]:undefined)||0x14},{'name':'attrChannel','value':_0x537223[_0x2187('0x6a')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x3]?_0x537223[_0x2187('0x5d')][0x3][_0x2187('0x5e')]:undefined)||_0x2187('0x6b')},{'name':'attrEmailAccounts','value':_0x537223[_0x2187('0x6c')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x4]?_0x537223[_0x2187('0x5d')][0x4][_0x2187('0x5e')]:undefined)||''},{'name':_0x2187('0x6d'),'value':_0x537223['attrFaxAccounts']||(_0x537223['attrs']&&_0x537223[_0x2187('0x5d')][0x5]?_0x537223[_0x2187('0x5d')][0x5][_0x2187('0x5e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x537223['attrSmsAccounts']||(_0x537223['attrs']&&_0x537223[_0x2187('0x5d')][0x6]?_0x537223[_0x2187('0x5d')][0x6][_0x2187('0x5e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x537223[_0x2187('0x6e')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x7]?_0x537223[_0x2187('0x5d')][0x7][_0x2187('0x5e')]:undefined)||''},{'name':_0x2187('0x6f'),'value':_0x537223['attrWhatsappAccounts']||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x8]?_0x537223[_0x2187('0x5d')][0x8][_0x2187('0x5e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x537223[_0x2187('0x70')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x9]?_0x537223['attrs'][0x9][_0x2187('0x5e')]:undefined)||''}];case _0x2187('0x71'):case _0x2187('0x72'):return[{'name':_0x2187('0x73'),'value':_0x537223[_0x2187('0x73')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x0]?_0x537223[_0x2187('0x5d')][0x0][_0x2187('0x5e')]:undefined)||_0x2187('0x74')},{'name':'attrSerie2','value':_0x537223['attrSerie2']||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x1]?_0x537223[_0x2187('0x5d')][0x1][_0x2187('0x5e')]:undefined)||null},{'name':_0x2187('0x75'),'value':_0x537223[_0x2187('0x75')]||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x2]?_0x537223[_0x2187('0x5d')][0x2][_0x2187('0x5e')]:undefined)||null},{'name':_0x2187('0x69'),'value':_0x537223['attrVoiceQueues']||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x3]?_0x537223[_0x2187('0x5d')][0x3][_0x2187('0x5e')]:undefined)||[]},{'name':'attrChannel','value':_0x537223['attrChannel']||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x4]?_0x537223['attrs'][0x4][_0x2187('0x5e')]:undefined)||_0x2187('0x6b')},{'name':'attrEmailAccounts','value':_0x537223['attrEmailAccounts']||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x5]?_0x537223['attrs'][0x5][_0x2187('0x5e')]:undefined)||''},{'name':_0x2187('0x6d'),'value':_0x537223[_0x2187('0x6d')]||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x6]?_0x537223[_0x2187('0x5d')][0x6][_0x2187('0x5e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x537223[_0x2187('0x76')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x7]?_0x537223['attrs'][0x7][_0x2187('0x5e')]:undefined)||''},{'name':_0x2187('0x6e'),'value':_0x537223[_0x2187('0x6e')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x8]?_0x537223['attrs'][0x8][_0x2187('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x537223[_0x2187('0x6f')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x9]?_0x537223[_0x2187('0x5d')][0x9][_0x2187('0x5e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x537223[_0x2187('0x70')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0xa]?_0x537223[_0x2187('0x5d')][0xa]['value']:undefined)||''}];case _0x2187('0x77'):return[{'name':_0x2187('0x78'),'type':_0x537223[_0x2187('0x79')]||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x0]?_0x537223[_0x2187('0x5d')][0x0]['type']:undefined)||null,'value':_0x537223[_0x2187('0x78')]||(_0x537223[_0x2187('0x5d')]&&_0x537223[_0x2187('0x5d')][0x0]?_0x537223[_0x2187('0x5d')][0x0][_0x2187('0x5e')]:undefined)||null},{'name':_0x2187('0x7a'),'value':_0x537223['attrRefresh']||(_0x537223[_0x2187('0x5d')]&&_0x537223['attrs'][0x1]?_0x537223['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1fcb90){logger[_0x2187('0x2c')]('widgetAttributes:\x20%s',JSON['stringify'](_0x1fcb90));return[];}}exports[_0x2187('0x7b')]=function(_0x3344f6,_0x506dd1,_0x1ef039){if(_0x3344f6[_0x2187('0x4d')]['id']){delete _0x3344f6['body']['id'];}return db[_0x2187('0x44')][_0x2187('0x4b')]({'where':{'id':_0x3344f6[_0x2187('0x54')]['id']}})[_0x2187('0x28')](handleEntityNotFound(_0x506dd1,null))[_0x2187('0x28')](function(_0x15ef92){if(_0x15ef92){_0x3344f6[_0x2187('0x4d')][_0x2187('0x7c')]=_0x15ef92['id'];_0x3344f6[_0x2187('0x4d')]['attrs']=widgetAttributes(_0x3344f6[_0x2187('0x4d')]);return db[_0x2187('0x7d')][_0x2187('0x4c')](_0x3344f6[_0x2187('0x4d')]);}})['then'](respondWithResult(_0x506dd1,null))[_0x2187('0x49')](handleError(_0x506dd1,null));};exports['getItems']=function(_0x5b9cd3,_0x15dcd2,_0x832ca9){var _0x28743a={};var _0x52d829={};var _0x5e481d;var _0x41938d;return db[_0x2187('0x44')][_0x2187('0x7e')]({'where':{'id':_0x5b9cd3[_0x2187('0x54')]['id']}})[_0x2187('0x28')](handleEntityNotFound(_0x15dcd2,null))[_0x2187('0x28')](function(_0x18cd08){if(_0x18cd08){_0x5e481d=_0x18cd08;_0x52d829[_0x2187('0x34')]=_[_0x2187('0x55')](db['DashboardItem'][_0x2187('0x56')]);_0x52d829[_0x2187('0x35')]=_[_0x2187('0x55')](_0x5b9cd3[_0x2187('0x35')]);_0x52d829['filters']=_['intersection'](_0x52d829[_0x2187('0x34')],_0x52d829[_0x2187('0x35')]);_0x28743a[_0x2187('0x36')]=_['intersection'](_0x52d829[_0x2187('0x34')],qs[_0x2187('0x38')](_0x5b9cd3[_0x2187('0x35')]['fields']));_0x28743a['attributes']=_0x28743a[_0x2187('0x36')]['length']?_0x28743a[_0x2187('0x36')]:_0x52d829[_0x2187('0x34')];_0x28743a[_0x2187('0x3b')]=qs[_0x2187('0x3c')](_0x5b9cd3[_0x2187('0x35')][_0x2187('0x3c')]);_0x28743a[_0x2187('0x41')]=qs[_0x2187('0x3d')](_[_0x2187('0x3e')](_0x5b9cd3[_0x2187('0x35')],_0x52d829[_0x2187('0x3d')]));if(_0x5b9cd3['query']['filter']){_0x28743a[_0x2187('0x41')]=_['merge'](_0x28743a[_0x2187('0x41')],{'$or':_['map'](_0x28743a['attributes'],function(_0x2e8629){var _0x5a7730={};_0x5a7730[_0x2e8629]={'$like':'%'+_0x5b9cd3[_0x2187('0x35')][_0x2187('0x3f')]+'%'};return _0x5a7730;})});}_0x28743a=_[_0x2187('0x40')]({},_0x28743a,_0x5b9cd3[_0x2187('0x43')]);return _0x5e481d['getItems'](_0x28743a);}})[_0x2187('0x28')](function(_0x7f2bd2){if(_0x7f2bd2){_0x41938d=_0x7f2bd2[_0x2187('0x39')];if(!_0x5b9cd3[_0x2187('0x35')][_0x2187('0x3a')](_0x2187('0x7f'))){_0x28743a[_0x2187('0x20')]=qs[_0x2187('0x20')](_0x5b9cd3[_0x2187('0x35')]['limit']);_0x28743a[_0x2187('0x22')]=qs[_0x2187('0x22')](_0x5b9cd3[_0x2187('0x35')][_0x2187('0x22')]);}return _0x5e481d[_0x2187('0x80')](_0x28743a);}})[_0x2187('0x28')](function(_0xcfb979){if(_0xcfb979){return _0xcfb979?{'count':_0x41938d,'rows':_0xcfb979}:null;}})[_0x2187('0x28')](respondWithResult(_0x15dcd2,null))['catch'](handleError(_0x15dcd2,null));}; \ No newline at end of file +var _0x1747=['attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','params','order','pick','getItems','nolimit','eml-format','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','VIRTUAL','merge','options','catch','show','Dashboard','length','includeAll','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','clone','omit','updatedAt','createdAt','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1747,0x108));var _0x7174=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1747[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x7174('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7174('0x1'));var jsonpatch=require(_0x7174('0x2'));var rp=require('request-promise');var moment=require(_0x7174('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7174('0x4'));var sox=require(_0x7174('0x5'));var csv=require(_0x7174('0x6'));var ejs=require(_0x7174('0x7'));var fs=require('fs');var fs_extra=require(_0x7174('0x8'));var _=require('lodash');var squel=require(_0x7174('0x9'));var crypto=require(_0x7174('0xa'));var jsforce=require(_0x7174('0xb'));var deskjs=require(_0x7174('0xc'));var toCsv=require(_0x7174('0x6'));var querystring=require('querystring');var Papa=require(_0x7174('0xd'));var Redis=require(_0x7174('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7174('0xf'));var as=require(_0x7174('0x10'));var hardwareService=require(_0x7174('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7174('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7174('0x13'));var db=require(_0x7174('0x14'))['db'];config[_0x7174('0x15')]=_[_0x7174('0x16')](config['redis'],{'host':_0x7174('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7174('0x15')]));require(_0x7174('0x18'))[_0x7174('0x19')](socket);function respondWithStatusCode(_0xff962c,_0x3b78bc){_0x3b78bc=_0x3b78bc||0xcc;return function(_0x10dc55){if(_0x10dc55){return _0xff962c[_0x7174('0x1a')](_0x3b78bc);}return _0xff962c[_0x7174('0x1b')](_0x3b78bc)[_0x7174('0x1c')]();};}function respondWithResult(_0x35dbd5,_0x392eec){_0x392eec=_0x392eec||0xc8;return function(_0x586103){if(_0x586103){return _0x35dbd5[_0x7174('0x1b')](_0x392eec)[_0x7174('0x1d')](_0x586103);}};}function respondWithFilteredResult(_0x688e35,_0x18d27e){return function(_0x484065){if(_0x484065){var _0x88c932=typeof _0x18d27e[_0x7174('0x1e')]==='undefined'&&typeof _0x18d27e[_0x7174('0x1f')]==='undefined';var _0x454a78=_0x484065[_0x7174('0x20')];var _0x2edac0=_0x88c932?0x0:_0x18d27e[_0x7174('0x1e')];var _0x370fb6=_0x88c932?_0x484065['count']:_0x18d27e['offset']+_0x18d27e[_0x7174('0x1f')];var _0x47edfc;if(_0x370fb6>=_0x454a78){_0x370fb6=_0x454a78;_0x47edfc=0xc8;}else{_0x47edfc=0xce;}_0x688e35[_0x7174('0x1b')](_0x47edfc);return _0x688e35[_0x7174('0x21')](_0x7174('0x22'),_0x2edac0+'-'+_0x370fb6+'/'+_0x454a78)[_0x7174('0x1d')](_0x484065);}return null;};}function patchUpdates(_0x2e78df){return function(_0x7692ca){try{jsonpatch[_0x7174('0x23')](_0x7692ca,_0x2e78df,!![]);}catch(_0x122b33){return BPromise['reject'](_0x122b33);}return _0x7692ca[_0x7174('0x24')]();};}function saveUpdates(_0x1c8f22,_0x26217e){return function(_0x521bfb){if(_0x521bfb){return _0x521bfb[_0x7174('0x25')](_0x1c8f22)[_0x7174('0x26')](function(_0x1496d6){return _0x1496d6;});}return null;};}function removeEntity(_0x130298,_0x2efbbe){return function(_0x4ee1c4){if(_0x4ee1c4){return _0x4ee1c4[_0x7174('0x27')]()[_0x7174('0x26')](function(){var _0x575da6=_0x4ee1c4[_0x7174('0x28')]({'plain':!![]});var _0x3ca4bb=_0x7174('0x29');return db[_0x7174('0x2a')][_0x7174('0x27')]({'where':{'type':_0x3ca4bb,'resourceId':_0x575da6['id']}})[_0x7174('0x26')](function(){return _0x4ee1c4;});})[_0x7174('0x26')](function(){_0x130298[_0x7174('0x1b')](0xcc)[_0x7174('0x1c')]();});}};}function handleEntityNotFound(_0x20585a,_0xf5273d){return function(_0x388932){if(!_0x388932){_0x20585a['sendStatus'](0x194);}return _0x388932;};}function handleError(_0x59e12e,_0x312679){_0x312679=_0x312679||0x1f4;return function(_0x18d25f){logger[_0x7174('0x2b')](_0x18d25f['stack']);if(_0x18d25f['name']){delete _0x18d25f['name'];}_0x59e12e[_0x7174('0x1b')](_0x312679)[_0x7174('0x2c')](_0x18d25f);};}exports[_0x7174('0x2d')]=function(_0x115fc9,_0x4396f6){var _0x34857f={},_0x417d02={},_0x5c9f70={'count':0x0,'rows':[]};var _0x2b8cdd=_[_0x7174('0x2e')](db['Dashboard'][_0x7174('0x2f')],function(_0x2bf3ba){return{'name':_0x2bf3ba['fieldName'],'type':_0x2bf3ba[_0x7174('0x30')][_0x7174('0x31')]};});_0x417d02[_0x7174('0x32')]=_[_0x7174('0x2e')](_0x2b8cdd,_0x7174('0x33'));_0x417d02[_0x7174('0x34')]=_[_0x7174('0x35')](_0x115fc9[_0x7174('0x34')]);_0x417d02[_0x7174('0x36')]=_[_0x7174('0x37')](_0x417d02[_0x7174('0x32')],_0x417d02[_0x7174('0x34')]);_0x34857f[_0x7174('0x38')]=_['intersection'](_0x417d02[_0x7174('0x32')],qs[_0x7174('0x39')](_0x115fc9[_0x7174('0x34')][_0x7174('0x39')]));_0x34857f[_0x7174('0x38')]=_0x34857f[_0x7174('0x38')]['length']?_0x34857f[_0x7174('0x38')]:_0x417d02[_0x7174('0x32')];if(!_0x115fc9[_0x7174('0x34')][_0x7174('0x3a')]('nolimit')){_0x34857f[_0x7174('0x1f')]=qs[_0x7174('0x1f')](_0x115fc9[_0x7174('0x34')][_0x7174('0x1f')]);_0x34857f[_0x7174('0x1e')]=qs[_0x7174('0x1e')](_0x115fc9['query'][_0x7174('0x1e')]);}_0x34857f['order']=qs[_0x7174('0x3b')](_0x115fc9[_0x7174('0x34')][_0x7174('0x3b')]);_0x34857f['where']=qs[_0x7174('0x36')](_['pick'](_0x115fc9['query'],_0x417d02[_0x7174('0x36')]),_0x2b8cdd);if(_0x115fc9[_0x7174('0x34')][_0x7174('0x3c')]){_0x34857f[_0x7174('0x3d')]=_['merge'](_0x34857f[_0x7174('0x3d')],{'$or':_[_0x7174('0x2e')](_0x2b8cdd,function(_0x10df38){if(_0x10df38[_0x7174('0x30')]!==_0x7174('0x3e')){var _0x389f11={};_0x389f11[_0x10df38[_0x7174('0x33')]]={'$like':'%'+_0x115fc9['query'][_0x7174('0x3c')]+'%'};return _0x389f11;}})});}_0x34857f=_[_0x7174('0x3f')]({},_0x34857f,_0x115fc9[_0x7174('0x40')]);var _0x4f159e={'where':_0x34857f[_0x7174('0x3d')]};return db['Dashboard'][_0x7174('0x20')](_0x4f159e)[_0x7174('0x26')](function(_0x391676){_0x5c9f70[_0x7174('0x20')]=_0x391676;if(_0x115fc9[_0x7174('0x34')]['includeAll']){_0x34857f['include']=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x34857f);})[_0x7174('0x26')](function(_0x2bff2e){_0x5c9f70['rows']=_0x2bff2e;return _0x5c9f70;})[_0x7174('0x26')](respondWithFilteredResult(_0x4396f6,_0x34857f))[_0x7174('0x41')](handleError(_0x4396f6,null));};exports[_0x7174('0x42')]=function(_0x319962,_0x566968){var _0xbe6200={'raw':![],'where':{'id':_0x319962['params']['id']}},_0x7e33c0={};_0x7e33c0[_0x7174('0x32')]=_[_0x7174('0x35')](db[_0x7174('0x43')]['rawAttributes']);_0x7e33c0[_0x7174('0x34')]=_['keys'](_0x319962['query']);_0x7e33c0[_0x7174('0x36')]=_[_0x7174('0x37')](_0x7e33c0[_0x7174('0x32')],_0x7e33c0[_0x7174('0x34')]);_0xbe6200[_0x7174('0x38')]=_[_0x7174('0x37')](_0x7e33c0['model'],qs[_0x7174('0x39')](_0x319962[_0x7174('0x34')][_0x7174('0x39')]));_0xbe6200[_0x7174('0x38')]=_0xbe6200[_0x7174('0x38')][_0x7174('0x44')]?_0xbe6200['attributes']:_0x7e33c0['model'];if(_0x319962['query'][_0x7174('0x45')]){_0xbe6200[_0x7174('0x46')]=[{'all':!![]}];}_0xbe6200=_[_0x7174('0x3f')]({},_0xbe6200,_0x319962[_0x7174('0x40')]);return db['Dashboard'][_0x7174('0x47')](_0xbe6200)[_0x7174('0x26')](handleEntityNotFound(_0x566968,null))[_0x7174('0x26')](respondWithResult(_0x566968,null))[_0x7174('0x41')](handleError(_0x566968,null));};exports[_0x7174('0x48')]=function(_0x2e165b,_0x1be015){return db[_0x7174('0x43')][_0x7174('0x48')](_0x2e165b[_0x7174('0x49')],{})['then'](function(_0x484375){var _0x182a10=_0x2e165b[_0x7174('0x4a')][_0x7174('0x28')]({'plain':!![]});if(!_0x182a10)throw new Error(_0x7174('0x4b'));if(_0x182a10[_0x7174('0x4c')]===_0x7174('0x4a')){var _0x6cde5c=_0x484375['get']({'plain':!![]});var _0x4cbf4e=_0x7174('0x29');return db[_0x7174('0x4d')]['find']({'where':{'name':_0x4cbf4e,'userProfileId':_0x182a10['userProfileId']},'raw':!![]})[_0x7174('0x26')](function(_0x224238){if(_0x224238&&_0x224238[_0x7174('0x4e')]===0x0){return db[_0x7174('0x2a')][_0x7174('0x48')]({'name':_0x6cde5c[_0x7174('0x33')],'resourceId':_0x6cde5c['id'],'type':_0x224238[_0x7174('0x33')],'sectionId':_0x224238['id']},{})[_0x7174('0x26')](function(){return _0x484375;});}else{return _0x484375;}})[_0x7174('0x41')](function(_0x1cd0cf){logger[_0x7174('0x2b')](_0x7174('0x4f'),_0x1cd0cf);throw _0x1cd0cf;});}return _0x484375;})['then'](respondWithResult(_0x1be015,0xc9))['catch'](handleError(_0x1be015,null));};exports[_0x7174('0x50')]=function(_0x36f23b,_0x4c0dec){var _0x931660={'where':{'id':_0x36f23b['params']['id']}},_0x35da22={};_0x35da22[_0x7174('0x32')]=_['keys'](db[_0x7174('0x43')][_0x7174('0x2f')]);_0x931660[_0x7174('0x38')]=_['intersection'](_0x35da22[_0x7174('0x32')],qs[_0x7174('0x39')](_0x36f23b[_0x7174('0x34')]['fields']));_0x931660[_0x7174('0x38')]=_0x931660[_0x7174('0x38')][_0x7174('0x44')]?_0x931660[_0x7174('0x38')]:_0x35da22['model'];if(_0x36f23b['query'][_0x7174('0x45')]){_0x931660[_0x7174('0x46')]=[{'all':!![]}];}_0x931660=_[_0x7174('0x3f')]({},_0x931660,_0x36f23b[_0x7174('0x40')]);return db['Dashboard'][_0x7174('0x47')](_0x931660)['then'](handleEntityNotFound(_0x4c0dec,null))[_0x7174('0x26')](function(_0x1bd30b){if(_0x1bd30b){var _0x5bd747=_0x1bd30b[_0x7174('0x28')]({'plain':!![]});_0x5bd747=qs[_0x7174('0x51')](_0x5bd747,['id','createdAt',_0x7174('0x52')]);_0x36f23b[_0x7174('0x49')]=_[_0x7174('0x51')](_0x36f23b[_0x7174('0x49')],['id',_0x7174('0x53'),'updatedAt']);return db[_0x7174('0x43')]['create'](_[_0x7174('0x3f')](_0x5bd747,_0x36f23b[_0x7174('0x49')]),{'include':_0x36f23b[_0x7174('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0x7174('0x26')](function(_0xcb1373){var _0x595872=_0x36f23b['user'][_0x7174('0x28')]({'plain':!![]});if(!_0x595872)throw new Error(_0x7174('0x4b'));if(_0x595872[_0x7174('0x4c')]===_0x7174('0x4a')){var _0x38088f=_0xcb1373[_0x7174('0x28')]({'plain':!![]});var _0x37144b=_0x7174('0x29');return db['UserProfileSection'][_0x7174('0x47')]({'where':{'name':_0x37144b,'userProfileId':_0x595872[_0x7174('0x54')]},'raw':!![]})[_0x7174('0x26')](function(_0x2a55ae){if(_0x2a55ae&&_0x2a55ae[_0x7174('0x4e')]===0x0){return db[_0x7174('0x2a')][_0x7174('0x48')]({'name':_0x38088f[_0x7174('0x33')],'resourceId':_0x38088f['id'],'type':_0x2a55ae[_0x7174('0x33')],'sectionId':_0x2a55ae['id']},{})['then'](function(){return _0xcb1373;});}else{return _0xcb1373;}})[_0x7174('0x41')](function(_0x12c049){logger['error'](_0x7174('0x4f'),_0x12c049);throw _0x12c049;});}return _0xcb1373;});}})[_0x7174('0x26')](respondWithResult(_0x4c0dec,0xc9))[_0x7174('0x41')](handleError(_0x4c0dec,null));};exports[_0x7174('0x25')]=function(_0x3928a9,_0x342413){if(_0x3928a9[_0x7174('0x49')]['id']){delete _0x3928a9['body']['id'];}return db[_0x7174('0x43')][_0x7174('0x47')]({'where':{'id':_0x3928a9['params']['id']}})['then'](handleEntityNotFound(_0x342413,null))[_0x7174('0x26')](saveUpdates(_0x3928a9[_0x7174('0x49')],null))[_0x7174('0x26')](respondWithResult(_0x342413,null))['catch'](handleError(_0x342413,null));};exports['destroy']=function(_0x3dfac5,_0x53e3a6){return db[_0x7174('0x43')]['find']({'where':{'id':_0x3dfac5['params']['id']}})[_0x7174('0x26')](handleEntityNotFound(_0x53e3a6,null))[_0x7174('0x26')](removeEntity(_0x53e3a6,null))[_0x7174('0x41')](handleError(_0x53e3a6,null));};function widgetAttributes(_0x1533b6){try{switch(_0x1533b6[_0x7174('0x30')]){case _0x7174('0x55'):return[{'name':_0x7174('0x56'),'value':_0x1533b6[_0x7174('0x56')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x0]?_0x1533b6['attrs'][0x0][_0x7174('0x58')]:undefined)||_0x7174('0x59')}];case _0x7174('0x5a'):return[{'name':'attrPath','value':_0x1533b6[_0x7174('0x5b')]||(_0x1533b6['attrs']&&_0x1533b6[_0x7174('0x57')][0x0]?_0x1533b6[_0x7174('0x57')][0x0][_0x7174('0x58')]:undefined)||''}];case _0x7174('0x5c'):return[{'name':_0x7174('0x5d'),'value':_0x1533b6['attrHourFormat']||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6['attrs'][0x0]?_0x1533b6['attrs'][0x0][_0x7174('0x58')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x1533b6[_0x7174('0x5e')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x1]?_0x1533b6[_0x7174('0x57')][0x1][_0x7174('0x58')]:undefined)||'0.00'},{'name':_0x7174('0x5f'),'value':_0x1533b6[_0x7174('0x5f')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x2]?_0x1533b6['attrs'][0x2][_0x7174('0x58')]:undefined)||0xc}];case _0x7174('0x60'):return[{'name':_0x7174('0x61'),'value':_0x1533b6[_0x7174('0x61')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x0]?_0x1533b6[_0x7174('0x57')][0x0][_0x7174('0x58')]:undefined)||_0x7174('0x62')},{'name':_0x7174('0x63'),'value':_0x1533b6[_0x7174('0x63')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x1]?_0x1533b6[_0x7174('0x57')][0x1]['value']:undefined)||[]},{'name':_0x7174('0x5f'),'value':_0x1533b6[_0x7174('0x5f')]||(_0x1533b6['attrs']&&_0x1533b6['attrs'][0x2]?_0x1533b6['attrs'][0x2][_0x7174('0x58')]:undefined)||0x14},{'name':_0x7174('0x64'),'value':_0x1533b6[_0x7174('0x64')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6['attrs'][0x3]?_0x1533b6['attrs'][0x3]['value']:undefined)||_0x7174('0x65')},{'name':_0x7174('0x66'),'value':_0x1533b6[_0x7174('0x66')]||(_0x1533b6['attrs']&&_0x1533b6[_0x7174('0x57')][0x4]?_0x1533b6[_0x7174('0x57')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x1533b6[_0x7174('0x67')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x5]?_0x1533b6[_0x7174('0x57')][0x5][_0x7174('0x58')]:undefined)||''},{'name':_0x7174('0x68'),'value':_0x1533b6['attrSmsAccounts']||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x6]?_0x1533b6['attrs'][0x6]['value']:undefined)||''},{'name':_0x7174('0x69'),'value':_0x1533b6['attrOpenchannelAccounts']||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x7]?_0x1533b6['attrs'][0x7][_0x7174('0x58')]:undefined)||''},{'name':_0x7174('0x6a'),'value':_0x1533b6[_0x7174('0x6a')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x8]?_0x1533b6[_0x7174('0x57')][0x8]['value']:undefined)||''},{'name':_0x7174('0x6b'),'value':_0x1533b6[_0x7174('0x6b')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x9]?_0x1533b6[_0x7174('0x57')][0x9][_0x7174('0x58')]:undefined)||''}];case _0x7174('0x6c'):case'pie-chart':return[{'name':_0x7174('0x6d'),'value':_0x1533b6[_0x7174('0x6d')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x0]?_0x1533b6['attrs'][0x0][_0x7174('0x58')]:undefined)||_0x7174('0x62')},{'name':_0x7174('0x6e'),'value':_0x1533b6[_0x7174('0x6e')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x1]?_0x1533b6[_0x7174('0x57')][0x1][_0x7174('0x58')]:undefined)||null},{'name':_0x7174('0x6f'),'value':_0x1533b6[_0x7174('0x6f')]||(_0x1533b6['attrs']&&_0x1533b6[_0x7174('0x57')][0x2]?_0x1533b6[_0x7174('0x57')][0x2][_0x7174('0x58')]:undefined)||null},{'name':_0x7174('0x63'),'value':_0x1533b6[_0x7174('0x63')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x3]?_0x1533b6['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x1533b6['attrChannel']||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6['attrs'][0x4]?_0x1533b6[_0x7174('0x57')][0x4][_0x7174('0x58')]:undefined)||'voice'},{'name':_0x7174('0x66'),'value':_0x1533b6[_0x7174('0x66')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x5]?_0x1533b6[_0x7174('0x57')][0x5][_0x7174('0x58')]:undefined)||''},{'name':_0x7174('0x67'),'value':_0x1533b6['attrFaxAccounts']||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x6]?_0x1533b6[_0x7174('0x57')][0x6][_0x7174('0x58')]:undefined)||''},{'name':_0x7174('0x68'),'value':_0x1533b6[_0x7174('0x68')]||(_0x1533b6['attrs']&&_0x1533b6[_0x7174('0x57')][0x7]?_0x1533b6['attrs'][0x7][_0x7174('0x58')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1533b6[_0x7174('0x69')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x8]?_0x1533b6['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1533b6[_0x7174('0x6a')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x9]?_0x1533b6[_0x7174('0x57')][0x9][_0x7174('0x58')]:undefined)||''},{'name':_0x7174('0x6b'),'value':_0x1533b6[_0x7174('0x6b')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0xa]?_0x1533b6['attrs'][0xa][_0x7174('0x58')]:undefined)||''}];case _0x7174('0x70'):return[{'name':_0x7174('0x71'),'type':_0x1533b6['reportType']||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x0]?_0x1533b6[_0x7174('0x57')][0x0][_0x7174('0x30')]:undefined)||null,'value':_0x1533b6['attrReport']||(_0x1533b6['attrs']&&_0x1533b6[_0x7174('0x57')][0x0]?_0x1533b6[_0x7174('0x57')][0x0]['value']:undefined)||null},{'name':_0x7174('0x72'),'value':_0x1533b6[_0x7174('0x72')]||(_0x1533b6[_0x7174('0x57')]&&_0x1533b6[_0x7174('0x57')][0x1]?_0x1533b6[_0x7174('0x57')][0x1][_0x7174('0x58')]:undefined)||0x0}];default:return[];}}catch(_0xbdba73){logger[_0x7174('0x2b')](_0x7174('0x73'),JSON[_0x7174('0x74')](_0xbdba73));return[];}}exports[_0x7174('0x75')]=function(_0x762214,_0x12e829,_0x2259ad){if(_0x762214[_0x7174('0x49')]['id']){delete _0x762214['body']['id'];}return db[_0x7174('0x43')][_0x7174('0x47')]({'where':{'id':_0x762214['params']['id']}})[_0x7174('0x26')](handleEntityNotFound(_0x12e829,null))[_0x7174('0x26')](function(_0x9bff32){if(_0x9bff32){_0x762214[_0x7174('0x49')][_0x7174('0x76')]=_0x9bff32['id'];_0x762214[_0x7174('0x49')][_0x7174('0x57')]=widgetAttributes(_0x762214[_0x7174('0x49')]);return db[_0x7174('0x77')][_0x7174('0x48')](_0x762214[_0x7174('0x49')]);}})[_0x7174('0x26')](respondWithResult(_0x12e829,null))[_0x7174('0x41')](handleError(_0x12e829,null));};exports['getItems']=function(_0x594691,_0x47d692,_0x28f29b){var _0x35e9fc={};var _0x12578b={};var _0x310127;var _0x359f31;return db[_0x7174('0x43')]['findOne']({'where':{'id':_0x594691[_0x7174('0x78')]['id']}})[_0x7174('0x26')](handleEntityNotFound(_0x47d692,null))[_0x7174('0x26')](function(_0x418568){if(_0x418568){_0x310127=_0x418568;_0x12578b['model']=_[_0x7174('0x35')](db['DashboardItem'][_0x7174('0x2f')]);_0x12578b[_0x7174('0x34')]=_[_0x7174('0x35')](_0x594691[_0x7174('0x34')]);_0x12578b[_0x7174('0x36')]=_[_0x7174('0x37')](_0x12578b[_0x7174('0x32')],_0x12578b[_0x7174('0x34')]);_0x35e9fc[_0x7174('0x38')]=_['intersection'](_0x12578b[_0x7174('0x32')],qs[_0x7174('0x39')](_0x594691[_0x7174('0x34')][_0x7174('0x39')]));_0x35e9fc[_0x7174('0x38')]=_0x35e9fc[_0x7174('0x38')][_0x7174('0x44')]?_0x35e9fc[_0x7174('0x38')]:_0x12578b[_0x7174('0x32')];_0x35e9fc[_0x7174('0x79')]=qs[_0x7174('0x3b')](_0x594691[_0x7174('0x34')][_0x7174('0x3b')]);_0x35e9fc[_0x7174('0x3d')]=qs[_0x7174('0x36')](_[_0x7174('0x7a')](_0x594691['query'],_0x12578b[_0x7174('0x36')]));if(_0x594691[_0x7174('0x34')][_0x7174('0x3c')]){_0x35e9fc[_0x7174('0x3d')]=_['merge'](_0x35e9fc[_0x7174('0x3d')],{'$or':_['map'](_0x35e9fc[_0x7174('0x38')],function(_0x5152e0){var _0x578060={};_0x578060[_0x5152e0]={'$like':'%'+_0x594691[_0x7174('0x34')][_0x7174('0x3c')]+'%'};return _0x578060;})});}_0x35e9fc=_[_0x7174('0x3f')]({},_0x35e9fc,_0x594691[_0x7174('0x40')]);return _0x310127[_0x7174('0x7b')](_0x35e9fc);}})[_0x7174('0x26')](function(_0x35e497){if(_0x35e497){_0x359f31=_0x35e497[_0x7174('0x44')];if(!_0x594691['query'][_0x7174('0x3a')](_0x7174('0x7c'))){_0x35e9fc['limit']=qs[_0x7174('0x1f')](_0x594691[_0x7174('0x34')]['limit']);_0x35e9fc['offset']=qs['offset'](_0x594691[_0x7174('0x34')][_0x7174('0x1e')]);}return _0x310127['getItems'](_0x35e9fc);}})['then'](function(_0x135c26){if(_0x135c26){return _0x135c26?{'count':_0x359f31,'rows':_0x135c26}:null;}})[_0x7174('0x26')](respondWithResult(_0x47d692,null))[_0x7174('0x41')](handleError(_0x47d692,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 8c63a6a..ec76c26 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 _0x9b8e=['events','Dashboard','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x377959,_0x565f80){var _0x4ac430=function(_0x6ffad5){while(--_0x6ffad5){_0x377959['push'](_0x377959['shift']());}};_0x4ac430(++_0x565f80);}(_0x9b8e,0x158));var _0xe9b8=function(_0x2eeac8,_0x1cd8ed){_0x2eeac8=_0x2eeac8-0x0;var _0xd87a3c=_0x9b8e[_0x2eeac8];return _0xd87a3c;};'use strict';var EventEmitter=require(_0xe9b8('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xe9b8('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe9b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe9b8('0x3')};function emitEvent(_0x56068b){return function(_0x1fb7b1,_0x175526,_0x5dc89c){DashboardEvents[_0xe9b8('0x4')](_0x56068b+':'+_0x1fb7b1['id'],_0x1fb7b1);DashboardEvents[_0xe9b8('0x4')](_0x56068b,_0x1fb7b1);_0x5dc89c(null);};}for(var e in events){if(events[_0xe9b8('0x5')](e)){var event=events[e];Dashboard[_0xe9b8('0x6')](e,emitEvent(event));}}module[_0xe9b8('0x7')]=DashboardEvents; \ No newline at end of file +var _0x2015=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x4f996c,_0x5847e7){var _0x4411ca=function(_0x53ad0d){while(--_0x53ad0d){_0x4f996c['push'](_0x4f996c['shift']());}};_0x4411ca(++_0x5847e7);}(_0x2015,0x193));var _0x5201=function(_0x5907b8,_0xf20cbf){_0x5907b8=_0x5907b8-0x0;var _0xd853e0=_0x2015[_0x5907b8];return _0xd853e0;};'use strict';var EventEmitter=require(_0x5201('0x0'));var Dashboard=require(_0x5201('0x1'))['db'][_0x5201('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5201('0x3')](0x0);var events={'afterCreate':_0x5201('0x4'),'afterUpdate':_0x5201('0x5'),'afterDestroy':_0x5201('0x6')};function emitEvent(_0x137f29){return function(_0x598fde,_0x95d6ae,_0x2fa026){DashboardEvents[_0x5201('0x7')](_0x137f29+':'+_0x598fde['id'],_0x598fde);DashboardEvents[_0x5201('0x7')](_0x137f29,_0x598fde);_0x2fa026(null);};}for(var e in events){if(events[_0x5201('0x8')](e)){var event=events[e];Dashboard[_0x5201('0x9')](e,emitEvent(event));}}module[_0x5201('0xa')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index a4218ba..7e833ed 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 _0xeb2c=['rimraf','./dashboard.attributes','exports','define','Dashboard','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3aca58,_0x1aeabc){var _0x45fc3b=function(_0x4ecfbd){while(--_0x4ecfbd){_0x3aca58['push'](_0x3aca58['shift']());}};_0x45fc3b(++_0x1aeabc);}(_0xeb2c,0x1e9));var _0xceb2=function(_0x1d6a3b,_0x2c90ff){_0x1d6a3b=_0x1d6a3b-0x0;var _0x1a192d=_0xeb2c[_0x1d6a3b];return _0x1a192d;};'use strict';var _=require(_0xceb2('0x0'));var util=require(_0xceb2('0x1'));var logger=require(_0xceb2('0x2'))(_0xceb2('0x3'));var moment=require(_0xceb2('0x4'));var BPromise=require('bluebird');var rp=require(_0xceb2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xceb2('0x6'));var config=require('../../config/environment');var attributes=require(_0xceb2('0x7'));module[_0xceb2('0x8')]=function(_0x11a0ec,_0x5d0b4f){return _0x11a0ec[_0xceb2('0x9')](_0xceb2('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4113=['./dashboard.attributes','exports','define','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x36896c,_0x573166){var _0x3c46a1=function(_0x2f6a1a){while(--_0x2f6a1a){_0x36896c['push'](_0x36896c['shift']());}};_0x3c46a1(++_0x573166);}(_0x4113,0x18a));var _0x3411=function(_0x56e86d,_0x2df0ad){_0x56e86d=_0x56e86d-0x0;var _0x3efb68=_0x4113[_0x56e86d];return _0x3efb68;};'use strict';var _=require(_0x3411('0x0'));var util=require(_0x3411('0x1'));var logger=require(_0x3411('0x2'))(_0x3411('0x3'));var moment=require(_0x3411('0x4'));var BPromise=require(_0x3411('0x5'));var rp=require(_0x3411('0x6'));var fs=require('fs');var path=require(_0x3411('0x7'));var rimraf=require(_0x3411('0x8'));var config=require('../../config/environment');var attributes=require(_0x3411('0x9'));module[_0x3411('0xa')]=function(_0xbc567d,_0x551163){return _0xbc567d[_0x3411('0xb')]('Dashboard',attributes,{'tableName':_0x3411('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 752ef31..36b82ad 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 _0x56cc=['Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','info'];(function(_0x486754,_0x143291){var _0x28ed42=function(_0x592731){while(--_0x592731){_0x486754['push'](_0x486754['shift']());}};_0x28ed42(++_0x143291);}(_0x56cc,0xc8));var _0xc56c=function(_0x229f2f,_0x4d8c4e){_0x229f2f=_0x229f2f-0x0;var _0x2e1406=_0x56cc[_0x229f2f];return _0x2e1406;};'use strict';var _=require('lodash');var util=require(_0xc56c('0x0'));var moment=require(_0xc56c('0x1'));var BPromise=require(_0xc56c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc56c('0x3'))['db'];var utils=require(_0xc56c('0x4'));var logger=require(_0xc56c('0x5'))('rpc');var config=require(_0xc56c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc56c('0x7')][_0xc56c('0x8')]({'port':0x232a});config['redis']=_[_0xc56c('0x9')](config['redis'],{'host':_0xc56c('0xa'),'port':0x18eb});var socket=require(_0xc56c('0xb'))(new Redis(config['redis']));require(_0xc56c('0xc'))[_0xc56c('0xd')](socket);function respondWithRpcPromise(_0x3ed47f,_0x173b13,_0x47ade7){return new BPromise(function(_0x282ada,_0x2ce471){return client['request'](_0x3ed47f,_0x47ade7)[_0xc56c('0xe')](function(_0x10e706){logger[_0xc56c('0xf')](_0xc56c('0x10'),_0x173b13,'request\x20sent');logger[_0xc56c('0x11')](_0xc56c('0x12'),_0x173b13,_0xc56c('0x13'),JSON['stringify'](_0x10e706));if(_0x10e706['error']){if(_0x10e706['error'][_0xc56c('0x14')]===0x1f4){logger[_0xc56c('0x15')](_0xc56c('0x10'),_0x173b13,_0x10e706[_0xc56c('0x15')][_0xc56c('0x16')]);return _0x2ce471(_0x10e706[_0xc56c('0x15')]['message']);}logger[_0xc56c('0x15')](_0xc56c('0x10'),_0x173b13,_0x10e706[_0xc56c('0x15')][_0xc56c('0x16')]);return _0x282ada(_0x10e706[_0xc56c('0x15')]['message']);}else{logger[_0xc56c('0xf')](_0xc56c('0x10'),_0x173b13,_0xc56c('0x13'));_0x282ada(_0x10e706[_0xc56c('0x17')][_0xc56c('0x16')]);}})['catch'](function(_0x40a4ec){logger[_0xc56c('0x15')]('Dashboard,\x20%s,\x20%s',_0x173b13,_0x40a4ec);_0x2ce471(_0x40a4ec);});});} \ No newline at end of file +var _0xad16=['bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment'];(function(_0x8c453,_0x57ffe1){var _0xc76889=function(_0x3bb84b){while(--_0x3bb84b){_0x8c453['push'](_0x8c453['shift']());}};_0xc76889(++_0x57ffe1);}(_0xad16,0xcf));var _0x6ad1=function(_0x4ddfdd,_0x4dacd8){_0x4ddfdd=_0x4ddfdd-0x0;var _0x47c565=_0xad16[_0x4ddfdd];return _0x47c565;};'use strict';var _=require(_0x6ad1('0x0'));var util=require(_0x6ad1('0x1'));var moment=require(_0x6ad1('0x2'));var BPromise=require(_0x6ad1('0x3'));var rs=require(_0x6ad1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ad1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ad1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6ad1('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x6ad1('0x8')]=_[_0x6ad1('0x9')](config[_0x6ad1('0x8')],{'host':_0x6ad1('0xa'),'port':0x18eb});var socket=require(_0x6ad1('0xb'))(new Redis(config[_0x6ad1('0x8')]));require(_0x6ad1('0xc'))['register'](socket);function respondWithRpcPromise(_0x452b7a,_0x36a4aa,_0x3ddea3){return new BPromise(function(_0x2034df,_0x4a9317){return client[_0x6ad1('0xd')](_0x452b7a,_0x3ddea3)['then'](function(_0x2c0aa8){logger['info'](_0x6ad1('0xe'),_0x36a4aa,_0x6ad1('0xf'));logger[_0x6ad1('0x10')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x36a4aa,_0x6ad1('0xf'),JSON[_0x6ad1('0x11')](_0x2c0aa8));if(_0x2c0aa8[_0x6ad1('0x12')]){if(_0x2c0aa8['error']['code']===0x1f4){logger[_0x6ad1('0x12')](_0x6ad1('0xe'),_0x36a4aa,_0x2c0aa8[_0x6ad1('0x12')][_0x6ad1('0x13')]);return _0x4a9317(_0x2c0aa8[_0x6ad1('0x12')]['message']);}logger[_0x6ad1('0x12')](_0x6ad1('0xe'),_0x36a4aa,_0x2c0aa8[_0x6ad1('0x12')][_0x6ad1('0x13')]);return _0x2034df(_0x2c0aa8[_0x6ad1('0x12')][_0x6ad1('0x13')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x36a4aa,_0x6ad1('0xf'));_0x2034df(_0x2c0aa8['result'][_0x6ad1('0x13')]);}})[_0x6ad1('0x14')](function(_0x4921be){logger[_0x6ad1('0x12')](_0x6ad1('0xe'),_0x36a4aa,_0x4921be);_0x4a9317(_0x4921be);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index c4fd384..e1a6d17 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 _0x3396=['update','emit','removeListener','register','length','dashboard:','./dashboard.events','remove'];(function(_0x5e7b0a,_0xe2a383){var _0x59e412=function(_0xd3a9cb){while(--_0xd3a9cb){_0x5e7b0a['push'](_0x5e7b0a['shift']());}};_0x59e412(++_0xe2a383);}(_0x3396,0x6e));var _0x6339=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3396[_0xfae23b];return _0x200640;};'use strict';var DashboardEvents=require(_0x6339('0x0'));var events=['save',_0x6339('0x1'),_0x6339('0x2')];function createListener(_0x13bbe2,_0x39e5a3){return function(_0x4354ca){_0x39e5a3[_0x6339('0x3')](_0x13bbe2,_0x4354ca);};}function removeListener(_0x12cc7b,_0x121c8d){return function(){DashboardEvents[_0x6339('0x4')](_0x12cc7b,_0x121c8d);};}exports[_0x6339('0x5')]=function(_0x26a870){for(var _0x4083d6=0x0,_0x2d1f6c=events[_0x6339('0x6')];_0x4083d6<_0x2d1f6c;_0x4083d6++){var _0x85d4d6=events[_0x4083d6];var _0x2af449=createListener(_0x6339('0x7')+_0x85d4d6,_0x26a870);DashboardEvents['on'](_0x85d4d6,_0x2af449);}}; \ No newline at end of file +var _0xc579=['removeListener','register','length','./dashboard.events','save','update'];(function(_0x1f3da5,_0x12ef35){var _0x43ae57=function(_0x596484){while(--_0x596484){_0x1f3da5['push'](_0x1f3da5['shift']());}};_0x43ae57(++_0x12ef35);}(_0xc579,0x1a1));var _0x9c57=function(_0x52236a,_0x5ad0c1){_0x52236a=_0x52236a-0x0;var _0x426879=_0xc579[_0x52236a];return _0x426879;};'use strict';var DashboardEvents=require(_0x9c57('0x0'));var events=[_0x9c57('0x1'),'remove',_0x9c57('0x2')];function createListener(_0x1ad0c1,_0x5cbe50){return function(_0x54b9c8){_0x5cbe50['emit'](_0x1ad0c1,_0x54b9c8);};}function removeListener(_0x27333e,_0x4a6a3e){return function(){DashboardEvents[_0x9c57('0x3')](_0x27333e,_0x4a6a3e);};}exports[_0x9c57('0x4')]=function(_0x16e62b){for(var _0x232d49=0x0,_0x248ceb=events[_0x9c57('0x5')];_0x232d49<_0x248ceb;_0x232d49++){var _0x7396ce=events[_0x232d49];var _0x203aaf=createListener('dashboard:'+_0x7396ce,_0x16e62b);DashboardEvents['on'](_0x7396ce,_0x203aaf);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 0a5042b..d2f7fc2 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 _0x0b26=['create','clone','addItem','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/items','post'];(function(_0x3441bb,_0x11052c){var _0xd94568=function(_0x3cd075){while(--_0x3cd075){_0x3441bb['push'](_0x3441bb['shift']());}};_0xd94568(++_0x11052c);}(_0x0b26,0xa0));var _0x60b2=function(_0x116c04,_0x4963da){_0x116c04=_0x116c04-0x0;var _0x9e011d=_0x0b26[_0x116c04];return _0x9e011d;};'use strict';var multer=require(_0x60b2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x60b2('0x1'));var router=express[_0x60b2('0x2')]();var fs_extra=require(_0x60b2('0x3'));var auth=require(_0x60b2('0x4'));var interaction=require(_0x60b2('0x5'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0x60b2('0x6')]('/',auth[_0x60b2('0x7')](),controller['index']);router[_0x60b2('0x6')](_0x60b2('0x8'),auth[_0x60b2('0x7')](),controller['show']);router[_0x60b2('0x6')](_0x60b2('0x9'),auth['isAuthenticated'](),controller['getItems']);router[_0x60b2('0xa')]('/',auth[_0x60b2('0x7')](),controller[_0x60b2('0xb')]);router['post']('/:id/clone',auth[_0x60b2('0x7')](),controller[_0x60b2('0xc')]);router[_0x60b2('0xa')](_0x60b2('0x9'),auth[_0x60b2('0x7')](),controller[_0x60b2('0xd')]);router[_0x60b2('0xe')](_0x60b2('0x8'),auth[_0x60b2('0x7')](),controller[_0x60b2('0xf')]);router[_0x60b2('0x10')](_0x60b2('0x8'),auth[_0x60b2('0x7')](),controller[_0x60b2('0x11')]);module[_0x60b2('0x12')]=router; \ No newline at end of file +var _0xb5b7=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','destroy','exports'];(function(_0x36b211,_0x12b311){var _0x410f1b=function(_0x24a88f){while(--_0x24a88f){_0x36b211['push'](_0x36b211['shift']());}};_0x410f1b(++_0x12b311);}(_0xb5b7,0x113));var _0x7b5b=function(_0x440dd6,_0x56bf31){_0x440dd6=_0x440dd6-0x0;var _0x1cf12a=_0xb5b7[_0x440dd6];return _0x1cf12a;};'use strict';var multer=require('multer');var util=require(_0x7b5b('0x0'));var path=require('path');var timeout=require(_0x7b5b('0x1'));var express=require('express');var router=express[_0x7b5b('0x2')]();var fs_extra=require(_0x7b5b('0x3'));var auth=require(_0x7b5b('0x4'));var interaction=require(_0x7b5b('0x5'));var config=require(_0x7b5b('0x6'));var controller=require(_0x7b5b('0x7'));router[_0x7b5b('0x8')]('/',auth['isAuthenticated'](),controller[_0x7b5b('0x9')]);router[_0x7b5b('0x8')](_0x7b5b('0xa'),auth[_0x7b5b('0xb')](),controller[_0x7b5b('0xc')]);router[_0x7b5b('0x8')](_0x7b5b('0xd'),auth[_0x7b5b('0xb')](),controller[_0x7b5b('0xe')]);router[_0x7b5b('0xf')]('/',auth[_0x7b5b('0xb')](),controller[_0x7b5b('0x10')]);router[_0x7b5b('0xf')](_0x7b5b('0x11'),auth[_0x7b5b('0xb')](),controller[_0x7b5b('0x12')]);router[_0x7b5b('0xf')](_0x7b5b('0xd'),auth[_0x7b5b('0xb')](),controller[_0x7b5b('0x13')]);router[_0x7b5b('0x14')](_0x7b5b('0xa'),auth[_0x7b5b('0xb')](),controller[_0x7b5b('0x15')]);router[_0x7b5b('0x16')]('/:id',auth[_0x7b5b('0xb')](),controller[_0x7b5b('0x17')]);module[_0x7b5b('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 735e27f..5bd02a1 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 _0xda19=['TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','squel','lodash','STRING'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0xda19,0xd5));var _0x9da1=function(_0x5dad2a,_0x5077f0){_0x5dad2a=_0x5dad2a-0x0;var _0x5b8728=_0xda19[_0x5dad2a];return _0x5b8728;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x9da1('0x0'));var _=require(_0x9da1('0x1'));module['exports']={'title':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9da1('0x3')]('long'),'get':function(){try{return JSON[_0x9da1('0x4')](this[_0x9da1('0x5')](_0x9da1('0x6')));}catch(_0x470043){return[];}},'set':function(_0x156faf){try{this[_0x9da1('0x7')](_0x9da1('0x6'),JSON[_0x9da1('0x8')](_0x156faf));}catch(_0x1c24e6){this[_0x9da1('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9da1('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x9da1('0x9')]},'background':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9da1('0x2')]},'titleFontSize':{'type':Sequelize[_0x9da1('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0x1883=['stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x1883,0xab));var _0x3188=function(_0x1efa21,_0x2b2779){_0x1efa21=_0x1efa21-0x0;var _0x1d5dad=_0x1883[_0x1efa21];return _0x1d5dad;};'use strict';var Sequelize=require(_0x3188('0x0'));var squel=require(_0x3188('0x1'));var _=require(_0x3188('0x2'));module[_0x3188('0x3')]={'title':{'type':Sequelize[_0x3188('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x3188('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3188('0x5')](_0x3188('0x6')),'get':function(){try{return JSON[_0x3188('0x7')](this[_0x3188('0x8')](_0x3188('0x9')));}catch(_0x345612){return[];}},'set':function(_0x408ae0){try{this[_0x3188('0xa')](_0x3188('0x9'),JSON[_0x3188('0xb')](_0x408ae0));}catch(_0x3e3afb){this['setDataValue'](_0x3188('0x9'),JSON[_0x3188('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3188('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x3188('0xc')]},'background':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':_0x3188('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3188('0x4')]},'titleFontSize':{'type':Sequelize[_0x3188('0xc')],'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 01e1b28..c194c90 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 _0xbe2a=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','attributes','intersection','fields','length','model','includeAll','include','find','catch','type','iframe','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','body','create','eml-format','rimraf'];(function(_0x46ed73,_0x53d915){var _0x220387=function(_0x5460bc){while(--_0x5460bc){_0x46ed73['push'](_0x46ed73['shift']());}};_0x220387(++_0x53d915);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x5c9589,_0x3800a5){_0x5c9589=_0x5c9589-0x0;var _0x5e6ea3=_0xbe2a[_0x5c9589];return _0x5e6ea3;};'use strict';var emlformat=require(_0xabe2('0x0'));var rimraf=require(_0xabe2('0x1'));var zipdir=require(_0xabe2('0x2'));var jsonpatch=require(_0xabe2('0x3'));var rp=require(_0xabe2('0x4'));var moment=require(_0xabe2('0x5'));var BPromise=require(_0xabe2('0x6'));var Mustache=require('mustache');var util=require(_0xabe2('0x7'));var path=require('path');var sox=require(_0xabe2('0x8'));var csv=require(_0xabe2('0x9'));var ejs=require(_0xabe2('0xa'));var fs=require('fs');var fs_extra=require(_0xabe2('0xb'));var _=require(_0xabe2('0xc'));var squel=require(_0xabe2('0xd'));var crypto=require('crypto');var jsforce=require(_0xabe2('0xe'));var deskjs=require(_0xabe2('0xf'));var toCsv=require(_0xabe2('0x9'));var querystring=require(_0xabe2('0x10'));var Papa=require(_0xabe2('0x11'));var Redis=require(_0xabe2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xabe2('0x13'));var as=require(_0xabe2('0x14'));var hardwareService=require(_0xabe2('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xabe2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xabe2('0x17'))['db'];config[_0xabe2('0x18')]=_['defaults'](config['redis'],{'host':_0xabe2('0x19'),'port':0x18eb});var socket=require(_0xabe2('0x1a'))(new Redis(config[_0xabe2('0x18')]));require(_0xabe2('0x1b'))[_0xabe2('0x1c')](socket);function respondWithStatusCode(_0xb8343d,_0x3d94a9){_0x3d94a9=_0x3d94a9||0xcc;return function(_0x3eb2e3){if(_0x3eb2e3){return _0xb8343d[_0xabe2('0x1d')](_0x3d94a9);}return _0xb8343d[_0xabe2('0x1e')](_0x3d94a9)['end']();};}function respondWithResult(_0x3dd6d9,_0x3ba203){_0x3ba203=_0x3ba203||0xc8;return function(_0x3eb2b2){if(_0x3eb2b2){return _0x3dd6d9['status'](_0x3ba203)[_0xabe2('0x1f')](_0x3eb2b2);}};}function respondWithFilteredResult(_0x59d667,_0x90ee5e){return function(_0x2d4bba){if(_0x2d4bba){var _0x49c4c3=typeof _0x90ee5e[_0xabe2('0x20')]===_0xabe2('0x21')&&typeof _0x90ee5e['limit']===_0xabe2('0x21');var _0x145a9d=_0x2d4bba['count'];var _0x55d89=_0x49c4c3?0x0:_0x90ee5e[_0xabe2('0x20')];var _0x2906f4=_0x49c4c3?_0x2d4bba['count']:_0x90ee5e[_0xabe2('0x20')]+_0x90ee5e[_0xabe2('0x22')];var _0x29a7b6;if(_0x2906f4>=_0x145a9d){_0x2906f4=_0x145a9d;_0x29a7b6=0xc8;}else{_0x29a7b6=0xce;}_0x59d667[_0xabe2('0x1e')](_0x29a7b6);return _0x59d667[_0xabe2('0x23')](_0xabe2('0x24'),_0x55d89+'-'+_0x2906f4+'/'+_0x145a9d)['json'](_0x2d4bba);}return null;};}function patchUpdates(_0x237a41){return function(_0x3472b4){try{jsonpatch['apply'](_0x3472b4,_0x237a41,!![]);}catch(_0x4ea837){return BPromise[_0xabe2('0x25')](_0x4ea837);}return _0x3472b4[_0xabe2('0x26')]();};}function saveUpdates(_0x1558a6,_0x91f296){return function(_0x5c83fb){if(_0x5c83fb){return _0x5c83fb[_0xabe2('0x27')](_0x1558a6)[_0xabe2('0x28')](function(_0x2c0c92){return _0x2c0c92;});}return null;};}function removeEntity(_0x49cd80,_0x3857cd){return function(_0x467365){if(_0x467365){return _0x467365['destroy']()[_0xabe2('0x28')](function(){_0x49cd80[_0xabe2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22a760,_0x519805){return function(_0x402c91){if(!_0x402c91){_0x22a760[_0xabe2('0x1d')](0x194);}return _0x402c91;};}function handleError(_0x20aee1,_0x8a5517){_0x8a5517=_0x8a5517||0x1f4;return function(_0x302919){logger[_0xabe2('0x29')](_0x302919[_0xabe2('0x2a')]);if(_0x302919['name']){delete _0x302919[_0xabe2('0x2b')];}_0x20aee1[_0xabe2('0x1e')](_0x8a5517)[_0xabe2('0x2c')](_0x302919);};}exports[_0xabe2('0x2d')]=function(_0x29ef25,_0x527a23){var _0x2824a2={'raw':![],'where':{'id':_0x29ef25[_0xabe2('0x2e')]['id']}},_0x20ee27={};_0x20ee27['model']=_[_0xabe2('0x2f')](db[_0xabe2('0x30')][_0xabe2('0x31')]);_0x20ee27[_0xabe2('0x32')]=_[_0xabe2('0x2f')](_0x29ef25[_0xabe2('0x32')]);_0x20ee27['filters']=_['intersection'](_0x20ee27['model'],_0x20ee27['query']);_0x2824a2[_0xabe2('0x33')]=_[_0xabe2('0x34')](_0x20ee27['model'],qs[_0xabe2('0x35')](_0x29ef25['query'][_0xabe2('0x35')]));_0x2824a2['attributes']=_0x2824a2['attributes'][_0xabe2('0x36')]?_0x2824a2[_0xabe2('0x33')]:_0x20ee27[_0xabe2('0x37')];if(_0x29ef25[_0xabe2('0x32')][_0xabe2('0x38')]){_0x2824a2[_0xabe2('0x39')]=[{'all':!![]}];}_0x2824a2=_['merge']({},_0x2824a2,_0x29ef25['options']);return db['DashboardItem'][_0xabe2('0x3a')](_0x2824a2)[_0xabe2('0x28')](handleEntityNotFound(_0x527a23,null))['then'](respondWithResult(_0x527a23,null))[_0xabe2('0x3b')](handleError(_0x527a23,null));};exports['destroy']=function(_0x510ca1,_0x438d68){return db['DashboardItem'][_0xabe2('0x3a')]({'where':{'id':_0x510ca1[_0xabe2('0x2e')]['id']}})[_0xabe2('0x28')](handleEntityNotFound(_0x438d68,null))[_0xabe2('0x28')](removeEntity(_0x438d68,null))[_0xabe2('0x3b')](handleError(_0x438d68,null));};function widgetAttributes(_0x170940){try{switch(_0x170940[_0xabe2('0x3c')]){case _0xabe2('0x3d'):return[{'name':'attrUrl','value':_0x170940['attrUrl']||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x0]?_0x170940['attrs'][0x0][_0xabe2('0x3f')]:undefined)||_0xabe2('0x40')}];case _0xabe2('0x41'):return[{'name':_0xabe2('0x42'),'value':_0x170940[_0xabe2('0x42')]||(_0x170940['attrs']&&_0x170940[_0xabe2('0x3e')][0x0]?_0x170940[_0xabe2('0x3e')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xabe2('0x43'),'value':_0x170940['attrHourFormat']||(_0x170940['attrs']&&_0x170940[_0xabe2('0x3e')][0x0]?_0x170940[_0xabe2('0x3e')][0x0][_0xabe2('0x3f')]:undefined)||_0xabe2('0x44')},{'name':_0xabe2('0x45'),'value':_0x170940['attrTimezone']||(_0x170940['attrs']&&_0x170940['attrs'][0x1]?_0x170940[_0xabe2('0x3e')][0x1]['value']:undefined)||_0xabe2('0x46')},{'name':'attrFontSize','value':_0x170940[_0xabe2('0x47')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940['attrs'][0x2]?_0x170940['attrs'][0x2][_0xabe2('0x3f')]:undefined)||0xc}];case _0xabe2('0x48'):return[{'name':_0xabe2('0x49'),'value':_0x170940[_0xabe2('0x49')]||(_0x170940['attrs']&&_0x170940[_0xabe2('0x3e')][0x0]?_0x170940[_0xabe2('0x3e')][0x0][_0xabe2('0x3f')]:undefined)||_0xabe2('0x4a')},{'name':'attrVoiceQueues','value':_0x170940[_0xabe2('0x4b')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x1]?_0x170940['attrs'][0x1][_0xabe2('0x3f')]:undefined)||[]},{'name':_0xabe2('0x47'),'value':_0x170940[_0xabe2('0x47')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x2]?_0x170940[_0xabe2('0x3e')][0x2]['value']:undefined)||0x14},{'name':_0xabe2('0x4c'),'value':_0x170940[_0xabe2('0x4c')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940['attrs'][0x3]?_0x170940['attrs'][0x3][_0xabe2('0x3f')]:undefined)||'voice'},{'name':_0xabe2('0x4d'),'value':_0x170940[_0xabe2('0x4d')]||(_0x170940['attrs']&&_0x170940['attrs'][0x4]?_0x170940[_0xabe2('0x3e')][0x4][_0xabe2('0x3f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x170940[_0xabe2('0x4e')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940['attrs'][0x5]?_0x170940['attrs'][0x5]['value']:undefined)||''},{'name':_0xabe2('0x4f'),'value':_0x170940[_0xabe2('0x4f')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940['attrs'][0x6]?_0x170940[_0xabe2('0x3e')][0x6][_0xabe2('0x3f')]:undefined)||''},{'name':_0xabe2('0x50'),'value':_0x170940[_0xabe2('0x50')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x7]?_0x170940[_0xabe2('0x3e')][0x7]['value']:undefined)||''},{'name':_0xabe2('0x51'),'value':_0x170940[_0xabe2('0x51')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940['attrs'][0x8]?_0x170940['attrs'][0x8][_0xabe2('0x3f')]:undefined)||''},{'name':_0xabe2('0x52'),'value':_0x170940[_0xabe2('0x52')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x9]?_0x170940[_0xabe2('0x3e')][0x9][_0xabe2('0x3f')]:undefined)||''}];case _0xabe2('0x53'):case _0xabe2('0x54'):return[{'name':_0xabe2('0x55'),'value':_0x170940[_0xabe2('0x55')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940['attrs'][0x0]?_0x170940[_0xabe2('0x3e')][0x0][_0xabe2('0x3f')]:undefined)||'total'},{'name':_0xabe2('0x56'),'value':_0x170940['attrSerie2']||(_0x170940['attrs']&&_0x170940['attrs'][0x1]?_0x170940[_0xabe2('0x3e')][0x1][_0xabe2('0x3f')]:undefined)||null},{'name':_0xabe2('0x57'),'value':_0x170940[_0xabe2('0x57')]||(_0x170940['attrs']&&_0x170940[_0xabe2('0x3e')][0x2]?_0x170940[_0xabe2('0x3e')][0x2][_0xabe2('0x3f')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x170940[_0xabe2('0x4b')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x3]?_0x170940[_0xabe2('0x3e')][0x3][_0xabe2('0x3f')]:undefined)||[]},{'name':_0xabe2('0x4c'),'value':_0x170940[_0xabe2('0x4c')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x4]?_0x170940[_0xabe2('0x3e')][0x4][_0xabe2('0x3f')]:undefined)||'voice'},{'name':_0xabe2('0x4d'),'value':_0x170940['attrEmailAccounts']||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x5]?_0x170940[_0xabe2('0x3e')][0x5][_0xabe2('0x3f')]:undefined)||''},{'name':_0xabe2('0x4e'),'value':_0x170940[_0xabe2('0x4e')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x6]?_0x170940['attrs'][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x170940[_0xabe2('0x4f')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940['attrs'][0x7]?_0x170940['attrs'][0x7][_0xabe2('0x3f')]:undefined)||''},{'name':_0xabe2('0x50'),'value':_0x170940[_0xabe2('0x50')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x8]?_0x170940['attrs'][0x8][_0xabe2('0x3f')]:undefined)||''},{'name':_0xabe2('0x51'),'value':_0x170940['attrWhatsappAccounts']||(_0x170940[_0xabe2('0x3e')]&&_0x170940['attrs'][0x9]?_0x170940[_0xabe2('0x3e')][0x9][_0xabe2('0x3f')]:undefined)||''},{'name':_0xabe2('0x52'),'value':_0x170940[_0xabe2('0x52')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0xa]?_0x170940[_0xabe2('0x3e')][0xa][_0xabe2('0x3f')]:undefined)||''}];case _0xabe2('0x58'):return[{'name':_0xabe2('0x59'),'type':_0x170940[_0xabe2('0x5a')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x0]?_0x170940['attrs'][0x0][_0xabe2('0x3c')]:undefined)||null,'value':_0x170940[_0xabe2('0x59')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x0]?_0x170940[_0xabe2('0x3e')][0x0][_0xabe2('0x3f')]:undefined)||null},{'name':_0xabe2('0x5b'),'value':_0x170940[_0xabe2('0x5b')]||(_0x170940[_0xabe2('0x3e')]&&_0x170940[_0xabe2('0x3e')][0x1]?_0x170940[_0xabe2('0x3e')][0x1][_0xabe2('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x4d91ee){logger[_0xabe2('0x29')]('widgetAttributes:\x20%s',JSON[_0xabe2('0x5c')](_0x4d91ee));return[];}}exports['create']=function(_0x59ea8c,_0x2770eb){if(_0x59ea8c[_0xabe2('0x5d')]){_0x59ea8c[_0xabe2('0x5d')]['attrs']=widgetAttributes(_0x59ea8c['body']);}return db['DashboardItem'][_0xabe2('0x5e')](_0x59ea8c[_0xabe2('0x5d')],{})[_0xabe2('0x28')](respondWithResult(_0x2770eb,0xc9))[_0xabe2('0x3b')](handleError(_0x2770eb,null));};exports[_0xabe2('0x27')]=function(_0x31ef5d,_0x50457b){if(_0x31ef5d[_0xabe2('0x5d')]['id']){delete _0x31ef5d[_0xabe2('0x5d')]['id'];}_0x31ef5d[_0xabe2('0x5d')][_0xabe2('0x3e')]=widgetAttributes(_0x31ef5d[_0xabe2('0x5d')]);return db['DashboardItem']['find']({'where':{'id':_0x31ef5d[_0xabe2('0x2e')]['id']}})[_0xabe2('0x28')](handleEntityNotFound(_0x50457b,null))['then'](saveUpdates(_0x31ef5d[_0xabe2('0x5d')],null))[_0xabe2('0x28')](respondWithResult(_0x50457b,null))[_0xabe2('0x3b')](handleError(_0x50457b,null));}; \ No newline at end of file +var _0xb7ae=['params','model','keys','DashboardItem','query','filters','attributes','intersection','fields','length','includeAll','merge','options','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','body','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','end','status','json','offset','undefined','count','apply','reject','save','update','then','sendStatus','error','stack','name','send','show'];(function(_0x1538f9,_0x4262fa){var _0x38f9d1=function(_0x2573eb){while(--_0x2573eb){_0x1538f9['push'](_0x1538f9['shift']());}};_0x38f9d1(++_0x4262fa);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x1cfce4,_0x66fa46){_0x1cfce4=_0x1cfce4-0x0;var _0x3a8345=_0xb7ae[_0x1cfce4];return _0x3a8345;};'use strict';var emlformat=require(_0xeb7a('0x0'));var rimraf=require(_0xeb7a('0x1'));var zipdir=require(_0xeb7a('0x2'));var jsonpatch=require(_0xeb7a('0x3'));var rp=require(_0xeb7a('0x4'));var moment=require('moment');var BPromise=require(_0xeb7a('0x5'));var Mustache=require(_0xeb7a('0x6'));var util=require(_0xeb7a('0x7'));var path=require('path');var sox=require(_0xeb7a('0x8'));var csv=require(_0xeb7a('0x9'));var ejs=require(_0xeb7a('0xa'));var fs=require('fs');var fs_extra=require(_0xeb7a('0xb'));var _=require(_0xeb7a('0xc'));var squel=require('squel');var crypto=require(_0xeb7a('0xd'));var jsforce=require(_0xeb7a('0xe'));var deskjs=require(_0xeb7a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb7a('0x10'));var Papa=require(_0xeb7a('0x11'));var Redis=require(_0xeb7a('0x12'));var authService=require(_0xeb7a('0x13'));var qs=require(_0xeb7a('0x14'));var as=require(_0xeb7a('0x15'));var hardwareService=require(_0xeb7a('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xeb7a('0x17'));var config=require(_0xeb7a('0x18'));var licenseUtil=require(_0xeb7a('0x19'));var db=require(_0xeb7a('0x1a'))['db'];config[_0xeb7a('0x1b')]=_[_0xeb7a('0x1c')](config[_0xeb7a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb7a('0x1d'))(new Redis(config[_0xeb7a('0x1b')]));require('./dashboardItem.socket')[_0xeb7a('0x1e')](socket);function respondWithStatusCode(_0x186ea3,_0x5f41f4){_0x5f41f4=_0x5f41f4||0xcc;return function(_0x2bf77e){if(_0x2bf77e){return _0x186ea3['sendStatus'](_0x5f41f4);}return _0x186ea3['status'](_0x5f41f4)[_0xeb7a('0x1f')]();};}function respondWithResult(_0x5e6256,_0x5782e6){_0x5782e6=_0x5782e6||0xc8;return function(_0x394208){if(_0x394208){return _0x5e6256[_0xeb7a('0x20')](_0x5782e6)[_0xeb7a('0x21')](_0x394208);}};}function respondWithFilteredResult(_0x2d92c7,_0x540b6c){return function(_0x4be13e){if(_0x4be13e){var _0x34ade5=typeof _0x540b6c[_0xeb7a('0x22')]==='undefined'&&typeof _0x540b6c['limit']===_0xeb7a('0x23');var _0x25a399=_0x4be13e[_0xeb7a('0x24')];var _0x268a17=_0x34ade5?0x0:_0x540b6c[_0xeb7a('0x22')];var _0x3025fc=_0x34ade5?_0x4be13e[_0xeb7a('0x24')]:_0x540b6c[_0xeb7a('0x22')]+_0x540b6c['limit'];var _0x431d4a;if(_0x3025fc>=_0x25a399){_0x3025fc=_0x25a399;_0x431d4a=0xc8;}else{_0x431d4a=0xce;}_0x2d92c7[_0xeb7a('0x20')](_0x431d4a);return _0x2d92c7['set']('Content-Range',_0x268a17+'-'+_0x3025fc+'/'+_0x25a399)[_0xeb7a('0x21')](_0x4be13e);}return null;};}function patchUpdates(_0x434aac){return function(_0x46a305){try{jsonpatch[_0xeb7a('0x25')](_0x46a305,_0x434aac,!![]);}catch(_0x29db91){return BPromise[_0xeb7a('0x26')](_0x29db91);}return _0x46a305[_0xeb7a('0x27')]();};}function saveUpdates(_0x4c4816,_0x1f0135){return function(_0xcf0f77){if(_0xcf0f77){return _0xcf0f77[_0xeb7a('0x28')](_0x4c4816)['then'](function(_0x10b7d3){return _0x10b7d3;});}return null;};}function removeEntity(_0x1cf8f6,_0x182335){return function(_0x9b80f5){if(_0x9b80f5){return _0x9b80f5['destroy']()[_0xeb7a('0x29')](function(){_0x1cf8f6['status'](0xcc)[_0xeb7a('0x1f')]();});}};}function handleEntityNotFound(_0x42698d,_0x4d24bc){return function(_0x189e2a){if(!_0x189e2a){_0x42698d[_0xeb7a('0x2a')](0x194);}return _0x189e2a;};}function handleError(_0x176577,_0x39738e){_0x39738e=_0x39738e||0x1f4;return function(_0x3917eb){logger[_0xeb7a('0x2b')](_0x3917eb[_0xeb7a('0x2c')]);if(_0x3917eb[_0xeb7a('0x2d')]){delete _0x3917eb['name'];}_0x176577[_0xeb7a('0x20')](_0x39738e)[_0xeb7a('0x2e')](_0x3917eb);};}exports[_0xeb7a('0x2f')]=function(_0x203993,_0x14e2e1){var _0x202d22={'raw':![],'where':{'id':_0x203993[_0xeb7a('0x30')]['id']}},_0x1662ee={};_0x1662ee[_0xeb7a('0x31')]=_[_0xeb7a('0x32')](db[_0xeb7a('0x33')]['rawAttributes']);_0x1662ee[_0xeb7a('0x34')]=_[_0xeb7a('0x32')](_0x203993[_0xeb7a('0x34')]);_0x1662ee[_0xeb7a('0x35')]=_['intersection'](_0x1662ee[_0xeb7a('0x31')],_0x1662ee[_0xeb7a('0x34')]);_0x202d22[_0xeb7a('0x36')]=_[_0xeb7a('0x37')](_0x1662ee[_0xeb7a('0x31')],qs[_0xeb7a('0x38')](_0x203993['query'][_0xeb7a('0x38')]));_0x202d22[_0xeb7a('0x36')]=_0x202d22[_0xeb7a('0x36')][_0xeb7a('0x39')]?_0x202d22[_0xeb7a('0x36')]:_0x1662ee[_0xeb7a('0x31')];if(_0x203993['query'][_0xeb7a('0x3a')]){_0x202d22['include']=[{'all':!![]}];}_0x202d22=_[_0xeb7a('0x3b')]({},_0x202d22,_0x203993[_0xeb7a('0x3c')]);return db['DashboardItem'][_0xeb7a('0x3d')](_0x202d22)[_0xeb7a('0x29')](handleEntityNotFound(_0x14e2e1,null))[_0xeb7a('0x29')](respondWithResult(_0x14e2e1,null))[_0xeb7a('0x3e')](handleError(_0x14e2e1,null));};exports[_0xeb7a('0x3f')]=function(_0x19bbf0,_0x2aaf7f){return db[_0xeb7a('0x33')]['find']({'where':{'id':_0x19bbf0[_0xeb7a('0x30')]['id']}})[_0xeb7a('0x29')](handleEntityNotFound(_0x2aaf7f,null))['then'](removeEntity(_0x2aaf7f,null))[_0xeb7a('0x3e')](handleError(_0x2aaf7f,null));};function widgetAttributes(_0x64dec){try{switch(_0x64dec[_0xeb7a('0x40')]){case _0xeb7a('0x41'):return[{'name':_0xeb7a('0x42'),'value':_0x64dec[_0xeb7a('0x42')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec['attrs'][0x0]?_0x64dec[_0xeb7a('0x43')][0x0][_0xeb7a('0x44')]:undefined)||_0xeb7a('0x45')}];case _0xeb7a('0x46'):return[{'name':_0xeb7a('0x47'),'value':_0x64dec[_0xeb7a('0x47')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x0]?_0x64dec[_0xeb7a('0x43')][0x0][_0xeb7a('0x44')]:undefined)||''}];case _0xeb7a('0x48'):return[{'name':_0xeb7a('0x49'),'value':_0x64dec['attrHourFormat']||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x0]?_0x64dec[_0xeb7a('0x43')][0x0][_0xeb7a('0x44')]:undefined)||'HH:mm:ss'},{'name':_0xeb7a('0x4a'),'value':_0x64dec[_0xeb7a('0x4a')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x1]?_0x64dec[_0xeb7a('0x43')][0x1][_0xeb7a('0x44')]:undefined)||'0.00'},{'name':_0xeb7a('0x4b'),'value':_0x64dec[_0xeb7a('0x4b')]||(_0x64dec['attrs']&&_0x64dec[_0xeb7a('0x43')][0x2]?_0x64dec['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xeb7a('0x4c'),'value':_0x64dec[_0xeb7a('0x4c')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x0]?_0x64dec[_0xeb7a('0x43')][0x0][_0xeb7a('0x44')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x64dec[_0xeb7a('0x4d')]||(_0x64dec['attrs']&&_0x64dec[_0xeb7a('0x43')][0x1]?_0x64dec[_0xeb7a('0x43')][0x1][_0xeb7a('0x44')]:undefined)||[]},{'name':_0xeb7a('0x4b'),'value':_0x64dec['attrFontSize']||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x2]?_0x64dec[_0xeb7a('0x43')][0x2][_0xeb7a('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x64dec[_0xeb7a('0x4e')]||(_0x64dec['attrs']&&_0x64dec[_0xeb7a('0x43')][0x3]?_0x64dec[_0xeb7a('0x43')][0x3][_0xeb7a('0x44')]:undefined)||_0xeb7a('0x4f')},{'name':_0xeb7a('0x50'),'value':_0x64dec[_0xeb7a('0x50')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec['attrs'][0x4]?_0x64dec['attrs'][0x4][_0xeb7a('0x44')]:undefined)||''},{'name':_0xeb7a('0x51'),'value':_0x64dec[_0xeb7a('0x51')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x5]?_0x64dec['attrs'][0x5]['value']:undefined)||''},{'name':_0xeb7a('0x52'),'value':_0x64dec['attrSmsAccounts']||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x6]?_0x64dec[_0xeb7a('0x43')][0x6][_0xeb7a('0x44')]:undefined)||''},{'name':_0xeb7a('0x53'),'value':_0x64dec[_0xeb7a('0x53')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x7]?_0x64dec[_0xeb7a('0x43')][0x7][_0xeb7a('0x44')]:undefined)||''},{'name':_0xeb7a('0x54'),'value':_0x64dec[_0xeb7a('0x54')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x8]?_0x64dec['attrs'][0x8][_0xeb7a('0x44')]:undefined)||''},{'name':_0xeb7a('0x55'),'value':_0x64dec[_0xeb7a('0x55')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x9]?_0x64dec[_0xeb7a('0x43')][0x9][_0xeb7a('0x44')]:undefined)||''}];case _0xeb7a('0x56'):case _0xeb7a('0x57'):return[{'name':_0xeb7a('0x58'),'value':_0x64dec[_0xeb7a('0x58')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x0]?_0x64dec[_0xeb7a('0x43')][0x0][_0xeb7a('0x44')]:undefined)||_0xeb7a('0x59')},{'name':_0xeb7a('0x5a'),'value':_0x64dec[_0xeb7a('0x5a')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x1]?_0x64dec[_0xeb7a('0x43')][0x1][_0xeb7a('0x44')]:undefined)||null},{'name':_0xeb7a('0x5b'),'value':_0x64dec['attrSerie3']||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec['attrs'][0x2]?_0x64dec[_0xeb7a('0x43')][0x2]['value']:undefined)||null},{'name':_0xeb7a('0x4d'),'value':_0x64dec[_0xeb7a('0x4d')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x3]?_0x64dec[_0xeb7a('0x43')][0x3][_0xeb7a('0x44')]:undefined)||[]},{'name':'attrChannel','value':_0x64dec[_0xeb7a('0x4e')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x4]?_0x64dec[_0xeb7a('0x43')][0x4]['value']:undefined)||_0xeb7a('0x4f')},{'name':_0xeb7a('0x50'),'value':_0x64dec[_0xeb7a('0x50')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x5]?_0x64dec[_0xeb7a('0x43')][0x5][_0xeb7a('0x44')]:undefined)||''},{'name':_0xeb7a('0x51'),'value':_0x64dec[_0xeb7a('0x51')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x6]?_0x64dec[_0xeb7a('0x43')][0x6][_0xeb7a('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x64dec[_0xeb7a('0x52')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x7]?_0x64dec[_0xeb7a('0x43')][0x7]['value']:undefined)||''},{'name':_0xeb7a('0x53'),'value':_0x64dec[_0xeb7a('0x53')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x8]?_0x64dec[_0xeb7a('0x43')][0x8][_0xeb7a('0x44')]:undefined)||''},{'name':_0xeb7a('0x54'),'value':_0x64dec[_0xeb7a('0x54')]||(_0x64dec['attrs']&&_0x64dec[_0xeb7a('0x43')][0x9]?_0x64dec[_0xeb7a('0x43')][0x9][_0xeb7a('0x44')]:undefined)||''},{'name':_0xeb7a('0x55'),'value':_0x64dec['attrChatWebsites']||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0xa]?_0x64dec[_0xeb7a('0x43')][0xa][_0xeb7a('0x44')]:undefined)||''}];case'web-report':return[{'name':_0xeb7a('0x5c'),'type':_0x64dec['reportType']||(_0x64dec['attrs']&&_0x64dec[_0xeb7a('0x43')][0x0]?_0x64dec[_0xeb7a('0x43')][0x0][_0xeb7a('0x40')]:undefined)||null,'value':_0x64dec[_0xeb7a('0x5c')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x0]?_0x64dec[_0xeb7a('0x43')][0x0][_0xeb7a('0x44')]:undefined)||null},{'name':_0xeb7a('0x5d'),'value':_0x64dec[_0xeb7a('0x5d')]||(_0x64dec[_0xeb7a('0x43')]&&_0x64dec[_0xeb7a('0x43')][0x1]?_0x64dec['attrs'][0x1][_0xeb7a('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x88d5fc){logger['error'](_0xeb7a('0x5e'),JSON['stringify'](_0x88d5fc));return[];}}exports['create']=function(_0x167322,_0x265d19){if(_0x167322[_0xeb7a('0x5f')]){_0x167322[_0xeb7a('0x5f')][_0xeb7a('0x43')]=widgetAttributes(_0x167322['body']);}return db['DashboardItem'][_0xeb7a('0x60')](_0x167322[_0xeb7a('0x5f')],{})[_0xeb7a('0x29')](respondWithResult(_0x265d19,0xc9))[_0xeb7a('0x3e')](handleError(_0x265d19,null));};exports[_0xeb7a('0x28')]=function(_0xb50b1e,_0x57918e){if(_0xb50b1e['body']['id']){delete _0xb50b1e[_0xeb7a('0x5f')]['id'];}_0xb50b1e[_0xeb7a('0x5f')][_0xeb7a('0x43')]=widgetAttributes(_0xb50b1e[_0xeb7a('0x5f')]);return db['DashboardItem'][_0xeb7a('0x3d')]({'where':{'id':_0xb50b1e[_0xeb7a('0x30')]['id']}})['then'](handleEntityNotFound(_0x57918e,null))['then'](saveUpdates(_0xb50b1e['body'],null))['then'](respondWithResult(_0x57918e,null))[_0xeb7a('0x3e')](handleError(_0x57918e,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a469639..523b6ad 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 _0x6636=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x62ec9e,_0x21c9a6){var _0x480322=function(_0x28c0d8){while(--_0x28c0d8){_0x62ec9e['push'](_0x62ec9e['shift']());}};_0x480322(++_0x21c9a6);}(_0x6636,0x119));var _0x6663=function(_0x34aa9c,_0x2e3071){_0x34aa9c=_0x34aa9c-0x0;var _0x5c12fa=_0x6636[_0x34aa9c];return _0x5c12fa;};'use strict';var EventEmitter=require(_0x6663('0x0'));var DashboardItem=require(_0x6663('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x6663('0x2')](0x0);var events={'afterCreate':_0x6663('0x3'),'afterUpdate':_0x6663('0x4'),'afterDestroy':_0x6663('0x5')};function emitEvent(_0x3b27e6){return function(_0x26173b,_0x24de71,_0x39f6ff){DashboardItemEvents[_0x6663('0x6')](_0x3b27e6+':'+_0x26173b['id'],_0x26173b);DashboardItemEvents[_0x6663('0x6')](_0x3b27e6,_0x26173b);_0x39f6ff(null);};}for(var e in events){if(events[_0x6663('0x7')](e)){var event=events[e];DashboardItem[_0x6663('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x8970=['remove','emit','hasOwnProperty','../../mysqldb','DashboardItem','setMaxListeners','save','update'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0x8970,0xb3));var _0x0897=function(_0x317098,_0x971731){_0x317098=_0x317098-0x0;var _0x4c834c=_0x8970[_0x317098];return _0x4c834c;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x0897('0x0'))['db'][_0x0897('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0897('0x2')](0x0);var events={'afterCreate':_0x0897('0x3'),'afterUpdate':_0x0897('0x4'),'afterDestroy':_0x0897('0x5')};function emitEvent(_0x156fca){return function(_0x4f051e,_0x334bd4,_0xb82f85){DashboardItemEvents['emit'](_0x156fca+':'+_0x4f051e['id'],_0x4f051e);DashboardItemEvents[_0x0897('0x6')](_0x156fca,_0x4f051e);_0xb82f85(null);};}for(var e in events){if(events[_0x0897('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index aa58a96..e931a90 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 _0x96c0=['DashboardItem','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x5e536f,_0x25f933){var _0x57b4cb=function(_0x7a9b51){while(--_0x7a9b51){_0x5e536f['push'](_0x5e536f['shift']());}};_0x57b4cb(++_0x25f933);}(_0x96c0,0xdd));var _0x096c=function(_0x24602f,_0xce5df6){_0x24602f=_0x24602f-0x0;var _0x3a16bc=_0x96c0[_0x24602f];return _0x3a16bc;};'use strict';var _=require(_0x096c('0x0'));var util=require(_0x096c('0x1'));var logger=require(_0x096c('0x2'))(_0x096c('0x3'));var moment=require(_0x096c('0x4'));var BPromise=require('bluebird');var rp=require(_0x096c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x096c('0x6'));var attributes=require(_0x096c('0x7'));module[_0x096c('0x8')]=function(_0x247358,_0x9770){return _0x247358['define'](_0x096c('0x9'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7ee=['dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0x16bfae,_0x36ed25){var _0x3870f5=function(_0x5ae24a){while(--_0x5ae24a){_0x16bfae['push'](_0x16bfae['shift']());}};_0x3870f5(++_0x36ed25);}(_0xa7ee,0x119));var _0xea7e=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0xa7ee[_0x57486e];return _0x5f110b;};'use strict';var _=require(_0xea7e('0x0'));var util=require(_0xea7e('0x1'));var logger=require(_0xea7e('0x2'))(_0xea7e('0x3'));var moment=require(_0xea7e('0x4'));var BPromise=require(_0xea7e('0x5'));var rp=require(_0xea7e('0x6'));var fs=require('fs');var path=require(_0xea7e('0x7'));var rimraf=require(_0xea7e('0x8'));var config=require(_0xea7e('0x9'));var attributes=require(_0xea7e('0xa'));module[_0xea7e('0xb')]=function(_0xc6b99d,_0x3d9e5e){return _0xc6b99d[_0xea7e('0xc')]('DashboardItem',attributes,{'tableName':_0xea7e('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 9eb1b96..f287853 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 _0x17eb=['redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x17eb,0xdd));var _0xb17e=function(_0x7c0ca,_0x3ed137){_0x7c0ca=_0x7c0ca-0x0;var _0x2052c5=_0x17eb[_0x7c0ca];return _0x2052c5;};'use strict';var _=require(_0xb17e('0x0'));var util=require(_0xb17e('0x1'));var moment=require('moment');var BPromise=require(_0xb17e('0x2'));var rs=require(_0xb17e('0x3'));var fs=require('fs');var Redis=require(_0xb17e('0x4'));var db=require(_0xb17e('0x5'))['db'];var utils=require(_0xb17e('0x6'));var logger=require(_0xb17e('0x7'))(_0xb17e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb17e('0x9')][_0xb17e('0xa')]({'port':0x232a});config[_0xb17e('0xb')]=_[_0xb17e('0xc')](config[_0xb17e('0xb')],{'host':_0xb17e('0xd'),'port':0x18eb});var socket=require(_0xb17e('0xe'))(new Redis(config[_0xb17e('0xb')]));require(_0xb17e('0xf'))[_0xb17e('0x10')](socket);function respondWithRpcPromise(_0x1cddac,_0x9f2dd2,_0x2c2df4){return new BPromise(function(_0x39e7d6,_0x11f82f){return client[_0xb17e('0x11')](_0x1cddac,_0x2c2df4)[_0xb17e('0x12')](function(_0x153790){logger[_0xb17e('0x13')](_0xb17e('0x14'),_0x9f2dd2,_0xb17e('0x15'));logger[_0xb17e('0x16')](_0xb17e('0x17'),_0x9f2dd2,'request\x20sent',JSON[_0xb17e('0x18')](_0x153790));if(_0x153790['error']){if(_0x153790['error']['code']===0x1f4){logger[_0xb17e('0x19')](_0xb17e('0x14'),_0x9f2dd2,_0x153790[_0xb17e('0x19')]['message']);return _0x11f82f(_0x153790[_0xb17e('0x19')]['message']);}logger[_0xb17e('0x19')](_0xb17e('0x14'),_0x9f2dd2,_0x153790[_0xb17e('0x19')][_0xb17e('0x1a')]);return _0x39e7d6(_0x153790[_0xb17e('0x19')]['message']);}else{logger[_0xb17e('0x13')](_0xb17e('0x14'),_0x9f2dd2,'request\x20sent');_0x39e7d6(_0x153790[_0xb17e('0x1b')][_0xb17e('0x1a')]);}})[_0xb17e('0x1c')](function(_0x5d5492){logger[_0xb17e('0x19')](_0xb17e('0x14'),_0x9f2dd2,_0x5d5492);_0x11f82f(_0x5d5492);});});} \ No newline at end of file +var _0x529a=['DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x529a,0x170));var _0xa529=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x529a[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xa529('0x0'));var util=require(_0xa529('0x1'));var moment=require(_0xa529('0x2'));var BPromise=require(_0xa529('0x3'));var rs=require(_0xa529('0x4'));var fs=require('fs');var Redis=require(_0xa529('0x5'));var db=require(_0xa529('0x6'))['db'];var utils=require(_0xa529('0x7'));var logger=require(_0xa529('0x8'))(_0xa529('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa529('0xa')]({'port':0x232a});config[_0xa529('0xb')]=_['defaults'](config[_0xa529('0xb')],{'host':_0xa529('0xc'),'port':0x18eb});var socket=require(_0xa529('0xd'))(new Redis(config[_0xa529('0xb')]));require(_0xa529('0xe'))[_0xa529('0xf')](socket);function respondWithRpcPromise(_0x448920,_0x4f3bd8,_0x2cfc7b){return new BPromise(function(_0x1687da,_0x3c5516){return client[_0xa529('0x10')](_0x448920,_0x2cfc7b)[_0xa529('0x11')](function(_0x643fdf){logger[_0xa529('0x12')]('DashboardItem,\x20%s,\x20%s',_0x4f3bd8,_0xa529('0x13'));logger[_0xa529('0x14')](_0xa529('0x15'),_0x4f3bd8,_0xa529('0x13'),JSON[_0xa529('0x16')](_0x643fdf));if(_0x643fdf['error']){if(_0x643fdf[_0xa529('0x17')]['code']===0x1f4){logger[_0xa529('0x17')](_0xa529('0x18'),_0x4f3bd8,_0x643fdf['error'][_0xa529('0x19')]);return _0x3c5516(_0x643fdf[_0xa529('0x17')]['message']);}logger[_0xa529('0x17')](_0xa529('0x18'),_0x4f3bd8,_0x643fdf['error']['message']);return _0x1687da(_0x643fdf[_0xa529('0x17')][_0xa529('0x19')]);}else{logger[_0xa529('0x12')](_0xa529('0x18'),_0x4f3bd8,_0xa529('0x13'));_0x1687da(_0x643fdf[_0xa529('0x1a')][_0xa529('0x19')]);}})[_0xa529('0x1b')](function(_0x5f52c7){logger[_0xa529('0x17')](_0xa529('0x18'),_0x4f3bd8,_0x5f52c7);_0x3c5516(_0x5f52c7);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 7918d17..78c7b45 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 _0x46a5=['update','emit','removeListener','register','length','./dashboardItem.events','save'];(function(_0x4ba102,_0x3dc213){var _0x1f35e7=function(_0xceae5a){while(--_0xceae5a){_0x4ba102['push'](_0x4ba102['shift']());}};_0x1f35e7(++_0x3dc213);}(_0x46a5,0x171));var _0x546a=function(_0x328991,_0x2e4053){_0x328991=_0x328991-0x0;var _0x3f824f=_0x46a5[_0x328991];return _0x3f824f;};'use strict';var DashboardItemEvents=require(_0x546a('0x0'));var events=[_0x546a('0x1'),'remove',_0x546a('0x2')];function createListener(_0x33ffe4,_0x44b9d5){return function(_0xa0fd98){_0x44b9d5[_0x546a('0x3')](_0x33ffe4,_0xa0fd98);};}function removeListener(_0x36a2a6,_0x26a006){return function(){DashboardItemEvents[_0x546a('0x4')](_0x36a2a6,_0x26a006);};}exports[_0x546a('0x5')]=function(_0x4642eb){for(var _0x1b4ad4=0x0,_0x552175=events[_0x546a('0x6')];_0x1b4ad4<_0x552175;_0x1b4ad4++){var _0x4de63b=events[_0x1b4ad4];var _0x218f43=createListener('dashboardItem:'+_0x4de63b,_0x4642eb);DashboardItemEvents['on'](_0x4de63b,_0x218f43);}}; \ No newline at end of file +var _0xef91=['remove','update','emit','removeListener','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x400322,_0x4353a8){var _0xfdd597=function(_0xd914b6){while(--_0xd914b6){_0x400322['push'](_0x400322['shift']());}};_0xfdd597(++_0x4353a8);}(_0xef91,0x1b6));var _0x1ef9=function(_0x208de5,_0x184158){_0x208de5=_0x208de5-0x0;var _0x527b0f=_0xef91[_0x208de5];return _0x527b0f;};'use strict';var DashboardItemEvents=require(_0x1ef9('0x0'));var events=[_0x1ef9('0x1'),_0x1ef9('0x2'),_0x1ef9('0x3')];function createListener(_0x4873f8,_0x5b3813){return function(_0x3db948){_0x5b3813[_0x1ef9('0x4')](_0x4873f8,_0x3db948);};}function removeListener(_0x4c0b4a,_0x2c3e82){return function(){DashboardItemEvents[_0x1ef9('0x5')](_0x4c0b4a,_0x2c3e82);};}exports['register']=function(_0x4d49a1){for(var _0x41919b=0x0,_0x55eb56=events[_0x1ef9('0x6')];_0x41919b<_0x55eb56;_0x41919b++){var _0x2d99ce=events[_0x41919b];var _0x24655f=createListener(_0x1ef9('0x7')+_0x2d99ce,_0x4d49a1);DashboardItemEvents['on'](_0x2d99ce,_0x24655f);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index ddf3736..16d2410 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 _0x6953=['fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','isAuthenticated','show','post','create','put','/:id','destroy','exports','util','path','express'];(function(_0x1664de,_0x7de777){var _0x411f8f=function(_0x38333f){while(--_0x38333f){_0x1664de['push'](_0x1664de['shift']());}};_0x411f8f(++_0x7de777);}(_0x6953,0x1bf));var _0x3695=function(_0x3389ac,_0x4999b3){_0x3389ac=_0x3389ac-0x0;var _0x4961a9=_0x6953[_0x3389ac];return _0x4961a9;};'use strict';var multer=require('multer');var util=require(_0x3695('0x0'));var path=require(_0x3695('0x1'));var timeout=require('connect-timeout');var express=require(_0x3695('0x2'));var router=express['Router']();var fs_extra=require(_0x3695('0x3'));var auth=require(_0x3695('0x4'));var interaction=require(_0x3695('0x5'));var config=require('../../config/environment');var controller=require(_0x3695('0x6'));router['get']('/:id',auth[_0x3695('0x7')](),controller[_0x3695('0x8')]);router[_0x3695('0x9')]('/',auth[_0x3695('0x7')](),controller[_0x3695('0xa')]);router[_0x3695('0xb')]('/:id',auth[_0x3695('0x7')](),controller['update']);router['delete'](_0x3695('0xc'),auth['isAuthenticated'](),controller[_0x3695('0xd')]);module[_0x3695('0xe')]=router; \ No newline at end of file +var _0x0e12=['../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','exports','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0x3f67da,_0x4a7758){var _0x150668=function(_0xf4b79b){while(--_0xf4b79b){_0x3f67da['push'](_0x3f67da['shift']());}};_0x150668(++_0x4a7758);}(_0x0e12,0xfb));var _0x20e1=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x0e12[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x20e1('0x0'));var util=require('util');var path=require(_0x20e1('0x1'));var timeout=require(_0x20e1('0x2'));var express=require(_0x20e1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x20e1('0x4'));var config=require(_0x20e1('0x5'));var controller=require(_0x20e1('0x6'));router[_0x20e1('0x7')](_0x20e1('0x8'),auth[_0x20e1('0x9')](),controller[_0x20e1('0xa')]);router[_0x20e1('0xb')]('/',auth[_0x20e1('0x9')](),controller[_0x20e1('0xc')]);router[_0x20e1('0xd')](_0x20e1('0x8'),auth['isAuthenticated'](),controller[_0x20e1('0xe')]);router['delete'](_0x20e1('0x8'),auth[_0x20e1('0x9')](),controller['destroy']);module[_0x20e1('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 8fd2920..6357dba 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 _0x37ea=['third','exports','STRING','first','second'];(function(_0x3513ed,_0x1a671e){var _0x4a70aa=function(_0x28879e){while(--_0x28879e){_0x3513ed['push'](_0x3513ed['shift']());}};_0x4a70aa(++_0x1a671e);}(_0x37ea,0xc9));var _0xa37e=function(_0x1ad392,_0x28c4c6){_0x1ad392=_0x1ad392-0x0;var _0x198517=_0x37ea[_0x1ad392];return _0x198517;};'use strict';var Sequelize=require('sequelize');module[_0xa37e('0x0')]={'name':{'type':Sequelize[_0xa37e('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xa37e('0x2'),_0xa37e('0x3'),_0xa37e('0x4')),'allowNull':![],'defaultValue':_0xa37e('0x2')},'description':{'type':Sequelize[_0xa37e('0x1')]}}; \ No newline at end of file +var _0xb8d1=['first','second','STRING','ENUM'];(function(_0x2bd97c,_0x9597af){var _0x56042d=function(_0x49598a){while(--_0x49598a){_0x2bd97c['push'](_0x2bd97c['shift']());}};_0x56042d(++_0x9597af);}(_0xb8d1,0xd2));var _0x1b8d=function(_0x4cb272,_0x52c0e9){_0x4cb272=_0x4cb272-0x0;var _0x57b4aa=_0xb8d1[_0x4cb272];return _0x57b4aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1b8d('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x1b8d('0x1')](_0x1b8d('0x2'),_0x1b8d('0x3'),'third'),'allowNull':![],'defaultValue':_0x1b8d('0x2')},'description':{'type':Sequelize[_0x1b8d('0x0')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 3e65a94..b2bc04c 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 _0x7952=['../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','Disposition','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x7ba4c8,_0x173d7a){var _0x54c9bd=function(_0x3f3565){while(--_0x3f3565){_0x7ba4c8['push'](_0x7ba4c8['shift']());}};_0x54c9bd(++_0x173d7a);}(_0x7952,0xec));var _0x2795=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0x7952[_0x55e1d1];return _0x1165db;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2795('0x0'));var jsonpatch=require(_0x2795('0x1'));var rp=require(_0x2795('0x2'));var moment=require(_0x2795('0x3'));var BPromise=require(_0x2795('0x4'));var Mustache=require(_0x2795('0x5'));var util=require(_0x2795('0x6'));var path=require(_0x2795('0x7'));var sox=require(_0x2795('0x8'));var csv=require(_0x2795('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2795('0xa'));var _=require('lodash');var squel=require(_0x2795('0xb'));var crypto=require(_0x2795('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2795('0xd'));var toCsv=require(_0x2795('0x9'));var querystring=require('querystring');var Papa=require(_0x2795('0xe'));var Redis=require(_0x2795('0xf'));var authService=require(_0x2795('0x10'));var qs=require(_0x2795('0x11'));var as=require(_0x2795('0x12'));var hardwareService=require(_0x2795('0x13'));var logger=require(_0x2795('0x14'))(_0x2795('0x15'));var utils=require(_0x2795('0x16'));var config=require(_0x2795('0x17'));var licenseUtil=require(_0x2795('0x18'));var db=require(_0x2795('0x19'))['db'];function respondWithStatusCode(_0x5cee6b,_0x27c660){_0x27c660=_0x27c660||0xcc;return function(_0x2dd0df){if(_0x2dd0df){return _0x5cee6b[_0x2795('0x1a')](_0x27c660);}return _0x5cee6b['status'](_0x27c660)['end']();};}function respondWithResult(_0x410c09,_0x33cadc){_0x33cadc=_0x33cadc||0xc8;return function(_0x6714db){if(_0x6714db){return _0x410c09[_0x2795('0x1b')](_0x33cadc)['json'](_0x6714db);}};}function respondWithFilteredResult(_0x220a6a,_0x2cf469){return function(_0x873c18){if(_0x873c18){var _0x176492=typeof _0x2cf469[_0x2795('0x1c')]===_0x2795('0x1d')&&typeof _0x2cf469[_0x2795('0x1e')]===_0x2795('0x1d');var _0x2dc652=_0x873c18[_0x2795('0x1f')];var _0x411710=_0x176492?0x0:_0x2cf469['offset'];var _0x82c2d6=_0x176492?_0x873c18[_0x2795('0x1f')]:_0x2cf469['offset']+_0x2cf469['limit'];var _0x8fd64e;if(_0x82c2d6>=_0x2dc652){_0x82c2d6=_0x2dc652;_0x8fd64e=0xc8;}else{_0x8fd64e=0xce;}_0x220a6a[_0x2795('0x1b')](_0x8fd64e);return _0x220a6a['set'](_0x2795('0x20'),_0x411710+'-'+_0x82c2d6+'/'+_0x2dc652)[_0x2795('0x21')](_0x873c18);}return null;};}function patchUpdates(_0x28bca1){return function(_0xcc9ef1){try{jsonpatch[_0x2795('0x22')](_0xcc9ef1,_0x28bca1,!![]);}catch(_0x59d44d){return BPromise[_0x2795('0x23')](_0x59d44d);}return _0xcc9ef1[_0x2795('0x24')]();};}function saveUpdates(_0x55988b,_0x47fc5c){return function(_0x42b40f){if(_0x42b40f){return _0x42b40f[_0x2795('0x25')](_0x55988b)[_0x2795('0x26')](function(_0x354161){return _0x354161;});}return null;};}function removeEntity(_0x59ed7e,_0x6bf071){return function(_0x58e774){if(_0x58e774){return _0x58e774[_0x2795('0x27')]()['then'](function(){var _0xe923fb=_0x58e774[_0x2795('0x28')]({'plain':!![]});var _0x5785e4=_0x2795('0x29');return db[_0x2795('0x2a')][_0x2795('0x27')]({'where':{'type':_0x5785e4,'resourceId':_0xe923fb['id']}})[_0x2795('0x26')](function(){return _0x58e774;});})[_0x2795('0x26')](function(){_0x59ed7e[_0x2795('0x1b')](0xcc)[_0x2795('0x2b')]();});}};}function handleEntityNotFound(_0x2e0720,_0x19b5d9){return function(_0x3ac1f2){if(!_0x3ac1f2){_0x2e0720['sendStatus'](0x194);}return _0x3ac1f2;};}function handleError(_0x5d75de,_0x19ef0a){_0x19ef0a=_0x19ef0a||0x1f4;return function(_0x18d416){logger[_0x2795('0x2c')](_0x18d416[_0x2795('0x2d')]);if(_0x18d416[_0x2795('0x2e')]){delete _0x18d416[_0x2795('0x2e')];}_0x5d75de[_0x2795('0x1b')](_0x19ef0a)[_0x2795('0x2f')](_0x18d416);};}exports['index']=function(_0x469cdf,_0x1a08dd){var _0x3c010d={},_0x1ec76f={},_0xa5ba1={'count':0x0,'rows':[]};var _0xc398b4=_[_0x2795('0x30')](db['Disposition'][_0x2795('0x31')],function(_0x261ce6){return{'name':_0x261ce6[_0x2795('0x32')],'type':_0x261ce6['type'][_0x2795('0x33')]};});_0x1ec76f[_0x2795('0x34')]=_['map'](_0xc398b4,_0x2795('0x2e'));_0x1ec76f[_0x2795('0x35')]=_[_0x2795('0x36')](_0x469cdf[_0x2795('0x35')]);_0x1ec76f['filters']=_[_0x2795('0x37')](_0x1ec76f[_0x2795('0x34')],_0x1ec76f[_0x2795('0x35')]);_0x3c010d[_0x2795('0x38')]=_['intersection'](_0x1ec76f['model'],qs[_0x2795('0x39')](_0x469cdf[_0x2795('0x35')][_0x2795('0x39')]));_0x3c010d[_0x2795('0x38')]=_0x3c010d[_0x2795('0x38')]['length']?_0x3c010d['attributes']:_0x1ec76f['model'];if(!_0x469cdf['query'][_0x2795('0x3a')](_0x2795('0x3b'))){_0x3c010d['limit']=qs[_0x2795('0x1e')](_0x469cdf['query']['limit']);_0x3c010d['offset']=qs[_0x2795('0x1c')](_0x469cdf['query'][_0x2795('0x1c')]);}_0x3c010d[_0x2795('0x3c')]=qs[_0x2795('0x3d')](_0x469cdf['query'][_0x2795('0x3d')]);_0x3c010d['where']=qs[_0x2795('0x3e')](_[_0x2795('0x3f')](_0x469cdf[_0x2795('0x35')],_0x1ec76f[_0x2795('0x3e')]),_0xc398b4);if(_0x469cdf['query'][_0x2795('0x40')]){_0x3c010d[_0x2795('0x41')]=_[_0x2795('0x42')](_0x3c010d[_0x2795('0x41')],{'$or':_[_0x2795('0x30')](_0xc398b4,function(_0x130b1d){if(_0x130b1d[_0x2795('0x43')]!==_0x2795('0x44')){var _0xcc6a7a={};_0xcc6a7a[_0x130b1d['name']]={'$like':'%'+_0x469cdf['query']['filter']+'%'};return _0xcc6a7a;}})});}_0x3c010d=_[_0x2795('0x42')]({},_0x3c010d,_0x469cdf[_0x2795('0x45')]);var _0x1d3be5={'where':_0x3c010d[_0x2795('0x41')]};return db[_0x2795('0x46')]['count'](_0x1d3be5)[_0x2795('0x26')](function(_0x4c8e9f){_0xa5ba1[_0x2795('0x1f')]=_0x4c8e9f;if(_0x469cdf[_0x2795('0x35')][_0x2795('0x47')]){_0x3c010d[_0x2795('0x48')]=[{'all':!![]}];}return db[_0x2795('0x46')][_0x2795('0x49')](_0x3c010d);})[_0x2795('0x26')](function(_0xc1662e){_0xa5ba1['rows']=_0xc1662e;return _0xa5ba1;})['then'](respondWithFilteredResult(_0x1a08dd,_0x3c010d))[_0x2795('0x4a')](handleError(_0x1a08dd,null));};exports[_0x2795('0x4b')]=function(_0x3a1353,_0x58d939){var _0x2ce4a0={'raw':!![],'where':{'id':_0x3a1353[_0x2795('0x4c')]['id']}},_0x4614c3={};_0x4614c3[_0x2795('0x34')]=_[_0x2795('0x36')](db[_0x2795('0x46')][_0x2795('0x31')]);_0x4614c3[_0x2795('0x35')]=_[_0x2795('0x36')](_0x3a1353['query']);_0x4614c3['filters']=_[_0x2795('0x37')](_0x4614c3[_0x2795('0x34')],_0x4614c3[_0x2795('0x35')]);_0x2ce4a0[_0x2795('0x38')]=_['intersection'](_0x4614c3[_0x2795('0x34')],qs[_0x2795('0x39')](_0x3a1353[_0x2795('0x35')][_0x2795('0x39')]));_0x2ce4a0[_0x2795('0x38')]=_0x2ce4a0[_0x2795('0x38')]['length']?_0x2ce4a0[_0x2795('0x38')]:_0x4614c3[_0x2795('0x34')];if(_0x3a1353[_0x2795('0x35')][_0x2795('0x47')]){_0x2ce4a0[_0x2795('0x48')]=[{'all':!![]}];}_0x2ce4a0=_[_0x2795('0x42')]({},_0x2ce4a0,_0x3a1353[_0x2795('0x45')]);return db[_0x2795('0x46')][_0x2795('0x4d')](_0x2ce4a0)[_0x2795('0x26')](handleEntityNotFound(_0x58d939,null))[_0x2795('0x26')](respondWithResult(_0x58d939,null))[_0x2795('0x4a')](handleError(_0x58d939,null));};exports['create']=function(_0x3e5c6,_0x330e62){return db['Disposition'][_0x2795('0x4e')](_0x3e5c6[_0x2795('0x4f')],{})[_0x2795('0x26')](function(_0x24ae1a){var _0x20cbb4=_0x3e5c6[_0x2795('0x50')][_0x2795('0x28')]({'plain':!![]});if(!_0x20cbb4)throw new Error(_0x2795('0x51'));if(_0x20cbb4[_0x2795('0x52')]===_0x2795('0x50')){var _0x5d76d5=_0x24ae1a[_0x2795('0x28')]({'plain':!![]});var _0x101fac=_0x2795('0x29');return db[_0x2795('0x53')]['find']({'where':{'name':_0x101fac,'userProfileId':_0x20cbb4[_0x2795('0x54')]},'raw':!![]})[_0x2795('0x26')](function(_0x27e9e8){if(_0x27e9e8&&_0x27e9e8[_0x2795('0x55')]===0x0){return db[_0x2795('0x2a')]['create']({'name':_0x5d76d5[_0x2795('0x2e')],'resourceId':_0x5d76d5['id'],'type':_0x27e9e8[_0x2795('0x2e')],'sectionId':_0x27e9e8['id']},{})['then'](function(){return _0x24ae1a;});}else{return _0x24ae1a;}})[_0x2795('0x4a')](function(_0x5b3ee7){logger[_0x2795('0x2c')](_0x2795('0x56'),_0x5b3ee7);throw _0x5b3ee7;});}return _0x24ae1a;})[_0x2795('0x26')](respondWithResult(_0x330e62,0xc9))[_0x2795('0x4a')](handleError(_0x330e62,null));};exports['update']=function(_0x5d81ba,_0x4ff138){if(_0x5d81ba['body']['id']){delete _0x5d81ba['body']['id'];}return db[_0x2795('0x46')][_0x2795('0x4d')]({'where':{'id':_0x5d81ba[_0x2795('0x4c')]['id']}})[_0x2795('0x26')](handleEntityNotFound(_0x4ff138,null))['then'](saveUpdates(_0x5d81ba[_0x2795('0x4f')],null))[_0x2795('0x26')](respondWithResult(_0x4ff138,null))['catch'](handleError(_0x4ff138,null));};exports[_0x2795('0x27')]=function(_0x1a9608,_0x44465c){return db[_0x2795('0x46')][_0x2795('0x4d')]({'where':{'id':_0x1a9608[_0x2795('0x4c')]['id']}})['then'](handleEntityNotFound(_0x44465c,null))[_0x2795('0x26')](removeEntity(_0x44465c,null))['catch'](handleError(_0x44465c,null));}; \ No newline at end of file +var _0x00b3=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','stack','name','map','Disposition','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x00b3,0x97));var _0x300b=function(_0x1b2156,_0x3460bf){_0x1b2156=_0x1b2156-0x0;var _0x44294e=_0x00b3[_0x1b2156];return _0x44294e;};'use strict';var emlformat=require(_0x300b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x300b('0x1'));var rp=require(_0x300b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x300b('0x3'));var util=require(_0x300b('0x4'));var path=require(_0x300b('0x5'));var sox=require('sox');var csv=require(_0x300b('0x6'));var ejs=require(_0x300b('0x7'));var fs=require('fs');var fs_extra=require(_0x300b('0x8'));var _=require(_0x300b('0x9'));var squel=require(_0x300b('0xa'));var crypto=require(_0x300b('0xb'));var jsforce=require(_0x300b('0xc'));var deskjs=require(_0x300b('0xd'));var toCsv=require(_0x300b('0x6'));var querystring=require(_0x300b('0xe'));var Papa=require(_0x300b('0xf'));var Redis=require(_0x300b('0x10'));var authService=require(_0x300b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x300b('0x12'));var hardwareService=require(_0x300b('0x13'));var logger=require(_0x300b('0x14'))('api');var utils=require(_0x300b('0x15'));var config=require(_0x300b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12da4c,_0x51b8fc){_0x51b8fc=_0x51b8fc||0xcc;return function(_0x12b3b0){if(_0x12b3b0){return _0x12da4c[_0x300b('0x17')](_0x51b8fc);}return _0x12da4c[_0x300b('0x18')](_0x51b8fc)[_0x300b('0x19')]();};}function respondWithResult(_0x3c9f85,_0x1edb37){_0x1edb37=_0x1edb37||0xc8;return function(_0x5c507b){if(_0x5c507b){return _0x3c9f85['status'](_0x1edb37)[_0x300b('0x1a')](_0x5c507b);}};}function respondWithFilteredResult(_0x29f231,_0x14cba0){return function(_0x19ac43){if(_0x19ac43){var _0x349a29=typeof _0x14cba0[_0x300b('0x1b')]===_0x300b('0x1c')&&typeof _0x14cba0[_0x300b('0x1d')]==='undefined';var _0x41cde4=_0x19ac43[_0x300b('0x1e')];var _0x5b812f=_0x349a29?0x0:_0x14cba0[_0x300b('0x1b')];var _0x2fe0db=_0x349a29?_0x19ac43[_0x300b('0x1e')]:_0x14cba0[_0x300b('0x1b')]+_0x14cba0['limit'];var _0x1c79d7;if(_0x2fe0db>=_0x41cde4){_0x2fe0db=_0x41cde4;_0x1c79d7=0xc8;}else{_0x1c79d7=0xce;}_0x29f231[_0x300b('0x18')](_0x1c79d7);return _0x29f231[_0x300b('0x1f')](_0x300b('0x20'),_0x5b812f+'-'+_0x2fe0db+'/'+_0x41cde4)['json'](_0x19ac43);}return null;};}function patchUpdates(_0x57f111){return function(_0x5d60c0){try{jsonpatch['apply'](_0x5d60c0,_0x57f111,!![]);}catch(_0x7853ee){return BPromise[_0x300b('0x21')](_0x7853ee);}return _0x5d60c0[_0x300b('0x22')]();};}function saveUpdates(_0x466d2e,_0x5e7937){return function(_0x2724de){if(_0x2724de){return _0x2724de[_0x300b('0x23')](_0x466d2e)[_0x300b('0x24')](function(_0x3b4eee){return _0x3b4eee;});}return null;};}function removeEntity(_0x3a87d7,_0x5e4093){return function(_0x105982){if(_0x105982){return _0x105982[_0x300b('0x25')]()[_0x300b('0x24')](function(){var _0x38a4c6=_0x105982[_0x300b('0x26')]({'plain':!![]});var _0x473bfd=_0x300b('0x27');return db[_0x300b('0x28')][_0x300b('0x25')]({'where':{'type':_0x473bfd,'resourceId':_0x38a4c6['id']}})['then'](function(){return _0x105982;});})['then'](function(){_0x3a87d7[_0x300b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x175a67,_0x225a19){return function(_0x164c66){if(!_0x164c66){_0x175a67[_0x300b('0x17')](0x194);}return _0x164c66;};}function handleError(_0x4e2c51,_0x4112eb){_0x4112eb=_0x4112eb||0x1f4;return function(_0xb2cf4d){logger['error'](_0xb2cf4d[_0x300b('0x29')]);if(_0xb2cf4d[_0x300b('0x2a')]){delete _0xb2cf4d[_0x300b('0x2a')];}_0x4e2c51[_0x300b('0x18')](_0x4112eb)['send'](_0xb2cf4d);};}exports['index']=function(_0x2c9356,_0x39f2c5){var _0x101fa2={},_0x4ee951={},_0x4eb3e5={'count':0x0,'rows':[]};var _0x712116=_[_0x300b('0x2b')](db[_0x300b('0x2c')][_0x300b('0x2d')],function(_0x1bfe89){return{'name':_0x1bfe89[_0x300b('0x2e')],'type':_0x1bfe89['type'][_0x300b('0x2f')]};});_0x4ee951[_0x300b('0x30')]=_[_0x300b('0x2b')](_0x712116,_0x300b('0x2a'));_0x4ee951[_0x300b('0x31')]=_['keys'](_0x2c9356['query']);_0x4ee951[_0x300b('0x32')]=_[_0x300b('0x33')](_0x4ee951['model'],_0x4ee951[_0x300b('0x31')]);_0x101fa2[_0x300b('0x34')]=_['intersection'](_0x4ee951[_0x300b('0x30')],qs['fields'](_0x2c9356[_0x300b('0x31')][_0x300b('0x35')]));_0x101fa2['attributes']=_0x101fa2[_0x300b('0x34')][_0x300b('0x36')]?_0x101fa2[_0x300b('0x34')]:_0x4ee951[_0x300b('0x30')];if(!_0x2c9356[_0x300b('0x31')][_0x300b('0x37')](_0x300b('0x38'))){_0x101fa2[_0x300b('0x1d')]=qs[_0x300b('0x1d')](_0x2c9356[_0x300b('0x31')][_0x300b('0x1d')]);_0x101fa2[_0x300b('0x1b')]=qs['offset'](_0x2c9356[_0x300b('0x31')]['offset']);}_0x101fa2['order']=qs[_0x300b('0x39')](_0x2c9356[_0x300b('0x31')]['sort']);_0x101fa2[_0x300b('0x3a')]=qs['filters'](_[_0x300b('0x3b')](_0x2c9356[_0x300b('0x31')],_0x4ee951['filters']),_0x712116);if(_0x2c9356[_0x300b('0x31')][_0x300b('0x3c')]){_0x101fa2[_0x300b('0x3a')]=_[_0x300b('0x3d')](_0x101fa2[_0x300b('0x3a')],{'$or':_[_0x300b('0x2b')](_0x712116,function(_0x55cd71){if(_0x55cd71[_0x300b('0x3e')]!==_0x300b('0x3f')){var _0x3d821a={};_0x3d821a[_0x55cd71['name']]={'$like':'%'+_0x2c9356['query'][_0x300b('0x3c')]+'%'};return _0x3d821a;}})});}_0x101fa2=_[_0x300b('0x3d')]({},_0x101fa2,_0x2c9356[_0x300b('0x40')]);var _0x482d32={'where':_0x101fa2[_0x300b('0x3a')]};return db['Disposition'][_0x300b('0x1e')](_0x482d32)[_0x300b('0x24')](function(_0x4ab488){_0x4eb3e5[_0x300b('0x1e')]=_0x4ab488;if(_0x2c9356[_0x300b('0x31')]['includeAll']){_0x101fa2['include']=[{'all':!![]}];}return db[_0x300b('0x2c')][_0x300b('0x41')](_0x101fa2);})['then'](function(_0x49fe13){_0x4eb3e5['rows']=_0x49fe13;return _0x4eb3e5;})[_0x300b('0x24')](respondWithFilteredResult(_0x39f2c5,_0x101fa2))[_0x300b('0x42')](handleError(_0x39f2c5,null));};exports[_0x300b('0x43')]=function(_0x220a2f,_0x23526e){var _0x1cf249={'raw':!![],'where':{'id':_0x220a2f[_0x300b('0x44')]['id']}},_0x57c233={};_0x57c233[_0x300b('0x30')]=_[_0x300b('0x45')](db[_0x300b('0x2c')][_0x300b('0x2d')]);_0x57c233[_0x300b('0x31')]=_[_0x300b('0x45')](_0x220a2f['query']);_0x57c233[_0x300b('0x32')]=_[_0x300b('0x33')](_0x57c233[_0x300b('0x30')],_0x57c233[_0x300b('0x31')]);_0x1cf249['attributes']=_[_0x300b('0x33')](_0x57c233[_0x300b('0x30')],qs[_0x300b('0x35')](_0x220a2f[_0x300b('0x31')]['fields']));_0x1cf249[_0x300b('0x34')]=_0x1cf249['attributes']['length']?_0x1cf249['attributes']:_0x57c233[_0x300b('0x30')];if(_0x220a2f[_0x300b('0x31')]['includeAll']){_0x1cf249[_0x300b('0x46')]=[{'all':!![]}];}_0x1cf249=_[_0x300b('0x3d')]({},_0x1cf249,_0x220a2f['options']);return db['Disposition'][_0x300b('0x47')](_0x1cf249)[_0x300b('0x24')](handleEntityNotFound(_0x23526e,null))[_0x300b('0x24')](respondWithResult(_0x23526e,null))[_0x300b('0x42')](handleError(_0x23526e,null));};exports['create']=function(_0x4aa017,_0x58a114){return db['Disposition'][_0x300b('0x48')](_0x4aa017[_0x300b('0x49')],{})[_0x300b('0x24')](function(_0x7e15b8){var _0x427bef=_0x4aa017[_0x300b('0x4a')][_0x300b('0x26')]({'plain':!![]});if(!_0x427bef)throw new Error(_0x300b('0x4b'));if(_0x427bef['role']===_0x300b('0x4a')){var _0x291a13=_0x7e15b8['get']({'plain':!![]});var _0x1ba443='Dispositions';return db['UserProfileSection'][_0x300b('0x47')]({'where':{'name':_0x1ba443,'userProfileId':_0x427bef[_0x300b('0x4c')]},'raw':!![]})['then'](function(_0xe14a61){if(_0xe14a61&&_0xe14a61[_0x300b('0x4d')]===0x0){return db[_0x300b('0x28')]['create']({'name':_0x291a13[_0x300b('0x2a')],'resourceId':_0x291a13['id'],'type':_0xe14a61[_0x300b('0x2a')],'sectionId':_0xe14a61['id']},{})['then'](function(){return _0x7e15b8;});}else{return _0x7e15b8;}})[_0x300b('0x42')](function(_0x4cfad6){logger[_0x300b('0x4e')](_0x300b('0x4f'),_0x4cfad6);throw _0x4cfad6;});}return _0x7e15b8;})[_0x300b('0x24')](respondWithResult(_0x58a114,0xc9))[_0x300b('0x42')](handleError(_0x58a114,null));};exports['update']=function(_0x18f731,_0x4c608d){if(_0x18f731['body']['id']){delete _0x18f731[_0x300b('0x49')]['id'];}return db[_0x300b('0x2c')][_0x300b('0x47')]({'where':{'id':_0x18f731[_0x300b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c608d,null))['then'](saveUpdates(_0x18f731[_0x300b('0x49')],null))['then'](respondWithResult(_0x4c608d,null))[_0x300b('0x42')](handleError(_0x4c608d,null));};exports[_0x300b('0x25')]=function(_0x25bb58,_0x5989c3){return db[_0x300b('0x2c')][_0x300b('0x47')]({'where':{'id':_0x25bb58[_0x300b('0x44')]['id']}})['then'](handleEntityNotFound(_0x5989c3,null))[_0x300b('0x24')](removeEntity(_0x5989c3,null))[_0x300b('0x42')](handleError(_0x5989c3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 4c2708e..6f57d32 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 _0xcdae=['tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','moment','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','Disposition'];(function(_0x444c13,_0x42a073){var _0x4d770a=function(_0xca1844){while(--_0xca1844){_0x444c13['push'](_0x444c13['shift']());}};_0x4d770a(++_0x42a073);}(_0xcdae,0x108));var _0xecda=function(_0x4b9d22,_0x47b52c){_0x4b9d22=_0x4b9d22-0x0;var _0x19582a=_0xcdae[_0x4b9d22];return _0x19582a;};'use strict';var _=require(_0xecda('0x0'));var util=require(_0xecda('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xecda('0x2'));var BPromise=require('bluebird');var rp=require(_0xecda('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecda('0x4'));var config=require(_0xecda('0x5'));var attributes=require(_0xecda('0x6'));module[_0xecda('0x7')]=function(_0x528c21,_0x24dc9c){return _0x528c21['define'](_0xecda('0x8'),attributes,{'tableName':_0xecda('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xecda('0xa'),'fields':[_0xecda('0xb'),_0xecda('0xc')]},{'unique':!![],'name':_0xecda('0xd'),'fields':[_0xecda('0xb'),_0xecda('0xe')]},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0xecda('0xf'),'fields':[_0xecda('0xb'),'SmsAccountId']},{'unique':!![],'name':_0xecda('0x10'),'fields':['name',_0xecda('0x11')]},{'unique':!![],'name':_0xecda('0x12'),'fields':[_0xecda('0xb'),_0xecda('0x13')]},{'unique':!![],'name':'name_whatsapp','fields':[_0xecda('0xb'),_0xecda('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x13cd=['ChatWebsiteId','name_mail','name_fax','OpenchannelAccountId','name_whatsapp','lodash','util','bluebird','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','name_chat'];(function(_0x23512c,_0x3a2831){var _0x49a39f=function(_0x5002ee){while(--_0x5002ee){_0x23512c['push'](_0x23512c['shift']());}};_0x49a39f(++_0x3a2831);}(_0x13cd,0x1a3));var _0xd13c=function(_0x203c80,_0xb5548f){_0x203c80=_0x203c80-0x0;var _0x558603=_0x13cd[_0x203c80];return _0x558603;};'use strict';var _=require(_0xd13c('0x0'));var util=require(_0xd13c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd13c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd13c('0x3'));var config=require(_0xd13c('0x4'));var attributes=require(_0xd13c('0x5'));module[_0xd13c('0x6')]=function(_0x1aeda5,_0x19b99f){return _0x1aeda5[_0xd13c('0x7')](_0xd13c('0x8'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xd13c('0x9'),'fields':[_0xd13c('0xa'),_0xd13c('0xb')]},{'unique':!![],'name':_0xd13c('0xc'),'fields':[_0xd13c('0xa'),_0xd13c('0xd')]},{'unique':!![],'name':_0xd13c('0xe'),'fields':[_0xd13c('0xa'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0xd13c('0xf'),'fields':[_0xd13c('0xa'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xd13c('0xa'),_0xd13c('0x10')]},{'unique':!![],'name':_0xd13c('0x11'),'fields':[_0xd13c('0xa'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 3218ec1..a6ac528 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(_0x59ddb7,_0x3f443e){var _0x34d727=function(_0x491b44){while(--_0x491b44){_0x59ddb7['push'](_0x59ddb7['shift']());}};_0x34d727(++_0x3f443e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x5d54ce,_0x47bc88){var _0x5994c6=function(_0x1da68e){while(--_0x1da68e){_0x5d54ce['push'](_0x5d54ce['shift']());}};_0x5994c6(++_0x47bc88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 ab7bed9..fae32d1 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 _0x307e=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x2cff3c,_0x6415f9){var _0x406371=function(_0x8cc3be){while(--_0x8cc3be){_0x2cff3c['push'](_0x2cff3c['shift']());}};_0x406371(++_0x6415f9);}(_0x307e,0xc9));var _0xe307=function(_0x1d6147,_0x555bbb){_0x1d6147=_0x1d6147-0x0;var _0x4501bf=_0x307e[_0x1d6147];return _0x4501bf;};'use strict';var multer=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var path=require(_0xe307('0x2'));var timeout=require(_0xe307('0x3'));var express=require(_0xe307('0x4'));var router=express['Router']();var fs_extra=require(_0xe307('0x5'));var auth=require(_0xe307('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe307('0x7'));var controller=require('./disposition.controller');router[_0xe307('0x8')]('/',auth[_0xe307('0x9')](),controller[_0xe307('0xa')]);router['get'](_0xe307('0xb'),auth[_0xe307('0x9')](),controller[_0xe307('0xc')]);router[_0xe307('0xd')]('/',auth[_0xe307('0x9')](),controller[_0xe307('0xe')]);router[_0xe307('0xf')](_0xe307('0xb'),auth[_0xe307('0x9')](),controller[_0xe307('0x10')]);router[_0xe307('0x11')](_0xe307('0xb'),auth[_0xe307('0x9')](),controller[_0xe307('0x12')]);module[_0xe307('0x13')]=router; \ No newline at end of file +var _0x6d27=['/:id','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','show','post','put'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x6d27,0x148));var _0x76d2=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x6d27[_0x485b5a];return _0xd2b34d;};'use strict';var multer=require(_0x76d2('0x0'));var util=require(_0x76d2('0x1'));var path=require(_0x76d2('0x2'));var timeout=require(_0x76d2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x76d2('0x4'));var auth=require(_0x76d2('0x5'));var interaction=require(_0x76d2('0x6'));var config=require(_0x76d2('0x7'));var controller=require(_0x76d2('0x8'));router[_0x76d2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x76d2('0x9')]('/:id',auth[_0x76d2('0xa')](),controller[_0x76d2('0xb')]);router[_0x76d2('0xc')]('/',auth[_0x76d2('0xa')](),controller['create']);router[_0x76d2('0xd')](_0x76d2('0xe'),auth['isAuthenticated'](),controller[_0x76d2('0xf')]);router['delete'](_0x76d2('0xe'),auth[_0x76d2('0xa')](),controller[_0x76d2('0x10')]);module[_0x76d2('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 2fdbd2c..fb2c646 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 _0x84e7=['14400','4800','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','12000'];(function(_0x1bec41,_0x54c220){var _0x5306b0=function(_0x18b3e9){while(--_0x18b3e9){_0x1bec41['push'](_0x1bec41['shift']());}};_0x5306b0(++_0x54c220);}(_0x84e7,0x122));var _0x784e=function(_0x5a2b31,_0x1bacd9){_0x5a2b31=_0x5a2b31-0x0;var _0x3da8fc=_0x84e7[_0x5a2b31];return _0x3da8fc;};'use strict';var Sequelize=require('sequelize');module[_0x784e('0x0')]={'name':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x784e('0x2')](_0x784e('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x784e('0x1')],'defaultValue':_0x784e('0x4')},'localstationid':{'type':Sequelize[_0x784e('0x1')],'unique':_0x784e('0x5')},'minrate':{'type':Sequelize[_0x784e('0x2')](_0x784e('0x6'),'4800',_0x784e('0x7'),'9600',_0x784e('0x8'),_0x784e('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x784e('0x2')](_0x784e('0x6'),_0x784e('0xa'),_0x784e('0x7'),'9600','12000',_0x784e('0x9')),'defaultValue':_0x784e('0x9')},'modem':{'type':Sequelize[_0x784e('0x1')],'defaultValue':_0x784e('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x784e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x784e('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x784e('0x2')](_0x784e('0xd'),_0x784e('0xe'),_0x784e('0xf'),'KHOMP'),'defaultValue':_0x784e('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x784e('0x10')],'defaultValue':function(){return _0x784e('0x11');}},'notificationSound':{'type':Sequelize[_0x784e('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x784e('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x784e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x784e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x784e('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x784e('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x784e('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x784e('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x784e('0x12')],'defaultValue':![],'comment':_0x784e('0x14'),'set':function(_0x25281f){if(!_0x25281f)this[_0x784e('0x15')](_0x784e('0x16'),null);this[_0x784e('0x15')]('mandatoryDisposition',_0x25281f);}}}; \ No newline at end of file +var _0xdb8b=['2400','7200','v17,v27,v29','INTEGER','SIP','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','9600','12000','14400'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x3599d8,_0x2e93d0){_0x3599d8=_0x3599d8-0x0;var _0x2390fa=_0xdb8b[_0x3599d8];return _0x2390fa;};'use strict';var Sequelize=require('sequelize');module[_0xbdb8('0x0')]={'name':{'type':Sequelize[_0xbdb8('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbdb8('0x1')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xbdb8('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xbdb8('0x3')},'localstationid':{'type':Sequelize[_0xbdb8('0x1')],'unique':_0xbdb8('0x4')},'minrate':{'type':Sequelize[_0xbdb8('0x5')]('2400',_0xbdb8('0x6'),'7200',_0xbdb8('0x7'),_0xbdb8('0x8'),_0xbdb8('0x9')),'defaultValue':_0xbdb8('0x6')},'maxrate':{'type':Sequelize[_0xbdb8('0x5')](_0xbdb8('0xa'),'4800',_0xbdb8('0xb'),_0xbdb8('0x7'),_0xbdb8('0x8'),_0xbdb8('0x9')),'defaultValue':_0xbdb8('0x9')},'modem':{'type':Sequelize[_0xbdb8('0x1')],'defaultValue':_0xbdb8('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xbdb8('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xbdb8('0xe'),'IAX',_0xbdb8('0xf'),'KHOMP'),'defaultValue':_0xbdb8('0xe')},'key':{'type':Sequelize[_0xbdb8('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xbdb8('0x10')],'defaultValue':function(){return _0xbdb8('0x11');}},'notificationSound':{'type':Sequelize[_0xbdb8('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbdb8('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbdb8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xbdb8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbdb8('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbdb8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbdb8('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbdb8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbdb8('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbdb8('0x12')],'defaultValue':![],'comment':_0xbdb8('0x13'),'set':function(_0x154036){if(!_0x154036)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xbdb8('0x14')]('mandatoryDisposition',_0x154036);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 3f488aa..8eefc59 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 _0x6229=['getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','get','FaxAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','pick','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','ids','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','exten','localstationid','app','type','system','description','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','sequelize','updateAccountApplications','VoiceExtension','tech','key','createdAt','TrunkId','ListId','findById'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6229,0x1b3));var _0x9622=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6229[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9622('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9622('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9622('0x2'));var path=require(_0x9622('0x3'));var sox=require(_0x9622('0x4'));var csv=require(_0x9622('0x5'));var ejs=require(_0x9622('0x6'));var fs=require('fs');var fs_extra=require(_0x9622('0x7'));var _=require(_0x9622('0x8'));var squel=require(_0x9622('0x9'));var crypto=require(_0x9622('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9622('0xb'));var toCsv=require(_0x9622('0x5'));var querystring=require('querystring');var Papa=require(_0x9622('0xc'));var Redis=require(_0x9622('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9622('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9622('0xf'))(_0x9622('0x10'));var utils=require('../../config/utils');var config=require(_0x9622('0x11'));var licenseUtil=require(_0x9622('0x12'));var db=require(_0x9622('0x13'))['db'];config[_0x9622('0x14')]=_['defaults'](config[_0x9622('0x14')],{'host':_0x9622('0x15'),'port':0x18eb});var socket=require(_0x9622('0x16'))(new Redis(config[_0x9622('0x14')]));require(_0x9622('0x17'))[_0x9622('0x18')](socket);var jayson=require(_0x9622('0x19'));var client=jayson[_0x9622('0x1a')][_0x9622('0x1b')]({'port':0x232c});var client9002=jayson[_0x9622('0x1a')][_0x9622('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2d2edf,_0x102a44,_0x3dbb61,_0x3cff65){return new BPromise(function(_0xb0b8fa,_0x4c0935){var _0x1f350d=_0x3cff65||client;return _0x1f350d[_0x9622('0x1c')](_0x2d2edf,_0x3dbb61)[_0x9622('0x1d')](function(_0x272756){logger['info']('FaxAccount,\x20%s,\x20%s',_0x102a44,_0x9622('0x1e'));logger[_0x9622('0x1f')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x102a44,'request\x20sent',JSON[_0x9622('0x20')](_0x272756));if(_0x272756['error']){if(_0x272756[_0x9622('0x21')][_0x9622('0x22')]===0x1f4){logger['error'](_0x9622('0x23'),_0x102a44,_0x272756[_0x9622('0x21')]['message']);return _0x4c0935(_0x272756[_0x9622('0x21')]['message']);}logger[_0x9622('0x21')](_0x9622('0x23'),_0x102a44,_0x272756[_0x9622('0x21')][_0x9622('0x24')]);return _0xb0b8fa(_0x272756[_0x9622('0x21')][_0x9622('0x24')]);}else{logger[_0x9622('0x25')](_0x9622('0x23'),_0x102a44,'request\x20sent');_0xb0b8fa(_0x272756[_0x9622('0x26')][_0x9622('0x24')]);}})[_0x9622('0x27')](function(_0x18684d){logger[_0x9622('0x21')](_0x9622('0x23'),_0x102a44,_0x18684d);_0x4c0935(_0x18684d);});});}function respondWithStatusCode(_0x1c9d7d,_0x1d428d){_0x1d428d=_0x1d428d||0xcc;return function(_0x3b190a){if(_0x3b190a){return _0x1c9d7d[_0x9622('0x28')](_0x1d428d);}return _0x1c9d7d[_0x9622('0x29')](_0x1d428d)[_0x9622('0x2a')]();};}function respondWithResult(_0x36dbef,_0x2783e6){_0x2783e6=_0x2783e6||0xc8;return function(_0x675f48){if(_0x675f48){return _0x36dbef[_0x9622('0x29')](_0x2783e6)['json'](_0x675f48);}};}function respondWithFilteredResult(_0x450dd5,_0x5dec4e){return function(_0x469971){if(_0x469971){var _0x1f49b5=typeof _0x5dec4e[_0x9622('0x2b')]==='undefined'&&typeof _0x5dec4e[_0x9622('0x2c')]===_0x9622('0x2d');var _0x48f2e=_0x469971['count'];var _0x5d6542=_0x1f49b5?0x0:_0x5dec4e[_0x9622('0x2b')];var _0x595475=_0x1f49b5?_0x469971[_0x9622('0x2e')]:_0x5dec4e['offset']+_0x5dec4e[_0x9622('0x2c')];var _0x51d6ce;if(_0x595475>=_0x48f2e){_0x595475=_0x48f2e;_0x51d6ce=0xc8;}else{_0x51d6ce=0xce;}_0x450dd5[_0x9622('0x29')](_0x51d6ce);return _0x450dd5[_0x9622('0x2f')](_0x9622('0x30'),_0x5d6542+'-'+_0x595475+'/'+_0x48f2e)['json'](_0x469971);}return null;};}function patchUpdates(_0x1dd815){return function(_0x37cb76){try{jsonpatch[_0x9622('0x31')](_0x37cb76,_0x1dd815,!![]);}catch(_0x56b224){return BPromise['reject'](_0x56b224);}return _0x37cb76[_0x9622('0x32')]();};}function saveUpdates(_0x385dca,_0x90006a){return function(_0x3bbe8){if(_0x3bbe8){return _0x3bbe8[_0x9622('0x33')](_0x385dca)[_0x9622('0x1d')](function(_0x4955a2){return _0x4955a2;});}return null;};}function removeEntity(_0x378246,_0x41c77f){return function(_0x397241){if(_0x397241){return _0x397241[_0x9622('0x34')]()[_0x9622('0x1d')](function(){var _0x191867=_0x397241[_0x9622('0x35')]({'plain':!![]});var _0x390bab=_0x9622('0x36');return db['UserProfileResource'][_0x9622('0x34')]({'where':{'type':_0x390bab,'resourceId':_0x191867['id']}})['then'](function(){return _0x397241;});})['then'](function(){_0x378246[_0x9622('0x29')](0xcc)[_0x9622('0x2a')]();});}};}function handleEntityNotFound(_0x49d753,_0x33a2ad){return function(_0x1cf00c){if(!_0x1cf00c){_0x49d753[_0x9622('0x28')](0x194);}return _0x1cf00c;};}function handleError(_0x24136d,_0x21aa0b){_0x21aa0b=_0x21aa0b||0x1f4;return function(_0x22bd83){logger['error'](_0x22bd83[_0x9622('0x37')]);if(_0x22bd83[_0x9622('0x38')]){delete _0x22bd83[_0x9622('0x38')];}_0x24136d[_0x9622('0x29')](_0x21aa0b)[_0x9622('0x39')](_0x22bd83);};}exports[_0x9622('0x3a')]=function(_0x26f3b6,_0xc2f628){var _0x5a4d76={'include':[{'model':db[_0x9622('0x3b')],'as':_0x9622('0x3c')}]},_0xcf80b0={},_0x50b6a3={'count':0x0,'rows':[]};var _0x45c81c=_[_0x9622('0x3d')](db[_0x9622('0x3e')]['rawAttributes'],function(_0x617014){return{'name':_0x617014['fieldName'],'type':_0x617014['type']['key']};});_0xcf80b0[_0x9622('0x3f')]=_['map'](_0x45c81c,_0x9622('0x38'));_0xcf80b0[_0x9622('0x40')]=_[_0x9622('0x41')](_0x26f3b6[_0x9622('0x40')]);_0xcf80b0[_0x9622('0x42')]=_[_0x9622('0x43')](_0xcf80b0[_0x9622('0x3f')],_0xcf80b0[_0x9622('0x40')]);_0x5a4d76[_0x9622('0x44')]=_[_0x9622('0x43')](_0xcf80b0[_0x9622('0x3f')],qs[_0x9622('0x45')](_0x26f3b6[_0x9622('0x40')][_0x9622('0x45')]));_0x5a4d76['attributes']=_0x5a4d76[_0x9622('0x44')][_0x9622('0x46')]?_0x5a4d76[_0x9622('0x44')]:_0xcf80b0[_0x9622('0x3f')];if(!_0x26f3b6[_0x9622('0x40')][_0x9622('0x47')](_0x9622('0x48'))){_0x5a4d76[_0x9622('0x2c')]=qs['limit'](_0x26f3b6[_0x9622('0x40')][_0x9622('0x2c')]);_0x5a4d76[_0x9622('0x2b')]=qs[_0x9622('0x2b')](_0x26f3b6[_0x9622('0x40')][_0x9622('0x2b')]);}_0x5a4d76[_0x9622('0x49')]=qs['sort'](_0x26f3b6[_0x9622('0x40')][_0x9622('0x4a')]);_0x5a4d76[_0x9622('0x4b')]=qs[_0x9622('0x42')](_['pick'](_0x26f3b6[_0x9622('0x40')],_0xcf80b0[_0x9622('0x42')]),_0x45c81c);if(_0x26f3b6['query'][_0x9622('0x4c')]){_0x5a4d76[_0x9622('0x4b')]=_['merge'](_0x5a4d76[_0x9622('0x4b')],{'$or':_['map'](_0x45c81c,function(_0x179adf){if(_0x179adf['type']!==_0x9622('0x4d')){var _0x42b539={};_0x42b539[_0x179adf[_0x9622('0x38')]]={'$like':'%'+_0x26f3b6[_0x9622('0x40')][_0x9622('0x4c')]+'%'};return _0x42b539;}})});}_0x5a4d76=_[_0x9622('0x4e')]({},_0x5a4d76,_0x26f3b6[_0x9622('0x4f')]);var _0x164db9={'where':_0x5a4d76[_0x9622('0x4b')]};return db[_0x9622('0x3e')][_0x9622('0x2e')](_0x164db9)['then'](function(_0x3b6cdf){_0x50b6a3[_0x9622('0x2e')]=_0x3b6cdf;if(_0x26f3b6[_0x9622('0x40')][_0x9622('0x50')]){_0x5a4d76[_0x9622('0x51')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x5a4d76);})[_0x9622('0x1d')](function(_0x4270e4){_0x50b6a3[_0x9622('0x52')]=_0x4270e4;return _0x50b6a3;})[_0x9622('0x1d')](respondWithFilteredResult(_0xc2f628,_0x5a4d76))['catch'](handleError(_0xc2f628,null));};exports['show']=function(_0x2cb940,_0x38915a){var _0x209c0b={'raw':![],'where':{'id':_0x2cb940[_0x9622('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x9622('0x3c')}]},_0x31ef87={};_0x31ef87[_0x9622('0x3f')]=_[_0x9622('0x41')](db[_0x9622('0x3e')][_0x9622('0x54')]);_0x31ef87['query']=_[_0x9622('0x41')](_0x2cb940[_0x9622('0x40')]);_0x31ef87[_0x9622('0x42')]=_[_0x9622('0x43')](_0x31ef87[_0x9622('0x3f')],_0x31ef87[_0x9622('0x40')]);_0x209c0b[_0x9622('0x44')]=_[_0x9622('0x43')](_0x31ef87['model'],qs[_0x9622('0x45')](_0x2cb940[_0x9622('0x40')]['fields']));_0x209c0b[_0x9622('0x44')]=_0x209c0b[_0x9622('0x44')]['length']?_0x209c0b['attributes']:_0x31ef87[_0x9622('0x3f')];if(_0x2cb940[_0x9622('0x40')][_0x9622('0x50')]){_0x209c0b[_0x9622('0x51')]=[{'all':!![]}];}_0x209c0b=_['merge']({},_0x209c0b,_0x2cb940['options']);return db[_0x9622('0x3e')]['find'](_0x209c0b)[_0x9622('0x1d')](handleEntityNotFound(_0x38915a,null))[_0x9622('0x1d')](respondWithResult(_0x38915a,null))[_0x9622('0x27')](handleError(_0x38915a,null));};exports['create']=function(_0x5a65d0,_0x17f6a9){return db[_0x9622('0x3e')][_0x9622('0x55')](_0x5a65d0['body'],{})[_0x9622('0x1d')](function(_0x204b45){var _0x1a23e7=_0x5a65d0[_0x9622('0x56')][_0x9622('0x35')]({'plain':!![]});if(!_0x1a23e7)throw new Error(_0x9622('0x57'));if(_0x1a23e7[_0x9622('0x58')]===_0x9622('0x56')){var _0x198019=_0x204b45[_0x9622('0x35')]({'plain':!![]});var _0xb2fff0=_0x9622('0x36');return db['UserProfileSection'][_0x9622('0x59')]({'where':{'name':_0xb2fff0,'userProfileId':_0x1a23e7[_0x9622('0x5a')]},'raw':!![]})['then'](function(_0x4c1c40){if(_0x4c1c40&&_0x4c1c40[_0x9622('0x5b')]===0x0){return db['UserProfileResource'][_0x9622('0x55')]({'name':_0x198019[_0x9622('0x38')],'resourceId':_0x198019['id'],'type':_0x4c1c40['name'],'sectionId':_0x4c1c40['id']},{})[_0x9622('0x1d')](function(){return _0x204b45;});}else{return _0x204b45;}})[_0x9622('0x27')](function(_0x45f1cf){logger[_0x9622('0x21')](_0x9622('0x5c'),_0x45f1cf);throw _0x45f1cf;});}return _0x204b45;})[_0x9622('0x1d')](respondWithResult(_0x17f6a9,0xc9))['catch'](handleError(_0x17f6a9,null));};exports[_0x9622('0x33')]=function(_0x419fe0,_0x49504e){if(_0x419fe0[_0x9622('0x5d')]['id']){delete _0x419fe0[_0x9622('0x5d')]['id'];}return db['FaxAccount'][_0x9622('0x59')]({'where':{'id':_0x419fe0['params']['id']},'include':[{'model':db[_0x9622('0x3b')],'as':_0x9622('0x3c')}]})[_0x9622('0x1d')](handleEntityNotFound(_0x49504e,null))['then'](saveUpdates(_0x419fe0[_0x9622('0x5d')],null))[_0x9622('0x1d')](respondWithResult(_0x49504e,null))['catch'](handleError(_0x49504e,null));};exports[_0x9622('0x34')]=function(_0x1074d8,_0x5ed18a){return db[_0x9622('0x3e')]['find']({'where':{'id':_0x1074d8['params']['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x5ed18a,null))[_0x9622('0x1d')](removeEntity(_0x5ed18a,null))[_0x9622('0x27')](handleError(_0x5ed18a,null));};exports[_0x9622('0x5e')]=function(_0x2d2920,_0x4bb841){return db[_0x9622('0x3e')][_0x9622('0x5e')]()[_0x9622('0x1d')](respondWithResult(_0x4bb841,null))[_0x9622('0x27')](handleError(_0x4bb841,null));};exports[_0x9622('0x5f')]=function(_0x45badf,_0x19e5fe,_0xa3054d){if(_0x45badf[_0x9622('0x5d')]['id']){delete _0x45badf['body']['id'];}return db['FaxAccount'][_0x9622('0x59')]({'where':{'id':_0x45badf[_0x9622('0x53')]['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x19e5fe,null))[_0x9622('0x1d')](function(_0xc35bc8){if(_0xc35bc8){_0x45badf[_0x9622('0x5d')][_0x9622('0x60')]=_0xc35bc8['id'];return db[_0x9622('0x61')][_0x9622('0x55')](_0x45badf['body']);}})[_0x9622('0x1d')](respondWithResult(_0x19e5fe,null))['catch'](handleError(_0x19e5fe,null));};exports[_0x9622('0x62')]=function(_0x4c5f19,_0x3a68c1,_0x69a66d){var _0x2a7ec2={'raw':![],'where':{}};var _0x57143f={};var _0x4367a1={'count':0x0,'rows':[]};return db[_0x9622('0x3e')][_0x9622('0x63')]({'where':{'id':_0x4c5f19[_0x9622('0x53')]['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x3a68c1,null))[_0x9622('0x1d')](function(_0x4f5391){if(_0x4f5391){_0x57143f[_0x9622('0x3f')]=_[_0x9622('0x41')](db['Disposition'][_0x9622('0x54')]);_0x57143f[_0x9622('0x40')]=_['keys'](_0x4c5f19[_0x9622('0x40')]);_0x57143f[_0x9622('0x42')]=_[_0x9622('0x43')](_0x57143f[_0x9622('0x3f')],_0x57143f[_0x9622('0x40')]);_0x2a7ec2['attributes']=_[_0x9622('0x43')](_0x57143f[_0x9622('0x3f')],qs[_0x9622('0x45')](_0x4c5f19[_0x9622('0x40')][_0x9622('0x45')]));_0x2a7ec2[_0x9622('0x44')]=_0x2a7ec2[_0x9622('0x44')]['length']?_0x2a7ec2['attributes']:_0x57143f['model'];if(!_0x4c5f19[_0x9622('0x40')][_0x9622('0x47')](_0x9622('0x48'))){_0x2a7ec2['limit']=qs[_0x9622('0x2c')](_0x4c5f19[_0x9622('0x40')]['limit']);_0x2a7ec2[_0x9622('0x2b')]=qs['offset'](_0x4c5f19[_0x9622('0x40')][_0x9622('0x2b')]);}_0x2a7ec2[_0x9622('0x49')]=qs[_0x9622('0x4a')](_0x4c5f19['query']['sort']);_0x2a7ec2['where']=qs[_0x9622('0x42')](_[_0x9622('0x64')](_0x4c5f19[_0x9622('0x40')],_0x57143f['filters']));_0x2a7ec2[_0x9622('0x4b')][_0x9622('0x60')]=_0x4f5391['id'];if(_0x4c5f19[_0x9622('0x40')]['filter']){_0x2a7ec2[_0x9622('0x4b')]=_[_0x9622('0x4e')](_0x2a7ec2[_0x9622('0x4b')],{'$or':_[_0x9622('0x3d')](_0x2a7ec2[_0x9622('0x44')],function(_0x4eeb63){var _0x13a6b9={};_0x13a6b9[_0x4eeb63]={'$like':'%'+_0x4c5f19[_0x9622('0x40')][_0x9622('0x4c')]+'%'};return _0x13a6b9;})});}_0x2a7ec2=_[_0x9622('0x4e')]({},_0x2a7ec2,_0x4c5f19[_0x9622('0x4f')]);return db[_0x9622('0x61')][_0x9622('0x2e')]({'where':_0x2a7ec2[_0x9622('0x4b')]})[_0x9622('0x1d')](function(_0x59a0d5){_0x4367a1[_0x9622('0x2e')]=_0x59a0d5;if(_0x4c5f19[_0x9622('0x40')][_0x9622('0x50')]){_0x2a7ec2['include']=[{'all':!![]}];}return db[_0x9622('0x61')][_0x9622('0x65')](_0x2a7ec2);})[_0x9622('0x1d')](function(_0x54ecdc){_0x4367a1['rows']=_0x54ecdc;return _0x4367a1;});}})['then'](respondWithFilteredResult(_0x3a68c1,_0x2a7ec2))[_0x9622('0x27')](handleError(_0x3a68c1,null));};exports[_0x9622('0x66')]=function(_0x122c2d,_0x259009,_0x1edb3e){return db[_0x9622('0x3e')][_0x9622('0x59')]({'where':{'id':_0x122c2d[_0x9622('0x53')]['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x259009,null))[_0x9622('0x1d')](function(_0x43a63e){if(_0x43a63e){return _0x43a63e[_0x9622('0x66')](_0x122c2d[_0x9622('0x40')]['ids']);}})[_0x9622('0x1d')](respondWithStatusCode(_0x259009,null))[_0x9622('0x27')](handleError(_0x259009,null));};exports[_0x9622('0x67')]=function(_0x307e9d,_0x39dbfd,_0x5981d2){if(_0x307e9d[_0x9622('0x5d')]['id']){delete _0x307e9d[_0x9622('0x5d')]['id'];}return db[_0x9622('0x3e')][_0x9622('0x59')]({'where':{'id':_0x307e9d[_0x9622('0x53')]['id']}})['then'](handleEntityNotFound(_0x39dbfd,null))[_0x9622('0x1d')](function(_0x4f331d){if(_0x4f331d){_0x307e9d[_0x9622('0x5d')][_0x9622('0x60')]=_0x4f331d['id'];return db[_0x9622('0x68')][_0x9622('0x55')](_0x307e9d[_0x9622('0x5d')]);}})['then'](respondWithResult(_0x39dbfd,null))[_0x9622('0x27')](handleError(_0x39dbfd,null));};exports[_0x9622('0x69')]=function(_0x5d7e9c,_0x215cbb,_0x392808){var _0x40520a={'raw':![],'where':{}};var _0x488215={};var _0x34f79c={'count':0x0,'rows':[]};return db[_0x9622('0x3e')][_0x9622('0x63')]({'where':{'id':_0x5d7e9c['params']['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x215cbb,null))[_0x9622('0x1d')](function(_0x3f3b91){if(_0x3f3b91){_0x488215['model']=_['keys'](db['CannedAnswer'][_0x9622('0x54')]);_0x488215[_0x9622('0x40')]=_['keys'](_0x5d7e9c[_0x9622('0x40')]);_0x488215[_0x9622('0x42')]=_[_0x9622('0x43')](_0x488215[_0x9622('0x3f')],_0x488215[_0x9622('0x40')]);_0x40520a[_0x9622('0x44')]=_[_0x9622('0x43')](_0x488215[_0x9622('0x3f')],qs[_0x9622('0x45')](_0x5d7e9c[_0x9622('0x40')][_0x9622('0x45')]));_0x40520a[_0x9622('0x44')]=_0x40520a[_0x9622('0x44')][_0x9622('0x46')]?_0x40520a[_0x9622('0x44')]:_0x488215[_0x9622('0x3f')];if(!_0x5d7e9c['query'][_0x9622('0x47')]('nolimit')){_0x40520a[_0x9622('0x2c')]=qs['limit'](_0x5d7e9c[_0x9622('0x40')][_0x9622('0x2c')]);_0x40520a[_0x9622('0x2b')]=qs[_0x9622('0x2b')](_0x5d7e9c['query'][_0x9622('0x2b')]);}_0x40520a[_0x9622('0x49')]=qs[_0x9622('0x4a')](_0x5d7e9c['query'][_0x9622('0x4a')]);_0x40520a[_0x9622('0x4b')]=qs[_0x9622('0x42')](_[_0x9622('0x64')](_0x5d7e9c[_0x9622('0x40')],_0x488215[_0x9622('0x42')]));_0x40520a[_0x9622('0x4b')][_0x9622('0x60')]=_0x3f3b91['id'];if(_0x5d7e9c[_0x9622('0x40')][_0x9622('0x4c')]){_0x40520a['where']=_[_0x9622('0x4e')](_0x40520a[_0x9622('0x4b')],{'$or':_['map'](_0x40520a[_0x9622('0x44')],function(_0xf6958c){var _0x428929={};_0x428929[_0xf6958c]={'$like':'%'+_0x5d7e9c[_0x9622('0x40')][_0x9622('0x4c')]+'%'};return _0x428929;})});}_0x40520a=_[_0x9622('0x4e')]({},_0x40520a,_0x5d7e9c[_0x9622('0x4f')]);return db[_0x9622('0x68')]['count']({'where':_0x40520a[_0x9622('0x4b')]})[_0x9622('0x1d')](function(_0x480f3e){_0x34f79c[_0x9622('0x2e')]=_0x480f3e;if(_0x5d7e9c[_0x9622('0x40')]['includeAll']){_0x40520a[_0x9622('0x51')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9622('0x65')](_0x40520a);})[_0x9622('0x1d')](function(_0x203f65){_0x34f79c[_0x9622('0x52')]=_0x203f65;return _0x34f79c;});}})[_0x9622('0x1d')](respondWithFilteredResult(_0x215cbb,_0x40520a))[_0x9622('0x27')](handleError(_0x215cbb,null));};exports[_0x9622('0x6a')]=function(_0x42ee1f,_0xf3b7d9,_0x563632){return db[_0x9622('0x3e')]['find']({'where':{'id':_0x42ee1f[_0x9622('0x53')]['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0xf3b7d9,null))[_0x9622('0x1d')](function(_0x158f6b){if(_0x158f6b){return _0x158f6b['removeAnswers'](_0x42ee1f['query']['ids']);}})['then'](respondWithStatusCode(_0xf3b7d9,null))['catch'](handleError(_0xf3b7d9,null));};exports[_0x9622('0x6b')]=function(_0x1e7909,_0x524bcc,_0x5a12ae){return db[_0x9622('0x6c')][_0x9622('0x59')]({'where':{'id':_0x1e7909[_0x9622('0x53')]['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x524bcc,null))[_0x9622('0x1d')](function(_0x18606a){if(_0x18606a){return _0x18606a[_0x9622('0x6b')](_0x1e7909[_0x9622('0x5d')][_0x9622('0x6d')],_[_0x9622('0x6e')](_0x1e7909['body'],[_0x9622('0x6d'),'id'])||{});}})[_0x9622('0x1d')](respondWithResult(_0x524bcc,null))[_0x9622('0x27')](handleError(_0x524bcc,null));};exports['getInteractions']=function(_0x4702f6,_0x38e7c4,_0x881b2a){var _0x38a8f6={'raw':![],'where':{}};var _0x3098cb={};var _0xe45640={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9622('0x63')]({'where':{'id':_0x4702f6[_0x9622('0x53')]['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x38e7c4,null))[_0x9622('0x1d')](function(_0x48d338){if(_0x48d338){_0x3098cb[_0x9622('0x3f')]=_[_0x9622('0x41')](db[_0x9622('0x6c')][_0x9622('0x54')]);_0x3098cb[_0x9622('0x40')]=_[_0x9622('0x41')](_0x4702f6[_0x9622('0x40')]);_0x3098cb['filters']=_[_0x9622('0x43')](_0x3098cb['model'],_0x3098cb[_0x9622('0x40')]);_0x38a8f6[_0x9622('0x44')]=_['intersection'](_0x3098cb[_0x9622('0x3f')],qs[_0x9622('0x45')](_0x4702f6[_0x9622('0x40')][_0x9622('0x45')]));_0x38a8f6[_0x9622('0x44')]=_0x38a8f6[_0x9622('0x44')][_0x9622('0x46')]?_0x38a8f6['attributes']:_0x3098cb[_0x9622('0x3f')];if(!_0x4702f6['query'][_0x9622('0x47')](_0x9622('0x48'))){_0x38a8f6[_0x9622('0x2c')]=qs[_0x9622('0x2c')](_0x4702f6[_0x9622('0x40')]['limit']);_0x38a8f6[_0x9622('0x2b')]=qs[_0x9622('0x2b')](_0x4702f6['query'][_0x9622('0x2b')]);}_0x38a8f6[_0x9622('0x49')]=qs['sort'](_0x4702f6[_0x9622('0x40')][_0x9622('0x4a')]);_0x38a8f6[_0x9622('0x4b')]=qs[_0x9622('0x42')](_[_0x9622('0x64')](_0x4702f6[_0x9622('0x40')],_0x3098cb[_0x9622('0x42')]));_0x38a8f6['where']['FaxAccountId']=_0x48d338['id'];if(_0x4702f6['query']['filter']){_0x38a8f6[_0x9622('0x4b')]=_[_0x9622('0x4e')](_0x38a8f6['where'],{'$or':_[_0x9622('0x3d')](_0x38a8f6[_0x9622('0x44')],function(_0x27d47b){var _0xffa80e={};_0xffa80e[_0x27d47b]={'$like':'%'+_0x4702f6[_0x9622('0x40')][_0x9622('0x4c')]+'%'};return _0xffa80e;})});}_0x38a8f6=_[_0x9622('0x4e')]({},_0x38a8f6,_0x4702f6[_0x9622('0x4f')]);return db['FaxInteraction'][_0x9622('0x2e')]({'where':_0x38a8f6['where']})['then'](function(_0x3c4862){_0xe45640[_0x9622('0x2e')]=_0x3c4862;if(_0x4702f6[_0x9622('0x40')][_0x9622('0x50')]){_0x38a8f6[_0x9622('0x51')]=[{'model':db[_0x9622('0x6f')],'as':_0x9622('0x70'),'required':![]},{'model':db[_0x9622('0x71')],'as':_0x9622('0x72'),'attributes':[_0x9622('0x38'),_0x9622('0x73'),_0x9622('0x74')],'required':![]},{'model':db[_0x9622('0x75')],'as':_0x9622('0x76'),'attributes':['id','name',_0x9622('0x77')],'where':_0x4702f6['query'][_0x9622('0x78')]?{'id':_0x4702f6['query'][_0x9622('0x78')]}:undefined,'required':_0x4702f6['query'][_0x9622('0x78')]?!![]:![]}];}return db[_0x9622('0x6c')]['findAll'](_0x38a8f6);})[_0x9622('0x1d')](function(_0xff29ec){_0xe45640[_0x9622('0x52')]=_0xff29ec;return _0xe45640;});}})[_0x9622('0x1d')](respondWithFilteredResult(_0x38e7c4,_0x38a8f6))[_0x9622('0x27')](handleError(_0x38e7c4,null));};exports[_0x9622('0x79')]=function(_0x42301b,_0x2890ba){var _0x41776a=_0x42301b[_0x9622('0x53')]['id'];var _0x352487=_0x42301b['body'];var _0x2861cd=0xc8;var _0x27d6c4=null;return db['sequelize'][_0x9622('0x7a')]({'isolationLevel':db['sequelize']['Transaction'][_0x9622('0x7b')][_0x9622('0x7c')]},function(_0x48854a){return db[_0x9622('0x3e')][_0x9622('0x63')]({'where':{'id':_0x41776a},'transaction':_0x48854a})[_0x9622('0x1d')](function(_0xd69111){if(_0xd69111){return db[_0x9622('0x7d')]['destroy']({'where':{'FaxAccountId':_0x41776a},'transaction':_0x48854a})['then'](function(){var _0x85db3f=_[_0x9622('0x3d')](_0x352487,function(_0xccf68){_0xccf68[_0x9622('0x60')]=_0x41776a;return _0xccf68;});return db[_0x9622('0x7d')][_0x9622('0x7e')](_0x85db3f,{'transaction':_0x48854a});});}else{_0x2861cd=0x194;_0x27d6c4=[];}});})[_0x9622('0x1d')](function(){if(_0x2861cd!==0x194){return db[_0x9622('0x7d')][_0x9622('0x7f')]({'where':{'FaxAccountId':_0x41776a},'order':'priority'})['then'](function(_0xb34b68){_0x27d6c4=_0xb34b68;});}})[_0x9622('0x27')](function(_0x1d4438){_0x2861cd=0x1f4;logger['error'](_0x1d4438['stack']);if(_0x1d4438[_0x9622('0x38')]){delete _0x1d4438[_0x9622('0x38')];}_0x27d6c4=_0x1d4438;})[_0x9622('0x80')](function(){if(_0x27d6c4===null){_0x2890ba[_0x9622('0x28')](_0x2861cd);}else{if(_0x2861cd===0x1f4){_0x2890ba[_0x9622('0x29')](_0x2861cd)['send'](_0x27d6c4);}else{_0x2890ba[_0x9622('0x29')](_0x2861cd)['json'](_0x27d6c4);}}});};exports['getApplications']=function(_0x2dd915,_0x196b6a,_0xd0cf1c){var _0x5c77cd={};var _0x5cdfc3={};var _0x45464c;var _0xbc8947;return db[_0x9622('0x3e')][_0x9622('0x63')]({'where':{'id':_0x2dd915['params']['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x196b6a,null))[_0x9622('0x1d')](function(_0x3f433a){if(_0x3f433a){_0x45464c=_0x3f433a;_0x5cdfc3['model']=_[_0x9622('0x41')](db[_0x9622('0x7d')][_0x9622('0x54')]);_0x5cdfc3[_0x9622('0x40')]=_[_0x9622('0x41')](_0x2dd915[_0x9622('0x40')]);_0x5cdfc3[_0x9622('0x42')]=_[_0x9622('0x43')](_0x5cdfc3[_0x9622('0x3f')],_0x5cdfc3[_0x9622('0x40')]);_0x5c77cd[_0x9622('0x44')]=_['intersection'](_0x5cdfc3['model'],qs[_0x9622('0x45')](_0x2dd915['query'][_0x9622('0x45')]));_0x5c77cd[_0x9622('0x44')]=_0x5c77cd[_0x9622('0x44')]['length']?_0x5c77cd[_0x9622('0x44')]:_0x5cdfc3['model'];_0x5c77cd[_0x9622('0x49')]=qs[_0x9622('0x4a')](_0x2dd915['query'][_0x9622('0x4a')]);_0x5c77cd[_0x9622('0x4b')]=qs[_0x9622('0x42')](_[_0x9622('0x64')](_0x2dd915[_0x9622('0x40')],_0x5cdfc3[_0x9622('0x42')]));if(_0x2dd915['query'][_0x9622('0x4c')]){_0x5c77cd[_0x9622('0x4b')]=_[_0x9622('0x4e')](_0x5c77cd['where'],{'$or':_[_0x9622('0x3d')](_0x5c77cd['attributes'],function(_0xaacbb7){var _0x20674a={};_0x20674a[_0xaacbb7]={'$like':'%'+_0x2dd915[_0x9622('0x40')][_0x9622('0x4c')]+'%'};return _0x20674a;})});}_0x5c77cd=_[_0x9622('0x4e')]({},_0x5c77cd,_0x2dd915[_0x9622('0x4f')]);return _0x45464c[_0x9622('0x81')](_0x5c77cd);}})[_0x9622('0x1d')](function(_0xb0ddc1){if(_0xb0ddc1){_0xbc8947=_0xb0ddc1[_0x9622('0x46')];if(!_0x2dd915[_0x9622('0x40')][_0x9622('0x47')]('nolimit')){_0x5c77cd[_0x9622('0x2c')]=qs[_0x9622('0x2c')](_0x2dd915['query'][_0x9622('0x2c')]);_0x5c77cd['offset']=qs[_0x9622('0x2b')](_0x2dd915[_0x9622('0x40')][_0x9622('0x2b')]);}return _0x45464c[_0x9622('0x81')](_0x5c77cd);}})[_0x9622('0x1d')](function(_0x223082){if(_0x223082){return _0x223082?{'count':_0xbc8947,'rows':_0x223082}:null;}})['then'](respondWithResult(_0x196b6a,null))['catch'](handleError(_0x196b6a,null));};function Extension(_0x34c1dd,_0x41d674,_0x13f415,_0x3d739f){this[_0x9622('0x82')]='from-voip-provider';this[_0x9622('0x83')]=_0x34c1dd[_0x9622('0x84')];this[_0x9622('0x85')]=_0x3d739f;this[_0x9622('0x86')]=_0x9622('0x87');this[_0x9622('0x88')]='Fax\x20Extension';this['FaxAccountId']=_0x34c1dd['id'];this[_0x9622('0x89')]=_0x41d674;this[_0x9622('0x8a')]=_0x13f415;}function createExtensionsReciveFax(_0x5db38d){var _0x401044=0x1;var _0x588409=[];_0x588409[_0x9622('0x8b')](new Extension(_0x5db38d,_0x401044,'',_0x9622('0x8c')));_0x401044+=0x1;_0x588409[_0x9622('0x8b')](new Extension(_0x5db38d,_0x401044,_0x9622('0x8d'),_0x9622('0x8e')));_0x401044+=0x1;for(var _0xacaa0d in _0x5db38d){if(_0x5db38d[_0x9622('0x47')](_0xacaa0d)&&(_0xacaa0d===_0x9622('0x8f')||_0xacaa0d===_0x9622('0x84')||_0xacaa0d===_0x9622('0x90')||_0xacaa0d===_0x9622('0x91')||_0xacaa0d===_0x9622('0x92')||_0xacaa0d===_0x9622('0x93')||_0xacaa0d===_0x9622('0x94')||_0xacaa0d==='modem'||_0xacaa0d===_0x9622('0x95'))){_0x588409[_0x9622('0x8b')](new Extension(_0x5db38d,_0x401044,_0x9622('0x96')+_0xacaa0d+')='+_0x5db38d[_0xacaa0d],_0x9622('0x8e')));_0x401044+=0x1;}}_0x588409[_0x9622('0x8b')](new Extension(_0x5db38d,_0x401044,'6','Wait'));_0x401044+=0x1;_0x588409[_0x9622('0x8b')](new Extension(_0x5db38d,_0x401044,_0x9622('0x97'),_0x9622('0x98')));_0x401044=0x0;return _0x588409;}exports['addAccountApplications']=function(_0x3e370d,_0x5bfa86,_0x3b4223){var _0x3a8779;return db[_0x9622('0x99')][_0x9622('0x7a')](function(_0x3bbfb1){return db[_0x9622('0x3e')][_0x9622('0x55')](_0x3e370d[_0x9622('0x5d')],{'transaction':_0x3bbfb1})[_0x9622('0x1d')](function(_0x500c44){_0x3a8779=_0x500c44[_0x9622('0x35')]({'plain':!![]});return db['VoiceExtension'][_0x9622('0x7e')](createExtensionsReciveFax(_0x3a8779),{'transaction':_0x3bbfb1});});})[_0x9622('0x1d')](function(){return _0x3a8779;})[_0x9622('0x1d')](respondWithResult(_0x5bfa86,null))[_0x9622('0x27')](handleError(_0x5bfa86,null));};exports[_0x9622('0x9a')]=function(_0x4d7834,_0x37540f,_0x3b5f69){var _0x13e993;return db['sequelize'][_0x9622('0x7a')](function(_0x57b8f2){return db[_0x9622('0x3e')][_0x9622('0x33')](_0x4d7834[_0x9622('0x5d')],{'where':{'id':_0x4d7834['body']['id']},'transaction':_0x57b8f2})[_0x9622('0x1d')](function(_0x144341){return db[_0x9622('0x9b')][_0x9622('0x34')]({'where':{'FaxAccountId':_0x4d7834[_0x9622('0x5d')]['id']},'transaction':_0x57b8f2})[_0x9622('0x1d')](function(_0x51c967){return db[_0x9622('0x9b')][_0x9622('0x7e')](createExtensionsReciveFax(_[_0x9622('0x6e')](_0x4d7834[_0x9622('0x5d')],[_0x9622('0x9c'),_0x9622('0x9d'),_0x9622('0x9e'),'updatedAt',_0x9622('0x9f'),_0x9622('0xa0')])),{'transaction':_0x57b8f2});});});})[_0x9622('0x1d')](function(){return db[_0x9622('0x3e')][_0x9622('0xa1')](_0x4d7834[_0x9622('0x5d')]['id']);})[_0x9622('0x1d')](respondWithResult(_0x37540f,null))[_0x9622('0x27')](handleError(_0x37540f,null));};exports[_0x9622('0xa2')]=function(_0x35d7e3,_0x41184d,_0x1dc32f){var _0x405b0e={'raw':!![],'where':{}};var _0x3011d6={};var _0x1c24cb={'count':0x0,'rows':[]};return db[_0x9622('0x3e')][_0x9622('0x63')]({'where':{'id':_0x35d7e3['params']['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x41184d,null))['then'](function(_0x546371){if(_0x546371){_0x3011d6[_0x9622('0x3f')]=_[_0x9622('0x41')](db[_0x9622('0xa3')][_0x9622('0x54')]);_0x3011d6['query']=_[_0x9622('0x41')](_0x35d7e3['query']);_0x3011d6[_0x9622('0x42')]=_['intersection'](_0x3011d6[_0x9622('0x3f')],_0x3011d6['query']);_0x405b0e[_0x9622('0x44')]=_[_0x9622('0x43')](_0x3011d6[_0x9622('0x3f')],qs[_0x9622('0x45')](_0x35d7e3['query'][_0x9622('0x45')]));_0x405b0e[_0x9622('0x44')]=_0x405b0e[_0x9622('0x44')][_0x9622('0x46')]?_0x405b0e[_0x9622('0x44')]:_0x3011d6[_0x9622('0x3f')];if(!_0x35d7e3[_0x9622('0x40')][_0x9622('0x47')](_0x9622('0x48'))){_0x405b0e[_0x9622('0x2c')]=qs[_0x9622('0x2c')](_0x35d7e3[_0x9622('0x40')][_0x9622('0x2c')]);_0x405b0e[_0x9622('0x2b')]=qs[_0x9622('0x2b')](_0x35d7e3[_0x9622('0x40')][_0x9622('0x2b')]);}_0x405b0e[_0x9622('0x49')]=qs[_0x9622('0x4a')](_0x35d7e3[_0x9622('0x40')][_0x9622('0x4a')]);_0x405b0e['where']=qs[_0x9622('0x42')](_[_0x9622('0x64')](_0x35d7e3['query'],_0x3011d6[_0x9622('0x42')]));_0x405b0e['where'][_0x9622('0x60')]=_0x546371['id'];if(_0x35d7e3[_0x9622('0x40')][_0x9622('0x4c')]){_0x405b0e['where']=_[_0x9622('0x4e')](_0x405b0e[_0x9622('0x4b')],{'$or':_[_0x9622('0x3d')](_0x405b0e[_0x9622('0x44')],function(_0x23a4b4){var _0x381a84={};_0x381a84[_0x23a4b4]={'$like':'%'+_0x35d7e3['query'][_0x9622('0x4c')]+'%'};return _0x381a84;})});}if(_0x35d7e3[_0x9622('0x40')][_0x9622('0xa4')]){var _0x4c5015=_0x35d7e3[_0x9622('0x40')]['$gte']['split'](',');var _0x150ad1={};_0x150ad1[_0x4c5015[0x0]]={'$gte':moment(_0x4c5015[0x1])[_0x9622('0xa5')](_0x9622('0xa6'))};_0x405b0e[_0x9622('0x4b')]=_[_0x9622('0x4e')](_0x405b0e['where'],_0x150ad1);}_0x405b0e=_['merge']({},_0x405b0e,_0x35d7e3['options']);return db['FaxMessage'][_0x9622('0x2e')]({'where':_0x405b0e[_0x9622('0x4b')]})[_0x9622('0x1d')](function(_0x47ba5a){_0x1c24cb['count']=_0x47ba5a;if(_0x35d7e3[_0x9622('0x40')]['includeAll']){_0x405b0e[_0x9622('0x51')]=[{'all':!![]}];}return db[_0x9622('0xa3')]['findAll'](_0x405b0e);})['then'](function(_0x345192){_0x1c24cb[_0x9622('0x52')]=_0x345192;return _0x1c24cb;});}})['then'](respondWithFilteredResult(_0x41184d,_0x405b0e))['catch'](handleError(_0x41184d,null));};exports['send']=function(_0x2ba6b5,_0x248677,_0x241f40){var _0x46c6f2,_0x2985fb={},_0x1932b4;if(_0x2ba6b5[_0x9622('0x5d')]['to']){_0x1932b4=_0x2ba6b5['body']['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x2ba6b5[_0x9622('0x53')]['id']},'include':[{'model':db[_0x9622('0xa7')],'as':_0x9622('0xa8'),'include':[{'model':db[_0x9622('0x6f')],'as':_0x9622('0xa9'),'where':{'fax':_0x1932b4},'limit':0x1,'order':[[_0x9622('0xaa'),_0x9622('0xab')]]}]}]})[_0x9622('0x1d')](handleEntityNotFound(_0x248677,null))[_0x9622('0x1d')](function(_0x2b93a0){_0x46c6f2=_0x2b93a0;if(_0x2ba6b5['body'][_0x9622('0xac')]&&_0x2ba6b5['body'][_0x9622('0xac')][_0x9622('0x46')]){for(var _0x2aff28=0x0;_0x2aff28<_0x2ba6b5[_0x9622('0x5d')]['attachments'][_0x9622('0x46')];_0x2aff28+=0x1){_0x2ba6b5[_0x9622('0x5d')][_0x9622('0xac')][_0x2aff28]={'filename':_0x2ba6b5['body'][_0x9622('0xac')][_0x2aff28][_0x9622('0x38')],'id':_0x2ba6b5[_0x9622('0x5d')]['attachments'][_0x2aff28]['id'],'path':path[_0x9622('0xad')](config[_0x9622('0xae')],_0x9622('0xaf'),_0x2ba6b5[_0x9622('0x5d')][_0x9622('0xac')][_0x2aff28]['basename'])};}}return respondWithRpcPromise(_0x9622('0xb0'),_0x9622('0xb0'),{'FaxAccountId':_[_0x9622('0xb1')](_0x2ba6b5[_0x9622('0x53')]['id'])?undefined:_0x2ba6b5[_0x9622('0x53')]['id'],'path':_['isNil'](_0x2ba6b5[_0x9622('0x5d')][_0x9622('0xac')][0x0]['path'])?undefined:_0x2ba6b5[_0x9622('0x5d')][_0x9622('0xac')][0x0][_0x9622('0x3')],'fax':_[_0x9622('0xb1')](_0x2ba6b5[_0x9622('0x5d')]['to'][0x0])?undefined:_0x2ba6b5[_0x9622('0x5d')]['to'][0x0]},client9002);})[_0x9622('0x1d')](function(){if(_0x46c6f2){if(_[_0x9622('0xb1')](_0x2ba6b5[_0x9622('0x5d')]['from'])){_0x2ba6b5['body'][_0x9622('0xb2')]=util[_0x9622('0xa5')](_0x9622('0xb3'),_0x46c6f2['name'],_0x46c6f2[_0x9622('0xb4')]);}if(_0x46c6f2[_0x9622('0xa8')]){if(_0x46c6f2[_0x9622('0xa8')]['Contacts'][_0x9622('0x46')]){return _0x46c6f2[_0x9622('0xa8')][_0x9622('0xa9')][0x0];}else{return db['CmContact'][_0x9622('0x55')](_[_0x9622('0xb5')](_0x2ba6b5[_0x9622('0x5d')],{'firstName':_0x2ba6b5[_0x9622('0x5d')]['to'][0x0],'phone':_0x2ba6b5[_0x9622('0x5d')]['to'][0x0],'fax':_0x2ba6b5[_0x9622('0x5d')]['to'][0x0],'ListId':_0x46c6f2[_0x9622('0xa0')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x9622('0xb6'));}})['then'](function(_0x4460ac){if(_0x4460ac){return db['FaxInteraction'][_0x9622('0x59')]({'where':{'ContactId':_0x4460ac['id'],'closed':![],'FaxAccountId':_0x46c6f2['id']}})[_0x9622('0x1d')](function(_0x50dbb8){if(_0x50dbb8){return[_0x50dbb8,![]];}return db[_0x9622('0x6c')][_0x9622('0x55')]({'UserId':_0x2ba6b5['user']['id'],'ContactId':_0x4460ac['id'],'FaxAccountId':_0x46c6f2['id'],'fax':_0x2ba6b5['body']['to'][0x0],'firstMsgDirection':_0x9622('0xb7'),'Messages':[_[_0x9622('0x4e')](_0x2ba6b5[_0x9622('0x5d')],{'read':![],'body':_0x2ba6b5['body']['attachments'][0x0]['filename'],'FaxAccountId':_0x46c6f2['id'],'UserId':_0x2ba6b5[_0x9622('0x56')]['id'],'ContactId':_0x4460ac['id'],'AttachmentId':_0x2ba6b5[_0x9622('0x5d')][_0x9622('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x9622('0xa3')],'as':_0x9622('0xb8')}]})[_0x9622('0x1d')](function(_0x1533f5){return[_0x1533f5,!![]];});});}else{throw new Error(_0x9622('0xb9'));}})[_0x9622('0xba')](function(_0x54d449,_0xff8643){if(_0xff8643){return _0x54d449;}return db[_0x9622('0xa3')][_0x9622('0x55')]({'direction':_0x9622('0xb7'),'read':![],'body':_0x2ba6b5[_0x9622('0x5d')][_0x9622('0xac')][0x0][_0x9622('0xbb')],'FaxAccountId':_0x46c6f2['id'],'FaxInteractionId':_0x54d449['id'],'UserId':_0x2ba6b5[_0x9622('0x56')]['id'],'ContactId':_0x54d449[_0x9622('0xbc')],'AttachmentId':_0x2ba6b5[_0x9622('0x5d')][_0x9622('0xac')][0x0]['id']})['then'](function(_0x4682ed){_0x54d449[_0x9622('0xbd')][_0x9622('0xb8')]=[];_0x54d449[_0x9622('0xbd')][_0x9622('0xb8')][_0x9622('0x8b')](_0x4682ed[_0x9622('0xbd')]);return _0x54d449;});})[_0x9622('0x1d')](function(_0x4d099b){respondWithRpcPromise(_0x9622('0xbe'),_0x9622('0xbe'),{'FaxAccountId':_[_0x9622('0xb1')](_0x2ba6b5[_0x9622('0x53')]['id'])?undefined:_0x2ba6b5['params']['id'],'path':_['isNil'](_0x2ba6b5['body']['attachments'][0x0][_0x9622('0x3')])?undefined:_0x2ba6b5[_0x9622('0x5d')]['attachments'][0x0]['path'],'fax':_[_0x9622('0xb1')](_0x2ba6b5[_0x9622('0x5d')]['to'][0x0])?undefined:_0x2ba6b5[_0x9622('0x5d')]['to'][0x0],'AttachmentId':_0x2ba6b5['body'][_0x9622('0xac')][0x0]['id']},client9002)[_0x9622('0x1d')](function(_0x5af2c8){logger[_0x9622('0x25')](_0x9622('0xbf'),_0x5af2c8);})['catch'](function(_0x326040){logger[_0x9622('0x25')]('SendFaxRpc,\x20%s',_0x326040);});return _0x4d099b;})[_0x9622('0x1d')](respondWithResult(_0x248677,null))[_0x9622('0x27')](handleError(_0x248677,null));};exports[_0x9622('0xc0')]=function(_0x1bd331,_0x5912a2,_0x115a94){return db[_0x9622('0x3e')][_0x9622('0x59')]({'where':{'id':_0x1bd331[_0x9622('0x53')]['id']}})[_0x9622('0x1d')](handleEntityNotFound(_0x5912a2,null))[_0x9622('0x1d')](function(_0x4b098b){if(_0x4b098b){return _0x4b098b['addAgents'](_0x1bd331[_0x9622('0x5d')][_0x9622('0x6d')],_[_0x9622('0x6e')](_0x1bd331[_0x9622('0x5d')],['ids','id'])||{})[_0x9622('0xba')](function(_0x298c13){for(var _0x2157e2=0x0;_0x2157e2<_0x1bd331[_0x9622('0x5d')][_0x9622('0x6d')]['length'];_0x2157e2+=0x1){socket[_0x9622('0xc1')](_0x9622('0xc2'),{'UserId':Number(_0x1bd331[_0x9622('0x5d')][_0x9622('0x6d')][_0x2157e2]),'FaxAccountId':Number(_0x1bd331[_0x9622('0x53')]['id'])});}return _0x298c13;});}})['then'](respondWithResult(_0x5912a2,null))[_0x9622('0x27')](handleError(_0x5912a2,null));};exports[_0x9622('0xc3')]=function(_0x396225,_0x35ac0e,_0x16df2f){return db[_0x9622('0x3e')][_0x9622('0x59')]({'where':{'id':_0x396225[_0x9622('0x53')]['id']}})['then'](handleEntityNotFound(_0x35ac0e,null))[_0x9622('0x1d')](function(_0x39911f){if(_0x39911f){return _0x39911f[_0x9622('0xc3')](_0x396225[_0x9622('0x40')][_0x9622('0x6d')])[_0x9622('0x1d')](function(){if(_[_0x9622('0xc4')](_0x396225[_0x9622('0x40')][_0x9622('0x6d')])){for(var _0x28b9eb=0x0;_0x28b9eb<_0x396225[_0x9622('0x40')][_0x9622('0x6d')]['length'];_0x28b9eb+=0x1){socket[_0x9622('0xc1')](_0x9622('0xc5'),{'UserId':Number(_0x396225[_0x9622('0x40')][_0x9622('0x6d')][_0x28b9eb]),'FaxAccountId':Number(_0x396225['params']['id'])});}}else{socket[_0x9622('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x396225[_0x9622('0x40')][_0x9622('0x6d')]),'FaxAccountId':Number(_0x396225['params']['id'])});}});}})['then'](respondWithStatusCode(_0x35ac0e,null))[_0x9622('0x27')](handleError(_0x35ac0e,null));};exports[_0x9622('0xc6')]=function(_0x549152,_0x629929,_0x4b16e8){var _0x147ff3={};var _0x5bd3f6={};var _0x56cdee;var _0x27a3b5;return db[_0x9622('0x3e')]['findOne']({'where':{'id':_0x549152['params']['id']}})['then'](handleEntityNotFound(_0x629929,null))['then'](function(_0x5d5947){if(_0x5d5947){_0x56cdee=_0x5d5947;_0x5bd3f6[_0x9622('0x3f')]=_[_0x9622('0x41')](db[_0x9622('0x71')][_0x9622('0x54')]);_0x5bd3f6[_0x9622('0x40')]=_['keys'](_0x549152['query']);_0x5bd3f6[_0x9622('0x42')]=_['intersection'](_0x5bd3f6[_0x9622('0x3f')],_0x5bd3f6[_0x9622('0x40')]);_0x147ff3[_0x9622('0x44')]=_['intersection'](_0x5bd3f6[_0x9622('0x3f')],qs['fields'](_0x549152['query']['fields']));_0x147ff3[_0x9622('0x44')]=_0x147ff3[_0x9622('0x44')]['length']?_0x147ff3[_0x9622('0x44')]:_0x5bd3f6[_0x9622('0x3f')];_0x147ff3['order']=qs[_0x9622('0x4a')](_0x549152[_0x9622('0x40')]['sort']);_0x147ff3[_0x9622('0x4b')]=qs['filters'](_[_0x9622('0x64')](_0x549152[_0x9622('0x40')],_0x5bd3f6[_0x9622('0x42')]));if(_0x549152[_0x9622('0x40')]['filter']){_0x147ff3[_0x9622('0x4b')]=_[_0x9622('0x4e')](_0x147ff3['where'],{'$or':_[_0x9622('0x3d')](_0x147ff3[_0x9622('0x44')],function(_0x515974){var _0x48cf9c={};_0x48cf9c[_0x515974]={'$like':'%'+_0x549152[_0x9622('0x40')][_0x9622('0x4c')]+'%'};return _0x48cf9c;})});}_0x147ff3=_[_0x9622('0x4e')]({},_0x147ff3,_0x549152['options']);return _0x56cdee[_0x9622('0xc6')](_0x147ff3);}})[_0x9622('0x1d')](function(_0x1f8154){if(_0x1f8154){_0x27a3b5=_0x1f8154['length'];if(!_0x549152[_0x9622('0x40')][_0x9622('0x47')]('nolimit')){_0x147ff3[_0x9622('0x2c')]=qs[_0x9622('0x2c')](_0x549152[_0x9622('0x40')][_0x9622('0x2c')]);_0x147ff3[_0x9622('0x2b')]=qs[_0x9622('0x2b')](_0x549152[_0x9622('0x40')]['offset']);}return _0x56cdee['getAgents'](_0x147ff3);}})['then'](function(_0x4a57f6){if(_0x4a57f6){return _0x4a57f6?{'count':_0x27a3b5,'rows':_0x4a57f6}:null;}})[_0x9622('0x1d')](respondWithResult(_0x629929,null))['catch'](handleError(_0x629929,null));}; \ No newline at end of file +var _0x4829=['filter','merge','VIRTUAL','options','FaxAccount','show','mandatoryDispositionPause','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','getDispositions','Disposition','sort','where','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','nolimit','CmContact','Contact','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','sendStatus','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','maxrate','minrate','modem','ReceiveFax','addAccountApplications','transaction','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','User','getAgents','eml-format','zip-dir','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick'];(function(_0x1fde24,_0x2c6bc0){var _0x2daaad=function(_0x44630b){while(--_0x44630b){_0x1fde24['push'](_0x1fde24['shift']());}};_0x2daaad(++_0x2c6bc0);}(_0x4829,0x13d));var _0x9482=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0x4829[_0x58a4fe];return _0x697de2;};'use strict';var emlformat=require(_0x9482('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9482('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9482('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9482('0x3'));var sox=require(_0x9482('0x4'));var csv=require(_0x9482('0x5'));var ejs=require(_0x9482('0x6'));var fs=require('fs');var fs_extra=require(_0x9482('0x7'));var _=require(_0x9482('0x8'));var squel=require('squel');var crypto=require(_0x9482('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9482('0x5'));var querystring=require(_0x9482('0xa'));var Papa=require(_0x9482('0xb'));var Redis=require(_0x9482('0xc'));var authService=require(_0x9482('0xd'));var qs=require(_0x9482('0xe'));var as=require(_0x9482('0xf'));var hardwareService=require(_0x9482('0x10'));var logger=require(_0x9482('0x11'))('api');var utils=require(_0x9482('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9482('0x13'));var db=require(_0x9482('0x14'))['db'];config[_0x9482('0x15')]=_['defaults'](config[_0x9482('0x15')],{'host':_0x9482('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9482('0x15')]));require(_0x9482('0x17'))[_0x9482('0x18')](socket);var jayson=require(_0x9482('0x19'));var client=jayson[_0x9482('0x1a')][_0x9482('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37b92d,_0x39bb89,_0x10bee4,_0x2c0a8a){return new BPromise(function(_0x453e58,_0x258cd4){var _0x137a6e=_0x2c0a8a||client;return _0x137a6e[_0x9482('0x1c')](_0x37b92d,_0x10bee4)['then'](function(_0x156f5f){logger[_0x9482('0x1d')](_0x9482('0x1e'),_0x39bb89,_0x9482('0x1f'));logger[_0x9482('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x39bb89,_0x9482('0x1f'),JSON[_0x9482('0x21')](_0x156f5f));if(_0x156f5f[_0x9482('0x22')]){if(_0x156f5f['error']['code']===0x1f4){logger[_0x9482('0x22')](_0x9482('0x1e'),_0x39bb89,_0x156f5f[_0x9482('0x22')][_0x9482('0x23')]);return _0x258cd4(_0x156f5f['error']['message']);}logger[_0x9482('0x22')](_0x9482('0x1e'),_0x39bb89,_0x156f5f[_0x9482('0x22')]['message']);return _0x453e58(_0x156f5f['error'][_0x9482('0x23')]);}else{logger[_0x9482('0x1d')](_0x9482('0x1e'),_0x39bb89,_0x9482('0x1f'));_0x453e58(_0x156f5f[_0x9482('0x24')][_0x9482('0x23')]);}})[_0x9482('0x25')](function(_0x174c43){logger[_0x9482('0x22')](_0x9482('0x1e'),_0x39bb89,_0x174c43);_0x258cd4(_0x174c43);});});}function respondWithStatusCode(_0x459a8a,_0x49eb1a){_0x49eb1a=_0x49eb1a||0xcc;return function(_0x33b87c){if(_0x33b87c){return _0x459a8a['sendStatus'](_0x49eb1a);}return _0x459a8a[_0x9482('0x26')](_0x49eb1a)[_0x9482('0x27')]();};}function respondWithResult(_0xcd4cff,_0x48ae32){_0x48ae32=_0x48ae32||0xc8;return function(_0x20136b){if(_0x20136b){return _0xcd4cff[_0x9482('0x26')](_0x48ae32)[_0x9482('0x28')](_0x20136b);}};}function respondWithFilteredResult(_0xc9fdf3,_0x42c814){return function(_0x1567e4){if(_0x1567e4){var _0x577e11=typeof _0x42c814[_0x9482('0x29')]===_0x9482('0x2a')&&typeof _0x42c814[_0x9482('0x2b')]===_0x9482('0x2a');var _0x485cf7=_0x1567e4[_0x9482('0x2c')];var _0x151134=_0x577e11?0x0:_0x42c814[_0x9482('0x29')];var _0x32729d=_0x577e11?_0x1567e4['count']:_0x42c814[_0x9482('0x29')]+_0x42c814[_0x9482('0x2b')];var _0x48f084;if(_0x32729d>=_0x485cf7){_0x32729d=_0x485cf7;_0x48f084=0xc8;}else{_0x48f084=0xce;}_0xc9fdf3['status'](_0x48f084);return _0xc9fdf3[_0x9482('0x2d')](_0x9482('0x2e'),_0x151134+'-'+_0x32729d+'/'+_0x485cf7)[_0x9482('0x28')](_0x1567e4);}return null;};}function patchUpdates(_0x1fb53e){return function(_0x1890ef){try{jsonpatch[_0x9482('0x2f')](_0x1890ef,_0x1fb53e,!![]);}catch(_0xdfddc3){return BPromise[_0x9482('0x30')](_0xdfddc3);}return _0x1890ef[_0x9482('0x31')]();};}function saveUpdates(_0x1b9f50,_0x1c45a5){return function(_0x480106){if(_0x480106){return _0x480106[_0x9482('0x32')](_0x1b9f50)[_0x9482('0x33')](function(_0x5d2773){return _0x5d2773;});}return null;};}function removeEntity(_0x14a2d8,_0x46a9ca){return function(_0x1a98d9){if(_0x1a98d9){return _0x1a98d9[_0x9482('0x34')]()['then'](function(){var _0x23769f=_0x1a98d9[_0x9482('0x35')]({'plain':!![]});var _0x3a3db4=_0x9482('0x36');return db[_0x9482('0x37')][_0x9482('0x34')]({'where':{'type':_0x3a3db4,'resourceId':_0x23769f['id']}})[_0x9482('0x33')](function(){return _0x1a98d9;});})[_0x9482('0x33')](function(){_0x14a2d8[_0x9482('0x26')](0xcc)[_0x9482('0x27')]();});}};}function handleEntityNotFound(_0x3a473c,_0x253e52){return function(_0x42f6f8){if(!_0x42f6f8){_0x3a473c['sendStatus'](0x194);}return _0x42f6f8;};}function handleError(_0x10c696,_0x590a75){_0x590a75=_0x590a75||0x1f4;return function(_0x18503e){logger[_0x9482('0x22')](_0x18503e[_0x9482('0x38')]);if(_0x18503e[_0x9482('0x39')]){delete _0x18503e[_0x9482('0x39')];}_0x10c696[_0x9482('0x26')](_0x590a75)[_0x9482('0x3a')](_0x18503e);};}exports[_0x9482('0x3b')]=function(_0x501ff2,_0x4c68e2){var _0x554148={'include':[{'model':db[_0x9482('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3e8033={},_0x1bc5ec={'count':0x0,'rows':[]};var _0x400dba=_[_0x9482('0x3d')](db['FaxAccount'][_0x9482('0x3e')],function(_0x10ce6f){return{'name':_0x10ce6f[_0x9482('0x3f')],'type':_0x10ce6f[_0x9482('0x40')][_0x9482('0x41')]};});_0x3e8033[_0x9482('0x42')]=_[_0x9482('0x3d')](_0x400dba,_0x9482('0x39'));_0x3e8033[_0x9482('0x43')]=_[_0x9482('0x44')](_0x501ff2[_0x9482('0x43')]);_0x3e8033[_0x9482('0x45')]=_[_0x9482('0x46')](_0x3e8033['model'],_0x3e8033['query']);_0x554148[_0x9482('0x47')]=_[_0x9482('0x46')](_0x3e8033[_0x9482('0x42')],qs['fields'](_0x501ff2[_0x9482('0x43')][_0x9482('0x48')]));_0x554148[_0x9482('0x47')]=_0x554148[_0x9482('0x47')][_0x9482('0x49')]?_0x554148[_0x9482('0x47')]:_0x3e8033[_0x9482('0x42')];if(!_0x501ff2[_0x9482('0x43')][_0x9482('0x4a')]('nolimit')){_0x554148[_0x9482('0x2b')]=qs[_0x9482('0x2b')](_0x501ff2[_0x9482('0x43')]['limit']);_0x554148[_0x9482('0x29')]=qs[_0x9482('0x29')](_0x501ff2[_0x9482('0x43')][_0x9482('0x29')]);}_0x554148[_0x9482('0x4b')]=qs['sort'](_0x501ff2['query']['sort']);_0x554148['where']=qs['filters'](_[_0x9482('0x4c')](_0x501ff2[_0x9482('0x43')],_0x3e8033[_0x9482('0x45')]),_0x400dba);if(_0x501ff2['query'][_0x9482('0x4d')]){_0x554148['where']=_[_0x9482('0x4e')](_0x554148['where'],{'$or':_[_0x9482('0x3d')](_0x400dba,function(_0x35913e){if(_0x35913e[_0x9482('0x40')]!==_0x9482('0x4f')){var _0x49c2d0={};_0x49c2d0[_0x35913e[_0x9482('0x39')]]={'$like':'%'+_0x501ff2[_0x9482('0x43')][_0x9482('0x4d')]+'%'};return _0x49c2d0;}})});}_0x554148=_[_0x9482('0x4e')]({},_0x554148,_0x501ff2[_0x9482('0x50')]);var _0x229e4a={'where':_0x554148['where']};return db[_0x9482('0x51')]['count'](_0x229e4a)[_0x9482('0x33')](function(_0x45d939){_0x1bc5ec['count']=_0x45d939;if(_0x501ff2[_0x9482('0x43')]['includeAll']){_0x554148['include']=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x554148);})['then'](function(_0x2a1451){_0x1bc5ec['rows']=_0x2a1451;return _0x1bc5ec;})[_0x9482('0x33')](respondWithFilteredResult(_0x4c68e2,_0x554148))[_0x9482('0x25')](handleError(_0x4c68e2,null));};exports[_0x9482('0x52')]=function(_0x273565,_0x3981e9){var _0x4abaf7={'raw':![],'where':{'id':_0x273565['params']['id']},'include':[{'model':db[_0x9482('0x3c')],'as':_0x9482('0x53')}]},_0x1c6406={};_0x1c6406[_0x9482('0x42')]=_[_0x9482('0x44')](db['FaxAccount'][_0x9482('0x3e')]);_0x1c6406[_0x9482('0x43')]=_[_0x9482('0x44')](_0x273565['query']);_0x1c6406[_0x9482('0x45')]=_['intersection'](_0x1c6406[_0x9482('0x42')],_0x1c6406[_0x9482('0x43')]);_0x4abaf7[_0x9482('0x47')]=_[_0x9482('0x46')](_0x1c6406[_0x9482('0x42')],qs[_0x9482('0x48')](_0x273565['query'][_0x9482('0x48')]));_0x4abaf7[_0x9482('0x47')]=_0x4abaf7[_0x9482('0x47')][_0x9482('0x49')]?_0x4abaf7[_0x9482('0x47')]:_0x1c6406[_0x9482('0x42')];if(_0x273565[_0x9482('0x43')][_0x9482('0x54')]){_0x4abaf7[_0x9482('0x55')]=[{'all':!![]}];}_0x4abaf7=_[_0x9482('0x4e')]({},_0x4abaf7,_0x273565[_0x9482('0x50')]);return db[_0x9482('0x51')][_0x9482('0x56')](_0x4abaf7)[_0x9482('0x33')](handleEntityNotFound(_0x3981e9,null))[_0x9482('0x33')](respondWithResult(_0x3981e9,null))['catch'](handleError(_0x3981e9,null));};exports[_0x9482('0x57')]=function(_0xa6262e,_0x1fb6eb){return db[_0x9482('0x51')][_0x9482('0x57')](_0xa6262e[_0x9482('0x58')],{})[_0x9482('0x33')](function(_0xcd15d){var _0x5ff033=_0xa6262e[_0x9482('0x59')]['get']({'plain':!![]});if(!_0x5ff033)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ff033[_0x9482('0x5a')]==='user'){var _0x5d06b3=_0xcd15d['get']({'plain':!![]});var _0x2f934b=_0x9482('0x36');return db[_0x9482('0x5b')][_0x9482('0x56')]({'where':{'name':_0x2f934b,'userProfileId':_0x5ff033[_0x9482('0x5c')]},'raw':!![]})[_0x9482('0x33')](function(_0x2808aa){if(_0x2808aa&&_0x2808aa[_0x9482('0x5d')]===0x0){return db[_0x9482('0x37')]['create']({'name':_0x5d06b3['name'],'resourceId':_0x5d06b3['id'],'type':_0x2808aa[_0x9482('0x39')],'sectionId':_0x2808aa['id']},{})['then'](function(){return _0xcd15d;});}else{return _0xcd15d;}})['catch'](function(_0x254099){logger[_0x9482('0x22')](_0x9482('0x5e'),_0x254099);throw _0x254099;});}return _0xcd15d;})[_0x9482('0x33')](respondWithResult(_0x1fb6eb,0xc9))[_0x9482('0x25')](handleError(_0x1fb6eb,null));};exports['update']=function(_0x293000,_0x47071d){if(_0x293000[_0x9482('0x58')]['id']){delete _0x293000[_0x9482('0x58')]['id'];}return db[_0x9482('0x51')][_0x9482('0x56')]({'where':{'id':_0x293000['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x47071d,null))['then'](saveUpdates(_0x293000[_0x9482('0x58')],null))['then'](respondWithResult(_0x47071d,null))[_0x9482('0x25')](handleError(_0x47071d,null));};exports[_0x9482('0x34')]=function(_0x40a5b2,_0x2cabc7){return db[_0x9482('0x51')][_0x9482('0x56')]({'where':{'id':_0x40a5b2[_0x9482('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2cabc7,null))[_0x9482('0x33')](removeEntity(_0x2cabc7,null))[_0x9482('0x25')](handleError(_0x2cabc7,null));};exports[_0x9482('0x60')]=function(_0x2c4bc9,_0x7ad59d){return db[_0x9482('0x51')][_0x9482('0x60')]()['then'](respondWithResult(_0x7ad59d,null))['catch'](handleError(_0x7ad59d,null));};exports[_0x9482('0x61')]=function(_0x182e62,_0x10b5cf,_0x41cb10){if(_0x182e62[_0x9482('0x58')]['id']){delete _0x182e62[_0x9482('0x58')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x182e62['params']['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x10b5cf,null))[_0x9482('0x33')](function(_0xe4ee3d){if(_0xe4ee3d){_0x182e62[_0x9482('0x58')][_0x9482('0x62')]=_0xe4ee3d['id'];return db['Disposition']['create'](_0x182e62[_0x9482('0x58')]);}})[_0x9482('0x33')](respondWithResult(_0x10b5cf,null))['catch'](handleError(_0x10b5cf,null));};exports[_0x9482('0x63')]=function(_0x489d0e,_0x1a897c,_0x406723){var _0x3923ac={'raw':![],'where':{}};var _0x3fbe11={};var _0x431004={'count':0x0,'rows':[]};return db[_0x9482('0x51')]['findOne']({'where':{'id':_0x489d0e[_0x9482('0x5f')]['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x1a897c,null))[_0x9482('0x33')](function(_0x49ad3f){if(_0x49ad3f){_0x3fbe11[_0x9482('0x42')]=_[_0x9482('0x44')](db[_0x9482('0x64')][_0x9482('0x3e')]);_0x3fbe11[_0x9482('0x43')]=_['keys'](_0x489d0e[_0x9482('0x43')]);_0x3fbe11[_0x9482('0x45')]=_[_0x9482('0x46')](_0x3fbe11[_0x9482('0x42')],_0x3fbe11['query']);_0x3923ac[_0x9482('0x47')]=_['intersection'](_0x3fbe11[_0x9482('0x42')],qs[_0x9482('0x48')](_0x489d0e[_0x9482('0x43')]['fields']));_0x3923ac[_0x9482('0x47')]=_0x3923ac[_0x9482('0x47')][_0x9482('0x49')]?_0x3923ac['attributes']:_0x3fbe11[_0x9482('0x42')];if(!_0x489d0e['query']['hasOwnProperty']('nolimit')){_0x3923ac[_0x9482('0x2b')]=qs[_0x9482('0x2b')](_0x489d0e['query'][_0x9482('0x2b')]);_0x3923ac[_0x9482('0x29')]=qs[_0x9482('0x29')](_0x489d0e[_0x9482('0x43')][_0x9482('0x29')]);}_0x3923ac[_0x9482('0x4b')]=qs[_0x9482('0x65')](_0x489d0e[_0x9482('0x43')][_0x9482('0x65')]);_0x3923ac[_0x9482('0x66')]=qs[_0x9482('0x45')](_[_0x9482('0x4c')](_0x489d0e[_0x9482('0x43')],_0x3fbe11[_0x9482('0x45')]));_0x3923ac['where'][_0x9482('0x62')]=_0x49ad3f['id'];if(_0x489d0e[_0x9482('0x43')][_0x9482('0x4d')]){_0x3923ac[_0x9482('0x66')]=_[_0x9482('0x4e')](_0x3923ac[_0x9482('0x66')],{'$or':_[_0x9482('0x3d')](_0x3923ac[_0x9482('0x47')],function(_0x117121){var _0x14c8c4={};_0x14c8c4[_0x117121]={'$like':'%'+_0x489d0e[_0x9482('0x43')][_0x9482('0x4d')]+'%'};return _0x14c8c4;})});}_0x3923ac=_[_0x9482('0x4e')]({},_0x3923ac,_0x489d0e[_0x9482('0x50')]);return db[_0x9482('0x64')]['count']({'where':_0x3923ac[_0x9482('0x66')]})['then'](function(_0xe61dd7){_0x431004[_0x9482('0x2c')]=_0xe61dd7;if(_0x489d0e['query']['includeAll']){_0x3923ac[_0x9482('0x55')]=[{'all':!![]}];}return db[_0x9482('0x64')][_0x9482('0x67')](_0x3923ac);})[_0x9482('0x33')](function(_0x17f59d){_0x431004[_0x9482('0x68')]=_0x17f59d;return _0x431004;});}})['then'](respondWithFilteredResult(_0x1a897c,_0x3923ac))['catch'](handleError(_0x1a897c,null));};exports[_0x9482('0x69')]=function(_0x9bef44,_0x37062a,_0xc083c9){return db[_0x9482('0x51')][_0x9482('0x56')]({'where':{'id':_0x9bef44[_0x9482('0x5f')]['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x37062a,null))[_0x9482('0x33')](function(_0x168a65){if(_0x168a65){return _0x168a65[_0x9482('0x69')](_0x9bef44[_0x9482('0x43')]['ids']);}})[_0x9482('0x33')](respondWithStatusCode(_0x37062a,null))['catch'](handleError(_0x37062a,null));};exports[_0x9482('0x6a')]=function(_0x92d23e,_0x56748b,_0x19ca10){if(_0x92d23e['body']['id']){delete _0x92d23e['body']['id'];}return db[_0x9482('0x51')]['find']({'where':{'id':_0x92d23e['params']['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x56748b,null))[_0x9482('0x33')](function(_0x2bdb2c){if(_0x2bdb2c){_0x92d23e['body'][_0x9482('0x62')]=_0x2bdb2c['id'];return db[_0x9482('0x6b')][_0x9482('0x57')](_0x92d23e['body']);}})[_0x9482('0x33')](respondWithResult(_0x56748b,null))[_0x9482('0x25')](handleError(_0x56748b,null));};exports[_0x9482('0x6c')]=function(_0x1ce16b,_0x5b8855,_0xb85dfc){var _0x2b7bb5={'raw':![],'where':{}};var _0x29f766={};var _0x59deb8={'count':0x0,'rows':[]};return db[_0x9482('0x51')][_0x9482('0x6d')]({'where':{'id':_0x1ce16b[_0x9482('0x5f')]['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x5b8855,null))[_0x9482('0x33')](function(_0x46887f){if(_0x46887f){_0x29f766['model']=_[_0x9482('0x44')](db['CannedAnswer'][_0x9482('0x3e')]);_0x29f766['query']=_[_0x9482('0x44')](_0x1ce16b[_0x9482('0x43')]);_0x29f766['filters']=_['intersection'](_0x29f766['model'],_0x29f766[_0x9482('0x43')]);_0x2b7bb5['attributes']=_[_0x9482('0x46')](_0x29f766[_0x9482('0x42')],qs[_0x9482('0x48')](_0x1ce16b['query'][_0x9482('0x48')]));_0x2b7bb5[_0x9482('0x47')]=_0x2b7bb5[_0x9482('0x47')][_0x9482('0x49')]?_0x2b7bb5['attributes']:_0x29f766[_0x9482('0x42')];if(!_0x1ce16b[_0x9482('0x43')][_0x9482('0x4a')]('nolimit')){_0x2b7bb5[_0x9482('0x2b')]=qs[_0x9482('0x2b')](_0x1ce16b[_0x9482('0x43')][_0x9482('0x2b')]);_0x2b7bb5['offset']=qs[_0x9482('0x29')](_0x1ce16b[_0x9482('0x43')][_0x9482('0x29')]);}_0x2b7bb5[_0x9482('0x4b')]=qs[_0x9482('0x65')](_0x1ce16b[_0x9482('0x43')][_0x9482('0x65')]);_0x2b7bb5[_0x9482('0x66')]=qs[_0x9482('0x45')](_[_0x9482('0x4c')](_0x1ce16b[_0x9482('0x43')],_0x29f766['filters']));_0x2b7bb5[_0x9482('0x66')]['FaxAccountId']=_0x46887f['id'];if(_0x1ce16b[_0x9482('0x43')][_0x9482('0x4d')]){_0x2b7bb5['where']=_['merge'](_0x2b7bb5[_0x9482('0x66')],{'$or':_['map'](_0x2b7bb5['attributes'],function(_0x71fa10){var _0x12e4cd={};_0x12e4cd[_0x71fa10]={'$like':'%'+_0x1ce16b[_0x9482('0x43')][_0x9482('0x4d')]+'%'};return _0x12e4cd;})});}_0x2b7bb5=_[_0x9482('0x4e')]({},_0x2b7bb5,_0x1ce16b['options']);return db[_0x9482('0x6b')]['count']({'where':_0x2b7bb5['where']})[_0x9482('0x33')](function(_0x2d10b3){_0x59deb8[_0x9482('0x2c')]=_0x2d10b3;if(_0x1ce16b[_0x9482('0x43')][_0x9482('0x54')]){_0x2b7bb5[_0x9482('0x55')]=[{'all':!![]}];}return db[_0x9482('0x6b')][_0x9482('0x67')](_0x2b7bb5);})[_0x9482('0x33')](function(_0x3e8bc1){_0x59deb8[_0x9482('0x68')]=_0x3e8bc1;return _0x59deb8;});}})[_0x9482('0x33')](respondWithFilteredResult(_0x5b8855,_0x2b7bb5))[_0x9482('0x25')](handleError(_0x5b8855,null));};exports[_0x9482('0x6e')]=function(_0x9e51af,_0x4d425e,_0x42e968){return db[_0x9482('0x51')][_0x9482('0x56')]({'where':{'id':_0x9e51af[_0x9482('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4d425e,null))['then'](function(_0x182e5e){if(_0x182e5e){return _0x182e5e['removeAnswers'](_0x9e51af['query'][_0x9482('0x6f')]);}})[_0x9482('0x33')](respondWithStatusCode(_0x4d425e,null))['catch'](handleError(_0x4d425e,null));};exports[_0x9482('0x70')]=function(_0x578340,_0x194d83,_0x4e47c2){return db[_0x9482('0x71')][_0x9482('0x56')]({'where':{'id':_0x578340[_0x9482('0x5f')]['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x194d83,null))['then'](function(_0x5b8355){if(_0x5b8355){return _0x5b8355['addInteraction'](_0x578340[_0x9482('0x58')][_0x9482('0x6f')],_[_0x9482('0x72')](_0x578340[_0x9482('0x58')],[_0x9482('0x6f'),'id'])||{});}})[_0x9482('0x33')](respondWithResult(_0x194d83,null))[_0x9482('0x25')](handleError(_0x194d83,null));};exports[_0x9482('0x73')]=function(_0xc0b020,_0x108810,_0xdc8127){var _0x212727={'raw':![],'where':{}};var _0x3cc4fd={};var _0x471a4b={'count':0x0,'rows':[]};return db[_0x9482('0x51')][_0x9482('0x6d')]({'where':{'id':_0xc0b020[_0x9482('0x5f')]['id']}})['then'](handleEntityNotFound(_0x108810,null))[_0x9482('0x33')](function(_0x301f38){if(_0x301f38){_0x3cc4fd[_0x9482('0x42')]=_[_0x9482('0x44')](db[_0x9482('0x71')][_0x9482('0x3e')]);_0x3cc4fd[_0x9482('0x43')]=_[_0x9482('0x44')](_0xc0b020[_0x9482('0x43')]);_0x3cc4fd[_0x9482('0x45')]=_[_0x9482('0x46')](_0x3cc4fd[_0x9482('0x42')],_0x3cc4fd[_0x9482('0x43')]);_0x212727[_0x9482('0x47')]=_[_0x9482('0x46')](_0x3cc4fd[_0x9482('0x42')],qs[_0x9482('0x48')](_0xc0b020[_0x9482('0x43')][_0x9482('0x48')]));_0x212727[_0x9482('0x47')]=_0x212727[_0x9482('0x47')][_0x9482('0x49')]?_0x212727['attributes']:_0x3cc4fd[_0x9482('0x42')];if(!_0xc0b020[_0x9482('0x43')]['hasOwnProperty'](_0x9482('0x74'))){_0x212727['limit']=qs['limit'](_0xc0b020['query'][_0x9482('0x2b')]);_0x212727[_0x9482('0x29')]=qs['offset'](_0xc0b020[_0x9482('0x43')][_0x9482('0x29')]);}_0x212727['order']=qs[_0x9482('0x65')](_0xc0b020[_0x9482('0x43')][_0x9482('0x65')]);_0x212727['where']=qs['filters'](_['pick'](_0xc0b020[_0x9482('0x43')],_0x3cc4fd['filters']));_0x212727[_0x9482('0x66')][_0x9482('0x62')]=_0x301f38['id'];if(_0xc0b020['query']['filter']){_0x212727[_0x9482('0x66')]=_[_0x9482('0x4e')](_0x212727[_0x9482('0x66')],{'$or':_[_0x9482('0x3d')](_0x212727[_0x9482('0x47')],function(_0x249d34){var _0x247dc8={};_0x247dc8[_0x249d34]={'$like':'%'+_0xc0b020[_0x9482('0x43')][_0x9482('0x4d')]+'%'};return _0x247dc8;})});}_0x212727=_[_0x9482('0x4e')]({},_0x212727,_0xc0b020[_0x9482('0x50')]);return db[_0x9482('0x71')][_0x9482('0x2c')]({'where':_0x212727[_0x9482('0x66')]})['then'](function(_0x304048){_0x471a4b[_0x9482('0x2c')]=_0x304048;if(_0xc0b020[_0x9482('0x43')][_0x9482('0x54')]){_0x212727[_0x9482('0x55')]=[{'model':db[_0x9482('0x75')],'as':_0x9482('0x76'),'required':![]},{'model':db['User'],'as':_0x9482('0x77'),'attributes':[_0x9482('0x39'),'fullname',_0x9482('0x78')],'required':![]},{'model':db[_0x9482('0x79')],'as':_0x9482('0x7a'),'attributes':['id','name',_0x9482('0x7b')],'where':_0xc0b020[_0x9482('0x43')]['tag']?{'id':_0xc0b020[_0x9482('0x43')]['tag']}:undefined,'required':_0xc0b020['query'][_0x9482('0x7c')]?!![]:![]}];}return db[_0x9482('0x71')][_0x9482('0x67')](_0x212727);})[_0x9482('0x33')](function(_0x86e26){_0x471a4b[_0x9482('0x68')]=_0x86e26;return _0x471a4b;});}})[_0x9482('0x33')](respondWithFilteredResult(_0x108810,_0x212727))[_0x9482('0x25')](handleError(_0x108810,null));};exports[_0x9482('0x7d')]=function(_0x48a309,_0x3477d0){var _0x471920=_0x48a309[_0x9482('0x5f')]['id'];var _0x3207d3=_0x48a309[_0x9482('0x58')];var _0x510c7f=0xc8;var _0x1c47ae=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x9482('0x7e')][_0x9482('0x7f')][_0x9482('0x80')][_0x9482('0x81')]},function(_0x125bb5){return db[_0x9482('0x51')][_0x9482('0x6d')]({'where':{'id':_0x471920},'transaction':_0x125bb5})[_0x9482('0x33')](function(_0x551e76){if(_0x551e76){return db[_0x9482('0x82')][_0x9482('0x34')]({'where':{'FaxAccountId':_0x471920},'transaction':_0x125bb5})[_0x9482('0x33')](function(){var _0x42f1e8=_['map'](_0x3207d3,function(_0xbf3a46){_0xbf3a46['FaxAccountId']=_0x471920;return _0xbf3a46;});return db[_0x9482('0x82')]['bulkCreate'](_0x42f1e8,{'transaction':_0x125bb5});});}else{_0x510c7f=0x194;_0x1c47ae=[];}});})['then'](function(){if(_0x510c7f!==0x194){return db[_0x9482('0x82')][_0x9482('0x83')]({'where':{'FaxAccountId':_0x471920},'order':_0x9482('0x84')})[_0x9482('0x33')](function(_0x4641d1){_0x1c47ae=_0x4641d1;});}})[_0x9482('0x25')](function(_0x9dd552){_0x510c7f=0x1f4;logger['error'](_0x9dd552[_0x9482('0x38')]);if(_0x9dd552['name']){delete _0x9dd552[_0x9482('0x39')];}_0x1c47ae=_0x9dd552;})['finally'](function(){if(_0x1c47ae===null){_0x3477d0[_0x9482('0x85')](_0x510c7f);}else{if(_0x510c7f===0x1f4){_0x3477d0[_0x9482('0x26')](_0x510c7f)[_0x9482('0x3a')](_0x1c47ae);}else{_0x3477d0['status'](_0x510c7f)['json'](_0x1c47ae);}}});};exports[_0x9482('0x86')]=function(_0x3e7064,_0x595f4c,_0x465b21){var _0x5b971e={};var _0x323fec={};var _0x137c96;var _0x3d2e64;return db[_0x9482('0x51')][_0x9482('0x6d')]({'where':{'id':_0x3e7064[_0x9482('0x5f')]['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x595f4c,null))['then'](function(_0x320faa){if(_0x320faa){_0x137c96=_0x320faa;_0x323fec['model']=_[_0x9482('0x44')](db[_0x9482('0x82')]['rawAttributes']);_0x323fec['query']=_['keys'](_0x3e7064[_0x9482('0x43')]);_0x323fec[_0x9482('0x45')]=_[_0x9482('0x46')](_0x323fec[_0x9482('0x42')],_0x323fec['query']);_0x5b971e[_0x9482('0x47')]=_[_0x9482('0x46')](_0x323fec[_0x9482('0x42')],qs['fields'](_0x3e7064[_0x9482('0x43')][_0x9482('0x48')]));_0x5b971e[_0x9482('0x47')]=_0x5b971e[_0x9482('0x47')][_0x9482('0x49')]?_0x5b971e[_0x9482('0x47')]:_0x323fec[_0x9482('0x42')];_0x5b971e[_0x9482('0x4b')]=qs[_0x9482('0x65')](_0x3e7064['query'][_0x9482('0x65')]);_0x5b971e[_0x9482('0x66')]=qs[_0x9482('0x45')](_[_0x9482('0x4c')](_0x3e7064[_0x9482('0x43')],_0x323fec['filters']));if(_0x3e7064[_0x9482('0x43')][_0x9482('0x4d')]){_0x5b971e['where']=_['merge'](_0x5b971e[_0x9482('0x66')],{'$or':_[_0x9482('0x3d')](_0x5b971e[_0x9482('0x47')],function(_0x44a5a9){var _0x5cdd7d={};_0x5cdd7d[_0x44a5a9]={'$like':'%'+_0x3e7064[_0x9482('0x43')][_0x9482('0x4d')]+'%'};return _0x5cdd7d;})});}_0x5b971e=_[_0x9482('0x4e')]({},_0x5b971e,_0x3e7064[_0x9482('0x50')]);return _0x137c96[_0x9482('0x86')](_0x5b971e);}})['then'](function(_0x244808){if(_0x244808){_0x3d2e64=_0x244808[_0x9482('0x49')];if(!_0x3e7064[_0x9482('0x43')][_0x9482('0x4a')](_0x9482('0x74'))){_0x5b971e[_0x9482('0x2b')]=qs[_0x9482('0x2b')](_0x3e7064[_0x9482('0x43')][_0x9482('0x2b')]);_0x5b971e['offset']=qs[_0x9482('0x29')](_0x3e7064[_0x9482('0x43')]['offset']);}return _0x137c96['getApplications'](_0x5b971e);}})[_0x9482('0x33')](function(_0x5ab2d8){if(_0x5ab2d8){return _0x5ab2d8?{'count':_0x3d2e64,'rows':_0x5ab2d8}:null;}})['then'](respondWithResult(_0x595f4c,null))[_0x9482('0x25')](handleError(_0x595f4c,null));};function Extension(_0x57b281,_0x78b66,_0x113c5a,_0x1300c3){this['context']=_0x9482('0x87');this[_0x9482('0x88')]=_0x57b281[_0x9482('0x89')];this[_0x9482('0x8a')]=_0x1300c3;this[_0x9482('0x40')]=_0x9482('0x8b');this[_0x9482('0x8c')]=_0x9482('0x8d');this[_0x9482('0x62')]=_0x57b281['id'];this[_0x9482('0x84')]=_0x78b66;this['appdata']=_0x113c5a;}function createExtensionsReciveFax(_0x283f0a){var _0x41904c=0x1;var _0x1878a7=[];_0x1878a7[_0x9482('0x8e')](new Extension(_0x283f0a,_0x41904c,'',_0x9482('0x8f')));_0x41904c+=0x1;_0x1878a7[_0x9482('0x8e')](new Extension(_0x283f0a,_0x41904c,_0x9482('0x90'),_0x9482('0x91')));_0x41904c+=0x1;for(var _0x364ff4 in _0x283f0a){if(_0x283f0a[_0x9482('0x4a')](_0x364ff4)&&(_0x364ff4===_0x9482('0x92')||_0x364ff4===_0x9482('0x89')||_0x364ff4==='gateway'||_0x364ff4===_0x9482('0x93')||_0x364ff4===_0x9482('0x94')||_0x364ff4===_0x9482('0x95')||_0x364ff4===_0x9482('0x96')||_0x364ff4===_0x9482('0x97')||_0x364ff4==='t38timeout')){_0x1878a7[_0x9482('0x8e')](new Extension(_0x283f0a,_0x41904c,'FAXOPT('+_0x364ff4+')='+_0x283f0a[_0x364ff4],_0x9482('0x91')));_0x41904c+=0x1;}}_0x1878a7['push'](new Extension(_0x283f0a,_0x41904c,'6','Wait'));_0x41904c+=0x1;_0x1878a7[_0x9482('0x8e')](new Extension(_0x283f0a,_0x41904c,'/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',_0x9482('0x98')));_0x41904c=0x0;return _0x1878a7;}exports[_0x9482('0x99')]=function(_0x21b4ee,_0x1c24f7,_0x265ee6){var _0x291dd4;return db[_0x9482('0x7e')][_0x9482('0x9a')](function(_0x2fbb94){return db[_0x9482('0x51')][_0x9482('0x57')](_0x21b4ee[_0x9482('0x58')],{'transaction':_0x2fbb94})[_0x9482('0x33')](function(_0x5a7a7a){_0x291dd4=_0x5a7a7a[_0x9482('0x35')]({'plain':!![]});return db[_0x9482('0x9b')][_0x9482('0x9c')](createExtensionsReciveFax(_0x291dd4),{'transaction':_0x2fbb94});});})[_0x9482('0x33')](function(){return _0x291dd4;})[_0x9482('0x33')](respondWithResult(_0x1c24f7,null))[_0x9482('0x25')](handleError(_0x1c24f7,null));};exports[_0x9482('0x9d')]=function(_0x30d3c4,_0x4ae581,_0x4fa234){var _0x4c86b8;return db[_0x9482('0x7e')]['transaction'](function(_0x5667ea){return db[_0x9482('0x51')][_0x9482('0x32')](_0x30d3c4[_0x9482('0x58')],{'where':{'id':_0x30d3c4[_0x9482('0x58')]['id']},'transaction':_0x5667ea})[_0x9482('0x33')](function(_0x365ba0){return db[_0x9482('0x9b')][_0x9482('0x34')]({'where':{'FaxAccountId':_0x30d3c4[_0x9482('0x58')]['id']},'transaction':_0x5667ea})[_0x9482('0x33')](function(_0x13dfd0){return db[_0x9482('0x9b')][_0x9482('0x9c')](createExtensionsReciveFax(_['omit'](_0x30d3c4[_0x9482('0x58')],[_0x9482('0x9e'),_0x9482('0x41'),_0x9482('0x9f'),_0x9482('0xa0'),_0x9482('0xa1'),'ListId'])),{'transaction':_0x5667ea});});});})['then'](function(){return db[_0x9482('0x51')][_0x9482('0xa2')](_0x30d3c4[_0x9482('0x58')]['id']);})['then'](respondWithResult(_0x4ae581,null))['catch'](handleError(_0x4ae581,null));};exports[_0x9482('0xa3')]=function(_0x11a332,_0x417931,_0x543bcf){var _0x5e0129={'raw':!![],'where':{}};var _0x5ef714={};var _0x2d49ed={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9482('0x6d')]({'where':{'id':_0x11a332[_0x9482('0x5f')]['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x417931,null))['then'](function(_0x146f14){if(_0x146f14){_0x5ef714[_0x9482('0x42')]=_[_0x9482('0x44')](db['FaxMessage']['rawAttributes']);_0x5ef714[_0x9482('0x43')]=_[_0x9482('0x44')](_0x11a332[_0x9482('0x43')]);_0x5ef714[_0x9482('0x45')]=_['intersection'](_0x5ef714['model'],_0x5ef714[_0x9482('0x43')]);_0x5e0129[_0x9482('0x47')]=_[_0x9482('0x46')](_0x5ef714[_0x9482('0x42')],qs['fields'](_0x11a332[_0x9482('0x43')][_0x9482('0x48')]));_0x5e0129[_0x9482('0x47')]=_0x5e0129[_0x9482('0x47')][_0x9482('0x49')]?_0x5e0129['attributes']:_0x5ef714['model'];if(!_0x11a332[_0x9482('0x43')]['hasOwnProperty'](_0x9482('0x74'))){_0x5e0129[_0x9482('0x2b')]=qs['limit'](_0x11a332[_0x9482('0x43')][_0x9482('0x2b')]);_0x5e0129[_0x9482('0x29')]=qs[_0x9482('0x29')](_0x11a332['query'][_0x9482('0x29')]);}_0x5e0129[_0x9482('0x4b')]=qs['sort'](_0x11a332[_0x9482('0x43')][_0x9482('0x65')]);_0x5e0129[_0x9482('0x66')]=qs[_0x9482('0x45')](_[_0x9482('0x4c')](_0x11a332[_0x9482('0x43')],_0x5ef714[_0x9482('0x45')]));_0x5e0129['where'][_0x9482('0x62')]=_0x146f14['id'];if(_0x11a332[_0x9482('0x43')][_0x9482('0x4d')]){_0x5e0129[_0x9482('0x66')]=_[_0x9482('0x4e')](_0x5e0129[_0x9482('0x66')],{'$or':_['map'](_0x5e0129[_0x9482('0x47')],function(_0x141ee5){var _0x104db7={};_0x104db7[_0x141ee5]={'$like':'%'+_0x11a332['query'][_0x9482('0x4d')]+'%'};return _0x104db7;})});}if(_0x11a332['query'][_0x9482('0xa4')]){var _0x9a0a31=_0x11a332[_0x9482('0x43')][_0x9482('0xa4')][_0x9482('0xa5')](',');var _0x131b4c={};_0x131b4c[_0x9a0a31[0x0]]={'$gte':moment(_0x9a0a31[0x1])['format'](_0x9482('0xa6'))};_0x5e0129[_0x9482('0x66')]=_[_0x9482('0x4e')](_0x5e0129[_0x9482('0x66')],_0x131b4c);}_0x5e0129=_[_0x9482('0x4e')]({},_0x5e0129,_0x11a332[_0x9482('0x50')]);return db['FaxMessage'][_0x9482('0x2c')]({'where':_0x5e0129[_0x9482('0x66')]})['then'](function(_0x2ba8c5){_0x2d49ed[_0x9482('0x2c')]=_0x2ba8c5;if(_0x11a332[_0x9482('0x43')]['includeAll']){_0x5e0129['include']=[{'all':!![]}];}return db[_0x9482('0xa7')][_0x9482('0x67')](_0x5e0129);})[_0x9482('0x33')](function(_0x16b847){_0x2d49ed[_0x9482('0x68')]=_0x16b847;return _0x2d49ed;});}})[_0x9482('0x33')](respondWithFilteredResult(_0x417931,_0x5e0129))['catch'](handleError(_0x417931,null));};exports['send']=function(_0xb5450d,_0x1b9d8c,_0x5846be){var _0x200f9e,_0xdafdbd={},_0x4e338c;if(_0xb5450d[_0x9482('0x58')]['to']){_0x4e338c=_0xb5450d['body']['to'][0x0];}return db[_0x9482('0x51')][_0x9482('0x56')]({'where':{'id':_0xb5450d['params']['id']},'include':[{'model':db[_0x9482('0xa8')],'as':_0x9482('0xa9'),'include':[{'model':db['CmContact'],'as':_0x9482('0xaa'),'where':{'fax':_0x4e338c},'limit':0x1,'order':[[_0x9482('0xa0'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x1b9d8c,null))[_0x9482('0x33')](function(_0x368bda){_0x200f9e=_0x368bda;if(_0xb5450d['body'][_0x9482('0xab')]&&_0xb5450d[_0x9482('0x58')][_0x9482('0xab')][_0x9482('0x49')]){for(var _0x4a5cd4=0x0;_0x4a5cd4<_0xb5450d['body'][_0x9482('0xab')]['length'];_0x4a5cd4+=0x1){_0xb5450d[_0x9482('0x58')][_0x9482('0xab')][_0x4a5cd4]={'filename':_0xb5450d[_0x9482('0x58')][_0x9482('0xab')][_0x4a5cd4]['name'],'id':_0xb5450d[_0x9482('0x58')]['attachments'][_0x4a5cd4]['id'],'path':path[_0x9482('0xac')](config[_0x9482('0xad')],_0x9482('0xae'),_0xb5450d[_0x9482('0x58')]['attachments'][_0x4a5cd4][_0x9482('0xaf')])};}}return respondWithRpcPromise(_0x9482('0xb0'),_0x9482('0xb0'),{'FaxAccountId':_[_0x9482('0xb1')](_0xb5450d[_0x9482('0x5f')]['id'])?undefined:_0xb5450d[_0x9482('0x5f')]['id'],'path':_[_0x9482('0xb1')](_0xb5450d[_0x9482('0x58')][_0x9482('0xab')][0x0][_0x9482('0x3')])?undefined:_0xb5450d[_0x9482('0x58')][_0x9482('0xab')][0x0][_0x9482('0x3')],'fax':_['isNil'](_0xb5450d[_0x9482('0x58')]['to'][0x0])?undefined:_0xb5450d[_0x9482('0x58')]['to'][0x0]},client9002);})['then'](function(){if(_0x200f9e){if(_['isNil'](_0xb5450d['body'][_0x9482('0xb2')])){_0xb5450d[_0x9482('0x58')][_0x9482('0xb2')]=util[_0x9482('0xb3')]('\x22%s\x22\x20<%s>',_0x200f9e['name'],_0x200f9e['fax']);}if(_0x200f9e[_0x9482('0xa9')]){if(_0x200f9e[_0x9482('0xa9')][_0x9482('0xaa')][_0x9482('0x49')]){return _0x200f9e[_0x9482('0xa9')][_0x9482('0xaa')][0x0];}else{return db[_0x9482('0x75')]['create'](_[_0x9482('0xb4')](_0xb5450d[_0x9482('0x58')],{'firstName':_0xb5450d[_0x9482('0x58')]['to'][0x0],'phone':_0xb5450d[_0x9482('0x58')]['to'][0x0],'fax':_0xb5450d['body']['to'][0x0],'ListId':_0x200f9e['ListId']}));}}else{throw new Error(_0x9482('0xb5'));}}else{throw new Error(_0x9482('0xb6'));}})['then'](function(_0x524dfc){if(_0x524dfc){return db[_0x9482('0x71')][_0x9482('0x56')]({'where':{'ContactId':_0x524dfc['id'],'closed':![],'FaxAccountId':_0x200f9e['id']}})[_0x9482('0x33')](function(_0x18701c){if(_0x18701c){return[_0x18701c,![]];}return db[_0x9482('0x71')][_0x9482('0x57')]({'UserId':_0xb5450d['user']['id'],'ContactId':_0x524dfc['id'],'FaxAccountId':_0x200f9e['id'],'fax':_0xb5450d[_0x9482('0x58')]['to'][0x0],'firstMsgDirection':_0x9482('0xb7'),'Messages':[_[_0x9482('0x4e')](_0xb5450d['body'],{'read':![],'body':_0xb5450d['body']['attachments'][0x0]['filename'],'FaxAccountId':_0x200f9e['id'],'UserId':_0xb5450d[_0x9482('0x59')]['id'],'ContactId':_0x524dfc['id'],'AttachmentId':_0xb5450d[_0x9482('0x58')][_0x9482('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x9482('0xa7')],'as':'Messages'}]})[_0x9482('0x33')](function(_0x2f57ea){return[_0x2f57ea,!![]];});});}else{throw new Error(_0x9482('0xb8'));}})[_0x9482('0xb9')](function(_0x20dab3,_0x18857a){if(_0x18857a){return _0x20dab3;}return db[_0x9482('0xa7')][_0x9482('0x57')]({'direction':_0x9482('0xb7'),'read':![],'body':_0xb5450d[_0x9482('0x58')]['attachments'][0x0]['filename'],'FaxAccountId':_0x200f9e['id'],'FaxInteractionId':_0x20dab3['id'],'UserId':_0xb5450d['user']['id'],'ContactId':_0x20dab3['ContactId'],'AttachmentId':_0xb5450d[_0x9482('0x58')][_0x9482('0xab')][0x0]['id']})['then'](function(_0x167aee){_0x20dab3[_0x9482('0xba')]['Messages']=[];_0x20dab3[_0x9482('0xba')][_0x9482('0xbb')][_0x9482('0x8e')](_0x167aee[_0x9482('0xba')]);return _0x20dab3;});})[_0x9482('0x33')](function(_0x24a59){respondWithRpcPromise(_0x9482('0xbc'),_0x9482('0xbc'),{'FaxAccountId':_[_0x9482('0xb1')](_0xb5450d[_0x9482('0x5f')]['id'])?undefined:_0xb5450d[_0x9482('0x5f')]['id'],'path':_[_0x9482('0xb1')](_0xb5450d[_0x9482('0x58')]['attachments'][0x0][_0x9482('0x3')])?undefined:_0xb5450d['body'][_0x9482('0xab')][0x0][_0x9482('0x3')],'fax':_['isNil'](_0xb5450d[_0x9482('0x58')]['to'][0x0])?undefined:_0xb5450d[_0x9482('0x58')]['to'][0x0],'AttachmentId':_0xb5450d[_0x9482('0x58')][_0x9482('0xab')][0x0]['id']},client9002)[_0x9482('0x33')](function(_0x51848b){logger[_0x9482('0x1d')]('SendFaxRpc,\x20%s',_0x51848b);})[_0x9482('0x25')](function(_0x330200){logger[_0x9482('0x1d')]('SendFaxRpc,\x20%s',_0x330200);});return _0x24a59;})['then'](respondWithResult(_0x1b9d8c,null))[_0x9482('0x25')](handleError(_0x1b9d8c,null));};exports[_0x9482('0xbd')]=function(_0x449469,_0x523ac6,_0x406c6b){return db[_0x9482('0x51')]['find']({'where':{'id':_0x449469['params']['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x523ac6,null))[_0x9482('0x33')](function(_0x380b8c){if(_0x380b8c){return _0x380b8c[_0x9482('0xbd')](_0x449469[_0x9482('0x58')][_0x9482('0x6f')],_[_0x9482('0x72')](_0x449469['body'],['ids','id'])||{})[_0x9482('0xb9')](function(_0x2ae864){for(var _0x5394c1=0x0;_0x5394c1<_0x449469[_0x9482('0x58')][_0x9482('0x6f')]['length'];_0x5394c1+=0x1){socket[_0x9482('0xbe')](_0x9482('0xbf'),{'UserId':Number(_0x449469[_0x9482('0x58')]['ids'][_0x5394c1]),'FaxAccountId':Number(_0x449469[_0x9482('0x5f')]['id'])});}return _0x2ae864;});}})['then'](respondWithResult(_0x523ac6,null))[_0x9482('0x25')](handleError(_0x523ac6,null));};exports[_0x9482('0xc0')]=function(_0x5d4a07,_0x1c9975,_0x4482d5){return db[_0x9482('0x51')][_0x9482('0x56')]({'where':{'id':_0x5d4a07[_0x9482('0x5f')]['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x1c9975,null))['then'](function(_0x4e1c15){if(_0x4e1c15){return _0x4e1c15[_0x9482('0xc0')](_0x5d4a07[_0x9482('0x43')]['ids'])['then'](function(){if(_[_0x9482('0xc1')](_0x5d4a07[_0x9482('0x43')][_0x9482('0x6f')])){for(var _0x47f0e7=0x0;_0x47f0e7<_0x5d4a07['query']['ids'][_0x9482('0x49')];_0x47f0e7+=0x1){socket[_0x9482('0xbe')](_0x9482('0xc2'),{'UserId':Number(_0x5d4a07['query']['ids'][_0x47f0e7]),'FaxAccountId':Number(_0x5d4a07[_0x9482('0x5f')]['id'])});}}else{socket[_0x9482('0xbe')](_0x9482('0xc2'),{'UserId':Number(_0x5d4a07['query'][_0x9482('0x6f')]),'FaxAccountId':Number(_0x5d4a07['params']['id'])});}});}})[_0x9482('0x33')](respondWithStatusCode(_0x1c9975,null))['catch'](handleError(_0x1c9975,null));};exports['getAgents']=function(_0x44c543,_0x4eecd0,_0x562146){var _0x904ff={};var _0x5531d6={};var _0x1fe74e;var _0x1febd6;return db[_0x9482('0x51')][_0x9482('0x6d')]({'where':{'id':_0x44c543[_0x9482('0x5f')]['id']}})[_0x9482('0x33')](handleEntityNotFound(_0x4eecd0,null))[_0x9482('0x33')](function(_0x1e66fc){if(_0x1e66fc){_0x1fe74e=_0x1e66fc;_0x5531d6['model']=_['keys'](db[_0x9482('0xc3')][_0x9482('0x3e')]);_0x5531d6[_0x9482('0x43')]=_['keys'](_0x44c543['query']);_0x5531d6['filters']=_[_0x9482('0x46')](_0x5531d6[_0x9482('0x42')],_0x5531d6['query']);_0x904ff['attributes']=_[_0x9482('0x46')](_0x5531d6[_0x9482('0x42')],qs[_0x9482('0x48')](_0x44c543[_0x9482('0x43')][_0x9482('0x48')]));_0x904ff[_0x9482('0x47')]=_0x904ff[_0x9482('0x47')][_0x9482('0x49')]?_0x904ff['attributes']:_0x5531d6[_0x9482('0x42')];_0x904ff[_0x9482('0x4b')]=qs[_0x9482('0x65')](_0x44c543['query']['sort']);_0x904ff[_0x9482('0x66')]=qs[_0x9482('0x45')](_[_0x9482('0x4c')](_0x44c543[_0x9482('0x43')],_0x5531d6[_0x9482('0x45')]));if(_0x44c543[_0x9482('0x43')][_0x9482('0x4d')]){_0x904ff[_0x9482('0x66')]=_[_0x9482('0x4e')](_0x904ff[_0x9482('0x66')],{'$or':_[_0x9482('0x3d')](_0x904ff[_0x9482('0x47')],function(_0x2ad703){var _0x29f6b9={};_0x29f6b9[_0x2ad703]={'$like':'%'+_0x44c543[_0x9482('0x43')][_0x9482('0x4d')]+'%'};return _0x29f6b9;})});}_0x904ff=_['merge']({},_0x904ff,_0x44c543[_0x9482('0x50')]);return _0x1fe74e[_0x9482('0xc4')](_0x904ff);}})['then'](function(_0x571efd){if(_0x571efd){_0x1febd6=_0x571efd['length'];if(!_0x44c543[_0x9482('0x43')][_0x9482('0x4a')](_0x9482('0x74'))){_0x904ff['limit']=qs['limit'](_0x44c543[_0x9482('0x43')][_0x9482('0x2b')]);_0x904ff[_0x9482('0x29')]=qs['offset'](_0x44c543[_0x9482('0x43')]['offset']);}return _0x1fe74e['getAgents'](_0x904ff);}})[_0x9482('0x33')](function(_0xeaccda){if(_0xeaccda){return _0xeaccda?{'count':_0x1febd6,'rows':_0xeaccda}:null;}})[_0x9482('0x33')](respondWithResult(_0x4eecd0,null))[_0x9482('0x25')](handleError(_0x4eecd0,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 047ed2a..40d311b 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 _0x9648=['remove','emit','hasOwnProperty','hook','events','FaxAccount','save','update'];(function(_0x582ec1,_0x1867d1){var _0x2695fa=function(_0xac5620){while(--_0xac5620){_0x582ec1['push'](_0x582ec1['shift']());}};_0x2695fa(++_0x1867d1);}(_0x9648,0xa4));var _0x8964=function(_0x234c03,_0x46ea53){_0x234c03=_0x234c03-0x0;var _0x2990fc=_0x9648[_0x234c03];return _0x2990fc;};'use strict';var EventEmitter=require(_0x8964('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x8964('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8964('0x2'),'afterUpdate':_0x8964('0x3'),'afterDestroy':_0x8964('0x4')};function emitEvent(_0x3c207d){return function(_0x577fd5,_0x3077af,_0x1ad783){FaxAccountEvents[_0x8964('0x5')](_0x3c207d+':'+_0x577fd5['id'],_0x577fd5);FaxAccountEvents[_0x8964('0x5')](_0x3c207d,_0x577fd5);_0x1ad783(null);};}for(var e in events){if(events[_0x8964('0x6')](e)){var event=events[e];FaxAccount[_0x8964('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x74ec=['FaxAccount','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x44c25a,_0x3ca6e5){var _0x4f804f=function(_0x18d1a6){while(--_0x18d1a6){_0x44c25a['push'](_0x44c25a['shift']());}};_0x4f804f(++_0x3ca6e5);}(_0x74ec,0x1de));var _0xc74e=function(_0x4ec19c,_0x4fb135){_0x4ec19c=_0x4ec19c-0x0;var _0x150d6f=_0x74ec[_0x4ec19c];return _0x150d6f;};'use strict';var EventEmitter=require(_0xc74e('0x0'));var FaxAccount=require(_0xc74e('0x1'))['db'][_0xc74e('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc74e('0x3'),'afterUpdate':_0xc74e('0x4'),'afterDestroy':_0xc74e('0x5')};function emitEvent(_0x346fc5){return function(_0x1a9f8f,_0x3b1826,_0x1f3c58){FaxAccountEvents[_0xc74e('0x6')](_0x346fc5+':'+_0x1a9f8f['id'],_0x1a9f8f);FaxAccountEvents[_0xc74e('0x6')](_0x346fc5,_0x1a9f8f);_0x1f3c58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xc74e('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 2f8fb9b..8e96b1d 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 _0x6cd4=['request-promise','../../config/environment','./faxAccount.attributes','define','FaxAccount','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6cd4,0x16d));var _0x46cd=function(_0x2be614,_0x3891a6){_0x2be614=_0x2be614-0x0;var _0x163a7c=_0x6cd4[_0x2be614];return _0x163a7c;};'use strict';var _=require(_0x46cd('0x0'));var util=require('util');var logger=require(_0x46cd('0x1'))(_0x46cd('0x2'));var moment=require(_0x46cd('0x3'));var BPromise=require(_0x46cd('0x4'));var rp=require(_0x46cd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x46cd('0x6'));var attributes=require(_0x46cd('0x7'));module['exports']=function(_0x24e442,_0x1cec4c){return _0x24e442[_0x46cd('0x8')](_0x46cd('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd44d=['./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','api','moment','bluebird','path','rimraf'];(function(_0x33e921,_0x4a3634){var _0x10cdda=function(_0x10c16a){while(--_0x10c16a){_0x33e921['push'](_0x33e921['shift']());}};_0x10cdda(++_0x4a3634);}(_0xd44d,0x144));var _0xdd44=function(_0x294d29,_0x3e1504){_0x294d29=_0x294d29-0x0;var _0x35957a=_0xd44d[_0x294d29];return _0x35957a;};'use strict';var _=require('lodash');var util=require(_0xdd44('0x0'));var logger=require('../../config/logger')(_0xdd44('0x1'));var moment=require(_0xdd44('0x2'));var BPromise=require(_0xdd44('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd44('0x4'));var rimraf=require(_0xdd44('0x5'));var config=require('../../config/environment');var attributes=require(_0xdd44('0x6'));module[_0xdd44('0x7')]=function(_0x253121,_0x4a6cc3){return _0x253121[_0xdd44('0x8')](_0xdd44('0x9'),attributes,{'tableName':_0xdd44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 9f6391f..4f9d274 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 _0x192a=['contact','fax','FaxInteraction','Contact\x20not\x20found','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','UserId','unshift','agent','name','waitForTheAssignedAgent','queueId','FaxQueue','queue','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxAccount','findAll','options','attributes','include','map','model','debug','GetFaxAccount','NotifyFaxAccount','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','applications','Applications','list','orderBy','asc','length','defaults','create'];(function(_0x4b78d2,_0x4691de){var _0x599eca=function(_0x145bae){while(--_0x145bae){_0x4b78d2['push'](_0x4b78d2['shift']());}};_0x599eca(++_0x4691de);}(_0x192a,0xd0));var _0xa192=function(_0x4c5c71,_0x41cef7){_0x4c5c71=_0x4c5c71-0x0;var _0x136eed=_0x192a[_0x4c5c71];return _0x136eed;};'use strict';var _=require(_0xa192('0x0'));var util=require(_0xa192('0x1'));var moment=require(_0xa192('0x2'));var BPromise=require('bluebird');var rs=require(_0xa192('0x3'));var fs=require('fs');var Redis=require(_0xa192('0x4'));var db=require(_0xa192('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa192('0x6'));var config=require(_0xa192('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa192('0x8')][_0xa192('0x9')]({'port':0x232c});config[_0xa192('0xa')]=_['defaults'](config[_0xa192('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa192('0xb'))(new Redis(config[_0xa192('0xa')]));require(_0xa192('0xc'))[_0xa192('0xd')](socket);function respondWithRpcPromise(_0x433faa,_0x33fc0f,_0x5efe04){return new BPromise(function(_0x4adc74,_0x130fc9){return client[_0xa192('0xe')](_0x433faa,_0x5efe04)[_0xa192('0xf')](function(_0x21661c){logger[_0xa192('0x10')](_0xa192('0x11'),_0x33fc0f,_0xa192('0x12'));logger['debug'](_0xa192('0x13'),_0x33fc0f,_0xa192('0x12'),JSON[_0xa192('0x14')](_0x21661c));if(_0x21661c[_0xa192('0x15')]){if(_0x21661c[_0xa192('0x15')]['code']===0x1f4){logger[_0xa192('0x15')](_0xa192('0x11'),_0x33fc0f,_0x21661c[_0xa192('0x15')][_0xa192('0x16')]);return _0x130fc9(_0x21661c['error'][_0xa192('0x16')]);}logger[_0xa192('0x15')]('FaxAccount,\x20%s,\x20%s',_0x33fc0f,_0x21661c[_0xa192('0x15')]['message']);return _0x4adc74(_0x21661c[_0xa192('0x15')]['message']);}else{logger[_0xa192('0x10')]('FaxAccount,\x20%s,\x20%s',_0x33fc0f,_0xa192('0x12'));_0x4adc74(_0x21661c[_0xa192('0x17')]['message']);}})[_0xa192('0x18')](function(_0x29d211){logger['error'](_0xa192('0x11'),_0x33fc0f,_0x29d211);_0x130fc9(_0x29d211);});});}exports['GetFaxAccount']=function(_0x3958aa){var _0x396fa7=this;return new Promise(function(_0x47bf4b,_0x37cb6e){return db[_0xa192('0x19')][_0xa192('0x1a')]({'raw':_0x3958aa[_0xa192('0x1b')]?_0x3958aa[_0xa192('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3958aa[_0xa192('0x1b')]?_0x3958aa[_0xa192('0x1b')]['where']||null:null,'attributes':_0x3958aa[_0xa192('0x1b')]?_0x3958aa[_0xa192('0x1b')][_0xa192('0x1c')]||null:null,'limit':_0x3958aa['options']?_0x3958aa[_0xa192('0x1b')]['limit']||null:null,'include':_0x3958aa[_0xa192('0x1b')]?_0x3958aa['options'][_0xa192('0x1d')]?_[_0xa192('0x1e')](_0x3958aa['options'][_0xa192('0x1d')],function(_0x46c7b3){return{'model':db[_0x46c7b3[_0xa192('0x1f')]],'as':_0x46c7b3['as'],'attributes':_0x46c7b3[_0xa192('0x1c')],'include':_0x46c7b3[_0xa192('0x1d')]?_['map'](_0x46c7b3['include'],function(_0x55c617){return{'model':db[_0x55c617[_0xa192('0x1f')]],'as':_0x55c617['as'],'attributes':_0x55c617[_0xa192('0x1c')],'include':_0x55c617[_0xa192('0x1d')]?_[_0xa192('0x1e')](_0x55c617[_0xa192('0x1d')],function(_0x19659e){return{'model':db[_0x19659e['model']],'as':_0x19659e['as'],'attributes':_0x19659e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b68d1){logger['info']('GetFaxAccount',_0x3958aa);logger[_0xa192('0x20')](_0xa192('0x21'),_0x3958aa,JSON['stringify'](_0x1b68d1));_0x47bf4b(_0x1b68d1);})[_0xa192('0x18')](function(_0x56c575){logger[_0xa192('0x15')](_0xa192('0x21'),_0x56c575['message'],_0x3958aa);_0x37cb6e(_0x396fa7[_0xa192('0x15')](0x1f4,_0x56c575[_0xa192('0x16')]));});});};exports[_0xa192('0x22')]=function(_0x32593c,_0x116c0f,_0x58726b){var _0x273fe7=this;return new Promise(function(_0x392da2,_0x5a8f12){var _0x5d7fa5={'body':_0x32593c['body'],'channel':'fax'};var _0xe94785=[];var _0x3ef61e=[];var _0x39e29f={};return db[_0xa192('0x23')][_0xa192('0x24')]()[_0xa192('0xf')](function(_0x17a34f){if(!_0x17a34f){throw new db[(_0xa192('0x25'))][(_0xa192('0x26'))](_0xa192('0x27'));}_0xe94785=_[_0xa192('0x28')](_[_0xa192('0x29')](_0x17a34f),[_0xa192('0x2a'),'updatedAt']);_0x3ef61e=_['difference'](_[_0xa192('0x29')](_0x17a34f),[_0xa192('0x2a'),_0xa192('0x2b'),_0xa192('0x2c'),'ListId']);if(_0x32593c[_0xa192('0x2d')]['id']){delete _0x32593c[_0xa192('0x2d')]['id'];}if(_[_0xa192('0x2e')](_0x32593c[_0xa192('0x2d')][_0xa192('0x2f')])){throw new db['Sequelize'][(_0xa192('0x26'))](_0xa192('0x30'));}if(_[_0xa192('0x2e')](_0x32593c['body']['body'])||_0x32593c[_0xa192('0x2d')][_0xa192('0x2d')]===''){throw new db[(_0xa192('0x25'))]['ValidationError'](_0xa192('0x31'));}if(_['isNil'](_0x32593c['body'][_0xa192('0x32')])){throw new db[(_0xa192('0x25'))][(_0xa192('0x26'))](_0xa192('0x33')+_0x3ef61e);}if(!_[_0xa192('0x34')](_0x3ef61e,_0x32593c[_0xa192('0x2d')][_0xa192('0x32')])){throw new db['Sequelize'][(_0xa192('0x26'))](_0xa192('0x35')+_0x3ef61e);}_0x39e29f[_0x32593c['body'][_0xa192('0x32')]]=_0x32593c[_0xa192('0x2d')][_0xa192('0x2f')];})[_0xa192('0xf')](function(){return db[_0xa192('0x19')][_0xa192('0x36')]({'where':{'id':_0x32593c[_0xa192('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0xa192('0x38'),'include':[{'model':db[_0xa192('0x23')],'as':_0xa192('0x39'),'where':_0x39e29f,'limit':0x1,'order':[['updatedAt',_0xa192('0x3a')]]}]},{'model':db[_0xa192('0x3b')],'as':'Applications'}]});})[_0xa192('0xf')](function(_0x334e10){if(_0x334e10&&_0x334e10[_0xa192('0x38')]){var _0x38c176=_0x334e10['get']({'plain':!![]});_0x5d7fa5[_0xa192('0x37')]=_0x38c176;_0x5d7fa5[_0xa192('0x3c')]=_0x38c176[_0xa192('0x3d')];_0x5d7fa5[_0xa192('0x3e')]=_0x38c176[_0xa192('0x38')];_0x5d7fa5[_0xa192('0x3c')]=_[_0xa192('0x3f')](_0x5d7fa5[_0xa192('0x3c')],['priority'],[_0xa192('0x40')]);if(_0x5d7fa5[_0xa192('0x37')][_0xa192('0x3d')]){delete _0x5d7fa5[_0xa192('0x37')][_0xa192('0x3d')];}if(_0x5d7fa5['account'][_0xa192('0x38')]&&_0x5d7fa5[_0xa192('0x37')][_0xa192('0x38')][_0xa192('0x39')][_0xa192('0x41')]){return _0x5d7fa5[_0xa192('0x37')][_0xa192('0x38')]['Contacts'][0x0];}var _0x5806b7=_[_0xa192('0x42')](_0x32593c['body'],{'firstName':_0x32593c[_0xa192('0x2d')][_0xa192('0x2f')],'ListId':_0x38c176['ListId']});_0x5806b7[_0x32593c[_0xa192('0x2d')]['mapKey']]=_0x32593c[_0xa192('0x2d')][_0xa192('0x2f')];return db[_0xa192('0x23')][_0xa192('0x43')](_0x5806b7,{'fields':_0xe94785,'raw':!![]});}})[_0xa192('0xf')](function(_0x28dc7b){_0x5d7fa5[_0xa192('0x44')]=_0x28dc7b;if(_0x28dc7b){var _0x20c55e={'ContactId':_0x28dc7b['id'],'FaxAccountId':_0x32593c[_0xa192('0x37')]['id'],'fax':_0x28dc7b[_0xa192('0x45')]};return db[_0xa192('0x46')][_0xa192('0x36')]({'where':{'ContactId':_0x28dc7b['id'],'closed':![],'FaxAccountId':_0x32593c[_0xa192('0x37')]['id']}})[_0xa192('0xf')](function(_0x2d9e24){if(_0x2d9e24){return[_0x2d9e24,![]];}return db[_0xa192('0x46')][_0xa192('0x43')](_0x20c55e)[_0xa192('0xf')](function(_0xd41e0c){return[_0xd41e0c,!![]];});});}else{throw new Error(_0xa192('0x47'));}})['spread'](function(_0x237117,_0x3c402e){var _0x3e51eb=_0x237117['get']({'plain':!![]});if(_0x3c402e){if(_0x5d7fa5[_0xa192('0x37')][_0xa192('0x48')]){_0x5d7fa5['applications']['push']({'id':0x0,'priority':_0x5d7fa5['applications'][_0xa192('0x41')]+0x1,'app':_0xa192('0x49'),'appdata':_0xa192('0x4a'),'interval':_0xa192('0x4b')});}_0x3e51eb[_0xa192('0x4c')]=!![];}else{_0x3e51eb[_0xa192('0x4c')]=![];}_0x5d7fa5[_0xa192('0x4d')]=_0x3e51eb;return db[_0xa192('0x4e')][_0xa192('0x43')]({'body':_0x32593c[_0xa192('0x2d')][_0xa192('0x2d')],'FaxAccountId':_0x32593c['account']['id'],'FaxInteractionId':_0x237117['id'],'direction':'in','ContactId':_0x237117[_0xa192('0x4f')],'AttachmentId':_0x32593c['body'][_0xa192('0x50')]});})[_0xa192('0xf')](function(_0x3fd021){_0x5d7fa5[_0xa192('0x16')]=_0x3fd021;if(!_0x5d7fa5[_0xa192('0x4d')]['UserId'])return;return db[_0xa192('0x51')]['find']({'attributes':['id','name'],'where':{'id':_0x5d7fa5[_0xa192('0x4d')][_0xa192('0x52')]}});})['then'](function(_0x2e9f94){if(_0x2e9f94){_0x5d7fa5[_0xa192('0x3c')][_0xa192('0x53')]({'id':0x0,'priority':0x0,'app':_0xa192('0x54'),'appdata':_0x2e9f94[_0xa192('0x55')]+','+(_0x5d7fa5['account'][_0xa192('0x56')]||0xa),'interval':_0xa192('0x4b')});}if(!_0x5d7fa5[_0xa192('0x4d')][_0xa192('0x57')])return;return db[_0xa192('0x58')][_0xa192('0x36')]({'attributes':['id','name'],'where':{'id':_0x5d7fa5[_0xa192('0x4d')][_0xa192('0x57')]}});})['then'](function(_0x6272d){if(_0x6272d){_0x5d7fa5['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0xa192('0x59'),'appdata':_0x6272d[_0xa192('0x55')]+','+(_0x5d7fa5[_0xa192('0x37')]['waitForTheAssignedQueue']||0x12c),'interval':_0xa192('0x4b')});}return respondWithRpcPromise(_0xa192('0x5a'),_0xa192('0x5b'),_0x5d7fa5);})[_0xa192('0xf')](function(_0x452359){_0x392da2(_0x452359);})[_0xa192('0x18')](function(_0x353957){_0x5a8f12(_0x273fe7[_0xa192('0x15')](0x1f4,_0x353957['message']));});});}; \ No newline at end of file +var _0x8f38=['info','result','catch','GetFaxAccount','FaxAccount','options','raw','attributes','limit','include','map','model','then','stringify','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','difference','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','Contacts','DESC','FaxApplication','Applications','List','get','list','applications','orderBy','priority','asc','account','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','queueId','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','FaxAccount,\x20%s,\x20%s','message'];(function(_0x3dc2c4,_0x1c68b0){var _0xf8c69a=function(_0x1e912a){while(--_0x1e912a){_0x3dc2c4['push'](_0x3dc2c4['shift']());}};_0xf8c69a(++_0x1c68b0);}(_0x8f38,0x100));var _0x88f3=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x8f38[_0x2a6d45];return _0x295253;};'use strict';var _=require(_0x88f3('0x0'));var util=require(_0x88f3('0x1'));var moment=require(_0x88f3('0x2'));var BPromise=require(_0x88f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88f3('0x4'));var db=require(_0x88f3('0x5'))['db'];var utils=require(_0x88f3('0x6'));var logger=require('../../config/logger')(_0x88f3('0x7'));var config=require(_0x88f3('0x8'));var jayson=require(_0x88f3('0x9'));var client=jayson[_0x88f3('0xa')][_0x88f3('0xb')]({'port':0x232c});config['redis']=_[_0x88f3('0xc')](config[_0x88f3('0xd')],{'host':_0x88f3('0xe'),'port':0x18eb});var socket=require(_0x88f3('0xf'))(new Redis(config[_0x88f3('0xd')]));require(_0x88f3('0x10'))['register'](socket);function respondWithRpcPromise(_0x10c5e5,_0x18fb4a,_0x4014c4){return new BPromise(function(_0x4283a7,_0x2a9d32){return client['request'](_0x10c5e5,_0x4014c4)['then'](function(_0x9fd3a9){logger['info']('FaxAccount,\x20%s,\x20%s',_0x18fb4a,_0x88f3('0x11'));logger[_0x88f3('0x12')](_0x88f3('0x13'),_0x18fb4a,'request\x20sent',JSON['stringify'](_0x9fd3a9));if(_0x9fd3a9[_0x88f3('0x14')]){if(_0x9fd3a9[_0x88f3('0x14')]['code']===0x1f4){logger[_0x88f3('0x14')](_0x88f3('0x15'),_0x18fb4a,_0x9fd3a9[_0x88f3('0x14')]['message']);return _0x2a9d32(_0x9fd3a9[_0x88f3('0x14')][_0x88f3('0x16')]);}logger[_0x88f3('0x14')](_0x88f3('0x15'),_0x18fb4a,_0x9fd3a9[_0x88f3('0x14')]['message']);return _0x4283a7(_0x9fd3a9[_0x88f3('0x14')][_0x88f3('0x16')]);}else{logger[_0x88f3('0x17')](_0x88f3('0x15'),_0x18fb4a,_0x88f3('0x11'));_0x4283a7(_0x9fd3a9[_0x88f3('0x18')][_0x88f3('0x16')]);}})[_0x88f3('0x19')](function(_0x4559da){logger['error'](_0x88f3('0x15'),_0x18fb4a,_0x4559da);_0x2a9d32(_0x4559da);});});}exports[_0x88f3('0x1a')]=function(_0x3cda31){var _0x46db31=this;return new Promise(function(_0x1199fd,_0x476021){return db[_0x88f3('0x1b')]['findAll']({'raw':_0x3cda31[_0x88f3('0x1c')]?_0x3cda31['options'][_0x88f3('0x1d')]===undefined?!![]:![]:!![],'where':_0x3cda31[_0x88f3('0x1c')]?_0x3cda31['options']['where']||null:null,'attributes':_0x3cda31[_0x88f3('0x1c')]?_0x3cda31['options'][_0x88f3('0x1e')]||null:null,'limit':_0x3cda31[_0x88f3('0x1c')]?_0x3cda31[_0x88f3('0x1c')][_0x88f3('0x1f')]||null:null,'include':_0x3cda31[_0x88f3('0x1c')]?_0x3cda31[_0x88f3('0x1c')][_0x88f3('0x20')]?_[_0x88f3('0x21')](_0x3cda31[_0x88f3('0x1c')][_0x88f3('0x20')],function(_0x15605f){return{'model':db[_0x15605f[_0x88f3('0x22')]],'as':_0x15605f['as'],'attributes':_0x15605f[_0x88f3('0x1e')],'include':_0x15605f[_0x88f3('0x20')]?_[_0x88f3('0x21')](_0x15605f[_0x88f3('0x20')],function(_0x4f610b){return{'model':db[_0x4f610b[_0x88f3('0x22')]],'as':_0x4f610b['as'],'attributes':_0x4f610b[_0x88f3('0x1e')],'include':_0x4f610b[_0x88f3('0x20')]?_['map'](_0x4f610b[_0x88f3('0x20')],function(_0x5996ba){return{'model':db[_0x5996ba['model']],'as':_0x5996ba['as'],'attributes':_0x5996ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x88f3('0x23')](function(_0x22699a){logger[_0x88f3('0x17')](_0x88f3('0x1a'),_0x3cda31);logger[_0x88f3('0x12')](_0x88f3('0x1a'),_0x3cda31,JSON[_0x88f3('0x24')](_0x22699a));_0x1199fd(_0x22699a);})[_0x88f3('0x19')](function(_0x4babe2){logger[_0x88f3('0x14')](_0x88f3('0x1a'),_0x4babe2['message'],_0x3cda31);_0x476021(_0x46db31[_0x88f3('0x14')](0x1f4,_0x4babe2['message']));});});};exports['NotifyFaxAccount']=function(_0x21517f,_0x5052a6,_0x1fc176){var _0x2a350a=this;return new Promise(function(_0x50703f,_0x140148){var _0x30395c={'body':_0x21517f[_0x88f3('0x25')],'channel':_0x88f3('0x26')};var _0x39eada=[];var _0x46328e=[];var _0xd27ef7={};return db[_0x88f3('0x27')]['describe']()['then'](function(_0x28edd9){if(!_0x28edd9){throw new db[(_0x88f3('0x28'))][(_0x88f3('0x29'))](_0x88f3('0x2a'));}_0x39eada=_['difference'](_[_0x88f3('0x2b')](_0x28edd9),[_0x88f3('0x2c'),'updatedAt']);_0x46328e=_[_0x88f3('0x2d')](_[_0x88f3('0x2b')](_0x28edd9),['createdAt',_0x88f3('0x2e'),_0x88f3('0x2f'),_0x88f3('0x30')]);if(_0x21517f[_0x88f3('0x25')]['id']){delete _0x21517f['body']['id'];}if(_['isNil'](_0x21517f['body'][_0x88f3('0x31')])){throw new db[(_0x88f3('0x28'))][(_0x88f3('0x29'))](_0x88f3('0x32'));}if(_[_0x88f3('0x33')](_0x21517f['body'][_0x88f3('0x25')])||_0x21517f[_0x88f3('0x25')][_0x88f3('0x25')]===''){throw new db[(_0x88f3('0x28'))][(_0x88f3('0x29'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x21517f[_0x88f3('0x25')][_0x88f3('0x34')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46328e);}if(!_['includes'](_0x46328e,_0x21517f['body'][_0x88f3('0x34')])){throw new db[(_0x88f3('0x28'))]['ValidationError'](_0x88f3('0x35')+_0x46328e);}_0xd27ef7[_0x21517f[_0x88f3('0x25')]['mapKey']]=_0x21517f[_0x88f3('0x25')]['from'];})[_0x88f3('0x23')](function(){return db[_0x88f3('0x1b')][_0x88f3('0x36')]({'where':{'id':_0x21517f['account']['id']},'include':[{'model':db[_0x88f3('0x37')],'as':'List','include':[{'model':db['CmContact'],'as':_0x88f3('0x38'),'where':_0xd27ef7,'limit':0x1,'order':[[_0x88f3('0x2e'),_0x88f3('0x39')]]}]},{'model':db[_0x88f3('0x3a')],'as':_0x88f3('0x3b')}]});})[_0x88f3('0x23')](function(_0x8d00aa){if(_0x8d00aa&&_0x8d00aa[_0x88f3('0x3c')]){var _0x77d4cb=_0x8d00aa[_0x88f3('0x3d')]({'plain':!![]});_0x30395c['account']=_0x77d4cb;_0x30395c['applications']=_0x77d4cb[_0x88f3('0x3b')];_0x30395c[_0x88f3('0x3e')]=_0x77d4cb[_0x88f3('0x3c')];_0x30395c[_0x88f3('0x3f')]=_[_0x88f3('0x40')](_0x30395c['applications'],[_0x88f3('0x41')],[_0x88f3('0x42')]);if(_0x30395c[_0x88f3('0x43')][_0x88f3('0x3b')]){delete _0x30395c['account'][_0x88f3('0x3b')];}if(_0x30395c[_0x88f3('0x43')][_0x88f3('0x3c')]&&_0x30395c[_0x88f3('0x43')][_0x88f3('0x3c')]['Contacts'][_0x88f3('0x44')]){return _0x30395c[_0x88f3('0x43')][_0x88f3('0x3c')][_0x88f3('0x38')][0x0];}var _0x480be9=_[_0x88f3('0xc')](_0x21517f[_0x88f3('0x25')],{'firstName':_0x21517f[_0x88f3('0x25')][_0x88f3('0x31')],'ListId':_0x77d4cb[_0x88f3('0x30')]});_0x480be9[_0x21517f['body'][_0x88f3('0x34')]]=_0x21517f[_0x88f3('0x25')][_0x88f3('0x31')];return db[_0x88f3('0x27')][_0x88f3('0x45')](_0x480be9,{'fields':_0x39eada,'raw':!![]});}})[_0x88f3('0x23')](function(_0x508033){_0x30395c[_0x88f3('0x46')]=_0x508033;if(_0x508033){var _0x1885a9={'ContactId':_0x508033['id'],'FaxAccountId':_0x21517f[_0x88f3('0x43')]['id'],'fax':_0x508033[_0x88f3('0x26')]};return db[_0x88f3('0x47')]['find']({'where':{'ContactId':_0x508033['id'],'closed':![],'FaxAccountId':_0x21517f[_0x88f3('0x43')]['id']}})[_0x88f3('0x23')](function(_0x20c061){if(_0x20c061){return[_0x20c061,![]];}return db[_0x88f3('0x47')]['create'](_0x1885a9)['then'](function(_0x28178c){return[_0x28178c,!![]];});});}else{throw new Error(_0x88f3('0x48'));}})[_0x88f3('0x49')](function(_0x24dbef,_0x127ea9){var _0xde6634=_0x24dbef[_0x88f3('0x3d')]({'plain':!![]});if(_0x127ea9){if(_0x30395c[_0x88f3('0x43')][_0x88f3('0x4a')]){_0x30395c[_0x88f3('0x3f')][_0x88f3('0x4b')]({'id':0x0,'priority':_0x30395c[_0x88f3('0x3f')][_0x88f3('0x44')]+0x1,'app':_0x88f3('0x4c'),'appdata':_0x88f3('0x4d'),'interval':_0x88f3('0x4e')});}_0xde6634[_0x88f3('0x4f')]=!![];}else{_0xde6634[_0x88f3('0x4f')]=![];}_0x30395c[_0x88f3('0x50')]=_0xde6634;return db[_0x88f3('0x51')][_0x88f3('0x45')]({'body':_0x21517f[_0x88f3('0x25')][_0x88f3('0x25')],'FaxAccountId':_0x21517f['account']['id'],'FaxInteractionId':_0x24dbef['id'],'direction':'in','ContactId':_0x24dbef['ContactId'],'AttachmentId':_0x21517f[_0x88f3('0x25')][_0x88f3('0x52')]});})[_0x88f3('0x23')](function(_0x3821dc){_0x30395c['message']=_0x3821dc;if(!_0x30395c[_0x88f3('0x50')][_0x88f3('0x53')])return;return db[_0x88f3('0x54')][_0x88f3('0x36')]({'attributes':['id',_0x88f3('0x55')],'where':{'id':_0x30395c[_0x88f3('0x50')]['UserId']}});})[_0x88f3('0x23')](function(_0x336538){if(_0x336538){_0x30395c[_0x88f3('0x3f')][_0x88f3('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x336538[_0x88f3('0x55')]+','+(_0x30395c[_0x88f3('0x43')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x30395c['interaction'][_0x88f3('0x57')])return;return db[_0x88f3('0x58')][_0x88f3('0x36')]({'attributes':['id',_0x88f3('0x55')],'where':{'id':_0x30395c['interaction']['queueId']}});})[_0x88f3('0x23')](function(_0x136873){if(_0x136873){_0x30395c[_0x88f3('0x3f')][_0x88f3('0x56')]({'id':0x0,'priority':0x1,'app':_0x88f3('0x59'),'appdata':_0x136873[_0x88f3('0x55')]+','+(_0x30395c[_0x88f3('0x43')][_0x88f3('0x5a')]||0x12c),'interval':_0x88f3('0x4e')});}return respondWithRpcPromise(_0x88f3('0x5b'),_0x88f3('0x5c'),_0x30395c);})[_0x88f3('0x23')](function(_0x56e06a){_0x50703f(_0x56e06a);})[_0x88f3('0x19')](function(_0x1a46e1){_0x140148(_0x2a350a['error'](0x1f4,_0x1a46e1[_0x88f3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 57f326b..5e2d725 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 _0xa93c=['emit','faxAccount:','save','remove','update'];(function(_0x2beeb9,_0x415c85){var _0x3f7f25=function(_0x1890d1){while(--_0x1890d1){_0x2beeb9['push'](_0x2beeb9['shift']());}};_0x3f7f25(++_0x415c85);}(_0xa93c,0x197));var _0xca93=function(_0x47cfa0,_0x176b87){_0x47cfa0=_0x47cfa0-0x0;var _0x386b1d=_0xa93c[_0x47cfa0];return _0x386b1d;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xca93('0x0'),_0xca93('0x1'),_0xca93('0x2')];function createListener(_0x3ef44f,_0x5201b6){return function(_0x19e5d){_0x5201b6[_0xca93('0x3')](_0x3ef44f,_0x19e5d);};}function removeListener(_0x4761c2,_0x2dda1c){return function(){FaxAccountEvents['removeListener'](_0x4761c2,_0x2dda1c);};}exports['register']=function(_0x283596){for(var _0x665d5a=0x0,_0xc756bf=events['length'];_0x665d5a<_0xc756bf;_0x665d5a++){var _0x54de70=events[_0x665d5a];var _0x40f808=createListener(_0xca93('0x4')+_0x54de70,_0x283596);FaxAccountEvents['on'](_0x54de70,_0x40f808);}}; \ No newline at end of file +var _0xeff0=['emit','removeListener','register','faxAccount:','./faxAccount.events','save','remove'];(function(_0x168ad0,_0x45e98b){var _0x3596fc=function(_0x388510){while(--_0x388510){_0x168ad0['push'](_0x168ad0['shift']());}};_0x3596fc(++_0x45e98b);}(_0xeff0,0xac));var _0x0eff=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xeff0[_0xfae23b];return _0x200640;};'use strict';var FaxAccountEvents=require(_0x0eff('0x0'));var events=[_0x0eff('0x1'),_0x0eff('0x2'),'update'];function createListener(_0x4667d2,_0x23696b){return function(_0x4b25d7){_0x23696b[_0x0eff('0x3')](_0x4667d2,_0x4b25d7);};}function removeListener(_0x2074b9,_0x161ff0){return function(){FaxAccountEvents[_0x0eff('0x4')](_0x2074b9,_0x161ff0);};}exports[_0x0eff('0x5')]=function(_0x14902e){for(var _0x1be556=0x0,_0x4cba78=events['length'];_0x1be556<_0x4cba78;_0x1be556++){var _0x295cc3=events[_0x1be556];var _0x558d58=createListener(_0x0eff('0x6')+_0x295cc3,_0x14902e);FaxAccountEvents['on'](_0x295cc3,_0x558d58);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 8d6d20a..7aa9549 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 _0xafbf=['/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','getMessages','getAgents','create','post','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/:id/send','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxAccount.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x333f66,_0x371f7f){var _0x44d5f2=function(_0xb8a2fc){while(--_0xb8a2fc){_0x333f66['push'](_0x333f66['shift']());}};_0x44d5f2(++_0x371f7f);}(_0xafbf,0x65));var _0xfafb=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xafbf[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0xfafb('0x0'));var path=require('path');var timeout=require(_0xfafb('0x1'));var express=require(_0xfafb('0x2'));var router=express[_0xfafb('0x3')]();var fs_extra=require(_0xfafb('0x4'));var auth=require(_0xfafb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfafb('0x6'));router['get']('/',auth[_0xfafb('0x7')](),controller[_0xfafb('0x8')]);router[_0xfafb('0x9')](_0xfafb('0xa'),auth['isAuthenticated'](),controller[_0xfafb('0xb')]);router[_0xfafb('0x9')](_0xfafb('0xc'),auth[_0xfafb('0x7')](),controller['show']);router[_0xfafb('0x9')](_0xfafb('0xd'),auth['isAuthenticated'](),controller[_0xfafb('0xe')]);router[_0xfafb('0x9')](_0xfafb('0xf'),auth[_0xfafb('0x7')](),controller['getAnswers']);router[_0xfafb('0x9')](_0xfafb('0x10'),auth['isAuthenticated'](),controller[_0xfafb('0x11')]);router['get'](_0xfafb('0x12'),auth[_0xfafb('0x7')](),controller['getApplications']);router[_0xfafb('0x9')]('/:id/messages',auth[_0xfafb('0x7')](),controller[_0xfafb('0x13')]);router[_0xfafb('0x9')]('/:id/users',auth[_0xfafb('0x7')](),controller[_0xfafb('0x14')]);router['post']('/',auth[_0xfafb('0x7')](),controller[_0xfafb('0x15')]);router[_0xfafb('0x16')]('/:id/dispositions',auth[_0xfafb('0x7')](),controller['addDisposition']);router['post'](_0xfafb('0xf'),auth[_0xfafb('0x7')](),controller[_0xfafb('0x17')]);router[_0xfafb('0x16')]('/:id/interactions',auth[_0xfafb('0x7')](),controller[_0xfafb('0x18')]);router[_0xfafb('0x16')](_0xfafb('0x12'),auth[_0xfafb('0x7')](),controller[_0xfafb('0x19')]);router[_0xfafb('0x16')](_0xfafb('0x1a'),auth[_0xfafb('0x7')](),controller[_0xfafb('0x1b')]);router['post']('/updateaccountapplications',auth['isAuthenticated'](),controller['updateAccountApplications']);router['post'](_0xfafb('0x1c'),auth[_0xfafb('0x7')](),controller['send']);router[_0xfafb('0x16')](_0xfafb('0x1d'),auth['isAuthenticated'](),controller[_0xfafb('0x1e')]);router['put'](_0xfafb('0xc'),auth[_0xfafb('0x7')](),controller[_0xfafb('0x1f')]);router[_0xfafb('0x20')](_0xfafb('0xc'),auth[_0xfafb('0x7')](),controller[_0xfafb('0x21')]);router[_0xfafb('0x20')](_0xfafb('0xd'),auth[_0xfafb('0x7')](),controller[_0xfafb('0x22')]);router[_0xfafb('0x20')](_0xfafb('0xf'),auth[_0xfafb('0x7')](),controller[_0xfafb('0x23')]);router[_0xfafb('0x20')](_0xfafb('0x1d'),auth[_0xfafb('0x7')](),controller[_0xfafb('0x24')]);module[_0xfafb('0x25')]=router; \ No newline at end of file +var _0x3697=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','post','create','addDisposition','addAnswer','addInteraction','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','destroy','exports','multer','util'];(function(_0x185382,_0x3f4342){var _0x2e93d7=function(_0x5709b8){while(--_0x5709b8){_0x185382['push'](_0x185382['shift']());}};_0x2e93d7(++_0x3f4342);}(_0x3697,0x1ea));var _0x7369=function(_0x4bcfd1,_0x348507){_0x4bcfd1=_0x4bcfd1-0x0;var _0x1a2e7c=_0x3697[_0x4bcfd1];return _0x1a2e7c;};'use strict';var multer=require(_0x7369('0x0'));var util=require(_0x7369('0x1'));var path=require(_0x7369('0x2'));var timeout=require(_0x7369('0x3'));var express=require(_0x7369('0x4'));var router=express['Router']();var fs_extra=require(_0x7369('0x5'));var auth=require(_0x7369('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7369('0x7'));var controller=require(_0x7369('0x8'));router[_0x7369('0x9')]('/',auth[_0x7369('0xa')](),controller[_0x7369('0xb')]);router[_0x7369('0x9')](_0x7369('0xc'),auth[_0x7369('0xa')](),controller['describe']);router[_0x7369('0x9')](_0x7369('0xd'),auth[_0x7369('0xa')](),controller['show']);router['get'](_0x7369('0xe'),auth[_0x7369('0xa')](),controller[_0x7369('0xf')]);router[_0x7369('0x9')](_0x7369('0x10'),auth[_0x7369('0xa')](),controller[_0x7369('0x11')]);router[_0x7369('0x9')](_0x7369('0x12'),auth[_0x7369('0xa')](),controller[_0x7369('0x13')]);router[_0x7369('0x9')](_0x7369('0x14'),auth[_0x7369('0xa')](),controller[_0x7369('0x15')]);router[_0x7369('0x9')](_0x7369('0x16'),auth[_0x7369('0xa')](),controller[_0x7369('0x17')]);router[_0x7369('0x9')]('/:id/users',auth[_0x7369('0xa')](),controller[_0x7369('0x18')]);router[_0x7369('0x19')]('/',auth[_0x7369('0xa')](),controller[_0x7369('0x1a')]);router[_0x7369('0x19')](_0x7369('0xe'),auth[_0x7369('0xa')](),controller[_0x7369('0x1b')]);router[_0x7369('0x19')](_0x7369('0x10'),auth[_0x7369('0xa')](),controller[_0x7369('0x1c')]);router[_0x7369('0x19')](_0x7369('0x12'),auth['isAuthenticated'](),controller[_0x7369('0x1d')]);router[_0x7369('0x19')](_0x7369('0x14'),auth[_0x7369('0xa')](),controller['addApplications']);router['post'](_0x7369('0x1e'),auth[_0x7369('0xa')](),controller[_0x7369('0x1f')]);router['post']('/updateaccountapplications',auth[_0x7369('0xa')](),controller[_0x7369('0x20')]);router[_0x7369('0x19')](_0x7369('0x21'),auth[_0x7369('0xa')](),controller[_0x7369('0x22')]);router[_0x7369('0x19')]('/:id/users',auth[_0x7369('0xa')](),controller[_0x7369('0x23')]);router[_0x7369('0x24')](_0x7369('0xd'),auth[_0x7369('0xa')](),controller[_0x7369('0x25')]);router[_0x7369('0x26')](_0x7369('0xd'),auth[_0x7369('0xa')](),controller[_0x7369('0x27')]);router[_0x7369('0x26')](_0x7369('0xe'),auth[_0x7369('0xa')](),controller['removeDispositions']);router[_0x7369('0x26')]('/:id/canned_answers',auth[_0x7369('0xa')](),controller['removeAnswers']);router[_0x7369('0x26')]('/:id/users',auth[_0x7369('0xa')](),controller['removeAgents']);module[_0x7369('0x28')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 57ba959..04d4ea4 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 _0xba28=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x7f133e,_0x48505c){var _0x3d8df7=function(_0xdb5339){while(--_0xdb5339){_0x7f133e['push'](_0x7f133e['shift']());}};_0x3d8df7(++_0x48505c);}(_0xba28,0x1e9));var _0x8ba2=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xba28[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require('sequelize');module[_0x8ba2('0x0')]={'priority':{'type':Sequelize[_0x8ba2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8ba2('0x2')],'allowNull':![],'defaultValue':_0x8ba2('0x3')},'appdata':{'type':Sequelize[_0x8ba2('0x4')]()},'description':{'type':Sequelize[_0x8ba2('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8ba2('0x5')}}; \ No newline at end of file +var _0xb54f=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x3ff9a9,_0x48e919){var _0x5aff78=function(_0x24a933){while(--_0x24a933){_0x3ff9a9['push'](_0x3ff9a9['shift']());}};_0x5aff78(++_0x48e919);}(_0xb54f,0x1f3));var _0xfb54=function(_0x245e33,_0x18f885){_0x245e33=_0x245e33-0x0;var _0x3fdb30=_0xb54f[_0x245e33];return _0x3fdb30;};'use strict';var Sequelize=require('sequelize');module[_0xfb54('0x0')]={'priority':{'type':Sequelize[_0xfb54('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfb54('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfb54('0x3')]()},'description':{'type':Sequelize[_0xfb54('0x2')]},'interval':{'type':Sequelize[_0xfb54('0x2')],'defaultValue':_0xfb54('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 43a6cbc..4f25070 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 _0x2ef2=['create','body','params','rimraf','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','FaxApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','where','pick','merge','map','filter','include','rows','catch','show','find'];(function(_0x4a0c33,_0x5686bb){var _0x6488f9=function(_0x3bbd97){while(--_0x3bbd97){_0x4a0c33['push'](_0x4a0c33['shift']());}};_0x6488f9(++_0x5686bb);}(_0x2ef2,0xcc));var _0x22ef=function(_0x2416b2,_0x134439){_0x2416b2=_0x2416b2-0x0;var _0x159c30=_0x2ef2[_0x2416b2];return _0x159c30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22ef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x22ef('0x1'));var moment=require(_0x22ef('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x22ef('0x3'));var util=require(_0x22ef('0x4'));var path=require(_0x22ef('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x22ef('0x6'));var fs=require('fs');var fs_extra=require(_0x22ef('0x7'));var _=require(_0x22ef('0x8'));var squel=require(_0x22ef('0x9'));var crypto=require('crypto');var jsforce=require(_0x22ef('0xa'));var deskjs=require(_0x22ef('0xb'));var toCsv=require(_0x22ef('0xc'));var querystring=require(_0x22ef('0xd'));var Papa=require(_0x22ef('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x22ef('0xf'));var hardwareService=require(_0x22ef('0x10'));var logger=require(_0x22ef('0x11'))('api');var utils=require(_0x22ef('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x22ef('0x13'));var db=require(_0x22ef('0x14'))['db'];function respondWithStatusCode(_0x48ffd6,_0x192d60){_0x192d60=_0x192d60||0xcc;return function(_0x13db54){if(_0x13db54){return _0x48ffd6[_0x22ef('0x15')](_0x192d60);}return _0x48ffd6[_0x22ef('0x16')](_0x192d60)[_0x22ef('0x17')]();};}function respondWithResult(_0x14ac28,_0x345e14){_0x345e14=_0x345e14||0xc8;return function(_0x35318f){if(_0x35318f){return _0x14ac28['status'](_0x345e14)[_0x22ef('0x18')](_0x35318f);}};}function respondWithFilteredResult(_0xcaa114,_0x15adc5){return function(_0x379cae){if(_0x379cae){var _0x26b89c=typeof _0x15adc5[_0x22ef('0x19')]===_0x22ef('0x1a')&&typeof _0x15adc5[_0x22ef('0x1b')]===_0x22ef('0x1a');var _0x4d3e9c=_0x379cae[_0x22ef('0x1c')];var _0x3fa31a=_0x26b89c?0x0:_0x15adc5[_0x22ef('0x19')];var _0x1820d2=_0x26b89c?_0x379cae[_0x22ef('0x1c')]:_0x15adc5[_0x22ef('0x19')]+_0x15adc5[_0x22ef('0x1b')];var _0x35a781;if(_0x1820d2>=_0x4d3e9c){_0x1820d2=_0x4d3e9c;_0x35a781=0xc8;}else{_0x35a781=0xce;}_0xcaa114['status'](_0x35a781);return _0xcaa114[_0x22ef('0x1d')](_0x22ef('0x1e'),_0x3fa31a+'-'+_0x1820d2+'/'+_0x4d3e9c)['json'](_0x379cae);}return null;};}function patchUpdates(_0x97ecfb){return function(_0x214fa0){try{jsonpatch['apply'](_0x214fa0,_0x97ecfb,!![]);}catch(_0xd08871){return BPromise[_0x22ef('0x1f')](_0xd08871);}return _0x214fa0[_0x22ef('0x20')]();};}function saveUpdates(_0xfe8f4b,_0x587ee4){return function(_0x2a1eaf){if(_0x2a1eaf){return _0x2a1eaf[_0x22ef('0x21')](_0xfe8f4b)[_0x22ef('0x22')](function(_0x4fd136){return _0x4fd136;});}return null;};}function removeEntity(_0x24fe3c,_0x15d1c4){return function(_0x1187d3){if(_0x1187d3){return _0x1187d3[_0x22ef('0x23')]()[_0x22ef('0x22')](function(){_0x24fe3c[_0x22ef('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59ce86,_0x15bb4b){return function(_0x53659d){if(!_0x53659d){_0x59ce86[_0x22ef('0x15')](0x194);}return _0x53659d;};}function handleError(_0x4da0d6,_0x25d7bd){_0x25d7bd=_0x25d7bd||0x1f4;return function(_0x1f9131){logger[_0x22ef('0x24')](_0x1f9131[_0x22ef('0x25')]);if(_0x1f9131[_0x22ef('0x26')]){delete _0x1f9131[_0x22ef('0x26')];}_0x4da0d6[_0x22ef('0x16')](_0x25d7bd)[_0x22ef('0x27')](_0x1f9131);};}exports['index']=function(_0x2b6c0c,_0x24e129){var _0x5b01e7={},_0x1c9ac6={},_0x57337b={'count':0x0,'rows':[]};var _0x35fc18=_['map'](db[_0x22ef('0x28')][_0x22ef('0x29')],function(_0xc9c422){return{'name':_0xc9c422[_0x22ef('0x2a')],'type':_0xc9c422[_0x22ef('0x2b')][_0x22ef('0x2c')]};});_0x1c9ac6['model']=_['map'](_0x35fc18,_0x22ef('0x26'));_0x1c9ac6[_0x22ef('0x2d')]=_[_0x22ef('0x2e')](_0x2b6c0c[_0x22ef('0x2d')]);_0x1c9ac6[_0x22ef('0x2f')]=_[_0x22ef('0x30')](_0x1c9ac6[_0x22ef('0x31')],_0x1c9ac6[_0x22ef('0x2d')]);_0x5b01e7[_0x22ef('0x32')]=_['intersection'](_0x1c9ac6[_0x22ef('0x31')],qs[_0x22ef('0x33')](_0x2b6c0c['query']['fields']));_0x5b01e7['attributes']=_0x5b01e7[_0x22ef('0x32')][_0x22ef('0x34')]?_0x5b01e7[_0x22ef('0x32')]:_0x1c9ac6[_0x22ef('0x31')];if(!_0x2b6c0c[_0x22ef('0x2d')]['hasOwnProperty'](_0x22ef('0x35'))){_0x5b01e7[_0x22ef('0x1b')]=qs[_0x22ef('0x1b')](_0x2b6c0c[_0x22ef('0x2d')][_0x22ef('0x1b')]);_0x5b01e7[_0x22ef('0x19')]=qs[_0x22ef('0x19')](_0x2b6c0c[_0x22ef('0x2d')][_0x22ef('0x19')]);}_0x5b01e7['order']=qs['sort'](_0x2b6c0c[_0x22ef('0x2d')]['sort']);_0x5b01e7[_0x22ef('0x36')]=qs[_0x22ef('0x2f')](_[_0x22ef('0x37')](_0x2b6c0c[_0x22ef('0x2d')],_0x1c9ac6[_0x22ef('0x2f')]),_0x35fc18);if(_0x2b6c0c[_0x22ef('0x2d')]['filter']){_0x5b01e7[_0x22ef('0x36')]=_[_0x22ef('0x38')](_0x5b01e7['where'],{'$or':_[_0x22ef('0x39')](_0x35fc18,function(_0x55aa79){if(_0x55aa79['type']!=='VIRTUAL'){var _0x2647ed={};_0x2647ed[_0x55aa79['name']]={'$like':'%'+_0x2b6c0c[_0x22ef('0x2d')][_0x22ef('0x3a')]+'%'};return _0x2647ed;}})});}_0x5b01e7=_[_0x22ef('0x38')]({},_0x5b01e7,_0x2b6c0c['options']);var _0x530cbb={'where':_0x5b01e7['where']};return db['FaxApplication'][_0x22ef('0x1c')](_0x530cbb)[_0x22ef('0x22')](function(_0x2d7299){_0x57337b[_0x22ef('0x1c')]=_0x2d7299;if(_0x2b6c0c['query']['includeAll']){_0x5b01e7[_0x22ef('0x3b')]=[{'all':!![]}];}return db[_0x22ef('0x28')]['findAll'](_0x5b01e7);})['then'](function(_0x405b96){_0x57337b[_0x22ef('0x3c')]=_0x405b96;return _0x57337b;})[_0x22ef('0x22')](respondWithFilteredResult(_0x24e129,_0x5b01e7))[_0x22ef('0x3d')](handleError(_0x24e129,null));};exports[_0x22ef('0x3e')]=function(_0x534579,_0x347b40){var _0x418c42={'raw':!![],'where':{'id':_0x534579['params']['id']}},_0x429593={};_0x429593[_0x22ef('0x31')]=_['keys'](db['FaxApplication'][_0x22ef('0x29')]);_0x429593[_0x22ef('0x2d')]=_[_0x22ef('0x2e')](_0x534579['query']);_0x429593[_0x22ef('0x2f')]=_[_0x22ef('0x30')](_0x429593[_0x22ef('0x31')],_0x429593['query']);_0x418c42['attributes']=_['intersection'](_0x429593[_0x22ef('0x31')],qs[_0x22ef('0x33')](_0x534579[_0x22ef('0x2d')]['fields']));_0x418c42[_0x22ef('0x32')]=_0x418c42[_0x22ef('0x32')][_0x22ef('0x34')]?_0x418c42[_0x22ef('0x32')]:_0x429593[_0x22ef('0x31')];if(_0x534579[_0x22ef('0x2d')]['includeAll']){_0x418c42[_0x22ef('0x3b')]=[{'all':!![]}];}_0x418c42=_[_0x22ef('0x38')]({},_0x418c42,_0x534579['options']);return db['FaxApplication'][_0x22ef('0x3f')](_0x418c42)['then'](handleEntityNotFound(_0x347b40,null))[_0x22ef('0x22')](respondWithResult(_0x347b40,null))['catch'](handleError(_0x347b40,null));};exports[_0x22ef('0x40')]=function(_0x15b87c,_0x191560){return db[_0x22ef('0x28')]['create'](_0x15b87c[_0x22ef('0x41')],{})[_0x22ef('0x22')](respondWithResult(_0x191560,0xc9))['catch'](handleError(_0x191560,null));};exports[_0x22ef('0x21')]=function(_0x40ffec,_0x4835e1){if(_0x40ffec[_0x22ef('0x41')]['id']){delete _0x40ffec[_0x22ef('0x41')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x40ffec[_0x22ef('0x42')]['id']}})[_0x22ef('0x22')](handleEntityNotFound(_0x4835e1,null))[_0x22ef('0x22')](saveUpdates(_0x40ffec['body'],null))[_0x22ef('0x22')](respondWithResult(_0x4835e1,null))[_0x22ef('0x3d')](handleError(_0x4835e1,null));};exports[_0x22ef('0x23')]=function(_0x5b886e,_0x277530){return db[_0x22ef('0x28')][_0x22ef('0x3f')]({'where':{'id':_0x5b886e[_0x22ef('0x42')]['id']}})['then'](handleEntityNotFound(_0x277530,null))[_0x22ef('0x22')](removeEntity(_0x277530,null))[_0x22ef('0x3d')](handleError(_0x277530,null));}; \ No newline at end of file +var _0x87e1=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','error','name','send','index','map','FaxApplication','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','then','include','rows','catch','show','keys','rawAttributes','filters','find','create','update','params','eml-format','rimraf','request-promise','sox','to-csv','ejs'];(function(_0x442ced,_0x43b4eb){var _0x2bbe2e=function(_0x506271){while(--_0x506271){_0x442ced['push'](_0x442ced['shift']());}};_0x2bbe2e(++_0x43b4eb);}(_0x87e1,0xc0));var _0x187e=function(_0x43e19a,_0x3127f2){_0x43e19a=_0x43e19a-0x0;var _0x35099e=_0x87e1[_0x43e19a];return _0x35099e;};'use strict';var emlformat=require(_0x187e('0x0'));var rimraf=require(_0x187e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x187e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x187e('0x3'));var csv=require(_0x187e('0x4'));var ejs=require(_0x187e('0x5'));var fs=require('fs');var fs_extra=require(_0x187e('0x6'));var _=require(_0x187e('0x7'));var squel=require('squel');var crypto=require(_0x187e('0x8'));var jsforce=require(_0x187e('0x9'));var deskjs=require(_0x187e('0xa'));var toCsv=require(_0x187e('0x4'));var querystring=require(_0x187e('0xb'));var Papa=require('papaparse');var Redis=require(_0x187e('0xc'));var authService=require(_0x187e('0xd'));var qs=require(_0x187e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x187e('0xf'));var logger=require(_0x187e('0x10'))(_0x187e('0x11'));var utils=require('../../config/utils');var config=require(_0x187e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x187e('0x13'))['db'];function respondWithStatusCode(_0x2b3231,_0x2830b9){_0x2830b9=_0x2830b9||0xcc;return function(_0x3e5bc7){if(_0x3e5bc7){return _0x2b3231[_0x187e('0x14')](_0x2830b9);}return _0x2b3231[_0x187e('0x15')](_0x2830b9)[_0x187e('0x16')]();};}function respondWithResult(_0x486e2f,_0x4bc8d4){_0x4bc8d4=_0x4bc8d4||0xc8;return function(_0x28ebbe){if(_0x28ebbe){return _0x486e2f[_0x187e('0x15')](_0x4bc8d4)['json'](_0x28ebbe);}};}function respondWithFilteredResult(_0x6b7a0c,_0x1f8b60){return function(_0x11c555){if(_0x11c555){var _0x3db25d=typeof _0x1f8b60[_0x187e('0x17')]===_0x187e('0x18')&&typeof _0x1f8b60[_0x187e('0x19')]===_0x187e('0x18');var _0x502b98=_0x11c555[_0x187e('0x1a')];var _0x295a98=_0x3db25d?0x0:_0x1f8b60[_0x187e('0x17')];var _0x3f4bc9=_0x3db25d?_0x11c555[_0x187e('0x1a')]:_0x1f8b60[_0x187e('0x17')]+_0x1f8b60[_0x187e('0x19')];var _0x9a41f2;if(_0x3f4bc9>=_0x502b98){_0x3f4bc9=_0x502b98;_0x9a41f2=0xc8;}else{_0x9a41f2=0xce;}_0x6b7a0c[_0x187e('0x15')](_0x9a41f2);return _0x6b7a0c[_0x187e('0x1b')](_0x187e('0x1c'),_0x295a98+'-'+_0x3f4bc9+'/'+_0x502b98)['json'](_0x11c555);}return null;};}function patchUpdates(_0xb626c3){return function(_0x443b47){try{jsonpatch[_0x187e('0x1d')](_0x443b47,_0xb626c3,!![]);}catch(_0x3d2945){return BPromise[_0x187e('0x1e')](_0x3d2945);}return _0x443b47['save']();};}function saveUpdates(_0x273807,_0x247e0f){return function(_0xd9a3f8){if(_0xd9a3f8){return _0xd9a3f8['update'](_0x273807)['then'](function(_0x30c602){return _0x30c602;});}return null;};}function removeEntity(_0x5c7777,_0x391bc7){return function(_0x2b730b){if(_0x2b730b){return _0x2b730b[_0x187e('0x1f')]()['then'](function(){_0x5c7777['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40ff61,_0x30e013){return function(_0x2ef466){if(!_0x2ef466){_0x40ff61[_0x187e('0x14')](0x194);}return _0x2ef466;};}function handleError(_0x586e7a,_0x433aa1){_0x433aa1=_0x433aa1||0x1f4;return function(_0x102164){logger[_0x187e('0x20')](_0x102164['stack']);if(_0x102164[_0x187e('0x21')]){delete _0x102164[_0x187e('0x21')];}_0x586e7a['status'](_0x433aa1)[_0x187e('0x22')](_0x102164);};}exports[_0x187e('0x23')]=function(_0x12344d,_0x55b817){var _0x3ebe53={},_0x5777ff={},_0x1bdbc7={'count':0x0,'rows':[]};var _0x12f2e6=_[_0x187e('0x24')](db[_0x187e('0x25')]['rawAttributes'],function(_0xcf5009){return{'name':_0xcf5009[_0x187e('0x26')],'type':_0xcf5009['type'][_0x187e('0x27')]};});_0x5777ff[_0x187e('0x28')]=_['map'](_0x12f2e6,_0x187e('0x21'));_0x5777ff[_0x187e('0x29')]=_['keys'](_0x12344d[_0x187e('0x29')]);_0x5777ff['filters']=_['intersection'](_0x5777ff['model'],_0x5777ff[_0x187e('0x29')]);_0x3ebe53[_0x187e('0x2a')]=_[_0x187e('0x2b')](_0x5777ff[_0x187e('0x28')],qs[_0x187e('0x2c')](_0x12344d['query'][_0x187e('0x2c')]));_0x3ebe53[_0x187e('0x2a')]=_0x3ebe53['attributes'][_0x187e('0x2d')]?_0x3ebe53[_0x187e('0x2a')]:_0x5777ff[_0x187e('0x28')];if(!_0x12344d[_0x187e('0x29')][_0x187e('0x2e')](_0x187e('0x2f'))){_0x3ebe53[_0x187e('0x19')]=qs[_0x187e('0x19')](_0x12344d['query']['limit']);_0x3ebe53['offset']=qs['offset'](_0x12344d[_0x187e('0x29')][_0x187e('0x17')]);}_0x3ebe53[_0x187e('0x30')]=qs['sort'](_0x12344d[_0x187e('0x29')][_0x187e('0x31')]);_0x3ebe53[_0x187e('0x32')]=qs['filters'](_['pick'](_0x12344d[_0x187e('0x29')],_0x5777ff['filters']),_0x12f2e6);if(_0x12344d['query']['filter']){_0x3ebe53['where']=_['merge'](_0x3ebe53[_0x187e('0x32')],{'$or':_[_0x187e('0x24')](_0x12f2e6,function(_0x556f32){if(_0x556f32['type']!==_0x187e('0x33')){var _0x421212={};_0x421212[_0x556f32[_0x187e('0x21')]]={'$like':'%'+_0x12344d['query']['filter']+'%'};return _0x421212;}})});}_0x3ebe53=_[_0x187e('0x34')]({},_0x3ebe53,_0x12344d[_0x187e('0x35')]);var _0x2c2bee={'where':_0x3ebe53[_0x187e('0x32')]};return db[_0x187e('0x25')][_0x187e('0x1a')](_0x2c2bee)[_0x187e('0x36')](function(_0x26087c){_0x1bdbc7[_0x187e('0x1a')]=_0x26087c;if(_0x12344d[_0x187e('0x29')]['includeAll']){_0x3ebe53[_0x187e('0x37')]=[{'all':!![]}];}return db[_0x187e('0x25')]['findAll'](_0x3ebe53);})[_0x187e('0x36')](function(_0x5b7ea0){_0x1bdbc7[_0x187e('0x38')]=_0x5b7ea0;return _0x1bdbc7;})[_0x187e('0x36')](respondWithFilteredResult(_0x55b817,_0x3ebe53))[_0x187e('0x39')](handleError(_0x55b817,null));};exports[_0x187e('0x3a')]=function(_0x51292e,_0x1a4759){var _0x3af2e7={'raw':!![],'where':{'id':_0x51292e['params']['id']}},_0x1fc073={};_0x1fc073[_0x187e('0x28')]=_[_0x187e('0x3b')](db[_0x187e('0x25')][_0x187e('0x3c')]);_0x1fc073['query']=_[_0x187e('0x3b')](_0x51292e[_0x187e('0x29')]);_0x1fc073[_0x187e('0x3d')]=_['intersection'](_0x1fc073['model'],_0x1fc073[_0x187e('0x29')]);_0x3af2e7[_0x187e('0x2a')]=_[_0x187e('0x2b')](_0x1fc073[_0x187e('0x28')],qs[_0x187e('0x2c')](_0x51292e[_0x187e('0x29')][_0x187e('0x2c')]));_0x3af2e7[_0x187e('0x2a')]=_0x3af2e7[_0x187e('0x2a')]['length']?_0x3af2e7[_0x187e('0x2a')]:_0x1fc073['model'];if(_0x51292e[_0x187e('0x29')]['includeAll']){_0x3af2e7[_0x187e('0x37')]=[{'all':!![]}];}_0x3af2e7=_[_0x187e('0x34')]({},_0x3af2e7,_0x51292e[_0x187e('0x35')]);return db[_0x187e('0x25')][_0x187e('0x3e')](_0x3af2e7)['then'](handleEntityNotFound(_0x1a4759,null))[_0x187e('0x36')](respondWithResult(_0x1a4759,null))[_0x187e('0x39')](handleError(_0x1a4759,null));};exports[_0x187e('0x3f')]=function(_0x402bcf,_0x5d2e6a){return db[_0x187e('0x25')][_0x187e('0x3f')](_0x402bcf['body'],{})['then'](respondWithResult(_0x5d2e6a,0xc9))['catch'](handleError(_0x5d2e6a,null));};exports[_0x187e('0x40')]=function(_0x5434ac,_0x1ac770){if(_0x5434ac['body']['id']){delete _0x5434ac['body']['id'];}return db[_0x187e('0x25')][_0x187e('0x3e')]({'where':{'id':_0x5434ac[_0x187e('0x41')]['id']}})[_0x187e('0x36')](handleEntityNotFound(_0x1ac770,null))[_0x187e('0x36')](saveUpdates(_0x5434ac['body'],null))[_0x187e('0x36')](respondWithResult(_0x1ac770,null))['catch'](handleError(_0x1ac770,null));};exports[_0x187e('0x1f')]=function(_0x48a3ad,_0x25f74f){return db['FaxApplication'][_0x187e('0x3e')]({'where':{'id':_0x48a3ad[_0x187e('0x41')]['id']}})[_0x187e('0x36')](handleEntityNotFound(_0x25f74f,null))[_0x187e('0x36')](removeEntity(_0x25f74f,null))['catch'](handleError(_0x25f74f,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index b62a383..78aa284 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 _0xf854=['path','rimraf','../../config/environment','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18557c,_0xb09006){var _0x58bc5f=function(_0x1f955c){while(--_0x1f955c){_0x18557c['push'](_0x18557c['shift']());}};_0x58bc5f(++_0xb09006);}(_0xf854,0xe3));var _0x4f85=function(_0x4080ed,_0x174935){_0x4080ed=_0x4080ed-0x0;var _0x7d13cc=_0xf854[_0x4080ed];return _0x7d13cc;};'use strict';var _=require(_0x4f85('0x0'));var util=require(_0x4f85('0x1'));var logger=require(_0x4f85('0x2'))(_0x4f85('0x3'));var moment=require(_0x4f85('0x4'));var BPromise=require(_0x4f85('0x5'));var rp=require(_0x4f85('0x6'));var fs=require('fs');var path=require(_0x4f85('0x7'));var rimraf=require(_0x4f85('0x8'));var config=require(_0x4f85('0x9'));var attributes=require('./faxApplication.attributes');module[_0x4f85('0xa')]=function(_0xa93bf3,_0x17275c){return _0xa93bf3['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4f85('0xb'),'collate':_0x4f85('0xc')});}; \ No newline at end of file +var _0x2d3b=['../../config/environment','./faxApplication.attributes','exports','FaxApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x49326c,_0x5ef3e8){var _0x426ef2=function(_0xf084af){while(--_0xf084af){_0x49326c['push'](_0x49326c['shift']());}};_0x426ef2(++_0x5ef3e8);}(_0x2d3b,0x1f1));var _0xb2d3=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x2d3b[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0xb2d3('0x0'));var util=require(_0xb2d3('0x1'));var logger=require(_0xb2d3('0x2'))(_0xb2d3('0x3'));var moment=require(_0xb2d3('0x4'));var BPromise=require('bluebird');var rp=require(_0xb2d3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2d3('0x6'));var config=require(_0xb2d3('0x7'));var attributes=require(_0xb2d3('0x8'));module[_0xb2d3('0x9')]=function(_0xa4afc3,_0x625928){return _0xa4afc3['define'](_0xb2d3('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb2d3('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index fdbcdca..00dc42d 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 _0x9e33=['raw','where','attributes','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','UpdateFaxApplication','FaxApplication','update','options'];(function(_0x1aa834,_0x537c04){var _0x168810=function(_0xb8b21d){while(--_0xb8b21d){_0x1aa834['push'](_0x1aa834['shift']());}};_0x168810(++_0x537c04);}(_0x9e33,0x144));var _0x39e3=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0x9e33[_0x2211ed];return _0x4d78cc;};'use strict';var _=require(_0x39e3('0x0'));var util=require(_0x39e3('0x1'));var moment=require(_0x39e3('0x2'));var BPromise=require(_0x39e3('0x3'));var rs=require(_0x39e3('0x4'));var fs=require('fs');var Redis=require(_0x39e3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x39e3('0x6'))(_0x39e3('0x7'));var config=require(_0x39e3('0x8'));var jayson=require(_0x39e3('0x9'));var client=jayson[_0x39e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d2cb4,_0x3da195,_0x4a7806){return new BPromise(function(_0x38ce81,_0x50a66a){return client['request'](_0x4d2cb4,_0x4a7806)[_0x39e3('0xb')](function(_0x1add3b){logger['info'](_0x39e3('0xc'),_0x3da195,_0x39e3('0xd'));logger['debug'](_0x39e3('0xe'),_0x3da195,'request\x20sent',JSON['stringify'](_0x1add3b));if(_0x1add3b['error']){if(_0x1add3b[_0x39e3('0xf')]['code']===0x1f4){logger[_0x39e3('0xf')]('FaxApplication,\x20%s,\x20%s',_0x3da195,_0x1add3b[_0x39e3('0xf')][_0x39e3('0x10')]);return _0x50a66a(_0x1add3b[_0x39e3('0xf')][_0x39e3('0x10')]);}logger[_0x39e3('0xf')](_0x39e3('0xc'),_0x3da195,_0x1add3b[_0x39e3('0xf')]['message']);return _0x38ce81(_0x1add3b[_0x39e3('0xf')][_0x39e3('0x10')]);}else{logger[_0x39e3('0x11')](_0x39e3('0xc'),_0x3da195,_0x39e3('0xd'));_0x38ce81(_0x1add3b[_0x39e3('0x12')][_0x39e3('0x10')]);}})[_0x39e3('0x13')](function(_0x7c86b4){logger[_0x39e3('0xf')](_0x39e3('0xc'),_0x3da195,_0x7c86b4);_0x50a66a(_0x7c86b4);});});}exports[_0x39e3('0x14')]=function(_0x1e2a2d){var _0x5074d6=this;return new Promise(function(_0x35cdfc,_0x2deb2b){return db[_0x39e3('0x15')][_0x39e3('0x16')](_0x1e2a2d['body'],{'raw':_0x1e2a2d[_0x39e3('0x17')]?_0x1e2a2d['options'][_0x39e3('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e2a2d[_0x39e3('0x17')]?_0x1e2a2d['options'][_0x39e3('0x19')]||null:null,'attributes':_0x1e2a2d[_0x39e3('0x17')]?_0x1e2a2d[_0x39e3('0x17')][_0x39e3('0x1a')]||null:null,'limit':_0x1e2a2d['options']?_0x1e2a2d[_0x39e3('0x17')]['limit']||null:null})['then'](function(_0x2b9a07){logger[_0x39e3('0x11')](_0x39e3('0x14'),_0x1e2a2d);logger[_0x39e3('0x1b')]('UpdateFaxApplication',_0x1e2a2d,JSON[_0x39e3('0x1c')](_0x2b9a07));_0x35cdfc(_0x2b9a07);})[_0x39e3('0x13')](function(_0x50b636){logger[_0x39e3('0xf')]('UpdateFaxApplication',_0x50b636[_0x39e3('0x10')],_0x1e2a2d);_0x2deb2b(_0x5074d6[_0x39e3('0xf')](0x1f4,_0x50b636[_0x39e3('0x10')]));});});}; \ No newline at end of file +var _0xb309=['then','info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','FaxApplication','update','body','raw','options','attributes','limit','UpdateFaxApplication','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','http'];(function(_0x48a132,_0x130c60){var _0xcc5b56=function(_0x5d17fe){while(--_0x5d17fe){_0x48a132['push'](_0x48a132['shift']());}};_0xcc5b56(++_0x130c60);}(_0xb309,0x84));var _0x9b30=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0xb309[_0x55c1f0];return _0x1530fa;};'use strict';var _=require(_0x9b30('0x0'));var util=require(_0x9b30('0x1'));var moment=require(_0x9b30('0x2'));var BPromise=require(_0x9b30('0x3'));var rs=require(_0x9b30('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b30('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9b30('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9b30('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1fc630,_0x51cc50,_0x53248a){return new BPromise(function(_0x33e738,_0x2b697f){return client['request'](_0x1fc630,_0x53248a)[_0x9b30('0x8')](function(_0x4ca0f5){logger[_0x9b30('0x9')]('FaxApplication,\x20%s,\x20%s',_0x51cc50,'request\x20sent');logger[_0x9b30('0xa')](_0x9b30('0xb'),_0x51cc50,_0x9b30('0xc'),JSON[_0x9b30('0xd')](_0x4ca0f5));if(_0x4ca0f5[_0x9b30('0xe')]){if(_0x4ca0f5[_0x9b30('0xe')][_0x9b30('0xf')]===0x1f4){logger[_0x9b30('0xe')](_0x9b30('0x10'),_0x51cc50,_0x4ca0f5['error']['message']);return _0x2b697f(_0x4ca0f5['error'][_0x9b30('0x11')]);}logger[_0x9b30('0xe')]('FaxApplication,\x20%s,\x20%s',_0x51cc50,_0x4ca0f5[_0x9b30('0xe')][_0x9b30('0x11')]);return _0x33e738(_0x4ca0f5['error'][_0x9b30('0x11')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x51cc50,_0x9b30('0xc'));_0x33e738(_0x4ca0f5[_0x9b30('0x12')]['message']);}})['catch'](function(_0xc735f2){logger[_0x9b30('0xe')](_0x9b30('0x10'),_0x51cc50,_0xc735f2);_0x2b697f(_0xc735f2);});});}exports['UpdateFaxApplication']=function(_0x10004a){var _0x56a940=this;return new Promise(function(_0x4346e7,_0x54d241){return db[_0x9b30('0x13')][_0x9b30('0x14')](_0x10004a[_0x9b30('0x15')],{'raw':_0x10004a['options']?_0x10004a['options'][_0x9b30('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10004a[_0x9b30('0x17')]?_0x10004a['options']['where']||null:null,'attributes':_0x10004a[_0x9b30('0x17')]?_0x10004a[_0x9b30('0x17')][_0x9b30('0x18')]||null:null,'limit':_0x10004a[_0x9b30('0x17')]?_0x10004a['options'][_0x9b30('0x19')]||null:null})[_0x9b30('0x8')](function(_0x1a1444){logger[_0x9b30('0x9')](_0x9b30('0x1a'),_0x10004a);logger['debug'](_0x9b30('0x1a'),_0x10004a,JSON['stringify'](_0x1a1444));_0x4346e7(_0x1a1444);})[_0x9b30('0x1b')](function(_0x4f4bda){logger[_0x9b30('0xe')](_0x9b30('0x1a'),_0x4f4bda[_0x9b30('0x11')],_0x10004a);_0x54d241(_0x56a940[_0x9b30('0xe')](0x1f4,_0x4f4bda[_0x9b30('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d18404e..9117e24 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 _0x0abf=['isAuthenticated','index','show','post','put','/:id','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0xb')]('/',auth[_0xf0ab('0x8')](),controller['create']);router[_0xf0ab('0xc')](_0xf0ab('0xd'),auth[_0xf0ab('0x8')](),controller['update']);router['delete'](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0xe')]);module[_0xf0ab('0xf')]=router; \ No newline at end of file +var _0xa571=['index','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x927e60,_0x354a26){var _0x3bb094=function(_0x2f40cb){while(--_0x2f40cb){_0x927e60['push'](_0x927e60['shift']());}};_0x3bb094(++_0x354a26);}(_0xa571,0x107));var _0x1a57=function(_0x2d3116,_0x29e625){_0x2d3116=_0x2d3116-0x0;var _0x3b27b1=_0xa571[_0x2d3116];return _0x3b27b1;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./faxApplication.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0xb')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0xc')]);router['put'](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0xe')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);module[_0x1a57('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 904e01b..d32c180 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 _0x0adf=['out','INTEGER','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0xe675ad,_0x511282){var _0x59005f=function(_0x49dc09){while(--_0x49dc09){_0xe675ad['push'](_0xe675ad['shift']());}};_0x59005f(++_0x511282);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x34e8ea,_0x5a5e15){_0x34e8ea=_0x34e8ea-0x0;var _0x541235=_0x0adf[_0x34e8ea];return _0x541235;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'closed':{'type':Sequelize[_0xf0ad('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf0ad('0x3')]},'secondDisposition':{'type':Sequelize[_0xf0ad('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf0ad('0x3')]},'note':{'type':Sequelize[_0xf0ad('0x3')]},'read1stAt':{'type':Sequelize[_0xf0ad('0x4')]},'fax':{'type':Sequelize[_0xf0ad('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf0ad('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf0ad('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf0ad('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xf0ad('0x7')]}}; \ No newline at end of file +var _0x6d38=['DATE','STRING','ENUM','out','INTEGER','exports','BOOLEAN'];(function(_0x12006f,_0x12fd6e){var _0xf1d907=function(_0x12b3df){while(--_0x12b3df){_0x12006f['push'](_0x12006f['shift']());}};_0xf1d907(++_0x12fd6e);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6d38[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require('sequelize');module[_0x86d3('0x0')]={'closed':{'type':Sequelize[_0x86d3('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x86d3('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x86d3('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x86d3('0x2')]},'fax':{'type':Sequelize[_0x86d3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x86d3('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x86d3('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x86d3('0x4')]('in',_0x86d3('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x86d3('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index e3eb243..04f131c 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 _0x08e9=['ids','omit','findOne','hasOwnProperty','nolimit','sort','where','pick','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','findAll','color','removeTags','download','unix','join','root','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','json','undefined','limit','offset','count','set','Content-Range','update','then','destroy','status','sendStatus','stack','name','send','index','map','FaxInteraction','fieldName','key','getOptions','query','keys','rawAttributes','filters','attributes','intersection','model','fields','length','includeAll','include','find','catch','create','body','params','describe','addMessage','FaxMessage'];(function(_0x2e8180,_0x2eae3a){var _0x53894d=function(_0x3650c7){while(--_0x3650c7){_0x2e8180['push'](_0x2e8180['shift']());}};_0x53894d(++_0x2eae3a);}(_0x08e9,0x8d));var _0x908e=function(_0x5baa98,_0x9e5c5){_0x5baa98=_0x5baa98-0x0;var _0x5b8e22=_0x08e9[_0x5baa98];return _0x5b8e22;};'use strict';var rimraf=require(_0x908e('0x0'));var zipdir=require('zip-dir');var moment=require(_0x908e('0x1'));var BPromise=require(_0x908e('0x2'));var util=require(_0x908e('0x3'));var path=require(_0x908e('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x908e('0x5'));var interaction=require(_0x908e('0x6'));var qs=require(_0x908e('0x7'));var logger=require(_0x908e('0x8'))(_0x908e('0x9'));var config=require(_0x908e('0xa'));var db=require(_0x908e('0xb'))['db'];config[_0x908e('0xc')]=_[_0x908e('0xd')](config[_0x908e('0xc')],{'host':_0x908e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x908e('0xc')]));require(_0x908e('0xf'))[_0x908e('0x10')](socket);function respondWithStatusCode(_0x5b92a9,_0x5f41b2){_0x5f41b2=_0x5f41b2||0xcc;return function(_0x25b12f){if(_0x25b12f){return _0x5b92a9['sendStatus'](_0x5f41b2);}return _0x5b92a9['status'](_0x5f41b2)['end']();};}function respondWithResult(_0x20aa08,_0x2fe9e0){_0x2fe9e0=_0x2fe9e0||0xc8;return function(_0x499509){if(_0x499509){return _0x20aa08['status'](_0x2fe9e0)[_0x908e('0x11')](_0x499509);}};}function respondWithFilteredResult(_0x55a6aa,_0x4fad47){return function(_0x2c9d1a){if(_0x2c9d1a){var _0x146f65=typeof _0x4fad47['offset']===_0x908e('0x12')&&typeof _0x4fad47[_0x908e('0x13')]==='undefined';var _0x4b4065=_0x2c9d1a['count'];var _0x24d87d=_0x146f65?0x0:_0x4fad47[_0x908e('0x14')];var _0x2c8ac0=_0x146f65?_0x2c9d1a[_0x908e('0x15')]:_0x4fad47[_0x908e('0x14')]+_0x4fad47[_0x908e('0x13')];var _0x23d952;if(_0x2c8ac0>=_0x4b4065){_0x2c8ac0=_0x4b4065;_0x23d952=0xc8;}else{_0x23d952=0xce;}_0x55a6aa['status'](_0x23d952);return _0x55a6aa[_0x908e('0x16')](_0x908e('0x17'),_0x24d87d+'-'+_0x2c8ac0+'/'+_0x4b4065)[_0x908e('0x11')](_0x2c9d1a);}return null;};}function saveUpdates(_0x3016fa){return function(_0x322f39){if(_0x322f39){return _0x322f39[_0x908e('0x18')](_0x3016fa)[_0x908e('0x19')](function(_0x24ccc1){return _0x24ccc1;});}return null;};}function removeEntity(_0x208545){return function(_0x1688c3){if(_0x1688c3){return _0x1688c3[_0x908e('0x1a')]()[_0x908e('0x19')](function(){_0x208545[_0x908e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25cad5){return function(_0x2b180c){if(!_0x2b180c){_0x25cad5[_0x908e('0x1c')](0x194);}return _0x2b180c;};}function handleError(_0x263d0c,_0x16101d){_0x16101d=_0x16101d||0x1f4;return function(_0x447e56){logger['error'](_0x447e56[_0x908e('0x1d')]);if(_0x447e56[_0x908e('0x1e')]){delete _0x447e56['name'];}_0x263d0c['status'](_0x16101d)[_0x908e('0x1f')](_0x447e56);};}exports[_0x908e('0x20')]=function(_0x588a1a,_0x55939d){var _0x2a323d={};var _0x623466=_[_0x908e('0x21')](db[_0x908e('0x22')]['rawAttributes'],function(_0x126251){return{'name':_0x126251[_0x908e('0x23')],'type':_0x126251['type'][_0x908e('0x24')]};});_0x2a323d=qs[_0x908e('0x25')](_0x623466,_0x588a1a);return interaction['findAll']('fax',_0x588a1a[_0x908e('0x26')],_0x588a1a['user'],_0x2a323d,_0x623466)[_0x908e('0x19')](respondWithFilteredResult(_0x55939d,_0x2a323d))['catch'](handleError(_0x55939d,null));};exports['show']=function(_0x2c86b7,_0x5c219a){var _0x733f59={'raw':![],'where':{'id':_0x2c86b7['params']['id']}},_0x57df0f={};_0x57df0f['model']=_[_0x908e('0x27')](db['FaxInteraction'][_0x908e('0x28')]);_0x57df0f[_0x908e('0x26')]=_[_0x908e('0x27')](_0x2c86b7['query']);_0x57df0f[_0x908e('0x29')]=_['intersection'](_0x57df0f['model'],_0x57df0f[_0x908e('0x26')]);_0x733f59[_0x908e('0x2a')]=_[_0x908e('0x2b')](_0x57df0f[_0x908e('0x2c')],qs['fields'](_0x2c86b7[_0x908e('0x26')][_0x908e('0x2d')]));_0x733f59[_0x908e('0x2a')]=_0x733f59['attributes'][_0x908e('0x2e')]?_0x733f59[_0x908e('0x2a')]:_0x57df0f[_0x908e('0x2c')];if(_0x2c86b7[_0x908e('0x26')][_0x908e('0x2f')]){_0x733f59[_0x908e('0x30')]=[{'all':!![]}];}_0x733f59=_['merge']({},_0x733f59,_0x2c86b7['options']);return db[_0x908e('0x22')][_0x908e('0x31')](_0x733f59)[_0x908e('0x19')](handleEntityNotFound(_0x5c219a,null))[_0x908e('0x19')](respondWithResult(_0x5c219a,null))[_0x908e('0x32')](handleError(_0x5c219a,null));};exports[_0x908e('0x33')]=function(_0x1c7714,_0x909ecc){return db[_0x908e('0x22')][_0x908e('0x33')](_0x1c7714[_0x908e('0x34')],{})[_0x908e('0x19')](respondWithResult(_0x909ecc,0xc9))[_0x908e('0x32')](handleError(_0x909ecc,null));};exports['update']=function(_0x1e4d7e,_0x1b50ca){if(_0x1e4d7e['body']['id']){delete _0x1e4d7e[_0x908e('0x34')]['id'];}return db[_0x908e('0x22')][_0x908e('0x31')]({'where':{'id':_0x1e4d7e['params']['id']}})[_0x908e('0x19')](handleEntityNotFound(_0x1b50ca,null))[_0x908e('0x19')](saveUpdates(_0x1e4d7e[_0x908e('0x34')],null))['then'](respondWithResult(_0x1b50ca,null))[_0x908e('0x32')](handleError(_0x1b50ca,null));};exports[_0x908e('0x1a')]=function(_0x34ed4f,_0x1a742e){return db[_0x908e('0x22')][_0x908e('0x31')]({'where':{'id':_0x34ed4f[_0x908e('0x35')]['id']}})[_0x908e('0x19')](handleEntityNotFound(_0x1a742e,null))[_0x908e('0x19')](removeEntity(_0x1a742e,null))['catch'](handleError(_0x1a742e,null));};exports['describe']=function(_0x55ea52,_0x1219ed){return db[_0x908e('0x22')][_0x908e('0x36')]()['then'](respondWithResult(_0x1219ed,null))[_0x908e('0x32')](handleError(_0x1219ed,null));};exports[_0x908e('0x37')]=function(_0x18d07d,_0x3219e8){return db[_0x908e('0x38')][_0x908e('0x31')]({'where':{'id':_0x18d07d['params']['id']}})[_0x908e('0x19')](handleEntityNotFound(_0x3219e8,null))['then'](function(_0x362414){if(_0x362414){return _0x362414[_0x908e('0x37')](_0x18d07d[_0x908e('0x34')][_0x908e('0x39')],_[_0x908e('0x3a')](_0x18d07d[_0x908e('0x34')],[_0x908e('0x39'),'id'])||{});}})['then'](respondWithResult(_0x3219e8,null))['catch'](handleError(_0x3219e8,null));};exports['getMessages']=function(_0x5c43bd,_0x4e4333){var _0x1d29da={'raw':![],'where':{}};var _0x5c1d88={};var _0xa13914={'count':0x0,'rows':[]};return db[_0x908e('0x22')][_0x908e('0x3b')]({'where':{'id':_0x5c43bd[_0x908e('0x35')]['id']}})[_0x908e('0x19')](handleEntityNotFound(_0x4e4333,null))[_0x908e('0x19')](function(_0x4d49e2){if(_0x4d49e2){_0x5c1d88[_0x908e('0x2c')]=_[_0x908e('0x27')](db[_0x908e('0x38')][_0x908e('0x28')]);_0x5c1d88[_0x908e('0x26')]=_[_0x908e('0x27')](_0x5c43bd[_0x908e('0x26')]);_0x5c1d88[_0x908e('0x29')]=_[_0x908e('0x2b')](_0x5c1d88[_0x908e('0x2c')],_0x5c1d88[_0x908e('0x26')]);_0x1d29da['attributes']=_['intersection'](_0x5c1d88['model'],qs[_0x908e('0x2d')](_0x5c43bd[_0x908e('0x26')][_0x908e('0x2d')]));_0x1d29da[_0x908e('0x2a')]=_0x1d29da[_0x908e('0x2a')][_0x908e('0x2e')]?_0x1d29da[_0x908e('0x2a')]:_0x5c1d88[_0x908e('0x2c')];if(!_0x5c43bd[_0x908e('0x26')][_0x908e('0x3c')](_0x908e('0x3d'))){_0x1d29da[_0x908e('0x13')]=qs[_0x908e('0x13')](_0x5c43bd[_0x908e('0x26')][_0x908e('0x13')]);_0x1d29da['offset']=qs[_0x908e('0x14')](_0x5c43bd['query'][_0x908e('0x14')]);}_0x1d29da['order']=qs[_0x908e('0x3e')](_0x5c43bd[_0x908e('0x26')][_0x908e('0x3e')]);_0x1d29da[_0x908e('0x3f')]=qs[_0x908e('0x29')](_[_0x908e('0x40')](_0x5c43bd['query'],_0x5c1d88[_0x908e('0x29')]));_0x1d29da['where']['FaxInteractionId']=_0x4d49e2['id'];if(_0x5c43bd[_0x908e('0x26')][_0x908e('0x41')]){_0x1d29da[_0x908e('0x3f')]=_[_0x908e('0x42')](_0x1d29da[_0x908e('0x3f')],{'$or':_['map'](_0x1d29da[_0x908e('0x2a')],function(_0x30c532){var _0x5b5b81={};_0x5b5b81[_0x30c532]={'$like':'%'+_0x5c43bd[_0x908e('0x26')][_0x908e('0x41')]+'%'};return _0x5b5b81;})});}if(_0x5c43bd[_0x908e('0x26')]['$gte']){var _0x18279c=_0x5c43bd[_0x908e('0x26')][_0x908e('0x43')]['split'](',');var _0xde3eb3={};_0xde3eb3[_0x18279c[0x0]]={'$gte':moment(_0x18279c[0x1])[_0x908e('0x44')](_0x908e('0x45'))};_0x1d29da[_0x908e('0x3f')]=_[_0x908e('0x42')](_0x1d29da[_0x908e('0x3f')],_0xde3eb3);}_0x1d29da=_[_0x908e('0x42')]({},_0x1d29da,_0x5c43bd[_0x908e('0x46')]);return db[_0x908e('0x38')][_0x908e('0x15')]({'where':_0x1d29da[_0x908e('0x3f')]})[_0x908e('0x19')](function(_0x4caf02){_0xa13914['count']=_0x4caf02;if(_0x5c43bd['query']['includeAll']){_0x1d29da[_0x908e('0x30')]=[{'all':!![]}];}return db[_0x908e('0x38')]['findAll'](_0x1d29da);})[_0x908e('0x19')](function(_0x4d0dd0){_0xa13914[_0x908e('0x47')]=_0x4d0dd0;return _0xa13914;});}})[_0x908e('0x19')](respondWithFilteredResult(_0x4e4333,_0x1d29da))['catch'](handleError(_0x4e4333,null));};exports[_0x908e('0x48')]=function(_0x43a6b3,_0x5f496e){return db[_0x908e('0x22')][_0x908e('0x31')]({'where':{'id':_0x43a6b3[_0x908e('0x35')]['id']}})['then'](handleEntityNotFound(_0x5f496e,null))[_0x908e('0x19')](function(_0x20d681){if(_0x20d681){return _0x20d681[_0x908e('0x49')](_0x43a6b3[_0x908e('0x34')][_0x908e('0x39')],_[_0x908e('0x3a')](_0x43a6b3[_0x908e('0x34')],[_0x908e('0x39'),'id'])||{})['spread'](function(){return db['Tag'][_0x908e('0x4a')]({'attributes':['id',_0x908e('0x1e'),_0x908e('0x4b')],'where':{'id':_0x43a6b3[_0x908e('0x34')][_0x908e('0x39')]}});})[_0x908e('0x19')](function(_0x3a0be4){socket['emit']('faxInteractionTags:save',{'id':Number(_0x43a6b3[_0x908e('0x35')]['id']),'tags':_0x3a0be4||[]});return{'id':Number(_0x43a6b3[_0x908e('0x35')]['id']),'tags':_0x3a0be4||[]};});}})[_0x908e('0x19')](respondWithResult(_0x5f496e,null))['catch'](handleError(_0x5f496e,null));};exports[_0x908e('0x4c')]=function(_0x150895,_0xf8143f){return db[_0x908e('0x22')][_0x908e('0x31')]({'where':{'id':_0x150895[_0x908e('0x35')]['id']}})['then'](handleEntityNotFound(_0xf8143f,null))['then'](function(_0x4c6a61){if(_0x4c6a61){return _0x4c6a61['removeTags'](_0x150895[_0x908e('0x26')]['ids']);}})[_0x908e('0x19')](respondWithStatusCode(_0xf8143f,null))['catch'](handleError(_0xf8143f,null));};exports[_0x908e('0x4d')]=function(_0x11f959,_0x402118){var _0x5d8408=moment()[_0x908e('0x4e')]()['toString']();var _0xb8975b=path[_0x908e('0x4f')](config[_0x908e('0x50')],'server',_0x908e('0x51'),'tmp');var _0x51a853=path[_0x908e('0x4f')](config['root'],'server',_0x908e('0x51'),_0x908e('0x52'));var _0x2c2b41=path[_0x908e('0x4f')](_0xb8975b,_0x5d8408);var _0x25ee67=util[_0x908e('0x44')](_0x908e('0x53'),_0x11f959['params']['id'],_0x5d8408);var _0x571897=path[_0x908e('0x4f')](_0xb8975b,_0x25ee67);var _0x3dc16d=[];_0x3dc16d[_0x908e('0x54')]({'model':db[_0x908e('0x55')],'as':_0x908e('0x55'),'raw':!![]});var _0x1c1596=[{'model':db[_0x908e('0x38')],'as':_0x908e('0x56'),'attributes':['id',_0x908e('0x34'),_0x908e('0x57')],'include':_0x3dc16d}];return db['FaxInteraction']['find']({'where':{'id':_0x11f959[_0x908e('0x35')]['id']},'include':_0x1c1596})[_0x908e('0x19')](handleEntityNotFound(_0x402118,null))['then'](function(_0x30855b){if(_0x30855b&&_0x30855b[_0x908e('0x56')]){var _0x50651f=_0x30855b[_0x908e('0x58')]({'plain':!![]});fs[_0x908e('0x59')](_0x2c2b41);for(var _0x5dd69e=0x0;_0x5dd69e<_0x50651f[_0x908e('0x56')]['length'];_0x5dd69e++){var _0x5a935a=_0x50651f[_0x908e('0x56')][_0x5dd69e][_0x908e('0x55')];if(_0x5a935a){var _0x4841ea=path['join'](_0x51a853,_0x5a935a[_0x908e('0x5a')]);if(fs[_0x908e('0x5b')](_0x4841ea)){fs[_0x908e('0x5c')](_0x4841ea)[_0x908e('0x5d')](fs[_0x908e('0x5e')](path[_0x908e('0x4f')](_0x2c2b41,_0x5a935a[_0x908e('0x5a')])));}}}return BPromise[_0x908e('0x5f')]()[_0x908e('0x19')](function(){return new BPromise(function(_0x31ea82,_0x59300b){zipdir(_0x2c2b41,{'saveTo':_0x571897},function(_0x1e8397,_0x3069a5){if(_0x1e8397)return _0x59300b(_0x1e8397);return _0x31ea82(_0x3069a5);});})[_0x908e('0x19')](function(){return new BPromise(function(_0x4e807c,_0x28f1b0){rimraf(_0x2c2b41,function(_0x5476dc){if(_0x5476dc)_0x28f1b0(_0x5476dc);return _0x4e807c();});});})[_0x908e('0x19')](function(){return _0x402118[_0x908e('0x4d')](_0x571897,_0x25ee67,function(_0x1a4946){if(_0x1a4946){console[_0x908e('0x60')](_0x908e('0x61'),_0x1a4946);}else{fs[_0x908e('0x62')](_0x571897);}});});});}else{return _0x402118[_0x908e('0x1c')](0xc8);}})[_0x908e('0x32')](handleError(_0x402118,null));}; \ No newline at end of file +var _0xe4b1=['spread','Tag','faxInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','pipe','log','err','unlinkSync','zip-dir','moment','bluebird','util','lodash','ioredis','../../components/interaction/service','api','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','catch','show','params','model','keys','FaxInteraction','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags'];(function(_0x44aab8,_0x1ae8aa){var _0x1f5e42=function(_0x333185){while(--_0x333185){_0x44aab8['push'](_0x44aab8['shift']());}};_0x1f5e42(++_0x1ae8aa);}(_0xe4b1,0x1bb));var _0x1e4b=function(_0x110924,_0x1374bb){_0x110924=_0x110924-0x0;var _0x12905b=_0xe4b1[_0x110924];return _0x12905b;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x1e4b('0x0'));var moment=require(_0x1e4b('0x1'));var BPromise=require(_0x1e4b('0x2'));var util=require(_0x1e4b('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x1e4b('0x4'));var Redis=require(_0x1e4b('0x5'));var interaction=require(_0x1e4b('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x1e4b('0x7'));var config=require('../../config/environment');var db=require(_0x1e4b('0x8'))['db'];config['redis']=_['defaults'](config[_0x1e4b('0x9')],{'host':_0x1e4b('0xa'),'port':0x18eb});var socket=require(_0x1e4b('0xb'))(new Redis(config[_0x1e4b('0x9')]));require(_0x1e4b('0xc'))[_0x1e4b('0xd')](socket);function respondWithStatusCode(_0x5979d,_0x1f012b){_0x1f012b=_0x1f012b||0xcc;return function(_0x1c173f){if(_0x1c173f){return _0x5979d[_0x1e4b('0xe')](_0x1f012b);}return _0x5979d[_0x1e4b('0xf')](_0x1f012b)[_0x1e4b('0x10')]();};}function respondWithResult(_0xb25307,_0xb6d1cb){_0xb6d1cb=_0xb6d1cb||0xc8;return function(_0x41bb1c){if(_0x41bb1c){return _0xb25307[_0x1e4b('0xf')](_0xb6d1cb)['json'](_0x41bb1c);}};}function respondWithFilteredResult(_0x45acf7,_0x14b797){return function(_0x4fa360){if(_0x4fa360){var _0x42c1ce=typeof _0x14b797[_0x1e4b('0x11')]==='undefined'&&typeof _0x14b797[_0x1e4b('0x12')]===_0x1e4b('0x13');var _0x5cab0a=_0x4fa360[_0x1e4b('0x14')];var _0x2ec2d0=_0x42c1ce?0x0:_0x14b797[_0x1e4b('0x11')];var _0x45faf1=_0x42c1ce?_0x4fa360[_0x1e4b('0x14')]:_0x14b797[_0x1e4b('0x11')]+_0x14b797[_0x1e4b('0x12')];var _0x3f9c4b;if(_0x45faf1>=_0x5cab0a){_0x45faf1=_0x5cab0a;_0x3f9c4b=0xc8;}else{_0x3f9c4b=0xce;}_0x45acf7[_0x1e4b('0xf')](_0x3f9c4b);return _0x45acf7[_0x1e4b('0x15')]('Content-Range',_0x2ec2d0+'-'+_0x45faf1+'/'+_0x5cab0a)['json'](_0x4fa360);}return null;};}function saveUpdates(_0x51e9ce){return function(_0x2a058e){if(_0x2a058e){return _0x2a058e[_0x1e4b('0x16')](_0x51e9ce)[_0x1e4b('0x17')](function(_0x457b71){return _0x457b71;});}return null;};}function removeEntity(_0x56914f){return function(_0xb930ec){if(_0xb930ec){return _0xb930ec[_0x1e4b('0x18')]()[_0x1e4b('0x17')](function(){_0x56914f[_0x1e4b('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x356e78){return function(_0x32fea5){if(!_0x32fea5){_0x356e78['sendStatus'](0x194);}return _0x32fea5;};}function handleError(_0x55eef0,_0x386c96){_0x386c96=_0x386c96||0x1f4;return function(_0x109806){logger[_0x1e4b('0x19')](_0x109806[_0x1e4b('0x1a')]);if(_0x109806[_0x1e4b('0x1b')]){delete _0x109806[_0x1e4b('0x1b')];}_0x55eef0[_0x1e4b('0xf')](_0x386c96)['send'](_0x109806);};}exports['index']=function(_0x5c5d69,_0x3806a9){var _0x493b38={};var _0x15621f=_[_0x1e4b('0x1c')](db['FaxInteraction'][_0x1e4b('0x1d')],function(_0x4f3cbd){return{'name':_0x4f3cbd[_0x1e4b('0x1e')],'type':_0x4f3cbd[_0x1e4b('0x1f')][_0x1e4b('0x20')]};});_0x493b38=qs[_0x1e4b('0x21')](_0x15621f,_0x5c5d69);return interaction[_0x1e4b('0x22')](_0x1e4b('0x23'),_0x5c5d69[_0x1e4b('0x24')],_0x5c5d69[_0x1e4b('0x25')],_0x493b38,_0x15621f)[_0x1e4b('0x17')](respondWithFilteredResult(_0x3806a9,_0x493b38))[_0x1e4b('0x26')](handleError(_0x3806a9,null));};exports[_0x1e4b('0x27')]=function(_0x37b8cc,_0x473de9){var _0x5dfb71={'raw':![],'where':{'id':_0x37b8cc[_0x1e4b('0x28')]['id']}},_0x5e2296={};_0x5e2296[_0x1e4b('0x29')]=_[_0x1e4b('0x2a')](db[_0x1e4b('0x2b')][_0x1e4b('0x1d')]);_0x5e2296['query']=_['keys'](_0x37b8cc[_0x1e4b('0x24')]);_0x5e2296[_0x1e4b('0x2c')]=_[_0x1e4b('0x2d')](_0x5e2296[_0x1e4b('0x29')],_0x5e2296[_0x1e4b('0x24')]);_0x5dfb71[_0x1e4b('0x2e')]=_[_0x1e4b('0x2d')](_0x5e2296[_0x1e4b('0x29')],qs['fields'](_0x37b8cc['query'][_0x1e4b('0x2f')]));_0x5dfb71[_0x1e4b('0x2e')]=_0x5dfb71[_0x1e4b('0x2e')][_0x1e4b('0x30')]?_0x5dfb71[_0x1e4b('0x2e')]:_0x5e2296['model'];if(_0x37b8cc['query'][_0x1e4b('0x31')]){_0x5dfb71[_0x1e4b('0x32')]=[{'all':!![]}];}_0x5dfb71=_[_0x1e4b('0x33')]({},_0x5dfb71,_0x37b8cc[_0x1e4b('0x34')]);return db[_0x1e4b('0x2b')][_0x1e4b('0x35')](_0x5dfb71)[_0x1e4b('0x17')](handleEntityNotFound(_0x473de9,null))['then'](respondWithResult(_0x473de9,null))[_0x1e4b('0x26')](handleError(_0x473de9,null));};exports[_0x1e4b('0x36')]=function(_0x398fbb,_0x34e293){return db[_0x1e4b('0x2b')]['create'](_0x398fbb[_0x1e4b('0x37')],{})[_0x1e4b('0x17')](respondWithResult(_0x34e293,0xc9))[_0x1e4b('0x26')](handleError(_0x34e293,null));};exports[_0x1e4b('0x16')]=function(_0x226f3f,_0x18763e){if(_0x226f3f[_0x1e4b('0x37')]['id']){delete _0x226f3f[_0x1e4b('0x37')]['id'];}return db['FaxInteraction'][_0x1e4b('0x35')]({'where':{'id':_0x226f3f[_0x1e4b('0x28')]['id']}})[_0x1e4b('0x17')](handleEntityNotFound(_0x18763e,null))['then'](saveUpdates(_0x226f3f[_0x1e4b('0x37')],null))['then'](respondWithResult(_0x18763e,null))['catch'](handleError(_0x18763e,null));};exports[_0x1e4b('0x18')]=function(_0x32585f,_0x43d821){return db[_0x1e4b('0x2b')][_0x1e4b('0x35')]({'where':{'id':_0x32585f[_0x1e4b('0x28')]['id']}})[_0x1e4b('0x17')](handleEntityNotFound(_0x43d821,null))[_0x1e4b('0x17')](removeEntity(_0x43d821,null))[_0x1e4b('0x26')](handleError(_0x43d821,null));};exports[_0x1e4b('0x38')]=function(_0x5891e8,_0x160c7a){return db[_0x1e4b('0x2b')][_0x1e4b('0x38')]()[_0x1e4b('0x17')](respondWithResult(_0x160c7a,null))['catch'](handleError(_0x160c7a,null));};exports[_0x1e4b('0x39')]=function(_0x30ecb1,_0x25a65e){return db[_0x1e4b('0x3a')]['find']({'where':{'id':_0x30ecb1[_0x1e4b('0x28')]['id']}})[_0x1e4b('0x17')](handleEntityNotFound(_0x25a65e,null))[_0x1e4b('0x17')](function(_0x274bfe){if(_0x274bfe){return _0x274bfe[_0x1e4b('0x39')](_0x30ecb1['body']['ids'],_[_0x1e4b('0x3b')](_0x30ecb1[_0x1e4b('0x37')],[_0x1e4b('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x25a65e,null))[_0x1e4b('0x26')](handleError(_0x25a65e,null));};exports[_0x1e4b('0x3d')]=function(_0x1a19ca,_0x2b9835){var _0x19443e={'raw':![],'where':{}};var _0x1eeaf0={};var _0xd1c068={'count':0x0,'rows':[]};return db[_0x1e4b('0x2b')][_0x1e4b('0x3e')]({'where':{'id':_0x1a19ca['params']['id']}})['then'](handleEntityNotFound(_0x2b9835,null))['then'](function(_0x5415a2){if(_0x5415a2){_0x1eeaf0['model']=_[_0x1e4b('0x2a')](db[_0x1e4b('0x3a')]['rawAttributes']);_0x1eeaf0['query']=_[_0x1e4b('0x2a')](_0x1a19ca[_0x1e4b('0x24')]);_0x1eeaf0[_0x1e4b('0x2c')]=_[_0x1e4b('0x2d')](_0x1eeaf0[_0x1e4b('0x29')],_0x1eeaf0[_0x1e4b('0x24')]);_0x19443e['attributes']=_[_0x1e4b('0x2d')](_0x1eeaf0[_0x1e4b('0x29')],qs[_0x1e4b('0x2f')](_0x1a19ca['query'][_0x1e4b('0x2f')]));_0x19443e[_0x1e4b('0x2e')]=_0x19443e[_0x1e4b('0x2e')]['length']?_0x19443e[_0x1e4b('0x2e')]:_0x1eeaf0[_0x1e4b('0x29')];if(!_0x1a19ca[_0x1e4b('0x24')][_0x1e4b('0x3f')](_0x1e4b('0x40'))){_0x19443e[_0x1e4b('0x12')]=qs['limit'](_0x1a19ca[_0x1e4b('0x24')][_0x1e4b('0x12')]);_0x19443e[_0x1e4b('0x11')]=qs[_0x1e4b('0x11')](_0x1a19ca['query']['offset']);}_0x19443e[_0x1e4b('0x41')]=qs[_0x1e4b('0x42')](_0x1a19ca['query'][_0x1e4b('0x42')]);_0x19443e[_0x1e4b('0x43')]=qs[_0x1e4b('0x2c')](_[_0x1e4b('0x44')](_0x1a19ca[_0x1e4b('0x24')],_0x1eeaf0['filters']));_0x19443e[_0x1e4b('0x43')][_0x1e4b('0x45')]=_0x5415a2['id'];if(_0x1a19ca['query'][_0x1e4b('0x46')]){_0x19443e['where']=_[_0x1e4b('0x33')](_0x19443e['where'],{'$or':_['map'](_0x19443e[_0x1e4b('0x2e')],function(_0x404d69){var _0x1b6ca1={};_0x1b6ca1[_0x404d69]={'$like':'%'+_0x1a19ca['query'][_0x1e4b('0x46')]+'%'};return _0x1b6ca1;})});}if(_0x1a19ca['query'][_0x1e4b('0x47')]){var _0x15e389=_0x1a19ca[_0x1e4b('0x24')][_0x1e4b('0x47')][_0x1e4b('0x48')](',');var _0x4c90dc={};_0x4c90dc[_0x15e389[0x0]]={'$gte':moment(_0x15e389[0x1])['format'](_0x1e4b('0x49'))};_0x19443e['where']=_[_0x1e4b('0x33')](_0x19443e[_0x1e4b('0x43')],_0x4c90dc);}_0x19443e=_[_0x1e4b('0x33')]({},_0x19443e,_0x1a19ca['options']);return db[_0x1e4b('0x3a')][_0x1e4b('0x14')]({'where':_0x19443e[_0x1e4b('0x43')]})[_0x1e4b('0x17')](function(_0x3574d6){_0xd1c068['count']=_0x3574d6;if(_0x1a19ca[_0x1e4b('0x24')]['includeAll']){_0x19443e['include']=[{'all':!![]}];}return db['FaxMessage'][_0x1e4b('0x22')](_0x19443e);})[_0x1e4b('0x17')](function(_0x4b4632){_0xd1c068[_0x1e4b('0x4a')]=_0x4b4632;return _0xd1c068;});}})['then'](respondWithFilteredResult(_0x2b9835,_0x19443e))[_0x1e4b('0x26')](handleError(_0x2b9835,null));};exports[_0x1e4b('0x4b')]=function(_0x1d8a03,_0x1f5779){return db['FaxInteraction'][_0x1e4b('0x35')]({'where':{'id':_0x1d8a03['params']['id']}})[_0x1e4b('0x17')](handleEntityNotFound(_0x1f5779,null))[_0x1e4b('0x17')](function(_0xd016ba){if(_0xd016ba){return _0xd016ba[_0x1e4b('0x4c')](_0x1d8a03[_0x1e4b('0x37')][_0x1e4b('0x3c')],_[_0x1e4b('0x3b')](_0x1d8a03[_0x1e4b('0x37')],['ids','id'])||{})[_0x1e4b('0x4d')](function(){return db[_0x1e4b('0x4e')][_0x1e4b('0x22')]({'attributes':['id','name','color'],'where':{'id':_0x1d8a03[_0x1e4b('0x37')][_0x1e4b('0x3c')]}});})[_0x1e4b('0x17')](function(_0x3688d3){socket['emit'](_0x1e4b('0x4f'),{'id':Number(_0x1d8a03['params']['id']),'tags':_0x3688d3||[]});return{'id':Number(_0x1d8a03[_0x1e4b('0x28')]['id']),'tags':_0x3688d3||[]};});}})[_0x1e4b('0x17')](respondWithResult(_0x1f5779,null))['catch'](handleError(_0x1f5779,null));};exports['removeTags']=function(_0x27c3a1,_0x3e2414){return db[_0x1e4b('0x2b')]['find']({'where':{'id':_0x27c3a1[_0x1e4b('0x28')]['id']}})[_0x1e4b('0x17')](handleEntityNotFound(_0x3e2414,null))['then'](function(_0x36a37a){if(_0x36a37a){return _0x36a37a[_0x1e4b('0x50')](_0x27c3a1[_0x1e4b('0x24')]['ids']);}})['then'](respondWithStatusCode(_0x3e2414,null))['catch'](handleError(_0x3e2414,null));};exports[_0x1e4b('0x51')]=function(_0x5a9eea,_0xc52832){var _0x944f41=moment()[_0x1e4b('0x52')]()[_0x1e4b('0x53')]();var _0x5e85dd=path[_0x1e4b('0x54')](config['root'],_0x1e4b('0x55'),_0x1e4b('0x56'),_0x1e4b('0x57'));var _0x38204f=path[_0x1e4b('0x54')](config[_0x1e4b('0x58')],'server',_0x1e4b('0x56'),_0x1e4b('0x59'));var _0x582f65=path[_0x1e4b('0x54')](_0x5e85dd,_0x944f41);var _0x319673=util[_0x1e4b('0x5a')](_0x1e4b('0x5b'),_0x5a9eea['params']['id'],_0x944f41);var _0x58126c=path[_0x1e4b('0x54')](_0x5e85dd,_0x319673);var _0x47c932=[];_0x47c932[_0x1e4b('0x5c')]({'model':db[_0x1e4b('0x5d')],'as':_0x1e4b('0x5d'),'raw':!![]});var _0x29514a=[{'model':db['FaxMessage'],'as':_0x1e4b('0x5e'),'attributes':['id',_0x1e4b('0x37'),_0x1e4b('0x5f')],'include':_0x47c932}];return db[_0x1e4b('0x2b')]['find']({'where':{'id':_0x5a9eea['params']['id']},'include':_0x29514a})[_0x1e4b('0x17')](handleEntityNotFound(_0xc52832,null))[_0x1e4b('0x17')](function(_0x2d7985){if(_0x2d7985&&_0x2d7985[_0x1e4b('0x5e')]){var _0x2197d7=_0x2d7985[_0x1e4b('0x60')]({'plain':!![]});fs[_0x1e4b('0x61')](_0x582f65);for(var _0x352e83=0x0;_0x352e83<_0x2197d7['Messages'][_0x1e4b('0x30')];_0x352e83++){var _0xc61b9f=_0x2197d7[_0x1e4b('0x5e')][_0x352e83]['Attachment'];if(_0xc61b9f){var _0x23f997=path[_0x1e4b('0x54')](_0x38204f,_0xc61b9f[_0x1e4b('0x62')]);if(fs[_0x1e4b('0x63')](_0x23f997)){fs['createReadStream'](_0x23f997)[_0x1e4b('0x64')](fs['createWriteStream'](path[_0x1e4b('0x54')](_0x582f65,_0xc61b9f[_0x1e4b('0x62')])));}}}return BPromise['resolve']()[_0x1e4b('0x17')](function(){return new BPromise(function(_0x141712,_0x56948a){zipdir(_0x582f65,{'saveTo':_0x58126c},function(_0x274e09,_0x18efae){if(_0x274e09)return _0x56948a(_0x274e09);return _0x141712(_0x18efae);});})[_0x1e4b('0x17')](function(){return new BPromise(function(_0x2119c1,_0x3d1268){rimraf(_0x582f65,function(_0x20a7ed){if(_0x20a7ed)_0x3d1268(_0x20a7ed);return _0x2119c1();});});})[_0x1e4b('0x17')](function(){return _0xc52832[_0x1e4b('0x51')](_0x58126c,_0x319673,function(_0x1f739e){if(_0x1f739e){console[_0x1e4b('0x65')](_0x1e4b('0x66'),_0x1f739e);}else{fs[_0x1e4b('0x67')](_0x58126c);}});});});}else{return _0xc52832['sendStatus'](0xc8);}})[_0x1e4b('0x26')](handleError(_0xc52832,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 94bc1a6..5fa20de 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 _0xe942=['length','emit','catch','hasOwnProperty','hook','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','Users','map','findAll','then','setDataValue','unreadMessages'];(function(_0x46c493,_0x429a61){var _0x1cac0f=function(_0x699a6a){while(--_0x699a6a){_0x46c493['push'](_0x46c493['shift']());}};_0x1cac0f(++_0x429a61);}(_0xe942,0xe2));var _0x2e94=function(_0x3ad462,_0x363c0d){_0x3ad462=_0x3ad462-0x0;var _0x4c721b=_0xe942[_0x3ad462];return _0x4c721b;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x2e94('0x0'))['db'][_0x2e94('0x1')];var FaxMessage=require(_0x2e94('0x0'))['db'][_0x2e94('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2e94('0x3')](0x0);var events={'afterCreate':_0x2e94('0x4'),'afterUpdate':_0x2e94('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41503f){return function(_0x5e2195,_0x2219b9,_0x5542f6){_0x5e2195['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x10588d){_0x5e2195['setDataValue'](_0x2e94('0x6'),_0x10588d[_0x2e94('0x7')](function(_0x5168a2){return{'id':_0x5168a2['id']};}));return FaxMessage[_0x2e94('0x8')]({'where':{'FaxInteractionId':_0x5e2195['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2e94('0x9')](function(_0x37ad6b){_0x5e2195[_0x2e94('0xa')](_0x2e94('0xb'),_0x37ad6b[_0x2e94('0xc')]);FaxInteractionEvents[_0x2e94('0xd')](_0x41503f+':'+_0x5e2195['id'],_0x5e2195);FaxInteractionEvents[_0x2e94('0xd')](_0x41503f,_0x5e2195);_0x5542f6(null);})[_0x2e94('0xe')](_0x5542f6(null));};}for(var e in events){if(events[_0x2e94('0xf')](e)){var event=events[e];FaxInteraction[_0x2e94('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x53b7=['remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update'];(function(_0x577ef9,_0x4a529c){var _0x335e9a=function(_0x45be1b){while(--_0x45be1b){_0x577ef9['push'](_0x577ef9['shift']());}};_0x335e9a(++_0x4a529c);}(_0x53b7,0x15e));var _0x753b=function(_0x4935dd,_0x2aadcb){_0x4935dd=_0x4935dd-0x0;var _0x3cdcad=_0x53b7[_0x4935dd];return _0x3cdcad;};'use strict';var EventEmitter=require(_0x753b('0x0'));var FaxInteraction=require(_0x753b('0x1'))['db'][_0x753b('0x2')];var FaxMessage=require(_0x753b('0x1'))['db'][_0x753b('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x753b('0x4')](0x0);var events={'afterCreate':_0x753b('0x5'),'afterUpdate':_0x753b('0x6'),'afterDestroy':_0x753b('0x7')};function emitEvent(_0x4f755f){return function(_0x28aec8,_0x470cb9,_0x764219){_0x28aec8[_0x753b('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x331e45){_0x28aec8[_0x753b('0x9')](_0x753b('0xa'),_0x331e45['map'](function(_0x12e33a){return{'id':_0x12e33a['id']};}));return FaxMessage[_0x753b('0xb')]({'where':{'FaxInteractionId':_0x28aec8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x753b('0xc')](function(_0x2bbf02){_0x28aec8[_0x753b('0x9')](_0x753b('0xd'),_0x2bbf02[_0x753b('0xe')]);FaxInteractionEvents[_0x753b('0xf')](_0x4f755f+':'+_0x28aec8['id'],_0x28aec8);FaxInteractionEvents[_0x753b('0xf')](_0x4f755f,_0x28aec8);_0x764219(null);})['catch'](_0x764219(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x753b('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index e9cf18d..ff0561f 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 _0x0dfa=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0x33ce24,_0x1d1370){var _0x6c76f8=function(_0x1559bb){while(--_0x1559bb){_0x33ce24['push'](_0x33ce24['shift']());}};_0x6c76f8(++_0x1d1370);}(_0x0dfa,0x13e));var _0xa0df=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0dfa[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0xa0df('0x0'));var logger=require(_0xa0df('0x1'))(_0xa0df('0x2'));var moment=require(_0xa0df('0x3'));var BPromise=require(_0xa0df('0x4'));var rp=require(_0xa0df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0df('0x6'));var config=require(_0xa0df('0x7'));var attributes=require(_0xa0df('0x8'));module[_0xa0df('0x9')]=function(_0x2f204f,_0x5ae3c1){return _0x2f204f[_0xa0df('0xa')](_0xa0df('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f74d6,_0x3deaa6,_0x1e7482){if(_0x3f74d6[_0xa0df('0xc')](_0xa0df('0xd'))){_0x3f74d6['closedAt']=moment()[_0xa0df('0xe')](_0xa0df('0xf'));}_0x1e7482(null,_0x3f74d6);}}});}; \ No newline at end of file +var _0x9c36=['bluebird','request-promise','path','rimraf','exports','define','fax_interactions','changed','closed','closedAt','format','lodash','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c36,0xbf));var _0x69c3=function(_0x3c4338,_0x1a57df){_0x3c4338=_0x3c4338-0x0;var _0x4dbbcf=_0x9c36[_0x3c4338];return _0x4dbbcf;};'use strict';var _=require(_0x69c3('0x0'));var util=require('util');var logger=require(_0x69c3('0x1'))(_0x69c3('0x2'));var moment=require(_0x69c3('0x3'));var BPromise=require(_0x69c3('0x4'));var rp=require(_0x69c3('0x5'));var fs=require('fs');var path=require(_0x69c3('0x6'));var rimraf=require(_0x69c3('0x7'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x69c3('0x8')]=function(_0x35aa2e,_0x1f7b62){return _0x35aa2e[_0x69c3('0x9')]('FaxInteraction',attributes,{'tableName':_0x69c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36a073,_0x185e56,_0x5af53d){if(_0x36a073[_0x69c3('0xb')](_0x69c3('0xc'))){_0x36a073[_0x69c3('0xd')]=moment()[_0x69c3('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5af53d(null,_0x36a073);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index a50eeb5..def448e 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 _0x612c=['code','error','message','FaxInteraction,\x20%s,\x20%s','result','UpdateFaxInteraction','update','body','options','raw','where','limit','catch','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x612c,0x109));var _0xc612=function(_0x19bc6c,_0x3aba6a){_0x19bc6c=_0x19bc6c-0x0;var _0x9691c5=_0x612c[_0x19bc6c];return _0x9691c5;};'use strict';var _=require(_0xc612('0x0'));var util=require(_0xc612('0x1'));var moment=require(_0xc612('0x2'));var BPromise=require(_0xc612('0x3'));var rs=require(_0xc612('0x4'));var fs=require('fs');var Redis=require(_0xc612('0x5'));var db=require(_0xc612('0x6'))['db'];var utils=require(_0xc612('0x7'));var logger=require(_0xc612('0x8'))(_0xc612('0x9'));var config=require('../../config/environment');var jayson=require(_0xc612('0xa'));var client=jayson['client'][_0xc612('0xb')]({'port':0x232a});config[_0xc612('0xc')]=_[_0xc612('0xd')](config[_0xc612('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc612('0xe'))(new Redis(config[_0xc612('0xc')]));require('./faxInteraction.socket')[_0xc612('0xf')](socket);function respondWithRpcPromise(_0x118412,_0x34536c,_0x4fbf46){return new BPromise(function(_0x4b8cf9,_0x388135){return client[_0xc612('0x10')](_0x118412,_0x4fbf46)[_0xc612('0x11')](function(_0x371ff3){logger[_0xc612('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x34536c,_0xc612('0x13'));logger[_0xc612('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x34536c,_0xc612('0x13'),JSON[_0xc612('0x15')](_0x371ff3));if(_0x371ff3['error']){if(_0x371ff3['error'][_0xc612('0x16')]===0x1f4){logger[_0xc612('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x34536c,_0x371ff3['error'][_0xc612('0x18')]);return _0x388135(_0x371ff3[_0xc612('0x17')][_0xc612('0x18')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x34536c,_0x371ff3[_0xc612('0x17')][_0xc612('0x18')]);return _0x4b8cf9(_0x371ff3['error'][_0xc612('0x18')]);}else{logger[_0xc612('0x12')](_0xc612('0x19'),_0x34536c,_0xc612('0x13'));_0x4b8cf9(_0x371ff3[_0xc612('0x1a')][_0xc612('0x18')]);}})['catch'](function(_0x4ae416){logger['error'](_0xc612('0x19'),_0x34536c,_0x4ae416);_0x388135(_0x4ae416);});});}exports[_0xc612('0x1b')]=function(_0x384553){var _0x188775=this;return new Promise(function(_0x3ea76b,_0x5c7a95){return db['FaxInteraction'][_0xc612('0x1c')](_0x384553[_0xc612('0x1d')],{'raw':_0x384553[_0xc612('0x1e')]?_0x384553['options'][_0xc612('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x384553[_0xc612('0x1e')]?_0x384553[_0xc612('0x1e')][_0xc612('0x20')]||null:null,'attributes':_0x384553['options']?_0x384553[_0xc612('0x1e')]['attributes']||null:null,'limit':_0x384553[_0xc612('0x1e')]?_0x384553[_0xc612('0x1e')][_0xc612('0x21')]||null:null})[_0xc612('0x11')](function(_0x519277){logger[_0xc612('0x12')]('UpdateFaxInteraction',_0x384553);logger['debug'](_0xc612('0x1b'),_0x384553,JSON[_0xc612('0x15')](_0x519277));_0x3ea76b(_0x519277);})[_0xc612('0x22')](function(_0x1308f6){logger[_0xc612('0x17')](_0xc612('0x1b'),_0x1308f6[_0xc612('0x18')],_0x384553);_0x5c7a95(_0x188775['error'](0x1f4,_0x1308f6[_0xc612('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4cbb30){return new Promise(function(_0x320f7c,_0x532ac6){return db['FaxInteraction'][_0xc612('0x23')]({'where':_0x4cbb30['options']?_0x4cbb30[_0xc612('0x1e')][_0xc612('0x20')]||null:null})[_0xc612('0x11')](function(_0x49046a){if(_0x49046a){return _0x49046a[_0xc612('0x24')](_0x4cbb30['body'][_0xc612('0x25')],_[_0xc612('0x26')](_0x4cbb30[_0xc612('0x1d')],[_0xc612('0x25'),'id'])||{});}})[_0xc612('0x27')](function(_0x221148){logger[_0xc612('0x12')](_0xc612('0x28'),_0x4cbb30);logger[_0xc612('0x14')]('AddTags',_0x4cbb30,JSON[_0xc612('0x15')](_0x221148));_0x320f7c(_0x221148);})['catch'](function(_0x36d672){logger[_0xc612('0x17')]('AddTags',_0x36d672[_0xc612('0x18')],_0x4cbb30);_0x532ac6(_this[_0xc612('0x17')](0x1f4,_0x36d672[_0xc612('0x18')]));});});}; \ No newline at end of file +var _0x2d16=['stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','then','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x486d0d,_0x316819){var _0x2d4ab6=function(_0x94cab4){while(--_0x94cab4){_0x486d0d['push'](_0x486d0d['shift']());}};_0x2d4ab6(++_0x316819);}(_0x2d16,0x104));var _0x62d1=function(_0x51ca05,_0x2bbdce){_0x51ca05=_0x51ca05-0x0;var _0x481d3a=_0x2d16[_0x51ca05];return _0x481d3a;};'use strict';var _=require(_0x62d1('0x0'));var util=require(_0x62d1('0x1'));var moment=require(_0x62d1('0x2'));var BPromise=require(_0x62d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x62d1('0x4'));var logger=require(_0x62d1('0x5'))(_0x62d1('0x6'));var config=require(_0x62d1('0x7'));var jayson=require(_0x62d1('0x8'));var client=jayson['client'][_0x62d1('0x9')]({'port':0x232a});config[_0x62d1('0xa')]=_[_0x62d1('0xb')](config[_0x62d1('0xa')],{'host':_0x62d1('0xc'),'port':0x18eb});var socket=require(_0x62d1('0xd'))(new Redis(config['redis']));require(_0x62d1('0xe'))['register'](socket);function respondWithRpcPromise(_0x556596,_0x338b0a,_0x3773f3){return new BPromise(function(_0x5ca3e8,_0xa3f043){return client[_0x62d1('0xf')](_0x556596,_0x3773f3)['then'](function(_0x5f4506){logger[_0x62d1('0x10')](_0x62d1('0x11'),_0x338b0a,_0x62d1('0x12'));logger[_0x62d1('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x338b0a,_0x62d1('0x12'),JSON[_0x62d1('0x14')](_0x5f4506));if(_0x5f4506[_0x62d1('0x15')]){if(_0x5f4506[_0x62d1('0x15')][_0x62d1('0x16')]===0x1f4){logger['error'](_0x62d1('0x11'),_0x338b0a,_0x5f4506[_0x62d1('0x15')][_0x62d1('0x17')]);return _0xa3f043(_0x5f4506[_0x62d1('0x15')][_0x62d1('0x17')]);}logger['error'](_0x62d1('0x11'),_0x338b0a,_0x5f4506['error']['message']);return _0x5ca3e8(_0x5f4506['error'][_0x62d1('0x17')]);}else{logger['info'](_0x62d1('0x11'),_0x338b0a,_0x62d1('0x12'));_0x5ca3e8(_0x5f4506[_0x62d1('0x18')][_0x62d1('0x17')]);}})[_0x62d1('0x19')](function(_0x4a1ce0){logger[_0x62d1('0x15')](_0x62d1('0x11'),_0x338b0a,_0x4a1ce0);_0xa3f043(_0x4a1ce0);});});}exports[_0x62d1('0x1a')]=function(_0x72333d){var _0x1ecf95=this;return new Promise(function(_0x43f7df,_0x5582a1){return db[_0x62d1('0x1b')][_0x62d1('0x1c')](_0x72333d['body'],{'raw':_0x72333d[_0x62d1('0x1d')]?_0x72333d['options'][_0x62d1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x72333d[_0x62d1('0x1d')]?_0x72333d[_0x62d1('0x1d')][_0x62d1('0x1f')]||null:null,'attributes':_0x72333d['options']?_0x72333d[_0x62d1('0x1d')][_0x62d1('0x20')]||null:null,'limit':_0x72333d['options']?_0x72333d['options'][_0x62d1('0x21')]||null:null})[_0x62d1('0x22')](function(_0x87c642){logger[_0x62d1('0x10')]('UpdateFaxInteraction',_0x72333d);logger['debug'](_0x62d1('0x1a'),_0x72333d,JSON[_0x62d1('0x14')](_0x87c642));_0x43f7df(_0x87c642);})[_0x62d1('0x19')](function(_0xf56f58){logger[_0x62d1('0x15')](_0x62d1('0x1a'),_0xf56f58[_0x62d1('0x17')],_0x72333d);_0x5582a1(_0x1ecf95[_0x62d1('0x15')](0x1f4,_0xf56f58[_0x62d1('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x51262a){return new Promise(function(_0x22d99f,_0x47f83c){return db['FaxInteraction']['find']({'where':_0x51262a[_0x62d1('0x1d')]?_0x51262a[_0x62d1('0x1d')][_0x62d1('0x1f')]||null:null})[_0x62d1('0x22')](function(_0x52cb69){if(_0x52cb69){return _0x52cb69['addTags'](_0x51262a[_0x62d1('0x23')][_0x62d1('0x24')],_[_0x62d1('0x25')](_0x51262a[_0x62d1('0x23')],['ids','id'])||{});}})[_0x62d1('0x26')](function(_0x597752){logger[_0x62d1('0x10')](_0x62d1('0x27'),_0x51262a);logger['debug']('AddTags',_0x51262a,JSON[_0x62d1('0x14')](_0x597752));_0x22d99f(_0x597752);})[_0x62d1('0x19')](function(_0xe8f773){logger[_0x62d1('0x15')]('AddTags',_0xe8f773['message'],_0x51262a);_0x47f83c(_this[_0x62d1('0x15')](0x1f4,_0xe8f773[_0x62d1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 5d3fd52..54ae4a5 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 _0x535b=['remove','update','emit','removeListener','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x12085d,_0x896e5e){var _0x3c0c45=function(_0x192bda){while(--_0x192bda){_0x12085d['push'](_0x12085d['shift']());}};_0x3c0c45(++_0x896e5e);}(_0x535b,0x1ae));var _0xb535=function(_0xefb9f4,_0x31b113){_0xefb9f4=_0xefb9f4-0x0;var _0x2953c3=_0x535b[_0xefb9f4];return _0x2953c3;};'use strict';var FaxInteractionEvents=require(_0xb535('0x0'));var events=[_0xb535('0x1'),_0xb535('0x2'),_0xb535('0x3')];function createListener(_0x5cf057,_0x162095){return function(_0x49f4eb){_0x162095[_0xb535('0x4')](_0x5cf057,_0x49f4eb);};}function removeListener(_0x22769,_0x299899){return function(){FaxInteractionEvents[_0xb535('0x5')](_0x22769,_0x299899);};}exports['register']=function(_0x483788){for(var _0xd8743=0x0,_0xde5bca=events[_0xb535('0x6')];_0xd8743<_0xde5bca;_0xd8743++){var _0x2cafe3=events[_0xd8743];var _0x58641c=createListener(_0xb535('0x7')+_0x2cafe3,_0x483788);FaxInteractionEvents['on'](_0x2cafe3,_0x58641c);}}; \ No newline at end of file +var _0x5d21=['removeListener','length','faxInteraction:','./faxInteraction.events','save','emit'];(function(_0x3a4bf2,_0x28258b){var _0x327929=function(_0x543f67){while(--_0x543f67){_0x3a4bf2['push'](_0x3a4bf2['shift']());}};_0x327929(++_0x28258b);}(_0x5d21,0x99));var _0x15d2=function(_0x58ba65,_0x10b3bb){_0x58ba65=_0x58ba65-0x0;var _0x2d890b=_0x5d21[_0x58ba65];return _0x2d890b;};'use strict';var FaxInteractionEvents=require(_0x15d2('0x0'));var events=[_0x15d2('0x1'),'remove','update'];function createListener(_0x4b7c62,_0x224194){return function(_0x6cb90f){_0x224194[_0x15d2('0x2')](_0x4b7c62,_0x6cb90f);};}function removeListener(_0xe44898,_0x2b83f3){return function(){FaxInteractionEvents[_0x15d2('0x3')](_0xe44898,_0x2b83f3);};}exports['register']=function(_0x3e3a39){for(var _0x488ce5=0x0,_0x1bacac=events[_0x15d2('0x4')];_0x488ce5<_0x1bacac;_0x488ce5++){var _0x518990=events[_0x488ce5];var _0x10f0cf=createListener(_0x15d2('0x5')+_0x518990,_0x3e3a39);FaxInteractionEvents['on'](_0x518990,_0x10f0cf);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 3776eb7..2bca567 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 _0x1a47=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','/:id','/:id/messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a47,0xe4));var _0x71a4=function(_0x2bb93c,_0x32b2fb){_0x2bb93c=_0x2bb93c-0x0;var _0x3aca85=_0x1a47[_0x2bb93c];return _0x3aca85;};'use strict';var multer=require('multer');var util=require(_0x71a4('0x0'));var path=require('path');var timeout=require(_0x71a4('0x1'));var express=require(_0x71a4('0x2'));var router=express[_0x71a4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x71a4('0x4'));var config=require(_0x71a4('0x5'));var controller=require(_0x71a4('0x6'));router[_0x71a4('0x7')]('/',auth[_0x71a4('0x8')](),controller['index']);router[_0x71a4('0x7')](_0x71a4('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x71a4('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x71a4('0x7')](_0x71a4('0xb'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x71a4('0xc'),auth[_0x71a4('0x8')](),controller[_0x71a4('0xd')]);router[_0x71a4('0xe')]('/',auth[_0x71a4('0x8')](),controller[_0x71a4('0xf')]);router[_0x71a4('0xe')](_0x71a4('0xb'),auth[_0x71a4('0x8')](),controller[_0x71a4('0x10')]);router[_0x71a4('0xe')](_0x71a4('0x11'),auth[_0x71a4('0x8')](),interaction[_0x71a4('0x12')]('fax',_0x71a4('0x13')),controller[_0x71a4('0x14')]);router[_0x71a4('0x15')](_0x71a4('0xa'),auth['isAuthenticated'](),interaction[_0x71a4('0x12')](_0x71a4('0x16'),_0x71a4('0x17')),controller[_0x71a4('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x71a4('0x12')]('fax',_0x71a4('0x19')),controller[_0x71a4('0x1a')]);router[_0x71a4('0x1b')](_0x71a4('0x11'),auth[_0x71a4('0x8')](),controller[_0x71a4('0x1c')]);module[_0x71a4('0x1d')]=router; \ No newline at end of file +var _0xa1dd=['index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','post','create','/:id/tags','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','tracked','faxinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get'];(function(_0xf2b443,_0x3cf032){var _0x263c99=function(_0x363533){while(--_0x363533){_0xf2b443['push'](_0xf2b443['shift']());}};_0x263c99(++_0x3cf032);}(_0xa1dd,0x1e5));var _0xda1d=function(_0x723026,_0x5e6ff0){_0x723026=_0x723026-0x0;var _0x551aa9=_0xa1dd[_0x723026];return _0x551aa9;};'use strict';var multer=require(_0xda1d('0x0'));var util=require('util');var path=require(_0xda1d('0x1'));var timeout=require(_0xda1d('0x2'));var express=require(_0xda1d('0x3'));var router=express[_0xda1d('0x4')]();var fs_extra=require(_0xda1d('0x5'));var auth=require(_0xda1d('0x6'));var interaction=require(_0xda1d('0x7'));var config=require('../../config/environment');var controller=require(_0xda1d('0x8'));router[_0xda1d('0x9')]('/',auth['isAuthenticated'](),controller[_0xda1d('0xa')]);router[_0xda1d('0x9')](_0xda1d('0xb'),auth[_0xda1d('0xc')](),controller[_0xda1d('0xd')]);router[_0xda1d('0x9')](_0xda1d('0xe'),auth[_0xda1d('0xc')](),controller[_0xda1d('0xf')]);router[_0xda1d('0x9')](_0xda1d('0x10'),auth[_0xda1d('0xc')](),controller['getMessages']);router[_0xda1d('0x9')](_0xda1d('0x11'),auth['isAuthenticated'](),controller['download']);router[_0xda1d('0x12')]('/',auth[_0xda1d('0xc')](),controller[_0xda1d('0x13')]);router[_0xda1d('0x12')]('/:id/messages',auth[_0xda1d('0xc')](),controller['addMessage']);router[_0xda1d('0x12')](_0xda1d('0x14'),auth[_0xda1d('0xc')](),interaction['tracked'](_0xda1d('0x15'),_0xda1d('0x16')),controller[_0xda1d('0x17')]);router[_0xda1d('0x18')](_0xda1d('0xe'),auth[_0xda1d('0xc')](),interaction['tracked'](_0xda1d('0x15'),_0xda1d('0x19')),controller[_0xda1d('0x1a')]);router[_0xda1d('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0xda1d('0x1c')](_0xda1d('0x15'),_0xda1d('0x1d')),controller[_0xda1d('0x1e')]);router['delete'](_0xda1d('0x14'),auth['isAuthenticated'](),controller[_0xda1d('0x1f')]);module[_0xda1d('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 803b152..6d1cb74 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 _0x4a81=['DATE','sequelize','exports','TEXT','medium','out'];(function(_0x13f514,_0x1ec5e2){var _0xdd2a85=function(_0x524fb6){while(--_0x524fb6){_0x13f514['push'](_0x13f514['shift']());}};_0xdd2a85(++_0x1ec5e2);}(_0x4a81,0x1b7));var _0x14a8=function(_0x5cd848,_0x43b34c){_0x5cd848=_0x5cd848-0x0;var _0x9e8fbe=_0x4a81[_0x5cd848];return _0x9e8fbe;};'use strict';var Sequelize=require(_0x14a8('0x0'));module[_0x14a8('0x1')]={'body':{'type':Sequelize[_0x14a8('0x2')](_0x14a8('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x14a8('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x14a8('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x14a8('0x5')]}}; \ No newline at end of file +var _0x630e=['DATE','sequelize','TEXT','ENUM','out'];(function(_0x11b664,_0x5ed6d7){var _0x419ea6=function(_0x2f90bb){while(--_0x2f90bb){_0x11b664['push'](_0x11b664['shift']());}};_0x419ea6(++_0x5ed6d7);}(_0x630e,0x1af));var _0xe630=function(_0x21441c,_0x259a8d){_0x21441c=_0x21441c-0x0;var _0x10d8d2=_0x630e[_0x21441c];return _0x10d8d2;};'use strict';var Sequelize=require(_0xe630('0x0'));module['exports']={'body':{'type':Sequelize[_0xe630('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe630('0x2')]('in',_0xe630('0x3')),'defaultValue':_0xe630('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xe630('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 9034329..b08d391 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 _0x36d3=['body','destroy','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','get','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','User','interface','rejectmessage','create','findOne','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','FaxMessage','includeAll','include','findAll','rows','show','params','find'];(function(_0x210966,_0x40aa93){var _0x23489a=function(_0x5425dc){while(--_0x5425dc){_0x210966['push'](_0x210966['shift']());}};_0x23489a(++_0x40aa93);}(_0x36d3,0x151));var _0x336d=function(_0x5738f6,_0x4669f1){_0x5738f6=_0x5738f6-0x0;var _0x2282d6=_0x36d3[_0x5738f6];return _0x2282d6;};'use strict';var emlformat=require(_0x336d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x336d('0x1'));var jsonpatch=require(_0x336d('0x2'));var rp=require(_0x336d('0x3'));var moment=require(_0x336d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x336d('0x5'));var util=require(_0x336d('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x336d('0x7'));var fs=require('fs');var fs_extra=require(_0x336d('0x8'));var _=require(_0x336d('0x9'));var squel=require(_0x336d('0xa'));var crypto=require(_0x336d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x336d('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x336d('0xd'));var qs=require(_0x336d('0xe'));var as=require(_0x336d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x336d('0x10'))(_0x336d('0x11'));var utils=require(_0x336d('0x12'));var config=require(_0x336d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x336d('0x14'))['db'];config['redis']=_[_0x336d('0x15')](config[_0x336d('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x336d('0x17'))(new Redis(config[_0x336d('0x16')]));require(_0x336d('0x18'))[_0x336d('0x19')](socket);var jayson=require(_0x336d('0x1a'));var client=jayson[_0x336d('0x1b')][_0x336d('0x1c')]({'port':0x232c});var client9002=jayson[_0x336d('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29121e,_0x416178,_0x103cbb,_0x4431bd){return new BPromise(function(_0x12d97b,_0x576dda){var _0x2f1c8d=_0x4431bd||client;return _0x2f1c8d['request'](_0x29121e,_0x103cbb)[_0x336d('0x1d')](function(_0x2cc6a2){logger[_0x336d('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x416178,_0x336d('0x1f'));logger[_0x336d('0x20')](_0x336d('0x21'),_0x416178,_0x336d('0x1f'),JSON[_0x336d('0x22')](_0x2cc6a2));if(_0x2cc6a2[_0x336d('0x23')]){if(_0x2cc6a2[_0x336d('0x23')][_0x336d('0x24')]===0x1f4){logger[_0x336d('0x23')](_0x336d('0x25'),_0x416178,_0x2cc6a2[_0x336d('0x23')][_0x336d('0x26')]);return _0x576dda(_0x2cc6a2[_0x336d('0x23')][_0x336d('0x26')]);}logger[_0x336d('0x23')](_0x336d('0x25'),_0x416178,_0x2cc6a2[_0x336d('0x23')][_0x336d('0x26')]);return _0x12d97b(_0x2cc6a2[_0x336d('0x23')][_0x336d('0x26')]);}else{logger[_0x336d('0x1e')](_0x336d('0x25'),_0x416178,'request\x20sent');_0x12d97b(_0x2cc6a2[_0x336d('0x27')][_0x336d('0x26')]);}})[_0x336d('0x28')](function(_0x3c11ca){logger[_0x336d('0x23')](_0x336d('0x25'),_0x416178,_0x3c11ca);_0x576dda(_0x3c11ca);});});}function respondWithStatusCode(_0x286e9a,_0x3b2b9a){_0x3b2b9a=_0x3b2b9a||0xcc;return function(_0x4bb891){if(_0x4bb891){return _0x286e9a[_0x336d('0x29')](_0x3b2b9a);}return _0x286e9a[_0x336d('0x2a')](_0x3b2b9a)[_0x336d('0x2b')]();};}function respondWithResult(_0x31b882,_0xa2c989){_0xa2c989=_0xa2c989||0xc8;return function(_0x4838b8){if(_0x4838b8){return _0x31b882['status'](_0xa2c989)['json'](_0x4838b8);}};}function respondWithFilteredResult(_0xed7d80,_0x2cf8a9){return function(_0x2fdd8b){if(_0x2fdd8b){var _0xdb8bfe=typeof _0x2cf8a9[_0x336d('0x2c')]===_0x336d('0x2d')&&typeof _0x2cf8a9['limit']===_0x336d('0x2d');var _0x57d57b=_0x2fdd8b[_0x336d('0x2e')];var _0x139417=_0xdb8bfe?0x0:_0x2cf8a9[_0x336d('0x2c')];var _0x168b9c=_0xdb8bfe?_0x2fdd8b[_0x336d('0x2e')]:_0x2cf8a9['offset']+_0x2cf8a9[_0x336d('0x2f')];var _0x1a8ac7;if(_0x168b9c>=_0x57d57b){_0x168b9c=_0x57d57b;_0x1a8ac7=0xc8;}else{_0x1a8ac7=0xce;}_0xed7d80['status'](_0x1a8ac7);return _0xed7d80['set'](_0x336d('0x30'),_0x139417+'-'+_0x168b9c+'/'+_0x57d57b)[_0x336d('0x31')](_0x2fdd8b);}return null;};}function patchUpdates(_0x2f9f16){return function(_0x1cec92){try{jsonpatch[_0x336d('0x32')](_0x1cec92,_0x2f9f16,!![]);}catch(_0x187a58){return BPromise[_0x336d('0x33')](_0x187a58);}return _0x1cec92[_0x336d('0x34')]();};}function saveUpdates(_0x1247ae,_0xa1463a){return function(_0x168556){if(_0x168556){return _0x168556[_0x336d('0x35')](_0x1247ae)[_0x336d('0x1d')](function(_0x236fe4){return _0x236fe4;});}return null;};}function removeEntity(_0x7e0690,_0x529dca){return function(_0x493cc2){if(_0x493cc2){return _0x493cc2['destroy']()['then'](function(){_0x7e0690[_0x336d('0x2a')](0xcc)[_0x336d('0x2b')]();});}};}function handleEntityNotFound(_0xa7f610,_0x37805a){return function(_0x18bf22){if(!_0x18bf22){_0xa7f610[_0x336d('0x29')](0x194);}return _0x18bf22;};}function handleError(_0x5e01a0,_0x48ca8f){_0x48ca8f=_0x48ca8f||0x1f4;return function(_0x22ac41){logger[_0x336d('0x23')](_0x22ac41[_0x336d('0x36')]);if(_0x22ac41[_0x336d('0x37')]){delete _0x22ac41[_0x336d('0x37')];}_0x5e01a0[_0x336d('0x2a')](_0x48ca8f)['send'](_0x22ac41);};}exports[_0x336d('0x38')]=function(_0x575dc6,_0x3dc048){var _0x5248aa={},_0x2f1159={},_0x418963={'count':0x0,'rows':[]};var _0x2590e5=_[_0x336d('0x39')](db['FaxMessage'][_0x336d('0x3a')],function(_0x2ff805){return{'name':_0x2ff805[_0x336d('0x3b')],'type':_0x2ff805[_0x336d('0x3c')][_0x336d('0x3d')]};});_0x2f1159[_0x336d('0x3e')]=_['map'](_0x2590e5,_0x336d('0x37'));_0x2f1159[_0x336d('0x3f')]=_[_0x336d('0x40')](_0x575dc6[_0x336d('0x3f')]);_0x2f1159[_0x336d('0x41')]=_[_0x336d('0x42')](_0x2f1159['model'],_0x2f1159[_0x336d('0x3f')]);_0x5248aa[_0x336d('0x43')]=_[_0x336d('0x42')](_0x2f1159['model'],qs[_0x336d('0x44')](_0x575dc6['query'][_0x336d('0x44')]));_0x5248aa[_0x336d('0x43')]=_0x5248aa[_0x336d('0x43')][_0x336d('0x45')]?_0x5248aa[_0x336d('0x43')]:_0x2f1159[_0x336d('0x3e')];if(!_0x575dc6[_0x336d('0x3f')][_0x336d('0x46')]('nolimit')){_0x5248aa[_0x336d('0x2f')]=qs[_0x336d('0x2f')](_0x575dc6['query']['limit']);_0x5248aa[_0x336d('0x2c')]=qs['offset'](_0x575dc6[_0x336d('0x3f')][_0x336d('0x2c')]);}_0x5248aa[_0x336d('0x47')]=qs[_0x336d('0x48')](_0x575dc6[_0x336d('0x3f')][_0x336d('0x48')]);_0x5248aa['where']=qs[_0x336d('0x41')](_[_0x336d('0x49')](_0x575dc6[_0x336d('0x3f')],_0x2f1159[_0x336d('0x41')]),_0x2590e5);if(_0x575dc6[_0x336d('0x3f')][_0x336d('0x4a')]){_0x5248aa[_0x336d('0x4b')]=_[_0x336d('0x4c')](_0x5248aa[_0x336d('0x4b')],{'$or':_['map'](_0x2590e5,function(_0x324868){if(_0x324868[_0x336d('0x3c')]!=='VIRTUAL'){var _0x4346bf={};_0x4346bf[_0x324868[_0x336d('0x37')]]={'$like':'%'+_0x575dc6[_0x336d('0x3f')][_0x336d('0x4a')]+'%'};return _0x4346bf;}})});}_0x5248aa=_[_0x336d('0x4c')]({},_0x5248aa,_0x575dc6[_0x336d('0x4d')]);var _0x5db0e2={'where':_0x5248aa[_0x336d('0x4b')]};return db[_0x336d('0x4e')]['count'](_0x5db0e2)[_0x336d('0x1d')](function(_0x5b4742){_0x418963[_0x336d('0x2e')]=_0x5b4742;if(_0x575dc6[_0x336d('0x3f')][_0x336d('0x4f')]){_0x5248aa[_0x336d('0x50')]=[{'all':!![]}];}return db[_0x336d('0x4e')][_0x336d('0x51')](_0x5248aa);})[_0x336d('0x1d')](function(_0x1f258f){_0x418963[_0x336d('0x52')]=_0x1f258f;return _0x418963;})[_0x336d('0x1d')](respondWithFilteredResult(_0x3dc048,_0x5248aa))['catch'](handleError(_0x3dc048,null));};exports[_0x336d('0x53')]=function(_0x1d0416,_0x1a6fad){var _0x32fda8={'raw':!![],'where':{'id':_0x1d0416[_0x336d('0x54')]['id']}},_0x2dde82={};_0x2dde82[_0x336d('0x3e')]=_[_0x336d('0x40')](db['FaxMessage'][_0x336d('0x3a')]);_0x2dde82[_0x336d('0x3f')]=_[_0x336d('0x40')](_0x1d0416[_0x336d('0x3f')]);_0x2dde82['filters']=_[_0x336d('0x42')](_0x2dde82[_0x336d('0x3e')],_0x2dde82[_0x336d('0x3f')]);_0x32fda8['attributes']=_[_0x336d('0x42')](_0x2dde82[_0x336d('0x3e')],qs[_0x336d('0x44')](_0x1d0416[_0x336d('0x3f')][_0x336d('0x44')]));_0x32fda8['attributes']=_0x32fda8[_0x336d('0x43')][_0x336d('0x45')]?_0x32fda8[_0x336d('0x43')]:_0x2dde82['model'];if(_0x1d0416['query'][_0x336d('0x4f')]){_0x32fda8[_0x336d('0x50')]=[{'all':!![]}];}_0x32fda8=_['merge']({},_0x32fda8,_0x1d0416['options']);return db['FaxMessage'][_0x336d('0x55')](_0x32fda8)[_0x336d('0x1d')](handleEntityNotFound(_0x1a6fad,null))[_0x336d('0x1d')](respondWithResult(_0x1a6fad,null))['catch'](handleError(_0x1a6fad,null));};exports['update']=function(_0x2ad45b,_0x1b9373){if(_0x2ad45b[_0x336d('0x56')]['id']){delete _0x2ad45b[_0x336d('0x56')]['id'];}return db[_0x336d('0x4e')][_0x336d('0x55')]({'where':{'id':_0x2ad45b[_0x336d('0x54')]['id']}})[_0x336d('0x1d')](handleEntityNotFound(_0x1b9373,null))[_0x336d('0x1d')](saveUpdates(_0x2ad45b[_0x336d('0x56')],null))[_0x336d('0x1d')](respondWithResult(_0x1b9373,null))[_0x336d('0x28')](handleError(_0x1b9373,null));};exports[_0x336d('0x57')]=function(_0x3698b2,_0x143dde){return db[_0x336d('0x4e')][_0x336d('0x55')]({'where':{'id':_0x3698b2[_0x336d('0x54')]['id']}})[_0x336d('0x1d')](handleEntityNotFound(_0x143dde,null))['then'](removeEntity(_0x143dde,null))[_0x336d('0x28')](handleError(_0x143dde,null));};exports[_0x336d('0x58')]=function(_0xbf3f2,_0x4f4e12){return db['FaxMessage']['describe']()[_0x336d('0x1d')](respondWithResult(_0x4f4e12,null))[_0x336d('0x28')](handleError(_0x4f4e12,null));};var interaction_log=require(_0x336d('0x10'))(_0x336d('0x59'));exports[_0x336d('0x5a')]=function(_0x1afd13,_0x47f916,_0x1806a2){var _0x2dc72c={'agent':{},'channel':_0x336d('0x5b')};if(_0x1afd13['body']['id']){delete _0x1afd13[_0x336d('0x56')]['id'];}_0x1afd13[_0x336d('0x56')][_0x336d('0x5c')]=!![];_0x1afd13[_0x336d('0x56')][_0x336d('0x5d')]=moment()[_0x336d('0x5e')](_0x336d('0x5f'));_0x1afd13[_0x336d('0x56')][_0x336d('0x60')]=_0x1afd13[_0x336d('0x56')]['UserId']||_0x1afd13[_0x336d('0x61')]['id'];_0x2dc72c[_0x336d('0x62')]['id']=_0x1afd13['body']['UserId'];return db['FaxMessage'][_0x336d('0x55')]({'where':{'id':_0x1afd13['params']['id'],'UserId':null}})[_0x336d('0x1d')](handleEntityNotFound(_0x47f916,null))[_0x336d('0x1d')](saveUpdates(_0x1afd13[_0x336d('0x56')],null))[_0x336d('0x1d')](function(_0x1919d1){if(_0x1919d1){_0x2dc72c[_0x336d('0x26')]=_0x1919d1['get']({'plain':!![]});return db[_0x336d('0x63')][_0x336d('0x55')]({'where':{'id':_0x1919d1['FaxInteractionId']}});}return null;})[_0x336d('0x1d')](handleEntityNotFound(_0x47f916,null))['then'](function(_0x775afe){if(_0x775afe){return _0x775afe[_0x336d('0x35')]({'UserId':_0x1afd13[_0x336d('0x56')][_0x336d('0x60')],'read1stAt':_['isNil'](_0x775afe['read1stAt'])?moment()[_0x336d('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x336d('0x1d')](function(_0x1066a6){if(_0x1066a6){_0x2dc72c['interaction']=_0x1066a6['get']({'plain':!![]});interaction_log['info'](_0x336d('0x64'),_0x1afd13[_0x336d('0x61')]['id'],_0x1afd13[_0x336d('0x61')][_0x336d('0x37')],_0x1afd13['user'][_0x336d('0x65')],_0x2dc72c[_0x336d('0x66')]['id'],_0x1afd13[_0x336d('0x56')]?JSON[_0x336d('0x22')](_0x1afd13['body']):_0x336d('0x67'));return respondWithRpcPromise(_0x336d('0x68'),_0x336d('0x69'),_0x2dc72c);}return null;})[_0x336d('0x1d')](function(_0x5e43f6){var _0x868bbc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e43f6[_0x336d('0x26')]['ContactId'];return db[_0x336d('0x6a')][_0x336d('0x3f')](_0x868bbc,{'type':db[_0x336d('0x6b')][_0x336d('0x6c')][_0x336d('0x6d')],'raw':!![]})['then'](function(_0x12da8d){return _0x12da8d;});})[_0x336d('0x1d')](function(_0x405057){if(_0x405057){_0x2dc72c[_0x336d('0x26')][_0x336d('0x6e')]=_0x405057[0x0];if(!_0x1afd13[_0x336d('0x56')]['UserId'])return;return db['User'][_0x336d('0x55')]({'where':{'id':_0x1afd13['body'][_0x336d('0x60')],'role':_0x336d('0x62')},'attributes':['id','name',_0x336d('0x6f'),_0x336d('0x70'),_0x336d('0x71')],'raw':!![]});}return null;})[_0x336d('0x1d')](function(_0x42e6b3){if(!_0x42e6b3)return null;_0x2dc72c[_0x336d('0x26')]['agent']=_0x42e6b3;return _0x2dc72c;})[_0x336d('0x1d')](function(_0x5c7a6d){if(_0x5c7a6d){if(_0x1afd13[_0x336d('0x56')][_0x336d('0x72')]){_0x2dc72c[_0x336d('0x26')]['interface']=util['format'](_0x336d('0x73'),_0x1afd13[_0x336d('0x61')][_0x336d('0x37')]);_0x2dc72c[_0x336d('0x26')][_0x336d('0x74')]=_0x2dc72c[_0x336d('0x74')];_0x2dc72c[_0x336d('0x26')][_0x336d('0x75')]=_0x2dc72c[_0x336d('0x74')];_0x2dc72c[_0x336d('0x26')][_0x336d('0x76')]=_0x336d('0x5a');return respondWithRpcPromise(_0x336d('0x77'),'EventManager',{'event':_0x336d('0x78'),'message':_0x2dc72c['message']},client9002)['then'](function(){return _0x2dc72c;});}return _0x2dc72c;}return null;})[_0x336d('0x1d')](respondWithResult(_0x47f916,null))['catch'](handleError(_0x47f916,null));};var interaction_log=require(_0x336d('0x10'))('fax-interactions');exports['reject']=function(_0x5c0d8a,_0x26094e,_0x2ad43b){var _0x1e30f0={'agent':{},'channel':_0x336d('0x5b')};if(_0x5c0d8a['body']['id']){delete _0x5c0d8a[_0x336d('0x56')]['id'];}_0x5c0d8a['body'][_0x336d('0x60')]=_0x5c0d8a[_0x336d('0x56')][_0x336d('0x60')]||_0x5c0d8a[_0x336d('0x61')]['id'];_0x1e30f0[_0x336d('0x62')]['id']=_0x5c0d8a[_0x336d('0x56')][_0x336d('0x60')];return db['FaxMessage'][_0x336d('0x55')]({'where':{'id':_0x5c0d8a['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x26094e,null))[_0x336d('0x1d')](function(_0x292317){if(_0x292317){_0x1e30f0['message']=_0x292317[_0x336d('0x79')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x292317[_0x336d('0x7a')]}});}return null;})[_0x336d('0x1d')](handleEntityNotFound(_0x26094e,null))['then'](function(_0x39f26a){if(_0x39f26a){_0x1e30f0[_0x336d('0x66')]=_0x39f26a['get']({'plain':!![]});interaction_log[_0x336d('0x1e')](_0x336d('0x7b'),_0x5c0d8a[_0x336d('0x61')]['id'],_0x5c0d8a[_0x336d('0x61')][_0x336d('0x37')],_0x5c0d8a[_0x336d('0x61')][_0x336d('0x65')],_0x1e30f0[_0x336d('0x66')]['id'],_0x5c0d8a[_0x336d('0x56')]?JSON['stringify'](_0x5c0d8a[_0x336d('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0x336d('0x7c'),_0x1e30f0);}return null;})[_0x336d('0x1d')](function(_0x5409b2){var _0x394f18=_0x336d('0x7d')+_0x5409b2['message'][_0x336d('0x7e')];return db[_0x336d('0x6a')]['query'](_0x394f18,{'type':db[_0x336d('0x6b')][_0x336d('0x6c')][_0x336d('0x6d')],'raw':!![]})[_0x336d('0x1d')](function(_0x275e28){return _0x275e28;});})['then'](function(_0x27acab){if(_0x27acab){_0x1e30f0[_0x336d('0x26')]['contact']=_0x27acab[0x0];if(!_0x5c0d8a['body'][_0x336d('0x60')])return;return db[_0x336d('0x7f')][_0x336d('0x55')]({'where':{'id':_0x5c0d8a[_0x336d('0x56')][_0x336d('0x60')],'role':_0x336d('0x62')},'attributes':['id',_0x336d('0x37'),_0x336d('0x6f'),_0x336d('0x70'),_0x336d('0x71')],'raw':!![]});}return null;})[_0x336d('0x1d')](function(_0x3d0ced){if(!_0x3d0ced)return null;_0x1e30f0[_0x336d('0x26')][_0x336d('0x62')]=_0x3d0ced;return _0x1e30f0;})[_0x336d('0x1d')](function(_0x2093e6){if(_0x2093e6){_0x2093e6[_0x336d('0x26')][_0x336d('0x80')]=util[_0x336d('0x5e')]('SIP/%s',_0x5c0d8a['user']['name']);_0x2093e6[_0x336d('0x26')][_0x336d('0x74')]=_0x1e30f0[_0x336d('0x74')];_0x2093e6[_0x336d('0x26')]['motionChannel']=_0x1e30f0[_0x336d('0x74')];_0x2093e6['message'][_0x336d('0x76')]='reject';respondWithRpcPromise(_0x336d('0x77'),_0x336d('0x77'),{'event':_0x336d('0x81'),'message':_0x2093e6[_0x336d('0x26')]},client9002);return _0x1e30f0;}return null;})[_0x336d('0x1d')](respondWithResult(_0x26094e,null))[_0x336d('0x28')](handleError(_0x26094e,null));};exports[_0x336d('0x82')]=function(_0x274089,_0xb1e83){var _0xb8033c;return db[_0x336d('0x4e')][_0x336d('0x82')](_0x274089['body'],{})[_0x336d('0x1d')](function(_0x1abf75){_0xb8033c=_0x1abf75;return db['CmContact'][_0x336d('0x83')]({'where':{'id':_0xb8033c['ContactId']}});})[_0x336d('0x1d')](function(_0x146eae){if(_[_0x336d('0x84')](_0x146eae)){return;}else{_0xb8033c[_0x336d('0x5b')]=_0x146eae[_0x336d('0x5b')];return db[_0x336d('0x85')][_0x336d('0x83')]({'where':{'id':_0xb8033c['AttachmentId']}});}})[_0x336d('0x1d')](function(_0x3ad131){return respondWithRpcPromise(_0x336d('0x86'),_0x336d('0x86'),{'FaxAccountId':_[_0x336d('0x84')](_0x274089['body'])?undefined:_0x274089[_0x336d('0x56')][_0x336d('0x87')],'path':_[_0x336d('0x84')](_0x3ad131)?undefined:util[_0x336d('0x5e')](_0x336d('0x88'),_0x3ad131[_0x336d('0x89')]),'fax':_['isNil'](_0xb8033c['fax'])?undefined:_0xb8033c[_0x336d('0x5b')],'AttachmentId':_0xb8033c[_0x336d('0x8a')]},client9002);})[_0x336d('0x1d')](respondWithResult(_0xb1e83,0xc9))['catch'](handleError(_0xb1e83,null));};exports[_0x336d('0x8b')]=function(_0x277f9c,_0x1165e4){var _0x6cc0a7=path[_0x336d('0x8c')](config['root'],'server','files','attachments');return db[_0x336d('0x4e')][_0x336d('0x55')]({'where':{'id':_0x277f9c[_0x336d('0x54')]['id']},'include':[{'model':db[_0x336d('0x85')],'as':_0x336d('0x85')}]})[_0x336d('0x1d')](handleEntityNotFound(_0x1165e4,null))[_0x336d('0x1d')](function(_0x54fe1c){if(_0x54fe1c){return _0x1165e4[_0x336d('0x8b')](path[_0x336d('0x8c')](_0x6cc0a7,_0x54fe1c[_0x336d('0x85')]['basename']));}})[_0x336d('0x28')](handleError(_0x1165e4,null));}; \ No newline at end of file +var _0x352d=['FaxMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','find','body','params','describe','fax-interactions','accept','fax','read','readAt','format','UserId','agent','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','channel','motionChannel','event','EventManager','acceptmessage','reject','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','RejectMessage','QueryTypes','internal','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','basename','download','files','Attachment','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','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','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','update','destroy','stack','name','index','map'];(function(_0x175b51,_0x4c285e){var _0x58c130=function(_0x329333){while(--_0x329333){_0x175b51['push'](_0x175b51['shift']());}};_0x58c130(++_0x4c285e);}(_0x352d,0x16f));var _0xd352=function(_0x55edf8,_0x517fa6){_0x55edf8=_0x55edf8-0x0;var _0x116c28=_0x352d[_0x55edf8];return _0x116c28;};'use strict';var emlformat=require(_0xd352('0x0'));var rimraf=require(_0xd352('0x1'));var zipdir=require(_0xd352('0x2'));var jsonpatch=require(_0xd352('0x3'));var rp=require(_0xd352('0x4'));var moment=require(_0xd352('0x5'));var BPromise=require(_0xd352('0x6'));var Mustache=require(_0xd352('0x7'));var util=require(_0xd352('0x8'));var path=require(_0xd352('0x9'));var sox=require('sox');var csv=require(_0xd352('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd352('0xb'));var _=require('lodash');var squel=require(_0xd352('0xc'));var crypto=require(_0xd352('0xd'));var jsforce=require(_0xd352('0xe'));var deskjs=require(_0xd352('0xf'));var toCsv=require(_0xd352('0xa'));var querystring=require(_0xd352('0x10'));var Papa=require(_0xd352('0x11'));var Redis=require(_0xd352('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd352('0x13'));var as=require(_0xd352('0x14'));var hardwareService=require(_0xd352('0x15'));var logger=require(_0xd352('0x16'))(_0xd352('0x17'));var utils=require(_0xd352('0x18'));var config=require(_0xd352('0x19'));var licenseUtil=require(_0xd352('0x1a'));var db=require(_0xd352('0x1b'))['db'];config[_0xd352('0x1c')]=_[_0xd352('0x1d')](config[_0xd352('0x1c')],{'host':_0xd352('0x1e'),'port':0x18eb});var socket=require(_0xd352('0x1f'))(new Redis(config[_0xd352('0x1c')]));require(_0xd352('0x20'))[_0xd352('0x21')](socket);var jayson=require(_0xd352('0x22'));var client=jayson[_0xd352('0x23')][_0xd352('0x24')]({'port':0x232c});var client9002=jayson[_0xd352('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30f950,_0x3cb0cc,_0x2e5de5,_0x48bf94){return new BPromise(function(_0x284a71,_0x133803){var _0xee7d53=_0x48bf94||client;return _0xee7d53[_0xd352('0x25')](_0x30f950,_0x2e5de5)[_0xd352('0x26')](function(_0x35774f){logger[_0xd352('0x27')](_0xd352('0x28'),_0x3cb0cc,_0xd352('0x29'));logger['debug'](_0xd352('0x2a'),_0x3cb0cc,'request\x20sent',JSON[_0xd352('0x2b')](_0x35774f));if(_0x35774f[_0xd352('0x2c')]){if(_0x35774f[_0xd352('0x2c')][_0xd352('0x2d')]===0x1f4){logger[_0xd352('0x2c')](_0xd352('0x28'),_0x3cb0cc,_0x35774f['error']['message']);return _0x133803(_0x35774f[_0xd352('0x2c')][_0xd352('0x2e')]);}logger[_0xd352('0x2c')](_0xd352('0x28'),_0x3cb0cc,_0x35774f[_0xd352('0x2c')]['message']);return _0x284a71(_0x35774f[_0xd352('0x2c')][_0xd352('0x2e')]);}else{logger[_0xd352('0x27')](_0xd352('0x28'),_0x3cb0cc,'request\x20sent');_0x284a71(_0x35774f[_0xd352('0x2f')][_0xd352('0x2e')]);}})[_0xd352('0x30')](function(_0x14d84b){logger[_0xd352('0x2c')](_0xd352('0x28'),_0x3cb0cc,_0x14d84b);_0x133803(_0x14d84b);});});}function respondWithStatusCode(_0x4e99c8,_0x5c2bff){_0x5c2bff=_0x5c2bff||0xcc;return function(_0x2966b6){if(_0x2966b6){return _0x4e99c8[_0xd352('0x31')](_0x5c2bff);}return _0x4e99c8['status'](_0x5c2bff)[_0xd352('0x32')]();};}function respondWithResult(_0x4ec677,_0x4653b0){_0x4653b0=_0x4653b0||0xc8;return function(_0x2281ff){if(_0x2281ff){return _0x4ec677[_0xd352('0x33')](_0x4653b0)[_0xd352('0x34')](_0x2281ff);}};}function respondWithFilteredResult(_0x4e88bc,_0x54c47d){return function(_0x47c028){if(_0x47c028){var _0x1a71b2=typeof _0x54c47d[_0xd352('0x35')]==='undefined'&&typeof _0x54c47d[_0xd352('0x36')]===_0xd352('0x37');var _0x2e249e=_0x47c028['count'];var _0x2c31ad=_0x1a71b2?0x0:_0x54c47d[_0xd352('0x35')];var _0x4d703c=_0x1a71b2?_0x47c028[_0xd352('0x38')]:_0x54c47d[_0xd352('0x35')]+_0x54c47d['limit'];var _0x404c6a;if(_0x4d703c>=_0x2e249e){_0x4d703c=_0x2e249e;_0x404c6a=0xc8;}else{_0x404c6a=0xce;}_0x4e88bc['status'](_0x404c6a);return _0x4e88bc[_0xd352('0x39')]('Content-Range',_0x2c31ad+'-'+_0x4d703c+'/'+_0x2e249e)[_0xd352('0x34')](_0x47c028);}return null;};}function patchUpdates(_0x254b03){return function(_0x5241f4){try{jsonpatch[_0xd352('0x3a')](_0x5241f4,_0x254b03,!![]);}catch(_0x54bacf){return BPromise['reject'](_0x54bacf);}return _0x5241f4['save']();};}function saveUpdates(_0x201795,_0x882a28){return function(_0x47f53e){if(_0x47f53e){return _0x47f53e[_0xd352('0x3b')](_0x201795)[_0xd352('0x26')](function(_0x17285f){return _0x17285f;});}return null;};}function removeEntity(_0x3f5490,_0x2ab375){return function(_0x4ae26c){if(_0x4ae26c){return _0x4ae26c[_0xd352('0x3c')]()[_0xd352('0x26')](function(){_0x3f5490[_0xd352('0x33')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b835,_0x3f3756){return function(_0x429bac){if(!_0x429bac){_0x59b835[_0xd352('0x31')](0x194);}return _0x429bac;};}function handleError(_0x13b8ea,_0x3cb937){_0x3cb937=_0x3cb937||0x1f4;return function(_0x13e848){logger[_0xd352('0x2c')](_0x13e848[_0xd352('0x3d')]);if(_0x13e848[_0xd352('0x3e')]){delete _0x13e848[_0xd352('0x3e')];}_0x13b8ea[_0xd352('0x33')](_0x3cb937)['send'](_0x13e848);};}exports[_0xd352('0x3f')]=function(_0x81fdf9,_0x1b70cd){var _0x57ed1d={},_0x75cd78={},_0x33a0cf={'count':0x0,'rows':[]};var _0x6ddd72=_[_0xd352('0x40')](db[_0xd352('0x41')][_0xd352('0x42')],function(_0x27be89){return{'name':_0x27be89[_0xd352('0x43')],'type':_0x27be89[_0xd352('0x44')][_0xd352('0x45')]};});_0x75cd78['model']=_[_0xd352('0x40')](_0x6ddd72,_0xd352('0x3e'));_0x75cd78[_0xd352('0x46')]=_[_0xd352('0x47')](_0x81fdf9['query']);_0x75cd78[_0xd352('0x48')]=_[_0xd352('0x49')](_0x75cd78[_0xd352('0x4a')],_0x75cd78['query']);_0x57ed1d[_0xd352('0x4b')]=_[_0xd352('0x49')](_0x75cd78[_0xd352('0x4a')],qs[_0xd352('0x4c')](_0x81fdf9[_0xd352('0x46')][_0xd352('0x4c')]));_0x57ed1d['attributes']=_0x57ed1d['attributes'][_0xd352('0x4d')]?_0x57ed1d[_0xd352('0x4b')]:_0x75cd78[_0xd352('0x4a')];if(!_0x81fdf9[_0xd352('0x46')]['hasOwnProperty'](_0xd352('0x4e'))){_0x57ed1d[_0xd352('0x36')]=qs[_0xd352('0x36')](_0x81fdf9[_0xd352('0x46')]['limit']);_0x57ed1d[_0xd352('0x35')]=qs[_0xd352('0x35')](_0x81fdf9[_0xd352('0x46')]['offset']);}_0x57ed1d[_0xd352('0x4f')]=qs['sort'](_0x81fdf9[_0xd352('0x46')]['sort']);_0x57ed1d['where']=qs[_0xd352('0x48')](_['pick'](_0x81fdf9[_0xd352('0x46')],_0x75cd78[_0xd352('0x48')]),_0x6ddd72);if(_0x81fdf9[_0xd352('0x46')]['filter']){_0x57ed1d[_0xd352('0x50')]=_[_0xd352('0x51')](_0x57ed1d['where'],{'$or':_['map'](_0x6ddd72,function(_0x2296f7){if(_0x2296f7[_0xd352('0x44')]!==_0xd352('0x52')){var _0x2635a7={};_0x2635a7[_0x2296f7['name']]={'$like':'%'+_0x81fdf9[_0xd352('0x46')][_0xd352('0x53')]+'%'};return _0x2635a7;}})});}_0x57ed1d=_[_0xd352('0x51')]({},_0x57ed1d,_0x81fdf9[_0xd352('0x54')]);var _0x3006b9={'where':_0x57ed1d[_0xd352('0x50')]};return db['FaxMessage'][_0xd352('0x38')](_0x3006b9)[_0xd352('0x26')](function(_0x205d68){_0x33a0cf['count']=_0x205d68;if(_0x81fdf9[_0xd352('0x46')][_0xd352('0x55')]){_0x57ed1d[_0xd352('0x56')]=[{'all':!![]}];}return db[_0xd352('0x41')][_0xd352('0x57')](_0x57ed1d);})['then'](function(_0x403da8){_0x33a0cf['rows']=_0x403da8;return _0x33a0cf;})[_0xd352('0x26')](respondWithFilteredResult(_0x1b70cd,_0x57ed1d))[_0xd352('0x30')](handleError(_0x1b70cd,null));};exports[_0xd352('0x58')]=function(_0x5e1ab8,_0xac74a6){var _0x148e17={'raw':!![],'where':{'id':_0x5e1ab8['params']['id']}},_0x1fdf43={};_0x1fdf43['model']=_[_0xd352('0x47')](db[_0xd352('0x41')]['rawAttributes']);_0x1fdf43['query']=_[_0xd352('0x47')](_0x5e1ab8[_0xd352('0x46')]);_0x1fdf43[_0xd352('0x48')]=_[_0xd352('0x49')](_0x1fdf43[_0xd352('0x4a')],_0x1fdf43[_0xd352('0x46')]);_0x148e17[_0xd352('0x4b')]=_[_0xd352('0x49')](_0x1fdf43['model'],qs['fields'](_0x5e1ab8[_0xd352('0x46')]['fields']));_0x148e17['attributes']=_0x148e17[_0xd352('0x4b')][_0xd352('0x4d')]?_0x148e17[_0xd352('0x4b')]:_0x1fdf43['model'];if(_0x5e1ab8[_0xd352('0x46')]['includeAll']){_0x148e17[_0xd352('0x56')]=[{'all':!![]}];}_0x148e17=_[_0xd352('0x51')]({},_0x148e17,_0x5e1ab8[_0xd352('0x54')]);return db[_0xd352('0x41')][_0xd352('0x59')](_0x148e17)[_0xd352('0x26')](handleEntityNotFound(_0xac74a6,null))[_0xd352('0x26')](respondWithResult(_0xac74a6,null))[_0xd352('0x30')](handleError(_0xac74a6,null));};exports['update']=function(_0x48eef0,_0x390026){if(_0x48eef0[_0xd352('0x5a')]['id']){delete _0x48eef0[_0xd352('0x5a')]['id'];}return db[_0xd352('0x41')][_0xd352('0x59')]({'where':{'id':_0x48eef0['params']['id']}})['then'](handleEntityNotFound(_0x390026,null))[_0xd352('0x26')](saveUpdates(_0x48eef0[_0xd352('0x5a')],null))[_0xd352('0x26')](respondWithResult(_0x390026,null))[_0xd352('0x30')](handleError(_0x390026,null));};exports['destroy']=function(_0x4fafc8,_0x309e3e){return db[_0xd352('0x41')][_0xd352('0x59')]({'where':{'id':_0x4fafc8[_0xd352('0x5b')]['id']}})[_0xd352('0x26')](handleEntityNotFound(_0x309e3e,null))[_0xd352('0x26')](removeEntity(_0x309e3e,null))[_0xd352('0x30')](handleError(_0x309e3e,null));};exports[_0xd352('0x5c')]=function(_0x58e4e2,_0x5e08dc){return db[_0xd352('0x41')][_0xd352('0x5c')]()['then'](respondWithResult(_0x5e08dc,null))[_0xd352('0x30')](handleError(_0x5e08dc,null));};var interaction_log=require(_0xd352('0x16'))(_0xd352('0x5d'));exports[_0xd352('0x5e')]=function(_0x29e9fe,_0x2dae51,_0x59c292){var _0xa5329={'agent':{},'channel':_0xd352('0x5f')};if(_0x29e9fe[_0xd352('0x5a')]['id']){delete _0x29e9fe[_0xd352('0x5a')]['id'];}_0x29e9fe[_0xd352('0x5a')][_0xd352('0x60')]=!![];_0x29e9fe[_0xd352('0x5a')][_0xd352('0x61')]=moment()[_0xd352('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x29e9fe['body'][_0xd352('0x63')]=_0x29e9fe[_0xd352('0x5a')][_0xd352('0x63')]||_0x29e9fe['user']['id'];_0xa5329[_0xd352('0x64')]['id']=_0x29e9fe['body'][_0xd352('0x63')];return db[_0xd352('0x41')][_0xd352('0x59')]({'where':{'id':_0x29e9fe[_0xd352('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2dae51,null))[_0xd352('0x26')](saveUpdates(_0x29e9fe[_0xd352('0x5a')],null))['then'](function(_0x1e6f24){if(_0x1e6f24){_0xa5329[_0xd352('0x2e')]=_0x1e6f24[_0xd352('0x65')]({'plain':!![]});return db[_0xd352('0x66')][_0xd352('0x59')]({'where':{'id':_0x1e6f24['FaxInteractionId']}});}return null;})[_0xd352('0x26')](handleEntityNotFound(_0x2dae51,null))[_0xd352('0x26')](function(_0x5610ff){if(_0x5610ff){return _0x5610ff[_0xd352('0x3b')]({'UserId':_0x29e9fe['body'][_0xd352('0x63')],'read1stAt':_[_0xd352('0x67')](_0x5610ff[_0xd352('0x68')])?moment()[_0xd352('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2284df){if(_0x2284df){_0xa5329['interaction']=_0x2284df[_0xd352('0x65')]({'plain':!![]});interaction_log[_0xd352('0x27')](_0xd352('0x69'),_0x29e9fe['user']['id'],_0x29e9fe[_0xd352('0x6a')]['name'],_0x29e9fe[_0xd352('0x6a')][_0xd352('0x6b')],_0xa5329['interaction']['id'],_0x29e9fe[_0xd352('0x5a')]?JSON[_0xd352('0x2b')](_0x29e9fe[_0xd352('0x5a')]):_0xd352('0x6c'));return respondWithRpcPromise(_0xd352('0x6d'),_0xd352('0x6e'),_0xa5329);}return null;})[_0xd352('0x26')](function(_0x3477c3){var _0x134a88=_0xd352('0x6f')+_0x3477c3[_0xd352('0x2e')][_0xd352('0x70')];return db[_0xd352('0x71')]['query'](_0x134a88,{'type':db[_0xd352('0x72')]['QueryTypes'][_0xd352('0x73')],'raw':!![]})[_0xd352('0x26')](function(_0xfecbf4){return _0xfecbf4;});})[_0xd352('0x26')](function(_0x1f0e9d){if(_0x1f0e9d){_0xa5329['message'][_0xd352('0x74')]=_0x1f0e9d[0x0];if(!_0x29e9fe[_0xd352('0x5a')][_0xd352('0x63')])return;return db[_0xd352('0x75')]['find']({'where':{'id':_0x29e9fe[_0xd352('0x5a')][_0xd352('0x63')],'role':'agent'},'attributes':['id','name',_0xd352('0x76'),_0xd352('0x77'),'internal'],'raw':!![]});}return null;})[_0xd352('0x26')](function(_0x25b870){if(!_0x25b870)return null;_0xa5329['message'][_0xd352('0x64')]=_0x25b870;return _0xa5329;})[_0xd352('0x26')](function(_0x5779f1){if(_0x5779f1){if(_0x29e9fe[_0xd352('0x5a')][_0xd352('0x78')]){_0xa5329[_0xd352('0x2e')]['interface']=util['format']('SIP/%s',_0x29e9fe[_0xd352('0x6a')][_0xd352('0x3e')]);_0xa5329[_0xd352('0x2e')][_0xd352('0x79')]=_0xa5329[_0xd352('0x79')];_0xa5329[_0xd352('0x2e')][_0xd352('0x7a')]=_0xa5329[_0xd352('0x79')];_0xa5329[_0xd352('0x2e')][_0xd352('0x7b')]=_0xd352('0x5e');return respondWithRpcPromise(_0xd352('0x7c'),_0xd352('0x7c'),{'event':_0xd352('0x7d'),'message':_0xa5329[_0xd352('0x2e')]},client9002)[_0xd352('0x26')](function(){return _0xa5329;});}return _0xa5329;}return null;})['then'](respondWithResult(_0x2dae51,null))[_0xd352('0x30')](handleError(_0x2dae51,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xd352('0x7e')]=function(_0x44ab07,_0x105db4,_0x351735){var _0x586f93={'agent':{},'channel':_0xd352('0x5f')};if(_0x44ab07[_0xd352('0x5a')]['id']){delete _0x44ab07[_0xd352('0x5a')]['id'];}_0x44ab07['body']['UserId']=_0x44ab07[_0xd352('0x5a')][_0xd352('0x63')]||_0x44ab07['user']['id'];_0x586f93[_0xd352('0x64')]['id']=_0x44ab07[_0xd352('0x5a')][_0xd352('0x63')];return db[_0xd352('0x41')][_0xd352('0x59')]({'where':{'id':_0x44ab07[_0xd352('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x105db4,null))[_0xd352('0x26')](function(_0x2cc84f){if(_0x2cc84f){_0x586f93['message']=_0x2cc84f[_0xd352('0x65')]({'plain':!![]});return db['FaxInteraction'][_0xd352('0x59')]({'where':{'id':_0x2cc84f[_0xd352('0x7f')]}});}return null;})[_0xd352('0x26')](handleEntityNotFound(_0x105db4,null))[_0xd352('0x26')](function(_0x244739){if(_0x244739){_0x586f93['interaction']=_0x244739[_0xd352('0x65')]({'plain':!![]});interaction_log[_0xd352('0x27')](_0xd352('0x80'),_0x44ab07[_0xd352('0x6a')]['id'],_0x44ab07[_0xd352('0x6a')][_0xd352('0x3e')],_0x44ab07[_0xd352('0x6a')][_0xd352('0x6b')],_0x586f93[_0xd352('0x81')]['id'],_0x44ab07['body']?JSON[_0xd352('0x2b')](_0x44ab07[_0xd352('0x5a')]):_0xd352('0x6c'));return respondWithRpcPromise(_0xd352('0x82'),'rejectMessage',_0x586f93);}return null;})[_0xd352('0x26')](function(_0x3bbf0f){var _0x435331=_0xd352('0x6f')+_0x3bbf0f[_0xd352('0x2e')][_0xd352('0x70')];return db[_0xd352('0x71')][_0xd352('0x46')](_0x435331,{'type':db[_0xd352('0x72')][_0xd352('0x83')][_0xd352('0x73')],'raw':!![]})[_0xd352('0x26')](function(_0x23ec88){return _0x23ec88;});})[_0xd352('0x26')](function(_0x234d7e){if(_0x234d7e){_0x586f93[_0xd352('0x2e')][_0xd352('0x74')]=_0x234d7e[0x0];if(!_0x44ab07[_0xd352('0x5a')][_0xd352('0x63')])return;return db[_0xd352('0x75')]['find']({'where':{'id':_0x44ab07[_0xd352('0x5a')][_0xd352('0x63')],'role':'agent'},'attributes':['id',_0xd352('0x3e'),_0xd352('0x76'),_0xd352('0x77'),_0xd352('0x84')],'raw':!![]});}return null;})[_0xd352('0x26')](function(_0x22bdcd){if(!_0x22bdcd)return null;_0x586f93[_0xd352('0x2e')][_0xd352('0x64')]=_0x22bdcd;return _0x586f93;})[_0xd352('0x26')](function(_0x4ab7c5){if(_0x4ab7c5){_0x4ab7c5[_0xd352('0x2e')]['interface']=util[_0xd352('0x62')]('SIP/%s',_0x44ab07['user']['name']);_0x4ab7c5['message'][_0xd352('0x79')]=_0x586f93[_0xd352('0x79')];_0x4ab7c5[_0xd352('0x2e')][_0xd352('0x7a')]=_0x586f93[_0xd352('0x79')];_0x4ab7c5[_0xd352('0x2e')][_0xd352('0x7b')]='reject';respondWithRpcPromise(_0xd352('0x7c'),_0xd352('0x7c'),{'event':'rejectmessage','message':_0x4ab7c5[_0xd352('0x2e')]},client9002);return _0x586f93;}return null;})[_0xd352('0x26')](respondWithResult(_0x105db4,null))[_0xd352('0x30')](handleError(_0x105db4,null));};exports[_0xd352('0x85')]=function(_0x15290c,_0x39d3f1){var _0x3271a5;return db[_0xd352('0x41')][_0xd352('0x85')](_0x15290c[_0xd352('0x5a')],{})[_0xd352('0x26')](function(_0x439325){_0x3271a5=_0x439325;return db[_0xd352('0x86')]['findOne']({'where':{'id':_0x3271a5[_0xd352('0x70')]}});})[_0xd352('0x26')](function(_0x17717e){if(_[_0xd352('0x67')](_0x17717e)){return;}else{_0x3271a5[_0xd352('0x5f')]=_0x17717e['fax'];return db['Attachment'][_0xd352('0x87')]({'where':{'id':_0x3271a5[_0xd352('0x88')]}});}})[_0xd352('0x26')](function(_0x2923a4){return respondWithRpcPromise(_0xd352('0x89'),_0xd352('0x89'),{'FaxAccountId':_['isNil'](_0x15290c[_0xd352('0x5a')])?undefined:_0x15290c[_0xd352('0x5a')][_0xd352('0x8a')],'path':_[_0xd352('0x67')](_0x2923a4)?undefined:util[_0xd352('0x62')]('/var/opt/motion2/server/files/attachments/%s',_0x2923a4[_0xd352('0x8b')]),'fax':_['isNil'](_0x3271a5[_0xd352('0x5f')])?undefined:_0x3271a5[_0xd352('0x5f')],'AttachmentId':_0x3271a5[_0xd352('0x88')]},client9002);})['then'](respondWithResult(_0x39d3f1,0xc9))[_0xd352('0x30')](handleError(_0x39d3f1,null));};exports[_0xd352('0x8c')]=function(_0x1b4329,_0x49aac6){var _0xf09924=path['join'](config['root'],'server',_0xd352('0x8d'),'attachments');return db[_0xd352('0x41')]['find']({'where':{'id':_0x1b4329[_0xd352('0x5b')]['id']},'include':[{'model':db[_0xd352('0x8e')],'as':_0xd352('0x8e')}]})[_0xd352('0x26')](handleEntityNotFound(_0x49aac6,null))[_0xd352('0x26')](function(_0xa09298){if(_0xa09298){return _0x49aac6['download'](path[_0xd352('0x8f')](_0xf09924,_0xa09298['Attachment'][_0xd352('0x8b')]));}})[_0xd352('0x30')](handleError(_0x49aac6,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 648e708..ba98427 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 _0x0eeb=['../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x444e8b,_0x3524cc){var _0x35eb37=function(_0x17e1a3){while(--_0x17e1a3){_0x444e8b['push'](_0x444e8b['shift']());}};_0x35eb37(++_0x3524cc);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0eeb[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xb0ee('0x0'));var FaxMessage=require(_0xb0ee('0x1'))['db'][_0xb0ee('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xb0ee('0x3')](0x0);var events={'afterCreate':_0xb0ee('0x4'),'afterUpdate':_0xb0ee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5add55){return function(_0x3b94a0,_0xfbf0cc,_0x13a7ce){FaxMessageEvents[_0xb0ee('0x6')](_0x5add55+':'+_0x3b94a0['id'],_0x3b94a0);FaxMessageEvents[_0xb0ee('0x6')](_0x5add55,_0x3b94a0);_0x13a7ce(null);};}for(var e in events){if(events[_0xb0ee('0x7')](e)){var event=events[e];FaxMessage[_0xb0ee('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xfb0b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','update'];(function(_0x4f59d8,_0x496632){var _0x1e8919=function(_0x13a76d){while(--_0x13a76d){_0x4f59d8['push'](_0x4f59d8['shift']());}};_0x1e8919(++_0x496632);}(_0xfb0b,0x94));var _0xbfb0=function(_0xf5d506,_0x4bb13b){_0xf5d506=_0xf5d506-0x0;var _0xd51cef=_0xfb0b[_0xf5d506];return _0xd51cef;};'use strict';var EventEmitter=require(_0xbfb0('0x0'));var FaxMessage=require(_0xbfb0('0x1'))['db'][_0xbfb0('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbfb0('0x3'),'afterUpdate':_0xbfb0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4adab6){return function(_0x299a7b,_0x4ac75d,_0x238a87){FaxMessageEvents[_0xbfb0('0x5')](_0x4adab6+':'+_0x299a7b['id'],_0x299a7b);FaxMessageEvents[_0xbfb0('0x5')](_0x4adab6,_0x299a7b);_0x238a87(null);};}for(var e in events){if(events[_0xbfb0('0x6')](e)){var event=events[e];FaxMessage[_0xbfb0('0x7')](e,emitEvent(event));}}module[_0xbfb0('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 452a4d8..b3669ea 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 _0x24e9=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','rimraf','./faxMessage.attributes','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','findOne','FaxInteractionId','then','createdAt','catch'];(function(_0x4589a5,_0x2f1754){var _0x37fde0=function(_0x3ced3d){while(--_0x3ced3d){_0x4589a5['push'](_0x4589a5['shift']());}};_0x37fde0(++_0x2f1754);}(_0x24e9,0x86));var _0x924e=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0x24e9[_0x43b06b];return _0x2c555b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x924e('0x0'))(_0x924e('0x1'));var moment=require(_0x924e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x924e('0x3'));var config=require('../../config/environment');var attributes=require(_0x924e('0x4'));module['exports']=function(_0x212a57,_0x30b08e){return _0x212a57['define'](_0x924e('0x5'),attributes,{'tableName':_0x924e('0x6'),'paranoid':![],'indexes':[{'name':_0x924e('0x7'),'fields':['body'],'type':_0x924e('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x580bae,_0x58740c,_0x4023a9){var _0x597911=_0x212a57['models'];var _0x4a99d7=_0x580bae[_0x924e('0x9')]({'plain':!![]});if(_0x4a99d7['direction'][_0x924e('0xa')]()==='in'||_0x4a99d7[_0x924e('0xb')][_0x924e('0xa')]()===_0x924e('0xc')&&!_0x4a99d7[_0x924e('0xd')]&&!_[_0x924e('0xe')](_0x4a99d7['UserId'])){_0x597911['FaxInteraction'][_0x924e('0xf')]({'where':{'id':_0x4a99d7[_0x924e('0x10')]}})[_0x924e('0x11')](function(_0x571e6f){if(_0x571e6f){_0x571e6f['update']({'lastMsgAt':_0x4a99d7[_0x924e('0x12')],'lastMsgDirection':_0x4a99d7[_0x924e('0xb')]['toLowerCase']()});}})[_0x924e('0x13')](function(_0x46a4c4){console['error'](_0x46a4c4);});}_0x4023a9();}},'charset':_0x924e('0x14'),'collate':_0x924e('0x15')});}; \ No newline at end of file +var _0x8f9a=['path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x33bcdb,_0x11846b){var _0x18a9bf=function(_0x34417a){while(--_0x34417a){_0x33bcdb['push'](_0x33bcdb['shift']());}};_0x18a9bf(++_0x11846b);}(_0x8f9a,0xa3));var _0xa8f9=function(_0x58ade6,_0x5a676c){_0x58ade6=_0x58ade6-0x0;var _0x317afe=_0x8f9a[_0x58ade6];return _0x317afe;};'use strict';var _=require(_0xa8f9('0x0'));var util=require('util');var logger=require(_0xa8f9('0x1'))('api');var moment=require(_0xa8f9('0x2'));var BPromise=require(_0xa8f9('0x3'));var rp=require(_0xa8f9('0x4'));var fs=require('fs');var path=require(_0xa8f9('0x5'));var rimraf=require(_0xa8f9('0x6'));var config=require(_0xa8f9('0x7'));var attributes=require(_0xa8f9('0x8'));module[_0xa8f9('0x9')]=function(_0x349d08,_0x533845){return _0x349d08[_0xa8f9('0xa')](_0xa8f9('0xb'),attributes,{'tableName':_0xa8f9('0xc'),'paranoid':![],'indexes':[{'name':_0xa8f9('0xd'),'fields':['body'],'type':_0xa8f9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c7556,_0x4af44f,_0x284e53){var _0x513538=_0x349d08[_0xa8f9('0xf')];var _0x56c84e=_0x3c7556['get']({'plain':!![]});if(_0x56c84e[_0xa8f9('0x10')][_0xa8f9('0x11')]()==='in'||_0x56c84e[_0xa8f9('0x10')][_0xa8f9('0x11')]()==='out'&&!_0x56c84e[_0xa8f9('0x12')]&&!_[_0xa8f9('0x13')](_0x56c84e[_0xa8f9('0x14')])){_0x513538[_0xa8f9('0x15')][_0xa8f9('0x16')]({'where':{'id':_0x56c84e[_0xa8f9('0x17')]}})[_0xa8f9('0x18')](function(_0x403ee3){if(_0x403ee3){_0x403ee3['update']({'lastMsgAt':_0x56c84e[_0xa8f9('0x19')],'lastMsgDirection':_0x56c84e[_0xa8f9('0x10')][_0xa8f9('0x11')]()});}})[_0xa8f9('0x1a')](function(_0x36950e){console['error'](_0x36950e);});}_0x284e53();}},'charset':'utf8mb4','collate':_0xa8f9('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 165f336..d461749 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 _0x6f0d=['../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xae282f,_0x2d9368){var _0x5f46d4=function(_0x4f703e){while(--_0x4f703e){_0xae282f['push'](_0xae282f['shift']());}};_0x5f46d4(++_0x2d9368);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x14e865,_0x24de1b){_0x14e865=_0x14e865-0x0;var _0x412c58=_0x6f0d[_0x14e865];return _0x412c58;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});config[_0xd6f0('0xa')]=_[_0xd6f0('0xb')](config[_0xd6f0('0xa')],{'host':_0xd6f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6f0('0xd'))[_0xd6f0('0xe')](socket);function respondWithRpcPromise(_0x2854cd,_0x382a2e,_0x225dcf){return new BPromise(function(_0x4db64a,_0x136eee){return client[_0xd6f0('0xf')](_0x2854cd,_0x225dcf)[_0xd6f0('0x10')](function(_0x44bba6){logger['info'](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x382a2e,_0xd6f0('0x12'),JSON[_0xd6f0('0x15')](_0x44bba6));if(_0x44bba6[_0xd6f0('0x16')]){if(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x17')]===0x1f4){logger['error'](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')]['message']);return _0x136eee(_0x44bba6[_0xd6f0('0x16')]['message']);}logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);return _0x4db64a(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);}else{logger[_0xd6f0('0x19')](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));_0x4db64a(_0x44bba6[_0xd6f0('0x1a')][_0xd6f0('0x18')]);}})[_0xd6f0('0x1b')](function(_0x327231){logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x327231);_0x136eee(_0x327231);});});}exports[_0xd6f0('0x1c')]=function(_0x5cd367){var _0x48ac38=this;return new Promise(function(_0x3939aa,_0x264104){return db[_0xd6f0('0x1d')]['create'](_0x5cd367[_0xd6f0('0x1e')],{'raw':_0x5cd367[_0xd6f0('0x1f')]?_0x5cd367['options'][_0xd6f0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ee584){logger[_0xd6f0('0x19')]('CreateFaxMessage',_0x5cd367);logger[_0xd6f0('0x13')](_0xd6f0('0x1c'),_0x5cd367,JSON['stringify'](_0x1ee584));_0x3939aa(_0x1ee584);})[_0xd6f0('0x1b')](function(_0x402070){logger[_0xd6f0('0x16')]('CreateFaxMessage',_0x402070[_0xd6f0('0x18')],_0x5cd367);_0x264104(_0x48ac38[_0xd6f0('0x16')](0x1f4,_0x402070['message']));});});};exports[_0xd6f0('0x21')]=function(_0x551be8){var _0x2042d5=this;return new Promise(function(_0x3fb5c3,_0x1630dc){return db[_0xd6f0('0x1d')][_0xd6f0('0x22')](_0x551be8[_0xd6f0('0x1e')],{'raw':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['where']||null:null,'attributes':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x23')]||null:null,'limit':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x24')]||null:null})[_0xd6f0('0x10')](function(_0x3151f8){logger[_0xd6f0('0x19')](_0xd6f0('0x21'),_0x551be8);logger[_0xd6f0('0x13')](_0xd6f0('0x21'),_0x551be8,JSON[_0xd6f0('0x15')](_0x3151f8));_0x3fb5c3(_0x3151f8);})[_0xd6f0('0x1b')](function(_0xbdd223){logger[_0xd6f0('0x16')](_0xd6f0('0x21'),_0xbdd223[_0xd6f0('0x18')],_0x551be8);_0x1630dc(_0x2042d5[_0xd6f0('0x16')](0x1f4,_0xbdd223[_0xd6f0('0x18')]));});});}; \ No newline at end of file +var _0x9a19=['http','redis','socket.io-emitter','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','update','attributes','limit','UpdateFaxMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x17541e,_0x46df72){var _0x1c17eb=function(_0x5f1d1e){while(--_0x5f1d1e){_0x17541e['push'](_0x17541e['shift']());}};_0x1c17eb(++_0x46df72);}(_0x9a19,0x114));var _0x99a1=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x9a19[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});config[_0x99a1('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x99a1('0xe'))(new Redis(config[_0x99a1('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4696f6,_0xd7b568,_0x23db53){return new BPromise(function(_0x26473f,_0x1551a1){return client['request'](_0x4696f6,_0x23db53)[_0x99a1('0xf')](function(_0xdd29e1){logger[_0x99a1('0x10')](_0x99a1('0x11'),_0xd7b568,_0x99a1('0x12'));logger[_0x99a1('0x13')](_0x99a1('0x14'),_0xd7b568,_0x99a1('0x12'),JSON[_0x99a1('0x15')](_0xdd29e1));if(_0xdd29e1[_0x99a1('0x16')]){if(_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x17')]===0x1f4){logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0xdd29e1[_0x99a1('0x16')]['message']);return _0x1551a1(_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x18')]);}logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x18')]);return _0x26473f(_0xdd29e1[_0x99a1('0x16')]['message']);}else{logger['info'](_0x99a1('0x11'),_0xd7b568,_0x99a1('0x12'));_0x26473f(_0xdd29e1[_0x99a1('0x19')][_0x99a1('0x18')]);}})[_0x99a1('0x1a')](function(_0x209021){logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0x209021);_0x1551a1(_0x209021);});});}exports[_0x99a1('0x1b')]=function(_0x2d8cac){var _0x3c23c0=this;return new Promise(function(_0x5eabcb,_0x3023a1){return db[_0x99a1('0x1c')]['create'](_0x2d8cac[_0x99a1('0x1d')],{'raw':_0x2d8cac['options']?_0x2d8cac[_0x99a1('0x1e')][_0x99a1('0x1f')]===undefined?!![]:![]:!![]})[_0x99a1('0xf')](function(_0x2d3b82){logger['info'](_0x99a1('0x1b'),_0x2d8cac);logger[_0x99a1('0x13')]('CreateFaxMessage',_0x2d8cac,JSON[_0x99a1('0x15')](_0x2d3b82));_0x5eabcb(_0x2d3b82);})['catch'](function(_0x1f9800){logger[_0x99a1('0x16')](_0x99a1('0x1b'),_0x1f9800[_0x99a1('0x18')],_0x2d8cac);_0x3023a1(_0x3c23c0[_0x99a1('0x16')](0x1f4,_0x1f9800[_0x99a1('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x114b38){var _0x5dabd9=this;return new Promise(function(_0x5dc733,_0xafea84){return db[_0x99a1('0x1c')][_0x99a1('0x20')](_0x114b38[_0x99a1('0x1d')],{'raw':_0x114b38[_0x99a1('0x1e')]?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x114b38['options']?_0x114b38[_0x99a1('0x1e')]['where']||null:null,'attributes':_0x114b38[_0x99a1('0x1e')]?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x21')]||null:null,'limit':_0x114b38['options']?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x22')]||null:null})['then'](function(_0x37514e){logger[_0x99a1('0x10')](_0x99a1('0x23'),_0x114b38);logger[_0x99a1('0x13')](_0x99a1('0x23'),_0x114b38,JSON[_0x99a1('0x15')](_0x37514e));_0x5dc733(_0x37514e);})[_0x99a1('0x1a')](function(_0x26c23c){logger['error']('UpdateFaxMessage',_0x26c23c[_0x99a1('0x18')],_0x114b38);_0xafea84(_0x5dabd9['error'](0x1f4,_0x26c23c[_0x99a1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index cc44f7a..45a7dd3 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 _0xc78e=['update','emit','removeListener','length','faxMessage:','./faxMessage.events'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xc78e,0xbf));var _0xec78=function(_0x1edc0c,_0x33d6c5){_0x1edc0c=_0x1edc0c-0x0;var _0x40c93e=_0xc78e[_0x1edc0c];return _0x40c93e;};'use strict';var FaxMessageEvents=require(_0xec78('0x0'));var events=['save','remove',_0xec78('0x1')];function createListener(_0x4a4ffc,_0x4e3d01){return function(_0x37e03f){_0x4e3d01[_0xec78('0x2')](_0x4a4ffc,_0x37e03f);};}function removeListener(_0x3b177a,_0x362182){return function(){FaxMessageEvents[_0xec78('0x3')](_0x3b177a,_0x362182);};}exports['register']=function(_0xcc269a){for(var _0xed65ca=0x0,_0x23738c=events[_0xec78('0x4')];_0xed65ca<_0x23738c;_0xed65ca++){var _0x3c8dea=events[_0xed65ca];var _0x874ecc=createListener(_0xec78('0x5')+_0x3c8dea,_0xcc269a);FaxMessageEvents['on'](_0x3c8dea,_0x874ecc);}}; \ No newline at end of file +var _0x0329=['emit','length','faxMessage:','./faxMessage.events','remove','update'];(function(_0xdd4363,_0x42998c){var _0x5f2c4a=function(_0x2cbfef){while(--_0x2cbfef){_0xdd4363['push'](_0xdd4363['shift']());}};_0x5f2c4a(++_0x42998c);}(_0x0329,0x11d));var _0x9032=function(_0x3bbde7,_0x344127){_0x3bbde7=_0x3bbde7-0x0;var _0x117992=_0x0329[_0x3bbde7];return _0x117992;};'use strict';var FaxMessageEvents=require(_0x9032('0x0'));var events=['save',_0x9032('0x1'),_0x9032('0x2')];function createListener(_0x17b650,_0x49b899){return function(_0x5586d2){_0x49b899[_0x9032('0x3')](_0x17b650,_0x5586d2);};}function removeListener(_0x219ecb,_0x3cbd8d){return function(){FaxMessageEvents['removeListener'](_0x219ecb,_0x3cbd8d);};}exports['register']=function(_0x1097bb){for(var _0x1c0040=0x0,_0x3588ca=events[_0x9032('0x4')];_0x1c0040<_0x3588ca;_0x1c0040++){var _0x42122a=events[_0x1c0040];var _0x1d1fba=createListener(_0x9032('0x5')+_0x42122a,_0x1097bb);FaxMessageEvents['on'](_0x42122a,_0x1d1fba);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 358c1f8..eabee5d 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 _0xec56=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','reject','delete','exports','multer','connect-timeout','express'];(function(_0x53dca0,_0x1db81d){var _0x516029=function(_0x41c692){while(--_0x41c692){_0x53dca0['push'](_0x53dca0['shift']());}};_0x516029(++_0x1db81d);}(_0xec56,0x1bd));var _0x6ec5=function(_0x1a98b8,_0x47d6dd){_0x1a98b8=_0x1a98b8-0x0;var _0x2db4d5=_0xec56[_0x1a98b8];return _0x2db4d5;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['get'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x11')]);router[_0x6ec5('0x12')]('/',auth[_0x6ec5('0xa')](),interaction[_0x6ec5('0x13')](_0x6ec5('0x14'),'faxmessage:create'),controller[_0x6ec5('0x15')]);router[_0x6ec5('0x16')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x17')]);router[_0x6ec5('0x16')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller['accept']);router[_0x6ec5('0x16')]('/:id/reject',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x19')]);router[_0x6ec5('0x1a')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller['destroy']);module[_0x6ec5('0x1b')]=router; \ No newline at end of file +var _0x2547=['/:id/download','download','post','tracked','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3987a1,_0x447793){var _0xe2596e=function(_0x546925){while(--_0x546925){_0x3987a1['push'](_0x3987a1['shift']());}};_0xe2596e(++_0x447793);}(_0x2547,0x1cd));var _0x7254=function(_0x5a68d5,_0x2e48dd){_0x5a68d5=_0x5a68d5-0x0;var _0x4ea813=_0x2547[_0x5a68d5];return _0x4ea813;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x11')]('/',auth[_0x7254('0xa')](),interaction[_0x7254('0x12')]('fax',_0x7254('0x13')),controller['create']);router[_0x7254('0x14')]('/:id',auth[_0x7254('0xa')](),controller[_0x7254('0x15')]);router[_0x7254('0x14')](_0x7254('0x16'),auth[_0x7254('0xa')](),controller[_0x7254('0x17')]);router[_0x7254('0x14')](_0x7254('0x18'),auth[_0x7254('0xa')](),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),controller['destroy']);module[_0x7254('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 46fe031..996fbc7 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 _0x7bd0=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x592e37,_0x388438){var _0x22ce1f=function(_0xa1549e){while(--_0xa1549e){_0x592e37['push'](_0x592e37['shift']());}};_0x22ce1f(++_0x388438);}(_0x7bd0,0x111));var _0x07bd=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x7bd0[_0x22cb5f];return _0x274d36;};'use strict';var Sequelize=require(_0x07bd('0x0'));module[_0x07bd('0x1')]={'name':{'type':Sequelize[_0x07bd('0x2')],'unique':_0x07bd('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x07bd('0x2')]},'timeout':{'type':Sequelize[_0x07bd('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x07bd('0x5')](_0x07bd('0x6'),'beepall',_0x07bd('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x07bd('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9169=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x3ef55e,_0xae8c6c){var _0x1df0d4=function(_0x5dd3f7){while(--_0x5dd3f7){_0x3ef55e['push'](_0x3ef55e['shift']());}};_0x1df0d4(++_0xae8c6c);}(_0x9169,0xdd));var _0x9916=function(_0x52ab89,_0x58a774){_0x52ab89=_0x52ab89-0x0;var _0x5e689d=_0x9169[_0x52ab89];return _0x5e689d;};'use strict';var Sequelize=require(_0x9916('0x0'));module[_0x9916('0x1')]={'name':{'type':Sequelize[_0x9916('0x2')],'unique':_0x9916('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9916('0x2')]},'timeout':{'type':Sequelize[_0x9916('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9916('0x5')](_0x9916('0x6'),_0x9916('0x7'),_0x9916('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9916('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index c562077..134d61c 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 _0xfdcd=['defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','limit','set','update','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','getOptions','count','then','include','findAll','rows','catch','show','model','keys','query','filters','intersection','attributes','fields','length','merge','options','create','user','role','FaxQueues','userProfileId','autoAssociation','body','params','describe','getMembers','UserFaxQueue','hasOwnProperty','nolimit','sort','where','pick','FaxQueueId','filter','User','findAndCountAll','agent','faxPause','updatedAt','format','%s/%s','SIP','getTeams','findOne','Team','order','addTeams','ids','Agents','online','interface','flatMap','transaction','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','find','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','isArray','getAgents','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require('bluebird');var util=require(_0xdfdc('0x0'));var _=require(_0xdfdc('0x1'));var squel=require(_0xdfdc('0x2'));var Redis=require('ioredis');var qs=require(_0xdfdc('0x3'));var logger=require(_0xdfdc('0x4'))(_0xdfdc('0x5'));var config=require(_0xdfdc('0x6'));var db=require(_0xdfdc('0x7'))['db'];config[_0xdfdc('0x8')]=_[_0xdfdc('0x9')](config[_0xdfdc('0x8')],{'host':_0xdfdc('0xa'),'port':0x18eb});var socket=require(_0xdfdc('0xb'))(new Redis(config[_0xdfdc('0x8')]));require(_0xdfdc('0xc'))[_0xdfdc('0xd')](socket);function respondWithStatusCode(_0x580fc7,_0x417ad4){_0x417ad4=_0x417ad4||0xcc;return function(_0xe36cc6){if(_0xe36cc6){return _0x580fc7['sendStatus'](_0x417ad4);}return _0x580fc7[_0xdfdc('0xe')](_0x417ad4)[_0xdfdc('0xf')]();};}function respondWithResult(_0x452de2,_0x37fe8b){_0x37fe8b=_0x37fe8b||0xc8;return function(_0x271fb9){if(_0x271fb9){return _0x452de2['status'](_0x37fe8b)[_0xdfdc('0x10')](_0x271fb9);}};}function respondWithFilteredResult(_0x495a93,_0x4a9418){return function(_0x29d282){if(_0x29d282){var _0x23a0cc=typeof _0x4a9418[_0xdfdc('0x11')]===_0xdfdc('0x12')&&typeof _0x4a9418[_0xdfdc('0x13')]===_0xdfdc('0x12');var _0x77bb4c=_0x29d282['count'];var _0x2f6e11=_0x23a0cc?0x0:_0x4a9418[_0xdfdc('0x11')];var _0x32451d=_0x23a0cc?_0x29d282['count']:_0x4a9418[_0xdfdc('0x11')]+_0x4a9418[_0xdfdc('0x13')];var _0x2b29bc;if(_0x32451d>=_0x77bb4c){_0x32451d=_0x77bb4c;_0x2b29bc=0xc8;}else{_0x2b29bc=0xce;}_0x495a93['status'](_0x2b29bc);return _0x495a93[_0xdfdc('0x14')]('Content-Range',_0x2f6e11+'-'+_0x32451d+'/'+_0x77bb4c)[_0xdfdc('0x10')](_0x29d282);}return null;};}function saveUpdates(_0x36aae5){return function(_0x4efb5a){if(_0x4efb5a){return _0x4efb5a[_0xdfdc('0x15')](_0x36aae5)['then'](function(_0x32c616){return _0x32c616;});}return null;};}function removeEntity(_0x100026){return function(_0x23a3be){if(_0x23a3be){return _0x23a3be[_0xdfdc('0x16')]()['then'](function(){var _0x2a8a1b=_0x23a3be[_0xdfdc('0x17')]({'plain':!![]});var _0x1315ee='FaxQueues';return db[_0xdfdc('0x18')][_0xdfdc('0x16')]({'where':{'type':_0x1315ee,'resourceId':_0x2a8a1b['id']}})['then'](function(){return _0x23a3be;});})['then'](function(){_0x100026[_0xdfdc('0xe')](0xcc)[_0xdfdc('0xf')]();});}};}function handleEntityNotFound(_0x462589){return function(_0x397f0d){if(!_0x397f0d){_0x462589[_0xdfdc('0x19')](0x194);}return _0x397f0d;};}function handleError(_0x1bb542,_0x1a2b57){_0x1a2b57=_0x1a2b57||0x1f4;return function(_0x40cfa2){logger[_0xdfdc('0x1a')](_0x40cfa2[_0xdfdc('0x1b')]);if(_0x40cfa2['name']){delete _0x40cfa2[_0xdfdc('0x1c')];}_0x1bb542[_0xdfdc('0xe')](_0x1a2b57)[_0xdfdc('0x1d')](_0x40cfa2);};}exports[_0xdfdc('0x1e')]=function(_0x2d5b07,_0x5c047c){var _0x585494={};var _0x540cdf={'count':0x0,'rows':[]};var _0x28f124=_[_0xdfdc('0x1f')](db[_0xdfdc('0x20')][_0xdfdc('0x21')],function(_0x3e3b93){return{'name':_0x3e3b93['fieldName'],'type':_0x3e3b93[_0xdfdc('0x22')][_0xdfdc('0x23')]};});_0x585494=qs[_0xdfdc('0x24')](_0x28f124,_0x2d5b07);var _0x4e7663={'where':_0x585494['where']};return db[_0xdfdc('0x20')][_0xdfdc('0x25')](_0x4e7663)[_0xdfdc('0x26')](function(_0x223b48){_0x540cdf[_0xdfdc('0x25')]=_0x223b48;_0x585494[_0xdfdc('0x27')]=qs[_0xdfdc('0x27')](_0x2d5b07['query']);return db[_0xdfdc('0x20')][_0xdfdc('0x28')](_0x585494);})[_0xdfdc('0x26')](function(_0x10bf5b){_0x540cdf[_0xdfdc('0x29')]=_0x10bf5b;return _0x540cdf;})[_0xdfdc('0x26')](respondWithFilteredResult(_0x5c047c,_0x585494))[_0xdfdc('0x2a')](handleError(_0x5c047c,null));};exports[_0xdfdc('0x2b')]=function(_0x253dbd,_0x135bdb){var _0x493ab4={'raw':!![],'where':{'id':_0x253dbd['params']['id']}},_0x561972={};_0x561972[_0xdfdc('0x2c')]=_[_0xdfdc('0x2d')](db[_0xdfdc('0x20')][_0xdfdc('0x21')]);_0x561972[_0xdfdc('0x2e')]=_[_0xdfdc('0x2d')](_0x253dbd[_0xdfdc('0x2e')]);_0x561972[_0xdfdc('0x2f')]=_[_0xdfdc('0x30')](_0x561972[_0xdfdc('0x2c')],_0x561972[_0xdfdc('0x2e')]);_0x493ab4[_0xdfdc('0x31')]=_[_0xdfdc('0x30')](_0x561972['model'],qs[_0xdfdc('0x32')](_0x253dbd[_0xdfdc('0x2e')][_0xdfdc('0x32')]));_0x493ab4[_0xdfdc('0x31')]=_0x493ab4['attributes'][_0xdfdc('0x33')]?_0x493ab4[_0xdfdc('0x31')]:_0x561972[_0xdfdc('0x2c')];if(_0x253dbd[_0xdfdc('0x2e')]['includeAll']){_0x493ab4[_0xdfdc('0x27')]=[{'all':!![]}];}_0x493ab4=_[_0xdfdc('0x34')]({},_0x493ab4,_0x253dbd[_0xdfdc('0x35')]);return db[_0xdfdc('0x20')]['find'](_0x493ab4)['then'](handleEntityNotFound(_0x135bdb,null))[_0xdfdc('0x26')](respondWithResult(_0x135bdb,null))['catch'](handleError(_0x135bdb,null));};exports[_0xdfdc('0x36')]=function(_0x4c4fa9,_0x5c9dbf){return db['FaxQueue'][_0xdfdc('0x36')](_0x4c4fa9['body'],{})[_0xdfdc('0x26')](function(_0x4618ba){var _0x136411=_0x4c4fa9[_0xdfdc('0x37')][_0xdfdc('0x17')]({'plain':!![]});if(!_0x136411)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x136411[_0xdfdc('0x38')]==='user'){var _0x21a00c=_0x4618ba['get']({'plain':!![]});var _0x4fd772=_0xdfdc('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x4fd772,'userProfileId':_0x136411[_0xdfdc('0x3a')]},'raw':!![]})[_0xdfdc('0x26')](function(_0x40e6b1){if(_0x40e6b1&&_0x40e6b1[_0xdfdc('0x3b')]===0x0){return db[_0xdfdc('0x18')][_0xdfdc('0x36')]({'name':_0x21a00c['name'],'resourceId':_0x21a00c['id'],'type':_0x40e6b1[_0xdfdc('0x1c')],'sectionId':_0x40e6b1['id']},{})[_0xdfdc('0x26')](function(){return _0x4618ba;});}else{return _0x4618ba;}})[_0xdfdc('0x2a')](function(_0x20dc1f){logger[_0xdfdc('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20dc1f);throw _0x20dc1f;});}return _0x4618ba;})['then'](respondWithResult(_0x5c9dbf,0xc9))[_0xdfdc('0x2a')](handleError(_0x5c9dbf,null));};exports[_0xdfdc('0x15')]=function(_0xac59e2,_0x4a9f94){if(_0xac59e2[_0xdfdc('0x3c')]['id']){delete _0xac59e2['body']['id'];}return db[_0xdfdc('0x20')]['find']({'where':{'id':_0xac59e2[_0xdfdc('0x3d')]['id']}})[_0xdfdc('0x26')](handleEntityNotFound(_0x4a9f94,null))[_0xdfdc('0x26')](saveUpdates(_0xac59e2[_0xdfdc('0x3c')],null))['then'](respondWithResult(_0x4a9f94,null))['catch'](handleError(_0x4a9f94,null));};exports[_0xdfdc('0x16')]=function(_0x3c065a,_0x10c337){return db['FaxQueue']['find']({'where':{'id':_0x3c065a['params']['id']}})[_0xdfdc('0x26')](handleEntityNotFound(_0x10c337,null))[_0xdfdc('0x26')](removeEntity(_0x10c337,null))['catch'](handleError(_0x10c337,null));};exports[_0xdfdc('0x3e')]=function(_0x397e4c,_0x61909){return db[_0xdfdc('0x20')][_0xdfdc('0x3e')]()['then'](respondWithResult(_0x61909,null))[_0xdfdc('0x2a')](handleError(_0x61909,null));};exports[_0xdfdc('0x3f')]=function(_0x390da4,_0xb65f88){var _0x161103={'raw':!![],'where':{}},_0x5a8674={},_0x3ad5a6;return db[_0xdfdc('0x20')]['findOne']({'where':{'id':_0x390da4[_0xdfdc('0x3d')]['id']}})[_0xdfdc('0x26')](handleEntityNotFound(_0xb65f88,null))['then'](function(_0x36bd40){if(_0x36bd40){_0x3ad5a6=_0x36bd40[_0xdfdc('0x17')]({'plain':!![]});_0x5a8674[_0xdfdc('0x2c')]=_[_0xdfdc('0x2d')](db[_0xdfdc('0x40')][_0xdfdc('0x21')]);_0x5a8674[_0xdfdc('0x2e')]=_['keys'](_0x390da4[_0xdfdc('0x2e')]);_0x5a8674[_0xdfdc('0x2f')]=_[_0xdfdc('0x30')](_0x5a8674[_0xdfdc('0x2c')],_0x5a8674[_0xdfdc('0x2e')]);_0x161103[_0xdfdc('0x31')]=_[_0xdfdc('0x30')](_0x5a8674[_0xdfdc('0x2c')],qs[_0xdfdc('0x32')](_0x390da4[_0xdfdc('0x2e')][_0xdfdc('0x32')]));_0x161103[_0xdfdc('0x31')]=_0x161103[_0xdfdc('0x31')]['length']?_0x161103[_0xdfdc('0x31')]:_0x5a8674[_0xdfdc('0x2c')];if(!_0x390da4[_0xdfdc('0x2e')][_0xdfdc('0x41')](_0xdfdc('0x42'))){_0x161103[_0xdfdc('0x13')]=qs['limit'](_0x390da4[_0xdfdc('0x2e')]['limit']);_0x161103[_0xdfdc('0x11')]=qs[_0xdfdc('0x11')](_0x390da4['query'][_0xdfdc('0x11')]);}_0x161103['order']=qs[_0xdfdc('0x43')](_0x390da4[_0xdfdc('0x2e')]['sort']);_0x161103[_0xdfdc('0x44')]=qs[_0xdfdc('0x2f')](_[_0xdfdc('0x45')](_0x390da4[_0xdfdc('0x2e')],_0x5a8674[_0xdfdc('0x2f')]));_0x161103[_0xdfdc('0x44')][_0xdfdc('0x46')]=_0x36bd40['id'];if(_0x390da4[_0xdfdc('0x2e')][_0xdfdc('0x47')]){_0x161103[_0xdfdc('0x44')]=_[_0xdfdc('0x34')](_0x161103[_0xdfdc('0x44')],{'$or':_[_0xdfdc('0x1f')](_0x161103['attributes'],function(_0xfc5643){var _0x5d68dc={};_0x5d68dc[_0xfc5643]={'$like':'%'+_0x390da4['query']['filter']+'%'};return _0x5d68dc;})});}_0x161103=_['merge']({},_0x161103,_0x390da4[_0xdfdc('0x35')]);return db[_0xdfdc('0x40')][_0xdfdc('0x28')](_0x161103);}})[_0xdfdc('0x26')](function(_0x2cef7c){if(_0x2cef7c){return db[_0xdfdc('0x48')][_0xdfdc('0x49')]({'where':{'id':_[_0xdfdc('0x1f')](_0x2cef7c,'UserId'),'role':_0xdfdc('0x4a')},'attributes':['id','name',_0xdfdc('0x4b'),_0xdfdc('0x4c'),'createdAt']});}})['then'](function(_0x54dad1){if(_0x54dad1){return{'count':_0x54dad1[_0xdfdc('0x25')],'rows':_[_0xdfdc('0x1f')](_0x54dad1[_0xdfdc('0x29')],function(_0x350467){return{'membername':_0x350467[_0xdfdc('0x1c')],'UserId':_0x350467['id'],'queue_name':_0x3ad5a6[_0xdfdc('0x1c')],'FaxQueueId':_0x3ad5a6['id'],'interface':util[_0xdfdc('0x4d')](_0xdfdc('0x4e'),_0xdfdc('0x4f'),_0x350467[_0xdfdc('0x1c')]),'penalty':0x0,'paused':_0x350467[_0xdfdc('0x4b')],'createdAt':_0x350467['createdAt'],'updatedAt':_0x350467[_0xdfdc('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xb65f88,_0x161103))[_0xdfdc('0x2a')](handleError(_0xb65f88,null));};exports[_0xdfdc('0x50')]=function(_0x15e64f,_0x19bd70){var _0x54ef29={};var _0x1711b5={};var _0xee9f6d;var _0xbe629d;return db[_0xdfdc('0x20')][_0xdfdc('0x51')]({'where':{'id':_0x15e64f[_0xdfdc('0x3d')]['id']}})[_0xdfdc('0x26')](handleEntityNotFound(_0x19bd70,null))[_0xdfdc('0x26')](function(_0x55eeaa){if(_0x55eeaa){_0xee9f6d=_0x55eeaa;_0x1711b5['model']=_[_0xdfdc('0x2d')](db[_0xdfdc('0x52')][_0xdfdc('0x21')]);_0x1711b5['query']=_[_0xdfdc('0x2d')](_0x15e64f[_0xdfdc('0x2e')]);_0x1711b5[_0xdfdc('0x2f')]=_[_0xdfdc('0x30')](_0x1711b5[_0xdfdc('0x2c')],_0x1711b5['query']);_0x54ef29[_0xdfdc('0x31')]=_[_0xdfdc('0x30')](_0x1711b5['model'],qs['fields'](_0x15e64f['query'][_0xdfdc('0x32')]));_0x54ef29[_0xdfdc('0x31')]=_0x54ef29[_0xdfdc('0x31')][_0xdfdc('0x33')]?_0x54ef29['attributes']:_0x1711b5['model'];_0x54ef29[_0xdfdc('0x53')]=qs['sort'](_0x15e64f[_0xdfdc('0x2e')][_0xdfdc('0x43')]);_0x54ef29[_0xdfdc('0x44')]=qs[_0xdfdc('0x2f')](_[_0xdfdc('0x45')](_0x15e64f[_0xdfdc('0x2e')],_0x1711b5['filters']));if(_0x15e64f['query']['filter']){_0x54ef29[_0xdfdc('0x44')]=_[_0xdfdc('0x34')](_0x54ef29[_0xdfdc('0x44')],{'$or':_['map'](_0x54ef29[_0xdfdc('0x31')],function(_0x290dca){var _0x438c05={};_0x438c05[_0x290dca]={'$like':'%'+_0x15e64f['query']['filter']+'%'};return _0x438c05;})});}_0x54ef29=_[_0xdfdc('0x34')]({},_0x54ef29,_0x15e64f[_0xdfdc('0x35')]);return _0xee9f6d[_0xdfdc('0x50')](_0x54ef29);}})[_0xdfdc('0x26')](function(_0x2b7f28){if(_0x2b7f28){_0xbe629d=_0x2b7f28['length'];if(!_0x15e64f[_0xdfdc('0x2e')]['hasOwnProperty'](_0xdfdc('0x42'))){_0x54ef29[_0xdfdc('0x13')]=qs[_0xdfdc('0x13')](_0x15e64f[_0xdfdc('0x2e')][_0xdfdc('0x13')]);_0x54ef29[_0xdfdc('0x11')]=qs[_0xdfdc('0x11')](_0x15e64f[_0xdfdc('0x2e')]['offset']);}return _0xee9f6d[_0xdfdc('0x50')](_0x54ef29);}})[_0xdfdc('0x26')](function(_0x12c401){if(_0x12c401){return _0x12c401?{'count':_0xbe629d,'rows':_0x12c401}:null;}})[_0xdfdc('0x26')](respondWithResult(_0x19bd70,null))[_0xdfdc('0x2a')](handleError(_0x19bd70,null));};exports[_0xdfdc('0x54')]=function(_0x4c382f,_0x1f6bd9){var _0x175833=_0x4c382f[_0xdfdc('0x3c')][_0xdfdc('0x55')];return db[_0xdfdc('0x52')][_0xdfdc('0x28')]({'where':{'id':_0x175833},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdfdc('0x56'),'attributes':['id','name',_0xdfdc('0x57'),'voicePause',_0xdfdc('0x58')],'raw':!![]}]})[_0xdfdc('0x26')](function(_0x43bc68){if(_0x43bc68){var _0x198547=_[_0xdfdc('0x59')](_0x43bc68,function(_0x27e49f){var _0xdd741=_0x27e49f[_0xdfdc('0x17')]({'plain':!![]});return _0xdd741[_0xdfdc('0x56')];});return db[_0xdfdc('0x20')]['find']({'where':{'id':_0x4c382f[_0xdfdc('0x3d')]['id']}})[_0xdfdc('0x26')](function(_0x507afd){return db['sequelize'][_0xdfdc('0x5a')](function(_0x3e8874){return _0x507afd['addTeams'](_0x175833,{'transaction':_0x3e8874})[_0xdfdc('0x26')](function(){return BPromise['each'](_0x198547,function(_0x37bd48){return db[_0xdfdc('0x40')]['findOrCreate']({'where':{'UserId':_0x37bd48['id'],'FaxQueueId':_0x4c382f[_0xdfdc('0x3d')]['id']},'transaction':_0x3e8874});});})[_0xdfdc('0x26')](function(){_0x198547['forEach'](function(_0x26e733){socket[_0xdfdc('0x5b')](_0xdfdc('0x5c'),{'UserId':_0x26e733['id'],'FaxQueueId':_0x507afd['id']});});});});});}})[_0xdfdc('0x26')](respondWithStatusCode(_0x1f6bd9,null))[_0xdfdc('0x2a')](handleError(_0x1f6bd9,null));};exports[_0xdfdc('0x5d')]=function(_0x1de113,_0x58e8d0){return db['Team'][_0xdfdc('0x28')]({'where':{'id':_0x1de113[_0xdfdc('0x2e')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdfdc('0x56'),'attributes':['id'],'raw':!![]}]})[_0xdfdc('0x26')](handleEntityNotFound(_0x58e8d0,null))['then'](function(_0x4a98f8){var _0x51cd09=_[_0xdfdc('0x1f')](_0x4a98f8,'id');var _0x3af077=[];var _0x5268d7=[];var _0xd7a3eb=squel[_0xdfdc('0x5e')]();_0xd7a3eb[_0xdfdc('0x5f')](_0xdfdc('0x60'))[_0xdfdc('0x61')](_0xdfdc('0x62'),'tq')['join'](_0xdfdc('0x63'),'ut',_0xdfdc('0x64'))[_0xdfdc('0x44')]('FaxQueueId\x20=\x20?',_0x1de113[_0xdfdc('0x3d')]['id']);for(var _0x1839e5=0x0;_0x1839e5<_0x4a98f8[_0xdfdc('0x33')];_0x1839e5+=0x1){let _0x3abcaf=_0x4a98f8[_0x1839e5];for(var _0x47afab=0x0;_0x47afab<_0x3abcaf[_0xdfdc('0x56')]['length'];_0x47afab+=0x1){let _0xd4f5a5=_0x3abcaf[_0xdfdc('0x56')][_0x47afab];var _0xa88ad6=_0xd7a3eb['clone']();_0xa88ad6['where'](_0xdfdc('0x65'),_0xd4f5a5['id']);_0x5268d7[_0xdfdc('0x66')](db[_0xdfdc('0x67')][_0xdfdc('0x2e')](_0xa88ad6[_0xdfdc('0x68')](),{'type':db[_0xdfdc('0x67')][_0xdfdc('0x69')][_0xdfdc('0x6a')]})[_0xdfdc('0x26')](function(_0x3ad159){if(_0x3ad159['length']===0x1){return _0xd4f5a5['id'];}else{var _0x1e9017=_[_0xdfdc('0x6b')](_['map'](_0x3ad159,_0xdfdc('0x6c')),function(_0x196d35){return _[_0xdfdc('0x6d')](_0x51cd09,_0x196d35);});if(_0x1e9017){return _0xd4f5a5['id'];}}}));}}return BPromise['all'](_0x5268d7)[_0xdfdc('0x26')](function(_0x4e83e5){_0x3af077=_(_0x3af077)[_0xdfdc('0x6e')](_0x4e83e5)[_0xdfdc('0x6f')]()[_0xdfdc('0x70')]();return db[_0xdfdc('0x20')][_0xdfdc('0x71')]({'where':{'id':_0x1de113[_0xdfdc('0x3d')]['id']}})[_0xdfdc('0x26')](function(_0x3a1f54){return db[_0xdfdc('0x67')][_0xdfdc('0x5a')](function(_0x5e287e){return _0x3a1f54[_0xdfdc('0x5d')](_0x1de113['query'][_0xdfdc('0x55')],{'transaction':_0x5e287e})['then'](function(){if(!_[_0xdfdc('0x72')](_0x3af077)){return _0x3a1f54[_0xdfdc('0x73')](_0x3af077,{'transaction':_0x5e287e});}})[_0xdfdc('0x26')](function(){_0x3af077[_0xdfdc('0x74')](function(_0x5cf661){socket[_0xdfdc('0x5b')](_0xdfdc('0x75'),{'UserId':_0x5cf661,'FaxQueueId':_0x3a1f54['id']});});});});});});})[_0xdfdc('0x26')](respondWithStatusCode(_0x58e8d0,null))[_0xdfdc('0x2a')](handleError(_0x58e8d0,null));};exports[_0xdfdc('0x76')]=function(_0x131205,_0x4c6e88){return db[_0xdfdc('0x20')][_0xdfdc('0x71')]({'where':{'id':_0x131205[_0xdfdc('0x3d')]['id']}})[_0xdfdc('0x26')](handleEntityNotFound(_0x4c6e88,null))['then'](function(_0xa494c2){if(_0xa494c2){return _0xa494c2[_0xdfdc('0x76')](_0x131205['body'][_0xdfdc('0x55')],_['omit'](_0x131205[_0xdfdc('0x3c')],[_0xdfdc('0x55'),'id'])||{})['spread'](function(_0x1c14ee){for(var _0x3e6808=0x0;_0x3e6808<_0x131205[_0xdfdc('0x3c')][_0xdfdc('0x55')][_0xdfdc('0x33')];_0x3e6808+=0x1){socket[_0xdfdc('0x5b')]('userFaxQueue:save',{'UserId':Number(_0x131205[_0xdfdc('0x3c')]['ids'][_0x3e6808]),'FaxQueueId':Number(_0x131205[_0xdfdc('0x3d')]['id'])});}return _0x1c14ee;});}})['then'](respondWithResult(_0x4c6e88,null))[_0xdfdc('0x2a')](handleError(_0x4c6e88,null));};exports[_0xdfdc('0x73')]=function(_0x1dd806,_0x35ee0a){return db[_0xdfdc('0x20')]['find']({'where':{'id':_0x1dd806[_0xdfdc('0x3d')]['id']}})[_0xdfdc('0x26')](handleEntityNotFound(_0x35ee0a,null))[_0xdfdc('0x26')](function(_0x4ca1c2){if(_0x4ca1c2){return _0x4ca1c2[_0xdfdc('0x73')](_0x1dd806['query'][_0xdfdc('0x55')])[_0xdfdc('0x26')](function(){if(_[_0xdfdc('0x77')](_0x1dd806[_0xdfdc('0x2e')]['ids'])){for(var _0x41c1ae=0x0;_0x41c1ae<_0x1dd806[_0xdfdc('0x2e')][_0xdfdc('0x55')][_0xdfdc('0x33')];_0x41c1ae+=0x1){socket[_0xdfdc('0x5b')](_0xdfdc('0x75'),{'UserId':Number(_0x1dd806[_0xdfdc('0x2e')]['ids'][_0x41c1ae]),'FaxQueueId':Number(_0x1dd806[_0xdfdc('0x3d')]['id'])});}}else{socket[_0xdfdc('0x5b')](_0xdfdc('0x75'),{'UserId':Number(_0x1dd806[_0xdfdc('0x2e')]['ids']),'FaxQueueId':Number(_0x1dd806[_0xdfdc('0x3d')]['id'])});}});}})['then'](respondWithStatusCode(_0x35ee0a,null))['catch'](handleError(_0x35ee0a,null));};exports[_0xdfdc('0x78')]=function(_0x318c48,_0xf9e02e){var _0x6fb433={};var _0x1553bd={};var _0x380ee2;var _0xb54e3a;return db[_0xdfdc('0x20')][_0xdfdc('0x51')]({'where':{'id':_0x318c48[_0xdfdc('0x3d')]['id']}})[_0xdfdc('0x26')](handleEntityNotFound(_0xf9e02e,null))[_0xdfdc('0x26')](function(_0x15c16e){if(_0x15c16e){_0x380ee2=_0x15c16e;_0x1553bd[_0xdfdc('0x2c')]=_['keys'](db[_0xdfdc('0x48')][_0xdfdc('0x21')]);_0x1553bd[_0xdfdc('0x2e')]=_[_0xdfdc('0x2d')](_0x318c48[_0xdfdc('0x2e')]);_0x1553bd[_0xdfdc('0x2f')]=_[_0xdfdc('0x30')](_0x1553bd[_0xdfdc('0x2c')],_0x1553bd[_0xdfdc('0x2e')]);_0x6fb433[_0xdfdc('0x31')]=_[_0xdfdc('0x30')](_0x1553bd['model'],qs[_0xdfdc('0x32')](_0x318c48[_0xdfdc('0x2e')]['fields']));_0x6fb433['attributes']=_0x6fb433['attributes']['length']?_0x6fb433[_0xdfdc('0x31')]:_0x1553bd[_0xdfdc('0x2c')];_0x6fb433[_0xdfdc('0x53')]=qs['sort'](_0x318c48['query']['sort']);_0x6fb433[_0xdfdc('0x44')]=qs[_0xdfdc('0x2f')](_[_0xdfdc('0x45')](_0x318c48[_0xdfdc('0x2e')],_0x1553bd[_0xdfdc('0x2f')]));if(_0x318c48[_0xdfdc('0x2e')][_0xdfdc('0x47')]){_0x6fb433[_0xdfdc('0x44')]=_[_0xdfdc('0x34')](_0x6fb433[_0xdfdc('0x44')],{'$or':_[_0xdfdc('0x1f')](_0x6fb433[_0xdfdc('0x31')],function(_0x3b548e){var _0x27af6a={};_0x27af6a[_0x3b548e]={'$like':'%'+_0x318c48[_0xdfdc('0x2e')]['filter']+'%'};return _0x27af6a;})});}_0x6fb433=_[_0xdfdc('0x34')]({},_0x6fb433,_0x318c48[_0xdfdc('0x35')]);return _0x380ee2['getAgents'](_0x6fb433);}})['then'](function(_0xa2f7d4){if(_0xa2f7d4){_0xb54e3a=_0xa2f7d4[_0xdfdc('0x33')];if(!_0x318c48['query']['hasOwnProperty']('nolimit')){_0x6fb433['limit']=qs[_0xdfdc('0x13')](_0x318c48[_0xdfdc('0x2e')][_0xdfdc('0x13')]);_0x6fb433[_0xdfdc('0x11')]=qs[_0xdfdc('0x11')](_0x318c48[_0xdfdc('0x2e')][_0xdfdc('0x11')]);}return _0x380ee2['getAgents'](_0x6fb433);}})[_0xdfdc('0x26')](function(_0x574ae0){if(_0x574ae0){return _0x574ae0?{'count':_0xb54e3a,'rows':_0x574ae0}:null;}})[_0xdfdc('0x26')](respondWithResult(_0xf9e02e,null))[_0xdfdc('0x2a')](handleError(_0xf9e02e,null));}; \ No newline at end of file +var _0xaf5a=['findOrCreate','forEach','removeTeams','tq.TeamId','from','team_has_fax_queues','join','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','userFaxQueue:save','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./faxQueue.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','model','keys','intersection','attributes','fields','length','includeAll','options','FaxQueue','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserFaxQueue','filters','hasOwnProperty','nolimit','order','sort','pick','FaxQueueId','filter','map','merge','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','faxPause','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0xaf5a,0x116));var _0xaaf5=function(_0x3e103d,_0x55790c){_0x3e103d=_0x3e103d-0x0;var _0x4931bf=_0xaf5a[_0x3e103d];return _0x4931bf;};'use strict';var BPromise=require('bluebird');var util=require(_0xaaf5('0x0'));var _=require(_0xaaf5('0x1'));var squel=require(_0xaaf5('0x2'));var Redis=require(_0xaaf5('0x3'));var qs=require(_0xaaf5('0x4'));var logger=require(_0xaaf5('0x5'))(_0xaaf5('0x6'));var config=require(_0xaaf5('0x7'));var db=require('../../mysqldb')['db'];config[_0xaaf5('0x8')]=_[_0xaaf5('0x9')](config[_0xaaf5('0x8')],{'host':_0xaaf5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaaf5('0xb'))[_0xaaf5('0xc')](socket);function respondWithStatusCode(_0x408180,_0x3da0ae){_0x3da0ae=_0x3da0ae||0xcc;return function(_0x1fcce1){if(_0x1fcce1){return _0x408180['sendStatus'](_0x3da0ae);}return _0x408180[_0xaaf5('0xd')](_0x3da0ae)['end']();};}function respondWithResult(_0x5a3ce0,_0x6b83d3){_0x6b83d3=_0x6b83d3||0xc8;return function(_0x46e850){if(_0x46e850){return _0x5a3ce0['status'](_0x6b83d3)[_0xaaf5('0xe')](_0x46e850);}};}function respondWithFilteredResult(_0x3ce357,_0x13dfe4){return function(_0x2cdc4b){if(_0x2cdc4b){var _0x5a35bc=typeof _0x13dfe4[_0xaaf5('0xf')]===_0xaaf5('0x10')&&typeof _0x13dfe4['limit']===_0xaaf5('0x10');var _0x5d1e11=_0x2cdc4b[_0xaaf5('0x11')];var _0xe50810=_0x5a35bc?0x0:_0x13dfe4[_0xaaf5('0xf')];var _0x304060=_0x5a35bc?_0x2cdc4b['count']:_0x13dfe4[_0xaaf5('0xf')]+_0x13dfe4[_0xaaf5('0x12')];var _0x2e8482;if(_0x304060>=_0x5d1e11){_0x304060=_0x5d1e11;_0x2e8482=0xc8;}else{_0x2e8482=0xce;}_0x3ce357[_0xaaf5('0xd')](_0x2e8482);return _0x3ce357[_0xaaf5('0x13')](_0xaaf5('0x14'),_0xe50810+'-'+_0x304060+'/'+_0x5d1e11)[_0xaaf5('0xe')](_0x2cdc4b);}return null;};}function saveUpdates(_0x4b1693){return function(_0x2045df){if(_0x2045df){return _0x2045df[_0xaaf5('0x15')](_0x4b1693)[_0xaaf5('0x16')](function(_0x3a036d){return _0x3a036d;});}return null;};}function removeEntity(_0x318d47){return function(_0x403bb2){if(_0x403bb2){return _0x403bb2[_0xaaf5('0x17')]()['then'](function(){var _0x482c45=_0x403bb2[_0xaaf5('0x18')]({'plain':!![]});var _0x45efc2=_0xaaf5('0x19');return db[_0xaaf5('0x1a')][_0xaaf5('0x17')]({'where':{'type':_0x45efc2,'resourceId':_0x482c45['id']}})[_0xaaf5('0x16')](function(){return _0x403bb2;});})['then'](function(){_0x318d47['status'](0xcc)[_0xaaf5('0x1b')]();});}};}function handleEntityNotFound(_0x2f74aa){return function(_0x341cfe){if(!_0x341cfe){_0x2f74aa[_0xaaf5('0x1c')](0x194);}return _0x341cfe;};}function handleError(_0x3020b0,_0x2a390c){_0x2a390c=_0x2a390c||0x1f4;return function(_0xe178ae){logger[_0xaaf5('0x1d')](_0xe178ae[_0xaaf5('0x1e')]);if(_0xe178ae[_0xaaf5('0x1f')]){delete _0xe178ae[_0xaaf5('0x1f')];}_0x3020b0[_0xaaf5('0xd')](_0x2a390c)[_0xaaf5('0x20')](_0xe178ae);};}exports[_0xaaf5('0x21')]=function(_0x5a1fea,_0x557bf8){var _0x15a6e4={};var _0x569c78={'count':0x0,'rows':[]};var _0x44aef2=_['map'](db['FaxQueue'][_0xaaf5('0x22')],function(_0x26f14a){return{'name':_0x26f14a[_0xaaf5('0x23')],'type':_0x26f14a[_0xaaf5('0x24')][_0xaaf5('0x25')]};});_0x15a6e4=qs[_0xaaf5('0x26')](_0x44aef2,_0x5a1fea);var _0x490bb6={'where':_0x15a6e4[_0xaaf5('0x27')]};return db['FaxQueue']['count'](_0x490bb6)[_0xaaf5('0x16')](function(_0x461fd9){_0x569c78[_0xaaf5('0x11')]=_0x461fd9;_0x15a6e4[_0xaaf5('0x28')]=qs[_0xaaf5('0x28')](_0x5a1fea[_0xaaf5('0x29')]);return db['FaxQueue'][_0xaaf5('0x2a')](_0x15a6e4);})['then'](function(_0x39539f){_0x569c78[_0xaaf5('0x2b')]=_0x39539f;return _0x569c78;})['then'](respondWithFilteredResult(_0x557bf8,_0x15a6e4))[_0xaaf5('0x2c')](handleError(_0x557bf8,null));};exports['show']=function(_0x161cd7,_0x380cbb){var _0x591652={'raw':!![],'where':{'id':_0x161cd7['params']['id']}},_0x3a94c0={};_0x3a94c0[_0xaaf5('0x2d')]=_[_0xaaf5('0x2e')](db['FaxQueue'][_0xaaf5('0x22')]);_0x3a94c0['query']=_[_0xaaf5('0x2e')](_0x161cd7[_0xaaf5('0x29')]);_0x3a94c0['filters']=_[_0xaaf5('0x2f')](_0x3a94c0['model'],_0x3a94c0[_0xaaf5('0x29')]);_0x591652[_0xaaf5('0x30')]=_[_0xaaf5('0x2f')](_0x3a94c0[_0xaaf5('0x2d')],qs[_0xaaf5('0x31')](_0x161cd7[_0xaaf5('0x29')][_0xaaf5('0x31')]));_0x591652['attributes']=_0x591652[_0xaaf5('0x30')][_0xaaf5('0x32')]?_0x591652['attributes']:_0x3a94c0[_0xaaf5('0x2d')];if(_0x161cd7[_0xaaf5('0x29')][_0xaaf5('0x33')]){_0x591652[_0xaaf5('0x28')]=[{'all':!![]}];}_0x591652=_['merge']({},_0x591652,_0x161cd7[_0xaaf5('0x34')]);return db[_0xaaf5('0x35')][_0xaaf5('0x36')](_0x591652)[_0xaaf5('0x16')](handleEntityNotFound(_0x380cbb,null))[_0xaaf5('0x16')](respondWithResult(_0x380cbb,null))[_0xaaf5('0x2c')](handleError(_0x380cbb,null));};exports['create']=function(_0x2bd03f,_0x28ad39){return db['FaxQueue'][_0xaaf5('0x37')](_0x2bd03f[_0xaaf5('0x38')],{})[_0xaaf5('0x16')](function(_0x3cc83c){var _0x583a3d=_0x2bd03f[_0xaaf5('0x39')]['get']({'plain':!![]});if(!_0x583a3d)throw new Error(_0xaaf5('0x3a'));if(_0x583a3d[_0xaaf5('0x3b')]===_0xaaf5('0x39')){var _0x385211=_0x3cc83c[_0xaaf5('0x18')]({'plain':!![]});var _0x35e3ec=_0xaaf5('0x19');return db[_0xaaf5('0x3c')][_0xaaf5('0x36')]({'where':{'name':_0x35e3ec,'userProfileId':_0x583a3d[_0xaaf5('0x3d')]},'raw':!![]})[_0xaaf5('0x16')](function(_0x294bf9){if(_0x294bf9&&_0x294bf9['autoAssociation']===0x0){return db[_0xaaf5('0x1a')][_0xaaf5('0x37')]({'name':_0x385211[_0xaaf5('0x1f')],'resourceId':_0x385211['id'],'type':_0x294bf9[_0xaaf5('0x1f')],'sectionId':_0x294bf9['id']},{})[_0xaaf5('0x16')](function(){return _0x3cc83c;});}else{return _0x3cc83c;}})[_0xaaf5('0x2c')](function(_0x3401fa){logger['error'](_0xaaf5('0x3e'),_0x3401fa);throw _0x3401fa;});}return _0x3cc83c;})[_0xaaf5('0x16')](respondWithResult(_0x28ad39,0xc9))[_0xaaf5('0x2c')](handleError(_0x28ad39,null));};exports[_0xaaf5('0x15')]=function(_0xbcd7f1,_0x111cda){if(_0xbcd7f1[_0xaaf5('0x38')]['id']){delete _0xbcd7f1[_0xaaf5('0x38')]['id'];}return db[_0xaaf5('0x35')][_0xaaf5('0x36')]({'where':{'id':_0xbcd7f1[_0xaaf5('0x3f')]['id']}})[_0xaaf5('0x16')](handleEntityNotFound(_0x111cda,null))['then'](saveUpdates(_0xbcd7f1[_0xaaf5('0x38')],null))[_0xaaf5('0x16')](respondWithResult(_0x111cda,null))[_0xaaf5('0x2c')](handleError(_0x111cda,null));};exports[_0xaaf5('0x17')]=function(_0x3f6535,_0x1ee90a){return db[_0xaaf5('0x35')][_0xaaf5('0x36')]({'where':{'id':_0x3f6535['params']['id']}})[_0xaaf5('0x16')](handleEntityNotFound(_0x1ee90a,null))['then'](removeEntity(_0x1ee90a,null))['catch'](handleError(_0x1ee90a,null));};exports[_0xaaf5('0x40')]=function(_0x4f4285,_0x43e41b){return db[_0xaaf5('0x35')]['describe']()[_0xaaf5('0x16')](respondWithResult(_0x43e41b,null))['catch'](handleError(_0x43e41b,null));};exports['getMembers']=function(_0x1503db,_0x35d7da){var _0x35b996={'raw':!![],'where':{}},_0x4df233={},_0xcf1bc;return db[_0xaaf5('0x35')][_0xaaf5('0x41')]({'where':{'id':_0x1503db[_0xaaf5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x35d7da,null))[_0xaaf5('0x16')](function(_0x5113ab){if(_0x5113ab){_0xcf1bc=_0x5113ab['get']({'plain':!![]});_0x4df233[_0xaaf5('0x2d')]=_['keys'](db[_0xaaf5('0x42')][_0xaaf5('0x22')]);_0x4df233[_0xaaf5('0x29')]=_[_0xaaf5('0x2e')](_0x1503db[_0xaaf5('0x29')]);_0x4df233[_0xaaf5('0x43')]=_['intersection'](_0x4df233[_0xaaf5('0x2d')],_0x4df233[_0xaaf5('0x29')]);_0x35b996['attributes']=_[_0xaaf5('0x2f')](_0x4df233[_0xaaf5('0x2d')],qs[_0xaaf5('0x31')](_0x1503db[_0xaaf5('0x29')][_0xaaf5('0x31')]));_0x35b996[_0xaaf5('0x30')]=_0x35b996[_0xaaf5('0x30')][_0xaaf5('0x32')]?_0x35b996['attributes']:_0x4df233[_0xaaf5('0x2d')];if(!_0x1503db[_0xaaf5('0x29')][_0xaaf5('0x44')](_0xaaf5('0x45'))){_0x35b996[_0xaaf5('0x12')]=qs[_0xaaf5('0x12')](_0x1503db['query'][_0xaaf5('0x12')]);_0x35b996[_0xaaf5('0xf')]=qs[_0xaaf5('0xf')](_0x1503db[_0xaaf5('0x29')][_0xaaf5('0xf')]);}_0x35b996[_0xaaf5('0x46')]=qs[_0xaaf5('0x47')](_0x1503db[_0xaaf5('0x29')][_0xaaf5('0x47')]);_0x35b996[_0xaaf5('0x27')]=qs['filters'](_[_0xaaf5('0x48')](_0x1503db[_0xaaf5('0x29')],_0x4df233['filters']));_0x35b996['where'][_0xaaf5('0x49')]=_0x5113ab['id'];if(_0x1503db[_0xaaf5('0x29')][_0xaaf5('0x4a')]){_0x35b996[_0xaaf5('0x27')]=_['merge'](_0x35b996[_0xaaf5('0x27')],{'$or':_[_0xaaf5('0x4b')](_0x35b996['attributes'],function(_0x2ce79c){var _0x3ec502={};_0x3ec502[_0x2ce79c]={'$like':'%'+_0x1503db[_0xaaf5('0x29')][_0xaaf5('0x4a')]+'%'};return _0x3ec502;})});}_0x35b996=_[_0xaaf5('0x4c')]({},_0x35b996,_0x1503db[_0xaaf5('0x34')]);return db[_0xaaf5('0x42')][_0xaaf5('0x2a')](_0x35b996);}})[_0xaaf5('0x16')](function(_0x2fa0bc){if(_0x2fa0bc){return db[_0xaaf5('0x4d')][_0xaaf5('0x4e')]({'where':{'id':_[_0xaaf5('0x4b')](_0x2fa0bc,_0xaaf5('0x4f')),'role':_0xaaf5('0x50')},'attributes':['id','name','faxPause',_0xaaf5('0x51'),_0xaaf5('0x52')]});}})[_0xaaf5('0x16')](function(_0x4d6714){if(_0x4d6714){return{'count':_0x4d6714[_0xaaf5('0x11')],'rows':_['map'](_0x4d6714[_0xaaf5('0x2b')],function(_0x246aca){return{'membername':_0x246aca[_0xaaf5('0x1f')],'UserId':_0x246aca['id'],'queue_name':_0xcf1bc[_0xaaf5('0x1f')],'FaxQueueId':_0xcf1bc['id'],'interface':util['format'](_0xaaf5('0x53'),_0xaaf5('0x54'),_0x246aca[_0xaaf5('0x1f')]),'penalty':0x0,'paused':_0x246aca[_0xaaf5('0x55')],'createdAt':_0x246aca[_0xaaf5('0x52')],'updatedAt':_0x246aca[_0xaaf5('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x35d7da,_0x35b996))[_0xaaf5('0x2c')](handleError(_0x35d7da,null));};exports[_0xaaf5('0x56')]=function(_0xd0b1fa,_0x36b20d){var _0x857ae={};var _0x3bba18={};var _0x23d386;var _0x4185fa;return db[_0xaaf5('0x35')][_0xaaf5('0x41')]({'where':{'id':_0xd0b1fa[_0xaaf5('0x3f')]['id']}})[_0xaaf5('0x16')](handleEntityNotFound(_0x36b20d,null))[_0xaaf5('0x16')](function(_0x588685){if(_0x588685){_0x23d386=_0x588685;_0x3bba18[_0xaaf5('0x2d')]=_[_0xaaf5('0x2e')](db[_0xaaf5('0x57')][_0xaaf5('0x22')]);_0x3bba18[_0xaaf5('0x29')]=_[_0xaaf5('0x2e')](_0xd0b1fa[_0xaaf5('0x29')]);_0x3bba18[_0xaaf5('0x43')]=_[_0xaaf5('0x2f')](_0x3bba18['model'],_0x3bba18[_0xaaf5('0x29')]);_0x857ae['attributes']=_['intersection'](_0x3bba18[_0xaaf5('0x2d')],qs[_0xaaf5('0x31')](_0xd0b1fa[_0xaaf5('0x29')]['fields']));_0x857ae['attributes']=_0x857ae[_0xaaf5('0x30')]['length']?_0x857ae['attributes']:_0x3bba18[_0xaaf5('0x2d')];_0x857ae['order']=qs[_0xaaf5('0x47')](_0xd0b1fa[_0xaaf5('0x29')]['sort']);_0x857ae[_0xaaf5('0x27')]=qs['filters'](_[_0xaaf5('0x48')](_0xd0b1fa['query'],_0x3bba18[_0xaaf5('0x43')]));if(_0xd0b1fa['query'][_0xaaf5('0x4a')]){_0x857ae[_0xaaf5('0x27')]=_[_0xaaf5('0x4c')](_0x857ae[_0xaaf5('0x27')],{'$or':_['map'](_0x857ae[_0xaaf5('0x30')],function(_0x26f404){var _0x4639c2={};_0x4639c2[_0x26f404]={'$like':'%'+_0xd0b1fa[_0xaaf5('0x29')][_0xaaf5('0x4a')]+'%'};return _0x4639c2;})});}_0x857ae=_[_0xaaf5('0x4c')]({},_0x857ae,_0xd0b1fa[_0xaaf5('0x34')]);return _0x23d386[_0xaaf5('0x56')](_0x857ae);}})[_0xaaf5('0x16')](function(_0x215942){if(_0x215942){_0x4185fa=_0x215942[_0xaaf5('0x32')];if(!_0xd0b1fa[_0xaaf5('0x29')][_0xaaf5('0x44')]('nolimit')){_0x857ae[_0xaaf5('0x12')]=qs['limit'](_0xd0b1fa['query'][_0xaaf5('0x12')]);_0x857ae[_0xaaf5('0xf')]=qs['offset'](_0xd0b1fa['query']['offset']);}return _0x23d386[_0xaaf5('0x56')](_0x857ae);}})['then'](function(_0x5f2b9f){if(_0x5f2b9f){return _0x5f2b9f?{'count':_0x4185fa,'rows':_0x5f2b9f}:null;}})[_0xaaf5('0x16')](respondWithResult(_0x36b20d,null))['catch'](handleError(_0x36b20d,null));};exports[_0xaaf5('0x58')]=function(_0x1aaaea,_0x4217f9){var _0x17adb9=_0x1aaaea['body'][_0xaaf5('0x59')];return db[_0xaaf5('0x57')][_0xaaf5('0x2a')]({'where':{'id':_0x17adb9},'attributes':['id'],'include':[{'model':db[_0xaaf5('0x4d')],'as':_0xaaf5('0x5a'),'attributes':['id',_0xaaf5('0x1f'),_0xaaf5('0x5b'),'voicePause',_0xaaf5('0x5c')],'raw':!![]}]})['then'](function(_0x57aa9c){if(_0x57aa9c){var _0x2b6758=_[_0xaaf5('0x5d')](_0x57aa9c,function(_0x326a93){var _0x29fafa=_0x326a93[_0xaaf5('0x18')]({'plain':!![]});return _0x29fafa['Agents'];});return db[_0xaaf5('0x35')][_0xaaf5('0x36')]({'where':{'id':_0x1aaaea[_0xaaf5('0x3f')]['id']}})[_0xaaf5('0x16')](function(_0x105bb8){return db[_0xaaf5('0x5e')][_0xaaf5('0x5f')](function(_0x191784){return _0x105bb8[_0xaaf5('0x58')](_0x17adb9,{'transaction':_0x191784})['then'](function(){return BPromise[_0xaaf5('0x60')](_0x2b6758,function(_0x201ac0){return db[_0xaaf5('0x42')][_0xaaf5('0x61')]({'where':{'UserId':_0x201ac0['id'],'FaxQueueId':_0x1aaaea[_0xaaf5('0x3f')]['id']},'transaction':_0x191784});});})['then'](function(){_0x2b6758[_0xaaf5('0x62')](function(_0x4d1317){socket['emit']('userFaxQueue:save',{'UserId':_0x4d1317['id'],'FaxQueueId':_0x105bb8['id']});});});});});}})[_0xaaf5('0x16')](respondWithStatusCode(_0x4217f9,null))[_0xaaf5('0x2c')](handleError(_0x4217f9,null));};exports[_0xaaf5('0x63')]=function(_0xd108a1,_0xbfbeeb){return db[_0xaaf5('0x57')]['findAll']({'where':{'id':_0xd108a1['query'][_0xaaf5('0x59')]},'attributes':['id'],'include':[{'model':db[_0xaaf5('0x4d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xaaf5('0x16')](handleEntityNotFound(_0xbfbeeb,null))[_0xaaf5('0x16')](function(_0x2077e6){var _0x46d2f0=_[_0xaaf5('0x4b')](_0x2077e6,'id');var _0x173de0=[];var _0x1bdef3=[];var _0x3f4e0d=squel['select']();_0x3f4e0d['field'](_0xaaf5('0x64'))[_0xaaf5('0x65')](_0xaaf5('0x66'),'tq')[_0xaaf5('0x67')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xaaf5('0x27')](_0xaaf5('0x68'),_0xd108a1[_0xaaf5('0x3f')]['id']);for(var _0x5b16af=0x0;_0x5b16af<_0x2077e6[_0xaaf5('0x32')];_0x5b16af+=0x1){let _0x3cfc75=_0x2077e6[_0x5b16af];for(var _0x590e0c=0x0;_0x590e0c<_0x3cfc75[_0xaaf5('0x5a')][_0xaaf5('0x32')];_0x590e0c+=0x1){let _0xeccc04=_0x3cfc75['Agents'][_0x590e0c];var _0x3c1875=_0x3f4e0d[_0xaaf5('0x69')]();_0x3c1875[_0xaaf5('0x27')](_0xaaf5('0x6a'),_0xeccc04['id']);_0x1bdef3[_0xaaf5('0x6b')](db['sequelize']['query'](_0x3c1875[_0xaaf5('0x6c')](),{'type':db[_0xaaf5('0x5e')][_0xaaf5('0x6d')][_0xaaf5('0x6e')]})[_0xaaf5('0x16')](function(_0x36f638){if(_0x36f638[_0xaaf5('0x32')]===0x1){return _0xeccc04['id'];}else{var _0x1253ca=_[_0xaaf5('0x6f')](_[_0xaaf5('0x4b')](_0x36f638,'TeamId'),function(_0x42af5e){return _['includes'](_0x46d2f0,_0x42af5e);});if(_0x1253ca){return _0xeccc04['id'];}}}));}}return BPromise[_0xaaf5('0x70')](_0x1bdef3)[_0xaaf5('0x16')](function(_0xe87a2a){_0x173de0=_(_0x173de0)[_0xaaf5('0x71')](_0xe87a2a)[_0xaaf5('0x72')]()[_0xaaf5('0x73')]();return db['FaxQueue'][_0xaaf5('0x36')]({'where':{'id':_0xd108a1[_0xaaf5('0x3f')]['id']}})[_0xaaf5('0x16')](function(_0x5a009e){return db[_0xaaf5('0x5e')][_0xaaf5('0x5f')](function(_0x3afba5){return _0x5a009e['removeTeams'](_0xd108a1['query'][_0xaaf5('0x59')],{'transaction':_0x3afba5})[_0xaaf5('0x16')](function(){if(!_[_0xaaf5('0x74')](_0x173de0)){return _0x5a009e[_0xaaf5('0x75')](_0x173de0,{'transaction':_0x3afba5});}})[_0xaaf5('0x16')](function(){_0x173de0[_0xaaf5('0x62')](function(_0x4027ec){socket[_0xaaf5('0x76')](_0xaaf5('0x77'),{'UserId':_0x4027ec,'FaxQueueId':_0x5a009e['id']});});});});});});})[_0xaaf5('0x16')](respondWithStatusCode(_0xbfbeeb,null))[_0xaaf5('0x2c')](handleError(_0xbfbeeb,null));};exports[_0xaaf5('0x78')]=function(_0x144d6c,_0x28c1c2){return db[_0xaaf5('0x35')][_0xaaf5('0x36')]({'where':{'id':_0x144d6c['params']['id']}})[_0xaaf5('0x16')](handleEntityNotFound(_0x28c1c2,null))[_0xaaf5('0x16')](function(_0x1e2b65){if(_0x1e2b65){return _0x1e2b65[_0xaaf5('0x78')](_0x144d6c[_0xaaf5('0x38')][_0xaaf5('0x59')],_[_0xaaf5('0x79')](_0x144d6c['body'],['ids','id'])||{})['spread'](function(_0x5dc7d5){for(var _0x37319e=0x0;_0x37319e<_0x144d6c[_0xaaf5('0x38')]['ids'][_0xaaf5('0x32')];_0x37319e+=0x1){socket[_0xaaf5('0x76')](_0xaaf5('0x7a'),{'UserId':Number(_0x144d6c[_0xaaf5('0x38')][_0xaaf5('0x59')][_0x37319e]),'FaxQueueId':Number(_0x144d6c[_0xaaf5('0x3f')]['id'])});}return _0x5dc7d5;});}})[_0xaaf5('0x16')](respondWithResult(_0x28c1c2,null))[_0xaaf5('0x2c')](handleError(_0x28c1c2,null));};exports[_0xaaf5('0x75')]=function(_0xbfcdfa,_0x1f08df){return db[_0xaaf5('0x35')][_0xaaf5('0x36')]({'where':{'id':_0xbfcdfa[_0xaaf5('0x3f')]['id']}})[_0xaaf5('0x16')](handleEntityNotFound(_0x1f08df,null))[_0xaaf5('0x16')](function(_0x2dc09e){if(_0x2dc09e){return _0x2dc09e[_0xaaf5('0x75')](_0xbfcdfa[_0xaaf5('0x29')]['ids'])[_0xaaf5('0x16')](function(){if(_[_0xaaf5('0x7b')](_0xbfcdfa[_0xaaf5('0x29')][_0xaaf5('0x59')])){for(var _0x473d88=0x0;_0x473d88<_0xbfcdfa['query'][_0xaaf5('0x59')][_0xaaf5('0x32')];_0x473d88+=0x1){socket['emit'](_0xaaf5('0x77'),{'UserId':Number(_0xbfcdfa['query']['ids'][_0x473d88]),'FaxQueueId':Number(_0xbfcdfa[_0xaaf5('0x3f')]['id'])});}}else{socket[_0xaaf5('0x76')](_0xaaf5('0x77'),{'UserId':Number(_0xbfcdfa[_0xaaf5('0x29')][_0xaaf5('0x59')]),'FaxQueueId':Number(_0xbfcdfa[_0xaaf5('0x3f')]['id'])});}});}})[_0xaaf5('0x16')](respondWithStatusCode(_0x1f08df,null))[_0xaaf5('0x2c')](handleError(_0x1f08df,null));};exports[_0xaaf5('0x7c')]=function(_0x465153,_0x5074d8){var _0xe2243e={};var _0x20a4f2={};var _0x3dda35;var _0x33525c;return db['FaxQueue'][_0xaaf5('0x41')]({'where':{'id':_0x465153[_0xaaf5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5074d8,null))['then'](function(_0x21769f){if(_0x21769f){_0x3dda35=_0x21769f;_0x20a4f2['model']=_[_0xaaf5('0x2e')](db[_0xaaf5('0x4d')][_0xaaf5('0x22')]);_0x20a4f2[_0xaaf5('0x29')]=_[_0xaaf5('0x2e')](_0x465153[_0xaaf5('0x29')]);_0x20a4f2[_0xaaf5('0x43')]=_[_0xaaf5('0x2f')](_0x20a4f2['model'],_0x20a4f2[_0xaaf5('0x29')]);_0xe2243e[_0xaaf5('0x30')]=_[_0xaaf5('0x2f')](_0x20a4f2[_0xaaf5('0x2d')],qs['fields'](_0x465153[_0xaaf5('0x29')][_0xaaf5('0x31')]));_0xe2243e[_0xaaf5('0x30')]=_0xe2243e[_0xaaf5('0x30')]['length']?_0xe2243e['attributes']:_0x20a4f2[_0xaaf5('0x2d')];_0xe2243e['order']=qs[_0xaaf5('0x47')](_0x465153[_0xaaf5('0x29')][_0xaaf5('0x47')]);_0xe2243e['where']=qs[_0xaaf5('0x43')](_[_0xaaf5('0x48')](_0x465153[_0xaaf5('0x29')],_0x20a4f2[_0xaaf5('0x43')]));if(_0x465153[_0xaaf5('0x29')][_0xaaf5('0x4a')]){_0xe2243e['where']=_['merge'](_0xe2243e[_0xaaf5('0x27')],{'$or':_['map'](_0xe2243e[_0xaaf5('0x30')],function(_0x17385a){var _0x105528={};_0x105528[_0x17385a]={'$like':'%'+_0x465153[_0xaaf5('0x29')][_0xaaf5('0x4a')]+'%'};return _0x105528;})});}_0xe2243e=_[_0xaaf5('0x4c')]({},_0xe2243e,_0x465153[_0xaaf5('0x34')]);return _0x3dda35['getAgents'](_0xe2243e);}})[_0xaaf5('0x16')](function(_0x15ad31){if(_0x15ad31){_0x33525c=_0x15ad31[_0xaaf5('0x32')];if(!_0x465153['query'][_0xaaf5('0x44')](_0xaaf5('0x45'))){_0xe2243e[_0xaaf5('0x12')]=qs[_0xaaf5('0x12')](_0x465153['query'][_0xaaf5('0x12')]);_0xe2243e[_0xaaf5('0xf')]=qs['offset'](_0x465153[_0xaaf5('0x29')][_0xaaf5('0xf')]);}return _0x3dda35[_0xaaf5('0x7c')](_0xe2243e);}})['then'](function(_0x19c198){if(_0x19c198){return _0x19c198?{'count':_0x33525c,'rows':_0x19c198}:null;}})[_0xaaf5('0x16')](respondWithResult(_0x5074d8,null))[_0xaaf5('0x2c')](handleError(_0x5074d8,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 2a9cc16..d5cdf09 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 _0x9789=['update','remove','emit','hasOwnProperty','exports','FaxQueue','setMaxListeners','save'];(function(_0x4e36a9,_0x3aff2f){var _0xf72168=function(_0x3193b7){while(--_0x3193b7){_0x4e36a9['push'](_0x4e36a9['shift']());}};_0xf72168(++_0x3aff2f);}(_0x9789,0xad));var _0x9978=function(_0x3bad26,_0x1cf013){_0x3bad26=_0x3bad26-0x0;var _0x42e1ff=_0x9789[_0x3bad26];return _0x42e1ff;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x9978('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x9978('0x1')](0x0);var events={'afterCreate':_0x9978('0x2'),'afterUpdate':_0x9978('0x3'),'afterDestroy':_0x9978('0x4')};function emitEvent(_0xa65a){return function(_0x5829ff,_0x5db127,_0x180ed4){FaxQueueEvents['emit'](_0xa65a+':'+_0x5829ff['id'],_0x5829ff);FaxQueueEvents[_0x9978('0x5')](_0xa65a,_0x5829ff);_0x180ed4(null);};}for(var e in events){if(events[_0x9978('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x9978('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x18f5=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue'];(function(_0x3a6113,_0x157537){var _0x5d1398=function(_0x5344be){while(--_0x5344be){_0x3a6113['push'](_0x3a6113['shift']());}};_0x5d1398(++_0x157537);}(_0x18f5,0x1d5));var _0x518f=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x18f5[_0x138adb];return _0x1b27f2;};'use strict';var EventEmitter=require(_0x518f('0x0'));var FaxQueue=require(_0x518f('0x1'))['db'][_0x518f('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x518f('0x3'),'afterUpdate':'update','afterDestroy':_0x518f('0x4')};function emitEvent(_0x580c7c){return function(_0x9bad7f,_0x3a1f97,_0x22f8a7){FaxQueueEvents[_0x518f('0x5')](_0x580c7c+':'+_0x9bad7f['id'],_0x9bad7f);FaxQueueEvents[_0x518f('0x5')](_0x580c7c,_0x9bad7f);_0x22f8a7(null);};}for(var e in events){if(events[_0x518f('0x6')](e)){var event=events[e];FaxQueue[_0x518f('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index ca03022..c53d38f 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 _0xecc2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','fax_queues','lodash','util'];(function(_0x11deef,_0x34bbdb){var _0xe9ba85=function(_0x591377){while(--_0x591377){_0x11deef['push'](_0x11deef['shift']());}};_0xe9ba85(++_0x34bbdb);}(_0xecc2,0x177));var _0x2ecc=function(_0x5b054f,_0x3438c8){_0x5b054f=_0x5b054f-0x0;var _0x5d3bcb=_0xecc2[_0x5b054f];return _0x5d3bcb;};'use strict';var _=require(_0x2ecc('0x0'));var util=require(_0x2ecc('0x1'));var logger=require(_0x2ecc('0x2'))(_0x2ecc('0x3'));var moment=require(_0x2ecc('0x4'));var BPromise=require(_0x2ecc('0x5'));var rp=require(_0x2ecc('0x6'));var fs=require('fs');var path=require(_0x2ecc('0x7'));var rimraf=require(_0x2ecc('0x8'));var config=require(_0x2ecc('0x9'));var attributes=require(_0x2ecc('0xa'));module[_0x2ecc('0xb')]=function(_0x544d2d,_0x140cc5){return _0x544d2d['define']('FaxQueue',attributes,{'tableName':_0x2ecc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf126=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue','lodash'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xf126,0x170));var _0x6f12=function(_0x515e9f,_0xff9586){_0x515e9f=_0x515e9f-0x0;var _0x19cbf0=_0xf126[_0x515e9f];return _0x19cbf0;};'use strict';var _=require(_0x6f12('0x0'));var util=require('util');var logger=require(_0x6f12('0x1'))(_0x6f12('0x2'));var moment=require('moment');var BPromise=require(_0x6f12('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f12('0x4'));var rimraf=require(_0x6f12('0x5'));var config=require(_0x6f12('0x6'));var attributes=require(_0x6f12('0x7'));module['exports']=function(_0x2f27aa,_0x57f4c4){return _0x2f27aa['define'](_0x6f12('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index a0baaa4..af81ae1 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 _0x02e0=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','model','map','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1aacaf,_0x29446c){var _0x247041=function(_0x40d603){while(--_0x40d603){_0x1aacaf['push'](_0x1aacaf['shift']());}};_0x247041(++_0x29446c);}(_0x02e0,0x1ef));var _0x002e=function(_0x26044e,_0x3064b6){_0x26044e=_0x26044e-0x0;var _0x70d079=_0x02e0[_0x26044e];return _0x70d079;};'use strict';var _=require(_0x002e('0x0'));var util=require(_0x002e('0x1'));var moment=require(_0x002e('0x2'));var BPromise=require(_0x002e('0x3'));var rs=require(_0x002e('0x4'));var fs=require('fs');var Redis=require(_0x002e('0x5'));var db=require(_0x002e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x002e('0x7'))(_0x002e('0x8'));var config=require(_0x002e('0x9'));var jayson=require(_0x002e('0xa'));var client=jayson['client'][_0x002e('0xb')]({'port':0x232a});config[_0x002e('0xc')]=_[_0x002e('0xd')](config[_0x002e('0xc')],{'host':_0x002e('0xe'),'port':0x18eb});var socket=require(_0x002e('0xf'))(new Redis(config[_0x002e('0xc')]));require(_0x002e('0x10'))[_0x002e('0x11')](socket);function respondWithRpcPromise(_0x2eae15,_0x1a32aa,_0x48541f){return new BPromise(function(_0x4d0ebe,_0x4a9f4f){return client[_0x002e('0x12')](_0x2eae15,_0x48541f)[_0x002e('0x13')](function(_0x380494){logger[_0x002e('0x14')](_0x002e('0x15'),_0x1a32aa,_0x002e('0x16'));logger[_0x002e('0x17')](_0x002e('0x18'),_0x1a32aa,'request\x20sent',JSON[_0x002e('0x19')](_0x380494));if(_0x380494['error']){if(_0x380494[_0x002e('0x1a')]['code']===0x1f4){logger[_0x002e('0x1a')]('FaxQueue,\x20%s,\x20%s',_0x1a32aa,_0x380494[_0x002e('0x1a')][_0x002e('0x1b')]);return _0x4a9f4f(_0x380494[_0x002e('0x1a')][_0x002e('0x1b')]);}logger[_0x002e('0x1a')](_0x002e('0x15'),_0x1a32aa,_0x380494[_0x002e('0x1a')][_0x002e('0x1b')]);return _0x4d0ebe(_0x380494[_0x002e('0x1a')]['message']);}else{logger[_0x002e('0x14')](_0x002e('0x15'),_0x1a32aa,'request\x20sent');_0x4d0ebe(_0x380494[_0x002e('0x1c')]['message']);}})[_0x002e('0x1d')](function(_0x28f2c6){logger['error'](_0x002e('0x15'),_0x1a32aa,_0x28f2c6);_0x4a9f4f(_0x28f2c6);});});}exports[_0x002e('0x1e')]=function(_0x30c3e0){var _0x4ef5a2=this;return new Promise(function(_0x35d2fd,_0x41b0e9){return db[_0x002e('0x1f')][_0x002e('0x20')]({'raw':_0x30c3e0[_0x002e('0x21')]?_0x30c3e0['options']['raw']===undefined?!![]:![]:!![],'where':_0x30c3e0['options']?_0x30c3e0['options'][_0x002e('0x22')]||null:null,'attributes':_0x30c3e0[_0x002e('0x21')]?_0x30c3e0[_0x002e('0x21')][_0x002e('0x23')]||null:null,'limit':_0x30c3e0[_0x002e('0x21')]?_0x30c3e0['options'][_0x002e('0x24')]||null:null,'include':_0x30c3e0[_0x002e('0x21')]?_0x30c3e0['options'][_0x002e('0x25')]?_['map'](_0x30c3e0[_0x002e('0x21')][_0x002e('0x25')],function(_0x573c75){return{'model':db[_0x573c75[_0x002e('0x26')]],'as':_0x573c75['as'],'attributes':_0x573c75['attributes'],'include':_0x573c75[_0x002e('0x25')]?_[_0x002e('0x27')](_0x573c75[_0x002e('0x25')],function(_0x44a399){return{'model':db[_0x44a399[_0x002e('0x26')]],'as':_0x44a399['as'],'attributes':_0x44a399['attributes'],'include':_0x44a399[_0x002e('0x25')]?_[_0x002e('0x27')](_0x44a399[_0x002e('0x25')],function(_0x3b2342){return{'model':db[_0x3b2342['model']],'as':_0x3b2342['as'],'attributes':_0x3b2342[_0x002e('0x23')]};}):[]};}):[]};}):[]:[]})[_0x002e('0x13')](function(_0x34217f){logger[_0x002e('0x14')]('GetFaxQueue',_0x30c3e0);logger[_0x002e('0x17')](_0x002e('0x1e'),_0x30c3e0,JSON[_0x002e('0x19')](_0x34217f));_0x35d2fd(_0x34217f);})[_0x002e('0x1d')](function(_0x29ab07){logger[_0x002e('0x1a')](_0x002e('0x1e'),_0x29ab07[_0x002e('0x1b')],_0x30c3e0);_0x41b0e9(_0x4ef5a2[_0x002e('0x1a')](0x1f4,_0x29ab07['message']));});});};exports['ShowFaxQueue']=function(_0x5d0d3b){var _0xe9dd38=this;return new Promise(function(_0x232dce,_0x5a3b9f){return db[_0x002e('0x1f')][_0x002e('0x28')]({'raw':_0x5d0d3b[_0x002e('0x21')]?_0x5d0d3b[_0x002e('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x5d0d3b[_0x002e('0x21')]?_0x5d0d3b[_0x002e('0x21')][_0x002e('0x22')]||null:null,'attributes':_0x5d0d3b['options']?_0x5d0d3b[_0x002e('0x21')][_0x002e('0x23')]||null:null,'include':_0x5d0d3b['options']?_0x5d0d3b[_0x002e('0x21')][_0x002e('0x25')]?_[_0x002e('0x27')](_0x5d0d3b['options'][_0x002e('0x25')],function(_0xc3e1dc){return{'model':db[_0xc3e1dc[_0x002e('0x26')]],'as':_0xc3e1dc['as'],'attributes':_0xc3e1dc[_0x002e('0x23')],'include':_0xc3e1dc[_0x002e('0x25')]?_['map'](_0xc3e1dc['include'],function(_0x3dc3d3){return{'model':db[_0x3dc3d3[_0x002e('0x26')]],'as':_0x3dc3d3['as'],'attributes':_0x3dc3d3[_0x002e('0x23')],'include':_0x3dc3d3[_0x002e('0x25')]?_['map'](_0x3dc3d3[_0x002e('0x25')],function(_0x5daa9f){return{'model':db[_0x5daa9f[_0x002e('0x26')]],'as':_0x5daa9f['as'],'attributes':_0x5daa9f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40e3bb){logger[_0x002e('0x14')]('ShowFaxQueue',_0x5d0d3b);logger[_0x002e('0x17')]('ShowFaxQueue',_0x5d0d3b,JSON[_0x002e('0x19')](_0x40e3bb));_0x232dce(_0x40e3bb);})[_0x002e('0x1d')](function(_0x3c4e87){logger['error'](_0x002e('0x29'),_0x3c4e87['message'],_0x5d0d3b);_0x5a3b9f(_0xe9dd38[_0x002e('0x1a')](0x1f4,_0x3c4e87[_0x002e('0x1b')]));});});}; \ No newline at end of file +var _0x05f7=['options','limit','include','model','attributes','map','ShowFaxQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll'];(function(_0x3c7c93,_0x205471){var _0x1967f7=function(_0x3504e2){while(--_0x3504e2){_0x3c7c93['push'](_0x3c7c93['shift']());}};_0x1967f7(++_0x205471);}(_0x05f7,0x1c0));var _0x705f=function(_0x228641,_0x25d636){_0x228641=_0x228641-0x0;var _0x5d5d78=_0x05f7[_0x228641];return _0x5d5d78;};'use strict';var _=require(_0x705f('0x0'));var util=require(_0x705f('0x1'));var moment=require(_0x705f('0x2'));var BPromise=require(_0x705f('0x3'));var rs=require(_0x705f('0x4'));var fs=require('fs');var Redis=require(_0x705f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x705f('0x6'));var logger=require(_0x705f('0x7'))(_0x705f('0x8'));var config=require(_0x705f('0x9'));var jayson=require(_0x705f('0xa'));var client=jayson[_0x705f('0xb')]['http']({'port':0x232a});config['redis']=_[_0x705f('0xc')](config[_0x705f('0xd')],{'host':_0x705f('0xe'),'port':0x18eb});var socket=require(_0x705f('0xf'))(new Redis(config[_0x705f('0xd')]));require(_0x705f('0x10'))[_0x705f('0x11')](socket);function respondWithRpcPromise(_0x32642a,_0x2817a6,_0x3316be){return new BPromise(function(_0x1823e4,_0x5cc192){return client['request'](_0x32642a,_0x3316be)[_0x705f('0x12')](function(_0x3e1c96){logger[_0x705f('0x13')](_0x705f('0x14'),_0x2817a6,_0x705f('0x15'));logger[_0x705f('0x16')](_0x705f('0x17'),_0x2817a6,_0x705f('0x15'),JSON[_0x705f('0x18')](_0x3e1c96));if(_0x3e1c96['error']){if(_0x3e1c96[_0x705f('0x19')][_0x705f('0x1a')]===0x1f4){logger[_0x705f('0x19')](_0x705f('0x14'),_0x2817a6,_0x3e1c96['error'][_0x705f('0x1b')]);return _0x5cc192(_0x3e1c96[_0x705f('0x19')][_0x705f('0x1b')]);}logger[_0x705f('0x19')](_0x705f('0x14'),_0x2817a6,_0x3e1c96[_0x705f('0x19')][_0x705f('0x1b')]);return _0x1823e4(_0x3e1c96[_0x705f('0x19')][_0x705f('0x1b')]);}else{logger[_0x705f('0x13')](_0x705f('0x14'),_0x2817a6,_0x705f('0x15'));_0x1823e4(_0x3e1c96['result'][_0x705f('0x1b')]);}})[_0x705f('0x1c')](function(_0x28f577){logger[_0x705f('0x19')](_0x705f('0x14'),_0x2817a6,_0x28f577);_0x5cc192(_0x28f577);});});}exports[_0x705f('0x1d')]=function(_0x20e9f1){var _0x14a692=this;return new Promise(function(_0x41260b,_0x1c9661){return db[_0x705f('0x1e')][_0x705f('0x1f')]({'raw':_0x20e9f1[_0x705f('0x20')]?_0x20e9f1[_0x705f('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x20e9f1[_0x705f('0x20')]?_0x20e9f1['options']['where']||null:null,'attributes':_0x20e9f1[_0x705f('0x20')]?_0x20e9f1[_0x705f('0x20')]['attributes']||null:null,'limit':_0x20e9f1[_0x705f('0x20')]?_0x20e9f1[_0x705f('0x20')][_0x705f('0x21')]||null:null,'include':_0x20e9f1[_0x705f('0x20')]?_0x20e9f1[_0x705f('0x20')][_0x705f('0x22')]?_['map'](_0x20e9f1[_0x705f('0x20')][_0x705f('0x22')],function(_0x220345){return{'model':db[_0x220345[_0x705f('0x23')]],'as':_0x220345['as'],'attributes':_0x220345[_0x705f('0x24')],'include':_0x220345[_0x705f('0x22')]?_[_0x705f('0x25')](_0x220345[_0x705f('0x22')],function(_0x418ea5){return{'model':db[_0x418ea5[_0x705f('0x23')]],'as':_0x418ea5['as'],'attributes':_0x418ea5['attributes'],'include':_0x418ea5[_0x705f('0x22')]?_['map'](_0x418ea5['include'],function(_0x5abfb3){return{'model':db[_0x5abfb3[_0x705f('0x23')]],'as':_0x5abfb3['as'],'attributes':_0x5abfb3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x555379){logger[_0x705f('0x13')]('GetFaxQueue',_0x20e9f1);logger[_0x705f('0x16')](_0x705f('0x1d'),_0x20e9f1,JSON[_0x705f('0x18')](_0x555379));_0x41260b(_0x555379);})[_0x705f('0x1c')](function(_0x50beab){logger['error'](_0x705f('0x1d'),_0x50beab[_0x705f('0x1b')],_0x20e9f1);_0x1c9661(_0x14a692[_0x705f('0x19')](0x1f4,_0x50beab[_0x705f('0x1b')]));});});};exports[_0x705f('0x26')]=function(_0x432e20){var _0x20ee4f=this;return new Promise(function(_0x3f50a2,_0xb93084){return db[_0x705f('0x1e')]['find']({'raw':_0x432e20[_0x705f('0x20')]?_0x432e20['options'][_0x705f('0x27')]===undefined?!![]:![]:!![],'where':_0x432e20['options']?_0x432e20[_0x705f('0x20')]['where']||null:null,'attributes':_0x432e20['options']?_0x432e20[_0x705f('0x20')][_0x705f('0x24')]||null:null,'include':_0x432e20[_0x705f('0x20')]?_0x432e20[_0x705f('0x20')][_0x705f('0x22')]?_[_0x705f('0x25')](_0x432e20[_0x705f('0x20')]['include'],function(_0x4d97ff){return{'model':db[_0x4d97ff[_0x705f('0x23')]],'as':_0x4d97ff['as'],'attributes':_0x4d97ff[_0x705f('0x24')],'include':_0x4d97ff[_0x705f('0x22')]?_[_0x705f('0x25')](_0x4d97ff[_0x705f('0x22')],function(_0x1ef3fd){return{'model':db[_0x1ef3fd[_0x705f('0x23')]],'as':_0x1ef3fd['as'],'attributes':_0x1ef3fd['attributes'],'include':_0x1ef3fd[_0x705f('0x22')]?_[_0x705f('0x25')](_0x1ef3fd[_0x705f('0x22')],function(_0x1025c9){return{'model':db[_0x1025c9[_0x705f('0x23')]],'as':_0x1025c9['as'],'attributes':_0x1025c9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f04ef){logger['info']('ShowFaxQueue',_0x432e20);logger['debug']('ShowFaxQueue',_0x432e20,JSON[_0x705f('0x18')](_0x1f04ef));_0x3f50a2(_0x1f04ef);})['catch'](function(_0x36f3ff){logger[_0x705f('0x19')](_0x705f('0x26'),_0x36f3ff[_0x705f('0x1b')],_0x432e20);_0xb93084(_0x20ee4f['error'](0x1f4,_0x36f3ff[_0x705f('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 831f745..346510c 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 _0x44f1=['update','removeListener','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44f1,0x169));var _0x144f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x44f1[_0x3947c9];return _0x2e7871;};'use strict';var FaxQueueEvents=require(_0x144f('0x0'));var events=[_0x144f('0x1'),_0x144f('0x2'),_0x144f('0x3')];function createListener(_0x15c829,_0x120634){return function(_0x24f7aa){_0x120634['emit'](_0x15c829,_0x24f7aa);};}function removeListener(_0x5651d8,_0x678a34){return function(){FaxQueueEvents[_0x144f('0x4')](_0x5651d8,_0x678a34);};}exports['register']=function(_0x1371bb){for(var _0x2d3657=0x0,_0x32c611=events[_0x144f('0x5')];_0x2d3657<_0x32c611;_0x2d3657++){var _0x72c006=events[_0x2d3657];var _0xe0347d=createListener(_0x144f('0x6')+_0x72c006,_0x1371bb);FaxQueueEvents['on'](_0x72c006,_0xe0347d);}}; \ No newline at end of file +var _0x589b=['register','length','./faxQueue.events','save','update','emit'];(function(_0x2016a6,_0x49b0e4){var _0x4da6a8=function(_0x5e4396){while(--_0x5e4396){_0x2016a6['push'](_0x2016a6['shift']());}};_0x4da6a8(++_0x49b0e4);}(_0x589b,0x1b2));var _0xb589=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x589b[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0xb589('0x0'));var events=[_0xb589('0x1'),'remove',_0xb589('0x2')];function createListener(_0x422bf5,_0x1588b5){return function(_0x320e0d){_0x1588b5[_0xb589('0x3')](_0x422bf5,_0x320e0d);};}function removeListener(_0x5e2638,_0x5c2219){return function(){FaxQueueEvents['removeListener'](_0x5e2638,_0x5c2219);};}exports[_0xb589('0x4')]=function(_0x5a2fc4){for(var _0x29f930=0x0,_0x10e602=events[_0xb589('0x5')];_0x29f930<_0x10e602;_0x29f930++){var _0x404abe=events[_0x29f930];var _0x14fbb0=createListener('faxQueue:'+_0x404abe,_0x5a2fc4);FaxQueueEvents['on'](_0x404abe,_0x14fbb0);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index a6c058e..36e3d3d 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 _0x9a5a=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','delete','removeTeams','exports','multer','util'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9a5a,0x194));var _0xa9a5=function(_0x1b759c,_0x5c3397){_0x1b759c=_0x1b759c-0x0;var _0x3fbd71=_0x9a5a[_0x1b759c];return _0x3fbd71;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0xa')](_0xa9a5('0x10'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0xa')](_0xa9a5('0x12'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xa9a5('0x13'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x14')]);router[_0xa9a5('0x15')]('/',auth[_0xa9a5('0xd')](),controller['create']);router[_0xa9a5('0x15')](_0xa9a5('0x12'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x16')]);router[_0xa9a5('0x15')](_0xa9a5('0x13'),auth['isAuthenticated'](),controller[_0xa9a5('0x17')]);router[_0xa9a5('0x18')](_0xa9a5('0x19'),auth[_0xa9a5('0xd')](),controller['update']);router[_0xa9a5('0x1a')](_0xa9a5('0x19'),auth[_0xa9a5('0xd')](),controller['destroy']);router[_0xa9a5('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller[_0xa9a5('0x1b')]);router[_0xa9a5('0x1a')]('/:id/users',auth[_0xa9a5('0xd')](),controller['removeAgents']);module[_0xa9a5('0x1c')]=router; \ No newline at end of file +var _0x3914=['../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','isAuthenticated','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x12b92e,_0x47c1d4){var _0x19001f=function(_0x2b7744){while(--_0x2b7744){_0x12b92e['push'](_0x12b92e['shift']());}};_0x19001f(++_0x47c1d4);}(_0x3914,0xeb));var _0x4391=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0x3914[_0x2fdce0];return _0x36f07e;};'use strict';var multer=require(_0x4391('0x0'));var util=require(_0x4391('0x1'));var path=require('path');var timeout=require(_0x4391('0x2'));var express=require(_0x4391('0x3'));var router=express['Router']();var fs_extra=require(_0x4391('0x4'));var auth=require(_0x4391('0x5'));var interaction=require(_0x4391('0x6'));var config=require('../../config/environment');var controller=require(_0x4391('0x7'));router[_0x4391('0x8')]('/',auth['isAuthenticated'](),controller[_0x4391('0x9')]);router['get'](_0x4391('0xa'),auth['isAuthenticated'](),controller[_0x4391('0xb')]);router[_0x4391('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4391('0xc')]);router[_0x4391('0x8')](_0x4391('0xd'),auth['isAuthenticated'](),controller[_0x4391('0xe')]);router[_0x4391('0x8')](_0x4391('0xf'),auth[_0x4391('0x10')](),controller['getTeams']);router[_0x4391('0x8')](_0x4391('0x11'),auth[_0x4391('0x10')](),controller[_0x4391('0x12')]);router[_0x4391('0x13')]('/',auth[_0x4391('0x10')](),controller[_0x4391('0x14')]);router[_0x4391('0x13')]('/:id/teams',auth[_0x4391('0x10')](),controller[_0x4391('0x15')]);router[_0x4391('0x13')](_0x4391('0x11'),auth['isAuthenticated'](),controller[_0x4391('0x16')]);router['put'](_0x4391('0x17'),auth[_0x4391('0x10')](),controller[_0x4391('0x18')]);router[_0x4391('0x19')](_0x4391('0x17'),auth[_0x4391('0x10')](),controller[_0x4391('0x1a')]);router[_0x4391('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4391('0x1b')]);router['delete'](_0x4391('0x11'),auth[_0x4391('0x10')](),controller[_0x4391('0x1c')]);module[_0x4391('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 0dfff90..6b09a21 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 _0x9abf=['moment','sequelize','exports','DATE','STRING'];(function(_0x46eb0e,_0x296d16){var _0x523297=function(_0x1e0dbb){while(--_0x1e0dbb){_0x46eb0e['push'](_0x46eb0e['shift']());}};_0x523297(++_0x296d16);}(_0x9abf,0xd7));var _0xf9ab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9abf[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0xf9ab('0x0'));var Sequelize=require(_0xf9ab('0x1'));module[_0xf9ab('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf9ab('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf9ab('0x3')]},'reason':{'type':Sequelize[_0xf9ab('0x4')]}}; \ No newline at end of file +var _0x98a8=['moment','sequelize','exports','STRING','DATE'];(function(_0x309619,_0x3f6824){var _0x5842b9=function(_0x46f35f){while(--_0x46f35f){_0x309619['push'](_0x309619['shift']());}};_0x5842b9(++_0x3f6824);}(_0x98a8,0x12c));var _0x898a=function(_0x5ed9ce,_0x4aba87){_0x5ed9ce=_0x5ed9ce-0x0;var _0x84871=_0x98a8[_0x5ed9ce];return _0x84871;};'use strict';var moment=require(_0x898a('0x0'));var Sequelize=require(_0x898a('0x1'));module[_0x898a('0x2')]={'uniqueid':{'type':Sequelize[_0x898a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x898a('0x3')]},'joinAt':{'type':Sequelize[_0x898a('0x4')]},'leaveAt':{'type':Sequelize[_0x898a('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x898a('0x4')]},'reason':{'type':Sequelize[_0x898a('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 3afa3d6..8736d75 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 _0x652b=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','merge','where','VIRTUAL','options','includeAll','include','FaxQueueReport','findAll','show','params','catch','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','then','end','sendStatus','stack','name','send','index','map'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x652b,0x68));var _0xb652=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x652b[_0x43a37c];return _0x5d1d40;};'use strict';var emlformat=require(_0xb652('0x0'));var rimraf=require(_0xb652('0x1'));var zipdir=require(_0xb652('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb652('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb652('0x4'));var util=require(_0xb652('0x5'));var path=require(_0xb652('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb652('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb652('0x8'));var crypto=require('crypto');var jsforce=require(_0xb652('0x9'));var deskjs=require(_0xb652('0xa'));var toCsv=require(_0xb652('0xb'));var querystring=require(_0xb652('0xc'));var Papa=require(_0xb652('0xd'));var Redis=require(_0xb652('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb652('0xf'));var hardwareService=require(_0xb652('0x10'));var logger=require(_0xb652('0x11'))(_0xb652('0x12'));var utils=require('../../config/utils');var config=require(_0xb652('0x13'));var licenseUtil=require(_0xb652('0x14'));var db=require(_0xb652('0x15'))['db'];function respondWithStatusCode(_0x54c2e2,_0x1c182c){_0x1c182c=_0x1c182c||0xcc;return function(_0x813e0c){if(_0x813e0c){return _0x54c2e2['sendStatus'](_0x1c182c);}return _0x54c2e2['status'](_0x1c182c)['end']();};}function respondWithResult(_0x4921a0,_0x21ce7f){_0x21ce7f=_0x21ce7f||0xc8;return function(_0x4dda37){if(_0x4dda37){return _0x4921a0[_0xb652('0x16')](_0x21ce7f)[_0xb652('0x17')](_0x4dda37);}};}function respondWithFilteredResult(_0x16fbac,_0x50889e){return function(_0x1d6f1c){if(_0x1d6f1c){var _0x3621a4=typeof _0x50889e[_0xb652('0x18')]===_0xb652('0x19')&&typeof _0x50889e['limit']===_0xb652('0x19');var _0x289911=_0x1d6f1c[_0xb652('0x1a')];var _0x3bf3b0=_0x3621a4?0x0:_0x50889e['offset'];var _0x94d0b3=_0x3621a4?_0x1d6f1c['count']:_0x50889e[_0xb652('0x18')]+_0x50889e[_0xb652('0x1b')];var _0x22288e;if(_0x94d0b3>=_0x289911){_0x94d0b3=_0x289911;_0x22288e=0xc8;}else{_0x22288e=0xce;}_0x16fbac[_0xb652('0x16')](_0x22288e);return _0x16fbac['set'](_0xb652('0x1c'),_0x3bf3b0+'-'+_0x94d0b3+'/'+_0x289911)[_0xb652('0x17')](_0x1d6f1c);}return null;};}function patchUpdates(_0x3fc43e){return function(_0x169f41){try{jsonpatch[_0xb652('0x1d')](_0x169f41,_0x3fc43e,!![]);}catch(_0x3fb365){return BPromise['reject'](_0x3fb365);}return _0x169f41['save']();};}function saveUpdates(_0x71465c,_0x39a4e3){return function(_0x49a2b2){if(_0x49a2b2){return _0x49a2b2['update'](_0x71465c)[_0xb652('0x1e')](function(_0x48ae93){return _0x48ae93;});}return null;};}function removeEntity(_0x1884a0,_0x3756fb){return function(_0x52d51f){if(_0x52d51f){return _0x52d51f['destroy']()[_0xb652('0x1e')](function(){_0x1884a0[_0xb652('0x16')](0xcc)[_0xb652('0x1f')]();});}};}function handleEntityNotFound(_0x432a86,_0x15ea86){return function(_0x2f7186){if(!_0x2f7186){_0x432a86[_0xb652('0x20')](0x194);}return _0x2f7186;};}function handleError(_0x44ccf3,_0x56eade){_0x56eade=_0x56eade||0x1f4;return function(_0x4dcc1b){logger['error'](_0x4dcc1b[_0xb652('0x21')]);if(_0x4dcc1b['name']){delete _0x4dcc1b[_0xb652('0x22')];}_0x44ccf3['status'](_0x56eade)[_0xb652('0x23')](_0x4dcc1b);};}exports[_0xb652('0x24')]=function(_0x3b74eb,_0x2b91ff){var _0x147b8d={},_0x5f39cb={},_0x459c03={'count':0x0,'rows':[]};var _0x52d918=_[_0xb652('0x25')](db['FaxQueueReport'][_0xb652('0x26')],function(_0x23e529){return{'name':_0x23e529[_0xb652('0x27')],'type':_0x23e529[_0xb652('0x28')][_0xb652('0x29')]};});_0x5f39cb[_0xb652('0x2a')]=_[_0xb652('0x25')](_0x52d918,_0xb652('0x22'));_0x5f39cb[_0xb652('0x2b')]=_[_0xb652('0x2c')](_0x3b74eb[_0xb652('0x2b')]);_0x5f39cb['filters']=_[_0xb652('0x2d')](_0x5f39cb[_0xb652('0x2a')],_0x5f39cb[_0xb652('0x2b')]);_0x147b8d[_0xb652('0x2e')]=_[_0xb652('0x2d')](_0x5f39cb[_0xb652('0x2a')],qs['fields'](_0x3b74eb[_0xb652('0x2b')][_0xb652('0x2f')]));_0x147b8d[_0xb652('0x2e')]=_0x147b8d[_0xb652('0x2e')][_0xb652('0x30')]?_0x147b8d[_0xb652('0x2e')]:_0x5f39cb[_0xb652('0x2a')];if(!_0x3b74eb[_0xb652('0x2b')][_0xb652('0x31')](_0xb652('0x32'))){_0x147b8d['limit']=qs[_0xb652('0x1b')](_0x3b74eb['query']['limit']);_0x147b8d['offset']=qs[_0xb652('0x18')](_0x3b74eb[_0xb652('0x2b')][_0xb652('0x18')]);}_0x147b8d['order']=qs[_0xb652('0x33')](_0x3b74eb['query'][_0xb652('0x33')]);_0x147b8d['where']=qs[_0xb652('0x34')](_['pick'](_0x3b74eb[_0xb652('0x2b')],_0x5f39cb[_0xb652('0x34')]),_0x52d918);if(_0x3b74eb[_0xb652('0x2b')][_0xb652('0x35')]){_0x147b8d['where']=_[_0xb652('0x36')](_0x147b8d[_0xb652('0x37')],{'$or':_[_0xb652('0x25')](_0x52d918,function(_0xd20e40){if(_0xd20e40['type']!==_0xb652('0x38')){var _0x6deca9={};_0x6deca9[_0xd20e40['name']]={'$like':'%'+_0x3b74eb[_0xb652('0x2b')]['filter']+'%'};return _0x6deca9;}})});}_0x147b8d=_['merge']({},_0x147b8d,_0x3b74eb[_0xb652('0x39')]);var _0xb8f377={'where':_0x147b8d[_0xb652('0x37')]};return db['FaxQueueReport'][_0xb652('0x1a')](_0xb8f377)[_0xb652('0x1e')](function(_0x22edb1){_0x459c03[_0xb652('0x1a')]=_0x22edb1;if(_0x3b74eb[_0xb652('0x2b')][_0xb652('0x3a')]){_0x147b8d[_0xb652('0x3b')]=[{'all':!![]}];}return db[_0xb652('0x3c')][_0xb652('0x3d')](_0x147b8d);})[_0xb652('0x1e')](function(_0x501cb7){_0x459c03['rows']=_0x501cb7;return _0x459c03;})[_0xb652('0x1e')](respondWithFilteredResult(_0x2b91ff,_0x147b8d))['catch'](handleError(_0x2b91ff,null));};exports[_0xb652('0x3e')]=function(_0x20e887,_0x6499a7){var _0x3b6c98={'raw':!![],'where':{'id':_0x20e887[_0xb652('0x3f')]['id']}},_0x190c7={};_0x190c7['model']=_['keys'](db[_0xb652('0x3c')][_0xb652('0x26')]);_0x190c7[_0xb652('0x2b')]=_[_0xb652('0x2c')](_0x20e887['query']);_0x190c7[_0xb652('0x34')]=_[_0xb652('0x2d')](_0x190c7[_0xb652('0x2a')],_0x190c7[_0xb652('0x2b')]);_0x3b6c98[_0xb652('0x2e')]=_[_0xb652('0x2d')](_0x190c7[_0xb652('0x2a')],qs[_0xb652('0x2f')](_0x20e887[_0xb652('0x2b')][_0xb652('0x2f')]));_0x3b6c98[_0xb652('0x2e')]=_0x3b6c98[_0xb652('0x2e')][_0xb652('0x30')]?_0x3b6c98[_0xb652('0x2e')]:_0x190c7['model'];if(_0x20e887['query'][_0xb652('0x3a')]){_0x3b6c98[_0xb652('0x3b')]=[{'all':!![]}];}_0x3b6c98=_[_0xb652('0x36')]({},_0x3b6c98,_0x20e887['options']);return db[_0xb652('0x3c')]['find'](_0x3b6c98)[_0xb652('0x1e')](handleEntityNotFound(_0x6499a7,null))[_0xb652('0x1e')](respondWithResult(_0x6499a7,null))[_0xb652('0x40')](handleError(_0x6499a7,null));};exports[_0xb652('0x41')]=function(_0x3739b3,_0xdbe9a2){return db[_0xb652('0x3c')][_0xb652('0x41')](_0x3739b3[_0xb652('0x42')],{})['then'](respondWithResult(_0xdbe9a2,0xc9))[_0xb652('0x40')](handleError(_0xdbe9a2,null));};exports[_0xb652('0x43')]=function(_0x5a4d6c,_0x33eb79){if(_0x5a4d6c['body']['id']){delete _0x5a4d6c[_0xb652('0x42')]['id'];}return db[_0xb652('0x3c')][_0xb652('0x44')]({'where':{'id':_0x5a4d6c['params']['id']}})[_0xb652('0x1e')](handleEntityNotFound(_0x33eb79,null))[_0xb652('0x1e')](saveUpdates(_0x5a4d6c[_0xb652('0x42')],null))[_0xb652('0x1e')](respondWithResult(_0x33eb79,null))[_0xb652('0x40')](handleError(_0x33eb79,null));};exports[_0xb652('0x45')]=function(_0x3e067c,_0x1bebc7){return db['FaxQueueReport']['find']({'where':{'id':_0x3e067c[_0xb652('0x3f')]['id']}})[_0xb652('0x1e')](handleEntityNotFound(_0x1bebc7,null))['then'](removeEntity(_0x1bebc7,null))['catch'](handleError(_0x1bebc7,null));};exports['describe']=function(_0x10ca6c,_0x938dbf){return db[_0xb652('0x3c')][_0xb652('0x46')]()['then'](respondWithResult(_0x938dbf,null))['catch'](handleError(_0x938dbf,null));}; \ No newline at end of file +var _0x324f=['mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','eml-format','rimraf','zip-dir','moment'];(function(_0x1c9f83,_0x349188){var _0x6d31f0=function(_0x4bddc6){while(--_0x4bddc6){_0x1c9f83['push'](_0x1c9f83['shift']());}};_0x6d31f0(++_0x349188);}(_0x324f,0x94));var _0xf324=function(_0x714d60,_0x1ede1f){_0x714d60=_0x714d60-0x0;var _0x25b2f1=_0x324f[_0x714d60];return _0x25b2f1;};'use strict';var emlformat=require(_0xf324('0x0'));var rimraf=require(_0xf324('0x1'));var zipdir=require(_0xf324('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf324('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf324('0x4'));var util=require(_0xf324('0x5'));var path=require('path');var sox=require(_0xf324('0x6'));var csv=require(_0xf324('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf324('0x8'));var _=require(_0xf324('0x9'));var squel=require(_0xf324('0xa'));var crypto=require(_0xf324('0xb'));var jsforce=require(_0xf324('0xc'));var deskjs=require(_0xf324('0xd'));var toCsv=require(_0xf324('0x7'));var querystring=require(_0xf324('0xe'));var Papa=require(_0xf324('0xf'));var Redis=require('ioredis');var authService=require(_0xf324('0x10'));var qs=require(_0xf324('0x11'));var as=require(_0xf324('0x12'));var hardwareService=require(_0xf324('0x13'));var logger=require('../../config/logger')(_0xf324('0x14'));var utils=require(_0xf324('0x15'));var config=require(_0xf324('0x16'));var licenseUtil=require(_0xf324('0x17'));var db=require(_0xf324('0x18'))['db'];function respondWithStatusCode(_0x312dbf,_0x790180){_0x790180=_0x790180||0xcc;return function(_0x9b34d3){if(_0x9b34d3){return _0x312dbf[_0xf324('0x19')](_0x790180);}return _0x312dbf[_0xf324('0x1a')](_0x790180)['end']();};}function respondWithResult(_0x59136f,_0x52c645){_0x52c645=_0x52c645||0xc8;return function(_0x4a0c04){if(_0x4a0c04){return _0x59136f[_0xf324('0x1a')](_0x52c645)['json'](_0x4a0c04);}};}function respondWithFilteredResult(_0x1fec90,_0x47c72f){return function(_0xd59071){if(_0xd59071){var _0x5c5c84=typeof _0x47c72f[_0xf324('0x1b')]===_0xf324('0x1c')&&typeof _0x47c72f[_0xf324('0x1d')]==='undefined';var _0x29334c=_0xd59071[_0xf324('0x1e')];var _0x39ca8e=_0x5c5c84?0x0:_0x47c72f[_0xf324('0x1b')];var _0x28d986=_0x5c5c84?_0xd59071[_0xf324('0x1e')]:_0x47c72f[_0xf324('0x1b')]+_0x47c72f[_0xf324('0x1d')];var _0x2c936e;if(_0x28d986>=_0x29334c){_0x28d986=_0x29334c;_0x2c936e=0xc8;}else{_0x2c936e=0xce;}_0x1fec90[_0xf324('0x1a')](_0x2c936e);return _0x1fec90[_0xf324('0x1f')](_0xf324('0x20'),_0x39ca8e+'-'+_0x28d986+'/'+_0x29334c)['json'](_0xd59071);}return null;};}function patchUpdates(_0x10e157){return function(_0xe5afd8){try{jsonpatch['apply'](_0xe5afd8,_0x10e157,!![]);}catch(_0x51507a){return BPromise[_0xf324('0x21')](_0x51507a);}return _0xe5afd8[_0xf324('0x22')]();};}function saveUpdates(_0x235730,_0x407cb7){return function(_0x202a46){if(_0x202a46){return _0x202a46[_0xf324('0x23')](_0x235730)[_0xf324('0x24')](function(_0x2a583f){return _0x2a583f;});}return null;};}function removeEntity(_0x497b89,_0x829a3){return function(_0x2e125d){if(_0x2e125d){return _0x2e125d['destroy']()[_0xf324('0x24')](function(){_0x497b89[_0xf324('0x1a')](0xcc)[_0xf324('0x25')]();});}};}function handleEntityNotFound(_0x5ef883,_0xec0d36){return function(_0x24188b){if(!_0x24188b){_0x5ef883[_0xf324('0x19')](0x194);}return _0x24188b;};}function handleError(_0x41b611,_0x153350){_0x153350=_0x153350||0x1f4;return function(_0x391e48){logger[_0xf324('0x26')](_0x391e48[_0xf324('0x27')]);if(_0x391e48[_0xf324('0x28')]){delete _0x391e48[_0xf324('0x28')];}_0x41b611[_0xf324('0x1a')](_0x153350)[_0xf324('0x29')](_0x391e48);};}exports[_0xf324('0x2a')]=function(_0x37e28a,_0x4c0636){var _0x2eaa37={},_0x143934={},_0x4dd1fc={'count':0x0,'rows':[]};var _0x3e2af0=_[_0xf324('0x2b')](db[_0xf324('0x2c')][_0xf324('0x2d')],function(_0x5af3af){return{'name':_0x5af3af[_0xf324('0x2e')],'type':_0x5af3af['type'][_0xf324('0x2f')]};});_0x143934[_0xf324('0x30')]=_[_0xf324('0x2b')](_0x3e2af0,'name');_0x143934[_0xf324('0x31')]=_[_0xf324('0x32')](_0x37e28a[_0xf324('0x31')]);_0x143934[_0xf324('0x33')]=_['intersection'](_0x143934[_0xf324('0x30')],_0x143934[_0xf324('0x31')]);_0x2eaa37['attributes']=_[_0xf324('0x34')](_0x143934[_0xf324('0x30')],qs[_0xf324('0x35')](_0x37e28a[_0xf324('0x31')][_0xf324('0x35')]));_0x2eaa37['attributes']=_0x2eaa37[_0xf324('0x36')][_0xf324('0x37')]?_0x2eaa37[_0xf324('0x36')]:_0x143934[_0xf324('0x30')];if(!_0x37e28a[_0xf324('0x31')][_0xf324('0x38')](_0xf324('0x39'))){_0x2eaa37[_0xf324('0x1d')]=qs[_0xf324('0x1d')](_0x37e28a[_0xf324('0x31')][_0xf324('0x1d')]);_0x2eaa37[_0xf324('0x1b')]=qs[_0xf324('0x1b')](_0x37e28a['query'][_0xf324('0x1b')]);}_0x2eaa37[_0xf324('0x3a')]=qs[_0xf324('0x3b')](_0x37e28a[_0xf324('0x31')][_0xf324('0x3b')]);_0x2eaa37[_0xf324('0x3c')]=qs[_0xf324('0x33')](_['pick'](_0x37e28a[_0xf324('0x31')],_0x143934[_0xf324('0x33')]),_0x3e2af0);if(_0x37e28a['query'][_0xf324('0x3d')]){_0x2eaa37[_0xf324('0x3c')]=_[_0xf324('0x3e')](_0x2eaa37[_0xf324('0x3c')],{'$or':_[_0xf324('0x2b')](_0x3e2af0,function(_0x4ea2bb){if(_0x4ea2bb[_0xf324('0x3f')]!=='VIRTUAL'){var _0x25b279={};_0x25b279[_0x4ea2bb['name']]={'$like':'%'+_0x37e28a[_0xf324('0x31')][_0xf324('0x3d')]+'%'};return _0x25b279;}})});}_0x2eaa37=_['merge']({},_0x2eaa37,_0x37e28a[_0xf324('0x40')]);var _0x16116e={'where':_0x2eaa37[_0xf324('0x3c')]};return db[_0xf324('0x2c')]['count'](_0x16116e)[_0xf324('0x24')](function(_0x3cb1e7){_0x4dd1fc[_0xf324('0x1e')]=_0x3cb1e7;if(_0x37e28a[_0xf324('0x31')]['includeAll']){_0x2eaa37[_0xf324('0x41')]=[{'all':!![]}];}return db[_0xf324('0x2c')][_0xf324('0x42')](_0x2eaa37);})[_0xf324('0x24')](function(_0x59571d){_0x4dd1fc[_0xf324('0x43')]=_0x59571d;return _0x4dd1fc;})['then'](respondWithFilteredResult(_0x4c0636,_0x2eaa37))[_0xf324('0x44')](handleError(_0x4c0636,null));};exports[_0xf324('0x45')]=function(_0x1a8acc,_0x4dbc4e){var _0xce58c2={'raw':!![],'where':{'id':_0x1a8acc[_0xf324('0x46')]['id']}},_0x9c06dc={};_0x9c06dc[_0xf324('0x30')]=_[_0xf324('0x32')](db[_0xf324('0x2c')]['rawAttributes']);_0x9c06dc['query']=_[_0xf324('0x32')](_0x1a8acc[_0xf324('0x31')]);_0x9c06dc[_0xf324('0x33')]=_[_0xf324('0x34')](_0x9c06dc[_0xf324('0x30')],_0x9c06dc[_0xf324('0x31')]);_0xce58c2[_0xf324('0x36')]=_[_0xf324('0x34')](_0x9c06dc['model'],qs[_0xf324('0x35')](_0x1a8acc[_0xf324('0x31')][_0xf324('0x35')]));_0xce58c2[_0xf324('0x36')]=_0xce58c2[_0xf324('0x36')]['length']?_0xce58c2[_0xf324('0x36')]:_0x9c06dc[_0xf324('0x30')];if(_0x1a8acc[_0xf324('0x31')][_0xf324('0x47')]){_0xce58c2[_0xf324('0x41')]=[{'all':!![]}];}_0xce58c2=_[_0xf324('0x3e')]({},_0xce58c2,_0x1a8acc['options']);return db[_0xf324('0x2c')]['find'](_0xce58c2)[_0xf324('0x24')](handleEntityNotFound(_0x4dbc4e,null))['then'](respondWithResult(_0x4dbc4e,null))[_0xf324('0x44')](handleError(_0x4dbc4e,null));};exports[_0xf324('0x48')]=function(_0x536b42,_0x1402e3){return db['FaxQueueReport'][_0xf324('0x48')](_0x536b42[_0xf324('0x49')],{})['then'](respondWithResult(_0x1402e3,0xc9))[_0xf324('0x44')](handleError(_0x1402e3,null));};exports['update']=function(_0x1bdd1f,_0x9aa58d){if(_0x1bdd1f[_0xf324('0x49')]['id']){delete _0x1bdd1f[_0xf324('0x49')]['id'];}return db[_0xf324('0x2c')][_0xf324('0x4a')]({'where':{'id':_0x1bdd1f['params']['id']}})['then'](handleEntityNotFound(_0x9aa58d,null))[_0xf324('0x24')](saveUpdates(_0x1bdd1f['body'],null))[_0xf324('0x24')](respondWithResult(_0x9aa58d,null))[_0xf324('0x44')](handleError(_0x9aa58d,null));};exports[_0xf324('0x4b')]=function(_0x396ea4,_0xc4604c){return db['FaxQueueReport'][_0xf324('0x4a')]({'where':{'id':_0x396ea4[_0xf324('0x46')]['id']}})['then'](handleEntityNotFound(_0xc4604c,null))[_0xf324('0x24')](removeEntity(_0xc4604c,null))[_0xf324('0x44')](handleError(_0xc4604c,null));};exports['describe']=function(_0x901207,_0x48b95b){return db[_0xf324('0x2c')]['describe']()[_0xf324('0x24')](respondWithResult(_0x48b95b,null))[_0xf324('0x44')](handleError(_0x48b95b,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a45cb8f..6ed4da3 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0xe37e53,_0x10cb82){var _0x6c60cf=function(_0x20df54){while(--_0x20df54){_0xe37e53['push'](_0xe37e53['shift']());}};_0x6c60cf(++_0x10cb82);}(_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 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')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x3a9479,_0x2e02f5){var _0x8e82ce=function(_0x3fe975){while(--_0x3fe975){_0x3a9479['push'](_0x3a9479['shift']());}};_0x8e82ce(++_0x2e02f5);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4c4b3a,_0xdffe34){_0x4c4b3a=_0x4c4b3a-0x0;var _0x18bd63=_0x7fbe[_0x4c4b3a];return _0x18bd63;};'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':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 384f09f..1a97b44 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 _0x84ed=['options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','create','body'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x84ed,0x69));var _0xd84e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x84ed[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd84e('0x0'));var util=require(_0xd84e('0x1'));var moment=require(_0xd84e('0x2'));var BPromise=require('bluebird');var rs=require(_0xd84e('0x3'));var fs=require('fs');var Redis=require(_0xd84e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd84e('0x5'));var logger=require(_0xd84e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd84e('0x7')][_0xd84e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46938c,_0x33a5df,_0xec6852){return new BPromise(function(_0x45e78b,_0x24bf0c){return client[_0xd84e('0x9')](_0x46938c,_0xec6852)[_0xd84e('0xa')](function(_0x79a3f4){logger['info'](_0xd84e('0xb'),_0x33a5df,_0xd84e('0xc'));logger[_0xd84e('0xd')](_0xd84e('0xe'),_0x33a5df,'request\x20sent',JSON[_0xd84e('0xf')](_0x79a3f4));if(_0x79a3f4[_0xd84e('0x10')]){if(_0x79a3f4[_0xd84e('0x10')][_0xd84e('0x11')]===0x1f4){logger[_0xd84e('0x10')](_0xd84e('0xb'),_0x33a5df,_0x79a3f4[_0xd84e('0x10')][_0xd84e('0x12')]);return _0x24bf0c(_0x79a3f4[_0xd84e('0x10')]['message']);}logger[_0xd84e('0x10')](_0xd84e('0xb'),_0x33a5df,_0x79a3f4[_0xd84e('0x10')][_0xd84e('0x12')]);return _0x45e78b(_0x79a3f4['error']['message']);}else{logger[_0xd84e('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x33a5df,_0xd84e('0xc'));_0x45e78b(_0x79a3f4[_0xd84e('0x14')][_0xd84e('0x12')]);}})['catch'](function(_0x3439e5){logger[_0xd84e('0x10')](_0xd84e('0xb'),_0x33a5df,_0x3439e5);_0x24bf0c(_0x3439e5);});});}exports['CreateFaxQueueReport']=function(_0x14c307){var _0x2d2280=this;return new Promise(function(_0x90bd2c,_0x13ae27){return db['FaxQueueReport'][_0xd84e('0x15')](_0x14c307[_0xd84e('0x16')],{'raw':_0x14c307[_0xd84e('0x17')]?_0x14c307['options'][_0xd84e('0x18')]===undefined?!![]:![]:!![]})[_0xd84e('0xa')](function(_0x439282){logger['info'](_0xd84e('0x19'),_0x14c307);logger[_0xd84e('0xd')](_0xd84e('0x19'),_0x14c307,JSON[_0xd84e('0xf')](_0x439282));_0x90bd2c(_0x439282);})['catch'](function(_0x2f096a){logger[_0xd84e('0x10')](_0xd84e('0x19'),_0x2f096a[_0xd84e('0x12')],_0x14c307);_0x13ae27(_0x2d2280[_0xd84e('0x10')](0x1f4,_0x2f096a[_0xd84e('0x12')]));});});};exports[_0xd84e('0x1a')]=function(_0xd58fec){var _0x296a80=this;return new Promise(function(_0x56c31f,_0x57d975){return db[_0xd84e('0x1b')][_0xd84e('0x1c')](_0xd58fec[_0xd84e('0x16')],{'raw':_0xd58fec[_0xd84e('0x17')]?_0xd58fec[_0xd84e('0x17')][_0xd84e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd58fec[_0xd84e('0x17')]?_0xd58fec[_0xd84e('0x17')][_0xd84e('0x1d')]||null:null,'attributes':_0xd58fec[_0xd84e('0x17')]?_0xd58fec[_0xd84e('0x17')][_0xd84e('0x1e')]||null:null,'limit':_0xd58fec[_0xd84e('0x17')]?_0xd58fec[_0xd84e('0x17')][_0xd84e('0x1f')]||null:null})[_0xd84e('0xa')](function(_0x548eea){logger[_0xd84e('0x13')](_0xd84e('0x1a'),_0xd58fec);logger[_0xd84e('0xd')](_0xd84e('0x1a'),_0xd58fec,JSON['stringify'](_0x548eea));_0x56c31f(_0x548eea);})['catch'](function(_0x50c11a){logger['error'](_0xd84e('0x1a'),_0x50c11a[_0xd84e('0x12')],_0xd58fec);_0x57d975(_0x296a80[_0xd84e('0x10')](0x1f4,_0x50c11a[_0xd84e('0x12')]));});});}; \ No newline at end of file +var _0x1231=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','create','body','options','raw','then','CreateFaxQueueReport','UpdateFaxQueueReport','update','attributes','limit','lodash','bluebird','randomstring'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1231,0x152));var _0x1123=function(_0x421f77,_0x547ea6){_0x421f77=_0x421f77-0x0;var _0x137f06=_0x1231[_0x421f77];return _0x137f06;};'use strict';var _=require(_0x1123('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1123('0x1'));var rs=require(_0x1123('0x2'));var fs=require('fs');var Redis=require(_0x1123('0x3'));var db=require(_0x1123('0x4'))['db'];var utils=require(_0x1123('0x5'));var logger=require(_0x1123('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1123('0x7'));var client=jayson[_0x1123('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b5214,_0x59322b,_0x336096){return new BPromise(function(_0x4be333,_0x3a352c){return client[_0x1123('0x9')](_0x2b5214,_0x336096)['then'](function(_0x3c71d6){logger['info'](_0x1123('0xa'),_0x59322b,_0x1123('0xb'));logger[_0x1123('0xc')](_0x1123('0xd'),_0x59322b,'request\x20sent',JSON[_0x1123('0xe')](_0x3c71d6));if(_0x3c71d6[_0x1123('0xf')]){if(_0x3c71d6[_0x1123('0xf')][_0x1123('0x10')]===0x1f4){logger[_0x1123('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x59322b,_0x3c71d6[_0x1123('0xf')][_0x1123('0x11')]);return _0x3a352c(_0x3c71d6[_0x1123('0xf')][_0x1123('0x11')]);}logger['error'](_0x1123('0xa'),_0x59322b,_0x3c71d6['error'][_0x1123('0x11')]);return _0x4be333(_0x3c71d6[_0x1123('0xf')]['message']);}else{logger[_0x1123('0x12')](_0x1123('0xa'),_0x59322b,_0x1123('0xb'));_0x4be333(_0x3c71d6[_0x1123('0x13')][_0x1123('0x11')]);}})[_0x1123('0x14')](function(_0x1d67d5){logger[_0x1123('0xf')](_0x1123('0xa'),_0x59322b,_0x1d67d5);_0x3a352c(_0x1d67d5);});});}exports['CreateFaxQueueReport']=function(_0x338b3b){var _0x1ac444=this;return new Promise(function(_0x563fda,_0x10891d){return db['FaxQueueReport'][_0x1123('0x15')](_0x338b3b[_0x1123('0x16')],{'raw':_0x338b3b[_0x1123('0x17')]?_0x338b3b['options'][_0x1123('0x18')]===undefined?!![]:![]:!![]})[_0x1123('0x19')](function(_0x7e8288){logger['info'](_0x1123('0x1a'),_0x338b3b);logger['debug']('CreateFaxQueueReport',_0x338b3b,JSON[_0x1123('0xe')](_0x7e8288));_0x563fda(_0x7e8288);})['catch'](function(_0x254d85){logger[_0x1123('0xf')](_0x1123('0x1a'),_0x254d85[_0x1123('0x11')],_0x338b3b);_0x10891d(_0x1ac444[_0x1123('0xf')](0x1f4,_0x254d85[_0x1123('0x11')]));});});};exports[_0x1123('0x1b')]=function(_0x399a57){var _0x55b394=this;return new Promise(function(_0x5b855c,_0x1b0d9e){return db['FaxQueueReport'][_0x1123('0x1c')](_0x399a57[_0x1123('0x16')],{'raw':_0x399a57[_0x1123('0x17')]?_0x399a57[_0x1123('0x17')][_0x1123('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x399a57[_0x1123('0x17')]?_0x399a57[_0x1123('0x17')]['where']||null:null,'attributes':_0x399a57[_0x1123('0x17')]?_0x399a57['options'][_0x1123('0x1d')]||null:null,'limit':_0x399a57[_0x1123('0x17')]?_0x399a57[_0x1123('0x17')][_0x1123('0x1e')]||null:null})['then'](function(_0x2863bc){logger[_0x1123('0x12')](_0x1123('0x1b'),_0x399a57);logger[_0x1123('0xc')]('UpdateFaxQueueReport',_0x399a57,JSON[_0x1123('0xe')](_0x2863bc));_0x5b855c(_0x2863bc);})[_0x1123('0x14')](function(_0x357a8d){logger[_0x1123('0xf')]('UpdateFaxQueueReport',_0x357a8d[_0x1123('0x11')],_0x399a57);_0x1b0d9e(_0x55b394[_0x1123('0xf')](0x1f4,_0x357a8d[_0x1123('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 0137c55..d66aab9 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 _0x6b07=['Router','fs-extra','../../components/interaction/service','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x29b274,_0x1865c3){var _0x273473=function(_0x45d259){while(--_0x45d259){_0x29b274['push'](_0x29b274['shift']());}};_0x273473(++_0x1865c3);}(_0x6b07,0x79));var _0x76b0=function(_0x4aaf3c,_0x393fb9){_0x4aaf3c=_0x4aaf3c-0x0;var _0x174c6c=_0x6b07[_0x4aaf3c];return _0x174c6c;};'use strict';var multer=require(_0x76b0('0x0'));var util=require(_0x76b0('0x1'));var path=require(_0x76b0('0x2'));var timeout=require(_0x76b0('0x3'));var express=require(_0x76b0('0x4'));var router=express[_0x76b0('0x5')]();var fs_extra=require(_0x76b0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x76b0('0x7'));var config=require('../../config/environment');var controller=require(_0x76b0('0x8'));router[_0x76b0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x76b0('0xa'),auth[_0x76b0('0xb')](),controller[_0x76b0('0xc')]);router[_0x76b0('0x9')]('/:id',auth[_0x76b0('0xb')](),controller[_0x76b0('0xd')]);router[_0x76b0('0xe')]('/',auth[_0x76b0('0xb')](),controller[_0x76b0('0xf')]);router[_0x76b0('0x10')]('/:id',auth[_0x76b0('0xb')](),controller[_0x76b0('0x11')]);router['delete'](_0x76b0('0x12'),auth[_0x76b0('0xb')](),controller[_0x76b0('0x13')]);module[_0x76b0('0x14')]=router; \ No newline at end of file +var _0x647f=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','index','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','util'];(function(_0x3300ee,_0xed60a9){var _0x714154=function(_0x1229c1){while(--_0x1229c1){_0x3300ee['push'](_0x3300ee['shift']());}};_0x714154(++_0xed60a9);}(_0x647f,0x1b4));var _0xf647=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x647f[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xf647('0x0'));var path=require(_0xf647('0x1'));var timeout=require('connect-timeout');var express=require(_0xf647('0x2'));var router=express[_0xf647('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf647('0x4'));var interaction=require(_0xf647('0x5'));var config=require(_0xf647('0x6'));var controller=require(_0xf647('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf647('0x8')]);router['get'](_0xf647('0x9'),auth[_0xf647('0xa')](),controller['describe']);router['get'](_0xf647('0xb'),auth[_0xf647('0xa')](),controller[_0xf647('0xc')]);router[_0xf647('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf647('0xe')]('/:id',auth[_0xf647('0xa')](),controller[_0xf647('0xf')]);router[_0xf647('0x10')](_0xf647('0xb'),auth[_0xf647('0xa')](),controller[_0xf647('0x11')]);module[_0xf647('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index e5f12f5..ff228b4 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x34947e,_0x45c404){var _0x87404f=function(_0x5e5027){while(--_0x5e5027){_0x34947e['push'](_0x34947e['shift']());}};_0x87404f(++_0x45c404);}(_0x54ef,0x112));var _0xf54e=function(_0x37c6ef,_0x38393d){_0x37c6ef=_0x37c6ef-0x0;var _0x177027=_0x54ef[_0x37c6ef];return _0x177027;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x353b4a,_0x4efd0a){var _0xd97525=function(_0x467029){while(--_0x467029){_0x353b4a['push'](_0x353b4a['shift']());}};_0xd97525(++_0x4efd0a);}(_0x54ef,0x112));var _0xf54e=function(_0x3843e1,_0x24ae9c){_0x3843e1=_0x3843e1-0x0;var _0x111666=_0x54ef[_0x3843e1];return _0x111666;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f4c8ae6..4dc3c48 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 _0x93d6=['sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','type','options','FaxTransferReport','includeAll','findAll','show','params','rawAttributes','include','catch','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy'];(function(_0x31a27d,_0x19a26d){var _0x935871=function(_0x2523b1){while(--_0x2523b1){_0x31a27d['push'](_0x31a27d['shift']());}};_0x935871(++_0x19a26d);}(_0x93d6,0xbe));var _0x693d=function(_0x243427,_0x784e11){_0x243427=_0x243427-0x0;var _0xc59f9a=_0x93d6[_0x243427];return _0xc59f9a;};'use strict';var emlformat=require(_0x693d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x693d('0x1'));var rp=require(_0x693d('0x2'));var moment=require('moment');var BPromise=require(_0x693d('0x3'));var Mustache=require(_0x693d('0x4'));var util=require(_0x693d('0x5'));var path=require(_0x693d('0x6'));var sox=require(_0x693d('0x7'));var csv=require(_0x693d('0x8'));var ejs=require(_0x693d('0x9'));var fs=require('fs');var fs_extra=require(_0x693d('0xa'));var _=require(_0x693d('0xb'));var squel=require(_0x693d('0xc'));var crypto=require('crypto');var jsforce=require(_0x693d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x693d('0x8'));var querystring=require(_0x693d('0xe'));var Papa=require(_0x693d('0xf'));var Redis=require(_0x693d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x693d('0x11'));var as=require(_0x693d('0x12'));var hardwareService=require(_0x693d('0x13'));var logger=require(_0x693d('0x14'))(_0x693d('0x15'));var utils=require(_0x693d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x693d('0x17'));var db=require(_0x693d('0x18'))['db'];function respondWithStatusCode(_0x23e98a,_0x2f6340){_0x2f6340=_0x2f6340||0xcc;return function(_0x2f6a46){if(_0x2f6a46){return _0x23e98a['sendStatus'](_0x2f6340);}return _0x23e98a[_0x693d('0x19')](_0x2f6340)[_0x693d('0x1a')]();};}function respondWithResult(_0x1e23cd,_0x4d1770){_0x4d1770=_0x4d1770||0xc8;return function(_0x29dc17){if(_0x29dc17){return _0x1e23cd[_0x693d('0x19')](_0x4d1770)[_0x693d('0x1b')](_0x29dc17);}};}function respondWithFilteredResult(_0x4e7a97,_0x50e355){return function(_0x2db8f9){if(_0x2db8f9){var _0x1c6f4d=typeof _0x50e355[_0x693d('0x1c')]===_0x693d('0x1d')&&typeof _0x50e355[_0x693d('0x1e')]==='undefined';var _0x216213=_0x2db8f9[_0x693d('0x1f')];var _0x4fb8d0=_0x1c6f4d?0x0:_0x50e355[_0x693d('0x1c')];var _0x4b49b6=_0x1c6f4d?_0x2db8f9[_0x693d('0x1f')]:_0x50e355[_0x693d('0x1c')]+_0x50e355[_0x693d('0x1e')];var _0x37675c;if(_0x4b49b6>=_0x216213){_0x4b49b6=_0x216213;_0x37675c=0xc8;}else{_0x37675c=0xce;}_0x4e7a97[_0x693d('0x19')](_0x37675c);return _0x4e7a97[_0x693d('0x20')](_0x693d('0x21'),_0x4fb8d0+'-'+_0x4b49b6+'/'+_0x216213)['json'](_0x2db8f9);}return null;};}function patchUpdates(_0x1ce0dc){return function(_0x12f276){try{jsonpatch[_0x693d('0x22')](_0x12f276,_0x1ce0dc,!![]);}catch(_0x37119b){return BPromise['reject'](_0x37119b);}return _0x12f276[_0x693d('0x23')]();};}function saveUpdates(_0x16e380,_0x4b8639){return function(_0x1e14e2){if(_0x1e14e2){return _0x1e14e2['update'](_0x16e380)[_0x693d('0x24')](function(_0x5b7ba3){return _0x5b7ba3;});}return null;};}function removeEntity(_0x2085b6,_0x56bc01){return function(_0x5a968d){if(_0x5a968d){return _0x5a968d[_0x693d('0x25')]()[_0x693d('0x24')](function(){_0x2085b6[_0x693d('0x19')](0xcc)[_0x693d('0x1a')]();});}};}function handleEntityNotFound(_0x3e0b36,_0x34bddd){return function(_0x5ca154){if(!_0x5ca154){_0x3e0b36[_0x693d('0x26')](0x194);}return _0x5ca154;};}function handleError(_0x12b398,_0x567de2){_0x567de2=_0x567de2||0x1f4;return function(_0x37c89e){logger[_0x693d('0x27')](_0x37c89e[_0x693d('0x28')]);if(_0x37c89e[_0x693d('0x29')]){delete _0x37c89e['name'];}_0x12b398[_0x693d('0x19')](_0x567de2)[_0x693d('0x2a')](_0x37c89e);};}exports[_0x693d('0x2b')]=function(_0x50fa83,_0x2bb850){var _0x143f51={},_0x54b4df={},_0xd6074f={'count':0x0,'rows':[]};var _0x1ace97=_[_0x693d('0x2c')](db['FaxTransferReport']['rawAttributes'],function(_0x546123){return{'name':_0x546123[_0x693d('0x2d')],'type':_0x546123['type'][_0x693d('0x2e')]};});_0x54b4df[_0x693d('0x2f')]=_[_0x693d('0x2c')](_0x1ace97,_0x693d('0x29'));_0x54b4df[_0x693d('0x30')]=_[_0x693d('0x31')](_0x50fa83[_0x693d('0x30')]);_0x54b4df[_0x693d('0x32')]=_[_0x693d('0x33')](_0x54b4df[_0x693d('0x2f')],_0x54b4df[_0x693d('0x30')]);_0x143f51[_0x693d('0x34')]=_[_0x693d('0x33')](_0x54b4df['model'],qs['fields'](_0x50fa83['query'][_0x693d('0x35')]));_0x143f51[_0x693d('0x34')]=_0x143f51[_0x693d('0x34')][_0x693d('0x36')]?_0x143f51[_0x693d('0x34')]:_0x54b4df[_0x693d('0x2f')];if(!_0x50fa83[_0x693d('0x30')]['hasOwnProperty']('nolimit')){_0x143f51['limit']=qs['limit'](_0x50fa83[_0x693d('0x30')]['limit']);_0x143f51[_0x693d('0x1c')]=qs['offset'](_0x50fa83[_0x693d('0x30')]['offset']);}_0x143f51[_0x693d('0x37')]=qs[_0x693d('0x38')](_0x50fa83[_0x693d('0x30')][_0x693d('0x38')]);_0x143f51['where']=qs[_0x693d('0x32')](_[_0x693d('0x39')](_0x50fa83[_0x693d('0x30')],_0x54b4df[_0x693d('0x32')]),_0x1ace97);if(_0x50fa83[_0x693d('0x30')][_0x693d('0x3a')]){_0x143f51[_0x693d('0x3b')]=_[_0x693d('0x3c')](_0x143f51[_0x693d('0x3b')],{'$or':_[_0x693d('0x2c')](_0x1ace97,function(_0x1514c9){if(_0x1514c9[_0x693d('0x3d')]!=='VIRTUAL'){var _0x1c8bc3={};_0x1c8bc3[_0x1514c9['name']]={'$like':'%'+_0x50fa83[_0x693d('0x30')][_0x693d('0x3a')]+'%'};return _0x1c8bc3;}})});}_0x143f51=_[_0x693d('0x3c')]({},_0x143f51,_0x50fa83[_0x693d('0x3e')]);var _0x4d243d={'where':_0x143f51[_0x693d('0x3b')]};return db[_0x693d('0x3f')][_0x693d('0x1f')](_0x4d243d)['then'](function(_0xe06202){_0xd6074f[_0x693d('0x1f')]=_0xe06202;if(_0x50fa83['query'][_0x693d('0x40')]){_0x143f51['include']=[{'all':!![]}];}return db[_0x693d('0x3f')][_0x693d('0x41')](_0x143f51);})['then'](function(_0x13fb32){_0xd6074f['rows']=_0x13fb32;return _0xd6074f;})[_0x693d('0x24')](respondWithFilteredResult(_0x2bb850,_0x143f51))['catch'](handleError(_0x2bb850,null));};exports[_0x693d('0x42')]=function(_0x5c813c,_0x556b63){var _0x65410={'raw':!![],'where':{'id':_0x5c813c[_0x693d('0x43')]['id']}},_0x5c754e={};_0x5c754e['model']=_['keys'](db['FaxTransferReport'][_0x693d('0x44')]);_0x5c754e[_0x693d('0x30')]=_[_0x693d('0x31')](_0x5c813c[_0x693d('0x30')]);_0x5c754e[_0x693d('0x32')]=_['intersection'](_0x5c754e[_0x693d('0x2f')],_0x5c754e[_0x693d('0x30')]);_0x65410[_0x693d('0x34')]=_[_0x693d('0x33')](_0x5c754e['model'],qs['fields'](_0x5c813c[_0x693d('0x30')][_0x693d('0x35')]));_0x65410[_0x693d('0x34')]=_0x65410[_0x693d('0x34')][_0x693d('0x36')]?_0x65410[_0x693d('0x34')]:_0x5c754e['model'];if(_0x5c813c[_0x693d('0x30')][_0x693d('0x40')]){_0x65410[_0x693d('0x45')]=[{'all':!![]}];}_0x65410=_[_0x693d('0x3c')]({},_0x65410,_0x5c813c[_0x693d('0x3e')]);return db[_0x693d('0x3f')]['find'](_0x65410)[_0x693d('0x24')](handleEntityNotFound(_0x556b63,null))['then'](respondWithResult(_0x556b63,null))[_0x693d('0x46')](handleError(_0x556b63,null));};exports[_0x693d('0x47')]=function(_0x5ef7f8,_0x363349){return db[_0x693d('0x3f')][_0x693d('0x47')](_0x5ef7f8[_0x693d('0x48')],{})[_0x693d('0x24')](respondWithResult(_0x363349,0xc9))[_0x693d('0x46')](handleError(_0x363349,null));};exports[_0x693d('0x49')]=function(_0x5575cc,_0x3103c4){if(_0x5575cc[_0x693d('0x48')]['id']){delete _0x5575cc[_0x693d('0x48')]['id'];}return db['FaxTransferReport'][_0x693d('0x4a')]({'where':{'id':_0x5575cc['params']['id']}})[_0x693d('0x24')](handleEntityNotFound(_0x3103c4,null))[_0x693d('0x24')](saveUpdates(_0x5575cc[_0x693d('0x48')],null))[_0x693d('0x24')](respondWithResult(_0x3103c4,null))[_0x693d('0x46')](handleError(_0x3103c4,null));};exports[_0x693d('0x25')]=function(_0x26828f,_0x3b4095){return db[_0x693d('0x3f')][_0x693d('0x4a')]({'where':{'id':_0x26828f[_0x693d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b4095,null))['then'](removeEntity(_0x3b4095,null))[_0x693d('0x46')](handleError(_0x3b4095,null));};exports[_0x693d('0x4b')]=function(_0x4e1131,_0x5b4328){return db[_0x693d('0x3f')][_0x693d('0x4b')]()['then'](respondWithResult(_0x5b4328,null))[_0x693d('0x46')](handleError(_0x5b4328,null));}; \ No newline at end of file +var _0x4e64=['show','params','keys','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','update','then','end','sendStatus','error','name','FaxTransferReport','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch'];(function(_0x1f5d5c,_0x242983){var _0x5c358f=function(_0x11fcf5){while(--_0x11fcf5){_0x1f5d5c['push'](_0x1f5d5c['shift']());}};_0x5c358f(++_0x242983);}(_0x4e64,0xe4));var _0x44e6=function(_0x519d1c,_0x1935a2){_0x519d1c=_0x519d1c-0x0;var _0x1662e4=_0x4e64[_0x519d1c];return _0x1662e4;};'use strict';var emlformat=require(_0x44e6('0x0'));var rimraf=require(_0x44e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44e6('0x2'));var moment=require(_0x44e6('0x3'));var BPromise=require(_0x44e6('0x4'));var Mustache=require(_0x44e6('0x5'));var util=require(_0x44e6('0x6'));var path=require('path');var sox=require(_0x44e6('0x7'));var csv=require('to-csv');var ejs=require(_0x44e6('0x8'));var fs=require('fs');var fs_extra=require(_0x44e6('0x9'));var _=require(_0x44e6('0xa'));var squel=require(_0x44e6('0xb'));var crypto=require(_0x44e6('0xc'));var jsforce=require(_0x44e6('0xd'));var deskjs=require(_0x44e6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x44e6('0xf'));var authService=require(_0x44e6('0x10'));var qs=require(_0x44e6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44e6('0x12'));var logger=require(_0x44e6('0x13'))(_0x44e6('0x14'));var utils=require(_0x44e6('0x15'));var config=require(_0x44e6('0x16'));var licenseUtil=require(_0x44e6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x460894,_0x48b236){_0x48b236=_0x48b236||0xcc;return function(_0x498189){if(_0x498189){return _0x460894['sendStatus'](_0x48b236);}return _0x460894[_0x44e6('0x18')](_0x48b236)['end']();};}function respondWithResult(_0x2c0c27,_0xd1a712){_0xd1a712=_0xd1a712||0xc8;return function(_0x143cb9){if(_0x143cb9){return _0x2c0c27[_0x44e6('0x18')](_0xd1a712)[_0x44e6('0x19')](_0x143cb9);}};}function respondWithFilteredResult(_0x55b085,_0xf03ae8){return function(_0xc97c1d){if(_0xc97c1d){var _0x13d98a=typeof _0xf03ae8[_0x44e6('0x1a')]==='undefined'&&typeof _0xf03ae8[_0x44e6('0x1b')]===_0x44e6('0x1c');var _0x40199d=_0xc97c1d[_0x44e6('0x1d')];var _0x318a08=_0x13d98a?0x0:_0xf03ae8['offset'];var _0x16fca6=_0x13d98a?_0xc97c1d[_0x44e6('0x1d')]:_0xf03ae8[_0x44e6('0x1a')]+_0xf03ae8[_0x44e6('0x1b')];var _0x4ce9b8;if(_0x16fca6>=_0x40199d){_0x16fca6=_0x40199d;_0x4ce9b8=0xc8;}else{_0x4ce9b8=0xce;}_0x55b085['status'](_0x4ce9b8);return _0x55b085[_0x44e6('0x1e')]('Content-Range',_0x318a08+'-'+_0x16fca6+'/'+_0x40199d)[_0x44e6('0x19')](_0xc97c1d);}return null;};}function patchUpdates(_0x3e7bcc){return function(_0x348315){try{jsonpatch[_0x44e6('0x1f')](_0x348315,_0x3e7bcc,!![]);}catch(_0x983abd){return BPromise[_0x44e6('0x20')](_0x983abd);}return _0x348315['save']();};}function saveUpdates(_0x32d704,_0x3b2ad6){return function(_0x5b0972){if(_0x5b0972){return _0x5b0972[_0x44e6('0x21')](_0x32d704)['then'](function(_0x54f509){return _0x54f509;});}return null;};}function removeEntity(_0x505e64,_0x51f003){return function(_0x28a056){if(_0x28a056){return _0x28a056['destroy']()[_0x44e6('0x22')](function(){_0x505e64[_0x44e6('0x18')](0xcc)[_0x44e6('0x23')]();});}};}function handleEntityNotFound(_0x2375c8,_0x3bea87){return function(_0x1172eb){if(!_0x1172eb){_0x2375c8[_0x44e6('0x24')](0x194);}return _0x1172eb;};}function handleError(_0x192369,_0x2ba920){_0x2ba920=_0x2ba920||0x1f4;return function(_0x1d15cb){logger[_0x44e6('0x25')](_0x1d15cb['stack']);if(_0x1d15cb[_0x44e6('0x26')]){delete _0x1d15cb[_0x44e6('0x26')];}_0x192369[_0x44e6('0x18')](_0x2ba920)['send'](_0x1d15cb);};}exports['index']=function(_0x63239d,_0x16c70e){var _0x35681b={},_0x4c1e2f={},_0x28c1f9={'count':0x0,'rows':[]};var _0x266dfd=_['map'](db[_0x44e6('0x27')]['rawAttributes'],function(_0x38be99){return{'name':_0x38be99[_0x44e6('0x28')],'type':_0x38be99[_0x44e6('0x29')][_0x44e6('0x2a')]};});_0x4c1e2f['model']=_[_0x44e6('0x2b')](_0x266dfd,_0x44e6('0x26'));_0x4c1e2f['query']=_['keys'](_0x63239d[_0x44e6('0x2c')]);_0x4c1e2f[_0x44e6('0x2d')]=_[_0x44e6('0x2e')](_0x4c1e2f[_0x44e6('0x2f')],_0x4c1e2f['query']);_0x35681b['attributes']=_['intersection'](_0x4c1e2f[_0x44e6('0x2f')],qs[_0x44e6('0x30')](_0x63239d[_0x44e6('0x2c')][_0x44e6('0x30')]));_0x35681b[_0x44e6('0x31')]=_0x35681b[_0x44e6('0x31')][_0x44e6('0x32')]?_0x35681b[_0x44e6('0x31')]:_0x4c1e2f['model'];if(!_0x63239d[_0x44e6('0x2c')][_0x44e6('0x33')](_0x44e6('0x34'))){_0x35681b[_0x44e6('0x1b')]=qs[_0x44e6('0x1b')](_0x63239d[_0x44e6('0x2c')][_0x44e6('0x1b')]);_0x35681b[_0x44e6('0x1a')]=qs[_0x44e6('0x1a')](_0x63239d[_0x44e6('0x2c')]['offset']);}_0x35681b[_0x44e6('0x35')]=qs['sort'](_0x63239d[_0x44e6('0x2c')][_0x44e6('0x36')]);_0x35681b[_0x44e6('0x37')]=qs['filters'](_[_0x44e6('0x38')](_0x63239d['query'],_0x4c1e2f[_0x44e6('0x2d')]),_0x266dfd);if(_0x63239d['query'][_0x44e6('0x39')]){_0x35681b[_0x44e6('0x37')]=_[_0x44e6('0x3a')](_0x35681b[_0x44e6('0x37')],{'$or':_[_0x44e6('0x2b')](_0x266dfd,function(_0x33fff4){if(_0x33fff4[_0x44e6('0x29')]!=='VIRTUAL'){var _0x4d363b={};_0x4d363b[_0x33fff4[_0x44e6('0x26')]]={'$like':'%'+_0x63239d[_0x44e6('0x2c')][_0x44e6('0x39')]+'%'};return _0x4d363b;}})});}_0x35681b=_[_0x44e6('0x3a')]({},_0x35681b,_0x63239d[_0x44e6('0x3b')]);var _0x3ba9e7={'where':_0x35681b[_0x44e6('0x37')]};return db[_0x44e6('0x27')][_0x44e6('0x1d')](_0x3ba9e7)['then'](function(_0x31c57e){_0x28c1f9['count']=_0x31c57e;if(_0x63239d[_0x44e6('0x2c')][_0x44e6('0x3c')]){_0x35681b[_0x44e6('0x3d')]=[{'all':!![]}];}return db[_0x44e6('0x27')]['findAll'](_0x35681b);})[_0x44e6('0x22')](function(_0x5afe3f){_0x28c1f9[_0x44e6('0x3e')]=_0x5afe3f;return _0x28c1f9;})[_0x44e6('0x22')](respondWithFilteredResult(_0x16c70e,_0x35681b))[_0x44e6('0x3f')](handleError(_0x16c70e,null));};exports[_0x44e6('0x40')]=function(_0x7b6220,_0x472008){var _0x361f6d={'raw':!![],'where':{'id':_0x7b6220[_0x44e6('0x41')]['id']}},_0x8ef46d={};_0x8ef46d['model']=_[_0x44e6('0x42')](db[_0x44e6('0x27')][_0x44e6('0x43')]);_0x8ef46d[_0x44e6('0x2c')]=_['keys'](_0x7b6220[_0x44e6('0x2c')]);_0x8ef46d[_0x44e6('0x2d')]=_['intersection'](_0x8ef46d[_0x44e6('0x2f')],_0x8ef46d[_0x44e6('0x2c')]);_0x361f6d[_0x44e6('0x31')]=_[_0x44e6('0x2e')](_0x8ef46d[_0x44e6('0x2f')],qs['fields'](_0x7b6220[_0x44e6('0x2c')][_0x44e6('0x30')]));_0x361f6d[_0x44e6('0x31')]=_0x361f6d[_0x44e6('0x31')]['length']?_0x361f6d[_0x44e6('0x31')]:_0x8ef46d[_0x44e6('0x2f')];if(_0x7b6220['query'][_0x44e6('0x3c')]){_0x361f6d[_0x44e6('0x3d')]=[{'all':!![]}];}_0x361f6d=_[_0x44e6('0x3a')]({},_0x361f6d,_0x7b6220[_0x44e6('0x3b')]);return db[_0x44e6('0x27')][_0x44e6('0x44')](_0x361f6d)['then'](handleEntityNotFound(_0x472008,null))['then'](respondWithResult(_0x472008,null))[_0x44e6('0x3f')](handleError(_0x472008,null));};exports[_0x44e6('0x45')]=function(_0x36c38b,_0x35dcb7){return db[_0x44e6('0x27')][_0x44e6('0x45')](_0x36c38b[_0x44e6('0x46')],{})[_0x44e6('0x22')](respondWithResult(_0x35dcb7,0xc9))[_0x44e6('0x3f')](handleError(_0x35dcb7,null));};exports[_0x44e6('0x21')]=function(_0x3ee738,_0x563205){if(_0x3ee738[_0x44e6('0x46')]['id']){delete _0x3ee738['body']['id'];}return db[_0x44e6('0x27')][_0x44e6('0x44')]({'where':{'id':_0x3ee738[_0x44e6('0x41')]['id']}})[_0x44e6('0x22')](handleEntityNotFound(_0x563205,null))['then'](saveUpdates(_0x3ee738[_0x44e6('0x46')],null))[_0x44e6('0x22')](respondWithResult(_0x563205,null))[_0x44e6('0x3f')](handleError(_0x563205,null));};exports[_0x44e6('0x47')]=function(_0xc08732,_0x712849){return db['FaxTransferReport']['find']({'where':{'id':_0xc08732[_0x44e6('0x41')]['id']}})[_0x44e6('0x22')](handleEntityNotFound(_0x712849,null))[_0x44e6('0x22')](removeEntity(_0x712849,null))[_0x44e6('0x3f')](handleError(_0x712849,null));};exports[_0x44e6('0x48')]=function(_0x4f4ae1,_0x3dad90){return db[_0x44e6('0x27')][_0x44e6('0x48')]()[_0x44e6('0x22')](respondWithResult(_0x3dad90,null))[_0x44e6('0x3f')](handleError(_0x3dad90,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ad0e3d7..de55c6b 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 _0x0f3e=['../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x343ebb,_0x1f46b9){var _0x58cf20=function(_0x4e070d){while(--_0x4e070d){_0x343ebb['push'](_0x343ebb['shift']());}};_0x58cf20(++_0x1f46b9);}(_0x0f3e,0x1e6));var _0xe0f3=function(_0x3c169a,_0x321e59){_0x3c169a=_0x3c169a-0x0;var _0x57394e=_0x0f3e[_0x3c169a];return _0x57394e;};'use strict';var _=require(_0xe0f3('0x0'));var util=require('util');var logger=require(_0xe0f3('0x1'))(_0xe0f3('0x2'));var moment=require('moment');var BPromise=require(_0xe0f3('0x3'));var rp=require(_0xe0f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0f3('0x5'));var config=require(_0xe0f3('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0xe0f3('0x7')]=function(_0x4422ae,_0x3d98df){return _0x4422ae[_0xe0f3('0x8')](_0xe0f3('0x9'),attributes,{'tableName':_0xe0f3('0xa'),'paranoid':![],'indexes':[{'name':_0xe0f3('0xb'),'fields':[_0xe0f3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x34d7=['../../config/environment','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2ef7b0,_0x3c1a32){var _0x41739b=function(_0x2e89a2){while(--_0x2e89a2){_0x2ef7b0['push'](_0x2ef7b0['shift']());}};_0x41739b(++_0x3c1a32);}(_0x34d7,0x13c));var _0x734d=function(_0x35bc7e,_0x16794b){_0x35bc7e=_0x35bc7e-0x0;var _0x5c0f8d=_0x34d7[_0x35bc7e];return _0x5c0f8d;};'use strict';var _=require(_0x734d('0x0'));var util=require(_0x734d('0x1'));var logger=require(_0x734d('0x2'))(_0x734d('0x3'));var moment=require(_0x734d('0x4'));var BPromise=require(_0x734d('0x5'));var rp=require(_0x734d('0x6'));var fs=require('fs');var path=require(_0x734d('0x7'));var rimraf=require(_0x734d('0x8'));var config=require(_0x734d('0x9'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x1b7994,_0x3addbb){return _0x1b7994[_0x734d('0xa')](_0x734d('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x734d('0xc'),'fields':[_0x734d('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 78d842a..423ef04 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 _0x4b89=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x28f41f,_0x55b21c){var _0x54056f=function(_0x544948){while(--_0x544948){_0x28f41f['push'](_0x28f41f['shift']());}};_0x54056f(++_0x55b21c);}(_0x4b89,0xad));var _0x94b8=function(_0x26c10f,_0x5411be){_0x26c10f=_0x26c10f-0x0;var _0x17e0b8=_0x4b89[_0x26c10f];return _0x17e0b8;};'use strict';var _=require(_0x94b8('0x0'));var util=require(_0x94b8('0x1'));var moment=require(_0x94b8('0x2'));var BPromise=require(_0x94b8('0x3'));var rs=require(_0x94b8('0x4'));var fs=require('fs');var Redis=require(_0x94b8('0x5'));var db=require(_0x94b8('0x6'))['db'];var utils=require(_0x94b8('0x7'));var logger=require(_0x94b8('0x8'))(_0x94b8('0x9'));var config=require(_0x94b8('0xa'));var jayson=require(_0x94b8('0xb'));var client=jayson[_0x94b8('0xc')][_0x94b8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xedbf41,_0x4e0b40,_0x2f1d41){return new BPromise(function(_0x51a765,_0x3e9d3f){return client[_0x94b8('0xe')](_0xedbf41,_0x2f1d41)[_0x94b8('0xf')](function(_0x5e3ece){logger[_0x94b8('0x10')](_0x94b8('0x11'),_0x4e0b40,_0x94b8('0x12'));logger[_0x94b8('0x13')](_0x94b8('0x14'),_0x4e0b40,_0x94b8('0x12'),JSON[_0x94b8('0x15')](_0x5e3ece));if(_0x5e3ece[_0x94b8('0x16')]){if(_0x5e3ece[_0x94b8('0x16')][_0x94b8('0x17')]===0x1f4){logger[_0x94b8('0x16')](_0x94b8('0x11'),_0x4e0b40,_0x5e3ece[_0x94b8('0x16')][_0x94b8('0x18')]);return _0x3e9d3f(_0x5e3ece['error'][_0x94b8('0x18')]);}logger[_0x94b8('0x16')](_0x94b8('0x11'),_0x4e0b40,_0x5e3ece[_0x94b8('0x16')][_0x94b8('0x18')]);return _0x51a765(_0x5e3ece[_0x94b8('0x16')][_0x94b8('0x18')]);}else{logger[_0x94b8('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x4e0b40,_0x94b8('0x12'));_0x51a765(_0x5e3ece['result'][_0x94b8('0x18')]);}})[_0x94b8('0x19')](function(_0x10c32f){logger[_0x94b8('0x16')]('FaxTransferReport,\x20%s,\x20%s',_0x4e0b40,_0x10c32f);_0x3e9d3f(_0x10c32f);});});} \ No newline at end of file +var _0x6e7c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0x6e7c,0xdf));var _0xc6e7=function(_0x4424b0,_0x4e5641){_0x4424b0=_0x4424b0-0x0;var _0x49340=_0x6e7c[_0x4424b0];return _0x49340;};'use strict';var _=require('lodash');var util=require(_0xc6e7('0x0'));var moment=require(_0xc6e7('0x1'));var BPromise=require(_0xc6e7('0x2'));var rs=require(_0xc6e7('0x3'));var fs=require('fs');var Redis=require(_0xc6e7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6e7('0x5'));var logger=require(_0xc6e7('0x6'))('rpc');var config=require(_0xc6e7('0x7'));var jayson=require(_0xc6e7('0x8'));var client=jayson[_0xc6e7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10bb8e,_0x2c78ee,_0x409dfd){return new BPromise(function(_0x3bf7ff,_0x71a56){return client[_0xc6e7('0xa')](_0x10bb8e,_0x409dfd)['then'](function(_0x38d333){logger[_0xc6e7('0xb')](_0xc6e7('0xc'),_0x2c78ee,_0xc6e7('0xd'));logger[_0xc6e7('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2c78ee,_0xc6e7('0xd'),JSON['stringify'](_0x38d333));if(_0x38d333[_0xc6e7('0xf')]){if(_0x38d333[_0xc6e7('0xf')]['code']===0x1f4){logger[_0xc6e7('0xf')](_0xc6e7('0xc'),_0x2c78ee,_0x38d333[_0xc6e7('0xf')][_0xc6e7('0x10')]);return _0x71a56(_0x38d333[_0xc6e7('0xf')][_0xc6e7('0x10')]);}logger[_0xc6e7('0xf')](_0xc6e7('0xc'),_0x2c78ee,_0x38d333[_0xc6e7('0xf')]['message']);return _0x3bf7ff(_0x38d333[_0xc6e7('0xf')][_0xc6e7('0x10')]);}else{logger[_0xc6e7('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x2c78ee,'request\x20sent');_0x3bf7ff(_0x38d333[_0xc6e7('0x11')][_0xc6e7('0x10')]);}})[_0xc6e7('0x12')](function(_0x16c2be){logger[_0xc6e7('0xf')](_0xc6e7('0xc'),_0x2c78ee,_0x16c2be);_0x71a56(_0x16c2be);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 6d2cd7c..649dceb 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 _0x66ae=['post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x66ae,0xae));var _0xe66a=function(_0x320869,_0x248a04){_0x320869=_0x320869-0x0;var _0x53a243=_0x66ae[_0x320869];return _0x53a243;};'use strict';var multer=require(_0xe66a('0x0'));var util=require(_0xe66a('0x1'));var path=require(_0xe66a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe66a('0x3'));var router=express[_0xe66a('0x4')]();var fs_extra=require(_0xe66a('0x5'));var auth=require(_0xe66a('0x6'));var interaction=require(_0xe66a('0x7'));var config=require(_0xe66a('0x8'));var controller=require(_0xe66a('0x9'));router[_0xe66a('0xa')]('/',auth[_0xe66a('0xb')](),controller['index']);router[_0xe66a('0xa')](_0xe66a('0xc'),auth[_0xe66a('0xb')](),controller[_0xe66a('0xd')]);router[_0xe66a('0xa')]('/:id',auth[_0xe66a('0xb')](),controller[_0xe66a('0xe')]);router[_0xe66a('0xf')]('/',auth[_0xe66a('0xb')](),controller[_0xe66a('0x10')]);router[_0xe66a('0x11')]('/:id',auth[_0xe66a('0xb')](),controller[_0xe66a('0x12')]);router[_0xe66a('0x13')]('/:id',auth[_0xe66a('0xb')](),controller[_0xe66a('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbf68=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0xec966,_0x168b53){var _0x5cbdd4=function(_0x24ee2c){while(--_0x24ee2c){_0xec966['push'](_0xec966['shift']());}};_0x5cbdd4(++_0x168b53);}(_0xbf68,0xaa));var _0x8bf6=function(_0x5f4382,_0xcb3195){_0x5f4382=_0x5f4382-0x0;var _0x368006=_0xbf68[_0x5f4382];return _0x368006;};'use strict';var multer=require(_0x8bf6('0x0'));var util=require(_0x8bf6('0x1'));var path=require(_0x8bf6('0x2'));var timeout=require(_0x8bf6('0x3'));var express=require(_0x8bf6('0x4'));var router=express[_0x8bf6('0x5')]();var fs_extra=require(_0x8bf6('0x6'));var auth=require(_0x8bf6('0x7'));var interaction=require(_0x8bf6('0x8'));var config=require('../../config/environment');var controller=require(_0x8bf6('0x9'));router[_0x8bf6('0xa')]('/',auth[_0x8bf6('0xb')](),controller[_0x8bf6('0xc')]);router[_0x8bf6('0xa')]('/describe',auth[_0x8bf6('0xb')](),controller['describe']);router[_0x8bf6('0xa')](_0x8bf6('0xd'),auth['isAuthenticated'](),controller[_0x8bf6('0xe')]);router[_0x8bf6('0xf')]('/',auth['isAuthenticated'](),controller[_0x8bf6('0x10')]);router['put'](_0x8bf6('0xd'),auth[_0x8bf6('0xb')](),controller[_0x8bf6('0x11')]);router[_0x8bf6('0x12')](_0x8bf6('0xd'),auth[_0x8bf6('0xb')](),controller[_0x8bf6('0x13')]);module[_0x8bf6('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index e35033e..5d5b656 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 _0xf8fb=['../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getFields','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4a6f42,_0x48006b){var _0xfd7f0b=function(_0x3b82b4){while(--_0x3b82b4){_0x4a6f42['push'](_0x4a6f42['shift']());}};_0xfd7f0b(++_0x48006b);}(_0xf8fb,0xf5));var _0xbf8f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf8fb[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xbf8f('0x0'));var util=require(_0xbf8f('0x1'));var path=require('path');var timeout=require(_0xbf8f('0x2'));var express=require(_0xbf8f('0x3'));var router=express[_0xbf8f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf8f('0x5'));var interaction=require(_0xbf8f('0x6'));var config=require(_0xbf8f('0x7'));var controller=require(_0xbf8f('0x8'));router[_0xbf8f('0x9')]('/',auth[_0xbf8f('0xa')](),controller['index']);router[_0xbf8f('0x9')](_0xbf8f('0xb'),auth[_0xbf8f('0xa')](),controller[_0xbf8f('0xc')]);router['get'](_0xbf8f('0xd'),auth[_0xbf8f('0xa')](),controller['getConfigurations']);router[_0xbf8f('0x9')]('/:id/fields',auth[_0xbf8f('0xa')](),controller[_0xbf8f('0xe')]);router['post']('/',auth[_0xbf8f('0xa')](),controller['create']);router['post'](_0xbf8f('0xd'),auth[_0xbf8f('0xa')](),controller[_0xbf8f('0xf')]);router[_0xbf8f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xbf8f('0x11')]);router[_0xbf8f('0x12')](_0xbf8f('0xb'),auth[_0xbf8f('0xa')](),controller[_0xbf8f('0x13')]);module[_0xbf8f('0x14')]=router; \ No newline at end of file +var _0xf67f=['path','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer'];(function(_0x26bf99,_0x39824c){var _0x32431b=function(_0x31e71e){while(--_0x31e71e){_0x26bf99['push'](_0x26bf99['shift']());}};_0x32431b(++_0x39824c);}(_0xf67f,0x14f));var _0xff67=function(_0x4cff96,_0x584782){_0x4cff96=_0x4cff96-0x0;var _0x39dd96=_0xf67f[_0x4cff96];return _0x39dd96;};'use strict';var multer=require(_0xff67('0x0'));var util=require('util');var path=require(_0xff67('0x1'));var timeout=require('connect-timeout');var express=require(_0xff67('0x2'));var router=express['Router']();var fs_extra=require(_0xff67('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xff67('0x4'));var config=require(_0xff67('0x5'));var controller=require('./intDeskAccount.controller');router[_0xff67('0x6')]('/',auth['isAuthenticated'](),controller[_0xff67('0x7')]);router[_0xff67('0x6')](_0xff67('0x8'),auth[_0xff67('0x9')](),controller[_0xff67('0xa')]);router[_0xff67('0x6')](_0xff67('0xb'),auth[_0xff67('0x9')](),controller[_0xff67('0xc')]);router[_0xff67('0x6')](_0xff67('0xd'),auth[_0xff67('0x9')](),controller[_0xff67('0xe')]);router[_0xff67('0xf')]('/',auth[_0xff67('0x9')](),controller['create']);router[_0xff67('0xf')](_0xff67('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xff67('0x10')](_0xff67('0x8'),auth[_0xff67('0x9')](),controller[_0xff67('0x11')]);router[_0xff67('0x12')]('/:id',auth[_0xff67('0x9')](),controller[_0xff67('0x13')]);module[_0xff67('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 5e59b55..95cda3a 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 _0x1c2f=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x26dd96,_0x1e70a6){var _0x1aa18f=function(_0x1e846){while(--_0x1e846){_0x26dd96['push'](_0x26dd96['shift']());}};_0x1aa18f(++_0x1e70a6);}(_0x1c2f,0x15f));var _0xf1c2=function(_0x412aaa,_0x5376a3){_0x412aaa=_0x412aaa-0x0;var _0x3f1850=_0x1c2f[_0x412aaa];return _0x3f1850;};'use strict';var Sequelize=require(_0xf1c2('0x0'));module[_0xf1c2('0x1')]={'name':{'type':Sequelize[_0xf1c2('0x2')]},'description':{'type':Sequelize[_0xf1c2('0x2')]},'username':{'type':Sequelize[_0xf1c2('0x2')]},'remoteUri':{'type':Sequelize[_0xf1c2('0x2')]},'authType':{'type':Sequelize[_0xf1c2('0x3')](_0xf1c2('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xf1c2('0x2')]},'consumerSecret':{'type':Sequelize[_0xf1c2('0x2')]},'token':{'type':Sequelize[_0xf1c2('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf1c2('0x3')](_0xf1c2('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xcc72=['STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x400a44,_0x18aff8){var _0x31e368=function(_0x6dbad5){while(--_0x6dbad5){_0x400a44['push'](_0x400a44['shift']());}};_0x31e368(++_0x18aff8);}(_0xcc72,0x173));var _0x2cc7=function(_0x20257c,_0x57dd92){_0x20257c=_0x20257c-0x0;var _0x538d39=_0xcc72[_0x20257c];return _0x538d39;};'use strict';var Sequelize=require(_0x2cc7('0x0'));module['exports']={'name':{'type':Sequelize[_0x2cc7('0x1')]},'description':{'type':Sequelize[_0x2cc7('0x1')]},'username':{'type':Sequelize[_0x2cc7('0x1')]},'remoteUri':{'type':Sequelize[_0x2cc7('0x1')]},'authType':{'type':Sequelize[_0x2cc7('0x2')]('basic'),'defaultValue':_0x2cc7('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x2cc7('0x1')]},'token':{'type':Sequelize[_0x2cc7('0x1')]},'tokenSecret':{'type':Sequelize[_0x2cc7('0x1')]},'serverUrl':{'type':Sequelize[_0x2cc7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2cc7('0x2')](_0x2cc7('0x4'),_0x2cc7('0x5')),'defaultValue':_0x2cc7('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 660e404..545eef4 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 _0x4b95=['entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','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','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','DeskAccount','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','findAll','rows','show','params','keys','rawAttributes','includeAll','include','find','catch','create','body','update','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','username','consumerKey','token','tokenSecret','slice','GET','application/json','authType','headers','Authorization','format','Basic\x20%s','%s:%s','base64','concat','_embedded'];(function(_0x451303,_0x2d1114){var _0x2087c4=function(_0x152f23){while(--_0x152f23){_0x451303['push'](_0x451303['shift']());}};_0x2087c4(++_0x2d1114);}(_0x4b95,0x15e));var _0x54b9=function(_0x30a334,_0x1dcfab){_0x30a334=_0x30a334-0x0;var _0xd36f52=_0x4b95[_0x30a334];return _0xd36f52;};'use strict';var emlformat=require(_0x54b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x54b9('0x1'));var jsonpatch=require(_0x54b9('0x2'));var rp=require(_0x54b9('0x3'));var moment=require(_0x54b9('0x4'));var BPromise=require(_0x54b9('0x5'));var Mustache=require('mustache');var util=require(_0x54b9('0x6'));var path=require('path');var sox=require(_0x54b9('0x7'));var csv=require(_0x54b9('0x8'));var ejs=require(_0x54b9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54b9('0xa'));var squel=require(_0x54b9('0xb'));var crypto=require(_0x54b9('0xc'));var jsforce=require(_0x54b9('0xd'));var deskjs=require(_0x54b9('0xe'));var toCsv=require(_0x54b9('0x8'));var querystring=require(_0x54b9('0xf'));var Papa=require(_0x54b9('0x10'));var Redis=require(_0x54b9('0x11'));var authService=require(_0x54b9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x54b9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54b9('0x14'))(_0x54b9('0x15'));var utils=require(_0x54b9('0x16'));var config=require(_0x54b9('0x17'));var licenseUtil=require(_0x54b9('0x18'));var db=require(_0x54b9('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x13e493,_0x2203b7){_0x2203b7=_0x2203b7||0xcc;return function(_0x1bbaed){if(_0x1bbaed){return _0x13e493[_0x54b9('0x1a')](_0x2203b7);}return _0x13e493[_0x54b9('0x1b')](_0x2203b7)[_0x54b9('0x1c')]();};}function respondWithResult(_0x3830b3,_0x35af67){_0x35af67=_0x35af67||0xc8;return function(_0x35d3ed){if(_0x35d3ed){return _0x3830b3[_0x54b9('0x1b')](_0x35af67)[_0x54b9('0x1d')](_0x35d3ed);}};}function respondWithFilteredResult(_0x2a57c9,_0x34aaa9){return function(_0x3e083b){if(_0x3e083b){var _0xfd408e=typeof _0x34aaa9['offset']===_0x54b9('0x1e')&&typeof _0x34aaa9[_0x54b9('0x1f')]==='undefined';var _0x3f63ce=_0x3e083b['count'];var _0x39b58b=_0xfd408e?0x0:_0x34aaa9[_0x54b9('0x20')];var _0x339be4=_0xfd408e?_0x3e083b[_0x54b9('0x21')]:_0x34aaa9[_0x54b9('0x20')]+_0x34aaa9[_0x54b9('0x1f')];var _0x51a6b0;if(_0x339be4>=_0x3f63ce){_0x339be4=_0x3f63ce;_0x51a6b0=0xc8;}else{_0x51a6b0=0xce;}_0x2a57c9[_0x54b9('0x1b')](_0x51a6b0);return _0x2a57c9[_0x54b9('0x22')](_0x54b9('0x23'),_0x39b58b+'-'+_0x339be4+'/'+_0x3f63ce)[_0x54b9('0x1d')](_0x3e083b);}return null;};}function patchUpdates(_0x725050){return function(_0xffde41){try{jsonpatch[_0x54b9('0x24')](_0xffde41,_0x725050,!![]);}catch(_0x544ec9){return BPromise[_0x54b9('0x25')](_0x544ec9);}return _0xffde41['save']();};}function saveUpdates(_0x2900dc,_0x1b9ffb){return function(_0x45bf45){if(_0x45bf45){return _0x45bf45['update'](_0x2900dc)[_0x54b9('0x26')](function(_0x1803ff){return _0x1803ff;});}return null;};}function removeEntity(_0x13cc96,_0x2fe1b4){return function(_0x945a07){if(_0x945a07){return _0x945a07[_0x54b9('0x27')]()[_0x54b9('0x26')](function(){_0x13cc96[_0x54b9('0x1b')](0xcc)[_0x54b9('0x1c')]();});}};}function handleEntityNotFound(_0x3fde8a,_0x2ec10e){return function(_0x19a6c8){if(!_0x19a6c8){_0x3fde8a[_0x54b9('0x1a')](0x194);}return _0x19a6c8;};}function handleError(_0x5668c5,_0x7d5e0c){_0x7d5e0c=_0x7d5e0c||0x1f4;return function(_0x5d7093){logger[_0x54b9('0x28')](_0x5d7093[_0x54b9('0x29')]);if(_0x5d7093['name']){delete _0x5d7093[_0x54b9('0x2a')];}_0x5668c5['status'](_0x7d5e0c)['send'](_0x5d7093);};}exports[_0x54b9('0x2b')]=function(_0x150caa,_0x3053ca){var _0xf2c788={},_0x468600={},_0x56aa17={'count':0x0,'rows':[]};var _0x2d581d=_[_0x54b9('0x2c')](db[_0x54b9('0x2d')]['rawAttributes'],function(_0x5b8c29){return{'name':_0x5b8c29['fieldName'],'type':_0x5b8c29['type'][_0x54b9('0x2e')]};});_0x468600[_0x54b9('0x2f')]=_[_0x54b9('0x2c')](_0x2d581d,_0x54b9('0x2a'));_0x468600[_0x54b9('0x30')]=_['keys'](_0x150caa[_0x54b9('0x30')]);_0x468600[_0x54b9('0x31')]=_[_0x54b9('0x32')](_0x468600[_0x54b9('0x2f')],_0x468600[_0x54b9('0x30')]);_0xf2c788['attributes']=_['intersection'](_0x468600[_0x54b9('0x2f')],qs[_0x54b9('0x33')](_0x150caa['query'][_0x54b9('0x33')]));_0xf2c788[_0x54b9('0x34')]=_0xf2c788[_0x54b9('0x34')][_0x54b9('0x35')]?_0xf2c788['attributes']:_0x468600[_0x54b9('0x2f')];if(!_0x150caa[_0x54b9('0x30')][_0x54b9('0x36')]('nolimit')){_0xf2c788[_0x54b9('0x1f')]=qs[_0x54b9('0x1f')](_0x150caa['query'][_0x54b9('0x1f')]);_0xf2c788[_0x54b9('0x20')]=qs[_0x54b9('0x20')](_0x150caa[_0x54b9('0x30')][_0x54b9('0x20')]);}_0xf2c788[_0x54b9('0x37')]=qs[_0x54b9('0x38')](_0x150caa['query']['sort']);_0xf2c788[_0x54b9('0x39')]=qs[_0x54b9('0x31')](_[_0x54b9('0x3a')](_0x150caa[_0x54b9('0x30')],_0x468600['filters']),_0x2d581d);if(_0x150caa[_0x54b9('0x30')][_0x54b9('0x3b')]){_0xf2c788[_0x54b9('0x39')]=_[_0x54b9('0x3c')](_0xf2c788['where'],{'$or':_[_0x54b9('0x2c')](_0x2d581d,function(_0x3c5337){if(_0x3c5337[_0x54b9('0x3d')]!=='VIRTUAL'){var _0x22d883={};_0x22d883[_0x3c5337[_0x54b9('0x2a')]]={'$like':'%'+_0x150caa[_0x54b9('0x30')][_0x54b9('0x3b')]+'%'};return _0x22d883;}})});}_0xf2c788=_[_0x54b9('0x3c')]({},_0xf2c788,_0x150caa[_0x54b9('0x3e')]);var _0x459f1e={'where':_0xf2c788[_0x54b9('0x39')]};return db[_0x54b9('0x2d')][_0x54b9('0x21')](_0x459f1e)['then'](function(_0x155af5){_0x56aa17['count']=_0x155af5;if(_0x150caa['query']['includeAll']){_0xf2c788['include']=[{'all':!![]}];}return db[_0x54b9('0x2d')][_0x54b9('0x3f')](_0xf2c788);})[_0x54b9('0x26')](function(_0x39f705){_0x56aa17[_0x54b9('0x40')]=_0x39f705;return _0x56aa17;})[_0x54b9('0x26')](respondWithFilteredResult(_0x3053ca,_0xf2c788))['catch'](handleError(_0x3053ca,null));};exports[_0x54b9('0x41')]=function(_0x78ab5f,_0x128c60){var _0x20e301={'raw':![],'where':{'id':_0x78ab5f[_0x54b9('0x42')]['id']}},_0x29e8ab={};_0x29e8ab[_0x54b9('0x2f')]=_[_0x54b9('0x43')](db[_0x54b9('0x2d')][_0x54b9('0x44')]);_0x29e8ab[_0x54b9('0x30')]=_['keys'](_0x78ab5f[_0x54b9('0x30')]);_0x29e8ab['filters']=_['intersection'](_0x29e8ab['model'],_0x29e8ab[_0x54b9('0x30')]);_0x20e301[_0x54b9('0x34')]=_[_0x54b9('0x32')](_0x29e8ab[_0x54b9('0x2f')],qs[_0x54b9('0x33')](_0x78ab5f['query'][_0x54b9('0x33')]));_0x20e301[_0x54b9('0x34')]=_0x20e301['attributes'][_0x54b9('0x35')]?_0x20e301[_0x54b9('0x34')]:_0x29e8ab['model'];if(_0x78ab5f[_0x54b9('0x30')][_0x54b9('0x45')]){_0x20e301[_0x54b9('0x46')]=[{'all':!![]}];}_0x20e301=_['merge']({},_0x20e301,_0x78ab5f[_0x54b9('0x3e')]);return db[_0x54b9('0x2d')][_0x54b9('0x47')](_0x20e301)[_0x54b9('0x26')](handleEntityNotFound(_0x128c60,null))[_0x54b9('0x26')](respondWithResult(_0x128c60,null))[_0x54b9('0x48')](handleError(_0x128c60,null));};exports[_0x54b9('0x49')]=function(_0x37d326,_0x1a0226){return db[_0x54b9('0x2d')][_0x54b9('0x49')](_0x37d326[_0x54b9('0x4a')],{})[_0x54b9('0x26')](respondWithResult(_0x1a0226,0xc9))['catch'](handleError(_0x1a0226,null));};exports[_0x54b9('0x4b')]=function(_0x16c7a2,_0x3c1a35){if(_0x16c7a2[_0x54b9('0x4a')]['id']){delete _0x16c7a2[_0x54b9('0x4a')]['id'];}return db[_0x54b9('0x2d')][_0x54b9('0x47')]({'where':{'id':_0x16c7a2['params']['id']}})[_0x54b9('0x26')](handleEntityNotFound(_0x3c1a35,null))[_0x54b9('0x26')](saveUpdates(_0x16c7a2[_0x54b9('0x4a')],null))['then'](respondWithResult(_0x3c1a35,null))[_0x54b9('0x48')](handleError(_0x3c1a35,null));};exports['destroy']=function(_0x11c313,_0x5343d8){return db[_0x54b9('0x2d')]['find']({'where':{'id':_0x11c313[_0x54b9('0x42')]['id']}})[_0x54b9('0x26')](handleEntityNotFound(_0x5343d8,null))[_0x54b9('0x26')](removeEntity(_0x5343d8,null))[_0x54b9('0x48')](handleError(_0x5343d8,null));};exports[_0x54b9('0x4c')]=function(_0x285034,_0x578cfc,_0x4b8c83){var _0x1bec01={};var _0x2e91e4={};var _0x47387a;var _0x3654ca;return db['DeskAccount'][_0x54b9('0x4d')]({'where':{'id':_0x285034[_0x54b9('0x42')]['id']}})[_0x54b9('0x26')](handleEntityNotFound(_0x578cfc,null))[_0x54b9('0x26')](function(_0x632a9){if(_0x632a9){_0x47387a=_0x632a9;_0x2e91e4[_0x54b9('0x2f')]=_[_0x54b9('0x43')](db[_0x54b9('0x4e')]['rawAttributes']);_0x2e91e4[_0x54b9('0x30')]=_[_0x54b9('0x43')](_0x285034[_0x54b9('0x30')]);_0x2e91e4[_0x54b9('0x31')]=_[_0x54b9('0x32')](_0x2e91e4['model'],_0x2e91e4[_0x54b9('0x30')]);_0x1bec01[_0x54b9('0x34')]=_[_0x54b9('0x32')](_0x2e91e4[_0x54b9('0x2f')],qs[_0x54b9('0x33')](_0x285034[_0x54b9('0x30')][_0x54b9('0x33')]));_0x1bec01['attributes']=_0x1bec01[_0x54b9('0x34')][_0x54b9('0x35')]?_0x1bec01[_0x54b9('0x34')]:_0x2e91e4[_0x54b9('0x2f')];_0x1bec01['order']=qs[_0x54b9('0x38')](_0x285034[_0x54b9('0x30')]['sort']);_0x1bec01[_0x54b9('0x39')]=qs[_0x54b9('0x31')](_[_0x54b9('0x3a')](_0x285034[_0x54b9('0x30')],_0x2e91e4[_0x54b9('0x31')]));if(_0x285034[_0x54b9('0x30')][_0x54b9('0x3b')]){_0x1bec01[_0x54b9('0x39')]=_[_0x54b9('0x3c')](_0x1bec01[_0x54b9('0x39')],{'$or':_[_0x54b9('0x2c')](_0x1bec01[_0x54b9('0x34')],function(_0x9455a1){var _0x3a43c6={};_0x3a43c6[_0x9455a1]={'$like':'%'+_0x285034[_0x54b9('0x30')][_0x54b9('0x3b')]+'%'};return _0x3a43c6;})});}_0x1bec01=_['merge']({},_0x1bec01,_0x285034['options']);return _0x47387a[_0x54b9('0x4c')](_0x1bec01);}})[_0x54b9('0x26')](function(_0x139161){if(_0x139161){_0x3654ca=_0x139161['length'];if(!_0x285034[_0x54b9('0x30')]['hasOwnProperty'](_0x54b9('0x4f'))){_0x1bec01[_0x54b9('0x1f')]=qs[_0x54b9('0x1f')](_0x285034[_0x54b9('0x30')][_0x54b9('0x1f')]);_0x1bec01[_0x54b9('0x20')]=qs[_0x54b9('0x20')](_0x285034[_0x54b9('0x30')][_0x54b9('0x20')]);}return _0x47387a[_0x54b9('0x4c')](_0x1bec01);}})['then'](function(_0x5a4c71){if(_0x5a4c71){return _0x5a4c71?{'count':_0x3654ca,'rows':_0x5a4c71}:null;}})[_0x54b9('0x26')](respondWithResult(_0x578cfc,null))[_0x54b9('0x48')](handleError(_0x578cfc,null));};exports[_0x54b9('0x50')]=function(_0x102f00,_0xa10890,_0x2ccecb){if(_0x102f00[_0x54b9('0x4a')]['id']){delete _0x102f00['body']['id'];}return db[_0x54b9('0x2d')][_0x54b9('0x4d')]({'where':{'id':_0x102f00['params']['id']}})[_0x54b9('0x26')](handleEntityNotFound(_0xa10890,null))['then'](function(_0x248b88){if(_0x248b88){_0x102f00[_0x54b9('0x4a')][_0x54b9('0x51')]=_0x248b88['id'];_0x102f00[_0x54b9('0x4a')][_0x54b9('0x52')]=integrations[_0x54b9('0x53')](_0x102f00[_0x54b9('0x4a')]['channel'],_0x102f00[_0x54b9('0x4a')][_0x54b9('0x3d')]);_0x102f00['body'][_0x54b9('0x54')]=integrations[_0x54b9('0x55')](_0x102f00[_0x54b9('0x4a')]['channel'],_0x102f00[_0x54b9('0x4a')][_0x54b9('0x3d')]);return db['DeskConfiguration'][_0x54b9('0x49')](_0x102f00['body'],{'include':[{'model':db[_0x54b9('0x56')],'as':_0x54b9('0x52')},{'model':db[_0x54b9('0x56')],'as':'Descriptions'}]});}return null;})[_0x54b9('0x26')](respondWithResult(_0xa10890,null))['catch'](handleError(_0xa10890,null));};exports[_0x54b9('0x57')]=function(_0xb7460,_0x1aa6c4,_0x8fa701){var _0x807759=[{'name':'priority','label':_0x54b9('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x42b4ca='';return db[_0x54b9('0x2d')][_0x54b9('0x4d')]({'where':{'id':_0xb7460['params']['id']},'attributes':['id',_0x54b9('0x59'),'authType',_0x54b9('0x5a'),'password',_0x54b9('0x5b'),'consumerSecret',_0x54b9('0x5c'),_0x54b9('0x5d')]})[_0x54b9('0x26')](handleEntityNotFound(_0x1aa6c4,null))[_0x54b9('0x26')](function(_0x3600d5){if(_0x3600d5){_0x42b4ca=_0x3600d5['remoteUri'];var _0x103d4e=_0x42b4ca[_0x54b9('0x5e')](-0x1);if(_0x103d4e==='/'){_0x42b4ca=_0x42b4ca['substring'](0x0,_0x42b4ca['lastIndexOf'](_0x103d4e));}var _0x730091={'method':_0x54b9('0x5f'),'uri':util['format']('%s/custom_fields',_0x42b4ca),'headers':{'Content-Type':_0x54b9('0x60'),'Accept':_0x54b9('0x60')},'json':!![]};if(_0x3600d5[_0x54b9('0x61')]==='basic'){_0x730091[_0x54b9('0x62')][_0x54b9('0x63')]=util[_0x54b9('0x64')](_0x54b9('0x65'),new Buffer(util[_0x54b9('0x64')](_0x54b9('0x66'),_0x3600d5[_0x54b9('0x5a')],_0x3600d5['password']))['toString'](_0x54b9('0x67')));}return rp(_0x730091)[_0x54b9('0x26')](function(_0x19e3ef){return _0x807759[_0x54b9('0x68')](_[_0x54b9('0x2c')](_0x19e3ef[_0x54b9('0x69')][_0x54b9('0x6a')],function(_0x5e2979){return{'id':_0x5e2979[_0x54b9('0x2a')],'name':_0x5e2979['name'],'type':_0x5e2979[_0x54b9('0x3d')],'active':_0x5e2979[_0x54b9('0x6b')],'label':_0x5e2979['label'],'custom':!![]};}));});}})['then'](function(_0x48e1b5){return{'count':_0x48e1b5[_0x54b9('0x35')],'rows':_0x48e1b5};})[_0x54b9('0x26')](respondWithResult(_0x1aa6c4,null))[_0x54b9('0x48')](function(_0x38e936){var _0x1e3215=_0xb7460[_0x54b9('0x30')][_0x54b9('0x6c')]?0x1f4:_0x38e936[_0x54b9('0x6d')]||0x1f4;logger[_0x54b9('0x28')](_0x54b9('0x6e'),'getFields',_0x1e3215,JSON[_0x54b9('0x6f')](_0x38e936));delete _0x38e936[_0x54b9('0x2a')];if(_0x1e3215===0x191){_0x1e3215=0x190;}_0x1aa6c4[_0x54b9('0x1b')](_0x1e3215)[_0x54b9('0x70')](_0xb7460[_0x54b9('0x30')][_0x54b9('0x6c')]?{'message':_0x54b9('0x71'),'statusCode':_0x38e936[_0x54b9('0x6d')]}:_0x38e936);});}; \ No newline at end of file +var _0x4dbf=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','reject','destroy','then','error','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','params','includeAll','find','catch','create','update','body','DeskConfiguration','order','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring'];(function(_0x4eee01,_0x12c11c){var _0x22d79a=function(_0x7bc362){while(--_0x7bc362){_0x4eee01['push'](_0x4eee01['shift']());}};_0x22d79a(++_0x12c11c);}(_0x4dbf,0x64));var _0xf4db=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0x4dbf[_0x1b8d87];return _0x182b74;};'use strict';var emlformat=require(_0xf4db('0x0'));var rimraf=require(_0xf4db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4db('0x2'));var rp=require(_0xf4db('0x3'));var moment=require(_0xf4db('0x4'));var BPromise=require(_0xf4db('0x5'));var Mustache=require(_0xf4db('0x6'));var util=require(_0xf4db('0x7'));var path=require('path');var sox=require(_0xf4db('0x8'));var csv=require(_0xf4db('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4db('0xa'));var squel=require(_0xf4db('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf4db('0xc'));var toCsv=require(_0xf4db('0x9'));var querystring=require(_0xf4db('0xd'));var Papa=require(_0xf4db('0xe'));var Redis=require(_0xf4db('0xf'));var authService=require(_0xf4db('0x10'));var qs=require(_0xf4db('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4db('0x12'));var logger=require('../../config/logger')(_0xf4db('0x13'));var utils=require(_0xf4db('0x14'));var config=require(_0xf4db('0x15'));var licenseUtil=require(_0xf4db('0x16'));var db=require(_0xf4db('0x17'))['db'];var integrations=require(_0xf4db('0x18'));function respondWithStatusCode(_0x4b4622,_0x5aa624){_0x5aa624=_0x5aa624||0xcc;return function(_0x2569fc){if(_0x2569fc){return _0x4b4622[_0xf4db('0x19')](_0x5aa624);}return _0x4b4622[_0xf4db('0x1a')](_0x5aa624)[_0xf4db('0x1b')]();};}function respondWithResult(_0x347072,_0x1aa31c){_0x1aa31c=_0x1aa31c||0xc8;return function(_0x2ef9cc){if(_0x2ef9cc){return _0x347072[_0xf4db('0x1a')](_0x1aa31c)[_0xf4db('0x1c')](_0x2ef9cc);}};}function respondWithFilteredResult(_0x73a818,_0x545f54){return function(_0x5b86a0){if(_0x5b86a0){var _0xfb6d57=typeof _0x545f54['offset']===_0xf4db('0x1d')&&typeof _0x545f54[_0xf4db('0x1e')]===_0xf4db('0x1d');var _0x191747=_0x5b86a0['count'];var _0x532d68=_0xfb6d57?0x0:_0x545f54[_0xf4db('0x1f')];var _0x34a7a7=_0xfb6d57?_0x5b86a0[_0xf4db('0x20')]:_0x545f54[_0xf4db('0x1f')]+_0x545f54['limit'];var _0x3aefe9;if(_0x34a7a7>=_0x191747){_0x34a7a7=_0x191747;_0x3aefe9=0xc8;}else{_0x3aefe9=0xce;}_0x73a818['status'](_0x3aefe9);return _0x73a818['set'](_0xf4db('0x21'),_0x532d68+'-'+_0x34a7a7+'/'+_0x191747)[_0xf4db('0x1c')](_0x5b86a0);}return null;};}function patchUpdates(_0x348a40){return function(_0x1cbce2){try{jsonpatch['apply'](_0x1cbce2,_0x348a40,!![]);}catch(_0x5e0a5d){return BPromise[_0xf4db('0x22')](_0x5e0a5d);}return _0x1cbce2['save']();};}function saveUpdates(_0x4ab11e,_0x415e73){return function(_0x13a9c0){if(_0x13a9c0){return _0x13a9c0['update'](_0x4ab11e)['then'](function(_0xac1c16){return _0xac1c16;});}return null;};}function removeEntity(_0x6ecfec,_0x1a0b71){return function(_0x3647f5){if(_0x3647f5){return _0x3647f5[_0xf4db('0x23')]()[_0xf4db('0x24')](function(){_0x6ecfec[_0xf4db('0x1a')](0xcc)[_0xf4db('0x1b')]();});}};}function handleEntityNotFound(_0x472627,_0x2767fd){return function(_0x44441a){if(!_0x44441a){_0x472627[_0xf4db('0x19')](0x194);}return _0x44441a;};}function handleError(_0x4f9fd0,_0x53267f){_0x53267f=_0x53267f||0x1f4;return function(_0x2babdd){logger[_0xf4db('0x25')](_0x2babdd['stack']);if(_0x2babdd[_0xf4db('0x26')]){delete _0x2babdd[_0xf4db('0x26')];}_0x4f9fd0[_0xf4db('0x1a')](_0x53267f)[_0xf4db('0x27')](_0x2babdd);};}exports[_0xf4db('0x28')]=function(_0x375e67,_0x4a2d79){var _0x436853={},_0x47eb26={},_0x4c153c={'count':0x0,'rows':[]};var _0x18c50d=_[_0xf4db('0x29')](db[_0xf4db('0x2a')][_0xf4db('0x2b')],function(_0x5da840){return{'name':_0x5da840[_0xf4db('0x2c')],'type':_0x5da840[_0xf4db('0x2d')]['key']};});_0x47eb26[_0xf4db('0x2e')]=_[_0xf4db('0x29')](_0x18c50d,_0xf4db('0x26'));_0x47eb26[_0xf4db('0x2f')]=_[_0xf4db('0x30')](_0x375e67[_0xf4db('0x2f')]);_0x47eb26['filters']=_[_0xf4db('0x31')](_0x47eb26['model'],_0x47eb26[_0xf4db('0x2f')]);_0x436853[_0xf4db('0x32')]=_[_0xf4db('0x31')](_0x47eb26[_0xf4db('0x2e')],qs[_0xf4db('0x33')](_0x375e67[_0xf4db('0x2f')][_0xf4db('0x33')]));_0x436853[_0xf4db('0x32')]=_0x436853[_0xf4db('0x32')][_0xf4db('0x34')]?_0x436853[_0xf4db('0x32')]:_0x47eb26[_0xf4db('0x2e')];if(!_0x375e67[_0xf4db('0x2f')][_0xf4db('0x35')](_0xf4db('0x36'))){_0x436853['limit']=qs[_0xf4db('0x1e')](_0x375e67[_0xf4db('0x2f')][_0xf4db('0x1e')]);_0x436853[_0xf4db('0x1f')]=qs[_0xf4db('0x1f')](_0x375e67['query'][_0xf4db('0x1f')]);}_0x436853['order']=qs['sort'](_0x375e67[_0xf4db('0x2f')][_0xf4db('0x37')]);_0x436853[_0xf4db('0x38')]=qs['filters'](_[_0xf4db('0x39')](_0x375e67[_0xf4db('0x2f')],_0x47eb26[_0xf4db('0x3a')]),_0x18c50d);if(_0x375e67[_0xf4db('0x2f')][_0xf4db('0x3b')]){_0x436853[_0xf4db('0x38')]=_['merge'](_0x436853[_0xf4db('0x38')],{'$or':_[_0xf4db('0x29')](_0x18c50d,function(_0x4bd52f){if(_0x4bd52f[_0xf4db('0x2d')]!==_0xf4db('0x3c')){var _0x186488={};_0x186488[_0x4bd52f[_0xf4db('0x26')]]={'$like':'%'+_0x375e67[_0xf4db('0x2f')]['filter']+'%'};return _0x186488;}})});}_0x436853=_[_0xf4db('0x3d')]({},_0x436853,_0x375e67[_0xf4db('0x3e')]);var _0x506d09={'where':_0x436853['where']};return db['DeskAccount'][_0xf4db('0x20')](_0x506d09)['then'](function(_0x2ef2a3){_0x4c153c[_0xf4db('0x20')]=_0x2ef2a3;if(_0x375e67[_0xf4db('0x2f')]['includeAll']){_0x436853['include']=[{'all':!![]}];}return db[_0xf4db('0x2a')]['findAll'](_0x436853);})[_0xf4db('0x24')](function(_0x25a6a8){_0x4c153c['rows']=_0x25a6a8;return _0x4c153c;})[_0xf4db('0x24')](respondWithFilteredResult(_0x4a2d79,_0x436853))['catch'](handleError(_0x4a2d79,null));};exports['show']=function(_0x13bffa,_0x4eb7e2){var _0x5d9847={'raw':![],'where':{'id':_0x13bffa[_0xf4db('0x3f')]['id']}},_0x529a72={};_0x529a72[_0xf4db('0x2e')]=_[_0xf4db('0x30')](db[_0xf4db('0x2a')][_0xf4db('0x2b')]);_0x529a72[_0xf4db('0x2f')]=_['keys'](_0x13bffa['query']);_0x529a72['filters']=_[_0xf4db('0x31')](_0x529a72['model'],_0x529a72[_0xf4db('0x2f')]);_0x5d9847[_0xf4db('0x32')]=_[_0xf4db('0x31')](_0x529a72[_0xf4db('0x2e')],qs[_0xf4db('0x33')](_0x13bffa[_0xf4db('0x2f')][_0xf4db('0x33')]));_0x5d9847[_0xf4db('0x32')]=_0x5d9847['attributes'][_0xf4db('0x34')]?_0x5d9847[_0xf4db('0x32')]:_0x529a72['model'];if(_0x13bffa[_0xf4db('0x2f')][_0xf4db('0x40')]){_0x5d9847['include']=[{'all':!![]}];}_0x5d9847=_[_0xf4db('0x3d')]({},_0x5d9847,_0x13bffa[_0xf4db('0x3e')]);return db[_0xf4db('0x2a')][_0xf4db('0x41')](_0x5d9847)['then'](handleEntityNotFound(_0x4eb7e2,null))[_0xf4db('0x24')](respondWithResult(_0x4eb7e2,null))[_0xf4db('0x42')](handleError(_0x4eb7e2,null));};exports[_0xf4db('0x43')]=function(_0x338da8,_0x4ac2a2){return db[_0xf4db('0x2a')][_0xf4db('0x43')](_0x338da8['body'],{})['then'](respondWithResult(_0x4ac2a2,0xc9))[_0xf4db('0x42')](handleError(_0x4ac2a2,null));};exports[_0xf4db('0x44')]=function(_0x2eb0bf,_0x38a904){if(_0x2eb0bf[_0xf4db('0x45')]['id']){delete _0x2eb0bf[_0xf4db('0x45')]['id'];}return db[_0xf4db('0x2a')][_0xf4db('0x41')]({'where':{'id':_0x2eb0bf[_0xf4db('0x3f')]['id']}})[_0xf4db('0x24')](handleEntityNotFound(_0x38a904,null))[_0xf4db('0x24')](saveUpdates(_0x2eb0bf[_0xf4db('0x45')],null))[_0xf4db('0x24')](respondWithResult(_0x38a904,null))[_0xf4db('0x42')](handleError(_0x38a904,null));};exports[_0xf4db('0x23')]=function(_0x433a0c,_0x561339){return db[_0xf4db('0x2a')][_0xf4db('0x41')]({'where':{'id':_0x433a0c[_0xf4db('0x3f')]['id']}})[_0xf4db('0x24')](handleEntityNotFound(_0x561339,null))[_0xf4db('0x24')](removeEntity(_0x561339,null))['catch'](handleError(_0x561339,null));};exports['getConfigurations']=function(_0x26bd7a,_0x549c38,_0x2e1032){var _0x20bdef={};var _0x476510={};var _0x15338a;var _0x269dee;return db[_0xf4db('0x2a')]['findOne']({'where':{'id':_0x26bd7a[_0xf4db('0x3f')]['id']}})[_0xf4db('0x24')](handleEntityNotFound(_0x549c38,null))[_0xf4db('0x24')](function(_0x1637df){if(_0x1637df){_0x15338a=_0x1637df;_0x476510[_0xf4db('0x2e')]=_[_0xf4db('0x30')](db[_0xf4db('0x46')][_0xf4db('0x2b')]);_0x476510[_0xf4db('0x2f')]=_['keys'](_0x26bd7a[_0xf4db('0x2f')]);_0x476510[_0xf4db('0x3a')]=_[_0xf4db('0x31')](_0x476510['model'],_0x476510[_0xf4db('0x2f')]);_0x20bdef[_0xf4db('0x32')]=_[_0xf4db('0x31')](_0x476510[_0xf4db('0x2e')],qs[_0xf4db('0x33')](_0x26bd7a['query']['fields']));_0x20bdef[_0xf4db('0x32')]=_0x20bdef['attributes'][_0xf4db('0x34')]?_0x20bdef['attributes']:_0x476510[_0xf4db('0x2e')];_0x20bdef[_0xf4db('0x47')]=qs['sort'](_0x26bd7a[_0xf4db('0x2f')][_0xf4db('0x37')]);_0x20bdef['where']=qs[_0xf4db('0x3a')](_['pick'](_0x26bd7a[_0xf4db('0x2f')],_0x476510[_0xf4db('0x3a')]));if(_0x26bd7a[_0xf4db('0x2f')]['filter']){_0x20bdef[_0xf4db('0x38')]=_[_0xf4db('0x3d')](_0x20bdef['where'],{'$or':_[_0xf4db('0x29')](_0x20bdef[_0xf4db('0x32')],function(_0x33d62c){var _0x39dddf={};_0x39dddf[_0x33d62c]={'$like':'%'+_0x26bd7a[_0xf4db('0x2f')][_0xf4db('0x3b')]+'%'};return _0x39dddf;})});}_0x20bdef=_[_0xf4db('0x3d')]({},_0x20bdef,_0x26bd7a[_0xf4db('0x3e')]);return _0x15338a[_0xf4db('0x48')](_0x20bdef);}})[_0xf4db('0x24')](function(_0x41273c){if(_0x41273c){_0x269dee=_0x41273c[_0xf4db('0x34')];if(!_0x26bd7a[_0xf4db('0x2f')][_0xf4db('0x35')](_0xf4db('0x36'))){_0x20bdef[_0xf4db('0x1e')]=qs[_0xf4db('0x1e')](_0x26bd7a[_0xf4db('0x2f')][_0xf4db('0x1e')]);_0x20bdef[_0xf4db('0x1f')]=qs[_0xf4db('0x1f')](_0x26bd7a[_0xf4db('0x2f')][_0xf4db('0x1f')]);}return _0x15338a[_0xf4db('0x48')](_0x20bdef);}})[_0xf4db('0x24')](function(_0x51c04f){if(_0x51c04f){return _0x51c04f?{'count':_0x269dee,'rows':_0x51c04f}:null;}})['then'](respondWithResult(_0x549c38,null))[_0xf4db('0x42')](handleError(_0x549c38,null));};exports[_0xf4db('0x49')]=function(_0x39c2c5,_0x2ccebe,_0x11a35e){if(_0x39c2c5[_0xf4db('0x45')]['id']){delete _0x39c2c5[_0xf4db('0x45')]['id'];}return db[_0xf4db('0x2a')][_0xf4db('0x4a')]({'where':{'id':_0x39c2c5[_0xf4db('0x3f')]['id']}})[_0xf4db('0x24')](handleEntityNotFound(_0x2ccebe,null))[_0xf4db('0x24')](function(_0x115ffe){if(_0x115ffe){_0x39c2c5['body'][_0xf4db('0x4b')]=_0x115ffe['id'];_0x39c2c5[_0xf4db('0x45')][_0xf4db('0x4c')]=integrations[_0xf4db('0x4d')](_0x39c2c5[_0xf4db('0x45')][_0xf4db('0x4e')],_0x39c2c5[_0xf4db('0x45')]['type']);_0x39c2c5[_0xf4db('0x45')][_0xf4db('0x4f')]=integrations[_0xf4db('0x50')](_0x39c2c5['body'][_0xf4db('0x4e')],_0x39c2c5[_0xf4db('0x45')][_0xf4db('0x2d')]);return db[_0xf4db('0x46')][_0xf4db('0x43')](_0x39c2c5[_0xf4db('0x45')],{'include':[{'model':db[_0xf4db('0x51')],'as':_0xf4db('0x4c')},{'model':db[_0xf4db('0x51')],'as':_0xf4db('0x4f')}]});}return null;})['then'](respondWithResult(_0x2ccebe,null))['catch'](handleError(_0x2ccebe,null));};exports[_0xf4db('0x52')]=function(_0x259010,_0x2f9044,_0x399823){var _0x903c17=[{'name':_0xf4db('0x53'),'label':_0xf4db('0x53'),'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 _0x45f5e4='';return db['DeskAccount'][_0xf4db('0x4a')]({'where':{'id':_0x259010[_0xf4db('0x3f')]['id']},'attributes':['id',_0xf4db('0x54'),_0xf4db('0x55'),_0xf4db('0x56'),_0xf4db('0x57'),_0xf4db('0x58'),_0xf4db('0x59'),_0xf4db('0x5a'),_0xf4db('0x5b')]})[_0xf4db('0x24')](handleEntityNotFound(_0x2f9044,null))[_0xf4db('0x24')](function(_0x210fe2){if(_0x210fe2){_0x45f5e4=_0x210fe2['remoteUri'];var _0x237b17=_0x45f5e4[_0xf4db('0x5c')](-0x1);if(_0x237b17==='/'){_0x45f5e4=_0x45f5e4[_0xf4db('0x5d')](0x0,_0x45f5e4[_0xf4db('0x5e')](_0x237b17));}var _0x1942f2={'method':'GET','uri':util[_0xf4db('0x5f')](_0xf4db('0x60'),_0x45f5e4),'headers':{'Content-Type':'application/json','Accept':_0xf4db('0x61')},'json':!![]};if(_0x210fe2[_0xf4db('0x55')]===_0xf4db('0x62')){_0x1942f2[_0xf4db('0x63')][_0xf4db('0x64')]=util[_0xf4db('0x5f')](_0xf4db('0x65'),new Buffer(util['format'](_0xf4db('0x66'),_0x210fe2['username'],_0x210fe2[_0xf4db('0x57')]))[_0xf4db('0x67')](_0xf4db('0x68')));}return rp(_0x1942f2)['then'](function(_0x184682){return _0x903c17[_0xf4db('0x69')](_['map'](_0x184682['_embedded'][_0xf4db('0x6a')],function(_0x42670a){return{'id':_0x42670a['name'],'name':_0x42670a[_0xf4db('0x26')],'type':_0x42670a[_0xf4db('0x2d')],'active':_0x42670a[_0xf4db('0x6b')],'label':_0x42670a[_0xf4db('0x6c')],'custom':!![]};}));});}})[_0xf4db('0x24')](function(_0x300292){return{'count':_0x300292[_0xf4db('0x34')],'rows':_0x300292};})[_0xf4db('0x24')](respondWithResult(_0x2f9044,null))[_0xf4db('0x42')](function(_0x2d746d){var _0x9ce722=_0x259010['query'][_0xf4db('0x6d')]?0x1f4:_0x2d746d['statusCode']||0x1f4;logger[_0xf4db('0x25')](_0xf4db('0x6e'),'getFields',_0x9ce722,JSON[_0xf4db('0x6f')](_0x2d746d));delete _0x2d746d[_0xf4db('0x26')];if(_0x9ce722===0x191){_0x9ce722=0x190;}_0x2f9044[_0xf4db('0x1a')](_0x9ce722)[_0xf4db('0x27')](_0x259010[_0xf4db('0x2f')]['test']?{'message':_0xf4db('0x70'),'statusCode':_0x2d746d[_0xf4db('0x71')]}:_0x2d746d);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index cf52ce5..05eca36 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 _0x78d5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','../../config/logger'];(function(_0x4c922b,_0x594eaa){var _0xccecc2=function(_0x1b4489){while(--_0x1b4489){_0x4c922b['push'](_0x4c922b['shift']());}};_0xccecc2(++_0x594eaa);}(_0x78d5,0x167));var _0x578d=function(_0x462391,_0x2c2fe7){_0x462391=_0x462391-0x0;var _0x26c572=_0x78d5[_0x462391];return _0x26c572;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x578d('0x0'))(_0x578d('0x1'));var moment=require(_0x578d('0x2'));var BPromise=require(_0x578d('0x3'));var rp=require(_0x578d('0x4'));var fs=require('fs');var path=require(_0x578d('0x5'));var rimraf=require(_0x578d('0x6'));var config=require(_0x578d('0x7'));var attributes=require(_0x578d('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x578d('0x9')]=function(_0x58fdc8,_0x141ced){return _0x58fdc8[_0x578d('0xa')](_0x578d('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1200=['path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x231af6,_0x8f6b1f){var _0x55dbcc=function(_0x53b941){while(--_0x53b941){_0x231af6['push'](_0x231af6['shift']());}};_0x55dbcc(++_0x8f6b1f);}(_0x1200,0x10b));var _0x0120=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0x1200[_0x562faa];return _0xc70f59;};'use strict';var _=require(_0x0120('0x0'));var util=require(_0x0120('0x1'));var logger=require(_0x0120('0x2'))('api');var moment=require(_0x0120('0x3'));var BPromise=require(_0x0120('0x4'));var rp=require(_0x0120('0x5'));var fs=require('fs');var path=require(_0x0120('0x6'));var rimraf=require('rimraf');var config=require(_0x0120('0x7'));var attributes=require(_0x0120('0x8'));var integrations=require(_0x0120('0x9'));module[_0x0120('0xa')]=function(_0x493963,_0x50ea18){return _0x493963['define'](_0x0120('0xb'),attributes,{'tableName':_0x0120('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 8617dbf..e72a540 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 _0x9998=['attributes','stringify','catch','ShowDeskAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','GetDeskAccount','DeskAccount','findAll','options','limit','map','include','model'];(function(_0x1594ef,_0x467a04){var _0x1b7070=function(_0xf86472){while(--_0xf86472){_0x1594ef['push'](_0x1594ef['shift']());}};_0x1b7070(++_0x467a04);}(_0x9998,0xa9));var _0x8999=function(_0x2ed33f,_0x1cbe4e){_0x2ed33f=_0x2ed33f-0x0;var _0x2cdd0e=_0x9998[_0x2ed33f];return _0x2cdd0e;};'use strict';var _=require('lodash');var util=require(_0x8999('0x0'));var moment=require('moment');var BPromise=require(_0x8999('0x1'));var rs=require(_0x8999('0x2'));var fs=require('fs');var Redis=require(_0x8999('0x3'));var db=require(_0x8999('0x4'))['db'];var utils=require(_0x8999('0x5'));var logger=require(_0x8999('0x6'))(_0x8999('0x7'));var config=require('../../config/environment');var jayson=require(_0x8999('0x8'));var client=jayson[_0x8999('0x9')][_0x8999('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4affae,_0x1cfd67,_0x6b3f3a){return new BPromise(function(_0x5ad7d5,_0x28cb28){return client[_0x8999('0xb')](_0x4affae,_0x6b3f3a)[_0x8999('0xc')](function(_0x5c3889){logger[_0x8999('0xd')](_0x8999('0xe'),_0x1cfd67,_0x8999('0xf'));logger[_0x8999('0x10')](_0x8999('0x11'),_0x1cfd67,_0x8999('0xf'),JSON['stringify'](_0x5c3889));if(_0x5c3889['error']){if(_0x5c3889['error'][_0x8999('0x12')]===0x1f4){logger['error'](_0x8999('0xe'),_0x1cfd67,_0x5c3889[_0x8999('0x13')][_0x8999('0x14')]);return _0x28cb28(_0x5c3889[_0x8999('0x13')][_0x8999('0x14')]);}logger[_0x8999('0x13')](_0x8999('0xe'),_0x1cfd67,_0x5c3889['error'][_0x8999('0x14')]);return _0x5ad7d5(_0x5c3889[_0x8999('0x13')][_0x8999('0x14')]);}else{logger['info'](_0x8999('0xe'),_0x1cfd67,_0x8999('0xf'));_0x5ad7d5(_0x5c3889['result']['message']);}})['catch'](function(_0x44732b){logger[_0x8999('0x13')](_0x8999('0xe'),_0x1cfd67,_0x44732b);_0x28cb28(_0x44732b);});});}exports[_0x8999('0x15')]=function(_0x3d2732){var _0xe860f3=this;return new Promise(function(_0x8e4dd1,_0x228f06){return db[_0x8999('0x16')][_0x8999('0x17')]({'raw':_0x3d2732[_0x8999('0x18')]?_0x3d2732['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d2732[_0x8999('0x18')]?_0x3d2732[_0x8999('0x18')]['where']||null:null,'attributes':_0x3d2732[_0x8999('0x18')]?_0x3d2732[_0x8999('0x18')]['attributes']||null:null,'limit':_0x3d2732['options']?_0x3d2732[_0x8999('0x18')][_0x8999('0x19')]||null:null,'include':_0x3d2732[_0x8999('0x18')]?_0x3d2732[_0x8999('0x18')]['include']?_[_0x8999('0x1a')](_0x3d2732[_0x8999('0x18')][_0x8999('0x1b')],function(_0x4756d2){return{'model':db[_0x4756d2[_0x8999('0x1c')]],'as':_0x4756d2['as'],'attributes':_0x4756d2[_0x8999('0x1d')],'include':_0x4756d2[_0x8999('0x1b')]?_['map'](_0x4756d2[_0x8999('0x1b')],function(_0x1979ec){return{'model':db[_0x1979ec[_0x8999('0x1c')]],'as':_0x1979ec['as'],'attributes':_0x1979ec[_0x8999('0x1d')],'include':_0x1979ec[_0x8999('0x1b')]?_[_0x8999('0x1a')](_0x1979ec[_0x8999('0x1b')],function(_0x250359){return{'model':db[_0x250359[_0x8999('0x1c')]],'as':_0x250359['as'],'attributes':_0x250359[_0x8999('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8999('0xc')](function(_0x131940){logger['info'](_0x8999('0x15'),_0x3d2732);logger[_0x8999('0x10')]('GetDeskAccount',_0x3d2732,JSON[_0x8999('0x1e')](_0x131940));_0x8e4dd1(_0x131940);})[_0x8999('0x1f')](function(_0xe9c053){logger[_0x8999('0x13')](_0x8999('0x15'),_0xe9c053[_0x8999('0x14')],_0x3d2732);_0x228f06(_0xe860f3[_0x8999('0x13')](0x1f4,_0xe9c053[_0x8999('0x14')]));});});};exports[_0x8999('0x20')]=function(_0x3d8a5e){var _0x22dd57=this;return new Promise(function(_0xf28147,_0x2281a3){return db[_0x8999('0x16')]['find']({'raw':_0x3d8a5e[_0x8999('0x18')]?_0x3d8a5e['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d8a5e[_0x8999('0x18')]?_0x3d8a5e[_0x8999('0x18')]['where']||null:null,'attributes':_0x3d8a5e[_0x8999('0x18')]?_0x3d8a5e[_0x8999('0x18')][_0x8999('0x1d')]||null:null,'include':_0x3d8a5e[_0x8999('0x18')]?_0x3d8a5e[_0x8999('0x18')]['include']?_[_0x8999('0x1a')](_0x3d8a5e[_0x8999('0x18')][_0x8999('0x1b')],function(_0x5058d9){return{'model':db[_0x5058d9[_0x8999('0x1c')]],'as':_0x5058d9['as'],'attributes':_0x5058d9[_0x8999('0x1d')],'include':_0x5058d9[_0x8999('0x1b')]?_[_0x8999('0x1a')](_0x5058d9[_0x8999('0x1b')],function(_0x386498){return{'model':db[_0x386498[_0x8999('0x1c')]],'as':_0x386498['as'],'attributes':_0x386498[_0x8999('0x1d')],'include':_0x386498[_0x8999('0x1b')]?_[_0x8999('0x1a')](_0x386498[_0x8999('0x1b')],function(_0x3fb10b){return{'model':db[_0x3fb10b[_0x8999('0x1c')]],'as':_0x3fb10b['as'],'attributes':_0x3fb10b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22e1da){logger[_0x8999('0xd')]('ShowDeskAccount',_0x3d8a5e);logger[_0x8999('0x10')]('ShowDeskAccount',_0x3d8a5e,JSON['stringify'](_0x22e1da));_0xf28147(_0x22e1da);})['catch'](function(_0x10c65d){logger['error']('ShowDeskAccount',_0x10c65d[_0x8999('0x14')],_0x3d8a5e);_0x2281a3(_0x22dd57[_0x8999('0x13')](0x1f4,_0x10c65d[_0x8999('0x14')]));});});}; \ No newline at end of file +var _0x0891=['request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','model','include','map','ShowDeskAccount','find','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0891,0x14b));var _0x1089=function(_0x4e0ad6,_0x249d47){_0x4e0ad6=_0x4e0ad6-0x0;var _0x305e12=_0x0891[_0x4e0ad6];return _0x305e12;};'use strict';var _=require(_0x1089('0x0'));var util=require(_0x1089('0x1'));var moment=require(_0x1089('0x2'));var BPromise=require(_0x1089('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1089('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1089('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1089('0x6'));var jayson=require(_0x1089('0x7'));var client=jayson[_0x1089('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x459dce,_0x3731f4,_0x35456a){return new BPromise(function(_0x30ed1b,_0x4f2af8){return client[_0x1089('0x9')](_0x459dce,_0x35456a)[_0x1089('0xa')](function(_0x45ea9e){logger[_0x1089('0xb')]('DeskAccount,\x20%s,\x20%s',_0x3731f4,_0x1089('0xc'));logger[_0x1089('0xd')](_0x1089('0xe'),_0x3731f4,_0x1089('0xc'),JSON[_0x1089('0xf')](_0x45ea9e));if(_0x45ea9e['error']){if(_0x45ea9e[_0x1089('0x10')]['code']===0x1f4){logger[_0x1089('0x10')](_0x1089('0x11'),_0x3731f4,_0x45ea9e[_0x1089('0x10')][_0x1089('0x12')]);return _0x4f2af8(_0x45ea9e['error']['message']);}logger[_0x1089('0x10')](_0x1089('0x11'),_0x3731f4,_0x45ea9e[_0x1089('0x10')][_0x1089('0x12')]);return _0x30ed1b(_0x45ea9e[_0x1089('0x10')][_0x1089('0x12')]);}else{logger[_0x1089('0xb')](_0x1089('0x11'),_0x3731f4,_0x1089('0xc'));_0x30ed1b(_0x45ea9e[_0x1089('0x13')][_0x1089('0x12')]);}})[_0x1089('0x14')](function(_0x351294){logger[_0x1089('0x10')](_0x1089('0x11'),_0x3731f4,_0x351294);_0x4f2af8(_0x351294);});});}exports[_0x1089('0x15')]=function(_0x95a9e3){var _0x5e17ba=this;return new Promise(function(_0x24443f,_0x84bc40){return db[_0x1089('0x16')][_0x1089('0x17')]({'raw':_0x95a9e3[_0x1089('0x18')]?_0x95a9e3['options'][_0x1089('0x19')]===undefined?!![]:![]:!![],'where':_0x95a9e3[_0x1089('0x18')]?_0x95a9e3[_0x1089('0x18')]['where']||null:null,'attributes':_0x95a9e3['options']?_0x95a9e3[_0x1089('0x18')][_0x1089('0x1a')]||null:null,'limit':_0x95a9e3[_0x1089('0x18')]?_0x95a9e3[_0x1089('0x18')][_0x1089('0x1b')]||null:null,'include':_0x95a9e3[_0x1089('0x18')]?_0x95a9e3[_0x1089('0x18')]['include']?_['map'](_0x95a9e3['options']['include'],function(_0xf46d4a){return{'model':db[_0xf46d4a[_0x1089('0x1c')]],'as':_0xf46d4a['as'],'attributes':_0xf46d4a[_0x1089('0x1a')],'include':_0xf46d4a[_0x1089('0x1d')]?_[_0x1089('0x1e')](_0xf46d4a[_0x1089('0x1d')],function(_0x38ddf4){return{'model':db[_0x38ddf4[_0x1089('0x1c')]],'as':_0x38ddf4['as'],'attributes':_0x38ddf4[_0x1089('0x1a')],'include':_0x38ddf4[_0x1089('0x1d')]?_['map'](_0x38ddf4[_0x1089('0x1d')],function(_0x276714){return{'model':db[_0x276714['model']],'as':_0x276714['as'],'attributes':_0x276714[_0x1089('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1089('0xa')](function(_0x344c03){logger['info'](_0x1089('0x15'),_0x95a9e3);logger[_0x1089('0xd')](_0x1089('0x15'),_0x95a9e3,JSON['stringify'](_0x344c03));_0x24443f(_0x344c03);})[_0x1089('0x14')](function(_0x3b0f75){logger[_0x1089('0x10')](_0x1089('0x15'),_0x3b0f75[_0x1089('0x12')],_0x95a9e3);_0x84bc40(_0x5e17ba[_0x1089('0x10')](0x1f4,_0x3b0f75['message']));});});};exports[_0x1089('0x1f')]=function(_0xffbcde){var _0x4703b1=this;return new Promise(function(_0x33ac59,_0x3259b8){return db['DeskAccount'][_0x1089('0x20')]({'raw':_0xffbcde[_0x1089('0x18')]?_0xffbcde['options'][_0x1089('0x19')]===undefined?!![]:![]:!![],'where':_0xffbcde[_0x1089('0x18')]?_0xffbcde[_0x1089('0x18')][_0x1089('0x21')]||null:null,'attributes':_0xffbcde['options']?_0xffbcde[_0x1089('0x18')][_0x1089('0x1a')]||null:null,'include':_0xffbcde[_0x1089('0x18')]?_0xffbcde[_0x1089('0x18')]['include']?_[_0x1089('0x1e')](_0xffbcde['options']['include'],function(_0xcb7e7f){return{'model':db[_0xcb7e7f[_0x1089('0x1c')]],'as':_0xcb7e7f['as'],'attributes':_0xcb7e7f['attributes'],'include':_0xcb7e7f[_0x1089('0x1d')]?_['map'](_0xcb7e7f[_0x1089('0x1d')],function(_0x34f30e){return{'model':db[_0x34f30e[_0x1089('0x1c')]],'as':_0x34f30e['as'],'attributes':_0x34f30e[_0x1089('0x1a')],'include':_0x34f30e['include']?_['map'](_0x34f30e[_0x1089('0x1d')],function(_0x4ca833){return{'model':db[_0x4ca833[_0x1089('0x1c')]],'as':_0x4ca833['as'],'attributes':_0x4ca833['attributes']};}):[]};}):[]};}):[]:[]})[_0x1089('0xa')](function(_0x295ddc){logger['info']('ShowDeskAccount',_0xffbcde);logger[_0x1089('0xd')](_0x1089('0x1f'),_0xffbcde,JSON[_0x1089('0xf')](_0x295ddc));_0x33ac59(_0x295ddc);})[_0x1089('0x14')](function(_0x3694d4){logger['error'](_0x1089('0x1f'),_0x3694d4[_0x1089('0x12')],_0xffbcde);_0x3259b8(_0x4703b1[_0x1089('0x10')](0x1f4,_0x3694d4[_0x1089('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 24a08bf..236c1a3 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 _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x3ce233,_0x58abd8){var _0x48c0cc=function(_0xce2df0){while(--_0xce2df0){_0x3ce233['push'](_0x3ce233['shift']());}};_0x48c0cc(++_0x58abd8);}(_0x7217,0x19e));var _0x7721=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x7217[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x44c476,_0x52fcbd){var _0x3de2d2=function(_0xcfaf87){while(--_0xcfaf87){_0x44c476['push'](_0x44c476['shift']());}};_0x3de2d2(++_0x52fcbd);}(_0xedd9,0xfc));var _0x9edd=function(_0x54fa2e,_0x77dc95){_0x54fa2e=_0x54fa2e-0x0;var _0xad81e5=_0xedd9[_0x54fa2e];return _0xad81e5;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('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 efb6e90..6610f77 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 _0x8ac0=['STRING'];(function(_0x4447fd,_0x1812c9){var _0x3c4718=function(_0x3c7591){while(--_0x3c7591){_0x4447fd['push'](_0x4447fd['shift']());}};_0x3c4718(++_0x1812c9);}(_0x8ac0,0x1c6));var _0x08ac=function(_0xc29704,_0x2767c7){_0xc29704=_0xc29704-0x0;var _0x7d8e58=_0x8ac0[_0xc29704];return _0x7d8e58;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x08ac('0x0')]},'description':{'type':Sequelize[_0x08ac('0x0')]}}; \ No newline at end of file +var _0xdd1f=['exports','STRING'];(function(_0x54aa2d,_0x4dafb3){var _0x292aa6=function(_0x29eec1){while(--_0x29eec1){_0x54aa2d['push'](_0x54aa2d['shift']());}};_0x292aa6(++_0x4dafb3);}(_0xdd1f,0xe4));var _0xfdd1=function(_0x29ab0e,_0xca9764){_0x29ab0e=_0x29ab0e-0x0;var _0x24f3c4=_0xdd1f[_0x29ab0e];return _0x24f3c4;};'use strict';var Sequelize=require('sequelize');module[_0xfdd1('0x0')]={'name':{'type':Sequelize[_0xfdd1('0x1')]},'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 aa0041e..8852565 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 _0x3a52=['find','getFields','findOne','DeskField','getSubjects','setTags','ids','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../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','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','DeskConfiguration','includeAll','include','findAll','rows','catch','show','params','filters','options','create','body'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x3a52,0x1b5));var _0x23a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3a52[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x23a5('0x0'));var jsonpatch=require(_0x23a5('0x1'));var rp=require(_0x23a5('0x2'));var moment=require(_0x23a5('0x3'));var BPromise=require(_0x23a5('0x4'));var Mustache=require(_0x23a5('0x5'));var util=require(_0x23a5('0x6'));var path=require(_0x23a5('0x7'));var sox=require(_0x23a5('0x8'));var csv=require('to-csv');var ejs=require(_0x23a5('0x9'));var fs=require('fs');var fs_extra=require(_0x23a5('0xa'));var _=require(_0x23a5('0xb'));var squel=require(_0x23a5('0xc'));var crypto=require(_0x23a5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x23a5('0xe'));var toCsv=require(_0x23a5('0xf'));var querystring=require(_0x23a5('0x10'));var Papa=require('papaparse');var Redis=require(_0x23a5('0x11'));var authService=require(_0x23a5('0x12'));var qs=require(_0x23a5('0x13'));var as=require(_0x23a5('0x14'));var hardwareService=require(_0x23a5('0x15'));var logger=require(_0x23a5('0x16'))(_0x23a5('0x17'));var utils=require(_0x23a5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x23a5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d3195,_0x3f2540){_0x3f2540=_0x3f2540||0xcc;return function(_0x40c86c){if(_0x40c86c){return _0x5d3195[_0x23a5('0x1a')](_0x3f2540);}return _0x5d3195[_0x23a5('0x1b')](_0x3f2540)[_0x23a5('0x1c')]();};}function respondWithResult(_0x914fbd,_0x55a279){_0x55a279=_0x55a279||0xc8;return function(_0x26a56c){if(_0x26a56c){return _0x914fbd[_0x23a5('0x1b')](_0x55a279)[_0x23a5('0x1d')](_0x26a56c);}};}function respondWithFilteredResult(_0x1e321e,_0x2d9953){return function(_0x5502b9){if(_0x5502b9){var _0x5efb49=typeof _0x2d9953[_0x23a5('0x1e')]===_0x23a5('0x1f')&&typeof _0x2d9953['limit']===_0x23a5('0x1f');var _0x71aa05=_0x5502b9[_0x23a5('0x20')];var _0x5e7d66=_0x5efb49?0x0:_0x2d9953[_0x23a5('0x1e')];var _0x215eee=_0x5efb49?_0x5502b9[_0x23a5('0x20')]:_0x2d9953[_0x23a5('0x1e')]+_0x2d9953[_0x23a5('0x21')];var _0x8dc9a1;if(_0x215eee>=_0x71aa05){_0x215eee=_0x71aa05;_0x8dc9a1=0xc8;}else{_0x8dc9a1=0xce;}_0x1e321e[_0x23a5('0x1b')](_0x8dc9a1);return _0x1e321e[_0x23a5('0x22')](_0x23a5('0x23'),_0x5e7d66+'-'+_0x215eee+'/'+_0x71aa05)['json'](_0x5502b9);}return null;};}function patchUpdates(_0x4dce73){return function(_0x401703){try{jsonpatch[_0x23a5('0x24')](_0x401703,_0x4dce73,!![]);}catch(_0x5a1fa0){return BPromise[_0x23a5('0x25')](_0x5a1fa0);}return _0x401703[_0x23a5('0x26')]();};}function saveUpdates(_0x1c81bb,_0x5a162f){return function(_0x27058c){if(_0x27058c){return _0x27058c[_0x23a5('0x27')](_0x1c81bb)[_0x23a5('0x28')](function(_0x535a44){return _0x535a44;});}return null;};}function removeEntity(_0x5c7629,_0x525bc8){return function(_0x189e2c){if(_0x189e2c){return _0x189e2c[_0x23a5('0x29')]()[_0x23a5('0x28')](function(){_0x5c7629['status'](0xcc)[_0x23a5('0x1c')]();});}};}function handleEntityNotFound(_0x2c1dcf,_0x224a60){return function(_0xd7723e){if(!_0xd7723e){_0x2c1dcf['sendStatus'](0x194);}return _0xd7723e;};}function handleError(_0x4f8e62,_0x5f1e12){_0x5f1e12=_0x5f1e12||0x1f4;return function(_0x31437d){logger[_0x23a5('0x2a')](_0x31437d[_0x23a5('0x2b')]);if(_0x31437d[_0x23a5('0x2c')]){delete _0x31437d[_0x23a5('0x2c')];}_0x4f8e62[_0x23a5('0x1b')](_0x5f1e12)[_0x23a5('0x2d')](_0x31437d);};}exports['index']=function(_0x543adb,_0x574de4){var _0x9b455d={},_0x129b25={},_0x48f1dc={'count':0x0,'rows':[]};var _0x48602d=_[_0x23a5('0x2e')](db['DeskConfiguration'][_0x23a5('0x2f')],function(_0x2a5a57){return{'name':_0x2a5a57[_0x23a5('0x30')],'type':_0x2a5a57['type'][_0x23a5('0x31')]};});_0x129b25['model']=_[_0x23a5('0x2e')](_0x48602d,'name');_0x129b25[_0x23a5('0x32')]=_[_0x23a5('0x33')](_0x543adb[_0x23a5('0x32')]);_0x129b25['filters']=_['intersection'](_0x129b25[_0x23a5('0x34')],_0x129b25[_0x23a5('0x32')]);_0x9b455d[_0x23a5('0x35')]=_[_0x23a5('0x36')](_0x129b25[_0x23a5('0x34')],qs[_0x23a5('0x37')](_0x543adb[_0x23a5('0x32')][_0x23a5('0x37')]));_0x9b455d[_0x23a5('0x35')]=_0x9b455d[_0x23a5('0x35')][_0x23a5('0x38')]?_0x9b455d[_0x23a5('0x35')]:_0x129b25[_0x23a5('0x34')];if(!_0x543adb['query'][_0x23a5('0x39')](_0x23a5('0x3a'))){_0x9b455d[_0x23a5('0x21')]=qs[_0x23a5('0x21')](_0x543adb[_0x23a5('0x32')][_0x23a5('0x21')]);_0x9b455d[_0x23a5('0x1e')]=qs[_0x23a5('0x1e')](_0x543adb[_0x23a5('0x32')]['offset']);}_0x9b455d[_0x23a5('0x3b')]=qs[_0x23a5('0x3c')](_0x543adb[_0x23a5('0x32')][_0x23a5('0x3c')]);_0x9b455d[_0x23a5('0x3d')]=qs['filters'](_[_0x23a5('0x3e')](_0x543adb[_0x23a5('0x32')],_0x129b25['filters']),_0x48602d);if(_0x543adb[_0x23a5('0x32')][_0x23a5('0x3f')]){_0x9b455d['where']=_[_0x23a5('0x40')](_0x9b455d[_0x23a5('0x3d')],{'$or':_[_0x23a5('0x2e')](_0x48602d,function(_0x2a30ea){if(_0x2a30ea[_0x23a5('0x41')]!==_0x23a5('0x42')){var _0x55d188={};_0x55d188[_0x2a30ea[_0x23a5('0x2c')]]={'$like':'%'+_0x543adb[_0x23a5('0x32')][_0x23a5('0x3f')]+'%'};return _0x55d188;}})});}_0x9b455d=_[_0x23a5('0x40')]({},_0x9b455d,_0x543adb['options']);var _0x237845={'where':_0x9b455d['where']};return db[_0x23a5('0x43')]['count'](_0x237845)[_0x23a5('0x28')](function(_0x3dab5d){_0x48f1dc['count']=_0x3dab5d;if(_0x543adb[_0x23a5('0x32')][_0x23a5('0x44')]){_0x9b455d[_0x23a5('0x45')]=[{'all':!![]}];}return db[_0x23a5('0x43')][_0x23a5('0x46')](_0x9b455d);})[_0x23a5('0x28')](function(_0x5ae495){_0x48f1dc[_0x23a5('0x47')]=_0x5ae495;return _0x48f1dc;})[_0x23a5('0x28')](respondWithFilteredResult(_0x574de4,_0x9b455d))[_0x23a5('0x48')](handleError(_0x574de4,null));};exports[_0x23a5('0x49')]=function(_0x2f2ac5,_0x15f1b3){var _0x11d263={'raw':![],'where':{'id':_0x2f2ac5[_0x23a5('0x4a')]['id']}},_0x32cfd8={};_0x32cfd8[_0x23a5('0x34')]=_[_0x23a5('0x33')](db[_0x23a5('0x43')]['rawAttributes']);_0x32cfd8['query']=_[_0x23a5('0x33')](_0x2f2ac5[_0x23a5('0x32')]);_0x32cfd8[_0x23a5('0x4b')]=_[_0x23a5('0x36')](_0x32cfd8[_0x23a5('0x34')],_0x32cfd8[_0x23a5('0x32')]);_0x11d263[_0x23a5('0x35')]=_[_0x23a5('0x36')](_0x32cfd8[_0x23a5('0x34')],qs[_0x23a5('0x37')](_0x2f2ac5[_0x23a5('0x32')][_0x23a5('0x37')]));_0x11d263['attributes']=_0x11d263['attributes'][_0x23a5('0x38')]?_0x11d263[_0x23a5('0x35')]:_0x32cfd8[_0x23a5('0x34')];if(_0x2f2ac5[_0x23a5('0x32')][_0x23a5('0x44')]){_0x11d263[_0x23a5('0x45')]=[{'all':!![]}];}_0x11d263=_[_0x23a5('0x40')]({},_0x11d263,_0x2f2ac5[_0x23a5('0x4c')]);return db[_0x23a5('0x43')]['find'](_0x11d263)[_0x23a5('0x28')](handleEntityNotFound(_0x15f1b3,null))[_0x23a5('0x28')](respondWithResult(_0x15f1b3,null))[_0x23a5('0x48')](handleError(_0x15f1b3,null));};exports[_0x23a5('0x4d')]=function(_0x5b4ff2,_0x1b285e){return db['DeskConfiguration'][_0x23a5('0x4d')](_0x5b4ff2['body'],{})[_0x23a5('0x28')](respondWithResult(_0x1b285e,0xc9))['catch'](handleError(_0x1b285e,null));};exports[_0x23a5('0x27')]=function(_0x54d312,_0x3b08e3){if(_0x54d312[_0x23a5('0x4e')]['id']){delete _0x54d312[_0x23a5('0x4e')]['id'];}return db[_0x23a5('0x43')][_0x23a5('0x4f')]({'where':{'id':_0x54d312[_0x23a5('0x4a')]['id']}})[_0x23a5('0x28')](handleEntityNotFound(_0x3b08e3,null))[_0x23a5('0x28')](saveUpdates(_0x54d312['body'],null))[_0x23a5('0x28')](respondWithResult(_0x3b08e3,null))[_0x23a5('0x48')](handleError(_0x3b08e3,null));};exports[_0x23a5('0x29')]=function(_0x3b6b37,_0x53cba2){return db[_0x23a5('0x43')][_0x23a5('0x4f')]({'where':{'id':_0x3b6b37['params']['id']}})[_0x23a5('0x28')](handleEntityNotFound(_0x53cba2,null))['then'](removeEntity(_0x53cba2,null))['catch'](handleError(_0x53cba2,null));};exports[_0x23a5('0x50')]=function(_0x65e07d,_0x124f1f,_0xf05d16){var _0x49b7f2={};var _0x14b94a={};var _0x477ffe;var _0x5dbffd;return db[_0x23a5('0x43')][_0x23a5('0x51')]({'where':{'id':_0x65e07d[_0x23a5('0x4a')]['id']}})[_0x23a5('0x28')](handleEntityNotFound(_0x124f1f,null))['then'](function(_0x54f9e8){if(_0x54f9e8){_0x477ffe=_0x54f9e8;_0x14b94a[_0x23a5('0x34')]=_[_0x23a5('0x33')](db[_0x23a5('0x52')][_0x23a5('0x2f')]);_0x14b94a['query']=_[_0x23a5('0x33')](_0x65e07d[_0x23a5('0x32')]);_0x14b94a[_0x23a5('0x4b')]=_[_0x23a5('0x36')](_0x14b94a['model'],_0x14b94a[_0x23a5('0x32')]);_0x49b7f2[_0x23a5('0x35')]=_[_0x23a5('0x36')](_0x14b94a['model'],qs[_0x23a5('0x37')](_0x65e07d[_0x23a5('0x32')][_0x23a5('0x37')]));_0x49b7f2['attributes']=_0x49b7f2[_0x23a5('0x35')][_0x23a5('0x38')]?_0x49b7f2[_0x23a5('0x35')]:_0x14b94a['model'];_0x49b7f2['order']=qs[_0x23a5('0x3c')](_0x65e07d[_0x23a5('0x32')][_0x23a5('0x3c')]);_0x49b7f2[_0x23a5('0x3d')]=qs['filters'](_[_0x23a5('0x3e')](_0x65e07d[_0x23a5('0x32')],_0x14b94a[_0x23a5('0x4b')]));if(_0x65e07d[_0x23a5('0x32')][_0x23a5('0x3f')]){_0x49b7f2[_0x23a5('0x3d')]=_[_0x23a5('0x40')](_0x49b7f2[_0x23a5('0x3d')],{'$or':_['map'](_0x49b7f2[_0x23a5('0x35')],function(_0x508c72){var _0x316569={};_0x316569[_0x508c72]={'$like':'%'+_0x65e07d[_0x23a5('0x32')]['filter']+'%'};return _0x316569;})});}_0x49b7f2=_[_0x23a5('0x40')]({},_0x49b7f2,_0x65e07d[_0x23a5('0x4c')]);return _0x477ffe[_0x23a5('0x50')](_0x49b7f2);}})[_0x23a5('0x28')](function(_0x2a7013){if(_0x2a7013){_0x5dbffd=_0x2a7013[_0x23a5('0x38')];if(!_0x65e07d['query']['hasOwnProperty'](_0x23a5('0x3a'))){_0x49b7f2[_0x23a5('0x21')]=qs[_0x23a5('0x21')](_0x65e07d[_0x23a5('0x32')][_0x23a5('0x21')]);_0x49b7f2[_0x23a5('0x1e')]=qs[_0x23a5('0x1e')](_0x65e07d[_0x23a5('0x32')][_0x23a5('0x1e')]);}return _0x477ffe['getFields'](_0x49b7f2);}})[_0x23a5('0x28')](function(_0x25d3d5){if(_0x25d3d5){return _0x25d3d5?{'count':_0x5dbffd,'rows':_0x25d3d5}:null;}})[_0x23a5('0x28')](respondWithResult(_0x124f1f,null))[_0x23a5('0x48')](handleError(_0x124f1f,null));};exports[_0x23a5('0x53')]=function(_0x5631a4,_0x7121b2,_0x57c217){var _0x2565ad={};var _0x1c2798={};var _0x4b9f0c;var _0x22f09b;return db[_0x23a5('0x43')][_0x23a5('0x51')]({'where':{'id':_0x5631a4[_0x23a5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7121b2,null))[_0x23a5('0x28')](function(_0x2cc96b){if(_0x2cc96b){_0x4b9f0c=_0x2cc96b;_0x1c2798[_0x23a5('0x34')]=_[_0x23a5('0x33')](db[_0x23a5('0x52')][_0x23a5('0x2f')]);_0x1c2798[_0x23a5('0x32')]=_['keys'](_0x5631a4[_0x23a5('0x32')]);_0x1c2798[_0x23a5('0x4b')]=_[_0x23a5('0x36')](_0x1c2798[_0x23a5('0x34')],_0x1c2798['query']);_0x2565ad[_0x23a5('0x35')]=_['intersection'](_0x1c2798[_0x23a5('0x34')],qs['fields'](_0x5631a4[_0x23a5('0x32')][_0x23a5('0x37')]));_0x2565ad[_0x23a5('0x35')]=_0x2565ad[_0x23a5('0x35')][_0x23a5('0x38')]?_0x2565ad['attributes']:_0x1c2798[_0x23a5('0x34')];_0x2565ad[_0x23a5('0x3b')]=qs[_0x23a5('0x3c')](_0x5631a4[_0x23a5('0x32')][_0x23a5('0x3c')]);_0x2565ad['where']=qs[_0x23a5('0x4b')](_[_0x23a5('0x3e')](_0x5631a4[_0x23a5('0x32')],_0x1c2798[_0x23a5('0x4b')]));if(_0x5631a4[_0x23a5('0x32')][_0x23a5('0x3f')]){_0x2565ad['where']=_[_0x23a5('0x40')](_0x2565ad[_0x23a5('0x3d')],{'$or':_['map'](_0x2565ad[_0x23a5('0x35')],function(_0x4f050a){var _0x5caabf={};_0x5caabf[_0x4f050a]={'$like':'%'+_0x5631a4[_0x23a5('0x32')][_0x23a5('0x3f')]+'%'};return _0x5caabf;})});}_0x2565ad=_['merge']({},_0x2565ad,_0x5631a4[_0x23a5('0x4c')]);return _0x4b9f0c[_0x23a5('0x53')](_0x2565ad);}})[_0x23a5('0x28')](function(_0x2233ed){if(_0x2233ed){_0x22f09b=_0x2233ed[_0x23a5('0x38')];if(!_0x5631a4[_0x23a5('0x32')][_0x23a5('0x39')](_0x23a5('0x3a'))){_0x2565ad[_0x23a5('0x21')]=qs[_0x23a5('0x21')](_0x5631a4['query'][_0x23a5('0x21')]);_0x2565ad['offset']=qs[_0x23a5('0x1e')](_0x5631a4[_0x23a5('0x32')][_0x23a5('0x1e')]);}return _0x4b9f0c[_0x23a5('0x53')](_0x2565ad);}})[_0x23a5('0x28')](function(_0x3b1ea0){if(_0x3b1ea0){return _0x3b1ea0?{'count':_0x22f09b,'rows':_0x3b1ea0}:null;}})['then'](respondWithResult(_0x7121b2,null))['catch'](handleError(_0x7121b2,null));};exports['getDescriptions']=function(_0x3a2d39,_0x7fc311,_0x23153a){var _0x518a54={};var _0x130290={};var _0x116c7d;var _0x5d1d60;return db[_0x23a5('0x43')][_0x23a5('0x51')]({'where':{'id':_0x3a2d39[_0x23a5('0x4a')]['id']}})[_0x23a5('0x28')](handleEntityNotFound(_0x7fc311,null))['then'](function(_0x1ee6bc){if(_0x1ee6bc){_0x116c7d=_0x1ee6bc;_0x130290['model']=_[_0x23a5('0x33')](db['DeskField']['rawAttributes']);_0x130290[_0x23a5('0x32')]=_['keys'](_0x3a2d39[_0x23a5('0x32')]);_0x130290[_0x23a5('0x4b')]=_[_0x23a5('0x36')](_0x130290['model'],_0x130290['query']);_0x518a54[_0x23a5('0x35')]=_['intersection'](_0x130290[_0x23a5('0x34')],qs[_0x23a5('0x37')](_0x3a2d39[_0x23a5('0x32')][_0x23a5('0x37')]));_0x518a54[_0x23a5('0x35')]=_0x518a54[_0x23a5('0x35')][_0x23a5('0x38')]?_0x518a54['attributes']:_0x130290[_0x23a5('0x34')];_0x518a54[_0x23a5('0x3b')]=qs[_0x23a5('0x3c')](_0x3a2d39[_0x23a5('0x32')][_0x23a5('0x3c')]);_0x518a54[_0x23a5('0x3d')]=qs[_0x23a5('0x4b')](_['pick'](_0x3a2d39[_0x23a5('0x32')],_0x130290[_0x23a5('0x4b')]));if(_0x3a2d39[_0x23a5('0x32')][_0x23a5('0x3f')]){_0x518a54[_0x23a5('0x3d')]=_[_0x23a5('0x40')](_0x518a54[_0x23a5('0x3d')],{'$or':_[_0x23a5('0x2e')](_0x518a54[_0x23a5('0x35')],function(_0x23c381){var _0x348280={};_0x348280[_0x23c381]={'$like':'%'+_0x3a2d39['query'][_0x23a5('0x3f')]+'%'};return _0x348280;})});}_0x518a54=_[_0x23a5('0x40')]({},_0x518a54,_0x3a2d39['options']);return _0x116c7d['getDescriptions'](_0x518a54);}})[_0x23a5('0x28')](function(_0xaa6747){if(_0xaa6747){_0x5d1d60=_0xaa6747[_0x23a5('0x38')];if(!_0x3a2d39['query'][_0x23a5('0x39')](_0x23a5('0x3a'))){_0x518a54['limit']=qs[_0x23a5('0x21')](_0x3a2d39[_0x23a5('0x32')]['limit']);_0x518a54['offset']=qs[_0x23a5('0x1e')](_0x3a2d39[_0x23a5('0x32')][_0x23a5('0x1e')]);}return _0x116c7d['getDescriptions'](_0x518a54);}})[_0x23a5('0x28')](function(_0x13cf7e){if(_0x13cf7e){return _0x13cf7e?{'count':_0x5d1d60,'rows':_0x13cf7e}:null;}})[_0x23a5('0x28')](respondWithResult(_0x7fc311,null))['catch'](handleError(_0x7fc311,null));};exports['getTags']=function(_0x3682c7,_0x472263,_0x349fda){var _0x4fde35={};var _0x577428={};var _0x47e4db;var _0x2177b5;return db[_0x23a5('0x43')][_0x23a5('0x51')]({'where':{'id':_0x3682c7[_0x23a5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x472263,null))[_0x23a5('0x28')](function(_0x326882){if(_0x326882){_0x47e4db=_0x326882;_0x577428[_0x23a5('0x34')]=_[_0x23a5('0x33')](db['Tag'][_0x23a5('0x2f')]);_0x577428[_0x23a5('0x32')]=_['keys'](_0x3682c7['query']);_0x577428[_0x23a5('0x4b')]=_[_0x23a5('0x36')](_0x577428['model'],_0x577428[_0x23a5('0x32')]);_0x4fde35[_0x23a5('0x35')]=_[_0x23a5('0x36')](_0x577428[_0x23a5('0x34')],qs['fields'](_0x3682c7[_0x23a5('0x32')]['fields']));_0x4fde35[_0x23a5('0x35')]=_0x4fde35[_0x23a5('0x35')][_0x23a5('0x38')]?_0x4fde35['attributes']:_0x577428[_0x23a5('0x34')];_0x4fde35[_0x23a5('0x3b')]=qs[_0x23a5('0x3c')](_0x3682c7[_0x23a5('0x32')][_0x23a5('0x3c')]);_0x4fde35[_0x23a5('0x3d')]=qs[_0x23a5('0x4b')](_[_0x23a5('0x3e')](_0x3682c7[_0x23a5('0x32')],_0x577428[_0x23a5('0x4b')]));if(_0x3682c7['query'][_0x23a5('0x3f')]){_0x4fde35['where']=_[_0x23a5('0x40')](_0x4fde35[_0x23a5('0x3d')],{'$or':_['map'](_0x4fde35[_0x23a5('0x35')],function(_0x1357c4){var _0x491dba={};_0x491dba[_0x1357c4]={'$like':'%'+_0x3682c7['query'][_0x23a5('0x3f')]+'%'};return _0x491dba;})});}_0x4fde35=_[_0x23a5('0x40')]({},_0x4fde35,_0x3682c7[_0x23a5('0x4c')]);return _0x47e4db['getTags'](_0x4fde35);}})[_0x23a5('0x28')](function(_0x5d76bf){if(_0x5d76bf){_0x2177b5=_0x5d76bf['length'];if(!_0x3682c7[_0x23a5('0x32')][_0x23a5('0x39')](_0x23a5('0x3a'))){_0x4fde35[_0x23a5('0x21')]=qs[_0x23a5('0x21')](_0x3682c7[_0x23a5('0x32')][_0x23a5('0x21')]);_0x4fde35['offset']=qs[_0x23a5('0x1e')](_0x3682c7[_0x23a5('0x32')][_0x23a5('0x1e')]);}return _0x47e4db['getTags'](_0x4fde35);}})['then'](function(_0x351379){if(_0x351379){return _0x351379?{'count':_0x2177b5,'rows':_0x351379}:null;}})[_0x23a5('0x28')](respondWithResult(_0x472263,null))['catch'](handleError(_0x472263,null));};exports[_0x23a5('0x54')]=function(_0x1e41df,_0x438fd9,_0x2d3b19){if(_0x1e41df['body']['id']){delete _0x1e41df[_0x23a5('0x4e')]['id'];}return db[_0x23a5('0x43')]['findOne']({'where':{'id':_0x1e41df[_0x23a5('0x4a')]['id']}})[_0x23a5('0x28')](handleEntityNotFound(_0x438fd9,null))[_0x23a5('0x28')](function(_0x14446f){if(_0x14446f){return _0x14446f[_0x23a5('0x54')](_0x1e41df[_0x23a5('0x4e')][_0x23a5('0x55')]||[]);}return null;})[_0x23a5('0x28')](respondWithResult(_0x438fd9,null))[_0x23a5('0x48')](handleError(_0x438fd9,null));}; \ No newline at end of file +var _0x8161=['model','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','map','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','keys','create','body','destroy','find','findOne','DeskField','length','order','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','save','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type'];(function(_0x39d980,_0x15c127){var _0x33fcbc=function(_0x32548a){while(--_0x32548a){_0x39d980['push'](_0x39d980['shift']());}};_0x33fcbc(++_0x15c127);}(_0x8161,0x1cc));var _0x1816=function(_0x4db388,_0x4d5718){_0x4db388=_0x4db388-0x0;var _0x35d965=_0x8161[_0x4db388];return _0x35d965;};'use strict';var emlformat=require(_0x1816('0x0'));var rimraf=require(_0x1816('0x1'));var zipdir=require(_0x1816('0x2'));var jsonpatch=require(_0x1816('0x3'));var rp=require(_0x1816('0x4'));var moment=require(_0x1816('0x5'));var BPromise=require(_0x1816('0x6'));var Mustache=require('mustache');var util=require(_0x1816('0x7'));var path=require(_0x1816('0x8'));var sox=require('sox');var csv=require(_0x1816('0x9'));var ejs=require(_0x1816('0xa'));var fs=require('fs');var fs_extra=require(_0x1816('0xb'));var _=require(_0x1816('0xc'));var squel=require(_0x1816('0xd'));var crypto=require('crypto');var jsforce=require(_0x1816('0xe'));var deskjs=require(_0x1816('0xf'));var toCsv=require(_0x1816('0x9'));var querystring=require(_0x1816('0x10'));var Papa=require('papaparse');var Redis=require(_0x1816('0x11'));var authService=require(_0x1816('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1816('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1816('0x14'))(_0x1816('0x15'));var utils=require(_0x1816('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1816('0x17'));var db=require(_0x1816('0x18'))['db'];function respondWithStatusCode(_0x2d8cab,_0x4a3151){_0x4a3151=_0x4a3151||0xcc;return function(_0x5da232){if(_0x5da232){return _0x2d8cab[_0x1816('0x19')](_0x4a3151);}return _0x2d8cab['status'](_0x4a3151)[_0x1816('0x1a')]();};}function respondWithResult(_0x2c8d8a,_0x420b04){_0x420b04=_0x420b04||0xc8;return function(_0x48d1bc){if(_0x48d1bc){return _0x2c8d8a[_0x1816('0x1b')](_0x420b04)[_0x1816('0x1c')](_0x48d1bc);}};}function respondWithFilteredResult(_0x114180,_0x202480){return function(_0xc1d015){if(_0xc1d015){var _0x596917=typeof _0x202480[_0x1816('0x1d')]===_0x1816('0x1e')&&typeof _0x202480['limit']===_0x1816('0x1e');var _0x34582d=_0xc1d015[_0x1816('0x1f')];var _0x1d078e=_0x596917?0x0:_0x202480['offset'];var _0x44e449=_0x596917?_0xc1d015['count']:_0x202480[_0x1816('0x1d')]+_0x202480[_0x1816('0x20')];var _0xd89b66;if(_0x44e449>=_0x34582d){_0x44e449=_0x34582d;_0xd89b66=0xc8;}else{_0xd89b66=0xce;}_0x114180[_0x1816('0x1b')](_0xd89b66);return _0x114180[_0x1816('0x21')]('Content-Range',_0x1d078e+'-'+_0x44e449+'/'+_0x34582d)[_0x1816('0x1c')](_0xc1d015);}return null;};}function patchUpdates(_0x16b42a){return function(_0x19fd9b){try{jsonpatch[_0x1816('0x22')](_0x19fd9b,_0x16b42a,!![]);}catch(_0x9102ac){return BPromise['reject'](_0x9102ac);}return _0x19fd9b[_0x1816('0x23')]();};}function saveUpdates(_0x3a202c,_0x399b54){return function(_0x394e91){if(_0x394e91){return _0x394e91['update'](_0x3a202c)['then'](function(_0x1673df){return _0x1673df;});}return null;};}function removeEntity(_0x4d3540,_0x3ac306){return function(_0x3b6828){if(_0x3b6828){return _0x3b6828['destroy']()['then'](function(){_0x4d3540[_0x1816('0x1b')](0xcc)[_0x1816('0x1a')]();});}};}function handleEntityNotFound(_0x3ea0bb,_0xdc2d9c){return function(_0x200749){if(!_0x200749){_0x3ea0bb[_0x1816('0x19')](0x194);}return _0x200749;};}function handleError(_0x4a7c9d,_0xc6c31c){_0xc6c31c=_0xc6c31c||0x1f4;return function(_0x5de7f6){logger['error'](_0x5de7f6[_0x1816('0x24')]);if(_0x5de7f6[_0x1816('0x25')]){delete _0x5de7f6[_0x1816('0x25')];}_0x4a7c9d[_0x1816('0x1b')](_0xc6c31c)[_0x1816('0x26')](_0x5de7f6);};}exports[_0x1816('0x27')]=function(_0x204380,_0x432808){var _0x30ebe7={},_0x131b23={},_0x5b0b93={'count':0x0,'rows':[]};var _0x2f0256=_['map'](db[_0x1816('0x28')][_0x1816('0x29')],function(_0x3212c8){return{'name':_0x3212c8[_0x1816('0x2a')],'type':_0x3212c8[_0x1816('0x2b')]['key']};});_0x131b23[_0x1816('0x2c')]=_['map'](_0x2f0256,_0x1816('0x25'));_0x131b23[_0x1816('0x2d')]=_['keys'](_0x204380[_0x1816('0x2d')]);_0x131b23['filters']=_['intersection'](_0x131b23[_0x1816('0x2c')],_0x131b23[_0x1816('0x2d')]);_0x30ebe7[_0x1816('0x2e')]=_[_0x1816('0x2f')](_0x131b23[_0x1816('0x2c')],qs[_0x1816('0x30')](_0x204380[_0x1816('0x2d')][_0x1816('0x30')]));_0x30ebe7['attributes']=_0x30ebe7['attributes']['length']?_0x30ebe7[_0x1816('0x2e')]:_0x131b23['model'];if(!_0x204380['query'][_0x1816('0x31')](_0x1816('0x32'))){_0x30ebe7[_0x1816('0x20')]=qs[_0x1816('0x20')](_0x204380['query']['limit']);_0x30ebe7[_0x1816('0x1d')]=qs['offset'](_0x204380['query']['offset']);}_0x30ebe7['order']=qs[_0x1816('0x33')](_0x204380[_0x1816('0x2d')][_0x1816('0x33')]);_0x30ebe7['where']=qs[_0x1816('0x34')](_[_0x1816('0x35')](_0x204380[_0x1816('0x2d')],_0x131b23[_0x1816('0x34')]),_0x2f0256);if(_0x204380[_0x1816('0x2d')][_0x1816('0x36')]){_0x30ebe7[_0x1816('0x37')]=_['merge'](_0x30ebe7[_0x1816('0x37')],{'$or':_[_0x1816('0x38')](_0x2f0256,function(_0x3f19a9){if(_0x3f19a9[_0x1816('0x2b')]!==_0x1816('0x39')){var _0x3ba9f6={};_0x3ba9f6[_0x3f19a9['name']]={'$like':'%'+_0x204380[_0x1816('0x2d')][_0x1816('0x36')]+'%'};return _0x3ba9f6;}})});}_0x30ebe7=_[_0x1816('0x3a')]({},_0x30ebe7,_0x204380[_0x1816('0x3b')]);var _0x4aa00f={'where':_0x30ebe7[_0x1816('0x37')]};return db['DeskConfiguration']['count'](_0x4aa00f)[_0x1816('0x3c')](function(_0x1493e7){_0x5b0b93[_0x1816('0x1f')]=_0x1493e7;if(_0x204380[_0x1816('0x2d')][_0x1816('0x3d')]){_0x30ebe7[_0x1816('0x3e')]=[{'all':!![]}];}return db[_0x1816('0x28')][_0x1816('0x3f')](_0x30ebe7);})[_0x1816('0x3c')](function(_0x505139){_0x5b0b93[_0x1816('0x40')]=_0x505139;return _0x5b0b93;})[_0x1816('0x3c')](respondWithFilteredResult(_0x432808,_0x30ebe7))[_0x1816('0x41')](handleError(_0x432808,null));};exports[_0x1816('0x42')]=function(_0x33282e,_0x5a1e6c){var _0x2bcc3e={'raw':![],'where':{'id':_0x33282e[_0x1816('0x43')]['id']}},_0x2eaeb8={};_0x2eaeb8[_0x1816('0x2c')]=_[_0x1816('0x44')](db[_0x1816('0x28')][_0x1816('0x29')]);_0x2eaeb8[_0x1816('0x2d')]=_[_0x1816('0x44')](_0x33282e[_0x1816('0x2d')]);_0x2eaeb8[_0x1816('0x34')]=_[_0x1816('0x2f')](_0x2eaeb8['model'],_0x2eaeb8[_0x1816('0x2d')]);_0x2bcc3e[_0x1816('0x2e')]=_['intersection'](_0x2eaeb8[_0x1816('0x2c')],qs[_0x1816('0x30')](_0x33282e[_0x1816('0x2d')][_0x1816('0x30')]));_0x2bcc3e[_0x1816('0x2e')]=_0x2bcc3e[_0x1816('0x2e')]['length']?_0x2bcc3e[_0x1816('0x2e')]:_0x2eaeb8[_0x1816('0x2c')];if(_0x33282e[_0x1816('0x2d')][_0x1816('0x3d')]){_0x2bcc3e[_0x1816('0x3e')]=[{'all':!![]}];}_0x2bcc3e=_['merge']({},_0x2bcc3e,_0x33282e[_0x1816('0x3b')]);return db[_0x1816('0x28')]['find'](_0x2bcc3e)[_0x1816('0x3c')](handleEntityNotFound(_0x5a1e6c,null))[_0x1816('0x3c')](respondWithResult(_0x5a1e6c,null))[_0x1816('0x41')](handleError(_0x5a1e6c,null));};exports['create']=function(_0x43b382,_0x1fbc92){return db[_0x1816('0x28')][_0x1816('0x45')](_0x43b382[_0x1816('0x46')],{})['then'](respondWithResult(_0x1fbc92,0xc9))[_0x1816('0x41')](handleError(_0x1fbc92,null));};exports['update']=function(_0x4d0311,_0x37ec3f){if(_0x4d0311[_0x1816('0x46')]['id']){delete _0x4d0311[_0x1816('0x46')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x4d0311['params']['id']}})[_0x1816('0x3c')](handleEntityNotFound(_0x37ec3f,null))['then'](saveUpdates(_0x4d0311[_0x1816('0x46')],null))[_0x1816('0x3c')](respondWithResult(_0x37ec3f,null))[_0x1816('0x41')](handleError(_0x37ec3f,null));};exports[_0x1816('0x47')]=function(_0x329b4b,_0x345dc2){return db['DeskConfiguration'][_0x1816('0x48')]({'where':{'id':_0x329b4b[_0x1816('0x43')]['id']}})[_0x1816('0x3c')](handleEntityNotFound(_0x345dc2,null))[_0x1816('0x3c')](removeEntity(_0x345dc2,null))['catch'](handleError(_0x345dc2,null));};exports['getFields']=function(_0x4570b7,_0x266ebd,_0x4a8419){var _0x396e79={};var _0x50ee1a={};var _0x32ff65;var _0x52d72b;return db['DeskConfiguration'][_0x1816('0x49')]({'where':{'id':_0x4570b7['params']['id']}})[_0x1816('0x3c')](handleEntityNotFound(_0x266ebd,null))[_0x1816('0x3c')](function(_0x3c7b49){if(_0x3c7b49){_0x32ff65=_0x3c7b49;_0x50ee1a[_0x1816('0x2c')]=_[_0x1816('0x44')](db[_0x1816('0x4a')][_0x1816('0x29')]);_0x50ee1a[_0x1816('0x2d')]=_[_0x1816('0x44')](_0x4570b7[_0x1816('0x2d')]);_0x50ee1a[_0x1816('0x34')]=_[_0x1816('0x2f')](_0x50ee1a[_0x1816('0x2c')],_0x50ee1a[_0x1816('0x2d')]);_0x396e79[_0x1816('0x2e')]=_[_0x1816('0x2f')](_0x50ee1a[_0x1816('0x2c')],qs[_0x1816('0x30')](_0x4570b7['query']['fields']));_0x396e79['attributes']=_0x396e79['attributes'][_0x1816('0x4b')]?_0x396e79[_0x1816('0x2e')]:_0x50ee1a['model'];_0x396e79[_0x1816('0x4c')]=qs['sort'](_0x4570b7[_0x1816('0x2d')][_0x1816('0x33')]);_0x396e79['where']=qs[_0x1816('0x34')](_[_0x1816('0x35')](_0x4570b7['query'],_0x50ee1a['filters']));if(_0x4570b7['query'][_0x1816('0x36')]){_0x396e79['where']=_[_0x1816('0x3a')](_0x396e79['where'],{'$or':_[_0x1816('0x38')](_0x396e79[_0x1816('0x2e')],function(_0x5c2a74){var _0x11da67={};_0x11da67[_0x5c2a74]={'$like':'%'+_0x4570b7['query'][_0x1816('0x36')]+'%'};return _0x11da67;})});}_0x396e79=_['merge']({},_0x396e79,_0x4570b7[_0x1816('0x3b')]);return _0x32ff65['getFields'](_0x396e79);}})['then'](function(_0x30d642){if(_0x30d642){_0x52d72b=_0x30d642[_0x1816('0x4b')];if(!_0x4570b7[_0x1816('0x2d')]['hasOwnProperty'](_0x1816('0x32'))){_0x396e79['limit']=qs['limit'](_0x4570b7['query']['limit']);_0x396e79[_0x1816('0x1d')]=qs[_0x1816('0x1d')](_0x4570b7[_0x1816('0x2d')][_0x1816('0x1d')]);}return _0x32ff65[_0x1816('0x4d')](_0x396e79);}})[_0x1816('0x3c')](function(_0x32481c){if(_0x32481c){return _0x32481c?{'count':_0x52d72b,'rows':_0x32481c}:null;}})[_0x1816('0x3c')](respondWithResult(_0x266ebd,null))['catch'](handleError(_0x266ebd,null));};exports[_0x1816('0x4e')]=function(_0x12714e,_0x4c819d,_0x1036b9){var _0x4fa2fb={};var _0x42ee87={};var _0x31973b;var _0x3a6c7b;return db[_0x1816('0x28')][_0x1816('0x49')]({'where':{'id':_0x12714e[_0x1816('0x43')]['id']}})[_0x1816('0x3c')](handleEntityNotFound(_0x4c819d,null))['then'](function(_0x2368b0){if(_0x2368b0){_0x31973b=_0x2368b0;_0x42ee87['model']=_[_0x1816('0x44')](db[_0x1816('0x4a')][_0x1816('0x29')]);_0x42ee87[_0x1816('0x2d')]=_[_0x1816('0x44')](_0x12714e[_0x1816('0x2d')]);_0x42ee87['filters']=_[_0x1816('0x2f')](_0x42ee87['model'],_0x42ee87[_0x1816('0x2d')]);_0x4fa2fb[_0x1816('0x2e')]=_['intersection'](_0x42ee87['model'],qs[_0x1816('0x30')](_0x12714e[_0x1816('0x2d')][_0x1816('0x30')]));_0x4fa2fb[_0x1816('0x2e')]=_0x4fa2fb['attributes'][_0x1816('0x4b')]?_0x4fa2fb['attributes']:_0x42ee87[_0x1816('0x2c')];_0x4fa2fb[_0x1816('0x4c')]=qs[_0x1816('0x33')](_0x12714e['query'][_0x1816('0x33')]);_0x4fa2fb['where']=qs[_0x1816('0x34')](_[_0x1816('0x35')](_0x12714e[_0x1816('0x2d')],_0x42ee87['filters']));if(_0x12714e['query'][_0x1816('0x36')]){_0x4fa2fb['where']=_[_0x1816('0x3a')](_0x4fa2fb['where'],{'$or':_['map'](_0x4fa2fb[_0x1816('0x2e')],function(_0x3bb7aa){var _0x162436={};_0x162436[_0x3bb7aa]={'$like':'%'+_0x12714e[_0x1816('0x2d')][_0x1816('0x36')]+'%'};return _0x162436;})});}_0x4fa2fb=_[_0x1816('0x3a')]({},_0x4fa2fb,_0x12714e[_0x1816('0x3b')]);return _0x31973b['getSubjects'](_0x4fa2fb);}})[_0x1816('0x3c')](function(_0x5cbd55){if(_0x5cbd55){_0x3a6c7b=_0x5cbd55[_0x1816('0x4b')];if(!_0x12714e['query'][_0x1816('0x31')]('nolimit')){_0x4fa2fb['limit']=qs[_0x1816('0x20')](_0x12714e[_0x1816('0x2d')][_0x1816('0x20')]);_0x4fa2fb[_0x1816('0x1d')]=qs[_0x1816('0x1d')](_0x12714e[_0x1816('0x2d')][_0x1816('0x1d')]);}return _0x31973b[_0x1816('0x4e')](_0x4fa2fb);}})[_0x1816('0x3c')](function(_0x545b5a){if(_0x545b5a){return _0x545b5a?{'count':_0x3a6c7b,'rows':_0x545b5a}:null;}})['then'](respondWithResult(_0x4c819d,null))[_0x1816('0x41')](handleError(_0x4c819d,null));};exports['getDescriptions']=function(_0x490806,_0x3da3d3,_0x38c9bb){var _0x193678={};var _0x5cef63={};var _0xf7d619;var _0x37a180;return db[_0x1816('0x28')][_0x1816('0x49')]({'where':{'id':_0x490806[_0x1816('0x43')]['id']}})[_0x1816('0x3c')](handleEntityNotFound(_0x3da3d3,null))[_0x1816('0x3c')](function(_0xac0a2){if(_0xac0a2){_0xf7d619=_0xac0a2;_0x5cef63[_0x1816('0x2c')]=_[_0x1816('0x44')](db[_0x1816('0x4a')][_0x1816('0x29')]);_0x5cef63[_0x1816('0x2d')]=_[_0x1816('0x44')](_0x490806['query']);_0x5cef63[_0x1816('0x34')]=_[_0x1816('0x2f')](_0x5cef63[_0x1816('0x2c')],_0x5cef63[_0x1816('0x2d')]);_0x193678[_0x1816('0x2e')]=_[_0x1816('0x2f')](_0x5cef63[_0x1816('0x2c')],qs[_0x1816('0x30')](_0x490806[_0x1816('0x2d')][_0x1816('0x30')]));_0x193678[_0x1816('0x2e')]=_0x193678[_0x1816('0x2e')][_0x1816('0x4b')]?_0x193678['attributes']:_0x5cef63[_0x1816('0x2c')];_0x193678[_0x1816('0x4c')]=qs[_0x1816('0x33')](_0x490806[_0x1816('0x2d')][_0x1816('0x33')]);_0x193678[_0x1816('0x37')]=qs[_0x1816('0x34')](_[_0x1816('0x35')](_0x490806[_0x1816('0x2d')],_0x5cef63[_0x1816('0x34')]));if(_0x490806[_0x1816('0x2d')]['filter']){_0x193678[_0x1816('0x37')]=_[_0x1816('0x3a')](_0x193678[_0x1816('0x37')],{'$or':_[_0x1816('0x38')](_0x193678[_0x1816('0x2e')],function(_0x3a3b79){var _0x1f33b9={};_0x1f33b9[_0x3a3b79]={'$like':'%'+_0x490806[_0x1816('0x2d')]['filter']+'%'};return _0x1f33b9;})});}_0x193678=_[_0x1816('0x3a')]({},_0x193678,_0x490806[_0x1816('0x3b')]);return _0xf7d619[_0x1816('0x4f')](_0x193678);}})['then'](function(_0x345980){if(_0x345980){_0x37a180=_0x345980[_0x1816('0x4b')];if(!_0x490806[_0x1816('0x2d')][_0x1816('0x31')](_0x1816('0x32'))){_0x193678[_0x1816('0x20')]=qs[_0x1816('0x20')](_0x490806['query'][_0x1816('0x20')]);_0x193678[_0x1816('0x1d')]=qs[_0x1816('0x1d')](_0x490806[_0x1816('0x2d')][_0x1816('0x1d')]);}return _0xf7d619[_0x1816('0x4f')](_0x193678);}})[_0x1816('0x3c')](function(_0x174467){if(_0x174467){return _0x174467?{'count':_0x37a180,'rows':_0x174467}:null;}})[_0x1816('0x3c')](respondWithResult(_0x3da3d3,null))[_0x1816('0x41')](handleError(_0x3da3d3,null));};exports[_0x1816('0x50')]=function(_0x1967c8,_0x516bfa,_0x3b3ad9){var _0x372a8a={};var _0x1c8350={};var _0x14228d;var _0x52c038;return db[_0x1816('0x28')][_0x1816('0x49')]({'where':{'id':_0x1967c8['params']['id']}})[_0x1816('0x3c')](handleEntityNotFound(_0x516bfa,null))[_0x1816('0x3c')](function(_0x169a1b){if(_0x169a1b){_0x14228d=_0x169a1b;_0x1c8350['model']=_[_0x1816('0x44')](db[_0x1816('0x51')][_0x1816('0x29')]);_0x1c8350[_0x1816('0x2d')]=_['keys'](_0x1967c8[_0x1816('0x2d')]);_0x1c8350[_0x1816('0x34')]=_[_0x1816('0x2f')](_0x1c8350[_0x1816('0x2c')],_0x1c8350[_0x1816('0x2d')]);_0x372a8a['attributes']=_[_0x1816('0x2f')](_0x1c8350[_0x1816('0x2c')],qs[_0x1816('0x30')](_0x1967c8[_0x1816('0x2d')][_0x1816('0x30')]));_0x372a8a['attributes']=_0x372a8a[_0x1816('0x2e')][_0x1816('0x4b')]?_0x372a8a[_0x1816('0x2e')]:_0x1c8350[_0x1816('0x2c')];_0x372a8a[_0x1816('0x4c')]=qs['sort'](_0x1967c8[_0x1816('0x2d')]['sort']);_0x372a8a[_0x1816('0x37')]=qs[_0x1816('0x34')](_[_0x1816('0x35')](_0x1967c8[_0x1816('0x2d')],_0x1c8350[_0x1816('0x34')]));if(_0x1967c8['query'][_0x1816('0x36')]){_0x372a8a['where']=_[_0x1816('0x3a')](_0x372a8a[_0x1816('0x37')],{'$or':_[_0x1816('0x38')](_0x372a8a[_0x1816('0x2e')],function(_0x1f4fd0){var _0x36a763={};_0x36a763[_0x1f4fd0]={'$like':'%'+_0x1967c8['query'][_0x1816('0x36')]+'%'};return _0x36a763;})});}_0x372a8a=_[_0x1816('0x3a')]({},_0x372a8a,_0x1967c8['options']);return _0x14228d[_0x1816('0x50')](_0x372a8a);}})[_0x1816('0x3c')](function(_0x4f2b9e){if(_0x4f2b9e){_0x52c038=_0x4f2b9e[_0x1816('0x4b')];if(!_0x1967c8[_0x1816('0x2d')]['hasOwnProperty'](_0x1816('0x32'))){_0x372a8a['limit']=qs[_0x1816('0x20')](_0x1967c8[_0x1816('0x2d')][_0x1816('0x20')]);_0x372a8a['offset']=qs[_0x1816('0x1d')](_0x1967c8[_0x1816('0x2d')]['offset']);}return _0x14228d[_0x1816('0x50')](_0x372a8a);}})['then'](function(_0x6822a1){if(_0x6822a1){return _0x6822a1?{'count':_0x52c038,'rows':_0x6822a1}:null;}})[_0x1816('0x3c')](respondWithResult(_0x516bfa,null))[_0x1816('0x41')](handleError(_0x516bfa,null));};exports[_0x1816('0x52')]=function(_0xdbca81,_0x3bfab6,_0x1ddb9a){if(_0xdbca81[_0x1816('0x46')]['id']){delete _0xdbca81[_0x1816('0x46')]['id'];}return db[_0x1816('0x28')]['findOne']({'where':{'id':_0xdbca81[_0x1816('0x43')]['id']}})[_0x1816('0x3c')](handleEntityNotFound(_0x3bfab6,null))[_0x1816('0x3c')](function(_0x1e452f){if(_0x1e452f){return _0x1e452f[_0x1816('0x52')](_0xdbca81[_0x1816('0x46')][_0x1816('0x53')]||[]);}return null;})[_0x1816('0x3c')](respondWithResult(_0x3bfab6,null))['catch'](handleError(_0x3bfab6,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index fac75b6..a022dfe 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 _0xdf03=['path','rimraf','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdf03,0x73));var _0x3df0=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0xdf03[_0x1c3370];return _0xa9b358;};'use strict';var _=require(_0x3df0('0x0'));var util=require(_0x3df0('0x1'));var logger=require(_0x3df0('0x2'))('api');var moment=require(_0x3df0('0x3'));var BPromise=require(_0x3df0('0x4'));var rp=require(_0x3df0('0x5'));var fs=require('fs');var path=require(_0x3df0('0x6'));var rimraf=require(_0x3df0('0x7'));var config=require('../../config/environment');var attributes=require(_0x3df0('0x8'));module['exports']=function(_0x3d20c1,_0x7e0fd8){return _0x3d20c1['define'](_0x3df0('0x9'),attributes,{'tableName':_0x3df0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd99=['../../config/logger','api','bluebird','request-promise','./intDeskConfiguration.attributes','exports','DeskConfiguration','util'];(function(_0x4d69d1,_0x211712){var _0x4950ad=function(_0x4868b8){while(--_0x4868b8){_0x4d69d1['push'](_0x4d69d1['shift']());}};_0x4950ad(++_0x211712);}(_0xbd99,0xff));var _0x9bd9=function(_0x5174bd,_0x4ab1b){_0x5174bd=_0x5174bd-0x0;var _0x2ada2e=_0xbd99[_0x5174bd];return _0x2ada2e;};'use strict';var _=require('lodash');var util=require(_0x9bd9('0x0'));var logger=require(_0x9bd9('0x1'))(_0x9bd9('0x2'));var moment=require('moment');var BPromise=require(_0x9bd9('0x3'));var rp=require(_0x9bd9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9bd9('0x5'));module[_0x9bd9('0x6')]=function(_0x7fa349,_0x5cf379){return _0x7fa349['define'](_0x9bd9('0x7'),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 1efb859..d607cc2 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 _0xa413=['result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info'];(function(_0x1f782d,_0x5906b8){var _0x228cce=function(_0x3036cc){while(--_0x3036cc){_0x1f782d['push'](_0x1f782d['shift']());}};_0x228cce(++_0x5906b8);}(_0xa413,0x1e5));var _0x3a41=function(_0x34a89a,_0x547e48){_0x34a89a=_0x34a89a-0x0;var _0x378dd3=_0xa413[_0x34a89a];return _0x378dd3;};'use strict';var _=require(_0x3a41('0x0'));var util=require('util');var moment=require(_0x3a41('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a41('0x2'));var fs=require('fs');var Redis=require(_0x3a41('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a41('0x4'))(_0x3a41('0x5'));var config=require(_0x3a41('0x6'));var jayson=require(_0x3a41('0x7'));var client=jayson[_0x3a41('0x8')][_0x3a41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45f6d2,_0x407d52,_0xca7253){return new BPromise(function(_0x473cd2,_0x27c2e5){return client['request'](_0x45f6d2,_0xca7253)[_0x3a41('0xa')](function(_0x570304){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x407d52,_0x3a41('0xb'));logger['debug'](_0x3a41('0xc'),_0x407d52,'request\x20sent',JSON[_0x3a41('0xd')](_0x570304));if(_0x570304[_0x3a41('0xe')]){if(_0x570304['error'][_0x3a41('0xf')]===0x1f4){logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x27c2e5(_0x570304['error'][_0x3a41('0x11')]);}logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x473cd2(_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);}else{logger[_0x3a41('0x12')](_0x3a41('0x10'),_0x407d52,_0x3a41('0xb'));_0x473cd2(_0x570304[_0x3a41('0x13')]['message']);}})[_0x3a41('0x14')](function(_0x30d675){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x407d52,_0x30d675);_0x27c2e5(_0x30d675);});});} \ No newline at end of file +var _0x70e3=['then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x44bbc2,_0x6bfeb8){var _0x1ab9c0=function(_0x28ef29){while(--_0x28ef29){_0x44bbc2['push'](_0x44bbc2['shift']());}};_0x1ab9c0(++_0x6bfeb8);}(_0x70e3,0x9d));var _0x370e=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x70e3[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var moment=require(_0x370e('0x2'));var BPromise=require(_0x370e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x370e('0x4'));var db=require(_0x370e('0x5'))['db'];var utils=require(_0x370e('0x6'));var logger=require('../../config/logger')(_0x370e('0x7'));var config=require(_0x370e('0x8'));var jayson=require(_0x370e('0x9'));var client=jayson[_0x370e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2aaf,_0x5f57ea,_0x4a6884){return new BPromise(function(_0x5e5c79,_0x4086c4){return client['request'](_0x3a2aaf,_0x4a6884)[_0x370e('0xb')](function(_0x52d611){logger[_0x370e('0xc')](_0x370e('0xd'),_0x5f57ea,'request\x20sent');logger['debug'](_0x370e('0xe'),_0x5f57ea,_0x370e('0xf'),JSON[_0x370e('0x10')](_0x52d611));if(_0x52d611[_0x370e('0x11')]){if(_0x52d611[_0x370e('0x11')]['code']===0x1f4){logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x4086c4(_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);}logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x5e5c79(_0x52d611[_0x370e('0x11')]['message']);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5f57ea,_0x370e('0xf'));_0x5e5c79(_0x52d611[_0x370e('0x13')][_0x370e('0x12')]);}})[_0x370e('0x14')](function(_0xb8381f){logger[_0x370e('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x5f57ea,_0xb8381f);_0x4086c4(_0xb8381f);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 65b054b..6516d15 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 _0x51c5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','exports','path','connect-timeout','express','Router'];(function(_0x194810,_0x18ca17){var _0x321409=function(_0x51b113){while(--_0x51b113){_0x194810['push'](_0x194810['shift']());}};_0x321409(++_0x18ca17);}(_0x51c5,0xc8));var _0x551c=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x51c5[_0x5627e1];return _0x2f013f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x551c('0x0'));var timeout=require(_0x551c('0x1'));var express=require(_0x551c('0x2'));var router=express[_0x551c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x551c('0x4'));var interaction=require(_0x551c('0x5'));var config=require(_0x551c('0x6'));var controller=require(_0x551c('0x7'));router[_0x551c('0x8')]('/',auth[_0x551c('0x9')](),controller['index']);router[_0x551c('0x8')](_0x551c('0xa'),auth[_0x551c('0x9')](),controller[_0x551c('0xb')]);router[_0x551c('0xc')]('/',auth[_0x551c('0x9')](),controller[_0x551c('0xd')]);router[_0x551c('0xe')](_0x551c('0xa'),auth[_0x551c('0x9')](),controller['update']);router['delete'](_0x551c('0xa'),auth['isAuthenticated'](),controller[_0x551c('0xf')]);module[_0x551c('0x10')]=router; \ No newline at end of file +var _0xcbde=['../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x128de4,_0x511592){var _0x167659=function(_0x5d4b6d){while(--_0x5d4b6d){_0x128de4['push'](_0x128de4['shift']());}};_0x167659(++_0x511592);}(_0xcbde,0x1df));var _0xecbd=function(_0x3de08c,_0x5bb265){_0x3de08c=_0x3de08c-0x0;var _0x1631a7=_0xcbde[_0x3de08c];return _0x1631a7;};'use strict';var multer=require('multer');var util=require(_0xecbd('0x0'));var path=require(_0xecbd('0x1'));var timeout=require(_0xecbd('0x2'));var express=require('express');var router=express[_0xecbd('0x3')]();var fs_extra=require(_0xecbd('0x4'));var auth=require(_0xecbd('0x5'));var interaction=require(_0xecbd('0x6'));var config=require(_0xecbd('0x7'));var controller=require(_0xecbd('0x8'));router[_0xecbd('0x9')]('/',auth[_0xecbd('0xa')](),controller[_0xecbd('0xb')]);router['get'](_0xecbd('0xc'),auth['isAuthenticated'](),controller[_0xecbd('0xd')]);router[_0xecbd('0xe')]('/',auth[_0xecbd('0xa')](),controller[_0xecbd('0xf')]);router['put'](_0xecbd('0xc'),auth['isAuthenticated'](),controller[_0xecbd('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xecbd('0x11')]);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 6887d79..d05fdf7 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 _0x0a5a=['variable','customVariable','picklist','string','STRING','exports'];(function(_0x329397,_0x102228){var _0x126bf9=function(_0x54215c){while(--_0x54215c){_0x329397['push'](_0x329397['shift']());}};_0x126bf9(++_0x102228);}(_0x0a5a,0x1e5));var _0xa0a5=function(_0x4f3f44,_0x27f107){_0x4f3f44=_0x4f3f44-0x0;var _0x2d98d1=_0x0a5a[_0x4f3f44];return _0x2d98d1;};'use strict';var Sequelize=require('sequelize');module[_0xa0a5('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xa0a5('0x1'),_0xa0a5('0x2'),'keyValue',_0xa0a5('0x3')),'defaultValue':_0xa0a5('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa0a5('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0xa0a5('0x1'),_0xa0a5('0x2'))},'keyContent':{'type':Sequelize[_0xa0a5('0x5')]},'idField':{'type':Sequelize[_0xa0a5('0x5')]},'nameField':{'type':Sequelize[_0xa0a5('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1d96=['keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x80ba2,_0x266084){var _0x3551f2=function(_0x14ed16){while(--_0x14ed16){_0x80ba2['push'](_0x80ba2['shift']());}};_0x3551f2(++_0x266084);}(_0x1d96,0xeb));var _0x61d9=function(_0x3d0958,_0x204a7e){_0x3d0958=_0x3d0958-0x0;var _0x1c77f8=_0x1d96[_0x3d0958];return _0x1c77f8;};'use strict';var Sequelize=require(_0x61d9('0x0'));module[_0x61d9('0x1')]={'type':{'type':Sequelize[_0x61d9('0x2')](_0x61d9('0x3'),_0x61d9('0x4'),'customVariable',_0x61d9('0x5'),_0x61d9('0x6')),'defaultValue':_0x61d9('0x3')},'content':{'type':Sequelize[_0x61d9('0x7')]},'key':{'type':Sequelize[_0x61d9('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x61d9('0x4'),_0x61d9('0x8'))},'keyContent':{'type':Sequelize[_0x61d9('0x7')]},'idField':{'type':Sequelize[_0x61d9('0x7')]},'nameField':{'type':Sequelize[_0x61d9('0x7')]},'customField':{'type':Sequelize[_0x61d9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x61d9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index e12208e..c02651c 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 _0x49c1=['save','update','then','destroy','sendStatus','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','includeAll','include','rows','catch','params','keys','find','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x354760,_0x256c41){var _0x499c94=function(_0x3b6750){while(--_0x3b6750){_0x354760['push'](_0x354760['shift']());}};_0x499c94(++_0x256c41);}(_0x49c1,0xef));var _0x149c=function(_0x5a5fc8,_0x2a1c05){_0x5a5fc8=_0x5a5fc8-0x0;var _0x3df2a9=_0x49c1[_0x5a5fc8];return _0x3df2a9;};'use strict';var emlformat=require(_0x149c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x149c('0x1'));var jsonpatch=require(_0x149c('0x2'));var rp=require(_0x149c('0x3'));var moment=require('moment');var BPromise=require(_0x149c('0x4'));var Mustache=require(_0x149c('0x5'));var util=require('util');var path=require(_0x149c('0x6'));var sox=require(_0x149c('0x7'));var csv=require('to-csv');var ejs=require(_0x149c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x149c('0x9'));var squel=require(_0x149c('0xa'));var crypto=require('crypto');var jsforce=require(_0x149c('0xb'));var deskjs=require(_0x149c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x149c('0xd'));var Papa=require(_0x149c('0xe'));var Redis=require('ioredis');var authService=require(_0x149c('0xf'));var qs=require(_0x149c('0x10'));var as=require(_0x149c('0x11'));var hardwareService=require(_0x149c('0x12'));var logger=require('../../config/logger')(_0x149c('0x13'));var utils=require(_0x149c('0x14'));var config=require(_0x149c('0x15'));var licenseUtil=require(_0x149c('0x16'));var db=require(_0x149c('0x17'))['db'];function respondWithStatusCode(_0x19e0b1,_0x1a0c32){_0x1a0c32=_0x1a0c32||0xcc;return function(_0x2310b8){if(_0x2310b8){return _0x19e0b1['sendStatus'](_0x1a0c32);}return _0x19e0b1[_0x149c('0x18')](_0x1a0c32)[_0x149c('0x19')]();};}function respondWithResult(_0x4aee29,_0x3b247e){_0x3b247e=_0x3b247e||0xc8;return function(_0x4e6cbc){if(_0x4e6cbc){return _0x4aee29[_0x149c('0x18')](_0x3b247e)[_0x149c('0x1a')](_0x4e6cbc);}};}function respondWithFilteredResult(_0x177800,_0x471e93){return function(_0x3d851a){if(_0x3d851a){var _0x30f8c1=typeof _0x471e93[_0x149c('0x1b')]===_0x149c('0x1c')&&typeof _0x471e93[_0x149c('0x1d')]==='undefined';var _0x449ac4=_0x3d851a[_0x149c('0x1e')];var _0x352f68=_0x30f8c1?0x0:_0x471e93[_0x149c('0x1b')];var _0x35f64f=_0x30f8c1?_0x3d851a[_0x149c('0x1e')]:_0x471e93[_0x149c('0x1b')]+_0x471e93[_0x149c('0x1d')];var _0x5910bd;if(_0x35f64f>=_0x449ac4){_0x35f64f=_0x449ac4;_0x5910bd=0xc8;}else{_0x5910bd=0xce;}_0x177800[_0x149c('0x18')](_0x5910bd);return _0x177800['set']('Content-Range',_0x352f68+'-'+_0x35f64f+'/'+_0x449ac4)['json'](_0x3d851a);}return null;};}function patchUpdates(_0x4c9b41){return function(_0x14194d){try{jsonpatch[_0x149c('0x1f')](_0x14194d,_0x4c9b41,!![]);}catch(_0xc1e2d6){return BPromise[_0x149c('0x20')](_0xc1e2d6);}return _0x14194d[_0x149c('0x21')]();};}function saveUpdates(_0x184924,_0x4e663e){return function(_0x398203){if(_0x398203){return _0x398203[_0x149c('0x22')](_0x184924)[_0x149c('0x23')](function(_0x178cf6){return _0x178cf6;});}return null;};}function removeEntity(_0x2cdd54,_0xb60e06){return function(_0x238363){if(_0x238363){return _0x238363[_0x149c('0x24')]()['then'](function(){_0x2cdd54[_0x149c('0x18')](0xcc)[_0x149c('0x19')]();});}};}function handleEntityNotFound(_0x4bb447,_0x29b216){return function(_0xac3cec){if(!_0xac3cec){_0x4bb447[_0x149c('0x25')](0x194);}return _0xac3cec;};}function handleError(_0x2b27f4,_0x5a16cb){_0x5a16cb=_0x5a16cb||0x1f4;return function(_0x36e070){logger[_0x149c('0x26')](_0x36e070[_0x149c('0x27')]);if(_0x36e070[_0x149c('0x28')]){delete _0x36e070[_0x149c('0x28')];}_0x2b27f4[_0x149c('0x18')](_0x5a16cb)[_0x149c('0x29')](_0x36e070);};}exports['index']=function(_0x55c85f,_0x5ea478){var _0x1203f2={},_0x2da1de={},_0x5a268b={'count':0x0,'rows':[]};var _0x7eddc0=_[_0x149c('0x2a')](db[_0x149c('0x2b')][_0x149c('0x2c')],function(_0x561445){return{'name':_0x561445[_0x149c('0x2d')],'type':_0x561445[_0x149c('0x2e')][_0x149c('0x2f')]};});_0x2da1de[_0x149c('0x30')]=_[_0x149c('0x2a')](_0x7eddc0,'name');_0x2da1de[_0x149c('0x31')]=_['keys'](_0x55c85f[_0x149c('0x31')]);_0x2da1de[_0x149c('0x32')]=_[_0x149c('0x33')](_0x2da1de[_0x149c('0x30')],_0x2da1de[_0x149c('0x31')]);_0x1203f2[_0x149c('0x34')]=_[_0x149c('0x33')](_0x2da1de['model'],qs[_0x149c('0x35')](_0x55c85f['query'][_0x149c('0x35')]));_0x1203f2['attributes']=_0x1203f2[_0x149c('0x34')]['length']?_0x1203f2[_0x149c('0x34')]:_0x2da1de[_0x149c('0x30')];if(!_0x55c85f['query']['hasOwnProperty'](_0x149c('0x36'))){_0x1203f2[_0x149c('0x1d')]=qs['limit'](_0x55c85f['query'][_0x149c('0x1d')]);_0x1203f2[_0x149c('0x1b')]=qs[_0x149c('0x1b')](_0x55c85f[_0x149c('0x31')][_0x149c('0x1b')]);}_0x1203f2[_0x149c('0x37')]=qs['sort'](_0x55c85f[_0x149c('0x31')][_0x149c('0x38')]);_0x1203f2[_0x149c('0x39')]=qs[_0x149c('0x32')](_['pick'](_0x55c85f[_0x149c('0x31')],_0x2da1de[_0x149c('0x32')]),_0x7eddc0);if(_0x55c85f[_0x149c('0x31')][_0x149c('0x3a')]){_0x1203f2['where']=_['merge'](_0x1203f2[_0x149c('0x39')],{'$or':_[_0x149c('0x2a')](_0x7eddc0,function(_0x48e4ca){if(_0x48e4ca[_0x149c('0x2e')]!=='VIRTUAL'){var _0xe18636={};_0xe18636[_0x48e4ca[_0x149c('0x28')]]={'$like':'%'+_0x55c85f[_0x149c('0x31')][_0x149c('0x3a')]+'%'};return _0xe18636;}})});}_0x1203f2=_[_0x149c('0x3b')]({},_0x1203f2,_0x55c85f['options']);var _0x36b9ce={'where':_0x1203f2[_0x149c('0x39')]};return db['DeskField']['count'](_0x36b9ce)[_0x149c('0x23')](function(_0xeecd72){_0x5a268b['count']=_0xeecd72;if(_0x55c85f[_0x149c('0x31')][_0x149c('0x3c')]){_0x1203f2[_0x149c('0x3d')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x1203f2);})[_0x149c('0x23')](function(_0x14f790){_0x5a268b[_0x149c('0x3e')]=_0x14f790;return _0x5a268b;})['then'](respondWithFilteredResult(_0x5ea478,_0x1203f2))[_0x149c('0x3f')](handleError(_0x5ea478,null));};exports['show']=function(_0x47d8fd,_0x3fc899){var _0x26418d={'raw':!![],'where':{'id':_0x47d8fd[_0x149c('0x40')]['id']}},_0x154a3c={};_0x154a3c[_0x149c('0x30')]=_[_0x149c('0x41')](db['DeskField'][_0x149c('0x2c')]);_0x154a3c[_0x149c('0x31')]=_[_0x149c('0x41')](_0x47d8fd[_0x149c('0x31')]);_0x154a3c[_0x149c('0x32')]=_[_0x149c('0x33')](_0x154a3c[_0x149c('0x30')],_0x154a3c[_0x149c('0x31')]);_0x26418d[_0x149c('0x34')]=_[_0x149c('0x33')](_0x154a3c['model'],qs[_0x149c('0x35')](_0x47d8fd[_0x149c('0x31')][_0x149c('0x35')]));_0x26418d[_0x149c('0x34')]=_0x26418d[_0x149c('0x34')]['length']?_0x26418d['attributes']:_0x154a3c[_0x149c('0x30')];if(_0x47d8fd['query'][_0x149c('0x3c')]){_0x26418d[_0x149c('0x3d')]=[{'all':!![]}];}_0x26418d=_['merge']({},_0x26418d,_0x47d8fd['options']);return db[_0x149c('0x2b')][_0x149c('0x42')](_0x26418d)[_0x149c('0x23')](handleEntityNotFound(_0x3fc899,null))[_0x149c('0x23')](respondWithResult(_0x3fc899,null))['catch'](handleError(_0x3fc899,null));};exports['create']=function(_0x24983b,_0x25584b){return db['DeskField']['create'](_0x24983b['body'],{})[_0x149c('0x23')](respondWithResult(_0x25584b,0xc9))[_0x149c('0x3f')](handleError(_0x25584b,null));};exports[_0x149c('0x22')]=function(_0x1cbc98,_0x54a99b){if(_0x1cbc98[_0x149c('0x43')]['id']){delete _0x1cbc98[_0x149c('0x43')]['id'];}return db[_0x149c('0x2b')]['find']({'where':{'id':_0x1cbc98[_0x149c('0x40')]['id']}})[_0x149c('0x23')](handleEntityNotFound(_0x54a99b,null))['then'](saveUpdates(_0x1cbc98['body'],null))['then'](respondWithResult(_0x54a99b,null))['catch'](handleError(_0x54a99b,null));};exports[_0x149c('0x24')]=function(_0x437ae0,_0x16cae8){return db['DeskField'][_0x149c('0x42')]({'where':{'id':_0x437ae0['params']['id']}})[_0x149c('0x23')](handleEntityNotFound(_0x16cae8,null))['then'](removeEntity(_0x16cae8,null))[_0x149c('0x3f')](handleError(_0x16cae8,null));}; \ No newline at end of file +var _0x8cc1=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','name','index','map','DeskField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','intersection','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2a31b9,_0x4a634d){var _0x5cda05=function(_0x5d0c0c){while(--_0x5d0c0c){_0x2a31b9['push'](_0x2a31b9['shift']());}};_0x5cda05(++_0x4a634d);}(_0x8cc1,0x14e));var _0x18cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8cc1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x18cc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x18cc('0x1'));var rp=require(_0x18cc('0x2'));var moment=require(_0x18cc('0x3'));var BPromise=require(_0x18cc('0x4'));var Mustache=require('mustache');var util=require(_0x18cc('0x5'));var path=require('path');var sox=require(_0x18cc('0x6'));var csv=require(_0x18cc('0x7'));var ejs=require(_0x18cc('0x8'));var fs=require('fs');var fs_extra=require(_0x18cc('0x9'));var _=require(_0x18cc('0xa'));var squel=require('squel');var crypto=require(_0x18cc('0xb'));var jsforce=require(_0x18cc('0xc'));var deskjs=require(_0x18cc('0xd'));var toCsv=require(_0x18cc('0x7'));var querystring=require(_0x18cc('0xe'));var Papa=require(_0x18cc('0xf'));var Redis=require('ioredis');var authService=require(_0x18cc('0x10'));var qs=require(_0x18cc('0x11'));var as=require(_0x18cc('0x12'));var hardwareService=require(_0x18cc('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x18cc('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x18cc('0x15'))['db'];function respondWithStatusCode(_0x38bedc,_0x1903d6){_0x1903d6=_0x1903d6||0xcc;return function(_0x4b0720){if(_0x4b0720){return _0x38bedc[_0x18cc('0x16')](_0x1903d6);}return _0x38bedc[_0x18cc('0x17')](_0x1903d6)['end']();};}function respondWithResult(_0x5c6d68,_0x27394f){_0x27394f=_0x27394f||0xc8;return function(_0x5ccbd4){if(_0x5ccbd4){return _0x5c6d68[_0x18cc('0x17')](_0x27394f)['json'](_0x5ccbd4);}};}function respondWithFilteredResult(_0x24e72b,_0x5dfd5c){return function(_0x343807){if(_0x343807){var _0x439e57=typeof _0x5dfd5c[_0x18cc('0x18')]==='undefined'&&typeof _0x5dfd5c[_0x18cc('0x19')]==='undefined';var _0x4bda78=_0x343807[_0x18cc('0x1a')];var _0x104fc4=_0x439e57?0x0:_0x5dfd5c[_0x18cc('0x18')];var _0x19884a=_0x439e57?_0x343807['count']:_0x5dfd5c[_0x18cc('0x18')]+_0x5dfd5c[_0x18cc('0x19')];var _0x201b2b;if(_0x19884a>=_0x4bda78){_0x19884a=_0x4bda78;_0x201b2b=0xc8;}else{_0x201b2b=0xce;}_0x24e72b[_0x18cc('0x17')](_0x201b2b);return _0x24e72b[_0x18cc('0x1b')](_0x18cc('0x1c'),_0x104fc4+'-'+_0x19884a+'/'+_0x4bda78)[_0x18cc('0x1d')](_0x343807);}return null;};}function patchUpdates(_0x313277){return function(_0x44adfa){try{jsonpatch[_0x18cc('0x1e')](_0x44adfa,_0x313277,!![]);}catch(_0x1259ca){return BPromise[_0x18cc('0x1f')](_0x1259ca);}return _0x44adfa[_0x18cc('0x20')]();};}function saveUpdates(_0x1f1abf,_0x244f3c){return function(_0x2ce670){if(_0x2ce670){return _0x2ce670[_0x18cc('0x21')](_0x1f1abf)[_0x18cc('0x22')](function(_0x2a19cf){return _0x2a19cf;});}return null;};}function removeEntity(_0x53ae78,_0x4b2358){return function(_0x2729b1){if(_0x2729b1){return _0x2729b1['destroy']()['then'](function(){_0x53ae78[_0x18cc('0x17')](0xcc)[_0x18cc('0x23')]();});}};}function handleEntityNotFound(_0x8ebbf4,_0x444c19){return function(_0x2591cf){if(!_0x2591cf){_0x8ebbf4[_0x18cc('0x16')](0x194);}return _0x2591cf;};}function handleError(_0x12cb3c,_0xaccd85){_0xaccd85=_0xaccd85||0x1f4;return function(_0x217793){logger['error'](_0x217793['stack']);if(_0x217793[_0x18cc('0x24')]){delete _0x217793[_0x18cc('0x24')];}_0x12cb3c[_0x18cc('0x17')](_0xaccd85)['send'](_0x217793);};}exports[_0x18cc('0x25')]=function(_0x4e3970,_0x1c5964){var _0x378fb6={},_0x3f1a24={},_0x206175={'count':0x0,'rows':[]};var _0x2cab1e=_[_0x18cc('0x26')](db[_0x18cc('0x27')][_0x18cc('0x28')],function(_0x50af21){return{'name':_0x50af21[_0x18cc('0x29')],'type':_0x50af21[_0x18cc('0x2a')]['key']};});_0x3f1a24[_0x18cc('0x2b')]=_[_0x18cc('0x26')](_0x2cab1e,_0x18cc('0x24'));_0x3f1a24[_0x18cc('0x2c')]=_[_0x18cc('0x2d')](_0x4e3970[_0x18cc('0x2c')]);_0x3f1a24[_0x18cc('0x2e')]=_['intersection'](_0x3f1a24['model'],_0x3f1a24[_0x18cc('0x2c')]);_0x378fb6[_0x18cc('0x2f')]=_['intersection'](_0x3f1a24['model'],qs[_0x18cc('0x30')](_0x4e3970[_0x18cc('0x2c')][_0x18cc('0x30')]));_0x378fb6[_0x18cc('0x2f')]=_0x378fb6[_0x18cc('0x2f')][_0x18cc('0x31')]?_0x378fb6['attributes']:_0x3f1a24[_0x18cc('0x2b')];if(!_0x4e3970[_0x18cc('0x2c')][_0x18cc('0x32')](_0x18cc('0x33'))){_0x378fb6[_0x18cc('0x19')]=qs['limit'](_0x4e3970[_0x18cc('0x2c')][_0x18cc('0x19')]);_0x378fb6[_0x18cc('0x18')]=qs[_0x18cc('0x18')](_0x4e3970[_0x18cc('0x2c')][_0x18cc('0x18')]);}_0x378fb6[_0x18cc('0x34')]=qs['sort'](_0x4e3970[_0x18cc('0x2c')][_0x18cc('0x35')]);_0x378fb6['where']=qs[_0x18cc('0x2e')](_[_0x18cc('0x36')](_0x4e3970[_0x18cc('0x2c')],_0x3f1a24[_0x18cc('0x2e')]),_0x2cab1e);if(_0x4e3970[_0x18cc('0x2c')]['filter']){_0x378fb6[_0x18cc('0x37')]=_[_0x18cc('0x38')](_0x378fb6[_0x18cc('0x37')],{'$or':_['map'](_0x2cab1e,function(_0x519fb1){if(_0x519fb1[_0x18cc('0x2a')]!==_0x18cc('0x39')){var _0x4b679c={};_0x4b679c[_0x519fb1[_0x18cc('0x24')]]={'$like':'%'+_0x4e3970[_0x18cc('0x2c')][_0x18cc('0x3a')]+'%'};return _0x4b679c;}})});}_0x378fb6=_[_0x18cc('0x38')]({},_0x378fb6,_0x4e3970[_0x18cc('0x3b')]);var _0x508e64={'where':_0x378fb6[_0x18cc('0x37')]};return db[_0x18cc('0x27')][_0x18cc('0x1a')](_0x508e64)[_0x18cc('0x22')](function(_0x384dff){_0x206175[_0x18cc('0x1a')]=_0x384dff;if(_0x4e3970['query'][_0x18cc('0x3c')]){_0x378fb6[_0x18cc('0x3d')]=[{'all':!![]}];}return db[_0x18cc('0x27')]['findAll'](_0x378fb6);})[_0x18cc('0x22')](function(_0xb12dee){_0x206175[_0x18cc('0x3e')]=_0xb12dee;return _0x206175;})[_0x18cc('0x22')](respondWithFilteredResult(_0x1c5964,_0x378fb6))[_0x18cc('0x3f')](handleError(_0x1c5964,null));};exports[_0x18cc('0x40')]=function(_0x281774,_0x1dc24f){var _0x257e1e={'raw':!![],'where':{'id':_0x281774[_0x18cc('0x41')]['id']}},_0x175062={};_0x175062[_0x18cc('0x2b')]=_[_0x18cc('0x2d')](db[_0x18cc('0x27')][_0x18cc('0x28')]);_0x175062[_0x18cc('0x2c')]=_[_0x18cc('0x2d')](_0x281774[_0x18cc('0x2c')]);_0x175062[_0x18cc('0x2e')]=_['intersection'](_0x175062[_0x18cc('0x2b')],_0x175062[_0x18cc('0x2c')]);_0x257e1e[_0x18cc('0x2f')]=_[_0x18cc('0x42')](_0x175062[_0x18cc('0x2b')],qs[_0x18cc('0x30')](_0x281774[_0x18cc('0x2c')]['fields']));_0x257e1e[_0x18cc('0x2f')]=_0x257e1e[_0x18cc('0x2f')]['length']?_0x257e1e[_0x18cc('0x2f')]:_0x175062[_0x18cc('0x2b')];if(_0x281774['query']['includeAll']){_0x257e1e[_0x18cc('0x3d')]=[{'all':!![]}];}_0x257e1e=_[_0x18cc('0x38')]({},_0x257e1e,_0x281774[_0x18cc('0x3b')]);return db[_0x18cc('0x27')]['find'](_0x257e1e)[_0x18cc('0x22')](handleEntityNotFound(_0x1dc24f,null))[_0x18cc('0x22')](respondWithResult(_0x1dc24f,null))[_0x18cc('0x3f')](handleError(_0x1dc24f,null));};exports[_0x18cc('0x43')]=function(_0x172867,_0x3566bb){return db[_0x18cc('0x27')]['create'](_0x172867[_0x18cc('0x44')],{})['then'](respondWithResult(_0x3566bb,0xc9))[_0x18cc('0x3f')](handleError(_0x3566bb,null));};exports[_0x18cc('0x21')]=function(_0x3a498a,_0x470709){if(_0x3a498a[_0x18cc('0x44')]['id']){delete _0x3a498a[_0x18cc('0x44')]['id'];}return db[_0x18cc('0x27')][_0x18cc('0x45')]({'where':{'id':_0x3a498a[_0x18cc('0x41')]['id']}})[_0x18cc('0x22')](handleEntityNotFound(_0x470709,null))[_0x18cc('0x22')](saveUpdates(_0x3a498a[_0x18cc('0x44')],null))[_0x18cc('0x22')](respondWithResult(_0x470709,null))[_0x18cc('0x3f')](handleError(_0x470709,null));};exports['destroy']=function(_0x392818,_0x519a91){return db['DeskField']['find']({'where':{'id':_0x392818['params']['id']}})[_0x18cc('0x22')](handleEntityNotFound(_0x519a91,null))[_0x18cc('0x22')](removeEntity(_0x519a91,null))[_0x18cc('0x3f')](handleError(_0x519a91,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index d5766f3..1e5ab63 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 _0x760e=['request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x433299,_0x2b09dd){var _0x3eb48d=function(_0x96e751){while(--_0x96e751){_0x433299['push'](_0x433299['shift']());}};_0x3eb48d(++_0x2b09dd);}(_0x760e,0x1df));var _0xe760=function(_0x1d8fa8,_0x4b699d){_0x1d8fa8=_0x1d8fa8-0x0;var _0x37396d=_0x760e[_0x1d8fa8];return _0x37396d;};'use strict';var _=require(_0xe760('0x0'));var util=require('util');var logger=require(_0xe760('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe760('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe760('0x3'));var config=require(_0xe760('0x4'));var attributes=require(_0xe760('0x5'));module[_0xe760('0x6')]=function(_0x309ff9,_0x3bced6){return _0x309ff9[_0xe760('0x7')](_0xe760('0x8'),attributes,{'tableName':_0xe760('0x9'),'paranoid':![],'indexes':[{'name':_0xe760('0xa'),'fields':[_0xe760('0xb'),_0xe760('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5aab=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','FieldId','lodash'];(function(_0x1ee126,_0x2b72a1){var _0x617309=function(_0x418baf){while(--_0x418baf){_0x1ee126['push'](_0x1ee126['shift']());}};_0x617309(++_0x2b72a1);}(_0x5aab,0x81));var _0xb5aa=function(_0xb903cb,_0x4e55aa){_0xb903cb=_0xb903cb-0x0;var _0x15f21b=_0x5aab[_0xb903cb];return _0x15f21b;};'use strict';var _=require(_0xb5aa('0x0'));var util=require(_0xb5aa('0x1'));var logger=require(_0xb5aa('0x2'))('api');var moment=require(_0xb5aa('0x3'));var BPromise=require('bluebird');var rp=require(_0xb5aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb5aa('0x5'));var config=require(_0xb5aa('0x6'));var attributes=require(_0xb5aa('0x7'));module[_0xb5aa('0x8')]=function(_0x46ea8a,_0x2e1174){return _0x46ea8a[_0xb5aa('0x9')](_0xb5aa('0xa'),attributes,{'tableName':_0xb5aa('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0xb5aa('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 4e1ee83..f57ea51 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 _0x04d4=['../../config/environment','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x266876,_0x5dbbb8){var _0x22de81=function(_0x40888c){while(--_0x40888c){_0x266876['push'](_0x266876['shift']());}};_0x22de81(++_0x5dbbb8);}(_0x04d4,0x8b));var _0x404d=function(_0x3a20f9,_0x474946){_0x3a20f9=_0x3a20f9-0x0;var _0x2cc897=_0x04d4[_0x3a20f9];return _0x2cc897;};'use strict';var _=require(_0x404d('0x0'));var util=require(_0x404d('0x1'));var moment=require(_0x404d('0x2'));var BPromise=require(_0x404d('0x3'));var rs=require(_0x404d('0x4'));var fs=require('fs');var Redis=require(_0x404d('0x5'));var db=require(_0x404d('0x6'))['db'];var utils=require(_0x404d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x404d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x404d('0x9')][_0x404d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdfffee,_0x30af69,_0x3e5e6c){return new BPromise(function(_0x4bc194,_0x1037cd){return client[_0x404d('0xb')](_0xdfffee,_0x3e5e6c)['then'](function(_0x346280){logger[_0x404d('0xc')](_0x404d('0xd'),_0x30af69,_0x404d('0xe'));logger[_0x404d('0xf')](_0x404d('0x10'),_0x30af69,_0x404d('0xe'),JSON[_0x404d('0x11')](_0x346280));if(_0x346280[_0x404d('0x12')]){if(_0x346280[_0x404d('0x12')]['code']===0x1f4){logger['error'](_0x404d('0xd'),_0x30af69,_0x346280['error'][_0x404d('0x13')]);return _0x1037cd(_0x346280[_0x404d('0x12')]['message']);}logger['error'](_0x404d('0xd'),_0x30af69,_0x346280[_0x404d('0x12')][_0x404d('0x13')]);return _0x4bc194(_0x346280[_0x404d('0x12')][_0x404d('0x13')]);}else{logger[_0x404d('0xc')](_0x404d('0xd'),_0x30af69,'request\x20sent');_0x4bc194(_0x346280['result'][_0x404d('0x13')]);}})[_0x404d('0x14')](function(_0x4889b9){logger['error'](_0x404d('0xd'),_0x30af69,_0x4889b9);_0x1037cd(_0x4889b9);});});} \ No newline at end of file +var _0xbea8=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','request\x20sent','stringify','error','DeskField,\x20%s,\x20%s','message','catch'];(function(_0x1c206c,_0x1da250){var _0x1e0611=function(_0x4c0578){while(--_0x4c0578){_0x1c206c['push'](_0x1c206c['shift']());}};_0x1e0611(++_0x1da250);}(_0xbea8,0xea));var _0x8bea=function(_0x2f16e5,_0x2e75e0){_0x2f16e5=_0x2f16e5-0x0;var _0x5d082a=_0xbea8[_0x2f16e5];return _0x5d082a;};'use strict';var _=require(_0x8bea('0x0'));var util=require(_0x8bea('0x1'));var moment=require(_0x8bea('0x2'));var BPromise=require(_0x8bea('0x3'));var rs=require(_0x8bea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bea('0x5'))['db'];var utils=require(_0x8bea('0x6'));var logger=require('../../config/logger')(_0x8bea('0x7'));var config=require('../../config/environment');var jayson=require(_0x8bea('0x8'));var client=jayson[_0x8bea('0x9')][_0x8bea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29bf91,_0x249aad,_0x151d5b){return new BPromise(function(_0x1368b7,_0x30b298){return client['request'](_0x29bf91,_0x151d5b)['then'](function(_0xc0813f){logger[_0x8bea('0xb')]('DeskField,\x20%s,\x20%s',_0x249aad,'request\x20sent');logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x249aad,_0x8bea('0xc'),JSON[_0x8bea('0xd')](_0xc0813f));if(_0xc0813f[_0x8bea('0xe')]){if(_0xc0813f[_0x8bea('0xe')]['code']===0x1f4){logger['error'](_0x8bea('0xf'),_0x249aad,_0xc0813f[_0x8bea('0xe')][_0x8bea('0x10')]);return _0x30b298(_0xc0813f['error'][_0x8bea('0x10')]);}logger[_0x8bea('0xe')](_0x8bea('0xf'),_0x249aad,_0xc0813f[_0x8bea('0xe')][_0x8bea('0x10')]);return _0x1368b7(_0xc0813f[_0x8bea('0xe')][_0x8bea('0x10')]);}else{logger[_0x8bea('0xb')](_0x8bea('0xf'),_0x249aad,_0x8bea('0xc'));_0x1368b7(_0xc0813f['result']['message']);}})[_0x8bea('0x11')](function(_0x5e9834){logger['error'](_0x8bea('0xf'),_0x249aad,_0x5e9834);_0x30b298(_0x5e9834);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6e2811e..80722c3 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 _0x75b0=['fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','isAuthenticated','put','update','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x75b0,0x103));var _0x075b=function(_0x46abf8,_0x25fde6){_0x46abf8=_0x46abf8-0x0;var _0x9aec4c=_0x75b0[_0x46abf8];return _0x9aec4c;};'use strict';var multer=require(_0x075b('0x0'));var util=require('util');var path=require(_0x075b('0x1'));var timeout=require(_0x075b('0x2'));var express=require(_0x075b('0x3'));var router=express[_0x075b('0x4')]();var fs_extra=require(_0x075b('0x5'));var auth=require(_0x075b('0x6'));var interaction=require(_0x075b('0x7'));var config=require('../../config/environment');var controller=require(_0x075b('0x8'));router[_0x075b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x075b('0x9')](_0x075b('0xa'),auth['isAuthenticated'](),controller[_0x075b('0xb')]);router[_0x075b('0x9')](_0x075b('0xc'),auth['isAuthenticated'](),controller[_0x075b('0xd')]);router[_0x075b('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x075b('0xe')]);router[_0x075b('0xf')]('/',auth['isAuthenticated'](),controller[_0x075b('0x10')]);router[_0x075b('0xf')]('/:id/configurations',auth[_0x075b('0x11')](),controller['addConfiguration']);router[_0x075b('0x12')](_0x075b('0xa'),auth['isAuthenticated'](),controller[_0x075b('0x13')]);router[_0x075b('0x14')](_0x075b('0xa'),auth['isAuthenticated'](),controller[_0x075b('0x15')]);module['exports']=router; \ No newline at end of file +var _0x37a8=['/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x15a46b,_0x519be4){var _0x733339=function(_0x38ac29){while(--_0x38ac29){_0x15a46b['push'](_0x15a46b['shift']());}};_0x733339(++_0x519be4);}(_0x37a8,0x162));var _0x837a=function(_0x230949,_0x790da6){_0x230949=_0x230949-0x0;var _0x54a3dd=_0x37a8[_0x230949];return _0x54a3dd;};'use strict';var multer=require('multer');var util=require(_0x837a('0x0'));var path=require(_0x837a('0x1'));var timeout=require(_0x837a('0x2'));var express=require('express');var router=express[_0x837a('0x3')]();var fs_extra=require(_0x837a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x837a('0x5'));var config=require(_0x837a('0x6'));var controller=require('./intDynamics365Account.controller');router[_0x837a('0x7')]('/',auth[_0x837a('0x8')](),controller[_0x837a('0x9')]);router[_0x837a('0x7')](_0x837a('0xa'),auth['isAuthenticated'](),controller[_0x837a('0xb')]);router[_0x837a('0x7')](_0x837a('0xc'),auth[_0x837a('0x8')](),controller[_0x837a('0xd')]);router['get'](_0x837a('0xe'),auth[_0x837a('0x8')](),controller[_0x837a('0xf')]);router[_0x837a('0x10')]('/',auth[_0x837a('0x8')](),controller[_0x837a('0x11')]);router['post'](_0x837a('0xc'),auth[_0x837a('0x8')](),controller[_0x837a('0x12')]);router[_0x837a('0x13')](_0x837a('0xa'),auth[_0x837a('0x8')](),controller['update']);router[_0x837a('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x837a('0x15')]);module[_0x837a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 6c6b59c..851f756 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 _0x4be6=['STRING','exports'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x4be6,0xb5));var _0x64be=function(_0x566760,_0x1f7104){_0x566760=_0x566760-0x0;var _0x30ca6d=_0x4be6[_0x566760];return _0x30ca6d;};'use strict';var Sequelize=require('sequelize');module[_0x64be('0x0')]={'name':{'type':Sequelize[_0x64be('0x1')]},'username':{'type':Sequelize[_0x64be('0x1')]},'password':{'type':Sequelize[_0x64be('0x1')]},'remoteUri':{'type':Sequelize[_0x64be('0x1')]},'tenantId':{'type':Sequelize[_0x64be('0x1')]},'clientId':{'type':Sequelize[_0x64be('0x1')]},'clientSecret':{'type':Sequelize[_0x64be('0x1')]},'serverUrl':{'type':Sequelize[_0x64be('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x64be('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xcee8=['sequelize','exports','STRING'];(function(_0x3f27ba,_0x422cdc){var _0x1933d0=function(_0x3a52ab){while(--_0x3a52ab){_0x3f27ba['push'](_0x3f27ba['shift']());}};_0x1933d0(++_0x422cdc);}(_0xcee8,0xb1));var _0x8cee=function(_0x5e843e,_0x4198e4){_0x5e843e=_0x5e843e-0x0;var _0x32a06b=_0xcee8[_0x5e843e];return _0x32a06b;};'use strict';var Sequelize=require(_0x8cee('0x0'));module[_0x8cee('0x1')]={'name':{'type':Sequelize[_0x8cee('0x2')]},'username':{'type':Sequelize[_0x8cee('0x2')]},'password':{'type':Sequelize[_0x8cee('0x2')]},'remoteUri':{'type':Sequelize[_0x8cee('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x8cee('0x2')]},'clientSecret':{'type':Sequelize[_0x8cee('0x2')]},'serverUrl':{'type':Sequelize[_0x8cee('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8cee('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index eb37707..4eaa197 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 _0x657b=['find','create','body','update','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','getFields','incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','resolveby','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','remoteUri','clientId','clientSecret','modernAuthentication','data5','access_token','CloudProvider','data7','POST','https://login.microsoftonline.com/','/oauth2/token','username','password','GET','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','includes','LogicalName','@odata.type','push','isNil','all','forEach','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','then','sendStatus','error','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','length'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x657b,0x131));var _0xb657=function(_0x4d437e,_0x1788b6){_0x4d437e=_0x4d437e-0x0;var _0xf14e4c=_0x657b[_0x4d437e];return _0xf14e4c;};'use strict';var rp=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var _=require(_0xb657('0x2'));var qs=require(_0xb657('0x3'));var logger=require(_0xb657('0x4'))('api');var db=require(_0xb657('0x5'))['db'];var integrations=require(_0xb657('0x6'));function respondWithResult(_0x5da1bc,_0x175072){_0x175072=_0x175072||0xc8;return function(_0x322e57){if(_0x322e57){return _0x5da1bc[_0xb657('0x7')](_0x175072)[_0xb657('0x8')](_0x322e57);}};}function respondWithFilteredResult(_0x446b17,_0x5d54f6){return function(_0x471e78){if(_0x471e78){var _0x55acdf=typeof _0x5d54f6[_0xb657('0x9')]===_0xb657('0xa')&&typeof _0x5d54f6[_0xb657('0xb')]==='undefined';var _0x36b334=_0x471e78['count'];var _0x3c9e00=_0x55acdf?0x0:_0x5d54f6['offset'];var _0x2a3189=_0x55acdf?_0x471e78[_0xb657('0xc')]:_0x5d54f6[_0xb657('0x9')]+_0x5d54f6['limit'];var _0x12aaa7;if(_0x2a3189>=_0x36b334){_0x2a3189=_0x36b334;_0x12aaa7=0xc8;}else{_0x12aaa7=0xce;}_0x446b17[_0xb657('0x7')](_0x12aaa7);return _0x446b17[_0xb657('0xd')](_0xb657('0xe'),_0x3c9e00+'-'+_0x2a3189+'/'+_0x36b334)['json'](_0x471e78);}return null;};}function saveUpdates(_0x3e1ea1){return function(_0x3ebcc2){if(_0x3ebcc2){return _0x3ebcc2['update'](_0x3e1ea1)[_0xb657('0xf')](function(_0x20a26){return _0x20a26;});}return null;};}function removeEntity(_0xf04de9){return function(_0x3ca0b4){if(_0x3ca0b4){return _0x3ca0b4['destroy']()[_0xb657('0xf')](function(){_0xf04de9[_0xb657('0x7')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d253b){return function(_0x144eaf){if(!_0x144eaf){_0x4d253b[_0xb657('0x10')](0x194);}return _0x144eaf;};}function handleError(_0x2c1fb7,_0x9dc84c){_0x9dc84c=_0x9dc84c||0x1f4;return function(_0x17c045){logger[_0xb657('0x11')](_0x17c045[_0xb657('0x12')]);if(_0x17c045[_0xb657('0x13')]){delete _0x17c045[_0xb657('0x13')];}_0x2c1fb7[_0xb657('0x7')](_0x9dc84c)[_0xb657('0x14')](_0x17c045);};}exports['index']=function(_0x8c156f,_0x12f79e){var _0x21474b={},_0x2120e3={},_0x538a12={'count':0x0,'rows':[]};var _0x58c86c=_[_0xb657('0x15')](db[_0xb657('0x16')][_0xb657('0x17')],function(_0x581db8){return{'name':_0x581db8[_0xb657('0x18')],'type':_0x581db8['type'][_0xb657('0x19')]};});_0x2120e3[_0xb657('0x1a')]=_[_0xb657('0x15')](_0x58c86c,_0xb657('0x13'));_0x2120e3[_0xb657('0x1b')]=_['keys'](_0x8c156f[_0xb657('0x1b')]);_0x2120e3[_0xb657('0x1c')]=_[_0xb657('0x1d')](_0x2120e3[_0xb657('0x1a')],_0x2120e3['query']);_0x21474b[_0xb657('0x1e')]=_['intersection'](_0x2120e3[_0xb657('0x1a')],qs['fields'](_0x8c156f[_0xb657('0x1b')]['fields']));_0x21474b[_0xb657('0x1e')]=_0x21474b[_0xb657('0x1e')]['length']?_0x21474b[_0xb657('0x1e')]:_0x2120e3[_0xb657('0x1a')];if(!_0x8c156f[_0xb657('0x1b')]['hasOwnProperty'](_0xb657('0x1f'))){_0x21474b[_0xb657('0xb')]=qs[_0xb657('0xb')](_0x8c156f[_0xb657('0x1b')][_0xb657('0xb')]);_0x21474b[_0xb657('0x9')]=qs[_0xb657('0x9')](_0x8c156f[_0xb657('0x1b')][_0xb657('0x9')]);}_0x21474b[_0xb657('0x20')]=qs[_0xb657('0x21')](_0x8c156f[_0xb657('0x1b')][_0xb657('0x21')]);_0x21474b[_0xb657('0x22')]=qs[_0xb657('0x1c')](_[_0xb657('0x23')](_0x8c156f[_0xb657('0x1b')],_0x2120e3['filters']),_0x58c86c);if(_0x8c156f[_0xb657('0x1b')]['filter']){_0x21474b[_0xb657('0x22')]=_[_0xb657('0x24')](_0x21474b['where'],{'$or':_[_0xb657('0x15')](_0x58c86c,function(_0x7ec316){if(_0x7ec316[_0xb657('0x25')]!==_0xb657('0x26')){var _0xbff50={};_0xbff50[_0x7ec316['name']]={'$like':'%'+_0x8c156f[_0xb657('0x1b')][_0xb657('0x27')]+'%'};return _0xbff50;}})});}_0x21474b=_[_0xb657('0x24')]({},_0x21474b,_0x8c156f[_0xb657('0x28')]);var _0x2041a7={'where':_0x21474b['where']};return db[_0xb657('0x16')][_0xb657('0xc')](_0x2041a7)[_0xb657('0xf')](function(_0x4cd635){_0x538a12[_0xb657('0xc')]=_0x4cd635;if(_0x8c156f['query'][_0xb657('0x29')]){_0x21474b[_0xb657('0x2a')]=[{'all':!![]}];}return db[_0xb657('0x16')][_0xb657('0x2b')](_0x21474b);})[_0xb657('0xf')](function(_0x87600a){_0x538a12[_0xb657('0x2c')]=_0x87600a;return _0x538a12;})[_0xb657('0xf')](respondWithFilteredResult(_0x12f79e,_0x21474b))[_0xb657('0x2d')](handleError(_0x12f79e,null));};exports[_0xb657('0x2e')]=function(_0x247ace,_0x5693c5){var _0x5c0e8c={'raw':![],'where':{'id':_0x247ace[_0xb657('0x2f')]['id']}},_0x31aa91={};_0x31aa91[_0xb657('0x1a')]=_[_0xb657('0x30')](db[_0xb657('0x16')][_0xb657('0x17')]);_0x31aa91['query']=_[_0xb657('0x30')](_0x247ace['query']);_0x31aa91[_0xb657('0x1c')]=_[_0xb657('0x1d')](_0x31aa91[_0xb657('0x1a')],_0x31aa91[_0xb657('0x1b')]);_0x5c0e8c[_0xb657('0x1e')]=_['intersection'](_0x31aa91[_0xb657('0x1a')],qs[_0xb657('0x31')](_0x247ace[_0xb657('0x1b')][_0xb657('0x31')]));_0x5c0e8c[_0xb657('0x1e')]=_0x5c0e8c[_0xb657('0x1e')][_0xb657('0x32')]?_0x5c0e8c[_0xb657('0x1e')]:_0x31aa91[_0xb657('0x1a')];if(_0x247ace[_0xb657('0x1b')]['includeAll']){_0x5c0e8c[_0xb657('0x2a')]=[{'all':!![]}];}_0x5c0e8c=_['merge']({},_0x5c0e8c,_0x247ace[_0xb657('0x28')]);return db['Dynamics365Account'][_0xb657('0x33')](_0x5c0e8c)[_0xb657('0xf')](handleEntityNotFound(_0x5693c5,null))[_0xb657('0xf')](respondWithResult(_0x5693c5,null))[_0xb657('0x2d')](handleError(_0x5693c5,null));};exports[_0xb657('0x34')]=function(_0x3d4132,_0x5e15cd){return db[_0xb657('0x16')][_0xb657('0x34')](_0x3d4132[_0xb657('0x35')],{})['then'](respondWithResult(_0x5e15cd,0xc9))[_0xb657('0x2d')](handleError(_0x5e15cd,null));};exports[_0xb657('0x36')]=function(_0x41a067,_0x239594){if(_0x41a067[_0xb657('0x35')]['id']){delete _0x41a067[_0xb657('0x35')]['id'];}return db[_0xb657('0x16')][_0xb657('0x33')]({'where':{'id':_0x41a067[_0xb657('0x2f')]['id']}})['then'](handleEntityNotFound(_0x239594,null))[_0xb657('0xf')](saveUpdates(_0x41a067['body'],null))[_0xb657('0xf')](respondWithResult(_0x239594,null))[_0xb657('0x2d')](handleError(_0x239594,null));};exports['destroy']=function(_0xd63abc,_0x59e4b4){return db['Dynamics365Account'][_0xb657('0x33')]({'where':{'id':_0xd63abc[_0xb657('0x2f')]['id']}})[_0xb657('0xf')](handleEntityNotFound(_0x59e4b4,null))[_0xb657('0xf')](removeEntity(_0x59e4b4,null))['catch'](handleError(_0x59e4b4,null));};exports[_0xb657('0x37')]=function(_0xab76d8,_0x2c336a){var _0xb12fd7={};var _0x3f4a16={};var _0x5c7d53;var _0x301c20;return db['Dynamics365Account']['findOne']({'where':{'id':_0xab76d8['params']['id']}})[_0xb657('0xf')](handleEntityNotFound(_0x2c336a,null))['then'](function(_0x2367aa){if(_0x2367aa){_0x5c7d53=_0x2367aa;_0x3f4a16[_0xb657('0x1a')]=_[_0xb657('0x30')](db['Dynamics365Configuration'][_0xb657('0x17')]);_0x3f4a16[_0xb657('0x1b')]=_[_0xb657('0x30')](_0xab76d8[_0xb657('0x1b')]);_0x3f4a16[_0xb657('0x1c')]=_[_0xb657('0x1d')](_0x3f4a16['model'],_0x3f4a16[_0xb657('0x1b')]);_0xb12fd7[_0xb657('0x1e')]=_['intersection'](_0x3f4a16[_0xb657('0x1a')],qs['fields'](_0xab76d8[_0xb657('0x1b')]['fields']));_0xb12fd7[_0xb657('0x1e')]=_0xb12fd7['attributes'][_0xb657('0x32')]?_0xb12fd7['attributes']:_0x3f4a16[_0xb657('0x1a')];_0xb12fd7[_0xb657('0x20')]=qs[_0xb657('0x21')](_0xab76d8[_0xb657('0x1b')][_0xb657('0x21')]);_0xb12fd7['where']=qs[_0xb657('0x1c')](_[_0xb657('0x23')](_0xab76d8[_0xb657('0x1b')],_0x3f4a16[_0xb657('0x1c')]));if(_0xab76d8[_0xb657('0x1b')][_0xb657('0x27')]){_0xb12fd7['where']=_[_0xb657('0x24')](_0xb12fd7[_0xb657('0x22')],{'$or':_[_0xb657('0x15')](_0xb12fd7[_0xb657('0x1e')],function(_0xfb5b71){var _0x267339={};_0x267339[_0xfb5b71]={'$like':'%'+_0xab76d8[_0xb657('0x1b')][_0xb657('0x27')]+'%'};return _0x267339;})});}_0xb12fd7=_[_0xb657('0x24')]({},_0xb12fd7,_0xab76d8['options']);return _0x5c7d53[_0xb657('0x37')](_0xb12fd7);}})[_0xb657('0xf')](function(_0x23102b){if(_0x23102b){_0x301c20=_0x23102b[_0xb657('0x32')];if(!_0xab76d8[_0xb657('0x1b')]['hasOwnProperty'](_0xb657('0x1f'))){_0xb12fd7['limit']=qs['limit'](_0xab76d8[_0xb657('0x1b')][_0xb657('0xb')]);_0xb12fd7[_0xb657('0x9')]=qs[_0xb657('0x9')](_0xab76d8[_0xb657('0x1b')]['offset']);}return _0x5c7d53[_0xb657('0x37')](_0xb12fd7);}})['then'](function(_0x1b7cba){if(_0x1b7cba){return _0x1b7cba?{'count':_0x301c20,'rows':_0x1b7cba}:null;}})[_0xb657('0xf')](respondWithResult(_0x2c336a,null))[_0xb657('0x2d')](handleError(_0x2c336a,null));};exports[_0xb657('0x38')]=function(_0xccc49b,_0x162d76){if(_0xccc49b[_0xb657('0x35')]['id']){delete _0xccc49b[_0xb657('0x35')]['id'];}return db[_0xb657('0x16')][_0xb657('0x39')]({'where':{'id':_0xccc49b[_0xb657('0x2f')]['id']}})[_0xb657('0xf')](handleEntityNotFound(_0x162d76,null))[_0xb657('0xf')](function(_0x148dba){if(_0x148dba){_0xccc49b[_0xb657('0x35')][_0xb657('0x3a')]=_0x148dba['id'];_0xccc49b[_0xb657('0x35')][_0xb657('0x3b')]=integrations[_0xb657('0x3c')](_0xccc49b[_0xb657('0x35')][_0xb657('0x3d')],_0xccc49b[_0xb657('0x35')][_0xb657('0x25')]);_0xccc49b['body'][_0xb657('0x3e')]=integrations[_0xb657('0x3f')](_0xccc49b[_0xb657('0x35')]['channel'],_0xccc49b[_0xb657('0x35')]['type']);return db['Dynamics365Configuration'][_0xb657('0x34')](_0xccc49b[_0xb657('0x35')],{'include':[{'model':db[_0xb657('0x40')],'as':'Subjects'},{'model':db[_0xb657('0x40')],'as':_0xb657('0x3e')}]});}return null;})[_0xb657('0xf')](respondWithResult(_0x162d76,null))['catch'](handleError(_0x162d76,null));};function sanitizeRemoteUri(_0x5e0cc0){var _0x35acf5=_0x5e0cc0[_0xb657('0x41')](-0x1);if(_0x35acf5==='/')return _0x5e0cc0[_0xb657('0x42')](0x0,_0x5e0cc0[_0xb657('0x43')](_0x35acf5));return _0x5e0cc0;}function getWebApiUrl(_0x25a27e){return util['format']('%s/api/data/v9.0/',_0x25a27e);}exports[_0xb657('0x44')]=function(_0x46bc3d,_0xcba01c){var _0xe8f0b2=_0x46bc3d[_0xb657('0x1b')]['ticketType'];var _0x2ca539=_0xe8f0b2===_0xb657('0x45')?'Incident':_0xb657('0x46');var _0xfe306f='';var _0x3f2773='';var _0x248dbf='';var _0x13eb21='';var _0x1679d9='';var _0x76336f='';var _0x15f10a='';var _0x5d77ee='';var _0x4c7d4b=['title',_0xb657('0x47'),_0xb657('0x48'),_0xb657('0x49'),_0xb657('0x4a'),_0xb657('0x4b'),_0xb657('0x4c'),_0xb657('0x4d'),'directioncode',_0xb657('0x4e')];var _0x4c3a05=['accountidname',_0xb657('0x4f'),_0xb657('0x50'),'billedserviceunits',_0xb657('0x51'),_0xb657('0x52'),_0xb657('0x53'),'contractidname',_0xb657('0x54'),_0xb657('0x55'),_0xb657('0x56'),_0xb657('0x57'),_0xb657('0x58'),'createdonbehalfbyname','createdonbehalfbyyominame',_0xb657('0x59'),_0xb657('0x5a'),_0xb657('0x5b'),_0xb657('0x5c'),_0xb657('0x5d'),_0xb657('0x5e'),_0xb657('0x5f'),_0xb657('0x60'),'exchangerate',_0xb657('0x61'),_0xb657('0x62'),'importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname',_0xb657('0x63'),_0xb657('0x64'),_0xb657('0x65'),'modifiedbyyominame','modifiedon','modifiedonbehalfbyname',_0xb657('0x66'),_0xb657('0x67'),_0xb657('0x68'),_0xb657('0x69'),'onholdtime',_0xb657('0x6a'),_0xb657('0x6b'),_0xb657('0x6c'),'owneridyominame',_0xb657('0x6d'),'primarycontactidname',_0xb657('0x6e'),_0xb657('0x6f'),'productidname','productserialnumber',_0xb657('0x70'),_0xb657('0x71'),'responseby','responsiblecontactidname',_0xb657('0x72'),_0xb657('0x73'),_0xb657('0x74'),_0xb657('0x75'),_0xb657('0x76'),_0xb657('0x77'),'statuscode','subjectidname',_0xb657('0x78'),_0xb657('0x79'),_0xb657('0x7a'),_0xb657('0x7b'),'utcconversiontimezonecode',_0xb657('0x7c')];var _0xafc404=_0x4c7d4b['concat'](_0x4c3a05);return db[_0xb657('0x16')]['findOne']({'where':{'id':_0x46bc3d['params']['id']},'attributes':['id','username','password',_0xb657('0x7d'),'tenantId',_0xb657('0x7e'),_0xb657('0x7f'),_0xb657('0x80')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id',_0xb657('0x81'),'data7']}]})[_0xb657('0xf')](handleEntityNotFound(_0xcba01c,null))[_0xb657('0xf')](function(_0x54d02b){if(_0x54d02b){if(_0x54d02b[_0xb657('0x80')]){_0x54d02b[_0xb657('0x82')]=_0x54d02b[_0xb657('0x83')][_0xb657('0x81')];_0x5d77ee=sanitizeRemoteUri(_0x54d02b[_0xb657('0x83')][_0xb657('0x84')]);_0x15f10a=getWebApiUrl(_0x5d77ee);return _0x54d02b;}_0x5d77ee=sanitizeRemoteUri(_0x54d02b[_0xb657('0x7d')]);_0x15f10a=getWebApiUrl(_0x5d77ee);var _0x647043={'method':_0xb657('0x85'),'uri':_0xb657('0x86')+_0x54d02b['tenantId']+_0xb657('0x87'),'form':{'client_id':_0x54d02b[_0xb657('0x7e')],'resource':_0x5d77ee,'username':_0x54d02b[_0xb657('0x88')],'password':_0x54d02b[_0xb657('0x89')],'grant_type':_0xb657('0x89'),'client_secret':_0x54d02b['clientSecret']},'json':!![]};return rp(_0x647043);}})[_0xb657('0xf')](function(_0x27b96a){_0x76336f=_0x27b96a[_0xb657('0x82')];var _0x537b50={'method':_0xb657('0x8a'),'uri':encodeURI(_0x15f10a+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2ca539+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x76336f,'If-None-Match':null,'OData-Version':_0xb657('0x8b')},'json':!![]};return rp(_0x537b50);})[_0xb657('0xf')](function(_0x1417fb){var _0x2de897=_0x1417fb[_0xb657('0x8c')][0x0];var _0x1aa012=_0x2de897[_0xb657('0x8d')];var _0x3f1a07={'method':_0xb657('0x8a'),'uri':_0x15f10a+_0xb657('0x8e')+_0x1aa012+_0xb657('0x8f'),'headers':{'Authorization':_0xb657('0x90')+_0x76336f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3f1a07);})[_0xb657('0xf')](function(_0x2cbaa0){_0xfe306f=_0x2cbaa0;_0x3f2773=_0xfe306f[_0xb657('0x91')];_0x3f2773=_['remove'](_0x3f2773,function(_0x27d455){return!_0xafc404[_0xb657('0x92')](_0x27d455[_0xb657('0x93')]);});var _0x3ec364=[];var _0x54bf8e=[];_0x3f2773['forEach'](function(_0x20ef2f){if(_0x20ef2f[_0xb657('0x94')]){var _0x5386c6=_0x20ef2f[_0xb657('0x94')][_0xb657('0x42')](_0x20ef2f[_0xb657('0x94')][_0xb657('0x43')]('.')+0x1);if(_0x5386c6==='PicklistAttributeMetadata'){_0x3ec364[_0xb657('0x95')](getSelectList(_0x15f10a,_0xe8f0b2,_0x54bf8e,_0xfe306f['MetadataId'],_0x20ef2f['MetadataId'],_0x76336f));}}});return Promise['all'](_0x3ec364);})[_0xb657('0xf')](function(_0x27fadf){_0x248dbf=_0x27fadf[0x0];var _0x2b5789=[];var _0x3b1966=[];_0x3f2773['forEach'](function(_0x4e3ac7){if(!_[_0xb657('0x96')](_0x4e3ac7[_0xb657('0x94')])){var _0x49d6b1=_0x4e3ac7[_0xb657('0x94')][_0xb657('0x42')](_0x4e3ac7[_0xb657('0x94')][_0xb657('0x43')]('.')+0x1);if(_0x49d6b1==='BooleanAttributeMetadata'){_0x2b5789[_0xb657('0x95')](getBooleanList(_0x15f10a,_0xe8f0b2,_0x3b1966,_0xfe306f[_0xb657('0x8d')],_0x4e3ac7[_0xb657('0x8d')],_0x76336f));}}});return Promise[_0xb657('0x97')](_0x2b5789);})['then'](function(_0x2a9739){_0x13eb21=_0x2a9739[0x0];var _0x24f533=[];var _0x2f5789=[];_0x3f2773[_0xb657('0x98')](function(_0x61e73d){if(_0x61e73d[_0xb657('0x94')]){var _0x15d7c3=_0x61e73d[_0xb657('0x94')][_0xb657('0x42')](_0x61e73d['@odata.type']['lastIndexOf']('.')+0x1);if(_0x15d7c3==='StringAttributeMetadata'||_0x15d7c3===_0xb657('0x99')||_0x15d7c3===_0xb657('0x9a')||_0x15d7c3===_0xb657('0x9b')||_0x15d7c3===_0xb657('0x9c')||_0x15d7c3==='DateTimeAttributeMetadata'||_0x15d7c3===_0xb657('0x9d')||_0x15d7c3===_0xb657('0x9e')||_0x15d7c3===_0xb657('0x9f')||_0x15d7c3===_0xb657('0xa0')){_0x24f533[_0xb657('0x95')](getInputList(_0x15f10a,_0xe8f0b2,_0x15d7c3,_0x2f5789,_0xfe306f[_0xb657('0x8d')],_0x61e73d[_0xb657('0x8d')],_0x76336f));}}});return Promise[_0xb657('0x97')](_0x24f533);})[_0xb657('0xf')](function(_0x504f61){_0x1679d9=_0x504f61[0x0];var _0x18dbe0=_0x248dbf[_0xb657('0xa1')](_0x13eb21)[_0xb657('0xa1')](_0x1679d9);var _0x3b39f7={'count':_0x18dbe0[_0xb657('0x32')],'rows':_0x18dbe0};return _0x3b39f7;})['then'](respondWithResult(_0xcba01c,null))[_0xb657('0x2d')](function(_0x23c132){var _0x5aa3aa=_0x46bc3d[_0xb657('0x1b')][_0xb657('0xa2')]?0x1f4:_0x23c132['statusCode']||0x1f4;logger[_0xb657('0x11')](_0x23c132['stack']);delete _0x23c132['name'];if(_0x5aa3aa===0x191){_0x5aa3aa=0x190;}_0xcba01c[_0xb657('0x7')](_0x5aa3aa)[_0xb657('0x14')](_0x46bc3d[_0xb657('0x1b')][_0xb657('0xa2')]?{'message':_0xb657('0xa3'),'statusCode':_0x23c132[_0xb657('0xa4')]}:_0x23c132);});};function getSelectList(_0x3e0652,_0x45cffc,_0x147231,_0xc71e4f,_0x2a8a27,_0x59485c){var _0x1fabbf={'method':'GET','uri':_0x3e0652+_0xb657('0x8e')+_0xc71e4f+_0xb657('0xa5')+_0x2a8a27+_0xb657('0xa6')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xb657('0x90')+_0x59485c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1fabbf)['then'](function(_0x51493f){var _0x4d6e18=[];var _0x4b7325=_0x51493f[_0xb657('0xa7')]['Options'];_0x4b7325[_0xb657('0x98')](function(_0x50c7cd){_0x4d6e18['push']({'name':_0x50c7cd[_0xb657('0xa8')][_0xb657('0xa9')]['Label'],'value':String(_0x50c7cd['Value'])});});var _0x560397={'id':_0x45cffc+'_'+_0x51493f['LogicalName'],'name':_0x51493f[_0xb657('0xaa')][_0xb657('0xa9')]['Label'],'custom':![],'options':_0x4d6e18};_0x147231['push'](_0x560397);return _0x147231;});}function getBooleanList(_0x5d2447,_0x40a159,_0x21d57c,_0x1d5b6a,_0x24acea,_0x40ca95){var _0x4f92a2={'method':'GET','uri':_0x5d2447+_0xb657('0x8e')+_0x1d5b6a+_0xb657('0xa5')+_0x24acea+_0xb657('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x40ca95,'If-None-Match':null,'OData-Version':_0xb657('0x8b')},'json':!![]};return rp(_0x4f92a2)[_0xb657('0xf')](function(_0x12fef5){var _0x2ce726=[];_0x2ce726['push']({'name':_0x12fef5[_0xb657('0xa7')][_0xb657('0xac')][_0xb657('0xa8')][_0xb657('0xa9')][_0xb657('0xa8')],'value':_0xb657('0xad')},{'name':_0x12fef5[_0xb657('0xa7')][_0xb657('0xae')][_0xb657('0xa8')][_0xb657('0xa9')]['Label'],'value':_0xb657('0xaf')});var _0x42a25={'id':_0x40a159+'_'+_0x12fef5['LogicalName'],'name':_0x12fef5[_0xb657('0xaa')][_0xb657('0xa9')][_0xb657('0xa8')],'custom':![],'options':_0x2ce726};_0x21d57c[_0xb657('0x95')](_0x42a25);return _0x21d57c;});}function getInputList(_0x4a4902,_0x2afcfb,_0x6a58eb,_0x2b45d8,_0x17eb16,_0x389a83,_0x2810b7){var _0x3b245b={'method':_0xb657('0x8a'),'uri':_0x4a4902+_0xb657('0x8e')+_0x17eb16+_0xb657('0xa5')+_0x389a83+_0xb657('0xb0')+_0x6a58eb+_0xb657('0xb1'),'headers':{'Authorization':_0xb657('0x90')+_0x2810b7,'If-None-Match':null,'OData-Version':_0xb657('0x8b')},'json':!![]};return rp(_0x3b245b)[_0xb657('0xf')](function(_0x4e6607){var _0x41a4a6={'id':_0x2afcfb+'_'+_0x4e6607[_0xb657('0x93')],'name':_0x4e6607['DisplayName']['UserLocalizedLabel']?_0x4e6607[_0xb657('0xaa')][_0xb657('0xa9')]['Label']:_0x4e6607['LogicalName'],'custom':![],'options':[]};_0x2b45d8[_0xb657('0x95')](_0x41a4a6);return _0x2b45d8;});} \ No newline at end of file +var _0x0f58=['rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','format','%s/api/data/v9.0/','ticketType','Incident','PhoneCall','title','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','https://login.microsoftonline.com/','/oauth2/token','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','forEach','substring','lastIndexOf','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','undefined','count','offset','limit','update','destroy','then','end','sendStatus','error','stack','send','index','map','Dynamics365Account'];(function(_0x538ce3,_0x25415d){var _0x230f2c=function(_0xe1f502){while(--_0xe1f502){_0x538ce3['push'](_0x538ce3['shift']());}};_0x230f2c(++_0x25415d);}(_0x0f58,0x164));var _0x80f5=function(_0x1c81be,_0x38517f){_0x1c81be=_0x1c81be-0x0;var _0x3be677=_0x0f58[_0x1c81be];return _0x3be677;};'use strict';var rp=require(_0x80f5('0x0'));var util=require(_0x80f5('0x1'));var _=require(_0x80f5('0x2'));var qs=require(_0x80f5('0x3'));var logger=require(_0x80f5('0x4'))('api');var db=require(_0x80f5('0x5'))['db'];var integrations=require(_0x80f5('0x6'));function respondWithResult(_0x14bc8c,_0x54a59c){_0x54a59c=_0x54a59c||0xc8;return function(_0x2925a8){if(_0x2925a8){return _0x14bc8c[_0x80f5('0x7')](_0x54a59c)[_0x80f5('0x8')](_0x2925a8);}};}function respondWithFilteredResult(_0x418af5,_0x2bec6d){return function(_0x5a8aaf){if(_0x5a8aaf){var _0x1e981f=typeof _0x2bec6d['offset']===_0x80f5('0x9')&&typeof _0x2bec6d['limit']===_0x80f5('0x9');var _0x124f61=_0x5a8aaf[_0x80f5('0xa')];var _0x3da407=_0x1e981f?0x0:_0x2bec6d[_0x80f5('0xb')];var _0x5e9501=_0x1e981f?_0x5a8aaf[_0x80f5('0xa')]:_0x2bec6d['offset']+_0x2bec6d[_0x80f5('0xc')];var _0x1d5376;if(_0x5e9501>=_0x124f61){_0x5e9501=_0x124f61;_0x1d5376=0xc8;}else{_0x1d5376=0xce;}_0x418af5[_0x80f5('0x7')](_0x1d5376);return _0x418af5['set']('Content-Range',_0x3da407+'-'+_0x5e9501+'/'+_0x124f61)['json'](_0x5a8aaf);}return null;};}function saveUpdates(_0x36357d){return function(_0x389249){if(_0x389249){return _0x389249[_0x80f5('0xd')](_0x36357d)['then'](function(_0xb4c5cd){return _0xb4c5cd;});}return null;};}function removeEntity(_0x48b8f4){return function(_0x26fc9a){if(_0x26fc9a){return _0x26fc9a[_0x80f5('0xe')]()[_0x80f5('0xf')](function(){_0x48b8f4[_0x80f5('0x7')](0xcc)[_0x80f5('0x10')]();});}};}function handleEntityNotFound(_0x19ac56){return function(_0x4242bc){if(!_0x4242bc){_0x19ac56[_0x80f5('0x11')](0x194);}return _0x4242bc;};}function handleError(_0x34fa1a,_0x3f07e2){_0x3f07e2=_0x3f07e2||0x1f4;return function(_0x2df7e8){logger[_0x80f5('0x12')](_0x2df7e8[_0x80f5('0x13')]);if(_0x2df7e8['name']){delete _0x2df7e8['name'];}_0x34fa1a[_0x80f5('0x7')](_0x3f07e2)[_0x80f5('0x14')](_0x2df7e8);};}exports[_0x80f5('0x15')]=function(_0x4c4822,_0x19260a){var _0x3f35a7={},_0x1f5947={},_0x38ecf0={'count':0x0,'rows':[]};var _0x176bd0=_[_0x80f5('0x16')](db[_0x80f5('0x17')][_0x80f5('0x18')],function(_0x10485d){return{'name':_0x10485d[_0x80f5('0x19')],'type':_0x10485d[_0x80f5('0x1a')][_0x80f5('0x1b')]};});_0x1f5947['model']=_[_0x80f5('0x16')](_0x176bd0,'name');_0x1f5947['query']=_[_0x80f5('0x1c')](_0x4c4822[_0x80f5('0x1d')]);_0x1f5947[_0x80f5('0x1e')]=_[_0x80f5('0x1f')](_0x1f5947['model'],_0x1f5947[_0x80f5('0x1d')]);_0x3f35a7[_0x80f5('0x20')]=_[_0x80f5('0x1f')](_0x1f5947[_0x80f5('0x21')],qs[_0x80f5('0x22')](_0x4c4822[_0x80f5('0x1d')][_0x80f5('0x22')]));_0x3f35a7[_0x80f5('0x20')]=_0x3f35a7['attributes'][_0x80f5('0x23')]?_0x3f35a7[_0x80f5('0x20')]:_0x1f5947[_0x80f5('0x21')];if(!_0x4c4822[_0x80f5('0x1d')][_0x80f5('0x24')](_0x80f5('0x25'))){_0x3f35a7[_0x80f5('0xc')]=qs[_0x80f5('0xc')](_0x4c4822['query'][_0x80f5('0xc')]);_0x3f35a7[_0x80f5('0xb')]=qs['offset'](_0x4c4822['query'][_0x80f5('0xb')]);}_0x3f35a7[_0x80f5('0x26')]=qs[_0x80f5('0x27')](_0x4c4822[_0x80f5('0x1d')]['sort']);_0x3f35a7[_0x80f5('0x28')]=qs[_0x80f5('0x1e')](_[_0x80f5('0x29')](_0x4c4822[_0x80f5('0x1d')],_0x1f5947[_0x80f5('0x1e')]),_0x176bd0);if(_0x4c4822[_0x80f5('0x1d')][_0x80f5('0x2a')]){_0x3f35a7[_0x80f5('0x28')]=_['merge'](_0x3f35a7['where'],{'$or':_[_0x80f5('0x16')](_0x176bd0,function(_0x3610b9){if(_0x3610b9[_0x80f5('0x1a')]!=='VIRTUAL'){var _0x417689={};_0x417689[_0x3610b9[_0x80f5('0x2b')]]={'$like':'%'+_0x4c4822[_0x80f5('0x1d')]['filter']+'%'};return _0x417689;}})});}_0x3f35a7=_[_0x80f5('0x2c')]({},_0x3f35a7,_0x4c4822[_0x80f5('0x2d')]);var _0x12fed5={'where':_0x3f35a7[_0x80f5('0x28')]};return db['Dynamics365Account'][_0x80f5('0xa')](_0x12fed5)[_0x80f5('0xf')](function(_0x19ea42){_0x38ecf0[_0x80f5('0xa')]=_0x19ea42;if(_0x4c4822[_0x80f5('0x1d')][_0x80f5('0x2e')]){_0x3f35a7[_0x80f5('0x2f')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x80f5('0x30')](_0x3f35a7);})[_0x80f5('0xf')](function(_0x457941){_0x38ecf0[_0x80f5('0x31')]=_0x457941;return _0x38ecf0;})[_0x80f5('0xf')](respondWithFilteredResult(_0x19260a,_0x3f35a7))[_0x80f5('0x32')](handleError(_0x19260a,null));};exports[_0x80f5('0x33')]=function(_0x23ced3,_0x3280c7){var _0x436af9={'raw':![],'where':{'id':_0x23ced3['params']['id']}},_0x49b8e5={};_0x49b8e5[_0x80f5('0x21')]=_[_0x80f5('0x1c')](db[_0x80f5('0x17')][_0x80f5('0x18')]);_0x49b8e5[_0x80f5('0x1d')]=_[_0x80f5('0x1c')](_0x23ced3[_0x80f5('0x1d')]);_0x49b8e5[_0x80f5('0x1e')]=_[_0x80f5('0x1f')](_0x49b8e5[_0x80f5('0x21')],_0x49b8e5[_0x80f5('0x1d')]);_0x436af9[_0x80f5('0x20')]=_[_0x80f5('0x1f')](_0x49b8e5[_0x80f5('0x21')],qs[_0x80f5('0x22')](_0x23ced3['query'][_0x80f5('0x22')]));_0x436af9[_0x80f5('0x20')]=_0x436af9['attributes'][_0x80f5('0x23')]?_0x436af9[_0x80f5('0x20')]:_0x49b8e5['model'];if(_0x23ced3[_0x80f5('0x1d')][_0x80f5('0x2e')]){_0x436af9[_0x80f5('0x2f')]=[{'all':!![]}];}_0x436af9=_['merge']({},_0x436af9,_0x23ced3[_0x80f5('0x2d')]);return db[_0x80f5('0x17')][_0x80f5('0x34')](_0x436af9)[_0x80f5('0xf')](handleEntityNotFound(_0x3280c7,null))[_0x80f5('0xf')](respondWithResult(_0x3280c7,null))[_0x80f5('0x32')](handleError(_0x3280c7,null));};exports[_0x80f5('0x35')]=function(_0x3a4cf6,_0x45188b){return db[_0x80f5('0x17')][_0x80f5('0x35')](_0x3a4cf6[_0x80f5('0x36')],{})[_0x80f5('0xf')](respondWithResult(_0x45188b,0xc9))[_0x80f5('0x32')](handleError(_0x45188b,null));};exports[_0x80f5('0xd')]=function(_0x54a646,_0x2915da){if(_0x54a646['body']['id']){delete _0x54a646[_0x80f5('0x36')]['id'];}return db[_0x80f5('0x17')][_0x80f5('0x34')]({'where':{'id':_0x54a646[_0x80f5('0x37')]['id']}})['then'](handleEntityNotFound(_0x2915da,null))['then'](saveUpdates(_0x54a646[_0x80f5('0x36')],null))[_0x80f5('0xf')](respondWithResult(_0x2915da,null))['catch'](handleError(_0x2915da,null));};exports[_0x80f5('0xe')]=function(_0x3e7f5c,_0x1d8f8c){return db[_0x80f5('0x17')]['find']({'where':{'id':_0x3e7f5c[_0x80f5('0x37')]['id']}})[_0x80f5('0xf')](handleEntityNotFound(_0x1d8f8c,null))[_0x80f5('0xf')](removeEntity(_0x1d8f8c,null))[_0x80f5('0x32')](handleError(_0x1d8f8c,null));};exports[_0x80f5('0x38')]=function(_0x722053,_0x1ad1a9){var _0x27d0fe={};var _0x319a16={};var _0x2d98d2;var _0x2e0b28;return db['Dynamics365Account'][_0x80f5('0x39')]({'where':{'id':_0x722053[_0x80f5('0x37')]['id']}})['then'](handleEntityNotFound(_0x1ad1a9,null))[_0x80f5('0xf')](function(_0x2e96d9){if(_0x2e96d9){_0x2d98d2=_0x2e96d9;_0x319a16[_0x80f5('0x21')]=_[_0x80f5('0x1c')](db[_0x80f5('0x3a')]['rawAttributes']);_0x319a16[_0x80f5('0x1d')]=_[_0x80f5('0x1c')](_0x722053[_0x80f5('0x1d')]);_0x319a16['filters']=_[_0x80f5('0x1f')](_0x319a16[_0x80f5('0x21')],_0x319a16[_0x80f5('0x1d')]);_0x27d0fe[_0x80f5('0x20')]=_[_0x80f5('0x1f')](_0x319a16[_0x80f5('0x21')],qs[_0x80f5('0x22')](_0x722053[_0x80f5('0x1d')][_0x80f5('0x22')]));_0x27d0fe[_0x80f5('0x20')]=_0x27d0fe[_0x80f5('0x20')]['length']?_0x27d0fe[_0x80f5('0x20')]:_0x319a16['model'];_0x27d0fe[_0x80f5('0x26')]=qs[_0x80f5('0x27')](_0x722053[_0x80f5('0x1d')][_0x80f5('0x27')]);_0x27d0fe[_0x80f5('0x28')]=qs[_0x80f5('0x1e')](_['pick'](_0x722053['query'],_0x319a16[_0x80f5('0x1e')]));if(_0x722053[_0x80f5('0x1d')][_0x80f5('0x2a')]){_0x27d0fe[_0x80f5('0x28')]=_[_0x80f5('0x2c')](_0x27d0fe['where'],{'$or':_[_0x80f5('0x16')](_0x27d0fe[_0x80f5('0x20')],function(_0x28651f){var _0x3649cd={};_0x3649cd[_0x28651f]={'$like':'%'+_0x722053[_0x80f5('0x1d')][_0x80f5('0x2a')]+'%'};return _0x3649cd;})});}_0x27d0fe=_['merge']({},_0x27d0fe,_0x722053[_0x80f5('0x2d')]);return _0x2d98d2[_0x80f5('0x38')](_0x27d0fe);}})[_0x80f5('0xf')](function(_0x2a1b5b){if(_0x2a1b5b){_0x2e0b28=_0x2a1b5b['length'];if(!_0x722053[_0x80f5('0x1d')][_0x80f5('0x24')]('nolimit')){_0x27d0fe[_0x80f5('0xc')]=qs[_0x80f5('0xc')](_0x722053[_0x80f5('0x1d')][_0x80f5('0xc')]);_0x27d0fe['offset']=qs['offset'](_0x722053['query']['offset']);}return _0x2d98d2[_0x80f5('0x38')](_0x27d0fe);}})[_0x80f5('0xf')](function(_0x1d433d){if(_0x1d433d){return _0x1d433d?{'count':_0x2e0b28,'rows':_0x1d433d}:null;}})[_0x80f5('0xf')](respondWithResult(_0x1ad1a9,null))[_0x80f5('0x32')](handleError(_0x1ad1a9,null));};exports[_0x80f5('0x3b')]=function(_0xc8aa2b,_0x505411){if(_0xc8aa2b[_0x80f5('0x36')]['id']){delete _0xc8aa2b[_0x80f5('0x36')]['id'];}return db[_0x80f5('0x17')][_0x80f5('0x39')]({'where':{'id':_0xc8aa2b['params']['id']}})['then'](handleEntityNotFound(_0x505411,null))[_0x80f5('0xf')](function(_0x24d8e5){if(_0x24d8e5){_0xc8aa2b[_0x80f5('0x36')]['AccountId']=_0x24d8e5['id'];_0xc8aa2b[_0x80f5('0x36')][_0x80f5('0x3c')]=integrations[_0x80f5('0x3d')](_0xc8aa2b['body'][_0x80f5('0x3e')],_0xc8aa2b[_0x80f5('0x36')][_0x80f5('0x1a')]);_0xc8aa2b['body']['Descriptions']=integrations[_0x80f5('0x3f')](_0xc8aa2b[_0x80f5('0x36')][_0x80f5('0x3e')],_0xc8aa2b['body'][_0x80f5('0x1a')]);return db[_0x80f5('0x3a')][_0x80f5('0x35')](_0xc8aa2b[_0x80f5('0x36')],{'include':[{'model':db[_0x80f5('0x40')],'as':_0x80f5('0x3c')},{'model':db[_0x80f5('0x40')],'as':_0x80f5('0x41')}]});}return null;})[_0x80f5('0xf')](respondWithResult(_0x505411,null))[_0x80f5('0x32')](handleError(_0x505411,null));};function sanitizeRemoteUri(_0x3683aa){var _0x3bd6aa=_0x3683aa[_0x80f5('0x42')](-0x1);if(_0x3bd6aa==='/')return _0x3683aa['substring'](0x0,_0x3683aa['lastIndexOf'](_0x3bd6aa));return _0x3683aa;}function getWebApiUrl(_0x5bcbde){return util[_0x80f5('0x43')](_0x80f5('0x44'),_0x5bcbde);}exports['getFields']=function(_0x2c24d1,_0x4513cc){var _0x4743c2=_0x2c24d1[_0x80f5('0x1d')][_0x80f5('0x45')];var _0x27f82e=_0x4743c2==='incident'?_0x80f5('0x46'):_0x80f5('0x47');var _0x53eea3='';var _0x1fe78c='';var _0x1460e2='';var _0x4826c1='';var _0x348308='';var _0xab94b='';var _0x2bb275='';var _0x717768='';var _0x2a7621=[_0x80f5('0x48'),_0x80f5('0x49'),_0x80f5('0x4a'),'ownerid',_0x80f5('0x4b'),_0x80f5('0x4c'),_0x80f5('0x4d'),_0x80f5('0x4e'),_0x80f5('0x4f'),_0x80f5('0x50')];var _0x7891d9=[_0x80f5('0x51'),_0x80f5('0x52'),_0x80f5('0x53'),_0x80f5('0x54'),_0x80f5('0x55'),_0x80f5('0x56'),_0x80f5('0x57'),_0x80f5('0x58'),_0x80f5('0x59'),_0x80f5('0x5a'),_0x80f5('0x5b'),_0x80f5('0x5c'),'createdon',_0x80f5('0x5d'),_0x80f5('0x5e'),_0x80f5('0x5f'),_0x80f5('0x60'),'customeridyominame','emailaddress','entitlementidname',_0x80f5('0x61'),'entityimage_url',_0x80f5('0x62'),_0x80f5('0x63'),_0x80f5('0x64'),_0x80f5('0x65'),_0x80f5('0x66'),_0x80f5('0x67'),'kbarticleidname','lastonholdtime',_0x80f5('0x68'),_0x80f5('0x69'),_0x80f5('0x6a'),_0x80f5('0x6b'),_0x80f5('0x6c'),_0x80f5('0x6d'),_0x80f5('0x6e'),_0x80f5('0x6f'),'msdyn_incidenttypename','msdyn_iotalertname',_0x80f5('0x70'),_0x80f5('0x71'),_0x80f5('0x72'),_0x80f5('0x73'),_0x80f5('0x74'),_0x80f5('0x75'),_0x80f5('0x76'),_0x80f5('0x77'),_0x80f5('0x78'),_0x80f5('0x79'),_0x80f5('0x7a'),_0x80f5('0x7b'),_0x80f5('0x7c'),'resolvebykpiidname','responseby','responsiblecontactidname',_0x80f5('0x7d'),_0x80f5('0x7e'),_0x80f5('0x7f'),_0x80f5('0x80'),'socialprofileidname',_0x80f5('0x81'),'statuscode',_0x80f5('0x82'),_0x80f5('0x83'),_0x80f5('0x84'),_0x80f5('0x85'),_0x80f5('0x86'),'utcconversiontimezonecode','versionnumber'];var _0x47f2ae=_0x2a7621[_0x80f5('0x87')](_0x7891d9);return db[_0x80f5('0x17')]['findOne']({'where':{'id':_0x2c24d1[_0x80f5('0x37')]['id']},'attributes':['id',_0x80f5('0x88'),'password',_0x80f5('0x89'),_0x80f5('0x8a'),_0x80f5('0x8b'),_0x80f5('0x8c'),_0x80f5('0x8d')],'include':[{'model':db[_0x80f5('0x8e')],'as':_0x80f5('0x8e'),'attributes':['id','data5',_0x80f5('0x8f')]}]})[_0x80f5('0xf')](handleEntityNotFound(_0x4513cc,null))[_0x80f5('0xf')](function(_0x17af15){if(_0x17af15){if(_0x17af15['modernAuthentication']){_0x17af15[_0x80f5('0x90')]=_0x17af15['CloudProvider'][_0x80f5('0x91')];_0x717768=sanitizeRemoteUri(_0x17af15[_0x80f5('0x8e')]['data7']);_0x2bb275=getWebApiUrl(_0x717768);return _0x17af15;}_0x717768=sanitizeRemoteUri(_0x17af15[_0x80f5('0x89')]);_0x2bb275=getWebApiUrl(_0x717768);var _0x1c279b={'method':'POST','uri':_0x80f5('0x92')+_0x17af15[_0x80f5('0x8a')]+_0x80f5('0x93'),'form':{'client_id':_0x17af15[_0x80f5('0x8b')],'resource':_0x717768,'username':_0x17af15['username'],'password':_0x17af15[_0x80f5('0x94')],'grant_type':_0x80f5('0x94'),'client_secret':_0x17af15[_0x80f5('0x8c')]},'json':!![]};return rp(_0x1c279b);}})['then'](function(_0x33c9ad){_0xab94b=_0x33c9ad['access_token'];var _0x21c84f={'method':_0x80f5('0x95'),'uri':encodeURI(_0x2bb275+_0x80f5('0x96')+_0x27f82e+'\x27'),'headers':{'Authorization':_0x80f5('0x97')+_0xab94b,'If-None-Match':null,'OData-Version':_0x80f5('0x98')},'json':!![]};return rp(_0x21c84f);})[_0x80f5('0xf')](function(_0x2ae41c){var _0x471db0=_0x2ae41c[_0x80f5('0x99')][0x0];var _0x8ba400=_0x471db0[_0x80f5('0x9a')];var _0x237a12={'method':_0x80f5('0x95'),'uri':_0x2bb275+'EntityDefinitions('+_0x8ba400+_0x80f5('0x9b'),'headers':{'Authorization':_0x80f5('0x97')+_0xab94b,'If-None-Match':null,'OData-Version':_0x80f5('0x98')},'json':!![]};return rp(_0x237a12);})[_0x80f5('0xf')](function(_0x4dcd17){_0x53eea3=_0x4dcd17;_0x1fe78c=_0x53eea3[_0x80f5('0x9c')];_0x1fe78c=_[_0x80f5('0x9d')](_0x1fe78c,function(_0x216fb0){return!_0x47f2ae[_0x80f5('0x9e')](_0x216fb0[_0x80f5('0x9f')]);});var _0x419e26=[];var _0x5ec274=[];_0x1fe78c['forEach'](function(_0xa8ac35){if(_0xa8ac35['@odata.type']){var _0x46c40a=_0xa8ac35[_0x80f5('0xa0')]['substring'](_0xa8ac35[_0x80f5('0xa0')]['lastIndexOf']('.')+0x1);if(_0x46c40a===_0x80f5('0xa1')){_0x419e26[_0x80f5('0xa2')](getSelectList(_0x2bb275,_0x4743c2,_0x5ec274,_0x53eea3[_0x80f5('0x9a')],_0xa8ac35[_0x80f5('0x9a')],_0xab94b));}}});return Promise[_0x80f5('0xa3')](_0x419e26);})['then'](function(_0x1d4266){_0x1460e2=_0x1d4266[0x0];var _0x28d815=[];var _0x4fe36f=[];_0x1fe78c[_0x80f5('0xa4')](function(_0xc033d6){if(!_['isNil'](_0xc033d6['@odata.type'])){var _0x321d40=_0xc033d6[_0x80f5('0xa0')][_0x80f5('0xa5')](_0xc033d6['@odata.type'][_0x80f5('0xa6')]('.')+0x1);if(_0x321d40==='BooleanAttributeMetadata'){_0x28d815[_0x80f5('0xa2')](getBooleanList(_0x2bb275,_0x4743c2,_0x4fe36f,_0x53eea3[_0x80f5('0x9a')],_0xc033d6[_0x80f5('0x9a')],_0xab94b));}}});return Promise[_0x80f5('0xa3')](_0x28d815);})[_0x80f5('0xf')](function(_0x3087e1){_0x4826c1=_0x3087e1[0x0];var _0x2c5b02=[];var _0x15e811=[];_0x1fe78c[_0x80f5('0xa4')](function(_0x3e0ca4){if(_0x3e0ca4['@odata.type']){var _0xb66964=_0x3e0ca4[_0x80f5('0xa0')][_0x80f5('0xa5')](_0x3e0ca4['@odata.type'][_0x80f5('0xa6')]('.')+0x1);if(_0xb66964==='StringAttributeMetadata'||_0xb66964===_0x80f5('0xa7')||_0xb66964===_0x80f5('0xa8')||_0xb66964==='IntegerAttributeMetadata'||_0xb66964==='MemoAttributeMetadata'||_0xb66964===_0x80f5('0xa9')||_0xb66964===_0x80f5('0xaa')||_0xb66964==='EntityNameAttributeMetadata'||_0xb66964===_0x80f5('0xab')||_0xb66964===_0x80f5('0xac')){_0x2c5b02[_0x80f5('0xa2')](getInputList(_0x2bb275,_0x4743c2,_0xb66964,_0x15e811,_0x53eea3['MetadataId'],_0x3e0ca4[_0x80f5('0x9a')],_0xab94b));}}});return Promise['all'](_0x2c5b02);})['then'](function(_0x20e40d){_0x348308=_0x20e40d[0x0];var _0x27bd1f=_0x1460e2[_0x80f5('0x87')](_0x4826c1)[_0x80f5('0x87')](_0x348308);var _0x266752={'count':_0x27bd1f['length'],'rows':_0x27bd1f};return _0x266752;})['then'](respondWithResult(_0x4513cc,null))[_0x80f5('0x32')](function(_0xe2217e){var _0x2655ea=_0x2c24d1[_0x80f5('0x1d')][_0x80f5('0xad')]?0x1f4:_0xe2217e[_0x80f5('0xae')]||0x1f4;logger[_0x80f5('0x12')](_0xe2217e['stack']);delete _0xe2217e[_0x80f5('0x2b')];if(_0x2655ea===0x191){_0x2655ea=0x190;}_0x4513cc[_0x80f5('0x7')](_0x2655ea)[_0x80f5('0x14')](_0x2c24d1[_0x80f5('0x1d')][_0x80f5('0xad')]?{'message':'Wrong\x20credentials','statusCode':_0xe2217e['statusCode']}:_0xe2217e);});};function getSelectList(_0x1b5197,_0x514b09,_0x2a07fc,_0x3f179e,_0x4a40ba,_0x180e75){var _0x12ff60={'method':_0x80f5('0x95'),'uri':_0x1b5197+'EntityDefinitions('+_0x3f179e+_0x80f5('0xaf')+_0x4a40ba+_0x80f5('0xb0')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x80f5('0x97')+_0x180e75,'If-None-Match':null,'OData-Version':_0x80f5('0x98')},'json':!![]};return rp(_0x12ff60)[_0x80f5('0xf')](function(_0x366ed6){var _0x282771=[];var _0x2c1236=_0x366ed6[_0x80f5('0xb1')][_0x80f5('0xb2')];_0x2c1236[_0x80f5('0xa4')](function(_0xb4805d){_0x282771[_0x80f5('0xa2')]({'name':_0xb4805d[_0x80f5('0xb3')][_0x80f5('0xb4')]['Label'],'value':String(_0xb4805d[_0x80f5('0xb5')])});});var _0x3cc170={'id':_0x514b09+'_'+_0x366ed6['LogicalName'],'name':_0x366ed6[_0x80f5('0xb6')][_0x80f5('0xb4')]['Label'],'custom':![],'options':_0x282771};_0x2a07fc[_0x80f5('0xa2')](_0x3cc170);return _0x2a07fc;});}function getBooleanList(_0x43f4d9,_0x32f979,_0x25d6d2,_0xb74d97,_0x59d8fa,_0xe108b5){var _0x50be43={'method':_0x80f5('0x95'),'uri':_0x43f4d9+_0x80f5('0xb7')+_0xb74d97+_0x80f5('0xaf')+_0x59d8fa+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x80f5('0x97')+_0xe108b5,'If-None-Match':null,'OData-Version':_0x80f5('0x98')},'json':!![]};return rp(_0x50be43)['then'](function(_0x1b1fc1){var _0x2ca1d8=[];_0x2ca1d8[_0x80f5('0xa2')]({'name':_0x1b1fc1[_0x80f5('0xb1')][_0x80f5('0xb8')]['Label'][_0x80f5('0xb4')]['Label'],'value':_0x80f5('0xb9')},{'name':_0x1b1fc1['OptionSet'][_0x80f5('0xba')][_0x80f5('0xb3')][_0x80f5('0xb4')][_0x80f5('0xb3')],'value':_0x80f5('0xbb')});var _0x398fac={'id':_0x32f979+'_'+_0x1b1fc1[_0x80f5('0x9f')],'name':_0x1b1fc1[_0x80f5('0xb6')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x2ca1d8};_0x25d6d2[_0x80f5('0xa2')](_0x398fac);return _0x25d6d2;});}function getInputList(_0x583620,_0x4b0edd,_0x119137,_0x16b507,_0x375f00,_0x18f60a,_0x294540){var _0xafffa9={'method':_0x80f5('0x95'),'uri':_0x583620+'EntityDefinitions('+_0x375f00+_0x80f5('0xaf')+_0x18f60a+_0x80f5('0xbc')+_0x119137+_0x80f5('0xbd'),'headers':{'Authorization':_0x80f5('0x97')+_0x294540,'If-None-Match':null,'OData-Version':_0x80f5('0x98')},'json':!![]};return rp(_0xafffa9)[_0x80f5('0xf')](function(_0x3e6caa){var _0x37941c={'id':_0x4b0edd+'_'+_0x3e6caa[_0x80f5('0x9f')],'name':_0x3e6caa[_0x80f5('0xb6')][_0x80f5('0xb4')]?_0x3e6caa[_0x80f5('0xb6')]['UserLocalizedLabel'][_0x80f5('0xb3')]:_0x3e6caa[_0x80f5('0x9f')],'custom':![],'options':[]};_0x16b507[_0x80f5('0xa2')](_0x37941c);return _0x16b507;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 1fe803e..4951443 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x39dda2,_0x383be4){var _0x10aaaa=function(_0x417d69){while(--_0x417d69){_0x39dda2['push'](_0x39dda2['shift']());}};_0x10aaaa(++_0x383be4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x528373,_0x4595d3){var _0x3bac7c=function(_0x4c08da){while(--_0x4c08da){_0x528373['push'](_0x528373['shift']());}};_0x3bac7c(++_0x4595d3);}(_0xe706,0xa3));var _0x6e70=function(_0x487ee4,_0x3d3e66){_0x487ee4=_0x487ee4-0x0;var _0x3b0877=_0xe706[_0x487ee4];return _0x3b0877;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 99bd655..1985688 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 _0xf229=['then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetDynamics365Account','ShowDynamics365Account','Dynamics365Account','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xd5f14,_0x43371d){var _0xb417ec=function(_0x9860b0){while(--_0x9860b0){_0xd5f14['push'](_0xd5f14['shift']());}};_0xb417ec(++_0x43371d);}(_0xf229,0x131));var _0x9f22=function(_0xf70346,_0x2ce180){_0xf70346=_0xf70346-0x0;var _0x4636fb=_0xf229[_0xf70346];return _0x4636fb;};'use strict';var _=require(_0x9f22('0x0'));var util=require('util');var moment=require(_0x9f22('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f22('0x2'));var fs=require('fs');var Redis=require(_0x9f22('0x3'));var db=require(_0x9f22('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f22('0x5'))(_0x9f22('0x6'));var config=require(_0x9f22('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f22('0x8')][_0x9f22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x195ce7,_0x1f7eac,_0x3cb923){return new BPromise(function(_0x1323b7,_0x55a77b){return client['request'](_0x195ce7,_0x3cb923)[_0x9f22('0xa')](function(_0x5e61cd){logger['info'](_0x9f22('0xb'),_0x1f7eac,'request\x20sent');logger[_0x9f22('0xc')](_0x9f22('0xd'),_0x1f7eac,'request\x20sent',JSON[_0x9f22('0xe')](_0x5e61cd));if(_0x5e61cd[_0x9f22('0xf')]){if(_0x5e61cd[_0x9f22('0xf')][_0x9f22('0x10')]===0x1f4){logger[_0x9f22('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x1f7eac,_0x5e61cd[_0x9f22('0xf')][_0x9f22('0x11')]);return _0x55a77b(_0x5e61cd[_0x9f22('0xf')][_0x9f22('0x11')]);}logger[_0x9f22('0xf')](_0x9f22('0xb'),_0x1f7eac,_0x5e61cd[_0x9f22('0xf')]['message']);return _0x1323b7(_0x5e61cd[_0x9f22('0xf')][_0x9f22('0x11')]);}else{logger[_0x9f22('0x12')](_0x9f22('0xb'),_0x1f7eac,_0x9f22('0x13'));_0x1323b7(_0x5e61cd[_0x9f22('0x14')]['message']);}})[_0x9f22('0x15')](function(_0x84dc1e){logger[_0x9f22('0xf')](_0x9f22('0xb'),_0x1f7eac,_0x84dc1e);_0x55a77b(_0x84dc1e);});});}exports['GetDynamics365Account']=function(_0x5b997b){var _0x423aee=this;return new Promise(function(_0x1bafa8,_0x4e4a64){return db['Dynamics365Account'][_0x9f22('0x16')]({'raw':_0x5b997b[_0x9f22('0x17')]?_0x5b997b[_0x9f22('0x17')][_0x9f22('0x18')]===undefined?!![]:![]:!![],'where':_0x5b997b['options']?_0x5b997b[_0x9f22('0x17')]['where']||null:null,'attributes':_0x5b997b[_0x9f22('0x17')]?_0x5b997b[_0x9f22('0x17')][_0x9f22('0x19')]||null:null,'limit':_0x5b997b['options']?_0x5b997b['options'][_0x9f22('0x1a')]||null:null,'include':_0x5b997b[_0x9f22('0x17')]?_0x5b997b[_0x9f22('0x17')][_0x9f22('0x1b')]?_[_0x9f22('0x1c')](_0x5b997b[_0x9f22('0x17')]['include'],function(_0x4c8cdf){return{'model':db[_0x4c8cdf[_0x9f22('0x1d')]],'as':_0x4c8cdf['as'],'attributes':_0x4c8cdf['attributes'],'include':_0x4c8cdf[_0x9f22('0x1b')]?_['map'](_0x4c8cdf['include'],function(_0x1d7b84){return{'model':db[_0x1d7b84[_0x9f22('0x1d')]],'as':_0x1d7b84['as'],'attributes':_0x1d7b84[_0x9f22('0x19')],'include':_0x1d7b84[_0x9f22('0x1b')]?_[_0x9f22('0x1c')](_0x1d7b84[_0x9f22('0x1b')],function(_0x118d5c){return{'model':db[_0x118d5c[_0x9f22('0x1d')]],'as':_0x118d5c['as'],'attributes':_0x118d5c[_0x9f22('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9f22('0xa')](function(_0x4f383a){logger[_0x9f22('0x12')](_0x9f22('0x1e'),_0x5b997b);logger['debug'](_0x9f22('0x1e'),_0x5b997b,JSON[_0x9f22('0xe')](_0x4f383a));_0x1bafa8(_0x4f383a);})[_0x9f22('0x15')](function(_0xec127f){logger[_0x9f22('0xf')](_0x9f22('0x1e'),_0xec127f[_0x9f22('0x11')],_0x5b997b);_0x4e4a64(_0x423aee[_0x9f22('0xf')](0x1f4,_0xec127f[_0x9f22('0x11')]));});});};exports[_0x9f22('0x1f')]=function(_0x4b2230){var _0x385f7f=this;return new Promise(function(_0x43157c,_0x1a0ffb){return db[_0x9f22('0x20')][_0x9f22('0x21')]({'raw':_0x4b2230[_0x9f22('0x17')]?_0x4b2230['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b2230[_0x9f22('0x17')]?_0x4b2230[_0x9f22('0x17')][_0x9f22('0x22')]||null:null,'attributes':_0x4b2230[_0x9f22('0x17')]?_0x4b2230[_0x9f22('0x17')][_0x9f22('0x19')]||null:null,'include':_0x4b2230[_0x9f22('0x17')]?_0x4b2230[_0x9f22('0x17')]['include']?_['map'](_0x4b2230['options'][_0x9f22('0x1b')],function(_0x36e06f){return{'model':db[_0x36e06f['model']],'as':_0x36e06f['as'],'attributes':_0x36e06f['attributes'],'include':_0x36e06f['include']?_[_0x9f22('0x1c')](_0x36e06f[_0x9f22('0x1b')],function(_0x3a978d){return{'model':db[_0x3a978d['model']],'as':_0x3a978d['as'],'attributes':_0x3a978d[_0x9f22('0x19')],'include':_0x3a978d[_0x9f22('0x1b')]?_[_0x9f22('0x1c')](_0x3a978d[_0x9f22('0x1b')],function(_0x2ca144){return{'model':db[_0x2ca144[_0x9f22('0x1d')]],'as':_0x2ca144['as'],'attributes':_0x2ca144[_0x9f22('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9f22('0xa')](function(_0x4d6d9b){logger[_0x9f22('0x12')](_0x9f22('0x1f'),_0x4b2230);logger[_0x9f22('0xc')](_0x9f22('0x1f'),_0x4b2230,JSON[_0x9f22('0xe')](_0x4d6d9b));_0x43157c(_0x4d6d9b);})[_0x9f22('0x15')](function(_0x358234){logger[_0x9f22('0xf')](_0x9f22('0x1f'),_0x358234['message'],_0x4b2230);_0x1a0ffb(_0x385f7f['error'](0x1f4,_0x358234[_0x9f22('0x11')]));});});}; \ No newline at end of file +var _0x2f38=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit','map','include','model','ShowDynamics365Account','find','raw','lodash','moment','bluebird'];(function(_0x4d230c,_0x3862fd){var _0x16b044=function(_0x3d61f6){while(--_0x3d61f6){_0x4d230c['push'](_0x4d230c['shift']());}};_0x16b044(++_0x3862fd);}(_0x2f38,0x95));var _0x82f3=function(_0x4e79f8,_0x223bf8){_0x4e79f8=_0x4e79f8-0x0;var _0x2254bc=_0x2f38[_0x4e79f8];return _0x2254bc;};'use strict';var _=require(_0x82f3('0x0'));var util=require('util');var moment=require(_0x82f3('0x1'));var BPromise=require(_0x82f3('0x2'));var rs=require(_0x82f3('0x3'));var fs=require('fs');var Redis=require(_0x82f3('0x4'));var db=require(_0x82f3('0x5'))['db'];var utils=require(_0x82f3('0x6'));var logger=require(_0x82f3('0x7'))(_0x82f3('0x8'));var config=require(_0x82f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x82f3('0xa')][_0x82f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31cec1,_0xe73c6,_0x4b4b1b){return new BPromise(function(_0x4d238e,_0x5794a0){return client[_0x82f3('0xc')](_0x31cec1,_0x4b4b1b)[_0x82f3('0xd')](function(_0x252666){logger['info'](_0x82f3('0xe'),_0xe73c6,_0x82f3('0xf'));logger[_0x82f3('0x10')](_0x82f3('0x11'),_0xe73c6,_0x82f3('0xf'),JSON[_0x82f3('0x12')](_0x252666));if(_0x252666[_0x82f3('0x13')]){if(_0x252666[_0x82f3('0x13')][_0x82f3('0x14')]===0x1f4){logger['error'](_0x82f3('0xe'),_0xe73c6,_0x252666['error'][_0x82f3('0x15')]);return _0x5794a0(_0x252666[_0x82f3('0x13')][_0x82f3('0x15')]);}logger[_0x82f3('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0xe73c6,_0x252666[_0x82f3('0x13')][_0x82f3('0x15')]);return _0x4d238e(_0x252666[_0x82f3('0x13')][_0x82f3('0x15')]);}else{logger[_0x82f3('0x16')](_0x82f3('0xe'),_0xe73c6,_0x82f3('0xf'));_0x4d238e(_0x252666[_0x82f3('0x17')][_0x82f3('0x15')]);}})[_0x82f3('0x18')](function(_0x62af69){logger[_0x82f3('0x13')](_0x82f3('0xe'),_0xe73c6,_0x62af69);_0x5794a0(_0x62af69);});});}exports[_0x82f3('0x19')]=function(_0x19b83f){var _0x4b6580=this;return new Promise(function(_0x3e02c3,_0x28c305){return db[_0x82f3('0x1a')][_0x82f3('0x1b')]({'raw':_0x19b83f[_0x82f3('0x1c')]?_0x19b83f['options']['raw']===undefined?!![]:![]:!![],'where':_0x19b83f[_0x82f3('0x1c')]?_0x19b83f[_0x82f3('0x1c')][_0x82f3('0x1d')]||null:null,'attributes':_0x19b83f[_0x82f3('0x1c')]?_0x19b83f[_0x82f3('0x1c')][_0x82f3('0x1e')]||null:null,'limit':_0x19b83f[_0x82f3('0x1c')]?_0x19b83f['options'][_0x82f3('0x1f')]||null:null,'include':_0x19b83f[_0x82f3('0x1c')]?_0x19b83f['options']['include']?_[_0x82f3('0x20')](_0x19b83f[_0x82f3('0x1c')]['include'],function(_0x754cac){return{'model':db[_0x754cac['model']],'as':_0x754cac['as'],'attributes':_0x754cac[_0x82f3('0x1e')],'include':_0x754cac[_0x82f3('0x21')]?_['map'](_0x754cac[_0x82f3('0x21')],function(_0x2ebf7d){return{'model':db[_0x2ebf7d[_0x82f3('0x22')]],'as':_0x2ebf7d['as'],'attributes':_0x2ebf7d[_0x82f3('0x1e')],'include':_0x2ebf7d[_0x82f3('0x21')]?_[_0x82f3('0x20')](_0x2ebf7d[_0x82f3('0x21')],function(_0x3bcfb9){return{'model':db[_0x3bcfb9['model']],'as':_0x3bcfb9['as'],'attributes':_0x3bcfb9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xded0f){logger[_0x82f3('0x16')](_0x82f3('0x19'),_0x19b83f);logger['debug'](_0x82f3('0x19'),_0x19b83f,JSON[_0x82f3('0x12')](_0xded0f));_0x3e02c3(_0xded0f);})[_0x82f3('0x18')](function(_0x5841aa){logger['error'](_0x82f3('0x19'),_0x5841aa['message'],_0x19b83f);_0x28c305(_0x4b6580[_0x82f3('0x13')](0x1f4,_0x5841aa[_0x82f3('0x15')]));});});};exports[_0x82f3('0x23')]=function(_0x40bef2){var _0x5a2768=this;return new Promise(function(_0x1c74b2,_0x2cb7ab){return db['Dynamics365Account'][_0x82f3('0x24')]({'raw':_0x40bef2[_0x82f3('0x1c')]?_0x40bef2[_0x82f3('0x1c')][_0x82f3('0x25')]===undefined?!![]:![]:!![],'where':_0x40bef2[_0x82f3('0x1c')]?_0x40bef2[_0x82f3('0x1c')][_0x82f3('0x1d')]||null:null,'attributes':_0x40bef2['options']?_0x40bef2['options'][_0x82f3('0x1e')]||null:null,'include':_0x40bef2[_0x82f3('0x1c')]?_0x40bef2['options'][_0x82f3('0x21')]?_[_0x82f3('0x20')](_0x40bef2[_0x82f3('0x1c')][_0x82f3('0x21')],function(_0x5d7d44){return{'model':db[_0x5d7d44[_0x82f3('0x22')]],'as':_0x5d7d44['as'],'attributes':_0x5d7d44[_0x82f3('0x1e')],'include':_0x5d7d44[_0x82f3('0x21')]?_['map'](_0x5d7d44[_0x82f3('0x21')],function(_0x178ed1){return{'model':db[_0x178ed1[_0x82f3('0x22')]],'as':_0x178ed1['as'],'attributes':_0x178ed1[_0x82f3('0x1e')],'include':_0x178ed1[_0x82f3('0x21')]?_[_0x82f3('0x20')](_0x178ed1[_0x82f3('0x21')],function(_0x346c4b){return{'model':db[_0x346c4b[_0x82f3('0x22')]],'as':_0x346c4b['as'],'attributes':_0x346c4b[_0x82f3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x575ab5){logger[_0x82f3('0x16')]('ShowDynamics365Account',_0x40bef2);logger[_0x82f3('0x10')]('ShowDynamics365Account',_0x40bef2,JSON[_0x82f3('0x12')](_0x575ab5));_0x1c74b2(_0x575ab5);})[_0x82f3('0x18')](function(_0x549357){logger[_0x82f3('0x13')](_0x82f3('0x23'),_0x549357[_0x82f3('0x15')],_0x40bef2);_0x2cb7ab(_0x5a2768['error'](0x1f4,_0x549357[_0x82f3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 3841c40..cde8c2c 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 _0x666b=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','/:id'];(function(_0x3137f6,_0x5d9dbf){var _0x28f5b7=function(_0x126769){while(--_0x126769){_0x3137f6['push'](_0x3137f6['shift']());}};_0x28f5b7(++_0x5d9dbf);}(_0x666b,0x107));var _0xb666=function(_0x9a7d08,_0xe9048){_0x9a7d08=_0x9a7d08-0x0;var _0x58e6e8=_0x666b[_0x9a7d08];return _0x58e6e8;};'use strict';var multer=require(_0xb666('0x0'));var util=require(_0xb666('0x1'));var path=require(_0xb666('0x2'));var timeout=require(_0xb666('0x3'));var express=require(_0xb666('0x4'));var router=express[_0xb666('0x5')]();var fs_extra=require(_0xb666('0x6'));var auth=require(_0xb666('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb666('0x8'));router[_0xb666('0x9')]('/',auth[_0xb666('0xa')](),controller['index']);router[_0xb666('0x9')](_0xb666('0xb'),auth[_0xb666('0xa')](),controller[_0xb666('0xc')]);router['get'](_0xb666('0xd'),auth['isAuthenticated'](),controller[_0xb666('0xe')]);router['get'](_0xb666('0xf'),auth[_0xb666('0xa')](),controller[_0xb666('0x10')]);router[_0xb666('0x9')](_0xb666('0x11'),auth[_0xb666('0xa')](),controller[_0xb666('0x12')]);router[_0xb666('0x13')]('/',auth['isAuthenticated'](),controller[_0xb666('0x14')]);router[_0xb666('0x15')](_0xb666('0xb'),auth[_0xb666('0xa')](),controller[_0xb666('0x16')]);router[_0xb666('0x17')](_0xb666('0xb'),auth[_0xb666('0xa')](),controller[_0xb666('0x18')]);module['exports']=router; \ No newline at end of file +var _0x80f7=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0xdeedb9,_0x71259f){var _0x197815=function(_0xf7a557){while(--_0xf7a557){_0xdeedb9['push'](_0xdeedb9['shift']());}};_0x197815(++_0x71259f);}(_0x80f7,0xd6));var _0x780f=function(_0x16aa70,_0x5b1f73){_0x16aa70=_0x16aa70-0x0;var _0x11875f=_0x80f7[_0x16aa70];return _0x11875f;};'use strict';var multer=require(_0x780f('0x0'));var util=require('util');var path=require(_0x780f('0x1'));var timeout=require(_0x780f('0x2'));var express=require(_0x780f('0x3'));var router=express[_0x780f('0x4')]();var fs_extra=require(_0x780f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x780f('0x6'));var controller=require(_0x780f('0x7'));router[_0x780f('0x8')]('/',auth[_0x780f('0x9')](),controller['index']);router[_0x780f('0x8')](_0x780f('0xa'),auth[_0x780f('0x9')](),controller[_0x780f('0xb')]);router[_0x780f('0x8')]('/:id/fields',auth[_0x780f('0x9')](),controller[_0x780f('0xc')]);router[_0x780f('0x8')](_0x780f('0xd'),auth[_0x780f('0x9')](),controller['getSubjects']);router[_0x780f('0x8')](_0x780f('0xe'),auth[_0x780f('0x9')](),controller[_0x780f('0xf')]);router[_0x780f('0x10')]('/',auth['isAuthenticated'](),controller[_0x780f('0x11')]);router[_0x780f('0x12')]('/:id',auth[_0x780f('0x9')](),controller[_0x780f('0x13')]);router[_0x780f('0x14')](_0x780f('0xa'),auth[_0x780f('0x9')](),controller[_0x780f('0x15')]);module[_0x780f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index f1e13a5..daa243f 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 _0x65c6=['incident','phonecall','contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x65c6,0xd4));var _0x665c=function(_0x5bfd40,_0x4af241){_0x5bfd40=_0x5bfd40-0x0;var _0x4bc758=_0x65c6[_0x5bfd40];return _0x4bc758;};'use strict';var Sequelize=require(_0x665c('0x0'));module[_0x665c('0x1')]={'name':{'type':Sequelize[_0x665c('0x2')]},'description':{'type':Sequelize[_0x665c('0x2')]},'ticketType':{'type':Sequelize[_0x665c('0x3')](_0x665c('0x4'),_0x665c('0x5')),'defaultValue':_0x665c('0x4')},'moduleCreate':{'type':Sequelize[_0x665c('0x3')](_0x665c('0x6'),_0x665c('0x7')),'defaultValue':_0x665c('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x665c('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x665c('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x30b4=['phonecall','incident','contact','nothing','STRING','exports','ENUM'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x30b4,0x14e));var _0x430b=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x30b4[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require('sequelize');module[_0x430b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x430b('0x1')]('incident',_0x430b('0x2')),'defaultValue':_0x430b('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0x430b('0x4'),_0x430b('0x5')),'defaultValue':_0x430b('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x430b('0x6')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 07f1668..a196c8a 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 _0xcbcb=['model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','destroy','then','stack','name','index','map','Dynamics365Configuration','rawAttributes','type','query','keys','filters','intersection'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xcbcb,0x6d));var _0xbcbc=function(_0x2b26c3,_0x514fd1){_0x2b26c3=_0x2b26c3-0x0;var _0x3cbde4=_0xcbcb[_0x2b26c3];return _0x3cbde4;};'use strict';var emlformat=require(_0xbcbc('0x0'));var rimraf=require(_0xbcbc('0x1'));var zipdir=require(_0xbcbc('0x2'));var jsonpatch=require(_0xbcbc('0x3'));var rp=require(_0xbcbc('0x4'));var moment=require(_0xbcbc('0x5'));var BPromise=require(_0xbcbc('0x6'));var Mustache=require(_0xbcbc('0x7'));var util=require(_0xbcbc('0x8'));var path=require(_0xbcbc('0x9'));var sox=require(_0xbcbc('0xa'));var csv=require(_0xbcbc('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcbc('0xc'));var _=require(_0xbcbc('0xd'));var squel=require(_0xbcbc('0xe'));var crypto=require('crypto');var jsforce=require(_0xbcbc('0xf'));var deskjs=require(_0xbcbc('0x10'));var toCsv=require(_0xbcbc('0xb'));var querystring=require(_0xbcbc('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbcbc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbcbc('0x13'));var hardwareService=require(_0xbcbc('0x14'));var logger=require(_0xbcbc('0x15'))(_0xbcbc('0x16'));var utils=require(_0xbcbc('0x17'));var config=require(_0xbcbc('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2710a6,_0x1d8d51){_0x1d8d51=_0x1d8d51||0xcc;return function(_0x4635fa){if(_0x4635fa){return _0x2710a6[_0xbcbc('0x19')](_0x1d8d51);}return _0x2710a6[_0xbcbc('0x1a')](_0x1d8d51)[_0xbcbc('0x1b')]();};}function respondWithResult(_0x1d3ec7,_0x447eb1){_0x447eb1=_0x447eb1||0xc8;return function(_0xbf69f1){if(_0xbf69f1){return _0x1d3ec7[_0xbcbc('0x1a')](_0x447eb1)[_0xbcbc('0x1c')](_0xbf69f1);}};}function respondWithFilteredResult(_0x43cc55,_0xedde1b){return function(_0x42e123){if(_0x42e123){var _0x3420d7=typeof _0xedde1b[_0xbcbc('0x1d')]==='undefined'&&typeof _0xedde1b[_0xbcbc('0x1e')]===_0xbcbc('0x1f');var _0x28ce09=_0x42e123[_0xbcbc('0x20')];var _0x27979d=_0x3420d7?0x0:_0xedde1b[_0xbcbc('0x1d')];var _0x154ae0=_0x3420d7?_0x42e123[_0xbcbc('0x20')]:_0xedde1b[_0xbcbc('0x1d')]+_0xedde1b[_0xbcbc('0x1e')];var _0x23469e;if(_0x154ae0>=_0x28ce09){_0x154ae0=_0x28ce09;_0x23469e=0xc8;}else{_0x23469e=0xce;}_0x43cc55[_0xbcbc('0x1a')](_0x23469e);return _0x43cc55[_0xbcbc('0x21')](_0xbcbc('0x22'),_0x27979d+'-'+_0x154ae0+'/'+_0x28ce09)[_0xbcbc('0x1c')](_0x42e123);}return null;};}function patchUpdates(_0x3fb0b2){return function(_0x28089e){try{jsonpatch[_0xbcbc('0x23')](_0x28089e,_0x3fb0b2,!![]);}catch(_0xcfe843){return BPromise['reject'](_0xcfe843);}return _0x28089e['save']();};}function saveUpdates(_0x5ddc03,_0x913ddc){return function(_0xd6c923){if(_0xd6c923){return _0xd6c923['update'](_0x5ddc03)['then'](function(_0x309103){return _0x309103;});}return null;};}function removeEntity(_0x3c45ab,_0x31725f){return function(_0x487058){if(_0x487058){return _0x487058[_0xbcbc('0x24')]()[_0xbcbc('0x25')](function(){_0x3c45ab['status'](0xcc)[_0xbcbc('0x1b')]();});}};}function handleEntityNotFound(_0x220046,_0x3745a4){return function(_0x54f162){if(!_0x54f162){_0x220046[_0xbcbc('0x19')](0x194);}return _0x54f162;};}function handleError(_0x2c499e,_0x2dad96){_0x2dad96=_0x2dad96||0x1f4;return function(_0x218834){logger['error'](_0x218834[_0xbcbc('0x26')]);if(_0x218834[_0xbcbc('0x27')]){delete _0x218834[_0xbcbc('0x27')];}_0x2c499e[_0xbcbc('0x1a')](_0x2dad96)['send'](_0x218834);};}exports[_0xbcbc('0x28')]=function(_0x41acdb,_0x251f38){var _0x4a8335={},_0x12a537={},_0x141dcb={'count':0x0,'rows':[]};var _0x5a7d9e=_[_0xbcbc('0x29')](db[_0xbcbc('0x2a')][_0xbcbc('0x2b')],function(_0x5b6a53){return{'name':_0x5b6a53['fieldName'],'type':_0x5b6a53[_0xbcbc('0x2c')]['key']};});_0x12a537['model']=_[_0xbcbc('0x29')](_0x5a7d9e,'name');_0x12a537[_0xbcbc('0x2d')]=_[_0xbcbc('0x2e')](_0x41acdb[_0xbcbc('0x2d')]);_0x12a537[_0xbcbc('0x2f')]=_[_0xbcbc('0x30')](_0x12a537[_0xbcbc('0x31')],_0x12a537[_0xbcbc('0x2d')]);_0x4a8335['attributes']=_['intersection'](_0x12a537[_0xbcbc('0x31')],qs[_0xbcbc('0x32')](_0x41acdb[_0xbcbc('0x2d')][_0xbcbc('0x32')]));_0x4a8335['attributes']=_0x4a8335[_0xbcbc('0x33')][_0xbcbc('0x34')]?_0x4a8335['attributes']:_0x12a537['model'];if(!_0x41acdb[_0xbcbc('0x2d')][_0xbcbc('0x35')](_0xbcbc('0x36'))){_0x4a8335[_0xbcbc('0x1e')]=qs[_0xbcbc('0x1e')](_0x41acdb[_0xbcbc('0x2d')]['limit']);_0x4a8335['offset']=qs[_0xbcbc('0x1d')](_0x41acdb[_0xbcbc('0x2d')]['offset']);}_0x4a8335[_0xbcbc('0x37')]=qs['sort'](_0x41acdb[_0xbcbc('0x2d')][_0xbcbc('0x38')]);_0x4a8335['where']=qs[_0xbcbc('0x2f')](_[_0xbcbc('0x39')](_0x41acdb[_0xbcbc('0x2d')],_0x12a537[_0xbcbc('0x2f')]),_0x5a7d9e);if(_0x41acdb[_0xbcbc('0x2d')][_0xbcbc('0x3a')]){_0x4a8335[_0xbcbc('0x3b')]=_[_0xbcbc('0x3c')](_0x4a8335['where'],{'$or':_[_0xbcbc('0x29')](_0x5a7d9e,function(_0x35c21d){if(_0x35c21d['type']!==_0xbcbc('0x3d')){var _0x339215={};_0x339215[_0x35c21d[_0xbcbc('0x27')]]={'$like':'%'+_0x41acdb[_0xbcbc('0x2d')]['filter']+'%'};return _0x339215;}})});}_0x4a8335=_[_0xbcbc('0x3c')]({},_0x4a8335,_0x41acdb[_0xbcbc('0x3e')]);var _0x4aa73a={'where':_0x4a8335['where']};return db['Dynamics365Configuration'][_0xbcbc('0x20')](_0x4aa73a)[_0xbcbc('0x25')](function(_0x3e1c57){_0x141dcb[_0xbcbc('0x20')]=_0x3e1c57;if(_0x41acdb[_0xbcbc('0x2d')][_0xbcbc('0x3f')]){_0x4a8335[_0xbcbc('0x40')]=[{'all':!![]}];}return db[_0xbcbc('0x2a')][_0xbcbc('0x41')](_0x4a8335);})['then'](function(_0x5e87a8){_0x141dcb[_0xbcbc('0x42')]=_0x5e87a8;return _0x141dcb;})[_0xbcbc('0x25')](respondWithFilteredResult(_0x251f38,_0x4a8335))[_0xbcbc('0x43')](handleError(_0x251f38,null));};exports[_0xbcbc('0x44')]=function(_0x578a3b,_0x335e3f){var _0x31e9b0={'raw':![],'where':{'id':_0x578a3b[_0xbcbc('0x45')]['id']}},_0x402198={};_0x402198['model']=_[_0xbcbc('0x2e')](db[_0xbcbc('0x2a')][_0xbcbc('0x2b')]);_0x402198[_0xbcbc('0x2d')]=_[_0xbcbc('0x2e')](_0x578a3b[_0xbcbc('0x2d')]);_0x402198[_0xbcbc('0x2f')]=_['intersection'](_0x402198[_0xbcbc('0x31')],_0x402198['query']);_0x31e9b0[_0xbcbc('0x33')]=_[_0xbcbc('0x30')](_0x402198[_0xbcbc('0x31')],qs[_0xbcbc('0x32')](_0x578a3b[_0xbcbc('0x2d')][_0xbcbc('0x32')]));_0x31e9b0[_0xbcbc('0x33')]=_0x31e9b0[_0xbcbc('0x33')][_0xbcbc('0x34')]?_0x31e9b0[_0xbcbc('0x33')]:_0x402198['model'];if(_0x578a3b[_0xbcbc('0x2d')][_0xbcbc('0x3f')]){_0x31e9b0[_0xbcbc('0x40')]=[{'all':!![]}];}_0x31e9b0=_[_0xbcbc('0x3c')]({},_0x31e9b0,_0x578a3b['options']);return db[_0xbcbc('0x2a')][_0xbcbc('0x46')](_0x31e9b0)['then'](handleEntityNotFound(_0x335e3f,null))['then'](respondWithResult(_0x335e3f,null))[_0xbcbc('0x43')](handleError(_0x335e3f,null));};exports['create']=function(_0x2ed45f,_0x21df2e){return db[_0xbcbc('0x2a')][_0xbcbc('0x47')](_0x2ed45f[_0xbcbc('0x48')],{})[_0xbcbc('0x25')](respondWithResult(_0x21df2e,0xc9))[_0xbcbc('0x43')](handleError(_0x21df2e,null));};exports[_0xbcbc('0x49')]=function(_0x1e9468,_0x273529){if(_0x1e9468[_0xbcbc('0x48')]['id']){delete _0x1e9468[_0xbcbc('0x48')]['id'];}return db[_0xbcbc('0x2a')]['find']({'where':{'id':_0x1e9468['params']['id']}})[_0xbcbc('0x25')](handleEntityNotFound(_0x273529,null))[_0xbcbc('0x25')](saveUpdates(_0x1e9468[_0xbcbc('0x48')],null))[_0xbcbc('0x25')](respondWithResult(_0x273529,null))[_0xbcbc('0x43')](handleError(_0x273529,null));};exports[_0xbcbc('0x24')]=function(_0x4be12c,_0x14411e){return db['Dynamics365Configuration'][_0xbcbc('0x46')]({'where':{'id':_0x4be12c[_0xbcbc('0x45')]['id']}})[_0xbcbc('0x25')](handleEntityNotFound(_0x14411e,null))['then'](removeEntity(_0x14411e,null))[_0xbcbc('0x43')](handleError(_0x14411e,null));};exports['getFields']=function(_0x105dd9,_0xcc9dad,_0x435d9f){var _0x4765eb={};var _0x2fd2ed={};var _0x235205;var _0x12ac26;return db['Dynamics365Configuration'][_0xbcbc('0x4a')]({'where':{'id':_0x105dd9[_0xbcbc('0x45')]['id']}})[_0xbcbc('0x25')](handleEntityNotFound(_0xcc9dad,null))[_0xbcbc('0x25')](function(_0x517440){if(_0x517440){_0x235205=_0x517440;_0x2fd2ed['model']=_[_0xbcbc('0x2e')](db[_0xbcbc('0x4b')]['rawAttributes']);_0x2fd2ed['query']=_[_0xbcbc('0x2e')](_0x105dd9['query']);_0x2fd2ed[_0xbcbc('0x2f')]=_[_0xbcbc('0x30')](_0x2fd2ed[_0xbcbc('0x31')],_0x2fd2ed[_0xbcbc('0x2d')]);_0x4765eb[_0xbcbc('0x33')]=_['intersection'](_0x2fd2ed['model'],qs['fields'](_0x105dd9[_0xbcbc('0x2d')][_0xbcbc('0x32')]));_0x4765eb[_0xbcbc('0x33')]=_0x4765eb[_0xbcbc('0x33')]['length']?_0x4765eb[_0xbcbc('0x33')]:_0x2fd2ed[_0xbcbc('0x31')];_0x4765eb[_0xbcbc('0x37')]=qs[_0xbcbc('0x38')](_0x105dd9[_0xbcbc('0x2d')][_0xbcbc('0x38')]);_0x4765eb[_0xbcbc('0x3b')]=qs[_0xbcbc('0x2f')](_[_0xbcbc('0x39')](_0x105dd9[_0xbcbc('0x2d')],_0x2fd2ed[_0xbcbc('0x2f')]));if(_0x105dd9[_0xbcbc('0x2d')]['filter']){_0x4765eb[_0xbcbc('0x3b')]=_['merge'](_0x4765eb['where'],{'$or':_[_0xbcbc('0x29')](_0x4765eb[_0xbcbc('0x33')],function(_0x15f968){var _0x41d775={};_0x41d775[_0x15f968]={'$like':'%'+_0x105dd9[_0xbcbc('0x2d')][_0xbcbc('0x3a')]+'%'};return _0x41d775;})});}_0x4765eb=_[_0xbcbc('0x3c')]({},_0x4765eb,_0x105dd9['options']);return _0x235205[_0xbcbc('0x4c')](_0x4765eb);}})['then'](function(_0x648c08){if(_0x648c08){_0x12ac26=_0x648c08[_0xbcbc('0x34')];if(!_0x105dd9[_0xbcbc('0x2d')][_0xbcbc('0x35')](_0xbcbc('0x36'))){_0x4765eb[_0xbcbc('0x1e')]=qs[_0xbcbc('0x1e')](_0x105dd9[_0xbcbc('0x2d')][_0xbcbc('0x1e')]);_0x4765eb[_0xbcbc('0x1d')]=qs[_0xbcbc('0x1d')](_0x105dd9[_0xbcbc('0x2d')][_0xbcbc('0x1d')]);}return _0x235205['getFields'](_0x4765eb);}})[_0xbcbc('0x25')](function(_0x16122b){if(_0x16122b){return _0x16122b?{'count':_0x12ac26,'rows':_0x16122b}:null;}})['then'](respondWithResult(_0xcc9dad,null))['catch'](handleError(_0xcc9dad,null));};exports[_0xbcbc('0x4d')]=function(_0x101b5a,_0x4b290a,_0x2940ee){var _0xbcf8da={};var _0xc625fb={};var _0x5133a2;var _0x14cd24;return db[_0xbcbc('0x2a')][_0xbcbc('0x4a')]({'where':{'id':_0x101b5a['params']['id']}})[_0xbcbc('0x25')](handleEntityNotFound(_0x4b290a,null))[_0xbcbc('0x25')](function(_0x3b494f){if(_0x3b494f){_0x5133a2=_0x3b494f;_0xc625fb[_0xbcbc('0x31')]=_[_0xbcbc('0x2e')](db[_0xbcbc('0x4b')][_0xbcbc('0x2b')]);_0xc625fb[_0xbcbc('0x2d')]=_[_0xbcbc('0x2e')](_0x101b5a[_0xbcbc('0x2d')]);_0xc625fb['filters']=_[_0xbcbc('0x30')](_0xc625fb[_0xbcbc('0x31')],_0xc625fb['query']);_0xbcf8da['attributes']=_['intersection'](_0xc625fb[_0xbcbc('0x31')],qs[_0xbcbc('0x32')](_0x101b5a['query']['fields']));_0xbcf8da['attributes']=_0xbcf8da[_0xbcbc('0x33')][_0xbcbc('0x34')]?_0xbcf8da[_0xbcbc('0x33')]:_0xc625fb['model'];_0xbcf8da[_0xbcbc('0x37')]=qs[_0xbcbc('0x38')](_0x101b5a[_0xbcbc('0x2d')][_0xbcbc('0x38')]);_0xbcf8da[_0xbcbc('0x3b')]=qs['filters'](_[_0xbcbc('0x39')](_0x101b5a[_0xbcbc('0x2d')],_0xc625fb[_0xbcbc('0x2f')]));if(_0x101b5a['query'][_0xbcbc('0x3a')]){_0xbcf8da[_0xbcbc('0x3b')]=_['merge'](_0xbcf8da['where'],{'$or':_[_0xbcbc('0x29')](_0xbcf8da['attributes'],function(_0x3d3fd7){var _0x487b14={};_0x487b14[_0x3d3fd7]={'$like':'%'+_0x101b5a[_0xbcbc('0x2d')]['filter']+'%'};return _0x487b14;})});}_0xbcf8da=_[_0xbcbc('0x3c')]({},_0xbcf8da,_0x101b5a['options']);return _0x5133a2[_0xbcbc('0x4d')](_0xbcf8da);}})[_0xbcbc('0x25')](function(_0x3afff2){if(_0x3afff2){_0x14cd24=_0x3afff2['length'];if(!_0x101b5a[_0xbcbc('0x2d')][_0xbcbc('0x35')]('nolimit')){_0xbcf8da['limit']=qs[_0xbcbc('0x1e')](_0x101b5a[_0xbcbc('0x2d')][_0xbcbc('0x1e')]);_0xbcf8da['offset']=qs[_0xbcbc('0x1d')](_0x101b5a[_0xbcbc('0x2d')][_0xbcbc('0x1d')]);}return _0x5133a2['getSubjects'](_0xbcf8da);}})[_0xbcbc('0x25')](function(_0x37c3c5){if(_0x37c3c5){return _0x37c3c5?{'count':_0x14cd24,'rows':_0x37c3c5}:null;}})[_0xbcbc('0x25')](respondWithResult(_0x4b290a,null))[_0xbcbc('0x43')](handleError(_0x4b290a,null));};exports[_0xbcbc('0x4e')]=function(_0x1c25bd,_0x544a8c,_0xb62e1e){var _0x33f1f4={};var _0x45254c={};var _0x1b4675;var _0x34ad0e;return db[_0xbcbc('0x2a')]['findOne']({'where':{'id':_0x1c25bd[_0xbcbc('0x45')]['id']}})[_0xbcbc('0x25')](handleEntityNotFound(_0x544a8c,null))[_0xbcbc('0x25')](function(_0x2b0946){if(_0x2b0946){_0x1b4675=_0x2b0946;_0x45254c[_0xbcbc('0x31')]=_['keys'](db['Dynamics365Field'][_0xbcbc('0x2b')]);_0x45254c[_0xbcbc('0x2d')]=_['keys'](_0x1c25bd['query']);_0x45254c['filters']=_['intersection'](_0x45254c[_0xbcbc('0x31')],_0x45254c[_0xbcbc('0x2d')]);_0x33f1f4['attributes']=_[_0xbcbc('0x30')](_0x45254c[_0xbcbc('0x31')],qs[_0xbcbc('0x32')](_0x1c25bd['query'][_0xbcbc('0x32')]));_0x33f1f4[_0xbcbc('0x33')]=_0x33f1f4[_0xbcbc('0x33')][_0xbcbc('0x34')]?_0x33f1f4['attributes']:_0x45254c[_0xbcbc('0x31')];_0x33f1f4['order']=qs[_0xbcbc('0x38')](_0x1c25bd[_0xbcbc('0x2d')][_0xbcbc('0x38')]);_0x33f1f4[_0xbcbc('0x3b')]=qs['filters'](_[_0xbcbc('0x39')](_0x1c25bd[_0xbcbc('0x2d')],_0x45254c['filters']));if(_0x1c25bd[_0xbcbc('0x2d')][_0xbcbc('0x3a')]){_0x33f1f4['where']=_[_0xbcbc('0x3c')](_0x33f1f4[_0xbcbc('0x3b')],{'$or':_['map'](_0x33f1f4[_0xbcbc('0x33')],function(_0x3c5ea6){var _0x581c04={};_0x581c04[_0x3c5ea6]={'$like':'%'+_0x1c25bd[_0xbcbc('0x2d')]['filter']+'%'};return _0x581c04;})});}_0x33f1f4=_[_0xbcbc('0x3c')]({},_0x33f1f4,_0x1c25bd[_0xbcbc('0x3e')]);return _0x1b4675[_0xbcbc('0x4e')](_0x33f1f4);}})['then'](function(_0x554441){if(_0x554441){_0x34ad0e=_0x554441[_0xbcbc('0x34')];if(!_0x1c25bd[_0xbcbc('0x2d')][_0xbcbc('0x35')](_0xbcbc('0x36'))){_0x33f1f4['limit']=qs[_0xbcbc('0x1e')](_0x1c25bd['query'][_0xbcbc('0x1e')]);_0x33f1f4[_0xbcbc('0x1d')]=qs[_0xbcbc('0x1d')](_0x1c25bd[_0xbcbc('0x2d')][_0xbcbc('0x1d')]);}return _0x1b4675[_0xbcbc('0x4e')](_0x33f1f4);}})[_0xbcbc('0x25')](function(_0x205bdb){if(_0x205bdb){return _0x205bdb?{'count':_0x34ad0e,'rows':_0x205bdb}:null;}})[_0xbcbc('0x25')](respondWithResult(_0x544a8c,null))['catch'](handleError(_0x544a8c,null));}; \ No newline at end of file +var _0x3e38=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','limit','order','where','filters','filter','merge','type','VIRTUAL','options','Dynamics365Configuration','includeAll','include','rows','show','find','catch','create','body','params','findOne','sort','pick','getFields','getSubjects','Dynamics365Field','nolimit','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x352bbe,_0x385eca){var _0x1d35f3=function(_0x35b385){while(--_0x35b385){_0x352bbe['push'](_0x352bbe['shift']());}};_0x1d35f3(++_0x385eca);}(_0x3e38,0x186));var _0x83e3=function(_0x37d12e,_0x47ae9b){_0x37d12e=_0x37d12e-0x0;var _0x5bbce3=_0x3e38[_0x37d12e];return _0x5bbce3;};'use strict';var emlformat=require(_0x83e3('0x0'));var rimraf=require(_0x83e3('0x1'));var zipdir=require(_0x83e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83e3('0x3'));var moment=require('moment');var BPromise=require(_0x83e3('0x4'));var Mustache=require(_0x83e3('0x5'));var util=require(_0x83e3('0x6'));var path=require(_0x83e3('0x7'));var sox=require('sox');var csv=require(_0x83e3('0x8'));var ejs=require(_0x83e3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x83e3('0xa'));var crypto=require(_0x83e3('0xb'));var jsforce=require(_0x83e3('0xc'));var deskjs=require(_0x83e3('0xd'));var toCsv=require(_0x83e3('0x8'));var querystring=require(_0x83e3('0xe'));var Papa=require('papaparse');var Redis=require(_0x83e3('0xf'));var authService=require(_0x83e3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x83e3('0x11'));var hardwareService=require(_0x83e3('0x12'));var logger=require(_0x83e3('0x13'))(_0x83e3('0x14'));var utils=require(_0x83e3('0x15'));var config=require(_0x83e3('0x16'));var licenseUtil=require(_0x83e3('0x17'));var db=require(_0x83e3('0x18'))['db'];function respondWithStatusCode(_0x4c783d,_0xd24620){_0xd24620=_0xd24620||0xcc;return function(_0x13a8b7){if(_0x13a8b7){return _0x4c783d[_0x83e3('0x19')](_0xd24620);}return _0x4c783d[_0x83e3('0x1a')](_0xd24620)[_0x83e3('0x1b')]();};}function respondWithResult(_0x7cb056,_0x1cd002){_0x1cd002=_0x1cd002||0xc8;return function(_0x4ce621){if(_0x4ce621){return _0x7cb056[_0x83e3('0x1a')](_0x1cd002)[_0x83e3('0x1c')](_0x4ce621);}};}function respondWithFilteredResult(_0x2c136d,_0x42e50a){return function(_0x27583b){if(_0x27583b){var _0x14bd4d=typeof _0x42e50a[_0x83e3('0x1d')]===_0x83e3('0x1e')&&typeof _0x42e50a['limit']===_0x83e3('0x1e');var _0x39a5d7=_0x27583b[_0x83e3('0x1f')];var _0x1bf3f4=_0x14bd4d?0x0:_0x42e50a[_0x83e3('0x1d')];var _0x38de14=_0x14bd4d?_0x27583b[_0x83e3('0x1f')]:_0x42e50a[_0x83e3('0x1d')]+_0x42e50a['limit'];var _0x1677cc;if(_0x38de14>=_0x39a5d7){_0x38de14=_0x39a5d7;_0x1677cc=0xc8;}else{_0x1677cc=0xce;}_0x2c136d[_0x83e3('0x1a')](_0x1677cc);return _0x2c136d[_0x83e3('0x20')](_0x83e3('0x21'),_0x1bf3f4+'-'+_0x38de14+'/'+_0x39a5d7)['json'](_0x27583b);}return null;};}function patchUpdates(_0x110337){return function(_0x559201){try{jsonpatch[_0x83e3('0x22')](_0x559201,_0x110337,!![]);}catch(_0x23d07a){return BPromise[_0x83e3('0x23')](_0x23d07a);}return _0x559201[_0x83e3('0x24')]();};}function saveUpdates(_0x4e30de,_0x7c4204){return function(_0x20942f){if(_0x20942f){return _0x20942f[_0x83e3('0x25')](_0x4e30de)[_0x83e3('0x26')](function(_0x4766c3){return _0x4766c3;});}return null;};}function removeEntity(_0x53c440,_0x212e26){return function(_0x515bd7){if(_0x515bd7){return _0x515bd7[_0x83e3('0x27')]()[_0x83e3('0x26')](function(){_0x53c440[_0x83e3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4a92e,_0x10dd98){return function(_0x238fbe){if(!_0x238fbe){_0xf4a92e[_0x83e3('0x19')](0x194);}return _0x238fbe;};}function handleError(_0x225411,_0x961de1){_0x961de1=_0x961de1||0x1f4;return function(_0x5c8c14){logger[_0x83e3('0x28')](_0x5c8c14[_0x83e3('0x29')]);if(_0x5c8c14['name']){delete _0x5c8c14[_0x83e3('0x2a')];}_0x225411[_0x83e3('0x1a')](_0x961de1)[_0x83e3('0x2b')](_0x5c8c14);};}exports[_0x83e3('0x2c')]=function(_0x89eabb,_0x561022){var _0x3c7dc2={},_0x8e8b44={},_0x4f29f9={'count':0x0,'rows':[]};var _0x2334ec=_[_0x83e3('0x2d')](db['Dynamics365Configuration'][_0x83e3('0x2e')],function(_0x558044){return{'name':_0x558044[_0x83e3('0x2f')],'type':_0x558044['type'][_0x83e3('0x30')]};});_0x8e8b44[_0x83e3('0x31')]=_['map'](_0x2334ec,_0x83e3('0x2a'));_0x8e8b44[_0x83e3('0x32')]=_[_0x83e3('0x33')](_0x89eabb[_0x83e3('0x32')]);_0x8e8b44['filters']=_[_0x83e3('0x34')](_0x8e8b44[_0x83e3('0x31')],_0x8e8b44[_0x83e3('0x32')]);_0x3c7dc2['attributes']=_['intersection'](_0x8e8b44[_0x83e3('0x31')],qs[_0x83e3('0x35')](_0x89eabb[_0x83e3('0x32')]['fields']));_0x3c7dc2['attributes']=_0x3c7dc2['attributes'][_0x83e3('0x36')]?_0x3c7dc2[_0x83e3('0x37')]:_0x8e8b44['model'];if(!_0x89eabb[_0x83e3('0x32')][_0x83e3('0x38')]('nolimit')){_0x3c7dc2[_0x83e3('0x39')]=qs[_0x83e3('0x39')](_0x89eabb[_0x83e3('0x32')][_0x83e3('0x39')]);_0x3c7dc2[_0x83e3('0x1d')]=qs['offset'](_0x89eabb[_0x83e3('0x32')][_0x83e3('0x1d')]);}_0x3c7dc2[_0x83e3('0x3a')]=qs['sort'](_0x89eabb['query']['sort']);_0x3c7dc2[_0x83e3('0x3b')]=qs['filters'](_['pick'](_0x89eabb['query'],_0x8e8b44[_0x83e3('0x3c')]),_0x2334ec);if(_0x89eabb[_0x83e3('0x32')][_0x83e3('0x3d')]){_0x3c7dc2['where']=_[_0x83e3('0x3e')](_0x3c7dc2[_0x83e3('0x3b')],{'$or':_[_0x83e3('0x2d')](_0x2334ec,function(_0x5549df){if(_0x5549df[_0x83e3('0x3f')]!==_0x83e3('0x40')){var _0xa283ac={};_0xa283ac[_0x5549df[_0x83e3('0x2a')]]={'$like':'%'+_0x89eabb[_0x83e3('0x32')][_0x83e3('0x3d')]+'%'};return _0xa283ac;}})});}_0x3c7dc2=_[_0x83e3('0x3e')]({},_0x3c7dc2,_0x89eabb[_0x83e3('0x41')]);var _0x42e69a={'where':_0x3c7dc2['where']};return db[_0x83e3('0x42')][_0x83e3('0x1f')](_0x42e69a)['then'](function(_0x4729d5){_0x4f29f9['count']=_0x4729d5;if(_0x89eabb[_0x83e3('0x32')][_0x83e3('0x43')]){_0x3c7dc2[_0x83e3('0x44')]=[{'all':!![]}];}return db[_0x83e3('0x42')]['findAll'](_0x3c7dc2);})['then'](function(_0x4a8aaa){_0x4f29f9[_0x83e3('0x45')]=_0x4a8aaa;return _0x4f29f9;})[_0x83e3('0x26')](respondWithFilteredResult(_0x561022,_0x3c7dc2))['catch'](handleError(_0x561022,null));};exports[_0x83e3('0x46')]=function(_0x2c35c4,_0xb47454){var _0x4fa9c6={'raw':![],'where':{'id':_0x2c35c4['params']['id']}},_0x1abd7c={};_0x1abd7c['model']=_[_0x83e3('0x33')](db[_0x83e3('0x42')][_0x83e3('0x2e')]);_0x1abd7c[_0x83e3('0x32')]=_[_0x83e3('0x33')](_0x2c35c4['query']);_0x1abd7c['filters']=_[_0x83e3('0x34')](_0x1abd7c[_0x83e3('0x31')],_0x1abd7c[_0x83e3('0x32')]);_0x4fa9c6[_0x83e3('0x37')]=_[_0x83e3('0x34')](_0x1abd7c[_0x83e3('0x31')],qs[_0x83e3('0x35')](_0x2c35c4['query'][_0x83e3('0x35')]));_0x4fa9c6[_0x83e3('0x37')]=_0x4fa9c6[_0x83e3('0x37')][_0x83e3('0x36')]?_0x4fa9c6[_0x83e3('0x37')]:_0x1abd7c[_0x83e3('0x31')];if(_0x2c35c4[_0x83e3('0x32')][_0x83e3('0x43')]){_0x4fa9c6[_0x83e3('0x44')]=[{'all':!![]}];}_0x4fa9c6=_['merge']({},_0x4fa9c6,_0x2c35c4[_0x83e3('0x41')]);return db[_0x83e3('0x42')][_0x83e3('0x47')](_0x4fa9c6)[_0x83e3('0x26')](handleEntityNotFound(_0xb47454,null))['then'](respondWithResult(_0xb47454,null))[_0x83e3('0x48')](handleError(_0xb47454,null));};exports[_0x83e3('0x49')]=function(_0x3d2447,_0x25217d){return db[_0x83e3('0x42')][_0x83e3('0x49')](_0x3d2447[_0x83e3('0x4a')],{})[_0x83e3('0x26')](respondWithResult(_0x25217d,0xc9))['catch'](handleError(_0x25217d,null));};exports[_0x83e3('0x25')]=function(_0x1ec9b3,_0xe7132e){if(_0x1ec9b3[_0x83e3('0x4a')]['id']){delete _0x1ec9b3[_0x83e3('0x4a')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x1ec9b3[_0x83e3('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe7132e,null))['then'](saveUpdates(_0x1ec9b3[_0x83e3('0x4a')],null))[_0x83e3('0x26')](respondWithResult(_0xe7132e,null))['catch'](handleError(_0xe7132e,null));};exports[_0x83e3('0x27')]=function(_0x200531,_0x4dc132){return db['Dynamics365Configuration'][_0x83e3('0x47')]({'where':{'id':_0x200531[_0x83e3('0x4b')]['id']}})[_0x83e3('0x26')](handleEntityNotFound(_0x4dc132,null))['then'](removeEntity(_0x4dc132,null))[_0x83e3('0x48')](handleError(_0x4dc132,null));};exports['getFields']=function(_0x7f94f2,_0x5aba02,_0x465b9a){var _0xc4f51d={};var _0x1f18dd={};var _0x5ae641;var _0x4a35b0;return db[_0x83e3('0x42')][_0x83e3('0x4c')]({'where':{'id':_0x7f94f2['params']['id']}})[_0x83e3('0x26')](handleEntityNotFound(_0x5aba02,null))['then'](function(_0x154170){if(_0x154170){_0x5ae641=_0x154170;_0x1f18dd[_0x83e3('0x31')]=_[_0x83e3('0x33')](db['Dynamics365Field']['rawAttributes']);_0x1f18dd[_0x83e3('0x32')]=_[_0x83e3('0x33')](_0x7f94f2['query']);_0x1f18dd['filters']=_[_0x83e3('0x34')](_0x1f18dd[_0x83e3('0x31')],_0x1f18dd[_0x83e3('0x32')]);_0xc4f51d['attributes']=_['intersection'](_0x1f18dd[_0x83e3('0x31')],qs[_0x83e3('0x35')](_0x7f94f2[_0x83e3('0x32')][_0x83e3('0x35')]));_0xc4f51d[_0x83e3('0x37')]=_0xc4f51d[_0x83e3('0x37')]['length']?_0xc4f51d[_0x83e3('0x37')]:_0x1f18dd[_0x83e3('0x31')];_0xc4f51d[_0x83e3('0x3a')]=qs[_0x83e3('0x4d')](_0x7f94f2[_0x83e3('0x32')][_0x83e3('0x4d')]);_0xc4f51d[_0x83e3('0x3b')]=qs[_0x83e3('0x3c')](_[_0x83e3('0x4e')](_0x7f94f2['query'],_0x1f18dd[_0x83e3('0x3c')]));if(_0x7f94f2[_0x83e3('0x32')][_0x83e3('0x3d')]){_0xc4f51d[_0x83e3('0x3b')]=_[_0x83e3('0x3e')](_0xc4f51d['where'],{'$or':_[_0x83e3('0x2d')](_0xc4f51d[_0x83e3('0x37')],function(_0x59b049){var _0x5d2876={};_0x5d2876[_0x59b049]={'$like':'%'+_0x7f94f2[_0x83e3('0x32')][_0x83e3('0x3d')]+'%'};return _0x5d2876;})});}_0xc4f51d=_[_0x83e3('0x3e')]({},_0xc4f51d,_0x7f94f2[_0x83e3('0x41')]);return _0x5ae641[_0x83e3('0x4f')](_0xc4f51d);}})[_0x83e3('0x26')](function(_0x415023){if(_0x415023){_0x4a35b0=_0x415023[_0x83e3('0x36')];if(!_0x7f94f2['query']['hasOwnProperty']('nolimit')){_0xc4f51d['limit']=qs['limit'](_0x7f94f2[_0x83e3('0x32')][_0x83e3('0x39')]);_0xc4f51d['offset']=qs[_0x83e3('0x1d')](_0x7f94f2[_0x83e3('0x32')][_0x83e3('0x1d')]);}return _0x5ae641[_0x83e3('0x4f')](_0xc4f51d);}})[_0x83e3('0x26')](function(_0x10a52d){if(_0x10a52d){return _0x10a52d?{'count':_0x4a35b0,'rows':_0x10a52d}:null;}})[_0x83e3('0x26')](respondWithResult(_0x5aba02,null))[_0x83e3('0x48')](handleError(_0x5aba02,null));};exports[_0x83e3('0x50')]=function(_0x44e21a,_0x23ce51,_0x1a3bb7){var _0x13aa3a={};var _0x330d3d={};var _0xa855d5;var _0x514717;return db[_0x83e3('0x42')][_0x83e3('0x4c')]({'where':{'id':_0x44e21a[_0x83e3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x23ce51,null))[_0x83e3('0x26')](function(_0x4471fd){if(_0x4471fd){_0xa855d5=_0x4471fd;_0x330d3d[_0x83e3('0x31')]=_[_0x83e3('0x33')](db[_0x83e3('0x51')][_0x83e3('0x2e')]);_0x330d3d['query']=_[_0x83e3('0x33')](_0x44e21a[_0x83e3('0x32')]);_0x330d3d['filters']=_[_0x83e3('0x34')](_0x330d3d[_0x83e3('0x31')],_0x330d3d[_0x83e3('0x32')]);_0x13aa3a['attributes']=_[_0x83e3('0x34')](_0x330d3d[_0x83e3('0x31')],qs[_0x83e3('0x35')](_0x44e21a[_0x83e3('0x32')][_0x83e3('0x35')]));_0x13aa3a[_0x83e3('0x37')]=_0x13aa3a[_0x83e3('0x37')][_0x83e3('0x36')]?_0x13aa3a[_0x83e3('0x37')]:_0x330d3d[_0x83e3('0x31')];_0x13aa3a[_0x83e3('0x3a')]=qs[_0x83e3('0x4d')](_0x44e21a[_0x83e3('0x32')][_0x83e3('0x4d')]);_0x13aa3a[_0x83e3('0x3b')]=qs[_0x83e3('0x3c')](_['pick'](_0x44e21a[_0x83e3('0x32')],_0x330d3d[_0x83e3('0x3c')]));if(_0x44e21a[_0x83e3('0x32')][_0x83e3('0x3d')]){_0x13aa3a[_0x83e3('0x3b')]=_[_0x83e3('0x3e')](_0x13aa3a[_0x83e3('0x3b')],{'$or':_['map'](_0x13aa3a['attributes'],function(_0x85fae9){var _0x3976ba={};_0x3976ba[_0x85fae9]={'$like':'%'+_0x44e21a[_0x83e3('0x32')][_0x83e3('0x3d')]+'%'};return _0x3976ba;})});}_0x13aa3a=_[_0x83e3('0x3e')]({},_0x13aa3a,_0x44e21a['options']);return _0xa855d5[_0x83e3('0x50')](_0x13aa3a);}})[_0x83e3('0x26')](function(_0x4f56b1){if(_0x4f56b1){_0x514717=_0x4f56b1[_0x83e3('0x36')];if(!_0x44e21a[_0x83e3('0x32')][_0x83e3('0x38')](_0x83e3('0x52'))){_0x13aa3a['limit']=qs[_0x83e3('0x39')](_0x44e21a['query'][_0x83e3('0x39')]);_0x13aa3a[_0x83e3('0x1d')]=qs[_0x83e3('0x1d')](_0x44e21a['query'][_0x83e3('0x1d')]);}return _0xa855d5[_0x83e3('0x50')](_0x13aa3a);}})[_0x83e3('0x26')](function(_0x5eda62){if(_0x5eda62){return _0x5eda62?{'count':_0x514717,'rows':_0x5eda62}:null;}})[_0x83e3('0x26')](respondWithResult(_0x23ce51,null))[_0x83e3('0x48')](handleError(_0x23ce51,null));};exports[_0x83e3('0x53')]=function(_0x211273,_0x561583,_0xbfcda2){var _0x182886={};var _0x1b3550={};var _0x46c9b8;var _0x757033;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x211273[_0x83e3('0x4b')]['id']}})[_0x83e3('0x26')](handleEntityNotFound(_0x561583,null))[_0x83e3('0x26')](function(_0x441d81){if(_0x441d81){_0x46c9b8=_0x441d81;_0x1b3550[_0x83e3('0x31')]=_[_0x83e3('0x33')](db[_0x83e3('0x51')][_0x83e3('0x2e')]);_0x1b3550['query']=_[_0x83e3('0x33')](_0x211273[_0x83e3('0x32')]);_0x1b3550[_0x83e3('0x3c')]=_[_0x83e3('0x34')](_0x1b3550[_0x83e3('0x31')],_0x1b3550['query']);_0x182886[_0x83e3('0x37')]=_[_0x83e3('0x34')](_0x1b3550[_0x83e3('0x31')],qs[_0x83e3('0x35')](_0x211273[_0x83e3('0x32')][_0x83e3('0x35')]));_0x182886[_0x83e3('0x37')]=_0x182886['attributes'][_0x83e3('0x36')]?_0x182886[_0x83e3('0x37')]:_0x1b3550['model'];_0x182886[_0x83e3('0x3a')]=qs[_0x83e3('0x4d')](_0x211273[_0x83e3('0x32')]['sort']);_0x182886['where']=qs[_0x83e3('0x3c')](_['pick'](_0x211273['query'],_0x1b3550[_0x83e3('0x3c')]));if(_0x211273[_0x83e3('0x32')][_0x83e3('0x3d')]){_0x182886[_0x83e3('0x3b')]=_[_0x83e3('0x3e')](_0x182886['where'],{'$or':_['map'](_0x182886[_0x83e3('0x37')],function(_0x41a9ea){var _0x475a38={};_0x475a38[_0x41a9ea]={'$like':'%'+_0x211273[_0x83e3('0x32')][_0x83e3('0x3d')]+'%'};return _0x475a38;})});}_0x182886=_[_0x83e3('0x3e')]({},_0x182886,_0x211273[_0x83e3('0x41')]);return _0x46c9b8[_0x83e3('0x53')](_0x182886);}})[_0x83e3('0x26')](function(_0x15d993){if(_0x15d993){_0x757033=_0x15d993[_0x83e3('0x36')];if(!_0x211273[_0x83e3('0x32')]['hasOwnProperty']('nolimit')){_0x182886['limit']=qs['limit'](_0x211273[_0x83e3('0x32')]['limit']);_0x182886[_0x83e3('0x1d')]=qs[_0x83e3('0x1d')](_0x211273[_0x83e3('0x32')]['offset']);}return _0x46c9b8['getDescriptions'](_0x182886);}})[_0x83e3('0x26')](function(_0x23ee00){if(_0x23ee00){return _0x23ee00?{'count':_0x757033,'rows':_0x23ee00}:null;}})['then'](respondWithResult(_0x561583,null))[_0x83e3('0x48')](handleError(_0x561583,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 702ff17..24f749a 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 _0x9c44=['request-promise','path','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','../../config/logger','api','moment','bluebird'];(function(_0x1f7d7b,_0x198611){var _0x4778c6=function(_0x1f3a95){while(--_0x1f3a95){_0x1f7d7b['push'](_0x1f7d7b['shift']());}};_0x4778c6(++_0x198611);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x566f24,_0x151a33){var _0x19b78d=function(_0x25bbb6){while(--_0x25bbb6){_0x566f24['push'](_0x566f24['shift']());}};_0x19b78d(++_0x151a33);}(_0x00bb,0x1d8));var _0xb00b=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x00bb[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'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 d7fb072..ca268b7 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 _0xd648=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x191dbb,_0x384952){var _0x214209=function(_0x4d5bf8){while(--_0x4d5bf8){_0x191dbb['push'](_0x191dbb['shift']());}};_0x214209(++_0x384952);}(_0xd648,0x175));var _0x8d64=function(_0x119119,_0x3d9525){_0x119119=_0x119119-0x0;var _0x4e8c54=_0xd648[_0x119119];return _0x4e8c54;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8d64('0x0'));var BPromise=require(_0x8d64('0x1'));var rs=require(_0x8d64('0x2'));var fs=require('fs');var Redis=require(_0x8d64('0x3'));var db=require(_0x8d64('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8d64('0x5'));var config=require(_0x8d64('0x6'));var jayson=require(_0x8d64('0x7'));var client=jayson[_0x8d64('0x8')][_0x8d64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39b9d4,_0x41cff9,_0x32f14b){return new BPromise(function(_0x4cf9a7,_0x39b314){return client[_0x8d64('0xa')](_0x39b9d4,_0x32f14b)[_0x8d64('0xb')](function(_0x1d6139){logger[_0x8d64('0xc')](_0x8d64('0xd'),_0x41cff9,_0x8d64('0xe'));logger[_0x8d64('0xf')](_0x8d64('0x10'),_0x41cff9,_0x8d64('0xe'),JSON['stringify'](_0x1d6139));if(_0x1d6139[_0x8d64('0x11')]){if(_0x1d6139[_0x8d64('0x11')][_0x8d64('0x12')]===0x1f4){logger['error'](_0x8d64('0xd'),_0x41cff9,_0x1d6139[_0x8d64('0x11')]['message']);return _0x39b314(_0x1d6139[_0x8d64('0x11')][_0x8d64('0x13')]);}logger[_0x8d64('0x11')](_0x8d64('0xd'),_0x41cff9,_0x1d6139[_0x8d64('0x11')][_0x8d64('0x13')]);return _0x4cf9a7(_0x1d6139[_0x8d64('0x11')][_0x8d64('0x13')]);}else{logger[_0x8d64('0xc')](_0x8d64('0xd'),_0x41cff9,_0x8d64('0xe'));_0x4cf9a7(_0x1d6139['result']['message']);}})[_0x8d64('0x14')](function(_0x2c238b){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x41cff9,_0x2c238b);_0x39b314(_0x2c238b);});});} \ No newline at end of file +var _0x1162=['../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','../../mysqldb','../../config/utils','rpc'];(function(_0x489443,_0x4aff14){var _0x3f0b2c=function(_0x3494e0){while(--_0x3494e0){_0x489443['push'](_0x489443['shift']());}};_0x3f0b2c(++_0x4aff14);}(_0x1162,0xd8));var _0x2116=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x1162[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x2116('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(_0x2116('0x1'))['db'];var utils=require(_0x2116('0x2'));var logger=require('../../config/logger')(_0x2116('0x3'));var config=require(_0x2116('0x4'));var jayson=require(_0x2116('0x5'));var client=jayson[_0x2116('0x6')][_0x2116('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d1055,_0x58709d,_0xafb152){return new BPromise(function(_0x413526,_0x12bbbe){return client[_0x2116('0x8')](_0x5d1055,_0xafb152)[_0x2116('0x9')](function(_0x196cbf){logger[_0x2116('0xa')](_0x2116('0xb'),_0x58709d,_0x2116('0xc'));logger[_0x2116('0xd')](_0x2116('0xe'),_0x58709d,_0x2116('0xc'),JSON[_0x2116('0xf')](_0x196cbf));if(_0x196cbf[_0x2116('0x10')]){if(_0x196cbf['error'][_0x2116('0x11')]===0x1f4){logger[_0x2116('0x10')](_0x2116('0xb'),_0x58709d,_0x196cbf[_0x2116('0x10')][_0x2116('0x12')]);return _0x12bbbe(_0x196cbf[_0x2116('0x10')][_0x2116('0x12')]);}logger['error'](_0x2116('0xb'),_0x58709d,_0x196cbf[_0x2116('0x10')][_0x2116('0x12')]);return _0x413526(_0x196cbf[_0x2116('0x10')][_0x2116('0x12')]);}else{logger[_0x2116('0xa')](_0x2116('0xb'),_0x58709d,'request\x20sent');_0x413526(_0x196cbf['result'][_0x2116('0x12')]);}})[_0x2116('0x13')](function(_0x30ed0b){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x58709d,_0x30ed0b);_0x12bbbe(_0x30ed0b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 38f5f55..cb389af 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 _0xe675=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','create','put','update','delete','multer','util','path'];(function(_0x2dccfb,_0x13bf41){var _0x4ff945=function(_0x3876a9){while(--_0x3876a9){_0x2dccfb['push'](_0x2dccfb['shift']());}};_0x4ff945(++_0x13bf41);}(_0xe675,0xb1));var _0x5e67=function(_0xcaeb26,_0x46a053){_0xcaeb26=_0xcaeb26-0x0;var _0x2795c6=_0xe675[_0xcaeb26];return _0x2795c6;};'use strict';var multer=require(_0x5e67('0x0'));var util=require(_0x5e67('0x1'));var path=require(_0x5e67('0x2'));var timeout=require(_0x5e67('0x3'));var express=require(_0x5e67('0x4'));var router=express[_0x5e67('0x5')]();var fs_extra=require(_0x5e67('0x6'));var auth=require(_0x5e67('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5e67('0x8'));var controller=require(_0x5e67('0x9'));router[_0x5e67('0xa')]('/',auth[_0x5e67('0xb')](),controller['index']);router['get'](_0x5e67('0xc'),auth[_0x5e67('0xb')](),controller[_0x5e67('0xd')]);router['post']('/',auth[_0x5e67('0xb')](),controller[_0x5e67('0xe')]);router[_0x5e67('0xf')](_0x5e67('0xc'),auth[_0x5e67('0xb')](),controller[_0x5e67('0x10')]);router[_0x5e67('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xff48=['./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','put','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0xff48,0x189));var _0x8ff4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xff48[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x8ff4('0x0'));var path=require(_0x8ff4('0x1'));var timeout=require(_0x8ff4('0x2'));var express=require(_0x8ff4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8ff4('0x4'));var interaction=require(_0x8ff4('0x5'));var config=require(_0x8ff4('0x6'));var controller=require(_0x8ff4('0x7'));router['get']('/',auth[_0x8ff4('0x8')](),controller[_0x8ff4('0x9')]);router[_0x8ff4('0xa')](_0x8ff4('0xb'),auth['isAuthenticated'](),controller[_0x8ff4('0xc')]);router['post']('/',auth[_0x8ff4('0x8')](),controller['create']);router[_0x8ff4('0xd')](_0x8ff4('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8ff4('0xe')](_0x8ff4('0xb'),auth[_0x8ff4('0x8')](),controller[_0x8ff4('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 101b289..e3202f9 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 _0xcba4=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcba4,0xe5));var _0x4cba=function(_0xc25577,_0x16d201){_0xc25577=_0xc25577-0x0;var _0x1a6990=_0xcba4[_0xc25577];return _0x1a6990;};'use strict';var Sequelize=require(_0x4cba('0x0'));module[_0x4cba('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4cba('0x2'),'variable',_0x4cba('0x3'),_0x4cba('0x4'),_0x4cba('0x5')),'defaultValue':_0x4cba('0x2')},'content':{'type':Sequelize[_0x4cba('0x6')]},'key':{'type':Sequelize[_0x4cba('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x4cba('0x3'))},'keyContent':{'type':Sequelize[_0x4cba('0x6')]},'idField':{'type':Sequelize[_0x4cba('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4cba('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4cba('0x6')]}}; \ No newline at end of file +var _0x97a9=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x97a9,0xf9));var _0x997a=function(_0x47bd0d,_0xbc523d){_0x47bd0d=_0x47bd0d-0x0;var _0x36cd89=_0x97a9[_0x47bd0d];return _0x36cd89;};'use strict';var Sequelize=require(_0x997a('0x0'));module[_0x997a('0x1')]={'type':{'type':Sequelize[_0x997a('0x2')]('string',_0x997a('0x3'),_0x997a('0x4'),_0x997a('0x5'),_0x997a('0x6')),'defaultValue':_0x997a('0x7')},'content':{'type':Sequelize[_0x997a('0x8')]},'key':{'type':Sequelize[_0x997a('0x8')]},'keyType':{'type':Sequelize[_0x997a('0x2')](_0x997a('0x7'),_0x997a('0x3'),_0x997a('0x4'))},'keyContent':{'type':Sequelize[_0x997a('0x8')]},'idField':{'type':Sequelize[_0x997a('0x8')]},'nameField':{'type':Sequelize[_0x997a('0x8')]},'customField':{'type':Sequelize[_0x997a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x997a('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index e1fbc97..30333eb 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 _0x7433=['desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','Dynamics365Field','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','rawAttributes','keys','catch','create','body','find','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x132765,_0x2663cd){var _0x2f3263=function(_0x28c713){while(--_0x28c713){_0x132765['push'](_0x132765['shift']());}};_0x2f3263(++_0x2663cd);}(_0x7433,0xfa));var _0x3743=function(_0x3944b3,_0xf05375){_0x3944b3=_0x3944b3-0x0;var _0xbf7a53=_0x7433[_0x3944b3];return _0xbf7a53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3743('0x0'));var zipdir=require(_0x3743('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3743('0x2'));var moment=require('moment');var BPromise=require(_0x3743('0x3'));var Mustache=require(_0x3743('0x4'));var util=require(_0x3743('0x5'));var path=require('path');var sox=require(_0x3743('0x6'));var csv=require(_0x3743('0x7'));var ejs=require(_0x3743('0x8'));var fs=require('fs');var fs_extra=require(_0x3743('0x9'));var _=require(_0x3743('0xa'));var squel=require(_0x3743('0xb'));var crypto=require(_0x3743('0xc'));var jsforce=require(_0x3743('0xd'));var deskjs=require(_0x3743('0xe'));var toCsv=require(_0x3743('0x7'));var querystring=require('querystring');var Papa=require(_0x3743('0xf'));var Redis=require(_0x3743('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3743('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3743('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3743('0x13'))['db'];function respondWithStatusCode(_0x314d76,_0x5498e8){_0x5498e8=_0x5498e8||0xcc;return function(_0x210ced){if(_0x210ced){return _0x314d76['sendStatus'](_0x5498e8);}return _0x314d76[_0x3743('0x14')](_0x5498e8)[_0x3743('0x15')]();};}function respondWithResult(_0x1383e0,_0x379f7a){_0x379f7a=_0x379f7a||0xc8;return function(_0x34396c){if(_0x34396c){return _0x1383e0['status'](_0x379f7a)[_0x3743('0x16')](_0x34396c);}};}function respondWithFilteredResult(_0x5ec748,_0x375949){return function(_0x4e8020){if(_0x4e8020){var _0x5593c7=typeof _0x375949[_0x3743('0x17')]===_0x3743('0x18')&&typeof _0x375949[_0x3743('0x19')]==='undefined';var _0x4b20aa=_0x4e8020[_0x3743('0x1a')];var _0x559091=_0x5593c7?0x0:_0x375949[_0x3743('0x17')];var _0x10fef3=_0x5593c7?_0x4e8020[_0x3743('0x1a')]:_0x375949[_0x3743('0x17')]+_0x375949[_0x3743('0x19')];var _0x2bcefa;if(_0x10fef3>=_0x4b20aa){_0x10fef3=_0x4b20aa;_0x2bcefa=0xc8;}else{_0x2bcefa=0xce;}_0x5ec748[_0x3743('0x14')](_0x2bcefa);return _0x5ec748[_0x3743('0x1b')]('Content-Range',_0x559091+'-'+_0x10fef3+'/'+_0x4b20aa)[_0x3743('0x16')](_0x4e8020);}return null;};}function patchUpdates(_0x46c3ff){return function(_0x54b452){try{jsonpatch[_0x3743('0x1c')](_0x54b452,_0x46c3ff,!![]);}catch(_0x1895a6){return BPromise[_0x3743('0x1d')](_0x1895a6);}return _0x54b452[_0x3743('0x1e')]();};}function saveUpdates(_0x67f608,_0x1bdb7e){return function(_0x988c2c){if(_0x988c2c){return _0x988c2c[_0x3743('0x1f')](_0x67f608)[_0x3743('0x20')](function(_0x571651){return _0x571651;});}return null;};}function removeEntity(_0x56a919,_0x37cddc){return function(_0x84755b){if(_0x84755b){return _0x84755b[_0x3743('0x21')]()[_0x3743('0x20')](function(){_0x56a919[_0x3743('0x14')](0xcc)[_0x3743('0x15')]();});}};}function handleEntityNotFound(_0x41bce7,_0x29876a){return function(_0x320212){if(!_0x320212){_0x41bce7['sendStatus'](0x194);}return _0x320212;};}function handleError(_0x3101f5,_0x5df785){_0x5df785=_0x5df785||0x1f4;return function(_0x253548){logger['error'](_0x253548[_0x3743('0x22')]);if(_0x253548[_0x3743('0x23')]){delete _0x253548[_0x3743('0x23')];}_0x3101f5['status'](_0x5df785)[_0x3743('0x24')](_0x253548);};}exports['index']=function(_0x536d83,_0x355a75){var _0x4676d4={},_0x2a7330={},_0x29687a={'count':0x0,'rows':[]};var _0x1616db=_[_0x3743('0x25')](db[_0x3743('0x26')]['rawAttributes'],function(_0x2efd40){return{'name':_0x2efd40[_0x3743('0x27')],'type':_0x2efd40[_0x3743('0x28')][_0x3743('0x29')]};});_0x2a7330[_0x3743('0x2a')]=_['map'](_0x1616db,_0x3743('0x23'));_0x2a7330[_0x3743('0x2b')]=_['keys'](_0x536d83['query']);_0x2a7330[_0x3743('0x2c')]=_[_0x3743('0x2d')](_0x2a7330[_0x3743('0x2a')],_0x2a7330[_0x3743('0x2b')]);_0x4676d4[_0x3743('0x2e')]=_[_0x3743('0x2d')](_0x2a7330[_0x3743('0x2a')],qs[_0x3743('0x2f')](_0x536d83[_0x3743('0x2b')][_0x3743('0x2f')]));_0x4676d4[_0x3743('0x2e')]=_0x4676d4[_0x3743('0x2e')][_0x3743('0x30')]?_0x4676d4[_0x3743('0x2e')]:_0x2a7330[_0x3743('0x2a')];if(!_0x536d83['query']['hasOwnProperty']('nolimit')){_0x4676d4['limit']=qs['limit'](_0x536d83[_0x3743('0x2b')][_0x3743('0x19')]);_0x4676d4['offset']=qs['offset'](_0x536d83[_0x3743('0x2b')][_0x3743('0x17')]);}_0x4676d4[_0x3743('0x31')]=qs[_0x3743('0x32')](_0x536d83[_0x3743('0x2b')][_0x3743('0x32')]);_0x4676d4[_0x3743('0x33')]=qs[_0x3743('0x2c')](_[_0x3743('0x34')](_0x536d83[_0x3743('0x2b')],_0x2a7330[_0x3743('0x2c')]),_0x1616db);if(_0x536d83[_0x3743('0x2b')][_0x3743('0x35')]){_0x4676d4['where']=_[_0x3743('0x36')](_0x4676d4[_0x3743('0x33')],{'$or':_[_0x3743('0x25')](_0x1616db,function(_0x5e81c9){if(_0x5e81c9[_0x3743('0x28')]!==_0x3743('0x37')){var _0x1371a2={};_0x1371a2[_0x5e81c9[_0x3743('0x23')]]={'$like':'%'+_0x536d83['query'][_0x3743('0x35')]+'%'};return _0x1371a2;}})});}_0x4676d4=_[_0x3743('0x36')]({},_0x4676d4,_0x536d83['options']);var _0x236013={'where':_0x4676d4[_0x3743('0x33')]};return db[_0x3743('0x26')][_0x3743('0x1a')](_0x236013)[_0x3743('0x20')](function(_0x37c540){_0x29687a[_0x3743('0x1a')]=_0x37c540;if(_0x536d83[_0x3743('0x2b')][_0x3743('0x38')]){_0x4676d4[_0x3743('0x39')]=[{'all':!![]}];}return db[_0x3743('0x26')]['findAll'](_0x4676d4);})[_0x3743('0x20')](function(_0x3171d2){_0x29687a['rows']=_0x3171d2;return _0x29687a;})[_0x3743('0x20')](respondWithFilteredResult(_0x355a75,_0x4676d4))['catch'](handleError(_0x355a75,null));};exports[_0x3743('0x3a')]=function(_0x425ba9,_0x43e3b7){var _0x45d5e6={'raw':!![],'where':{'id':_0x425ba9[_0x3743('0x3b')]['id']}},_0x4da0d4={};_0x4da0d4[_0x3743('0x2a')]=_['keys'](db[_0x3743('0x26')][_0x3743('0x3c')]);_0x4da0d4[_0x3743('0x2b')]=_[_0x3743('0x3d')](_0x425ba9[_0x3743('0x2b')]);_0x4da0d4[_0x3743('0x2c')]=_[_0x3743('0x2d')](_0x4da0d4[_0x3743('0x2a')],_0x4da0d4[_0x3743('0x2b')]);_0x45d5e6[_0x3743('0x2e')]=_[_0x3743('0x2d')](_0x4da0d4[_0x3743('0x2a')],qs['fields'](_0x425ba9['query'][_0x3743('0x2f')]));_0x45d5e6['attributes']=_0x45d5e6[_0x3743('0x2e')][_0x3743('0x30')]?_0x45d5e6[_0x3743('0x2e')]:_0x4da0d4[_0x3743('0x2a')];if(_0x425ba9[_0x3743('0x2b')][_0x3743('0x38')]){_0x45d5e6['include']=[{'all':!![]}];}_0x45d5e6=_[_0x3743('0x36')]({},_0x45d5e6,_0x425ba9['options']);return db[_0x3743('0x26')]['find'](_0x45d5e6)[_0x3743('0x20')](handleEntityNotFound(_0x43e3b7,null))['then'](respondWithResult(_0x43e3b7,null))[_0x3743('0x3e')](handleError(_0x43e3b7,null));};exports[_0x3743('0x3f')]=function(_0x4aeab3,_0x57e4d9){return db[_0x3743('0x26')][_0x3743('0x3f')](_0x4aeab3['body'],{})[_0x3743('0x20')](respondWithResult(_0x57e4d9,0xc9))['catch'](handleError(_0x57e4d9,null));};exports[_0x3743('0x1f')]=function(_0x569a90,_0x4c05da){if(_0x569a90[_0x3743('0x40')]['id']){delete _0x569a90[_0x3743('0x40')]['id'];}return db[_0x3743('0x26')][_0x3743('0x41')]({'where':{'id':_0x569a90[_0x3743('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4c05da,null))[_0x3743('0x20')](saveUpdates(_0x569a90[_0x3743('0x40')],null))[_0x3743('0x20')](respondWithResult(_0x4c05da,null))[_0x3743('0x3e')](handleError(_0x4c05da,null));};exports[_0x3743('0x21')]=function(_0x357dc2,_0x33c531){return db[_0x3743('0x26')][_0x3743('0x41')]({'where':{'id':_0x357dc2[_0x3743('0x3b')]['id']}})[_0x3743('0x20')](handleEntityNotFound(_0x33c531,null))[_0x3743('0x20')](removeEntity(_0x33c531,null))[_0x3743('0x3e')](handleError(_0x33c531,null));}; \ No newline at end of file +var _0x3ff9=['sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x784fec,_0x3f7922){var _0x33975e=function(_0x55e73d){while(--_0x55e73d){_0x784fec['push'](_0x784fec['shift']());}};_0x33975e(++_0x3f7922);}(_0x3ff9,0x10e));var _0x93ff=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x3ff9[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0x93ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x93ff('0x1'));var jsonpatch=require(_0x93ff('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x93ff('0x3'));var Mustache=require(_0x93ff('0x4'));var util=require('util');var path=require('path');var sox=require(_0x93ff('0x5'));var csv=require(_0x93ff('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ff('0x7'));var _=require(_0x93ff('0x8'));var squel=require(_0x93ff('0x9'));var crypto=require(_0x93ff('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x93ff('0xb'));var toCsv=require('to-csv');var querystring=require(_0x93ff('0xc'));var Papa=require(_0x93ff('0xd'));var Redis=require(_0x93ff('0xe'));var authService=require(_0x93ff('0xf'));var qs=require(_0x93ff('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93ff('0x11'));var logger=require(_0x93ff('0x12'))('api');var utils=require(_0x93ff('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x93ff('0x14'));var db=require(_0x93ff('0x15'))['db'];function respondWithStatusCode(_0x45055c,_0x3ac99a){_0x3ac99a=_0x3ac99a||0xcc;return function(_0x15b037){if(_0x15b037){return _0x45055c[_0x93ff('0x16')](_0x3ac99a);}return _0x45055c[_0x93ff('0x17')](_0x3ac99a)['end']();};}function respondWithResult(_0x180b58,_0x2a090b){_0x2a090b=_0x2a090b||0xc8;return function(_0x454104){if(_0x454104){return _0x180b58[_0x93ff('0x17')](_0x2a090b)['json'](_0x454104);}};}function respondWithFilteredResult(_0x2c56a7,_0x5de4f1){return function(_0x41bdb2){if(_0x41bdb2){var _0x4ac24c=typeof _0x5de4f1['offset']===_0x93ff('0x18')&&typeof _0x5de4f1[_0x93ff('0x19')]===_0x93ff('0x18');var _0x2f0a8b=_0x41bdb2[_0x93ff('0x1a')];var _0x2937d4=_0x4ac24c?0x0:_0x5de4f1[_0x93ff('0x1b')];var _0x286100=_0x4ac24c?_0x41bdb2[_0x93ff('0x1a')]:_0x5de4f1[_0x93ff('0x1b')]+_0x5de4f1[_0x93ff('0x19')];var _0x3bacef;if(_0x286100>=_0x2f0a8b){_0x286100=_0x2f0a8b;_0x3bacef=0xc8;}else{_0x3bacef=0xce;}_0x2c56a7[_0x93ff('0x17')](_0x3bacef);return _0x2c56a7[_0x93ff('0x1c')]('Content-Range',_0x2937d4+'-'+_0x286100+'/'+_0x2f0a8b)[_0x93ff('0x1d')](_0x41bdb2);}return null;};}function patchUpdates(_0x63db2a){return function(_0xd92a8f){try{jsonpatch[_0x93ff('0x1e')](_0xd92a8f,_0x63db2a,!![]);}catch(_0x526566){return BPromise[_0x93ff('0x1f')](_0x526566);}return _0xd92a8f[_0x93ff('0x20')]();};}function saveUpdates(_0x5af524,_0x3a22b3){return function(_0x581b1b){if(_0x581b1b){return _0x581b1b[_0x93ff('0x21')](_0x5af524)[_0x93ff('0x22')](function(_0x537b9c){return _0x537b9c;});}return null;};}function removeEntity(_0x198633,_0x424a37){return function(_0x26e681){if(_0x26e681){return _0x26e681['destroy']()[_0x93ff('0x22')](function(){_0x198633[_0x93ff('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fbc75,_0x2777f7){return function(_0x19e78a){if(!_0x19e78a){_0x3fbc75['sendStatus'](0x194);}return _0x19e78a;};}function handleError(_0x5ba2e9,_0x34fc32){_0x34fc32=_0x34fc32||0x1f4;return function(_0x56b48d){logger['error'](_0x56b48d[_0x93ff('0x23')]);if(_0x56b48d['name']){delete _0x56b48d[_0x93ff('0x24')];}_0x5ba2e9[_0x93ff('0x17')](_0x34fc32)[_0x93ff('0x25')](_0x56b48d);};}exports[_0x93ff('0x26')]=function(_0x17ee33,_0x2105f4){var _0x3bd3a2={},_0x4cd233={},_0x37bf84={'count':0x0,'rows':[]};var _0x470a0e=_[_0x93ff('0x27')](db[_0x93ff('0x28')][_0x93ff('0x29')],function(_0x5a6406){return{'name':_0x5a6406[_0x93ff('0x2a')],'type':_0x5a6406[_0x93ff('0x2b')]['key']};});_0x4cd233['model']=_['map'](_0x470a0e,_0x93ff('0x24'));_0x4cd233[_0x93ff('0x2c')]=_[_0x93ff('0x2d')](_0x17ee33[_0x93ff('0x2c')]);_0x4cd233['filters']=_[_0x93ff('0x2e')](_0x4cd233[_0x93ff('0x2f')],_0x4cd233['query']);_0x3bd3a2[_0x93ff('0x30')]=_['intersection'](_0x4cd233[_0x93ff('0x2f')],qs[_0x93ff('0x31')](_0x17ee33['query'][_0x93ff('0x31')]));_0x3bd3a2['attributes']=_0x3bd3a2[_0x93ff('0x30')][_0x93ff('0x32')]?_0x3bd3a2[_0x93ff('0x30')]:_0x4cd233[_0x93ff('0x2f')];if(!_0x17ee33['query'][_0x93ff('0x33')](_0x93ff('0x34'))){_0x3bd3a2[_0x93ff('0x19')]=qs[_0x93ff('0x19')](_0x17ee33[_0x93ff('0x2c')][_0x93ff('0x19')]);_0x3bd3a2['offset']=qs[_0x93ff('0x1b')](_0x17ee33[_0x93ff('0x2c')]['offset']);}_0x3bd3a2[_0x93ff('0x35')]=qs['sort'](_0x17ee33[_0x93ff('0x2c')][_0x93ff('0x36')]);_0x3bd3a2[_0x93ff('0x37')]=qs['filters'](_[_0x93ff('0x38')](_0x17ee33[_0x93ff('0x2c')],_0x4cd233[_0x93ff('0x39')]),_0x470a0e);if(_0x17ee33[_0x93ff('0x2c')][_0x93ff('0x3a')]){_0x3bd3a2[_0x93ff('0x37')]=_[_0x93ff('0x3b')](_0x3bd3a2['where'],{'$or':_[_0x93ff('0x27')](_0x470a0e,function(_0x260a4b){if(_0x260a4b[_0x93ff('0x2b')]!==_0x93ff('0x3c')){var _0x571a5e={};_0x571a5e[_0x260a4b['name']]={'$like':'%'+_0x17ee33['query']['filter']+'%'};return _0x571a5e;}})});}_0x3bd3a2=_['merge']({},_0x3bd3a2,_0x17ee33[_0x93ff('0x3d')]);var _0x3190c7={'where':_0x3bd3a2[_0x93ff('0x37')]};return db[_0x93ff('0x28')][_0x93ff('0x1a')](_0x3190c7)[_0x93ff('0x22')](function(_0x3438f8){_0x37bf84[_0x93ff('0x1a')]=_0x3438f8;if(_0x17ee33[_0x93ff('0x2c')][_0x93ff('0x3e')]){_0x3bd3a2[_0x93ff('0x3f')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x93ff('0x40')](_0x3bd3a2);})['then'](function(_0x2bd959){_0x37bf84[_0x93ff('0x41')]=_0x2bd959;return _0x37bf84;})[_0x93ff('0x22')](respondWithFilteredResult(_0x2105f4,_0x3bd3a2))['catch'](handleError(_0x2105f4,null));};exports[_0x93ff('0x42')]=function(_0x488fd5,_0x3541de){var _0x128f40={'raw':!![],'where':{'id':_0x488fd5[_0x93ff('0x43')]['id']}},_0x2b8bf1={};_0x2b8bf1[_0x93ff('0x2f')]=_[_0x93ff('0x2d')](db[_0x93ff('0x28')][_0x93ff('0x29')]);_0x2b8bf1[_0x93ff('0x2c')]=_['keys'](_0x488fd5[_0x93ff('0x2c')]);_0x2b8bf1[_0x93ff('0x39')]=_['intersection'](_0x2b8bf1['model'],_0x2b8bf1['query']);_0x128f40[_0x93ff('0x30')]=_[_0x93ff('0x2e')](_0x2b8bf1[_0x93ff('0x2f')],qs[_0x93ff('0x31')](_0x488fd5[_0x93ff('0x2c')]['fields']));_0x128f40['attributes']=_0x128f40['attributes']['length']?_0x128f40['attributes']:_0x2b8bf1['model'];if(_0x488fd5[_0x93ff('0x2c')][_0x93ff('0x3e')]){_0x128f40[_0x93ff('0x3f')]=[{'all':!![]}];}_0x128f40=_[_0x93ff('0x3b')]({},_0x128f40,_0x488fd5[_0x93ff('0x3d')]);return db['Dynamics365Field'][_0x93ff('0x44')](_0x128f40)[_0x93ff('0x22')](handleEntityNotFound(_0x3541de,null))['then'](respondWithResult(_0x3541de,null))[_0x93ff('0x45')](handleError(_0x3541de,null));};exports[_0x93ff('0x46')]=function(_0x4efb7b,_0x98508){return db[_0x93ff('0x28')][_0x93ff('0x46')](_0x4efb7b[_0x93ff('0x47')],{})[_0x93ff('0x22')](respondWithResult(_0x98508,0xc9))[_0x93ff('0x45')](handleError(_0x98508,null));};exports[_0x93ff('0x21')]=function(_0x145821,_0x1d0953){if(_0x145821[_0x93ff('0x47')]['id']){delete _0x145821['body']['id'];}return db[_0x93ff('0x28')]['find']({'where':{'id':_0x145821[_0x93ff('0x43')]['id']}})[_0x93ff('0x22')](handleEntityNotFound(_0x1d0953,null))[_0x93ff('0x22')](saveUpdates(_0x145821[_0x93ff('0x47')],null))[_0x93ff('0x22')](respondWithResult(_0x1d0953,null))[_0x93ff('0x45')](handleError(_0x1d0953,null));};exports[_0x93ff('0x48')]=function(_0x4bae28,_0x2eec26){return db[_0x93ff('0x28')][_0x93ff('0x44')]({'where':{'id':_0x4bae28[_0x93ff('0x43')]['id']}})[_0x93ff('0x22')](handleEntityNotFound(_0x2eec26,null))[_0x93ff('0x22')](removeEntity(_0x2eec26,null))['catch'](handleError(_0x2eec26,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 0fa53df..7b3478f 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 _0xefa7=['bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','../../config/logger','api','moment'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0xefa7,0x106));var _0x7efa=function(_0x1547ed,_0x17e5eb){_0x1547ed=_0x1547ed-0x0;var _0x45bc13=_0xefa7[_0x1547ed];return _0x45bc13;};'use strict';var _=require(_0x7efa('0x0'));var util=require('util');var logger=require(_0x7efa('0x1'))(_0x7efa('0x2'));var moment=require(_0x7efa('0x3'));var BPromise=require(_0x7efa('0x4'));var rp=require(_0x7efa('0x5'));var fs=require('fs');var path=require(_0x7efa('0x6'));var rimraf=require(_0x7efa('0x7'));var config=require('../../config/environment');var attributes=require(_0x7efa('0x8'));module[_0x7efa('0x9')]=function(_0x467212,_0x27d029){return _0x467212[_0x7efa('0xa')]('Dynamics365Field',attributes,{'tableName':_0x7efa('0xb'),'paranoid':![],'indexes':[{'name':_0x7efa('0xc'),'fields':['idField',_0x7efa('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f02=['define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','util','moment','path','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0xa61a5d,_0x2e4a89){var _0x3d6712=function(_0x3752e9){while(--_0x3752e9){_0xa61a5d['push'](_0xa61a5d['shift']());}};_0x3d6712(++_0x2e4a89);}(_0x8f02,0x1f4));var _0x28f0=function(_0x2914f6,_0x486818){_0x2914f6=_0x2914f6-0x0;var _0x4d7e79=_0x8f02[_0x2914f6];return _0x4d7e79;};'use strict';var _=require('lodash');var util=require(_0x28f0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x28f0('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x28f0('0x2'));var rimraf=require('rimraf');var config=require(_0x28f0('0x3'));var attributes=require(_0x28f0('0x4'));module[_0x28f0('0x5')]=function(_0xc6309d,_0x3e1b2f){return _0xc6309d[_0x28f0('0x6')](_0x28f0('0x7'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x28f0('0x8'),'fields':[_0x28f0('0x9'),_0x28f0('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 aa77249..4a98ef9 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 _0xa82a=['then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3a5648,_0x58054e){var _0x34126d=function(_0x3a6476){while(--_0x3a6476){_0x3a5648['push'](_0x3a5648['shift']());}};_0x34126d(++_0x58054e);}(_0xa82a,0xfa));var _0xaa82=function(_0x29f1a5,_0x2a56b4){_0x29f1a5=_0x29f1a5-0x0;var _0x3d5ce1=_0xa82a[_0x29f1a5];return _0x3d5ce1;};'use strict';var _=require(_0xaa82('0x0'));var util=require(_0xaa82('0x1'));var moment=require(_0xaa82('0x2'));var BPromise=require(_0xaa82('0x3'));var rs=require(_0xaa82('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa82('0x5'))['db'];var utils=require(_0xaa82('0x6'));var logger=require(_0xaa82('0x7'))(_0xaa82('0x8'));var config=require(_0xaa82('0x9'));var jayson=require(_0xaa82('0xa'));var client=jayson[_0xaa82('0xb')][_0xaa82('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3039cf,_0x21b352,_0xcf1d58){return new BPromise(function(_0x4a92b2,_0x24884a){return client[_0xaa82('0xd')](_0x3039cf,_0xcf1d58)[_0xaa82('0xe')](function(_0x2096a4){logger[_0xaa82('0xf')](_0xaa82('0x10'),_0x21b352,_0xaa82('0x11'));logger[_0xaa82('0x12')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x21b352,'request\x20sent',JSON[_0xaa82('0x13')](_0x2096a4));if(_0x2096a4[_0xaa82('0x14')]){if(_0x2096a4[_0xaa82('0x14')][_0xaa82('0x15')]===0x1f4){logger[_0xaa82('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x21b352,_0x2096a4[_0xaa82('0x14')][_0xaa82('0x16')]);return _0x24884a(_0x2096a4[_0xaa82('0x14')][_0xaa82('0x16')]);}logger[_0xaa82('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x21b352,_0x2096a4[_0xaa82('0x14')]['message']);return _0x4a92b2(_0x2096a4[_0xaa82('0x14')]['message']);}else{logger[_0xaa82('0xf')](_0xaa82('0x10'),_0x21b352,_0xaa82('0x11'));_0x4a92b2(_0x2096a4[_0xaa82('0x17')][_0xaa82('0x16')]);}})['catch'](function(_0x5115cc){logger['error'](_0xaa82('0x10'),_0x21b352,_0x5115cc);_0x24884a(_0x5115cc);});});} \ No newline at end of file +var _0x91a6=['info','request\x20sent','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x91a6,0x9e));var _0x691a=function(_0xc2f35,_0x4453b1){_0xc2f35=_0xc2f35-0x0;var _0x3b5f46=_0x91a6[_0xc2f35];return _0x3b5f46;};'use strict';var _=require(_0x691a('0x0'));var util=require(_0x691a('0x1'));var moment=require(_0x691a('0x2'));var BPromise=require('bluebird');var rs=require(_0x691a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x691a('0x4'));var logger=require(_0x691a('0x5'))(_0x691a('0x6'));var config=require(_0x691a('0x7'));var jayson=require(_0x691a('0x8'));var client=jayson[_0x691a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1934d5,_0xb570dd,_0x76739c){return new BPromise(function(_0x5c2583,_0x857087){return client[_0x691a('0xa')](_0x1934d5,_0x76739c)[_0x691a('0xb')](function(_0x2cc0f0){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0xb570dd,'request\x20sent');logger['debug'](_0x691a('0xc'),_0xb570dd,'request\x20sent',JSON[_0x691a('0xd')](_0x2cc0f0));if(_0x2cc0f0[_0x691a('0xe')]){if(_0x2cc0f0[_0x691a('0xe')][_0x691a('0xf')]===0x1f4){logger['error'](_0x691a('0x10'),_0xb570dd,_0x2cc0f0['error']['message']);return _0x857087(_0x2cc0f0['error'][_0x691a('0x11')]);}logger['error'](_0x691a('0x10'),_0xb570dd,_0x2cc0f0[_0x691a('0xe')][_0x691a('0x11')]);return _0x5c2583(_0x2cc0f0['error'][_0x691a('0x11')]);}else{logger[_0x691a('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0xb570dd,_0x691a('0x13'));_0x5c2583(_0x2cc0f0[_0x691a('0x14')][_0x691a('0x11')]);}})[_0x691a('0x15')](function(_0x1c551a){logger[_0x691a('0xe')](_0x691a('0x10'),_0xb570dd,_0x1c551a);_0x857087(_0x1c551a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 572cfa1..b06c032 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 _0x8cec=['../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x56553e,_0x188da){var _0x10515a=function(_0x4f1445){while(--_0x4f1445){_0x56553e['push'](_0x56553e['shift']());}};_0x10515a(++_0x188da);}(_0x8cec,0x192));var _0xc8ce=function(_0x26b5a9,_0x2c1f6f){_0x26b5a9=_0x26b5a9-0x0;var _0x5dc833=_0x8cec[_0x26b5a9];return _0x5dc833;};'use strict';var multer=require(_0xc8ce('0x0'));var util=require(_0xc8ce('0x1'));var path=require(_0xc8ce('0x2'));var timeout=require(_0xc8ce('0x3'));var express=require('express');var router=express[_0xc8ce('0x4')]();var fs_extra=require(_0xc8ce('0x5'));var auth=require(_0xc8ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc8ce('0x7'));var controller=require(_0xc8ce('0x8'));router[_0xc8ce('0x9')]('/',auth[_0xc8ce('0xa')](),controller[_0xc8ce('0xb')]);router[_0xc8ce('0x9')](_0xc8ce('0xc'),auth[_0xc8ce('0xa')](),controller[_0xc8ce('0xd')]);router[_0xc8ce('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc8ce('0x9')](_0xc8ce('0xe'),auth['isAuthenticated'](),controller[_0xc8ce('0xf')]);router[_0xc8ce('0x10')]('/',auth[_0xc8ce('0xa')](),controller['create']);router[_0xc8ce('0x10')](_0xc8ce('0x11'),auth[_0xc8ce('0xa')](),controller[_0xc8ce('0x12')]);router[_0xc8ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xc8ce('0x14')]);router[_0xc8ce('0x15')]('/:id',auth[_0xc8ce('0xa')](),controller[_0xc8ce('0x16')]);module[_0xc8ce('0x17')]=router; \ No newline at end of file +var _0xaf4d=['../../config/environment','./intFreshdeskAccount.controller','index','/:id','get','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','addConfiguration','put','delete','exports','multer','util','express','fs-extra','../../components/interaction/service'];(function(_0x154207,_0x1ddced){var _0x165fff=function(_0x224441){while(--_0x224441){_0x154207['push'](_0x154207['shift']());}};_0x165fff(++_0x1ddced);}(_0xaf4d,0x93));var _0xdaf4=function(_0x524639,_0x56d05d){_0x524639=_0x524639-0x0;var _0xa1568d=_0xaf4d[_0x524639];return _0xa1568d;};'use strict';var multer=require(_0xdaf4('0x0'));var util=require(_0xdaf4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdaf4('0x2'));var router=express['Router']();var fs_extra=require(_0xdaf4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdaf4('0x4'));var config=require(_0xdaf4('0x5'));var controller=require(_0xdaf4('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xdaf4('0x7')]);router['get'](_0xdaf4('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xdaf4('0x9')](_0xdaf4('0xa'),auth[_0xdaf4('0xb')](),controller[_0xdaf4('0xc')]);router[_0xdaf4('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xdaf4('0xd')]);router[_0xdaf4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdaf4('0xe')](_0xdaf4('0xa'),auth[_0xdaf4('0xb')](),controller[_0xdaf4('0xf')]);router[_0xdaf4('0x10')](_0xdaf4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xdaf4('0x11')](_0xdaf4('0x8'),auth[_0xdaf4('0xb')](),controller['destroy']);module[_0xdaf4('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index d112ec9..dc294a6 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 _0x2032=['remoteUri','exports','STRING','username'];(function(_0x175113,_0x1119d7){var _0x510e3b=function(_0x14549d){while(--_0x14549d){_0x175113['push'](_0x175113['shift']());}};_0x510e3b(++_0x1119d7);}(_0x2032,0xd9));var _0x2203=function(_0x3371df,_0x3894b9){_0x3371df=_0x3371df-0x0;var _0x119a00=_0x2032[_0x3371df];return _0x119a00;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')]},'description':{'type':Sequelize[_0x2203('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2203('0x2')},'apiKey':{'type':Sequelize[_0x2203('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2203('0x3')},'serverUrl':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x14a0=['username','exports','STRING'];(function(_0x440e51,_0x4fc63a){var _0x9be905=function(_0x3e685e){while(--_0x3e685e){_0x440e51['push'](_0x440e51['shift']());}};_0x9be905(++_0x4fc63a);}(_0x14a0,0x8e));var _0x014a=function(_0x59c1dd,_0xa83f98){_0x59c1dd=_0x59c1dd-0x0;var _0x2ada60=_0x14a0[_0x59c1dd];return _0x2ada60;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'name':{'type':Sequelize[_0x014a('0x1')]},'description':{'type':Sequelize[_0x014a('0x1')]},'username':{'type':Sequelize[_0x014a('0x1')],'unique':_0x014a('0x2')},'apiKey':{'type':Sequelize[_0x014a('0x1')]},'remoteUri':{'type':Sequelize[_0x014a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 64d2e9d..32db8b0 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 _0xa68c=['includeAll','findAll','rows','catch','params','include','create','body','destroy','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','remoteUri','GET','format','%s/%s','Basic\x20%s','%s:X','apiKey','toString','base64','requester','subject','agent','priority','source','ticket_type','group','company','remove','default','custom_text','label','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','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','../../components/integrations/configuration','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xa68c,0x187));var _0xca68=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa68c[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xca68('0x0'));var rimraf=require(_0xca68('0x1'));var zipdir=require(_0xca68('0x2'));var jsonpatch=require(_0xca68('0x3'));var rp=require(_0xca68('0x4'));var moment=require(_0xca68('0x5'));var BPromise=require(_0xca68('0x6'));var Mustache=require(_0xca68('0x7'));var util=require(_0xca68('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xca68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca68('0xa'));var _=require(_0xca68('0xb'));var squel=require(_0xca68('0xc'));var crypto=require(_0xca68('0xd'));var jsforce=require(_0xca68('0xe'));var deskjs=require(_0xca68('0xf'));var toCsv=require(_0xca68('0x9'));var querystring=require(_0xca68('0x10'));var Papa=require(_0xca68('0x11'));var Redis=require(_0xca68('0x12'));var authService=require(_0xca68('0x13'));var qs=require(_0xca68('0x14'));var as=require(_0xca68('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xca68('0x16'));var utils=require(_0xca68('0x17'));var config=require(_0xca68('0x18'));var licenseUtil=require(_0xca68('0x19'));var db=require(_0xca68('0x1a'))['db'];var integrations=require(_0xca68('0x1b'));function respondWithStatusCode(_0x4cc845,_0x221af9){_0x221af9=_0x221af9||0xcc;return function(_0x109996){if(_0x109996){return _0x4cc845[_0xca68('0x1c')](_0x221af9);}return _0x4cc845['status'](_0x221af9)[_0xca68('0x1d')]();};}function respondWithResult(_0x4944db,_0x1eee82){_0x1eee82=_0x1eee82||0xc8;return function(_0x1d5ef1){if(_0x1d5ef1){return _0x4944db['status'](_0x1eee82)['json'](_0x1d5ef1);}};}function respondWithFilteredResult(_0x2cb440,_0x252712){return function(_0x38d443){if(_0x38d443){var _0xce1268=typeof _0x252712[_0xca68('0x1e')]===_0xca68('0x1f')&&typeof _0x252712[_0xca68('0x20')]===_0xca68('0x1f');var _0x180edb=_0x38d443[_0xca68('0x21')];var _0x9221a5=_0xce1268?0x0:_0x252712[_0xca68('0x1e')];var _0x30e34f=_0xce1268?_0x38d443[_0xca68('0x21')]:_0x252712[_0xca68('0x1e')]+_0x252712[_0xca68('0x20')];var _0x5d5ac3;if(_0x30e34f>=_0x180edb){_0x30e34f=_0x180edb;_0x5d5ac3=0xc8;}else{_0x5d5ac3=0xce;}_0x2cb440[_0xca68('0x22')](_0x5d5ac3);return _0x2cb440['set'](_0xca68('0x23'),_0x9221a5+'-'+_0x30e34f+'/'+_0x180edb)[_0xca68('0x24')](_0x38d443);}return null;};}function patchUpdates(_0x27b1a2){return function(_0x4aeac7){try{jsonpatch['apply'](_0x4aeac7,_0x27b1a2,!![]);}catch(_0x58855b){return BPromise[_0xca68('0x25')](_0x58855b);}return _0x4aeac7[_0xca68('0x26')]();};}function saveUpdates(_0x39f8ee,_0x441a4e){return function(_0x1efd64){if(_0x1efd64){return _0x1efd64[_0xca68('0x27')](_0x39f8ee)[_0xca68('0x28')](function(_0x5d1891){return _0x5d1891;});}return null;};}function removeEntity(_0x1b2f41,_0x26628c){return function(_0x17f0c7){if(_0x17f0c7){return _0x17f0c7['destroy']()['then'](function(){_0x1b2f41[_0xca68('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8279,_0x28b801){return function(_0x55af0b){if(!_0x55af0b){_0x5d8279[_0xca68('0x1c')](0x194);}return _0x55af0b;};}function handleError(_0x1ca374,_0x2ebfe0){_0x2ebfe0=_0x2ebfe0||0x1f4;return function(_0x4f059c){logger[_0xca68('0x29')](_0x4f059c[_0xca68('0x2a')]);if(_0x4f059c[_0xca68('0x2b')]){delete _0x4f059c[_0xca68('0x2b')];}_0x1ca374[_0xca68('0x22')](_0x2ebfe0)[_0xca68('0x2c')](_0x4f059c);};}exports[_0xca68('0x2d')]=function(_0x141aa2,_0x553469){var _0x51bd6f={},_0x44b5f3={},_0x5e0f3b={'count':0x0,'rows':[]};var _0x3b01df=_[_0xca68('0x2e')](db[_0xca68('0x2f')][_0xca68('0x30')],function(_0x438cf4){return{'name':_0x438cf4[_0xca68('0x31')],'type':_0x438cf4[_0xca68('0x32')]['key']};});_0x44b5f3[_0xca68('0x33')]=_[_0xca68('0x2e')](_0x3b01df,_0xca68('0x2b'));_0x44b5f3[_0xca68('0x34')]=_[_0xca68('0x35')](_0x141aa2[_0xca68('0x34')]);_0x44b5f3[_0xca68('0x36')]=_['intersection'](_0x44b5f3['model'],_0x44b5f3[_0xca68('0x34')]);_0x51bd6f[_0xca68('0x37')]=_[_0xca68('0x38')](_0x44b5f3[_0xca68('0x33')],qs[_0xca68('0x39')](_0x141aa2['query']['fields']));_0x51bd6f[_0xca68('0x37')]=_0x51bd6f[_0xca68('0x37')][_0xca68('0x3a')]?_0x51bd6f[_0xca68('0x37')]:_0x44b5f3[_0xca68('0x33')];if(!_0x141aa2[_0xca68('0x34')][_0xca68('0x3b')](_0xca68('0x3c'))){_0x51bd6f[_0xca68('0x20')]=qs[_0xca68('0x20')](_0x141aa2[_0xca68('0x34')]['limit']);_0x51bd6f[_0xca68('0x1e')]=qs[_0xca68('0x1e')](_0x141aa2[_0xca68('0x34')][_0xca68('0x1e')]);}_0x51bd6f[_0xca68('0x3d')]=qs[_0xca68('0x3e')](_0x141aa2['query'][_0xca68('0x3e')]);_0x51bd6f[_0xca68('0x3f')]=qs['filters'](_[_0xca68('0x40')](_0x141aa2['query'],_0x44b5f3[_0xca68('0x36')]),_0x3b01df);if(_0x141aa2[_0xca68('0x34')]['filter']){_0x51bd6f[_0xca68('0x3f')]=_[_0xca68('0x41')](_0x51bd6f[_0xca68('0x3f')],{'$or':_[_0xca68('0x2e')](_0x3b01df,function(_0x3132b0){if(_0x3132b0['type']!==_0xca68('0x42')){var _0x1ab056={};_0x1ab056[_0x3132b0['name']]={'$like':'%'+_0x141aa2[_0xca68('0x34')][_0xca68('0x43')]+'%'};return _0x1ab056;}})});}_0x51bd6f=_[_0xca68('0x41')]({},_0x51bd6f,_0x141aa2[_0xca68('0x44')]);var _0xc49648={'where':_0x51bd6f[_0xca68('0x3f')]};return db['FreshdeskAccount']['count'](_0xc49648)['then'](function(_0x802506){_0x5e0f3b['count']=_0x802506;if(_0x141aa2[_0xca68('0x34')][_0xca68('0x45')]){_0x51bd6f['include']=[{'all':!![]}];}return db[_0xca68('0x2f')][_0xca68('0x46')](_0x51bd6f);})[_0xca68('0x28')](function(_0x449f97){_0x5e0f3b[_0xca68('0x47')]=_0x449f97;return _0x5e0f3b;})[_0xca68('0x28')](respondWithFilteredResult(_0x553469,_0x51bd6f))[_0xca68('0x48')](handleError(_0x553469,null));};exports['show']=function(_0x5f105c,_0x3269aa){var _0xd1f72={'raw':![],'where':{'id':_0x5f105c[_0xca68('0x49')]['id']}},_0x512e2e={};_0x512e2e[_0xca68('0x33')]=_[_0xca68('0x35')](db['FreshdeskAccount'][_0xca68('0x30')]);_0x512e2e[_0xca68('0x34')]=_[_0xca68('0x35')](_0x5f105c['query']);_0x512e2e[_0xca68('0x36')]=_[_0xca68('0x38')](_0x512e2e[_0xca68('0x33')],_0x512e2e[_0xca68('0x34')]);_0xd1f72[_0xca68('0x37')]=_[_0xca68('0x38')](_0x512e2e['model'],qs[_0xca68('0x39')](_0x5f105c['query'][_0xca68('0x39')]));_0xd1f72['attributes']=_0xd1f72[_0xca68('0x37')][_0xca68('0x3a')]?_0xd1f72[_0xca68('0x37')]:_0x512e2e['model'];if(_0x5f105c[_0xca68('0x34')][_0xca68('0x45')]){_0xd1f72[_0xca68('0x4a')]=[{'all':!![]}];}_0xd1f72=_['merge']({},_0xd1f72,_0x5f105c[_0xca68('0x44')]);return db[_0xca68('0x2f')]['find'](_0xd1f72)['then'](handleEntityNotFound(_0x3269aa,null))['then'](respondWithResult(_0x3269aa,null))['catch'](handleError(_0x3269aa,null));};exports[_0xca68('0x4b')]=function(_0x1f3f96,_0x31219e){return db['FreshdeskAccount']['create'](_0x1f3f96[_0xca68('0x4c')],{})[_0xca68('0x28')](respondWithResult(_0x31219e,0xc9))[_0xca68('0x48')](handleError(_0x31219e,null));};exports[_0xca68('0x27')]=function(_0x40cef9,_0x20c6ea){if(_0x40cef9[_0xca68('0x4c')]['id']){delete _0x40cef9[_0xca68('0x4c')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x40cef9[_0xca68('0x49')]['id']}})[_0xca68('0x28')](handleEntityNotFound(_0x20c6ea,null))['then'](saveUpdates(_0x40cef9['body'],null))[_0xca68('0x28')](respondWithResult(_0x20c6ea,null))['catch'](handleError(_0x20c6ea,null));};exports[_0xca68('0x4d')]=function(_0x4670ed,_0x5b2cff){return db['FreshdeskAccount']['find']({'where':{'id':_0x4670ed[_0xca68('0x49')]['id']}})[_0xca68('0x28')](handleEntityNotFound(_0x5b2cff,null))['then'](removeEntity(_0x5b2cff,null))[_0xca68('0x48')](handleError(_0x5b2cff,null));};exports[_0xca68('0x4e')]=function(_0x134736,_0x1c4d0a,_0x1b8867){var _0x414c62={};var _0x3713c6={};var _0xb13cd;var _0x10a31f;return db[_0xca68('0x2f')]['findOne']({'where':{'id':_0x134736[_0xca68('0x49')]['id']}})[_0xca68('0x28')](handleEntityNotFound(_0x1c4d0a,null))[_0xca68('0x28')](function(_0x2fa868){if(_0x2fa868){_0xb13cd=_0x2fa868;_0x3713c6[_0xca68('0x33')]=_[_0xca68('0x35')](db['FreshdeskConfiguration'][_0xca68('0x30')]);_0x3713c6[_0xca68('0x34')]=_[_0xca68('0x35')](_0x134736[_0xca68('0x34')]);_0x3713c6[_0xca68('0x36')]=_[_0xca68('0x38')](_0x3713c6['model'],_0x3713c6[_0xca68('0x34')]);_0x414c62[_0xca68('0x37')]=_['intersection'](_0x3713c6['model'],qs[_0xca68('0x39')](_0x134736[_0xca68('0x34')]['fields']));_0x414c62[_0xca68('0x37')]=_0x414c62[_0xca68('0x37')][_0xca68('0x3a')]?_0x414c62['attributes']:_0x3713c6['model'];_0x414c62[_0xca68('0x3d')]=qs[_0xca68('0x3e')](_0x134736['query'][_0xca68('0x3e')]);_0x414c62[_0xca68('0x3f')]=qs[_0xca68('0x36')](_[_0xca68('0x40')](_0x134736['query'],_0x3713c6['filters']));if(_0x134736[_0xca68('0x34')]['filter']){_0x414c62['where']=_['merge'](_0x414c62[_0xca68('0x3f')],{'$or':_[_0xca68('0x2e')](_0x414c62[_0xca68('0x37')],function(_0x35b592){var _0xc00d0d={};_0xc00d0d[_0x35b592]={'$like':'%'+_0x134736[_0xca68('0x34')][_0xca68('0x43')]+'%'};return _0xc00d0d;})});}_0x414c62=_['merge']({},_0x414c62,_0x134736[_0xca68('0x44')]);return _0xb13cd['getConfigurations'](_0x414c62);}})[_0xca68('0x28')](function(_0x12070f){if(_0x12070f){_0x10a31f=_0x12070f[_0xca68('0x3a')];if(!_0x134736[_0xca68('0x34')][_0xca68('0x3b')]('nolimit')){_0x414c62[_0xca68('0x20')]=qs['limit'](_0x134736[_0xca68('0x34')][_0xca68('0x20')]);_0x414c62[_0xca68('0x1e')]=qs['offset'](_0x134736['query'][_0xca68('0x1e')]);}return _0xb13cd[_0xca68('0x4e')](_0x414c62);}})[_0xca68('0x28')](function(_0x29afac){if(_0x29afac){return _0x29afac?{'count':_0x10a31f,'rows':_0x29afac}:null;}})[_0xca68('0x28')](respondWithResult(_0x1c4d0a,null))['catch'](handleError(_0x1c4d0a,null));};exports[_0xca68('0x4f')]=function(_0x11a4c7,_0x43a6a0,_0x705a0e){if(_0x11a4c7[_0xca68('0x4c')]['id']){delete _0x11a4c7[_0xca68('0x4c')]['id'];}return db[_0xca68('0x2f')][_0xca68('0x50')]({'where':{'id':_0x11a4c7[_0xca68('0x49')]['id']}})[_0xca68('0x28')](handleEntityNotFound(_0x43a6a0,null))['then'](function(_0x21f50e){if(_0x21f50e){_0x11a4c7[_0xca68('0x4c')][_0xca68('0x51')]=_0x21f50e['id'];_0x11a4c7['body'][_0xca68('0x52')]=integrations[_0xca68('0x53')](_0x11a4c7[_0xca68('0x4c')][_0xca68('0x54')],_0x11a4c7['body'][_0xca68('0x32')]);_0x11a4c7[_0xca68('0x4c')][_0xca68('0x55')]=integrations[_0xca68('0x56')](_0x11a4c7['body'][_0xca68('0x54')],_0x11a4c7[_0xca68('0x4c')][_0xca68('0x32')]);return db[_0xca68('0x57')]['create'](_0x11a4c7[_0xca68('0x4c')],{'include':[{'model':db[_0xca68('0x58')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0xca68('0x55')}]});}return null;})[_0xca68('0x28')](respondWithResult(_0x43a6a0,null))[_0xca68('0x48')](handleError(_0x43a6a0,null));};exports['getFields']=function(_0x25ce17,_0x48678f,_0x411fe5){var _0x195a2f='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x25ce17[_0xca68('0x49')]['id']},'attributes':['id',_0xca68('0x59'),'apiKey']})[_0xca68('0x28')](handleEntityNotFound(_0x48678f,null))[_0xca68('0x28')](function(_0x645396){if(_0x645396){_0x195a2f=_0x645396[_0xca68('0x59')];var _0x200803=_0x195a2f['slice'](-0x1);if(_0x200803==='/'){_0x195a2f=_0x195a2f['substring'](0x0,_0x195a2f['lastIndexOf'](_0x200803));}return rp({'method':_0xca68('0x5a'),'uri':util[_0xca68('0x5b')](_0xca68('0x5c'),_0x195a2f,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0xca68('0x5d'),new Buffer(util['format'](_0xca68('0x5e'),_0x645396[_0xca68('0x5f')]))[_0xca68('0x60')](_0xca68('0x61')))},'json':!![]});}})[_0xca68('0x28')](function(_0x1ffa11){if(_0x1ffa11){var _0x280fcb=[_0xca68('0x62'),_0xca68('0x63'),_0xca68('0x64'),'description','status',_0xca68('0x65'),'group',_0xca68('0x66'),_0xca68('0x67'),_0xca68('0x68'),_0xca68('0x69')];_[_0xca68('0x6a')](_0x1ffa11,function(_0x2c0651){return _0x280fcb['includes'](_0x2c0651[_0xca68('0x2b')])||!_0x2c0651[_0xca68('0x6b')]&&_0x2c0651[_0xca68('0x32')]!==_0xca68('0x6c')&&_0x2c0651[_0xca68('0x32')]!=='custom_dropdown';});return{'count':_0x1ffa11[_0xca68('0x3a')],'rows':_[_0xca68('0x2e')](_0x1ffa11,function(_0x5bfb2a){return{'id':_0x5bfb2a['name'],'name':_0x5bfb2a[_0xca68('0x6d')],'custom':!_0x5bfb2a[_0xca68('0x6b')],'options':_0x5bfb2a[_0xca68('0x6e')]?_[_0xca68('0x2e')](_0x5bfb2a[_0xca68('0x6e')],function(_0x2b4679){return{'name':_[_0xca68('0x6f')](_0x2b4679),'value':_0x2b4679};}):[]};})};}})[_0xca68('0x28')](respondWithResult(_0x48678f,null))['catch'](function(_0x342093){var _0x4b515d=_0x25ce17[_0xca68('0x34')][_0xca68('0x70')]?0x1f4:_0x342093['statusCode']||0x1f4;logger[_0xca68('0x29')](_0xca68('0x71'),'getFields',_0x4b515d,JSON[_0xca68('0x72')](_0x342093));delete _0x342093['name'];if(_0x4b515d===0x191){_0x4b515d=0x190;}_0x48678f[_0xca68('0x22')](_0x4b515d)['send'](_0x25ce17['query'][_0xca68('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x342093['statusCode']}:_0x342093);});}; \ 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(_0x6cfdba,_0xfc2b46){var _0x35fa0c=function(_0x453feb){while(--_0x453feb){_0x6cfdba['push'](_0x6cfdba['shift']());}};_0x35fa0c(++_0xfc2b46);}(_0xe706,0xa3));var _0x6e70=function(_0x268c4c,_0x5cce8d){_0x268c4c=_0x268c4c-0x0;var _0x37e96e=_0xe706[_0x268c4c];return _0x37e96e;};'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 15c6b5b..6ff5026 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 _0x6a09=['lodash','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','int_freshdesk_accounts'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x6a09,0xc6));var _0x96a0=function(_0x13023b,_0x51328e){_0x13023b=_0x13023b-0x0;var _0x458326=_0x6a09[_0x13023b];return _0x458326;};'use strict';var _=require(_0x96a0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x96a0('0x1'));var fs=require('fs');var path=require(_0x96a0('0x2'));var rimraf=require(_0x96a0('0x3'));var config=require(_0x96a0('0x4'));var attributes=require(_0x96a0('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x96a0('0x6')]=function(_0x3adde4,_0x486c60){return _0x3adde4[_0x96a0('0x7')]('FreshdeskAccount',attributes,{'tableName':_0x96a0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf433=['bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','api','moment'];(function(_0x43c2f1,_0x1fcb52){var _0xfcc3a5=function(_0x5be31d){while(--_0x5be31d){_0x43c2f1['push'](_0x43c2f1['shift']());}};_0xfcc3a5(++_0x1fcb52);}(_0xf433,0x169));var _0x3f43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf433[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3f43('0x0'));var moment=require(_0x3f43('0x1'));var BPromise=require(_0x3f43('0x2'));var rp=require(_0x3f43('0x3'));var fs=require('fs');var path=require(_0x3f43('0x4'));var rimraf=require('rimraf');var config=require(_0x3f43('0x5'));var attributes=require(_0x3f43('0x6'));var integrations=require(_0x3f43('0x7'));module['exports']=function(_0x2688e8,_0x2afc8c){return _0x2688e8[_0x3f43('0x8')](_0x3f43('0x9'),attributes,{'tableName':_0x3f43('0xa'),'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 736d346..f7b2a61 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 _0x1093=['info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FreshdeskAccount','findAll','options','where','attributes','limit','include','model','map','GetFreshdeskAccount','ShowFreshdeskAccount','find'];(function(_0x355692,_0x1ad1ac){var _0x270884=function(_0x5253b8){while(--_0x5253b8){_0x355692['push'](_0x355692['shift']());}};_0x270884(++_0x1ad1ac);}(_0x1093,0x1c8));var _0x3109=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x1093[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x3109('0x0'));var util=require(_0x3109('0x1'));var moment=require(_0x3109('0x2'));var BPromise=require(_0x3109('0x3'));var rs=require(_0x3109('0x4'));var fs=require('fs');var Redis=require(_0x3109('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3109('0x6'));var logger=require(_0x3109('0x7'))(_0x3109('0x8'));var config=require(_0x3109('0x9'));var jayson=require(_0x3109('0xa'));var client=jayson['client'][_0x3109('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8b1e13,_0x2f7e68,_0x48a6f9){return new BPromise(function(_0x3a1543,_0x2fdb78){return client['request'](_0x8b1e13,_0x48a6f9)[_0x3109('0xc')](function(_0x39dc41){logger['info'](_0x3109('0xd'),_0x2f7e68,_0x3109('0xe'));logger[_0x3109('0xf')](_0x3109('0x10'),_0x2f7e68,'request\x20sent',JSON[_0x3109('0x11')](_0x39dc41));if(_0x39dc41[_0x3109('0x12')]){if(_0x39dc41[_0x3109('0x12')]['code']===0x1f4){logger[_0x3109('0x12')](_0x3109('0xd'),_0x2f7e68,_0x39dc41[_0x3109('0x12')][_0x3109('0x13')]);return _0x2fdb78(_0x39dc41[_0x3109('0x12')]['message']);}logger[_0x3109('0x12')](_0x3109('0xd'),_0x2f7e68,_0x39dc41[_0x3109('0x12')]['message']);return _0x3a1543(_0x39dc41[_0x3109('0x12')]['message']);}else{logger['info'](_0x3109('0xd'),_0x2f7e68,_0x3109('0xe'));_0x3a1543(_0x39dc41[_0x3109('0x14')][_0x3109('0x13')]);}})[_0x3109('0x15')](function(_0x1684fd){logger[_0x3109('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x2f7e68,_0x1684fd);_0x2fdb78(_0x1684fd);});});}exports['GetFreshdeskAccount']=function(_0x4840a9){var _0x40af6c=this;return new Promise(function(_0x1e622e,_0x52f04d){return db[_0x3109('0x16')][_0x3109('0x17')]({'raw':_0x4840a9[_0x3109('0x18')]?_0x4840a9[_0x3109('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4840a9[_0x3109('0x18')]?_0x4840a9['options'][_0x3109('0x19')]||null:null,'attributes':_0x4840a9['options']?_0x4840a9[_0x3109('0x18')][_0x3109('0x1a')]||null:null,'limit':_0x4840a9[_0x3109('0x18')]?_0x4840a9[_0x3109('0x18')][_0x3109('0x1b')]||null:null,'include':_0x4840a9[_0x3109('0x18')]?_0x4840a9[_0x3109('0x18')]['include']?_['map'](_0x4840a9[_0x3109('0x18')][_0x3109('0x1c')],function(_0x1831ce){return{'model':db[_0x1831ce[_0x3109('0x1d')]],'as':_0x1831ce['as'],'attributes':_0x1831ce['attributes'],'include':_0x1831ce[_0x3109('0x1c')]?_[_0x3109('0x1e')](_0x1831ce[_0x3109('0x1c')],function(_0x1d1717){return{'model':db[_0x1d1717[_0x3109('0x1d')]],'as':_0x1d1717['as'],'attributes':_0x1d1717[_0x3109('0x1a')],'include':_0x1d1717['include']?_[_0x3109('0x1e')](_0x1d1717[_0x3109('0x1c')],function(_0x435bd1){return{'model':db[_0x435bd1[_0x3109('0x1d')]],'as':_0x435bd1['as'],'attributes':_0x435bd1[_0x3109('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3109('0xc')](function(_0x307c38){logger['info'](_0x3109('0x1f'),_0x4840a9);logger[_0x3109('0xf')](_0x3109('0x1f'),_0x4840a9,JSON[_0x3109('0x11')](_0x307c38));_0x1e622e(_0x307c38);})[_0x3109('0x15')](function(_0x1a9259){logger['error'](_0x3109('0x1f'),_0x1a9259[_0x3109('0x13')],_0x4840a9);_0x52f04d(_0x40af6c[_0x3109('0x12')](0x1f4,_0x1a9259[_0x3109('0x13')]));});});};exports[_0x3109('0x20')]=function(_0x1181b6){var _0xd5e08b=this;return new Promise(function(_0x396fec,_0x447ea1){return db['FreshdeskAccount'][_0x3109('0x21')]({'raw':_0x1181b6[_0x3109('0x18')]?_0x1181b6[_0x3109('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1181b6[_0x3109('0x18')]?_0x1181b6[_0x3109('0x18')][_0x3109('0x19')]||null:null,'attributes':_0x1181b6[_0x3109('0x18')]?_0x1181b6['options'][_0x3109('0x1a')]||null:null,'include':_0x1181b6[_0x3109('0x18')]?_0x1181b6['options'][_0x3109('0x1c')]?_[_0x3109('0x1e')](_0x1181b6[_0x3109('0x18')][_0x3109('0x1c')],function(_0x1e7451){return{'model':db[_0x1e7451[_0x3109('0x1d')]],'as':_0x1e7451['as'],'attributes':_0x1e7451['attributes'],'include':_0x1e7451[_0x3109('0x1c')]?_[_0x3109('0x1e')](_0x1e7451[_0x3109('0x1c')],function(_0x2a971c){return{'model':db[_0x2a971c['model']],'as':_0x2a971c['as'],'attributes':_0x2a971c['attributes'],'include':_0x2a971c[_0x3109('0x1c')]?_[_0x3109('0x1e')](_0x2a971c[_0x3109('0x1c')],function(_0x176e38){return{'model':db[_0x176e38[_0x3109('0x1d')]],'as':_0x176e38['as'],'attributes':_0x176e38[_0x3109('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c9e9b){logger[_0x3109('0x22')](_0x3109('0x20'),_0x1181b6);logger[_0x3109('0xf')]('ShowFreshdeskAccount',_0x1181b6,JSON[_0x3109('0x11')](_0x1c9e9b));_0x396fec(_0x1c9e9b);})[_0x3109('0x15')](function(_0x50e93f){logger[_0x3109('0x12')](_0x3109('0x20'),_0x50e93f[_0x3109('0x13')],_0x1181b6);_0x447ea1(_0xd5e08b[_0x3109('0x12')](0x1f4,_0x50e93f[_0x3109('0x13')]));});});}; \ No newline at end of file +var _0x06e4=['message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x41e7cc,_0x3e893e){var _0x4a79cf=function(_0x2056d7){while(--_0x2056d7){_0x41e7cc['push'](_0x41e7cc['shift']());}};_0x4a79cf(++_0x3e893e);}(_0x06e4,0x1ef));var _0x406e=function(_0x208d39,_0x5de94f){_0x208d39=_0x208d39-0x0;var _0x3f96cb=_0x06e4[_0x208d39];return _0x3f96cb;};'use strict';var _=require('lodash');var util=require(_0x406e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x406e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x406e('0x2'))['db'];var utils=require(_0x406e('0x3'));var logger=require('../../config/logger')(_0x406e('0x4'));var config=require(_0x406e('0x5'));var jayson=require(_0x406e('0x6'));var client=jayson[_0x406e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x113983,_0x51a911,_0x2c85e0){return new BPromise(function(_0x43053e,_0x1835c0){return client[_0x406e('0x8')](_0x113983,_0x2c85e0)[_0x406e('0x9')](function(_0x42fc32){logger[_0x406e('0xa')](_0x406e('0xb'),_0x51a911,_0x406e('0xc'));logger[_0x406e('0xd')](_0x406e('0xe'),_0x51a911,_0x406e('0xc'),JSON[_0x406e('0xf')](_0x42fc32));if(_0x42fc32['error']){if(_0x42fc32[_0x406e('0x10')]['code']===0x1f4){logger[_0x406e('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x51a911,_0x42fc32['error'][_0x406e('0x11')]);return _0x1835c0(_0x42fc32[_0x406e('0x10')][_0x406e('0x11')]);}logger[_0x406e('0x10')](_0x406e('0xb'),_0x51a911,_0x42fc32[_0x406e('0x10')][_0x406e('0x11')]);return _0x43053e(_0x42fc32[_0x406e('0x10')][_0x406e('0x11')]);}else{logger[_0x406e('0xa')](_0x406e('0xb'),_0x51a911,_0x406e('0xc'));_0x43053e(_0x42fc32[_0x406e('0x12')][_0x406e('0x11')]);}})[_0x406e('0x13')](function(_0xb78768){logger[_0x406e('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x51a911,_0xb78768);_0x1835c0(_0xb78768);});});}exports[_0x406e('0x14')]=function(_0xca204c){var _0x22c094=this;return new Promise(function(_0x2d8540,_0x16c02f){return db[_0x406e('0x15')]['findAll']({'raw':_0xca204c[_0x406e('0x16')]?_0xca204c[_0x406e('0x16')][_0x406e('0x17')]===undefined?!![]:![]:!![],'where':_0xca204c[_0x406e('0x16')]?_0xca204c[_0x406e('0x16')][_0x406e('0x18')]||null:null,'attributes':_0xca204c[_0x406e('0x16')]?_0xca204c[_0x406e('0x16')][_0x406e('0x19')]||null:null,'limit':_0xca204c[_0x406e('0x16')]?_0xca204c[_0x406e('0x16')][_0x406e('0x1a')]||null:null,'include':_0xca204c['options']?_0xca204c[_0x406e('0x16')][_0x406e('0x1b')]?_[_0x406e('0x1c')](_0xca204c[_0x406e('0x16')]['include'],function(_0x5eb11e){return{'model':db[_0x5eb11e[_0x406e('0x1d')]],'as':_0x5eb11e['as'],'attributes':_0x5eb11e['attributes'],'include':_0x5eb11e['include']?_[_0x406e('0x1c')](_0x5eb11e[_0x406e('0x1b')],function(_0x3b72fa){return{'model':db[_0x3b72fa['model']],'as':_0x3b72fa['as'],'attributes':_0x3b72fa[_0x406e('0x19')],'include':_0x3b72fa[_0x406e('0x1b')]?_[_0x406e('0x1c')](_0x3b72fa['include'],function(_0x31a974){return{'model':db[_0x31a974[_0x406e('0x1d')]],'as':_0x31a974['as'],'attributes':_0x31a974[_0x406e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x406e('0x9')](function(_0x8bd788){logger[_0x406e('0xa')](_0x406e('0x14'),_0xca204c);logger[_0x406e('0xd')](_0x406e('0x14'),_0xca204c,JSON[_0x406e('0xf')](_0x8bd788));_0x2d8540(_0x8bd788);})[_0x406e('0x13')](function(_0x10e5d4){logger[_0x406e('0x10')](_0x406e('0x14'),_0x10e5d4['message'],_0xca204c);_0x16c02f(_0x22c094[_0x406e('0x10')](0x1f4,_0x10e5d4['message']));});});};exports[_0x406e('0x1e')]=function(_0x3b7eb1){var _0x20de3f=this;return new Promise(function(_0x9f7c8b,_0x37be5e){return db[_0x406e('0x15')][_0x406e('0x1f')]({'raw':_0x3b7eb1[_0x406e('0x16')]?_0x3b7eb1[_0x406e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3b7eb1[_0x406e('0x16')]?_0x3b7eb1[_0x406e('0x16')][_0x406e('0x18')]||null:null,'attributes':_0x3b7eb1[_0x406e('0x16')]?_0x3b7eb1['options']['attributes']||null:null,'include':_0x3b7eb1['options']?_0x3b7eb1['options'][_0x406e('0x1b')]?_[_0x406e('0x1c')](_0x3b7eb1[_0x406e('0x16')][_0x406e('0x1b')],function(_0x18f643){return{'model':db[_0x18f643['model']],'as':_0x18f643['as'],'attributes':_0x18f643['attributes'],'include':_0x18f643['include']?_['map'](_0x18f643['include'],function(_0x28fe13){return{'model':db[_0x28fe13['model']],'as':_0x28fe13['as'],'attributes':_0x28fe13[_0x406e('0x19')],'include':_0x28fe13[_0x406e('0x1b')]?_[_0x406e('0x1c')](_0x28fe13[_0x406e('0x1b')],function(_0x25ada3){return{'model':db[_0x25ada3[_0x406e('0x1d')]],'as':_0x25ada3['as'],'attributes':_0x25ada3[_0x406e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x406e('0x9')](function(_0x2e9b5a){logger[_0x406e('0xa')](_0x406e('0x1e'),_0x3b7eb1);logger[_0x406e('0xd')](_0x406e('0x1e'),_0x3b7eb1,JSON[_0x406e('0xf')](_0x2e9b5a));_0x9f7c8b(_0x2e9b5a);})[_0x406e('0x13')](function(_0x11d883){logger['error']('ShowFreshdeskAccount',_0x11d883[_0x406e('0x11')],_0x3b7eb1);_0x37be5e(_0x20de3f['error'](0x1f4,_0x11d883[_0x406e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 6d42004..b651179 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 _0x96f7=['isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0x96f7,0x1e1));var _0x796f=function(_0x32e77f,_0x14464d){_0x32e77f=_0x32e77f-0x0;var _0x47e651=_0x96f7[_0x32e77f];return _0x47e651;};'use strict';var multer=require(_0x796f('0x0'));var util=require(_0x796f('0x1'));var path=require('path');var timeout=require(_0x796f('0x2'));var express=require(_0x796f('0x3'));var router=express[_0x796f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x796f('0x5'));var interaction=require(_0x796f('0x6'));var config=require(_0x796f('0x7'));var controller=require(_0x796f('0x8'));router[_0x796f('0x9')]('/',auth['isAuthenticated'](),controller[_0x796f('0xa')]);router[_0x796f('0x9')](_0x796f('0xb'),auth[_0x796f('0xc')](),controller[_0x796f('0xd')]);router[_0x796f('0x9')](_0x796f('0xe'),auth[_0x796f('0xc')](),controller[_0x796f('0xf')]);router['get'](_0x796f('0x10'),auth[_0x796f('0xc')](),controller[_0x796f('0x11')]);router[_0x796f('0x9')](_0x796f('0x12'),auth[_0x796f('0xc')](),controller[_0x796f('0x13')]);router[_0x796f('0x9')](_0x796f('0x14'),auth['isAuthenticated'](),controller[_0x796f('0x15')]);router['post']('/',auth[_0x796f('0xc')](),controller[_0x796f('0x16')]);router[_0x796f('0x17')]('/:id/tags',auth[_0x796f('0xc')](),controller['setTags']);router[_0x796f('0x18')]('/:id',auth[_0x796f('0xc')](),controller[_0x796f('0x19')]);router[_0x796f('0x1a')](_0x796f('0xb'),auth[_0x796f('0xc')](),controller[_0x796f('0x1b')]);module[_0x796f('0x1c')]=router; \ No newline at end of file +var _0x40e6=['./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x40e6,0x1d7));var _0x640e=function(_0x4e82ff,_0x3cbf4b){_0x4e82ff=_0x4e82ff-0x0;var _0x495205=_0x40e6[_0x4e82ff];return _0x495205;};'use strict';var multer=require(_0x640e('0x0'));var util=require(_0x640e('0x1'));var path=require('path');var timeout=require(_0x640e('0x2'));var express=require(_0x640e('0x3'));var router=express[_0x640e('0x4')]();var fs_extra=require(_0x640e('0x5'));var auth=require(_0x640e('0x6'));var interaction=require(_0x640e('0x7'));var config=require(_0x640e('0x8'));var controller=require(_0x640e('0x9'));router[_0x640e('0xa')]('/',auth[_0x640e('0xb')](),controller[_0x640e('0xc')]);router[_0x640e('0xa')]('/:id',auth[_0x640e('0xb')](),controller[_0x640e('0xd')]);router[_0x640e('0xa')](_0x640e('0xe'),auth[_0x640e('0xb')](),controller[_0x640e('0xf')]);router[_0x640e('0xa')](_0x640e('0x10'),auth['isAuthenticated'](),controller[_0x640e('0x11')]);router[_0x640e('0xa')](_0x640e('0x12'),auth[_0x640e('0xb')](),controller[_0x640e('0x13')]);router['get']('/:id/tags',auth[_0x640e('0xb')](),controller[_0x640e('0x14')]);router[_0x640e('0x15')]('/',auth['isAuthenticated'](),controller[_0x640e('0x16')]);router[_0x640e('0x15')](_0x640e('0x17'),auth[_0x640e('0xb')](),controller[_0x640e('0x18')]);router[_0x640e('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x640e('0x1a')]);router[_0x640e('0x1b')](_0x640e('0x1c'),auth[_0x640e('0xb')](),controller[_0x640e('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 922d1e6..de0cde0 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 _0x296d=['exports','STRING','sequelize'];(function(_0x805404,_0x18cb52){var _0x3b7050=function(_0x2bd1a2){while(--_0x2bd1a2){_0x805404['push'](_0x805404['shift']());}};_0x3b7050(++_0x18cb52);}(_0x296d,0xc8));var _0xd296=function(_0x52a592,_0x2926b4){_0x52a592=_0x52a592-0x0;var _0x511e55=_0x296d[_0x52a592];return _0x511e55;};'use strict';var Sequelize=require(_0xd296('0x0'));module[_0xd296('0x1')]={'name':{'type':Sequelize[_0xd296('0x2')]},'description':{'type':Sequelize[_0xd296('0x2')]}}; \ No newline at end of file +var _0x76ca=['exports','STRING','sequelize'];(function(_0x25d60d,_0x4015c8){var _0x57cfc0=function(_0xd7acc6){while(--_0xd7acc6){_0x25d60d['push'](_0x25d60d['shift']());}};_0x57cfc0(++_0x4015c8);}(_0x76ca,0xa7));var _0xa76c=function(_0x53b5da,_0x56fdad){_0x53b5da=_0x53b5da-0x0;var _0x120595=_0x76ca[_0x53b5da];return _0x120595;};'use strict';var Sequelize=require(_0xa76c('0x0'));module[_0xa76c('0x1')]={'name':{'type':Sequelize[_0xa76c('0x2')]},'description':{'type':Sequelize[_0xa76c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 7487078..60e7c86 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 _0x8beb=['fs-extra','lodash','squel','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','type','includeAll','include','findAll','rows','catch','show','params','create','body','find','getFields','findOne','FreshdeskField','options','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs'];(function(_0x155766,_0x3a07b9){var _0x11f367=function(_0x365dec){while(--_0x365dec){_0x155766['push'](_0x155766['shift']());}};_0x11f367(++_0x3a07b9);}(_0x8beb,0xa2));var _0xb8be=function(_0x576206,_0x10ddfa){_0x576206=_0x576206-0x0;var _0x219034=_0x8beb[_0x576206];return _0x219034;};'use strict';var emlformat=require(_0xb8be('0x0'));var rimraf=require(_0xb8be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8be('0x2'));var rp=require(_0xb8be('0x3'));var moment=require('moment');var BPromise=require(_0xb8be('0x4'));var Mustache=require(_0xb8be('0x5'));var util=require(_0xb8be('0x6'));var path=require(_0xb8be('0x7'));var sox=require(_0xb8be('0x8'));var csv=require('to-csv');var ejs=require(_0xb8be('0x9'));var fs=require('fs');var fs_extra=require(_0xb8be('0xa'));var _=require(_0xb8be('0xb'));var squel=require(_0xb8be('0xc'));var crypto=require('crypto');var jsforce=require(_0xb8be('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb8be('0xe'));var querystring=require(_0xb8be('0xf'));var Papa=require(_0xb8be('0x10'));var Redis=require('ioredis');var authService=require(_0xb8be('0x11'));var qs=require(_0xb8be('0x12'));var as=require(_0xb8be('0x13'));var hardwareService=require(_0xb8be('0x14'));var logger=require(_0xb8be('0x15'))('api');var utils=require(_0xb8be('0x16'));var config=require(_0xb8be('0x17'));var licenseUtil=require(_0xb8be('0x18'));var db=require(_0xb8be('0x19'))['db'];function respondWithStatusCode(_0x444f9b,_0x41afcc){_0x41afcc=_0x41afcc||0xcc;return function(_0x1e9034){if(_0x1e9034){return _0x444f9b['sendStatus'](_0x41afcc);}return _0x444f9b[_0xb8be('0x1a')](_0x41afcc)[_0xb8be('0x1b')]();};}function respondWithResult(_0xdb0222,_0x5e9232){_0x5e9232=_0x5e9232||0xc8;return function(_0x52fa54){if(_0x52fa54){return _0xdb0222[_0xb8be('0x1a')](_0x5e9232)[_0xb8be('0x1c')](_0x52fa54);}};}function respondWithFilteredResult(_0x457305,_0x535cef){return function(_0x253faf){if(_0x253faf){var _0x5c233f=typeof _0x535cef[_0xb8be('0x1d')]===_0xb8be('0x1e')&&typeof _0x535cef[_0xb8be('0x1f')]===_0xb8be('0x1e');var _0x53a63c=_0x253faf[_0xb8be('0x20')];var _0x45cfd5=_0x5c233f?0x0:_0x535cef[_0xb8be('0x1d')];var _0x501544=_0x5c233f?_0x253faf[_0xb8be('0x20')]:_0x535cef[_0xb8be('0x1d')]+_0x535cef[_0xb8be('0x1f')];var _0x3c5ea6;if(_0x501544>=_0x53a63c){_0x501544=_0x53a63c;_0x3c5ea6=0xc8;}else{_0x3c5ea6=0xce;}_0x457305[_0xb8be('0x1a')](_0x3c5ea6);return _0x457305[_0xb8be('0x21')](_0xb8be('0x22'),_0x45cfd5+'-'+_0x501544+'/'+_0x53a63c)[_0xb8be('0x1c')](_0x253faf);}return null;};}function patchUpdates(_0x786e22){return function(_0xe1f41a){try{jsonpatch[_0xb8be('0x23')](_0xe1f41a,_0x786e22,!![]);}catch(_0x475bc2){return BPromise[_0xb8be('0x24')](_0x475bc2);}return _0xe1f41a[_0xb8be('0x25')]();};}function saveUpdates(_0x5bd750,_0x42afe8){return function(_0x29ee64){if(_0x29ee64){return _0x29ee64[_0xb8be('0x26')](_0x5bd750)[_0xb8be('0x27')](function(_0x358671){return _0x358671;});}return null;};}function removeEntity(_0x4665e2,_0x5cc065){return function(_0x4277a8){if(_0x4277a8){return _0x4277a8[_0xb8be('0x28')]()[_0xb8be('0x27')](function(){_0x4665e2[_0xb8be('0x1a')](0xcc)[_0xb8be('0x1b')]();});}};}function handleEntityNotFound(_0x2fdbe,_0x12c715){return function(_0x2dfce3){if(!_0x2dfce3){_0x2fdbe[_0xb8be('0x29')](0x194);}return _0x2dfce3;};}function handleError(_0x4c1ab9,_0x379a02){_0x379a02=_0x379a02||0x1f4;return function(_0x243092){logger[_0xb8be('0x2a')](_0x243092['stack']);if(_0x243092[_0xb8be('0x2b')]){delete _0x243092['name'];}_0x4c1ab9[_0xb8be('0x1a')](_0x379a02)[_0xb8be('0x2c')](_0x243092);};}exports[_0xb8be('0x2d')]=function(_0x3b7f86,_0x5de05c){var _0x4b0a24={},_0x3deaa6={},_0x2ee285={'count':0x0,'rows':[]};var _0x281d7f=_[_0xb8be('0x2e')](db[_0xb8be('0x2f')][_0xb8be('0x30')],function(_0x454075){return{'name':_0x454075['fieldName'],'type':_0x454075['type'][_0xb8be('0x31')]};});_0x3deaa6[_0xb8be('0x32')]=_['map'](_0x281d7f,'name');_0x3deaa6['query']=_[_0xb8be('0x33')](_0x3b7f86[_0xb8be('0x34')]);_0x3deaa6['filters']=_[_0xb8be('0x35')](_0x3deaa6[_0xb8be('0x32')],_0x3deaa6[_0xb8be('0x34')]);_0x4b0a24['attributes']=_[_0xb8be('0x35')](_0x3deaa6[_0xb8be('0x32')],qs[_0xb8be('0x36')](_0x3b7f86[_0xb8be('0x34')][_0xb8be('0x36')]));_0x4b0a24[_0xb8be('0x37')]=_0x4b0a24[_0xb8be('0x37')][_0xb8be('0x38')]?_0x4b0a24[_0xb8be('0x37')]:_0x3deaa6[_0xb8be('0x32')];if(!_0x3b7f86[_0xb8be('0x34')][_0xb8be('0x39')](_0xb8be('0x3a'))){_0x4b0a24[_0xb8be('0x1f')]=qs[_0xb8be('0x1f')](_0x3b7f86['query'][_0xb8be('0x1f')]);_0x4b0a24['offset']=qs[_0xb8be('0x1d')](_0x3b7f86[_0xb8be('0x34')][_0xb8be('0x1d')]);}_0x4b0a24[_0xb8be('0x3b')]=qs['sort'](_0x3b7f86[_0xb8be('0x34')][_0xb8be('0x3c')]);_0x4b0a24['where']=qs['filters'](_[_0xb8be('0x3d')](_0x3b7f86['query'],_0x3deaa6[_0xb8be('0x3e')]),_0x281d7f);if(_0x3b7f86[_0xb8be('0x34')][_0xb8be('0x3f')]){_0x4b0a24['where']=_[_0xb8be('0x40')](_0x4b0a24[_0xb8be('0x41')],{'$or':_['map'](_0x281d7f,function(_0x394e12){if(_0x394e12[_0xb8be('0x42')]!=='VIRTUAL'){var _0x311c38={};_0x311c38[_0x394e12['name']]={'$like':'%'+_0x3b7f86[_0xb8be('0x34')][_0xb8be('0x3f')]+'%'};return _0x311c38;}})});}_0x4b0a24=_[_0xb8be('0x40')]({},_0x4b0a24,_0x3b7f86['options']);var _0x1ec993={'where':_0x4b0a24['where']};return db[_0xb8be('0x2f')][_0xb8be('0x20')](_0x1ec993)[_0xb8be('0x27')](function(_0x5be848){_0x2ee285[_0xb8be('0x20')]=_0x5be848;if(_0x3b7f86['query'][_0xb8be('0x43')]){_0x4b0a24[_0xb8be('0x44')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xb8be('0x45')](_0x4b0a24);})[_0xb8be('0x27')](function(_0x383334){_0x2ee285[_0xb8be('0x46')]=_0x383334;return _0x2ee285;})['then'](respondWithFilteredResult(_0x5de05c,_0x4b0a24))[_0xb8be('0x47')](handleError(_0x5de05c,null));};exports[_0xb8be('0x48')]=function(_0x1e9895,_0x4c7bb1){var _0x3e1e6e={'raw':![],'where':{'id':_0x1e9895[_0xb8be('0x49')]['id']}},_0xe7bc7b={};_0xe7bc7b[_0xb8be('0x32')]=_[_0xb8be('0x33')](db[_0xb8be('0x2f')][_0xb8be('0x30')]);_0xe7bc7b['query']=_[_0xb8be('0x33')](_0x1e9895[_0xb8be('0x34')]);_0xe7bc7b[_0xb8be('0x3e')]=_[_0xb8be('0x35')](_0xe7bc7b[_0xb8be('0x32')],_0xe7bc7b[_0xb8be('0x34')]);_0x3e1e6e[_0xb8be('0x37')]=_[_0xb8be('0x35')](_0xe7bc7b[_0xb8be('0x32')],qs[_0xb8be('0x36')](_0x1e9895[_0xb8be('0x34')][_0xb8be('0x36')]));_0x3e1e6e[_0xb8be('0x37')]=_0x3e1e6e[_0xb8be('0x37')][_0xb8be('0x38')]?_0x3e1e6e[_0xb8be('0x37')]:_0xe7bc7b['model'];if(_0x1e9895[_0xb8be('0x34')][_0xb8be('0x43')]){_0x3e1e6e['include']=[{'all':!![]}];}_0x3e1e6e=_[_0xb8be('0x40')]({},_0x3e1e6e,_0x1e9895['options']);return db[_0xb8be('0x2f')]['find'](_0x3e1e6e)[_0xb8be('0x27')](handleEntityNotFound(_0x4c7bb1,null))[_0xb8be('0x27')](respondWithResult(_0x4c7bb1,null))[_0xb8be('0x47')](handleError(_0x4c7bb1,null));};exports['create']=function(_0xeacf10,_0x511e7b){return db[_0xb8be('0x2f')][_0xb8be('0x4a')](_0xeacf10['body'],{})[_0xb8be('0x27')](respondWithResult(_0x511e7b,0xc9))[_0xb8be('0x47')](handleError(_0x511e7b,null));};exports[_0xb8be('0x26')]=function(_0xfb83c1,_0x262bda){if(_0xfb83c1['body']['id']){delete _0xfb83c1[_0xb8be('0x4b')]['id'];}return db[_0xb8be('0x2f')][_0xb8be('0x4c')]({'where':{'id':_0xfb83c1[_0xb8be('0x49')]['id']}})[_0xb8be('0x27')](handleEntityNotFound(_0x262bda,null))['then'](saveUpdates(_0xfb83c1[_0xb8be('0x4b')],null))[_0xb8be('0x27')](respondWithResult(_0x262bda,null))[_0xb8be('0x47')](handleError(_0x262bda,null));};exports[_0xb8be('0x28')]=function(_0x8459db,_0x37f2fb){return db[_0xb8be('0x2f')][_0xb8be('0x4c')]({'where':{'id':_0x8459db[_0xb8be('0x49')]['id']}})[_0xb8be('0x27')](handleEntityNotFound(_0x37f2fb,null))[_0xb8be('0x27')](removeEntity(_0x37f2fb,null))[_0xb8be('0x47')](handleError(_0x37f2fb,null));};exports[_0xb8be('0x4d')]=function(_0x66c7f1,_0x4c31b3,_0x31385c){var _0x13547f={};var _0x314e05={};var _0x14d74c;var _0x47d958;return db[_0xb8be('0x2f')][_0xb8be('0x4e')]({'where':{'id':_0x66c7f1[_0xb8be('0x49')]['id']}})[_0xb8be('0x27')](handleEntityNotFound(_0x4c31b3,null))['then'](function(_0x51272a){if(_0x51272a){_0x14d74c=_0x51272a;_0x314e05['model']=_[_0xb8be('0x33')](db[_0xb8be('0x4f')][_0xb8be('0x30')]);_0x314e05[_0xb8be('0x34')]=_['keys'](_0x66c7f1[_0xb8be('0x34')]);_0x314e05['filters']=_[_0xb8be('0x35')](_0x314e05[_0xb8be('0x32')],_0x314e05[_0xb8be('0x34')]);_0x13547f[_0xb8be('0x37')]=_[_0xb8be('0x35')](_0x314e05[_0xb8be('0x32')],qs[_0xb8be('0x36')](_0x66c7f1['query']['fields']));_0x13547f['attributes']=_0x13547f[_0xb8be('0x37')][_0xb8be('0x38')]?_0x13547f['attributes']:_0x314e05[_0xb8be('0x32')];_0x13547f['order']=qs[_0xb8be('0x3c')](_0x66c7f1[_0xb8be('0x34')][_0xb8be('0x3c')]);_0x13547f[_0xb8be('0x41')]=qs[_0xb8be('0x3e')](_[_0xb8be('0x3d')](_0x66c7f1[_0xb8be('0x34')],_0x314e05[_0xb8be('0x3e')]));if(_0x66c7f1[_0xb8be('0x34')][_0xb8be('0x3f')]){_0x13547f[_0xb8be('0x41')]=_[_0xb8be('0x40')](_0x13547f[_0xb8be('0x41')],{'$or':_['map'](_0x13547f[_0xb8be('0x37')],function(_0x303aff){var _0x569315={};_0x569315[_0x303aff]={'$like':'%'+_0x66c7f1[_0xb8be('0x34')][_0xb8be('0x3f')]+'%'};return _0x569315;})});}_0x13547f=_['merge']({},_0x13547f,_0x66c7f1[_0xb8be('0x50')]);return _0x14d74c[_0xb8be('0x4d')](_0x13547f);}})[_0xb8be('0x27')](function(_0x11e1dd){if(_0x11e1dd){_0x47d958=_0x11e1dd[_0xb8be('0x38')];if(!_0x66c7f1['query']['hasOwnProperty'](_0xb8be('0x3a'))){_0x13547f[_0xb8be('0x1f')]=qs['limit'](_0x66c7f1[_0xb8be('0x34')][_0xb8be('0x1f')]);_0x13547f[_0xb8be('0x1d')]=qs['offset'](_0x66c7f1[_0xb8be('0x34')]['offset']);}return _0x14d74c[_0xb8be('0x4d')](_0x13547f);}})[_0xb8be('0x27')](function(_0x588ff7){if(_0x588ff7){return _0x588ff7?{'count':_0x47d958,'rows':_0x588ff7}:null;}})['then'](respondWithResult(_0x4c31b3,null))[_0xb8be('0x47')](handleError(_0x4c31b3,null));};exports['getSubjects']=function(_0x5ac4c5,_0x17d7d7,_0x33dfdc){var _0x3a8703={};var _0x19ed30={};var _0x4c1633;var _0x267627;return db[_0xb8be('0x2f')]['findOne']({'where':{'id':_0x5ac4c5[_0xb8be('0x49')]['id']}})['then'](handleEntityNotFound(_0x17d7d7,null))[_0xb8be('0x27')](function(_0x1b7f4f){if(_0x1b7f4f){_0x4c1633=_0x1b7f4f;_0x19ed30[_0xb8be('0x32')]=_[_0xb8be('0x33')](db['FreshdeskField'][_0xb8be('0x30')]);_0x19ed30[_0xb8be('0x34')]=_[_0xb8be('0x33')](_0x5ac4c5[_0xb8be('0x34')]);_0x19ed30[_0xb8be('0x3e')]=_['intersection'](_0x19ed30[_0xb8be('0x32')],_0x19ed30[_0xb8be('0x34')]);_0x3a8703[_0xb8be('0x37')]=_[_0xb8be('0x35')](_0x19ed30[_0xb8be('0x32')],qs[_0xb8be('0x36')](_0x5ac4c5[_0xb8be('0x34')]['fields']));_0x3a8703[_0xb8be('0x37')]=_0x3a8703[_0xb8be('0x37')][_0xb8be('0x38')]?_0x3a8703[_0xb8be('0x37')]:_0x19ed30['model'];_0x3a8703[_0xb8be('0x3b')]=qs[_0xb8be('0x3c')](_0x5ac4c5['query'][_0xb8be('0x3c')]);_0x3a8703[_0xb8be('0x41')]=qs[_0xb8be('0x3e')](_[_0xb8be('0x3d')](_0x5ac4c5[_0xb8be('0x34')],_0x19ed30['filters']));if(_0x5ac4c5['query'][_0xb8be('0x3f')]){_0x3a8703[_0xb8be('0x41')]=_['merge'](_0x3a8703[_0xb8be('0x41')],{'$or':_[_0xb8be('0x2e')](_0x3a8703[_0xb8be('0x37')],function(_0x10fa9a){var _0x498e91={};_0x498e91[_0x10fa9a]={'$like':'%'+_0x5ac4c5[_0xb8be('0x34')][_0xb8be('0x3f')]+'%'};return _0x498e91;})});}_0x3a8703=_[_0xb8be('0x40')]({},_0x3a8703,_0x5ac4c5[_0xb8be('0x50')]);return _0x4c1633[_0xb8be('0x51')](_0x3a8703);}})[_0xb8be('0x27')](function(_0x2de122){if(_0x2de122){_0x267627=_0x2de122[_0xb8be('0x38')];if(!_0x5ac4c5[_0xb8be('0x34')][_0xb8be('0x39')]('nolimit')){_0x3a8703[_0xb8be('0x1f')]=qs['limit'](_0x5ac4c5[_0xb8be('0x34')][_0xb8be('0x1f')]);_0x3a8703[_0xb8be('0x1d')]=qs[_0xb8be('0x1d')](_0x5ac4c5['query']['offset']);}return _0x4c1633['getSubjects'](_0x3a8703);}})[_0xb8be('0x27')](function(_0x441f97){if(_0x441f97){return _0x441f97?{'count':_0x267627,'rows':_0x441f97}:null;}})[_0xb8be('0x27')](respondWithResult(_0x17d7d7,null))[_0xb8be('0x47')](handleError(_0x17d7d7,null));};exports['getDescriptions']=function(_0x335ce0,_0xd84374,_0x442060){var _0x5ecc77={};var _0x2fc91a={};var _0x4da959;var _0x576c2e;return db[_0xb8be('0x2f')][_0xb8be('0x4e')]({'where':{'id':_0x335ce0[_0xb8be('0x49')]['id']}})[_0xb8be('0x27')](handleEntityNotFound(_0xd84374,null))[_0xb8be('0x27')](function(_0x8d7127){if(_0x8d7127){_0x4da959=_0x8d7127;_0x2fc91a['model']=_[_0xb8be('0x33')](db[_0xb8be('0x4f')][_0xb8be('0x30')]);_0x2fc91a[_0xb8be('0x34')]=_[_0xb8be('0x33')](_0x335ce0['query']);_0x2fc91a['filters']=_['intersection'](_0x2fc91a[_0xb8be('0x32')],_0x2fc91a[_0xb8be('0x34')]);_0x5ecc77[_0xb8be('0x37')]=_[_0xb8be('0x35')](_0x2fc91a[_0xb8be('0x32')],qs[_0xb8be('0x36')](_0x335ce0[_0xb8be('0x34')][_0xb8be('0x36')]));_0x5ecc77[_0xb8be('0x37')]=_0x5ecc77[_0xb8be('0x37')][_0xb8be('0x38')]?_0x5ecc77[_0xb8be('0x37')]:_0x2fc91a[_0xb8be('0x32')];_0x5ecc77[_0xb8be('0x3b')]=qs[_0xb8be('0x3c')](_0x335ce0[_0xb8be('0x34')][_0xb8be('0x3c')]);_0x5ecc77[_0xb8be('0x41')]=qs['filters'](_['pick'](_0x335ce0[_0xb8be('0x34')],_0x2fc91a['filters']));if(_0x335ce0[_0xb8be('0x34')][_0xb8be('0x3f')]){_0x5ecc77[_0xb8be('0x41')]=_[_0xb8be('0x40')](_0x5ecc77[_0xb8be('0x41')],{'$or':_['map'](_0x5ecc77['attributes'],function(_0x167cc6){var _0x33b169={};_0x33b169[_0x167cc6]={'$like':'%'+_0x335ce0[_0xb8be('0x34')][_0xb8be('0x3f')]+'%'};return _0x33b169;})});}_0x5ecc77=_[_0xb8be('0x40')]({},_0x5ecc77,_0x335ce0[_0xb8be('0x50')]);return _0x4da959[_0xb8be('0x52')](_0x5ecc77);}})[_0xb8be('0x27')](function(_0x1ec78d){if(_0x1ec78d){_0x576c2e=_0x1ec78d[_0xb8be('0x38')];if(!_0x335ce0[_0xb8be('0x34')]['hasOwnProperty'](_0xb8be('0x3a'))){_0x5ecc77[_0xb8be('0x1f')]=qs[_0xb8be('0x1f')](_0x335ce0[_0xb8be('0x34')][_0xb8be('0x1f')]);_0x5ecc77[_0xb8be('0x1d')]=qs[_0xb8be('0x1d')](_0x335ce0[_0xb8be('0x34')][_0xb8be('0x1d')]);}return _0x4da959['getDescriptions'](_0x5ecc77);}})[_0xb8be('0x27')](function(_0x4220e1){if(_0x4220e1){return _0x4220e1?{'count':_0x576c2e,'rows':_0x4220e1}:null;}})[_0xb8be('0x27')](respondWithResult(_0xd84374,null))[_0xb8be('0x47')](handleError(_0xd84374,null));};exports[_0xb8be('0x53')]=function(_0x1fd29c,_0x495650,_0x20b341){var _0x5d892a={};var _0x2c00cb={};var _0x1695f3;var _0x4f5e7e;return db[_0xb8be('0x2f')][_0xb8be('0x4e')]({'where':{'id':_0x1fd29c[_0xb8be('0x49')]['id']}})[_0xb8be('0x27')](handleEntityNotFound(_0x495650,null))['then'](function(_0x19a14e){if(_0x19a14e){_0x1695f3=_0x19a14e;_0x2c00cb[_0xb8be('0x32')]=_[_0xb8be('0x33')](db['Tag'][_0xb8be('0x30')]);_0x2c00cb[_0xb8be('0x34')]=_[_0xb8be('0x33')](_0x1fd29c[_0xb8be('0x34')]);_0x2c00cb['filters']=_['intersection'](_0x2c00cb['model'],_0x2c00cb[_0xb8be('0x34')]);_0x5d892a[_0xb8be('0x37')]=_[_0xb8be('0x35')](_0x2c00cb[_0xb8be('0x32')],qs[_0xb8be('0x36')](_0x1fd29c[_0xb8be('0x34')][_0xb8be('0x36')]));_0x5d892a['attributes']=_0x5d892a[_0xb8be('0x37')]['length']?_0x5d892a[_0xb8be('0x37')]:_0x2c00cb[_0xb8be('0x32')];_0x5d892a['order']=qs[_0xb8be('0x3c')](_0x1fd29c[_0xb8be('0x34')]['sort']);_0x5d892a['where']=qs['filters'](_[_0xb8be('0x3d')](_0x1fd29c[_0xb8be('0x34')],_0x2c00cb['filters']));if(_0x1fd29c[_0xb8be('0x34')][_0xb8be('0x3f')]){_0x5d892a['where']=_[_0xb8be('0x40')](_0x5d892a[_0xb8be('0x41')],{'$or':_[_0xb8be('0x2e')](_0x5d892a[_0xb8be('0x37')],function(_0x2b6f46){var _0x2c6e4b={};_0x2c6e4b[_0x2b6f46]={'$like':'%'+_0x1fd29c['query'][_0xb8be('0x3f')]+'%'};return _0x2c6e4b;})});}_0x5d892a=_[_0xb8be('0x40')]({},_0x5d892a,_0x1fd29c[_0xb8be('0x50')]);return _0x1695f3['getTags'](_0x5d892a);}})['then'](function(_0x48bd59){if(_0x48bd59){_0x4f5e7e=_0x48bd59['length'];if(!_0x1fd29c[_0xb8be('0x34')][_0xb8be('0x39')]('nolimit')){_0x5d892a['limit']=qs[_0xb8be('0x1f')](_0x1fd29c[_0xb8be('0x34')]['limit']);_0x5d892a[_0xb8be('0x1d')]=qs['offset'](_0x1fd29c[_0xb8be('0x34')][_0xb8be('0x1d')]);}return _0x1695f3[_0xb8be('0x53')](_0x5d892a);}})['then'](function(_0x3dbf76){if(_0x3dbf76){return _0x3dbf76?{'count':_0x4f5e7e,'rows':_0x3dbf76}:null;}})['then'](respondWithResult(_0x495650,null))[_0xb8be('0x47')](handleError(_0x495650,null));};exports[_0xb8be('0x54')]=function(_0x3d6973,_0x19e5b6,_0x5a6a0d){if(_0x3d6973[_0xb8be('0x4b')]['id']){delete _0x3d6973[_0xb8be('0x4b')]['id'];}return db[_0xb8be('0x2f')]['findOne']({'where':{'id':_0x3d6973[_0xb8be('0x49')]['id']}})[_0xb8be('0x27')](handleEntityNotFound(_0x19e5b6,null))[_0xb8be('0x27')](function(_0x248ec1){if(_0x248ec1){return _0x248ec1[_0xb8be('0x54')](_0x3d6973[_0xb8be('0x4b')][_0xb8be('0x55')]||[]);}return null;})[_0xb8be('0x27')](respondWithResult(_0x19e5b6,null))[_0xb8be('0x47')](handleError(_0x19e5b6,null));}; \ No newline at end of file +var _0x1deb=['status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','filter','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','getFields','findOne','pick','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x43a380,_0xac5878){var _0x39a758=function(_0x1a2f76){while(--_0x1a2f76){_0x43a380['push'](_0x43a380['shift']());}};_0x39a758(++_0xac5878);}(_0x1deb,0x1c4));var _0xb1de=function(_0xb891ca,_0x36ce0d){_0xb891ca=_0xb891ca-0x0;var _0x37e48e=_0x1deb[_0xb891ca];return _0x37e48e;};'use strict';var emlformat=require(_0xb1de('0x0'));var rimraf=require(_0xb1de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1de('0x2'));var rp=require('request-promise');var moment=require(_0xb1de('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb1de('0x4'));var util=require(_0xb1de('0x5'));var path=require(_0xb1de('0x6'));var sox=require(_0xb1de('0x7'));var csv=require(_0xb1de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1de('0x9'));var squel=require(_0xb1de('0xa'));var crypto=require(_0xb1de('0xb'));var jsforce=require(_0xb1de('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb1de('0xd'));var Papa=require(_0xb1de('0xe'));var Redis=require('ioredis');var authService=require(_0xb1de('0xf'));var qs=require(_0xb1de('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1de('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xb1de('0x12'));var licenseUtil=require(_0xb1de('0x13'));var db=require(_0xb1de('0x14'))['db'];function respondWithStatusCode(_0x166020,_0x356cc5){_0x356cc5=_0x356cc5||0xcc;return function(_0x25f5ee){if(_0x25f5ee){return _0x166020[_0xb1de('0x15')](_0x356cc5);}return _0x166020[_0xb1de('0x16')](_0x356cc5)[_0xb1de('0x17')]();};}function respondWithResult(_0x33235c,_0x58ab8e){_0x58ab8e=_0x58ab8e||0xc8;return function(_0x1501fc){if(_0x1501fc){return _0x33235c['status'](_0x58ab8e)[_0xb1de('0x18')](_0x1501fc);}};}function respondWithFilteredResult(_0x35580d,_0x45d27d){return function(_0x562bcf){if(_0x562bcf){var _0x55594f=typeof _0x45d27d[_0xb1de('0x19')]===_0xb1de('0x1a')&&typeof _0x45d27d['limit']===_0xb1de('0x1a');var _0x2e5b5e=_0x562bcf['count'];var _0x332bd6=_0x55594f?0x0:_0x45d27d[_0xb1de('0x19')];var _0x28c98c=_0x55594f?_0x562bcf[_0xb1de('0x1b')]:_0x45d27d[_0xb1de('0x19')]+_0x45d27d['limit'];var _0x4476eb;if(_0x28c98c>=_0x2e5b5e){_0x28c98c=_0x2e5b5e;_0x4476eb=0xc8;}else{_0x4476eb=0xce;}_0x35580d[_0xb1de('0x16')](_0x4476eb);return _0x35580d[_0xb1de('0x1c')]('Content-Range',_0x332bd6+'-'+_0x28c98c+'/'+_0x2e5b5e)[_0xb1de('0x18')](_0x562bcf);}return null;};}function patchUpdates(_0x5bf3a9){return function(_0x5bef9a){try{jsonpatch[_0xb1de('0x1d')](_0x5bef9a,_0x5bf3a9,!![]);}catch(_0x386196){return BPromise[_0xb1de('0x1e')](_0x386196);}return _0x5bef9a[_0xb1de('0x1f')]();};}function saveUpdates(_0x22c1de,_0x4d7c99){return function(_0x47f297){if(_0x47f297){return _0x47f297[_0xb1de('0x20')](_0x22c1de)[_0xb1de('0x21')](function(_0x371ac8){return _0x371ac8;});}return null;};}function removeEntity(_0x232f2e,_0x1cce6d){return function(_0xb78b0e){if(_0xb78b0e){return _0xb78b0e[_0xb1de('0x22')]()[_0xb1de('0x21')](function(){_0x232f2e[_0xb1de('0x16')](0xcc)[_0xb1de('0x17')]();});}};}function handleEntityNotFound(_0x28a8e8,_0x74c033){return function(_0x2c0b52){if(!_0x2c0b52){_0x28a8e8[_0xb1de('0x15')](0x194);}return _0x2c0b52;};}function handleError(_0x179943,_0xff87eb){_0xff87eb=_0xff87eb||0x1f4;return function(_0x35830a){logger['error'](_0x35830a[_0xb1de('0x23')]);if(_0x35830a['name']){delete _0x35830a[_0xb1de('0x24')];}_0x179943[_0xb1de('0x16')](_0xff87eb)[_0xb1de('0x25')](_0x35830a);};}exports[_0xb1de('0x26')]=function(_0x30daee,_0x3ee225){var _0x15d47d={},_0x168675={},_0x56f9e2={'count':0x0,'rows':[]};var _0x12390e=_[_0xb1de('0x27')](db[_0xb1de('0x28')][_0xb1de('0x29')],function(_0x43763e){return{'name':_0x43763e[_0xb1de('0x2a')],'type':_0x43763e['type'][_0xb1de('0x2b')]};});_0x168675[_0xb1de('0x2c')]=_['map'](_0x12390e,_0xb1de('0x24'));_0x168675[_0xb1de('0x2d')]=_['keys'](_0x30daee[_0xb1de('0x2d')]);_0x168675[_0xb1de('0x2e')]=_[_0xb1de('0x2f')](_0x168675['model'],_0x168675[_0xb1de('0x2d')]);_0x15d47d[_0xb1de('0x30')]=_['intersection'](_0x168675[_0xb1de('0x2c')],qs[_0xb1de('0x31')](_0x30daee[_0xb1de('0x2d')][_0xb1de('0x31')]));_0x15d47d['attributes']=_0x15d47d[_0xb1de('0x30')][_0xb1de('0x32')]?_0x15d47d['attributes']:_0x168675['model'];if(!_0x30daee[_0xb1de('0x2d')][_0xb1de('0x33')](_0xb1de('0x34'))){_0x15d47d[_0xb1de('0x35')]=qs[_0xb1de('0x35')](_0x30daee[_0xb1de('0x2d')]['limit']);_0x15d47d[_0xb1de('0x19')]=qs[_0xb1de('0x19')](_0x30daee[_0xb1de('0x2d')][_0xb1de('0x19')]);}_0x15d47d[_0xb1de('0x36')]=qs['sort'](_0x30daee[_0xb1de('0x2d')][_0xb1de('0x37')]);_0x15d47d[_0xb1de('0x38')]=qs['filters'](_['pick'](_0x30daee[_0xb1de('0x2d')],_0x168675[_0xb1de('0x2e')]),_0x12390e);if(_0x30daee[_0xb1de('0x2d')]['filter']){_0x15d47d['where']=_[_0xb1de('0x39')](_0x15d47d[_0xb1de('0x38')],{'$or':_['map'](_0x12390e,function(_0xf29156){if(_0xf29156[_0xb1de('0x3a')]!=='VIRTUAL'){var _0x54afa4={};_0x54afa4[_0xf29156['name']]={'$like':'%'+_0x30daee[_0xb1de('0x2d')][_0xb1de('0x3b')]+'%'};return _0x54afa4;}})});}_0x15d47d=_[_0xb1de('0x39')]({},_0x15d47d,_0x30daee['options']);var _0x51baf8={'where':_0x15d47d['where']};return db[_0xb1de('0x28')][_0xb1de('0x1b')](_0x51baf8)[_0xb1de('0x21')](function(_0x3e01c7){_0x56f9e2[_0xb1de('0x1b')]=_0x3e01c7;if(_0x30daee[_0xb1de('0x2d')][_0xb1de('0x3c')]){_0x15d47d[_0xb1de('0x3d')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xb1de('0x3e')](_0x15d47d);})[_0xb1de('0x21')](function(_0x456343){_0x56f9e2[_0xb1de('0x3f')]=_0x456343;return _0x56f9e2;})[_0xb1de('0x21')](respondWithFilteredResult(_0x3ee225,_0x15d47d))[_0xb1de('0x40')](handleError(_0x3ee225,null));};exports['show']=function(_0x24a936,_0x57816c){var _0x10e054={'raw':![],'where':{'id':_0x24a936[_0xb1de('0x41')]['id']}},_0x565089={};_0x565089[_0xb1de('0x2c')]=_[_0xb1de('0x42')](db[_0xb1de('0x28')][_0xb1de('0x29')]);_0x565089[_0xb1de('0x2d')]=_['keys'](_0x24a936['query']);_0x565089[_0xb1de('0x2e')]=_['intersection'](_0x565089[_0xb1de('0x2c')],_0x565089[_0xb1de('0x2d')]);_0x10e054[_0xb1de('0x30')]=_[_0xb1de('0x2f')](_0x565089['model'],qs['fields'](_0x24a936[_0xb1de('0x2d')][_0xb1de('0x31')]));_0x10e054[_0xb1de('0x30')]=_0x10e054[_0xb1de('0x30')]['length']?_0x10e054[_0xb1de('0x30')]:_0x565089[_0xb1de('0x2c')];if(_0x24a936[_0xb1de('0x2d')][_0xb1de('0x3c')]){_0x10e054[_0xb1de('0x3d')]=[{'all':!![]}];}_0x10e054=_[_0xb1de('0x39')]({},_0x10e054,_0x24a936[_0xb1de('0x43')]);return db[_0xb1de('0x28')][_0xb1de('0x44')](_0x10e054)[_0xb1de('0x21')](handleEntityNotFound(_0x57816c,null))['then'](respondWithResult(_0x57816c,null))['catch'](handleError(_0x57816c,null));};exports[_0xb1de('0x45')]=function(_0x48fd18,_0x4be963){return db[_0xb1de('0x28')][_0xb1de('0x45')](_0x48fd18[_0xb1de('0x46')],{})[_0xb1de('0x21')](respondWithResult(_0x4be963,0xc9))[_0xb1de('0x40')](handleError(_0x4be963,null));};exports['update']=function(_0x53e20f,_0x18cd75){if(_0x53e20f[_0xb1de('0x46')]['id']){delete _0x53e20f[_0xb1de('0x46')]['id'];}return db[_0xb1de('0x28')]['find']({'where':{'id':_0x53e20f[_0xb1de('0x41')]['id']}})['then'](handleEntityNotFound(_0x18cd75,null))['then'](saveUpdates(_0x53e20f[_0xb1de('0x46')],null))['then'](respondWithResult(_0x18cd75,null))['catch'](handleError(_0x18cd75,null));};exports[_0xb1de('0x22')]=function(_0x41a6c0,_0x4b18dc){return db[_0xb1de('0x28')]['find']({'where':{'id':_0x41a6c0['params']['id']}})['then'](handleEntityNotFound(_0x4b18dc,null))['then'](removeEntity(_0x4b18dc,null))[_0xb1de('0x40')](handleError(_0x4b18dc,null));};exports[_0xb1de('0x47')]=function(_0x3470cd,_0x1bf6a1,_0x4178a9){var _0x21eb43={};var _0x11dd4c={};var _0x30563b;var _0x489b12;return db[_0xb1de('0x28')][_0xb1de('0x48')]({'where':{'id':_0x3470cd[_0xb1de('0x41')]['id']}})[_0xb1de('0x21')](handleEntityNotFound(_0x1bf6a1,null))[_0xb1de('0x21')](function(_0x38b39d){if(_0x38b39d){_0x30563b=_0x38b39d;_0x11dd4c[_0xb1de('0x2c')]=_[_0xb1de('0x42')](db['FreshdeskField'][_0xb1de('0x29')]);_0x11dd4c['query']=_[_0xb1de('0x42')](_0x3470cd[_0xb1de('0x2d')]);_0x11dd4c[_0xb1de('0x2e')]=_[_0xb1de('0x2f')](_0x11dd4c['model'],_0x11dd4c[_0xb1de('0x2d')]);_0x21eb43[_0xb1de('0x30')]=_[_0xb1de('0x2f')](_0x11dd4c[_0xb1de('0x2c')],qs[_0xb1de('0x31')](_0x3470cd['query'][_0xb1de('0x31')]));_0x21eb43[_0xb1de('0x30')]=_0x21eb43[_0xb1de('0x30')][_0xb1de('0x32')]?_0x21eb43[_0xb1de('0x30')]:_0x11dd4c['model'];_0x21eb43[_0xb1de('0x36')]=qs[_0xb1de('0x37')](_0x3470cd['query'][_0xb1de('0x37')]);_0x21eb43[_0xb1de('0x38')]=qs[_0xb1de('0x2e')](_[_0xb1de('0x49')](_0x3470cd[_0xb1de('0x2d')],_0x11dd4c[_0xb1de('0x2e')]));if(_0x3470cd[_0xb1de('0x2d')][_0xb1de('0x3b')]){_0x21eb43[_0xb1de('0x38')]=_['merge'](_0x21eb43[_0xb1de('0x38')],{'$or':_[_0xb1de('0x27')](_0x21eb43[_0xb1de('0x30')],function(_0x9f7251){var _0xca6895={};_0xca6895[_0x9f7251]={'$like':'%'+_0x3470cd['query'][_0xb1de('0x3b')]+'%'};return _0xca6895;})});}_0x21eb43=_[_0xb1de('0x39')]({},_0x21eb43,_0x3470cd['options']);return _0x30563b[_0xb1de('0x47')](_0x21eb43);}})['then'](function(_0x52418d){if(_0x52418d){_0x489b12=_0x52418d[_0xb1de('0x32')];if(!_0x3470cd[_0xb1de('0x2d')][_0xb1de('0x33')]('nolimit')){_0x21eb43[_0xb1de('0x35')]=qs['limit'](_0x3470cd[_0xb1de('0x2d')][_0xb1de('0x35')]);_0x21eb43['offset']=qs[_0xb1de('0x19')](_0x3470cd[_0xb1de('0x2d')][_0xb1de('0x19')]);}return _0x30563b[_0xb1de('0x47')](_0x21eb43);}})['then'](function(_0x1c8daf){if(_0x1c8daf){return _0x1c8daf?{'count':_0x489b12,'rows':_0x1c8daf}:null;}})[_0xb1de('0x21')](respondWithResult(_0x1bf6a1,null))[_0xb1de('0x40')](handleError(_0x1bf6a1,null));};exports[_0xb1de('0x4a')]=function(_0x236ffd,_0x56b9bc,_0x8b77ea){var _0x280386={};var _0x99e75c={};var _0x36f54e;var _0x8cc42;return db[_0xb1de('0x28')][_0xb1de('0x48')]({'where':{'id':_0x236ffd[_0xb1de('0x41')]['id']}})[_0xb1de('0x21')](handleEntityNotFound(_0x56b9bc,null))[_0xb1de('0x21')](function(_0x5183f2){if(_0x5183f2){_0x36f54e=_0x5183f2;_0x99e75c[_0xb1de('0x2c')]=_[_0xb1de('0x42')](db[_0xb1de('0x4b')][_0xb1de('0x29')]);_0x99e75c[_0xb1de('0x2d')]=_[_0xb1de('0x42')](_0x236ffd[_0xb1de('0x2d')]);_0x99e75c['filters']=_[_0xb1de('0x2f')](_0x99e75c[_0xb1de('0x2c')],_0x99e75c['query']);_0x280386[_0xb1de('0x30')]=_[_0xb1de('0x2f')](_0x99e75c[_0xb1de('0x2c')],qs[_0xb1de('0x31')](_0x236ffd['query'][_0xb1de('0x31')]));_0x280386[_0xb1de('0x30')]=_0x280386['attributes'][_0xb1de('0x32')]?_0x280386[_0xb1de('0x30')]:_0x99e75c[_0xb1de('0x2c')];_0x280386[_0xb1de('0x36')]=qs[_0xb1de('0x37')](_0x236ffd[_0xb1de('0x2d')][_0xb1de('0x37')]);_0x280386[_0xb1de('0x38')]=qs[_0xb1de('0x2e')](_[_0xb1de('0x49')](_0x236ffd['query'],_0x99e75c[_0xb1de('0x2e')]));if(_0x236ffd['query']['filter']){_0x280386[_0xb1de('0x38')]=_[_0xb1de('0x39')](_0x280386[_0xb1de('0x38')],{'$or':_[_0xb1de('0x27')](_0x280386['attributes'],function(_0x416a0a){var _0x2cc6be={};_0x2cc6be[_0x416a0a]={'$like':'%'+_0x236ffd['query'][_0xb1de('0x3b')]+'%'};return _0x2cc6be;})});}_0x280386=_[_0xb1de('0x39')]({},_0x280386,_0x236ffd['options']);return _0x36f54e[_0xb1de('0x4a')](_0x280386);}})['then'](function(_0x206788){if(_0x206788){_0x8cc42=_0x206788[_0xb1de('0x32')];if(!_0x236ffd[_0xb1de('0x2d')][_0xb1de('0x33')]('nolimit')){_0x280386['limit']=qs[_0xb1de('0x35')](_0x236ffd[_0xb1de('0x2d')][_0xb1de('0x35')]);_0x280386['offset']=qs[_0xb1de('0x19')](_0x236ffd['query'][_0xb1de('0x19')]);}return _0x36f54e['getSubjects'](_0x280386);}})['then'](function(_0x5328d4){if(_0x5328d4){return _0x5328d4?{'count':_0x8cc42,'rows':_0x5328d4}:null;}})['then'](respondWithResult(_0x56b9bc,null))[_0xb1de('0x40')](handleError(_0x56b9bc,null));};exports['getDescriptions']=function(_0xc21173,_0x48211f,_0x5ae423){var _0x45e568={};var _0x55b1f0={};var _0x2bf8f2;var _0x1a8723;return db[_0xb1de('0x28')][_0xb1de('0x48')]({'where':{'id':_0xc21173[_0xb1de('0x41')]['id']}})[_0xb1de('0x21')](handleEntityNotFound(_0x48211f,null))[_0xb1de('0x21')](function(_0x2cb3bd){if(_0x2cb3bd){_0x2bf8f2=_0x2cb3bd;_0x55b1f0[_0xb1de('0x2c')]=_[_0xb1de('0x42')](db[_0xb1de('0x4b')][_0xb1de('0x29')]);_0x55b1f0[_0xb1de('0x2d')]=_[_0xb1de('0x42')](_0xc21173['query']);_0x55b1f0[_0xb1de('0x2e')]=_[_0xb1de('0x2f')](_0x55b1f0[_0xb1de('0x2c')],_0x55b1f0[_0xb1de('0x2d')]);_0x45e568['attributes']=_[_0xb1de('0x2f')](_0x55b1f0['model'],qs[_0xb1de('0x31')](_0xc21173[_0xb1de('0x2d')][_0xb1de('0x31')]));_0x45e568[_0xb1de('0x30')]=_0x45e568['attributes']['length']?_0x45e568[_0xb1de('0x30')]:_0x55b1f0[_0xb1de('0x2c')];_0x45e568[_0xb1de('0x36')]=qs['sort'](_0xc21173[_0xb1de('0x2d')]['sort']);_0x45e568[_0xb1de('0x38')]=qs[_0xb1de('0x2e')](_[_0xb1de('0x49')](_0xc21173[_0xb1de('0x2d')],_0x55b1f0[_0xb1de('0x2e')]));if(_0xc21173['query'][_0xb1de('0x3b')]){_0x45e568[_0xb1de('0x38')]=_[_0xb1de('0x39')](_0x45e568[_0xb1de('0x38')],{'$or':_[_0xb1de('0x27')](_0x45e568[_0xb1de('0x30')],function(_0x1f043f){var _0x3fad4d={};_0x3fad4d[_0x1f043f]={'$like':'%'+_0xc21173[_0xb1de('0x2d')]['filter']+'%'};return _0x3fad4d;})});}_0x45e568=_[_0xb1de('0x39')]({},_0x45e568,_0xc21173['options']);return _0x2bf8f2['getDescriptions'](_0x45e568);}})[_0xb1de('0x21')](function(_0x25132b){if(_0x25132b){_0x1a8723=_0x25132b[_0xb1de('0x32')];if(!_0xc21173[_0xb1de('0x2d')]['hasOwnProperty']('nolimit')){_0x45e568[_0xb1de('0x35')]=qs['limit'](_0xc21173['query']['limit']);_0x45e568[_0xb1de('0x19')]=qs['offset'](_0xc21173[_0xb1de('0x2d')][_0xb1de('0x19')]);}return _0x2bf8f2[_0xb1de('0x4c')](_0x45e568);}})[_0xb1de('0x21')](function(_0x39f804){if(_0x39f804){return _0x39f804?{'count':_0x1a8723,'rows':_0x39f804}:null;}})[_0xb1de('0x21')](respondWithResult(_0x48211f,null))[_0xb1de('0x40')](handleError(_0x48211f,null));};exports[_0xb1de('0x4d')]=function(_0x1ac1ab,_0x3bd945,_0x22f569){var _0x523a92={};var _0x5f5cb6={};var _0x5c0a83;var _0x59e05e;return db[_0xb1de('0x28')][_0xb1de('0x48')]({'where':{'id':_0x1ac1ab[_0xb1de('0x41')]['id']}})[_0xb1de('0x21')](handleEntityNotFound(_0x3bd945,null))[_0xb1de('0x21')](function(_0x47c5bc){if(_0x47c5bc){_0x5c0a83=_0x47c5bc;_0x5f5cb6[_0xb1de('0x2c')]=_[_0xb1de('0x42')](db['Tag']['rawAttributes']);_0x5f5cb6['query']=_[_0xb1de('0x42')](_0x1ac1ab[_0xb1de('0x2d')]);_0x5f5cb6[_0xb1de('0x2e')]=_['intersection'](_0x5f5cb6['model'],_0x5f5cb6[_0xb1de('0x2d')]);_0x523a92[_0xb1de('0x30')]=_['intersection'](_0x5f5cb6['model'],qs[_0xb1de('0x31')](_0x1ac1ab[_0xb1de('0x2d')]['fields']));_0x523a92['attributes']=_0x523a92['attributes'][_0xb1de('0x32')]?_0x523a92[_0xb1de('0x30')]:_0x5f5cb6[_0xb1de('0x2c')];_0x523a92[_0xb1de('0x36')]=qs[_0xb1de('0x37')](_0x1ac1ab['query'][_0xb1de('0x37')]);_0x523a92[_0xb1de('0x38')]=qs['filters'](_[_0xb1de('0x49')](_0x1ac1ab['query'],_0x5f5cb6['filters']));if(_0x1ac1ab['query']['filter']){_0x523a92[_0xb1de('0x38')]=_[_0xb1de('0x39')](_0x523a92[_0xb1de('0x38')],{'$or':_['map'](_0x523a92[_0xb1de('0x30')],function(_0x2b1575){var _0x5f2086={};_0x5f2086[_0x2b1575]={'$like':'%'+_0x1ac1ab[_0xb1de('0x2d')][_0xb1de('0x3b')]+'%'};return _0x5f2086;})});}_0x523a92=_[_0xb1de('0x39')]({},_0x523a92,_0x1ac1ab[_0xb1de('0x43')]);return _0x5c0a83['getTags'](_0x523a92);}})[_0xb1de('0x21')](function(_0x4857ae){if(_0x4857ae){_0x59e05e=_0x4857ae[_0xb1de('0x32')];if(!_0x1ac1ab['query'][_0xb1de('0x33')](_0xb1de('0x34'))){_0x523a92[_0xb1de('0x35')]=qs[_0xb1de('0x35')](_0x1ac1ab['query'][_0xb1de('0x35')]);_0x523a92[_0xb1de('0x19')]=qs['offset'](_0x1ac1ab[_0xb1de('0x2d')]['offset']);}return _0x5c0a83[_0xb1de('0x4d')](_0x523a92);}})['then'](function(_0x5829ff){if(_0x5829ff){return _0x5829ff?{'count':_0x59e05e,'rows':_0x5829ff}:null;}})[_0xb1de('0x21')](respondWithResult(_0x3bd945,null))['catch'](handleError(_0x3bd945,null));};exports[_0xb1de('0x4e')]=function(_0x539556,_0x39f604,_0x46c87f){if(_0x539556[_0xb1de('0x46')]['id']){delete _0x539556[_0xb1de('0x46')]['id'];}return db[_0xb1de('0x28')]['findOne']({'where':{'id':_0x539556['params']['id']}})[_0xb1de('0x21')](handleEntityNotFound(_0x39f604,null))[_0xb1de('0x21')](function(_0x556d15){if(_0x556d15){return _0x556d15[_0xb1de('0x4e')](_0x539556[_0xb1de('0x46')]['ids']||[]);}return null;})['then'](respondWithResult(_0x39f604,null))[_0xb1de('0x40')](handleError(_0x39f604,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 50a8c55..3392047 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 _0x6855=['define','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x48f149,_0x934452){var _0x2c9318=function(_0x15ae35){while(--_0x15ae35){_0x48f149['push'](_0x48f149['shift']());}};_0x2c9318(++_0x934452);}(_0x6855,0x91));var _0x5685=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x6855[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0x5685('0x0'));var util=require(_0x5685('0x1'));var logger=require(_0x5685('0x2'))(_0x5685('0x3'));var moment=require(_0x5685('0x4'));var BPromise=require(_0x5685('0x5'));var rp=require(_0x5685('0x6'));var fs=require('fs');var path=require(_0x5685('0x7'));var rimraf=require(_0x5685('0x8'));var config=require(_0x5685('0x9'));var attributes=require(_0x5685('0xa'));module['exports']=function(_0x4bd5c7,_0x2442d7){return _0x4bd5c7[_0x5685('0xb')]('FreshdeskConfiguration',attributes,{'tableName':_0x5685('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9434=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x28cedf,_0x427ed8){var _0x4fa0b3=function(_0x4c9b40){while(--_0x4c9b40){_0x28cedf['push'](_0x28cedf['shift']());}};_0x4fa0b3(++_0x427ed8);}(_0x9434,0x1ac));var _0x4943=function(_0x5d9923,_0x505c08){_0x5d9923=_0x5d9923-0x0;var _0x2fba01=_0x9434[_0x5d9923];return _0x2fba01;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var logger=require(_0x4943('0x2'))(_0x4943('0x3'));var moment=require('moment');var BPromise=require(_0x4943('0x4'));var rp=require(_0x4943('0x5'));var fs=require('fs');var path=require(_0x4943('0x6'));var rimraf=require(_0x4943('0x7'));var config=require(_0x4943('0x8'));var attributes=require(_0x4943('0x9'));module['exports']=function(_0x4a352d,_0x831828){return _0x4a352d[_0x4943('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x4943('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 1dcf18d..f04d48d 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 _0xfced=['http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x2d057e,_0x1cd908){var _0x34c80d=function(_0x54edf9){while(--_0x54edf9){_0x2d057e['push'](_0x2d057e['shift']());}};_0x34c80d(++_0x1cd908);}(_0xfced,0x18e));var _0xdfce=function(_0x2306b7,_0x4f7413){_0x2306b7=_0x2306b7-0x0;var _0x36f8b7=_0xfced[_0x2306b7];return _0x36f8b7;};'use strict';var _=require(_0xdfce('0x0'));var util=require(_0xdfce('0x1'));var moment=require(_0xdfce('0x2'));var BPromise=require(_0xdfce('0x3'));var rs=require(_0xdfce('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfce('0x5'))['db'];var utils=require(_0xdfce('0x6'));var logger=require(_0xdfce('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdfce('0x8'));var client=jayson[_0xdfce('0x9')][_0xdfce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a9c8a,_0x521119,_0x3fa76a){return new BPromise(function(_0x1bc909,_0x4e4ba6){return client[_0xdfce('0xb')](_0x1a9c8a,_0x3fa76a)[_0xdfce('0xc')](function(_0x405400){logger['info'](_0xdfce('0xd'),_0x521119,'request\x20sent');logger[_0xdfce('0xe')](_0xdfce('0xf'),_0x521119,'request\x20sent',JSON[_0xdfce('0x10')](_0x405400));if(_0x405400['error']){if(_0x405400[_0xdfce('0x11')][_0xdfce('0x12')]===0x1f4){logger[_0xdfce('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x521119,_0x405400['error'][_0xdfce('0x13')]);return _0x4e4ba6(_0x405400['error'][_0xdfce('0x13')]);}logger[_0xdfce('0x11')](_0xdfce('0xd'),_0x521119,_0x405400['error'][_0xdfce('0x13')]);return _0x1bc909(_0x405400[_0xdfce('0x11')][_0xdfce('0x13')]);}else{logger[_0xdfce('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x521119,_0xdfce('0x15'));_0x1bc909(_0x405400[_0xdfce('0x16')][_0xdfce('0x13')]);}})[_0xdfce('0x17')](function(_0x26da4d){logger[_0xdfce('0x11')](_0xdfce('0xd'),_0x521119,_0x26da4d);_0x4e4ba6(_0x26da4d);});});} \ No newline at end of file +var _0xc610=['lodash','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','then','request\x20sent','debug','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0xc610,0x168));var _0x0c61=function(_0x46c45a,_0x1b9c19){_0x46c45a=_0x46c45a-0x0;var _0x2a6f0c=_0xc610[_0x46c45a];return _0x2a6f0c;};'use strict';var _=require(_0x0c61('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0c61('0x1'));var rs=require(_0x0c61('0x2'));var fs=require('fs');var Redis=require(_0x0c61('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0c61('0x4'));var config=require(_0x0c61('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0c61('0x6')][_0x0c61('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc03a30,_0x5d077d,_0x34b569){return new BPromise(function(_0x2e7c79,_0x4cb0d0){return client['request'](_0xc03a30,_0x34b569)[_0x0c61('0x8')](function(_0x1313aa){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5d077d,_0x0c61('0x9'));logger[_0x0c61('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5d077d,_0x0c61('0x9'),JSON[_0x0c61('0xb')](_0x1313aa));if(_0x1313aa[_0x0c61('0xc')]){if(_0x1313aa[_0x0c61('0xc')][_0x0c61('0xd')]===0x1f4){logger[_0x0c61('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5d077d,_0x1313aa[_0x0c61('0xc')]['message']);return _0x4cb0d0(_0x1313aa['error'][_0x0c61('0xe')]);}logger[_0x0c61('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5d077d,_0x1313aa['error']['message']);return _0x2e7c79(_0x1313aa[_0x0c61('0xc')][_0x0c61('0xe')]);}else{logger['info'](_0x0c61('0xf'),_0x5d077d,_0x0c61('0x9'));_0x2e7c79(_0x1313aa[_0x0c61('0x10')][_0x0c61('0xe')]);}})[_0x0c61('0x11')](function(_0x5f0712){logger[_0x0c61('0xc')](_0x0c61('0xf'),_0x5d077d,_0x5f0712);_0x4cb0d0(_0x5f0712);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d97b175..d24c980 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 _0x57f5=['index','isAuthenticated','post','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x57f5,0x1e3));var _0x557f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x57f5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x557f('0x0'));var util=require(_0x557f('0x1'));var path=require('path');var timeout=require(_0x557f('0x2'));var express=require(_0x557f('0x3'));var router=express[_0x557f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x557f('0x5'));var interaction=require(_0x557f('0x6'));var config=require(_0x557f('0x7'));var controller=require(_0x557f('0x8'));router[_0x557f('0x9')]('/',auth['isAuthenticated'](),controller[_0x557f('0xa')]);router[_0x557f('0x9')]('/:id',auth[_0x557f('0xb')](),controller['show']);router[_0x557f('0xc')]('/',auth[_0x557f('0xb')](),controller['create']);router['put'](_0x557f('0xd'),auth['isAuthenticated'](),controller[_0x557f('0xe')]);router[_0x557f('0xf')](_0x557f('0xd'),auth[_0x557f('0xb')](),controller['destroy']);module[_0x557f('0x10')]=router; \ No newline at end of file +var _0xa9e9=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','/:id','show','post','isAuthenticated','create','put'];(function(_0x2599ec,_0x42f4fb){var _0x4efd1f=function(_0x4a9e18){while(--_0x4a9e18){_0x2599ec['push'](_0x2599ec['shift']());}};_0x4efd1f(++_0x42f4fb);}(_0xa9e9,0xac));var _0x9a9e=function(_0x91edfd,_0x2bb13e){_0x91edfd=_0x91edfd-0x0;var _0x561ba8=_0xa9e9[_0x91edfd];return _0x561ba8;};'use strict';var multer=require(_0x9a9e('0x0'));var util=require(_0x9a9e('0x1'));var path=require(_0x9a9e('0x2'));var timeout=require(_0x9a9e('0x3'));var express=require(_0x9a9e('0x4'));var router=express[_0x9a9e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9a9e('0x6'));var interaction=require(_0x9a9e('0x7'));var config=require(_0x9a9e('0x8'));var controller=require(_0x9a9e('0x9'));router[_0x9a9e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9a9e('0xa')](_0x9a9e('0xb'),auth['isAuthenticated'](),controller[_0x9a9e('0xc')]);router[_0x9a9e('0xd')]('/',auth[_0x9a9e('0xe')](),controller[_0x9a9e('0xf')]);router[_0x9a9e('0x10')](_0x9a9e('0xb'),auth['isAuthenticated'](),controller[_0x9a9e('0x11')]);router[_0x9a9e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9a9e('0x13')]);module[_0x9a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 038f44d..18a81c9 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 _0x10d3=['sequelize','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x3465d2,_0x165659){var _0x203f3c=function(_0x221099){while(--_0x221099){_0x3465d2['push'](_0x3465d2['shift']());}};_0x203f3c(++_0x165659);}(_0x10d3,0x19e));var _0x310d=function(_0x5da339,_0x26c474){_0x5da339=_0x5da339-0x0;var _0x23958a=_0x10d3[_0x5da339];return _0x23958a;};'use strict';var Sequelize=require(_0x310d('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x310d('0x1'),_0x310d('0x2'),_0x310d('0x3'),_0x310d('0x4'),_0x310d('0x5')),'defaultValue':_0x310d('0x1')},'content':{'type':Sequelize[_0x310d('0x6')]},'key':{'type':Sequelize[_0x310d('0x6')]},'keyType':{'type':Sequelize[_0x310d('0x7')]('string',_0x310d('0x2'),_0x310d('0x3'))},'keyContent':{'type':Sequelize[_0x310d('0x6')]},'idField':{'type':Sequelize[_0x310d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x310d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2b43=['keyValue','picklist','STRING','string','sequelize','exports','ENUM','variable','customVariable'];(function(_0x1e196b,_0x175aa7){var _0x330e6d=function(_0x183da2){while(--_0x183da2){_0x1e196b['push'](_0x1e196b['shift']());}};_0x330e6d(++_0x175aa7);}(_0x2b43,0x1a2));var _0x32b4=function(_0x3fcc96,_0x1c65d4){_0x3fcc96=_0x3fcc96-0x0;var _0x5caa7a=_0x2b43[_0x3fcc96];return _0x5caa7a;};'use strict';var Sequelize=require(_0x32b4('0x0'));module[_0x32b4('0x1')]={'type':{'type':Sequelize[_0x32b4('0x2')]('string',_0x32b4('0x3'),_0x32b4('0x4'),_0x32b4('0x5'),_0x32b4('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x32b4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x32b4('0x2')](_0x32b4('0x8'),_0x32b4('0x3'),_0x32b4('0x4'))},'keyContent':{'type':Sequelize[_0x32b4('0x7')]},'idField':{'type':Sequelize[_0x32b4('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x32b4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 599b0fe..bfe027a 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 _0xb469=['undefined','count','limit','set','Content-Range','apply','update','then','error','stack','name','index','map','FreshdeskField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','include','rows','catch','params','includeAll','options','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x1ca66c,_0x3e3868){var _0x5a78ce=function(_0x5432ac){while(--_0x5432ac){_0x1ca66c['push'](_0x1ca66c['shift']());}};_0x5a78ce(++_0x3e3868);}(_0xb469,0x13b));var _0x9b46=function(_0x7c6e1b,_0x5a9c22){_0x7c6e1b=_0x7c6e1b-0x0;var _0x1329ba=_0xb469[_0x7c6e1b];return _0x1329ba;};'use strict';var emlformat=require(_0x9b46('0x0'));var rimraf=require(_0x9b46('0x1'));var zipdir=require(_0x9b46('0x2'));var jsonpatch=require(_0x9b46('0x3'));var rp=require(_0x9b46('0x4'));var moment=require(_0x9b46('0x5'));var BPromise=require(_0x9b46('0x6'));var Mustache=require('mustache');var util=require(_0x9b46('0x7'));var path=require(_0x9b46('0x8'));var sox=require('sox');var csv=require(_0x9b46('0x9'));var ejs=require(_0x9b46('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b46('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b46('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b46('0x9'));var querystring=require(_0x9b46('0xd'));var Papa=require(_0x9b46('0xe'));var Redis=require('ioredis');var authService=require(_0x9b46('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9b46('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b46('0x11'))('api');var utils=require(_0x9b46('0x12'));var config=require(_0x9b46('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b46('0x14'))['db'];function respondWithStatusCode(_0x417df5,_0x5b65c2){_0x5b65c2=_0x5b65c2||0xcc;return function(_0x14362a){if(_0x14362a){return _0x417df5[_0x9b46('0x15')](_0x5b65c2);}return _0x417df5[_0x9b46('0x16')](_0x5b65c2)[_0x9b46('0x17')]();};}function respondWithResult(_0xa8f4ac,_0x35c5c1){_0x35c5c1=_0x35c5c1||0xc8;return function(_0x2136bc){if(_0x2136bc){return _0xa8f4ac[_0x9b46('0x16')](_0x35c5c1)[_0x9b46('0x18')](_0x2136bc);}};}function respondWithFilteredResult(_0x178293,_0xbc1ba6){return function(_0x135cc2){if(_0x135cc2){var _0x1e6911=typeof _0xbc1ba6['offset']==='undefined'&&typeof _0xbc1ba6['limit']===_0x9b46('0x19');var _0x5a380c=_0x135cc2[_0x9b46('0x1a')];var _0x5c5cc9=_0x1e6911?0x0:_0xbc1ba6['offset'];var _0x3d9efa=_0x1e6911?_0x135cc2['count']:_0xbc1ba6['offset']+_0xbc1ba6[_0x9b46('0x1b')];var _0x3a15cc;if(_0x3d9efa>=_0x5a380c){_0x3d9efa=_0x5a380c;_0x3a15cc=0xc8;}else{_0x3a15cc=0xce;}_0x178293['status'](_0x3a15cc);return _0x178293[_0x9b46('0x1c')](_0x9b46('0x1d'),_0x5c5cc9+'-'+_0x3d9efa+'/'+_0x5a380c)['json'](_0x135cc2);}return null;};}function patchUpdates(_0x55aece){return function(_0xbec2ea){try{jsonpatch[_0x9b46('0x1e')](_0xbec2ea,_0x55aece,!![]);}catch(_0x204098){return BPromise['reject'](_0x204098);}return _0xbec2ea['save']();};}function saveUpdates(_0x2b3440,_0x51d2ca){return function(_0x21dacb){if(_0x21dacb){return _0x21dacb[_0x9b46('0x1f')](_0x2b3440)['then'](function(_0xadff19){return _0xadff19;});}return null;};}function removeEntity(_0x5182b1,_0x141cb6){return function(_0x2b6f72){if(_0x2b6f72){return _0x2b6f72['destroy']()[_0x9b46('0x20')](function(){_0x5182b1[_0x9b46('0x16')](0xcc)[_0x9b46('0x17')]();});}};}function handleEntityNotFound(_0x319930,_0x33ea06){return function(_0x3e4899){if(!_0x3e4899){_0x319930[_0x9b46('0x15')](0x194);}return _0x3e4899;};}function handleError(_0x5dc377,_0xdd756c){_0xdd756c=_0xdd756c||0x1f4;return function(_0x3ac37e){logger[_0x9b46('0x21')](_0x3ac37e[_0x9b46('0x22')]);if(_0x3ac37e[_0x9b46('0x23')]){delete _0x3ac37e[_0x9b46('0x23')];}_0x5dc377[_0x9b46('0x16')](_0xdd756c)['send'](_0x3ac37e);};}exports[_0x9b46('0x24')]=function(_0xee519e,_0x3630bf){var _0x376ccc={},_0x28b289={},_0x869993={'count':0x0,'rows':[]};var _0xc062ec=_[_0x9b46('0x25')](db[_0x9b46('0x26')][_0x9b46('0x27')],function(_0x2e1c51){return{'name':_0x2e1c51['fieldName'],'type':_0x2e1c51[_0x9b46('0x28')][_0x9b46('0x29')]};});_0x28b289[_0x9b46('0x2a')]=_[_0x9b46('0x25')](_0xc062ec,_0x9b46('0x23'));_0x28b289[_0x9b46('0x2b')]=_[_0x9b46('0x2c')](_0xee519e[_0x9b46('0x2b')]);_0x28b289[_0x9b46('0x2d')]=_[_0x9b46('0x2e')](_0x28b289[_0x9b46('0x2a')],_0x28b289['query']);_0x376ccc[_0x9b46('0x2f')]=_['intersection'](_0x28b289[_0x9b46('0x2a')],qs[_0x9b46('0x30')](_0xee519e[_0x9b46('0x2b')]['fields']));_0x376ccc[_0x9b46('0x2f')]=_0x376ccc[_0x9b46('0x2f')][_0x9b46('0x31')]?_0x376ccc[_0x9b46('0x2f')]:_0x28b289[_0x9b46('0x2a')];if(!_0xee519e['query']['hasOwnProperty'](_0x9b46('0x32'))){_0x376ccc[_0x9b46('0x1b')]=qs[_0x9b46('0x1b')](_0xee519e[_0x9b46('0x2b')]['limit']);_0x376ccc[_0x9b46('0x33')]=qs['offset'](_0xee519e[_0x9b46('0x2b')][_0x9b46('0x33')]);}_0x376ccc[_0x9b46('0x34')]=qs[_0x9b46('0x35')](_0xee519e['query'][_0x9b46('0x35')]);_0x376ccc['where']=qs[_0x9b46('0x2d')](_[_0x9b46('0x36')](_0xee519e[_0x9b46('0x2b')],_0x28b289[_0x9b46('0x2d')]),_0xc062ec);if(_0xee519e[_0x9b46('0x2b')][_0x9b46('0x37')]){_0x376ccc[_0x9b46('0x38')]=_[_0x9b46('0x39')](_0x376ccc[_0x9b46('0x38')],{'$or':_[_0x9b46('0x25')](_0xc062ec,function(_0x1c4147){if(_0x1c4147['type']!==_0x9b46('0x3a')){var _0x5aac02={};_0x5aac02[_0x1c4147[_0x9b46('0x23')]]={'$like':'%'+_0xee519e[_0x9b46('0x2b')]['filter']+'%'};return _0x5aac02;}})});}_0x376ccc=_[_0x9b46('0x39')]({},_0x376ccc,_0xee519e['options']);var _0x416538={'where':_0x376ccc['where']};return db[_0x9b46('0x26')][_0x9b46('0x1a')](_0x416538)[_0x9b46('0x20')](function(_0x22ab5d){_0x869993[_0x9b46('0x1a')]=_0x22ab5d;if(_0xee519e['query']['includeAll']){_0x376ccc[_0x9b46('0x3b')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x376ccc);})['then'](function(_0x4e1911){_0x869993[_0x9b46('0x3c')]=_0x4e1911;return _0x869993;})['then'](respondWithFilteredResult(_0x3630bf,_0x376ccc))[_0x9b46('0x3d')](handleError(_0x3630bf,null));};exports['show']=function(_0x3fa46c,_0xe807bf){var _0x2e92aa={'raw':!![],'where':{'id':_0x3fa46c[_0x9b46('0x3e')]['id']}},_0xa14b={};_0xa14b[_0x9b46('0x2a')]=_[_0x9b46('0x2c')](db[_0x9b46('0x26')][_0x9b46('0x27')]);_0xa14b['query']=_[_0x9b46('0x2c')](_0x3fa46c[_0x9b46('0x2b')]);_0xa14b[_0x9b46('0x2d')]=_[_0x9b46('0x2e')](_0xa14b[_0x9b46('0x2a')],_0xa14b[_0x9b46('0x2b')]);_0x2e92aa[_0x9b46('0x2f')]=_[_0x9b46('0x2e')](_0xa14b[_0x9b46('0x2a')],qs[_0x9b46('0x30')](_0x3fa46c[_0x9b46('0x2b')][_0x9b46('0x30')]));_0x2e92aa[_0x9b46('0x2f')]=_0x2e92aa[_0x9b46('0x2f')]['length']?_0x2e92aa['attributes']:_0xa14b[_0x9b46('0x2a')];if(_0x3fa46c[_0x9b46('0x2b')][_0x9b46('0x3f')]){_0x2e92aa['include']=[{'all':!![]}];}_0x2e92aa=_['merge']({},_0x2e92aa,_0x3fa46c[_0x9b46('0x40')]);return db[_0x9b46('0x26')][_0x9b46('0x41')](_0x2e92aa)[_0x9b46('0x20')](handleEntityNotFound(_0xe807bf,null))[_0x9b46('0x20')](respondWithResult(_0xe807bf,null))[_0x9b46('0x3d')](handleError(_0xe807bf,null));};exports['create']=function(_0x6d1e73,_0x32e34d){return db[_0x9b46('0x26')]['create'](_0x6d1e73[_0x9b46('0x42')],{})['then'](respondWithResult(_0x32e34d,0xc9))[_0x9b46('0x3d')](handleError(_0x32e34d,null));};exports[_0x9b46('0x1f')]=function(_0x16e6d8,_0x566bad){if(_0x16e6d8[_0x9b46('0x42')]['id']){delete _0x16e6d8[_0x9b46('0x42')]['id'];}return db[_0x9b46('0x26')][_0x9b46('0x41')]({'where':{'id':_0x16e6d8[_0x9b46('0x3e')]['id']}})[_0x9b46('0x20')](handleEntityNotFound(_0x566bad,null))['then'](saveUpdates(_0x16e6d8[_0x9b46('0x42')],null))[_0x9b46('0x20')](respondWithResult(_0x566bad,null))[_0x9b46('0x3d')](handleError(_0x566bad,null));};exports[_0x9b46('0x43')]=function(_0x362311,_0x36a492){return db['FreshdeskField'][_0x9b46('0x41')]({'where':{'id':_0x362311['params']['id']}})[_0x9b46('0x20')](handleEntityNotFound(_0x36a492,null))[_0x9b46('0x20')](removeEntity(_0x36a492,null))[_0x9b46('0x3d')](handleError(_0x36a492,null));}; \ No newline at end of file +var _0xa9e0=['nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','body','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','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x389a8b,_0x270bdf){var _0x361307=function(_0x1ebf47){while(--_0x1ebf47){_0x389a8b['push'](_0x389a8b['shift']());}};_0x361307(++_0x270bdf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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['FreshdeskField'][_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));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1c2a76b..043470b 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 _0x707d=['FieldId','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','FreshdeskField','idField'];(function(_0xc412fe,_0x45318e){var _0x45cf39=function(_0x214edd){while(--_0x214edd){_0xc412fe['push'](_0xc412fe['shift']());}};_0x45cf39(++_0x45318e);}(_0x707d,0x12d));var _0xd707=function(_0x6fb36e,_0x2cbe26){_0x6fb36e=_0x6fb36e-0x0;var _0x49e55b=_0x707d[_0x6fb36e];return _0x49e55b;};'use strict';var _=require('lodash');var util=require(_0xd707('0x0'));var logger=require(_0xd707('0x1'))(_0xd707('0x2'));var moment=require(_0xd707('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd707('0x4'));var config=require(_0xd707('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0xd707('0x6')]=function(_0x6f0216,_0x10a295){return _0x6f0216['define'](_0xd707('0x7'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xd707('0x8'),_0xd707('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8743=['bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x9f6e2e,_0x5b38ae){var _0x5baf6a=function(_0x355795){while(--_0x355795){_0x9f6e2e['push'](_0x9f6e2e['shift']());}};_0x5baf6a(++_0x5b38ae);}(_0x8743,0xa3));var _0x3874=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8743[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3874('0x0'));var util=require(_0x3874('0x1'));var logger=require(_0x3874('0x2'))(_0x3874('0x3'));var moment=require(_0x3874('0x4'));var BPromise=require(_0x3874('0x5'));var rp=require(_0x3874('0x6'));var fs=require('fs');var path=require(_0x3874('0x7'));var rimraf=require(_0x3874('0x8'));var config=require('../../config/environment');var attributes=require(_0x3874('0x9'));module[_0x3874('0xa')]=function(_0x1de2f9,_0x4fd2de){return _0x1de2f9[_0x3874('0xb')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x3874('0xc'),'fields':[_0x3874('0xd'),'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 d1ed180..cef4c6c 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 _0xf0b6=['../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x2d1476,_0x589dd3){var _0x2e4cde=function(_0x4d1211){while(--_0x4d1211){_0x2d1476['push'](_0x2d1476['shift']());}};_0x2e4cde(++_0x589dd3);}(_0xf0b6,0x18a));var _0x6f0b=function(_0x1c11e1,_0x313123){_0x1c11e1=_0x1c11e1-0x0;var _0x3f498b=_0xf0b6[_0x1c11e1];return _0x3f498b;};'use strict';var _=require(_0x6f0b('0x0'));var util=require(_0x6f0b('0x1'));var moment=require('moment');var BPromise=require(_0x6f0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f0b('0x3'))['db'];var utils=require(_0x6f0b('0x4'));var logger=require('../../config/logger')(_0x6f0b('0x5'));var config=require(_0x6f0b('0x6'));var jayson=require(_0x6f0b('0x7'));var client=jayson[_0x6f0b('0x8')][_0x6f0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30b457,_0x37774b,_0x5967a6){return new BPromise(function(_0x1e922f,_0x1c6751){return client[_0x6f0b('0xa')](_0x30b457,_0x5967a6)['then'](function(_0x273b8d){logger[_0x6f0b('0xb')](_0x6f0b('0xc'),_0x37774b,_0x6f0b('0xd'));logger[_0x6f0b('0xe')](_0x6f0b('0xf'),_0x37774b,_0x6f0b('0xd'),JSON[_0x6f0b('0x10')](_0x273b8d));if(_0x273b8d[_0x6f0b('0x11')]){if(_0x273b8d[_0x6f0b('0x11')]['code']===0x1f4){logger[_0x6f0b('0x11')](_0x6f0b('0xc'),_0x37774b,_0x273b8d['error'][_0x6f0b('0x12')]);return _0x1c6751(_0x273b8d[_0x6f0b('0x11')][_0x6f0b('0x12')]);}logger[_0x6f0b('0x11')](_0x6f0b('0xc'),_0x37774b,_0x273b8d[_0x6f0b('0x11')][_0x6f0b('0x12')]);return _0x1e922f(_0x273b8d[_0x6f0b('0x11')][_0x6f0b('0x12')]);}else{logger[_0x6f0b('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x37774b,_0x6f0b('0xd'));_0x1e922f(_0x273b8d[_0x6f0b('0x13')][_0x6f0b('0x12')]);}})['catch'](function(_0x5da306){logger[_0x6f0b('0x11')](_0x6f0b('0xc'),_0x37774b,_0x5da306);_0x1c6751(_0x5da306);});});} \ No newline at end of file +var _0xb2d5=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4ad63f,_0x4c737d){var _0x290e8a=function(_0x436650){while(--_0x436650){_0x4ad63f['push'](_0x4ad63f['shift']());}};_0x290e8a(++_0x4c737d);}(_0xb2d5,0x10c));var _0x5b2d=function(_0xc6549e,_0x358a32){_0xc6549e=_0xc6549e-0x0;var _0x4afb26=_0xb2d5[_0xc6549e];return _0x4afb26;};'use strict';var _=require(_0x5b2d('0x0'));var util=require(_0x5b2d('0x1'));var moment=require(_0x5b2d('0x2'));var BPromise=require(_0x5b2d('0x3'));var rs=require(_0x5b2d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b2d('0x5'))['db'];var utils=require(_0x5b2d('0x6'));var logger=require(_0x5b2d('0x7'))(_0x5b2d('0x8'));var config=require(_0x5b2d('0x9'));var jayson=require(_0x5b2d('0xa'));var client=jayson[_0x5b2d('0xb')][_0x5b2d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9153c4,_0x379489,_0x69c876){return new BPromise(function(_0x357ea7,_0x45e3c7){return client['request'](_0x9153c4,_0x69c876)['then'](function(_0x4e26bc){logger[_0x5b2d('0xd')](_0x5b2d('0xe'),_0x379489,'request\x20sent');logger[_0x5b2d('0xf')](_0x5b2d('0x10'),_0x379489,_0x5b2d('0x11'),JSON[_0x5b2d('0x12')](_0x4e26bc));if(_0x4e26bc[_0x5b2d('0x13')]){if(_0x4e26bc[_0x5b2d('0x13')][_0x5b2d('0x14')]===0x1f4){logger[_0x5b2d('0x13')](_0x5b2d('0xe'),_0x379489,_0x4e26bc['error'][_0x5b2d('0x15')]);return _0x45e3c7(_0x4e26bc[_0x5b2d('0x13')]['message']);}logger['error'](_0x5b2d('0xe'),_0x379489,_0x4e26bc[_0x5b2d('0x13')][_0x5b2d('0x15')]);return _0x357ea7(_0x4e26bc[_0x5b2d('0x13')]['message']);}else{logger[_0x5b2d('0xd')](_0x5b2d('0xe'),_0x379489,_0x5b2d('0x11'));_0x357ea7(_0x4e26bc[_0x5b2d('0x16')][_0x5b2d('0x15')]);}})[_0x5b2d('0x17')](function(_0x1368ec){logger[_0x5b2d('0x13')](_0x5b2d('0xe'),_0x379489,_0x1368ec);_0x45e3c7(_0x1368ec);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index dd4616c..2004c1f 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 _0x0713=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','delete'];(function(_0x221c3c,_0x7319f2){var _0x8b4802=function(_0x1302e5){while(--_0x1302e5){_0x221c3c['push'](_0x221c3c['shift']());}};_0x8b4802(++_0x7319f2);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getConfigurations']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x10')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x12')]);router['put']('/:id',auth[_0x3071('0x9')](),controller['update']);router[_0x3071('0x13')](_0x3071('0xb'),auth['isAuthenticated'](),controller[_0x3071('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb7e7=['put','update','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','index','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0xb7e7,0x121));var _0x7b7e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb7e7[_0x68ee8b];return _0x5148f7;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x12')]);router[_0x7b7e('0x13')]('/:id',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['delete'](_0x7b7e('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x7b7e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index a27a97c..0591b6e 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 _0xb03e=['STRING','username','remoteUri','exports'];(function(_0x383349,_0x460379){var _0xddb587=function(_0x383db6){while(--_0x383db6){_0x383349['push'](_0x383349['shift']());}};_0xddb587(++_0x460379);}(_0xb03e,0x1eb));var _0xeb03=function(_0xa191e8,_0x5f516b){_0xa191e8=_0xa191e8-0x0;var _0xa733ef=_0xb03e[_0xa191e8];return _0xa733ef;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'name':{'type':Sequelize[_0xeb03('0x1')]},'description':{'type':Sequelize[_0xeb03('0x1')]},'username':{'type':Sequelize[_0xeb03('0x1')],'unique':_0xeb03('0x2')},'apiKey':{'type':Sequelize[_0xeb03('0x1')]},'remoteUri':{'type':Sequelize[_0xeb03('0x1')],'unique':_0xeb03('0x3')},'serverUrl':{'type':Sequelize[_0xeb03('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5204=['exports','STRING','username','sequelize'];(function(_0x36dc9c,_0x3d6314){var _0x4f7c9b=function(_0x122c05){while(--_0x122c05){_0x36dc9c['push'](_0x36dc9c['shift']());}};_0x4f7c9b(++_0x3d6314);}(_0x5204,0xdf));var _0x4520=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x5204[_0x595604];return _0x1466f3;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 9fd3b7d..b54f7d7 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 _0xb09e=['name','send','index','FreshsalesAccount','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','getConfigurations','findOne','FreshsalesConfiguration','AccountId','channel','getDescriptions','FreshsalesField','Subjects','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack'];(function(_0x407d85,_0x23c79e){var _0x51c8ff=function(_0x250c24){while(--_0x250c24){_0x407d85['push'](_0x407d85['shift']());}};_0x51c8ff(++_0x23c79e);}(_0xb09e,0x176));var _0xeb09=function(_0x14f1c7,_0x5eae6b){_0x14f1c7=_0x14f1c7-0x0;var _0x35f232=_0xb09e[_0x14f1c7];return _0x35f232;};'use strict';var emlformat=require(_0xeb09('0x0'));var rimraf=require(_0xeb09('0x1'));var zipdir=require(_0xeb09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb09('0x3'));var moment=require(_0xeb09('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeb09('0x5'));var util=require(_0xeb09('0x6'));var path=require('path');var sox=require(_0xeb09('0x7'));var csv=require('to-csv');var ejs=require(_0xeb09('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb09('0x9'));var squel=require(_0xeb09('0xa'));var crypto=require(_0xeb09('0xb'));var jsforce=require(_0xeb09('0xc'));var deskjs=require(_0xeb09('0xd'));var toCsv=require(_0xeb09('0xe'));var querystring=require(_0xeb09('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb09('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeb09('0x11'));var hardwareService=require(_0xeb09('0x12'));var logger=require(_0xeb09('0x13'))(_0xeb09('0x14'));var utils=require(_0xeb09('0x15'));var config=require(_0xeb09('0x16'));var licenseUtil=require(_0xeb09('0x17'));var db=require(_0xeb09('0x18'))['db'];var integrations=require(_0xeb09('0x19'));function respondWithStatusCode(_0x54ed68,_0x134336){_0x134336=_0x134336||0xcc;return function(_0x4a2b11){if(_0x4a2b11){return _0x54ed68[_0xeb09('0x1a')](_0x134336);}return _0x54ed68[_0xeb09('0x1b')](_0x134336)[_0xeb09('0x1c')]();};}function respondWithResult(_0xbd7200,_0x433929){_0x433929=_0x433929||0xc8;return function(_0xe7cf9){if(_0xe7cf9){return _0xbd7200['status'](_0x433929)[_0xeb09('0x1d')](_0xe7cf9);}};}function respondWithFilteredResult(_0x17fd3b,_0x4971bd){return function(_0x7842cb){if(_0x7842cb){var _0x3a9376=typeof _0x4971bd[_0xeb09('0x1e')]===_0xeb09('0x1f')&&typeof _0x4971bd[_0xeb09('0x20')]===_0xeb09('0x1f');var _0x269dd2=_0x7842cb[_0xeb09('0x21')];var _0x3b2ccc=_0x3a9376?0x0:_0x4971bd[_0xeb09('0x1e')];var _0x317f7b=_0x3a9376?_0x7842cb[_0xeb09('0x21')]:_0x4971bd[_0xeb09('0x1e')]+_0x4971bd['limit'];var _0x268677;if(_0x317f7b>=_0x269dd2){_0x317f7b=_0x269dd2;_0x268677=0xc8;}else{_0x268677=0xce;}_0x17fd3b[_0xeb09('0x1b')](_0x268677);return _0x17fd3b[_0xeb09('0x22')]('Content-Range',_0x3b2ccc+'-'+_0x317f7b+'/'+_0x269dd2)[_0xeb09('0x1d')](_0x7842cb);}return null;};}function patchUpdates(_0x252e46){return function(_0x43f4ae){try{jsonpatch[_0xeb09('0x23')](_0x43f4ae,_0x252e46,!![]);}catch(_0x29690f){return BPromise[_0xeb09('0x24')](_0x29690f);}return _0x43f4ae['save']();};}function saveUpdates(_0x113a01,_0x965c18){return function(_0x1b01c9){if(_0x1b01c9){return _0x1b01c9[_0xeb09('0x25')](_0x113a01)[_0xeb09('0x26')](function(_0x814663){return _0x814663;});}return null;};}function removeEntity(_0x32cffb,_0x81ea90){return function(_0x35ce73){if(_0x35ce73){return _0x35ce73[_0xeb09('0x27')]()[_0xeb09('0x26')](function(){_0x32cffb[_0xeb09('0x1b')](0xcc)[_0xeb09('0x1c')]();});}};}function handleEntityNotFound(_0x3bc833,_0x37eac4){return function(_0x481da7){if(!_0x481da7){_0x3bc833[_0xeb09('0x1a')](0x194);}return _0x481da7;};}function handleError(_0x5ce311,_0x4a71b4){_0x4a71b4=_0x4a71b4||0x1f4;return function(_0x26404a){logger[_0xeb09('0x28')](_0x26404a[_0xeb09('0x29')]);if(_0x26404a['name']){delete _0x26404a[_0xeb09('0x2a')];}_0x5ce311[_0xeb09('0x1b')](_0x4a71b4)[_0xeb09('0x2b')](_0x26404a);};}exports[_0xeb09('0x2c')]=function(_0x13d015,_0x71d74f){var _0xc057cf={},_0xf9d50d={},_0x428938={'count':0x0,'rows':[]};var _0x4c7311=_['map'](db[_0xeb09('0x2d')][_0xeb09('0x2e')],function(_0x339726){return{'name':_0x339726['fieldName'],'type':_0x339726[_0xeb09('0x2f')][_0xeb09('0x30')]};});_0xf9d50d[_0xeb09('0x31')]=_[_0xeb09('0x32')](_0x4c7311,_0xeb09('0x2a'));_0xf9d50d[_0xeb09('0x33')]=_['keys'](_0x13d015[_0xeb09('0x33')]);_0xf9d50d[_0xeb09('0x34')]=_[_0xeb09('0x35')](_0xf9d50d[_0xeb09('0x31')],_0xf9d50d[_0xeb09('0x33')]);_0xc057cf[_0xeb09('0x36')]=_[_0xeb09('0x35')](_0xf9d50d[_0xeb09('0x31')],qs['fields'](_0x13d015[_0xeb09('0x33')][_0xeb09('0x37')]));_0xc057cf['attributes']=_0xc057cf['attributes']['length']?_0xc057cf[_0xeb09('0x36')]:_0xf9d50d['model'];if(!_0x13d015[_0xeb09('0x33')][_0xeb09('0x38')](_0xeb09('0x39'))){_0xc057cf[_0xeb09('0x20')]=qs[_0xeb09('0x20')](_0x13d015['query'][_0xeb09('0x20')]);_0xc057cf[_0xeb09('0x1e')]=qs['offset'](_0x13d015[_0xeb09('0x33')]['offset']);}_0xc057cf[_0xeb09('0x3a')]=qs[_0xeb09('0x3b')](_0x13d015[_0xeb09('0x33')][_0xeb09('0x3b')]);_0xc057cf[_0xeb09('0x3c')]=qs['filters'](_[_0xeb09('0x3d')](_0x13d015[_0xeb09('0x33')],_0xf9d50d[_0xeb09('0x34')]),_0x4c7311);if(_0x13d015['query'][_0xeb09('0x3e')]){_0xc057cf['where']=_[_0xeb09('0x3f')](_0xc057cf[_0xeb09('0x3c')],{'$or':_['map'](_0x4c7311,function(_0x4f4c98){if(_0x4f4c98[_0xeb09('0x2f')]!==_0xeb09('0x40')){var _0x1ea0ae={};_0x1ea0ae[_0x4f4c98[_0xeb09('0x2a')]]={'$like':'%'+_0x13d015[_0xeb09('0x33')]['filter']+'%'};return _0x1ea0ae;}})});}_0xc057cf=_[_0xeb09('0x3f')]({},_0xc057cf,_0x13d015[_0xeb09('0x41')]);var _0xfb1bba={'where':_0xc057cf['where']};return db[_0xeb09('0x2d')][_0xeb09('0x21')](_0xfb1bba)[_0xeb09('0x26')](function(_0x1cb1f9){_0x428938[_0xeb09('0x21')]=_0x1cb1f9;if(_0x13d015[_0xeb09('0x33')][_0xeb09('0x42')]){_0xc057cf[_0xeb09('0x43')]=[{'all':!![]}];}return db[_0xeb09('0x2d')][_0xeb09('0x44')](_0xc057cf);})[_0xeb09('0x26')](function(_0x11405f){_0x428938[_0xeb09('0x45')]=_0x11405f;return _0x428938;})[_0xeb09('0x26')](respondWithFilteredResult(_0x71d74f,_0xc057cf))['catch'](handleError(_0x71d74f,null));};exports[_0xeb09('0x46')]=function(_0x3965ef,_0x32a8f3){var _0x380990={'raw':![],'where':{'id':_0x3965ef[_0xeb09('0x47')]['id']}},_0x129447={};_0x129447['model']=_[_0xeb09('0x48')](db['FreshsalesAccount'][_0xeb09('0x2e')]);_0x129447[_0xeb09('0x33')]=_[_0xeb09('0x48')](_0x3965ef[_0xeb09('0x33')]);_0x129447[_0xeb09('0x34')]=_[_0xeb09('0x35')](_0x129447[_0xeb09('0x31')],_0x129447[_0xeb09('0x33')]);_0x380990[_0xeb09('0x36')]=_[_0xeb09('0x35')](_0x129447[_0xeb09('0x31')],qs['fields'](_0x3965ef['query'][_0xeb09('0x37')]));_0x380990[_0xeb09('0x36')]=_0x380990[_0xeb09('0x36')][_0xeb09('0x49')]?_0x380990[_0xeb09('0x36')]:_0x129447[_0xeb09('0x31')];if(_0x3965ef[_0xeb09('0x33')][_0xeb09('0x42')]){_0x380990[_0xeb09('0x43')]=[{'all':!![]}];}_0x380990=_[_0xeb09('0x3f')]({},_0x380990,_0x3965ef[_0xeb09('0x41')]);return db[_0xeb09('0x2d')][_0xeb09('0x4a')](_0x380990)['then'](handleEntityNotFound(_0x32a8f3,null))[_0xeb09('0x26')](respondWithResult(_0x32a8f3,null))[_0xeb09('0x4b')](handleError(_0x32a8f3,null));};exports[_0xeb09('0x4c')]=function(_0x31f429,_0x306b13){return db[_0xeb09('0x2d')][_0xeb09('0x4c')](_0x31f429[_0xeb09('0x4d')],{})['then'](respondWithResult(_0x306b13,0xc9))['catch'](handleError(_0x306b13,null));};exports[_0xeb09('0x25')]=function(_0x3eaf5b,_0x2c0d4a){if(_0x3eaf5b[_0xeb09('0x4d')]['id']){delete _0x3eaf5b[_0xeb09('0x4d')]['id'];}return db[_0xeb09('0x2d')][_0xeb09('0x4a')]({'where':{'id':_0x3eaf5b[_0xeb09('0x47')]['id']}})[_0xeb09('0x26')](handleEntityNotFound(_0x2c0d4a,null))[_0xeb09('0x26')](saveUpdates(_0x3eaf5b[_0xeb09('0x4d')],null))['then'](respondWithResult(_0x2c0d4a,null))[_0xeb09('0x4b')](handleError(_0x2c0d4a,null));};exports['destroy']=function(_0x525e99,_0x1a692e){return db[_0xeb09('0x2d')]['find']({'where':{'id':_0x525e99['params']['id']}})['then'](handleEntityNotFound(_0x1a692e,null))[_0xeb09('0x26')](removeEntity(_0x1a692e,null))[_0xeb09('0x4b')](handleError(_0x1a692e,null));};exports[_0xeb09('0x4e')]=function(_0x246dbf,_0x486406,_0x33219d){var _0xa1dc91={};var _0xb607e1={};var _0x40ff69;var _0x1eb7f3;return db[_0xeb09('0x2d')][_0xeb09('0x4f')]({'where':{'id':_0x246dbf[_0xeb09('0x47')]['id']}})[_0xeb09('0x26')](handleEntityNotFound(_0x486406,null))[_0xeb09('0x26')](function(_0x5e6189){if(_0x5e6189){_0x40ff69=_0x5e6189;_0xb607e1['model']=_['keys'](db[_0xeb09('0x50')][_0xeb09('0x2e')]);_0xb607e1[_0xeb09('0x33')]=_[_0xeb09('0x48')](_0x246dbf['query']);_0xb607e1[_0xeb09('0x34')]=_[_0xeb09('0x35')](_0xb607e1['model'],_0xb607e1[_0xeb09('0x33')]);_0xa1dc91['attributes']=_['intersection'](_0xb607e1[_0xeb09('0x31')],qs[_0xeb09('0x37')](_0x246dbf[_0xeb09('0x33')]['fields']));_0xa1dc91['attributes']=_0xa1dc91[_0xeb09('0x36')][_0xeb09('0x49')]?_0xa1dc91[_0xeb09('0x36')]:_0xb607e1[_0xeb09('0x31')];_0xa1dc91[_0xeb09('0x3a')]=qs[_0xeb09('0x3b')](_0x246dbf[_0xeb09('0x33')][_0xeb09('0x3b')]);_0xa1dc91[_0xeb09('0x3c')]=qs[_0xeb09('0x34')](_['pick'](_0x246dbf['query'],_0xb607e1['filters']));if(_0x246dbf[_0xeb09('0x33')]['filter']){_0xa1dc91[_0xeb09('0x3c')]=_['merge'](_0xa1dc91[_0xeb09('0x3c')],{'$or':_[_0xeb09('0x32')](_0xa1dc91[_0xeb09('0x36')],function(_0x587b02){var _0x2a59fa={};_0x2a59fa[_0x587b02]={'$like':'%'+_0x246dbf[_0xeb09('0x33')][_0xeb09('0x3e')]+'%'};return _0x2a59fa;})});}_0xa1dc91=_[_0xeb09('0x3f')]({},_0xa1dc91,_0x246dbf[_0xeb09('0x41')]);return _0x40ff69['getConfigurations'](_0xa1dc91);}})[_0xeb09('0x26')](function(_0x10538c){if(_0x10538c){_0x1eb7f3=_0x10538c[_0xeb09('0x49')];if(!_0x246dbf['query'][_0xeb09('0x38')](_0xeb09('0x39'))){_0xa1dc91['limit']=qs[_0xeb09('0x20')](_0x246dbf['query'][_0xeb09('0x20')]);_0xa1dc91[_0xeb09('0x1e')]=qs['offset'](_0x246dbf[_0xeb09('0x33')][_0xeb09('0x1e')]);}return _0x40ff69[_0xeb09('0x4e')](_0xa1dc91);}})['then'](function(_0x3de9e0){if(_0x3de9e0){return _0x3de9e0?{'count':_0x1eb7f3,'rows':_0x3de9e0}:null;}})[_0xeb09('0x26')](respondWithResult(_0x486406,null))[_0xeb09('0x4b')](handleError(_0x486406,null));};exports['addConfiguration']=function(_0x4d0611,_0x36b906,_0x5a9f1d){if(_0x4d0611[_0xeb09('0x4d')]['id']){delete _0x4d0611[_0xeb09('0x4d')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x4d0611[_0xeb09('0x47')]['id']}})[_0xeb09('0x26')](handleEntityNotFound(_0x36b906,null))[_0xeb09('0x26')](function(_0x3a3f69){if(_0x3a3f69){_0x4d0611[_0xeb09('0x4d')][_0xeb09('0x51')]=_0x3a3f69['id'];_0x4d0611[_0xeb09('0x4d')]['Subjects']=integrations['getSubjects'](_0x4d0611[_0xeb09('0x4d')][_0xeb09('0x52')],_0x4d0611['body'][_0xeb09('0x2f')]);_0x4d0611[_0xeb09('0x4d')]['Descriptions']=integrations[_0xeb09('0x53')](_0x4d0611[_0xeb09('0x4d')][_0xeb09('0x52')],_0x4d0611[_0xeb09('0x4d')][_0xeb09('0x2f')]);return db[_0xeb09('0x50')][_0xeb09('0x4c')](_0x4d0611[_0xeb09('0x4d')],{'include':[{'model':db[_0xeb09('0x54')],'as':_0xeb09('0x55')},{'model':db[_0xeb09('0x54')],'as':_0xeb09('0x56')}]});}return null;})['then'](respondWithResult(_0x36b906,null))['catch'](handleError(_0x36b906,null));};exports[_0xeb09('0x57')]=function(_0x2306bd,_0x2fe793,_0x425fb0){var _0x42eeea='';var _0xb15534='';return db['FreshsalesAccount'][_0xeb09('0x4f')]({'where':{'id':_0x2306bd[_0xeb09('0x47')]['id']},'attributes':['id',_0xeb09('0x58'),_0xeb09('0x59'),_0xeb09('0x5a')]})[_0xeb09('0x26')](handleEntityNotFound(_0x2fe793,null))[_0xeb09('0x26')](function(_0x481a7b){if(_0x481a7b){_0xb15534=_0x481a7b[_0xeb09('0x58')];_0x42eeea=_0x481a7b['remoteUri'];var _0x3ed853=_0x481a7b['remoteUri'][_0xeb09('0x5b')](-0x1);if(_0x3ed853==='/'){_0x42eeea=_0x42eeea[_0xeb09('0x5c')](0x0,_0x42eeea[_0xeb09('0x5d')](_0x3ed853));}return rp({'method':_0xeb09('0x5e'),'uri':util['format'](_0xeb09('0x5f'),_0x42eeea,_0xeb09('0x60')),'headers':{'Authorization':_0xeb09('0x61')+_0x481a7b[_0xeb09('0x5a')]},'json':!![]});}})[_0xeb09('0x26')](function(_0x5bc497){if(_0x5bc497){var _0x9c3e00=_0x5bc497[_0xeb09('0x62')];var _0xf3d006=![];var _0x2be6f9=null;for(_0x2be6f9=0x0;_0x2be6f9<_0x9c3e00[_0xeb09('0x49')];_0x2be6f9++){if(_0x9c3e00[_0x2be6f9]['email']===_0xb15534){_0xf3d006=!![];}}if(_0xf3d006){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xeb09('0x63')});}}})['then'](respondWithResult(_0x2fe793,null))['catch'](function(_0x59fa97){var _0x15e07d=_0x2306bd[_0xeb09('0x33')][_0xeb09('0x64')]?0x1f4:_0x59fa97[_0xeb09('0x65')]||0x1f4;logger['error'](_0xeb09('0x66'),_0xeb09('0x57'),_0x15e07d,JSON['stringify'](_0x59fa97));delete _0x59fa97['name'];if(_0x15e07d===0x191){_0x15e07d=0x190;}_0x2fe793[_0xeb09('0x1b')](_0x15e07d)['send'](_0x2306bd[_0xeb09('0x33')][_0xeb09('0x64')]?{'message':_0xeb09('0x67'),'statusCode':_0x59fa97[_0xeb09('0x65')]}:_0x59fa97);});}; \ No newline at end of file +var _0x01fe=['type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','params','rawAttributes','include','find','catch','create','body','getConfigurations','findOne','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','GET','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','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','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','update','then','destroy','send','index','map','FreshsalesAccount','fieldName'];(function(_0x3e7192,_0x375882){var _0x4d271d=function(_0x48f4d4){while(--_0x48f4d4){_0x3e7192['push'](_0x3e7192['shift']());}};_0x4d271d(++_0x375882);}(_0x01fe,0x98));var _0xe01f=function(_0x211fe4,_0x4df66b){_0x211fe4=_0x211fe4-0x0;var _0x21b3fd=_0x01fe[_0x211fe4];return _0x21b3fd;};'use strict';var emlformat=require(_0xe01f('0x0'));var rimraf=require(_0xe01f('0x1'));var zipdir=require(_0xe01f('0x2'));var jsonpatch=require(_0xe01f('0x3'));var rp=require(_0xe01f('0x4'));var moment=require(_0xe01f('0x5'));var BPromise=require(_0xe01f('0x6'));var Mustache=require('mustache');var util=require(_0xe01f('0x7'));var path=require(_0xe01f('0x8'));var sox=require(_0xe01f('0x9'));var csv=require(_0xe01f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe01f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe01f('0xc'));var jsforce=require(_0xe01f('0xd'));var deskjs=require(_0xe01f('0xe'));var toCsv=require(_0xe01f('0xa'));var querystring=require(_0xe01f('0xf'));var Papa=require(_0xe01f('0x10'));var Redis=require(_0xe01f('0x11'));var authService=require(_0xe01f('0x12'));var qs=require(_0xe01f('0x13'));var as=require(_0xe01f('0x14'));var hardwareService=require(_0xe01f('0x15'));var logger=require(_0xe01f('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xe01f('0x17'));var licenseUtil=require(_0xe01f('0x18'));var db=require(_0xe01f('0x19'))['db'];var integrations=require(_0xe01f('0x1a'));function respondWithStatusCode(_0x53a1e1,_0x733715){_0x733715=_0x733715||0xcc;return function(_0x2454f1){if(_0x2454f1){return _0x53a1e1[_0xe01f('0x1b')](_0x733715);}return _0x53a1e1[_0xe01f('0x1c')](_0x733715)[_0xe01f('0x1d')]();};}function respondWithResult(_0x3ebb4e,_0x418b60){_0x418b60=_0x418b60||0xc8;return function(_0xfc980f){if(_0xfc980f){return _0x3ebb4e['status'](_0x418b60)[_0xe01f('0x1e')](_0xfc980f);}};}function respondWithFilteredResult(_0x15789c,_0x4402a2){return function(_0x17c602){if(_0x17c602){var _0x2a9bb6=typeof _0x4402a2['offset']===_0xe01f('0x1f')&&typeof _0x4402a2['limit']==='undefined';var _0x555c37=_0x17c602[_0xe01f('0x20')];var _0xf1a64a=_0x2a9bb6?0x0:_0x4402a2[_0xe01f('0x21')];var _0x502988=_0x2a9bb6?_0x17c602[_0xe01f('0x20')]:_0x4402a2[_0xe01f('0x21')]+_0x4402a2[_0xe01f('0x22')];var _0x47dc34;if(_0x502988>=_0x555c37){_0x502988=_0x555c37;_0x47dc34=0xc8;}else{_0x47dc34=0xce;}_0x15789c['status'](_0x47dc34);return _0x15789c['set'](_0xe01f('0x23'),_0xf1a64a+'-'+_0x502988+'/'+_0x555c37)['json'](_0x17c602);}return null;};}function patchUpdates(_0x9b1b2c){return function(_0x1ea74a){try{jsonpatch[_0xe01f('0x24')](_0x1ea74a,_0x9b1b2c,!![]);}catch(_0x369a1b){return BPromise['reject'](_0x369a1b);}return _0x1ea74a[_0xe01f('0x25')]();};}function saveUpdates(_0x585387,_0x59e970){return function(_0x1616a8){if(_0x1616a8){return _0x1616a8[_0xe01f('0x26')](_0x585387)[_0xe01f('0x27')](function(_0x7f27c5){return _0x7f27c5;});}return null;};}function removeEntity(_0x14050c,_0x1f63e0){return function(_0x524332){if(_0x524332){return _0x524332[_0xe01f('0x28')]()[_0xe01f('0x27')](function(){_0x14050c[_0xe01f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c45f4,_0x3c459){return function(_0x188809){if(!_0x188809){_0x4c45f4['sendStatus'](0x194);}return _0x188809;};}function handleError(_0x32971f,_0xb838d1){_0xb838d1=_0xb838d1||0x1f4;return function(_0xc4b6bd){logger['error'](_0xc4b6bd['stack']);if(_0xc4b6bd['name']){delete _0xc4b6bd['name'];}_0x32971f[_0xe01f('0x1c')](_0xb838d1)[_0xe01f('0x29')](_0xc4b6bd);};}exports[_0xe01f('0x2a')]=function(_0x1db584,_0x5210ca){var _0x9b2013={},_0x53859e={},_0x18a5c5={'count':0x0,'rows':[]};var _0x56c06a=_[_0xe01f('0x2b')](db[_0xe01f('0x2c')]['rawAttributes'],function(_0x4828ab){return{'name':_0x4828ab[_0xe01f('0x2d')],'type':_0x4828ab[_0xe01f('0x2e')][_0xe01f('0x2f')]};});_0x53859e[_0xe01f('0x30')]=_[_0xe01f('0x2b')](_0x56c06a,'name');_0x53859e['query']=_[_0xe01f('0x31')](_0x1db584[_0xe01f('0x32')]);_0x53859e[_0xe01f('0x33')]=_[_0xe01f('0x34')](_0x53859e[_0xe01f('0x30')],_0x53859e['query']);_0x9b2013[_0xe01f('0x35')]=_['intersection'](_0x53859e['model'],qs[_0xe01f('0x36')](_0x1db584[_0xe01f('0x32')][_0xe01f('0x36')]));_0x9b2013[_0xe01f('0x35')]=_0x9b2013['attributes'][_0xe01f('0x37')]?_0x9b2013[_0xe01f('0x35')]:_0x53859e['model'];if(!_0x1db584[_0xe01f('0x32')][_0xe01f('0x38')]('nolimit')){_0x9b2013[_0xe01f('0x22')]=qs[_0xe01f('0x22')](_0x1db584[_0xe01f('0x32')][_0xe01f('0x22')]);_0x9b2013[_0xe01f('0x21')]=qs['offset'](_0x1db584[_0xe01f('0x32')]['offset']);}_0x9b2013[_0xe01f('0x39')]=qs[_0xe01f('0x3a')](_0x1db584[_0xe01f('0x32')]['sort']);_0x9b2013[_0xe01f('0x3b')]=qs['filters'](_[_0xe01f('0x3c')](_0x1db584['query'],_0x53859e[_0xe01f('0x33')]),_0x56c06a);if(_0x1db584[_0xe01f('0x32')][_0xe01f('0x3d')]){_0x9b2013[_0xe01f('0x3b')]=_[_0xe01f('0x3e')](_0x9b2013[_0xe01f('0x3b')],{'$or':_['map'](_0x56c06a,function(_0x4574ee){if(_0x4574ee[_0xe01f('0x2e')]!==_0xe01f('0x3f')){var _0x1b3905={};_0x1b3905[_0x4574ee[_0xe01f('0x40')]]={'$like':'%'+_0x1db584[_0xe01f('0x32')][_0xe01f('0x3d')]+'%'};return _0x1b3905;}})});}_0x9b2013=_['merge']({},_0x9b2013,_0x1db584[_0xe01f('0x41')]);var _0x297011={'where':_0x9b2013[_0xe01f('0x3b')]};return db[_0xe01f('0x2c')]['count'](_0x297011)[_0xe01f('0x27')](function(_0x40426c){_0x18a5c5[_0xe01f('0x20')]=_0x40426c;if(_0x1db584[_0xe01f('0x32')][_0xe01f('0x42')]){_0x9b2013['include']=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x9b2013);})[_0xe01f('0x27')](function(_0x117052){_0x18a5c5['rows']=_0x117052;return _0x18a5c5;})[_0xe01f('0x27')](respondWithFilteredResult(_0x5210ca,_0x9b2013))['catch'](handleError(_0x5210ca,null));};exports['show']=function(_0x49aee5,_0x14a104){var _0x42740d={'raw':![],'where':{'id':_0x49aee5[_0xe01f('0x43')]['id']}},_0x123d94={};_0x123d94[_0xe01f('0x30')]=_[_0xe01f('0x31')](db['FreshsalesAccount'][_0xe01f('0x44')]);_0x123d94[_0xe01f('0x32')]=_[_0xe01f('0x31')](_0x49aee5[_0xe01f('0x32')]);_0x123d94[_0xe01f('0x33')]=_[_0xe01f('0x34')](_0x123d94[_0xe01f('0x30')],_0x123d94[_0xe01f('0x32')]);_0x42740d['attributes']=_[_0xe01f('0x34')](_0x123d94['model'],qs['fields'](_0x49aee5[_0xe01f('0x32')][_0xe01f('0x36')]));_0x42740d['attributes']=_0x42740d['attributes']['length']?_0x42740d[_0xe01f('0x35')]:_0x123d94['model'];if(_0x49aee5[_0xe01f('0x32')][_0xe01f('0x42')]){_0x42740d[_0xe01f('0x45')]=[{'all':!![]}];}_0x42740d=_[_0xe01f('0x3e')]({},_0x42740d,_0x49aee5[_0xe01f('0x41')]);return db['FreshsalesAccount'][_0xe01f('0x46')](_0x42740d)['then'](handleEntityNotFound(_0x14a104,null))[_0xe01f('0x27')](respondWithResult(_0x14a104,null))[_0xe01f('0x47')](handleError(_0x14a104,null));};exports[_0xe01f('0x48')]=function(_0x279912,_0x1856e6){return db['FreshsalesAccount']['create'](_0x279912[_0xe01f('0x49')],{})[_0xe01f('0x27')](respondWithResult(_0x1856e6,0xc9))[_0xe01f('0x47')](handleError(_0x1856e6,null));};exports['update']=function(_0x4d75d6,_0x925b8c){if(_0x4d75d6[_0xe01f('0x49')]['id']){delete _0x4d75d6[_0xe01f('0x49')]['id'];}return db[_0xe01f('0x2c')][_0xe01f('0x46')]({'where':{'id':_0x4d75d6[_0xe01f('0x43')]['id']}})[_0xe01f('0x27')](handleEntityNotFound(_0x925b8c,null))[_0xe01f('0x27')](saveUpdates(_0x4d75d6['body'],null))[_0xe01f('0x27')](respondWithResult(_0x925b8c,null))[_0xe01f('0x47')](handleError(_0x925b8c,null));};exports[_0xe01f('0x28')]=function(_0x53e756,_0x23bbe1){return db['FreshsalesAccount'][_0xe01f('0x46')]({'where':{'id':_0x53e756[_0xe01f('0x43')]['id']}})[_0xe01f('0x27')](handleEntityNotFound(_0x23bbe1,null))[_0xe01f('0x27')](removeEntity(_0x23bbe1,null))[_0xe01f('0x47')](handleError(_0x23bbe1,null));};exports[_0xe01f('0x4a')]=function(_0x487db3,_0xd7a6de,_0x251221){var _0x1398cd={};var _0x1d290a={};var _0x557cc7;var _0x22354e;return db['FreshsalesAccount'][_0xe01f('0x4b')]({'where':{'id':_0x487db3['params']['id']}})[_0xe01f('0x27')](handleEntityNotFound(_0xd7a6de,null))[_0xe01f('0x27')](function(_0x375b5a){if(_0x375b5a){_0x557cc7=_0x375b5a;_0x1d290a[_0xe01f('0x30')]=_[_0xe01f('0x31')](db['FreshsalesConfiguration'][_0xe01f('0x44')]);_0x1d290a[_0xe01f('0x32')]=_[_0xe01f('0x31')](_0x487db3[_0xe01f('0x32')]);_0x1d290a[_0xe01f('0x33')]=_[_0xe01f('0x34')](_0x1d290a[_0xe01f('0x30')],_0x1d290a[_0xe01f('0x32')]);_0x1398cd[_0xe01f('0x35')]=_['intersection'](_0x1d290a[_0xe01f('0x30')],qs['fields'](_0x487db3[_0xe01f('0x32')][_0xe01f('0x36')]));_0x1398cd[_0xe01f('0x35')]=_0x1398cd[_0xe01f('0x35')][_0xe01f('0x37')]?_0x1398cd[_0xe01f('0x35')]:_0x1d290a[_0xe01f('0x30')];_0x1398cd[_0xe01f('0x39')]=qs[_0xe01f('0x3a')](_0x487db3['query'][_0xe01f('0x3a')]);_0x1398cd[_0xe01f('0x3b')]=qs[_0xe01f('0x33')](_['pick'](_0x487db3[_0xe01f('0x32')],_0x1d290a['filters']));if(_0x487db3['query'][_0xe01f('0x3d')]){_0x1398cd['where']=_[_0xe01f('0x3e')](_0x1398cd[_0xe01f('0x3b')],{'$or':_['map'](_0x1398cd[_0xe01f('0x35')],function(_0x4168c2){var _0x552172={};_0x552172[_0x4168c2]={'$like':'%'+_0x487db3['query']['filter']+'%'};return _0x552172;})});}_0x1398cd=_[_0xe01f('0x3e')]({},_0x1398cd,_0x487db3[_0xe01f('0x41')]);return _0x557cc7[_0xe01f('0x4a')](_0x1398cd);}})[_0xe01f('0x27')](function(_0x428371){if(_0x428371){_0x22354e=_0x428371[_0xe01f('0x37')];if(!_0x487db3['query']['hasOwnProperty'](_0xe01f('0x4c'))){_0x1398cd[_0xe01f('0x22')]=qs[_0xe01f('0x22')](_0x487db3[_0xe01f('0x32')][_0xe01f('0x22')]);_0x1398cd['offset']=qs[_0xe01f('0x21')](_0x487db3[_0xe01f('0x32')][_0xe01f('0x21')]);}return _0x557cc7[_0xe01f('0x4a')](_0x1398cd);}})['then'](function(_0x165fdc){if(_0x165fdc){return _0x165fdc?{'count':_0x22354e,'rows':_0x165fdc}:null;}})[_0xe01f('0x27')](respondWithResult(_0xd7a6de,null))[_0xe01f('0x47')](handleError(_0xd7a6de,null));};exports['addConfiguration']=function(_0x2f19e4,_0x118e60,_0x5d2d23){if(_0x2f19e4['body']['id']){delete _0x2f19e4[_0xe01f('0x49')]['id'];}return db[_0xe01f('0x2c')][_0xe01f('0x4b')]({'where':{'id':_0x2f19e4[_0xe01f('0x43')]['id']}})[_0xe01f('0x27')](handleEntityNotFound(_0x118e60,null))['then'](function(_0xc6c70c){if(_0xc6c70c){_0x2f19e4['body'][_0xe01f('0x4d')]=_0xc6c70c['id'];_0x2f19e4[_0xe01f('0x49')][_0xe01f('0x4e')]=integrations[_0xe01f('0x4f')](_0x2f19e4[_0xe01f('0x49')][_0xe01f('0x50')],_0x2f19e4['body'][_0xe01f('0x2e')]);_0x2f19e4[_0xe01f('0x49')][_0xe01f('0x51')]=integrations[_0xe01f('0x52')](_0x2f19e4['body']['channel'],_0x2f19e4[_0xe01f('0x49')][_0xe01f('0x2e')]);return db['FreshsalesConfiguration'][_0xe01f('0x48')](_0x2f19e4[_0xe01f('0x49')],{'include':[{'model':db[_0xe01f('0x53')],'as':_0xe01f('0x4e')},{'model':db[_0xe01f('0x53')],'as':_0xe01f('0x51')}]});}return null;})[_0xe01f('0x27')](respondWithResult(_0x118e60,null))[_0xe01f('0x47')](handleError(_0x118e60,null));};exports[_0xe01f('0x54')]=function(_0x487fbb,_0x44ce82,_0x127fbe){var _0x124ddf='';var _0x6d4ecc='';return db['FreshsalesAccount'][_0xe01f('0x4b')]({'where':{'id':_0x487fbb[_0xe01f('0x43')]['id']},'attributes':['id',_0xe01f('0x55'),'remoteUri',_0xe01f('0x56')]})['then'](handleEntityNotFound(_0x44ce82,null))[_0xe01f('0x27')](function(_0x5b95c5){if(_0x5b95c5){_0x6d4ecc=_0x5b95c5[_0xe01f('0x55')];_0x124ddf=_0x5b95c5[_0xe01f('0x57')];var _0x22fb08=_0x5b95c5['remoteUri'][_0xe01f('0x58')](-0x1);if(_0x22fb08==='/'){_0x124ddf=_0x124ddf[_0xe01f('0x59')](0x0,_0x124ddf['lastIndexOf'](_0x22fb08));}return rp({'method':_0xe01f('0x5a'),'uri':util['format']('%s%s',_0x124ddf,'/api/selector/owners'),'headers':{'Authorization':_0xe01f('0x5b')+_0x5b95c5[_0xe01f('0x56')]},'json':!![]});}})[_0xe01f('0x27')](function(_0x5b2feb){if(_0x5b2feb){var _0x3f4f60=_0x5b2feb['users'];var _0x8ded24=![];var _0x457b4c=null;for(_0x457b4c=0x0;_0x457b4c<_0x3f4f60[_0xe01f('0x37')];_0x457b4c++){if(_0x3f4f60[_0x457b4c][_0xe01f('0x5c')]===_0x6d4ecc){_0x8ded24=!![];}}if(_0x8ded24){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xe01f('0x5d')});}}})[_0xe01f('0x27')](respondWithResult(_0x44ce82,null))[_0xe01f('0x47')](function(_0x5e3437){var _0x550b01=_0x487fbb[_0xe01f('0x32')][_0xe01f('0x5e')]?0x1f4:_0x5e3437[_0xe01f('0x5f')]||0x1f4;logger['error'](_0xe01f('0x60'),_0xe01f('0x54'),_0x550b01,JSON[_0xe01f('0x61')](_0x5e3437));delete _0x5e3437[_0xe01f('0x40')];if(_0x550b01===0x191){_0x550b01=0x190;}_0x44ce82[_0xe01f('0x1c')](_0x550b01)[_0xe01f('0x29')](_0x487fbb[_0xe01f('0x32')]['test']?{'message':_0xe01f('0x62'),'statusCode':_0x5e3437['statusCode']}:_0x5e3437);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 6108946..26c2c10 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 _0xadb5=['../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xadb5,0xad));var _0x5adb=function(_0x5e6a49,_0x47f003){_0x5e6a49=_0x5e6a49-0x0;var _0x17cc26=_0xadb5[_0x5e6a49];return _0x17cc26;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x5adb('0x7'));module[_0x5adb('0x8')]=function(_0x3e2555,_0x3213e8){return _0x3e2555[_0x5adb('0x9')](_0x5adb('0xa'),attributes,{'tableName':_0x5adb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6343=['../../components/integrations/configuration','exports','define','../../config/logger','api','rimraf','../../config/environment'];(function(_0x32e443,_0x3d249b){var _0x55f2de=function(_0x5290ca){while(--_0x5290ca){_0x32e443['push'](_0x32e443['shift']());}};_0x55f2de(++_0x3d249b);}(_0x6343,0x168));var _0x3634=function(_0x2a9e21,_0x44e605){_0x2a9e21=_0x2a9e21-0x0;var _0xa0d934=_0x6343[_0x2a9e21];return _0xa0d934;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3634('0x0'))(_0x3634('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3634('0x2'));var config=require(_0x3634('0x3'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x3634('0x4'));module[_0x3634('0x5')]=function(_0x4bb496,_0x302828){return _0x4bb496[_0x3634('0x6')]('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 dcd21e5..3fb68f8 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 _0x7096=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','map','model','find','ShowFreshsalesAccount','util','bluebird','ioredis','../../mysqldb'];(function(_0x5ea2f9,_0x320917){var _0x36e586=function(_0x2e79a2){while(--_0x2e79a2){_0x5ea2f9['push'](_0x5ea2f9['shift']());}};_0x36e586(++_0x320917);}(_0x7096,0x10c));var _0x6709=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7096[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});}exports[_0x6709('0x16')]=function(_0x235a54){var _0x4a732e=this;return new Promise(function(_0x9c1fd8,_0x166c97){return db[_0x6709('0x17')]['findAll']({'raw':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x19')]===undefined?!![]:![]:!![],'where':_0x235a54[_0x6709('0x18')]?_0x235a54['options'][_0x6709('0x1a')]||null:null,'attributes':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x1b')]||null:null,'limit':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x1c')]||null:null,'include':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x235a54[_0x6709('0x18')]['include'],function(_0x29f25f){return{'model':db[_0x29f25f[_0x6709('0x1f')]],'as':_0x29f25f['as'],'attributes':_0x29f25f[_0x6709('0x1b')],'include':_0x29f25f['include']?_[_0x6709('0x1e')](_0x29f25f[_0x6709('0x1d')],function(_0x20a347){return{'model':db[_0x20a347[_0x6709('0x1f')]],'as':_0x20a347['as'],'attributes':_0x20a347['attributes'],'include':_0x20a347[_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x20a347['include'],function(_0x585073){return{'model':db[_0x585073[_0x6709('0x1f')]],'as':_0x585073['as'],'attributes':_0x585073['attributes']};}):[]};}):[]};}):[]:[]})[_0x6709('0xb')](function(_0x2499a2){logger['info'](_0x6709('0x16'),_0x235a54);logger['debug'](_0x6709('0x16'),_0x235a54,JSON[_0x6709('0x10')](_0x2499a2));_0x9c1fd8(_0x2499a2);})['catch'](function(_0x137137){logger['error'](_0x6709('0x16'),_0x137137[_0x6709('0x13')],_0x235a54);_0x166c97(_0x4a732e['error'](0x1f4,_0x137137[_0x6709('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x138318){var _0x135f46=this;return new Promise(function(_0x4b93b2,_0x564dcb){return db[_0x6709('0x17')][_0x6709('0x20')]({'raw':_0x138318[_0x6709('0x18')]?_0x138318[_0x6709('0x18')][_0x6709('0x19')]===undefined?!![]:![]:!![],'where':_0x138318[_0x6709('0x18')]?_0x138318[_0x6709('0x18')][_0x6709('0x1a')]||null:null,'attributes':_0x138318[_0x6709('0x18')]?_0x138318['options'][_0x6709('0x1b')]||null:null,'include':_0x138318[_0x6709('0x18')]?_0x138318[_0x6709('0x18')][_0x6709('0x1d')]?_['map'](_0x138318[_0x6709('0x18')][_0x6709('0x1d')],function(_0x124e01){return{'model':db[_0x124e01[_0x6709('0x1f')]],'as':_0x124e01['as'],'attributes':_0x124e01['attributes'],'include':_0x124e01[_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x124e01['include'],function(_0x8952f1){return{'model':db[_0x8952f1[_0x6709('0x1f')]],'as':_0x8952f1['as'],'attributes':_0x8952f1['attributes'],'include':_0x8952f1[_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x8952f1[_0x6709('0x1d')],function(_0xf30c4c){return{'model':db[_0xf30c4c[_0x6709('0x1f')]],'as':_0xf30c4c['as'],'attributes':_0xf30c4c[_0x6709('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6709('0xb')](function(_0x4bfed4){logger[_0x6709('0xc')](_0x6709('0x21'),_0x138318);logger['debug'](_0x6709('0x21'),_0x138318,JSON[_0x6709('0x10')](_0x4bfed4));_0x4b93b2(_0x4bfed4);})[_0x6709('0x15')](function(_0x2bb89c){logger[_0x6709('0x11')](_0x6709('0x21'),_0x2bb89c['message'],_0x138318);_0x564dcb(_0x135f46[_0x6709('0x11')](0x1f4,_0x2bb89c['message']));});});}; \ No newline at end of file +var _0x8952=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','ShowFreshsalesAccount','find','raw','debug','util','moment','bluebird'];(function(_0x2caf41,_0x5b398e){var _0x5ca4de=function(_0x5ae652){while(--_0x5ae652){_0x2caf41['push'](_0x2caf41['shift']());}};_0x5ca4de(++_0x5b398e);}(_0x8952,0x17e));var _0x2895=function(_0x4bcc47,_0x33ce29){_0x4bcc47=_0x4bcc47-0x0;var _0x3c843c=_0x8952[_0x4bcc47];return _0x3c843c;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});}exports[_0x2895('0x15')]=function(_0xbf8b63){var _0x2cb505=this;return new Promise(function(_0x155124,_0x184d11){return db[_0x2895('0x16')][_0x2895('0x17')]({'raw':_0xbf8b63['options']?_0xbf8b63['options']['raw']===undefined?!![]:![]:!![],'where':_0xbf8b63[_0x2895('0x18')]?_0xbf8b63[_0x2895('0x18')][_0x2895('0x19')]||null:null,'attributes':_0xbf8b63['options']?_0xbf8b63[_0x2895('0x18')][_0x2895('0x1a')]||null:null,'limit':_0xbf8b63[_0x2895('0x18')]?_0xbf8b63[_0x2895('0x18')][_0x2895('0x1b')]||null:null,'include':_0xbf8b63['options']?_0xbf8b63[_0x2895('0x18')][_0x2895('0x1c')]?_['map'](_0xbf8b63[_0x2895('0x18')][_0x2895('0x1c')],function(_0x6f8ad4){return{'model':db[_0x6f8ad4['model']],'as':_0x6f8ad4['as'],'attributes':_0x6f8ad4['attributes'],'include':_0x6f8ad4[_0x2895('0x1c')]?_[_0x2895('0x1d')](_0x6f8ad4[_0x2895('0x1c')],function(_0x4a21cf){return{'model':db[_0x4a21cf[_0x2895('0x1e')]],'as':_0x4a21cf['as'],'attributes':_0x4a21cf[_0x2895('0x1a')],'include':_0x4a21cf['include']?_[_0x2895('0x1d')](_0x4a21cf[_0x2895('0x1c')],function(_0x2cd4df){return{'model':db[_0x2cd4df['model']],'as':_0x2cd4df['as'],'attributes':_0x2cd4df[_0x2895('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2895('0xc')](function(_0x5eedfc){logger[_0x2895('0xd')]('GetFreshsalesAccount',_0xbf8b63);logger['debug'](_0x2895('0x15'),_0xbf8b63,JSON['stringify'](_0x5eedfc));_0x155124(_0x5eedfc);})[_0x2895('0x14')](function(_0x381538){logger['error']('GetFreshsalesAccount',_0x381538[_0x2895('0x12')],_0xbf8b63);_0x184d11(_0x2cb505[_0x2895('0x10')](0x1f4,_0x381538[_0x2895('0x12')]));});});};exports[_0x2895('0x1f')]=function(_0x14d150){var _0xa61689=this;return new Promise(function(_0x34e110,_0x546514){return db[_0x2895('0x16')][_0x2895('0x20')]({'raw':_0x14d150[_0x2895('0x18')]?_0x14d150['options'][_0x2895('0x21')]===undefined?!![]:![]:!![],'where':_0x14d150[_0x2895('0x18')]?_0x14d150[_0x2895('0x18')][_0x2895('0x19')]||null:null,'attributes':_0x14d150['options']?_0x14d150[_0x2895('0x18')][_0x2895('0x1a')]||null:null,'include':_0x14d150[_0x2895('0x18')]?_0x14d150[_0x2895('0x18')][_0x2895('0x1c')]?_['map'](_0x14d150['options'][_0x2895('0x1c')],function(_0xf3c8f7){return{'model':db[_0xf3c8f7['model']],'as':_0xf3c8f7['as'],'attributes':_0xf3c8f7[_0x2895('0x1a')],'include':_0xf3c8f7['include']?_[_0x2895('0x1d')](_0xf3c8f7[_0x2895('0x1c')],function(_0x586c4a){return{'model':db[_0x586c4a[_0x2895('0x1e')]],'as':_0x586c4a['as'],'attributes':_0x586c4a['attributes'],'include':_0x586c4a[_0x2895('0x1c')]?_['map'](_0x586c4a['include'],function(_0xa6fe9e){return{'model':db[_0xa6fe9e[_0x2895('0x1e')]],'as':_0xa6fe9e['as'],'attributes':_0xa6fe9e[_0x2895('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e4348){logger[_0x2895('0xd')](_0x2895('0x1f'),_0x14d150);logger[_0x2895('0x22')](_0x2895('0x1f'),_0x14d150,JSON[_0x2895('0xf')](_0x1e4348));_0x34e110(_0x1e4348);})[_0x2895('0x14')](function(_0x240230){logger[_0x2895('0x10')](_0x2895('0x1f'),_0x240230['message'],_0x14d150);_0x546514(_0xa61689[_0x2895('0x10')](0x1f4,_0x240230[_0x2895('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index d3e15c4..d1db931 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 _0xa3d7=['getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','index','get','/:id','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0xa3d7,0xe8));var _0x7a3d=function(_0x32bb6b,_0x1a5fbe){_0x32bb6b=_0x32bb6b-0x0;var _0x58dcb4=_0xa3d7[_0x32bb6b];return _0x58dcb4;};'use strict';var multer=require(_0x7a3d('0x0'));var util=require(_0x7a3d('0x1'));var path=require(_0x7a3d('0x2'));var timeout=require(_0x7a3d('0x3'));var express=require(_0x7a3d('0x4'));var router=express[_0x7a3d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7a3d('0x6'));var config=require(_0x7a3d('0x7'));var controller=require(_0x7a3d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a3d('0x9')]);router[_0x7a3d('0xa')](_0x7a3d('0xb'),auth[_0x7a3d('0xc')](),controller['show']);router['get'](_0x7a3d('0xd'),auth[_0x7a3d('0xc')](),controller[_0x7a3d('0xe')]);router[_0x7a3d('0xa')](_0x7a3d('0xf'),auth[_0x7a3d('0xc')](),controller[_0x7a3d('0x10')]);router[_0x7a3d('0xa')](_0x7a3d('0x11'),auth[_0x7a3d('0xc')](),controller[_0x7a3d('0x12')]);router[_0x7a3d('0x13')]('/',auth[_0x7a3d('0xc')](),controller[_0x7a3d('0x14')]);router[_0x7a3d('0x15')](_0x7a3d('0xb'),auth[_0x7a3d('0xc')](),controller[_0x7a3d('0x16')]);router[_0x7a3d('0x17')]('/:id',auth[_0x7a3d('0xc')](),controller[_0x7a3d('0x18')]);module['exports']=router; \ No newline at end of file +var _0x2d31=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','update','delete','destroy','multer','path','express','fs-extra','../../components/auth/service'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0x2d31,0x113));var _0x12d3=function(_0x1a9e78,_0x180720){_0x1a9e78=_0x1a9e78-0x0;var _0x113e06=_0x2d31[_0x1a9e78];return _0x113e06;};'use strict';var multer=require(_0x12d3('0x0'));var util=require('util');var path=require(_0x12d3('0x1'));var timeout=require('connect-timeout');var express=require(_0x12d3('0x2'));var router=express['Router']();var fs_extra=require(_0x12d3('0x3'));var auth=require(_0x12d3('0x4'));var interaction=require(_0x12d3('0x5'));var config=require(_0x12d3('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x12d3('0x7')]('/',auth['isAuthenticated'](),controller[_0x12d3('0x8')]);router[_0x12d3('0x7')]('/:id',auth[_0x12d3('0x9')](),controller[_0x12d3('0xa')]);router[_0x12d3('0x7')](_0x12d3('0xb'),auth[_0x12d3('0x9')](),controller[_0x12d3('0xc')]);router['get'](_0x12d3('0xd'),auth['isAuthenticated'](),controller[_0x12d3('0xe')]);router[_0x12d3('0x7')](_0x12d3('0xf'),auth[_0x12d3('0x9')](),controller[_0x12d3('0x10')]);router['post']('/',auth[_0x12d3('0x9')](),controller['create']);router['put']('/:id',auth[_0x12d3('0x9')](),controller[_0x12d3('0x11')]);router[_0x12d3('0x12')]('/:id',auth[_0x12d3('0x9')](),controller[_0x12d3('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index ae5cc24..8b708e5 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 _0xa93a=['STRING'];(function(_0x38a155,_0x2aa026){var _0x269403=function(_0x47263b){while(--_0x47263b){_0x38a155['push'](_0x38a155['shift']());}};_0x269403(++_0x2aa026);}(_0xa93a,0x1f3));var _0xaa93=function(_0x3753e4,_0x29beeb){_0x3753e4=_0x3753e4-0x0;var _0x1ce9e0=_0xa93a[_0x3753e4];return _0x1ce9e0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaa93('0x0')]},'description':{'type':Sequelize[_0xaa93('0x0')]}}; \ No newline at end of file +var _0x484d=['STRING','exports'];(function(_0x2ab117,_0x2eba23){var _0x5e736c=function(_0x5c694e){while(--_0x5c694e){_0x2ab117['push'](_0x2ab117['shift']());}};_0x5e736c(++_0x2eba23);}(_0x484d,0x9b));var _0xd484=function(_0x558cd6,_0x19bb75){_0x558cd6=_0x558cd6-0x0;var _0x86ff74=_0x484d[_0x558cd6];return _0x86ff74;};'use strict';var Sequelize=require('sequelize');module[_0xd484('0x0')]={'name':{'type':Sequelize[_0xd484('0x1')]},'description':{'type':Sequelize[_0xd484('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 512ea3b..e4fc7d4 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 _0x30e2=['VIRTUAL','options','FreshsalesConfiguration','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','getSubjects','findOne','FreshsalesField','length','order','getDescriptions','pick','getFields','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','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/license/util','../../mysqldb','sendStatus','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','status','end','error','stack','name','send','index','fieldName','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type'];(function(_0x392950,_0x48f861){var _0x532f67=function(_0x58b37d){while(--_0x58b37d){_0x392950['push'](_0x392950['shift']());}};_0x532f67(++_0x48f861);}(_0x30e2,0x167));var _0x230e=function(_0x3edb04,_0x26bf5a){_0x3edb04=_0x3edb04-0x0;var _0x2082e8=_0x30e2[_0x3edb04];return _0x2082e8;};'use strict';var emlformat=require(_0x230e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x230e('0x1'));var jsonpatch=require(_0x230e('0x2'));var rp=require(_0x230e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x230e('0x4'));var util=require(_0x230e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x230e('0x6'));var ejs=require(_0x230e('0x7'));var fs=require('fs');var fs_extra=require(_0x230e('0x8'));var _=require(_0x230e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x230e('0xa'));var deskjs=require(_0x230e('0xb'));var toCsv=require(_0x230e('0x6'));var querystring=require(_0x230e('0xc'));var Papa=require(_0x230e('0xd'));var Redis=require(_0x230e('0xe'));var authService=require(_0x230e('0xf'));var qs=require(_0x230e('0x10'));var as=require(_0x230e('0x11'));var hardwareService=require(_0x230e('0x12'));var logger=require(_0x230e('0x13'))(_0x230e('0x14'));var utils=require(_0x230e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x230e('0x16'));var db=require(_0x230e('0x17'))['db'];function respondWithStatusCode(_0x3da563,_0x4016d5){_0x4016d5=_0x4016d5||0xcc;return function(_0x175df8){if(_0x175df8){return _0x3da563[_0x230e('0x18')](_0x4016d5);}return _0x3da563['status'](_0x4016d5)['end']();};}function respondWithResult(_0x4c6058,_0x56ba38){_0x56ba38=_0x56ba38||0xc8;return function(_0x1ab108){if(_0x1ab108){return _0x4c6058['status'](_0x56ba38)[_0x230e('0x19')](_0x1ab108);}};}function respondWithFilteredResult(_0x2dec29,_0x2c235f){return function(_0x2ecf60){if(_0x2ecf60){var _0xbc4645=typeof _0x2c235f['offset']==='undefined'&&typeof _0x2c235f[_0x230e('0x1a')]===_0x230e('0x1b');var _0x452f6b=_0x2ecf60[_0x230e('0x1c')];var _0x19f633=_0xbc4645?0x0:_0x2c235f[_0x230e('0x1d')];var _0x310a9f=_0xbc4645?_0x2ecf60[_0x230e('0x1c')]:_0x2c235f['offset']+_0x2c235f['limit'];var _0x59c628;if(_0x310a9f>=_0x452f6b){_0x310a9f=_0x452f6b;_0x59c628=0xc8;}else{_0x59c628=0xce;}_0x2dec29['status'](_0x59c628);return _0x2dec29[_0x230e('0x1e')](_0x230e('0x1f'),_0x19f633+'-'+_0x310a9f+'/'+_0x452f6b)[_0x230e('0x19')](_0x2ecf60);}return null;};}function patchUpdates(_0x2a529e){return function(_0x67be15){try{jsonpatch[_0x230e('0x20')](_0x67be15,_0x2a529e,!![]);}catch(_0x5ad54f){return BPromise[_0x230e('0x21')](_0x5ad54f);}return _0x67be15[_0x230e('0x22')]();};}function saveUpdates(_0x2ba996,_0x1035c5){return function(_0xe40e8a){if(_0xe40e8a){return _0xe40e8a[_0x230e('0x23')](_0x2ba996)[_0x230e('0x24')](function(_0x2e0164){return _0x2e0164;});}return null;};}function removeEntity(_0x41bc36,_0xc9d350){return function(_0x5afefb){if(_0x5afefb){return _0x5afefb['destroy']()['then'](function(){_0x41bc36[_0x230e('0x25')](0xcc)[_0x230e('0x26')]();});}};}function handleEntityNotFound(_0x513768,_0x54e2fd){return function(_0x482598){if(!_0x482598){_0x513768[_0x230e('0x18')](0x194);}return _0x482598;};}function handleError(_0x39f079,_0x2b9b54){_0x2b9b54=_0x2b9b54||0x1f4;return function(_0x140004){logger[_0x230e('0x27')](_0x140004[_0x230e('0x28')]);if(_0x140004[_0x230e('0x29')]){delete _0x140004['name'];}_0x39f079[_0x230e('0x25')](_0x2b9b54)[_0x230e('0x2a')](_0x140004);};}exports[_0x230e('0x2b')]=function(_0xe8d8f,_0x3e8259){var _0x4e3fad={},_0x19a2b5={},_0x67fb27={'count':0x0,'rows':[]};var _0x440ef8=_['map'](db['FreshsalesConfiguration']['rawAttributes'],function(_0x365607){return{'name':_0x365607[_0x230e('0x2c')],'type':_0x365607['type'][_0x230e('0x2d')]};});_0x19a2b5[_0x230e('0x2e')]=_[_0x230e('0x2f')](_0x440ef8,_0x230e('0x29'));_0x19a2b5[_0x230e('0x30')]=_[_0x230e('0x31')](_0xe8d8f[_0x230e('0x30')]);_0x19a2b5['filters']=_[_0x230e('0x32')](_0x19a2b5['model'],_0x19a2b5[_0x230e('0x30')]);_0x4e3fad[_0x230e('0x33')]=_['intersection'](_0x19a2b5[_0x230e('0x2e')],qs[_0x230e('0x34')](_0xe8d8f[_0x230e('0x30')][_0x230e('0x34')]));_0x4e3fad['attributes']=_0x4e3fad[_0x230e('0x33')]['length']?_0x4e3fad['attributes']:_0x19a2b5[_0x230e('0x2e')];if(!_0xe8d8f[_0x230e('0x30')][_0x230e('0x35')](_0x230e('0x36'))){_0x4e3fad[_0x230e('0x1a')]=qs[_0x230e('0x1a')](_0xe8d8f[_0x230e('0x30')][_0x230e('0x1a')]);_0x4e3fad[_0x230e('0x1d')]=qs[_0x230e('0x1d')](_0xe8d8f[_0x230e('0x30')][_0x230e('0x1d')]);}_0x4e3fad['order']=qs['sort'](_0xe8d8f[_0x230e('0x30')][_0x230e('0x37')]);_0x4e3fad[_0x230e('0x38')]=qs['filters'](_['pick'](_0xe8d8f['query'],_0x19a2b5[_0x230e('0x39')]),_0x440ef8);if(_0xe8d8f['query'][_0x230e('0x3a')]){_0x4e3fad['where']=_[_0x230e('0x3b')](_0x4e3fad['where'],{'$or':_[_0x230e('0x2f')](_0x440ef8,function(_0x14c8de){if(_0x14c8de[_0x230e('0x3c')]!==_0x230e('0x3d')){var _0x4c6a53={};_0x4c6a53[_0x14c8de[_0x230e('0x29')]]={'$like':'%'+_0xe8d8f[_0x230e('0x30')][_0x230e('0x3a')]+'%'};return _0x4c6a53;}})});}_0x4e3fad=_[_0x230e('0x3b')]({},_0x4e3fad,_0xe8d8f[_0x230e('0x3e')]);var _0x16ad29={'where':_0x4e3fad['where']};return db[_0x230e('0x3f')][_0x230e('0x1c')](_0x16ad29)['then'](function(_0x5ccee6){_0x67fb27[_0x230e('0x1c')]=_0x5ccee6;if(_0xe8d8f[_0x230e('0x30')][_0x230e('0x40')]){_0x4e3fad['include']=[{'all':!![]}];}return db[_0x230e('0x3f')][_0x230e('0x41')](_0x4e3fad);})[_0x230e('0x24')](function(_0x54295f){_0x67fb27[_0x230e('0x42')]=_0x54295f;return _0x67fb27;})[_0x230e('0x24')](respondWithFilteredResult(_0x3e8259,_0x4e3fad))[_0x230e('0x43')](handleError(_0x3e8259,null));};exports[_0x230e('0x44')]=function(_0x4e08d6,_0x497964){var _0x74fd3f={'raw':![],'where':{'id':_0x4e08d6[_0x230e('0x45')]['id']}},_0x46b4f3={};_0x46b4f3[_0x230e('0x2e')]=_[_0x230e('0x31')](db['FreshsalesConfiguration'][_0x230e('0x46')]);_0x46b4f3[_0x230e('0x30')]=_['keys'](_0x4e08d6['query']);_0x46b4f3[_0x230e('0x39')]=_['intersection'](_0x46b4f3[_0x230e('0x2e')],_0x46b4f3[_0x230e('0x30')]);_0x74fd3f[_0x230e('0x33')]=_[_0x230e('0x32')](_0x46b4f3[_0x230e('0x2e')],qs[_0x230e('0x34')](_0x4e08d6[_0x230e('0x30')][_0x230e('0x34')]));_0x74fd3f[_0x230e('0x33')]=_0x74fd3f[_0x230e('0x33')]['length']?_0x74fd3f['attributes']:_0x46b4f3[_0x230e('0x2e')];if(_0x4e08d6[_0x230e('0x30')][_0x230e('0x40')]){_0x74fd3f[_0x230e('0x47')]=[{'all':!![]}];}_0x74fd3f=_[_0x230e('0x3b')]({},_0x74fd3f,_0x4e08d6['options']);return db[_0x230e('0x3f')][_0x230e('0x48')](_0x74fd3f)['then'](handleEntityNotFound(_0x497964,null))[_0x230e('0x24')](respondWithResult(_0x497964,null))[_0x230e('0x43')](handleError(_0x497964,null));};exports[_0x230e('0x49')]=function(_0x1fa0f2,_0x213ae3){return db['FreshsalesConfiguration'][_0x230e('0x49')](_0x1fa0f2[_0x230e('0x4a')],{})[_0x230e('0x24')](respondWithResult(_0x213ae3,0xc9))[_0x230e('0x43')](handleError(_0x213ae3,null));};exports['update']=function(_0x3db88f,_0x301753){if(_0x3db88f[_0x230e('0x4a')]['id']){delete _0x3db88f[_0x230e('0x4a')]['id'];}return db['FreshsalesConfiguration'][_0x230e('0x48')]({'where':{'id':_0x3db88f['params']['id']}})[_0x230e('0x24')](handleEntityNotFound(_0x301753,null))['then'](saveUpdates(_0x3db88f[_0x230e('0x4a')],null))[_0x230e('0x24')](respondWithResult(_0x301753,null))[_0x230e('0x43')](handleError(_0x301753,null));};exports[_0x230e('0x4b')]=function(_0x5494ea,_0x3bcd14){return db[_0x230e('0x3f')][_0x230e('0x48')]({'where':{'id':_0x5494ea['params']['id']}})[_0x230e('0x24')](handleEntityNotFound(_0x3bcd14,null))[_0x230e('0x24')](removeEntity(_0x3bcd14,null))[_0x230e('0x43')](handleError(_0x3bcd14,null));};exports[_0x230e('0x4c')]=function(_0x4f81c9,_0x18c698,_0x24e5c0){var _0x23264b={};var _0x405e2a={};var _0x2b24d0;var _0x27b517;return db[_0x230e('0x3f')][_0x230e('0x4d')]({'where':{'id':_0x4f81c9['params']['id']}})['then'](handleEntityNotFound(_0x18c698,null))[_0x230e('0x24')](function(_0x1e432c){if(_0x1e432c){_0x2b24d0=_0x1e432c;_0x405e2a[_0x230e('0x2e')]=_[_0x230e('0x31')](db[_0x230e('0x4e')][_0x230e('0x46')]);_0x405e2a['query']=_['keys'](_0x4f81c9['query']);_0x405e2a['filters']=_['intersection'](_0x405e2a[_0x230e('0x2e')],_0x405e2a[_0x230e('0x30')]);_0x23264b[_0x230e('0x33')]=_[_0x230e('0x32')](_0x405e2a[_0x230e('0x2e')],qs[_0x230e('0x34')](_0x4f81c9[_0x230e('0x30')][_0x230e('0x34')]));_0x23264b[_0x230e('0x33')]=_0x23264b['attributes'][_0x230e('0x4f')]?_0x23264b[_0x230e('0x33')]:_0x405e2a[_0x230e('0x2e')];_0x23264b[_0x230e('0x50')]=qs[_0x230e('0x37')](_0x4f81c9['query'][_0x230e('0x37')]);_0x23264b[_0x230e('0x38')]=qs[_0x230e('0x39')](_['pick'](_0x4f81c9[_0x230e('0x30')],_0x405e2a['filters']));if(_0x4f81c9[_0x230e('0x30')][_0x230e('0x3a')]){_0x23264b[_0x230e('0x38')]=_['merge'](_0x23264b['where'],{'$or':_['map'](_0x23264b[_0x230e('0x33')],function(_0x113b07){var _0x2a8b7b={};_0x2a8b7b[_0x113b07]={'$like':'%'+_0x4f81c9[_0x230e('0x30')]['filter']+'%'};return _0x2a8b7b;})});}_0x23264b=_['merge']({},_0x23264b,_0x4f81c9['options']);return _0x2b24d0[_0x230e('0x4c')](_0x23264b);}})[_0x230e('0x24')](function(_0x16b535){if(_0x16b535){_0x27b517=_0x16b535['length'];if(!_0x4f81c9[_0x230e('0x30')][_0x230e('0x35')]('nolimit')){_0x23264b[_0x230e('0x1a')]=qs[_0x230e('0x1a')](_0x4f81c9[_0x230e('0x30')][_0x230e('0x1a')]);_0x23264b[_0x230e('0x1d')]=qs[_0x230e('0x1d')](_0x4f81c9[_0x230e('0x30')][_0x230e('0x1d')]);}return _0x2b24d0['getSubjects'](_0x23264b);}})[_0x230e('0x24')](function(_0x2a48d6){if(_0x2a48d6){return _0x2a48d6?{'count':_0x27b517,'rows':_0x2a48d6}:null;}})[_0x230e('0x24')](respondWithResult(_0x18c698,null))[_0x230e('0x43')](handleError(_0x18c698,null));};exports[_0x230e('0x51')]=function(_0x455cac,_0xbbe2a8,_0x5078e3){var _0x53e7f0={};var _0x3bae46={};var _0x3e9e87;var _0x4716cd;return db[_0x230e('0x3f')][_0x230e('0x4d')]({'where':{'id':_0x455cac[_0x230e('0x45')]['id']}})['then'](handleEntityNotFound(_0xbbe2a8,null))[_0x230e('0x24')](function(_0x23b4f9){if(_0x23b4f9){_0x3e9e87=_0x23b4f9;_0x3bae46[_0x230e('0x2e')]=_[_0x230e('0x31')](db[_0x230e('0x4e')][_0x230e('0x46')]);_0x3bae46[_0x230e('0x30')]=_[_0x230e('0x31')](_0x455cac[_0x230e('0x30')]);_0x3bae46[_0x230e('0x39')]=_[_0x230e('0x32')](_0x3bae46[_0x230e('0x2e')],_0x3bae46['query']);_0x53e7f0[_0x230e('0x33')]=_[_0x230e('0x32')](_0x3bae46['model'],qs[_0x230e('0x34')](_0x455cac[_0x230e('0x30')][_0x230e('0x34')]));_0x53e7f0[_0x230e('0x33')]=_0x53e7f0[_0x230e('0x33')][_0x230e('0x4f')]?_0x53e7f0[_0x230e('0x33')]:_0x3bae46['model'];_0x53e7f0['order']=qs[_0x230e('0x37')](_0x455cac[_0x230e('0x30')][_0x230e('0x37')]);_0x53e7f0[_0x230e('0x38')]=qs[_0x230e('0x39')](_[_0x230e('0x52')](_0x455cac['query'],_0x3bae46['filters']));if(_0x455cac[_0x230e('0x30')][_0x230e('0x3a')]){_0x53e7f0[_0x230e('0x38')]=_[_0x230e('0x3b')](_0x53e7f0[_0x230e('0x38')],{'$or':_['map'](_0x53e7f0[_0x230e('0x33')],function(_0x4c82ac){var _0x12bb27={};_0x12bb27[_0x4c82ac]={'$like':'%'+_0x455cac[_0x230e('0x30')][_0x230e('0x3a')]+'%'};return _0x12bb27;})});}_0x53e7f0=_[_0x230e('0x3b')]({},_0x53e7f0,_0x455cac[_0x230e('0x3e')]);return _0x3e9e87['getDescriptions'](_0x53e7f0);}})[_0x230e('0x24')](function(_0x2e1dba){if(_0x2e1dba){_0x4716cd=_0x2e1dba[_0x230e('0x4f')];if(!_0x455cac[_0x230e('0x30')][_0x230e('0x35')](_0x230e('0x36'))){_0x53e7f0[_0x230e('0x1a')]=qs[_0x230e('0x1a')](_0x455cac['query'][_0x230e('0x1a')]);_0x53e7f0[_0x230e('0x1d')]=qs[_0x230e('0x1d')](_0x455cac[_0x230e('0x30')][_0x230e('0x1d')]);}return _0x3e9e87[_0x230e('0x51')](_0x53e7f0);}})['then'](function(_0x3abb58){if(_0x3abb58){return _0x3abb58?{'count':_0x4716cd,'rows':_0x3abb58}:null;}})[_0x230e('0x24')](respondWithResult(_0xbbe2a8,null))[_0x230e('0x43')](handleError(_0xbbe2a8,null));};exports[_0x230e('0x53')]=function(_0x1c1455,_0x580eca,_0x46dada){var _0x1afccf={};var _0x643edb={};var _0x3477f3;var _0x5728b9;return db[_0x230e('0x3f')][_0x230e('0x4d')]({'where':{'id':_0x1c1455[_0x230e('0x45')]['id']}})['then'](handleEntityNotFound(_0x580eca,null))[_0x230e('0x24')](function(_0x3418f6){if(_0x3418f6){_0x3477f3=_0x3418f6;_0x643edb[_0x230e('0x2e')]=_[_0x230e('0x31')](db['FreshsalesField'][_0x230e('0x46')]);_0x643edb['query']=_[_0x230e('0x31')](_0x1c1455[_0x230e('0x30')]);_0x643edb[_0x230e('0x39')]=_[_0x230e('0x32')](_0x643edb[_0x230e('0x2e')],_0x643edb[_0x230e('0x30')]);_0x1afccf[_0x230e('0x33')]=_[_0x230e('0x32')](_0x643edb[_0x230e('0x2e')],qs[_0x230e('0x34')](_0x1c1455['query'][_0x230e('0x34')]));_0x1afccf[_0x230e('0x33')]=_0x1afccf[_0x230e('0x33')][_0x230e('0x4f')]?_0x1afccf['attributes']:_0x643edb[_0x230e('0x2e')];_0x1afccf[_0x230e('0x50')]=qs[_0x230e('0x37')](_0x1c1455['query'][_0x230e('0x37')]);_0x1afccf[_0x230e('0x38')]=qs[_0x230e('0x39')](_['pick'](_0x1c1455[_0x230e('0x30')],_0x643edb[_0x230e('0x39')]));if(_0x1c1455['query'][_0x230e('0x3a')]){_0x1afccf[_0x230e('0x38')]=_['merge'](_0x1afccf['where'],{'$or':_[_0x230e('0x2f')](_0x1afccf['attributes'],function(_0x2a57e6){var _0x5abc18={};_0x5abc18[_0x2a57e6]={'$like':'%'+_0x1c1455['query'][_0x230e('0x3a')]+'%'};return _0x5abc18;})});}_0x1afccf=_[_0x230e('0x3b')]({},_0x1afccf,_0x1c1455[_0x230e('0x3e')]);return _0x3477f3[_0x230e('0x53')](_0x1afccf);}})['then'](function(_0x26cc4c){if(_0x26cc4c){_0x5728b9=_0x26cc4c[_0x230e('0x4f')];if(!_0x1c1455[_0x230e('0x30')]['hasOwnProperty'](_0x230e('0x36'))){_0x1afccf[_0x230e('0x1a')]=qs[_0x230e('0x1a')](_0x1c1455[_0x230e('0x30')][_0x230e('0x1a')]);_0x1afccf[_0x230e('0x1d')]=qs[_0x230e('0x1d')](_0x1c1455[_0x230e('0x30')]['offset']);}return _0x3477f3['getFields'](_0x1afccf);}})[_0x230e('0x24')](function(_0x1828f0){if(_0x1828f0){return _0x1828f0?{'count':_0x5728b9,'rows':_0x1828f0}:null;}})['then'](respondWithResult(_0x580eca,null))[_0x230e('0x43')](handleError(_0x580eca,null));}; \ No newline at end of file +var _0x3903=['count','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','getSubjects','findOne','FreshsalesField','length','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x38f894,_0x1bd7d2){var _0x1c7961=function(_0x35897f){while(--_0x35897f){_0x38f894['push'](_0x38f894['shift']());}};_0x1c7961(++_0x1bd7d2);}(_0x3903,0x11c));var _0x3390=function(_0x2dd252,_0x34eb5c){_0x2dd252=_0x2dd252-0x0;var _0x296bd6=_0x3903[_0x2dd252];return _0x296bd6;};'use strict';var emlformat=require(_0x3390('0x0'));var rimraf=require(_0x3390('0x1'));var zipdir=require(_0x3390('0x2'));var jsonpatch=require(_0x3390('0x3'));var rp=require(_0x3390('0x4'));var moment=require(_0x3390('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3390('0x6'));var csv=require(_0x3390('0x7'));var ejs=require(_0x3390('0x8'));var fs=require('fs');var fs_extra=require(_0x3390('0x9'));var _=require(_0x3390('0xa'));var squel=require(_0x3390('0xb'));var crypto=require(_0x3390('0xc'));var jsforce=require(_0x3390('0xd'));var deskjs=require(_0x3390('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3390('0xf'));var Redis=require(_0x3390('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3390('0x11'));var as=require(_0x3390('0x12'));var hardwareService=require(_0x3390('0x13'));var logger=require('../../config/logger')(_0x3390('0x14'));var utils=require('../../config/utils');var config=require(_0x3390('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3390('0x16'))['db'];function respondWithStatusCode(_0x305e0d,_0x5b675b){_0x5b675b=_0x5b675b||0xcc;return function(_0x3972cb){if(_0x3972cb){return _0x305e0d[_0x3390('0x17')](_0x5b675b);}return _0x305e0d[_0x3390('0x18')](_0x5b675b)['end']();};}function respondWithResult(_0x301c80,_0x7f4ac8){_0x7f4ac8=_0x7f4ac8||0xc8;return function(_0x1b389c){if(_0x1b389c){return _0x301c80['status'](_0x7f4ac8)[_0x3390('0x19')](_0x1b389c);}};}function respondWithFilteredResult(_0x5ef74c,_0x439f49){return function(_0x450cf3){if(_0x450cf3){var _0x2e479f=typeof _0x439f49[_0x3390('0x1a')]===_0x3390('0x1b')&&typeof _0x439f49['limit']===_0x3390('0x1b');var _0x5c95c3=_0x450cf3[_0x3390('0x1c')];var _0x52d2db=_0x2e479f?0x0:_0x439f49[_0x3390('0x1a')];var _0x440c1f=_0x2e479f?_0x450cf3[_0x3390('0x1c')]:_0x439f49[_0x3390('0x1a')]+_0x439f49[_0x3390('0x1d')];var _0x55b1cd;if(_0x440c1f>=_0x5c95c3){_0x440c1f=_0x5c95c3;_0x55b1cd=0xc8;}else{_0x55b1cd=0xce;}_0x5ef74c['status'](_0x55b1cd);return _0x5ef74c[_0x3390('0x1e')](_0x3390('0x1f'),_0x52d2db+'-'+_0x440c1f+'/'+_0x5c95c3)[_0x3390('0x19')](_0x450cf3);}return null;};}function patchUpdates(_0x27d16c){return function(_0x263b6a){try{jsonpatch[_0x3390('0x20')](_0x263b6a,_0x27d16c,!![]);}catch(_0x438823){return BPromise[_0x3390('0x21')](_0x438823);}return _0x263b6a['save']();};}function saveUpdates(_0x371066,_0x4636d2){return function(_0x2783c1){if(_0x2783c1){return _0x2783c1[_0x3390('0x22')](_0x371066)[_0x3390('0x23')](function(_0x4c47da){return _0x4c47da;});}return null;};}function removeEntity(_0x2f1286,_0x444f4c){return function(_0x209c3a){if(_0x209c3a){return _0x209c3a['destroy']()[_0x3390('0x23')](function(){_0x2f1286[_0x3390('0x18')](0xcc)[_0x3390('0x24')]();});}};}function handleEntityNotFound(_0x32be80,_0x183534){return function(_0x521d43){if(!_0x521d43){_0x32be80[_0x3390('0x17')](0x194);}return _0x521d43;};}function handleError(_0x3e88b7,_0x5d1880){_0x5d1880=_0x5d1880||0x1f4;return function(_0xd36c18){logger[_0x3390('0x25')](_0xd36c18[_0x3390('0x26')]);if(_0xd36c18[_0x3390('0x27')]){delete _0xd36c18[_0x3390('0x27')];}_0x3e88b7[_0x3390('0x18')](_0x5d1880)[_0x3390('0x28')](_0xd36c18);};}exports['index']=function(_0x4bfd91,_0x237aed){var _0x53d1b6={},_0x7b0196={},_0x5da2ce={'count':0x0,'rows':[]};var _0xed5772=_[_0x3390('0x29')](db[_0x3390('0x2a')][_0x3390('0x2b')],function(_0x4c12dd){return{'name':_0x4c12dd[_0x3390('0x2c')],'type':_0x4c12dd[_0x3390('0x2d')]['key']};});_0x7b0196[_0x3390('0x2e')]=_[_0x3390('0x29')](_0xed5772,'name');_0x7b0196[_0x3390('0x2f')]=_[_0x3390('0x30')](_0x4bfd91[_0x3390('0x2f')]);_0x7b0196[_0x3390('0x31')]=_['intersection'](_0x7b0196[_0x3390('0x2e')],_0x7b0196[_0x3390('0x2f')]);_0x53d1b6['attributes']=_[_0x3390('0x32')](_0x7b0196[_0x3390('0x2e')],qs['fields'](_0x4bfd91[_0x3390('0x2f')][_0x3390('0x33')]));_0x53d1b6[_0x3390('0x34')]=_0x53d1b6['attributes']['length']?_0x53d1b6[_0x3390('0x34')]:_0x7b0196[_0x3390('0x2e')];if(!_0x4bfd91[_0x3390('0x2f')][_0x3390('0x35')](_0x3390('0x36'))){_0x53d1b6['limit']=qs[_0x3390('0x1d')](_0x4bfd91[_0x3390('0x2f')]['limit']);_0x53d1b6[_0x3390('0x1a')]=qs[_0x3390('0x1a')](_0x4bfd91[_0x3390('0x2f')]['offset']);}_0x53d1b6[_0x3390('0x37')]=qs[_0x3390('0x38')](_0x4bfd91[_0x3390('0x2f')]['sort']);_0x53d1b6[_0x3390('0x39')]=qs['filters'](_[_0x3390('0x3a')](_0x4bfd91[_0x3390('0x2f')],_0x7b0196[_0x3390('0x31')]),_0xed5772);if(_0x4bfd91[_0x3390('0x2f')][_0x3390('0x3b')]){_0x53d1b6['where']=_[_0x3390('0x3c')](_0x53d1b6[_0x3390('0x39')],{'$or':_[_0x3390('0x29')](_0xed5772,function(_0x25860d){if(_0x25860d[_0x3390('0x2d')]!==_0x3390('0x3d')){var _0x517949={};_0x517949[_0x25860d[_0x3390('0x27')]]={'$like':'%'+_0x4bfd91['query']['filter']+'%'};return _0x517949;}})});}_0x53d1b6=_[_0x3390('0x3c')]({},_0x53d1b6,_0x4bfd91[_0x3390('0x3e')]);var _0x8db717={'where':_0x53d1b6['where']};return db['FreshsalesConfiguration']['count'](_0x8db717)[_0x3390('0x23')](function(_0x1c1d44){_0x5da2ce[_0x3390('0x1c')]=_0x1c1d44;if(_0x4bfd91['query'][_0x3390('0x3f')]){_0x53d1b6[_0x3390('0x40')]=[{'all':!![]}];}return db[_0x3390('0x2a')]['findAll'](_0x53d1b6);})[_0x3390('0x23')](function(_0x13da46){_0x5da2ce[_0x3390('0x41')]=_0x13da46;return _0x5da2ce;})[_0x3390('0x23')](respondWithFilteredResult(_0x237aed,_0x53d1b6))[_0x3390('0x42')](handleError(_0x237aed,null));};exports[_0x3390('0x43')]=function(_0x207503,_0xd2f727){var _0x2dd84a={'raw':![],'where':{'id':_0x207503[_0x3390('0x44')]['id']}},_0x291a12={};_0x291a12[_0x3390('0x2e')]=_[_0x3390('0x30')](db[_0x3390('0x2a')]['rawAttributes']);_0x291a12[_0x3390('0x2f')]=_['keys'](_0x207503[_0x3390('0x2f')]);_0x291a12[_0x3390('0x31')]=_[_0x3390('0x32')](_0x291a12[_0x3390('0x2e')],_0x291a12[_0x3390('0x2f')]);_0x2dd84a['attributes']=_[_0x3390('0x32')](_0x291a12['model'],qs[_0x3390('0x33')](_0x207503[_0x3390('0x2f')]['fields']));_0x2dd84a['attributes']=_0x2dd84a[_0x3390('0x34')]['length']?_0x2dd84a['attributes']:_0x291a12[_0x3390('0x2e')];if(_0x207503[_0x3390('0x2f')]['includeAll']){_0x2dd84a[_0x3390('0x40')]=[{'all':!![]}];}_0x2dd84a=_['merge']({},_0x2dd84a,_0x207503[_0x3390('0x3e')]);return db['FreshsalesConfiguration']['find'](_0x2dd84a)[_0x3390('0x23')](handleEntityNotFound(_0xd2f727,null))[_0x3390('0x23')](respondWithResult(_0xd2f727,null))[_0x3390('0x42')](handleError(_0xd2f727,null));};exports[_0x3390('0x45')]=function(_0x3a0f80,_0x185887){return db[_0x3390('0x2a')][_0x3390('0x45')](_0x3a0f80[_0x3390('0x46')],{})[_0x3390('0x23')](respondWithResult(_0x185887,0xc9))[_0x3390('0x42')](handleError(_0x185887,null));};exports[_0x3390('0x22')]=function(_0x8fd1ff,_0x1c0e14){if(_0x8fd1ff[_0x3390('0x46')]['id']){delete _0x8fd1ff[_0x3390('0x46')]['id'];}return db['FreshsalesConfiguration'][_0x3390('0x47')]({'where':{'id':_0x8fd1ff[_0x3390('0x44')]['id']}})[_0x3390('0x23')](handleEntityNotFound(_0x1c0e14,null))[_0x3390('0x23')](saveUpdates(_0x8fd1ff[_0x3390('0x46')],null))[_0x3390('0x23')](respondWithResult(_0x1c0e14,null))[_0x3390('0x42')](handleError(_0x1c0e14,null));};exports['destroy']=function(_0x4b0413,_0x55d5b3){return db[_0x3390('0x2a')]['find']({'where':{'id':_0x4b0413[_0x3390('0x44')]['id']}})[_0x3390('0x23')](handleEntityNotFound(_0x55d5b3,null))[_0x3390('0x23')](removeEntity(_0x55d5b3,null))['catch'](handleError(_0x55d5b3,null));};exports[_0x3390('0x48')]=function(_0x504053,_0x4d1a86,_0x14e5f3){var _0x2fc66c={};var _0x42c35e={};var _0x1595e7;var _0x4487c5;return db[_0x3390('0x2a')][_0x3390('0x49')]({'where':{'id':_0x504053[_0x3390('0x44')]['id']}})[_0x3390('0x23')](handleEntityNotFound(_0x4d1a86,null))[_0x3390('0x23')](function(_0x21a072){if(_0x21a072){_0x1595e7=_0x21a072;_0x42c35e['model']=_['keys'](db[_0x3390('0x4a')][_0x3390('0x2b')]);_0x42c35e['query']=_[_0x3390('0x30')](_0x504053[_0x3390('0x2f')]);_0x42c35e['filters']=_['intersection'](_0x42c35e['model'],_0x42c35e[_0x3390('0x2f')]);_0x2fc66c[_0x3390('0x34')]=_[_0x3390('0x32')](_0x42c35e[_0x3390('0x2e')],qs[_0x3390('0x33')](_0x504053[_0x3390('0x2f')][_0x3390('0x33')]));_0x2fc66c[_0x3390('0x34')]=_0x2fc66c[_0x3390('0x34')][_0x3390('0x4b')]?_0x2fc66c[_0x3390('0x34')]:_0x42c35e[_0x3390('0x2e')];_0x2fc66c[_0x3390('0x37')]=qs[_0x3390('0x38')](_0x504053[_0x3390('0x2f')]['sort']);_0x2fc66c[_0x3390('0x39')]=qs[_0x3390('0x31')](_['pick'](_0x504053[_0x3390('0x2f')],_0x42c35e[_0x3390('0x31')]));if(_0x504053[_0x3390('0x2f')]['filter']){_0x2fc66c[_0x3390('0x39')]=_[_0x3390('0x3c')](_0x2fc66c[_0x3390('0x39')],{'$or':_[_0x3390('0x29')](_0x2fc66c['attributes'],function(_0x34c34e){var _0x25a0a7={};_0x25a0a7[_0x34c34e]={'$like':'%'+_0x504053['query'][_0x3390('0x3b')]+'%'};return _0x25a0a7;})});}_0x2fc66c=_[_0x3390('0x3c')]({},_0x2fc66c,_0x504053[_0x3390('0x3e')]);return _0x1595e7[_0x3390('0x48')](_0x2fc66c);}})[_0x3390('0x23')](function(_0x530059){if(_0x530059){_0x4487c5=_0x530059[_0x3390('0x4b')];if(!_0x504053['query'][_0x3390('0x35')](_0x3390('0x36'))){_0x2fc66c['limit']=qs['limit'](_0x504053[_0x3390('0x2f')][_0x3390('0x1d')]);_0x2fc66c[_0x3390('0x1a')]=qs[_0x3390('0x1a')](_0x504053['query'][_0x3390('0x1a')]);}return _0x1595e7['getSubjects'](_0x2fc66c);}})[_0x3390('0x23')](function(_0x1368a4){if(_0x1368a4){return _0x1368a4?{'count':_0x4487c5,'rows':_0x1368a4}:null;}})['then'](respondWithResult(_0x4d1a86,null))[_0x3390('0x42')](handleError(_0x4d1a86,null));};exports[_0x3390('0x4c')]=function(_0xcc7143,_0xec7055,_0x5613cb){var _0x273b65={};var _0x12a99d={};var _0x3148c8;var _0x12d253;return db[_0x3390('0x2a')][_0x3390('0x49')]({'where':{'id':_0xcc7143[_0x3390('0x44')]['id']}})[_0x3390('0x23')](handleEntityNotFound(_0xec7055,null))[_0x3390('0x23')](function(_0x316940){if(_0x316940){_0x3148c8=_0x316940;_0x12a99d[_0x3390('0x2e')]=_[_0x3390('0x30')](db[_0x3390('0x4a')][_0x3390('0x2b')]);_0x12a99d['query']=_[_0x3390('0x30')](_0xcc7143[_0x3390('0x2f')]);_0x12a99d[_0x3390('0x31')]=_[_0x3390('0x32')](_0x12a99d['model'],_0x12a99d['query']);_0x273b65[_0x3390('0x34')]=_['intersection'](_0x12a99d[_0x3390('0x2e')],qs[_0x3390('0x33')](_0xcc7143[_0x3390('0x2f')][_0x3390('0x33')]));_0x273b65[_0x3390('0x34')]=_0x273b65['attributes']['length']?_0x273b65[_0x3390('0x34')]:_0x12a99d[_0x3390('0x2e')];_0x273b65[_0x3390('0x37')]=qs[_0x3390('0x38')](_0xcc7143[_0x3390('0x2f')]['sort']);_0x273b65['where']=qs['filters'](_[_0x3390('0x3a')](_0xcc7143[_0x3390('0x2f')],_0x12a99d[_0x3390('0x31')]));if(_0xcc7143[_0x3390('0x2f')][_0x3390('0x3b')]){_0x273b65[_0x3390('0x39')]=_[_0x3390('0x3c')](_0x273b65[_0x3390('0x39')],{'$or':_[_0x3390('0x29')](_0x273b65[_0x3390('0x34')],function(_0x3127d1){var _0x204cae={};_0x204cae[_0x3127d1]={'$like':'%'+_0xcc7143[_0x3390('0x2f')][_0x3390('0x3b')]+'%'};return _0x204cae;})});}_0x273b65=_[_0x3390('0x3c')]({},_0x273b65,_0xcc7143[_0x3390('0x3e')]);return _0x3148c8[_0x3390('0x4c')](_0x273b65);}})['then'](function(_0x2d3fc6){if(_0x2d3fc6){_0x12d253=_0x2d3fc6[_0x3390('0x4b')];if(!_0xcc7143[_0x3390('0x2f')][_0x3390('0x35')](_0x3390('0x36'))){_0x273b65[_0x3390('0x1d')]=qs['limit'](_0xcc7143[_0x3390('0x2f')][_0x3390('0x1d')]);_0x273b65[_0x3390('0x1a')]=qs[_0x3390('0x1a')](_0xcc7143['query']['offset']);}return _0x3148c8[_0x3390('0x4c')](_0x273b65);}})[_0x3390('0x23')](function(_0x43fc6f){if(_0x43fc6f){return _0x43fc6f?{'count':_0x12d253,'rows':_0x43fc6f}:null;}})[_0x3390('0x23')](respondWithResult(_0xec7055,null))[_0x3390('0x42')](handleError(_0xec7055,null));};exports['getFields']=function(_0x13db8a,_0x131cc6,_0x4cde21){var _0x41e2f4={};var _0x377f41={};var _0x59edcc;var _0x54c5d8;return db[_0x3390('0x2a')][_0x3390('0x49')]({'where':{'id':_0x13db8a[_0x3390('0x44')]['id']}})['then'](handleEntityNotFound(_0x131cc6,null))[_0x3390('0x23')](function(_0x1b766c){if(_0x1b766c){_0x59edcc=_0x1b766c;_0x377f41[_0x3390('0x2e')]=_[_0x3390('0x30')](db[_0x3390('0x4a')][_0x3390('0x2b')]);_0x377f41[_0x3390('0x2f')]=_[_0x3390('0x30')](_0x13db8a['query']);_0x377f41[_0x3390('0x31')]=_[_0x3390('0x32')](_0x377f41[_0x3390('0x2e')],_0x377f41[_0x3390('0x2f')]);_0x41e2f4[_0x3390('0x34')]=_[_0x3390('0x32')](_0x377f41[_0x3390('0x2e')],qs['fields'](_0x13db8a[_0x3390('0x2f')][_0x3390('0x33')]));_0x41e2f4[_0x3390('0x34')]=_0x41e2f4[_0x3390('0x34')]['length']?_0x41e2f4[_0x3390('0x34')]:_0x377f41[_0x3390('0x2e')];_0x41e2f4[_0x3390('0x37')]=qs['sort'](_0x13db8a['query'][_0x3390('0x38')]);_0x41e2f4[_0x3390('0x39')]=qs[_0x3390('0x31')](_[_0x3390('0x3a')](_0x13db8a['query'],_0x377f41['filters']));if(_0x13db8a[_0x3390('0x2f')][_0x3390('0x3b')]){_0x41e2f4[_0x3390('0x39')]=_[_0x3390('0x3c')](_0x41e2f4['where'],{'$or':_['map'](_0x41e2f4[_0x3390('0x34')],function(_0x373fb3){var _0x28dda1={};_0x28dda1[_0x373fb3]={'$like':'%'+_0x13db8a[_0x3390('0x2f')][_0x3390('0x3b')]+'%'};return _0x28dda1;})});}_0x41e2f4=_[_0x3390('0x3c')]({},_0x41e2f4,_0x13db8a[_0x3390('0x3e')]);return _0x59edcc[_0x3390('0x4d')](_0x41e2f4);}})['then'](function(_0x12ef65){if(_0x12ef65){_0x54c5d8=_0x12ef65[_0x3390('0x4b')];if(!_0x13db8a[_0x3390('0x2f')][_0x3390('0x35')](_0x3390('0x36'))){_0x41e2f4[_0x3390('0x1d')]=qs['limit'](_0x13db8a[_0x3390('0x2f')]['limit']);_0x41e2f4[_0x3390('0x1a')]=qs[_0x3390('0x1a')](_0x13db8a[_0x3390('0x2f')][_0x3390('0x1a')]);}return _0x59edcc['getFields'](_0x41e2f4);}})[_0x3390('0x23')](function(_0x47a459){if(_0x47a459){return _0x47a459?{'count':_0x54c5d8,'rows':_0x47a459}:null;}})[_0x3390('0x23')](respondWithResult(_0x131cc6,null))[_0x3390('0x42')](handleError(_0x131cc6,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 87c7a45..e39fc3a 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 _0x493b=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','api','moment','request-promise'];(function(_0x364107,_0x50fa5d){var _0x144121=function(_0x3328ba){while(--_0x3328ba){_0x364107['push'](_0x364107['shift']());}};_0x144121(++_0x50fa5d);}(_0x493b,0xec));var _0xb493=function(_0xe69ce1,_0x11fea4){_0xe69ce1=_0xe69ce1-0x0;var _0x3e8e93=_0x493b[_0xe69ce1];return _0x3e8e93;};'use strict';var _=require('lodash');var util=require(_0xb493('0x0'));var logger=require('../../config/logger')(_0xb493('0x1'));var moment=require(_0xb493('0x2'));var BPromise=require('bluebird');var rp=require(_0xb493('0x3'));var fs=require('fs');var path=require(_0xb493('0x4'));var rimraf=require(_0xb493('0x5'));var config=require(_0xb493('0x6'));var attributes=require(_0xb493('0x7'));module[_0xb493('0x8')]=function(_0x3e5302,_0x201f45){return _0x3e5302[_0xb493('0x9')](_0xb493('0xa'),attributes,{'tableName':_0xb493('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd679=['api','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x1f4aa1,_0x246141){var _0x458357=function(_0x41630c){while(--_0x41630c){_0x1f4aa1['push'](_0x1f4aa1['shift']());}};_0x458357(++_0x246141);}(_0xd679,0x1ec));var _0x9d67=function(_0x2b537d,_0x3bb31f){_0x2b537d=_0x2b537d-0x0;var _0x9d6f5b=_0xd679[_0x2b537d];return _0x9d6f5b;};'use strict';var _=require(_0x9d67('0x0'));var util=require(_0x9d67('0x1'));var logger=require(_0x9d67('0x2'))(_0x9d67('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9d67('0x4'));var fs=require('fs');var path=require(_0x9d67('0x5'));var rimraf=require(_0x9d67('0x6'));var config=require('../../config/environment');var attributes=require(_0x9d67('0x7'));module[_0x9d67('0x8')]=function(_0x58b5ca,_0x41c103){return _0x58b5ca[_0x9d67('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x9d67('0xa'),'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 0cf1d33..eea1065 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 _0xd13d=['code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3e57ef,_0x388fab){var _0x5ade66=function(_0xcbbd3){while(--_0xcbbd3){_0x3e57ef['push'](_0x3e57ef['shift']());}};_0x5ade66(++_0x388fab);}(_0xd13d,0x97));var _0xdd13=function(_0xe4d1cc,_0x35bf20){_0xe4d1cc=_0xe4d1cc-0x0;var _0x41b493=_0xd13d[_0xe4d1cc];return _0x41b493;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdd13('0x0'));var BPromise=require('bluebird');var rs=require(_0xdd13('0x1'));var fs=require('fs');var Redis=require(_0xdd13('0x2'));var db=require(_0xdd13('0x3'))['db'];var utils=require(_0xdd13('0x4'));var logger=require(_0xdd13('0x5'))(_0xdd13('0x6'));var config=require('../../config/environment');var jayson=require(_0xdd13('0x7'));var client=jayson[_0xdd13('0x8')][_0xdd13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x207769,_0x470aa5,_0x3be803){return new BPromise(function(_0x2f1881,_0x37ffaf){return client['request'](_0x207769,_0x3be803)[_0xdd13('0xa')](function(_0x4ecb25){logger[_0xdd13('0xb')](_0xdd13('0xc'),_0x470aa5,_0xdd13('0xd'));logger[_0xdd13('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x470aa5,_0xdd13('0xd'),JSON[_0xdd13('0xf')](_0x4ecb25));if(_0x4ecb25[_0xdd13('0x10')]){if(_0x4ecb25[_0xdd13('0x10')][_0xdd13('0x11')]===0x1f4){logger[_0xdd13('0x10')](_0xdd13('0xc'),_0x470aa5,_0x4ecb25[_0xdd13('0x10')][_0xdd13('0x12')]);return _0x37ffaf(_0x4ecb25[_0xdd13('0x10')][_0xdd13('0x12')]);}logger['error'](_0xdd13('0xc'),_0x470aa5,_0x4ecb25[_0xdd13('0x10')][_0xdd13('0x12')]);return _0x2f1881(_0x4ecb25[_0xdd13('0x10')]['message']);}else{logger[_0xdd13('0xb')](_0xdd13('0xc'),_0x470aa5,'request\x20sent');_0x2f1881(_0x4ecb25[_0xdd13('0x13')]['message']);}})[_0xdd13('0x14')](function(_0x59ecae){logger[_0xdd13('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x470aa5,_0x59ecae);_0x37ffaf(_0x59ecae);});});} \ No newline at end of file +var _0x45bd=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x385cf2,_0x4b1d4d){var _0x3c5c24=function(_0x5e28bf){while(--_0x5e28bf){_0x385cf2['push'](_0x385cf2['shift']());}};_0x3c5c24(++_0x4b1d4d);}(_0x45bd,0x1cf));var _0xd45b=function(_0x507b75,_0x2fcdff){_0x507b75=_0x507b75-0x0;var _0x2bfb14=_0x45bd[_0x507b75];return _0x2bfb14;};'use strict';var _=require(_0xd45b('0x0'));var util=require(_0xd45b('0x1'));var moment=require(_0xd45b('0x2'));var BPromise=require(_0xd45b('0x3'));var rs=require(_0xd45b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd45b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd45b('0x6'))('rpc');var config=require(_0xd45b('0x7'));var jayson=require(_0xd45b('0x8'));var client=jayson[_0xd45b('0x9')][_0xd45b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x474980,_0x48ac96,_0x5dcbd0){return new BPromise(function(_0x5ca605,_0x1c51e6){return client[_0xd45b('0xb')](_0x474980,_0x5dcbd0)[_0xd45b('0xc')](function(_0x20c9bb){logger['info'](_0xd45b('0xd'),_0x48ac96,'request\x20sent');logger[_0xd45b('0xe')](_0xd45b('0xf'),_0x48ac96,_0xd45b('0x10'),JSON[_0xd45b('0x11')](_0x20c9bb));if(_0x20c9bb[_0xd45b('0x12')]){if(_0x20c9bb[_0xd45b('0x12')][_0xd45b('0x13')]===0x1f4){logger[_0xd45b('0x12')](_0xd45b('0xd'),_0x48ac96,_0x20c9bb['error'][_0xd45b('0x14')]);return _0x1c51e6(_0x20c9bb['error'][_0xd45b('0x14')]);}logger[_0xd45b('0x12')](_0xd45b('0xd'),_0x48ac96,_0x20c9bb['error'][_0xd45b('0x14')]);return _0x5ca605(_0x20c9bb[_0xd45b('0x12')][_0xd45b('0x14')]);}else{logger[_0xd45b('0x15')](_0xd45b('0xd'),_0x48ac96,_0xd45b('0x10'));_0x5ca605(_0x20c9bb[_0xd45b('0x16')]['message']);}})[_0xd45b('0x17')](function(_0x24e15e){logger[_0xd45b('0x12')](_0xd45b('0xd'),_0x48ac96,_0x24e15e);_0x1c51e6(_0x24e15e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 49d7625..57d6a6c 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 _0x1e69=['/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x1e69,0x85));var _0x91e6=function(_0x328cdc,_0xe9775){_0x328cdc=_0x328cdc-0x0;var _0x17eea7=_0x1e69[_0x328cdc];return _0x17eea7;};'use strict';var multer=require('multer');var util=require(_0x91e6('0x0'));var path=require(_0x91e6('0x1'));var timeout=require(_0x91e6('0x2'));var express=require(_0x91e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x91e6('0x4'));var interaction=require(_0x91e6('0x5'));var config=require(_0x91e6('0x6'));var controller=require(_0x91e6('0x7'));router[_0x91e6('0x8')]('/',auth[_0x91e6('0x9')](),controller[_0x91e6('0xa')]);router[_0x91e6('0x8')](_0x91e6('0xb'),auth[_0x91e6('0x9')](),controller[_0x91e6('0xc')]);router[_0x91e6('0xd')]('/',auth[_0x91e6('0x9')](),controller['create']);router['put'](_0x91e6('0xb'),auth[_0x91e6('0x9')](),controller[_0x91e6('0xe')]);router[_0x91e6('0xf')]('/:id',auth[_0x91e6('0x9')](),controller[_0x91e6('0x10')]);module[_0x91e6('0x11')]=router; \ No newline at end of file +var _0xaf9b=['fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','index','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','multer','path','express','Router'];(function(_0x1537dc,_0x2a6c1c){var _0x331ebb=function(_0x17f1bc){while(--_0x17f1bc){_0x1537dc['push'](_0x1537dc['shift']());}};_0x331ebb(++_0x2a6c1c);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0xf2c8ad,_0x528e04){_0xf2c8ad=_0xf2c8ad-0x0;var _0x2bb3a9=_0xaf9b[_0xf2c8ad];return _0x2bb3a9;};'use strict';var multer=require(_0xbaf9('0x0'));var util=require('util');var path=require(_0xbaf9('0x1'));var timeout=require('connect-timeout');var express=require(_0xbaf9('0x2'));var router=express[_0xbaf9('0x3')]();var fs_extra=require(_0xbaf9('0x4'));var auth=require(_0xbaf9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbaf9('0x6'));var controller=require(_0xbaf9('0x7'));router[_0xbaf9('0x8')]('/',auth['isAuthenticated'](),controller[_0xbaf9('0x9')]);router[_0xbaf9('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbaf9('0xa')]);router[_0xbaf9('0xb')]('/',auth[_0xbaf9('0xc')](),controller[_0xbaf9('0xd')]);router[_0xbaf9('0xe')](_0xbaf9('0xf'),auth[_0xbaf9('0xc')](),controller[_0xbaf9('0x10')]);router[_0xbaf9('0x11')](_0xbaf9('0xf'),auth[_0xbaf9('0xc')](),controller[_0xbaf9('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 200d73f..238200e 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 _0xd221=['exports','ENUM','variable','keyValue','string','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xd221,0x14c));var _0x1d22=function(_0x1ee3e1,_0x3807fc){_0x1ee3e1=_0x1ee3e1-0x0;var _0xf52785=_0xd221[_0x1ee3e1];return _0xf52785;};'use strict';var Sequelize=require(_0x1d22('0x0'));module[_0x1d22('0x1')]={'type':{'type':Sequelize[_0x1d22('0x2')]('string',_0x1d22('0x3'),'customVariable',_0x1d22('0x4'),'picklist'),'defaultValue':_0x1d22('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1d22('0x6')]},'keyType':{'type':Sequelize[_0x1d22('0x2')]('string','variable',_0x1d22('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1d22('0x6')]},'customField':{'type':Sequelize[_0x1d22('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0111=['BOOLEAN','sequelize','ENUM','string','keyValue','picklist','STRING','variable','customVariable'];(function(_0x246b4b,_0x285913){var _0x35c072=function(_0x288ebc){while(--_0x288ebc){_0x246b4b['push'](_0x246b4b['shift']());}};_0x35c072(++_0x285913);}(_0x0111,0x91));var _0x1011=function(_0x598efc,_0x5e971c){_0x598efc=_0x598efc-0x0;var _0x435e4f=_0x0111[_0x598efc];return _0x435e4f;};'use strict';var Sequelize=require(_0x1011('0x0'));module['exports']={'type':{'type':Sequelize[_0x1011('0x1')](_0x1011('0x2'),'variable','customVariable',_0x1011('0x3'),_0x1011('0x4')),'defaultValue':_0x1011('0x2')},'content':{'type':Sequelize[_0x1011('0x5')]},'key':{'type':Sequelize[_0x1011('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x1011('0x2'),_0x1011('0x6'),_0x1011('0x7'))},'keyContent':{'type':Sequelize[_0x1011('0x5')]},'idField':{'type':Sequelize[_0x1011('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1011('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1011('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 312fa52..af77110 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 _0xf2b9=['name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','FreshsalesField','includeAll','include','findAll','rows','catch','params','fields','length','options','find','create','body','update','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','error','stack'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf2b9,0x15d));var _0x9f2b=function(_0x36fa1a,_0xe9af21){_0x36fa1a=_0x36fa1a-0x0;var _0x224bd9=_0xf2b9[_0x36fa1a];return _0x224bd9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9f2b('0x0'));var jsonpatch=require(_0x9f2b('0x1'));var rp=require(_0x9f2b('0x2'));var moment=require('moment');var BPromise=require(_0x9f2b('0x3'));var Mustache=require(_0x9f2b('0x4'));var util=require(_0x9f2b('0x5'));var path=require(_0x9f2b('0x6'));var sox=require('sox');var csv=require(_0x9f2b('0x7'));var ejs=require(_0x9f2b('0x8'));var fs=require('fs');var fs_extra=require(_0x9f2b('0x9'));var _=require(_0x9f2b('0xa'));var squel=require(_0x9f2b('0xb'));var crypto=require(_0x9f2b('0xc'));var jsforce=require(_0x9f2b('0xd'));var deskjs=require(_0x9f2b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9f2b('0xf'));var Papa=require(_0x9f2b('0x10'));var Redis=require(_0x9f2b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f2b('0x12'));var as=require(_0x9f2b('0x13'));var hardwareService=require(_0x9f2b('0x14'));var logger=require(_0x9f2b('0x15'))(_0x9f2b('0x16'));var utils=require(_0x9f2b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9f2b('0x18'))['db'];function respondWithStatusCode(_0x30b4a6,_0x168667){_0x168667=_0x168667||0xcc;return function(_0xf11e74){if(_0xf11e74){return _0x30b4a6[_0x9f2b('0x19')](_0x168667);}return _0x30b4a6[_0x9f2b('0x1a')](_0x168667)[_0x9f2b('0x1b')]();};}function respondWithResult(_0x3cdb84,_0x2bd988){_0x2bd988=_0x2bd988||0xc8;return function(_0x693faa){if(_0x693faa){return _0x3cdb84[_0x9f2b('0x1a')](_0x2bd988)['json'](_0x693faa);}};}function respondWithFilteredResult(_0x518b8f,_0x31d9b7){return function(_0x5d28f9){if(_0x5d28f9){var _0x138a1e=typeof _0x31d9b7['offset']===_0x9f2b('0x1c')&&typeof _0x31d9b7[_0x9f2b('0x1d')]===_0x9f2b('0x1c');var _0x3b2487=_0x5d28f9[_0x9f2b('0x1e')];var _0x348130=_0x138a1e?0x0:_0x31d9b7[_0x9f2b('0x1f')];var _0x440bee=_0x138a1e?_0x5d28f9[_0x9f2b('0x1e')]:_0x31d9b7['offset']+_0x31d9b7[_0x9f2b('0x1d')];var _0x1cf64a;if(_0x440bee>=_0x3b2487){_0x440bee=_0x3b2487;_0x1cf64a=0xc8;}else{_0x1cf64a=0xce;}_0x518b8f['status'](_0x1cf64a);return _0x518b8f[_0x9f2b('0x20')](_0x9f2b('0x21'),_0x348130+'-'+_0x440bee+'/'+_0x3b2487)[_0x9f2b('0x22')](_0x5d28f9);}return null;};}function patchUpdates(_0x1c539e){return function(_0x41e7e6){try{jsonpatch[_0x9f2b('0x23')](_0x41e7e6,_0x1c539e,!![]);}catch(_0x45a753){return BPromise[_0x9f2b('0x24')](_0x45a753);}return _0x41e7e6[_0x9f2b('0x25')]();};}function saveUpdates(_0x56a5a7,_0x234209){return function(_0x6951f9){if(_0x6951f9){return _0x6951f9['update'](_0x56a5a7)[_0x9f2b('0x26')](function(_0x5a80b5){return _0x5a80b5;});}return null;};}function removeEntity(_0x2d8646,_0x354be1){return function(_0x5db8c2){if(_0x5db8c2){return _0x5db8c2['destroy']()['then'](function(){_0x2d8646['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5abf53,_0x1edf8e){return function(_0x3e9d68){if(!_0x3e9d68){_0x5abf53[_0x9f2b('0x19')](0x194);}return _0x3e9d68;};}function handleError(_0x2cada7,_0x4fa536){_0x4fa536=_0x4fa536||0x1f4;return function(_0x29ac4b){logger[_0x9f2b('0x27')](_0x29ac4b[_0x9f2b('0x28')]);if(_0x29ac4b[_0x9f2b('0x29')]){delete _0x29ac4b[_0x9f2b('0x29')];}_0x2cada7[_0x9f2b('0x1a')](_0x4fa536)[_0x9f2b('0x2a')](_0x29ac4b);};}exports[_0x9f2b('0x2b')]=function(_0x130308,_0x4760c3){var _0x2709fe={},_0x3aa489={},_0x5f495a={'count':0x0,'rows':[]};var _0x55b419=_['map'](db['FreshsalesField'][_0x9f2b('0x2c')],function(_0x57cd2e){return{'name':_0x57cd2e[_0x9f2b('0x2d')],'type':_0x57cd2e[_0x9f2b('0x2e')]['key']};});_0x3aa489[_0x9f2b('0x2f')]=_[_0x9f2b('0x30')](_0x55b419,_0x9f2b('0x29'));_0x3aa489[_0x9f2b('0x31')]=_[_0x9f2b('0x32')](_0x130308['query']);_0x3aa489[_0x9f2b('0x33')]=_[_0x9f2b('0x34')](_0x3aa489['model'],_0x3aa489[_0x9f2b('0x31')]);_0x2709fe[_0x9f2b('0x35')]=_[_0x9f2b('0x34')](_0x3aa489[_0x9f2b('0x2f')],qs['fields'](_0x130308['query']['fields']));_0x2709fe[_0x9f2b('0x35')]=_0x2709fe[_0x9f2b('0x35')]['length']?_0x2709fe[_0x9f2b('0x35')]:_0x3aa489[_0x9f2b('0x2f')];if(!_0x130308['query'][_0x9f2b('0x36')](_0x9f2b('0x37'))){_0x2709fe['limit']=qs[_0x9f2b('0x1d')](_0x130308[_0x9f2b('0x31')][_0x9f2b('0x1d')]);_0x2709fe[_0x9f2b('0x1f')]=qs[_0x9f2b('0x1f')](_0x130308[_0x9f2b('0x31')][_0x9f2b('0x1f')]);}_0x2709fe[_0x9f2b('0x38')]=qs[_0x9f2b('0x39')](_0x130308['query'][_0x9f2b('0x39')]);_0x2709fe[_0x9f2b('0x3a')]=qs[_0x9f2b('0x33')](_[_0x9f2b('0x3b')](_0x130308[_0x9f2b('0x31')],_0x3aa489[_0x9f2b('0x33')]),_0x55b419);if(_0x130308[_0x9f2b('0x31')][_0x9f2b('0x3c')]){_0x2709fe[_0x9f2b('0x3a')]=_['merge'](_0x2709fe[_0x9f2b('0x3a')],{'$or':_[_0x9f2b('0x30')](_0x55b419,function(_0x3303b2){if(_0x3303b2[_0x9f2b('0x2e')]!==_0x9f2b('0x3d')){var _0x1bdd71={};_0x1bdd71[_0x3303b2[_0x9f2b('0x29')]]={'$like':'%'+_0x130308[_0x9f2b('0x31')][_0x9f2b('0x3c')]+'%'};return _0x1bdd71;}})});}_0x2709fe=_[_0x9f2b('0x3e')]({},_0x2709fe,_0x130308['options']);var _0x49317d={'where':_0x2709fe['where']};return db[_0x9f2b('0x3f')][_0x9f2b('0x1e')](_0x49317d)[_0x9f2b('0x26')](function(_0x3f29b0){_0x5f495a[_0x9f2b('0x1e')]=_0x3f29b0;if(_0x130308[_0x9f2b('0x31')][_0x9f2b('0x40')]){_0x2709fe[_0x9f2b('0x41')]=[{'all':!![]}];}return db[_0x9f2b('0x3f')][_0x9f2b('0x42')](_0x2709fe);})[_0x9f2b('0x26')](function(_0x53adf4){_0x5f495a[_0x9f2b('0x43')]=_0x53adf4;return _0x5f495a;})[_0x9f2b('0x26')](respondWithFilteredResult(_0x4760c3,_0x2709fe))[_0x9f2b('0x44')](handleError(_0x4760c3,null));};exports['show']=function(_0x1af1b2,_0x21b014){var _0x248f61={'raw':!![],'where':{'id':_0x1af1b2[_0x9f2b('0x45')]['id']}},_0x1c819f={};_0x1c819f['model']=_[_0x9f2b('0x32')](db[_0x9f2b('0x3f')][_0x9f2b('0x2c')]);_0x1c819f['query']=_['keys'](_0x1af1b2[_0x9f2b('0x31')]);_0x1c819f['filters']=_[_0x9f2b('0x34')](_0x1c819f[_0x9f2b('0x2f')],_0x1c819f[_0x9f2b('0x31')]);_0x248f61[_0x9f2b('0x35')]=_[_0x9f2b('0x34')](_0x1c819f[_0x9f2b('0x2f')],qs[_0x9f2b('0x46')](_0x1af1b2['query']['fields']));_0x248f61[_0x9f2b('0x35')]=_0x248f61[_0x9f2b('0x35')][_0x9f2b('0x47')]?_0x248f61[_0x9f2b('0x35')]:_0x1c819f[_0x9f2b('0x2f')];if(_0x1af1b2['query'][_0x9f2b('0x40')]){_0x248f61['include']=[{'all':!![]}];}_0x248f61=_[_0x9f2b('0x3e')]({},_0x248f61,_0x1af1b2[_0x9f2b('0x48')]);return db['FreshsalesField'][_0x9f2b('0x49')](_0x248f61)[_0x9f2b('0x26')](handleEntityNotFound(_0x21b014,null))['then'](respondWithResult(_0x21b014,null))['catch'](handleError(_0x21b014,null));};exports[_0x9f2b('0x4a')]=function(_0x17840c,_0x4e1f4c){return db[_0x9f2b('0x3f')][_0x9f2b('0x4a')](_0x17840c[_0x9f2b('0x4b')],{})[_0x9f2b('0x26')](respondWithResult(_0x4e1f4c,0xc9))[_0x9f2b('0x44')](handleError(_0x4e1f4c,null));};exports[_0x9f2b('0x4c')]=function(_0x4163c9,_0x1e2ead){if(_0x4163c9[_0x9f2b('0x4b')]['id']){delete _0x4163c9[_0x9f2b('0x4b')]['id'];}return db['FreshsalesField'][_0x9f2b('0x49')]({'where':{'id':_0x4163c9['params']['id']}})['then'](handleEntityNotFound(_0x1e2ead,null))[_0x9f2b('0x26')](saveUpdates(_0x4163c9['body'],null))['then'](respondWithResult(_0x1e2ead,null))['catch'](handleError(_0x1e2ead,null));};exports[_0x9f2b('0x4d')]=function(_0x22f991,_0x53f50b){return db[_0x9f2b('0x3f')][_0x9f2b('0x49')]({'where':{'id':_0x22f991[_0x9f2b('0x45')]['id']}})[_0x9f2b('0x26')](handleEntityNotFound(_0x53f50b,null))[_0x9f2b('0x26')](removeEntity(_0x53f50b,null))[_0x9f2b('0x44')](handleError(_0x53f50b,null));}; \ No newline at end of file +var _0x3c58=['destroy','then','error','name','send','index','rawAttributes','fieldName','type','key','map','filters','model','intersection','fields','attributes','length','query','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','FreshsalesField','count','include','findAll','show','params','keys','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','save'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x3c58,0x1bd));var _0x83c5=function(_0xad33dd,_0x214b91){_0xad33dd=_0xad33dd-0x0;var _0x4193f1=_0x3c58[_0xad33dd];return _0x4193f1;};'use strict';var emlformat=require(_0x83c5('0x0'));var rimraf=require(_0x83c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83c5('0x2'));var rp=require('request-promise');var moment=require(_0x83c5('0x3'));var BPromise=require(_0x83c5('0x4'));var Mustache=require('mustache');var util=require(_0x83c5('0x5'));var path=require(_0x83c5('0x6'));var sox=require('sox');var csv=require(_0x83c5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83c5('0x8'));var _=require(_0x83c5('0x9'));var squel=require(_0x83c5('0xa'));var crypto=require('crypto');var jsforce=require(_0x83c5('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x83c5('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x83c5('0xd'));var hardwareService=require(_0x83c5('0xe'));var logger=require('../../config/logger')(_0x83c5('0xf'));var utils=require(_0x83c5('0x10'));var config=require(_0x83c5('0x11'));var licenseUtil=require(_0x83c5('0x12'));var db=require(_0x83c5('0x13'))['db'];function respondWithStatusCode(_0x221901,_0x5a3407){_0x5a3407=_0x5a3407||0xcc;return function(_0x2a0ca0){if(_0x2a0ca0){return _0x221901[_0x83c5('0x14')](_0x5a3407);}return _0x221901[_0x83c5('0x15')](_0x5a3407)[_0x83c5('0x16')]();};}function respondWithResult(_0x4f2f52,_0x4e2e66){_0x4e2e66=_0x4e2e66||0xc8;return function(_0x2cb5ad){if(_0x2cb5ad){return _0x4f2f52[_0x83c5('0x15')](_0x4e2e66)['json'](_0x2cb5ad);}};}function respondWithFilteredResult(_0x1fa509,_0x2559b8){return function(_0x3f67d5){if(_0x3f67d5){var _0x45a1e2=typeof _0x2559b8[_0x83c5('0x17')]===_0x83c5('0x18')&&typeof _0x2559b8[_0x83c5('0x19')]===_0x83c5('0x18');var _0x498a95=_0x3f67d5['count'];var _0x5b4180=_0x45a1e2?0x0:_0x2559b8[_0x83c5('0x17')];var _0x1ea4f3=_0x45a1e2?_0x3f67d5['count']:_0x2559b8['offset']+_0x2559b8[_0x83c5('0x19')];var _0x1e0cf3;if(_0x1ea4f3>=_0x498a95){_0x1ea4f3=_0x498a95;_0x1e0cf3=0xc8;}else{_0x1e0cf3=0xce;}_0x1fa509['status'](_0x1e0cf3);return _0x1fa509[_0x83c5('0x1a')](_0x83c5('0x1b'),_0x5b4180+'-'+_0x1ea4f3+'/'+_0x498a95)['json'](_0x3f67d5);}return null;};}function patchUpdates(_0x1aaaf9){return function(_0x51771a){try{jsonpatch[_0x83c5('0x1c')](_0x51771a,_0x1aaaf9,!![]);}catch(_0x29d0e4){return BPromise[_0x83c5('0x1d')](_0x29d0e4);}return _0x51771a[_0x83c5('0x1e')]();};}function saveUpdates(_0x19d892,_0x2d4ea3){return function(_0x4e7317){if(_0x4e7317){return _0x4e7317['update'](_0x19d892)['then'](function(_0x56300d){return _0x56300d;});}return null;};}function removeEntity(_0x18dcab,_0x54b99a){return function(_0x30e305){if(_0x30e305){return _0x30e305[_0x83c5('0x1f')]()[_0x83c5('0x20')](function(){_0x18dcab[_0x83c5('0x15')](0xcc)[_0x83c5('0x16')]();});}};}function handleEntityNotFound(_0x279e78,_0x109be7){return function(_0x5f22be){if(!_0x5f22be){_0x279e78[_0x83c5('0x14')](0x194);}return _0x5f22be;};}function handleError(_0x56ec4b,_0xd17958){_0xd17958=_0xd17958||0x1f4;return function(_0x510167){logger[_0x83c5('0x21')](_0x510167['stack']);if(_0x510167['name']){delete _0x510167[_0x83c5('0x22')];}_0x56ec4b[_0x83c5('0x15')](_0xd17958)[_0x83c5('0x23')](_0x510167);};}exports[_0x83c5('0x24')]=function(_0x55269a,_0x9019a2){var _0x5afe6a={},_0x56e5db={},_0x262a20={'count':0x0,'rows':[]};var _0x5db4ac=_['map'](db['FreshsalesField'][_0x83c5('0x25')],function(_0x489b8b){return{'name':_0x489b8b[_0x83c5('0x26')],'type':_0x489b8b[_0x83c5('0x27')][_0x83c5('0x28')]};});_0x56e5db['model']=_[_0x83c5('0x29')](_0x5db4ac,'name');_0x56e5db['query']=_['keys'](_0x55269a['query']);_0x56e5db[_0x83c5('0x2a')]=_['intersection'](_0x56e5db[_0x83c5('0x2b')],_0x56e5db['query']);_0x5afe6a['attributes']=_[_0x83c5('0x2c')](_0x56e5db[_0x83c5('0x2b')],qs[_0x83c5('0x2d')](_0x55269a['query'][_0x83c5('0x2d')]));_0x5afe6a[_0x83c5('0x2e')]=_0x5afe6a[_0x83c5('0x2e')][_0x83c5('0x2f')]?_0x5afe6a[_0x83c5('0x2e')]:_0x56e5db[_0x83c5('0x2b')];if(!_0x55269a[_0x83c5('0x30')][_0x83c5('0x31')]('nolimit')){_0x5afe6a['limit']=qs[_0x83c5('0x19')](_0x55269a[_0x83c5('0x30')][_0x83c5('0x19')]);_0x5afe6a['offset']=qs[_0x83c5('0x17')](_0x55269a[_0x83c5('0x30')][_0x83c5('0x17')]);}_0x5afe6a[_0x83c5('0x32')]=qs[_0x83c5('0x33')](_0x55269a[_0x83c5('0x30')][_0x83c5('0x33')]);_0x5afe6a[_0x83c5('0x34')]=qs['filters'](_[_0x83c5('0x35')](_0x55269a[_0x83c5('0x30')],_0x56e5db['filters']),_0x5db4ac);if(_0x55269a[_0x83c5('0x30')]['filter']){_0x5afe6a['where']=_[_0x83c5('0x36')](_0x5afe6a[_0x83c5('0x34')],{'$or':_[_0x83c5('0x29')](_0x5db4ac,function(_0x4537e3){if(_0x4537e3['type']!==_0x83c5('0x37')){var _0x48cef7={};_0x48cef7[_0x4537e3[_0x83c5('0x22')]]={'$like':'%'+_0x55269a[_0x83c5('0x30')]['filter']+'%'};return _0x48cef7;}})});}_0x5afe6a=_[_0x83c5('0x36')]({},_0x5afe6a,_0x55269a['options']);var _0x595cdd={'where':_0x5afe6a[_0x83c5('0x34')]};return db[_0x83c5('0x38')][_0x83c5('0x39')](_0x595cdd)[_0x83c5('0x20')](function(_0x39d019){_0x262a20['count']=_0x39d019;if(_0x55269a[_0x83c5('0x30')]['includeAll']){_0x5afe6a[_0x83c5('0x3a')]=[{'all':!![]}];}return db[_0x83c5('0x38')][_0x83c5('0x3b')](_0x5afe6a);})['then'](function(_0x40d9bf){_0x262a20['rows']=_0x40d9bf;return _0x262a20;})[_0x83c5('0x20')](respondWithFilteredResult(_0x9019a2,_0x5afe6a))['catch'](handleError(_0x9019a2,null));};exports[_0x83c5('0x3c')]=function(_0x75c1e4,_0x455dd9){var _0x4ac6e4={'raw':!![],'where':{'id':_0x75c1e4[_0x83c5('0x3d')]['id']}},_0xb1b734={};_0xb1b734[_0x83c5('0x2b')]=_[_0x83c5('0x3e')](db[_0x83c5('0x38')][_0x83c5('0x25')]);_0xb1b734[_0x83c5('0x30')]=_[_0x83c5('0x3e')](_0x75c1e4[_0x83c5('0x30')]);_0xb1b734[_0x83c5('0x2a')]=_[_0x83c5('0x2c')](_0xb1b734[_0x83c5('0x2b')],_0xb1b734[_0x83c5('0x30')]);_0x4ac6e4[_0x83c5('0x2e')]=_['intersection'](_0xb1b734['model'],qs[_0x83c5('0x2d')](_0x75c1e4[_0x83c5('0x30')][_0x83c5('0x2d')]));_0x4ac6e4[_0x83c5('0x2e')]=_0x4ac6e4[_0x83c5('0x2e')][_0x83c5('0x2f')]?_0x4ac6e4[_0x83c5('0x2e')]:_0xb1b734[_0x83c5('0x2b')];if(_0x75c1e4[_0x83c5('0x30')]['includeAll']){_0x4ac6e4['include']=[{'all':!![]}];}_0x4ac6e4=_[_0x83c5('0x36')]({},_0x4ac6e4,_0x75c1e4[_0x83c5('0x3f')]);return db[_0x83c5('0x38')][_0x83c5('0x40')](_0x4ac6e4)[_0x83c5('0x20')](handleEntityNotFound(_0x455dd9,null))['then'](respondWithResult(_0x455dd9,null))[_0x83c5('0x41')](handleError(_0x455dd9,null));};exports['create']=function(_0x6803ba,_0x1e91fc){return db[_0x83c5('0x38')][_0x83c5('0x42')](_0x6803ba[_0x83c5('0x43')],{})['then'](respondWithResult(_0x1e91fc,0xc9))[_0x83c5('0x41')](handleError(_0x1e91fc,null));};exports['update']=function(_0x10625a,_0x54f99f){if(_0x10625a[_0x83c5('0x43')]['id']){delete _0x10625a[_0x83c5('0x43')]['id'];}return db[_0x83c5('0x38')][_0x83c5('0x40')]({'where':{'id':_0x10625a[_0x83c5('0x3d')]['id']}})[_0x83c5('0x20')](handleEntityNotFound(_0x54f99f,null))[_0x83c5('0x20')](saveUpdates(_0x10625a[_0x83c5('0x43')],null))[_0x83c5('0x20')](respondWithResult(_0x54f99f,null))[_0x83c5('0x41')](handleError(_0x54f99f,null));};exports[_0x83c5('0x1f')]=function(_0x2f5149,_0x3df2d4){return db[_0x83c5('0x38')]['find']({'where':{'id':_0x2f5149[_0x83c5('0x3d')]['id']}})[_0x83c5('0x20')](handleEntityNotFound(_0x3df2d4,null))[_0x83c5('0x20')](removeEntity(_0x3df2d4,null))['catch'](handleError(_0x3df2d4,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 3418d1c..39f8e74 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 _0xa848=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xd511ff,_0xf77ab9){var _0x508d6d=function(_0x19342a){while(--_0x19342a){_0xd511ff['push'](_0xd511ff['shift']());}};_0x508d6d(++_0xf77ab9);}(_0xa848,0x99));var _0x8a84=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa848[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x8a84('0x0'));var util=require(_0x8a84('0x1'));var logger=require(_0x8a84('0x2'))('api');var moment=require(_0x8a84('0x3'));var BPromise=require(_0x8a84('0x4'));var rp=require(_0x8a84('0x5'));var fs=require('fs');var path=require(_0x8a84('0x6'));var rimraf=require(_0x8a84('0x7'));var config=require(_0x8a84('0x8'));var attributes=require(_0x8a84('0x9'));module[_0x8a84('0xa')]=function(_0x13acad,_0x3ee596){return _0x13acad[_0x8a84('0xb')](_0x8a84('0xc'),attributes,{'tableName':_0x8a84('0xd'),'paranoid':![],'indexes':[{'name':_0x8a84('0xe'),'fields':['idField',_0x8a84('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae8e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae8e,0xc3));var _0xeae8=function(_0x3938d2,_0x8e9793){_0x3938d2=_0x3938d2-0x0;var _0x45513c=_0xae8e[_0x3938d2];return _0x45513c;};'use strict';var _=require(_0xeae8('0x0'));var util=require(_0xeae8('0x1'));var logger=require(_0xeae8('0x2'))(_0xeae8('0x3'));var moment=require(_0xeae8('0x4'));var BPromise=require(_0xeae8('0x5'));var rp=require(_0xeae8('0x6'));var fs=require('fs');var path=require(_0xeae8('0x7'));var rimraf=require(_0xeae8('0x8'));var config=require(_0xeae8('0x9'));var attributes=require(_0xeae8('0xa'));module[_0xeae8('0xb')]=function(_0x23b0d7,_0x17345e){return _0x23b0d7[_0xeae8('0xc')](_0xeae8('0xd'),attributes,{'tableName':_0xeae8('0xe'),'paranoid':![],'indexes':[{'name':_0xeae8('0xf'),'fields':[_0xeae8('0x10'),_0xeae8('0x11')],'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 2bc9fb7..0fbd8e8 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x4975,0x86));var _0x5497=function(_0x16fcd9,_0x250c06){_0x16fcd9=_0x16fcd9-0x0;var _0x29fefd=_0x4975[_0x16fcd9];return _0x29fefd;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0x524e,0x15e));var _0xe524=function(_0x4b7644,_0x4baf98){_0x4b7644=_0x4b7644-0x0;var _0x198495=_0x524e[_0x4b7644];return _0x198495;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index d02b975..0adffa6 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(_0x38b171,_0x5d4925){var _0xe18c8=function(_0x468127){while(--_0x468127){_0x38b171['push'](_0x38b171['shift']());}};_0xe18c8(++_0x5d4925);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x420001,_0x2488b5){var _0x1c5ef2=function(_0x143bdc){while(--_0x143bdc){_0x420001['push'](_0x420001['shift']());}};_0x1c5ef2(++_0x2488b5);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 2f09939..1246a8e 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 _0x363a=['newTab','exports','STRING','username','ENUM','integrationTab'];(function(_0x4c2845,_0x16f1a0){var _0x2eb1db=function(_0x49a5ce){while(--_0x49a5ce){_0x4c2845['push'](_0x4c2845['shift']());}};_0x2eb1db(++_0x16f1a0);}(_0x363a,0x97));var _0xa363=function(_0x122e42,_0x222609){_0x122e42=_0x122e42-0x0;var _0x4c019e=_0x363a[_0x122e42];return _0x4c019e;};'use strict';var Sequelize=require('sequelize');module[_0xa363('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa363('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xa363('0x2')},'remoteUri':{'type':Sequelize[_0xa363('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xa363('0x1')]},'clientSecret':{'type':Sequelize[_0xa363('0x1')]},'securityToken':{'type':Sequelize[_0xa363('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa363('0x3')](_0xa363('0x4'),_0xa363('0x5')),'defaultValue':_0xa363('0x4')}}; \ No newline at end of file +var _0x2906=['ENUM','newTab','sequelize','exports','STRING','username'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0x2906,0xe0));var _0x6290=function(_0xafceaf,_0x5c65ad){_0xafceaf=_0xafceaf-0x0;var _0x3684e4=_0x2906[_0xafceaf];return _0x3684e4;};'use strict';var Sequelize=require(_0x6290('0x0'));module[_0x6290('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6290('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6290('0x3')},'remoteUri':{'type':Sequelize[_0x6290('0x2')]},'password':{'type':Sequelize[_0x6290('0x2')]},'clientId':{'type':Sequelize[_0x6290('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6290('0x4')]('integrationTab',_0x6290('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index df6f2d6..76ba4c2 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 _0x83f9=['clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','login','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','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/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','SalesforceAccount','findAll','show','intersection','fields','includeAll','include','find','create','body','catch','params','getConfigurations','findOne','SalesforceConfiguration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId'];(function(_0x317e30,_0x32ad66){var _0x203788=function(_0x264d38){while(--_0x264d38){_0x317e30['push'](_0x317e30['shift']());}};_0x203788(++_0x32ad66);}(_0x83f9,0x197));var _0x983f=function(_0x3814d4,_0x32ea27){_0x3814d4=_0x3814d4-0x0;var _0x315172=_0x83f9[_0x3814d4];return _0x315172;};'use strict';var emlformat=require(_0x983f('0x0'));var rimraf=require(_0x983f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x983f('0x2'));var rp=require('request-promise');var moment=require(_0x983f('0x3'));var BPromise=require(_0x983f('0x4'));var Mustache=require(_0x983f('0x5'));var util=require(_0x983f('0x6'));var path=require('path');var sox=require(_0x983f('0x7'));var csv=require(_0x983f('0x8'));var ejs=require(_0x983f('0x9'));var fs=require('fs');var fs_extra=require(_0x983f('0xa'));var _=require(_0x983f('0xb'));var squel=require('squel');var crypto=require(_0x983f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x983f('0xd'));var toCsv=require(_0x983f('0x8'));var querystring=require(_0x983f('0xe'));var Papa=require(_0x983f('0xf'));var Redis=require(_0x983f('0x10'));var authService=require(_0x983f('0x11'));var qs=require(_0x983f('0x12'));var as=require(_0x983f('0x13'));var hardwareService=require(_0x983f('0x14'));var logger=require(_0x983f('0x15'))(_0x983f('0x16'));var utils=require('../../config/utils');var config=require(_0x983f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x983f('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3cf8f3,_0x24e309){_0x24e309=_0x24e309||0xcc;return function(_0xe16392){if(_0xe16392){return _0x3cf8f3[_0x983f('0x19')](_0x24e309);}return _0x3cf8f3[_0x983f('0x1a')](_0x24e309)[_0x983f('0x1b')]();};}function respondWithResult(_0x26392a,_0x388208){_0x388208=_0x388208||0xc8;return function(_0x57e2a1){if(_0x57e2a1){return _0x26392a[_0x983f('0x1a')](_0x388208)[_0x983f('0x1c')](_0x57e2a1);}};}function respondWithFilteredResult(_0x387872,_0x2ebd60){return function(_0x1f3f1d){if(_0x1f3f1d){var _0x2f099e=typeof _0x2ebd60[_0x983f('0x1d')]===_0x983f('0x1e')&&typeof _0x2ebd60[_0x983f('0x1f')]===_0x983f('0x1e');var _0xe468ad=_0x1f3f1d[_0x983f('0x20')];var _0x1923da=_0x2f099e?0x0:_0x2ebd60['offset'];var _0x4ace4a=_0x2f099e?_0x1f3f1d[_0x983f('0x20')]:_0x2ebd60[_0x983f('0x1d')]+_0x2ebd60[_0x983f('0x1f')];var _0x385942;if(_0x4ace4a>=_0xe468ad){_0x4ace4a=_0xe468ad;_0x385942=0xc8;}else{_0x385942=0xce;}_0x387872[_0x983f('0x1a')](_0x385942);return _0x387872[_0x983f('0x21')]('Content-Range',_0x1923da+'-'+_0x4ace4a+'/'+_0xe468ad)[_0x983f('0x1c')](_0x1f3f1d);}return null;};}function patchUpdates(_0x34d0ec){return function(_0x1c6340){try{jsonpatch['apply'](_0x1c6340,_0x34d0ec,!![]);}catch(_0x3c24d7){return BPromise['reject'](_0x3c24d7);}return _0x1c6340['save']();};}function saveUpdates(_0x1cd832,_0x1390e0){return function(_0x73a4ca){if(_0x73a4ca){return _0x73a4ca[_0x983f('0x22')](_0x1cd832)['then'](function(_0x21014f){return _0x21014f;});}return null;};}function removeEntity(_0x506133,_0x39a7f5){return function(_0x1d3028){if(_0x1d3028){return _0x1d3028[_0x983f('0x23')]()[_0x983f('0x24')](function(){_0x506133['status'](0xcc)[_0x983f('0x1b')]();});}};}function handleEntityNotFound(_0x381eb0,_0x3847ae){return function(_0x2bd811){if(!_0x2bd811){_0x381eb0['sendStatus'](0x194);}return _0x2bd811;};}function handleError(_0x5c14b2,_0x1a3633){_0x1a3633=_0x1a3633||0x1f4;return function(_0x493038){logger[_0x983f('0x25')](_0x493038['stack']);if(_0x493038[_0x983f('0x26')]){delete _0x493038['name'];}_0x5c14b2[_0x983f('0x1a')](_0x1a3633)[_0x983f('0x27')](_0x493038);};}exports[_0x983f('0x28')]=function(_0x993afb,_0x2d1456){var _0xba33f0={},_0x68157b={},_0x438bb8={'count':0x0,'rows':[]};var _0x2baca2=_[_0x983f('0x29')](db['SalesforceAccount'][_0x983f('0x2a')],function(_0xc3b167){return{'name':_0xc3b167[_0x983f('0x2b')],'type':_0xc3b167[_0x983f('0x2c')][_0x983f('0x2d')]};});_0x68157b[_0x983f('0x2e')]=_['map'](_0x2baca2,_0x983f('0x26'));_0x68157b[_0x983f('0x2f')]=_[_0x983f('0x30')](_0x993afb[_0x983f('0x2f')]);_0x68157b[_0x983f('0x31')]=_['intersection'](_0x68157b[_0x983f('0x2e')],_0x68157b[_0x983f('0x2f')]);_0xba33f0[_0x983f('0x32')]=_['intersection'](_0x68157b['model'],qs['fields'](_0x993afb[_0x983f('0x2f')]['fields']));_0xba33f0['attributes']=_0xba33f0[_0x983f('0x32')][_0x983f('0x33')]?_0xba33f0[_0x983f('0x32')]:_0x68157b['model'];if(!_0x993afb[_0x983f('0x2f')][_0x983f('0x34')](_0x983f('0x35'))){_0xba33f0[_0x983f('0x1f')]=qs['limit'](_0x993afb[_0x983f('0x2f')]['limit']);_0xba33f0[_0x983f('0x1d')]=qs[_0x983f('0x1d')](_0x993afb['query'][_0x983f('0x1d')]);}_0xba33f0[_0x983f('0x36')]=qs[_0x983f('0x37')](_0x993afb[_0x983f('0x2f')][_0x983f('0x37')]);_0xba33f0[_0x983f('0x38')]=qs[_0x983f('0x31')](_[_0x983f('0x39')](_0x993afb['query'],_0x68157b['filters']),_0x2baca2);if(_0x993afb['query']['filter']){_0xba33f0[_0x983f('0x38')]=_['merge'](_0xba33f0[_0x983f('0x38')],{'$or':_[_0x983f('0x29')](_0x2baca2,function(_0x70047d){if(_0x70047d['type']!==_0x983f('0x3a')){var _0x1a13fd={};_0x1a13fd[_0x70047d[_0x983f('0x26')]]={'$like':'%'+_0x993afb[_0x983f('0x2f')]['filter']+'%'};return _0x1a13fd;}})});}_0xba33f0=_[_0x983f('0x3b')]({},_0xba33f0,_0x993afb[_0x983f('0x3c')]);var _0x489e16={'where':_0xba33f0[_0x983f('0x38')]};return db[_0x983f('0x3d')][_0x983f('0x20')](_0x489e16)[_0x983f('0x24')](function(_0x356426){_0x438bb8[_0x983f('0x20')]=_0x356426;if(_0x993afb[_0x983f('0x2f')]['includeAll']){_0xba33f0['include']=[{'all':!![]}];}return db[_0x983f('0x3d')][_0x983f('0x3e')](_0xba33f0);})[_0x983f('0x24')](function(_0x39416d){_0x438bb8['rows']=_0x39416d;return _0x438bb8;})[_0x983f('0x24')](respondWithFilteredResult(_0x2d1456,_0xba33f0))['catch'](handleError(_0x2d1456,null));};exports[_0x983f('0x3f')]=function(_0x3f5b78,_0x111eb5){var _0x627ffa={'raw':![],'where':{'id':_0x3f5b78['params']['id']}},_0x2a2518={};_0x2a2518[_0x983f('0x2e')]=_['keys'](db['SalesforceAccount'][_0x983f('0x2a')]);_0x2a2518['query']=_[_0x983f('0x30')](_0x3f5b78['query']);_0x2a2518[_0x983f('0x31')]=_[_0x983f('0x40')](_0x2a2518[_0x983f('0x2e')],_0x2a2518['query']);_0x627ffa['attributes']=_[_0x983f('0x40')](_0x2a2518['model'],qs[_0x983f('0x41')](_0x3f5b78[_0x983f('0x2f')][_0x983f('0x41')]));_0x627ffa['attributes']=_0x627ffa[_0x983f('0x32')][_0x983f('0x33')]?_0x627ffa[_0x983f('0x32')]:_0x2a2518[_0x983f('0x2e')];if(_0x3f5b78[_0x983f('0x2f')][_0x983f('0x42')]){_0x627ffa[_0x983f('0x43')]=[{'all':!![]}];}_0x627ffa=_[_0x983f('0x3b')]({},_0x627ffa,_0x3f5b78[_0x983f('0x3c')]);return db[_0x983f('0x3d')][_0x983f('0x44')](_0x627ffa)[_0x983f('0x24')](handleEntityNotFound(_0x111eb5,null))[_0x983f('0x24')](respondWithResult(_0x111eb5,null))['catch'](handleError(_0x111eb5,null));};exports[_0x983f('0x45')]=function(_0x48d4f3,_0x59e106){return db['SalesforceAccount']['create'](_0x48d4f3[_0x983f('0x46')],{})['then'](respondWithResult(_0x59e106,0xc9))[_0x983f('0x47')](handleError(_0x59e106,null));};exports[_0x983f('0x22')]=function(_0x1e723e,_0x54c76b){if(_0x1e723e[_0x983f('0x46')]['id']){delete _0x1e723e['body']['id'];}return db[_0x983f('0x3d')][_0x983f('0x44')]({'where':{'id':_0x1e723e[_0x983f('0x48')]['id']}})[_0x983f('0x24')](handleEntityNotFound(_0x54c76b,null))[_0x983f('0x24')](saveUpdates(_0x1e723e[_0x983f('0x46')],null))[_0x983f('0x24')](respondWithResult(_0x54c76b,null))[_0x983f('0x47')](handleError(_0x54c76b,null));};exports[_0x983f('0x23')]=function(_0x5aca24,_0x28d1aa){return db[_0x983f('0x3d')][_0x983f('0x44')]({'where':{'id':_0x5aca24[_0x983f('0x48')]['id']}})['then'](handleEntityNotFound(_0x28d1aa,null))[_0x983f('0x24')](removeEntity(_0x28d1aa,null))[_0x983f('0x47')](handleError(_0x28d1aa,null));};exports[_0x983f('0x49')]=function(_0x495f3b,_0x46b016,_0x41eab9){var _0x3dcddd={};var _0x5e1b5f={};var _0x3c7f59;var _0x1b5b30;return db[_0x983f('0x3d')][_0x983f('0x4a')]({'where':{'id':_0x495f3b[_0x983f('0x48')]['id']}})[_0x983f('0x24')](handleEntityNotFound(_0x46b016,null))['then'](function(_0x276a9d){if(_0x276a9d){_0x3c7f59=_0x276a9d;_0x5e1b5f[_0x983f('0x2e')]=_['keys'](db[_0x983f('0x4b')][_0x983f('0x2a')]);_0x5e1b5f[_0x983f('0x2f')]=_[_0x983f('0x30')](_0x495f3b[_0x983f('0x2f')]);_0x5e1b5f['filters']=_['intersection'](_0x5e1b5f[_0x983f('0x2e')],_0x5e1b5f[_0x983f('0x2f')]);_0x3dcddd[_0x983f('0x32')]=_[_0x983f('0x40')](_0x5e1b5f['model'],qs[_0x983f('0x41')](_0x495f3b[_0x983f('0x2f')][_0x983f('0x41')]));_0x3dcddd[_0x983f('0x32')]=_0x3dcddd['attributes'][_0x983f('0x33')]?_0x3dcddd['attributes']:_0x5e1b5f[_0x983f('0x2e')];_0x3dcddd['order']=qs[_0x983f('0x37')](_0x495f3b['query'][_0x983f('0x37')]);_0x3dcddd['where']=qs[_0x983f('0x31')](_[_0x983f('0x39')](_0x495f3b['query'],_0x5e1b5f[_0x983f('0x31')]));if(_0x495f3b[_0x983f('0x2f')][_0x983f('0x4c')]){_0x3dcddd[_0x983f('0x38')]=_[_0x983f('0x3b')](_0x3dcddd['where'],{'$or':_[_0x983f('0x29')](_0x3dcddd['attributes'],function(_0x124c47){var _0xa7d857={};_0xa7d857[_0x124c47]={'$like':'%'+_0x495f3b['query'][_0x983f('0x4c')]+'%'};return _0xa7d857;})});}_0x3dcddd=_[_0x983f('0x3b')]({},_0x3dcddd,_0x495f3b[_0x983f('0x3c')]);return _0x3c7f59[_0x983f('0x49')](_0x3dcddd);}})[_0x983f('0x24')](function(_0x5db141){if(_0x5db141){_0x1b5b30=_0x5db141[_0x983f('0x33')];if(!_0x495f3b[_0x983f('0x2f')][_0x983f('0x34')](_0x983f('0x35'))){_0x3dcddd['limit']=qs[_0x983f('0x1f')](_0x495f3b['query'][_0x983f('0x1f')]);_0x3dcddd['offset']=qs[_0x983f('0x1d')](_0x495f3b[_0x983f('0x2f')][_0x983f('0x1d')]);}return _0x3c7f59['getConfigurations'](_0x3dcddd);}})['then'](function(_0x163e19){if(_0x163e19){return _0x163e19?{'count':_0x1b5b30,'rows':_0x163e19}:null;}})[_0x983f('0x24')](respondWithResult(_0x46b016,null))['catch'](handleError(_0x46b016,null));};exports[_0x983f('0x4d')]=function(_0x3f0c7c,_0x2bd545,_0x1aec30){if(_0x3f0c7c[_0x983f('0x46')]['id']){delete _0x3f0c7c[_0x983f('0x46')]['id'];}return db[_0x983f('0x3d')][_0x983f('0x4a')]({'where':{'id':_0x3f0c7c[_0x983f('0x48')]['id']}})[_0x983f('0x24')](handleEntityNotFound(_0x2bd545,null))['then'](function(_0x281011){if(_0x281011){_0x3f0c7c[_0x983f('0x46')][_0x983f('0x4e')]=_0x281011['id'];_0x3f0c7c[_0x983f('0x46')][_0x983f('0x4f')]=integrations[_0x983f('0x50')](_0x3f0c7c[_0x983f('0x46')][_0x983f('0x51')],_0x3f0c7c[_0x983f('0x46')][_0x983f('0x2c')]);_0x3f0c7c[_0x983f('0x46')][_0x983f('0x52')]=integrations[_0x983f('0x53')](_0x3f0c7c[_0x983f('0x46')][_0x983f('0x51')],_0x3f0c7c[_0x983f('0x46')][_0x983f('0x2c')]);return db[_0x983f('0x4b')][_0x983f('0x45')](_0x3f0c7c[_0x983f('0x46')],{'include':[{'model':db[_0x983f('0x54')],'as':'Subjects'},{'model':db[_0x983f('0x54')],'as':_0x983f('0x52')}]});}return null;})['then'](respondWithResult(_0x2bd545,null))['catch'](handleError(_0x2bd545,null));};exports[_0x983f('0x55')]=function(_0x5c99d9,_0x195bbf,_0x13ba45){var _0x576484;var _0x38bd00='';var _0x2d8972=_0x983f('0x56');return db[_0x983f('0x3d')]['findOne']({'where':{'id':_0x5c99d9[_0x983f('0x48')]['id']},'attributes':['id',_0x983f('0x57'),_0x983f('0x58'),_0x983f('0x59'),_0x983f('0x5a'),_0x983f('0x5b'),_0x983f('0x5c')]})['then'](handleEntityNotFound(_0x195bbf,null))[_0x983f('0x24')](function(_0x42eca2){if(_0x42eca2){_0x38bd00=_0x42eca2[_0x983f('0x57')];var _0x10e5ce=_0x38bd00[_0x983f('0x5d')](-0x1);if(_0x10e5ce==='/'){_0x38bd00=_0x38bd00['substring'](0x0,_0x38bd00[_0x983f('0x5e')](_0x10e5ce));}_0x576484=new jsforce[(_0x983f('0x5f'))]({'oauth2':{'loginUrl':_0x38bd00,'clientId':_0x42eca2['clientId'],'clientSecret':_0x42eca2[_0x983f('0x59')]}});return _0x576484[_0x983f('0x60')](_0x42eca2['username'],_0x42eca2[_0x983f('0x5b')]['concat'](_0x42eca2[_0x983f('0x5c')]));}})[_0x983f('0x24')](function(_0x1ae3fc){if(_0x1ae3fc){if(!_[_0x983f('0x61')](_0x5c99d9['query'][_0x983f('0x62')])){_0x2d8972=_0x5c99d9[_0x983f('0x2f')]['ticketType'];}return _0x576484['sobject'](_0x2d8972)[_0x983f('0x63')]();}})[_0x983f('0x24')](function(_0x408f69){var _0x2dc880=[_0x983f('0x64'),_0x983f('0x65'),_0x983f('0x66'),_0x983f('0x67'),_0x983f('0x68'),_0x983f('0x69')];var _0x3b8808=[_0x983f('0x6a'),_0x983f('0x6b'),_0x983f('0x6c'),_0x983f('0x6d'),_0x983f('0x6e'),_0x983f('0x6f'),_0x983f('0x70')];if(_0x408f69){_['remove'](_0x408f69[_0x983f('0x41')],function(_0x325c9a){return _0x2dc880[_0x983f('0x71')](_0x325c9a['name'])||!_0x3b8808[_0x983f('0x71')](_0x325c9a[_0x983f('0x2c')]);});return{'count':_0x408f69[_0x983f('0x41')][_0x983f('0x33')],'rows':_[_0x983f('0x29')](_0x408f69[_0x983f('0x41')],function(_0x360ba3){return{'id':_0x360ba3[_0x983f('0x26')],'name':_0x360ba3[_0x983f('0x72')],'custom':_0x360ba3[_0x983f('0x73')],'options':_0x360ba3['picklistValues'][_0x983f('0x33')]>0x0?_[_0x983f('0x29')](_0x360ba3[_0x983f('0x74')],function(_0x26c562){return{'name':_0x26c562[_0x983f('0x72')],'value':_0x26c562['value']};}):_0x360ba3[_0x983f('0x2c')]==_0x983f('0x6d')?[{'name':_0x983f('0x75'),'value':_0x983f('0x76')},{'name':_0x983f('0x77'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x195bbf,null))[_0x983f('0x47')](function(_0x40150d){var _0x4f3682=_0x5c99d9[_0x983f('0x2f')][_0x983f('0x78')]?0x1f4:_0x40150d[_0x983f('0x79')]||0x1f4;logger['error'](_0x983f('0x7a'),_0x983f('0x55'),_0x4f3682,JSON[_0x983f('0x7b')](_0x40150d));delete _0x40150d['name'];if(_0x4f3682===0x191){_0x4f3682=0x190;}_0x195bbf[_0x983f('0x1a')](_0x4f3682)[_0x983f('0x27')](_0x5c99d9[_0x983f('0x2f')][_0x983f('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x40150d['statusCode']}:_0x40150d);});}; \ No newline at end of file +var _0x9be1=['include','SalesforceAccount','rows','catch','params','create','body','find','findOne','SalesforceConfiguration','length','getConfigurations','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','SalesforceField','Subjects','getFields','remoteUri','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientId','concat','isNil','ticketType','sobject','describe','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count'];(function(_0x3bc255,_0x5712b0){var _0x14e4fc=function(_0x1de689){while(--_0x1de689){_0x3bc255['push'](_0x3bc255['shift']());}};_0x14e4fc(++_0x5712b0);}(_0x9be1,0x128));var _0x19be=function(_0x2f5a4e,_0x2e4bfe){_0x2f5a4e=_0x2f5a4e-0x0;var _0x7b2856=_0x9be1[_0x2f5a4e];return _0x7b2856;};'use strict';var emlformat=require(_0x19be('0x0'));var rimraf=require(_0x19be('0x1'));var zipdir=require(_0x19be('0x2'));var jsonpatch=require(_0x19be('0x3'));var rp=require(_0x19be('0x4'));var moment=require(_0x19be('0x5'));var BPromise=require(_0x19be('0x6'));var Mustache=require(_0x19be('0x7'));var util=require(_0x19be('0x8'));var path=require(_0x19be('0x9'));var sox=require(_0x19be('0xa'));var csv=require(_0x19be('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x19be('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x19be('0xd'));var jsforce=require(_0x19be('0xe'));var deskjs=require(_0x19be('0xf'));var toCsv=require(_0x19be('0xb'));var querystring=require(_0x19be('0x10'));var Papa=require('papaparse');var Redis=require(_0x19be('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x19be('0x12'));var as=require(_0x19be('0x13'));var hardwareService=require(_0x19be('0x14'));var logger=require(_0x19be('0x15'))(_0x19be('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x19be('0x17'));var db=require(_0x19be('0x18'))['db'];var integrations=require(_0x19be('0x19'));function respondWithStatusCode(_0x45f60f,_0x30b9c1){_0x30b9c1=_0x30b9c1||0xcc;return function(_0xaa06ff){if(_0xaa06ff){return _0x45f60f[_0x19be('0x1a')](_0x30b9c1);}return _0x45f60f[_0x19be('0x1b')](_0x30b9c1)[_0x19be('0x1c')]();};}function respondWithResult(_0xb9800e,_0x34e357){_0x34e357=_0x34e357||0xc8;return function(_0x1aec16){if(_0x1aec16){return _0xb9800e[_0x19be('0x1b')](_0x34e357)[_0x19be('0x1d')](_0x1aec16);}};}function respondWithFilteredResult(_0x26a629,_0x35bcff){return function(_0x571354){if(_0x571354){var _0x37df42=typeof _0x35bcff['offset']===_0x19be('0x1e')&&typeof _0x35bcff[_0x19be('0x1f')]===_0x19be('0x1e');var _0x4ca9dc=_0x571354['count'];var _0x381bdb=_0x37df42?0x0:_0x35bcff[_0x19be('0x20')];var _0x2d463d=_0x37df42?_0x571354['count']:_0x35bcff[_0x19be('0x20')]+_0x35bcff[_0x19be('0x1f')];var _0x28a61f;if(_0x2d463d>=_0x4ca9dc){_0x2d463d=_0x4ca9dc;_0x28a61f=0xc8;}else{_0x28a61f=0xce;}_0x26a629[_0x19be('0x1b')](_0x28a61f);return _0x26a629[_0x19be('0x21')](_0x19be('0x22'),_0x381bdb+'-'+_0x2d463d+'/'+_0x4ca9dc)[_0x19be('0x1d')](_0x571354);}return null;};}function patchUpdates(_0x48806f){return function(_0x5d32f3){try{jsonpatch[_0x19be('0x23')](_0x5d32f3,_0x48806f,!![]);}catch(_0x328e9b){return BPromise[_0x19be('0x24')](_0x328e9b);}return _0x5d32f3[_0x19be('0x25')]();};}function saveUpdates(_0x43b5a9,_0x4bca6a){return function(_0x678fee){if(_0x678fee){return _0x678fee[_0x19be('0x26')](_0x43b5a9)[_0x19be('0x27')](function(_0x444435){return _0x444435;});}return null;};}function removeEntity(_0x563197,_0x2c24df){return function(_0x5b6f8e){if(_0x5b6f8e){return _0x5b6f8e[_0x19be('0x28')]()[_0x19be('0x27')](function(){_0x563197['status'](0xcc)[_0x19be('0x1c')]();});}};}function handleEntityNotFound(_0x5ae9ed,_0xadfed8){return function(_0x43c198){if(!_0x43c198){_0x5ae9ed[_0x19be('0x1a')](0x194);}return _0x43c198;};}function handleError(_0x2e8e19,_0x4389d4){_0x4389d4=_0x4389d4||0x1f4;return function(_0x2091dd){logger[_0x19be('0x29')](_0x2091dd[_0x19be('0x2a')]);if(_0x2091dd['name']){delete _0x2091dd['name'];}_0x2e8e19[_0x19be('0x1b')](_0x4389d4)[_0x19be('0x2b')](_0x2091dd);};}exports[_0x19be('0x2c')]=function(_0x49e2d9,_0x383478){var _0x5327c2={},_0x38e8fe={},_0x316651={'count':0x0,'rows':[]};var _0x11ca07=_[_0x19be('0x2d')](db['SalesforceAccount'][_0x19be('0x2e')],function(_0xf22362){return{'name':_0xf22362[_0x19be('0x2f')],'type':_0xf22362[_0x19be('0x30')][_0x19be('0x31')]};});_0x38e8fe[_0x19be('0x32')]=_[_0x19be('0x2d')](_0x11ca07,_0x19be('0x33'));_0x38e8fe['query']=_[_0x19be('0x34')](_0x49e2d9[_0x19be('0x35')]);_0x38e8fe[_0x19be('0x36')]=_[_0x19be('0x37')](_0x38e8fe[_0x19be('0x32')],_0x38e8fe[_0x19be('0x35')]);_0x5327c2[_0x19be('0x38')]=_['intersection'](_0x38e8fe[_0x19be('0x32')],qs[_0x19be('0x39')](_0x49e2d9[_0x19be('0x35')][_0x19be('0x39')]));_0x5327c2['attributes']=_0x5327c2['attributes']['length']?_0x5327c2[_0x19be('0x38')]:_0x38e8fe[_0x19be('0x32')];if(!_0x49e2d9[_0x19be('0x35')]['hasOwnProperty'](_0x19be('0x3a'))){_0x5327c2[_0x19be('0x1f')]=qs['limit'](_0x49e2d9[_0x19be('0x35')]['limit']);_0x5327c2[_0x19be('0x20')]=qs[_0x19be('0x20')](_0x49e2d9[_0x19be('0x35')][_0x19be('0x20')]);}_0x5327c2[_0x19be('0x3b')]=qs['sort'](_0x49e2d9[_0x19be('0x35')][_0x19be('0x3c')]);_0x5327c2[_0x19be('0x3d')]=qs[_0x19be('0x36')](_['pick'](_0x49e2d9[_0x19be('0x35')],_0x38e8fe[_0x19be('0x36')]),_0x11ca07);if(_0x49e2d9[_0x19be('0x35')][_0x19be('0x3e')]){_0x5327c2[_0x19be('0x3d')]=_[_0x19be('0x3f')](_0x5327c2['where'],{'$or':_[_0x19be('0x2d')](_0x11ca07,function(_0x12e542){if(_0x12e542['type']!==_0x19be('0x40')){var _0x5a9090={};_0x5a9090[_0x12e542[_0x19be('0x33')]]={'$like':'%'+_0x49e2d9[_0x19be('0x35')][_0x19be('0x3e')]+'%'};return _0x5a9090;}})});}_0x5327c2=_[_0x19be('0x3f')]({},_0x5327c2,_0x49e2d9[_0x19be('0x41')]);var _0x1b3ab9={'where':_0x5327c2['where']};return db['SalesforceAccount'][_0x19be('0x42')](_0x1b3ab9)[_0x19be('0x27')](function(_0x21b413){_0x316651['count']=_0x21b413;if(_0x49e2d9[_0x19be('0x35')]['includeAll']){_0x5327c2[_0x19be('0x43')]=[{'all':!![]}];}return db[_0x19be('0x44')]['findAll'](_0x5327c2);})['then'](function(_0x4981c8){_0x316651[_0x19be('0x45')]=_0x4981c8;return _0x316651;})['then'](respondWithFilteredResult(_0x383478,_0x5327c2))[_0x19be('0x46')](handleError(_0x383478,null));};exports['show']=function(_0x4d9a4b,_0xb917dc){var _0x48a1f0={'raw':![],'where':{'id':_0x4d9a4b[_0x19be('0x47')]['id']}},_0x43c6f5={};_0x43c6f5[_0x19be('0x32')]=_[_0x19be('0x34')](db['SalesforceAccount'][_0x19be('0x2e')]);_0x43c6f5['query']=_[_0x19be('0x34')](_0x4d9a4b['query']);_0x43c6f5[_0x19be('0x36')]=_['intersection'](_0x43c6f5[_0x19be('0x32')],_0x43c6f5[_0x19be('0x35')]);_0x48a1f0[_0x19be('0x38')]=_['intersection'](_0x43c6f5['model'],qs[_0x19be('0x39')](_0x4d9a4b['query']['fields']));_0x48a1f0[_0x19be('0x38')]=_0x48a1f0[_0x19be('0x38')]['length']?_0x48a1f0[_0x19be('0x38')]:_0x43c6f5[_0x19be('0x32')];if(_0x4d9a4b['query']['includeAll']){_0x48a1f0[_0x19be('0x43')]=[{'all':!![]}];}_0x48a1f0=_[_0x19be('0x3f')]({},_0x48a1f0,_0x4d9a4b['options']);return db[_0x19be('0x44')]['find'](_0x48a1f0)[_0x19be('0x27')](handleEntityNotFound(_0xb917dc,null))[_0x19be('0x27')](respondWithResult(_0xb917dc,null))[_0x19be('0x46')](handleError(_0xb917dc,null));};exports[_0x19be('0x48')]=function(_0x487dbf,_0x14ff91){return db[_0x19be('0x44')]['create'](_0x487dbf[_0x19be('0x49')],{})[_0x19be('0x27')](respondWithResult(_0x14ff91,0xc9))['catch'](handleError(_0x14ff91,null));};exports['update']=function(_0x514a0a,_0x288a17){if(_0x514a0a[_0x19be('0x49')]['id']){delete _0x514a0a[_0x19be('0x49')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x514a0a[_0x19be('0x47')]['id']}})['then'](handleEntityNotFound(_0x288a17,null))['then'](saveUpdates(_0x514a0a[_0x19be('0x49')],null))[_0x19be('0x27')](respondWithResult(_0x288a17,null))[_0x19be('0x46')](handleError(_0x288a17,null));};exports[_0x19be('0x28')]=function(_0x5b0db7,_0x2e5a0d){return db['SalesforceAccount'][_0x19be('0x4a')]({'where':{'id':_0x5b0db7[_0x19be('0x47')]['id']}})[_0x19be('0x27')](handleEntityNotFound(_0x2e5a0d,null))['then'](removeEntity(_0x2e5a0d,null))[_0x19be('0x46')](handleError(_0x2e5a0d,null));};exports['getConfigurations']=function(_0x4fe6dd,_0x59d1ba,_0x2bc209){var _0x226635={};var _0x510f17={};var _0xdf42f4;var _0x211d79;return db[_0x19be('0x44')][_0x19be('0x4b')]({'where':{'id':_0x4fe6dd['params']['id']}})['then'](handleEntityNotFound(_0x59d1ba,null))[_0x19be('0x27')](function(_0x5ad9f9){if(_0x5ad9f9){_0xdf42f4=_0x5ad9f9;_0x510f17[_0x19be('0x32')]=_[_0x19be('0x34')](db[_0x19be('0x4c')][_0x19be('0x2e')]);_0x510f17[_0x19be('0x35')]=_[_0x19be('0x34')](_0x4fe6dd[_0x19be('0x35')]);_0x510f17[_0x19be('0x36')]=_[_0x19be('0x37')](_0x510f17[_0x19be('0x32')],_0x510f17[_0x19be('0x35')]);_0x226635['attributes']=_[_0x19be('0x37')](_0x510f17[_0x19be('0x32')],qs[_0x19be('0x39')](_0x4fe6dd[_0x19be('0x35')]['fields']));_0x226635[_0x19be('0x38')]=_0x226635[_0x19be('0x38')][_0x19be('0x4d')]?_0x226635[_0x19be('0x38')]:_0x510f17[_0x19be('0x32')];_0x226635[_0x19be('0x3b')]=qs[_0x19be('0x3c')](_0x4fe6dd[_0x19be('0x35')]['sort']);_0x226635[_0x19be('0x3d')]=qs[_0x19be('0x36')](_['pick'](_0x4fe6dd[_0x19be('0x35')],_0x510f17['filters']));if(_0x4fe6dd['query'][_0x19be('0x3e')]){_0x226635['where']=_[_0x19be('0x3f')](_0x226635[_0x19be('0x3d')],{'$or':_[_0x19be('0x2d')](_0x226635['attributes'],function(_0xcc68c5){var _0x5582ab={};_0x5582ab[_0xcc68c5]={'$like':'%'+_0x4fe6dd[_0x19be('0x35')][_0x19be('0x3e')]+'%'};return _0x5582ab;})});}_0x226635=_[_0x19be('0x3f')]({},_0x226635,_0x4fe6dd['options']);return _0xdf42f4[_0x19be('0x4e')](_0x226635);}})[_0x19be('0x27')](function(_0x50d034){if(_0x50d034){_0x211d79=_0x50d034[_0x19be('0x4d')];if(!_0x4fe6dd['query'][_0x19be('0x4f')]('nolimit')){_0x226635[_0x19be('0x1f')]=qs[_0x19be('0x1f')](_0x4fe6dd[_0x19be('0x35')]['limit']);_0x226635[_0x19be('0x20')]=qs[_0x19be('0x20')](_0x4fe6dd['query'][_0x19be('0x20')]);}return _0xdf42f4[_0x19be('0x4e')](_0x226635);}})[_0x19be('0x27')](function(_0x66cea6){if(_0x66cea6){return _0x66cea6?{'count':_0x211d79,'rows':_0x66cea6}:null;}})['then'](respondWithResult(_0x59d1ba,null))[_0x19be('0x46')](handleError(_0x59d1ba,null));};exports['addConfiguration']=function(_0x20e0d9,_0x2cdd3d,_0x3c3702){if(_0x20e0d9[_0x19be('0x49')]['id']){delete _0x20e0d9[_0x19be('0x49')]['id'];}return db['SalesforceAccount'][_0x19be('0x4b')]({'where':{'id':_0x20e0d9[_0x19be('0x47')]['id']}})[_0x19be('0x27')](handleEntityNotFound(_0x2cdd3d,null))['then'](function(_0x191377){if(_0x191377){_0x20e0d9[_0x19be('0x49')][_0x19be('0x50')]=_0x191377['id'];_0x20e0d9['body']['Subjects']=integrations[_0x19be('0x51')](_0x20e0d9[_0x19be('0x49')][_0x19be('0x52')],_0x20e0d9[_0x19be('0x49')][_0x19be('0x30')]);_0x20e0d9[_0x19be('0x49')][_0x19be('0x53')]=integrations['getDescriptions'](_0x20e0d9['body']['channel'],_0x20e0d9[_0x19be('0x49')][_0x19be('0x30')]);return db[_0x19be('0x4c')][_0x19be('0x48')](_0x20e0d9[_0x19be('0x49')],{'include':[{'model':db[_0x19be('0x54')],'as':_0x19be('0x55')},{'model':db[_0x19be('0x54')],'as':_0x19be('0x53')}]});}return null;})[_0x19be('0x27')](respondWithResult(_0x2cdd3d,null))[_0x19be('0x46')](handleError(_0x2cdd3d,null));};exports[_0x19be('0x56')]=function(_0x29714b,_0x4c2b77,_0x1c6c7e){var _0x3a553d;var _0x14c92a='';var _0x471311='Task';return db['SalesforceAccount'][_0x19be('0x4b')]({'where':{'id':_0x29714b['params']['id']},'attributes':['id',_0x19be('0x57'),'clientId',_0x19be('0x58'),_0x19be('0x59'),_0x19be('0x5a'),_0x19be('0x5b')]})['then'](handleEntityNotFound(_0x4c2b77,null))[_0x19be('0x27')](function(_0x83904c){if(_0x83904c){_0x14c92a=_0x83904c['remoteUri'];var _0x3aa751=_0x14c92a[_0x19be('0x5c')](-0x1);if(_0x3aa751==='/'){_0x14c92a=_0x14c92a[_0x19be('0x5d')](0x0,_0x14c92a[_0x19be('0x5e')](_0x3aa751));}_0x3a553d=new jsforce[(_0x19be('0x5f'))]({'oauth2':{'loginUrl':_0x14c92a,'clientId':_0x83904c[_0x19be('0x60')],'clientSecret':_0x83904c[_0x19be('0x58')]}});return _0x3a553d['login'](_0x83904c[_0x19be('0x59')],_0x83904c[_0x19be('0x5a')][_0x19be('0x61')](_0x83904c[_0x19be('0x5b')]));}})[_0x19be('0x27')](function(_0x43d374){if(_0x43d374){if(!_[_0x19be('0x62')](_0x29714b[_0x19be('0x35')][_0x19be('0x63')])){_0x471311=_0x29714b['query'][_0x19be('0x63')];}return _0x3a553d[_0x19be('0x64')](_0x471311)[_0x19be('0x65')]();}})[_0x19be('0x27')](function(_0x4a3f36){var _0x42d326=['OwnerId','ActivityDate',_0x19be('0x66'),_0x19be('0x67'),_0x19be('0x68'),_0x19be('0x69')];var _0x1b79e0=[_0x19be('0x6a'),_0x19be('0x6b'),_0x19be('0x6c'),_0x19be('0x6d'),_0x19be('0x6e'),_0x19be('0x6f'),_0x19be('0x70')];if(_0x4a3f36){_['remove'](_0x4a3f36[_0x19be('0x39')],function(_0x142c64){return _0x42d326['includes'](_0x142c64[_0x19be('0x33')])||!_0x1b79e0[_0x19be('0x71')](_0x142c64[_0x19be('0x30')]);});return{'count':_0x4a3f36['fields']['length'],'rows':_[_0x19be('0x2d')](_0x4a3f36[_0x19be('0x39')],function(_0x32796a){return{'id':_0x32796a[_0x19be('0x33')],'name':_0x32796a[_0x19be('0x72')],'custom':_0x32796a[_0x19be('0x73')],'options':_0x32796a[_0x19be('0x74')]['length']>0x0?_[_0x19be('0x2d')](_0x32796a[_0x19be('0x74')],function(_0x476631){return{'name':_0x476631[_0x19be('0x72')],'value':_0x476631['value']};}):_0x32796a['type']=='boolean'?[{'name':'True','value':'true'},{'name':'False','value':_0x19be('0x75')}]:[]};})};}})[_0x19be('0x27')](respondWithResult(_0x4c2b77,null))[_0x19be('0x46')](function(_0x34fa3d){var _0x798e39=_0x29714b[_0x19be('0x35')][_0x19be('0x76')]?0x1f4:_0x34fa3d[_0x19be('0x77')]||0x1f4;logger['error'](_0x19be('0x78'),'getFields',_0x798e39,JSON['stringify'](_0x34fa3d));delete _0x34fa3d[_0x19be('0x33')];if(_0x798e39===0x191){_0x798e39=0x190;}_0x4c2b77['status'](_0x798e39)[_0x19be('0x2b')](_0x29714b['query'][_0x19be('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x34fa3d[_0x19be('0x77')]}:_0x34fa3d);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 27c5d4a..b3cc494 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 _0x11cd=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts'];(function(_0xfbd45c,_0x52c611){var _0x432e51=function(_0x125f9c){while(--_0x125f9c){_0xfbd45c['push'](_0xfbd45c['shift']());}};_0x432e51(++_0x52c611);}(_0x11cd,0x1c0));var _0xd11c=function(_0x48f151,_0x1e4161){_0x48f151=_0x48f151-0x0;var _0x362072=_0x11cd[_0x48f151];return _0x362072;};'use strict';var _=require(_0xd11c('0x0'));var util=require(_0xd11c('0x1'));var logger=require(_0xd11c('0x2'))(_0xd11c('0x3'));var moment=require(_0xd11c('0x4'));var BPromise=require('bluebird');var rp=require(_0xd11c('0x5'));var fs=require('fs');var path=require(_0xd11c('0x6'));var rimraf=require(_0xd11c('0x7'));var config=require(_0xd11c('0x8'));var attributes=require(_0xd11c('0x9'));var integrations=require(_0xd11c('0xa'));module['exports']=function(_0x795b6f,_0xb8e9a7){return _0x795b6f[_0xd11c('0xb')](_0xd11c('0xc'),attributes,{'tableName':_0xd11c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffdc=['moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xffdc,0x7f));var _0xcffd=function(_0x573c19,_0x5525bd){_0x573c19=_0x573c19-0x0;var _0x26df1d=_0xffdc[_0x573c19];return _0x26df1d;};'use strict';var _=require(_0xcffd('0x0'));var util=require(_0xcffd('0x1'));var logger=require('../../config/logger')(_0xcffd('0x2'));var moment=require(_0xcffd('0x3'));var BPromise=require('bluebird');var rp=require(_0xcffd('0x4'));var fs=require('fs');var path=require(_0xcffd('0x5'));var rimraf=require(_0xcffd('0x6'));var config=require(_0xcffd('0x7'));var attributes=require(_0xcffd('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xcffd('0x9')]=function(_0x963fad,_0x12e830){return _0x963fad[_0xcffd('0xa')](_0xcffd('0xb'),attributes,{'tableName':_0xcffd('0xc'),'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 0fe391f..4f4c0ab 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 _0xa467=['where','attributes','limit','map','include','model','debug','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0xa467,0x143));var _0x7a46=function(_0x2e2824,_0x49905b){_0x2e2824=_0x2e2824-0x0;var _0x21549c=_0xa467[_0x2e2824];return _0x21549c;};'use strict';var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var moment=require(_0x7a46('0x2'));var BPromise=require(_0x7a46('0x3'));var rs=require(_0x7a46('0x4'));var fs=require('fs');var Redis=require(_0x7a46('0x5'));var db=require(_0x7a46('0x6'))['db'];var utils=require(_0x7a46('0x7'));var logger=require(_0x7a46('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7a46('0x9'));var client=jayson[_0x7a46('0xa')][_0x7a46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x463cdf,_0x6d8fce,_0x550c38){return new BPromise(function(_0x341d9e,_0x1f8b07){return client[_0x7a46('0xc')](_0x463cdf,_0x550c38)[_0x7a46('0xd')](function(_0x382b56){logger[_0x7a46('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x6d8fce,_0x7a46('0xf'));logger['debug'](_0x7a46('0x10'),_0x6d8fce,'request\x20sent',JSON[_0x7a46('0x11')](_0x382b56));if(_0x382b56[_0x7a46('0x12')]){if(_0x382b56[_0x7a46('0x12')][_0x7a46('0x13')]===0x1f4){logger[_0x7a46('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x6d8fce,_0x382b56[_0x7a46('0x12')][_0x7a46('0x14')]);return _0x1f8b07(_0x382b56[_0x7a46('0x12')][_0x7a46('0x14')]);}logger[_0x7a46('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x6d8fce,_0x382b56[_0x7a46('0x12')]['message']);return _0x341d9e(_0x382b56['error'][_0x7a46('0x14')]);}else{logger[_0x7a46('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x6d8fce,_0x7a46('0xf'));_0x341d9e(_0x382b56['result'][_0x7a46('0x14')]);}})[_0x7a46('0x15')](function(_0x50e40e){logger[_0x7a46('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x6d8fce,_0x50e40e);_0x1f8b07(_0x50e40e);});});}exports[_0x7a46('0x16')]=function(_0x3aa0ad){var _0x3cdc54=this;return new Promise(function(_0x279fc8,_0x5eace2){return db[_0x7a46('0x17')][_0x7a46('0x18')]({'raw':_0x3aa0ad['options']?_0x3aa0ad[_0x7a46('0x19')][_0x7a46('0x1a')]===undefined?!![]:![]:!![],'where':_0x3aa0ad['options']?_0x3aa0ad['options'][_0x7a46('0x1b')]||null:null,'attributes':_0x3aa0ad[_0x7a46('0x19')]?_0x3aa0ad[_0x7a46('0x19')][_0x7a46('0x1c')]||null:null,'limit':_0x3aa0ad['options']?_0x3aa0ad[_0x7a46('0x19')][_0x7a46('0x1d')]||null:null,'include':_0x3aa0ad['options']?_0x3aa0ad['options']['include']?_[_0x7a46('0x1e')](_0x3aa0ad[_0x7a46('0x19')]['include'],function(_0x46512d){return{'model':db[_0x46512d['model']],'as':_0x46512d['as'],'attributes':_0x46512d[_0x7a46('0x1c')],'include':_0x46512d[_0x7a46('0x1f')]?_['map'](_0x46512d[_0x7a46('0x1f')],function(_0x1222ae){return{'model':db[_0x1222ae[_0x7a46('0x20')]],'as':_0x1222ae['as'],'attributes':_0x1222ae[_0x7a46('0x1c')],'include':_0x1222ae[_0x7a46('0x1f')]?_[_0x7a46('0x1e')](_0x1222ae[_0x7a46('0x1f')],function(_0x595c66){return{'model':db[_0x595c66[_0x7a46('0x20')]],'as':_0x595c66['as'],'attributes':_0x595c66[_0x7a46('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7a46('0xd')](function(_0xa81c32){logger[_0x7a46('0xe')](_0x7a46('0x16'),_0x3aa0ad);logger[_0x7a46('0x21')]('GetSalesforceAccount',_0x3aa0ad,JSON[_0x7a46('0x11')](_0xa81c32));_0x279fc8(_0xa81c32);})[_0x7a46('0x15')](function(_0x3b35dd){logger[_0x7a46('0x12')](_0x7a46('0x16'),_0x3b35dd['message'],_0x3aa0ad);_0x5eace2(_0x3cdc54[_0x7a46('0x12')](0x1f4,_0x3b35dd['message']));});});};exports['ShowSalesforceAccount']=function(_0x29ac6a){var _0x477aa1=this;return new Promise(function(_0x273cec,_0x3c7016){return db[_0x7a46('0x17')]['find']({'raw':_0x29ac6a['options']?_0x29ac6a[_0x7a46('0x19')][_0x7a46('0x1a')]===undefined?!![]:![]:!![],'where':_0x29ac6a[_0x7a46('0x19')]?_0x29ac6a['options'][_0x7a46('0x1b')]||null:null,'attributes':_0x29ac6a[_0x7a46('0x19')]?_0x29ac6a[_0x7a46('0x19')][_0x7a46('0x1c')]||null:null,'include':_0x29ac6a[_0x7a46('0x19')]?_0x29ac6a[_0x7a46('0x19')][_0x7a46('0x1f')]?_[_0x7a46('0x1e')](_0x29ac6a[_0x7a46('0x19')][_0x7a46('0x1f')],function(_0x10a1f4){return{'model':db[_0x10a1f4[_0x7a46('0x20')]],'as':_0x10a1f4['as'],'attributes':_0x10a1f4[_0x7a46('0x1c')],'include':_0x10a1f4[_0x7a46('0x1f')]?_[_0x7a46('0x1e')](_0x10a1f4[_0x7a46('0x1f')],function(_0x4d86f7){return{'model':db[_0x4d86f7['model']],'as':_0x4d86f7['as'],'attributes':_0x4d86f7[_0x7a46('0x1c')],'include':_0x4d86f7[_0x7a46('0x1f')]?_[_0x7a46('0x1e')](_0x4d86f7[_0x7a46('0x1f')],function(_0x4a6ffd){return{'model':db[_0x4a6ffd[_0x7a46('0x20')]],'as':_0x4a6ffd['as'],'attributes':_0x4a6ffd[_0x7a46('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15ca0f){logger[_0x7a46('0xe')](_0x7a46('0x22'),_0x29ac6a);logger['debug']('ShowSalesforceAccount',_0x29ac6a,JSON[_0x7a46('0x11')](_0x15ca0f));_0x273cec(_0x15ca0f);})[_0x7a46('0x15')](function(_0x115cb3){logger[_0x7a46('0x12')](_0x7a46('0x22'),_0x115cb3[_0x7a46('0x14')],_0x29ac6a);_0x3c7016(_0x477aa1[_0x7a46('0x12')](0x1f4,_0x115cb3['message']));});});}; \ No newline at end of file +var _0x8069=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','limit','include','map','model','stringify','catch','ShowSalesforceAccount','find','raw','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x105b1a,_0x52d2de){var _0x5c95a0=function(_0x3ec868){while(--_0x3ec868){_0x105b1a['push'](_0x105b1a['shift']());}};_0x5c95a0(++_0x52d2de);}(_0x8069,0x67));var _0x9806=function(_0x38db8c,_0x4ca28a){_0x38db8c=_0x38db8c-0x0;var _0x1a6043=_0x8069[_0x38db8c];return _0x1a6043;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9806('0x0'));var BPromise=require(_0x9806('0x1'));var rs=require(_0x9806('0x2'));var fs=require('fs');var Redis=require(_0x9806('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9806('0x4'));var logger=require(_0x9806('0x5'))(_0x9806('0x6'));var config=require(_0x9806('0x7'));var jayson=require(_0x9806('0x8'));var client=jayson[_0x9806('0x9')][_0x9806('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bf866,_0x559c92,_0x3ee78c){return new BPromise(function(_0x238cc2,_0x2d111e){return client['request'](_0x5bf866,_0x3ee78c)[_0x9806('0xb')](function(_0x408b4a){logger[_0x9806('0xc')](_0x9806('0xd'),_0x559c92,_0x9806('0xe'));logger[_0x9806('0xf')](_0x9806('0x10'),_0x559c92,_0x9806('0xe'),JSON['stringify'](_0x408b4a));if(_0x408b4a['error']){if(_0x408b4a['error'][_0x9806('0x11')]===0x1f4){logger[_0x9806('0x12')](_0x9806('0xd'),_0x559c92,_0x408b4a[_0x9806('0x12')][_0x9806('0x13')]);return _0x2d111e(_0x408b4a[_0x9806('0x12')][_0x9806('0x13')]);}logger[_0x9806('0x12')](_0x9806('0xd'),_0x559c92,_0x408b4a[_0x9806('0x12')]['message']);return _0x238cc2(_0x408b4a[_0x9806('0x12')]['message']);}else{logger[_0x9806('0xc')](_0x9806('0xd'),_0x559c92,_0x9806('0xe'));_0x238cc2(_0x408b4a[_0x9806('0x14')][_0x9806('0x13')]);}})['catch'](function(_0x251499){logger[_0x9806('0x12')](_0x9806('0xd'),_0x559c92,_0x251499);_0x2d111e(_0x251499);});});}exports[_0x9806('0x15')]=function(_0x4cdbc2){var _0x16e63a=this;return new Promise(function(_0x2da1c5,_0x50e564){return db[_0x9806('0x16')][_0x9806('0x17')]({'raw':_0x4cdbc2['options']?_0x4cdbc2[_0x9806('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4cdbc2['options']?_0x4cdbc2[_0x9806('0x18')][_0x9806('0x19')]||null:null,'attributes':_0x4cdbc2[_0x9806('0x18')]?_0x4cdbc2[_0x9806('0x18')][_0x9806('0x1a')]||null:null,'limit':_0x4cdbc2[_0x9806('0x18')]?_0x4cdbc2[_0x9806('0x18')][_0x9806('0x1b')]||null:null,'include':_0x4cdbc2[_0x9806('0x18')]?_0x4cdbc2[_0x9806('0x18')][_0x9806('0x1c')]?_[_0x9806('0x1d')](_0x4cdbc2['options'][_0x9806('0x1c')],function(_0x2fa55b){return{'model':db[_0x2fa55b[_0x9806('0x1e')]],'as':_0x2fa55b['as'],'attributes':_0x2fa55b['attributes'],'include':_0x2fa55b['include']?_[_0x9806('0x1d')](_0x2fa55b['include'],function(_0x515911){return{'model':db[_0x515911['model']],'as':_0x515911['as'],'attributes':_0x515911[_0x9806('0x1a')],'include':_0x515911['include']?_[_0x9806('0x1d')](_0x515911[_0x9806('0x1c')],function(_0x22b362){return{'model':db[_0x22b362[_0x9806('0x1e')]],'as':_0x22b362['as'],'attributes':_0x22b362['attributes']};}):[]};}):[]};}):[]:[]})[_0x9806('0xb')](function(_0x2c0564){logger[_0x9806('0xc')](_0x9806('0x15'),_0x4cdbc2);logger[_0x9806('0xf')]('GetSalesforceAccount',_0x4cdbc2,JSON[_0x9806('0x1f')](_0x2c0564));_0x2da1c5(_0x2c0564);})[_0x9806('0x20')](function(_0xf9f682){logger[_0x9806('0x12')](_0x9806('0x15'),_0xf9f682[_0x9806('0x13')],_0x4cdbc2);_0x50e564(_0x16e63a[_0x9806('0x12')](0x1f4,_0xf9f682['message']));});});};exports[_0x9806('0x21')]=function(_0x30c2eb){var _0x1a98a5=this;return new Promise(function(_0x46c2eb,_0x2993f1){return db[_0x9806('0x16')][_0x9806('0x22')]({'raw':_0x30c2eb[_0x9806('0x18')]?_0x30c2eb[_0x9806('0x18')][_0x9806('0x23')]===undefined?!![]:![]:!![],'where':_0x30c2eb[_0x9806('0x18')]?_0x30c2eb[_0x9806('0x18')][_0x9806('0x19')]||null:null,'attributes':_0x30c2eb[_0x9806('0x18')]?_0x30c2eb['options'][_0x9806('0x1a')]||null:null,'include':_0x30c2eb['options']?_0x30c2eb[_0x9806('0x18')][_0x9806('0x1c')]?_[_0x9806('0x1d')](_0x30c2eb['options']['include'],function(_0x1267f6){return{'model':db[_0x1267f6[_0x9806('0x1e')]],'as':_0x1267f6['as'],'attributes':_0x1267f6['attributes'],'include':_0x1267f6['include']?_[_0x9806('0x1d')](_0x1267f6['include'],function(_0x586252){return{'model':db[_0x586252[_0x9806('0x1e')]],'as':_0x586252['as'],'attributes':_0x586252['attributes'],'include':_0x586252[_0x9806('0x1c')]?_[_0x9806('0x1d')](_0x586252[_0x9806('0x1c')],function(_0x4e3265){return{'model':db[_0x4e3265[_0x9806('0x1e')]],'as':_0x4e3265['as'],'attributes':_0x4e3265[_0x9806('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9806('0xb')](function(_0x2382c8){logger['info'](_0x9806('0x21'),_0x30c2eb);logger[_0x9806('0xf')](_0x9806('0x21'),_0x30c2eb,JSON['stringify'](_0x2382c8));_0x46c2eb(_0x2382c8);})['catch'](function(_0x38a986){logger[_0x9806('0x12')](_0x9806('0x21'),_0x38a986[_0x9806('0x13')],_0x30c2eb);_0x2993f1(_0x1a98a5[_0x9806('0x12')](0x1f4,_0x38a986[_0x9806('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 588b5ac..a994713 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 _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x1710f2,_0x341159){var _0x355f2d=function(_0x4ab2e9){while(--_0x4ab2e9){_0x1710f2['push'](_0x1710f2['shift']());}};_0x355f2d(++_0x341159);}(_0x2ef3,0xba));var _0x32ef=function(_0x4cd027,_0x326ef5){_0x4cd027=_0x4cd027-0x0;var _0x55b2da=_0x2ef3[_0x4cd027];return _0x55b2da;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x2033eb,_0x43529c){var _0x130b6d=function(_0xff5e1d){while(--_0xff5e1d){_0x2033eb['push'](_0x2033eb['shift']());}};_0x130b6d(++_0x43529c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'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('./intSalesforceConfiguration.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['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 8da6042..81b8085 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 _0x224f=['lead','account_contact_lead','account','nothing','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x44ac1e,_0x2fb2be){var _0x37c9db=function(_0x43226b){while(--_0x43226b){_0x44ac1e['push'](_0x44ac1e['shift']());}};_0x37c9db(++_0x2fb2be);}(_0x224f,0x1a6));var _0xf224=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0x224f[_0x4191bc];return _0x1ffd4e;};'use strict';var Sequelize=require('sequelize');module[_0xf224('0x0')]={'name':{'type':Sequelize[_0xf224('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xf224('0x2')](_0xf224('0x3'),_0xf224('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xf224('0x2')](_0xf224('0x5'),_0xf224('0x6'),_0xf224('0x7'),_0xf224('0x8'),_0xf224('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xf224('0x2')](_0xf224('0xa'),_0xf224('0x6'),_0xf224('0x7'),_0xf224('0x9')),'defaultValue':_0xf224('0x7')},'leadId':{'type':Sequelize[_0xf224('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xf224('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xf224('0x1')]}}; \ No newline at end of file +var _0x3bb4=['sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact','lead'];(function(_0x366f2e,_0x6bff89){var _0x5059fe=function(_0x49d81e){while(--_0x49d81e){_0x366f2e['push'](_0x366f2e['shift']());}};_0x5059fe(++_0x6bff89);}(_0x3bb4,0x87));var _0x43bb=function(_0x56eb89,_0xa70f63){_0x56eb89=_0x56eb89-0x0;var _0x237f9d=_0x3bb4[_0x56eb89];return _0x237f9d;};'use strict';var Sequelize=require(_0x43bb('0x0'));module[_0x43bb('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x43bb('0x2')]},'ticketType':{'type':Sequelize[_0x43bb('0x3')]('Task',_0x43bb('0x4')),'defaultValue':_0x43bb('0x5')},'moduleSearch':{'type':Sequelize[_0x43bb('0x3')](_0x43bb('0x6'),_0x43bb('0x7'),_0x43bb('0x8'),'account_contact_lead','account'),'defaultValue':_0x43bb('0x6')},'moduleCreate':{'type':Sequelize[_0x43bb('0x3')]('nothing',_0x43bb('0x7'),'lead','account'),'defaultValue':_0x43bb('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x43bb('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x43bb('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x43bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 50b3ca8..c13d1e6 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 _0x41f2=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','include','findAll','show','length','includeAll','find','create','body','catch','destroy','params','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x38ec31,_0x5a9ead){var _0x274821=function(_0x5a0fe5){while(--_0x5a0fe5){_0x38ec31['push'](_0x38ec31['shift']());}};_0x274821(++_0x5a9ead);}(_0x41f2,0x14f));var _0x241f=function(_0x4c7e4,_0x30ab4d){_0x4c7e4=_0x4c7e4-0x0;var _0xd8677=_0x41f2[_0x4c7e4];return _0xd8677;};'use strict';var emlformat=require(_0x241f('0x0'));var rimraf=require(_0x241f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x241f('0x2'));var rp=require(_0x241f('0x3'));var moment=require(_0x241f('0x4'));var BPromise=require(_0x241f('0x5'));var Mustache=require('mustache');var util=require(_0x241f('0x6'));var path=require(_0x241f('0x7'));var sox=require('sox');var csv=require(_0x241f('0x8'));var ejs=require(_0x241f('0x9'));var fs=require('fs');var fs_extra=require(_0x241f('0xa'));var _=require(_0x241f('0xb'));var squel=require(_0x241f('0xc'));var crypto=require('crypto');var jsforce=require(_0x241f('0xd'));var deskjs=require(_0x241f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x241f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x241f('0x10'));var as=require(_0x241f('0x11'));var hardwareService=require(_0x241f('0x12'));var logger=require('../../config/logger')(_0x241f('0x13'));var utils=require('../../config/utils');var config=require(_0x241f('0x14'));var licenseUtil=require(_0x241f('0x15'));var db=require(_0x241f('0x16'))['db'];function respondWithStatusCode(_0x5df4ed,_0x35429f){_0x35429f=_0x35429f||0xcc;return function(_0x3c3302){if(_0x3c3302){return _0x5df4ed[_0x241f('0x17')](_0x35429f);}return _0x5df4ed[_0x241f('0x18')](_0x35429f)['end']();};}function respondWithResult(_0x144877,_0x4e8be7){_0x4e8be7=_0x4e8be7||0xc8;return function(_0x313e95){if(_0x313e95){return _0x144877[_0x241f('0x18')](_0x4e8be7)['json'](_0x313e95);}};}function respondWithFilteredResult(_0x471165,_0x34ee2a){return function(_0x432fc2){if(_0x432fc2){var _0x436856=typeof _0x34ee2a['offset']===_0x241f('0x19')&&typeof _0x34ee2a[_0x241f('0x1a')]==='undefined';var _0x24f4b0=_0x432fc2['count'];var _0x32f7b9=_0x436856?0x0:_0x34ee2a[_0x241f('0x1b')];var _0x55e0d0=_0x436856?_0x432fc2[_0x241f('0x1c')]:_0x34ee2a[_0x241f('0x1b')]+_0x34ee2a['limit'];var _0x4e2d93;if(_0x55e0d0>=_0x24f4b0){_0x55e0d0=_0x24f4b0;_0x4e2d93=0xc8;}else{_0x4e2d93=0xce;}_0x471165[_0x241f('0x18')](_0x4e2d93);return _0x471165['set'](_0x241f('0x1d'),_0x32f7b9+'-'+_0x55e0d0+'/'+_0x24f4b0)['json'](_0x432fc2);}return null;};}function patchUpdates(_0x5eaab7){return function(_0x499440){try{jsonpatch[_0x241f('0x1e')](_0x499440,_0x5eaab7,!![]);}catch(_0x5cfd64){return BPromise[_0x241f('0x1f')](_0x5cfd64);}return _0x499440[_0x241f('0x20')]();};}function saveUpdates(_0x34a174,_0x43b477){return function(_0x3d5eaa){if(_0x3d5eaa){return _0x3d5eaa[_0x241f('0x21')](_0x34a174)[_0x241f('0x22')](function(_0x5d8446){return _0x5d8446;});}return null;};}function removeEntity(_0x404ca9,_0x1b7a9c){return function(_0x2c1c84){if(_0x2c1c84){return _0x2c1c84['destroy']()[_0x241f('0x22')](function(){_0x404ca9[_0x241f('0x18')](0xcc)[_0x241f('0x23')]();});}};}function handleEntityNotFound(_0x563513,_0x1210bb){return function(_0x2d17d0){if(!_0x2d17d0){_0x563513['sendStatus'](0x194);}return _0x2d17d0;};}function handleError(_0x30debf,_0x5a6b13){_0x5a6b13=_0x5a6b13||0x1f4;return function(_0x2113c2){logger[_0x241f('0x24')](_0x2113c2[_0x241f('0x25')]);if(_0x2113c2[_0x241f('0x26')]){delete _0x2113c2[_0x241f('0x26')];}_0x30debf[_0x241f('0x18')](_0x5a6b13)['send'](_0x2113c2);};}exports['index']=function(_0x5700e1,_0x5ce5b2){var _0x3ba48d={},_0x52c85b={},_0x5d3f2f={'count':0x0,'rows':[]};var _0x124ae2=_['map'](db[_0x241f('0x27')][_0x241f('0x28')],function(_0x4488e0){return{'name':_0x4488e0[_0x241f('0x29')],'type':_0x4488e0[_0x241f('0x2a')][_0x241f('0x2b')]};});_0x52c85b[_0x241f('0x2c')]=_['map'](_0x124ae2,_0x241f('0x26'));_0x52c85b[_0x241f('0x2d')]=_[_0x241f('0x2e')](_0x5700e1[_0x241f('0x2d')]);_0x52c85b[_0x241f('0x2f')]=_[_0x241f('0x30')](_0x52c85b['model'],_0x52c85b[_0x241f('0x2d')]);_0x3ba48d[_0x241f('0x31')]=_[_0x241f('0x30')](_0x52c85b[_0x241f('0x2c')],qs[_0x241f('0x32')](_0x5700e1[_0x241f('0x2d')]['fields']));_0x3ba48d['attributes']=_0x3ba48d['attributes']['length']?_0x3ba48d[_0x241f('0x31')]:_0x52c85b[_0x241f('0x2c')];if(!_0x5700e1[_0x241f('0x2d')][_0x241f('0x33')](_0x241f('0x34'))){_0x3ba48d[_0x241f('0x1a')]=qs[_0x241f('0x1a')](_0x5700e1[_0x241f('0x2d')][_0x241f('0x1a')]);_0x3ba48d[_0x241f('0x1b')]=qs['offset'](_0x5700e1[_0x241f('0x2d')][_0x241f('0x1b')]);}_0x3ba48d[_0x241f('0x35')]=qs[_0x241f('0x36')](_0x5700e1[_0x241f('0x2d')][_0x241f('0x36')]);_0x3ba48d[_0x241f('0x37')]=qs[_0x241f('0x2f')](_[_0x241f('0x38')](_0x5700e1[_0x241f('0x2d')],_0x52c85b[_0x241f('0x2f')]),_0x124ae2);if(_0x5700e1[_0x241f('0x2d')][_0x241f('0x39')]){_0x3ba48d[_0x241f('0x37')]=_[_0x241f('0x3a')](_0x3ba48d['where'],{'$or':_[_0x241f('0x3b')](_0x124ae2,function(_0x355041){if(_0x355041['type']!=='VIRTUAL'){var _0x165820={};_0x165820[_0x355041[_0x241f('0x26')]]={'$like':'%'+_0x5700e1[_0x241f('0x2d')][_0x241f('0x39')]+'%'};return _0x165820;}})});}_0x3ba48d=_[_0x241f('0x3a')]({},_0x3ba48d,_0x5700e1[_0x241f('0x3c')]);var _0x574d70={'where':_0x3ba48d[_0x241f('0x37')]};return db['SalesforceConfiguration'][_0x241f('0x1c')](_0x574d70)[_0x241f('0x22')](function(_0x14a5f9){_0x5d3f2f[_0x241f('0x1c')]=_0x14a5f9;if(_0x5700e1[_0x241f('0x2d')]['includeAll']){_0x3ba48d[_0x241f('0x3d')]=[{'all':!![]}];}return db[_0x241f('0x27')][_0x241f('0x3e')](_0x3ba48d);})[_0x241f('0x22')](function(_0x50e6be){_0x5d3f2f['rows']=_0x50e6be;return _0x5d3f2f;})['then'](respondWithFilteredResult(_0x5ce5b2,_0x3ba48d))['catch'](handleError(_0x5ce5b2,null));};exports[_0x241f('0x3f')]=function(_0x2cf899,_0x227490){var _0x5c5d56={'raw':![],'where':{'id':_0x2cf899['params']['id']}},_0x433662={};_0x433662[_0x241f('0x2c')]=_[_0x241f('0x2e')](db['SalesforceConfiguration'][_0x241f('0x28')]);_0x433662[_0x241f('0x2d')]=_[_0x241f('0x2e')](_0x2cf899[_0x241f('0x2d')]);_0x433662[_0x241f('0x2f')]=_[_0x241f('0x30')](_0x433662[_0x241f('0x2c')],_0x433662[_0x241f('0x2d')]);_0x5c5d56[_0x241f('0x31')]=_[_0x241f('0x30')](_0x433662[_0x241f('0x2c')],qs[_0x241f('0x32')](_0x2cf899[_0x241f('0x2d')][_0x241f('0x32')]));_0x5c5d56['attributes']=_0x5c5d56[_0x241f('0x31')][_0x241f('0x40')]?_0x5c5d56[_0x241f('0x31')]:_0x433662['model'];if(_0x2cf899['query'][_0x241f('0x41')]){_0x5c5d56['include']=[{'all':!![]}];}_0x5c5d56=_[_0x241f('0x3a')]({},_0x5c5d56,_0x2cf899[_0x241f('0x3c')]);return db['SalesforceConfiguration'][_0x241f('0x42')](_0x5c5d56)[_0x241f('0x22')](handleEntityNotFound(_0x227490,null))['then'](respondWithResult(_0x227490,null))['catch'](handleError(_0x227490,null));};exports['create']=function(_0x2c5004,_0x40510d){return db[_0x241f('0x27')][_0x241f('0x43')](_0x2c5004[_0x241f('0x44')],{})[_0x241f('0x22')](respondWithResult(_0x40510d,0xc9))[_0x241f('0x45')](handleError(_0x40510d,null));};exports['update']=function(_0x4108b7,_0xe3fc9a){if(_0x4108b7[_0x241f('0x44')]['id']){delete _0x4108b7['body']['id'];}return db[_0x241f('0x27')][_0x241f('0x42')]({'where':{'id':_0x4108b7['params']['id']}})[_0x241f('0x22')](handleEntityNotFound(_0xe3fc9a,null))[_0x241f('0x22')](saveUpdates(_0x4108b7['body'],null))[_0x241f('0x22')](respondWithResult(_0xe3fc9a,null))[_0x241f('0x45')](handleError(_0xe3fc9a,null));};exports[_0x241f('0x46')]=function(_0xda0ba5,_0x2811a9){return db[_0x241f('0x27')][_0x241f('0x42')]({'where':{'id':_0xda0ba5[_0x241f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2811a9,null))[_0x241f('0x22')](removeEntity(_0x2811a9,null))['catch'](handleError(_0x2811a9,null));};exports[_0x241f('0x48')]=function(_0x396770,_0x11aff8,_0x51cd89){var _0x5b0859={};var _0x4a6ea2={};var _0x489398;var _0x560187;return db['SalesforceConfiguration'][_0x241f('0x49')]({'where':{'id':_0x396770['params']['id']}})[_0x241f('0x22')](handleEntityNotFound(_0x11aff8,null))[_0x241f('0x22')](function(_0x5dc208){if(_0x5dc208){_0x489398=_0x5dc208;_0x4a6ea2[_0x241f('0x2c')]=_[_0x241f('0x2e')](db[_0x241f('0x4a')][_0x241f('0x28')]);_0x4a6ea2[_0x241f('0x2d')]=_[_0x241f('0x2e')](_0x396770[_0x241f('0x2d')]);_0x4a6ea2['filters']=_[_0x241f('0x30')](_0x4a6ea2[_0x241f('0x2c')],_0x4a6ea2[_0x241f('0x2d')]);_0x5b0859['attributes']=_['intersection'](_0x4a6ea2[_0x241f('0x2c')],qs[_0x241f('0x32')](_0x396770[_0x241f('0x2d')][_0x241f('0x32')]));_0x5b0859[_0x241f('0x31')]=_0x5b0859[_0x241f('0x31')][_0x241f('0x40')]?_0x5b0859[_0x241f('0x31')]:_0x4a6ea2[_0x241f('0x2c')];_0x5b0859[_0x241f('0x35')]=qs[_0x241f('0x36')](_0x396770[_0x241f('0x2d')][_0x241f('0x36')]);_0x5b0859[_0x241f('0x37')]=qs[_0x241f('0x2f')](_['pick'](_0x396770[_0x241f('0x2d')],_0x4a6ea2[_0x241f('0x2f')]));if(_0x396770[_0x241f('0x2d')][_0x241f('0x39')]){_0x5b0859[_0x241f('0x37')]=_[_0x241f('0x3a')](_0x5b0859['where'],{'$or':_[_0x241f('0x3b')](_0x5b0859[_0x241f('0x31')],function(_0x4df1a5){var _0x21f4c9={};_0x21f4c9[_0x4df1a5]={'$like':'%'+_0x396770['query'][_0x241f('0x39')]+'%'};return _0x21f4c9;})});}_0x5b0859=_[_0x241f('0x3a')]({},_0x5b0859,_0x396770['options']);return _0x489398[_0x241f('0x48')](_0x5b0859);}})[_0x241f('0x22')](function(_0x55ae4c){if(_0x55ae4c){_0x560187=_0x55ae4c[_0x241f('0x40')];if(!_0x396770[_0x241f('0x2d')][_0x241f('0x33')](_0x241f('0x34'))){_0x5b0859[_0x241f('0x1a')]=qs['limit'](_0x396770[_0x241f('0x2d')][_0x241f('0x1a')]);_0x5b0859[_0x241f('0x1b')]=qs[_0x241f('0x1b')](_0x396770[_0x241f('0x2d')][_0x241f('0x1b')]);}return _0x489398[_0x241f('0x48')](_0x5b0859);}})[_0x241f('0x22')](function(_0x410428){if(_0x410428){return _0x410428?{'count':_0x560187,'rows':_0x410428}:null;}})['then'](respondWithResult(_0x11aff8,null))[_0x241f('0x45')](handleError(_0x11aff8,null));};exports['getSubjects']=function(_0x418ecf,_0x5a52c5,_0x2c4947){var _0x56457d={};var _0x1704fc={};var _0x1187f8;var _0x11cd33;return db[_0x241f('0x27')][_0x241f('0x49')]({'where':{'id':_0x418ecf[_0x241f('0x47')]['id']}})[_0x241f('0x22')](handleEntityNotFound(_0x5a52c5,null))[_0x241f('0x22')](function(_0x382e8d){if(_0x382e8d){_0x1187f8=_0x382e8d;_0x1704fc[_0x241f('0x2c')]=_[_0x241f('0x2e')](db[_0x241f('0x4a')][_0x241f('0x28')]);_0x1704fc['query']=_[_0x241f('0x2e')](_0x418ecf[_0x241f('0x2d')]);_0x1704fc[_0x241f('0x2f')]=_['intersection'](_0x1704fc['model'],_0x1704fc[_0x241f('0x2d')]);_0x56457d[_0x241f('0x31')]=_['intersection'](_0x1704fc[_0x241f('0x2c')],qs[_0x241f('0x32')](_0x418ecf['query'][_0x241f('0x32')]));_0x56457d['attributes']=_0x56457d['attributes'][_0x241f('0x40')]?_0x56457d['attributes']:_0x1704fc['model'];_0x56457d[_0x241f('0x35')]=qs[_0x241f('0x36')](_0x418ecf[_0x241f('0x2d')]['sort']);_0x56457d[_0x241f('0x37')]=qs['filters'](_[_0x241f('0x38')](_0x418ecf['query'],_0x1704fc[_0x241f('0x2f')]));if(_0x418ecf['query'][_0x241f('0x39')]){_0x56457d[_0x241f('0x37')]=_[_0x241f('0x3a')](_0x56457d[_0x241f('0x37')],{'$or':_[_0x241f('0x3b')](_0x56457d[_0x241f('0x31')],function(_0x11d2cc){var _0x507258={};_0x507258[_0x11d2cc]={'$like':'%'+_0x418ecf[_0x241f('0x2d')][_0x241f('0x39')]+'%'};return _0x507258;})});}_0x56457d=_[_0x241f('0x3a')]({},_0x56457d,_0x418ecf[_0x241f('0x3c')]);return _0x1187f8[_0x241f('0x4b')](_0x56457d);}})[_0x241f('0x22')](function(_0xffb72f){if(_0xffb72f){_0x11cd33=_0xffb72f[_0x241f('0x40')];if(!_0x418ecf[_0x241f('0x2d')][_0x241f('0x33')]('nolimit')){_0x56457d[_0x241f('0x1a')]=qs[_0x241f('0x1a')](_0x418ecf[_0x241f('0x2d')][_0x241f('0x1a')]);_0x56457d['offset']=qs[_0x241f('0x1b')](_0x418ecf[_0x241f('0x2d')][_0x241f('0x1b')]);}return _0x1187f8['getSubjects'](_0x56457d);}})[_0x241f('0x22')](function(_0x237356){if(_0x237356){return _0x237356?{'count':_0x11cd33,'rows':_0x237356}:null;}})['then'](respondWithResult(_0x5a52c5,null))[_0x241f('0x45')](handleError(_0x5a52c5,null));};exports[_0x241f('0x4c')]=function(_0x51adfd,_0x3fbedc,_0x4d9124){var _0x5be3bf={};var _0xb9e569={};var _0x53da21;var _0x1f1364;return db[_0x241f('0x27')]['findOne']({'where':{'id':_0x51adfd['params']['id']}})[_0x241f('0x22')](handleEntityNotFound(_0x3fbedc,null))['then'](function(_0x5acac1){if(_0x5acac1){_0x53da21=_0x5acac1;_0xb9e569[_0x241f('0x2c')]=_[_0x241f('0x2e')](db[_0x241f('0x4a')]['rawAttributes']);_0xb9e569[_0x241f('0x2d')]=_['keys'](_0x51adfd[_0x241f('0x2d')]);_0xb9e569[_0x241f('0x2f')]=_[_0x241f('0x30')](_0xb9e569[_0x241f('0x2c')],_0xb9e569[_0x241f('0x2d')]);_0x5be3bf[_0x241f('0x31')]=_['intersection'](_0xb9e569[_0x241f('0x2c')],qs[_0x241f('0x32')](_0x51adfd[_0x241f('0x2d')][_0x241f('0x32')]));_0x5be3bf['attributes']=_0x5be3bf[_0x241f('0x31')]['length']?_0x5be3bf['attributes']:_0xb9e569[_0x241f('0x2c')];_0x5be3bf[_0x241f('0x35')]=qs[_0x241f('0x36')](_0x51adfd[_0x241f('0x2d')][_0x241f('0x36')]);_0x5be3bf[_0x241f('0x37')]=qs[_0x241f('0x2f')](_[_0x241f('0x38')](_0x51adfd[_0x241f('0x2d')],_0xb9e569[_0x241f('0x2f')]));if(_0x51adfd[_0x241f('0x2d')]['filter']){_0x5be3bf['where']=_[_0x241f('0x3a')](_0x5be3bf[_0x241f('0x37')],{'$or':_['map'](_0x5be3bf[_0x241f('0x31')],function(_0x59dc0d){var _0x7101f7={};_0x7101f7[_0x59dc0d]={'$like':'%'+_0x51adfd[_0x241f('0x2d')][_0x241f('0x39')]+'%'};return _0x7101f7;})});}_0x5be3bf=_[_0x241f('0x3a')]({},_0x5be3bf,_0x51adfd[_0x241f('0x3c')]);return _0x53da21[_0x241f('0x4c')](_0x5be3bf);}})[_0x241f('0x22')](function(_0x405520){if(_0x405520){_0x1f1364=_0x405520[_0x241f('0x40')];if(!_0x51adfd[_0x241f('0x2d')][_0x241f('0x33')](_0x241f('0x34'))){_0x5be3bf[_0x241f('0x1a')]=qs[_0x241f('0x1a')](_0x51adfd[_0x241f('0x2d')]['limit']);_0x5be3bf[_0x241f('0x1b')]=qs[_0x241f('0x1b')](_0x51adfd[_0x241f('0x2d')][_0x241f('0x1b')]);}return _0x53da21[_0x241f('0x4c')](_0x5be3bf);}})[_0x241f('0x22')](function(_0x1f34ba){if(_0x1f34ba){return _0x1f34ba?{'count':_0x1f1364,'rows':_0x1f34ba}:null;}})[_0x241f('0x22')](respondWithResult(_0x3fbedc,null))[_0x241f('0x45')](handleError(_0x3fbedc,null));}; \ No newline at end of file +var _0x337c=['findAll','catch','show','params','rawAttributes','length','body','find','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','SalesforceConfiguration','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x29adde,_0x36b9aa){var _0xf0003d=function(_0x19cf19){while(--_0x19cf19){_0x29adde['push'](_0x29adde['shift']());}};_0xf0003d(++_0x36b9aa);}(_0x337c,0x10d));var _0xc337=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x337c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc337('0x0'));var rimraf=require(_0xc337('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc337('0x2'));var rp=require(_0xc337('0x3'));var moment=require(_0xc337('0x4'));var BPromise=require(_0xc337('0x5'));var Mustache=require(_0xc337('0x6'));var util=require(_0xc337('0x7'));var path=require(_0xc337('0x8'));var sox=require(_0xc337('0x9'));var csv=require('to-csv');var ejs=require(_0xc337('0xa'));var fs=require('fs');var fs_extra=require(_0xc337('0xb'));var _=require(_0xc337('0xc'));var squel=require(_0xc337('0xd'));var crypto=require(_0xc337('0xe'));var jsforce=require(_0xc337('0xf'));var deskjs=require(_0xc337('0x10'));var toCsv=require(_0xc337('0x11'));var querystring=require(_0xc337('0x12'));var Papa=require(_0xc337('0x13'));var Redis=require(_0xc337('0x14'));var authService=require(_0xc337('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xc337('0x16'));var hardwareService=require(_0xc337('0x17'));var logger=require(_0xc337('0x18'))(_0xc337('0x19'));var utils=require(_0xc337('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xc337('0x1b'));var db=require(_0xc337('0x1c'))['db'];function respondWithStatusCode(_0x2704c3,_0x300a38){_0x300a38=_0x300a38||0xcc;return function(_0x424d45){if(_0x424d45){return _0x2704c3[_0xc337('0x1d')](_0x300a38);}return _0x2704c3[_0xc337('0x1e')](_0x300a38)[_0xc337('0x1f')]();};}function respondWithResult(_0x53c65f,_0x297a19){_0x297a19=_0x297a19||0xc8;return function(_0x588868){if(_0x588868){return _0x53c65f[_0xc337('0x1e')](_0x297a19)['json'](_0x588868);}};}function respondWithFilteredResult(_0x1245ea,_0x5edf51){return function(_0x3e5ef2){if(_0x3e5ef2){var _0x38e708=typeof _0x5edf51[_0xc337('0x20')]===_0xc337('0x21')&&typeof _0x5edf51[_0xc337('0x22')]===_0xc337('0x21');var _0x314eb2=_0x3e5ef2[_0xc337('0x23')];var _0x5419c6=_0x38e708?0x0:_0x5edf51[_0xc337('0x20')];var _0x402ef4=_0x38e708?_0x3e5ef2['count']:_0x5edf51[_0xc337('0x20')]+_0x5edf51[_0xc337('0x22')];var _0x236fee;if(_0x402ef4>=_0x314eb2){_0x402ef4=_0x314eb2;_0x236fee=0xc8;}else{_0x236fee=0xce;}_0x1245ea['status'](_0x236fee);return _0x1245ea[_0xc337('0x24')](_0xc337('0x25'),_0x5419c6+'-'+_0x402ef4+'/'+_0x314eb2)[_0xc337('0x26')](_0x3e5ef2);}return null;};}function patchUpdates(_0x315f28){return function(_0x5f59f6){try{jsonpatch[_0xc337('0x27')](_0x5f59f6,_0x315f28,!![]);}catch(_0x2afc28){return BPromise[_0xc337('0x28')](_0x2afc28);}return _0x5f59f6['save']();};}function saveUpdates(_0x1cdc70,_0x199c74){return function(_0x46e38f){if(_0x46e38f){return _0x46e38f[_0xc337('0x29')](_0x1cdc70)[_0xc337('0x2a')](function(_0x339982){return _0x339982;});}return null;};}function removeEntity(_0x240a92,_0x1391b3){return function(_0x54c14a){if(_0x54c14a){return _0x54c14a[_0xc337('0x2b')]()[_0xc337('0x2a')](function(){_0x240a92[_0xc337('0x1e')](0xcc)[_0xc337('0x1f')]();});}};}function handleEntityNotFound(_0x369237,_0x68a9bf){return function(_0x3c5d92){if(!_0x3c5d92){_0x369237['sendStatus'](0x194);}return _0x3c5d92;};}function handleError(_0xd7cd2f,_0x431387){_0x431387=_0x431387||0x1f4;return function(_0x21681a){logger[_0xc337('0x2c')](_0x21681a[_0xc337('0x2d')]);if(_0x21681a[_0xc337('0x2e')]){delete _0x21681a[_0xc337('0x2e')];}_0xd7cd2f[_0xc337('0x1e')](_0x431387)[_0xc337('0x2f')](_0x21681a);};}exports['index']=function(_0x5a2242,_0x582db8){var _0x517377={},_0x6b7caa={},_0x3880ec={'count':0x0,'rows':[]};var _0x588c13=_['map'](db[_0xc337('0x30')]['rawAttributes'],function(_0x40918c){return{'name':_0x40918c[_0xc337('0x31')],'type':_0x40918c[_0xc337('0x32')][_0xc337('0x33')]};});_0x6b7caa[_0xc337('0x34')]=_[_0xc337('0x35')](_0x588c13,_0xc337('0x2e'));_0x6b7caa[_0xc337('0x36')]=_[_0xc337('0x37')](_0x5a2242[_0xc337('0x36')]);_0x6b7caa['filters']=_[_0xc337('0x38')](_0x6b7caa['model'],_0x6b7caa[_0xc337('0x36')]);_0x517377[_0xc337('0x39')]=_[_0xc337('0x38')](_0x6b7caa[_0xc337('0x34')],qs[_0xc337('0x3a')](_0x5a2242['query']['fields']));_0x517377[_0xc337('0x39')]=_0x517377[_0xc337('0x39')]['length']?_0x517377[_0xc337('0x39')]:_0x6b7caa['model'];if(!_0x5a2242['query']['hasOwnProperty'](_0xc337('0x3b'))){_0x517377[_0xc337('0x22')]=qs[_0xc337('0x22')](_0x5a2242[_0xc337('0x36')][_0xc337('0x22')]);_0x517377[_0xc337('0x20')]=qs[_0xc337('0x20')](_0x5a2242[_0xc337('0x36')]['offset']);}_0x517377[_0xc337('0x3c')]=qs[_0xc337('0x3d')](_0x5a2242[_0xc337('0x36')]['sort']);_0x517377[_0xc337('0x3e')]=qs[_0xc337('0x3f')](_[_0xc337('0x40')](_0x5a2242['query'],_0x6b7caa[_0xc337('0x3f')]),_0x588c13);if(_0x5a2242[_0xc337('0x36')][_0xc337('0x41')]){_0x517377[_0xc337('0x3e')]=_[_0xc337('0x42')](_0x517377[_0xc337('0x3e')],{'$or':_['map'](_0x588c13,function(_0x580002){if(_0x580002[_0xc337('0x32')]!==_0xc337('0x43')){var _0x53f86f={};_0x53f86f[_0x580002['name']]={'$like':'%'+_0x5a2242[_0xc337('0x36')][_0xc337('0x41')]+'%'};return _0x53f86f;}})});}_0x517377=_[_0xc337('0x42')]({},_0x517377,_0x5a2242[_0xc337('0x44')]);var _0x26d722={'where':_0x517377['where']};return db[_0xc337('0x30')][_0xc337('0x23')](_0x26d722)[_0xc337('0x2a')](function(_0x1d52c){_0x3880ec[_0xc337('0x23')]=_0x1d52c;if(_0x5a2242['query'][_0xc337('0x45')]){_0x517377[_0xc337('0x46')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xc337('0x47')](_0x517377);})[_0xc337('0x2a')](function(_0x536523){_0x3880ec['rows']=_0x536523;return _0x3880ec;})[_0xc337('0x2a')](respondWithFilteredResult(_0x582db8,_0x517377))[_0xc337('0x48')](handleError(_0x582db8,null));};exports[_0xc337('0x49')]=function(_0x46946f,_0x4175b3){var _0x46d193={'raw':![],'where':{'id':_0x46946f[_0xc337('0x4a')]['id']}},_0x1c4ec8={};_0x1c4ec8[_0xc337('0x34')]=_['keys'](db[_0xc337('0x30')][_0xc337('0x4b')]);_0x1c4ec8[_0xc337('0x36')]=_[_0xc337('0x37')](_0x46946f[_0xc337('0x36')]);_0x1c4ec8[_0xc337('0x3f')]=_[_0xc337('0x38')](_0x1c4ec8['model'],_0x1c4ec8['query']);_0x46d193['attributes']=_[_0xc337('0x38')](_0x1c4ec8['model'],qs['fields'](_0x46946f[_0xc337('0x36')]['fields']));_0x46d193[_0xc337('0x39')]=_0x46d193['attributes'][_0xc337('0x4c')]?_0x46d193[_0xc337('0x39')]:_0x1c4ec8['model'];if(_0x46946f[_0xc337('0x36')][_0xc337('0x45')]){_0x46d193[_0xc337('0x46')]=[{'all':!![]}];}_0x46d193=_[_0xc337('0x42')]({},_0x46d193,_0x46946f[_0xc337('0x44')]);return db[_0xc337('0x30')]['find'](_0x46d193)[_0xc337('0x2a')](handleEntityNotFound(_0x4175b3,null))[_0xc337('0x2a')](respondWithResult(_0x4175b3,null))['catch'](handleError(_0x4175b3,null));};exports['create']=function(_0x59b0d4,_0x341f0f){return db[_0xc337('0x30')]['create'](_0x59b0d4[_0xc337('0x4d')],{})[_0xc337('0x2a')](respondWithResult(_0x341f0f,0xc9))['catch'](handleError(_0x341f0f,null));};exports[_0xc337('0x29')]=function(_0x410526,_0x5c217c){if(_0x410526[_0xc337('0x4d')]['id']){delete _0x410526[_0xc337('0x4d')]['id'];}return db[_0xc337('0x30')][_0xc337('0x4e')]({'where':{'id':_0x410526[_0xc337('0x4a')]['id']}})[_0xc337('0x2a')](handleEntityNotFound(_0x5c217c,null))[_0xc337('0x2a')](saveUpdates(_0x410526[_0xc337('0x4d')],null))[_0xc337('0x2a')](respondWithResult(_0x5c217c,null))[_0xc337('0x48')](handleError(_0x5c217c,null));};exports['destroy']=function(_0x351581,_0x372a06){return db['SalesforceConfiguration'][_0xc337('0x4e')]({'where':{'id':_0x351581[_0xc337('0x4a')]['id']}})[_0xc337('0x2a')](handleEntityNotFound(_0x372a06,null))[_0xc337('0x2a')](removeEntity(_0x372a06,null))[_0xc337('0x48')](handleError(_0x372a06,null));};exports[_0xc337('0x4f')]=function(_0x7b3b4d,_0x24559d,_0x301695){var _0x1ec176={};var _0x2f5c2d={};var _0x2c85f3;var _0x2d898b;return db[_0xc337('0x30')][_0xc337('0x50')]({'where':{'id':_0x7b3b4d[_0xc337('0x4a')]['id']}})['then'](handleEntityNotFound(_0x24559d,null))[_0xc337('0x2a')](function(_0x32c328){if(_0x32c328){_0x2c85f3=_0x32c328;_0x2f5c2d[_0xc337('0x34')]=_[_0xc337('0x37')](db[_0xc337('0x51')][_0xc337('0x4b')]);_0x2f5c2d[_0xc337('0x36')]=_[_0xc337('0x37')](_0x7b3b4d[_0xc337('0x36')]);_0x2f5c2d[_0xc337('0x3f')]=_[_0xc337('0x38')](_0x2f5c2d['model'],_0x2f5c2d[_0xc337('0x36')]);_0x1ec176[_0xc337('0x39')]=_[_0xc337('0x38')](_0x2f5c2d[_0xc337('0x34')],qs[_0xc337('0x3a')](_0x7b3b4d[_0xc337('0x36')][_0xc337('0x3a')]));_0x1ec176[_0xc337('0x39')]=_0x1ec176[_0xc337('0x39')][_0xc337('0x4c')]?_0x1ec176['attributes']:_0x2f5c2d[_0xc337('0x34')];_0x1ec176[_0xc337('0x3c')]=qs[_0xc337('0x3d')](_0x7b3b4d[_0xc337('0x36')][_0xc337('0x3d')]);_0x1ec176['where']=qs[_0xc337('0x3f')](_[_0xc337('0x40')](_0x7b3b4d[_0xc337('0x36')],_0x2f5c2d[_0xc337('0x3f')]));if(_0x7b3b4d[_0xc337('0x36')][_0xc337('0x41')]){_0x1ec176['where']=_[_0xc337('0x42')](_0x1ec176['where'],{'$or':_['map'](_0x1ec176[_0xc337('0x39')],function(_0x555d2a){var _0x18955b={};_0x18955b[_0x555d2a]={'$like':'%'+_0x7b3b4d[_0xc337('0x36')]['filter']+'%'};return _0x18955b;})});}_0x1ec176=_[_0xc337('0x42')]({},_0x1ec176,_0x7b3b4d[_0xc337('0x44')]);return _0x2c85f3[_0xc337('0x4f')](_0x1ec176);}})[_0xc337('0x2a')](function(_0x51c913){if(_0x51c913){_0x2d898b=_0x51c913[_0xc337('0x4c')];if(!_0x7b3b4d[_0xc337('0x36')][_0xc337('0x52')](_0xc337('0x3b'))){_0x1ec176['limit']=qs[_0xc337('0x22')](_0x7b3b4d[_0xc337('0x36')]['limit']);_0x1ec176[_0xc337('0x20')]=qs[_0xc337('0x20')](_0x7b3b4d[_0xc337('0x36')][_0xc337('0x20')]);}return _0x2c85f3[_0xc337('0x4f')](_0x1ec176);}})[_0xc337('0x2a')](function(_0x455db4){if(_0x455db4){return _0x455db4?{'count':_0x2d898b,'rows':_0x455db4}:null;}})[_0xc337('0x2a')](respondWithResult(_0x24559d,null))[_0xc337('0x48')](handleError(_0x24559d,null));};exports[_0xc337('0x53')]=function(_0x4d3600,_0x235e03,_0x3edbaf){var _0xe935a8={};var _0x157490={};var _0x4111be;var _0x3315b3;return db[_0xc337('0x30')]['findOne']({'where':{'id':_0x4d3600['params']['id']}})[_0xc337('0x2a')](handleEntityNotFound(_0x235e03,null))['then'](function(_0x69cef7){if(_0x69cef7){_0x4111be=_0x69cef7;_0x157490[_0xc337('0x34')]=_['keys'](db[_0xc337('0x51')]['rawAttributes']);_0x157490[_0xc337('0x36')]=_['keys'](_0x4d3600['query']);_0x157490[_0xc337('0x3f')]=_[_0xc337('0x38')](_0x157490[_0xc337('0x34')],_0x157490[_0xc337('0x36')]);_0xe935a8['attributes']=_[_0xc337('0x38')](_0x157490[_0xc337('0x34')],qs['fields'](_0x4d3600['query'][_0xc337('0x3a')]));_0xe935a8[_0xc337('0x39')]=_0xe935a8[_0xc337('0x39')][_0xc337('0x4c')]?_0xe935a8[_0xc337('0x39')]:_0x157490['model'];_0xe935a8[_0xc337('0x3c')]=qs[_0xc337('0x3d')](_0x4d3600[_0xc337('0x36')][_0xc337('0x3d')]);_0xe935a8['where']=qs[_0xc337('0x3f')](_['pick'](_0x4d3600[_0xc337('0x36')],_0x157490[_0xc337('0x3f')]));if(_0x4d3600[_0xc337('0x36')]['filter']){_0xe935a8[_0xc337('0x3e')]=_[_0xc337('0x42')](_0xe935a8[_0xc337('0x3e')],{'$or':_[_0xc337('0x35')](_0xe935a8[_0xc337('0x39')],function(_0x11f6ec){var _0x1d09ec={};_0x1d09ec[_0x11f6ec]={'$like':'%'+_0x4d3600['query'][_0xc337('0x41')]+'%'};return _0x1d09ec;})});}_0xe935a8=_[_0xc337('0x42')]({},_0xe935a8,_0x4d3600[_0xc337('0x44')]);return _0x4111be[_0xc337('0x53')](_0xe935a8);}})[_0xc337('0x2a')](function(_0x23b5b8){if(_0x23b5b8){_0x3315b3=_0x23b5b8[_0xc337('0x4c')];if(!_0x4d3600['query'][_0xc337('0x52')](_0xc337('0x3b'))){_0xe935a8[_0xc337('0x22')]=qs[_0xc337('0x22')](_0x4d3600['query']['limit']);_0xe935a8['offset']=qs[_0xc337('0x20')](_0x4d3600[_0xc337('0x36')][_0xc337('0x20')]);}return _0x4111be[_0xc337('0x53')](_0xe935a8);}})['then'](function(_0x2839bb){if(_0x2839bb){return _0x2839bb?{'count':_0x3315b3,'rows':_0x2839bb}:null;}})['then'](respondWithResult(_0x235e03,null))[_0xc337('0x48')](handleError(_0x235e03,null));};exports[_0xc337('0x54')]=function(_0x67830c,_0x57aea2,_0x93cb61){var _0x49f67e={};var _0x63e39e={};var _0x425b8e;var _0x368521;return db[_0xc337('0x30')][_0xc337('0x50')]({'where':{'id':_0x67830c['params']['id']}})[_0xc337('0x2a')](handleEntityNotFound(_0x57aea2,null))['then'](function(_0xc7d25e){if(_0xc7d25e){_0x425b8e=_0xc7d25e;_0x63e39e[_0xc337('0x34')]=_[_0xc337('0x37')](db[_0xc337('0x51')][_0xc337('0x4b')]);_0x63e39e[_0xc337('0x36')]=_[_0xc337('0x37')](_0x67830c[_0xc337('0x36')]);_0x63e39e[_0xc337('0x3f')]=_[_0xc337('0x38')](_0x63e39e['model'],_0x63e39e[_0xc337('0x36')]);_0x49f67e['attributes']=_[_0xc337('0x38')](_0x63e39e[_0xc337('0x34')],qs[_0xc337('0x3a')](_0x67830c[_0xc337('0x36')]['fields']));_0x49f67e['attributes']=_0x49f67e[_0xc337('0x39')][_0xc337('0x4c')]?_0x49f67e[_0xc337('0x39')]:_0x63e39e[_0xc337('0x34')];_0x49f67e[_0xc337('0x3c')]=qs['sort'](_0x67830c[_0xc337('0x36')][_0xc337('0x3d')]);_0x49f67e['where']=qs[_0xc337('0x3f')](_[_0xc337('0x40')](_0x67830c[_0xc337('0x36')],_0x63e39e[_0xc337('0x3f')]));if(_0x67830c[_0xc337('0x36')][_0xc337('0x41')]){_0x49f67e[_0xc337('0x3e')]=_[_0xc337('0x42')](_0x49f67e[_0xc337('0x3e')],{'$or':_[_0xc337('0x35')](_0x49f67e['attributes'],function(_0xe49a8a){var _0x1d041d={};_0x1d041d[_0xe49a8a]={'$like':'%'+_0x67830c[_0xc337('0x36')]['filter']+'%'};return _0x1d041d;})});}_0x49f67e=_[_0xc337('0x42')]({},_0x49f67e,_0x67830c[_0xc337('0x44')]);return _0x425b8e[_0xc337('0x54')](_0x49f67e);}})[_0xc337('0x2a')](function(_0x868d63){if(_0x868d63){_0x368521=_0x868d63[_0xc337('0x4c')];if(!_0x67830c[_0xc337('0x36')][_0xc337('0x52')](_0xc337('0x3b'))){_0x49f67e[_0xc337('0x22')]=qs[_0xc337('0x22')](_0x67830c[_0xc337('0x36')][_0xc337('0x22')]);_0x49f67e[_0xc337('0x20')]=qs[_0xc337('0x20')](_0x67830c['query'][_0xc337('0x20')]);}return _0x425b8e[_0xc337('0x54')](_0x49f67e);}})[_0xc337('0x2a')](function(_0x1956bd){if(_0x1956bd){return _0x1956bd?{'count':_0x368521,'rows':_0x1956bd}:null;}})['then'](respondWithResult(_0x57aea2,null))['catch'](handleError(_0x57aea2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index d8d288e..375b4f7 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 _0x992a=['../../config/environment','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x992a,0xd4));var _0xa992=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0x992a[_0xd9f102];return _0x2652e4;};'use strict';var _=require(_0xa992('0x0'));var util=require(_0xa992('0x1'));var logger=require(_0xa992('0x2'))(_0xa992('0x3'));var moment=require(_0xa992('0x4'));var BPromise=require('bluebird');var rp=require(_0xa992('0x5'));var fs=require('fs');var path=require(_0xa992('0x6'));var rimraf=require(_0xa992('0x7'));var config=require(_0xa992('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x237cba,_0x42badf){return _0x237cba['define'](_0xa992('0x9'),attributes,{'tableName':_0xa992('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde07=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x1d33f2,_0x98de2c){var _0x48e0dd=function(_0x3dbcc5){while(--_0x3dbcc5){_0x1d33f2['push'](_0x1d33f2['shift']());}};_0x48e0dd(++_0x98de2c);}(_0xde07,0x81));var _0x7de0=function(_0x6ca1af,_0x64091){_0x6ca1af=_0x6ca1af-0x0;var _0x392ffe=_0xde07[_0x6ca1af];return _0x392ffe;};'use strict';var _=require(_0x7de0('0x0'));var util=require(_0x7de0('0x1'));var logger=require(_0x7de0('0x2'))(_0x7de0('0x3'));var moment=require(_0x7de0('0x4'));var BPromise=require(_0x7de0('0x5'));var rp=require(_0x7de0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7de0('0x7'));var config=require(_0x7de0('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x7de0('0x9')]=function(_0x56bc68,_0x201830){return _0x56bc68[_0x7de0('0xa')]('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 836f70c..30ed9eb 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 _0x6616=['request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x41d942,_0x5bf053){var _0x12bd52=function(_0x1338bb){while(--_0x1338bb){_0x41d942['push'](_0x41d942['shift']());}};_0x12bd52(++_0x5bf053);}(_0x6616,0x10a));var _0x6661=function(_0x253298,_0x84da9f){_0x253298=_0x253298-0x0;var _0x12801e=_0x6616[_0x253298];return _0x12801e;};'use strict';var _=require(_0x6661('0x0'));var util=require(_0x6661('0x1'));var moment=require(_0x6661('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6661('0x3'))['db'];var utils=require(_0x6661('0x4'));var logger=require(_0x6661('0x5'))(_0x6661('0x6'));var config=require('../../config/environment');var jayson=require(_0x6661('0x7'));var client=jayson[_0x6661('0x8')][_0x6661('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1881e7,_0x5aa352,_0x1d58d2){return new BPromise(function(_0x485f67,_0x1e777d){return client[_0x6661('0xa')](_0x1881e7,_0x1d58d2)[_0x6661('0xb')](function(_0x1e1022){logger[_0x6661('0xc')](_0x6661('0xd'),_0x5aa352,_0x6661('0xe'));logger[_0x6661('0xf')](_0x6661('0x10'),_0x5aa352,_0x6661('0xe'),JSON[_0x6661('0x11')](_0x1e1022));if(_0x1e1022[_0x6661('0x12')]){if(_0x1e1022[_0x6661('0x12')][_0x6661('0x13')]===0x1f4){logger[_0x6661('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5aa352,_0x1e1022[_0x6661('0x12')]['message']);return _0x1e777d(_0x1e1022['error'][_0x6661('0x14')]);}logger[_0x6661('0x12')](_0x6661('0xd'),_0x5aa352,_0x1e1022[_0x6661('0x12')][_0x6661('0x14')]);return _0x485f67(_0x1e1022[_0x6661('0x12')][_0x6661('0x14')]);}else{logger['info'](_0x6661('0xd'),_0x5aa352,'request\x20sent');_0x485f67(_0x1e1022[_0x6661('0x15')]['message']);}})[_0x6661('0x16')](function(_0x15c7c3){logger[_0x6661('0x12')](_0x6661('0xd'),_0x5aa352,_0x15c7c3);_0x1e777d(_0x15c7c3);});});} \ No newline at end of file +var _0x1942=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x322dfc,_0x1543e8){var _0x59cf17=function(_0x878f52){while(--_0x878f52){_0x322dfc['push'](_0x322dfc['shift']());}};_0x59cf17(++_0x1543e8);}(_0x1942,0x127));var _0x2194=function(_0x27909b,_0x459581){_0x27909b=_0x27909b-0x0;var _0x5d1928=_0x1942[_0x27909b];return _0x5d1928;};'use strict';var _=require(_0x2194('0x0'));var util=require(_0x2194('0x1'));var moment=require('moment');var BPromise=require(_0x2194('0x2'));var rs=require(_0x2194('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2194('0x4'))['db'];var utils=require(_0x2194('0x5'));var logger=require(_0x2194('0x6'))('rpc');var config=require(_0x2194('0x7'));var jayson=require(_0x2194('0x8'));var client=jayson[_0x2194('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47418c,_0x2b71d7,_0x153b7b){return new BPromise(function(_0x2a6a0b,_0x3e85af){return client['request'](_0x47418c,_0x153b7b)[_0x2194('0xa')](function(_0x89bfb){logger[_0x2194('0xb')](_0x2194('0xc'),_0x2b71d7,'request\x20sent');logger[_0x2194('0xd')](_0x2194('0xe'),_0x2b71d7,_0x2194('0xf'),JSON[_0x2194('0x10')](_0x89bfb));if(_0x89bfb[_0x2194('0x11')]){if(_0x89bfb[_0x2194('0x11')]['code']===0x1f4){logger[_0x2194('0x11')](_0x2194('0xc'),_0x2b71d7,_0x89bfb[_0x2194('0x11')][_0x2194('0x12')]);return _0x3e85af(_0x89bfb[_0x2194('0x11')][_0x2194('0x12')]);}logger[_0x2194('0x11')](_0x2194('0xc'),_0x2b71d7,_0x89bfb['error'][_0x2194('0x12')]);return _0x2a6a0b(_0x89bfb[_0x2194('0x11')][_0x2194('0x12')]);}else{logger[_0x2194('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2b71d7,_0x2194('0xf'));_0x2a6a0b(_0x89bfb[_0x2194('0x13')][_0x2194('0x12')]);}})[_0x2194('0x14')](function(_0x4ac86c){logger[_0x2194('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2b71d7,_0x4ac86c);_0x3e85af(_0x4ac86c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 7558e41..f8f7b69 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 _0x24f5=['get','index','/:id','isAuthenticated','show','post','create','put','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x24f5,0x101));var _0x524f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x24f5[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x524f('0x0'));var path=require(_0x524f('0x1'));var timeout=require(_0x524f('0x2'));var express=require('express');var router=express[_0x524f('0x3')]();var fs_extra=require(_0x524f('0x4'));var auth=require(_0x524f('0x5'));var interaction=require(_0x524f('0x6'));var config=require(_0x524f('0x7'));var controller=require(_0x524f('0x8'));router[_0x524f('0x9')]('/',auth['isAuthenticated'](),controller[_0x524f('0xa')]);router['get'](_0x524f('0xb'),auth[_0x524f('0xc')](),controller[_0x524f('0xd')]);router[_0x524f('0xe')]('/',auth[_0x524f('0xc')](),controller[_0x524f('0xf')]);router[_0x524f('0x10')]('/:id',auth[_0x524f('0xc')](),controller[_0x524f('0x11')]);router['delete']('/:id',auth[_0x524f('0xc')](),controller['destroy']);module[_0x524f('0x12')]=router; \ No newline at end of file +var _0x49f1=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x49f1,0x18b));var _0x149f=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0x49f1[_0x9c8b4a];return _0x198bef;};'use strict';var multer=require('multer');var util=require(_0x149f('0x0'));var path=require('path');var timeout=require(_0x149f('0x1'));var express=require('express');var router=express[_0x149f('0x2')]();var fs_extra=require(_0x149f('0x3'));var auth=require(_0x149f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x149f('0x5'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x149f('0x6')](),controller[_0x149f('0x7')]);router[_0x149f('0x8')](_0x149f('0x9'),auth[_0x149f('0x6')](),controller[_0x149f('0xa')]);router[_0x149f('0xb')]('/',auth[_0x149f('0x6')](),controller[_0x149f('0xc')]);router[_0x149f('0xd')](_0x149f('0x9'),auth[_0x149f('0x6')](),controller[_0x149f('0xe')]);router[_0x149f('0xf')](_0x149f('0x9'),auth[_0x149f('0x6')](),controller[_0x149f('0x10')]);module[_0x149f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 5686503..2e9d093 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 _0xd0ac=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0xd0ac,0x1e8));var _0xcd0a=function(_0x42d010,_0x3ee3fb){_0x42d010=_0x42d010-0x0;var _0x4d5c28=_0xd0ac[_0x42d010];return _0x4d5c28;};'use strict';var Sequelize=require(_0xcd0a('0x0'));module[_0xcd0a('0x1')]={'type':{'type':Sequelize[_0xcd0a('0x2')](_0xcd0a('0x3'),_0xcd0a('0x4'),_0xcd0a('0x5'),_0xcd0a('0x6'),_0xcd0a('0x7')),'defaultValue':_0xcd0a('0x3')},'content':{'type':Sequelize[_0xcd0a('0x8')]},'key':{'type':Sequelize[_0xcd0a('0x8')]},'keyType':{'type':Sequelize[_0xcd0a('0x2')]('string',_0xcd0a('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xcd0a('0x8')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xcd0a('0x8')]}}; \ No newline at end of file +var _0x1f75=['exports','string','customVariable','picklist','STRING','ENUM','sequelize'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1f75,0x195));var _0x51f7=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x1f75[_0x288f5e];return _0x476cc9;};'use strict';var Sequelize=require(_0x51f7('0x0'));module[_0x51f7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x51f7('0x2'),'variable',_0x51f7('0x3'),'keyValue',_0x51f7('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x51f7('0x5')]},'key':{'type':Sequelize[_0x51f7('0x5')]},'keyType':{'type':Sequelize[_0x51f7('0x6')](_0x51f7('0x2'),'variable',_0x51f7('0x3'))},'keyContent':{'type':Sequelize[_0x51f7('0x5')]},'idField':{'type':Sequelize[_0x51f7('0x5')]},'variableName':{'type':Sequelize[_0x51f7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 9b85468..5dc5700 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 _0xf982=['includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','error','stack','name','SalesforceField','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys'];(function(_0x4af777,_0x1dcc3f){var _0x3f752d=function(_0x20c7eb){while(--_0x20c7eb){_0x4af777['push'](_0x4af777['shift']());}};_0x3f752d(++_0x1dcc3f);}(_0xf982,0x171));var _0x2f98=function(_0x2e71d3,_0x42cd6d){_0x2e71d3=_0x2e71d3-0x0;var _0x37d70d=_0xf982[_0x2e71d3];return _0x37d70d;};'use strict';var emlformat=require(_0x2f98('0x0'));var rimraf=require(_0x2f98('0x1'));var zipdir=require(_0x2f98('0x2'));var jsonpatch=require(_0x2f98('0x3'));var rp=require(_0x2f98('0x4'));var moment=require(_0x2f98('0x5'));var BPromise=require(_0x2f98('0x6'));var Mustache=require(_0x2f98('0x7'));var util=require(_0x2f98('0x8'));var path=require(_0x2f98('0x9'));var sox=require(_0x2f98('0xa'));var csv=require('to-csv');var ejs=require(_0x2f98('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f98('0xc'));var squel=require(_0x2f98('0xd'));var crypto=require(_0x2f98('0xe'));var jsforce=require(_0x2f98('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f98('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2f98('0x11'));var qs=require(_0x2f98('0x12'));var as=require(_0x2f98('0x13'));var hardwareService=require(_0x2f98('0x14'));var logger=require('../../config/logger')(_0x2f98('0x15'));var utils=require('../../config/utils');var config=require(_0x2f98('0x16'));var licenseUtil=require(_0x2f98('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21725a,_0x1c13d0){_0x1c13d0=_0x1c13d0||0xcc;return function(_0x36198b){if(_0x36198b){return _0x21725a[_0x2f98('0x18')](_0x1c13d0);}return _0x21725a[_0x2f98('0x19')](_0x1c13d0)['end']();};}function respondWithResult(_0x405b82,_0x2def31){_0x2def31=_0x2def31||0xc8;return function(_0x25e35d){if(_0x25e35d){return _0x405b82[_0x2f98('0x19')](_0x2def31)[_0x2f98('0x1a')](_0x25e35d);}};}function respondWithFilteredResult(_0x107526,_0xfee0dc){return function(_0x557a03){if(_0x557a03){var _0x19b1df=typeof _0xfee0dc[_0x2f98('0x1b')]===_0x2f98('0x1c')&&typeof _0xfee0dc[_0x2f98('0x1d')]==='undefined';var _0x533243=_0x557a03[_0x2f98('0x1e')];var _0x12bd64=_0x19b1df?0x0:_0xfee0dc[_0x2f98('0x1b')];var _0x49ef20=_0x19b1df?_0x557a03[_0x2f98('0x1e')]:_0xfee0dc[_0x2f98('0x1b')]+_0xfee0dc[_0x2f98('0x1d')];var _0x3371ac;if(_0x49ef20>=_0x533243){_0x49ef20=_0x533243;_0x3371ac=0xc8;}else{_0x3371ac=0xce;}_0x107526[_0x2f98('0x19')](_0x3371ac);return _0x107526[_0x2f98('0x1f')]('Content-Range',_0x12bd64+'-'+_0x49ef20+'/'+_0x533243)[_0x2f98('0x1a')](_0x557a03);}return null;};}function patchUpdates(_0x4b7c73){return function(_0x2a56a1){try{jsonpatch[_0x2f98('0x20')](_0x2a56a1,_0x4b7c73,!![]);}catch(_0x2a76ac){return BPromise['reject'](_0x2a76ac);}return _0x2a56a1[_0x2f98('0x21')]();};}function saveUpdates(_0x254c01,_0x41d1da){return function(_0x140c3a){if(_0x140c3a){return _0x140c3a[_0x2f98('0x22')](_0x254c01)[_0x2f98('0x23')](function(_0x4edc62){return _0x4edc62;});}return null;};}function removeEntity(_0x149be2,_0x52bdf1){return function(_0x5e27f4){if(_0x5e27f4){return _0x5e27f4[_0x2f98('0x24')]()[_0x2f98('0x23')](function(){_0x149be2['status'](0xcc)[_0x2f98('0x25')]();});}};}function handleEntityNotFound(_0x550565,_0x1de14e){return function(_0x1b76e5){if(!_0x1b76e5){_0x550565['sendStatus'](0x194);}return _0x1b76e5;};}function handleError(_0x5ee850,_0x51b8bf){_0x51b8bf=_0x51b8bf||0x1f4;return function(_0x24f22c){logger[_0x2f98('0x26')](_0x24f22c[_0x2f98('0x27')]);if(_0x24f22c[_0x2f98('0x28')]){delete _0x24f22c['name'];}_0x5ee850[_0x2f98('0x19')](_0x51b8bf)['send'](_0x24f22c);};}exports['index']=function(_0xa1a9f2,_0x5cc4b5){var _0x422492={},_0x437ebb={},_0x1d0fa2={'count':0x0,'rows':[]};var _0x5506f5=_['map'](db[_0x2f98('0x29')][_0x2f98('0x2a')],function(_0x509e3c){return{'name':_0x509e3c[_0x2f98('0x2b')],'type':_0x509e3c['type'][_0x2f98('0x2c')]};});_0x437ebb[_0x2f98('0x2d')]=_[_0x2f98('0x2e')](_0x5506f5,_0x2f98('0x28'));_0x437ebb[_0x2f98('0x2f')]=_['keys'](_0xa1a9f2[_0x2f98('0x2f')]);_0x437ebb[_0x2f98('0x30')]=_[_0x2f98('0x31')](_0x437ebb[_0x2f98('0x2d')],_0x437ebb[_0x2f98('0x2f')]);_0x422492[_0x2f98('0x32')]=_[_0x2f98('0x31')](_0x437ebb[_0x2f98('0x2d')],qs['fields'](_0xa1a9f2[_0x2f98('0x2f')][_0x2f98('0x33')]));_0x422492[_0x2f98('0x32')]=_0x422492['attributes'][_0x2f98('0x34')]?_0x422492['attributes']:_0x437ebb['model'];if(!_0xa1a9f2[_0x2f98('0x2f')]['hasOwnProperty'](_0x2f98('0x35'))){_0x422492[_0x2f98('0x1d')]=qs['limit'](_0xa1a9f2[_0x2f98('0x2f')][_0x2f98('0x1d')]);_0x422492[_0x2f98('0x1b')]=qs[_0x2f98('0x1b')](_0xa1a9f2[_0x2f98('0x2f')][_0x2f98('0x1b')]);}_0x422492['order']=qs[_0x2f98('0x36')](_0xa1a9f2[_0x2f98('0x2f')][_0x2f98('0x36')]);_0x422492[_0x2f98('0x37')]=qs['filters'](_[_0x2f98('0x38')](_0xa1a9f2[_0x2f98('0x2f')],_0x437ebb[_0x2f98('0x30')]),_0x5506f5);if(_0xa1a9f2[_0x2f98('0x2f')][_0x2f98('0x39')]){_0x422492[_0x2f98('0x37')]=_[_0x2f98('0x3a')](_0x422492[_0x2f98('0x37')],{'$or':_[_0x2f98('0x2e')](_0x5506f5,function(_0x508615){if(_0x508615[_0x2f98('0x3b')]!==_0x2f98('0x3c')){var _0x328e4d={};_0x328e4d[_0x508615['name']]={'$like':'%'+_0xa1a9f2[_0x2f98('0x2f')][_0x2f98('0x39')]+'%'};return _0x328e4d;}})});}_0x422492=_['merge']({},_0x422492,_0xa1a9f2[_0x2f98('0x3d')]);var _0x57a5de={'where':_0x422492['where']};return db['SalesforceField'][_0x2f98('0x1e')](_0x57a5de)[_0x2f98('0x23')](function(_0x204a4e){_0x1d0fa2[_0x2f98('0x1e')]=_0x204a4e;if(_0xa1a9f2[_0x2f98('0x2f')]['includeAll']){_0x422492[_0x2f98('0x3e')]=[{'all':!![]}];}return db['SalesforceField'][_0x2f98('0x3f')](_0x422492);})[_0x2f98('0x23')](function(_0x41040f){_0x1d0fa2[_0x2f98('0x40')]=_0x41040f;return _0x1d0fa2;})[_0x2f98('0x23')](respondWithFilteredResult(_0x5cc4b5,_0x422492))[_0x2f98('0x41')](handleError(_0x5cc4b5,null));};exports[_0x2f98('0x42')]=function(_0x42dbe9,_0x5a86e7){var _0x47dd7a={'raw':!![],'where':{'id':_0x42dbe9[_0x2f98('0x43')]['id']}},_0x3767ac={};_0x3767ac[_0x2f98('0x2d')]=_[_0x2f98('0x44')](db[_0x2f98('0x29')][_0x2f98('0x2a')]);_0x3767ac[_0x2f98('0x2f')]=_[_0x2f98('0x44')](_0x42dbe9[_0x2f98('0x2f')]);_0x3767ac[_0x2f98('0x30')]=_[_0x2f98('0x31')](_0x3767ac[_0x2f98('0x2d')],_0x3767ac['query']);_0x47dd7a[_0x2f98('0x32')]=_['intersection'](_0x3767ac['model'],qs[_0x2f98('0x33')](_0x42dbe9[_0x2f98('0x2f')][_0x2f98('0x33')]));_0x47dd7a['attributes']=_0x47dd7a[_0x2f98('0x32')][_0x2f98('0x34')]?_0x47dd7a[_0x2f98('0x32')]:_0x3767ac[_0x2f98('0x2d')];if(_0x42dbe9[_0x2f98('0x2f')][_0x2f98('0x45')]){_0x47dd7a['include']=[{'all':!![]}];}_0x47dd7a=_['merge']({},_0x47dd7a,_0x42dbe9[_0x2f98('0x3d')]);return db[_0x2f98('0x29')]['find'](_0x47dd7a)[_0x2f98('0x23')](handleEntityNotFound(_0x5a86e7,null))[_0x2f98('0x23')](respondWithResult(_0x5a86e7,null))[_0x2f98('0x41')](handleError(_0x5a86e7,null));};exports['create']=function(_0x3621e6,_0x2e2cdc){return db[_0x2f98('0x29')][_0x2f98('0x46')](_0x3621e6[_0x2f98('0x47')],{})[_0x2f98('0x23')](respondWithResult(_0x2e2cdc,0xc9))[_0x2f98('0x41')](handleError(_0x2e2cdc,null));};exports[_0x2f98('0x22')]=function(_0x32f260,_0x5ead14){if(_0x32f260[_0x2f98('0x47')]['id']){delete _0x32f260[_0x2f98('0x47')]['id'];}return db['SalesforceField'][_0x2f98('0x48')]({'where':{'id':_0x32f260['params']['id']}})[_0x2f98('0x23')](handleEntityNotFound(_0x5ead14,null))[_0x2f98('0x23')](saveUpdates(_0x32f260[_0x2f98('0x47')],null))[_0x2f98('0x23')](respondWithResult(_0x5ead14,null))[_0x2f98('0x41')](handleError(_0x5ead14,null));};exports['destroy']=function(_0x38a9ac,_0x4fa13f){return db[_0x2f98('0x29')][_0x2f98('0x48')]({'where':{'id':_0x38a9ac['params']['id']}})[_0x2f98('0x23')](handleEntityNotFound(_0x4fa13f,null))[_0x2f98('0x23')](removeEntity(_0x4fa13f,null))[_0x2f98('0x41')](handleError(_0x4fa13f,null));}; \ No newline at end of file +var _0xae2b=['order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit'];(function(_0x1f1dde,_0x218543){var _0xac7c3b=function(_0x3d90a3){while(--_0x3d90a3){_0x1f1dde['push'](_0x1f1dde['shift']());}};_0xac7c3b(++_0x218543);}(_0xae2b,0x1e7));var _0xbae2=function(_0x1fc396,_0x517e59){_0x1fc396=_0x1fc396-0x0;var _0x4a9e61=_0xae2b[_0x1fc396];return _0x4a9e61;};'use strict';var emlformat=require(_0xbae2('0x0'));var rimraf=require(_0xbae2('0x1'));var zipdir=require(_0xbae2('0x2'));var jsonpatch=require(_0xbae2('0x3'));var rp=require(_0xbae2('0x4'));var moment=require(_0xbae2('0x5'));var BPromise=require(_0xbae2('0x6'));var Mustache=require(_0xbae2('0x7'));var util=require(_0xbae2('0x8'));var path=require(_0xbae2('0x9'));var sox=require(_0xbae2('0xa'));var csv=require(_0xbae2('0xb'));var ejs=require(_0xbae2('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbae2('0xd'));var squel=require(_0xbae2('0xe'));var crypto=require(_0xbae2('0xf'));var jsforce=require(_0xbae2('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xbae2('0xb'));var querystring=require('querystring');var Papa=require(_0xbae2('0x11'));var Redis=require('ioredis');var authService=require(_0xbae2('0x12'));var qs=require(_0xbae2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbae2('0x14'));var logger=require('../../config/logger')(_0xbae2('0x15'));var utils=require(_0xbae2('0x16'));var config=require(_0xbae2('0x17'));var licenseUtil=require(_0xbae2('0x18'));var db=require(_0xbae2('0x19'))['db'];function respondWithStatusCode(_0xedf0fd,_0x5dc52){_0x5dc52=_0x5dc52||0xcc;return function(_0x39795a){if(_0x39795a){return _0xedf0fd[_0xbae2('0x1a')](_0x5dc52);}return _0xedf0fd['status'](_0x5dc52)[_0xbae2('0x1b')]();};}function respondWithResult(_0x4874bb,_0x246e46){_0x246e46=_0x246e46||0xc8;return function(_0x4168d3){if(_0x4168d3){return _0x4874bb[_0xbae2('0x1c')](_0x246e46)[_0xbae2('0x1d')](_0x4168d3);}};}function respondWithFilteredResult(_0x53c578,_0x435a1b){return function(_0x198f59){if(_0x198f59){var _0x4bad02=typeof _0x435a1b[_0xbae2('0x1e')]===_0xbae2('0x1f')&&typeof _0x435a1b[_0xbae2('0x20')]===_0xbae2('0x1f');var _0x2c488c=_0x198f59[_0xbae2('0x21')];var _0x221047=_0x4bad02?0x0:_0x435a1b[_0xbae2('0x1e')];var _0x3d4075=_0x4bad02?_0x198f59[_0xbae2('0x21')]:_0x435a1b[_0xbae2('0x1e')]+_0x435a1b['limit'];var _0xa86fa3;if(_0x3d4075>=_0x2c488c){_0x3d4075=_0x2c488c;_0xa86fa3=0xc8;}else{_0xa86fa3=0xce;}_0x53c578['status'](_0xa86fa3);return _0x53c578[_0xbae2('0x22')](_0xbae2('0x23'),_0x221047+'-'+_0x3d4075+'/'+_0x2c488c)[_0xbae2('0x1d')](_0x198f59);}return null;};}function patchUpdates(_0x18ae4c){return function(_0x10604f){try{jsonpatch[_0xbae2('0x24')](_0x10604f,_0x18ae4c,!![]);}catch(_0x5e0756){return BPromise[_0xbae2('0x25')](_0x5e0756);}return _0x10604f[_0xbae2('0x26')]();};}function saveUpdates(_0x1a26c5,_0x517ec7){return function(_0x3307ab){if(_0x3307ab){return _0x3307ab[_0xbae2('0x27')](_0x1a26c5)[_0xbae2('0x28')](function(_0xaba272){return _0xaba272;});}return null;};}function removeEntity(_0x286958,_0x3fcc6e){return function(_0xdfda9c){if(_0xdfda9c){return _0xdfda9c[_0xbae2('0x29')]()[_0xbae2('0x28')](function(){_0x286958[_0xbae2('0x1c')](0xcc)[_0xbae2('0x1b')]();});}};}function handleEntityNotFound(_0x3ede2a,_0x522e59){return function(_0x39a52a){if(!_0x39a52a){_0x3ede2a[_0xbae2('0x1a')](0x194);}return _0x39a52a;};}function handleError(_0x2a0bfc,_0x589730){_0x589730=_0x589730||0x1f4;return function(_0x2b2dae){logger['error'](_0x2b2dae['stack']);if(_0x2b2dae[_0xbae2('0x2a')]){delete _0x2b2dae[_0xbae2('0x2a')];}_0x2a0bfc['status'](_0x589730)[_0xbae2('0x2b')](_0x2b2dae);};}exports[_0xbae2('0x2c')]=function(_0x129124,_0x42451d){var _0x12723f={},_0x1b11ee={},_0x542165={'count':0x0,'rows':[]};var _0x2c4208=_[_0xbae2('0x2d')](db[_0xbae2('0x2e')][_0xbae2('0x2f')],function(_0x22fe1e){return{'name':_0x22fe1e[_0xbae2('0x30')],'type':_0x22fe1e[_0xbae2('0x31')][_0xbae2('0x32')]};});_0x1b11ee['model']=_[_0xbae2('0x2d')](_0x2c4208,_0xbae2('0x2a'));_0x1b11ee[_0xbae2('0x33')]=_['keys'](_0x129124[_0xbae2('0x33')]);_0x1b11ee[_0xbae2('0x34')]=_[_0xbae2('0x35')](_0x1b11ee[_0xbae2('0x36')],_0x1b11ee[_0xbae2('0x33')]);_0x12723f[_0xbae2('0x37')]=_['intersection'](_0x1b11ee['model'],qs[_0xbae2('0x38')](_0x129124[_0xbae2('0x33')][_0xbae2('0x38')]));_0x12723f[_0xbae2('0x37')]=_0x12723f[_0xbae2('0x37')][_0xbae2('0x39')]?_0x12723f[_0xbae2('0x37')]:_0x1b11ee[_0xbae2('0x36')];if(!_0x129124[_0xbae2('0x33')]['hasOwnProperty'](_0xbae2('0x3a'))){_0x12723f[_0xbae2('0x20')]=qs[_0xbae2('0x20')](_0x129124['query']['limit']);_0x12723f[_0xbae2('0x1e')]=qs['offset'](_0x129124[_0xbae2('0x33')][_0xbae2('0x1e')]);}_0x12723f[_0xbae2('0x3b')]=qs[_0xbae2('0x3c')](_0x129124[_0xbae2('0x33')]['sort']);_0x12723f[_0xbae2('0x3d')]=qs[_0xbae2('0x34')](_[_0xbae2('0x3e')](_0x129124[_0xbae2('0x33')],_0x1b11ee['filters']),_0x2c4208);if(_0x129124['query']['filter']){_0x12723f[_0xbae2('0x3d')]=_['merge'](_0x12723f[_0xbae2('0x3d')],{'$or':_[_0xbae2('0x2d')](_0x2c4208,function(_0x4e8e66){if(_0x4e8e66['type']!==_0xbae2('0x3f')){var _0x121666={};_0x121666[_0x4e8e66['name']]={'$like':'%'+_0x129124[_0xbae2('0x33')][_0xbae2('0x40')]+'%'};return _0x121666;}})});}_0x12723f=_[_0xbae2('0x41')]({},_0x12723f,_0x129124[_0xbae2('0x42')]);var _0x593fdc={'where':_0x12723f[_0xbae2('0x3d')]};return db['SalesforceField'][_0xbae2('0x21')](_0x593fdc)[_0xbae2('0x28')](function(_0x2573a4){_0x542165['count']=_0x2573a4;if(_0x129124[_0xbae2('0x33')][_0xbae2('0x43')]){_0x12723f['include']=[{'all':!![]}];}return db[_0xbae2('0x2e')][_0xbae2('0x44')](_0x12723f);})[_0xbae2('0x28')](function(_0x77cf33){_0x542165[_0xbae2('0x45')]=_0x77cf33;return _0x542165;})[_0xbae2('0x28')](respondWithFilteredResult(_0x42451d,_0x12723f))[_0xbae2('0x46')](handleError(_0x42451d,null));};exports[_0xbae2('0x47')]=function(_0x593420,_0x2c4214){var _0x15c35d={'raw':!![],'where':{'id':_0x593420[_0xbae2('0x48')]['id']}},_0x84f988={};_0x84f988[_0xbae2('0x36')]=_[_0xbae2('0x49')](db[_0xbae2('0x2e')]['rawAttributes']);_0x84f988['query']=_[_0xbae2('0x49')](_0x593420[_0xbae2('0x33')]);_0x84f988[_0xbae2('0x34')]=_[_0xbae2('0x35')](_0x84f988[_0xbae2('0x36')],_0x84f988[_0xbae2('0x33')]);_0x15c35d[_0xbae2('0x37')]=_[_0xbae2('0x35')](_0x84f988[_0xbae2('0x36')],qs['fields'](_0x593420['query'][_0xbae2('0x38')]));_0x15c35d['attributes']=_0x15c35d[_0xbae2('0x37')]['length']?_0x15c35d[_0xbae2('0x37')]:_0x84f988[_0xbae2('0x36')];if(_0x593420[_0xbae2('0x33')]['includeAll']){_0x15c35d[_0xbae2('0x4a')]=[{'all':!![]}];}_0x15c35d=_[_0xbae2('0x41')]({},_0x15c35d,_0x593420['options']);return db['SalesforceField'][_0xbae2('0x4b')](_0x15c35d)[_0xbae2('0x28')](handleEntityNotFound(_0x2c4214,null))['then'](respondWithResult(_0x2c4214,null))['catch'](handleError(_0x2c4214,null));};exports[_0xbae2('0x4c')]=function(_0x28ec5b,_0x5e9ffa){return db[_0xbae2('0x2e')][_0xbae2('0x4c')](_0x28ec5b['body'],{})[_0xbae2('0x28')](respondWithResult(_0x5e9ffa,0xc9))[_0xbae2('0x46')](handleError(_0x5e9ffa,null));};exports['update']=function(_0x211845,_0x5750ae){if(_0x211845[_0xbae2('0x4d')]['id']){delete _0x211845['body']['id'];}return db[_0xbae2('0x2e')][_0xbae2('0x4b')]({'where':{'id':_0x211845[_0xbae2('0x48')]['id']}})[_0xbae2('0x28')](handleEntityNotFound(_0x5750ae,null))[_0xbae2('0x28')](saveUpdates(_0x211845[_0xbae2('0x4d')],null))['then'](respondWithResult(_0x5750ae,null))[_0xbae2('0x46')](handleError(_0x5750ae,null));};exports[_0xbae2('0x29')]=function(_0x581050,_0x2407d5){return db[_0xbae2('0x2e')][_0xbae2('0x4b')]({'where':{'id':_0x581050[_0xbae2('0x48')]['id']}})['then'](handleEntityNotFound(_0x2407d5,null))[_0xbae2('0x28')](removeEntity(_0x2407d5,null))[_0xbae2('0x46')](handleError(_0x2407d5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index ee9b78c..57a05f1 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 _0x8d2e=['SalesforceField','int_salesforce_fields','idField','lodash','util','api','moment','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d2e,0x6b));var _0xe8d2=function(_0x42145f,_0xc3da46){_0x42145f=_0x42145f-0x0;var _0x3f9619=_0x8d2e[_0x42145f];return _0x3f9619;};'use strict';var _=require(_0xe8d2('0x0'));var util=require(_0xe8d2('0x1'));var logger=require('../../config/logger')(_0xe8d2('0x2'));var moment=require(_0xe8d2('0x3'));var BPromise=require('bluebird');var rp=require(_0xe8d2('0x4'));var fs=require('fs');var path=require(_0xe8d2('0x5'));var rimraf=require(_0xe8d2('0x6'));var config=require('../../config/environment');var attributes=require(_0xe8d2('0x7'));module[_0xe8d2('0x8')]=function(_0x3416bf,_0x3c0814){return _0x3416bf[_0xe8d2('0x9')](_0xe8d2('0xa'),attributes,{'tableName':_0xe8d2('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xe8d2('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4787=['../../config/logger','api','bluebird','request-promise','rimraf','exports','define','SalesforceField','salesforce_unique_index','idField'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x4787,0x1ea));var _0x7478=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x4787[_0x266618];return _0x54dbf5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7478('0x0'))(_0x7478('0x1'));var moment=require('moment');var BPromise=require(_0x7478('0x2'));var rp=require(_0x7478('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7478('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x7478('0x5')]=function(_0x157bf7,_0x166ca5){return _0x157bf7[_0x7478('0x6')](_0x7478('0x7'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x7478('0x8'),'fields':[_0x7478('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 7cb1d52..16b8b30 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 _0xe332=['../../config/logger','rpc','../../config/environment','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','moment','bluebird','../../mysqldb'];(function(_0x4be3ec,_0x218441){var _0x44b79f=function(_0x56d3c1){while(--_0x56d3c1){_0x4be3ec['push'](_0x4be3ec['shift']());}};_0x44b79f(++_0x218441);}(_0xe332,0x18c));var _0x2e33=function(_0x294f75,_0x187720){_0x294f75=_0x294f75-0x0;var _0x2cbc9e=_0xe332[_0x294f75];return _0x2cbc9e;};'use strict';var _=require(_0x2e33('0x0'));var util=require('util');var moment=require(_0x2e33('0x1'));var BPromise=require(_0x2e33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e33('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e33('0x4'))(_0x2e33('0x5'));var config=require(_0x2e33('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e33('0x7')][_0x2e33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f6025,_0x3861cf,_0x2c32c4){return new BPromise(function(_0x9e0a2e,_0x24238f){return client[_0x2e33('0x9')](_0x4f6025,_0x2c32c4)[_0x2e33('0xa')](function(_0x285433){logger['info'](_0x2e33('0xb'),_0x3861cf,_0x2e33('0xc'));logger[_0x2e33('0xd')](_0x2e33('0xe'),_0x3861cf,'request\x20sent',JSON['stringify'](_0x285433));if(_0x285433['error']){if(_0x285433[_0x2e33('0xf')][_0x2e33('0x10')]===0x1f4){logger[_0x2e33('0xf')](_0x2e33('0xb'),_0x3861cf,_0x285433['error']['message']);return _0x24238f(_0x285433[_0x2e33('0xf')][_0x2e33('0x11')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x3861cf,_0x285433[_0x2e33('0xf')][_0x2e33('0x11')]);return _0x9e0a2e(_0x285433[_0x2e33('0xf')][_0x2e33('0x11')]);}else{logger[_0x2e33('0x12')]('SalesforceField,\x20%s,\x20%s',_0x3861cf,_0x2e33('0xc'));_0x9e0a2e(_0x285433['result'][_0x2e33('0x11')]);}})[_0x2e33('0x13')](function(_0x178805){logger[_0x2e33('0xf')]('SalesforceField,\x20%s,\x20%s',_0x3861cf,_0x178805);_0x24238f(_0x178805);});});} \ No newline at end of file +var _0xc5d3=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5d3,0xf5));var _0x3c5d=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xc5d3[_0x5216e0];return _0x5b3f40;};'use strict';var _=require(_0x3c5d('0x0'));var util=require(_0x3c5d('0x1'));var moment=require(_0x3c5d('0x2'));var BPromise=require(_0x3c5d('0x3'));var rs=require(_0x3c5d('0x4'));var fs=require('fs');var Redis=require(_0x3c5d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c5d('0x6'));var logger=require(_0x3c5d('0x7'))(_0x3c5d('0x8'));var config=require(_0x3c5d('0x9'));var jayson=require(_0x3c5d('0xa'));var client=jayson[_0x3c5d('0xb')][_0x3c5d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39c387,_0x4f3eff,_0x2da2a9){return new BPromise(function(_0x861237,_0x53323c){return client[_0x3c5d('0xd')](_0x39c387,_0x2da2a9)[_0x3c5d('0xe')](function(_0x45f35b){logger['info'](_0x3c5d('0xf'),_0x4f3eff,_0x3c5d('0x10'));logger[_0x3c5d('0x11')](_0x3c5d('0x12'),_0x4f3eff,_0x3c5d('0x10'),JSON[_0x3c5d('0x13')](_0x45f35b));if(_0x45f35b[_0x3c5d('0x14')]){if(_0x45f35b[_0x3c5d('0x14')][_0x3c5d('0x15')]===0x1f4){logger[_0x3c5d('0x14')](_0x3c5d('0xf'),_0x4f3eff,_0x45f35b[_0x3c5d('0x14')]['message']);return _0x53323c(_0x45f35b[_0x3c5d('0x14')][_0x3c5d('0x16')]);}logger[_0x3c5d('0x14')](_0x3c5d('0xf'),_0x4f3eff,_0x45f35b[_0x3c5d('0x14')][_0x3c5d('0x16')]);return _0x861237(_0x45f35b['error'][_0x3c5d('0x16')]);}else{logger['info'](_0x3c5d('0xf'),_0x4f3eff,_0x3c5d('0x10'));_0x861237(_0x45f35b[_0x3c5d('0x17')][_0x3c5d('0x16')]);}})[_0x3c5d('0x18')](function(_0xc8b773){logger[_0x3c5d('0x14')](_0x3c5d('0xf'),_0x4f3eff,_0xc8b773);_0x53323c(_0xc8b773);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 94070c1..b4bae61 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 _0x07c3=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x4e6fe3,_0x4375e6){var _0x44b03e=function(_0x485c9b){while(--_0x485c9b){_0x4e6fe3['push'](_0x4e6fe3['shift']());}};_0x44b03e(++_0x4375e6);}(_0x07c3,0x1bf));var _0x307c=function(_0x129a57,_0x330d03){_0x129a57=_0x129a57-0x0;var _0xa7147c=_0x07c3[_0x129a57];return _0xa7147c;};'use strict';var multer=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var path=require(_0x307c('0x2'));var timeout=require(_0x307c('0x3'));var express=require(_0x307c('0x4'));var router=express[_0x307c('0x5')]();var fs_extra=require(_0x307c('0x6'));var auth=require(_0x307c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x307c('0x8'));var controller=require(_0x307c('0x9'));router[_0x307c('0xa')]('/',auth[_0x307c('0xb')](),controller[_0x307c('0xc')]);router[_0x307c('0xa')](_0x307c('0xd'),auth[_0x307c('0xb')](),controller[_0x307c('0xe')]);router[_0x307c('0xa')](_0x307c('0xf'),auth[_0x307c('0xb')](),controller[_0x307c('0x10')]);router[_0x307c('0xa')](_0x307c('0x11'),auth['isAuthenticated'](),controller[_0x307c('0x12')]);router[_0x307c('0x13')]('/',auth[_0x307c('0xb')](),controller[_0x307c('0x14')]);router['post']('/:id/configurations',auth[_0x307c('0xb')](),controller['addConfiguration']);router[_0x307c('0x15')](_0x307c('0xd'),auth['isAuthenticated'](),controller[_0x307c('0x16')]);router[_0x307c('0x17')](_0x307c('0xd'),auth[_0x307c('0xb')](),controller[_0x307c('0x18')]);module[_0x307c('0x19')]=router; \ No newline at end of file +var _0xdfe9=['show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x439d6a,_0x349f50){var _0x766aef=function(_0x5a3a0d){while(--_0x5a3a0d){_0x439d6a['push'](_0x439d6a['shift']());}};_0x766aef(++_0x349f50);}(_0xdfe9,0xc3));var _0x9dfe=function(_0x30154f,_0x105213){_0x30154f=_0x30154f-0x0;var _0x22faed=_0xdfe9[_0x30154f];return _0x22faed;};'use strict';var multer=require(_0x9dfe('0x0'));var util=require('util');var path=require(_0x9dfe('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dfe('0x2')]();var fs_extra=require(_0x9dfe('0x3'));var auth=require(_0x9dfe('0x4'));var interaction=require(_0x9dfe('0x5'));var config=require(_0x9dfe('0x6'));var controller=require(_0x9dfe('0x7'));router[_0x9dfe('0x8')]('/',auth[_0x9dfe('0x9')](),controller[_0x9dfe('0xa')]);router[_0x9dfe('0x8')](_0x9dfe('0xb'),auth['isAuthenticated'](),controller[_0x9dfe('0xc')]);router[_0x9dfe('0x8')](_0x9dfe('0xd'),auth[_0x9dfe('0x9')](),controller[_0x9dfe('0xe')]);router[_0x9dfe('0x8')](_0x9dfe('0xf'),auth[_0x9dfe('0x9')](),controller['getFields']);router[_0x9dfe('0x10')]('/',auth[_0x9dfe('0x9')](),controller[_0x9dfe('0x11')]);router[_0x9dfe('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9dfe('0x12')]);router[_0x9dfe('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9dfe('0x14')](_0x9dfe('0xb'),auth[_0x9dfe('0x9')](),controller[_0x9dfe('0x15')]);module[_0x9dfe('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index bb9eb21..89a2199 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 _0xe578=['exports','STRING','username','remoteUri','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe578,0x95));var _0x8e57=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe578[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x8e57('0x0'));module[_0x8e57('0x1')]={'name':{'type':Sequelize[_0x8e57('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8e57('0x2')],'unique':_0x8e57('0x3')},'password':{'type':Sequelize[_0x8e57('0x2')]},'email':{'type':Sequelize[_0x8e57('0x2')]},'remoteUri':{'type':Sequelize[_0x8e57('0x2')],'unique':_0x8e57('0x4')},'serverUrl':{'type':Sequelize[_0x8e57('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x9d88=['username','remoteUri','sequelize','exports','STRING'];(function(_0x19d0e0,_0x15fd48){var _0x4b9a0a=function(_0x38a82a){while(--_0x38a82a){_0x19d0e0['push'](_0x19d0e0['shift']());}};_0x4b9a0a(++_0x15fd48);}(_0x9d88,0x1ec));var _0x89d8=function(_0x3693d8,_0x3c97bf){_0x3693d8=_0x3693d8-0x0;var _0x45a5fe=_0x9d88[_0x3693d8];return _0x45a5fe;};'use strict';var Sequelize=require(_0x89d8('0x0'));module[_0x89d8('0x1')]={'name':{'type':Sequelize[_0x89d8('0x2')]},'description':{'type':Sequelize[_0x89d8('0x2')]},'username':{'type':Sequelize[_0x89d8('0x2')],'unique':_0x89d8('0x3')},'password':{'type':Sequelize[_0x89d8('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x89d8('0x2')],'unique':_0x89d8('0x4')},'serverUrl':{'type':Sequelize[_0x89d8('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 147e9a6..9b44a59 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 _0x4793=['find','create','body','params','getConfigurations','findOne','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','category','parent','caused_by','watch_list','upon_reject','child_incidents','number','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','reopened_time','resolved_at','caller_id','work_notes','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','problem_id','reassignment_count','assigned_to','severity','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','label','push','all','internalType','concat','test','statusCode','error','Wrong\x20credentials','boolean','True','true','False','false','value','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','ServicenowAccount','catch','show','rawAttributes','includeAll','include'];(function(_0x5df9e9,_0xc5717f){var _0x55a6ae=function(_0x3f4b2b){while(--_0x3f4b2b){_0x5df9e9['push'](_0x5df9e9['shift']());}};_0x55a6ae(++_0xc5717f);}(_0x4793,0x1e6));var _0x3479=function(_0x2e9ce5,_0x156a53){_0x2e9ce5=_0x2e9ce5-0x0;var _0x2f2e01=_0x4793[_0x2e9ce5];return _0x2f2e01;};'use strict';var emlformat=require(_0x3479('0x0'));var rimraf=require(_0x3479('0x1'));var zipdir=require(_0x3479('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3479('0x3'));var Mustache=require(_0x3479('0x4'));var util=require(_0x3479('0x5'));var path=require(_0x3479('0x6'));var sox=require('sox');var csv=require(_0x3479('0x7'));var ejs=require(_0x3479('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3479('0x9'));var crypto=require('crypto');var jsforce=require(_0x3479('0xa'));var deskjs=require(_0x3479('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3479('0xc'));var Papa=require(_0x3479('0xd'));var Redis=require(_0x3479('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3479('0xf'));var as=require(_0x3479('0x10'));var hardwareService=require(_0x3479('0x11'));var logger=require('../../config/logger')(_0x3479('0x12'));var utils=require(_0x3479('0x13'));var config=require(_0x3479('0x14'));var licenseUtil=require(_0x3479('0x15'));var db=require(_0x3479('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5052a5,_0x55258a){_0x55258a=_0x55258a||0xcc;return function(_0x4fbf42){if(_0x4fbf42){return _0x5052a5['sendStatus'](_0x55258a);}return _0x5052a5[_0x3479('0x17')](_0x55258a)[_0x3479('0x18')]();};}function respondWithResult(_0x1ad86b,_0x260690){_0x260690=_0x260690||0xc8;return function(_0x204b3e){if(_0x204b3e){return _0x1ad86b[_0x3479('0x17')](_0x260690)[_0x3479('0x19')](_0x204b3e);}};}function respondWithFilteredResult(_0x1c81c6,_0x1782be){return function(_0x57a831){if(_0x57a831){var _0x3f170f=typeof _0x1782be['offset']==='undefined'&&typeof _0x1782be[_0x3479('0x1a')]===_0x3479('0x1b');var _0xe26601=_0x57a831['count'];var _0x1f4dbc=_0x3f170f?0x0:_0x1782be[_0x3479('0x1c')];var _0x5e3bec=_0x3f170f?_0x57a831[_0x3479('0x1d')]:_0x1782be['offset']+_0x1782be[_0x3479('0x1a')];var _0x4eed89;if(_0x5e3bec>=_0xe26601){_0x5e3bec=_0xe26601;_0x4eed89=0xc8;}else{_0x4eed89=0xce;}_0x1c81c6['status'](_0x4eed89);return _0x1c81c6[_0x3479('0x1e')](_0x3479('0x1f'),_0x1f4dbc+'-'+_0x5e3bec+'/'+_0xe26601)['json'](_0x57a831);}return null;};}function patchUpdates(_0x2328f6){return function(_0x224a09){try{jsonpatch[_0x3479('0x20')](_0x224a09,_0x2328f6,!![]);}catch(_0xc157cb){return BPromise[_0x3479('0x21')](_0xc157cb);}return _0x224a09[_0x3479('0x22')]();};}function saveUpdates(_0x3b05b0,_0x65696f){return function(_0x37238a){if(_0x37238a){return _0x37238a[_0x3479('0x23')](_0x3b05b0)[_0x3479('0x24')](function(_0x348963){return _0x348963;});}return null;};}function removeEntity(_0x51ac71,_0x43f9ea){return function(_0x202982){if(_0x202982){return _0x202982[_0x3479('0x25')]()[_0x3479('0x24')](function(){_0x51ac71['status'](0xcc)[_0x3479('0x18')]();});}};}function handleEntityNotFound(_0x534f1c,_0x2d9afe){return function(_0x31f2a3){if(!_0x31f2a3){_0x534f1c[_0x3479('0x26')](0x194);}return _0x31f2a3;};}function handleError(_0x4ad232,_0x30ba9e){_0x30ba9e=_0x30ba9e||0x1f4;return function(_0x202134){logger['error'](_0x202134[_0x3479('0x27')]);if(_0x202134[_0x3479('0x28')]){delete _0x202134['name'];}_0x4ad232[_0x3479('0x17')](_0x30ba9e)[_0x3479('0x29')](_0x202134);};}exports[_0x3479('0x2a')]=function(_0x24694e,_0x192204){var _0xcf8070={},_0x4173d9={},_0x370da1={'count':0x0,'rows':[]};var _0x10f39b=_['map'](db['ServicenowAccount']['rawAttributes'],function(_0x1baa96){return{'name':_0x1baa96[_0x3479('0x2b')],'type':_0x1baa96['type'][_0x3479('0x2c')]};});_0x4173d9['model']=_[_0x3479('0x2d')](_0x10f39b,_0x3479('0x28'));_0x4173d9[_0x3479('0x2e')]=_[_0x3479('0x2f')](_0x24694e[_0x3479('0x2e')]);_0x4173d9[_0x3479('0x30')]=_[_0x3479('0x31')](_0x4173d9[_0x3479('0x32')],_0x4173d9[_0x3479('0x2e')]);_0xcf8070[_0x3479('0x33')]=_[_0x3479('0x31')](_0x4173d9[_0x3479('0x32')],qs[_0x3479('0x34')](_0x24694e[_0x3479('0x2e')]['fields']));_0xcf8070[_0x3479('0x33')]=_0xcf8070[_0x3479('0x33')][_0x3479('0x35')]?_0xcf8070[_0x3479('0x33')]:_0x4173d9[_0x3479('0x32')];if(!_0x24694e[_0x3479('0x2e')][_0x3479('0x36')]('nolimit')){_0xcf8070['limit']=qs[_0x3479('0x1a')](_0x24694e['query'][_0x3479('0x1a')]);_0xcf8070['offset']=qs[_0x3479('0x1c')](_0x24694e[_0x3479('0x2e')][_0x3479('0x1c')]);}_0xcf8070[_0x3479('0x37')]=qs[_0x3479('0x38')](_0x24694e[_0x3479('0x2e')]['sort']);_0xcf8070[_0x3479('0x39')]=qs[_0x3479('0x30')](_['pick'](_0x24694e[_0x3479('0x2e')],_0x4173d9[_0x3479('0x30')]),_0x10f39b);if(_0x24694e['query'][_0x3479('0x3a')]){_0xcf8070[_0x3479('0x39')]=_[_0x3479('0x3b')](_0xcf8070[_0x3479('0x39')],{'$or':_[_0x3479('0x2d')](_0x10f39b,function(_0x1d2fc5){if(_0x1d2fc5[_0x3479('0x3c')]!==_0x3479('0x3d')){var _0x3a737c={};_0x3a737c[_0x1d2fc5[_0x3479('0x28')]]={'$like':'%'+_0x24694e[_0x3479('0x2e')][_0x3479('0x3a')]+'%'};return _0x3a737c;}})});}_0xcf8070=_[_0x3479('0x3b')]({},_0xcf8070,_0x24694e[_0x3479('0x3e')]);var _0x4df333={'where':_0xcf8070['where']};return db[_0x3479('0x3f')][_0x3479('0x1d')](_0x4df333)[_0x3479('0x24')](function(_0x294f5b){_0x370da1[_0x3479('0x1d')]=_0x294f5b;if(_0x24694e[_0x3479('0x2e')]['includeAll']){_0xcf8070['include']=[{'all':!![]}];}return db[_0x3479('0x3f')]['findAll'](_0xcf8070);})[_0x3479('0x24')](function(_0x438cca){_0x370da1['rows']=_0x438cca;return _0x370da1;})[_0x3479('0x24')](respondWithFilteredResult(_0x192204,_0xcf8070))[_0x3479('0x40')](handleError(_0x192204,null));};exports[_0x3479('0x41')]=function(_0x4eefb2,_0x4966a7){var _0x381705={'raw':![],'where':{'id':_0x4eefb2['params']['id']}},_0xe37af0={};_0xe37af0['model']=_[_0x3479('0x2f')](db[_0x3479('0x3f')][_0x3479('0x42')]);_0xe37af0['query']=_[_0x3479('0x2f')](_0x4eefb2['query']);_0xe37af0[_0x3479('0x30')]=_[_0x3479('0x31')](_0xe37af0['model'],_0xe37af0[_0x3479('0x2e')]);_0x381705[_0x3479('0x33')]=_[_0x3479('0x31')](_0xe37af0[_0x3479('0x32')],qs[_0x3479('0x34')](_0x4eefb2['query'][_0x3479('0x34')]));_0x381705[_0x3479('0x33')]=_0x381705['attributes'][_0x3479('0x35')]?_0x381705['attributes']:_0xe37af0[_0x3479('0x32')];if(_0x4eefb2[_0x3479('0x2e')][_0x3479('0x43')]){_0x381705[_0x3479('0x44')]=[{'all':!![]}];}_0x381705=_[_0x3479('0x3b')]({},_0x381705,_0x4eefb2[_0x3479('0x3e')]);return db[_0x3479('0x3f')][_0x3479('0x45')](_0x381705)[_0x3479('0x24')](handleEntityNotFound(_0x4966a7,null))[_0x3479('0x24')](respondWithResult(_0x4966a7,null))[_0x3479('0x40')](handleError(_0x4966a7,null));};exports[_0x3479('0x46')]=function(_0x53238d,_0x2064e8){return db[_0x3479('0x3f')][_0x3479('0x46')](_0x53238d[_0x3479('0x47')],{})[_0x3479('0x24')](respondWithResult(_0x2064e8,0xc9))[_0x3479('0x40')](handleError(_0x2064e8,null));};exports[_0x3479('0x23')]=function(_0x559bd8,_0x306cb9){if(_0x559bd8[_0x3479('0x47')]['id']){delete _0x559bd8[_0x3479('0x47')]['id'];}return db[_0x3479('0x3f')][_0x3479('0x45')]({'where':{'id':_0x559bd8[_0x3479('0x48')]['id']}})[_0x3479('0x24')](handleEntityNotFound(_0x306cb9,null))['then'](saveUpdates(_0x559bd8['body'],null))[_0x3479('0x24')](respondWithResult(_0x306cb9,null))[_0x3479('0x40')](handleError(_0x306cb9,null));};exports[_0x3479('0x25')]=function(_0x1daa4b,_0x3b58a1){return db[_0x3479('0x3f')][_0x3479('0x45')]({'where':{'id':_0x1daa4b[_0x3479('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b58a1,null))[_0x3479('0x24')](removeEntity(_0x3b58a1,null))[_0x3479('0x40')](handleError(_0x3b58a1,null));};exports[_0x3479('0x49')]=function(_0x376108,_0x5a27d1,_0x5b7e8b){var _0x1e8327={};var _0x47cc22={};var _0x3e6eb6;var _0x47e4de;return db[_0x3479('0x3f')][_0x3479('0x4a')]({'where':{'id':_0x376108[_0x3479('0x48')]['id']}})[_0x3479('0x24')](handleEntityNotFound(_0x5a27d1,null))[_0x3479('0x24')](function(_0x49c2e7){if(_0x49c2e7){_0x3e6eb6=_0x49c2e7;_0x47cc22['model']=_[_0x3479('0x2f')](db['ServicenowConfiguration'][_0x3479('0x42')]);_0x47cc22[_0x3479('0x2e')]=_[_0x3479('0x2f')](_0x376108[_0x3479('0x2e')]);_0x47cc22[_0x3479('0x30')]=_[_0x3479('0x31')](_0x47cc22[_0x3479('0x32')],_0x47cc22['query']);_0x1e8327[_0x3479('0x33')]=_[_0x3479('0x31')](_0x47cc22[_0x3479('0x32')],qs[_0x3479('0x34')](_0x376108[_0x3479('0x2e')][_0x3479('0x34')]));_0x1e8327['attributes']=_0x1e8327[_0x3479('0x33')]['length']?_0x1e8327[_0x3479('0x33')]:_0x47cc22['model'];_0x1e8327['order']=qs[_0x3479('0x38')](_0x376108[_0x3479('0x2e')][_0x3479('0x38')]);_0x1e8327[_0x3479('0x39')]=qs[_0x3479('0x30')](_[_0x3479('0x4b')](_0x376108[_0x3479('0x2e')],_0x47cc22[_0x3479('0x30')]));if(_0x376108[_0x3479('0x2e')]['filter']){_0x1e8327[_0x3479('0x39')]=_['merge'](_0x1e8327[_0x3479('0x39')],{'$or':_[_0x3479('0x2d')](_0x1e8327[_0x3479('0x33')],function(_0x3d9a0d){var _0x41a923={};_0x41a923[_0x3d9a0d]={'$like':'%'+_0x376108[_0x3479('0x2e')][_0x3479('0x3a')]+'%'};return _0x41a923;})});}_0x1e8327=_[_0x3479('0x3b')]({},_0x1e8327,_0x376108[_0x3479('0x3e')]);return _0x3e6eb6[_0x3479('0x49')](_0x1e8327);}})['then'](function(_0x56780f){if(_0x56780f){_0x47e4de=_0x56780f[_0x3479('0x35')];if(!_0x376108['query'][_0x3479('0x36')](_0x3479('0x4c'))){_0x1e8327[_0x3479('0x1a')]=qs['limit'](_0x376108[_0x3479('0x2e')][_0x3479('0x1a')]);_0x1e8327['offset']=qs['offset'](_0x376108[_0x3479('0x2e')]['offset']);}return _0x3e6eb6['getConfigurations'](_0x1e8327);}})['then'](function(_0x48dc6d){if(_0x48dc6d){return _0x48dc6d?{'count':_0x47e4de,'rows':_0x48dc6d}:null;}})[_0x3479('0x24')](respondWithResult(_0x5a27d1,null))['catch'](handleError(_0x5a27d1,null));};exports[_0x3479('0x4d')]=function(_0x5ef8f0,_0x1d9277,_0x49e1c1){if(_0x5ef8f0[_0x3479('0x47')]['id']){delete _0x5ef8f0[_0x3479('0x47')]['id'];}return db['ServicenowAccount'][_0x3479('0x4a')]({'where':{'id':_0x5ef8f0[_0x3479('0x48')]['id']}})[_0x3479('0x24')](handleEntityNotFound(_0x1d9277,null))[_0x3479('0x24')](function(_0x1980ce){if(_0x1980ce){_0x5ef8f0[_0x3479('0x47')][_0x3479('0x4e')]=_0x1980ce['id'];_0x5ef8f0[_0x3479('0x47')][_0x3479('0x4f')]=integrations[_0x3479('0x50')](_0x5ef8f0['body']['channel'],_0x5ef8f0[_0x3479('0x47')][_0x3479('0x3c')]);_0x5ef8f0[_0x3479('0x47')][_0x3479('0x51')]=integrations[_0x3479('0x52')](_0x5ef8f0[_0x3479('0x47')][_0x3479('0x53')],_0x5ef8f0[_0x3479('0x47')][_0x3479('0x3c')]);return db['ServicenowConfiguration'][_0x3479('0x46')](_0x5ef8f0[_0x3479('0x47')],{'include':[{'model':db[_0x3479('0x54')],'as':_0x3479('0x4f')},{'model':db[_0x3479('0x54')],'as':_0x3479('0x51')}]});}return null;})[_0x3479('0x24')](respondWithResult(_0x1d9277,null))[_0x3479('0x40')](handleError(_0x1d9277,null));};exports[_0x3479('0x55')]=function(_0x4051b7,_0xdd88d2,_0x5cb8c7){var _0x51229a=[_0x3479('0x56'),_0x3479('0x57'),_0x3479('0x58'),_0x3479('0x59'),_0x3479('0x5a'),'notify','incident_state','severity',_0x3479('0x5b')];var _0x247743=[_0x3479('0x5c'),'made_sla',_0x3479('0x5d'),_0x3479('0x5e'),_0x3479('0x5f'),'sys_updated_on',_0x3479('0x60'),_0x3479('0x57'),'approval_history',_0x3479('0x61'),'resolved_by','sys_updated_by',_0x3479('0x62'),_0x3479('0x63'),_0x3479('0x64'),_0x3479('0x65'),_0x3479('0x66'),_0x3479('0x67'),_0x3479('0x58'),'order',_0x3479('0x68'),'closed_at',_0x3479('0x69'),_0x3479('0x6a'),_0x3479('0x6b'),_0x3479('0x6c'),'work_notes_list',_0x3479('0x6d'),_0x3479('0x6e'),_0x3479('0x6f'),_0x3479('0x70'),_0x3479('0x71'),_0x3479('0x72'),_0x3479('0x73'),_0x3479('0x74'),'group_list','work_end',_0x3479('0x75'),_0x3479('0x76'),_0x3479('0x77'),'approval_set','subcategory',_0x3479('0x78'),'short_description',_0x3479('0x5a'),_0x3479('0x79'),'delivery_task',_0x3479('0x7a'),_0x3479('0x7b'),_0x3479('0x7c'),_0x3479('0x7d'),'description','calendar_duration',_0x3479('0x7e'),_0x3479('0x7f'),_0x3479('0x80'),_0x3479('0x81'),_0x3479('0x82'),_0x3479('0x83'),_0x3479('0x84'),_0x3479('0x85'),_0x3479('0x86'),_0x3479('0x87'),'urgency',_0x3479('0x88'),'company',_0x3479('0x89'),'activity_due',_0x3479('0x8a'),_0x3479('0x8b'),'comments',_0x3479('0x8c'),_0x3479('0x8d'),_0x3479('0x8e'),_0x3479('0x8f'),_0x3479('0x90'),_0x3479('0x91'),_0x3479('0x92'),_0x3479('0x93'),_0x3479('0x94'),_0x3479('0x95'),_0x3479('0x96'),'category'];var _0x4d50d6='';var _0x57e0d1='';var _0x48c16b=[];var _0x168c1d='';var _0x3c88bd='';var _0x3ba86b=[];var _0x48aed9='';var _0x1b5f4b='';var _0x3da9b1={};var _0x11839f='';return db[_0x3479('0x3f')][_0x3479('0x4a')]({'where':{'id':_0x4051b7['params']['id']},'attributes':['id',_0x3479('0x97'),_0x3479('0x98'),_0x3479('0x99'),_0x3479('0x9a'),_0x3479('0x9b')]})[_0x3479('0x24')](handleEntityNotFound(_0xdd88d2,null))[_0x3479('0x24')](function(_0x230515){if(_0x230515){_0x11839f=_0x230515[_0x3479('0x9a')];var _0xfae213=_0x11839f[_0x3479('0x9c')](-0x1);if(_0xfae213==='/'){_0x11839f=_0x11839f[_0x3479('0x9d')](0x0,_0x11839f[_0x3479('0x9e')](_0xfae213));}_0x1b5f4b=util[_0x3479('0x9f')](_0x3479('0xa0'),_0x11839f);_0x48aed9=util[_0x3479('0x9f')](_0x3479('0xa1'),_0x11839f);_0x3da9b1={'user':_0x230515[_0x3479('0x97')],'pass':_0x230515[_0x3479('0x98')]};var _0x12f3dc={'method':_0x3479('0xa2'),'uri':_0x1b5f4b+_0x3479('0xa3'),'auth':_0x3da9b1,'json':!![]};return rp(_0x12f3dc);}})['then'](function(_0x1f8b73){if(_0x1f8b73[_0x3479('0xa4')][_0x3479('0x35')]>0x0){_0x4d50d6=_0x1f8b73[_0x3479('0xa4')];}console[_0x3479('0xa5')]('incident\x20table\x20objects',_0x4d50d6);_0x3ba86b=[];_0x57e0d1=Object[_0x3479('0xa6')]([],_0x4d50d6);_[_0x3479('0xa7')](_0x57e0d1,function(_0x22a163){return!_0x51229a[_0x3479('0xa8')](_0x22a163['name']);});_0x57e0d1[_0x3479('0xa9')](function(_0x1d06e4){var _0x43a6e8=createFieldObject(_0x48aed9,_0x3da9b1,_0x1d06e4['internalType'],_0x1d06e4['name'],_0x1d06e4[_0x3479('0xaa')],![]);_0x3ba86b[_0x3479('0xab')](_0x43a6e8);});return Promise[_0x3479('0xac')](_0x3ba86b);})[_0x3479('0x24')](function(_0x428111){_0x48c16b=_0x428111;_0x168c1d=Object[_0x3479('0xa6')]([],_0x4d50d6);console['log']('TCL:\x20_object',_0x4d50d6);_[_0x3479('0xa7')](_0x168c1d,function(_0x120958){return _0x247743[_0x3479('0xa8')](_0x120958[_0x3479('0x28')]);});console[_0x3479('0xa5')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x168c1d);_0x3ba86b=[];_0x168c1d[_0x3479('0xa9')](function(_0x27f03b){var _0xac27a=createFieldObject(_0x48aed9,_0x3da9b1,_0x27f03b[_0x3479('0xad')],_0x27f03b[_0x3479('0x28')],_0x27f03b[_0x3479('0xaa')],!![]);_0x3ba86b['push'](_0xac27a);});return Promise[_0x3479('0xac')](_0x3ba86b);})['then'](function(_0x3bf418){_0x3c88bd=_0x3bf418;var _0x41bf60=_0x48c16b[_0x3479('0xae')](_0x3c88bd);return{'count':_0x41bf60[_0x3479('0x35')],'rows':_0x41bf60};})[_0x3479('0x24')](respondWithResult(_0xdd88d2,null))['catch'](function(_0x37e97a){console[_0x3479('0xa5')]('ServiceNow\x20error:\x20'+_0x37e97a);var _0x5706a2=_0x4051b7[_0x3479('0x2e')][_0x3479('0xaf')]?0x1f4:_0x37e97a[_0x3479('0xb0')]||0x1f4;logger[_0x3479('0xb1')](_0x37e97a[_0x3479('0x27')]);delete _0x37e97a[_0x3479('0x28')];if(_0x5706a2===0x191){_0x5706a2=0x190;}_0xdd88d2['status'](_0x5706a2)['send'](_0x4051b7[_0x3479('0x2e')][_0x3479('0xaf')]?{'message':_0x3479('0xb2'),'statusCode':_0x37e97a['statusCode']}:_0x37e97a);});};function createFieldObject(_0x53cd7e,_0x5e002d,_0x37fa40,_0x3435b1,_0x25c86a,_0x3cca9f){return new Promise(function(_0x9f0aa,_0x4db016){var _0x52503b={'id':_0x3435b1,'name':_0x25c86a,'custom':_0x3cca9f};if(_0x37fa40===_0x3479('0xb3')){_0x52503b[_0x3479('0x3e')]=[{'name':_0x3479('0xb4'),'value':_0x3479('0xb5')},{'name':_0x3479('0xb6'),'value':_0x3479('0xb7')}];_0x9f0aa(_0x52503b);}else{var _0xe3f8c6={'method':_0x3479('0xa2'),'uri':_0x53cd7e+'sys_choice?sysparm_query=name=incident^element='+_0x3435b1,'auth':_0x5e002d,'json':!![]};return rp(_0xe3f8c6)[_0x3479('0x24')](function(_0xb103b4){var _0x23c142=[];if(_0xb103b4[_0x3479('0xa4')][_0x3479('0x35')]>0x0){_0xb103b4[_0x3479('0xa4')][_0x3479('0xa9')](function(_0x299af6){if(_0x299af6['inactive']===_0x3479('0xb7')){var _0x4d64ef={'name':_0x299af6[_0x3479('0xaa')],'value':_0x299af6[_0x3479('0xb8')]};_0x23c142[_0x3479('0xab')](_0x4d64ef);}});}_0x52503b[_0x3479('0x3e')]=_0x23c142;if(_0x52503b['options']['length']>0x0){_0x9f0aa(_0x52503b);}else{if(_0x3cca9f==![]){_0x9f0aa();}else{_0x9f0aa(_0x52503b);}}});}});} \ No newline at end of file +var _0x6e43=['sox','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','findAll','rows','show','includeAll','find','catch','create','body','params','getConfigurations','findOne','ServicenowConfiguration','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','caused_by','upon_reject','child_incidents','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','sys_class_name','close_notes','parent_incident','sys_id','contact_type','reopened_by','company','reassignment_count','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','upon_approval','correlation_id','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','result','assign','includes','internalType','label','all','log','TCL:\x20_object','remove','push','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x416aad,_0x144244){var _0x15fc82=function(_0x33994d){while(--_0x33994d){_0x416aad['push'](_0x416aad['shift']());}};_0x15fc82(++_0x144244);}(_0x6e43,0xaf));var _0x36e4=function(_0xeab20e,_0x1b62ec){_0xeab20e=_0xeab20e-0x0;var _0x3b78f0=_0x6e43[_0xeab20e];return _0x3b78f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36e4('0x0'));var zipdir=require(_0x36e4('0x1'));var jsonpatch=require(_0x36e4('0x2'));var rp=require(_0x36e4('0x3'));var moment=require(_0x36e4('0x4'));var BPromise=require(_0x36e4('0x5'));var Mustache=require(_0x36e4('0x6'));var util=require(_0x36e4('0x7'));var path=require(_0x36e4('0x8'));var sox=require(_0x36e4('0x9'));var csv=require('to-csv');var ejs=require(_0x36e4('0xa'));var fs=require('fs');var fs_extra=require(_0x36e4('0xb'));var _=require(_0x36e4('0xc'));var squel=require(_0x36e4('0xd'));var crypto=require('crypto');var jsforce=require(_0x36e4('0xe'));var deskjs=require(_0x36e4('0xf'));var toCsv=require(_0x36e4('0x10'));var querystring=require(_0x36e4('0x11'));var Papa=require(_0x36e4('0x12'));var Redis=require(_0x36e4('0x13'));var authService=require(_0x36e4('0x14'));var qs=require(_0x36e4('0x15'));var as=require(_0x36e4('0x16'));var hardwareService=require(_0x36e4('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x36e4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x36e4('0x19'));var db=require(_0x36e4('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3ddb18,_0x423ace){_0x423ace=_0x423ace||0xcc;return function(_0x568de0){if(_0x568de0){return _0x3ddb18[_0x36e4('0x1b')](_0x423ace);}return _0x3ddb18['status'](_0x423ace)[_0x36e4('0x1c')]();};}function respondWithResult(_0x20f32b,_0x327868){_0x327868=_0x327868||0xc8;return function(_0x216758){if(_0x216758){return _0x20f32b[_0x36e4('0x1d')](_0x327868)['json'](_0x216758);}};}function respondWithFilteredResult(_0x4089ff,_0x4c07fa){return function(_0x2cccc9){if(_0x2cccc9){var _0x38922d=typeof _0x4c07fa[_0x36e4('0x1e')]==='undefined'&&typeof _0x4c07fa[_0x36e4('0x1f')]==='undefined';var _0x449102=_0x2cccc9[_0x36e4('0x20')];var _0x609899=_0x38922d?0x0:_0x4c07fa[_0x36e4('0x1e')];var _0x36afaa=_0x38922d?_0x2cccc9[_0x36e4('0x20')]:_0x4c07fa[_0x36e4('0x1e')]+_0x4c07fa[_0x36e4('0x1f')];var _0x3f334c;if(_0x36afaa>=_0x449102){_0x36afaa=_0x449102;_0x3f334c=0xc8;}else{_0x3f334c=0xce;}_0x4089ff['status'](_0x3f334c);return _0x4089ff['set'](_0x36e4('0x21'),_0x609899+'-'+_0x36afaa+'/'+_0x449102)[_0x36e4('0x22')](_0x2cccc9);}return null;};}function patchUpdates(_0x2b156e){return function(_0x1a14fa){try{jsonpatch[_0x36e4('0x23')](_0x1a14fa,_0x2b156e,!![]);}catch(_0x3a20c5){return BPromise['reject'](_0x3a20c5);}return _0x1a14fa[_0x36e4('0x24')]();};}function saveUpdates(_0x286424,_0x5374d2){return function(_0x31c810){if(_0x31c810){return _0x31c810['update'](_0x286424)[_0x36e4('0x25')](function(_0x245f70){return _0x245f70;});}return null;};}function removeEntity(_0x4a38dc,_0x55ca26){return function(_0x29de0c){if(_0x29de0c){return _0x29de0c[_0x36e4('0x26')]()[_0x36e4('0x25')](function(){_0x4a38dc['status'](0xcc)[_0x36e4('0x1c')]();});}};}function handleEntityNotFound(_0x5241fe,_0x3dedf1){return function(_0x22f0fa){if(!_0x22f0fa){_0x5241fe[_0x36e4('0x1b')](0x194);}return _0x22f0fa;};}function handleError(_0x1c2277,_0x297638){_0x297638=_0x297638||0x1f4;return function(_0x49b48f){logger[_0x36e4('0x27')](_0x49b48f[_0x36e4('0x28')]);if(_0x49b48f[_0x36e4('0x29')]){delete _0x49b48f[_0x36e4('0x29')];}_0x1c2277[_0x36e4('0x1d')](_0x297638)[_0x36e4('0x2a')](_0x49b48f);};}exports[_0x36e4('0x2b')]=function(_0x89b87a,_0x2b5c60){var _0x3a1cdb={},_0xce6447={},_0x248ece={'count':0x0,'rows':[]};var _0x256031=_[_0x36e4('0x2c')](db[_0x36e4('0x2d')][_0x36e4('0x2e')],function(_0x381f6a){return{'name':_0x381f6a[_0x36e4('0x2f')],'type':_0x381f6a[_0x36e4('0x30')][_0x36e4('0x31')]};});_0xce6447[_0x36e4('0x32')]=_['map'](_0x256031,_0x36e4('0x29'));_0xce6447[_0x36e4('0x33')]=_[_0x36e4('0x34')](_0x89b87a[_0x36e4('0x33')]);_0xce6447[_0x36e4('0x35')]=_[_0x36e4('0x36')](_0xce6447[_0x36e4('0x32')],_0xce6447['query']);_0x3a1cdb[_0x36e4('0x37')]=_[_0x36e4('0x36')](_0xce6447[_0x36e4('0x32')],qs[_0x36e4('0x38')](_0x89b87a[_0x36e4('0x33')][_0x36e4('0x38')]));_0x3a1cdb[_0x36e4('0x37')]=_0x3a1cdb['attributes'][_0x36e4('0x39')]?_0x3a1cdb[_0x36e4('0x37')]:_0xce6447[_0x36e4('0x32')];if(!_0x89b87a[_0x36e4('0x33')][_0x36e4('0x3a')](_0x36e4('0x3b'))){_0x3a1cdb[_0x36e4('0x1f')]=qs[_0x36e4('0x1f')](_0x89b87a['query']['limit']);_0x3a1cdb[_0x36e4('0x1e')]=qs[_0x36e4('0x1e')](_0x89b87a[_0x36e4('0x33')][_0x36e4('0x1e')]);}_0x3a1cdb[_0x36e4('0x3c')]=qs['sort'](_0x89b87a[_0x36e4('0x33')][_0x36e4('0x3d')]);_0x3a1cdb['where']=qs[_0x36e4('0x35')](_['pick'](_0x89b87a[_0x36e4('0x33')],_0xce6447[_0x36e4('0x35')]),_0x256031);if(_0x89b87a[_0x36e4('0x33')][_0x36e4('0x3e')]){_0x3a1cdb[_0x36e4('0x3f')]=_[_0x36e4('0x40')](_0x3a1cdb[_0x36e4('0x3f')],{'$or':_[_0x36e4('0x2c')](_0x256031,function(_0x2c7019){if(_0x2c7019[_0x36e4('0x30')]!=='VIRTUAL'){var _0x26aad9={};_0x26aad9[_0x2c7019['name']]={'$like':'%'+_0x89b87a['query'][_0x36e4('0x3e')]+'%'};return _0x26aad9;}})});}_0x3a1cdb=_['merge']({},_0x3a1cdb,_0x89b87a[_0x36e4('0x41')]);var _0xf0688d={'where':_0x3a1cdb['where']};return db['ServicenowAccount'][_0x36e4('0x20')](_0xf0688d)['then'](function(_0x384034){_0x248ece[_0x36e4('0x20')]=_0x384034;if(_0x89b87a[_0x36e4('0x33')]['includeAll']){_0x3a1cdb[_0x36e4('0x42')]=[{'all':!![]}];}return db[_0x36e4('0x2d')][_0x36e4('0x43')](_0x3a1cdb);})[_0x36e4('0x25')](function(_0x142df2){_0x248ece[_0x36e4('0x44')]=_0x142df2;return _0x248ece;})[_0x36e4('0x25')](respondWithFilteredResult(_0x2b5c60,_0x3a1cdb))['catch'](handleError(_0x2b5c60,null));};exports[_0x36e4('0x45')]=function(_0x2f0827,_0xd2c17c){var _0x5c07e8={'raw':![],'where':{'id':_0x2f0827['params']['id']}},_0x2bdd55={};_0x2bdd55[_0x36e4('0x32')]=_['keys'](db[_0x36e4('0x2d')]['rawAttributes']);_0x2bdd55[_0x36e4('0x33')]=_[_0x36e4('0x34')](_0x2f0827[_0x36e4('0x33')]);_0x2bdd55[_0x36e4('0x35')]=_[_0x36e4('0x36')](_0x2bdd55[_0x36e4('0x32')],_0x2bdd55['query']);_0x5c07e8[_0x36e4('0x37')]=_[_0x36e4('0x36')](_0x2bdd55[_0x36e4('0x32')],qs['fields'](_0x2f0827[_0x36e4('0x33')][_0x36e4('0x38')]));_0x5c07e8['attributes']=_0x5c07e8[_0x36e4('0x37')][_0x36e4('0x39')]?_0x5c07e8[_0x36e4('0x37')]:_0x2bdd55['model'];if(_0x2f0827[_0x36e4('0x33')][_0x36e4('0x46')]){_0x5c07e8[_0x36e4('0x42')]=[{'all':!![]}];}_0x5c07e8=_[_0x36e4('0x40')]({},_0x5c07e8,_0x2f0827[_0x36e4('0x41')]);return db[_0x36e4('0x2d')][_0x36e4('0x47')](_0x5c07e8)['then'](handleEntityNotFound(_0xd2c17c,null))[_0x36e4('0x25')](respondWithResult(_0xd2c17c,null))[_0x36e4('0x48')](handleError(_0xd2c17c,null));};exports[_0x36e4('0x49')]=function(_0x156bed,_0x59a5ac){return db['ServicenowAccount'][_0x36e4('0x49')](_0x156bed[_0x36e4('0x4a')],{})[_0x36e4('0x25')](respondWithResult(_0x59a5ac,0xc9))[_0x36e4('0x48')](handleError(_0x59a5ac,null));};exports['update']=function(_0x1934ca,_0x4ad06c){if(_0x1934ca['body']['id']){delete _0x1934ca[_0x36e4('0x4a')]['id'];}return db[_0x36e4('0x2d')][_0x36e4('0x47')]({'where':{'id':_0x1934ca[_0x36e4('0x4b')]['id']}})[_0x36e4('0x25')](handleEntityNotFound(_0x4ad06c,null))['then'](saveUpdates(_0x1934ca[_0x36e4('0x4a')],null))[_0x36e4('0x25')](respondWithResult(_0x4ad06c,null))[_0x36e4('0x48')](handleError(_0x4ad06c,null));};exports['destroy']=function(_0x20625e,_0x18bf32){return db[_0x36e4('0x2d')][_0x36e4('0x47')]({'where':{'id':_0x20625e['params']['id']}})[_0x36e4('0x25')](handleEntityNotFound(_0x18bf32,null))[_0x36e4('0x25')](removeEntity(_0x18bf32,null))[_0x36e4('0x48')](handleError(_0x18bf32,null));};exports[_0x36e4('0x4c')]=function(_0xaf17c6,_0x3f794c,_0x12b839){var _0xa31ff0={};var _0x54bd7a={};var _0x931aa1;var _0x4a2d19;return db[_0x36e4('0x2d')][_0x36e4('0x4d')]({'where':{'id':_0xaf17c6['params']['id']}})[_0x36e4('0x25')](handleEntityNotFound(_0x3f794c,null))[_0x36e4('0x25')](function(_0x4fbb3c){if(_0x4fbb3c){_0x931aa1=_0x4fbb3c;_0x54bd7a[_0x36e4('0x32')]=_[_0x36e4('0x34')](db[_0x36e4('0x4e')][_0x36e4('0x2e')]);_0x54bd7a[_0x36e4('0x33')]=_[_0x36e4('0x34')](_0xaf17c6[_0x36e4('0x33')]);_0x54bd7a['filters']=_[_0x36e4('0x36')](_0x54bd7a[_0x36e4('0x32')],_0x54bd7a[_0x36e4('0x33')]);_0xa31ff0[_0x36e4('0x37')]=_[_0x36e4('0x36')](_0x54bd7a['model'],qs[_0x36e4('0x38')](_0xaf17c6[_0x36e4('0x33')][_0x36e4('0x38')]));_0xa31ff0[_0x36e4('0x37')]=_0xa31ff0[_0x36e4('0x37')][_0x36e4('0x39')]?_0xa31ff0['attributes']:_0x54bd7a[_0x36e4('0x32')];_0xa31ff0[_0x36e4('0x3c')]=qs[_0x36e4('0x3d')](_0xaf17c6[_0x36e4('0x33')][_0x36e4('0x3d')]);_0xa31ff0['where']=qs['filters'](_[_0x36e4('0x4f')](_0xaf17c6[_0x36e4('0x33')],_0x54bd7a['filters']));if(_0xaf17c6['query']['filter']){_0xa31ff0['where']=_[_0x36e4('0x40')](_0xa31ff0[_0x36e4('0x3f')],{'$or':_['map'](_0xa31ff0['attributes'],function(_0x258809){var _0x17f471={};_0x17f471[_0x258809]={'$like':'%'+_0xaf17c6[_0x36e4('0x33')][_0x36e4('0x3e')]+'%'};return _0x17f471;})});}_0xa31ff0=_[_0x36e4('0x40')]({},_0xa31ff0,_0xaf17c6[_0x36e4('0x41')]);return _0x931aa1[_0x36e4('0x4c')](_0xa31ff0);}})[_0x36e4('0x25')](function(_0x16a684){if(_0x16a684){_0x4a2d19=_0x16a684['length'];if(!_0xaf17c6[_0x36e4('0x33')][_0x36e4('0x3a')]('nolimit')){_0xa31ff0['limit']=qs['limit'](_0xaf17c6['query'][_0x36e4('0x1f')]);_0xa31ff0['offset']=qs['offset'](_0xaf17c6[_0x36e4('0x33')][_0x36e4('0x1e')]);}return _0x931aa1[_0x36e4('0x4c')](_0xa31ff0);}})[_0x36e4('0x25')](function(_0x14ff41){if(_0x14ff41){return _0x14ff41?{'count':_0x4a2d19,'rows':_0x14ff41}:null;}})[_0x36e4('0x25')](respondWithResult(_0x3f794c,null))['catch'](handleError(_0x3f794c,null));};exports[_0x36e4('0x50')]=function(_0x43af3f,_0x5aa530,_0x59ddc3){if(_0x43af3f[_0x36e4('0x4a')]['id']){delete _0x43af3f[_0x36e4('0x4a')]['id'];}return db['ServicenowAccount'][_0x36e4('0x4d')]({'where':{'id':_0x43af3f[_0x36e4('0x4b')]['id']}})[_0x36e4('0x25')](handleEntityNotFound(_0x5aa530,null))[_0x36e4('0x25')](function(_0x45e100){if(_0x45e100){_0x43af3f[_0x36e4('0x4a')][_0x36e4('0x51')]=_0x45e100['id'];_0x43af3f['body']['Subjects']=integrations[_0x36e4('0x52')](_0x43af3f[_0x36e4('0x4a')][_0x36e4('0x53')],_0x43af3f['body'][_0x36e4('0x30')]);_0x43af3f[_0x36e4('0x4a')][_0x36e4('0x54')]=integrations['getDescriptions'](_0x43af3f[_0x36e4('0x4a')][_0x36e4('0x53')],_0x43af3f[_0x36e4('0x4a')][_0x36e4('0x30')]);return db[_0x36e4('0x4e')][_0x36e4('0x49')](_0x43af3f[_0x36e4('0x4a')],{'include':[{'model':db[_0x36e4('0x55')],'as':_0x36e4('0x56')},{'model':db[_0x36e4('0x55')],'as':_0x36e4('0x54')}]});}return null;})[_0x36e4('0x25')](respondWithResult(_0x5aa530,null))['catch'](handleError(_0x5aa530,null));};exports[_0x36e4('0x57')]=function(_0x4a8de5,_0x518e0e,_0x38c393){var _0x2492bc=[_0x36e4('0x58'),_0x36e4('0x59'),_0x36e4('0x5a'),_0x36e4('0x5b'),_0x36e4('0x5c'),_0x36e4('0x5d'),_0x36e4('0x5e'),'severity',_0x36e4('0x5f')];var _0x13bcd0=['parent',_0x36e4('0x58'),_0x36e4('0x60'),'watch_list',_0x36e4('0x61'),'sys_updated_on',_0x36e4('0x62'),_0x36e4('0x59'),'approval_history','number',_0x36e4('0x63'),_0x36e4('0x64'),_0x36e4('0x65'),_0x36e4('0x66'),_0x36e4('0x67'),_0x36e4('0x68'),_0x36e4('0x69'),_0x36e4('0x6a'),_0x36e4('0x5a'),_0x36e4('0x3c'),_0x36e4('0x6b'),_0x36e4('0x6c'),_0x36e4('0x6d'),_0x36e4('0x6e'),_0x36e4('0x6f'),'active',_0x36e4('0x70'),_0x36e4('0x71'),_0x36e4('0x72'),'sys_domain_path',_0x36e4('0x73'),_0x36e4('0x74'),'expected_start',_0x36e4('0x75'),'business_duration',_0x36e4('0x76'),_0x36e4('0x77'),_0x36e4('0x78'),_0x36e4('0x79'),_0x36e4('0x7a'),_0x36e4('0x7b'),_0x36e4('0x5b'),_0x36e4('0x7c'),_0x36e4('0x7d'),_0x36e4('0x5c'),_0x36e4('0x7e'),_0x36e4('0x7f'),_0x36e4('0x80'),_0x36e4('0x81'),_0x36e4('0x82'),_0x36e4('0x83'),'description','calendar_duration',_0x36e4('0x5d'),_0x36e4('0x84'),_0x36e4('0x85'),'closed_by','follow_up',_0x36e4('0x86'),_0x36e4('0x87'),_0x36e4('0x88'),_0x36e4('0x89'),_0x36e4('0x5e'),'urgency','problem_id',_0x36e4('0x8a'),_0x36e4('0x8b'),'activity_due',_0x36e4('0x8c'),_0x36e4('0x8d'),_0x36e4('0x8e'),_0x36e4('0x8f'),_0x36e4('0x90'),_0x36e4('0x91'),_0x36e4('0x92'),_0x36e4('0x93'),'reopen_count',_0x36e4('0x94'),'escalation',_0x36e4('0x95'),_0x36e4('0x96'),'location','category'];var _0x276df9='';var _0xd753e5='';var _0x12f60e=[];var _0x523cf0='';var _0x264851='';var _0x5eb5ef=[];var _0x39aab3='';var _0x1cfb03='';var _0x3918b2={};var _0x21035c='';return db[_0x36e4('0x2d')][_0x36e4('0x4d')]({'where':{'id':_0x4a8de5[_0x36e4('0x4b')]['id']},'attributes':['id','username',_0x36e4('0x97'),_0x36e4('0x98'),'remoteUri',_0x36e4('0x99')]})[_0x36e4('0x25')](handleEntityNotFound(_0x518e0e,null))['then'](function(_0x203e85){if(_0x203e85){_0x21035c=_0x203e85[_0x36e4('0x9a')];var _0x27cc3e=_0x21035c[_0x36e4('0x9b')](-0x1);if(_0x27cc3e==='/'){_0x21035c=_0x21035c[_0x36e4('0x9c')](0x0,_0x21035c[_0x36e4('0x9d')](_0x27cc3e));}_0x1cfb03=util['format'](_0x36e4('0x9e'),_0x21035c);_0x39aab3=util['format'](_0x36e4('0x9f'),_0x21035c);_0x3918b2={'user':_0x203e85[_0x36e4('0xa0')],'pass':_0x203e85[_0x36e4('0x97')]};var _0x501e6d={'method':_0x36e4('0xa1'),'uri':_0x1cfb03+'incident?sysparm_display_value=all','auth':_0x3918b2,'json':!![]};return rp(_0x501e6d);}})['then'](function(_0xdf006e){if(_0xdf006e[_0x36e4('0xa2')]['length']>0x0){_0x276df9=_0xdf006e[_0x36e4('0xa2')];}console['log']('incident\x20table\x20objects',_0x276df9);_0x5eb5ef=[];_0xd753e5=Object[_0x36e4('0xa3')]([],_0x276df9);_['remove'](_0xd753e5,function(_0x451712){return!_0x2492bc[_0x36e4('0xa4')](_0x451712[_0x36e4('0x29')]);});_0xd753e5['forEach'](function(_0x476f60){var _0x7aa35=createFieldObject(_0x39aab3,_0x3918b2,_0x476f60[_0x36e4('0xa5')],_0x476f60[_0x36e4('0x29')],_0x476f60[_0x36e4('0xa6')],![]);_0x5eb5ef['push'](_0x7aa35);});return Promise[_0x36e4('0xa7')](_0x5eb5ef);})['then'](function(_0x2ab1ad){_0x12f60e=_0x2ab1ad;_0x523cf0=Object[_0x36e4('0xa3')]([],_0x276df9);console[_0x36e4('0xa8')](_0x36e4('0xa9'),_0x276df9);_[_0x36e4('0xaa')](_0x523cf0,function(_0xa26cd4){return _0x13bcd0[_0x36e4('0xa4')](_0xa26cd4[_0x36e4('0x29')]);});console[_0x36e4('0xa8')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x523cf0);_0x5eb5ef=[];_0x523cf0['forEach'](function(_0x154006){var _0x30995d=createFieldObject(_0x39aab3,_0x3918b2,_0x154006['internalType'],_0x154006[_0x36e4('0x29')],_0x154006[_0x36e4('0xa6')],!![]);_0x5eb5ef[_0x36e4('0xab')](_0x30995d);});return Promise[_0x36e4('0xa7')](_0x5eb5ef);})[_0x36e4('0x25')](function(_0x26a8de){_0x264851=_0x26a8de;var _0x1e12cb=_0x12f60e[_0x36e4('0xac')](_0x264851);return{'count':_0x1e12cb[_0x36e4('0x39')],'rows':_0x1e12cb};})[_0x36e4('0x25')](respondWithResult(_0x518e0e,null))[_0x36e4('0x48')](function(_0x1a21b0){console[_0x36e4('0xa8')](_0x36e4('0xad')+_0x1a21b0);var _0x372eeb=_0x4a8de5[_0x36e4('0x33')][_0x36e4('0xae')]?0x1f4:_0x1a21b0[_0x36e4('0xaf')]||0x1f4;logger[_0x36e4('0x27')](_0x1a21b0[_0x36e4('0x28')]);delete _0x1a21b0[_0x36e4('0x29')];if(_0x372eeb===0x191){_0x372eeb=0x190;}_0x518e0e[_0x36e4('0x1d')](_0x372eeb)[_0x36e4('0x2a')](_0x4a8de5[_0x36e4('0x33')][_0x36e4('0xae')]?{'message':_0x36e4('0xb0'),'statusCode':_0x1a21b0[_0x36e4('0xaf')]}:_0x1a21b0);});};function createFieldObject(_0x2e4807,_0x4e6423,_0xccbcb7,_0x2ca7c4,_0x38ab8d,_0x46672e){return new Promise(function(_0x295af5,_0x2eb0b6){var _0x1aa8e3={'id':_0x2ca7c4,'name':_0x38ab8d,'custom':_0x46672e};if(_0xccbcb7==='boolean'){_0x1aa8e3['options']=[{'name':_0x36e4('0xb1'),'value':_0x36e4('0xb2')},{'name':_0x36e4('0xb3'),'value':_0x36e4('0xb4')}];_0x295af5(_0x1aa8e3);}else{var _0x277933={'method':_0x36e4('0xa1'),'uri':_0x2e4807+_0x36e4('0xb5')+_0x2ca7c4,'auth':_0x4e6423,'json':!![]};return rp(_0x277933)[_0x36e4('0x25')](function(_0x2b8099){var _0x425da9=[];if(_0x2b8099[_0x36e4('0xa2')]['length']>0x0){_0x2b8099[_0x36e4('0xa2')]['forEach'](function(_0x2cd55f){if(_0x2cd55f[_0x36e4('0xb6')]===_0x36e4('0xb4')){var _0x2be70a={'name':_0x2cd55f[_0x36e4('0xa6')],'value':_0x2cd55f[_0x36e4('0xb7')]};_0x425da9[_0x36e4('0xab')](_0x2be70a);}});}_0x1aa8e3[_0x36e4('0x41')]=_0x425da9;if(_0x1aa8e3[_0x36e4('0x41')]['length']>0x0){_0x295af5(_0x1aa8e3);}else{if(_0x46672e==![]){_0x295af5();}else{_0x295af5(_0x1aa8e3);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1ae97e8..14d004e 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 _0x4975=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x12105a,_0x59fada){var _0x34c70d=function(_0x618b5e){while(--_0x618b5e){_0x12105a['push'](_0x12105a['shift']());}};_0x34c70d(++_0x59fada);}(_0x4975,0x86));var _0x5497=function(_0x295a4e,_0x170c47){_0x295a4e=_0x295a4e-0x0;var _0x3a80e6=_0x4975[_0x295a4e];return _0x3a80e6;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));var integrations=require(_0x5497('0xa'));module['exports']=function(_0x37e48d,_0x4f563d){return _0x37e48d[_0x5497('0xb')](_0x5497('0xc'),attributes,{'tableName':_0x5497('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x3e1c34,_0x3cc71a){var _0x45c67a=function(_0x171826){while(--_0x171826){_0x3e1c34['push'](_0x3e1c34['shift']());}};_0x45c67a(++_0x3cc71a);}(_0x4819,0xcd));var _0x9481=function(_0x350f77,_0x12a9b8){_0x350f77=_0x350f77-0x0;var _0x1305b6=_0x4819[_0x350f77];return _0x1305b6;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x9481('0xa')]=function(_0x5def07,_0x54cc78){return _0x5def07[_0x9481('0xb')](_0x9481('0xc'),attributes,{'tableName':_0x9481('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 58f3788..f603577 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 _0x822f=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','findAll','options','attributes','include','map','model','GetServicenowAccount','stringify','ServicenowAccount','raw','where','ShowServicenowAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5c12f0,_0x1f3a1f){var _0x2bd5ae=function(_0x1e4190){while(--_0x1e4190){_0x5c12f0['push'](_0x5c12f0['shift']());}};_0x2bd5ae(++_0x1f3a1f);}(_0x822f,0x150));var _0xf822=function(_0x7cadc5,_0x4f9a41){_0x7cadc5=_0x7cadc5-0x0;var _0x441ee1=_0x822f[_0x7cadc5];return _0x441ee1;};'use strict';var _=require(_0xf822('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf822('0x1'));var rs=require(_0xf822('0x2'));var fs=require('fs');var Redis=require(_0xf822('0x3'));var db=require(_0xf822('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf822('0x5'))(_0xf822('0x6'));var config=require(_0xf822('0x7'));var jayson=require(_0xf822('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cfe05,_0x2972d4,_0x247004){return new BPromise(function(_0x570175,_0x26444e){return client[_0xf822('0x9')](_0x5cfe05,_0x247004)[_0xf822('0xa')](function(_0x3d9d44){logger[_0xf822('0xb')](_0xf822('0xc'),_0x2972d4,_0xf822('0xd'));logger[_0xf822('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x2972d4,_0xf822('0xd'),JSON['stringify'](_0x3d9d44));if(_0x3d9d44[_0xf822('0xf')]){if(_0x3d9d44['error'][_0xf822('0x10')]===0x1f4){logger[_0xf822('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x2972d4,_0x3d9d44[_0xf822('0xf')][_0xf822('0x11')]);return _0x26444e(_0x3d9d44[_0xf822('0xf')][_0xf822('0x11')]);}logger[_0xf822('0xf')](_0xf822('0xc'),_0x2972d4,_0x3d9d44['error'][_0xf822('0x11')]);return _0x570175(_0x3d9d44[_0xf822('0xf')][_0xf822('0x11')]);}else{logger['info'](_0xf822('0xc'),_0x2972d4,_0xf822('0xd'));_0x570175(_0x3d9d44['result'][_0xf822('0x11')]);}})[_0xf822('0x12')](function(_0x2f5621){logger[_0xf822('0xf')](_0xf822('0xc'),_0x2972d4,_0x2f5621);_0x26444e(_0x2f5621);});});}exports['GetServicenowAccount']=function(_0x47dd4a){var _0x5c7d83=this;return new Promise(function(_0x26c61e,_0x13c580){return db['ServicenowAccount'][_0xf822('0x13')]({'raw':_0x47dd4a['options']?_0x47dd4a[_0xf822('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x47dd4a[_0xf822('0x14')]?_0x47dd4a[_0xf822('0x14')]['where']||null:null,'attributes':_0x47dd4a[_0xf822('0x14')]?_0x47dd4a[_0xf822('0x14')][_0xf822('0x15')]||null:null,'limit':_0x47dd4a[_0xf822('0x14')]?_0x47dd4a[_0xf822('0x14')]['limit']||null:null,'include':_0x47dd4a[_0xf822('0x14')]?_0x47dd4a[_0xf822('0x14')][_0xf822('0x16')]?_[_0xf822('0x17')](_0x47dd4a[_0xf822('0x14')][_0xf822('0x16')],function(_0x2a5d41){return{'model':db[_0x2a5d41['model']],'as':_0x2a5d41['as'],'attributes':_0x2a5d41[_0xf822('0x15')],'include':_0x2a5d41[_0xf822('0x16')]?_[_0xf822('0x17')](_0x2a5d41[_0xf822('0x16')],function(_0x224375){return{'model':db[_0x224375[_0xf822('0x18')]],'as':_0x224375['as'],'attributes':_0x224375[_0xf822('0x15')],'include':_0x224375['include']?_[_0xf822('0x17')](_0x224375[_0xf822('0x16')],function(_0x12bbb0){return{'model':db[_0x12bbb0[_0xf822('0x18')]],'as':_0x12bbb0['as'],'attributes':_0x12bbb0[_0xf822('0x15')]};}):[]};}):[]};}):[]:[]})[_0xf822('0xa')](function(_0x4c6946){logger['info']('GetServicenowAccount',_0x47dd4a);logger[_0xf822('0xe')](_0xf822('0x19'),_0x47dd4a,JSON[_0xf822('0x1a')](_0x4c6946));_0x26c61e(_0x4c6946);})[_0xf822('0x12')](function(_0x15ff1d){logger['error'](_0xf822('0x19'),_0x15ff1d['message'],_0x47dd4a);_0x13c580(_0x5c7d83['error'](0x1f4,_0x15ff1d[_0xf822('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x51a403){var _0x1f9443=this;return new Promise(function(_0x4cdf94,_0x429932){return db[_0xf822('0x1b')]['find']({'raw':_0x51a403[_0xf822('0x14')]?_0x51a403[_0xf822('0x14')][_0xf822('0x1c')]===undefined?!![]:![]:!![],'where':_0x51a403['options']?_0x51a403[_0xf822('0x14')][_0xf822('0x1d')]||null:null,'attributes':_0x51a403['options']?_0x51a403[_0xf822('0x14')][_0xf822('0x15')]||null:null,'include':_0x51a403[_0xf822('0x14')]?_0x51a403[_0xf822('0x14')][_0xf822('0x16')]?_[_0xf822('0x17')](_0x51a403['options']['include'],function(_0x22f581){return{'model':db[_0x22f581['model']],'as':_0x22f581['as'],'attributes':_0x22f581[_0xf822('0x15')],'include':_0x22f581['include']?_[_0xf822('0x17')](_0x22f581[_0xf822('0x16')],function(_0x381e89){return{'model':db[_0x381e89['model']],'as':_0x381e89['as'],'attributes':_0x381e89[_0xf822('0x15')],'include':_0x381e89[_0xf822('0x16')]?_[_0xf822('0x17')](_0x381e89[_0xf822('0x16')],function(_0x174fc9){return{'model':db[_0x174fc9[_0xf822('0x18')]],'as':_0x174fc9['as'],'attributes':_0x174fc9[_0xf822('0x15')]};}):[]};}):[]};}):[]:[]})[_0xf822('0xa')](function(_0x277c0f){logger['info']('ShowServicenowAccount',_0x51a403);logger[_0xf822('0xe')]('ShowServicenowAccount',_0x51a403,JSON[_0xf822('0x1a')](_0x277c0f));_0x4cdf94(_0x277c0f);})[_0xf822('0x12')](function(_0xdf0c92){logger[_0xf822('0xf')](_0xf822('0x1e'),_0xdf0c92[_0xf822('0x11')],_0x51a403);_0x429932(_0x1f9443['error'](0x1f4,_0xdf0c92[_0xf822('0x11')]));});});}; \ No newline at end of file +var _0x50b2=['request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','limit','include','map','model','attributes','ShowServicenowAccount','find','raw','where','catch','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x4a4b0e,_0x15d1a9){var _0x57beab=function(_0x564b1d){while(--_0x564b1d){_0x4a4b0e['push'](_0x4a4b0e['shift']());}};_0x57beab(++_0x15d1a9);}(_0x50b2,0x9d));var _0x250b=function(_0x2a99e2,_0x1803e4){_0x2a99e2=_0x2a99e2-0x0;var _0x23fb5f=_0x50b2[_0x2a99e2];return _0x23fb5f;};'use strict';var _=require('lodash');var util=require(_0x250b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x250b('0x1'));var fs=require('fs');var Redis=require(_0x250b('0x2'));var db=require(_0x250b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x250b('0x4'));var config=require(_0x250b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x250b('0x6')][_0x250b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x275b10,_0x512c93,_0x319e81){return new BPromise(function(_0x326339,_0x4609a3){return client[_0x250b('0x8')](_0x275b10,_0x319e81)[_0x250b('0x9')](function(_0x2efa57){logger[_0x250b('0xa')](_0x250b('0xb'),_0x512c93,_0x250b('0xc'));logger[_0x250b('0xd')](_0x250b('0xe'),_0x512c93,_0x250b('0xc'),JSON[_0x250b('0xf')](_0x2efa57));if(_0x2efa57['error']){if(_0x2efa57['error']['code']===0x1f4){logger[_0x250b('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x512c93,_0x2efa57[_0x250b('0x10')]['message']);return _0x4609a3(_0x2efa57[_0x250b('0x10')][_0x250b('0x11')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x512c93,_0x2efa57[_0x250b('0x10')][_0x250b('0x11')]);return _0x326339(_0x2efa57[_0x250b('0x10')][_0x250b('0x11')]);}else{logger[_0x250b('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x512c93,_0x250b('0xc'));_0x326339(_0x2efa57[_0x250b('0x12')]['message']);}})['catch'](function(_0x3ce053){logger[_0x250b('0x10')](_0x250b('0xb'),_0x512c93,_0x3ce053);_0x4609a3(_0x3ce053);});});}exports[_0x250b('0x13')]=function(_0x3b81d3){var _0x2280f4=this;return new Promise(function(_0x22215f,_0x579a7e){return db[_0x250b('0x14')][_0x250b('0x15')]({'raw':_0x3b81d3['options']?_0x3b81d3[_0x250b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3b81d3[_0x250b('0x16')]?_0x3b81d3[_0x250b('0x16')]['where']||null:null,'attributes':_0x3b81d3['options']?_0x3b81d3['options']['attributes']||null:null,'limit':_0x3b81d3[_0x250b('0x16')]?_0x3b81d3[_0x250b('0x16')][_0x250b('0x17')]||null:null,'include':_0x3b81d3[_0x250b('0x16')]?_0x3b81d3[_0x250b('0x16')][_0x250b('0x18')]?_[_0x250b('0x19')](_0x3b81d3[_0x250b('0x16')][_0x250b('0x18')],function(_0x3b4814){return{'model':db[_0x3b4814[_0x250b('0x1a')]],'as':_0x3b4814['as'],'attributes':_0x3b4814[_0x250b('0x1b')],'include':_0x3b4814[_0x250b('0x18')]?_[_0x250b('0x19')](_0x3b4814[_0x250b('0x18')],function(_0x2319a6){return{'model':db[_0x2319a6[_0x250b('0x1a')]],'as':_0x2319a6['as'],'attributes':_0x2319a6[_0x250b('0x1b')],'include':_0x2319a6[_0x250b('0x18')]?_[_0x250b('0x19')](_0x2319a6[_0x250b('0x18')],function(_0x27fa35){return{'model':db[_0x27fa35[_0x250b('0x1a')]],'as':_0x27fa35['as'],'attributes':_0x27fa35['attributes']};}):[]};}):[]};}):[]:[]})[_0x250b('0x9')](function(_0x384ca2){logger[_0x250b('0xa')](_0x250b('0x13'),_0x3b81d3);logger[_0x250b('0xd')](_0x250b('0x13'),_0x3b81d3,JSON[_0x250b('0xf')](_0x384ca2));_0x22215f(_0x384ca2);})['catch'](function(_0x3c440b){logger[_0x250b('0x10')]('GetServicenowAccount',_0x3c440b['message'],_0x3b81d3);_0x579a7e(_0x2280f4[_0x250b('0x10')](0x1f4,_0x3c440b[_0x250b('0x11')]));});});};exports[_0x250b('0x1c')]=function(_0x366ad0){var _0x2fe90c=this;return new Promise(function(_0x2f2954,_0x42c204){return db['ServicenowAccount'][_0x250b('0x1d')]({'raw':_0x366ad0['options']?_0x366ad0['options'][_0x250b('0x1e')]===undefined?!![]:![]:!![],'where':_0x366ad0['options']?_0x366ad0['options'][_0x250b('0x1f')]||null:null,'attributes':_0x366ad0[_0x250b('0x16')]?_0x366ad0[_0x250b('0x16')][_0x250b('0x1b')]||null:null,'include':_0x366ad0[_0x250b('0x16')]?_0x366ad0[_0x250b('0x16')][_0x250b('0x18')]?_[_0x250b('0x19')](_0x366ad0[_0x250b('0x16')]['include'],function(_0x446a3b){return{'model':db[_0x446a3b[_0x250b('0x1a')]],'as':_0x446a3b['as'],'attributes':_0x446a3b[_0x250b('0x1b')],'include':_0x446a3b['include']?_[_0x250b('0x19')](_0x446a3b[_0x250b('0x18')],function(_0x2f6d96){return{'model':db[_0x2f6d96[_0x250b('0x1a')]],'as':_0x2f6d96['as'],'attributes':_0x2f6d96[_0x250b('0x1b')],'include':_0x2f6d96['include']?_['map'](_0x2f6d96[_0x250b('0x18')],function(_0xb8bf64){return{'model':db[_0xb8bf64[_0x250b('0x1a')]],'as':_0xb8bf64['as'],'attributes':_0xb8bf64[_0x250b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x250b('0x9')](function(_0x5a97f7){logger[_0x250b('0xa')](_0x250b('0x1c'),_0x366ad0);logger[_0x250b('0xd')](_0x250b('0x1c'),_0x366ad0,JSON[_0x250b('0xf')](_0x5a97f7));_0x2f2954(_0x5a97f7);})[_0x250b('0x20')](function(_0xae1118){logger[_0x250b('0x10')]('ShowServicenowAccount',_0xae1118['message'],_0x366ad0);_0x42c204(_0x2fe90c['error'](0x1f4,_0xae1118[_0x250b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 4053d8c..5eb80ff 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 _0xa888=['fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa888,0x17c));var _0x8a88=function(_0x187283,_0x4246d2){_0x187283=_0x187283-0x0;var _0x4aca7f=_0xa888[_0x187283];return _0x4aca7f;};'use strict';var multer=require('multer');var util=require(_0x8a88('0x0'));var path=require('path');var timeout=require(_0x8a88('0x1'));var express=require(_0x8a88('0x2'));var router=express[_0x8a88('0x3')]();var fs_extra=require(_0x8a88('0x4'));var auth=require(_0x8a88('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a88('0x6'));var controller=require(_0x8a88('0x7'));router[_0x8a88('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8a88('0x8')](_0x8a88('0x9'),auth[_0x8a88('0xa')](),controller[_0x8a88('0xb')]);router[_0x8a88('0x8')](_0x8a88('0xc'),auth[_0x8a88('0xa')](),controller[_0x8a88('0xd')]);router[_0x8a88('0x8')](_0x8a88('0xe'),auth[_0x8a88('0xa')](),controller['getSubjects']);router[_0x8a88('0x8')](_0x8a88('0xf'),auth[_0x8a88('0xa')](),controller[_0x8a88('0x10')]);router[_0x8a88('0x11')]('/',auth[_0x8a88('0xa')](),controller[_0x8a88('0x12')]);router[_0x8a88('0x13')](_0x8a88('0x9'),auth['isAuthenticated'](),controller[_0x8a88('0x14')]);router[_0x8a88('0x15')](_0x8a88('0x9'),auth[_0x8a88('0xa')](),controller[_0x8a88('0x16')]);module[_0x8a88('0x17')]=router; \ No newline at end of file +var _0x9d1b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','/:id','show','isAuthenticated','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer'];(function(_0x10a621,_0x39bb56){var _0x53f036=function(_0x74ac9){while(--_0x74ac9){_0x10a621['push'](_0x10a621['shift']());}};_0x53f036(++_0x39bb56);}(_0x9d1b,0x6d));var _0xb9d1=function(_0xdbce8,_0x550d11){_0xdbce8=_0xdbce8-0x0;var _0x4e8866=_0x9d1b[_0xdbce8];return _0x4e8866;};'use strict';var multer=require(_0xb9d1('0x0'));var util=require('util');var path=require(_0xb9d1('0x1'));var timeout=require(_0xb9d1('0x2'));var express=require(_0xb9d1('0x3'));var router=express[_0xb9d1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb9d1('0x5'));var interaction=require(_0xb9d1('0x6'));var config=require(_0xb9d1('0x7'));var controller=require(_0xb9d1('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb9d1('0x9')](_0xb9d1('0xa'),auth['isAuthenticated'](),controller[_0xb9d1('0xb')]);router[_0xb9d1('0x9')]('/:id/fields',auth[_0xb9d1('0xc')](),controller['getFields']);router['get'](_0xb9d1('0xd'),auth[_0xb9d1('0xc')](),controller['getSubjects']);router['get'](_0xb9d1('0xe'),auth[_0xb9d1('0xc')](),controller[_0xb9d1('0xf')]);router[_0xb9d1('0x10')]('/',auth[_0xb9d1('0xc')](),controller[_0xb9d1('0x11')]);router[_0xb9d1('0x12')](_0xb9d1('0xa'),auth[_0xb9d1('0xc')](),controller[_0xb9d1('0x13')]);router[_0xb9d1('0x14')](_0xb9d1('0xa'),auth[_0xb9d1('0xc')](),controller['destroy']);module[_0xb9d1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 243210d..2445f47 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 _0xe330=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe330,0xf9));var _0x0e33=function(_0x62ad97,_0x43d530){_0x62ad97=_0x62ad97-0x0;var _0x388a47=_0xe330[_0x62ad97];return _0x388a47;};'use strict';var Sequelize=require(_0x0e33('0x0'));module[_0x0e33('0x1')]={'name':{'type':Sequelize[_0x0e33('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x57ab=['exports','STRING','sequelize'];(function(_0x2116b9,_0x44bb12){var _0x18aa55=function(_0x41b27f){while(--_0x41b27f){_0x2116b9['push'](_0x2116b9['shift']());}};_0x18aa55(++_0x44bb12);}(_0x57ab,0x176));var _0xb57a=function(_0x1ae8ab,_0x6e5c2a){_0x1ae8ab=_0x1ae8ab-0x0;var _0x1ad705=_0x57ab[_0x1ae8ab];return _0x1ad705;};'use strict';var Sequelize=require(_0xb57a('0x0'));module[_0xb57a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb57a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 1547e96..9643637 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 _0xf079=['merge','VIRTUAL','includeAll','include','findAll','catch','show','params','length','options','create','update','body','find','getFields','findOne','ServicenowField','filter','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf079,0xb6));var _0x9f07=function(_0x22f78b,_0x47aabb){_0x22f78b=_0x22f78b-0x0;var _0x302c54=_0xf079[_0x22f78b];return _0x302c54;};'use strict';var emlformat=require(_0x9f07('0x0'));var rimraf=require(_0x9f07('0x1'));var zipdir=require(_0x9f07('0x2'));var jsonpatch=require(_0x9f07('0x3'));var rp=require(_0x9f07('0x4'));var moment=require(_0x9f07('0x5'));var BPromise=require(_0x9f07('0x6'));var Mustache=require(_0x9f07('0x7'));var util=require(_0x9f07('0x8'));var path=require(_0x9f07('0x9'));var sox=require(_0x9f07('0xa'));var csv=require(_0x9f07('0xb'));var ejs=require(_0x9f07('0xc'));var fs=require('fs');var fs_extra=require(_0x9f07('0xd'));var _=require(_0x9f07('0xe'));var squel=require(_0x9f07('0xf'));var crypto=require(_0x9f07('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x9f07('0x11'));var toCsv=require(_0x9f07('0xb'));var querystring=require(_0x9f07('0x12'));var Papa=require(_0x9f07('0x13'));var Redis=require(_0x9f07('0x14'));var authService=require(_0x9f07('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f07('0x16'))(_0x9f07('0x17'));var utils=require('../../config/utils');var config=require(_0x9f07('0x18'));var licenseUtil=require(_0x9f07('0x19'));var db=require(_0x9f07('0x1a'))['db'];function respondWithStatusCode(_0x22570b,_0x250f3d){_0x250f3d=_0x250f3d||0xcc;return function(_0x2c9e15){if(_0x2c9e15){return _0x22570b[_0x9f07('0x1b')](_0x250f3d);}return _0x22570b[_0x9f07('0x1c')](_0x250f3d)[_0x9f07('0x1d')]();};}function respondWithResult(_0x8d9276,_0x48a0ce){_0x48a0ce=_0x48a0ce||0xc8;return function(_0x1c14ad){if(_0x1c14ad){return _0x8d9276['status'](_0x48a0ce)['json'](_0x1c14ad);}};}function respondWithFilteredResult(_0x59c440,_0x5ba9aa){return function(_0x431831){if(_0x431831){var _0x453edc=typeof _0x5ba9aa[_0x9f07('0x1e')]===_0x9f07('0x1f')&&typeof _0x5ba9aa[_0x9f07('0x20')]===_0x9f07('0x1f');var _0xf9c21b=_0x431831[_0x9f07('0x21')];var _0x9101ce=_0x453edc?0x0:_0x5ba9aa[_0x9f07('0x1e')];var _0x31f96a=_0x453edc?_0x431831[_0x9f07('0x21')]:_0x5ba9aa[_0x9f07('0x1e')]+_0x5ba9aa[_0x9f07('0x20')];var _0x16d113;if(_0x31f96a>=_0xf9c21b){_0x31f96a=_0xf9c21b;_0x16d113=0xc8;}else{_0x16d113=0xce;}_0x59c440[_0x9f07('0x1c')](_0x16d113);return _0x59c440['set'](_0x9f07('0x22'),_0x9101ce+'-'+_0x31f96a+'/'+_0xf9c21b)[_0x9f07('0x23')](_0x431831);}return null;};}function patchUpdates(_0x994ed1){return function(_0x3ef3b5){try{jsonpatch[_0x9f07('0x24')](_0x3ef3b5,_0x994ed1,!![]);}catch(_0x23c85c){return BPromise['reject'](_0x23c85c);}return _0x3ef3b5[_0x9f07('0x25')]();};}function saveUpdates(_0xdfb2a0,_0x14bf99){return function(_0x9f67aa){if(_0x9f67aa){return _0x9f67aa['update'](_0xdfb2a0)['then'](function(_0x18a957){return _0x18a957;});}return null;};}function removeEntity(_0x3ea6de,_0x7b5790){return function(_0x106fb1){if(_0x106fb1){return _0x106fb1['destroy']()[_0x9f07('0x26')](function(){_0x3ea6de[_0x9f07('0x1c')](0xcc)[_0x9f07('0x1d')]();});}};}function handleEntityNotFound(_0x49f721,_0x2563e2){return function(_0x1381b9){if(!_0x1381b9){_0x49f721['sendStatus'](0x194);}return _0x1381b9;};}function handleError(_0x3cc1d0,_0x524640){_0x524640=_0x524640||0x1f4;return function(_0x40b94c){logger[_0x9f07('0x27')](_0x40b94c[_0x9f07('0x28')]);if(_0x40b94c['name']){delete _0x40b94c[_0x9f07('0x29')];}_0x3cc1d0[_0x9f07('0x1c')](_0x524640)[_0x9f07('0x2a')](_0x40b94c);};}exports[_0x9f07('0x2b')]=function(_0x2e08a4,_0x2f96c5){var _0x51aebc={},_0x3ad3b8={},_0x3b1d04={'count':0x0,'rows':[]};var _0x334298=_['map'](db[_0x9f07('0x2c')][_0x9f07('0x2d')],function(_0x47a454){return{'name':_0x47a454['fieldName'],'type':_0x47a454[_0x9f07('0x2e')]['key']};});_0x3ad3b8['model']=_[_0x9f07('0x2f')](_0x334298,_0x9f07('0x29'));_0x3ad3b8[_0x9f07('0x30')]=_[_0x9f07('0x31')](_0x2e08a4['query']);_0x3ad3b8[_0x9f07('0x32')]=_[_0x9f07('0x33')](_0x3ad3b8[_0x9f07('0x34')],_0x3ad3b8['query']);_0x51aebc[_0x9f07('0x35')]=_[_0x9f07('0x33')](_0x3ad3b8['model'],qs['fields'](_0x2e08a4[_0x9f07('0x30')][_0x9f07('0x36')]));_0x51aebc[_0x9f07('0x35')]=_0x51aebc['attributes']['length']?_0x51aebc[_0x9f07('0x35')]:_0x3ad3b8['model'];if(!_0x2e08a4[_0x9f07('0x30')][_0x9f07('0x37')](_0x9f07('0x38'))){_0x51aebc['limit']=qs[_0x9f07('0x20')](_0x2e08a4[_0x9f07('0x30')][_0x9f07('0x20')]);_0x51aebc['offset']=qs[_0x9f07('0x1e')](_0x2e08a4[_0x9f07('0x30')]['offset']);}_0x51aebc[_0x9f07('0x39')]=qs[_0x9f07('0x3a')](_0x2e08a4['query'][_0x9f07('0x3a')]);_0x51aebc[_0x9f07('0x3b')]=qs[_0x9f07('0x32')](_[_0x9f07('0x3c')](_0x2e08a4['query'],_0x3ad3b8['filters']),_0x334298);if(_0x2e08a4[_0x9f07('0x30')]['filter']){_0x51aebc[_0x9f07('0x3b')]=_[_0x9f07('0x3d')](_0x51aebc[_0x9f07('0x3b')],{'$or':_[_0x9f07('0x2f')](_0x334298,function(_0x4b08f9){if(_0x4b08f9[_0x9f07('0x2e')]!==_0x9f07('0x3e')){var _0xe98de2={};_0xe98de2[_0x4b08f9['name']]={'$like':'%'+_0x2e08a4[_0x9f07('0x30')]['filter']+'%'};return _0xe98de2;}})});}_0x51aebc=_[_0x9f07('0x3d')]({},_0x51aebc,_0x2e08a4['options']);var _0x5556c0={'where':_0x51aebc[_0x9f07('0x3b')]};return db[_0x9f07('0x2c')]['count'](_0x5556c0)[_0x9f07('0x26')](function(_0x32bfb4){_0x3b1d04[_0x9f07('0x21')]=_0x32bfb4;if(_0x2e08a4[_0x9f07('0x30')][_0x9f07('0x3f')]){_0x51aebc[_0x9f07('0x40')]=[{'all':!![]}];}return db[_0x9f07('0x2c')][_0x9f07('0x41')](_0x51aebc);})[_0x9f07('0x26')](function(_0x3e509d){_0x3b1d04['rows']=_0x3e509d;return _0x3b1d04;})[_0x9f07('0x26')](respondWithFilteredResult(_0x2f96c5,_0x51aebc))[_0x9f07('0x42')](handleError(_0x2f96c5,null));};exports[_0x9f07('0x43')]=function(_0x257fa4,_0x2b64dd){var _0x1aba31={'raw':![],'where':{'id':_0x257fa4[_0x9f07('0x44')]['id']}},_0x65f902={};_0x65f902[_0x9f07('0x34')]=_[_0x9f07('0x31')](db['ServicenowConfiguration'][_0x9f07('0x2d')]);_0x65f902[_0x9f07('0x30')]=_[_0x9f07('0x31')](_0x257fa4[_0x9f07('0x30')]);_0x65f902[_0x9f07('0x32')]=_[_0x9f07('0x33')](_0x65f902[_0x9f07('0x34')],_0x65f902[_0x9f07('0x30')]);_0x1aba31['attributes']=_[_0x9f07('0x33')](_0x65f902[_0x9f07('0x34')],qs['fields'](_0x257fa4[_0x9f07('0x30')][_0x9f07('0x36')]));_0x1aba31[_0x9f07('0x35')]=_0x1aba31['attributes'][_0x9f07('0x45')]?_0x1aba31[_0x9f07('0x35')]:_0x65f902[_0x9f07('0x34')];if(_0x257fa4[_0x9f07('0x30')][_0x9f07('0x3f')]){_0x1aba31[_0x9f07('0x40')]=[{'all':!![]}];}_0x1aba31=_[_0x9f07('0x3d')]({},_0x1aba31,_0x257fa4[_0x9f07('0x46')]);return db['ServicenowConfiguration']['find'](_0x1aba31)[_0x9f07('0x26')](handleEntityNotFound(_0x2b64dd,null))[_0x9f07('0x26')](respondWithResult(_0x2b64dd,null))[_0x9f07('0x42')](handleError(_0x2b64dd,null));};exports[_0x9f07('0x47')]=function(_0x56efa2,_0x577fcc){return db[_0x9f07('0x2c')][_0x9f07('0x47')](_0x56efa2['body'],{})['then'](respondWithResult(_0x577fcc,0xc9))[_0x9f07('0x42')](handleError(_0x577fcc,null));};exports[_0x9f07('0x48')]=function(_0x465d46,_0x1c702c){if(_0x465d46[_0x9f07('0x49')]['id']){delete _0x465d46['body']['id'];}return db[_0x9f07('0x2c')]['find']({'where':{'id':_0x465d46[_0x9f07('0x44')]['id']}})[_0x9f07('0x26')](handleEntityNotFound(_0x1c702c,null))[_0x9f07('0x26')](saveUpdates(_0x465d46[_0x9f07('0x49')],null))[_0x9f07('0x26')](respondWithResult(_0x1c702c,null))['catch'](handleError(_0x1c702c,null));};exports['destroy']=function(_0x3583da,_0x1340c6){return db['ServicenowConfiguration'][_0x9f07('0x4a')]({'where':{'id':_0x3583da[_0x9f07('0x44')]['id']}})['then'](handleEntityNotFound(_0x1340c6,null))[_0x9f07('0x26')](removeEntity(_0x1340c6,null))[_0x9f07('0x42')](handleError(_0x1340c6,null));};exports[_0x9f07('0x4b')]=function(_0x3d8710,_0x43e608,_0x27537f){var _0x4d644e={};var _0x4ad194={};var _0x2f27f2;var _0xf17106;return db['ServicenowConfiguration'][_0x9f07('0x4c')]({'where':{'id':_0x3d8710['params']['id']}})[_0x9f07('0x26')](handleEntityNotFound(_0x43e608,null))[_0x9f07('0x26')](function(_0x21ed3b){if(_0x21ed3b){_0x2f27f2=_0x21ed3b;_0x4ad194[_0x9f07('0x34')]=_['keys'](db[_0x9f07('0x4d')]['rawAttributes']);_0x4ad194[_0x9f07('0x30')]=_[_0x9f07('0x31')](_0x3d8710[_0x9f07('0x30')]);_0x4ad194['filters']=_[_0x9f07('0x33')](_0x4ad194['model'],_0x4ad194[_0x9f07('0x30')]);_0x4d644e[_0x9f07('0x35')]=_[_0x9f07('0x33')](_0x4ad194[_0x9f07('0x34')],qs[_0x9f07('0x36')](_0x3d8710[_0x9f07('0x30')][_0x9f07('0x36')]));_0x4d644e['attributes']=_0x4d644e['attributes'][_0x9f07('0x45')]?_0x4d644e['attributes']:_0x4ad194[_0x9f07('0x34')];_0x4d644e[_0x9f07('0x39')]=qs['sort'](_0x3d8710[_0x9f07('0x30')][_0x9f07('0x3a')]);_0x4d644e['where']=qs[_0x9f07('0x32')](_['pick'](_0x3d8710[_0x9f07('0x30')],_0x4ad194[_0x9f07('0x32')]));if(_0x3d8710[_0x9f07('0x30')]['filter']){_0x4d644e[_0x9f07('0x3b')]=_[_0x9f07('0x3d')](_0x4d644e[_0x9f07('0x3b')],{'$or':_[_0x9f07('0x2f')](_0x4d644e['attributes'],function(_0x137a74){var _0x444552={};_0x444552[_0x137a74]={'$like':'%'+_0x3d8710['query'][_0x9f07('0x4e')]+'%'};return _0x444552;})});}_0x4d644e=_[_0x9f07('0x3d')]({},_0x4d644e,_0x3d8710[_0x9f07('0x46')]);return _0x2f27f2[_0x9f07('0x4b')](_0x4d644e);}})[_0x9f07('0x26')](function(_0x4d05e2){if(_0x4d05e2){_0xf17106=_0x4d05e2[_0x9f07('0x45')];if(!_0x3d8710['query']['hasOwnProperty'](_0x9f07('0x38'))){_0x4d644e['limit']=qs['limit'](_0x3d8710[_0x9f07('0x30')][_0x9f07('0x20')]);_0x4d644e['offset']=qs[_0x9f07('0x1e')](_0x3d8710[_0x9f07('0x30')][_0x9f07('0x1e')]);}return _0x2f27f2[_0x9f07('0x4b')](_0x4d644e);}})[_0x9f07('0x26')](function(_0x7852bf){if(_0x7852bf){return _0x7852bf?{'count':_0xf17106,'rows':_0x7852bf}:null;}})[_0x9f07('0x26')](respondWithResult(_0x43e608,null))['catch'](handleError(_0x43e608,null));};exports[_0x9f07('0x4f')]=function(_0x43c638,_0x3b9a52,_0x35858c){var _0x34f15f={};var _0x40387f={};var _0x135f79;var _0x494beb;return db['ServicenowConfiguration'][_0x9f07('0x4c')]({'where':{'id':_0x43c638[_0x9f07('0x44')]['id']}})[_0x9f07('0x26')](handleEntityNotFound(_0x3b9a52,null))[_0x9f07('0x26')](function(_0x212225){if(_0x212225){_0x135f79=_0x212225;_0x40387f[_0x9f07('0x34')]=_[_0x9f07('0x31')](db[_0x9f07('0x4d')][_0x9f07('0x2d')]);_0x40387f[_0x9f07('0x30')]=_[_0x9f07('0x31')](_0x43c638[_0x9f07('0x30')]);_0x40387f[_0x9f07('0x32')]=_[_0x9f07('0x33')](_0x40387f['model'],_0x40387f[_0x9f07('0x30')]);_0x34f15f['attributes']=_[_0x9f07('0x33')](_0x40387f['model'],qs[_0x9f07('0x36')](_0x43c638[_0x9f07('0x30')][_0x9f07('0x36')]));_0x34f15f[_0x9f07('0x35')]=_0x34f15f[_0x9f07('0x35')][_0x9f07('0x45')]?_0x34f15f[_0x9f07('0x35')]:_0x40387f[_0x9f07('0x34')];_0x34f15f[_0x9f07('0x39')]=qs[_0x9f07('0x3a')](_0x43c638[_0x9f07('0x30')][_0x9f07('0x3a')]);_0x34f15f[_0x9f07('0x3b')]=qs[_0x9f07('0x32')](_['pick'](_0x43c638[_0x9f07('0x30')],_0x40387f[_0x9f07('0x32')]));if(_0x43c638[_0x9f07('0x30')][_0x9f07('0x4e')]){_0x34f15f[_0x9f07('0x3b')]=_[_0x9f07('0x3d')](_0x34f15f[_0x9f07('0x3b')],{'$or':_[_0x9f07('0x2f')](_0x34f15f[_0x9f07('0x35')],function(_0x337277){var _0x86b857={};_0x86b857[_0x337277]={'$like':'%'+_0x43c638[_0x9f07('0x30')][_0x9f07('0x4e')]+'%'};return _0x86b857;})});}_0x34f15f=_[_0x9f07('0x3d')]({},_0x34f15f,_0x43c638[_0x9f07('0x46')]);return _0x135f79[_0x9f07('0x4f')](_0x34f15f);}})[_0x9f07('0x26')](function(_0x2db244){if(_0x2db244){_0x494beb=_0x2db244['length'];if(!_0x43c638[_0x9f07('0x30')][_0x9f07('0x37')](_0x9f07('0x38'))){_0x34f15f['limit']=qs['limit'](_0x43c638[_0x9f07('0x30')][_0x9f07('0x20')]);_0x34f15f['offset']=qs['offset'](_0x43c638[_0x9f07('0x30')][_0x9f07('0x1e')]);}return _0x135f79[_0x9f07('0x4f')](_0x34f15f);}})[_0x9f07('0x26')](function(_0x510ffd){if(_0x510ffd){return _0x510ffd?{'count':_0x494beb,'rows':_0x510ffd}:null;}})[_0x9f07('0x26')](respondWithResult(_0x3b9a52,null))[_0x9f07('0x42')](handleError(_0x3b9a52,null));};exports[_0x9f07('0x50')]=function(_0x5e86e5,_0x796786,_0x27375d){var _0x43d44c={};var _0x557f01={};var _0x412bfc;var _0x5062d0;return db[_0x9f07('0x2c')]['findOne']({'where':{'id':_0x5e86e5[_0x9f07('0x44')]['id']}})[_0x9f07('0x26')](handleEntityNotFound(_0x796786,null))['then'](function(_0x2144cf){if(_0x2144cf){_0x412bfc=_0x2144cf;_0x557f01[_0x9f07('0x34')]=_[_0x9f07('0x31')](db['ServicenowField'][_0x9f07('0x2d')]);_0x557f01[_0x9f07('0x30')]=_[_0x9f07('0x31')](_0x5e86e5['query']);_0x557f01[_0x9f07('0x32')]=_[_0x9f07('0x33')](_0x557f01[_0x9f07('0x34')],_0x557f01[_0x9f07('0x30')]);_0x43d44c[_0x9f07('0x35')]=_[_0x9f07('0x33')](_0x557f01['model'],qs[_0x9f07('0x36')](_0x5e86e5[_0x9f07('0x30')][_0x9f07('0x36')]));_0x43d44c[_0x9f07('0x35')]=_0x43d44c[_0x9f07('0x35')][_0x9f07('0x45')]?_0x43d44c[_0x9f07('0x35')]:_0x557f01['model'];_0x43d44c[_0x9f07('0x39')]=qs[_0x9f07('0x3a')](_0x5e86e5[_0x9f07('0x30')][_0x9f07('0x3a')]);_0x43d44c[_0x9f07('0x3b')]=qs[_0x9f07('0x32')](_[_0x9f07('0x3c')](_0x5e86e5[_0x9f07('0x30')],_0x557f01['filters']));if(_0x5e86e5['query']['filter']){_0x43d44c[_0x9f07('0x3b')]=_[_0x9f07('0x3d')](_0x43d44c[_0x9f07('0x3b')],{'$or':_[_0x9f07('0x2f')](_0x43d44c[_0x9f07('0x35')],function(_0x264733){var _0x246c7c={};_0x246c7c[_0x264733]={'$like':'%'+_0x5e86e5[_0x9f07('0x30')][_0x9f07('0x4e')]+'%'};return _0x246c7c;})});}_0x43d44c=_[_0x9f07('0x3d')]({},_0x43d44c,_0x5e86e5[_0x9f07('0x46')]);return _0x412bfc['getDescriptions'](_0x43d44c);}})['then'](function(_0x284f03){if(_0x284f03){_0x5062d0=_0x284f03[_0x9f07('0x45')];if(!_0x5e86e5[_0x9f07('0x30')][_0x9f07('0x37')](_0x9f07('0x38'))){_0x43d44c[_0x9f07('0x20')]=qs[_0x9f07('0x20')](_0x5e86e5[_0x9f07('0x30')][_0x9f07('0x20')]);_0x43d44c['offset']=qs[_0x9f07('0x1e')](_0x5e86e5[_0x9f07('0x30')][_0x9f07('0x1e')]);}return _0x412bfc[_0x9f07('0x50')](_0x43d44c);}})['then'](function(_0x43ef48){if(_0x43ef48){return _0x43ef48?{'count':_0x5062d0,'rows':_0x43ef48}:null;}})[_0x9f07('0x26')](respondWithResult(_0x796786,null))['catch'](handleError(_0x796786,null));}; \ No newline at end of file +var _0x3ad0=['hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','then','catch','show','params','include','find','create','body','getFields','findOne','ServicenowField','pick','getSubjects','getDescriptions','fast-json-patch','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length'];(function(_0x2edb81,_0x215538){var _0x1a8e8b=function(_0x2cfcc2){while(--_0x2cfcc2){_0x2edb81['push'](_0x2edb81['shift']());}};_0x1a8e8b(++_0x215538);}(_0x3ad0,0xff));var _0x03ad=function(_0x5959ad,_0x5a009f){_0x5959ad=_0x5959ad-0x0;var _0x819929=_0x3ad0[_0x5959ad];return _0x819929;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x03ad('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x03ad('0x1'));var util=require('util');var path=require(_0x03ad('0x2'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x03ad('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03ad('0x4'));var squel=require(_0x03ad('0x5'));var crypto=require(_0x03ad('0x6'));var jsforce=require(_0x03ad('0x7'));var deskjs=require(_0x03ad('0x8'));var toCsv=require(_0x03ad('0x9'));var querystring=require(_0x03ad('0xa'));var Papa=require(_0x03ad('0xb'));var Redis=require(_0x03ad('0xc'));var authService=require(_0x03ad('0xd'));var qs=require(_0x03ad('0xe'));var as=require(_0x03ad('0xf'));var hardwareService=require(_0x03ad('0x10'));var logger=require(_0x03ad('0x11'))('api');var utils=require(_0x03ad('0x12'));var config=require(_0x03ad('0x13'));var licenseUtil=require(_0x03ad('0x14'));var db=require(_0x03ad('0x15'))['db'];function respondWithStatusCode(_0x4884e8,_0x1648ec){_0x1648ec=_0x1648ec||0xcc;return function(_0x9aaefb){if(_0x9aaefb){return _0x4884e8['sendStatus'](_0x1648ec);}return _0x4884e8[_0x03ad('0x16')](_0x1648ec)['end']();};}function respondWithResult(_0xbebc7b,_0x94acdb){_0x94acdb=_0x94acdb||0xc8;return function(_0xed7adc){if(_0xed7adc){return _0xbebc7b[_0x03ad('0x16')](_0x94acdb)[_0x03ad('0x17')](_0xed7adc);}};}function respondWithFilteredResult(_0x1bb8a6,_0x554246){return function(_0x2c6def){if(_0x2c6def){var _0x55ad81=typeof _0x554246[_0x03ad('0x18')]===_0x03ad('0x19')&&typeof _0x554246[_0x03ad('0x1a')]===_0x03ad('0x19');var _0x1e1f52=_0x2c6def[_0x03ad('0x1b')];var _0x537d87=_0x55ad81?0x0:_0x554246[_0x03ad('0x18')];var _0x20db0a=_0x55ad81?_0x2c6def[_0x03ad('0x1b')]:_0x554246[_0x03ad('0x18')]+_0x554246[_0x03ad('0x1a')];var _0x243d5b;if(_0x20db0a>=_0x1e1f52){_0x20db0a=_0x1e1f52;_0x243d5b=0xc8;}else{_0x243d5b=0xce;}_0x1bb8a6['status'](_0x243d5b);return _0x1bb8a6['set'](_0x03ad('0x1c'),_0x537d87+'-'+_0x20db0a+'/'+_0x1e1f52)[_0x03ad('0x17')](_0x2c6def);}return null;};}function patchUpdates(_0x2ec6f3){return function(_0x52d5dd){try{jsonpatch[_0x03ad('0x1d')](_0x52d5dd,_0x2ec6f3,!![]);}catch(_0x51f791){return BPromise[_0x03ad('0x1e')](_0x51f791);}return _0x52d5dd[_0x03ad('0x1f')]();};}function saveUpdates(_0x171946,_0x577192){return function(_0xca277){if(_0xca277){return _0xca277[_0x03ad('0x20')](_0x171946)['then'](function(_0x97bead){return _0x97bead;});}return null;};}function removeEntity(_0x33183d,_0xabbf33){return function(_0x40a87c){if(_0x40a87c){return _0x40a87c[_0x03ad('0x21')]()['then'](function(){_0x33183d[_0x03ad('0x16')](0xcc)[_0x03ad('0x22')]();});}};}function handleEntityNotFound(_0x4ba15f,_0x21a275){return function(_0x1b0af7){if(!_0x1b0af7){_0x4ba15f['sendStatus'](0x194);}return _0x1b0af7;};}function handleError(_0x2d4074,_0x47c0e3){_0x47c0e3=_0x47c0e3||0x1f4;return function(_0x33f0cf){logger[_0x03ad('0x23')](_0x33f0cf[_0x03ad('0x24')]);if(_0x33f0cf[_0x03ad('0x25')]){delete _0x33f0cf[_0x03ad('0x25')];}_0x2d4074['status'](_0x47c0e3)[_0x03ad('0x26')](_0x33f0cf);};}exports[_0x03ad('0x27')]=function(_0x11e973,_0x30db16){var _0x22b352={},_0x1380b3={},_0x5c0758={'count':0x0,'rows':[]};var _0x4ef96c=_[_0x03ad('0x28')](db[_0x03ad('0x29')][_0x03ad('0x2a')],function(_0x4ba0e8){return{'name':_0x4ba0e8[_0x03ad('0x2b')],'type':_0x4ba0e8[_0x03ad('0x2c')][_0x03ad('0x2d')]};});_0x1380b3['model']=_['map'](_0x4ef96c,_0x03ad('0x25'));_0x1380b3[_0x03ad('0x2e')]=_[_0x03ad('0x2f')](_0x11e973[_0x03ad('0x2e')]);_0x1380b3['filters']=_[_0x03ad('0x30')](_0x1380b3[_0x03ad('0x31')],_0x1380b3[_0x03ad('0x2e')]);_0x22b352[_0x03ad('0x32')]=_['intersection'](_0x1380b3[_0x03ad('0x31')],qs['fields'](_0x11e973[_0x03ad('0x2e')][_0x03ad('0x33')]));_0x22b352['attributes']=_0x22b352[_0x03ad('0x32')][_0x03ad('0x34')]?_0x22b352[_0x03ad('0x32')]:_0x1380b3[_0x03ad('0x31')];if(!_0x11e973[_0x03ad('0x2e')][_0x03ad('0x35')](_0x03ad('0x36'))){_0x22b352[_0x03ad('0x1a')]=qs[_0x03ad('0x1a')](_0x11e973[_0x03ad('0x2e')][_0x03ad('0x1a')]);_0x22b352['offset']=qs[_0x03ad('0x18')](_0x11e973['query']['offset']);}_0x22b352[_0x03ad('0x37')]=qs[_0x03ad('0x38')](_0x11e973[_0x03ad('0x2e')][_0x03ad('0x38')]);_0x22b352['where']=qs['filters'](_['pick'](_0x11e973['query'],_0x1380b3[_0x03ad('0x39')]),_0x4ef96c);if(_0x11e973['query'][_0x03ad('0x3a')]){_0x22b352[_0x03ad('0x3b')]=_[_0x03ad('0x3c')](_0x22b352['where'],{'$or':_[_0x03ad('0x28')](_0x4ef96c,function(_0x229e53){if(_0x229e53[_0x03ad('0x2c')]!==_0x03ad('0x3d')){var _0x58cedc={};_0x58cedc[_0x229e53[_0x03ad('0x25')]]={'$like':'%'+_0x11e973[_0x03ad('0x2e')][_0x03ad('0x3a')]+'%'};return _0x58cedc;}})});}_0x22b352=_['merge']({},_0x22b352,_0x11e973[_0x03ad('0x3e')]);var _0x45e1da={'where':_0x22b352[_0x03ad('0x3b')]};return db['ServicenowConfiguration']['count'](_0x45e1da)[_0x03ad('0x3f')](function(_0x1c1e39){_0x5c0758[_0x03ad('0x1b')]=_0x1c1e39;if(_0x11e973['query']['includeAll']){_0x22b352['include']=[{'all':!![]}];}return db[_0x03ad('0x29')]['findAll'](_0x22b352);})[_0x03ad('0x3f')](function(_0x31a31f){_0x5c0758['rows']=_0x31a31f;return _0x5c0758;})[_0x03ad('0x3f')](respondWithFilteredResult(_0x30db16,_0x22b352))[_0x03ad('0x40')](handleError(_0x30db16,null));};exports[_0x03ad('0x41')]=function(_0x575469,_0x3ad450){var _0x403ba={'raw':![],'where':{'id':_0x575469[_0x03ad('0x42')]['id']}},_0x5c41ed={};_0x5c41ed[_0x03ad('0x31')]=_[_0x03ad('0x2f')](db[_0x03ad('0x29')][_0x03ad('0x2a')]);_0x5c41ed['query']=_['keys'](_0x575469[_0x03ad('0x2e')]);_0x5c41ed[_0x03ad('0x39')]=_[_0x03ad('0x30')](_0x5c41ed['model'],_0x5c41ed[_0x03ad('0x2e')]);_0x403ba[_0x03ad('0x32')]=_[_0x03ad('0x30')](_0x5c41ed[_0x03ad('0x31')],qs[_0x03ad('0x33')](_0x575469[_0x03ad('0x2e')][_0x03ad('0x33')]));_0x403ba[_0x03ad('0x32')]=_0x403ba[_0x03ad('0x32')][_0x03ad('0x34')]?_0x403ba[_0x03ad('0x32')]:_0x5c41ed['model'];if(_0x575469[_0x03ad('0x2e')]['includeAll']){_0x403ba[_0x03ad('0x43')]=[{'all':!![]}];}_0x403ba=_[_0x03ad('0x3c')]({},_0x403ba,_0x575469[_0x03ad('0x3e')]);return db['ServicenowConfiguration'][_0x03ad('0x44')](_0x403ba)[_0x03ad('0x3f')](handleEntityNotFound(_0x3ad450,null))[_0x03ad('0x3f')](respondWithResult(_0x3ad450,null))[_0x03ad('0x40')](handleError(_0x3ad450,null));};exports[_0x03ad('0x45')]=function(_0x369bb6,_0x5e4f09){return db[_0x03ad('0x29')][_0x03ad('0x45')](_0x369bb6[_0x03ad('0x46')],{})[_0x03ad('0x3f')](respondWithResult(_0x5e4f09,0xc9))[_0x03ad('0x40')](handleError(_0x5e4f09,null));};exports[_0x03ad('0x20')]=function(_0x19d165,_0x56dea5){if(_0x19d165[_0x03ad('0x46')]['id']){delete _0x19d165[_0x03ad('0x46')]['id'];}return db[_0x03ad('0x29')]['find']({'where':{'id':_0x19d165[_0x03ad('0x42')]['id']}})[_0x03ad('0x3f')](handleEntityNotFound(_0x56dea5,null))[_0x03ad('0x3f')](saveUpdates(_0x19d165[_0x03ad('0x46')],null))[_0x03ad('0x3f')](respondWithResult(_0x56dea5,null))['catch'](handleError(_0x56dea5,null));};exports[_0x03ad('0x21')]=function(_0x25be00,_0x4bbb70){return db[_0x03ad('0x29')]['find']({'where':{'id':_0x25be00['params']['id']}})[_0x03ad('0x3f')](handleEntityNotFound(_0x4bbb70,null))['then'](removeEntity(_0x4bbb70,null))[_0x03ad('0x40')](handleError(_0x4bbb70,null));};exports[_0x03ad('0x47')]=function(_0x1f9f2e,_0x9732a7,_0x38da06){var _0xe384d3={};var _0x43d9f2={};var _0x60dbfc;var _0x192b60;return db['ServicenowConfiguration'][_0x03ad('0x48')]({'where':{'id':_0x1f9f2e[_0x03ad('0x42')]['id']}})[_0x03ad('0x3f')](handleEntityNotFound(_0x9732a7,null))[_0x03ad('0x3f')](function(_0x26e901){if(_0x26e901){_0x60dbfc=_0x26e901;_0x43d9f2[_0x03ad('0x31')]=_[_0x03ad('0x2f')](db[_0x03ad('0x49')][_0x03ad('0x2a')]);_0x43d9f2[_0x03ad('0x2e')]=_[_0x03ad('0x2f')](_0x1f9f2e[_0x03ad('0x2e')]);_0x43d9f2[_0x03ad('0x39')]=_[_0x03ad('0x30')](_0x43d9f2[_0x03ad('0x31')],_0x43d9f2[_0x03ad('0x2e')]);_0xe384d3[_0x03ad('0x32')]=_[_0x03ad('0x30')](_0x43d9f2['model'],qs[_0x03ad('0x33')](_0x1f9f2e[_0x03ad('0x2e')][_0x03ad('0x33')]));_0xe384d3['attributes']=_0xe384d3[_0x03ad('0x32')][_0x03ad('0x34')]?_0xe384d3[_0x03ad('0x32')]:_0x43d9f2[_0x03ad('0x31')];_0xe384d3['order']=qs['sort'](_0x1f9f2e[_0x03ad('0x2e')]['sort']);_0xe384d3[_0x03ad('0x3b')]=qs[_0x03ad('0x39')](_[_0x03ad('0x4a')](_0x1f9f2e[_0x03ad('0x2e')],_0x43d9f2['filters']));if(_0x1f9f2e[_0x03ad('0x2e')][_0x03ad('0x3a')]){_0xe384d3[_0x03ad('0x3b')]=_[_0x03ad('0x3c')](_0xe384d3['where'],{'$or':_[_0x03ad('0x28')](_0xe384d3[_0x03ad('0x32')],function(_0x351525){var _0xc1dcac={};_0xc1dcac[_0x351525]={'$like':'%'+_0x1f9f2e[_0x03ad('0x2e')]['filter']+'%'};return _0xc1dcac;})});}_0xe384d3=_[_0x03ad('0x3c')]({},_0xe384d3,_0x1f9f2e[_0x03ad('0x3e')]);return _0x60dbfc[_0x03ad('0x47')](_0xe384d3);}})[_0x03ad('0x3f')](function(_0x24b9a9){if(_0x24b9a9){_0x192b60=_0x24b9a9['length'];if(!_0x1f9f2e['query']['hasOwnProperty'](_0x03ad('0x36'))){_0xe384d3['limit']=qs[_0x03ad('0x1a')](_0x1f9f2e[_0x03ad('0x2e')]['limit']);_0xe384d3[_0x03ad('0x18')]=qs[_0x03ad('0x18')](_0x1f9f2e['query'][_0x03ad('0x18')]);}return _0x60dbfc['getFields'](_0xe384d3);}})[_0x03ad('0x3f')](function(_0x178e56){if(_0x178e56){return _0x178e56?{'count':_0x192b60,'rows':_0x178e56}:null;}})[_0x03ad('0x3f')](respondWithResult(_0x9732a7,null))[_0x03ad('0x40')](handleError(_0x9732a7,null));};exports[_0x03ad('0x4b')]=function(_0x410c28,_0x5a5435,_0x427c57){var _0x381766={};var _0x25cec6={};var _0x264513;var _0x53c581;return db[_0x03ad('0x29')][_0x03ad('0x48')]({'where':{'id':_0x410c28[_0x03ad('0x42')]['id']}})[_0x03ad('0x3f')](handleEntityNotFound(_0x5a5435,null))[_0x03ad('0x3f')](function(_0x2e086e){if(_0x2e086e){_0x264513=_0x2e086e;_0x25cec6[_0x03ad('0x31')]=_[_0x03ad('0x2f')](db[_0x03ad('0x49')]['rawAttributes']);_0x25cec6[_0x03ad('0x2e')]=_['keys'](_0x410c28['query']);_0x25cec6[_0x03ad('0x39')]=_[_0x03ad('0x30')](_0x25cec6['model'],_0x25cec6['query']);_0x381766[_0x03ad('0x32')]=_['intersection'](_0x25cec6[_0x03ad('0x31')],qs['fields'](_0x410c28[_0x03ad('0x2e')][_0x03ad('0x33')]));_0x381766[_0x03ad('0x32')]=_0x381766[_0x03ad('0x32')][_0x03ad('0x34')]?_0x381766[_0x03ad('0x32')]:_0x25cec6['model'];_0x381766[_0x03ad('0x37')]=qs[_0x03ad('0x38')](_0x410c28[_0x03ad('0x2e')][_0x03ad('0x38')]);_0x381766[_0x03ad('0x3b')]=qs['filters'](_[_0x03ad('0x4a')](_0x410c28['query'],_0x25cec6[_0x03ad('0x39')]));if(_0x410c28[_0x03ad('0x2e')][_0x03ad('0x3a')]){_0x381766[_0x03ad('0x3b')]=_[_0x03ad('0x3c')](_0x381766[_0x03ad('0x3b')],{'$or':_[_0x03ad('0x28')](_0x381766[_0x03ad('0x32')],function(_0x49ec3b){var _0x518a96={};_0x518a96[_0x49ec3b]={'$like':'%'+_0x410c28[_0x03ad('0x2e')][_0x03ad('0x3a')]+'%'};return _0x518a96;})});}_0x381766=_[_0x03ad('0x3c')]({},_0x381766,_0x410c28['options']);return _0x264513[_0x03ad('0x4b')](_0x381766);}})[_0x03ad('0x3f')](function(_0x5f84de){if(_0x5f84de){_0x53c581=_0x5f84de[_0x03ad('0x34')];if(!_0x410c28[_0x03ad('0x2e')][_0x03ad('0x35')](_0x03ad('0x36'))){_0x381766[_0x03ad('0x1a')]=qs[_0x03ad('0x1a')](_0x410c28[_0x03ad('0x2e')][_0x03ad('0x1a')]);_0x381766['offset']=qs[_0x03ad('0x18')](_0x410c28[_0x03ad('0x2e')][_0x03ad('0x18')]);}return _0x264513[_0x03ad('0x4b')](_0x381766);}})[_0x03ad('0x3f')](function(_0x308140){if(_0x308140){return _0x308140?{'count':_0x53c581,'rows':_0x308140}:null;}})[_0x03ad('0x3f')](respondWithResult(_0x5a5435,null))[_0x03ad('0x40')](handleError(_0x5a5435,null));};exports[_0x03ad('0x4c')]=function(_0x49cfe3,_0x2dd4b6,_0x43d00b){var _0x18f053={};var _0x40b37b={};var _0x39c3fc;var _0x4e9932;return db[_0x03ad('0x29')][_0x03ad('0x48')]({'where':{'id':_0x49cfe3[_0x03ad('0x42')]['id']}})['then'](handleEntityNotFound(_0x2dd4b6,null))[_0x03ad('0x3f')](function(_0x5fc25d){if(_0x5fc25d){_0x39c3fc=_0x5fc25d;_0x40b37b[_0x03ad('0x31')]=_[_0x03ad('0x2f')](db['ServicenowField'][_0x03ad('0x2a')]);_0x40b37b[_0x03ad('0x2e')]=_[_0x03ad('0x2f')](_0x49cfe3[_0x03ad('0x2e')]);_0x40b37b['filters']=_['intersection'](_0x40b37b['model'],_0x40b37b[_0x03ad('0x2e')]);_0x18f053[_0x03ad('0x32')]=_[_0x03ad('0x30')](_0x40b37b[_0x03ad('0x31')],qs[_0x03ad('0x33')](_0x49cfe3[_0x03ad('0x2e')][_0x03ad('0x33')]));_0x18f053[_0x03ad('0x32')]=_0x18f053['attributes'][_0x03ad('0x34')]?_0x18f053[_0x03ad('0x32')]:_0x40b37b[_0x03ad('0x31')];_0x18f053['order']=qs[_0x03ad('0x38')](_0x49cfe3['query'][_0x03ad('0x38')]);_0x18f053[_0x03ad('0x3b')]=qs[_0x03ad('0x39')](_[_0x03ad('0x4a')](_0x49cfe3['query'],_0x40b37b[_0x03ad('0x39')]));if(_0x49cfe3[_0x03ad('0x2e')][_0x03ad('0x3a')]){_0x18f053[_0x03ad('0x3b')]=_[_0x03ad('0x3c')](_0x18f053[_0x03ad('0x3b')],{'$or':_[_0x03ad('0x28')](_0x18f053[_0x03ad('0x32')],function(_0x5eb809){var _0x54a6cc={};_0x54a6cc[_0x5eb809]={'$like':'%'+_0x49cfe3['query'][_0x03ad('0x3a')]+'%'};return _0x54a6cc;})});}_0x18f053=_[_0x03ad('0x3c')]({},_0x18f053,_0x49cfe3[_0x03ad('0x3e')]);return _0x39c3fc[_0x03ad('0x4c')](_0x18f053);}})[_0x03ad('0x3f')](function(_0x2d6e3e){if(_0x2d6e3e){_0x4e9932=_0x2d6e3e[_0x03ad('0x34')];if(!_0x49cfe3[_0x03ad('0x2e')][_0x03ad('0x35')](_0x03ad('0x36'))){_0x18f053['limit']=qs[_0x03ad('0x1a')](_0x49cfe3[_0x03ad('0x2e')][_0x03ad('0x1a')]);_0x18f053['offset']=qs['offset'](_0x49cfe3[_0x03ad('0x2e')]['offset']);}return _0x39c3fc['getDescriptions'](_0x18f053);}})['then'](function(_0x1a865b){if(_0x1a865b){return _0x1a865b?{'count':_0x4e9932,'rows':_0x1a865b}:null;}})[_0x03ad('0x3f')](respondWithResult(_0x2dd4b6,null))[_0x03ad('0x40')](handleError(_0x2dd4b6,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 91ea620..333f69a 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 _0x4959=['int_servicenow_configurations','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4959,0x9b));var _0x9495=function(_0x40e9b8,_0x2e5267){_0x40e9b8=_0x40e9b8-0x0;var _0x4a4f56=_0x4959[_0x40e9b8];return _0x4a4f56;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9495('0x0'))(_0x9495('0x1'));var moment=require(_0x9495('0x2'));var BPromise=require('bluebird');var rp=require(_0x9495('0x3'));var fs=require('fs');var path=require(_0x9495('0x4'));var rimraf=require(_0x9495('0x5'));var config=require(_0x9495('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x9495('0x7')]=function(_0x2225a0,_0x2c716d){return _0x2225a0[_0x9495('0x8')](_0x9495('0x9'),attributes,{'tableName':_0x9495('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x530f=['path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','util','moment','bluebird','request-promise'];(function(_0x2e5ea9,_0x4d280a){var _0x228844=function(_0x2b3707){while(--_0x2b3707){_0x2e5ea9['push'](_0x2e5ea9['shift']());}};_0x228844(++_0x4d280a);}(_0x530f,0x167));var _0xf530=function(_0x2f4d7f,_0x62f4b7){_0x2f4d7f=_0x2f4d7f-0x0;var _0x147ba1=_0x530f[_0x2f4d7f];return _0x147ba1;};'use strict';var _=require('lodash');var util=require(_0xf530('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf530('0x1'));var BPromise=require(_0xf530('0x2'));var rp=require(_0xf530('0x3'));var fs=require('fs');var path=require(_0xf530('0x4'));var rimraf=require(_0xf530('0x5'));var config=require(_0xf530('0x6'));var attributes=require(_0xf530('0x7'));module[_0xf530('0x8')]=function(_0x58f5f8,_0x3a0301){return _0x58f5f8[_0xf530('0x9')](_0xf530('0xa'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index e3dc97e..e807e05 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 _0x2882=['request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','info','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x30904d,_0x47c538){var _0x175296=function(_0x4d8e46){while(--_0x4d8e46){_0x30904d['push'](_0x30904d['shift']());}};_0x175296(++_0x47c538);}(_0x2882,0x1db));var _0x2288=function(_0x9d97e8,_0x44a55b){_0x9d97e8=_0x9d97e8-0x0;var _0x29e3f5=_0x2882[_0x9d97e8];return _0x29e3f5;};'use strict';var _=require(_0x2288('0x0'));var util=require('util');var moment=require(_0x2288('0x1'));var BPromise=require(_0x2288('0x2'));var rs=require(_0x2288('0x3'));var fs=require('fs');var Redis=require(_0x2288('0x4'));var db=require(_0x2288('0x5'))['db'];var utils=require(_0x2288('0x6'));var logger=require(_0x2288('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2288('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x162771,_0x35acd6,_0x2d84ff){return new BPromise(function(_0x5ea93d,_0x4d251b){return client['request'](_0x162771,_0x2d84ff)['then'](function(_0x42f1b0){logger[_0x2288('0x9')](_0x2288('0xa'),_0x35acd6,_0x2288('0xb'));logger[_0x2288('0xc')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x35acd6,_0x2288('0xb'),JSON['stringify'](_0x42f1b0));if(_0x42f1b0['error']){if(_0x42f1b0[_0x2288('0xd')][_0x2288('0xe')]===0x1f4){logger[_0x2288('0xd')](_0x2288('0xa'),_0x35acd6,_0x42f1b0[_0x2288('0xd')][_0x2288('0xf')]);return _0x4d251b(_0x42f1b0[_0x2288('0xd')][_0x2288('0xf')]);}logger[_0x2288('0xd')](_0x2288('0xa'),_0x35acd6,_0x42f1b0[_0x2288('0xd')]['message']);return _0x5ea93d(_0x42f1b0[_0x2288('0xd')][_0x2288('0xf')]);}else{logger[_0x2288('0x9')](_0x2288('0xa'),_0x35acd6,_0x2288('0xb'));_0x5ea93d(_0x42f1b0[_0x2288('0x10')][_0x2288('0xf')]);}})[_0x2288('0x11')](function(_0x39805d){logger['error'](_0x2288('0xa'),_0x35acd6,_0x39805d);_0x4d251b(_0x39805d);});});} \ No newline at end of file +var _0x1d5f=['client','request','then','info','request\x20sent','debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1d5f,0x8a));var _0xf1d5=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x1d5f[_0x3b150c];return _0x5cd414;};'use strict';var _=require('lodash');var util=require(_0xf1d5('0x0'));var moment=require(_0xf1d5('0x1'));var BPromise=require('bluebird');var rs=require(_0xf1d5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1d5('0x3'))['db'];var utils=require(_0xf1d5('0x4'));var logger=require(_0xf1d5('0x5'))(_0xf1d5('0x6'));var config=require(_0xf1d5('0x7'));var jayson=require(_0xf1d5('0x8'));var client=jayson[_0xf1d5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b37d2,_0x2aa190,_0x564103){return new BPromise(function(_0x36d7bb,_0x2d75a9){return client[_0xf1d5('0xa')](_0x4b37d2,_0x564103)[_0xf1d5('0xb')](function(_0x32b778){logger[_0xf1d5('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2aa190,_0xf1d5('0xd'));logger[_0xf1d5('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2aa190,_0xf1d5('0xd'),JSON[_0xf1d5('0xf')](_0x32b778));if(_0x32b778[_0xf1d5('0x10')]){if(_0x32b778['error'][_0xf1d5('0x11')]===0x1f4){logger['error'](_0xf1d5('0x12'),_0x2aa190,_0x32b778[_0xf1d5('0x10')][_0xf1d5('0x13')]);return _0x2d75a9(_0x32b778[_0xf1d5('0x10')]['message']);}logger['error'](_0xf1d5('0x12'),_0x2aa190,_0x32b778[_0xf1d5('0x10')][_0xf1d5('0x13')]);return _0x36d7bb(_0x32b778[_0xf1d5('0x10')][_0xf1d5('0x13')]);}else{logger[_0xf1d5('0xc')](_0xf1d5('0x12'),_0x2aa190,_0xf1d5('0xd'));_0x36d7bb(_0x32b778['result'][_0xf1d5('0x13')]);}})[_0xf1d5('0x14')](function(_0x2725e8){logger[_0xf1d5('0x10')](_0xf1d5('0x12'),_0x2aa190,_0x2725e8);_0x2d75a9(_0x2725e8);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 8f48b63..c6fe87b 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 _0x80f5=['get','isAuthenticated','/:id','show','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowField.controller'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x80f5,0x1d4));var _0x580f=function(_0x4ddc0e,_0x349cab){_0x4ddc0e=_0x4ddc0e-0x0;var _0x17a6a4=_0x80f5[_0x4ddc0e];return _0x17a6a4;};'use strict';var multer=require(_0x580f('0x0'));var util=require('util');var path=require(_0x580f('0x1'));var timeout=require(_0x580f('0x2'));var express=require(_0x580f('0x3'));var router=express[_0x580f('0x4')]();var fs_extra=require(_0x580f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x580f('0x6'));var config=require('../../config/environment');var controller=require(_0x580f('0x7'));router[_0x580f('0x8')]('/',auth[_0x580f('0x9')](),controller['index']);router[_0x580f('0x8')](_0x580f('0xa'),auth[_0x580f('0x9')](),controller[_0x580f('0xb')]);router['post']('/',auth[_0x580f('0x9')](),controller[_0x580f('0xc')]);router['put'](_0x580f('0xa'),auth[_0x580f('0x9')](),controller[_0x580f('0xd')]);router[_0x580f('0xe')](_0x580f('0xa'),auth['isAuthenticated'](),controller[_0x580f('0xf')]);module[_0x580f('0x10')]=router; \ No newline at end of file +var _0x19af=['Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x4980ea,_0x506f69){var _0x4038d2=function(_0x2cfd62){while(--_0x2cfd62){_0x4980ea['push'](_0x4980ea['shift']());}};_0x4038d2(++_0x506f69);}(_0x19af,0x184));var _0xf19a=function(_0x1fb114,_0x2a1b98){_0x1fb114=_0x1fb114-0x0;var _0x1819f4=_0x19af[_0x1fb114];return _0x1819f4;};'use strict';var multer=require('multer');var util=require(_0xf19a('0x0'));var path=require(_0xf19a('0x1'));var timeout=require(_0xf19a('0x2'));var express=require('express');var router=express[_0xf19a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf19a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf19a('0x5'));var controller=require(_0xf19a('0x6'));router[_0xf19a('0x7')]('/',auth['isAuthenticated'](),controller[_0xf19a('0x8')]);router[_0xf19a('0x7')](_0xf19a('0x9'),auth[_0xf19a('0xa')](),controller[_0xf19a('0xb')]);router['post']('/',auth[_0xf19a('0xa')](),controller[_0xf19a('0xc')]);router[_0xf19a('0xd')](_0xf19a('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xf19a('0xe')](_0xf19a('0x9'),auth[_0xf19a('0xa')](),controller[_0xf19a('0xf')]);module[_0xf19a('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index ea4133b..63d3377 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 _0x86cc=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x149e16,_0x13c8d0){var _0x5142e0=function(_0x2a6650){while(--_0x2a6650){_0x149e16['push'](_0x149e16['shift']());}};_0x5142e0(++_0x13c8d0);}(_0x86cc,0x14a));var _0xc86c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x86cc[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc86c('0x0'));module[_0xc86c('0x1')]={'type':{'type':Sequelize[_0xc86c('0x2')](_0xc86c('0x3'),_0xc86c('0x4'),_0xc86c('0x5'),'keyValue',_0xc86c('0x6')),'defaultValue':_0xc86c('0x3')},'content':{'type':Sequelize[_0xc86c('0x7')]},'key':{'type':Sequelize[_0xc86c('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xc86c('0x3'),_0xc86c('0x4'),_0xc86c('0x5'))},'keyContent':{'type':Sequelize[_0xc86c('0x7')]},'idField':{'type':Sequelize[_0xc86c('0x7')]},'nameField':{'type':Sequelize[_0xc86c('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc86c('0x7')]}}; \ No newline at end of file +var _0xedde=['STRING','BOOLEAN','ENUM','string','variable','customVariable','picklist'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xedde,0x16e));var _0xeedd=function(_0x5d8dce,_0x12f793){_0x5d8dce=_0x5d8dce-0x0;var _0x518e99=_0xedde[_0x5d8dce];return _0x518e99;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xeedd('0x0')](_0xeedd('0x1'),_0xeedd('0x2'),_0xeedd('0x3'),'keyValue',_0xeedd('0x4')),'defaultValue':_0xeedd('0x1')},'content':{'type':Sequelize[_0xeedd('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xeedd('0x0')]('string',_0xeedd('0x2'),_0xeedd('0x3'))},'keyContent':{'type':Sequelize[_0xeedd('0x5')]},'idField':{'type':Sequelize[_0xeedd('0x5')]},'nameField':{'type':Sequelize[_0xeedd('0x5')]},'customField':{'type':Sequelize[_0xeedd('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeedd('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 63ce30b..3a7aba6 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 _0x1012=['end','json','offset','undefined','limit','count','Content-Range','save','update','then','error','stack','name','index','ServicenowField','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x17ad9b,_0x462fca){var _0x5ca36c=function(_0x208011){while(--_0x208011){_0x17ad9b['push'](_0x17ad9b['shift']());}};_0x5ca36c(++_0x462fca);}(_0x1012,0x145));var _0x2101=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x1012[_0x2235bf];return _0x4c3a64;};'use strict';var emlformat=require(_0x2101('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2101('0x1'));var rp=require(_0x2101('0x2'));var moment=require('moment');var BPromise=require(_0x2101('0x3'));var Mustache=require(_0x2101('0x4'));var util=require(_0x2101('0x5'));var path=require(_0x2101('0x6'));var sox=require('sox');var csv=require(_0x2101('0x7'));var ejs=require(_0x2101('0x8'));var fs=require('fs');var fs_extra=require(_0x2101('0x9'));var _=require(_0x2101('0xa'));var squel=require(_0x2101('0xb'));var crypto=require(_0x2101('0xc'));var jsforce=require(_0x2101('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2101('0x7'));var querystring=require(_0x2101('0xe'));var Papa=require('papaparse');var Redis=require(_0x2101('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2101('0x10'));var hardwareService=require(_0x2101('0x11'));var logger=require(_0x2101('0x12'))(_0x2101('0x13'));var utils=require('../../config/utils');var config=require(_0x2101('0x14'));var licenseUtil=require(_0x2101('0x15'));var db=require(_0x2101('0x16'))['db'];function respondWithStatusCode(_0x262ebd,_0x59da78){_0x59da78=_0x59da78||0xcc;return function(_0x3c1ccd){if(_0x3c1ccd){return _0x262ebd[_0x2101('0x17')](_0x59da78);}return _0x262ebd[_0x2101('0x18')](_0x59da78)[_0x2101('0x19')]();};}function respondWithResult(_0x15518b,_0x511547){_0x511547=_0x511547||0xc8;return function(_0x55d196){if(_0x55d196){return _0x15518b[_0x2101('0x18')](_0x511547)[_0x2101('0x1a')](_0x55d196);}};}function respondWithFilteredResult(_0x5cea1e,_0x5a1cd9){return function(_0x5ad072){if(_0x5ad072){var _0x1b607a=typeof _0x5a1cd9[_0x2101('0x1b')]===_0x2101('0x1c')&&typeof _0x5a1cd9[_0x2101('0x1d')]===_0x2101('0x1c');var _0x388fe4=_0x5ad072[_0x2101('0x1e')];var _0x26a145=_0x1b607a?0x0:_0x5a1cd9['offset'];var _0x12c77c=_0x1b607a?_0x5ad072['count']:_0x5a1cd9[_0x2101('0x1b')]+_0x5a1cd9['limit'];var _0x559b60;if(_0x12c77c>=_0x388fe4){_0x12c77c=_0x388fe4;_0x559b60=0xc8;}else{_0x559b60=0xce;}_0x5cea1e[_0x2101('0x18')](_0x559b60);return _0x5cea1e['set'](_0x2101('0x1f'),_0x26a145+'-'+_0x12c77c+'/'+_0x388fe4)[_0x2101('0x1a')](_0x5ad072);}return null;};}function patchUpdates(_0x20f60f){return function(_0x3f77f5){try{jsonpatch['apply'](_0x3f77f5,_0x20f60f,!![]);}catch(_0x498b3c){return BPromise['reject'](_0x498b3c);}return _0x3f77f5[_0x2101('0x20')]();};}function saveUpdates(_0x13ab06,_0x3df807){return function(_0x51ef8b){if(_0x51ef8b){return _0x51ef8b[_0x2101('0x21')](_0x13ab06)[_0x2101('0x22')](function(_0x54f7df){return _0x54f7df;});}return null;};}function removeEntity(_0x107608,_0x531ffa){return function(_0x49c63e){if(_0x49c63e){return _0x49c63e['destroy']()[_0x2101('0x22')](function(){_0x107608[_0x2101('0x18')](0xcc)[_0x2101('0x19')]();});}};}function handleEntityNotFound(_0x177d79,_0x290613){return function(_0x5e1978){if(!_0x5e1978){_0x177d79[_0x2101('0x17')](0x194);}return _0x5e1978;};}function handleError(_0x464078,_0xd4e380){_0xd4e380=_0xd4e380||0x1f4;return function(_0x4b1094){logger[_0x2101('0x23')](_0x4b1094[_0x2101('0x24')]);if(_0x4b1094[_0x2101('0x25')]){delete _0x4b1094[_0x2101('0x25')];}_0x464078['status'](_0xd4e380)['send'](_0x4b1094);};}exports[_0x2101('0x26')]=function(_0x273b2d,_0x2e4520){var _0x1e18be={},_0x5be7af={},_0x4928a8={'count':0x0,'rows':[]};var _0x437ed8=_['map'](db[_0x2101('0x27')][_0x2101('0x28')],function(_0x25d403){return{'name':_0x25d403[_0x2101('0x29')],'type':_0x25d403[_0x2101('0x2a')]['key']};});_0x5be7af[_0x2101('0x2b')]=_[_0x2101('0x2c')](_0x437ed8,'name');_0x5be7af['query']=_[_0x2101('0x2d')](_0x273b2d[_0x2101('0x2e')]);_0x5be7af[_0x2101('0x2f')]=_['intersection'](_0x5be7af[_0x2101('0x2b')],_0x5be7af[_0x2101('0x2e')]);_0x1e18be[_0x2101('0x30')]=_[_0x2101('0x31')](_0x5be7af[_0x2101('0x2b')],qs[_0x2101('0x32')](_0x273b2d[_0x2101('0x2e')][_0x2101('0x32')]));_0x1e18be['attributes']=_0x1e18be['attributes'][_0x2101('0x33')]?_0x1e18be['attributes']:_0x5be7af[_0x2101('0x2b')];if(!_0x273b2d['query'][_0x2101('0x34')]('nolimit')){_0x1e18be[_0x2101('0x1d')]=qs[_0x2101('0x1d')](_0x273b2d[_0x2101('0x2e')][_0x2101('0x1d')]);_0x1e18be['offset']=qs['offset'](_0x273b2d[_0x2101('0x2e')]['offset']);}_0x1e18be[_0x2101('0x35')]=qs[_0x2101('0x36')](_0x273b2d[_0x2101('0x2e')][_0x2101('0x36')]);_0x1e18be[_0x2101('0x37')]=qs[_0x2101('0x2f')](_['pick'](_0x273b2d[_0x2101('0x2e')],_0x5be7af['filters']),_0x437ed8);if(_0x273b2d['query'][_0x2101('0x38')]){_0x1e18be[_0x2101('0x37')]=_['merge'](_0x1e18be[_0x2101('0x37')],{'$or':_[_0x2101('0x2c')](_0x437ed8,function(_0x28e8ad){if(_0x28e8ad['type']!==_0x2101('0x39')){var _0x2d952d={};_0x2d952d[_0x28e8ad[_0x2101('0x25')]]={'$like':'%'+_0x273b2d[_0x2101('0x2e')]['filter']+'%'};return _0x2d952d;}})});}_0x1e18be=_[_0x2101('0x3a')]({},_0x1e18be,_0x273b2d[_0x2101('0x3b')]);var _0x4a3bed={'where':_0x1e18be[_0x2101('0x37')]};return db[_0x2101('0x27')][_0x2101('0x1e')](_0x4a3bed)[_0x2101('0x22')](function(_0x137f9a){_0x4928a8['count']=_0x137f9a;if(_0x273b2d[_0x2101('0x2e')][_0x2101('0x3c')]){_0x1e18be[_0x2101('0x3d')]=[{'all':!![]}];}return db['ServicenowField'][_0x2101('0x3e')](_0x1e18be);})[_0x2101('0x22')](function(_0x275bae){_0x4928a8[_0x2101('0x3f')]=_0x275bae;return _0x4928a8;})['then'](respondWithFilteredResult(_0x2e4520,_0x1e18be))['catch'](handleError(_0x2e4520,null));};exports['show']=function(_0x257db1,_0x49a3d6){var _0x12ec00={'raw':!![],'where':{'id':_0x257db1[_0x2101('0x40')]['id']}},_0x268d9a={};_0x268d9a[_0x2101('0x2b')]=_['keys'](db['ServicenowField'][_0x2101('0x28')]);_0x268d9a[_0x2101('0x2e')]=_[_0x2101('0x2d')](_0x257db1[_0x2101('0x2e')]);_0x268d9a['filters']=_['intersection'](_0x268d9a[_0x2101('0x2b')],_0x268d9a[_0x2101('0x2e')]);_0x12ec00[_0x2101('0x30')]=_[_0x2101('0x31')](_0x268d9a[_0x2101('0x2b')],qs[_0x2101('0x32')](_0x257db1['query']['fields']));_0x12ec00[_0x2101('0x30')]=_0x12ec00['attributes'][_0x2101('0x33')]?_0x12ec00['attributes']:_0x268d9a['model'];if(_0x257db1[_0x2101('0x2e')]['includeAll']){_0x12ec00['include']=[{'all':!![]}];}_0x12ec00=_[_0x2101('0x3a')]({},_0x12ec00,_0x257db1[_0x2101('0x3b')]);return db[_0x2101('0x27')][_0x2101('0x41')](_0x12ec00)['then'](handleEntityNotFound(_0x49a3d6,null))['then'](respondWithResult(_0x49a3d6,null))[_0x2101('0x42')](handleError(_0x49a3d6,null));};exports['create']=function(_0x47d06b,_0x5abb84){return db[_0x2101('0x27')][_0x2101('0x43')](_0x47d06b[_0x2101('0x44')],{})[_0x2101('0x22')](respondWithResult(_0x5abb84,0xc9))[_0x2101('0x42')](handleError(_0x5abb84,null));};exports[_0x2101('0x21')]=function(_0x4b2b59,_0x285125){if(_0x4b2b59[_0x2101('0x44')]['id']){delete _0x4b2b59[_0x2101('0x44')]['id'];}return db[_0x2101('0x27')][_0x2101('0x41')]({'where':{'id':_0x4b2b59['params']['id']}})['then'](handleEntityNotFound(_0x285125,null))[_0x2101('0x22')](saveUpdates(_0x4b2b59['body'],null))[_0x2101('0x22')](respondWithResult(_0x285125,null))['catch'](handleError(_0x285125,null));};exports[_0x2101('0x45')]=function(_0x12e92d,_0x4266fc){return db['ServicenowField'][_0x2101('0x41')]({'where':{'id':_0x12e92d[_0x2101('0x40')]['id']}})[_0x2101('0x22')](handleEntityNotFound(_0x4266fc,null))[_0x2101('0x22')](removeEntity(_0x4266fc,null))['catch'](handleError(_0x4266fc,null));}; \ No newline at end of file +var _0xaebc=['body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','map','ServicenowField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create'];(function(_0x2f1d17,_0x5076aa){var _0x4b1270=function(_0x55125c){while(--_0x55125c){_0x2f1d17['push'](_0x2f1d17['shift']());}};_0x4b1270(++_0x5076aa);}(_0xaebc,0x1dc));var _0xcaeb=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0xaebc[_0x5b1c50];return _0x2d379b;};'use strict';var emlformat=require(_0xcaeb('0x0'));var rimraf=require(_0xcaeb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaeb('0x2'));var rp=require('request-promise');var moment=require(_0xcaeb('0x3'));var BPromise=require(_0xcaeb('0x4'));var Mustache=require(_0xcaeb('0x5'));var util=require(_0xcaeb('0x6'));var path=require(_0xcaeb('0x7'));var sox=require(_0xcaeb('0x8'));var csv=require(_0xcaeb('0x9'));var ejs=require(_0xcaeb('0xa'));var fs=require('fs');var fs_extra=require(_0xcaeb('0xb'));var _=require(_0xcaeb('0xc'));var squel=require(_0xcaeb('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcaeb('0xe'));var toCsv=require(_0xcaeb('0x9'));var querystring=require(_0xcaeb('0xf'));var Papa=require('papaparse');var Redis=require(_0xcaeb('0x10'));var authService=require(_0xcaeb('0x11'));var qs=require(_0xcaeb('0x12'));var as=require(_0xcaeb('0x13'));var hardwareService=require(_0xcaeb('0x14'));var logger=require(_0xcaeb('0x15'))(_0xcaeb('0x16'));var utils=require(_0xcaeb('0x17'));var config=require(_0xcaeb('0x18'));var licenseUtil=require(_0xcaeb('0x19'));var db=require(_0xcaeb('0x1a'))['db'];function respondWithStatusCode(_0x4fc06e,_0x35d00e){_0x35d00e=_0x35d00e||0xcc;return function(_0x38a43c){if(_0x38a43c){return _0x4fc06e[_0xcaeb('0x1b')](_0x35d00e);}return _0x4fc06e[_0xcaeb('0x1c')](_0x35d00e)[_0xcaeb('0x1d')]();};}function respondWithResult(_0x5232c0,_0x2bc8cc){_0x2bc8cc=_0x2bc8cc||0xc8;return function(_0x3f662e){if(_0x3f662e){return _0x5232c0[_0xcaeb('0x1c')](_0x2bc8cc)[_0xcaeb('0x1e')](_0x3f662e);}};}function respondWithFilteredResult(_0x442852,_0x20f628){return function(_0xf51bc6){if(_0xf51bc6){var _0x25fe60=typeof _0x20f628[_0xcaeb('0x1f')]==='undefined'&&typeof _0x20f628['limit']===_0xcaeb('0x20');var _0x1f6d74=_0xf51bc6['count'];var _0x45f040=_0x25fe60?0x0:_0x20f628[_0xcaeb('0x1f')];var _0x55908c=_0x25fe60?_0xf51bc6[_0xcaeb('0x21')]:_0x20f628[_0xcaeb('0x1f')]+_0x20f628[_0xcaeb('0x22')];var _0x4b39e4;if(_0x55908c>=_0x1f6d74){_0x55908c=_0x1f6d74;_0x4b39e4=0xc8;}else{_0x4b39e4=0xce;}_0x442852[_0xcaeb('0x1c')](_0x4b39e4);return _0x442852[_0xcaeb('0x23')](_0xcaeb('0x24'),_0x45f040+'-'+_0x55908c+'/'+_0x1f6d74)[_0xcaeb('0x1e')](_0xf51bc6);}return null;};}function patchUpdates(_0x2d1e7e){return function(_0x106a5b){try{jsonpatch[_0xcaeb('0x25')](_0x106a5b,_0x2d1e7e,!![]);}catch(_0x4bd289){return BPromise[_0xcaeb('0x26')](_0x4bd289);}return _0x106a5b[_0xcaeb('0x27')]();};}function saveUpdates(_0x3112ec,_0x306275){return function(_0x45dd55){if(_0x45dd55){return _0x45dd55['update'](_0x3112ec)['then'](function(_0xd3ff24){return _0xd3ff24;});}return null;};}function removeEntity(_0x296463,_0x3c8dd7){return function(_0x29b744){if(_0x29b744){return _0x29b744[_0xcaeb('0x28')]()['then'](function(){_0x296463[_0xcaeb('0x1c')](0xcc)[_0xcaeb('0x1d')]();});}};}function handleEntityNotFound(_0x392aa3,_0x3277ad){return function(_0x381618){if(!_0x381618){_0x392aa3[_0xcaeb('0x1b')](0x194);}return _0x381618;};}function handleError(_0x11a3d6,_0x1beb26){_0x1beb26=_0x1beb26||0x1f4;return function(_0x1ad749){logger[_0xcaeb('0x29')](_0x1ad749[_0xcaeb('0x2a')]);if(_0x1ad749['name']){delete _0x1ad749[_0xcaeb('0x2b')];}_0x11a3d6[_0xcaeb('0x1c')](_0x1beb26)[_0xcaeb('0x2c')](_0x1ad749);};}exports['index']=function(_0x32fca6,_0x48481b){var _0x3c900a={},_0x4186c0={},_0x2ed3c8={'count':0x0,'rows':[]};var _0x48ed30=_[_0xcaeb('0x2d')](db[_0xcaeb('0x2e')]['rawAttributes'],function(_0x418e2d){return{'name':_0x418e2d[_0xcaeb('0x2f')],'type':_0x418e2d[_0xcaeb('0x30')][_0xcaeb('0x31')]};});_0x4186c0[_0xcaeb('0x32')]=_['map'](_0x48ed30,_0xcaeb('0x2b'));_0x4186c0[_0xcaeb('0x33')]=_[_0xcaeb('0x34')](_0x32fca6['query']);_0x4186c0[_0xcaeb('0x35')]=_[_0xcaeb('0x36')](_0x4186c0[_0xcaeb('0x32')],_0x4186c0[_0xcaeb('0x33')]);_0x3c900a[_0xcaeb('0x37')]=_[_0xcaeb('0x36')](_0x4186c0['model'],qs[_0xcaeb('0x38')](_0x32fca6['query'][_0xcaeb('0x38')]));_0x3c900a[_0xcaeb('0x37')]=_0x3c900a[_0xcaeb('0x37')][_0xcaeb('0x39')]?_0x3c900a['attributes']:_0x4186c0[_0xcaeb('0x32')];if(!_0x32fca6[_0xcaeb('0x33')][_0xcaeb('0x3a')](_0xcaeb('0x3b'))){_0x3c900a['limit']=qs[_0xcaeb('0x22')](_0x32fca6[_0xcaeb('0x33')][_0xcaeb('0x22')]);_0x3c900a[_0xcaeb('0x1f')]=qs[_0xcaeb('0x1f')](_0x32fca6[_0xcaeb('0x33')]['offset']);}_0x3c900a[_0xcaeb('0x3c')]=qs[_0xcaeb('0x3d')](_0x32fca6[_0xcaeb('0x33')][_0xcaeb('0x3d')]);_0x3c900a[_0xcaeb('0x3e')]=qs['filters'](_[_0xcaeb('0x3f')](_0x32fca6[_0xcaeb('0x33')],_0x4186c0['filters']),_0x48ed30);if(_0x32fca6[_0xcaeb('0x33')][_0xcaeb('0x40')]){_0x3c900a[_0xcaeb('0x3e')]=_[_0xcaeb('0x41')](_0x3c900a['where'],{'$or':_[_0xcaeb('0x2d')](_0x48ed30,function(_0x28f347){if(_0x28f347[_0xcaeb('0x30')]!==_0xcaeb('0x42')){var _0x3ad52d={};_0x3ad52d[_0x28f347[_0xcaeb('0x2b')]]={'$like':'%'+_0x32fca6[_0xcaeb('0x33')][_0xcaeb('0x40')]+'%'};return _0x3ad52d;}})});}_0x3c900a=_['merge']({},_0x3c900a,_0x32fca6['options']);var _0x2cb9da={'where':_0x3c900a[_0xcaeb('0x3e')]};return db[_0xcaeb('0x2e')][_0xcaeb('0x21')](_0x2cb9da)[_0xcaeb('0x43')](function(_0x53020f){_0x2ed3c8[_0xcaeb('0x21')]=_0x53020f;if(_0x32fca6[_0xcaeb('0x33')]['includeAll']){_0x3c900a['include']=[{'all':!![]}];}return db[_0xcaeb('0x2e')][_0xcaeb('0x44')](_0x3c900a);})[_0xcaeb('0x43')](function(_0x2ad7cf){_0x2ed3c8[_0xcaeb('0x45')]=_0x2ad7cf;return _0x2ed3c8;})[_0xcaeb('0x43')](respondWithFilteredResult(_0x48481b,_0x3c900a))[_0xcaeb('0x46')](handleError(_0x48481b,null));};exports[_0xcaeb('0x47')]=function(_0xec5ed9,_0x46fec3){var _0x2cd707={'raw':!![],'where':{'id':_0xec5ed9[_0xcaeb('0x48')]['id']}},_0x488926={};_0x488926[_0xcaeb('0x32')]=_[_0xcaeb('0x34')](db[_0xcaeb('0x2e')][_0xcaeb('0x49')]);_0x488926[_0xcaeb('0x33')]=_[_0xcaeb('0x34')](_0xec5ed9[_0xcaeb('0x33')]);_0x488926['filters']=_[_0xcaeb('0x36')](_0x488926[_0xcaeb('0x32')],_0x488926[_0xcaeb('0x33')]);_0x2cd707[_0xcaeb('0x37')]=_[_0xcaeb('0x36')](_0x488926[_0xcaeb('0x32')],qs[_0xcaeb('0x38')](_0xec5ed9[_0xcaeb('0x33')]['fields']));_0x2cd707[_0xcaeb('0x37')]=_0x2cd707[_0xcaeb('0x37')][_0xcaeb('0x39')]?_0x2cd707[_0xcaeb('0x37')]:_0x488926['model'];if(_0xec5ed9[_0xcaeb('0x33')][_0xcaeb('0x4a')]){_0x2cd707['include']=[{'all':!![]}];}_0x2cd707=_['merge']({},_0x2cd707,_0xec5ed9['options']);return db[_0xcaeb('0x2e')][_0xcaeb('0x4b')](_0x2cd707)['then'](handleEntityNotFound(_0x46fec3,null))[_0xcaeb('0x43')](respondWithResult(_0x46fec3,null))[_0xcaeb('0x46')](handleError(_0x46fec3,null));};exports[_0xcaeb('0x4c')]=function(_0x329058,_0x432bbf){return db[_0xcaeb('0x2e')][_0xcaeb('0x4c')](_0x329058[_0xcaeb('0x4d')],{})['then'](respondWithResult(_0x432bbf,0xc9))[_0xcaeb('0x46')](handleError(_0x432bbf,null));};exports[_0xcaeb('0x4e')]=function(_0x4028c5,_0x1c2c14){if(_0x4028c5[_0xcaeb('0x4d')]['id']){delete _0x4028c5[_0xcaeb('0x4d')]['id'];}return db[_0xcaeb('0x2e')][_0xcaeb('0x4b')]({'where':{'id':_0x4028c5[_0xcaeb('0x48')]['id']}})[_0xcaeb('0x43')](handleEntityNotFound(_0x1c2c14,null))[_0xcaeb('0x43')](saveUpdates(_0x4028c5[_0xcaeb('0x4d')],null))['then'](respondWithResult(_0x1c2c14,null))[_0xcaeb('0x46')](handleError(_0x1c2c14,null));};exports[_0xcaeb('0x28')]=function(_0x6a18b2,_0x427ad1){return db[_0xcaeb('0x2e')][_0xcaeb('0x4b')]({'where':{'id':_0x6a18b2['params']['id']}})[_0xcaeb('0x43')](handleEntityNotFound(_0x427ad1,null))[_0xcaeb('0x43')](removeEntity(_0x427ad1,null))['catch'](handleError(_0x427ad1,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index dc10ad2..0c25a88 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 _0x6444=['moment','bluebird','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','api'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x6444,0x19d));var _0x4644=function(_0xe1c263,_0x11dcfa){_0xe1c263=_0xe1c263-0x0;var _0x5c72d3=_0x6444[_0xe1c263];return _0x5c72d3;};'use strict';var _=require(_0x4644('0x0'));var util=require(_0x4644('0x1'));var logger=require('../../config/logger')(_0x4644('0x2'));var moment=require(_0x4644('0x3'));var BPromise=require(_0x4644('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4644('0x5'));var config=require(_0x4644('0x6'));var attributes=require(_0x4644('0x7'));module['exports']=function(_0x3410da,_0x92a935){return _0x3410da[_0x4644('0x8')](_0x4644('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x4644('0xa'),'fields':[_0x4644('0xb'),_0x4644('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a59=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x5cea21,_0x2ea4cb){var _0x20f508=function(_0x407265){while(--_0x407265){_0x5cea21['push'](_0x5cea21['shift']());}};_0x20f508(++_0x2ea4cb);}(_0x1a59,0x11c));var _0x91a5=function(_0x12ad1b,_0x106d01){_0x12ad1b=_0x12ad1b-0x0;var _0x22efbb=_0x1a59[_0x12ad1b];return _0x22efbb;};'use strict';var _=require(_0x91a5('0x0'));var util=require(_0x91a5('0x1'));var logger=require(_0x91a5('0x2'))(_0x91a5('0x3'));var moment=require(_0x91a5('0x4'));var BPromise=require(_0x91a5('0x5'));var rp=require(_0x91a5('0x6'));var fs=require('fs');var path=require(_0x91a5('0x7'));var rimraf=require(_0x91a5('0x8'));var config=require(_0x91a5('0x9'));var attributes=require(_0x91a5('0xa'));module[_0x91a5('0xb')]=function(_0x152a3d,_0x421957){return _0x152a3d[_0x91a5('0xc')](_0x91a5('0xd'),attributes,{'tableName':_0x91a5('0xe'),'paranoid':![],'indexes':[{'name':_0x91a5('0xf'),'fields':[_0x91a5('0x10'),'FieldId'],'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 ed52b04..728d8bf 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x10c310,_0x9b53a1){var _0x51cf80=function(_0x33c2e3){while(--_0x33c2e3){_0x10c310['push'](_0x10c310['shift']());}};_0x51cf80(++_0x9b53a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xac4a,0x13f));var _0xaac4=function(_0x7a1229,_0x1a3e84){_0x7a1229=_0x7a1229-0x0;var _0x176ff6=_0xac4a[_0x7a1229];return _0x176ff6;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 29c2a54..a404551 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x148d18,_0x567e02){var _0x492db4=function(_0x116382){while(--_0x116382){_0x148d18['push'](_0x148d18['shift']());}};_0x492db4(++_0x567e02);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x52303d,_0x70c512){var _0x373ea3=function(_0x1111b1){while(--_0x1111b1){_0x52303d['push'](_0x52303d['shift']());}};_0x373ea3(++_0x70c512);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 54b46c5..ba8a155 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(_0x518348,_0x358fbf){var _0x142b6b=function(_0x56946d){while(--_0x56946d){_0x518348['push'](_0x518348['shift']());}};_0x142b6b(++_0x358fbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x53c2b3,_0x232fb1){var _0x544060=function(_0x55e0a2){while(--_0x55e0a2){_0x53c2b3['push'](_0x53c2b3['shift']());}};_0x544060(++_0x232fb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 a0a998a..20fd198 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 _0xb522=['find','create','body','getConfigurations','findOne','SugarcrmConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','module_fields','label','endsWith','value','test','error','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','SugarcrmAccount','findAll','catch','params','fields','include'];(function(_0x5747e9,_0x549146){var _0x1f52f4=function(_0x522b28){while(--_0x522b28){_0x5747e9['push'](_0x5747e9['shift']());}};_0x1f52f4(++_0x549146);}(_0xb522,0x188));var _0x2b52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb522[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x2b52('0x0'));var rimraf=require(_0x2b52('0x1'));var zipdir=require(_0x2b52('0x2'));var jsonpatch=require(_0x2b52('0x3'));var rp=require('request-promise');var moment=require(_0x2b52('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2b52('0x5'));var util=require('util');var path=require(_0x2b52('0x6'));var sox=require('sox');var csv=require(_0x2b52('0x7'));var ejs=require(_0x2b52('0x8'));var fs=require('fs');var fs_extra=require(_0x2b52('0x9'));var _=require(_0x2b52('0xa'));var squel=require(_0x2b52('0xb'));var crypto=require('crypto');var jsforce=require(_0x2b52('0xc'));var deskjs=require(_0x2b52('0xd'));var toCsv=require(_0x2b52('0x7'));var querystring=require(_0x2b52('0xe'));var Papa=require(_0x2b52('0xf'));var Redis=require(_0x2b52('0x10'));var authService=require(_0x2b52('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2b52('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2b52('0x13'));var utils=require(_0x2b52('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2b52('0x15'));function respondWithStatusCode(_0x59d7f1,_0x4d7680){_0x4d7680=_0x4d7680||0xcc;return function(_0x40fb80){if(_0x40fb80){return _0x59d7f1[_0x2b52('0x16')](_0x4d7680);}return _0x59d7f1['status'](_0x4d7680)[_0x2b52('0x17')]();};}function respondWithResult(_0x4353b2,_0x1a2ecd){_0x1a2ecd=_0x1a2ecd||0xc8;return function(_0x6c54a3){if(_0x6c54a3){return _0x4353b2['status'](_0x1a2ecd)[_0x2b52('0x18')](_0x6c54a3);}};}function respondWithFilteredResult(_0x1bfc21,_0x47a656){return function(_0x5c3f57){if(_0x5c3f57){var _0x1085d4=typeof _0x47a656[_0x2b52('0x19')]===_0x2b52('0x1a')&&typeof _0x47a656['limit']===_0x2b52('0x1a');var _0x6f1532=_0x5c3f57[_0x2b52('0x1b')];var _0x48e930=_0x1085d4?0x0:_0x47a656[_0x2b52('0x19')];var _0x1ab0a9=_0x1085d4?_0x5c3f57[_0x2b52('0x1b')]:_0x47a656[_0x2b52('0x19')]+_0x47a656[_0x2b52('0x1c')];var _0x1df5c7;if(_0x1ab0a9>=_0x6f1532){_0x1ab0a9=_0x6f1532;_0x1df5c7=0xc8;}else{_0x1df5c7=0xce;}_0x1bfc21[_0x2b52('0x1d')](_0x1df5c7);return _0x1bfc21[_0x2b52('0x1e')](_0x2b52('0x1f'),_0x48e930+'-'+_0x1ab0a9+'/'+_0x6f1532)[_0x2b52('0x18')](_0x5c3f57);}return null;};}function patchUpdates(_0x4080a0){return function(_0x4bdfa1){try{jsonpatch[_0x2b52('0x20')](_0x4bdfa1,_0x4080a0,!![]);}catch(_0xc5408b){return BPromise[_0x2b52('0x21')](_0xc5408b);}return _0x4bdfa1['save']();};}function saveUpdates(_0x356d9d,_0x32de11){return function(_0x510991){if(_0x510991){return _0x510991[_0x2b52('0x22')](_0x356d9d)[_0x2b52('0x23')](function(_0x22a742){return _0x22a742;});}return null;};}function removeEntity(_0x320d6d,_0x232cfd){return function(_0x4c7506){if(_0x4c7506){return _0x4c7506[_0x2b52('0x24')]()[_0x2b52('0x23')](function(){_0x320d6d[_0x2b52('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x179cde,_0x39880c){return function(_0x14a9ed){if(!_0x14a9ed){_0x179cde[_0x2b52('0x16')](0x194);}return _0x14a9ed;};}function handleError(_0x36b449,_0x50249f){_0x50249f=_0x50249f||0x1f4;return function(_0x10b50b){logger['error'](_0x10b50b[_0x2b52('0x25')]);if(_0x10b50b[_0x2b52('0x26')]){delete _0x10b50b[_0x2b52('0x26')];}_0x36b449[_0x2b52('0x1d')](_0x50249f)[_0x2b52('0x27')](_0x10b50b);};}exports['index']=function(_0x2ef34f,_0xda0f48){var _0x55652e={},_0x509d82={},_0x87f6b={'count':0x0,'rows':[]};var _0x1f32ec=_[_0x2b52('0x28')](db['SugarcrmAccount'][_0x2b52('0x29')],function(_0x12dfc2){return{'name':_0x12dfc2[_0x2b52('0x2a')],'type':_0x12dfc2[_0x2b52('0x2b')]['key']};});_0x509d82[_0x2b52('0x2c')]=_[_0x2b52('0x28')](_0x1f32ec,_0x2b52('0x26'));_0x509d82[_0x2b52('0x2d')]=_[_0x2b52('0x2e')](_0x2ef34f[_0x2b52('0x2d')]);_0x509d82['filters']=_[_0x2b52('0x2f')](_0x509d82[_0x2b52('0x2c')],_0x509d82['query']);_0x55652e[_0x2b52('0x30')]=_[_0x2b52('0x2f')](_0x509d82[_0x2b52('0x2c')],qs['fields'](_0x2ef34f[_0x2b52('0x2d')]['fields']));_0x55652e[_0x2b52('0x30')]=_0x55652e[_0x2b52('0x30')][_0x2b52('0x31')]?_0x55652e[_0x2b52('0x30')]:_0x509d82['model'];if(!_0x2ef34f['query'][_0x2b52('0x32')](_0x2b52('0x33'))){_0x55652e[_0x2b52('0x1c')]=qs['limit'](_0x2ef34f[_0x2b52('0x2d')]['limit']);_0x55652e['offset']=qs[_0x2b52('0x19')](_0x2ef34f[_0x2b52('0x2d')][_0x2b52('0x19')]);}_0x55652e[_0x2b52('0x34')]=qs[_0x2b52('0x35')](_0x2ef34f[_0x2b52('0x2d')]['sort']);_0x55652e[_0x2b52('0x36')]=qs[_0x2b52('0x37')](_[_0x2b52('0x38')](_0x2ef34f[_0x2b52('0x2d')],_0x509d82[_0x2b52('0x37')]),_0x1f32ec);if(_0x2ef34f[_0x2b52('0x2d')][_0x2b52('0x39')]){_0x55652e[_0x2b52('0x36')]=_[_0x2b52('0x3a')](_0x55652e[_0x2b52('0x36')],{'$or':_[_0x2b52('0x28')](_0x1f32ec,function(_0x37b8cf){if(_0x37b8cf[_0x2b52('0x2b')]!==_0x2b52('0x3b')){var _0x17bd45={};_0x17bd45[_0x37b8cf[_0x2b52('0x26')]]={'$like':'%'+_0x2ef34f[_0x2b52('0x2d')][_0x2b52('0x39')]+'%'};return _0x17bd45;}})});}_0x55652e=_[_0x2b52('0x3a')]({},_0x55652e,_0x2ef34f[_0x2b52('0x3c')]);var _0x2b4469={'where':_0x55652e[_0x2b52('0x36')]};return db['SugarcrmAccount'][_0x2b52('0x1b')](_0x2b4469)[_0x2b52('0x23')](function(_0x34f682){_0x87f6b[_0x2b52('0x1b')]=_0x34f682;if(_0x2ef34f['query'][_0x2b52('0x3d')]){_0x55652e['include']=[{'all':!![]}];}return db[_0x2b52('0x3e')][_0x2b52('0x3f')](_0x55652e);})[_0x2b52('0x23')](function(_0x4c434a){_0x87f6b['rows']=_0x4c434a;return _0x87f6b;})[_0x2b52('0x23')](respondWithFilteredResult(_0xda0f48,_0x55652e))[_0x2b52('0x40')](handleError(_0xda0f48,null));};exports['show']=function(_0x42c64f,_0x2695cc){var _0x5d917e={'raw':![],'where':{'id':_0x42c64f[_0x2b52('0x41')]['id']}},_0x275d7c={};_0x275d7c['model']=_[_0x2b52('0x2e')](db[_0x2b52('0x3e')][_0x2b52('0x29')]);_0x275d7c[_0x2b52('0x2d')]=_[_0x2b52('0x2e')](_0x42c64f[_0x2b52('0x2d')]);_0x275d7c[_0x2b52('0x37')]=_[_0x2b52('0x2f')](_0x275d7c[_0x2b52('0x2c')],_0x275d7c['query']);_0x5d917e[_0x2b52('0x30')]=_['intersection'](_0x275d7c[_0x2b52('0x2c')],qs[_0x2b52('0x42')](_0x42c64f['query'][_0x2b52('0x42')]));_0x5d917e[_0x2b52('0x30')]=_0x5d917e[_0x2b52('0x30')]['length']?_0x5d917e[_0x2b52('0x30')]:_0x275d7c[_0x2b52('0x2c')];if(_0x42c64f[_0x2b52('0x2d')]['includeAll']){_0x5d917e[_0x2b52('0x43')]=[{'all':!![]}];}_0x5d917e=_[_0x2b52('0x3a')]({},_0x5d917e,_0x42c64f['options']);return db[_0x2b52('0x3e')][_0x2b52('0x44')](_0x5d917e)['then'](handleEntityNotFound(_0x2695cc,null))[_0x2b52('0x23')](respondWithResult(_0x2695cc,null))[_0x2b52('0x40')](handleError(_0x2695cc,null));};exports['create']=function(_0x380a11,_0x13b335){return db['SugarcrmAccount'][_0x2b52('0x45')](_0x380a11['body'],{})[_0x2b52('0x23')](respondWithResult(_0x13b335,0xc9))[_0x2b52('0x40')](handleError(_0x13b335,null));};exports[_0x2b52('0x22')]=function(_0x1adaf9,_0x4b50bf){if(_0x1adaf9[_0x2b52('0x46')]['id']){delete _0x1adaf9[_0x2b52('0x46')]['id'];}return db[_0x2b52('0x3e')][_0x2b52('0x44')]({'where':{'id':_0x1adaf9[_0x2b52('0x41')]['id']}})[_0x2b52('0x23')](handleEntityNotFound(_0x4b50bf,null))[_0x2b52('0x23')](saveUpdates(_0x1adaf9['body'],null))['then'](respondWithResult(_0x4b50bf,null))[_0x2b52('0x40')](handleError(_0x4b50bf,null));};exports[_0x2b52('0x24')]=function(_0x202c1b,_0x517137){return db[_0x2b52('0x3e')][_0x2b52('0x44')]({'where':{'id':_0x202c1b[_0x2b52('0x41')]['id']}})[_0x2b52('0x23')](handleEntityNotFound(_0x517137,null))[_0x2b52('0x23')](removeEntity(_0x517137,null))['catch'](handleError(_0x517137,null));};exports[_0x2b52('0x47')]=function(_0x8b373b,_0x304c6a,_0x28273f){var _0x1a3d1f={};var _0x35c769={};var _0x298098;var _0x1a8b46;return db[_0x2b52('0x3e')][_0x2b52('0x48')]({'where':{'id':_0x8b373b[_0x2b52('0x41')]['id']}})['then'](handleEntityNotFound(_0x304c6a,null))['then'](function(_0x4a80bd){if(_0x4a80bd){_0x298098=_0x4a80bd;_0x35c769['model']=_[_0x2b52('0x2e')](db[_0x2b52('0x49')]['rawAttributes']);_0x35c769[_0x2b52('0x2d')]=_[_0x2b52('0x2e')](_0x8b373b['query']);_0x35c769[_0x2b52('0x37')]=_['intersection'](_0x35c769[_0x2b52('0x2c')],_0x35c769[_0x2b52('0x2d')]);_0x1a3d1f[_0x2b52('0x30')]=_[_0x2b52('0x2f')](_0x35c769[_0x2b52('0x2c')],qs[_0x2b52('0x42')](_0x8b373b[_0x2b52('0x2d')][_0x2b52('0x42')]));_0x1a3d1f[_0x2b52('0x30')]=_0x1a3d1f[_0x2b52('0x30')][_0x2b52('0x31')]?_0x1a3d1f[_0x2b52('0x30')]:_0x35c769[_0x2b52('0x2c')];_0x1a3d1f['order']=qs[_0x2b52('0x35')](_0x8b373b[_0x2b52('0x2d')][_0x2b52('0x35')]);_0x1a3d1f[_0x2b52('0x36')]=qs[_0x2b52('0x37')](_[_0x2b52('0x38')](_0x8b373b[_0x2b52('0x2d')],_0x35c769[_0x2b52('0x37')]));if(_0x8b373b[_0x2b52('0x2d')]['filter']){_0x1a3d1f[_0x2b52('0x36')]=_[_0x2b52('0x3a')](_0x1a3d1f[_0x2b52('0x36')],{'$or':_[_0x2b52('0x28')](_0x1a3d1f[_0x2b52('0x30')],function(_0x49fd0e){var _0x26522e={};_0x26522e[_0x49fd0e]={'$like':'%'+_0x8b373b[_0x2b52('0x2d')][_0x2b52('0x39')]+'%'};return _0x26522e;})});}_0x1a3d1f=_[_0x2b52('0x3a')]({},_0x1a3d1f,_0x8b373b[_0x2b52('0x3c')]);return _0x298098[_0x2b52('0x47')](_0x1a3d1f);}})['then'](function(_0x405a33){if(_0x405a33){_0x1a8b46=_0x405a33['length'];if(!_0x8b373b[_0x2b52('0x2d')]['hasOwnProperty'](_0x2b52('0x33'))){_0x1a3d1f[_0x2b52('0x1c')]=qs[_0x2b52('0x1c')](_0x8b373b[_0x2b52('0x2d')][_0x2b52('0x1c')]);_0x1a3d1f[_0x2b52('0x19')]=qs[_0x2b52('0x19')](_0x8b373b[_0x2b52('0x2d')][_0x2b52('0x19')]);}return _0x298098[_0x2b52('0x47')](_0x1a3d1f);}})[_0x2b52('0x23')](function(_0x5119da){if(_0x5119da){return _0x5119da?{'count':_0x1a8b46,'rows':_0x5119da}:null;}})['then'](respondWithResult(_0x304c6a,null))[_0x2b52('0x40')](handleError(_0x304c6a,null));};exports['addConfiguration']=function(_0x4ba012,_0x50897c,_0x210c20){if(_0x4ba012['body']['id']){delete _0x4ba012['body']['id'];}return db[_0x2b52('0x3e')][_0x2b52('0x48')]({'where':{'id':_0x4ba012[_0x2b52('0x41')]['id']}})[_0x2b52('0x23')](handleEntityNotFound(_0x50897c,null))[_0x2b52('0x23')](function(_0x1266bd){if(_0x1266bd){_0x4ba012[_0x2b52('0x46')][_0x2b52('0x4a')]=_0x1266bd['id'];_0x4ba012['body'][_0x2b52('0x4b')]=integrations[_0x2b52('0x4c')](_0x4ba012[_0x2b52('0x46')][_0x2b52('0x4d')],_0x4ba012['body'][_0x2b52('0x2b')]);_0x4ba012[_0x2b52('0x46')][_0x2b52('0x4e')]=integrations[_0x2b52('0x4f')](_0x4ba012[_0x2b52('0x46')][_0x2b52('0x4d')],_0x4ba012[_0x2b52('0x46')]['type']);return db['SugarcrmConfiguration'][_0x2b52('0x45')](_0x4ba012[_0x2b52('0x46')],{'include':[{'model':db['SugarcrmField'],'as':_0x2b52('0x4b')},{'model':db['SugarcrmField'],'as':_0x2b52('0x4e')}]});}return null;})['then'](respondWithResult(_0x50897c,null))['catch'](handleError(_0x50897c,null));};exports['getFields']=function(_0x5b1108,_0x1b3515,_0x27ebdb){var _0x159f22='';var _0x3a44bd=['id',_0x2b52('0x26'),_0x2b52('0x50'),_0x2b52('0x51'),_0x2b52('0x52'),'date_start',_0x2b52('0x53'),_0x2b52('0x54'),_0x2b52('0x55'),_0x2b52('0x56'),_0x2b52('0x57'),_0x2b52('0x58')];return db[_0x2b52('0x3e')][_0x2b52('0x48')]({'where':{'id':_0x5b1108[_0x2b52('0x41')]['id']},'attributes':['id',_0x2b52('0x59'),_0x2b52('0x5a'),_0x2b52('0x5b')]})[_0x2b52('0x23')](handleEntityNotFound(_0x1b3515,null))['then'](function(_0x2042b5){if(_0x2042b5){_0x159f22=_0x2042b5[_0x2b52('0x5b')];var _0x123cde=_0x159f22[_0x2b52('0x5c')](-0x1);if(_0x123cde==='/'){_0x159f22=_0x159f22['substring'](0x0,_0x159f22[_0x2b52('0x5d')](_0x123cde));}return rp({'method':_0x2b52('0x5e'),'uri':util[_0x2b52('0x5f')](_0x2b52('0x60'),_0x159f22,_0x2b52('0x61')),'json':!![],'form':{'method':_0x2b52('0x62'),'input_type':_0x2b52('0x63'),'response_type':_0x2b52('0x63'),'rest_data':JSON[_0x2b52('0x64')]({'user_auth':{'user_name':_0x2042b5[_0x2b52('0x59')],'password':_0x2042b5[_0x2b52('0x5a')],'encryption':_0x2b52('0x65')},'application':_0x2b52('0x66')})}});}})['then'](function(_0x565a30){if(_0x565a30&&_0x565a30[_0x2b52('0x26')]!=='Invalid\x20Login'&&_0x565a30[_0x2b52('0x26')]!==_0x2b52('0x67')){return rp({'method':_0x2b52('0x5e'),'uri':util[_0x2b52('0x5f')](_0x2b52('0x60'),_0x159f22,_0x2b52('0x61')),'json':!![],'form':{'method':_0x2b52('0x68'),'input_type':_0x2b52('0x63'),'response_type':'JSON','rest_data':JSON[_0x2b52('0x64')]({'session':_0x565a30['id'],'module_name':_0x2b52('0x69')})}})[_0x2b52('0x23')](function(_0x2c0481){if(_0x2c0481){var _0x1d1440=_['values'](_0x2c0481[_0x2b52('0x6a')]);_['remove'](_0x1d1440,function(_0x2a0ef7){return _0x3a44bd['includes'](_0x2a0ef7['name']);});return{'count':_0x1d1440[_0x2b52('0x31')],'rows':_[_0x2b52('0x28')](_0x1d1440,function(_0x51306b){return{'id':_0x51306b[_0x2b52('0x26')],'name':_0x51306b[_0x2b52('0x6b')],'custom':_[_0x2b52('0x6c')](_0x51306b['name'],'_c')?!![]:![],'options':_0x51306b[_0x2b52('0x3c')]?_[_0x2b52('0x28')](_['values'](_0x51306b[_0x2b52('0x3c')]),function(_0x376b3d){return{'name':_0x376b3d[_0x2b52('0x6d')],'value':_0x376b3d[_0x2b52('0x26')]};}):[]};})};}})[_0x2b52('0x23')](respondWithResult(_0x1b3515,null))[_0x2b52('0x40')](function(_0x2c438a){var _0x1615c3=_0x5b1108[_0x2b52('0x2d')][_0x2b52('0x6e')]?0x1f4:_0x2c438a['statusCode']||0x1f4;logger[_0x2b52('0x6f')]('getFields,\x20%s,\x20%s,\x20%s',_0x2b52('0x70'),_0x1615c3,JSON[_0x2b52('0x64')](_0x2c438a));delete _0x2c438a[_0x2b52('0x26')];if(_0x1615c3===0x191){_0x1615c3=0x190;}_0x1b3515[_0x2b52('0x1d')](_0x1615c3)['send'](_0x5b1108[_0x2b52('0x2d')][_0x2b52('0x6e')]?{'message':_0x2b52('0x71'),'statusCode':_0x2c438a[_0x2b52('0x72')]}:_0x2c438a);});}else{var _0xd2d83b=0x1f4;_0x1b3515[_0x2b52('0x1d')](_0xd2d83b)[_0x2b52('0x27')]({'message':_0x2b52('0x71'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x34c0=['test','statusCode','getFields','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','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','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','error','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','keys','options','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','created_by','description','duration_minutes','parent_type','parent_name','direction','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','username','password','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value'];(function(_0x3394a6,_0x7b1ede){var _0x4a7909=function(_0x20451f){while(--_0x20451f){_0x3394a6['push'](_0x3394a6['shift']());}};_0x4a7909(++_0x7b1ede);}(_0x34c0,0x160));var _0x034c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34c0[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x034c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x034c('0x1'));var rp=require(_0x034c('0x2'));var moment=require('moment');var BPromise=require(_0x034c('0x3'));var Mustache=require('mustache');var util=require(_0x034c('0x4'));var path=require(_0x034c('0x5'));var sox=require('sox');var csv=require(_0x034c('0x6'));var ejs=require(_0x034c('0x7'));var fs=require('fs');var fs_extra=require(_0x034c('0x8'));var _=require('lodash');var squel=require(_0x034c('0x9'));var crypto=require(_0x034c('0xa'));var jsforce=require(_0x034c('0xb'));var deskjs=require(_0x034c('0xc'));var toCsv=require(_0x034c('0x6'));var querystring=require(_0x034c('0xd'));var Papa=require(_0x034c('0xe'));var Redis=require(_0x034c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x034c('0x10'));var as=require(_0x034c('0x11'));var hardwareService=require(_0x034c('0x12'));var logger=require(_0x034c('0x13'))(_0x034c('0x14'));var utils=require(_0x034c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x034c('0x16'));var db=require(_0x034c('0x17'))['db'];var integrations=require(_0x034c('0x18'));function respondWithStatusCode(_0x384385,_0x4e622b){_0x4e622b=_0x4e622b||0xcc;return function(_0x164383){if(_0x164383){return _0x384385[_0x034c('0x19')](_0x4e622b);}return _0x384385['status'](_0x4e622b)[_0x034c('0x1a')]();};}function respondWithResult(_0x596577,_0x3b0512){_0x3b0512=_0x3b0512||0xc8;return function(_0x51c92c){if(_0x51c92c){return _0x596577[_0x034c('0x1b')](_0x3b0512)[_0x034c('0x1c')](_0x51c92c);}};}function respondWithFilteredResult(_0x734a69,_0xbdabc6){return function(_0x6530cd){if(_0x6530cd){var _0x3f7f7c=typeof _0xbdabc6[_0x034c('0x1d')]===_0x034c('0x1e')&&typeof _0xbdabc6['limit']===_0x034c('0x1e');var _0x5a2906=_0x6530cd[_0x034c('0x1f')];var _0x312545=_0x3f7f7c?0x0:_0xbdabc6[_0x034c('0x1d')];var _0xc59eca=_0x3f7f7c?_0x6530cd[_0x034c('0x1f')]:_0xbdabc6[_0x034c('0x1d')]+_0xbdabc6[_0x034c('0x20')];var _0x11ba2b;if(_0xc59eca>=_0x5a2906){_0xc59eca=_0x5a2906;_0x11ba2b=0xc8;}else{_0x11ba2b=0xce;}_0x734a69[_0x034c('0x1b')](_0x11ba2b);return _0x734a69['set'](_0x034c('0x21'),_0x312545+'-'+_0xc59eca+'/'+_0x5a2906)[_0x034c('0x1c')](_0x6530cd);}return null;};}function patchUpdates(_0x85e66b){return function(_0x3f6524){try{jsonpatch['apply'](_0x3f6524,_0x85e66b,!![]);}catch(_0x1333c7){return BPromise[_0x034c('0x22')](_0x1333c7);}return _0x3f6524['save']();};}function saveUpdates(_0x45ae5a,_0x5a78e2){return function(_0x2b5038){if(_0x2b5038){return _0x2b5038[_0x034c('0x23')](_0x45ae5a)[_0x034c('0x24')](function(_0x159025){return _0x159025;});}return null;};}function removeEntity(_0x5ce219,_0x554b0c){return function(_0x53cee6){if(_0x53cee6){return _0x53cee6[_0x034c('0x25')]()[_0x034c('0x24')](function(){_0x5ce219[_0x034c('0x1b')](0xcc)[_0x034c('0x1a')]();});}};}function handleEntityNotFound(_0x137877,_0x50b6a7){return function(_0x5aa6db){if(!_0x5aa6db){_0x137877[_0x034c('0x19')](0x194);}return _0x5aa6db;};}function handleError(_0x5d86f2,_0x553468){_0x553468=_0x553468||0x1f4;return function(_0x40dc8c){logger[_0x034c('0x26')](_0x40dc8c['stack']);if(_0x40dc8c[_0x034c('0x27')]){delete _0x40dc8c[_0x034c('0x27')];}_0x5d86f2[_0x034c('0x1b')](_0x553468)[_0x034c('0x28')](_0x40dc8c);};}exports['index']=function(_0x37b526,_0x1cd68d){var _0x1ae020={},_0x4b6b72={},_0x43c58a={'count':0x0,'rows':[]};var _0x36dab1=_[_0x034c('0x29')](db[_0x034c('0x2a')][_0x034c('0x2b')],function(_0x1353ba){return{'name':_0x1353ba[_0x034c('0x2c')],'type':_0x1353ba[_0x034c('0x2d')][_0x034c('0x2e')]};});_0x4b6b72[_0x034c('0x2f')]=_['map'](_0x36dab1,_0x034c('0x27'));_0x4b6b72[_0x034c('0x30')]=_['keys'](_0x37b526['query']);_0x4b6b72['filters']=_[_0x034c('0x31')](_0x4b6b72[_0x034c('0x2f')],_0x4b6b72[_0x034c('0x30')]);_0x1ae020[_0x034c('0x32')]=_[_0x034c('0x31')](_0x4b6b72['model'],qs[_0x034c('0x33')](_0x37b526['query'][_0x034c('0x33')]));_0x1ae020['attributes']=_0x1ae020[_0x034c('0x32')][_0x034c('0x34')]?_0x1ae020[_0x034c('0x32')]:_0x4b6b72['model'];if(!_0x37b526[_0x034c('0x30')]['hasOwnProperty'](_0x034c('0x35'))){_0x1ae020[_0x034c('0x20')]=qs['limit'](_0x37b526[_0x034c('0x30')]['limit']);_0x1ae020['offset']=qs[_0x034c('0x1d')](_0x37b526[_0x034c('0x30')][_0x034c('0x1d')]);}_0x1ae020[_0x034c('0x36')]=qs['sort'](_0x37b526[_0x034c('0x30')][_0x034c('0x37')]);_0x1ae020[_0x034c('0x38')]=qs[_0x034c('0x39')](_['pick'](_0x37b526[_0x034c('0x30')],_0x4b6b72[_0x034c('0x39')]),_0x36dab1);if(_0x37b526[_0x034c('0x30')]['filter']){_0x1ae020[_0x034c('0x38')]=_[_0x034c('0x3a')](_0x1ae020['where'],{'$or':_[_0x034c('0x29')](_0x36dab1,function(_0x592f7d){if(_0x592f7d[_0x034c('0x2d')]!==_0x034c('0x3b')){var _0x4a8b05={};_0x4a8b05[_0x592f7d[_0x034c('0x27')]]={'$like':'%'+_0x37b526[_0x034c('0x30')][_0x034c('0x3c')]+'%'};return _0x4a8b05;}})});}_0x1ae020=_[_0x034c('0x3a')]({},_0x1ae020,_0x37b526['options']);var _0x4238c5={'where':_0x1ae020[_0x034c('0x38')]};return db[_0x034c('0x2a')]['count'](_0x4238c5)[_0x034c('0x24')](function(_0x1b28d7){_0x43c58a[_0x034c('0x1f')]=_0x1b28d7;if(_0x37b526['query'][_0x034c('0x3d')]){_0x1ae020[_0x034c('0x3e')]=[{'all':!![]}];}return db[_0x034c('0x2a')][_0x034c('0x3f')](_0x1ae020);})[_0x034c('0x24')](function(_0x12fe67){_0x43c58a['rows']=_0x12fe67;return _0x43c58a;})[_0x034c('0x24')](respondWithFilteredResult(_0x1cd68d,_0x1ae020))['catch'](handleError(_0x1cd68d,null));};exports[_0x034c('0x40')]=function(_0x248edf,_0x4c06f1){var _0x6e96a7={'raw':![],'where':{'id':_0x248edf[_0x034c('0x41')]['id']}},_0x3e8639={};_0x3e8639[_0x034c('0x2f')]=_['keys'](db[_0x034c('0x2a')][_0x034c('0x2b')]);_0x3e8639[_0x034c('0x30')]=_[_0x034c('0x42')](_0x248edf[_0x034c('0x30')]);_0x3e8639['filters']=_['intersection'](_0x3e8639[_0x034c('0x2f')],_0x3e8639[_0x034c('0x30')]);_0x6e96a7['attributes']=_[_0x034c('0x31')](_0x3e8639[_0x034c('0x2f')],qs['fields'](_0x248edf[_0x034c('0x30')]['fields']));_0x6e96a7['attributes']=_0x6e96a7[_0x034c('0x32')][_0x034c('0x34')]?_0x6e96a7[_0x034c('0x32')]:_0x3e8639[_0x034c('0x2f')];if(_0x248edf[_0x034c('0x30')][_0x034c('0x3d')]){_0x6e96a7[_0x034c('0x3e')]=[{'all':!![]}];}_0x6e96a7=_[_0x034c('0x3a')]({},_0x6e96a7,_0x248edf[_0x034c('0x43')]);return db[_0x034c('0x2a')][_0x034c('0x44')](_0x6e96a7)[_0x034c('0x24')](handleEntityNotFound(_0x4c06f1,null))[_0x034c('0x24')](respondWithResult(_0x4c06f1,null))[_0x034c('0x45')](handleError(_0x4c06f1,null));};exports[_0x034c('0x46')]=function(_0x5523ad,_0x45cf3c){return db['SugarcrmAccount']['create'](_0x5523ad[_0x034c('0x47')],{})[_0x034c('0x24')](respondWithResult(_0x45cf3c,0xc9))[_0x034c('0x45')](handleError(_0x45cf3c,null));};exports[_0x034c('0x23')]=function(_0x2b5771,_0xb968f){if(_0x2b5771[_0x034c('0x47')]['id']){delete _0x2b5771[_0x034c('0x47')]['id'];}return db['SugarcrmAccount'][_0x034c('0x44')]({'where':{'id':_0x2b5771[_0x034c('0x41')]['id']}})[_0x034c('0x24')](handleEntityNotFound(_0xb968f,null))['then'](saveUpdates(_0x2b5771[_0x034c('0x47')],null))[_0x034c('0x24')](respondWithResult(_0xb968f,null))[_0x034c('0x45')](handleError(_0xb968f,null));};exports['destroy']=function(_0x51e079,_0x32cc08){return db[_0x034c('0x2a')]['find']({'where':{'id':_0x51e079[_0x034c('0x41')]['id']}})[_0x034c('0x24')](handleEntityNotFound(_0x32cc08,null))[_0x034c('0x24')](removeEntity(_0x32cc08,null))['catch'](handleError(_0x32cc08,null));};exports[_0x034c('0x48')]=function(_0x18198f,_0x167c62,_0x108ab6){var _0x426a65={};var _0x10252b={};var _0x4109c9;var _0x25670e;return db[_0x034c('0x2a')][_0x034c('0x49')]({'where':{'id':_0x18198f['params']['id']}})['then'](handleEntityNotFound(_0x167c62,null))[_0x034c('0x24')](function(_0x2a20f5){if(_0x2a20f5){_0x4109c9=_0x2a20f5;_0x10252b[_0x034c('0x2f')]=_[_0x034c('0x42')](db[_0x034c('0x4a')][_0x034c('0x2b')]);_0x10252b[_0x034c('0x30')]=_['keys'](_0x18198f[_0x034c('0x30')]);_0x10252b[_0x034c('0x39')]=_[_0x034c('0x31')](_0x10252b[_0x034c('0x2f')],_0x10252b[_0x034c('0x30')]);_0x426a65[_0x034c('0x32')]=_[_0x034c('0x31')](_0x10252b[_0x034c('0x2f')],qs[_0x034c('0x33')](_0x18198f[_0x034c('0x30')][_0x034c('0x33')]));_0x426a65[_0x034c('0x32')]=_0x426a65[_0x034c('0x32')][_0x034c('0x34')]?_0x426a65[_0x034c('0x32')]:_0x10252b[_0x034c('0x2f')];_0x426a65[_0x034c('0x36')]=qs[_0x034c('0x37')](_0x18198f[_0x034c('0x30')]['sort']);_0x426a65[_0x034c('0x38')]=qs[_0x034c('0x39')](_['pick'](_0x18198f[_0x034c('0x30')],_0x10252b[_0x034c('0x39')]));if(_0x18198f[_0x034c('0x30')][_0x034c('0x3c')]){_0x426a65[_0x034c('0x38')]=_[_0x034c('0x3a')](_0x426a65['where'],{'$or':_[_0x034c('0x29')](_0x426a65['attributes'],function(_0x305944){var _0x7db3f1={};_0x7db3f1[_0x305944]={'$like':'%'+_0x18198f[_0x034c('0x30')][_0x034c('0x3c')]+'%'};return _0x7db3f1;})});}_0x426a65=_[_0x034c('0x3a')]({},_0x426a65,_0x18198f[_0x034c('0x43')]);return _0x4109c9[_0x034c('0x48')](_0x426a65);}})[_0x034c('0x24')](function(_0x4ba368){if(_0x4ba368){_0x25670e=_0x4ba368['length'];if(!_0x18198f[_0x034c('0x30')][_0x034c('0x4b')]('nolimit')){_0x426a65[_0x034c('0x20')]=qs['limit'](_0x18198f[_0x034c('0x30')]['limit']);_0x426a65[_0x034c('0x1d')]=qs[_0x034c('0x1d')](_0x18198f[_0x034c('0x30')]['offset']);}return _0x4109c9[_0x034c('0x48')](_0x426a65);}})['then'](function(_0x3aa619){if(_0x3aa619){return _0x3aa619?{'count':_0x25670e,'rows':_0x3aa619}:null;}})[_0x034c('0x24')](respondWithResult(_0x167c62,null))['catch'](handleError(_0x167c62,null));};exports[_0x034c('0x4c')]=function(_0x72ffe7,_0x50a08c,_0x1076f7){if(_0x72ffe7[_0x034c('0x47')]['id']){delete _0x72ffe7[_0x034c('0x47')]['id'];}return db[_0x034c('0x2a')][_0x034c('0x49')]({'where':{'id':_0x72ffe7[_0x034c('0x41')]['id']}})['then'](handleEntityNotFound(_0x50a08c,null))[_0x034c('0x24')](function(_0x4b8fc9){if(_0x4b8fc9){_0x72ffe7[_0x034c('0x47')]['AccountId']=_0x4b8fc9['id'];_0x72ffe7[_0x034c('0x47')][_0x034c('0x4d')]=integrations[_0x034c('0x4e')](_0x72ffe7['body'][_0x034c('0x4f')],_0x72ffe7[_0x034c('0x47')][_0x034c('0x2d')]);_0x72ffe7[_0x034c('0x47')][_0x034c('0x50')]=integrations[_0x034c('0x51')](_0x72ffe7[_0x034c('0x47')][_0x034c('0x4f')],_0x72ffe7[_0x034c('0x47')][_0x034c('0x2d')]);return db[_0x034c('0x4a')][_0x034c('0x46')](_0x72ffe7[_0x034c('0x47')],{'include':[{'model':db[_0x034c('0x52')],'as':_0x034c('0x4d')},{'model':db[_0x034c('0x52')],'as':'Descriptions'}]});}return null;})[_0x034c('0x24')](respondWithResult(_0x50a08c,null))[_0x034c('0x45')](handleError(_0x50a08c,null));};exports['getFields']=function(_0x37b87a,_0x576846,_0x287adf){var _0xa13d1d='';var _0x4fea48=['id','name','assigned_user_id',_0x034c('0x53'),_0x034c('0x54'),'date_start','duration_hours',_0x034c('0x55'),'parent_id',_0x034c('0x56'),_0x034c('0x57'),_0x034c('0x58')];return db[_0x034c('0x2a')][_0x034c('0x49')]({'where':{'id':_0x37b87a[_0x034c('0x41')]['id']},'attributes':['id','username','password',_0x034c('0x59')]})[_0x034c('0x24')](handleEntityNotFound(_0x576846,null))[_0x034c('0x24')](function(_0x4f36e1){if(_0x4f36e1){_0xa13d1d=_0x4f36e1[_0x034c('0x59')];var _0x534b13=_0xa13d1d[_0x034c('0x5a')](-0x1);if(_0x534b13==='/'){_0xa13d1d=_0xa13d1d[_0x034c('0x5b')](0x0,_0xa13d1d[_0x034c('0x5c')](_0x534b13));}return rp({'method':_0x034c('0x5d'),'uri':util[_0x034c('0x5e')](_0x034c('0x5f'),_0xa13d1d,_0x034c('0x60')),'json':!![],'form':{'method':'login','input_type':_0x034c('0x61'),'response_type':'JSON','rest_data':JSON[_0x034c('0x62')]({'user_auth':{'user_name':_0x4f36e1[_0x034c('0x63')],'password':_0x4f36e1[_0x034c('0x64')],'encryption':_0x034c('0x65')},'application':_0x034c('0x66')})}});}})[_0x034c('0x24')](function(_0x1a8228){if(_0x1a8228&&_0x1a8228[_0x034c('0x27')]!=='Invalid\x20Login'&&_0x1a8228['name']!==_0x034c('0x67')){return rp({'method':'POST','uri':util[_0x034c('0x5e')](_0x034c('0x5f'),_0xa13d1d,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x034c('0x68'),'input_type':'JSON','response_type':_0x034c('0x61'),'rest_data':JSON[_0x034c('0x62')]({'session':_0x1a8228['id'],'module_name':_0x034c('0x69')})}})['then'](function(_0x4464ac){if(_0x4464ac){var _0x23cf46=_[_0x034c('0x6a')](_0x4464ac[_0x034c('0x6b')]);_[_0x034c('0x6c')](_0x23cf46,function(_0x1e654d){return _0x4fea48['includes'](_0x1e654d['name']);});return{'count':_0x23cf46[_0x034c('0x34')],'rows':_['map'](_0x23cf46,function(_0x834f00){return{'id':_0x834f00[_0x034c('0x27')],'name':_0x834f00[_0x034c('0x6d')],'custom':_[_0x034c('0x6e')](_0x834f00[_0x034c('0x27')],'_c')?!![]:![],'options':_0x834f00[_0x034c('0x43')]?_[_0x034c('0x29')](_[_0x034c('0x6a')](_0x834f00[_0x034c('0x43')]),function(_0x500be2){return{'name':_0x500be2[_0x034c('0x6f')],'value':_0x500be2[_0x034c('0x27')]};}):[]};})};}})[_0x034c('0x24')](respondWithResult(_0x576846,null))[_0x034c('0x45')](function(_0x4ea133){var _0x15352c=_0x37b87a[_0x034c('0x30')][_0x034c('0x70')]?0x1f4:_0x4ea133[_0x034c('0x71')]||0x1f4;logger[_0x034c('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x034c('0x72'),_0x15352c,JSON[_0x034c('0x62')](_0x4ea133));delete _0x4ea133['name'];if(_0x15352c===0x191){_0x15352c=0x190;}_0x576846['status'](_0x15352c)[_0x034c('0x28')](_0x37b87a[_0x034c('0x30')][_0x034c('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x4ea133['statusCode']}:_0x4ea133);});}else{var _0x28db3a=0x1f4;_0x576846[_0x034c('0x1b')](_0x28db3a)[_0x034c('0x28')]({'message':_0x034c('0x73'),'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 c8d7f6e..1d71b59 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 _0x759e=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x759e,0xd1));var _0xe759=function(_0x59d08c,_0x595f68){_0x59d08c=_0x59d08c-0x0;var _0x172e6e=_0x759e[_0x59d08c];return _0x172e6e;};'use strict';var _=require(_0xe759('0x0'));var util=require(_0xe759('0x1'));var logger=require('../../config/logger')(_0xe759('0x2'));var moment=require(_0xe759('0x3'));var BPromise=require(_0xe759('0x4'));var rp=require(_0xe759('0x5'));var fs=require('fs');var path=require(_0xe759('0x6'));var rimraf=require(_0xe759('0x7'));var config=require(_0xe759('0x8'));var attributes=require(_0xe759('0x9'));var integrations=require(_0xe759('0xa'));module[_0xe759('0xb')]=function(_0x4bf712,_0x59057f){return _0x4bf712[_0xe759('0xc')](_0xe759('0xd'),attributes,{'tableName':_0xe759('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd12a=['define','SugarcrmAccount','util','api','request-promise','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x116737,_0x4cfe5b){var _0x8fd425=function(_0x32a8f0){while(--_0x32a8f0){_0x116737['push'](_0x116737['shift']());}};_0x8fd425(++_0x4cfe5b);}(_0xd12a,0x1f2));var _0xad12=function(_0x327a1c,_0x26df15){_0x327a1c=_0x327a1c-0x0;var _0x484a1a=_0xd12a[_0x327a1c];return _0x484a1a;};'use strict';var _=require('lodash');var util=require(_0xad12('0x0'));var logger=require('../../config/logger')(_0xad12('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xad12('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad12('0x3'));var attributes=require(_0xad12('0x4'));var integrations=require(_0xad12('0x5'));module['exports']=function(_0x35484,_0x2af5ac){return _0x35484[_0xad12('0x6')](_0xad12('0x7'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index dfd2eb1..8aef27b 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 _0xc2bf=['limit','include','map','attributes','model','then','ShowSugarcrmAccount','SugarcrmAccount','raw','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetSugarcrmAccount','findAll','options','where'];(function(_0x1a6cc3,_0x72951e){var _0x4a66e1=function(_0x3f8573){while(--_0x3f8573){_0x1a6cc3['push'](_0x1a6cc3['shift']());}};_0x4a66e1(++_0x72951e);}(_0xc2bf,0x70));var _0xfc2b=function(_0x26bb3f,_0x154461){_0x26bb3f=_0x26bb3f-0x0;var _0x4c7c79=_0xc2bf[_0x26bb3f];return _0x4c7c79;};'use strict';var _=require(_0xfc2b('0x0'));var util=require(_0xfc2b('0x1'));var moment=require(_0xfc2b('0x2'));var BPromise=require(_0xfc2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc2b('0x4'))['db'];var utils=require(_0xfc2b('0x5'));var logger=require(_0xfc2b('0x6'))(_0xfc2b('0x7'));var config=require('../../config/environment');var jayson=require(_0xfc2b('0x8'));var client=jayson['client'][_0xfc2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11bb2a,_0xdc7dbb,_0x42ddce){return new BPromise(function(_0x5378bb,_0xff880a){return client[_0xfc2b('0xa')](_0x11bb2a,_0x42ddce)['then'](function(_0xac6d6e){logger['info'](_0xfc2b('0xb'),_0xdc7dbb,'request\x20sent');logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xdc7dbb,_0xfc2b('0xc'),JSON[_0xfc2b('0xd')](_0xac6d6e));if(_0xac6d6e['error']){if(_0xac6d6e[_0xfc2b('0xe')][_0xfc2b('0xf')]===0x1f4){logger[_0xfc2b('0xe')](_0xfc2b('0xb'),_0xdc7dbb,_0xac6d6e['error'][_0xfc2b('0x10')]);return _0xff880a(_0xac6d6e[_0xfc2b('0xe')][_0xfc2b('0x10')]);}logger[_0xfc2b('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0xdc7dbb,_0xac6d6e[_0xfc2b('0xe')][_0xfc2b('0x10')]);return _0x5378bb(_0xac6d6e[_0xfc2b('0xe')][_0xfc2b('0x10')]);}else{logger[_0xfc2b('0x11')](_0xfc2b('0xb'),_0xdc7dbb,_0xfc2b('0xc'));_0x5378bb(_0xac6d6e[_0xfc2b('0x12')][_0xfc2b('0x10')]);}})[_0xfc2b('0x13')](function(_0x5039b3){logger[_0xfc2b('0xe')](_0xfc2b('0xb'),_0xdc7dbb,_0x5039b3);_0xff880a(_0x5039b3);});});}exports[_0xfc2b('0x14')]=function(_0x2f20f2){var _0x34502c=this;return new Promise(function(_0x204dbc,_0x57a414){return db['SugarcrmAccount'][_0xfc2b('0x15')]({'raw':_0x2f20f2[_0xfc2b('0x16')]?_0x2f20f2[_0xfc2b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2f20f2[_0xfc2b('0x16')]?_0x2f20f2[_0xfc2b('0x16')][_0xfc2b('0x17')]||null:null,'attributes':_0x2f20f2[_0xfc2b('0x16')]?_0x2f20f2[_0xfc2b('0x16')]['attributes']||null:null,'limit':_0x2f20f2[_0xfc2b('0x16')]?_0x2f20f2[_0xfc2b('0x16')][_0xfc2b('0x18')]||null:null,'include':_0x2f20f2[_0xfc2b('0x16')]?_0x2f20f2[_0xfc2b('0x16')][_0xfc2b('0x19')]?_[_0xfc2b('0x1a')](_0x2f20f2[_0xfc2b('0x16')][_0xfc2b('0x19')],function(_0x5a4412){return{'model':db[_0x5a4412['model']],'as':_0x5a4412['as'],'attributes':_0x5a4412[_0xfc2b('0x1b')],'include':_0x5a4412['include']?_['map'](_0x5a4412['include'],function(_0x24b416){return{'model':db[_0x24b416[_0xfc2b('0x1c')]],'as':_0x24b416['as'],'attributes':_0x24b416[_0xfc2b('0x1b')],'include':_0x24b416[_0xfc2b('0x19')]?_[_0xfc2b('0x1a')](_0x24b416[_0xfc2b('0x19')],function(_0x2ba3e0){return{'model':db[_0x2ba3e0[_0xfc2b('0x1c')]],'as':_0x2ba3e0['as'],'attributes':_0x2ba3e0[_0xfc2b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfc2b('0x1d')](function(_0xd4dd0c){logger[_0xfc2b('0x11')](_0xfc2b('0x14'),_0x2f20f2);logger['debug']('GetSugarcrmAccount',_0x2f20f2,JSON[_0xfc2b('0xd')](_0xd4dd0c));_0x204dbc(_0xd4dd0c);})[_0xfc2b('0x13')](function(_0xc2aedd){logger[_0xfc2b('0xe')](_0xfc2b('0x14'),_0xc2aedd[_0xfc2b('0x10')],_0x2f20f2);_0x57a414(_0x34502c[_0xfc2b('0xe')](0x1f4,_0xc2aedd[_0xfc2b('0x10')]));});});};exports[_0xfc2b('0x1e')]=function(_0x434a71){var _0x5ba487=this;return new Promise(function(_0xa98eea,_0x3132d6){return db[_0xfc2b('0x1f')]['find']({'raw':_0x434a71[_0xfc2b('0x16')]?_0x434a71[_0xfc2b('0x16')][_0xfc2b('0x20')]===undefined?!![]:![]:!![],'where':_0x434a71[_0xfc2b('0x16')]?_0x434a71['options'][_0xfc2b('0x17')]||null:null,'attributes':_0x434a71[_0xfc2b('0x16')]?_0x434a71[_0xfc2b('0x16')][_0xfc2b('0x1b')]||null:null,'include':_0x434a71[_0xfc2b('0x16')]?_0x434a71[_0xfc2b('0x16')][_0xfc2b('0x19')]?_[_0xfc2b('0x1a')](_0x434a71[_0xfc2b('0x16')][_0xfc2b('0x19')],function(_0xcdcd5e){return{'model':db[_0xcdcd5e[_0xfc2b('0x1c')]],'as':_0xcdcd5e['as'],'attributes':_0xcdcd5e[_0xfc2b('0x1b')],'include':_0xcdcd5e[_0xfc2b('0x19')]?_[_0xfc2b('0x1a')](_0xcdcd5e[_0xfc2b('0x19')],function(_0x49f1f3){return{'model':db[_0x49f1f3[_0xfc2b('0x1c')]],'as':_0x49f1f3['as'],'attributes':_0x49f1f3[_0xfc2b('0x1b')],'include':_0x49f1f3['include']?_['map'](_0x49f1f3['include'],function(_0x25e2f0){return{'model':db[_0x25e2f0[_0xfc2b('0x1c')]],'as':_0x25e2f0['as'],'attributes':_0x25e2f0[_0xfc2b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46cfa4){logger[_0xfc2b('0x11')](_0xfc2b('0x1e'),_0x434a71);logger[_0xfc2b('0x21')](_0xfc2b('0x1e'),_0x434a71,JSON['stringify'](_0x46cfa4));_0xa98eea(_0x46cfa4);})['catch'](function(_0x429fca){logger['error'](_0xfc2b('0x1e'),_0x429fca[_0xfc2b('0x10')],_0x434a71);_0x3132d6(_0x5ba487[_0xfc2b('0xe')](0x1f4,_0x429fca[_0xfc2b('0x10')]));});});}; \ No newline at end of file +var _0xc420=['GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify','find','ShowSugarcrmAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../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','code','message','catch'];(function(_0x2ef7f7,_0x2e7724){var _0x2b2927=function(_0x1edca4){while(--_0x1edca4){_0x2ef7f7['push'](_0x2ef7f7['shift']());}};_0x2b2927(++_0x2e7724);}(_0xc420,0xa2));var _0x0c42=function(_0x2d085c,_0x31eec0){_0x2d085c=_0x2d085c-0x0;var _0x3cb85d=_0xc420[_0x2d085c];return _0x3cb85d;};'use strict';var _=require('lodash');var util=require(_0x0c42('0x0'));var moment=require(_0x0c42('0x1'));var BPromise=require(_0x0c42('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c42('0x3'));var db=require(_0x0c42('0x4'))['db'];var utils=require(_0x0c42('0x5'));var logger=require(_0x0c42('0x6'))(_0x0c42('0x7'));var config=require(_0x0c42('0x8'));var jayson=require(_0x0c42('0x9'));var client=jayson[_0x0c42('0xa')][_0x0c42('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31496d,_0x1277fe,_0x2bf41b){return new BPromise(function(_0x3e68c1,_0x559ee7){return client[_0x0c42('0xc')](_0x31496d,_0x2bf41b)[_0x0c42('0xd')](function(_0x4608f9){logger[_0x0c42('0xe')](_0x0c42('0xf'),_0x1277fe,_0x0c42('0x10'));logger[_0x0c42('0x11')](_0x0c42('0x12'),_0x1277fe,_0x0c42('0x10'),JSON['stringify'](_0x4608f9));if(_0x4608f9[_0x0c42('0x13')]){if(_0x4608f9[_0x0c42('0x13')][_0x0c42('0x14')]===0x1f4){logger[_0x0c42('0x13')](_0x0c42('0xf'),_0x1277fe,_0x4608f9[_0x0c42('0x13')][_0x0c42('0x15')]);return _0x559ee7(_0x4608f9[_0x0c42('0x13')][_0x0c42('0x15')]);}logger[_0x0c42('0x13')](_0x0c42('0xf'),_0x1277fe,_0x4608f9['error']['message']);return _0x3e68c1(_0x4608f9[_0x0c42('0x13')]['message']);}else{logger['info'](_0x0c42('0xf'),_0x1277fe,_0x0c42('0x10'));_0x3e68c1(_0x4608f9['result'][_0x0c42('0x15')]);}})[_0x0c42('0x16')](function(_0x267481){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1277fe,_0x267481);_0x559ee7(_0x267481);});});}exports[_0x0c42('0x17')]=function(_0x1fb6f0){var _0x5803d9=this;return new Promise(function(_0x1ffb00,_0x576f0a){return db[_0x0c42('0x18')][_0x0c42('0x19')]({'raw':_0x1fb6f0['options']?_0x1fb6f0[_0x0c42('0x1a')][_0x0c42('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fb6f0[_0x0c42('0x1a')]?_0x1fb6f0[_0x0c42('0x1a')][_0x0c42('0x1c')]||null:null,'attributes':_0x1fb6f0[_0x0c42('0x1a')]?_0x1fb6f0[_0x0c42('0x1a')][_0x0c42('0x1d')]||null:null,'limit':_0x1fb6f0['options']?_0x1fb6f0[_0x0c42('0x1a')][_0x0c42('0x1e')]||null:null,'include':_0x1fb6f0[_0x0c42('0x1a')]?_0x1fb6f0[_0x0c42('0x1a')]['include']?_[_0x0c42('0x1f')](_0x1fb6f0[_0x0c42('0x1a')]['include'],function(_0x242335){return{'model':db[_0x242335['model']],'as':_0x242335['as'],'attributes':_0x242335['attributes'],'include':_0x242335[_0x0c42('0x20')]?_[_0x0c42('0x1f')](_0x242335[_0x0c42('0x20')],function(_0x40b632){return{'model':db[_0x40b632[_0x0c42('0x21')]],'as':_0x40b632['as'],'attributes':_0x40b632['attributes'],'include':_0x40b632[_0x0c42('0x20')]?_['map'](_0x40b632[_0x0c42('0x20')],function(_0x20c1eb){return{'model':db[_0x20c1eb[_0x0c42('0x21')]],'as':_0x20c1eb['as'],'attributes':_0x20c1eb[_0x0c42('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21666e){logger['info']('GetSugarcrmAccount',_0x1fb6f0);logger['debug'](_0x0c42('0x17'),_0x1fb6f0,JSON[_0x0c42('0x22')](_0x21666e));_0x1ffb00(_0x21666e);})['catch'](function(_0x3ea845){logger['error'](_0x0c42('0x17'),_0x3ea845['message'],_0x1fb6f0);_0x576f0a(_0x5803d9[_0x0c42('0x13')](0x1f4,_0x3ea845[_0x0c42('0x15')]));});});};exports['ShowSugarcrmAccount']=function(_0x376884){var _0x193d4d=this;return new Promise(function(_0x358c43,_0x5e931a){return db[_0x0c42('0x18')][_0x0c42('0x23')]({'raw':_0x376884[_0x0c42('0x1a')]?_0x376884[_0x0c42('0x1a')][_0x0c42('0x1b')]===undefined?!![]:![]:!![],'where':_0x376884['options']?_0x376884[_0x0c42('0x1a')]['where']||null:null,'attributes':_0x376884[_0x0c42('0x1a')]?_0x376884[_0x0c42('0x1a')][_0x0c42('0x1d')]||null:null,'include':_0x376884[_0x0c42('0x1a')]?_0x376884[_0x0c42('0x1a')][_0x0c42('0x20')]?_[_0x0c42('0x1f')](_0x376884[_0x0c42('0x1a')][_0x0c42('0x20')],function(_0x37254a){return{'model':db[_0x37254a[_0x0c42('0x21')]],'as':_0x37254a['as'],'attributes':_0x37254a['attributes'],'include':_0x37254a[_0x0c42('0x20')]?_[_0x0c42('0x1f')](_0x37254a['include'],function(_0x532855){return{'model':db[_0x532855[_0x0c42('0x21')]],'as':_0x532855['as'],'attributes':_0x532855[_0x0c42('0x1d')],'include':_0x532855[_0x0c42('0x20')]?_[_0x0c42('0x1f')](_0x532855['include'],function(_0x335d8a){return{'model':db[_0x335d8a[_0x0c42('0x21')]],'as':_0x335d8a['as'],'attributes':_0x335d8a[_0x0c42('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0c42('0xd')](function(_0x23a7e1){logger[_0x0c42('0xe')](_0x0c42('0x24'),_0x376884);logger[_0x0c42('0x11')]('ShowSugarcrmAccount',_0x376884,JSON[_0x0c42('0x22')](_0x23a7e1));_0x358c43(_0x23a7e1);})['catch'](function(_0x526448){logger['error'](_0x0c42('0x24'),_0x526448[_0x0c42('0x15')],_0x376884);_0x5e931a(_0x193d4d[_0x0c42('0x13')](0x1f4,_0x526448[_0x0c42('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index f219c39..88b457b 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 _0xbf06=['create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post'];(function(_0x1179d2,_0x928deb){var _0x4d54f6=function(_0x58df79){while(--_0x58df79){_0x1179d2['push'](_0x1179d2['shift']());}};_0x4d54f6(++_0x928deb);}(_0xbf06,0x101));var _0x6bf0=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xbf06[_0x38ced4];return _0x547c07;};'use strict';var multer=require('multer');var util=require(_0x6bf0('0x0'));var path=require(_0x6bf0('0x1'));var timeout=require(_0x6bf0('0x2'));var express=require(_0x6bf0('0x3'));var router=express[_0x6bf0('0x4')]();var fs_extra=require(_0x6bf0('0x5'));var auth=require(_0x6bf0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6bf0('0x7'));router[_0x6bf0('0x8')]('/',auth[_0x6bf0('0x9')](),controller[_0x6bf0('0xa')]);router['get'](_0x6bf0('0xb'),auth[_0x6bf0('0x9')](),controller[_0x6bf0('0xc')]);router[_0x6bf0('0x8')](_0x6bf0('0xd'),auth['isAuthenticated'](),controller[_0x6bf0('0xe')]);router[_0x6bf0('0x8')](_0x6bf0('0xf'),auth[_0x6bf0('0x9')](),controller[_0x6bf0('0x10')]);router['get']('/:id/descriptions',auth[_0x6bf0('0x9')](),controller[_0x6bf0('0x11')]);router[_0x6bf0('0x12')]('/',auth[_0x6bf0('0x9')](),controller[_0x6bf0('0x13')]);router[_0x6bf0('0x14')](_0x6bf0('0xb'),auth[_0x6bf0('0x9')](),controller[_0x6bf0('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6bf0('0x16')]=router; \ No newline at end of file +var _0x3ae4=['fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','delete','/:id','destroy','util','path'];(function(_0x1b36bc,_0x266008){var _0x195834=function(_0x36e932){while(--_0x36e932){_0x1b36bc['push'](_0x1b36bc['shift']());}};_0x195834(++_0x266008);}(_0x3ae4,0xe2));var _0x43ae=function(_0x2df2b1,_0x5ea4db){_0x2df2b1=_0x2df2b1-0x0;var _0x19b60a=_0x3ae4[_0x2df2b1];return _0x19b60a;};'use strict';var multer=require('multer');var util=require(_0x43ae('0x0'));var path=require(_0x43ae('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x43ae('0x2'));var auth=require(_0x43ae('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x43ae('0x4'));var controller=require(_0x43ae('0x5'));router['get']('/',auth[_0x43ae('0x6')](),controller['index']);router[_0x43ae('0x7')]('/:id',auth[_0x43ae('0x6')](),controller['show']);router[_0x43ae('0x7')](_0x43ae('0x8'),auth[_0x43ae('0x6')](),controller[_0x43ae('0x9')]);router['get'](_0x43ae('0xa'),auth['isAuthenticated'](),controller[_0x43ae('0xb')]);router[_0x43ae('0x7')](_0x43ae('0xc'),auth[_0x43ae('0x6')](),controller[_0x43ae('0xd')]);router['post']('/',auth[_0x43ae('0x6')](),controller[_0x43ae('0xe')]);router[_0x43ae('0xf')]('/:id',auth[_0x43ae('0x6')](),controller['update']);router[_0x43ae('0x10')](_0x43ae('0x11'),auth[_0x43ae('0x6')](),controller[_0x43ae('0x12')]);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 224c9cf..42b505b 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 _0xea26=['STRING','sequelize','exports'];(function(_0x19258b,_0x22e850){var _0x5be66a=function(_0x24e321){while(--_0x24e321){_0x19258b['push'](_0x19258b['shift']());}};_0x5be66a(++_0x22e850);}(_0xea26,0xb2));var _0x6ea2=function(_0x2e5333,_0x495fee){_0x2e5333=_0x2e5333-0x0;var _0x22508a=_0xea26[_0x2e5333];return _0x22508a;};'use strict';var Sequelize=require(_0x6ea2('0x0'));module[_0x6ea2('0x1')]={'name':{'type':Sequelize[_0x6ea2('0x2')]},'description':{'type':Sequelize[_0x6ea2('0x2')]}}; \ No newline at end of file +var _0x4680=['STRING','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x4680,0x169));var _0x0468=function(_0x49325f,_0x5064d1){_0x49325f=_0x49325f-0x0;var _0x1d7605=_0x4680[_0x49325f];return _0x1d7605;};'use strict';var Sequelize=require(_0x0468('0x0'));module['exports']={'name':{'type':Sequelize[_0x0468('0x1')]},'description':{'type':Sequelize[_0x0468('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 7654d8d..056963f 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 _0x6e9f=['offset','status','Content-Range','apply','reject','update','then','error','name','map','rawAttributes','fieldName','type','key','keys','query','filters','model','fields','attributes','length','sort','where','pick','filter','merge','options','includeAll','SugarcrmConfiguration','findAll','show','params','intersection','include','find','catch','create','body','SugarcrmField','order','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','limit','undefined','count'];(function(_0x513c98,_0x36d3c1){var _0x59d12f=function(_0x27ca1e){while(--_0x27ca1e){_0x513c98['push'](_0x513c98['shift']());}};_0x59d12f(++_0x36d3c1);}(_0x6e9f,0x195));var _0xf6e9=function(_0x705dc,_0x333cb5){_0x705dc=_0x705dc-0x0;var _0x26c704=_0x6e9f[_0x705dc];return _0x26c704;};'use strict';var emlformat=require(_0xf6e9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf6e9('0x1'));var rp=require(_0xf6e9('0x2'));var moment=require(_0xf6e9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf6e9('0x4'));var util=require('util');var path=require(_0xf6e9('0x5'));var sox=require(_0xf6e9('0x6'));var csv=require('to-csv');var ejs=require(_0xf6e9('0x7'));var fs=require('fs');var fs_extra=require(_0xf6e9('0x8'));var _=require(_0xf6e9('0x9'));var squel=require(_0xf6e9('0xa'));var crypto=require('crypto');var jsforce=require(_0xf6e9('0xb'));var deskjs=require(_0xf6e9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf6e9('0xd'));var Papa=require(_0xf6e9('0xe'));var Redis=require(_0xf6e9('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6e9('0x10'));var logger=require(_0xf6e9('0x11'))('api');var utils=require(_0xf6e9('0x12'));var config=require(_0xf6e9('0x13'));var licenseUtil=require(_0xf6e9('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43ecd6,_0x30c8f2){_0x30c8f2=_0x30c8f2||0xcc;return function(_0x1db4f0){if(_0x1db4f0){return _0x43ecd6[_0xf6e9('0x15')](_0x30c8f2);}return _0x43ecd6['status'](_0x30c8f2)[_0xf6e9('0x16')]();};}function respondWithResult(_0x5b3f5f,_0x3265df){_0x3265df=_0x3265df||0xc8;return function(_0x32147b){if(_0x32147b){return _0x5b3f5f['status'](_0x3265df)[_0xf6e9('0x17')](_0x32147b);}};}function respondWithFilteredResult(_0x7095dc,_0xf5a243){return function(_0x3488a2){if(_0x3488a2){var _0x1d40d0=typeof _0xf5a243['offset']==='undefined'&&typeof _0xf5a243[_0xf6e9('0x18')]===_0xf6e9('0x19');var _0x2bc780=_0x3488a2[_0xf6e9('0x1a')];var _0x20db99=_0x1d40d0?0x0:_0xf5a243[_0xf6e9('0x1b')];var _0x19d4ac=_0x1d40d0?_0x3488a2[_0xf6e9('0x1a')]:_0xf5a243['offset']+_0xf5a243[_0xf6e9('0x18')];var _0x3eb59f;if(_0x19d4ac>=_0x2bc780){_0x19d4ac=_0x2bc780;_0x3eb59f=0xc8;}else{_0x3eb59f=0xce;}_0x7095dc[_0xf6e9('0x1c')](_0x3eb59f);return _0x7095dc['set'](_0xf6e9('0x1d'),_0x20db99+'-'+_0x19d4ac+'/'+_0x2bc780)[_0xf6e9('0x17')](_0x3488a2);}return null;};}function patchUpdates(_0x5aa697){return function(_0x4bc264){try{jsonpatch[_0xf6e9('0x1e')](_0x4bc264,_0x5aa697,!![]);}catch(_0x3429f1){return BPromise[_0xf6e9('0x1f')](_0x3429f1);}return _0x4bc264['save']();};}function saveUpdates(_0x535b29,_0x44a86b){return function(_0x228b99){if(_0x228b99){return _0x228b99[_0xf6e9('0x20')](_0x535b29)[_0xf6e9('0x21')](function(_0x1ad623){return _0x1ad623;});}return null;};}function removeEntity(_0x51becb,_0x24b3b6){return function(_0x3f608a){if(_0x3f608a){return _0x3f608a['destroy']()[_0xf6e9('0x21')](function(){_0x51becb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xba714e,_0x2d549d){return function(_0x59cc36){if(!_0x59cc36){_0xba714e[_0xf6e9('0x15')](0x194);}return _0x59cc36;};}function handleError(_0x5943ba,_0x187f8f){_0x187f8f=_0x187f8f||0x1f4;return function(_0x1eb97c){logger[_0xf6e9('0x22')](_0x1eb97c['stack']);if(_0x1eb97c['name']){delete _0x1eb97c[_0xf6e9('0x23')];}_0x5943ba[_0xf6e9('0x1c')](_0x187f8f)['send'](_0x1eb97c);};}exports['index']=function(_0x3201eb,_0x2d3509){var _0x166d27={},_0x58f3a8={},_0x79acc2={'count':0x0,'rows':[]};var _0x4e96=_[_0xf6e9('0x24')](db['SugarcrmConfiguration'][_0xf6e9('0x25')],function(_0x10b826){return{'name':_0x10b826[_0xf6e9('0x26')],'type':_0x10b826[_0xf6e9('0x27')][_0xf6e9('0x28')]};});_0x58f3a8['model']=_[_0xf6e9('0x24')](_0x4e96,_0xf6e9('0x23'));_0x58f3a8['query']=_[_0xf6e9('0x29')](_0x3201eb[_0xf6e9('0x2a')]);_0x58f3a8[_0xf6e9('0x2b')]=_['intersection'](_0x58f3a8[_0xf6e9('0x2c')],_0x58f3a8[_0xf6e9('0x2a')]);_0x166d27['attributes']=_['intersection'](_0x58f3a8[_0xf6e9('0x2c')],qs[_0xf6e9('0x2d')](_0x3201eb['query'][_0xf6e9('0x2d')]));_0x166d27[_0xf6e9('0x2e')]=_0x166d27[_0xf6e9('0x2e')][_0xf6e9('0x2f')]?_0x166d27['attributes']:_0x58f3a8[_0xf6e9('0x2c')];if(!_0x3201eb[_0xf6e9('0x2a')]['hasOwnProperty']('nolimit')){_0x166d27[_0xf6e9('0x18')]=qs['limit'](_0x3201eb[_0xf6e9('0x2a')]['limit']);_0x166d27[_0xf6e9('0x1b')]=qs[_0xf6e9('0x1b')](_0x3201eb[_0xf6e9('0x2a')]['offset']);}_0x166d27['order']=qs[_0xf6e9('0x30')](_0x3201eb[_0xf6e9('0x2a')][_0xf6e9('0x30')]);_0x166d27[_0xf6e9('0x31')]=qs[_0xf6e9('0x2b')](_[_0xf6e9('0x32')](_0x3201eb[_0xf6e9('0x2a')],_0x58f3a8[_0xf6e9('0x2b')]),_0x4e96);if(_0x3201eb[_0xf6e9('0x2a')][_0xf6e9('0x33')]){_0x166d27[_0xf6e9('0x31')]=_[_0xf6e9('0x34')](_0x166d27[_0xf6e9('0x31')],{'$or':_[_0xf6e9('0x24')](_0x4e96,function(_0x2bcec2){if(_0x2bcec2[_0xf6e9('0x27')]!=='VIRTUAL'){var _0x3ad289={};_0x3ad289[_0x2bcec2[_0xf6e9('0x23')]]={'$like':'%'+_0x3201eb[_0xf6e9('0x2a')][_0xf6e9('0x33')]+'%'};return _0x3ad289;}})});}_0x166d27=_[_0xf6e9('0x34')]({},_0x166d27,_0x3201eb[_0xf6e9('0x35')]);var _0x4882f2={'where':_0x166d27[_0xf6e9('0x31')]};return db['SugarcrmConfiguration'][_0xf6e9('0x1a')](_0x4882f2)['then'](function(_0x283bef){_0x79acc2[_0xf6e9('0x1a')]=_0x283bef;if(_0x3201eb[_0xf6e9('0x2a')][_0xf6e9('0x36')]){_0x166d27['include']=[{'all':!![]}];}return db[_0xf6e9('0x37')][_0xf6e9('0x38')](_0x166d27);})[_0xf6e9('0x21')](function(_0x30aadf){_0x79acc2['rows']=_0x30aadf;return _0x79acc2;})[_0xf6e9('0x21')](respondWithFilteredResult(_0x2d3509,_0x166d27))['catch'](handleError(_0x2d3509,null));};exports[_0xf6e9('0x39')]=function(_0x30f68d,_0x434faf){var _0x13a67a={'raw':![],'where':{'id':_0x30f68d[_0xf6e9('0x3a')]['id']}},_0x24527b={};_0x24527b[_0xf6e9('0x2c')]=_[_0xf6e9('0x29')](db[_0xf6e9('0x37')]['rawAttributes']);_0x24527b['query']=_[_0xf6e9('0x29')](_0x30f68d[_0xf6e9('0x2a')]);_0x24527b['filters']=_['intersection'](_0x24527b[_0xf6e9('0x2c')],_0x24527b[_0xf6e9('0x2a')]);_0x13a67a['attributes']=_[_0xf6e9('0x3b')](_0x24527b[_0xf6e9('0x2c')],qs[_0xf6e9('0x2d')](_0x30f68d[_0xf6e9('0x2a')][_0xf6e9('0x2d')]));_0x13a67a['attributes']=_0x13a67a[_0xf6e9('0x2e')][_0xf6e9('0x2f')]?_0x13a67a[_0xf6e9('0x2e')]:_0x24527b[_0xf6e9('0x2c')];if(_0x30f68d[_0xf6e9('0x2a')][_0xf6e9('0x36')]){_0x13a67a[_0xf6e9('0x3c')]=[{'all':!![]}];}_0x13a67a=_['merge']({},_0x13a67a,_0x30f68d[_0xf6e9('0x35')]);return db[_0xf6e9('0x37')][_0xf6e9('0x3d')](_0x13a67a)[_0xf6e9('0x21')](handleEntityNotFound(_0x434faf,null))[_0xf6e9('0x21')](respondWithResult(_0x434faf,null))[_0xf6e9('0x3e')](handleError(_0x434faf,null));};exports[_0xf6e9('0x3f')]=function(_0xaa3b44,_0x44eea4){return db['SugarcrmConfiguration']['create'](_0xaa3b44['body'],{})[_0xf6e9('0x21')](respondWithResult(_0x44eea4,0xc9))[_0xf6e9('0x3e')](handleError(_0x44eea4,null));};exports[_0xf6e9('0x20')]=function(_0x3d67aa,_0x1d5856){if(_0x3d67aa[_0xf6e9('0x40')]['id']){delete _0x3d67aa[_0xf6e9('0x40')]['id'];}return db[_0xf6e9('0x37')][_0xf6e9('0x3d')]({'where':{'id':_0x3d67aa[_0xf6e9('0x3a')]['id']}})[_0xf6e9('0x21')](handleEntityNotFound(_0x1d5856,null))['then'](saveUpdates(_0x3d67aa[_0xf6e9('0x40')],null))[_0xf6e9('0x21')](respondWithResult(_0x1d5856,null))[_0xf6e9('0x3e')](handleError(_0x1d5856,null));};exports['destroy']=function(_0x62ce89,_0x345f31){return db[_0xf6e9('0x37')][_0xf6e9('0x3d')]({'where':{'id':_0x62ce89['params']['id']}})[_0xf6e9('0x21')](handleEntityNotFound(_0x345f31,null))[_0xf6e9('0x21')](removeEntity(_0x345f31,null))['catch'](handleError(_0x345f31,null));};exports['getFields']=function(_0x7e2608,_0x593f25,_0xfaa01c){var _0x9ec935={};var _0x17f074={};var _0x41a3e2;var _0x126f77;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x7e2608[_0xf6e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x593f25,null))[_0xf6e9('0x21')](function(_0x82fe64){if(_0x82fe64){_0x41a3e2=_0x82fe64;_0x17f074[_0xf6e9('0x2c')]=_['keys'](db[_0xf6e9('0x41')][_0xf6e9('0x25')]);_0x17f074['query']=_[_0xf6e9('0x29')](_0x7e2608[_0xf6e9('0x2a')]);_0x17f074[_0xf6e9('0x2b')]=_[_0xf6e9('0x3b')](_0x17f074['model'],_0x17f074['query']);_0x9ec935['attributes']=_[_0xf6e9('0x3b')](_0x17f074['model'],qs[_0xf6e9('0x2d')](_0x7e2608['query'][_0xf6e9('0x2d')]));_0x9ec935['attributes']=_0x9ec935[_0xf6e9('0x2e')][_0xf6e9('0x2f')]?_0x9ec935[_0xf6e9('0x2e')]:_0x17f074['model'];_0x9ec935[_0xf6e9('0x42')]=qs['sort'](_0x7e2608['query'][_0xf6e9('0x30')]);_0x9ec935[_0xf6e9('0x31')]=qs[_0xf6e9('0x2b')](_['pick'](_0x7e2608['query'],_0x17f074[_0xf6e9('0x2b')]));if(_0x7e2608[_0xf6e9('0x2a')][_0xf6e9('0x33')]){_0x9ec935[_0xf6e9('0x31')]=_[_0xf6e9('0x34')](_0x9ec935[_0xf6e9('0x31')],{'$or':_[_0xf6e9('0x24')](_0x9ec935[_0xf6e9('0x2e')],function(_0x5a71e9){var _0x5e76e1={};_0x5e76e1[_0x5a71e9]={'$like':'%'+_0x7e2608['query'][_0xf6e9('0x33')]+'%'};return _0x5e76e1;})});}_0x9ec935=_['merge']({},_0x9ec935,_0x7e2608[_0xf6e9('0x35')]);return _0x41a3e2['getFields'](_0x9ec935);}})[_0xf6e9('0x21')](function(_0x1f732d){if(_0x1f732d){_0x126f77=_0x1f732d[_0xf6e9('0x2f')];if(!_0x7e2608[_0xf6e9('0x2a')][_0xf6e9('0x43')](_0xf6e9('0x44'))){_0x9ec935[_0xf6e9('0x18')]=qs[_0xf6e9('0x18')](_0x7e2608[_0xf6e9('0x2a')][_0xf6e9('0x18')]);_0x9ec935[_0xf6e9('0x1b')]=qs['offset'](_0x7e2608['query'][_0xf6e9('0x1b')]);}return _0x41a3e2['getFields'](_0x9ec935);}})[_0xf6e9('0x21')](function(_0x4139ff){if(_0x4139ff){return _0x4139ff?{'count':_0x126f77,'rows':_0x4139ff}:null;}})['then'](respondWithResult(_0x593f25,null))[_0xf6e9('0x3e')](handleError(_0x593f25,null));};exports[_0xf6e9('0x45')]=function(_0x49f99a,_0x194a6c,_0x56fb8a){var _0x5dab5d={};var _0x91030f={};var _0x446a3a;var _0x4ccfcf;return db[_0xf6e9('0x37')][_0xf6e9('0x46')]({'where':{'id':_0x49f99a[_0xf6e9('0x3a')]['id']}})[_0xf6e9('0x21')](handleEntityNotFound(_0x194a6c,null))[_0xf6e9('0x21')](function(_0x21a6ae){if(_0x21a6ae){_0x446a3a=_0x21a6ae;_0x91030f[_0xf6e9('0x2c')]=_[_0xf6e9('0x29')](db[_0xf6e9('0x41')][_0xf6e9('0x25')]);_0x91030f[_0xf6e9('0x2a')]=_[_0xf6e9('0x29')](_0x49f99a[_0xf6e9('0x2a')]);_0x91030f[_0xf6e9('0x2b')]=_[_0xf6e9('0x3b')](_0x91030f[_0xf6e9('0x2c')],_0x91030f[_0xf6e9('0x2a')]);_0x5dab5d[_0xf6e9('0x2e')]=_[_0xf6e9('0x3b')](_0x91030f['model'],qs['fields'](_0x49f99a[_0xf6e9('0x2a')][_0xf6e9('0x2d')]));_0x5dab5d[_0xf6e9('0x2e')]=_0x5dab5d['attributes'][_0xf6e9('0x2f')]?_0x5dab5d['attributes']:_0x91030f[_0xf6e9('0x2c')];_0x5dab5d[_0xf6e9('0x42')]=qs[_0xf6e9('0x30')](_0x49f99a[_0xf6e9('0x2a')]['sort']);_0x5dab5d['where']=qs['filters'](_[_0xf6e9('0x32')](_0x49f99a['query'],_0x91030f['filters']));if(_0x49f99a[_0xf6e9('0x2a')]['filter']){_0x5dab5d[_0xf6e9('0x31')]=_[_0xf6e9('0x34')](_0x5dab5d['where'],{'$or':_[_0xf6e9('0x24')](_0x5dab5d[_0xf6e9('0x2e')],function(_0x268fd5){var _0x3e9df0={};_0x3e9df0[_0x268fd5]={'$like':'%'+_0x49f99a[_0xf6e9('0x2a')]['filter']+'%'};return _0x3e9df0;})});}_0x5dab5d=_[_0xf6e9('0x34')]({},_0x5dab5d,_0x49f99a[_0xf6e9('0x35')]);return _0x446a3a[_0xf6e9('0x45')](_0x5dab5d);}})[_0xf6e9('0x21')](function(_0x49b6a6){if(_0x49b6a6){_0x4ccfcf=_0x49b6a6[_0xf6e9('0x2f')];if(!_0x49f99a['query'][_0xf6e9('0x43')](_0xf6e9('0x44'))){_0x5dab5d[_0xf6e9('0x18')]=qs[_0xf6e9('0x18')](_0x49f99a[_0xf6e9('0x2a')]['limit']);_0x5dab5d[_0xf6e9('0x1b')]=qs[_0xf6e9('0x1b')](_0x49f99a[_0xf6e9('0x2a')][_0xf6e9('0x1b')]);}return _0x446a3a['getSubjects'](_0x5dab5d);}})[_0xf6e9('0x21')](function(_0x3b12d0){if(_0x3b12d0){return _0x3b12d0?{'count':_0x4ccfcf,'rows':_0x3b12d0}:null;}})['then'](respondWithResult(_0x194a6c,null))[_0xf6e9('0x3e')](handleError(_0x194a6c,null));};exports[_0xf6e9('0x47')]=function(_0x3276ee,_0x147fe7,_0x329f85){var _0x411bfe={};var _0x12d76a={};var _0x459d63;var _0x15356a;return db[_0xf6e9('0x37')]['findOne']({'where':{'id':_0x3276ee['params']['id']}})['then'](handleEntityNotFound(_0x147fe7,null))[_0xf6e9('0x21')](function(_0x65ea16){if(_0x65ea16){_0x459d63=_0x65ea16;_0x12d76a[_0xf6e9('0x2c')]=_[_0xf6e9('0x29')](db['SugarcrmField'][_0xf6e9('0x25')]);_0x12d76a[_0xf6e9('0x2a')]=_[_0xf6e9('0x29')](_0x3276ee[_0xf6e9('0x2a')]);_0x12d76a['filters']=_['intersection'](_0x12d76a[_0xf6e9('0x2c')],_0x12d76a[_0xf6e9('0x2a')]);_0x411bfe[_0xf6e9('0x2e')]=_['intersection'](_0x12d76a[_0xf6e9('0x2c')],qs[_0xf6e9('0x2d')](_0x3276ee[_0xf6e9('0x2a')]['fields']));_0x411bfe[_0xf6e9('0x2e')]=_0x411bfe[_0xf6e9('0x2e')][_0xf6e9('0x2f')]?_0x411bfe[_0xf6e9('0x2e')]:_0x12d76a[_0xf6e9('0x2c')];_0x411bfe[_0xf6e9('0x42')]=qs[_0xf6e9('0x30')](_0x3276ee[_0xf6e9('0x2a')][_0xf6e9('0x30')]);_0x411bfe[_0xf6e9('0x31')]=qs['filters'](_[_0xf6e9('0x32')](_0x3276ee[_0xf6e9('0x2a')],_0x12d76a[_0xf6e9('0x2b')]));if(_0x3276ee[_0xf6e9('0x2a')][_0xf6e9('0x33')]){_0x411bfe[_0xf6e9('0x31')]=_['merge'](_0x411bfe[_0xf6e9('0x31')],{'$or':_[_0xf6e9('0x24')](_0x411bfe[_0xf6e9('0x2e')],function(_0x10f57f){var _0x47c32e={};_0x47c32e[_0x10f57f]={'$like':'%'+_0x3276ee['query']['filter']+'%'};return _0x47c32e;})});}_0x411bfe=_[_0xf6e9('0x34')]({},_0x411bfe,_0x3276ee[_0xf6e9('0x35')]);return _0x459d63[_0xf6e9('0x47')](_0x411bfe);}})[_0xf6e9('0x21')](function(_0x4a57c1){if(_0x4a57c1){_0x15356a=_0x4a57c1[_0xf6e9('0x2f')];if(!_0x3276ee[_0xf6e9('0x2a')][_0xf6e9('0x43')](_0xf6e9('0x44'))){_0x411bfe['limit']=qs[_0xf6e9('0x18')](_0x3276ee[_0xf6e9('0x2a')][_0xf6e9('0x18')]);_0x411bfe['offset']=qs[_0xf6e9('0x1b')](_0x3276ee['query'][_0xf6e9('0x1b')]);}return _0x459d63[_0xf6e9('0x47')](_0x411bfe);}})[_0xf6e9('0x21')](function(_0x11c882){if(_0x11c882){return _0x11c882?{'count':_0x15356a,'rows':_0x11c882}:null;}})['then'](respondWithResult(_0x147fe7,null))[_0xf6e9('0x3e')](handleError(_0x147fe7,null));}; \ No newline at end of file +var _0xe075=['options','SugarcrmConfiguration','include','findAll','rows','catch','show','rawAttributes','includeAll','find','body','params','getFields','SugarcrmField','getSubjects','findOne','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','send','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xe075,0x108));var _0x5e07=function(_0x5f123f,_0xe31c1){_0x5f123f=_0x5f123f-0x0;var _0x235e2f=_0xe075[_0x5f123f];return _0x235e2f;};'use strict';var emlformat=require(_0x5e07('0x0'));var rimraf=require(_0x5e07('0x1'));var zipdir=require(_0x5e07('0x2'));var jsonpatch=require(_0x5e07('0x3'));var rp=require(_0x5e07('0x4'));var moment=require(_0x5e07('0x5'));var BPromise=require(_0x5e07('0x6'));var Mustache=require(_0x5e07('0x7'));var util=require(_0x5e07('0x8'));var path=require(_0x5e07('0x9'));var sox=require('sox');var csv=require(_0x5e07('0xa'));var ejs=require(_0x5e07('0xb'));var fs=require('fs');var fs_extra=require(_0x5e07('0xc'));var _=require(_0x5e07('0xd'));var squel=require(_0x5e07('0xe'));var crypto=require(_0x5e07('0xf'));var jsforce=require(_0x5e07('0x10'));var deskjs=require(_0x5e07('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5e07('0x12'));var Papa=require(_0x5e07('0x13'));var Redis=require(_0x5e07('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x5e07('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e07('0x16'));var logger=require(_0x5e07('0x17'))(_0x5e07('0x18'));var utils=require(_0x5e07('0x19'));var config=require(_0x5e07('0x1a'));var licenseUtil=require(_0x5e07('0x1b'));var db=require(_0x5e07('0x1c'))['db'];function respondWithStatusCode(_0x17a5c7,_0x3d6838){_0x3d6838=_0x3d6838||0xcc;return function(_0x5d3b2f){if(_0x5d3b2f){return _0x17a5c7[_0x5e07('0x1d')](_0x3d6838);}return _0x17a5c7[_0x5e07('0x1e')](_0x3d6838)[_0x5e07('0x1f')]();};}function respondWithResult(_0x224a3d,_0x19eeb6){_0x19eeb6=_0x19eeb6||0xc8;return function(_0x10a471){if(_0x10a471){return _0x224a3d['status'](_0x19eeb6)[_0x5e07('0x20')](_0x10a471);}};}function respondWithFilteredResult(_0x13a6a1,_0x40d1e9){return function(_0x3ae2b1){if(_0x3ae2b1){var _0x4d6ec7=typeof _0x40d1e9[_0x5e07('0x21')]===_0x5e07('0x22')&&typeof _0x40d1e9[_0x5e07('0x23')]===_0x5e07('0x22');var _0x41a418=_0x3ae2b1[_0x5e07('0x24')];var _0x1d734e=_0x4d6ec7?0x0:_0x40d1e9['offset'];var _0x49eb83=_0x4d6ec7?_0x3ae2b1[_0x5e07('0x24')]:_0x40d1e9[_0x5e07('0x21')]+_0x40d1e9[_0x5e07('0x23')];var _0x331a86;if(_0x49eb83>=_0x41a418){_0x49eb83=_0x41a418;_0x331a86=0xc8;}else{_0x331a86=0xce;}_0x13a6a1['status'](_0x331a86);return _0x13a6a1['set']('Content-Range',_0x1d734e+'-'+_0x49eb83+'/'+_0x41a418)[_0x5e07('0x20')](_0x3ae2b1);}return null;};}function patchUpdates(_0x45a3a2){return function(_0x1713ba){try{jsonpatch[_0x5e07('0x25')](_0x1713ba,_0x45a3a2,!![]);}catch(_0xd322fc){return BPromise['reject'](_0xd322fc);}return _0x1713ba[_0x5e07('0x26')]();};}function saveUpdates(_0x178b5a,_0x20b677){return function(_0x1f1cd2){if(_0x1f1cd2){return _0x1f1cd2[_0x5e07('0x27')](_0x178b5a)[_0x5e07('0x28')](function(_0x4f4061){return _0x4f4061;});}return null;};}function removeEntity(_0x3838fd,_0x4ec47c){return function(_0x2dfd53){if(_0x2dfd53){return _0x2dfd53[_0x5e07('0x29')]()['then'](function(){_0x3838fd[_0x5e07('0x1e')](0xcc)[_0x5e07('0x1f')]();});}};}function handleEntityNotFound(_0x1a4236,_0x528f77){return function(_0x510937){if(!_0x510937){_0x1a4236[_0x5e07('0x1d')](0x194);}return _0x510937;};}function handleError(_0x3100a2,_0xcd477e){_0xcd477e=_0xcd477e||0x1f4;return function(_0x247269){logger[_0x5e07('0x2a')](_0x247269[_0x5e07('0x2b')]);if(_0x247269[_0x5e07('0x2c')]){delete _0x247269[_0x5e07('0x2c')];}_0x3100a2[_0x5e07('0x1e')](_0xcd477e)[_0x5e07('0x2d')](_0x247269);};}exports['index']=function(_0x3db7da,_0x22b83c){var _0x2b65d0={},_0x365292={},_0x306c63={'count':0x0,'rows':[]};var _0x41cb19=_['map'](db['SugarcrmConfiguration']['rawAttributes'],function(_0x2d9b1d){return{'name':_0x2d9b1d[_0x5e07('0x2e')],'type':_0x2d9b1d[_0x5e07('0x2f')]['key']};});_0x365292[_0x5e07('0x30')]=_[_0x5e07('0x31')](_0x41cb19,_0x5e07('0x2c'));_0x365292[_0x5e07('0x32')]=_[_0x5e07('0x33')](_0x3db7da[_0x5e07('0x32')]);_0x365292[_0x5e07('0x34')]=_[_0x5e07('0x35')](_0x365292['model'],_0x365292[_0x5e07('0x32')]);_0x2b65d0['attributes']=_[_0x5e07('0x35')](_0x365292['model'],qs[_0x5e07('0x36')](_0x3db7da['query'][_0x5e07('0x36')]));_0x2b65d0[_0x5e07('0x37')]=_0x2b65d0[_0x5e07('0x37')][_0x5e07('0x38')]?_0x2b65d0[_0x5e07('0x37')]:_0x365292[_0x5e07('0x30')];if(!_0x3db7da['query'][_0x5e07('0x39')](_0x5e07('0x3a'))){_0x2b65d0['limit']=qs['limit'](_0x3db7da[_0x5e07('0x32')]['limit']);_0x2b65d0[_0x5e07('0x21')]=qs[_0x5e07('0x21')](_0x3db7da[_0x5e07('0x32')][_0x5e07('0x21')]);}_0x2b65d0['order']=qs[_0x5e07('0x3b')](_0x3db7da[_0x5e07('0x32')]['sort']);_0x2b65d0[_0x5e07('0x3c')]=qs[_0x5e07('0x34')](_[_0x5e07('0x3d')](_0x3db7da[_0x5e07('0x32')],_0x365292[_0x5e07('0x34')]),_0x41cb19);if(_0x3db7da['query'][_0x5e07('0x3e')]){_0x2b65d0['where']=_[_0x5e07('0x3f')](_0x2b65d0['where'],{'$or':_[_0x5e07('0x31')](_0x41cb19,function(_0x4900ec){if(_0x4900ec[_0x5e07('0x2f')]!=='VIRTUAL'){var _0x3319db={};_0x3319db[_0x4900ec[_0x5e07('0x2c')]]={'$like':'%'+_0x3db7da[_0x5e07('0x32')]['filter']+'%'};return _0x3319db;}})});}_0x2b65d0=_['merge']({},_0x2b65d0,_0x3db7da[_0x5e07('0x40')]);var _0x39df2e={'where':_0x2b65d0[_0x5e07('0x3c')]};return db[_0x5e07('0x41')][_0x5e07('0x24')](_0x39df2e)[_0x5e07('0x28')](function(_0x3c9668){_0x306c63['count']=_0x3c9668;if(_0x3db7da['query']['includeAll']){_0x2b65d0[_0x5e07('0x42')]=[{'all':!![]}];}return db[_0x5e07('0x41')][_0x5e07('0x43')](_0x2b65d0);})[_0x5e07('0x28')](function(_0x2f1d04){_0x306c63[_0x5e07('0x44')]=_0x2f1d04;return _0x306c63;})[_0x5e07('0x28')](respondWithFilteredResult(_0x22b83c,_0x2b65d0))[_0x5e07('0x45')](handleError(_0x22b83c,null));};exports[_0x5e07('0x46')]=function(_0x4e344a,_0x4809a1){var _0x493dff={'raw':![],'where':{'id':_0x4e344a['params']['id']}},_0x1d3582={};_0x1d3582[_0x5e07('0x30')]=_[_0x5e07('0x33')](db['SugarcrmConfiguration'][_0x5e07('0x47')]);_0x1d3582[_0x5e07('0x32')]=_[_0x5e07('0x33')](_0x4e344a[_0x5e07('0x32')]);_0x1d3582[_0x5e07('0x34')]=_[_0x5e07('0x35')](_0x1d3582[_0x5e07('0x30')],_0x1d3582[_0x5e07('0x32')]);_0x493dff['attributes']=_[_0x5e07('0x35')](_0x1d3582['model'],qs['fields'](_0x4e344a[_0x5e07('0x32')][_0x5e07('0x36')]));_0x493dff['attributes']=_0x493dff[_0x5e07('0x37')]['length']?_0x493dff[_0x5e07('0x37')]:_0x1d3582['model'];if(_0x4e344a[_0x5e07('0x32')][_0x5e07('0x48')]){_0x493dff[_0x5e07('0x42')]=[{'all':!![]}];}_0x493dff=_[_0x5e07('0x3f')]({},_0x493dff,_0x4e344a['options']);return db['SugarcrmConfiguration'][_0x5e07('0x49')](_0x493dff)[_0x5e07('0x28')](handleEntityNotFound(_0x4809a1,null))['then'](respondWithResult(_0x4809a1,null))[_0x5e07('0x45')](handleError(_0x4809a1,null));};exports['create']=function(_0x3c619e,_0xbe546b){return db[_0x5e07('0x41')]['create'](_0x3c619e[_0x5e07('0x4a')],{})['then'](respondWithResult(_0xbe546b,0xc9))[_0x5e07('0x45')](handleError(_0xbe546b,null));};exports[_0x5e07('0x27')]=function(_0x1092d4,_0x2db509){if(_0x1092d4[_0x5e07('0x4a')]['id']){delete _0x1092d4[_0x5e07('0x4a')]['id'];}return db['SugarcrmConfiguration'][_0x5e07('0x49')]({'where':{'id':_0x1092d4[_0x5e07('0x4b')]['id']}})[_0x5e07('0x28')](handleEntityNotFound(_0x2db509,null))[_0x5e07('0x28')](saveUpdates(_0x1092d4[_0x5e07('0x4a')],null))['then'](respondWithResult(_0x2db509,null))[_0x5e07('0x45')](handleError(_0x2db509,null));};exports[_0x5e07('0x29')]=function(_0x54bb52,_0x4c12af){return db['SugarcrmConfiguration'][_0x5e07('0x49')]({'where':{'id':_0x54bb52['params']['id']}})[_0x5e07('0x28')](handleEntityNotFound(_0x4c12af,null))['then'](removeEntity(_0x4c12af,null))[_0x5e07('0x45')](handleError(_0x4c12af,null));};exports[_0x5e07('0x4c')]=function(_0x5d19c2,_0x119f7b,_0x42a11a){var _0x559b7c={};var _0x274ef9={};var _0x40d294;var _0x27a182;return db[_0x5e07('0x41')]['findOne']({'where':{'id':_0x5d19c2[_0x5e07('0x4b')]['id']}})['then'](handleEntityNotFound(_0x119f7b,null))[_0x5e07('0x28')](function(_0x1e1b75){if(_0x1e1b75){_0x40d294=_0x1e1b75;_0x274ef9[_0x5e07('0x30')]=_[_0x5e07('0x33')](db[_0x5e07('0x4d')][_0x5e07('0x47')]);_0x274ef9[_0x5e07('0x32')]=_[_0x5e07('0x33')](_0x5d19c2[_0x5e07('0x32')]);_0x274ef9[_0x5e07('0x34')]=_[_0x5e07('0x35')](_0x274ef9['model'],_0x274ef9[_0x5e07('0x32')]);_0x559b7c[_0x5e07('0x37')]=_[_0x5e07('0x35')](_0x274ef9[_0x5e07('0x30')],qs[_0x5e07('0x36')](_0x5d19c2[_0x5e07('0x32')][_0x5e07('0x36')]));_0x559b7c[_0x5e07('0x37')]=_0x559b7c[_0x5e07('0x37')][_0x5e07('0x38')]?_0x559b7c[_0x5e07('0x37')]:_0x274ef9[_0x5e07('0x30')];_0x559b7c['order']=qs[_0x5e07('0x3b')](_0x5d19c2[_0x5e07('0x32')][_0x5e07('0x3b')]);_0x559b7c[_0x5e07('0x3c')]=qs['filters'](_['pick'](_0x5d19c2[_0x5e07('0x32')],_0x274ef9[_0x5e07('0x34')]));if(_0x5d19c2[_0x5e07('0x32')]['filter']){_0x559b7c[_0x5e07('0x3c')]=_[_0x5e07('0x3f')](_0x559b7c[_0x5e07('0x3c')],{'$or':_[_0x5e07('0x31')](_0x559b7c['attributes'],function(_0x5bc554){var _0x258258={};_0x258258[_0x5bc554]={'$like':'%'+_0x5d19c2[_0x5e07('0x32')]['filter']+'%'};return _0x258258;})});}_0x559b7c=_[_0x5e07('0x3f')]({},_0x559b7c,_0x5d19c2[_0x5e07('0x40')]);return _0x40d294['getFields'](_0x559b7c);}})[_0x5e07('0x28')](function(_0x1293cc){if(_0x1293cc){_0x27a182=_0x1293cc[_0x5e07('0x38')];if(!_0x5d19c2[_0x5e07('0x32')]['hasOwnProperty']('nolimit')){_0x559b7c['limit']=qs[_0x5e07('0x23')](_0x5d19c2[_0x5e07('0x32')]['limit']);_0x559b7c[_0x5e07('0x21')]=qs[_0x5e07('0x21')](_0x5d19c2[_0x5e07('0x32')][_0x5e07('0x21')]);}return _0x40d294[_0x5e07('0x4c')](_0x559b7c);}})[_0x5e07('0x28')](function(_0x2a7ad0){if(_0x2a7ad0){return _0x2a7ad0?{'count':_0x27a182,'rows':_0x2a7ad0}:null;}})[_0x5e07('0x28')](respondWithResult(_0x119f7b,null))[_0x5e07('0x45')](handleError(_0x119f7b,null));};exports[_0x5e07('0x4e')]=function(_0x86f54a,_0x37bfed,_0x5ae4eb){var _0x1d4979={};var _0x461fe2={};var _0x2155b6;var _0x1507ae;return db[_0x5e07('0x41')][_0x5e07('0x4f')]({'where':{'id':_0x86f54a[_0x5e07('0x4b')]['id']}})['then'](handleEntityNotFound(_0x37bfed,null))[_0x5e07('0x28')](function(_0x2156c9){if(_0x2156c9){_0x2155b6=_0x2156c9;_0x461fe2[_0x5e07('0x30')]=_['keys'](db[_0x5e07('0x4d')][_0x5e07('0x47')]);_0x461fe2[_0x5e07('0x32')]=_[_0x5e07('0x33')](_0x86f54a[_0x5e07('0x32')]);_0x461fe2[_0x5e07('0x34')]=_[_0x5e07('0x35')](_0x461fe2[_0x5e07('0x30')],_0x461fe2['query']);_0x1d4979[_0x5e07('0x37')]=_[_0x5e07('0x35')](_0x461fe2[_0x5e07('0x30')],qs['fields'](_0x86f54a[_0x5e07('0x32')][_0x5e07('0x36')]));_0x1d4979[_0x5e07('0x37')]=_0x1d4979[_0x5e07('0x37')]['length']?_0x1d4979[_0x5e07('0x37')]:_0x461fe2[_0x5e07('0x30')];_0x1d4979[_0x5e07('0x50')]=qs[_0x5e07('0x3b')](_0x86f54a['query'][_0x5e07('0x3b')]);_0x1d4979[_0x5e07('0x3c')]=qs['filters'](_[_0x5e07('0x3d')](_0x86f54a[_0x5e07('0x32')],_0x461fe2[_0x5e07('0x34')]));if(_0x86f54a[_0x5e07('0x32')]['filter']){_0x1d4979[_0x5e07('0x3c')]=_[_0x5e07('0x3f')](_0x1d4979[_0x5e07('0x3c')],{'$or':_[_0x5e07('0x31')](_0x1d4979[_0x5e07('0x37')],function(_0x2db877){var _0x5ebcd5={};_0x5ebcd5[_0x2db877]={'$like':'%'+_0x86f54a[_0x5e07('0x32')][_0x5e07('0x3e')]+'%'};return _0x5ebcd5;})});}_0x1d4979=_[_0x5e07('0x3f')]({},_0x1d4979,_0x86f54a['options']);return _0x2155b6['getSubjects'](_0x1d4979);}})[_0x5e07('0x28')](function(_0x3db9d9){if(_0x3db9d9){_0x1507ae=_0x3db9d9['length'];if(!_0x86f54a['query']['hasOwnProperty'](_0x5e07('0x3a'))){_0x1d4979[_0x5e07('0x23')]=qs['limit'](_0x86f54a[_0x5e07('0x32')][_0x5e07('0x23')]);_0x1d4979[_0x5e07('0x21')]=qs[_0x5e07('0x21')](_0x86f54a[_0x5e07('0x32')][_0x5e07('0x21')]);}return _0x2155b6[_0x5e07('0x4e')](_0x1d4979);}})[_0x5e07('0x28')](function(_0x17703e){if(_0x17703e){return _0x17703e?{'count':_0x1507ae,'rows':_0x17703e}:null;}})[_0x5e07('0x28')](respondWithResult(_0x37bfed,null))[_0x5e07('0x45')](handleError(_0x37bfed,null));};exports[_0x5e07('0x51')]=function(_0x1d8be1,_0x424c8c,_0x15e2cd){var _0x1b6fd6={};var _0x2a96d8={};var _0x3f6b68;var _0x12506d;return db[_0x5e07('0x41')][_0x5e07('0x4f')]({'where':{'id':_0x1d8be1[_0x5e07('0x4b')]['id']}})[_0x5e07('0x28')](handleEntityNotFound(_0x424c8c,null))[_0x5e07('0x28')](function(_0x3a856c){if(_0x3a856c){_0x3f6b68=_0x3a856c;_0x2a96d8['model']=_[_0x5e07('0x33')](db[_0x5e07('0x4d')][_0x5e07('0x47')]);_0x2a96d8[_0x5e07('0x32')]=_[_0x5e07('0x33')](_0x1d8be1[_0x5e07('0x32')]);_0x2a96d8[_0x5e07('0x34')]=_[_0x5e07('0x35')](_0x2a96d8['model'],_0x2a96d8[_0x5e07('0x32')]);_0x1b6fd6[_0x5e07('0x37')]=_['intersection'](_0x2a96d8[_0x5e07('0x30')],qs[_0x5e07('0x36')](_0x1d8be1[_0x5e07('0x32')][_0x5e07('0x36')]));_0x1b6fd6[_0x5e07('0x37')]=_0x1b6fd6[_0x5e07('0x37')][_0x5e07('0x38')]?_0x1b6fd6['attributes']:_0x2a96d8[_0x5e07('0x30')];_0x1b6fd6[_0x5e07('0x50')]=qs[_0x5e07('0x3b')](_0x1d8be1[_0x5e07('0x32')][_0x5e07('0x3b')]);_0x1b6fd6[_0x5e07('0x3c')]=qs[_0x5e07('0x34')](_['pick'](_0x1d8be1['query'],_0x2a96d8[_0x5e07('0x34')]));if(_0x1d8be1[_0x5e07('0x32')][_0x5e07('0x3e')]){_0x1b6fd6[_0x5e07('0x3c')]=_['merge'](_0x1b6fd6[_0x5e07('0x3c')],{'$or':_[_0x5e07('0x31')](_0x1b6fd6[_0x5e07('0x37')],function(_0xd6d292){var _0x3a8b3e={};_0x3a8b3e[_0xd6d292]={'$like':'%'+_0x1d8be1[_0x5e07('0x32')][_0x5e07('0x3e')]+'%'};return _0x3a8b3e;})});}_0x1b6fd6=_[_0x5e07('0x3f')]({},_0x1b6fd6,_0x1d8be1[_0x5e07('0x40')]);return _0x3f6b68[_0x5e07('0x51')](_0x1b6fd6);}})[_0x5e07('0x28')](function(_0x39ea36){if(_0x39ea36){_0x12506d=_0x39ea36[_0x5e07('0x38')];if(!_0x1d8be1[_0x5e07('0x32')][_0x5e07('0x39')]('nolimit')){_0x1b6fd6[_0x5e07('0x23')]=qs[_0x5e07('0x23')](_0x1d8be1[_0x5e07('0x32')]['limit']);_0x1b6fd6[_0x5e07('0x21')]=qs[_0x5e07('0x21')](_0x1d8be1['query']['offset']);}return _0x3f6b68[_0x5e07('0x51')](_0x1b6fd6);}})[_0x5e07('0x28')](function(_0xc4dea){if(_0xc4dea){return _0xc4dea?{'count':_0x12506d,'rows':_0xc4dea}:null;}})[_0x5e07('0x28')](respondWithResult(_0x424c8c,null))[_0x5e07('0x45')](handleError(_0x424c8c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index bc3f959..a4b2dd1 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 _0x7ccb=['../../config/logger','moment','request-promise','../../config/environment','exports','define','int_sugarcrm_configurations','util'];(function(_0x2c428d,_0x3a11e2){var _0x1d6888=function(_0x26ce38){while(--_0x26ce38){_0x2c428d['push'](_0x2c428d['shift']());}};_0x1d6888(++_0x3a11e2);}(_0x7ccb,0x167));var _0xb7cc=function(_0x18a71e,_0x1887ec){_0x18a71e=_0x18a71e-0x0;var _0x6a2ef7=_0x7ccb[_0x18a71e];return _0x6a2ef7;};'use strict';var _=require('lodash');var util=require(_0xb7cc('0x0'));var logger=require(_0xb7cc('0x1'))('api');var moment=require(_0xb7cc('0x2'));var BPromise=require('bluebird');var rp=require(_0xb7cc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb7cc('0x4'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xb7cc('0x5')]=function(_0x4849ef,_0x59de15){return _0x4849ef[_0xb7cc('0x6')]('SugarcrmConfiguration',attributes,{'tableName':_0xb7cc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc19=['define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x5d845e,_0x5ad47b){var _0x2090c0=function(_0x4057e2){while(--_0x4057e2){_0x5d845e['push'](_0x5d845e['shift']());}};_0x2090c0(++_0x5ad47b);}(_0xdc19,0x199));var _0x9dc1=function(_0x594812,_0x2eb78d){_0x594812=_0x594812-0x0;var _0xc25be2=_0xdc19[_0x594812];return _0xc25be2;};'use strict';var _=require(_0x9dc1('0x0'));var util=require(_0x9dc1('0x1'));var logger=require(_0x9dc1('0x2'))(_0x9dc1('0x3'));var moment=require(_0x9dc1('0x4'));var BPromise=require(_0x9dc1('0x5'));var rp=require(_0x9dc1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9dc1('0x7'));var config=require(_0x9dc1('0x8'));var attributes=require(_0x9dc1('0x9'));module[_0x9dc1('0xa')]=function(_0xee7fa2,_0x57aa09){return _0xee7fa2[_0x9dc1('0xb')](_0x9dc1('0xc'),attributes,{'tableName':_0x9dc1('0xd'),'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 df5d484..5824a3e 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 _0xa6a7=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x51a34e,_0xdd9984){var _0x6e5bd7=function(_0x11f638){while(--_0x11f638){_0x51a34e['push'](_0x51a34e['shift']());}};_0x6e5bd7(++_0xdd9984);}(_0xa6a7,0x1d7));var _0x7a6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa6a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7a6a('0x0'));var util=require('util');var moment=require(_0x7a6a('0x1'));var BPromise=require(_0x7a6a('0x2'));var rs=require(_0x7a6a('0x3'));var fs=require('fs');var Redis=require(_0x7a6a('0x4'));var db=require(_0x7a6a('0x5'))['db'];var utils=require(_0x7a6a('0x6'));var logger=require('../../config/logger')(_0x7a6a('0x7'));var config=require(_0x7a6a('0x8'));var jayson=require(_0x7a6a('0x9'));var client=jayson[_0x7a6a('0xa')][_0x7a6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a6cd4,_0x464605,_0x1c7891){return new BPromise(function(_0x4a068e,_0x13b5ee){return client['request'](_0x2a6cd4,_0x1c7891)[_0x7a6a('0xc')](function(_0x2c2301){logger['info'](_0x7a6a('0xd'),_0x464605,_0x7a6a('0xe'));logger[_0x7a6a('0xf')](_0x7a6a('0x10'),_0x464605,_0x7a6a('0xe'),JSON['stringify'](_0x2c2301));if(_0x2c2301['error']){if(_0x2c2301['error']['code']===0x1f4){logger[_0x7a6a('0x11')](_0x7a6a('0xd'),_0x464605,_0x2c2301[_0x7a6a('0x11')][_0x7a6a('0x12')]);return _0x13b5ee(_0x2c2301['error'][_0x7a6a('0x12')]);}logger['error'](_0x7a6a('0xd'),_0x464605,_0x2c2301[_0x7a6a('0x11')][_0x7a6a('0x12')]);return _0x4a068e(_0x2c2301[_0x7a6a('0x11')]['message']);}else{logger[_0x7a6a('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x464605,'request\x20sent');_0x4a068e(_0x2c2301[_0x7a6a('0x14')][_0x7a6a('0x12')]);}})[_0x7a6a('0x15')](function(_0x4b8942){logger[_0x7a6a('0x11')](_0x7a6a('0xd'),_0x464605,_0x4b8942);_0x13b5ee(_0x4b8942);});});} \ No newline at end of file +var _0x6400=['jayson/promise','client','http','request','then','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x6400,0xd8));var _0x0640=function(_0x46f659,_0x3c2c9d){_0x46f659=_0x46f659-0x0;var _0xbf5e5c=_0x6400[_0x46f659];return _0xbf5e5c;};'use strict';var _=require('lodash');var util=require(_0x0640('0x0'));var moment=require(_0x0640('0x1'));var BPromise=require(_0x0640('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0640('0x3'));var db=require(_0x0640('0x4'))['db'];var utils=require(_0x0640('0x5'));var logger=require(_0x0640('0x6'))(_0x0640('0x7'));var config=require(_0x0640('0x8'));var jayson=require(_0x0640('0x9'));var client=jayson[_0x0640('0xa')][_0x0640('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x574bad,_0x27d4fb,_0x25bcf2){return new BPromise(function(_0x5daba0,_0x335834){return client[_0x0640('0xc')](_0x574bad,_0x25bcf2)[_0x0640('0xd')](function(_0x2a93a0){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x27d4fb,_0x0640('0xe'));logger[_0x0640('0xf')](_0x0640('0x10'),_0x27d4fb,_0x0640('0xe'),JSON[_0x0640('0x11')](_0x2a93a0));if(_0x2a93a0[_0x0640('0x12')]){if(_0x2a93a0[_0x0640('0x12')][_0x0640('0x13')]===0x1f4){logger[_0x0640('0x12')](_0x0640('0x14'),_0x27d4fb,_0x2a93a0['error'][_0x0640('0x15')]);return _0x335834(_0x2a93a0[_0x0640('0x12')]['message']);}logger[_0x0640('0x12')](_0x0640('0x14'),_0x27d4fb,_0x2a93a0[_0x0640('0x12')][_0x0640('0x15')]);return _0x5daba0(_0x2a93a0[_0x0640('0x12')]['message']);}else{logger[_0x0640('0x16')](_0x0640('0x14'),_0x27d4fb,_0x0640('0xe'));_0x5daba0(_0x2a93a0[_0x0640('0x17')][_0x0640('0x15')]);}})[_0x0640('0x18')](function(_0x448d5d){logger['error'](_0x0640('0x14'),_0x27d4fb,_0x448d5d);_0x335834(_0x448d5d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index b9172f7..846bfa6 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 _0x5d36=['exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','index','/:id','show','post','isAuthenticated','create','put','update','destroy'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x5d36,0x199));var _0x65d3=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0x5d36[_0xf31767];return _0x24bd0c;};'use strict';var multer=require(_0x65d3('0x0'));var util=require(_0x65d3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x65d3('0x2'));var router=express['Router']();var fs_extra=require(_0x65d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x65d3('0x4'));var config=require(_0x65d3('0x5'));var controller=require(_0x65d3('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x65d3('0x7')]);router['get'](_0x65d3('0x8'),auth['isAuthenticated'](),controller[_0x65d3('0x9')]);router[_0x65d3('0xa')]('/',auth[_0x65d3('0xb')](),controller[_0x65d3('0xc')]);router[_0x65d3('0xd')](_0x65d3('0x8'),auth[_0x65d3('0xb')](),controller[_0x65d3('0xe')]);router['delete'](_0x65d3('0x8'),auth[_0x65d3('0xb')](),controller[_0x65d3('0xf')]);module[_0x65d3('0x10')]=router; \ No newline at end of file +var _0x1c81=['show','post','put','update','delete','destroy','multer','util','express','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','/:id'];(function(_0x3015e6,_0x7b361){var _0x42f816=function(_0x1c3740){while(--_0x1c3740){_0x3015e6['push'](_0x3015e6['shift']());}};_0x42f816(++_0x7b361);}(_0x1c81,0xe7));var _0x11c8=function(_0x288fe6,_0x1bbe4a){_0x288fe6=_0x288fe6-0x0;var _0x453c80=_0x1c81[_0x288fe6];return _0x453c80;};'use strict';var multer=require(_0x11c8('0x0'));var util=require(_0x11c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x11c8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x11c8('0x3'));var config=require('../../config/environment');var controller=require(_0x11c8('0x4'));router[_0x11c8('0x5')]('/',auth[_0x11c8('0x6')](),controller[_0x11c8('0x7')]);router[_0x11c8('0x5')](_0x11c8('0x8'),auth[_0x11c8('0x6')](),controller[_0x11c8('0x9')]);router[_0x11c8('0xa')]('/',auth[_0x11c8('0x6')](),controller['create']);router[_0x11c8('0xb')](_0x11c8('0x8'),auth['isAuthenticated'](),controller[_0x11c8('0xc')]);router[_0x11c8('0xd')](_0x11c8('0x8'),auth['isAuthenticated'](),controller[_0x11c8('0xe')]);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 0b4f34c..f807d95 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 _0xf000=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0xce3a0b,_0x5b271b){var _0x1ca1b9=function(_0x1acd40){while(--_0x1acd40){_0xce3a0b['push'](_0xce3a0b['shift']());}};_0x1ca1b9(++_0x5b271b);}(_0xf000,0x1d8));var _0x0f00=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0xf000[_0x3fb9dd];return _0x20136a;};'use strict';var Sequelize=require('sequelize');module[_0x0f00('0x0')]={'type':{'type':Sequelize[_0x0f00('0x1')]('string',_0x0f00('0x2'),_0x0f00('0x3'),_0x0f00('0x4'),_0x0f00('0x5')),'defaultValue':_0x0f00('0x6')},'content':{'type':Sequelize[_0x0f00('0x7')]},'key':{'type':Sequelize[_0x0f00('0x7')]},'keyType':{'type':Sequelize[_0x0f00('0x1')](_0x0f00('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0f00('0x7')]},'nameField':{'type':Sequelize[_0x0f00('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9045=['string','variable','BOOLEAN','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x9045,0x183));var _0x5904=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x9045[_0x34021d];return _0x16597b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0x5904('0x0'),_0x5904('0x1'),_0x5904('0x2')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5904('0x3')]},'key':{'type':Sequelize[_0x5904('0x3')]},'keyType':{'type':Sequelize[_0x5904('0x4')](_0x5904('0x5'),_0x5904('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x5904('0x3')]},'idField':{'type':Sequelize[_0x5904('0x3')]},'nameField':{'type':Sequelize[_0x5904('0x3')]},'customField':{'type':Sequelize[_0x5904('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 5abbff9..638f8a6 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 _0x078c=['show','params','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','then','error','stack','name','map','SugarcrmField','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x2ce852,_0x33114f){var _0x28132c=function(_0x40efeb){while(--_0x40efeb){_0x2ce852['push'](_0x2ce852['shift']());}};_0x28132c(++_0x33114f);}(_0x078c,0x1c9));var _0xc078=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x078c[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0xc078('0x0'));var rimraf=require(_0xc078('0x1'));var zipdir=require(_0xc078('0x2'));var jsonpatch=require(_0xc078('0x3'));var rp=require(_0xc078('0x4'));var moment=require(_0xc078('0x5'));var BPromise=require(_0xc078('0x6'));var Mustache=require(_0xc078('0x7'));var util=require(_0xc078('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xc078('0x9'));var ejs=require(_0xc078('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc078('0xb'));var squel=require(_0xc078('0xc'));var crypto=require(_0xc078('0xd'));var jsforce=require(_0xc078('0xe'));var deskjs=require(_0xc078('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc078('0x10'));var Papa=require(_0xc078('0x11'));var Redis=require(_0xc078('0x12'));var authService=require(_0xc078('0x13'));var qs=require(_0xc078('0x14'));var as=require(_0xc078('0x15'));var hardwareService=require(_0xc078('0x16'));var logger=require('../../config/logger')(_0xc078('0x17'));var utils=require(_0xc078('0x18'));var config=require(_0xc078('0x19'));var licenseUtil=require(_0xc078('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x694f80,_0x403486){_0x403486=_0x403486||0xcc;return function(_0x1fdee4){if(_0x1fdee4){return _0x694f80[_0xc078('0x1b')](_0x403486);}return _0x694f80[_0xc078('0x1c')](_0x403486)[_0xc078('0x1d')]();};}function respondWithResult(_0x64cf1b,_0x15afff){_0x15afff=_0x15afff||0xc8;return function(_0x3fdfee){if(_0x3fdfee){return _0x64cf1b[_0xc078('0x1c')](_0x15afff)[_0xc078('0x1e')](_0x3fdfee);}};}function respondWithFilteredResult(_0x18a1d3,_0x552838){return function(_0x5db74a){if(_0x5db74a){var _0x226787=typeof _0x552838[_0xc078('0x1f')]===_0xc078('0x20')&&typeof _0x552838[_0xc078('0x21')]===_0xc078('0x20');var _0x385743=_0x5db74a[_0xc078('0x22')];var _0x12446f=_0x226787?0x0:_0x552838['offset'];var _0x5a0d48=_0x226787?_0x5db74a[_0xc078('0x22')]:_0x552838[_0xc078('0x1f')]+_0x552838[_0xc078('0x21')];var _0x4fba09;if(_0x5a0d48>=_0x385743){_0x5a0d48=_0x385743;_0x4fba09=0xc8;}else{_0x4fba09=0xce;}_0x18a1d3['status'](_0x4fba09);return _0x18a1d3['set']('Content-Range',_0x12446f+'-'+_0x5a0d48+'/'+_0x385743)['json'](_0x5db74a);}return null;};}function patchUpdates(_0x117c27){return function(_0x55557c){try{jsonpatch['apply'](_0x55557c,_0x117c27,!![]);}catch(_0x4e98c5){return BPromise[_0xc078('0x23')](_0x4e98c5);}return _0x55557c[_0xc078('0x24')]();};}function saveUpdates(_0x3d2217,_0x36abfd){return function(_0x14bb9d){if(_0x14bb9d){return _0x14bb9d['update'](_0x3d2217)[_0xc078('0x25')](function(_0x3cb249){return _0x3cb249;});}return null;};}function removeEntity(_0x13480b,_0x2155d7){return function(_0x4d3167){if(_0x4d3167){return _0x4d3167['destroy']()[_0xc078('0x25')](function(){_0x13480b['status'](0xcc)[_0xc078('0x1d')]();});}};}function handleEntityNotFound(_0x5e21ef,_0x4076f8){return function(_0x2d027e){if(!_0x2d027e){_0x5e21ef[_0xc078('0x1b')](0x194);}return _0x2d027e;};}function handleError(_0x2cc494,_0x4d3c3f){_0x4d3c3f=_0x4d3c3f||0x1f4;return function(_0x561bfa){logger[_0xc078('0x26')](_0x561bfa[_0xc078('0x27')]);if(_0x561bfa[_0xc078('0x28')]){delete _0x561bfa[_0xc078('0x28')];}_0x2cc494['status'](_0x4d3c3f)['send'](_0x561bfa);};}exports['index']=function(_0x5b76e7,_0x59319a){var _0x241ad4={},_0x48a51b={},_0x42ed7f={'count':0x0,'rows':[]};var _0x1bc950=_[_0xc078('0x29')](db[_0xc078('0x2a')][_0xc078('0x2b')],function(_0x31091e){return{'name':_0x31091e[_0xc078('0x2c')],'type':_0x31091e['type']['key']};});_0x48a51b['model']=_[_0xc078('0x29')](_0x1bc950,_0xc078('0x28'));_0x48a51b['query']=_[_0xc078('0x2d')](_0x5b76e7[_0xc078('0x2e')]);_0x48a51b[_0xc078('0x2f')]=_[_0xc078('0x30')](_0x48a51b[_0xc078('0x31')],_0x48a51b[_0xc078('0x2e')]);_0x241ad4[_0xc078('0x32')]=_[_0xc078('0x30')](_0x48a51b[_0xc078('0x31')],qs[_0xc078('0x33')](_0x5b76e7[_0xc078('0x2e')][_0xc078('0x33')]));_0x241ad4[_0xc078('0x32')]=_0x241ad4[_0xc078('0x32')][_0xc078('0x34')]?_0x241ad4['attributes']:_0x48a51b[_0xc078('0x31')];if(!_0x5b76e7[_0xc078('0x2e')][_0xc078('0x35')](_0xc078('0x36'))){_0x241ad4[_0xc078('0x21')]=qs['limit'](_0x5b76e7[_0xc078('0x2e')][_0xc078('0x21')]);_0x241ad4[_0xc078('0x1f')]=qs[_0xc078('0x1f')](_0x5b76e7[_0xc078('0x2e')][_0xc078('0x1f')]);}_0x241ad4[_0xc078('0x37')]=qs[_0xc078('0x38')](_0x5b76e7[_0xc078('0x2e')][_0xc078('0x38')]);_0x241ad4['where']=qs[_0xc078('0x2f')](_[_0xc078('0x39')](_0x5b76e7[_0xc078('0x2e')],_0x48a51b[_0xc078('0x2f')]),_0x1bc950);if(_0x5b76e7[_0xc078('0x2e')][_0xc078('0x3a')]){_0x241ad4[_0xc078('0x3b')]=_[_0xc078('0x3c')](_0x241ad4[_0xc078('0x3b')],{'$or':_['map'](_0x1bc950,function(_0x58390b){if(_0x58390b[_0xc078('0x3d')]!==_0xc078('0x3e')){var _0x3e56fb={};_0x3e56fb[_0x58390b['name']]={'$like':'%'+_0x5b76e7[_0xc078('0x2e')][_0xc078('0x3a')]+'%'};return _0x3e56fb;}})});}_0x241ad4=_['merge']({},_0x241ad4,_0x5b76e7[_0xc078('0x3f')]);var _0x55f81a={'where':_0x241ad4['where']};return db[_0xc078('0x2a')]['count'](_0x55f81a)[_0xc078('0x25')](function(_0x3012f7){_0x42ed7f['count']=_0x3012f7;if(_0x5b76e7[_0xc078('0x2e')]['includeAll']){_0x241ad4[_0xc078('0x40')]=[{'all':!![]}];}return db[_0xc078('0x2a')][_0xc078('0x41')](_0x241ad4);})[_0xc078('0x25')](function(_0x404d65){_0x42ed7f[_0xc078('0x42')]=_0x404d65;return _0x42ed7f;})['then'](respondWithFilteredResult(_0x59319a,_0x241ad4))[_0xc078('0x43')](handleError(_0x59319a,null));};exports[_0xc078('0x44')]=function(_0x5dd9ba,_0x2e9248){var _0x27beff={'raw':!![],'where':{'id':_0x5dd9ba[_0xc078('0x45')]['id']}},_0x361e40={};_0x361e40[_0xc078('0x31')]=_[_0xc078('0x2d')](db['SugarcrmField'][_0xc078('0x2b')]);_0x361e40['query']=_['keys'](_0x5dd9ba[_0xc078('0x2e')]);_0x361e40['filters']=_[_0xc078('0x30')](_0x361e40[_0xc078('0x31')],_0x361e40['query']);_0x27beff[_0xc078('0x32')]=_['intersection'](_0x361e40[_0xc078('0x31')],qs[_0xc078('0x33')](_0x5dd9ba['query'][_0xc078('0x33')]));_0x27beff['attributes']=_0x27beff[_0xc078('0x32')][_0xc078('0x34')]?_0x27beff['attributes']:_0x361e40[_0xc078('0x31')];if(_0x5dd9ba[_0xc078('0x2e')][_0xc078('0x46')]){_0x27beff['include']=[{'all':!![]}];}_0x27beff=_[_0xc078('0x3c')]({},_0x27beff,_0x5dd9ba[_0xc078('0x3f')]);return db[_0xc078('0x2a')][_0xc078('0x47')](_0x27beff)[_0xc078('0x25')](handleEntityNotFound(_0x2e9248,null))[_0xc078('0x25')](respondWithResult(_0x2e9248,null))[_0xc078('0x43')](handleError(_0x2e9248,null));};exports[_0xc078('0x48')]=function(_0x9e7892,_0x33606b){return db['SugarcrmField'][_0xc078('0x48')](_0x9e7892['body'],{})[_0xc078('0x25')](respondWithResult(_0x33606b,0xc9))[_0xc078('0x43')](handleError(_0x33606b,null));};exports['update']=function(_0x23d324,_0x48cf68){if(_0x23d324[_0xc078('0x49')]['id']){delete _0x23d324[_0xc078('0x49')]['id'];}return db[_0xc078('0x2a')][_0xc078('0x47')]({'where':{'id':_0x23d324[_0xc078('0x45')]['id']}})[_0xc078('0x25')](handleEntityNotFound(_0x48cf68,null))[_0xc078('0x25')](saveUpdates(_0x23d324[_0xc078('0x49')],null))[_0xc078('0x25')](respondWithResult(_0x48cf68,null))[_0xc078('0x43')](handleError(_0x48cf68,null));};exports[_0xc078('0x4a')]=function(_0x3995b9,_0x2588b3){return db[_0xc078('0x2a')][_0xc078('0x47')]({'where':{'id':_0x3995b9['params']['id']}})['then'](handleEntityNotFound(_0x2588b3,null))[_0xc078('0x25')](removeEntity(_0x2588b3,null))[_0xc078('0x43')](handleError(_0x2588b3,null));}; \ No newline at end of file +var _0x5014=['api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','sendStatus','error','stack','name','index','map','SugarcrmField','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5014,0x15a));var _0x4501=function(_0x4f5c62,_0xac8212){_0x4f5c62=_0x4f5c62-0x0;var _0x22af89=_0x5014[_0x4f5c62];return _0x22af89;};'use strict';var emlformat=require(_0x4501('0x0'));var rimraf=require(_0x4501('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4501('0x2'));var moment=require(_0x4501('0x3'));var BPromise=require(_0x4501('0x4'));var Mustache=require('mustache');var util=require(_0x4501('0x5'));var path=require(_0x4501('0x6'));var sox=require(_0x4501('0x7'));var csv=require(_0x4501('0x8'));var ejs=require(_0x4501('0x9'));var fs=require('fs');var fs_extra=require(_0x4501('0xa'));var _=require(_0x4501('0xb'));var squel=require(_0x4501('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4501('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4501('0xe'));var Papa=require(_0x4501('0xf'));var Redis=require('ioredis');var authService=require(_0x4501('0x10'));var qs=require(_0x4501('0x11'));var as=require(_0x4501('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4501('0x13'));var utils=require(_0x4501('0x14'));var config=require(_0x4501('0x15'));var licenseUtil=require(_0x4501('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38f6a5,_0x57d2f3){_0x57d2f3=_0x57d2f3||0xcc;return function(_0x11ef92){if(_0x11ef92){return _0x38f6a5['sendStatus'](_0x57d2f3);}return _0x38f6a5['status'](_0x57d2f3)[_0x4501('0x17')]();};}function respondWithResult(_0x21e792,_0x205eeb){_0x205eeb=_0x205eeb||0xc8;return function(_0x38395b){if(_0x38395b){return _0x21e792[_0x4501('0x18')](_0x205eeb)[_0x4501('0x19')](_0x38395b);}};}function respondWithFilteredResult(_0x4774c7,_0x56a83a){return function(_0x358d7d){if(_0x358d7d){var _0x2f65d3=typeof _0x56a83a[_0x4501('0x1a')]===_0x4501('0x1b')&&typeof _0x56a83a[_0x4501('0x1c')]===_0x4501('0x1b');var _0x819b66=_0x358d7d['count'];var _0x58e157=_0x2f65d3?0x0:_0x56a83a[_0x4501('0x1a')];var _0x44e67a=_0x2f65d3?_0x358d7d[_0x4501('0x1d')]:_0x56a83a[_0x4501('0x1a')]+_0x56a83a['limit'];var _0x5abcb1;if(_0x44e67a>=_0x819b66){_0x44e67a=_0x819b66;_0x5abcb1=0xc8;}else{_0x5abcb1=0xce;}_0x4774c7[_0x4501('0x18')](_0x5abcb1);return _0x4774c7[_0x4501('0x1e')](_0x4501('0x1f'),_0x58e157+'-'+_0x44e67a+'/'+_0x819b66)[_0x4501('0x19')](_0x358d7d);}return null;};}function patchUpdates(_0xfee66c){return function(_0xe02bb0){try{jsonpatch[_0x4501('0x20')](_0xe02bb0,_0xfee66c,!![]);}catch(_0x9e901d){return BPromise['reject'](_0x9e901d);}return _0xe02bb0[_0x4501('0x21')]();};}function saveUpdates(_0x5e14b8,_0x4f3294){return function(_0x3c1040){if(_0x3c1040){return _0x3c1040['update'](_0x5e14b8)[_0x4501('0x22')](function(_0x4f8d0b){return _0x4f8d0b;});}return null;};}function removeEntity(_0x40ef9c,_0xd03197){return function(_0x222a36){if(_0x222a36){return _0x222a36['destroy']()['then'](function(){_0x40ef9c[_0x4501('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e0402,_0x114e0a){return function(_0xaef291){if(!_0xaef291){_0x5e0402[_0x4501('0x23')](0x194);}return _0xaef291;};}function handleError(_0x2cb720,_0x28cfca){_0x28cfca=_0x28cfca||0x1f4;return function(_0x1ef69f){logger[_0x4501('0x24')](_0x1ef69f[_0x4501('0x25')]);if(_0x1ef69f['name']){delete _0x1ef69f[_0x4501('0x26')];}_0x2cb720[_0x4501('0x18')](_0x28cfca)['send'](_0x1ef69f);};}exports[_0x4501('0x27')]=function(_0x2013f1,_0x4adc21){var _0x467f15={},_0x58d251={},_0xfab21d={'count':0x0,'rows':[]};var _0x207562=_[_0x4501('0x28')](db[_0x4501('0x29')]['rawAttributes'],function(_0x3ebf63){return{'name':_0x3ebf63[_0x4501('0x2a')],'type':_0x3ebf63['type'][_0x4501('0x2b')]};});_0x58d251[_0x4501('0x2c')]=_[_0x4501('0x28')](_0x207562,_0x4501('0x26'));_0x58d251['query']=_[_0x4501('0x2d')](_0x2013f1[_0x4501('0x2e')]);_0x58d251[_0x4501('0x2f')]=_[_0x4501('0x30')](_0x58d251[_0x4501('0x2c')],_0x58d251[_0x4501('0x2e')]);_0x467f15[_0x4501('0x31')]=_[_0x4501('0x30')](_0x58d251[_0x4501('0x2c')],qs[_0x4501('0x32')](_0x2013f1[_0x4501('0x2e')][_0x4501('0x32')]));_0x467f15[_0x4501('0x31')]=_0x467f15[_0x4501('0x31')][_0x4501('0x33')]?_0x467f15[_0x4501('0x31')]:_0x58d251['model'];if(!_0x2013f1[_0x4501('0x2e')][_0x4501('0x34')]('nolimit')){_0x467f15[_0x4501('0x1c')]=qs[_0x4501('0x1c')](_0x2013f1[_0x4501('0x2e')][_0x4501('0x1c')]);_0x467f15[_0x4501('0x1a')]=qs[_0x4501('0x1a')](_0x2013f1[_0x4501('0x2e')]['offset']);}_0x467f15[_0x4501('0x35')]=qs[_0x4501('0x36')](_0x2013f1['query'][_0x4501('0x36')]);_0x467f15[_0x4501('0x37')]=qs[_0x4501('0x2f')](_[_0x4501('0x38')](_0x2013f1[_0x4501('0x2e')],_0x58d251[_0x4501('0x2f')]),_0x207562);if(_0x2013f1[_0x4501('0x2e')][_0x4501('0x39')]){_0x467f15['where']=_[_0x4501('0x3a')](_0x467f15['where'],{'$or':_[_0x4501('0x28')](_0x207562,function(_0x270632){if(_0x270632['type']!=='VIRTUAL'){var _0x3bbed0={};_0x3bbed0[_0x270632[_0x4501('0x26')]]={'$like':'%'+_0x2013f1[_0x4501('0x2e')]['filter']+'%'};return _0x3bbed0;}})});}_0x467f15=_[_0x4501('0x3a')]({},_0x467f15,_0x2013f1[_0x4501('0x3b')]);var _0x1c169f={'where':_0x467f15['where']};return db[_0x4501('0x29')][_0x4501('0x1d')](_0x1c169f)[_0x4501('0x22')](function(_0x2d180d){_0xfab21d[_0x4501('0x1d')]=_0x2d180d;if(_0x2013f1[_0x4501('0x2e')][_0x4501('0x3c')]){_0x467f15[_0x4501('0x3d')]=[{'all':!![]}];}return db[_0x4501('0x29')][_0x4501('0x3e')](_0x467f15);})['then'](function(_0x389858){_0xfab21d[_0x4501('0x3f')]=_0x389858;return _0xfab21d;})[_0x4501('0x22')](respondWithFilteredResult(_0x4adc21,_0x467f15))[_0x4501('0x40')](handleError(_0x4adc21,null));};exports[_0x4501('0x41')]=function(_0x5ae2b8,_0x98380d){var _0x3609e9={'raw':!![],'where':{'id':_0x5ae2b8[_0x4501('0x42')]['id']}},_0x14a8b9={};_0x14a8b9[_0x4501('0x2c')]=_[_0x4501('0x2d')](db['SugarcrmField'][_0x4501('0x43')]);_0x14a8b9[_0x4501('0x2e')]=_[_0x4501('0x2d')](_0x5ae2b8[_0x4501('0x2e')]);_0x14a8b9[_0x4501('0x2f')]=_[_0x4501('0x30')](_0x14a8b9[_0x4501('0x2c')],_0x14a8b9[_0x4501('0x2e')]);_0x3609e9[_0x4501('0x31')]=_[_0x4501('0x30')](_0x14a8b9[_0x4501('0x2c')],qs[_0x4501('0x32')](_0x5ae2b8[_0x4501('0x2e')][_0x4501('0x32')]));_0x3609e9[_0x4501('0x31')]=_0x3609e9['attributes'][_0x4501('0x33')]?_0x3609e9[_0x4501('0x31')]:_0x14a8b9['model'];if(_0x5ae2b8[_0x4501('0x2e')]['includeAll']){_0x3609e9[_0x4501('0x3d')]=[{'all':!![]}];}_0x3609e9=_[_0x4501('0x3a')]({},_0x3609e9,_0x5ae2b8[_0x4501('0x3b')]);return db['SugarcrmField'][_0x4501('0x44')](_0x3609e9)['then'](handleEntityNotFound(_0x98380d,null))['then'](respondWithResult(_0x98380d,null))[_0x4501('0x40')](handleError(_0x98380d,null));};exports[_0x4501('0x45')]=function(_0x1f239d,_0x3d183f){return db[_0x4501('0x29')][_0x4501('0x45')](_0x1f239d[_0x4501('0x46')],{})[_0x4501('0x22')](respondWithResult(_0x3d183f,0xc9))[_0x4501('0x40')](handleError(_0x3d183f,null));};exports[_0x4501('0x47')]=function(_0x561889,_0x5ca4c2){if(_0x561889['body']['id']){delete _0x561889['body']['id'];}return db[_0x4501('0x29')]['find']({'where':{'id':_0x561889[_0x4501('0x42')]['id']}})[_0x4501('0x22')](handleEntityNotFound(_0x5ca4c2,null))[_0x4501('0x22')](saveUpdates(_0x561889['body'],null))[_0x4501('0x22')](respondWithResult(_0x5ca4c2,null))['catch'](handleError(_0x5ca4c2,null));};exports[_0x4501('0x48')]=function(_0x16be5a,_0x1b7dd4){return db[_0x4501('0x29')]['find']({'where':{'id':_0x16be5a[_0x4501('0x42')]['id']}})[_0x4501('0x22')](handleEntityNotFound(_0x1b7dd4,null))[_0x4501('0x22')](removeEntity(_0x1b7dd4,null))[_0x4501('0x40')](handleError(_0x1b7dd4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index c572876..2862e18 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 _0xab47=['../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x5dd421,_0x46f942){var _0x1b42c7=function(_0x53a1dd){while(--_0x53a1dd){_0x5dd421['push'](_0x5dd421['shift']());}};_0x1b42c7(++_0x46f942);}(_0xab47,0xd6));var _0x7ab4=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xab47[_0x29dda1];return _0x21b0ef;};'use strict';var _=require(_0x7ab4('0x0'));var util=require(_0x7ab4('0x1'));var logger=require(_0x7ab4('0x2'))('api');var moment=require(_0x7ab4('0x3'));var BPromise=require(_0x7ab4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ab4('0x5'));var rimraf=require(_0x7ab4('0x6'));var config=require(_0x7ab4('0x7'));var attributes=require(_0x7ab4('0x8'));module['exports']=function(_0x1efcd2,_0x14816c){return _0x1efcd2[_0x7ab4('0x9')](_0x7ab4('0xa'),attributes,{'tableName':_0x7ab4('0xb'),'paranoid':![],'indexes':[{'name':_0x7ab4('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe24b=['./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','path'];(function(_0x10784b,_0x59bd34){var _0x3123b4=function(_0x2a58a5){while(--_0x2a58a5){_0x10784b['push'](_0x10784b['shift']());}};_0x3123b4(++_0x59bd34);}(_0xe24b,0xcc));var _0xbe24=function(_0xd204b0,_0x4c7d1d){_0xd204b0=_0xd204b0-0x0;var _0xfc8310=_0xe24b[_0xd204b0];return _0xfc8310;};'use strict';var _=require(_0xbe24('0x0'));var util=require(_0xbe24('0x1'));var logger=require(_0xbe24('0x2'))(_0xbe24('0x3'));var moment=require(_0xbe24('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe24('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe24('0x6'));module[_0xbe24('0x7')]=function(_0x40e214,_0x2ea02a){return _0x40e214[_0xbe24('0x8')](_0xbe24('0x9'),attributes,{'tableName':_0xbe24('0xa'),'paranoid':![],'indexes':[{'name':_0xbe24('0xb'),'fields':[_0xbe24('0xc'),_0xbe24('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index e3e9bf7..543004a 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 _0xe7e7=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe7e7,0xbd));var _0x7e7e=function(_0x1cd12a,_0x1a55cd){_0x1cd12a=_0x1cd12a-0x0;var _0x1cab4d=_0xe7e7[_0x1cd12a];return _0x1cab4d;};'use strict';var _=require(_0x7e7e('0x0'));var util=require(_0x7e7e('0x1'));var moment=require(_0x7e7e('0x2'));var BPromise=require(_0x7e7e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e7e('0x4'));var db=require(_0x7e7e('0x5'))['db'];var utils=require(_0x7e7e('0x6'));var logger=require(_0x7e7e('0x7'))(_0x7e7e('0x8'));var config=require(_0x7e7e('0x9'));var jayson=require(_0x7e7e('0xa'));var client=jayson[_0x7e7e('0xb')][_0x7e7e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2926ff,_0x5b1aa4,_0xfecd7e){return new BPromise(function(_0x2332fd,_0x2002c6){return client[_0x7e7e('0xd')](_0x2926ff,_0xfecd7e)[_0x7e7e('0xe')](function(_0x986086){logger[_0x7e7e('0xf')](_0x7e7e('0x10'),_0x5b1aa4,_0x7e7e('0x11'));logger['debug'](_0x7e7e('0x12'),_0x5b1aa4,'request\x20sent',JSON[_0x7e7e('0x13')](_0x986086));if(_0x986086['error']){if(_0x986086[_0x7e7e('0x14')]['code']===0x1f4){logger[_0x7e7e('0x14')](_0x7e7e('0x10'),_0x5b1aa4,_0x986086[_0x7e7e('0x14')][_0x7e7e('0x15')]);return _0x2002c6(_0x986086['error'][_0x7e7e('0x15')]);}logger[_0x7e7e('0x14')](_0x7e7e('0x10'),_0x5b1aa4,_0x986086['error'][_0x7e7e('0x15')]);return _0x2332fd(_0x986086[_0x7e7e('0x14')][_0x7e7e('0x15')]);}else{logger['info'](_0x7e7e('0x10'),_0x5b1aa4,'request\x20sent');_0x2332fd(_0x986086[_0x7e7e('0x16')][_0x7e7e('0x15')]);}})[_0x7e7e('0x17')](function(_0xa1ece4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x5b1aa4,_0xa1ece4);_0x2002c6(_0xa1ece4);});});} \ No newline at end of file +var _0x3f61=['code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x119dac,_0x23117e){var _0x9076d2=function(_0x2a0d13){while(--_0x2a0d13){_0x119dac['push'](_0x119dac['shift']());}};_0x9076d2(++_0x23117e);}(_0x3f61,0x1e6));var _0x13f6=function(_0x44c92b,_0x77a838){_0x44c92b=_0x44c92b-0x0;var _0x4dedf9=_0x3f61[_0x44c92b];return _0x4dedf9;};'use strict';var _=require(_0x13f6('0x0'));var util=require(_0x13f6('0x1'));var moment=require(_0x13f6('0x2'));var BPromise=require('bluebird');var rs=require(_0x13f6('0x3'));var fs=require('fs');var Redis=require(_0x13f6('0x4'));var db=require(_0x13f6('0x5'))['db'];var utils=require(_0x13f6('0x6'));var logger=require(_0x13f6('0x7'))(_0x13f6('0x8'));var config=require(_0x13f6('0x9'));var jayson=require(_0x13f6('0xa'));var client=jayson[_0x13f6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13730c,_0x3ba1b0,_0xa9c0){return new BPromise(function(_0x39f836,_0xb5ba51){return client['request'](_0x13730c,_0xa9c0)[_0x13f6('0xc')](function(_0x324166){logger[_0x13f6('0xd')](_0x13f6('0xe'),_0x3ba1b0,_0x13f6('0xf'));logger[_0x13f6('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3ba1b0,'request\x20sent',JSON['stringify'](_0x324166));if(_0x324166[_0x13f6('0x11')]){if(_0x324166[_0x13f6('0x11')][_0x13f6('0x12')]===0x1f4){logger[_0x13f6('0x11')](_0x13f6('0xe'),_0x3ba1b0,_0x324166[_0x13f6('0x11')][_0x13f6('0x13')]);return _0xb5ba51(_0x324166[_0x13f6('0x11')][_0x13f6('0x13')]);}logger[_0x13f6('0x11')](_0x13f6('0xe'),_0x3ba1b0,_0x324166[_0x13f6('0x11')][_0x13f6('0x13')]);return _0x39f836(_0x324166[_0x13f6('0x11')][_0x13f6('0x13')]);}else{logger[_0x13f6('0xd')](_0x13f6('0xe'),_0x3ba1b0,_0x13f6('0xf'));_0x39f836(_0x324166['result'][_0x13f6('0x13')]);}})[_0x13f6('0x14')](function(_0x26e503){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x3ba1b0,_0x26e503);_0xb5ba51(_0x26e503);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index f672959..763ca82 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 _0xb9c6=['get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intVtigerAccount.controller','index','/:id','isAuthenticated'];(function(_0x4ecd76,_0x79f1f3){var _0x240f34=function(_0x563f79){while(--_0x563f79){_0x4ecd76['push'](_0x4ecd76['shift']());}};_0x240f34(++_0x79f1f3);}(_0xb9c6,0x1d8));var _0x6b9c=function(_0x30ebff,_0x434cc4){_0x30ebff=_0x30ebff-0x0;var _0x421101=_0xb9c6[_0x30ebff];return _0x421101;};'use strict';var multer=require(_0x6b9c('0x0'));var util=require(_0x6b9c('0x1'));var path=require(_0x6b9c('0x2'));var timeout=require(_0x6b9c('0x3'));var express=require(_0x6b9c('0x4'));var router=express[_0x6b9c('0x5')]();var fs_extra=require(_0x6b9c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6b9c('0x7'));var controller=require(_0x6b9c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6b9c('0x9')]);router['get'](_0x6b9c('0xa'),auth[_0x6b9c('0xb')](),controller['show']);router[_0x6b9c('0xc')](_0x6b9c('0xd'),auth[_0x6b9c('0xb')](),controller[_0x6b9c('0xe')]);router[_0x6b9c('0xc')](_0x6b9c('0xf'),auth[_0x6b9c('0xb')](),controller[_0x6b9c('0x10')]);router['post']('/',auth[_0x6b9c('0xb')](),controller[_0x6b9c('0x11')]);router[_0x6b9c('0x12')](_0x6b9c('0xd'),auth[_0x6b9c('0xb')](),controller['addConfiguration']);router[_0x6b9c('0x13')](_0x6b9c('0xa'),auth[_0x6b9c('0xb')](),controller['update']);router['delete'](_0x6b9c('0xa'),auth['isAuthenticated'](),controller[_0x6b9c('0x14')]);module[_0x6b9c('0x15')]=router; \ No newline at end of file +var _0xf842=['update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0xf842,0x172));var _0x2f84=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xf842[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require(_0x2f84('0x0'));var util=require(_0x2f84('0x1'));var path=require(_0x2f84('0x2'));var timeout=require(_0x2f84('0x3'));var express=require('express');var router=express[_0x2f84('0x4')]();var fs_extra=require(_0x2f84('0x5'));var auth=require(_0x2f84('0x6'));var interaction=require(_0x2f84('0x7'));var config=require(_0x2f84('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x2f84('0x9')]('/',auth[_0x2f84('0xa')](),controller[_0x2f84('0xb')]);router['get'](_0x2f84('0xc'),auth[_0x2f84('0xa')](),controller[_0x2f84('0xd')]);router[_0x2f84('0x9')](_0x2f84('0xe'),auth[_0x2f84('0xa')](),controller[_0x2f84('0xf')]);router[_0x2f84('0x9')](_0x2f84('0x10'),auth[_0x2f84('0xa')](),controller['getFields']);router[_0x2f84('0x11')]('/',auth['isAuthenticated'](),controller[_0x2f84('0x12')]);router[_0x2f84('0x11')](_0x2f84('0xe'),auth[_0x2f84('0xa')](),controller[_0x2f84('0x13')]);router[_0x2f84('0x14')](_0x2f84('0xc'),auth[_0x2f84('0xa')](),controller[_0x2f84('0x15')]);router[_0x2f84('0x16')](_0x2f84('0xc'),auth[_0x2f84('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 2a25a7c..d05da8f 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 _0xcfba=['STRING','HelpDesk','sequelize'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0xcfba,0x1df));var _0xacfb=function(_0x1afeb5,_0x7c6311){_0x1afeb5=_0x1afeb5-0x0;var _0x55f568=_0xcfba[_0x1afeb5];return _0x55f568;};'use strict';var Sequelize=require(_0xacfb('0x0'));module['exports']={'name':{'type':Sequelize[_0xacfb('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xacfb('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xacfb('0x1')],'allowNull':![],'defaultValue':_0xacfb('0x2')},'remoteUri':{'type':Sequelize[_0xacfb('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xacfb('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xacfb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x6050=['HelpDesk','sequelize','STRING'];(function(_0x21e459,_0xf0c456){var _0x2f8e1d=function(_0x437ab8){while(--_0x437ab8){_0x21e459['push'](_0x21e459['shift']());}};_0x2f8e1d(++_0xf0c456);}(_0x6050,0x187));var _0x0605=function(_0x435db3,_0x5110e5){_0x435db3=_0x435db3-0x0;var _0x1c6b4f=_0x6050[_0x435db3];return _0x1c6b4f;};'use strict';var Sequelize=require(_0x0605('0x0'));module['exports']={'name':{'type':Sequelize[_0x0605('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0605('0x1')]},'username':{'type':Sequelize[_0x0605('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0605('0x1')],'allowNull':![],'defaultValue':_0x0605('0x2')},'remoteUri':{'type':Sequelize[_0x0605('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0605('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 3b3dd54..9b519fc 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 _0xf401=['attributes','fields','length','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','VtigerAccount','includeAll','include','rows','catch','params','create','body','find','destroy','getConfigurations','keys','VtigerConfiguration','hasOwnProperty','findOne','getSubjects','Descriptions','getDescriptions','channel','VtigerField','Subjects','md5','username','description','moduleName','remoteUri','accessKey','slice','substring','format','%s/webservice.php','GET','success','POST','login','token','describe','result','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','rawAttributes','type','key','query','filters','intersection','model'];(function(_0x10ccf1,_0x20f414){var _0x257c76=function(_0x49f817){while(--_0x49f817){_0x10ccf1['push'](_0x10ccf1['shift']());}};_0x257c76(++_0x20f414);}(_0xf401,0xbe));var _0x1f40=function(_0x467ad2,_0x22ddc3){_0x467ad2=_0x467ad2-0x0;var _0x3bb275=_0xf401[_0x467ad2];return _0x3bb275;};'use strict';var emlformat=require(_0x1f40('0x0'));var rimraf=require(_0x1f40('0x1'));var zipdir=require(_0x1f40('0x2'));var jsonpatch=require(_0x1f40('0x3'));var rp=require(_0x1f40('0x4'));var moment=require(_0x1f40('0x5'));var BPromise=require(_0x1f40('0x6'));var Mustache=require(_0x1f40('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1f40('0x8'));var csv=require(_0x1f40('0x9'));var ejs=require(_0x1f40('0xa'));var fs=require('fs');var fs_extra=require(_0x1f40('0xb'));var _=require(_0x1f40('0xc'));var squel=require(_0x1f40('0xd'));var crypto=require(_0x1f40('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1f40('0xf'));var toCsv=require(_0x1f40('0x9'));var querystring=require(_0x1f40('0x10'));var Papa=require('papaparse');var Redis=require(_0x1f40('0x11'));var authService=require(_0x1f40('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f40('0x13'));var logger=require('../../config/logger')(_0x1f40('0x14'));var utils=require(_0x1f40('0x15'));var config=require(_0x1f40('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1f40('0x17'))['db'];var integrations=require(_0x1f40('0x18'));function respondWithStatusCode(_0x59ddbf,_0x2968fc){_0x2968fc=_0x2968fc||0xcc;return function(_0x144fb6){if(_0x144fb6){return _0x59ddbf[_0x1f40('0x19')](_0x2968fc);}return _0x59ddbf[_0x1f40('0x1a')](_0x2968fc)[_0x1f40('0x1b')]();};}function respondWithResult(_0x5935b9,_0x55091d){_0x55091d=_0x55091d||0xc8;return function(_0x206955){if(_0x206955){return _0x5935b9[_0x1f40('0x1a')](_0x55091d)[_0x1f40('0x1c')](_0x206955);}};}function respondWithFilteredResult(_0x4a67bb,_0x5c4412){return function(_0xb1317d){if(_0xb1317d){var _0x218b9e=typeof _0x5c4412['offset']===_0x1f40('0x1d')&&typeof _0x5c4412[_0x1f40('0x1e')]==='undefined';var _0x192785=_0xb1317d[_0x1f40('0x1f')];var _0x1a21c0=_0x218b9e?0x0:_0x5c4412[_0x1f40('0x20')];var _0x1bb1ec=_0x218b9e?_0xb1317d[_0x1f40('0x1f')]:_0x5c4412[_0x1f40('0x20')]+_0x5c4412[_0x1f40('0x1e')];var _0x209bee;if(_0x1bb1ec>=_0x192785){_0x1bb1ec=_0x192785;_0x209bee=0xc8;}else{_0x209bee=0xce;}_0x4a67bb[_0x1f40('0x1a')](_0x209bee);return _0x4a67bb[_0x1f40('0x21')](_0x1f40('0x22'),_0x1a21c0+'-'+_0x1bb1ec+'/'+_0x192785)['json'](_0xb1317d);}return null;};}function patchUpdates(_0x5cb384){return function(_0x3c4137){try{jsonpatch[_0x1f40('0x23')](_0x3c4137,_0x5cb384,!![]);}catch(_0x32fefe){return BPromise['reject'](_0x32fefe);}return _0x3c4137[_0x1f40('0x24')]();};}function saveUpdates(_0x53e50c,_0x397c19){return function(_0x194ecb){if(_0x194ecb){return _0x194ecb[_0x1f40('0x25')](_0x53e50c)[_0x1f40('0x26')](function(_0x420399){return _0x420399;});}return null;};}function removeEntity(_0x471021,_0x2a313c){return function(_0x206259){if(_0x206259){return _0x206259['destroy']()[_0x1f40('0x26')](function(){_0x471021[_0x1f40('0x1a')](0xcc)[_0x1f40('0x1b')]();});}};}function handleEntityNotFound(_0x25a583,_0xbbe931){return function(_0x42dcb8){if(!_0x42dcb8){_0x25a583[_0x1f40('0x19')](0x194);}return _0x42dcb8;};}function handleError(_0x4e9fd1,_0x325564){_0x325564=_0x325564||0x1f4;return function(_0x4a3ab1){logger[_0x1f40('0x27')](_0x4a3ab1[_0x1f40('0x28')]);if(_0x4a3ab1[_0x1f40('0x29')]){delete _0x4a3ab1[_0x1f40('0x29')];}_0x4e9fd1['status'](_0x325564)['send'](_0x4a3ab1);};}exports[_0x1f40('0x2a')]=function(_0xe1314a,_0x4e1093){var _0x4eca65={},_0xf8f92b={},_0x2d7e67={'count':0x0,'rows':[]};var _0x351b19=_['map'](db['VtigerAccount'][_0x1f40('0x2b')],function(_0x587e02){return{'name':_0x587e02['fieldName'],'type':_0x587e02[_0x1f40('0x2c')][_0x1f40('0x2d')]};});_0xf8f92b['model']=_['map'](_0x351b19,_0x1f40('0x29'));_0xf8f92b[_0x1f40('0x2e')]=_['keys'](_0xe1314a[_0x1f40('0x2e')]);_0xf8f92b[_0x1f40('0x2f')]=_[_0x1f40('0x30')](_0xf8f92b[_0x1f40('0x31')],_0xf8f92b['query']);_0x4eca65[_0x1f40('0x32')]=_[_0x1f40('0x30')](_0xf8f92b[_0x1f40('0x31')],qs[_0x1f40('0x33')](_0xe1314a[_0x1f40('0x2e')][_0x1f40('0x33')]));_0x4eca65[_0x1f40('0x32')]=_0x4eca65[_0x1f40('0x32')][_0x1f40('0x34')]?_0x4eca65[_0x1f40('0x32')]:_0xf8f92b[_0x1f40('0x31')];if(!_0xe1314a[_0x1f40('0x2e')]['hasOwnProperty'](_0x1f40('0x35'))){_0x4eca65['limit']=qs[_0x1f40('0x1e')](_0xe1314a[_0x1f40('0x2e')][_0x1f40('0x1e')]);_0x4eca65['offset']=qs[_0x1f40('0x20')](_0xe1314a['query'][_0x1f40('0x20')]);}_0x4eca65[_0x1f40('0x36')]=qs[_0x1f40('0x37')](_0xe1314a['query'][_0x1f40('0x37')]);_0x4eca65[_0x1f40('0x38')]=qs[_0x1f40('0x2f')](_[_0x1f40('0x39')](_0xe1314a['query'],_0xf8f92b['filters']),_0x351b19);if(_0xe1314a[_0x1f40('0x2e')][_0x1f40('0x3a')]){_0x4eca65['where']=_['merge'](_0x4eca65[_0x1f40('0x38')],{'$or':_[_0x1f40('0x3b')](_0x351b19,function(_0x3f327a){if(_0x3f327a['type']!==_0x1f40('0x3c')){var _0x1cee6a={};_0x1cee6a[_0x3f327a['name']]={'$like':'%'+_0xe1314a[_0x1f40('0x2e')][_0x1f40('0x3a')]+'%'};return _0x1cee6a;}})});}_0x4eca65=_[_0x1f40('0x3d')]({},_0x4eca65,_0xe1314a[_0x1f40('0x3e')]);var _0x4f3b29={'where':_0x4eca65[_0x1f40('0x38')]};return db[_0x1f40('0x3f')][_0x1f40('0x1f')](_0x4f3b29)['then'](function(_0x3e40f2){_0x2d7e67[_0x1f40('0x1f')]=_0x3e40f2;if(_0xe1314a[_0x1f40('0x2e')][_0x1f40('0x40')]){_0x4eca65[_0x1f40('0x41')]=[{'all':!![]}];}return db[_0x1f40('0x3f')]['findAll'](_0x4eca65);})[_0x1f40('0x26')](function(_0x3215d0){_0x2d7e67[_0x1f40('0x42')]=_0x3215d0;return _0x2d7e67;})[_0x1f40('0x26')](respondWithFilteredResult(_0x4e1093,_0x4eca65))[_0x1f40('0x43')](handleError(_0x4e1093,null));};exports['show']=function(_0x19f3f7,_0x193f12){var _0x522b7b={'raw':![],'where':{'id':_0x19f3f7[_0x1f40('0x44')]['id']}},_0x4f2081={};_0x4f2081[_0x1f40('0x31')]=_['keys'](db[_0x1f40('0x3f')][_0x1f40('0x2b')]);_0x4f2081[_0x1f40('0x2e')]=_['keys'](_0x19f3f7[_0x1f40('0x2e')]);_0x4f2081[_0x1f40('0x2f')]=_[_0x1f40('0x30')](_0x4f2081[_0x1f40('0x31')],_0x4f2081[_0x1f40('0x2e')]);_0x522b7b['attributes']=_[_0x1f40('0x30')](_0x4f2081[_0x1f40('0x31')],qs[_0x1f40('0x33')](_0x19f3f7[_0x1f40('0x2e')][_0x1f40('0x33')]));_0x522b7b[_0x1f40('0x32')]=_0x522b7b[_0x1f40('0x32')][_0x1f40('0x34')]?_0x522b7b[_0x1f40('0x32')]:_0x4f2081[_0x1f40('0x31')];if(_0x19f3f7['query']['includeAll']){_0x522b7b[_0x1f40('0x41')]=[{'all':!![]}];}_0x522b7b=_['merge']({},_0x522b7b,_0x19f3f7[_0x1f40('0x3e')]);return db[_0x1f40('0x3f')]['find'](_0x522b7b)[_0x1f40('0x26')](handleEntityNotFound(_0x193f12,null))[_0x1f40('0x26')](respondWithResult(_0x193f12,null))[_0x1f40('0x43')](handleError(_0x193f12,null));};exports[_0x1f40('0x45')]=function(_0x1e3437,_0x467789){return db[_0x1f40('0x3f')][_0x1f40('0x45')](_0x1e3437[_0x1f40('0x46')],{})[_0x1f40('0x26')](respondWithResult(_0x467789,0xc9))['catch'](handleError(_0x467789,null));};exports[_0x1f40('0x25')]=function(_0x78c1af,_0x30920c){if(_0x78c1af[_0x1f40('0x46')]['id']){delete _0x78c1af[_0x1f40('0x46')]['id'];}return db[_0x1f40('0x3f')][_0x1f40('0x47')]({'where':{'id':_0x78c1af['params']['id']}})[_0x1f40('0x26')](handleEntityNotFound(_0x30920c,null))[_0x1f40('0x26')](saveUpdates(_0x78c1af[_0x1f40('0x46')],null))['then'](respondWithResult(_0x30920c,null))['catch'](handleError(_0x30920c,null));};exports[_0x1f40('0x48')]=function(_0x499b56,_0x50233e){return db['VtigerAccount']['find']({'where':{'id':_0x499b56[_0x1f40('0x44')]['id']}})['then'](handleEntityNotFound(_0x50233e,null))[_0x1f40('0x26')](removeEntity(_0x50233e,null))[_0x1f40('0x43')](handleError(_0x50233e,null));};exports[_0x1f40('0x49')]=function(_0x4c75ff,_0x419379,_0x4312d9){var _0x272f2f={};var _0x275a43={};var _0x3f2894;var _0x2ce878;return db[_0x1f40('0x3f')]['findOne']({'where':{'id':_0x4c75ff[_0x1f40('0x44')]['id']}})[_0x1f40('0x26')](handleEntityNotFound(_0x419379,null))[_0x1f40('0x26')](function(_0x1829fb){if(_0x1829fb){_0x3f2894=_0x1829fb;_0x275a43['model']=_[_0x1f40('0x4a')](db[_0x1f40('0x4b')][_0x1f40('0x2b')]);_0x275a43[_0x1f40('0x2e')]=_[_0x1f40('0x4a')](_0x4c75ff[_0x1f40('0x2e')]);_0x275a43[_0x1f40('0x2f')]=_['intersection'](_0x275a43[_0x1f40('0x31')],_0x275a43[_0x1f40('0x2e')]);_0x272f2f[_0x1f40('0x32')]=_['intersection'](_0x275a43[_0x1f40('0x31')],qs[_0x1f40('0x33')](_0x4c75ff[_0x1f40('0x2e')][_0x1f40('0x33')]));_0x272f2f[_0x1f40('0x32')]=_0x272f2f[_0x1f40('0x32')][_0x1f40('0x34')]?_0x272f2f['attributes']:_0x275a43[_0x1f40('0x31')];_0x272f2f[_0x1f40('0x36')]=qs[_0x1f40('0x37')](_0x4c75ff[_0x1f40('0x2e')]['sort']);_0x272f2f[_0x1f40('0x38')]=qs[_0x1f40('0x2f')](_[_0x1f40('0x39')](_0x4c75ff[_0x1f40('0x2e')],_0x275a43[_0x1f40('0x2f')]));if(_0x4c75ff[_0x1f40('0x2e')][_0x1f40('0x3a')]){_0x272f2f[_0x1f40('0x38')]=_[_0x1f40('0x3d')](_0x272f2f[_0x1f40('0x38')],{'$or':_[_0x1f40('0x3b')](_0x272f2f[_0x1f40('0x32')],function(_0x591776){var _0x3c647f={};_0x3c647f[_0x591776]={'$like':'%'+_0x4c75ff['query'][_0x1f40('0x3a')]+'%'};return _0x3c647f;})});}_0x272f2f=_['merge']({},_0x272f2f,_0x4c75ff['options']);return _0x3f2894[_0x1f40('0x49')](_0x272f2f);}})['then'](function(_0x5ea9ff){if(_0x5ea9ff){_0x2ce878=_0x5ea9ff[_0x1f40('0x34')];if(!_0x4c75ff['query'][_0x1f40('0x4c')](_0x1f40('0x35'))){_0x272f2f[_0x1f40('0x1e')]=qs[_0x1f40('0x1e')](_0x4c75ff[_0x1f40('0x2e')][_0x1f40('0x1e')]);_0x272f2f[_0x1f40('0x20')]=qs[_0x1f40('0x20')](_0x4c75ff['query'][_0x1f40('0x20')]);}return _0x3f2894['getConfigurations'](_0x272f2f);}})[_0x1f40('0x26')](function(_0x10b831){if(_0x10b831){return _0x10b831?{'count':_0x2ce878,'rows':_0x10b831}:null;}})[_0x1f40('0x26')](respondWithResult(_0x419379,null))[_0x1f40('0x43')](handleError(_0x419379,null));};exports['addConfiguration']=function(_0x362844,_0x2821b2,_0x4b68fa){if(_0x362844[_0x1f40('0x46')]['id']){delete _0x362844[_0x1f40('0x46')]['id'];}return db[_0x1f40('0x3f')][_0x1f40('0x4d')]({'where':{'id':_0x362844['params']['id']}})[_0x1f40('0x26')](handleEntityNotFound(_0x2821b2,null))[_0x1f40('0x26')](function(_0x23519e){if(_0x23519e){_0x362844[_0x1f40('0x46')]['AccountId']=_0x23519e['id'];_0x362844[_0x1f40('0x46')]['Subjects']=integrations[_0x1f40('0x4e')](_0x362844[_0x1f40('0x46')]['channel'],_0x362844['body'][_0x1f40('0x2c')]);_0x362844[_0x1f40('0x46')][_0x1f40('0x4f')]=integrations[_0x1f40('0x50')](_0x362844[_0x1f40('0x46')][_0x1f40('0x51')],_0x362844[_0x1f40('0x46')][_0x1f40('0x2c')]);return db['VtigerConfiguration']['create'](_0x362844[_0x1f40('0x46')],{'include':[{'model':db[_0x1f40('0x52')],'as':_0x1f40('0x53')},{'model':db[_0x1f40('0x52')],'as':_0x1f40('0x4f')}]});}return null;})[_0x1f40('0x26')](respondWithResult(_0x2821b2,null))[_0x1f40('0x43')](handleError(_0x2821b2,null));};var md5=require(_0x1f40('0x54'));exports['getFields']=function(_0x11cd88,_0x182631,_0x50a582){var _0x8f1329=null;var _0x6e7e36=null;var _0x5b95ec=null;var _0x45c39e=null;var _0x46033e='';return db[_0x1f40('0x3f')][_0x1f40('0x4d')]({'where':{'id':_0x11cd88[_0x1f40('0x44')]['id']},'attributes':['id','name',_0x1f40('0x55'),_0x1f40('0x56'),_0x1f40('0x57'),_0x1f40('0x58'),'serverUrl',_0x1f40('0x59')]})[_0x1f40('0x26')](handleEntityNotFound(_0x182631,null))[_0x1f40('0x26')](function(_0x243a99){if(_0x243a99){_0x8f1329=_0x243a99[_0x1f40('0x55')];_0x6e7e36=_0x243a99['accessKey'];_0x5b95ec=_0x243a99['moduleName'];_0x46033e=_0x243a99[_0x1f40('0x58')];var _0x247d1b=_0x46033e[_0x1f40('0x5a')](-0x1);if(_0x247d1b==='/'){_0x46033e=_0x46033e[_0x1f40('0x5b')](0x0,_0x46033e['lastIndexOf'](_0x247d1b));}_0x45c39e=util[_0x1f40('0x5c')](_0x1f40('0x5d'),_0x46033e);var _0xf7c024={'method':_0x1f40('0x5e'),'uri':_0x45c39e,'qs':{'operation':'getchallenge','username':_0x243a99[_0x1f40('0x55')]},'json':!![]};return rp(_0xf7c024);}})[_0x1f40('0x26')](function(_0x5ddbe6){if(_0x5ddbe6[_0x1f40('0x5f')]){var _0x743374={'method':_0x1f40('0x60'),'uri':_0x45c39e,'form':{'operation':_0x1f40('0x61'),'username':_0x8f1329,'accessKey':md5(_0x5ddbe6['result'][_0x1f40('0x62')]+_0x6e7e36)},'json':!![]};return rp(_0x743374);}})[_0x1f40('0x26')](function(_0x2b9c26){if(_0x2b9c26[_0x1f40('0x5f')]){var _0x17d351={'method':_0x1f40('0x5e'),'uri':_0x45c39e,'qs':{'operation':_0x1f40('0x63'),'username':_0x8f1329,'sessionName':_0x2b9c26[_0x1f40('0x64')]['sessionName'],'elementType':_0x5b95ec},'json':!![]};return rp(_0x17d351);}})[_0x1f40('0x26')](function(_0x3aa1af){if(_0x3aa1af[_0x1f40('0x5f')]){var _0x5ed08a=[_0x1f40('0x65'),_0x1f40('0x66'),_0x1f40('0x67')];_[_0x1f40('0x68')](_0x3aa1af[_0x1f40('0x64')]['fields'],function(_0x3378f7){return _0x5ed08a[_0x1f40('0x69')](_0x3378f7[_0x1f40('0x2c')]['name']);});_[_0x1f40('0x68')](_0x3aa1af[_0x1f40('0x64')][_0x1f40('0x33')],function(_0x15da87){return _0x15da87[_0x1f40('0x6a')]===_0x1f40('0x6b');});return{'count':_0x3aa1af['result'][_0x1f40('0x33')][_0x1f40('0x34')],'rows':_[_0x1f40('0x3b')](_0x3aa1af['result'][_0x1f40('0x33')],function(_0x10233d){return{'id':_0x10233d[_0x1f40('0x29')],'name':_0x10233d[_0x1f40('0x6c')],'custom':_[_0x1f40('0x6d')](_0x10233d['name'],_0x1f40('0x6e'))?!![]:![],'options':_0x10233d[_0x1f40('0x2c')]['name']===_0x1f40('0x6f')&&_0x10233d[_0x1f40('0x2c')][_0x1f40('0x70')][_0x1f40('0x34')]>0x0?_['map'](_0x10233d[_0x1f40('0x2c')][_0x1f40('0x70')],function(_0x50fc0){return{'name':_0x50fc0[_0x1f40('0x6c')],'value':_0x50fc0[_0x1f40('0x71')]};}):[]};})};}})[_0x1f40('0x26')](respondWithResult(_0x182631,null))['catch'](function(_0x323944){console[_0x1f40('0x72')](_0x1f40('0x73')+_0x323944);var _0x250995=_0x11cd88[_0x1f40('0x2e')][_0x1f40('0x74')]?0x1f4:_0x323944['statusCode']||0x1f4;logger[_0x1f40('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x1f40('0x75'),_0x250995,JSON['stringify'](_0x323944));delete _0x323944[_0x1f40('0x29')];if(_0x250995===0x191){_0x250995=0x190;}_0x182631[_0x1f40('0x1a')](_0x250995)['send'](_0x11cd88[_0x1f40('0x2e')]['test']?{'message':_0x1f40('0x76'),'statusCode':_0x323944[_0x1f40('0x77')]}:_0x323944);});}; \ No newline at end of file +var _0x91b1=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','VtigerAccount','includeAll','include','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','moduleName','remoteUri','serverUrl','username','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x52b054,_0x11c4c4){var _0x1b75f1=function(_0x245a7a){while(--_0x245a7a){_0x52b054['push'](_0x52b054['shift']());}};_0x1b75f1(++_0x11c4c4);}(_0x91b1,0xee));var _0x191b=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x91b1[_0x479509];return _0x382da8;};'use strict';var emlformat=require(_0x191b('0x0'));var rimraf=require(_0x191b('0x1'));var zipdir=require(_0x191b('0x2'));var jsonpatch=require(_0x191b('0x3'));var rp=require(_0x191b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x191b('0x5'));var util=require('util');var path=require(_0x191b('0x6'));var sox=require(_0x191b('0x7'));var csv=require(_0x191b('0x8'));var ejs=require(_0x191b('0x9'));var fs=require('fs');var fs_extra=require(_0x191b('0xa'));var _=require(_0x191b('0xb'));var squel=require('squel');var crypto=require(_0x191b('0xc'));var jsforce=require(_0x191b('0xd'));var deskjs=require(_0x191b('0xe'));var toCsv=require(_0x191b('0x8'));var querystring=require(_0x191b('0xf'));var Papa=require(_0x191b('0x10'));var Redis=require(_0x191b('0x11'));var authService=require(_0x191b('0x12'));var qs=require(_0x191b('0x13'));var as=require(_0x191b('0x14'));var hardwareService=require(_0x191b('0x15'));var logger=require(_0x191b('0x16'))(_0x191b('0x17'));var utils=require('../../config/utils');var config=require(_0x191b('0x18'));var licenseUtil=require(_0x191b('0x19'));var db=require(_0x191b('0x1a'))['db'];var integrations=require(_0x191b('0x1b'));function respondWithStatusCode(_0x2d77d4,_0x4d73ec){_0x4d73ec=_0x4d73ec||0xcc;return function(_0x2cb576){if(_0x2cb576){return _0x2d77d4[_0x191b('0x1c')](_0x4d73ec);}return _0x2d77d4[_0x191b('0x1d')](_0x4d73ec)['end']();};}function respondWithResult(_0x310a75,_0x62a624){_0x62a624=_0x62a624||0xc8;return function(_0x5418c4){if(_0x5418c4){return _0x310a75['status'](_0x62a624)[_0x191b('0x1e')](_0x5418c4);}};}function respondWithFilteredResult(_0x4851cf,_0x3c77ff){return function(_0x1adabb){if(_0x1adabb){var _0x174d79=typeof _0x3c77ff[_0x191b('0x1f')]==='undefined'&&typeof _0x3c77ff[_0x191b('0x20')]===_0x191b('0x21');var _0x5b6ec8=_0x1adabb['count'];var _0xb6323d=_0x174d79?0x0:_0x3c77ff[_0x191b('0x1f')];var _0x335ee0=_0x174d79?_0x1adabb[_0x191b('0x22')]:_0x3c77ff[_0x191b('0x1f')]+_0x3c77ff[_0x191b('0x20')];var _0x324992;if(_0x335ee0>=_0x5b6ec8){_0x335ee0=_0x5b6ec8;_0x324992=0xc8;}else{_0x324992=0xce;}_0x4851cf[_0x191b('0x1d')](_0x324992);return _0x4851cf[_0x191b('0x23')](_0x191b('0x24'),_0xb6323d+'-'+_0x335ee0+'/'+_0x5b6ec8)[_0x191b('0x1e')](_0x1adabb);}return null;};}function patchUpdates(_0x4e8a3a){return function(_0x10bbb8){try{jsonpatch[_0x191b('0x25')](_0x10bbb8,_0x4e8a3a,!![]);}catch(_0xdab17b){return BPromise[_0x191b('0x26')](_0xdab17b);}return _0x10bbb8[_0x191b('0x27')]();};}function saveUpdates(_0xef88d3,_0x40896e){return function(_0x58da09){if(_0x58da09){return _0x58da09[_0x191b('0x28')](_0xef88d3)[_0x191b('0x29')](function(_0x2d0c05){return _0x2d0c05;});}return null;};}function removeEntity(_0x1ed1a7,_0x16a7a7){return function(_0x19bb74){if(_0x19bb74){return _0x19bb74[_0x191b('0x2a')]()[_0x191b('0x29')](function(){_0x1ed1a7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f66e2,_0xf0ec9){return function(_0x7f5781){if(!_0x7f5781){_0x3f66e2['sendStatus'](0x194);}return _0x7f5781;};}function handleError(_0x5d7eae,_0x496d0b){_0x496d0b=_0x496d0b||0x1f4;return function(_0x31c48f){logger[_0x191b('0x2b')](_0x31c48f[_0x191b('0x2c')]);if(_0x31c48f[_0x191b('0x2d')]){delete _0x31c48f['name'];}_0x5d7eae[_0x191b('0x1d')](_0x496d0b)['send'](_0x31c48f);};}exports[_0x191b('0x2e')]=function(_0x463cb4,_0x4f2052){var _0x48b794={},_0x44c3e8={},_0x45455c={'count':0x0,'rows':[]};var _0x3a3146=_[_0x191b('0x2f')](db['VtigerAccount'][_0x191b('0x30')],function(_0x23ace0){return{'name':_0x23ace0[_0x191b('0x31')],'type':_0x23ace0[_0x191b('0x32')][_0x191b('0x33')]};});_0x44c3e8[_0x191b('0x34')]=_[_0x191b('0x2f')](_0x3a3146,_0x191b('0x2d'));_0x44c3e8['query']=_[_0x191b('0x35')](_0x463cb4[_0x191b('0x36')]);_0x44c3e8[_0x191b('0x37')]=_[_0x191b('0x38')](_0x44c3e8[_0x191b('0x34')],_0x44c3e8[_0x191b('0x36')]);_0x48b794[_0x191b('0x39')]=_[_0x191b('0x38')](_0x44c3e8['model'],qs['fields'](_0x463cb4[_0x191b('0x36')][_0x191b('0x3a')]));_0x48b794['attributes']=_0x48b794[_0x191b('0x39')]['length']?_0x48b794[_0x191b('0x39')]:_0x44c3e8['model'];if(!_0x463cb4[_0x191b('0x36')][_0x191b('0x3b')]('nolimit')){_0x48b794[_0x191b('0x20')]=qs[_0x191b('0x20')](_0x463cb4[_0x191b('0x36')][_0x191b('0x20')]);_0x48b794[_0x191b('0x1f')]=qs[_0x191b('0x1f')](_0x463cb4[_0x191b('0x36')][_0x191b('0x1f')]);}_0x48b794[_0x191b('0x3c')]=qs[_0x191b('0x3d')](_0x463cb4['query']['sort']);_0x48b794[_0x191b('0x3e')]=qs[_0x191b('0x37')](_[_0x191b('0x3f')](_0x463cb4[_0x191b('0x36')],_0x44c3e8[_0x191b('0x37')]),_0x3a3146);if(_0x463cb4['query'][_0x191b('0x40')]){_0x48b794[_0x191b('0x3e')]=_['merge'](_0x48b794[_0x191b('0x3e')],{'$or':_[_0x191b('0x2f')](_0x3a3146,function(_0x48d270){if(_0x48d270[_0x191b('0x32')]!==_0x191b('0x41')){var _0x42930a={};_0x42930a[_0x48d270[_0x191b('0x2d')]]={'$like':'%'+_0x463cb4[_0x191b('0x36')][_0x191b('0x40')]+'%'};return _0x42930a;}})});}_0x48b794=_[_0x191b('0x42')]({},_0x48b794,_0x463cb4[_0x191b('0x43')]);var _0x5a27d2={'where':_0x48b794[_0x191b('0x3e')]};return db[_0x191b('0x44')][_0x191b('0x22')](_0x5a27d2)['then'](function(_0x260d47){_0x45455c[_0x191b('0x22')]=_0x260d47;if(_0x463cb4[_0x191b('0x36')][_0x191b('0x45')]){_0x48b794[_0x191b('0x46')]=[{'all':!![]}];}return db[_0x191b('0x44')]['findAll'](_0x48b794);})[_0x191b('0x29')](function(_0x28dc65){_0x45455c[_0x191b('0x47')]=_0x28dc65;return _0x45455c;})[_0x191b('0x29')](respondWithFilteredResult(_0x4f2052,_0x48b794))[_0x191b('0x48')](handleError(_0x4f2052,null));};exports[_0x191b('0x49')]=function(_0x1b5b71,_0x1c78fa){var _0x217b9a={'raw':![],'where':{'id':_0x1b5b71[_0x191b('0x4a')]['id']}},_0x219be5={};_0x219be5[_0x191b('0x34')]=_[_0x191b('0x35')](db[_0x191b('0x44')][_0x191b('0x30')]);_0x219be5[_0x191b('0x36')]=_[_0x191b('0x35')](_0x1b5b71['query']);_0x219be5['filters']=_[_0x191b('0x38')](_0x219be5[_0x191b('0x34')],_0x219be5[_0x191b('0x36')]);_0x217b9a[_0x191b('0x39')]=_[_0x191b('0x38')](_0x219be5[_0x191b('0x34')],qs[_0x191b('0x3a')](_0x1b5b71[_0x191b('0x36')]['fields']));_0x217b9a['attributes']=_0x217b9a['attributes'][_0x191b('0x4b')]?_0x217b9a['attributes']:_0x219be5[_0x191b('0x34')];if(_0x1b5b71['query']['includeAll']){_0x217b9a[_0x191b('0x46')]=[{'all':!![]}];}_0x217b9a=_[_0x191b('0x42')]({},_0x217b9a,_0x1b5b71[_0x191b('0x43')]);return db[_0x191b('0x44')][_0x191b('0x4c')](_0x217b9a)[_0x191b('0x29')](handleEntityNotFound(_0x1c78fa,null))[_0x191b('0x29')](respondWithResult(_0x1c78fa,null))[_0x191b('0x48')](handleError(_0x1c78fa,null));};exports[_0x191b('0x4d')]=function(_0x17dcf2,_0x52eaba){return db[_0x191b('0x44')]['create'](_0x17dcf2[_0x191b('0x4e')],{})[_0x191b('0x29')](respondWithResult(_0x52eaba,0xc9))[_0x191b('0x48')](handleError(_0x52eaba,null));};exports[_0x191b('0x28')]=function(_0x2471f1,_0x21f85d){if(_0x2471f1[_0x191b('0x4e')]['id']){delete _0x2471f1['body']['id'];}return db['VtigerAccount'][_0x191b('0x4c')]({'where':{'id':_0x2471f1['params']['id']}})[_0x191b('0x29')](handleEntityNotFound(_0x21f85d,null))[_0x191b('0x29')](saveUpdates(_0x2471f1[_0x191b('0x4e')],null))['then'](respondWithResult(_0x21f85d,null))[_0x191b('0x48')](handleError(_0x21f85d,null));};exports[_0x191b('0x2a')]=function(_0x58dc72,_0x50652b){return db[_0x191b('0x44')][_0x191b('0x4c')]({'where':{'id':_0x58dc72[_0x191b('0x4a')]['id']}})[_0x191b('0x29')](handleEntityNotFound(_0x50652b,null))['then'](removeEntity(_0x50652b,null))['catch'](handleError(_0x50652b,null));};exports[_0x191b('0x4f')]=function(_0x1cef0d,_0x26e477,_0x41302c){var _0x585e7e={};var _0x1945cf={};var _0x15d87b;var _0x1249db;return db[_0x191b('0x44')][_0x191b('0x50')]({'where':{'id':_0x1cef0d[_0x191b('0x4a')]['id']}})[_0x191b('0x29')](handleEntityNotFound(_0x26e477,null))[_0x191b('0x29')](function(_0x477462){if(_0x477462){_0x15d87b=_0x477462;_0x1945cf['model']=_[_0x191b('0x35')](db['VtigerConfiguration'][_0x191b('0x30')]);_0x1945cf[_0x191b('0x36')]=_[_0x191b('0x35')](_0x1cef0d['query']);_0x1945cf[_0x191b('0x37')]=_['intersection'](_0x1945cf[_0x191b('0x34')],_0x1945cf[_0x191b('0x36')]);_0x585e7e[_0x191b('0x39')]=_[_0x191b('0x38')](_0x1945cf[_0x191b('0x34')],qs['fields'](_0x1cef0d[_0x191b('0x36')][_0x191b('0x3a')]));_0x585e7e[_0x191b('0x39')]=_0x585e7e[_0x191b('0x39')][_0x191b('0x4b')]?_0x585e7e[_0x191b('0x39')]:_0x1945cf[_0x191b('0x34')];_0x585e7e[_0x191b('0x3c')]=qs[_0x191b('0x3d')](_0x1cef0d[_0x191b('0x36')][_0x191b('0x3d')]);_0x585e7e[_0x191b('0x3e')]=qs[_0x191b('0x37')](_[_0x191b('0x3f')](_0x1cef0d['query'],_0x1945cf[_0x191b('0x37')]));if(_0x1cef0d[_0x191b('0x36')][_0x191b('0x40')]){_0x585e7e[_0x191b('0x3e')]=_[_0x191b('0x42')](_0x585e7e[_0x191b('0x3e')],{'$or':_[_0x191b('0x2f')](_0x585e7e[_0x191b('0x39')],function(_0xc02d25){var _0x148a55={};_0x148a55[_0xc02d25]={'$like':'%'+_0x1cef0d['query'][_0x191b('0x40')]+'%'};return _0x148a55;})});}_0x585e7e=_[_0x191b('0x42')]({},_0x585e7e,_0x1cef0d[_0x191b('0x43')]);return _0x15d87b[_0x191b('0x4f')](_0x585e7e);}})['then'](function(_0x454771){if(_0x454771){_0x1249db=_0x454771[_0x191b('0x4b')];if(!_0x1cef0d[_0x191b('0x36')]['hasOwnProperty'](_0x191b('0x51'))){_0x585e7e['limit']=qs[_0x191b('0x20')](_0x1cef0d[_0x191b('0x36')][_0x191b('0x20')]);_0x585e7e['offset']=qs['offset'](_0x1cef0d[_0x191b('0x36')][_0x191b('0x1f')]);}return _0x15d87b[_0x191b('0x4f')](_0x585e7e);}})[_0x191b('0x29')](function(_0x39a32c){if(_0x39a32c){return _0x39a32c?{'count':_0x1249db,'rows':_0x39a32c}:null;}})[_0x191b('0x29')](respondWithResult(_0x26e477,null))[_0x191b('0x48')](handleError(_0x26e477,null));};exports[_0x191b('0x52')]=function(_0x357182,_0x3fc53d,_0x4cf67f){if(_0x357182[_0x191b('0x4e')]['id']){delete _0x357182[_0x191b('0x4e')]['id'];}return db[_0x191b('0x44')]['findOne']({'where':{'id':_0x357182['params']['id']}})[_0x191b('0x29')](handleEntityNotFound(_0x3fc53d,null))[_0x191b('0x29')](function(_0x8e8a15){if(_0x8e8a15){_0x357182[_0x191b('0x4e')][_0x191b('0x53')]=_0x8e8a15['id'];_0x357182['body'][_0x191b('0x54')]=integrations[_0x191b('0x55')](_0x357182[_0x191b('0x4e')][_0x191b('0x56')],_0x357182[_0x191b('0x4e')][_0x191b('0x32')]);_0x357182[_0x191b('0x4e')]['Descriptions']=integrations[_0x191b('0x57')](_0x357182[_0x191b('0x4e')][_0x191b('0x56')],_0x357182[_0x191b('0x4e')][_0x191b('0x32')]);return db['VtigerConfiguration'][_0x191b('0x4d')](_0x357182[_0x191b('0x4e')],{'include':[{'model':db[_0x191b('0x58')],'as':'Subjects'},{'model':db[_0x191b('0x58')],'as':_0x191b('0x59')}]});}return null;})[_0x191b('0x29')](respondWithResult(_0x3fc53d,null))[_0x191b('0x48')](handleError(_0x3fc53d,null));};var md5=require(_0x191b('0x5a'));exports[_0x191b('0x5b')]=function(_0x4049f2,_0x47902,_0x49f217){var _0x29dc1b=null;var _0x5d8969=null;var _0x509c0b=null;var _0x52ebc5=null;var _0x1b6e7b='';return db[_0x191b('0x44')]['findOne']({'where':{'id':_0x4049f2['params']['id']},'attributes':['id',_0x191b('0x2d'),'username','description',_0x191b('0x5c'),_0x191b('0x5d'),_0x191b('0x5e'),'accessKey']})[_0x191b('0x29')](handleEntityNotFound(_0x47902,null))['then'](function(_0xcfd7d3){if(_0xcfd7d3){_0x29dc1b=_0xcfd7d3[_0x191b('0x5f')];_0x5d8969=_0xcfd7d3[_0x191b('0x60')];_0x509c0b=_0xcfd7d3[_0x191b('0x5c')];_0x1b6e7b=_0xcfd7d3[_0x191b('0x5d')];var _0x24092a=_0x1b6e7b[_0x191b('0x61')](-0x1);if(_0x24092a==='/'){_0x1b6e7b=_0x1b6e7b[_0x191b('0x62')](0x0,_0x1b6e7b[_0x191b('0x63')](_0x24092a));}_0x52ebc5=util[_0x191b('0x64')](_0x191b('0x65'),_0x1b6e7b);var _0x34efe6={'method':_0x191b('0x66'),'uri':_0x52ebc5,'qs':{'operation':'getchallenge','username':_0xcfd7d3[_0x191b('0x5f')]},'json':!![]};return rp(_0x34efe6);}})[_0x191b('0x29')](function(_0x94b403){if(_0x94b403[_0x191b('0x67')]){var _0x5d4223={'method':_0x191b('0x68'),'uri':_0x52ebc5,'form':{'operation':_0x191b('0x69'),'username':_0x29dc1b,'accessKey':md5(_0x94b403[_0x191b('0x6a')][_0x191b('0x6b')]+_0x5d8969)},'json':!![]};return rp(_0x5d4223);}})[_0x191b('0x29')](function(_0x261191){if(_0x261191[_0x191b('0x67')]){var _0x1b8b24={'method':_0x191b('0x66'),'uri':_0x52ebc5,'qs':{'operation':'describe','username':_0x29dc1b,'sessionName':_0x261191[_0x191b('0x6a')][_0x191b('0x6c')],'elementType':_0x509c0b},'json':!![]};return rp(_0x1b8b24);}})[_0x191b('0x29')](function(_0xf33916){if(_0xf33916[_0x191b('0x67')]){var _0x3f7ffa=[_0x191b('0x6d'),_0x191b('0x6e'),_0x191b('0x6f')];_[_0x191b('0x70')](_0xf33916['result'][_0x191b('0x3a')],function(_0x442360){return _0x3f7ffa[_0x191b('0x71')](_0x442360[_0x191b('0x32')][_0x191b('0x2d')]);});_['remove'](_0xf33916[_0x191b('0x6a')][_0x191b('0x3a')],function(_0x1be69a){return _0x1be69a[_0x191b('0x72')]===_0x191b('0x73');});return{'count':_0xf33916[_0x191b('0x6a')][_0x191b('0x3a')][_0x191b('0x4b')],'rows':_[_0x191b('0x2f')](_0xf33916['result']['fields'],function(_0x3c70eb){return{'id':_0x3c70eb[_0x191b('0x2d')],'name':_0x3c70eb[_0x191b('0x74')],'custom':_['startsWith'](_0x3c70eb['name'],'cf_')?!![]:![],'options':_0x3c70eb[_0x191b('0x32')]['name']===_0x191b('0x75')&&_0x3c70eb[_0x191b('0x32')]['picklistValues']['length']>0x0?_['map'](_0x3c70eb[_0x191b('0x32')][_0x191b('0x76')],function(_0x577166){return{'name':_0x577166[_0x191b('0x74')],'value':_0x577166[_0x191b('0x77')]};}):[]};})};}})[_0x191b('0x29')](respondWithResult(_0x47902,null))[_0x191b('0x48')](function(_0x59dfbe){console[_0x191b('0x78')](_0x191b('0x79')+_0x59dfbe);var _0x278212=_0x4049f2[_0x191b('0x36')][_0x191b('0x7a')]?0x1f4:_0x59dfbe[_0x191b('0x7b')]||0x1f4;logger[_0x191b('0x2b')](_0x191b('0x7c'),_0x191b('0x5b'),_0x278212,JSON[_0x191b('0x7d')](_0x59dfbe));delete _0x59dfbe['name'];if(_0x278212===0x191){_0x278212=0x190;}_0x47902[_0x191b('0x1d')](_0x278212)[_0x191b('0x7e')](_0x4049f2['query'][_0x191b('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x59dfbe[_0x191b('0x7b')]}:_0x59dfbe);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 36e74c4..2966810 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 _0x60d7=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','int_vtiger_accounts','lodash'];(function(_0x1b7a7e,_0xca7bec){var _0x39f594=function(_0x29c658){while(--_0x29c658){_0x1b7a7e['push'](_0x1b7a7e['shift']());}};_0x39f594(++_0xca7bec);}(_0x60d7,0xe9));var _0x760d=function(_0x42052e,_0x4a3189){_0x42052e=_0x42052e-0x0;var _0x2ad1ca=_0x60d7[_0x42052e];return _0x2ad1ca;};'use strict';var _=require(_0x760d('0x0'));var util=require(_0x760d('0x1'));var logger=require('../../config/logger')(_0x760d('0x2'));var moment=require(_0x760d('0x3'));var BPromise=require(_0x760d('0x4'));var rp=require(_0x760d('0x5'));var fs=require('fs');var path=require(_0x760d('0x6'));var rimraf=require(_0x760d('0x7'));var config=require(_0x760d('0x8'));var attributes=require(_0x760d('0x9'));var integrations=require(_0x760d('0xa'));module[_0x760d('0xb')]=function(_0x1b6239,_0x8f8dba){return _0x1b6239['define']('VtigerAccount',attributes,{'tableName':_0x760d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6d1=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa6d1,0x17c));var _0x1a6d=function(_0x556477,_0x1b7214){_0x556477=_0x556477-0x0;var _0x552276=_0xa6d1[_0x556477];return _0x552276;};'use strict';var _=require(_0x1a6d('0x0'));var util=require(_0x1a6d('0x1'));var logger=require(_0x1a6d('0x2'))(_0x1a6d('0x3'));var moment=require('moment');var BPromise=require(_0x1a6d('0x4'));var rp=require(_0x1a6d('0x5'));var fs=require('fs');var path=require(_0x1a6d('0x6'));var rimraf=require(_0x1a6d('0x7'));var config=require(_0x1a6d('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x1a6d('0x9'));module[_0x1a6d('0xa')]=function(_0x501c91,_0x397736){return _0x501c91['define']('VtigerAccount',attributes,{'tableName':_0x1a6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 4c404dd..160958c 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 _0x34b7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','map','include','model','then','ShowVtigerAccount','find','moment','bluebird'];(function(_0x2715a9,_0x14247e){var _0x224ef6=function(_0x284c0e){while(--_0x284c0e){_0x2715a9['push'](_0x2715a9['shift']());}};_0x224ef6(++_0x14247e);}(_0x34b7,0x196));var _0x734b=function(_0xaeff8a,_0x506724){_0xaeff8a=_0xaeff8a-0x0;var _0x8a6ce3=_0x34b7[_0xaeff8a];return _0x8a6ce3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')]({'raw':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'limit':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['limit']||null:null,'include':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['include']?_[_0x734b('0x1c')](_0x5edbe9[_0x734b('0x18')][_0x734b('0x1d')],function(_0x11fb8e){return{'model':db[_0x11fb8e[_0x734b('0x1e')]],'as':_0x11fb8e['as'],'attributes':_0x11fb8e[_0x734b('0x1b')],'include':_0x11fb8e[_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x11fb8e[_0x734b('0x1d')],function(_0x3abbe6){return{'model':db[_0x3abbe6[_0x734b('0x1e')]],'as':_0x3abbe6['as'],'attributes':_0x3abbe6[_0x734b('0x1b')],'include':_0x3abbe6[_0x734b('0x1d')]?_['map'](_0x3abbe6['include'],function(_0x13cc5a){return{'model':db[_0x13cc5a[_0x734b('0x1e')]],'as':_0x13cc5a['as'],'attributes':_0x13cc5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x734b('0x1f')](function(_0x2dd51a){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x2dd51a));_0x56a95c(_0x2dd51a);})['catch'](function(_0x1f3652){logger[_0x734b('0xf')](_0x734b('0x15'),_0x1f3652[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1f3652[_0x734b('0x12')]));});});};exports[_0x734b('0x20')]=function(_0x21ed3c){var _0x371ead=this;return new Promise(function(_0x3065b0,_0x5dcabf){return db[_0x734b('0x16')][_0x734b('0x21')]({'raw':_0x21ed3c['options']?_0x21ed3c[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'include':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')],function(_0x4512fc){return{'model':db[_0x4512fc['model']],'as':_0x4512fc['as'],'attributes':_0x4512fc[_0x734b('0x1b')],'include':_0x4512fc['include']?_[_0x734b('0x1c')](_0x4512fc[_0x734b('0x1d')],function(_0x3413bf){return{'model':db[_0x3413bf[_0x734b('0x1e')]],'as':_0x3413bf['as'],'attributes':_0x3413bf[_0x734b('0x1b')],'include':_0x3413bf[_0x734b('0x1d')]?_['map'](_0x3413bf['include'],function(_0x3460a0){return{'model':db[_0x3460a0['model']],'as':_0x3460a0['as'],'attributes':_0x3460a0[_0x734b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de959){logger['info'](_0x734b('0x20'),_0x21ed3c);logger['debug'](_0x734b('0x20'),_0x21ed3c,JSON[_0x734b('0xe')](_0x2de959));_0x3065b0(_0x2de959);})[_0x734b('0x14')](function(_0x34a504){logger[_0x734b('0xf')](_0x734b('0x20'),_0x34a504[_0x734b('0x12')],_0x21ed3c);_0x5dcabf(_0x371ead['error'](0x1f4,_0x34a504[_0x734b('0x12')]));});});}; \ No newline at end of file +var _0xb574=['where','attributes','include','map','model','ShowVtigerAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw'];(function(_0x447f6d,_0x36fc29){var _0x56a9b8=function(_0x16444e){while(--_0x16444e){_0x447f6d['push'](_0x447f6d['shift']());}};_0x56a9b8(++_0x36fc29);}(_0xb574,0x106));var _0x4b57=function(_0x28614f,_0x40add1){_0x28614f=_0x28614f-0x0;var _0x1ef791=_0xb574[_0x28614f];return _0x1ef791;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a4a0f,_0x585d86,_0x4b2d65){return new BPromise(function(_0x548ee8,_0x291e54){return client[_0x4b57('0xa')](_0x4a4a0f,_0x4b2d65)[_0x4b57('0xb')](function(_0x3b112d){logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,_0x4b57('0xe'));logger[_0x4b57('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x585d86,_0x4b57('0xe'),JSON[_0x4b57('0x10')](_0x3b112d));if(_0x3b112d[_0x4b57('0x11')]){if(_0x3b112d['error']['code']===0x1f4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);return _0x291e54(_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);}logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')]['message']);return _0x548ee8(_0x3b112d['error'][_0x4b57('0x12')]);}else{logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,'request\x20sent');_0x548ee8(_0x3b112d[_0x4b57('0x13')]['message']);}})[_0x4b57('0x14')](function(_0x42aff4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x42aff4);_0x291e54(_0x42aff4);});});}exports[_0x4b57('0x15')]=function(_0xfb71cc){var _0x4ede42=this;return new Promise(function(_0x1b35ff,_0x1a0b72){return db[_0x4b57('0x16')][_0x4b57('0x17')]({'raw':_0xfb71cc['options']?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![],'where':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x1a')]||null:null,'attributes':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc['options'][_0x4b57('0x1b')]||null:null,'limit':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')]['limit']||null:null,'include':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0xfb71cc['options'][_0x4b57('0x1c')],function(_0x368c5f){return{'model':db[_0x368c5f['model']],'as':_0x368c5f['as'],'attributes':_0x368c5f[_0x4b57('0x1b')],'include':_0x368c5f[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x368c5f[_0x4b57('0x1c')],function(_0x540eff){return{'model':db[_0x540eff[_0x4b57('0x1e')]],'as':_0x540eff['as'],'attributes':_0x540eff['attributes'],'include':_0x540eff[_0x4b57('0x1c')]?_['map'](_0x540eff[_0x4b57('0x1c')],function(_0x2dc9d8){return{'model':db[_0x2dc9d8[_0x4b57('0x1e')]],'as':_0x2dc9d8['as'],'attributes':_0x2dc9d8[_0x4b57('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4b57('0xb')](function(_0x392e37){logger['info']('GetVtigerAccount',_0xfb71cc);logger[_0x4b57('0xf')]('GetVtigerAccount',_0xfb71cc,JSON[_0x4b57('0x10')](_0x392e37));_0x1b35ff(_0x392e37);})[_0x4b57('0x14')](function(_0x874cf7){logger[_0x4b57('0x11')](_0x4b57('0x15'),_0x874cf7[_0x4b57('0x12')],_0xfb71cc);_0x1a0b72(_0x4ede42['error'](0x1f4,_0x874cf7[_0x4b57('0x12')]));});});};exports[_0x4b57('0x1f')]=function(_0x68be27){var _0x3cd331=this;return new Promise(function(_0x4ccf89,_0xa91ba){return db[_0x4b57('0x16')]['find']({'raw':_0x68be27[_0x4b57('0x18')]?_0x68be27[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![],'where':_0x68be27[_0x4b57('0x18')]?_0x68be27['options']['where']||null:null,'attributes':_0x68be27['options']?_0x68be27[_0x4b57('0x18')][_0x4b57('0x1b')]||null:null,'include':_0x68be27[_0x4b57('0x18')]?_0x68be27[_0x4b57('0x18')][_0x4b57('0x1c')]?_['map'](_0x68be27[_0x4b57('0x18')][_0x4b57('0x1c')],function(_0x1fd3f7){return{'model':db[_0x1fd3f7['model']],'as':_0x1fd3f7['as'],'attributes':_0x1fd3f7[_0x4b57('0x1b')],'include':_0x1fd3f7[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x1fd3f7['include'],function(_0x28a0ee){return{'model':db[_0x28a0ee[_0x4b57('0x1e')]],'as':_0x28a0ee['as'],'attributes':_0x28a0ee['attributes'],'include':_0x28a0ee[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x28a0ee[_0x4b57('0x1c')],function(_0x91f32e){return{'model':db[_0x91f32e[_0x4b57('0x1e')]],'as':_0x91f32e['as'],'attributes':_0x91f32e[_0x4b57('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9f76){logger[_0x4b57('0xc')](_0x4b57('0x1f'),_0x68be27);logger[_0x4b57('0xf')](_0x4b57('0x1f'),_0x68be27,JSON[_0x4b57('0x10')](_0x1f9f76));_0x4ccf89(_0x1f9f76);})[_0x4b57('0x14')](function(_0x4c5b82){logger['error'](_0x4b57('0x1f'),_0x4c5b82[_0x4b57('0x12')],_0x68be27);_0xa91ba(_0x3cd331[_0x4b57('0x11')](0x1f4,_0x4c5b82['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 0541c9f..a1df50b 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 _0xdba3=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','exports','multer'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xdba3,0x107));var _0x3dba=function(_0x4afb46,_0x99c527){_0x4afb46=_0x4afb46-0x0;var _0x5b5d50=_0xdba3[_0x4afb46];return _0x5b5d50;};'use strict';var multer=require(_0x3dba('0x0'));var util=require('util');var path=require(_0x3dba('0x1'));var timeout=require(_0x3dba('0x2'));var express=require(_0x3dba('0x3'));var router=express[_0x3dba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3dba('0x5'));var interaction=require(_0x3dba('0x6'));var config=require(_0x3dba('0x7'));var controller=require(_0x3dba('0x8'));router[_0x3dba('0x9')]('/',auth[_0x3dba('0xa')](),controller[_0x3dba('0xb')]);router[_0x3dba('0x9')](_0x3dba('0xc'),auth[_0x3dba('0xa')](),controller[_0x3dba('0xd')]);router[_0x3dba('0x9')](_0x3dba('0xe'),auth['isAuthenticated'](),controller[_0x3dba('0xf')]);router['get'](_0x3dba('0x10'),auth['isAuthenticated'](),controller[_0x3dba('0x11')]);router[_0x3dba('0x9')]('/:id/descriptions',auth[_0x3dba('0xa')](),controller[_0x3dba('0x12')]);router[_0x3dba('0x13')]('/',auth[_0x3dba('0xa')](),controller[_0x3dba('0x14')]);router['put'](_0x3dba('0xc'),auth[_0x3dba('0xa')](),controller[_0x3dba('0x15')]);router[_0x3dba('0x16')]('/:id',auth[_0x3dba('0xa')](),controller['destroy']);module[_0x3dba('0x17')]=router; \ No newline at end of file +var _0xb88f=['./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x43126d,_0x2139d4){var _0x15b8d0=function(_0x38d459){while(--_0x38d459){_0x43126d['push'](_0x43126d['shift']());}};_0x15b8d0(++_0x2139d4);}(_0xb88f,0xe8));var _0xfb88=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xb88f[_0x22c684];return _0x39fcbb;};'use strict';var multer=require(_0xfb88('0x0'));var util=require(_0xfb88('0x1'));var path=require(_0xfb88('0x2'));var timeout=require(_0xfb88('0x3'));var express=require('express');var router=express[_0xfb88('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfb88('0x5'));var interaction=require(_0xfb88('0x6'));var config=require(_0xfb88('0x7'));var controller=require(_0xfb88('0x8'));router[_0xfb88('0x9')]('/',auth[_0xfb88('0xa')](),controller['index']);router['get'](_0xfb88('0xb'),auth[_0xfb88('0xa')](),controller[_0xfb88('0xc')]);router['get'](_0xfb88('0xd'),auth[_0xfb88('0xa')](),controller[_0xfb88('0xe')]);router['get'](_0xfb88('0xf'),auth['isAuthenticated'](),controller[_0xfb88('0x10')]);router[_0xfb88('0x9')](_0xfb88('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xfb88('0x12')]('/',auth['isAuthenticated'](),controller[_0xfb88('0x13')]);router[_0xfb88('0x14')](_0xfb88('0xb'),auth[_0xfb88('0xa')](),controller[_0xfb88('0x15')]);router['delete']('/:id',auth[_0xfb88('0xa')](),controller[_0xfb88('0x16')]);module[_0xfb88('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index e470c68..4684650 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 _0x8fd8=['exports','STRING'];(function(_0x194631,_0x425021){var _0x15c0c3=function(_0x51642d){while(--_0x51642d){_0x194631['push'](_0x194631['shift']());}};_0x15c0c3(++_0x425021);}(_0x8fd8,0x130));var _0x88fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8fd8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x88fd('0x0')]={'name':{'type':Sequelize[_0x88fd('0x1')]},'description':{'type':Sequelize[_0x88fd('0x1')]}}; \ No newline at end of file +var _0xc01f=['exports','STRING'];(function(_0x3c14dc,_0x2a1e9b){var _0x16fb4a=function(_0x52fed1){while(--_0x52fed1){_0x3c14dc['push'](_0x3c14dc['shift']());}};_0x16fb4a(++_0x2a1e9b);}(_0xc01f,0x17e));var _0xfc01=function(_0x3863d5,_0x5c65ff){_0x3863d5=_0x3863d5-0x0;var _0x4cd9a5=_0xc01f[_0x3863d5];return _0x4cd9a5;};'use strict';var Sequelize=require('sequelize');module[_0xfc01('0x0')]={'name':{'type':Sequelize[_0xfc01('0x1')]},'description':{'type':Sequelize[_0xfc01('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 7793a03..99bac40 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 _0x7e9b=['getSubjects','nolimit','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','VtigerConfiguration','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','filter','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','getFields','findOne','VtigerField'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7e9b,0x18e));var _0xb7e9=function(_0x2143b2,_0x1e5dfb){_0x2143b2=_0x2143b2-0x0;var _0x28e265=_0x7e9b[_0x2143b2];return _0x28e265;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb7e9('0x0'));var zipdir=require(_0xb7e9('0x1'));var jsonpatch=require(_0xb7e9('0x2'));var rp=require(_0xb7e9('0x3'));var moment=require('moment');var BPromise=require(_0xb7e9('0x4'));var Mustache=require(_0xb7e9('0x5'));var util=require(_0xb7e9('0x6'));var path=require(_0xb7e9('0x7'));var sox=require(_0xb7e9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb7e9('0x9'));var squel=require('squel');var crypto=require(_0xb7e9('0xa'));var jsforce=require(_0xb7e9('0xb'));var deskjs=require(_0xb7e9('0xc'));var toCsv=require(_0xb7e9('0xd'));var querystring=require(_0xb7e9('0xe'));var Papa=require(_0xb7e9('0xf'));var Redis=require(_0xb7e9('0x10'));var authService=require(_0xb7e9('0x11'));var qs=require(_0xb7e9('0x12'));var as=require(_0xb7e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7e9('0x14'))(_0xb7e9('0x15'));var utils=require(_0xb7e9('0x16'));var config=require(_0xb7e9('0x17'));var licenseUtil=require(_0xb7e9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f1cb1,_0xebd333){_0xebd333=_0xebd333||0xcc;return function(_0x29b26f){if(_0x29b26f){return _0x2f1cb1[_0xb7e9('0x19')](_0xebd333);}return _0x2f1cb1['status'](_0xebd333)[_0xb7e9('0x1a')]();};}function respondWithResult(_0x530836,_0x31d944){_0x31d944=_0x31d944||0xc8;return function(_0x670058){if(_0x670058){return _0x530836[_0xb7e9('0x1b')](_0x31d944)['json'](_0x670058);}};}function respondWithFilteredResult(_0x3b523e,_0x23caa8){return function(_0x32fa98){if(_0x32fa98){var _0x980153=typeof _0x23caa8[_0xb7e9('0x1c')]===_0xb7e9('0x1d')&&typeof _0x23caa8['limit']==='undefined';var _0x671b01=_0x32fa98[_0xb7e9('0x1e')];var _0x629ab1=_0x980153?0x0:_0x23caa8[_0xb7e9('0x1c')];var _0x3324f1=_0x980153?_0x32fa98['count']:_0x23caa8[_0xb7e9('0x1c')]+_0x23caa8[_0xb7e9('0x1f')];var _0x424a91;if(_0x3324f1>=_0x671b01){_0x3324f1=_0x671b01;_0x424a91=0xc8;}else{_0x424a91=0xce;}_0x3b523e['status'](_0x424a91);return _0x3b523e[_0xb7e9('0x20')](_0xb7e9('0x21'),_0x629ab1+'-'+_0x3324f1+'/'+_0x671b01)[_0xb7e9('0x22')](_0x32fa98);}return null;};}function patchUpdates(_0x41caf9){return function(_0x40f3a1){try{jsonpatch['apply'](_0x40f3a1,_0x41caf9,!![]);}catch(_0x516021){return BPromise['reject'](_0x516021);}return _0x40f3a1[_0xb7e9('0x23')]();};}function saveUpdates(_0x283344,_0x31a329){return function(_0x117c26){if(_0x117c26){return _0x117c26[_0xb7e9('0x24')](_0x283344)[_0xb7e9('0x25')](function(_0x2fc1ee){return _0x2fc1ee;});}return null;};}function removeEntity(_0x4910d5,_0x58736c){return function(_0x511d7d){if(_0x511d7d){return _0x511d7d[_0xb7e9('0x26')]()['then'](function(){_0x4910d5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44ffb6,_0x3a0b13){return function(_0x42857b){if(!_0x42857b){_0x44ffb6[_0xb7e9('0x19')](0x194);}return _0x42857b;};}function handleError(_0x394d4f,_0x3ec815){_0x3ec815=_0x3ec815||0x1f4;return function(_0x2f8e43){logger[_0xb7e9('0x27')](_0x2f8e43[_0xb7e9('0x28')]);if(_0x2f8e43[_0xb7e9('0x29')]){delete _0x2f8e43['name'];}_0x394d4f[_0xb7e9('0x1b')](_0x3ec815)[_0xb7e9('0x2a')](_0x2f8e43);};}exports['index']=function(_0x33d050,_0x57e82e){var _0x3fbd0e={},_0x2c0e29={},_0x4720f5={'count':0x0,'rows':[]};var _0x111e8d=_['map'](db[_0xb7e9('0x2b')]['rawAttributes'],function(_0x14fd14){return{'name':_0x14fd14[_0xb7e9('0x2c')],'type':_0x14fd14['type'][_0xb7e9('0x2d')]};});_0x2c0e29[_0xb7e9('0x2e')]=_[_0xb7e9('0x2f')](_0x111e8d,_0xb7e9('0x29'));_0x2c0e29[_0xb7e9('0x30')]=_[_0xb7e9('0x31')](_0x33d050[_0xb7e9('0x30')]);_0x2c0e29[_0xb7e9('0x32')]=_[_0xb7e9('0x33')](_0x2c0e29[_0xb7e9('0x2e')],_0x2c0e29['query']);_0x3fbd0e[_0xb7e9('0x34')]=_[_0xb7e9('0x33')](_0x2c0e29['model'],qs[_0xb7e9('0x35')](_0x33d050[_0xb7e9('0x30')][_0xb7e9('0x35')]));_0x3fbd0e[_0xb7e9('0x34')]=_0x3fbd0e[_0xb7e9('0x34')][_0xb7e9('0x36')]?_0x3fbd0e[_0xb7e9('0x34')]:_0x2c0e29['model'];if(!_0x33d050[_0xb7e9('0x30')][_0xb7e9('0x37')]('nolimit')){_0x3fbd0e['limit']=qs[_0xb7e9('0x1f')](_0x33d050['query'][_0xb7e9('0x1f')]);_0x3fbd0e[_0xb7e9('0x1c')]=qs[_0xb7e9('0x1c')](_0x33d050[_0xb7e9('0x30')][_0xb7e9('0x1c')]);}_0x3fbd0e[_0xb7e9('0x38')]=qs[_0xb7e9('0x39')](_0x33d050[_0xb7e9('0x30')][_0xb7e9('0x39')]);_0x3fbd0e['where']=qs[_0xb7e9('0x32')](_[_0xb7e9('0x3a')](_0x33d050[_0xb7e9('0x30')],_0x2c0e29['filters']),_0x111e8d);if(_0x33d050['query']['filter']){_0x3fbd0e[_0xb7e9('0x3b')]=_[_0xb7e9('0x3c')](_0x3fbd0e[_0xb7e9('0x3b')],{'$or':_['map'](_0x111e8d,function(_0x118536){if(_0x118536['type']!=='VIRTUAL'){var _0x50b46b={};_0x50b46b[_0x118536[_0xb7e9('0x29')]]={'$like':'%'+_0x33d050['query'][_0xb7e9('0x3d')]+'%'};return _0x50b46b;}})});}_0x3fbd0e=_[_0xb7e9('0x3c')]({},_0x3fbd0e,_0x33d050['options']);var _0x25f4df={'where':_0x3fbd0e[_0xb7e9('0x3b')]};return db[_0xb7e9('0x2b')][_0xb7e9('0x1e')](_0x25f4df)[_0xb7e9('0x25')](function(_0x539650){_0x4720f5[_0xb7e9('0x1e')]=_0x539650;if(_0x33d050[_0xb7e9('0x30')][_0xb7e9('0x3e')]){_0x3fbd0e[_0xb7e9('0x3f')]=[{'all':!![]}];}return db[_0xb7e9('0x2b')][_0xb7e9('0x40')](_0x3fbd0e);})[_0xb7e9('0x25')](function(_0x4f0a53){_0x4720f5['rows']=_0x4f0a53;return _0x4720f5;})[_0xb7e9('0x25')](respondWithFilteredResult(_0x57e82e,_0x3fbd0e))[_0xb7e9('0x41')](handleError(_0x57e82e,null));};exports[_0xb7e9('0x42')]=function(_0xa0d268,_0x228e52){var _0x25a932={'raw':![],'where':{'id':_0xa0d268[_0xb7e9('0x43')]['id']}},_0x4a8412={};_0x4a8412['model']=_['keys'](db['VtigerConfiguration'][_0xb7e9('0x44')]);_0x4a8412[_0xb7e9('0x30')]=_['keys'](_0xa0d268['query']);_0x4a8412['filters']=_['intersection'](_0x4a8412[_0xb7e9('0x2e')],_0x4a8412['query']);_0x25a932[_0xb7e9('0x34')]=_[_0xb7e9('0x33')](_0x4a8412[_0xb7e9('0x2e')],qs['fields'](_0xa0d268[_0xb7e9('0x30')][_0xb7e9('0x35')]));_0x25a932[_0xb7e9('0x34')]=_0x25a932[_0xb7e9('0x34')][_0xb7e9('0x36')]?_0x25a932[_0xb7e9('0x34')]:_0x4a8412[_0xb7e9('0x2e')];if(_0xa0d268[_0xb7e9('0x30')][_0xb7e9('0x3e')]){_0x25a932[_0xb7e9('0x3f')]=[{'all':!![]}];}_0x25a932=_[_0xb7e9('0x3c')]({},_0x25a932,_0xa0d268[_0xb7e9('0x45')]);return db[_0xb7e9('0x2b')][_0xb7e9('0x46')](_0x25a932)['then'](handleEntityNotFound(_0x228e52,null))[_0xb7e9('0x25')](respondWithResult(_0x228e52,null))[_0xb7e9('0x41')](handleError(_0x228e52,null));};exports[_0xb7e9('0x47')]=function(_0x3df48c,_0x3a590e){return db[_0xb7e9('0x2b')][_0xb7e9('0x47')](_0x3df48c[_0xb7e9('0x48')],{})['then'](respondWithResult(_0x3a590e,0xc9))[_0xb7e9('0x41')](handleError(_0x3a590e,null));};exports[_0xb7e9('0x24')]=function(_0x3e15fb,_0x4096cc){if(_0x3e15fb[_0xb7e9('0x48')]['id']){delete _0x3e15fb[_0xb7e9('0x48')]['id'];}return db[_0xb7e9('0x2b')]['find']({'where':{'id':_0x3e15fb[_0xb7e9('0x43')]['id']}})[_0xb7e9('0x25')](handleEntityNotFound(_0x4096cc,null))[_0xb7e9('0x25')](saveUpdates(_0x3e15fb['body'],null))['then'](respondWithResult(_0x4096cc,null))[_0xb7e9('0x41')](handleError(_0x4096cc,null));};exports[_0xb7e9('0x26')]=function(_0x5a53b8,_0x1b01e3){return db[_0xb7e9('0x2b')][_0xb7e9('0x46')]({'where':{'id':_0x5a53b8[_0xb7e9('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b01e3,null))[_0xb7e9('0x25')](removeEntity(_0x1b01e3,null))[_0xb7e9('0x41')](handleError(_0x1b01e3,null));};exports[_0xb7e9('0x49')]=function(_0x3d19e5,_0x24b74b,_0x7549da){var _0x30e652={};var _0x5d0e22={};var _0x5e0b82;var _0x389538;return db['VtigerConfiguration'][_0xb7e9('0x4a')]({'where':{'id':_0x3d19e5['params']['id']}})['then'](handleEntityNotFound(_0x24b74b,null))[_0xb7e9('0x25')](function(_0x50eb7f){if(_0x50eb7f){_0x5e0b82=_0x50eb7f;_0x5d0e22[_0xb7e9('0x2e')]=_[_0xb7e9('0x31')](db[_0xb7e9('0x4b')][_0xb7e9('0x44')]);_0x5d0e22['query']=_[_0xb7e9('0x31')](_0x3d19e5[_0xb7e9('0x30')]);_0x5d0e22[_0xb7e9('0x32')]=_[_0xb7e9('0x33')](_0x5d0e22['model'],_0x5d0e22['query']);_0x30e652['attributes']=_[_0xb7e9('0x33')](_0x5d0e22[_0xb7e9('0x2e')],qs[_0xb7e9('0x35')](_0x3d19e5[_0xb7e9('0x30')][_0xb7e9('0x35')]));_0x30e652[_0xb7e9('0x34')]=_0x30e652[_0xb7e9('0x34')][_0xb7e9('0x36')]?_0x30e652['attributes']:_0x5d0e22[_0xb7e9('0x2e')];_0x30e652[_0xb7e9('0x38')]=qs['sort'](_0x3d19e5['query'][_0xb7e9('0x39')]);_0x30e652['where']=qs[_0xb7e9('0x32')](_['pick'](_0x3d19e5[_0xb7e9('0x30')],_0x5d0e22[_0xb7e9('0x32')]));if(_0x3d19e5[_0xb7e9('0x30')][_0xb7e9('0x3d')]){_0x30e652[_0xb7e9('0x3b')]=_[_0xb7e9('0x3c')](_0x30e652[_0xb7e9('0x3b')],{'$or':_[_0xb7e9('0x2f')](_0x30e652['attributes'],function(_0x2cd3ba){var _0x1dc415={};_0x1dc415[_0x2cd3ba]={'$like':'%'+_0x3d19e5[_0xb7e9('0x30')]['filter']+'%'};return _0x1dc415;})});}_0x30e652=_[_0xb7e9('0x3c')]({},_0x30e652,_0x3d19e5[_0xb7e9('0x45')]);return _0x5e0b82['getFields'](_0x30e652);}})['then'](function(_0x406f8d){if(_0x406f8d){_0x389538=_0x406f8d[_0xb7e9('0x36')];if(!_0x3d19e5['query'][_0xb7e9('0x37')]('nolimit')){_0x30e652[_0xb7e9('0x1f')]=qs[_0xb7e9('0x1f')](_0x3d19e5['query'][_0xb7e9('0x1f')]);_0x30e652['offset']=qs[_0xb7e9('0x1c')](_0x3d19e5[_0xb7e9('0x30')]['offset']);}return _0x5e0b82[_0xb7e9('0x49')](_0x30e652);}})[_0xb7e9('0x25')](function(_0xe6af58){if(_0xe6af58){return _0xe6af58?{'count':_0x389538,'rows':_0xe6af58}:null;}})[_0xb7e9('0x25')](respondWithResult(_0x24b74b,null))[_0xb7e9('0x41')](handleError(_0x24b74b,null));};exports['getSubjects']=function(_0x1d1efe,_0x5cac94,_0x46192a){var _0x3b3c95={};var _0x1bdbc0={};var _0x3b499f;var _0x408358;return db[_0xb7e9('0x2b')][_0xb7e9('0x4a')]({'where':{'id':_0x1d1efe[_0xb7e9('0x43')]['id']}})['then'](handleEntityNotFound(_0x5cac94,null))[_0xb7e9('0x25')](function(_0x366277){if(_0x366277){_0x3b499f=_0x366277;_0x1bdbc0[_0xb7e9('0x2e')]=_[_0xb7e9('0x31')](db[_0xb7e9('0x4b')][_0xb7e9('0x44')]);_0x1bdbc0[_0xb7e9('0x30')]=_[_0xb7e9('0x31')](_0x1d1efe['query']);_0x1bdbc0[_0xb7e9('0x32')]=_['intersection'](_0x1bdbc0['model'],_0x1bdbc0[_0xb7e9('0x30')]);_0x3b3c95[_0xb7e9('0x34')]=_[_0xb7e9('0x33')](_0x1bdbc0[_0xb7e9('0x2e')],qs[_0xb7e9('0x35')](_0x1d1efe[_0xb7e9('0x30')]['fields']));_0x3b3c95[_0xb7e9('0x34')]=_0x3b3c95[_0xb7e9('0x34')]['length']?_0x3b3c95[_0xb7e9('0x34')]:_0x1bdbc0[_0xb7e9('0x2e')];_0x3b3c95['order']=qs['sort'](_0x1d1efe[_0xb7e9('0x30')][_0xb7e9('0x39')]);_0x3b3c95['where']=qs[_0xb7e9('0x32')](_[_0xb7e9('0x3a')](_0x1d1efe[_0xb7e9('0x30')],_0x1bdbc0[_0xb7e9('0x32')]));if(_0x1d1efe[_0xb7e9('0x30')][_0xb7e9('0x3d')]){_0x3b3c95[_0xb7e9('0x3b')]=_[_0xb7e9('0x3c')](_0x3b3c95[_0xb7e9('0x3b')],{'$or':_['map'](_0x3b3c95['attributes'],function(_0x132721){var _0x318e9d={};_0x318e9d[_0x132721]={'$like':'%'+_0x1d1efe[_0xb7e9('0x30')][_0xb7e9('0x3d')]+'%'};return _0x318e9d;})});}_0x3b3c95=_[_0xb7e9('0x3c')]({},_0x3b3c95,_0x1d1efe[_0xb7e9('0x45')]);return _0x3b499f[_0xb7e9('0x4c')](_0x3b3c95);}})[_0xb7e9('0x25')](function(_0x2000bc){if(_0x2000bc){_0x408358=_0x2000bc[_0xb7e9('0x36')];if(!_0x1d1efe[_0xb7e9('0x30')][_0xb7e9('0x37')](_0xb7e9('0x4d'))){_0x3b3c95[_0xb7e9('0x1f')]=qs['limit'](_0x1d1efe[_0xb7e9('0x30')]['limit']);_0x3b3c95['offset']=qs['offset'](_0x1d1efe[_0xb7e9('0x30')][_0xb7e9('0x1c')]);}return _0x3b499f[_0xb7e9('0x4c')](_0x3b3c95);}})[_0xb7e9('0x25')](function(_0x411f65){if(_0x411f65){return _0x411f65?{'count':_0x408358,'rows':_0x411f65}:null;}})['then'](respondWithResult(_0x5cac94,null))[_0xb7e9('0x41')](handleError(_0x5cac94,null));};exports[_0xb7e9('0x4e')]=function(_0x891235,_0x4a6c53,_0x424639){var _0x3922e2={};var _0x3c5c1a={};var _0x406c0c;var _0x3d7365;return db[_0xb7e9('0x2b')][_0xb7e9('0x4a')]({'where':{'id':_0x891235[_0xb7e9('0x43')]['id']}})[_0xb7e9('0x25')](handleEntityNotFound(_0x4a6c53,null))[_0xb7e9('0x25')](function(_0x50646c){if(_0x50646c){_0x406c0c=_0x50646c;_0x3c5c1a['model']=_[_0xb7e9('0x31')](db[_0xb7e9('0x4b')][_0xb7e9('0x44')]);_0x3c5c1a[_0xb7e9('0x30')]=_['keys'](_0x891235['query']);_0x3c5c1a[_0xb7e9('0x32')]=_['intersection'](_0x3c5c1a[_0xb7e9('0x2e')],_0x3c5c1a[_0xb7e9('0x30')]);_0x3922e2['attributes']=_[_0xb7e9('0x33')](_0x3c5c1a[_0xb7e9('0x2e')],qs[_0xb7e9('0x35')](_0x891235[_0xb7e9('0x30')][_0xb7e9('0x35')]));_0x3922e2[_0xb7e9('0x34')]=_0x3922e2[_0xb7e9('0x34')][_0xb7e9('0x36')]?_0x3922e2['attributes']:_0x3c5c1a[_0xb7e9('0x2e')];_0x3922e2[_0xb7e9('0x38')]=qs[_0xb7e9('0x39')](_0x891235['query']['sort']);_0x3922e2[_0xb7e9('0x3b')]=qs[_0xb7e9('0x32')](_['pick'](_0x891235[_0xb7e9('0x30')],_0x3c5c1a['filters']));if(_0x891235[_0xb7e9('0x30')][_0xb7e9('0x3d')]){_0x3922e2[_0xb7e9('0x3b')]=_[_0xb7e9('0x3c')](_0x3922e2[_0xb7e9('0x3b')],{'$or':_[_0xb7e9('0x2f')](_0x3922e2['attributes'],function(_0x10a665){var _0x159686={};_0x159686[_0x10a665]={'$like':'%'+_0x891235[_0xb7e9('0x30')][_0xb7e9('0x3d')]+'%'};return _0x159686;})});}_0x3922e2=_[_0xb7e9('0x3c')]({},_0x3922e2,_0x891235[_0xb7e9('0x45')]);return _0x406c0c[_0xb7e9('0x4e')](_0x3922e2);}})['then'](function(_0x3880cf){if(_0x3880cf){_0x3d7365=_0x3880cf['length'];if(!_0x891235[_0xb7e9('0x30')][_0xb7e9('0x37')]('nolimit')){_0x3922e2[_0xb7e9('0x1f')]=qs[_0xb7e9('0x1f')](_0x891235[_0xb7e9('0x30')][_0xb7e9('0x1f')]);_0x3922e2[_0xb7e9('0x1c')]=qs['offset'](_0x891235[_0xb7e9('0x30')][_0xb7e9('0x1c')]);}return _0x406c0c['getDescriptions'](_0x3922e2);}})[_0xb7e9('0x25')](function(_0x47a111){if(_0x47a111){return _0x47a111?{'count':_0x3d7365,'rows':_0x47a111}:null;}})[_0xb7e9('0x25')](respondWithResult(_0x4a6c53,null))['catch'](handleError(_0x4a6c53,null));}; \ No newline at end of file +var _0x048c=['api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','VtigerConfiguration','count','includeAll','include','findAll','catch','show','params','keys','find','create','body','getFields','findOne','options','length','VtigerField','getSubjects','getDescriptions','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4e44fc,_0x5c78e5){var _0x4a6c22=function(_0x46a662){while(--_0x46a662){_0x4e44fc['push'](_0x4e44fc['shift']());}};_0x4a6c22(++_0x5c78e5);}(_0x048c,0xdb));var _0xc048=function(_0x32b25f,_0x1b7b0c){_0x32b25f=_0x32b25f-0x0;var _0x134545=_0x048c[_0x32b25f];return _0x134545;};'use strict';var emlformat=require(_0xc048('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc048('0x1'));var rp=require('request-promise');var moment=require(_0xc048('0x2'));var BPromise=require(_0xc048('0x3'));var Mustache=require('mustache');var util=require(_0xc048('0x4'));var path=require(_0xc048('0x5'));var sox=require(_0xc048('0x6'));var csv=require(_0xc048('0x7'));var ejs=require(_0xc048('0x8'));var fs=require('fs');var fs_extra=require(_0xc048('0x9'));var _=require(_0xc048('0xa'));var squel=require(_0xc048('0xb'));var crypto=require('crypto');var jsforce=require(_0xc048('0xc'));var deskjs=require(_0xc048('0xd'));var toCsv=require(_0xc048('0x7'));var querystring=require(_0xc048('0xe'));var Papa=require(_0xc048('0xf'));var Redis=require(_0xc048('0x10'));var authService=require(_0xc048('0x11'));var qs=require(_0xc048('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc048('0x13'));var logger=require(_0xc048('0x14'))(_0xc048('0x15'));var utils=require(_0xc048('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc048('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x215da1,_0x51bb57){_0x51bb57=_0x51bb57||0xcc;return function(_0x44e03f){if(_0x44e03f){return _0x215da1[_0xc048('0x18')](_0x51bb57);}return _0x215da1[_0xc048('0x19')](_0x51bb57)[_0xc048('0x1a')]();};}function respondWithResult(_0x3c0a79,_0x3c7e07){_0x3c7e07=_0x3c7e07||0xc8;return function(_0x20b0bc){if(_0x20b0bc){return _0x3c0a79[_0xc048('0x19')](_0x3c7e07)[_0xc048('0x1b')](_0x20b0bc);}};}function respondWithFilteredResult(_0x180a5b,_0x1505ef){return function(_0x7a8ac6){if(_0x7a8ac6){var _0x17f007=typeof _0x1505ef['offset']==='undefined'&&typeof _0x1505ef[_0xc048('0x1c')]===_0xc048('0x1d');var _0x193a74=_0x7a8ac6['count'];var _0xb76ff8=_0x17f007?0x0:_0x1505ef[_0xc048('0x1e')];var _0x32d229=_0x17f007?_0x7a8ac6['count']:_0x1505ef[_0xc048('0x1e')]+_0x1505ef[_0xc048('0x1c')];var _0x11531b;if(_0x32d229>=_0x193a74){_0x32d229=_0x193a74;_0x11531b=0xc8;}else{_0x11531b=0xce;}_0x180a5b[_0xc048('0x19')](_0x11531b);return _0x180a5b['set'](_0xc048('0x1f'),_0xb76ff8+'-'+_0x32d229+'/'+_0x193a74)['json'](_0x7a8ac6);}return null;};}function patchUpdates(_0x2efc0b){return function(_0x3d55fb){try{jsonpatch['apply'](_0x3d55fb,_0x2efc0b,!![]);}catch(_0x49bdc4){return BPromise[_0xc048('0x20')](_0x49bdc4);}return _0x3d55fb[_0xc048('0x21')]();};}function saveUpdates(_0x401bb5,_0x58973c){return function(_0x2ba571){if(_0x2ba571){return _0x2ba571[_0xc048('0x22')](_0x401bb5)['then'](function(_0x1a854d){return _0x1a854d;});}return null;};}function removeEntity(_0x35160c,_0xa2a309){return function(_0x4f4d3c){if(_0x4f4d3c){return _0x4f4d3c[_0xc048('0x23')]()[_0xc048('0x24')](function(){_0x35160c['status'](0xcc)[_0xc048('0x1a')]();});}};}function handleEntityNotFound(_0x44c3a0,_0x23c014){return function(_0xf2b8f3){if(!_0xf2b8f3){_0x44c3a0[_0xc048('0x18')](0x194);}return _0xf2b8f3;};}function handleError(_0x18a03a,_0x24b4e6){_0x24b4e6=_0x24b4e6||0x1f4;return function(_0x41de32){logger[_0xc048('0x25')](_0x41de32[_0xc048('0x26')]);if(_0x41de32['name']){delete _0x41de32[_0xc048('0x27')];}_0x18a03a['status'](_0x24b4e6)[_0xc048('0x28')](_0x41de32);};}exports[_0xc048('0x29')]=function(_0x312d00,_0x1cda79){var _0x3a421a={},_0x338747={},_0xd1883e={'count':0x0,'rows':[]};var _0x36f75c=_['map'](db['VtigerConfiguration'][_0xc048('0x2a')],function(_0x25be0f){return{'name':_0x25be0f[_0xc048('0x2b')],'type':_0x25be0f[_0xc048('0x2c')]['key']};});_0x338747[_0xc048('0x2d')]=_[_0xc048('0x2e')](_0x36f75c,_0xc048('0x27'));_0x338747[_0xc048('0x2f')]=_['keys'](_0x312d00[_0xc048('0x2f')]);_0x338747[_0xc048('0x30')]=_[_0xc048('0x31')](_0x338747['model'],_0x338747['query']);_0x3a421a[_0xc048('0x32')]=_[_0xc048('0x31')](_0x338747[_0xc048('0x2d')],qs['fields'](_0x312d00[_0xc048('0x2f')][_0xc048('0x33')]));_0x3a421a['attributes']=_0x3a421a[_0xc048('0x32')]['length']?_0x3a421a[_0xc048('0x32')]:_0x338747[_0xc048('0x2d')];if(!_0x312d00[_0xc048('0x2f')][_0xc048('0x34')](_0xc048('0x35'))){_0x3a421a['limit']=qs['limit'](_0x312d00[_0xc048('0x2f')][_0xc048('0x1c')]);_0x3a421a[_0xc048('0x1e')]=qs[_0xc048('0x1e')](_0x312d00['query'][_0xc048('0x1e')]);}_0x3a421a[_0xc048('0x36')]=qs[_0xc048('0x37')](_0x312d00[_0xc048('0x2f')][_0xc048('0x37')]);_0x3a421a[_0xc048('0x38')]=qs[_0xc048('0x30')](_[_0xc048('0x39')](_0x312d00[_0xc048('0x2f')],_0x338747['filters']),_0x36f75c);if(_0x312d00[_0xc048('0x2f')]['filter']){_0x3a421a[_0xc048('0x38')]=_[_0xc048('0x3a')](_0x3a421a[_0xc048('0x38')],{'$or':_[_0xc048('0x2e')](_0x36f75c,function(_0x39e2de){if(_0x39e2de['type']!==_0xc048('0x3b')){var _0x11317c={};_0x11317c[_0x39e2de[_0xc048('0x27')]]={'$like':'%'+_0x312d00['query'][_0xc048('0x3c')]+'%'};return _0x11317c;}})});}_0x3a421a=_['merge']({},_0x3a421a,_0x312d00['options']);var _0x13a9a0={'where':_0x3a421a[_0xc048('0x38')]};return db[_0xc048('0x3d')][_0xc048('0x3e')](_0x13a9a0)['then'](function(_0x5b51b6){_0xd1883e[_0xc048('0x3e')]=_0x5b51b6;if(_0x312d00[_0xc048('0x2f')][_0xc048('0x3f')]){_0x3a421a[_0xc048('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xc048('0x41')](_0x3a421a);})[_0xc048('0x24')](function(_0xbc32ba){_0xd1883e['rows']=_0xbc32ba;return _0xd1883e;})[_0xc048('0x24')](respondWithFilteredResult(_0x1cda79,_0x3a421a))[_0xc048('0x42')](handleError(_0x1cda79,null));};exports[_0xc048('0x43')]=function(_0x46808e,_0x45af30){var _0x3846f6={'raw':![],'where':{'id':_0x46808e[_0xc048('0x44')]['id']}},_0xbdbf98={};_0xbdbf98[_0xc048('0x2d')]=_[_0xc048('0x45')](db[_0xc048('0x3d')][_0xc048('0x2a')]);_0xbdbf98[_0xc048('0x2f')]=_[_0xc048('0x45')](_0x46808e[_0xc048('0x2f')]);_0xbdbf98[_0xc048('0x30')]=_[_0xc048('0x31')](_0xbdbf98['model'],_0xbdbf98[_0xc048('0x2f')]);_0x3846f6[_0xc048('0x32')]=_[_0xc048('0x31')](_0xbdbf98[_0xc048('0x2d')],qs[_0xc048('0x33')](_0x46808e['query'][_0xc048('0x33')]));_0x3846f6[_0xc048('0x32')]=_0x3846f6[_0xc048('0x32')]['length']?_0x3846f6[_0xc048('0x32')]:_0xbdbf98[_0xc048('0x2d')];if(_0x46808e[_0xc048('0x2f')][_0xc048('0x3f')]){_0x3846f6[_0xc048('0x40')]=[{'all':!![]}];}_0x3846f6=_['merge']({},_0x3846f6,_0x46808e['options']);return db[_0xc048('0x3d')][_0xc048('0x46')](_0x3846f6)['then'](handleEntityNotFound(_0x45af30,null))[_0xc048('0x24')](respondWithResult(_0x45af30,null))[_0xc048('0x42')](handleError(_0x45af30,null));};exports['create']=function(_0x24f338,_0x57c3aa){return db['VtigerConfiguration'][_0xc048('0x47')](_0x24f338[_0xc048('0x48')],{})['then'](respondWithResult(_0x57c3aa,0xc9))[_0xc048('0x42')](handleError(_0x57c3aa,null));};exports[_0xc048('0x22')]=function(_0x2ce0e6,_0x1de5a1){if(_0x2ce0e6[_0xc048('0x48')]['id']){delete _0x2ce0e6['body']['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x2ce0e6['params']['id']}})['then'](handleEntityNotFound(_0x1de5a1,null))[_0xc048('0x24')](saveUpdates(_0x2ce0e6[_0xc048('0x48')],null))['then'](respondWithResult(_0x1de5a1,null))[_0xc048('0x42')](handleError(_0x1de5a1,null));};exports[_0xc048('0x23')]=function(_0x42e6d8,_0xc0a463){return db[_0xc048('0x3d')][_0xc048('0x46')]({'where':{'id':_0x42e6d8[_0xc048('0x44')]['id']}})[_0xc048('0x24')](handleEntityNotFound(_0xc0a463,null))[_0xc048('0x24')](removeEntity(_0xc0a463,null))[_0xc048('0x42')](handleError(_0xc0a463,null));};exports[_0xc048('0x49')]=function(_0x3b8b37,_0x59aca0,_0x333997){var _0x350333={};var _0x39d2f2={};var _0xb1f64a;var _0x13f1f7;return db['VtigerConfiguration'][_0xc048('0x4a')]({'where':{'id':_0x3b8b37['params']['id']}})[_0xc048('0x24')](handleEntityNotFound(_0x59aca0,null))[_0xc048('0x24')](function(_0x2bcd1b){if(_0x2bcd1b){_0xb1f64a=_0x2bcd1b;_0x39d2f2[_0xc048('0x2d')]=_[_0xc048('0x45')](db['VtigerField'][_0xc048('0x2a')]);_0x39d2f2['query']=_[_0xc048('0x45')](_0x3b8b37[_0xc048('0x2f')]);_0x39d2f2[_0xc048('0x30')]=_[_0xc048('0x31')](_0x39d2f2[_0xc048('0x2d')],_0x39d2f2[_0xc048('0x2f')]);_0x350333[_0xc048('0x32')]=_[_0xc048('0x31')](_0x39d2f2[_0xc048('0x2d')],qs[_0xc048('0x33')](_0x3b8b37['query'][_0xc048('0x33')]));_0x350333[_0xc048('0x32')]=_0x350333[_0xc048('0x32')]['length']?_0x350333[_0xc048('0x32')]:_0x39d2f2[_0xc048('0x2d')];_0x350333[_0xc048('0x36')]=qs[_0xc048('0x37')](_0x3b8b37[_0xc048('0x2f')][_0xc048('0x37')]);_0x350333[_0xc048('0x38')]=qs[_0xc048('0x30')](_['pick'](_0x3b8b37[_0xc048('0x2f')],_0x39d2f2['filters']));if(_0x3b8b37[_0xc048('0x2f')]['filter']){_0x350333[_0xc048('0x38')]=_[_0xc048('0x3a')](_0x350333['where'],{'$or':_['map'](_0x350333[_0xc048('0x32')],function(_0x4c9ee6){var _0x46a4ce={};_0x46a4ce[_0x4c9ee6]={'$like':'%'+_0x3b8b37[_0xc048('0x2f')]['filter']+'%'};return _0x46a4ce;})});}_0x350333=_['merge']({},_0x350333,_0x3b8b37[_0xc048('0x4b')]);return _0xb1f64a[_0xc048('0x49')](_0x350333);}})['then'](function(_0x663cbf){if(_0x663cbf){_0x13f1f7=_0x663cbf[_0xc048('0x4c')];if(!_0x3b8b37[_0xc048('0x2f')][_0xc048('0x34')](_0xc048('0x35'))){_0x350333[_0xc048('0x1c')]=qs[_0xc048('0x1c')](_0x3b8b37['query']['limit']);_0x350333[_0xc048('0x1e')]=qs['offset'](_0x3b8b37[_0xc048('0x2f')][_0xc048('0x1e')]);}return _0xb1f64a[_0xc048('0x49')](_0x350333);}})[_0xc048('0x24')](function(_0x448376){if(_0x448376){return _0x448376?{'count':_0x13f1f7,'rows':_0x448376}:null;}})[_0xc048('0x24')](respondWithResult(_0x59aca0,null))['catch'](handleError(_0x59aca0,null));};exports['getSubjects']=function(_0x598c66,_0x286ca5,_0x3ebae4){var _0x397e85={};var _0x468823={};var _0x568b25;var _0x3f63eb;return db[_0xc048('0x3d')][_0xc048('0x4a')]({'where':{'id':_0x598c66[_0xc048('0x44')]['id']}})[_0xc048('0x24')](handleEntityNotFound(_0x286ca5,null))[_0xc048('0x24')](function(_0x5a8390){if(_0x5a8390){_0x568b25=_0x5a8390;_0x468823[_0xc048('0x2d')]=_[_0xc048('0x45')](db[_0xc048('0x4d')][_0xc048('0x2a')]);_0x468823[_0xc048('0x2f')]=_['keys'](_0x598c66['query']);_0x468823[_0xc048('0x30')]=_[_0xc048('0x31')](_0x468823[_0xc048('0x2d')],_0x468823[_0xc048('0x2f')]);_0x397e85['attributes']=_[_0xc048('0x31')](_0x468823[_0xc048('0x2d')],qs[_0xc048('0x33')](_0x598c66[_0xc048('0x2f')][_0xc048('0x33')]));_0x397e85['attributes']=_0x397e85['attributes'][_0xc048('0x4c')]?_0x397e85['attributes']:_0x468823[_0xc048('0x2d')];_0x397e85[_0xc048('0x36')]=qs[_0xc048('0x37')](_0x598c66[_0xc048('0x2f')][_0xc048('0x37')]);_0x397e85['where']=qs[_0xc048('0x30')](_[_0xc048('0x39')](_0x598c66[_0xc048('0x2f')],_0x468823[_0xc048('0x30')]));if(_0x598c66['query'][_0xc048('0x3c')]){_0x397e85['where']=_[_0xc048('0x3a')](_0x397e85[_0xc048('0x38')],{'$or':_['map'](_0x397e85[_0xc048('0x32')],function(_0x2957ad){var _0x23a2ce={};_0x23a2ce[_0x2957ad]={'$like':'%'+_0x598c66['query'][_0xc048('0x3c')]+'%'};return _0x23a2ce;})});}_0x397e85=_[_0xc048('0x3a')]({},_0x397e85,_0x598c66[_0xc048('0x4b')]);return _0x568b25[_0xc048('0x4e')](_0x397e85);}})['then'](function(_0x15d3b3){if(_0x15d3b3){_0x3f63eb=_0x15d3b3[_0xc048('0x4c')];if(!_0x598c66[_0xc048('0x2f')][_0xc048('0x34')](_0xc048('0x35'))){_0x397e85[_0xc048('0x1c')]=qs[_0xc048('0x1c')](_0x598c66[_0xc048('0x2f')][_0xc048('0x1c')]);_0x397e85['offset']=qs[_0xc048('0x1e')](_0x598c66['query'][_0xc048('0x1e')]);}return _0x568b25[_0xc048('0x4e')](_0x397e85);}})[_0xc048('0x24')](function(_0x3e18ff){if(_0x3e18ff){return _0x3e18ff?{'count':_0x3f63eb,'rows':_0x3e18ff}:null;}})[_0xc048('0x24')](respondWithResult(_0x286ca5,null))['catch'](handleError(_0x286ca5,null));};exports['getDescriptions']=function(_0x971cb5,_0x2f74ff,_0x1355b9){var _0x54772d={};var _0x40739f={};var _0x5f1de5;var _0xfa115e;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x971cb5['params']['id']}})[_0xc048('0x24')](handleEntityNotFound(_0x2f74ff,null))['then'](function(_0x57be7b){if(_0x57be7b){_0x5f1de5=_0x57be7b;_0x40739f[_0xc048('0x2d')]=_[_0xc048('0x45')](db[_0xc048('0x4d')][_0xc048('0x2a')]);_0x40739f[_0xc048('0x2f')]=_[_0xc048('0x45')](_0x971cb5[_0xc048('0x2f')]);_0x40739f[_0xc048('0x30')]=_['intersection'](_0x40739f[_0xc048('0x2d')],_0x40739f[_0xc048('0x2f')]);_0x54772d[_0xc048('0x32')]=_['intersection'](_0x40739f[_0xc048('0x2d')],qs['fields'](_0x971cb5['query'][_0xc048('0x33')]));_0x54772d[_0xc048('0x32')]=_0x54772d[_0xc048('0x32')][_0xc048('0x4c')]?_0x54772d['attributes']:_0x40739f[_0xc048('0x2d')];_0x54772d[_0xc048('0x36')]=qs[_0xc048('0x37')](_0x971cb5[_0xc048('0x2f')]['sort']);_0x54772d[_0xc048('0x38')]=qs[_0xc048('0x30')](_[_0xc048('0x39')](_0x971cb5['query'],_0x40739f['filters']));if(_0x971cb5[_0xc048('0x2f')][_0xc048('0x3c')]){_0x54772d[_0xc048('0x38')]=_[_0xc048('0x3a')](_0x54772d[_0xc048('0x38')],{'$or':_[_0xc048('0x2e')](_0x54772d[_0xc048('0x32')],function(_0x4ae946){var _0x46dc47={};_0x46dc47[_0x4ae946]={'$like':'%'+_0x971cb5[_0xc048('0x2f')][_0xc048('0x3c')]+'%'};return _0x46dc47;})});}_0x54772d=_[_0xc048('0x3a')]({},_0x54772d,_0x971cb5['options']);return _0x5f1de5[_0xc048('0x4f')](_0x54772d);}})[_0xc048('0x24')](function(_0x295eaf){if(_0x295eaf){_0xfa115e=_0x295eaf[_0xc048('0x4c')];if(!_0x971cb5[_0xc048('0x2f')][_0xc048('0x34')](_0xc048('0x35'))){_0x54772d[_0xc048('0x1c')]=qs[_0xc048('0x1c')](_0x971cb5[_0xc048('0x2f')][_0xc048('0x1c')]);_0x54772d[_0xc048('0x1e')]=qs[_0xc048('0x1e')](_0x971cb5[_0xc048('0x2f')][_0xc048('0x1e')]);}return _0x5f1de5[_0xc048('0x4f')](_0x54772d);}})[_0xc048('0x24')](function(_0x636eef){if(_0x636eef){return _0x636eef?{'count':_0xfa115e,'rows':_0x636eef}:null;}})[_0xc048('0x24')](respondWithResult(_0x2f74ff,null))[_0xc048('0x42')](handleError(_0x2f74ff,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 96bac6a..aa5e735 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 _0xf9f0=['int_vtiger_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intVtigerConfiguration.attributes','define','VtigerConfiguration'];(function(_0x1a8207,_0x576621){var _0x4bc774=function(_0x228d2e){while(--_0x228d2e){_0x1a8207['push'](_0x1a8207['shift']());}};_0x4bc774(++_0x576621);}(_0xf9f0,0x139));var _0x0f9f=function(_0x36a570,_0x23705b){_0x36a570=_0x36a570-0x0;var _0x34ac5c=_0xf9f0[_0x36a570];return _0x34ac5c;};'use strict';var _=require(_0x0f9f('0x0'));var util=require(_0x0f9f('0x1'));var logger=require('../../config/logger')(_0x0f9f('0x2'));var moment=require(_0x0f9f('0x3'));var BPromise=require(_0x0f9f('0x4'));var rp=require(_0x0f9f('0x5'));var fs=require('fs');var path=require(_0x0f9f('0x6'));var rimraf=require(_0x0f9f('0x7'));var config=require('../../config/environment');var attributes=require(_0x0f9f('0x8'));module['exports']=function(_0x1b230a,_0xa98b7d){return _0x1b230a[_0x0f9f('0x9')](_0x0f9f('0xa'),attributes,{'tableName':_0x0f9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb50=['request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations','api','bluebird'];(function(_0x21ba84,_0x1a8abd){var _0x4ddb03=function(_0x5406f9){while(--_0x5406f9){_0x21ba84['push'](_0x21ba84['shift']());}};_0x4ddb03(++_0x1a8abd);}(_0xdb50,0x85));var _0x0db5=function(_0x31a893,_0xcfbb4a){_0x31a893=_0x31a893-0x0;var _0x11c43a=_0xdb50[_0x31a893];return _0x11c43a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0db5('0x0'));var moment=require('moment');var BPromise=require(_0x0db5('0x1'));var rp=require(_0x0db5('0x2'));var fs=require('fs');var path=require(_0x0db5('0x3'));var rimraf=require(_0x0db5('0x4'));var config=require(_0x0db5('0x5'));var attributes=require(_0x0db5('0x6'));module['exports']=function(_0x3bee5b,_0x141022){return _0x3bee5b['define'](_0x0db5('0x7'),attributes,{'tableName':_0x0db5('0x8'),'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 76b8bea..ffc1a38 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 _0x9bad=['client','http','then','info','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5b3ce1,_0xedd65b){var _0x38b358=function(_0x154aa6){while(--_0x154aa6){_0x5b3ce1['push'](_0x5b3ce1['shift']());}};_0x38b358(++_0xedd65b);}(_0x9bad,0x1b6));var _0xd9ba=function(_0x18a556,_0x344f55){_0x18a556=_0x18a556-0x0;var _0x5aa894=_0x9bad[_0x18a556];return _0x5aa894;};'use strict';var _=require(_0xd9ba('0x0'));var util=require(_0xd9ba('0x1'));var moment=require(_0xd9ba('0x2'));var BPromise=require(_0xd9ba('0x3'));var rs=require(_0xd9ba('0x4'));var fs=require('fs');var Redis=require(_0xd9ba('0x5'));var db=require(_0xd9ba('0x6'))['db'];var utils=require(_0xd9ba('0x7'));var logger=require(_0xd9ba('0x8'))(_0xd9ba('0x9'));var config=require(_0xd9ba('0xa'));var jayson=require(_0xd9ba('0xb'));var client=jayson[_0xd9ba('0xc')][_0xd9ba('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2f5c30,_0x2457b1,_0x4860f2){return new BPromise(function(_0x2f0d70,_0x2d99a7){return client['request'](_0x2f5c30,_0x4860f2)[_0xd9ba('0xe')](function(_0x580075){logger[_0xd9ba('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x2457b1,_0xd9ba('0x10'));logger['debug'](_0xd9ba('0x11'),_0x2457b1,'request\x20sent',JSON[_0xd9ba('0x12')](_0x580075));if(_0x580075[_0xd9ba('0x13')]){if(_0x580075['error'][_0xd9ba('0x14')]===0x1f4){logger['error'](_0xd9ba('0x15'),_0x2457b1,_0x580075[_0xd9ba('0x13')][_0xd9ba('0x16')]);return _0x2d99a7(_0x580075[_0xd9ba('0x13')]['message']);}logger[_0xd9ba('0x13')](_0xd9ba('0x15'),_0x2457b1,_0x580075[_0xd9ba('0x13')]['message']);return _0x2f0d70(_0x580075[_0xd9ba('0x13')][_0xd9ba('0x16')]);}else{logger['info'](_0xd9ba('0x15'),_0x2457b1,_0xd9ba('0x10'));_0x2f0d70(_0x580075[_0xd9ba('0x17')][_0xd9ba('0x16')]);}})[_0xd9ba('0x18')](function(_0x248dcd){logger[_0xd9ba('0x13')](_0xd9ba('0x15'),_0x2457b1,_0x248dcd);_0x2d99a7(_0x248dcd);});});} \ No newline at end of file +var _0xd080=['../../config/environment','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger'];(function(_0x51c1a3,_0x1d4a0f){var _0xfbef99=function(_0x1c2f60){while(--_0x1c2f60){_0x51c1a3['push'](_0x51c1a3['shift']());}};_0xfbef99(++_0x1d4a0f);}(_0xd080,0x13a));var _0x0d08=function(_0x5d43aa,_0x127537){_0x5d43aa=_0x5d43aa-0x0;var _0x3b3f87=_0xd080[_0x5d43aa];return _0x3b3f87;};'use strict';var _=require(_0x0d08('0x0'));var util=require(_0x0d08('0x1'));var moment=require(_0x0d08('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d08('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d08('0x4'));var logger=require(_0x0d08('0x5'))('rpc');var config=require(_0x0d08('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0d08('0x7')][_0x0d08('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3799f8,_0x584bdf,_0x2c566b){return new BPromise(function(_0x1db8a2,_0x39b293){return client[_0x0d08('0x9')](_0x3799f8,_0x2c566b)['then'](function(_0x92e787){logger[_0x0d08('0xa')](_0x0d08('0xb'),_0x584bdf,_0x0d08('0xc'));logger[_0x0d08('0xd')](_0x0d08('0xe'),_0x584bdf,_0x0d08('0xc'),JSON['stringify'](_0x92e787));if(_0x92e787['error']){if(_0x92e787['error'][_0x0d08('0xf')]===0x1f4){logger['error'](_0x0d08('0xb'),_0x584bdf,_0x92e787[_0x0d08('0x10')][_0x0d08('0x11')]);return _0x39b293(_0x92e787['error'][_0x0d08('0x11')]);}logger[_0x0d08('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x584bdf,_0x92e787[_0x0d08('0x10')][_0x0d08('0x11')]);return _0x1db8a2(_0x92e787[_0x0d08('0x10')]['message']);}else{logger[_0x0d08('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x584bdf,'request\x20sent');_0x1db8a2(_0x92e787[_0x0d08('0x12')][_0x0d08('0x11')]);}})[_0x0d08('0x13')](function(_0x570eba){logger[_0x0d08('0x10')](_0x0d08('0xb'),_0x584bdf,_0x570eba);_0x39b293(_0x570eba);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 1c1a9d3..35d6526 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 _0x4f8f=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4f8f,0xfa));var _0xf4f8=function(_0x45f7c8,_0x4b2546){_0x45f7c8=_0x45f7c8-0x0;var _0x4846c1=_0x4f8f[_0x45f7c8];return _0x4846c1;};'use strict';var multer=require(_0xf4f8('0x0'));var util=require(_0xf4f8('0x1'));var path=require(_0xf4f8('0x2'));var timeout=require(_0xf4f8('0x3'));var express=require(_0xf4f8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf4f8('0x5'));var interaction=require(_0xf4f8('0x6'));var config=require(_0xf4f8('0x7'));var controller=require('./intVtigerField.controller');router[_0xf4f8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf4f8('0x8')](_0xf4f8('0x9'),auth[_0xf4f8('0xa')](),controller[_0xf4f8('0xb')]);router[_0xf4f8('0xc')]('/',auth[_0xf4f8('0xa')](),controller[_0xf4f8('0xd')]);router[_0xf4f8('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf4f8('0xf')](_0xf4f8('0x9'),auth[_0xf4f8('0xa')](),controller[_0xf4f8('0x10')]);module[_0xf4f8('0x11')]=router; \ No newline at end of file +var _0xa25c=['isAuthenticated','show','post','update','/:id','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get'];(function(_0x5de079,_0x4d1a34){var _0x97e4fc=function(_0x2d7156){while(--_0x2d7156){_0x5de079['push'](_0x5de079['shift']());}};_0x97e4fc(++_0x4d1a34);}(_0xa25c,0x9c));var _0xca25=function(_0x1caf3f,_0x1b4800){_0x1caf3f=_0x1caf3f-0x0;var _0x1905f0=_0xa25c[_0x1caf3f];return _0x1905f0;};'use strict';var multer=require(_0xca25('0x0'));var util=require(_0xca25('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca25('0x2'));var router=express[_0xca25('0x3')]();var fs_extra=require(_0xca25('0x4'));var auth=require(_0xca25('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xca25('0x6'));var controller=require(_0xca25('0x7'));router[_0xca25('0x8')]('/',auth[_0xca25('0x9')](),controller['index']);router[_0xca25('0x8')]('/:id',auth[_0xca25('0x9')](),controller[_0xca25('0xa')]);router[_0xca25('0xb')]('/',auth[_0xca25('0x9')](),controller['create']);router['put']('/:id',auth[_0xca25('0x9')](),controller[_0xca25('0xc')]);router['delete'](_0xca25('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xca25('0xe')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index fb10b39..20f8816 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 _0xb268=['keyValue','picklist','STRING','variable','sequelize','ENUM','string','customVariable'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0xb268,0x1bc));var _0x8b26=function(_0x156f2d,_0xf77c58){_0x156f2d=_0x156f2d-0x0;var _0x4a3142=_0xb268[_0x156f2d];return _0x4a3142;};'use strict';var Sequelize=require(_0x8b26('0x0'));module['exports']={'type':{'type':Sequelize[_0x8b26('0x1')](_0x8b26('0x2'),'variable',_0x8b26('0x3'),_0x8b26('0x4'),_0x8b26('0x5')),'defaultValue':_0x8b26('0x2')},'content':{'type':Sequelize[_0x8b26('0x6')]},'key':{'type':Sequelize[_0x8b26('0x6')]},'keyType':{'type':Sequelize[_0x8b26('0x1')]('string',_0x8b26('0x7'),_0x8b26('0x3'))},'keyContent':{'type':Sequelize[_0x8b26('0x6')]},'idField':{'type':Sequelize[_0x8b26('0x6')]},'nameField':{'type':Sequelize[_0x8b26('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b26('0x6')]}}; \ No newline at end of file +var _0x69ea=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x69ea,0x100));var _0xa69e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x69ea[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xa69e('0x0'));module[_0xa69e('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa69e('0x2'),_0xa69e('0x3'),_0xa69e('0x4'),_0xa69e('0x5'),_0xa69e('0x6')),'defaultValue':_0xa69e('0x2')},'content':{'type':Sequelize[_0xa69e('0x7')]},'key':{'type':Sequelize[_0xa69e('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xa69e('0x2'),'variable',_0xa69e('0x4'))},'keyContent':{'type':Sequelize[_0xa69e('0x7')]},'idField':{'type':Sequelize[_0xa69e('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa69e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa69e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 7b3170a..0661f5f 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 _0xa635=['then','destroy','end','error','name','send','index','VtigerField','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','update','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','limit','undefined','count','offset','status','set','save'];(function(_0x5d8445,_0x41d87c){var _0x510fa1=function(_0x1b0936){while(--_0x1b0936){_0x5d8445['push'](_0x5d8445['shift']());}};_0x510fa1(++_0x41d87c);}(_0xa635,0x19a));var _0x5a63=function(_0x1c7543,_0x11328a){_0x1c7543=_0x1c7543-0x0;var _0x3d90d8=_0xa635[_0x1c7543];return _0x3d90d8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5a63('0x0'));var rp=require(_0x5a63('0x1'));var moment=require(_0x5a63('0x2'));var BPromise=require(_0x5a63('0x3'));var Mustache=require(_0x5a63('0x4'));var util=require('util');var path=require(_0x5a63('0x5'));var sox=require(_0x5a63('0x6'));var csv=require(_0x5a63('0x7'));var ejs=require(_0x5a63('0x8'));var fs=require('fs');var fs_extra=require(_0x5a63('0x9'));var _=require(_0x5a63('0xa'));var squel=require(_0x5a63('0xb'));var crypto=require(_0x5a63('0xc'));var jsforce=require(_0x5a63('0xd'));var deskjs=require(_0x5a63('0xe'));var toCsv=require(_0x5a63('0x7'));var querystring=require(_0x5a63('0xf'));var Papa=require('papaparse');var Redis=require(_0x5a63('0x10'));var authService=require(_0x5a63('0x11'));var qs=require(_0x5a63('0x12'));var as=require(_0x5a63('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a63('0x14'))(_0x5a63('0x15'));var utils=require(_0x5a63('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5a63('0x17'));var db=require(_0x5a63('0x18'))['db'];function respondWithStatusCode(_0x570ba1,_0x4e2aab){_0x4e2aab=_0x4e2aab||0xcc;return function(_0x24ebd0){if(_0x24ebd0){return _0x570ba1[_0x5a63('0x19')](_0x4e2aab);}return _0x570ba1['status'](_0x4e2aab)['end']();};}function respondWithResult(_0x2862e8,_0x16d6a9){_0x16d6a9=_0x16d6a9||0xc8;return function(_0x26c45e){if(_0x26c45e){return _0x2862e8['status'](_0x16d6a9)[_0x5a63('0x1a')](_0x26c45e);}};}function respondWithFilteredResult(_0x13feda,_0x1403c8){return function(_0x2eb272){if(_0x2eb272){var _0x4b3412=typeof _0x1403c8['offset']==='undefined'&&typeof _0x1403c8[_0x5a63('0x1b')]===_0x5a63('0x1c');var _0x511428=_0x2eb272[_0x5a63('0x1d')];var _0x134a0f=_0x4b3412?0x0:_0x1403c8[_0x5a63('0x1e')];var _0x218414=_0x4b3412?_0x2eb272[_0x5a63('0x1d')]:_0x1403c8[_0x5a63('0x1e')]+_0x1403c8[_0x5a63('0x1b')];var _0x1087c0;if(_0x218414>=_0x511428){_0x218414=_0x511428;_0x1087c0=0xc8;}else{_0x1087c0=0xce;}_0x13feda[_0x5a63('0x1f')](_0x1087c0);return _0x13feda[_0x5a63('0x20')]('Content-Range',_0x134a0f+'-'+_0x218414+'/'+_0x511428)[_0x5a63('0x1a')](_0x2eb272);}return null;};}function patchUpdates(_0x236442){return function(_0x14880c){try{jsonpatch['apply'](_0x14880c,_0x236442,!![]);}catch(_0x45572a){return BPromise['reject'](_0x45572a);}return _0x14880c[_0x5a63('0x21')]();};}function saveUpdates(_0xe89919,_0x16e21f){return function(_0x883d4f){if(_0x883d4f){return _0x883d4f['update'](_0xe89919)[_0x5a63('0x22')](function(_0x45de0d){return _0x45de0d;});}return null;};}function removeEntity(_0x4a58e2,_0x225ac6){return function(_0x158b0a){if(_0x158b0a){return _0x158b0a[_0x5a63('0x23')]()[_0x5a63('0x22')](function(){_0x4a58e2['status'](0xcc)[_0x5a63('0x24')]();});}};}function handleEntityNotFound(_0x5e8213,_0x40fae3){return function(_0x11fbef){if(!_0x11fbef){_0x5e8213[_0x5a63('0x19')](0x194);}return _0x11fbef;};}function handleError(_0xedda67,_0x4e1add){_0x4e1add=_0x4e1add||0x1f4;return function(_0x2fb75a){logger[_0x5a63('0x25')](_0x2fb75a['stack']);if(_0x2fb75a[_0x5a63('0x26')]){delete _0x2fb75a[_0x5a63('0x26')];}_0xedda67[_0x5a63('0x1f')](_0x4e1add)[_0x5a63('0x27')](_0x2fb75a);};}exports[_0x5a63('0x28')]=function(_0x10f575,_0x541848){var _0x30a7ed={},_0x144e52={},_0x83ddec={'count':0x0,'rows':[]};var _0x371c68=_['map'](db[_0x5a63('0x29')]['rawAttributes'],function(_0x32362e){return{'name':_0x32362e[_0x5a63('0x2a')],'type':_0x32362e['type'][_0x5a63('0x2b')]};});_0x144e52[_0x5a63('0x2c')]=_[_0x5a63('0x2d')](_0x371c68,'name');_0x144e52[_0x5a63('0x2e')]=_['keys'](_0x10f575[_0x5a63('0x2e')]);_0x144e52[_0x5a63('0x2f')]=_['intersection'](_0x144e52[_0x5a63('0x2c')],_0x144e52[_0x5a63('0x2e')]);_0x30a7ed[_0x5a63('0x30')]=_[_0x5a63('0x31')](_0x144e52[_0x5a63('0x2c')],qs[_0x5a63('0x32')](_0x10f575[_0x5a63('0x2e')][_0x5a63('0x32')]));_0x30a7ed[_0x5a63('0x30')]=_0x30a7ed['attributes'][_0x5a63('0x33')]?_0x30a7ed[_0x5a63('0x30')]:_0x144e52[_0x5a63('0x2c')];if(!_0x10f575[_0x5a63('0x2e')][_0x5a63('0x34')]('nolimit')){_0x30a7ed['limit']=qs[_0x5a63('0x1b')](_0x10f575['query']['limit']);_0x30a7ed[_0x5a63('0x1e')]=qs[_0x5a63('0x1e')](_0x10f575[_0x5a63('0x2e')]['offset']);}_0x30a7ed[_0x5a63('0x35')]=qs[_0x5a63('0x36')](_0x10f575[_0x5a63('0x2e')][_0x5a63('0x36')]);_0x30a7ed[_0x5a63('0x37')]=qs[_0x5a63('0x2f')](_[_0x5a63('0x38')](_0x10f575[_0x5a63('0x2e')],_0x144e52['filters']),_0x371c68);if(_0x10f575[_0x5a63('0x2e')][_0x5a63('0x39')]){_0x30a7ed['where']=_[_0x5a63('0x3a')](_0x30a7ed[_0x5a63('0x37')],{'$or':_[_0x5a63('0x2d')](_0x371c68,function(_0x37cdae){if(_0x37cdae[_0x5a63('0x3b')]!==_0x5a63('0x3c')){var _0x57a239={};_0x57a239[_0x37cdae[_0x5a63('0x26')]]={'$like':'%'+_0x10f575[_0x5a63('0x2e')][_0x5a63('0x39')]+'%'};return _0x57a239;}})});}_0x30a7ed=_['merge']({},_0x30a7ed,_0x10f575[_0x5a63('0x3d')]);var _0x2cf9c4={'where':_0x30a7ed[_0x5a63('0x37')]};return db['VtigerField']['count'](_0x2cf9c4)[_0x5a63('0x22')](function(_0x49976e){_0x83ddec['count']=_0x49976e;if(_0x10f575['query'][_0x5a63('0x3e')]){_0x30a7ed[_0x5a63('0x3f')]=[{'all':!![]}];}return db[_0x5a63('0x29')][_0x5a63('0x40')](_0x30a7ed);})[_0x5a63('0x22')](function(_0x401863){_0x83ddec[_0x5a63('0x41')]=_0x401863;return _0x83ddec;})[_0x5a63('0x22')](respondWithFilteredResult(_0x541848,_0x30a7ed))[_0x5a63('0x42')](handleError(_0x541848,null));};exports['show']=function(_0x4a89b9,_0x4ea44b){var _0x2a0bb9={'raw':!![],'where':{'id':_0x4a89b9[_0x5a63('0x43')]['id']}},_0x1380ee={};_0x1380ee[_0x5a63('0x2c')]=_[_0x5a63('0x44')](db[_0x5a63('0x29')][_0x5a63('0x45')]);_0x1380ee[_0x5a63('0x2e')]=_[_0x5a63('0x44')](_0x4a89b9[_0x5a63('0x2e')]);_0x1380ee[_0x5a63('0x2f')]=_[_0x5a63('0x31')](_0x1380ee[_0x5a63('0x2c')],_0x1380ee[_0x5a63('0x2e')]);_0x2a0bb9['attributes']=_[_0x5a63('0x31')](_0x1380ee['model'],qs[_0x5a63('0x32')](_0x4a89b9['query']['fields']));_0x2a0bb9[_0x5a63('0x30')]=_0x2a0bb9[_0x5a63('0x30')][_0x5a63('0x33')]?_0x2a0bb9[_0x5a63('0x30')]:_0x1380ee[_0x5a63('0x2c')];if(_0x4a89b9['query'][_0x5a63('0x3e')]){_0x2a0bb9[_0x5a63('0x3f')]=[{'all':!![]}];}_0x2a0bb9=_['merge']({},_0x2a0bb9,_0x4a89b9[_0x5a63('0x3d')]);return db[_0x5a63('0x29')][_0x5a63('0x46')](_0x2a0bb9)[_0x5a63('0x22')](handleEntityNotFound(_0x4ea44b,null))[_0x5a63('0x22')](respondWithResult(_0x4ea44b,null))[_0x5a63('0x42')](handleError(_0x4ea44b,null));};exports[_0x5a63('0x47')]=function(_0x226e55,_0x2a5265){return db[_0x5a63('0x29')]['create'](_0x226e55[_0x5a63('0x48')],{})[_0x5a63('0x22')](respondWithResult(_0x2a5265,0xc9))[_0x5a63('0x42')](handleError(_0x2a5265,null));};exports[_0x5a63('0x49')]=function(_0x39c87d,_0x45e324){if(_0x39c87d[_0x5a63('0x48')]['id']){delete _0x39c87d[_0x5a63('0x48')]['id'];}return db[_0x5a63('0x29')][_0x5a63('0x46')]({'where':{'id':_0x39c87d[_0x5a63('0x43')]['id']}})[_0x5a63('0x22')](handleEntityNotFound(_0x45e324,null))['then'](saveUpdates(_0x39c87d['body'],null))[_0x5a63('0x22')](respondWithResult(_0x45e324,null))[_0x5a63('0x42')](handleError(_0x45e324,null));};exports[_0x5a63('0x23')]=function(_0x5ddd54,_0x41e06b){return db[_0x5a63('0x29')][_0x5a63('0x46')]({'where':{'id':_0x5ddd54[_0x5a63('0x43')]['id']}})[_0x5a63('0x22')](handleEntityNotFound(_0x41e06b,null))['then'](removeEntity(_0x41e06b,null))['catch'](handleError(_0x41e06b,null));}; \ No newline at end of file +var _0x9ba9=['order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','sendStatus','error','stack','name','index','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0x9ba9,0x190));var _0x99ba=function(_0x504257,_0x8fef1e){_0x504257=_0x504257-0x0;var _0x5f1215=_0x9ba9[_0x504257];return _0x5f1215;};'use strict';var emlformat=require(_0x99ba('0x0'));var rimraf=require(_0x99ba('0x1'));var zipdir=require(_0x99ba('0x2'));var jsonpatch=require(_0x99ba('0x3'));var rp=require(_0x99ba('0x4'));var moment=require(_0x99ba('0x5'));var BPromise=require(_0x99ba('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x99ba('0x7'));var sox=require('sox');var csv=require(_0x99ba('0x8'));var ejs=require(_0x99ba('0x9'));var fs=require('fs');var fs_extra=require(_0x99ba('0xa'));var _=require(_0x99ba('0xb'));var squel=require(_0x99ba('0xc'));var crypto=require(_0x99ba('0xd'));var jsforce=require(_0x99ba('0xe'));var deskjs=require(_0x99ba('0xf'));var toCsv=require(_0x99ba('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99ba('0x10'));var authService=require(_0x99ba('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x99ba('0x12'));var hardwareService=require(_0x99ba('0x13'));var logger=require(_0x99ba('0x14'))(_0x99ba('0x15'));var utils=require(_0x99ba('0x16'));var config=require(_0x99ba('0x17'));var licenseUtil=require(_0x99ba('0x18'));var db=require(_0x99ba('0x19'))['db'];function respondWithStatusCode(_0x567355,_0x15c86e){_0x15c86e=_0x15c86e||0xcc;return function(_0x2318a9){if(_0x2318a9){return _0x567355['sendStatus'](_0x15c86e);}return _0x567355[_0x99ba('0x1a')](_0x15c86e)[_0x99ba('0x1b')]();};}function respondWithResult(_0x3d7759,_0x359b27){_0x359b27=_0x359b27||0xc8;return function(_0x15061f){if(_0x15061f){return _0x3d7759[_0x99ba('0x1a')](_0x359b27)[_0x99ba('0x1c')](_0x15061f);}};}function respondWithFilteredResult(_0x16d50b,_0x5859dd){return function(_0x2ff31b){if(_0x2ff31b){var _0x4fe052=typeof _0x5859dd[_0x99ba('0x1d')]===_0x99ba('0x1e')&&typeof _0x5859dd['limit']===_0x99ba('0x1e');var _0x455b22=_0x2ff31b[_0x99ba('0x1f')];var _0x22ef4d=_0x4fe052?0x0:_0x5859dd[_0x99ba('0x1d')];var _0xf36910=_0x4fe052?_0x2ff31b['count']:_0x5859dd['offset']+_0x5859dd[_0x99ba('0x20')];var _0x7c6b;if(_0xf36910>=_0x455b22){_0xf36910=_0x455b22;_0x7c6b=0xc8;}else{_0x7c6b=0xce;}_0x16d50b[_0x99ba('0x1a')](_0x7c6b);return _0x16d50b['set']('Content-Range',_0x22ef4d+'-'+_0xf36910+'/'+_0x455b22)['json'](_0x2ff31b);}return null;};}function patchUpdates(_0x4a0a21){return function(_0x35e93f){try{jsonpatch[_0x99ba('0x21')](_0x35e93f,_0x4a0a21,!![]);}catch(_0x4f8663){return BPromise[_0x99ba('0x22')](_0x4f8663);}return _0x35e93f[_0x99ba('0x23')]();};}function saveUpdates(_0x28ee96,_0x24d34f){return function(_0x1b337c){if(_0x1b337c){return _0x1b337c[_0x99ba('0x24')](_0x28ee96)[_0x99ba('0x25')](function(_0x107ef1){return _0x107ef1;});}return null;};}function removeEntity(_0x39ce15,_0x403711){return function(_0xbcce2f){if(_0xbcce2f){return _0xbcce2f['destroy']()[_0x99ba('0x25')](function(){_0x39ce15[_0x99ba('0x1a')](0xcc)[_0x99ba('0x1b')]();});}};}function handleEntityNotFound(_0x49bf98,_0x481b5){return function(_0x262b21){if(!_0x262b21){_0x49bf98[_0x99ba('0x26')](0x194);}return _0x262b21;};}function handleError(_0x2f7e82,_0x52fc66){_0x52fc66=_0x52fc66||0x1f4;return function(_0x5b9101){logger[_0x99ba('0x27')](_0x5b9101[_0x99ba('0x28')]);if(_0x5b9101[_0x99ba('0x29')]){delete _0x5b9101[_0x99ba('0x29')];}_0x2f7e82[_0x99ba('0x1a')](_0x52fc66)['send'](_0x5b9101);};}exports[_0x99ba('0x2a')]=function(_0x22d2c2,_0x1f814d){var _0x25f542={},_0x22fdec={},_0xbf2a25={'count':0x0,'rows':[]};var _0x57fbc2=_['map'](db[_0x99ba('0x2b')][_0x99ba('0x2c')],function(_0x16e27d){return{'name':_0x16e27d[_0x99ba('0x2d')],'type':_0x16e27d[_0x99ba('0x2e')][_0x99ba('0x2f')]};});_0x22fdec[_0x99ba('0x30')]=_[_0x99ba('0x31')](_0x57fbc2,'name');_0x22fdec[_0x99ba('0x32')]=_[_0x99ba('0x33')](_0x22d2c2[_0x99ba('0x32')]);_0x22fdec['filters']=_[_0x99ba('0x34')](_0x22fdec[_0x99ba('0x30')],_0x22fdec[_0x99ba('0x32')]);_0x25f542[_0x99ba('0x35')]=_[_0x99ba('0x34')](_0x22fdec['model'],qs['fields'](_0x22d2c2[_0x99ba('0x32')]['fields']));_0x25f542['attributes']=_0x25f542[_0x99ba('0x35')][_0x99ba('0x36')]?_0x25f542['attributes']:_0x22fdec[_0x99ba('0x30')];if(!_0x22d2c2[_0x99ba('0x32')][_0x99ba('0x37')]('nolimit')){_0x25f542['limit']=qs['limit'](_0x22d2c2[_0x99ba('0x32')][_0x99ba('0x20')]);_0x25f542[_0x99ba('0x1d')]=qs[_0x99ba('0x1d')](_0x22d2c2[_0x99ba('0x32')][_0x99ba('0x1d')]);}_0x25f542[_0x99ba('0x38')]=qs[_0x99ba('0x39')](_0x22d2c2[_0x99ba('0x32')][_0x99ba('0x39')]);_0x25f542[_0x99ba('0x3a')]=qs[_0x99ba('0x3b')](_[_0x99ba('0x3c')](_0x22d2c2[_0x99ba('0x32')],_0x22fdec[_0x99ba('0x3b')]),_0x57fbc2);if(_0x22d2c2[_0x99ba('0x32')][_0x99ba('0x3d')]){_0x25f542['where']=_[_0x99ba('0x3e')](_0x25f542[_0x99ba('0x3a')],{'$or':_['map'](_0x57fbc2,function(_0xb32e45){if(_0xb32e45[_0x99ba('0x2e')]!=='VIRTUAL'){var _0x1bd6fd={};_0x1bd6fd[_0xb32e45[_0x99ba('0x29')]]={'$like':'%'+_0x22d2c2[_0x99ba('0x32')]['filter']+'%'};return _0x1bd6fd;}})});}_0x25f542=_[_0x99ba('0x3e')]({},_0x25f542,_0x22d2c2[_0x99ba('0x3f')]);var _0x5eb168={'where':_0x25f542[_0x99ba('0x3a')]};return db[_0x99ba('0x2b')][_0x99ba('0x1f')](_0x5eb168)[_0x99ba('0x25')](function(_0x523792){_0xbf2a25[_0x99ba('0x1f')]=_0x523792;if(_0x22d2c2[_0x99ba('0x32')][_0x99ba('0x40')]){_0x25f542[_0x99ba('0x41')]=[{'all':!![]}];}return db[_0x99ba('0x2b')][_0x99ba('0x42')](_0x25f542);})[_0x99ba('0x25')](function(_0x461417){_0xbf2a25[_0x99ba('0x43')]=_0x461417;return _0xbf2a25;})[_0x99ba('0x25')](respondWithFilteredResult(_0x1f814d,_0x25f542))[_0x99ba('0x44')](handleError(_0x1f814d,null));};exports[_0x99ba('0x45')]=function(_0x19e71a,_0x497ce1){var _0x2300e9={'raw':!![],'where':{'id':_0x19e71a[_0x99ba('0x46')]['id']}},_0x409c21={};_0x409c21[_0x99ba('0x30')]=_[_0x99ba('0x33')](db['VtigerField'][_0x99ba('0x2c')]);_0x409c21[_0x99ba('0x32')]=_[_0x99ba('0x33')](_0x19e71a[_0x99ba('0x32')]);_0x409c21[_0x99ba('0x3b')]=_[_0x99ba('0x34')](_0x409c21['model'],_0x409c21[_0x99ba('0x32')]);_0x2300e9[_0x99ba('0x35')]=_['intersection'](_0x409c21[_0x99ba('0x30')],qs['fields'](_0x19e71a[_0x99ba('0x32')][_0x99ba('0x47')]));_0x2300e9[_0x99ba('0x35')]=_0x2300e9['attributes'][_0x99ba('0x36')]?_0x2300e9['attributes']:_0x409c21[_0x99ba('0x30')];if(_0x19e71a[_0x99ba('0x32')][_0x99ba('0x40')]){_0x2300e9['include']=[{'all':!![]}];}_0x2300e9=_['merge']({},_0x2300e9,_0x19e71a['options']);return db['VtigerField'][_0x99ba('0x48')](_0x2300e9)[_0x99ba('0x25')](handleEntityNotFound(_0x497ce1,null))[_0x99ba('0x25')](respondWithResult(_0x497ce1,null))[_0x99ba('0x44')](handleError(_0x497ce1,null));};exports['create']=function(_0x147b88,_0x194b22){return db[_0x99ba('0x2b')][_0x99ba('0x49')](_0x147b88[_0x99ba('0x4a')],{})[_0x99ba('0x25')](respondWithResult(_0x194b22,0xc9))[_0x99ba('0x44')](handleError(_0x194b22,null));};exports[_0x99ba('0x24')]=function(_0x44be16,_0x2c4274){if(_0x44be16['body']['id']){delete _0x44be16[_0x99ba('0x4a')]['id'];}return db[_0x99ba('0x2b')][_0x99ba('0x48')]({'where':{'id':_0x44be16['params']['id']}})[_0x99ba('0x25')](handleEntityNotFound(_0x2c4274,null))[_0x99ba('0x25')](saveUpdates(_0x44be16[_0x99ba('0x4a')],null))['then'](respondWithResult(_0x2c4274,null))[_0x99ba('0x44')](handleError(_0x2c4274,null));};exports[_0x99ba('0x4b')]=function(_0x5505cb,_0x1a5df9){return db[_0x99ba('0x2b')][_0x99ba('0x48')]({'where':{'id':_0x5505cb[_0x99ba('0x46')]['id']}})[_0x99ba('0x25')](handleEntityNotFound(_0x1a5df9,null))[_0x99ba('0x25')](removeEntity(_0x1a5df9,null))['catch'](handleError(_0x1a5df9,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 9660326..aca9d9a 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 _0x5655=['../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x32dd80,_0x4b94cb){var _0x1c7198=function(_0x450916){while(--_0x450916){_0x32dd80['push'](_0x32dd80['shift']());}};_0x1c7198(++_0x4b94cb);}(_0x5655,0xd9));var _0x5565=function(_0x12d0d2,_0x2ffc6d){_0x12d0d2=_0x12d0d2-0x0;var _0x4aec05=_0x5655[_0x12d0d2];return _0x4aec05;};'use strict';var _=require(_0x5565('0x0'));var util=require(_0x5565('0x1'));var logger=require(_0x5565('0x2'))(_0x5565('0x3'));var moment=require(_0x5565('0x4'));var BPromise=require(_0x5565('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5565('0x6'));var config=require(_0x5565('0x7'));var attributes=require(_0x5565('0x8'));module[_0x5565('0x9')]=function(_0x5f4c52,_0x5d8cf2){return _0x5f4c52['define'](_0x5565('0xa'),attributes,{'tableName':_0x5565('0xb'),'paranoid':![],'indexes':[{'name':_0x5565('0xc'),'fields':['idField',_0x5565('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x24f5=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x24f5,0x1da));var _0x524f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x24f5[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x524f('0x0'));var util=require(_0x524f('0x1'));var logger=require(_0x524f('0x2'))('api');var moment=require(_0x524f('0x3'));var BPromise=require('bluebird');var rp=require(_0x524f('0x4'));var fs=require('fs');var path=require(_0x524f('0x5'));var rimraf=require(_0x524f('0x6'));var config=require(_0x524f('0x7'));var attributes=require(_0x524f('0x8'));module[_0x524f('0x9')]=function(_0x2be9c7,_0x5449a3){return _0x2be9c7['define']('VtigerField',attributes,{'tableName':_0x524f('0xa'),'paranoid':![],'indexes':[{'name':_0x524f('0xb'),'fields':[_0x524f('0xc'),_0x524f('0xd')],'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 1ccae0e..fa31239 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 _0xc11a=['client','http','then','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x56c2d5,_0x3908fe){var _0x2e2133=function(_0x5d94e9){while(--_0x5d94e9){_0x56c2d5['push'](_0x56c2d5['shift']());}};_0x2e2133(++_0x3908fe);}(_0xc11a,0x1b1));var _0xac11=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0xc11a[_0x21f931];return _0x3f083c;};'use strict';var _=require('lodash');var util=require(_0xac11('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xac11('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac11('0x2'))['db'];var utils=require(_0xac11('0x3'));var logger=require(_0xac11('0x4'))('rpc');var config=require(_0xac11('0x5'));var jayson=require(_0xac11('0x6'));var client=jayson[_0xac11('0x7')][_0xac11('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31bee4,_0x5cf97d,_0x3adff5){return new BPromise(function(_0x46c151,_0x53a0db){return client['request'](_0x31bee4,_0x3adff5)[_0xac11('0x9')](function(_0x44a7ba){logger[_0xac11('0xa')](_0xac11('0xb'),_0x5cf97d,'request\x20sent');logger['debug'](_0xac11('0xc'),_0x5cf97d,_0xac11('0xd'),JSON[_0xac11('0xe')](_0x44a7ba));if(_0x44a7ba[_0xac11('0xf')]){if(_0x44a7ba[_0xac11('0xf')][_0xac11('0x10')]===0x1f4){logger[_0xac11('0xf')](_0xac11('0xb'),_0x5cf97d,_0x44a7ba[_0xac11('0xf')]['message']);return _0x53a0db(_0x44a7ba['error']['message']);}logger['error'](_0xac11('0xb'),_0x5cf97d,_0x44a7ba[_0xac11('0xf')]['message']);return _0x46c151(_0x44a7ba[_0xac11('0xf')][_0xac11('0x11')]);}else{logger[_0xac11('0xa')](_0xac11('0xb'),_0x5cf97d,_0xac11('0xd'));_0x46c151(_0x44a7ba[_0xac11('0x12')][_0xac11('0x11')]);}})[_0xac11('0x13')](function(_0xc62482){logger['error']('VtigerField,\x20%s,\x20%s',_0x5cf97d,_0xc62482);_0x53a0db(_0xc62482);});});} \ No newline at end of file +var _0x8dd9=['catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x8dd9,0x1a5));var _0x98dd=function(_0x2bce0a,_0x34ac2a){_0x2bce0a=_0x2bce0a-0x0;var _0x2f06ca=_0x8dd9[_0x2bce0a];return _0x2f06ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x98dd('0x0'));var fs=require('fs');var Redis=require(_0x98dd('0x1'));var db=require(_0x98dd('0x2'))['db'];var utils=require(_0x98dd('0x3'));var logger=require(_0x98dd('0x4'))('rpc');var config=require(_0x98dd('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x98dd('0x6')][_0x98dd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e37d4,_0xf93c98,_0x101986){return new BPromise(function(_0x2a96e9,_0x49aa2f){return client[_0x98dd('0x8')](_0x1e37d4,_0x101986)[_0x98dd('0x9')](function(_0x31d829){logger[_0x98dd('0xa')](_0x98dd('0xb'),_0xf93c98,_0x98dd('0xc'));logger[_0x98dd('0xd')](_0x98dd('0xe'),_0xf93c98,_0x98dd('0xc'),JSON[_0x98dd('0xf')](_0x31d829));if(_0x31d829[_0x98dd('0x10')]){if(_0x31d829['error'][_0x98dd('0x11')]===0x1f4){logger[_0x98dd('0x10')]('VtigerField,\x20%s,\x20%s',_0xf93c98,_0x31d829[_0x98dd('0x10')][_0x98dd('0x12')]);return _0x49aa2f(_0x31d829[_0x98dd('0x10')]['message']);}logger[_0x98dd('0x10')]('VtigerField,\x20%s,\x20%s',_0xf93c98,_0x31d829['error'][_0x98dd('0x12')]);return _0x2a96e9(_0x31d829[_0x98dd('0x10')][_0x98dd('0x12')]);}else{logger[_0x98dd('0xa')](_0x98dd('0xb'),_0xf93c98,'request\x20sent');_0x2a96e9(_0x31d829[_0x98dd('0x13')]['message']);}})[_0x98dd('0x14')](function(_0x278623){logger[_0x98dd('0x10')](_0x98dd('0xb'),_0xf93c98,_0x278623);_0x49aa2f(_0x278623);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 43086cf..2c9a259 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 _0xc0a4=['show','/:id/configurations','getFields','post','create','addConfiguration','put','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index'];(function(_0xca9b1c,_0xdd3855){var _0xf76968=function(_0xf34ec0){while(--_0xf34ec0){_0xca9b1c['push'](_0xca9b1c['shift']());}};_0xf76968(++_0xdd3855);}(_0xc0a4,0xc6));var _0x4c0a=function(_0x4ea71e,_0x2c0956){_0x4ea71e=_0x4ea71e-0x0;var _0x47d9ff=_0xc0a4[_0x4ea71e];return _0x47d9ff;};'use strict';var multer=require(_0x4c0a('0x0'));var util=require(_0x4c0a('0x1'));var path=require('path');var timeout=require(_0x4c0a('0x2'));var express=require('express');var router=express[_0x4c0a('0x3')]();var fs_extra=require(_0x4c0a('0x4'));var auth=require(_0x4c0a('0x5'));var interaction=require(_0x4c0a('0x6'));var config=require(_0x4c0a('0x7'));var controller=require(_0x4c0a('0x8'));router[_0x4c0a('0x9')]('/',auth[_0x4c0a('0xa')](),controller[_0x4c0a('0xb')]);router[_0x4c0a('0x9')]('/:id',auth[_0x4c0a('0xa')](),controller[_0x4c0a('0xc')]);router['get'](_0x4c0a('0xd'),auth[_0x4c0a('0xa')](),controller['getConfigurations']);router[_0x4c0a('0x9')]('/:id/fields',auth[_0x4c0a('0xa')](),controller[_0x4c0a('0xe')]);router[_0x4c0a('0xf')]('/',auth[_0x4c0a('0xa')](),controller[_0x4c0a('0x10')]);router[_0x4c0a('0xf')](_0x4c0a('0xd'),auth['isAuthenticated'](),controller[_0x4c0a('0x11')]);router[_0x4c0a('0x12')]('/:id',auth[_0x4c0a('0xa')](),controller['update']);router['delete']('/:id',auth[_0x4c0a('0xa')](),controller[_0x4c0a('0x13')]);module[_0x4c0a('0x14')]=router; \ No newline at end of file +var _0xb182=['./intZendeskAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb182,0x19a));var _0x2b18=function(_0x143565,_0x54d887){_0x143565=_0x143565-0x0;var _0x4dc1d9=_0xb182[_0x143565];return _0x4dc1d9;};'use strict';var multer=require(_0x2b18('0x0'));var util=require('util');var path=require(_0x2b18('0x1'));var timeout=require('connect-timeout');var express=require(_0x2b18('0x2'));var router=express[_0x2b18('0x3')]();var fs_extra=require(_0x2b18('0x4'));var auth=require(_0x2b18('0x5'));var interaction=require(_0x2b18('0x6'));var config=require(_0x2b18('0x7'));var controller=require(_0x2b18('0x8'));router[_0x2b18('0x9')]('/',auth[_0x2b18('0xa')](),controller['index']);router[_0x2b18('0x9')]('/:id',auth[_0x2b18('0xa')](),controller['show']);router['get'](_0x2b18('0xb'),auth[_0x2b18('0xa')](),controller[_0x2b18('0xc')]);router[_0x2b18('0x9')](_0x2b18('0xd'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x2b18('0xa')](),controller[_0x2b18('0xe')]);router['post'](_0x2b18('0xb'),auth['isAuthenticated'](),controller[_0x2b18('0xf')]);router[_0x2b18('0x10')](_0x2b18('0x11'),auth['isAuthenticated'](),controller[_0x2b18('0x12')]);router[_0x2b18('0x13')](_0x2b18('0x11'),auth['isAuthenticated'](),controller[_0x2b18('0x14')]);module[_0x2b18('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index ac463c3..7ee1b73 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 _0x8aad=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','token','password'];(function(_0x207fb9,_0x44038b){var _0x564985=function(_0xc8a74e){while(--_0xc8a74e){_0x207fb9['push'](_0x207fb9['shift']());}};_0x564985(++_0x44038b);}(_0x8aad,0x146));var _0xd8aa=function(_0x1919f3,_0x318a4e){_0x1919f3=_0x1919f3-0x0;var _0x2c4234=_0x8aad[_0x1919f3];return _0x2c4234;};'use strict';var Sequelize=require(_0xd8aa('0x0'));module[_0xd8aa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8aa('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xd8aa('0x3')},'password':{'type':Sequelize[_0xd8aa('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd8aa('0x4')},'authType':{'type':Sequelize['ENUM']('password',_0xd8aa('0x5')),'defaultValue':_0xd8aa('0x6')},'serverUrl':{'type':Sequelize[_0xd8aa('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd8aa('0x7'),_0xd8aa('0x8')),'defaultValue':_0xd8aa('0x7')}}; \ No newline at end of file +var _0xa809=['integrationTab','exports','STRING','remoteUri','ENUM','password'];(function(_0x47ef7e,_0x2cbbcd){var _0x2902f5=function(_0x2ea2b1){while(--_0x2ea2b1){_0x47ef7e['push'](_0x47ef7e['shift']());}};_0x2902f5(++_0x2cbbcd);}(_0xa809,0x1f3));var _0x9a80=function(_0x10346c,_0x3341fa){_0x10346c=_0x10346c-0x0;var _0x4cffe2=_0xa809[_0x10346c];return _0x4cffe2;};'use strict';var Sequelize=require('sequelize');module[_0x9a80('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9a80('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9a80('0x1')],'unique':_0x9a80('0x2')},'authType':{'type':Sequelize[_0x9a80('0x3')](_0x9a80('0x4'),'token'),'defaultValue':_0x9a80('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9a80('0x3')](_0x9a80('0x5'),'newTab'),'defaultValue':_0x9a80('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 8c4d5b4..96f0a54 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 _0x6324=['error','name','send','index','ZendeskAccount','key','model','map','keys','query','intersection','fields','attributes','length','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZendeskField','Subjects','Descriptions','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','assignee','remove','includes','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0xd7936d,_0xa7eecc){var _0x10149b=function(_0x3f4508){while(--_0x3f4508){_0xd7936d['push'](_0xd7936d['shift']());}};_0x10149b(++_0xa7eecc);}(_0x6324,0x142));var _0x4632=function(_0x4baac3,_0x481c9a){_0x4baac3=_0x4baac3-0x0;var _0x4fb4bc=_0x6324[_0x4baac3];return _0x4fb4bc;};'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'];var integrations=require(_0x4632('0x18'));function respondWithStatusCode(_0x499d88,_0x4719f7){_0x4719f7=_0x4719f7||0xcc;return function(_0x299073){if(_0x299073){return _0x499d88[_0x4632('0x19')](_0x4719f7);}return _0x499d88[_0x4632('0x1a')](_0x4719f7)['end']();};}function respondWithResult(_0x3ba361,_0x255882){_0x255882=_0x255882||0xc8;return function(_0x3b9901){if(_0x3b9901){return _0x3ba361[_0x4632('0x1a')](_0x255882)[_0x4632('0x1b')](_0x3b9901);}};}function respondWithFilteredResult(_0x5438ab,_0x47b349){return function(_0x2fd7ae){if(_0x2fd7ae){var _0x38bedd=typeof _0x47b349[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x47b349['limit']===_0x4632('0x1d');var _0x113872=_0x2fd7ae[_0x4632('0x1e')];var _0x5b28b7=_0x38bedd?0x0:_0x47b349[_0x4632('0x1c')];var _0x1894bb=_0x38bedd?_0x2fd7ae['count']:_0x47b349['offset']+_0x47b349[_0x4632('0x1f')];var _0x3cf2bd;if(_0x1894bb>=_0x113872){_0x1894bb=_0x113872;_0x3cf2bd=0xc8;}else{_0x3cf2bd=0xce;}_0x5438ab[_0x4632('0x1a')](_0x3cf2bd);return _0x5438ab[_0x4632('0x20')](_0x4632('0x21'),_0x5b28b7+'-'+_0x1894bb+'/'+_0x113872)[_0x4632('0x1b')](_0x2fd7ae);}return null;};}function patchUpdates(_0x9ab826){return function(_0x468ccb){try{jsonpatch[_0x4632('0x22')](_0x468ccb,_0x9ab826,!![]);}catch(_0x3ea0d1){return BPromise[_0x4632('0x23')](_0x3ea0d1);}return _0x468ccb[_0x4632('0x24')]();};}function saveUpdates(_0x2ca6a5,_0x263907){return function(_0x4cfebc){if(_0x4cfebc){return _0x4cfebc[_0x4632('0x25')](_0x2ca6a5)[_0x4632('0x26')](function(_0x3537ed){return _0x3537ed;});}return null;};}function removeEntity(_0x380a9f,_0x1e1b86){return function(_0x38cbbc){if(_0x38cbbc){return _0x38cbbc[_0x4632('0x27')]()[_0x4632('0x26')](function(){_0x380a9f[_0x4632('0x1a')](0xcc)[_0x4632('0x28')]();});}};}function handleEntityNotFound(_0x1b8de0,_0x4af026){return function(_0x2e3428){if(!_0x2e3428){_0x1b8de0[_0x4632('0x19')](0x194);}return _0x2e3428;};}function handleError(_0x372679,_0x22d0f5){_0x22d0f5=_0x22d0f5||0x1f4;return function(_0x2a0b11){logger[_0x4632('0x29')](_0x2a0b11['stack']);if(_0x2a0b11['name']){delete _0x2a0b11[_0x4632('0x2a')];}_0x372679[_0x4632('0x1a')](_0x22d0f5)[_0x4632('0x2b')](_0x2a0b11);};}exports[_0x4632('0x2c')]=function(_0x34079f,_0x119d1b){var _0x3570b2={},_0x5e2ee4={},_0x42d505={'count':0x0,'rows':[]};var _0x135fd2=_['map'](db[_0x4632('0x2d')]['rawAttributes'],function(_0x6599ad){return{'name':_0x6599ad['fieldName'],'type':_0x6599ad['type'][_0x4632('0x2e')]};});_0x5e2ee4[_0x4632('0x2f')]=_[_0x4632('0x30')](_0x135fd2,'name');_0x5e2ee4['query']=_[_0x4632('0x31')](_0x34079f[_0x4632('0x32')]);_0x5e2ee4['filters']=_['intersection'](_0x5e2ee4[_0x4632('0x2f')],_0x5e2ee4[_0x4632('0x32')]);_0x3570b2['attributes']=_[_0x4632('0x33')](_0x5e2ee4[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x34079f[_0x4632('0x32')][_0x4632('0x34')]));_0x3570b2['attributes']=_0x3570b2[_0x4632('0x35')][_0x4632('0x36')]?_0x3570b2['attributes']:_0x5e2ee4['model'];if(!_0x34079f[_0x4632('0x32')]['hasOwnProperty']('nolimit')){_0x3570b2[_0x4632('0x1f')]=qs['limit'](_0x34079f[_0x4632('0x32')][_0x4632('0x1f')]);_0x3570b2[_0x4632('0x1c')]=qs['offset'](_0x34079f[_0x4632('0x32')][_0x4632('0x1c')]);}_0x3570b2[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x34079f[_0x4632('0x32')]['sort']);_0x3570b2['where']=qs[_0x4632('0x39')](_[_0x4632('0x3a')](_0x34079f[_0x4632('0x32')],_0x5e2ee4['filters']),_0x135fd2);if(_0x34079f['query']['filter']){_0x3570b2[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0x3570b2['where'],{'$or':_[_0x4632('0x30')](_0x135fd2,function(_0x20a700){if(_0x20a700[_0x4632('0x3d')]!==_0x4632('0x3e')){var _0x2309f1={};_0x2309f1[_0x20a700[_0x4632('0x2a')]]={'$like':'%'+_0x34079f[_0x4632('0x32')][_0x4632('0x3f')]+'%'};return _0x2309f1;}})});}_0x3570b2=_[_0x4632('0x3c')]({},_0x3570b2,_0x34079f[_0x4632('0x40')]);var _0x1fd3f1={'where':_0x3570b2[_0x4632('0x3b')]};return db['ZendeskAccount'][_0x4632('0x1e')](_0x1fd3f1)[_0x4632('0x26')](function(_0x4c0e13){_0x42d505[_0x4632('0x1e')]=_0x4c0e13;if(_0x34079f[_0x4632('0x32')]['includeAll']){_0x3570b2[_0x4632('0x41')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x4632('0x42')](_0x3570b2);})[_0x4632('0x26')](function(_0x1bfb36){_0x42d505[_0x4632('0x43')]=_0x1bfb36;return _0x42d505;})['then'](respondWithFilteredResult(_0x119d1b,_0x3570b2))[_0x4632('0x44')](handleError(_0x119d1b,null));};exports[_0x4632('0x45')]=function(_0x23ef38,_0x279298){var _0x5cc716={'raw':![],'where':{'id':_0x23ef38[_0x4632('0x46')]['id']}},_0x5b3fa9={};_0x5b3fa9[_0x4632('0x2f')]=_[_0x4632('0x31')](db['ZendeskAccount'][_0x4632('0x47')]);_0x5b3fa9[_0x4632('0x32')]=_[_0x4632('0x31')](_0x23ef38[_0x4632('0x32')]);_0x5b3fa9[_0x4632('0x39')]=_[_0x4632('0x33')](_0x5b3fa9[_0x4632('0x2f')],_0x5b3fa9['query']);_0x5cc716[_0x4632('0x35')]=_[_0x4632('0x33')](_0x5b3fa9[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x23ef38[_0x4632('0x32')]['fields']));_0x5cc716['attributes']=_0x5cc716[_0x4632('0x35')][_0x4632('0x36')]?_0x5cc716[_0x4632('0x35')]:_0x5b3fa9[_0x4632('0x2f')];if(_0x23ef38['query'][_0x4632('0x48')]){_0x5cc716[_0x4632('0x41')]=[{'all':!![]}];}_0x5cc716=_[_0x4632('0x3c')]({},_0x5cc716,_0x23ef38[_0x4632('0x40')]);return db[_0x4632('0x2d')]['find'](_0x5cc716)[_0x4632('0x26')](handleEntityNotFound(_0x279298,null))[_0x4632('0x26')](respondWithResult(_0x279298,null))[_0x4632('0x44')](handleError(_0x279298,null));};exports[_0x4632('0x49')]=function(_0x3676fa,_0x2eb8b0){return db[_0x4632('0x2d')][_0x4632('0x49')](_0x3676fa[_0x4632('0x4a')],{})[_0x4632('0x26')](respondWithResult(_0x2eb8b0,0xc9))[_0x4632('0x44')](handleError(_0x2eb8b0,null));};exports['update']=function(_0xc3ffd0,_0x1ccadb){if(_0xc3ffd0[_0x4632('0x4a')]['id']){delete _0xc3ffd0['body']['id'];}return db[_0x4632('0x2d')][_0x4632('0x4b')]({'where':{'id':_0xc3ffd0[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x1ccadb,null))[_0x4632('0x26')](saveUpdates(_0xc3ffd0[_0x4632('0x4a')],null))[_0x4632('0x26')](respondWithResult(_0x1ccadb,null))[_0x4632('0x44')](handleError(_0x1ccadb,null));};exports[_0x4632('0x27')]=function(_0x1aa831,_0x4e89e3){return db[_0x4632('0x2d')][_0x4632('0x4b')]({'where':{'id':_0x1aa831['params']['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x4e89e3,null))[_0x4632('0x26')](removeEntity(_0x4e89e3,null))[_0x4632('0x44')](handleError(_0x4e89e3,null));};exports[_0x4632('0x4c')]=function(_0x2c59f5,_0xfeeac0,_0x248dcf){var _0xf4880f={};var _0x31b42d={};var _0x1b66e0;var _0x3e66d8;return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x2c59f5[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0xfeeac0,null))[_0x4632('0x26')](function(_0x32cd35){if(_0x32cd35){_0x1b66e0=_0x32cd35;_0x31b42d[_0x4632('0x2f')]=_[_0x4632('0x31')](db[_0x4632('0x4e')]['rawAttributes']);_0x31b42d[_0x4632('0x32')]=_[_0x4632('0x31')](_0x2c59f5[_0x4632('0x32')]);_0x31b42d[_0x4632('0x39')]=_[_0x4632('0x33')](_0x31b42d[_0x4632('0x2f')],_0x31b42d['query']);_0xf4880f[_0x4632('0x35')]=_[_0x4632('0x33')](_0x31b42d[_0x4632('0x2f')],qs['fields'](_0x2c59f5[_0x4632('0x32')][_0x4632('0x34')]));_0xf4880f['attributes']=_0xf4880f[_0x4632('0x35')][_0x4632('0x36')]?_0xf4880f[_0x4632('0x35')]:_0x31b42d['model'];_0xf4880f[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x2c59f5[_0x4632('0x32')][_0x4632('0x38')]);_0xf4880f[_0x4632('0x3b')]=qs[_0x4632('0x39')](_[_0x4632('0x3a')](_0x2c59f5[_0x4632('0x32')],_0x31b42d[_0x4632('0x39')]));if(_0x2c59f5[_0x4632('0x32')]['filter']){_0xf4880f[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0xf4880f['where'],{'$or':_[_0x4632('0x30')](_0xf4880f['attributes'],function(_0x48e942){var _0xa55d76={};_0xa55d76[_0x48e942]={'$like':'%'+_0x2c59f5[_0x4632('0x32')][_0x4632('0x3f')]+'%'};return _0xa55d76;})});}_0xf4880f=_[_0x4632('0x3c')]({},_0xf4880f,_0x2c59f5[_0x4632('0x40')]);return _0x1b66e0[_0x4632('0x4c')](_0xf4880f);}})[_0x4632('0x26')](function(_0x3e2849){if(_0x3e2849){_0x3e66d8=_0x3e2849[_0x4632('0x36')];if(!_0x2c59f5[_0x4632('0x32')][_0x4632('0x4f')](_0x4632('0x50'))){_0xf4880f[_0x4632('0x1f')]=qs[_0x4632('0x1f')](_0x2c59f5['query']['limit']);_0xf4880f[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x2c59f5[_0x4632('0x32')][_0x4632('0x1c')]);}return _0x1b66e0[_0x4632('0x4c')](_0xf4880f);}})[_0x4632('0x26')](function(_0x5b66ee){if(_0x5b66ee){return _0x5b66ee?{'count':_0x3e66d8,'rows':_0x5b66ee}:null;}})[_0x4632('0x26')](respondWithResult(_0xfeeac0,null))[_0x4632('0x44')](handleError(_0xfeeac0,null));};exports[_0x4632('0x51')]=function(_0x2e4d57,_0x5d1994,_0x529be1){if(_0x2e4d57[_0x4632('0x4a')]['id']){delete _0x2e4d57['body']['id'];}return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x2e4d57[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x5d1994,null))[_0x4632('0x26')](function(_0x5e5669){if(_0x5e5669){_0x2e4d57[_0x4632('0x4a')][_0x4632('0x52')]=_0x5e5669['id'];_0x2e4d57['body']['Subjects']=integrations[_0x4632('0x53')](_0x2e4d57[_0x4632('0x4a')][_0x4632('0x54')],_0x2e4d57[_0x4632('0x4a')]['type']);_0x2e4d57['body']['Descriptions']=integrations[_0x4632('0x55')](_0x2e4d57['body'][_0x4632('0x54')],_0x2e4d57[_0x4632('0x4a')][_0x4632('0x3d')]);return db[_0x4632('0x4e')][_0x4632('0x49')](_0x2e4d57[_0x4632('0x4a')],{'include':[{'model':db[_0x4632('0x56')],'as':_0x4632('0x57')},{'model':db[_0x4632('0x56')],'as':_0x4632('0x58')}]});}return null;})[_0x4632('0x26')](respondWithResult(_0x5d1994,null))[_0x4632('0x44')](handleError(_0x5d1994,null));};exports[_0x4632('0x59')]=function(_0x3d5e65,_0x461700,_0x1b2905){var _0x550c4d='';return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x3d5e65[_0x4632('0x46')]['id']},'attributes':['id',_0x4632('0x5a'),_0x4632('0x5b'),_0x4632('0x5c'),_0x4632('0x5d'),_0x4632('0x5e')]})[_0x4632('0x26')](handleEntityNotFound(_0x461700,null))[_0x4632('0x26')](function(_0x16ed40){if(_0x16ed40){_0x550c4d=_0x16ed40[_0x4632('0x5e')];var _0x27e2a6=_0x550c4d['slice'](-0x1);if(_0x27e2a6==='/'){_0x550c4d=_0x550c4d[_0x4632('0x5f')](0x0,_0x550c4d[_0x4632('0x60')](_0x27e2a6));}var _0x348af1={'method':_0x4632('0x61'),'uri':util[_0x4632('0x62')](_0x4632('0x63'),_0x550c4d,'ticket_fields'),'json':!![]};switch(_0x16ed40[_0x4632('0x5d')]){case _0x4632('0x5b'):_0x348af1['headers']={'Authorization':util[_0x4632('0x62')](_0x4632('0x64'),new Buffer(util[_0x4632('0x62')](_0x4632('0x65'),_0x16ed40[_0x4632('0x5a')],_0x16ed40['password']))[_0x4632('0x66')](_0x4632('0x67')))};break;case _0x4632('0x5c'):_0x348af1['headers']={'Authorization':util[_0x4632('0x62')](_0x4632('0x64'),new Buffer(util[_0x4632('0x62')](_0x4632('0x68'),_0x16ed40[_0x4632('0x5a')],_0x16ed40[_0x4632('0x5c')]))[_0x4632('0x66')](_0x4632('0x67')))};break;default:throw new db['Sequelize'][(_0x4632('0x69'))](_0x4632('0x6a'));}return rp(_0x348af1);}})[_0x4632('0x26')](function(_0x525bf9){if(_0x525bf9){var _0xfc48bd=[_0x4632('0x6b'),'description','group',_0x4632('0x6c')];_[_0x4632('0x6d')](_0x525bf9['ticket_fields'],function(_0x63d3e1){return _0xfc48bd[_0x4632('0x6e')](_0x63d3e1[_0x4632('0x3d')]);});return{'count':_0x525bf9[_0x4632('0x6f')][_0x4632('0x36')],'rows':_[_0x4632('0x30')](_0x525bf9[_0x4632('0x6f')],function(_0x130b52){return{'id':_0x130b52['id'],'name':_0x130b52['position']>0x7?_0x130b52[_0x4632('0x70')]:_0x130b52[_0x4632('0x3d')],'custom':_0x130b52[_0x4632('0x71')]>0x7?!![]:![],'options':_0x130b52[_0x4632('0x72')]?_0x130b52['system_field_options']:_0x130b52[_0x4632('0x73')]?_0x130b52[_0x4632('0x73')]:[]};})};}})[_0x4632('0x26')](respondWithResult(_0x461700,null))[_0x4632('0x44')](function(_0x3cee1d){var _0x4ca8a8=_0x3d5e65[_0x4632('0x32')][_0x4632('0x74')]?0x1f4:_0x3cee1d[_0x4632('0x75')]||0x1f4;logger[_0x4632('0x29')](_0x4632('0x76'),_0x4632('0x59'),_0x4ca8a8,JSON[_0x4632('0x77')](_0x3cee1d));delete _0x3cee1d[_0x4632('0x2a')];if(_0x4ca8a8===0x191){_0x4ca8a8=0x190;}_0x461700['status'](_0x4ca8a8)[_0x4632('0x2b')](_0x3d5e65[_0x4632('0x32')][_0x4632('0x74')]?{'message':_0x4632('0x78'),'statusCode':_0x3cee1d[_0x4632('0x75')]}:_0x3cee1d);});}; \ No newline at end of file +var _0x91a7=['includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskAccount','count','include','rows','params','keys','includeAll','find','catch','create','body','destroy','getConfigurations','ZendeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','findOne','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields'];(function(_0x3611da,_0x3af211){var _0xc81cd5=function(_0xcf4c7c){while(--_0xcf4c7c){_0x3611da['push'](_0x3611da['shift']());}};_0xc81cd5(++_0x3af211);}(_0x91a7,0xe7));var _0x791a=function(_0x41e81d,_0x2be61e){_0x41e81d=_0x41e81d-0x0;var _0x40292d=_0x91a7[_0x41e81d];return _0x40292d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5daecd,_0xc92016){_0xc92016=_0xc92016||0xcc;return function(_0x2f2d8d){if(_0x2f2d8d){return _0x5daecd['sendStatus'](_0xc92016);}return _0x5daecd[_0x791a('0x16')](_0xc92016)[_0x791a('0x17')]();};}function respondWithResult(_0x5d5b11,_0x2887f0){_0x2887f0=_0x2887f0||0xc8;return function(_0x31b86d){if(_0x31b86d){return _0x5d5b11[_0x791a('0x16')](_0x2887f0)[_0x791a('0x18')](_0x31b86d);}};}function respondWithFilteredResult(_0x55e845,_0x2ce2e0){return function(_0x575d11){if(_0x575d11){var _0x43dea6=typeof _0x2ce2e0[_0x791a('0x19')]==='undefined'&&typeof _0x2ce2e0[_0x791a('0x1a')]==='undefined';var _0x35fe48=_0x575d11['count'];var _0x4a84ee=_0x43dea6?0x0:_0x2ce2e0['offset'];var _0x40f0d3=_0x43dea6?_0x575d11['count']:_0x2ce2e0['offset']+_0x2ce2e0[_0x791a('0x1a')];var _0x5a702e;if(_0x40f0d3>=_0x35fe48){_0x40f0d3=_0x35fe48;_0x5a702e=0xc8;}else{_0x5a702e=0xce;}_0x55e845[_0x791a('0x16')](_0x5a702e);return _0x55e845[_0x791a('0x1b')]('Content-Range',_0x4a84ee+'-'+_0x40f0d3+'/'+_0x35fe48)[_0x791a('0x18')](_0x575d11);}return null;};}function patchUpdates(_0xcb5e66){return function(_0x234514){try{jsonpatch[_0x791a('0x1c')](_0x234514,_0xcb5e66,!![]);}catch(_0x530e32){return BPromise[_0x791a('0x1d')](_0x530e32);}return _0x234514[_0x791a('0x1e')]();};}function saveUpdates(_0x25bae5,_0x9e17b5){return function(_0x3200dd){if(_0x3200dd){return _0x3200dd[_0x791a('0x1f')](_0x25bae5)[_0x791a('0x20')](function(_0x45a67d){return _0x45a67d;});}return null;};}function removeEntity(_0x323c6a,_0xe8e452){return function(_0x137992){if(_0x137992){return _0x137992['destroy']()[_0x791a('0x20')](function(){_0x323c6a[_0x791a('0x16')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x2966b8,_0x4d748a){return function(_0x456480){if(!_0x456480){_0x2966b8[_0x791a('0x21')](0x194);}return _0x456480;};}function handleError(_0x51dcca,_0xdfa84f){_0xdfa84f=_0xdfa84f||0x1f4;return function(_0x1785f5){logger[_0x791a('0x22')](_0x1785f5['stack']);if(_0x1785f5[_0x791a('0x23')]){delete _0x1785f5[_0x791a('0x23')];}_0x51dcca[_0x791a('0x16')](_0xdfa84f)[_0x791a('0x24')](_0x1785f5);};}exports[_0x791a('0x25')]=function(_0x1a9c6b,_0x628816){var _0x889534={},_0x58bbc0={},_0xbc3436={'count':0x0,'rows':[]};var _0x9e9332=_[_0x791a('0x26')](db['ZendeskAccount'][_0x791a('0x27')],function(_0x5df656){return{'name':_0x5df656[_0x791a('0x28')],'type':_0x5df656[_0x791a('0x29')][_0x791a('0x2a')]};});_0x58bbc0[_0x791a('0x2b')]=_[_0x791a('0x26')](_0x9e9332,_0x791a('0x23'));_0x58bbc0[_0x791a('0x2c')]=_['keys'](_0x1a9c6b[_0x791a('0x2c')]);_0x58bbc0[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],_0x58bbc0[_0x791a('0x2c')]);_0x889534['attributes']=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x2f')]));_0x889534['attributes']=_0x889534[_0x791a('0x30')][_0x791a('0x31')]?_0x889534[_0x791a('0x30')]:_0x58bbc0[_0x791a('0x2b')];if(!_0x1a9c6b[_0x791a('0x2c')]['hasOwnProperty'](_0x791a('0x32'))){_0x889534['limit']=qs[_0x791a('0x1a')](_0x1a9c6b['query']['limit']);_0x889534[_0x791a('0x19')]=qs[_0x791a('0x19')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x19')]);}_0x889534[_0x791a('0x33')]=qs[_0x791a('0x34')](_0x1a9c6b[_0x791a('0x2c')]['sort']);_0x889534[_0x791a('0x35')]=qs['filters'](_[_0x791a('0x36')](_0x1a9c6b['query'],_0x58bbc0[_0x791a('0x2d')]),_0x9e9332);if(_0x1a9c6b[_0x791a('0x2c')]['filter']){_0x889534[_0x791a('0x35')]=_[_0x791a('0x37')](_0x889534['where'],{'$or':_[_0x791a('0x26')](_0x9e9332,function(_0x165e2b){if(_0x165e2b[_0x791a('0x29')]!==_0x791a('0x38')){var _0x29d267={};_0x29d267[_0x165e2b[_0x791a('0x23')]]={'$like':'%'+_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x29d267;}})});}_0x889534=_[_0x791a('0x37')]({},_0x889534,_0x1a9c6b[_0x791a('0x3a')]);var _0x587481={'where':_0x889534[_0x791a('0x35')]};return db[_0x791a('0x3b')][_0x791a('0x3c')](_0x587481)['then'](function(_0xf4e2fa){_0xbc3436['count']=_0xf4e2fa;if(_0x1a9c6b['query']['includeAll']){_0x889534[_0x791a('0x3d')]=[{'all':!![]}];}return db[_0x791a('0x3b')]['findAll'](_0x889534);})[_0x791a('0x20')](function(_0x2d1692){_0xbc3436[_0x791a('0x3e')]=_0x2d1692;return _0xbc3436;})[_0x791a('0x20')](respondWithFilteredResult(_0x628816,_0x889534))['catch'](handleError(_0x628816,null));};exports['show']=function(_0x57b9ba,_0x2f0395){var _0x216dd3={'raw':![],'where':{'id':_0x57b9ba[_0x791a('0x3f')]['id']}},_0x4e0191={};_0x4e0191[_0x791a('0x2b')]=_[_0x791a('0x40')](db[_0x791a('0x3b')]['rawAttributes']);_0x4e0191[_0x791a('0x2c')]=_['keys'](_0x57b9ba[_0x791a('0x2c')]);_0x4e0191[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],_0x4e0191[_0x791a('0x2c')]);_0x216dd3['attributes']=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x57b9ba[_0x791a('0x2c')][_0x791a('0x2f')]));_0x216dd3['attributes']=_0x216dd3[_0x791a('0x30')][_0x791a('0x31')]?_0x216dd3['attributes']:_0x4e0191['model'];if(_0x57b9ba[_0x791a('0x2c')][_0x791a('0x41')]){_0x216dd3[_0x791a('0x3d')]=[{'all':!![]}];}_0x216dd3=_['merge']({},_0x216dd3,_0x57b9ba['options']);return db[_0x791a('0x3b')][_0x791a('0x42')](_0x216dd3)['then'](handleEntityNotFound(_0x2f0395,null))[_0x791a('0x20')](respondWithResult(_0x2f0395,null))[_0x791a('0x43')](handleError(_0x2f0395,null));};exports[_0x791a('0x44')]=function(_0x549980,_0x5a30a6){return db[_0x791a('0x3b')][_0x791a('0x44')](_0x549980[_0x791a('0x45')],{})[_0x791a('0x20')](respondWithResult(_0x5a30a6,0xc9))['catch'](handleError(_0x5a30a6,null));};exports[_0x791a('0x1f')]=function(_0x9f768a,_0x4e6d0d){if(_0x9f768a[_0x791a('0x45')]['id']){delete _0x9f768a['body']['id'];}return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x9f768a[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4e6d0d,null))[_0x791a('0x20')](saveUpdates(_0x9f768a[_0x791a('0x45')],null))[_0x791a('0x20')](respondWithResult(_0x4e6d0d,null))['catch'](handleError(_0x4e6d0d,null));};exports[_0x791a('0x46')]=function(_0x1fd826,_0x4bffa6){return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x1fd826['params']['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4bffa6,null))[_0x791a('0x20')](removeEntity(_0x4bffa6,null))[_0x791a('0x43')](handleError(_0x4bffa6,null));};exports[_0x791a('0x47')]=function(_0xd5ec90,_0x4d82eb,_0x4ab42f){var _0x5a616f={};var _0x305033={};var _0x51b556;var _0x4c7555;return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0xd5ec90[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4d82eb,null))['then'](function(_0x5166b5){if(_0x5166b5){_0x51b556=_0x5166b5;_0x305033[_0x791a('0x2b')]=_['keys'](db[_0x791a('0x48')][_0x791a('0x27')]);_0x305033[_0x791a('0x2c')]=_['keys'](_0xd5ec90[_0x791a('0x2c')]);_0x305033[_0x791a('0x2d')]=_['intersection'](_0x305033[_0x791a('0x2b')],_0x305033[_0x791a('0x2c')]);_0x5a616f[_0x791a('0x30')]=_[_0x791a('0x2e')](_0x305033[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0xd5ec90['query']['fields']));_0x5a616f[_0x791a('0x30')]=_0x5a616f['attributes'][_0x791a('0x31')]?_0x5a616f[_0x791a('0x30')]:_0x305033[_0x791a('0x2b')];_0x5a616f[_0x791a('0x33')]=qs[_0x791a('0x34')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x34')]);_0x5a616f['where']=qs[_0x791a('0x2d')](_[_0x791a('0x36')](_0xd5ec90[_0x791a('0x2c')],_0x305033[_0x791a('0x2d')]));if(_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]){_0x5a616f[_0x791a('0x35')]=_['merge'](_0x5a616f[_0x791a('0x35')],{'$or':_['map'](_0x5a616f['attributes'],function(_0x1cc240){var _0x3c81e2={};_0x3c81e2[_0x1cc240]={'$like':'%'+_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x3c81e2;})});}_0x5a616f=_[_0x791a('0x37')]({},_0x5a616f,_0xd5ec90[_0x791a('0x3a')]);return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x2bfb66){if(_0x2bfb66){_0x4c7555=_0x2bfb66[_0x791a('0x31')];if(!_0xd5ec90[_0x791a('0x2c')][_0x791a('0x49')](_0x791a('0x32'))){_0x5a616f[_0x791a('0x1a')]=qs[_0x791a('0x1a')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x1a')]);_0x5a616f[_0x791a('0x19')]=qs[_0x791a('0x19')](_0xd5ec90[_0x791a('0x2c')]['offset']);}return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x380087){if(_0x380087){return _0x380087?{'count':_0x4c7555,'rows':_0x380087}:null;}})[_0x791a('0x20')](respondWithResult(_0x4d82eb,null))[_0x791a('0x43')](handleError(_0x4d82eb,null));};exports['addConfiguration']=function(_0x42ce59,_0x3d24bd,_0x277774){if(_0x42ce59[_0x791a('0x45')]['id']){delete _0x42ce59['body']['id'];}return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0x42ce59['params']['id']}})['then'](handleEntityNotFound(_0x3d24bd,null))['then'](function(_0x22aaf2){if(_0x22aaf2){_0x42ce59[_0x791a('0x45')][_0x791a('0x4a')]=_0x22aaf2['id'];_0x42ce59[_0x791a('0x45')][_0x791a('0x4b')]=integrations[_0x791a('0x4c')](_0x42ce59[_0x791a('0x45')]['channel'],_0x42ce59['body'][_0x791a('0x29')]);_0x42ce59[_0x791a('0x45')]['Descriptions']=integrations['getDescriptions'](_0x42ce59[_0x791a('0x45')][_0x791a('0x4d')],_0x42ce59['body'][_0x791a('0x29')]);return db[_0x791a('0x48')][_0x791a('0x44')](_0x42ce59[_0x791a('0x45')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x791a('0x4e')],'as':_0x791a('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d24bd,null))[_0x791a('0x43')](handleError(_0x3d24bd,null));};exports[_0x791a('0x50')]=function(_0x10b51f,_0x3838c4,_0x565c83){var _0x24efc2='';return db[_0x791a('0x3b')][_0x791a('0x51')]({'where':{'id':_0x10b51f[_0x791a('0x3f')]['id']},'attributes':['id',_0x791a('0x52'),_0x791a('0x53'),_0x791a('0x54'),_0x791a('0x55'),'remoteUri']})['then'](handleEntityNotFound(_0x3838c4,null))['then'](function(_0xf8ac72){if(_0xf8ac72){_0x24efc2=_0xf8ac72[_0x791a('0x56')];var _0x1118a8=_0x24efc2[_0x791a('0x57')](-0x1);if(_0x1118a8==='/'){_0x24efc2=_0x24efc2[_0x791a('0x58')](0x0,_0x24efc2[_0x791a('0x59')](_0x1118a8));}var _0x348e54={'method':_0x791a('0x5a'),'uri':util[_0x791a('0x5b')](_0x791a('0x5c'),_0x24efc2,'ticket_fields'),'json':!![]};switch(_0xf8ac72[_0x791a('0x55')]){case _0x791a('0x53'):_0x348e54['headers']={'Authorization':util[_0x791a('0x5b')](_0x791a('0x5d'),new Buffer(util['format']('%s:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x53')]))['toString']('base64'))};break;case _0x791a('0x54'):_0x348e54[_0x791a('0x5e')]={'Authorization':util[_0x791a('0x5b')]('Basic\x20%s',new Buffer(util[_0x791a('0x5b')]('%s/token:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x54')]))[_0x791a('0x5f')](_0x791a('0x60')))};break;default:throw new db[(_0x791a('0x61'))][(_0x791a('0x62'))]('Unknown\x20authentication\x20type');}return rp(_0x348e54);}})[_0x791a('0x20')](function(_0x2e666e){if(_0x2e666e){var _0x41d1a5=[_0x791a('0x63'),_0x791a('0x64'),_0x791a('0x65'),_0x791a('0x66')];_[_0x791a('0x67')](_0x2e666e[_0x791a('0x68')],function(_0x203fc5){return _0x41d1a5[_0x791a('0x69')](_0x203fc5[_0x791a('0x29')]);});return{'count':_0x2e666e[_0x791a('0x68')][_0x791a('0x31')],'rows':_[_0x791a('0x26')](_0x2e666e[_0x791a('0x68')],function(_0x3272c0){return{'id':_0x3272c0['id'],'name':_0x3272c0[_0x791a('0x6a')]>0x7?_0x3272c0['title']:_0x3272c0[_0x791a('0x29')],'custom':_0x3272c0[_0x791a('0x6a')]>0x7?!![]:![],'options':_0x3272c0[_0x791a('0x6b')]?_0x3272c0[_0x791a('0x6b')]:_0x3272c0[_0x791a('0x6c')]?_0x3272c0['custom_field_options']:[]};})};}})[_0x791a('0x20')](respondWithResult(_0x3838c4,null))['catch'](function(_0x467d65){var _0x48b8dc=_0x10b51f[_0x791a('0x2c')][_0x791a('0x6d')]?0x1f4:_0x467d65['statusCode']||0x1f4;logger[_0x791a('0x22')](_0x791a('0x6e'),_0x791a('0x50'),_0x48b8dc,JSON['stringify'](_0x467d65));delete _0x467d65[_0x791a('0x23')];if(_0x48b8dc===0x191){_0x48b8dc=0x190;}_0x3838c4['status'](_0x48b8dc)[_0x791a('0x24')](_0x10b51f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x467d65[_0x791a('0x6f')]}:_0x467d65);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 074177e..d017ed0 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 _0xada6=['util','../../config/logger','moment','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xada6,0x1ee));var _0x6ada=function(_0x419ed8,_0x4a4414){_0x419ed8=_0x419ed8-0x0;var _0x12a3b1=_0xada6[_0x419ed8];return _0x12a3b1;};'use strict';var _=require(_0x6ada('0x0'));var util=require(_0x6ada('0x1'));var logger=require(_0x6ada('0x2'))('api');var moment=require(_0x6ada('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ada('0x4'));var attributes=require(_0x6ada('0x5'));var integrations=require(_0x6ada('0x6'));module[_0x6ada('0x7')]=function(_0x196561,_0x2935ba){return _0x196561[_0x6ada('0x8')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd819=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x59f6eb,_0x22b37b){var _0x27bfdb=function(_0x127f4b){while(--_0x127f4b){_0x59f6eb['push'](_0x59f6eb['shift']());}};_0x27bfdb(++_0x22b37b);}(_0xd819,0x131));var _0x9d81=function(_0x6a47c,_0x2cbd54){_0x6a47c=_0x6a47c-0x0;var _0x1b8c47=_0xd819[_0x6a47c];return _0x1b8c47;};'use strict';var _=require(_0x9d81('0x0'));var util=require(_0x9d81('0x1'));var logger=require(_0x9d81('0x2'))('api');var moment=require(_0x9d81('0x3'));var BPromise=require(_0x9d81('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d81('0x5'));var rimraf=require(_0x9d81('0x6'));var config=require(_0x9d81('0x7'));var attributes=require(_0x9d81('0x8'));var integrations=require(_0x9d81('0x9'));module[_0x9d81('0xa')]=function(_0x199563,_0x4a3efd){return _0x199563['define'](_0x9d81('0xb'),attributes,{'tableName':_0x9d81('0xc'),'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 858c9de..1b2614f 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 _0x5d99=['stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','GetZendeskAccount','findAll','options','raw','where','attributes','include','map','model','catch','ShowZendeskAccount','ZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug'];(function(_0x5c6c42,_0x5105b0){var _0x1f1775=function(_0x4cef47){while(--_0x4cef47){_0x5c6c42['push'](_0x5c6c42['shift']());}};_0x1f1775(++_0x5105b0);}(_0x5d99,0x1b7));var _0x95d9=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0x5d99[_0x328b1c];return _0x4dbeaa;};'use strict';var _=require(_0x95d9('0x0'));var util=require(_0x95d9('0x1'));var moment=require(_0x95d9('0x2'));var BPromise=require(_0x95d9('0x3'));var rs=require(_0x95d9('0x4'));var fs=require('fs');var Redis=require(_0x95d9('0x5'));var db=require(_0x95d9('0x6'))['db'];var utils=require(_0x95d9('0x7'));var logger=require(_0x95d9('0x8'))(_0x95d9('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x95d9('0xa')][_0x95d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x159b28,_0x5ca01b,_0x5925f9){return new BPromise(function(_0xc7413,_0x272135){return client['request'](_0x159b28,_0x5925f9)[_0x95d9('0xc')](function(_0x467f87){logger[_0x95d9('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x5ca01b,_0x95d9('0xe'));logger[_0x95d9('0xf')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x5ca01b,'request\x20sent',JSON[_0x95d9('0x10')](_0x467f87));if(_0x467f87[_0x95d9('0x11')]){if(_0x467f87[_0x95d9('0x11')][_0x95d9('0x12')]===0x1f4){logger[_0x95d9('0x11')](_0x95d9('0x13'),_0x5ca01b,_0x467f87[_0x95d9('0x11')][_0x95d9('0x14')]);return _0x272135(_0x467f87['error'][_0x95d9('0x14')]);}logger[_0x95d9('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x5ca01b,_0x467f87[_0x95d9('0x11')][_0x95d9('0x14')]);return _0xc7413(_0x467f87[_0x95d9('0x11')][_0x95d9('0x14')]);}else{logger[_0x95d9('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x5ca01b,_0x95d9('0xe'));_0xc7413(_0x467f87[_0x95d9('0x15')][_0x95d9('0x14')]);}})['catch'](function(_0x173ae9){logger[_0x95d9('0x11')](_0x95d9('0x13'),_0x5ca01b,_0x173ae9);_0x272135(_0x173ae9);});});}exports[_0x95d9('0x16')]=function(_0xb3b52a){var _0x3ccc59=this;return new Promise(function(_0x1f58b5,_0x311e4b){return db['ZendeskAccount'][_0x95d9('0x17')]({'raw':_0xb3b52a['options']?_0xb3b52a[_0x95d9('0x18')][_0x95d9('0x19')]===undefined?!![]:![]:!![],'where':_0xb3b52a['options']?_0xb3b52a[_0x95d9('0x18')][_0x95d9('0x1a')]||null:null,'attributes':_0xb3b52a[_0x95d9('0x18')]?_0xb3b52a[_0x95d9('0x18')][_0x95d9('0x1b')]||null:null,'limit':_0xb3b52a['options']?_0xb3b52a[_0x95d9('0x18')]['limit']||null:null,'include':_0xb3b52a[_0x95d9('0x18')]?_0xb3b52a[_0x95d9('0x18')][_0x95d9('0x1c')]?_[_0x95d9('0x1d')](_0xb3b52a[_0x95d9('0x18')]['include'],function(_0x102777){return{'model':db[_0x102777[_0x95d9('0x1e')]],'as':_0x102777['as'],'attributes':_0x102777[_0x95d9('0x1b')],'include':_0x102777[_0x95d9('0x1c')]?_['map'](_0x102777[_0x95d9('0x1c')],function(_0x420041){return{'model':db[_0x420041['model']],'as':_0x420041['as'],'attributes':_0x420041[_0x95d9('0x1b')],'include':_0x420041[_0x95d9('0x1c')]?_[_0x95d9('0x1d')](_0x420041['include'],function(_0x12091c){return{'model':db[_0x12091c[_0x95d9('0x1e')]],'as':_0x12091c['as'],'attributes':_0x12091c['attributes']};}):[]};}):[]};}):[]:[]})[_0x95d9('0xc')](function(_0x5c96ad){logger['info'](_0x95d9('0x16'),_0xb3b52a);logger[_0x95d9('0xf')](_0x95d9('0x16'),_0xb3b52a,JSON['stringify'](_0x5c96ad));_0x1f58b5(_0x5c96ad);})[_0x95d9('0x1f')](function(_0x5cda53){logger[_0x95d9('0x11')](_0x95d9('0x16'),_0x5cda53[_0x95d9('0x14')],_0xb3b52a);_0x311e4b(_0x3ccc59['error'](0x1f4,_0x5cda53[_0x95d9('0x14')]));});});};exports[_0x95d9('0x20')]=function(_0xe710fb){var _0xa72afa=this;return new Promise(function(_0x38c7d6,_0x5de7ec){return db[_0x95d9('0x21')][_0x95d9('0x22')]({'raw':_0xe710fb['options']?_0xe710fb[_0x95d9('0x18')][_0x95d9('0x19')]===undefined?!![]:![]:!![],'where':_0xe710fb['options']?_0xe710fb[_0x95d9('0x18')][_0x95d9('0x1a')]||null:null,'attributes':_0xe710fb[_0x95d9('0x18')]?_0xe710fb[_0x95d9('0x18')][_0x95d9('0x1b')]||null:null,'include':_0xe710fb[_0x95d9('0x18')]?_0xe710fb[_0x95d9('0x18')][_0x95d9('0x1c')]?_[_0x95d9('0x1d')](_0xe710fb[_0x95d9('0x18')][_0x95d9('0x1c')],function(_0x98d4c4){return{'model':db[_0x98d4c4['model']],'as':_0x98d4c4['as'],'attributes':_0x98d4c4['attributes'],'include':_0x98d4c4['include']?_[_0x95d9('0x1d')](_0x98d4c4['include'],function(_0x16a5b8){return{'model':db[_0x16a5b8[_0x95d9('0x1e')]],'as':_0x16a5b8['as'],'attributes':_0x16a5b8['attributes'],'include':_0x16a5b8['include']?_[_0x95d9('0x1d')](_0x16a5b8[_0x95d9('0x1c')],function(_0x58e7f8){return{'model':db[_0x58e7f8[_0x95d9('0x1e')]],'as':_0x58e7f8['as'],'attributes':_0x58e7f8[_0x95d9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x95d9('0xc')](function(_0x125833){logger['info'](_0x95d9('0x20'),_0xe710fb);logger[_0x95d9('0xf')](_0x95d9('0x20'),_0xe710fb,JSON[_0x95d9('0x10')](_0x125833));_0x38c7d6(_0x125833);})[_0x95d9('0x1f')](function(_0x332880){logger['error']('ShowZendeskAccount',_0x332880['message'],_0xe710fb);_0x5de7ec(_0xa72afa[_0x95d9('0x11')](0x1f4,_0x332880['message']));});});}; \ No newline at end of file +var _0x6175=['then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','include','map','model','info','find','ShowZendeskAccount','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http'];(function(_0x5f4507,_0x277927){var _0x2ba543=function(_0x52570b){while(--_0x52570b){_0x5f4507['push'](_0x5f4507['shift']());}};_0x2ba543(++_0x277927);}(_0x6175,0xd7));var _0x5617=function(_0x5b134f,_0x22e6ca){_0x5b134f=_0x5b134f-0x0;var _0x4717eb=_0x6175[_0x5b134f];return _0x4717eb;};'use strict';var _=require(_0x5617('0x0'));var util=require('util');var moment=require(_0x5617('0x1'));var BPromise=require(_0x5617('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5617('0x3'));var db=require(_0x5617('0x4'))['db'];var utils=require(_0x5617('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5617('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5617('0x7')][_0x5617('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42eb89,_0x19f5ad,_0x511402){return new BPromise(function(_0x2ed041,_0x229c26){return client['request'](_0x42eb89,_0x511402)[_0x5617('0x9')](function(_0x5e8a32){logger['info'](_0x5617('0xa'),_0x19f5ad,_0x5617('0xb'));logger[_0x5617('0xc')](_0x5617('0xd'),_0x19f5ad,_0x5617('0xb'),JSON['stringify'](_0x5e8a32));if(_0x5e8a32[_0x5617('0xe')]){if(_0x5e8a32['error'][_0x5617('0xf')]===0x1f4){logger[_0x5617('0xe')](_0x5617('0xa'),_0x19f5ad,_0x5e8a32[_0x5617('0xe')][_0x5617('0x10')]);return _0x229c26(_0x5e8a32['error'][_0x5617('0x10')]);}logger['error'](_0x5617('0xa'),_0x19f5ad,_0x5e8a32[_0x5617('0xe')]['message']);return _0x2ed041(_0x5e8a32['error']['message']);}else{logger['info'](_0x5617('0xa'),_0x19f5ad,_0x5617('0xb'));_0x2ed041(_0x5e8a32[_0x5617('0x11')][_0x5617('0x10')]);}})[_0x5617('0x12')](function(_0x3dcbbc){logger[_0x5617('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x19f5ad,_0x3dcbbc);_0x229c26(_0x3dcbbc);});});}exports[_0x5617('0x13')]=function(_0x409b94){var _0x530668=this;return new Promise(function(_0x2752c3,_0x46e741){return db[_0x5617('0x14')][_0x5617('0x15')]({'raw':_0x409b94['options']?_0x409b94[_0x5617('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x409b94['options']?_0x409b94[_0x5617('0x16')][_0x5617('0x17')]||null:null,'attributes':_0x409b94[_0x5617('0x16')]?_0x409b94[_0x5617('0x16')][_0x5617('0x18')]||null:null,'limit':_0x409b94['options']?_0x409b94[_0x5617('0x16')]['limit']||null:null,'include':_0x409b94['options']?_0x409b94[_0x5617('0x16')][_0x5617('0x19')]?_[_0x5617('0x1a')](_0x409b94[_0x5617('0x16')]['include'],function(_0x3cfc04){return{'model':db[_0x3cfc04[_0x5617('0x1b')]],'as':_0x3cfc04['as'],'attributes':_0x3cfc04[_0x5617('0x18')],'include':_0x3cfc04[_0x5617('0x19')]?_[_0x5617('0x1a')](_0x3cfc04[_0x5617('0x19')],function(_0xa83275){return{'model':db[_0xa83275[_0x5617('0x1b')]],'as':_0xa83275['as'],'attributes':_0xa83275[_0x5617('0x18')],'include':_0xa83275['include']?_[_0x5617('0x1a')](_0xa83275[_0x5617('0x19')],function(_0x13036b){return{'model':db[_0x13036b[_0x5617('0x1b')]],'as':_0x13036b['as'],'attributes':_0x13036b['attributes']};}):[]};}):[]};}):[]:[]})[_0x5617('0x9')](function(_0xc04257){logger[_0x5617('0x1c')](_0x5617('0x13'),_0x409b94);logger[_0x5617('0xc')]('GetZendeskAccount',_0x409b94,JSON['stringify'](_0xc04257));_0x2752c3(_0xc04257);})['catch'](function(_0x43d6fd){logger['error']('GetZendeskAccount',_0x43d6fd[_0x5617('0x10')],_0x409b94);_0x46e741(_0x530668[_0x5617('0xe')](0x1f4,_0x43d6fd[_0x5617('0x10')]));});});};exports['ShowZendeskAccount']=function(_0x11b53f){var _0x25b778=this;return new Promise(function(_0x1093be,_0x459cd1){return db[_0x5617('0x14')][_0x5617('0x1d')]({'raw':_0x11b53f[_0x5617('0x16')]?_0x11b53f['options']['raw']===undefined?!![]:![]:!![],'where':_0x11b53f[_0x5617('0x16')]?_0x11b53f[_0x5617('0x16')][_0x5617('0x17')]||null:null,'attributes':_0x11b53f[_0x5617('0x16')]?_0x11b53f[_0x5617('0x16')][_0x5617('0x18')]||null:null,'include':_0x11b53f['options']?_0x11b53f['options']['include']?_[_0x5617('0x1a')](_0x11b53f[_0x5617('0x16')][_0x5617('0x19')],function(_0x23c82b){return{'model':db[_0x23c82b['model']],'as':_0x23c82b['as'],'attributes':_0x23c82b['attributes'],'include':_0x23c82b[_0x5617('0x19')]?_['map'](_0x23c82b[_0x5617('0x19')],function(_0x3a3e81){return{'model':db[_0x3a3e81[_0x5617('0x1b')]],'as':_0x3a3e81['as'],'attributes':_0x3a3e81['attributes'],'include':_0x3a3e81[_0x5617('0x19')]?_[_0x5617('0x1a')](_0x3a3e81[_0x5617('0x19')],function(_0x475276){return{'model':db[_0x475276[_0x5617('0x1b')]],'as':_0x475276['as'],'attributes':_0x475276['attributes']};}):[]};}):[]};}):[]:[]})[_0x5617('0x9')](function(_0x2423c2){logger[_0x5617('0x1c')](_0x5617('0x1e'),_0x11b53f);logger[_0x5617('0xc')]('ShowZendeskAccount',_0x11b53f,JSON[_0x5617('0x1f')](_0x2423c2));_0x1093be(_0x2423c2);})[_0x5617('0x12')](function(_0x23eb8e){logger[_0x5617('0xe')]('ShowZendeskAccount',_0x23eb8e['message'],_0x11b53f);_0x459cd1(_0x25b778[_0x5617('0xe')](0x1f4,_0x23eb8e[_0x5617('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 02b9d04..23c9ed7 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0xb33eae,_0x18d02d){var _0x59c7a6=function(_0x18841b){while(--_0x18841b){_0xb33eae['push'](_0xb33eae['shift']());}};_0x59c7a6(++_0x18d02d);}(_0xe706,0xa3));var _0x6e70=function(_0x1ba5ba,_0x566734){_0x1ba5ba=_0x1ba5ba-0x0;var _0x5991c6=_0xe706[_0x1ba5ba];return _0x5991c6;};'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('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x4ed593,_0x412507){var _0x1e10c1=function(_0xd534ab){while(--_0xd534ab){_0x4ed593['push'](_0x4ed593['shift']());}};_0x1e10c1(++_0x412507);}(_0x750a,0x140));var _0xa750=function(_0x924c29,_0x309120){_0x924c29=_0x924c29-0x0;var _0x24ddd6=_0x750a[_0x924c29];return _0x24ddd6;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('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 f583c51..db2e964 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 _0x112b=['STRING','sequelize','exports'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x112b,0xf4));var _0xb112=function(_0x1a7e4b,_0x2fbd40){_0x1a7e4b=_0x1a7e4b-0x0;var _0x37a8fd=_0x112b[_0x1a7e4b];return _0x37a8fd;};'use strict';var Sequelize=require(_0xb112('0x0'));module[_0xb112('0x1')]={'name':{'type':Sequelize[_0xb112('0x2')]},'description':{'type':Sequelize[_0xb112('0x2')]}}; \ No newline at end of file +var _0x281c=['exports','STRING','sequelize'];(function(_0x4c235e,_0x895501){var _0x4491e8=function(_0x4802ed){while(--_0x4802ed){_0x4c235e['push'](_0x4c235e['shift']());}};_0x4491e8(++_0x895501);}(_0x281c,0x1dc));var _0xc281=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x281c[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0xc281('0x0'));module[_0xc281('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc281('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 784fed4..345a1c5 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 _0x61b9=['zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','destroy','then','error','stack','name','send','map','ZendeskConfiguration','rawAttributes','type','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf'];(function(_0x4080ec,_0x5d3f21){var _0x3cce9a=function(_0x13b1b2){while(--_0x13b1b2){_0x4080ec['push'](_0x4080ec['shift']());}};_0x3cce9a(++_0x5d3f21);}(_0x61b9,0x198));var _0x961b=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x61b9[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0x961b('0x0'));var rimraf=require(_0x961b('0x1'));var zipdir=require(_0x961b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x961b('0x3'));var moment=require(_0x961b('0x4'));var BPromise=require(_0x961b('0x5'));var Mustache=require('mustache');var util=require(_0x961b('0x6'));var path=require(_0x961b('0x7'));var sox=require(_0x961b('0x8'));var csv=require('to-csv');var ejs=require(_0x961b('0x9'));var fs=require('fs');var fs_extra=require(_0x961b('0xa'));var _=require('lodash');var squel=require(_0x961b('0xb'));var crypto=require(_0x961b('0xc'));var jsforce=require(_0x961b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x961b('0xe'));var querystring=require(_0x961b('0xf'));var Papa=require(_0x961b('0x10'));var Redis=require('ioredis');var authService=require(_0x961b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x961b('0x12'));var hardwareService=require(_0x961b('0x13'));var logger=require(_0x961b('0x14'))(_0x961b('0x15'));var utils=require(_0x961b('0x16'));var config=require(_0x961b('0x17'));var licenseUtil=require(_0x961b('0x18'));var db=require(_0x961b('0x19'))['db'];function respondWithStatusCode(_0x47b9ce,_0x57e219){_0x57e219=_0x57e219||0xcc;return function(_0x1bfb10){if(_0x1bfb10){return _0x47b9ce[_0x961b('0x1a')](_0x57e219);}return _0x47b9ce[_0x961b('0x1b')](_0x57e219)[_0x961b('0x1c')]();};}function respondWithResult(_0x4f416b,_0xb21c2a){_0xb21c2a=_0xb21c2a||0xc8;return function(_0x2d3e6e){if(_0x2d3e6e){return _0x4f416b['status'](_0xb21c2a)[_0x961b('0x1d')](_0x2d3e6e);}};}function respondWithFilteredResult(_0x1d9392,_0x5eafbe){return function(_0x5ac4fc){if(_0x5ac4fc){var _0x1fefac=typeof _0x5eafbe[_0x961b('0x1e')]===_0x961b('0x1f')&&typeof _0x5eafbe[_0x961b('0x20')]===_0x961b('0x1f');var _0x170189=_0x5ac4fc[_0x961b('0x21')];var _0x12efbc=_0x1fefac?0x0:_0x5eafbe['offset'];var _0x303a65=_0x1fefac?_0x5ac4fc[_0x961b('0x21')]:_0x5eafbe[_0x961b('0x1e')]+_0x5eafbe['limit'];var _0x4cfeea;if(_0x303a65>=_0x170189){_0x303a65=_0x170189;_0x4cfeea=0xc8;}else{_0x4cfeea=0xce;}_0x1d9392[_0x961b('0x1b')](_0x4cfeea);return _0x1d9392[_0x961b('0x22')]('Content-Range',_0x12efbc+'-'+_0x303a65+'/'+_0x170189)[_0x961b('0x1d')](_0x5ac4fc);}return null;};}function patchUpdates(_0x1b0d8b){return function(_0x4210cb){try{jsonpatch[_0x961b('0x23')](_0x4210cb,_0x1b0d8b,!![]);}catch(_0x106f46){return BPromise['reject'](_0x106f46);}return _0x4210cb[_0x961b('0x24')]();};}function saveUpdates(_0x221dba,_0x480158){return function(_0xf29c5){if(_0xf29c5){return _0xf29c5['update'](_0x221dba)['then'](function(_0x22df04){return _0x22df04;});}return null;};}function removeEntity(_0x490e76,_0xb8675){return function(_0x7b13a8){if(_0x7b13a8){return _0x7b13a8[_0x961b('0x25')]()[_0x961b('0x26')](function(){_0x490e76[_0x961b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d72e9,_0x1a90f3){return function(_0x34fd06){if(!_0x34fd06){_0x3d72e9[_0x961b('0x1a')](0x194);}return _0x34fd06;};}function handleError(_0x19bfb4,_0x3b672e){_0x3b672e=_0x3b672e||0x1f4;return function(_0x2c7be8){logger[_0x961b('0x27')](_0x2c7be8[_0x961b('0x28')]);if(_0x2c7be8[_0x961b('0x29')]){delete _0x2c7be8[_0x961b('0x29')];}_0x19bfb4[_0x961b('0x1b')](_0x3b672e)[_0x961b('0x2a')](_0x2c7be8);};}exports['index']=function(_0x5949bd,_0x460b0d){var _0x59edec={},_0x4cb6e1={},_0x1d59c0={'count':0x0,'rows':[]};var _0x19712d=_[_0x961b('0x2b')](db[_0x961b('0x2c')][_0x961b('0x2d')],function(_0x184141){return{'name':_0x184141['fieldName'],'type':_0x184141[_0x961b('0x2e')]['key']};});_0x4cb6e1['model']=_['map'](_0x19712d,_0x961b('0x29'));_0x4cb6e1[_0x961b('0x2f')]=_['keys'](_0x5949bd[_0x961b('0x2f')]);_0x4cb6e1['filters']=_[_0x961b('0x30')](_0x4cb6e1['model'],_0x4cb6e1[_0x961b('0x2f')]);_0x59edec['attributes']=_[_0x961b('0x30')](_0x4cb6e1[_0x961b('0x31')],qs[_0x961b('0x32')](_0x5949bd[_0x961b('0x2f')][_0x961b('0x32')]));_0x59edec[_0x961b('0x33')]=_0x59edec[_0x961b('0x33')][_0x961b('0x34')]?_0x59edec[_0x961b('0x33')]:_0x4cb6e1[_0x961b('0x31')];if(!_0x5949bd[_0x961b('0x2f')][_0x961b('0x35')](_0x961b('0x36'))){_0x59edec[_0x961b('0x20')]=qs[_0x961b('0x20')](_0x5949bd[_0x961b('0x2f')][_0x961b('0x20')]);_0x59edec[_0x961b('0x1e')]=qs['offset'](_0x5949bd['query'][_0x961b('0x1e')]);}_0x59edec[_0x961b('0x37')]=qs[_0x961b('0x38')](_0x5949bd['query'][_0x961b('0x38')]);_0x59edec['where']=qs[_0x961b('0x39')](_[_0x961b('0x3a')](_0x5949bd[_0x961b('0x2f')],_0x4cb6e1[_0x961b('0x39')]),_0x19712d);if(_0x5949bd['query'][_0x961b('0x3b')]){_0x59edec[_0x961b('0x3c')]=_[_0x961b('0x3d')](_0x59edec['where'],{'$or':_['map'](_0x19712d,function(_0x487818){if(_0x487818[_0x961b('0x2e')]!==_0x961b('0x3e')){var _0x1b7b14={};_0x1b7b14[_0x487818['name']]={'$like':'%'+_0x5949bd[_0x961b('0x2f')]['filter']+'%'};return _0x1b7b14;}})});}_0x59edec=_[_0x961b('0x3d')]({},_0x59edec,_0x5949bd[_0x961b('0x3f')]);var _0x3abc8a={'where':_0x59edec[_0x961b('0x3c')]};return db[_0x961b('0x2c')][_0x961b('0x21')](_0x3abc8a)[_0x961b('0x26')](function(_0x330195){_0x1d59c0[_0x961b('0x21')]=_0x330195;if(_0x5949bd[_0x961b('0x2f')][_0x961b('0x40')]){_0x59edec[_0x961b('0x41')]=[{'all':!![]}];}return db[_0x961b('0x2c')][_0x961b('0x42')](_0x59edec);})['then'](function(_0x579610){_0x1d59c0[_0x961b('0x43')]=_0x579610;return _0x1d59c0;})['then'](respondWithFilteredResult(_0x460b0d,_0x59edec))[_0x961b('0x44')](handleError(_0x460b0d,null));};exports['show']=function(_0x50f358,_0x1c8c2d){var _0x5a40b4={'raw':![],'where':{'id':_0x50f358[_0x961b('0x45')]['id']}},_0x5e8b4a={};_0x5e8b4a[_0x961b('0x31')]=_['keys'](db[_0x961b('0x2c')][_0x961b('0x2d')]);_0x5e8b4a[_0x961b('0x2f')]=_[_0x961b('0x46')](_0x50f358[_0x961b('0x2f')]);_0x5e8b4a[_0x961b('0x39')]=_[_0x961b('0x30')](_0x5e8b4a['model'],_0x5e8b4a[_0x961b('0x2f')]);_0x5a40b4['attributes']=_[_0x961b('0x30')](_0x5e8b4a[_0x961b('0x31')],qs['fields'](_0x50f358[_0x961b('0x2f')][_0x961b('0x32')]));_0x5a40b4[_0x961b('0x33')]=_0x5a40b4[_0x961b('0x33')]['length']?_0x5a40b4[_0x961b('0x33')]:_0x5e8b4a[_0x961b('0x31')];if(_0x50f358[_0x961b('0x2f')][_0x961b('0x40')]){_0x5a40b4[_0x961b('0x41')]=[{'all':!![]}];}_0x5a40b4=_[_0x961b('0x3d')]({},_0x5a40b4,_0x50f358['options']);return db[_0x961b('0x2c')][_0x961b('0x47')](_0x5a40b4)[_0x961b('0x26')](handleEntityNotFound(_0x1c8c2d,null))[_0x961b('0x26')](respondWithResult(_0x1c8c2d,null))[_0x961b('0x44')](handleError(_0x1c8c2d,null));};exports[_0x961b('0x48')]=function(_0x3e01b2,_0x5b3254){return db['ZendeskConfiguration']['create'](_0x3e01b2[_0x961b('0x49')],{})[_0x961b('0x26')](respondWithResult(_0x5b3254,0xc9))[_0x961b('0x44')](handleError(_0x5b3254,null));};exports['update']=function(_0x5b518e,_0x3fa549){if(_0x5b518e[_0x961b('0x49')]['id']){delete _0x5b518e[_0x961b('0x49')]['id'];}return db[_0x961b('0x2c')][_0x961b('0x47')]({'where':{'id':_0x5b518e['params']['id']}})[_0x961b('0x26')](handleEntityNotFound(_0x3fa549,null))['then'](saveUpdates(_0x5b518e[_0x961b('0x49')],null))['then'](respondWithResult(_0x3fa549,null))[_0x961b('0x44')](handleError(_0x3fa549,null));};exports['destroy']=function(_0x33ddfc,_0xf45614){return db[_0x961b('0x2c')][_0x961b('0x47')]({'where':{'id':_0x33ddfc[_0x961b('0x45')]['id']}})[_0x961b('0x26')](handleEntityNotFound(_0xf45614,null))[_0x961b('0x26')](removeEntity(_0xf45614,null))[_0x961b('0x44')](handleError(_0xf45614,null));};exports[_0x961b('0x4a')]=function(_0x245a33,_0x35b227,_0x4c167c){var _0x5920b7={};var _0x394831={};var _0x292107;var _0xf5e8d5;return db[_0x961b('0x2c')][_0x961b('0x4b')]({'where':{'id':_0x245a33[_0x961b('0x45')]['id']}})['then'](handleEntityNotFound(_0x35b227,null))['then'](function(_0x878171){if(_0x878171){_0x292107=_0x878171;_0x394831['model']=_[_0x961b('0x46')](db[_0x961b('0x4c')][_0x961b('0x2d')]);_0x394831[_0x961b('0x2f')]=_[_0x961b('0x46')](_0x245a33[_0x961b('0x2f')]);_0x394831[_0x961b('0x39')]=_[_0x961b('0x30')](_0x394831[_0x961b('0x31')],_0x394831['query']);_0x5920b7[_0x961b('0x33')]=_[_0x961b('0x30')](_0x394831[_0x961b('0x31')],qs[_0x961b('0x32')](_0x245a33[_0x961b('0x2f')][_0x961b('0x32')]));_0x5920b7['attributes']=_0x5920b7[_0x961b('0x33')][_0x961b('0x34')]?_0x5920b7[_0x961b('0x33')]:_0x394831[_0x961b('0x31')];_0x5920b7[_0x961b('0x37')]=qs[_0x961b('0x38')](_0x245a33['query'][_0x961b('0x38')]);_0x5920b7[_0x961b('0x3c')]=qs['filters'](_['pick'](_0x245a33[_0x961b('0x2f')],_0x394831[_0x961b('0x39')]));if(_0x245a33['query'][_0x961b('0x3b')]){_0x5920b7[_0x961b('0x3c')]=_['merge'](_0x5920b7[_0x961b('0x3c')],{'$or':_[_0x961b('0x2b')](_0x5920b7['attributes'],function(_0x56287a){var _0x171b7a={};_0x171b7a[_0x56287a]={'$like':'%'+_0x245a33[_0x961b('0x2f')][_0x961b('0x3b')]+'%'};return _0x171b7a;})});}_0x5920b7=_['merge']({},_0x5920b7,_0x245a33[_0x961b('0x3f')]);return _0x292107[_0x961b('0x4a')](_0x5920b7);}})[_0x961b('0x26')](function(_0x49c8ed){if(_0x49c8ed){_0xf5e8d5=_0x49c8ed['length'];if(!_0x245a33[_0x961b('0x2f')][_0x961b('0x35')](_0x961b('0x36'))){_0x5920b7[_0x961b('0x20')]=qs[_0x961b('0x20')](_0x245a33[_0x961b('0x2f')][_0x961b('0x20')]);_0x5920b7[_0x961b('0x1e')]=qs[_0x961b('0x1e')](_0x245a33[_0x961b('0x2f')][_0x961b('0x1e')]);}return _0x292107[_0x961b('0x4a')](_0x5920b7);}})['then'](function(_0x379ae3){if(_0x379ae3){return _0x379ae3?{'count':_0xf5e8d5,'rows':_0x379ae3}:null;}})[_0x961b('0x26')](respondWithResult(_0x35b227,null))[_0x961b('0x44')](handleError(_0x35b227,null));};exports['getSubjects']=function(_0x3e9325,_0x5a0ee9,_0x35e89f){var _0x227634={};var _0xe32783={};var _0x512f62;var _0x54d708;return db['ZendeskConfiguration'][_0x961b('0x4b')]({'where':{'id':_0x3e9325[_0x961b('0x45')]['id']}})[_0x961b('0x26')](handleEntityNotFound(_0x5a0ee9,null))[_0x961b('0x26')](function(_0x2e40f2){if(_0x2e40f2){_0x512f62=_0x2e40f2;_0xe32783[_0x961b('0x31')]=_['keys'](db[_0x961b('0x4c')][_0x961b('0x2d')]);_0xe32783[_0x961b('0x2f')]=_[_0x961b('0x46')](_0x3e9325[_0x961b('0x2f')]);_0xe32783['filters']=_[_0x961b('0x30')](_0xe32783['model'],_0xe32783['query']);_0x227634['attributes']=_['intersection'](_0xe32783[_0x961b('0x31')],qs[_0x961b('0x32')](_0x3e9325[_0x961b('0x2f')][_0x961b('0x32')]));_0x227634[_0x961b('0x33')]=_0x227634[_0x961b('0x33')][_0x961b('0x34')]?_0x227634['attributes']:_0xe32783['model'];_0x227634['order']=qs['sort'](_0x3e9325[_0x961b('0x2f')][_0x961b('0x38')]);_0x227634[_0x961b('0x3c')]=qs[_0x961b('0x39')](_[_0x961b('0x3a')](_0x3e9325[_0x961b('0x2f')],_0xe32783[_0x961b('0x39')]));if(_0x3e9325[_0x961b('0x2f')][_0x961b('0x3b')]){_0x227634[_0x961b('0x3c')]=_[_0x961b('0x3d')](_0x227634[_0x961b('0x3c')],{'$or':_[_0x961b('0x2b')](_0x227634[_0x961b('0x33')],function(_0x5efb43){var _0x4c0b2d={};_0x4c0b2d[_0x5efb43]={'$like':'%'+_0x3e9325[_0x961b('0x2f')][_0x961b('0x3b')]+'%'};return _0x4c0b2d;})});}_0x227634=_['merge']({},_0x227634,_0x3e9325['options']);return _0x512f62[_0x961b('0x4d')](_0x227634);}})[_0x961b('0x26')](function(_0x54bd26){if(_0x54bd26){_0x54d708=_0x54bd26[_0x961b('0x34')];if(!_0x3e9325[_0x961b('0x2f')][_0x961b('0x35')](_0x961b('0x36'))){_0x227634[_0x961b('0x20')]=qs[_0x961b('0x20')](_0x3e9325[_0x961b('0x2f')][_0x961b('0x20')]);_0x227634[_0x961b('0x1e')]=qs[_0x961b('0x1e')](_0x3e9325['query'][_0x961b('0x1e')]);}return _0x512f62[_0x961b('0x4d')](_0x227634);}})[_0x961b('0x26')](function(_0x433f31){if(_0x433f31){return _0x433f31?{'count':_0x54d708,'rows':_0x433f31}:null;}})[_0x961b('0x26')](respondWithResult(_0x5a0ee9,null))[_0x961b('0x44')](handleError(_0x5a0ee9,null));};exports[_0x961b('0x4e')]=function(_0x28dd01,_0x55b3e1,_0x3e8a91){var _0x4dbf97={};var _0x5d5d2c={};var _0x348658;var _0x576381;return db[_0x961b('0x2c')][_0x961b('0x4b')]({'where':{'id':_0x28dd01['params']['id']}})[_0x961b('0x26')](handleEntityNotFound(_0x55b3e1,null))[_0x961b('0x26')](function(_0x802e2f){if(_0x802e2f){_0x348658=_0x802e2f;_0x5d5d2c[_0x961b('0x31')]=_[_0x961b('0x46')](db['ZendeskField']['rawAttributes']);_0x5d5d2c[_0x961b('0x2f')]=_[_0x961b('0x46')](_0x28dd01[_0x961b('0x2f')]);_0x5d5d2c['filters']=_[_0x961b('0x30')](_0x5d5d2c[_0x961b('0x31')],_0x5d5d2c[_0x961b('0x2f')]);_0x4dbf97[_0x961b('0x33')]=_[_0x961b('0x30')](_0x5d5d2c[_0x961b('0x31')],qs[_0x961b('0x32')](_0x28dd01['query']['fields']));_0x4dbf97['attributes']=_0x4dbf97[_0x961b('0x33')][_0x961b('0x34')]?_0x4dbf97[_0x961b('0x33')]:_0x5d5d2c[_0x961b('0x31')];_0x4dbf97[_0x961b('0x37')]=qs['sort'](_0x28dd01[_0x961b('0x2f')][_0x961b('0x38')]);_0x4dbf97[_0x961b('0x3c')]=qs[_0x961b('0x39')](_['pick'](_0x28dd01['query'],_0x5d5d2c['filters']));if(_0x28dd01['query'][_0x961b('0x3b')]){_0x4dbf97[_0x961b('0x3c')]=_[_0x961b('0x3d')](_0x4dbf97[_0x961b('0x3c')],{'$or':_[_0x961b('0x2b')](_0x4dbf97[_0x961b('0x33')],function(_0x4941c5){var _0x36e5d5={};_0x36e5d5[_0x4941c5]={'$like':'%'+_0x28dd01['query'][_0x961b('0x3b')]+'%'};return _0x36e5d5;})});}_0x4dbf97=_[_0x961b('0x3d')]({},_0x4dbf97,_0x28dd01[_0x961b('0x3f')]);return _0x348658['getDescriptions'](_0x4dbf97);}})['then'](function(_0x56b83b){if(_0x56b83b){_0x576381=_0x56b83b[_0x961b('0x34')];if(!_0x28dd01[_0x961b('0x2f')][_0x961b('0x35')](_0x961b('0x36'))){_0x4dbf97[_0x961b('0x20')]=qs[_0x961b('0x20')](_0x28dd01[_0x961b('0x2f')][_0x961b('0x20')]);_0x4dbf97[_0x961b('0x1e')]=qs[_0x961b('0x1e')](_0x28dd01['query'][_0x961b('0x1e')]);}return _0x348658['getDescriptions'](_0x4dbf97);}})[_0x961b('0x26')](function(_0x2f43b4){if(_0x2f43b4){return _0x2f43b4?{'count':_0x576381,'rows':_0x2f43b4}:null;}})[_0x961b('0x26')](respondWithResult(_0x55b3e1,null))['catch'](handleError(_0x55b3e1,null));};exports[_0x961b('0x4f')]=function(_0x203d61,_0x4bf8a8,_0x33f38b){var _0x13bc3d={};var _0x558752={};var _0x5c4ad9;var _0x214dac;return db['ZendeskConfiguration'][_0x961b('0x4b')]({'where':{'id':_0x203d61[_0x961b('0x45')]['id']}})[_0x961b('0x26')](handleEntityNotFound(_0x4bf8a8,null))[_0x961b('0x26')](function(_0xa962a4){if(_0xa962a4){_0x5c4ad9=_0xa962a4;_0x558752[_0x961b('0x31')]=_[_0x961b('0x46')](db['Tag']['rawAttributes']);_0x558752[_0x961b('0x2f')]=_[_0x961b('0x46')](_0x203d61['query']);_0x558752[_0x961b('0x39')]=_[_0x961b('0x30')](_0x558752['model'],_0x558752[_0x961b('0x2f')]);_0x13bc3d[_0x961b('0x33')]=_[_0x961b('0x30')](_0x558752[_0x961b('0x31')],qs[_0x961b('0x32')](_0x203d61[_0x961b('0x2f')][_0x961b('0x32')]));_0x13bc3d['attributes']=_0x13bc3d[_0x961b('0x33')][_0x961b('0x34')]?_0x13bc3d[_0x961b('0x33')]:_0x558752['model'];_0x13bc3d[_0x961b('0x37')]=qs[_0x961b('0x38')](_0x203d61['query'][_0x961b('0x38')]);_0x13bc3d[_0x961b('0x3c')]=qs[_0x961b('0x39')](_['pick'](_0x203d61['query'],_0x558752[_0x961b('0x39')]));if(_0x203d61['query'][_0x961b('0x3b')]){_0x13bc3d['where']=_[_0x961b('0x3d')](_0x13bc3d[_0x961b('0x3c')],{'$or':_[_0x961b('0x2b')](_0x13bc3d['attributes'],function(_0x517b1b){var _0x2b80c6={};_0x2b80c6[_0x517b1b]={'$like':'%'+_0x203d61[_0x961b('0x2f')][_0x961b('0x3b')]+'%'};return _0x2b80c6;})});}_0x13bc3d=_[_0x961b('0x3d')]({},_0x13bc3d,_0x203d61[_0x961b('0x3f')]);return _0x5c4ad9[_0x961b('0x4f')](_0x13bc3d);}})[_0x961b('0x26')](function(_0x46e046){if(_0x46e046){_0x214dac=_0x46e046[_0x961b('0x34')];if(!_0x203d61[_0x961b('0x2f')][_0x961b('0x35')](_0x961b('0x36'))){_0x13bc3d[_0x961b('0x20')]=qs[_0x961b('0x20')](_0x203d61['query'][_0x961b('0x20')]);_0x13bc3d[_0x961b('0x1e')]=qs[_0x961b('0x1e')](_0x203d61['query']['offset']);}return _0x5c4ad9[_0x961b('0x4f')](_0x13bc3d);}})[_0x961b('0x26')](function(_0x2fd30e){if(_0x2fd30e){return _0x2fd30e?{'count':_0x214dac,'rows':_0x2fd30e}:null;}})[_0x961b('0x26')](respondWithResult(_0x4bf8a8,null))[_0x961b('0x44')](handleError(_0x4bf8a8,null));};exports[_0x961b('0x50')]=function(_0x18e7f0,_0x5d2ffe,_0x419b6f){if(_0x18e7f0[_0x961b('0x49')]['id']){delete _0x18e7f0[_0x961b('0x49')]['id'];}return db[_0x961b('0x2c')][_0x961b('0x4b')]({'where':{'id':_0x18e7f0[_0x961b('0x45')]['id']}})[_0x961b('0x26')](handleEntityNotFound(_0x5d2ffe,null))[_0x961b('0x26')](function(_0x31050e){if(_0x31050e){return _0x31050e['setTags'](_0x18e7f0['body'][_0x961b('0x51')]||[]);}return null;})[_0x961b('0x26')](respondWithResult(_0x5d2ffe,null))['catch'](handleError(_0x5d2ffe,null));}; \ No newline at end of file +var _0x26a0=['options','includeAll','include','ZendeskConfiguration','findAll','rows','catch','params','create','body','find','destroy','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','order','nolimit','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','end','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x3d6dc4,_0x132d7a){var _0x1b8438=function(_0xe45fe5){while(--_0xe45fe5){_0x3d6dc4['push'](_0x3d6dc4['shift']());}};_0x1b8438(++_0x132d7a);}(_0x26a0,0xbc));var _0x026a=function(_0x1ce70b,_0xcfab32){_0x1ce70b=_0x1ce70b-0x0;var _0x400ec4=_0x26a0[_0x1ce70b];return _0x400ec4;};'use strict';var emlformat=require(_0x026a('0x0'));var rimraf=require(_0x026a('0x1'));var zipdir=require(_0x026a('0x2'));var jsonpatch=require(_0x026a('0x3'));var rp=require(_0x026a('0x4'));var moment=require(_0x026a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x026a('0x6'));var path=require('path');var sox=require(_0x026a('0x7'));var csv=require(_0x026a('0x8'));var ejs=require(_0x026a('0x9'));var fs=require('fs');var fs_extra=require(_0x026a('0xa'));var _=require(_0x026a('0xb'));var squel=require('squel');var crypto=require(_0x026a('0xc'));var jsforce=require(_0x026a('0xd'));var deskjs=require(_0x026a('0xe'));var toCsv=require(_0x026a('0x8'));var querystring=require(_0x026a('0xf'));var Papa=require('papaparse');var Redis=require(_0x026a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x026a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x026a('0x12'))(_0x026a('0x13'));var utils=require(_0x026a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x026a('0x15'));var db=require(_0x026a('0x16'))['db'];function respondWithStatusCode(_0x108b96,_0x467887){_0x467887=_0x467887||0xcc;return function(_0x5668b0){if(_0x5668b0){return _0x108b96[_0x026a('0x17')](_0x467887);}return _0x108b96['status'](_0x467887)['end']();};}function respondWithResult(_0x184cce,_0x5d4a43){_0x5d4a43=_0x5d4a43||0xc8;return function(_0x2f8816){if(_0x2f8816){return _0x184cce[_0x026a('0x18')](_0x5d4a43)['json'](_0x2f8816);}};}function respondWithFilteredResult(_0x3a2a78,_0x2d0295){return function(_0xfbaef7){if(_0xfbaef7){var _0x3a42e5=typeof _0x2d0295[_0x026a('0x19')]==='undefined'&&typeof _0x2d0295[_0x026a('0x1a')]==='undefined';var _0x323b8d=_0xfbaef7['count'];var _0x4185f8=_0x3a42e5?0x0:_0x2d0295[_0x026a('0x19')];var _0x147c89=_0x3a42e5?_0xfbaef7[_0x026a('0x1b')]:_0x2d0295['offset']+_0x2d0295['limit'];var _0x29e518;if(_0x147c89>=_0x323b8d){_0x147c89=_0x323b8d;_0x29e518=0xc8;}else{_0x29e518=0xce;}_0x3a2a78[_0x026a('0x18')](_0x29e518);return _0x3a2a78[_0x026a('0x1c')](_0x026a('0x1d'),_0x4185f8+'-'+_0x147c89+'/'+_0x323b8d)[_0x026a('0x1e')](_0xfbaef7);}return null;};}function patchUpdates(_0x3294b4){return function(_0x1a02fd){try{jsonpatch['apply'](_0x1a02fd,_0x3294b4,!![]);}catch(_0x1f9255){return BPromise[_0x026a('0x1f')](_0x1f9255);}return _0x1a02fd[_0x026a('0x20')]();};}function saveUpdates(_0x13313d,_0x285755){return function(_0x593913){if(_0x593913){return _0x593913[_0x026a('0x21')](_0x13313d)['then'](function(_0x192bd2){return _0x192bd2;});}return null;};}function removeEntity(_0x54481c,_0x1586bc){return function(_0x2516bf){if(_0x2516bf){return _0x2516bf['destroy']()[_0x026a('0x22')](function(){_0x54481c[_0x026a('0x18')](0xcc)[_0x026a('0x23')]();});}};}function handleEntityNotFound(_0x2f8e2b,_0x56f40e){return function(_0xe17b60){if(!_0xe17b60){_0x2f8e2b[_0x026a('0x17')](0x194);}return _0xe17b60;};}function handleError(_0x2805f8,_0x3f41ee){_0x3f41ee=_0x3f41ee||0x1f4;return function(_0x80616){logger['error'](_0x80616[_0x026a('0x24')]);if(_0x80616['name']){delete _0x80616[_0x026a('0x25')];}_0x2805f8[_0x026a('0x18')](_0x3f41ee)[_0x026a('0x26')](_0x80616);};}exports['index']=function(_0x3e0e4e,_0x3383b2){var _0x47bdd3={},_0x305619={},_0x2c521d={'count':0x0,'rows':[]};var _0x28cd4b=_['map'](db['ZendeskConfiguration'][_0x026a('0x27')],function(_0x4b0a75){return{'name':_0x4b0a75[_0x026a('0x28')],'type':_0x4b0a75[_0x026a('0x29')][_0x026a('0x2a')]};});_0x305619[_0x026a('0x2b')]=_[_0x026a('0x2c')](_0x28cd4b,'name');_0x305619[_0x026a('0x2d')]=_[_0x026a('0x2e')](_0x3e0e4e[_0x026a('0x2d')]);_0x305619[_0x026a('0x2f')]=_['intersection'](_0x305619[_0x026a('0x2b')],_0x305619[_0x026a('0x2d')]);_0x47bdd3[_0x026a('0x30')]=_[_0x026a('0x31')](_0x305619[_0x026a('0x2b')],qs['fields'](_0x3e0e4e[_0x026a('0x2d')][_0x026a('0x32')]));_0x47bdd3['attributes']=_0x47bdd3[_0x026a('0x30')][_0x026a('0x33')]?_0x47bdd3['attributes']:_0x305619[_0x026a('0x2b')];if(!_0x3e0e4e['query']['hasOwnProperty']('nolimit')){_0x47bdd3[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x3e0e4e[_0x026a('0x2d')][_0x026a('0x1a')]);_0x47bdd3[_0x026a('0x19')]=qs['offset'](_0x3e0e4e[_0x026a('0x2d')][_0x026a('0x19')]);}_0x47bdd3['order']=qs['sort'](_0x3e0e4e[_0x026a('0x2d')][_0x026a('0x34')]);_0x47bdd3[_0x026a('0x35')]=qs[_0x026a('0x2f')](_[_0x026a('0x36')](_0x3e0e4e[_0x026a('0x2d')],_0x305619[_0x026a('0x2f')]),_0x28cd4b);if(_0x3e0e4e[_0x026a('0x2d')][_0x026a('0x37')]){_0x47bdd3[_0x026a('0x35')]=_[_0x026a('0x38')](_0x47bdd3[_0x026a('0x35')],{'$or':_[_0x026a('0x2c')](_0x28cd4b,function(_0x1a38fd){if(_0x1a38fd[_0x026a('0x29')]!==_0x026a('0x39')){var _0x33185f={};_0x33185f[_0x1a38fd[_0x026a('0x25')]]={'$like':'%'+_0x3e0e4e['query'][_0x026a('0x37')]+'%'};return _0x33185f;}})});}_0x47bdd3=_['merge']({},_0x47bdd3,_0x3e0e4e[_0x026a('0x3a')]);var _0x1f8dad={'where':_0x47bdd3[_0x026a('0x35')]};return db['ZendeskConfiguration'][_0x026a('0x1b')](_0x1f8dad)[_0x026a('0x22')](function(_0x2ff7b0){_0x2c521d[_0x026a('0x1b')]=_0x2ff7b0;if(_0x3e0e4e[_0x026a('0x2d')][_0x026a('0x3b')]){_0x47bdd3[_0x026a('0x3c')]=[{'all':!![]}];}return db[_0x026a('0x3d')][_0x026a('0x3e')](_0x47bdd3);})[_0x026a('0x22')](function(_0x5c5c78){_0x2c521d[_0x026a('0x3f')]=_0x5c5c78;return _0x2c521d;})['then'](respondWithFilteredResult(_0x3383b2,_0x47bdd3))[_0x026a('0x40')](handleError(_0x3383b2,null));};exports['show']=function(_0x1a64c9,_0x30f987){var _0x32dec6={'raw':![],'where':{'id':_0x1a64c9[_0x026a('0x41')]['id']}},_0x57381b={};_0x57381b['model']=_[_0x026a('0x2e')](db[_0x026a('0x3d')][_0x026a('0x27')]);_0x57381b[_0x026a('0x2d')]=_[_0x026a('0x2e')](_0x1a64c9[_0x026a('0x2d')]);_0x57381b[_0x026a('0x2f')]=_['intersection'](_0x57381b[_0x026a('0x2b')],_0x57381b['query']);_0x32dec6[_0x026a('0x30')]=_[_0x026a('0x31')](_0x57381b[_0x026a('0x2b')],qs[_0x026a('0x32')](_0x1a64c9[_0x026a('0x2d')][_0x026a('0x32')]));_0x32dec6[_0x026a('0x30')]=_0x32dec6[_0x026a('0x30')][_0x026a('0x33')]?_0x32dec6['attributes']:_0x57381b['model'];if(_0x1a64c9['query'][_0x026a('0x3b')]){_0x32dec6[_0x026a('0x3c')]=[{'all':!![]}];}_0x32dec6=_['merge']({},_0x32dec6,_0x1a64c9[_0x026a('0x3a')]);return db[_0x026a('0x3d')]['find'](_0x32dec6)['then'](handleEntityNotFound(_0x30f987,null))[_0x026a('0x22')](respondWithResult(_0x30f987,null))[_0x026a('0x40')](handleError(_0x30f987,null));};exports[_0x026a('0x42')]=function(_0x1ed564,_0x156c5a){return db[_0x026a('0x3d')][_0x026a('0x42')](_0x1ed564[_0x026a('0x43')],{})[_0x026a('0x22')](respondWithResult(_0x156c5a,0xc9))['catch'](handleError(_0x156c5a,null));};exports['update']=function(_0x3130f3,_0x4e15c3){if(_0x3130f3[_0x026a('0x43')]['id']){delete _0x3130f3[_0x026a('0x43')]['id'];}return db['ZendeskConfiguration'][_0x026a('0x44')]({'where':{'id':_0x3130f3[_0x026a('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e15c3,null))[_0x026a('0x22')](saveUpdates(_0x3130f3[_0x026a('0x43')],null))[_0x026a('0x22')](respondWithResult(_0x4e15c3,null))['catch'](handleError(_0x4e15c3,null));};exports[_0x026a('0x45')]=function(_0x4eb289,_0x39a63a){return db[_0x026a('0x3d')][_0x026a('0x44')]({'where':{'id':_0x4eb289['params']['id']}})['then'](handleEntityNotFound(_0x39a63a,null))[_0x026a('0x22')](removeEntity(_0x39a63a,null))[_0x026a('0x40')](handleError(_0x39a63a,null));};exports[_0x026a('0x46')]=function(_0x3e5ba5,_0x59d0d8,_0x184101){var _0xcd8a5c={};var _0x14173c={};var _0x9878d6;var _0x363406;return db[_0x026a('0x3d')][_0x026a('0x47')]({'where':{'id':_0x3e5ba5[_0x026a('0x41')]['id']}})[_0x026a('0x22')](handleEntityNotFound(_0x59d0d8,null))['then'](function(_0x97377){if(_0x97377){_0x9878d6=_0x97377;_0x14173c[_0x026a('0x2b')]=_[_0x026a('0x2e')](db[_0x026a('0x48')][_0x026a('0x27')]);_0x14173c[_0x026a('0x2d')]=_['keys'](_0x3e5ba5[_0x026a('0x2d')]);_0x14173c[_0x026a('0x2f')]=_[_0x026a('0x31')](_0x14173c[_0x026a('0x2b')],_0x14173c[_0x026a('0x2d')]);_0xcd8a5c[_0x026a('0x30')]=_[_0x026a('0x31')](_0x14173c['model'],qs[_0x026a('0x32')](_0x3e5ba5[_0x026a('0x2d')][_0x026a('0x32')]));_0xcd8a5c[_0x026a('0x30')]=_0xcd8a5c[_0x026a('0x30')][_0x026a('0x33')]?_0xcd8a5c[_0x026a('0x30')]:_0x14173c[_0x026a('0x2b')];_0xcd8a5c['order']=qs[_0x026a('0x34')](_0x3e5ba5[_0x026a('0x2d')][_0x026a('0x34')]);_0xcd8a5c[_0x026a('0x35')]=qs[_0x026a('0x2f')](_[_0x026a('0x36')](_0x3e5ba5[_0x026a('0x2d')],_0x14173c[_0x026a('0x2f')]));if(_0x3e5ba5[_0x026a('0x2d')][_0x026a('0x37')]){_0xcd8a5c[_0x026a('0x35')]=_['merge'](_0xcd8a5c[_0x026a('0x35')],{'$or':_['map'](_0xcd8a5c[_0x026a('0x30')],function(_0xfb5a8f){var _0xc60251={};_0xc60251[_0xfb5a8f]={'$like':'%'+_0x3e5ba5['query'][_0x026a('0x37')]+'%'};return _0xc60251;})});}_0xcd8a5c=_[_0x026a('0x38')]({},_0xcd8a5c,_0x3e5ba5[_0x026a('0x3a')]);return _0x9878d6[_0x026a('0x46')](_0xcd8a5c);}})['then'](function(_0x7366a8){if(_0x7366a8){_0x363406=_0x7366a8[_0x026a('0x33')];if(!_0x3e5ba5['query'][_0x026a('0x49')]('nolimit')){_0xcd8a5c[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x3e5ba5['query'][_0x026a('0x1a')]);_0xcd8a5c[_0x026a('0x19')]=qs[_0x026a('0x19')](_0x3e5ba5[_0x026a('0x2d')][_0x026a('0x19')]);}return _0x9878d6[_0x026a('0x46')](_0xcd8a5c);}})['then'](function(_0x45907d){if(_0x45907d){return _0x45907d?{'count':_0x363406,'rows':_0x45907d}:null;}})[_0x026a('0x22')](respondWithResult(_0x59d0d8,null))[_0x026a('0x40')](handleError(_0x59d0d8,null));};exports[_0x026a('0x4a')]=function(_0x5efd35,_0x1d2c3e,_0x34507d){var _0x5c6091={};var _0x5b1f57={};var _0x261c3b;var _0x159026;return db[_0x026a('0x3d')]['findOne']({'where':{'id':_0x5efd35['params']['id']}})[_0x026a('0x22')](handleEntityNotFound(_0x1d2c3e,null))['then'](function(_0x5e72cd){if(_0x5e72cd){_0x261c3b=_0x5e72cd;_0x5b1f57['model']=_['keys'](db[_0x026a('0x48')][_0x026a('0x27')]);_0x5b1f57[_0x026a('0x2d')]=_[_0x026a('0x2e')](_0x5efd35[_0x026a('0x2d')]);_0x5b1f57[_0x026a('0x2f')]=_['intersection'](_0x5b1f57['model'],_0x5b1f57[_0x026a('0x2d')]);_0x5c6091['attributes']=_[_0x026a('0x31')](_0x5b1f57[_0x026a('0x2b')],qs['fields'](_0x5efd35[_0x026a('0x2d')]['fields']));_0x5c6091[_0x026a('0x30')]=_0x5c6091[_0x026a('0x30')]['length']?_0x5c6091[_0x026a('0x30')]:_0x5b1f57[_0x026a('0x2b')];_0x5c6091[_0x026a('0x4b')]=qs[_0x026a('0x34')](_0x5efd35[_0x026a('0x2d')][_0x026a('0x34')]);_0x5c6091[_0x026a('0x35')]=qs[_0x026a('0x2f')](_[_0x026a('0x36')](_0x5efd35['query'],_0x5b1f57[_0x026a('0x2f')]));if(_0x5efd35['query'][_0x026a('0x37')]){_0x5c6091[_0x026a('0x35')]=_[_0x026a('0x38')](_0x5c6091[_0x026a('0x35')],{'$or':_[_0x026a('0x2c')](_0x5c6091[_0x026a('0x30')],function(_0x11925f){var _0x117587={};_0x117587[_0x11925f]={'$like':'%'+_0x5efd35[_0x026a('0x2d')][_0x026a('0x37')]+'%'};return _0x117587;})});}_0x5c6091=_[_0x026a('0x38')]({},_0x5c6091,_0x5efd35[_0x026a('0x3a')]);return _0x261c3b[_0x026a('0x4a')](_0x5c6091);}})['then'](function(_0x478580){if(_0x478580){_0x159026=_0x478580[_0x026a('0x33')];if(!_0x5efd35['query']['hasOwnProperty'](_0x026a('0x4c'))){_0x5c6091[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x5efd35[_0x026a('0x2d')][_0x026a('0x1a')]);_0x5c6091[_0x026a('0x19')]=qs[_0x026a('0x19')](_0x5efd35[_0x026a('0x2d')]['offset']);}return _0x261c3b[_0x026a('0x4a')](_0x5c6091);}})[_0x026a('0x22')](function(_0x21b9c1){if(_0x21b9c1){return _0x21b9c1?{'count':_0x159026,'rows':_0x21b9c1}:null;}})[_0x026a('0x22')](respondWithResult(_0x1d2c3e,null))[_0x026a('0x40')](handleError(_0x1d2c3e,null));};exports['getDescriptions']=function(_0x1a1f06,_0x48dd0e,_0x14b911){var _0x3fc63d={};var _0x4c3f9a={};var _0x348eb6;var _0x28a95e;return db[_0x026a('0x3d')][_0x026a('0x47')]({'where':{'id':_0x1a1f06[_0x026a('0x41')]['id']}})[_0x026a('0x22')](handleEntityNotFound(_0x48dd0e,null))['then'](function(_0x2f5453){if(_0x2f5453){_0x348eb6=_0x2f5453;_0x4c3f9a[_0x026a('0x2b')]=_[_0x026a('0x2e')](db[_0x026a('0x48')]['rawAttributes']);_0x4c3f9a['query']=_['keys'](_0x1a1f06[_0x026a('0x2d')]);_0x4c3f9a['filters']=_['intersection'](_0x4c3f9a[_0x026a('0x2b')],_0x4c3f9a[_0x026a('0x2d')]);_0x3fc63d['attributes']=_['intersection'](_0x4c3f9a[_0x026a('0x2b')],qs[_0x026a('0x32')](_0x1a1f06[_0x026a('0x2d')][_0x026a('0x32')]));_0x3fc63d[_0x026a('0x30')]=_0x3fc63d[_0x026a('0x30')][_0x026a('0x33')]?_0x3fc63d[_0x026a('0x30')]:_0x4c3f9a['model'];_0x3fc63d['order']=qs[_0x026a('0x34')](_0x1a1f06[_0x026a('0x2d')]['sort']);_0x3fc63d[_0x026a('0x35')]=qs[_0x026a('0x2f')](_[_0x026a('0x36')](_0x1a1f06[_0x026a('0x2d')],_0x4c3f9a[_0x026a('0x2f')]));if(_0x1a1f06['query'][_0x026a('0x37')]){_0x3fc63d['where']=_['merge'](_0x3fc63d[_0x026a('0x35')],{'$or':_[_0x026a('0x2c')](_0x3fc63d[_0x026a('0x30')],function(_0x5c0e1d){var _0x10db3d={};_0x10db3d[_0x5c0e1d]={'$like':'%'+_0x1a1f06[_0x026a('0x2d')][_0x026a('0x37')]+'%'};return _0x10db3d;})});}_0x3fc63d=_[_0x026a('0x38')]({},_0x3fc63d,_0x1a1f06['options']);return _0x348eb6[_0x026a('0x4d')](_0x3fc63d);}})[_0x026a('0x22')](function(_0x502235){if(_0x502235){_0x28a95e=_0x502235[_0x026a('0x33')];if(!_0x1a1f06[_0x026a('0x2d')][_0x026a('0x49')](_0x026a('0x4c'))){_0x3fc63d[_0x026a('0x1a')]=qs['limit'](_0x1a1f06[_0x026a('0x2d')]['limit']);_0x3fc63d[_0x026a('0x19')]=qs[_0x026a('0x19')](_0x1a1f06['query'][_0x026a('0x19')]);}return _0x348eb6[_0x026a('0x4d')](_0x3fc63d);}})[_0x026a('0x22')](function(_0x5c3d49){if(_0x5c3d49){return _0x5c3d49?{'count':_0x28a95e,'rows':_0x5c3d49}:null;}})[_0x026a('0x22')](respondWithResult(_0x48dd0e,null))[_0x026a('0x40')](handleError(_0x48dd0e,null));};exports['getTags']=function(_0x23c15f,_0x4caefb,_0x2e5f6c){var _0x28c8c1={};var _0x6ea425={};var _0x415205;var _0x121cc3;return db[_0x026a('0x3d')][_0x026a('0x47')]({'where':{'id':_0x23c15f[_0x026a('0x41')]['id']}})[_0x026a('0x22')](handleEntityNotFound(_0x4caefb,null))[_0x026a('0x22')](function(_0x61cd3b){if(_0x61cd3b){_0x415205=_0x61cd3b;_0x6ea425[_0x026a('0x2b')]=_[_0x026a('0x2e')](db[_0x026a('0x4e')][_0x026a('0x27')]);_0x6ea425[_0x026a('0x2d')]=_[_0x026a('0x2e')](_0x23c15f[_0x026a('0x2d')]);_0x6ea425[_0x026a('0x2f')]=_['intersection'](_0x6ea425[_0x026a('0x2b')],_0x6ea425[_0x026a('0x2d')]);_0x28c8c1[_0x026a('0x30')]=_[_0x026a('0x31')](_0x6ea425[_0x026a('0x2b')],qs[_0x026a('0x32')](_0x23c15f[_0x026a('0x2d')][_0x026a('0x32')]));_0x28c8c1[_0x026a('0x30')]=_0x28c8c1['attributes'][_0x026a('0x33')]?_0x28c8c1[_0x026a('0x30')]:_0x6ea425[_0x026a('0x2b')];_0x28c8c1[_0x026a('0x4b')]=qs[_0x026a('0x34')](_0x23c15f[_0x026a('0x2d')]['sort']);_0x28c8c1[_0x026a('0x35')]=qs[_0x026a('0x2f')](_[_0x026a('0x36')](_0x23c15f[_0x026a('0x2d')],_0x6ea425[_0x026a('0x2f')]));if(_0x23c15f[_0x026a('0x2d')][_0x026a('0x37')]){_0x28c8c1[_0x026a('0x35')]=_['merge'](_0x28c8c1['where'],{'$or':_[_0x026a('0x2c')](_0x28c8c1[_0x026a('0x30')],function(_0x4e334c){var _0x4f6c42={};_0x4f6c42[_0x4e334c]={'$like':'%'+_0x23c15f['query'][_0x026a('0x37')]+'%'};return _0x4f6c42;})});}_0x28c8c1=_[_0x026a('0x38')]({},_0x28c8c1,_0x23c15f[_0x026a('0x3a')]);return _0x415205[_0x026a('0x4f')](_0x28c8c1);}})[_0x026a('0x22')](function(_0x587beb){if(_0x587beb){_0x121cc3=_0x587beb['length'];if(!_0x23c15f[_0x026a('0x2d')][_0x026a('0x49')]('nolimit')){_0x28c8c1[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x23c15f[_0x026a('0x2d')][_0x026a('0x1a')]);_0x28c8c1[_0x026a('0x19')]=qs['offset'](_0x23c15f[_0x026a('0x2d')][_0x026a('0x19')]);}return _0x415205[_0x026a('0x4f')](_0x28c8c1);}})['then'](function(_0x3bbea0){if(_0x3bbea0){return _0x3bbea0?{'count':_0x121cc3,'rows':_0x3bbea0}:null;}})['then'](respondWithResult(_0x4caefb,null))[_0x026a('0x40')](handleError(_0x4caefb,null));};exports[_0x026a('0x50')]=function(_0x3afbf0,_0x176010,_0x380eef){if(_0x3afbf0[_0x026a('0x43')]['id']){delete _0x3afbf0['body']['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3afbf0[_0x026a('0x41')]['id']}})[_0x026a('0x22')](handleEntityNotFound(_0x176010,null))[_0x026a('0x22')](function(_0x43bd5f){if(_0x43bd5f){return _0x43bd5f['setTags'](_0x3afbf0['body'][_0x026a('0x51')]||[]);}return null;})[_0x026a('0x22')](respondWithResult(_0x176010,null))[_0x026a('0x40')](handleError(_0x176010,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 81702c1..60fb577 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 _0xfcbb=['rimraf','../../config/environment','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x2d89f7,_0x4e2553){var _0x3c226d=function(_0x53ad66){while(--_0x53ad66){_0x2d89f7['push'](_0x2d89f7['shift']());}};_0x3c226d(++_0x4e2553);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x1f4c43,_0x11819a){_0x1f4c43=_0x1f4c43-0x0;var _0x5ec2b2=_0xfcbb[_0x1f4c43];return _0x5ec2b2;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var logger=require(_0xbfcb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbfcb('0x3'));var rp=require(_0xbfcb('0x4'));var fs=require('fs');var path=require(_0xbfcb('0x5'));var rimraf=require(_0xbfcb('0x6'));var config=require(_0xbfcb('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x32c2aa,_0x4990c){return _0x32c2aa[_0xbfcb('0x8')](_0xbfcb('0x9'),attributes,{'tableName':_0xbfcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x065e=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','define','int_zendesk_configurations','lodash'];(function(_0xf7f1b4,_0x1b6d93){var _0x4da4a9=function(_0x438ca0){while(--_0x438ca0){_0xf7f1b4['push'](_0xf7f1b4['shift']());}};_0x4da4a9(++_0x1b6d93);}(_0x065e,0x1a7));var _0xe065=function(_0x10b743,_0x29bf0d){_0x10b743=_0x10b743-0x0;var _0x2e4595=_0x065e[_0x10b743];return _0x2e4595;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe065('0x1'));var BPromise=require(_0xe065('0x2'));var rp=require(_0xe065('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe065('0x4'));var attributes=require(_0xe065('0x5'));module['exports']=function(_0x10b45f,_0x1e7e69){return _0x10b45f[_0xe065('0x6')]('ZendeskConfiguration',attributes,{'tableName':_0xe065('0x7'),'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 72915b0..3ca69c1 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 _0x98f8=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x32b92b,_0xbb85f1){var _0x38ef8e=function(_0xc12e91){while(--_0xc12e91){_0x32b92b['push'](_0x32b92b['shift']());}};_0x38ef8e(++_0xbb85f1);}(_0x98f8,0x16e));var _0x898f=function(_0x5a8f34,_0x11c27b){_0x5a8f34=_0x5a8f34-0x0;var _0x497614=_0x98f8[_0x5a8f34];return _0x497614;};'use strict';var _=require(_0x898f('0x0'));var util=require(_0x898f('0x1'));var moment=require('moment');var BPromise=require(_0x898f('0x2'));var rs=require(_0x898f('0x3'));var fs=require('fs');var Redis=require(_0x898f('0x4'));var db=require(_0x898f('0x5'))['db'];var utils=require(_0x898f('0x6'));var logger=require('../../config/logger')(_0x898f('0x7'));var config=require(_0x898f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x898f('0x9')][_0x898f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22bd17,_0x35f706,_0x3fc98e){return new BPromise(function(_0xe04f6f,_0x1a99f0){return client[_0x898f('0xb')](_0x22bd17,_0x3fc98e)['then'](function(_0x2629ba){logger[_0x898f('0xc')](_0x898f('0xd'),_0x35f706,'request\x20sent');logger[_0x898f('0xe')](_0x898f('0xf'),_0x35f706,_0x898f('0x10'),JSON[_0x898f('0x11')](_0x2629ba));if(_0x2629ba['error']){if(_0x2629ba[_0x898f('0x12')][_0x898f('0x13')]===0x1f4){logger['error'](_0x898f('0xd'),_0x35f706,_0x2629ba[_0x898f('0x12')][_0x898f('0x14')]);return _0x1a99f0(_0x2629ba[_0x898f('0x12')][_0x898f('0x14')]);}logger[_0x898f('0x12')](_0x898f('0xd'),_0x35f706,_0x2629ba[_0x898f('0x12')][_0x898f('0x14')]);return _0xe04f6f(_0x2629ba[_0x898f('0x12')][_0x898f('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x35f706,_0x898f('0x10'));_0xe04f6f(_0x2629ba[_0x898f('0x15')][_0x898f('0x14')]);}})[_0x898f('0x16')](function(_0x88bc32){logger[_0x898f('0x12')](_0x898f('0xd'),_0x35f706,_0x88bc32);_0x1a99f0(_0x88bc32);});});} \ No newline at end of file +var _0xefee=['request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x47d41c,_0x10c552){var _0x414cd7=function(_0x50c27a){while(--_0x50c27a){_0x47d41c['push'](_0x47d41c['shift']());}};_0x414cd7(++_0x10c552);}(_0xefee,0x1e6));var _0xeefe=function(_0x4d51e4,_0x29c50d){_0x4d51e4=_0x4d51e4-0x0;var _0x1f3e05=_0xefee[_0x4d51e4];return _0x1f3e05;};'use strict';var _=require(_0xeefe('0x0'));var util=require(_0xeefe('0x1'));var moment=require(_0xeefe('0x2'));var BPromise=require(_0xeefe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeefe('0x4'));var db=require(_0xeefe('0x5'))['db'];var utils=require(_0xeefe('0x6'));var logger=require('../../config/logger')(_0xeefe('0x7'));var config=require(_0xeefe('0x8'));var jayson=require(_0xeefe('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x322d17,_0x20489f,_0x1ad685){return new BPromise(function(_0x2fd002,_0x122973){return client[_0xeefe('0xa')](_0x322d17,_0x1ad685)[_0xeefe('0xb')](function(_0x877d80){logger[_0xeefe('0xc')](_0xeefe('0xd'),_0x20489f,_0xeefe('0xe'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x20489f,_0xeefe('0xe'),JSON[_0xeefe('0xf')](_0x877d80));if(_0x877d80[_0xeefe('0x10')]){if(_0x877d80[_0xeefe('0x10')]['code']===0x1f4){logger[_0xeefe('0x10')](_0xeefe('0xd'),_0x20489f,_0x877d80[_0xeefe('0x10')][_0xeefe('0x11')]);return _0x122973(_0x877d80[_0xeefe('0x10')][_0xeefe('0x11')]);}logger['error'](_0xeefe('0xd'),_0x20489f,_0x877d80[_0xeefe('0x10')][_0xeefe('0x11')]);return _0x2fd002(_0x877d80[_0xeefe('0x10')]['message']);}else{logger[_0xeefe('0xc')](_0xeefe('0xd'),_0x20489f,'request\x20sent');_0x2fd002(_0x877d80[_0xeefe('0x12')]['message']);}})[_0xeefe('0x13')](function(_0x53c3a0){logger[_0xeefe('0x10')](_0xeefe('0xd'),_0x20489f,_0x53c3a0);_0x122973(_0x53c3a0);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 944ebc9..f715596 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 _0x5f09=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','show','create','put','isAuthenticated','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f09,0x8d));var _0x95f0=function(_0x156437,_0x2d6910){_0x156437=_0x156437-0x0;var _0x74ea68=_0x5f09[_0x156437];return _0x74ea68;};'use strict';var multer=require('multer');var util=require(_0x95f0('0x0'));var path=require('path');var timeout=require(_0x95f0('0x1'));var express=require(_0x95f0('0x2'));var router=express[_0x95f0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x95f0('0x4'));var interaction=require(_0x95f0('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x95f0('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x95f0('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x95f0('0x8')]);router[_0x95f0('0x9')]('/:id',auth[_0x95f0('0xa')](),controller[_0x95f0('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x95f0('0xc')]);module[_0x95f0('0xd')]=router; \ No newline at end of file +var _0x08d5=['fs-extra','../../config/environment','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x31264f,_0x1212b0){var _0x54b08d=function(_0x40c8be){while(--_0x40c8be){_0x31264f['push'](_0x31264f['shift']());}};_0x54b08d(++_0x1212b0);}(_0x08d5,0x14f));var _0x508d=function(_0x497e50,_0x2c2177){_0x497e50=_0x497e50-0x0;var _0x2eaa88=_0x08d5[_0x497e50];return _0x2eaa88;};'use strict';var multer=require(_0x508d('0x0'));var util=require('util');var path=require(_0x508d('0x1'));var timeout=require(_0x508d('0x2'));var express=require(_0x508d('0x3'));var router=express[_0x508d('0x4')]();var fs_extra=require(_0x508d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x508d('0x6'));var controller=require('./intZendeskField.controller');router[_0x508d('0x7')]('/',auth[_0x508d('0x8')](),controller['index']);router[_0x508d('0x7')]('/:id',auth[_0x508d('0x8')](),controller[_0x508d('0x9')]);router[_0x508d('0xa')]('/',auth[_0x508d('0x8')](),controller[_0x508d('0xb')]);router['put'](_0x508d('0xc'),auth['isAuthenticated'](),controller[_0x508d('0xd')]);router[_0x508d('0xe')](_0x508d('0xc'),auth[_0x508d('0x8')](),controller[_0x508d('0xf')]);module[_0x508d('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index e6b2117..187215b 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 _0x5741=['ENUM','BOOLEAN','exports','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x43fd8c,_0x1cc721){var _0x558a00=function(_0x15949a){while(--_0x15949a){_0x43fd8c['push'](_0x43fd8c['shift']());}};_0x558a00(++_0x1cc721);}(_0x5741,0x89));var _0x1574=function(_0x38df21,_0x288856){_0x38df21=_0x38df21-0x0;var _0x247efc=_0x5741[_0x38df21];return _0x247efc;};'use strict';var Sequelize=require('sequelize');module[_0x1574('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x1574('0x1'),_0x1574('0x2'),_0x1574('0x3'),_0x1574('0x4')),'defaultValue':_0x1574('0x5')},'content':{'type':Sequelize[_0x1574('0x6')]},'key':{'type':Sequelize[_0x1574('0x6')]},'keyType':{'type':Sequelize[_0x1574('0x7')](_0x1574('0x5'),'variable',_0x1574('0x2'))},'keyContent':{'type':Sequelize[_0x1574('0x6')]},'idField':{'type':Sequelize[_0x1574('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1574('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1574('0x6')]}}; \ No newline at end of file +var _0xf6d4=['string','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','ENUM'];(function(_0xf149c0,_0x18bee6){var _0x270633=function(_0x17a06d){while(--_0x17a06d){_0xf149c0['push'](_0xf149c0['shift']());}};_0x270633(++_0x18bee6);}(_0xf6d4,0x18e));var _0x4f6d=function(_0x1bda3e,_0x2ceda1){_0x1bda3e=_0x1bda3e-0x0;var _0x6de9f3=_0xf6d4[_0x1bda3e];return _0x6de9f3;};'use strict';var Sequelize=require(_0x4f6d('0x0'));module['exports']={'type':{'type':Sequelize[_0x4f6d('0x1')](_0x4f6d('0x2'),'variable','customVariable',_0x4f6d('0x3'),_0x4f6d('0x4')),'defaultValue':_0x4f6d('0x2')},'content':{'type':Sequelize[_0x4f6d('0x5')]},'key':{'type':Sequelize[_0x4f6d('0x5')]},'keyType':{'type':Sequelize[_0x4f6d('0x1')]('string',_0x4f6d('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x4f6d('0x5')]},'idField':{'type':Sequelize[_0x4f6d('0x5')]},'nameField':{'type':Sequelize[_0x4f6d('0x5')]},'customField':{'type':Sequelize[_0x4f6d('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 ebf8b19..10d4bc2 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 _0xcfee=['crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel'];(function(_0x374ddc,_0x1c612b){var _0x18575e=function(_0x1cabb6){while(--_0x1cabb6){_0x374ddc['push'](_0x374ddc['shift']());}};_0x18575e(++_0x1c612b);}(_0xcfee,0x175));var _0xecfe=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xcfee[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xecfe('0x0'));var zipdir=require(_0xecfe('0x1'));var jsonpatch=require(_0xecfe('0x2'));var rp=require(_0xecfe('0x3'));var moment=require('moment');var BPromise=require(_0xecfe('0x4'));var Mustache=require(_0xecfe('0x5'));var util=require(_0xecfe('0x6'));var path=require(_0xecfe('0x7'));var sox=require(_0xecfe('0x8'));var csv=require('to-csv');var ejs=require(_0xecfe('0x9'));var fs=require('fs');var fs_extra=require(_0xecfe('0xa'));var _=require('lodash');var squel=require(_0xecfe('0xb'));var crypto=require(_0xecfe('0xc'));var jsforce=require(_0xecfe('0xd'));var deskjs=require(_0xecfe('0xe'));var toCsv=require(_0xecfe('0xf'));var querystring=require(_0xecfe('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xecfe('0x11'));var qs=require(_0xecfe('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xecfe('0x13'));var logger=require(_0xecfe('0x14'))(_0xecfe('0x15'));var utils=require('../../config/utils');var config=require(_0xecfe('0x16'));var licenseUtil=require(_0xecfe('0x17'));var db=require(_0xecfe('0x18'))['db'];function respondWithStatusCode(_0x3abb0e,_0x244cb5){_0x244cb5=_0x244cb5||0xcc;return function(_0x493d77){if(_0x493d77){return _0x3abb0e[_0xecfe('0x19')](_0x244cb5);}return _0x3abb0e['status'](_0x244cb5)['end']();};}function respondWithResult(_0x464408,_0x38bb93){_0x38bb93=_0x38bb93||0xc8;return function(_0x38ffbf){if(_0x38ffbf){return _0x464408[_0xecfe('0x1a')](_0x38bb93)['json'](_0x38ffbf);}};}function respondWithFilteredResult(_0x42655f,_0x1128ac){return function(_0x1087d9){if(_0x1087d9){var _0x196e5a=typeof _0x1128ac['offset']===_0xecfe('0x1b')&&typeof _0x1128ac[_0xecfe('0x1c')]===_0xecfe('0x1b');var _0xedf697=_0x1087d9[_0xecfe('0x1d')];var _0x3d6ca4=_0x196e5a?0x0:_0x1128ac[_0xecfe('0x1e')];var _0x22ea0a=_0x196e5a?_0x1087d9[_0xecfe('0x1d')]:_0x1128ac[_0xecfe('0x1e')]+_0x1128ac[_0xecfe('0x1c')];var _0x7b74c0;if(_0x22ea0a>=_0xedf697){_0x22ea0a=_0xedf697;_0x7b74c0=0xc8;}else{_0x7b74c0=0xce;}_0x42655f[_0xecfe('0x1a')](_0x7b74c0);return _0x42655f[_0xecfe('0x1f')](_0xecfe('0x20'),_0x3d6ca4+'-'+_0x22ea0a+'/'+_0xedf697)[_0xecfe('0x21')](_0x1087d9);}return null;};}function patchUpdates(_0x152afa){return function(_0x150688){try{jsonpatch[_0xecfe('0x22')](_0x150688,_0x152afa,!![]);}catch(_0x4ab6ca){return BPromise[_0xecfe('0x23')](_0x4ab6ca);}return _0x150688[_0xecfe('0x24')]();};}function saveUpdates(_0x3978c1,_0x175141){return function(_0x2ed048){if(_0x2ed048){return _0x2ed048[_0xecfe('0x25')](_0x3978c1)[_0xecfe('0x26')](function(_0x479570){return _0x479570;});}return null;};}function removeEntity(_0x3d19db,_0x3fe3c4){return function(_0x105320){if(_0x105320){return _0x105320[_0xecfe('0x27')]()[_0xecfe('0x26')](function(){_0x3d19db[_0xecfe('0x1a')](0xcc)[_0xecfe('0x28')]();});}};}function handleEntityNotFound(_0x5cc2f4,_0x422c47){return function(_0x5b35a2){if(!_0x5b35a2){_0x5cc2f4[_0xecfe('0x19')](0x194);}return _0x5b35a2;};}function handleError(_0x3b9abb,_0x1f0422){_0x1f0422=_0x1f0422||0x1f4;return function(_0x370c9b){logger[_0xecfe('0x29')](_0x370c9b[_0xecfe('0x2a')]);if(_0x370c9b['name']){delete _0x370c9b[_0xecfe('0x2b')];}_0x3b9abb['status'](_0x1f0422)[_0xecfe('0x2c')](_0x370c9b);};}exports['index']=function(_0x51bac8,_0x5b337d){var _0x3d60fb={},_0x5b44bc={},_0x372105={'count':0x0,'rows':[]};var _0x5550ee=_[_0xecfe('0x2d')](db[_0xecfe('0x2e')][_0xecfe('0x2f')],function(_0x72d021){return{'name':_0x72d021[_0xecfe('0x30')],'type':_0x72d021[_0xecfe('0x31')][_0xecfe('0x32')]};});_0x5b44bc['model']=_[_0xecfe('0x2d')](_0x5550ee,_0xecfe('0x2b'));_0x5b44bc[_0xecfe('0x33')]=_['keys'](_0x51bac8[_0xecfe('0x33')]);_0x5b44bc[_0xecfe('0x34')]=_[_0xecfe('0x35')](_0x5b44bc[_0xecfe('0x36')],_0x5b44bc[_0xecfe('0x33')]);_0x3d60fb[_0xecfe('0x37')]=_['intersection'](_0x5b44bc[_0xecfe('0x36')],qs[_0xecfe('0x38')](_0x51bac8[_0xecfe('0x33')][_0xecfe('0x38')]));_0x3d60fb[_0xecfe('0x37')]=_0x3d60fb[_0xecfe('0x37')][_0xecfe('0x39')]?_0x3d60fb[_0xecfe('0x37')]:_0x5b44bc[_0xecfe('0x36')];if(!_0x51bac8[_0xecfe('0x33')][_0xecfe('0x3a')](_0xecfe('0x3b'))){_0x3d60fb[_0xecfe('0x1c')]=qs['limit'](_0x51bac8[_0xecfe('0x33')][_0xecfe('0x1c')]);_0x3d60fb[_0xecfe('0x1e')]=qs[_0xecfe('0x1e')](_0x51bac8[_0xecfe('0x33')][_0xecfe('0x1e')]);}_0x3d60fb[_0xecfe('0x3c')]=qs[_0xecfe('0x3d')](_0x51bac8[_0xecfe('0x33')][_0xecfe('0x3d')]);_0x3d60fb['where']=qs[_0xecfe('0x34')](_[_0xecfe('0x3e')](_0x51bac8[_0xecfe('0x33')],_0x5b44bc[_0xecfe('0x34')]),_0x5550ee);if(_0x51bac8['query'][_0xecfe('0x3f')]){_0x3d60fb['where']=_[_0xecfe('0x40')](_0x3d60fb['where'],{'$or':_[_0xecfe('0x2d')](_0x5550ee,function(_0x510bf6){if(_0x510bf6['type']!=='VIRTUAL'){var _0x2fbb71={};_0x2fbb71[_0x510bf6[_0xecfe('0x2b')]]={'$like':'%'+_0x51bac8[_0xecfe('0x33')][_0xecfe('0x3f')]+'%'};return _0x2fbb71;}})});}_0x3d60fb=_[_0xecfe('0x40')]({},_0x3d60fb,_0x51bac8[_0xecfe('0x41')]);var _0x43589b={'where':_0x3d60fb['where']};return db['ZendeskField'][_0xecfe('0x1d')](_0x43589b)[_0xecfe('0x26')](function(_0x2dc05d){_0x372105[_0xecfe('0x1d')]=_0x2dc05d;if(_0x51bac8['query'][_0xecfe('0x42')]){_0x3d60fb[_0xecfe('0x43')]=[{'all':!![]}];}return db[_0xecfe('0x2e')][_0xecfe('0x44')](_0x3d60fb);})['then'](function(_0x3c7fd6){_0x372105[_0xecfe('0x45')]=_0x3c7fd6;return _0x372105;})[_0xecfe('0x26')](respondWithFilteredResult(_0x5b337d,_0x3d60fb))[_0xecfe('0x46')](handleError(_0x5b337d,null));};exports[_0xecfe('0x47')]=function(_0x1f24e4,_0x4b68c2){var _0x5898e6={'raw':!![],'where':{'id':_0x1f24e4[_0xecfe('0x48')]['id']}},_0x3bb3a6={};_0x3bb3a6[_0xecfe('0x36')]=_['keys'](db[_0xecfe('0x2e')][_0xecfe('0x2f')]);_0x3bb3a6[_0xecfe('0x33')]=_[_0xecfe('0x49')](_0x1f24e4['query']);_0x3bb3a6[_0xecfe('0x34')]=_[_0xecfe('0x35')](_0x3bb3a6[_0xecfe('0x36')],_0x3bb3a6[_0xecfe('0x33')]);_0x5898e6['attributes']=_[_0xecfe('0x35')](_0x3bb3a6[_0xecfe('0x36')],qs['fields'](_0x1f24e4[_0xecfe('0x33')][_0xecfe('0x38')]));_0x5898e6[_0xecfe('0x37')]=_0x5898e6['attributes'][_0xecfe('0x39')]?_0x5898e6[_0xecfe('0x37')]:_0x3bb3a6[_0xecfe('0x36')];if(_0x1f24e4[_0xecfe('0x33')][_0xecfe('0x42')]){_0x5898e6[_0xecfe('0x43')]=[{'all':!![]}];}_0x5898e6=_[_0xecfe('0x40')]({},_0x5898e6,_0x1f24e4[_0xecfe('0x41')]);return db[_0xecfe('0x2e')][_0xecfe('0x4a')](_0x5898e6)[_0xecfe('0x26')](handleEntityNotFound(_0x4b68c2,null))[_0xecfe('0x26')](respondWithResult(_0x4b68c2,null))[_0xecfe('0x46')](handleError(_0x4b68c2,null));};exports[_0xecfe('0x4b')]=function(_0x213bb8,_0x410e88){return db[_0xecfe('0x2e')][_0xecfe('0x4b')](_0x213bb8[_0xecfe('0x4c')],{})['then'](respondWithResult(_0x410e88,0xc9))[_0xecfe('0x46')](handleError(_0x410e88,null));};exports[_0xecfe('0x25')]=function(_0x1b548b,_0x32a440){if(_0x1b548b['body']['id']){delete _0x1b548b['body']['id'];}return db[_0xecfe('0x2e')]['find']({'where':{'id':_0x1b548b[_0xecfe('0x48')]['id']}})[_0xecfe('0x26')](handleEntityNotFound(_0x32a440,null))[_0xecfe('0x26')](saveUpdates(_0x1b548b['body'],null))[_0xecfe('0x26')](respondWithResult(_0x32a440,null))['catch'](handleError(_0x32a440,null));};exports['destroy']=function(_0x15f11b,_0x501bf5){return db[_0xecfe('0x2e')][_0xecfe('0x4a')]({'where':{'id':_0x15f11b[_0xecfe('0x48')]['id']}})[_0xecfe('0x26')](handleEntityNotFound(_0x501bf5,null))[_0xecfe('0x26')](removeEntity(_0x501bf5,null))[_0xecfe('0x46')](handleError(_0x501bf5,null));}; \ No newline at end of file +var _0xdab2=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body'];(function(_0x49c73b,_0x4fe6e3){var _0x3cac41=function(_0x12efb9){while(--_0x12efb9){_0x49c73b['push'](_0x49c73b['shift']());}};_0x3cac41(++_0x4fe6e3);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2dab('0x0'));var rimraf=require(_0x2dab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2dab('0x2'));var rp=require(_0x2dab('0x3'));var moment=require(_0x2dab('0x4'));var BPromise=require(_0x2dab('0x5'));var Mustache=require('mustache');var util=require(_0x2dab('0x6'));var path=require(_0x2dab('0x7'));var sox=require(_0x2dab('0x8'));var csv=require(_0x2dab('0x9'));var ejs=require(_0x2dab('0xa'));var fs=require('fs');var fs_extra=require(_0x2dab('0xb'));var _=require(_0x2dab('0xc'));var squel=require(_0x2dab('0xd'));var crypto=require(_0x2dab('0xe'));var jsforce=require(_0x2dab('0xf'));var deskjs=require(_0x2dab('0x10'));var toCsv=require(_0x2dab('0x9'));var querystring=require(_0x2dab('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2dab('0x12'));var qs=require(_0x2dab('0x13'));var as=require(_0x2dab('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2dab('0x15'));var utils=require(_0x2dab('0x16'));var config=require(_0x2dab('0x17'));var licenseUtil=require(_0x2dab('0x18'));var db=require(_0x2dab('0x19'))['db'];function respondWithStatusCode(_0x553435,_0x2653c8){_0x2653c8=_0x2653c8||0xcc;return function(_0x263f53){if(_0x263f53){return _0x553435['sendStatus'](_0x2653c8);}return _0x553435[_0x2dab('0x1a')](_0x2653c8)[_0x2dab('0x1b')]();};}function respondWithResult(_0x1b5161,_0x597a6e){_0x597a6e=_0x597a6e||0xc8;return function(_0x4040d8){if(_0x4040d8){return _0x1b5161[_0x2dab('0x1a')](_0x597a6e)['json'](_0x4040d8);}};}function respondWithFilteredResult(_0x3c00b1,_0x15a9e7){return function(_0x3e8613){if(_0x3e8613){var _0x2f64c8=typeof _0x15a9e7[_0x2dab('0x1c')]==='undefined'&&typeof _0x15a9e7[_0x2dab('0x1d')]===_0x2dab('0x1e');var _0x18d52c=_0x3e8613[_0x2dab('0x1f')];var _0x30bbde=_0x2f64c8?0x0:_0x15a9e7[_0x2dab('0x1c')];var _0x4ff9be=_0x2f64c8?_0x3e8613[_0x2dab('0x1f')]:_0x15a9e7[_0x2dab('0x1c')]+_0x15a9e7[_0x2dab('0x1d')];var _0x5d3c93;if(_0x4ff9be>=_0x18d52c){_0x4ff9be=_0x18d52c;_0x5d3c93=0xc8;}else{_0x5d3c93=0xce;}_0x3c00b1[_0x2dab('0x1a')](_0x5d3c93);return _0x3c00b1[_0x2dab('0x20')](_0x2dab('0x21'),_0x30bbde+'-'+_0x4ff9be+'/'+_0x18d52c)['json'](_0x3e8613);}return null;};}function patchUpdates(_0x477494){return function(_0x14e373){try{jsonpatch[_0x2dab('0x22')](_0x14e373,_0x477494,!![]);}catch(_0x37a4c0){return BPromise[_0x2dab('0x23')](_0x37a4c0);}return _0x14e373[_0x2dab('0x24')]();};}function saveUpdates(_0x528a8c,_0x343bfc){return function(_0x321469){if(_0x321469){return _0x321469['update'](_0x528a8c)[_0x2dab('0x25')](function(_0x3b0b84){return _0x3b0b84;});}return null;};}function removeEntity(_0xf16fec,_0x37cb08){return function(_0x119d38){if(_0x119d38){return _0x119d38[_0x2dab('0x26')]()[_0x2dab('0x25')](function(){_0xf16fec[_0x2dab('0x1a')](0xcc)[_0x2dab('0x1b')]();});}};}function handleEntityNotFound(_0x1b1c5b,_0x50153d){return function(_0x255478){if(!_0x255478){_0x1b1c5b['sendStatus'](0x194);}return _0x255478;};}function handleError(_0xbe611,_0x11454f){_0x11454f=_0x11454f||0x1f4;return function(_0x594f6f){logger[_0x2dab('0x27')](_0x594f6f[_0x2dab('0x28')]);if(_0x594f6f[_0x2dab('0x29')]){delete _0x594f6f[_0x2dab('0x29')];}_0xbe611['status'](_0x11454f)[_0x2dab('0x2a')](_0x594f6f);};}exports[_0x2dab('0x2b')]=function(_0xa93e,_0x2b15c0){var _0x31cde1={},_0x577a09={},_0x39a899={'count':0x0,'rows':[]};var _0x271d4f=_[_0x2dab('0x2c')](db[_0x2dab('0x2d')][_0x2dab('0x2e')],function(_0x11582d){return{'name':_0x11582d[_0x2dab('0x2f')],'type':_0x11582d[_0x2dab('0x30')][_0x2dab('0x31')]};});_0x577a09['model']=_['map'](_0x271d4f,'name');_0x577a09[_0x2dab('0x32')]=_[_0x2dab('0x33')](_0xa93e[_0x2dab('0x32')]);_0x577a09[_0x2dab('0x34')]=_[_0x2dab('0x35')](_0x577a09['model'],_0x577a09[_0x2dab('0x32')]);_0x31cde1['attributes']=_['intersection'](_0x577a09['model'],qs[_0x2dab('0x36')](_0xa93e[_0x2dab('0x32')]['fields']));_0x31cde1['attributes']=_0x31cde1[_0x2dab('0x37')][_0x2dab('0x38')]?_0x31cde1[_0x2dab('0x37')]:_0x577a09[_0x2dab('0x39')];if(!_0xa93e[_0x2dab('0x32')][_0x2dab('0x3a')]('nolimit')){_0x31cde1[_0x2dab('0x1d')]=qs['limit'](_0xa93e[_0x2dab('0x32')][_0x2dab('0x1d')]);_0x31cde1[_0x2dab('0x1c')]=qs[_0x2dab('0x1c')](_0xa93e[_0x2dab('0x32')][_0x2dab('0x1c')]);}_0x31cde1['order']=qs['sort'](_0xa93e[_0x2dab('0x32')][_0x2dab('0x3b')]);_0x31cde1[_0x2dab('0x3c')]=qs[_0x2dab('0x34')](_[_0x2dab('0x3d')](_0xa93e['query'],_0x577a09[_0x2dab('0x34')]),_0x271d4f);if(_0xa93e[_0x2dab('0x32')][_0x2dab('0x3e')]){_0x31cde1[_0x2dab('0x3c')]=_[_0x2dab('0x3f')](_0x31cde1[_0x2dab('0x3c')],{'$or':_[_0x2dab('0x2c')](_0x271d4f,function(_0x3e1b57){if(_0x3e1b57[_0x2dab('0x30')]!==_0x2dab('0x40')){var _0x4dc041={};_0x4dc041[_0x3e1b57[_0x2dab('0x29')]]={'$like':'%'+_0xa93e['query'][_0x2dab('0x3e')]+'%'};return _0x4dc041;}})});}_0x31cde1=_['merge']({},_0x31cde1,_0xa93e[_0x2dab('0x41')]);var _0x5d52b6={'where':_0x31cde1['where']};return db[_0x2dab('0x2d')][_0x2dab('0x1f')](_0x5d52b6)[_0x2dab('0x25')](function(_0x47967e){_0x39a899[_0x2dab('0x1f')]=_0x47967e;if(_0xa93e[_0x2dab('0x32')][_0x2dab('0x42')]){_0x31cde1[_0x2dab('0x43')]=[{'all':!![]}];}return db[_0x2dab('0x2d')][_0x2dab('0x44')](_0x31cde1);})[_0x2dab('0x25')](function(_0x23c7c2){_0x39a899[_0x2dab('0x45')]=_0x23c7c2;return _0x39a899;})[_0x2dab('0x25')](respondWithFilteredResult(_0x2b15c0,_0x31cde1))['catch'](handleError(_0x2b15c0,null));};exports[_0x2dab('0x46')]=function(_0x5c5b73,_0x53239d){var _0x25fd84={'raw':!![],'where':{'id':_0x5c5b73[_0x2dab('0x47')]['id']}},_0x964bad={};_0x964bad['model']=_['keys'](db['ZendeskField']['rawAttributes']);_0x964bad[_0x2dab('0x32')]=_['keys'](_0x5c5b73[_0x2dab('0x32')]);_0x964bad[_0x2dab('0x34')]=_[_0x2dab('0x35')](_0x964bad[_0x2dab('0x39')],_0x964bad[_0x2dab('0x32')]);_0x25fd84[_0x2dab('0x37')]=_['intersection'](_0x964bad[_0x2dab('0x39')],qs[_0x2dab('0x36')](_0x5c5b73['query'][_0x2dab('0x36')]));_0x25fd84[_0x2dab('0x37')]=_0x25fd84['attributes']['length']?_0x25fd84[_0x2dab('0x37')]:_0x964bad[_0x2dab('0x39')];if(_0x5c5b73[_0x2dab('0x32')][_0x2dab('0x42')]){_0x25fd84['include']=[{'all':!![]}];}_0x25fd84=_[_0x2dab('0x3f')]({},_0x25fd84,_0x5c5b73[_0x2dab('0x41')]);return db['ZendeskField'][_0x2dab('0x48')](_0x25fd84)[_0x2dab('0x25')](handleEntityNotFound(_0x53239d,null))[_0x2dab('0x25')](respondWithResult(_0x53239d,null))[_0x2dab('0x49')](handleError(_0x53239d,null));};exports[_0x2dab('0x4a')]=function(_0x2ee65c,_0x3b0056){return db[_0x2dab('0x2d')][_0x2dab('0x4a')](_0x2ee65c['body'],{})['then'](respondWithResult(_0x3b0056,0xc9))['catch'](handleError(_0x3b0056,null));};exports['update']=function(_0x4b117f,_0x358576){if(_0x4b117f[_0x2dab('0x4b')]['id']){delete _0x4b117f[_0x2dab('0x4b')]['id'];}return db['ZendeskField'][_0x2dab('0x48')]({'where':{'id':_0x4b117f[_0x2dab('0x47')]['id']}})[_0x2dab('0x25')](handleEntityNotFound(_0x358576,null))['then'](saveUpdates(_0x4b117f[_0x2dab('0x4b')],null))['then'](respondWithResult(_0x358576,null))[_0x2dab('0x49')](handleError(_0x358576,null));};exports[_0x2dab('0x26')]=function(_0x3d1bfd,_0x83d78d){return db[_0x2dab('0x2d')]['find']({'where':{'id':_0x3d1bfd[_0x2dab('0x47')]['id']}})[_0x2dab('0x25')](handleEntityNotFound(_0x83d78d,null))[_0x2dab('0x25')](removeEntity(_0x83d78d,null))['catch'](handleError(_0x83d78d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 28609d0..de72d72 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 _0xeb7c=['../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','moment','bluebird','request-promise','rimraf'];(function(_0x1d4fb5,_0x205c2f){var _0x566c83=function(_0x33fe30){while(--_0x33fe30){_0x1d4fb5['push'](_0x1d4fb5['shift']());}};_0x566c83(++_0x205c2f);}(_0xeb7c,0x17b));var _0xceb7=function(_0x545cf1,_0x22e5cd){_0x545cf1=_0x545cf1-0x0;var _0x2b0511=_0xeb7c[_0x545cf1];return _0x2b0511;};'use strict';var _=require(_0xceb7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xceb7('0x1'));var BPromise=require(_0xceb7('0x2'));var rp=require(_0xceb7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xceb7('0x4'));var config=require(_0xceb7('0x5'));var attributes=require(_0xceb7('0x6'));module['exports']=function(_0x128952,_0x3ca540){return _0x128952[_0xceb7('0x7')](_0xceb7('0x8'),attributes,{'tableName':_0xceb7('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xceb7('0xa'),_0xceb7('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8540=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1d0308,_0x1e83f3){var _0x3e93bc=function(_0x2e369c){while(--_0x2e369c){_0x1d0308['push'](_0x1d0308['shift']());}};_0x3e93bc(++_0x1e83f3);}(_0x8540,0xa2));var _0x0854=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x8540[_0x51fe5f];return _0x4abce9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0854('0x0'))(_0x0854('0x1'));var moment=require(_0x0854('0x2'));var BPromise=require(_0x0854('0x3'));var rp=require(_0x0854('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0854('0x5'));var config=require(_0x0854('0x6'));var attributes=require(_0x0854('0x7'));module[_0x0854('0x8')]=function(_0x2fbd04,_0x1f2d66){return _0x2fbd04[_0x0854('0x9')](_0x0854('0xa'),attributes,{'tableName':_0x0854('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x0854('0xc'),_0x0854('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index fc6bb95..6ff5f4f 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 _0xc038=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x117604,_0x5175b9){var _0x5cee33=function(_0x4b64b2){while(--_0x4b64b2){_0x117604['push'](_0x117604['shift']());}};_0x5cee33(++_0x5175b9);}(_0xc038,0xc8));var _0x8c03=function(_0x54fd3c,_0x4025c3){_0x54fd3c=_0x54fd3c-0x0;var _0x4f872c=_0xc038[_0x54fd3c];return _0x4f872c;};'use strict';var _=require(_0x8c03('0x0'));var util=require(_0x8c03('0x1'));var moment=require(_0x8c03('0x2'));var BPromise=require(_0x8c03('0x3'));var rs=require(_0x8c03('0x4'));var fs=require('fs');var Redis=require(_0x8c03('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c03('0x6'));var logger=require(_0x8c03('0x7'))(_0x8c03('0x8'));var config=require('../../config/environment');var jayson=require(_0x8c03('0x9'));var client=jayson[_0x8c03('0xa')][_0x8c03('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x244793,_0x3913b2,_0x128a82){return new BPromise(function(_0x60dcea,_0x3948a7){return client['request'](_0x244793,_0x128a82)[_0x8c03('0xc')](function(_0x10568f){logger['info'](_0x8c03('0xd'),_0x3913b2,'request\x20sent');logger[_0x8c03('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x3913b2,_0x8c03('0xf'),JSON[_0x8c03('0x10')](_0x10568f));if(_0x10568f[_0x8c03('0x11')]){if(_0x10568f[_0x8c03('0x11')][_0x8c03('0x12')]===0x1f4){logger[_0x8c03('0x11')]('ZendeskField,\x20%s,\x20%s',_0x3913b2,_0x10568f[_0x8c03('0x11')]['message']);return _0x3948a7(_0x10568f[_0x8c03('0x11')][_0x8c03('0x13')]);}logger[_0x8c03('0x11')](_0x8c03('0xd'),_0x3913b2,_0x10568f[_0x8c03('0x11')][_0x8c03('0x13')]);return _0x60dcea(_0x10568f[_0x8c03('0x11')][_0x8c03('0x13')]);}else{logger[_0x8c03('0x14')](_0x8c03('0xd'),_0x3913b2,_0x8c03('0xf'));_0x60dcea(_0x10568f['result'][_0x8c03('0x13')]);}})[_0x8c03('0x15')](function(_0x299f82){logger[_0x8c03('0x11')](_0x8c03('0xd'),_0x3913b2,_0x299f82);_0x3948a7(_0x299f82);});});} \ No newline at end of file +var _0xa9bb=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','info','result'];(function(_0x3eea7a,_0x5b9d08){var _0x3ab4b2=function(_0x3f753b){while(--_0x3f753b){_0x3eea7a['push'](_0x3eea7a['shift']());}};_0x3ab4b2(++_0x5b9d08);}(_0xa9bb,0x12c));var _0xba9b=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xa9bb[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xba9b('0x0'));var BPromise=require(_0xba9b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba9b('0x2'));var db=require(_0xba9b('0x3'))['db'];var utils=require(_0xba9b('0x4'));var logger=require(_0xba9b('0x5'))('rpc');var config=require(_0xba9b('0x6'));var jayson=require(_0xba9b('0x7'));var client=jayson[_0xba9b('0x8')][_0xba9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384397,_0x424f1b,_0x53cf14){return new BPromise(function(_0x574782,_0x136b4e){return client[_0xba9b('0xa')](_0x384397,_0x53cf14)[_0xba9b('0xb')](function(_0xe84a3c){logger['info']('ZendeskField,\x20%s,\x20%s',_0x424f1b,_0xba9b('0xc'));logger[_0xba9b('0xd')](_0xba9b('0xe'),_0x424f1b,'request\x20sent',JSON[_0xba9b('0xf')](_0xe84a3c));if(_0xe84a3c[_0xba9b('0x10')]){if(_0xe84a3c[_0xba9b('0x10')][_0xba9b('0x11')]===0x1f4){logger['error'](_0xba9b('0x12'),_0x424f1b,_0xe84a3c[_0xba9b('0x10')]['message']);return _0x136b4e(_0xe84a3c[_0xba9b('0x10')]['message']);}logger[_0xba9b('0x10')](_0xba9b('0x12'),_0x424f1b,_0xe84a3c[_0xba9b('0x10')][_0xba9b('0x13')]);return _0x574782(_0xe84a3c[_0xba9b('0x10')][_0xba9b('0x13')]);}else{logger[_0xba9b('0x14')](_0xba9b('0x12'),_0x424f1b,'request\x20sent');_0x574782(_0xe84a3c[_0xba9b('0x15')][_0xba9b('0x13')]);}})[_0xba9b('0x16')](function(_0x5e8319){logger['error'](_0xba9b('0x12'),_0x424f1b,_0x5e8319);_0x136b4e(_0x5e8319);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 349563b..c1da8a2 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 _0x7044=['get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x503cd5,_0x57774a){var _0x1fdf1e=function(_0x5222cc){while(--_0x5222cc){_0x503cd5['push'](_0x503cd5['shift']());}};_0x1fdf1e(++_0x57774a);}(_0x7044,0xeb));var _0x4704=function(_0x5e1990,_0x1700b2){_0x5e1990=_0x5e1990-0x0;var _0x34430c=_0x7044[_0x5e1990];return _0x34430c;};'use strict';var multer=require('multer');var util=require(_0x4704('0x0'));var path=require(_0x4704('0x1'));var timeout=require('connect-timeout');var express=require(_0x4704('0x2'));var router=express[_0x4704('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4704('0x4'));var interaction=require(_0x4704('0x5'));var config=require(_0x4704('0x6'));var controller=require('./intZohoAccount.controller');router[_0x4704('0x7')]('/',auth[_0x4704('0x8')](),controller[_0x4704('0x9')]);router[_0x4704('0x7')](_0x4704('0xa'),auth[_0x4704('0x8')](),controller['show']);router['get'](_0x4704('0xb'),auth['isAuthenticated'](),controller[_0x4704('0xc')]);router[_0x4704('0x7')](_0x4704('0xd'),auth['isAuthenticated'](),controller[_0x4704('0xe')]);router[_0x4704('0xf')]('/',auth['isAuthenticated'](),controller[_0x4704('0x10')]);router[_0x4704('0xf')]('/:id/configurations',auth[_0x4704('0x8')](),controller['addConfiguration']);router[_0x4704('0x11')]('/:id',auth[_0x4704('0x8')](),controller[_0x4704('0x12')]);router[_0x4704('0x13')]('/:id',auth[_0x4704('0x8')](),controller[_0x4704('0x14')]);module[_0x4704('0x15')]=router; \ No newline at end of file +var _0x1270=['/:id/fields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x3c6741,_0x24c6f0){var _0x5d3310=function(_0x504ffb){while(--_0x504ffb){_0x3c6741['push'](_0x3c6741['shift']());}};_0x5d3310(++_0x24c6f0);}(_0x1270,0xee));var _0x0127=function(_0x5315a8,_0x3c669d){_0x5315a8=_0x5315a8-0x0;var _0x5d5ba8=_0x1270[_0x5315a8];return _0x5d5ba8;};'use strict';var multer=require(_0x0127('0x0'));var util=require(_0x0127('0x1'));var path=require(_0x0127('0x2'));var timeout=require(_0x0127('0x3'));var express=require('express');var router=express[_0x0127('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0127('0x5'));var config=require(_0x0127('0x6'));var controller=require(_0x0127('0x7'));router[_0x0127('0x8')]('/',auth[_0x0127('0x9')](),controller[_0x0127('0xa')]);router[_0x0127('0x8')](_0x0127('0xb'),auth[_0x0127('0x9')](),controller[_0x0127('0xc')]);router[_0x0127('0x8')](_0x0127('0xd'),auth['isAuthenticated'](),controller[_0x0127('0xe')]);router['get'](_0x0127('0xf'),auth[_0x0127('0x9')](),controller['getFields']);router[_0x0127('0x10')]('/',auth[_0x0127('0x9')](),controller[_0x0127('0x11')]);router['post'](_0x0127('0xd'),auth[_0x0127('0x9')](),controller[_0x0127('0x12')]);router[_0x0127('0x13')](_0x0127('0xb'),auth['isAuthenticated'](),controller[_0x0127('0x14')]);router['delete'](_0x0127('0xb'),auth['isAuthenticated'](),controller[_0x0127('0x15')]);module[_0x0127('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 54a5fad..c6cfafc 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 _0xd64b=['STRING','sequelize'];(function(_0x425709,_0x36bc1e){var _0x5e548f=function(_0x12e74e){while(--_0x12e74e){_0x425709['push'](_0x425709['shift']());}};_0x5e548f(++_0x36bc1e);}(_0xd64b,0xc1));var _0xbd64=function(_0x57de2e,_0x43b244){_0x57de2e=_0x57de2e-0x0;var _0x17c67e=_0xd64b[_0x57de2e];return _0x17c67e;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9bde=['STRING','exports'];(function(_0x31dde9,_0x12e816){var _0x1fbf2d=function(_0x1d1bf6){while(--_0x1d1bf6){_0x31dde9['push'](_0x31dde9['shift']());}};_0x1fbf2d(++_0x12e816);}(_0x9bde,0xe1));var _0xe9bd=function(_0x323be4,_0x476525){_0x323be4=_0x323be4-0x0;var _0x362b41=_0x9bde[_0x323be4];return _0x362b41;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 3c4fb76..c53aa81 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 _0xa603=['find','create','body','destroy','getConfigurations','findOne','rawAttributes','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','includes','api_name','push','display_label','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','ZohoAccount','fieldName','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0xa603,0x1b8));var _0x3a60=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa603[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x3a60('0x0'));var rimraf=require(_0x3a60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a60('0x2'));var rp=require(_0x3a60('0x3'));var moment=require('moment');var BPromise=require(_0x3a60('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3a60('0x5'));var sox=require('sox');var csv=require(_0x3a60('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a60('0x7'));var _=require(_0x3a60('0x8'));var squel=require(_0x3a60('0x9'));var crypto=require(_0x3a60('0xa'));var jsforce=require(_0x3a60('0xb'));var deskjs=require(_0x3a60('0xc'));var toCsv=require(_0x3a60('0x6'));var querystring=require(_0x3a60('0xd'));var Papa=require(_0x3a60('0xe'));var Redis=require('ioredis');var authService=require(_0x3a60('0xf'));var qs=require(_0x3a60('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a60('0x11'));var logger=require(_0x3a60('0x12'))('api');var utils=require(_0x3a60('0x13'));var config=require(_0x3a60('0x14'));var licenseUtil=require(_0x3a60('0x15'));var db=require(_0x3a60('0x16'))['db'];var integrations=require(_0x3a60('0x17'));function respondWithStatusCode(_0x127c65,_0x295928){_0x295928=_0x295928||0xcc;return function(_0x153749){if(_0x153749){return _0x127c65['sendStatus'](_0x295928);}return _0x127c65['status'](_0x295928)['end']();};}function respondWithResult(_0x40a6b2,_0x5872e0){_0x5872e0=_0x5872e0||0xc8;return function(_0x17f431){if(_0x17f431){return _0x40a6b2['status'](_0x5872e0)[_0x3a60('0x18')](_0x17f431);}};}function respondWithFilteredResult(_0x59c837,_0x41e552){return function(_0x9fee32){if(_0x9fee32){var _0x42f109=typeof _0x41e552[_0x3a60('0x19')]===_0x3a60('0x1a')&&typeof _0x41e552[_0x3a60('0x1b')]===_0x3a60('0x1a');var _0x4d16ab=_0x9fee32[_0x3a60('0x1c')];var _0x449414=_0x42f109?0x0:_0x41e552[_0x3a60('0x19')];var _0x340a2c=_0x42f109?_0x9fee32[_0x3a60('0x1c')]:_0x41e552[_0x3a60('0x19')]+_0x41e552[_0x3a60('0x1b')];var _0x2d6fc0;if(_0x340a2c>=_0x4d16ab){_0x340a2c=_0x4d16ab;_0x2d6fc0=0xc8;}else{_0x2d6fc0=0xce;}_0x59c837[_0x3a60('0x1d')](_0x2d6fc0);return _0x59c837[_0x3a60('0x1e')](_0x3a60('0x1f'),_0x449414+'-'+_0x340a2c+'/'+_0x4d16ab)[_0x3a60('0x18')](_0x9fee32);}return null;};}function patchUpdates(_0xe03b75){return function(_0x520ecb){try{jsonpatch[_0x3a60('0x20')](_0x520ecb,_0xe03b75,!![]);}catch(_0x52331c){return BPromise[_0x3a60('0x21')](_0x52331c);}return _0x520ecb[_0x3a60('0x22')]();};}function saveUpdates(_0x3e3769,_0xda257d){return function(_0x4a8ca4){if(_0x4a8ca4){return _0x4a8ca4[_0x3a60('0x23')](_0x3e3769)['then'](function(_0x5916ec){return _0x5916ec;});}return null;};}function removeEntity(_0x588b71,_0x1d769e){return function(_0x207631){if(_0x207631){return _0x207631['destroy']()[_0x3a60('0x24')](function(){_0x588b71[_0x3a60('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55818a,_0x123fe5){return function(_0xa24211){if(!_0xa24211){_0x55818a['sendStatus'](0x194);}return _0xa24211;};}function handleError(_0x19fa27,_0x20a9dd){_0x20a9dd=_0x20a9dd||0x1f4;return function(_0x217b5d){logger[_0x3a60('0x25')](_0x217b5d[_0x3a60('0x26')]);if(_0x217b5d[_0x3a60('0x27')]){delete _0x217b5d[_0x3a60('0x27')];}_0x19fa27[_0x3a60('0x1d')](_0x20a9dd)['send'](_0x217b5d);};}exports[_0x3a60('0x28')]=function(_0x321e23,_0x4e0de0){var _0x5e6eec={},_0x3fc365={},_0x176f35={'count':0x0,'rows':[]};var _0x5c455c=_['map'](db[_0x3a60('0x29')]['rawAttributes'],function(_0x1057a){return{'name':_0x1057a[_0x3a60('0x2a')],'type':_0x1057a['type']['key']};});_0x3fc365['model']=_[_0x3a60('0x2b')](_0x5c455c,_0x3a60('0x27'));_0x3fc365[_0x3a60('0x2c')]=_[_0x3a60('0x2d')](_0x321e23[_0x3a60('0x2c')]);_0x3fc365[_0x3a60('0x2e')]=_[_0x3a60('0x2f')](_0x3fc365[_0x3a60('0x30')],_0x3fc365['query']);_0x5e6eec['attributes']=_[_0x3a60('0x2f')](_0x3fc365[_0x3a60('0x30')],qs['fields'](_0x321e23[_0x3a60('0x2c')][_0x3a60('0x31')]));_0x5e6eec['attributes']=_0x5e6eec[_0x3a60('0x32')][_0x3a60('0x33')]?_0x5e6eec[_0x3a60('0x32')]:_0x3fc365[_0x3a60('0x30')];if(!_0x321e23['query'][_0x3a60('0x34')]('nolimit')){_0x5e6eec['limit']=qs['limit'](_0x321e23[_0x3a60('0x2c')][_0x3a60('0x1b')]);_0x5e6eec[_0x3a60('0x19')]=qs[_0x3a60('0x19')](_0x321e23[_0x3a60('0x2c')][_0x3a60('0x19')]);}_0x5e6eec[_0x3a60('0x35')]=qs[_0x3a60('0x36')](_0x321e23['query'][_0x3a60('0x36')]);_0x5e6eec['where']=qs[_0x3a60('0x2e')](_[_0x3a60('0x37')](_0x321e23[_0x3a60('0x2c')],_0x3fc365[_0x3a60('0x2e')]),_0x5c455c);if(_0x321e23[_0x3a60('0x2c')]['filter']){_0x5e6eec[_0x3a60('0x38')]=_[_0x3a60('0x39')](_0x5e6eec[_0x3a60('0x38')],{'$or':_['map'](_0x5c455c,function(_0x31ea0c){if(_0x31ea0c[_0x3a60('0x3a')]!==_0x3a60('0x3b')){var _0x1184b0={};_0x1184b0[_0x31ea0c[_0x3a60('0x27')]]={'$like':'%'+_0x321e23[_0x3a60('0x2c')][_0x3a60('0x3c')]+'%'};return _0x1184b0;}})});}_0x5e6eec=_[_0x3a60('0x39')]({},_0x5e6eec,_0x321e23[_0x3a60('0x3d')]);var _0x1bd911={'where':_0x5e6eec[_0x3a60('0x38')]};return db[_0x3a60('0x29')]['count'](_0x1bd911)[_0x3a60('0x24')](function(_0x3ab002){_0x176f35[_0x3a60('0x1c')]=_0x3ab002;if(_0x321e23[_0x3a60('0x2c')]['includeAll']){_0x5e6eec[_0x3a60('0x3e')]=[{'all':!![]}];}return db[_0x3a60('0x29')]['findAll'](_0x5e6eec);})[_0x3a60('0x24')](function(_0x8cba2c){_0x176f35[_0x3a60('0x3f')]=_0x8cba2c;return _0x176f35;})[_0x3a60('0x24')](respondWithFilteredResult(_0x4e0de0,_0x5e6eec))[_0x3a60('0x40')](handleError(_0x4e0de0,null));};exports[_0x3a60('0x41')]=function(_0x4a0ac2,_0x5694bf){var _0x582fed={'raw':![],'where':{'id':_0x4a0ac2[_0x3a60('0x42')]['id']}},_0x228da0={};_0x228da0[_0x3a60('0x30')]=_[_0x3a60('0x2d')](db[_0x3a60('0x29')]['rawAttributes']);_0x228da0[_0x3a60('0x2c')]=_[_0x3a60('0x2d')](_0x4a0ac2[_0x3a60('0x2c')]);_0x228da0[_0x3a60('0x2e')]=_['intersection'](_0x228da0[_0x3a60('0x30')],_0x228da0[_0x3a60('0x2c')]);_0x582fed['attributes']=_[_0x3a60('0x2f')](_0x228da0[_0x3a60('0x30')],qs[_0x3a60('0x31')](_0x4a0ac2[_0x3a60('0x2c')][_0x3a60('0x31')]));_0x582fed['attributes']=_0x582fed[_0x3a60('0x32')][_0x3a60('0x33')]?_0x582fed[_0x3a60('0x32')]:_0x228da0[_0x3a60('0x30')];if(_0x4a0ac2[_0x3a60('0x2c')][_0x3a60('0x43')]){_0x582fed[_0x3a60('0x3e')]=[{'all':!![]}];}_0x582fed=_['merge']({},_0x582fed,_0x4a0ac2['options']);return db[_0x3a60('0x29')][_0x3a60('0x44')](_0x582fed)['then'](handleEntityNotFound(_0x5694bf,null))[_0x3a60('0x24')](respondWithResult(_0x5694bf,null))[_0x3a60('0x40')](handleError(_0x5694bf,null));};exports[_0x3a60('0x45')]=function(_0x58269a,_0xbe2ff){return db[_0x3a60('0x29')][_0x3a60('0x45')](_0x58269a[_0x3a60('0x46')],{})[_0x3a60('0x24')](respondWithResult(_0xbe2ff,0xc9))[_0x3a60('0x40')](handleError(_0xbe2ff,null));};exports[_0x3a60('0x23')]=function(_0x22566f,_0x45bcd2){if(_0x22566f[_0x3a60('0x46')]['id']){delete _0x22566f[_0x3a60('0x46')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x22566f[_0x3a60('0x42')]['id']}})[_0x3a60('0x24')](handleEntityNotFound(_0x45bcd2,null))[_0x3a60('0x24')](saveUpdates(_0x22566f[_0x3a60('0x46')],null))[_0x3a60('0x24')](respondWithResult(_0x45bcd2,null))['catch'](handleError(_0x45bcd2,null));};exports[_0x3a60('0x47')]=function(_0x1bef44,_0x48dec9){return db[_0x3a60('0x29')][_0x3a60('0x44')]({'where':{'id':_0x1bef44['params']['id']}})['then'](handleEntityNotFound(_0x48dec9,null))[_0x3a60('0x24')](removeEntity(_0x48dec9,null))[_0x3a60('0x40')](handleError(_0x48dec9,null));};exports[_0x3a60('0x48')]=function(_0x210eca,_0x4aa9c8,_0x2cae9e){var _0xbcbbdf={};var _0x4869f1={};var _0x24a6cd;var _0x135381;return db[_0x3a60('0x29')][_0x3a60('0x49')]({'where':{'id':_0x210eca[_0x3a60('0x42')]['id']}})[_0x3a60('0x24')](handleEntityNotFound(_0x4aa9c8,null))[_0x3a60('0x24')](function(_0x1d6f6c){if(_0x1d6f6c){_0x24a6cd=_0x1d6f6c;_0x4869f1[_0x3a60('0x30')]=_[_0x3a60('0x2d')](db['ZohoConfiguration'][_0x3a60('0x4a')]);_0x4869f1['query']=_['keys'](_0x210eca[_0x3a60('0x2c')]);_0x4869f1[_0x3a60('0x2e')]=_['intersection'](_0x4869f1[_0x3a60('0x30')],_0x4869f1[_0x3a60('0x2c')]);_0xbcbbdf['attributes']=_[_0x3a60('0x2f')](_0x4869f1[_0x3a60('0x30')],qs[_0x3a60('0x31')](_0x210eca['query'][_0x3a60('0x31')]));_0xbcbbdf[_0x3a60('0x32')]=_0xbcbbdf['attributes'][_0x3a60('0x33')]?_0xbcbbdf['attributes']:_0x4869f1[_0x3a60('0x30')];_0xbcbbdf[_0x3a60('0x35')]=qs[_0x3a60('0x36')](_0x210eca['query'][_0x3a60('0x36')]);_0xbcbbdf[_0x3a60('0x38')]=qs[_0x3a60('0x2e')](_['pick'](_0x210eca[_0x3a60('0x2c')],_0x4869f1[_0x3a60('0x2e')]));if(_0x210eca[_0x3a60('0x2c')][_0x3a60('0x3c')]){_0xbcbbdf[_0x3a60('0x38')]=_[_0x3a60('0x39')](_0xbcbbdf[_0x3a60('0x38')],{'$or':_[_0x3a60('0x2b')](_0xbcbbdf[_0x3a60('0x32')],function(_0xfc7513){var _0x374385={};_0x374385[_0xfc7513]={'$like':'%'+_0x210eca[_0x3a60('0x2c')][_0x3a60('0x3c')]+'%'};return _0x374385;})});}_0xbcbbdf=_[_0x3a60('0x39')]({},_0xbcbbdf,_0x210eca['options']);return _0x24a6cd[_0x3a60('0x48')](_0xbcbbdf);}})[_0x3a60('0x24')](function(_0x41e9d6){if(_0x41e9d6){_0x135381=_0x41e9d6['length'];if(!_0x210eca[_0x3a60('0x2c')][_0x3a60('0x34')](_0x3a60('0x4b'))){_0xbcbbdf[_0x3a60('0x1b')]=qs[_0x3a60('0x1b')](_0x210eca[_0x3a60('0x2c')][_0x3a60('0x1b')]);_0xbcbbdf[_0x3a60('0x19')]=qs[_0x3a60('0x19')](_0x210eca[_0x3a60('0x2c')]['offset']);}return _0x24a6cd[_0x3a60('0x48')](_0xbcbbdf);}})[_0x3a60('0x24')](function(_0xce9c2f){if(_0xce9c2f){return _0xce9c2f?{'count':_0x135381,'rows':_0xce9c2f}:null;}})[_0x3a60('0x24')](respondWithResult(_0x4aa9c8,null))['catch'](handleError(_0x4aa9c8,null));};exports[_0x3a60('0x4c')]=function(_0x563087,_0x2bfdea,_0x36c2a5){if(_0x563087[_0x3a60('0x46')]['id']){delete _0x563087[_0x3a60('0x46')]['id'];}return db[_0x3a60('0x29')][_0x3a60('0x49')]({'where':{'id':_0x563087[_0x3a60('0x42')]['id']}})[_0x3a60('0x24')](handleEntityNotFound(_0x2bfdea,null))[_0x3a60('0x24')](function(_0x23e49b){if(_0x23e49b){_0x563087[_0x3a60('0x46')][_0x3a60('0x4d')]=_0x23e49b['id'];_0x563087[_0x3a60('0x46')][_0x3a60('0x4e')]=integrations[_0x3a60('0x4f')](_0x563087[_0x3a60('0x46')][_0x3a60('0x50')],_0x563087[_0x3a60('0x46')][_0x3a60('0x3a')]);_0x563087[_0x3a60('0x46')][_0x3a60('0x51')]=integrations[_0x3a60('0x52')](_0x563087[_0x3a60('0x46')]['channel'],_0x563087[_0x3a60('0x46')][_0x3a60('0x3a')]);return db['ZohoConfiguration'][_0x3a60('0x45')](_0x563087['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x3a60('0x53')],'as':'Descriptions'}]});}return null;})[_0x3a60('0x24')](respondWithResult(_0x2bfdea,null))['catch'](handleError(_0x2bfdea,null));};function getAccessToken(_0x71ee17){return new Promise(function(_0x2d2b75,_0x5f03ec){var _0x64a901;switch(_0x71ee17[_0x3a60('0x54')]){case'US':_0x64a901='https://accounts.zoho.com';break;case'AU':_0x64a901='https://accounts.zoho.com.au';break;case'EU':_0x64a901=_0x3a60('0x55');break;case'IN':_0x64a901='https://accounts.zoho.in';break;case'CN':_0x64a901=_0x3a60('0x56');break;default:_0x64a901=_0x3a60('0x55');break;}var _0x91acc5={'method':_0x3a60('0x57'),'uri':_0x64a901+'/oauth/v2/token','qs':{'refresh_token':_0x71ee17[_0x3a60('0x58')],'client_id':_0x71ee17[_0x3a60('0x59')],'client_secret':_0x71ee17[_0x3a60('0x5a')],'grant_type':_0x3a60('0x5b')},'json':!![]};return rp(_0x91acc5)[_0x3a60('0x24')](function(_0x18c44c){if(_0x18c44c[_0x3a60('0x5c')]){_0x2d2b75(_0x18c44c['access_token']);}else{_0x5f03ec(_0x3a60('0x5d'));}})['catch'](function(_0x3ad67e){_0x5f03ec(_0x3ad67e);});});}exports[_0x3a60('0x5e')]=function(_0x36654f,_0x56a49b,_0x5523d1){var _0x2b3c41,_0x2a9b1a,_0x138ad5,_0x3390fc,_0x4f03a6;return db[_0x3a60('0x29')][_0x3a60('0x49')]({'where':{'id':_0x36654f['params']['id']},'attributes':['id',_0x3a60('0x5f'),_0x3a60('0x54'),_0x3a60('0x59'),_0x3a60('0x5a'),_0x3a60('0x60'),_0x3a60('0x61'),_0x3a60('0x58')]})[_0x3a60('0x24')](handleEntityNotFound(_0x56a49b,null))['then'](function(_0x2c7209){_0x4f03a6=_0x2c7209;_0x2b3c41=_0x4f03a6['host'];_0x2a9b1a=_0x2b3c41===_0x3a60('0x62')?'eu':_0x3a60('0x63');_0x138ad5=_0x4f03a6['serverUrl'];var _0x538aa9=_0x138ad5[_0x3a60('0x64')](-0x1);if(_0x538aa9==='/'||_0x538aa9==='\x5c'||_0x538aa9===':'){_0x138ad5=_0x138ad5[_0x3a60('0x65')](0x0,_0x138ad5[_0x3a60('0x66')](_0x538aa9));}if(!_0x4f03a6[_0x3a60('0x58')]){throw new Error(_0x3a60('0x67'));}return getAccessToken(_0x4f03a6);})[_0x3a60('0x24')](function(_0x10f39c){if(_0x10f39c){return rp({'method':_0x3a60('0x68'),'uri':util[_0x3a60('0x69')](_0x3a60('0x6a'),_0x2a9b1a),'qs':{'module':'Calls'},'headers':{'Authorization':_0x3a60('0x6b')+_0x10f39c},'json':!![]});}})[_0x3a60('0x24')](function(_0x1f6525){if(_0x1f6525){if(_0x1f6525['response']&&_0x1f6525[_0x3a60('0x6c')][_0x3a60('0x25')]){throw new Error(_0x1f6525['response'][_0x3a60('0x25')]['message']);}var _0xceef8c=[];var _0x522d1d=[];var _0x50a150=[_0x3a60('0x6d'),_0x3a60('0x6e'),_0x3a60('0x6f'),_0x3a60('0x70'),_0x3a60('0x71'),_0x3a60('0x72'),_0x3a60('0x73'),'Call_Type'];_0x522d1d=_['remove'](_0x1f6525[_0x3a60('0x31')],function(_0x112d91){return _0x50a150[_0x3a60('0x74')](_0x112d91[_0x3a60('0x75')]);});for(var _0x208b96=0x0;_0x208b96<_0x522d1d[_0x3a60('0x33')];_0x208b96++){if(_0x522d1d[_0x208b96]['system_mandatory']===![]){_0xceef8c[_0x3a60('0x76')]({'id':_0x522d1d[_0x208b96]['id'],'name':_0x522d1d[_0x208b96][_0x3a60('0x77')],'custom':_0x522d1d[_0x208b96]['custom_field'],'options':_0x522d1d[_0x208b96]['data_type']===_0x3a60('0x78')&&_0x522d1d[_0x208b96][_0x3a60('0x79')][_0x3a60('0x33')]>-0x1?_[_0x3a60('0x2b')](_0x522d1d[_0x208b96][_0x3a60('0x79')],function(_0x257b54){return{'name':_0x257b54,'value':_0x257b54};}):[]});}}return{'count':_0xceef8c[_0x3a60('0x33')],'rows':_0xceef8c};}else{return{'count':0x0,'rows':[]};}})[_0x3a60('0x24')](respondWithResult(_0x56a49b,null))['catch'](function(_0x18e75c){var _0x521c43=_0x36654f[_0x3a60('0x2c')]['test']?0x1f4:_0x18e75c['statusCode']||0x1f4;logger[_0x3a60('0x25')](_0x3a60('0x7a'),_0x3a60('0x5e'),_0x521c43,JSON['stringify'](_0x18e75c));delete _0x18e75c[_0x3a60('0x27')];if(_0x521c43===0x191){_0x521c43=0x190;}_0x56a49b[_0x3a60('0x1d')](_0x521c43)[_0x3a60('0x7b')](_0x36654f[_0x3a60('0x2c')][_0x3a60('0x7c')]?{'message':_0x3a60('0x7d'),'statusCode':_0x18e75c[_0x3a60('0x7e')]}:_0x18e75c);});}; \ No newline at end of file +var _0xf605=['/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','code','zoho.eu','com','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','includes','api_name','push','display_label','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','sendStatus','error','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','keys','intersection','includeAll','find','create','update','body','params','destroy','findOne','filter','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','zone','https://accounts.zoho.com','https://accounts.zoho.in','POST'];(function(_0x248edc,_0x272d7c){var _0x26a30d=function(_0x14c96b){while(--_0x14c96b){_0x248edc['push'](_0x248edc['shift']());}};_0x26a30d(++_0x272d7c);}(_0xf605,0x129));var _0x5f60=function(_0x149c1f,_0x7b4dc6){_0x149c1f=_0x149c1f-0x0;var _0x309eeb=_0xf605[_0x149c1f];return _0x309eeb;};'use strict';var emlformat=require(_0x5f60('0x0'));var rimraf=require(_0x5f60('0x1'));var zipdir=require(_0x5f60('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f60('0x3'));var moment=require('moment');var BPromise=require(_0x5f60('0x4'));var Mustache=require(_0x5f60('0x5'));var util=require(_0x5f60('0x6'));var path=require(_0x5f60('0x7'));var sox=require(_0x5f60('0x8'));var csv=require(_0x5f60('0x9'));var ejs=require(_0x5f60('0xa'));var fs=require('fs');var fs_extra=require(_0x5f60('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f60('0xc'));var jsforce=require(_0x5f60('0xd'));var deskjs=require(_0x5f60('0xe'));var toCsv=require(_0x5f60('0x9'));var querystring=require(_0x5f60('0xf'));var Papa=require(_0x5f60('0x10'));var Redis=require(_0x5f60('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f60('0x12'));var as=require(_0x5f60('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f60('0x14'))(_0x5f60('0x15'));var utils=require(_0x5f60('0x16'));var config=require(_0x5f60('0x17'));var licenseUtil=require(_0x5f60('0x18'));var db=require(_0x5f60('0x19'))['db'];var integrations=require(_0x5f60('0x1a'));function respondWithStatusCode(_0x172777,_0x31b7a7){_0x31b7a7=_0x31b7a7||0xcc;return function(_0x526ab4){if(_0x526ab4){return _0x172777['sendStatus'](_0x31b7a7);}return _0x172777[_0x5f60('0x1b')](_0x31b7a7)[_0x5f60('0x1c')]();};}function respondWithResult(_0x20f95b,_0x3bde11){_0x3bde11=_0x3bde11||0xc8;return function(_0x28f532){if(_0x28f532){return _0x20f95b['status'](_0x3bde11)[_0x5f60('0x1d')](_0x28f532);}};}function respondWithFilteredResult(_0x1ac5ad,_0x3fb4e6){return function(_0x2ffc59){if(_0x2ffc59){var _0x12171c=typeof _0x3fb4e6[_0x5f60('0x1e')]===_0x5f60('0x1f')&&typeof _0x3fb4e6[_0x5f60('0x20')]==='undefined';var _0x18f450=_0x2ffc59[_0x5f60('0x21')];var _0x31685d=_0x12171c?0x0:_0x3fb4e6[_0x5f60('0x1e')];var _0x2c3359=_0x12171c?_0x2ffc59['count']:_0x3fb4e6[_0x5f60('0x1e')]+_0x3fb4e6[_0x5f60('0x20')];var _0x26a9c1;if(_0x2c3359>=_0x18f450){_0x2c3359=_0x18f450;_0x26a9c1=0xc8;}else{_0x26a9c1=0xce;}_0x1ac5ad['status'](_0x26a9c1);return _0x1ac5ad['set'](_0x5f60('0x22'),_0x31685d+'-'+_0x2c3359+'/'+_0x18f450)[_0x5f60('0x1d')](_0x2ffc59);}return null;};}function patchUpdates(_0x3c5533){return function(_0x2751a8){try{jsonpatch[_0x5f60('0x23')](_0x2751a8,_0x3c5533,!![]);}catch(_0x163bab){return BPromise[_0x5f60('0x24')](_0x163bab);}return _0x2751a8[_0x5f60('0x25')]();};}function saveUpdates(_0x12c11c,_0x4bb345){return function(_0x517f72){if(_0x517f72){return _0x517f72['update'](_0x12c11c)[_0x5f60('0x26')](function(_0x4c1efc){return _0x4c1efc;});}return null;};}function removeEntity(_0x38f277,_0x53e768){return function(_0x287cad){if(_0x287cad){return _0x287cad['destroy']()[_0x5f60('0x26')](function(){_0x38f277['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a512f,_0x282eb3){return function(_0x250b35){if(!_0x250b35){_0x5a512f[_0x5f60('0x27')](0x194);}return _0x250b35;};}function handleError(_0x512e5f,_0x3a09ef){_0x3a09ef=_0x3a09ef||0x1f4;return function(_0x29c663){logger[_0x5f60('0x28')](_0x29c663['stack']);if(_0x29c663['name']){delete _0x29c663[_0x5f60('0x29')];}_0x512e5f['status'](_0x3a09ef)[_0x5f60('0x2a')](_0x29c663);};}exports['index']=function(_0x10eefa,_0x512fd7){var _0x534d9b={},_0x2710db={},_0x2ea395={'count':0x0,'rows':[]};var _0x556c8a=_[_0x5f60('0x2b')](db[_0x5f60('0x2c')][_0x5f60('0x2d')],function(_0x5a0982){return{'name':_0x5a0982[_0x5f60('0x2e')],'type':_0x5a0982[_0x5f60('0x2f')][_0x5f60('0x30')]};});_0x2710db[_0x5f60('0x31')]=_[_0x5f60('0x2b')](_0x556c8a,_0x5f60('0x29'));_0x2710db[_0x5f60('0x32')]=_['keys'](_0x10eefa['query']);_0x2710db[_0x5f60('0x33')]=_['intersection'](_0x2710db[_0x5f60('0x31')],_0x2710db[_0x5f60('0x32')]);_0x534d9b[_0x5f60('0x34')]=_['intersection'](_0x2710db[_0x5f60('0x31')],qs[_0x5f60('0x35')](_0x10eefa['query'][_0x5f60('0x35')]));_0x534d9b['attributes']=_0x534d9b[_0x5f60('0x34')][_0x5f60('0x36')]?_0x534d9b[_0x5f60('0x34')]:_0x2710db[_0x5f60('0x31')];if(!_0x10eefa[_0x5f60('0x32')][_0x5f60('0x37')](_0x5f60('0x38'))){_0x534d9b[_0x5f60('0x20')]=qs[_0x5f60('0x20')](_0x10eefa[_0x5f60('0x32')][_0x5f60('0x20')]);_0x534d9b[_0x5f60('0x1e')]=qs['offset'](_0x10eefa[_0x5f60('0x32')][_0x5f60('0x1e')]);}_0x534d9b[_0x5f60('0x39')]=qs[_0x5f60('0x3a')](_0x10eefa[_0x5f60('0x32')][_0x5f60('0x3a')]);_0x534d9b[_0x5f60('0x3b')]=qs[_0x5f60('0x33')](_[_0x5f60('0x3c')](_0x10eefa[_0x5f60('0x32')],_0x2710db[_0x5f60('0x33')]),_0x556c8a);if(_0x10eefa[_0x5f60('0x32')]['filter']){_0x534d9b['where']=_[_0x5f60('0x3d')](_0x534d9b['where'],{'$or':_['map'](_0x556c8a,function(_0x943dc0){if(_0x943dc0[_0x5f60('0x2f')]!==_0x5f60('0x3e')){var _0x18a1be={};_0x18a1be[_0x943dc0[_0x5f60('0x29')]]={'$like':'%'+_0x10eefa[_0x5f60('0x32')]['filter']+'%'};return _0x18a1be;}})});}_0x534d9b=_['merge']({},_0x534d9b,_0x10eefa[_0x5f60('0x3f')]);var _0x4d4a05={'where':_0x534d9b['where']};return db['ZohoAccount'][_0x5f60('0x21')](_0x4d4a05)[_0x5f60('0x26')](function(_0x3ac787){_0x2ea395[_0x5f60('0x21')]=_0x3ac787;if(_0x10eefa[_0x5f60('0x32')]['includeAll']){_0x534d9b[_0x5f60('0x40')]=[{'all':!![]}];}return db[_0x5f60('0x2c')][_0x5f60('0x41')](_0x534d9b);})[_0x5f60('0x26')](function(_0x52e526){_0x2ea395[_0x5f60('0x42')]=_0x52e526;return _0x2ea395;})[_0x5f60('0x26')](respondWithFilteredResult(_0x512fd7,_0x534d9b))[_0x5f60('0x43')](handleError(_0x512fd7,null));};exports['show']=function(_0x1afbf9,_0x30d60e){var _0x8f129d={'raw':![],'where':{'id':_0x1afbf9['params']['id']}},_0x3b8fad={};_0x3b8fad['model']=_['keys'](db['ZohoAccount'][_0x5f60('0x2d')]);_0x3b8fad[_0x5f60('0x32')]=_[_0x5f60('0x44')](_0x1afbf9[_0x5f60('0x32')]);_0x3b8fad[_0x5f60('0x33')]=_[_0x5f60('0x45')](_0x3b8fad[_0x5f60('0x31')],_0x3b8fad[_0x5f60('0x32')]);_0x8f129d[_0x5f60('0x34')]=_[_0x5f60('0x45')](_0x3b8fad[_0x5f60('0x31')],qs['fields'](_0x1afbf9['query']['fields']));_0x8f129d[_0x5f60('0x34')]=_0x8f129d[_0x5f60('0x34')][_0x5f60('0x36')]?_0x8f129d[_0x5f60('0x34')]:_0x3b8fad[_0x5f60('0x31')];if(_0x1afbf9[_0x5f60('0x32')][_0x5f60('0x46')]){_0x8f129d[_0x5f60('0x40')]=[{'all':!![]}];}_0x8f129d=_[_0x5f60('0x3d')]({},_0x8f129d,_0x1afbf9[_0x5f60('0x3f')]);return db[_0x5f60('0x2c')][_0x5f60('0x47')](_0x8f129d)['then'](handleEntityNotFound(_0x30d60e,null))[_0x5f60('0x26')](respondWithResult(_0x30d60e,null))['catch'](handleError(_0x30d60e,null));};exports[_0x5f60('0x48')]=function(_0x31ab74,_0x55fbb0){return db['ZohoAccount'][_0x5f60('0x48')](_0x31ab74['body'],{})['then'](respondWithResult(_0x55fbb0,0xc9))[_0x5f60('0x43')](handleError(_0x55fbb0,null));};exports[_0x5f60('0x49')]=function(_0x385f69,_0x5ab68a){if(_0x385f69[_0x5f60('0x4a')]['id']){delete _0x385f69[_0x5f60('0x4a')]['id'];}return db[_0x5f60('0x2c')][_0x5f60('0x47')]({'where':{'id':_0x385f69[_0x5f60('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5ab68a,null))[_0x5f60('0x26')](saveUpdates(_0x385f69[_0x5f60('0x4a')],null))['then'](respondWithResult(_0x5ab68a,null))[_0x5f60('0x43')](handleError(_0x5ab68a,null));};exports[_0x5f60('0x4c')]=function(_0x131e65,_0x4b502b){return db['ZohoAccount'][_0x5f60('0x47')]({'where':{'id':_0x131e65['params']['id']}})['then'](handleEntityNotFound(_0x4b502b,null))['then'](removeEntity(_0x4b502b,null))[_0x5f60('0x43')](handleError(_0x4b502b,null));};exports['getConfigurations']=function(_0x3ff869,_0x14a856,_0x2f1e31){var _0x30c5c7={};var _0x22d67f={};var _0x490c52;var _0x10fd23;return db['ZohoAccount'][_0x5f60('0x4d')]({'where':{'id':_0x3ff869[_0x5f60('0x4b')]['id']}})[_0x5f60('0x26')](handleEntityNotFound(_0x14a856,null))[_0x5f60('0x26')](function(_0x53fe8a){if(_0x53fe8a){_0x490c52=_0x53fe8a;_0x22d67f[_0x5f60('0x31')]=_[_0x5f60('0x44')](db['ZohoConfiguration'][_0x5f60('0x2d')]);_0x22d67f['query']=_[_0x5f60('0x44')](_0x3ff869[_0x5f60('0x32')]);_0x22d67f[_0x5f60('0x33')]=_[_0x5f60('0x45')](_0x22d67f[_0x5f60('0x31')],_0x22d67f[_0x5f60('0x32')]);_0x30c5c7[_0x5f60('0x34')]=_[_0x5f60('0x45')](_0x22d67f[_0x5f60('0x31')],qs[_0x5f60('0x35')](_0x3ff869[_0x5f60('0x32')][_0x5f60('0x35')]));_0x30c5c7[_0x5f60('0x34')]=_0x30c5c7[_0x5f60('0x34')][_0x5f60('0x36')]?_0x30c5c7[_0x5f60('0x34')]:_0x22d67f[_0x5f60('0x31')];_0x30c5c7[_0x5f60('0x39')]=qs[_0x5f60('0x3a')](_0x3ff869['query']['sort']);_0x30c5c7[_0x5f60('0x3b')]=qs['filters'](_[_0x5f60('0x3c')](_0x3ff869[_0x5f60('0x32')],_0x22d67f['filters']));if(_0x3ff869['query']['filter']){_0x30c5c7['where']=_[_0x5f60('0x3d')](_0x30c5c7['where'],{'$or':_[_0x5f60('0x2b')](_0x30c5c7['attributes'],function(_0x478d7c){var _0x2b35da={};_0x2b35da[_0x478d7c]={'$like':'%'+_0x3ff869[_0x5f60('0x32')][_0x5f60('0x4e')]+'%'};return _0x2b35da;})});}_0x30c5c7=_[_0x5f60('0x3d')]({},_0x30c5c7,_0x3ff869[_0x5f60('0x3f')]);return _0x490c52[_0x5f60('0x4f')](_0x30c5c7);}})[_0x5f60('0x26')](function(_0xdbac41){if(_0xdbac41){_0x10fd23=_0xdbac41[_0x5f60('0x36')];if(!_0x3ff869[_0x5f60('0x32')][_0x5f60('0x37')](_0x5f60('0x38'))){_0x30c5c7['limit']=qs[_0x5f60('0x20')](_0x3ff869['query'][_0x5f60('0x20')]);_0x30c5c7[_0x5f60('0x1e')]=qs[_0x5f60('0x1e')](_0x3ff869[_0x5f60('0x32')][_0x5f60('0x1e')]);}return _0x490c52[_0x5f60('0x4f')](_0x30c5c7);}})['then'](function(_0x268d0c){if(_0x268d0c){return _0x268d0c?{'count':_0x10fd23,'rows':_0x268d0c}:null;}})[_0x5f60('0x26')](respondWithResult(_0x14a856,null))[_0x5f60('0x43')](handleError(_0x14a856,null));};exports[_0x5f60('0x50')]=function(_0x7d223d,_0x48cdf8,_0x1fe5e9){if(_0x7d223d[_0x5f60('0x4a')]['id']){delete _0x7d223d[_0x5f60('0x4a')]['id'];}return db[_0x5f60('0x2c')][_0x5f60('0x4d')]({'where':{'id':_0x7d223d[_0x5f60('0x4b')]['id']}})[_0x5f60('0x26')](handleEntityNotFound(_0x48cdf8,null))[_0x5f60('0x26')](function(_0x2bb31c){if(_0x2bb31c){_0x7d223d[_0x5f60('0x4a')][_0x5f60('0x51')]=_0x2bb31c['id'];_0x7d223d[_0x5f60('0x4a')][_0x5f60('0x52')]=integrations['getSubjects'](_0x7d223d[_0x5f60('0x4a')][_0x5f60('0x53')],_0x7d223d['body'][_0x5f60('0x2f')]);_0x7d223d[_0x5f60('0x4a')][_0x5f60('0x54')]=integrations[_0x5f60('0x55')](_0x7d223d[_0x5f60('0x4a')]['channel'],_0x7d223d[_0x5f60('0x4a')][_0x5f60('0x2f')]);return db['ZohoConfiguration'][_0x5f60('0x48')](_0x7d223d[_0x5f60('0x4a')],{'include':[{'model':db['ZohoField'],'as':_0x5f60('0x52')},{'model':db['ZohoField'],'as':_0x5f60('0x54')}]});}return null;})[_0x5f60('0x26')](respondWithResult(_0x48cdf8,null))[_0x5f60('0x43')](handleError(_0x48cdf8,null));};function getAccessToken(_0x2d14ea){return new Promise(function(_0x27940c,_0x44f198){var _0x449c2f;switch(_0x2d14ea[_0x5f60('0x56')]){case'US':_0x449c2f=_0x5f60('0x57');break;case'AU':_0x449c2f='https://accounts.zoho.com.au';break;case'EU':_0x449c2f='https://accounts.zoho.eu';break;case'IN':_0x449c2f=_0x5f60('0x58');break;case'CN':_0x449c2f='https://accounts.zoho.com.cn';break;default:_0x449c2f='https://accounts.zoho.eu';break;}var _0x4e7062={'method':_0x5f60('0x59'),'uri':_0x449c2f+_0x5f60('0x5a'),'qs':{'refresh_token':_0x2d14ea[_0x5f60('0x5b')],'client_id':_0x2d14ea[_0x5f60('0x5c')],'client_secret':_0x2d14ea['clientSecret'],'grant_type':_0x5f60('0x5d')},'json':!![]};return rp(_0x4e7062)['then'](function(_0x52b036){if(_0x52b036['access_token']){_0x27940c(_0x52b036[_0x5f60('0x5e')]);}else{_0x44f198(_0x5f60('0x5f'));}})[_0x5f60('0x43')](function(_0x38a282){_0x44f198(_0x38a282);});});}exports[_0x5f60('0x60')]=function(_0x2c9d4e,_0xd2d805,_0x14b8ac){var _0x418c10,_0x35a7b5,_0x1c635b,_0x4dd3eb,_0x23adac;return db[_0x5f60('0x2c')][_0x5f60('0x4d')]({'where':{'id':_0x2c9d4e[_0x5f60('0x4b')]['id']},'attributes':['id',_0x5f60('0x61'),_0x5f60('0x56'),_0x5f60('0x5c'),_0x5f60('0x62'),'serverUrl',_0x5f60('0x63'),_0x5f60('0x5b')]})[_0x5f60('0x26')](handleEntityNotFound(_0xd2d805,null))['then'](function(_0x5bea00){_0x23adac=_0x5bea00;_0x418c10=_0x23adac[_0x5f60('0x61')];_0x35a7b5=_0x418c10===_0x5f60('0x64')?'eu':_0x5f60('0x65');_0x1c635b=_0x23adac[_0x5f60('0x66')];var _0x3ed1e6=_0x1c635b['slice'](-0x1);if(_0x3ed1e6==='/'||_0x3ed1e6==='\x5c'||_0x3ed1e6===':'){_0x1c635b=_0x1c635b[_0x5f60('0x67')](0x0,_0x1c635b[_0x5f60('0x68')](_0x3ed1e6));}if(!_0x23adac['refreshToken']){throw new Error(_0x5f60('0x69'));}return getAccessToken(_0x23adac);})[_0x5f60('0x26')](function(_0x123146){if(_0x123146){return rp({'method':_0x5f60('0x6a'),'uri':util[_0x5f60('0x6b')](_0x5f60('0x6c'),_0x35a7b5),'qs':{'module':_0x5f60('0x6d')},'headers':{'Authorization':_0x5f60('0x6e')+_0x123146},'json':!![]});}})[_0x5f60('0x26')](function(_0x30d3bc){if(_0x30d3bc){if(_0x30d3bc[_0x5f60('0x6f')]&&_0x30d3bc['response'][_0x5f60('0x28')]){throw new Error(_0x30d3bc['response'][_0x5f60('0x28')][_0x5f60('0x70')]);}var _0x48d585=[];var _0x59293f=[];var _0x5674ce=['Owner','Subject',_0x5f60('0x71'),_0x5f60('0x72'),'Call_Duration',_0x5f60('0x73'),_0x5f60('0x74'),_0x5f60('0x75')];_0x59293f=_['remove'](_0x30d3bc[_0x5f60('0x35')],function(_0x1493d6){return _0x5674ce[_0x5f60('0x76')](_0x1493d6[_0x5f60('0x77')]);});for(var _0x29978c=0x0;_0x29978c<_0x59293f[_0x5f60('0x36')];_0x29978c++){if(_0x59293f[_0x29978c]['system_mandatory']===![]){_0x48d585[_0x5f60('0x78')]({'id':_0x59293f[_0x29978c]['id'],'name':_0x59293f[_0x29978c][_0x5f60('0x79')],'custom':_0x59293f[_0x29978c][_0x5f60('0x7a')],'options':_0x59293f[_0x29978c]['data_type']===_0x5f60('0x7b')&&_0x59293f[_0x29978c][_0x5f60('0x7c')]['length']>-0x1?_[_0x5f60('0x2b')](_0x59293f[_0x29978c][_0x5f60('0x7c')],function(_0x1d4a3b){return{'name':_0x1d4a3b,'value':_0x1d4a3b};}):[]});}}return{'count':_0x48d585[_0x5f60('0x36')],'rows':_0x48d585};}else{return{'count':0x0,'rows':[]};}})[_0x5f60('0x26')](respondWithResult(_0xd2d805,null))[_0x5f60('0x43')](function(_0x27928e){var _0x335155=_0x2c9d4e[_0x5f60('0x32')]['test']?0x1f4:_0x27928e[_0x5f60('0x7d')]||0x1f4;logger[_0x5f60('0x28')](_0x5f60('0x7e'),_0x5f60('0x60'),_0x335155,JSON[_0x5f60('0x7f')](_0x27928e));delete _0x27928e[_0x5f60('0x29')];if(_0x335155===0x191){_0x335155=0x190;}_0xd2d805[_0x5f60('0x1b')](_0x335155)[_0x5f60('0x2a')](_0x2c9d4e[_0x5f60('0x32')]['test']?{'message':_0x5f60('0x80'),'statusCode':_0x27928e[_0x5f60('0x7d')]}:_0x27928e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 06ad6d2..4c279af 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 _0x3593=['info','inspect','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code'];(function(_0x3fb72d,_0xf5c409){var _0x3ed08a=function(_0x4ff79f){while(--_0x4ff79f){_0x3fb72d['push'](_0x3fb72d['shift']());}};_0x3ed08a(++_0xf5c409);}(_0x3593,0x152));var _0x3359=function(_0x475645,_0x1f3e79){_0x475645=_0x475645-0x0;var _0x13e9e9=_0x3593[_0x475645];return _0x13e9e9;};'use strict';var _=require(_0x3359('0x0'));var util=require(_0x3359('0x1'));var logger=require(_0x3359('0x2'))(_0x3359('0x3'));var moment=require(_0x3359('0x4'));var BPromise=require(_0x3359('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3359('0x6'));var config=require(_0x3359('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x3359('0x8'));module[_0x3359('0x9')]=function(_0x2ec3b8,_0x3be0d3){return _0x2ec3b8[_0x3359('0xa')](_0x3359('0xb'),attributes,{'tableName':_0x3359('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x19f859,_0x40a61a,_0x568b6e){if(_0x19f859[_0x3359('0xd')](_0x3359('0xe'))||_0x19f859[_0x3359('0xd')](_0x3359('0xf'))||_0x19f859[_0x3359('0xd')](_0x3359('0x10'))||_0x19f859[_0x3359('0xd')](_0x3359('0x11'))||_0x19f859[_0x3359('0xd')](_0x3359('0x12'))||_0x19f859[_0x3359('0xd')](_0x3359('0x13'))){var _0x3e5b1c,_0x24b2f3;_0x3e5b1c=_0x19f859['serverUrl'];var _0x2ad8b3=_0x3e5b1c[_0x3359('0x14')](-0x1);if(_0x2ad8b3==='/'||_0x2ad8b3==='\x5c'||_0x2ad8b3===':'){_0x3e5b1c=_0x3e5b1c[_0x3359('0x15')](0x0,_0x3e5b1c[_0x3359('0x16')](_0x2ad8b3));}switch(_0x19f859['zone']){case'US':_0x24b2f3=_0x3359('0x17');break;case'AU':_0x24b2f3=_0x3359('0x18');break;case'IN':_0x24b2f3=_0x3359('0x19');break;case'CN':_0x24b2f3='https://accounts.zoho.com.cn';break;default:_0x24b2f3='https://accounts.zoho.eu';break;}var _0x29ed8b={'method':'POST','uri':_0x24b2f3+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x19f859[_0x3359('0x10')],'client_secret':_0x19f859[_0x3359('0x11')],'redirect_uri':_0x19f859[_0x3359('0xf')],'code':_0x19f859['code']},'headers':{'Content-Type':_0x3359('0x1a')}};return rp(_0x29ed8b)[_0x3359('0x1b')](function(_0x494846){var _0xde7e71=JSON[_0x3359('0x1c')](_0x494846);if(_0xde7e71[_0x3359('0x1d')]){_0x19f859[_0x3359('0x1e')]=_0xde7e71[_0x3359('0x1d')];logger['info'](util[_0x3359('0x1f')](_0x3359('0x20'),_0x19f859[_0x3359('0x21')],_0x19f859['id']));}else{logger[_0x3359('0x22')](util[_0x3359('0x1f')](_0x3359('0x23'),_0x19f859['name'],_0x19f859['id']),util['inspect'](_0xde7e71,{'showHidden':![],'depth':null}));}return _0x568b6e(null,_0x40a61a);})[_0x3359('0x24')](function(_0x2390e2){logger[_0x3359('0x22')](util[_0x3359('0x1f')](_0x3359('0x23'),_0x19f859[_0x3359('0x21')],_0x19f859['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x568b6e(_0x2390e2);});}else{return _0x568b6e(null,_0x40a61a);}},'beforeUpdate':function(_0x31d06c,_0x77a31,_0x235593){if(_0x31d06c['changed'](_0x3359('0xe'))||_0x31d06c[_0x3359('0xd')](_0x3359('0xf'))||_0x31d06c[_0x3359('0xd')](_0x3359('0x10'))||_0x31d06c[_0x3359('0xd')]('clientSecret')||_0x31d06c[_0x3359('0xd')](_0x3359('0x12'))||_0x31d06c[_0x3359('0xd')](_0x3359('0x13'))){var _0x33ccd4,_0x56850d;_0x33ccd4=_0x31d06c[_0x3359('0xf')];var _0x2a36bb=_0x33ccd4['slice'](-0x1);if(_0x2a36bb==='/'||_0x2a36bb==='\x5c'||_0x2a36bb===':'){_0x33ccd4=_0x33ccd4['substring'](0x0,_0x33ccd4[_0x3359('0x16')](_0x2a36bb));}switch(_0x31d06c['zone']){case'US':_0x56850d=_0x3359('0x17');break;case'AU':_0x56850d=_0x3359('0x18');break;case'IN':_0x56850d=_0x3359('0x19');break;case'CN':_0x56850d=_0x3359('0x25');break;default:_0x56850d='https://accounts.zoho.eu';break;}var _0x2aff50={'method':'POST','uri':_0x56850d+_0x3359('0x26'),'form':{'grant_type':_0x3359('0x27'),'client_id':_0x31d06c[_0x3359('0x10')],'client_secret':_0x31d06c[_0x3359('0x11')],'redirect_uri':_0x31d06c[_0x3359('0xf')],'code':_0x31d06c[_0x3359('0x12')]},'headers':{'Content-Type':_0x3359('0x1a')}};return rp(_0x2aff50)[_0x3359('0x1b')](function(_0x335e66){var _0x18e1bd=JSON[_0x3359('0x1c')](_0x335e66);if(_0x18e1bd['refresh_token']){_0x31d06c[_0x3359('0x1e')]=_0x18e1bd[_0x3359('0x1d')];logger[_0x3359('0x28')](util[_0x3359('0x1f')](_0x3359('0x20'),_0x31d06c[_0x3359('0x21')],_0x31d06c['id']));}else{logger[_0x3359('0x22')](util[_0x3359('0x1f')](_0x3359('0x23'),_0x31d06c[_0x3359('0x21')],_0x31d06c['id']),util[_0x3359('0x29')](_0x18e1bd,{'showHidden':![],'depth':null}));}return _0x235593(null,_0x77a31);})[_0x3359('0x24')](function(_0x33ee83){logger[_0x3359('0x22')](util[_0x3359('0x1f')](_0x3359('0x23'),_0x31d06c[_0x3359('0x21')],_0x31d06c['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x235593(_0x33ee83);});}else{return _0x235593(null,_0x77a31);}}}});}; \ No newline at end of file +var _0xe2ed=['application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','https://accounts.zoho.com','https://accounts.zoho.eu','info','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2ed,0x95));var _0xde2e=function(_0x1a9591,_0x25a7a0){_0x1a9591=_0x1a9591-0x0;var _0x4ae5a8=_0xe2ed[_0x1a9591];return _0x4ae5a8;};'use strict';var _=require(_0xde2e('0x0'));var util=require(_0xde2e('0x1'));var logger=require(_0xde2e('0x2'))(_0xde2e('0x3'));var moment=require(_0xde2e('0x4'));var BPromise=require(_0xde2e('0x5'));var rp=require(_0xde2e('0x6'));var fs=require('fs');var path=require(_0xde2e('0x7'));var rimraf=require(_0xde2e('0x8'));var config=require('../../config/environment');var attributes=require(_0xde2e('0x9'));var integrations=require(_0xde2e('0xa'));module[_0xde2e('0xb')]=function(_0x1c3cd6,_0x2e703c){return _0x1c3cd6[_0xde2e('0xc')](_0xde2e('0xd'),attributes,{'tableName':_0xde2e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1dfc53,_0x1e94c0,_0x13e57c){if(_0x1dfc53[_0xde2e('0xf')]('zone')||_0x1dfc53['changed']('serverUrl')||_0x1dfc53['changed'](_0xde2e('0x10'))||_0x1dfc53['changed'](_0xde2e('0x11'))||_0x1dfc53[_0xde2e('0xf')](_0xde2e('0x12'))||_0x1dfc53[_0xde2e('0xf')](_0xde2e('0x13'))){var _0x2bebbc,_0x21369e;_0x2bebbc=_0x1dfc53[_0xde2e('0x14')];var _0x1f133e=_0x2bebbc[_0xde2e('0x15')](-0x1);if(_0x1f133e==='/'||_0x1f133e==='\x5c'||_0x1f133e===':'){_0x2bebbc=_0x2bebbc[_0xde2e('0x16')](0x0,_0x2bebbc[_0xde2e('0x17')](_0x1f133e));}switch(_0x1dfc53[_0xde2e('0x18')]){case'US':_0x21369e='https://accounts.zoho.com';break;case'AU':_0x21369e=_0xde2e('0x19');break;case'IN':_0x21369e=_0xde2e('0x1a');break;case'CN':_0x21369e=_0xde2e('0x1b');break;default:_0x21369e='https://accounts.zoho.eu';break;}var _0x15447e={'method':_0xde2e('0x1c'),'uri':_0x21369e+_0xde2e('0x1d'),'form':{'grant_type':_0xde2e('0x1e'),'client_id':_0x1dfc53[_0xde2e('0x10')],'client_secret':_0x1dfc53[_0xde2e('0x11')],'redirect_uri':_0x1dfc53['serverUrl'],'code':_0x1dfc53[_0xde2e('0x12')]},'headers':{'Content-Type':_0xde2e('0x1f')}};return rp(_0x15447e)[_0xde2e('0x20')](function(_0x1ad05f){var _0x137e45=JSON[_0xde2e('0x21')](_0x1ad05f);if(_0x137e45[_0xde2e('0x22')]){_0x1dfc53[_0xde2e('0x23')]=_0x137e45[_0xde2e('0x22')];logger['info'](util[_0xde2e('0x24')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1dfc53['name'],_0x1dfc53['id']));}else{logger[_0xde2e('0x25')](util['format'](_0xde2e('0x26'),_0x1dfc53[_0xde2e('0x27')],_0x1dfc53['id']),util[_0xde2e('0x28')](_0x137e45,{'showHidden':![],'depth':null}));}return _0x13e57c(null,_0x1e94c0);})[_0xde2e('0x29')](function(_0x3974d6){logger[_0xde2e('0x25')](util[_0xde2e('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1dfc53[_0xde2e('0x27')],_0x1dfc53['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x13e57c(_0x3974d6);});}else{return _0x13e57c(null,_0x1e94c0);}},'beforeUpdate':function(_0x42d566,_0x402804,_0x5a20cb){if(_0x42d566[_0xde2e('0xf')](_0xde2e('0x18'))||_0x42d566[_0xde2e('0xf')](_0xde2e('0x14'))||_0x42d566['changed'](_0xde2e('0x10'))||_0x42d566['changed'](_0xde2e('0x11'))||_0x42d566[_0xde2e('0xf')]('code')||_0x42d566['changed'](_0xde2e('0x13'))){var _0x1a2b8d,_0x1875a3;_0x1a2b8d=_0x42d566[_0xde2e('0x14')];var _0x179a36=_0x1a2b8d['slice'](-0x1);if(_0x179a36==='/'||_0x179a36==='\x5c'||_0x179a36===':'){_0x1a2b8d=_0x1a2b8d['substring'](0x0,_0x1a2b8d[_0xde2e('0x17')](_0x179a36));}switch(_0x42d566[_0xde2e('0x18')]){case'US':_0x1875a3=_0xde2e('0x2a');break;case'AU':_0x1875a3=_0xde2e('0x19');break;case'IN':_0x1875a3='https://accounts.zoho.in';break;case'CN':_0x1875a3=_0xde2e('0x1b');break;default:_0x1875a3=_0xde2e('0x2b');break;}var _0xcf2065={'method':_0xde2e('0x1c'),'uri':_0x1875a3+_0xde2e('0x1d'),'form':{'grant_type':_0xde2e('0x1e'),'client_id':_0x42d566[_0xde2e('0x10')],'client_secret':_0x42d566[_0xde2e('0x11')],'redirect_uri':_0x42d566[_0xde2e('0x14')],'code':_0x42d566[_0xde2e('0x12')]},'headers':{'Content-Type':_0xde2e('0x1f')}};return rp(_0xcf2065)['then'](function(_0x4c2c03){var _0x12549c=JSON[_0xde2e('0x21')](_0x4c2c03);if(_0x12549c[_0xde2e('0x22')]){_0x42d566[_0xde2e('0x23')]=_0x12549c[_0xde2e('0x22')];logger[_0xde2e('0x2c')](util[_0xde2e('0x24')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x42d566['name'],_0x42d566['id']));}else{logger[_0xde2e('0x25')](util[_0xde2e('0x24')](_0xde2e('0x26'),_0x42d566[_0xde2e('0x27')],_0x42d566['id']),util['inspect'](_0x12549c,{'showHidden':![],'depth':null}));}return _0x5a20cb(null,_0x402804);})[_0xde2e('0x29')](function(_0x25aa20){logger[_0xde2e('0x25')](util[_0xde2e('0x24')](_0xde2e('0x26'),_0x42d566[_0xde2e('0x27')],_0x42d566['id']),util[_0xde2e('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x5a20cb(_0x25aa20);});}else{return _0x5a20cb(null,_0x402804);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 7900600..e0b4dc7 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 _0xa064=['message','ZohoAccount,\x20%s,\x20%s','result','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZohoAccount','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xa064,0x192));var _0x4a06=function(_0x4b7150,_0x5c23df){_0x4b7150=_0x4b7150-0x0;var _0x298641=_0xa064[_0x4b7150];return _0x298641;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var moment=require(_0x4a06('0x2'));var BPromise=require(_0x4a06('0x3'));var rs=require(_0x4a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a06('0x5'));var logger=require('../../config/logger')(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a06('0x8')][_0x4a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d4e3,_0x3b01cc,_0x454574){return new BPromise(function(_0x4c966b,_0x5e3342){return client[_0x4a06('0xa')](_0x55d4e3,_0x454574)[_0x4a06('0xb')](function(_0x3a8db5){logger[_0x4a06('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));logger[_0x4a06('0xe')](_0x4a06('0xf'),_0x3b01cc,_0x4a06('0xd'),JSON[_0x4a06('0x10')](_0x3a8db5));if(_0x3a8db5[_0x4a06('0x11')]){if(_0x3a8db5[_0x4a06('0x11')]['code']===0x1f4){logger[_0x4a06('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x3b01cc,_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);return _0x5e3342(_0x3a8db5[_0x4a06('0x11')]['message']);}logger[_0x4a06('0x11')](_0x4a06('0x13'),_0x3b01cc,_0x3a8db5[_0x4a06('0x11')]['message']);return _0x4c966b(_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);}else{logger[_0x4a06('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));_0x4c966b(_0x3a8db5[_0x4a06('0x14')][_0x4a06('0x12')]);}})[_0x4a06('0x15')](function(_0x15b067){logger['error'](_0x4a06('0x13'),_0x3b01cc,_0x15b067);_0x5e3342(_0x15b067);});});}exports['GetZohoAccount']=function(_0x4fd47f){var _0x9ea060=this;return new Promise(function(_0x463aca,_0x29e98b){return db[_0x4a06('0x16')][_0x4a06('0x17')]({'raw':_0x4fd47f[_0x4a06('0x18')]?_0x4fd47f[_0x4a06('0x18')][_0x4a06('0x19')]===undefined?!![]:![]:!![],'where':_0x4fd47f[_0x4a06('0x18')]?_0x4fd47f['options'][_0x4a06('0x1a')]||null:null,'attributes':_0x4fd47f[_0x4a06('0x18')]?_0x4fd47f[_0x4a06('0x18')][_0x4a06('0x1b')]||null:null,'limit':_0x4fd47f[_0x4a06('0x18')]?_0x4fd47f[_0x4a06('0x18')][_0x4a06('0x1c')]||null:null,'include':_0x4fd47f[_0x4a06('0x18')]?_0x4fd47f[_0x4a06('0x18')][_0x4a06('0x1d')]?_[_0x4a06('0x1e')](_0x4fd47f[_0x4a06('0x18')][_0x4a06('0x1d')],function(_0x5ebd7c){return{'model':db[_0x5ebd7c['model']],'as':_0x5ebd7c['as'],'attributes':_0x5ebd7c[_0x4a06('0x1b')],'include':_0x5ebd7c[_0x4a06('0x1d')]?_[_0x4a06('0x1e')](_0x5ebd7c[_0x4a06('0x1d')],function(_0x5b5a43){return{'model':db[_0x5b5a43['model']],'as':_0x5b5a43['as'],'attributes':_0x5b5a43[_0x4a06('0x1b')],'include':_0x5b5a43[_0x4a06('0x1d')]?_['map'](_0x5b5a43[_0x4a06('0x1d')],function(_0x54613e){return{'model':db[_0x54613e[_0x4a06('0x1f')]],'as':_0x54613e['as'],'attributes':_0x54613e[_0x4a06('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a47be){logger[_0x4a06('0xc')](_0x4a06('0x20'),_0x4fd47f);logger[_0x4a06('0xe')](_0x4a06('0x20'),_0x4fd47f,JSON[_0x4a06('0x10')](_0x1a47be));_0x463aca(_0x1a47be);})['catch'](function(_0x255924){logger[_0x4a06('0x11')](_0x4a06('0x20'),_0x255924['message'],_0x4fd47f);_0x29e98b(_0x9ea060[_0x4a06('0x11')](0x1f4,_0x255924[_0x4a06('0x12')]));});});};exports[_0x4a06('0x21')]=function(_0x5de4ed){var _0x5a440c=this;return new Promise(function(_0x424e8e,_0x235804){return db[_0x4a06('0x16')][_0x4a06('0x22')]({'raw':_0x5de4ed[_0x4a06('0x18')]?_0x5de4ed[_0x4a06('0x18')][_0x4a06('0x19')]===undefined?!![]:![]:!![],'where':_0x5de4ed[_0x4a06('0x18')]?_0x5de4ed['options'][_0x4a06('0x1a')]||null:null,'attributes':_0x5de4ed[_0x4a06('0x18')]?_0x5de4ed[_0x4a06('0x18')][_0x4a06('0x1b')]||null:null,'include':_0x5de4ed[_0x4a06('0x18')]?_0x5de4ed['options'][_0x4a06('0x1d')]?_['map'](_0x5de4ed[_0x4a06('0x18')][_0x4a06('0x1d')],function(_0x4c0d58){return{'model':db[_0x4c0d58[_0x4a06('0x1f')]],'as':_0x4c0d58['as'],'attributes':_0x4c0d58[_0x4a06('0x1b')],'include':_0x4c0d58[_0x4a06('0x1d')]?_[_0x4a06('0x1e')](_0x4c0d58[_0x4a06('0x1d')],function(_0x4de43c){return{'model':db[_0x4de43c[_0x4a06('0x1f')]],'as':_0x4de43c['as'],'attributes':_0x4de43c['attributes'],'include':_0x4de43c[_0x4a06('0x1d')]?_[_0x4a06('0x1e')](_0x4de43c[_0x4a06('0x1d')],function(_0x4a0a1e){return{'model':db[_0x4a0a1e[_0x4a06('0x1f')]],'as':_0x4a0a1e['as'],'attributes':_0x4a0a1e[_0x4a06('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4a06('0xb')](function(_0x1095f8){logger[_0x4a06('0xc')](_0x4a06('0x21'),_0x5de4ed);logger['debug'](_0x4a06('0x21'),_0x5de4ed,JSON['stringify'](_0x1095f8));_0x424e8e(_0x1095f8);})[_0x4a06('0x15')](function(_0x301bb4){logger[_0x4a06('0x11')]('ShowZohoAccount',_0x301bb4[_0x4a06('0x12')],_0x5de4ed);_0x235804(_0x5a440c['error'](0x1f4,_0x301bb4[_0x4a06('0x12')]));});});}; \ No newline at end of file +var _0x761c=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','raw','options','where','attributes','limit','include','map','model','ShowZohoAccount','lodash','moment'];(function(_0xa79fa,_0xda7962){var _0xdf1884=function(_0x2aea24){while(--_0x2aea24){_0xa79fa['push'](_0xa79fa['shift']());}};_0xdf1884(++_0xda7962);}(_0x761c,0x18a));var _0xc761=function(_0x45b560,_0x11ac32){_0x45b560=_0x45b560-0x0;var _0x16e3be=_0x761c[_0x45b560];return _0x16e3be;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var moment=require(_0xc761('0x1'));var BPromise=require(_0xc761('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc761('0x3'));var db=require(_0xc761('0x4'))['db'];var utils=require(_0xc761('0x5'));var logger=require('../../config/logger')(_0xc761('0x6'));var config=require('../../config/environment');var jayson=require(_0xc761('0x7'));var client=jayson[_0xc761('0x8')][_0xc761('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xafa0bd,_0x2f4f2e,_0x444747){return new BPromise(function(_0x46e882,_0x507772){return client[_0xc761('0xa')](_0xafa0bd,_0x444747)[_0xc761('0xb')](function(_0x175c1c){logger[_0xc761('0xc')](_0xc761('0xd'),_0x2f4f2e,_0xc761('0xe'));logger[_0xc761('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2f4f2e,'request\x20sent',JSON[_0xc761('0x10')](_0x175c1c));if(_0x175c1c[_0xc761('0x11')]){if(_0x175c1c['error']['code']===0x1f4){logger[_0xc761('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x2f4f2e,_0x175c1c[_0xc761('0x11')]['message']);return _0x507772(_0x175c1c[_0xc761('0x11')]['message']);}logger[_0xc761('0x11')](_0xc761('0xd'),_0x2f4f2e,_0x175c1c[_0xc761('0x11')][_0xc761('0x12')]);return _0x46e882(_0x175c1c[_0xc761('0x11')][_0xc761('0x12')]);}else{logger[_0xc761('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x2f4f2e,'request\x20sent');_0x46e882(_0x175c1c[_0xc761('0x13')][_0xc761('0x12')]);}})[_0xc761('0x14')](function(_0x597085){logger[_0xc761('0x11')](_0xc761('0xd'),_0x2f4f2e,_0x597085);_0x507772(_0x597085);});});}exports[_0xc761('0x15')]=function(_0x281750){var _0x31399f=this;return new Promise(function(_0x5939ee,_0x59e371){return db[_0xc761('0x16')][_0xc761('0x17')]({'raw':_0x281750['options']?_0x281750['options'][_0xc761('0x18')]===undefined?!![]:![]:!![],'where':_0x281750[_0xc761('0x19')]?_0x281750[_0xc761('0x19')][_0xc761('0x1a')]||null:null,'attributes':_0x281750[_0xc761('0x19')]?_0x281750['options'][_0xc761('0x1b')]||null:null,'limit':_0x281750[_0xc761('0x19')]?_0x281750[_0xc761('0x19')][_0xc761('0x1c')]||null:null,'include':_0x281750[_0xc761('0x19')]?_0x281750['options'][_0xc761('0x1d')]?_[_0xc761('0x1e')](_0x281750[_0xc761('0x19')][_0xc761('0x1d')],function(_0x47c0d9){return{'model':db[_0x47c0d9['model']],'as':_0x47c0d9['as'],'attributes':_0x47c0d9[_0xc761('0x1b')],'include':_0x47c0d9[_0xc761('0x1d')]?_[_0xc761('0x1e')](_0x47c0d9[_0xc761('0x1d')],function(_0x2a8b01){return{'model':db[_0x2a8b01[_0xc761('0x1f')]],'as':_0x2a8b01['as'],'attributes':_0x2a8b01[_0xc761('0x1b')],'include':_0x2a8b01[_0xc761('0x1d')]?_['map'](_0x2a8b01[_0xc761('0x1d')],function(_0x475e24){return{'model':db[_0x475e24[_0xc761('0x1f')]],'as':_0x475e24['as'],'attributes':_0x475e24['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x15dfb4){logger[_0xc761('0xc')]('GetZohoAccount',_0x281750);logger[_0xc761('0xf')]('GetZohoAccount',_0x281750,JSON[_0xc761('0x10')](_0x15dfb4));_0x5939ee(_0x15dfb4);})['catch'](function(_0x47eda8){logger['error'](_0xc761('0x15'),_0x47eda8[_0xc761('0x12')],_0x281750);_0x59e371(_0x31399f[_0xc761('0x11')](0x1f4,_0x47eda8[_0xc761('0x12')]));});});};exports['ShowZohoAccount']=function(_0xaab91a){var _0x4f494=this;return new Promise(function(_0x3f37fb,_0x37da20){return db[_0xc761('0x16')]['find']({'raw':_0xaab91a[_0xc761('0x19')]?_0xaab91a[_0xc761('0x19')][_0xc761('0x18')]===undefined?!![]:![]:!![],'where':_0xaab91a[_0xc761('0x19')]?_0xaab91a[_0xc761('0x19')][_0xc761('0x1a')]||null:null,'attributes':_0xaab91a[_0xc761('0x19')]?_0xaab91a[_0xc761('0x19')][_0xc761('0x1b')]||null:null,'include':_0xaab91a[_0xc761('0x19')]?_0xaab91a['options'][_0xc761('0x1d')]?_[_0xc761('0x1e')](_0xaab91a['options']['include'],function(_0x2360fc){return{'model':db[_0x2360fc[_0xc761('0x1f')]],'as':_0x2360fc['as'],'attributes':_0x2360fc[_0xc761('0x1b')],'include':_0x2360fc['include']?_['map'](_0x2360fc['include'],function(_0x21fa09){return{'model':db[_0x21fa09[_0xc761('0x1f')]],'as':_0x21fa09['as'],'attributes':_0x21fa09[_0xc761('0x1b')],'include':_0x21fa09[_0xc761('0x1d')]?_['map'](_0x21fa09[_0xc761('0x1d')],function(_0x58d2b6){return{'model':db[_0x58d2b6['model']],'as':_0x58d2b6['as'],'attributes':_0x58d2b6[_0xc761('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc761('0xb')](function(_0x1ea0d5){logger['info'](_0xc761('0x20'),_0xaab91a);logger[_0xc761('0xf')](_0xc761('0x20'),_0xaab91a,JSON['stringify'](_0x1ea0d5));_0x3f37fb(_0x1ea0d5);})[_0xc761('0x14')](function(_0x2171b5){logger[_0xc761('0x11')]('ShowZohoAccount',_0x2171b5[_0xc761('0x12')],_0xaab91a);_0x37da20(_0x4f494[_0xc761('0x11')](0x1f4,_0x2171b5['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index dcdca69..e4d8b93 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 _0x6fac=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields'];(function(_0x52614c,_0x1dd730){var _0x583dcd=function(_0x4e98bf){while(--_0x4e98bf){_0x52614c['push'](_0x52614c['shift']());}};_0x583dcd(++_0x1dd730);}(_0x6fac,0x1d5));var _0xc6fa=function(_0x4cd5e4,_0x4daa0d){_0x4cd5e4=_0x4cd5e4-0x0;var _0x4ba6c8=_0x6fac[_0x4cd5e4];return _0x4ba6c8;};'use strict';var multer=require(_0xc6fa('0x0'));var util=require(_0xc6fa('0x1'));var path=require(_0xc6fa('0x2'));var timeout=require(_0xc6fa('0x3'));var express=require(_0xc6fa('0x4'));var router=express[_0xc6fa('0x5')]();var fs_extra=require(_0xc6fa('0x6'));var auth=require(_0xc6fa('0x7'));var interaction=require(_0xc6fa('0x8'));var config=require(_0xc6fa('0x9'));var controller=require(_0xc6fa('0xa'));router[_0xc6fa('0xb')]('/',auth[_0xc6fa('0xc')](),controller['index']);router[_0xc6fa('0xb')](_0xc6fa('0xd'),auth[_0xc6fa('0xc')](),controller[_0xc6fa('0xe')]);router[_0xc6fa('0xb')](_0xc6fa('0xf'),auth[_0xc6fa('0xc')](),controller[_0xc6fa('0x10')]);router['get'](_0xc6fa('0x11'),auth[_0xc6fa('0xc')](),controller[_0xc6fa('0x12')]);router[_0xc6fa('0xb')](_0xc6fa('0x13'),auth[_0xc6fa('0xc')](),controller[_0xc6fa('0x14')]);router[_0xc6fa('0x15')]('/',auth[_0xc6fa('0xc')](),controller[_0xc6fa('0x16')]);router[_0xc6fa('0x17')]('/:id',auth[_0xc6fa('0xc')](),controller[_0xc6fa('0x18')]);router['delete'](_0xc6fa('0xd'),auth[_0xc6fa('0xc')](),controller[_0xc6fa('0x19')]);module[_0xc6fa('0x1a')]=router; \ No newline at end of file +var _0xabb5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','/:id','get','/:id/fields','/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','path','connect-timeout'];(function(_0x4d908e,_0x493fd7){var _0x35b27b=function(_0x1c850b){while(--_0x1c850b){_0x4d908e['push'](_0x4d908e['shift']());}};_0x35b27b(++_0x493fd7);}(_0xabb5,0x129));var _0x5abb=function(_0x1b2481,_0x497d6d){_0x1b2481=_0x1b2481-0x0;var _0x4a5e1f=_0xabb5[_0x1b2481];return _0x4a5e1f;};'use strict';var multer=require(_0x5abb('0x0'));var util=require('util');var path=require(_0x5abb('0x1'));var timeout=require(_0x5abb('0x2'));var express=require('express');var router=express[_0x5abb('0x3')]();var fs_extra=require(_0x5abb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5abb('0x5'));var config=require(_0x5abb('0x6'));var controller=require(_0x5abb('0x7'));router['get']('/',auth[_0x5abb('0x8')](),controller[_0x5abb('0x9')]);router['get'](_0x5abb('0xa'),auth[_0x5abb('0x8')](),controller['show']);router[_0x5abb('0xb')](_0x5abb('0xc'),auth[_0x5abb('0x8')](),controller['getFields']);router[_0x5abb('0xb')]('/:id/subjects',auth[_0x5abb('0x8')](),controller['getSubjects']);router[_0x5abb('0xb')](_0x5abb('0xd'),auth['isAuthenticated'](),controller[_0x5abb('0xe')]);router[_0x5abb('0xf')]('/',auth[_0x5abb('0x8')](),controller[_0x5abb('0x10')]);router['put'](_0x5abb('0xa'),auth[_0x5abb('0x8')](),controller[_0x5abb('0x11')]);router[_0x5abb('0x12')](_0x5abb('0xa'),auth[_0x5abb('0x8')](),controller['destroy']);module[_0x5abb('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index ddd4a58..dd0d7cf 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 _0x1cfd=['sequelize','exports','STRING','ENUM','lead','contact','contact_lead'];(function(_0x226414,_0x2c6b8b){var _0x4da71b=function(_0x5d1da6){while(--_0x5d1da6){_0x226414['push'](_0x226414['shift']());}};_0x4da71b(++_0x2c6b8b);}(_0x1cfd,0x1a4));var _0xd1cf=function(_0x1e8c86,_0x524c80){_0x1e8c86=_0x1e8c86-0x0;var _0x4b7918=_0x1cfd[_0x1e8c86];return _0x4b7918;};'use strict';var Sequelize=require(_0xd1cf('0x0'));module[_0xd1cf('0x1')]={'name':{'type':Sequelize[_0xd1cf('0x2')]},'moduleCreate':{'type':Sequelize[_0xd1cf('0x3')](_0xd1cf('0x4'),_0xd1cf('0x5'),'nothing'),'defaultValue':_0xd1cf('0x4')},'moduleSearch':{'type':Sequelize[_0xd1cf('0x3')]('contact_lead',_0xd1cf('0x5'),_0xd1cf('0x4')),'defaultValue':_0xd1cf('0x6')},'description':{'type':Sequelize[_0xd1cf('0x2')]}}; \ No newline at end of file +var _0x1225=['lead','sequelize','exports','STRING','ENUM','contact_lead','contact'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x1225,0x10b));var _0x5122=function(_0x23a139,_0xeabab8){_0x23a139=_0x23a139-0x0;var _0x335eab=_0x1225[_0x23a139];return _0x335eab;};'use strict';var Sequelize=require(_0x5122('0x0'));module[_0x5122('0x1')]={'name':{'type':Sequelize[_0x5122('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x5122('0x3')](_0x5122('0x4'),_0x5122('0x5'),_0x5122('0x6')),'defaultValue':_0x5122('0x4')},'description':{'type':Sequelize[_0x5122('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 95c2560..4c73940 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 _0x19ed=['filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','find','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model'];(function(_0x92d580,_0x4928fb){var _0x4ee344=function(_0x55aa0c){while(--_0x55aa0c){_0x92d580['push'](_0x92d580['shift']());}};_0x4ee344(++_0x4928fb);}(_0x19ed,0x156));var _0xd19e=function(_0x70504d,_0x34e810){_0x70504d=_0x70504d-0x0;var _0x47e29b=_0x19ed[_0x70504d];return _0x47e29b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd19e('0x0'));var jsonpatch=require(_0xd19e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd19e('0x2'));var Mustache=require(_0xd19e('0x3'));var util=require('util');var path=require(_0xd19e('0x4'));var sox=require(_0xd19e('0x5'));var csv=require(_0xd19e('0x6'));var ejs=require(_0xd19e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd19e('0x8'));var crypto=require(_0xd19e('0x9'));var jsforce=require(_0xd19e('0xa'));var deskjs=require(_0xd19e('0xb'));var toCsv=require(_0xd19e('0x6'));var querystring=require(_0xd19e('0xc'));var Papa=require(_0xd19e('0xd'));var Redis=require(_0xd19e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd19e('0xf'));var hardwareService=require(_0xd19e('0x10'));var logger=require('../../config/logger')(_0xd19e('0x11'));var utils=require(_0xd19e('0x12'));var config=require(_0xd19e('0x13'));var licenseUtil=require(_0xd19e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x326e94,_0x2fa6fa){_0x2fa6fa=_0x2fa6fa||0xcc;return function(_0x4e710a){if(_0x4e710a){return _0x326e94[_0xd19e('0x15')](_0x2fa6fa);}return _0x326e94['status'](_0x2fa6fa)[_0xd19e('0x16')]();};}function respondWithResult(_0x29f1fc,_0x4cd9da){_0x4cd9da=_0x4cd9da||0xc8;return function(_0x28e7f4){if(_0x28e7f4){return _0x29f1fc[_0xd19e('0x17')](_0x4cd9da)['json'](_0x28e7f4);}};}function respondWithFilteredResult(_0x3052d6,_0x2f7c9a){return function(_0x70a1d9){if(_0x70a1d9){var _0x41985c=typeof _0x2f7c9a['offset']===_0xd19e('0x18')&&typeof _0x2f7c9a['limit']===_0xd19e('0x18');var _0x4eb67b=_0x70a1d9[_0xd19e('0x19')];var _0x3c9db2=_0x41985c?0x0:_0x2f7c9a['offset'];var _0x4d62c2=_0x41985c?_0x70a1d9[_0xd19e('0x19')]:_0x2f7c9a[_0xd19e('0x1a')]+_0x2f7c9a[_0xd19e('0x1b')];var _0x3a0923;if(_0x4d62c2>=_0x4eb67b){_0x4d62c2=_0x4eb67b;_0x3a0923=0xc8;}else{_0x3a0923=0xce;}_0x3052d6[_0xd19e('0x17')](_0x3a0923);return _0x3052d6[_0xd19e('0x1c')](_0xd19e('0x1d'),_0x3c9db2+'-'+_0x4d62c2+'/'+_0x4eb67b)[_0xd19e('0x1e')](_0x70a1d9);}return null;};}function patchUpdates(_0x5d8616){return function(_0x8fe15a){try{jsonpatch[_0xd19e('0x1f')](_0x8fe15a,_0x5d8616,!![]);}catch(_0x271889){return BPromise[_0xd19e('0x20')](_0x271889);}return _0x8fe15a[_0xd19e('0x21')]();};}function saveUpdates(_0x50eb32,_0x5ac9be){return function(_0x555ef7){if(_0x555ef7){return _0x555ef7[_0xd19e('0x22')](_0x50eb32)[_0xd19e('0x23')](function(_0x4a0d83){return _0x4a0d83;});}return null;};}function removeEntity(_0xf7c2d5,_0x35832b){return function(_0x3fef9f){if(_0x3fef9f){return _0x3fef9f[_0xd19e('0x24')]()[_0xd19e('0x23')](function(){_0xf7c2d5['status'](0xcc)[_0xd19e('0x16')]();});}};}function handleEntityNotFound(_0x5dfb55,_0x4f38ba){return function(_0x5f4ca5){if(!_0x5f4ca5){_0x5dfb55[_0xd19e('0x15')](0x194);}return _0x5f4ca5;};}function handleError(_0xfd786a,_0x4b303c){_0x4b303c=_0x4b303c||0x1f4;return function(_0x14f4cc){logger[_0xd19e('0x25')](_0x14f4cc['stack']);if(_0x14f4cc[_0xd19e('0x26')]){delete _0x14f4cc['name'];}_0xfd786a[_0xd19e('0x17')](_0x4b303c)[_0xd19e('0x27')](_0x14f4cc);};}exports[_0xd19e('0x28')]=function(_0x32d2ba,_0x4849cb){var _0xcc0242={},_0x368c46={},_0x4b9e22={'count':0x0,'rows':[]};var _0x2eb17e=_[_0xd19e('0x29')](db[_0xd19e('0x2a')][_0xd19e('0x2b')],function(_0x56eea5){return{'name':_0x56eea5[_0xd19e('0x2c')],'type':_0x56eea5[_0xd19e('0x2d')][_0xd19e('0x2e')]};});_0x368c46[_0xd19e('0x2f')]=_[_0xd19e('0x29')](_0x2eb17e,_0xd19e('0x26'));_0x368c46['query']=_['keys'](_0x32d2ba['query']);_0x368c46[_0xd19e('0x30')]=_[_0xd19e('0x31')](_0x368c46[_0xd19e('0x2f')],_0x368c46[_0xd19e('0x32')]);_0xcc0242[_0xd19e('0x33')]=_['intersection'](_0x368c46['model'],qs[_0xd19e('0x34')](_0x32d2ba[_0xd19e('0x32')][_0xd19e('0x34')]));_0xcc0242[_0xd19e('0x33')]=_0xcc0242[_0xd19e('0x33')][_0xd19e('0x35')]?_0xcc0242[_0xd19e('0x33')]:_0x368c46['model'];if(!_0x32d2ba['query'][_0xd19e('0x36')](_0xd19e('0x37'))){_0xcc0242[_0xd19e('0x1b')]=qs['limit'](_0x32d2ba[_0xd19e('0x32')][_0xd19e('0x1b')]);_0xcc0242['offset']=qs['offset'](_0x32d2ba[_0xd19e('0x32')][_0xd19e('0x1a')]);}_0xcc0242[_0xd19e('0x38')]=qs[_0xd19e('0x39')](_0x32d2ba[_0xd19e('0x32')][_0xd19e('0x39')]);_0xcc0242[_0xd19e('0x3a')]=qs[_0xd19e('0x30')](_[_0xd19e('0x3b')](_0x32d2ba[_0xd19e('0x32')],_0x368c46[_0xd19e('0x30')]),_0x2eb17e);if(_0x32d2ba['query'][_0xd19e('0x3c')]){_0xcc0242[_0xd19e('0x3a')]=_[_0xd19e('0x3d')](_0xcc0242[_0xd19e('0x3a')],{'$or':_[_0xd19e('0x29')](_0x2eb17e,function(_0x2fb6cf){if(_0x2fb6cf['type']!==_0xd19e('0x3e')){var _0x1eccb2={};_0x1eccb2[_0x2fb6cf[_0xd19e('0x26')]]={'$like':'%'+_0x32d2ba['query'][_0xd19e('0x3c')]+'%'};return _0x1eccb2;}})});}_0xcc0242=_[_0xd19e('0x3d')]({},_0xcc0242,_0x32d2ba[_0xd19e('0x3f')]);var _0xaa6f04={'where':_0xcc0242[_0xd19e('0x3a')]};return db[_0xd19e('0x2a')]['count'](_0xaa6f04)[_0xd19e('0x23')](function(_0x4da980){_0x4b9e22[_0xd19e('0x19')]=_0x4da980;if(_0x32d2ba[_0xd19e('0x32')][_0xd19e('0x40')]){_0xcc0242['include']=[{'all':!![]}];}return db[_0xd19e('0x2a')][_0xd19e('0x41')](_0xcc0242);})[_0xd19e('0x23')](function(_0x3bc2ea){_0x4b9e22[_0xd19e('0x42')]=_0x3bc2ea;return _0x4b9e22;})[_0xd19e('0x23')](respondWithFilteredResult(_0x4849cb,_0xcc0242))[_0xd19e('0x43')](handleError(_0x4849cb,null));};exports['show']=function(_0x335269,_0x1b2d16){var _0x101003={'raw':![],'where':{'id':_0x335269[_0xd19e('0x44')]['id']}},_0xaf0d77={};_0xaf0d77[_0xd19e('0x2f')]=_['keys'](db[_0xd19e('0x2a')]['rawAttributes']);_0xaf0d77[_0xd19e('0x32')]=_[_0xd19e('0x45')](_0x335269[_0xd19e('0x32')]);_0xaf0d77[_0xd19e('0x30')]=_[_0xd19e('0x31')](_0xaf0d77[_0xd19e('0x2f')],_0xaf0d77['query']);_0x101003[_0xd19e('0x33')]=_[_0xd19e('0x31')](_0xaf0d77['model'],qs[_0xd19e('0x34')](_0x335269[_0xd19e('0x32')][_0xd19e('0x34')]));_0x101003[_0xd19e('0x33')]=_0x101003['attributes']['length']?_0x101003['attributes']:_0xaf0d77[_0xd19e('0x2f')];if(_0x335269[_0xd19e('0x32')][_0xd19e('0x40')]){_0x101003['include']=[{'all':!![]}];}_0x101003=_[_0xd19e('0x3d')]({},_0x101003,_0x335269['options']);return db[_0xd19e('0x2a')][_0xd19e('0x46')](_0x101003)[_0xd19e('0x23')](handleEntityNotFound(_0x1b2d16,null))[_0xd19e('0x23')](respondWithResult(_0x1b2d16,null))[_0xd19e('0x43')](handleError(_0x1b2d16,null));};exports[_0xd19e('0x47')]=function(_0x22430d,_0x597eb3){return db[_0xd19e('0x2a')][_0xd19e('0x47')](_0x22430d['body'],{})[_0xd19e('0x23')](respondWithResult(_0x597eb3,0xc9))['catch'](handleError(_0x597eb3,null));};exports[_0xd19e('0x22')]=function(_0x1a555c,_0x18863c){if(_0x1a555c[_0xd19e('0x48')]['id']){delete _0x1a555c['body']['id'];}return db['ZohoConfiguration'][_0xd19e('0x46')]({'where':{'id':_0x1a555c['params']['id']}})[_0xd19e('0x23')](handleEntityNotFound(_0x18863c,null))[_0xd19e('0x23')](saveUpdates(_0x1a555c[_0xd19e('0x48')],null))['then'](respondWithResult(_0x18863c,null))['catch'](handleError(_0x18863c,null));};exports[_0xd19e('0x24')]=function(_0x4965b2,_0x5bb0b1){return db[_0xd19e('0x2a')][_0xd19e('0x46')]({'where':{'id':_0x4965b2['params']['id']}})[_0xd19e('0x23')](handleEntityNotFound(_0x5bb0b1,null))[_0xd19e('0x23')](removeEntity(_0x5bb0b1,null))[_0xd19e('0x43')](handleError(_0x5bb0b1,null));};exports[_0xd19e('0x49')]=function(_0xd1b19b,_0x29dc11,_0x314888){var _0x14f65b={};var _0x5be18a={};var _0x580403;var _0x2e5c85;return db[_0xd19e('0x2a')][_0xd19e('0x4a')]({'where':{'id':_0xd1b19b[_0xd19e('0x44')]['id']}})[_0xd19e('0x23')](handleEntityNotFound(_0x29dc11,null))[_0xd19e('0x23')](function(_0x3063ae){if(_0x3063ae){_0x580403=_0x3063ae;_0x5be18a[_0xd19e('0x2f')]=_[_0xd19e('0x45')](db[_0xd19e('0x4b')][_0xd19e('0x2b')]);_0x5be18a['query']=_['keys'](_0xd1b19b['query']);_0x5be18a['filters']=_[_0xd19e('0x31')](_0x5be18a[_0xd19e('0x2f')],_0x5be18a[_0xd19e('0x32')]);_0x14f65b[_0xd19e('0x33')]=_[_0xd19e('0x31')](_0x5be18a[_0xd19e('0x2f')],qs[_0xd19e('0x34')](_0xd1b19b[_0xd19e('0x32')][_0xd19e('0x34')]));_0x14f65b[_0xd19e('0x33')]=_0x14f65b['attributes']['length']?_0x14f65b['attributes']:_0x5be18a['model'];_0x14f65b[_0xd19e('0x38')]=qs[_0xd19e('0x39')](_0xd1b19b[_0xd19e('0x32')]['sort']);_0x14f65b[_0xd19e('0x3a')]=qs[_0xd19e('0x30')](_['pick'](_0xd1b19b[_0xd19e('0x32')],_0x5be18a[_0xd19e('0x30')]));if(_0xd1b19b['query'][_0xd19e('0x3c')]){_0x14f65b['where']=_[_0xd19e('0x3d')](_0x14f65b['where'],{'$or':_['map'](_0x14f65b[_0xd19e('0x33')],function(_0x5e4a5e){var _0x2f2de1={};_0x2f2de1[_0x5e4a5e]={'$like':'%'+_0xd1b19b[_0xd19e('0x32')][_0xd19e('0x3c')]+'%'};return _0x2f2de1;})});}_0x14f65b=_[_0xd19e('0x3d')]({},_0x14f65b,_0xd1b19b['options']);return _0x580403[_0xd19e('0x49')](_0x14f65b);}})[_0xd19e('0x23')](function(_0x4ef0f9){if(_0x4ef0f9){_0x2e5c85=_0x4ef0f9[_0xd19e('0x35')];if(!_0xd1b19b[_0xd19e('0x32')][_0xd19e('0x36')]('nolimit')){_0x14f65b['limit']=qs[_0xd19e('0x1b')](_0xd1b19b['query'][_0xd19e('0x1b')]);_0x14f65b['offset']=qs['offset'](_0xd1b19b[_0xd19e('0x32')][_0xd19e('0x1a')]);}return _0x580403[_0xd19e('0x49')](_0x14f65b);}})[_0xd19e('0x23')](function(_0xb6aa49){if(_0xb6aa49){return _0xb6aa49?{'count':_0x2e5c85,'rows':_0xb6aa49}:null;}})[_0xd19e('0x23')](respondWithResult(_0x29dc11,null))['catch'](handleError(_0x29dc11,null));};exports[_0xd19e('0x4c')]=function(_0x33852b,_0xdd7046,_0x3d6eca){var _0x22a369={};var _0x43f19e={};var _0x28c448;var _0x1fe285;return db[_0xd19e('0x2a')][_0xd19e('0x4a')]({'where':{'id':_0x33852b[_0xd19e('0x44')]['id']}})[_0xd19e('0x23')](handleEntityNotFound(_0xdd7046,null))[_0xd19e('0x23')](function(_0x44ad94){if(_0x44ad94){_0x28c448=_0x44ad94;_0x43f19e[_0xd19e('0x2f')]=_['keys'](db['ZohoField'][_0xd19e('0x2b')]);_0x43f19e[_0xd19e('0x32')]=_[_0xd19e('0x45')](_0x33852b['query']);_0x43f19e[_0xd19e('0x30')]=_['intersection'](_0x43f19e[_0xd19e('0x2f')],_0x43f19e[_0xd19e('0x32')]);_0x22a369[_0xd19e('0x33')]=_[_0xd19e('0x31')](_0x43f19e[_0xd19e('0x2f')],qs[_0xd19e('0x34')](_0x33852b[_0xd19e('0x32')][_0xd19e('0x34')]));_0x22a369[_0xd19e('0x33')]=_0x22a369[_0xd19e('0x33')][_0xd19e('0x35')]?_0x22a369[_0xd19e('0x33')]:_0x43f19e[_0xd19e('0x2f')];_0x22a369['order']=qs[_0xd19e('0x39')](_0x33852b[_0xd19e('0x32')]['sort']);_0x22a369[_0xd19e('0x3a')]=qs[_0xd19e('0x30')](_[_0xd19e('0x3b')](_0x33852b[_0xd19e('0x32')],_0x43f19e['filters']));if(_0x33852b[_0xd19e('0x32')]['filter']){_0x22a369[_0xd19e('0x3a')]=_[_0xd19e('0x3d')](_0x22a369[_0xd19e('0x3a')],{'$or':_[_0xd19e('0x29')](_0x22a369['attributes'],function(_0x162a48){var _0x5f48cc={};_0x5f48cc[_0x162a48]={'$like':'%'+_0x33852b[_0xd19e('0x32')]['filter']+'%'};return _0x5f48cc;})});}_0x22a369=_[_0xd19e('0x3d')]({},_0x22a369,_0x33852b['options']);return _0x28c448[_0xd19e('0x4c')](_0x22a369);}})[_0xd19e('0x23')](function(_0x8427e6){if(_0x8427e6){_0x1fe285=_0x8427e6[_0xd19e('0x35')];if(!_0x33852b[_0xd19e('0x32')][_0xd19e('0x36')](_0xd19e('0x37'))){_0x22a369[_0xd19e('0x1b')]=qs['limit'](_0x33852b[_0xd19e('0x32')][_0xd19e('0x1b')]);_0x22a369[_0xd19e('0x1a')]=qs[_0xd19e('0x1a')](_0x33852b[_0xd19e('0x32')][_0xd19e('0x1a')]);}return _0x28c448[_0xd19e('0x4c')](_0x22a369);}})[_0xd19e('0x23')](function(_0x26f46e){if(_0x26f46e){return _0x26f46e?{'count':_0x1fe285,'rows':_0x26f46e}:null;}})[_0xd19e('0x23')](respondWithResult(_0xdd7046,null))[_0xd19e('0x43')](handleError(_0xdd7046,null));};exports[_0xd19e('0x4d')]=function(_0x535c64,_0x1c4ec2,_0x521228){var _0x5b2962={};var _0x2dc8c7={};var _0x4700b3;var _0x4c742a;return db[_0xd19e('0x2a')]['findOne']({'where':{'id':_0x535c64[_0xd19e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c4ec2,null))[_0xd19e('0x23')](function(_0x576f9e){if(_0x576f9e){_0x4700b3=_0x576f9e;_0x2dc8c7[_0xd19e('0x2f')]=_['keys'](db[_0xd19e('0x4b')][_0xd19e('0x2b')]);_0x2dc8c7[_0xd19e('0x32')]=_['keys'](_0x535c64[_0xd19e('0x32')]);_0x2dc8c7[_0xd19e('0x30')]=_[_0xd19e('0x31')](_0x2dc8c7[_0xd19e('0x2f')],_0x2dc8c7[_0xd19e('0x32')]);_0x5b2962[_0xd19e('0x33')]=_[_0xd19e('0x31')](_0x2dc8c7[_0xd19e('0x2f')],qs['fields'](_0x535c64[_0xd19e('0x32')]['fields']));_0x5b2962['attributes']=_0x5b2962['attributes'][_0xd19e('0x35')]?_0x5b2962[_0xd19e('0x33')]:_0x2dc8c7[_0xd19e('0x2f')];_0x5b2962[_0xd19e('0x38')]=qs[_0xd19e('0x39')](_0x535c64[_0xd19e('0x32')][_0xd19e('0x39')]);_0x5b2962[_0xd19e('0x3a')]=qs[_0xd19e('0x30')](_['pick'](_0x535c64[_0xd19e('0x32')],_0x2dc8c7[_0xd19e('0x30')]));if(_0x535c64[_0xd19e('0x32')]['filter']){_0x5b2962[_0xd19e('0x3a')]=_[_0xd19e('0x3d')](_0x5b2962[_0xd19e('0x3a')],{'$or':_[_0xd19e('0x29')](_0x5b2962[_0xd19e('0x33')],function(_0x37321b){var _0x1bbd9d={};_0x1bbd9d[_0x37321b]={'$like':'%'+_0x535c64['query'][_0xd19e('0x3c')]+'%'};return _0x1bbd9d;})});}_0x5b2962=_['merge']({},_0x5b2962,_0x535c64['options']);return _0x4700b3['getDescriptions'](_0x5b2962);}})['then'](function(_0x9757fb){if(_0x9757fb){_0x4c742a=_0x9757fb[_0xd19e('0x35')];if(!_0x535c64['query'][_0xd19e('0x36')](_0xd19e('0x37'))){_0x5b2962[_0xd19e('0x1b')]=qs['limit'](_0x535c64[_0xd19e('0x32')][_0xd19e('0x1b')]);_0x5b2962[_0xd19e('0x1a')]=qs['offset'](_0x535c64['query'][_0xd19e('0x1a')]);}return _0x4700b3[_0xd19e('0x4d')](_0x5b2962);}})[_0xd19e('0x23')](function(_0x17c740){if(_0x17c740){return _0x17c740?{'count':_0x4c742a,'rows':_0x17c740}:null;}})['then'](respondWithResult(_0x1c4ec2,null))[_0xd19e('0x43')](handleError(_0x1c4ec2,null));}; \ No newline at end of file +var _0xa38d=['apply','reject','save','then','error','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json'];(function(_0x11c257,_0x26ddc2){var _0x1ddc86=function(_0x1cc89f){while(--_0x1cc89f){_0x11c257['push'](_0x11c257['shift']());}};_0x1ddc86(++_0x26ddc2);}(_0xa38d,0x164));var _0xda38=function(_0x53297f,_0x16389a){_0x53297f=_0x53297f-0x0;var _0xd7aec3=_0xa38d[_0x53297f];return _0xd7aec3;};'use strict';var emlformat=require(_0xda38('0x0'));var rimraf=require(_0xda38('0x1'));var zipdir=require(_0xda38('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda38('0x3'));var moment=require(_0xda38('0x4'));var BPromise=require(_0xda38('0x5'));var Mustache=require(_0xda38('0x6'));var util=require(_0xda38('0x7'));var path=require(_0xda38('0x8'));var sox=require(_0xda38('0x9'));var csv=require(_0xda38('0xa'));var ejs=require(_0xda38('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda38('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xda38('0xd'));var deskjs=require(_0xda38('0xe'));var toCsv=require(_0xda38('0xa'));var querystring=require(_0xda38('0xf'));var Papa=require(_0xda38('0x10'));var Redis=require(_0xda38('0x11'));var authService=require(_0xda38('0x12'));var qs=require(_0xda38('0x13'));var as=require(_0xda38('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda38('0x15'))('api');var utils=require(_0xda38('0x16'));var config=require(_0xda38('0x17'));var licenseUtil=require(_0xda38('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4aa3c3,_0x1b4eb1){_0x1b4eb1=_0x1b4eb1||0xcc;return function(_0x5df3f2){if(_0x5df3f2){return _0x4aa3c3[_0xda38('0x19')](_0x1b4eb1);}return _0x4aa3c3[_0xda38('0x1a')](_0x1b4eb1)[_0xda38('0x1b')]();};}function respondWithResult(_0x4795e5,_0x324509){_0x324509=_0x324509||0xc8;return function(_0x1f02c0){if(_0x1f02c0){return _0x4795e5['status'](_0x324509)['json'](_0x1f02c0);}};}function respondWithFilteredResult(_0x44b0ac,_0x2a0971){return function(_0x3fa379){if(_0x3fa379){var _0x37a32b=typeof _0x2a0971[_0xda38('0x1c')]===_0xda38('0x1d')&&typeof _0x2a0971[_0xda38('0x1e')]===_0xda38('0x1d');var _0x2c9116=_0x3fa379[_0xda38('0x1f')];var _0x171ee3=_0x37a32b?0x0:_0x2a0971[_0xda38('0x1c')];var _0x134427=_0x37a32b?_0x3fa379[_0xda38('0x1f')]:_0x2a0971[_0xda38('0x1c')]+_0x2a0971['limit'];var _0x34e123;if(_0x134427>=_0x2c9116){_0x134427=_0x2c9116;_0x34e123=0xc8;}else{_0x34e123=0xce;}_0x44b0ac[_0xda38('0x1a')](_0x34e123);return _0x44b0ac[_0xda38('0x20')]('Content-Range',_0x171ee3+'-'+_0x134427+'/'+_0x2c9116)[_0xda38('0x21')](_0x3fa379);}return null;};}function patchUpdates(_0x2ef616){return function(_0x4ba867){try{jsonpatch[_0xda38('0x22')](_0x4ba867,_0x2ef616,!![]);}catch(_0x59269e){return BPromise[_0xda38('0x23')](_0x59269e);}return _0x4ba867[_0xda38('0x24')]();};}function saveUpdates(_0x3992de,_0x3f37b2){return function(_0x48a0e1){if(_0x48a0e1){return _0x48a0e1['update'](_0x3992de)[_0xda38('0x25')](function(_0xeba47){return _0xeba47;});}return null;};}function removeEntity(_0x23b413,_0x3b13ba){return function(_0xbe1892){if(_0xbe1892){return _0xbe1892['destroy']()[_0xda38('0x25')](function(){_0x23b413['status'](0xcc)[_0xda38('0x1b')]();});}};}function handleEntityNotFound(_0x360110,_0x13c971){return function(_0x10475d){if(!_0x10475d){_0x360110[_0xda38('0x19')](0x194);}return _0x10475d;};}function handleError(_0x459835,_0x93a587){_0x93a587=_0x93a587||0x1f4;return function(_0x196f66){logger[_0xda38('0x26')](_0x196f66[_0xda38('0x27')]);if(_0x196f66['name']){delete _0x196f66[_0xda38('0x28')];}_0x459835[_0xda38('0x1a')](_0x93a587)[_0xda38('0x29')](_0x196f66);};}exports['index']=function(_0x857e14,_0x2ddf47){var _0x3c6b0d={},_0x24c1fa={},_0x25140b={'count':0x0,'rows':[]};var _0x4aafa1=_[_0xda38('0x2a')](db[_0xda38('0x2b')][_0xda38('0x2c')],function(_0x5ee901){return{'name':_0x5ee901[_0xda38('0x2d')],'type':_0x5ee901[_0xda38('0x2e')]['key']};});_0x24c1fa['model']=_['map'](_0x4aafa1,'name');_0x24c1fa[_0xda38('0x2f')]=_['keys'](_0x857e14[_0xda38('0x2f')]);_0x24c1fa[_0xda38('0x30')]=_[_0xda38('0x31')](_0x24c1fa['model'],_0x24c1fa[_0xda38('0x2f')]);_0x3c6b0d['attributes']=_[_0xda38('0x31')](_0x24c1fa[_0xda38('0x32')],qs[_0xda38('0x33')](_0x857e14[_0xda38('0x2f')][_0xda38('0x33')]));_0x3c6b0d[_0xda38('0x34')]=_0x3c6b0d[_0xda38('0x34')][_0xda38('0x35')]?_0x3c6b0d[_0xda38('0x34')]:_0x24c1fa[_0xda38('0x32')];if(!_0x857e14[_0xda38('0x2f')][_0xda38('0x36')](_0xda38('0x37'))){_0x3c6b0d[_0xda38('0x1e')]=qs[_0xda38('0x1e')](_0x857e14[_0xda38('0x2f')]['limit']);_0x3c6b0d[_0xda38('0x1c')]=qs['offset'](_0x857e14[_0xda38('0x2f')][_0xda38('0x1c')]);}_0x3c6b0d[_0xda38('0x38')]=qs[_0xda38('0x39')](_0x857e14[_0xda38('0x2f')][_0xda38('0x39')]);_0x3c6b0d[_0xda38('0x3a')]=qs[_0xda38('0x30')](_[_0xda38('0x3b')](_0x857e14[_0xda38('0x2f')],_0x24c1fa[_0xda38('0x30')]),_0x4aafa1);if(_0x857e14[_0xda38('0x2f')][_0xda38('0x3c')]){_0x3c6b0d['where']=_['merge'](_0x3c6b0d[_0xda38('0x3a')],{'$or':_[_0xda38('0x2a')](_0x4aafa1,function(_0x4650d9){if(_0x4650d9[_0xda38('0x2e')]!=='VIRTUAL'){var _0x45f9d7={};_0x45f9d7[_0x4650d9['name']]={'$like':'%'+_0x857e14[_0xda38('0x2f')][_0xda38('0x3c')]+'%'};return _0x45f9d7;}})});}_0x3c6b0d=_[_0xda38('0x3d')]({},_0x3c6b0d,_0x857e14[_0xda38('0x3e')]);var _0x10416b={'where':_0x3c6b0d[_0xda38('0x3a')]};return db[_0xda38('0x2b')][_0xda38('0x1f')](_0x10416b)[_0xda38('0x25')](function(_0x41ab3a){_0x25140b[_0xda38('0x1f')]=_0x41ab3a;if(_0x857e14['query']['includeAll']){_0x3c6b0d[_0xda38('0x3f')]=[{'all':!![]}];}return db[_0xda38('0x2b')][_0xda38('0x40')](_0x3c6b0d);})[_0xda38('0x25')](function(_0x2fc8c9){_0x25140b[_0xda38('0x41')]=_0x2fc8c9;return _0x25140b;})[_0xda38('0x25')](respondWithFilteredResult(_0x2ddf47,_0x3c6b0d))[_0xda38('0x42')](handleError(_0x2ddf47,null));};exports[_0xda38('0x43')]=function(_0x2bcd3f,_0x7b2165){var _0x192025={'raw':![],'where':{'id':_0x2bcd3f[_0xda38('0x44')]['id']}},_0x3e5238={};_0x3e5238[_0xda38('0x32')]=_[_0xda38('0x45')](db[_0xda38('0x2b')]['rawAttributes']);_0x3e5238[_0xda38('0x2f')]=_[_0xda38('0x45')](_0x2bcd3f[_0xda38('0x2f')]);_0x3e5238['filters']=_[_0xda38('0x31')](_0x3e5238[_0xda38('0x32')],_0x3e5238[_0xda38('0x2f')]);_0x192025[_0xda38('0x34')]=_[_0xda38('0x31')](_0x3e5238[_0xda38('0x32')],qs[_0xda38('0x33')](_0x2bcd3f[_0xda38('0x2f')][_0xda38('0x33')]));_0x192025[_0xda38('0x34')]=_0x192025[_0xda38('0x34')][_0xda38('0x35')]?_0x192025[_0xda38('0x34')]:_0x3e5238[_0xda38('0x32')];if(_0x2bcd3f[_0xda38('0x2f')]['includeAll']){_0x192025[_0xda38('0x3f')]=[{'all':!![]}];}_0x192025=_[_0xda38('0x3d')]({},_0x192025,_0x2bcd3f['options']);return db[_0xda38('0x2b')][_0xda38('0x46')](_0x192025)[_0xda38('0x25')](handleEntityNotFound(_0x7b2165,null))[_0xda38('0x25')](respondWithResult(_0x7b2165,null))[_0xda38('0x42')](handleError(_0x7b2165,null));};exports[_0xda38('0x47')]=function(_0x273c7f,_0x13b2af){return db[_0xda38('0x2b')][_0xda38('0x47')](_0x273c7f['body'],{})[_0xda38('0x25')](respondWithResult(_0x13b2af,0xc9))[_0xda38('0x42')](handleError(_0x13b2af,null));};exports['update']=function(_0x586a3b,_0x373a5b){if(_0x586a3b[_0xda38('0x48')]['id']){delete _0x586a3b['body']['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x586a3b[_0xda38('0x44')]['id']}})[_0xda38('0x25')](handleEntityNotFound(_0x373a5b,null))[_0xda38('0x25')](saveUpdates(_0x586a3b[_0xda38('0x48')],null))[_0xda38('0x25')](respondWithResult(_0x373a5b,null))['catch'](handleError(_0x373a5b,null));};exports[_0xda38('0x49')]=function(_0x20363b,_0x19addc){return db[_0xda38('0x2b')][_0xda38('0x46')]({'where':{'id':_0x20363b[_0xda38('0x44')]['id']}})[_0xda38('0x25')](handleEntityNotFound(_0x19addc,null))[_0xda38('0x25')](removeEntity(_0x19addc,null))['catch'](handleError(_0x19addc,null));};exports['getFields']=function(_0x455a58,_0x1a6fd4,_0x384229){var _0x446b35={};var _0x4597ac={};var _0x1787a8;var _0x7a0dd3;return db[_0xda38('0x2b')][_0xda38('0x4a')]({'where':{'id':_0x455a58[_0xda38('0x44')]['id']}})[_0xda38('0x25')](handleEntityNotFound(_0x1a6fd4,null))[_0xda38('0x25')](function(_0x54f677){if(_0x54f677){_0x1787a8=_0x54f677;_0x4597ac['model']=_['keys'](db[_0xda38('0x4b')][_0xda38('0x2c')]);_0x4597ac['query']=_[_0xda38('0x45')](_0x455a58['query']);_0x4597ac[_0xda38('0x30')]=_[_0xda38('0x31')](_0x4597ac[_0xda38('0x32')],_0x4597ac['query']);_0x446b35['attributes']=_[_0xda38('0x31')](_0x4597ac[_0xda38('0x32')],qs[_0xda38('0x33')](_0x455a58[_0xda38('0x2f')]['fields']));_0x446b35[_0xda38('0x34')]=_0x446b35['attributes'][_0xda38('0x35')]?_0x446b35[_0xda38('0x34')]:_0x4597ac[_0xda38('0x32')];_0x446b35['order']=qs[_0xda38('0x39')](_0x455a58['query'][_0xda38('0x39')]);_0x446b35['where']=qs[_0xda38('0x30')](_[_0xda38('0x3b')](_0x455a58[_0xda38('0x2f')],_0x4597ac[_0xda38('0x30')]));if(_0x455a58[_0xda38('0x2f')][_0xda38('0x3c')]){_0x446b35[_0xda38('0x3a')]=_['merge'](_0x446b35[_0xda38('0x3a')],{'$or':_[_0xda38('0x2a')](_0x446b35[_0xda38('0x34')],function(_0x31cc6a){var _0x4f4fbb={};_0x4f4fbb[_0x31cc6a]={'$like':'%'+_0x455a58['query'][_0xda38('0x3c')]+'%'};return _0x4f4fbb;})});}_0x446b35=_[_0xda38('0x3d')]({},_0x446b35,_0x455a58[_0xda38('0x3e')]);return _0x1787a8['getFields'](_0x446b35);}})['then'](function(_0x3bf6ae){if(_0x3bf6ae){_0x7a0dd3=_0x3bf6ae[_0xda38('0x35')];if(!_0x455a58['query'][_0xda38('0x36')](_0xda38('0x37'))){_0x446b35['limit']=qs[_0xda38('0x1e')](_0x455a58[_0xda38('0x2f')]['limit']);_0x446b35[_0xda38('0x1c')]=qs['offset'](_0x455a58[_0xda38('0x2f')][_0xda38('0x1c')]);}return _0x1787a8['getFields'](_0x446b35);}})['then'](function(_0x27c562){if(_0x27c562){return _0x27c562?{'count':_0x7a0dd3,'rows':_0x27c562}:null;}})[_0xda38('0x25')](respondWithResult(_0x1a6fd4,null))[_0xda38('0x42')](handleError(_0x1a6fd4,null));};exports[_0xda38('0x4c')]=function(_0x3b421b,_0x25dbb4,_0x5487a6){var _0x2c28f7={};var _0x1060c7={};var _0x136fe6;var _0x346a73;return db['ZohoConfiguration'][_0xda38('0x4a')]({'where':{'id':_0x3b421b[_0xda38('0x44')]['id']}})[_0xda38('0x25')](handleEntityNotFound(_0x25dbb4,null))[_0xda38('0x25')](function(_0x1d54ee){if(_0x1d54ee){_0x136fe6=_0x1d54ee;_0x1060c7[_0xda38('0x32')]=_[_0xda38('0x45')](db[_0xda38('0x4b')]['rawAttributes']);_0x1060c7[_0xda38('0x2f')]=_[_0xda38('0x45')](_0x3b421b['query']);_0x1060c7[_0xda38('0x30')]=_['intersection'](_0x1060c7['model'],_0x1060c7[_0xda38('0x2f')]);_0x2c28f7['attributes']=_['intersection'](_0x1060c7[_0xda38('0x32')],qs['fields'](_0x3b421b[_0xda38('0x2f')][_0xda38('0x33')]));_0x2c28f7[_0xda38('0x34')]=_0x2c28f7[_0xda38('0x34')][_0xda38('0x35')]?_0x2c28f7[_0xda38('0x34')]:_0x1060c7[_0xda38('0x32')];_0x2c28f7['order']=qs[_0xda38('0x39')](_0x3b421b[_0xda38('0x2f')][_0xda38('0x39')]);_0x2c28f7[_0xda38('0x3a')]=qs[_0xda38('0x30')](_[_0xda38('0x3b')](_0x3b421b[_0xda38('0x2f')],_0x1060c7['filters']));if(_0x3b421b['query'][_0xda38('0x3c')]){_0x2c28f7[_0xda38('0x3a')]=_[_0xda38('0x3d')](_0x2c28f7[_0xda38('0x3a')],{'$or':_['map'](_0x2c28f7[_0xda38('0x34')],function(_0x45c57e){var _0x29f57d={};_0x29f57d[_0x45c57e]={'$like':'%'+_0x3b421b[_0xda38('0x2f')][_0xda38('0x3c')]+'%'};return _0x29f57d;})});}_0x2c28f7=_[_0xda38('0x3d')]({},_0x2c28f7,_0x3b421b[_0xda38('0x3e')]);return _0x136fe6[_0xda38('0x4c')](_0x2c28f7);}})[_0xda38('0x25')](function(_0x4705ac){if(_0x4705ac){_0x346a73=_0x4705ac['length'];if(!_0x3b421b[_0xda38('0x2f')]['hasOwnProperty'](_0xda38('0x37'))){_0x2c28f7[_0xda38('0x1e')]=qs[_0xda38('0x1e')](_0x3b421b[_0xda38('0x2f')][_0xda38('0x1e')]);_0x2c28f7[_0xda38('0x1c')]=qs[_0xda38('0x1c')](_0x3b421b[_0xda38('0x2f')][_0xda38('0x1c')]);}return _0x136fe6[_0xda38('0x4c')](_0x2c28f7);}})[_0xda38('0x25')](function(_0x14b991){if(_0x14b991){return _0x14b991?{'count':_0x346a73,'rows':_0x14b991}:null;}})[_0xda38('0x25')](respondWithResult(_0x25dbb4,null))[_0xda38('0x42')](handleError(_0x25dbb4,null));};exports[_0xda38('0x4d')]=function(_0x29d04b,_0x2b12bd,_0x3487d0){var _0x2a3727={};var _0x1e9038={};var _0x4c62bb;var _0x59d0f9;return db[_0xda38('0x2b')][_0xda38('0x4a')]({'where':{'id':_0x29d04b['params']['id']}})[_0xda38('0x25')](handleEntityNotFound(_0x2b12bd,null))[_0xda38('0x25')](function(_0x4ff986){if(_0x4ff986){_0x4c62bb=_0x4ff986;_0x1e9038[_0xda38('0x32')]=_[_0xda38('0x45')](db[_0xda38('0x4b')][_0xda38('0x2c')]);_0x1e9038[_0xda38('0x2f')]=_[_0xda38('0x45')](_0x29d04b[_0xda38('0x2f')]);_0x1e9038[_0xda38('0x30')]=_[_0xda38('0x31')](_0x1e9038['model'],_0x1e9038[_0xda38('0x2f')]);_0x2a3727[_0xda38('0x34')]=_[_0xda38('0x31')](_0x1e9038[_0xda38('0x32')],qs[_0xda38('0x33')](_0x29d04b[_0xda38('0x2f')][_0xda38('0x33')]));_0x2a3727[_0xda38('0x34')]=_0x2a3727[_0xda38('0x34')][_0xda38('0x35')]?_0x2a3727[_0xda38('0x34')]:_0x1e9038[_0xda38('0x32')];_0x2a3727['order']=qs['sort'](_0x29d04b[_0xda38('0x2f')][_0xda38('0x39')]);_0x2a3727[_0xda38('0x3a')]=qs[_0xda38('0x30')](_['pick'](_0x29d04b[_0xda38('0x2f')],_0x1e9038[_0xda38('0x30')]));if(_0x29d04b[_0xda38('0x2f')][_0xda38('0x3c')]){_0x2a3727[_0xda38('0x3a')]=_[_0xda38('0x3d')](_0x2a3727[_0xda38('0x3a')],{'$or':_[_0xda38('0x2a')](_0x2a3727['attributes'],function(_0x2fa8d2){var _0x17ef75={};_0x17ef75[_0x2fa8d2]={'$like':'%'+_0x29d04b[_0xda38('0x2f')]['filter']+'%'};return _0x17ef75;})});}_0x2a3727=_[_0xda38('0x3d')]({},_0x2a3727,_0x29d04b[_0xda38('0x3e')]);return _0x4c62bb[_0xda38('0x4d')](_0x2a3727);}})[_0xda38('0x25')](function(_0x49bc67){if(_0x49bc67){_0x59d0f9=_0x49bc67[_0xda38('0x35')];if(!_0x29d04b['query']['hasOwnProperty'](_0xda38('0x37'))){_0x2a3727[_0xda38('0x1e')]=qs['limit'](_0x29d04b[_0xda38('0x2f')][_0xda38('0x1e')]);_0x2a3727[_0xda38('0x1c')]=qs[_0xda38('0x1c')](_0x29d04b[_0xda38('0x2f')][_0xda38('0x1c')]);}return _0x4c62bb[_0xda38('0x4d')](_0x2a3727);}})[_0xda38('0x25')](function(_0x1690a7){if(_0x1690a7){return _0x1690a7?{'count':_0x59d0f9,'rows':_0x1690a7}:null;}})[_0xda38('0x25')](respondWithResult(_0x2b12bd,null))['catch'](handleError(_0x2b12bd,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 1dbff07..31c7d21 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 _0x6e96=['rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xac9b71,_0x4c8fa2){var _0x276103=function(_0x97a41a){while(--_0x97a41a){_0xac9b71['push'](_0xac9b71['shift']());}};_0x276103(++_0x4c8fa2);}(_0x6e96,0xd6));var _0x66e9=function(_0x477d1b,_0x2a673b){_0x477d1b=_0x477d1b-0x0;var _0x56349f=_0x6e96[_0x477d1b];return _0x56349f;};'use strict';var _=require('lodash');var util=require(_0x66e9('0x0'));var logger=require(_0x66e9('0x1'))(_0x66e9('0x2'));var moment=require(_0x66e9('0x3'));var BPromise=require(_0x66e9('0x4'));var rp=require(_0x66e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66e9('0x6'));var config=require(_0x66e9('0x7'));var attributes=require(_0x66e9('0x8'));module['exports']=function(_0x5dc9c3,_0x1e3673){return _0x5dc9c3['define'](_0x66e9('0x9'),attributes,{'tableName':_0x66e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x210b=['path','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a00a0,_0x570182){var _0x32c986=function(_0x1b6a0a){while(--_0x1b6a0a){_0x2a00a0['push'](_0x2a00a0['shift']());}};_0x32c986(++_0x570182);}(_0x210b,0x1b3));var _0xb210=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x210b[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xb210('0x0'));var util=require(_0xb210('0x1'));var logger=require(_0xb210('0x2'))(_0xb210('0x3'));var moment=require(_0xb210('0x4'));var BPromise=require(_0xb210('0x5'));var rp=require(_0xb210('0x6'));var fs=require('fs');var path=require(_0xb210('0x7'));var rimraf=require('rimraf');var config=require(_0xb210('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0xb210('0x9')]=function(_0x1b0770,_0x251145){return _0x1b0770[_0xb210('0xa')](_0xb210('0xb'),attributes,{'tableName':_0xb210('0xc'),'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 eebb9e7..46a400c 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 _0x4574=['then','info','request\x20sent','debug','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x1ee0a1,_0x51058e){var _0x1d2d5b=function(_0x35cfb5){while(--_0x35cfb5){_0x1ee0a1['push'](_0x1ee0a1['shift']());}};_0x1d2d5b(++_0x51058e);}(_0x4574,0x82));var _0x4457=function(_0x1ef458,_0x1f4eaa){_0x1ef458=_0x1ef458-0x0;var _0x6a1ec4=_0x4574[_0x1ef458];return _0x6a1ec4;};'use strict';var _=require('lodash');var util=require(_0x4457('0x0'));var moment=require(_0x4457('0x1'));var BPromise=require(_0x4457('0x2'));var rs=require(_0x4457('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4457('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4457('0x5'))(_0x4457('0x6'));var config=require('../../config/environment');var jayson=require(_0x4457('0x7'));var client=jayson['client'][_0x4457('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x233845,_0x13da08,_0x5da438){return new BPromise(function(_0x30a74c,_0x521f7c){return client[_0x4457('0x9')](_0x233845,_0x5da438)[_0x4457('0xa')](function(_0x12ce6c){logger[_0x4457('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x13da08,_0x4457('0xc'));logger[_0x4457('0xd')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x13da08,'request\x20sent',JSON[_0x4457('0xe')](_0x12ce6c));if(_0x12ce6c['error']){if(_0x12ce6c[_0x4457('0xf')]['code']===0x1f4){logger[_0x4457('0xf')](_0x4457('0x10'),_0x13da08,_0x12ce6c[_0x4457('0xf')]['message']);return _0x521f7c(_0x12ce6c[_0x4457('0xf')][_0x4457('0x11')]);}logger[_0x4457('0xf')](_0x4457('0x10'),_0x13da08,_0x12ce6c[_0x4457('0xf')][_0x4457('0x11')]);return _0x30a74c(_0x12ce6c[_0x4457('0xf')][_0x4457('0x11')]);}else{logger[_0x4457('0xb')](_0x4457('0x10'),_0x13da08,_0x4457('0xc'));_0x30a74c(_0x12ce6c[_0x4457('0x12')][_0x4457('0x11')]);}})[_0x4457('0x13')](function(_0x152057){logger[_0x4457('0xf')](_0x4457('0x10'),_0x13da08,_0x152057);_0x521f7c(_0x152057);});});} \ No newline at end of file +var _0xee1d=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request\x20sent','stringify','error','message','ZohoConfiguration,\x20%s,\x20%s','info'];(function(_0x4ea0e6,_0x4fd5bf){var _0x1b641e=function(_0x2a318d){while(--_0x2a318d){_0x4ea0e6['push'](_0x4ea0e6['shift']());}};_0x1b641e(++_0x4fd5bf);}(_0xee1d,0x1aa));var _0xdee1=function(_0x28553c,_0x4123d1){_0x28553c=_0x28553c-0x0;var _0x4f1e57=_0xee1d[_0x28553c];return _0x4f1e57;};'use strict';var _=require(_0xdee1('0x0'));var util=require(_0xdee1('0x1'));var moment=require(_0xdee1('0x2'));var BPromise=require(_0xdee1('0x3'));var rs=require(_0xdee1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdee1('0x5'))['db'];var utils=require(_0xdee1('0x6'));var logger=require('../../config/logger')(_0xdee1('0x7'));var config=require(_0xdee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdee1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33a2f8,_0x5a2f64,_0x32b44f){return new BPromise(function(_0x5bd826,_0x1ac9b1){return client['request'](_0x33a2f8,_0x32b44f)['then'](function(_0x3168ba){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x5a2f64,_0xdee1('0xa'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5a2f64,_0xdee1('0xa'),JSON[_0xdee1('0xb')](_0x3168ba));if(_0x3168ba[_0xdee1('0xc')]){if(_0x3168ba[_0xdee1('0xc')]['code']===0x1f4){logger[_0xdee1('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x5a2f64,_0x3168ba[_0xdee1('0xc')]['message']);return _0x1ac9b1(_0x3168ba[_0xdee1('0xc')][_0xdee1('0xd')]);}logger[_0xdee1('0xc')](_0xdee1('0xe'),_0x5a2f64,_0x3168ba[_0xdee1('0xc')]['message']);return _0x5bd826(_0x3168ba[_0xdee1('0xc')][_0xdee1('0xd')]);}else{logger[_0xdee1('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x5a2f64,'request\x20sent');_0x5bd826(_0x3168ba[_0xdee1('0x10')][_0xdee1('0xd')]);}})['catch'](function(_0xd541fd){logger[_0xdee1('0xc')](_0xdee1('0xe'),_0x5a2f64,_0xd541fd);_0x1ac9b1(_0xd541fd);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index bc382c2..761b754 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 _0xd0e3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','show','create','put','/:id','update','delete','multer','util','path'];(function(_0x4ffa03,_0x363a82){var _0x30d661=function(_0x36ba86){while(--_0x36ba86){_0x4ffa03['push'](_0x4ffa03['shift']());}};_0x30d661(++_0x363a82);}(_0xd0e3,0x19b));var _0x3d0e=function(_0x172cf3,_0x310b51){_0x172cf3=_0x172cf3-0x0;var _0x62ec22=_0xd0e3[_0x172cf3];return _0x62ec22;};'use strict';var multer=require(_0x3d0e('0x0'));var util=require(_0x3d0e('0x1'));var path=require(_0x3d0e('0x2'));var timeout=require(_0x3d0e('0x3'));var express=require(_0x3d0e('0x4'));var router=express[_0x3d0e('0x5')]();var fs_extra=require(_0x3d0e('0x6'));var auth=require(_0x3d0e('0x7'));var interaction=require(_0x3d0e('0x8'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router['get']('/',auth[_0x3d0e('0x9')](),controller[_0x3d0e('0xa')]);router[_0x3d0e('0xb')]('/:id',auth[_0x3d0e('0x9')](),controller[_0x3d0e('0xc')]);router['post']('/',auth[_0x3d0e('0x9')](),controller[_0x3d0e('0xd')]);router[_0x3d0e('0xe')](_0x3d0e('0xf'),auth[_0x3d0e('0x9')](),controller[_0x3d0e('0x10')]);router[_0x3d0e('0x11')](_0x3d0e('0xf'),auth[_0x3d0e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa9c7=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports'];(function(_0x4ebc11,_0x853cd4){var _0x280b72=function(_0xd24054){while(--_0xd24054){_0x4ebc11['push'](_0x4ebc11['shift']());}};_0x280b72(++_0x853cd4);}(_0xa9c7,0xb4));var _0x7a9c=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0xa9c7[_0x479160];return _0x47ac6d;};'use strict';var multer=require(_0x7a9c('0x0'));var util=require(_0x7a9c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7a9c('0x2'));var router=express[_0x7a9c('0x3')]();var fs_extra=require(_0x7a9c('0x4'));var auth=require(_0x7a9c('0x5'));var interaction=require(_0x7a9c('0x6'));var config=require(_0x7a9c('0x7'));var controller=require('./intZohoField.controller');router[_0x7a9c('0x8')]('/',auth[_0x7a9c('0x9')](),controller[_0x7a9c('0xa')]);router[_0x7a9c('0x8')](_0x7a9c('0xb'),auth[_0x7a9c('0x9')](),controller['show']);router[_0x7a9c('0xc')]('/',auth[_0x7a9c('0x9')](),controller[_0x7a9c('0xd')]);router['put'](_0x7a9c('0xb'),auth[_0x7a9c('0x9')](),controller[_0x7a9c('0xe')]);router[_0x7a9c('0xf')](_0x7a9c('0xb'),auth[_0x7a9c('0x9')](),controller[_0x7a9c('0x10')]);module[_0x7a9c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 85af9e6..08f8b9a 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 _0x571d=['variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x3d91fd,_0x3a768b){var _0x137a3a=function(_0x19f617){while(--_0x19f617){_0x3d91fd['push'](_0x3d91fd['shift']());}};_0x137a3a(++_0x3a768b);}(_0x571d,0x6b));var _0xd571=function(_0x571521,_0x50cb39){_0x571521=_0x571521-0x0;var _0x55f6dd=_0x571d[_0x571521];return _0x55f6dd;};'use strict';var Sequelize=require(_0xd571('0x0'));module[_0xd571('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd571('0x2'),_0xd571('0x3'),_0xd571('0x4'),_0xd571('0x5'),_0xd571('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd571('0x7')]},'key':{'type':Sequelize[_0xd571('0x7')]},'keyType':{'type':Sequelize[_0xd571('0x8')](_0xd571('0x2'),_0xd571('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd571('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd571('0x7')]},'customField':{'type':Sequelize[_0xd571('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd571('0x7')]}}; \ No newline at end of file +var _0xfea7=['keyValue','picklist','STRING','ENUM','variable','customVariable','BOOLEAN','sequelize','exports','string'];(function(_0x504f20,_0x1be5be){var _0x2c1254=function(_0x4931df){while(--_0x4931df){_0x504f20['push'](_0x504f20['shift']());}};_0x2c1254(++_0x1be5be);}(_0xfea7,0x1d3));var _0x7fea=function(_0x3bc72a,_0x25471d){_0x3bc72a=_0x3bc72a-0x0;var _0x539ff0=_0xfea7[_0x3bc72a];return _0x539ff0;};'use strict';var Sequelize=require(_0x7fea('0x0'));module[_0x7fea('0x1')]={'type':{'type':Sequelize['ENUM'](_0x7fea('0x2'),'variable','customVariable',_0x7fea('0x3'),_0x7fea('0x4')),'defaultValue':_0x7fea('0x2')},'content':{'type':Sequelize[_0x7fea('0x5')]},'key':{'type':Sequelize[_0x7fea('0x5')]},'keyType':{'type':Sequelize[_0x7fea('0x6')]('string',_0x7fea('0x7'),_0x7fea('0x8'))},'keyContent':{'type':Sequelize[_0x7fea('0x5')]},'idField':{'type':Sequelize[_0x7fea('0x5')]},'nameField':{'type':Sequelize[_0x7fea('0x5')]},'customField':{'type':Sequelize[_0x7fea('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 081229b..6478c50 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 _0x6eeb=['model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','ZohoField','fieldName','type','key'];(function(_0x201740,_0x3de1f0){var _0x5b62a1=function(_0x532b0f){while(--_0x532b0f){_0x201740['push'](_0x201740['shift']());}};_0x5b62a1(++_0x3de1f0);}(_0x6eeb,0x1f1));var _0xb6ee=function(_0x42f41b,_0x67e11f){_0x42f41b=_0x42f41b-0x0;var _0x4a4e89=_0x6eeb[_0x42f41b];return _0x4a4e89;};'use strict';var emlformat=require(_0xb6ee('0x0'));var rimraf=require(_0xb6ee('0x1'));var zipdir=require(_0xb6ee('0x2'));var jsonpatch=require(_0xb6ee('0x3'));var rp=require(_0xb6ee('0x4'));var moment=require('moment');var BPromise=require(_0xb6ee('0x5'));var Mustache=require('mustache');var util=require(_0xb6ee('0x6'));var path=require('path');var sox=require(_0xb6ee('0x7'));var csv=require(_0xb6ee('0x8'));var ejs=require(_0xb6ee('0x9'));var fs=require('fs');var fs_extra=require(_0xb6ee('0xa'));var _=require(_0xb6ee('0xb'));var squel=require(_0xb6ee('0xc'));var crypto=require(_0xb6ee('0xd'));var jsforce=require(_0xb6ee('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb6ee('0xf'));var Redis=require(_0xb6ee('0x10'));var authService=require(_0xb6ee('0x11'));var qs=require(_0xb6ee('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6ee('0x13'))(_0xb6ee('0x14'));var utils=require(_0xb6ee('0x15'));var config=require(_0xb6ee('0x16'));var licenseUtil=require(_0xb6ee('0x17'));var db=require(_0xb6ee('0x18'))['db'];function respondWithStatusCode(_0x7b0575,_0x5ecfe1){_0x5ecfe1=_0x5ecfe1||0xcc;return function(_0x50d325){if(_0x50d325){return _0x7b0575['sendStatus'](_0x5ecfe1);}return _0x7b0575[_0xb6ee('0x19')](_0x5ecfe1)['end']();};}function respondWithResult(_0x19e2e2,_0x5a96a8){_0x5a96a8=_0x5a96a8||0xc8;return function(_0x20a365){if(_0x20a365){return _0x19e2e2[_0xb6ee('0x19')](_0x5a96a8)[_0xb6ee('0x1a')](_0x20a365);}};}function respondWithFilteredResult(_0xcc73fb,_0x33d220){return function(_0x5e22ba){if(_0x5e22ba){var _0x23a85c=typeof _0x33d220[_0xb6ee('0x1b')]===_0xb6ee('0x1c')&&typeof _0x33d220[_0xb6ee('0x1d')]===_0xb6ee('0x1c');var _0x5a0989=_0x5e22ba[_0xb6ee('0x1e')];var _0x73bad7=_0x23a85c?0x0:_0x33d220[_0xb6ee('0x1b')];var _0x3555f6=_0x23a85c?_0x5e22ba[_0xb6ee('0x1e')]:_0x33d220[_0xb6ee('0x1b')]+_0x33d220['limit'];var _0x4aaf84;if(_0x3555f6>=_0x5a0989){_0x3555f6=_0x5a0989;_0x4aaf84=0xc8;}else{_0x4aaf84=0xce;}_0xcc73fb[_0xb6ee('0x19')](_0x4aaf84);return _0xcc73fb[_0xb6ee('0x1f')](_0xb6ee('0x20'),_0x73bad7+'-'+_0x3555f6+'/'+_0x5a0989)[_0xb6ee('0x1a')](_0x5e22ba);}return null;};}function patchUpdates(_0x59f2a1){return function(_0x236ae6){try{jsonpatch[_0xb6ee('0x21')](_0x236ae6,_0x59f2a1,!![]);}catch(_0x68f521){return BPromise[_0xb6ee('0x22')](_0x68f521);}return _0x236ae6[_0xb6ee('0x23')]();};}function saveUpdates(_0x120cb1,_0x20d70f){return function(_0x429c2){if(_0x429c2){return _0x429c2[_0xb6ee('0x24')](_0x120cb1)[_0xb6ee('0x25')](function(_0x18a659){return _0x18a659;});}return null;};}function removeEntity(_0x4bc01a,_0x3b3f45){return function(_0x313969){if(_0x313969){return _0x313969[_0xb6ee('0x26')]()['then'](function(){_0x4bc01a[_0xb6ee('0x19')](0xcc)[_0xb6ee('0x27')]();});}};}function handleEntityNotFound(_0x1ceadf,_0x56e4bf){return function(_0xa8c336){if(!_0xa8c336){_0x1ceadf[_0xb6ee('0x28')](0x194);}return _0xa8c336;};}function handleError(_0x5d3d90,_0xb4c3e0){_0xb4c3e0=_0xb4c3e0||0x1f4;return function(_0x197eeb){logger[_0xb6ee('0x29')](_0x197eeb[_0xb6ee('0x2a')]);if(_0x197eeb[_0xb6ee('0x2b')]){delete _0x197eeb[_0xb6ee('0x2b')];}_0x5d3d90[_0xb6ee('0x19')](_0xb4c3e0)[_0xb6ee('0x2c')](_0x197eeb);};}exports['index']=function(_0x37fe7b,_0x3472af){var _0x3fb31a={},_0x56dc96={},_0x3bbb4b={'count':0x0,'rows':[]};var _0x39966b=_['map'](db[_0xb6ee('0x2d')]['rawAttributes'],function(_0x93137){return{'name':_0x93137[_0xb6ee('0x2e')],'type':_0x93137[_0xb6ee('0x2f')][_0xb6ee('0x30')]};});_0x56dc96[_0xb6ee('0x31')]=_[_0xb6ee('0x32')](_0x39966b,_0xb6ee('0x2b'));_0x56dc96[_0xb6ee('0x33')]=_['keys'](_0x37fe7b[_0xb6ee('0x33')]);_0x56dc96[_0xb6ee('0x34')]=_[_0xb6ee('0x35')](_0x56dc96[_0xb6ee('0x31')],_0x56dc96['query']);_0x3fb31a['attributes']=_['intersection'](_0x56dc96[_0xb6ee('0x31')],qs[_0xb6ee('0x36')](_0x37fe7b[_0xb6ee('0x33')]['fields']));_0x3fb31a['attributes']=_0x3fb31a[_0xb6ee('0x37')][_0xb6ee('0x38')]?_0x3fb31a[_0xb6ee('0x37')]:_0x56dc96['model'];if(!_0x37fe7b[_0xb6ee('0x33')][_0xb6ee('0x39')](_0xb6ee('0x3a'))){_0x3fb31a['limit']=qs[_0xb6ee('0x1d')](_0x37fe7b['query'][_0xb6ee('0x1d')]);_0x3fb31a[_0xb6ee('0x1b')]=qs[_0xb6ee('0x1b')](_0x37fe7b[_0xb6ee('0x33')][_0xb6ee('0x1b')]);}_0x3fb31a['order']=qs[_0xb6ee('0x3b')](_0x37fe7b[_0xb6ee('0x33')][_0xb6ee('0x3b')]);_0x3fb31a[_0xb6ee('0x3c')]=qs[_0xb6ee('0x34')](_[_0xb6ee('0x3d')](_0x37fe7b[_0xb6ee('0x33')],_0x56dc96[_0xb6ee('0x34')]),_0x39966b);if(_0x37fe7b[_0xb6ee('0x33')]['filter']){_0x3fb31a[_0xb6ee('0x3c')]=_[_0xb6ee('0x3e')](_0x3fb31a['where'],{'$or':_[_0xb6ee('0x32')](_0x39966b,function(_0x367a1e){if(_0x367a1e[_0xb6ee('0x2f')]!==_0xb6ee('0x3f')){var _0xb1f2fe={};_0xb1f2fe[_0x367a1e['name']]={'$like':'%'+_0x37fe7b[_0xb6ee('0x33')][_0xb6ee('0x40')]+'%'};return _0xb1f2fe;}})});}_0x3fb31a=_[_0xb6ee('0x3e')]({},_0x3fb31a,_0x37fe7b[_0xb6ee('0x41')]);var _0x923eeb={'where':_0x3fb31a['where']};return db['ZohoField']['count'](_0x923eeb)['then'](function(_0x3dbdfa){_0x3bbb4b[_0xb6ee('0x1e')]=_0x3dbdfa;if(_0x37fe7b['query'][_0xb6ee('0x42')]){_0x3fb31a[_0xb6ee('0x43')]=[{'all':!![]}];}return db['ZohoField'][_0xb6ee('0x44')](_0x3fb31a);})[_0xb6ee('0x25')](function(_0x1ccc18){_0x3bbb4b[_0xb6ee('0x45')]=_0x1ccc18;return _0x3bbb4b;})['then'](respondWithFilteredResult(_0x3472af,_0x3fb31a))[_0xb6ee('0x46')](handleError(_0x3472af,null));};exports[_0xb6ee('0x47')]=function(_0x391273,_0x491a0b){var _0x4f86ad={'raw':!![],'where':{'id':_0x391273[_0xb6ee('0x48')]['id']}},_0x4821a4={};_0x4821a4[_0xb6ee('0x31')]=_[_0xb6ee('0x49')](db['ZohoField'][_0xb6ee('0x4a')]);_0x4821a4[_0xb6ee('0x33')]=_['keys'](_0x391273[_0xb6ee('0x33')]);_0x4821a4[_0xb6ee('0x34')]=_[_0xb6ee('0x35')](_0x4821a4['model'],_0x4821a4['query']);_0x4f86ad[_0xb6ee('0x37')]=_[_0xb6ee('0x35')](_0x4821a4[_0xb6ee('0x31')],qs[_0xb6ee('0x36')](_0x391273['query'][_0xb6ee('0x36')]));_0x4f86ad['attributes']=_0x4f86ad['attributes'][_0xb6ee('0x38')]?_0x4f86ad[_0xb6ee('0x37')]:_0x4821a4[_0xb6ee('0x31')];if(_0x391273[_0xb6ee('0x33')][_0xb6ee('0x42')]){_0x4f86ad[_0xb6ee('0x43')]=[{'all':!![]}];}_0x4f86ad=_['merge']({},_0x4f86ad,_0x391273[_0xb6ee('0x41')]);return db[_0xb6ee('0x2d')][_0xb6ee('0x4b')](_0x4f86ad)[_0xb6ee('0x25')](handleEntityNotFound(_0x491a0b,null))[_0xb6ee('0x25')](respondWithResult(_0x491a0b,null))[_0xb6ee('0x46')](handleError(_0x491a0b,null));};exports[_0xb6ee('0x4c')]=function(_0x67652e,_0x1ee4cb){return db['ZohoField'][_0xb6ee('0x4c')](_0x67652e[_0xb6ee('0x4d')],{})[_0xb6ee('0x25')](respondWithResult(_0x1ee4cb,0xc9))[_0xb6ee('0x46')](handleError(_0x1ee4cb,null));};exports[_0xb6ee('0x24')]=function(_0x35216e,_0x219e12){if(_0x35216e[_0xb6ee('0x4d')]['id']){delete _0x35216e['body']['id'];}return db[_0xb6ee('0x2d')][_0xb6ee('0x4b')]({'where':{'id':_0x35216e[_0xb6ee('0x48')]['id']}})[_0xb6ee('0x25')](handleEntityNotFound(_0x219e12,null))['then'](saveUpdates(_0x35216e[_0xb6ee('0x4d')],null))[_0xb6ee('0x25')](respondWithResult(_0x219e12,null))[_0xb6ee('0x46')](handleError(_0x219e12,null));};exports['destroy']=function(_0x4edf82,_0x50c38a){return db[_0xb6ee('0x2d')][_0xb6ee('0x4b')]({'where':{'id':_0x4edf82['params']['id']}})[_0xb6ee('0x25')](handleEntityNotFound(_0x50c38a,null))[_0xb6ee('0x25')](removeEntity(_0x50c38a,null))[_0xb6ee('0x46')](handleError(_0x50c38a,null));}; \ No newline at end of file +var _0x420d=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','find','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','map','ZohoField'];(function(_0xa4f54b,_0x219d67){var _0x29f24c=function(_0x1b7ca7){while(--_0x1b7ca7){_0xa4f54b['push'](_0xa4f54b['shift']());}};_0x29f24c(++_0x219d67);}(_0x420d,0x19e));var _0xd420=function(_0x40942c,_0x3ab94d){_0x40942c=_0x40942c-0x0;var _0x261213=_0x420d[_0x40942c];return _0x261213;};'use strict';var emlformat=require(_0xd420('0x0'));var rimraf=require(_0xd420('0x1'));var zipdir=require(_0xd420('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd420('0x3'));var moment=require(_0xd420('0x4'));var BPromise=require(_0xd420('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd420('0x6'));var sox=require(_0xd420('0x7'));var csv=require(_0xd420('0x8'));var ejs=require(_0xd420('0x9'));var fs=require('fs');var fs_extra=require(_0xd420('0xa'));var _=require(_0xd420('0xb'));var squel=require(_0xd420('0xc'));var crypto=require(_0xd420('0xd'));var jsforce=require(_0xd420('0xe'));var deskjs=require(_0xd420('0xf'));var toCsv=require(_0xd420('0x8'));var querystring=require(_0xd420('0x10'));var Papa=require(_0xd420('0x11'));var Redis=require('ioredis');var authService=require(_0xd420('0x12'));var qs=require(_0xd420('0x13'));var as=require(_0xd420('0x14'));var hardwareService=require(_0xd420('0x15'));var logger=require(_0xd420('0x16'))(_0xd420('0x17'));var utils=require(_0xd420('0x18'));var config=require(_0xd420('0x19'));var licenseUtil=require(_0xd420('0x1a'));var db=require(_0xd420('0x1b'))['db'];function respondWithStatusCode(_0x4fb961,_0x31b94a){_0x31b94a=_0x31b94a||0xcc;return function(_0x196c8a){if(_0x196c8a){return _0x4fb961[_0xd420('0x1c')](_0x31b94a);}return _0x4fb961['status'](_0x31b94a)[_0xd420('0x1d')]();};}function respondWithResult(_0x35fb0e,_0x6d69ef){_0x6d69ef=_0x6d69ef||0xc8;return function(_0x1281fe){if(_0x1281fe){return _0x35fb0e[_0xd420('0x1e')](_0x6d69ef)[_0xd420('0x1f')](_0x1281fe);}};}function respondWithFilteredResult(_0x4e4c7b,_0x5da181){return function(_0x1ab7ec){if(_0x1ab7ec){var _0x1d1205=typeof _0x5da181[_0xd420('0x20')]===_0xd420('0x21')&&typeof _0x5da181[_0xd420('0x22')]===_0xd420('0x21');var _0x3370a9=_0x1ab7ec[_0xd420('0x23')];var _0x1a2a2e=_0x1d1205?0x0:_0x5da181[_0xd420('0x20')];var _0x17ec0e=_0x1d1205?_0x1ab7ec[_0xd420('0x23')]:_0x5da181[_0xd420('0x20')]+_0x5da181['limit'];var _0x3a0fd9;if(_0x17ec0e>=_0x3370a9){_0x17ec0e=_0x3370a9;_0x3a0fd9=0xc8;}else{_0x3a0fd9=0xce;}_0x4e4c7b['status'](_0x3a0fd9);return _0x4e4c7b[_0xd420('0x24')]('Content-Range',_0x1a2a2e+'-'+_0x17ec0e+'/'+_0x3370a9)['json'](_0x1ab7ec);}return null;};}function patchUpdates(_0x293ec6){return function(_0x37a855){try{jsonpatch[_0xd420('0x25')](_0x37a855,_0x293ec6,!![]);}catch(_0x3b3f7d){return BPromise[_0xd420('0x26')](_0x3b3f7d);}return _0x37a855[_0xd420('0x27')]();};}function saveUpdates(_0xdb02e9,_0x1950a1){return function(_0x54c400){if(_0x54c400){return _0x54c400[_0xd420('0x28')](_0xdb02e9)[_0xd420('0x29')](function(_0x491e1d){return _0x491e1d;});}return null;};}function removeEntity(_0x3a24bd,_0x2e3a15){return function(_0x313395){if(_0x313395){return _0x313395['destroy']()[_0xd420('0x29')](function(){_0x3a24bd[_0xd420('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x226261,_0x56de68){return function(_0x586c7e){if(!_0x586c7e){_0x226261[_0xd420('0x1c')](0x194);}return _0x586c7e;};}function handleError(_0x2d0fb2,_0x4321f7){_0x4321f7=_0x4321f7||0x1f4;return function(_0x31f40f){logger[_0xd420('0x2a')](_0x31f40f[_0xd420('0x2b')]);if(_0x31f40f[_0xd420('0x2c')]){delete _0x31f40f['name'];}_0x2d0fb2['status'](_0x4321f7)[_0xd420('0x2d')](_0x31f40f);};}exports['index']=function(_0x5002b,_0x560a98){var _0x528e0c={},_0x5a5b5b={},_0x423c0d={'count':0x0,'rows':[]};var _0x2ee529=_[_0xd420('0x2e')](db[_0xd420('0x2f')][_0xd420('0x30')],function(_0x47a81f){return{'name':_0x47a81f[_0xd420('0x31')],'type':_0x47a81f[_0xd420('0x32')]['key']};});_0x5a5b5b[_0xd420('0x33')]=_[_0xd420('0x2e')](_0x2ee529,_0xd420('0x2c'));_0x5a5b5b[_0xd420('0x34')]=_[_0xd420('0x35')](_0x5002b[_0xd420('0x34')]);_0x5a5b5b[_0xd420('0x36')]=_[_0xd420('0x37')](_0x5a5b5b['model'],_0x5a5b5b[_0xd420('0x34')]);_0x528e0c['attributes']=_['intersection'](_0x5a5b5b['model'],qs[_0xd420('0x38')](_0x5002b[_0xd420('0x34')][_0xd420('0x38')]));_0x528e0c[_0xd420('0x39')]=_0x528e0c[_0xd420('0x39')][_0xd420('0x3a')]?_0x528e0c['attributes']:_0x5a5b5b['model'];if(!_0x5002b[_0xd420('0x34')][_0xd420('0x3b')](_0xd420('0x3c'))){_0x528e0c[_0xd420('0x22')]=qs[_0xd420('0x22')](_0x5002b[_0xd420('0x34')][_0xd420('0x22')]);_0x528e0c[_0xd420('0x20')]=qs['offset'](_0x5002b[_0xd420('0x34')]['offset']);}_0x528e0c[_0xd420('0x3d')]=qs['sort'](_0x5002b[_0xd420('0x34')][_0xd420('0x3e')]);_0x528e0c[_0xd420('0x3f')]=qs[_0xd420('0x36')](_[_0xd420('0x40')](_0x5002b['query'],_0x5a5b5b[_0xd420('0x36')]),_0x2ee529);if(_0x5002b[_0xd420('0x34')][_0xd420('0x41')]){_0x528e0c[_0xd420('0x3f')]=_[_0xd420('0x42')](_0x528e0c['where'],{'$or':_[_0xd420('0x2e')](_0x2ee529,function(_0x1ec03a){if(_0x1ec03a['type']!=='VIRTUAL'){var _0x59e0dd={};_0x59e0dd[_0x1ec03a[_0xd420('0x2c')]]={'$like':'%'+_0x5002b['query']['filter']+'%'};return _0x59e0dd;}})});}_0x528e0c=_[_0xd420('0x42')]({},_0x528e0c,_0x5002b[_0xd420('0x43')]);var _0x43b077={'where':_0x528e0c[_0xd420('0x3f')]};return db[_0xd420('0x2f')][_0xd420('0x23')](_0x43b077)[_0xd420('0x29')](function(_0x2e2fd5){_0x423c0d['count']=_0x2e2fd5;if(_0x5002b[_0xd420('0x34')][_0xd420('0x44')]){_0x528e0c[_0xd420('0x45')]=[{'all':!![]}];}return db['ZohoField'][_0xd420('0x46')](_0x528e0c);})[_0xd420('0x29')](function(_0x2f439d){_0x423c0d['rows']=_0x2f439d;return _0x423c0d;})[_0xd420('0x29')](respondWithFilteredResult(_0x560a98,_0x528e0c))[_0xd420('0x47')](handleError(_0x560a98,null));};exports['show']=function(_0x19399a,_0x287b77){var _0xba0ee={'raw':!![],'where':{'id':_0x19399a['params']['id']}},_0x5567af={};_0x5567af[_0xd420('0x33')]=_[_0xd420('0x35')](db[_0xd420('0x2f')][_0xd420('0x30')]);_0x5567af[_0xd420('0x34')]=_[_0xd420('0x35')](_0x19399a[_0xd420('0x34')]);_0x5567af[_0xd420('0x36')]=_[_0xd420('0x37')](_0x5567af[_0xd420('0x33')],_0x5567af[_0xd420('0x34')]);_0xba0ee[_0xd420('0x39')]=_[_0xd420('0x37')](_0x5567af['model'],qs[_0xd420('0x38')](_0x19399a[_0xd420('0x34')][_0xd420('0x38')]));_0xba0ee[_0xd420('0x39')]=_0xba0ee[_0xd420('0x39')][_0xd420('0x3a')]?_0xba0ee['attributes']:_0x5567af['model'];if(_0x19399a[_0xd420('0x34')][_0xd420('0x44')]){_0xba0ee[_0xd420('0x45')]=[{'all':!![]}];}_0xba0ee=_['merge']({},_0xba0ee,_0x19399a['options']);return db[_0xd420('0x2f')][_0xd420('0x48')](_0xba0ee)[_0xd420('0x29')](handleEntityNotFound(_0x287b77,null))[_0xd420('0x29')](respondWithResult(_0x287b77,null))[_0xd420('0x47')](handleError(_0x287b77,null));};exports[_0xd420('0x49')]=function(_0x1aa853,_0x2266c3){return db[_0xd420('0x2f')][_0xd420('0x49')](_0x1aa853[_0xd420('0x4a')],{})[_0xd420('0x29')](respondWithResult(_0x2266c3,0xc9))['catch'](handleError(_0x2266c3,null));};exports[_0xd420('0x28')]=function(_0x3dcb93,_0xb185d1){if(_0x3dcb93[_0xd420('0x4a')]['id']){delete _0x3dcb93[_0xd420('0x4a')]['id'];}return db[_0xd420('0x2f')]['find']({'where':{'id':_0x3dcb93[_0xd420('0x4b')]['id']}})[_0xd420('0x29')](handleEntityNotFound(_0xb185d1,null))['then'](saveUpdates(_0x3dcb93['body'],null))[_0xd420('0x29')](respondWithResult(_0xb185d1,null))[_0xd420('0x47')](handleError(_0xb185d1,null));};exports[_0xd420('0x4c')]=function(_0x1b44f6,_0x312677){return db[_0xd420('0x2f')][_0xd420('0x48')]({'where':{'id':_0x1b44f6['params']['id']}})[_0xd420('0x29')](handleEntityNotFound(_0x312677,null))[_0xd420('0x29')](removeEntity(_0x312677,null))[_0xd420('0x47')](handleError(_0x312677,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index a4b5f07..05246ac 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 _0x8952=['exports','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x52ce6b,_0x1272bc){var _0x220bb1=function(_0x279a4d){while(--_0x279a4d){_0x52ce6b['push'](_0x52ce6b['shift']());}};_0x220bb1(++_0x1272bc);}(_0x8952,0x17e));var _0x2895=function(_0x23792b,_0x1000d4){_0x23792b=_0x23792b-0x0;var _0x4a10be=_0x8952[_0x23792b];return _0x4a10be;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./intZohoField.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('ZohoField',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[{'name':_0x2895('0xa'),'fields':[_0x2895('0xb'),_0x2895('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4745=['../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e8194,_0x119f3d){var _0x1493e1=function(_0x489b51){while(--_0x489b51){_0x1e8194['push'](_0x1e8194['shift']());}};_0x1493e1(++_0x119f3d);}(_0x4745,0x1e7));var _0x5474=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x4745[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));module[_0x5474('0xb')]=function(_0x4e7ce7,_0x3d1e1){return _0x4e7ce7[_0x5474('0xc')]('ZohoField',attributes,{'tableName':_0x5474('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x5474('0xe'),_0x5474('0xf')],'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 0bcec78..5ffe1ee 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 _0x70a1=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x70a1,0x162));var _0x170a=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x70a1[_0x1fa759];return _0x2da9f4;};'use strict';var _=require(_0x170a('0x0'));var util=require(_0x170a('0x1'));var moment=require(_0x170a('0x2'));var BPromise=require(_0x170a('0x3'));var rs=require(_0x170a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x170a('0x5'))['db'];var utils=require(_0x170a('0x6'));var logger=require(_0x170a('0x7'))(_0x170a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x170a('0x9')][_0x170a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ab87,_0x4e8f01,_0x26f9f6){return new BPromise(function(_0x539714,_0x34a13b){return client[_0x170a('0xb')](_0x23ab87,_0x26f9f6)['then'](function(_0x1ff5c9){logger['info'](_0x170a('0xc'),_0x4e8f01,'request\x20sent');logger[_0x170a('0xd')](_0x170a('0xe'),_0x4e8f01,'request\x20sent',JSON[_0x170a('0xf')](_0x1ff5c9));if(_0x1ff5c9['error']){if(_0x1ff5c9[_0x170a('0x10')][_0x170a('0x11')]===0x1f4){logger[_0x170a('0x10')](_0x170a('0xc'),_0x4e8f01,_0x1ff5c9[_0x170a('0x10')]['message']);return _0x34a13b(_0x1ff5c9[_0x170a('0x10')]['message']);}logger[_0x170a('0x10')](_0x170a('0xc'),_0x4e8f01,_0x1ff5c9[_0x170a('0x10')]['message']);return _0x539714(_0x1ff5c9['error'][_0x170a('0x12')]);}else{logger[_0x170a('0x13')](_0x170a('0xc'),_0x4e8f01,_0x170a('0x14'));_0x539714(_0x1ff5c9['result'][_0x170a('0x12')]);}})[_0x170a('0x15')](function(_0x51e81a){logger['error'](_0x170a('0xc'),_0x4e8f01,_0x51e81a);_0x34a13b(_0x51e81a);});});} \ No newline at end of file +var _0x800a=['request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1fb850,_0x502946){var _0x552ce6=function(_0x18f643){while(--_0x18f643){_0x1fb850['push'](_0x1fb850['shift']());}};_0x552ce6(++_0x502946);}(_0x800a,0x7b));var _0xa800=function(_0x17fcef,_0x41d145){_0x17fcef=_0x17fcef-0x0;var _0x198dc3=_0x800a[_0x17fcef];return _0x198dc3;};'use strict';var _=require(_0xa800('0x0'));var util=require('util');var moment=require(_0xa800('0x1'));var BPromise=require(_0xa800('0x2'));var rs=require(_0xa800('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa800('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa800('0x5'))(_0xa800('0x6'));var config=require(_0xa800('0x7'));var jayson=require(_0xa800('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36c477,_0x3005c5,_0x5a4f75){return new BPromise(function(_0x336d4b,_0x2ba2d8){return client[_0xa800('0x9')](_0x36c477,_0x5a4f75)[_0xa800('0xa')](function(_0x2faa92){logger[_0xa800('0xb')]('ZohoField,\x20%s,\x20%s',_0x3005c5,_0xa800('0xc'));logger[_0xa800('0xd')](_0xa800('0xe'),_0x3005c5,_0xa800('0xc'),JSON[_0xa800('0xf')](_0x2faa92));if(_0x2faa92['error']){if(_0x2faa92[_0xa800('0x10')][_0xa800('0x11')]===0x1f4){logger['error'](_0xa800('0x12'),_0x3005c5,_0x2faa92[_0xa800('0x10')][_0xa800('0x13')]);return _0x2ba2d8(_0x2faa92[_0xa800('0x10')]['message']);}logger[_0xa800('0x10')](_0xa800('0x12'),_0x3005c5,_0x2faa92[_0xa800('0x10')][_0xa800('0x13')]);return _0x336d4b(_0x2faa92['error']['message']);}else{logger['info'](_0xa800('0x12'),_0x3005c5,'request\x20sent');_0x336d4b(_0x2faa92[_0xa800('0x14')]['message']);}})[_0xa800('0x15')](function(_0x3c36c2){logger[_0xa800('0x10')](_0xa800('0x12'),_0x3005c5,_0x3c36c2);_0x2ba2d8(_0x3c36c2);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 570671a..7423873 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(_0x3c079e,_0x12422d){var _0x2dbc87=function(_0x507b00){while(--_0x507b00){_0x3c079e['push'](_0x3c079e['shift']());}};_0x2dbc87(++_0x12422d);}(_0x70e0,0x17b));var _0x070e=function(_0x4d5ad6,_0x25364f){_0x4d5ad6=_0x4d5ad6-0x0;var _0x367f3f=_0x70e0[_0x4d5ad6];return _0x367f3f;};'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(_0x4a7d0e,_0x16d69d){var _0x3df65a=function(_0x3b1f14){while(--_0x3b1f14){_0x4a7d0e['push'](_0x4a7d0e['shift']());}};_0x3df65a(++_0x16d69d);}(_0xedd9,0xfc));var _0x9edd=function(_0x38f280,_0x37303c){_0x38f280=_0x38f280-0x0;var _0x571559=_0xedd9[_0x38f280];return _0x571559;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 22c3b1f..614addd 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 _0x80c7=['state','sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN'];(function(_0x4e6afe,_0x34dc76){var _0x43cf2d=function(_0x1f585f){while(--_0x1f585f){_0x4e6afe['push'](_0x4e6afe['shift']());}};_0x43cf2d(++_0x34dc76);}(_0x80c7,0x8d));var _0x780c=function(_0x36a475,_0x11a2ab){_0x36a475=_0x36a475-0x0;var _0x10075b=_0x80c7[_0x36a475];return _0x10075b;};'use strict';var Sequelize=require(_0x780c('0x0'));module[_0x780c('0x1')]={'name':{'type':Sequelize[_0x780c('0x2')],'allowNull':![],'unique':_0x780c('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x780c('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x780c('0x2')]},'path':{'type':Sequelize[_0x780c('0x2')]},'type':{'type':Sequelize[_0x780c('0x2')]},'size':{'type':Sequelize[_0x780c('0x4')]},'active':{'type':Sequelize[_0x780c('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x780c('0x2')]},'logo':{'type':Sequelize[_0x780c('0x2')]},'state':{'type':Sequelize[_0x780c('0x2')],'unique':_0x780c('0x6')},'description':{'type':Sequelize[_0x780c('0x2')]},'title':{'type':Sequelize[_0x780c('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x780c('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x1120=['STRING','app.js','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0x325c1d,_0xaac33){var _0x41620d=function(_0x44e13c){while(--_0x44e13c){_0x325c1d['push'](_0x325c1d['shift']());}};_0x41620d(++_0xaac33);}(_0x1120,0x140));var _0x0112=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x1120[_0x1e4a8e];return _0x5408f9;};'use strict';var Sequelize=require(_0x0112('0x0'));module[_0x0112('0x1')]={'name':{'type':Sequelize[_0x0112('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x0112('0x3')},'filename':{'type':Sequelize[_0x0112('0x2')]},'path':{'type':Sequelize[_0x0112('0x2')]},'type':{'type':Sequelize[_0x0112('0x2')]},'size':{'type':Sequelize[_0x0112('0x4')]},'active':{'type':Sequelize[_0x0112('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x0112('0x2')]},'logo':{'type':Sequelize[_0x0112('0x2')]},'state':{'type':Sequelize[_0x0112('0x2')],'unique':_0x0112('0x6')},'description':{'type':Sequelize[_0x0112('0x2')]},'title':{'type':Sequelize[_0x0112('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x0112('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 26bcef9..d254c4e 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 _0x5fab=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0x5fab,0x177));var _0xb5fa=function(_0x5a7521,_0x2d1d5e){_0x5a7521=_0x5a7521-0x0;var _0x3d6e6a=_0x5fab[_0x5a7521];return _0x3d6e6a;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['Integration'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['Integration'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));}; \ No newline at end of file +var _0xc2c7=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc2c7,0x134));var _0x7c2c=function(_0xc11adc,_0x5afe25){_0xc11adc=_0xc11adc-0x0;var _0xd6aa49=_0xc2c7[_0xc11adc];return _0xd6aa49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['Integration'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['Integration'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 9073359..adac933 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 _0xa1aa=['exports','define','integrations','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x1e6012,_0x2cb951){var _0x18fdc4=function(_0x21b540){while(--_0x21b540){_0x1e6012['push'](_0x1e6012['shift']());}};_0x18fdc4(++_0x2cb951);}(_0xa1aa,0x1a7));var _0xaa1a=function(_0x1af548,_0x23a19e){_0x1af548=_0x1af548-0x0;var _0x2a2649=_0xa1aa[_0x1af548];return _0x2a2649;};'use strict';var _=require(_0xaa1a('0x0'));var util=require(_0xaa1a('0x1'));var logger=require('../../config/logger')(_0xaa1a('0x2'));var moment=require(_0xaa1a('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa1a('0x4'));var fs=require('fs');var path=require(_0xaa1a('0x5'));var rimraf=require(_0xaa1a('0x6'));var config=require(_0xaa1a('0x7'));var attributes=require(_0xaa1a('0x8'));module[_0xaa1a('0x9')]=function(_0x43aeb3,_0x45caf3){return _0x43aeb3[_0xaa1a('0xa')]('Integration',attributes,{'tableName':_0xaa1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15d7=['path','../../config/environment','./integration.attributes','define','integrations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x347d63,_0x2d778a){var _0x57c27d=function(_0x444e81){while(--_0x444e81){_0x347d63['push'](_0x347d63['shift']());}};_0x57c27d(++_0x2d778a);}(_0x15d7,0x94));var _0x715d=function(_0x5a1e01,_0x372036){_0x5a1e01=_0x5a1e01-0x0;var _0x3aa606=_0x15d7[_0x5a1e01];return _0x3aa606;};'use strict';var _=require(_0x715d('0x0'));var util=require(_0x715d('0x1'));var logger=require('../../config/logger')(_0x715d('0x2'));var moment=require(_0x715d('0x3'));var BPromise=require(_0x715d('0x4'));var rp=require(_0x715d('0x5'));var fs=require('fs');var path=require(_0x715d('0x6'));var rimraf=require('rimraf');var config=require(_0x715d('0x7'));var attributes=require(_0x715d('0x8'));module['exports']=function(_0x31dda2,_0x3017d1){return _0x31dda2[_0x715d('0x9')]('Integration',attributes,{'tableName':_0x715d('0xa'),'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 7d40864..f70b6a9 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 _0x6d38=['request','then','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x263b14,_0x2391ad){var _0x434143=function(_0x231681){while(--_0x231681){_0x263b14['push'](_0x263b14['shift']());}};_0x434143(++_0x2391ad);}(_0x6d38,0x1ef));var _0x86d3=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x6d38[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file +var _0x0b0e=['Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','debug'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x0b0e[_0x5e4563];return _0x8d1bf5;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Integration,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 9dc7365..6b834ac 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 _0xe2fe=['describe','/:id','post','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_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('./integrationReport.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('0xc')]('/',auth[_0xee2f('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xe')]);module[_0xee2f('0xf')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x4f656e,_0x2d602c){var _0x2bc30c=function(_0x278de9){while(--_0x278de9){_0x4f656e['push'](_0x4f656e['shift']());}};_0x2bc30c(++_0x2d602c);}(_0x7a54,0x106));var _0x47a5=function(_0x34e268,_0x2b1265){_0x34e268=_0x34e268-0x0;var _0x5c2908=_0x7a54[_0x34e268];return _0x5c2908;};'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['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 08431d2..88388ed 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 _0xdebf=['SENT','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM'];(function(_0x48a0e9,_0x22b8ab){var _0x563cd2=function(_0x5bf97a){while(--_0x5bf97a){_0x48a0e9['push'](_0x48a0e9['shift']());}};_0x563cd2(++_0x22b8ab);}(_0xdebf,0x172));var _0xfdeb=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xdebf[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0xfdeb('0x0'));module[_0xfdeb('0x1')]={'integration':{'type':Sequelize[_0xfdeb('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xfdeb('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xfdeb('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfdeb('0x2')]},'interface':{'type':Sequelize[_0xfdeb('0x2')]},'membername':{'type':Sequelize[_0xfdeb('0x2')]},'agentcalledAt':{'type':Sequelize[_0xfdeb('0x3')]},'agentconnectAt':{'type':Sequelize[_0xfdeb('0x3')]},'holdtime':{'type':Sequelize[_0xfdeb('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xfdeb('0x3')]},'talktime':{'type':Sequelize[_0xfdeb('0x4')]},'agentacw':{'type':Sequelize[_0xfdeb('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xfdeb('0x4')]},'reason':{'type':Sequelize[_0xfdeb('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xfdeb('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xfdeb('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xfdeb('0x3')]},'lastevent':{'type':Sequelize[_0xfdeb('0x2')]},'channel':{'type':Sequelize[_0xfdeb('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xfdeb('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfdeb('0x2')]},'connectedlinename':{'type':Sequelize[_0xfdeb('0x2')]},'language':{'type':Sequelize[_0xfdeb('0x2')]},'accountcode':{'type':Sequelize[_0xfdeb('0x2')]},'context':{'type':Sequelize[_0xfdeb('0x2')]},'exten':{'type':Sequelize[_0xfdeb('0x2')]},'priority':{'type':Sequelize[_0xfdeb('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xfdeb('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xfdeb('0x2')]},'destcalleridnum':{'type':Sequelize[_0xfdeb('0x2')]},'destcalleridname':{'type':Sequelize[_0xfdeb('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xfdeb('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xfdeb('0x2')]},'destaccountcode':{'type':Sequelize[_0xfdeb('0x2')]},'destcontext':{'type':Sequelize[_0xfdeb('0x2')]},'destexten':{'type':Sequelize[_0xfdeb('0x2')]},'destpriority':{'type':Sequelize[_0xfdeb('0x2')]},'destuniqueid':{'type':Sequelize[_0xfdeb('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xfdeb('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xfdeb('0x2')]},'to':{'type':Sequelize[_0xfdeb('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xfdeb('0x6')]},'html':{'type':Sequelize[_0xfdeb('0x6')]},'text':{'type':Sequelize[_0xfdeb('0x6')]},'status':{'type':Sequelize[_0xfdeb('0x7')](_0xfdeb('0x8'),'SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize[_0xfdeb('0x2')]},'app':{'type':Sequelize[_0xfdeb('0x2')]},'appdata':{'type':Sequelize[_0xfdeb('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe543=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe543,0x76));var _0x3e54=function(_0x267c40,_0x3964ed){_0x267c40=_0x267c40-0x0;var _0x2f48f9=_0xe543[_0x267c40];return _0x2f48f9;};'use strict';var Sequelize=require(_0x3e54('0x0'));module[_0x3e54('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x3e54('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x3e54('0x3')]},'contacts':{'type':Sequelize[_0x3e54('0x2')]},'uniqueid':{'type':Sequelize[_0x3e54('0x2')]},'calleridnum':{'type':Sequelize[_0x3e54('0x2')]},'calleridname':{'type':Sequelize[_0x3e54('0x2')]},'queue':{'type':Sequelize[_0x3e54('0x2')]},'interface':{'type':Sequelize[_0x3e54('0x2')]},'membername':{'type':Sequelize[_0x3e54('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x3e54('0x4')]},'holdtime':{'type':Sequelize[_0x3e54('0x3')]},'agentcomplete':{'type':Sequelize[_0x3e54('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3e54('0x4')]},'talktime':{'type':Sequelize[_0x3e54('0x3')]},'agentacw':{'type':Sequelize[_0x3e54('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3e54('0x3')]},'reason':{'type':Sequelize[_0x3e54('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x3e54('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x3e54('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3e54('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3e54('0x2')]},'channelstate':{'type':Sequelize[_0x3e54('0x3')]},'channelstatedesc':{'type':Sequelize[_0x3e54('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3e54('0x2')]},'connectedlinename':{'type':Sequelize[_0x3e54('0x2')]},'language':{'type':Sequelize[_0x3e54('0x2')]},'accountcode':{'type':Sequelize[_0x3e54('0x2')]},'context':{'type':Sequelize[_0x3e54('0x2')]},'exten':{'type':Sequelize[_0x3e54('0x2')]},'priority':{'type':Sequelize[_0x3e54('0x2')]},'destchannel':{'type':Sequelize[_0x3e54('0x2')]},'destchannelstate':{'type':Sequelize[_0x3e54('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x3e54('0x2')]},'destcalleridnum':{'type':Sequelize[_0x3e54('0x2')]},'destcalleridname':{'type':Sequelize[_0x3e54('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x3e54('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x3e54('0x2')]},'destcontext':{'type':Sequelize[_0x3e54('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e54('0x2')]},'destuniqueid':{'type':Sequelize[_0x3e54('0x2')]},'messageId':{'type':Sequelize[_0x3e54('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x3e54('0x2')]},'to':{'type':Sequelize[_0x3e54('0x2')]},'cc':{'type':Sequelize[_0x3e54('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x3e54('0x6')]},'text':{'type':Sequelize[_0x3e54('0x6')]},'status':{'type':Sequelize[_0x3e54('0x7')](_0x3e54('0x8'),_0x3e54('0x9'),_0x3e54('0xa'),_0x3e54('0xb'))},'url':{'type':Sequelize[_0x3e54('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x3e54('0x2')]},'projectId':{'type':Sequelize[_0x3e54('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 2b94f96..42f4950 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 _0x7ec5=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','catch','show','params','create','body','update','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','key','model','query'];(function(_0x1085a7,_0x4dbdb0){var _0x5052ad=function(_0x5df828){while(--_0x5df828){_0x1085a7['push'](_0x1085a7['shift']());}};_0x5052ad(++_0x4dbdb0);}(_0x7ec5,0xfb));var _0x57ec=function(_0x403e7f,_0x4912f0){_0x403e7f=_0x403e7f-0x0;var _0x18eef0=_0x7ec5[_0x403e7f];return _0x18eef0;};'use strict';var emlformat=require(_0x57ec('0x0'));var rimraf=require(_0x57ec('0x1'));var zipdir=require(_0x57ec('0x2'));var jsonpatch=require(_0x57ec('0x3'));var rp=require(_0x57ec('0x4'));var moment=require(_0x57ec('0x5'));var BPromise=require(_0x57ec('0x6'));var Mustache=require(_0x57ec('0x7'));var util=require(_0x57ec('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x57ec('0x9'));var ejs=require(_0x57ec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57ec('0xb'));var squel=require(_0x57ec('0xc'));var crypto=require(_0x57ec('0xd'));var jsforce=require(_0x57ec('0xe'));var deskjs=require(_0x57ec('0xf'));var toCsv=require('to-csv');var querystring=require(_0x57ec('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x57ec('0x11'));var qs=require(_0x57ec('0x12'));var as=require(_0x57ec('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x57ec('0x14'))(_0x57ec('0x15'));var utils=require(_0x57ec('0x16'));var config=require(_0x57ec('0x17'));var licenseUtil=require(_0x57ec('0x18'));var db=require(_0x57ec('0x19'))['db'];function respondWithStatusCode(_0x625fb0,_0x1f664b){_0x1f664b=_0x1f664b||0xcc;return function(_0x4008aa){if(_0x4008aa){return _0x625fb0[_0x57ec('0x1a')](_0x1f664b);}return _0x625fb0[_0x57ec('0x1b')](_0x1f664b)[_0x57ec('0x1c')]();};}function respondWithResult(_0x359932,_0x276c81){_0x276c81=_0x276c81||0xc8;return function(_0x2deeb2){if(_0x2deeb2){return _0x359932[_0x57ec('0x1b')](_0x276c81)[_0x57ec('0x1d')](_0x2deeb2);}};}function respondWithFilteredResult(_0x1045fb,_0x53c5d9){return function(_0x118b48){if(_0x118b48){var _0x41364a=typeof _0x53c5d9[_0x57ec('0x1e')]==='undefined'&&typeof _0x53c5d9[_0x57ec('0x1f')]===_0x57ec('0x20');var _0x36ef7d=_0x118b48[_0x57ec('0x21')];var _0x471c14=_0x41364a?0x0:_0x53c5d9[_0x57ec('0x1e')];var _0x4a6c1b=_0x41364a?_0x118b48['count']:_0x53c5d9[_0x57ec('0x1e')]+_0x53c5d9['limit'];var _0x3da338;if(_0x4a6c1b>=_0x36ef7d){_0x4a6c1b=_0x36ef7d;_0x3da338=0xc8;}else{_0x3da338=0xce;}_0x1045fb[_0x57ec('0x1b')](_0x3da338);return _0x1045fb[_0x57ec('0x22')](_0x57ec('0x23'),_0x471c14+'-'+_0x4a6c1b+'/'+_0x36ef7d)[_0x57ec('0x1d')](_0x118b48);}return null;};}function patchUpdates(_0xb6e879){return function(_0x4f7542){try{jsonpatch['apply'](_0x4f7542,_0xb6e879,!![]);}catch(_0x29805c){return BPromise['reject'](_0x29805c);}return _0x4f7542[_0x57ec('0x24')]();};}function saveUpdates(_0x58f4dd,_0x73e19e){return function(_0x1b4a9c){if(_0x1b4a9c){return _0x1b4a9c['update'](_0x58f4dd)[_0x57ec('0x25')](function(_0x329c5d){return _0x329c5d;});}return null;};}function removeEntity(_0x5222d3,_0x219f20){return function(_0x43825c){if(_0x43825c){return _0x43825c['destroy']()['then'](function(){_0x5222d3[_0x57ec('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42540b,_0x745e9f){return function(_0x805052){if(!_0x805052){_0x42540b['sendStatus'](0x194);}return _0x805052;};}function handleError(_0x5af4d6,_0x151cea){_0x151cea=_0x151cea||0x1f4;return function(_0x37270a){logger[_0x57ec('0x26')](_0x37270a[_0x57ec('0x27')]);if(_0x37270a[_0x57ec('0x28')]){delete _0x37270a[_0x57ec('0x28')];}_0x5af4d6['status'](_0x151cea)[_0x57ec('0x29')](_0x37270a);};}exports['index']=function(_0xa57643,_0x6bcd66){var _0x3566b4={},_0x2c1c8a={},_0x422f0c={'count':0x0,'rows':[]};var _0x883d7c=_[_0x57ec('0x2a')](db[_0x57ec('0x2b')][_0x57ec('0x2c')],function(_0x4b68fc){return{'name':_0x4b68fc[_0x57ec('0x2d')],'type':_0x4b68fc['type'][_0x57ec('0x2e')]};});_0x2c1c8a[_0x57ec('0x2f')]=_[_0x57ec('0x2a')](_0x883d7c,'name');_0x2c1c8a[_0x57ec('0x30')]=_[_0x57ec('0x31')](_0xa57643['query']);_0x2c1c8a[_0x57ec('0x32')]=_[_0x57ec('0x33')](_0x2c1c8a[_0x57ec('0x2f')],_0x2c1c8a[_0x57ec('0x30')]);_0x3566b4[_0x57ec('0x34')]=_[_0x57ec('0x33')](_0x2c1c8a['model'],qs[_0x57ec('0x35')](_0xa57643[_0x57ec('0x30')][_0x57ec('0x35')]));_0x3566b4[_0x57ec('0x34')]=_0x3566b4['attributes'][_0x57ec('0x36')]?_0x3566b4[_0x57ec('0x34')]:_0x2c1c8a['model'];if(!_0xa57643[_0x57ec('0x30')][_0x57ec('0x37')](_0x57ec('0x38'))){_0x3566b4[_0x57ec('0x1f')]=qs[_0x57ec('0x1f')](_0xa57643[_0x57ec('0x30')][_0x57ec('0x1f')]);_0x3566b4[_0x57ec('0x1e')]=qs['offset'](_0xa57643['query'][_0x57ec('0x1e')]);}_0x3566b4[_0x57ec('0x39')]=qs['sort'](_0xa57643[_0x57ec('0x30')][_0x57ec('0x3a')]);_0x3566b4['where']=qs[_0x57ec('0x32')](_['pick'](_0xa57643[_0x57ec('0x30')],_0x2c1c8a[_0x57ec('0x32')]),_0x883d7c);if(_0xa57643[_0x57ec('0x30')][_0x57ec('0x3b')]){_0x3566b4[_0x57ec('0x3c')]=_[_0x57ec('0x3d')](_0x3566b4['where'],{'$or':_[_0x57ec('0x2a')](_0x883d7c,function(_0x2a5613){if(_0x2a5613['type']!=='VIRTUAL'){var _0x4c60d8={};_0x4c60d8[_0x2a5613[_0x57ec('0x28')]]={'$like':'%'+_0xa57643[_0x57ec('0x30')][_0x57ec('0x3b')]+'%'};return _0x4c60d8;}})});}_0x3566b4=_[_0x57ec('0x3d')]({},_0x3566b4,_0xa57643[_0x57ec('0x3e')]);var _0x283f2e={'where':_0x3566b4[_0x57ec('0x3c')]};return db[_0x57ec('0x2b')][_0x57ec('0x21')](_0x283f2e)[_0x57ec('0x25')](function(_0x3b9a3d){_0x422f0c['count']=_0x3b9a3d;if(_0xa57643['query'][_0x57ec('0x3f')]){_0x3566b4[_0x57ec('0x40')]=[{'all':!![]}];}return db[_0x57ec('0x2b')][_0x57ec('0x41')](_0x3566b4);})[_0x57ec('0x25')](function(_0xc05fef){_0x422f0c['rows']=_0xc05fef;return _0x422f0c;})[_0x57ec('0x25')](respondWithFilteredResult(_0x6bcd66,_0x3566b4))[_0x57ec('0x42')](handleError(_0x6bcd66,null));};exports[_0x57ec('0x43')]=function(_0xb653fc,_0x475cdf){var _0x582f85={'raw':![],'where':{'id':_0xb653fc[_0x57ec('0x44')]['id']}},_0xfdd9c1={};_0xfdd9c1[_0x57ec('0x2f')]=_['keys'](db[_0x57ec('0x2b')][_0x57ec('0x2c')]);_0xfdd9c1[_0x57ec('0x30')]=_[_0x57ec('0x31')](_0xb653fc[_0x57ec('0x30')]);_0xfdd9c1[_0x57ec('0x32')]=_[_0x57ec('0x33')](_0xfdd9c1['model'],_0xfdd9c1['query']);_0x582f85['attributes']=_[_0x57ec('0x33')](_0xfdd9c1[_0x57ec('0x2f')],qs[_0x57ec('0x35')](_0xb653fc[_0x57ec('0x30')][_0x57ec('0x35')]));_0x582f85['attributes']=_0x582f85[_0x57ec('0x34')]['length']?_0x582f85['attributes']:_0xfdd9c1[_0x57ec('0x2f')];if(_0xb653fc['query']['includeAll']){_0x582f85['include']=[{'all':!![]}];}_0x582f85=_[_0x57ec('0x3d')]({},_0x582f85,_0xb653fc[_0x57ec('0x3e')]);return db[_0x57ec('0x2b')]['find'](_0x582f85)[_0x57ec('0x25')](handleEntityNotFound(_0x475cdf,null))[_0x57ec('0x25')](respondWithResult(_0x475cdf,null))[_0x57ec('0x42')](handleError(_0x475cdf,null));};exports['create']=function(_0x1cb4d1,_0x14d18d){return db[_0x57ec('0x2b')][_0x57ec('0x45')](_0x1cb4d1[_0x57ec('0x46')],{})[_0x57ec('0x25')](respondWithResult(_0x14d18d,0xc9))[_0x57ec('0x42')](handleError(_0x14d18d,null));};exports[_0x57ec('0x47')]=function(_0x324c00,_0x48d8d1){if(_0x324c00[_0x57ec('0x46')]['id']){delete _0x324c00[_0x57ec('0x46')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x324c00[_0x57ec('0x44')]['id']}})[_0x57ec('0x25')](handleEntityNotFound(_0x48d8d1,null))[_0x57ec('0x25')](saveUpdates(_0x324c00[_0x57ec('0x46')],null))['then'](respondWithResult(_0x48d8d1,null))[_0x57ec('0x42')](handleError(_0x48d8d1,null));};exports[_0x57ec('0x48')]=function(_0x2232c9,_0x3c9d70){return db[_0x57ec('0x2b')][_0x57ec('0x49')]({'where':{'id':_0x2232c9[_0x57ec('0x44')]['id']}})[_0x57ec('0x25')](handleEntityNotFound(_0x3c9d70,null))[_0x57ec('0x25')](removeEntity(_0x3c9d70,null))['catch'](handleError(_0x3c9d70,null));};exports[_0x57ec('0x4a')]=function(_0x5b24d7,_0x57e813){return db[_0x57ec('0x2b')]['describe']()[_0x57ec('0x25')](respondWithResult(_0x57e813,null))[_0x57ec('0x42')](handleError(_0x57e813,null));}; \ No newline at end of file +var _0xf928=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','IntegrationReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0xac56ce,_0xb73e4){var _0x5105e1=function(_0x52768d){while(--_0x52768d){_0xac56ce['push'](_0xac56ce['shift']());}};_0x5105e1(++_0xb73e4);}(_0xf928,0x19c));var _0x8f92=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf928[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x8f92('0x0'));var rimraf=require(_0x8f92('0x1'));var zipdir=require(_0x8f92('0x2'));var jsonpatch=require(_0x8f92('0x3'));var rp=require(_0x8f92('0x4'));var moment=require(_0x8f92('0x5'));var BPromise=require(_0x8f92('0x6'));var Mustache=require(_0x8f92('0x7'));var util=require(_0x8f92('0x8'));var path=require(_0x8f92('0x9'));var sox=require('sox');var csv=require(_0x8f92('0xa'));var ejs=require(_0x8f92('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f92('0xc'));var squel=require(_0x8f92('0xd'));var crypto=require(_0x8f92('0xe'));var jsforce=require(_0x8f92('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8f92('0xa'));var querystring=require(_0x8f92('0x10'));var Papa=require(_0x8f92('0x11'));var Redis=require(_0x8f92('0x12'));var authService=require(_0x8f92('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8f92('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8f92('0x15'));var utils=require(_0x8f92('0x16'));var config=require(_0x8f92('0x17'));var licenseUtil=require(_0x8f92('0x18'));var db=require(_0x8f92('0x19'))['db'];function respondWithStatusCode(_0xf4d4db,_0x2d6fdf){_0x2d6fdf=_0x2d6fdf||0xcc;return function(_0x1959f0){if(_0x1959f0){return _0xf4d4db[_0x8f92('0x1a')](_0x2d6fdf);}return _0xf4d4db[_0x8f92('0x1b')](_0x2d6fdf)[_0x8f92('0x1c')]();};}function respondWithResult(_0x13b68b,_0x28dae4){_0x28dae4=_0x28dae4||0xc8;return function(_0x56a184){if(_0x56a184){return _0x13b68b['status'](_0x28dae4)['json'](_0x56a184);}};}function respondWithFilteredResult(_0x1cfe3d,_0x5f3318){return function(_0x49c33d){if(_0x49c33d){var _0x5237c7=typeof _0x5f3318[_0x8f92('0x1d')]===_0x8f92('0x1e')&&typeof _0x5f3318[_0x8f92('0x1f')]===_0x8f92('0x1e');var _0x20f5e=_0x49c33d['count'];var _0x571e61=_0x5237c7?0x0:_0x5f3318['offset'];var _0x21e623=_0x5237c7?_0x49c33d[_0x8f92('0x20')]:_0x5f3318[_0x8f92('0x1d')]+_0x5f3318[_0x8f92('0x1f')];var _0x3e438c;if(_0x21e623>=_0x20f5e){_0x21e623=_0x20f5e;_0x3e438c=0xc8;}else{_0x3e438c=0xce;}_0x1cfe3d[_0x8f92('0x1b')](_0x3e438c);return _0x1cfe3d[_0x8f92('0x21')](_0x8f92('0x22'),_0x571e61+'-'+_0x21e623+'/'+_0x20f5e)['json'](_0x49c33d);}return null;};}function patchUpdates(_0x1a5240){return function(_0x2db0ba){try{jsonpatch[_0x8f92('0x23')](_0x2db0ba,_0x1a5240,!![]);}catch(_0x1ff812){return BPromise[_0x8f92('0x24')](_0x1ff812);}return _0x2db0ba[_0x8f92('0x25')]();};}function saveUpdates(_0x52ad4f,_0x3a45b0){return function(_0x5d6562){if(_0x5d6562){return _0x5d6562[_0x8f92('0x26')](_0x52ad4f)[_0x8f92('0x27')](function(_0x11292a){return _0x11292a;});}return null;};}function removeEntity(_0x19c85e,_0x4e01f7){return function(_0x23f5a0){if(_0x23f5a0){return _0x23f5a0[_0x8f92('0x28')]()[_0x8f92('0x27')](function(){_0x19c85e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bb412,_0x324ea7){return function(_0x3f9294){if(!_0x3f9294){_0x2bb412[_0x8f92('0x1a')](0x194);}return _0x3f9294;};}function handleError(_0x410b6a,_0x86bb54){_0x86bb54=_0x86bb54||0x1f4;return function(_0x55239c){logger[_0x8f92('0x29')](_0x55239c[_0x8f92('0x2a')]);if(_0x55239c[_0x8f92('0x2b')]){delete _0x55239c[_0x8f92('0x2b')];}_0x410b6a[_0x8f92('0x1b')](_0x86bb54)[_0x8f92('0x2c')](_0x55239c);};}exports['index']=function(_0x2c4042,_0x166c45){var _0x3d379f={},_0x18d893={},_0x3e03c6={'count':0x0,'rows':[]};var _0x18d12f=_[_0x8f92('0x2d')](db[_0x8f92('0x2e')]['rawAttributes'],function(_0x2072ab){return{'name':_0x2072ab[_0x8f92('0x2f')],'type':_0x2072ab[_0x8f92('0x30')]['key']};});_0x18d893[_0x8f92('0x31')]=_[_0x8f92('0x2d')](_0x18d12f,'name');_0x18d893[_0x8f92('0x32')]=_[_0x8f92('0x33')](_0x2c4042[_0x8f92('0x32')]);_0x18d893[_0x8f92('0x34')]=_[_0x8f92('0x35')](_0x18d893[_0x8f92('0x31')],_0x18d893[_0x8f92('0x32')]);_0x3d379f['attributes']=_[_0x8f92('0x35')](_0x18d893[_0x8f92('0x31')],qs[_0x8f92('0x36')](_0x2c4042[_0x8f92('0x32')]['fields']));_0x3d379f[_0x8f92('0x37')]=_0x3d379f['attributes'][_0x8f92('0x38')]?_0x3d379f[_0x8f92('0x37')]:_0x18d893[_0x8f92('0x31')];if(!_0x2c4042[_0x8f92('0x32')][_0x8f92('0x39')](_0x8f92('0x3a'))){_0x3d379f[_0x8f92('0x1f')]=qs[_0x8f92('0x1f')](_0x2c4042['query']['limit']);_0x3d379f[_0x8f92('0x1d')]=qs[_0x8f92('0x1d')](_0x2c4042[_0x8f92('0x32')][_0x8f92('0x1d')]);}_0x3d379f[_0x8f92('0x3b')]=qs[_0x8f92('0x3c')](_0x2c4042[_0x8f92('0x32')][_0x8f92('0x3c')]);_0x3d379f[_0x8f92('0x3d')]=qs['filters'](_['pick'](_0x2c4042[_0x8f92('0x32')],_0x18d893['filters']),_0x18d12f);if(_0x2c4042[_0x8f92('0x32')][_0x8f92('0x3e')]){_0x3d379f[_0x8f92('0x3d')]=_[_0x8f92('0x3f')](_0x3d379f[_0x8f92('0x3d')],{'$or':_[_0x8f92('0x2d')](_0x18d12f,function(_0x47c23a){if(_0x47c23a[_0x8f92('0x30')]!==_0x8f92('0x40')){var _0x16cc72={};_0x16cc72[_0x47c23a[_0x8f92('0x2b')]]={'$like':'%'+_0x2c4042[_0x8f92('0x32')]['filter']+'%'};return _0x16cc72;}})});}_0x3d379f=_[_0x8f92('0x3f')]({},_0x3d379f,_0x2c4042['options']);var _0x2e16d5={'where':_0x3d379f[_0x8f92('0x3d')]};return db[_0x8f92('0x2e')][_0x8f92('0x20')](_0x2e16d5)[_0x8f92('0x27')](function(_0xb951f2){_0x3e03c6[_0x8f92('0x20')]=_0xb951f2;if(_0x2c4042[_0x8f92('0x32')][_0x8f92('0x41')]){_0x3d379f[_0x8f92('0x42')]=[{'all':!![]}];}return db[_0x8f92('0x2e')][_0x8f92('0x43')](_0x3d379f);})[_0x8f92('0x27')](function(_0xa70c6){_0x3e03c6[_0x8f92('0x44')]=_0xa70c6;return _0x3e03c6;})[_0x8f92('0x27')](respondWithFilteredResult(_0x166c45,_0x3d379f))[_0x8f92('0x45')](handleError(_0x166c45,null));};exports[_0x8f92('0x46')]=function(_0x13e41,_0x441997){var _0x535c13={'raw':![],'where':{'id':_0x13e41[_0x8f92('0x47')]['id']}},_0x4cb573={};_0x4cb573[_0x8f92('0x31')]=_['keys'](db[_0x8f92('0x2e')][_0x8f92('0x48')]);_0x4cb573[_0x8f92('0x32')]=_['keys'](_0x13e41[_0x8f92('0x32')]);_0x4cb573[_0x8f92('0x34')]=_[_0x8f92('0x35')](_0x4cb573[_0x8f92('0x31')],_0x4cb573[_0x8f92('0x32')]);_0x535c13[_0x8f92('0x37')]=_['intersection'](_0x4cb573[_0x8f92('0x31')],qs[_0x8f92('0x36')](_0x13e41[_0x8f92('0x32')][_0x8f92('0x36')]));_0x535c13[_0x8f92('0x37')]=_0x535c13['attributes'][_0x8f92('0x38')]?_0x535c13[_0x8f92('0x37')]:_0x4cb573[_0x8f92('0x31')];if(_0x13e41['query']['includeAll']){_0x535c13[_0x8f92('0x42')]=[{'all':!![]}];}_0x535c13=_['merge']({},_0x535c13,_0x13e41[_0x8f92('0x49')]);return db[_0x8f92('0x2e')]['find'](_0x535c13)[_0x8f92('0x27')](handleEntityNotFound(_0x441997,null))[_0x8f92('0x27')](respondWithResult(_0x441997,null))['catch'](handleError(_0x441997,null));};exports[_0x8f92('0x4a')]=function(_0x5b1396,_0x118547){return db['IntegrationReport'][_0x8f92('0x4a')](_0x5b1396[_0x8f92('0x4b')],{})[_0x8f92('0x27')](respondWithResult(_0x118547,0xc9))['catch'](handleError(_0x118547,null));};exports[_0x8f92('0x26')]=function(_0x2ca81a,_0x1a9043){if(_0x2ca81a[_0x8f92('0x4b')]['id']){delete _0x2ca81a[_0x8f92('0x4b')]['id'];}return db['IntegrationReport'][_0x8f92('0x4c')]({'where':{'id':_0x2ca81a[_0x8f92('0x47')]['id']}})[_0x8f92('0x27')](handleEntityNotFound(_0x1a9043,null))[_0x8f92('0x27')](saveUpdates(_0x2ca81a[_0x8f92('0x4b')],null))[_0x8f92('0x27')](respondWithResult(_0x1a9043,null))[_0x8f92('0x45')](handleError(_0x1a9043,null));};exports[_0x8f92('0x28')]=function(_0x3c292a,_0x4c3eb3){return db[_0x8f92('0x2e')][_0x8f92('0x4c')]({'where':{'id':_0x3c292a[_0x8f92('0x47')]['id']}})[_0x8f92('0x27')](handleEntityNotFound(_0x4c3eb3,null))[_0x8f92('0x27')](removeEntity(_0x4c3eb3,null))['catch'](handleError(_0x4c3eb3,null));};exports[_0x8f92('0x4d')]=function(_0x27076f,_0x2c9042){return db[_0x8f92('0x2e')][_0x8f92('0x4d')]()[_0x8f92('0x27')](respondWithResult(_0x2c9042,null))[_0x8f92('0x45')](handleError(_0x2c9042,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 4342d41..cfc07a6 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 _0xe08c=['./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','moment','bluebird','request-promise','rimraf'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xe08c,0x9b));var _0xce08=function(_0x590cd0,_0x11bfd4){_0x590cd0=_0x590cd0-0x0;var _0x208eb0=_0xe08c[_0x590cd0];return _0x208eb0;};'use strict';var _=require('lodash');var util=require(_0xce08('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xce08('0x1'));var BPromise=require(_0xce08('0x2'));var rp=require(_0xce08('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce08('0x4'));var config=require('../../config/environment');var attributes=require(_0xce08('0x5'));module[_0xce08('0x6')]=function(_0x349b71,_0x2d3f41){return _0x349b71[_0xce08('0x7')](_0xce08('0x8'),attributes,{'tableName':_0xce08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b88=['report_integration','../../config/logger','api','moment','request-promise','path','rimraf','./integrationReport.attributes','exports','IntegrationReport'];(function(_0x36c70b,_0x2a2b8c){var _0x42f1d8=function(_0x141797){while(--_0x141797){_0x36c70b['push'](_0x36c70b['shift']());}};_0x42f1d8(++_0x2a2b8c);}(_0x3b88,0xdd));var _0x83b8=function(_0x38fbc0,_0xa4a88c){_0x38fbc0=_0x38fbc0-0x0;var _0x39b21a=_0x3b88[_0x38fbc0];return _0x39b21a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x83b8('0x0'))(_0x83b8('0x1'));var moment=require(_0x83b8('0x2'));var BPromise=require('bluebird');var rp=require(_0x83b8('0x3'));var fs=require('fs');var path=require(_0x83b8('0x4'));var rimraf=require(_0x83b8('0x5'));var config=require('../../config/environment');var attributes=require(_0x83b8('0x6'));module[_0x83b8('0x7')]=function(_0x9ad047,_0x153a15){return _0x9ad047['define'](_0x83b8('0x8'),attributes,{'tableName':_0x83b8('0x9'),'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 a023abb..2645a52 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 _0x2542=['info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4ce5cf,_0x3d118e){var _0x194315=function(_0x58d828){while(--_0x58d828){_0x4ce5cf['push'](_0x4ce5cf['shift']());}};_0x194315(++_0x3d118e);}(_0x2542,0x169));var _0x2254=function(_0x53eff7,_0x1c08f8){_0x53eff7=_0x53eff7-0x0;var _0x320cd4=_0x2542[_0x53eff7];return _0x320cd4;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xf494,0x1c6));var _0x4f49=function(_0x22d61f,_0x32a0d3){_0x22d61f=_0x22d61f-0x0;var _0xc1ecb7=_0xf494[_0x22d61f];return _0xc1ecb7;};'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);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 87bedb1..470e61c 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 _0x9bb8=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','getIntervals','post','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','exports','multer','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9bb8,0x1ae));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x89bb('0x0'));var util=require(_0x89bb('0x1'));var path=require(_0x89bb('0x2'));var timeout=require(_0x89bb('0x3'));var express=require(_0x89bb('0x4'));var router=express[_0x89bb('0x5')]();var fs_extra=require(_0x89bb('0x6'));var auth=require(_0x89bb('0x7'));var interaction=require(_0x89bb('0x8'));var config=require(_0x89bb('0x9'));var controller=require(_0x89bb('0xa'));router[_0x89bb('0xb')]('/',auth['isAuthenticated'](),controller[_0x89bb('0xc')]);router[_0x89bb('0xb')](_0x89bb('0xd'),auth[_0x89bb('0xe')](),controller[_0x89bb('0xf')]);router[_0x89bb('0xb')]('/:id/sub_intervals',auth[_0x89bb('0xe')](),controller[_0x89bb('0x10')]);router['post']('/',auth[_0x89bb('0xe')](),controller['create']);router[_0x89bb('0x11')]('/:id/sub_intervals',auth[_0x89bb('0xe')](),controller['addInterval']);router[_0x89bb('0x11')](_0x89bb('0x12'),auth[_0x89bb('0xe')](),controller[_0x89bb('0x13')]);router['put'](_0x89bb('0xd'),auth[_0x89bb('0xe')](),controller[_0x89bb('0x14')]);router[_0x89bb('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x89bb('0x16')]);module[_0x89bb('0x17')]=router; \ No newline at end of file +var _0xb091=['index','get','show','/:id/sub_intervals','getIntervals','post','create','addInterval','addIntervals','put','/:id','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../config/environment','./interval.controller','isAuthenticated'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0xb091,0x16e));var _0x1b09=function(_0x299b5a,_0x38b4f4){_0x299b5a=_0x299b5a-0x0;var _0x4304b9=_0xb091[_0x299b5a];return _0x4304b9;};'use strict';var multer=require('multer');var util=require(_0x1b09('0x0'));var path=require(_0x1b09('0x1'));var timeout=require(_0x1b09('0x2'));var express=require(_0x1b09('0x3'));var router=express['Router']();var fs_extra=require(_0x1b09('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b09('0x5'));var controller=require(_0x1b09('0x6'));router['get']('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0x8')]);router[_0x1b09('0x9')]('/:id',auth[_0x1b09('0x7')](),controller[_0x1b09('0xa')]);router[_0x1b09('0x9')](_0x1b09('0xb'),auth[_0x1b09('0x7')](),controller[_0x1b09('0xc')]);router[_0x1b09('0xd')]('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0xe')]);router[_0x1b09('0xd')](_0x1b09('0xb'),auth['isAuthenticated'](),controller[_0x1b09('0xf')]);router[_0x1b09('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x1b09('0x10')]);router[_0x1b09('0x11')](_0x1b09('0x12'),auth[_0x1b09('0x7')](),controller[_0x1b09('0x13')]);router[_0x1b09('0x14')](_0x1b09('0x12'),auth['isAuthenticated'](),controller[_0x1b09('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 125d1e7..8aa84f6 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 _0x757f=['STRING','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x757f,0x91));var _0xf757=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x757f[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xf757('0x0'));module[_0xf757('0x1')]={'name':{'type':Sequelize[_0xf757('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf757('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x8372=['STRING','sequelize','exports'];(function(_0x3fbb91,_0x5ec106){var _0x3eb213=function(_0x118b9f){while(--_0x118b9f){_0x3fbb91['push'](_0x3fbb91['shift']());}};_0x3eb213(++_0x5ec106);}(_0x8372,0x18d));var _0x2837=function(_0x3daaf5,_0xaca28b){_0x3daaf5=_0x3daaf5-0x0;var _0x446333=_0x8372[_0x3daaf5];return _0x446333;};'use strict';var Sequelize=require(_0x2837('0x0'));module[_0x2837('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2837('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 1de9b7c..52caa70 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 _0xcff1=['limit','count','Content-Range','reject','save','update','then','get','Intervals','UserProfileResource','destroy','error','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','length','includeAll','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','body','addInterval','IntervalId','getIntervals','nolimit','addIntervals','findOne','transaction','bulkCreate','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','end','json','offset','undefined'];(function(_0x5ebc57,_0x9409db){var _0x3f841d=function(_0x2aaefc){while(--_0x2aaefc){_0x5ebc57['push'](_0x5ebc57['shift']());}};_0x3f841d(++_0x9409db);}(_0xcff1,0x191));var _0x1cff=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0xcff1[_0x1030ce];return _0x3367fd;};'use strict';var emlformat=require(_0x1cff('0x0'));var rimraf=require(_0x1cff('0x1'));var zipdir=require(_0x1cff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1cff('0x3'));var BPromise=require(_0x1cff('0x4'));var Mustache=require('mustache');var util=require(_0x1cff('0x5'));var path=require(_0x1cff('0x6'));var sox=require(_0x1cff('0x7'));var csv=require(_0x1cff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cff('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1cff('0xa'));var toCsv=require(_0x1cff('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cff('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x1cff('0xc'));var hardwareService=require(_0x1cff('0xd'));var logger=require(_0x1cff('0xe'))('api');var utils=require(_0x1cff('0xf'));var config=require(_0x1cff('0x10'));var licenseUtil=require(_0x1cff('0x11'));var db=require('../../mysqldb')['db'];var extensions=require(_0x1cff('0x12'));function respondWithStatusCode(_0x41bc92,_0x6d3668){_0x6d3668=_0x6d3668||0xcc;return function(_0x47f9bd){if(_0x47f9bd){return _0x41bc92['sendStatus'](_0x6d3668);}return _0x41bc92[_0x1cff('0x13')](_0x6d3668)[_0x1cff('0x14')]();};}function respondWithResult(_0xc18010,_0x520d58){_0x520d58=_0x520d58||0xc8;return function(_0x53e3f8){if(_0x53e3f8){return _0xc18010[_0x1cff('0x13')](_0x520d58)[_0x1cff('0x15')](_0x53e3f8);}};}function respondWithFilteredResult(_0xaeec27,_0x2e2db6){return function(_0x501d91){if(_0x501d91){var _0x26efc8=typeof _0x2e2db6[_0x1cff('0x16')]===_0x1cff('0x17')&&typeof _0x2e2db6[_0x1cff('0x18')]==='undefined';var _0x3541de=_0x501d91[_0x1cff('0x19')];var _0x192b64=_0x26efc8?0x0:_0x2e2db6['offset'];var _0x22f45f=_0x26efc8?_0x501d91[_0x1cff('0x19')]:_0x2e2db6[_0x1cff('0x16')]+_0x2e2db6[_0x1cff('0x18')];var _0x59df3b;if(_0x22f45f>=_0x3541de){_0x22f45f=_0x3541de;_0x59df3b=0xc8;}else{_0x59df3b=0xce;}_0xaeec27[_0x1cff('0x13')](_0x59df3b);return _0xaeec27['set'](_0x1cff('0x1a'),_0x192b64+'-'+_0x22f45f+'/'+_0x3541de)[_0x1cff('0x15')](_0x501d91);}return null;};}function patchUpdates(_0x1efe58){return function(_0x47b28b){try{jsonpatch['apply'](_0x47b28b,_0x1efe58,!![]);}catch(_0x12e30f){return BPromise[_0x1cff('0x1b')](_0x12e30f);}return _0x47b28b[_0x1cff('0x1c')]();};}function saveUpdates(_0x14862c,_0x849426){return function(_0x420872){if(_0x420872){return _0x420872[_0x1cff('0x1d')](_0x14862c)['then'](function(_0x2351d2){return _0x2351d2;});}return null;};}function removeEntity(_0x1b658e,_0x3285fd){return function(_0x55e18c){if(_0x55e18c){return _0x55e18c['destroy']()[_0x1cff('0x1e')](function(){var _0x2879c6=_0x55e18c[_0x1cff('0x1f')]({'plain':!![]});var _0x2b2b12=_0x1cff('0x20');return db[_0x1cff('0x21')][_0x1cff('0x22')]({'where':{'type':_0x2b2b12,'resourceId':_0x2879c6['id']}})[_0x1cff('0x1e')](function(){return _0x55e18c;});})[_0x1cff('0x1e')](function(){_0x1b658e[_0x1cff('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ea7cf,_0x5a47a1){return function(_0x121e39){if(!_0x121e39){_0x2ea7cf['sendStatus'](0x194);}return _0x121e39;};}function handleError(_0x37797e,_0x93bbbf){_0x93bbbf=_0x93bbbf||0x1f4;return function(_0x4fff1d){logger[_0x1cff('0x23')](_0x4fff1d['stack']);if(_0x4fff1d[_0x1cff('0x24')]){delete _0x4fff1d[_0x1cff('0x24')];}_0x37797e[_0x1cff('0x13')](_0x93bbbf)[_0x1cff('0x25')](_0x4fff1d);};}exports[_0x1cff('0x26')]=function(_0x348dfe,_0xcfc51c){var _0x14cbf1={},_0x2611bb={},_0x2591c8={'count':0x0,'rows':[]};var _0x2f8a5d=_['map'](db[_0x1cff('0x27')][_0x1cff('0x28')],function(_0x472fe4){return{'name':_0x472fe4[_0x1cff('0x29')],'type':_0x472fe4[_0x1cff('0x2a')][_0x1cff('0x2b')]};});_0x2611bb[_0x1cff('0x2c')]=_[_0x1cff('0x2d')](_0x2f8a5d,_0x1cff('0x24'));_0x2611bb[_0x1cff('0x2e')]=_[_0x1cff('0x2f')](_0x348dfe[_0x1cff('0x2e')]);_0x2611bb['filters']=_[_0x1cff('0x30')](_0x2611bb[_0x1cff('0x2c')],_0x2611bb[_0x1cff('0x2e')]);_0x14cbf1[_0x1cff('0x31')]=_[_0x1cff('0x30')](_0x2611bb[_0x1cff('0x2c')],qs['fields'](_0x348dfe[_0x1cff('0x2e')][_0x1cff('0x32')]));_0x14cbf1[_0x1cff('0x31')]=_0x14cbf1['attributes']['length']?_0x14cbf1[_0x1cff('0x31')]:_0x2611bb[_0x1cff('0x2c')];if(!_0x348dfe[_0x1cff('0x2e')][_0x1cff('0x33')]('nolimit')){_0x14cbf1[_0x1cff('0x18')]=qs[_0x1cff('0x18')](_0x348dfe['query']['limit']);_0x14cbf1['offset']=qs[_0x1cff('0x16')](_0x348dfe['query'][_0x1cff('0x16')]);}_0x14cbf1[_0x1cff('0x34')]=qs[_0x1cff('0x35')](_0x348dfe[_0x1cff('0x2e')][_0x1cff('0x35')]);_0x14cbf1[_0x1cff('0x36')]=qs[_0x1cff('0x37')](_[_0x1cff('0x38')](_0x348dfe[_0x1cff('0x2e')],_0x2611bb['filters']),_0x2f8a5d);if(_0x348dfe[_0x1cff('0x2e')][_0x1cff('0x39')]){_0x14cbf1[_0x1cff('0x36')]=_[_0x1cff('0x3a')](_0x14cbf1[_0x1cff('0x36')],{'$or':_[_0x1cff('0x2d')](_0x2f8a5d,function(_0x47f02e){if(_0x47f02e['type']!==_0x1cff('0x3b')){var _0x506e71={};_0x506e71[_0x47f02e[_0x1cff('0x24')]]={'$like':'%'+_0x348dfe[_0x1cff('0x2e')][_0x1cff('0x39')]+'%'};return _0x506e71;}})});}_0x14cbf1=_[_0x1cff('0x3a')]({},_0x14cbf1,_0x348dfe[_0x1cff('0x3c')]);var _0x118d8f={'where':_0x14cbf1[_0x1cff('0x36')]};return db['Interval'][_0x1cff('0x19')](_0x118d8f)['then'](function(_0x1acc4f){_0x2591c8[_0x1cff('0x19')]=_0x1acc4f;if(_0x348dfe[_0x1cff('0x2e')]['includeAll']){_0x14cbf1['include']=[{'all':!![]}];}return db[_0x1cff('0x27')][_0x1cff('0x3d')](_0x14cbf1);})[_0x1cff('0x1e')](function(_0x30811d){_0x2591c8[_0x1cff('0x3e')]=_0x30811d;return _0x2591c8;})[_0x1cff('0x1e')](respondWithFilteredResult(_0xcfc51c,_0x14cbf1))[_0x1cff('0x3f')](handleError(_0xcfc51c,null));};exports['show']=function(_0x454f72,_0x248661){var _0x83f621={'raw':!![],'where':{'id':_0x454f72[_0x1cff('0x40')]['id']}},_0x250376={};_0x250376[_0x1cff('0x2c')]=_[_0x1cff('0x2f')](db[_0x1cff('0x27')][_0x1cff('0x28')]);_0x250376[_0x1cff('0x2e')]=_[_0x1cff('0x2f')](_0x454f72[_0x1cff('0x2e')]);_0x250376[_0x1cff('0x37')]=_[_0x1cff('0x30')](_0x250376[_0x1cff('0x2c')],_0x250376[_0x1cff('0x2e')]);_0x83f621[_0x1cff('0x31')]=_[_0x1cff('0x30')](_0x250376[_0x1cff('0x2c')],qs[_0x1cff('0x32')](_0x454f72[_0x1cff('0x2e')]['fields']));_0x83f621[_0x1cff('0x31')]=_0x83f621['attributes'][_0x1cff('0x41')]?_0x83f621[_0x1cff('0x31')]:_0x250376[_0x1cff('0x2c')];if(_0x454f72[_0x1cff('0x2e')][_0x1cff('0x42')]){_0x83f621[_0x1cff('0x43')]=[{'all':!![]}];}_0x83f621=_[_0x1cff('0x3a')]({},_0x83f621,_0x454f72[_0x1cff('0x3c')]);return db[_0x1cff('0x27')]['find'](_0x83f621)['then'](handleEntityNotFound(_0x248661,null))[_0x1cff('0x1e')](respondWithResult(_0x248661,null))[_0x1cff('0x3f')](handleError(_0x248661,null));};exports[_0x1cff('0x44')]=function(_0x195b33,_0x544dc5){return db[_0x1cff('0x27')]['create'](_0x195b33['body'],{})['then'](function(_0x415462){var _0x2b542e=_0x195b33['user'][_0x1cff('0x1f')]({'plain':!![]});if(!_0x2b542e)throw new Error(_0x1cff('0x45'));if(_0x2b542e[_0x1cff('0x46')]===_0x1cff('0x47')){var _0x238dea=_0x415462[_0x1cff('0x1f')]({'plain':!![]});var _0x55589b=_0x1cff('0x20');return db[_0x1cff('0x48')][_0x1cff('0x49')]({'where':{'name':_0x55589b,'userProfileId':_0x2b542e[_0x1cff('0x4a')]},'raw':!![]})[_0x1cff('0x1e')](function(_0xfcc1fc){if(_0xfcc1fc&&_0xfcc1fc[_0x1cff('0x4b')]===0x0){return db[_0x1cff('0x21')][_0x1cff('0x44')]({'name':_0x238dea[_0x1cff('0x24')],'resourceId':_0x238dea['id'],'type':_0xfcc1fc[_0x1cff('0x24')],'sectionId':_0xfcc1fc['id']},{})[_0x1cff('0x1e')](function(){return _0x415462;});}else{return _0x415462;}})[_0x1cff('0x3f')](function(_0x130e87){logger[_0x1cff('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x130e87);throw _0x130e87;});}return _0x415462;})[_0x1cff('0x1e')](respondWithResult(_0x544dc5,0xc9))['catch'](handleError(_0x544dc5,null));};exports['update']=function(_0x3bf8fa,_0x586fd3){if(_0x3bf8fa[_0x1cff('0x4c')]['id']){delete _0x3bf8fa[_0x1cff('0x4c')]['id'];}return db[_0x1cff('0x27')][_0x1cff('0x49')]({'where':{'id':_0x3bf8fa['params']['id']}})[_0x1cff('0x1e')](handleEntityNotFound(_0x586fd3,null))[_0x1cff('0x1e')](saveUpdates(_0x3bf8fa[_0x1cff('0x4c')],null))[_0x1cff('0x1e')](respondWithResult(_0x586fd3,null))[_0x1cff('0x3f')](handleError(_0x586fd3,null));};exports['destroy']=function(_0x19bf9c,_0xcaff36){return db[_0x1cff('0x27')]['find']({'where':{'id':_0x19bf9c['params']['id']}})['then'](handleEntityNotFound(_0xcaff36,null))['then'](removeEntity(_0xcaff36,null))[_0x1cff('0x3f')](handleError(_0xcaff36,null));};exports[_0x1cff('0x4d')]=function(_0x59fb09,_0x1330b8,_0x3b077c){if(_0x59fb09[_0x1cff('0x4c')]['id']){delete _0x59fb09['body']['id'];}return db['Interval'][_0x1cff('0x49')]({'where':{'id':_0x59fb09['params']['id']}})[_0x1cff('0x1e')](handleEntityNotFound(_0x1330b8,null))['then'](function(_0x1fba9c){if(_0x1fba9c){_0x59fb09[_0x1cff('0x4c')][_0x1cff('0x4e')]=_0x1fba9c['id'];return db[_0x1cff('0x27')][_0x1cff('0x44')](_0x59fb09[_0x1cff('0x4c')]);}})[_0x1cff('0x1e')](respondWithResult(_0x1330b8,null))[_0x1cff('0x3f')](handleError(_0x1330b8,null));};exports['getIntervals']=function(_0x54f456,_0x35ef8a,_0x4e3897){var _0x8fa38a={};var _0x534eb9={};var _0x23dbed;var _0xf3e7db;return db[_0x1cff('0x27')]['findOne']({'where':{'id':_0x54f456[_0x1cff('0x40')]['id']}})['then'](handleEntityNotFound(_0x35ef8a,null))[_0x1cff('0x1e')](function(_0x239d99){if(_0x239d99){_0x23dbed=_0x239d99;_0x534eb9[_0x1cff('0x2c')]=_[_0x1cff('0x2f')](db['Interval'][_0x1cff('0x28')]);_0x534eb9['query']=_[_0x1cff('0x2f')](_0x54f456['query']);_0x534eb9[_0x1cff('0x37')]=_[_0x1cff('0x30')](_0x534eb9['model'],_0x534eb9[_0x1cff('0x2e')]);_0x8fa38a[_0x1cff('0x31')]=_[_0x1cff('0x30')](_0x534eb9['model'],qs[_0x1cff('0x32')](_0x54f456['query'][_0x1cff('0x32')]));_0x8fa38a['attributes']=_0x8fa38a[_0x1cff('0x31')][_0x1cff('0x41')]?_0x8fa38a[_0x1cff('0x31')]:_0x534eb9[_0x1cff('0x2c')];_0x8fa38a[_0x1cff('0x34')]=qs[_0x1cff('0x35')](_0x54f456[_0x1cff('0x2e')]['sort']);_0x8fa38a['where']=qs[_0x1cff('0x37')](_[_0x1cff('0x38')](_0x54f456['query'],_0x534eb9[_0x1cff('0x37')]));if(_0x54f456['query'][_0x1cff('0x39')]){_0x8fa38a[_0x1cff('0x36')]=_[_0x1cff('0x3a')](_0x8fa38a['where'],{'$or':_['map'](_0x8fa38a[_0x1cff('0x31')],function(_0x3f87da){var _0x3e3e33={};_0x3e3e33[_0x3f87da]={'$like':'%'+_0x54f456[_0x1cff('0x2e')][_0x1cff('0x39')]+'%'};return _0x3e3e33;})});}_0x8fa38a=_[_0x1cff('0x3a')]({},_0x8fa38a,_0x54f456[_0x1cff('0x3c')]);return _0x23dbed[_0x1cff('0x4f')](_0x8fa38a);}})[_0x1cff('0x1e')](function(_0x368da1){if(_0x368da1){_0xf3e7db=_0x368da1[_0x1cff('0x41')];if(!_0x54f456[_0x1cff('0x2e')]['hasOwnProperty'](_0x1cff('0x50'))){_0x8fa38a[_0x1cff('0x18')]=qs[_0x1cff('0x18')](_0x54f456[_0x1cff('0x2e')][_0x1cff('0x18')]);_0x8fa38a['offset']=qs[_0x1cff('0x16')](_0x54f456['query'][_0x1cff('0x16')]);}return _0x23dbed['getIntervals'](_0x8fa38a);}})[_0x1cff('0x1e')](function(_0x1a0e0c){if(_0x1a0e0c){return _0x1a0e0c?{'count':_0xf3e7db,'rows':_0x1a0e0c}:null;}})['then'](respondWithResult(_0x35ef8a,null))['catch'](handleError(_0x35ef8a,null));};exports[_0x1cff('0x51')]=function(_0x1f30d2,_0x53d8c9,_0x5a5697){return db[_0x1cff('0x27')][_0x1cff('0x52')]({'where':{'id':_0x1f30d2[_0x1cff('0x40')]['id']}})[_0x1cff('0x1e')](handleEntityNotFound(_0x53d8c9,null))[_0x1cff('0x1e')](function(_0x3e4649){if(_0x3e4649){return db['sequelize'][_0x1cff('0x53')](function(_0x20df33){return db[_0x1cff('0x27')][_0x1cff('0x22')]({'where':{'IntervalId':_0x1f30d2['params']['id']},'transaction':_0x20df33})[_0x1cff('0x1e')](function(_0x26e9a2){var _0x5d8e6f=_[_0x1cff('0x2d')](_0x1f30d2['body'],function(_0x4a0cce){delete _0x4a0cce['id'];_0x4a0cce[_0x1cff('0x4e')]=_0x1f30d2['params']['id'];return _0x4a0cce;});return db[_0x1cff('0x27')][_0x1cff('0x54')](_0x5d8e6f,{'transaction':_0x20df33});});})[_0x1cff('0x1e')](function(){return db[_0x1cff('0x27')][_0x1cff('0x3d')]({'where':{'IntervalId':_0x1f30d2[_0x1cff('0x40')]['id']}});});}})['then'](respondWithResult(_0x53d8c9,null))[_0x1cff('0x3f')](handleError(_0x53d8c9,null));}; \ No newline at end of file +var _0xcfd9=['create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','length','pick','addIntervals','sequelize','bulkCreate','eml-format','rimraf','fast-json-patch','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/advancedSearch','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','json','offset','limit','undefined','count','status','Content-Range','reject','update','then','destroy','get','Intervals','UserProfileResource','error','name','send','index','Interval','rawAttributes','fieldName','key','map','query','keys','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','find'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xcfd9,0x111));var _0x9cfd=function(_0x56ca61,_0x187321){_0x56ca61=_0x56ca61-0x0;var _0x1e7bee=_0xcfd9[_0x56ca61];return _0x1e7bee;};'use strict';var emlformat=require(_0x9cfd('0x0'));var rimraf=require(_0x9cfd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9cfd('0x2'));var rp=require(_0x9cfd('0x3'));var moment=require(_0x9cfd('0x4'));var BPromise=require(_0x9cfd('0x5'));var Mustache=require(_0x9cfd('0x6'));var util=require(_0x9cfd('0x7'));var path=require(_0x9cfd('0x8'));var sox=require(_0x9cfd('0x9'));var csv=require(_0x9cfd('0xa'));var ejs=require(_0x9cfd('0xb'));var fs=require('fs');var fs_extra=require(_0x9cfd('0xc'));var _=require(_0x9cfd('0xd'));var squel=require(_0x9cfd('0xe'));var crypto=require(_0x9cfd('0xf'));var jsforce=require(_0x9cfd('0x10'));var deskjs=require(_0x9cfd('0x11'));var toCsv=require(_0x9cfd('0xa'));var querystring=require(_0x9cfd('0x12'));var Papa=require('papaparse');var Redis=require(_0x9cfd('0x13'));var authService=require(_0x9cfd('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9cfd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9cfd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9cfd('0x17'))['db'];var extensions=require(_0x9cfd('0x18'));function respondWithStatusCode(_0xd1325e,_0x5b74ff){_0x5b74ff=_0x5b74ff||0xcc;return function(_0x57b1f2){if(_0x57b1f2){return _0xd1325e['sendStatus'](_0x5b74ff);}return _0xd1325e['status'](_0x5b74ff)[_0x9cfd('0x19')]();};}function respondWithResult(_0x1d84d3,_0x37d7c5){_0x37d7c5=_0x37d7c5||0xc8;return function(_0x441591){if(_0x441591){return _0x1d84d3['status'](_0x37d7c5)[_0x9cfd('0x1a')](_0x441591);}};}function respondWithFilteredResult(_0x4a1919,_0x524b56){return function(_0xd70e1b){if(_0xd70e1b){var _0x16c0cd=typeof _0x524b56[_0x9cfd('0x1b')]==='undefined'&&typeof _0x524b56[_0x9cfd('0x1c')]===_0x9cfd('0x1d');var _0x4ffbbe=_0xd70e1b[_0x9cfd('0x1e')];var _0x16da4a=_0x16c0cd?0x0:_0x524b56[_0x9cfd('0x1b')];var _0x5f7855=_0x16c0cd?_0xd70e1b[_0x9cfd('0x1e')]:_0x524b56[_0x9cfd('0x1b')]+_0x524b56['limit'];var _0x325fbf;if(_0x5f7855>=_0x4ffbbe){_0x5f7855=_0x4ffbbe;_0x325fbf=0xc8;}else{_0x325fbf=0xce;}_0x4a1919[_0x9cfd('0x1f')](_0x325fbf);return _0x4a1919['set'](_0x9cfd('0x20'),_0x16da4a+'-'+_0x5f7855+'/'+_0x4ffbbe)[_0x9cfd('0x1a')](_0xd70e1b);}return null;};}function patchUpdates(_0x3c4bc7){return function(_0x35c593){try{jsonpatch['apply'](_0x35c593,_0x3c4bc7,!![]);}catch(_0x1a5773){return BPromise[_0x9cfd('0x21')](_0x1a5773);}return _0x35c593['save']();};}function saveUpdates(_0x323a9f,_0x316407){return function(_0x59e802){if(_0x59e802){return _0x59e802[_0x9cfd('0x22')](_0x323a9f)[_0x9cfd('0x23')](function(_0x8fd395){return _0x8fd395;});}return null;};}function removeEntity(_0x1de449,_0x52e6b5){return function(_0x56fa8e){if(_0x56fa8e){return _0x56fa8e[_0x9cfd('0x24')]()[_0x9cfd('0x23')](function(){var _0x75cd87=_0x56fa8e[_0x9cfd('0x25')]({'plain':!![]});var _0x30ac56=_0x9cfd('0x26');return db[_0x9cfd('0x27')][_0x9cfd('0x24')]({'where':{'type':_0x30ac56,'resourceId':_0x75cd87['id']}})[_0x9cfd('0x23')](function(){return _0x56fa8e;});})[_0x9cfd('0x23')](function(){_0x1de449['status'](0xcc)[_0x9cfd('0x19')]();});}};}function handleEntityNotFound(_0x4b88f3,_0x1f8ccc){return function(_0x26935f){if(!_0x26935f){_0x4b88f3['sendStatus'](0x194);}return _0x26935f;};}function handleError(_0x1a0998,_0x11fdf7){_0x11fdf7=_0x11fdf7||0x1f4;return function(_0x1f2622){logger[_0x9cfd('0x28')](_0x1f2622['stack']);if(_0x1f2622[_0x9cfd('0x29')]){delete _0x1f2622[_0x9cfd('0x29')];}_0x1a0998[_0x9cfd('0x1f')](_0x11fdf7)[_0x9cfd('0x2a')](_0x1f2622);};}exports[_0x9cfd('0x2b')]=function(_0x3677ce,_0xe0f34c){var _0x11f52c={},_0x40c6f4={},_0x3955c5={'count':0x0,'rows':[]};var _0x326e97=_['map'](db[_0x9cfd('0x2c')][_0x9cfd('0x2d')],function(_0x557984){return{'name':_0x557984[_0x9cfd('0x2e')],'type':_0x557984['type'][_0x9cfd('0x2f')]};});_0x40c6f4['model']=_[_0x9cfd('0x30')](_0x326e97,_0x9cfd('0x29'));_0x40c6f4[_0x9cfd('0x31')]=_[_0x9cfd('0x32')](_0x3677ce[_0x9cfd('0x31')]);_0x40c6f4['filters']=_[_0x9cfd('0x33')](_0x40c6f4['model'],_0x40c6f4[_0x9cfd('0x31')]);_0x11f52c[_0x9cfd('0x34')]=_['intersection'](_0x40c6f4['model'],qs[_0x9cfd('0x35')](_0x3677ce[_0x9cfd('0x31')][_0x9cfd('0x35')]));_0x11f52c[_0x9cfd('0x34')]=_0x11f52c['attributes']['length']?_0x11f52c[_0x9cfd('0x34')]:_0x40c6f4[_0x9cfd('0x36')];if(!_0x3677ce[_0x9cfd('0x31')][_0x9cfd('0x37')](_0x9cfd('0x38'))){_0x11f52c['limit']=qs[_0x9cfd('0x1c')](_0x3677ce['query']['limit']);_0x11f52c['offset']=qs[_0x9cfd('0x1b')](_0x3677ce[_0x9cfd('0x31')]['offset']);}_0x11f52c[_0x9cfd('0x39')]=qs[_0x9cfd('0x3a')](_0x3677ce[_0x9cfd('0x31')][_0x9cfd('0x3a')]);_0x11f52c[_0x9cfd('0x3b')]=qs[_0x9cfd('0x3c')](_['pick'](_0x3677ce['query'],_0x40c6f4['filters']),_0x326e97);if(_0x3677ce['query'][_0x9cfd('0x3d')]){_0x11f52c['where']=_[_0x9cfd('0x3e')](_0x11f52c[_0x9cfd('0x3b')],{'$or':_[_0x9cfd('0x30')](_0x326e97,function(_0x702c80){if(_0x702c80[_0x9cfd('0x3f')]!==_0x9cfd('0x40')){var _0x416374={};_0x416374[_0x702c80['name']]={'$like':'%'+_0x3677ce['query']['filter']+'%'};return _0x416374;}})});}_0x11f52c=_[_0x9cfd('0x3e')]({},_0x11f52c,_0x3677ce[_0x9cfd('0x41')]);var _0xea9f70={'where':_0x11f52c[_0x9cfd('0x3b')]};return db[_0x9cfd('0x2c')][_0x9cfd('0x1e')](_0xea9f70)[_0x9cfd('0x23')](function(_0x4f2993){_0x3955c5[_0x9cfd('0x1e')]=_0x4f2993;if(_0x3677ce[_0x9cfd('0x31')][_0x9cfd('0x42')]){_0x11f52c['include']=[{'all':!![]}];}return db['Interval'][_0x9cfd('0x43')](_0x11f52c);})['then'](function(_0x3a9a0c){_0x3955c5['rows']=_0x3a9a0c;return _0x3955c5;})[_0x9cfd('0x23')](respondWithFilteredResult(_0xe0f34c,_0x11f52c))[_0x9cfd('0x44')](handleError(_0xe0f34c,null));};exports['show']=function(_0x2c300b,_0x3ac062){var _0xc751b9={'raw':!![],'where':{'id':_0x2c300b[_0x9cfd('0x45')]['id']}},_0x13842f={};_0x13842f[_0x9cfd('0x36')]=_[_0x9cfd('0x32')](db['Interval']['rawAttributes']);_0x13842f[_0x9cfd('0x31')]=_[_0x9cfd('0x32')](_0x2c300b['query']);_0x13842f[_0x9cfd('0x3c')]=_[_0x9cfd('0x33')](_0x13842f['model'],_0x13842f[_0x9cfd('0x31')]);_0xc751b9[_0x9cfd('0x34')]=_['intersection'](_0x13842f[_0x9cfd('0x36')],qs[_0x9cfd('0x35')](_0x2c300b[_0x9cfd('0x31')][_0x9cfd('0x35')]));_0xc751b9[_0x9cfd('0x34')]=_0xc751b9[_0x9cfd('0x34')]['length']?_0xc751b9[_0x9cfd('0x34')]:_0x13842f[_0x9cfd('0x36')];if(_0x2c300b[_0x9cfd('0x31')][_0x9cfd('0x42')]){_0xc751b9['include']=[{'all':!![]}];}_0xc751b9=_[_0x9cfd('0x3e')]({},_0xc751b9,_0x2c300b[_0x9cfd('0x41')]);return db[_0x9cfd('0x2c')][_0x9cfd('0x46')](_0xc751b9)[_0x9cfd('0x23')](handleEntityNotFound(_0x3ac062,null))[_0x9cfd('0x23')](respondWithResult(_0x3ac062,null))[_0x9cfd('0x44')](handleError(_0x3ac062,null));};exports[_0x9cfd('0x47')]=function(_0x26b701,_0x457495){return db[_0x9cfd('0x2c')][_0x9cfd('0x47')](_0x26b701[_0x9cfd('0x48')],{})['then'](function(_0x1d6c35){var _0x1424e6=_0x26b701[_0x9cfd('0x49')][_0x9cfd('0x25')]({'plain':!![]});if(!_0x1424e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1424e6['role']===_0x9cfd('0x49')){var _0x20f719=_0x1d6c35[_0x9cfd('0x25')]({'plain':!![]});var _0x3ed290='Intervals';return db[_0x9cfd('0x4a')][_0x9cfd('0x46')]({'where':{'name':_0x3ed290,'userProfileId':_0x1424e6[_0x9cfd('0x4b')]},'raw':!![]})[_0x9cfd('0x23')](function(_0x3288d4){if(_0x3288d4&&_0x3288d4[_0x9cfd('0x4c')]===0x0){return db[_0x9cfd('0x27')]['create']({'name':_0x20f719[_0x9cfd('0x29')],'resourceId':_0x20f719['id'],'type':_0x3288d4[_0x9cfd('0x29')],'sectionId':_0x3288d4['id']},{})[_0x9cfd('0x23')](function(){return _0x1d6c35;});}else{return _0x1d6c35;}})[_0x9cfd('0x44')](function(_0x1bc294){logger['error'](_0x9cfd('0x4d'),_0x1bc294);throw _0x1bc294;});}return _0x1d6c35;})[_0x9cfd('0x23')](respondWithResult(_0x457495,0xc9))[_0x9cfd('0x44')](handleError(_0x457495,null));};exports[_0x9cfd('0x22')]=function(_0xbfd631,_0x4fb025){if(_0xbfd631[_0x9cfd('0x48')]['id']){delete _0xbfd631[_0x9cfd('0x48')]['id'];}return db['Interval'][_0x9cfd('0x46')]({'where':{'id':_0xbfd631[_0x9cfd('0x45')]['id']}})['then'](handleEntityNotFound(_0x4fb025,null))['then'](saveUpdates(_0xbfd631[_0x9cfd('0x48')],null))[_0x9cfd('0x23')](respondWithResult(_0x4fb025,null))['catch'](handleError(_0x4fb025,null));};exports['destroy']=function(_0x401d76,_0x4022f0){return db[_0x9cfd('0x2c')][_0x9cfd('0x46')]({'where':{'id':_0x401d76[_0x9cfd('0x45')]['id']}})[_0x9cfd('0x23')](handleEntityNotFound(_0x4022f0,null))[_0x9cfd('0x23')](removeEntity(_0x4022f0,null))[_0x9cfd('0x44')](handleError(_0x4022f0,null));};exports[_0x9cfd('0x4e')]=function(_0x35ff72,_0x2dda88,_0x170bdb){if(_0x35ff72['body']['id']){delete _0x35ff72[_0x9cfd('0x48')]['id'];}return db[_0x9cfd('0x2c')][_0x9cfd('0x46')]({'where':{'id':_0x35ff72[_0x9cfd('0x45')]['id']}})['then'](handleEntityNotFound(_0x2dda88,null))['then'](function(_0x3f1584){if(_0x3f1584){_0x35ff72[_0x9cfd('0x48')]['IntervalId']=_0x3f1584['id'];return db['Interval'][_0x9cfd('0x47')](_0x35ff72[_0x9cfd('0x48')]);}})[_0x9cfd('0x23')](respondWithResult(_0x2dda88,null))[_0x9cfd('0x44')](handleError(_0x2dda88,null));};exports[_0x9cfd('0x4f')]=function(_0x3e1516,_0x24addd,_0x2fd7fe){var _0x43f7f9={};var _0x4529bf={};var _0x5d3a3e;var _0x1a5e06;return db[_0x9cfd('0x2c')][_0x9cfd('0x50')]({'where':{'id':_0x3e1516[_0x9cfd('0x45')]['id']}})['then'](handleEntityNotFound(_0x24addd,null))[_0x9cfd('0x23')](function(_0x2d5f2b){if(_0x2d5f2b){_0x5d3a3e=_0x2d5f2b;_0x4529bf[_0x9cfd('0x36')]=_[_0x9cfd('0x32')](db[_0x9cfd('0x2c')][_0x9cfd('0x2d')]);_0x4529bf[_0x9cfd('0x31')]=_[_0x9cfd('0x32')](_0x3e1516[_0x9cfd('0x31')]);_0x4529bf['filters']=_[_0x9cfd('0x33')](_0x4529bf[_0x9cfd('0x36')],_0x4529bf['query']);_0x43f7f9[_0x9cfd('0x34')]=_[_0x9cfd('0x33')](_0x4529bf[_0x9cfd('0x36')],qs['fields'](_0x3e1516[_0x9cfd('0x31')]['fields']));_0x43f7f9[_0x9cfd('0x34')]=_0x43f7f9[_0x9cfd('0x34')][_0x9cfd('0x51')]?_0x43f7f9[_0x9cfd('0x34')]:_0x4529bf[_0x9cfd('0x36')];_0x43f7f9['order']=qs[_0x9cfd('0x3a')](_0x3e1516[_0x9cfd('0x31')][_0x9cfd('0x3a')]);_0x43f7f9['where']=qs[_0x9cfd('0x3c')](_[_0x9cfd('0x52')](_0x3e1516[_0x9cfd('0x31')],_0x4529bf[_0x9cfd('0x3c')]));if(_0x3e1516[_0x9cfd('0x31')][_0x9cfd('0x3d')]){_0x43f7f9['where']=_[_0x9cfd('0x3e')](_0x43f7f9['where'],{'$or':_['map'](_0x43f7f9[_0x9cfd('0x34')],function(_0x98e5a5){var _0x357e35={};_0x357e35[_0x98e5a5]={'$like':'%'+_0x3e1516[_0x9cfd('0x31')][_0x9cfd('0x3d')]+'%'};return _0x357e35;})});}_0x43f7f9=_[_0x9cfd('0x3e')]({},_0x43f7f9,_0x3e1516['options']);return _0x5d3a3e[_0x9cfd('0x4f')](_0x43f7f9);}})[_0x9cfd('0x23')](function(_0x52c2a4){if(_0x52c2a4){_0x1a5e06=_0x52c2a4[_0x9cfd('0x51')];if(!_0x3e1516[_0x9cfd('0x31')][_0x9cfd('0x37')](_0x9cfd('0x38'))){_0x43f7f9['limit']=qs[_0x9cfd('0x1c')](_0x3e1516[_0x9cfd('0x31')]['limit']);_0x43f7f9['offset']=qs[_0x9cfd('0x1b')](_0x3e1516[_0x9cfd('0x31')][_0x9cfd('0x1b')]);}return _0x5d3a3e[_0x9cfd('0x4f')](_0x43f7f9);}})[_0x9cfd('0x23')](function(_0x6fdb88){if(_0x6fdb88){return _0x6fdb88?{'count':_0x1a5e06,'rows':_0x6fdb88}:null;}})[_0x9cfd('0x23')](respondWithResult(_0x24addd,null))[_0x9cfd('0x44')](handleError(_0x24addd,null));};exports[_0x9cfd('0x53')]=function(_0x2a10e7,_0x4b3850,_0xc57fe7){return db[_0x9cfd('0x2c')][_0x9cfd('0x50')]({'where':{'id':_0x2a10e7['params']['id']}})['then'](handleEntityNotFound(_0x4b3850,null))[_0x9cfd('0x23')](function(_0x21554e){if(_0x21554e){return db[_0x9cfd('0x54')]['transaction'](function(_0x2acae8){return db[_0x9cfd('0x2c')]['destroy']({'where':{'IntervalId':_0x2a10e7[_0x9cfd('0x45')]['id']},'transaction':_0x2acae8})[_0x9cfd('0x23')](function(_0x336ad0){var _0x5676a4=_['map'](_0x2a10e7[_0x9cfd('0x48')],function(_0xfb988f){delete _0xfb988f['id'];_0xfb988f['IntervalId']=_0x2a10e7[_0x9cfd('0x45')]['id'];return _0xfb988f;});return db['Interval'][_0x9cfd('0x55')](_0x5676a4,{'transaction':_0x2acae8});});})[_0x9cfd('0x23')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x2a10e7[_0x9cfd('0x45')]['id']}});});}})['then'](respondWithResult(_0x4b3850,null))[_0x9cfd('0x44')](handleError(_0x4b3850,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 8e386fc..bc52618 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 _0x7a60=['../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite','string','interval','getIntervals','then','all','map','ifTime','reduce'];(function(_0xd0a95d,_0xd7e320){var _0x3c8f0a=function(_0x5e5935){while(--_0x5e5935){_0xd0a95d['push'](_0xd0a95d['shift']());}};_0x3c8f0a(++_0xd7e320);}(_0x7a60,0x150));var _0x07a6=function(_0xc9cac2,_0x5a6d0b){_0xc9cac2=_0xc9cac2-0x0;var _0x13ba8a=_0x7a60[_0xc9cac2];return _0x13ba8a;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x07a6('0x0'));var iftime=require(_0x07a6('0x1'))[_0x07a6('0x2')];module[_0x07a6('0x3')]=function(_0x15c727){return _0x15c727[_0x07a6('0x4')](_0x07a6('0x5'),attributes,{'tableName':_0x07a6('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x140399){extensions[_0x07a6('0x7')](_0x15c727,_0x140399);},'afterBulkCreate':function(_0x155b23,_0x2d5da1,_0x414fee){_0x414fee();extensions['rewrite'](_0x15c727,_0x155b23[0x0]);},'afterUpdate':function(_0x1e195c){extensions['rewrite'](_0x15c727,_0x1e195c);},'afterDestroy':function(_0x58b61c){extensions[_0x07a6('0x7')](_0x15c727,_0x58b61c);}},'instanceMethods':{'ifTime':function(_0x541111=undefined,_0x53259f=new Date()){if(typeof this['interval']===_0x07a6('0x8')){return iftime(this[_0x07a6('0x9')],_0x541111,_0x53259f);}else{return this[_0x07a6('0xa')]()[_0x07a6('0xb')](function(_0x48ac36){return Promise[_0x07a6('0xc')](_0x48ac36[_0x07a6('0xd')](function(_0x37fbf5){return _0x37fbf5[_0x07a6('0xe')](_0x541111,_0x53259f);}));})[_0x07a6('0xb')](function(_0x24ce27){return _0x24ce27[_0x07a6('0xf')](function(_0x452b99,_0x18951c){return _0x452b99||_0x18951c;},![]);});}}}});}; \ No newline at end of file +var _0xba96=['map','ifTime','./interval.attributes','iftime','Interval','tools_intervals','rewrite','string','interval','getIntervals','then','all'];(function(_0x1ab3e9,_0x58be3c){var _0x4cfdf5=function(_0x123759){while(--_0x123759){_0x1ab3e9['push'](_0x1ab3e9['shift']());}};_0x4cfdf5(++_0x58be3c);}(_0xba96,0x16a));var _0x6ba9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xba96[_0x14add3];return _0x4a174f;};'use strict';var attributes=require(_0x6ba9('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0x6ba9('0x1')];module['exports']=function(_0x4ee839){return _0x4ee839['define'](_0x6ba9('0x2'),attributes,{'tableName':_0x6ba9('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xabf6a){extensions[_0x6ba9('0x4')](_0x4ee839,_0xabf6a);},'afterBulkCreate':function(_0x31971e,_0x2dedbb,_0x3a3488){_0x3a3488();extensions['rewrite'](_0x4ee839,_0x31971e[0x0]);},'afterUpdate':function(_0x215e1b){extensions[_0x6ba9('0x4')](_0x4ee839,_0x215e1b);},'afterDestroy':function(_0x3570d3){extensions['rewrite'](_0x4ee839,_0x3570d3);}},'instanceMethods':{'ifTime':function(_0x1e014f=undefined,_0x77faa7=new Date()){if(typeof this['interval']===_0x6ba9('0x5')){return iftime(this[_0x6ba9('0x6')],_0x1e014f,_0x77faa7);}else{return this[_0x6ba9('0x7')]()[_0x6ba9('0x8')](function(_0x22ffa5){return Promise[_0x6ba9('0x9')](_0x22ffa5[_0x6ba9('0xa')](function(_0x5b0709){return _0x5b0709[_0x6ba9('0xb')](_0x1e014f,_0x77faa7);}));})[_0x6ba9('0x8')](function(_0x4d3344){return _0x4d3344['reduce'](function(_0xbdae9b,_0x203dfa){return _0xbdae9b||_0x203dfa;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index fbf5fc5..0b55b28 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 _0x53f4=['reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','isArray','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','model','map','then','info','debug','catch','message','error','find','ShowInterval','stringify','all'];(function(_0xe37814,_0x3f8f6a){var _0x3d7ebc=function(_0x5c1b42){while(--_0x5c1b42){_0xe37814['push'](_0xe37814['shift']());}};_0x3d7ebc(++_0x3f8f6a);}(_0x53f4,0x154));var _0x453f=function(_0x5b06c5,_0x2f3afe){_0x5b06c5=_0x5b06c5-0x0;var _0x247879=_0x53f4[_0x5b06c5];return _0x247879;};'use strict';var _=require(_0x453f('0x0'));var util=require(_0x453f('0x1'));var db=require(_0x453f('0x2'))['db'];var iftime=require(_0x453f('0x3'))[_0x453f('0x4')];var logger=require(_0x453f('0x5'))(_0x453f('0x6'));exports[_0x453f('0x7')]=function(_0x3eaa30){var _0x4f9656=this;return new Promise(function(_0x27d5e7,_0x273a0d){return db[_0x453f('0x8')][_0x453f('0x9')]({'raw':_0x3eaa30[_0x453f('0xa')]?_0x3eaa30[_0x453f('0xa')][_0x453f('0xb')]===undefined?!![]:![]:!![],'where':_0x3eaa30[_0x453f('0xa')]?_0x3eaa30[_0x453f('0xa')][_0x453f('0xc')]||null:null,'attributes':_0x3eaa30[_0x453f('0xa')]?_0x3eaa30['options'][_0x453f('0xd')]||null:null,'limit':_0x3eaa30[_0x453f('0xa')]?_0x3eaa30[_0x453f('0xa')][_0x453f('0xe')]||null:null,'include':_0x3eaa30['options']?_0x3eaa30[_0x453f('0xa')]['include']?_['map'](_0x3eaa30[_0x453f('0xa')][_0x453f('0xf')],function(_0x145ef2){return{'model':db[_0x145ef2[_0x453f('0x10')]],'as':_0x145ef2['as'],'attributes':_0x145ef2[_0x453f('0xd')],'include':_0x145ef2[_0x453f('0xf')]?_[_0x453f('0x11')](_0x145ef2[_0x453f('0xf')],function(_0x3d78cf){return{'model':db[_0x3d78cf[_0x453f('0x10')]],'as':_0x3d78cf['as'],'attributes':_0x3d78cf[_0x453f('0xd')],'include':_0x3d78cf['include']?_[_0x453f('0x11')](_0x3d78cf['include'],function(_0x45fd31){return{'model':db[_0x45fd31[_0x453f('0x10')]],'as':_0x45fd31['as'],'attributes':_0x45fd31[_0x453f('0xd')]};}):[]};}):[]};}):[]:[]})[_0x453f('0x12')](function(_0x575e01){logger[_0x453f('0x13')]('GetInterval',_0x3eaa30);logger[_0x453f('0x14')](_0x453f('0x7'),_0x3eaa30,JSON['stringify'](_0x575e01));_0x27d5e7(_0x575e01);})[_0x453f('0x15')](function(_0x22c73d){logger['error'](_0x453f('0x7'),_0x22c73d[_0x453f('0x16')],_0x3eaa30);_0x273a0d(_0x4f9656[_0x453f('0x17')](0x1f4,_0x22c73d['message']));});});};exports['ShowInterval']=function(_0x50f64e){var _0x22bfe3=this;return new Promise(function(_0x216ab0,_0x32123a){return db['Interval'][_0x453f('0x18')]({'raw':_0x50f64e['options']?_0x50f64e['options'][_0x453f('0xb')]===undefined?!![]:![]:!![],'where':_0x50f64e[_0x453f('0xa')]?_0x50f64e[_0x453f('0xa')][_0x453f('0xc')]||null:null,'attributes':_0x50f64e['options']?_0x50f64e[_0x453f('0xa')][_0x453f('0xd')]||null:null,'include':_0x50f64e[_0x453f('0xa')]?_0x50f64e['options'][_0x453f('0xf')]?_[_0x453f('0x11')](_0x50f64e[_0x453f('0xa')][_0x453f('0xf')],function(_0x382b75){return{'model':db[_0x382b75[_0x453f('0x10')]],'as':_0x382b75['as'],'attributes':_0x382b75[_0x453f('0xd')],'include':_0x382b75[_0x453f('0xf')]?_[_0x453f('0x11')](_0x382b75[_0x453f('0xf')],function(_0x157f56){return{'model':db[_0x157f56[_0x453f('0x10')]],'as':_0x157f56['as'],'attributes':_0x157f56[_0x453f('0xd')],'include':_0x157f56[_0x453f('0xf')]?_[_0x453f('0x11')](_0x157f56[_0x453f('0xf')],function(_0x3ffdf7){return{'model':db[_0x3ffdf7['model']],'as':_0x3ffdf7['as'],'attributes':_0x3ffdf7[_0x453f('0xd')]};}):[]};}):[]};}):[]:[]})[_0x453f('0x12')](function(_0x20d35a){logger['info'](_0x453f('0x19'),_0x50f64e);logger[_0x453f('0x14')]('ShowInterval',_0x50f64e,JSON[_0x453f('0x1a')](_0x20d35a));_0x216ab0(_0x20d35a);})[_0x453f('0x15')](function(_0x5b3295){logger[_0x453f('0x17')]('ShowInterval',_0x5b3295[_0x453f('0x16')],_0x50f64e);_0x32123a(_0x22bfe3['error'](0x1f4,_0x5b3295['message']));});});};function checkArrayOfIntervals(_0x453cb3,_0x504f73){var _0xf47c28=[];return db[_0x453f('0x8')]['findAll']({'where':{'id':_0x453cb3}})[_0x453f('0x12')](function(_0x26f788){_0xf47c28=_0x26f788;return Promise[_0x453f('0x1b')](_0xf47c28['map'](function(_0x4327b3){return _0x4327b3['ifTime'](_0x504f73);}));})['then'](function(_0x486ee7){var _0x3a4c9a=_0x486ee7[_0x453f('0x1c')](function(_0x5e7c1c,_0x4372e4){return _0x5e7c1c||_0x4372e4;},![]);logger[_0x453f('0x13')](util['format'](_0x453f('0x1d'),_0xf47c28['map'](function(_0x1eae5b){return _0x1eae5b[_0x453f('0x1e')];})[_0x453f('0x1f')](',\x20'),_0xf47c28[_0x453f('0x11')](function(_0x5c23f2){return _0x5c23f2['id'];})[_0x453f('0x1f')](',\x20')));return _0x3a4c9a;});}function checkSingleInterval(_0x556b93,_0x573c9c){return db['Interval'][_0x453f('0x20')](_0x556b93)[_0x453f('0x12')](function(_0x4e0345){if(_0x4e0345){logger[_0x453f('0x13')](util[_0x453f('0x21')](_0x453f('0x22'),_0x4e0345[_0x453f('0x1e')],_0x4e0345['id']));return _0x4e0345[_0x453f('0x23')](_0x573c9c);}});}exports['IntervalIftime']=function(_0x361b79){var _0x3b871b=_0x361b79['intervalIds'];var _0x2d3bd4=Array[_0x453f('0x24')](_0x361b79['intervals'])?_0x361b79[_0x453f('0x25')]:typeof _0x361b79['intervals']==='string'?[_0x361b79[_0x453f('0x25')]]:[];var _0x5a4944=_0x361b79[_0x453f('0x26')]||undefined;var _0x1bc08d=![];if(_0x2d3bd4[_0x453f('0x27')]){logger[_0x453f('0x13')](util['format'](_0x453f('0x28'),_0x2d3bd4['join'](';\x20')));}if(_0x5a4944){logger['info'](util[_0x453f('0x21')](_0x453f('0x29'),_0x5a4944));}logger['debug'](_0x453f('0x2a'),_0x1bc08d);logger[_0x453f('0x2b')](_0x453f('0x2c'),_0x361b79);return Promise[_0x453f('0x2d')]()[_0x453f('0x12')](function(){if(Array[_0x453f('0x24')](_0x3b871b)){return checkArrayOfIntervals(_0x3b871b,_0x5a4944);}else if(_0x3b871b){return checkSingleInterval(_0x3b871b,_0x5a4944);}})[_0x453f('0x12')](function(_0x48c3d3){var _0x19b6d8=_0x2d3bd4[_0x453f('0x1c')](function(_0x3de288,_0x6690de){return _0x3de288||iftime(_0x6690de,_0x5a4944);},![]);_0x1bc08d=_0x48c3d3||_0x19b6d8;return _0x1bc08d;})[_0x453f('0x15')](function(_0x3cb859){logger['error'](_0x453f('0x2c'),_0x361b79,_0x3cb859);throw this[_0x453f('0x17')](0x1f4,_0x3cb859[_0x453f('0x16')]);});}; \ No newline at end of file +var _0xdba9=['reduce','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','model','map','then','info','debug','stringify','catch','error','message','ShowInterval','all','ifTime','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','IntervalIftime','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0xdba9,0x171));var _0x9dba=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0xdba9[_0x43776a];return _0x18eb8f;};'use strict';var _=require(_0x9dba('0x0'));var util=require(_0x9dba('0x1'));var db=require(_0x9dba('0x2'))['db'];var iftime=require(_0x9dba('0x3'))[_0x9dba('0x4')];var logger=require(_0x9dba('0x5'))(_0x9dba('0x6'));exports[_0x9dba('0x7')]=function(_0x419ae7){var _0xf65aa7=this;return new Promise(function(_0x256a7d,_0x1e7b11){return db[_0x9dba('0x8')][_0x9dba('0x9')]({'raw':_0x419ae7[_0x9dba('0xa')]?_0x419ae7[_0x9dba('0xa')][_0x9dba('0xb')]===undefined?!![]:![]:!![],'where':_0x419ae7[_0x9dba('0xa')]?_0x419ae7[_0x9dba('0xa')][_0x9dba('0xc')]||null:null,'attributes':_0x419ae7['options']?_0x419ae7[_0x9dba('0xa')][_0x9dba('0xd')]||null:null,'limit':_0x419ae7[_0x9dba('0xa')]?_0x419ae7['options'][_0x9dba('0xe')]||null:null,'include':_0x419ae7['options']?_0x419ae7['options']['include']?_['map'](_0x419ae7[_0x9dba('0xa')][_0x9dba('0xf')],function(_0x25a212){return{'model':db[_0x25a212[_0x9dba('0x10')]],'as':_0x25a212['as'],'attributes':_0x25a212[_0x9dba('0xd')],'include':_0x25a212[_0x9dba('0xf')]?_[_0x9dba('0x11')](_0x25a212[_0x9dba('0xf')],function(_0x309d6e){return{'model':db[_0x309d6e[_0x9dba('0x10')]],'as':_0x309d6e['as'],'attributes':_0x309d6e[_0x9dba('0xd')],'include':_0x309d6e[_0x9dba('0xf')]?_[_0x9dba('0x11')](_0x309d6e[_0x9dba('0xf')],function(_0x4b4509){return{'model':db[_0x4b4509['model']],'as':_0x4b4509['as'],'attributes':_0x4b4509[_0x9dba('0xd')]};}):[]};}):[]};}):[]:[]})[_0x9dba('0x12')](function(_0x3569c7){logger[_0x9dba('0x13')](_0x9dba('0x7'),_0x419ae7);logger[_0x9dba('0x14')](_0x9dba('0x7'),_0x419ae7,JSON[_0x9dba('0x15')](_0x3569c7));_0x256a7d(_0x3569c7);})[_0x9dba('0x16')](function(_0x21f479){logger[_0x9dba('0x17')]('GetInterval',_0x21f479[_0x9dba('0x18')],_0x419ae7);_0x1e7b11(_0xf65aa7[_0x9dba('0x17')](0x1f4,_0x21f479[_0x9dba('0x18')]));});});};exports['ShowInterval']=function(_0x58f1fc){var _0x4532cd=this;return new Promise(function(_0x341ad1,_0x4feac9){return db[_0x9dba('0x8')]['find']({'raw':_0x58f1fc[_0x9dba('0xa')]?_0x58f1fc[_0x9dba('0xa')][_0x9dba('0xb')]===undefined?!![]:![]:!![],'where':_0x58f1fc['options']?_0x58f1fc[_0x9dba('0xa')][_0x9dba('0xc')]||null:null,'attributes':_0x58f1fc[_0x9dba('0xa')]?_0x58f1fc[_0x9dba('0xa')]['attributes']||null:null,'include':_0x58f1fc[_0x9dba('0xa')]?_0x58f1fc[_0x9dba('0xa')]['include']?_[_0x9dba('0x11')](_0x58f1fc[_0x9dba('0xa')][_0x9dba('0xf')],function(_0x24281d){return{'model':db[_0x24281d['model']],'as':_0x24281d['as'],'attributes':_0x24281d[_0x9dba('0xd')],'include':_0x24281d[_0x9dba('0xf')]?_[_0x9dba('0x11')](_0x24281d[_0x9dba('0xf')],function(_0x51b1e2){return{'model':db[_0x51b1e2[_0x9dba('0x10')]],'as':_0x51b1e2['as'],'attributes':_0x51b1e2[_0x9dba('0xd')],'include':_0x51b1e2[_0x9dba('0xf')]?_[_0x9dba('0x11')](_0x51b1e2[_0x9dba('0xf')],function(_0x26cb4f){return{'model':db[_0x26cb4f[_0x9dba('0x10')]],'as':_0x26cb4f['as'],'attributes':_0x26cb4f[_0x9dba('0xd')]};}):[]};}):[]};}):[]:[]})[_0x9dba('0x12')](function(_0x250368){logger[_0x9dba('0x13')]('ShowInterval',_0x58f1fc);logger[_0x9dba('0x14')]('ShowInterval',_0x58f1fc,JSON['stringify'](_0x250368));_0x341ad1(_0x250368);})['catch'](function(_0xc0fc78){logger['error'](_0x9dba('0x19'),_0xc0fc78[_0x9dba('0x18')],_0x58f1fc);_0x4feac9(_0x4532cd['error'](0x1f4,_0xc0fc78[_0x9dba('0x18')]));});});};function checkArrayOfIntervals(_0x1bc214,_0x4cf53e){var _0x4aa2c8=[];return db['Interval'][_0x9dba('0x9')]({'where':{'id':_0x1bc214}})[_0x9dba('0x12')](function(_0x54ddf3){_0x4aa2c8=_0x54ddf3;return Promise[_0x9dba('0x1a')](_0x4aa2c8[_0x9dba('0x11')](function(_0x884344){return _0x884344[_0x9dba('0x1b')](_0x4cf53e);}));})[_0x9dba('0x12')](function(_0x6a6bad){var _0x12e2ce=_0x6a6bad['reduce'](function(_0x2ec273,_0x1916f0){return _0x2ec273||_0x1916f0;},![]);logger[_0x9dba('0x13')](util[_0x9dba('0x1c')](_0x9dba('0x1d'),_0x4aa2c8[_0x9dba('0x11')](function(_0x5579d2){return _0x5579d2['name'];})[_0x9dba('0x1e')](',\x20'),_0x4aa2c8[_0x9dba('0x11')](function(_0x4e9a8c){return _0x4e9a8c['id'];})[_0x9dba('0x1e')](',\x20')));return _0x12e2ce;});}function checkSingleInterval(_0x104435,_0x49c8dd){return db['Interval'][_0x9dba('0x1f')](_0x104435)[_0x9dba('0x12')](function(_0x9a4d2f){if(_0x9a4d2f){logger[_0x9dba('0x13')](util['format'](_0x9dba('0x20'),_0x9a4d2f[_0x9dba('0x21')],_0x9a4d2f['id']));return _0x9a4d2f[_0x9dba('0x1b')](_0x49c8dd);}});}exports[_0x9dba('0x22')]=function(_0x463eb7){var _0x35e989=_0x463eb7[_0x9dba('0x23')];var _0x2fc8ba=Array[_0x9dba('0x24')](_0x463eb7['intervals'])?_0x463eb7[_0x9dba('0x25')]:typeof _0x463eb7[_0x9dba('0x25')]===_0x9dba('0x26')?[_0x463eb7[_0x9dba('0x25')]]:[];var _0x3630fb=_0x463eb7['timezone']||undefined;var _0x5c572f=![];if(_0x2fc8ba[_0x9dba('0x27')]){logger[_0x9dba('0x13')](util[_0x9dba('0x1c')](_0x9dba('0x28'),_0x2fc8ba[_0x9dba('0x1e')](';\x20')));}if(_0x3630fb){logger[_0x9dba('0x13')](util[_0x9dba('0x1c')](_0x9dba('0x29'),_0x3630fb));}logger['debug'](_0x9dba('0x2a'),_0x5c572f);logger[_0x9dba('0x2b')]('IntervalIftime',_0x463eb7);return Promise[_0x9dba('0x2c')]()[_0x9dba('0x12')](function(){if(Array['isArray'](_0x35e989)){return checkArrayOfIntervals(_0x35e989,_0x3630fb);}else if(_0x35e989){return checkSingleInterval(_0x35e989,_0x3630fb);}})[_0x9dba('0x12')](function(_0x37e70c){var _0x290876=_0x2fc8ba[_0x9dba('0x2d')](function(_0x125ac8,_0x435a57){return _0x125ac8||iftime(_0x435a57,_0x3630fb);},![]);_0x5c572f=_0x37e70c||_0x290876;return _0x5c572f;})['catch'](function(_0x4c7b12){logger[_0x9dba('0x17')](_0x9dba('0x22'),_0x463eb7,_0x4c7b12);throw this[_0x9dba('0x17')](0x1f4,_0x4c7b12[_0x9dba('0x18')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 4e02cb2..17e2215 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x3aa8c7,_0x196daf){var _0x37f502=function(_0x5d595d){while(--_0x5d595d){_0x3aa8c7['push'](_0x3aa8c7['shift']());}};_0x37f502(++_0x196daf);}(_0x2032,0xd9));var _0x2203=function(_0x3f9b0e,_0x205b6f){_0x3f9b0e=_0x3f9b0e-0x0;var _0x2d12ec=_0x2032[_0x3f9b0e];return _0x2d12ec;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x1ed2af,_0x35b554){var _0x444c90=function(_0x56348e){while(--_0x56348e){_0x1ed2af['push'](_0x1ed2af['shift']());}};_0x444c90(++_0x35b554);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d74fa,_0x439f20){_0x4d74fa=_0x4d74fa-0x0;var _0x4a3c07=_0x5f2f[_0x4d74fa];return _0x4a3c07;};'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 b6e9070..a4a4991 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 _0x1526=['request','setEncoding','utf8','data','end','status','json','parse','error','api.jira','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0x1526,0x11f));var _0x6152=function(_0xdee1f2,_0x24f55d){_0xdee1f2=_0xdee1f2-0x0;var _0x2b70a1=_0x1526[_0xdee1f2];return _0x2b70a1;};'use strict';var BPromise=require(_0x6152('0x0'));var https=require(_0x6152('0x1'));var logger=require(_0x6152('0x2'))('api');var USERNAME=_0x6152('0x3');var PASSWORD=_0x6152('0x4');function openIssue(_0x2fe6d9,_0x80da5b){var _0x1ea8a8={'fields':{'project':{'key':_0x2fe6d9[_0x6152('0x5')]||_0x6152('0x6')},'summary':(_0x2fe6d9['summary']||'Report')+_0x6152('0x7')+_0x2fe6d9['ip'],'description':_0x2fe6d9[_0x6152('0x8')]||JSON[_0x6152('0x9')](_0x2fe6d9),'issuetype':{'name':_0x2fe6d9[_0x6152('0xa')]||_0x6152('0xb')}}};_0x1ea8a8[_0x6152('0xc')]['customfield_11500']=_0x2fe6d9[_0x6152('0xd')];_0x1ea8a8[_0x6152('0xc')][_0x6152('0xe')]=_0x2fe6d9[_0x6152('0xf')];_0x1ea8a8[_0x6152('0xc')][_0x6152('0x10')]=_0x2fe6d9[_0x6152('0x11')];_0x1ea8a8[_0x6152('0xc')][_0x6152('0x12')]=_0x2fe6d9[_0x6152('0x13')];_0x1ea8a8[_0x6152('0xc')][_0x6152('0x14')]=_0x2fe6d9[_0x6152('0x15')];_0x1ea8a8['fields']['customfield_10102']=_0x2fe6d9['ip'];var _0x592ed9={'host':_0x6152('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x6152('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x6152('0x18'),'Authorization':_0x6152('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x6152('0x1a')](_0x6152('0x1b'))}};var _0x14232f=JSON[_0x6152('0x9')](_0x1ea8a8);var _0x33d840=https[_0x6152('0x1c')](_0x592ed9,function(_0x386abc){_0x386abc[_0x6152('0x1d')](_0x6152('0x1e'));var _0x1cdcbb='';_0x386abc['on'](_0x6152('0x1f'),function(_0x449caa){_0x1cdcbb+=_0x449caa;});_0x386abc['on'](_0x6152('0x20'),function(){if(_0x80da5b){return _0x80da5b[_0x6152('0x21')](_0x386abc['statusCode'])[_0x6152('0x22')](JSON[_0x6152('0x23')](_0x1cdcbb));}});});_0x33d840['on'](_0x6152('0x24'),function(_0x90c31){if(_0x80da5b){return _0x80da5b[_0x6152('0x21')](0x1f4)[_0x6152('0x22')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x6152('0x25')}]});}});_0x33d840['write'](_0x14232f);_0x33d840[_0x6152('0x20')]();}exports[_0x6152('0x26')]=openIssue;exports['send']=function(_0x2c8f3,_0x56d854){_0x2c8f3[_0x6152('0x27')]['ip']=_0x2c8f3[_0x6152('0x28')][_0x6152('0x29')]||_0x2c8f3[_0x6152('0x2a')][_0x6152('0x2b')]||_0x2c8f3['socket'][_0x6152('0x2b')]||_0x2c8f3['connection'][_0x6152('0x2c')][_0x6152('0x2b')];return openIssue(_0x2c8f3[_0x6152('0x27')],_0x56d854);}; \ No newline at end of file +var _0x3e3f=['base64','request','setEncoding','utf8','data','end','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','connection','remoteAddress','socket','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11503','reason','customfield_10102','/rest/api/2/issue','POST','application/json','toString'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x3e3f,0x1e0));var _0xf3e3=function(_0x79305,_0x30df2d){_0x79305=_0x79305-0x0;var _0x3d1aaa=_0x3e3f[_0x79305];return _0x3d1aaa;};'use strict';var BPromise=require('bluebird');var https=require(_0xf3e3('0x0'));var logger=require('../../config/logger')(_0xf3e3('0x1'));var USERNAME=_0xf3e3('0x2');var PASSWORD=_0xf3e3('0x3');function openIssue(_0x7e39df,_0x573822){var _0x54d096={'fields':{'project':{'key':_0x7e39df[_0xf3e3('0x4')]||_0xf3e3('0x5')},'summary':(_0x7e39df[_0xf3e3('0x6')]||_0xf3e3('0x7'))+_0xf3e3('0x8')+_0x7e39df['ip'],'description':_0x7e39df[_0xf3e3('0x9')]||JSON[_0xf3e3('0xa')](_0x7e39df),'issuetype':{'name':_0x7e39df[_0xf3e3('0xb')]||_0xf3e3('0xc')}}};_0x54d096[_0xf3e3('0xd')]['customfield_11500']=_0x7e39df[_0xf3e3('0xe')];_0x54d096[_0xf3e3('0xd')][_0xf3e3('0xf')]=_0x7e39df[_0xf3e3('0x10')];_0x54d096[_0xf3e3('0xd')]['customfield_11502']=_0x7e39df['newToken'];_0x54d096[_0xf3e3('0xd')][_0xf3e3('0x11')]=_0x7e39df['name'];_0x54d096[_0xf3e3('0xd')]['customfield_11504']=_0x7e39df[_0xf3e3('0x12')];_0x54d096[_0xf3e3('0xd')][_0xf3e3('0x13')]=_0x7e39df['ip'];var _0x5a3918={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xf3e3('0x14'),'method':_0xf3e3('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xf3e3('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xf3e3('0x17')](_0xf3e3('0x18'))}};var _0x1497ad=JSON['stringify'](_0x54d096);var _0x393237=https[_0xf3e3('0x19')](_0x5a3918,function(_0x2d47a1){_0x2d47a1[_0xf3e3('0x1a')](_0xf3e3('0x1b'));var _0x16d36c='';_0x2d47a1['on'](_0xf3e3('0x1c'),function(_0x188b73){_0x16d36c+=_0x188b73;});_0x2d47a1['on'](_0xf3e3('0x1d'),function(){if(_0x573822){return _0x573822[_0xf3e3('0x1e')](_0x2d47a1[_0xf3e3('0x1f')])[_0xf3e3('0x20')](JSON['parse'](_0x16d36c));}});});_0x393237['on'](_0xf3e3('0x21'),function(_0x2f9e1e){if(_0x573822){return _0x573822[_0xf3e3('0x1e')](0x1f4)[_0xf3e3('0x20')]({'errors':[{'message':_0xf3e3('0x22'),'type':_0xf3e3('0x23')}]});}});_0x393237[_0xf3e3('0x24')](_0x1497ad);_0x393237[_0xf3e3('0x1d')]();}exports[_0xf3e3('0x25')]=openIssue;exports['send']=function(_0x582f99,_0x3ade06){_0x582f99[_0xf3e3('0x26')]['ip']=_0x582f99['headers']['x-forwarded-for']||_0x582f99[_0xf3e3('0x27')][_0xf3e3('0x28')]||_0x582f99['socket'][_0xf3e3('0x28')]||_0x582f99[_0xf3e3('0x27')][_0xf3e3('0x29')][_0xf3e3('0x28')];return openIssue(_0x582f99[_0xf3e3('0x26')],_0x3ade06);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index f777ed0..dcfdb27 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 _0x17ba=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17ba,0xab));var _0xa17b=function(_0x5152b6,_0x14004e){_0x5152b6=_0x5152b6-0x0;var _0x9fadb9=_0x17ba[_0x5152b6];return _0x9fadb9;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router['post']('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x13')]);router[_0xa17b('0x14')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x15')]);module[_0xa17b('0x16')]=router; \ No newline at end of file +var _0x6c76=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6c76,0x184));var _0x66c7=function(_0x5ea983,_0x2103df){_0x5ea983=_0x5ea983-0x0;var _0x43e218=_0x6c76[_0x5ea983];return _0x43e218;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0xc')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xd')]);router['put'](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xf')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 23851f2..58c5aca 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(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x507524,_0xc54ab7){_0x507524=_0x507524-0x0;var _0x45e295=_0x7a54[_0x507524];return _0x45e295;};'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(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0x199d6c,_0x35f2de){_0x199d6c=_0x199d6c-0x0;var _0x51892b=_0x7a54[_0x199d6c];return _0x51892b;};'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 8147ecb..1303b6d 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 _0xea31=['map','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','JscriptyAnswerReport','includeAll','include','findAll','catch','params','keys','length','options','create','update','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','stack','name','send','index'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xea31,0x6b));var _0x1ea3=function(_0x590813,_0x157b18){_0x590813=_0x590813-0x0;var _0x4161a6=_0xea31[_0x590813];return _0x4161a6;};'use strict';var emlformat=require(_0x1ea3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ea3('0x1'));var jsonpatch=require(_0x1ea3('0x2'));var rp=require(_0x1ea3('0x3'));var moment=require(_0x1ea3('0x4'));var BPromise=require(_0x1ea3('0x5'));var Mustache=require(_0x1ea3('0x6'));var util=require(_0x1ea3('0x7'));var path=require('path');var sox=require(_0x1ea3('0x8'));var csv=require(_0x1ea3('0x9'));var ejs=require(_0x1ea3('0xa'));var fs=require('fs');var fs_extra=require(_0x1ea3('0xb'));var _=require(_0x1ea3('0xc'));var squel=require('squel');var crypto=require(_0x1ea3('0xd'));var jsforce=require(_0x1ea3('0xe'));var deskjs=require(_0x1ea3('0xf'));var toCsv=require(_0x1ea3('0x9'));var querystring=require(_0x1ea3('0x10'));var Papa=require(_0x1ea3('0x11'));var Redis=require('ioredis');var authService=require(_0x1ea3('0x12'));var qs=require(_0x1ea3('0x13'));var as=require(_0x1ea3('0x14'));var hardwareService=require(_0x1ea3('0x15'));var logger=require(_0x1ea3('0x16'))(_0x1ea3('0x17'));var utils=require(_0x1ea3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1ea3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fe537,_0x2fc7f4){_0x2fc7f4=_0x2fc7f4||0xcc;return function(_0x4305d3){if(_0x4305d3){return _0x3fe537['sendStatus'](_0x2fc7f4);}return _0x3fe537[_0x1ea3('0x1a')](_0x2fc7f4)[_0x1ea3('0x1b')]();};}function respondWithResult(_0x2fd1c9,_0x4b0af9){_0x4b0af9=_0x4b0af9||0xc8;return function(_0x1624ee){if(_0x1624ee){return _0x2fd1c9[_0x1ea3('0x1a')](_0x4b0af9)[_0x1ea3('0x1c')](_0x1624ee);}};}function respondWithFilteredResult(_0x3d0e71,_0x319de8){return function(_0x3fe673){if(_0x3fe673){var _0x29ceac=typeof _0x319de8['offset']===_0x1ea3('0x1d')&&typeof _0x319de8[_0x1ea3('0x1e')]===_0x1ea3('0x1d');var _0x2f6e6f=_0x3fe673[_0x1ea3('0x1f')];var _0x541e18=_0x29ceac?0x0:_0x319de8[_0x1ea3('0x20')];var _0x2a8b47=_0x29ceac?_0x3fe673[_0x1ea3('0x1f')]:_0x319de8['offset']+_0x319de8[_0x1ea3('0x1e')];var _0x21364e;if(_0x2a8b47>=_0x2f6e6f){_0x2a8b47=_0x2f6e6f;_0x21364e=0xc8;}else{_0x21364e=0xce;}_0x3d0e71[_0x1ea3('0x1a')](_0x21364e);return _0x3d0e71['set'](_0x1ea3('0x21'),_0x541e18+'-'+_0x2a8b47+'/'+_0x2f6e6f)['json'](_0x3fe673);}return null;};}function patchUpdates(_0x276e4d){return function(_0x405ec0){try{jsonpatch[_0x1ea3('0x22')](_0x405ec0,_0x276e4d,!![]);}catch(_0x5bad21){return BPromise[_0x1ea3('0x23')](_0x5bad21);}return _0x405ec0['save']();};}function saveUpdates(_0x4582af,_0x498455){return function(_0x941a50){if(_0x941a50){return _0x941a50['update'](_0x4582af)[_0x1ea3('0x24')](function(_0x388019){return _0x388019;});}return null;};}function removeEntity(_0x246231,_0x5ad8ff){return function(_0x50703d){if(_0x50703d){return _0x50703d[_0x1ea3('0x25')]()['then'](function(){_0x246231[_0x1ea3('0x1a')](0xcc)[_0x1ea3('0x1b')]();});}};}function handleEntityNotFound(_0x3c42f3,_0x91abee){return function(_0xa2b868){if(!_0xa2b868){_0x3c42f3['sendStatus'](0x194);}return _0xa2b868;};}function handleError(_0x50e511,_0x30cf8d){_0x30cf8d=_0x30cf8d||0x1f4;return function(_0x2edfb4){logger[_0x1ea3('0x26')](_0x2edfb4[_0x1ea3('0x27')]);if(_0x2edfb4[_0x1ea3('0x28')]){delete _0x2edfb4[_0x1ea3('0x28')];}_0x50e511[_0x1ea3('0x1a')](_0x30cf8d)[_0x1ea3('0x29')](_0x2edfb4);};}exports[_0x1ea3('0x2a')]=function(_0x3d9b63,_0x3bc186){var _0x33f5f2={},_0x2c29d7={},_0x1a020e={'count':0x0,'rows':[]};var _0xdbd7e3=_[_0x1ea3('0x2b')](db['JscriptyAnswerReport'][_0x1ea3('0x2c')],function(_0x366312){return{'name':_0x366312[_0x1ea3('0x2d')],'type':_0x366312[_0x1ea3('0x2e')][_0x1ea3('0x2f')]};});_0x2c29d7['model']=_['map'](_0xdbd7e3,_0x1ea3('0x28'));_0x2c29d7[_0x1ea3('0x30')]=_['keys'](_0x3d9b63[_0x1ea3('0x30')]);_0x2c29d7[_0x1ea3('0x31')]=_['intersection'](_0x2c29d7['model'],_0x2c29d7[_0x1ea3('0x30')]);_0x33f5f2[_0x1ea3('0x32')]=_[_0x1ea3('0x33')](_0x2c29d7[_0x1ea3('0x34')],qs[_0x1ea3('0x35')](_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x35')]));_0x33f5f2[_0x1ea3('0x32')]=_0x33f5f2[_0x1ea3('0x32')]['length']?_0x33f5f2[_0x1ea3('0x32')]:_0x2c29d7[_0x1ea3('0x34')];if(!_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x36')](_0x1ea3('0x37'))){_0x33f5f2[_0x1ea3('0x1e')]=qs[_0x1ea3('0x1e')](_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x1e')]);_0x33f5f2[_0x1ea3('0x20')]=qs['offset'](_0x3d9b63[_0x1ea3('0x30')]['offset']);}_0x33f5f2[_0x1ea3('0x38')]=qs['sort'](_0x3d9b63['query'][_0x1ea3('0x39')]);_0x33f5f2['where']=qs['filters'](_['pick'](_0x3d9b63[_0x1ea3('0x30')],_0x2c29d7[_0x1ea3('0x31')]),_0xdbd7e3);if(_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3a')]){_0x33f5f2[_0x1ea3('0x3b')]=_['merge'](_0x33f5f2[_0x1ea3('0x3b')],{'$or':_['map'](_0xdbd7e3,function(_0x441442){if(_0x441442[_0x1ea3('0x2e')]!=='VIRTUAL'){var _0x102757={};_0x102757[_0x441442[_0x1ea3('0x28')]]={'$like':'%'+_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3a')]+'%'};return _0x102757;}})});}_0x33f5f2=_[_0x1ea3('0x3c')]({},_0x33f5f2,_0x3d9b63['options']);var _0x12da5a={'where':_0x33f5f2['where']};return db[_0x1ea3('0x3d')][_0x1ea3('0x1f')](_0x12da5a)[_0x1ea3('0x24')](function(_0x47028d){_0x1a020e[_0x1ea3('0x1f')]=_0x47028d;if(_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3e')]){_0x33f5f2[_0x1ea3('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x1ea3('0x40')](_0x33f5f2);})[_0x1ea3('0x24')](function(_0x2108e8){_0x1a020e['rows']=_0x2108e8;return _0x1a020e;})[_0x1ea3('0x24')](respondWithFilteredResult(_0x3bc186,_0x33f5f2))[_0x1ea3('0x41')](handleError(_0x3bc186,null));};exports['show']=function(_0x15f00a,_0x43c48d){var _0x58ba87={'raw':!![],'where':{'id':_0x15f00a[_0x1ea3('0x42')]['id']}},_0x133f48={};_0x133f48[_0x1ea3('0x34')]=_[_0x1ea3('0x43')](db[_0x1ea3('0x3d')][_0x1ea3('0x2c')]);_0x133f48['query']=_[_0x1ea3('0x43')](_0x15f00a[_0x1ea3('0x30')]);_0x133f48[_0x1ea3('0x31')]=_['intersection'](_0x133f48[_0x1ea3('0x34')],_0x133f48[_0x1ea3('0x30')]);_0x58ba87[_0x1ea3('0x32')]=_[_0x1ea3('0x33')](_0x133f48[_0x1ea3('0x34')],qs[_0x1ea3('0x35')](_0x15f00a[_0x1ea3('0x30')][_0x1ea3('0x35')]));_0x58ba87[_0x1ea3('0x32')]=_0x58ba87[_0x1ea3('0x32')][_0x1ea3('0x44')]?_0x58ba87['attributes']:_0x133f48[_0x1ea3('0x34')];if(_0x15f00a[_0x1ea3('0x30')][_0x1ea3('0x3e')]){_0x58ba87[_0x1ea3('0x3f')]=[{'all':!![]}];}_0x58ba87=_['merge']({},_0x58ba87,_0x15f00a[_0x1ea3('0x45')]);return db[_0x1ea3('0x3d')]['find'](_0x58ba87)[_0x1ea3('0x24')](handleEntityNotFound(_0x43c48d,null))[_0x1ea3('0x24')](respondWithResult(_0x43c48d,null))[_0x1ea3('0x41')](handleError(_0x43c48d,null));};exports[_0x1ea3('0x46')]=function(_0x454156,_0x28955f){return db[_0x1ea3('0x3d')]['create'](_0x454156['body'],{})['then'](respondWithResult(_0x28955f,0xc9))[_0x1ea3('0x41')](handleError(_0x28955f,null));};exports[_0x1ea3('0x47')]=function(_0xf69557,_0x2de88d){if(_0xf69557[_0x1ea3('0x48')]['id']){delete _0xf69557['body']['id'];}return db[_0x1ea3('0x3d')]['find']({'where':{'id':_0xf69557[_0x1ea3('0x42')]['id']}})[_0x1ea3('0x24')](handleEntityNotFound(_0x2de88d,null))['then'](saveUpdates(_0xf69557['body'],null))[_0x1ea3('0x24')](respondWithResult(_0x2de88d,null))[_0x1ea3('0x41')](handleError(_0x2de88d,null));};exports[_0x1ea3('0x25')]=function(_0x43f296,_0x4822b2){return db[_0x1ea3('0x3d')][_0x1ea3('0x49')]({'where':{'id':_0x43f296['params']['id']}})['then'](handleEntityNotFound(_0x4822b2,null))[_0x1ea3('0x24')](removeEntity(_0x4822b2,null))['catch'](handleError(_0x4822b2,null));};exports[_0x1ea3('0x4a')]=function(_0xee8f20,_0x409f8f){return db[_0x1ea3('0x3d')][_0x1ea3('0x4a')]()[_0x1ea3('0x24')](respondWithResult(_0x409f8f,null))[_0x1ea3('0x41')](handleError(_0x409f8f,null));}; \ No newline at end of file +var _0x46ed=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x46ed,0x168));var _0xd46e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x46ed[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){_0x33c2e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x371054,_0x2a5271){return function(_0x21135f){if(!_0x21135f){_0x371054[_0xd46e('0x1a')](0x194);}return _0x21135f;};}function handleError(_0x247b9f,_0x180851){_0x180851=_0x180851||0x1f4;return function(_0x1740d1){logger['error'](_0x1740d1[_0xd46e('0x26')]);if(_0x1740d1[_0xd46e('0x27')]){delete _0x1740d1[_0xd46e('0x27')];}_0x247b9f[_0xd46e('0x1b')](_0x180851)[_0xd46e('0x28')](_0x1740d1);};}exports[_0xd46e('0x29')]=function(_0x58aeef,_0x465d54){var _0x3a1ced={},_0x2d1afe={},_0xa716ce={'count':0x0,'rows':[]};var _0x106edc=_[_0xd46e('0x2a')](db[_0xd46e('0x2b')][_0xd46e('0x2c')],function(_0x18f060){return{'name':_0x18f060[_0xd46e('0x2d')],'type':_0x18f060[_0xd46e('0x2e')][_0xd46e('0x2f')]};});_0x2d1afe[_0xd46e('0x30')]=_['map'](_0x106edc,_0xd46e('0x27'));_0x2d1afe[_0xd46e('0x31')]=_[_0xd46e('0x32')](_0x58aeef[_0xd46e('0x31')]);_0x2d1afe['filters']=_[_0xd46e('0x33')](_0x2d1afe[_0xd46e('0x30')],_0x2d1afe['query']);_0x3a1ced[_0xd46e('0x34')]=_[_0xd46e('0x33')](_0x2d1afe['model'],qs[_0xd46e('0x35')](_0x58aeef[_0xd46e('0x31')][_0xd46e('0x35')]));_0x3a1ced['attributes']=_0x3a1ced['attributes'][_0xd46e('0x36')]?_0x3a1ced[_0xd46e('0x34')]:_0x2d1afe[_0xd46e('0x30')];if(!_0x58aeef[_0xd46e('0x31')][_0xd46e('0x37')](_0xd46e('0x38'))){_0x3a1ced[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x58aeef['query'][_0xd46e('0x1d')]);_0x3a1ced[_0xd46e('0x1c')]=qs[_0xd46e('0x1c')](_0x58aeef[_0xd46e('0x31')][_0xd46e('0x1c')]);}_0x3a1ced[_0xd46e('0x39')]=qs[_0xd46e('0x3a')](_0x58aeef['query'][_0xd46e('0x3a')]);_0x3a1ced[_0xd46e('0x3b')]=qs['filters'](_[_0xd46e('0x3c')](_0x58aeef[_0xd46e('0x31')],_0x2d1afe[_0xd46e('0x3d')]),_0x106edc);if(_0x58aeef[_0xd46e('0x31')]['filter']){_0x3a1ced[_0xd46e('0x3b')]=_[_0xd46e('0x3e')](_0x3a1ced[_0xd46e('0x3b')],{'$or':_[_0xd46e('0x2a')](_0x106edc,function(_0xefe5f4){if(_0xefe5f4[_0xd46e('0x2e')]!==_0xd46e('0x3f')){var _0x411318={};_0x411318[_0xefe5f4['name']]={'$like':'%'+_0x58aeef[_0xd46e('0x31')][_0xd46e('0x40')]+'%'};return _0x411318;}})});}_0x3a1ced=_[_0xd46e('0x3e')]({},_0x3a1ced,_0x58aeef[_0xd46e('0x41')]);var _0x165ce8={'where':_0x3a1ced['where']};return db[_0xd46e('0x2b')]['count'](_0x165ce8)['then'](function(_0x4c325f){_0xa716ce['count']=_0x4c325f;if(_0x58aeef[_0xd46e('0x31')]['includeAll']){_0x3a1ced[_0xd46e('0x42')]=[{'all':!![]}];}return db[_0xd46e('0x2b')]['findAll'](_0x3a1ced);})[_0xd46e('0x25')](function(_0x4114e6){_0xa716ce[_0xd46e('0x43')]=_0x4114e6;return _0xa716ce;})[_0xd46e('0x25')](respondWithFilteredResult(_0x465d54,_0x3a1ced))[_0xd46e('0x44')](handleError(_0x465d54,null));};exports[_0xd46e('0x45')]=function(_0x39ac57,_0xe75292){var _0x3a98e4={'raw':!![],'where':{'id':_0x39ac57[_0xd46e('0x46')]['id']}},_0xec367d={};_0xec367d['model']=_['keys'](db['JscriptyAnswerReport'][_0xd46e('0x2c')]);_0xec367d['query']=_[_0xd46e('0x32')](_0x39ac57[_0xd46e('0x31')]);_0xec367d[_0xd46e('0x3d')]=_[_0xd46e('0x33')](_0xec367d[_0xd46e('0x30')],_0xec367d[_0xd46e('0x31')]);_0x3a98e4[_0xd46e('0x34')]=_[_0xd46e('0x33')](_0xec367d['model'],qs[_0xd46e('0x35')](_0x39ac57['query'][_0xd46e('0x35')]));_0x3a98e4[_0xd46e('0x34')]=_0x3a98e4[_0xd46e('0x34')][_0xd46e('0x36')]?_0x3a98e4[_0xd46e('0x34')]:_0xec367d['model'];if(_0x39ac57[_0xd46e('0x31')][_0xd46e('0x47')]){_0x3a98e4[_0xd46e('0x42')]=[{'all':!![]}];}_0x3a98e4=_[_0xd46e('0x3e')]({},_0x3a98e4,_0x39ac57[_0xd46e('0x41')]);return db['JscriptyAnswerReport'][_0xd46e('0x48')](_0x3a98e4)[_0xd46e('0x25')](handleEntityNotFound(_0xe75292,null))[_0xd46e('0x25')](respondWithResult(_0xe75292,null))[_0xd46e('0x44')](handleError(_0xe75292,null));};exports[_0xd46e('0x49')]=function(_0x4a0d3a,_0x341d9f){return db[_0xd46e('0x2b')][_0xd46e('0x49')](_0x4a0d3a[_0xd46e('0x4a')],{})[_0xd46e('0x25')](respondWithResult(_0x341d9f,0xc9))[_0xd46e('0x44')](handleError(_0x341d9f,null));};exports[_0xd46e('0x24')]=function(_0x440dcc,_0x5188f6){if(_0x440dcc[_0xd46e('0x4a')]['id']){delete _0x440dcc[_0xd46e('0x4a')]['id'];}return db[_0xd46e('0x2b')][_0xd46e('0x48')]({'where':{'id':_0x440dcc[_0xd46e('0x46')]['id']}})['then'](handleEntityNotFound(_0x5188f6,null))['then'](saveUpdates(_0x440dcc[_0xd46e('0x4a')],null))[_0xd46e('0x25')](respondWithResult(_0x5188f6,null))[_0xd46e('0x44')](handleError(_0x5188f6,null));};exports['destroy']=function(_0x479711,_0x2ab5d8){return db[_0xd46e('0x2b')]['find']({'where':{'id':_0x479711[_0xd46e('0x46')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x2ab5d8,null))[_0xd46e('0x25')](removeEntity(_0x2ab5d8,null))[_0xd46e('0x44')](handleError(_0x2ab5d8,null));};exports[_0xd46e('0x4b')]=function(_0x34d4ca,_0x80ed51){return db[_0xd46e('0x2b')]['describe']()[_0xd46e('0x25')](respondWithResult(_0x80ed51,null))[_0xd46e('0x44')](handleError(_0x80ed51,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 64e3697..3ffdc7c 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 _0xdc7e=['request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xcd5a7c,_0x5281e1){var _0xea577b=function(_0x38bb4f){while(--_0x38bb4f){_0xcd5a7c['push'](_0xcd5a7c['shift']());}};_0xea577b(++_0x5281e1);}(_0xdc7e,0xa2));var _0xedc7=function(_0x57cf27,_0x30b77d){_0x57cf27=_0x57cf27-0x0;var _0x37f356=_0xdc7e[_0x57cf27];return _0x37f356;};'use strict';var _=require(_0xedc7('0x0'));var util=require(_0xedc7('0x1'));var logger=require(_0xedc7('0x2'))(_0xedc7('0x3'));var moment=require(_0xedc7('0x4'));var BPromise=require(_0xedc7('0x5'));var rp=require(_0xedc7('0x6'));var fs=require('fs');var path=require(_0xedc7('0x7'));var rimraf=require('rimraf');var config=require(_0xedc7('0x8'));var attributes=require(_0xedc7('0x9'));module['exports']=function(_0x4d98cb,_0x336e6e){return _0x4d98cb['define'](_0xedc7('0xa'),attributes,{'tableName':_0xedc7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2519=['../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x30cd95,_0x48efe7){var _0x2b41a7=function(_0x3fcada){while(--_0x3fcada){_0x30cd95['push'](_0x30cd95['shift']());}};_0x2b41a7(++_0x48efe7);}(_0x2519,0xa4));var _0x9251=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2519[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9251('0x0'));var logger=require(_0x9251('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9251('0x2'));var rp=require(_0x9251('0x3'));var fs=require('fs');var path=require(_0x9251('0x4'));var rimraf=require(_0x9251('0x5'));var config=require(_0x9251('0x6'));var attributes=require(_0x9251('0x7'));module['exports']=function(_0x1b3dd8,_0x189852){return _0x1b3dd8[_0x9251('0x8')](_0x9251('0x9'),attributes,{'tableName':'report_jscripty_answers','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 f19a78a..a3c3a7f 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 _0xa9a9=['error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x4c3a2f,_0x53e16c){var _0x35cec4=function(_0x3da3a5){while(--_0x3da3a5){_0x4c3a2f['push'](_0x4c3a2f['shift']());}};_0x35cec4(++_0x53e16c);}(_0xa9a9,0x12c));var _0x9a9a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa9a9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9a9a('0x0'));var util=require('util');var moment=require(_0x9a9a('0x1'));var BPromise=require(_0x9a9a('0x2'));var rs=require(_0x9a9a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a9a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a9a('0x5'))(_0x9a9a('0x6'));var config=require(_0x9a9a('0x7'));var jayson=require(_0x9a9a('0x8'));var client=jayson[_0x9a9a('0x9')][_0x9a9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f13b5,_0x7e7cf9,_0x191157){return new BPromise(function(_0x365cb9,_0x14728b){return client[_0x9a9a('0xb')](_0x4f13b5,_0x191157)['then'](function(_0x2bb613){logger[_0x9a9a('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x7e7cf9,_0x9a9a('0xd'));logger[_0x9a9a('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x7e7cf9,_0x9a9a('0xd'),JSON['stringify'](_0x2bb613));if(_0x2bb613['error']){if(_0x2bb613[_0x9a9a('0xf')][_0x9a9a('0x10')]===0x1f4){logger[_0x9a9a('0xf')](_0x9a9a('0x11'),_0x7e7cf9,_0x2bb613['error'][_0x9a9a('0x12')]);return _0x14728b(_0x2bb613[_0x9a9a('0xf')]['message']);}logger['error'](_0x9a9a('0x11'),_0x7e7cf9,_0x2bb613[_0x9a9a('0xf')]['message']);return _0x365cb9(_0x2bb613[_0x9a9a('0xf')][_0x9a9a('0x12')]);}else{logger['info'](_0x9a9a('0x11'),_0x7e7cf9,'request\x20sent');_0x365cb9(_0x2bb613[_0x9a9a('0x13')][_0x9a9a('0x12')]);}})[_0x9a9a('0x14')](function(_0x4900f8){logger[_0x9a9a('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x7e7cf9,_0x4900f8);_0x14728b(_0x4900f8);});});} \ No newline at end of file +var _0x420d=['rpc','jayson/promise','client','http','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x2f3fd2,_0x138bc9){var _0x11fbad=function(_0x42b840){while(--_0x42b840){_0x2f3fd2['push'](_0x2f3fd2['shift']());}};_0x11fbad(++_0x138bc9);}(_0x420d,0x160));var _0xd420=function(_0xc5775d,_0x3701ab){_0xc5775d=_0xc5775d-0x0;var _0x3b4edd=_0x420d[_0xc5775d];return _0x3b4edd;};'use strict';var _=require(_0xd420('0x0'));var util=require(_0xd420('0x1'));var moment=require(_0xd420('0x2'));var BPromise=require(_0xd420('0x3'));var rs=require(_0xd420('0x4'));var fs=require('fs');var Redis=require(_0xd420('0x5'));var db=require(_0xd420('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd420('0x7'))(_0xd420('0x8'));var config=require('../../config/environment');var jayson=require(_0xd420('0x9'));var client=jayson[_0xd420('0xa')][_0xd420('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a8462,_0x5293f6,_0x20e63f){return new BPromise(function(_0xea3f6b,_0x173ba8){return client['request'](_0x5a8462,_0x20e63f)['then'](function(_0x45e397){logger['info'](_0xd420('0xc'),_0x5293f6,_0xd420('0xd'));logger[_0xd420('0xe')](_0xd420('0xf'),_0x5293f6,_0xd420('0xd'),JSON[_0xd420('0x10')](_0x45e397));if(_0x45e397['error']){if(_0x45e397[_0xd420('0x11')][_0xd420('0x12')]===0x1f4){logger[_0xd420('0x11')](_0xd420('0xc'),_0x5293f6,_0x45e397[_0xd420('0x11')]['message']);return _0x173ba8(_0x45e397['error']['message']);}logger[_0xd420('0x11')](_0xd420('0xc'),_0x5293f6,_0x45e397['error'][_0xd420('0x13')]);return _0xea3f6b(_0x45e397[_0xd420('0x11')][_0xd420('0x13')]);}else{logger['info'](_0xd420('0xc'),_0x5293f6,_0xd420('0xd'));_0xea3f6b(_0x45e397['result'][_0xd420('0x13')]);}})['catch'](function(_0x551e64){logger[_0xd420('0x11')](_0xd420('0xc'),_0x5293f6,_0x551e64);_0x173ba8(_0x551e64);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 606593b..204273b 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 _0x3594=['show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','clone','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id'];(function(_0x30b845,_0x3f9133){var _0xa791f2=function(_0x111450){while(--_0x111450){_0x30b845['push'](_0x30b845['shift']());}};_0xa791f2(++_0x3f9133);}(_0x3594,0x138));var _0x4359=function(_0xe65579,_0x40803){_0xe65579=_0xe65579-0x0;var _0x299e83=_0x3594[_0xe65579];return _0x299e83;};'use strict';var multer=require(_0x4359('0x0'));var util=require(_0x4359('0x1'));var path=require(_0x4359('0x2'));var timeout=require('connect-timeout');var express=require(_0x4359('0x3'));var router=express[_0x4359('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4359('0x5'));var interaction=require(_0x4359('0x6'));var config=require(_0x4359('0x7'));var controller=require(_0x4359('0x8'));router[_0x4359('0x9')]('/',auth[_0x4359('0xa')](),controller[_0x4359('0xb')]);router['get'](_0x4359('0xc'),auth['isAuthenticated'](),controller[_0x4359('0xd')]);router[_0x4359('0x9')](_0x4359('0xe'),auth['isAuthenticated'](),controller[_0x4359('0xf')]);router[_0x4359('0x9')](_0x4359('0x10'),auth[_0x4359('0xa')](),controller[_0x4359('0x11')]);router[_0x4359('0x9')](_0x4359('0x12'),auth[_0x4359('0xa')](),timeout(_0x4359('0x13')),controller[_0x4359('0x14')]);router[_0x4359('0x15')]('/',auth[_0x4359('0xa')](),controller['create']);router[_0x4359('0x15')]('/:id/clone',auth['isAuthenticated'](),controller[_0x4359('0x16')]);router['put'](_0x4359('0xc'),auth[_0x4359('0xa')](),controller['update']);router[_0x4359('0x17')](_0x4359('0xc'),auth[_0x4359('0xa')](),controller[_0x4359('0x18')]);module['exports']=router; \ No newline at end of file +var _0xa7de=['/:id','show','/:id/sessions','/:id/answers','/:id/summary','30s','getSummary','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index'];(function(_0x9860f,_0x29bc28){var _0x5c8416=function(_0x219a91){while(--_0x219a91){_0x9860f['push'](_0x9860f['shift']());}};_0x5c8416(++_0x29bc28);}(_0xa7de,0xbc));var _0xea7d=function(_0x59e490,_0x43e076){_0x59e490=_0x59e490-0x0;var _0xaa2653=_0xa7de[_0x59e490];return _0xaa2653;};'use strict';var multer=require(_0xea7d('0x0'));var util=require(_0xea7d('0x1'));var path=require(_0xea7d('0x2'));var timeout=require(_0xea7d('0x3'));var express=require(_0xea7d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xea7d('0x5'));var interaction=require(_0xea7d('0x6'));var config=require(_0xea7d('0x7'));var controller=require(_0xea7d('0x8'));router[_0xea7d('0x9')]('/',auth[_0xea7d('0xa')](),controller[_0xea7d('0xb')]);router[_0xea7d('0x9')](_0xea7d('0xc'),auth[_0xea7d('0xa')](),controller[_0xea7d('0xd')]);router[_0xea7d('0x9')](_0xea7d('0xe'),auth[_0xea7d('0xa')](),controller['getSessions']);router[_0xea7d('0x9')](_0xea7d('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xea7d('0x10'),auth['isAuthenticated'](),timeout(_0xea7d('0x11')),controller[_0xea7d('0x12')]);router[_0xea7d('0x13')]('/',auth['isAuthenticated'](),controller[_0xea7d('0x14')]);router[_0xea7d('0x13')]('/:id/clone',auth[_0xea7d('0xa')](),controller['clone']);router[_0xea7d('0x15')](_0xea7d('0xc'),auth['isAuthenticated'](),controller[_0xea7d('0x16')]);router[_0xea7d('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xea7d('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a4b17d4..eb8c7e8 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 _0x1612=['isObjectLike','setDataValue','formData','stringify','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','STRING','name','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1612,0xa4));var _0x2161=function(_0x24fc2c,_0x47b500){_0x24fc2c=_0x24fc2c-0x0;var _0x483de4=_0x1612[_0x24fc2c];return _0x483de4;};'use strict';var Sequelize=require(_0x2161('0x0'));var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0x2161('0x1')],'unique':_0x2161('0x2')},'description':{'type':Sequelize[_0x2161('0x1')]},'formData':{'type':Sequelize[_0x2161('0x3')]('long'),'set':function(_0x5956fa){if(_[_0x2161('0x4')](_0x5956fa)){this[_0x2161('0x5')](_0x2161('0x6'),JSON[_0x2161('0x7')](_0x5956fa));}else if(_['isString'](_0x5956fa)){this[_0x2161('0x5')](_0x2161('0x6'),_0x5956fa);}else{this[_0x2161('0x5')](_0x2161('0x6'),util['format'](_0x2161('0x8'),this[_0x2161('0x9')](_0x2161('0x2'))||'',this[_0x2161('0x9')](_0x2161('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2161('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0x2031=['getDataValue','description','BOOLEAN','sequelize','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x4b860a,_0x53f0c7){var _0x4d6bf1=function(_0x10a321){while(--_0x10a321){_0x4b860a['push'](_0x4b860a['shift']());}};_0x4d6bf1(++_0x53f0c7);}(_0x2031,0x198));var _0x1203=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2031[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1203('0x0'));var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0x1203('0x1')],'unique':_0x1203('0x2')},'description':{'type':Sequelize[_0x1203('0x1')]},'formData':{'type':Sequelize[_0x1203('0x3')](_0x1203('0x4')),'set':function(_0x598ea6){if(_[_0x1203('0x5')](_0x598ea6)){this['setDataValue'](_0x1203('0x6'),JSON[_0x1203('0x7')](_0x598ea6));}else if(_[_0x1203('0x8')](_0x598ea6)){this[_0x1203('0x9')]('formData',_0x598ea6);}else{this['setDataValue'](_0x1203('0x6'),util[_0x1203('0xa')](_0x1203('0xb'),this[_0x1203('0xc')]('name')||'',this[_0x1203('0xc')](_0x1203('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x1203('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index d139943..1095659 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 _0x285b=['setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Projects','UserProfileResource','end','error','stack','name','index','JscriptyProject','rawAttributes','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','clone','createdAt','body','updatedAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','JscriptySessionReport','ProjectId','getAnswers','nolimit','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv'];(function(_0x433252,_0x36db15){var _0x401f34=function(_0xa7c989){while(--_0xa7c989){_0x433252['push'](_0x433252['shift']());}};_0x401f34(++_0x36db15);}(_0x285b,0x171));var _0xb285=function(_0x1f3b8c,_0x38619e){_0x1f3b8c=_0x1f3b8c-0x0;var _0x6d00a2=_0x285b[_0x1f3b8c];return _0x6d00a2;};'use strict';var emlformat=require(_0xb285('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb285('0x1'));var jsonpatch=require(_0xb285('0x2'));var rp=require('request-promise');var moment=require(_0xb285('0x3'));var BPromise=require(_0xb285('0x4'));var Mustache=require(_0xb285('0x5'));var util=require(_0xb285('0x6'));var path=require(_0xb285('0x7'));var sox=require(_0xb285('0x8'));var csv=require(_0xb285('0x9'));var ejs=require(_0xb285('0xa'));var fs=require('fs');var fs_extra=require(_0xb285('0xb'));var _=require(_0xb285('0xc'));var squel=require('squel');var crypto=require(_0xb285('0xd'));var jsforce=require(_0xb285('0xe'));var deskjs=require(_0xb285('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb285('0x10'));var Redis=require(_0xb285('0x11'));var authService=require(_0xb285('0x12'));var qs=require(_0xb285('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb285('0x14'));var logger=require('../../config/logger')(_0xb285('0x15'));var utils=require(_0xb285('0x16'));var config=require(_0xb285('0x17'));var licenseUtil=require(_0xb285('0x18'));var db=require(_0xb285('0x19'))['db'];function respondWithStatusCode(_0x151a16,_0x39eef3){_0x39eef3=_0x39eef3||0xcc;return function(_0x19b745){if(_0x19b745){return _0x151a16[_0xb285('0x1a')](_0x39eef3);}return _0x151a16[_0xb285('0x1b')](_0x39eef3)['end']();};}function respondWithResult(_0x518217,_0x31b7b8){_0x31b7b8=_0x31b7b8||0xc8;return function(_0x21b84e){if(_0x21b84e){return _0x518217[_0xb285('0x1b')](_0x31b7b8)[_0xb285('0x1c')](_0x21b84e);}};}function respondWithFilteredResult(_0x52b3d1,_0x3f90f8){return function(_0x3f104a){if(_0x3f104a){var _0x281725=typeof _0x3f90f8[_0xb285('0x1d')]==='undefined'&&typeof _0x3f90f8[_0xb285('0x1e')]==='undefined';var _0x50ae0a=_0x3f104a[_0xb285('0x1f')];var _0x1e6a55=_0x281725?0x0:_0x3f90f8['offset'];var _0x9a75cc=_0x281725?_0x3f104a[_0xb285('0x1f')]:_0x3f90f8[_0xb285('0x1d')]+_0x3f90f8[_0xb285('0x1e')];var _0x17858d;if(_0x9a75cc>=_0x50ae0a){_0x9a75cc=_0x50ae0a;_0x17858d=0xc8;}else{_0x17858d=0xce;}_0x52b3d1[_0xb285('0x1b')](_0x17858d);return _0x52b3d1[_0xb285('0x20')](_0xb285('0x21'),_0x1e6a55+'-'+_0x9a75cc+'/'+_0x50ae0a)[_0xb285('0x1c')](_0x3f104a);}return null;};}function patchUpdates(_0x5d77cb){return function(_0x2f9967){try{jsonpatch[_0xb285('0x22')](_0x2f9967,_0x5d77cb,!![]);}catch(_0x453cab){return BPromise[_0xb285('0x23')](_0x453cab);}return _0x2f9967['save']();};}function saveUpdates(_0xc99e96,_0x33cdf4){return function(_0x531f1f){if(_0x531f1f){return _0x531f1f[_0xb285('0x24')](_0xc99e96)[_0xb285('0x25')](function(_0x4f4a56){return _0x4f4a56;});}return null;};}function removeEntity(_0x5f297d,_0x40a8a2){return function(_0x3058be){if(_0x3058be){return _0x3058be[_0xb285('0x26')]()[_0xb285('0x25')](function(){var _0x3c8fbd=_0x3058be[_0xb285('0x27')]({'plain':!![]});var _0x40a994=_0xb285('0x28');return db[_0xb285('0x29')][_0xb285('0x26')]({'where':{'type':_0x40a994,'resourceId':_0x3c8fbd['id']}})[_0xb285('0x25')](function(){return _0x3058be;});})['then'](function(){_0x5f297d[_0xb285('0x1b')](0xcc)[_0xb285('0x2a')]();});}};}function handleEntityNotFound(_0x56c81f,_0x164f52){return function(_0x53edd4){if(!_0x53edd4){_0x56c81f[_0xb285('0x1a')](0x194);}return _0x53edd4;};}function handleError(_0x67bc8b,_0x19a9d3){_0x19a9d3=_0x19a9d3||0x1f4;return function(_0x4377aa){logger[_0xb285('0x2b')](_0x4377aa[_0xb285('0x2c')]);if(_0x4377aa[_0xb285('0x2d')]){delete _0x4377aa[_0xb285('0x2d')];}_0x67bc8b[_0xb285('0x1b')](_0x19a9d3)['send'](_0x4377aa);};}exports[_0xb285('0x2e')]=function(_0x3af675,_0x2b3358){var _0x348e9a={},_0x3f7139={},_0x1c6174={'count':0x0,'rows':[]};var _0x236edc=_['map'](db[_0xb285('0x2f')][_0xb285('0x30')],function(_0x284550){return{'name':_0x284550[_0xb285('0x31')],'type':_0x284550[_0xb285('0x32')]['key']};});_0x3f7139['model']=_[_0xb285('0x33')](_0x236edc,_0xb285('0x2d'));_0x3f7139[_0xb285('0x34')]=_[_0xb285('0x35')](_0x3af675[_0xb285('0x34')]);_0x3f7139[_0xb285('0x36')]=_[_0xb285('0x37')](_0x3f7139['model'],_0x3f7139[_0xb285('0x34')]);_0x348e9a[_0xb285('0x38')]=_[_0xb285('0x37')](_0x3f7139[_0xb285('0x39')],qs['fields'](_0x3af675[_0xb285('0x34')][_0xb285('0x3a')]));_0x348e9a[_0xb285('0x38')]=_0x348e9a[_0xb285('0x38')][_0xb285('0x3b')]?_0x348e9a[_0xb285('0x38')]:_0x3f7139['model'];if(!_0x3af675[_0xb285('0x34')][_0xb285('0x3c')]('nolimit')){_0x348e9a[_0xb285('0x1e')]=qs[_0xb285('0x1e')](_0x3af675['query'][_0xb285('0x1e')]);_0x348e9a[_0xb285('0x1d')]=qs['offset'](_0x3af675[_0xb285('0x34')][_0xb285('0x1d')]);}_0x348e9a[_0xb285('0x3d')]=qs[_0xb285('0x3e')](_0x3af675[_0xb285('0x34')][_0xb285('0x3e')]);_0x348e9a[_0xb285('0x3f')]=qs[_0xb285('0x36')](_[_0xb285('0x40')](_0x3af675['query'],_0x3f7139[_0xb285('0x36')]),_0x236edc);if(_0x3af675[_0xb285('0x34')][_0xb285('0x41')]){_0x348e9a[_0xb285('0x3f')]=_[_0xb285('0x42')](_0x348e9a[_0xb285('0x3f')],{'$or':_['map'](_0x236edc,function(_0x37dec0){if(_0x37dec0[_0xb285('0x32')]!==_0xb285('0x43')){var _0x22f354={};_0x22f354[_0x37dec0[_0xb285('0x2d')]]={'$like':'%'+_0x3af675[_0xb285('0x34')][_0xb285('0x41')]+'%'};return _0x22f354;}})});}_0x348e9a=_[_0xb285('0x42')]({},_0x348e9a,_0x3af675['options']);var _0x222e51={'where':_0x348e9a['where']};return db[_0xb285('0x2f')][_0xb285('0x1f')](_0x222e51)[_0xb285('0x25')](function(_0x2e8334){_0x1c6174[_0xb285('0x1f')]=_0x2e8334;if(_0x3af675['query']['includeAll']){_0x348e9a[_0xb285('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0xb285('0x45')](_0x348e9a);})[_0xb285('0x25')](function(_0x2609c3){_0x1c6174[_0xb285('0x46')]=_0x2609c3;return _0x1c6174;})['then'](respondWithFilteredResult(_0x2b3358,_0x348e9a))[_0xb285('0x47')](handleError(_0x2b3358,null));};exports[_0xb285('0x48')]=function(_0x58bf3c,_0x46110c){var _0x2f476c={'raw':![],'where':{'id':_0x58bf3c[_0xb285('0x49')]['id']}},_0x11621b={};_0x11621b[_0xb285('0x39')]=_[_0xb285('0x35')](db[_0xb285('0x2f')][_0xb285('0x30')]);_0x11621b[_0xb285('0x34')]=_[_0xb285('0x35')](_0x58bf3c[_0xb285('0x34')]);_0x11621b[_0xb285('0x36')]=_[_0xb285('0x37')](_0x11621b[_0xb285('0x39')],_0x11621b[_0xb285('0x34')]);_0x2f476c['attributes']=_[_0xb285('0x37')](_0x11621b['model'],qs[_0xb285('0x3a')](_0x58bf3c[_0xb285('0x34')][_0xb285('0x3a')]));_0x2f476c[_0xb285('0x38')]=_0x2f476c[_0xb285('0x38')][_0xb285('0x3b')]?_0x2f476c[_0xb285('0x38')]:_0x11621b[_0xb285('0x39')];if(_0x58bf3c[_0xb285('0x34')][_0xb285('0x4a')]){_0x2f476c[_0xb285('0x44')]=[{'all':!![]}];}_0x2f476c=_[_0xb285('0x42')]({},_0x2f476c,_0x58bf3c[_0xb285('0x4b')]);return db['JscriptyProject']['find'](_0x2f476c)[_0xb285('0x25')](handleEntityNotFound(_0x46110c,null))[_0xb285('0x25')](respondWithResult(_0x46110c,null))[_0xb285('0x47')](handleError(_0x46110c,null));};exports[_0xb285('0x4c')]=function(_0x178fc9,_0x5a9bcb){return db[_0xb285('0x2f')]['create'](_0x178fc9['body'],{})['then'](function(_0x473c3f){var _0xc2fb94=_0x178fc9[_0xb285('0x4d')][_0xb285('0x27')]({'plain':!![]});if(!_0xc2fb94)throw new Error(_0xb285('0x4e'));if(_0xc2fb94[_0xb285('0x4f')]==='user'){var _0x4a7e2a=_0x473c3f[_0xb285('0x27')]({'plain':!![]});var _0x21b8af='Projects';return db['UserProfileSection'][_0xb285('0x50')]({'where':{'name':_0x21b8af,'userProfileId':_0xc2fb94[_0xb285('0x51')]},'raw':!![]})[_0xb285('0x25')](function(_0x33c042){if(_0x33c042&&_0x33c042[_0xb285('0x52')]===0x0){return db[_0xb285('0x29')][_0xb285('0x4c')]({'name':_0x4a7e2a[_0xb285('0x2d')],'resourceId':_0x4a7e2a['id'],'type':_0x33c042[_0xb285('0x2d')],'sectionId':_0x33c042['id']},{})[_0xb285('0x25')](function(){return _0x473c3f;});}else{return _0x473c3f;}})[_0xb285('0x47')](function(_0x1750ab){logger[_0xb285('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1750ab);throw _0x1750ab;});}return _0x473c3f;})[_0xb285('0x25')](respondWithResult(_0x5a9bcb,0xc9))[_0xb285('0x47')](handleError(_0x5a9bcb,null));};exports[_0xb285('0x53')]=function(_0x1cd6ca,_0x4cbb2d){var _0x1d9869={'where':{'id':_0x1cd6ca['params']['id']}},_0x248095={};_0x248095['model']=_['keys'](db[_0xb285('0x2f')][_0xb285('0x30')]);_0x1d9869[_0xb285('0x38')]=_[_0xb285('0x37')](_0x248095[_0xb285('0x39')],qs[_0xb285('0x3a')](_0x1cd6ca[_0xb285('0x34')]['fields']));_0x1d9869[_0xb285('0x38')]=_0x1d9869['attributes']['length']?_0x1d9869[_0xb285('0x38')]:_0x248095[_0xb285('0x39')];if(_0x1cd6ca[_0xb285('0x34')][_0xb285('0x4a')]){_0x1d9869['include']=[{'all':!![]}];}_0x1d9869=_[_0xb285('0x42')]({},_0x1d9869,_0x1cd6ca[_0xb285('0x4b')]);return db[_0xb285('0x2f')]['find'](_0x1d9869)[_0xb285('0x25')](handleEntityNotFound(_0x4cbb2d,null))[_0xb285('0x25')](function(_0x5c317f){if(_0x5c317f){var _0x3bc39d=_0x5c317f[_0xb285('0x27')]({'plain':!![]});_0x3bc39d=qs['omit'](_0x3bc39d,['id',_0xb285('0x54'),'updatedAt']);_0x1cd6ca['body']=_['omit'](_0x1cd6ca[_0xb285('0x55')],['id',_0xb285('0x54'),_0xb285('0x56')]);return db[_0xb285('0x2f')][_0xb285('0x4c')](_[_0xb285('0x42')](_0x3bc39d,_0x1cd6ca[_0xb285('0x55')]),{'include':_0x1cd6ca[_0xb285('0x34')][_0xb285('0x4a')]?[{'all':!![]}]:undefined})[_0xb285('0x25')](function(_0x5c0eb6){var _0x9c0759=_0x1cd6ca[_0xb285('0x4d')][_0xb285('0x27')]({'plain':!![]});if(!_0x9c0759)throw new Error(_0xb285('0x4e'));if(_0x9c0759[_0xb285('0x4f')]===_0xb285('0x4d')){var _0x66f6e8=_0x5c0eb6['get']({'plain':!![]});var _0x54b9d9=_0xb285('0x28');return db[_0xb285('0x57')][_0xb285('0x50')]({'where':{'name':_0x54b9d9,'userProfileId':_0x9c0759[_0xb285('0x51')]},'raw':!![]})[_0xb285('0x25')](function(_0x24bd05){if(_0x24bd05&&_0x24bd05[_0xb285('0x52')]===0x0){return db[_0xb285('0x29')][_0xb285('0x4c')]({'name':_0x66f6e8['name'],'resourceId':_0x66f6e8['id'],'type':_0x24bd05[_0xb285('0x2d')],'sectionId':_0x24bd05['id']},{})[_0xb285('0x25')](function(){return _0x5c0eb6;});}else{return _0x5c0eb6;}})[_0xb285('0x47')](function(_0x12e825){logger[_0xb285('0x2b')](_0xb285('0x58'),_0x12e825);throw _0x12e825;});}return _0x5c0eb6;});}})[_0xb285('0x25')](respondWithResult(_0x4cbb2d,0xc9))[_0xb285('0x47')](handleError(_0x4cbb2d,null));};exports[_0xb285('0x24')]=function(_0x1fb9c3,_0x29f027){if(_0x1fb9c3[_0xb285('0x55')]['id']){delete _0x1fb9c3[_0xb285('0x55')]['id'];}return db['JscriptyProject'][_0xb285('0x50')]({'where':{'id':_0x1fb9c3[_0xb285('0x49')]['id']}})[_0xb285('0x25')](handleEntityNotFound(_0x29f027,null))[_0xb285('0x25')](saveUpdates(_0x1fb9c3[_0xb285('0x55')],null))[_0xb285('0x25')](respondWithResult(_0x29f027,null))[_0xb285('0x47')](handleError(_0x29f027,null));};exports['destroy']=function(_0x20e181,_0x1ae470){return db[_0xb285('0x2f')]['find']({'where':{'id':_0x20e181['params']['id']}})[_0xb285('0x25')](handleEntityNotFound(_0x1ae470,null))[_0xb285('0x25')](removeEntity(_0x1ae470,null))['catch'](handleError(_0x1ae470,null));};exports['getSessions']=function(_0x417433,_0x2c2746,_0x1058f0){var _0x2363ee={'raw':!![],'where':{}};var _0x21cb64={};var _0xb40684={'count':0x0,'rows':[]};return db[_0xb285('0x2f')][_0xb285('0x59')]({'where':{'id':_0x417433[_0xb285('0x49')]['id']}})[_0xb285('0x25')](handleEntityNotFound(_0x2c2746,null))[_0xb285('0x25')](function(_0x1c493f){if(_0x1c493f){_0x21cb64['model']=_[_0xb285('0x35')](db[_0xb285('0x5a')][_0xb285('0x30')]);_0x21cb64['query']=_[_0xb285('0x35')](_0x417433['query']);_0x21cb64[_0xb285('0x36')]=_[_0xb285('0x37')](_0x21cb64[_0xb285('0x39')],_0x21cb64[_0xb285('0x34')]);_0x2363ee[_0xb285('0x38')]=_[_0xb285('0x37')](_0x21cb64[_0xb285('0x39')],qs[_0xb285('0x3a')](_0x417433[_0xb285('0x34')][_0xb285('0x3a')]));_0x2363ee[_0xb285('0x38')]=_0x2363ee['attributes'][_0xb285('0x3b')]?_0x2363ee[_0xb285('0x38')]:_0x21cb64[_0xb285('0x39')];if(!_0x417433[_0xb285('0x34')]['hasOwnProperty']('nolimit')){_0x2363ee[_0xb285('0x1e')]=qs[_0xb285('0x1e')](_0x417433['query'][_0xb285('0x1e')]);_0x2363ee[_0xb285('0x1d')]=qs[_0xb285('0x1d')](_0x417433['query'][_0xb285('0x1d')]);}_0x2363ee[_0xb285('0x3d')]=qs[_0xb285('0x3e')](_0x417433[_0xb285('0x34')][_0xb285('0x3e')]);_0x2363ee[_0xb285('0x3f')]=qs['filters'](_[_0xb285('0x40')](_0x417433[_0xb285('0x34')],_0x21cb64[_0xb285('0x36')]));_0x2363ee[_0xb285('0x3f')][_0xb285('0x5b')]=_0x1c493f['id'];if(_0x417433['query']['filter']){_0x2363ee[_0xb285('0x3f')]=_[_0xb285('0x42')](_0x2363ee['where'],{'$or':_[_0xb285('0x33')](_0x2363ee[_0xb285('0x38')],function(_0x33e57c){var _0x28224e={};_0x28224e[_0x33e57c]={'$like':'%'+_0x417433['query'][_0xb285('0x41')]+'%'};return _0x28224e;})});}_0x2363ee=_['merge']({},_0x2363ee,_0x417433['options']);return db[_0xb285('0x5a')][_0xb285('0x1f')]({'where':_0x2363ee[_0xb285('0x3f')]})[_0xb285('0x25')](function(_0x36945d){_0xb40684[_0xb285('0x1f')]=_0x36945d;if(_0x417433['query'][_0xb285('0x4a')]){_0x2363ee[_0xb285('0x44')]=[{'all':!![]}];}return db[_0xb285('0x5a')][_0xb285('0x45')](_0x2363ee);})[_0xb285('0x25')](function(_0x133dec){_0xb40684[_0xb285('0x46')]=_0x133dec;return _0xb40684;});}})[_0xb285('0x25')](respondWithFilteredResult(_0x2c2746,_0x2363ee))[_0xb285('0x47')](handleError(_0x2c2746,null));};exports[_0xb285('0x5c')]=function(_0x5a6c5,_0x4b7562,_0x584734){var _0x3af7aa={'raw':!![],'where':{}};var _0x1706cd={};var _0x1a9c5e={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xb285('0x59')]({'where':{'id':_0x5a6c5[_0xb285('0x49')]['id']}})[_0xb285('0x25')](handleEntityNotFound(_0x4b7562,null))[_0xb285('0x25')](function(_0x2ee9a5){if(_0x2ee9a5){_0x1706cd[_0xb285('0x39')]=_[_0xb285('0x35')](db['JscriptyAnswerReport']['rawAttributes']);_0x1706cd['query']=_[_0xb285('0x35')](_0x5a6c5['query']);_0x1706cd[_0xb285('0x36')]=_[_0xb285('0x37')](_0x1706cd[_0xb285('0x39')],_0x1706cd[_0xb285('0x34')]);_0x3af7aa[_0xb285('0x38')]=_[_0xb285('0x37')](_0x1706cd[_0xb285('0x39')],qs[_0xb285('0x3a')](_0x5a6c5['query']['fields']));_0x3af7aa[_0xb285('0x38')]=_0x3af7aa[_0xb285('0x38')]['length']?_0x3af7aa[_0xb285('0x38')]:_0x1706cd[_0xb285('0x39')];if(!_0x5a6c5[_0xb285('0x34')][_0xb285('0x3c')](_0xb285('0x5d'))){_0x3af7aa[_0xb285('0x1e')]=qs[_0xb285('0x1e')](_0x5a6c5['query']['limit']);_0x3af7aa[_0xb285('0x1d')]=qs['offset'](_0x5a6c5[_0xb285('0x34')][_0xb285('0x1d')]);}_0x3af7aa[_0xb285('0x3d')]=qs[_0xb285('0x3e')](_0x5a6c5[_0xb285('0x34')]['sort']);_0x3af7aa[_0xb285('0x3f')]=qs[_0xb285('0x36')](_[_0xb285('0x40')](_0x5a6c5[_0xb285('0x34')],_0x1706cd[_0xb285('0x36')]));_0x3af7aa[_0xb285('0x3f')][_0xb285('0x5b')]=_0x2ee9a5['id'];if(_0x5a6c5['query'][_0xb285('0x41')]){_0x3af7aa[_0xb285('0x3f')]=_['merge'](_0x3af7aa['where'],{'$or':_[_0xb285('0x33')](_0x3af7aa[_0xb285('0x38')],function(_0x10126b){var _0xd6d06f={};_0xd6d06f[_0x10126b]={'$like':'%'+_0x5a6c5[_0xb285('0x34')][_0xb285('0x41')]+'%'};return _0xd6d06f;})});}_0x3af7aa=_[_0xb285('0x42')]({},_0x3af7aa,_0x5a6c5[_0xb285('0x4b')]);return db[_0xb285('0x5e')][_0xb285('0x1f')]({'where':_0x3af7aa[_0xb285('0x3f')]})['then'](function(_0x26dc21){_0x1a9c5e['count']=_0x26dc21;if(_0x5a6c5[_0xb285('0x34')][_0xb285('0x4a')]){_0x3af7aa[_0xb285('0x44')]=[{'all':!![]}];}return db[_0xb285('0x5e')][_0xb285('0x45')](_0x3af7aa);})['then'](function(_0x5aa75c){_0x1a9c5e[_0xb285('0x46')]=_0x5aa75c;return _0x1a9c5e;});}})[_0xb285('0x25')](respondWithFilteredResult(_0x4b7562,_0x3af7aa))[_0xb285('0x47')](handleError(_0x4b7562,null));};function char(_0xcef778){return _0xb285('0x5f')===typeof _0xcef778?String['fromCharCode'][_0xb285('0x22')](null,arguments):_0xcef778;}function needsEncapsulation(_0x1be39f){return!!_0x1be39f&&(_0x1be39f[_0xb285('0x60')]()[_0xb285('0x61')](char(0xd))>=0x0||_0x1be39f['toString']()[_0xb285('0x61')](char(0xa))>=0x0||_0x1be39f['toString']()[_0xb285('0x61')](char(0x2c))>=0x0||_0x1be39f[_0xb285('0x60')]()[_0xb285('0x61')](char(0x22))>=0x0);}function encapsulate(_0x46da16){var _0x348f2a=char(0x22),_0x4f2157='\x5c'+char(0x22),_0x4cc118=_0x46da16['toString']()[_0xb285('0x62')](new RegExp(_0x348f2a,'g'),_0x4f2157);return _0x348f2a+_0x4cc118+_0x348f2a;}exports[_0xb285('0x63')]=function(_0x13682d,_0x3e785a,_0x2565a0){var _0x2cb6e1,_0x1568ea;var _0x16891c={'where':{'ProjectId':_0x13682d['params']['id']}};if(_0x13682d[_0xb285('0x34')][_0xb285('0x64')]){_0x16891c[_0xb285('0x3f')][_0xb285('0x65')]=JSON[_0xb285('0x66')](_0x13682d[_0xb285('0x34')]['startTime']);}return db['JscriptySessionReport'][_0xb285('0x45')](_0x16891c)[_0xb285('0x25')](handleEntityNotFound(_0x3e785a,null))['then'](function(_0x246725){if(_0x246725){_0x2cb6e1=_0x246725;return db[_0xb285('0x67')][_0xb285('0x45')]({'where':{'SessionId':{'$in':_['map'](_0x2cb6e1,'id')},'ProjectId':_0x13682d[_0xb285('0x49')]['id']},'order':_0xb285('0x68')});}})['then'](handleEntityNotFound(_0x3e785a,null))['then'](function(_0x2ab078){if(_0x2ab078){_0x1568ea=_0x2ab078;var _0x21f8df={};for(var _0x48bc27=0x0,_0x40896f=_0x1568ea[_0xb285('0x3b')];_0x48bc27<_0x40896f;_0x48bc27++){if(!_0x21f8df[_0xb285('0x3c')](_0x1568ea[_0x48bc27]['questionId'])){_0x21f8df[_0x1568ea[_0x48bc27][_0xb285('0x69')]]=needsEncapsulation(_0x1568ea[_0x48bc27][_0xb285('0x6a')])?encapsulate(_0x1568ea[_0x48bc27][_0xb285('0x6a')]):_0x1568ea[_0x48bc27][_0xb285('0x6a')];}}var _0x501657=[],_0x3cf8e9={};for(var _0x1e812d=0x0,_0x21639a=_0x2cb6e1[_0xb285('0x3b')];_0x1e812d<_0x21639a;_0x1e812d++){_0x3cf8e9={'ProjectId':_0x13682d[_0xb285('0x49')]['id'],'SessionId':_0x2cb6e1[_0x1e812d]['id'],'StartTime':moment(_0x2cb6e1[_0x1e812d][_0xb285('0x65')])[_0xb285('0x6b')](_0xb285('0x6c'))};for(var _0x2269c5=0x0,_0x59f336=_0x1568ea['length'];_0x2269c5<_0x59f336;_0x2269c5++){if(_0x1568ea[_0x2269c5][_0xb285('0x6d')]==_0x2cb6e1[_0x1e812d]['id']&&_0x21f8df['hasOwnProperty'](_0x1568ea[_0x2269c5][_0xb285('0x69')])){_0x3cf8e9[_0x21f8df[_0x1568ea[_0x2269c5][_0xb285('0x69')]]]=_0x1568ea[_0x2269c5][_0xb285('0x6e')];}}for(var _0x408091 in _0x21f8df){if(!_0x3cf8e9[_0xb285('0x3c')](_0x21f8df[_0x408091])){_0x3cf8e9[_0x21f8df[_0x408091]]=null;}}_0x501657[_0xb285('0x6f')](_0x3cf8e9);}return _0x501657;}})[_0xb285('0x25')](function(_0x3c622e){if(!_['isEmpty'](_0x3c622e)){var _0x58e3fd=toCsv(_0x3c622e);var _0x77c466=Date[_0xb285('0x70')]();fs[_0xb285('0x71')](util[_0xb285('0x6b')](_0xb285('0x72'),_0x13682d[_0xb285('0x49')]['id'],_0x77c466),_0x58e3fd);_0x3e785a[_0xb285('0x73')](_0xb285('0x74'),_0xb285('0x75')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x13682d[_0xb285('0x49')]['id'],_0x77c466));_0x3e785a[_0xb285('0x73')](_0xb285('0x76'),_0xb285('0x77'));return _0x3e785a[_0xb285('0x78')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x13682d[_0xb285('0x49')]['id'],_0x77c466));}else{return _0x3e785a[_0xb285('0x1a')](0xcc);}})[_0xb285('0x47')](handleError(_0x3e785a,null));}; \ No newline at end of file +var _0xf793=['model','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','JscriptyProject','includeAll','findAll','rows','catch','show','fields','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','autoAssociation','update','findOne','JscriptySessionReport','pick','ProjectId','JscriptyAnswerReport','nolimit','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','Projects','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','intersection'];(function(_0x37237f,_0xbe3925){var _0x244a40=function(_0x5470b1){while(--_0x5470b1){_0x37237f['push'](_0x37237f['shift']());}};_0x244a40(++_0xbe3925);}(_0xf793,0x1ac));var _0x3f79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf793[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3f79('0x1'));var moment=require(_0x3f79('0x2'));var BPromise=require(_0x3f79('0x3'));var Mustache=require(_0x3f79('0x4'));var util=require(_0x3f79('0x5'));var path=require(_0x3f79('0x6'));var sox=require(_0x3f79('0x7'));var csv=require(_0x3f79('0x8'));var ejs=require(_0x3f79('0x9'));var fs=require('fs');var fs_extra=require(_0x3f79('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3f79('0xb'));var toCsv=require(_0x3f79('0x8'));var querystring=require(_0x3f79('0xc'));var Papa=require(_0x3f79('0xd'));var Redis=require(_0x3f79('0xe'));var authService=require(_0x3f79('0xf'));var qs=require(_0x3f79('0x10'));var as=require(_0x3f79('0x11'));var hardwareService=require(_0x3f79('0x12'));var logger=require(_0x3f79('0x13'))(_0x3f79('0x14'));var utils=require(_0x3f79('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3f79('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe441ab,_0x485895){_0x485895=_0x485895||0xcc;return function(_0x2b1936){if(_0x2b1936){return _0xe441ab[_0x3f79('0x17')](_0x485895);}return _0xe441ab[_0x3f79('0x18')](_0x485895)[_0x3f79('0x19')]();};}function respondWithResult(_0x2a1e48,_0x5db97d){_0x5db97d=_0x5db97d||0xc8;return function(_0x137cef){if(_0x137cef){return _0x2a1e48[_0x3f79('0x18')](_0x5db97d)['json'](_0x137cef);}};}function respondWithFilteredResult(_0x4efcd8,_0x328616){return function(_0x5f5a50){if(_0x5f5a50){var _0x22e098=typeof _0x328616[_0x3f79('0x1a')]===_0x3f79('0x1b')&&typeof _0x328616['limit']===_0x3f79('0x1b');var _0x5be18a=_0x5f5a50[_0x3f79('0x1c')];var _0x11d0fb=_0x22e098?0x0:_0x328616['offset'];var _0x42ddff=_0x22e098?_0x5f5a50['count']:_0x328616['offset']+_0x328616[_0x3f79('0x1d')];var _0x52834c;if(_0x42ddff>=_0x5be18a){_0x42ddff=_0x5be18a;_0x52834c=0xc8;}else{_0x52834c=0xce;}_0x4efcd8[_0x3f79('0x18')](_0x52834c);return _0x4efcd8[_0x3f79('0x1e')](_0x3f79('0x1f'),_0x11d0fb+'-'+_0x42ddff+'/'+_0x5be18a)[_0x3f79('0x20')](_0x5f5a50);}return null;};}function patchUpdates(_0x2f421c){return function(_0x56efd3){try{jsonpatch[_0x3f79('0x21')](_0x56efd3,_0x2f421c,!![]);}catch(_0x4cd7c8){return BPromise[_0x3f79('0x22')](_0x4cd7c8);}return _0x56efd3[_0x3f79('0x23')]();};}function saveUpdates(_0x4bc817,_0x2cd3f4){return function(_0xe561ca){if(_0xe561ca){return _0xe561ca['update'](_0x4bc817)[_0x3f79('0x24')](function(_0x24c28d){return _0x24c28d;});}return null;};}function removeEntity(_0x5aab90,_0x45278e){return function(_0x276d68){if(_0x276d68){return _0x276d68[_0x3f79('0x25')]()[_0x3f79('0x24')](function(){var _0x1ae34a=_0x276d68['get']({'plain':!![]});var _0x5184f5=_0x3f79('0x26');return db[_0x3f79('0x27')]['destroy']({'where':{'type':_0x5184f5,'resourceId':_0x1ae34a['id']}})[_0x3f79('0x24')](function(){return _0x276d68;});})[_0x3f79('0x24')](function(){_0x5aab90[_0x3f79('0x18')](0xcc)[_0x3f79('0x19')]();});}};}function handleEntityNotFound(_0x3d581a,_0x3610e9){return function(_0x1d3b14){if(!_0x1d3b14){_0x3d581a[_0x3f79('0x17')](0x194);}return _0x1d3b14;};}function handleError(_0x176fbe,_0x54a52c){_0x54a52c=_0x54a52c||0x1f4;return function(_0x2adcda){logger[_0x3f79('0x28')](_0x2adcda[_0x3f79('0x29')]);if(_0x2adcda[_0x3f79('0x2a')]){delete _0x2adcda[_0x3f79('0x2a')];}_0x176fbe['status'](_0x54a52c)['send'](_0x2adcda);};}exports[_0x3f79('0x2b')]=function(_0x315645,_0xb20b98){var _0x3f72b3={},_0x1407ac={},_0x39c4f7={'count':0x0,'rows':[]};var _0x1570da=_[_0x3f79('0x2c')](db['JscriptyProject'][_0x3f79('0x2d')],function(_0x257c5a){return{'name':_0x257c5a[_0x3f79('0x2e')],'type':_0x257c5a[_0x3f79('0x2f')][_0x3f79('0x30')]};});_0x1407ac['model']=_[_0x3f79('0x2c')](_0x1570da,_0x3f79('0x2a'));_0x1407ac[_0x3f79('0x31')]=_[_0x3f79('0x32')](_0x315645[_0x3f79('0x31')]);_0x1407ac['filters']=_[_0x3f79('0x33')](_0x1407ac[_0x3f79('0x34')],_0x1407ac['query']);_0x3f72b3[_0x3f79('0x35')]=_[_0x3f79('0x33')](_0x1407ac[_0x3f79('0x34')],qs['fields'](_0x315645[_0x3f79('0x31')]['fields']));_0x3f72b3[_0x3f79('0x35')]=_0x3f72b3['attributes'][_0x3f79('0x36')]?_0x3f72b3[_0x3f79('0x35')]:_0x1407ac[_0x3f79('0x34')];if(!_0x315645[_0x3f79('0x31')][_0x3f79('0x37')]('nolimit')){_0x3f72b3[_0x3f79('0x1d')]=qs[_0x3f79('0x1d')](_0x315645[_0x3f79('0x31')][_0x3f79('0x1d')]);_0x3f72b3[_0x3f79('0x1a')]=qs[_0x3f79('0x1a')](_0x315645['query'][_0x3f79('0x1a')]);}_0x3f72b3[_0x3f79('0x38')]=qs['sort'](_0x315645['query'][_0x3f79('0x39')]);_0x3f72b3[_0x3f79('0x3a')]=qs[_0x3f79('0x3b')](_['pick'](_0x315645['query'],_0x1407ac['filters']),_0x1570da);if(_0x315645[_0x3f79('0x31')][_0x3f79('0x3c')]){_0x3f72b3['where']=_[_0x3f79('0x3d')](_0x3f72b3[_0x3f79('0x3a')],{'$or':_[_0x3f79('0x2c')](_0x1570da,function(_0x398cf8){if(_0x398cf8[_0x3f79('0x2f')]!==_0x3f79('0x3e')){var _0x20fe41={};_0x20fe41[_0x398cf8[_0x3f79('0x2a')]]={'$like':'%'+_0x315645[_0x3f79('0x31')][_0x3f79('0x3c')]+'%'};return _0x20fe41;}})});}_0x3f72b3=_['merge']({},_0x3f72b3,_0x315645['options']);var _0x14fb7d={'where':_0x3f72b3[_0x3f79('0x3a')]};return db[_0x3f79('0x3f')]['count'](_0x14fb7d)[_0x3f79('0x24')](function(_0x28375f){_0x39c4f7['count']=_0x28375f;if(_0x315645['query'][_0x3f79('0x40')]){_0x3f72b3['include']=[{'all':!![]}];}return db[_0x3f79('0x3f')][_0x3f79('0x41')](_0x3f72b3);})[_0x3f79('0x24')](function(_0x4198e4){_0x39c4f7[_0x3f79('0x42')]=_0x4198e4;return _0x39c4f7;})[_0x3f79('0x24')](respondWithFilteredResult(_0xb20b98,_0x3f72b3))[_0x3f79('0x43')](handleError(_0xb20b98,null));};exports[_0x3f79('0x44')]=function(_0x58b638,_0x12ddbd){var _0x1fb120={'raw':![],'where':{'id':_0x58b638['params']['id']}},_0x51c278={};_0x51c278['model']=_['keys'](db['JscriptyProject'][_0x3f79('0x2d')]);_0x51c278[_0x3f79('0x31')]=_[_0x3f79('0x32')](_0x58b638[_0x3f79('0x31')]);_0x51c278[_0x3f79('0x3b')]=_[_0x3f79('0x33')](_0x51c278[_0x3f79('0x34')],_0x51c278[_0x3f79('0x31')]);_0x1fb120[_0x3f79('0x35')]=_[_0x3f79('0x33')](_0x51c278[_0x3f79('0x34')],qs[_0x3f79('0x45')](_0x58b638[_0x3f79('0x31')][_0x3f79('0x45')]));_0x1fb120[_0x3f79('0x35')]=_0x1fb120[_0x3f79('0x35')]['length']?_0x1fb120[_0x3f79('0x35')]:_0x51c278[_0x3f79('0x34')];if(_0x58b638[_0x3f79('0x31')][_0x3f79('0x40')]){_0x1fb120[_0x3f79('0x46')]=[{'all':!![]}];}_0x1fb120=_[_0x3f79('0x3d')]({},_0x1fb120,_0x58b638[_0x3f79('0x47')]);return db[_0x3f79('0x3f')]['find'](_0x1fb120)[_0x3f79('0x24')](handleEntityNotFound(_0x12ddbd,null))['then'](respondWithResult(_0x12ddbd,null))[_0x3f79('0x43')](handleError(_0x12ddbd,null));};exports[_0x3f79('0x48')]=function(_0x372996,_0x2bbd11){return db[_0x3f79('0x3f')][_0x3f79('0x48')](_0x372996[_0x3f79('0x49')],{})[_0x3f79('0x24')](function(_0x303a12){var _0x4c7695=_0x372996[_0x3f79('0x4a')]['get']({'plain':!![]});if(!_0x4c7695)throw new Error(_0x3f79('0x4b'));if(_0x4c7695[_0x3f79('0x4c')]===_0x3f79('0x4a')){var _0x11f013=_0x303a12[_0x3f79('0x4d')]({'plain':!![]});var _0x4d38ac=_0x3f79('0x26');return db[_0x3f79('0x4e')][_0x3f79('0x4f')]({'where':{'name':_0x4d38ac,'userProfileId':_0x4c7695[_0x3f79('0x50')]},'raw':!![]})[_0x3f79('0x24')](function(_0xd280ab){if(_0xd280ab&&_0xd280ab['autoAssociation']===0x0){return db[_0x3f79('0x27')][_0x3f79('0x48')]({'name':_0x11f013[_0x3f79('0x2a')],'resourceId':_0x11f013['id'],'type':_0xd280ab[_0x3f79('0x2a')],'sectionId':_0xd280ab['id']},{})[_0x3f79('0x24')](function(){return _0x303a12;});}else{return _0x303a12;}})['catch'](function(_0x10e323){logger[_0x3f79('0x28')](_0x3f79('0x51'),_0x10e323);throw _0x10e323;});}return _0x303a12;})[_0x3f79('0x24')](respondWithResult(_0x2bbd11,0xc9))[_0x3f79('0x43')](handleError(_0x2bbd11,null));};exports[_0x3f79('0x52')]=function(_0x3dcad3,_0x59f4ce){var _0x2b2737={'where':{'id':_0x3dcad3[_0x3f79('0x53')]['id']}},_0x4bea6f={};_0x4bea6f[_0x3f79('0x34')]=_[_0x3f79('0x32')](db[_0x3f79('0x3f')]['rawAttributes']);_0x2b2737[_0x3f79('0x35')]=_[_0x3f79('0x33')](_0x4bea6f['model'],qs[_0x3f79('0x45')](_0x3dcad3[_0x3f79('0x31')][_0x3f79('0x45')]));_0x2b2737[_0x3f79('0x35')]=_0x2b2737['attributes'][_0x3f79('0x36')]?_0x2b2737['attributes']:_0x4bea6f['model'];if(_0x3dcad3[_0x3f79('0x31')][_0x3f79('0x40')]){_0x2b2737[_0x3f79('0x46')]=[{'all':!![]}];}_0x2b2737=_[_0x3f79('0x3d')]({},_0x2b2737,_0x3dcad3[_0x3f79('0x47')]);return db[_0x3f79('0x3f')][_0x3f79('0x4f')](_0x2b2737)['then'](handleEntityNotFound(_0x59f4ce,null))[_0x3f79('0x24')](function(_0x993e26){if(_0x993e26){var _0x2e695a=_0x993e26[_0x3f79('0x4d')]({'plain':!![]});_0x2e695a=qs[_0x3f79('0x54')](_0x2e695a,['id',_0x3f79('0x55'),_0x3f79('0x56')]);_0x3dcad3[_0x3f79('0x49')]=_['omit'](_0x3dcad3[_0x3f79('0x49')],['id',_0x3f79('0x55'),_0x3f79('0x56')]);return db['JscriptyProject'][_0x3f79('0x48')](_['merge'](_0x2e695a,_0x3dcad3[_0x3f79('0x49')]),{'include':_0x3dcad3['query'][_0x3f79('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x38d69e){var _0x4ab40b=_0x3dcad3['user'][_0x3f79('0x4d')]({'plain':!![]});if(!_0x4ab40b)throw new Error(_0x3f79('0x4b'));if(_0x4ab40b[_0x3f79('0x4c')]==='user'){var _0x2f9535=_0x38d69e['get']({'plain':!![]});var _0x2a7900='Projects';return db[_0x3f79('0x4e')][_0x3f79('0x4f')]({'where':{'name':_0x2a7900,'userProfileId':_0x4ab40b[_0x3f79('0x50')]},'raw':!![]})[_0x3f79('0x24')](function(_0x459543){if(_0x459543&&_0x459543[_0x3f79('0x57')]===0x0){return db['UserProfileResource'][_0x3f79('0x48')]({'name':_0x2f9535[_0x3f79('0x2a')],'resourceId':_0x2f9535['id'],'type':_0x459543[_0x3f79('0x2a')],'sectionId':_0x459543['id']},{})[_0x3f79('0x24')](function(){return _0x38d69e;});}else{return _0x38d69e;}})[_0x3f79('0x43')](function(_0x452e56){logger[_0x3f79('0x28')](_0x3f79('0x51'),_0x452e56);throw _0x452e56;});}return _0x38d69e;});}})[_0x3f79('0x24')](respondWithResult(_0x59f4ce,0xc9))[_0x3f79('0x43')](handleError(_0x59f4ce,null));};exports[_0x3f79('0x58')]=function(_0x1ae328,_0xc963){if(_0x1ae328[_0x3f79('0x49')]['id']){delete _0x1ae328[_0x3f79('0x49')]['id'];}return db[_0x3f79('0x3f')][_0x3f79('0x4f')]({'where':{'id':_0x1ae328[_0x3f79('0x53')]['id']}})[_0x3f79('0x24')](handleEntityNotFound(_0xc963,null))[_0x3f79('0x24')](saveUpdates(_0x1ae328[_0x3f79('0x49')],null))[_0x3f79('0x24')](respondWithResult(_0xc963,null))[_0x3f79('0x43')](handleError(_0xc963,null));};exports[_0x3f79('0x25')]=function(_0x56e040,_0x6e42d0){return db[_0x3f79('0x3f')]['find']({'where':{'id':_0x56e040[_0x3f79('0x53')]['id']}})[_0x3f79('0x24')](handleEntityNotFound(_0x6e42d0,null))['then'](removeEntity(_0x6e42d0,null))[_0x3f79('0x43')](handleError(_0x6e42d0,null));};exports['getSessions']=function(_0xab909d,_0x15538c,_0x556e71){var _0x2d5448={'raw':!![],'where':{}};var _0x4f9ca9={};var _0x103fcf={'count':0x0,'rows':[]};return db[_0x3f79('0x3f')][_0x3f79('0x59')]({'where':{'id':_0xab909d['params']['id']}})[_0x3f79('0x24')](handleEntityNotFound(_0x15538c,null))[_0x3f79('0x24')](function(_0x116a41){if(_0x116a41){_0x4f9ca9[_0x3f79('0x34')]=_['keys'](db[_0x3f79('0x5a')][_0x3f79('0x2d')]);_0x4f9ca9[_0x3f79('0x31')]=_['keys'](_0xab909d[_0x3f79('0x31')]);_0x4f9ca9[_0x3f79('0x3b')]=_[_0x3f79('0x33')](_0x4f9ca9[_0x3f79('0x34')],_0x4f9ca9[_0x3f79('0x31')]);_0x2d5448[_0x3f79('0x35')]=_[_0x3f79('0x33')](_0x4f9ca9['model'],qs[_0x3f79('0x45')](_0xab909d[_0x3f79('0x31')][_0x3f79('0x45')]));_0x2d5448[_0x3f79('0x35')]=_0x2d5448[_0x3f79('0x35')]['length']?_0x2d5448[_0x3f79('0x35')]:_0x4f9ca9['model'];if(!_0xab909d[_0x3f79('0x31')]['hasOwnProperty']('nolimit')){_0x2d5448[_0x3f79('0x1d')]=qs[_0x3f79('0x1d')](_0xab909d['query'][_0x3f79('0x1d')]);_0x2d5448['offset']=qs['offset'](_0xab909d[_0x3f79('0x31')][_0x3f79('0x1a')]);}_0x2d5448['order']=qs[_0x3f79('0x39')](_0xab909d[_0x3f79('0x31')][_0x3f79('0x39')]);_0x2d5448[_0x3f79('0x3a')]=qs[_0x3f79('0x3b')](_[_0x3f79('0x5b')](_0xab909d[_0x3f79('0x31')],_0x4f9ca9['filters']));_0x2d5448[_0x3f79('0x3a')][_0x3f79('0x5c')]=_0x116a41['id'];if(_0xab909d[_0x3f79('0x31')]['filter']){_0x2d5448[_0x3f79('0x3a')]=_[_0x3f79('0x3d')](_0x2d5448[_0x3f79('0x3a')],{'$or':_[_0x3f79('0x2c')](_0x2d5448[_0x3f79('0x35')],function(_0x271599){var _0x270f0a={};_0x270f0a[_0x271599]={'$like':'%'+_0xab909d[_0x3f79('0x31')]['filter']+'%'};return _0x270f0a;})});}_0x2d5448=_[_0x3f79('0x3d')]({},_0x2d5448,_0xab909d[_0x3f79('0x47')]);return db['JscriptySessionReport'][_0x3f79('0x1c')]({'where':_0x2d5448[_0x3f79('0x3a')]})[_0x3f79('0x24')](function(_0x193ea5){_0x103fcf[_0x3f79('0x1c')]=_0x193ea5;if(_0xab909d[_0x3f79('0x31')][_0x3f79('0x40')]){_0x2d5448['include']=[{'all':!![]}];}return db[_0x3f79('0x5a')][_0x3f79('0x41')](_0x2d5448);})[_0x3f79('0x24')](function(_0x2b9dd5){_0x103fcf[_0x3f79('0x42')]=_0x2b9dd5;return _0x103fcf;});}})['then'](respondWithFilteredResult(_0x15538c,_0x2d5448))[_0x3f79('0x43')](handleError(_0x15538c,null));};exports['getAnswers']=function(_0x3987e9,_0x5de8c1,_0x1ba5a4){var _0x2bc46b={'raw':!![],'where':{}};var _0x10d43c={};var _0x575dd5={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x3987e9[_0x3f79('0x53')]['id']}})[_0x3f79('0x24')](handleEntityNotFound(_0x5de8c1,null))[_0x3f79('0x24')](function(_0x138b50){if(_0x138b50){_0x10d43c[_0x3f79('0x34')]=_['keys'](db[_0x3f79('0x5d')][_0x3f79('0x2d')]);_0x10d43c[_0x3f79('0x31')]=_[_0x3f79('0x32')](_0x3987e9[_0x3f79('0x31')]);_0x10d43c[_0x3f79('0x3b')]=_['intersection'](_0x10d43c[_0x3f79('0x34')],_0x10d43c[_0x3f79('0x31')]);_0x2bc46b[_0x3f79('0x35')]=_['intersection'](_0x10d43c[_0x3f79('0x34')],qs[_0x3f79('0x45')](_0x3987e9[_0x3f79('0x31')][_0x3f79('0x45')]));_0x2bc46b[_0x3f79('0x35')]=_0x2bc46b['attributes'][_0x3f79('0x36')]?_0x2bc46b['attributes']:_0x10d43c[_0x3f79('0x34')];if(!_0x3987e9[_0x3f79('0x31')][_0x3f79('0x37')](_0x3f79('0x5e'))){_0x2bc46b[_0x3f79('0x1d')]=qs['limit'](_0x3987e9['query']['limit']);_0x2bc46b['offset']=qs[_0x3f79('0x1a')](_0x3987e9['query']['offset']);}_0x2bc46b[_0x3f79('0x38')]=qs['sort'](_0x3987e9[_0x3f79('0x31')][_0x3f79('0x39')]);_0x2bc46b[_0x3f79('0x3a')]=qs[_0x3f79('0x3b')](_[_0x3f79('0x5b')](_0x3987e9[_0x3f79('0x31')],_0x10d43c[_0x3f79('0x3b')]));_0x2bc46b['where']['ProjectId']=_0x138b50['id'];if(_0x3987e9[_0x3f79('0x31')][_0x3f79('0x3c')]){_0x2bc46b[_0x3f79('0x3a')]=_['merge'](_0x2bc46b[_0x3f79('0x3a')],{'$or':_[_0x3f79('0x2c')](_0x2bc46b[_0x3f79('0x35')],function(_0x1efda7){var _0x273f05={};_0x273f05[_0x1efda7]={'$like':'%'+_0x3987e9[_0x3f79('0x31')][_0x3f79('0x3c')]+'%'};return _0x273f05;})});}_0x2bc46b=_[_0x3f79('0x3d')]({},_0x2bc46b,_0x3987e9[_0x3f79('0x47')]);return db[_0x3f79('0x5d')][_0x3f79('0x1c')]({'where':_0x2bc46b[_0x3f79('0x3a')]})[_0x3f79('0x24')](function(_0x441c60){_0x575dd5[_0x3f79('0x1c')]=_0x441c60;if(_0x3987e9[_0x3f79('0x31')]['includeAll']){_0x2bc46b['include']=[{'all':!![]}];}return db[_0x3f79('0x5d')][_0x3f79('0x41')](_0x2bc46b);})[_0x3f79('0x24')](function(_0x58c3bb){_0x575dd5['rows']=_0x58c3bb;return _0x575dd5;});}})[_0x3f79('0x24')](respondWithFilteredResult(_0x5de8c1,_0x2bc46b))[_0x3f79('0x43')](handleError(_0x5de8c1,null));};function char(_0x2cdfda){return _0x3f79('0x5f')===typeof _0x2cdfda?String[_0x3f79('0x60')][_0x3f79('0x21')](null,arguments):_0x2cdfda;}function needsEncapsulation(_0x3b9c11){return!!_0x3b9c11&&(_0x3b9c11[_0x3f79('0x61')]()[_0x3f79('0x62')](char(0xd))>=0x0||_0x3b9c11[_0x3f79('0x61')]()[_0x3f79('0x62')](char(0xa))>=0x0||_0x3b9c11[_0x3f79('0x61')]()['indexOf'](char(0x2c))>=0x0||_0x3b9c11[_0x3f79('0x61')]()[_0x3f79('0x62')](char(0x22))>=0x0);}function encapsulate(_0x323582){var _0x27d8b7=char(0x22),_0x3e460b='\x5c'+char(0x22),_0x3cdbc3=_0x323582[_0x3f79('0x61')]()[_0x3f79('0x63')](new RegExp(_0x27d8b7,'g'),_0x3e460b);return _0x27d8b7+_0x3cdbc3+_0x27d8b7;}exports[_0x3f79('0x64')]=function(_0x3bc992,_0x8e6349,_0x5cbb14){var _0x1b7eb6,_0x5cbff9;var _0xc3c139={'where':{'ProjectId':_0x3bc992[_0x3f79('0x53')]['id']}};if(_0x3bc992[_0x3f79('0x31')][_0x3f79('0x65')]){_0xc3c139[_0x3f79('0x3a')]['starttime']=JSON[_0x3f79('0x66')](_0x3bc992[_0x3f79('0x31')][_0x3f79('0x65')]);}return db[_0x3f79('0x5a')][_0x3f79('0x41')](_0xc3c139)[_0x3f79('0x24')](handleEntityNotFound(_0x8e6349,null))['then'](function(_0x4cbccf){if(_0x4cbccf){_0x1b7eb6=_0x4cbccf;return db[_0x3f79('0x67')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x1b7eb6,'id')},'ProjectId':_0x3bc992[_0x3f79('0x53')]['id']},'order':_0x3f79('0x68')});}})[_0x3f79('0x24')](handleEntityNotFound(_0x8e6349,null))['then'](function(_0x21b0ff){if(_0x21b0ff){_0x5cbff9=_0x21b0ff;var _0xf1bf23={};for(var _0x5caebc=0x0,_0x381b6a=_0x5cbff9[_0x3f79('0x36')];_0x5caebc<_0x381b6a;_0x5caebc++){if(!_0xf1bf23[_0x3f79('0x37')](_0x5cbff9[_0x5caebc][_0x3f79('0x69')])){_0xf1bf23[_0x5cbff9[_0x5caebc][_0x3f79('0x69')]]=needsEncapsulation(_0x5cbff9[_0x5caebc][_0x3f79('0x6a')])?encapsulate(_0x5cbff9[_0x5caebc][_0x3f79('0x6a')]):_0x5cbff9[_0x5caebc][_0x3f79('0x6a')];}}var _0x3e6d52=[],_0xa95d4a={};for(var _0x1468c4=0x0,_0xddd3c=_0x1b7eb6['length'];_0x1468c4<_0xddd3c;_0x1468c4++){_0xa95d4a={'ProjectId':_0x3bc992[_0x3f79('0x53')]['id'],'SessionId':_0x1b7eb6[_0x1468c4]['id'],'StartTime':moment(_0x1b7eb6[_0x1468c4]['starttime'])['format'](_0x3f79('0x6b'))};for(var _0x4dae09=0x0,_0x21da6c=_0x5cbff9[_0x3f79('0x36')];_0x4dae09<_0x21da6c;_0x4dae09++){if(_0x5cbff9[_0x4dae09][_0x3f79('0x6c')]==_0x1b7eb6[_0x1468c4]['id']&&_0xf1bf23[_0x3f79('0x37')](_0x5cbff9[_0x4dae09][_0x3f79('0x69')])){_0xa95d4a[_0xf1bf23[_0x5cbff9[_0x4dae09][_0x3f79('0x69')]]]=_0x5cbff9[_0x4dae09]['answer'];}}for(var _0x1c414e in _0xf1bf23){if(!_0xa95d4a[_0x3f79('0x37')](_0xf1bf23[_0x1c414e])){_0xa95d4a[_0xf1bf23[_0x1c414e]]=null;}}_0x3e6d52[_0x3f79('0x6d')](_0xa95d4a);}return _0x3e6d52;}})[_0x3f79('0x24')](function(_0x4c985d){if(!_['isEmpty'](_0x4c985d)){var _0x334152=toCsv(_0x4c985d);var _0x127530=Date[_0x3f79('0x6e')]();fs[_0x3f79('0x6f')](util[_0x3f79('0x70')](_0x3f79('0x71'),_0x3bc992[_0x3f79('0x53')]['id'],_0x127530),_0x334152);_0x8e6349[_0x3f79('0x72')](_0x3f79('0x73'),'attachment;\x20filename='+util[_0x3f79('0x70')](_0x3f79('0x74'),_0x3bc992[_0x3f79('0x53')]['id'],_0x127530));_0x8e6349[_0x3f79('0x72')](_0x3f79('0x75'),_0x3f79('0x76'));return _0x8e6349[_0x3f79('0x77')](util[_0x3f79('0x70')](_0x3f79('0x71'),_0x3bc992['params']['id'],_0x127530));}else{return _0x8e6349['sendStatus'](0xcc);}})['catch'](handleError(_0x8e6349,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 29d30c8..8d03694 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 _0x562d=['path','../../config/environment','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x384e98,_0x3ce130){var _0x385e81=function(_0x3e5af1){while(--_0x3e5af1){_0x384e98['push'](_0x384e98['shift']());}};_0x385e81(++_0x3ce130);}(_0x562d,0xe1));var _0xd562=function(_0x18f64a,_0x1c8248){_0x18f64a=_0x18f64a-0x0;var _0x44687f=_0x562d[_0x18f64a];return _0x44687f;};'use strict';var _=require(_0xd562('0x0'));var util=require(_0xd562('0x1'));var logger=require(_0xd562('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd562('0x3'));var rp=require(_0xd562('0x4'));var fs=require('fs');var path=require(_0xd562('0x5'));var rimraf=require('rimraf');var config=require(_0xd562('0x6'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x1d05e9,_0x46bf9b){return _0x1d05e9[_0xd562('0x7')](_0xd562('0x8'),attributes,{'tableName':_0xd562('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fc6=['rimraf','../../config/environment','define','jscripty_projects','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x34d823,_0x2d20b0){var _0x1eb90c=function(_0x43eda6){while(--_0x43eda6){_0x34d823['push'](_0x34d823['shift']());}};_0x1eb90c(++_0x2d20b0);}(_0x3fc6,0x159));var _0x63fc=function(_0xe3f5b0,_0x502816){_0xe3f5b0=_0xe3f5b0-0x0;var _0x2bebcb=_0x3fc6[_0xe3f5b0];return _0x2bebcb;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var logger=require(_0x63fc('0x2'))('api');var moment=require(_0x63fc('0x3'));var BPromise=require(_0x63fc('0x4'));var rp=require(_0x63fc('0x5'));var fs=require('fs');var path=require(_0x63fc('0x6'));var rimraf=require(_0x63fc('0x7'));var config=require(_0x63fc('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0xdb65b8,_0x7d24f){return _0xdb65b8[_0x63fc('0x9')]('JscriptyProject',attributes,{'tableName':_0x63fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 0c61f45..77b4158 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(_0x240e70,_0x46efa7){var _0x5d9361=function(_0x408271){while(--_0x408271){_0x240e70['push'](_0x240e70['shift']());}};_0x5d9361(++_0x46efa7);}(_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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x2ba5c4,_0x276dd8){var _0x2da8dc=function(_0x529054){while(--_0x529054){_0x2ba5c4['push'](_0x2ba5c4['shift']());}};_0x2da8dc(++_0x276dd8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0xcb91[_0x5cc8];return _0x450661;};'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')]('JscriptyProject,\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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 68ac466..8c3c83a 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 _0xdd98=['../../config/environment','get','/describe','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util','path','express','../../components/interaction/service'];(function(_0x76641c,_0x18870c){var _0x53e88e=function(_0x515451){while(--_0x515451){_0x76641c['push'](_0x76641c['shift']());}};_0x53e88e(++_0x18870c);}(_0xdd98,0x1eb));var _0x8dd9=function(_0x50e153,_0x4e8ede){_0x50e153=_0x50e153-0x0;var _0x3f76e1=_0xdd98[_0x50e153];return _0x3f76e1;};'use strict';var multer=require(_0x8dd9('0x0'));var util=require(_0x8dd9('0x1'));var path=require(_0x8dd9('0x2'));var timeout=require('connect-timeout');var express=require(_0x8dd9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8dd9('0x4'));var config=require(_0x8dd9('0x5'));var controller=require('./jscriptyQuestionReport.controller');router[_0x8dd9('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8dd9('0x7'),auth[_0x8dd9('0x8')](),controller['describe']);router[_0x8dd9('0x6')](_0x8dd9('0x9'),auth[_0x8dd9('0x8')](),controller['show']);router[_0x8dd9('0xa')]('/',auth[_0x8dd9('0x8')](),controller[_0x8dd9('0xb')]);router[_0x8dd9('0xc')](_0x8dd9('0x9'),auth[_0x8dd9('0x8')](),controller[_0x8dd9('0xd')]);router[_0x8dd9('0xe')](_0x8dd9('0x9'),auth[_0x8dd9('0x8')](),controller['destroy']);module[_0x8dd9('0xf')]=router; \ No newline at end of file +var _0x85e7=['get','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','index','/describe','isAuthenticated','describe'];(function(_0x17876c,_0x17c9e3){var _0x26844b=function(_0x497029){while(--_0x497029){_0x17876c['push'](_0x17876c['shift']());}};_0x26844b(++_0x17c9e3);}(_0x85e7,0x104));var _0x785e=function(_0x27d129,_0x422f0c){_0x27d129=_0x27d129-0x0;var _0x2d8c2b=_0x85e7[_0x27d129];return _0x2d8c2b;};'use strict';var multer=require(_0x785e('0x0'));var util=require('util');var path=require(_0x785e('0x1'));var timeout=require(_0x785e('0x2'));var express=require(_0x785e('0x3'));var router=express[_0x785e('0x4')]();var fs_extra=require(_0x785e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x785e('0x6'));var config=require(_0x785e('0x7'));var controller=require(_0x785e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x785e('0x9')]);router['get'](_0x785e('0xa'),auth[_0x785e('0xb')](),controller[_0x785e('0xc')]);router[_0x785e('0xd')](_0x785e('0xe'),auth[_0x785e('0xb')](),controller[_0x785e('0xf')]);router[_0x785e('0x10')]('/',auth[_0x785e('0xb')](),controller['create']);router[_0x785e('0x11')](_0x785e('0xe'),auth[_0x785e('0xb')](),controller[_0x785e('0x12')]);router['delete'](_0x785e('0xe'),auth[_0x785e('0xb')](),controller[_0x785e('0x13')]);module[_0x785e('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index d5396c1..a4b62b4 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(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7a54,0x106));var _0x47a5=function(_0x4d7b34,_0x56dd22){_0x4d7b34=_0x4d7b34-0x0;var _0x300c34=_0x7a54[_0x4d7b34];return _0x300c34;};'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(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0x36870a,_0x3ffae2){_0x36870a=_0x36870a-0x0;var _0x7de030=_0x7a54[_0x36870a];return _0x7de030;};'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 084a841..db2391f 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 _0xb218=['intersection','attributes','fields','length','nolimit','limit','order','sort','filters','pick','where','VIRTUAL','filter','options','includeAll','include','catch','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb218,0xee));var _0x8b21=function(_0x239d4f,_0x412468){_0x239d4f=_0x239d4f-0x0;var _0x393070=_0xb218[_0x239d4f];return _0x393070;};'use strict';var emlformat=require(_0x8b21('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8b21('0x1'));var rp=require(_0x8b21('0x2'));var moment=require(_0x8b21('0x3'));var BPromise=require(_0x8b21('0x4'));var Mustache=require('mustache');var util=require(_0x8b21('0x5'));var path=require(_0x8b21('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b21('0x7'));var _=require(_0x8b21('0x8'));var squel=require(_0x8b21('0x9'));var crypto=require('crypto');var jsforce=require(_0x8b21('0xa'));var deskjs=require(_0x8b21('0xb'));var toCsv=require(_0x8b21('0xc'));var querystring=require(_0x8b21('0xd'));var Papa=require(_0x8b21('0xe'));var Redis=require(_0x8b21('0xf'));var authService=require(_0x8b21('0x10'));var qs=require(_0x8b21('0x11'));var as=require(_0x8b21('0x12'));var hardwareService=require(_0x8b21('0x13'));var logger=require(_0x8b21('0x14'))('api');var utils=require(_0x8b21('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8b21('0x16'));var db=require(_0x8b21('0x17'))['db'];function respondWithStatusCode(_0x21aa4d,_0x480552){_0x480552=_0x480552||0xcc;return function(_0x3c275c){if(_0x3c275c){return _0x21aa4d[_0x8b21('0x18')](_0x480552);}return _0x21aa4d[_0x8b21('0x19')](_0x480552)[_0x8b21('0x1a')]();};}function respondWithResult(_0x1faed2,_0x2048bf){_0x2048bf=_0x2048bf||0xc8;return function(_0x163a08){if(_0x163a08){return _0x1faed2[_0x8b21('0x19')](_0x2048bf)[_0x8b21('0x1b')](_0x163a08);}};}function respondWithFilteredResult(_0x2fba39,_0x1d77d9){return function(_0x4ee614){if(_0x4ee614){var _0x3034fd=typeof _0x1d77d9[_0x8b21('0x1c')]==='undefined'&&typeof _0x1d77d9['limit']===_0x8b21('0x1d');var _0x400858=_0x4ee614[_0x8b21('0x1e')];var _0x33010f=_0x3034fd?0x0:_0x1d77d9[_0x8b21('0x1c')];var _0x5b2bb9=_0x3034fd?_0x4ee614[_0x8b21('0x1e')]:_0x1d77d9['offset']+_0x1d77d9['limit'];var _0x129c1c;if(_0x5b2bb9>=_0x400858){_0x5b2bb9=_0x400858;_0x129c1c=0xc8;}else{_0x129c1c=0xce;}_0x2fba39[_0x8b21('0x19')](_0x129c1c);return _0x2fba39[_0x8b21('0x1f')](_0x8b21('0x20'),_0x33010f+'-'+_0x5b2bb9+'/'+_0x400858)[_0x8b21('0x1b')](_0x4ee614);}return null;};}function patchUpdates(_0x21f73e){return function(_0x5b438e){try{jsonpatch[_0x8b21('0x21')](_0x5b438e,_0x21f73e,!![]);}catch(_0x11707d){return BPromise['reject'](_0x11707d);}return _0x5b438e['save']();};}function saveUpdates(_0x2acef9,_0x4b2ed6){return function(_0x4ae2f1){if(_0x4ae2f1){return _0x4ae2f1[_0x8b21('0x22')](_0x2acef9)[_0x8b21('0x23')](function(_0x55c13d){return _0x55c13d;});}return null;};}function removeEntity(_0x430fcc,_0x2e25b6){return function(_0x2ff6aa){if(_0x2ff6aa){return _0x2ff6aa[_0x8b21('0x24')]()[_0x8b21('0x23')](function(){_0x430fcc['status'](0xcc)[_0x8b21('0x1a')]();});}};}function handleEntityNotFound(_0x441b35,_0x4ac323){return function(_0x241a93){if(!_0x241a93){_0x441b35[_0x8b21('0x18')](0x194);}return _0x241a93;};}function handleError(_0x1de10f,_0x427066){_0x427066=_0x427066||0x1f4;return function(_0x2eff16){logger[_0x8b21('0x25')](_0x2eff16[_0x8b21('0x26')]);if(_0x2eff16[_0x8b21('0x27')]){delete _0x2eff16['name'];}_0x1de10f['status'](_0x427066)[_0x8b21('0x28')](_0x2eff16);};}exports[_0x8b21('0x29')]=function(_0x1a44ab,_0x3c4be5){var _0x460a7e={},_0x3a5c2b={},_0x1a4ae1={'count':0x0,'rows':[]};var _0x27845b=_[_0x8b21('0x2a')](db[_0x8b21('0x2b')][_0x8b21('0x2c')],function(_0x344350){return{'name':_0x344350['fieldName'],'type':_0x344350[_0x8b21('0x2d')][_0x8b21('0x2e')]};});_0x3a5c2b[_0x8b21('0x2f')]=_['map'](_0x27845b,_0x8b21('0x27'));_0x3a5c2b[_0x8b21('0x30')]=_[_0x8b21('0x31')](_0x1a44ab[_0x8b21('0x30')]);_0x3a5c2b['filters']=_[_0x8b21('0x32')](_0x3a5c2b[_0x8b21('0x2f')],_0x3a5c2b['query']);_0x460a7e[_0x8b21('0x33')]=_[_0x8b21('0x32')](_0x3a5c2b[_0x8b21('0x2f')],qs[_0x8b21('0x34')](_0x1a44ab['query'][_0x8b21('0x34')]));_0x460a7e['attributes']=_0x460a7e['attributes'][_0x8b21('0x35')]?_0x460a7e[_0x8b21('0x33')]:_0x3a5c2b[_0x8b21('0x2f')];if(!_0x1a44ab[_0x8b21('0x30')]['hasOwnProperty'](_0x8b21('0x36'))){_0x460a7e[_0x8b21('0x37')]=qs[_0x8b21('0x37')](_0x1a44ab[_0x8b21('0x30')]['limit']);_0x460a7e[_0x8b21('0x1c')]=qs[_0x8b21('0x1c')](_0x1a44ab['query'][_0x8b21('0x1c')]);}_0x460a7e[_0x8b21('0x38')]=qs[_0x8b21('0x39')](_0x1a44ab['query']['sort']);_0x460a7e['where']=qs[_0x8b21('0x3a')](_[_0x8b21('0x3b')](_0x1a44ab[_0x8b21('0x30')],_0x3a5c2b[_0x8b21('0x3a')]),_0x27845b);if(_0x1a44ab['query']['filter']){_0x460a7e[_0x8b21('0x3c')]=_['merge'](_0x460a7e['where'],{'$or':_[_0x8b21('0x2a')](_0x27845b,function(_0x3f991f){if(_0x3f991f[_0x8b21('0x2d')]!==_0x8b21('0x3d')){var _0x4bd44c={};_0x4bd44c[_0x3f991f[_0x8b21('0x27')]]={'$like':'%'+_0x1a44ab[_0x8b21('0x30')][_0x8b21('0x3e')]+'%'};return _0x4bd44c;}})});}_0x460a7e=_['merge']({},_0x460a7e,_0x1a44ab[_0x8b21('0x3f')]);var _0xc8a66a={'where':_0x460a7e['where']};return db[_0x8b21('0x2b')][_0x8b21('0x1e')](_0xc8a66a)[_0x8b21('0x23')](function(_0x55cd86){_0x1a4ae1[_0x8b21('0x1e')]=_0x55cd86;if(_0x1a44ab[_0x8b21('0x30')][_0x8b21('0x40')]){_0x460a7e[_0x8b21('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x460a7e);})[_0x8b21('0x23')](function(_0x119dff){_0x1a4ae1['rows']=_0x119dff;return _0x1a4ae1;})[_0x8b21('0x23')](respondWithFilteredResult(_0x3c4be5,_0x460a7e))[_0x8b21('0x42')](handleError(_0x3c4be5,null));};exports['show']=function(_0xc00d10,_0x2424ec){var _0x442c47={'raw':!![],'where':{'id':_0xc00d10[_0x8b21('0x43')]['id']}},_0x5e9de7={};_0x5e9de7['model']=_['keys'](db[_0x8b21('0x2b')][_0x8b21('0x2c')]);_0x5e9de7['query']=_[_0x8b21('0x31')](_0xc00d10['query']);_0x5e9de7[_0x8b21('0x3a')]=_[_0x8b21('0x32')](_0x5e9de7['model'],_0x5e9de7['query']);_0x442c47[_0x8b21('0x33')]=_[_0x8b21('0x32')](_0x5e9de7[_0x8b21('0x2f')],qs[_0x8b21('0x34')](_0xc00d10[_0x8b21('0x30')]['fields']));_0x442c47[_0x8b21('0x33')]=_0x442c47[_0x8b21('0x33')][_0x8b21('0x35')]?_0x442c47[_0x8b21('0x33')]:_0x5e9de7['model'];if(_0xc00d10[_0x8b21('0x30')][_0x8b21('0x40')]){_0x442c47[_0x8b21('0x41')]=[{'all':!![]}];}_0x442c47=_['merge']({},_0x442c47,_0xc00d10[_0x8b21('0x3f')]);return db[_0x8b21('0x2b')][_0x8b21('0x44')](_0x442c47)['then'](handleEntityNotFound(_0x2424ec,null))[_0x8b21('0x23')](respondWithResult(_0x2424ec,null))['catch'](handleError(_0x2424ec,null));};exports[_0x8b21('0x45')]=function(_0x46d6ba,_0x39dcd8){return db['JscriptyQuestionReport'][_0x8b21('0x45')](_0x46d6ba[_0x8b21('0x46')],{})[_0x8b21('0x23')](respondWithResult(_0x39dcd8,0xc9))[_0x8b21('0x42')](handleError(_0x39dcd8,null));};exports['update']=function(_0x573ee5,_0x13c3f5){if(_0x573ee5[_0x8b21('0x46')]['id']){delete _0x573ee5[_0x8b21('0x46')]['id'];}return db[_0x8b21('0x2b')][_0x8b21('0x44')]({'where':{'id':_0x573ee5[_0x8b21('0x43')]['id']}})['then'](handleEntityNotFound(_0x13c3f5,null))[_0x8b21('0x23')](saveUpdates(_0x573ee5['body'],null))[_0x8b21('0x23')](respondWithResult(_0x13c3f5,null))['catch'](handleError(_0x13c3f5,null));};exports['destroy']=function(_0x26607f,_0x39924e){return db[_0x8b21('0x2b')][_0x8b21('0x44')]({'where':{'id':_0x26607f[_0x8b21('0x43')]['id']}})[_0x8b21('0x23')](handleEntityNotFound(_0x39924e,null))[_0x8b21('0x23')](removeEntity(_0x39924e,null))['catch'](handleError(_0x39924e,null));};exports[_0x8b21('0x47')]=function(_0x4306fa,_0x598287){return db[_0x8b21('0x2b')][_0x8b21('0x47')]()['then'](respondWithResult(_0x598287,null))[_0x8b21('0x42')](handleError(_0x598287,null));}; \ No newline at end of file +var _0x9054=['request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','update','then','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3394a6,_0x7b1ede){var _0x4a7909=function(_0x20451f){while(--_0x20451f){_0x3394a6['push'](_0x3394a6['shift']());}};_0x4a7909(++_0x7b1ede);}(_0x9054,0xe0));var _0x4905=function(_0x103fd0,_0x3d6bf0){_0x103fd0=_0x103fd0-0x0;var _0x4bc231=_0x9054[_0x103fd0];return _0x4bc231;};'use strict';var emlformat=require(_0x4905('0x0'));var rimraf=require(_0x4905('0x1'));var zipdir=require(_0x4905('0x2'));var jsonpatch=require(_0x4905('0x3'));var rp=require(_0x4905('0x4'));var moment=require('moment');var BPromise=require(_0x4905('0x5'));var Mustache=require(_0x4905('0x6'));var util=require(_0x4905('0x7'));var path=require('path');var sox=require(_0x4905('0x8'));var csv=require(_0x4905('0x9'));var ejs=require(_0x4905('0xa'));var fs=require('fs');var fs_extra=require(_0x4905('0xb'));var _=require(_0x4905('0xc'));var squel=require(_0x4905('0xd'));var crypto=require(_0x4905('0xe'));var jsforce=require(_0x4905('0xf'));var deskjs=require(_0x4905('0x10'));var toCsv=require(_0x4905('0x9'));var querystring=require(_0x4905('0x11'));var Papa=require(_0x4905('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4905('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4905('0x14'))('api');var utils=require(_0x4905('0x15'));var config=require(_0x4905('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4905('0x17'))['db'];function respondWithStatusCode(_0xe962b0,_0x544c60){_0x544c60=_0x544c60||0xcc;return function(_0x5ec9f1){if(_0x5ec9f1){return _0xe962b0[_0x4905('0x18')](_0x544c60);}return _0xe962b0['status'](_0x544c60)[_0x4905('0x19')]();};}function respondWithResult(_0x513e67,_0x5250ec){_0x5250ec=_0x5250ec||0xc8;return function(_0x24cde5){if(_0x24cde5){return _0x513e67['status'](_0x5250ec)[_0x4905('0x1a')](_0x24cde5);}};}function respondWithFilteredResult(_0x259c8e,_0x4d7600){return function(_0x5d8abe){if(_0x5d8abe){var _0x137d64=typeof _0x4d7600[_0x4905('0x1b')]===_0x4905('0x1c')&&typeof _0x4d7600[_0x4905('0x1d')]==='undefined';var _0xf02707=_0x5d8abe['count'];var _0x269cb8=_0x137d64?0x0:_0x4d7600[_0x4905('0x1b')];var _0x2bb701=_0x137d64?_0x5d8abe[_0x4905('0x1e')]:_0x4d7600[_0x4905('0x1b')]+_0x4d7600[_0x4905('0x1d')];var _0x38bac4;if(_0x2bb701>=_0xf02707){_0x2bb701=_0xf02707;_0x38bac4=0xc8;}else{_0x38bac4=0xce;}_0x259c8e[_0x4905('0x1f')](_0x38bac4);return _0x259c8e[_0x4905('0x20')]('Content-Range',_0x269cb8+'-'+_0x2bb701+'/'+_0xf02707)[_0x4905('0x1a')](_0x5d8abe);}return null;};}function patchUpdates(_0x3149fc){return function(_0x90a22f){try{jsonpatch[_0x4905('0x21')](_0x90a22f,_0x3149fc,!![]);}catch(_0x1331e8){return BPromise[_0x4905('0x22')](_0x1331e8);}return _0x90a22f['save']();};}function saveUpdates(_0x25ef0f,_0x2298c5){return function(_0x204a48){if(_0x204a48){return _0x204a48[_0x4905('0x23')](_0x25ef0f)[_0x4905('0x24')](function(_0x2628d4){return _0x2628d4;});}return null;};}function removeEntity(_0x4259f1,_0x39cff1){return function(_0x4931b6){if(_0x4931b6){return _0x4931b6['destroy']()[_0x4905('0x24')](function(){_0x4259f1[_0x4905('0x1f')](0xcc)[_0x4905('0x19')]();});}};}function handleEntityNotFound(_0x4b46f0,_0x4bc3d5){return function(_0x5d110){if(!_0x5d110){_0x4b46f0[_0x4905('0x18')](0x194);}return _0x5d110;};}function handleError(_0x33e558,_0x365812){_0x365812=_0x365812||0x1f4;return function(_0x411d7b){logger[_0x4905('0x25')](_0x411d7b[_0x4905('0x26')]);if(_0x411d7b[_0x4905('0x27')]){delete _0x411d7b[_0x4905('0x27')];}_0x33e558[_0x4905('0x1f')](_0x365812)[_0x4905('0x28')](_0x411d7b);};}exports[_0x4905('0x29')]=function(_0x585a0d,_0x57fbfe){var _0x3cf9c4={},_0x5f1e9e={},_0x1456d8={'count':0x0,'rows':[]};var _0x3473f9=_['map'](db[_0x4905('0x2a')][_0x4905('0x2b')],function(_0x76d976){return{'name':_0x76d976[_0x4905('0x2c')],'type':_0x76d976[_0x4905('0x2d')][_0x4905('0x2e')]};});_0x5f1e9e[_0x4905('0x2f')]=_[_0x4905('0x30')](_0x3473f9,'name');_0x5f1e9e['query']=_[_0x4905('0x31')](_0x585a0d[_0x4905('0x32')]);_0x5f1e9e['filters']=_[_0x4905('0x33')](_0x5f1e9e['model'],_0x5f1e9e[_0x4905('0x32')]);_0x3cf9c4[_0x4905('0x34')]=_['intersection'](_0x5f1e9e['model'],qs[_0x4905('0x35')](_0x585a0d['query'][_0x4905('0x35')]));_0x3cf9c4['attributes']=_0x3cf9c4[_0x4905('0x34')][_0x4905('0x36')]?_0x3cf9c4['attributes']:_0x5f1e9e[_0x4905('0x2f')];if(!_0x585a0d[_0x4905('0x32')][_0x4905('0x37')](_0x4905('0x38'))){_0x3cf9c4[_0x4905('0x1d')]=qs[_0x4905('0x1d')](_0x585a0d['query'][_0x4905('0x1d')]);_0x3cf9c4['offset']=qs['offset'](_0x585a0d[_0x4905('0x32')][_0x4905('0x1b')]);}_0x3cf9c4[_0x4905('0x39')]=qs[_0x4905('0x3a')](_0x585a0d[_0x4905('0x32')][_0x4905('0x3a')]);_0x3cf9c4[_0x4905('0x3b')]=qs[_0x4905('0x3c')](_[_0x4905('0x3d')](_0x585a0d[_0x4905('0x32')],_0x5f1e9e[_0x4905('0x3c')]),_0x3473f9);if(_0x585a0d[_0x4905('0x32')][_0x4905('0x3e')]){_0x3cf9c4[_0x4905('0x3b')]=_[_0x4905('0x3f')](_0x3cf9c4[_0x4905('0x3b')],{'$or':_[_0x4905('0x30')](_0x3473f9,function(_0x20682d){if(_0x20682d['type']!=='VIRTUAL'){var _0x207fc4={};_0x207fc4[_0x20682d[_0x4905('0x27')]]={'$like':'%'+_0x585a0d[_0x4905('0x32')][_0x4905('0x3e')]+'%'};return _0x207fc4;}})});}_0x3cf9c4=_[_0x4905('0x3f')]({},_0x3cf9c4,_0x585a0d[_0x4905('0x40')]);var _0x5b26d6={'where':_0x3cf9c4[_0x4905('0x3b')]};return db['JscriptyQuestionReport'][_0x4905('0x1e')](_0x5b26d6)['then'](function(_0x9d766d){_0x1456d8['count']=_0x9d766d;if(_0x585a0d[_0x4905('0x32')][_0x4905('0x41')]){_0x3cf9c4[_0x4905('0x42')]=[{'all':!![]}];}return db[_0x4905('0x2a')]['findAll'](_0x3cf9c4);})[_0x4905('0x24')](function(_0x589724){_0x1456d8[_0x4905('0x43')]=_0x589724;return _0x1456d8;})[_0x4905('0x24')](respondWithFilteredResult(_0x57fbfe,_0x3cf9c4))['catch'](handleError(_0x57fbfe,null));};exports[_0x4905('0x44')]=function(_0x50b765,_0x3698c0){var _0x1bcab1={'raw':!![],'where':{'id':_0x50b765[_0x4905('0x45')]['id']}},_0x229bfb={};_0x229bfb[_0x4905('0x2f')]=_[_0x4905('0x31')](db[_0x4905('0x2a')][_0x4905('0x2b')]);_0x229bfb[_0x4905('0x32')]=_[_0x4905('0x31')](_0x50b765['query']);_0x229bfb[_0x4905('0x3c')]=_[_0x4905('0x33')](_0x229bfb[_0x4905('0x2f')],_0x229bfb[_0x4905('0x32')]);_0x1bcab1[_0x4905('0x34')]=_[_0x4905('0x33')](_0x229bfb[_0x4905('0x2f')],qs[_0x4905('0x35')](_0x50b765['query'][_0x4905('0x35')]));_0x1bcab1[_0x4905('0x34')]=_0x1bcab1[_0x4905('0x34')][_0x4905('0x36')]?_0x1bcab1[_0x4905('0x34')]:_0x229bfb['model'];if(_0x50b765[_0x4905('0x32')]['includeAll']){_0x1bcab1[_0x4905('0x42')]=[{'all':!![]}];}_0x1bcab1=_['merge']({},_0x1bcab1,_0x50b765[_0x4905('0x40')]);return db[_0x4905('0x2a')][_0x4905('0x46')](_0x1bcab1)[_0x4905('0x24')](handleEntityNotFound(_0x3698c0,null))['then'](respondWithResult(_0x3698c0,null))[_0x4905('0x47')](handleError(_0x3698c0,null));};exports[_0x4905('0x48')]=function(_0x352dac,_0x4ef8ec){return db['JscriptyQuestionReport'][_0x4905('0x48')](_0x352dac[_0x4905('0x49')],{})[_0x4905('0x24')](respondWithResult(_0x4ef8ec,0xc9))[_0x4905('0x47')](handleError(_0x4ef8ec,null));};exports[_0x4905('0x23')]=function(_0x28d819,_0x5e6d65){if(_0x28d819['body']['id']){delete _0x28d819['body']['id'];}return db[_0x4905('0x2a')][_0x4905('0x46')]({'where':{'id':_0x28d819[_0x4905('0x45')]['id']}})[_0x4905('0x24')](handleEntityNotFound(_0x5e6d65,null))[_0x4905('0x24')](saveUpdates(_0x28d819[_0x4905('0x49')],null))[_0x4905('0x24')](respondWithResult(_0x5e6d65,null))[_0x4905('0x47')](handleError(_0x5e6d65,null));};exports[_0x4905('0x4a')]=function(_0x273124,_0x563e31){return db[_0x4905('0x2a')]['find']({'where':{'id':_0x273124['params']['id']}})[_0x4905('0x24')](handleEntityNotFound(_0x563e31,null))[_0x4905('0x24')](removeEntity(_0x563e31,null))[_0x4905('0x47')](handleError(_0x563e31,null));};exports[_0x4905('0x4b')]=function(_0x4d128a,_0x5b6c81){return db['JscriptyQuestionReport'][_0x4905('0x4b')]()[_0x4905('0x24')](respondWithResult(_0x5b6c81,null))[_0x4905('0x47')](handleError(_0x5b6c81,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index ea08c11..366da91 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 _0x4c9d=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x1b053b,_0x4915e9){var _0x266a81=function(_0x41f6a3){while(--_0x41f6a3){_0x1b053b['push'](_0x1b053b['shift']());}};_0x266a81(++_0x4915e9);}(_0x4c9d,0x1de));var _0xd4c9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4c9d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd4c9('0x0'));var util=require(_0xd4c9('0x1'));var logger=require('../../config/logger')(_0xd4c9('0x2'));var moment=require(_0xd4c9('0x3'));var BPromise=require(_0xd4c9('0x4'));var rp=require(_0xd4c9('0x5'));var fs=require('fs');var path=require(_0xd4c9('0x6'));var rimraf=require(_0xd4c9('0x7'));var config=require(_0xd4c9('0x8'));var attributes=require(_0xd4c9('0x9'));module[_0xd4c9('0xa')]=function(_0x4e40a8,_0x3ee7c5){return _0x4e40a8[_0xd4c9('0xb')](_0xd4c9('0xc'),attributes,{'tableName':_0xd4c9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4922=['api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x407461,_0x1cf61c){var _0x2b3ffa=function(_0x2acb31){while(--_0x2acb31){_0x407461['push'](_0x407461['shift']());}};_0x2b3ffa(++_0x1cf61c);}(_0x4922,0x1c3));var _0x2492=function(_0x5a3fd7,_0x5919da){_0x5a3fd7=_0x5a3fd7-0x0;var _0x572299=_0x4922[_0x5a3fd7];return _0x572299;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2492('0x0'));var moment=require(_0x2492('0x1'));var BPromise=require(_0x2492('0x2'));var rp=require(_0x2492('0x3'));var fs=require('fs');var path=require(_0x2492('0x4'));var rimraf=require('rimraf');var config=require(_0x2492('0x5'));var attributes=require(_0x2492('0x6'));module[_0x2492('0x7')]=function(_0x50708d,_0x378422){return _0x50708d[_0x2492('0x8')](_0x2492('0x9'),attributes,{'tableName':_0x2492('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index df55363..032ec10 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 _0xf34f=['../../config/environment','jayson/promise','client','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x597be4,_0x27e874){var _0x2b2608=function(_0x37ca34){while(--_0x37ca34){_0x597be4['push'](_0x597be4['shift']());}};_0x2b2608(++_0x27e874);}(_0xf34f,0x1db));var _0xff34=function(_0x316ef3,_0x48bdf6){_0x316ef3=_0x316ef3-0x0;var _0x445617=_0xf34f[_0x316ef3];return _0x445617;};'use strict';var _=require('lodash');var util=require(_0xff34('0x0'));var moment=require(_0xff34('0x1'));var BPromise=require(_0xff34('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff34('0x3'));var db=require(_0xff34('0x4'))['db'];var utils=require(_0xff34('0x5'));var logger=require(_0xff34('0x6'))(_0xff34('0x7'));var config=require(_0xff34('0x8'));var jayson=require(_0xff34('0x9'));var client=jayson[_0xff34('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x377fb9,_0x17f6c4,_0x3c3b8d){return new BPromise(function(_0x3925b9,_0x3db158){return client[_0xff34('0xb')](_0x377fb9,_0x3c3b8d)['then'](function(_0x1a1f6){logger[_0xff34('0xc')](_0xff34('0xd'),_0x17f6c4,_0xff34('0xe'));logger[_0xff34('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x17f6c4,_0xff34('0xe'),JSON['stringify'](_0x1a1f6));if(_0x1a1f6[_0xff34('0x10')]){if(_0x1a1f6[_0xff34('0x10')][_0xff34('0x11')]===0x1f4){logger[_0xff34('0x10')](_0xff34('0xd'),_0x17f6c4,_0x1a1f6[_0xff34('0x10')]['message']);return _0x3db158(_0x1a1f6[_0xff34('0x10')][_0xff34('0x12')]);}logger[_0xff34('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x17f6c4,_0x1a1f6['error'][_0xff34('0x12')]);return _0x3925b9(_0x1a1f6[_0xff34('0x10')][_0xff34('0x12')]);}else{logger[_0xff34('0xc')](_0xff34('0xd'),_0x17f6c4,_0xff34('0xe'));_0x3925b9(_0x1a1f6[_0xff34('0x13')][_0xff34('0x12')]);}})[_0xff34('0x14')](function(_0x1c76ae){logger[_0xff34('0x10')](_0xff34('0xd'),_0x17f6c4,_0x1c76ae);_0x3db158(_0x1c76ae);});});} \ No newline at end of file +var _0x0fdd=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','request\x20sent','debug','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0x4d3aab,_0x2be4dc){var _0x11b002=function(_0xcf75f){while(--_0xcf75f){_0x4d3aab['push'](_0x4d3aab['shift']());}};_0x11b002(++_0x2be4dc);}(_0x0fdd,0x1d9));var _0xd0fd=function(_0x345f90,_0x209bfc){_0x345f90=_0x345f90-0x0;var _0x49497c=_0x0fdd[_0x345f90];return _0x49497c;};'use strict';var _=require('lodash');var util=require(_0xd0fd('0x0'));var moment=require(_0xd0fd('0x1'));var BPromise=require(_0xd0fd('0x2'));var rs=require(_0xd0fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0fd('0x4'))['db'];var utils=require(_0xd0fd('0x5'));var logger=require(_0xd0fd('0x6'))('rpc');var config=require(_0xd0fd('0x7'));var jayson=require(_0xd0fd('0x8'));var client=jayson[_0xd0fd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x272105,_0x1247da,_0x4a5a29){return new BPromise(function(_0x47ebbe,_0x156c3f){return client[_0xd0fd('0xa')](_0x272105,_0x4a5a29)['then'](function(_0x374af1){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1247da,_0xd0fd('0xb'));logger[_0xd0fd('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x1247da,_0xd0fd('0xb'),JSON['stringify'](_0x374af1));if(_0x374af1['error']){if(_0x374af1[_0xd0fd('0xd')][_0xd0fd('0xe')]===0x1f4){logger[_0xd0fd('0xd')](_0xd0fd('0xf'),_0x1247da,_0x374af1[_0xd0fd('0xd')]['message']);return _0x156c3f(_0x374af1['error']['message']);}logger['error'](_0xd0fd('0xf'),_0x1247da,_0x374af1['error'][_0xd0fd('0x10')]);return _0x47ebbe(_0x374af1[_0xd0fd('0xd')][_0xd0fd('0x10')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1247da,_0xd0fd('0xb'));_0x47ebbe(_0x374af1[_0xd0fd('0x11')]['message']);}})[_0xd0fd('0x12')](function(_0x221618){logger[_0xd0fd('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1247da,_0x221618);_0x156c3f(_0x221618);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index e608825..66f5b7a 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 _0x750c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','show','/:id/questions','getQuestions','post','create','put','/:id','update','delete','exports','util','path'];(function(_0x21799b,_0x17a5fa){var _0x2fbda8=function(_0x3f1da4){while(--_0x3f1da4){_0x21799b['push'](_0x21799b['shift']());}};_0x2fbda8(++_0x17a5fa);}(_0x750c,0x157));var _0xc750=function(_0x20dc1c,_0x21d9e8){_0x20dc1c=_0x20dc1c-0x0;var _0x108360=_0x750c[_0x20dc1c];return _0x108360;};'use strict';var multer=require('multer');var util=require(_0xc750('0x0'));var path=require(_0xc750('0x1'));var timeout=require(_0xc750('0x2'));var express=require(_0xc750('0x3'));var router=express[_0xc750('0x4')]();var fs_extra=require(_0xc750('0x5'));var auth=require(_0xc750('0x6'));var interaction=require(_0xc750('0x7'));var config=require('../../config/environment');var controller=require(_0xc750('0x8'));router[_0xc750('0x9')]('/',auth[_0xc750('0xa')](),controller[_0xc750('0xb')]);router[_0xc750('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc750('0xc')]);router[_0xc750('0x9')]('/:id',auth[_0xc750('0xa')](),controller[_0xc750('0xd')]);router[_0xc750('0x9')](_0xc750('0xe'),auth[_0xc750('0xa')](),controller[_0xc750('0xf')]);router[_0xc750('0x10')]('/',auth[_0xc750('0xa')](),controller[_0xc750('0x11')]);router[_0xc750('0x12')](_0xc750('0x13'),auth[_0xc750('0xa')](),controller[_0xc750('0x14')]);router[_0xc750('0x15')](_0xc750('0x13'),auth[_0xc750('0xa')](),controller['destroy']);module[_0xc750('0x16')]=router; \ No newline at end of file +var _0x7567=['/:id/questions','getQuestions','post','create','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x17b8fc,_0x136a24){var _0x1a6137=function(_0x48f3e0){while(--_0x48f3e0){_0x17b8fc['push'](_0x17b8fc['shift']());}};_0x1a6137(++_0x136a24);}(_0x7567,0x149));var _0x7756=function(_0x1bd850,_0x1d972a){_0x1bd850=_0x1bd850-0x0;var _0x3ebd2b=_0x7567[_0x1bd850];return _0x3ebd2b;};'use strict';var multer=require(_0x7756('0x0'));var util=require('util');var path=require(_0x7756('0x1'));var timeout=require(_0x7756('0x2'));var express=require(_0x7756('0x3'));var router=express[_0x7756('0x4')]();var fs_extra=require(_0x7756('0x5'));var auth=require(_0x7756('0x6'));var interaction=require(_0x7756('0x7'));var config=require(_0x7756('0x8'));var controller=require('./jscriptySessionReport.controller');router[_0x7756('0x9')]('/',auth[_0x7756('0xa')](),controller[_0x7756('0xb')]);router[_0x7756('0x9')](_0x7756('0xc'),auth['isAuthenticated'](),controller[_0x7756('0xd')]);router[_0x7756('0x9')](_0x7756('0xe'),auth['isAuthenticated'](),controller[_0x7756('0xf')]);router['get'](_0x7756('0x10'),auth[_0x7756('0xa')](),controller[_0x7756('0x11')]);router[_0x7756('0x12')]('/',auth['isAuthenticated'](),controller[_0x7756('0x13')]);router[_0x7756('0x14')](_0x7756('0xe'),auth['isAuthenticated'](),controller[_0x7756('0x15')]);router['delete']('/:id',auth[_0x7756('0xa')](),controller[_0x7756('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a12f22a..ffb9581 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 _0xa904=['moment','sequelize','starttime','setDataValue','endtime','DATE','STRING','BOOLEAN'];(function(_0x562b39,_0x574554){var _0x561dea=function(_0x453b68){while(--_0x453b68){_0x562b39['push'](_0x562b39['shift']());}};_0x561dea(++_0x574554);}(_0xa904,0xf8));var _0x4a90=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0xa904[_0x2f32c4];return _0x95b5dc;};'use strict';var moment=require(_0x4a90('0x0'));var Sequelize=require(_0x4a90('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x17d7e6){this['setDataValue'](_0x4a90('0x2'),_0x17d7e6);this[_0x4a90('0x3')](_0x4a90('0x4'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x4a90('0x5')]},'membername':{'type':Sequelize[_0x4a90('0x6')]},'projectname':{'type':Sequelize[_0x4a90('0x6')]},'queue':{'type':Sequelize[_0x4a90('0x6')]},'uniqueid':{'type':Sequelize[_0x4a90('0x6')]},'calleridname':{'type':Sequelize[_0x4a90('0x6')]},'calleridnum':{'type':Sequelize[_0x4a90('0x6')]},'completed':{'type':Sequelize[_0x4a90('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xbafd=['BOOLEAN','sequelize','exports','DATE','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x36c304,_0x3984c4){var _0x4a55e4=function(_0xf1416a){while(--_0xf1416a){_0x36c304['push'](_0x36c304['shift']());}};_0x4a55e4(++_0x3984c4);}(_0xbafd,0x69));var _0xdbaf=function(_0x3e0db3,_0x277a28){_0x3e0db3=_0x3e0db3-0x0;var _0x28bcef=_0xbafd[_0x3e0db3];return _0x28bcef;};'use strict';var moment=require('moment');var Sequelize=require(_0xdbaf('0x0'));module[_0xdbaf('0x1')]={'starttime':{'type':Sequelize[_0xdbaf('0x2')],'set':function(_0x16b95c){this[_0xdbaf('0x3')](_0xdbaf('0x4'),_0x16b95c);this[_0xdbaf('0x3')]('endtime',moment()['format'](_0xdbaf('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xdbaf('0x6')]},'projectname':{'type':Sequelize[_0xdbaf('0x6')]},'queue':{'type':Sequelize[_0xdbaf('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdbaf('0x6')]},'calleridnum':{'type':Sequelize[_0xdbaf('0x6')]},'completed':{'type':Sequelize[_0xdbaf('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 640d08a..3506b89 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 _0x935c=['JscriptySessionReport','then','includeAll','findAll','catch','params','length','include','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','filter','rows','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','count','limit','status','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge'];(function(_0x114a4e,_0x2a2072){var _0x530744=function(_0x58875a){while(--_0x58875a){_0x114a4e['push'](_0x114a4e['shift']());}};_0x530744(++_0x2a2072);}(_0x935c,0xad));var _0xc935=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x935c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc935('0x0'));var zipdir=require(_0xc935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc935('0x2'));var moment=require(_0xc935('0x3'));var BPromise=require(_0xc935('0x4'));var Mustache=require('mustache');var util=require(_0xc935('0x5'));var path=require('path');var sox=require(_0xc935('0x6'));var csv=require('to-csv');var ejs=require(_0xc935('0x7'));var fs=require('fs');var fs_extra=require(_0xc935('0x8'));var _=require(_0xc935('0x9'));var squel=require(_0xc935('0xa'));var crypto=require(_0xc935('0xb'));var jsforce=require(_0xc935('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc935('0xd'));var Papa=require(_0xc935('0xe'));var Redis=require('ioredis');var authService=require(_0xc935('0xf'));var qs=require(_0xc935('0x10'));var as=require(_0xc935('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc935('0x12'));var utils=require(_0xc935('0x13'));var config=require(_0xc935('0x14'));var licenseUtil=require(_0xc935('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ef33f,_0x35924b){_0x35924b=_0x35924b||0xcc;return function(_0x481658){if(_0x481658){return _0x4ef33f[_0xc935('0x16')](_0x35924b);}return _0x4ef33f['status'](_0x35924b)[_0xc935('0x17')]();};}function respondWithResult(_0x17feb1,_0x2e8659){_0x2e8659=_0x2e8659||0xc8;return function(_0x517424){if(_0x517424){return _0x17feb1['status'](_0x2e8659)['json'](_0x517424);}};}function respondWithFilteredResult(_0x393913,_0xc0a493){return function(_0x5372a7){if(_0x5372a7){var _0x2acc0a=typeof _0xc0a493[_0xc935('0x18')]===_0xc935('0x19')&&typeof _0xc0a493['limit']===_0xc935('0x19');var _0x4d1738=_0x5372a7[_0xc935('0x1a')];var _0x257224=_0x2acc0a?0x0:_0xc0a493[_0xc935('0x18')];var _0xbfffcc=_0x2acc0a?_0x5372a7['count']:_0xc0a493[_0xc935('0x18')]+_0xc0a493[_0xc935('0x1b')];var _0x12cd8e;if(_0xbfffcc>=_0x4d1738){_0xbfffcc=_0x4d1738;_0x12cd8e=0xc8;}else{_0x12cd8e=0xce;}_0x393913[_0xc935('0x1c')](_0x12cd8e);return _0x393913['set'](_0xc935('0x1d'),_0x257224+'-'+_0xbfffcc+'/'+_0x4d1738)['json'](_0x5372a7);}return null;};}function patchUpdates(_0x442f22){return function(_0x1500cb){try{jsonpatch[_0xc935('0x1e')](_0x1500cb,_0x442f22,!![]);}catch(_0x48b202){return BPromise[_0xc935('0x1f')](_0x48b202);}return _0x1500cb['save']();};}function saveUpdates(_0x3288aa,_0x46e331){return function(_0x23871b){if(_0x23871b){return _0x23871b[_0xc935('0x20')](_0x3288aa)['then'](function(_0x2c6032){return _0x2c6032;});}return null;};}function removeEntity(_0x2fbbe4,_0x333440){return function(_0x5f3548){if(_0x5f3548){return _0x5f3548[_0xc935('0x21')]()['then'](function(){_0x2fbbe4['status'](0xcc)[_0xc935('0x17')]();});}};}function handleEntityNotFound(_0xd24445,_0x38ab3c){return function(_0x423c43){if(!_0x423c43){_0xd24445['sendStatus'](0x194);}return _0x423c43;};}function handleError(_0x1ce10d,_0x59a2df){_0x59a2df=_0x59a2df||0x1f4;return function(_0x3dfa38){logger[_0xc935('0x22')](_0x3dfa38[_0xc935('0x23')]);if(_0x3dfa38[_0xc935('0x24')]){delete _0x3dfa38[_0xc935('0x24')];}_0x1ce10d[_0xc935('0x1c')](_0x59a2df)[_0xc935('0x25')](_0x3dfa38);};}exports[_0xc935('0x26')]=function(_0x5199ff,_0x1ec331){var _0x106e40={},_0x15c727={},_0x3b7da5={'count':0x0,'rows':[]};var _0x49ad87=_[_0xc935('0x27')](db['JscriptySessionReport'][_0xc935('0x28')],function(_0x37d45a){return{'name':_0x37d45a[_0xc935('0x29')],'type':_0x37d45a[_0xc935('0x2a')][_0xc935('0x2b')]};});_0x15c727[_0xc935('0x2c')]=_['map'](_0x49ad87,_0xc935('0x24'));_0x15c727[_0xc935('0x2d')]=_[_0xc935('0x2e')](_0x5199ff['query']);_0x15c727[_0xc935('0x2f')]=_[_0xc935('0x30')](_0x15c727[_0xc935('0x2c')],_0x15c727['query']);_0x106e40['attributes']=_[_0xc935('0x30')](_0x15c727[_0xc935('0x2c')],qs['fields'](_0x5199ff[_0xc935('0x2d')][_0xc935('0x31')]));_0x106e40[_0xc935('0x32')]=_0x106e40[_0xc935('0x32')]['length']?_0x106e40[_0xc935('0x32')]:_0x15c727[_0xc935('0x2c')];if(!_0x5199ff[_0xc935('0x2d')][_0xc935('0x33')](_0xc935('0x34'))){_0x106e40[_0xc935('0x1b')]=qs[_0xc935('0x1b')](_0x5199ff[_0xc935('0x2d')][_0xc935('0x1b')]);_0x106e40['offset']=qs['offset'](_0x5199ff[_0xc935('0x2d')][_0xc935('0x18')]);}_0x106e40[_0xc935('0x35')]=qs['sort'](_0x5199ff['query'][_0xc935('0x36')]);_0x106e40['where']=qs['filters'](_[_0xc935('0x37')](_0x5199ff['query'],_0x15c727[_0xc935('0x2f')]),_0x49ad87);if(_0x5199ff['query']['filter']){_0x106e40[_0xc935('0x38')]=_[_0xc935('0x39')](_0x106e40[_0xc935('0x38')],{'$or':_[_0xc935('0x27')](_0x49ad87,function(_0x343111){if(_0x343111[_0xc935('0x2a')]!=='VIRTUAL'){var _0x1be4ca={};_0x1be4ca[_0x343111['name']]={'$like':'%'+_0x5199ff[_0xc935('0x2d')]['filter']+'%'};return _0x1be4ca;}})});}_0x106e40=_[_0xc935('0x39')]({},_0x106e40,_0x5199ff['options']);var _0xcfcd90={'where':_0x106e40['where']};return db[_0xc935('0x3a')]['count'](_0xcfcd90)[_0xc935('0x3b')](function(_0x366bc1){_0x3b7da5['count']=_0x366bc1;if(_0x5199ff[_0xc935('0x2d')][_0xc935('0x3c')]){_0x106e40['include']=[{'all':!![]}];}return db[_0xc935('0x3a')][_0xc935('0x3d')](_0x106e40);})[_0xc935('0x3b')](function(_0x251ac6){_0x3b7da5['rows']=_0x251ac6;return _0x3b7da5;})['then'](respondWithFilteredResult(_0x1ec331,_0x106e40))[_0xc935('0x3e')](handleError(_0x1ec331,null));};exports['show']=function(_0x2f535f,_0x46016f){var _0x23a735={'raw':!![],'where':{'id':_0x2f535f[_0xc935('0x3f')]['id']}},_0x429976={};_0x429976[_0xc935('0x2c')]=_['keys'](db[_0xc935('0x3a')]['rawAttributes']);_0x429976[_0xc935('0x2d')]=_['keys'](_0x2f535f[_0xc935('0x2d')]);_0x429976['filters']=_['intersection'](_0x429976[_0xc935('0x2c')],_0x429976[_0xc935('0x2d')]);_0x23a735['attributes']=_[_0xc935('0x30')](_0x429976[_0xc935('0x2c')],qs[_0xc935('0x31')](_0x2f535f[_0xc935('0x2d')][_0xc935('0x31')]));_0x23a735[_0xc935('0x32')]=_0x23a735[_0xc935('0x32')][_0xc935('0x40')]?_0x23a735[_0xc935('0x32')]:_0x429976[_0xc935('0x2c')];if(_0x2f535f['query'][_0xc935('0x3c')]){_0x23a735[_0xc935('0x41')]=[{'all':!![]}];}_0x23a735=_[_0xc935('0x39')]({},_0x23a735,_0x2f535f[_0xc935('0x42')]);return db[_0xc935('0x3a')][_0xc935('0x43')](_0x23a735)[_0xc935('0x3b')](handleEntityNotFound(_0x46016f,null))[_0xc935('0x3b')](respondWithResult(_0x46016f,null))[_0xc935('0x3e')](handleError(_0x46016f,null));};exports[_0xc935('0x44')]=function(_0x1b21e5,_0x2773ae){return db['JscriptySessionReport'][_0xc935('0x44')](_0x1b21e5['body'],{})[_0xc935('0x3b')](respondWithResult(_0x2773ae,0xc9))[_0xc935('0x3e')](handleError(_0x2773ae,null));};exports[_0xc935('0x20')]=function(_0x4402cc,_0x95f896){if(_0x4402cc[_0xc935('0x45')]['id']){delete _0x4402cc[_0xc935('0x45')]['id'];}return db[_0xc935('0x3a')][_0xc935('0x43')]({'where':{'id':_0x4402cc[_0xc935('0x3f')]['id']}})[_0xc935('0x3b')](handleEntityNotFound(_0x95f896,null))[_0xc935('0x3b')](saveUpdates(_0x4402cc[_0xc935('0x45')],null))[_0xc935('0x3b')](respondWithResult(_0x95f896,null))[_0xc935('0x3e')](handleError(_0x95f896,null));};exports[_0xc935('0x21')]=function(_0x3fec6e,_0x1a3f57){return db[_0xc935('0x3a')]['find']({'where':{'id':_0x3fec6e[_0xc935('0x3f')]['id']}})[_0xc935('0x3b')](handleEntityNotFound(_0x1a3f57,null))[_0xc935('0x3b')](removeEntity(_0x1a3f57,null))[_0xc935('0x3e')](handleError(_0x1a3f57,null));};exports[_0xc935('0x46')]=function(_0x3cc877,_0x3f7d51){return db[_0xc935('0x3a')][_0xc935('0x46')]()[_0xc935('0x3b')](respondWithResult(_0x3f7d51,null))['catch'](handleError(_0x3f7d51,null));};exports[_0xc935('0x47')]=function(_0x2a238a,_0x13e147,_0x5b8885){var _0x2b0d99={'raw':!![],'where':{}};var _0x12bd75={};var _0x117129={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xc935('0x48')]({'where':{'id':_0x2a238a['params']['id']}})[_0xc935('0x3b')](handleEntityNotFound(_0x13e147,null))[_0xc935('0x3b')](function(_0x3940cb){if(_0x3940cb){_0x12bd75['model']=_[_0xc935('0x2e')](db[_0xc935('0x49')][_0xc935('0x28')]);_0x12bd75[_0xc935('0x2d')]=_[_0xc935('0x2e')](_0x2a238a[_0xc935('0x2d')]);_0x12bd75['filters']=_['intersection'](_0x12bd75[_0xc935('0x2c')],_0x12bd75['query']);_0x2b0d99['attributes']=_[_0xc935('0x30')](_0x12bd75['model'],qs['fields'](_0x2a238a[_0xc935('0x2d')][_0xc935('0x31')]));_0x2b0d99['attributes']=_0x2b0d99[_0xc935('0x32')][_0xc935('0x40')]?_0x2b0d99[_0xc935('0x32')]:_0x12bd75['model'];if(!_0x2a238a['query'][_0xc935('0x33')](_0xc935('0x34'))){_0x2b0d99['limit']=qs[_0xc935('0x1b')](_0x2a238a[_0xc935('0x2d')][_0xc935('0x1b')]);_0x2b0d99[_0xc935('0x18')]=qs['offset'](_0x2a238a[_0xc935('0x2d')][_0xc935('0x18')]);}_0x2b0d99[_0xc935('0x35')]=qs[_0xc935('0x36')](_0x2a238a['query'][_0xc935('0x36')]);_0x2b0d99[_0xc935('0x38')]=qs['filters'](_[_0xc935('0x37')](_0x2a238a[_0xc935('0x2d')],_0x12bd75[_0xc935('0x2f')]));_0x2b0d99[_0xc935('0x38')][_0xc935('0x4a')]=_0x3940cb['id'];if(_0x2a238a[_0xc935('0x2d')][_0xc935('0x4b')]){_0x2b0d99[_0xc935('0x38')]=_[_0xc935('0x39')](_0x2b0d99['where'],{'$or':_[_0xc935('0x27')](_0x2b0d99[_0xc935('0x32')],function(_0x1ea337){var _0x444190={};_0x444190[_0x1ea337]={'$like':'%'+_0x2a238a[_0xc935('0x2d')][_0xc935('0x4b')]+'%'};return _0x444190;})});}_0x2b0d99=_[_0xc935('0x39')]({},_0x2b0d99,_0x2a238a[_0xc935('0x42')]);return db['JscriptyQuestionReport'][_0xc935('0x1a')]({'where':_0x2b0d99[_0xc935('0x38')]})['then'](function(_0x4a022b){_0x117129[_0xc935('0x1a')]=_0x4a022b;if(_0x2a238a[_0xc935('0x2d')][_0xc935('0x3c')]){_0x2b0d99[_0xc935('0x41')]=[{'all':!![]}];}return db[_0xc935('0x49')][_0xc935('0x3d')](_0x2b0d99);})[_0xc935('0x3b')](function(_0x2f165d){_0x117129[_0xc935('0x4c')]=_0x2f165d;return _0x117129;});}})[_0xc935('0x3b')](respondWithFilteredResult(_0x13e147,_0x2b0d99))[_0xc935('0x3e')](handleError(_0x13e147,null));}; \ No newline at end of file +var _0x2994=['name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','pick','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model'];(function(_0xd155bf,_0x51608e){var _0x5527ac=function(_0x4639fd){while(--_0x4639fd){_0xd155bf['push'](_0xd155bf['shift']());}};_0x5527ac(++_0x51608e);}(_0x2994,0x114));var _0x4299=function(_0x4186c3,_0x1c0521){_0x4186c3=_0x4186c3-0x0;var _0x23ff6c=_0x2994[_0x4186c3];return _0x23ff6c;};'use strict';var emlformat=require(_0x4299('0x0'));var rimraf=require(_0x4299('0x1'));var zipdir=require(_0x4299('0x2'));var jsonpatch=require(_0x4299('0x3'));var rp=require('request-promise');var moment=require(_0x4299('0x4'));var BPromise=require(_0x4299('0x5'));var Mustache=require('mustache');var util=require(_0x4299('0x6'));var path=require(_0x4299('0x7'));var sox=require(_0x4299('0x8'));var csv=require('to-csv');var ejs=require(_0x4299('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4299('0xa'));var squel=require(_0x4299('0xb'));var crypto=require('crypto');var jsforce=require(_0x4299('0xc'));var deskjs=require(_0x4299('0xd'));var toCsv=require(_0x4299('0xe'));var querystring=require(_0x4299('0xf'));var Papa=require(_0x4299('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4299('0x11'));var as=require(_0x4299('0x12'));var hardwareService=require(_0x4299('0x13'));var logger=require('../../config/logger')(_0x4299('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4299('0x15'));var db=require(_0x4299('0x16'))['db'];function respondWithStatusCode(_0x4d582c,_0x1f6896){_0x1f6896=_0x1f6896||0xcc;return function(_0x2cdc79){if(_0x2cdc79){return _0x4d582c[_0x4299('0x17')](_0x1f6896);}return _0x4d582c['status'](_0x1f6896)[_0x4299('0x18')]();};}function respondWithResult(_0xd37499,_0x419500){_0x419500=_0x419500||0xc8;return function(_0x2542a9){if(_0x2542a9){return _0xd37499[_0x4299('0x19')](_0x419500)[_0x4299('0x1a')](_0x2542a9);}};}function respondWithFilteredResult(_0x5b553d,_0x5d9c9b){return function(_0x263d64){if(_0x263d64){var _0x1b05c6=typeof _0x5d9c9b['offset']==='undefined'&&typeof _0x5d9c9b['limit']===_0x4299('0x1b');var _0x1e9bb0=_0x263d64[_0x4299('0x1c')];var _0x582f74=_0x1b05c6?0x0:_0x5d9c9b[_0x4299('0x1d')];var _0x2e7784=_0x1b05c6?_0x263d64[_0x4299('0x1c')]:_0x5d9c9b[_0x4299('0x1d')]+_0x5d9c9b['limit'];var _0x4493fa;if(_0x2e7784>=_0x1e9bb0){_0x2e7784=_0x1e9bb0;_0x4493fa=0xc8;}else{_0x4493fa=0xce;}_0x5b553d['status'](_0x4493fa);return _0x5b553d[_0x4299('0x1e')](_0x4299('0x1f'),_0x582f74+'-'+_0x2e7784+'/'+_0x1e9bb0)['json'](_0x263d64);}return null;};}function patchUpdates(_0x3c92c9){return function(_0x32ec6f){try{jsonpatch['apply'](_0x32ec6f,_0x3c92c9,!![]);}catch(_0x5163c7){return BPromise[_0x4299('0x20')](_0x5163c7);}return _0x32ec6f[_0x4299('0x21')]();};}function saveUpdates(_0x126796,_0x29cf10){return function(_0x18bcda){if(_0x18bcda){return _0x18bcda[_0x4299('0x22')](_0x126796)[_0x4299('0x23')](function(_0x39130e){return _0x39130e;});}return null;};}function removeEntity(_0x1b1441,_0x13e1cb){return function(_0x5b3c90){if(_0x5b3c90){return _0x5b3c90[_0x4299('0x24')]()[_0x4299('0x23')](function(){_0x1b1441[_0x4299('0x19')](0xcc)[_0x4299('0x18')]();});}};}function handleEntityNotFound(_0x44fee8,_0x10ef4e){return function(_0x4081fb){if(!_0x4081fb){_0x44fee8['sendStatus'](0x194);}return _0x4081fb;};}function handleError(_0x540cd7,_0x4a1f7d){_0x4a1f7d=_0x4a1f7d||0x1f4;return function(_0x2f9a5a){logger[_0x4299('0x25')](_0x2f9a5a[_0x4299('0x26')]);if(_0x2f9a5a['name']){delete _0x2f9a5a['name'];}_0x540cd7['status'](_0x4a1f7d)[_0x4299('0x27')](_0x2f9a5a);};}exports[_0x4299('0x28')]=function(_0x203fe4,_0x12c511){var _0x4270ae={},_0x3b2739={},_0x318d06={'count':0x0,'rows':[]};var _0x43cd69=_[_0x4299('0x29')](db[_0x4299('0x2a')][_0x4299('0x2b')],function(_0x550cf2){return{'name':_0x550cf2[_0x4299('0x2c')],'type':_0x550cf2[_0x4299('0x2d')][_0x4299('0x2e')]};});_0x3b2739[_0x4299('0x2f')]=_['map'](_0x43cd69,_0x4299('0x30'));_0x3b2739[_0x4299('0x31')]=_[_0x4299('0x32')](_0x203fe4['query']);_0x3b2739[_0x4299('0x33')]=_[_0x4299('0x34')](_0x3b2739[_0x4299('0x2f')],_0x3b2739[_0x4299('0x31')]);_0x4270ae[_0x4299('0x35')]=_[_0x4299('0x34')](_0x3b2739[_0x4299('0x2f')],qs[_0x4299('0x36')](_0x203fe4[_0x4299('0x31')][_0x4299('0x36')]));_0x4270ae[_0x4299('0x35')]=_0x4270ae[_0x4299('0x35')][_0x4299('0x37')]?_0x4270ae[_0x4299('0x35')]:_0x3b2739[_0x4299('0x2f')];if(!_0x203fe4[_0x4299('0x31')][_0x4299('0x38')](_0x4299('0x39'))){_0x4270ae[_0x4299('0x3a')]=qs[_0x4299('0x3a')](_0x203fe4[_0x4299('0x31')][_0x4299('0x3a')]);_0x4270ae['offset']=qs[_0x4299('0x1d')](_0x203fe4[_0x4299('0x31')][_0x4299('0x1d')]);}_0x4270ae[_0x4299('0x3b')]=qs[_0x4299('0x3c')](_0x203fe4[_0x4299('0x31')][_0x4299('0x3c')]);_0x4270ae[_0x4299('0x3d')]=qs[_0x4299('0x33')](_['pick'](_0x203fe4['query'],_0x3b2739[_0x4299('0x33')]),_0x43cd69);if(_0x203fe4[_0x4299('0x31')][_0x4299('0x3e')]){_0x4270ae[_0x4299('0x3d')]=_[_0x4299('0x3f')](_0x4270ae[_0x4299('0x3d')],{'$or':_[_0x4299('0x29')](_0x43cd69,function(_0x4abe0e){if(_0x4abe0e[_0x4299('0x2d')]!==_0x4299('0x40')){var _0x2d8e0c={};_0x2d8e0c[_0x4abe0e[_0x4299('0x30')]]={'$like':'%'+_0x203fe4[_0x4299('0x31')][_0x4299('0x3e')]+'%'};return _0x2d8e0c;}})});}_0x4270ae=_['merge']({},_0x4270ae,_0x203fe4['options']);var _0xdb5a48={'where':_0x4270ae['where']};return db[_0x4299('0x2a')][_0x4299('0x1c')](_0xdb5a48)['then'](function(_0x36005c){_0x318d06[_0x4299('0x1c')]=_0x36005c;if(_0x203fe4[_0x4299('0x31')][_0x4299('0x41')]){_0x4270ae['include']=[{'all':!![]}];}return db[_0x4299('0x2a')]['findAll'](_0x4270ae);})['then'](function(_0x49e272){_0x318d06[_0x4299('0x42')]=_0x49e272;return _0x318d06;})['then'](respondWithFilteredResult(_0x12c511,_0x4270ae))[_0x4299('0x43')](handleError(_0x12c511,null));};exports[_0x4299('0x44')]=function(_0x3fb569,_0x4b94fa){var _0x28afa9={'raw':!![],'where':{'id':_0x3fb569[_0x4299('0x45')]['id']}},_0x3d27c8={};_0x3d27c8[_0x4299('0x2f')]=_[_0x4299('0x32')](db[_0x4299('0x2a')][_0x4299('0x2b')]);_0x3d27c8[_0x4299('0x31')]=_[_0x4299('0x32')](_0x3fb569[_0x4299('0x31')]);_0x3d27c8[_0x4299('0x33')]=_[_0x4299('0x34')](_0x3d27c8[_0x4299('0x2f')],_0x3d27c8[_0x4299('0x31')]);_0x28afa9[_0x4299('0x35')]=_[_0x4299('0x34')](_0x3d27c8['model'],qs[_0x4299('0x36')](_0x3fb569[_0x4299('0x31')]['fields']));_0x28afa9[_0x4299('0x35')]=_0x28afa9[_0x4299('0x35')][_0x4299('0x37')]?_0x28afa9[_0x4299('0x35')]:_0x3d27c8['model'];if(_0x3fb569[_0x4299('0x31')][_0x4299('0x41')]){_0x28afa9[_0x4299('0x46')]=[{'all':!![]}];}_0x28afa9=_[_0x4299('0x3f')]({},_0x28afa9,_0x3fb569[_0x4299('0x47')]);return db['JscriptySessionReport']['find'](_0x28afa9)['then'](handleEntityNotFound(_0x4b94fa,null))[_0x4299('0x23')](respondWithResult(_0x4b94fa,null))[_0x4299('0x43')](handleError(_0x4b94fa,null));};exports['create']=function(_0x167985,_0x3adbc5){return db[_0x4299('0x2a')][_0x4299('0x48')](_0x167985['body'],{})[_0x4299('0x23')](respondWithResult(_0x3adbc5,0xc9))[_0x4299('0x43')](handleError(_0x3adbc5,null));};exports[_0x4299('0x22')]=function(_0x4ed661,_0xbcd9e){if(_0x4ed661['body']['id']){delete _0x4ed661[_0x4299('0x49')]['id'];}return db[_0x4299('0x2a')][_0x4299('0x4a')]({'where':{'id':_0x4ed661[_0x4299('0x45')]['id']}})[_0x4299('0x23')](handleEntityNotFound(_0xbcd9e,null))[_0x4299('0x23')](saveUpdates(_0x4ed661[_0x4299('0x49')],null))[_0x4299('0x23')](respondWithResult(_0xbcd9e,null))[_0x4299('0x43')](handleError(_0xbcd9e,null));};exports[_0x4299('0x24')]=function(_0x5b88d5,_0x2be81a){return db[_0x4299('0x2a')][_0x4299('0x4a')]({'where':{'id':_0x5b88d5[_0x4299('0x45')]['id']}})[_0x4299('0x23')](handleEntityNotFound(_0x2be81a,null))[_0x4299('0x23')](removeEntity(_0x2be81a,null))[_0x4299('0x43')](handleError(_0x2be81a,null));};exports[_0x4299('0x4b')]=function(_0x6d9cda,_0x3ad7c9){return db[_0x4299('0x2a')]['describe']()[_0x4299('0x23')](respondWithResult(_0x3ad7c9,null))[_0x4299('0x43')](handleError(_0x3ad7c9,null));};exports[_0x4299('0x4c')]=function(_0x5d7275,_0xbb36a,_0x4c3a90){var _0x337e38={'raw':!![],'where':{}};var _0x1eb0e4={};var _0x491ae7={'count':0x0,'rows':[]};return db[_0x4299('0x2a')][_0x4299('0x4d')]({'where':{'id':_0x5d7275['params']['id']}})['then'](handleEntityNotFound(_0xbb36a,null))[_0x4299('0x23')](function(_0x5e05c5){if(_0x5e05c5){_0x1eb0e4[_0x4299('0x2f')]=_['keys'](db[_0x4299('0x4e')][_0x4299('0x2b')]);_0x1eb0e4[_0x4299('0x31')]=_[_0x4299('0x32')](_0x5d7275['query']);_0x1eb0e4[_0x4299('0x33')]=_['intersection'](_0x1eb0e4[_0x4299('0x2f')],_0x1eb0e4[_0x4299('0x31')]);_0x337e38[_0x4299('0x35')]=_[_0x4299('0x34')](_0x1eb0e4[_0x4299('0x2f')],qs[_0x4299('0x36')](_0x5d7275[_0x4299('0x31')][_0x4299('0x36')]));_0x337e38[_0x4299('0x35')]=_0x337e38[_0x4299('0x35')][_0x4299('0x37')]?_0x337e38[_0x4299('0x35')]:_0x1eb0e4['model'];if(!_0x5d7275[_0x4299('0x31')][_0x4299('0x38')](_0x4299('0x39'))){_0x337e38[_0x4299('0x3a')]=qs[_0x4299('0x3a')](_0x5d7275[_0x4299('0x31')]['limit']);_0x337e38[_0x4299('0x1d')]=qs[_0x4299('0x1d')](_0x5d7275[_0x4299('0x31')]['offset']);}_0x337e38[_0x4299('0x3b')]=qs['sort'](_0x5d7275[_0x4299('0x31')][_0x4299('0x3c')]);_0x337e38['where']=qs[_0x4299('0x33')](_[_0x4299('0x4f')](_0x5d7275[_0x4299('0x31')],_0x1eb0e4[_0x4299('0x33')]));_0x337e38[_0x4299('0x3d')][_0x4299('0x50')]=_0x5e05c5['id'];if(_0x5d7275[_0x4299('0x31')][_0x4299('0x3e')]){_0x337e38['where']=_[_0x4299('0x3f')](_0x337e38[_0x4299('0x3d')],{'$or':_[_0x4299('0x29')](_0x337e38[_0x4299('0x35')],function(_0x3133a6){var _0x5a568c={};_0x5a568c[_0x3133a6]={'$like':'%'+_0x5d7275[_0x4299('0x31')][_0x4299('0x3e')]+'%'};return _0x5a568c;})});}_0x337e38=_[_0x4299('0x3f')]({},_0x337e38,_0x5d7275[_0x4299('0x47')]);return db[_0x4299('0x4e')]['count']({'where':_0x337e38[_0x4299('0x3d')]})[_0x4299('0x23')](function(_0xc1f299){_0x491ae7['count']=_0xc1f299;if(_0x5d7275[_0x4299('0x31')]['includeAll']){_0x337e38['include']=[{'all':!![]}];}return db[_0x4299('0x4e')]['findAll'](_0x337e38);})[_0x4299('0x23')](function(_0x5b69d2){_0x491ae7['rows']=_0x5b69d2;return _0x491ae7;});}})['then'](respondWithFilteredResult(_0xbb36a,_0x337e38))[_0x4299('0x43')](handleError(_0xbb36a,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index ccba10a..2b41ed2 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','report_jscripty_sessions','lodash'];(function(_0x4a6b6b,_0x428c40){var _0x25977a=function(_0x4ce72e){while(--_0x4ce72e){_0x4a6b6b['push'](_0x4a6b6b['shift']());}};_0x25977a(++_0x428c40);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('JscriptySessionReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11e5=['path','../../config/environment','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xda7618,_0x34a0dc){var _0x577b06=function(_0x184af6){while(--_0x184af6){_0xda7618['push'](_0xda7618['shift']());}};_0x577b06(++_0x34a0dc);}(_0x11e5,0x8b));var _0x511e=function(_0x48c03c,_0x3a0d41){_0x48c03c=_0x48c03c-0x0;var _0x33b898=_0x11e5[_0x48c03c];return _0x33b898;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 103c0a4..66dca5f 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 _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b84e0,_0x2572e2){var _0x5069fa=function(_0x7ec1cf){while(--_0x7ec1cf){_0x3b84e0['push'](_0x3b84e0['shift']());}};_0x5069fa(++_0x2572e2);}(_0xafc4,0x69));var _0x4afc=function(_0x2f855d,_0xfbe70e){_0x2f855d=_0x2f855d-0x0;var _0x267032=_0xafc4[_0x2f855d];return _0x267032;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});} \ No newline at end of file +var _0xa456=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xa456,0x142));var _0x6a45=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xa456[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));var BPromise=require(_0x6a45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a45('0x4'));var db=require(_0x6a45('0x5'))['db'];var utils=require(_0x6a45('0x6'));var logger=require('../../config/logger')(_0x6a45('0x7'));var config=require(_0x6a45('0x8'));var jayson=require(_0x6a45('0x9'));var client=jayson[_0x6a45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cf8d,_0x26bfc0,_0x214514){return new BPromise(function(_0x19e67c,_0x3deb09){return client['request'](_0x25cf8d,_0x214514)[_0x6a45('0xb')](function(_0x517040){logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));logger[_0x6a45('0xf')](_0x6a45('0x10'),_0x26bfc0,'request\x20sent',JSON['stringify'](_0x517040));if(_0x517040[_0x6a45('0x11')]){if(_0x517040[_0x6a45('0x11')]['code']===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x26bfc0,_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);return _0x3deb09(_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);}logger[_0x6a45('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x26bfc0,_0x517040['error'][_0x6a45('0x12')]);return _0x19e67c(_0x517040[_0x6a45('0x11')]['message']);}else{logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));_0x19e67c(_0x517040[_0x6a45('0x13')]['message']);}})['catch'](function(_0x49023f){logger[_0x6a45('0x11')](_0x6a45('0xd'),_0x26bfc0,_0x49023f);_0x3deb09(_0x49023f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 732ae51..2a60ce9 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 _0xe89f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','put','/:id','isAuthenticated','/download_log_file','downloadLogFile','util','path','connect-timeout','express'];(function(_0x208dd7,_0x188257){var _0x44c926=function(_0x175f14){while(--_0x175f14){_0x208dd7['push'](_0x208dd7['shift']());}};_0x44c926(++_0x188257);}(_0xe89f,0x14c));var _0xfe89=function(_0x2a30f6,_0x303f67){_0x2a30f6=_0x2a30f6-0x0;var _0x528f9c=_0xe89f[_0x2a30f6];return _0x528f9c;};'use strict';var multer=require('multer');var util=require(_0xfe89('0x0'));var path=require(_0xfe89('0x1'));var timeout=require(_0xfe89('0x2'));var express=require(_0xfe89('0x3'));var router=express[_0xfe89('0x4')]();var fs_extra=require(_0xfe89('0x5'));var auth=require(_0xfe89('0x6'));var interaction=require(_0xfe89('0x7'));var config=require(_0xfe89('0x8'));var controller=require(_0xfe89('0x9'));router['get']('/',controller[_0xfe89('0xa')]);router[_0xfe89('0xb')](_0xfe89('0xc'),auth[_0xfe89('0xd')](),controller['update']);router['get'](_0xfe89('0xe'),auth[_0xfe89('0xd')](),controller[_0xfe89('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5ae9=['/:id','isAuthenticated','/download_log_file','downloadLogFile','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put'];(function(_0x4eab4a,_0x165767){var _0x1650c1=function(_0x33f38b){while(--_0x33f38b){_0x4eab4a['push'](_0x4eab4a['shift']());}};_0x1650c1(++_0x165767);}(_0x5ae9,0xd1));var _0x95ae=function(_0x216f7d,_0x496249){_0x216f7d=_0x216f7d-0x0;var _0xc49d7f=_0x5ae9[_0x216f7d];return _0xc49d7f;};'use strict';var multer=require(_0x95ae('0x0'));var util=require('util');var path=require(_0x95ae('0x1'));var timeout=require(_0x95ae('0x2'));var express=require(_0x95ae('0x3'));var router=express[_0x95ae('0x4')]();var fs_extra=require(_0x95ae('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x95ae('0x6'));var config=require(_0x95ae('0x7'));var controller=require(_0x95ae('0x8'));router[_0x95ae('0x9')]('/',controller[_0x95ae('0xa')]);router[_0x95ae('0xb')](_0x95ae('0xc'),auth[_0x95ae('0xd')](),controller['update']);router[_0x95ae('0x9')](_0x95ae('0xe'),auth[_0x95ae('0xd')](),controller[_0x95ae('0xf')]);module[_0x95ae('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index ced4c0b..8ef82d5 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 _0x3371=['sequelize','STRING','INTEGER'];(function(_0x1551af,_0x5223c3){var _0xd8eb82=function(_0x4b133a){while(--_0x4b133a){_0x1551af['push'](_0x1551af['shift']());}};_0xd8eb82(++_0x5223c3);}(_0x3371,0xcf));var _0x1337=function(_0x4df674,_0x56eb16){_0x4df674=_0x4df674-0x0;var _0x331e3a=_0x3371[_0x4df674];return _0x331e3a;};'use strict';var Sequelize=require(_0x1337('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x1337('0x1')]},'data2':{'type':Sequelize[_0x1337('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x1337('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd58d=['sequelize','exports','STRING','INTEGER'];(function(_0x12ffb4,_0x4afede){var _0x50dc9c=function(_0x422d84){while(--_0x422d84){_0x12ffb4['push'](_0x12ffb4['shift']());}};_0x50dc9c(++_0x4afede);}(_0xd58d,0x1c8));var _0xdd58=function(_0x40b93d,_0x825f6b){_0x40b93d=_0x40b93d-0x0;var _0x26a7a7=_0xd58d[_0x40b93d];return _0x26a7a7;};'use strict';var Sequelize=require(_0xdd58('0x0'));module[_0xdd58('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xdd58('0x2')]},'data2':{'type':Sequelize[_0xdd58('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xdd58('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 0eed5b4..ba9f1db 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 _0x8ff5=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','destroy','error','stack','name','send','../../config/license/util','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','merge','options','body','License','params','get','checkLicense','key','demo','catch','downloadLogFile','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x2c3069,_0xb2f898){var _0x2ace87=function(_0x15dae4){while(--_0x15dae4){_0x2c3069['push'](_0x2c3069['shift']());}};_0x2ace87(++_0xb2f898);}(_0x8ff5,0x156));var _0x58ff=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x8ff5[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x58ff('0x0'));var rimraf=require(_0x58ff('0x1'));var zipdir=require(_0x58ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x58ff('0x3'));var BPromise=require(_0x58ff('0x4'));var Mustache=require(_0x58ff('0x5'));var util=require(_0x58ff('0x6'));var path=require(_0x58ff('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x58ff('0x8'));var fs=require('fs');var fs_extra=require(_0x58ff('0x9'));var _=require(_0x58ff('0xa'));var squel=require(_0x58ff('0xb'));var crypto=require('crypto');var jsforce=require(_0x58ff('0xc'));var deskjs=require(_0x58ff('0xd'));var toCsv=require(_0x58ff('0xe'));var querystring=require(_0x58ff('0xf'));var Papa=require(_0x58ff('0x10'));var Redis=require('ioredis');var authService=require(_0x58ff('0x11'));var qs=require(_0x58ff('0x12'));var as=require(_0x58ff('0x13'));var hardwareService=require(_0x58ff('0x14'));var logger=require('../../config/logger')(_0x58ff('0x15'));var utils=require(_0x58ff('0x16'));var config=require(_0x58ff('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51cccd,_0x202f3a){_0x202f3a=_0x202f3a||0xcc;return function(_0x1540c4){if(_0x1540c4){return _0x51cccd[_0x58ff('0x18')](_0x202f3a);}return _0x51cccd[_0x58ff('0x19')](_0x202f3a)[_0x58ff('0x1a')]();};}function respondWithResult(_0x25ec48,_0x3912ee){_0x3912ee=_0x3912ee||0xc8;return function(_0x20d69b){if(_0x20d69b){return _0x25ec48[_0x58ff('0x19')](_0x3912ee)['json'](_0x20d69b);}};}function respondWithFilteredResult(_0x4c9ad8,_0xe13724){return function(_0xec397b){if(_0xec397b){var _0x32e58a=typeof _0xe13724[_0x58ff('0x1b')]===_0x58ff('0x1c')&&typeof _0xe13724[_0x58ff('0x1d')]==='undefined';var _0x1fc36d=_0xec397b['count'];var _0x4307c4=_0x32e58a?0x0:_0xe13724[_0x58ff('0x1b')];var _0x536931=_0x32e58a?_0xec397b[_0x58ff('0x1e')]:_0xe13724[_0x58ff('0x1b')]+_0xe13724[_0x58ff('0x1d')];var _0x366123;if(_0x536931>=_0x1fc36d){_0x536931=_0x1fc36d;_0x366123=0xc8;}else{_0x366123=0xce;}_0x4c9ad8[_0x58ff('0x19')](_0x366123);return _0x4c9ad8[_0x58ff('0x1f')]('Content-Range',_0x4307c4+'-'+_0x536931+'/'+_0x1fc36d)[_0x58ff('0x20')](_0xec397b);}return null;};}function patchUpdates(_0x43e6d8){return function(_0x2bcbed){try{jsonpatch['apply'](_0x2bcbed,_0x43e6d8,!![]);}catch(_0x32366d){return BPromise[_0x58ff('0x21')](_0x32366d);}return _0x2bcbed['save']();};}function saveUpdates(_0x3fe56c,_0x2a3c0a){return function(_0x59af96){if(_0x59af96){return _0x59af96[_0x58ff('0x22')](_0x3fe56c)[_0x58ff('0x23')](function(_0x281ccf){return _0x281ccf;});}return null;};}function removeEntity(_0x4451d6,_0x574c55){return function(_0x18a74d){if(_0x18a74d){return _0x18a74d[_0x58ff('0x24')]()[_0x58ff('0x23')](function(){_0x4451d6[_0x58ff('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d508b,_0x510c4a){return function(_0x43f353){if(!_0x43f353){_0x5d508b[_0x58ff('0x18')](0x194);}return _0x43f353;};}function handleError(_0x5471e0,_0x48b65b){_0x48b65b=_0x48b65b||0x1f4;return function(_0x3763e9){logger[_0x58ff('0x25')](_0x3763e9[_0x58ff('0x26')]);if(_0x3763e9[_0x58ff('0x27')]){delete _0x3763e9[_0x58ff('0x27')];}_0x5471e0[_0x58ff('0x19')](_0x48b65b)[_0x58ff('0x28')](_0x3763e9);};}var utilLicense=require(_0x58ff('0x29'));exports[_0x58ff('0x2a')]=function(_0x20261d,_0x3d2490){var _0x3125d6={'raw':!![],'where':{'id':0x1}},_0x548c72={};_0x548c72['model']=_['keys'](db['License'][_0x58ff('0x2b')]);_0x548c72['query']=_[_0x58ff('0x2c')](_0x20261d[_0x58ff('0x2d')]);_0x548c72[_0x58ff('0x2e')]=_[_0x58ff('0x2f')](_0x548c72[_0x58ff('0x30')],_0x548c72[_0x58ff('0x2d')]);_0x3125d6['attributes']=_[_0x58ff('0x2f')](_0x548c72[_0x58ff('0x30')],qs[_0x58ff('0x31')](_0x20261d['query'][_0x58ff('0x31')]));_0x3125d6['attributes']=_0x3125d6[_0x58ff('0x32')][_0x58ff('0x33')]?_0x3125d6[_0x58ff('0x32')]:_0x548c72[_0x58ff('0x30')];_0x3125d6=_[_0x58ff('0x34')]({},_0x3125d6,_0x20261d[_0x58ff('0x35')]);return utilLicense['getLicense'](_0x3125d6)['then'](respondWithResult(_0x3d2490,null))['catch'](handleError(_0x3d2490,null));};exports[_0x58ff('0x22')]=function(_0xc83f90,_0x321e69){if(_0xc83f90[_0x58ff('0x36')]['id']){delete _0xc83f90[_0x58ff('0x36')]['id'];}return db[_0x58ff('0x37')]['find']({'where':{'id':_0xc83f90[_0x58ff('0x38')]['id']}})['then'](handleEntityNotFound(_0x321e69,null))[_0x58ff('0x23')](function(_0x290317){var _0x530828=_0x290317[_0x58ff('0x39')]({'plain':!![]});return utilLicense[_0x58ff('0x3a')](_0x530828,_0xc83f90[_0x58ff('0x36')][_0x58ff('0x3b')]);})[_0x58ff('0x23')](function(_0x227f0e){if(!_0x227f0e[_0x58ff('0x3c')]){return saveUpdates(_0xc83f90[_0x58ff('0x36')],null);}return _0x227f0e;})['then'](respondWithResult(_0x321e69,null))[_0x58ff('0x3d')](handleError(_0x321e69,null));};exports[_0x58ff('0x3e')]=function(_0x1aad58,_0x4cfdd4){var _0x139263='license-info.log';var _0x2dfbfc=path[_0x58ff('0x3f')](_0x58ff('0x40'),'log',_0x58ff('0x41'),_0x139263);_0x4cfdd4[_0x58ff('0x42')](_0x58ff('0x43'),_0x58ff('0x44')+_0x139263);_0x4cfdd4[_0x58ff('0x1f')](_0x58ff('0x45'),_0x58ff('0x46'));_0x4cfdd4[_0x58ff('0x47')](_0x2dfbfc);}; \ No newline at end of file +var _0x0ec0=['lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','save','update','then','destroy','error','stack','send','index','License','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','getLicense','catch','body','find','get','checkLicense','demo','license-info.log','join','log','xcally','Content-disposition','text/plain','download','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x317cb7,_0x20ba28){var _0x38f055=function(_0x585b0f){while(--_0x585b0f){_0x317cb7['push'](_0x317cb7['shift']());}};_0x38f055(++_0x20ba28);}(_0x0ec0,0x1c2));var _0x00ec=function(_0x1bf9a5,_0x2247b3){_0x1bf9a5=_0x1bf9a5-0x0;var _0x1b6538=_0x0ec0[_0x1bf9a5];return _0x1b6538;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00ec('0x0'));var zipdir=require(_0x00ec('0x1'));var jsonpatch=require(_0x00ec('0x2'));var rp=require(_0x00ec('0x3'));var moment=require('moment');var BPromise=require(_0x00ec('0x4'));var Mustache=require(_0x00ec('0x5'));var util=require(_0x00ec('0x6'));var path=require(_0x00ec('0x7'));var sox=require(_0x00ec('0x8'));var csv=require(_0x00ec('0x9'));var ejs=require(_0x00ec('0xa'));var fs=require('fs');var fs_extra=require(_0x00ec('0xb'));var _=require(_0x00ec('0xc'));var squel=require(_0x00ec('0xd'));var crypto=require(_0x00ec('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x00ec('0xf'));var toCsv=require(_0x00ec('0x9'));var querystring=require('querystring');var Papa=require(_0x00ec('0x10'));var Redis=require('ioredis');var authService=require(_0x00ec('0x11'));var qs=require(_0x00ec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00ec('0x13'));var logger=require(_0x00ec('0x14'))('api');var utils=require(_0x00ec('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x00ec('0x16'));var db=require(_0x00ec('0x17'))['db'];function respondWithStatusCode(_0x384eaa,_0x1a1d3f){_0x1a1d3f=_0x1a1d3f||0xcc;return function(_0x5744a8){if(_0x5744a8){return _0x384eaa[_0x00ec('0x18')](_0x1a1d3f);}return _0x384eaa['status'](_0x1a1d3f)[_0x00ec('0x19')]();};}function respondWithResult(_0x5cb7a4,_0x1a066a){_0x1a066a=_0x1a066a||0xc8;return function(_0x25386c){if(_0x25386c){return _0x5cb7a4['status'](_0x1a066a)['json'](_0x25386c);}};}function respondWithFilteredResult(_0x249164,_0xb54abb){return function(_0x28d16c){if(_0x28d16c){var _0xc7e48a=typeof _0xb54abb[_0x00ec('0x1a')]===_0x00ec('0x1b')&&typeof _0xb54abb[_0x00ec('0x1c')]==='undefined';var _0x56666c=_0x28d16c[_0x00ec('0x1d')];var _0x3d1178=_0xc7e48a?0x0:_0xb54abb[_0x00ec('0x1a')];var _0x20ce02=_0xc7e48a?_0x28d16c['count']:_0xb54abb[_0x00ec('0x1a')]+_0xb54abb[_0x00ec('0x1c')];var _0x1a18d6;if(_0x20ce02>=_0x56666c){_0x20ce02=_0x56666c;_0x1a18d6=0xc8;}else{_0x1a18d6=0xce;}_0x249164[_0x00ec('0x1e')](_0x1a18d6);return _0x249164[_0x00ec('0x1f')](_0x00ec('0x20'),_0x3d1178+'-'+_0x20ce02+'/'+_0x56666c)[_0x00ec('0x21')](_0x28d16c);}return null;};}function patchUpdates(_0x1aa9da){return function(_0x795719){try{jsonpatch['apply'](_0x795719,_0x1aa9da,!![]);}catch(_0x29615e){return BPromise['reject'](_0x29615e);}return _0x795719[_0x00ec('0x22')]();};}function saveUpdates(_0x4daca4,_0x5541d6){return function(_0x1a61ec){if(_0x1a61ec){return _0x1a61ec[_0x00ec('0x23')](_0x4daca4)[_0x00ec('0x24')](function(_0x4e6123){return _0x4e6123;});}return null;};}function removeEntity(_0x2ed0f3,_0x58fc25){return function(_0x5537d6){if(_0x5537d6){return _0x5537d6[_0x00ec('0x25')]()[_0x00ec('0x24')](function(){_0x2ed0f3[_0x00ec('0x1e')](0xcc)[_0x00ec('0x19')]();});}};}function handleEntityNotFound(_0xfc7b,_0x3ae6be){return function(_0xc62eb8){if(!_0xc62eb8){_0xfc7b['sendStatus'](0x194);}return _0xc62eb8;};}function handleError(_0x34b22c,_0x55c7db){_0x55c7db=_0x55c7db||0x1f4;return function(_0x384dec){logger[_0x00ec('0x26')](_0x384dec[_0x00ec('0x27')]);if(_0x384dec['name']){delete _0x384dec['name'];}_0x34b22c[_0x00ec('0x1e')](_0x55c7db)[_0x00ec('0x28')](_0x384dec);};}var utilLicense=require('../../config/license/util');exports[_0x00ec('0x29')]=function(_0x1829af,_0x4b7899){var _0x1c83b5={'raw':!![],'where':{'id':0x1}},_0x33bb3c={};_0x33bb3c['model']=_['keys'](db[_0x00ec('0x2a')][_0x00ec('0x2b')]);_0x33bb3c[_0x00ec('0x2c')]=_[_0x00ec('0x2d')](_0x1829af['query']);_0x33bb3c[_0x00ec('0x2e')]=_[_0x00ec('0x2f')](_0x33bb3c['model'],_0x33bb3c[_0x00ec('0x2c')]);_0x1c83b5[_0x00ec('0x30')]=_[_0x00ec('0x2f')](_0x33bb3c[_0x00ec('0x31')],qs[_0x00ec('0x32')](_0x1829af[_0x00ec('0x2c')]['fields']));_0x1c83b5[_0x00ec('0x30')]=_0x1c83b5[_0x00ec('0x30')][_0x00ec('0x33')]?_0x1c83b5[_0x00ec('0x30')]:_0x33bb3c[_0x00ec('0x31')];_0x1c83b5=_['merge']({},_0x1c83b5,_0x1829af['options']);return utilLicense[_0x00ec('0x34')](_0x1c83b5)[_0x00ec('0x24')](respondWithResult(_0x4b7899,null))[_0x00ec('0x35')](handleError(_0x4b7899,null));};exports[_0x00ec('0x23')]=function(_0x5ce6d6,_0x5e2291){if(_0x5ce6d6[_0x00ec('0x36')]['id']){delete _0x5ce6d6[_0x00ec('0x36')]['id'];}return db[_0x00ec('0x2a')][_0x00ec('0x37')]({'where':{'id':_0x5ce6d6['params']['id']}})[_0x00ec('0x24')](handleEntityNotFound(_0x5e2291,null))['then'](function(_0x1fa835){var _0x2e17c2=_0x1fa835[_0x00ec('0x38')]({'plain':!![]});return utilLicense[_0x00ec('0x39')](_0x2e17c2,_0x5ce6d6[_0x00ec('0x36')]['key']);})[_0x00ec('0x24')](function(_0x1548ac){if(!_0x1548ac[_0x00ec('0x3a')]){return saveUpdates(_0x5ce6d6[_0x00ec('0x36')],null);}return _0x1548ac;})[_0x00ec('0x24')](respondWithResult(_0x5e2291,null))[_0x00ec('0x35')](handleError(_0x5e2291,null));};exports['downloadLogFile']=function(_0x56f80c,_0x257259){var _0x2e74db=_0x00ec('0x3b');var _0x491bca=path[_0x00ec('0x3c')]('/var',_0x00ec('0x3d'),_0x00ec('0x3e'),_0x2e74db);_0x257259['setHeader'](_0x00ec('0x3f'),'attachment;\x20filename='+_0x2e74db);_0x257259[_0x00ec('0x1f')]('Content-Type',_0x00ec('0x40'));_0x257259[_0x00ec('0x41')](_0x491bca);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 82996d2..5ec1e8d 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 _0xc1ce=['../../config/environment','./license.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3e6737,_0x20c4d5){var _0x2c84df=function(_0x572149){while(--_0x572149){_0x3e6737['push'](_0x3e6737['shift']());}};_0x2c84df(++_0x20c4d5);}(_0xc1ce,0x163));var _0xec1c=function(_0x1b69b2,_0x492168){_0x1b69b2=_0x1b69b2-0x0;var _0x3f30d1=_0xc1ce[_0x1b69b2];return _0x3f30d1;};'use strict';var _=require(_0xec1c('0x0'));var util=require(_0xec1c('0x1'));var logger=require(_0xec1c('0x2'))(_0xec1c('0x3'));var moment=require(_0xec1c('0x4'));var BPromise=require(_0xec1c('0x5'));var rp=require(_0xec1c('0x6'));var fs=require('fs');var path=require(_0xec1c('0x7'));var rimraf=require(_0xec1c('0x8'));var config=require(_0xec1c('0x9'));var attributes=require(_0xec1c('0xa'));module[_0xec1c('0xb')]=function(_0x5c48eb,_0x17648c){return _0x5c48eb[_0xec1c('0xc')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb816=['exports','define','License','license','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xb6cb4e,_0x4e14bb){var _0x4cc304=function(_0x133a18){while(--_0x133a18){_0xb6cb4e['push'](_0xb6cb4e['shift']());}};_0x4cc304(++_0x4e14bb);}(_0xb816,0x72));var _0x6b81=function(_0x17ddbf,_0x29b0f8){_0x17ddbf=_0x17ddbf-0x0;var _0x563565=_0xb816[_0x17ddbf];return _0x563565;};'use strict';var _=require('lodash');var util=require(_0x6b81('0x0'));var logger=require(_0x6b81('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6b81('0x2'));var rp=require(_0x6b81('0x3'));var fs=require('fs');var path=require(_0x6b81('0x4'));var rimraf=require(_0x6b81('0x5'));var config=require(_0x6b81('0x6'));var attributes=require('./license.attributes');module[_0x6b81('0x7')]=function(_0x522695,_0x2dc1c0){return _0x522695[_0x6b81('0x8')](_0x6b81('0x9'),attributes,{'tableName':_0x6b81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index b611ed8..149ba4d 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 _0x8a23=['catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','message','License,\x20%s,\x20%s','result'];(function(_0x21ef85,_0x1d1aff){var _0x560ec8=function(_0x5eaa8f){while(--_0x5eaa8f){_0x21ef85['push'](_0x21ef85['shift']());}};_0x560ec8(++_0x1d1aff);}(_0x8a23,0x1b9));var _0x38a2=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0x8a23[_0x5e77db];return _0x34b675;};'use strict';var _=require(_0x38a2('0x0'));var util=require(_0x38a2('0x1'));var moment=require(_0x38a2('0x2'));var BPromise=require(_0x38a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x38a2('0x4'));var logger=require(_0x38a2('0x5'))('rpc');var config=require(_0x38a2('0x6'));var jayson=require(_0x38a2('0x7'));var client=jayson[_0x38a2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x117833,_0x5f2b20,_0x296254){return new BPromise(function(_0x4e50d6,_0x18c5fd){return client[_0x38a2('0x9')](_0x117833,_0x296254)['then'](function(_0xf82da1){logger[_0x38a2('0xa')]('License,\x20%s,\x20%s',_0x5f2b20,_0x38a2('0xb'));logger[_0x38a2('0xc')]('License,\x20%s,\x20%s,\x20%s',_0x5f2b20,'request\x20sent',JSON[_0x38a2('0xd')](_0xf82da1));if(_0xf82da1[_0x38a2('0xe')]){if(_0xf82da1[_0x38a2('0xe')][_0x38a2('0xf')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x5f2b20,_0xf82da1[_0x38a2('0xe')]['message']);return _0x18c5fd(_0xf82da1['error'][_0x38a2('0x10')]);}logger[_0x38a2('0xe')]('License,\x20%s,\x20%s',_0x5f2b20,_0xf82da1[_0x38a2('0xe')][_0x38a2('0x10')]);return _0x4e50d6(_0xf82da1['error']['message']);}else{logger['info'](_0x38a2('0x11'),_0x5f2b20,_0x38a2('0xb'));_0x4e50d6(_0xf82da1[_0x38a2('0x12')][_0x38a2('0x10')]);}})[_0x38a2('0x13')](function(_0x47c48c){logger['error'](_0x38a2('0x11'),_0x5f2b20,_0x47c48c);_0x18c5fd(_0x47c48c);});});} \ No newline at end of file +var _0x2877=['../../config/logger','../../config/environment','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','code','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x266ffd,_0x39499a){var _0x4d301a=function(_0x226465){while(--_0x226465){_0x266ffd['push'](_0x266ffd['shift']());}};_0x4d301a(++_0x39499a);}(_0x2877,0x71));var _0x7287=function(_0x45b018,_0x24cc3d){_0x45b018=_0x45b018-0x0;var _0x480ef7=_0x2877[_0x45b018];return _0x480ef7;};'use strict';var _=require(_0x7287('0x0'));var util=require(_0x7287('0x1'));var moment=require(_0x7287('0x2'));var BPromise=require(_0x7287('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7287('0x4'));var db=require(_0x7287('0x5'))['db'];var utils=require(_0x7287('0x6'));var logger=require(_0x7287('0x7'))('rpc');var config=require(_0x7287('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x424fab,_0x10ea9d,_0x55233f){return new BPromise(function(_0x5277d5,_0x54403f){return client[_0x7287('0x9')](_0x424fab,_0x55233f)[_0x7287('0xa')](function(_0x3f0e92){logger['info'](_0x7287('0xb'),_0x10ea9d,_0x7287('0xc'));logger[_0x7287('0xd')](_0x7287('0xe'),_0x10ea9d,_0x7287('0xc'),JSON['stringify'](_0x3f0e92));if(_0x3f0e92['error']){if(_0x3f0e92['error'][_0x7287('0xf')]===0x1f4){logger[_0x7287('0x10')]('License,\x20%s,\x20%s',_0x10ea9d,_0x3f0e92[_0x7287('0x10')][_0x7287('0x11')]);return _0x54403f(_0x3f0e92['error'][_0x7287('0x11')]);}logger['error']('License,\x20%s,\x20%s',_0x10ea9d,_0x3f0e92[_0x7287('0x10')][_0x7287('0x11')]);return _0x5277d5(_0x3f0e92['error']['message']);}else{logger[_0x7287('0x12')](_0x7287('0xb'),_0x10ea9d,_0x7287('0xc'));_0x5277d5(_0x3f0e92[_0x7287('0x13')][_0x7287('0x11')]);}})['catch'](function(_0x598b18){logger[_0x7287('0x10')]('License,\x20%s,\x20%s',_0x10ea9d,_0x598b18);_0x54403f(_0x598b18);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 5748ae4..c8023cf 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 _0x477a=['removeImap','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','addDisposition','post','addAnswer','addImap','addSmtp','/:id/send','send','addAgents','update','delete'];(function(_0x1ab0e6,_0x17ba8d){var _0x248815=function(_0x5d2b40){while(--_0x5d2b40){_0x1ab0e6['push'](_0x1ab0e6['shift']());}};_0x248815(++_0x17ba8d);}(_0x477a,0x1f3));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa477('0x0'));var util=require(_0xa477('0x1'));var path=require(_0xa477('0x2'));var timeout=require(_0xa477('0x3'));var express=require(_0xa477('0x4'));var router=express['Router']();var fs_extra=require(_0xa477('0x5'));var auth=require(_0xa477('0x6'));var interaction=require(_0xa477('0x7'));var config=require(_0xa477('0x8'));var controller=require('./mailAccount.controller');router[_0xa477('0x9')]('/',auth[_0xa477('0xa')](),controller['index']);router[_0xa477('0x9')](_0xa477('0xb'),auth[_0xa477('0xa')](),controller[_0xa477('0xc')]);router['get'](_0xa477('0xd'),auth[_0xa477('0xa')](),controller[_0xa477('0xe')]);router[_0xa477('0x9')](_0xa477('0xf'),auth[_0xa477('0xa')](),controller[_0xa477('0x10')]);router['get'](_0xa477('0x11'),auth[_0xa477('0xa')](),controller[_0xa477('0x12')]);router[_0xa477('0x9')](_0xa477('0x13'),auth[_0xa477('0xa')](),controller[_0xa477('0x14')]);router['get'](_0xa477('0x15'),auth[_0xa477('0xa')](),controller[_0xa477('0x16')]);router['get'](_0xa477('0x17'),auth[_0xa477('0xa')](),controller[_0xa477('0x18')]);router[_0xa477('0x9')](_0xa477('0x19'),auth[_0xa477('0xa')](),controller[_0xa477('0x1a')]);router['get'](_0xa477('0x1b'),auth[_0xa477('0xa')](),controller['getMessages']);router['get'](_0xa477('0x1c'),auth[_0xa477('0xa')](),controller[_0xa477('0x1d')]);router[_0xa477('0x9')](_0xa477('0x1e'),auth[_0xa477('0xa')](),controller['getAgents']);router['post'](_0xa477('0xf'),auth[_0xa477('0xa')](),controller[_0xa477('0x1f')]);router[_0xa477('0x20')](_0xa477('0x11'),auth[_0xa477('0xa')](),controller[_0xa477('0x21')]);router[_0xa477('0x20')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa477('0x20')](_0xa477('0x13'),auth['isAuthenticated'](),controller[_0xa477('0x22')]);router['post'](_0xa477('0x15'),auth[_0xa477('0xa')](),controller[_0xa477('0x23')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0xa477('0x20')](_0xa477('0x19'),auth[_0xa477('0xa')](),controller['addApplications']);router['post'](_0xa477('0x24'),auth[_0xa477('0xa')](),controller[_0xa477('0x25')]);router['post'](_0xa477('0x1e'),auth['isAuthenticated'](),controller[_0xa477('0x26')]);router['put'](_0xa477('0xd'),auth[_0xa477('0xa')](),controller[_0xa477('0x27')]);router[_0xa477('0x28')](_0xa477('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xa477('0x28')](_0xa477('0x11'),auth[_0xa477('0xa')](),controller['removeAnswers']);router['delete'](_0xa477('0x13'),auth['isAuthenticated'](),controller[_0xa477('0x29')]);router[_0xa477('0x28')](_0xa477('0x15'),auth[_0xa477('0xa')](),controller['removeSmtp']);router['delete']('/:id',auth[_0xa477('0xa')](),controller[_0xa477('0x2a')]);router['delete'](_0xa477('0x1e'),auth[_0xa477('0xa')](),controller[_0xa477('0x2b')]);module[_0xa477('0x2c')]=router; \ No newline at end of file +var _0x47eb=['addApplications','/:id/send','addAgents','put','delete','removeDispositions','removeAnswers','/:id/out_servers','removeSmtp','destroy','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','isAuthenticated','index','get','/describe','/:id','getDispositions','/:id/canned_answers','/:id/in_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/verify','verifySmtp','getAgents','/:id/dispositions','post','addAnswer','create','addSmtp','/:id/interactions'];(function(_0x385971,_0x117450){var _0x1f0e2a=function(_0x4b3732){while(--_0x4b3732){_0x385971['push'](_0x385971['shift']());}};_0x1f0e2a(++_0x117450);}(_0x47eb,0x13a));var _0xb47e=function(_0x13d5bc,_0x3fce3c){_0x13d5bc=_0x13d5bc-0x0;var _0x4b8a40=_0x47eb[_0x13d5bc];return _0x4b8a40;};'use strict';var multer=require(_0xb47e('0x0'));var util=require(_0xb47e('0x1'));var path=require(_0xb47e('0x2'));var timeout=require(_0xb47e('0x3'));var express=require(_0xb47e('0x4'));var router=express['Router']();var fs_extra=require(_0xb47e('0x5'));var auth=require(_0xb47e('0x6'));var interaction=require(_0xb47e('0x7'));var config=require('../../config/environment');var controller=require(_0xb47e('0x8'));router['get']('/',auth[_0xb47e('0x9')](),controller[_0xb47e('0xa')]);router[_0xb47e('0xb')](_0xb47e('0xc'),auth[_0xb47e('0x9')](),controller['describe']);router['get'](_0xb47e('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth[_0xb47e('0x9')](),controller[_0xb47e('0xe')]);router[_0xb47e('0xb')](_0xb47e('0xf'),auth[_0xb47e('0x9')](),controller['getAnswers']);router['get'](_0xb47e('0x10'),auth[_0xb47e('0x9')](),controller['getImap']);router['get']('/:id/out_servers',auth[_0xb47e('0x9')](),controller[_0xb47e('0x11')]);router[_0xb47e('0xb')]('/:id/interactions',auth[_0xb47e('0x9')](),controller[_0xb47e('0x12')]);router['get'](_0xb47e('0x13'),auth[_0xb47e('0x9')](),controller[_0xb47e('0x14')]);router[_0xb47e('0xb')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xb47e('0xb')](_0xb47e('0x15'),auth[_0xb47e('0x9')](),controller[_0xb47e('0x16')]);router['get']('/:id/users',auth[_0xb47e('0x9')](),controller[_0xb47e('0x17')]);router['post'](_0xb47e('0x18'),auth[_0xb47e('0x9')](),controller['addDisposition']);router[_0xb47e('0x19')](_0xb47e('0xf'),auth['isAuthenticated'](),controller[_0xb47e('0x1a')]);router[_0xb47e('0x19')]('/',auth[_0xb47e('0x9')](),controller[_0xb47e('0x1b')]);router[_0xb47e('0x19')]('/:id/in_servers',auth[_0xb47e('0x9')](),controller['addImap']);router[_0xb47e('0x19')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xb47e('0x1c')]);router[_0xb47e('0x19')](_0xb47e('0x1d'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xb47e('0x19')](_0xb47e('0x13'),auth[_0xb47e('0x9')](),controller[_0xb47e('0x1e')]);router[_0xb47e('0x19')](_0xb47e('0x1f'),auth[_0xb47e('0x9')](),controller['send']);router[_0xb47e('0x19')]('/:id/users',auth[_0xb47e('0x9')](),controller[_0xb47e('0x20')]);router[_0xb47e('0x21')](_0xb47e('0xd'),auth[_0xb47e('0x9')](),controller['update']);router[_0xb47e('0x22')](_0xb47e('0x18'),auth[_0xb47e('0x9')](),controller[_0xb47e('0x23')]);router['delete'](_0xb47e('0xf'),auth[_0xb47e('0x9')](),controller[_0xb47e('0x24')]);router[_0xb47e('0x22')](_0xb47e('0x10'),auth[_0xb47e('0x9')](),controller['removeImap']);router[_0xb47e('0x22')](_0xb47e('0x25'),auth['isAuthenticated'](),controller[_0xb47e('0x26')]);router[_0xb47e('0x22')](_0xb47e('0xd'),auth['isAuthenticated'](),controller[_0xb47e('0x27')]);router[_0xb47e('0x22')](_0xb47e('0x28'),auth[_0xb47e('0x9')](),controller[_0xb47e('0x29')]);module[_0xb47e('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 797ceb4..c7bf29d 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 _0xf763=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','getDataValue','provider','custom','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf763,0x15d));var _0x3f76=function(_0x2bb3ae,_0x5c4ae3){_0x2bb3ae=_0x2bb3ae-0x0;var _0x30a067=_0xf763[_0x2bb3ae];return _0x30a067;};'use strict';var Sequelize=require(_0x3f76('0x0'));module[_0x3f76('0x1')]={'description':{'type':Sequelize[_0x3f76('0x2')]},'name':{'type':Sequelize[_0x3f76('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x3f76('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x3f76('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3f76('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x3f76('0x4')](0x2)[_0x3f76('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3f76('0x3')],'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[_0x3f76('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3f76('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3f76('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3f76('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3f76('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3f76('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x3f76('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x3f76('0x6')],'defaultValue':![],'comment':_0x3f76('0x8'),'set':function(_0x291c8d){if(!_0x291c8d)this[_0x3f76('0x9')]('mandatoryDispositionPauseId',null);this[_0x3f76('0x9')](_0x3f76('0xa'),_0x291c8d);}},'provider':{'type':Sequelize[_0x3f76('0xb')](_0x3f76('0xc'),_0x3f76('0xd'),'yahoo','outlook365'),'defaultValue':null,'get':function(){var _0x5a6b23=this[_0x3f76('0xe')](_0x3f76('0xf'));return _0x5a6b23||_0x3f76('0x10');},'set':function(_0x506fea){if(_0x506fea===_0x3f76('0x10')){_0x506fea=null;}return this[_0x3f76('0x9')](_0x3f76('0xf'),_0x506fea);}}}; \ No newline at end of file +var _0x86fd=['TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN'];(function(_0x47bbc4,_0x45f2a5){var _0x55cab2=function(_0x4ba02b){while(--_0x4ba02b){_0x47bbc4['push'](_0x47bbc4['shift']());}};_0x55cab2(++_0x45f2a5);}(_0x86fd,0xe6));var _0xd86f=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x86fd[_0x5c4f6b];return _0x104c4e;};'use strict';var Sequelize=require(_0xd86f('0x0'));module[_0xd86f('0x1')]={'description':{'type':Sequelize[_0xd86f('0x2')]},'name':{'type':Sequelize[_0xd86f('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xd86f('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xd86f('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xd86f('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xd86f('0x5')](0x2)[_0xd86f('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xd86f('0x4')],'defaultValue':function(){return _0xd86f('0x7');}},'notificationSound':{'type':Sequelize[_0xd86f('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd86f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd86f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd86f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd86f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd86f('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xd86f('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x24dc28){if(!_0x24dc28)this[_0xd86f('0x9')]('mandatoryDispositionPauseId',null);this[_0xd86f('0x9')](_0xd86f('0xa'),_0x24dc28);}},'provider':{'type':Sequelize[_0xd86f('0xb')](_0xd86f('0xc'),_0xd86f('0xd'),'yahoo',_0xd86f('0xe')),'defaultValue':null,'get':function(){var _0x45ef03=this[_0xd86f('0xf')]('provider');return _0x45ef03||'custom';},'set':function(_0x20fccd){if(_0x20fccd===_0xd86f('0x10')){_0x20fccd=null;}return this[_0xd86f('0x9')](_0xd86f('0x11'),_0x20fccd);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index f38fe5c..4a8761e 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 _0x301a=['MailInteraction','omit','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','getApplications','getMessages','$gte','MailMessage','inlineCss','true','List','CmContact','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','SendMail','sendMail','Contacts','messageId','subject','attach','out','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','bluebird','util','path','lodash','juice','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','get','MailAccounts','sendStatus','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','username','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','findAll','rows','catch','show','params','includeAll','include','find','body','custom','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','Disposition','create','getDispositions','findOne','nolimit','options','count','removeDispositions','ids','addAnswer','MailAccountId','getAnswers','CannedAnswer','key','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x301a,0x1c8));var _0xa301=function(_0xf8bbe9,_0x3631db){_0xf8bbe9=_0xf8bbe9-0x0;var _0xf6d2b2=_0x301a[_0xf8bbe9];return _0xf6d2b2;};'use strict';var moment=require('moment');var BPromise=require(_0xa301('0x0'));var util=require(_0xa301('0x1'));var path=require(_0xa301('0x2'));var _=require(_0xa301('0x3'));var juice=require(_0xa301('0x4'));var Redis=require(_0xa301('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xa301('0x6'))(_0xa301('0x7'));var config=require('../../config/environment');var db=require(_0xa301('0x8'))['db'];config[_0xa301('0x9')]=_[_0xa301('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa301('0xb'))(new Redis(config[_0xa301('0x9')]));require(_0xa301('0xc'))[_0xa301('0xd')](socket);var jayson=require(_0xa301('0xe'));var client=jayson[_0xa301('0xf')][_0xa301('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x483417,_0xa9e343,_0x436325,_0x19e0e8){return new BPromise(function(_0x1dc234,_0x2540e6){var _0x1889f5=_0x19e0e8||client;return _0x1889f5[_0xa301('0x11')](_0x483417,_0x436325)[_0xa301('0x12')](function(_0x3f3a0e){logger[_0xa301('0x13')](_0xa301('0x14'),_0xa9e343,'request\x20sent');logger[_0xa301('0x15')](_0xa301('0x16'),_0xa9e343,_0xa301('0x17'),JSON[_0xa301('0x18')](_0x3f3a0e));if(_0x3f3a0e[_0xa301('0x19')]){if(_0x3f3a0e['error'][_0xa301('0x1a')]===0x1f4){logger[_0xa301('0x19')](_0xa301('0x14'),_0xa9e343,_0x3f3a0e['error'][_0xa301('0x1b')]);return _0x2540e6(_0x3f3a0e[_0xa301('0x19')][_0xa301('0x1b')]);}logger[_0xa301('0x19')](_0xa301('0x14'),_0xa9e343,_0x3f3a0e[_0xa301('0x19')]['message']);return _0x1dc234(_0x3f3a0e['error'][_0xa301('0x1b')]);}else{logger['info'](_0xa301('0x14'),_0xa9e343,_0xa301('0x17'));_0x1dc234(_0x3f3a0e[_0xa301('0x1c')][_0xa301('0x1b')]);}})['catch'](function(_0x13f9ad){logger[_0xa301('0x19')](_0xa301('0x14'),_0xa9e343,_0x13f9ad);_0x2540e6(_0x13f9ad);});});}function respondWithStatusCode(_0x13d941,_0x360deb){_0x360deb=_0x360deb||0xcc;return function(_0x1c3c28){if(_0x1c3c28){return _0x13d941['sendStatus'](_0x360deb);}return _0x13d941[_0xa301('0x1d')](_0x360deb)[_0xa301('0x1e')]();};}function respondWithResult(_0x1a3a89,_0x2efa74){_0x2efa74=_0x2efa74||0xc8;return function(_0xd55d00){if(_0xd55d00){return _0x1a3a89['status'](_0x2efa74)[_0xa301('0x1f')](_0xd55d00);}};}function respondWithFilteredResult(_0x525e30,_0x202242){return function(_0x42dcb6){if(_0x42dcb6){var _0x232a4b=typeof _0x202242[_0xa301('0x20')]===_0xa301('0x21')&&typeof _0x202242[_0xa301('0x22')]===_0xa301('0x21');var _0x375791=_0x42dcb6['count'];var _0x7126b0=_0x232a4b?0x0:_0x202242[_0xa301('0x20')];var _0x232677=_0x232a4b?_0x42dcb6['count']:_0x202242['offset']+_0x202242[_0xa301('0x22')];var _0x46a424;if(_0x232677>=_0x375791){_0x232677=_0x375791;_0x46a424=0xc8;}else{_0x46a424=0xce;}_0x525e30[_0xa301('0x1d')](_0x46a424);return _0x525e30[_0xa301('0x23')](_0xa301('0x24'),_0x7126b0+'-'+_0x232677+'/'+_0x375791)['json'](_0x42dcb6);}return null;};}function saveUpdates(_0x63609d){return function(_0x2864bc){if(_0x2864bc){return _0x2864bc[_0xa301('0x25')](_0x63609d)[_0xa301('0x12')](function(_0x2d25e6){return _0x2d25e6;});}return null;};}function removeEntity(_0x4acd38){return function(_0x520bd3){if(_0x520bd3){return _0x520bd3[_0xa301('0x26')]()['then'](function(){var _0x1318db=_0x520bd3[_0xa301('0x27')]({'plain':!![]});var _0x394357=_0xa301('0x28');return db['UserProfileResource'][_0xa301('0x26')]({'where':{'type':_0x394357,'resourceId':_0x1318db['id']}})[_0xa301('0x12')](function(){return _0x520bd3;});})[_0xa301('0x12')](function(){_0x4acd38[_0xa301('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x222427){return function(_0x186c8a){if(!_0x186c8a){_0x222427[_0xa301('0x29')](0x194);}return _0x186c8a;};}function handleError(_0x3f7e8d,_0x1ead3f){_0x1ead3f=_0x1ead3f||0x1f4;return function(_0x1eda16){logger[_0xa301('0x19')](_0x1eda16['stack']);if(_0x1eda16[_0xa301('0x2a')]){delete _0x1eda16[_0xa301('0x2a')];}_0x3f7e8d[_0xa301('0x1d')](_0x1ead3f)[_0xa301('0x2b')](_0x1eda16);};}function getImapHost(_0x2c7575){switch(_0x2c7575){case _0xa301('0x2c'):return _0xa301('0x2d');case _0xa301('0x2e'):return _0xa301('0x2f');case _0xa301('0x30'):return _0xa301('0x31');case'outlook365':return _0xa301('0x32');}throw new Error(_0xa301('0x33'),_0x2c7575);}function getSmtpHost(_0x395ab1){switch(_0x395ab1){case _0xa301('0x2c'):return _0xa301('0x34');case _0xa301('0x2e'):return _0xa301('0x35');case _0xa301('0x30'):return _0xa301('0x36');case'outlook365':return _0xa301('0x37');}throw new Error(_0xa301('0x33'),_0x395ab1);}function getAuthenticationOptions(_0x3e3361,_0xe6c9d8){var _0x574eb1={};var _0x2c719d={};if(_0x3e3361){_0x574eb1[_0xa301('0x38')]=_0x2c719d[_0xa301('0x38')]=_0xe6c9d8['username'];_0x574eb1[_0xa301('0x39')]=_0x2c719d[_0xa301('0x3a')]=_0xe6c9d8[_0xa301('0x39')];if(_0xe6c9d8['modernAuthentication']){_0x574eb1[_0xa301('0x3b')]=_0x2c719d[_0xa301('0x3b')]=!![];_0x574eb1[_0xa301('0x3c')]=_0x2c719d[_0xa301('0x3c')]=_0xe6c9d8['CloudProviderId'];_0x574eb1[_0xa301('0x39')]=_0x2c719d[_0xa301('0x3a')]=null;}else{_0x574eb1['CloudProviderId']=_0x2c719d[_0xa301('0x3c')]=null;}_0x574eb1[_0xa301('0x3d')]=getImapHost(_0x3e3361);_0x574eb1[_0xa301('0x3e')]=0x3e1;_0x2c719d[_0xa301('0x3d')]=getSmtpHost(_0x3e3361);_0x2c719d[_0xa301('0x3e')]=0x24b;_0x2c719d[_0xa301('0x3f')]=![];_0x574eb1['service']=_0x2c719d[_0xa301('0x40')]=null;}else{if(_0xe6c9d8['authentication']){_0x574eb1[_0xa301('0x38')]=_0x2c719d['user']=_0xe6c9d8[_0xa301('0x41')];_0x574eb1['password']=_0x2c719d[_0xa301('0x3a')]=_0xe6c9d8[_0xa301('0x39')];}else{_0x574eb1[_0xa301('0x42')]=_0x2c719d[_0xa301('0x42')]=![];_0x574eb1['user']=_0x2c719d[_0xa301('0x38')]=null;_0x574eb1[_0xa301('0x39')]=_0x2c719d['pass']=null;}_0x574eb1[_0xa301('0x3d')]=_0xe6c9d8[_0xa301('0x43')][_0xa301('0x3d')];_0x574eb1[_0xa301('0x3e')]=_0xe6c9d8[_0xa301('0x43')][_0xa301('0x3e')];_0x2c719d['host']=_0xe6c9d8[_0xa301('0x44')][_0xa301('0x3d')];_0x2c719d[_0xa301('0x3e')]=_0xe6c9d8[_0xa301('0x44')]['port'];}return{'Imap':_0x574eb1,'Smtp':_0x2c719d};}exports['index']=function(_0xd80068,_0x121925){var _0x25771a={'include':[{'model':db[_0xa301('0x45')],'as':_0xa301('0x43')},{'model':db[_0xa301('0x46')],'as':_0xa301('0x44')},{'model':db[_0xa301('0x47')],'as':_0xa301('0x48')}]},_0xeff0a0={},_0x530104={'count':0x0,'rows':[]};var _0x5de1f3=_[_0xa301('0x49')](db[_0xa301('0x4a')][_0xa301('0x4b')],function(_0x1179a9){return{'name':_0x1179a9[_0xa301('0x4c')],'type':_0x1179a9[_0xa301('0x4d')]['key']};});_0xeff0a0[_0xa301('0x4e')]=_[_0xa301('0x49')](_0x5de1f3,_0xa301('0x2a'));_0xeff0a0[_0xa301('0x4f')]=_[_0xa301('0x50')](_0xd80068['query']);_0xeff0a0[_0xa301('0x51')]=_[_0xa301('0x52')](_0xeff0a0[_0xa301('0x4e')],_0xeff0a0[_0xa301('0x4f')]);_0x25771a['attributes']=_[_0xa301('0x52')](_0xeff0a0[_0xa301('0x4e')],qs[_0xa301('0x53')](_0xd80068[_0xa301('0x4f')][_0xa301('0x53')]));_0x25771a[_0xa301('0x54')]=_0x25771a[_0xa301('0x54')][_0xa301('0x55')]?_0x25771a['attributes']:_0xeff0a0[_0xa301('0x4e')];if(!_0xd80068[_0xa301('0x4f')][_0xa301('0x56')]('nolimit')){_0x25771a[_0xa301('0x22')]=qs[_0xa301('0x22')](_0xd80068[_0xa301('0x4f')]['limit']);_0x25771a[_0xa301('0x20')]=qs[_0xa301('0x20')](_0xd80068['query'][_0xa301('0x20')]);}_0x25771a[_0xa301('0x57')]=qs[_0xa301('0x58')](_0xd80068[_0xa301('0x4f')][_0xa301('0x58')]);_0x25771a[_0xa301('0x59')]=qs[_0xa301('0x51')](_[_0xa301('0x5a')](_0xd80068[_0xa301('0x4f')],_0xeff0a0['filters']),_0x5de1f3);if(_0xd80068[_0xa301('0x4f')][_0xa301('0x5b')]){_0x25771a[_0xa301('0x59')]=_['merge'](_0x25771a[_0xa301('0x59')],{'$or':_[_0xa301('0x49')](_0x5de1f3,function(_0xe439a0){if(_0xe439a0[_0xa301('0x4d')]!=='VIRTUAL'){var _0x4f4b19={};_0x4f4b19[_0xe439a0[_0xa301('0x2a')]]={'$like':'%'+_0xd80068[_0xa301('0x4f')]['filter']+'%'};return _0x4f4b19;}})});}_0x25771a=_[_0xa301('0x5c')]({},_0x25771a,_0xd80068['options']);var _0x1333ab={'where':_0x25771a[_0xa301('0x59')]};return db['MailAccount']['count'](_0x1333ab)[_0xa301('0x12')](function(_0x9e1ae2){_0x530104['count']=_0x9e1ae2;if(_0xd80068[_0xa301('0x4f')]['includeAll']){_0x25771a['include']=[{'all':!![]}];}return db[_0xa301('0x4a')][_0xa301('0x5d')](_0x25771a);})['then'](function(_0x59b1fc){_0x530104[_0xa301('0x5e')]=_0x59b1fc;return _0x530104;})[_0xa301('0x12')](respondWithFilteredResult(_0x121925,_0x25771a))[_0xa301('0x5f')](handleError(_0x121925,null));};exports[_0xa301('0x60')]=function(_0x55f5a8,_0x438a19){var _0x418591={'raw':![],'where':{'id':_0x55f5a8[_0xa301('0x61')]['id']},'include':[{'model':db[_0xa301('0x45')],'as':_0xa301('0x43')},{'model':db[_0xa301('0x46')],'as':_0xa301('0x44')},{'model':db[_0xa301('0x47')],'as':_0xa301('0x48')}]},_0x397fbb={};_0x397fbb[_0xa301('0x4e')]=_[_0xa301('0x50')](db[_0xa301('0x4a')][_0xa301('0x4b')]);_0x397fbb['query']=_[_0xa301('0x50')](_0x55f5a8[_0xa301('0x4f')]);_0x397fbb[_0xa301('0x51')]=_[_0xa301('0x52')](_0x397fbb['model'],_0x397fbb[_0xa301('0x4f')]);_0x418591[_0xa301('0x54')]=_['intersection'](_0x397fbb[_0xa301('0x4e')],qs['fields'](_0x55f5a8[_0xa301('0x4f')][_0xa301('0x53')]));_0x418591['attributes']=_0x418591[_0xa301('0x54')][_0xa301('0x55')]?_0x418591[_0xa301('0x54')]:_0x397fbb['model'];if(_0x55f5a8[_0xa301('0x4f')][_0xa301('0x62')]){_0x418591[_0xa301('0x63')]=[{'all':!![]}];}_0x418591=_[_0xa301('0x5c')]({},_0x418591,_0x55f5a8['options']);return db[_0xa301('0x4a')][_0xa301('0x64')](_0x418591)[_0xa301('0x12')](handleEntityNotFound(_0x438a19,null))[_0xa301('0x12')](respondWithResult(_0x438a19,null))[_0xa301('0x5f')](handleError(_0x438a19,null));};exports[_0xa301('0x25')]=function(_0x3a2ccd,_0xf6161){if(_0x3a2ccd[_0xa301('0x65')]['id']){delete _0x3a2ccd[_0xa301('0x65')]['id'];}var _0x1df33c=_0x3a2ccd['body']['provider']===_0xa301('0x66')?null:_0x3a2ccd[_0xa301('0x65')][_0xa301('0x67')];var _0x2c9e4e=_0x3a2ccd[_0xa301('0x65')]['Imap']||{};var _0x1872af=_0x3a2ccd[_0xa301('0x65')][_0xa301('0x44')]||{};if(_0x1df33c){_0x2c9e4e[_0xa301('0x3d')]=getImapHost(_0x1df33c);_0x2c9e4e[_0xa301('0x3e')]=0x3e1;_0x1872af['host']=getSmtpHost(_0x1df33c);_0x1872af['port']=0x24b;_0x1872af[_0xa301('0x3f')]=![];}if(_0x1872af[_0xa301('0x3b')]){_0x1872af[_0xa301('0x3f')]=![];}else{_0x1872af[_0xa301('0x3c')]=null;}if(!_0x2c9e4e[_0xa301('0x3b')])_0x2c9e4e[_0xa301('0x3c')]=null;_0x3a2ccd[_0xa301('0x65')][_0xa301('0x43')]=_0x2c9e4e;_0x3a2ccd[_0xa301('0x65')]['Smtp']=_0x1872af;return db[_0xa301('0x4a')][_0xa301('0x64')]({'where':{'id':_0x3a2ccd[_0xa301('0x61')]['id']},'include':[{'model':db[_0xa301('0x45')],'as':_0xa301('0x43')},{'model':db[_0xa301('0x46')],'as':_0xa301('0x44')},{'model':db['Pause'],'as':_0xa301('0x48')}]})[_0xa301('0x12')](handleEntityNotFound(_0xf6161,null))[_0xa301('0x12')](function(_0x126a30){if(!_0x126a30)throw new Error(_0xa301('0x68'));if(_0x126a30['service'])delete _0x3a2ccd[_0xa301('0x65')][_0xa301('0x43')];return _0x126a30;})[_0xa301('0x12')](saveUpdates(_0x3a2ccd['body'],null))[_0xa301('0x12')](function(_0x53429d){if(!_0x3a2ccd[_0xa301('0x65')][_0xa301('0x43')])return _0x53429d;return db['MailServerIn'][_0xa301('0x25')](_0x3a2ccd[_0xa301('0x65')][_0xa301('0x43')],{'where':{'MailAccountId':_0x53429d['id']}})['then'](function(){return _0x53429d;});})[_0xa301('0x12')](function(_0x30024f){if(!_0x3a2ccd['body']['Smtp'])return _0x30024f;return db[_0xa301('0x46')]['update'](_0x3a2ccd[_0xa301('0x65')]['Smtp'],{'where':{'MailAccountId':_0x30024f['id']}})[_0xa301('0x12')](function(){return _0x30024f;});})['then'](respondWithResult(_0xf6161,null))[_0xa301('0x5f')](handleError(_0xf6161,null));};exports[_0xa301('0x69')]=function(_0x5635d7,_0x255c0d){return db[_0xa301('0x4a')][_0xa301('0x69')]()[_0xa301('0x12')](respondWithResult(_0x255c0d,null))['catch'](handleError(_0x255c0d,null));};exports[_0xa301('0x6a')]=function(_0x322b9e,_0x1244be){if(_0x322b9e['body']['id']){delete _0x322b9e[_0xa301('0x65')]['id'];}return db[_0xa301('0x4a')]['find']({'where':{'id':_0x322b9e[_0xa301('0x61')]['id']}})['then'](handleEntityNotFound(_0x1244be,null))[_0xa301('0x12')](function(_0x31bc9b){if(_0x31bc9b){_0x322b9e['body']['MailAccountId']=_0x31bc9b['id'];return db[_0xa301('0x6b')][_0xa301('0x6c')](_0x322b9e[_0xa301('0x65')]);}})[_0xa301('0x12')](respondWithResult(_0x1244be,null))['catch'](handleError(_0x1244be,null));};exports[_0xa301('0x6d')]=function(_0x2f8682,_0x22cd2c){var _0x169fea={'raw':![],'where':{}};var _0x56bcd8={};var _0x2e7a7f={'count':0x0,'rows':[]};return db[_0xa301('0x4a')][_0xa301('0x6e')]({'where':{'id':_0x2f8682[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x22cd2c,null))[_0xa301('0x12')](function(_0x5197b8){if(_0x5197b8){_0x56bcd8['model']=_[_0xa301('0x50')](db[_0xa301('0x6b')][_0xa301('0x4b')]);_0x56bcd8[_0xa301('0x4f')]=_[_0xa301('0x50')](_0x2f8682['query']);_0x56bcd8[_0xa301('0x51')]=_[_0xa301('0x52')](_0x56bcd8[_0xa301('0x4e')],_0x56bcd8[_0xa301('0x4f')]);_0x169fea[_0xa301('0x54')]=_[_0xa301('0x52')](_0x56bcd8[_0xa301('0x4e')],qs['fields'](_0x2f8682[_0xa301('0x4f')]['fields']));_0x169fea[_0xa301('0x54')]=_0x169fea[_0xa301('0x54')][_0xa301('0x55')]?_0x169fea[_0xa301('0x54')]:_0x56bcd8[_0xa301('0x4e')];if(!_0x2f8682[_0xa301('0x4f')][_0xa301('0x56')](_0xa301('0x6f'))){_0x169fea[_0xa301('0x22')]=qs[_0xa301('0x22')](_0x2f8682[_0xa301('0x4f')][_0xa301('0x22')]);_0x169fea['offset']=qs[_0xa301('0x20')](_0x2f8682['query'][_0xa301('0x20')]);}_0x169fea[_0xa301('0x57')]=qs[_0xa301('0x58')](_0x2f8682[_0xa301('0x4f')][_0xa301('0x58')]);_0x169fea[_0xa301('0x59')]=qs[_0xa301('0x51')](_['pick'](_0x2f8682[_0xa301('0x4f')],_0x56bcd8[_0xa301('0x51')]));_0x169fea[_0xa301('0x59')]['MailAccountId']=_0x5197b8['id'];if(_0x2f8682['query'][_0xa301('0x5b')]){_0x169fea[_0xa301('0x59')]=_[_0xa301('0x5c')](_0x169fea[_0xa301('0x59')],{'$or':_[_0xa301('0x49')](_0x169fea[_0xa301('0x54')],function(_0x869906){var _0x2904e9={};_0x2904e9[_0x869906]={'$like':'%'+_0x2f8682['query']['filter']+'%'};return _0x2904e9;})});}_0x169fea=_[_0xa301('0x5c')]({},_0x169fea,_0x2f8682[_0xa301('0x70')]);return db['Disposition'][_0xa301('0x71')]({'where':_0x169fea[_0xa301('0x59')]})['then'](function(_0x47ffa7){_0x2e7a7f[_0xa301('0x71')]=_0x47ffa7;if(_0x2f8682[_0xa301('0x4f')][_0xa301('0x62')]){_0x169fea[_0xa301('0x63')]=[{'all':!![]}];}return db[_0xa301('0x6b')][_0xa301('0x5d')](_0x169fea);})['then'](function(_0x22de5f){_0x2e7a7f[_0xa301('0x5e')]=_0x22de5f;return _0x2e7a7f;});}})[_0xa301('0x12')](respondWithFilteredResult(_0x22cd2c,_0x169fea))['catch'](handleError(_0x22cd2c,null));};exports[_0xa301('0x72')]=function(_0xefd63,_0x31b9ec){return db[_0xa301('0x4a')]['find']({'where':{'id':_0xefd63[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x31b9ec,null))[_0xa301('0x12')](function(_0x65d54d){if(_0x65d54d){return _0x65d54d[_0xa301('0x72')](_0xefd63[_0xa301('0x4f')][_0xa301('0x73')]);}})[_0xa301('0x12')](respondWithStatusCode(_0x31b9ec,null))[_0xa301('0x5f')](handleError(_0x31b9ec,null));};exports[_0xa301('0x74')]=function(_0x4c2d45,_0x334220){if(_0x4c2d45['body']['id']){delete _0x4c2d45[_0xa301('0x65')]['id'];}return db[_0xa301('0x4a')][_0xa301('0x64')]({'where':{'id':_0x4c2d45[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x334220,null))[_0xa301('0x12')](function(_0x14ffb5){if(_0x14ffb5){_0x4c2d45[_0xa301('0x65')][_0xa301('0x75')]=_0x14ffb5['id'];return db['CannedAnswer'][_0xa301('0x6c')](_0x4c2d45[_0xa301('0x65')]);}})['then'](respondWithResult(_0x334220,null))[_0xa301('0x5f')](handleError(_0x334220,null));};exports[_0xa301('0x76')]=function(_0x2c71ba,_0x43698b){var _0x51bbc9={'raw':![],'where':{}};var _0x32ac20={};var _0x44d540={'count':0x0,'rows':[]};return db['MailAccount'][_0xa301('0x6e')]({'where':{'id':_0x2c71ba['params']['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x43698b,null))[_0xa301('0x12')](function(_0x49594c){if(_0x49594c){_0x32ac20['model']=_[_0xa301('0x50')](db[_0xa301('0x77')]['rawAttributes']);_0x32ac20[_0xa301('0x4f')]=_[_0xa301('0x50')](_0x2c71ba[_0xa301('0x4f')]);_0x32ac20[_0xa301('0x51')]=_['intersection'](_0x32ac20[_0xa301('0x4e')],_0x32ac20['query']);_0x51bbc9[_0xa301('0x54')]=_[_0xa301('0x52')](_0x32ac20[_0xa301('0x4e')],qs[_0xa301('0x53')](_0x2c71ba[_0xa301('0x4f')][_0xa301('0x53')]));_0x51bbc9[_0xa301('0x54')]=_0x51bbc9['attributes'][_0xa301('0x55')]?_0x51bbc9['attributes']:_0x32ac20[_0xa301('0x4e')];if(!_0x2c71ba[_0xa301('0x4f')]['hasOwnProperty'](_0xa301('0x6f'))){_0x51bbc9[_0xa301('0x22')]=qs[_0xa301('0x22')](_0x2c71ba[_0xa301('0x4f')][_0xa301('0x22')]);_0x51bbc9[_0xa301('0x20')]=qs[_0xa301('0x20')](_0x2c71ba[_0xa301('0x4f')][_0xa301('0x20')]);}_0x51bbc9['order']=qs[_0xa301('0x58')](_0x2c71ba['query'][_0xa301('0x58')]);_0x51bbc9[_0xa301('0x59')]=qs[_0xa301('0x51')](_['pick'](_0x2c71ba[_0xa301('0x4f')],_0x32ac20[_0xa301('0x51')]));_0x51bbc9[_0xa301('0x59')][_0xa301('0x75')]=_0x49594c['id'];if(_0x2c71ba[_0xa301('0x4f')][_0xa301('0x5b')]){_0x51bbc9[_0xa301('0x59')]=_[_0xa301('0x5c')](_0x51bbc9[_0xa301('0x59')],{'$or':_[_0xa301('0x49')](_0x51bbc9['attributes'],function(_0x55a22d){var _0x4661df={};_0x4661df[_0x55a22d]={'$like':'%'+_0x2c71ba[_0xa301('0x4f')][_0xa301('0x5b')]+'%'};return _0x4661df;})});}_0x51bbc9=_['merge']({},_0x51bbc9,_0x2c71ba[_0xa301('0x70')]);return db['CannedAnswer'][_0xa301('0x71')]({'where':_0x51bbc9[_0xa301('0x59')]})['then'](function(_0x9004f5){_0x44d540[_0xa301('0x71')]=_0x9004f5;if(_0x2c71ba[_0xa301('0x4f')]['includeAll']){_0x51bbc9[_0xa301('0x63')]=[{'all':!![]}];}return db[_0xa301('0x77')][_0xa301('0x5d')](_0x51bbc9);})[_0xa301('0x12')](function(_0x537da2){_0x44d540[_0xa301('0x5e')]=_0x537da2;return _0x44d540;});}})[_0xa301('0x12')](respondWithFilteredResult(_0x43698b,_0x51bbc9))[_0xa301('0x5f')](handleError(_0x43698b,null));};exports['removeAnswers']=function(_0x12795d,_0x29543c){return db[_0xa301('0x4a')][_0xa301('0x64')]({'where':{'id':_0x12795d[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x29543c,null))[_0xa301('0x12')](function(_0x35cf84){if(_0x35cf84){return _0x35cf84['removeAnswers'](_0x12795d[_0xa301('0x4f')][_0xa301('0x73')]);}})[_0xa301('0x12')](respondWithStatusCode(_0x29543c,null))[_0xa301('0x5f')](handleError(_0x29543c,null));};exports[_0xa301('0x6c')]=function(_0x7450ae,_0x3939f6){var _0x3bcb85={'name':_0x7450ae[_0xa301('0x65')]['name'],'key':_0x7450ae['body'][_0xa301('0x78')],'provider':_0x7450ae[_0xa301('0x65')][_0xa301('0x67')]==='custom'?null:_0x7450ae[_0xa301('0x65')][_0xa301('0x67')],'email':_0x7450ae[_0xa301('0x65')][_0xa301('0x79')],'ListId':_0x7450ae['body'][_0xa301('0x7a')],'active':!_[_0xa301('0x7b')](_0x7450ae[_0xa301('0x65')]['active'])?_0x7450ae[_0xa301('0x65')][_0xa301('0x7c')]:!![],'description':_0x7450ae[_0xa301('0x65')][_0xa301('0x7d')]||null};var _0x5d0c9c=getAuthenticationOptions(_0x3bcb85[_0xa301('0x67')],_0x7450ae[_0xa301('0x65')]);_0x3bcb85['Imap']=_0x5d0c9c['Imap'];_0x3bcb85[_0xa301('0x44')]=_0x5d0c9c['Smtp'];return db['MailAccount'][_0xa301('0x6c')](_0x3bcb85,{'include':[{'model':db['MailServerOut'],'as':_0xa301('0x44')},{'model':db['MailServerIn'],'as':_0xa301('0x43')}]})[_0xa301('0x12')](function(_0x12d695){var _0x35b755=_0x7450ae[_0xa301('0x38')]['get']({'plain':!![]});if(!_0x35b755)throw new Error(_0xa301('0x7e'));if(_0x35b755[_0xa301('0x7f')]==='user'){var _0x32b539=_0x12d695[_0xa301('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xa301('0x64')]({'where':{'name':_0xa301('0x28'),'userProfileId':_0x35b755[_0xa301('0x80')]},'raw':!![]})['then'](function(_0x38c6ac){if(_0x38c6ac&&_0x38c6ac[_0xa301('0x81')]===0x0){return db[_0xa301('0x82')][_0xa301('0x6c')]({'name':_0x32b539[_0xa301('0x2a')],'resourceId':_0x32b539['id'],'type':_0x38c6ac[_0xa301('0x2a')],'sectionId':_0x38c6ac['id']},{})[_0xa301('0x12')](function(){return _0x12d695;});}else{return _0x12d695;}})[_0xa301('0x5f')](function(_0x5ae6c0){logger[_0xa301('0x19')](_0xa301('0x83'),_0x5ae6c0);throw _0x5ae6c0;});}return _0x12d695;})[_0xa301('0x12')](respondWithResult(_0x3939f6,0xc9))['catch'](handleError(_0x3939f6,null));};exports['getImap']=function(_0x5311bc,_0x45ab45){return db['MailAccount'][_0xa301('0x6e')]({'where':{'id':_0x5311bc[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x45ab45,null))[_0xa301('0x12')](function(_0x425a51){if(_0x425a51){return _0x425a51['getImap']();}return null;})[_0xa301('0x12')](respondWithResult(_0x45ab45,null))[_0xa301('0x5f')](handleError(_0x45ab45,null));};exports['addImap']=function(_0x433463,_0x3887d8){if(_0x433463[_0xa301('0x65')]['id']){delete _0x433463[_0xa301('0x65')]['id'];}return db[_0xa301('0x4a')][_0xa301('0x64')]({'where':{'id':_0x433463[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x3887d8,null))[_0xa301('0x12')](function(_0x556939){if(_0x556939){_0x433463['body'][_0xa301('0x75')]=_0x556939['id'];return db[_0xa301('0x45')][_0xa301('0x6c')](_0x433463[_0xa301('0x65')]);}})[_0xa301('0x12')](respondWithResult(_0x3887d8,null))[_0xa301('0x5f')](handleError(_0x3887d8,null));};exports[_0xa301('0x84')]=function(_0x328419,_0x3818c5){return db[_0xa301('0x4a')][_0xa301('0x6e')]({'where':{'id':_0x328419[_0xa301('0x61')]['id']}})['then'](handleEntityNotFound(_0x3818c5,null))[_0xa301('0x12')](function(_0x3d074c){if(_0x3d074c){return _0x3d074c[_0xa301('0x85')](null);}return null;})[_0xa301('0x12')](respondWithStatusCode(_0x3818c5,null))[_0xa301('0x5f')](handleError(_0x3818c5,null));};exports['getSmtp']=function(_0x4972fe,_0x56fe04){return db['MailAccount']['findOne']({'where':{'id':_0x4972fe['params']['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x56fe04,null))[_0xa301('0x12')](function(_0x1aa241){if(_0x1aa241){return _0x1aa241[_0xa301('0x86')]();}return null;})[_0xa301('0x12')](respondWithResult(_0x56fe04,null))['catch'](handleError(_0x56fe04,null));};exports[_0xa301('0x87')]=function(_0x318ef2,_0x394891){if(_0x318ef2['body']['id']){delete _0x318ef2[_0xa301('0x65')]['id'];}return db[_0xa301('0x4a')][_0xa301('0x64')]({'where':{'id':_0x318ef2['params']['id']}})['then'](handleEntityNotFound(_0x394891,null))[_0xa301('0x12')](function(_0x3f3b50){if(_0x3f3b50){_0x318ef2['body'][_0xa301('0x75')]=_0x3f3b50['id'];return db[_0xa301('0x46')][_0xa301('0x6c')](_0x318ef2['body']);}})[_0xa301('0x12')](respondWithResult(_0x394891,null))[_0xa301('0x5f')](handleError(_0x394891,null));};exports['removeSmtp']=function(_0x133994,_0xa3a69b){return db[_0xa301('0x4a')][_0xa301('0x6e')]({'where':{'id':_0x133994[_0xa301('0x61')]['id']}})['then'](handleEntityNotFound(_0xa3a69b,null))[_0xa301('0x12')](function(_0x24b7c2){if(_0x24b7c2){return _0x24b7c2[_0xa301('0x88')](null);}return null;})[_0xa301('0x12')](respondWithStatusCode(_0xa3a69b,null))[_0xa301('0x5f')](handleError(_0xa3a69b,null));};exports[_0xa301('0x89')]=function(_0x3eed4a,_0xc6d95e){return db[_0xa301('0x8a')]['find']({'where':{'id':_0x3eed4a[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0xc6d95e,null))[_0xa301('0x12')](function(_0x16568a){if(_0x16568a){return _0x16568a[_0xa301('0x89')](_0x3eed4a[_0xa301('0x65')][_0xa301('0x73')],_[_0xa301('0x8b')](_0x3eed4a['body'],['ids','id'])||{});}})[_0xa301('0x12')](respondWithResult(_0xc6d95e,null))[_0xa301('0x5f')](handleError(_0xc6d95e,null));};exports['getInteractions']=function(_0x4f02f6,_0x3f2adb){var _0x21eeb2={'raw':![],'where':{}};var _0x293805={};var _0x58039b={'count':0x0,'rows':[]};return db['MailAccount'][_0xa301('0x6e')]({'where':{'id':_0x4f02f6[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x3f2adb,null))[_0xa301('0x12')](function(_0xb0f009){if(_0xb0f009){_0x293805[_0xa301('0x4e')]=_[_0xa301('0x50')](db[_0xa301('0x8a')][_0xa301('0x4b')]);_0x293805[_0xa301('0x4f')]=_[_0xa301('0x50')](_0x4f02f6[_0xa301('0x4f')]);_0x293805[_0xa301('0x51')]=_['intersection'](_0x293805[_0xa301('0x4e')],_0x293805[_0xa301('0x4f')]);_0x21eeb2[_0xa301('0x54')]=_[_0xa301('0x52')](_0x293805[_0xa301('0x4e')],qs['fields'](_0x4f02f6[_0xa301('0x4f')][_0xa301('0x53')]));_0x21eeb2[_0xa301('0x54')]=_0x21eeb2[_0xa301('0x54')][_0xa301('0x55')]?_0x21eeb2['attributes']:_0x293805[_0xa301('0x4e')];if(!_0x4f02f6[_0xa301('0x4f')]['hasOwnProperty'](_0xa301('0x6f'))){_0x21eeb2[_0xa301('0x22')]=qs[_0xa301('0x22')](_0x4f02f6[_0xa301('0x4f')][_0xa301('0x22')]);_0x21eeb2['offset']=qs[_0xa301('0x20')](_0x4f02f6[_0xa301('0x4f')]['offset']);}_0x21eeb2[_0xa301('0x57')]=qs[_0xa301('0x58')](_0x4f02f6['query'][_0xa301('0x58')]);_0x21eeb2[_0xa301('0x59')]=qs[_0xa301('0x51')](_['pick'](_0x4f02f6[_0xa301('0x4f')],_0x293805[_0xa301('0x51')]));_0x21eeb2[_0xa301('0x59')][_0xa301('0x75')]=_0xb0f009['id'];if(_0x4f02f6[_0xa301('0x4f')][_0xa301('0x5b')]){_0x21eeb2[_0xa301('0x59')]=_[_0xa301('0x5c')](_0x21eeb2[_0xa301('0x59')],{'$or':_[_0xa301('0x49')](_0x21eeb2['attributes'],function(_0x14d869){var _0xde72bb={};_0xde72bb[_0x14d869]={'$like':'%'+_0x4f02f6[_0xa301('0x4f')][_0xa301('0x5b')]+'%'};return _0xde72bb;})});}_0x21eeb2=_[_0xa301('0x5c')]({},_0x21eeb2,_0x4f02f6[_0xa301('0x70')]);return db[_0xa301('0x8a')]['count']({'where':_0x21eeb2['where']})[_0xa301('0x12')](function(_0x109e09){_0x58039b[_0xa301('0x71')]=_0x109e09;if(_0x4f02f6[_0xa301('0x4f')][_0xa301('0x62')]){_0x21eeb2['include']=[{'model':db['CmContact'],'as':_0xa301('0x8c'),'required':![]},{'model':db[_0xa301('0x8d')],'as':_0xa301('0x8e'),'attributes':[_0xa301('0x2a'),'fullname',_0xa301('0x8f')],'required':![]},{'model':db[_0xa301('0x90')],'as':_0xa301('0x91'),'attributes':['id',_0xa301('0x2a'),_0xa301('0x92')],'where':_0x4f02f6[_0xa301('0x4f')][_0xa301('0x93')]?{'id':_0x4f02f6[_0xa301('0x4f')][_0xa301('0x93')]}:undefined,'required':_0x4f02f6[_0xa301('0x4f')][_0xa301('0x93')]?!![]:![]}];}return db[_0xa301('0x8a')][_0xa301('0x5d')](_0x21eeb2);})[_0xa301('0x12')](function(_0x887bb0){_0x58039b[_0xa301('0x5e')]=_0x887bb0;return _0x58039b;});}})[_0xa301('0x12')](respondWithFilteredResult(_0x3f2adb,_0x21eeb2))['catch'](handleError(_0x3f2adb,null));};exports[_0xa301('0x94')]=function addApplications(_0x2c7949,_0x668899){var _0x51864e=_0x2c7949[_0xa301('0x61')]['id'];var _0x43e4df=_0x2c7949['body'];var _0x34abd9=0xc8;var _0x26ded8=null;return db['sequelize'][_0xa301('0x95')]({'isolationLevel':db[_0xa301('0x96')]['Transaction'][_0xa301('0x97')][_0xa301('0x98')]},function(_0x2c2365){return db[_0xa301('0x4a')][_0xa301('0x6e')]({'where':{'id':_0x51864e},'transaction':_0x2c2365})[_0xa301('0x12')](function(_0x3aa025){if(_0x3aa025){return db[_0xa301('0x99')][_0xa301('0x26')]({'where':{'MailAccountId':_0x51864e},'transaction':_0x2c2365})[_0xa301('0x12')](function(){var _0x541c7b=_[_0xa301('0x49')](_0x43e4df,function(_0x36b6c3){_0x36b6c3['MailAccountId']=_0x51864e;return _0x36b6c3;});return db['MailApplication'][_0xa301('0x9a')](_0x541c7b,{'transaction':_0x2c2365});});}else{_0x34abd9=0x194;_0x26ded8=[];}});})[_0xa301('0x12')](function(){if(_0x34abd9!==0x194){return db[_0xa301('0x99')]['findAndCountAll']({'where':{'MailAccountId':_0x51864e},'order':_0xa301('0x9b')})[_0xa301('0x12')](function(_0x402ae5){_0x26ded8=_0x402ae5;});}})[_0xa301('0x5f')](function(_0x20c263){_0x34abd9=0x1f4;logger[_0xa301('0x19')](_0x20c263['stack']);if(_0x20c263[_0xa301('0x2a')]){delete _0x20c263[_0xa301('0x2a')];}_0x26ded8=_0x20c263;})['finally'](function(){if(_0x26ded8===null){_0x668899[_0xa301('0x29')](_0x34abd9);}else{if(_0x34abd9===0x1f4){_0x668899[_0xa301('0x1d')](_0x34abd9)[_0xa301('0x2b')](_0x26ded8);}else{_0x668899[_0xa301('0x1d')](_0x34abd9)['json'](_0x26ded8);}}});};exports[_0xa301('0x9c')]=function(_0x50c4ff,_0x346b6b){var _0x2fac40={};var _0x2f6d30={};var _0x870203;var _0x4519f1;return db[_0xa301('0x4a')]['findOne']({'where':{'id':_0x50c4ff['params']['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x346b6b,null))['then'](function(_0x218aa1){if(_0x218aa1){_0x870203=_0x218aa1;_0x2f6d30['model']=_[_0xa301('0x50')](db[_0xa301('0x99')][_0xa301('0x4b')]);_0x2f6d30[_0xa301('0x4f')]=_[_0xa301('0x50')](_0x50c4ff[_0xa301('0x4f')]);_0x2f6d30['filters']=_[_0xa301('0x52')](_0x2f6d30['model'],_0x2f6d30[_0xa301('0x4f')]);_0x2fac40[_0xa301('0x54')]=_[_0xa301('0x52')](_0x2f6d30[_0xa301('0x4e')],qs[_0xa301('0x53')](_0x50c4ff[_0xa301('0x4f')][_0xa301('0x53')]));_0x2fac40[_0xa301('0x54')]=_0x2fac40[_0xa301('0x54')]['length']?_0x2fac40[_0xa301('0x54')]:_0x2f6d30['model'];_0x2fac40[_0xa301('0x57')]=qs['sort'](_0x50c4ff['query']['sort']);_0x2fac40['where']=qs[_0xa301('0x51')](_['pick'](_0x50c4ff[_0xa301('0x4f')],_0x2f6d30[_0xa301('0x51')]));if(_0x50c4ff[_0xa301('0x4f')][_0xa301('0x5b')]){_0x2fac40[_0xa301('0x59')]=_[_0xa301('0x5c')](_0x2fac40[_0xa301('0x59')],{'$or':_['map'](_0x2fac40[_0xa301('0x54')],function(_0x530b7b){var _0x26e9fc={};_0x26e9fc[_0x530b7b]={'$like':'%'+_0x50c4ff[_0xa301('0x4f')]['filter']+'%'};return _0x26e9fc;})});}_0x2fac40=_[_0xa301('0x5c')]({},_0x2fac40,_0x50c4ff[_0xa301('0x70')]);return _0x870203[_0xa301('0x9c')](_0x2fac40);}})[_0xa301('0x12')](function(_0x557c85){if(_0x557c85){_0x4519f1=_0x557c85[_0xa301('0x55')];if(!_0x50c4ff[_0xa301('0x4f')][_0xa301('0x56')](_0xa301('0x6f'))){_0x2fac40[_0xa301('0x22')]=qs[_0xa301('0x22')](_0x50c4ff[_0xa301('0x4f')][_0xa301('0x22')]);_0x2fac40[_0xa301('0x20')]=qs[_0xa301('0x20')](_0x50c4ff[_0xa301('0x4f')][_0xa301('0x20')]);}return _0x870203[_0xa301('0x9c')](_0x2fac40);}})[_0xa301('0x12')](function(_0x55a255){if(_0x55a255){return _0x55a255?{'count':_0x4519f1,'rows':_0x55a255}:null;}})['then'](respondWithResult(_0x346b6b,null))[_0xa301('0x5f')](handleError(_0x346b6b,null));};exports[_0xa301('0x9d')]=function(_0x3f2984,_0x4fe4fd){var _0x5d5681={'raw':!![],'where':{}};var _0xf0a896={};var _0x159e26={'count':0x0,'rows':[]};return db[_0xa301('0x4a')]['findOne']({'where':{'id':_0x3f2984['params']['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x4fe4fd,null))[_0xa301('0x12')](function(_0x334fad){if(_0x334fad){_0xf0a896['model']=_[_0xa301('0x50')](db['MailMessage']['rawAttributes']);_0xf0a896[_0xa301('0x4f')]=_[_0xa301('0x50')](_0x3f2984[_0xa301('0x4f')]);_0xf0a896['filters']=_[_0xa301('0x52')](_0xf0a896[_0xa301('0x4e')],_0xf0a896[_0xa301('0x4f')]);_0x5d5681[_0xa301('0x54')]=_[_0xa301('0x52')](_0xf0a896[_0xa301('0x4e')],qs['fields'](_0x3f2984[_0xa301('0x4f')][_0xa301('0x53')]));_0x5d5681['attributes']=_0x5d5681[_0xa301('0x54')][_0xa301('0x55')]?_0x5d5681[_0xa301('0x54')]:_0xf0a896['model'];if(!_0x3f2984[_0xa301('0x4f')][_0xa301('0x56')]('nolimit')){_0x5d5681[_0xa301('0x22')]=qs[_0xa301('0x22')](_0x3f2984[_0xa301('0x4f')][_0xa301('0x22')]);_0x5d5681[_0xa301('0x20')]=qs['offset'](_0x3f2984[_0xa301('0x4f')][_0xa301('0x20')]);}_0x5d5681[_0xa301('0x57')]=qs[_0xa301('0x58')](_0x3f2984[_0xa301('0x4f')]['sort']);_0x5d5681[_0xa301('0x59')]=qs[_0xa301('0x51')](_[_0xa301('0x5a')](_0x3f2984[_0xa301('0x4f')],_0xf0a896[_0xa301('0x51')]));_0x5d5681['where'][_0xa301('0x75')]=_0x334fad['id'];if(_0x3f2984[_0xa301('0x4f')]['filter']){_0x5d5681[_0xa301('0x59')]=_[_0xa301('0x5c')](_0x5d5681[_0xa301('0x59')],{'$or':_[_0xa301('0x49')](_0x5d5681[_0xa301('0x54')],function(_0x38388a){var _0x4d10b6={};_0x4d10b6[_0x38388a]={'$like':'%'+_0x3f2984[_0xa301('0x4f')]['filter']+'%'};return _0x4d10b6;})});}if(_0x3f2984[_0xa301('0x4f')]['$gte']){var _0x25d52a=_0x3f2984[_0xa301('0x4f')][_0xa301('0x9e')]['split'](',');var _0x5c318c={};_0x5c318c[_0x25d52a[0x0]]={'$gte':moment(_0x25d52a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5d5681[_0xa301('0x59')]=_[_0xa301('0x5c')](_0x5d5681[_0xa301('0x59')],_0x5c318c);}_0x5d5681=_[_0xa301('0x5c')]({},_0x5d5681,_0x3f2984['options']);return db[_0xa301('0x9f')][_0xa301('0x71')]({'where':_0x5d5681[_0xa301('0x59')]})[_0xa301('0x12')](function(_0x1ab3d6){_0x159e26[_0xa301('0x71')]=_0x1ab3d6;if(_0x3f2984[_0xa301('0x4f')][_0xa301('0x62')]){_0x5d5681[_0xa301('0x63')]=[{'all':!![]}];}return db['MailMessage'][_0xa301('0x5d')](_0x5d5681);})[_0xa301('0x12')](function(_0xb754fa){if(_0x3f2984[_0xa301('0x4f')][_0xa301('0xa0')]===_0xa301('0xa1')){for(var _0x238539=0x0;_0x238539<_0xb754fa[_0xa301('0x55')];_0x238539++){_0xb754fa[_0x238539][_0xa301('0x65')]=juice(_0xb754fa[_0x238539][_0xa301('0x65')]);}}_0x159e26[_0xa301('0x5e')]=_0xb754fa;return _0x159e26;});}})[_0xa301('0x12')](respondWithFilteredResult(_0x4fe4fd,_0x5d5681))[_0xa301('0x5f')](handleError(_0x4fe4fd,null));};exports['send']=function(_0x4a361e,_0x561126){var _0x14cddf,_0x433141={},_0xa27fd7;if(_0x4a361e[_0xa301('0x65')]['to']){_0xa27fd7=_0x4a361e[_0xa301('0x65')]['to']['split'](',')[0x0];}return db['MailAccount'][_0xa301('0x64')]({'where':{'id':_0x4a361e['params']['id']},'include':[{'model':db['CmList'],'as':_0xa301('0xa2'),'include':[{'model':db[_0xa301('0xa3')],'as':'Contacts','where':{'email':_0xa27fd7},'limit':0x1,'order':[[_0xa301('0xa4'),_0xa301('0xa5')]]}]},{'model':db[_0xa301('0x46')],'as':_0xa301('0x44'),'raw':!![],'include':[{'model':db[_0xa301('0xa6')],'as':'CloudProvider','raw':!![]}]}]})[_0xa301('0x12')](handleEntityNotFound(_0x561126,null))[_0xa301('0x12')](function(_0x4cd7ab){if(!_0x4cd7ab)return;_0x14cddf=_0x4cd7ab;if(!_0x4cd7ab[_0xa301('0x44')])throw new Error(_0xa301('0xa7'));if(_[_0xa301('0x7b')](_0x4a361e[_0xa301('0x65')][_0xa301('0xa8')])){_0x4a361e[_0xa301('0x65')][_0xa301('0xa8')]=util['format'](_0xa301('0xa9'),_0x4cd7ab[_0xa301('0x2a')],_0x4cd7ab['email']||_0x4cd7ab[_0xa301('0x44')][_0xa301('0x38')]);}if(_0x4a361e[_0xa301('0x65')][_0xa301('0xaa')]&&_0x4a361e[_0xa301('0x65')]['attachments'][_0xa301('0x55')]){for(var _0x515855=0x0;_0x515855<_0x4a361e[_0xa301('0x65')][_0xa301('0xaa')]['length'];_0x515855+=0x1){_0x4a361e[_0xa301('0x65')]['attachments'][_0x515855]={'filename':_0x4a361e['body']['attachments'][_0x515855][_0xa301('0x2a')],'path':path['join'](config[_0xa301('0xab')],_0xa301('0xac'),_0x4a361e[_0xa301('0x65')][_0xa301('0xaa')][_0x515855][_0xa301('0xad')])};}}var _0x150cd7=_0x4cd7ab['getSmtpOptions']();return respondWithRpcPromise(_0xa301('0xae'),_0xa301('0xaf'),{'account':_0x150cd7,'message':_0x4a361e[_0xa301('0x65')]});})[_0xa301('0x12')](function(_0x5b1a8e){if(!_0x5b1a8e)return;_0x433141=_0x5b1a8e;if(!_0x14cddf[_0xa301('0xa2')])throw new Error('List\x20not\x20found');if(_0x14cddf['List'][_0xa301('0xb0')][_0xa301('0x55')])return _0x14cddf['List'][_0xa301('0xb0')][0x0];return db[_0xa301('0xa3')][_0xa301('0x6c')](_[_0xa301('0xa')](_0x4a361e[_0xa301('0x65')],{'firstName':_0x4a361e[_0xa301('0x65')]['to'],'email':_0x4a361e['body']['to'],'phone':_0x4a361e['body']['to'],'ListId':_0x14cddf[_0xa301('0x7a')]}));})['then'](function(_0x521af3){if(!_0x521af3)return;var _0x25c0f9={'UserId':_0x4a361e[_0xa301('0x38')]['id'],'ContactId':_0x521af3['id'],'MailAccountId':_0x14cddf['id'],'inReplyTo':_0x433141[_0xa301('0xb1')],'to':_0x4a361e[_0xa301('0x65')][_0xa301('0xa8')],'cc':_0x4a361e['body']['cc'],'subject':_0x4a361e['body'][_0xa301('0xb2')],'attach':_0x4a361e[_0xa301('0x65')][_0xa301('0xb3')],'firstMsgDirection':_0xa301('0xb4'),'lastMsgAt':moment()[_0xa301('0xb5')](_0xa301('0xb6')),'lastMsgDirection':_0xa301('0xb4'),'Messages':[_['merge'](_0x4a361e[_0xa301('0x65')],{'messageId':_0x433141[_0xa301('0xb1')],'sentAt':moment()[_0xa301('0xb5')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x14cddf['id'],'UserId':_0x4a361e[_0xa301('0x38')]['id'],'ContactId':_0x521af3['id']})]};if(_0x4a361e['body']['Interaction']){_0x25c0f9=_[_0xa301('0x5c')](_0x25c0f9,_0x4a361e[_0xa301('0x65')][_0xa301('0xb7')]);}return db['MailInteraction'][_0xa301('0x6c')](_0x25c0f9,{'include':[{'model':db['MailMessage'],'as':_0xa301('0xb8')}]});})['then'](respondWithResult(_0x561126,null))[_0xa301('0x5f')](handleError(_0x561126,null));};exports[_0xa301('0xb9')]=function(_0x6043b4,_0x1b048a){return db['MailAccount'][_0xa301('0x64')]({'where':{'id':_0x6043b4['params']['id']},'include':[{'model':db[_0xa301('0x46')],'as':_0xa301('0x44'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa301('0xa6'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1b048a,null))[_0xa301('0x12')](function(_0x1b4433){if(!_0x1b4433[_0xa301('0x44')])return;var _0x2cfb78=_0x1b4433[_0xa301('0xba')]();return respondWithRpcPromise(_0xa301('0xbb'),_0xa301('0xb9'),{'account':_0x2cfb78});})['then'](respondWithResult(_0x1b048a,null))['catch'](handleError(_0x1b048a,null));};exports[_0xa301('0x26')]=function(_0x1d8109,_0x2bc99f){return db['MailAccount'][_0xa301('0x64')]({'where':{'id':_0x1d8109[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x2bc99f,null))[_0xa301('0x12')](function(_0x58af5c){if(_0x58af5c&&_0x58af5c[_0xa301('0x40')]){throw new db[(_0xa301('0xbc'))][(_0xa301('0xbd'))](_0xa301('0xbe'));}return _0x58af5c;})[_0xa301('0x12')](removeEntity(_0x2bc99f,null))[_0xa301('0x5f')](handleError(_0x2bc99f,null));};exports[_0xa301('0xbf')]=function(_0x5a6a5f,_0x4926d5){return db[_0xa301('0x4a')][_0xa301('0x64')]({'where':{'id':_0x5a6a5f[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x4926d5,null))[_0xa301('0x12')](function(_0x568d4f){if(_0x568d4f){return _0x568d4f['addAgents'](_0x5a6a5f[_0xa301('0x65')][_0xa301('0x73')],_['omit'](_0x5a6a5f['body'],[_0xa301('0x73'),'id'])||{})[_0xa301('0xc0')](function(_0x3dda67){for(var _0x1dc088=0x0;_0x1dc088<_0x5a6a5f[_0xa301('0x65')][_0xa301('0x73')][_0xa301('0x55')];_0x1dc088+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x5a6a5f[_0xa301('0x65')][_0xa301('0x73')][_0x1dc088]),'MailAccountId':Number(_0x5a6a5f[_0xa301('0x61')]['id'])});}return _0x3dda67;});}})['then'](respondWithResult(_0x4926d5,null))[_0xa301('0x5f')](handleError(_0x4926d5,null));};exports[_0xa301('0xc1')]=function(_0x964181,_0x4abb14){return db['MailAccount'][_0xa301('0x64')]({'where':{'id':_0x964181[_0xa301('0x61')]['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x4abb14,null))['then'](function(_0xe8e8cf){if(_0xe8e8cf){return _0xe8e8cf['removeAgents'](_0x964181[_0xa301('0x4f')][_0xa301('0x73')])['then'](function(){if(_[_0xa301('0xc2')](_0x964181[_0xa301('0x4f')][_0xa301('0x73')])){for(var _0x285982=0x0;_0x285982<_0x964181[_0xa301('0x4f')]['ids']['length'];_0x285982+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x964181[_0xa301('0x4f')]['ids'][_0x285982]),'MailAccountId':Number(_0x964181[_0xa301('0x61')]['id'])});}}else{socket[_0xa301('0xc3')](_0xa301('0xc4'),{'UserId':Number(_0x964181[_0xa301('0x4f')][_0xa301('0x73')]),'MailAccountId':Number(_0x964181['params']['id'])});}});}})[_0xa301('0x12')](respondWithStatusCode(_0x4abb14,null))[_0xa301('0x5f')](handleError(_0x4abb14,null));};exports[_0xa301('0xc5')]=function(_0x5060b5,_0x7faf81){var _0x405bab={};var _0x56333a={};var _0x462abf;var _0x376d4a;return db['MailAccount']['findOne']({'where':{'id':_0x5060b5['params']['id']}})[_0xa301('0x12')](handleEntityNotFound(_0x7faf81,null))[_0xa301('0x12')](function(_0x18ec46){if(_0x18ec46){_0x462abf=_0x18ec46;_0x56333a[_0xa301('0x4e')]=_[_0xa301('0x50')](db[_0xa301('0x8d')][_0xa301('0x4b')]);_0x56333a[_0xa301('0x4f')]=_['keys'](_0x5060b5['query']);_0x56333a[_0xa301('0x51')]=_[_0xa301('0x52')](_0x56333a[_0xa301('0x4e')],_0x56333a[_0xa301('0x4f')]);_0x405bab['attributes']=_[_0xa301('0x52')](_0x56333a['model'],qs[_0xa301('0x53')](_0x5060b5['query']['fields']));_0x405bab[_0xa301('0x54')]=_0x405bab[_0xa301('0x54')][_0xa301('0x55')]?_0x405bab['attributes']:_0x56333a[_0xa301('0x4e')];_0x405bab[_0xa301('0x57')]=qs['sort'](_0x5060b5[_0xa301('0x4f')][_0xa301('0x58')]);_0x405bab[_0xa301('0x59')]=qs[_0xa301('0x51')](_[_0xa301('0x5a')](_0x5060b5['query'],_0x56333a['filters']));if(_0x5060b5[_0xa301('0x4f')]['filter']){_0x405bab[_0xa301('0x59')]=_['merge'](_0x405bab['where'],{'$or':_[_0xa301('0x49')](_0x405bab['attributes'],function(_0x39e260){var _0x39e762={};_0x39e762[_0x39e260]={'$like':'%'+_0x5060b5[_0xa301('0x4f')][_0xa301('0x5b')]+'%'};return _0x39e762;})});}_0x405bab=_['merge']({},_0x405bab,_0x5060b5[_0xa301('0x70')]);return _0x462abf['getAgents'](_0x405bab);}})[_0xa301('0x12')](function(_0x5b8e65){if(_0x5b8e65){_0x376d4a=_0x5b8e65[_0xa301('0x55')];if(!_0x5060b5['query'][_0xa301('0x56')](_0xa301('0x6f'))){_0x405bab[_0xa301('0x22')]=qs['limit'](_0x5060b5[_0xa301('0x4f')][_0xa301('0x22')]);_0x405bab['offset']=qs[_0xa301('0x20')](_0x5060b5[_0xa301('0x4f')][_0xa301('0x20')]);}return _0x462abf[_0xa301('0xc5')](_0x405bab);}})[_0xa301('0x12')](function(_0x415b0f){if(_0x415b0f){return _0x415b0f?{'count':_0x376d4a,'rows':_0x415b0f}:null;}})[_0xa301('0x12')](respondWithResult(_0x7faf81,null))[_0xa301('0x5f')](handleError(_0x7faf81,null));}; \ No newline at end of file +var _0xbc19=['smtp.gmail.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','body','provider','describe','MailAccountId','Disposition','getDispositions','findOne','rawAttributes','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','custom','email','isNil','active','description','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','addInteraction','MailInteraction','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','CmContact','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','userMailAccount:save','removeAgents','emit','getAgents','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','MailAccounts','end','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider'];(function(_0x51057a,_0x2c8c27){var _0x3cbdaa=function(_0x168adf){while(--_0x168adf){_0x51057a['push'](_0x51057a['shift']());}};_0x3cbdaa(++_0x2c8c27);}(_0xbc19,0x92));var _0x9bc1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbc19[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x9bc1('0x0'));var BPromise=require(_0x9bc1('0x1'));var util=require('util');var path=require(_0x9bc1('0x2'));var _=require(_0x9bc1('0x3'));var juice=require(_0x9bc1('0x4'));var Redis=require(_0x9bc1('0x5'));var qs=require(_0x9bc1('0x6'));var logger=require(_0x9bc1('0x7'))(_0x9bc1('0x8'));var config=require('../../config/environment');var db=require(_0x9bc1('0x9'))['db'];config[_0x9bc1('0xa')]=_[_0x9bc1('0xb')](config[_0x9bc1('0xa')],{'host':_0x9bc1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9bc1('0xa')]));require(_0x9bc1('0xd'))[_0x9bc1('0xe')](socket);var jayson=require(_0x9bc1('0xf'));var client=jayson['client'][_0x9bc1('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x38f753,_0x29a5e3,_0x174efa,_0x3de8ef){return new BPromise(function(_0xdcdb77,_0x17e7a2){var _0x2612e9=_0x3de8ef||client;return _0x2612e9['request'](_0x38f753,_0x174efa)['then'](function(_0x536aef){logger[_0x9bc1('0x11')](_0x9bc1('0x12'),_0x29a5e3,_0x9bc1('0x13'));logger[_0x9bc1('0x14')](_0x9bc1('0x15'),_0x29a5e3,'request\x20sent',JSON[_0x9bc1('0x16')](_0x536aef));if(_0x536aef['error']){if(_0x536aef[_0x9bc1('0x17')][_0x9bc1('0x18')]===0x1f4){logger['error'](_0x9bc1('0x12'),_0x29a5e3,_0x536aef[_0x9bc1('0x17')][_0x9bc1('0x19')]);return _0x17e7a2(_0x536aef[_0x9bc1('0x17')][_0x9bc1('0x19')]);}logger[_0x9bc1('0x17')](_0x9bc1('0x12'),_0x29a5e3,_0x536aef[_0x9bc1('0x17')][_0x9bc1('0x19')]);return _0xdcdb77(_0x536aef['error']['message']);}else{logger[_0x9bc1('0x11')](_0x9bc1('0x12'),_0x29a5e3,_0x9bc1('0x13'));_0xdcdb77(_0x536aef['result'][_0x9bc1('0x19')]);}})[_0x9bc1('0x1a')](function(_0x39dedc){logger[_0x9bc1('0x17')](_0x9bc1('0x12'),_0x29a5e3,_0x39dedc);_0x17e7a2(_0x39dedc);});});}function respondWithStatusCode(_0x29da12,_0xbf9946){_0xbf9946=_0xbf9946||0xcc;return function(_0x2717e3){if(_0x2717e3){return _0x29da12[_0x9bc1('0x1b')](_0xbf9946);}return _0x29da12[_0x9bc1('0x1c')](_0xbf9946)['end']();};}function respondWithResult(_0x4d2677,_0x5e15cd){_0x5e15cd=_0x5e15cd||0xc8;return function(_0x1a4cac){if(_0x1a4cac){return _0x4d2677[_0x9bc1('0x1c')](_0x5e15cd)[_0x9bc1('0x1d')](_0x1a4cac);}};}function respondWithFilteredResult(_0x298cb3,_0x2e311a){return function(_0x198c93){if(_0x198c93){var _0x26d83a=typeof _0x2e311a[_0x9bc1('0x1e')]==='undefined'&&typeof _0x2e311a['limit']===_0x9bc1('0x1f');var _0x1ea610=_0x198c93['count'];var _0x2c1f39=_0x26d83a?0x0:_0x2e311a[_0x9bc1('0x1e')];var _0x2bad92=_0x26d83a?_0x198c93[_0x9bc1('0x20')]:_0x2e311a[_0x9bc1('0x1e')]+_0x2e311a[_0x9bc1('0x21')];var _0x5df866;if(_0x2bad92>=_0x1ea610){_0x2bad92=_0x1ea610;_0x5df866=0xc8;}else{_0x5df866=0xce;}_0x298cb3[_0x9bc1('0x1c')](_0x5df866);return _0x298cb3[_0x9bc1('0x22')](_0x9bc1('0x23'),_0x2c1f39+'-'+_0x2bad92+'/'+_0x1ea610)[_0x9bc1('0x1d')](_0x198c93);}return null;};}function saveUpdates(_0x73954c){return function(_0x3d9f0a){if(_0x3d9f0a){return _0x3d9f0a[_0x9bc1('0x24')](_0x73954c)[_0x9bc1('0x25')](function(_0x29a89d){return _0x29a89d;});}return null;};}function removeEntity(_0xf2317a){return function(_0x2e60dc){if(_0x2e60dc){return _0x2e60dc[_0x9bc1('0x26')]()['then'](function(){var _0x47dd93=_0x2e60dc[_0x9bc1('0x27')]({'plain':!![]});var _0x24c2bb=_0x9bc1('0x28');return db['UserProfileResource'][_0x9bc1('0x26')]({'where':{'type':_0x24c2bb,'resourceId':_0x47dd93['id']}})[_0x9bc1('0x25')](function(){return _0x2e60dc;});})[_0x9bc1('0x25')](function(){_0xf2317a[_0x9bc1('0x1c')](0xcc)[_0x9bc1('0x29')]();});}};}function handleEntityNotFound(_0x31acfa){return function(_0x4bbf3a){if(!_0x4bbf3a){_0x31acfa[_0x9bc1('0x1b')](0x194);}return _0x4bbf3a;};}function handleError(_0xedcba0,_0x3b77e2){_0x3b77e2=_0x3b77e2||0x1f4;return function(_0x2ea010){logger[_0x9bc1('0x17')](_0x2ea010[_0x9bc1('0x2a')]);if(_0x2ea010[_0x9bc1('0x2b')]){delete _0x2ea010[_0x9bc1('0x2b')];}_0xedcba0['status'](_0x3b77e2)[_0x9bc1('0x2c')](_0x2ea010);};}function getImapHost(_0x4d4f8e){switch(_0x4d4f8e){case _0x9bc1('0x2d'):return _0x9bc1('0x2e');case _0x9bc1('0x2f'):return _0x9bc1('0x30');case _0x9bc1('0x31'):return _0x9bc1('0x32');case _0x9bc1('0x33'):return _0x9bc1('0x34');}throw new Error(_0x9bc1('0x35'),_0x4d4f8e);}function getSmtpHost(_0x53ecc8){switch(_0x53ecc8){case _0x9bc1('0x2d'):return _0x9bc1('0x36');case'yahoo':return'smtp.mail.yahoo.com';case _0x9bc1('0x31'):return _0x9bc1('0x37');case _0x9bc1('0x33'):return _0x9bc1('0x38');}throw new Error(_0x9bc1('0x35'),_0x53ecc8);}function getAuthenticationOptions(_0x1ab640,_0x544f51){var _0x2cbac2={};var _0x217df3={};if(_0x1ab640){_0x2cbac2[_0x9bc1('0x39')]=_0x217df3['user']=_0x544f51[_0x9bc1('0x3a')];_0x2cbac2[_0x9bc1('0x3b')]=_0x217df3['pass']=_0x544f51[_0x9bc1('0x3b')];if(_0x544f51['modernAuthentication']){_0x2cbac2[_0x9bc1('0x3c')]=_0x217df3[_0x9bc1('0x3c')]=!![];_0x2cbac2['CloudProviderId']=_0x217df3[_0x9bc1('0x3d')]=_0x544f51[_0x9bc1('0x3d')];_0x2cbac2[_0x9bc1('0x3b')]=_0x217df3[_0x9bc1('0x3e')]=null;}else{_0x2cbac2[_0x9bc1('0x3d')]=_0x217df3[_0x9bc1('0x3d')]=null;}_0x2cbac2[_0x9bc1('0x3f')]=getImapHost(_0x1ab640);_0x2cbac2['port']=0x3e1;_0x217df3[_0x9bc1('0x3f')]=getSmtpHost(_0x1ab640);_0x217df3[_0x9bc1('0x40')]=0x24b;_0x217df3[_0x9bc1('0x41')]=![];_0x2cbac2[_0x9bc1('0x42')]=_0x217df3[_0x9bc1('0x42')]=null;}else{if(_0x544f51[_0x9bc1('0x43')]){_0x2cbac2[_0x9bc1('0x39')]=_0x217df3['user']=_0x544f51['username'];_0x2cbac2[_0x9bc1('0x3b')]=_0x217df3[_0x9bc1('0x3e')]=_0x544f51[_0x9bc1('0x3b')];}else{_0x2cbac2['authentication']=_0x217df3['authentication']=![];_0x2cbac2['user']=_0x217df3[_0x9bc1('0x39')]=null;_0x2cbac2[_0x9bc1('0x3b')]=_0x217df3[_0x9bc1('0x3e')]=null;}_0x2cbac2['host']=_0x544f51[_0x9bc1('0x44')][_0x9bc1('0x3f')];_0x2cbac2[_0x9bc1('0x40')]=_0x544f51[_0x9bc1('0x44')][_0x9bc1('0x40')];_0x217df3[_0x9bc1('0x3f')]=_0x544f51[_0x9bc1('0x45')][_0x9bc1('0x3f')];_0x217df3[_0x9bc1('0x40')]=_0x544f51['Smtp'][_0x9bc1('0x40')];}return{'Imap':_0x2cbac2,'Smtp':_0x217df3};}exports[_0x9bc1('0x46')]=function(_0x303e77,_0x2bb3ce){var _0x2c152a={'include':[{'model':db[_0x9bc1('0x47')],'as':_0x9bc1('0x44')},{'model':db[_0x9bc1('0x48')],'as':_0x9bc1('0x45')},{'model':db[_0x9bc1('0x49')],'as':_0x9bc1('0x4a')}]},_0x5c8d3d={},_0xdce37a={'count':0x0,'rows':[]};var _0x8750d1=_['map'](db[_0x9bc1('0x4b')]['rawAttributes'],function(_0x27885b){return{'name':_0x27885b[_0x9bc1('0x4c')],'type':_0x27885b[_0x9bc1('0x4d')][_0x9bc1('0x4e')]};});_0x5c8d3d[_0x9bc1('0x4f')]=_[_0x9bc1('0x50')](_0x8750d1,_0x9bc1('0x2b'));_0x5c8d3d[_0x9bc1('0x51')]=_[_0x9bc1('0x52')](_0x303e77[_0x9bc1('0x51')]);_0x5c8d3d[_0x9bc1('0x53')]=_['intersection'](_0x5c8d3d[_0x9bc1('0x4f')],_0x5c8d3d[_0x9bc1('0x51')]);_0x2c152a['attributes']=_[_0x9bc1('0x54')](_0x5c8d3d[_0x9bc1('0x4f')],qs['fields'](_0x303e77[_0x9bc1('0x51')][_0x9bc1('0x55')]));_0x2c152a[_0x9bc1('0x56')]=_0x2c152a[_0x9bc1('0x56')][_0x9bc1('0x57')]?_0x2c152a[_0x9bc1('0x56')]:_0x5c8d3d[_0x9bc1('0x4f')];if(!_0x303e77[_0x9bc1('0x51')][_0x9bc1('0x58')](_0x9bc1('0x59'))){_0x2c152a[_0x9bc1('0x21')]=qs['limit'](_0x303e77[_0x9bc1('0x51')]['limit']);_0x2c152a[_0x9bc1('0x1e')]=qs[_0x9bc1('0x1e')](_0x303e77['query'][_0x9bc1('0x1e')]);}_0x2c152a['order']=qs[_0x9bc1('0x5a')](_0x303e77['query'][_0x9bc1('0x5a')]);_0x2c152a[_0x9bc1('0x5b')]=qs['filters'](_[_0x9bc1('0x5c')](_0x303e77[_0x9bc1('0x51')],_0x5c8d3d[_0x9bc1('0x53')]),_0x8750d1);if(_0x303e77[_0x9bc1('0x51')][_0x9bc1('0x5d')]){_0x2c152a[_0x9bc1('0x5b')]=_[_0x9bc1('0x5e')](_0x2c152a[_0x9bc1('0x5b')],{'$or':_[_0x9bc1('0x50')](_0x8750d1,function(_0x302012){if(_0x302012[_0x9bc1('0x4d')]!==_0x9bc1('0x5f')){var _0x355c8f={};_0x355c8f[_0x302012[_0x9bc1('0x2b')]]={'$like':'%'+_0x303e77[_0x9bc1('0x51')][_0x9bc1('0x5d')]+'%'};return _0x355c8f;}})});}_0x2c152a=_[_0x9bc1('0x5e')]({},_0x2c152a,_0x303e77['options']);var _0x2401e7={'where':_0x2c152a['where']};return db[_0x9bc1('0x4b')]['count'](_0x2401e7)[_0x9bc1('0x25')](function(_0xa04ddc){_0xdce37a[_0x9bc1('0x20')]=_0xa04ddc;if(_0x303e77['query'][_0x9bc1('0x60')]){_0x2c152a[_0x9bc1('0x61')]=[{'all':!![]}];}return db[_0x9bc1('0x4b')][_0x9bc1('0x62')](_0x2c152a);})['then'](function(_0x52440a){_0xdce37a[_0x9bc1('0x63')]=_0x52440a;return _0xdce37a;})[_0x9bc1('0x25')](respondWithFilteredResult(_0x2bb3ce,_0x2c152a))[_0x9bc1('0x1a')](handleError(_0x2bb3ce,null));};exports[_0x9bc1('0x64')]=function(_0x574550,_0x4ade8e){var _0x3742f5={'raw':![],'where':{'id':_0x574550[_0x9bc1('0x65')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x9bc1('0x44')},{'model':db[_0x9bc1('0x48')],'as':_0x9bc1('0x45')},{'model':db[_0x9bc1('0x49')],'as':_0x9bc1('0x4a')}]},_0x5f3bdc={};_0x5f3bdc[_0x9bc1('0x4f')]=_[_0x9bc1('0x52')](db[_0x9bc1('0x4b')]['rawAttributes']);_0x5f3bdc[_0x9bc1('0x51')]=_[_0x9bc1('0x52')](_0x574550['query']);_0x5f3bdc[_0x9bc1('0x53')]=_[_0x9bc1('0x54')](_0x5f3bdc[_0x9bc1('0x4f')],_0x5f3bdc['query']);_0x3742f5['attributes']=_[_0x9bc1('0x54')](_0x5f3bdc[_0x9bc1('0x4f')],qs[_0x9bc1('0x55')](_0x574550[_0x9bc1('0x51')][_0x9bc1('0x55')]));_0x3742f5[_0x9bc1('0x56')]=_0x3742f5[_0x9bc1('0x56')][_0x9bc1('0x57')]?_0x3742f5[_0x9bc1('0x56')]:_0x5f3bdc['model'];if(_0x574550[_0x9bc1('0x51')][_0x9bc1('0x60')]){_0x3742f5['include']=[{'all':!![]}];}_0x3742f5=_[_0x9bc1('0x5e')]({},_0x3742f5,_0x574550[_0x9bc1('0x66')]);return db[_0x9bc1('0x4b')][_0x9bc1('0x67')](_0x3742f5)[_0x9bc1('0x25')](handleEntityNotFound(_0x4ade8e,null))[_0x9bc1('0x25')](respondWithResult(_0x4ade8e,null))[_0x9bc1('0x1a')](handleError(_0x4ade8e,null));};exports[_0x9bc1('0x24')]=function(_0x490e2b,_0x38b045){if(_0x490e2b[_0x9bc1('0x68')]['id']){delete _0x490e2b[_0x9bc1('0x68')]['id'];}var _0x1d99cc=_0x490e2b[_0x9bc1('0x68')][_0x9bc1('0x69')]==='custom'?null:_0x490e2b[_0x9bc1('0x68')][_0x9bc1('0x69')];var _0x16943f=_0x490e2b['body'][_0x9bc1('0x44')]||{};var _0x15e42a=_0x490e2b[_0x9bc1('0x68')][_0x9bc1('0x45')]||{};if(_0x1d99cc){_0x16943f[_0x9bc1('0x3f')]=getImapHost(_0x1d99cc);_0x16943f[_0x9bc1('0x40')]=0x3e1;_0x15e42a[_0x9bc1('0x3f')]=getSmtpHost(_0x1d99cc);_0x15e42a[_0x9bc1('0x40')]=0x24b;_0x15e42a[_0x9bc1('0x41')]=![];}if(_0x15e42a[_0x9bc1('0x3c')]){_0x15e42a['secure']=![];}else{_0x15e42a[_0x9bc1('0x3d')]=null;}if(!_0x16943f[_0x9bc1('0x3c')])_0x16943f['CloudProviderId']=null;_0x490e2b[_0x9bc1('0x68')]['Imap']=_0x16943f;_0x490e2b[_0x9bc1('0x68')][_0x9bc1('0x45')]=_0x15e42a;return db[_0x9bc1('0x4b')][_0x9bc1('0x67')]({'where':{'id':_0x490e2b[_0x9bc1('0x65')]['id']},'include':[{'model':db[_0x9bc1('0x47')],'as':'Imap'},{'model':db[_0x9bc1('0x48')],'as':'Smtp'},{'model':db[_0x9bc1('0x49')],'as':_0x9bc1('0x4a')}]})[_0x9bc1('0x25')](handleEntityNotFound(_0x38b045,null))['then'](function(_0x425d36){if(!_0x425d36)throw new Error('Mail\x20Account\x20not\x20found');if(_0x425d36['service'])delete _0x490e2b['body']['Imap'];return _0x425d36;})[_0x9bc1('0x25')](saveUpdates(_0x490e2b[_0x9bc1('0x68')],null))[_0x9bc1('0x25')](function(_0x3c4fc5){if(!_0x490e2b[_0x9bc1('0x68')][_0x9bc1('0x44')])return _0x3c4fc5;return db[_0x9bc1('0x47')][_0x9bc1('0x24')](_0x490e2b[_0x9bc1('0x68')][_0x9bc1('0x44')],{'where':{'MailAccountId':_0x3c4fc5['id']}})[_0x9bc1('0x25')](function(){return _0x3c4fc5;});})[_0x9bc1('0x25')](function(_0x5ebdcd){if(!_0x490e2b['body']['Smtp'])return _0x5ebdcd;return db[_0x9bc1('0x48')][_0x9bc1('0x24')](_0x490e2b[_0x9bc1('0x68')]['Smtp'],{'where':{'MailAccountId':_0x5ebdcd['id']}})[_0x9bc1('0x25')](function(){return _0x5ebdcd;});})['then'](respondWithResult(_0x38b045,null))['catch'](handleError(_0x38b045,null));};exports[_0x9bc1('0x6a')]=function(_0x51bfbd,_0x47dbd9){return db[_0x9bc1('0x4b')][_0x9bc1('0x6a')]()[_0x9bc1('0x25')](respondWithResult(_0x47dbd9,null))['catch'](handleError(_0x47dbd9,null));};exports['addDisposition']=function(_0x5135a1,_0x312564){if(_0x5135a1[_0x9bc1('0x68')]['id']){delete _0x5135a1[_0x9bc1('0x68')]['id'];}return db[_0x9bc1('0x4b')][_0x9bc1('0x67')]({'where':{'id':_0x5135a1['params']['id']}})['then'](handleEntityNotFound(_0x312564,null))[_0x9bc1('0x25')](function(_0x3b113c){if(_0x3b113c){_0x5135a1[_0x9bc1('0x68')][_0x9bc1('0x6b')]=_0x3b113c['id'];return db[_0x9bc1('0x6c')]['create'](_0x5135a1[_0x9bc1('0x68')]);}})[_0x9bc1('0x25')](respondWithResult(_0x312564,null))[_0x9bc1('0x1a')](handleError(_0x312564,null));};exports[_0x9bc1('0x6d')]=function(_0x28944c,_0x30b611){var _0x48533f={'raw':![],'where':{}};var _0x194f8c={};var _0x555a82={'count':0x0,'rows':[]};return db[_0x9bc1('0x4b')][_0x9bc1('0x6e')]({'where':{'id':_0x28944c['params']['id']}})['then'](handleEntityNotFound(_0x30b611,null))[_0x9bc1('0x25')](function(_0x156a5e){if(_0x156a5e){_0x194f8c[_0x9bc1('0x4f')]=_['keys'](db[_0x9bc1('0x6c')][_0x9bc1('0x6f')]);_0x194f8c['query']=_[_0x9bc1('0x52')](_0x28944c[_0x9bc1('0x51')]);_0x194f8c[_0x9bc1('0x53')]=_[_0x9bc1('0x54')](_0x194f8c[_0x9bc1('0x4f')],_0x194f8c[_0x9bc1('0x51')]);_0x48533f[_0x9bc1('0x56')]=_['intersection'](_0x194f8c[_0x9bc1('0x4f')],qs[_0x9bc1('0x55')](_0x28944c[_0x9bc1('0x51')][_0x9bc1('0x55')]));_0x48533f[_0x9bc1('0x56')]=_0x48533f['attributes'][_0x9bc1('0x57')]?_0x48533f[_0x9bc1('0x56')]:_0x194f8c[_0x9bc1('0x4f')];if(!_0x28944c[_0x9bc1('0x51')][_0x9bc1('0x58')](_0x9bc1('0x59'))){_0x48533f[_0x9bc1('0x21')]=qs['limit'](_0x28944c[_0x9bc1('0x51')][_0x9bc1('0x21')]);_0x48533f[_0x9bc1('0x1e')]=qs[_0x9bc1('0x1e')](_0x28944c['query'][_0x9bc1('0x1e')]);}_0x48533f[_0x9bc1('0x70')]=qs[_0x9bc1('0x5a')](_0x28944c['query'][_0x9bc1('0x5a')]);_0x48533f[_0x9bc1('0x5b')]=qs[_0x9bc1('0x53')](_[_0x9bc1('0x5c')](_0x28944c['query'],_0x194f8c['filters']));_0x48533f[_0x9bc1('0x5b')]['MailAccountId']=_0x156a5e['id'];if(_0x28944c[_0x9bc1('0x51')][_0x9bc1('0x5d')]){_0x48533f['where']=_[_0x9bc1('0x5e')](_0x48533f[_0x9bc1('0x5b')],{'$or':_['map'](_0x48533f[_0x9bc1('0x56')],function(_0x47eae0){var _0x5da009={};_0x5da009[_0x47eae0]={'$like':'%'+_0x28944c[_0x9bc1('0x51')][_0x9bc1('0x5d')]+'%'};return _0x5da009;})});}_0x48533f=_[_0x9bc1('0x5e')]({},_0x48533f,_0x28944c[_0x9bc1('0x66')]);return db[_0x9bc1('0x6c')]['count']({'where':_0x48533f[_0x9bc1('0x5b')]})['then'](function(_0x3f4e70){_0x555a82[_0x9bc1('0x20')]=_0x3f4e70;if(_0x28944c['query'][_0x9bc1('0x60')]){_0x48533f[_0x9bc1('0x61')]=[{'all':!![]}];}return db[_0x9bc1('0x6c')]['findAll'](_0x48533f);})[_0x9bc1('0x25')](function(_0x3d0dba){_0x555a82[_0x9bc1('0x63')]=_0x3d0dba;return _0x555a82;});}})[_0x9bc1('0x25')](respondWithFilteredResult(_0x30b611,_0x48533f))[_0x9bc1('0x1a')](handleError(_0x30b611,null));};exports['removeDispositions']=function(_0x29d000,_0x5c61f4){return db[_0x9bc1('0x4b')][_0x9bc1('0x67')]({'where':{'id':_0x29d000[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x5c61f4,null))['then'](function(_0x1e8012){if(_0x1e8012){return _0x1e8012[_0x9bc1('0x71')](_0x29d000[_0x9bc1('0x51')][_0x9bc1('0x72')]);}})[_0x9bc1('0x25')](respondWithStatusCode(_0x5c61f4,null))[_0x9bc1('0x1a')](handleError(_0x5c61f4,null));};exports[_0x9bc1('0x73')]=function(_0x599a2d,_0x4617e7){if(_0x599a2d[_0x9bc1('0x68')]['id']){delete _0x599a2d['body']['id'];}return db[_0x9bc1('0x4b')][_0x9bc1('0x67')]({'where':{'id':_0x599a2d[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x4617e7,null))[_0x9bc1('0x25')](function(_0x4cd035){if(_0x4cd035){_0x599a2d['body'][_0x9bc1('0x6b')]=_0x4cd035['id'];return db[_0x9bc1('0x74')]['create'](_0x599a2d['body']);}})[_0x9bc1('0x25')](respondWithResult(_0x4617e7,null))[_0x9bc1('0x1a')](handleError(_0x4617e7,null));};exports[_0x9bc1('0x75')]=function(_0x54ed4,_0x58b11c){var _0x4a3eb7={'raw':![],'where':{}};var _0x2bae24={};var _0x4d6319={'count':0x0,'rows':[]};return db[_0x9bc1('0x4b')][_0x9bc1('0x6e')]({'where':{'id':_0x54ed4[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x58b11c,null))[_0x9bc1('0x25')](function(_0x175553){if(_0x175553){_0x2bae24[_0x9bc1('0x4f')]=_[_0x9bc1('0x52')](db[_0x9bc1('0x74')][_0x9bc1('0x6f')]);_0x2bae24['query']=_[_0x9bc1('0x52')](_0x54ed4[_0x9bc1('0x51')]);_0x2bae24[_0x9bc1('0x53')]=_['intersection'](_0x2bae24[_0x9bc1('0x4f')],_0x2bae24['query']);_0x4a3eb7[_0x9bc1('0x56')]=_['intersection'](_0x2bae24['model'],qs['fields'](_0x54ed4[_0x9bc1('0x51')][_0x9bc1('0x55')]));_0x4a3eb7[_0x9bc1('0x56')]=_0x4a3eb7[_0x9bc1('0x56')][_0x9bc1('0x57')]?_0x4a3eb7[_0x9bc1('0x56')]:_0x2bae24[_0x9bc1('0x4f')];if(!_0x54ed4['query'][_0x9bc1('0x58')](_0x9bc1('0x59'))){_0x4a3eb7['limit']=qs[_0x9bc1('0x21')](_0x54ed4[_0x9bc1('0x51')][_0x9bc1('0x21')]);_0x4a3eb7[_0x9bc1('0x1e')]=qs[_0x9bc1('0x1e')](_0x54ed4[_0x9bc1('0x51')]['offset']);}_0x4a3eb7[_0x9bc1('0x70')]=qs[_0x9bc1('0x5a')](_0x54ed4[_0x9bc1('0x51')]['sort']);_0x4a3eb7[_0x9bc1('0x5b')]=qs[_0x9bc1('0x53')](_[_0x9bc1('0x5c')](_0x54ed4[_0x9bc1('0x51')],_0x2bae24[_0x9bc1('0x53')]));_0x4a3eb7['where']['MailAccountId']=_0x175553['id'];if(_0x54ed4[_0x9bc1('0x51')]['filter']){_0x4a3eb7['where']=_['merge'](_0x4a3eb7['where'],{'$or':_['map'](_0x4a3eb7[_0x9bc1('0x56')],function(_0x35c8d4){var _0x34452b={};_0x34452b[_0x35c8d4]={'$like':'%'+_0x54ed4['query']['filter']+'%'};return _0x34452b;})});}_0x4a3eb7=_[_0x9bc1('0x5e')]({},_0x4a3eb7,_0x54ed4[_0x9bc1('0x66')]);return db['CannedAnswer'][_0x9bc1('0x20')]({'where':_0x4a3eb7[_0x9bc1('0x5b')]})[_0x9bc1('0x25')](function(_0x5f5204){_0x4d6319[_0x9bc1('0x20')]=_0x5f5204;if(_0x54ed4[_0x9bc1('0x51')][_0x9bc1('0x60')]){_0x4a3eb7[_0x9bc1('0x61')]=[{'all':!![]}];}return db[_0x9bc1('0x74')][_0x9bc1('0x62')](_0x4a3eb7);})['then'](function(_0x45093e){_0x4d6319['rows']=_0x45093e;return _0x4d6319;});}})[_0x9bc1('0x25')](respondWithFilteredResult(_0x58b11c,_0x4a3eb7))[_0x9bc1('0x1a')](handleError(_0x58b11c,null));};exports[_0x9bc1('0x76')]=function(_0x5f511a,_0x7007db){return db[_0x9bc1('0x4b')][_0x9bc1('0x67')]({'where':{'id':_0x5f511a[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x7007db,null))[_0x9bc1('0x25')](function(_0x556f99){if(_0x556f99){return _0x556f99[_0x9bc1('0x76')](_0x5f511a[_0x9bc1('0x51')]['ids']);}})['then'](respondWithStatusCode(_0x7007db,null))['catch'](handleError(_0x7007db,null));};exports['create']=function(_0x25462f,_0x2ed637){var _0x53515b={'name':_0x25462f[_0x9bc1('0x68')]['name'],'key':_0x25462f['body'][_0x9bc1('0x4e')],'provider':_0x25462f[_0x9bc1('0x68')]['provider']===_0x9bc1('0x77')?null:_0x25462f[_0x9bc1('0x68')]['provider'],'email':_0x25462f[_0x9bc1('0x68')][_0x9bc1('0x78')],'ListId':_0x25462f[_0x9bc1('0x68')]['ListId'],'active':!_[_0x9bc1('0x79')](_0x25462f[_0x9bc1('0x68')]['active'])?_0x25462f[_0x9bc1('0x68')][_0x9bc1('0x7a')]:!![],'description':_0x25462f[_0x9bc1('0x68')][_0x9bc1('0x7b')]||null};var _0x2a1f6c=getAuthenticationOptions(_0x53515b['provider'],_0x25462f['body']);_0x53515b['Imap']=_0x2a1f6c['Imap'];_0x53515b[_0x9bc1('0x45')]=_0x2a1f6c[_0x9bc1('0x45')];return db[_0x9bc1('0x4b')][_0x9bc1('0x7c')](_0x53515b,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['MailServerIn'],'as':'Imap'}]})[_0x9bc1('0x25')](function(_0x4ce56e){var _0x3f4b24=_0x25462f[_0x9bc1('0x39')][_0x9bc1('0x27')]({'plain':!![]});if(!_0x3f4b24)throw new Error(_0x9bc1('0x7d'));if(_0x3f4b24[_0x9bc1('0x7e')]===_0x9bc1('0x39')){var _0x38f888=_0x4ce56e[_0x9bc1('0x27')]({'plain':!![]});return db[_0x9bc1('0x7f')][_0x9bc1('0x67')]({'where':{'name':'MailAccounts','userProfileId':_0x3f4b24[_0x9bc1('0x80')]},'raw':!![]})['then'](function(_0x183766){if(_0x183766&&_0x183766[_0x9bc1('0x81')]===0x0){return db[_0x9bc1('0x82')][_0x9bc1('0x7c')]({'name':_0x38f888[_0x9bc1('0x2b')],'resourceId':_0x38f888['id'],'type':_0x183766[_0x9bc1('0x2b')],'sectionId':_0x183766['id']},{})[_0x9bc1('0x25')](function(){return _0x4ce56e;});}else{return _0x4ce56e;}})['catch'](function(_0x430c40){logger['error'](_0x9bc1('0x83'),_0x430c40);throw _0x430c40;});}return _0x4ce56e;})['then'](respondWithResult(_0x2ed637,0xc9))[_0x9bc1('0x1a')](handleError(_0x2ed637,null));};exports[_0x9bc1('0x84')]=function(_0x13b37b,_0xb0f47e){return db[_0x9bc1('0x4b')][_0x9bc1('0x6e')]({'where':{'id':_0x13b37b[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0xb0f47e,null))[_0x9bc1('0x25')](function(_0x5f56f0){if(_0x5f56f0){return _0x5f56f0['getImap']();}return null;})[_0x9bc1('0x25')](respondWithResult(_0xb0f47e,null))['catch'](handleError(_0xb0f47e,null));};exports['addImap']=function(_0x27c6e5,_0x1eb04e){if(_0x27c6e5[_0x9bc1('0x68')]['id']){delete _0x27c6e5[_0x9bc1('0x68')]['id'];}return db[_0x9bc1('0x4b')][_0x9bc1('0x67')]({'where':{'id':_0x27c6e5[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x1eb04e,null))[_0x9bc1('0x25')](function(_0x2670d6){if(_0x2670d6){_0x27c6e5[_0x9bc1('0x68')][_0x9bc1('0x6b')]=_0x2670d6['id'];return db['MailServerIn']['create'](_0x27c6e5[_0x9bc1('0x68')]);}})[_0x9bc1('0x25')](respondWithResult(_0x1eb04e,null))[_0x9bc1('0x1a')](handleError(_0x1eb04e,null));};exports[_0x9bc1('0x85')]=function(_0x2583d1,_0x4c7030){return db[_0x9bc1('0x4b')]['findOne']({'where':{'id':_0x2583d1[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x4c7030,null))[_0x9bc1('0x25')](function(_0x142be0){if(_0x142be0){return _0x142be0[_0x9bc1('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x4c7030,null))[_0x9bc1('0x1a')](handleError(_0x4c7030,null));};exports[_0x9bc1('0x87')]=function(_0x591e5b,_0xf87ee3){return db['MailAccount'][_0x9bc1('0x6e')]({'where':{'id':_0x591e5b[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0xf87ee3,null))[_0x9bc1('0x25')](function(_0x2cf872){if(_0x2cf872){return _0x2cf872['getSmtp']();}return null;})[_0x9bc1('0x25')](respondWithResult(_0xf87ee3,null))[_0x9bc1('0x1a')](handleError(_0xf87ee3,null));};exports[_0x9bc1('0x88')]=function(_0x231736,_0x3f4b97){if(_0x231736[_0x9bc1('0x68')]['id']){delete _0x231736[_0x9bc1('0x68')]['id'];}return db['MailAccount'][_0x9bc1('0x67')]({'where':{'id':_0x231736[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x3f4b97,null))['then'](function(_0x134913){if(_0x134913){_0x231736[_0x9bc1('0x68')][_0x9bc1('0x6b')]=_0x134913['id'];return db[_0x9bc1('0x48')][_0x9bc1('0x7c')](_0x231736[_0x9bc1('0x68')]);}})['then'](respondWithResult(_0x3f4b97,null))[_0x9bc1('0x1a')](handleError(_0x3f4b97,null));};exports['removeSmtp']=function(_0x3d8e5e,_0x8aee8b){return db['MailAccount'][_0x9bc1('0x6e')]({'where':{'id':_0x3d8e5e['params']['id']}})['then'](handleEntityNotFound(_0x8aee8b,null))[_0x9bc1('0x25')](function(_0x4f7059){if(_0x4f7059){return _0x4f7059['setSmtp'](null);}return null;})[_0x9bc1('0x25')](respondWithStatusCode(_0x8aee8b,null))[_0x9bc1('0x1a')](handleError(_0x8aee8b,null));};exports[_0x9bc1('0x89')]=function(_0x5377fc,_0x547005){return db[_0x9bc1('0x8a')]['find']({'where':{'id':_0x5377fc[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x547005,null))[_0x9bc1('0x25')](function(_0x1c23ec){if(_0x1c23ec){return _0x1c23ec[_0x9bc1('0x89')](_0x5377fc[_0x9bc1('0x68')]['ids'],_['omit'](_0x5377fc[_0x9bc1('0x68')],[_0x9bc1('0x72'),'id'])||{});}})[_0x9bc1('0x25')](respondWithResult(_0x547005,null))['catch'](handleError(_0x547005,null));};exports[_0x9bc1('0x8b')]=function(_0x9c46b8,_0x58aea9){var _0x1c020c={'raw':![],'where':{}};var _0x1982bf={};var _0x272d22={'count':0x0,'rows':[]};return db[_0x9bc1('0x4b')][_0x9bc1('0x6e')]({'where':{'id':_0x9c46b8[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x58aea9,null))[_0x9bc1('0x25')](function(_0x267724){if(_0x267724){_0x1982bf['model']=_[_0x9bc1('0x52')](db['MailInteraction']['rawAttributes']);_0x1982bf['query']=_['keys'](_0x9c46b8['query']);_0x1982bf[_0x9bc1('0x53')]=_['intersection'](_0x1982bf[_0x9bc1('0x4f')],_0x1982bf['query']);_0x1c020c['attributes']=_[_0x9bc1('0x54')](_0x1982bf[_0x9bc1('0x4f')],qs['fields'](_0x9c46b8[_0x9bc1('0x51')][_0x9bc1('0x55')]));_0x1c020c['attributes']=_0x1c020c[_0x9bc1('0x56')]['length']?_0x1c020c[_0x9bc1('0x56')]:_0x1982bf[_0x9bc1('0x4f')];if(!_0x9c46b8['query'][_0x9bc1('0x58')]('nolimit')){_0x1c020c[_0x9bc1('0x21')]=qs[_0x9bc1('0x21')](_0x9c46b8[_0x9bc1('0x51')][_0x9bc1('0x21')]);_0x1c020c['offset']=qs[_0x9bc1('0x1e')](_0x9c46b8[_0x9bc1('0x51')][_0x9bc1('0x1e')]);}_0x1c020c[_0x9bc1('0x70')]=qs[_0x9bc1('0x5a')](_0x9c46b8[_0x9bc1('0x51')]['sort']);_0x1c020c['where']=qs[_0x9bc1('0x53')](_[_0x9bc1('0x5c')](_0x9c46b8[_0x9bc1('0x51')],_0x1982bf[_0x9bc1('0x53')]));_0x1c020c[_0x9bc1('0x5b')][_0x9bc1('0x6b')]=_0x267724['id'];if(_0x9c46b8[_0x9bc1('0x51')][_0x9bc1('0x5d')]){_0x1c020c[_0x9bc1('0x5b')]=_[_0x9bc1('0x5e')](_0x1c020c['where'],{'$or':_['map'](_0x1c020c[_0x9bc1('0x56')],function(_0xc8c7b8){var _0x1f0862={};_0x1f0862[_0xc8c7b8]={'$like':'%'+_0x9c46b8[_0x9bc1('0x51')]['filter']+'%'};return _0x1f0862;})});}_0x1c020c=_[_0x9bc1('0x5e')]({},_0x1c020c,_0x9c46b8['options']);return db[_0x9bc1('0x8a')][_0x9bc1('0x20')]({'where':_0x1c020c['where']})[_0x9bc1('0x25')](function(_0x227f27){_0x272d22['count']=_0x227f27;if(_0x9c46b8[_0x9bc1('0x51')][_0x9bc1('0x60')]){_0x1c020c[_0x9bc1('0x61')]=[{'model':db['CmContact'],'as':_0x9bc1('0x8c'),'required':![]},{'model':db[_0x9bc1('0x8d')],'as':'Owner','attributes':['name',_0x9bc1('0x8e'),_0x9bc1('0x8f')],'required':![]},{'model':db[_0x9bc1('0x90')],'as':_0x9bc1('0x91'),'attributes':['id',_0x9bc1('0x2b'),_0x9bc1('0x92')],'where':_0x9c46b8['query'][_0x9bc1('0x93')]?{'id':_0x9c46b8['query'][_0x9bc1('0x93')]}:undefined,'required':_0x9c46b8[_0x9bc1('0x51')]['tag']?!![]:![]}];}return db[_0x9bc1('0x8a')][_0x9bc1('0x62')](_0x1c020c);})[_0x9bc1('0x25')](function(_0x47b653){_0x272d22['rows']=_0x47b653;return _0x272d22;});}})[_0x9bc1('0x25')](respondWithFilteredResult(_0x58aea9,_0x1c020c))[_0x9bc1('0x1a')](handleError(_0x58aea9,null));};exports[_0x9bc1('0x94')]=function addApplications(_0x1f743e,_0x4f6d0c){var _0x196f70=_0x1f743e[_0x9bc1('0x65')]['id'];var _0x29e0e6=_0x1f743e['body'];var _0x537c5b=0xc8;var _0x1d8195=null;return db[_0x9bc1('0x95')][_0x9bc1('0x96')]({'isolationLevel':db[_0x9bc1('0x95')][_0x9bc1('0x97')][_0x9bc1('0x98')]['READ_COMMITTED']},function(_0x394c4e){return db[_0x9bc1('0x4b')]['findOne']({'where':{'id':_0x196f70},'transaction':_0x394c4e})[_0x9bc1('0x25')](function(_0x1ba01c){if(_0x1ba01c){return db[_0x9bc1('0x99')][_0x9bc1('0x26')]({'where':{'MailAccountId':_0x196f70},'transaction':_0x394c4e})['then'](function(){var _0x22b166=_[_0x9bc1('0x50')](_0x29e0e6,function(_0x576935){_0x576935['MailAccountId']=_0x196f70;return _0x576935;});return db[_0x9bc1('0x99')][_0x9bc1('0x9a')](_0x22b166,{'transaction':_0x394c4e});});}else{_0x537c5b=0x194;_0x1d8195=[];}});})['then'](function(){if(_0x537c5b!==0x194){return db[_0x9bc1('0x99')][_0x9bc1('0x9b')]({'where':{'MailAccountId':_0x196f70},'order':'priority'})[_0x9bc1('0x25')](function(_0x40d7de){_0x1d8195=_0x40d7de;});}})[_0x9bc1('0x1a')](function(_0x31abe2){_0x537c5b=0x1f4;logger[_0x9bc1('0x17')](_0x31abe2[_0x9bc1('0x2a')]);if(_0x31abe2['name']){delete _0x31abe2['name'];}_0x1d8195=_0x31abe2;})[_0x9bc1('0x9c')](function(){if(_0x1d8195===null){_0x4f6d0c[_0x9bc1('0x1b')](_0x537c5b);}else{if(_0x537c5b===0x1f4){_0x4f6d0c['status'](_0x537c5b)[_0x9bc1('0x2c')](_0x1d8195);}else{_0x4f6d0c[_0x9bc1('0x1c')](_0x537c5b)[_0x9bc1('0x1d')](_0x1d8195);}}});};exports[_0x9bc1('0x9d')]=function(_0x4cbcc5,_0x39b4da){var _0x5546e1={};var _0x1ccbb3={};var _0x124cdb;var _0x178517;return db[_0x9bc1('0x4b')]['findOne']({'where':{'id':_0x4cbcc5[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x39b4da,null))[_0x9bc1('0x25')](function(_0x57bae9){if(_0x57bae9){_0x124cdb=_0x57bae9;_0x1ccbb3['model']=_[_0x9bc1('0x52')](db[_0x9bc1('0x99')]['rawAttributes']);_0x1ccbb3[_0x9bc1('0x51')]=_[_0x9bc1('0x52')](_0x4cbcc5[_0x9bc1('0x51')]);_0x1ccbb3[_0x9bc1('0x53')]=_[_0x9bc1('0x54')](_0x1ccbb3[_0x9bc1('0x4f')],_0x1ccbb3['query']);_0x5546e1[_0x9bc1('0x56')]=_[_0x9bc1('0x54')](_0x1ccbb3[_0x9bc1('0x4f')],qs[_0x9bc1('0x55')](_0x4cbcc5[_0x9bc1('0x51')][_0x9bc1('0x55')]));_0x5546e1[_0x9bc1('0x56')]=_0x5546e1[_0x9bc1('0x56')][_0x9bc1('0x57')]?_0x5546e1[_0x9bc1('0x56')]:_0x1ccbb3[_0x9bc1('0x4f')];_0x5546e1[_0x9bc1('0x70')]=qs['sort'](_0x4cbcc5['query'][_0x9bc1('0x5a')]);_0x5546e1[_0x9bc1('0x5b')]=qs['filters'](_['pick'](_0x4cbcc5[_0x9bc1('0x51')],_0x1ccbb3[_0x9bc1('0x53')]));if(_0x4cbcc5[_0x9bc1('0x51')][_0x9bc1('0x5d')]){_0x5546e1[_0x9bc1('0x5b')]=_['merge'](_0x5546e1[_0x9bc1('0x5b')],{'$or':_[_0x9bc1('0x50')](_0x5546e1[_0x9bc1('0x56')],function(_0x25488b){var _0x5e21e3={};_0x5e21e3[_0x25488b]={'$like':'%'+_0x4cbcc5[_0x9bc1('0x51')][_0x9bc1('0x5d')]+'%'};return _0x5e21e3;})});}_0x5546e1=_[_0x9bc1('0x5e')]({},_0x5546e1,_0x4cbcc5[_0x9bc1('0x66')]);return _0x124cdb[_0x9bc1('0x9d')](_0x5546e1);}})[_0x9bc1('0x25')](function(_0x140d41){if(_0x140d41){_0x178517=_0x140d41[_0x9bc1('0x57')];if(!_0x4cbcc5['query'][_0x9bc1('0x58')]('nolimit')){_0x5546e1[_0x9bc1('0x21')]=qs[_0x9bc1('0x21')](_0x4cbcc5[_0x9bc1('0x51')][_0x9bc1('0x21')]);_0x5546e1[_0x9bc1('0x1e')]=qs[_0x9bc1('0x1e')](_0x4cbcc5[_0x9bc1('0x51')]['offset']);}return _0x124cdb['getApplications'](_0x5546e1);}})[_0x9bc1('0x25')](function(_0x21d974){if(_0x21d974){return _0x21d974?{'count':_0x178517,'rows':_0x21d974}:null;}})[_0x9bc1('0x25')](respondWithResult(_0x39b4da,null))[_0x9bc1('0x1a')](handleError(_0x39b4da,null));};exports[_0x9bc1('0x9e')]=function(_0x17ca2a,_0x3ee09d){var _0x3c3995={'raw':!![],'where':{}};var _0x4bc196={};var _0x184022={'count':0x0,'rows':[]};return db[_0x9bc1('0x4b')][_0x9bc1('0x6e')]({'where':{'id':_0x17ca2a['params']['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x3ee09d,null))[_0x9bc1('0x25')](function(_0x2e278f){if(_0x2e278f){_0x4bc196['model']=_['keys'](db[_0x9bc1('0x9f')][_0x9bc1('0x6f')]);_0x4bc196[_0x9bc1('0x51')]=_['keys'](_0x17ca2a[_0x9bc1('0x51')]);_0x4bc196[_0x9bc1('0x53')]=_['intersection'](_0x4bc196[_0x9bc1('0x4f')],_0x4bc196[_0x9bc1('0x51')]);_0x3c3995['attributes']=_[_0x9bc1('0x54')](_0x4bc196[_0x9bc1('0x4f')],qs[_0x9bc1('0x55')](_0x17ca2a['query'][_0x9bc1('0x55')]));_0x3c3995[_0x9bc1('0x56')]=_0x3c3995[_0x9bc1('0x56')][_0x9bc1('0x57')]?_0x3c3995['attributes']:_0x4bc196[_0x9bc1('0x4f')];if(!_0x17ca2a[_0x9bc1('0x51')]['hasOwnProperty'](_0x9bc1('0x59'))){_0x3c3995[_0x9bc1('0x21')]=qs[_0x9bc1('0x21')](_0x17ca2a[_0x9bc1('0x51')][_0x9bc1('0x21')]);_0x3c3995[_0x9bc1('0x1e')]=qs[_0x9bc1('0x1e')](_0x17ca2a['query'][_0x9bc1('0x1e')]);}_0x3c3995[_0x9bc1('0x70')]=qs[_0x9bc1('0x5a')](_0x17ca2a[_0x9bc1('0x51')]['sort']);_0x3c3995[_0x9bc1('0x5b')]=qs[_0x9bc1('0x53')](_[_0x9bc1('0x5c')](_0x17ca2a['query'],_0x4bc196[_0x9bc1('0x53')]));_0x3c3995[_0x9bc1('0x5b')][_0x9bc1('0x6b')]=_0x2e278f['id'];if(_0x17ca2a['query']['filter']){_0x3c3995[_0x9bc1('0x5b')]=_['merge'](_0x3c3995['where'],{'$or':_['map'](_0x3c3995['attributes'],function(_0xe96acb){var _0x47f897={};_0x47f897[_0xe96acb]={'$like':'%'+_0x17ca2a['query'][_0x9bc1('0x5d')]+'%'};return _0x47f897;})});}if(_0x17ca2a[_0x9bc1('0x51')]['$gte']){var _0x344e9b=_0x17ca2a[_0x9bc1('0x51')][_0x9bc1('0xa0')][_0x9bc1('0xa1')](',');var _0x3cf5b6={};_0x3cf5b6[_0x344e9b[0x0]]={'$gte':moment(_0x344e9b[0x1])[_0x9bc1('0xa2')](_0x9bc1('0xa3'))};_0x3c3995[_0x9bc1('0x5b')]=_[_0x9bc1('0x5e')](_0x3c3995[_0x9bc1('0x5b')],_0x3cf5b6);}_0x3c3995=_[_0x9bc1('0x5e')]({},_0x3c3995,_0x17ca2a[_0x9bc1('0x66')]);return db[_0x9bc1('0x9f')][_0x9bc1('0x20')]({'where':_0x3c3995[_0x9bc1('0x5b')]})[_0x9bc1('0x25')](function(_0x2b14ad){_0x184022['count']=_0x2b14ad;if(_0x17ca2a[_0x9bc1('0x51')]['includeAll']){_0x3c3995[_0x9bc1('0x61')]=[{'all':!![]}];}return db[_0x9bc1('0x9f')][_0x9bc1('0x62')](_0x3c3995);})['then'](function(_0x4c0354){if(_0x17ca2a[_0x9bc1('0x51')]['inlineCss']===_0x9bc1('0xa4')){for(var _0x2263d0=0x0;_0x2263d0<_0x4c0354['length'];_0x2263d0++){_0x4c0354[_0x2263d0][_0x9bc1('0x68')]=juice(_0x4c0354[_0x2263d0][_0x9bc1('0x68')]);}}_0x184022[_0x9bc1('0x63')]=_0x4c0354;return _0x184022;});}})['then'](respondWithFilteredResult(_0x3ee09d,_0x3c3995))[_0x9bc1('0x1a')](handleError(_0x3ee09d,null));};exports['send']=function(_0x2275ae,_0x10b152){var _0x5187ce,_0x41db49={},_0x5cb708;if(_0x2275ae[_0x9bc1('0x68')]['to']){_0x5cb708=_0x2275ae['body']['to']['split'](',')[0x0];}return db[_0x9bc1('0x4b')]['find']({'where':{'id':_0x2275ae[_0x9bc1('0x65')]['id']},'include':[{'model':db[_0x9bc1('0xa5')],'as':_0x9bc1('0xa6'),'include':[{'model':db[_0x9bc1('0xa7')],'as':_0x9bc1('0xa8'),'where':{'email':_0x5cb708},'limit':0x1,'order':[['updatedAt',_0x9bc1('0xa9')]]}]},{'model':db[_0x9bc1('0x48')],'as':_0x9bc1('0x45'),'raw':!![],'include':[{'model':db[_0x9bc1('0xaa')],'as':_0x9bc1('0xaa'),'raw':!![]}]}]})[_0x9bc1('0x25')](handleEntityNotFound(_0x10b152,null))[_0x9bc1('0x25')](function(_0x112317){if(!_0x112317)return;_0x5187ce=_0x112317;if(!_0x112317['Smtp'])throw new Error(_0x9bc1('0xab'));if(_[_0x9bc1('0x79')](_0x2275ae[_0x9bc1('0x68')][_0x9bc1('0xac')])){_0x2275ae['body'][_0x9bc1('0xac')]=util[_0x9bc1('0xa2')]('%s\x20<%s>',_0x112317[_0x9bc1('0x2b')],_0x112317[_0x9bc1('0x78')]||_0x112317[_0x9bc1('0x45')][_0x9bc1('0x39')]);}if(_0x2275ae[_0x9bc1('0x68')][_0x9bc1('0xad')]&&_0x2275ae['body'][_0x9bc1('0xad')]['length']){for(var _0x382a29=0x0;_0x382a29<_0x2275ae[_0x9bc1('0x68')][_0x9bc1('0xad')][_0x9bc1('0x57')];_0x382a29+=0x1){_0x2275ae['body'][_0x9bc1('0xad')][_0x382a29]={'filename':_0x2275ae[_0x9bc1('0x68')]['attachments'][_0x382a29][_0x9bc1('0x2b')],'path':path[_0x9bc1('0xae')](config[_0x9bc1('0xaf')],_0x9bc1('0xb0'),_0x2275ae['body']['attachments'][_0x382a29][_0x9bc1('0xb1')])};}}var _0x502df2=_0x112317[_0x9bc1('0xb2')]();return respondWithRpcPromise(_0x9bc1('0xb3'),'sendMail',{'account':_0x502df2,'message':_0x2275ae[_0x9bc1('0x68')]});})[_0x9bc1('0x25')](function(_0x3e115e){if(!_0x3e115e)return;_0x41db49=_0x3e115e;if(!_0x5187ce[_0x9bc1('0xa6')])throw new Error(_0x9bc1('0xb4'));if(_0x5187ce[_0x9bc1('0xa6')][_0x9bc1('0xa8')][_0x9bc1('0x57')])return _0x5187ce[_0x9bc1('0xa6')][_0x9bc1('0xa8')][0x0];return db[_0x9bc1('0xa7')][_0x9bc1('0x7c')](_[_0x9bc1('0xb')](_0x2275ae[_0x9bc1('0x68')],{'firstName':_0x2275ae[_0x9bc1('0x68')]['to'],'email':_0x2275ae[_0x9bc1('0x68')]['to'],'phone':_0x2275ae['body']['to'],'ListId':_0x5187ce[_0x9bc1('0xb5')]}));})[_0x9bc1('0x25')](function(_0x47e472){if(!_0x47e472)return;var _0x35af67={'UserId':_0x2275ae[_0x9bc1('0x39')]['id'],'ContactId':_0x47e472['id'],'MailAccountId':_0x5187ce['id'],'inReplyTo':_0x41db49[_0x9bc1('0xb6')],'to':_0x2275ae[_0x9bc1('0x68')][_0x9bc1('0xac')],'cc':_0x2275ae[_0x9bc1('0x68')]['cc'],'subject':_0x2275ae['body'][_0x9bc1('0xb7')],'attach':_0x2275ae['body'][_0x9bc1('0xb8')],'firstMsgDirection':_0x9bc1('0xb9'),'lastMsgAt':moment()[_0x9bc1('0xa2')](_0x9bc1('0xa3')),'lastMsgDirection':_0x9bc1('0xb9'),'Messages':[_[_0x9bc1('0x5e')](_0x2275ae[_0x9bc1('0x68')],{'messageId':_0x41db49[_0x9bc1('0xb6')],'sentAt':moment()[_0x9bc1('0xa2')](_0x9bc1('0xa3')),'read':!![],'MailAccountId':_0x5187ce['id'],'UserId':_0x2275ae[_0x9bc1('0x39')]['id'],'ContactId':_0x47e472['id']})]};if(_0x2275ae['body'][_0x9bc1('0xba')]){_0x35af67=_[_0x9bc1('0x5e')](_0x35af67,_0x2275ae[_0x9bc1('0x68')][_0x9bc1('0xba')]);}return db[_0x9bc1('0x8a')][_0x9bc1('0x7c')](_0x35af67,{'include':[{'model':db[_0x9bc1('0x9f')],'as':_0x9bc1('0xbb')}]});})['then'](respondWithResult(_0x10b152,null))[_0x9bc1('0x1a')](handleError(_0x10b152,null));};exports[_0x9bc1('0xbc')]=function(_0x1cef0e,_0x45598e){return db[_0x9bc1('0x4b')][_0x9bc1('0x67')]({'where':{'id':_0x1cef0e[_0x9bc1('0x65')]['id']},'include':[{'model':db[_0x9bc1('0x48')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9bc1('0xaa'),'raw':!![]}]}]})[_0x9bc1('0x25')](handleEntityNotFound(_0x45598e,null))['then'](function(_0x1089c2){if(!_0x1089c2[_0x9bc1('0x45')])return;var _0x95695f=_0x1089c2[_0x9bc1('0xb2')]();return respondWithRpcPromise(_0x9bc1('0xbd'),_0x9bc1('0xbc'),{'account':_0x95695f});})[_0x9bc1('0x25')](respondWithResult(_0x45598e,null))[_0x9bc1('0x1a')](handleError(_0x45598e,null));};exports[_0x9bc1('0x26')]=function(_0x2d9fb5,_0xa3bc51){return db['MailAccount']['find']({'where':{'id':_0x2d9fb5[_0x9bc1('0x65')]['id']}})['then'](handleEntityNotFound(_0xa3bc51,null))[_0x9bc1('0x25')](function(_0x22f479){if(_0x22f479&&_0x22f479[_0x9bc1('0x42')]){throw new db[(_0x9bc1('0xbe'))][(_0x9bc1('0xbf'))](_0x9bc1('0xc0'));}return _0x22f479;})[_0x9bc1('0x25')](removeEntity(_0xa3bc51,null))[_0x9bc1('0x1a')](handleError(_0xa3bc51,null));};exports[_0x9bc1('0xc1')]=function(_0x15ad7b,_0x4be0a2){return db[_0x9bc1('0x4b')][_0x9bc1('0x67')]({'where':{'id':_0x15ad7b[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x4be0a2,null))[_0x9bc1('0x25')](function(_0x41d6ee){if(_0x41d6ee){return _0x41d6ee[_0x9bc1('0xc1')](_0x15ad7b['body']['ids'],_[_0x9bc1('0xc2')](_0x15ad7b['body'],['ids','id'])||{})[_0x9bc1('0xc3')](function(_0x49757e){for(var _0x1873f4=0x0;_0x1873f4<_0x15ad7b['body'][_0x9bc1('0x72')][_0x9bc1('0x57')];_0x1873f4+=0x1){socket['emit'](_0x9bc1('0xc4'),{'UserId':Number(_0x15ad7b['body'][_0x9bc1('0x72')][_0x1873f4]),'MailAccountId':Number(_0x15ad7b[_0x9bc1('0x65')]['id'])});}return _0x49757e;});}})[_0x9bc1('0x25')](respondWithResult(_0x4be0a2,null))[_0x9bc1('0x1a')](handleError(_0x4be0a2,null));};exports[_0x9bc1('0xc5')]=function(_0x563973,_0x3e206e){return db[_0x9bc1('0x4b')]['find']({'where':{'id':_0x563973['params']['id']}})['then'](handleEntityNotFound(_0x3e206e,null))[_0x9bc1('0x25')](function(_0xcc4daa){if(_0xcc4daa){return _0xcc4daa[_0x9bc1('0xc5')](_0x563973[_0x9bc1('0x51')][_0x9bc1('0x72')])['then'](function(){if(_['isArray'](_0x563973[_0x9bc1('0x51')]['ids'])){for(var _0x1c722b=0x0;_0x1c722b<_0x563973['query'][_0x9bc1('0x72')][_0x9bc1('0x57')];_0x1c722b+=0x1){socket[_0x9bc1('0xc6')]('userMailAccount:remove',{'UserId':Number(_0x563973['query']['ids'][_0x1c722b]),'MailAccountId':Number(_0x563973['params']['id'])});}}else{socket[_0x9bc1('0xc6')]('userMailAccount:remove',{'UserId':Number(_0x563973[_0x9bc1('0x51')][_0x9bc1('0x72')]),'MailAccountId':Number(_0x563973[_0x9bc1('0x65')]['id'])});}});}})['then'](respondWithStatusCode(_0x3e206e,null))['catch'](handleError(_0x3e206e,null));};exports[_0x9bc1('0xc7')]=function(_0x22dab8,_0x2e57d3){var _0x8f2a10={};var _0x18d072={};var _0x2489a3;var _0x1c3628;return db['MailAccount'][_0x9bc1('0x6e')]({'where':{'id':_0x22dab8[_0x9bc1('0x65')]['id']}})[_0x9bc1('0x25')](handleEntityNotFound(_0x2e57d3,null))[_0x9bc1('0x25')](function(_0x309881){if(_0x309881){_0x2489a3=_0x309881;_0x18d072[_0x9bc1('0x4f')]=_[_0x9bc1('0x52')](db[_0x9bc1('0x8d')][_0x9bc1('0x6f')]);_0x18d072[_0x9bc1('0x51')]=_[_0x9bc1('0x52')](_0x22dab8[_0x9bc1('0x51')]);_0x18d072[_0x9bc1('0x53')]=_[_0x9bc1('0x54')](_0x18d072[_0x9bc1('0x4f')],_0x18d072[_0x9bc1('0x51')]);_0x8f2a10[_0x9bc1('0x56')]=_[_0x9bc1('0x54')](_0x18d072[_0x9bc1('0x4f')],qs['fields'](_0x22dab8['query'][_0x9bc1('0x55')]));_0x8f2a10[_0x9bc1('0x56')]=_0x8f2a10[_0x9bc1('0x56')][_0x9bc1('0x57')]?_0x8f2a10[_0x9bc1('0x56')]:_0x18d072['model'];_0x8f2a10[_0x9bc1('0x70')]=qs[_0x9bc1('0x5a')](_0x22dab8[_0x9bc1('0x51')][_0x9bc1('0x5a')]);_0x8f2a10[_0x9bc1('0x5b')]=qs[_0x9bc1('0x53')](_[_0x9bc1('0x5c')](_0x22dab8[_0x9bc1('0x51')],_0x18d072[_0x9bc1('0x53')]));if(_0x22dab8[_0x9bc1('0x51')][_0x9bc1('0x5d')]){_0x8f2a10[_0x9bc1('0x5b')]=_[_0x9bc1('0x5e')](_0x8f2a10[_0x9bc1('0x5b')],{'$or':_[_0x9bc1('0x50')](_0x8f2a10[_0x9bc1('0x56')],function(_0x51922d){var _0x411398={};_0x411398[_0x51922d]={'$like':'%'+_0x22dab8[_0x9bc1('0x51')][_0x9bc1('0x5d')]+'%'};return _0x411398;})});}_0x8f2a10=_[_0x9bc1('0x5e')]({},_0x8f2a10,_0x22dab8[_0x9bc1('0x66')]);return _0x2489a3[_0x9bc1('0xc7')](_0x8f2a10);}})[_0x9bc1('0x25')](function(_0x497d6e){if(_0x497d6e){_0x1c3628=_0x497d6e[_0x9bc1('0x57')];if(!_0x22dab8[_0x9bc1('0x51')][_0x9bc1('0x58')](_0x9bc1('0x59'))){_0x8f2a10[_0x9bc1('0x21')]=qs[_0x9bc1('0x21')](_0x22dab8[_0x9bc1('0x51')][_0x9bc1('0x21')]);_0x8f2a10[_0x9bc1('0x1e')]=qs[_0x9bc1('0x1e')](_0x22dab8[_0x9bc1('0x51')][_0x9bc1('0x1e')]);}return _0x2489a3[_0x9bc1('0xc7')](_0x8f2a10);}})['then'](function(_0xfa97aa){if(_0xfa97aa){return _0xfa97aa?{'count':_0x1c3628,'rows':_0xfa97aa}:null;}})['then'](respondWithResult(_0x2e57d3,null))[_0x9bc1('0x1a')](handleError(_0x2e57d3,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index f9465f8..dd090c6 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 _0x4351=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailAccount'];(function(_0x5e6943,_0x19fe3b){var _0x435333=function(_0x284cc4){while(--_0x284cc4){_0x5e6943['push'](_0x5e6943['shift']());}};_0x435333(++_0x19fe3b);}(_0x4351,0x1b5));var _0x1435=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4351[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x1435('0x0'));var MailAccount=require(_0x1435('0x1'))['db'][_0x1435('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1435('0x3')](0x0);var events={'afterCreate':_0x1435('0x4'),'afterUpdate':_0x1435('0x5'),'afterDestroy':_0x1435('0x6')};function emitEvent(_0x1b5f1e){return function(_0x2fc1f2,_0x2fa227,_0x111bc6){MailAccountEvents[_0x1435('0x7')](_0x1b5f1e+':'+_0x2fc1f2['id'],_0x2fc1f2);MailAccountEvents[_0x1435('0x7')](_0x1b5f1e,_0x2fc1f2);_0x111bc6(null);};}for(var e in events){if(events[_0x1435('0x8')](e)){var event=events[e];MailAccount[_0x1435('0x9')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xd3ef=['events','MailAccount','setMaxListeners','save','remove','hook','exports'];(function(_0x47d6de,_0x474eea){var _0x3e4547=function(_0x20c664){while(--_0x20c664){_0x47d6de['push'](_0x47d6de['shift']());}};_0x3e4547(++_0x474eea);}(_0xd3ef,0x69));var _0xfd3e=function(_0x5c6d58,_0x522652){_0x5c6d58=_0x5c6d58-0x0;var _0xf91e8c=_0xd3ef[_0x5c6d58];return _0xf91e8c;};'use strict';var EventEmitter=require(_0xfd3e('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xfd3e('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xfd3e('0x2')](0x0);var events={'afterCreate':_0xfd3e('0x3'),'afterUpdate':'update','afterDestroy':_0xfd3e('0x4')};function emitEvent(_0x5228a7){return function(_0x14c771,_0x495139,_0x45a715){MailAccountEvents['emit'](_0x5228a7+':'+_0x14c771['id'],_0x14c771);MailAccountEvents['emit'](_0x5228a7,_0x14c771);_0x45a715(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xfd3e('0x5')](e,emitEvent(event));}}module[_0xfd3e('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 630fb07..e8cc103 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 _0x0e0d=['user','data5','pass','exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x0e0d,0x120));var _0xd0e0=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0e0d[_0x53ccf2];return _0x5a2964;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xd0e0('0x0')]=function(_0x223208){return _0x223208[_0xd0e0('0x1')](_0xd0e0('0x2'),attributes,{'tableName':_0xd0e0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1d791b=this;var _0x3d0dde={'id':_0x1d791b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1d791b[_0xd0e0('0x4')]!==_0xd0e0('0x5')){_0x3d0dde[_0xd0e0('0x6')]=_0x1d791b[_0xd0e0('0x4')];}else{_0x3d0dde[_0xd0e0('0x7')]=_0x1d791b[_0xd0e0('0x8')]['host'];_0x3d0dde[_0xd0e0('0x9')]=_0x1d791b[_0xd0e0('0x8')]['port'];_0x3d0dde[_0xd0e0('0xa')]=_0x1d791b[_0xd0e0('0x8')][_0xd0e0('0xa')];}if(_0x1d791b[_0xd0e0('0x8')][_0xd0e0('0xb')]){if(_0x1d791b[_0xd0e0('0x8')]['modernAuthentication']){if(!_0x1d791b[_0xd0e0('0x8')][_0xd0e0('0xc')])throw new Error(_0xd0e0('0xd'));_0x3d0dde[_0xd0e0('0xe')]={'type':_0xd0e0('0xf'),'user':_0x1d791b[_0xd0e0('0x8')][_0xd0e0('0x10')],'accessToken':_0x1d791b[_0xd0e0('0x8')][_0xd0e0('0xc')][_0xd0e0('0x11')]};}else{_0x3d0dde[_0xd0e0('0xe')]={'user':_0x1d791b[_0xd0e0('0x8')][_0xd0e0('0x10')],'pass':_0x1d791b[_0xd0e0('0x8')][_0xd0e0('0x12')]};}}return _0x3d0dde;}}});}; \ No newline at end of file +var _0x2c7c=['auth','OAuth2','user','pass','./mailAccount.attributes','exports','define','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','CloudProvider'];(function(_0x35cf09,_0x116a7f){var _0x4e5c43=function(_0x545ce6){while(--_0x545ce6){_0x35cf09['push'](_0x35cf09['shift']());}};_0x4e5c43(++_0x116a7f);}(_0x2c7c,0x1ad));var _0xc2c7=function(_0x2cc62b,_0x202d4c){_0x2cc62b=_0x2cc62b-0x0;var _0x2a64bf=_0x2c7c[_0x2cc62b];return _0x2a64bf;};'use strict';var attributes=require(_0xc2c7('0x0'));module[_0xc2c7('0x1')]=function(_0x3a30da){return _0x3a30da[_0xc2c7('0x2')]('MailAccount',attributes,{'tableName':_0xc2c7('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xc4da15=this;var _0xac2958={'id':_0xc4da15['id'],'tls':{'rejectUnauthorized':![]}};if(_0xc4da15[_0xc2c7('0x4')]!==_0xc2c7('0x5')){_0xac2958[_0xc2c7('0x6')]=_0xc4da15['provider'];}else{_0xac2958[_0xc2c7('0x7')]=_0xc4da15[_0xc2c7('0x8')][_0xc2c7('0x7')];_0xac2958[_0xc2c7('0x9')]=_0xc4da15['Smtp'][_0xc2c7('0x9')];_0xac2958[_0xc2c7('0xa')]=_0xc4da15[_0xc2c7('0x8')][_0xc2c7('0xa')];}if(_0xc4da15['Smtp'][_0xc2c7('0xb')]){if(_0xc4da15['Smtp']['modernAuthentication']){if(!_0xc4da15['Smtp'][_0xc2c7('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0xac2958[_0xc2c7('0xd')]={'type':_0xc2c7('0xe'),'user':_0xc4da15[_0xc2c7('0x8')][_0xc2c7('0xf')],'accessToken':_0xc4da15[_0xc2c7('0x8')]['CloudProvider']['data5']};}else{_0xac2958['auth']={'user':_0xc4da15[_0xc2c7('0x8')][_0xc2c7('0xf')],'pass':_0xc4da15[_0xc2c7('0x8')][_0xc2c7('0x10')]};}}return _0xac2958;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index ba24d65..ae1ef4c 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 _0x6ec2=['ChatOfflineMessageId','Attachments','UserId','name','agent','waitForTheAssignedAgent','queueId','MailQueue','unshift','waitForTheAssignedQueue','Start','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','find','setDataValue','smtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','DESC','MailApplication','Applications','List','omit','list','orderBy','priority','asc','autoclose','applications','length','*,*,*,*','Contacts','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email'];(function(_0x47f7c1,_0x3f5dd2){var _0xdfa709=function(_0x3f556d){while(--_0x3f556d){_0x47f7c1['push'](_0x47f7c1['shift']());}};_0xdfa709(++_0x3f5dd2);}(_0x6ec2,0x78));var _0x26ec=function(_0x1e60f7,_0x554c4d){_0x1e60f7=_0x1e60f7-0x0;var _0x1d2b9c=_0x6ec2[_0x1e60f7];return _0x1d2b9c;};'use strict';var _=require(_0x26ec('0x0'));var moment=require(_0x26ec('0x1'));var BPromise=require(_0x26ec('0x2'));var rs=require(_0x26ec('0x3'));var Redis=require(_0x26ec('0x4'));var db=require(_0x26ec('0x5'))['db'];var logger=require('../../config/logger')(_0x26ec('0x6'));var config=require(_0x26ec('0x7'));var jayson=require(_0x26ec('0x8'));var client=jayson[_0x26ec('0x9')][_0x26ec('0xa')]({'port':0x232c});config['redis']=_[_0x26ec('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x26ec('0xc'))(new Redis(config[_0x26ec('0xd')]));require(_0x26ec('0xe'))['register'](socket);function respondWithRpcPromise(_0x1d1df3,_0x5ae60e,_0x143d9f){return new BPromise(function(_0x23b140,_0x26f0a6){return client[_0x26ec('0xf')](_0x1d1df3,_0x143d9f)[_0x26ec('0x10')](function(_0x1b24e2){logger[_0x26ec('0x11')](_0x26ec('0x12'),_0x5ae60e,_0x26ec('0x13'));logger[_0x26ec('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5ae60e,'request\x20sent',JSON[_0x26ec('0x15')](_0x1b24e2));if(_0x1b24e2[_0x26ec('0x16')]){if(_0x1b24e2[_0x26ec('0x16')][_0x26ec('0x17')]===0x1f4){logger[_0x26ec('0x16')](_0x26ec('0x12'),_0x5ae60e,_0x1b24e2[_0x26ec('0x16')]['message']);return _0x26f0a6(_0x1b24e2[_0x26ec('0x16')][_0x26ec('0x18')]);}logger[_0x26ec('0x16')](_0x26ec('0x12'),_0x5ae60e,_0x1b24e2['error']['message']);return _0x23b140(_0x1b24e2[_0x26ec('0x16')][_0x26ec('0x18')]);}else{logger[_0x26ec('0x11')](_0x26ec('0x12'),_0x5ae60e,'request\x20sent');_0x23b140(_0x1b24e2[_0x26ec('0x19')][_0x26ec('0x18')]);}})['catch'](function(_0x5ef1e5){logger['error'](_0x26ec('0x12'),_0x5ae60e,_0x5ef1e5);_0x26f0a6(_0x5ef1e5);});});}exports[_0x26ec('0x1a')]=function(_0x60511e){var _0x4f6eb5=this;return new Promise(function(_0x4ad50c,_0x289978){return db[_0x26ec('0x1b')][_0x26ec('0x1c')]({'raw':_0x60511e[_0x26ec('0x1d')]?_0x60511e[_0x26ec('0x1d')][_0x26ec('0x1e')]===undefined?!![]:![]:!![],'where':_0x60511e['options']?_0x60511e[_0x26ec('0x1d')][_0x26ec('0x1f')]||null:null,'attributes':_0x60511e[_0x26ec('0x1d')]?_0x60511e[_0x26ec('0x1d')][_0x26ec('0x20')]||null:null,'limit':_0x60511e['options']?_0x60511e['options'][_0x26ec('0x21')]||null:null,'include':_0x60511e[_0x26ec('0x1d')]?_0x60511e[_0x26ec('0x1d')]['include']?_['map'](_0x60511e[_0x26ec('0x1d')][_0x26ec('0x22')],function(_0x16aba4){return{'model':db[_0x16aba4[_0x26ec('0x23')]],'as':_0x16aba4['as'],'attributes':_0x16aba4[_0x26ec('0x20')],'include':_0x16aba4[_0x26ec('0x22')]?_[_0x26ec('0x24')](_0x16aba4['include'],function(_0x50fedc){return{'model':db[_0x50fedc['model']],'as':_0x50fedc['as'],'attributes':_0x50fedc[_0x26ec('0x20')],'include':_0x50fedc[_0x26ec('0x22')]?_[_0x26ec('0x24')](_0x50fedc[_0x26ec('0x22')],function(_0x19e0fc){return{'model':db[_0x19e0fc[_0x26ec('0x23')]],'as':_0x19e0fc['as'],'attributes':_0x19e0fc[_0x26ec('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30231e){logger['info'](_0x26ec('0x1a'),_0x60511e);logger[_0x26ec('0x14')]('GetMailAccount',_0x60511e,JSON[_0x26ec('0x15')](_0x30231e));_0x4ad50c(_0x30231e);})[_0x26ec('0x25')](function(_0x139d24){logger[_0x26ec('0x16')](_0x26ec('0x1a'),_0x139d24[_0x26ec('0x18')],_0x60511e);_0x289978(_0x4f6eb5['error'](0x1f4,_0x139d24[_0x26ec('0x18')]));});});};exports['ShowMailAccount']=function(_0x3d8b89){var _0x5e9989=this;return new Promise(function(_0x43caa5,_0x3ce472){return db['MailAccount'][_0x26ec('0x26')]({'raw':_0x3d8b89[_0x26ec('0x1d')]?_0x3d8b89[_0x26ec('0x1d')][_0x26ec('0x1e')]===undefined?!![]:![]:!![],'where':_0x3d8b89[_0x26ec('0x1d')]?_0x3d8b89[_0x26ec('0x1d')]['where']||null:null,'attributes':_0x3d8b89['options']?_0x3d8b89['options']['attributes']||null:null,'include':_0x3d8b89['options']?_0x3d8b89[_0x26ec('0x1d')][_0x26ec('0x22')]?_[_0x26ec('0x24')](_0x3d8b89[_0x26ec('0x1d')][_0x26ec('0x22')],function(_0x4fec35){return{'model':db[_0x4fec35[_0x26ec('0x23')]],'as':_0x4fec35['as'],'attributes':_0x4fec35[_0x26ec('0x20')],'include':_0x4fec35[_0x26ec('0x22')]?_[_0x26ec('0x24')](_0x4fec35[_0x26ec('0x22')],function(_0x4e3250){return{'model':db[_0x4e3250[_0x26ec('0x23')]],'as':_0x4e3250['as'],'attributes':_0x4e3250[_0x26ec('0x20')],'include':_0x4e3250[_0x26ec('0x22')]?_[_0x26ec('0x24')](_0x4e3250[_0x26ec('0x22')],function(_0x171118){return{'model':db[_0x171118[_0x26ec('0x23')]],'as':_0x171118['as'],'attributes':_0x171118[_0x26ec('0x20')]};}):[]};}):[]};}):[]:[]})[_0x26ec('0x10')](function(_0x16c0ee){if(_0x3d8b89['options']['smtp']===!![])_0x16c0ee[_0x26ec('0x27')](_0x26ec('0x28'),_0x16c0ee['getSmtpOptions']());logger[_0x26ec('0x11')]('ShowMailAccount',_0x3d8b89);logger[_0x26ec('0x14')](_0x26ec('0x29'),_0x3d8b89,JSON[_0x26ec('0x15')](_0x16c0ee));_0x43caa5(_0x16c0ee);})[_0x26ec('0x25')](function(_0x2a0c92){logger[_0x26ec('0x16')]('ShowMailAccount',_0x2a0c92[_0x26ec('0x18')],_0x3d8b89);_0x3ce472(_0x5e9989[_0x26ec('0x16')](0x1f4,_0x2a0c92[_0x26ec('0x18')]));});});};exports[_0x26ec('0x2a')]=function(_0x1bbc5b){var _0x304194=this;return new Promise(function(_0x440ed3,_0x319a45){var _0x60c74c={'body':_0x1bbc5b[_0x26ec('0x2b')],'channel':_0x26ec('0x2c')};var _0x1d5e19=_[_0x26ec('0x2d')](_[_0x26ec('0x2e')](db[_0x26ec('0x2f')]['rawAttributes']),[_0x26ec('0x30'),_0x26ec('0x31'),_0x26ec('0x32'),_0x26ec('0x33')]);var _0x452bbb=![];if(_0x1bbc5b[_0x26ec('0x2b')]['id']){delete _0x1bbc5b['body']['id'];}if(_['isNil'](_0x1bbc5b[_0x26ec('0x2b')]['from'])){return _0x319a45(_0x304194[_0x26ec('0x16')](0x1f4,_0x26ec('0x34')));}if(_[_0x26ec('0x35')](_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x2b')])||_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x2b')]===''){return _0x319a45(_0x304194[_0x26ec('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x26ec('0x35')](_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x36')])){return _0x319a45(_0x304194['error'](0x1f4,_0x26ec('0x37')+_0x1d5e19));}if(!_[_0x26ec('0x38')](_0x1d5e19,_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x36')])){return _0x319a45(_0x304194[_0x26ec('0x16')](0x1f4,_0x26ec('0x39')+_0x1d5e19));}var _0x42724f={};_0x42724f[_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x36')]]=_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x3a')];return db[_0x26ec('0x1b')][_0x26ec('0x26')]({'where':{'id':_0x1bbc5b[_0x26ec('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x26ec('0x2f')],'as':'Contacts','where':_0x42724f,'limit':0x1,'order':[['updatedAt',_0x26ec('0x3c')]]}]},{'model':db[_0x26ec('0x3d')],'as':_0x26ec('0x3e')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0x26ec('0x10')](function(_0x583a22){if(_0x583a22&&_0x583a22[_0x26ec('0x3f')]){var _0x1220da=_0x583a22['get']({'plain':!![]});_0x60c74c['account']=_[_0x26ec('0x40')](_0x1220da,[_0x26ec('0x3e'),'List']);_0x60c74c[_0x26ec('0x3b')][_0x26ec('0x28')]=_0x583a22['getSmtpOptions']();_0x60c74c['applications']=_0x1220da[_0x26ec('0x3e')];_0x60c74c[_0x26ec('0x41')]=_0x1220da[_0x26ec('0x3f')];_0x60c74c['applications']=_[_0x26ec('0x42')](_0x60c74c['applications'],[_0x26ec('0x43')],[_0x26ec('0x44')]);if(_0x60c74c[_0x26ec('0x3b')]&&_0x60c74c[_0x26ec('0x3b')][_0x26ec('0x45')]){_0x60c74c[_0x26ec('0x46')]['push']({'id':0x0,'priority':_0x60c74c[_0x26ec('0x46')][_0x26ec('0x47')]+0x1,'app':'close','appdata':_0x26ec('0x45'),'interval':_0x26ec('0x48')});}if(_0x60c74c['account'][_0x26ec('0x3e')]){delete _0x60c74c['account']['Applications'];}if(_0x60c74c[_0x26ec('0x3b')][_0x26ec('0x3f')]){delete _0x60c74c[_0x26ec('0x3b')]['List'];}if(_0x1220da['List'][_0x26ec('0x49')][_0x26ec('0x47')]){return _0x1220da[_0x26ec('0x3f')]['Contacts'][0x0];}var _0xeec1e4=_[_0x26ec('0xb')](_0x1bbc5b['body'],{'firstName':_0x1bbc5b['body'][_0x26ec('0x3a')],'ListId':_0x1220da['ListId']});_0xeec1e4[_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x36')]]=_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x3a')];return db['CmContact']['create'](_0xeec1e4);}else{throw new Error(_0x26ec('0x4a'));}})[_0x26ec('0x10')](function(_0x2e1eec){_0x60c74c[_0x26ec('0x4b')]=_0x2e1eec;if(_0x2e1eec){if(!_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x4c')]){_0x1bbc5b['body'][_0x26ec('0x18')][_0x26ec('0x4c')]=rs[_0x26ec('0x4d')]()+'\x20'+_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x3a')];}var _0x37c62e={'ContactId':_0x2e1eec['id'],'MailAccountId':_0x1bbc5b['account']['id'],'inReplyTo':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x4c')],'to':_0x1bbc5b[_0x26ec('0x2b')]['message'][_0x26ec('0x3a')],'cc':_0x1bbc5b[_0x26ec('0x2b')]['message']['cc'],'subject':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x4e')],'attach':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x4f')],'lastMsgAt':moment()[_0x26ec('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x26ec('0x51')][_0x26ec('0x26')]({'where':{'closed':![],'MailAccountId':_0x1bbc5b['account']['id']},'include':[{'model':db[_0x26ec('0x52')],'as':_0x26ec('0x53'),'attributes':[_0x26ec('0x4c')],'where':{'messageId':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x54')]}}]})[_0x26ec('0x10')](function(_0x38d350){if(_0x38d350){return[_0x38d350,![]];}return db[_0x26ec('0x51')][_0x26ec('0x55')](_0x37c62e)[_0x26ec('0x10')](function(_0x4618dc){return[_0x4618dc,!![]];});});}else{throw new Error(_0x26ec('0x56'));}})[_0x26ec('0x57')](function(_0x426c56,_0x4a8769){if(_0x426c56){_0x452bbb=_0x4a8769;if(!_0x4a8769){return _0x426c56['update']({'inReplyTo':_0x1bbc5b['body']['message'][_0x26ec('0x4c')],'to':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')]['from'],'cc':_0x1bbc5b[_0x26ec('0x2b')]['message']['cc'],'subject':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x4e')],'attach':_0x426c56['attach']?_0x426c56[_0x26ec('0x4f')]:_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x4f')],'substatus':null,'substatusAt':moment()[_0x26ec('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x26ec('0x50')](_0x26ec('0x58')),'lastMsgDirection':'in'});}else{return _0x426c56;}}})['then'](function(_0x141119){_0x60c74c[_0x26ec('0x59')]=_0x141119[_0x26ec('0x5a')]({'plain':!![]});_0x60c74c['interaction'][_0x26ec('0x5b')]=_0x452bbb;return db[_0x26ec('0x52')][_0x26ec('0x55')]({'body':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x2b')],'MailAccountId':_0x1bbc5b[_0x26ec('0x3b')]['id'],'MailInteractionId':_0x141119['id'],'direction':'in','ContactId':_0x60c74c[_0x26ec('0x4b')]['id'],'messageId':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x4c')],'from':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x3a')],'to':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')]['to'],'cc':_0x1bbc5b[_0x26ec('0x2b')]['message']['cc'],'subject':_0x1bbc5b['body'][_0x26ec('0x18')][_0x26ec('0x4e')],'attach':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x4f')],'Attachments':_0x1bbc5b[_0x26ec('0x2b')]['message'][_0x26ec('0x5c')],'originTo':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x5d')],'originCc':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x5e')],'bcc':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')][_0x26ec('0x5f')],'ChatWebsiteId':_0x1bbc5b[_0x26ec('0x2b')]['message'][_0x26ec('0x60')]||null,'originChannel':_0x1bbc5b[_0x26ec('0x2b')][_0x26ec('0x18')]['originChannel']||_0x26ec('0x61'),'ChatOfflineMessageId':_0x1bbc5b[_0x26ec('0x2b')]['message'][_0x26ec('0x62')]||null},{'include':[{'model':db['Attachment'],'as':_0x26ec('0x63')}]});})[_0x26ec('0x10')](function(_0x32b4b8){_0x60c74c[_0x26ec('0x18')]=_0x32b4b8;if(!_0x60c74c[_0x26ec('0x59')][_0x26ec('0x64')]){return;}return db['User'][_0x26ec('0x26')]({'attributes':['id',_0x26ec('0x65')],'where':{'id':_0x60c74c['interaction'][_0x26ec('0x64')]}});})[_0x26ec('0x10')](function(_0x5f3d5e){if(_0x5f3d5e){_0x60c74c[_0x26ec('0x46')]['unshift']({'id':0x0,'priority':0x0,'app':_0x26ec('0x66'),'appdata':_0x5f3d5e[_0x26ec('0x65')]+','+(_0x60c74c['account'][_0x26ec('0x67')]||0xa),'interval':_0x26ec('0x48')});}if(!_0x60c74c['interaction'][_0x26ec('0x68')]){return;}return db[_0x26ec('0x69')][_0x26ec('0x26')]({'attributes':['id',_0x26ec('0x65')],'where':{'id':_0x60c74c[_0x26ec('0x59')][_0x26ec('0x68')]}});})[_0x26ec('0x10')](function(_0x5e46c8){if(_0x5e46c8){_0x60c74c[_0x26ec('0x46')][_0x26ec('0x6a')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5e46c8['name']+','+(_0x60c74c['account'][_0x26ec('0x6b')]||0x12c),'interval':_0x26ec('0x48')});}return respondWithRpcPromise(_0x26ec('0x6c'),'startRouting',_0x60c74c);})[_0x26ec('0x10')](function(_0x4122ce){_0x440ed3(_0x4122ce);})[_0x26ec('0x25')](function(_0x14d063){_0x319a45(_0x304194[_0x26ec('0x16')](0x1f4,_0x14d063[_0x26ec('0x18')]));});});}; \ No newline at end of file +var _0xabce=['Smtp','CloudProvider','get','omit','smtpOptions','getSmtpOptions','list','applications','asc','autoclose','push','length','close','defaults','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','update','attach','interaction','created','originTo','originCc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','MailQueue','queue','waitForTheAssignedQueue','startRouting','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','raw','attributes','limit','map','include','model','ShowMailAccount','find','where','smtp','NotifyMailAccount','body','difference','keys','rawAttributes','updatedAt','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','List','CmContact','Contacts','MailApplication','Applications','MailServerOut'];(function(_0x33d953,_0x52993a){var _0x13d3cd=function(_0x33395e){while(--_0x33395e){_0x33d953['push'](_0x33d953['shift']());}};_0x13d3cd(++_0x52993a);}(_0xabce,0x103));var _0xeabc=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xabce[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0xeabc('0x0'));var moment=require(_0xeabc('0x1'));var BPromise=require(_0xeabc('0x2'));var rs=require(_0xeabc('0x3'));var Redis=require(_0xeabc('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xeabc('0x5'));var config=require(_0xeabc('0x6'));var jayson=require(_0xeabc('0x7'));var client=jayson['client']['http']({'port':0x232c});config[_0xeabc('0x8')]=_['defaults'](config[_0xeabc('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xeabc('0x9'))(new Redis(config[_0xeabc('0x8')]));require(_0xeabc('0xa'))['register'](socket);function respondWithRpcPromise(_0x438ccf,_0x341f16,_0x2f73e9){return new BPromise(function(_0x1b4d1b,_0x4301e4){return client[_0xeabc('0xb')](_0x438ccf,_0x2f73e9)[_0xeabc('0xc')](function(_0x28292c){logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x341f16,_0xeabc('0xf'));logger[_0xeabc('0x10')](_0xeabc('0x11'),_0x341f16,_0xeabc('0xf'),JSON[_0xeabc('0x12')](_0x28292c));if(_0x28292c[_0xeabc('0x13')]){if(_0x28292c['error'][_0xeabc('0x14')]===0x1f4){logger[_0xeabc('0x13')](_0xeabc('0xe'),_0x341f16,_0x28292c['error']['message']);return _0x4301e4(_0x28292c[_0xeabc('0x13')][_0xeabc('0x15')]);}logger[_0xeabc('0x13')]('MailAccount,\x20%s,\x20%s',_0x341f16,_0x28292c[_0xeabc('0x13')][_0xeabc('0x15')]);return _0x1b4d1b(_0x28292c['error']['message']);}else{logger[_0xeabc('0xd')]('MailAccount,\x20%s,\x20%s',_0x341f16,_0xeabc('0xf'));_0x1b4d1b(_0x28292c[_0xeabc('0x16')][_0xeabc('0x15')]);}})[_0xeabc('0x17')](function(_0x31dd53){logger[_0xeabc('0x13')](_0xeabc('0xe'),_0x341f16,_0x31dd53);_0x4301e4(_0x31dd53);});});}exports[_0xeabc('0x18')]=function(_0x5d92e5){var _0x1253e4=this;return new Promise(function(_0x4d68ea,_0x31201a){return db[_0xeabc('0x19')]['findAll']({'raw':_0x5d92e5[_0xeabc('0x1a')]?_0x5d92e5[_0xeabc('0x1a')][_0xeabc('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d92e5[_0xeabc('0x1a')]?_0x5d92e5[_0xeabc('0x1a')]['where']||null:null,'attributes':_0x5d92e5[_0xeabc('0x1a')]?_0x5d92e5[_0xeabc('0x1a')][_0xeabc('0x1c')]||null:null,'limit':_0x5d92e5['options']?_0x5d92e5[_0xeabc('0x1a')][_0xeabc('0x1d')]||null:null,'include':_0x5d92e5[_0xeabc('0x1a')]?_0x5d92e5[_0xeabc('0x1a')]['include']?_[_0xeabc('0x1e')](_0x5d92e5['options'][_0xeabc('0x1f')],function(_0x4d4e29){return{'model':db[_0x4d4e29[_0xeabc('0x20')]],'as':_0x4d4e29['as'],'attributes':_0x4d4e29[_0xeabc('0x1c')],'include':_0x4d4e29[_0xeabc('0x1f')]?_[_0xeabc('0x1e')](_0x4d4e29[_0xeabc('0x1f')],function(_0x137293){return{'model':db[_0x137293[_0xeabc('0x20')]],'as':_0x137293['as'],'attributes':_0x137293['attributes'],'include':_0x137293['include']?_[_0xeabc('0x1e')](_0x137293['include'],function(_0x3c1b5b){return{'model':db[_0x3c1b5b[_0xeabc('0x20')]],'as':_0x3c1b5b['as'],'attributes':_0x3c1b5b['attributes']};}):[]};}):[]};}):[]:[]})[_0xeabc('0xc')](function(_0x38572d){logger[_0xeabc('0xd')](_0xeabc('0x18'),_0x5d92e5);logger[_0xeabc('0x10')](_0xeabc('0x18'),_0x5d92e5,JSON[_0xeabc('0x12')](_0x38572d));_0x4d68ea(_0x38572d);})[_0xeabc('0x17')](function(_0x2915c1){logger['error'](_0xeabc('0x18'),_0x2915c1['message'],_0x5d92e5);_0x31201a(_0x1253e4[_0xeabc('0x13')](0x1f4,_0x2915c1[_0xeabc('0x15')]));});});};exports[_0xeabc('0x21')]=function(_0x3c606a){var _0x73c8d4=this;return new Promise(function(_0x368b8a,_0x61c0af){return db['MailAccount'][_0xeabc('0x22')]({'raw':_0x3c606a[_0xeabc('0x1a')]?_0x3c606a[_0xeabc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3c606a[_0xeabc('0x1a')]?_0x3c606a[_0xeabc('0x1a')][_0xeabc('0x23')]||null:null,'attributes':_0x3c606a['options']?_0x3c606a[_0xeabc('0x1a')][_0xeabc('0x1c')]||null:null,'include':_0x3c606a[_0xeabc('0x1a')]?_0x3c606a['options'][_0xeabc('0x1f')]?_[_0xeabc('0x1e')](_0x3c606a['options']['include'],function(_0x254568){return{'model':db[_0x254568[_0xeabc('0x20')]],'as':_0x254568['as'],'attributes':_0x254568['attributes'],'include':_0x254568[_0xeabc('0x1f')]?_[_0xeabc('0x1e')](_0x254568[_0xeabc('0x1f')],function(_0x10434e){return{'model':db[_0x10434e[_0xeabc('0x20')]],'as':_0x10434e['as'],'attributes':_0x10434e['attributes'],'include':_0x10434e[_0xeabc('0x1f')]?_['map'](_0x10434e[_0xeabc('0x1f')],function(_0x2bda29){return{'model':db[_0x2bda29[_0xeabc('0x20')]],'as':_0x2bda29['as'],'attributes':_0x2bda29['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x452580){if(_0x3c606a['options'][_0xeabc('0x24')]===!![])_0x452580['setDataValue']('smtpOptions',_0x452580['getSmtpOptions']());logger['info'](_0xeabc('0x21'),_0x3c606a);logger['debug'](_0xeabc('0x21'),_0x3c606a,JSON[_0xeabc('0x12')](_0x452580));_0x368b8a(_0x452580);})['catch'](function(_0xe8fa6e){logger['error'](_0xeabc('0x21'),_0xe8fa6e['message'],_0x3c606a);_0x61c0af(_0x73c8d4[_0xeabc('0x13')](0x1f4,_0xe8fa6e[_0xeabc('0x15')]));});});};exports[_0xeabc('0x25')]=function(_0x5d8ae4){var _0x5a00d0=this;return new Promise(function(_0x54a3ae,_0x46056c){var _0x23fb33={'body':_0x5d8ae4[_0xeabc('0x26')],'channel':'mail'};var _0x4f1897=_[_0xeabc('0x27')](_[_0xeabc('0x28')](db['CmContact'][_0xeabc('0x29')]),['createdAt',_0xeabc('0x2a'),'CompanyId','ListId']);var _0x5cd04d=![];if(_0x5d8ae4[_0xeabc('0x26')]['id']){delete _0x5d8ae4[_0xeabc('0x26')]['id'];}if(_[_0xeabc('0x2b')](_0x5d8ae4[_0xeabc('0x26')]['from'])){return _0x46056c(_0x5a00d0[_0xeabc('0x13')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xeabc('0x2b')](_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x26')])||_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x26')]===''){return _0x46056c(_0x5a00d0['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xeabc('0x2b')](_0x5d8ae4['body'][_0xeabc('0x2c')])){return _0x46056c(_0x5a00d0[_0xeabc('0x13')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f1897));}if(!_[_0xeabc('0x2d')](_0x4f1897,_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x2c')])){return _0x46056c(_0x5a00d0[_0xeabc('0x13')](0x1f4,_0xeabc('0x2e')+_0x4f1897));}var _0xcaa5b9={};_0xcaa5b9[_0x5d8ae4[_0xeabc('0x26')]['mapKey']]=_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x2f')];return db[_0xeabc('0x19')][_0xeabc('0x22')]({'where':{'id':_0x5d8ae4[_0xeabc('0x30')]['id']},'include':[{'model':db[_0xeabc('0x31')],'as':_0xeabc('0x32'),'include':[{'model':db[_0xeabc('0x33')],'as':_0xeabc('0x34'),'where':_0xcaa5b9,'limit':0x1,'order':[[_0xeabc('0x2a'),'DESC']]}]},{'model':db[_0xeabc('0x35')],'as':_0xeabc('0x36')},{'model':db[_0xeabc('0x37')],'as':_0xeabc('0x38'),'include':[{'model':db[_0xeabc('0x39')],'as':_0xeabc('0x39')}]}]})[_0xeabc('0xc')](function(_0x48df43){if(_0x48df43&&_0x48df43[_0xeabc('0x32')]){var _0x32e09b=_0x48df43[_0xeabc('0x3a')]({'plain':!![]});_0x23fb33[_0xeabc('0x30')]=_[_0xeabc('0x3b')](_0x32e09b,['Applications',_0xeabc('0x32')]);_0x23fb33[_0xeabc('0x30')][_0xeabc('0x3c')]=_0x48df43[_0xeabc('0x3d')]();_0x23fb33['applications']=_0x32e09b[_0xeabc('0x36')];_0x23fb33[_0xeabc('0x3e')]=_0x32e09b['List'];_0x23fb33[_0xeabc('0x3f')]=_['orderBy'](_0x23fb33[_0xeabc('0x3f')],['priority'],[_0xeabc('0x40')]);if(_0x23fb33[_0xeabc('0x30')]&&_0x23fb33[_0xeabc('0x30')][_0xeabc('0x41')]){_0x23fb33[_0xeabc('0x3f')][_0xeabc('0x42')]({'id':0x0,'priority':_0x23fb33[_0xeabc('0x3f')][_0xeabc('0x43')]+0x1,'app':_0xeabc('0x44'),'appdata':_0xeabc('0x41'),'interval':'*,*,*,*'});}if(_0x23fb33[_0xeabc('0x30')][_0xeabc('0x36')]){delete _0x23fb33[_0xeabc('0x30')][_0xeabc('0x36')];}if(_0x23fb33['account'][_0xeabc('0x32')]){delete _0x23fb33[_0xeabc('0x30')][_0xeabc('0x32')];}if(_0x32e09b[_0xeabc('0x32')]['Contacts'][_0xeabc('0x43')]){return _0x32e09b[_0xeabc('0x32')][_0xeabc('0x34')][0x0];}var _0xa55cce=_[_0xeabc('0x45')](_0x5d8ae4[_0xeabc('0x26')],{'firstName':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x2f')],'ListId':_0x32e09b[_0xeabc('0x46')]});_0xa55cce[_0x5d8ae4['body'][_0xeabc('0x2c')]]=_0x5d8ae4['body']['from'];return db['CmContact'][_0xeabc('0x47')](_0xa55cce);}else{throw new Error(_0xeabc('0x48'));}})[_0xeabc('0xc')](function(_0xb35103){_0x23fb33[_0xeabc('0x49')]=_0xb35103;if(_0xb35103){if(!_0x5d8ae4[_0xeabc('0x26')]['message'][_0xeabc('0x4a')]){_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x4a')]=rs[_0xeabc('0x4b')]()+'\x20'+_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x2f')];}var _0x5820ca={'ContactId':_0xb35103['id'],'MailAccountId':_0x5d8ae4['account']['id'],'inReplyTo':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x4a')],'to':_0x5d8ae4['body'][_0xeabc('0x15')]['from'],'cc':_0x5d8ae4['body'][_0xeabc('0x15')]['cc'],'subject':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x4c')],'attach':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')]['attach'],'lastMsgAt':moment()[_0xeabc('0x4d')](_0xeabc('0x4e')),'lastMsgDirection':'in'};return db[_0xeabc('0x4f')][_0xeabc('0x22')]({'where':{'closed':![],'MailAccountId':_0x5d8ae4[_0xeabc('0x30')]['id']},'include':[{'model':db[_0xeabc('0x50')],'as':'Messages','attributes':[_0xeabc('0x4a')],'where':{'messageId':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x51')]}}]})[_0xeabc('0xc')](function(_0x19faa4){if(_0x19faa4){return[_0x19faa4,![]];}return db[_0xeabc('0x4f')][_0xeabc('0x47')](_0x5820ca)[_0xeabc('0xc')](function(_0x54d2b3){return[_0x54d2b3,!![]];});});}else{throw new Error(_0xeabc('0x52'));}})['spread'](function(_0x404846,_0x2c389d){if(_0x404846){_0x5cd04d=_0x2c389d;if(!_0x2c389d){return _0x404846[_0xeabc('0x53')]({'inReplyTo':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x4a')],'to':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x2f')],'cc':_0x5d8ae4[_0xeabc('0x26')]['message']['cc'],'subject':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x4c')],'attach':_0x404846[_0xeabc('0x54')]?_0x404846['attach']:_0x5d8ae4[_0xeabc('0x26')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0xeabc('0x4d')](_0xeabc('0x4e')),'lastMsgAt':moment()[_0xeabc('0x4d')](_0xeabc('0x4e')),'lastMsgDirection':'in'});}else{return _0x404846;}}})['then'](function(_0x51a0c7){_0x23fb33[_0xeabc('0x55')]=_0x51a0c7['get']({'plain':!![]});_0x23fb33['interaction'][_0xeabc('0x56')]=_0x5cd04d;return db['MailMessage']['create']({'body':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x26')],'MailAccountId':_0x5d8ae4['account']['id'],'MailInteractionId':_0x51a0c7['id'],'direction':'in','ContactId':_0x23fb33['contact']['id'],'messageId':_0x5d8ae4[_0xeabc('0x26')]['message'][_0xeabc('0x4a')],'from':_0x5d8ae4[_0xeabc('0x26')]['message']['from'],'to':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')]['to'],'cc':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')]['cc'],'subject':_0x5d8ae4[_0xeabc('0x26')]['message']['subject'],'attach':_0x5d8ae4[_0xeabc('0x26')]['message'][_0xeabc('0x54')],'Attachments':_0x5d8ae4['body'][_0xeabc('0x15')]['attachments'],'originTo':_0x5d8ae4[_0xeabc('0x26')]['message'][_0xeabc('0x57')],'originCc':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x58')],'bcc':_0x5d8ae4['body'][_0xeabc('0x15')]['bcc'],'ChatWebsiteId':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x59')]||null,'originChannel':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')]['originChannel']||_0xeabc('0x5a'),'ChatOfflineMessageId':_0x5d8ae4[_0xeabc('0x26')][_0xeabc('0x15')][_0xeabc('0x5b')]||null},{'include':[{'model':db['Attachment'],'as':_0xeabc('0x5c')}]});})[_0xeabc('0xc')](function(_0xe60b11){_0x23fb33[_0xeabc('0x15')]=_0xe60b11;if(!_0x23fb33['interaction'][_0xeabc('0x5d')]){return;}return db[_0xeabc('0x5e')][_0xeabc('0x22')]({'attributes':['id',_0xeabc('0x5f')],'where':{'id':_0x23fb33['interaction']['UserId']}});})[_0xeabc('0xc')](function(_0x4f406b){if(_0x4f406b){_0x23fb33['applications'][_0xeabc('0x60')]({'id':0x0,'priority':0x0,'app':_0xeabc('0x61'),'appdata':_0x4f406b[_0xeabc('0x5f')]+','+(_0x23fb33['account'][_0xeabc('0x62')]||0xa),'interval':_0xeabc('0x63')});}if(!_0x23fb33['interaction'][_0xeabc('0x64')]){return;}return db[_0xeabc('0x65')][_0xeabc('0x22')]({'attributes':['id',_0xeabc('0x5f')],'where':{'id':_0x23fb33[_0xeabc('0x55')]['queueId']}});})[_0xeabc('0xc')](function(_0x523496){if(_0x523496){_0x23fb33['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0xeabc('0x66'),'appdata':_0x523496[_0xeabc('0x5f')]+','+(_0x23fb33[_0xeabc('0x30')][_0xeabc('0x67')]||0x12c),'interval':_0xeabc('0x63')});}return respondWithRpcPromise('Start',_0xeabc('0x68'),_0x23fb33);})['then'](function(_0x1795fe){_0x54a3ae(_0x1795fe);})[_0xeabc('0x17')](function(_0x4dac49){_0x46056c(_0x5a00d0[_0xeabc('0x13')](0x1f4,_0x4dac49['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index aba832c..e7efb40 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 _0x3260=['remove','update','emit','register','length','./mailAccount.events','save'];(function(_0x53972e,_0x275c){var _0xc48fcf=function(_0x1130de){while(--_0x1130de){_0x53972e['push'](_0x53972e['shift']());}};_0xc48fcf(++_0x275c);}(_0x3260,0xd7));var _0x0326=function(_0x8fd06,_0x33eea1){_0x8fd06=_0x8fd06-0x0;var _0x429e9b=_0x3260[_0x8fd06];return _0x429e9b;};'use strict';var MailAccountEvents=require(_0x0326('0x0'));var events=[_0x0326('0x1'),_0x0326('0x2'),_0x0326('0x3')];function createListener(_0x4ad390,_0x58a21c){return function(_0x4502fb){_0x58a21c[_0x0326('0x4')](_0x4ad390,_0x4502fb);};}function removeListener(_0x24cc5b,_0x34b862){return function(){MailAccountEvents['removeListener'](_0x24cc5b,_0x34b862);};}exports[_0x0326('0x5')]=function(_0x5198d5){for(var _0x4e5f8e=0x0,_0x23f016=events[_0x0326('0x6')];_0x4e5f8e<_0x23f016;_0x4e5f8e++){var _0x34c33e=events[_0x4e5f8e];var _0x20c300=createListener('mailAccount:'+_0x34c33e,_0x5198d5);MailAccountEvents['on'](_0x34c33e,_0x20c300);}}; \ No newline at end of file +var _0xc4ee=['save','remove','update','emit','removeListener','register','length','./mailAccount.events'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xc4ee,0x147));var _0xec4e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4ee[_0x321bb2];return _0x9c12ed;};'use strict';var MailAccountEvents=require(_0xec4e('0x0'));var events=[_0xec4e('0x1'),_0xec4e('0x2'),_0xec4e('0x3')];function createListener(_0x5663bb,_0x16288f){return function(_0x220e55){_0x16288f[_0xec4e('0x4')](_0x5663bb,_0x220e55);};}function removeListener(_0x3be487,_0x271621){return function(){MailAccountEvents[_0xec4e('0x5')](_0x3be487,_0x271621);};}exports[_0xec4e('0x6')]=function(_0x4cd36c){for(var _0xf8ec68=0x0,_0x3b750d=events[_0xec4e('0x7')];_0xf8ec68<_0x3b750d;_0xf8ec68++){var _0x135a6e=events[_0xf8ec68];var _0x16431d=createListener('mailAccount:'+_0x135a6e,_0x4cd36c);MailAccountEvents['on'](_0x135a6e,_0x16431d);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 0de6761..b571b7c 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 _0x398f=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailApplication.controller','isAuthenticated','put','update','delete','destroy'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x398f,0x1a5));var _0xf398=function(_0x3af1e2,_0x1bb655){_0x3af1e2=_0x3af1e2-0x0;var _0x42ee12=_0x398f[_0x3af1e2];return _0x42ee12;};'use strict';var multer=require('multer');var util=require(_0xf398('0x0'));var path=require(_0xf398('0x1'));var timeout=require(_0xf398('0x2'));var express=require(_0xf398('0x3'));var router=express[_0xf398('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf398('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf398('0x6'));var controller=require(_0xf398('0x7'));router['get']('/:id',auth[_0xf398('0x8')](),controller['show']);router[_0xf398('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf398('0xa')]);router[_0xf398('0xb')]('/:id',auth[_0xf398('0x8')](),controller[_0xf398('0xc')]);module[_0xf398('0xd')]=router; \ No newline at end of file +var _0x02fe=['isAuthenticated','put','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get'];(function(_0x1171ce,_0x447ada){var _0xab4650=function(_0x4803d3){while(--_0x4803d3){_0x1171ce['push'](_0x1171ce['shift']());}};_0xab4650(++_0x447ada);}(_0x02fe,0x1e6));var _0xe02f=function(_0xb8a7dc,_0x24b727){_0xb8a7dc=_0xb8a7dc-0x0;var _0x98ef09=_0x02fe[_0xb8a7dc];return _0x98ef09;};'use strict';var multer=require(_0xe02f('0x0'));var util=require(_0xe02f('0x1'));var path=require(_0xe02f('0x2'));var timeout=require('connect-timeout');var express=require(_0xe02f('0x3'));var router=express[_0xe02f('0x4')]();var fs_extra=require(_0xe02f('0x5'));var auth=require(_0xe02f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe02f('0x7'));var controller=require(_0xe02f('0x8'));router[_0xe02f('0x9')]('/:id',auth[_0xe02f('0xa')](),controller['show']);router[_0xe02f('0xb')](_0xe02f('0xc'),auth['isAuthenticated'](),controller[_0xe02f('0xd')]);router[_0xe02f('0xe')](_0xe02f('0xc'),auth[_0xe02f('0xa')](),controller[_0xe02f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a2c4680..052cd36 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 _0xe719=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x2d565,_0x401263){var _0x2e95aa=function(_0x1f2bed){while(--_0x1f2bed){_0x2d565['push'](_0x2d565['shift']());}};_0x2e95aa(++_0x401263);}(_0xe719,0xbc));var _0x9e71=function(_0x1c868c,_0x4983cb){_0x1c868c=_0x1c868c-0x0;var _0x22b288=_0xe719[_0x1c868c];return _0x22b288;};'use strict';var Sequelize=require(_0x9e71('0x0'));module[_0x9e71('0x1')]={'priority':{'type':Sequelize[_0x9e71('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9e71('0x3')},'appdata':{'type':Sequelize[_0x9e71('0x4')]()},'description':{'type':Sequelize[_0x9e71('0x5')]},'interval':{'type':Sequelize[_0x9e71('0x5')],'defaultValue':_0x9e71('0x6')}}; \ No newline at end of file +var _0x486d=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x2ab662,_0x19bef6){var _0x3ba074=function(_0x19688d){while(--_0x19688d){_0x2ab662['push'](_0x2ab662['shift']());}};_0x3ba074(++_0x19bef6);}(_0x486d,0x79));var _0xd486=function(_0x4619b9,_0x3f3d27){_0x4619b9=_0x4619b9-0x0;var _0x28ac9a=_0x486d[_0x4619b9];return _0x28ac9a;};'use strict';var Sequelize=require(_0xd486('0x0'));module[_0xd486('0x1')]={'priority':{'type':Sequelize[_0xd486('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd486('0x3')],'allowNull':![],'defaultValue':_0xd486('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd486('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd486('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 5ccef17..b133745 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 _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x3e5d9c,_0x885c02){var _0x103b7a=function(_0x9ec6cb){while(--_0x9ec6cb){_0x3e5d9c['push'](_0x3e5d9c['shift']());}};_0x103b7a(++_0x885c02);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','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'];(function(_0x55ba3c,_0x33abff){var _0x53b09e=function(_0x2f54e3){while(--_0x2f54e3){_0x55ba3c['push'](_0x55ba3c['shift']());}};_0x53b09e(++_0x33abff);}(_0x54ef,0x112));var _0xf54e=function(_0x202a9b,_0xb87d6){_0x202a9b=_0x202a9b-0x0;var _0x50560a=_0x54ef[_0x202a9b];return _0x50560a;};'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'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index b168a74..316405a 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 _0x699c=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x699c,0x1d2));var _0xc699=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x699c[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xc699('0x0'));var util=require(_0xc699('0x1'));var logger=require(_0xc699('0x2'))(_0xc699('0x3'));var moment=require(_0xc699('0x4'));var BPromise=require(_0xc699('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc699('0x6'));var rimraf=require(_0xc699('0x7'));var config=require(_0xc699('0x8'));var attributes=require('./mailApplication.attributes');module[_0xc699('0x9')]=function(_0x4c7cf0,_0x4d61ee){return _0x4c7cf0[_0xc699('0xa')](_0xc699('0xb'),attributes,{'tableName':_0xc699('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc699('0xd'),'collate':_0xc699('0xe')});}; \ No newline at end of file +var _0xcfe0=['utf8mb4_unicode_ci','util','moment','bluebird','path','rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xcfe0,0xe5));var _0x0cfe=function(_0x221bb0,_0x38bfa1){_0x221bb0=_0x221bb0-0x0;var _0x6e47c0=_0xcfe0[_0x221bb0];return _0x6e47c0;};'use strict';var _=require('lodash');var util=require(_0x0cfe('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0cfe('0x1'));var BPromise=require(_0x0cfe('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cfe('0x3'));var rimraf=require(_0x0cfe('0x4'));var config=require('../../config/environment');var attributes=require(_0x0cfe('0x5'));module[_0x0cfe('0x6')]=function(_0x387758,_0x3b45dd){return _0x387758[_0x0cfe('0x7')](_0x0cfe('0x8'),attributes,{'tableName':_0x0cfe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0cfe('0xa'),'collate':_0x0cfe('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 14edaa7..87cc4d3 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 _0x5880=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','then','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5880,0xcd));var _0x0588=function(_0x442406,_0x118e15){_0x442406=_0x442406-0x0;var _0x32d78a=_0x5880[_0x442406];return _0x32d78a;};'use strict';var _=require(_0x0588('0x0'));var util=require(_0x0588('0x1'));var moment=require(_0x0588('0x2'));var BPromise=require(_0x0588('0x3'));var rs=require(_0x0588('0x4'));var fs=require('fs');var Redis=require(_0x0588('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0588('0x6'))(_0x0588('0x7'));var config=require(_0x0588('0x8'));var jayson=require(_0x0588('0x9'));var client=jayson[_0x0588('0xa')][_0x0588('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d5b5c,_0x49f348,_0x5ec5e7){return new BPromise(function(_0x30e498,_0x4cfa60){return client[_0x0588('0xc')](_0x1d5b5c,_0x5ec5e7)['then'](function(_0x3cfdbd){logger[_0x0588('0xd')](_0x0588('0xe'),_0x49f348,'request\x20sent');logger[_0x0588('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x49f348,'request\x20sent',JSON['stringify'](_0x3cfdbd));if(_0x3cfdbd[_0x0588('0x10')]){if(_0x3cfdbd[_0x0588('0x10')][_0x0588('0x11')]===0x1f4){logger['error'](_0x0588('0xe'),_0x49f348,_0x3cfdbd[_0x0588('0x10')][_0x0588('0x12')]);return _0x4cfa60(_0x3cfdbd['error']['message']);}logger[_0x0588('0x10')](_0x0588('0xe'),_0x49f348,_0x3cfdbd['error']['message']);return _0x30e498(_0x3cfdbd['error'][_0x0588('0x12')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x49f348,_0x0588('0x13'));_0x30e498(_0x3cfdbd[_0x0588('0x14')][_0x0588('0x12')]);}})['catch'](function(_0x6b76aa){logger['error'](_0x0588('0xe'),_0x49f348,_0x6b76aa);_0x4cfa60(_0x6b76aa);});});}exports[_0x0588('0x15')]=function(_0x4a5db2){var _0x314951=this;return new Promise(function(_0x2050b1,_0x3f6456){return db[_0x0588('0x16')][_0x0588('0x17')](_0x4a5db2[_0x0588('0x18')],{'raw':_0x4a5db2['options']?_0x4a5db2[_0x0588('0x19')][_0x0588('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a5db2[_0x0588('0x19')]?_0x4a5db2[_0x0588('0x19')]['where']||null:null,'attributes':_0x4a5db2[_0x0588('0x19')]?_0x4a5db2[_0x0588('0x19')][_0x0588('0x1b')]||null:null,'limit':_0x4a5db2[_0x0588('0x19')]?_0x4a5db2[_0x0588('0x19')][_0x0588('0x1c')]||null:null})[_0x0588('0x1d')](function(_0x505703){logger[_0x0588('0xd')](_0x0588('0x15'),_0x4a5db2);logger[_0x0588('0xf')](_0x0588('0x15'),_0x4a5db2,JSON['stringify'](_0x505703));_0x2050b1(_0x505703);})['catch'](function(_0xab686d){logger[_0x0588('0x10')](_0x0588('0x15'),_0xab686d[_0x0588('0x12')],_0x4a5db2);_0x3f6456(_0x314951['error'](0x1f4,_0xab686d['message']));});});}; \ No newline at end of file +var _0xf846=['then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf846,0x85));var _0x6f84=function(_0xb7284d,_0x3a8acc){_0xb7284d=_0xb7284d-0x0;var _0x52a570=_0xf846[_0xb7284d];return _0x52a570;};'use strict';var _=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var moment=require(_0x6f84('0x2'));var BPromise=require(_0x6f84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f84('0x4'));var db=require(_0x6f84('0x5'))['db'];var utils=require(_0x6f84('0x6'));var logger=require(_0x6f84('0x7'))('rpc');var config=require(_0x6f84('0x8'));var jayson=require(_0x6f84('0x9'));var client=jayson[_0x6f84('0xa')][_0x6f84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x162a59,_0x45dd2b,_0x4dcf04){return new BPromise(function(_0x196c7a,_0x2da435){return client[_0x6f84('0xc')](_0x162a59,_0x4dcf04)['then'](function(_0x156032){logger[_0x6f84('0xd')]('MailApplication,\x20%s,\x20%s',_0x45dd2b,_0x6f84('0xe'));logger[_0x6f84('0xf')](_0x6f84('0x10'),_0x45dd2b,_0x6f84('0xe'),JSON[_0x6f84('0x11')](_0x156032));if(_0x156032[_0x6f84('0x12')]){if(_0x156032[_0x6f84('0x12')][_0x6f84('0x13')]===0x1f4){logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x156032[_0x6f84('0x12')]['message']);return _0x2da435(_0x156032[_0x6f84('0x12')]['message']);}logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x156032['error'][_0x6f84('0x15')]);return _0x196c7a(_0x156032['error'][_0x6f84('0x15')]);}else{logger['info'](_0x6f84('0x14'),_0x45dd2b,'request\x20sent');_0x196c7a(_0x156032[_0x6f84('0x16')]['message']);}})[_0x6f84('0x17')](function(_0x27bc7d){logger[_0x6f84('0x12')](_0x6f84('0x14'),_0x45dd2b,_0x27bc7d);_0x2da435(_0x27bc7d);});});}exports[_0x6f84('0x18')]=function(_0x2abc28){var _0x5474ad=this;return new Promise(function(_0x2b91ad,_0x4f323b){return db[_0x6f84('0x19')][_0x6f84('0x1a')](_0x2abc28[_0x6f84('0x1b')],{'raw':_0x2abc28[_0x6f84('0x1c')]?_0x2abc28[_0x6f84('0x1c')][_0x6f84('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2abc28[_0x6f84('0x1c')]?_0x2abc28['options']['where']||null:null,'attributes':_0x2abc28[_0x6f84('0x1c')]?_0x2abc28['options'][_0x6f84('0x1e')]||null:null,'limit':_0x2abc28[_0x6f84('0x1c')]?_0x2abc28[_0x6f84('0x1c')][_0x6f84('0x1f')]||null:null})[_0x6f84('0x20')](function(_0x1d51c8){logger[_0x6f84('0xd')](_0x6f84('0x18'),_0x2abc28);logger[_0x6f84('0xf')]('UpdateMailApplication',_0x2abc28,JSON[_0x6f84('0x11')](_0x1d51c8));_0x2b91ad(_0x1d51c8);})['catch'](function(_0x32692d){logger[_0x6f84('0x12')](_0x6f84('0x18'),_0x32692d[_0x6f84('0x15')],_0x2abc28);_0x4f323b(_0x5474ad[_0x6f84('0x12')](0x1f4,_0x32692d[_0x6f84('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index bf668d9..1c21ce8 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 _0x4d0c=['/:id/tags','mailinteraction:addtags','addTags','tracked','mail','mailinteraction:update','update','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/interaction/service','./mailInteraction.controller','get','/:id','isAuthenticated','show','/:id/messages','download','create','post','addMessage'];(function(_0x3ac893,_0x3f19e5){var _0x523b07=function(_0x45c70){while(--_0x45c70){_0x3ac893['push'](_0x3ac893['shift']());}};_0x523b07(++_0x3f19e5);}(_0x4d0c,0x135));var _0xc4d0=function(_0x17e93f,_0x18581b){_0x17e93f=_0x17e93f-0x0;var _0x1c8805=_0x4d0c[_0x17e93f];return _0x1c8805;};'use strict';var express=require(_0xc4d0('0x0'));var router=express[_0xc4d0('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xc4d0('0x2'));var controller=require(_0xc4d0('0x3'));router[_0xc4d0('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xc4d0('0x5'),auth[_0xc4d0('0x6')](),controller[_0xc4d0('0x7')]);router[_0xc4d0('0x4')](_0xc4d0('0x8'),auth[_0xc4d0('0x6')](),controller['getMessages']);router[_0xc4d0('0x4')]('/:id/download',auth['isAuthenticated'](),controller[_0xc4d0('0x9')]);router['post']('/',auth[_0xc4d0('0x6')](),controller[_0xc4d0('0xa')]);router[_0xc4d0('0xb')](_0xc4d0('0x8'),auth[_0xc4d0('0x6')](),controller[_0xc4d0('0xc')]);router['post'](_0xc4d0('0xd'),auth[_0xc4d0('0x6')](),interaction['tracked']('mail',_0xc4d0('0xe')),controller[_0xc4d0('0xf')]);router['put'](_0xc4d0('0x5'),auth[_0xc4d0('0x6')](),interaction[_0xc4d0('0x10')](_0xc4d0('0x11'),_0xc4d0('0x12')),controller[_0xc4d0('0x13')]);router['delete'](_0xc4d0('0x5'),auth[_0xc4d0('0x6')](),interaction[_0xc4d0('0x10')](_0xc4d0('0x11'),_0xc4d0('0x14')),controller[_0xc4d0('0x15')]);router['delete'](_0xc4d0('0xd'),auth['isAuthenticated'](),controller[_0xc4d0('0x16')]);module['exports']=router; \ No newline at end of file +var _0x58e2=['mail','mailinteraction:update','update','delete','removeTags','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id/messages','getMessages','create','post','addMessage','/:id/tags','tracked','mailinteraction:addtags','put','/:id'];(function(_0x50d1d9,_0x503739){var _0x3d9c91=function(_0x2b1319){while(--_0x2b1319){_0x50d1d9['push'](_0x50d1d9['shift']());}};_0x3d9c91(++_0x503739);}(_0x58e2,0x10d));var _0x258e=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x58e2[_0x344a3f];return _0x264712;};'use strict';var express=require('express');var router=express[_0x258e('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x258e('0x1'));var controller=require(_0x258e('0x2'));router[_0x258e('0x3')]('/',auth[_0x258e('0x4')](),controller[_0x258e('0x5')]);router[_0x258e('0x3')]('/describe',auth[_0x258e('0x4')](),controller[_0x258e('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x258e('0x3')](_0x258e('0x7'),auth[_0x258e('0x4')](),controller[_0x258e('0x8')]);router[_0x258e('0x3')]('/:id/download',auth[_0x258e('0x4')](),controller['download']);router['post']('/',auth[_0x258e('0x4')](),controller[_0x258e('0x9')]);router[_0x258e('0xa')](_0x258e('0x7'),auth[_0x258e('0x4')](),controller[_0x258e('0xb')]);router[_0x258e('0xa')](_0x258e('0xc'),auth['isAuthenticated'](),interaction[_0x258e('0xd')]('mail',_0x258e('0xe')),controller['addTags']);router[_0x258e('0xf')](_0x258e('0x10'),auth[_0x258e('0x4')](),interaction['tracked'](_0x258e('0x11'),_0x258e('0x12')),controller[_0x258e('0x13')]);router[_0x258e('0x14')]('/:id',auth[_0x258e('0x4')](),interaction[_0x258e('0xd')](_0x258e('0x11'),'mailinteraction:destroy'),controller['destroy']);router[_0x258e('0x14')]('/:id/tags',auth[_0x258e('0x4')](),controller[_0x258e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4989fe7..147fa8b 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 _0x6ac6=['BOOLEAN','STRING','TEXT','long','DATE','out','ENUM','INTEGER','iconv','exports'];(function(_0x2573ac,_0x2946f7){var _0x1f6a51=function(_0x1ad47f){while(--_0x1ad47f){_0x2573ac['push'](_0x2573ac['shift']());}};_0x1f6a51(++_0x2946f7);}(_0x6ac6,0x1d4));var _0x66ac=function(_0x31748b,_0x3a08a9){_0x31748b=_0x31748b-0x0;var _0x389dd3=_0x6ac6[_0x31748b];return _0x389dd3;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x66ac('0x0'));module[_0x66ac('0x1')]={'closed':{'type':Sequelize[_0x66ac('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x66ac('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x66ac('0x3')]},'inReplyTo':{'type':Sequelize[_0x66ac('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x66ac('0x4')](_0x66ac('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x66ac('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x66ac('0x6')]},'substatus':{'type':Sequelize[_0x66ac('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x66ac('0x6')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x66ac('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x66ac('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x66ac('0x8')]('in',_0x66ac('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x66ac('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x66ac('0x9')]}}; \ No newline at end of file +var _0x440b=['sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x15f5c2,_0xb11c6d){var _0x1cae58=function(_0x1a0d7a){while(--_0x1a0d7a){_0x15f5c2['push'](_0x15f5c2['shift']());}};_0x1cae58(++_0xb11c6d);}(_0x440b,0xfa));var _0xb440=function(_0x365056,_0x5afa4f){_0x365056=_0x365056-0x0;var _0x412743=_0x440b[_0x365056];return _0x412743;};'use strict';var Sequelize=require(_0xb440('0x0'));var iconv=require(_0xb440('0x1'));module[_0xb440('0x2')]={'closed':{'type':Sequelize[_0xb440('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb440('0x4')]},'disposition':{'type':Sequelize[_0xb440('0x5')]},'secondDisposition':{'type':Sequelize[_0xb440('0x5')]},'thirdDisposition':{'type':Sequelize[_0xb440('0x5')]},'note':{'type':Sequelize[_0xb440('0x5')]},'inReplyTo':{'type':Sequelize[_0xb440('0x5')](0x1fe)},'to':{'type':Sequelize[_0xb440('0x5')]},'cc':{'type':Sequelize[_0xb440('0x6')](_0xb440('0x7'))},'subject':{'type':Sequelize[_0xb440('0x6')]()},'attach':{'type':Sequelize[_0xb440('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb440('0x4')]},'substatus':{'type':Sequelize[_0xb440('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xb440('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xb440('0x8')]('in',_0xb440('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb440('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xb440('0x8')]('in',_0xb440('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8c1704b..f83b4f5 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 _0xe2d2=['fields','attributes','length','includeAll','merge','options','find','create','body','describe','MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','where','pick','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','inlineCss','true','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','toString','join','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','subject','sort','get','each','from','missing.recipient@your.company.com','decode','createdAt','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','offset','undefined','limit','count','set','json','update','destroy','then','error','stack','name','send','index','map','MailInteraction','rawAttributes','type','key','getOptions','findAll','mail','query','user','catch','params','model','keys','filters','intersection'];(function(_0x4fa0ea,_0x2cd534){var _0x51d027=function(_0xe67342){while(--_0xe67342){_0x4fa0ea['push'](_0x4fa0ea['shift']());}};_0x51d027(++_0x2cd534);}(_0xe2d2,0x1a7));var _0x2e2d=function(_0x169c95,_0x16914c){_0x169c95=_0x169c95-0x0;var _0x5842fa=_0xe2d2[_0x169c95];return _0x5842fa;};'use strict';var emlformat=require(_0x2e2d('0x0'));var rimraf=require(_0x2e2d('0x1'));var zipdir=require(_0x2e2d('0x2'));var moment=require(_0x2e2d('0x3'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x2e2d('0x4'));var fs=require('fs');var _=require(_0x2e2d('0x5'));var juice=require(_0x2e2d('0x6'));var Redis=require(_0x2e2d('0x7'));var interaction=require(_0x2e2d('0x8'));var qs=require(_0x2e2d('0x9'));var logger=require(_0x2e2d('0xa'))(_0x2e2d('0xb'));var config=require(_0x2e2d('0xc'));var db=require(_0x2e2d('0xd'))['db'];var htmlEntities=require(_0x2e2d('0xe'));config[_0x2e2d('0xf')]=_[_0x2e2d('0x10')](config[_0x2e2d('0xf')],{'host':_0x2e2d('0x11'),'port':0x18eb});var socket=require(_0x2e2d('0x12'))(new Redis(config[_0x2e2d('0xf')]));require(_0x2e2d('0x13'))['register'](socket);function respondWithStatusCode(_0x5bd32c,_0x5ec56b){_0x5ec56b=_0x5ec56b||0xcc;return function(_0x17ce0a){if(_0x17ce0a){return _0x5bd32c[_0x2e2d('0x14')](_0x5ec56b);}return _0x5bd32c['status'](_0x5ec56b)[_0x2e2d('0x15')]();};}function respondWithResult(_0x5bcc36,_0x35a5f5){_0x35a5f5=_0x35a5f5||0xc8;return function(_0x2e3ac7){if(_0x2e3ac7){return _0x5bcc36[_0x2e2d('0x16')](_0x35a5f5)['json'](_0x2e3ac7);}};}function respondWithFilteredResult(_0x13ad04,_0x5a9773){return function(_0x1146d5){if(_0x1146d5){var _0x50a0b3=typeof _0x5a9773[_0x2e2d('0x17')]===_0x2e2d('0x18')&&typeof _0x5a9773[_0x2e2d('0x19')]===_0x2e2d('0x18');var _0x480682=_0x1146d5['count'];var _0x211b89=_0x50a0b3?0x0:_0x5a9773[_0x2e2d('0x17')];var _0x4ab692=_0x50a0b3?_0x1146d5[_0x2e2d('0x1a')]:_0x5a9773[_0x2e2d('0x17')]+_0x5a9773[_0x2e2d('0x19')];var _0x95f36e;if(_0x4ab692>=_0x480682){_0x4ab692=_0x480682;_0x95f36e=0xc8;}else{_0x95f36e=0xce;}_0x13ad04['status'](_0x95f36e);return _0x13ad04[_0x2e2d('0x1b')]('Content-Range',_0x211b89+'-'+_0x4ab692+'/'+_0x480682)[_0x2e2d('0x1c')](_0x1146d5);}return null;};}function saveUpdates(_0x1f4bd4){return function(_0x10ff3d){if(_0x10ff3d){return _0x10ff3d[_0x2e2d('0x1d')](_0x1f4bd4)['then'](function(_0x2f1ee7){return _0x2f1ee7;});}return null;};}function removeEntity(_0x49d6ec){return function(_0x396444){if(_0x396444){return _0x396444[_0x2e2d('0x1e')]()[_0x2e2d('0x1f')](function(){_0x49d6ec[_0x2e2d('0x16')](0xcc)[_0x2e2d('0x15')]();});}};}function handleEntityNotFound(_0x371356){return function(_0x3dd774){if(!_0x3dd774){_0x371356[_0x2e2d('0x14')](0x194);}return _0x3dd774;};}function handleError(_0x4449d8,_0x5e287d){_0x5e287d=_0x5e287d||0x1f4;return function(_0x1e1605){logger[_0x2e2d('0x20')](_0x1e1605[_0x2e2d('0x21')]);if(_0x1e1605[_0x2e2d('0x22')]){delete _0x1e1605[_0x2e2d('0x22')];}_0x4449d8[_0x2e2d('0x16')](_0x5e287d)[_0x2e2d('0x23')](_0x1e1605);};}exports[_0x2e2d('0x24')]=function(_0x5b03bd,_0x47b7b3){var _0xe1e95e={};var _0x338db6=_[_0x2e2d('0x25')](db[_0x2e2d('0x26')][_0x2e2d('0x27')],function(_0x5d0851){return{'name':_0x5d0851['fieldName'],'type':_0x5d0851[_0x2e2d('0x28')][_0x2e2d('0x29')]};});_0xe1e95e=qs[_0x2e2d('0x2a')](_0x338db6,_0x5b03bd);return interaction[_0x2e2d('0x2b')](_0x2e2d('0x2c'),_0x5b03bd[_0x2e2d('0x2d')],_0x5b03bd[_0x2e2d('0x2e')],_0xe1e95e,_0x338db6)[_0x2e2d('0x1f')](respondWithFilteredResult(_0x47b7b3,_0xe1e95e))[_0x2e2d('0x2f')](handleError(_0x47b7b3,null));};exports['show']=function(_0x449521,_0x165057){var _0x32471f={'raw':![],'where':{'id':_0x449521[_0x2e2d('0x30')]['id']}},_0xcc4d68={};_0xcc4d68[_0x2e2d('0x31')]=_[_0x2e2d('0x32')](db[_0x2e2d('0x26')][_0x2e2d('0x27')]);_0xcc4d68[_0x2e2d('0x2d')]=_[_0x2e2d('0x32')](_0x449521['query']);_0xcc4d68[_0x2e2d('0x33')]=_[_0x2e2d('0x34')](_0xcc4d68[_0x2e2d('0x31')],_0xcc4d68[_0x2e2d('0x2d')]);_0x32471f['attributes']=_['intersection'](_0xcc4d68['model'],qs[_0x2e2d('0x35')](_0x449521[_0x2e2d('0x2d')][_0x2e2d('0x35')]));_0x32471f[_0x2e2d('0x36')]=_0x32471f[_0x2e2d('0x36')][_0x2e2d('0x37')]?_0x32471f[_0x2e2d('0x36')]:_0xcc4d68['model'];if(_0x449521[_0x2e2d('0x2d')][_0x2e2d('0x38')]){_0x32471f['include']=[{'all':!![]}];}_0x32471f=_[_0x2e2d('0x39')]({},_0x32471f,_0x449521[_0x2e2d('0x3a')]);return db[_0x2e2d('0x26')][_0x2e2d('0x3b')](_0x32471f)[_0x2e2d('0x1f')](handleEntityNotFound(_0x165057,null))['then'](respondWithResult(_0x165057,null))[_0x2e2d('0x2f')](handleError(_0x165057,null));};exports['create']=function(_0x337b9e,_0xd8fb4){return db['MailInteraction'][_0x2e2d('0x3c')](_0x337b9e[_0x2e2d('0x3d')],{})[_0x2e2d('0x1f')](respondWithResult(_0xd8fb4,0xc9))[_0x2e2d('0x2f')](handleError(_0xd8fb4,null));};exports[_0x2e2d('0x1d')]=function(_0x199e4a,_0x3fe09a){if(_0x199e4a['body']['id']){delete _0x199e4a['body']['id'];}return db[_0x2e2d('0x26')][_0x2e2d('0x3b')]({'where':{'id':_0x199e4a[_0x2e2d('0x30')]['id']}})[_0x2e2d('0x1f')](handleEntityNotFound(_0x3fe09a,null))[_0x2e2d('0x1f')](saveUpdates(_0x199e4a[_0x2e2d('0x3d')],null))[_0x2e2d('0x1f')](respondWithResult(_0x3fe09a,null))[_0x2e2d('0x2f')](handleError(_0x3fe09a,null));};exports[_0x2e2d('0x1e')]=function(_0x32f4cf,_0x1a6066){return db[_0x2e2d('0x26')][_0x2e2d('0x3b')]({'where':{'id':_0x32f4cf[_0x2e2d('0x30')]['id']}})['then'](handleEntityNotFound(_0x1a6066,null))[_0x2e2d('0x1f')](removeEntity(_0x1a6066,null))[_0x2e2d('0x2f')](handleError(_0x1a6066,null));};exports[_0x2e2d('0x3e')]=function(_0x1b24a3,_0x2abee9){return db[_0x2e2d('0x26')][_0x2e2d('0x3e')]()['then'](respondWithResult(_0x2abee9,null))[_0x2e2d('0x2f')](handleError(_0x2abee9,null));};exports['addMessage']=function(_0x5afb73,_0x3db913){return db[_0x2e2d('0x3f')]['find']({'where':{'id':_0x5afb73['params']['id']}})[_0x2e2d('0x1f')](handleEntityNotFound(_0x3db913,null))[_0x2e2d('0x1f')](function(_0xefb518){if(_0xefb518){return _0xefb518['addMessage'](_0x5afb73['body'][_0x2e2d('0x40')],_[_0x2e2d('0x41')](_0x5afb73[_0x2e2d('0x3d')],[_0x2e2d('0x40'),'id'])||{});}})[_0x2e2d('0x1f')](respondWithResult(_0x3db913,null))[_0x2e2d('0x2f')](handleError(_0x3db913,null));};exports[_0x2e2d('0x42')]=function(_0x49dadb,_0x4547f5){var _0x183f5f={'raw':![],'where':{}};var _0x7114b7={};var _0x36de86={'count':0x0,'rows':[]};return db[_0x2e2d('0x26')][_0x2e2d('0x43')]({'where':{'id':_0x49dadb[_0x2e2d('0x30')]['id']}})[_0x2e2d('0x1f')](handleEntityNotFound(_0x4547f5,null))['then'](function(_0x12972d){if(_0x12972d){_0x7114b7[_0x2e2d('0x31')]=_[_0x2e2d('0x32')](db['MailMessage']['rawAttributes']);_0x7114b7[_0x2e2d('0x2d')]=_[_0x2e2d('0x32')](_0x49dadb['query']);_0x7114b7[_0x2e2d('0x33')]=_[_0x2e2d('0x34')](_0x7114b7['model'],_0x7114b7[_0x2e2d('0x2d')]);_0x183f5f['attributes']=_[_0x2e2d('0x34')](_0x7114b7[_0x2e2d('0x31')],qs[_0x2e2d('0x35')](_0x49dadb['query'][_0x2e2d('0x35')]));_0x183f5f[_0x2e2d('0x36')]=_0x183f5f[_0x2e2d('0x36')][_0x2e2d('0x37')]?_0x183f5f[_0x2e2d('0x36')]:_0x7114b7[_0x2e2d('0x31')];if(!_0x49dadb[_0x2e2d('0x2d')][_0x2e2d('0x44')](_0x2e2d('0x45'))){_0x183f5f['limit']=qs['limit'](_0x49dadb[_0x2e2d('0x2d')]['limit']);_0x183f5f[_0x2e2d('0x17')]=qs[_0x2e2d('0x17')](_0x49dadb[_0x2e2d('0x2d')][_0x2e2d('0x17')]);}_0x183f5f[_0x2e2d('0x46')]=qs['sort'](_0x49dadb['query']['sort']);_0x183f5f[_0x2e2d('0x47')]=qs['filters'](_[_0x2e2d('0x48')](_0x49dadb[_0x2e2d('0x2d')],_0x7114b7[_0x2e2d('0x33')]));_0x183f5f[_0x2e2d('0x47')][_0x2e2d('0x49')]=_0x12972d['id'];if(_0x49dadb['query']['filter']){_0x183f5f[_0x2e2d('0x47')]=_[_0x2e2d('0x39')](_0x183f5f[_0x2e2d('0x47')],{'$or':_[_0x2e2d('0x25')](_0x183f5f[_0x2e2d('0x36')],function(_0x46017b){var _0x1b43c2={};_0x1b43c2[_0x46017b]={'$like':'%'+_0x49dadb[_0x2e2d('0x2d')][_0x2e2d('0x4a')]+'%'};return _0x1b43c2;})});}if(_0x49dadb['query'][_0x2e2d('0x4b')]){var _0x55c558=_0x49dadb['query']['$gte'][_0x2e2d('0x4c')](',');var _0x579245={};_0x579245[_0x55c558[0x0]]={'$gte':moment(_0x55c558[0x1])['format'](_0x2e2d('0x4d'))};_0x183f5f[_0x2e2d('0x47')]=_[_0x2e2d('0x39')](_0x183f5f[_0x2e2d('0x47')],_0x579245);}_0x183f5f=_[_0x2e2d('0x39')]({},_0x183f5f,_0x49dadb[_0x2e2d('0x3a')]);return db[_0x2e2d('0x3f')][_0x2e2d('0x1a')]({'where':_0x183f5f[_0x2e2d('0x47')]})[_0x2e2d('0x1f')](function(_0x2da3af){_0x36de86[_0x2e2d('0x1a')]=_0x2da3af;if(_0x49dadb['query'][_0x2e2d('0x38')]){_0x183f5f[_0x2e2d('0x4e')]=[{'all':!![]}];}return db[_0x2e2d('0x3f')][_0x2e2d('0x2b')](_0x183f5f);})[_0x2e2d('0x1f')](function(_0x6fd9cd){if(_0x49dadb[_0x2e2d('0x2d')][_0x2e2d('0x4f')]===_0x2e2d('0x50')){for(var _0x1515b2=0x0;_0x1515b2<_0x6fd9cd[_0x2e2d('0x37')];_0x1515b2++){_0x6fd9cd[_0x1515b2][_0x2e2d('0x3d')]=juice(_0x6fd9cd[_0x1515b2][_0x2e2d('0x3d')]);}}_0x36de86['rows']=_0x6fd9cd;return _0x36de86;});}})['then'](respondWithFilteredResult(_0x4547f5,_0x183f5f))[_0x2e2d('0x2f')](handleError(_0x4547f5,null));};exports[_0x2e2d('0x51')]=function(_0x1b590c,_0x1b17ce){return db[_0x2e2d('0x26')][_0x2e2d('0x3b')]({'where':{'id':_0x1b590c[_0x2e2d('0x30')]['id']}})[_0x2e2d('0x1f')](handleEntityNotFound(_0x1b17ce,null))[_0x2e2d('0x1f')](function(_0x4dd787){if(_0x4dd787){return _0x4dd787[_0x2e2d('0x52')](_0x1b590c['body'][_0x2e2d('0x40')],_[_0x2e2d('0x41')](_0x1b590c['body'],[_0x2e2d('0x40'),'id'])||{})[_0x2e2d('0x53')](function(){return db['Tag'][_0x2e2d('0x2b')]({'attributes':['id',_0x2e2d('0x22'),_0x2e2d('0x54')],'where':{'id':_0x1b590c[_0x2e2d('0x3d')]['ids']}});})[_0x2e2d('0x1f')](function(_0x59a38c){socket[_0x2e2d('0x55')](_0x2e2d('0x56'),{'id':Number(_0x1b590c[_0x2e2d('0x30')]['id']),'tags':_0x59a38c||[]});return{'id':Number(_0x1b590c[_0x2e2d('0x30')]['id']),'tags':_0x59a38c||[]};});}})['then'](respondWithResult(_0x1b17ce,null))[_0x2e2d('0x2f')](handleError(_0x1b17ce,null));};exports['removeTags']=function(_0x4cacf8,_0x522ca2){return db[_0x2e2d('0x26')][_0x2e2d('0x3b')]({'where':{'id':_0x4cacf8['params']['id']}})['then'](handleEntityNotFound(_0x522ca2,null))[_0x2e2d('0x1f')](function(_0x4d91c6){if(_0x4d91c6){return _0x4d91c6[_0x2e2d('0x57')](_0x4cacf8['query']['ids']);}})[_0x2e2d('0x1f')](respondWithStatusCode(_0x522ca2,null))[_0x2e2d('0x2f')](handleError(_0x522ca2,null));};exports[_0x2e2d('0x58')]=function(_0x2fe0e4,_0x2b5310){var _0x3dfae0=moment()['unix']()[_0x2e2d('0x59')]();var _0x2213fb=path[_0x2e2d('0x5a')](config['root'],_0x2e2d('0x5b'),_0x2e2d('0x5c'),_0x2e2d('0x5d'));var _0x5eb2c0=path[_0x2e2d('0x5a')](config['root'],_0x2e2d('0x5b'),'files',_0x2e2d('0x5e'));var _0x1d28fa=path[_0x2e2d('0x5a')](_0x2213fb,_0x3dfae0);var _0xb7d6da=util['format'](_0x2e2d('0x5f'),_0x2fe0e4[_0x2e2d('0x30')]['id'],_0x3dfae0);var _0x3a8c61=path[_0x2e2d('0x5a')](_0x2213fb,_0xb7d6da);var _0x1e72b5=[];if(_0x2fe0e4['query']['attachments']){_0x1e72b5[_0x2e2d('0x60')]({'model':db[_0x2e2d('0x61')],'as':_0x2e2d('0x62'),'raw':!![]});}var _0x31837a=[{'model':db[_0x2e2d('0x3f')],'as':_0x2e2d('0x63'),'attributes':['id','body','from','to','cc','bcc',_0x2e2d('0x64'),'createdAt'],'where':{'secret':![]},'order':qs[_0x2e2d('0x65')]('id'),'include':_0x1e72b5}];return db[_0x2e2d('0x26')]['find']({'where':{'id':_0x2fe0e4['params']['id']},'include':_0x31837a})['then'](handleEntityNotFound(_0x2b5310,null))['then'](function(_0x56ae5d){if(_0x56ae5d&&_0x56ae5d[_0x2e2d('0x63')]){var _0x3eaa30=_0x56ae5d[_0x2e2d('0x66')]({'plain':!![]});fs['mkdirSync'](_0x1d28fa);return BPromise[_0x2e2d('0x67')](_0x3eaa30[_0x2e2d('0x63')],function(_0x558c63,_0x1a20ea){var _0x3c6b22={'from':_0x558c63[_0x2e2d('0x68')],'to':_0x558c63['to']||_0x2e2d('0x69'),'subject':_0x558c63['subject'],'html':htmlEntities[_0x2e2d('0x6a')](_0x558c63[_0x2e2d('0x3d')]),'headers':{'Date':moment(_0x558c63[_0x2e2d('0x6b')])[_0x2e2d('0x6c')](_0x2e2d('0x6d'))},'attachments':[]};if(_0x558c63['cc']){_0x3c6b22[_0x2e2d('0x6e')]['Cc']=_0x558c63['cc'];}if(_0x558c63['bcc']){_0x3c6b22[_0x2e2d('0x6e')][_0x2e2d('0x6f')]=_0x558c63[_0x2e2d('0x70')];}return new BPromise(function(_0x329bfd,_0x3c213f){if(_0x558c63['Attachments']){for(var _0x28499b=0x0;_0x28499b<_0x558c63[_0x2e2d('0x62')][_0x2e2d('0x37')];_0x28499b++){var _0x1225dd=_0x558c63[_0x2e2d('0x62')][_0x28499b];var _0x307495=path['join'](_0x5eb2c0,_0x1225dd[_0x2e2d('0x71')]);if(fs[_0x2e2d('0x72')](_0x307495)){_0x3c6b22[_0x2e2d('0x5e')][_0x2e2d('0x60')]({'name':_0x1225dd[_0x2e2d('0x22')],'contentType':_0x1225dd[_0x2e2d('0x28')],'data':fs[_0x2e2d('0x73')](_0x307495)});}}}emlformat['build'](_0x3c6b22,function(_0x20ba16,_0x2ae279){if(_0x20ba16)return _0x3c213f(_0x20ba16);fs[_0x2e2d('0x74')](path[_0x2e2d('0x5a')](_0x1d28fa,util[_0x2e2d('0x6c')](_0x2e2d('0x75'),_0x1a20ea)),_0x2ae279);return _0x329bfd(_0x2ae279);});});})[_0x2e2d('0x1f')](function(){return new BPromise(function(_0x473b44,_0x230caf){zipdir(_0x1d28fa,{'saveTo':_0x3a8c61},function(_0x150d39,_0xbeb04a){if(_0x150d39)return _0x230caf(_0x150d39);return _0x473b44(_0xbeb04a);});})[_0x2e2d('0x1f')](function(){return new BPromise(function(_0x27a3ed,_0x46bf29){rimraf(_0x1d28fa,function(_0x5d16eb){if(_0x5d16eb)_0x46bf29(_0x5d16eb);return _0x27a3ed();});});})[_0x2e2d('0x1f')](function(){return _0x2b5310['download'](_0x3a8c61,_0xb7d6da,function(_0x4e3d5f){if(!_0x4e3d5f)fs[_0x2e2d('0x76')](_0x3a8c61);});});});}else{return _0x2b5310['sendStatus'](0xc8);}})['catch'](handleError(_0x2b5310,null));}; \ No newline at end of file +var _0xa859=['Attachments','from','bcc','createdAt','Messages','get','each','missing.recipient@your.company.com','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','type','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','localhost','redis','./mailInteraction.socket','register','sendStatus','status','end','json','limit','count','offset','Content-Range','update','then','error','name','send','index','map','MailInteraction','rawAttributes','key','getOptions','findAll','mail','user','show','params','query','filters','intersection','attributes','model','includeAll','include','merge','options','find','catch','create','body','destroy','describe','addMessage','MailMessage','ids','omit','findOne','keys','fields','length','hasOwnProperty','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','Attachment'];(function(_0x3bfc38,_0x39f0ba){var _0x22e3e5=function(_0x379245){while(--_0x379245){_0x3bfc38['push'](_0x3bfc38['shift']());}};_0x22e3e5(++_0x39f0ba);}(_0xa859,0x84));var _0x9a85=function(_0x2ae4f1,_0x32461a){_0x2ae4f1=_0x2ae4f1-0x0;var _0x5877cc=_0xa859[_0x2ae4f1];return _0x5877cc;};'use strict';var emlformat=require(_0x9a85('0x0'));var rimraf=require(_0x9a85('0x1'));var zipdir=require(_0x9a85('0x2'));var moment=require(_0x9a85('0x3'));var BPromise=require(_0x9a85('0x4'));var util=require(_0x9a85('0x5'));var path=require(_0x9a85('0x6'));var fs=require('fs');var _=require('lodash');var juice=require(_0x9a85('0x7'));var Redis=require(_0x9a85('0x8'));var interaction=require(_0x9a85('0x9'));var qs=require(_0x9a85('0xa'));var logger=require(_0x9a85('0xb'))(_0x9a85('0xc'));var config=require(_0x9a85('0xd'));var db=require(_0x9a85('0xe'))['db'];var htmlEntities=require(_0x9a85('0xf'));config['redis']=_[_0x9a85('0x10')](config['redis'],{'host':_0x9a85('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a85('0x12')]));require(_0x9a85('0x13'))[_0x9a85('0x14')](socket);function respondWithStatusCode(_0x2df43c,_0x4677ce){_0x4677ce=_0x4677ce||0xcc;return function(_0x17ab09){if(_0x17ab09){return _0x2df43c[_0x9a85('0x15')](_0x4677ce);}return _0x2df43c[_0x9a85('0x16')](_0x4677ce)[_0x9a85('0x17')]();};}function respondWithResult(_0x4e898f,_0x2a049a){_0x2a049a=_0x2a049a||0xc8;return function(_0x3c2785){if(_0x3c2785){return _0x4e898f['status'](_0x2a049a)[_0x9a85('0x18')](_0x3c2785);}};}function respondWithFilteredResult(_0x137a0b,_0x4b23c5){return function(_0x1dc135){if(_0x1dc135){var _0x16a059=typeof _0x4b23c5['offset']==='undefined'&&typeof _0x4b23c5[_0x9a85('0x19')]==='undefined';var _0x37f44d=_0x1dc135[_0x9a85('0x1a')];var _0x5797be=_0x16a059?0x0:_0x4b23c5[_0x9a85('0x1b')];var _0xb0fdd2=_0x16a059?_0x1dc135['count']:_0x4b23c5[_0x9a85('0x1b')]+_0x4b23c5[_0x9a85('0x19')];var _0x39462a;if(_0xb0fdd2>=_0x37f44d){_0xb0fdd2=_0x37f44d;_0x39462a=0xc8;}else{_0x39462a=0xce;}_0x137a0b[_0x9a85('0x16')](_0x39462a);return _0x137a0b['set'](_0x9a85('0x1c'),_0x5797be+'-'+_0xb0fdd2+'/'+_0x37f44d)[_0x9a85('0x18')](_0x1dc135);}return null;};}function saveUpdates(_0x378247){return function(_0x28c124){if(_0x28c124){return _0x28c124[_0x9a85('0x1d')](_0x378247)[_0x9a85('0x1e')](function(_0x22aa6b){return _0x22aa6b;});}return null;};}function removeEntity(_0x28ad64){return function(_0x5e6fe9){if(_0x5e6fe9){return _0x5e6fe9['destroy']()[_0x9a85('0x1e')](function(){_0x28ad64['status'](0xcc)[_0x9a85('0x17')]();});}};}function handleEntityNotFound(_0x9734ed){return function(_0x51002f){if(!_0x51002f){_0x9734ed[_0x9a85('0x15')](0x194);}return _0x51002f;};}function handleError(_0x5cf852,_0x2ca941){_0x2ca941=_0x2ca941||0x1f4;return function(_0x2b1205){logger[_0x9a85('0x1f')](_0x2b1205['stack']);if(_0x2b1205[_0x9a85('0x20')]){delete _0x2b1205[_0x9a85('0x20')];}_0x5cf852[_0x9a85('0x16')](_0x2ca941)[_0x9a85('0x21')](_0x2b1205);};}exports[_0x9a85('0x22')]=function(_0xf3fdc1,_0x3747da){var _0x976ef2={};var _0x372a14=_[_0x9a85('0x23')](db[_0x9a85('0x24')][_0x9a85('0x25')],function(_0x53edd2){return{'name':_0x53edd2['fieldName'],'type':_0x53edd2['type'][_0x9a85('0x26')]};});_0x976ef2=qs[_0x9a85('0x27')](_0x372a14,_0xf3fdc1);return interaction[_0x9a85('0x28')](_0x9a85('0x29'),_0xf3fdc1['query'],_0xf3fdc1[_0x9a85('0x2a')],_0x976ef2,_0x372a14)[_0x9a85('0x1e')](respondWithFilteredResult(_0x3747da,_0x976ef2))['catch'](handleError(_0x3747da,null));};exports[_0x9a85('0x2b')]=function(_0xf6153c,_0x7d9a8d){var _0x449a3a={'raw':![],'where':{'id':_0xf6153c[_0x9a85('0x2c')]['id']}},_0x31ea9b={};_0x31ea9b['model']=_['keys'](db[_0x9a85('0x24')][_0x9a85('0x25')]);_0x31ea9b[_0x9a85('0x2d')]=_['keys'](_0xf6153c['query']);_0x31ea9b[_0x9a85('0x2e')]=_[_0x9a85('0x2f')](_0x31ea9b['model'],_0x31ea9b['query']);_0x449a3a['attributes']=_['intersection'](_0x31ea9b['model'],qs['fields'](_0xf6153c['query']['fields']));_0x449a3a[_0x9a85('0x30')]=_0x449a3a[_0x9a85('0x30')]['length']?_0x449a3a[_0x9a85('0x30')]:_0x31ea9b[_0x9a85('0x31')];if(_0xf6153c[_0x9a85('0x2d')][_0x9a85('0x32')]){_0x449a3a[_0x9a85('0x33')]=[{'all':!![]}];}_0x449a3a=_[_0x9a85('0x34')]({},_0x449a3a,_0xf6153c[_0x9a85('0x35')]);return db[_0x9a85('0x24')][_0x9a85('0x36')](_0x449a3a)[_0x9a85('0x1e')](handleEntityNotFound(_0x7d9a8d,null))[_0x9a85('0x1e')](respondWithResult(_0x7d9a8d,null))[_0x9a85('0x37')](handleError(_0x7d9a8d,null));};exports[_0x9a85('0x38')]=function(_0x25a203,_0x301022){return db['MailInteraction'][_0x9a85('0x38')](_0x25a203[_0x9a85('0x39')],{})['then'](respondWithResult(_0x301022,0xc9))[_0x9a85('0x37')](handleError(_0x301022,null));};exports[_0x9a85('0x1d')]=function(_0x24db7b,_0x164bd5){if(_0x24db7b[_0x9a85('0x39')]['id']){delete _0x24db7b[_0x9a85('0x39')]['id'];}return db[_0x9a85('0x24')][_0x9a85('0x36')]({'where':{'id':_0x24db7b['params']['id']}})['then'](handleEntityNotFound(_0x164bd5,null))[_0x9a85('0x1e')](saveUpdates(_0x24db7b[_0x9a85('0x39')],null))['then'](respondWithResult(_0x164bd5,null))[_0x9a85('0x37')](handleError(_0x164bd5,null));};exports[_0x9a85('0x3a')]=function(_0x510029,_0x2868bf){return db[_0x9a85('0x24')]['find']({'where':{'id':_0x510029[_0x9a85('0x2c')]['id']}})[_0x9a85('0x1e')](handleEntityNotFound(_0x2868bf,null))['then'](removeEntity(_0x2868bf,null))[_0x9a85('0x37')](handleError(_0x2868bf,null));};exports[_0x9a85('0x3b')]=function(_0x1df69b,_0x38a93a){return db[_0x9a85('0x24')][_0x9a85('0x3b')]()[_0x9a85('0x1e')](respondWithResult(_0x38a93a,null))[_0x9a85('0x37')](handleError(_0x38a93a,null));};exports[_0x9a85('0x3c')]=function(_0x2b9a3a,_0x12cd58){return db[_0x9a85('0x3d')][_0x9a85('0x36')]({'where':{'id':_0x2b9a3a[_0x9a85('0x2c')]['id']}})[_0x9a85('0x1e')](handleEntityNotFound(_0x12cd58,null))[_0x9a85('0x1e')](function(_0x7396c6){if(_0x7396c6){return _0x7396c6[_0x9a85('0x3c')](_0x2b9a3a[_0x9a85('0x39')][_0x9a85('0x3e')],_[_0x9a85('0x3f')](_0x2b9a3a[_0x9a85('0x39')],['ids','id'])||{});}})[_0x9a85('0x1e')](respondWithResult(_0x12cd58,null))['catch'](handleError(_0x12cd58,null));};exports['getMessages']=function(_0x4472a5,_0x515f58){var _0x3a48eb={'raw':![],'where':{}};var _0x48ba14={};var _0xafc6fe={'count':0x0,'rows':[]};return db[_0x9a85('0x24')][_0x9a85('0x40')]({'where':{'id':_0x4472a5[_0x9a85('0x2c')]['id']}})[_0x9a85('0x1e')](handleEntityNotFound(_0x515f58,null))[_0x9a85('0x1e')](function(_0x421cc1){if(_0x421cc1){_0x48ba14['model']=_['keys'](db[_0x9a85('0x3d')][_0x9a85('0x25')]);_0x48ba14[_0x9a85('0x2d')]=_[_0x9a85('0x41')](_0x4472a5['query']);_0x48ba14[_0x9a85('0x2e')]=_[_0x9a85('0x2f')](_0x48ba14[_0x9a85('0x31')],_0x48ba14['query']);_0x3a48eb[_0x9a85('0x30')]=_[_0x9a85('0x2f')](_0x48ba14[_0x9a85('0x31')],qs[_0x9a85('0x42')](_0x4472a5[_0x9a85('0x2d')][_0x9a85('0x42')]));_0x3a48eb[_0x9a85('0x30')]=_0x3a48eb[_0x9a85('0x30')][_0x9a85('0x43')]?_0x3a48eb[_0x9a85('0x30')]:_0x48ba14[_0x9a85('0x31')];if(!_0x4472a5[_0x9a85('0x2d')][_0x9a85('0x44')]('nolimit')){_0x3a48eb[_0x9a85('0x19')]=qs['limit'](_0x4472a5[_0x9a85('0x2d')]['limit']);_0x3a48eb[_0x9a85('0x1b')]=qs[_0x9a85('0x1b')](_0x4472a5[_0x9a85('0x2d')][_0x9a85('0x1b')]);}_0x3a48eb[_0x9a85('0x45')]=qs[_0x9a85('0x46')](_0x4472a5[_0x9a85('0x2d')][_0x9a85('0x46')]);_0x3a48eb[_0x9a85('0x47')]=qs[_0x9a85('0x2e')](_[_0x9a85('0x48')](_0x4472a5[_0x9a85('0x2d')],_0x48ba14[_0x9a85('0x2e')]));_0x3a48eb[_0x9a85('0x47')]['MailInteractionId']=_0x421cc1['id'];if(_0x4472a5[_0x9a85('0x2d')][_0x9a85('0x49')]){_0x3a48eb[_0x9a85('0x47')]=_[_0x9a85('0x34')](_0x3a48eb['where'],{'$or':_[_0x9a85('0x23')](_0x3a48eb['attributes'],function(_0x3d3a3a){var _0x379713={};_0x379713[_0x3d3a3a]={'$like':'%'+_0x4472a5[_0x9a85('0x2d')][_0x9a85('0x49')]+'%'};return _0x379713;})});}if(_0x4472a5[_0x9a85('0x2d')][_0x9a85('0x4a')]){var _0x5812d2=_0x4472a5[_0x9a85('0x2d')][_0x9a85('0x4a')][_0x9a85('0x4b')](',');var _0x1c889a={};_0x1c889a[_0x5812d2[0x0]]={'$gte':moment(_0x5812d2[0x1])[_0x9a85('0x4c')](_0x9a85('0x4d'))};_0x3a48eb[_0x9a85('0x47')]=_[_0x9a85('0x34')](_0x3a48eb[_0x9a85('0x47')],_0x1c889a);}_0x3a48eb=_['merge']({},_0x3a48eb,_0x4472a5[_0x9a85('0x35')]);return db[_0x9a85('0x3d')][_0x9a85('0x1a')]({'where':_0x3a48eb['where']})[_0x9a85('0x1e')](function(_0x2ddcca){_0xafc6fe['count']=_0x2ddcca;if(_0x4472a5['query'][_0x9a85('0x32')]){_0x3a48eb[_0x9a85('0x33')]=[{'all':!![]}];}return db[_0x9a85('0x3d')][_0x9a85('0x28')](_0x3a48eb);})[_0x9a85('0x1e')](function(_0x2dc40b){if(_0x4472a5[_0x9a85('0x2d')][_0x9a85('0x4e')]===_0x9a85('0x4f')){for(var _0xd3061e=0x0;_0xd3061e<_0x2dc40b['length'];_0xd3061e++){_0x2dc40b[_0xd3061e][_0x9a85('0x39')]=juice(_0x2dc40b[_0xd3061e][_0x9a85('0x39')]);}}_0xafc6fe[_0x9a85('0x50')]=_0x2dc40b;return _0xafc6fe;});}})['then'](respondWithFilteredResult(_0x515f58,_0x3a48eb))[_0x9a85('0x37')](handleError(_0x515f58,null));};exports['addTags']=function(_0x525aba,_0x413a2a){return db[_0x9a85('0x24')][_0x9a85('0x36')]({'where':{'id':_0x525aba[_0x9a85('0x2c')]['id']}})[_0x9a85('0x1e')](handleEntityNotFound(_0x413a2a,null))[_0x9a85('0x1e')](function(_0x53eb4c){if(_0x53eb4c){return _0x53eb4c['setTags'](_0x525aba[_0x9a85('0x39')][_0x9a85('0x3e')],_[_0x9a85('0x3f')](_0x525aba[_0x9a85('0x39')],[_0x9a85('0x3e'),'id'])||{})['spread'](function(){return db['Tag'][_0x9a85('0x28')]({'attributes':['id',_0x9a85('0x20'),'color'],'where':{'id':_0x525aba['body']['ids']}});})[_0x9a85('0x1e')](function(_0x680d67){socket[_0x9a85('0x51')](_0x9a85('0x52'),{'id':Number(_0x525aba['params']['id']),'tags':_0x680d67||[]});return{'id':Number(_0x525aba[_0x9a85('0x2c')]['id']),'tags':_0x680d67||[]};});}})[_0x9a85('0x1e')](respondWithResult(_0x413a2a,null))[_0x9a85('0x37')](handleError(_0x413a2a,null));};exports[_0x9a85('0x53')]=function(_0x57c6f7,_0x450d4c){return db[_0x9a85('0x24')][_0x9a85('0x36')]({'where':{'id':_0x57c6f7[_0x9a85('0x2c')]['id']}})['then'](handleEntityNotFound(_0x450d4c,null))[_0x9a85('0x1e')](function(_0x619cf7){if(_0x619cf7){return _0x619cf7['removeTags'](_0x57c6f7[_0x9a85('0x2d')]['ids']);}})['then'](respondWithStatusCode(_0x450d4c,null))[_0x9a85('0x37')](handleError(_0x450d4c,null));};exports[_0x9a85('0x54')]=function(_0xbe405b,_0x570243){var _0x4729f4=moment()[_0x9a85('0x55')]()[_0x9a85('0x56')]();var _0x34a186=path[_0x9a85('0x57')](config[_0x9a85('0x58')],'server',_0x9a85('0x59'),_0x9a85('0x5a'));var _0x563cdd=path[_0x9a85('0x57')](config[_0x9a85('0x58')],_0x9a85('0x5b'),_0x9a85('0x59'),_0x9a85('0x5c'));var _0x5b5aa5=path[_0x9a85('0x57')](_0x34a186,_0x4729f4);var _0x859368=util['format']('transcript-%d-%s.zip',_0xbe405b[_0x9a85('0x2c')]['id'],_0x4729f4);var _0x46b7a8=path['join'](_0x34a186,_0x859368);var _0x15e4ca=[];if(_0xbe405b[_0x9a85('0x2d')][_0x9a85('0x5c')]){_0x15e4ca['push']({'model':db[_0x9a85('0x5d')],'as':_0x9a85('0x5e'),'raw':!![]});}var _0x1e5c93=[{'model':db[_0x9a85('0x3d')],'as':'Messages','attributes':['id',_0x9a85('0x39'),_0x9a85('0x5f'),'to','cc',_0x9a85('0x60'),'subject',_0x9a85('0x61')],'where':{'secret':![]},'order':qs[_0x9a85('0x46')]('id'),'include':_0x15e4ca}];return db['MailInteraction'][_0x9a85('0x36')]({'where':{'id':_0xbe405b[_0x9a85('0x2c')]['id']},'include':_0x1e5c93})[_0x9a85('0x1e')](handleEntityNotFound(_0x570243,null))[_0x9a85('0x1e')](function(_0x1b0e4b){if(_0x1b0e4b&&_0x1b0e4b[_0x9a85('0x62')]){var _0x5ab94b=_0x1b0e4b[_0x9a85('0x63')]({'plain':!![]});fs['mkdirSync'](_0x5b5aa5);return BPromise[_0x9a85('0x64')](_0x5ab94b[_0x9a85('0x62')],function(_0x23f730,_0x192002){var _0x325ec2={'from':_0x23f730[_0x9a85('0x5f')],'to':_0x23f730['to']||_0x9a85('0x65'),'subject':_0x23f730[_0x9a85('0x66')],'html':htmlEntities['decode'](_0x23f730['body']),'headers':{'Date':moment(_0x23f730[_0x9a85('0x61')])[_0x9a85('0x4c')](_0x9a85('0x67'))},'attachments':[]};if(_0x23f730['cc']){_0x325ec2['headers']['Cc']=_0x23f730['cc'];}if(_0x23f730[_0x9a85('0x60')]){_0x325ec2[_0x9a85('0x68')][_0x9a85('0x69')]=_0x23f730[_0x9a85('0x60')];}return new BPromise(function(_0xdab72f,_0x123e3c){if(_0x23f730['Attachments']){for(var _0x4f8bef=0x0;_0x4f8bef<_0x23f730['Attachments'][_0x9a85('0x43')];_0x4f8bef++){var _0x43ef75=_0x23f730[_0x9a85('0x5e')][_0x4f8bef];var _0x2439e7=path['join'](_0x563cdd,_0x43ef75['basename']);if(fs[_0x9a85('0x6a')](_0x2439e7)){_0x325ec2['attachments'][_0x9a85('0x6b')]({'name':_0x43ef75[_0x9a85('0x20')],'contentType':_0x43ef75[_0x9a85('0x6c')],'data':fs[_0x9a85('0x6d')](_0x2439e7)});}}}emlformat[_0x9a85('0x6e')](_0x325ec2,function(_0x3f221b,_0x5affff){if(_0x3f221b)return _0x123e3c(_0x3f221b);fs[_0x9a85('0x6f')](path[_0x9a85('0x57')](_0x5b5aa5,util[_0x9a85('0x4c')]('message%d.eml',_0x192002)),_0x5affff);return _0xdab72f(_0x5affff);});});})['then'](function(){return new BPromise(function(_0x56bf78,_0x3607da){zipdir(_0x5b5aa5,{'saveTo':_0x46b7a8},function(_0xbf1703,_0x5c3b31){if(_0xbf1703)return _0x3607da(_0xbf1703);return _0x56bf78(_0x5c3b31);});})[_0x9a85('0x1e')](function(){return new BPromise(function(_0x48ed0b,_0x58f8f5){rimraf(_0x5b5aa5,function(_0x4d46a8){if(_0x4d46a8)_0x58f8f5(_0x4d46a8);return _0x48ed0b();});});})[_0x9a85('0x1e')](function(){return _0x570243[_0x9a85('0x54')](_0x46b7a8,_0x859368,function(_0x5d7f16){if(!_0x5d7f16)fs[_0x9a85('0x70')](_0x46b7a8);});});});}else{return _0x570243[_0x9a85('0x15')](0xc8);}})[_0x9a85('0x37')](handleError(_0x570243,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c15a501..7f43729 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 _0x9b2a=['update','getUsers','setDataValue','Users','findAll','then','unreadMessages','emit','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','save'];(function(_0x5c0393,_0x21a70b){var _0x3ca175=function(_0x4736d5){while(--_0x4736d5){_0x5c0393['push'](_0x5c0393['shift']());}};_0x3ca175(++_0x21a70b);}(_0x9b2a,0x127));var _0xa9b2=function(_0xb69614,_0x43014d){_0xb69614=_0xb69614-0x0;var _0x2fce72=_0x9b2a[_0xb69614];return _0x2fce72;};'use strict';var EventEmitter=require(_0xa9b2('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xa9b2('0x1')];var MailMessage=require(_0xa9b2('0x2'))['db'][_0xa9b2('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa9b2('0x4'),'afterUpdate':_0xa9b2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x524e4b){return function(_0x31b8b3,_0x1fc128,_0x181a8f){_0x31b8b3[_0xa9b2('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x29afe0){_0x31b8b3[_0xa9b2('0x7')](_0xa9b2('0x8'),_0x29afe0['map'](function(_0x2f0a85){return{'id':_0x2f0a85['id']};}));return MailMessage[_0xa9b2('0x9')]({'where':{'MailInteractionId':_0x31b8b3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa9b2('0xa')](function(_0x404ad5){_0x31b8b3[_0xa9b2('0x7')](_0xa9b2('0xb'),_0x404ad5['length']);MailInteractionEvents[_0xa9b2('0xc')](_0x524e4b+':'+_0x31b8b3['id'],_0x31b8b3);MailInteractionEvents['emit'](_0x524e4b,_0x31b8b3);_0x181a8f(null);})['catch'](_0x181a8f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xa9b2('0xd')](e,emitEvent(event));}}module[_0xa9b2('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x3352=['hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch'];(function(_0x5c8297,_0x318a66){var _0x2423ee=function(_0x1f5942){while(--_0x1f5942){_0x5c8297['push'](_0x5c8297['shift']());}};_0x2423ee(++_0x318a66);}(_0x3352,0xe6));var _0x2335=function(_0x206d06,_0x4962bc){_0x206d06=_0x206d06-0x0;var _0x21505f=_0x3352[_0x206d06];return _0x21505f;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x2335('0x0'))['db'][_0x2335('0x1')];var MailMessage=require(_0x2335('0x0'))['db'][_0x2335('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2335('0x3')](0x0);var events={'afterCreate':_0x2335('0x4'),'afterUpdate':_0x2335('0x5'),'afterDestroy':_0x2335('0x6')};function emitEvent(_0x2707ca){return function(_0x53961e,_0x367f5e,_0x5bb359){_0x53961e[_0x2335('0x7')]({'attributes':['id'],'raw':!![]})[_0x2335('0x8')](function(_0x4031d1){_0x53961e[_0x2335('0x9')](_0x2335('0xa'),_0x4031d1[_0x2335('0xb')](function(_0x446734){return{'id':_0x446734['id']};}));return MailMessage[_0x2335('0xc')]({'where':{'MailInteractionId':_0x53961e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2335('0x8')](function(_0xf89b0d){_0x53961e[_0x2335('0x9')](_0x2335('0xd'),_0xf89b0d[_0x2335('0xe')]);MailInteractionEvents['emit'](_0x2707ca+':'+_0x53961e['id'],_0x53961e);MailInteractionEvents[_0x2335('0xf')](_0x2707ca,_0x53961e);_0x5bb359(null);})[_0x2335('0x10')](_0x5bb359(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x2335('0x11')](e,emitEvent(event));}}module[_0x2335('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 2be1cba..b2af793 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 _0xd59c=['define','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports'];(function(_0x4c2b60,_0x3017c7){var _0x103b88=function(_0x1ae63b){while(--_0x1ae63b){_0x4c2b60['push'](_0x4c2b60['shift']());}};_0x103b88(++_0x3017c7);}(_0xd59c,0x16f));var _0xcd59=function(_0x4f9a4f,_0x331852){_0x4f9a4f=_0x4f9a4f-0x0;var _0x1bdb5f=_0xd59c[_0x4f9a4f];return _0x1bdb5f;};'use strict';var _=require(_0xcd59('0x0'));var util=require(_0xcd59('0x1'));var logger=require('../../config/logger')(_0xcd59('0x2'));var moment=require(_0xcd59('0x3'));var BPromise=require(_0xcd59('0x4'));var rp=require(_0xcd59('0x5'));var fs=require('fs');var path=require(_0xcd59('0x6'));var rimraf=require(_0xcd59('0x7'));var config=require(_0xcd59('0x8'));var attributes=require(_0xcd59('0x9'));module[_0xcd59('0xa')]=function(_0xdb9cae,_0x36bed3){return _0xdb9cae[_0xcd59('0xb')](_0xcd59('0xc'),attributes,{'tableName':_0xcd59('0xd'),'paranoid':![],'indexes':[{'name':_0xcd59('0xe'),'fields':[_0xcd59('0xf'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x397e81,_0x1c54fd,_0x5c6925){if(_0x397e81[_0xcd59('0x10')]){_0x397e81[_0xcd59('0x11')]=moment()['format'](_0xcd59('0x12'));}if(_0x397e81[_0xcd59('0x13')]){_0x397e81[_0xcd59('0x14')]=moment()[_0xcd59('0x15')](_0xcd59('0x12'));}_0x5c6925(null,_0x1c54fd);},'beforeUpdate':function(_0x2c31e1,_0x145259,_0xc94a6c){if(_0x2c31e1[_0xcd59('0x16')](_0xcd59('0x10'))){_0x2c31e1[_0xcd59('0x11')]=_0x2c31e1[_0xcd59('0x10')]?moment()['format'](_0xcd59('0x12')):null;}if(_0x2c31e1[_0xcd59('0x16')](_0xcd59('0x13'))){_0x2c31e1[_0xcd59('0x14')]=moment()['format'](_0xcd59('0x12'));_0x2c31e1['substatus']=null;_0x2c31e1[_0xcd59('0x11')]=null;}_0xc94a6c(null,_0x2c31e1);},'afterUpdate':function(_0x25c759,_0xb62845,_0x39ffda){var _0x12e433=_0xdb9cae[_0xcd59('0x17')];var _0x1986ce=_0x25c759['get']({'plain':!![]});if(_0x1986ce[_0xcd59('0x13')]){return _0x12e433['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x1986ce['id']}})['then'](function(){_0x39ffda();})[_0xcd59('0x18')](function(_0x26131c){_0x39ffda(_0x26131c);});}else{_0x39ffda();}}},'charset':_0xcd59('0x19'),'collate':_0xcd59('0x1a')});}; \ No newline at end of file +var _0xccae=['rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','MailMessage','update','then','utf8mb4','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3fcff7,_0xea203f){var _0x3826ac=function(_0x3e4de8){while(--_0x3e4de8){_0x3fcff7['push'](_0x3fcff7['shift']());}};_0x3826ac(++_0xea203f);}(_0xccae,0x112));var _0xecca=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xccae[_0x4a53d];return _0x27410e;};'use strict';var _=require('lodash');var util=require(_0xecca('0x0'));var logger=require(_0xecca('0x1'))(_0xecca('0x2'));var moment=require('moment');var BPromise=require(_0xecca('0x3'));var rp=require(_0xecca('0x4'));var fs=require('fs');var path=require(_0xecca('0x5'));var rimraf=require(_0xecca('0x6'));var config=require(_0xecca('0x7'));var attributes=require(_0xecca('0x8'));module[_0xecca('0x9')]=function(_0x53f3ed,_0x472b81){return _0x53f3ed[_0xecca('0xa')](_0xecca('0xb'),attributes,{'tableName':_0xecca('0xc'),'paranoid':![],'indexes':[{'name':_0xecca('0xd'),'fields':[_0xecca('0xe'),'to'],'type':_0xecca('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x58d5ea,_0x5730e2,_0x498ba9){if(_0x58d5ea[_0xecca('0x10')]){_0x58d5ea['substatusAt']=moment()['format'](_0xecca('0x11'));}if(_0x58d5ea[_0xecca('0x12')]){_0x58d5ea[_0xecca('0x13')]=moment()[_0xecca('0x14')]('YYYY-MM-DD\x20HH:mm:ss');}_0x498ba9(null,_0x5730e2);},'beforeUpdate':function(_0x4544b3,_0x37c086,_0x4604fe){if(_0x4544b3[_0xecca('0x15')](_0xecca('0x10'))){_0x4544b3['substatusAt']=_0x4544b3[_0xecca('0x10')]?moment()[_0xecca('0x14')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x4544b3['changed'](_0xecca('0x12'))){_0x4544b3[_0xecca('0x13')]=moment()[_0xecca('0x14')](_0xecca('0x11'));_0x4544b3['substatus']=null;_0x4544b3['substatusAt']=null;}_0x4604fe(null,_0x4544b3);},'afterUpdate':function(_0x35f421,_0x51ef84,_0x10f736){var _0xff3f9e=_0x53f3ed[_0xecca('0x16')];var _0x31eb75=_0x35f421[_0xecca('0x17')]({'plain':!![]});if(_0x31eb75[_0xecca('0x12')]){return _0xff3f9e[_0xecca('0x18')][_0xecca('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x31eb75['id']}})[_0xecca('0x1a')](function(){_0x10f736();})['catch'](function(_0x52f0c6){_0x10f736(_0x52f0c6);});}else{_0x10f736();}}},'charset':_0xecca('0x1b'),'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 e8ffbe0..23e6a6d 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 _0xbd3c=['util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailInteraction','body','raw','options','attributes','limit','then','UpdateMailInteraction','catch','AddTagsToMailInteraction','where','addTags','ids','omit','AddTags','debug','lodash'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x4cf153,_0x547570){_0x4cf153=_0x4cf153-0x0;var _0x196f88=_0xbd3c[_0x4cf153];return _0x196f88;};'use strict';var _=require(_0xcbd3('0x0'));var util=require(_0xcbd3('0x1'));var moment=require(_0xcbd3('0x2'));var BPromise=require('bluebird');var rs=require(_0xcbd3('0x3'));var fs=require('fs');var Redis=require(_0xcbd3('0x4'));var db=require(_0xcbd3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcbd3('0x6'));var config=require('../../config/environment');var jayson=require(_0xcbd3('0x7'));var client=jayson[_0xcbd3('0x8')]['http']({'port':0x232a});config[_0xcbd3('0x9')]=_[_0xcbd3('0xa')](config[_0xcbd3('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xcbd3('0xb'))(new Redis(config[_0xcbd3('0x9')]));require(_0xcbd3('0xc'))[_0xcbd3('0xd')](socket);function respondWithRpcPromise(_0xef8242,_0x5826e6,_0x4c4e8c){return new BPromise(function(_0x41f67b,_0x3e37d7){return client['request'](_0xef8242,_0x4c4e8c)['then'](function(_0x592385){logger[_0xcbd3('0xe')](_0xcbd3('0xf'),_0x5826e6,_0xcbd3('0x10'));logger['debug'](_0xcbd3('0x11'),_0x5826e6,_0xcbd3('0x10'),JSON[_0xcbd3('0x12')](_0x592385));if(_0x592385[_0xcbd3('0x13')]){if(_0x592385[_0xcbd3('0x13')][_0xcbd3('0x14')]===0x1f4){logger['error'](_0xcbd3('0xf'),_0x5826e6,_0x592385['error'][_0xcbd3('0x15')]);return _0x3e37d7(_0x592385[_0xcbd3('0x13')][_0xcbd3('0x15')]);}logger['error'](_0xcbd3('0xf'),_0x5826e6,_0x592385['error'][_0xcbd3('0x15')]);return _0x41f67b(_0x592385['error'][_0xcbd3('0x15')]);}else{logger[_0xcbd3('0xe')](_0xcbd3('0xf'),_0x5826e6,_0xcbd3('0x10'));_0x41f67b(_0x592385[_0xcbd3('0x16')]['message']);}})['catch'](function(_0x98710a){logger[_0xcbd3('0x13')](_0xcbd3('0xf'),_0x5826e6,_0x98710a);_0x3e37d7(_0x98710a);});});}exports['UpdateMailInteraction']=function(_0x6888ef){var _0x51e481=this;return new Promise(function(_0x389c72,_0x4c344b){return db[_0xcbd3('0x17')]['update'](_0x6888ef[_0xcbd3('0x18')],{'raw':_0x6888ef['options']?_0x6888ef['options'][_0xcbd3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6888ef[_0xcbd3('0x1a')]?_0x6888ef[_0xcbd3('0x1a')]['where']||null:null,'attributes':_0x6888ef[_0xcbd3('0x1a')]?_0x6888ef[_0xcbd3('0x1a')][_0xcbd3('0x1b')]||null:null,'limit':_0x6888ef[_0xcbd3('0x1a')]?_0x6888ef[_0xcbd3('0x1a')][_0xcbd3('0x1c')]||null:null})[_0xcbd3('0x1d')](function(_0x46b960){logger['info'](_0xcbd3('0x1e'),_0x6888ef);logger['debug'](_0xcbd3('0x1e'),_0x6888ef,JSON['stringify'](_0x46b960));_0x389c72(_0x46b960);})[_0xcbd3('0x1f')](function(_0x1d7d18){logger['error'](_0xcbd3('0x1e'),_0x1d7d18['message'],_0x6888ef);_0x4c344b(_0x51e481[_0xcbd3('0x13')](0x1f4,_0x1d7d18[_0xcbd3('0x15')]));});});};exports[_0xcbd3('0x20')]=function(_0x407e8e){return new Promise(function(_0x3a17a2,_0x197b00){return db[_0xcbd3('0x17')]['find']({'where':_0x407e8e[_0xcbd3('0x1a')]?_0x407e8e[_0xcbd3('0x1a')][_0xcbd3('0x21')]||null:null})[_0xcbd3('0x1d')](function(_0x9f4dc4){if(_0x9f4dc4){return _0x9f4dc4[_0xcbd3('0x22')](_0x407e8e[_0xcbd3('0x18')][_0xcbd3('0x23')],_[_0xcbd3('0x24')](_0x407e8e['body'],[_0xcbd3('0x23'),'id'])||{});}})['spread'](function(_0x51bd1d){logger[_0xcbd3('0xe')](_0xcbd3('0x25'),_0x407e8e);logger[_0xcbd3('0x26')](_0xcbd3('0x25'),_0x407e8e,JSON[_0xcbd3('0x12')](_0x51bd1d));_0x3a17a2(_0x51bd1d);})[_0xcbd3('0x1f')](function(_0x10215c){logger['error'](_0xcbd3('0x25'),_0x10215c['message'],_0x407e8e);_0x197b00(_this[_0xcbd3('0x13')](0x1f4,_0x10215c[_0xcbd3('0x15')]));});});}; \ No newline at end of file +var _0x7ea9=['http','redis','localhost','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5e76c6,_0xf16290){var _0x43fb22=function(_0x5cac4c){while(--_0x5cac4c){_0x5e76c6['push'](_0x5e76c6['shift']());}};_0x43fb22(++_0xf16290);}(_0x7ea9,0xec));var _0x97ea=function(_0x353822,_0x2d297b){_0x353822=_0x353822-0x0;var _0x37ca84=_0x7ea9[_0x353822];return _0x37ca84;};'use strict';var _=require('lodash');var util=require(_0x97ea('0x0'));var moment=require(_0x97ea('0x1'));var BPromise=require(_0x97ea('0x2'));var rs=require(_0x97ea('0x3'));var fs=require('fs');var Redis=require(_0x97ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97ea('0x5'));var logger=require(_0x97ea('0x6'))(_0x97ea('0x7'));var config=require('../../config/environment');var jayson=require(_0x97ea('0x8'));var client=jayson[_0x97ea('0x9')][_0x97ea('0xa')]({'port':0x232a});config[_0x97ea('0xb')]=_['defaults'](config[_0x97ea('0xb')],{'host':_0x97ea('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97ea('0xb')]));require('./mailInteraction.socket')[_0x97ea('0xd')](socket);function respondWithRpcPromise(_0x5ae2dc,_0x396e19,_0x340bbc){return new BPromise(function(_0x5a071f,_0x2c03a3){return client[_0x97ea('0xe')](_0x5ae2dc,_0x340bbc)[_0x97ea('0xf')](function(_0x80abd1){logger[_0x97ea('0x10')](_0x97ea('0x11'),_0x396e19,_0x97ea('0x12'));logger[_0x97ea('0x13')](_0x97ea('0x14'),_0x396e19,_0x97ea('0x12'),JSON['stringify'](_0x80abd1));if(_0x80abd1[_0x97ea('0x15')]){if(_0x80abd1[_0x97ea('0x15')]['code']===0x1f4){logger[_0x97ea('0x15')](_0x97ea('0x11'),_0x396e19,_0x80abd1[_0x97ea('0x15')]['message']);return _0x2c03a3(_0x80abd1[_0x97ea('0x15')][_0x97ea('0x16')]);}logger['error'](_0x97ea('0x11'),_0x396e19,_0x80abd1['error'][_0x97ea('0x16')]);return _0x5a071f(_0x80abd1[_0x97ea('0x15')][_0x97ea('0x16')]);}else{logger[_0x97ea('0x10')](_0x97ea('0x11'),_0x396e19,_0x97ea('0x12'));_0x5a071f(_0x80abd1[_0x97ea('0x17')]['message']);}})[_0x97ea('0x18')](function(_0x12499b){logger[_0x97ea('0x15')](_0x97ea('0x11'),_0x396e19,_0x12499b);_0x2c03a3(_0x12499b);});});}exports[_0x97ea('0x19')]=function(_0x3577de){var _0x11f20d=this;return new Promise(function(_0x36771,_0x10c346){return db[_0x97ea('0x1a')][_0x97ea('0x1b')](_0x3577de[_0x97ea('0x1c')],{'raw':_0x3577de['options']?_0x3577de[_0x97ea('0x1d')][_0x97ea('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3577de['options']?_0x3577de[_0x97ea('0x1d')][_0x97ea('0x1f')]||null:null,'attributes':_0x3577de['options']?_0x3577de['options'][_0x97ea('0x20')]||null:null,'limit':_0x3577de[_0x97ea('0x1d')]?_0x3577de[_0x97ea('0x1d')][_0x97ea('0x21')]||null:null})[_0x97ea('0xf')](function(_0x4b3b52){logger[_0x97ea('0x10')](_0x97ea('0x19'),_0x3577de);logger['debug']('UpdateMailInteraction',_0x3577de,JSON[_0x97ea('0x22')](_0x4b3b52));_0x36771(_0x4b3b52);})[_0x97ea('0x18')](function(_0x44fa98){logger[_0x97ea('0x15')](_0x97ea('0x19'),_0x44fa98[_0x97ea('0x16')],_0x3577de);_0x10c346(_0x11f20d[_0x97ea('0x15')](0x1f4,_0x44fa98[_0x97ea('0x16')]));});});};exports[_0x97ea('0x23')]=function(_0x436613){return new Promise(function(_0x2b947c,_0x1d1a15){return db[_0x97ea('0x1a')]['find']({'where':_0x436613[_0x97ea('0x1d')]?_0x436613[_0x97ea('0x1d')]['where']||null:null})['then'](function(_0xa2d99a){if(_0xa2d99a){return _0xa2d99a[_0x97ea('0x24')](_0x436613[_0x97ea('0x1c')][_0x97ea('0x25')],_[_0x97ea('0x26')](_0x436613[_0x97ea('0x1c')],[_0x97ea('0x25'),'id'])||{});}})[_0x97ea('0x27')](function(_0x3f586a){logger[_0x97ea('0x10')](_0x97ea('0x28'),_0x436613);logger[_0x97ea('0x13')](_0x97ea('0x28'),_0x436613,JSON[_0x97ea('0x22')](_0x3f586a));_0x2b947c(_0x3f586a);})[_0x97ea('0x18')](function(_0x1e0b61){logger['error'](_0x97ea('0x28'),_0x1e0b61[_0x97ea('0x16')],_0x436613);_0x1d1a15(_this['error'](0x1f4,_0x1e0b61[_0x97ea('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 9f0cb3a..95f43b0 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 _0x7f89=['register','length','save','remove','update','emit','removeListener'];(function(_0x2bc4b9,_0x335bd9){var _0x155997=function(_0xa4d48){while(--_0xa4d48){_0x2bc4b9['push'](_0x2bc4b9['shift']());}};_0x155997(++_0x335bd9);}(_0x7f89,0x1ad));var _0x97f8=function(_0x1c270a,_0x378796){_0x1c270a=_0x1c270a-0x0;var _0x2607b8=_0x7f89[_0x1c270a];return _0x2607b8;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x97f8('0x0'),_0x97f8('0x1'),_0x97f8('0x2')];function createListener(_0x28597d,_0xef4ee6){return function(_0x5350fe){_0xef4ee6[_0x97f8('0x3')](_0x28597d,_0x5350fe);};}function removeListener(_0x4a0fcc,_0x244231){return function(){MailInteractionEvents[_0x97f8('0x4')](_0x4a0fcc,_0x244231);};}exports[_0x97f8('0x5')]=function(_0x2c0dfc){for(var _0xc10678=0x0,_0x216b53=events[_0x97f8('0x6')];_0xc10678<_0x216b53;_0xc10678++){var _0x3f8691=events[_0xc10678];var _0x3c2175=createListener('mailInteraction:'+_0x3f8691,_0x2c0dfc);MailInteractionEvents['on'](_0x3f8691,_0x3c2175);}}; \ No newline at end of file +var _0xa86e=['register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener'];(function(_0x575b7a,_0x570cbc){var _0x1982e1=function(_0x4a01fc){while(--_0x4a01fc){_0x575b7a['push'](_0x575b7a['shift']());}};_0x1982e1(++_0x570cbc);}(_0xa86e,0x1bc));var _0xea86=function(_0x43f0e9,_0x1c9aa5){_0x43f0e9=_0x43f0e9-0x0;var _0x2b1dfa=_0xa86e[_0x43f0e9];return _0x2b1dfa;};'use strict';var MailInteractionEvents=require(_0xea86('0x0'));var events=[_0xea86('0x1'),_0xea86('0x2'),_0xea86('0x3')];function createListener(_0x4fcfd4,_0x24ac61){return function(_0x56f773){_0x24ac61[_0xea86('0x4')](_0x4fcfd4,_0x56f773);};}function removeListener(_0xc715ec,_0x38bc2d){return function(){MailInteractionEvents[_0xea86('0x5')](_0xc715ec,_0x38bc2d);};}exports[_0xea86('0x6')]=function(_0x592004){for(var _0x440c15=0x0,_0x52f0d8=events[_0xea86('0x7')];_0x440c15<_0x52f0d8;_0x440c15++){var _0x1cc7ee=events[_0x440c15];var _0x2f2dfb=createListener(_0xea86('0x8')+_0x1cc7ee,_0x592004);MailInteractionEvents['on'](_0x1cc7ee,_0x2f2dfb);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index e63999a..ef8c722 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 _0x56ce=['download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x5a6aa,_0x496e8f){var _0x55bc63=function(_0x1327bf){while(--_0x1327bf){_0x5a6aa['push'](_0x5a6aa['shift']());}};_0x55bc63(++_0x496e8f);}(_0x56ce,0x1e9));var _0xe56c=function(_0x4dc74d,_0x3ea004){_0x4dc74d=_0x4dc74d-0x0;var _0x4e3f2d=_0x56ce[_0x4dc74d];return _0x4e3f2d;};'use strict';var multer=require(_0xe56c('0x0'));var util=require('util');var path=require(_0xe56c('0x1'));var timeout=require(_0xe56c('0x2'));var express=require(_0xe56c('0x3'));var router=express[_0xe56c('0x4')]();var fs_extra=require(_0xe56c('0x5'));var auth=require(_0xe56c('0x6'));var interaction=require(_0xe56c('0x7'));var config=require(_0xe56c('0x8'));var controller=require('./mailMessage.controller');router['get']('/',auth[_0xe56c('0x9')](),controller['index']);router[_0xe56c('0xa')](_0xe56c('0xb'),auth[_0xe56c('0x9')](),controller[_0xe56c('0xc')]);router[_0xe56c('0xa')](_0xe56c('0xd'),auth[_0xe56c('0x9')](),controller[_0xe56c('0xe')]);router[_0xe56c('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xe56c('0xf')]);router[_0xe56c('0x10')]('/',auth[_0xe56c('0x9')](),interaction[_0xe56c('0x11')](_0xe56c('0x12'),_0xe56c('0x13')),controller[_0xe56c('0x14')]);router[_0xe56c('0x15')](_0xe56c('0xd'),auth[_0xe56c('0x9')](),controller[_0xe56c('0x16')]);router[_0xe56c('0x15')](_0xe56c('0x17'),auth[_0xe56c('0x9')](),controller['accept']);router['put'](_0xe56c('0x18'),auth[_0xe56c('0x9')](),controller[_0xe56c('0x19')]);router[_0xe56c('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xe56c('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xc48e=['put','update','/:id/accept','accept','reject','delete','destroy','multer','path','express','Router','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create'];(function(_0x1a1470,_0x3bfdd1){var _0x15d44e=function(_0x37913c){while(--_0x37913c){_0x1a1470['push'](_0x1a1470['shift']());}};_0x15d44e(++_0x3bfdd1);}(_0xc48e,0xd7));var _0xec48=function(_0x7ee74a,_0x34bca9){_0x7ee74a=_0x7ee74a-0x0;var _0x29704f=_0xc48e[_0x7ee74a];return _0x29704f;};'use strict';var multer=require(_0xec48('0x0'));var util=require('util');var path=require(_0xec48('0x1'));var timeout=require('connect-timeout');var express=require(_0xec48('0x2'));var router=express[_0xec48('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xec48('0x4'));var config=require(_0xec48('0x5'));var controller=require(_0xec48('0x6'));router[_0xec48('0x7')]('/',auth[_0xec48('0x8')](),controller[_0xec48('0x9')]);router['get']('/describe',auth[_0xec48('0x8')](),controller[_0xec48('0xa')]);router[_0xec48('0x7')](_0xec48('0xb'),auth[_0xec48('0x8')](),controller[_0xec48('0xc')]);router[_0xec48('0x7')](_0xec48('0xd'),auth[_0xec48('0x8')](),controller[_0xec48('0xe')]);router[_0xec48('0xf')]('/',auth['isAuthenticated'](),interaction[_0xec48('0x10')](_0xec48('0x11'),_0xec48('0x12')),controller['create']);router[_0xec48('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xec48('0x14')]);router[_0xec48('0x13')](_0xec48('0x15'),auth[_0xec48('0x8')](),controller[_0xec48('0x16')]);router[_0xec48('0x13')]('/:id/reject',auth[_0xec48('0x8')](),controller[_0xec48('0x17')]);router[_0xec48('0x18')](_0xec48('0xb'),auth['isAuthenticated'](),controller[_0xec48('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 031d5bf..c3b19c8 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 _0xc4d0=['INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x5e01d4,_0x4ff457){var _0x5e8a7a=function(_0x2d53ad){while(--_0x2d53ad){_0x5e01d4['push'](_0x5e01d4['shift']());}};_0x5e8a7a(++_0x4ff457);}(_0xc4d0,0x107));var _0x0c4d=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0xc4d0[_0x1d5ba8];return _0x1022a2;};'use strict';var Sequelize=require(_0x0c4d('0x0'));var _=require(_0x0c4d('0x1'));module[_0x0c4d('0x2')]={'body':{'type':Sequelize[_0x0c4d('0x3')](_0x0c4d('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0c4d('0x3')]('medium')},'read':{'type':Sequelize[_0x0c4d('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0c4d('0x6')]('in',_0x0c4d('0x7')),'defaultValue':_0x0c4d('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x0c4d('0x8')]},'to':{'type':Sequelize[_0x0c4d('0x3')](_0x0c4d('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x0c4d('0x4'))},'bcc':{'type':Sequelize[_0x0c4d('0x3')]('long')},'subject':{'type':Sequelize[_0x0c4d('0x3')]},'sentAt':{'type':Sequelize[_0x0c4d('0x9')]},'attach':{'type':Sequelize[_0x0c4d('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0c4d('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0c4d('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x0c4d('0x4'))},'originCc':{'type':Sequelize[_0x0c4d('0x3')]('long')},'originChannel':{'type':Sequelize[_0x0c4d('0x6')](_0x0c4d('0xb'),_0x0c4d('0xc')),'defaultValue':_0x0c4d('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x503e=['Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','DATE','Email'];(function(_0x385e7a,_0x3104e3){var _0x372588=function(_0x146f89){while(--_0x146f89){_0x385e7a['push'](_0x385e7a['shift']());}};_0x372588(++_0x3104e3);}(_0x503e,0x12d));var _0xe503=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x503e[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xe503('0x0'));var _=require(_0xe503('0x1'));module[_0xe503('0x2')]={'body':{'type':Sequelize[_0xe503('0x3')](_0xe503('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe503('0x3')](_0xe503('0x5'))},'read':{'type':Sequelize[_0xe503('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe503('0x7')]('in',_0xe503('0x8')),'defaultValue':_0xe503('0x8'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0xe503('0x4'))},'cc':{'type':Sequelize[_0xe503('0x3')]('long')},'bcc':{'type':Sequelize[_0xe503('0x3')](_0xe503('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xe503('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe503('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe503('0x9')]},'originTo':{'type':Sequelize[_0xe503('0x3')](_0xe503('0x4'))},'originCc':{'type':Sequelize[_0xe503('0x3')](_0xe503('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0xe503('0xa'),_0xe503('0xb')),'defaultValue':_0xe503('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 4b3a3a4..8863c6f 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 _0x3a7f=['../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','http','client','request','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','status','json','offset','undefined','limit','set','Content-Range','then','destroy','end','sendStatus','stack','name','send','map','MailMessage','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','intersection','length','include','update','body','find','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','stringify','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','UserId','get','MailInteraction','MailInteractionId','read1stAt','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','email','agent','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','sequelize','fullname','internal','rejectmessage','download','unix','toString','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','eml-format','moment','util','path','html-to-text'];(function(_0x17feda,_0x5bf5bd){var _0x2d9024=function(_0x4456be){while(--_0x4456be){_0x17feda['push'](_0x17feda['shift']());}};_0x2d9024(++_0x5bf5bd);}(_0x3a7f,0x1e1));var _0xf3a7=function(_0x26fa25,_0x3eba1c){_0x26fa25=_0x26fa25-0x0;var _0xe16666=_0x3a7f[_0x26fa25];return _0xe16666;};'use strict';var emlformat=require(_0xf3a7('0x0'));var moment=require(_0xf3a7('0x1'));var BPromise=require('bluebird');var util=require(_0xf3a7('0x2'));var path=require(_0xf3a7('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0xf3a7('0x4'));var qs=require(_0xf3a7('0x5'));var logger=require(_0xf3a7('0x6'))(_0xf3a7('0x7'));var interaction_log=require(_0xf3a7('0x6'))(_0xf3a7('0x8'));var config=require(_0xf3a7('0x9'));var db=require(_0xf3a7('0xa'))['db'];config[_0xf3a7('0xb')]=_[_0xf3a7('0xc')](config[_0xf3a7('0xb')],{'host':_0xf3a7('0xd'),'port':0x18eb});var socket=require(_0xf3a7('0xe'))(new Redis(config[_0xf3a7('0xb')]));var htmlEntities=require(_0xf3a7('0xf'));require(_0xf3a7('0x10'))[_0xf3a7('0x11')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xf3a7('0x12')]({'port':0x232c});var client9003=jayson['client'][_0xf3a7('0x12')]({'port':0x232b});var client9002=jayson[_0xf3a7('0x13')][_0xf3a7('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x506133,_0x286259,_0x5b8fa6,_0x283c18){return new BPromise(function(_0x4f16ed,_0x4b45ce){var _0x32ac6f=_0x283c18||client;return _0x32ac6f[_0xf3a7('0x14')](_0x506133,_0x5b8fa6)['then'](function(_0x15cea0){logger['info'](_0xf3a7('0x15'),_0x286259,'request\x20sent');logger[_0xf3a7('0x16')](_0xf3a7('0x17'),_0x286259,_0xf3a7('0x18'),JSON['stringify'](_0x15cea0));if(_0x15cea0['error']){if(_0x15cea0[_0xf3a7('0x19')][_0xf3a7('0x1a')]===0x1f4){logger[_0xf3a7('0x19')]('MailMessage,\x20%s,\x20%s',_0x286259,_0x15cea0[_0xf3a7('0x19')][_0xf3a7('0x1b')]);return _0x4b45ce(_0x15cea0['error'][_0xf3a7('0x1b')]);}logger[_0xf3a7('0x19')](_0xf3a7('0x15'),_0x286259,_0x15cea0[_0xf3a7('0x19')][_0xf3a7('0x1b')]);return _0x4f16ed(_0x15cea0[_0xf3a7('0x19')][_0xf3a7('0x1b')]);}else{logger[_0xf3a7('0x1c')](_0xf3a7('0x15'),_0x286259,_0xf3a7('0x18'));_0x4f16ed(_0x15cea0['result'][_0xf3a7('0x1b')]);}})['catch'](function(_0x451d98){logger[_0xf3a7('0x19')]('MailMessage,\x20%s,\x20%s',_0x286259,_0x451d98);_0x4b45ce(_0x451d98);});});}function respondWithResult(_0x290f18,_0x2dc2e7){_0x2dc2e7=_0x2dc2e7||0xc8;return function(_0x1f05a7){if(_0x1f05a7){return _0x290f18[_0xf3a7('0x1d')](_0x2dc2e7)[_0xf3a7('0x1e')](_0x1f05a7);}};}function respondWithFilteredResult(_0x46e5b9,_0x58f803){return function(_0x39c307){if(_0x39c307){var _0x1add4c=typeof _0x58f803[_0xf3a7('0x1f')]===_0xf3a7('0x20')&&typeof _0x58f803[_0xf3a7('0x21')]===_0xf3a7('0x20');var _0x3c6749=_0x39c307['count'];var _0xb55b3b=_0x1add4c?0x0:_0x58f803['offset'];var _0x2107a5=_0x1add4c?_0x39c307['count']:_0x58f803['offset']+_0x58f803['limit'];var _0x2bd35c;if(_0x2107a5>=_0x3c6749){_0x2107a5=_0x3c6749;_0x2bd35c=0xc8;}else{_0x2bd35c=0xce;}_0x46e5b9['status'](_0x2bd35c);return _0x46e5b9[_0xf3a7('0x22')](_0xf3a7('0x23'),_0xb55b3b+'-'+_0x2107a5+'/'+_0x3c6749)['json'](_0x39c307);}return null;};}function saveUpdates(_0x315564){return function(_0x4805d5){if(_0x4805d5){return _0x4805d5['update'](_0x315564)[_0xf3a7('0x24')](function(_0x3fb9de){return _0x3fb9de;});}return null;};}function removeEntity(_0x3e89f7){return function(_0xb7aa91){if(_0xb7aa91){return _0xb7aa91[_0xf3a7('0x25')]()['then'](function(){_0x3e89f7[_0xf3a7('0x1d')](0xcc)[_0xf3a7('0x26')]();});}};}function handleEntityNotFound(_0x2f17b8){return function(_0x14a516){if(!_0x14a516){_0x2f17b8[_0xf3a7('0x27')](0x194);}return _0x14a516;};}function handleError(_0x273444,_0xc7f10b){_0xc7f10b=_0xc7f10b||0x1f4;return function(_0x257485){logger['error'](_0x257485[_0xf3a7('0x28')]);if(_0x257485[_0xf3a7('0x29')]){delete _0x257485[_0xf3a7('0x29')];}_0x273444[_0xf3a7('0x1d')](_0xc7f10b)[_0xf3a7('0x2a')](_0x257485);};}exports['index']=function(_0x4f6ba1,_0x45f0d5){var _0x48c598={},_0x1c095c={},_0x101fa4={'count':0x0,'rows':[]};var _0x3b2fb0=_[_0xf3a7('0x2b')](db[_0xf3a7('0x2c')]['rawAttributes'],function(_0x131ae4){return{'name':_0x131ae4[_0xf3a7('0x2d')],'type':_0x131ae4[_0xf3a7('0x2e')][_0xf3a7('0x2f')]};});_0x1c095c[_0xf3a7('0x30')]=_[_0xf3a7('0x2b')](_0x3b2fb0,_0xf3a7('0x29'));_0x1c095c[_0xf3a7('0x31')]=_[_0xf3a7('0x32')](_0x4f6ba1['query']);_0x1c095c[_0xf3a7('0x33')]=_['intersection'](_0x1c095c[_0xf3a7('0x30')],_0x1c095c['query']);_0x48c598[_0xf3a7('0x34')]=_['intersection'](_0x1c095c['model'],qs['fields'](_0x4f6ba1[_0xf3a7('0x31')][_0xf3a7('0x35')]));_0x48c598[_0xf3a7('0x34')]=_0x48c598[_0xf3a7('0x34')]['length']?_0x48c598[_0xf3a7('0x34')]:_0x1c095c[_0xf3a7('0x30')];if(!_0x4f6ba1[_0xf3a7('0x31')][_0xf3a7('0x36')](_0xf3a7('0x37'))){_0x48c598['limit']=qs[_0xf3a7('0x21')](_0x4f6ba1[_0xf3a7('0x31')]['limit']);_0x48c598[_0xf3a7('0x1f')]=qs[_0xf3a7('0x1f')](_0x4f6ba1[_0xf3a7('0x31')][_0xf3a7('0x1f')]);}_0x48c598['order']=qs[_0xf3a7('0x38')](_0x4f6ba1[_0xf3a7('0x31')][_0xf3a7('0x38')]);_0x48c598[_0xf3a7('0x39')]=qs['filters'](_[_0xf3a7('0x3a')](_0x4f6ba1['query'],_0x1c095c[_0xf3a7('0x33')]),_0x3b2fb0);if(_0x4f6ba1[_0xf3a7('0x31')][_0xf3a7('0x3b')]){_0x48c598[_0xf3a7('0x39')]=_[_0xf3a7('0x3c')](_0x48c598[_0xf3a7('0x39')],{'$or':_[_0xf3a7('0x2b')](_0x3b2fb0,function(_0x1887db){if(_0x1887db[_0xf3a7('0x2e')]!==_0xf3a7('0x3d')){var _0x28ef84={};_0x28ef84[_0x1887db[_0xf3a7('0x29')]]={'$like':'%'+_0x4f6ba1['query']['filter']+'%'};return _0x28ef84;}})});}_0x48c598=_['merge']({},_0x48c598,_0x4f6ba1[_0xf3a7('0x3e')]);var _0x83fd54={'where':_0x48c598[_0xf3a7('0x39')]};return db[_0xf3a7('0x2c')]['count'](_0x83fd54)[_0xf3a7('0x24')](function(_0x55c357){_0x101fa4['count']=_0x55c357;if(_0x4f6ba1[_0xf3a7('0x31')][_0xf3a7('0x3f')]){_0x48c598['include']=[{'all':!![]}];}return db[_0xf3a7('0x2c')][_0xf3a7('0x40')](_0x48c598);})[_0xf3a7('0x24')](function(_0x970a4b){_0x101fa4[_0xf3a7('0x41')]=_0x970a4b;return _0x101fa4;})['then'](respondWithFilteredResult(_0x45f0d5,_0x48c598))[_0xf3a7('0x42')](handleError(_0x45f0d5,null));};exports['show']=function(_0x1cc873,_0x402fb4){var _0x3688f4={'raw':!![],'where':{'id':_0x1cc873[_0xf3a7('0x43')]['id']}},_0x52b4ab={};_0x52b4ab[_0xf3a7('0x30')]=_[_0xf3a7('0x32')](db[_0xf3a7('0x2c')][_0xf3a7('0x44')]);_0x52b4ab[_0xf3a7('0x31')]=_['keys'](_0x1cc873[_0xf3a7('0x31')]);_0x52b4ab[_0xf3a7('0x33')]=_['intersection'](_0x52b4ab[_0xf3a7('0x30')],_0x52b4ab[_0xf3a7('0x31')]);_0x3688f4[_0xf3a7('0x34')]=_[_0xf3a7('0x45')](_0x52b4ab[_0xf3a7('0x30')],qs[_0xf3a7('0x35')](_0x1cc873[_0xf3a7('0x31')][_0xf3a7('0x35')]));_0x3688f4[_0xf3a7('0x34')]=_0x3688f4['attributes'][_0xf3a7('0x46')]?_0x3688f4[_0xf3a7('0x34')]:_0x52b4ab[_0xf3a7('0x30')];if(_0x1cc873['query'][_0xf3a7('0x3f')]){_0x3688f4[_0xf3a7('0x47')]=[{'all':!![]}];}_0x3688f4=_['merge']({},_0x3688f4,_0x1cc873[_0xf3a7('0x3e')]);return db['MailMessage']['find'](_0x3688f4)[_0xf3a7('0x24')](handleEntityNotFound(_0x402fb4,null))[_0xf3a7('0x24')](respondWithResult(_0x402fb4,null))['catch'](handleError(_0x402fb4,null));};exports[_0xf3a7('0x48')]=function(_0x2d295c,_0x4e0225){if(_0x2d295c[_0xf3a7('0x49')]['id']){delete _0x2d295c[_0xf3a7('0x49')]['id'];}return db[_0xf3a7('0x2c')]['find']({'where':{'id':_0x2d295c[_0xf3a7('0x43')]['id']}})[_0xf3a7('0x24')](handleEntityNotFound(_0x4e0225,null))[_0xf3a7('0x24')](saveUpdates(_0x2d295c[_0xf3a7('0x49')],null))[_0xf3a7('0x24')](respondWithResult(_0x4e0225,null))['catch'](handleError(_0x4e0225,null));};exports['destroy']=function(_0x1a739d,_0x4a2a50){return db['MailMessage'][_0xf3a7('0x4a')]({'where':{'id':_0x1a739d['params']['id']}})[_0xf3a7('0x24')](handleEntityNotFound(_0x4a2a50,null))[_0xf3a7('0x24')](removeEntity(_0x4a2a50,null))[_0xf3a7('0x42')](handleError(_0x4a2a50,null));};exports[_0xf3a7('0x4b')]=function(_0x1c8017,_0x472e47){return db[_0xf3a7('0x2c')][_0xf3a7('0x4b')]()[_0xf3a7('0x24')](respondWithResult(_0x472e47,null))['catch'](handleError(_0x472e47,null));};exports[_0xf3a7('0x4c')]=function(_0x402728,_0x43c294){return db[_0xf3a7('0x2c')][_0xf3a7('0x4c')](_0x402728[_0xf3a7('0x49')])['then'](function(_0x4c4695){if(_0x4c4695){if(_0x4c4695[_0xf3a7('0x4d')]===_0xf3a7('0x4e')&&!_0x4c4695[_0xf3a7('0x4f')]){var _0x32b835,_0x34ea8c,_0x6ce38b;if(_0x402728['body']['to']){_0x34ea8c=_0x402728[_0xf3a7('0x49')]['to'][_0xf3a7('0x50')](',')[0x0];}return db[_0xf3a7('0x51')][_0xf3a7('0x52')]({'where':{'id':_0x4c4695[_0xf3a7('0x53')]},'include':[{'model':db['CmList'],'as':_0xf3a7('0x54'),'include':[{'model':db['CmContact'],'as':_0xf3a7('0x55'),'where':{'email':_0x34ea8c},'limit':0x1,'order':[[_0xf3a7('0x56'),'DESC']]}]},{'model':db[_0xf3a7('0x57')],'as':_0xf3a7('0x58'),'raw':!![],'include':[{'model':db[_0xf3a7('0x59')],'as':'CloudProvider','raw':!![]}]}]})[_0xf3a7('0x24')](function(_0x2f9090){_0x32b835=_0x2f9090;if(!_0x32b835||!_0x32b835[_0xf3a7('0x58')])return;var _0x1449da=_0x32b835[_0xf3a7('0x5a')]();if(_0x402728['body'][_0xf3a7('0x5b')]&&_0x402728['body'][_0xf3a7('0x5b')][_0xf3a7('0x46')]){for(var _0x357d83=0x0;_0x357d83<_0x402728[_0xf3a7('0x49')][_0xf3a7('0x5b')][_0xf3a7('0x46')];_0x357d83+=0x1){_0x402728[_0xf3a7('0x49')][_0xf3a7('0x5b')][_0x357d83]={'filename':_0x402728[_0xf3a7('0x49')][_0xf3a7('0x5b')][_0x357d83][_0xf3a7('0x29')],'path':path[_0xf3a7('0x5c')](config[_0xf3a7('0x5d')],_0xf3a7('0x5e'),_0x402728[_0xf3a7('0x49')][_0xf3a7('0x5b')][_0x357d83][_0xf3a7('0x5f')])};}}_0x6ce38b={'account':_0x1449da,'message':_0x402728[_0xf3a7('0x49')]};return;})[_0xf3a7('0x24')](function(){if(_0x32b835[_0xf3a7('0x54')]){if(_0x32b835[_0xf3a7('0x54')][_0xf3a7('0x55')]['length']){return _0x32b835[_0xf3a7('0x54')]['Contacts'][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x402728['body'],{'firstName':_0x402728[_0xf3a7('0x49')]['to'],'email':_0x402728[_0xf3a7('0x49')]['to'],'phone':_0x402728[_0xf3a7('0x49')]['to'],'ListId':_0x32b835[_0xf3a7('0x60')]}));}}else{throw new Error(_0xf3a7('0x61'));}})[_0xf3a7('0x24')](function(){if(_0x6ce38b){return respondWithRpcPromise(_0xf3a7('0x62'),_0xf3a7('0x63'),_0x6ce38b,client9003)['then'](function(_0x404dfd){return _0x4c4695[_0xf3a7('0x48')]({'read':!![],'messageId':_0x404dfd[_0xf3a7('0x64')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xf3a7('0x42')](function(_0x562872){logger['error']('%s',JSON[_0xf3a7('0x65')](_0x562872));return _0x4c4695;});}return _0x4c4695;});}return _0x4c4695;}})['then'](respondWithResult(_0x43c294,0xc9))['catch'](handleError(_0x43c294,null));};exports[_0xf3a7('0x66')]=function(_0x167f47,_0x2b8c15){var _0x4abd7b={'agent':{},'channel':_0xf3a7('0x67')};if(_0x167f47[_0xf3a7('0x49')]['id']){delete _0x167f47['body']['id'];}_0x167f47[_0xf3a7('0x49')][_0xf3a7('0x68')]=!![];_0x167f47[_0xf3a7('0x49')][_0xf3a7('0x69')]=moment()['format'](_0xf3a7('0x6a'));_0x167f47[_0xf3a7('0x49')]['UserId']=_0x167f47[_0xf3a7('0x49')]['UserId']||_0x167f47[_0xf3a7('0x6b')]['id'];_0x4abd7b['agent']['id']=_0x167f47[_0xf3a7('0x49')][_0xf3a7('0x6c')];return db[_0xf3a7('0x2c')]['find']({'where':{'id':_0x167f47[_0xf3a7('0x43')]['id'],'UserId':null}})[_0xf3a7('0x24')](handleEntityNotFound(_0x2b8c15,null))[_0xf3a7('0x24')](saveUpdates(_0x167f47[_0xf3a7('0x49')],null))['then'](function(_0x8484c9){if(_0x8484c9){_0x4abd7b[_0xf3a7('0x1b')]=_0x8484c9[_0xf3a7('0x6d')]({'plain':!![]});return db[_0xf3a7('0x6e')][_0xf3a7('0x4a')]({'where':{'id':_0x8484c9[_0xf3a7('0x6f')]}});}return null;})[_0xf3a7('0x24')](handleEntityNotFound(_0x2b8c15,null))[_0xf3a7('0x24')](function(_0x5f2e6c){if(_0x5f2e6c){return _0x5f2e6c[_0xf3a7('0x48')]({'UserId':_0x167f47[_0xf3a7('0x49')][_0xf3a7('0x6c')],'read1stAt':_['isNil'](_0x5f2e6c[_0xf3a7('0x70')])?moment()[_0xf3a7('0x71')](_0xf3a7('0x6a')):undefined});}return null;})[_0xf3a7('0x24')](function(_0x49dbf2){if(_0x49dbf2){_0x4abd7b[_0xf3a7('0x72')]=_0x49dbf2[_0xf3a7('0x6d')]({'plain':!![]});interaction_log[_0xf3a7('0x1c')](_0xf3a7('0x73'),_0x167f47[_0xf3a7('0x6b')]['id'],_0x167f47['user'][_0xf3a7('0x29')],_0x167f47[_0xf3a7('0x6b')][_0xf3a7('0x74')],_0x4abd7b[_0xf3a7('0x72')]['id'],_0x167f47[_0xf3a7('0x49')]?JSON['stringify'](_0x167f47[_0xf3a7('0x49')]):'null');return respondWithRpcPromise(_0xf3a7('0x75'),_0xf3a7('0x76'),_0x4abd7b);}return null;})['then'](function(_0xe90761){var _0x8631e5=_0xf3a7('0x77')+_0xe90761['message']['ContactId'];return db['sequelize'][_0xf3a7('0x31')](_0x8631e5,{'type':db[_0xf3a7('0x78')][_0xf3a7('0x79')][_0xf3a7('0x7a')],'raw':!![]})[_0xf3a7('0x24')](function(_0x2bed51){return _0x2bed51;});})[_0xf3a7('0x24')](function(_0x74bbc6){if(_0x74bbc6){_0x4abd7b[_0xf3a7('0x1b')][_0xf3a7('0x7b')]=_0x74bbc6[0x0];if(!_0x167f47[_0xf3a7('0x49')][_0xf3a7('0x6c')])return;return db[_0xf3a7('0x7c')][_0xf3a7('0x4a')]({'where':{'id':_0x167f47[_0xf3a7('0x49')][_0xf3a7('0x6c')],'role':'agent'},'attributes':['id',_0xf3a7('0x29'),'fullname',_0xf3a7('0x7d'),'internal'],'raw':!![]});}return null;})['then'](function(_0xc69a02){if(!_0xc69a02)return null;_0x4abd7b[_0xf3a7('0x1b')][_0xf3a7('0x7e')]=_0xc69a02;return _0x4abd7b;})['then'](function(_0x275108){if(_0x275108){if(_0x167f47[_0xf3a7('0x49')][_0xf3a7('0x7f')]){_0x4abd7b['message'][_0xf3a7('0x80')]=util[_0xf3a7('0x71')](_0xf3a7('0x81'),_0x167f47['user'][_0xf3a7('0x29')]);_0x4abd7b[_0xf3a7('0x1b')][_0xf3a7('0x82')]=_0x4abd7b[_0xf3a7('0x82')];_0x4abd7b['message'][_0xf3a7('0x83')]=_0x4abd7b[_0xf3a7('0x82')];_0x4abd7b[_0xf3a7('0x1b')][_0xf3a7('0x84')]=_0xf3a7('0x66');_0x4abd7b[_0xf3a7('0x1b')][_0xf3a7('0x49')]=htmlToText[_0xf3a7('0x85')](_0x4abd7b[_0xf3a7('0x1b')][_0xf3a7('0x49')]);return respondWithRpcPromise('EventManager',_0xf3a7('0x86'),{'event':_0xf3a7('0x87'),'message':_0x4abd7b[_0xf3a7('0x1b')]},client9002)['then'](function(){return _0x4abd7b;});}return _0x4abd7b;}return null;})[_0xf3a7('0x24')](respondWithResult(_0x2b8c15,null))[_0xf3a7('0x42')](handleError(_0x2b8c15,null));};exports[_0xf3a7('0x88')]=function(_0x5d85c9,_0x4484df){var _0x4d673a={'agent':{},'channel':_0xf3a7('0x67')};if(_0x5d85c9['body']['id']){delete _0x5d85c9[_0xf3a7('0x49')]['id'];}_0x5d85c9[_0xf3a7('0x49')]['UserId']=_0x5d85c9[_0xf3a7('0x49')][_0xf3a7('0x6c')]||_0x5d85c9[_0xf3a7('0x6b')]['id'];_0x4d673a['agent']['id']=_0x5d85c9[_0xf3a7('0x49')]['UserId'];return db[_0xf3a7('0x2c')][_0xf3a7('0x4a')]({'where':{'id':_0x5d85c9[_0xf3a7('0x43')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4484df,null))[_0xf3a7('0x24')](function(_0x20d0b6){if(_0x20d0b6){_0x4d673a[_0xf3a7('0x1b')]=_0x20d0b6['get']({'plain':!![]});return db[_0xf3a7('0x6e')][_0xf3a7('0x4a')]({'where':{'id':_0x20d0b6[_0xf3a7('0x6f')]}});}return null;})['then'](handleEntityNotFound(_0x4484df,null))[_0xf3a7('0x24')](function(_0x26f314){if(_0x26f314){_0x4d673a[_0xf3a7('0x72')]=_0x26f314['get']({'plain':!![]});interaction_log[_0xf3a7('0x1c')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d85c9[_0xf3a7('0x6b')]['id'],_0x5d85c9[_0xf3a7('0x6b')][_0xf3a7('0x29')],_0x5d85c9[_0xf3a7('0x6b')][_0xf3a7('0x74')],_0x4d673a[_0xf3a7('0x72')]['id'],_0x5d85c9[_0xf3a7('0x49')]?JSON['stringify'](_0x5d85c9[_0xf3a7('0x49')]):'null');return respondWithRpcPromise(_0xf3a7('0x89'),_0xf3a7('0x8a'),_0x4d673a);}return null;})[_0xf3a7('0x24')](function(_0x55d73e){var _0x35d4fa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x55d73e[_0xf3a7('0x1b')]['ContactId'];return db[_0xf3a7('0x8b')][_0xf3a7('0x31')](_0x35d4fa,{'type':db['Sequelize'][_0xf3a7('0x79')]['SELECT'],'raw':!![]})[_0xf3a7('0x24')](function(_0x370413){return _0x370413;});})['then'](function(_0xb04ca3){if(_0xb04ca3){_0x4d673a[_0xf3a7('0x1b')][_0xf3a7('0x7b')]=_0xb04ca3[0x0];if(!_0x5d85c9[_0xf3a7('0x49')][_0xf3a7('0x6c')])return;return db['User'][_0xf3a7('0x4a')]({'where':{'id':_0x5d85c9[_0xf3a7('0x49')]['UserId'],'role':_0xf3a7('0x7e')},'attributes':['id',_0xf3a7('0x29'),_0xf3a7('0x8c'),_0xf3a7('0x7d'),_0xf3a7('0x8d')],'raw':!![]});}return null;})[_0xf3a7('0x24')](function(_0x301531){if(!_0x301531)return null;_0x4d673a['message'][_0xf3a7('0x7e')]=_0x301531;return _0x4d673a;})[_0xf3a7('0x24')](function(_0x203bc0){if(_0x203bc0){_0x203bc0[_0xf3a7('0x1b')][_0xf3a7('0x80')]=util[_0xf3a7('0x71')](_0xf3a7('0x81'),_0x5d85c9[_0xf3a7('0x6b')][_0xf3a7('0x29')]);_0x203bc0['message'][_0xf3a7('0x82')]=_0x4d673a['channel'];_0x203bc0[_0xf3a7('0x1b')][_0xf3a7('0x83')]=_0x4d673a[_0xf3a7('0x82')];_0x203bc0[_0xf3a7('0x1b')][_0xf3a7('0x84')]='reject';_0x203bc0[_0xf3a7('0x1b')][_0xf3a7('0x49')]=htmlToText[_0xf3a7('0x85')](_0x4d673a[_0xf3a7('0x1b')][_0xf3a7('0x49')]);respondWithRpcPromise(_0xf3a7('0x86'),_0xf3a7('0x86'),{'event':_0xf3a7('0x8e'),'message':_0x203bc0[_0xf3a7('0x1b')]},client9002);return _0x4d673a;}return null;})[_0xf3a7('0x24')](respondWithResult(_0x4484df,null))[_0xf3a7('0x42')](handleError(_0x4484df,null));};exports[_0xf3a7('0x8f')]=function(_0x42723b,_0x469228){var _0x382509=moment()[_0xf3a7('0x90')]()[_0xf3a7('0x91')]();var _0xeccb5=path[_0xf3a7('0x5c')](config[_0xf3a7('0x5d')],_0xf3a7('0x92'),'files','tmp');var _0x33113c=path['join'](config['root'],'server',_0xf3a7('0x93'),_0xf3a7('0x5b'));var _0x25195a=util[_0xf3a7('0x71')](_0xf3a7('0x94'),_0x382509);return db['MailMessage'][_0xf3a7('0x4a')]({'where':{'id':_0x42723b[_0xf3a7('0x43')]['id']},'attributes':['id',_0xf3a7('0x49'),_0xf3a7('0x95'),'to','cc',_0xf3a7('0x96'),_0xf3a7('0x97'),_0xf3a7('0x98')],'include':_0x42723b['query'][_0xf3a7('0x5b')]?[{'model':db['Attachment'],'as':_0xf3a7('0x99')}]:undefined})[_0xf3a7('0x24')](handleEntityNotFound(_0x469228,null))[_0xf3a7('0x24')](function(_0x237ce9){if(_0x237ce9){var _0x4ef7d3=_0x237ce9;var _0x1c1e42={'from':_0x4ef7d3[_0xf3a7('0x95')],'to':_0x4ef7d3['to'],'subject':_0x4ef7d3[_0xf3a7('0x97')],'html':htmlEntities[_0xf3a7('0x9a')](_0x4ef7d3[_0xf3a7('0x49')]),'headers':{'Date':moment(_0x4ef7d3[_0xf3a7('0x98')])[_0xf3a7('0x71')](_0xf3a7('0x9b'))},'attachments':[]};if(_0x237ce9['cc']){_0x1c1e42[_0xf3a7('0x9c')]['Cc']=_0x237ce9['cc'];}if(_0x237ce9[_0xf3a7('0x96')]){_0x1c1e42[_0xf3a7('0x9c')][_0xf3a7('0x9d')]=_0x237ce9[_0xf3a7('0x96')];}return new BPromise(function(_0x26843a,_0x464da5){if(_0x237ce9['Attachments']){for(var _0x2094ee=0x0;_0x2094ee<_0x237ce9['Attachments'][_0xf3a7('0x46')];_0x2094ee++){var _0x43b7e2=_0x237ce9['Attachments'][_0x2094ee];var _0x2b30d5=path['join'](_0x33113c,_0x43b7e2[_0xf3a7('0x5f')]);if(fs[_0xf3a7('0x9e')](_0x2b30d5)){_0x1c1e42[_0xf3a7('0x5b')]['push']({'name':_0x43b7e2[_0xf3a7('0x29')],'contentType':_0x43b7e2[_0xf3a7('0x2e')],'data':fs[_0xf3a7('0x9f')](_0x2b30d5)});}}}emlformat[_0xf3a7('0xa0')](_0x1c1e42,function(_0x259330,_0x3727c1){if(_0x259330)return _0x464da5(_0x259330);fs[_0xf3a7('0xa1')](path[_0xf3a7('0x5c')](_0xeccb5,_0x25195a),_0x3727c1);return _0x26843a(_0x3727c1);});});}})['then'](function(_0x13f23b){if(_0x13f23b){return _0x469228[_0xf3a7('0x8f')](path[_0xf3a7('0x5c')](_0xeccb5,_0x25195a),_0x25195a,function(_0x37feae){if(!_0x37feae)fs['unlinkSync'](path[_0xf3a7('0x5c')](_0xeccb5,_0x25195a));});}})['catch'](handleError(_0x469228,null));}; \ No newline at end of file +var _0x9774=['readAt','format','UserId','user','params','MailInteraction','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','agent','email','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','User','internal','interface','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','status','json','offset','undefined','limit','count','set','update','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','find','body','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','getSmtpOptions','attachments','join','root','basename','List','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read'];(function(_0x3d68db,_0x457b7f){var _0x58212d=function(_0x1436ea){while(--_0x1436ea){_0x3d68db['push'](_0x3d68db['shift']());}};_0x58212d(++_0x457b7f);}(_0x9774,0x17f));var _0x4977=function(_0x407314,_0x3c9f5f){_0x407314=_0x407314-0x0;var _0x253ff4=_0x9774[_0x407314];return _0x253ff4;};'use strict';var emlformat=require(_0x4977('0x0'));var moment=require(_0x4977('0x1'));var BPromise=require(_0x4977('0x2'));var util=require('util');var path=require(_0x4977('0x3'));var fs=require('fs');var _=require(_0x4977('0x4'));var Redis=require('ioredis');var htmlToText=require(_0x4977('0x5'));var qs=require(_0x4977('0x6'));var logger=require(_0x4977('0x7'))(_0x4977('0x8'));var interaction_log=require(_0x4977('0x7'))(_0x4977('0x9'));var config=require(_0x4977('0xa'));var db=require(_0x4977('0xb'))['db'];config[_0x4977('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4977('0xd'))(new Redis(config[_0x4977('0xc')]));var htmlEntities=require(_0x4977('0xe'));require(_0x4977('0xf'))[_0x4977('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4977('0x11')][_0x4977('0x12')]({'port':0x232c});var client9003=jayson['client'][_0x4977('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x4977('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x272998,_0x36b301,_0x55df1f,_0x236336){return new BPromise(function(_0x1d527c,_0x4090c1){var _0x3a3b7e=_0x236336||client;return _0x3a3b7e[_0x4977('0x13')](_0x272998,_0x55df1f)[_0x4977('0x14')](function(_0x3a89a2){logger['info'](_0x4977('0x15'),_0x36b301,'request\x20sent');logger[_0x4977('0x16')](_0x4977('0x17'),_0x36b301,_0x4977('0x18'),JSON[_0x4977('0x19')](_0x3a89a2));if(_0x3a89a2[_0x4977('0x1a')]){if(_0x3a89a2[_0x4977('0x1a')]['code']===0x1f4){logger['error'](_0x4977('0x15'),_0x36b301,_0x3a89a2['error']['message']);return _0x4090c1(_0x3a89a2[_0x4977('0x1a')][_0x4977('0x1b')]);}logger[_0x4977('0x1a')]('MailMessage,\x20%s,\x20%s',_0x36b301,_0x3a89a2[_0x4977('0x1a')][_0x4977('0x1b')]);return _0x1d527c(_0x3a89a2[_0x4977('0x1a')][_0x4977('0x1b')]);}else{logger[_0x4977('0x1c')](_0x4977('0x15'),_0x36b301,_0x4977('0x18'));_0x1d527c(_0x3a89a2['result'][_0x4977('0x1b')]);}})[_0x4977('0x1d')](function(_0x3f7a7d){logger['error'](_0x4977('0x15'),_0x36b301,_0x3f7a7d);_0x4090c1(_0x3f7a7d);});});}function respondWithResult(_0x36f757,_0x23d7e4){_0x23d7e4=_0x23d7e4||0xc8;return function(_0x4c2a52){if(_0x4c2a52){return _0x36f757[_0x4977('0x1e')](_0x23d7e4)[_0x4977('0x1f')](_0x4c2a52);}};}function respondWithFilteredResult(_0x28ffc5,_0x225e8a){return function(_0x533af6){if(_0x533af6){var _0x29fc3f=typeof _0x225e8a[_0x4977('0x20')]===_0x4977('0x21')&&typeof _0x225e8a[_0x4977('0x22')]===_0x4977('0x21');var _0x168c16=_0x533af6[_0x4977('0x23')];var _0x4a5956=_0x29fc3f?0x0:_0x225e8a[_0x4977('0x20')];var _0x961fe=_0x29fc3f?_0x533af6[_0x4977('0x23')]:_0x225e8a[_0x4977('0x20')]+_0x225e8a[_0x4977('0x22')];var _0x73cb9b;if(_0x961fe>=_0x168c16){_0x961fe=_0x168c16;_0x73cb9b=0xc8;}else{_0x73cb9b=0xce;}_0x28ffc5['status'](_0x73cb9b);return _0x28ffc5[_0x4977('0x24')]('Content-Range',_0x4a5956+'-'+_0x961fe+'/'+_0x168c16)['json'](_0x533af6);}return null;};}function saveUpdates(_0x1e2a49){return function(_0x40bc55){if(_0x40bc55){return _0x40bc55[_0x4977('0x25')](_0x1e2a49)['then'](function(_0x4f5d28){return _0x4f5d28;});}return null;};}function removeEntity(_0x362fa5){return function(_0x514f54){if(_0x514f54){return _0x514f54[_0x4977('0x26')]()[_0x4977('0x14')](function(){_0x362fa5[_0x4977('0x1e')](0xcc)[_0x4977('0x27')]();});}};}function handleEntityNotFound(_0x584f09){return function(_0x35a6d4){if(!_0x35a6d4){_0x584f09[_0x4977('0x28')](0x194);}return _0x35a6d4;};}function handleError(_0x937e9e,_0x4cf8af){_0x4cf8af=_0x4cf8af||0x1f4;return function(_0x1b7a0c){logger[_0x4977('0x1a')](_0x1b7a0c['stack']);if(_0x1b7a0c['name']){delete _0x1b7a0c[_0x4977('0x29')];}_0x937e9e[_0x4977('0x1e')](_0x4cf8af)[_0x4977('0x2a')](_0x1b7a0c);};}exports[_0x4977('0x2b')]=function(_0x32ad9b,_0xc5fd0a){var _0x3c2ee6={},_0x31766e={},_0x1ee092={'count':0x0,'rows':[]};var _0x3e1954=_[_0x4977('0x2c')](db[_0x4977('0x2d')][_0x4977('0x2e')],function(_0x40b4f6){return{'name':_0x40b4f6[_0x4977('0x2f')],'type':_0x40b4f6[_0x4977('0x30')][_0x4977('0x31')]};});_0x31766e['model']=_['map'](_0x3e1954,_0x4977('0x29'));_0x31766e['query']=_[_0x4977('0x32')](_0x32ad9b[_0x4977('0x33')]);_0x31766e[_0x4977('0x34')]=_[_0x4977('0x35')](_0x31766e['model'],_0x31766e[_0x4977('0x33')]);_0x3c2ee6[_0x4977('0x36')]=_[_0x4977('0x35')](_0x31766e[_0x4977('0x37')],qs[_0x4977('0x38')](_0x32ad9b['query'][_0x4977('0x38')]));_0x3c2ee6[_0x4977('0x36')]=_0x3c2ee6[_0x4977('0x36')][_0x4977('0x39')]?_0x3c2ee6[_0x4977('0x36')]:_0x31766e['model'];if(!_0x32ad9b[_0x4977('0x33')][_0x4977('0x3a')](_0x4977('0x3b'))){_0x3c2ee6[_0x4977('0x22')]=qs[_0x4977('0x22')](_0x32ad9b[_0x4977('0x33')][_0x4977('0x22')]);_0x3c2ee6['offset']=qs[_0x4977('0x20')](_0x32ad9b[_0x4977('0x33')][_0x4977('0x20')]);}_0x3c2ee6[_0x4977('0x3c')]=qs['sort'](_0x32ad9b[_0x4977('0x33')][_0x4977('0x3d')]);_0x3c2ee6['where']=qs['filters'](_[_0x4977('0x3e')](_0x32ad9b['query'],_0x31766e[_0x4977('0x34')]),_0x3e1954);if(_0x32ad9b[_0x4977('0x33')][_0x4977('0x3f')]){_0x3c2ee6[_0x4977('0x40')]=_[_0x4977('0x41')](_0x3c2ee6[_0x4977('0x40')],{'$or':_[_0x4977('0x2c')](_0x3e1954,function(_0x528235){if(_0x528235[_0x4977('0x30')]!==_0x4977('0x42')){var _0x11c447={};_0x11c447[_0x528235[_0x4977('0x29')]]={'$like':'%'+_0x32ad9b[_0x4977('0x33')][_0x4977('0x3f')]+'%'};return _0x11c447;}})});}_0x3c2ee6=_['merge']({},_0x3c2ee6,_0x32ad9b['options']);var _0xa4f6a1={'where':_0x3c2ee6['where']};return db[_0x4977('0x2d')][_0x4977('0x23')](_0xa4f6a1)[_0x4977('0x14')](function(_0x13311b){_0x1ee092[_0x4977('0x23')]=_0x13311b;if(_0x32ad9b['query'][_0x4977('0x43')]){_0x3c2ee6[_0x4977('0x44')]=[{'all':!![]}];}return db[_0x4977('0x2d')][_0x4977('0x45')](_0x3c2ee6);})[_0x4977('0x14')](function(_0x58b0b7){_0x1ee092[_0x4977('0x46')]=_0x58b0b7;return _0x1ee092;})['then'](respondWithFilteredResult(_0xc5fd0a,_0x3c2ee6))[_0x4977('0x1d')](handleError(_0xc5fd0a,null));};exports['show']=function(_0x30d0d7,_0x2fab99){var _0x492ef5={'raw':!![],'where':{'id':_0x30d0d7['params']['id']}},_0x487e6c={};_0x487e6c[_0x4977('0x37')]=_[_0x4977('0x32')](db[_0x4977('0x2d')][_0x4977('0x2e')]);_0x487e6c['query']=_[_0x4977('0x32')](_0x30d0d7[_0x4977('0x33')]);_0x487e6c[_0x4977('0x34')]=_[_0x4977('0x35')](_0x487e6c['model'],_0x487e6c[_0x4977('0x33')]);_0x492ef5['attributes']=_['intersection'](_0x487e6c[_0x4977('0x37')],qs[_0x4977('0x38')](_0x30d0d7[_0x4977('0x33')][_0x4977('0x38')]));_0x492ef5[_0x4977('0x36')]=_0x492ef5[_0x4977('0x36')][_0x4977('0x39')]?_0x492ef5[_0x4977('0x36')]:_0x487e6c['model'];if(_0x30d0d7['query'][_0x4977('0x43')]){_0x492ef5[_0x4977('0x44')]=[{'all':!![]}];}_0x492ef5=_[_0x4977('0x41')]({},_0x492ef5,_0x30d0d7['options']);return db[_0x4977('0x2d')][_0x4977('0x47')](_0x492ef5)[_0x4977('0x14')](handleEntityNotFound(_0x2fab99,null))[_0x4977('0x14')](respondWithResult(_0x2fab99,null))[_0x4977('0x1d')](handleError(_0x2fab99,null));};exports[_0x4977('0x25')]=function(_0x20d036,_0xec65b3){if(_0x20d036[_0x4977('0x48')]['id']){delete _0x20d036[_0x4977('0x48')]['id'];}return db[_0x4977('0x2d')][_0x4977('0x47')]({'where':{'id':_0x20d036['params']['id']}})[_0x4977('0x14')](handleEntityNotFound(_0xec65b3,null))[_0x4977('0x14')](saveUpdates(_0x20d036['body'],null))['then'](respondWithResult(_0xec65b3,null))[_0x4977('0x1d')](handleError(_0xec65b3,null));};exports[_0x4977('0x26')]=function(_0x42bc95,_0x131642){return db[_0x4977('0x2d')]['find']({'where':{'id':_0x42bc95['params']['id']}})['then'](handleEntityNotFound(_0x131642,null))[_0x4977('0x14')](removeEntity(_0x131642,null))[_0x4977('0x1d')](handleError(_0x131642,null));};exports[_0x4977('0x49')]=function(_0x5805af,_0x2877ef){return db[_0x4977('0x2d')][_0x4977('0x49')]()[_0x4977('0x14')](respondWithResult(_0x2877ef,null))['catch'](handleError(_0x2877ef,null));};exports[_0x4977('0x4a')]=function(_0x31961c,_0x13b60d){return db[_0x4977('0x2d')][_0x4977('0x4a')](_0x31961c[_0x4977('0x48')])[_0x4977('0x14')](function(_0x59b366){if(_0x59b366){if(_0x59b366[_0x4977('0x4b')]===_0x4977('0x4c')&&!_0x59b366[_0x4977('0x4d')]){var _0x162e3b,_0x17c332,_0x660b10;if(_0x31961c[_0x4977('0x48')]['to']){_0x17c332=_0x31961c[_0x4977('0x48')]['to'][_0x4977('0x4e')](',')[0x0];}return db[_0x4977('0x4f')]['findOne']({'where':{'id':_0x59b366[_0x4977('0x50')]},'include':[{'model':db[_0x4977('0x51')],'as':'List','include':[{'model':db[_0x4977('0x52')],'as':_0x4977('0x53'),'where':{'email':_0x17c332},'limit':0x1,'order':[[_0x4977('0x54'),_0x4977('0x55')]]}]},{'model':db['MailServerOut'],'as':_0x4977('0x56'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x35c0e7){_0x162e3b=_0x35c0e7;if(!_0x162e3b||!_0x162e3b[_0x4977('0x56')])return;var _0x5f1f85=_0x162e3b[_0x4977('0x57')]();if(_0x31961c[_0x4977('0x48')][_0x4977('0x58')]&&_0x31961c['body'][_0x4977('0x58')][_0x4977('0x39')]){for(var _0x245d90=0x0;_0x245d90<_0x31961c['body'][_0x4977('0x58')][_0x4977('0x39')];_0x245d90+=0x1){_0x31961c[_0x4977('0x48')][_0x4977('0x58')][_0x245d90]={'filename':_0x31961c[_0x4977('0x48')][_0x4977('0x58')][_0x245d90][_0x4977('0x29')],'path':path[_0x4977('0x59')](config[_0x4977('0x5a')],'server/files/attachments',_0x31961c[_0x4977('0x48')]['attachments'][_0x245d90][_0x4977('0x5b')])};}}_0x660b10={'account':_0x5f1f85,'message':_0x31961c['body']};return;})[_0x4977('0x14')](function(){if(_0x162e3b[_0x4977('0x5c')]){if(_0x162e3b[_0x4977('0x5c')]['Contacts']['length']){return _0x162e3b[_0x4977('0x5c')]['Contacts'][0x0];}else{return db[_0x4977('0x52')][_0x4977('0x4a')](_[_0x4977('0x5d')](_0x31961c['body'],{'firstName':_0x31961c[_0x4977('0x48')]['to'],'email':_0x31961c[_0x4977('0x48')]['to'],'phone':_0x31961c[_0x4977('0x48')]['to'],'ListId':_0x162e3b[_0x4977('0x5e')]}));}}else{throw new Error(_0x4977('0x5f'));}})['then'](function(){if(_0x660b10){return respondWithRpcPromise(_0x4977('0x60'),_0x4977('0x61'),_0x660b10,client9003)[_0x4977('0x14')](function(_0x453391){return _0x59b366[_0x4977('0x25')]({'read':!![],'messageId':_0x453391[_0x4977('0x62')],'sentAt':moment()['format'](_0x4977('0x63'))});})[_0x4977('0x1d')](function(_0x90613f){logger[_0x4977('0x1a')]('%s',JSON[_0x4977('0x19')](_0x90613f));return _0x59b366;});}return _0x59b366;});}return _0x59b366;}})['then'](respondWithResult(_0x13b60d,0xc9))[_0x4977('0x1d')](handleError(_0x13b60d,null));};exports[_0x4977('0x64')]=function(_0x465f4c,_0x2fc2a8){var _0x3218b5={'agent':{},'channel':_0x4977('0x65')};if(_0x465f4c['body']['id']){delete _0x465f4c[_0x4977('0x48')]['id'];}_0x465f4c[_0x4977('0x48')][_0x4977('0x66')]=!![];_0x465f4c['body'][_0x4977('0x67')]=moment()[_0x4977('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x465f4c[_0x4977('0x48')][_0x4977('0x69')]=_0x465f4c[_0x4977('0x48')][_0x4977('0x69')]||_0x465f4c[_0x4977('0x6a')]['id'];_0x3218b5['agent']['id']=_0x465f4c[_0x4977('0x48')][_0x4977('0x69')];return db[_0x4977('0x2d')]['find']({'where':{'id':_0x465f4c[_0x4977('0x6b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2fc2a8,null))[_0x4977('0x14')](saveUpdates(_0x465f4c['body'],null))[_0x4977('0x14')](function(_0x1d7822){if(_0x1d7822){_0x3218b5['message']=_0x1d7822['get']({'plain':!![]});return db[_0x4977('0x6c')][_0x4977('0x47')]({'where':{'id':_0x1d7822[_0x4977('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x2fc2a8,null))['then'](function(_0x4ea91f){if(_0x4ea91f){return _0x4ea91f[_0x4977('0x25')]({'UserId':_0x465f4c[_0x4977('0x48')][_0x4977('0x69')],'read1stAt':_['isNil'](_0x4ea91f[_0x4977('0x6e')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4977('0x14')](function(_0x1ecc15){if(_0x1ecc15){_0x3218b5[_0x4977('0x6f')]=_0x1ecc15[_0x4977('0x70')]({'plain':!![]});interaction_log['info'](_0x4977('0x71'),_0x465f4c['user']['id'],_0x465f4c['user'][_0x4977('0x29')],_0x465f4c[_0x4977('0x6a')][_0x4977('0x72')],_0x3218b5[_0x4977('0x6f')]['id'],_0x465f4c['body']?JSON[_0x4977('0x19')](_0x465f4c[_0x4977('0x48')]):_0x4977('0x73'));return respondWithRpcPromise('AcceptMessage',_0x4977('0x74'),_0x3218b5);}return null;})[_0x4977('0x14')](function(_0x4b044c){var _0x3f129d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b044c[_0x4977('0x1b')][_0x4977('0x75')];return db[_0x4977('0x76')]['query'](_0x3f129d,{'type':db[_0x4977('0x77')][_0x4977('0x78')]['SELECT'],'raw':!![]})[_0x4977('0x14')](function(_0x2c23cd){return _0x2c23cd;});})['then'](function(_0x309c6f){if(_0x309c6f){_0x3218b5[_0x4977('0x1b')]['contact']=_0x309c6f[0x0];if(!_0x465f4c[_0x4977('0x48')][_0x4977('0x69')])return;return db['User'][_0x4977('0x47')]({'where':{'id':_0x465f4c[_0x4977('0x48')][_0x4977('0x69')],'role':_0x4977('0x79')},'attributes':['id',_0x4977('0x29'),'fullname',_0x4977('0x7a'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2d5e4d){if(!_0x2d5e4d)return null;_0x3218b5[_0x4977('0x1b')][_0x4977('0x79')]=_0x2d5e4d;return _0x3218b5;})[_0x4977('0x14')](function(_0x1e736f){if(_0x1e736f){if(_0x465f4c[_0x4977('0x48')][_0x4977('0x7b')]){_0x3218b5['message']['interface']=util[_0x4977('0x68')](_0x4977('0x7c'),_0x465f4c['user'][_0x4977('0x29')]);_0x3218b5['message'][_0x4977('0x7d')]=_0x3218b5[_0x4977('0x7d')];_0x3218b5[_0x4977('0x1b')][_0x4977('0x7e')]=_0x3218b5['channel'];_0x3218b5[_0x4977('0x1b')][_0x4977('0x7f')]='accept';_0x3218b5[_0x4977('0x1b')][_0x4977('0x48')]=htmlToText[_0x4977('0x80')](_0x3218b5[_0x4977('0x1b')][_0x4977('0x48')]);return respondWithRpcPromise(_0x4977('0x81'),_0x4977('0x81'),{'event':_0x4977('0x82'),'message':_0x3218b5[_0x4977('0x1b')]},client9002)[_0x4977('0x14')](function(){return _0x3218b5;});}return _0x3218b5;}return null;})[_0x4977('0x14')](respondWithResult(_0x2fc2a8,null))[_0x4977('0x1d')](handleError(_0x2fc2a8,null));};exports[_0x4977('0x83')]=function(_0x42aa33,_0x5c875b){var _0x2492c0={'agent':{},'channel':_0x4977('0x65')};if(_0x42aa33[_0x4977('0x48')]['id']){delete _0x42aa33[_0x4977('0x48')]['id'];}_0x42aa33[_0x4977('0x48')][_0x4977('0x69')]=_0x42aa33[_0x4977('0x48')][_0x4977('0x69')]||_0x42aa33[_0x4977('0x6a')]['id'];_0x2492c0[_0x4977('0x79')]['id']=_0x42aa33['body'][_0x4977('0x69')];return db['MailMessage'][_0x4977('0x47')]({'where':{'id':_0x42aa33[_0x4977('0x6b')]['id'],'UserId':null}})[_0x4977('0x14')](handleEntityNotFound(_0x5c875b,null))[_0x4977('0x14')](function(_0x524902){if(_0x524902){_0x2492c0[_0x4977('0x1b')]=_0x524902[_0x4977('0x70')]({'plain':!![]});return db['MailInteraction'][_0x4977('0x47')]({'where':{'id':_0x524902[_0x4977('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x5c875b,null))['then'](function(_0x245e88){if(_0x245e88){_0x2492c0[_0x4977('0x6f')]=_0x245e88[_0x4977('0x70')]({'plain':!![]});interaction_log['info'](_0x4977('0x84'),_0x42aa33['user']['id'],_0x42aa33[_0x4977('0x6a')][_0x4977('0x29')],_0x42aa33[_0x4977('0x6a')][_0x4977('0x72')],_0x2492c0[_0x4977('0x6f')]['id'],_0x42aa33['body']?JSON[_0x4977('0x19')](_0x42aa33['body']):_0x4977('0x73'));return respondWithRpcPromise(_0x4977('0x85'),_0x4977('0x86'),_0x2492c0);}return null;})['then'](function(_0x24505f){var _0x3de6d1=_0x4977('0x87')+_0x24505f[_0x4977('0x1b')]['ContactId'];return db['sequelize'][_0x4977('0x33')](_0x3de6d1,{'type':db[_0x4977('0x77')][_0x4977('0x78')]['SELECT'],'raw':!![]})[_0x4977('0x14')](function(_0x42cc82){return _0x42cc82;});})[_0x4977('0x14')](function(_0x1649c6){if(_0x1649c6){_0x2492c0['message'][_0x4977('0x88')]=_0x1649c6[0x0];if(!_0x42aa33['body'][_0x4977('0x69')])return;return db[_0x4977('0x89')][_0x4977('0x47')]({'where':{'id':_0x42aa33[_0x4977('0x48')][_0x4977('0x69')],'role':_0x4977('0x79')},'attributes':['id',_0x4977('0x29'),'fullname',_0x4977('0x7a'),_0x4977('0x8a')],'raw':!![]});}return null;})[_0x4977('0x14')](function(_0x45608d){if(!_0x45608d)return null;_0x2492c0[_0x4977('0x1b')]['agent']=_0x45608d;return _0x2492c0;})[_0x4977('0x14')](function(_0x40fcc2){if(_0x40fcc2){_0x40fcc2['message'][_0x4977('0x8b')]=util[_0x4977('0x68')](_0x4977('0x7c'),_0x42aa33[_0x4977('0x6a')][_0x4977('0x29')]);_0x40fcc2[_0x4977('0x1b')][_0x4977('0x7d')]=_0x2492c0[_0x4977('0x7d')];_0x40fcc2[_0x4977('0x1b')]['motionChannel']=_0x2492c0[_0x4977('0x7d')];_0x40fcc2[_0x4977('0x1b')][_0x4977('0x7f')]='reject';_0x40fcc2[_0x4977('0x1b')]['body']=htmlToText['fromString'](_0x2492c0['message'][_0x4977('0x48')]);respondWithRpcPromise(_0x4977('0x81'),'EventManager',{'event':_0x4977('0x8c'),'message':_0x40fcc2[_0x4977('0x1b')]},client9002);return _0x2492c0;}return null;})['then'](respondWithResult(_0x5c875b,null))[_0x4977('0x1d')](handleError(_0x5c875b,null));};exports[_0x4977('0x8d')]=function(_0x218946,_0x300b81){var _0x51fa26=moment()[_0x4977('0x8e')]()[_0x4977('0x8f')]();var _0x790a5f=path['join'](config[_0x4977('0x5a')],_0x4977('0x90'),_0x4977('0x91'),_0x4977('0x92'));var _0x4bb958=path[_0x4977('0x59')](config[_0x4977('0x5a')],_0x4977('0x90'),'files',_0x4977('0x58'));var _0x39df41=util[_0x4977('0x68')](_0x4977('0x93'),_0x51fa26);return db['MailMessage'][_0x4977('0x47')]({'where':{'id':_0x218946['params']['id']},'attributes':['id',_0x4977('0x48'),_0x4977('0x94'),'to','cc',_0x4977('0x95'),_0x4977('0x96'),_0x4977('0x97')],'include':_0x218946[_0x4977('0x33')][_0x4977('0x58')]?[{'model':db['Attachment'],'as':_0x4977('0x98')}]:undefined})[_0x4977('0x14')](handleEntityNotFound(_0x300b81,null))[_0x4977('0x14')](function(_0x389bf0){if(_0x389bf0){var _0x18bc05=_0x389bf0;var _0x42a4d9={'from':_0x18bc05[_0x4977('0x94')],'to':_0x18bc05['to'],'subject':_0x18bc05['subject'],'html':htmlEntities[_0x4977('0x99')](_0x18bc05['body']),'headers':{'Date':moment(_0x18bc05[_0x4977('0x97')])['format'](_0x4977('0x9a'))},'attachments':[]};if(_0x389bf0['cc']){_0x42a4d9[_0x4977('0x9b')]['Cc']=_0x389bf0['cc'];}if(_0x389bf0[_0x4977('0x95')]){_0x42a4d9[_0x4977('0x9b')][_0x4977('0x9c')]=_0x389bf0['bcc'];}return new BPromise(function(_0x5b9f79,_0x512f6e){if(_0x389bf0['Attachments']){for(var _0x1c6ea1=0x0;_0x1c6ea1<_0x389bf0['Attachments']['length'];_0x1c6ea1++){var _0x55c253=_0x389bf0[_0x4977('0x98')][_0x1c6ea1];var _0x4b86e8=path['join'](_0x4bb958,_0x55c253[_0x4977('0x5b')]);if(fs[_0x4977('0x9d')](_0x4b86e8)){_0x42a4d9[_0x4977('0x58')]['push']({'name':_0x55c253['name'],'contentType':_0x55c253['type'],'data':fs[_0x4977('0x9e')](_0x4b86e8)});}}}emlformat[_0x4977('0x9f')](_0x42a4d9,function(_0x3d5971,_0x52750f){if(_0x3d5971)return _0x512f6e(_0x3d5971);fs[_0x4977('0xa0')](path['join'](_0x790a5f,_0x39df41),_0x52750f);return _0x5b9f79(_0x52750f);});});}})['then'](function(_0x1f4611){if(_0x1f4611){return _0x300b81[_0x4977('0x8d')](path[_0x4977('0x59')](_0x790a5f,_0x39df41),_0x39df41,function(_0x41d4e4){if(!_0x41d4e4)fs[_0x4977('0xa1')](path[_0x4977('0x59')](_0x790a5f,_0x39df41));});}})[_0x4977('0x1d')](handleError(_0x300b81,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 90f4a2a..32c510d 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 _0x674d=['hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x674d,0x14c));var _0xd674=function(_0x4c742f,_0x2bd40a){_0x4c742f=_0x4c742f-0x0;var _0x2913ae=_0x674d[_0x4c742f];return _0x2913ae;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xd674('0x0'))['db'][_0xd674('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xd674('0x2')](0x0);var events={'afterCreate':_0xd674('0x3'),'afterUpdate':_0xd674('0x4'),'afterDestroy':_0xd674('0x5')};function emitEvent(_0x151dd9){return function(_0x1c8b45,_0x521228,_0x3bb240){MailMessageEvents['emit'](_0x151dd9+':'+_0x1c8b45['id'],_0x1c8b45);MailMessageEvents[_0xd674('0x6')](_0x151dd9,_0x1c8b45);_0x3bb240(null);};}for(var e in events){if(events[_0xd674('0x7')](e)){var event=events[e];MailMessage[_0xd674('0x8')](e,emitEvent(event));}}module[_0xd674('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x6abe=['emit','hasOwnProperty','exports','../../mysqldb','MailMessage','setMaxListeners','save','remove'];(function(_0x346f5a,_0x33de62){var _0x2c1254=function(_0x20c734){while(--_0x20c734){_0x346f5a['push'](_0x346f5a['shift']());}};_0x2c1254(++_0x33de62);}(_0x6abe,0xcb));var _0xe6ab=function(_0x480aa2,_0x33f309){_0x480aa2=_0x480aa2-0x0;var _0x459614=_0x6abe[_0x480aa2];return _0x459614;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xe6ab('0x0'))['db'][_0xe6ab('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe6ab('0x2')](0x0);var events={'afterCreate':_0xe6ab('0x3'),'afterUpdate':'update','afterDestroy':_0xe6ab('0x4')};function emitEvent(_0x3f3b23){return function(_0x2a725a,_0x29902a,_0x46f08f){MailMessageEvents[_0xe6ab('0x5')](_0x3f3b23+':'+_0x2a725a['id'],_0x2a725a);MailMessageEvents[_0xe6ab('0x5')](_0x3f3b23,_0x2a725a);_0x46f08f(null);};}for(var e in events){if(events[_0xe6ab('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xe6ab('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 2a48c79..f33ca59 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 _0x5434=['out','secret','isNil','UserId','MailInteractionId','update','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models','get','direction','toLowerCase'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x5434,0x99));var _0x4543=function(_0xdcb378,_0xbac002){_0xdcb378=_0xdcb378-0x0;var _0x289172=_0x5434[_0xdcb378];return _0x289172;};'use strict';var _=require(_0x4543('0x0'));var util=require('util');var logger=require(_0x4543('0x1'))(_0x4543('0x2'));var moment=require('moment');var BPromise=require(_0x4543('0x3'));var rp=require(_0x4543('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x4543('0x5'));var rimraf=require(_0x4543('0x6'));var config=require(_0x4543('0x7'));var attributes=require(_0x4543('0x8'));module[_0x4543('0x9')]=function(_0x5867d9,_0x1f5ee3){return _0x5867d9[_0x4543('0xa')]('MailMessage',attributes,{'tableName':_0x4543('0xb'),'paranoid':![],'indexes':[{'name':_0x4543('0xc'),'fields':['messageId']},{'name':_0x4543('0xd'),'fields':[_0x4543('0xe'),_0x4543('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xf79bde,_0x17f2f2,_0x36a5e3){if(_0xf79bde['body']){_0xf79bde['plainBody']=htmlToText['fromString'](_0xf79bde[_0x4543('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x36a5e3(null,_0x17f2f2);},'afterCreate':function(_0xe64112,_0x15a025,_0xa0b497){var _0x4b4d8d=_0x5867d9[_0x4543('0x11')];var _0x2e7ae0=_0xe64112[_0x4543('0x12')]({'plain':!![]});if(_0x2e7ae0['direction']['toLowerCase']()==='in'||_0x2e7ae0[_0x4543('0x13')][_0x4543('0x14')]()===_0x4543('0x15')&&!_0x2e7ae0[_0x4543('0x16')]&&!_[_0x4543('0x17')](_0x2e7ae0[_0x4543('0x18')])){_0x4b4d8d['MailInteraction']['findOne']({'where':{'id':_0x2e7ae0[_0x4543('0x19')]}})['then'](function(_0x484450){if(_0x484450){_0x484450[_0x4543('0x1a')]({'lastMsgAt':_0x2e7ae0['createdAt'],'lastMsgDirection':_0x2e7ae0[_0x4543('0x13')]['toLowerCase']()});}})['catch'](function(_0x6d038a){console['error'](_0x6d038a);});}_0xa0b497();}},'charset':_0x4543('0x1b'),'collate':_0x4543('0x1c')});}; \ No newline at end of file +var _0xe1ee=['rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','plainBody','fromString','body','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','util','../../config/logger','api','moment','request-promise','html-to-text','path'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xe1ee,0x143));var _0xee1e=function(_0x1792c6,_0x5e5f01){_0x1792c6=_0x1792c6-0x0;var _0x250b50=_0xe1ee[_0x1792c6];return _0x250b50;};'use strict';var _=require('lodash');var util=require(_0xee1e('0x0'));var logger=require(_0xee1e('0x1'))(_0xee1e('0x2'));var moment=require(_0xee1e('0x3'));var BPromise=require('bluebird');var rp=require(_0xee1e('0x4'));var htmlToText=require(_0xee1e('0x5'));var fs=require('fs');var path=require(_0xee1e('0x6'));var rimraf=require(_0xee1e('0x7'));var config=require(_0xee1e('0x8'));var attributes=require(_0xee1e('0x9'));module['exports']=function(_0x35d47a,_0x6e526d){return _0x35d47a[_0xee1e('0xa')](_0xee1e('0xb'),attributes,{'tableName':_0xee1e('0xc'),'paranoid':![],'indexes':[{'name':_0xee1e('0xd'),'fields':[_0xee1e('0xd')]},{'name':_0xee1e('0xe'),'fields':['plainBody',_0xee1e('0xf')],'type':_0xee1e('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x989436,_0x37cdf1,_0x1b04e9){if(_0x989436['body']){_0x989436[_0xee1e('0x11')]=htmlToText[_0xee1e('0x12')](_0x989436[_0xee1e('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1b04e9(null,_0x37cdf1);},'afterCreate':function(_0x421d91,_0x26878e,_0x2bdb25){var _0x3f5301=_0x35d47a[_0xee1e('0x14')];var _0x5f2e94=_0x421d91[_0xee1e('0x15')]({'plain':!![]});if(_0x5f2e94[_0xee1e('0x16')][_0xee1e('0x17')]()==='in'||_0x5f2e94['direction'][_0xee1e('0x17')]()==='out'&&!_0x5f2e94[_0xee1e('0x18')]&&!_[_0xee1e('0x19')](_0x5f2e94[_0xee1e('0x1a')])){_0x3f5301[_0xee1e('0x1b')][_0xee1e('0x1c')]({'where':{'id':_0x5f2e94[_0xee1e('0x1d')]}})[_0xee1e('0x1e')](function(_0x420609){if(_0x420609){_0x420609['update']({'lastMsgAt':_0x5f2e94[_0xee1e('0x1f')],'lastMsgDirection':_0x5f2e94[_0xee1e('0x16')][_0xee1e('0x17')]()});}})[_0xee1e('0x20')](function(_0x313fde){console['error'](_0x313fde);});}_0x2bdb25();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 43e9ab2..03b051e 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 _0x1775=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','MailMessage','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5f3905,_0x43a651){var _0x2923b1=function(_0x3c72d8){while(--_0x3c72d8){_0x5f3905['push'](_0x5f3905['shift']());}};_0x2923b1(++_0x43a651);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});config[_0x5177('0xd')]=_[_0x5177('0xe')](config[_0x5177('0xd')],{'host':_0x5177('0xf'),'port':0x18eb});var socket=require(_0x5177('0x10'))(new Redis(config[_0x5177('0xd')]));require(_0x5177('0x11'))[_0x5177('0x12')](socket);function respondWithRpcPromise(_0x206035,_0x5bdca9,_0x4ae3d2){return new BPromise(function(_0x13c7f6,_0x1d7116){return client[_0x5177('0x13')](_0x206035,_0x4ae3d2)[_0x5177('0x14')](function(_0x301db2){logger['info'](_0x5177('0x15'),_0x5bdca9,_0x5177('0x16'));logger[_0x5177('0x17')](_0x5177('0x18'),_0x5bdca9,_0x5177('0x16'),JSON[_0x5177('0x19')](_0x301db2));if(_0x301db2[_0x5177('0x1a')]){if(_0x301db2[_0x5177('0x1a')][_0x5177('0x1b')]===0x1f4){logger[_0x5177('0x1a')](_0x5177('0x15'),_0x5bdca9,_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);return _0x1d7116(_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);}logger[_0x5177('0x1a')](_0x5177('0x15'),_0x5bdca9,_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);return _0x13c7f6(_0x301db2['error'][_0x5177('0x1c')]);}else{logger[_0x5177('0x1d')](_0x5177('0x15'),_0x5bdca9,_0x5177('0x16'));_0x13c7f6(_0x301db2['result'][_0x5177('0x1c')]);}})[_0x5177('0x1e')](function(_0x13d5d4){logger['error'](_0x5177('0x15'),_0x5bdca9,_0x13d5d4);_0x1d7116(_0x13d5d4);});});}exports['CreateMailMessage']=function(_0xc2b2b5){var _0xe221b3=this;return new Promise(function(_0x219744,_0x27b732){return db[_0x5177('0x1f')][_0x5177('0x20')](_0xc2b2b5[_0x5177('0x21')],{'raw':_0xc2b2b5[_0x5177('0x22')]?_0xc2b2b5[_0x5177('0x22')][_0x5177('0x23')]===undefined?!![]:![]:!![]})[_0x5177('0x14')](function(_0x3b0c37){logger['info'](_0x5177('0x24'),_0xc2b2b5);logger['debug'](_0x5177('0x24'),_0xc2b2b5,JSON[_0x5177('0x19')](_0x3b0c37));_0x219744(_0x3b0c37);})[_0x5177('0x1e')](function(_0x2d51d0){logger['error'](_0x5177('0x24'),_0x2d51d0['message'],_0xc2b2b5);_0x27b732(_0xe221b3['error'](0x1f4,_0x2d51d0[_0x5177('0x1c')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','MailMessage','create','body','options','raw','CreateMailMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','then','MailMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0xfd4811,_0x5aa63c){var _0x2b48af=function(_0x59d074){while(--_0x59d074){_0xfd4811['push'](_0xfd4811['shift']());}};_0x2b48af(++_0x5aa63c);}(_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});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')]('MailMessage,\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')]('MailMessage,\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')]('MailMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateMailMessage']=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']('CreateMailMessage',_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/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 3a4e191..d2dc433 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 _0x145c=['emit','register','length','mailMessage:','./mailMessage.events','remove','update'];(function(_0x8a6714,_0x388b5b){var _0x2eb9e2=function(_0x4643e4){while(--_0x4643e4){_0x8a6714['push'](_0x8a6714['shift']());}};_0x2eb9e2(++_0x388b5b);}(_0x145c,0x193));var _0xc145=function(_0x44f9f9,_0x331b68){_0x44f9f9=_0x44f9f9-0x0;var _0x53dcaf=_0x145c[_0x44f9f9];return _0x53dcaf;};'use strict';var MailMessageEvents=require(_0xc145('0x0'));var events=['save',_0xc145('0x1'),_0xc145('0x2')];function createListener(_0xc905a8,_0x4a00f5){return function(_0x15c223){_0x4a00f5[_0xc145('0x3')](_0xc905a8,_0x15c223);};}function removeListener(_0x2f613e,_0x31cd04){return function(){MailMessageEvents['removeListener'](_0x2f613e,_0x31cd04);};}exports[_0xc145('0x4')]=function(_0x492d38){for(var _0x322713=0x0,_0x4dafeb=events[_0xc145('0x5')];_0x322713<_0x4dafeb;_0x322713++){var _0x5f9c17=events[_0x322713];var _0x1547c6=createListener(_0xc145('0x6')+_0x5f9c17,_0x492d38);MailMessageEvents['on'](_0x5f9c17,_0x1547c6);}}; \ No newline at end of file +var _0x1928=['./mailMessage.events','save','remove','update','emit','removeListener','register','length','mailMessage:'];(function(_0xb6a965,_0x5c5ace){var _0x51d37d=function(_0x1c7c0d){while(--_0x1c7c0d){_0xb6a965['push'](_0xb6a965['shift']());}};_0x51d37d(++_0x5c5ace);}(_0x1928,0x183));var _0x8192=function(_0x2dc9bd,_0x46f762){_0x2dc9bd=_0x2dc9bd-0x0;var _0x39bc3e=_0x1928[_0x2dc9bd];return _0x39bc3e;};'use strict';var MailMessageEvents=require(_0x8192('0x0'));var events=[_0x8192('0x1'),_0x8192('0x2'),_0x8192('0x3')];function createListener(_0x323c7e,_0x16c2a7){return function(_0x382ec7){_0x16c2a7[_0x8192('0x4')](_0x323c7e,_0x382ec7);};}function removeListener(_0xcafdfd,_0xfa58df){return function(){MailMessageEvents[_0x8192('0x5')](_0xcafdfd,_0xfa58df);};}exports[_0x8192('0x6')]=function(_0x4f19f0){for(var _0x4f5426=0x0,_0x266c31=events[_0x8192('0x7')];_0x4f5426<_0x266c31;_0x4f5426++){var _0xf8d882=events[_0x4f5426];var _0x1f3f76=createListener(_0x8192('0x8')+_0xf8d882,_0x4f19f0);MailMessageEvents['on'](_0xf8d882,_0x1f3f76);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index d21e2ac..16a1e2f 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 _0xe620=['post','/:id/teams','addTeams','/:id/users','put','update','delete','destroy','removeTeams','removeAgents','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','getTeams','getAgents'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xe620,0x182));var _0x0e62=function(_0x5dfee3,_0x5e3bbe){_0x5dfee3=_0x5dfee3-0x0;var _0x1e1785=_0xe620[_0x5dfee3];return _0x1e1785;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0e62('0x0'));var express=require(_0x0e62('0x1'));var router=express['Router']();var fs_extra=require(_0x0e62('0x2'));var auth=require(_0x0e62('0x3'));var interaction=require(_0x0e62('0x4'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x0e62('0x5')]('/',auth[_0x0e62('0x6')](),controller['index']);router['get'](_0x0e62('0x7'),auth['isAuthenticated'](),controller[_0x0e62('0x8')]);router[_0x0e62('0x5')](_0x0e62('0x9'),auth[_0x0e62('0x6')](),controller['show']);router[_0x0e62('0x5')](_0x0e62('0xa'),auth['isAuthenticated'](),controller[_0x0e62('0xb')]);router[_0x0e62('0x5')]('/:id/teams',auth[_0x0e62('0x6')](),controller[_0x0e62('0xc')]);router[_0x0e62('0x5')]('/:id/users',auth[_0x0e62('0x6')](),controller[_0x0e62('0xd')]);router[_0x0e62('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0e62('0xe')](_0x0e62('0xf'),auth[_0x0e62('0x6')](),controller[_0x0e62('0x10')]);router[_0x0e62('0xe')](_0x0e62('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0x0e62('0x12')]('/:id',auth[_0x0e62('0x6')](),controller[_0x0e62('0x13')]);router[_0x0e62('0x14')]('/:id',auth[_0x0e62('0x6')](),controller[_0x0e62('0x15')]);router[_0x0e62('0x14')](_0x0e62('0xf'),auth[_0x0e62('0x6')](),controller[_0x0e62('0x16')]);router[_0x0e62('0x14')](_0x0e62('0x11'),auth[_0x0e62('0x6')](),controller[_0x0e62('0x17')]);module[_0x0e62('0x18')]=router; \ No newline at end of file +var _0x5dd1=['index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated'];(function(_0x303329,_0xc03595){var _0x5b0c50=function(_0x10bf13){while(--_0x10bf13){_0x303329['push'](_0x303329['shift']());}};_0x5b0c50(++_0xc03595);}(_0x5dd1,0x104));var _0x15dd=function(_0x3b9113,_0x5b5516){_0x3b9113=_0x3b9113-0x0;var _0x38d86f=_0x5dd1[_0x3b9113];return _0x38d86f;};'use strict';var multer=require('multer');var util=require(_0x15dd('0x0'));var path=require('path');var timeout=require(_0x15dd('0x1'));var express=require(_0x15dd('0x2'));var router=express[_0x15dd('0x3')]();var fs_extra=require(_0x15dd('0x4'));var auth=require(_0x15dd('0x5'));var interaction=require(_0x15dd('0x6'));var config=require('../../config/environment');var controller=require(_0x15dd('0x7'));router[_0x15dd('0x8')]('/',auth[_0x15dd('0x9')](),controller[_0x15dd('0xa')]);router[_0x15dd('0x8')](_0x15dd('0xb'),auth[_0x15dd('0x9')](),controller['describe']);router[_0x15dd('0x8')](_0x15dd('0xc'),auth[_0x15dd('0x9')](),controller['show']);router[_0x15dd('0x8')](_0x15dd('0xd'),auth[_0x15dd('0x9')](),controller[_0x15dd('0xe')]);router['get'](_0x15dd('0xf'),auth[_0x15dd('0x9')](),controller[_0x15dd('0x10')]);router[_0x15dd('0x8')](_0x15dd('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0x15dd('0x12')]('/',auth['isAuthenticated'](),controller[_0x15dd('0x13')]);router['post'](_0x15dd('0xf'),auth[_0x15dd('0x9')](),controller[_0x15dd('0x14')]);router[_0x15dd('0x12')](_0x15dd('0x11'),auth[_0x15dd('0x9')](),controller[_0x15dd('0x15')]);router[_0x15dd('0x16')](_0x15dd('0xc'),auth[_0x15dd('0x9')](),controller['update']);router[_0x15dd('0x17')](_0x15dd('0xc'),auth[_0x15dd('0x9')](),controller[_0x15dd('0x18')]);router[_0x15dd('0x17')](_0x15dd('0xf'),auth[_0x15dd('0x9')](),controller[_0x15dd('0x19')]);router[_0x15dd('0x17')](_0x15dd('0x11'),auth[_0x15dd('0x9')](),controller[_0x15dd('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 14261cc..507fbe2 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 _0xae61=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x12dd11,_0x52b882){var _0x3a502b=function(_0x1a660d){while(--_0x1a660d){_0x12dd11['push'](_0x12dd11['shift']());}};_0x3a502b(++_0x52b882);}(_0xae61,0x132));var _0x1ae6=function(_0x5e6b64,_0x5b1e25){_0x5e6b64=_0x5e6b64-0x0;var _0x2a03ce=_0xae61[_0x5e6b64];return _0x2a03ce;};'use strict';var Sequelize=require(_0x1ae6('0x0'));module[_0x1ae6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1ae6('0x2')]},'timeout':{'type':Sequelize[_0x1ae6('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ae6('0x4')](_0x1ae6('0x5'),_0x1ae6('0x6'),_0x1ae6('0x7'))}}; \ No newline at end of file +var _0x59c2=['name','INTEGER','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x59c2,0xeb));var _0x259c=function(_0x51eb91,_0x4799d5){_0x51eb91=_0x51eb91-0x0;var _0x1c4fc4=_0x59c2[_0x51eb91];return _0x1c4fc4;};'use strict';var Sequelize=require(_0x259c('0x0'));module[_0x259c('0x1')]={'name':{'type':Sequelize[_0x259c('0x2')],'unique':_0x259c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x259c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x259c('0x5'),_0x259c('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 8105ee6..852c965 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 _0x8cfd=['sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','UserProfileResource','destroy','stack','name','send','index','map','fieldName','type','key','getOptions','MailQueue','include','query','findAll','rows','catch','params','model','keys','rawAttributes','filters','intersection','fields','attributes','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','length','nolimit','order','sort','where','pick','MailQueueId','filter','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','field','tq.TeamId','from','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','isArray','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis'];(function(_0x231412,_0x3cff7c){var _0x4a9bf8=function(_0x5e4569){while(--_0x5e4569){_0x231412['push'](_0x231412['shift']());}};_0x4a9bf8(++_0x3cff7c);}(_0x8cfd,0x1e7));var _0xd8cf=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x8cfd[_0x264b9b];return _0x4c7a0e;};'use strict';var BPromise=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var _=require(_0xd8cf('0x2'));var squel=require(_0xd8cf('0x3'));var Redis=require(_0xd8cf('0x4'));var qs=require(_0xd8cf('0x5'));var logger=require(_0xd8cf('0x6'))(_0xd8cf('0x7'));var config=require(_0xd8cf('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd8cf('0x9')](config['redis'],{'host':_0xd8cf('0xa'),'port':0x18eb});var socket=require(_0xd8cf('0xb'))(new Redis(config[_0xd8cf('0xc')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x2d336f,_0x241ea5){_0x241ea5=_0x241ea5||0xcc;return function(_0x22f908){if(_0x22f908){return _0x2d336f[_0xd8cf('0xd')](_0x241ea5);}return _0x2d336f['status'](_0x241ea5)[_0xd8cf('0xe')]();};}function respondWithResult(_0x283292,_0x1633df){_0x1633df=_0x1633df||0xc8;return function(_0x55b296){if(_0x55b296){return _0x283292[_0xd8cf('0xf')](_0x1633df)[_0xd8cf('0x10')](_0x55b296);}};}function respondWithFilteredResult(_0x854149,_0x1cfd38){return function(_0xa5290e){if(_0xa5290e){var _0x53e417=typeof _0x1cfd38[_0xd8cf('0x11')]===_0xd8cf('0x12')&&typeof _0x1cfd38[_0xd8cf('0x13')]===_0xd8cf('0x12');var _0x1330e8=_0xa5290e[_0xd8cf('0x14')];var _0x23a893=_0x53e417?0x0:_0x1cfd38[_0xd8cf('0x11')];var _0x5c60ed=_0x53e417?_0xa5290e[_0xd8cf('0x14')]:_0x1cfd38[_0xd8cf('0x11')]+_0x1cfd38['limit'];var _0x223e6c;if(_0x5c60ed>=_0x1330e8){_0x5c60ed=_0x1330e8;_0x223e6c=0xc8;}else{_0x223e6c=0xce;}_0x854149[_0xd8cf('0xf')](_0x223e6c);return _0x854149[_0xd8cf('0x15')](_0xd8cf('0x16'),_0x23a893+'-'+_0x5c60ed+'/'+_0x1330e8)[_0xd8cf('0x10')](_0xa5290e);}return null;};}function saveUpdates(_0x103ee6){return function(_0x1bc8ef){if(_0x1bc8ef){return _0x1bc8ef[_0xd8cf('0x17')](_0x103ee6)['then'](function(_0x528d09){return _0x528d09;});}return null;};}function removeEntity(_0xfe0a55){return function(_0x4ff7ae){if(_0x4ff7ae){return _0x4ff7ae['destroy']()[_0xd8cf('0x18')](function(){var _0x31ed41=_0x4ff7ae[_0xd8cf('0x19')]({'plain':!![]});var _0x2208d9='MailQueues';return db[_0xd8cf('0x1a')][_0xd8cf('0x1b')]({'where':{'type':_0x2208d9,'resourceId':_0x31ed41['id']}})[_0xd8cf('0x18')](function(){return _0x4ff7ae;});})['then'](function(){_0xfe0a55[_0xd8cf('0xf')](0xcc)[_0xd8cf('0xe')]();});}};}function handleEntityNotFound(_0x7a47de){return function(_0x4404fe){if(!_0x4404fe){_0x7a47de['sendStatus'](0x194);}return _0x4404fe;};}function handleError(_0x29b1a1,_0x3fdb93){_0x3fdb93=_0x3fdb93||0x1f4;return function(_0x2ee3fd){logger['error'](_0x2ee3fd[_0xd8cf('0x1c')]);if(_0x2ee3fd[_0xd8cf('0x1d')]){delete _0x2ee3fd[_0xd8cf('0x1d')];}_0x29b1a1[_0xd8cf('0xf')](_0x3fdb93)[_0xd8cf('0x1e')](_0x2ee3fd);};}exports[_0xd8cf('0x1f')]=function(_0xada016,_0x3c5b17){var _0x1005d8={};var _0x4e806c={'count':0x0,'rows':[]};var _0x106827=_[_0xd8cf('0x20')](db['MailQueue']['rawAttributes'],function(_0x37dba9){return{'name':_0x37dba9[_0xd8cf('0x21')],'type':_0x37dba9[_0xd8cf('0x22')][_0xd8cf('0x23')]};});_0x1005d8=qs[_0xd8cf('0x24')](_0x106827,_0xada016);var _0x1f0ce6={'where':_0x1005d8['where']};return db[_0xd8cf('0x25')][_0xd8cf('0x14')](_0x1f0ce6)['then'](function(_0x1bd756){_0x4e806c[_0xd8cf('0x14')]=_0x1bd756;_0x1005d8['include']=qs[_0xd8cf('0x26')](_0xada016[_0xd8cf('0x27')]);return db[_0xd8cf('0x25')][_0xd8cf('0x28')](_0x1005d8);})['then'](function(_0x332c48){_0x4e806c[_0xd8cf('0x29')]=_0x332c48;return _0x4e806c;})[_0xd8cf('0x18')](respondWithFilteredResult(_0x3c5b17,_0x1005d8))[_0xd8cf('0x2a')](handleError(_0x3c5b17,null));};exports['show']=function(_0x4ed51e,_0x20c3c1){var _0x3f3846={'raw':!![],'where':{'id':_0x4ed51e[_0xd8cf('0x2b')]['id']}},_0x1f3cf4={};_0x1f3cf4[_0xd8cf('0x2c')]=_[_0xd8cf('0x2d')](db['MailQueue'][_0xd8cf('0x2e')]);_0x1f3cf4[_0xd8cf('0x27')]=_[_0xd8cf('0x2d')](_0x4ed51e['query']);_0x1f3cf4[_0xd8cf('0x2f')]=_[_0xd8cf('0x30')](_0x1f3cf4[_0xd8cf('0x2c')],_0x1f3cf4[_0xd8cf('0x27')]);_0x3f3846['attributes']=_[_0xd8cf('0x30')](_0x1f3cf4[_0xd8cf('0x2c')],qs[_0xd8cf('0x31')](_0x4ed51e[_0xd8cf('0x27')][_0xd8cf('0x31')]));_0x3f3846[_0xd8cf('0x32')]=_0x3f3846['attributes']['length']?_0x3f3846[_0xd8cf('0x32')]:_0x1f3cf4[_0xd8cf('0x2c')];if(_0x4ed51e[_0xd8cf('0x27')][_0xd8cf('0x33')]){_0x3f3846['include']=[{'all':!![]}];}_0x3f3846=_[_0xd8cf('0x34')]({},_0x3f3846,_0x4ed51e[_0xd8cf('0x35')]);return db[_0xd8cf('0x25')][_0xd8cf('0x36')](_0x3f3846)['then'](handleEntityNotFound(_0x20c3c1,null))[_0xd8cf('0x18')](respondWithResult(_0x20c3c1,null))['catch'](handleError(_0x20c3c1,null));};exports[_0xd8cf('0x37')]=function(_0x1b1db9,_0x2c50ca){return db[_0xd8cf('0x25')][_0xd8cf('0x37')](_0x1b1db9[_0xd8cf('0x38')],{})[_0xd8cf('0x18')](function(_0x36f20a){var _0x31be13=_0x1b1db9[_0xd8cf('0x39')][_0xd8cf('0x19')]({'plain':!![]});if(!_0x31be13)throw new Error(_0xd8cf('0x3a'));if(_0x31be13[_0xd8cf('0x3b')]===_0xd8cf('0x39')){var _0x32f36a=_0x36f20a[_0xd8cf('0x19')]({'plain':!![]});var _0x5bde4c=_0xd8cf('0x3c');return db[_0xd8cf('0x3d')][_0xd8cf('0x36')]({'where':{'name':_0x5bde4c,'userProfileId':_0x31be13[_0xd8cf('0x3e')]},'raw':!![]})[_0xd8cf('0x18')](function(_0x575e31){if(_0x575e31&&_0x575e31[_0xd8cf('0x3f')]===0x0){return db[_0xd8cf('0x1a')]['create']({'name':_0x32f36a[_0xd8cf('0x1d')],'resourceId':_0x32f36a['id'],'type':_0x575e31[_0xd8cf('0x1d')],'sectionId':_0x575e31['id']},{})[_0xd8cf('0x18')](function(){return _0x36f20a;});}else{return _0x36f20a;}})[_0xd8cf('0x2a')](function(_0x4d827e){logger['error'](_0xd8cf('0x40'),_0x4d827e);throw _0x4d827e;});}return _0x36f20a;})[_0xd8cf('0x18')](respondWithResult(_0x2c50ca,0xc9))[_0xd8cf('0x2a')](handleError(_0x2c50ca,null));};exports[_0xd8cf('0x17')]=function(_0x349b9e,_0xc43605){if(_0x349b9e['body']['id']){delete _0x349b9e[_0xd8cf('0x38')]['id'];}return db[_0xd8cf('0x25')]['find']({'where':{'id':_0x349b9e[_0xd8cf('0x2b')]['id']}})['then'](handleEntityNotFound(_0xc43605,null))[_0xd8cf('0x18')](saveUpdates(_0x349b9e['body'],null))['then'](respondWithResult(_0xc43605,null))[_0xd8cf('0x2a')](handleError(_0xc43605,null));};exports[_0xd8cf('0x1b')]=function(_0x703cb7,_0x2624b7){return db[_0xd8cf('0x25')]['find']({'where':{'id':_0x703cb7[_0xd8cf('0x2b')]['id']}})[_0xd8cf('0x18')](handleEntityNotFound(_0x2624b7,null))[_0xd8cf('0x18')](removeEntity(_0x2624b7,null))[_0xd8cf('0x2a')](handleError(_0x2624b7,null));};exports[_0xd8cf('0x41')]=function(_0xb592e5,_0x52045b){return db['MailQueue'][_0xd8cf('0x41')]()[_0xd8cf('0x18')](respondWithResult(_0x52045b,null))[_0xd8cf('0x2a')](handleError(_0x52045b,null));};exports[_0xd8cf('0x42')]=function(_0x3f3570,_0x168c95){var _0x104f91={'raw':!![],'where':{}},_0x4f4902={},_0x3c31cb;return db['MailQueue'][_0xd8cf('0x43')]({'where':{'id':_0x3f3570[_0xd8cf('0x2b')]['id']}})['then'](handleEntityNotFound(_0x168c95,null))[_0xd8cf('0x18')](function(_0x42d220){if(_0x42d220){_0x3c31cb=_0x42d220[_0xd8cf('0x19')]({'plain':!![]});_0x4f4902[_0xd8cf('0x2c')]=_[_0xd8cf('0x2d')](db[_0xd8cf('0x44')][_0xd8cf('0x2e')]);_0x4f4902[_0xd8cf('0x27')]=_[_0xd8cf('0x2d')](_0x3f3570[_0xd8cf('0x27')]);_0x4f4902['filters']=_['intersection'](_0x4f4902['model'],_0x4f4902[_0xd8cf('0x27')]);_0x104f91['attributes']=_[_0xd8cf('0x30')](_0x4f4902['model'],qs[_0xd8cf('0x31')](_0x3f3570[_0xd8cf('0x27')]['fields']));_0x104f91[_0xd8cf('0x32')]=_0x104f91[_0xd8cf('0x32')][_0xd8cf('0x45')]?_0x104f91[_0xd8cf('0x32')]:_0x4f4902[_0xd8cf('0x2c')];if(!_0x3f3570[_0xd8cf('0x27')]['hasOwnProperty'](_0xd8cf('0x46'))){_0x104f91[_0xd8cf('0x13')]=qs[_0xd8cf('0x13')](_0x3f3570[_0xd8cf('0x27')][_0xd8cf('0x13')]);_0x104f91[_0xd8cf('0x11')]=qs[_0xd8cf('0x11')](_0x3f3570[_0xd8cf('0x27')][_0xd8cf('0x11')]);}_0x104f91[_0xd8cf('0x47')]=qs[_0xd8cf('0x48')](_0x3f3570['query'][_0xd8cf('0x48')]);_0x104f91[_0xd8cf('0x49')]=qs[_0xd8cf('0x2f')](_[_0xd8cf('0x4a')](_0x3f3570[_0xd8cf('0x27')],_0x4f4902['filters']));_0x104f91[_0xd8cf('0x49')][_0xd8cf('0x4b')]=_0x42d220['id'];if(_0x3f3570['query']['filter']){_0x104f91[_0xd8cf('0x49')]=_[_0xd8cf('0x34')](_0x104f91[_0xd8cf('0x49')],{'$or':_[_0xd8cf('0x20')](_0x104f91[_0xd8cf('0x32')],function(_0x3e385c){var _0x191bbc={};_0x191bbc[_0x3e385c]={'$like':'%'+_0x3f3570['query'][_0xd8cf('0x4c')]+'%'};return _0x191bbc;})});}_0x104f91=_[_0xd8cf('0x34')]({},_0x104f91,_0x3f3570[_0xd8cf('0x35')]);return db[_0xd8cf('0x44')][_0xd8cf('0x28')](_0x104f91);}})[_0xd8cf('0x18')](function(_0x3599dc){if(_0x3599dc){return db['User'][_0xd8cf('0x4d')]({'where':{'id':_[_0xd8cf('0x20')](_0x3599dc,_0xd8cf('0x4e')),'role':_0xd8cf('0x4f')},'attributes':['id','name',_0xd8cf('0x50'),_0xd8cf('0x51'),_0xd8cf('0x52')]});}})[_0xd8cf('0x18')](function(_0x265727){if(_0x265727){return{'count':_0x265727[_0xd8cf('0x14')],'rows':_[_0xd8cf('0x20')](_0x265727[_0xd8cf('0x29')],function(_0xd4cc26){return{'membername':_0xd4cc26[_0xd8cf('0x1d')],'UserId':_0xd4cc26['id'],'queue_name':_0x3c31cb[_0xd8cf('0x1d')],'MailQueueId':_0x3c31cb['id'],'interface':util[_0xd8cf('0x53')]('%s/%s',_0xd8cf('0x54'),_0xd4cc26[_0xd8cf('0x1d')]),'penalty':0x0,'paused':_0xd4cc26[_0xd8cf('0x50')],'createdAt':_0xd4cc26[_0xd8cf('0x52')],'updatedAt':_0xd4cc26[_0xd8cf('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd8cf('0x18')](respondWithFilteredResult(_0x168c95,_0x104f91))[_0xd8cf('0x2a')](handleError(_0x168c95,null));};exports[_0xd8cf('0x55')]=function(_0xaf6c3a,_0x24ccdf){var _0x39d2b2={};var _0x438471={};var _0x353cae;var _0x12a8c8;return db[_0xd8cf('0x25')][_0xd8cf('0x43')]({'where':{'id':_0xaf6c3a[_0xd8cf('0x2b')]['id']}})[_0xd8cf('0x18')](handleEntityNotFound(_0x24ccdf,null))['then'](function(_0x557c04){if(_0x557c04){_0x353cae=_0x557c04;_0x438471['model']=_[_0xd8cf('0x2d')](db[_0xd8cf('0x56')][_0xd8cf('0x2e')]);_0x438471[_0xd8cf('0x27')]=_[_0xd8cf('0x2d')](_0xaf6c3a[_0xd8cf('0x27')]);_0x438471[_0xd8cf('0x2f')]=_['intersection'](_0x438471['model'],_0x438471[_0xd8cf('0x27')]);_0x39d2b2[_0xd8cf('0x32')]=_[_0xd8cf('0x30')](_0x438471[_0xd8cf('0x2c')],qs[_0xd8cf('0x31')](_0xaf6c3a[_0xd8cf('0x27')][_0xd8cf('0x31')]));_0x39d2b2[_0xd8cf('0x32')]=_0x39d2b2['attributes']['length']?_0x39d2b2[_0xd8cf('0x32')]:_0x438471[_0xd8cf('0x2c')];_0x39d2b2[_0xd8cf('0x47')]=qs['sort'](_0xaf6c3a[_0xd8cf('0x27')][_0xd8cf('0x48')]);_0x39d2b2[_0xd8cf('0x49')]=qs[_0xd8cf('0x2f')](_[_0xd8cf('0x4a')](_0xaf6c3a[_0xd8cf('0x27')],_0x438471[_0xd8cf('0x2f')]));if(_0xaf6c3a[_0xd8cf('0x27')]['filter']){_0x39d2b2['where']=_['merge'](_0x39d2b2[_0xd8cf('0x49')],{'$or':_[_0xd8cf('0x20')](_0x39d2b2[_0xd8cf('0x32')],function(_0x1d5da5){var _0x561cac={};_0x561cac[_0x1d5da5]={'$like':'%'+_0xaf6c3a['query'][_0xd8cf('0x4c')]+'%'};return _0x561cac;})});}_0x39d2b2=_[_0xd8cf('0x34')]({},_0x39d2b2,_0xaf6c3a[_0xd8cf('0x35')]);return _0x353cae[_0xd8cf('0x55')](_0x39d2b2);}})['then'](function(_0x341380){if(_0x341380){_0x12a8c8=_0x341380[_0xd8cf('0x45')];if(!_0xaf6c3a['query']['hasOwnProperty'](_0xd8cf('0x46'))){_0x39d2b2[_0xd8cf('0x13')]=qs[_0xd8cf('0x13')](_0xaf6c3a['query']['limit']);_0x39d2b2[_0xd8cf('0x11')]=qs[_0xd8cf('0x11')](_0xaf6c3a[_0xd8cf('0x27')][_0xd8cf('0x11')]);}return _0x353cae[_0xd8cf('0x55')](_0x39d2b2);}})[_0xd8cf('0x18')](function(_0x4390d7){if(_0x4390d7){return _0x4390d7?{'count':_0x12a8c8,'rows':_0x4390d7}:null;}})[_0xd8cf('0x18')](respondWithResult(_0x24ccdf,null))[_0xd8cf('0x2a')](handleError(_0x24ccdf,null));};exports[_0xd8cf('0x57')]=function(_0x2fe3e1,_0x571eec){var _0x37b577=_0x2fe3e1[_0xd8cf('0x38')][_0xd8cf('0x58')];return db['Team']['findAll']({'where':{'id':_0x37b577},'attributes':['id'],'include':[{'model':db[_0xd8cf('0x59')],'as':_0xd8cf('0x5a'),'attributes':['id',_0xd8cf('0x1d'),_0xd8cf('0x5b'),_0xd8cf('0x5c'),'interface'],'raw':!![]}]})[_0xd8cf('0x18')](function(_0x4f6878){if(_0x4f6878){var _0x569bf1=_[_0xd8cf('0x5d')](_0x4f6878,function(_0x5ef052){var _0x5303d2=_0x5ef052['get']({'plain':!![]});return _0x5303d2['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x2fe3e1[_0xd8cf('0x2b')]['id']}})[_0xd8cf('0x18')](function(_0x4f07cb){return db['sequelize'][_0xd8cf('0x5e')](function(_0x4c26f3){return _0x4f07cb[_0xd8cf('0x57')](_0x37b577,{'transaction':_0x4c26f3})[_0xd8cf('0x18')](function(){return BPromise[_0xd8cf('0x5f')](_0x569bf1,function(_0x25896b){return db['UserMailQueue'][_0xd8cf('0x60')]({'where':{'UserId':_0x25896b['id'],'MailQueueId':_0x2fe3e1['params']['id']},'transaction':_0x4c26f3});});})[_0xd8cf('0x18')](function(){_0x569bf1[_0xd8cf('0x61')](function(_0x531ef0){socket['emit'](_0xd8cf('0x62'),{'UserId':_0x531ef0['id'],'MailQueueId':_0x4f07cb['id']});});});});});}})[_0xd8cf('0x18')](respondWithStatusCode(_0x571eec,null))[_0xd8cf('0x2a')](handleError(_0x571eec,null));};exports[_0xd8cf('0x63')]=function(_0x148217,_0x472138){return db[_0xd8cf('0x56')][_0xd8cf('0x28')]({'where':{'id':_0x148217['query'][_0xd8cf('0x58')]},'attributes':['id'],'include':[{'model':db[_0xd8cf('0x59')],'as':_0xd8cf('0x5a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x472138,null))[_0xd8cf('0x18')](function(_0x471b42){var _0x586245=_[_0xd8cf('0x20')](_0x471b42,'id');var _0x2fd8c4=[];var _0x720cb7=[];var _0x548962=squel['select']();_0x548962[_0xd8cf('0x64')](_0xd8cf('0x65'))[_0xd8cf('0x66')]('team_has_mail_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd8cf('0x49')]('MailQueueId\x20=\x20?',_0x148217[_0xd8cf('0x2b')]['id']);for(var _0x280721=0x0;_0x280721<_0x471b42[_0xd8cf('0x45')];_0x280721+=0x1){let _0x3eded5=_0x471b42[_0x280721];for(var _0x14c8aa=0x0;_0x14c8aa<_0x3eded5[_0xd8cf('0x5a')]['length'];_0x14c8aa+=0x1){let _0x42907b=_0x3eded5['Agents'][_0x14c8aa];var _0x841187=_0x548962[_0xd8cf('0x67')]();_0x841187[_0xd8cf('0x49')]('ut.UserId\x20=\x20?',_0x42907b['id']);_0x720cb7[_0xd8cf('0x68')](db[_0xd8cf('0x69')][_0xd8cf('0x27')](_0x841187[_0xd8cf('0x6a')](),{'type':db['sequelize'][_0xd8cf('0x6b')][_0xd8cf('0x6c')]})[_0xd8cf('0x18')](function(_0x486701){if(_0x486701[_0xd8cf('0x45')]===0x1){return _0x42907b['id'];}else{var _0x562b75=_[_0xd8cf('0x6d')](_[_0xd8cf('0x20')](_0x486701,_0xd8cf('0x6e')),function(_0xf5fe00){return _[_0xd8cf('0x6f')](_0x586245,_0xf5fe00);});if(_0x562b75){return _0x42907b['id'];}}}));}}return BPromise[_0xd8cf('0x70')](_0x720cb7)[_0xd8cf('0x18')](function(_0xfe9ac1){_0x2fd8c4=_(_0x2fd8c4)[_0xd8cf('0x71')](_0xfe9ac1)[_0xd8cf('0x72')]()[_0xd8cf('0x73')]();return db['MailQueue']['find']({'where':{'id':_0x148217['params']['id']}})[_0xd8cf('0x18')](function(_0x125b62){return db[_0xd8cf('0x69')][_0xd8cf('0x5e')](function(_0x1c533f){return _0x125b62['removeTeams'](_0x148217[_0xd8cf('0x27')][_0xd8cf('0x58')],{'transaction':_0x1c533f})['then'](function(){if(!_[_0xd8cf('0x74')](_0x2fd8c4)){return _0x125b62[_0xd8cf('0x75')](_0x2fd8c4,{'transaction':_0x1c533f});}})['then'](function(){_0x2fd8c4[_0xd8cf('0x61')](function(_0x3cce54){socket[_0xd8cf('0x76')](_0xd8cf('0x77'),{'UserId':_0x3cce54,'MailQueueId':_0x125b62['id']});});});});});});})['then'](respondWithStatusCode(_0x472138,null))['catch'](handleError(_0x472138,null));};exports[_0xd8cf('0x78')]=function(_0x38192f,_0x3e26bd){return db['MailQueue'][_0xd8cf('0x36')]({'where':{'id':_0x38192f['params']['id']}})[_0xd8cf('0x18')](handleEntityNotFound(_0x3e26bd,null))[_0xd8cf('0x18')](function(_0x5249e1){if(_0x5249e1){return _0x5249e1[_0xd8cf('0x78')](_0x38192f['body'][_0xd8cf('0x58')],_[_0xd8cf('0x79')](_0x38192f['body'],['ids','id'])||{})['spread'](function(_0x17d4bf){for(var _0x41fd18=0x0;_0x41fd18<_0x38192f['body']['ids'][_0xd8cf('0x45')];_0x41fd18+=0x1){socket[_0xd8cf('0x76')](_0xd8cf('0x62'),{'UserId':Number(_0x38192f[_0xd8cf('0x38')][_0xd8cf('0x58')][_0x41fd18]),'MailQueueId':Number(_0x38192f['params']['id'])});}return _0x17d4bf;});}})[_0xd8cf('0x18')](respondWithResult(_0x3e26bd,null))[_0xd8cf('0x2a')](handleError(_0x3e26bd,null));};exports[_0xd8cf('0x75')]=function(_0x34e921,_0x28f265){return db[_0xd8cf('0x25')]['find']({'where':{'id':_0x34e921[_0xd8cf('0x2b')]['id']}})[_0xd8cf('0x18')](handleEntityNotFound(_0x28f265,null))[_0xd8cf('0x18')](function(_0x6924e9){if(_0x6924e9){return _0x6924e9['removeAgents'](_0x34e921[_0xd8cf('0x27')][_0xd8cf('0x58')])['then'](function(){if(_[_0xd8cf('0x7a')](_0x34e921[_0xd8cf('0x27')]['ids'])){for(var _0x87fda2=0x0;_0x87fda2<_0x34e921[_0xd8cf('0x27')][_0xd8cf('0x58')][_0xd8cf('0x45')];_0x87fda2+=0x1){socket[_0xd8cf('0x76')](_0xd8cf('0x77'),{'UserId':Number(_0x34e921[_0xd8cf('0x27')][_0xd8cf('0x58')][_0x87fda2]),'MailQueueId':Number(_0x34e921['params']['id'])});}}else{socket['emit'](_0xd8cf('0x77'),{'UserId':Number(_0x34e921[_0xd8cf('0x27')][_0xd8cf('0x58')]),'MailQueueId':Number(_0x34e921[_0xd8cf('0x2b')]['id'])});}});}})[_0xd8cf('0x18')](respondWithStatusCode(_0x28f265,null))[_0xd8cf('0x2a')](handleError(_0x28f265,null));};exports[_0xd8cf('0x7b')]=function(_0x29052a,_0x259018){var _0x485342={};var _0x3270f3={};var _0x3b1f1e;var _0x2db9a9;return db[_0xd8cf('0x25')]['findOne']({'where':{'id':_0x29052a[_0xd8cf('0x2b')]['id']}})[_0xd8cf('0x18')](handleEntityNotFound(_0x259018,null))['then'](function(_0x1444ae){if(_0x1444ae){_0x3b1f1e=_0x1444ae;_0x3270f3[_0xd8cf('0x2c')]=_[_0xd8cf('0x2d')](db['User'][_0xd8cf('0x2e')]);_0x3270f3['query']=_[_0xd8cf('0x2d')](_0x29052a[_0xd8cf('0x27')]);_0x3270f3['filters']=_[_0xd8cf('0x30')](_0x3270f3[_0xd8cf('0x2c')],_0x3270f3[_0xd8cf('0x27')]);_0x485342[_0xd8cf('0x32')]=_[_0xd8cf('0x30')](_0x3270f3[_0xd8cf('0x2c')],qs['fields'](_0x29052a[_0xd8cf('0x27')][_0xd8cf('0x31')]));_0x485342['attributes']=_0x485342[_0xd8cf('0x32')]['length']?_0x485342['attributes']:_0x3270f3['model'];_0x485342[_0xd8cf('0x47')]=qs[_0xd8cf('0x48')](_0x29052a['query'][_0xd8cf('0x48')]);_0x485342['where']=qs['filters'](_[_0xd8cf('0x4a')](_0x29052a[_0xd8cf('0x27')],_0x3270f3[_0xd8cf('0x2f')]));if(_0x29052a[_0xd8cf('0x27')][_0xd8cf('0x4c')]){_0x485342[_0xd8cf('0x49')]=_[_0xd8cf('0x34')](_0x485342[_0xd8cf('0x49')],{'$or':_['map'](_0x485342[_0xd8cf('0x32')],function(_0x31afa5){var _0x181164={};_0x181164[_0x31afa5]={'$like':'%'+_0x29052a[_0xd8cf('0x27')]['filter']+'%'};return _0x181164;})});}_0x485342=_[_0xd8cf('0x34')]({},_0x485342,_0x29052a[_0xd8cf('0x35')]);return _0x3b1f1e[_0xd8cf('0x7b')](_0x485342);}})[_0xd8cf('0x18')](function(_0xab0943){if(_0xab0943){_0x2db9a9=_0xab0943['length'];if(!_0x29052a[_0xd8cf('0x27')][_0xd8cf('0x7c')](_0xd8cf('0x46'))){_0x485342[_0xd8cf('0x13')]=qs[_0xd8cf('0x13')](_0x29052a[_0xd8cf('0x27')][_0xd8cf('0x13')]);_0x485342[_0xd8cf('0x11')]=qs[_0xd8cf('0x11')](_0x29052a[_0xd8cf('0x27')][_0xd8cf('0x11')]);}return _0x3b1f1e[_0xd8cf('0x7b')](_0x485342);}})[_0xd8cf('0x18')](function(_0xd3c2de){if(_0xd3c2de){return _0xd3c2de?{'count':_0x2db9a9,'rows':_0xd3c2de}:null;}})[_0xd8cf('0x18')](respondWithResult(_0x259018,null))['catch'](handleError(_0x259018,null));}; \ No newline at end of file +var _0xda6a=['role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserMailQueue','hasOwnProperty','nolimit','order','filter','merge','User','UserId','mailPause','updatedAt','createdAt','format','getTeams','sort','pick','addTeams','ids','online','voicePause','flatMap','sequelize','transaction','each','userMailQueue:save','removeTeams','Team','Agents','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','push','SELECT','every','includes','union','compact','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','addAgents','spread','isArray','findOne','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','get','MailQueues','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','MailQueue','include','query','findAll','rows','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4e6c9f,_0x42e717){var _0x36f990=function(_0x1938ab){while(--_0x1938ab){_0x4e6c9f['push'](_0x4e6c9f['shift']());}};_0x36f990(++_0x42e717);}(_0xda6a,0x126));var _0xada6=function(_0x1f873c,_0x47b9d7){_0x1f873c=_0x1f873c-0x0;var _0x40408a=_0xda6a[_0x1f873c];return _0x40408a;};'use strict';var BPromise=require(_0xada6('0x0'));var util=require(_0xada6('0x1'));var _=require(_0xada6('0x2'));var squel=require('squel');var Redis=require(_0xada6('0x3'));var qs=require(_0xada6('0x4'));var logger=require(_0xada6('0x5'))(_0xada6('0x6'));var config=require('../../config/environment');var db=require(_0xada6('0x7'))['db'];config['redis']=_['defaults'](config[_0xada6('0x8')],{'host':_0xada6('0x9'),'port':0x18eb});var socket=require(_0xada6('0xa'))(new Redis(config[_0xada6('0x8')]));require('./mailQueue.socket')[_0xada6('0xb')](socket);function respondWithStatusCode(_0x45fd51,_0x2811ad){_0x2811ad=_0x2811ad||0xcc;return function(_0x320e8d){if(_0x320e8d){return _0x45fd51[_0xada6('0xc')](_0x2811ad);}return _0x45fd51[_0xada6('0xd')](_0x2811ad)['end']();};}function respondWithResult(_0x56a2dc,_0x2075ef){_0x2075ef=_0x2075ef||0xc8;return function(_0x1d5e94){if(_0x1d5e94){return _0x56a2dc[_0xada6('0xd')](_0x2075ef)[_0xada6('0xe')](_0x1d5e94);}};}function respondWithFilteredResult(_0x5d8372,_0x12b530){return function(_0x5448b5){if(_0x5448b5){var _0x2eafdd=typeof _0x12b530[_0xada6('0xf')]==='undefined'&&typeof _0x12b530[_0xada6('0x10')]===_0xada6('0x11');var _0x455a34=_0x5448b5[_0xada6('0x12')];var _0x4dbfdd=_0x2eafdd?0x0:_0x12b530[_0xada6('0xf')];var _0x380408=_0x2eafdd?_0x5448b5[_0xada6('0x12')]:_0x12b530['offset']+_0x12b530[_0xada6('0x10')];var _0x24cb28;if(_0x380408>=_0x455a34){_0x380408=_0x455a34;_0x24cb28=0xc8;}else{_0x24cb28=0xce;}_0x5d8372['status'](_0x24cb28);return _0x5d8372[_0xada6('0x13')](_0xada6('0x14'),_0x4dbfdd+'-'+_0x380408+'/'+_0x455a34)[_0xada6('0xe')](_0x5448b5);}return null;};}function saveUpdates(_0xcbffe1){return function(_0xb0934a){if(_0xb0934a){return _0xb0934a[_0xada6('0x15')](_0xcbffe1)[_0xada6('0x16')](function(_0x31e635){return _0x31e635;});}return null;};}function removeEntity(_0x1d953c){return function(_0x346ddd){if(_0x346ddd){return _0x346ddd[_0xada6('0x17')]()[_0xada6('0x16')](function(){var _0x34366b=_0x346ddd[_0xada6('0x18')]({'plain':!![]});var _0x22fcd4=_0xada6('0x19');return db[_0xada6('0x1a')]['destroy']({'where':{'type':_0x22fcd4,'resourceId':_0x34366b['id']}})[_0xada6('0x16')](function(){return _0x346ddd;});})[_0xada6('0x16')](function(){_0x1d953c['status'](0xcc)[_0xada6('0x1b')]();});}};}function handleEntityNotFound(_0x488fad){return function(_0x345406){if(!_0x345406){_0x488fad[_0xada6('0xc')](0x194);}return _0x345406;};}function handleError(_0x4578e5,_0x1c6eb2){_0x1c6eb2=_0x1c6eb2||0x1f4;return function(_0x5e82c4){logger[_0xada6('0x1c')](_0x5e82c4[_0xada6('0x1d')]);if(_0x5e82c4[_0xada6('0x1e')]){delete _0x5e82c4[_0xada6('0x1e')];}_0x4578e5[_0xada6('0xd')](_0x1c6eb2)[_0xada6('0x1f')](_0x5e82c4);};}exports[_0xada6('0x20')]=function(_0x2fc53a,_0xd3ce98){var _0x30e2a2={};var _0x233f13={'count':0x0,'rows':[]};var _0x51e278=_[_0xada6('0x21')](db['MailQueue'][_0xada6('0x22')],function(_0x7965ed){return{'name':_0x7965ed[_0xada6('0x23')],'type':_0x7965ed[_0xada6('0x24')][_0xada6('0x25')]};});_0x30e2a2=qs[_0xada6('0x26')](_0x51e278,_0x2fc53a);var _0x5e1e6b={'where':_0x30e2a2[_0xada6('0x27')]};return db[_0xada6('0x28')][_0xada6('0x12')](_0x5e1e6b)[_0xada6('0x16')](function(_0x3382e8){_0x233f13[_0xada6('0x12')]=_0x3382e8;_0x30e2a2[_0xada6('0x29')]=qs[_0xada6('0x29')](_0x2fc53a[_0xada6('0x2a')]);return db[_0xada6('0x28')][_0xada6('0x2b')](_0x30e2a2);})[_0xada6('0x16')](function(_0x3ef879){_0x233f13[_0xada6('0x2c')]=_0x3ef879;return _0x233f13;})[_0xada6('0x16')](respondWithFilteredResult(_0xd3ce98,_0x30e2a2))[_0xada6('0x2d')](handleError(_0xd3ce98,null));};exports[_0xada6('0x2e')]=function(_0x5acddc,_0x1d55de){var _0x2394ec={'raw':!![],'where':{'id':_0x5acddc['params']['id']}},_0x55f68a={};_0x55f68a[_0xada6('0x2f')]=_[_0xada6('0x30')](db[_0xada6('0x28')][_0xada6('0x22')]);_0x55f68a[_0xada6('0x2a')]=_[_0xada6('0x30')](_0x5acddc[_0xada6('0x2a')]);_0x55f68a[_0xada6('0x31')]=_[_0xada6('0x32')](_0x55f68a[_0xada6('0x2f')],_0x55f68a['query']);_0x2394ec[_0xada6('0x33')]=_[_0xada6('0x32')](_0x55f68a[_0xada6('0x2f')],qs[_0xada6('0x34')](_0x5acddc[_0xada6('0x2a')]['fields']));_0x2394ec[_0xada6('0x33')]=_0x2394ec['attributes'][_0xada6('0x35')]?_0x2394ec[_0xada6('0x33')]:_0x55f68a['model'];if(_0x5acddc[_0xada6('0x2a')][_0xada6('0x36')]){_0x2394ec[_0xada6('0x29')]=[{'all':!![]}];}_0x2394ec=_['merge']({},_0x2394ec,_0x5acddc[_0xada6('0x37')]);return db[_0xada6('0x28')]['find'](_0x2394ec)[_0xada6('0x16')](handleEntityNotFound(_0x1d55de,null))['then'](respondWithResult(_0x1d55de,null))[_0xada6('0x2d')](handleError(_0x1d55de,null));};exports[_0xada6('0x38')]=function(_0x2d5b6f,_0x402f74){return db[_0xada6('0x28')][_0xada6('0x38')](_0x2d5b6f[_0xada6('0x39')],{})['then'](function(_0x3f2159){var _0x34aa53=_0x2d5b6f[_0xada6('0x3a')][_0xada6('0x18')]({'plain':!![]});if(!_0x34aa53)throw new Error(_0xada6('0x3b'));if(_0x34aa53[_0xada6('0x3c')]==='user'){var _0x4da6b3=_0x3f2159[_0xada6('0x18')]({'plain':!![]});var _0x2978b8=_0xada6('0x19');return db['UserProfileSection'][_0xada6('0x3d')]({'where':{'name':_0x2978b8,'userProfileId':_0x34aa53[_0xada6('0x3e')]},'raw':!![]})[_0xada6('0x16')](function(_0x5e6c98){if(_0x5e6c98&&_0x5e6c98[_0xada6('0x3f')]===0x0){return db[_0xada6('0x1a')][_0xada6('0x38')]({'name':_0x4da6b3['name'],'resourceId':_0x4da6b3['id'],'type':_0x5e6c98[_0xada6('0x1e')],'sectionId':_0x5e6c98['id']},{})[_0xada6('0x16')](function(){return _0x3f2159;});}else{return _0x3f2159;}})['catch'](function(_0x2d9db8){logger[_0xada6('0x1c')](_0xada6('0x40'),_0x2d9db8);throw _0x2d9db8;});}return _0x3f2159;})['then'](respondWithResult(_0x402f74,0xc9))[_0xada6('0x2d')](handleError(_0x402f74,null));};exports[_0xada6('0x15')]=function(_0x2135b9,_0x147362){if(_0x2135b9[_0xada6('0x39')]['id']){delete _0x2135b9[_0xada6('0x39')]['id'];}return db['MailQueue'][_0xada6('0x3d')]({'where':{'id':_0x2135b9[_0xada6('0x41')]['id']}})[_0xada6('0x16')](handleEntityNotFound(_0x147362,null))[_0xada6('0x16')](saveUpdates(_0x2135b9[_0xada6('0x39')],null))['then'](respondWithResult(_0x147362,null))[_0xada6('0x2d')](handleError(_0x147362,null));};exports[_0xada6('0x17')]=function(_0x1dd63c,_0x1567a7){return db['MailQueue']['find']({'where':{'id':_0x1dd63c[_0xada6('0x41')]['id']}})['then'](handleEntityNotFound(_0x1567a7,null))[_0xada6('0x16')](removeEntity(_0x1567a7,null))[_0xada6('0x2d')](handleError(_0x1567a7,null));};exports[_0xada6('0x42')]=function(_0x42c28e,_0x46f05d){return db[_0xada6('0x28')][_0xada6('0x42')]()[_0xada6('0x16')](respondWithResult(_0x46f05d,null))[_0xada6('0x2d')](handleError(_0x46f05d,null));};exports[_0xada6('0x43')]=function(_0x48d4af,_0x3b40e2){var _0x3dc523={'raw':!![],'where':{}},_0x2e1369={},_0x17c902;return db[_0xada6('0x28')]['findOne']({'where':{'id':_0x48d4af['params']['id']}})[_0xada6('0x16')](handleEntityNotFound(_0x3b40e2,null))['then'](function(_0x5c8c69){if(_0x5c8c69){_0x17c902=_0x5c8c69[_0xada6('0x18')]({'plain':!![]});_0x2e1369[_0xada6('0x2f')]=_[_0xada6('0x30')](db[_0xada6('0x44')][_0xada6('0x22')]);_0x2e1369[_0xada6('0x2a')]=_['keys'](_0x48d4af[_0xada6('0x2a')]);_0x2e1369[_0xada6('0x31')]=_['intersection'](_0x2e1369[_0xada6('0x2f')],_0x2e1369[_0xada6('0x2a')]);_0x3dc523[_0xada6('0x33')]=_[_0xada6('0x32')](_0x2e1369[_0xada6('0x2f')],qs[_0xada6('0x34')](_0x48d4af['query'][_0xada6('0x34')]));_0x3dc523[_0xada6('0x33')]=_0x3dc523[_0xada6('0x33')]['length']?_0x3dc523[_0xada6('0x33')]:_0x2e1369[_0xada6('0x2f')];if(!_0x48d4af[_0xada6('0x2a')][_0xada6('0x45')](_0xada6('0x46'))){_0x3dc523['limit']=qs[_0xada6('0x10')](_0x48d4af['query']['limit']);_0x3dc523[_0xada6('0xf')]=qs[_0xada6('0xf')](_0x48d4af[_0xada6('0x2a')][_0xada6('0xf')]);}_0x3dc523[_0xada6('0x47')]=qs['sort'](_0x48d4af['query']['sort']);_0x3dc523[_0xada6('0x27')]=qs[_0xada6('0x31')](_['pick'](_0x48d4af[_0xada6('0x2a')],_0x2e1369[_0xada6('0x31')]));_0x3dc523[_0xada6('0x27')]['MailQueueId']=_0x5c8c69['id'];if(_0x48d4af[_0xada6('0x2a')][_0xada6('0x48')]){_0x3dc523[_0xada6('0x27')]=_[_0xada6('0x49')](_0x3dc523[_0xada6('0x27')],{'$or':_['map'](_0x3dc523[_0xada6('0x33')],function(_0x5a0764){var _0x288e38={};_0x288e38[_0x5a0764]={'$like':'%'+_0x48d4af['query'][_0xada6('0x48')]+'%'};return _0x288e38;})});}_0x3dc523=_['merge']({},_0x3dc523,_0x48d4af[_0xada6('0x37')]);return db[_0xada6('0x44')]['findAll'](_0x3dc523);}})['then'](function(_0x354b5b){if(_0x354b5b){return db[_0xada6('0x4a')]['findAndCountAll']({'where':{'id':_[_0xada6('0x21')](_0x354b5b,_0xada6('0x4b')),'role':'agent'},'attributes':['id','name',_0xada6('0x4c'),_0xada6('0x4d'),_0xada6('0x4e')]});}})[_0xada6('0x16')](function(_0x4368fe){if(_0x4368fe){return{'count':_0x4368fe[_0xada6('0x12')],'rows':_[_0xada6('0x21')](_0x4368fe[_0xada6('0x2c')],function(_0x48284e){return{'membername':_0x48284e[_0xada6('0x1e')],'UserId':_0x48284e['id'],'queue_name':_0x17c902[_0xada6('0x1e')],'MailQueueId':_0x17c902['id'],'interface':util[_0xada6('0x4f')]('%s/%s','SIP',_0x48284e[_0xada6('0x1e')]),'penalty':0x0,'paused':_0x48284e['mailPause'],'createdAt':_0x48284e[_0xada6('0x4e')],'updatedAt':_0x48284e[_0xada6('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xada6('0x16')](respondWithFilteredResult(_0x3b40e2,_0x3dc523))[_0xada6('0x2d')](handleError(_0x3b40e2,null));};exports[_0xada6('0x50')]=function(_0x34674a,_0x2e097f){var _0x2b20bf={};var _0x223893={};var _0x128d58;var _0x1ad97c;return db[_0xada6('0x28')]['findOne']({'where':{'id':_0x34674a['params']['id']}})[_0xada6('0x16')](handleEntityNotFound(_0x2e097f,null))['then'](function(_0x3a4175){if(_0x3a4175){_0x128d58=_0x3a4175;_0x223893[_0xada6('0x2f')]=_['keys'](db['Team'][_0xada6('0x22')]);_0x223893[_0xada6('0x2a')]=_[_0xada6('0x30')](_0x34674a[_0xada6('0x2a')]);_0x223893['filters']=_['intersection'](_0x223893[_0xada6('0x2f')],_0x223893[_0xada6('0x2a')]);_0x2b20bf[_0xada6('0x33')]=_[_0xada6('0x32')](_0x223893['model'],qs['fields'](_0x34674a['query']['fields']));_0x2b20bf[_0xada6('0x33')]=_0x2b20bf[_0xada6('0x33')][_0xada6('0x35')]?_0x2b20bf[_0xada6('0x33')]:_0x223893[_0xada6('0x2f')];_0x2b20bf['order']=qs[_0xada6('0x51')](_0x34674a['query']['sort']);_0x2b20bf[_0xada6('0x27')]=qs['filters'](_[_0xada6('0x52')](_0x34674a[_0xada6('0x2a')],_0x223893[_0xada6('0x31')]));if(_0x34674a[_0xada6('0x2a')][_0xada6('0x48')]){_0x2b20bf[_0xada6('0x27')]=_[_0xada6('0x49')](_0x2b20bf[_0xada6('0x27')],{'$or':_[_0xada6('0x21')](_0x2b20bf['attributes'],function(_0x5d2fe7){var _0x3cff9d={};_0x3cff9d[_0x5d2fe7]={'$like':'%'+_0x34674a[_0xada6('0x2a')][_0xada6('0x48')]+'%'};return _0x3cff9d;})});}_0x2b20bf=_[_0xada6('0x49')]({},_0x2b20bf,_0x34674a[_0xada6('0x37')]);return _0x128d58['getTeams'](_0x2b20bf);}})[_0xada6('0x16')](function(_0x435bd0){if(_0x435bd0){_0x1ad97c=_0x435bd0[_0xada6('0x35')];if(!_0x34674a[_0xada6('0x2a')][_0xada6('0x45')](_0xada6('0x46'))){_0x2b20bf[_0xada6('0x10')]=qs[_0xada6('0x10')](_0x34674a[_0xada6('0x2a')][_0xada6('0x10')]);_0x2b20bf[_0xada6('0xf')]=qs[_0xada6('0xf')](_0x34674a[_0xada6('0x2a')][_0xada6('0xf')]);}return _0x128d58['getTeams'](_0x2b20bf);}})[_0xada6('0x16')](function(_0x11c2ac){if(_0x11c2ac){return _0x11c2ac?{'count':_0x1ad97c,'rows':_0x11c2ac}:null;}})[_0xada6('0x16')](respondWithResult(_0x2e097f,null))[_0xada6('0x2d')](handleError(_0x2e097f,null));};exports[_0xada6('0x53')]=function(_0x502b58,_0x21cdec){var _0x25d32f=_0x502b58['body'][_0xada6('0x54')];return db['Team'][_0xada6('0x2b')]({'where':{'id':_0x25d32f},'attributes':['id'],'include':[{'model':db[_0xada6('0x4a')],'as':'Agents','attributes':['id','name',_0xada6('0x55'),_0xada6('0x56'),'interface'],'raw':!![]}]})['then'](function(_0x3b9f42){if(_0x3b9f42){var _0x52ab85=_[_0xada6('0x57')](_0x3b9f42,function(_0xf5e6ee){var _0x1b59ce=_0xf5e6ee[_0xada6('0x18')]({'plain':!![]});return _0x1b59ce['Agents'];});return db[_0xada6('0x28')][_0xada6('0x3d')]({'where':{'id':_0x502b58[_0xada6('0x41')]['id']}})[_0xada6('0x16')](function(_0x5e5131){return db[_0xada6('0x58')][_0xada6('0x59')](function(_0xb900bb){return _0x5e5131[_0xada6('0x53')](_0x25d32f,{'transaction':_0xb900bb})[_0xada6('0x16')](function(){return BPromise[_0xada6('0x5a')](_0x52ab85,function(_0x335a18){return db[_0xada6('0x44')]['findOrCreate']({'where':{'UserId':_0x335a18['id'],'MailQueueId':_0x502b58[_0xada6('0x41')]['id']},'transaction':_0xb900bb});});})['then'](function(){_0x52ab85['forEach'](function(_0x50d1b4){socket['emit'](_0xada6('0x5b'),{'UserId':_0x50d1b4['id'],'MailQueueId':_0x5e5131['id']});});});});});}})[_0xada6('0x16')](respondWithStatusCode(_0x21cdec,null))[_0xada6('0x2d')](handleError(_0x21cdec,null));};exports[_0xada6('0x5c')]=function(_0x36f041,_0x1562ad){return db[_0xada6('0x5d')][_0xada6('0x2b')]({'where':{'id':_0x36f041[_0xada6('0x2a')][_0xada6('0x54')]},'attributes':['id'],'include':[{'model':db[_0xada6('0x4a')],'as':_0xada6('0x5e'),'attributes':['id'],'raw':!![]}]})[_0xada6('0x16')](handleEntityNotFound(_0x1562ad,null))['then'](function(_0x2451b6){var _0x176f4b=_['map'](_0x2451b6,'id');var _0x5edcd3=[];var _0xbd9575=[];var _0x133493=squel[_0xada6('0x5f')]();_0x133493[_0xada6('0x60')](_0xada6('0x61'))[_0xada6('0x62')](_0xada6('0x63'),'tq')[_0xada6('0x64')](_0xada6('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xada6('0x27')]('MailQueueId\x20=\x20?',_0x36f041[_0xada6('0x41')]['id']);for(var _0x2ecdfb=0x0;_0x2ecdfb<_0x2451b6['length'];_0x2ecdfb+=0x1){let _0x5b5bf9=_0x2451b6[_0x2ecdfb];for(var _0x13fab3=0x0;_0x13fab3<_0x5b5bf9['Agents'][_0xada6('0x35')];_0x13fab3+=0x1){let _0x523ec4=_0x5b5bf9['Agents'][_0x13fab3];var _0x17bad9=_0x133493['clone']();_0x17bad9[_0xada6('0x27')]('ut.UserId\x20=\x20?',_0x523ec4['id']);_0xbd9575[_0xada6('0x66')](db[_0xada6('0x58')][_0xada6('0x2a')](_0x17bad9['toString'](),{'type':db[_0xada6('0x58')]['QueryTypes'][_0xada6('0x67')]})[_0xada6('0x16')](function(_0x385824){if(_0x385824[_0xada6('0x35')]===0x1){return _0x523ec4['id'];}else{var _0x287590=_[_0xada6('0x68')](_[_0xada6('0x21')](_0x385824,'TeamId'),function(_0x588178){return _[_0xada6('0x69')](_0x176f4b,_0x588178);});if(_0x287590){return _0x523ec4['id'];}}}));}}return BPromise['all'](_0xbd9575)['then'](function(_0x5cc4c6){_0x5edcd3=_(_0x5edcd3)[_0xada6('0x6a')](_0x5cc4c6)[_0xada6('0x6b')]()['value']();return db['MailQueue'][_0xada6('0x3d')]({'where':{'id':_0x36f041[_0xada6('0x41')]['id']}})[_0xada6('0x16')](function(_0x5e32ba){return db[_0xada6('0x58')]['transaction'](function(_0x4beb87){return _0x5e32ba[_0xada6('0x5c')](_0x36f041[_0xada6('0x2a')][_0xada6('0x54')],{'transaction':_0x4beb87})[_0xada6('0x16')](function(){if(!_[_0xada6('0x6c')](_0x5edcd3)){return _0x5e32ba[_0xada6('0x6d')](_0x5edcd3,{'transaction':_0x4beb87});}})[_0xada6('0x16')](function(){_0x5edcd3[_0xada6('0x6e')](function(_0x18644b){socket[_0xada6('0x6f')](_0xada6('0x70'),{'UserId':_0x18644b,'MailQueueId':_0x5e32ba['id']});});});});});});})[_0xada6('0x16')](respondWithStatusCode(_0x1562ad,null))[_0xada6('0x2d')](handleError(_0x1562ad,null));};exports[_0xada6('0x71')]=function(_0x380cf5,_0x2f5e3e){return db[_0xada6('0x28')]['find']({'where':{'id':_0x380cf5['params']['id']}})[_0xada6('0x16')](handleEntityNotFound(_0x2f5e3e,null))['then'](function(_0x4fc161){if(_0x4fc161){return _0x4fc161[_0xada6('0x71')](_0x380cf5[_0xada6('0x39')][_0xada6('0x54')],_['omit'](_0x380cf5[_0xada6('0x39')],[_0xada6('0x54'),'id'])||{})[_0xada6('0x72')](function(_0x182446){for(var _0xacfde2=0x0;_0xacfde2<_0x380cf5[_0xada6('0x39')][_0xada6('0x54')][_0xada6('0x35')];_0xacfde2+=0x1){socket[_0xada6('0x6f')](_0xada6('0x5b'),{'UserId':Number(_0x380cf5[_0xada6('0x39')][_0xada6('0x54')][_0xacfde2]),'MailQueueId':Number(_0x380cf5[_0xada6('0x41')]['id'])});}return _0x182446;});}})['then'](respondWithResult(_0x2f5e3e,null))[_0xada6('0x2d')](handleError(_0x2f5e3e,null));};exports[_0xada6('0x6d')]=function(_0x1cc947,_0x1d37ef){return db['MailQueue']['find']({'where':{'id':_0x1cc947[_0xada6('0x41')]['id']}})[_0xada6('0x16')](handleEntityNotFound(_0x1d37ef,null))[_0xada6('0x16')](function(_0x3af5b7){if(_0x3af5b7){return _0x3af5b7[_0xada6('0x6d')](_0x1cc947[_0xada6('0x2a')][_0xada6('0x54')])['then'](function(){if(_[_0xada6('0x73')](_0x1cc947[_0xada6('0x2a')][_0xada6('0x54')])){for(var _0x2df8d8=0x0;_0x2df8d8<_0x1cc947['query']['ids'][_0xada6('0x35')];_0x2df8d8+=0x1){socket[_0xada6('0x6f')](_0xada6('0x70'),{'UserId':Number(_0x1cc947[_0xada6('0x2a')][_0xada6('0x54')][_0x2df8d8]),'MailQueueId':Number(_0x1cc947[_0xada6('0x41')]['id'])});}}else{socket[_0xada6('0x6f')](_0xada6('0x70'),{'UserId':Number(_0x1cc947[_0xada6('0x2a')][_0xada6('0x54')]),'MailQueueId':Number(_0x1cc947[_0xada6('0x41')]['id'])});}});}})[_0xada6('0x16')](respondWithStatusCode(_0x1d37ef,null))[_0xada6('0x2d')](handleError(_0x1d37ef,null));};exports['getAgents']=function(_0x3b86cd,_0x15fe6e){var _0x4416fa={};var _0x4a27d6={};var _0x30f286;var _0x1d8f3b;return db['MailQueue'][_0xada6('0x74')]({'where':{'id':_0x3b86cd['params']['id']}})[_0xada6('0x16')](handleEntityNotFound(_0x15fe6e,null))[_0xada6('0x16')](function(_0x24b701){if(_0x24b701){_0x30f286=_0x24b701;_0x4a27d6[_0xada6('0x2f')]=_[_0xada6('0x30')](db['User']['rawAttributes']);_0x4a27d6[_0xada6('0x2a')]=_[_0xada6('0x30')](_0x3b86cd[_0xada6('0x2a')]);_0x4a27d6['filters']=_[_0xada6('0x32')](_0x4a27d6[_0xada6('0x2f')],_0x4a27d6[_0xada6('0x2a')]);_0x4416fa[_0xada6('0x33')]=_[_0xada6('0x32')](_0x4a27d6[_0xada6('0x2f')],qs[_0xada6('0x34')](_0x3b86cd[_0xada6('0x2a')][_0xada6('0x34')]));_0x4416fa['attributes']=_0x4416fa[_0xada6('0x33')][_0xada6('0x35')]?_0x4416fa[_0xada6('0x33')]:_0x4a27d6[_0xada6('0x2f')];_0x4416fa[_0xada6('0x47')]=qs['sort'](_0x3b86cd[_0xada6('0x2a')]['sort']);_0x4416fa[_0xada6('0x27')]=qs[_0xada6('0x31')](_[_0xada6('0x52')](_0x3b86cd[_0xada6('0x2a')],_0x4a27d6[_0xada6('0x31')]));if(_0x3b86cd[_0xada6('0x2a')][_0xada6('0x48')]){_0x4416fa[_0xada6('0x27')]=_[_0xada6('0x49')](_0x4416fa['where'],{'$or':_['map'](_0x4416fa['attributes'],function(_0x4ec6b5){var _0x3dfe4b={};_0x3dfe4b[_0x4ec6b5]={'$like':'%'+_0x3b86cd[_0xada6('0x2a')]['filter']+'%'};return _0x3dfe4b;})});}_0x4416fa=_['merge']({},_0x4416fa,_0x3b86cd[_0xada6('0x37')]);return _0x30f286[_0xada6('0x75')](_0x4416fa);}})[_0xada6('0x16')](function(_0x326948){if(_0x326948){_0x1d8f3b=_0x326948[_0xada6('0x35')];if(!_0x3b86cd['query']['hasOwnProperty'](_0xada6('0x46'))){_0x4416fa[_0xada6('0x10')]=qs[_0xada6('0x10')](_0x3b86cd['query'][_0xada6('0x10')]);_0x4416fa[_0xada6('0xf')]=qs['offset'](_0x3b86cd[_0xada6('0x2a')][_0xada6('0xf')]);}return _0x30f286[_0xada6('0x75')](_0x4416fa);}})[_0xada6('0x16')](function(_0x545099){if(_0x545099){return _0x545099?{'count':_0x1d8f3b,'rows':_0x545099}:null;}})['then'](respondWithResult(_0x15fe6e,null))[_0xada6('0x2d')](handleError(_0x15fe6e,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index bb7c9e4..0720a37 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 _0x0546=['MailQueue','save','remove','emit','events','../../mysqldb'];(function(_0xc473b,_0x260edd){var _0x4f4cc5=function(_0x3d7d65){while(--_0x3d7d65){_0xc473b['push'](_0xc473b['shift']());}};_0x4f4cc5(++_0x260edd);}(_0x0546,0xa6));var _0x6054=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0x0546[_0x5d61b4];return _0x183fc5;};'use strict';var EventEmitter=require(_0x6054('0x0'));var MailQueue=require(_0x6054('0x1'))['db'][_0x6054('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6054('0x3'),'afterUpdate':'update','afterDestroy':_0x6054('0x4')};function emitEvent(_0x36d410){return function(_0x2da397,_0x48f4fb,_0x38bd86){MailQueueEvents['emit'](_0x36d410+':'+_0x2da397['id'],_0x2da397);MailQueueEvents[_0x6054('0x5')](_0x36d410,_0x2da397);_0x38bd86(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x3b2e=['setMaxListeners','save','update','remove','emit','hook','MailQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3b2e,0x141));var _0xe3b2=function(_0x46cb35,_0x2b92ab){_0x46cb35=_0x46cb35-0x0;var _0x847507=_0x3b2e[_0x46cb35];return _0x847507;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xe3b2('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe3b2('0x1')](0x0);var events={'afterCreate':_0xe3b2('0x2'),'afterUpdate':_0xe3b2('0x3'),'afterDestroy':_0xe3b2('0x4')};function emitEvent(_0x567677){return function(_0x218668,_0x3e47db,_0x1aafac){MailQueueEvents[_0xe3b2('0x5')](_0x567677+':'+_0x218668['id'],_0x218668);MailQueueEvents['emit'](_0x567677,_0x218668);_0x1aafac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xe3b2('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 93a4ee3..8574a29 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 _0x7a15=['exports','MailQueue','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x390ef6,_0x1d401c){var _0x2fdaac=function(_0x692ab7){while(--_0x692ab7){_0x390ef6['push'](_0x390ef6['shift']());}};_0x2fdaac(++_0x1d401c);}(_0x7a15,0xa4));var _0x57a1=function(_0xa9ad76,_0x36bb01){_0xa9ad76=_0xa9ad76-0x0;var _0x45bc4d=_0x7a15[_0xa9ad76];return _0x45bc4d;};'use strict';var _=require(_0x57a1('0x0'));var util=require(_0x57a1('0x1'));var logger=require(_0x57a1('0x2'))(_0x57a1('0x3'));var moment=require(_0x57a1('0x4'));var BPromise=require('bluebird');var rp=require(_0x57a1('0x5'));var fs=require('fs');var path=require(_0x57a1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x57a1('0x7')]=function(_0x5e5b17,_0x56d65c){return _0x5e5b17['define'](_0x57a1('0x8'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ed=['bluebird','request-promise','../../config/environment','exports','define','MailQueue','mail_queues','lodash','../../config/logger','api','moment'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xd2ed,0xcd));var _0xdd2e=function(_0x5017e8,_0x44bf12){_0x5017e8=_0x5017e8-0x0;var _0x4f36f0=_0xd2ed[_0x5017e8];return _0x4f36f0;};'use strict';var _=require(_0xdd2e('0x0'));var util=require('util');var logger=require(_0xdd2e('0x1'))(_0xdd2e('0x2'));var moment=require(_0xdd2e('0x3'));var BPromise=require(_0xdd2e('0x4'));var rp=require(_0xdd2e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdd2e('0x6'));var attributes=require('./mailQueue.attributes');module[_0xdd2e('0x7')]=function(_0x51b36a,_0xedb8be){return _0x51b36a[_0xdd2e('0x8')](_0xdd2e('0x9'),attributes,{'tableName':_0xdd2e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 9d6a4cb..2ec1e95 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 _0xaa9c=['code','message','catch','GetMailQueue','MailQueue','options','limit','include','model','attributes','map','ShowMailQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1aa423,_0x4460e1){var _0x15ef07=function(_0x14c7f1){while(--_0x14c7f1){_0x1aa423['push'](_0x1aa423['shift']());}};_0x15ef07(++_0x4460e1);}(_0xaa9c,0x1e2));var _0xcaa9=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xaa9c[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0xcaa9('0x0'));var util=require(_0xcaa9('0x1'));var moment=require(_0xcaa9('0x2'));var BPromise=require(_0xcaa9('0x3'));var rs=require(_0xcaa9('0x4'));var fs=require('fs');var Redis=require(_0xcaa9('0x5'));var db=require(_0xcaa9('0x6'))['db'];var utils=require(_0xcaa9('0x7'));var logger=require(_0xcaa9('0x8'))(_0xcaa9('0x9'));var config=require(_0xcaa9('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xcaa9('0xb')](config[_0xcaa9('0xc')],{'host':_0xcaa9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcaa9('0xc')]));require(_0xcaa9('0xe'))[_0xcaa9('0xf')](socket);function respondWithRpcPromise(_0x5a3e8a,_0x1e14f9,_0x35615a){return new BPromise(function(_0x4302a7,_0xe3017f){return client[_0xcaa9('0x10')](_0x5a3e8a,_0x35615a)[_0xcaa9('0x11')](function(_0x183d78){logger[_0xcaa9('0x12')](_0xcaa9('0x13'),_0x1e14f9,_0xcaa9('0x14'));logger[_0xcaa9('0x15')](_0xcaa9('0x16'),_0x1e14f9,_0xcaa9('0x14'),JSON[_0xcaa9('0x17')](_0x183d78));if(_0x183d78[_0xcaa9('0x18')]){if(_0x183d78[_0xcaa9('0x18')][_0xcaa9('0x19')]===0x1f4){logger[_0xcaa9('0x18')]('MailQueue,\x20%s,\x20%s',_0x1e14f9,_0x183d78['error'][_0xcaa9('0x1a')]);return _0xe3017f(_0x183d78[_0xcaa9('0x18')][_0xcaa9('0x1a')]);}logger[_0xcaa9('0x18')](_0xcaa9('0x13'),_0x1e14f9,_0x183d78[_0xcaa9('0x18')][_0xcaa9('0x1a')]);return _0x4302a7(_0x183d78[_0xcaa9('0x18')][_0xcaa9('0x1a')]);}else{logger[_0xcaa9('0x12')]('MailQueue,\x20%s,\x20%s',_0x1e14f9,_0xcaa9('0x14'));_0x4302a7(_0x183d78['result'][_0xcaa9('0x1a')]);}})[_0xcaa9('0x1b')](function(_0x5b1426){logger['error'](_0xcaa9('0x13'),_0x1e14f9,_0x5b1426);_0xe3017f(_0x5b1426);});});}exports[_0xcaa9('0x1c')]=function(_0x5e4c9a){var _0x33d892=this;return new Promise(function(_0x4eaaa3,_0x352ca2){return db[_0xcaa9('0x1d')]['findAll']({'raw':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a[_0xcaa9('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a['options']['where']||null:null,'attributes':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a['options']['attributes']||null:null,'limit':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a[_0xcaa9('0x1e')][_0xcaa9('0x1f')]||null:null,'include':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a['options'][_0xcaa9('0x20')]?_['map'](_0x5e4c9a[_0xcaa9('0x1e')][_0xcaa9('0x20')],function(_0x15e6ed){return{'model':db[_0x15e6ed[_0xcaa9('0x21')]],'as':_0x15e6ed['as'],'attributes':_0x15e6ed[_0xcaa9('0x22')],'include':_0x15e6ed['include']?_['map'](_0x15e6ed['include'],function(_0x34c88e){return{'model':db[_0x34c88e[_0xcaa9('0x21')]],'as':_0x34c88e['as'],'attributes':_0x34c88e[_0xcaa9('0x22')],'include':_0x34c88e[_0xcaa9('0x20')]?_[_0xcaa9('0x23')](_0x34c88e[_0xcaa9('0x20')],function(_0x13be38){return{'model':db[_0x13be38[_0xcaa9('0x21')]],'as':_0x13be38['as'],'attributes':_0x13be38[_0xcaa9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf817fe){logger['info'](_0xcaa9('0x1c'),_0x5e4c9a);logger[_0xcaa9('0x15')](_0xcaa9('0x1c'),_0x5e4c9a,JSON['stringify'](_0xf817fe));_0x4eaaa3(_0xf817fe);})[_0xcaa9('0x1b')](function(_0xdc5c04){logger['error'](_0xcaa9('0x1c'),_0xdc5c04['message'],_0x5e4c9a);_0x352ca2(_0x33d892[_0xcaa9('0x18')](0x1f4,_0xdc5c04[_0xcaa9('0x1a')]));});});};exports[_0xcaa9('0x24')]=function(_0x355601){var _0x1bb829=this;return new Promise(function(_0x540615,_0x571f0c){return db[_0xcaa9('0x1d')][_0xcaa9('0x25')]({'raw':_0x355601[_0xcaa9('0x1e')]?_0x355601[_0xcaa9('0x1e')][_0xcaa9('0x26')]===undefined?!![]:![]:!![],'where':_0x355601[_0xcaa9('0x1e')]?_0x355601[_0xcaa9('0x1e')]['where']||null:null,'attributes':_0x355601[_0xcaa9('0x1e')]?_0x355601[_0xcaa9('0x1e')][_0xcaa9('0x22')]||null:null,'include':_0x355601[_0xcaa9('0x1e')]?_0x355601[_0xcaa9('0x1e')][_0xcaa9('0x20')]?_[_0xcaa9('0x23')](_0x355601[_0xcaa9('0x1e')][_0xcaa9('0x20')],function(_0x29e7aa){return{'model':db[_0x29e7aa[_0xcaa9('0x21')]],'as':_0x29e7aa['as'],'attributes':_0x29e7aa['attributes'],'include':_0x29e7aa[_0xcaa9('0x20')]?_['map'](_0x29e7aa['include'],function(_0x2586e1){return{'model':db[_0x2586e1[_0xcaa9('0x21')]],'as':_0x2586e1['as'],'attributes':_0x2586e1[_0xcaa9('0x22')],'include':_0x2586e1['include']?_['map'](_0x2586e1[_0xcaa9('0x20')],function(_0x8aa5d3){return{'model':db[_0x8aa5d3[_0xcaa9('0x21')]],'as':_0x8aa5d3['as'],'attributes':_0x8aa5d3['attributes']};}):[]};}):[]};}):[]:[]})[_0xcaa9('0x11')](function(_0x460d4f){logger['info'](_0xcaa9('0x24'),_0x355601);logger[_0xcaa9('0x15')](_0xcaa9('0x24'),_0x355601,JSON[_0xcaa9('0x17')](_0x460d4f));_0x540615(_0x460d4f);})['catch'](function(_0x4ade8b){logger[_0xcaa9('0x18')](_0xcaa9('0x24'),_0x4ade8b[_0xcaa9('0x1a')],_0x355601);_0x571f0c(_0x1bb829['error'](0x1f4,_0x4ade8b[_0xcaa9('0x1a')]));});});}; \ No newline at end of file +var _0xda1c=['request\x20sent','debug','stringify','code','error','message','result','catch','MailQueue','findAll','options','raw','where','attributes','map','include','model','GetMailQueue','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0xda1c,0x68));var _0xcda1=function(_0x34f846,_0x5da8fe){_0x34f846=_0x34f846-0x0;var _0x3fee5e=_0xda1c[_0x34f846];return _0x3fee5e;};'use strict';var _=require(_0xcda1('0x0'));var util=require(_0xcda1('0x1'));var moment=require(_0xcda1('0x2'));var BPromise=require(_0xcda1('0x3'));var rs=require(_0xcda1('0x4'));var fs=require('fs');var Redis=require(_0xcda1('0x5'));var db=require(_0xcda1('0x6'))['db'];var utils=require(_0xcda1('0x7'));var logger=require(_0xcda1('0x8'))(_0xcda1('0x9'));var config=require(_0xcda1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcda1('0xb')][_0xcda1('0xc')]({'port':0x232a});config[_0xcda1('0xd')]=_[_0xcda1('0xe')](config[_0xcda1('0xd')],{'host':_0xcda1('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcda1('0xd')]));require(_0xcda1('0x10'))[_0xcda1('0x11')](socket);function respondWithRpcPromise(_0xb4c147,_0x88e4e8,_0x3b9202){return new BPromise(function(_0xc6f0c5,_0x1e8d34){return client[_0xcda1('0x12')](_0xb4c147,_0x3b9202)[_0xcda1('0x13')](function(_0x4c1ae0){logger[_0xcda1('0x14')](_0xcda1('0x15'),_0x88e4e8,_0xcda1('0x16'));logger[_0xcda1('0x17')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x88e4e8,'request\x20sent',JSON[_0xcda1('0x18')](_0x4c1ae0));if(_0x4c1ae0['error']){if(_0x4c1ae0['error'][_0xcda1('0x19')]===0x1f4){logger[_0xcda1('0x1a')]('MailQueue,\x20%s,\x20%s',_0x88e4e8,_0x4c1ae0[_0xcda1('0x1a')]['message']);return _0x1e8d34(_0x4c1ae0['error'][_0xcda1('0x1b')]);}logger[_0xcda1('0x1a')](_0xcda1('0x15'),_0x88e4e8,_0x4c1ae0[_0xcda1('0x1a')][_0xcda1('0x1b')]);return _0xc6f0c5(_0x4c1ae0['error'][_0xcda1('0x1b')]);}else{logger['info'](_0xcda1('0x15'),_0x88e4e8,_0xcda1('0x16'));_0xc6f0c5(_0x4c1ae0[_0xcda1('0x1c')][_0xcda1('0x1b')]);}})[_0xcda1('0x1d')](function(_0x2c2a35){logger[_0xcda1('0x1a')](_0xcda1('0x15'),_0x88e4e8,_0x2c2a35);_0x1e8d34(_0x2c2a35);});});}exports['GetMailQueue']=function(_0x56fb91){var _0x547510=this;return new Promise(function(_0x3802f8,_0x26ebd1){return db[_0xcda1('0x1e')][_0xcda1('0x1f')]({'raw':_0x56fb91[_0xcda1('0x20')]?_0x56fb91[_0xcda1('0x20')][_0xcda1('0x21')]===undefined?!![]:![]:!![],'where':_0x56fb91[_0xcda1('0x20')]?_0x56fb91[_0xcda1('0x20')][_0xcda1('0x22')]||null:null,'attributes':_0x56fb91[_0xcda1('0x20')]?_0x56fb91[_0xcda1('0x20')][_0xcda1('0x23')]||null:null,'limit':_0x56fb91['options']?_0x56fb91['options']['limit']||null:null,'include':_0x56fb91[_0xcda1('0x20')]?_0x56fb91['options']['include']?_[_0xcda1('0x24')](_0x56fb91[_0xcda1('0x20')][_0xcda1('0x25')],function(_0xa3acf3){return{'model':db[_0xa3acf3['model']],'as':_0xa3acf3['as'],'attributes':_0xa3acf3[_0xcda1('0x23')],'include':_0xa3acf3[_0xcda1('0x25')]?_['map'](_0xa3acf3['include'],function(_0x29206){return{'model':db[_0x29206[_0xcda1('0x26')]],'as':_0x29206['as'],'attributes':_0x29206[_0xcda1('0x23')],'include':_0x29206[_0xcda1('0x25')]?_[_0xcda1('0x24')](_0x29206[_0xcda1('0x25')],function(_0x1036e7){return{'model':db[_0x1036e7['model']],'as':_0x1036e7['as'],'attributes':_0x1036e7[_0xcda1('0x23')]};}):[]};}):[]};}):[]:[]})[_0xcda1('0x13')](function(_0x1bef43){logger[_0xcda1('0x14')](_0xcda1('0x27'),_0x56fb91);logger[_0xcda1('0x17')](_0xcda1('0x27'),_0x56fb91,JSON[_0xcda1('0x18')](_0x1bef43));_0x3802f8(_0x1bef43);})['catch'](function(_0x2335ca){logger['error'](_0xcda1('0x27'),_0x2335ca['message'],_0x56fb91);_0x26ebd1(_0x547510[_0xcda1('0x1a')](0x1f4,_0x2335ca[_0xcda1('0x1b')]));});});};exports[_0xcda1('0x28')]=function(_0x52fd12){var _0x59cf74=this;return new Promise(function(_0x1ab8ea,_0x136c08){return db['MailQueue'][_0xcda1('0x29')]({'raw':_0x52fd12[_0xcda1('0x20')]?_0x52fd12[_0xcda1('0x20')][_0xcda1('0x21')]===undefined?!![]:![]:!![],'where':_0x52fd12[_0xcda1('0x20')]?_0x52fd12[_0xcda1('0x20')][_0xcda1('0x22')]||null:null,'attributes':_0x52fd12[_0xcda1('0x20')]?_0x52fd12['options']['attributes']||null:null,'include':_0x52fd12['options']?_0x52fd12['options'][_0xcda1('0x25')]?_[_0xcda1('0x24')](_0x52fd12[_0xcda1('0x20')][_0xcda1('0x25')],function(_0x19a54d){return{'model':db[_0x19a54d[_0xcda1('0x26')]],'as':_0x19a54d['as'],'attributes':_0x19a54d['attributes'],'include':_0x19a54d['include']?_[_0xcda1('0x24')](_0x19a54d[_0xcda1('0x25')],function(_0x19ec04){return{'model':db[_0x19ec04[_0xcda1('0x26')]],'as':_0x19ec04['as'],'attributes':_0x19ec04['attributes'],'include':_0x19ec04[_0xcda1('0x25')]?_[_0xcda1('0x24')](_0x19ec04[_0xcda1('0x25')],function(_0x4a3992){return{'model':db[_0x4a3992[_0xcda1('0x26')]],'as':_0x4a3992['as'],'attributes':_0x4a3992[_0xcda1('0x23')]};}):[]};}):[]};}):[]:[]})[_0xcda1('0x13')](function(_0x17c7a7){logger['info']('ShowMailQueue',_0x52fd12);logger['debug'](_0xcda1('0x28'),_0x52fd12,JSON[_0xcda1('0x18')](_0x17c7a7));_0x1ab8ea(_0x17c7a7);})[_0xcda1('0x1d')](function(_0x225f6a){logger['error']('ShowMailQueue',_0x225f6a[_0xcda1('0x1b')],_0x52fd12);_0x136c08(_0x59cf74[_0xcda1('0x1a')](0x1f4,_0x225f6a[_0xcda1('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 6c6961b..6f78799 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 _0xcc04=['length','./mailQueue.events','save','remove','update','emit','register'];(function(_0x4689d0,_0x5a28c5){var _0xb61270=function(_0x290db1){while(--_0x290db1){_0x4689d0['push'](_0x4689d0['shift']());}};_0xb61270(++_0x5a28c5);}(_0xcc04,0x1c8));var _0x4cc0=function(_0x3394fc,_0x20ce38){_0x3394fc=_0x3394fc-0x0;var _0x1abe8b=_0xcc04[_0x3394fc];return _0x1abe8b;};'use strict';var MailQueueEvents=require(_0x4cc0('0x0'));var events=[_0x4cc0('0x1'),_0x4cc0('0x2'),_0x4cc0('0x3')];function createListener(_0x186182,_0x22b308){return function(_0x317e23){_0x22b308[_0x4cc0('0x4')](_0x186182,_0x317e23);};}function removeListener(_0x38248a,_0x2ab193){return function(){MailQueueEvents['removeListener'](_0x38248a,_0x2ab193);};}exports[_0x4cc0('0x5')]=function(_0x374412){for(var _0x5d774b=0x0,_0x34f8a9=events[_0x4cc0('0x6')];_0x5d774b<_0x34f8a9;_0x5d774b++){var _0x17f22f=events[_0x5d774b];var _0x434b93=createListener('mailQueue:'+_0x17f22f,_0x374412);MailQueueEvents['on'](_0x17f22f,_0x434b93);}}; \ No newline at end of file +var _0xb6e5=['removeListener','length','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x1902eb,_0x4362bd){var _0x355eaa=function(_0x24d156){while(--_0x24d156){_0x1902eb['push'](_0x1902eb['shift']());}};_0x355eaa(++_0x4362bd);}(_0xb6e5,0x81));var _0x5b6e=function(_0x586ccd,_0x3bc6a0){_0x586ccd=_0x586ccd-0x0;var _0x46e27f=_0xb6e5[_0x586ccd];return _0x46e27f;};'use strict';var MailQueueEvents=require(_0x5b6e('0x0'));var events=[_0x5b6e('0x1'),_0x5b6e('0x2'),_0x5b6e('0x3')];function createListener(_0x9eda40,_0x89ebcb){return function(_0x15141c){_0x89ebcb['emit'](_0x9eda40,_0x15141c);};}function removeListener(_0x17b056,_0x473d68){return function(){MailQueueEvents[_0x5b6e('0x4')](_0x17b056,_0x473d68);};}exports['register']=function(_0x2457cd){for(var _0x5b459c=0x0,_0x232721=events[_0x5b6e('0x5')];_0x5b459c<_0x232721;_0x5b459c++){var _0x3b67da=events[_0x5b459c];var _0x2724ea=createListener(_0x5b6e('0x6')+_0x3b67da,_0x2457cd);MailQueueEvents['on'](_0x3b67da,_0x2724ea);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 6bcae90..0ca93b5 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 _0x881e=['fs-extra','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout'];(function(_0x200776,_0x47a291){var _0x250234=function(_0x4de3fa){while(--_0x4de3fa){_0x200776['push'](_0x200776['shift']());}};_0x250234(++_0x47a291);}(_0x881e,0x11a));var _0xe881=function(_0xb3d808,_0x3b3224){_0xb3d808=_0xb3d808-0x0;var _0x5bddaa=_0x881e[_0xb3d808];return _0x5bddaa;};'use strict';var multer=require(_0xe881('0x0'));var util=require(_0xe881('0x1'));var path=require('path');var timeout=require(_0xe881('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe881('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe881('0x4'));var config=require('../../config/environment');var controller=require(_0xe881('0x5'));router[_0xe881('0x6')]('/',auth[_0xe881('0x7')](),controller[_0xe881('0x8')]);router[_0xe881('0x6')](_0xe881('0x9'),auth[_0xe881('0x7')](),controller[_0xe881('0xa')]);router[_0xe881('0x6')]('/:id',auth[_0xe881('0x7')](),controller[_0xe881('0xb')]);router[_0xe881('0xc')]('/',auth['isAuthenticated'](),controller[_0xe881('0xd')]);router[_0xe881('0xe')](_0xe881('0xf'),auth[_0xe881('0x7')](),controller[_0xe881('0x10')]);router['delete'](_0xe881('0xf'),auth[_0xe881('0x7')](),controller[_0xe881('0x11')]);module[_0xe881('0x12')]=router; \ No newline at end of file +var _0x6ac7=['Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3cb051,_0x3aac86){var _0x21dd99=function(_0x794b58){while(--_0x794b58){_0x3cb051['push'](_0x3cb051['shift']());}};_0x21dd99(++_0x3aac86);}(_0x6ac7,0x1b4));var _0x76ac=function(_0x335b21,_0x43d273){_0x335b21=_0x335b21-0x0;var _0x11bb61=_0x6ac7[_0x335b21];return _0x11bb61;};'use strict';var multer=require(_0x76ac('0x0'));var util=require(_0x76ac('0x1'));var path=require('path');var timeout=require(_0x76ac('0x2'));var express=require(_0x76ac('0x3'));var router=express[_0x76ac('0x4')]();var fs_extra=require(_0x76ac('0x5'));var auth=require(_0x76ac('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x76ac('0x7'));var controller=require(_0x76ac('0x8'));router[_0x76ac('0x9')]('/',auth[_0x76ac('0xa')](),controller['index']);router['get'](_0x76ac('0xb'),auth[_0x76ac('0xa')](),controller[_0x76ac('0xc')]);router['get'](_0x76ac('0xd'),auth['isAuthenticated'](),controller[_0x76ac('0xe')]);router[_0x76ac('0xf')]('/',auth['isAuthenticated'](),controller[_0x76ac('0x10')]);router[_0x76ac('0x11')](_0x76ac('0xd'),auth[_0x76ac('0xa')](),controller[_0x76ac('0x12')]);router[_0x76ac('0x13')](_0x76ac('0xd'),auth[_0x76ac('0xa')](),controller[_0x76ac('0x14')]);module[_0x76ac('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index e33db75..da81f3b 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 _0xacd0=['DATE','moment','sequelize','exports','STRING'];(function(_0xab0faf,_0x2ea57f){var _0x2032ff=function(_0x49c224){while(--_0x49c224){_0xab0faf['push'](_0xab0faf['shift']());}};_0x2032ff(++_0x2ea57f);}(_0xacd0,0xc9));var _0x0acd=function(_0x408de5,_0x24fa7b){_0x408de5=_0x408de5-0x0;var _0x2015a1=_0xacd0[_0x408de5];return _0x2015a1;};'use strict';var moment=require(_0x0acd('0x0'));var Sequelize=require(_0x0acd('0x1'));module[_0x0acd('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0acd('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0acd('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0acd('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa5cf=['moment','sequelize','exports','STRING','DATE'];(function(_0x2d7712,_0x39aba4){var _0x2efa08=function(_0xfbe847){while(--_0xfbe847){_0x2d7712['push'](_0x2d7712['shift']());}};_0x2efa08(++_0x39aba4);}(_0xa5cf,0x12c));var _0xfa5c=function(_0xaae708,_0x3ef7d9){_0xaae708=_0xaae708-0x0;var _0x24653a=_0xa5cf[_0xaae708];return _0x24653a;};'use strict';var moment=require(_0xfa5c('0x0'));var Sequelize=require(_0xfa5c('0x1'));module[_0xfa5c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfa5c('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfa5c('0x4')]},'acceptAt':{'type':Sequelize[_0xfa5c('0x4')]},'exitAt':{'type':Sequelize[_0xfa5c('0x4')]},'reason':{'type':Sequelize[_0xfa5c('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 490f8af..111e7bf 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 _0xc2c7=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x155b1b,_0x36df28){var _0x156e37=function(_0x56bda0){while(--_0x56bda0){_0x155b1b['push'](_0x155b1b['shift']());}};_0x156e37(++_0x36df28);}(_0xc2c7,0x134));var _0x7c2c=function(_0x5c71c2,_0xbf7c88){_0x5c71c2=_0x5c71c2-0x0;var _0x432239=_0xc2c7[_0x5c71c2];return _0x432239;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['MailQueueReport'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['MailQueueReport'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));};exports['describe']=function(_0x13e0bf,_0x11d337){return db['MailQueueReport'][_0x7c2c('0x49')]()[_0x7c2c('0x26')](respondWithResult(_0x11d337,null))['catch'](handleError(_0x11d337,null));}; \ No newline at end of file +var _0x0b0e=['merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','MailQueueReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter'];(function(_0x1cd37f,_0x2b15a9){var _0x1d6e3b=function(_0x48d103){while(--_0x48d103){_0x1cd37f['push'](_0x1cd37f['shift']());}};_0x1d6e3b(++_0x2b15a9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x0b0e[_0x27c068];return _0xe5a67f;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['MailQueueReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['MailQueueReport'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['MailQueueReport']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};exports[_0xe0b0('0x4a')]=function(_0x54cf7b,_0x4b65d1){return db[_0xe0b0('0x2a')][_0xe0b0('0x4a')]()[_0xe0b0('0x23')](respondWithResult(_0x4b65d1,null))[_0xe0b0('0x43')](handleError(_0x4b65d1,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index afef8e6..492776b 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 _0x3663=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0x3663,0x1ee));var _0x3366=function(_0x3cb5f1,_0x48c50e){_0x3cb5f1=_0x3cb5f1-0x0;var _0x31d0c9=_0x3663[_0x3cb5f1];return _0x31d0c9;};'use strict';var _=require(_0x3366('0x0'));var util=require(_0x3366('0x1'));var logger=require(_0x3366('0x2'))('api');var moment=require(_0x3366('0x3'));var BPromise=require(_0x3366('0x4'));var rp=require(_0x3366('0x5'));var fs=require('fs');var path=require(_0x3366('0x6'));var rimraf=require('rimraf');var config=require(_0x3366('0x7'));var attributes=require(_0x3366('0x8'));module[_0x3366('0x9')]=function(_0x133760,_0x4331d9){return _0x133760[_0x3366('0xa')]('MailQueueReport',attributes,{'tableName':_0x3366('0xb'),'paranoid':![],'indexes':[{'name':_0x3366('0xc'),'fields':[_0x3366('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x14f4=['./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x254308,_0x4b501a){var _0x254c27=function(_0x527310){while(--_0x527310){_0x254308['push'](_0x254308['shift']());}};_0x254c27(++_0x4b501a);}(_0x14f4,0x1d9));var _0x414f=function(_0x15461a,_0x4915a6){_0x15461a=_0x15461a-0x0;var _0x21fe97=_0x14f4[_0x15461a];return _0x21fe97;};'use strict';var _=require('lodash');var util=require(_0x414f('0x0'));var logger=require(_0x414f('0x1'))(_0x414f('0x2'));var moment=require(_0x414f('0x3'));var BPromise=require(_0x414f('0x4'));var rp=require(_0x414f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x414f('0x6'));var config=require(_0x414f('0x7'));var attributes=require(_0x414f('0x8'));module[_0x414f('0x9')]=function(_0x49b714,_0x273f8b){return _0x49b714[_0x414f('0xa')](_0x414f('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x414f('0xc'),'fields':[_0x414f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index ffff559..d9dee98 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x45d2e8,_0x3c9572){var _0xfbdeb9=function(_0x252899){while(--_0x252899){_0x45d2e8['push'](_0x45d2e8['shift']());}};_0xfbdeb9(++_0x3c9572);}(_0x7a54,0x106));var _0x47a5=function(_0x563d87,_0x4d954f){_0x563d87=_0x563d87-0x0;var _0x8f6edf=_0x7a54[_0x563d87];return _0x8f6edf;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +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(_0x22e5b6,_0x4f821c){var _0x467ad2=function(_0x1e95a8){while(--_0x1e95a8){_0x22e5b6['push'](_0x22e5b6['shift']());}};_0x467ad2(++_0x4f821c);}(_0xadb5,0xad));var _0x5adb=function(_0x498b44,_0x5a43b3){_0x498b44=_0x498b44-0x0;var _0x34c189=_0xadb5[_0x498b44];return _0x34c189;};'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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 7236670..37206ea 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2ea9ea,_0x330ee5){var _0x58feae=function(_0x1a48b5){while(--_0x1a48b5){_0x2ea9ea['push'](_0x2ea9ea['shift']());}};_0x58feae(++_0x330ee5);}(_0x70e0,0x17b));var _0x070e=function(_0x3f3b7b,_0x3238d6){_0x3f3b7b=_0x3f3b7b-0x0;var _0x288802=_0x70e0[_0x3f3b7b];return _0x288802;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4d413d,_0x2822b8){var _0x47e8b7=function(_0x5458d6){while(--_0x5458d6){_0x4d413d['push'](_0x4d413d['shift']());}};_0x47e8b7(++_0x2822b8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 4d0b423..95d3cf6 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 _0x7262=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7262,0x1cc));var _0x2726=function(_0x1c9a80,_0x32424f){_0x1c9a80=_0x1c9a80-0x0;var _0x3d98d6=_0x7262[_0x1c9a80];return _0x3d98d6;};'use strict';var Sequelize=require(_0x2726('0x0'));module[_0x2726('0x1')]={'description':{'type':Sequelize[_0x2726('0x2')]},'host':{'type':Sequelize[_0x2726('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2726('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x2726('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x2726('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x2726('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x2726('0x2')]},'modernAuthentication':{'type':Sequelize[_0x2726('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xc0a6=['INBOX','STRING','BOOLEAN','INTEGER'];(function(_0x2798e4,_0x323aaa){var _0x2e2485=function(_0x1d121b){while(--_0x1d121b){_0x2798e4['push'](_0x2798e4['shift']());}};_0x2e2485(++_0x323aaa);}(_0xc0a6,0x139));var _0x6c0a=function(_0x31ff45,_0x574718){_0x31ff45=_0x31ff45-0x0;var _0x1c2efc=_0xc0a6[_0x31ff45];return _0x1c2efc;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x6c0a('0x0')]},'host':{'type':Sequelize[_0x6c0a('0x0')]},'authentication':{'type':Sequelize[_0x6c0a('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x6c0a('0x0')]},'password':{'type':Sequelize[_0x6c0a('0x0')]},'port':{'type':Sequelize[_0x6c0a('0x2')]},'tls':{'type':Sequelize[_0x6c0a('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x6c0a('0x3')},'connTimeout':{'type':Sequelize[_0x6c0a('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x6c0a('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x6c0a('0x0')]},'modernAuthentication':{'type':Sequelize[_0x6c0a('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 1bf52c6..859aa81 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 _0x2b6a=['request-promise','./mailServerIn.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x49cc34,_0x1d978c){var _0x9e56eb=function(_0x45646a){while(--_0x45646a){_0x49cc34['push'](_0x49cc34['shift']());}};_0x9e56eb(++_0x1d978c);}(_0x2b6a,0x1c6));var _0xa2b6=function(_0x23ae30,_0x2c2eb2){_0x23ae30=_0x23ae30-0x0;var _0x34facd=_0x2b6a[_0x23ae30];return _0x34facd;};'use strict';var _=require(_0xa2b6('0x0'));var util=require(_0xa2b6('0x1'));var logger=require(_0xa2b6('0x2'))(_0xa2b6('0x3'));var moment=require(_0xa2b6('0x4'));var BPromise=require('bluebird');var rp=require(_0xa2b6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa2b6('0x6'));module[_0xa2b6('0x7')]=function(_0xf31814,_0x53abe1){return _0xf31814[_0xa2b6('0x8')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x374f=['rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0xd9c274,_0x58f1ef){var _0x56aa81=function(_0x20029f){while(--_0x20029f){_0xd9c274['push'](_0xd9c274['shift']());}};_0x56aa81(++_0x58f1ef);}(_0x374f,0x72));var _0xf374=function(_0x2b1509,_0x3d3b7d){_0x2b1509=_0x2b1509-0x0;var _0x58edb4=_0x374f[_0x2b1509];return _0x58edb4;};'use strict';var _=require(_0xf374('0x0'));var util=require('util');var logger=require(_0xf374('0x1'))(_0xf374('0x2'));var moment=require(_0xf374('0x3'));var BPromise=require(_0xf374('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf374('0x5'));var rimraf=require(_0xf374('0x6'));var config=require('../../config/environment');var attributes=require(_0xf374('0x7'));module[_0xf374('0x8')]=function(_0x2e1e03,_0x142da6){return _0x2e1e03[_0xf374('0x9')](_0xf374('0xa'),attributes,{'tableName':_0xf374('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 f1e0d48..a381c5a 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 _0xb6b8=['result','catch','GetMailServerIn','MailServerIn','options','where','attributes','include','model','map','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailServerIn,\x20%s,\x20%s','message'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xb6b8,0xc5));var _0x8b6b=function(_0x289a98,_0x4ecccd){_0x289a98=_0x289a98-0x0;var _0x862eb5=_0xb6b8[_0x289a98];return _0x862eb5;};'use strict';var _=require('lodash');var util=require(_0x8b6b('0x0'));var moment=require(_0x8b6b('0x1'));var BPromise=require(_0x8b6b('0x2'));var rs=require(_0x8b6b('0x3'));var fs=require('fs');var Redis=require(_0x8b6b('0x4'));var db=require(_0x8b6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b6b('0x6'))(_0x8b6b('0x7'));var config=require(_0x8b6b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b6b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56da2a,_0x21bbc2,_0x303c21){return new BPromise(function(_0x142239,_0x21c84e){return client[_0x8b6b('0xa')](_0x56da2a,_0x303c21)[_0x8b6b('0xb')](function(_0x1f2c39){logger[_0x8b6b('0xc')]('MailServerIn,\x20%s,\x20%s',_0x21bbc2,'request\x20sent');logger['debug'](_0x8b6b('0xd'),_0x21bbc2,_0x8b6b('0xe'),JSON[_0x8b6b('0xf')](_0x1f2c39));if(_0x1f2c39['error']){if(_0x1f2c39[_0x8b6b('0x10')][_0x8b6b('0x11')]===0x1f4){logger['error'](_0x8b6b('0x12'),_0x21bbc2,_0x1f2c39['error'][_0x8b6b('0x13')]);return _0x21c84e(_0x1f2c39[_0x8b6b('0x10')]['message']);}logger['error'](_0x8b6b('0x12'),_0x21bbc2,_0x1f2c39['error'][_0x8b6b('0x13')]);return _0x142239(_0x1f2c39[_0x8b6b('0x10')][_0x8b6b('0x13')]);}else{logger[_0x8b6b('0xc')](_0x8b6b('0x12'),_0x21bbc2,'request\x20sent');_0x142239(_0x1f2c39[_0x8b6b('0x14')][_0x8b6b('0x13')]);}})[_0x8b6b('0x15')](function(_0x2d16c7){logger[_0x8b6b('0x10')](_0x8b6b('0x12'),_0x21bbc2,_0x2d16c7);_0x21c84e(_0x2d16c7);});});}exports[_0x8b6b('0x16')]=function(_0x4ab006){var _0x3d15d1=this;return new Promise(function(_0x106b3f,_0x11e588){return db[_0x8b6b('0x17')]['findAll']({'raw':_0x4ab006[_0x8b6b('0x18')]?_0x4ab006[_0x8b6b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4ab006['options']?_0x4ab006[_0x8b6b('0x18')][_0x8b6b('0x19')]||null:null,'attributes':_0x4ab006[_0x8b6b('0x18')]?_0x4ab006['options'][_0x8b6b('0x1a')]||null:null,'limit':_0x4ab006[_0x8b6b('0x18')]?_0x4ab006[_0x8b6b('0x18')]['limit']||null:null,'include':_0x4ab006[_0x8b6b('0x18')]?_0x4ab006[_0x8b6b('0x18')][_0x8b6b('0x1b')]?_['map'](_0x4ab006['options'][_0x8b6b('0x1b')],function(_0x47df9e){return{'model':db[_0x47df9e[_0x8b6b('0x1c')]],'as':_0x47df9e['as'],'attributes':_0x47df9e['attributes'],'include':_0x47df9e[_0x8b6b('0x1b')]?_[_0x8b6b('0x1d')](_0x47df9e[_0x8b6b('0x1b')],function(_0x2753fc){return{'model':db[_0x2753fc[_0x8b6b('0x1c')]],'as':_0x2753fc['as'],'attributes':_0x2753fc['attributes'],'include':_0x2753fc['include']?_[_0x8b6b('0x1d')](_0x2753fc[_0x8b6b('0x1b')],function(_0x434631){return{'model':db[_0x434631[_0x8b6b('0x1c')]],'as':_0x434631['as'],'attributes':_0x434631[_0x8b6b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8b6b('0xb')](function(_0x4a6dae){logger['info'](_0x8b6b('0x16'),_0x4ab006);logger[_0x8b6b('0x1e')](_0x8b6b('0x16'),_0x4ab006,JSON[_0x8b6b('0xf')](_0x4a6dae));_0x106b3f(_0x4a6dae);})[_0x8b6b('0x15')](function(_0x157350){logger[_0x8b6b('0x10')](_0x8b6b('0x16'),_0x157350[_0x8b6b('0x13')],_0x4ab006);_0x11e588(_0x3d15d1['error'](0x1f4,_0x157350[_0x8b6b('0x13')]));});});}; \ No newline at end of file +var _0x2413=['attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','include','map','model'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x2413,0x1a1));var _0x3241=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2413[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x3241('0x0'));var util=require('util');var moment=require(_0x3241('0x1'));var BPromise=require('bluebird');var rs=require(_0x3241('0x2'));var fs=require('fs');var Redis=require(_0x3241('0x3'));var db=require(_0x3241('0x4'))['db'];var utils=require(_0x3241('0x5'));var logger=require(_0x3241('0x6'))('rpc');var config=require(_0x3241('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3241('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19bcef,_0x39a113,_0x3ea78e){return new BPromise(function(_0x3a7848,_0x26dc64){return client[_0x3241('0x9')](_0x19bcef,_0x3ea78e)[_0x3241('0xa')](function(_0x1f2659){logger[_0x3241('0xb')]('MailServerIn,\x20%s,\x20%s',_0x39a113,'request\x20sent');logger[_0x3241('0xc')](_0x3241('0xd'),_0x39a113,_0x3241('0xe'),JSON[_0x3241('0xf')](_0x1f2659));if(_0x1f2659[_0x3241('0x10')]){if(_0x1f2659[_0x3241('0x10')]['code']===0x1f4){logger['error'](_0x3241('0x11'),_0x39a113,_0x1f2659['error'][_0x3241('0x12')]);return _0x26dc64(_0x1f2659[_0x3241('0x10')][_0x3241('0x12')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x39a113,_0x1f2659[_0x3241('0x10')][_0x3241('0x12')]);return _0x3a7848(_0x1f2659[_0x3241('0x10')][_0x3241('0x12')]);}else{logger[_0x3241('0xb')](_0x3241('0x11'),_0x39a113,_0x3241('0xe'));_0x3a7848(_0x1f2659[_0x3241('0x13')]['message']);}})[_0x3241('0x14')](function(_0xf5ba32){logger['error'](_0x3241('0x11'),_0x39a113,_0xf5ba32);_0x26dc64(_0xf5ba32);});});}exports[_0x3241('0x15')]=function(_0x4cdd14){var _0x3e4f8c=this;return new Promise(function(_0x5879eb,_0x266e00){return db[_0x3241('0x16')][_0x3241('0x17')]({'raw':_0x4cdd14[_0x3241('0x18')]?_0x4cdd14[_0x3241('0x18')][_0x3241('0x19')]===undefined?!![]:![]:!![],'where':_0x4cdd14['options']?_0x4cdd14['options'][_0x3241('0x1a')]||null:null,'attributes':_0x4cdd14['options']?_0x4cdd14[_0x3241('0x18')]['attributes']||null:null,'limit':_0x4cdd14[_0x3241('0x18')]?_0x4cdd14[_0x3241('0x18')][_0x3241('0x1b')]||null:null,'include':_0x4cdd14[_0x3241('0x18')]?_0x4cdd14['options'][_0x3241('0x1c')]?_[_0x3241('0x1d')](_0x4cdd14[_0x3241('0x18')]['include'],function(_0x1edaa8){return{'model':db[_0x1edaa8[_0x3241('0x1e')]],'as':_0x1edaa8['as'],'attributes':_0x1edaa8[_0x3241('0x1f')],'include':_0x1edaa8[_0x3241('0x1c')]?_[_0x3241('0x1d')](_0x1edaa8['include'],function(_0x586e9d){return{'model':db[_0x586e9d[_0x3241('0x1e')]],'as':_0x586e9d['as'],'attributes':_0x586e9d[_0x3241('0x1f')],'include':_0x586e9d['include']?_[_0x3241('0x1d')](_0x586e9d[_0x3241('0x1c')],function(_0x2947e6){return{'model':db[_0x2947e6[_0x3241('0x1e')]],'as':_0x2947e6['as'],'attributes':_0x2947e6[_0x3241('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3241('0xa')](function(_0x3a1d12){logger[_0x3241('0xb')]('GetMailServerIn',_0x4cdd14);logger[_0x3241('0xc')](_0x3241('0x15'),_0x4cdd14,JSON[_0x3241('0xf')](_0x3a1d12));_0x5879eb(_0x3a1d12);})['catch'](function(_0x37a529){logger[_0x3241('0x10')](_0x3241('0x15'),_0x37a529[_0x3241('0x12')],_0x4cdd14);_0x266e00(_0x3e4f8c[_0x3241('0x10')](0x1f4,_0x37a529[_0x3241('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 960db15..d7db41b 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(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a54,0x106));var _0x47a5=function(_0x2f6992,_0x565206){_0x2f6992=_0x2f6992-0x0;var _0x34c36a=_0x7a54[_0x2f6992];return _0x34c36a;};'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(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 9a57ac7..f0e578f 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 _0xd4f4=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x3a53dd,_0x250708){var _0x1c1261=function(_0x2ff6cc){while(--_0x2ff6cc){_0x3a53dd['push'](_0x3a53dd['shift']());}};_0x1c1261(++_0x250708);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x54355c,_0x4e7bfa){_0x54355c=_0x54355c-0x0;var _0x43ca41=_0xd4f4[_0x54355c];return _0x43ca41;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'description':{'type':Sequelize[_0x4d4f('0x2')]},'host':{'type':Sequelize[_0x4d4f('0x2')]},'user':{'type':Sequelize[_0x4d4f('0x2')]},'pass':{'type':Sequelize[_0x4d4f('0x2')]},'port':{'type':Sequelize[_0x4d4f('0x3')]},'secure':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x4d4f('0x2')]},'authentication':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x3423=['INTEGER','BOOLEAN','STRING'];(function(_0x4343b6,_0x3bd4d4){var _0x5be505=function(_0x56a50c){while(--_0x56a50c){_0x4343b6['push'](_0x4343b6['shift']());}};_0x5be505(++_0x3bd4d4);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x3342('0x0')]},'host':{'type':Sequelize[_0x3342('0x0')]},'user':{'type':Sequelize[_0x3342('0x0')]},'pass':{'type':Sequelize[_0x3342('0x0')]},'port':{'type':Sequelize[_0x3342('0x1')]},'secure':{'type':Sequelize[_0x3342('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x3342('0x0')]},'authentication':{'type':Sequelize[_0x3342('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3342('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index a62db2f..09fa7bd 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 _0xa117=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','stack','name','send','index','MailServerOut','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','rows','catch','rawAttributes','includeAll','create','body','params','destroy','find','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse'];(function(_0x560b93,_0x2d05fc){var _0x1d7bbb=function(_0x54003f){while(--_0x54003f){_0x560b93['push'](_0x560b93['shift']());}};_0x1d7bbb(++_0x2d05fc);}(_0xa117,0x122));var _0x7a11=function(_0x471102,_0x5518cb){_0x471102=_0x471102-0x0;var _0x57b492=_0xa117[_0x471102];return _0x57b492;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7a11('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a11('0x1'));var moment=require(_0x7a11('0x2'));var BPromise=require(_0x7a11('0x3'));var Mustache=require(_0x7a11('0x4'));var util=require(_0x7a11('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x7a11('0x6'));var ejs=require(_0x7a11('0x7'));var fs=require('fs');var fs_extra=require(_0x7a11('0x8'));var _=require(_0x7a11('0x9'));var squel=require(_0x7a11('0xa'));var crypto=require(_0x7a11('0xb'));var jsforce=require(_0x7a11('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7a11('0xd'));var Redis=require(_0x7a11('0xe'));var authService=require(_0x7a11('0xf'));var qs=require(_0x7a11('0x10'));var as=require(_0x7a11('0x11'));var hardwareService=require(_0x7a11('0x12'));var logger=require(_0x7a11('0x13'))(_0x7a11('0x14'));var utils=require(_0x7a11('0x15'));var config=require(_0x7a11('0x16'));var licenseUtil=require(_0x7a11('0x17'));var db=require(_0x7a11('0x18'))['db'];function respondWithStatusCode(_0x15fc5b,_0x1e0821){_0x1e0821=_0x1e0821||0xcc;return function(_0x1435cf){if(_0x1435cf){return _0x15fc5b[_0x7a11('0x19')](_0x1e0821);}return _0x15fc5b[_0x7a11('0x1a')](_0x1e0821)[_0x7a11('0x1b')]();};}function respondWithResult(_0x2bd62a,_0x1a8171){_0x1a8171=_0x1a8171||0xc8;return function(_0x2faed6){if(_0x2faed6){return _0x2bd62a[_0x7a11('0x1a')](_0x1a8171)[_0x7a11('0x1c')](_0x2faed6);}};}function respondWithFilteredResult(_0x2a2847,_0x479e4d){return function(_0x2bc8e9){if(_0x2bc8e9){var _0x126c78=typeof _0x479e4d[_0x7a11('0x1d')]===_0x7a11('0x1e')&&typeof _0x479e4d[_0x7a11('0x1f')]==='undefined';var _0x1a957b=_0x2bc8e9[_0x7a11('0x20')];var _0x84ff11=_0x126c78?0x0:_0x479e4d['offset'];var _0x22f035=_0x126c78?_0x2bc8e9['count']:_0x479e4d[_0x7a11('0x1d')]+_0x479e4d[_0x7a11('0x1f')];var _0x5e0225;if(_0x22f035>=_0x1a957b){_0x22f035=_0x1a957b;_0x5e0225=0xc8;}else{_0x5e0225=0xce;}_0x2a2847[_0x7a11('0x1a')](_0x5e0225);return _0x2a2847['set'](_0x7a11('0x21'),_0x84ff11+'-'+_0x22f035+'/'+_0x1a957b)[_0x7a11('0x1c')](_0x2bc8e9);}return null;};}function patchUpdates(_0x39023d){return function(_0x11080a){try{jsonpatch['apply'](_0x11080a,_0x39023d,!![]);}catch(_0x43a88b){return BPromise[_0x7a11('0x22')](_0x43a88b);}return _0x11080a[_0x7a11('0x23')]();};}function saveUpdates(_0x2d73a9,_0x22aaed){return function(_0x17b5d2){if(_0x17b5d2){return _0x17b5d2[_0x7a11('0x24')](_0x2d73a9)[_0x7a11('0x25')](function(_0x4ff659){return _0x4ff659;});}return null;};}function removeEntity(_0x356411,_0x49a8fd){return function(_0x367af9){if(_0x367af9){return _0x367af9['destroy']()['then'](function(){_0x356411[_0x7a11('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dff34,_0x4b0bb6){return function(_0x3f04ce){if(!_0x3f04ce){_0x1dff34[_0x7a11('0x19')](0x194);}return _0x3f04ce;};}function handleError(_0x29f6e6,_0x1e32ca){_0x1e32ca=_0x1e32ca||0x1f4;return function(_0x458712){logger['error'](_0x458712[_0x7a11('0x26')]);if(_0x458712[_0x7a11('0x27')]){delete _0x458712[_0x7a11('0x27')];}_0x29f6e6['status'](_0x1e32ca)[_0x7a11('0x28')](_0x458712);};}exports[_0x7a11('0x29')]=function(_0x1c34e8,_0x4e3a6d){var _0x404474={},_0x5ac061={},_0x11410d={'count':0x0,'rows':[]};var _0x537e17=_['map'](db[_0x7a11('0x2a')]['rawAttributes'],function(_0x2e9795){return{'name':_0x2e9795[_0x7a11('0x2b')],'type':_0x2e9795[_0x7a11('0x2c')][_0x7a11('0x2d')]};});_0x5ac061['model']=_['map'](_0x537e17,'name');_0x5ac061['query']=_[_0x7a11('0x2e')](_0x1c34e8[_0x7a11('0x2f')]);_0x5ac061[_0x7a11('0x30')]=_['intersection'](_0x5ac061[_0x7a11('0x31')],_0x5ac061[_0x7a11('0x2f')]);_0x404474['attributes']=_[_0x7a11('0x32')](_0x5ac061[_0x7a11('0x31')],qs['fields'](_0x1c34e8[_0x7a11('0x2f')][_0x7a11('0x33')]));_0x404474['attributes']=_0x404474[_0x7a11('0x34')][_0x7a11('0x35')]?_0x404474[_0x7a11('0x34')]:_0x5ac061[_0x7a11('0x31')];if(!_0x1c34e8[_0x7a11('0x2f')][_0x7a11('0x36')](_0x7a11('0x37'))){_0x404474['limit']=qs[_0x7a11('0x1f')](_0x1c34e8['query'][_0x7a11('0x1f')]);_0x404474['offset']=qs[_0x7a11('0x1d')](_0x1c34e8[_0x7a11('0x2f')][_0x7a11('0x1d')]);}_0x404474[_0x7a11('0x38')]=qs['sort'](_0x1c34e8[_0x7a11('0x2f')][_0x7a11('0x39')]);_0x404474['where']=qs[_0x7a11('0x30')](_[_0x7a11('0x3a')](_0x1c34e8[_0x7a11('0x2f')],_0x5ac061[_0x7a11('0x30')]),_0x537e17);if(_0x1c34e8['query'][_0x7a11('0x3b')]){_0x404474[_0x7a11('0x3c')]=_[_0x7a11('0x3d')](_0x404474['where'],{'$or':_[_0x7a11('0x3e')](_0x537e17,function(_0x4583c4){if(_0x4583c4[_0x7a11('0x2c')]!==_0x7a11('0x3f')){var _0x14f8ac={};_0x14f8ac[_0x4583c4[_0x7a11('0x27')]]={'$like':'%'+_0x1c34e8[_0x7a11('0x2f')][_0x7a11('0x3b')]+'%'};return _0x14f8ac;}})});}_0x404474=_[_0x7a11('0x3d')]({},_0x404474,_0x1c34e8[_0x7a11('0x40')]);var _0x3afe78={'where':_0x404474[_0x7a11('0x3c')]};return db['MailServerOut'][_0x7a11('0x20')](_0x3afe78)[_0x7a11('0x25')](function(_0x1ce160){_0x11410d[_0x7a11('0x20')]=_0x1ce160;if(_0x1c34e8[_0x7a11('0x2f')]['includeAll']){_0x404474[_0x7a11('0x41')]=[{'all':!![]}];}return db[_0x7a11('0x2a')][_0x7a11('0x42')](_0x404474);})[_0x7a11('0x25')](function(_0x5ababc){_0x11410d[_0x7a11('0x43')]=_0x5ababc;return _0x11410d;})[_0x7a11('0x25')](respondWithFilteredResult(_0x4e3a6d,_0x404474))[_0x7a11('0x44')](handleError(_0x4e3a6d,null));};exports['show']=function(_0x544547,_0x36302c){var _0x27946a={'raw':!![],'where':{'id':_0x544547['params']['id']}},_0x139ca0={};_0x139ca0['model']=_['keys'](db[_0x7a11('0x2a')][_0x7a11('0x45')]);_0x139ca0[_0x7a11('0x2f')]=_[_0x7a11('0x2e')](_0x544547[_0x7a11('0x2f')]);_0x139ca0['filters']=_[_0x7a11('0x32')](_0x139ca0['model'],_0x139ca0[_0x7a11('0x2f')]);_0x27946a[_0x7a11('0x34')]=_['intersection'](_0x139ca0[_0x7a11('0x31')],qs[_0x7a11('0x33')](_0x544547[_0x7a11('0x2f')][_0x7a11('0x33')]));_0x27946a[_0x7a11('0x34')]=_0x27946a[_0x7a11('0x34')][_0x7a11('0x35')]?_0x27946a[_0x7a11('0x34')]:_0x139ca0[_0x7a11('0x31')];if(_0x544547[_0x7a11('0x2f')][_0x7a11('0x46')]){_0x27946a[_0x7a11('0x41')]=[{'all':!![]}];}_0x27946a=_[_0x7a11('0x3d')]({},_0x27946a,_0x544547[_0x7a11('0x40')]);return db[_0x7a11('0x2a')]['find'](_0x27946a)[_0x7a11('0x25')](handleEntityNotFound(_0x36302c,null))[_0x7a11('0x25')](respondWithResult(_0x36302c,null))[_0x7a11('0x44')](handleError(_0x36302c,null));};exports[_0x7a11('0x47')]=function(_0x22a7b0,_0x28cde7){return db[_0x7a11('0x2a')][_0x7a11('0x47')](_0x22a7b0[_0x7a11('0x48')],{})['then'](respondWithResult(_0x28cde7,0xc9))[_0x7a11('0x44')](handleError(_0x28cde7,null));};exports['update']=function(_0x1d9dd9,_0x15922f){if(_0x1d9dd9['body']['id']){delete _0x1d9dd9[_0x7a11('0x48')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x1d9dd9[_0x7a11('0x49')]['id']}})['then'](handleEntityNotFound(_0x15922f,null))[_0x7a11('0x25')](saveUpdates(_0x1d9dd9[_0x7a11('0x48')],null))[_0x7a11('0x25')](respondWithResult(_0x15922f,null))[_0x7a11('0x44')](handleError(_0x15922f,null));};exports[_0x7a11('0x4a')]=function(_0x2f8ffc,_0x51ffa3){return db[_0x7a11('0x2a')][_0x7a11('0x4b')]({'where':{'id':_0x2f8ffc[_0x7a11('0x49')]['id']}})[_0x7a11('0x25')](handleEntityNotFound(_0x51ffa3,null))[_0x7a11('0x25')](removeEntity(_0x51ffa3,null))['catch'](handleError(_0x51ffa3,null));}; \ No newline at end of file +var _0x822b=['squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','end','sendStatus','error','stack','name','send','index','MailServerOut','rawAttributes','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x48fa3f,_0x700760){var _0x16037d=function(_0x23fe27){while(--_0x23fe27){_0x48fa3f['push'](_0x48fa3f['shift']());}};_0x16037d(++_0x700760);}(_0x822b,0x161));var _0xb822=function(_0x3e9582,_0x5ef882){_0x3e9582=_0x3e9582-0x0;var _0xdf59d7=_0x822b[_0x3e9582];return _0xdf59d7;};'use strict';var emlformat=require(_0xb822('0x0'));var rimraf=require(_0xb822('0x1'));var zipdir=require(_0xb822('0x2'));var jsonpatch=require(_0xb822('0x3'));var rp=require(_0xb822('0x4'));var moment=require('moment');var BPromise=require(_0xb822('0x5'));var Mustache=require(_0xb822('0x6'));var util=require(_0xb822('0x7'));var path=require(_0xb822('0x8'));var sox=require(_0xb822('0x9'));var csv=require(_0xb822('0xa'));var ejs=require(_0xb822('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb822('0xc'));var crypto=require(_0xb822('0xd'));var jsforce=require(_0xb822('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb822('0xf'));var Papa=require('papaparse');var Redis=require(_0xb822('0x10'));var authService=require(_0xb822('0x11'));var qs=require(_0xb822('0x12'));var as=require(_0xb822('0x13'));var hardwareService=require(_0xb822('0x14'));var logger=require(_0xb822('0x15'))('api');var utils=require(_0xb822('0x16'));var config=require(_0xb822('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26bbc7,_0x5ccfb4){_0x5ccfb4=_0x5ccfb4||0xcc;return function(_0x3abbb2){if(_0x3abbb2){return _0x26bbc7['sendStatus'](_0x5ccfb4);}return _0x26bbc7[_0xb822('0x18')](_0x5ccfb4)['end']();};}function respondWithResult(_0x38a09a,_0x34e330){_0x34e330=_0x34e330||0xc8;return function(_0x8eaa9c){if(_0x8eaa9c){return _0x38a09a[_0xb822('0x18')](_0x34e330)[_0xb822('0x19')](_0x8eaa9c);}};}function respondWithFilteredResult(_0x4b3ef6,_0x124568){return function(_0x567c85){if(_0x567c85){var _0x28adf6=typeof _0x124568[_0xb822('0x1a')]===_0xb822('0x1b')&&typeof _0x124568[_0xb822('0x1c')]==='undefined';var _0x4fd4ce=_0x567c85['count'];var _0x3b5dcc=_0x28adf6?0x0:_0x124568[_0xb822('0x1a')];var _0xbf6eb3=_0x28adf6?_0x567c85[_0xb822('0x1d')]:_0x124568[_0xb822('0x1a')]+_0x124568[_0xb822('0x1c')];var _0x8392f6;if(_0xbf6eb3>=_0x4fd4ce){_0xbf6eb3=_0x4fd4ce;_0x8392f6=0xc8;}else{_0x8392f6=0xce;}_0x4b3ef6[_0xb822('0x18')](_0x8392f6);return _0x4b3ef6[_0xb822('0x1e')](_0xb822('0x1f'),_0x3b5dcc+'-'+_0xbf6eb3+'/'+_0x4fd4ce)[_0xb822('0x19')](_0x567c85);}return null;};}function patchUpdates(_0x486075){return function(_0xaef91){try{jsonpatch['apply'](_0xaef91,_0x486075,!![]);}catch(_0x11760f){return BPromise[_0xb822('0x20')](_0x11760f);}return _0xaef91['save']();};}function saveUpdates(_0x445e0f,_0x5e7710){return function(_0x4397e9){if(_0x4397e9){return _0x4397e9['update'](_0x445e0f)['then'](function(_0x38fe1b){return _0x38fe1b;});}return null;};}function removeEntity(_0x2dffeb,_0x468316){return function(_0x28988d){if(_0x28988d){return _0x28988d[_0xb822('0x21')]()[_0xb822('0x22')](function(){_0x2dffeb[_0xb822('0x18')](0xcc)[_0xb822('0x23')]();});}};}function handleEntityNotFound(_0x150ee2,_0x24cf9b){return function(_0x384454){if(!_0x384454){_0x150ee2[_0xb822('0x24')](0x194);}return _0x384454;};}function handleError(_0x4d7303,_0x2a266a){_0x2a266a=_0x2a266a||0x1f4;return function(_0x3c6c26){logger[_0xb822('0x25')](_0x3c6c26[_0xb822('0x26')]);if(_0x3c6c26[_0xb822('0x27')]){delete _0x3c6c26[_0xb822('0x27')];}_0x4d7303[_0xb822('0x18')](_0x2a266a)[_0xb822('0x28')](_0x3c6c26);};}exports[_0xb822('0x29')]=function(_0xd59456,_0x3f4712){var _0x15f3d9={},_0x556878={},_0x43eac4={'count':0x0,'rows':[]};var _0x2a7792=_['map'](db[_0xb822('0x2a')][_0xb822('0x2b')],function(_0x5eaa5c){return{'name':_0x5eaa5c['fieldName'],'type':_0x5eaa5c[_0xb822('0x2c')][_0xb822('0x2d')]};});_0x556878['model']=_[_0xb822('0x2e')](_0x2a7792,'name');_0x556878[_0xb822('0x2f')]=_[_0xb822('0x30')](_0xd59456[_0xb822('0x2f')]);_0x556878[_0xb822('0x31')]=_['intersection'](_0x556878[_0xb822('0x32')],_0x556878[_0xb822('0x2f')]);_0x15f3d9[_0xb822('0x33')]=_[_0xb822('0x34')](_0x556878[_0xb822('0x32')],qs[_0xb822('0x35')](_0xd59456['query'][_0xb822('0x35')]));_0x15f3d9[_0xb822('0x33')]=_0x15f3d9[_0xb822('0x33')][_0xb822('0x36')]?_0x15f3d9[_0xb822('0x33')]:_0x556878[_0xb822('0x32')];if(!_0xd59456[_0xb822('0x2f')]['hasOwnProperty']('nolimit')){_0x15f3d9[_0xb822('0x1c')]=qs[_0xb822('0x1c')](_0xd59456[_0xb822('0x2f')][_0xb822('0x1c')]);_0x15f3d9[_0xb822('0x1a')]=qs[_0xb822('0x1a')](_0xd59456[_0xb822('0x2f')][_0xb822('0x1a')]);}_0x15f3d9[_0xb822('0x37')]=qs[_0xb822('0x38')](_0xd59456[_0xb822('0x2f')][_0xb822('0x38')]);_0x15f3d9[_0xb822('0x39')]=qs[_0xb822('0x31')](_[_0xb822('0x3a')](_0xd59456['query'],_0x556878[_0xb822('0x31')]),_0x2a7792);if(_0xd59456['query'][_0xb822('0x3b')]){_0x15f3d9['where']=_[_0xb822('0x3c')](_0x15f3d9[_0xb822('0x39')],{'$or':_[_0xb822('0x2e')](_0x2a7792,function(_0x25bac2){if(_0x25bac2['type']!==_0xb822('0x3d')){var _0x517305={};_0x517305[_0x25bac2[_0xb822('0x27')]]={'$like':'%'+_0xd59456['query'][_0xb822('0x3b')]+'%'};return _0x517305;}})});}_0x15f3d9=_[_0xb822('0x3c')]({},_0x15f3d9,_0xd59456[_0xb822('0x3e')]);var _0xb087dd={'where':_0x15f3d9['where']};return db['MailServerOut'][_0xb822('0x1d')](_0xb087dd)[_0xb822('0x22')](function(_0x4b76a4){_0x43eac4[_0xb822('0x1d')]=_0x4b76a4;if(_0xd59456['query'][_0xb822('0x3f')]){_0x15f3d9['include']=[{'all':!![]}];}return db['MailServerOut'][_0xb822('0x40')](_0x15f3d9);})[_0xb822('0x22')](function(_0x2691ff){_0x43eac4[_0xb822('0x41')]=_0x2691ff;return _0x43eac4;})[_0xb822('0x22')](respondWithFilteredResult(_0x3f4712,_0x15f3d9))[_0xb822('0x42')](handleError(_0x3f4712,null));};exports[_0xb822('0x43')]=function(_0x39424d,_0xb26e2a){var _0x4b2399={'raw':!![],'where':{'id':_0x39424d[_0xb822('0x44')]['id']}},_0x2c67c1={};_0x2c67c1['model']=_[_0xb822('0x30')](db['MailServerOut'][_0xb822('0x2b')]);_0x2c67c1[_0xb822('0x2f')]=_[_0xb822('0x30')](_0x39424d[_0xb822('0x2f')]);_0x2c67c1['filters']=_[_0xb822('0x34')](_0x2c67c1[_0xb822('0x32')],_0x2c67c1['query']);_0x4b2399['attributes']=_[_0xb822('0x34')](_0x2c67c1[_0xb822('0x32')],qs[_0xb822('0x35')](_0x39424d[_0xb822('0x2f')][_0xb822('0x35')]));_0x4b2399[_0xb822('0x33')]=_0x4b2399[_0xb822('0x33')][_0xb822('0x36')]?_0x4b2399[_0xb822('0x33')]:_0x2c67c1[_0xb822('0x32')];if(_0x39424d[_0xb822('0x2f')]['includeAll']){_0x4b2399[_0xb822('0x45')]=[{'all':!![]}];}_0x4b2399=_['merge']({},_0x4b2399,_0x39424d[_0xb822('0x3e')]);return db['MailServerOut'][_0xb822('0x46')](_0x4b2399)[_0xb822('0x22')](handleEntityNotFound(_0xb26e2a,null))[_0xb822('0x22')](respondWithResult(_0xb26e2a,null))[_0xb822('0x42')](handleError(_0xb26e2a,null));};exports[_0xb822('0x47')]=function(_0x127dd5,_0x11cba6){return db[_0xb822('0x2a')][_0xb822('0x47')](_0x127dd5['body'],{})['then'](respondWithResult(_0x11cba6,0xc9))[_0xb822('0x42')](handleError(_0x11cba6,null));};exports['update']=function(_0x5a67ec,_0x254e94){if(_0x5a67ec[_0xb822('0x48')]['id']){delete _0x5a67ec[_0xb822('0x48')]['id'];}return db['MailServerOut'][_0xb822('0x46')]({'where':{'id':_0x5a67ec[_0xb822('0x44')]['id']}})[_0xb822('0x22')](handleEntityNotFound(_0x254e94,null))[_0xb822('0x22')](saveUpdates(_0x5a67ec[_0xb822('0x48')],null))[_0xb822('0x22')](respondWithResult(_0x254e94,null))['catch'](handleError(_0x254e94,null));};exports['destroy']=function(_0x3ec586,_0x1cb545){return db[_0xb822('0x2a')]['find']({'where':{'id':_0x3ec586[_0xb822('0x44')]['id']}})[_0xb822('0x22')](handleEntityNotFound(_0x1cb545,null))[_0xb822('0x22')](removeEntity(_0x1cb545,null))[_0xb822('0x42')](handleError(_0x1cb545,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 1dcd9b2..8c5afd0 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 _0xb4cd=['MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','exports'];(function(_0x17dc7d,_0x107272){var _0x4fd0c2=function(_0x36723f){while(--_0x36723f){_0x17dc7d['push'](_0x17dc7d['shift']());}};_0x4fd0c2(++_0x107272);}(_0xb4cd,0x86));var _0xdb4c=function(_0x54ff06,_0x416580){_0x54ff06=_0x54ff06-0x0;var _0x26c033=_0xb4cd[_0x54ff06];return _0x26c033;};'use strict';var _=require(_0xdb4c('0x0'));var util=require('util');var logger=require(_0xdb4c('0x1'))(_0xdb4c('0x2'));var moment=require(_0xdb4c('0x3'));var BPromise=require(_0xdb4c('0x4'));var rp=require(_0xdb4c('0x5'));var fs=require('fs');var path=require(_0xdb4c('0x6'));var rimraf=require(_0xdb4c('0x7'));var config=require('../../config/environment');var attributes=require(_0xdb4c('0x8'));module[_0xdb4c('0x9')]=function(_0x1e3f6d,_0x182af3){return _0x1e3f6d['define'](_0xdb4c('0xa'),attributes,{'tableName':_0xdb4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77bc=['./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x77bc,0x108));var _0xc77b=function(_0x55178d,_0xd90ff){_0x55178d=_0x55178d-0x0;var _0x311396=_0x77bc[_0x55178d];return _0x311396;};'use strict';var _=require(_0xc77b('0x0'));var util=require(_0xc77b('0x1'));var logger=require(_0xc77b('0x2'))('api');var moment=require(_0xc77b('0x3'));var BPromise=require(_0xc77b('0x4'));var rp=require(_0xc77b('0x5'));var fs=require('fs');var path=require(_0xc77b('0x6'));var rimraf=require(_0xc77b('0x7'));var config=require(_0xc77b('0x8'));var attributes=require(_0xc77b('0x9'));module[_0xc77b('0xa')]=function(_0x53fa4d,_0x5d1972){return _0x53fa4d[_0xc77b('0xb')]('MailServerOut',attributes,{'tableName':_0xc77b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 7f94310..dcb81f9 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x30f910,_0x8e3a23){var _0x836515=function(_0x1742eb){while(--_0x1742eb){_0x30f910['push'](_0x30f910['shift']());}};_0x836515(++_0x8e3a23);}(_0xadb5,0xad));var _0x5adb=function(_0x4a71ad,_0x148ba4){_0x4a71ad=_0x4a71ad-0x0;var _0x2402f9=_0xadb5[_0x4a71ad];return _0x2402f9;};'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']('MailServerOut,\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 +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x489a55,_0x1f5395){var _0x5beb03=function(_0x2fb454){while(--_0x2fb454){_0x489a55['push'](_0x489a55['shift']());}};_0x5beb03(++_0x1f5395);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'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')]('MailServerOut,\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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 0f908a7..4b29379 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 _0x5899=['./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x80d9f4,_0x34882b){var _0x1f78f1=function(_0x45db65){while(--_0x45db65){_0x80d9f4['push'](_0x80d9f4['shift']());}};_0x1f78f1(++_0x34882b);}(_0x5899,0xb4));var _0x9589=function(_0x38c897,_0x250282){_0x38c897=_0x38c897-0x0;var _0x382b25=_0x5899[_0x38c897];return _0x382b25;};'use strict';var multer=require(_0x9589('0x0'));var util=require('util');var path=require(_0x9589('0x1'));var timeout=require(_0x9589('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9589('0x3'));var auth=require(_0x9589('0x4'));var interaction=require(_0x9589('0x5'));var config=require(_0x9589('0x6'));var controller=require(_0x9589('0x7'));router[_0x9589('0x8')]('/',auth[_0x9589('0x9')](),controller[_0x9589('0xa')]);router[_0x9589('0x8')](_0x9589('0xb'),auth[_0x9589('0x9')](),controller[_0x9589('0xc')]);router['get'](_0x9589('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9589('0x9')](),controller['create']);router['put']('/:id',auth[_0x9589('0x9')](),controller['update']);router[_0x9589('0xe')](_0x9589('0xd'),auth['isAuthenticated'](),controller[_0x9589('0xf')]);module[_0x9589('0x10')]=router; \ No newline at end of file +var _0xb53e=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x5d1437,_0x3ccad1){var _0x18e4e7=function(_0x32624a){while(--_0x32624a){_0x5d1437['push'](_0x5d1437['shift']());}};_0x18e4e7(++_0x3ccad1);}(_0xb53e,0x134));var _0xeb53=function(_0x4be042,_0x686535){_0x4be042=_0x4be042-0x0;var _0x58328e=_0xb53e[_0x4be042];return _0x58328e;};'use strict';var multer=require(_0xeb53('0x0'));var util=require(_0xeb53('0x1'));var path=require(_0xeb53('0x2'));var timeout=require(_0xeb53('0x3'));var express=require(_0xeb53('0x4'));var router=express[_0xeb53('0x5')]();var fs_extra=require(_0xeb53('0x6'));var auth=require(_0xeb53('0x7'));var interaction=require(_0xeb53('0x8'));var config=require(_0xeb53('0x9'));var controller=require(_0xeb53('0xa'));router['get']('/',auth[_0xeb53('0xb')](),controller[_0xeb53('0xc')]);router[_0xeb53('0xd')](_0xeb53('0xe'),auth[_0xeb53('0xb')](),controller[_0xeb53('0xf')]);router[_0xeb53('0xd')](_0xeb53('0x10'),auth[_0xeb53('0xb')](),controller[_0xeb53('0x11')]);router[_0xeb53('0x12')]('/',auth['isAuthenticated'](),controller[_0xeb53('0x13')]);router[_0xeb53('0x14')](_0xeb53('0x10'),auth[_0xeb53('0xb')](),controller[_0xeb53('0x15')]);router[_0xeb53('0x16')](_0xeb53('0x10'),auth[_0xeb53('0xb')](),controller[_0xeb53('0x17')]);module[_0xeb53('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index d3d83a1..54b7b8e 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 _0xeae8=['sequelize','exports','STRING'];(function(_0x27d402,_0x26a705){var _0x383012=function(_0x3b406f){while(--_0x3b406f){_0x27d402['push'](_0x27d402['shift']());}};_0x383012(++_0x26a705);}(_0xeae8,0x66));var _0x8eae=function(_0x22e162,_0x44ab53){_0x22e162=_0x22e162-0x0;var _0x1db28e=_0xeae8[_0x22e162];return _0x1db28e;};'use strict';var Sequelize=require(_0x8eae('0x0'));module[_0x8eae('0x1')]={'name':{'type':Sequelize[_0x8eae('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8eae('0x2')]}}; \ No newline at end of file +var _0x126e=['exports','STRING','name'];(function(_0x127f81,_0x236bf1){var _0x371284=function(_0x6c4799){while(--_0x6c4799){_0x127f81['push'](_0x127f81['shift']());}};_0x371284(++_0x236bf1);}(_0x126e,0x108));var _0xe126=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x126e[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require('sequelize');module[_0xe126('0x0')]={'name':{'type':Sequelize[_0xe126('0x1')],'unique':_0xe126('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe126('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index ff52d35..e96f3aa 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 _0x9a14=['limit','count','offset','status','set','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','index','map','MailSubstatus','rawAttributes','type','key','model','query','keys','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','includeAll','include','findAll','show','params','intersection','options','find','create','body','update','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','undefined'];(function(_0x3686f4,_0xd4a373){var _0x168f2b=function(_0x352038){while(--_0x352038){_0x3686f4['push'](_0x3686f4['shift']());}};_0x168f2b(++_0xd4a373);}(_0x9a14,0xc8));var _0x49a1=function(_0xb250b2,_0x38bb44){_0xb250b2=_0xb250b2-0x0;var _0x37c987=_0x9a14[_0xb250b2];return _0x37c987;};'use strict';var emlformat=require(_0x49a1('0x0'));var rimraf=require(_0x49a1('0x1'));var zipdir=require(_0x49a1('0x2'));var jsonpatch=require(_0x49a1('0x3'));var rp=require('request-promise');var moment=require(_0x49a1('0x4'));var BPromise=require(_0x49a1('0x5'));var Mustache=require(_0x49a1('0x6'));var util=require('util');var path=require(_0x49a1('0x7'));var sox=require(_0x49a1('0x8'));var csv=require(_0x49a1('0x9'));var ejs=require(_0x49a1('0xa'));var fs=require('fs');var fs_extra=require(_0x49a1('0xb'));var _=require('lodash');var squel=require(_0x49a1('0xc'));var crypto=require(_0x49a1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x49a1('0xe'));var toCsv=require(_0x49a1('0x9'));var querystring=require(_0x49a1('0xf'));var Papa=require(_0x49a1('0x10'));var Redis=require(_0x49a1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x49a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49a1('0x13'));var logger=require(_0x49a1('0x14'))(_0x49a1('0x15'));var utils=require(_0x49a1('0x16'));var config=require(_0x49a1('0x17'));var licenseUtil=require(_0x49a1('0x18'));var db=require(_0x49a1('0x19'))['db'];function respondWithStatusCode(_0x4cf2e7,_0x4647c6){_0x4647c6=_0x4647c6||0xcc;return function(_0x45d187){if(_0x45d187){return _0x4cf2e7[_0x49a1('0x1a')](_0x4647c6);}return _0x4cf2e7['status'](_0x4647c6)['end']();};}function respondWithResult(_0x54ac34,_0x122f5f){_0x122f5f=_0x122f5f||0xc8;return function(_0x497dac){if(_0x497dac){return _0x54ac34['status'](_0x122f5f)['json'](_0x497dac);}};}function respondWithFilteredResult(_0x194ae4,_0x21fbac){return function(_0x2f3c9f){if(_0x2f3c9f){var _0x25a660=typeof _0x21fbac['offset']===_0x49a1('0x1b')&&typeof _0x21fbac[_0x49a1('0x1c')]===_0x49a1('0x1b');var _0x3169bb=_0x2f3c9f['count'];var _0x518572=_0x25a660?0x0:_0x21fbac['offset'];var _0x576236=_0x25a660?_0x2f3c9f[_0x49a1('0x1d')]:_0x21fbac[_0x49a1('0x1e')]+_0x21fbac['limit'];var _0x24827f;if(_0x576236>=_0x3169bb){_0x576236=_0x3169bb;_0x24827f=0xc8;}else{_0x24827f=0xce;}_0x194ae4[_0x49a1('0x1f')](_0x24827f);return _0x194ae4[_0x49a1('0x20')](_0x49a1('0x21'),_0x518572+'-'+_0x576236+'/'+_0x3169bb)[_0x49a1('0x22')](_0x2f3c9f);}return null;};}function patchUpdates(_0x52d955){return function(_0x45a9ca){try{jsonpatch[_0x49a1('0x23')](_0x45a9ca,_0x52d955,!![]);}catch(_0x5ec965){return BPromise[_0x49a1('0x24')](_0x5ec965);}return _0x45a9ca[_0x49a1('0x25')]();};}function saveUpdates(_0x521e52,_0x1ab82d){return function(_0xc6cec6){if(_0xc6cec6){return _0xc6cec6['update'](_0x521e52)[_0x49a1('0x26')](function(_0x1871f9){return _0x1871f9;});}return null;};}function removeEntity(_0xce293b,_0x3a4e41){return function(_0x42c8ff){if(_0x42c8ff){return _0x42c8ff[_0x49a1('0x27')]()[_0x49a1('0x26')](function(){_0xce293b[_0x49a1('0x1f')](0xcc)[_0x49a1('0x28')]();});}};}function handleEntityNotFound(_0x1399da,_0x24a28b){return function(_0x125fe7){if(!_0x125fe7){_0x1399da[_0x49a1('0x1a')](0x194);}return _0x125fe7;};}function handleError(_0x35f967,_0x4a17d9){_0x4a17d9=_0x4a17d9||0x1f4;return function(_0x527cd4){logger[_0x49a1('0x29')](_0x527cd4[_0x49a1('0x2a')]);if(_0x527cd4[_0x49a1('0x2b')]){delete _0x527cd4[_0x49a1('0x2b')];}_0x35f967['status'](_0x4a17d9)['send'](_0x527cd4);};}exports[_0x49a1('0x2c')]=function(_0x4d548f,_0x151c8c){var _0x20ea1d={},_0x544f55={},_0x446900={'count':0x0,'rows':[]};var _0x22e71b=_[_0x49a1('0x2d')](db[_0x49a1('0x2e')][_0x49a1('0x2f')],function(_0x7363a6){return{'name':_0x7363a6['fieldName'],'type':_0x7363a6[_0x49a1('0x30')][_0x49a1('0x31')]};});_0x544f55[_0x49a1('0x32')]=_[_0x49a1('0x2d')](_0x22e71b,_0x49a1('0x2b'));_0x544f55[_0x49a1('0x33')]=_[_0x49a1('0x34')](_0x4d548f[_0x49a1('0x33')]);_0x544f55['filters']=_['intersection'](_0x544f55['model'],_0x544f55[_0x49a1('0x33')]);_0x20ea1d['attributes']=_['intersection'](_0x544f55[_0x49a1('0x32')],qs[_0x49a1('0x35')](_0x4d548f[_0x49a1('0x33')][_0x49a1('0x35')]));_0x20ea1d['attributes']=_0x20ea1d[_0x49a1('0x36')][_0x49a1('0x37')]?_0x20ea1d['attributes']:_0x544f55[_0x49a1('0x32')];if(!_0x4d548f['query'][_0x49a1('0x38')]('nolimit')){_0x20ea1d[_0x49a1('0x1c')]=qs[_0x49a1('0x1c')](_0x4d548f[_0x49a1('0x33')][_0x49a1('0x1c')]);_0x20ea1d[_0x49a1('0x1e')]=qs[_0x49a1('0x1e')](_0x4d548f[_0x49a1('0x33')]['offset']);}_0x20ea1d[_0x49a1('0x39')]=qs[_0x49a1('0x3a')](_0x4d548f[_0x49a1('0x33')][_0x49a1('0x3a')]);_0x20ea1d[_0x49a1('0x3b')]=qs[_0x49a1('0x3c')](_['pick'](_0x4d548f[_0x49a1('0x33')],_0x544f55[_0x49a1('0x3c')]),_0x22e71b);if(_0x4d548f['query'][_0x49a1('0x3d')]){_0x20ea1d[_0x49a1('0x3b')]=_[_0x49a1('0x3e')](_0x20ea1d[_0x49a1('0x3b')],{'$or':_[_0x49a1('0x2d')](_0x22e71b,function(_0x4e0b7e){if(_0x4e0b7e['type']!=='VIRTUAL'){var _0x864031={};_0x864031[_0x4e0b7e['name']]={'$like':'%'+_0x4d548f[_0x49a1('0x33')][_0x49a1('0x3d')]+'%'};return _0x864031;}})});}_0x20ea1d=_[_0x49a1('0x3e')]({},_0x20ea1d,_0x4d548f['options']);var _0x295969={'where':_0x20ea1d[_0x49a1('0x3b')]};return db[_0x49a1('0x2e')][_0x49a1('0x1d')](_0x295969)[_0x49a1('0x26')](function(_0x40a49e){_0x446900[_0x49a1('0x1d')]=_0x40a49e;if(_0x4d548f[_0x49a1('0x33')][_0x49a1('0x3f')]){_0x20ea1d[_0x49a1('0x40')]=[{'all':!![]}];}return db['MailSubstatus'][_0x49a1('0x41')](_0x20ea1d);})[_0x49a1('0x26')](function(_0x52fcad){_0x446900['rows']=_0x52fcad;return _0x446900;})[_0x49a1('0x26')](respondWithFilteredResult(_0x151c8c,_0x20ea1d))['catch'](handleError(_0x151c8c,null));};exports[_0x49a1('0x42')]=function(_0x561f4d,_0x2da524){var _0x4a691c={'raw':!![],'where':{'id':_0x561f4d[_0x49a1('0x43')]['id']}},_0x37b56a={};_0x37b56a[_0x49a1('0x32')]=_['keys'](db[_0x49a1('0x2e')]['rawAttributes']);_0x37b56a[_0x49a1('0x33')]=_[_0x49a1('0x34')](_0x561f4d[_0x49a1('0x33')]);_0x37b56a[_0x49a1('0x3c')]=_['intersection'](_0x37b56a[_0x49a1('0x32')],_0x37b56a[_0x49a1('0x33')]);_0x4a691c['attributes']=_[_0x49a1('0x44')](_0x37b56a[_0x49a1('0x32')],qs[_0x49a1('0x35')](_0x561f4d[_0x49a1('0x33')][_0x49a1('0x35')]));_0x4a691c[_0x49a1('0x36')]=_0x4a691c[_0x49a1('0x36')][_0x49a1('0x37')]?_0x4a691c[_0x49a1('0x36')]:_0x37b56a[_0x49a1('0x32')];if(_0x561f4d['query'][_0x49a1('0x3f')]){_0x4a691c[_0x49a1('0x40')]=[{'all':!![]}];}_0x4a691c=_[_0x49a1('0x3e')]({},_0x4a691c,_0x561f4d[_0x49a1('0x45')]);return db[_0x49a1('0x2e')][_0x49a1('0x46')](_0x4a691c)[_0x49a1('0x26')](handleEntityNotFound(_0x2da524,null))[_0x49a1('0x26')](respondWithResult(_0x2da524,null))['catch'](handleError(_0x2da524,null));};exports[_0x49a1('0x47')]=function(_0xb4e486,_0x367176){return db[_0x49a1('0x2e')]['create'](_0xb4e486[_0x49a1('0x48')],{})[_0x49a1('0x26')](respondWithResult(_0x367176,0xc9))['catch'](handleError(_0x367176,null));};exports[_0x49a1('0x49')]=function(_0xc26981,_0x42298d){if(_0xc26981[_0x49a1('0x48')]['id']){delete _0xc26981[_0x49a1('0x48')]['id'];}return db[_0x49a1('0x2e')][_0x49a1('0x46')]({'where':{'id':_0xc26981[_0x49a1('0x43')]['id']}})['then'](handleEntityNotFound(_0x42298d,null))['then'](saveUpdates(_0xc26981[_0x49a1('0x48')],null))[_0x49a1('0x26')](respondWithResult(_0x42298d,null))[_0x49a1('0x4a')](handleError(_0x42298d,null));};exports[_0x49a1('0x27')]=function(_0x490e8a,_0x2ee999){return db[_0x49a1('0x2e')]['find']({'where':{'id':_0x490e8a['params']['id']}})['then'](handleEntityNotFound(_0x2ee999,null))[_0x49a1('0x26')](removeEntity(_0x2ee999,null))[_0x49a1('0x4a')](handleError(_0x2ee999,null));};exports[_0x49a1('0x4b')]=function(_0x1ed754,_0x2f571f){return db[_0x49a1('0x2e')][_0x49a1('0x4b')]()[_0x49a1('0x26')](respondWithResult(_0x2f571f,null))[_0x49a1('0x4a')](handleError(_0x2f571f,null));}; \ No newline at end of file +var _0xf70c=['where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x56d298,_0x11428a){var _0x10ab24=function(_0x29459b){while(--_0x29459b){_0x56d298['push'](_0x56d298['shift']());}};_0x10ab24(++_0x11428a);}(_0xf70c,0xef));var _0xcf70=function(_0x211451,_0x17db5e){_0x211451=_0x211451-0x0;var _0xd42813=_0xf70c[_0x211451];return _0xd42813;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf70('0x0'));var zipdir=require(_0xcf70('0x1'));var jsonpatch=require(_0xcf70('0x2'));var rp=require(_0xcf70('0x3'));var moment=require(_0xcf70('0x4'));var BPromise=require(_0xcf70('0x5'));var Mustache=require(_0xcf70('0x6'));var util=require('util');var path=require(_0xcf70('0x7'));var sox=require('sox');var csv=require(_0xcf70('0x8'));var ejs=require(_0xcf70('0x9'));var fs=require('fs');var fs_extra=require(_0xcf70('0xa'));var _=require(_0xcf70('0xb'));var squel=require(_0xcf70('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcf70('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcf70('0xe'));var Redis=require(_0xcf70('0xf'));var authService=require(_0xcf70('0x10'));var qs=require(_0xcf70('0x11'));var as=require(_0xcf70('0x12'));var hardwareService=require(_0xcf70('0x13'));var logger=require(_0xcf70('0x14'))('api');var utils=require(_0xcf70('0x15'));var config=require(_0xcf70('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x279dc9,_0x29d15a){_0x29d15a=_0x29d15a||0xcc;return function(_0x5ad63f){if(_0x5ad63f){return _0x279dc9[_0xcf70('0x17')](_0x29d15a);}return _0x279dc9[_0xcf70('0x18')](_0x29d15a)[_0xcf70('0x19')]();};}function respondWithResult(_0x2c3501,_0x583680){_0x583680=_0x583680||0xc8;return function(_0x20f2e8){if(_0x20f2e8){return _0x2c3501[_0xcf70('0x18')](_0x583680)[_0xcf70('0x1a')](_0x20f2e8);}};}function respondWithFilteredResult(_0x267739,_0xeb89a9){return function(_0x2b41a4){if(_0x2b41a4){var _0x17aaae=typeof _0xeb89a9[_0xcf70('0x1b')]==='undefined'&&typeof _0xeb89a9[_0xcf70('0x1c')]===_0xcf70('0x1d');var _0x3a6aea=_0x2b41a4[_0xcf70('0x1e')];var _0x2c89af=_0x17aaae?0x0:_0xeb89a9[_0xcf70('0x1b')];var _0x44a1c0=_0x17aaae?_0x2b41a4[_0xcf70('0x1e')]:_0xeb89a9[_0xcf70('0x1b')]+_0xeb89a9['limit'];var _0x41b088;if(_0x44a1c0>=_0x3a6aea){_0x44a1c0=_0x3a6aea;_0x41b088=0xc8;}else{_0x41b088=0xce;}_0x267739[_0xcf70('0x18')](_0x41b088);return _0x267739[_0xcf70('0x1f')]('Content-Range',_0x2c89af+'-'+_0x44a1c0+'/'+_0x3a6aea)['json'](_0x2b41a4);}return null;};}function patchUpdates(_0x1573e2){return function(_0x43eeff){try{jsonpatch['apply'](_0x43eeff,_0x1573e2,!![]);}catch(_0xdd354a){return BPromise[_0xcf70('0x20')](_0xdd354a);}return _0x43eeff['save']();};}function saveUpdates(_0x42d830,_0x66b467){return function(_0x21059f){if(_0x21059f){return _0x21059f[_0xcf70('0x21')](_0x42d830)[_0xcf70('0x22')](function(_0x42857c){return _0x42857c;});}return null;};}function removeEntity(_0x5adcc3,_0x230ec2){return function(_0x301d02){if(_0x301d02){return _0x301d02[_0xcf70('0x23')]()['then'](function(){_0x5adcc3[_0xcf70('0x18')](0xcc)[_0xcf70('0x19')]();});}};}function handleEntityNotFound(_0x6eda8c,_0x336750){return function(_0x4a6035){if(!_0x4a6035){_0x6eda8c[_0xcf70('0x17')](0x194);}return _0x4a6035;};}function handleError(_0x4a89f8,_0x186198){_0x186198=_0x186198||0x1f4;return function(_0x3dae78){logger[_0xcf70('0x24')](_0x3dae78[_0xcf70('0x25')]);if(_0x3dae78[_0xcf70('0x26')]){delete _0x3dae78[_0xcf70('0x26')];}_0x4a89f8[_0xcf70('0x18')](_0x186198)[_0xcf70('0x27')](_0x3dae78);};}exports[_0xcf70('0x28')]=function(_0x32e82c,_0x3dfc38){var _0x1f2247={},_0x5be35b={},_0xeb96eb={'count':0x0,'rows':[]};var _0x3016ea=_[_0xcf70('0x29')](db[_0xcf70('0x2a')][_0xcf70('0x2b')],function(_0x576504){return{'name':_0x576504[_0xcf70('0x2c')],'type':_0x576504['type'][_0xcf70('0x2d')]};});_0x5be35b['model']=_['map'](_0x3016ea,_0xcf70('0x26'));_0x5be35b['query']=_[_0xcf70('0x2e')](_0x32e82c[_0xcf70('0x2f')]);_0x5be35b['filters']=_[_0xcf70('0x30')](_0x5be35b[_0xcf70('0x31')],_0x5be35b[_0xcf70('0x2f')]);_0x1f2247[_0xcf70('0x32')]=_[_0xcf70('0x30')](_0x5be35b['model'],qs[_0xcf70('0x33')](_0x32e82c['query']['fields']));_0x1f2247[_0xcf70('0x32')]=_0x1f2247[_0xcf70('0x32')]['length']?_0x1f2247['attributes']:_0x5be35b['model'];if(!_0x32e82c[_0xcf70('0x2f')][_0xcf70('0x34')]('nolimit')){_0x1f2247[_0xcf70('0x1c')]=qs['limit'](_0x32e82c['query'][_0xcf70('0x1c')]);_0x1f2247[_0xcf70('0x1b')]=qs[_0xcf70('0x1b')](_0x32e82c[_0xcf70('0x2f')][_0xcf70('0x1b')]);}_0x1f2247['order']=qs['sort'](_0x32e82c[_0xcf70('0x2f')]['sort']);_0x1f2247[_0xcf70('0x35')]=qs[_0xcf70('0x36')](_[_0xcf70('0x37')](_0x32e82c[_0xcf70('0x2f')],_0x5be35b[_0xcf70('0x36')]),_0x3016ea);if(_0x32e82c[_0xcf70('0x2f')]['filter']){_0x1f2247['where']=_[_0xcf70('0x38')](_0x1f2247[_0xcf70('0x35')],{'$or':_[_0xcf70('0x29')](_0x3016ea,function(_0x396d65){if(_0x396d65[_0xcf70('0x39')]!==_0xcf70('0x3a')){var _0x4c2bfa={};_0x4c2bfa[_0x396d65[_0xcf70('0x26')]]={'$like':'%'+_0x32e82c[_0xcf70('0x2f')][_0xcf70('0x3b')]+'%'};return _0x4c2bfa;}})});}_0x1f2247=_[_0xcf70('0x38')]({},_0x1f2247,_0x32e82c[_0xcf70('0x3c')]);var _0x4a416f={'where':_0x1f2247[_0xcf70('0x35')]};return db[_0xcf70('0x2a')]['count'](_0x4a416f)[_0xcf70('0x22')](function(_0x4d2c45){_0xeb96eb[_0xcf70('0x1e')]=_0x4d2c45;if(_0x32e82c[_0xcf70('0x2f')][_0xcf70('0x3d')]){_0x1f2247[_0xcf70('0x3e')]=[{'all':!![]}];}return db[_0xcf70('0x2a')][_0xcf70('0x3f')](_0x1f2247);})[_0xcf70('0x22')](function(_0x33dfa7){_0xeb96eb[_0xcf70('0x40')]=_0x33dfa7;return _0xeb96eb;})['then'](respondWithFilteredResult(_0x3dfc38,_0x1f2247))['catch'](handleError(_0x3dfc38,null));};exports[_0xcf70('0x41')]=function(_0x430cfa,_0x415acf){var _0x265f17={'raw':!![],'where':{'id':_0x430cfa[_0xcf70('0x42')]['id']}},_0x2bc7c3={};_0x2bc7c3[_0xcf70('0x31')]=_[_0xcf70('0x2e')](db['MailSubstatus'][_0xcf70('0x2b')]);_0x2bc7c3[_0xcf70('0x2f')]=_['keys'](_0x430cfa[_0xcf70('0x2f')]);_0x2bc7c3['filters']=_[_0xcf70('0x30')](_0x2bc7c3[_0xcf70('0x31')],_0x2bc7c3[_0xcf70('0x2f')]);_0x265f17['attributes']=_[_0xcf70('0x30')](_0x2bc7c3[_0xcf70('0x31')],qs['fields'](_0x430cfa[_0xcf70('0x2f')]['fields']));_0x265f17[_0xcf70('0x32')]=_0x265f17[_0xcf70('0x32')][_0xcf70('0x43')]?_0x265f17[_0xcf70('0x32')]:_0x2bc7c3[_0xcf70('0x31')];if(_0x430cfa[_0xcf70('0x2f')][_0xcf70('0x3d')]){_0x265f17['include']=[{'all':!![]}];}_0x265f17=_['merge']({},_0x265f17,_0x430cfa[_0xcf70('0x3c')]);return db[_0xcf70('0x2a')]['find'](_0x265f17)['then'](handleEntityNotFound(_0x415acf,null))[_0xcf70('0x22')](respondWithResult(_0x415acf,null))[_0xcf70('0x44')](handleError(_0x415acf,null));};exports[_0xcf70('0x45')]=function(_0x290de8,_0x4b270d){return db[_0xcf70('0x2a')][_0xcf70('0x45')](_0x290de8[_0xcf70('0x46')],{})[_0xcf70('0x22')](respondWithResult(_0x4b270d,0xc9))[_0xcf70('0x44')](handleError(_0x4b270d,null));};exports['update']=function(_0x39441f,_0x49ab8b){if(_0x39441f['body']['id']){delete _0x39441f['body']['id'];}return db['MailSubstatus'][_0xcf70('0x47')]({'where':{'id':_0x39441f[_0xcf70('0x42')]['id']}})[_0xcf70('0x22')](handleEntityNotFound(_0x49ab8b,null))[_0xcf70('0x22')](saveUpdates(_0x39441f[_0xcf70('0x46')],null))['then'](respondWithResult(_0x49ab8b,null))[_0xcf70('0x44')](handleError(_0x49ab8b,null));};exports['destroy']=function(_0x42d6e2,_0x3a6e79){return db[_0xcf70('0x2a')]['find']({'where':{'id':_0x42d6e2['params']['id']}})[_0xcf70('0x22')](handleEntityNotFound(_0x3a6e79,null))[_0xcf70('0x22')](removeEntity(_0x3a6e79,null))['catch'](handleError(_0x3a6e79,null));};exports[_0xcf70('0x48')]=function(_0x45a0e5,_0x4f3269){return db['MailSubstatus'][_0xcf70('0x48')]()[_0xcf70('0x22')](respondWithResult(_0x4f3269,null))['catch'](handleError(_0x4f3269,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index b4462ca..ee2e7b6 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 _0x6831=['hasOwnProperty','hook','events','MailSubstatus','setMaxListeners','update','emit'];(function(_0x40063e,_0x542fae){var _0x2b6c67=function(_0x47d559){while(--_0x47d559){_0x40063e['push'](_0x40063e['shift']());}};_0x2b6c67(++_0x542fae);}(_0x6831,0x87));var _0x1683=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6831[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x1683('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x1683('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x1683('0x2')](0x0);var events={'afterUpdate':_0x1683('0x3')};function emitEvent(_0xe23752){return function(_0x13f44a,_0xaf0d5c,_0x476638){MailSubstatusEvents[_0x1683('0x4')](_0xe23752+':'+_0x13f44a['id'],_0x13f44a);MailSubstatusEvents[_0x1683('0x4')](_0xe23752,_0x13f44a);_0x476638(null);};}for(var e in events){if(events[_0x1683('0x5')](e)){var event=events[e];MailSubstatus[_0x1683('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x089b=['emit','hasOwnProperty','events','../../mysqldb','update'];(function(_0x55c193,_0x3dc41a){var _0x56f621=function(_0xb184fb){while(--_0xb184fb){_0x55c193['push'](_0x55c193['shift']());}};_0x56f621(++_0x3dc41a);}(_0x089b,0x188));var _0xb089=function(_0x136fc6,_0x2fe735){_0x136fc6=_0x136fc6-0x0;var _0x35147a=_0x089b[_0x136fc6];return _0x35147a;};'use strict';var EventEmitter=require(_0xb089('0x0'));var MailSubstatus=require(_0xb089('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xb089('0x2')};function emitEvent(_0x559989){return function(_0x1ad25e,_0x42da76,_0x5c7533){MailSubstatusEvents[_0xb089('0x3')](_0x559989+':'+_0x1ad25e['id'],_0x1ad25e);MailSubstatusEvents[_0xb089('0x3')](_0x559989,_0x1ad25e);_0x5c7533(null);};}for(var e in events){if(events[_0xb089('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 301fdaa..c5cb593 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 _0xa3e5=['name','_previousDataValues','catch','./mailSubstatus.attributes','models','define','MailSubstatus','Condition','update'];(function(_0x328305,_0x19098d){var _0xf0347=function(_0xa391c1){while(--_0xa391c1){_0x328305['push'](_0x328305['shift']());}};_0xf0347(++_0x19098d);}(_0xa3e5,0x198));var _0x5a3e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa3e5[_0xa1e3e3];return _0xc980e9;};'use strict';var attributes=require(_0x5a3e('0x0'));module['exports']=function(_0xc0d69){var _0x51d643=_0xc0d69[_0x5a3e('0x1')];return _0xc0d69[_0x5a3e('0x2')](_0x5a3e('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4d65bb,_0x1e3d56,_0x5ba185){return _0x51d643[_0x5a3e('0x4')][_0x5a3e('0x5')]({'value':_0x4d65bb[_0x5a3e('0x6')]},{'where':{'field':'mailSubstatus','value':_0x4d65bb[_0x5a3e('0x7')]['name']}})['then'](function(){_0x5ba185();})[_0x5a3e('0x8')](function(_0x2d3c39){_0x5ba185(_0x2d3c39);});}}});}; \ No newline at end of file +var _0x51b4=['define','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models'];(function(_0x1ecce9,_0x3d1db0){var _0x1a871f=function(_0x53f809){while(--_0x53f809){_0x1ecce9['push'](_0x1ecce9['shift']());}};_0x1a871f(++_0x3d1db0);}(_0x51b4,0x1a1));var _0x451b=function(_0x227180,_0xe5b77a){_0x227180=_0x227180-0x0;var _0x63c295=_0x51b4[_0x227180];return _0x63c295;};'use strict';var attributes=require(_0x451b('0x0'));module[_0x451b('0x1')]=function(_0x13901a){var _0x1fb30c=_0x13901a[_0x451b('0x2')];return _0x13901a[_0x451b('0x3')]('MailSubstatus',attributes,{'tableName':_0x451b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4d29f0,_0x156b94,_0x39123b){return _0x1fb30c[_0x451b('0x5')][_0x451b('0x6')]({'value':_0x4d29f0[_0x451b('0x7')]},{'where':{'field':_0x451b('0x8'),'value':_0x4d29f0[_0x451b('0x9')][_0x451b('0x7')]}})[_0x451b('0xa')](function(){_0x39123b();})[_0x451b('0xb')](function(_0x4d0358){_0x39123b(_0x4d0358);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 8a077b5..ca21c1a 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 _0x5c48=['../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3a7306,_0x5b0a08){var _0x15736a=function(_0x5245b4){while(--_0x5245b4){_0x3a7306['push'](_0x3a7306['shift']());}};_0x15736a(++_0x5b0a08);}(_0x5c48,0x172));var _0x85c4=function(_0x3b7d07,_0x593043){_0x3b7d07=_0x3b7d07-0x0;var _0x1a3e2c=_0x5c48[_0x3b7d07];return _0x1a3e2c;};'use strict';var _=require(_0x85c4('0x0'));var util=require(_0x85c4('0x1'));var moment=require(_0x85c4('0x2'));var BPromise=require(_0x85c4('0x3'));var rs=require(_0x85c4('0x4'));var fs=require('fs');var Redis=require(_0x85c4('0x5'));var db=require(_0x85c4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x85c4('0x7'))('rpc');var config=require(_0x85c4('0x8'));var jayson=require(_0x85c4('0x9'));var client=jayson['client'][_0x85c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4666cf,_0x193dc9,_0x1eff96){return new BPromise(function(_0x41a648,_0x2ee4e1){return client[_0x85c4('0xb')](_0x4666cf,_0x1eff96)['then'](function(_0x4d4d64){logger[_0x85c4('0xc')](_0x85c4('0xd'),_0x193dc9,_0x85c4('0xe'));logger['debug'](_0x85c4('0xf'),_0x193dc9,'request\x20sent',JSON[_0x85c4('0x10')](_0x4d4d64));if(_0x4d4d64[_0x85c4('0x11')]){if(_0x4d4d64['error']['code']===0x1f4){logger[_0x85c4('0x11')](_0x85c4('0xd'),_0x193dc9,_0x4d4d64[_0x85c4('0x11')][_0x85c4('0x12')]);return _0x2ee4e1(_0x4d4d64[_0x85c4('0x11')][_0x85c4('0x12')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x193dc9,_0x4d4d64['error']['message']);return _0x41a648(_0x4d4d64['error'][_0x85c4('0x12')]);}else{logger[_0x85c4('0xc')](_0x85c4('0xd'),_0x193dc9,_0x85c4('0xe'));_0x41a648(_0x4d4d64[_0x85c4('0x13')][_0x85c4('0x12')]);}})[_0x85c4('0x14')](function(_0x76e9ce){logger[_0x85c4('0x11')](_0x85c4('0xd'),_0x193dc9,_0x76e9ce);_0x2ee4e1(_0x76e9ce);});});} \ No newline at end of file +var _0x4e87=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','catch','lodash','moment'];(function(_0x5858f0,_0x3de41c){var _0x7c390a=function(_0x2e0535){while(--_0x2e0535){_0x5858f0['push'](_0x5858f0['shift']());}};_0x7c390a(++_0x3de41c);}(_0x4e87,0x19c));var _0x74e8=function(_0x3207d2,_0x41d478){_0x3207d2=_0x3207d2-0x0;var _0x102231=_0x4e87[_0x3207d2];return _0x102231;};'use strict';var _=require(_0x74e8('0x0'));var util=require('util');var moment=require(_0x74e8('0x1'));var BPromise=require(_0x74e8('0x2'));var rs=require(_0x74e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74e8('0x4'))['db'];var utils=require(_0x74e8('0x5'));var logger=require(_0x74e8('0x6'))(_0x74e8('0x7'));var config=require(_0x74e8('0x8'));var jayson=require(_0x74e8('0x9'));var client=jayson[_0x74e8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c4966,_0x10e375,_0x490b07){return new BPromise(function(_0x3748d7,_0xadb4fc){return client[_0x74e8('0xb')](_0x2c4966,_0x490b07)[_0x74e8('0xc')](function(_0x3d49be){logger[_0x74e8('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x10e375,'request\x20sent');logger[_0x74e8('0xe')](_0x74e8('0xf'),_0x10e375,_0x74e8('0x10'),JSON[_0x74e8('0x11')](_0x3d49be));if(_0x3d49be[_0x74e8('0x12')]){if(_0x3d49be[_0x74e8('0x12')][_0x74e8('0x13')]===0x1f4){logger['error'](_0x74e8('0x14'),_0x10e375,_0x3d49be['error'][_0x74e8('0x15')]);return _0xadb4fc(_0x3d49be[_0x74e8('0x12')]['message']);}logger[_0x74e8('0x12')](_0x74e8('0x14'),_0x10e375,_0x3d49be['error'][_0x74e8('0x15')]);return _0x3748d7(_0x3d49be['error'][_0x74e8('0x15')]);}else{logger['info'](_0x74e8('0x14'),_0x10e375,'request\x20sent');_0x3748d7(_0x3d49be['result'][_0x74e8('0x15')]);}})[_0x74e8('0x16')](function(_0x2e455f){logger[_0x74e8('0x12')](_0x74e8('0x14'),_0x10e375,_0x2e455f);_0xadb4fc(_0x2e455f);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index c78622b..d64521d 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 _0xe475=['/:id','post','create','put','update','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x3f3743,_0x8f8644){var _0x305f8a=function(_0xa4507f){while(--_0xa4507f){_0x3f3743['push'](_0x3f3743['shift']());}};_0x305f8a(++_0x8f8644);}(_0xe475,0x19f));var _0x5e47=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe475[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x5e47('0x0'));var path=require(_0x5e47('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e47('0x2')]();var fs_extra=require(_0x5e47('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5e47('0x4'));var config=require(_0x5e47('0x5'));var controller=require(_0x5e47('0x6'));router[_0x5e47('0x7')]('/',auth[_0x5e47('0x8')](),controller['index']);router[_0x5e47('0x7')](_0x5e47('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x5e47('0x7')](_0x5e47('0xa'),auth[_0x5e47('0x8')](),controller['show']);router[_0x5e47('0xb')]('/',auth[_0x5e47('0x8')](),controller[_0x5e47('0xc')]);router[_0x5e47('0xd')](_0x5e47('0xa'),auth[_0x5e47('0x8')](),controller[_0x5e47('0xe')]);router['delete'](_0x5e47('0xa'),auth[_0x5e47('0x8')](),controller[_0x5e47('0xf')]);module[_0x5e47('0x10')]=router; \ No newline at end of file +var _0x6165=['/describe','show','create','put','/:id','delete','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x10ee65,_0x3a0b05){var _0x2cc7d6=function(_0x57f173){while(--_0x57f173){_0x10ee65['push'](_0x10ee65['shift']());}};_0x2cc7d6(++_0x3a0b05);}(_0x6165,0x115));var _0x5616=function(_0x45ab42,_0x5545f9){_0x45ab42=_0x45ab42-0x0;var _0x291531=_0x6165[_0x45ab42];return _0x291531;};'use strict';var multer=require(_0x5616('0x0'));var util=require(_0x5616('0x1'));var path=require(_0x5616('0x2'));var timeout=require('connect-timeout');var express=require(_0x5616('0x3'));var router=express['Router']();var fs_extra=require(_0x5616('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5616('0x5'));var config=require(_0x5616('0x6'));var controller=require(_0x5616('0x7'));router[_0x5616('0x8')]('/',auth[_0x5616('0x9')](),controller[_0x5616('0xa')]);router[_0x5616('0x8')](_0x5616('0xb'),auth[_0x5616('0x9')](),controller['describe']);router[_0x5616('0x8')]('/:id',auth[_0x5616('0x9')](),controller[_0x5616('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5616('0xd')]);router[_0x5616('0xe')](_0x5616('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x5616('0x10')]('/:id',auth[_0x5616('0x9')](),controller[_0x5616('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 7ec721d..26437ef 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x4fd43b,_0x55e475){var _0xf556f0=function(_0x5c39ba){while(--_0x5c39ba){_0x4fd43b['push'](_0x4fd43b['shift']());}};_0xf556f0(++_0x55e475);}(_0x70e0,0x17b));var _0x070e=function(_0x11231b,_0x4ab493){_0x11231b=_0x11231b-0x0;var _0x569eda=_0x70e0[_0x11231b];return _0x569eda;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2b51a9,_0x5b9092){var _0x2de139=function(_0x5076b3){while(--_0x5076b3){_0x2b51a9['push'](_0x2b51a9['shift']());}};_0x2de139(++_0x5b9092);}(_0x54ef,0x112));var _0xf54e=function(_0x14ccfc,_0xeb46f5){_0x14ccfc=_0x14ccfc-0x0;var _0x1d564f=_0x54ef[_0x14ccfc];return _0x1d564f;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 539195b..b53ca0b 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 _0xf6a3=['send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','where','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name'];(function(_0x5874d1,_0x40c2e2){var _0x44cda3=function(_0x13ec25){while(--_0x13ec25){_0x5874d1['push'](_0x5874d1['shift']());}};_0x44cda3(++_0x40c2e2);}(_0xf6a3,0xf2));var _0x3f6a=function(_0x1ff391,_0x5bca49){_0x1ff391=_0x1ff391-0x0;var _0x4bcad8=_0xf6a3[_0x1ff391];return _0x4bcad8;};'use strict';var emlformat=require(_0x3f6a('0x0'));var rimraf=require(_0x3f6a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f6a('0x2'));var rp=require(_0x3f6a('0x3'));var moment=require(_0x3f6a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3f6a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3f6a('0x6'));var csv=require(_0x3f6a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f6a('0x8'));var _=require(_0x3f6a('0x9'));var squel=require(_0x3f6a('0xa'));var crypto=require(_0x3f6a('0xb'));var jsforce=require(_0x3f6a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3f6a('0x7'));var querystring=require('querystring');var Papa=require(_0x3f6a('0xd'));var Redis=require(_0x3f6a('0xe'));var authService=require(_0x3f6a('0xf'));var qs=require(_0x3f6a('0x10'));var as=require(_0x3f6a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f6a('0x12'))(_0x3f6a('0x13'));var utils=require(_0x3f6a('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c468d,_0x36b14e){_0x36b14e=_0x36b14e||0xcc;return function(_0x3f04e5){if(_0x3f04e5){return _0x3c468d[_0x3f6a('0x15')](_0x36b14e);}return _0x3c468d['status'](_0x36b14e)[_0x3f6a('0x16')]();};}function respondWithResult(_0x1aef96,_0x193ad6){_0x193ad6=_0x193ad6||0xc8;return function(_0x2f8812){if(_0x2f8812){return _0x1aef96[_0x3f6a('0x17')](_0x193ad6)[_0x3f6a('0x18')](_0x2f8812);}};}function respondWithFilteredResult(_0x8f4c67,_0x1a1b58){return function(_0x263770){if(_0x263770){var _0x1607a0=typeof _0x1a1b58[_0x3f6a('0x19')]===_0x3f6a('0x1a')&&typeof _0x1a1b58[_0x3f6a('0x1b')]===_0x3f6a('0x1a');var _0x4c2d0=_0x263770[_0x3f6a('0x1c')];var _0x1ab851=_0x1607a0?0x0:_0x1a1b58[_0x3f6a('0x19')];var _0x233e31=_0x1607a0?_0x263770[_0x3f6a('0x1c')]:_0x1a1b58[_0x3f6a('0x19')]+_0x1a1b58[_0x3f6a('0x1b')];var _0x2f0e46;if(_0x233e31>=_0x4c2d0){_0x233e31=_0x4c2d0;_0x2f0e46=0xc8;}else{_0x2f0e46=0xce;}_0x8f4c67['status'](_0x2f0e46);return _0x8f4c67[_0x3f6a('0x1d')](_0x3f6a('0x1e'),_0x1ab851+'-'+_0x233e31+'/'+_0x4c2d0)['json'](_0x263770);}return null;};}function patchUpdates(_0x2b53ed){return function(_0x54e9a2){try{jsonpatch[_0x3f6a('0x1f')](_0x54e9a2,_0x2b53ed,!![]);}catch(_0xeb180d){return BPromise[_0x3f6a('0x20')](_0xeb180d);}return _0x54e9a2[_0x3f6a('0x21')]();};}function saveUpdates(_0x1ee474,_0xb9fbc2){return function(_0x540e5e){if(_0x540e5e){return _0x540e5e[_0x3f6a('0x22')](_0x1ee474)['then'](function(_0x1a7ac3){return _0x1a7ac3;});}return null;};}function removeEntity(_0x58dc8c,_0xf3ddea){return function(_0x11f341){if(_0x11f341){return _0x11f341['destroy']()[_0x3f6a('0x23')](function(){_0x58dc8c['status'](0xcc)[_0x3f6a('0x16')]();});}};}function handleEntityNotFound(_0x13476e,_0x3694de){return function(_0x506421){if(!_0x506421){_0x13476e[_0x3f6a('0x15')](0x194);}return _0x506421;};}function handleError(_0x33cbb2,_0x1779b3){_0x1779b3=_0x1779b3||0x1f4;return function(_0x22d874){logger[_0x3f6a('0x24')](_0x22d874['stack']);if(_0x22d874[_0x3f6a('0x25')]){delete _0x22d874[_0x3f6a('0x25')];}_0x33cbb2[_0x3f6a('0x17')](_0x1779b3)[_0x3f6a('0x26')](_0x22d874);};}exports[_0x3f6a('0x27')]=function(_0x76e6c1,_0x37c510){var _0x1ccd29={},_0x187b5a={},_0x28102f={'count':0x0,'rows':[]};var _0x18a48b=_[_0x3f6a('0x28')](db[_0x3f6a('0x29')][_0x3f6a('0x2a')],function(_0x144b3f){return{'name':_0x144b3f[_0x3f6a('0x2b')],'type':_0x144b3f[_0x3f6a('0x2c')][_0x3f6a('0x2d')]};});_0x187b5a['model']=_[_0x3f6a('0x28')](_0x18a48b,'name');_0x187b5a[_0x3f6a('0x2e')]=_[_0x3f6a('0x2f')](_0x76e6c1[_0x3f6a('0x2e')]);_0x187b5a[_0x3f6a('0x30')]=_['intersection'](_0x187b5a[_0x3f6a('0x31')],_0x187b5a[_0x3f6a('0x2e')]);_0x1ccd29[_0x3f6a('0x32')]=_[_0x3f6a('0x33')](_0x187b5a['model'],qs[_0x3f6a('0x34')](_0x76e6c1[_0x3f6a('0x2e')][_0x3f6a('0x34')]));_0x1ccd29[_0x3f6a('0x32')]=_0x1ccd29[_0x3f6a('0x32')][_0x3f6a('0x35')]?_0x1ccd29[_0x3f6a('0x32')]:_0x187b5a[_0x3f6a('0x31')];if(!_0x76e6c1[_0x3f6a('0x2e')]['hasOwnProperty']('nolimit')){_0x1ccd29[_0x3f6a('0x1b')]=qs[_0x3f6a('0x1b')](_0x76e6c1[_0x3f6a('0x2e')][_0x3f6a('0x1b')]);_0x1ccd29[_0x3f6a('0x19')]=qs[_0x3f6a('0x19')](_0x76e6c1[_0x3f6a('0x2e')]['offset']);}_0x1ccd29['order']=qs['sort'](_0x76e6c1[_0x3f6a('0x2e')]['sort']);_0x1ccd29[_0x3f6a('0x36')]=qs[_0x3f6a('0x30')](_['pick'](_0x76e6c1[_0x3f6a('0x2e')],_0x187b5a['filters']),_0x18a48b);if(_0x76e6c1['query'][_0x3f6a('0x37')]){_0x1ccd29['where']=_[_0x3f6a('0x38')](_0x1ccd29[_0x3f6a('0x36')],{'$or':_['map'](_0x18a48b,function(_0x3e45c3){if(_0x3e45c3[_0x3f6a('0x2c')]!==_0x3f6a('0x39')){var _0x2dba43={};_0x2dba43[_0x3e45c3[_0x3f6a('0x25')]]={'$like':'%'+_0x76e6c1['query'][_0x3f6a('0x37')]+'%'};return _0x2dba43;}})});}_0x1ccd29=_[_0x3f6a('0x38')]({},_0x1ccd29,_0x76e6c1[_0x3f6a('0x3a')]);var _0x475771={'where':_0x1ccd29[_0x3f6a('0x36')]};return db[_0x3f6a('0x29')][_0x3f6a('0x1c')](_0x475771)[_0x3f6a('0x23')](function(_0xd9fa09){_0x28102f[_0x3f6a('0x1c')]=_0xd9fa09;if(_0x76e6c1[_0x3f6a('0x2e')]['includeAll']){_0x1ccd29[_0x3f6a('0x3b')]=[{'all':!![]}];}return db[_0x3f6a('0x29')]['findAll'](_0x1ccd29);})[_0x3f6a('0x23')](function(_0x114e8c){_0x28102f[_0x3f6a('0x3c')]=_0x114e8c;return _0x28102f;})[_0x3f6a('0x23')](respondWithFilteredResult(_0x37c510,_0x1ccd29))['catch'](handleError(_0x37c510,null));};exports[_0x3f6a('0x3d')]=function(_0x46efa4,_0x4b3fd7){var _0x74c5a9={'raw':!![],'where':{'id':_0x46efa4[_0x3f6a('0x3e')]['id']}},_0x52cf4e={};_0x52cf4e[_0x3f6a('0x31')]=_[_0x3f6a('0x2f')](db['MailTransferReport'][_0x3f6a('0x2a')]);_0x52cf4e[_0x3f6a('0x2e')]=_['keys'](_0x46efa4[_0x3f6a('0x2e')]);_0x52cf4e['filters']=_[_0x3f6a('0x33')](_0x52cf4e['model'],_0x52cf4e[_0x3f6a('0x2e')]);_0x74c5a9[_0x3f6a('0x32')]=_[_0x3f6a('0x33')](_0x52cf4e['model'],qs[_0x3f6a('0x34')](_0x46efa4[_0x3f6a('0x2e')][_0x3f6a('0x34')]));_0x74c5a9['attributes']=_0x74c5a9[_0x3f6a('0x32')][_0x3f6a('0x35')]?_0x74c5a9[_0x3f6a('0x32')]:_0x52cf4e[_0x3f6a('0x31')];if(_0x46efa4['query'][_0x3f6a('0x3f')]){_0x74c5a9['include']=[{'all':!![]}];}_0x74c5a9=_[_0x3f6a('0x38')]({},_0x74c5a9,_0x46efa4['options']);return db[_0x3f6a('0x29')][_0x3f6a('0x40')](_0x74c5a9)['then'](handleEntityNotFound(_0x4b3fd7,null))['then'](respondWithResult(_0x4b3fd7,null))[_0x3f6a('0x41')](handleError(_0x4b3fd7,null));};exports['create']=function(_0x25257e,_0x27d7aa){return db[_0x3f6a('0x29')][_0x3f6a('0x42')](_0x25257e[_0x3f6a('0x43')],{})[_0x3f6a('0x23')](respondWithResult(_0x27d7aa,0xc9))[_0x3f6a('0x41')](handleError(_0x27d7aa,null));};exports[_0x3f6a('0x22')]=function(_0x2ecfba,_0x4476ab){if(_0x2ecfba['body']['id']){delete _0x2ecfba[_0x3f6a('0x43')]['id'];}return db[_0x3f6a('0x29')][_0x3f6a('0x40')]({'where':{'id':_0x2ecfba[_0x3f6a('0x3e')]['id']}})[_0x3f6a('0x23')](handleEntityNotFound(_0x4476ab,null))[_0x3f6a('0x23')](saveUpdates(_0x2ecfba[_0x3f6a('0x43')],null))[_0x3f6a('0x23')](respondWithResult(_0x4476ab,null))[_0x3f6a('0x41')](handleError(_0x4476ab,null));};exports[_0x3f6a('0x44')]=function(_0x22a261,_0x2077f5){return db['MailTransferReport']['find']({'where':{'id':_0x22a261[_0x3f6a('0x3e')]['id']}})[_0x3f6a('0x23')](handleEntityNotFound(_0x2077f5,null))[_0x3f6a('0x23')](removeEntity(_0x2077f5,null))[_0x3f6a('0x41')](handleError(_0x2077f5,null));};exports[_0x3f6a('0x45')]=function(_0x2d6095,_0x281d91){return db[_0x3f6a('0x29')][_0x3f6a('0x45')]()[_0x3f6a('0x23')](respondWithResult(_0x281d91,null))['catch'](handleError(_0x281d91,null));}; \ No newline at end of file +var _0xc1f5=['offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','MailTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit'];(function(_0x5e7b15,_0x21c50c){var _0x499cdf=function(_0x134ea3){while(--_0x134ea3){_0x5e7b15['push'](_0x5e7b15['shift']());}};_0x499cdf(++_0x21c50c);}(_0xc1f5,0x159));var _0x5c1f=function(_0x7591a,_0x37d9cc){_0x7591a=_0x7591a-0x0;var _0x1c0512=_0xc1f5[_0x7591a];return _0x1c0512;};'use strict';var emlformat=require(_0x5c1f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c1f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c1f('0x2'));var moment=require(_0x5c1f('0x3'));var BPromise=require(_0x5c1f('0x4'));var Mustache=require(_0x5c1f('0x5'));var util=require(_0x5c1f('0x6'));var path=require(_0x5c1f('0x7'));var sox=require('sox');var csv=require(_0x5c1f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c1f('0x9'));var _=require(_0x5c1f('0xa'));var squel=require(_0x5c1f('0xb'));var crypto=require(_0x5c1f('0xc'));var jsforce=require(_0x5c1f('0xd'));var deskjs=require(_0x5c1f('0xe'));var toCsv=require(_0x5c1f('0x8'));var querystring=require(_0x5c1f('0xf'));var Papa=require('papaparse');var Redis=require(_0x5c1f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c1f('0x11'));var as=require(_0x5c1f('0x12'));var hardwareService=require(_0x5c1f('0x13'));var logger=require('../../config/logger')(_0x5c1f('0x14'));var utils=require(_0x5c1f('0x15'));var config=require(_0x5c1f('0x16'));var licenseUtil=require(_0x5c1f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56b700,_0x1bf563){_0x1bf563=_0x1bf563||0xcc;return function(_0x520829){if(_0x520829){return _0x56b700[_0x5c1f('0x18')](_0x1bf563);}return _0x56b700[_0x5c1f('0x19')](_0x1bf563)[_0x5c1f('0x1a')]();};}function respondWithResult(_0x462500,_0x21e42e){_0x21e42e=_0x21e42e||0xc8;return function(_0x5c12b3){if(_0x5c12b3){return _0x462500[_0x5c1f('0x19')](_0x21e42e)[_0x5c1f('0x1b')](_0x5c12b3);}};}function respondWithFilteredResult(_0x5b331b,_0x585448){return function(_0x3790c3){if(_0x3790c3){var _0x45f6c5=typeof _0x585448['offset']===_0x5c1f('0x1c')&&typeof _0x585448[_0x5c1f('0x1d')]==='undefined';var _0x1d4cd9=_0x3790c3['count'];var _0x2d1161=_0x45f6c5?0x0:_0x585448[_0x5c1f('0x1e')];var _0x59367e=_0x45f6c5?_0x3790c3['count']:_0x585448[_0x5c1f('0x1e')]+_0x585448[_0x5c1f('0x1d')];var _0x55d816;if(_0x59367e>=_0x1d4cd9){_0x59367e=_0x1d4cd9;_0x55d816=0xc8;}else{_0x55d816=0xce;}_0x5b331b['status'](_0x55d816);return _0x5b331b[_0x5c1f('0x1f')](_0x5c1f('0x20'),_0x2d1161+'-'+_0x59367e+'/'+_0x1d4cd9)[_0x5c1f('0x1b')](_0x3790c3);}return null;};}function patchUpdates(_0x252190){return function(_0x3730b3){try{jsonpatch[_0x5c1f('0x21')](_0x3730b3,_0x252190,!![]);}catch(_0x49aa81){return BPromise[_0x5c1f('0x22')](_0x49aa81);}return _0x3730b3['save']();};}function saveUpdates(_0x55c6c3,_0x20bfbd){return function(_0x264baa){if(_0x264baa){return _0x264baa[_0x5c1f('0x23')](_0x55c6c3)[_0x5c1f('0x24')](function(_0x13891f){return _0x13891f;});}return null;};}function removeEntity(_0x5a958d,_0x277654){return function(_0x1a1ead){if(_0x1a1ead){return _0x1a1ead[_0x5c1f('0x25')]()['then'](function(){_0x5a958d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e8d27,_0x4c06ea){return function(_0x11780f){if(!_0x11780f){_0x2e8d27['sendStatus'](0x194);}return _0x11780f;};}function handleError(_0x3c6cda,_0x54b685){_0x54b685=_0x54b685||0x1f4;return function(_0x2f7080){logger[_0x5c1f('0x26')](_0x2f7080[_0x5c1f('0x27')]);if(_0x2f7080[_0x5c1f('0x28')]){delete _0x2f7080[_0x5c1f('0x28')];}_0x3c6cda['status'](_0x54b685)[_0x5c1f('0x29')](_0x2f7080);};}exports['index']=function(_0x14888a,_0x261fc4){var _0x460cfc={},_0x2bf42b={},_0x413001={'count':0x0,'rows':[]};var _0x32d883=_['map'](db[_0x5c1f('0x2a')]['rawAttributes'],function(_0x49ced5){return{'name':_0x49ced5[_0x5c1f('0x2b')],'type':_0x49ced5[_0x5c1f('0x2c')][_0x5c1f('0x2d')]};});_0x2bf42b[_0x5c1f('0x2e')]=_['map'](_0x32d883,_0x5c1f('0x28'));_0x2bf42b[_0x5c1f('0x2f')]=_[_0x5c1f('0x30')](_0x14888a[_0x5c1f('0x2f')]);_0x2bf42b[_0x5c1f('0x31')]=_[_0x5c1f('0x32')](_0x2bf42b[_0x5c1f('0x2e')],_0x2bf42b['query']);_0x460cfc[_0x5c1f('0x33')]=_[_0x5c1f('0x32')](_0x2bf42b[_0x5c1f('0x2e')],qs[_0x5c1f('0x34')](_0x14888a[_0x5c1f('0x2f')][_0x5c1f('0x34')]));_0x460cfc[_0x5c1f('0x33')]=_0x460cfc[_0x5c1f('0x33')]['length']?_0x460cfc[_0x5c1f('0x33')]:_0x2bf42b[_0x5c1f('0x2e')];if(!_0x14888a[_0x5c1f('0x2f')][_0x5c1f('0x35')](_0x5c1f('0x36'))){_0x460cfc[_0x5c1f('0x1d')]=qs[_0x5c1f('0x1d')](_0x14888a[_0x5c1f('0x2f')][_0x5c1f('0x1d')]);_0x460cfc[_0x5c1f('0x1e')]=qs[_0x5c1f('0x1e')](_0x14888a[_0x5c1f('0x2f')][_0x5c1f('0x1e')]);}_0x460cfc['order']=qs['sort'](_0x14888a[_0x5c1f('0x2f')][_0x5c1f('0x37')]);_0x460cfc[_0x5c1f('0x38')]=qs[_0x5c1f('0x31')](_[_0x5c1f('0x39')](_0x14888a['query'],_0x2bf42b[_0x5c1f('0x31')]),_0x32d883);if(_0x14888a[_0x5c1f('0x2f')]['filter']){_0x460cfc[_0x5c1f('0x38')]=_[_0x5c1f('0x3a')](_0x460cfc['where'],{'$or':_['map'](_0x32d883,function(_0x3dac0e){if(_0x3dac0e[_0x5c1f('0x2c')]!==_0x5c1f('0x3b')){var _0x2b6a87={};_0x2b6a87[_0x3dac0e[_0x5c1f('0x28')]]={'$like':'%'+_0x14888a[_0x5c1f('0x2f')][_0x5c1f('0x3c')]+'%'};return _0x2b6a87;}})});}_0x460cfc=_[_0x5c1f('0x3a')]({},_0x460cfc,_0x14888a[_0x5c1f('0x3d')]);var _0x97d1ec={'where':_0x460cfc[_0x5c1f('0x38')]};return db['MailTransferReport'][_0x5c1f('0x3e')](_0x97d1ec)[_0x5c1f('0x24')](function(_0x4ec6f4){_0x413001[_0x5c1f('0x3e')]=_0x4ec6f4;if(_0x14888a['query'][_0x5c1f('0x3f')]){_0x460cfc[_0x5c1f('0x40')]=[{'all':!![]}];}return db[_0x5c1f('0x2a')][_0x5c1f('0x41')](_0x460cfc);})['then'](function(_0x5482b7){_0x413001[_0x5c1f('0x42')]=_0x5482b7;return _0x413001;})[_0x5c1f('0x24')](respondWithFilteredResult(_0x261fc4,_0x460cfc))['catch'](handleError(_0x261fc4,null));};exports[_0x5c1f('0x43')]=function(_0x161d3d,_0x345209){var _0x12130a={'raw':!![],'where':{'id':_0x161d3d[_0x5c1f('0x44')]['id']}},_0x21a2a1={};_0x21a2a1[_0x5c1f('0x2e')]=_['keys'](db[_0x5c1f('0x2a')]['rawAttributes']);_0x21a2a1[_0x5c1f('0x2f')]=_[_0x5c1f('0x30')](_0x161d3d['query']);_0x21a2a1[_0x5c1f('0x31')]=_[_0x5c1f('0x32')](_0x21a2a1[_0x5c1f('0x2e')],_0x21a2a1['query']);_0x12130a['attributes']=_[_0x5c1f('0x32')](_0x21a2a1[_0x5c1f('0x2e')],qs[_0x5c1f('0x34')](_0x161d3d[_0x5c1f('0x2f')]['fields']));_0x12130a['attributes']=_0x12130a['attributes'][_0x5c1f('0x45')]?_0x12130a[_0x5c1f('0x33')]:_0x21a2a1[_0x5c1f('0x2e')];if(_0x161d3d[_0x5c1f('0x2f')]['includeAll']){_0x12130a[_0x5c1f('0x40')]=[{'all':!![]}];}_0x12130a=_[_0x5c1f('0x3a')]({},_0x12130a,_0x161d3d[_0x5c1f('0x3d')]);return db[_0x5c1f('0x2a')]['find'](_0x12130a)['then'](handleEntityNotFound(_0x345209,null))['then'](respondWithResult(_0x345209,null))[_0x5c1f('0x46')](handleError(_0x345209,null));};exports['create']=function(_0x5ed052,_0x1cbdf4){return db[_0x5c1f('0x2a')][_0x5c1f('0x47')](_0x5ed052['body'],{})[_0x5c1f('0x24')](respondWithResult(_0x1cbdf4,0xc9))[_0x5c1f('0x46')](handleError(_0x1cbdf4,null));};exports[_0x5c1f('0x23')]=function(_0x261098,_0x310262){if(_0x261098[_0x5c1f('0x48')]['id']){delete _0x261098[_0x5c1f('0x48')]['id'];}return db[_0x5c1f('0x2a')][_0x5c1f('0x49')]({'where':{'id':_0x261098[_0x5c1f('0x44')]['id']}})['then'](handleEntityNotFound(_0x310262,null))[_0x5c1f('0x24')](saveUpdates(_0x261098[_0x5c1f('0x48')],null))[_0x5c1f('0x24')](respondWithResult(_0x310262,null))[_0x5c1f('0x46')](handleError(_0x310262,null));};exports[_0x5c1f('0x25')]=function(_0x1318b4,_0x54d26b){return db[_0x5c1f('0x2a')]['find']({'where':{'id':_0x1318b4[_0x5c1f('0x44')]['id']}})['then'](handleEntityNotFound(_0x54d26b,null))[_0x5c1f('0x24')](removeEntity(_0x54d26b,null))['catch'](handleError(_0x54d26b,null));};exports[_0x5c1f('0x4a')]=function(_0x39b8bf,_0x940918){return db['MailTransferReport']['describe']()[_0x5c1f('0x24')](respondWithResult(_0x940918,null))[_0x5c1f('0x46')](handleError(_0x940918,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 1a4fe62..aa412ce 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 _0x6666=['lodash','bluebird','request-promise','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0x6666,0x6e));var _0x6666=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0x6666[_0xf04c6d];return _0x4a804e;};'use strict';var _=require(_0x6666('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6666('0x1'));var rp=require(_0x6666('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6666('0x3'));var attributes=require(_0x6666('0x4'));module[_0x6666('0x5')]=function(_0x1cf748,_0xfb7053){return _0x1cf748[_0x6666('0x6')](_0x6666('0x7'),attributes,{'tableName':_0x6666('0x8'),'paranoid':![],'indexes':[{'name':_0x6666('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1016=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util'];(function(_0x2e3818,_0x2493c7){var _0x57ff69=function(_0x38aa50){while(--_0x38aa50){_0x2e3818['push'](_0x2e3818['shift']());}};_0x57ff69(++_0x2493c7);}(_0x1016,0x124));var _0x6101=function(_0x1e6951,_0x4d39ee){_0x1e6951=_0x1e6951-0x0;var _0x235723=_0x1016[_0x1e6951];return _0x235723;};'use strict';var _=require(_0x6101('0x0'));var util=require(_0x6101('0x1'));var logger=require(_0x6101('0x2'))('api');var moment=require(_0x6101('0x3'));var BPromise=require(_0x6101('0x4'));var rp=require(_0x6101('0x5'));var fs=require('fs');var path=require(_0x6101('0x6'));var rimraf=require(_0x6101('0x7'));var config=require(_0x6101('0x8'));var attributes=require(_0x6101('0x9'));module[_0x6101('0xa')]=function(_0x49bf64,_0x3bd613){return _0x49bf64[_0x6101('0xb')]('MailTransferReport',attributes,{'tableName':_0x6101('0xc'),'paranoid':![],'indexes':[{'name':_0x6101('0xd'),'fields':[_0x6101('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 bdebc16..2cbe4c3 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 _0x500b=['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','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x44c193,_0x5d61a2){var _0x454a14=function(_0x18ea25){while(--_0x18ea25){_0x44c193['push'](_0x44c193['shift']());}};_0x454a14(++_0x5d61a2);}(_0x500b,0xa2));var _0xb500=function(_0x4d1dcb,_0x49df03){_0x4d1dcb=_0x4d1dcb-0x0;var _0x3088a7=_0x500b[_0x4d1dcb];return _0x3088a7;};'use strict';var _=require('lodash');var util=require(_0xb500('0x0'));var moment=require(_0xb500('0x1'));var BPromise=require(_0xb500('0x2'));var rs=require(_0xb500('0x3'));var fs=require('fs');var Redis=require(_0xb500('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb500('0x5'));var logger=require(_0xb500('0x6'))(_0xb500('0x7'));var config=require(_0xb500('0x8'));var jayson=require(_0xb500('0x9'));var client=jayson[_0xb500('0xa')][_0xb500('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa03a1a,_0x5b445c,_0x7652e){return new BPromise(function(_0x3b877c,_0x109ad6){return client[_0xb500('0xc')](_0xa03a1a,_0x7652e)[_0xb500('0xd')](function(_0x1c1e67){logger[_0xb500('0xe')](_0xb500('0xf'),_0x5b445c,_0xb500('0x10'));logger[_0xb500('0x11')](_0xb500('0x12'),_0x5b445c,_0xb500('0x10'),JSON[_0xb500('0x13')](_0x1c1e67));if(_0x1c1e67['error']){if(_0x1c1e67[_0xb500('0x14')][_0xb500('0x15')]===0x1f4){logger[_0xb500('0x14')](_0xb500('0xf'),_0x5b445c,_0x1c1e67['error'][_0xb500('0x16')]);return _0x109ad6(_0x1c1e67[_0xb500('0x14')][_0xb500('0x16')]);}logger[_0xb500('0x14')](_0xb500('0xf'),_0x5b445c,_0x1c1e67[_0xb500('0x14')][_0xb500('0x16')]);return _0x3b877c(_0x1c1e67['error'][_0xb500('0x16')]);}else{logger[_0xb500('0xe')](_0xb500('0xf'),_0x5b445c,_0xb500('0x10'));_0x3b877c(_0x1c1e67[_0xb500('0x17')][_0xb500('0x16')]);}})[_0xb500('0x18')](function(_0x37bf34){logger[_0xb500('0x14')](_0xb500('0xf'),_0x5b445c,_0x37bf34);_0x109ad6(_0x37bf34);});});} \ No newline at end of file +var _0x3f50=['rpc','../../config/environment','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ddf26,_0x15c898){var _0x32a6c3=function(_0x32e45f){while(--_0x32e45f){_0x3ddf26['push'](_0x3ddf26['shift']());}};_0x32a6c3(++_0x15c898);}(_0x3f50,0xfe));var _0x03f5=function(_0x262e4b,_0x251fb8){_0x262e4b=_0x262e4b-0x0;var _0x161042=_0x3f50[_0x262e4b];return _0x161042;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x03f5('0x0'));var BPromise=require(_0x03f5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03f5('0x2'));var db=require(_0x03f5('0x3'))['db'];var utils=require(_0x03f5('0x4'));var logger=require(_0x03f5('0x5'))(_0x03f5('0x6'));var config=require(_0x03f5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x03f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb55d7e,_0x3bfa71,_0x3f8687){return new BPromise(function(_0x7abeb2,_0x2ab905){return client[_0x03f5('0x9')](_0xb55d7e,_0x3f8687)['then'](function(_0x273c0b){logger[_0x03f5('0xa')](_0x03f5('0xb'),_0x3bfa71,_0x03f5('0xc'));logger[_0x03f5('0xd')](_0x03f5('0xe'),_0x3bfa71,_0x03f5('0xc'),JSON['stringify'](_0x273c0b));if(_0x273c0b[_0x03f5('0xf')]){if(_0x273c0b[_0x03f5('0xf')][_0x03f5('0x10')]===0x1f4){logger['error'](_0x03f5('0xb'),_0x3bfa71,_0x273c0b[_0x03f5('0xf')][_0x03f5('0x11')]);return _0x2ab905(_0x273c0b['error']['message']);}logger['error'](_0x03f5('0xb'),_0x3bfa71,_0x273c0b['error'][_0x03f5('0x11')]);return _0x7abeb2(_0x273c0b[_0x03f5('0xf')][_0x03f5('0x11')]);}else{logger['info'](_0x03f5('0xb'),_0x3bfa71,_0x03f5('0xc'));_0x7abeb2(_0x273c0b[_0x03f5('0x12')][_0x03f5('0x11')]);}})[_0x03f5('0x13')](function(_0x53ce78){logger[_0x03f5('0xf')](_0x03f5('0xb'),_0x3bfa71,_0x53ce78);_0x2ab905(_0x53ce78);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 0d87b94..6aa4a3d 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 _0x5d64=['../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','show','create','put','delete','/:id','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x2dcec8,_0x4d998d){var _0x9a610d=function(_0x5cc449){while(--_0x5cc449){_0x2dcec8['push'](_0x2dcec8['shift']());}};_0x9a610d(++_0x4d998d);}(_0x5d64,0x13e));var _0x45d6=function(_0x45659c,_0xc3a04){_0x45659c=_0x45659c-0x0;var _0x4cc33f=_0x5d64[_0x45659c];return _0x4cc33f;};'use strict';var multer=require(_0x45d6('0x0'));var util=require(_0x45d6('0x1'));var path=require('path');var timeout=require(_0x45d6('0x2'));var express=require('express');var router=express[_0x45d6('0x3')]();var fs_extra=require(_0x45d6('0x4'));var auth=require(_0x45d6('0x5'));var interaction=require(_0x45d6('0x6'));var config=require(_0x45d6('0x7'));var controller=require(_0x45d6('0x8'));router[_0x45d6('0x9')]('/',auth[_0x45d6('0xa')](),controller[_0x45d6('0xb')]);router[_0x45d6('0x9')](_0x45d6('0xc'),auth[_0x45d6('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x45d6('0xd')]);router['post']('/',auth[_0x45d6('0xa')](),controller[_0x45d6('0xe')]);router[_0x45d6('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x45d6('0x10')](_0x45d6('0x11'),auth[_0x45d6('0xa')](),controller['destroy']);module[_0x45d6('0x12')]=router; \ No newline at end of file +var _0x1cf2=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x512148,_0xf754c1){var _0x54e864=function(_0x8c1503){while(--_0x8c1503){_0x512148['push'](_0x512148['shift']());}};_0x54e864(++_0xf754c1);}(_0x1cf2,0x6c));var _0x21cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1cf2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x21cf('0x0'));var path=require(_0x21cf('0x1'));var timeout=require('connect-timeout');var express=require(_0x21cf('0x2'));var router=express[_0x21cf('0x3')]();var fs_extra=require(_0x21cf('0x4'));var auth=require(_0x21cf('0x5'));var interaction=require(_0x21cf('0x6'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x21cf('0x7')]('/',auth[_0x21cf('0x8')](),controller[_0x21cf('0x9')]);router['get'](_0x21cf('0xa'),auth[_0x21cf('0x8')](),controller[_0x21cf('0xb')]);router['get'](_0x21cf('0xc'),auth[_0x21cf('0x8')](),controller['show']);router[_0x21cf('0xd')]('/',auth[_0x21cf('0x8')](),controller['create']);router[_0x21cf('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x21cf('0xf')]);router[_0x21cf('0x10')](_0x21cf('0xc'),auth[_0x21cf('0x8')](),controller[_0x21cf('0x11')]);module[_0x21cf('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 3ab05a9..81d2e18 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 _0x12d0=['STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports'];(function(_0x2bc6be,_0x9bf473){var _0x3a1197=function(_0x35d452){while(--_0x35d452){_0x2bc6be['push'](_0x2bc6be['shift']());}};_0x3a1197(++_0x9bf473);}(_0x12d0,0x1d2));var _0x012d=function(_0xb7ba3f,_0x3b4b15){_0xb7ba3f=_0xb7ba3f-0x0;var _0x47c212=_0x12d0[_0xb7ba3f];return _0x47c212;};'use strict';var Sequelize=require(_0x012d('0x0'));var moment=require('moment');module[_0x012d('0x1')]={'channel':{'type':Sequelize[_0x012d('0x2')]},'membername':{'type':Sequelize[_0x012d('0x2')]},'interface':{'type':Sequelize[_0x012d('0x2')]},'type':{'type':Sequelize[_0x012d('0x2')],'defaultValue':_0x012d('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x012d('0x4')]},'enterAt':{'type':Sequelize[_0x012d('0x5')]},'exitAt':{'type':Sequelize[_0x012d('0x5')],'set':function(_0x482f03){var _0x23245c=moment(_0x482f03);var _0x2cccce=moment(this[_0x012d('0x6')](_0x012d('0x7')));var _0xe209bf=_0x23245c[_0x012d('0x8')](_0x2cccce,_0x012d('0x9'));this[_0x012d('0xa')](_0x012d('0xb'),_0x482f03);this[_0x012d('0xa')](_0x012d('0xc'),_0xe209bf>=0x0?_0xe209bf:null);}},'data1':{'type':Sequelize[_0x012d('0x2')],'comment':_0x012d('0xd')},'data2':{'type':Sequelize[_0x012d('0x2')],'comment':_0x012d('0xe')},'data3':{'type':Sequelize[_0x012d('0x2')],'comment':_0x012d('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0x012d('0x10')},'data5':{'type':Sequelize['STRING'],'comment':_0x012d('0x11')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x012d('0x2')]}}; \ No newline at end of file +var _0xe987=['sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]'];(function(_0x568736,_0x1be39c){var _0x6463be=function(_0x1b18ea){while(--_0x1b18ea){_0x568736['push'](_0x568736['shift']());}};_0x6463be(++_0x1be39c);}(_0xe987,0x1dc));var _0x7e98=function(_0x32082b,_0x5e2270){_0x32082b=_0x32082b-0x0;var _0x411a3c=_0xe987[_0x32082b];return _0x411a3c;};'use strict';var Sequelize=require(_0x7e98('0x0'));var moment=require(_0x7e98('0x1'));module['exports']={'channel':{'type':Sequelize[_0x7e98('0x2')]},'membername':{'type':Sequelize[_0x7e98('0x2')]},'interface':{'type':Sequelize[_0x7e98('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x7e98('0x3'),'comment':_0x7e98('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x7e98('0x5')]},'exitAt':{'type':Sequelize[_0x7e98('0x5')],'set':function(_0x5909c4){var _0x3bc838=moment(_0x5909c4);var _0x23c777=moment(this[_0x7e98('0x6')](_0x7e98('0x7')));var _0x5f2040=_0x3bc838[_0x7e98('0x8')](_0x23c777,_0x7e98('0x9'));this['setDataValue'](_0x7e98('0xa'),_0x5909c4);this[_0x7e98('0xb')](_0x7e98('0xc'),_0x5f2040>=0x0?_0x5f2040:null);}},'data1':{'type':Sequelize[_0x7e98('0x2')],'comment':_0x7e98('0xd')},'data2':{'type':Sequelize[_0x7e98('0x2')],'comment':_0x7e98('0xe')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x7e98('0x2')],'comment':_0x7e98('0xf')},'data5':{'type':Sequelize[_0x7e98('0x2')],'comment':_0x7e98('0x10')},'role':{'type':Sequelize[_0x7e98('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x7e98('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index cbfb987..58988b9 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x3ffc30,_0x3ae8ff){var _0x57c8d9=function(_0x33bfa7){while(--_0x33bfa7){_0x3ffc30['push'](_0x3ffc30['shift']());}};_0x57c8d9(++_0x3ae8ff);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x34e8,0x12c));var _0x834e=function(_0x5debb9,_0x159e1){_0x5debb9=_0x5debb9-0x0;var _0x2411b1=_0x34e8[_0x5debb9];return _0x2411b1;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 431ddd7..e7d6e28 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 _0xe4e5=['moment','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','interface','api'];(function(_0x29af75,_0x152b87){var _0x32b56b=function(_0x5460fe){while(--_0x5460fe){_0x29af75['push'](_0x29af75['shift']());}};_0x32b56b(++_0x152b87);}(_0xe4e5,0xfb));var _0x5e4e=function(_0x3a04c6,_0x12a482){_0x3a04c6=_0x3a04c6-0x0;var _0xf4131a=_0xe4e5[_0x3a04c6];return _0xf4131a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5e4e('0x0'));var moment=require(_0x5e4e('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e4e('0x2'));var rimraf=require(_0x5e4e('0x3'));var config=require(_0x5e4e('0x4'));var attributes=require(_0x5e4e('0x5'));module[_0x5e4e('0x6')]=function(_0x3d2c63,_0x2977cf){return _0x3d2c63[_0x5e4e('0x7')](_0x5e4e('0x8'),attributes,{'tableName':_0x5e4e('0x9'),'paranoid':![],'indexes':[{'name':_0x5e4e('0xa'),'fields':['membername',_0x5e4e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xddd3=['./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3616eb,_0x3e60c2){var _0x502001=function(_0x1e1bc2){while(--_0x1e1bc2){_0x3616eb['push'](_0x3616eb['shift']());}};_0x502001(++_0x3e60c2);}(_0xddd3,0x1e8));var _0x3ddd=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xddd3[_0x257642];return _0x3d813b;};'use strict';var _=require(_0x3ddd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3ddd('0x1'));var moment=require(_0x3ddd('0x2'));var BPromise=require(_0x3ddd('0x3'));var rp=require(_0x3ddd('0x4'));var fs=require('fs');var path=require(_0x3ddd('0x5'));var rimraf=require('rimraf');var config=require(_0x3ddd('0x6'));var attributes=require(_0x3ddd('0x7'));module[_0x3ddd('0x8')]=function(_0x3b1319,_0x521856){return _0x3b1319[_0x3ddd('0x9')](_0x3ddd('0xa'),attributes,{'tableName':_0x3ddd('0xb'),'paranoid':![],'indexes':[{'name':_0x3ddd('0xc'),'fields':[_0x3ddd('0xd'),_0x3ddd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 731de89..3f6e149 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 _0x7e02=['GetMemberReport','body','CreateMemberReport','limit','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','MemberReport','findAll','options','raw','where','attributes','map','include','model'];(function(_0x4718bc,_0x3fd2be){var _0x40e411=function(_0x1a928e){while(--_0x1a928e){_0x4718bc['push'](_0x4718bc['shift']());}};_0x40e411(++_0x3fd2be);}(_0x7e02,0x71));var _0x27e0=function(_0x1657c0,_0x2e07e5){_0x1657c0=_0x1657c0-0x0;var _0x40912a=_0x7e02[_0x1657c0];return _0x40912a;};'use strict';var _=require(_0x27e0('0x0'));var util=require(_0x27e0('0x1'));var moment=require(_0x27e0('0x2'));var BPromise=require(_0x27e0('0x3'));var rs=require(_0x27e0('0x4'));var fs=require('fs');var Redis=require(_0x27e0('0x5'));var db=require(_0x27e0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x27e0('0x7'));var config=require('../../config/environment');var jayson=require(_0x27e0('0x8'));var client=jayson[_0x27e0('0x9')][_0x27e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cc944,_0x32bc79,_0x2dff51){return new BPromise(function(_0x44ae54,_0x272efb){return client['request'](_0x1cc944,_0x2dff51)[_0x27e0('0xb')](function(_0x5ec050){logger[_0x27e0('0xc')](_0x27e0('0xd'),_0x32bc79,'request\x20sent');logger[_0x27e0('0xe')](_0x27e0('0xf'),_0x32bc79,_0x27e0('0x10'),JSON[_0x27e0('0x11')](_0x5ec050));if(_0x5ec050[_0x27e0('0x12')]){if(_0x5ec050[_0x27e0('0x12')][_0x27e0('0x13')]===0x1f4){logger[_0x27e0('0x12')](_0x27e0('0xd'),_0x32bc79,_0x5ec050['error'][_0x27e0('0x14')]);return _0x272efb(_0x5ec050[_0x27e0('0x12')][_0x27e0('0x14')]);}logger['error'](_0x27e0('0xd'),_0x32bc79,_0x5ec050[_0x27e0('0x12')][_0x27e0('0x14')]);return _0x44ae54(_0x5ec050['error'][_0x27e0('0x14')]);}else{logger[_0x27e0('0xc')](_0x27e0('0xd'),_0x32bc79,_0x27e0('0x10'));_0x44ae54(_0x5ec050['result']['message']);}})[_0x27e0('0x15')](function(_0xe6b7b1){logger[_0x27e0('0x12')](_0x27e0('0xd'),_0x32bc79,_0xe6b7b1);_0x272efb(_0xe6b7b1);});});}exports['GetMemberReport']=function(_0x32597b){var _0x20a4cc=this;return new Promise(function(_0x12a91f,_0x1e141f){return db[_0x27e0('0x16')][_0x27e0('0x17')]({'raw':_0x32597b['options']?_0x32597b[_0x27e0('0x18')][_0x27e0('0x19')]===undefined?!![]:![]:!![],'where':_0x32597b['options']?_0x32597b[_0x27e0('0x18')][_0x27e0('0x1a')]||null:null,'attributes':_0x32597b[_0x27e0('0x18')]?_0x32597b[_0x27e0('0x18')][_0x27e0('0x1b')]||null:null,'limit':_0x32597b['options']?_0x32597b['options']['limit']||null:null,'include':_0x32597b[_0x27e0('0x18')]?_0x32597b[_0x27e0('0x18')]['include']?_[_0x27e0('0x1c')](_0x32597b[_0x27e0('0x18')][_0x27e0('0x1d')],function(_0x6f83ee){return{'model':db[_0x6f83ee[_0x27e0('0x1e')]],'as':_0x6f83ee['as'],'attributes':_0x6f83ee[_0x27e0('0x1b')],'include':_0x6f83ee[_0x27e0('0x1d')]?_[_0x27e0('0x1c')](_0x6f83ee[_0x27e0('0x1d')],function(_0x3068c4){return{'model':db[_0x3068c4[_0x27e0('0x1e')]],'as':_0x3068c4['as'],'attributes':_0x3068c4[_0x27e0('0x1b')],'include':_0x3068c4[_0x27e0('0x1d')]?_[_0x27e0('0x1c')](_0x3068c4[_0x27e0('0x1d')],function(_0x581ec9){return{'model':db[_0x581ec9[_0x27e0('0x1e')]],'as':_0x581ec9['as'],'attributes':_0x581ec9[_0x27e0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x27e0('0xb')](function(_0x7e00da){logger[_0x27e0('0xc')]('GetMemberReport',_0x32597b);logger['debug'](_0x27e0('0x1f'),_0x32597b,JSON[_0x27e0('0x11')](_0x7e00da));_0x12a91f(_0x7e00da);})[_0x27e0('0x15')](function(_0x304fe6){logger['error']('GetMemberReport',_0x304fe6[_0x27e0('0x14')],_0x32597b);_0x1e141f(_0x20a4cc[_0x27e0('0x12')](0x1f4,_0x304fe6['message']));});});};exports['CreateMemberReport']=function(_0x551794){var _0xdedb73=this;return new Promise(function(_0x384e11,_0x24605a){return db[_0x27e0('0x16')]['create'](_0x551794[_0x27e0('0x20')],{'raw':_0x551794[_0x27e0('0x18')]?_0x551794[_0x27e0('0x18')][_0x27e0('0x19')]===undefined?!![]:![]:!![]})[_0x27e0('0xb')](function(_0x2c98bd){logger[_0x27e0('0xc')](_0x27e0('0x21'),_0x551794);logger[_0x27e0('0xe')](_0x27e0('0x21'),_0x551794,JSON['stringify'](_0x2c98bd));_0x384e11(_0x2c98bd);})[_0x27e0('0x15')](function(_0xecebf7){logger['error']('CreateMemberReport',_0xecebf7[_0x27e0('0x14')],_0x551794);_0x24605a(_0xdedb73[_0x27e0('0x12')](0x1f4,_0xecebf7[_0x27e0('0x14')]));});});};exports['UpdateMemberReport']=function(_0x17e020){var _0x10eb01=this;return new Promise(function(_0x4d26f7,_0x352679){return db[_0x27e0('0x16')]['update'](_0x17e020[_0x27e0('0x20')],{'raw':_0x17e020[_0x27e0('0x18')]?_0x17e020['options'][_0x27e0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e020[_0x27e0('0x18')]?_0x17e020['options']['where']||null:null,'attributes':_0x17e020[_0x27e0('0x18')]?_0x17e020[_0x27e0('0x18')][_0x27e0('0x1b')]||null:null,'limit':_0x17e020[_0x27e0('0x18')]?_0x17e020['options'][_0x27e0('0x22')]||null:null})['then'](function(_0x3f1d73){logger[_0x27e0('0xc')](_0x27e0('0x23'),_0x17e020);logger['debug'](_0x27e0('0x23'),_0x17e020,JSON[_0x27e0('0x11')](_0x3f1d73));_0x4d26f7(_0x3f1d73);})['catch'](function(_0x4cf35f){logger[_0x27e0('0x12')](_0x27e0('0x23'),_0x4cf35f[_0x27e0('0x14')],_0x17e020);_0x352679(_0x10eb01[_0x27e0('0x12')](0x1f4,_0x4cf35f['message']));});});}; \ No newline at end of file +var _0x52ad=['rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','info','result','catch','GetMemberReport','findAll','raw','options','where','attributes','include','map','model','CreateMemberReport','UpdateMemberReport','MemberReport','update','body','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x33124f,_0x5b4aa1){var _0x1236e7=function(_0x47d62b){while(--_0x47d62b){_0x33124f['push'](_0x33124f['shift']());}};_0x1236e7(++_0x5b4aa1);}(_0x52ad,0x1d8));var _0xd52a=function(_0x20264e,_0x219a4f){_0x20264e=_0x20264e-0x0;var _0x28314f=_0x52ad[_0x20264e];return _0x28314f;};'use strict';var _=require(_0xd52a('0x0'));var util=require(_0xd52a('0x1'));var moment=require(_0xd52a('0x2'));var BPromise=require(_0xd52a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd52a('0x4'));var db=require(_0xd52a('0x5'))['db'];var utils=require(_0xd52a('0x6'));var logger=require(_0xd52a('0x7'))(_0xd52a('0x8'));var config=require(_0xd52a('0x9'));var jayson=require(_0xd52a('0xa'));var client=jayson[_0xd52a('0xb')][_0xd52a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e80f5,_0x123bb1,_0x16a73d){return new BPromise(function(_0x20b817,_0x3df9d4){return client['request'](_0x5e80f5,_0x16a73d)[_0xd52a('0xd')](function(_0x671681){logger['info']('MemberReport,\x20%s,\x20%s',_0x123bb1,_0xd52a('0xe'));logger[_0xd52a('0xf')](_0xd52a('0x10'),_0x123bb1,_0xd52a('0xe'),JSON[_0xd52a('0x11')](_0x671681));if(_0x671681[_0xd52a('0x12')]){if(_0x671681['error'][_0xd52a('0x13')]===0x1f4){logger[_0xd52a('0x12')](_0xd52a('0x14'),_0x123bb1,_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);return _0x3df9d4(_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);}logger[_0xd52a('0x12')](_0xd52a('0x14'),_0x123bb1,_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);return _0x20b817(_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);}else{logger[_0xd52a('0x16')](_0xd52a('0x14'),_0x123bb1,_0xd52a('0xe'));_0x20b817(_0x671681[_0xd52a('0x17')][_0xd52a('0x15')]);}})[_0xd52a('0x18')](function(_0x1aa59f){logger[_0xd52a('0x12')](_0xd52a('0x14'),_0x123bb1,_0x1aa59f);_0x3df9d4(_0x1aa59f);});});}exports[_0xd52a('0x19')]=function(_0x120617){var _0x3d9daa=this;return new Promise(function(_0x41f11f,_0x5231a7){return db['MemberReport'][_0xd52a('0x1a')]({'raw':_0x120617['options']?_0x120617['options'][_0xd52a('0x1b')]===undefined?!![]:![]:!![],'where':_0x120617[_0xd52a('0x1c')]?_0x120617[_0xd52a('0x1c')][_0xd52a('0x1d')]||null:null,'attributes':_0x120617[_0xd52a('0x1c')]?_0x120617[_0xd52a('0x1c')][_0xd52a('0x1e')]||null:null,'limit':_0x120617[_0xd52a('0x1c')]?_0x120617[_0xd52a('0x1c')]['limit']||null:null,'include':_0x120617[_0xd52a('0x1c')]?_0x120617[_0xd52a('0x1c')][_0xd52a('0x1f')]?_[_0xd52a('0x20')](_0x120617[_0xd52a('0x1c')][_0xd52a('0x1f')],function(_0x3644c1){return{'model':db[_0x3644c1[_0xd52a('0x21')]],'as':_0x3644c1['as'],'attributes':_0x3644c1['attributes'],'include':_0x3644c1['include']?_[_0xd52a('0x20')](_0x3644c1['include'],function(_0x1863fd){return{'model':db[_0x1863fd[_0xd52a('0x21')]],'as':_0x1863fd['as'],'attributes':_0x1863fd['attributes'],'include':_0x1863fd['include']?_[_0xd52a('0x20')](_0x1863fd[_0xd52a('0x1f')],function(_0x275244){return{'model':db[_0x275244[_0xd52a('0x21')]],'as':_0x275244['as'],'attributes':_0x275244[_0xd52a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd52a('0xd')](function(_0x23da09){logger[_0xd52a('0x16')](_0xd52a('0x19'),_0x120617);logger[_0xd52a('0xf')](_0xd52a('0x19'),_0x120617,JSON[_0xd52a('0x11')](_0x23da09));_0x41f11f(_0x23da09);})[_0xd52a('0x18')](function(_0x4ad3e4){logger[_0xd52a('0x12')](_0xd52a('0x19'),_0x4ad3e4['message'],_0x120617);_0x5231a7(_0x3d9daa['error'](0x1f4,_0x4ad3e4[_0xd52a('0x15')]));});});};exports[_0xd52a('0x22')]=function(_0x48133d){var _0x59e328=this;return new Promise(function(_0x5e0abb,_0x1ed056){return db['MemberReport']['create'](_0x48133d['body'],{'raw':_0x48133d[_0xd52a('0x1c')]?_0x48133d[_0xd52a('0x1c')][_0xd52a('0x1b')]===undefined?!![]:![]:!![]})[_0xd52a('0xd')](function(_0x2ff425){logger[_0xd52a('0x16')](_0xd52a('0x22'),_0x48133d);logger[_0xd52a('0xf')](_0xd52a('0x22'),_0x48133d,JSON['stringify'](_0x2ff425));_0x5e0abb(_0x2ff425);})[_0xd52a('0x18')](function(_0x20fbb4){logger[_0xd52a('0x12')]('CreateMemberReport',_0x20fbb4['message'],_0x48133d);_0x1ed056(_0x59e328[_0xd52a('0x12')](0x1f4,_0x20fbb4['message']));});});};exports[_0xd52a('0x23')]=function(_0xf01fab){var _0x3a0cb5=this;return new Promise(function(_0x397a06,_0x1f1aca){return db[_0xd52a('0x24')][_0xd52a('0x25')](_0xf01fab[_0xd52a('0x26')],{'raw':_0xf01fab['options']?_0xf01fab['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf01fab[_0xd52a('0x1c')]?_0xf01fab[_0xd52a('0x1c')]['where']||null:null,'attributes':_0xf01fab['options']?_0xf01fab[_0xd52a('0x1c')][_0xd52a('0x1e')]||null:null,'limit':_0xf01fab[_0xd52a('0x1c')]?_0xf01fab[_0xd52a('0x1c')][_0xd52a('0x27')]||null:null})[_0xd52a('0xd')](function(_0xfeccee){logger['info'](_0xd52a('0x23'),_0xf01fab);logger[_0xd52a('0xf')]('UpdateMemberReport',_0xf01fab,JSON['stringify'](_0xfeccee));_0x397a06(_0xfeccee);})['catch'](function(_0x4f2129){logger['error']('UpdateMemberReport',_0x4f2129['message'],_0xf01fab);_0x1f1aca(_0x3a0cb5[_0xd52a('0x12')](0x1f4,_0x4f2129[_0xd52a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 7df3898..fbf34ae 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 _0xa43a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','exports','multer','util','path','connect-timeout'];(function(_0x405385,_0x56f573){var _0x43837b=function(_0x30e20e){while(--_0x30e20e){_0x405385['push'](_0x405385['shift']());}};_0x43837b(++_0x56f573);}(_0xa43a,0xe3));var _0xaa43=function(_0xce5e5c,_0x175633){_0xce5e5c=_0xce5e5c-0x0;var _0x93ebc1=_0xa43a[_0xce5e5c];return _0x93ebc1;};'use strict';var multer=require(_0xaa43('0x0'));var util=require(_0xaa43('0x1'));var path=require(_0xaa43('0x2'));var timeout=require(_0xaa43('0x3'));var express=require(_0xaa43('0x4'));var router=express[_0xaa43('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaa43('0x6'));var interaction=require(_0xaa43('0x7'));var config=require(_0xaa43('0x8'));var controller=require(_0xaa43('0x9'));router['get']('/',controller['index']);module[_0xaa43('0xa')]=router; \ No newline at end of file +var _0xeb24=['express','fs-extra','../../components/auth/service','./migration.controller','get','index','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb24,0xd8));var _0x4eb2=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xeb24[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0x4eb2('0x0'));var util=require(_0x4eb2('0x1'));var path=require(_0x4eb2('0x2'));var timeout=require(_0x4eb2('0x3'));var express=require(_0x4eb2('0x4'));var router=express['Router']();var fs_extra=require(_0x4eb2('0x5'));var auth=require(_0x4eb2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4eb2('0x7'));router[_0x4eb2('0x8')]('/',controller[_0x4eb2('0x9')]);module[_0x4eb2('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index c539a80..2aa3c23 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 _0xb5f5=['STRING','version'];(function(_0x48ee35,_0x58daa7){var _0x58f2df=function(_0x5d2075){while(--_0x5d2075){_0x48ee35['push'](_0x48ee35['shift']());}};_0x58f2df(++_0x58daa7);}(_0xb5f5,0x1da));var _0x5b5f=function(_0x1af715,_0x5209a3){_0x1af715=_0x1af715-0x0;var _0x438c68=_0xb5f5[_0x1af715];return _0x438c68;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0x5b5f('0x0')],'unique':_0x5b5f('0x1')}}; \ No newline at end of file +var _0xbd90=['STRING','version','sequelize','exports'];(function(_0x318dda,_0x1aa800){var _0x3f97ca=function(_0x1dc61a){while(--_0x1dc61a){_0x318dda['push'](_0x318dda['shift']());}};_0x3f97ca(++_0x1aa800);}(_0xbd90,0x1ea));var _0x0bd9=function(_0x1b2905,_0x2a9ec7){_0x1b2905=_0x1b2905-0x0;var _0x1d5023=_0xbd90[_0x1b2905];return _0x1d5023;};'use strict';var Sequelize=require(_0x0bd9('0x0'));module[_0x0bd9('0x1')]={'version':{'type':Sequelize[_0x0bd9('0x2')],'unique':_0x0bd9('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index ba9bee0..fa60d76 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 _0xe2b7=['sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','catch','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','Migration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order'];(function(_0x4f1c96,_0x49aa12){var _0x2a7ba8=function(_0x4bb7c3){while(--_0x4bb7c3){_0x4f1c96['push'](_0x4f1c96['shift']());}};_0x2a7ba8(++_0x49aa12);}(_0xe2b7,0x8c));var _0x7e2b=function(_0x41cf8d,_0x8be49){_0x41cf8d=_0x41cf8d-0x0;var _0x5111c1=_0xe2b7[_0x41cf8d];return _0x5111c1;};'use strict';var emlformat=require(_0x7e2b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7e2b('0x1'));var rp=require('request-promise');var moment=require(_0x7e2b('0x2'));var BPromise=require(_0x7e2b('0x3'));var Mustache=require(_0x7e2b('0x4'));var util=require(_0x7e2b('0x5'));var path=require('path');var sox=require(_0x7e2b('0x6'));var csv=require('to-csv');var ejs=require(_0x7e2b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e2b('0x8'));var squel=require(_0x7e2b('0x9'));var crypto=require(_0x7e2b('0xa'));var jsforce=require(_0x7e2b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7e2b('0xc'));var querystring=require('querystring');var Papa=require(_0x7e2b('0xd'));var Redis=require(_0x7e2b('0xe'));var authService=require(_0x7e2b('0xf'));var qs=require(_0x7e2b('0x10'));var as=require(_0x7e2b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7e2b('0x12'));var utils=require('../../config/utils');var config=require(_0x7e2b('0x13'));var licenseUtil=require(_0x7e2b('0x14'));var db=require(_0x7e2b('0x15'))['db'];function respondWithStatusCode(_0x8e4297,_0xa3a638){_0xa3a638=_0xa3a638||0xcc;return function(_0x337467){if(_0x337467){return _0x8e4297[_0x7e2b('0x16')](_0xa3a638);}return _0x8e4297['status'](_0xa3a638)[_0x7e2b('0x17')]();};}function respondWithResult(_0x3ecada,_0x25c61c){_0x25c61c=_0x25c61c||0xc8;return function(_0x552794){if(_0x552794){return _0x3ecada['status'](_0x25c61c)['json'](_0x552794);}};}function respondWithFilteredResult(_0x1f18d9,_0x11580a){return function(_0x3fa599){if(_0x3fa599){var _0x3ce9b3=typeof _0x11580a[_0x7e2b('0x18')]===_0x7e2b('0x19')&&typeof _0x11580a['limit']===_0x7e2b('0x19');var _0x434740=_0x3fa599[_0x7e2b('0x1a')];var _0x1a4c15=_0x3ce9b3?0x0:_0x11580a[_0x7e2b('0x18')];var _0x2cf4da=_0x3ce9b3?_0x3fa599[_0x7e2b('0x1a')]:_0x11580a[_0x7e2b('0x18')]+_0x11580a[_0x7e2b('0x1b')];var _0x568ffe;if(_0x2cf4da>=_0x434740){_0x2cf4da=_0x434740;_0x568ffe=0xc8;}else{_0x568ffe=0xce;}_0x1f18d9[_0x7e2b('0x1c')](_0x568ffe);return _0x1f18d9[_0x7e2b('0x1d')](_0x7e2b('0x1e'),_0x1a4c15+'-'+_0x2cf4da+'/'+_0x434740)[_0x7e2b('0x1f')](_0x3fa599);}return null;};}function patchUpdates(_0x3a0268){return function(_0x252af0){try{jsonpatch[_0x7e2b('0x20')](_0x252af0,_0x3a0268,!![]);}catch(_0xf16536){return BPromise[_0x7e2b('0x21')](_0xf16536);}return _0x252af0[_0x7e2b('0x22')]();};}function saveUpdates(_0xc9888,_0x167b0e){return function(_0x2f7b56){if(_0x2f7b56){return _0x2f7b56[_0x7e2b('0x23')](_0xc9888)[_0x7e2b('0x24')](function(_0x4f4b94){return _0x4f4b94;});}return null;};}function removeEntity(_0x8ca28c,_0x3f9259){return function(_0xee1d8f){if(_0xee1d8f){return _0xee1d8f[_0x7e2b('0x25')]()[_0x7e2b('0x24')](function(){_0x8ca28c[_0x7e2b('0x1c')](0xcc)[_0x7e2b('0x17')]();});}};}function handleEntityNotFound(_0x48f67a,_0x41f28e){return function(_0x5675b4){if(!_0x5675b4){_0x48f67a['sendStatus'](0x194);}return _0x5675b4;};}function handleError(_0x468f37,_0x21545a){_0x21545a=_0x21545a||0x1f4;return function(_0x31bb4a){logger[_0x7e2b('0x26')](_0x31bb4a['stack']);if(_0x31bb4a['name']){delete _0x31bb4a[_0x7e2b('0x27')];}_0x468f37['status'](_0x21545a)[_0x7e2b('0x28')](_0x31bb4a);};}exports['index']=function(_0x1fcf38,_0x57730b){var _0x19524e={},_0x4b0411={},_0x5e42fa={'count':0x0,'rows':[]};var _0x21eeae=_[_0x7e2b('0x29')](db[_0x7e2b('0x2a')][_0x7e2b('0x2b')],function(_0x2be298){return{'name':_0x2be298[_0x7e2b('0x2c')],'type':_0x2be298['type'][_0x7e2b('0x2d')]};});_0x4b0411[_0x7e2b('0x2e')]=_[_0x7e2b('0x29')](_0x21eeae,_0x7e2b('0x27'));_0x4b0411[_0x7e2b('0x2f')]=_[_0x7e2b('0x30')](_0x1fcf38['query']);_0x4b0411[_0x7e2b('0x31')]=_[_0x7e2b('0x32')](_0x4b0411[_0x7e2b('0x2e')],_0x4b0411[_0x7e2b('0x2f')]);_0x19524e[_0x7e2b('0x33')]=_[_0x7e2b('0x32')](_0x4b0411[_0x7e2b('0x2e')],qs[_0x7e2b('0x34')](_0x1fcf38[_0x7e2b('0x2f')][_0x7e2b('0x34')]));_0x19524e[_0x7e2b('0x33')]=_0x19524e[_0x7e2b('0x33')]['length']?_0x19524e['attributes']:_0x4b0411[_0x7e2b('0x2e')];if(!_0x1fcf38[_0x7e2b('0x2f')][_0x7e2b('0x35')]('nolimit')){_0x19524e[_0x7e2b('0x1b')]=qs[_0x7e2b('0x1b')](_0x1fcf38[_0x7e2b('0x2f')][_0x7e2b('0x1b')]);_0x19524e[_0x7e2b('0x18')]=qs[_0x7e2b('0x18')](_0x1fcf38['query']['offset']);}_0x19524e[_0x7e2b('0x36')]=qs[_0x7e2b('0x37')](_0x1fcf38[_0x7e2b('0x2f')]['sort']);_0x19524e[_0x7e2b('0x38')]=qs[_0x7e2b('0x31')](_['pick'](_0x1fcf38[_0x7e2b('0x2f')],_0x4b0411['filters']),_0x21eeae);if(_0x1fcf38['query'][_0x7e2b('0x39')]){_0x19524e['where']=_[_0x7e2b('0x3a')](_0x19524e['where'],{'$or':_['map'](_0x21eeae,function(_0x1f4f2f){if(_0x1f4f2f[_0x7e2b('0x3b')]!==_0x7e2b('0x3c')){var _0xda798b={};_0xda798b[_0x1f4f2f['name']]={'$like':'%'+_0x1fcf38['query'][_0x7e2b('0x39')]+'%'};return _0xda798b;}})});}_0x19524e=_[_0x7e2b('0x3a')]({},_0x19524e,_0x1fcf38[_0x7e2b('0x3d')]);var _0x5994b5={'where':_0x19524e['where']};return db[_0x7e2b('0x2a')][_0x7e2b('0x1a')](_0x5994b5)['then'](function(_0xb843f1){_0x5e42fa[_0x7e2b('0x1a')]=_0xb843f1;if(_0x1fcf38[_0x7e2b('0x2f')]['includeAll']){_0x19524e['include']=[{'all':!![]}];}return db[_0x7e2b('0x2a')][_0x7e2b('0x3e')](_0x19524e);})[_0x7e2b('0x24')](function(_0x5d7d6a){_0x5e42fa[_0x7e2b('0x3f')]=_0x5d7d6a;return _0x5e42fa;})[_0x7e2b('0x24')](respondWithFilteredResult(_0x57730b,_0x19524e))[_0x7e2b('0x40')](handleError(_0x57730b,null));}; \ No newline at end of file +var _0xfd36=['bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','Migration','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xfd36,0x154));var _0x6fd3=function(_0x1ba155,_0x38626d){_0x1ba155=_0x1ba155-0x0;var _0x215aac=_0xfd36[_0x1ba155];return _0x215aac;};'use strict';var emlformat=require(_0x6fd3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6fd3('0x1'));var jsonpatch=require(_0x6fd3('0x2'));var rp=require(_0x6fd3('0x3'));var moment=require(_0x6fd3('0x4'));var BPromise=require(_0x6fd3('0x5'));var Mustache=require(_0x6fd3('0x6'));var util=require(_0x6fd3('0x7'));var path=require(_0x6fd3('0x8'));var sox=require(_0x6fd3('0x9'));var csv=require(_0x6fd3('0xa'));var ejs=require(_0x6fd3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6fd3('0xc'));var jsforce=require(_0x6fd3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6fd3('0xa'));var querystring=require('querystring');var Papa=require(_0x6fd3('0xe'));var Redis=require(_0x6fd3('0xf'));var authService=require(_0x6fd3('0x10'));var qs=require(_0x6fd3('0x11'));var as=require(_0x6fd3('0x12'));var hardwareService=require(_0x6fd3('0x13'));var logger=require('../../config/logger')(_0x6fd3('0x14'));var utils=require(_0x6fd3('0x15'));var config=require(_0x6fd3('0x16'));var licenseUtil=require(_0x6fd3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x160f65,_0x5cbbe3){_0x5cbbe3=_0x5cbbe3||0xcc;return function(_0x3d6e81){if(_0x3d6e81){return _0x160f65[_0x6fd3('0x18')](_0x5cbbe3);}return _0x160f65[_0x6fd3('0x19')](_0x5cbbe3)[_0x6fd3('0x1a')]();};}function respondWithResult(_0x595ede,_0x2455f8){_0x2455f8=_0x2455f8||0xc8;return function(_0x1c7bc8){if(_0x1c7bc8){return _0x595ede[_0x6fd3('0x19')](_0x2455f8)[_0x6fd3('0x1b')](_0x1c7bc8);}};}function respondWithFilteredResult(_0x282721,_0x197a53){return function(_0x2f3413){if(_0x2f3413){var _0x5413b3=typeof _0x197a53['offset']===_0x6fd3('0x1c')&&typeof _0x197a53[_0x6fd3('0x1d')]===_0x6fd3('0x1c');var _0x32496e=_0x2f3413[_0x6fd3('0x1e')];var _0x1558ee=_0x5413b3?0x0:_0x197a53[_0x6fd3('0x1f')];var _0x20949b=_0x5413b3?_0x2f3413[_0x6fd3('0x1e')]:_0x197a53[_0x6fd3('0x1f')]+_0x197a53[_0x6fd3('0x1d')];var _0x2302eb;if(_0x20949b>=_0x32496e){_0x20949b=_0x32496e;_0x2302eb=0xc8;}else{_0x2302eb=0xce;}_0x282721['status'](_0x2302eb);return _0x282721[_0x6fd3('0x20')](_0x6fd3('0x21'),_0x1558ee+'-'+_0x20949b+'/'+_0x32496e)['json'](_0x2f3413);}return null;};}function patchUpdates(_0x56375b){return function(_0x4e8aaa){try{jsonpatch[_0x6fd3('0x22')](_0x4e8aaa,_0x56375b,!![]);}catch(_0x3830fc){return BPromise[_0x6fd3('0x23')](_0x3830fc);}return _0x4e8aaa['save']();};}function saveUpdates(_0x5c446a,_0x1d40db){return function(_0x2a0e6e){if(_0x2a0e6e){return _0x2a0e6e[_0x6fd3('0x24')](_0x5c446a)[_0x6fd3('0x25')](function(_0x1026f8){return _0x1026f8;});}return null;};}function removeEntity(_0x5492a0,_0x2bf0c8){return function(_0x1aeacc){if(_0x1aeacc){return _0x1aeacc[_0x6fd3('0x26')]()['then'](function(){_0x5492a0[_0x6fd3('0x19')](0xcc)[_0x6fd3('0x1a')]();});}};}function handleEntityNotFound(_0x6d8f40,_0x57c1f4){return function(_0x37655d){if(!_0x37655d){_0x6d8f40[_0x6fd3('0x18')](0x194);}return _0x37655d;};}function handleError(_0x4ccba3,_0x4b5a04){_0x4b5a04=_0x4b5a04||0x1f4;return function(_0x42ac8b){logger[_0x6fd3('0x27')](_0x42ac8b[_0x6fd3('0x28')]);if(_0x42ac8b[_0x6fd3('0x29')]){delete _0x42ac8b[_0x6fd3('0x29')];}_0x4ccba3[_0x6fd3('0x19')](_0x4b5a04)[_0x6fd3('0x2a')](_0x42ac8b);};}exports[_0x6fd3('0x2b')]=function(_0x4e5b66,_0x15c4b6){var _0x384a62={},_0x2066a5={},_0x201f11={'count':0x0,'rows':[]};var _0x36e089=_['map'](db[_0x6fd3('0x2c')]['rawAttributes'],function(_0x1a231f){return{'name':_0x1a231f['fieldName'],'type':_0x1a231f[_0x6fd3('0x2d')][_0x6fd3('0x2e')]};});_0x2066a5[_0x6fd3('0x2f')]=_[_0x6fd3('0x30')](_0x36e089,'name');_0x2066a5[_0x6fd3('0x31')]=_[_0x6fd3('0x32')](_0x4e5b66[_0x6fd3('0x31')]);_0x2066a5['filters']=_['intersection'](_0x2066a5[_0x6fd3('0x2f')],_0x2066a5[_0x6fd3('0x31')]);_0x384a62[_0x6fd3('0x33')]=_[_0x6fd3('0x34')](_0x2066a5[_0x6fd3('0x2f')],qs[_0x6fd3('0x35')](_0x4e5b66[_0x6fd3('0x31')]['fields']));_0x384a62[_0x6fd3('0x33')]=_0x384a62[_0x6fd3('0x33')][_0x6fd3('0x36')]?_0x384a62[_0x6fd3('0x33')]:_0x2066a5[_0x6fd3('0x2f')];if(!_0x4e5b66[_0x6fd3('0x31')][_0x6fd3('0x37')](_0x6fd3('0x38'))){_0x384a62[_0x6fd3('0x1d')]=qs['limit'](_0x4e5b66[_0x6fd3('0x31')][_0x6fd3('0x1d')]);_0x384a62[_0x6fd3('0x1f')]=qs['offset'](_0x4e5b66[_0x6fd3('0x31')]['offset']);}_0x384a62[_0x6fd3('0x39')]=qs[_0x6fd3('0x3a')](_0x4e5b66['query'][_0x6fd3('0x3a')]);_0x384a62[_0x6fd3('0x3b')]=qs[_0x6fd3('0x3c')](_['pick'](_0x4e5b66[_0x6fd3('0x31')],_0x2066a5['filters']),_0x36e089);if(_0x4e5b66['query'][_0x6fd3('0x3d')]){_0x384a62[_0x6fd3('0x3b')]=_[_0x6fd3('0x3e')](_0x384a62[_0x6fd3('0x3b')],{'$or':_['map'](_0x36e089,function(_0x4ef883){if(_0x4ef883[_0x6fd3('0x2d')]!==_0x6fd3('0x3f')){var _0x2dd907={};_0x2dd907[_0x4ef883[_0x6fd3('0x29')]]={'$like':'%'+_0x4e5b66[_0x6fd3('0x31')][_0x6fd3('0x3d')]+'%'};return _0x2dd907;}})});}_0x384a62=_['merge']({},_0x384a62,_0x4e5b66[_0x6fd3('0x40')]);var _0x5b2ca3={'where':_0x384a62[_0x6fd3('0x3b')]};return db[_0x6fd3('0x2c')]['count'](_0x5b2ca3)['then'](function(_0x8e5587){_0x201f11[_0x6fd3('0x1e')]=_0x8e5587;if(_0x4e5b66['query'][_0x6fd3('0x41')]){_0x384a62[_0x6fd3('0x42')]=[{'all':!![]}];}return db['Migration'][_0x6fd3('0x43')](_0x384a62);})[_0x6fd3('0x25')](function(_0x52b079){_0x201f11[_0x6fd3('0x44')]=_0x52b079;return _0x201f11;})[_0x6fd3('0x25')](respondWithFilteredResult(_0x15c4b6,_0x384a62))['catch'](handleError(_0x15c4b6,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 6214f60..dcdf6e0 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 _0x7c1d=['api','moment','bluebird','request-promise','path','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger'];(function(_0x1beab1,_0x27951e){var _0x4fbc4f=function(_0xfaf85a){while(--_0xfaf85a){_0x1beab1['push'](_0x1beab1['shift']());}};_0x4fbc4f(++_0x27951e);}(_0x7c1d,0x82));var _0xd7c1=function(_0x52fa96,_0x520949){_0x52fa96=_0x52fa96-0x0;var _0x370b00=_0x7c1d[_0x52fa96];return _0x370b00;};'use strict';var _=require('lodash');var util=require(_0xd7c1('0x0'));var logger=require(_0xd7c1('0x1'))(_0xd7c1('0x2'));var moment=require(_0xd7c1('0x3'));var BPromise=require(_0xd7c1('0x4'));var rp=require(_0xd7c1('0x5'));var fs=require('fs');var path=require(_0xd7c1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7c1('0x7'));module[_0xd7c1('0x8')]=function(_0x4a17b2,_0x5dc871){return _0x4a17b2[_0xd7c1('0x9')](_0xd7c1('0xa'),attributes,{'tableName':_0xd7c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33c6=['request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','lodash','util','../../config/logger','moment','bluebird'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x33c6,0x1dc));var _0x633c=function(_0x3d8fe3,_0x17ef11){_0x3d8fe3=_0x3d8fe3-0x0;var _0xcf40d1=_0x33c6[_0x3d8fe3];return _0xcf40d1;};'use strict';var _=require(_0x633c('0x0'));var util=require(_0x633c('0x1'));var logger=require(_0x633c('0x2'))('api');var moment=require(_0x633c('0x3'));var BPromise=require(_0x633c('0x4'));var rp=require(_0x633c('0x5'));var fs=require('fs');var path=require(_0x633c('0x6'));var rimraf=require(_0x633c('0x7'));var config=require(_0x633c('0x8'));var attributes=require(_0x633c('0x9'));module[_0x633c('0xa')]=function(_0x49ba13,_0xe046ad){return _0x49ba13[_0x633c('0xb')](_0x633c('0xc'),attributes,{'tableName':'migrations','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 2757542..c577475 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 _0xf12a=['info','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','code','error','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xf12a,0x8e));var _0xaf12=function(_0xdafc1b,_0x2e33a2){_0xdafc1b=_0xdafc1b-0x0;var _0x31de5b=_0xf12a[_0xdafc1b];return _0x31de5b;};'use strict';var _=require(_0xaf12('0x0'));var util=require(_0xaf12('0x1'));var moment=require(_0xaf12('0x2'));var BPromise=require(_0xaf12('0x3'));var rs=require(_0xaf12('0x4'));var fs=require('fs');var Redis=require(_0xaf12('0x5'));var db=require(_0xaf12('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaf12('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf12('0x8'));var client=jayson['client'][_0xaf12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x581819,_0x38389d,_0x418c64){return new BPromise(function(_0x3b6626,_0xff1952){return client[_0xaf12('0xa')](_0x581819,_0x418c64)[_0xaf12('0xb')](function(_0x3d733d){logger[_0xaf12('0xc')]('Migration,\x20%s,\x20%s',_0x38389d,_0xaf12('0xd'));logger['debug'](_0xaf12('0xe'),_0x38389d,'request\x20sent',JSON[_0xaf12('0xf')](_0x3d733d));if(_0x3d733d['error']){if(_0x3d733d['error'][_0xaf12('0x10')]===0x1f4){logger[_0xaf12('0x11')](_0xaf12('0x12'),_0x38389d,_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);return _0xff1952(_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);}logger[_0xaf12('0x11')](_0xaf12('0x12'),_0x38389d,_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);return _0x3b6626(_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);}else{logger[_0xaf12('0xc')](_0xaf12('0x12'),_0x38389d,_0xaf12('0xd'));_0x3b6626(_0x3d733d[_0xaf12('0x14')]['message']);}})[_0xaf12('0x15')](function(_0x31a420){logger['error']('Migration,\x20%s,\x20%s',_0x38389d,_0x31a420);_0xff1952(_0x31a420);});});} \ No newline at end of file +var _0x44d4=['http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0x4e944b,_0x3e910f){var _0x4eec32=function(_0x1c8286){while(--_0x1c8286){_0x4e944b['push'](_0x4e944b['shift']());}};_0x4eec32(++_0x3e910f);}(_0x44d4,0x161));var _0x444d=function(_0x299392,_0x3eb1f9){_0x299392=_0x299392-0x0;var _0x4a0f4f=_0x44d4[_0x299392];return _0x4a0f4f;};'use strict';var _=require(_0x444d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x444d('0x1'));var fs=require('fs');var Redis=require(_0x444d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x444d('0x3'));var config=require(_0x444d('0x4'));var jayson=require(_0x444d('0x5'));var client=jayson[_0x444d('0x6')][_0x444d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33fe8c,_0x300f01,_0x58e34d){return new BPromise(function(_0x38938a,_0x56e84b){return client[_0x444d('0x8')](_0x33fe8c,_0x58e34d)[_0x444d('0x9')](function(_0x87d3e8){logger[_0x444d('0xa')](_0x444d('0xb'),_0x300f01,_0x444d('0xc'));logger[_0x444d('0xd')](_0x444d('0xe'),_0x300f01,_0x444d('0xc'),JSON[_0x444d('0xf')](_0x87d3e8));if(_0x87d3e8[_0x444d('0x10')]){if(_0x87d3e8['error'][_0x444d('0x11')]===0x1f4){logger[_0x444d('0x10')]('Migration,\x20%s,\x20%s',_0x300f01,_0x87d3e8[_0x444d('0x10')][_0x444d('0x12')]);return _0x56e84b(_0x87d3e8[_0x444d('0x10')]['message']);}logger[_0x444d('0x10')](_0x444d('0xb'),_0x300f01,_0x87d3e8[_0x444d('0x10')]['message']);return _0x38938a(_0x87d3e8[_0x444d('0x10')]['message']);}else{logger[_0x444d('0xa')](_0x444d('0xb'),_0x300f01,_0x444d('0xc'));_0x38938a(_0x87d3e8[_0x444d('0x13')]['message']);}})['catch'](function(_0x4da5e3){logger['error'](_0x444d('0xb'),_0x300f01,_0x4da5e3);_0x56e84b(_0x4da5e3);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 8cd8267..82a25fd 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 _0xba6f=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','show','put','/:id'];(function(_0x1107cd,_0x69d5cb){var _0x104de2=function(_0x52b364){while(--_0x52b364){_0x1107cd['push'](_0x1107cd['shift']());}};_0x104de2(++_0x69d5cb);}(_0xba6f,0x1d0));var _0xfba6=function(_0x37d225,_0x2ed664){_0x37d225=_0x37d225-0x0;var _0x26834b=_0xba6f[_0x37d225];return _0x26834b;};'use strict';var multer=require(_0xfba6('0x0'));var util=require('util');var path=require(_0xfba6('0x1'));var timeout=require(_0xfba6('0x2'));var express=require(_0xfba6('0x3'));var router=express[_0xfba6('0x4')]();var fs_extra=require(_0xfba6('0x5'));var auth=require(_0xfba6('0x6'));var interaction=require(_0xfba6('0x7'));var config=require(_0xfba6('0x8'));var controller=require(_0xfba6('0x9'));router[_0xfba6('0xa')]('/',auth[_0xfba6('0xb')](),controller[_0xfba6('0xc')]);router[_0xfba6('0xa')]('/:id',auth[_0xfba6('0xb')](),controller[_0xfba6('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfba6('0xe')](_0xfba6('0xf'),auth[_0xfba6('0xb')](),controller[_0xfba6('0x10')]);router[_0xfba6('0x11')](_0xfba6('0xf'),auth[_0xfba6('0xb')](),controller[_0xfba6('0x12')]);module[_0xfba6('0x13')]=router; \ No newline at end of file +var _0xdfa0=['get','isAuthenticated','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3cd133,_0x222fcb){var _0x2512c8=function(_0x484491){while(--_0x484491){_0x3cd133['push'](_0x3cd133['shift']());}};_0x2512c8(++_0x222fcb);}(_0xdfa0,0x69));var _0x0dfa=function(_0x10c358,_0x952b41){_0x10c358=_0x10c358-0x0;var _0x53ed9d=_0xdfa0[_0x10c358];return _0x53ed9d;};'use strict';var multer=require(_0x0dfa('0x0'));var util=require('util');var path=require(_0x0dfa('0x1'));var timeout=require(_0x0dfa('0x2'));var express=require('express');var router=express[_0x0dfa('0x3')]();var fs_extra=require(_0x0dfa('0x4'));var auth=require(_0x0dfa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0dfa('0x6'));var controller=require('./network.controller');router[_0x0dfa('0x7')]('/',auth[_0x0dfa('0x8')](),controller['index']);router[_0x0dfa('0x7')](_0x0dfa('0x9'),auth[_0x0dfa('0x8')](),controller[_0x0dfa('0xa')]);router[_0x0dfa('0xb')]('/',auth['isAuthenticated'](),controller[_0x0dfa('0xc')]);router[_0x0dfa('0xd')](_0x0dfa('0x9'),auth['isAuthenticated'](),controller[_0x0dfa('0xe')]);router['delete'](_0x0dfa('0x9'),auth[_0x0dfa('0x8')](),controller[_0x0dfa('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 3d96c47..cc472fa 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 _0xfeeb=['ENUM','localnet','externip','stun','STRING','sequelize','exports'];(function(_0x3b2365,_0x14f220){var _0x1379b8=function(_0x1e72fa){while(--_0x1e72fa){_0x3b2365['push'](_0x3b2365['shift']());}};_0x1379b8(++_0x14f220);}(_0xfeeb,0x186));var _0xbfee=function(_0x18f458,_0x1424eb){_0x18f458=_0x18f458-0x0;var _0x206e01=_0xfeeb[_0x18f458];return _0x206e01;};'use strict';var Sequelize=require(_0xbfee('0x0'));module[_0xbfee('0x1')]={'type':{'type':Sequelize[_0xbfee('0x2')](_0xbfee('0x3'),_0xbfee('0x4'),_0xbfee('0x5'),'turn')},'value':{'type':Sequelize[_0xbfee('0x6')]},'username':{'type':Sequelize[_0xbfee('0x6')]},'password':{'type':Sequelize[_0xbfee('0x6')]}}; \ No newline at end of file +var _0x3876=['exports','ENUM','localnet','externip','stun','STRING','sequelize'];(function(_0x364c24,_0x341bdf){var _0x4387dc=function(_0x11749b){while(--_0x11749b){_0x364c24['push'](_0x364c24['shift']());}};_0x4387dc(++_0x341bdf);}(_0x3876,0x92));var _0x6387=function(_0x375baa,_0x5ccc3c){_0x375baa=_0x375baa-0x0;var _0x5f1f13=_0x3876[_0x375baa];return _0x5f1f13;};'use strict';var Sequelize=require(_0x6387('0x0'));module[_0x6387('0x1')]={'type':{'type':Sequelize[_0x6387('0x2')](_0x6387('0x3'),_0x6387('0x4'),_0x6387('0x5'),'turn')},'value':{'type':Sequelize[_0x6387('0x6')]},'username':{'type':Sequelize[_0x6387('0x6')]},'password':{'type':Sequelize[_0x6387('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index f8b953b..6ed466d 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 _0xb6a0=['pick','filters','filter','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','options','find','create','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','STUN','toLowerCase','chan_sip.so','destroy','server/files/templates/turn_multiple.ejs','util','path','ejs','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','json','offset','undefined','count','set','Content-Range','update','end','sendStatus','name','send','index','map','Network','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x50cf46,_0x4c7e15){var _0x118e26=function(_0x46083e){while(--_0x46083e){_0x50cf46['push'](_0x50cf46['shift']());}};_0x118e26(++_0x4c7e15);}(_0xb6a0,0x126));var _0x0b6a=function(_0x47afb2,_0x42dad3){_0x47afb2=_0x47afb2-0x0;var _0x39486a=_0xb6a0[_0x47afb2];return _0x39486a;};'use strict';var util=require(_0x0b6a('0x0'));var path=require(_0x0b6a('0x1'));var ejs=require(_0x0b6a('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0x0b6a('0x3'));var logger=require(_0x0b6a('0x4'))(_0x0b6a('0x5'));var config=require('../../config/environment');var db=require(_0x0b6a('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x0b6a('0x7')][_0x0b6a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2faea4,_0x422d76,_0x16dd40,_0x73dc3d){return new Promise(function(_0x248faa,_0xf3ca34){var _0x464003=_0x73dc3d||client;return _0x464003[_0x0b6a('0x9')](_0x2faea4,_0x16dd40)[_0x0b6a('0xa')](function(_0x30e8e1){logger[_0x0b6a('0xb')](_0x0b6a('0xc'),_0x422d76,_0x0b6a('0xd'));logger[_0x0b6a('0xe')]('Network,\x20%s,\x20%s,\x20%s',_0x422d76,_0x0b6a('0xd'),JSON[_0x0b6a('0xf')](_0x30e8e1));if(_0x30e8e1[_0x0b6a('0x10')]){if(_0x30e8e1['error']['code']===0x1f4){logger[_0x0b6a('0x10')](_0x0b6a('0xc'),_0x422d76,_0x30e8e1[_0x0b6a('0x10')][_0x0b6a('0x11')]);return _0xf3ca34(_0x30e8e1[_0x0b6a('0x10')][_0x0b6a('0x11')]);}logger[_0x0b6a('0x10')](_0x0b6a('0xc'),_0x422d76,_0x30e8e1[_0x0b6a('0x10')][_0x0b6a('0x11')]);return _0x248faa(_0x30e8e1[_0x0b6a('0x10')][_0x0b6a('0x11')]);}else{logger['info'](_0x0b6a('0xc'),_0x422d76,'request\x20sent');_0x248faa(_0x30e8e1[_0x0b6a('0x12')][_0x0b6a('0x11')]);}})[_0x0b6a('0x13')](function(_0x3c6bfd){logger[_0x0b6a('0x10')](_0x0b6a('0xc'),_0x422d76,_0x3c6bfd);_0xf3ca34(_0x3c6bfd);});});}function respondWithResult(_0x40d786,_0x1152b0){_0x1152b0=_0x1152b0||0xc8;return function(_0x38214e){if(_0x38214e){return _0x40d786[_0x0b6a('0x14')](_0x1152b0)[_0x0b6a('0x15')](_0x38214e);}};}function respondWithFilteredResult(_0x4aea5e,_0x1dec83){return function(_0x182ff3){if(_0x182ff3){var _0x48d044=typeof _0x1dec83[_0x0b6a('0x16')]===_0x0b6a('0x17')&&typeof _0x1dec83['limit']===_0x0b6a('0x17');var _0x5b891e=_0x182ff3[_0x0b6a('0x18')];var _0x4d1220=_0x48d044?0x0:_0x1dec83[_0x0b6a('0x16')];var _0x30a908=_0x48d044?_0x182ff3['count']:_0x1dec83['offset']+_0x1dec83['limit'];var _0x5957b4;if(_0x30a908>=_0x5b891e){_0x30a908=_0x5b891e;_0x5957b4=0xc8;}else{_0x5957b4=0xce;}_0x4aea5e[_0x0b6a('0x14')](_0x5957b4);return _0x4aea5e[_0x0b6a('0x19')](_0x0b6a('0x1a'),_0x4d1220+'-'+_0x30a908+'/'+_0x5b891e)['json'](_0x182ff3);}return null;};}function saveUpdates(_0x56442c){return function(_0x30ddec){if(_0x30ddec){return _0x30ddec[_0x0b6a('0x1b')](_0x56442c)[_0x0b6a('0xa')](function(_0x498501){return _0x498501;});}return null;};}function removeEntity(_0x1fadc4){return function(_0x1624f8){if(_0x1624f8){return _0x1624f8['destroy']()[_0x0b6a('0xa')](function(){_0x1fadc4[_0x0b6a('0x14')](0xcc)[_0x0b6a('0x1c')]();});}};}function handleEntityNotFound(_0x48244f){return function(_0x51ddfb){if(!_0x51ddfb){_0x48244f[_0x0b6a('0x1d')](0x194);}return _0x51ddfb;};}function handleError(_0x467fa2,_0x240348){_0x240348=_0x240348||0x1f4;return function(_0x18d10e){logger[_0x0b6a('0x10')](_0x18d10e['stack']);if(_0x18d10e[_0x0b6a('0x1e')]){delete _0x18d10e[_0x0b6a('0x1e')];}_0x467fa2[_0x0b6a('0x14')](_0x240348)[_0x0b6a('0x1f')](_0x18d10e);};}exports[_0x0b6a('0x20')]=function(_0x11b11b,_0x552b83){var _0xd49254={},_0x5a96b2={},_0x666a51={'count':0x0,'rows':[]};var _0x4f38a1=_[_0x0b6a('0x21')](db[_0x0b6a('0x22')][_0x0b6a('0x23')],function(_0x112ed4){return{'name':_0x112ed4[_0x0b6a('0x24')],'type':_0x112ed4[_0x0b6a('0x25')]['key']};});_0x5a96b2[_0x0b6a('0x26')]=_[_0x0b6a('0x21')](_0x4f38a1,'name');_0x5a96b2[_0x0b6a('0x27')]=_[_0x0b6a('0x28')](_0x11b11b[_0x0b6a('0x27')]);_0x5a96b2['filters']=_[_0x0b6a('0x29')](_0x5a96b2[_0x0b6a('0x26')],_0x5a96b2[_0x0b6a('0x27')]);_0xd49254[_0x0b6a('0x2a')]=_[_0x0b6a('0x29')](_0x5a96b2[_0x0b6a('0x26')],qs[_0x0b6a('0x2b')](_0x11b11b[_0x0b6a('0x27')][_0x0b6a('0x2b')]));_0xd49254[_0x0b6a('0x2a')]=_0xd49254[_0x0b6a('0x2a')]['length']?_0xd49254[_0x0b6a('0x2a')]:_0x5a96b2[_0x0b6a('0x26')];if(!_0x11b11b[_0x0b6a('0x27')][_0x0b6a('0x2c')](_0x0b6a('0x2d'))){_0xd49254[_0x0b6a('0x2e')]=qs[_0x0b6a('0x2e')](_0x11b11b['query'][_0x0b6a('0x2e')]);_0xd49254['offset']=qs[_0x0b6a('0x16')](_0x11b11b[_0x0b6a('0x27')][_0x0b6a('0x16')]);}_0xd49254[_0x0b6a('0x2f')]=qs['sort'](_0x11b11b[_0x0b6a('0x27')][_0x0b6a('0x30')]);_0xd49254[_0x0b6a('0x31')]=qs['filters'](_[_0x0b6a('0x32')](_0x11b11b[_0x0b6a('0x27')],_0x5a96b2[_0x0b6a('0x33')]),_0x4f38a1);if(_0x11b11b[_0x0b6a('0x27')][_0x0b6a('0x34')]){_0xd49254[_0x0b6a('0x31')]=_[_0x0b6a('0x35')](_0xd49254[_0x0b6a('0x31')],{'$or':_[_0x0b6a('0x21')](_0x4f38a1,function(_0x4014ee){if(_0x4014ee['type']!==_0x0b6a('0x36')){var _0x5775b8={};_0x5775b8[_0x4014ee[_0x0b6a('0x1e')]]={'$like':'%'+_0x11b11b[_0x0b6a('0x27')]['filter']+'%'};return _0x5775b8;}})});}_0xd49254=_[_0x0b6a('0x35')]({},_0xd49254,_0x11b11b['options']);var _0xd238fb={'where':_0xd49254[_0x0b6a('0x31')]};return db[_0x0b6a('0x22')][_0x0b6a('0x18')](_0xd238fb)[_0x0b6a('0xa')](function(_0x1b5496){_0x666a51[_0x0b6a('0x18')]=_0x1b5496;if(_0x11b11b[_0x0b6a('0x27')]['includeAll']){_0xd49254[_0x0b6a('0x37')]=[{'all':!![]}];}return db['Network'][_0x0b6a('0x38')](_0xd49254);})[_0x0b6a('0xa')](function(_0x35904e){_0x666a51[_0x0b6a('0x39')]=_0x35904e;return _0x666a51;})['then'](respondWithFilteredResult(_0x552b83,_0xd49254))['catch'](handleError(_0x552b83,null));};exports[_0x0b6a('0x3a')]=function(_0x260f07,_0x39d66b){var _0x53c4ff={'raw':!![],'where':{'id':_0x260f07[_0x0b6a('0x3b')]['id']}},_0x34cdeb={};_0x34cdeb['model']=_[_0x0b6a('0x28')](db[_0x0b6a('0x22')]['rawAttributes']);_0x34cdeb[_0x0b6a('0x27')]=_[_0x0b6a('0x28')](_0x260f07[_0x0b6a('0x27')]);_0x34cdeb['filters']=_[_0x0b6a('0x29')](_0x34cdeb[_0x0b6a('0x26')],_0x34cdeb[_0x0b6a('0x27')]);_0x53c4ff[_0x0b6a('0x2a')]=_[_0x0b6a('0x29')](_0x34cdeb[_0x0b6a('0x26')],qs[_0x0b6a('0x2b')](_0x260f07[_0x0b6a('0x27')][_0x0b6a('0x2b')]));_0x53c4ff[_0x0b6a('0x2a')]=_0x53c4ff[_0x0b6a('0x2a')]['length']?_0x53c4ff['attributes']:_0x34cdeb['model'];if(_0x260f07[_0x0b6a('0x27')][_0x0b6a('0x3c')]){_0x53c4ff[_0x0b6a('0x37')]=[{'all':!![]}];}_0x53c4ff=_[_0x0b6a('0x35')]({},_0x53c4ff,_0x260f07[_0x0b6a('0x3d')]);return db[_0x0b6a('0x22')][_0x0b6a('0x3e')](_0x53c4ff)[_0x0b6a('0xa')](handleEntityNotFound(_0x39d66b,null))[_0x0b6a('0xa')](respondWithResult(_0x39d66b,null))[_0x0b6a('0x13')](handleError(_0x39d66b,null));};exports[_0x0b6a('0x3f')]=function(_0xc7a7ff,_0x4fb1b2){var _0x2af718;return db[_0x0b6a('0x22')][_0x0b6a('0x3f')](_0xc7a7ff[_0x0b6a('0x40')],{'raw':!![]})[_0x0b6a('0xa')](function(_0x17146c){_0x2af718=_0x17146c;return db['Network']['findAll']({'where':{'type':_0xc7a7ff['body'][_0x0b6a('0x25')]},'raw':!![]});})[_0x0b6a('0xa')](function(_0x104903){if(_0x2af718[_0x0b6a('0x25')][_0x0b6a('0x41')]()=='STUN'){var _0x2b1ea4=fs[_0x0b6a('0x42')](path[_0x0b6a('0x43')](config[_0x0b6a('0x44')],_0x0b6a('0x45')),'utf8');var _0x4cc8d9=ejs[_0x0b6a('0x46')](_0x2b1ea4,{'networks':_0x104903||[]});fs[_0x0b6a('0x47')](_0x0b6a('0x48'),_0x4cc8d9);return respondWithRpcPromise(_0x0b6a('0x49'),_0x0b6a('0x3f'),{'module':_0x0b6a('0x4a')});}else if(_0x2af718[_0x0b6a('0x25')][_0x0b6a('0x41')]()==_0x0b6a('0x4b')){var _0x1387aa=fs[_0x0b6a('0x42')](path[_0x0b6a('0x43')](config[_0x0b6a('0x44')],'server/files/templates/turn_multiple.ejs'),_0x0b6a('0x4c'));var _0x99015f=ejs[_0x0b6a('0x46')](_0x1387aa,{'networks':_0x104903||[]});fs[_0x0b6a('0x47')](_0x0b6a('0x4d'),_0x99015f);return respondWithRpcPromise(_0x0b6a('0x49'),_0x0b6a('0x3f'),{'module':_0x0b6a('0x4a')});}else{var _0x3b3697=fs['readFileSync'](path[_0x0b6a('0x43')](config[_0x0b6a('0x44')],_0x0b6a('0x4e')),_0x0b6a('0x4c'));var _0x279de4=ejs[_0x0b6a('0x46')](_0x3b3697,{'networks':_0x104903||[]});fs['writeFileSync'](util[_0x0b6a('0x4f')](_0x0b6a('0x50'),_0xc7a7ff[_0x0b6a('0x40')][_0x0b6a('0x25')]['toLowerCase']()),_0x279de4);return respondWithRpcPromise(_0x0b6a('0x49'),_0x0b6a('0x3f'),{'module':'chan_sip.so'});}})['then'](function(){return _0x2af718;})[_0x0b6a('0xa')](respondWithResult(_0x4fb1b2,0xc9))[_0x0b6a('0x13')](handleError(_0x4fb1b2,null));};exports[_0x0b6a('0x1b')]=function(_0x1b2174,_0x8838cf){var _0x1055fc;return db[_0x0b6a('0x22')][_0x0b6a('0x3e')]({'where':{'id':_0x1b2174[_0x0b6a('0x3b')]['id']}})['then'](handleEntityNotFound(_0x8838cf,null))['then'](saveUpdates(_0x1b2174['body'],null))['then'](function(_0x4d7a76){if(_0x4d7a76){_0x1055fc=_0x4d7a76;return db[_0x0b6a('0x22')][_0x0b6a('0x38')]({'where':{'type':_0x1055fc[_0x0b6a('0x25')]},'raw':!![]});}return null;})[_0x0b6a('0xa')](function(_0x424cb8){if(_0x1055fc[_0x0b6a('0x25')][_0x0b6a('0x41')]()==_0x0b6a('0x51')){var _0x6c0ddf=fs[_0x0b6a('0x42')](path[_0x0b6a('0x43')](config[_0x0b6a('0x44')],_0x0b6a('0x45')),_0x0b6a('0x4c'));var _0x34728d=ejs[_0x0b6a('0x46')](_0x6c0ddf,{'networks':_0x424cb8||[]});fs[_0x0b6a('0x47')](_0x0b6a('0x48'),_0x34728d);return respondWithRpcPromise(_0x0b6a('0x49'),_0x0b6a('0x1b'),{'module':_0x0b6a('0x4a')});}else if(_0x1055fc[_0x0b6a('0x25')][_0x0b6a('0x41')]()=='TURN'){var _0x3eb444=fs['readFileSync'](path[_0x0b6a('0x43')](config[_0x0b6a('0x44')],'server/files/templates/turn_multiple.ejs'),_0x0b6a('0x4c'));var _0x61823f=ejs[_0x0b6a('0x46')](_0x3eb444,{'networks':_0x424cb8||[]});fs['writeFileSync'](_0x0b6a('0x4d'),_0x61823f);return respondWithRpcPromise('Reload',_0x0b6a('0x1b'),{'module':'res_stun_monitor.so'});}else{var _0x12d980=fs['readFileSync'](path[_0x0b6a('0x43')](config[_0x0b6a('0x44')],'server/files/templates/network.ejs'),'utf8');var _0x5aac6a=ejs[_0x0b6a('0x46')](_0x12d980,{'networks':_0x424cb8||[]});fs[_0x0b6a('0x47')](util[_0x0b6a('0x4f')](_0x0b6a('0x50'),_0x1b2174[_0x0b6a('0x40')][_0x0b6a('0x25')][_0x0b6a('0x52')]()),_0x5aac6a);return respondWithRpcPromise(_0x0b6a('0x49'),_0x0b6a('0x1b'),{'module':_0x0b6a('0x53')});}})[_0x0b6a('0xa')](function(_0x10cd1a){if(_0x10cd1a){return _0x1055fc;}return null;})[_0x0b6a('0xa')](respondWithResult(_0x8838cf,null))[_0x0b6a('0x13')](handleError(_0x8838cf,null));};exports[_0x0b6a('0x54')]=function(_0x381b01,_0x199be1){var _0xf03b9d;return db[_0x0b6a('0x22')]['find']({'where':{'id':_0x381b01[_0x0b6a('0x3b')]['id']}})[_0x0b6a('0xa')](function(_0x16b18c){_0xf03b9d=_0x16b18c;return _0x16b18c;})[_0x0b6a('0xa')](handleEntityNotFound(_0x199be1,null))[_0x0b6a('0xa')](removeEntity(_0x199be1,null))[_0x0b6a('0xa')](function(){if(_0xf03b9d){return db[_0x0b6a('0x22')][_0x0b6a('0x38')]({'where':{'type':_0xf03b9d[_0x0b6a('0x25')]},'raw':!![]});}})[_0x0b6a('0xa')](function(_0x1ef954){if(_0xf03b9d[_0x0b6a('0x25')]['toUpperCase']()==_0x0b6a('0x51')){var _0x2aadb7=fs['readFileSync'](path[_0x0b6a('0x43')](config[_0x0b6a('0x44')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x40d370=ejs['render'](_0x2aadb7,{'networks':_0x1ef954||[]});fs[_0x0b6a('0x47')]('/etc/asterisk/stun_xcally.conf',_0x40d370);return respondWithRpcPromise('Reload',_0x0b6a('0x54'),{'module':'res_stun_monitor.so'});}else if(_0xf03b9d[_0x0b6a('0x25')][_0x0b6a('0x41')]()==_0x0b6a('0x4b')){var _0x309198=fs['readFileSync'](path[_0x0b6a('0x43')](config[_0x0b6a('0x44')],_0x0b6a('0x55')),_0x0b6a('0x4c'));var _0x5fda87=ejs[_0x0b6a('0x46')](_0x309198,{'networks':_0x1ef954||[]});fs[_0x0b6a('0x47')]('/etc/asterisk/turn_xcally.conf',_0x5fda87);return respondWithRpcPromise(_0x0b6a('0x49'),_0x0b6a('0x54'),{'module':'res_stun_monitor.so'});}else{var _0x3b67d5=fs[_0x0b6a('0x42')](path[_0x0b6a('0x43')](config[_0x0b6a('0x44')],_0x0b6a('0x4e')),'utf8');var _0x316c6c=ejs[_0x0b6a('0x46')](_0x3b67d5,{'networks':_0x1ef954||[]});fs['writeFileSync'](util[_0x0b6a('0x4f')](_0x0b6a('0x50'),_0xf03b9d[_0x0b6a('0x25')][_0x0b6a('0x52')]()),_0x316c6c);return respondWithRpcPromise(_0x0b6a('0x49'),_0x0b6a('0x54'),{'module':_0x0b6a('0x53')});}})[_0x0b6a('0x13')](handleError(_0x199be1,null));}; \ No newline at end of file +var _0x0f5e=['code','message','catch','json','undefined','limit','count','offset','status','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','send','index','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','options','includeAll','include','findAll','rows','show','params','merge','find','create','body','readFileSync','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','join','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','toUpperCase','server/files/templates/network.ejs','format','STUN','/etc/asterisk/turn_xcally.conf','util','path','ejs','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','client','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x205b46,_0x3ca65b){var _0x2b6ae8=function(_0x1f4ae9){while(--_0x1f4ae9){_0x205b46['push'](_0x205b46['shift']());}};_0x2b6ae8(++_0x3ca65b);}(_0x0f5e,0x187));var _0xe0f5=function(_0x395ca2,_0x5d218b){_0x395ca2=_0x395ca2-0x0;var _0x393e98=_0x0f5e[_0x395ca2];return _0x393e98;};'use strict';var util=require(_0xe0f5('0x0'));var path=require(_0xe0f5('0x1'));var ejs=require(_0xe0f5('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0xe0f5('0x3'));var logger=require(_0xe0f5('0x4'))('api');var config=require(_0xe0f5('0x5'));var db=require(_0xe0f5('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe0f5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f04b1,_0x2553ad,_0x4ee0d9,_0x2eeecb){return new Promise(function(_0x108653,_0x18cf80){var _0x49e566=_0x2eeecb||client;return _0x49e566['request'](_0x3f04b1,_0x4ee0d9)['then'](function(_0x50a0e0){logger[_0xe0f5('0x8')](_0xe0f5('0x9'),_0x2553ad,_0xe0f5('0xa'));logger[_0xe0f5('0xb')]('Network,\x20%s,\x20%s,\x20%s',_0x2553ad,'request\x20sent',JSON[_0xe0f5('0xc')](_0x50a0e0));if(_0x50a0e0['error']){if(_0x50a0e0[_0xe0f5('0xd')][_0xe0f5('0xe')]===0x1f4){logger[_0xe0f5('0xd')](_0xe0f5('0x9'),_0x2553ad,_0x50a0e0[_0xe0f5('0xd')]['message']);return _0x18cf80(_0x50a0e0[_0xe0f5('0xd')]['message']);}logger[_0xe0f5('0xd')](_0xe0f5('0x9'),_0x2553ad,_0x50a0e0[_0xe0f5('0xd')][_0xe0f5('0xf')]);return _0x108653(_0x50a0e0['error'][_0xe0f5('0xf')]);}else{logger[_0xe0f5('0x8')](_0xe0f5('0x9'),_0x2553ad,'request\x20sent');_0x108653(_0x50a0e0['result'][_0xe0f5('0xf')]);}})[_0xe0f5('0x10')](function(_0x178ede){logger[_0xe0f5('0xd')](_0xe0f5('0x9'),_0x2553ad,_0x178ede);_0x18cf80(_0x178ede);});});}function respondWithResult(_0xb65169,_0x4cf267){_0x4cf267=_0x4cf267||0xc8;return function(_0x5107aa){if(_0x5107aa){return _0xb65169['status'](_0x4cf267)[_0xe0f5('0x11')](_0x5107aa);}};}function respondWithFilteredResult(_0x5f146e,_0x51e721){return function(_0x31bac5){if(_0x31bac5){var _0x35e3cf=typeof _0x51e721['offset']===_0xe0f5('0x12')&&typeof _0x51e721[_0xe0f5('0x13')]===_0xe0f5('0x12');var _0x1a914e=_0x31bac5[_0xe0f5('0x14')];var _0x584699=_0x35e3cf?0x0:_0x51e721[_0xe0f5('0x15')];var _0x673688=_0x35e3cf?_0x31bac5[_0xe0f5('0x14')]:_0x51e721[_0xe0f5('0x15')]+_0x51e721[_0xe0f5('0x13')];var _0x5b77be;if(_0x673688>=_0x1a914e){_0x673688=_0x1a914e;_0x5b77be=0xc8;}else{_0x5b77be=0xce;}_0x5f146e[_0xe0f5('0x16')](_0x5b77be);return _0x5f146e[_0xe0f5('0x17')](_0xe0f5('0x18'),_0x584699+'-'+_0x673688+'/'+_0x1a914e)[_0xe0f5('0x11')](_0x31bac5);}return null;};}function saveUpdates(_0x51d41b){return function(_0x48d591){if(_0x48d591){return _0x48d591[_0xe0f5('0x19')](_0x51d41b)[_0xe0f5('0x1a')](function(_0x2030ce){return _0x2030ce;});}return null;};}function removeEntity(_0x295bd9){return function(_0x103a05){if(_0x103a05){return _0x103a05[_0xe0f5('0x1b')]()[_0xe0f5('0x1a')](function(){_0x295bd9[_0xe0f5('0x16')](0xcc)[_0xe0f5('0x1c')]();});}};}function handleEntityNotFound(_0x4da6ac){return function(_0x47fff1){if(!_0x47fff1){_0x4da6ac[_0xe0f5('0x1d')](0x194);}return _0x47fff1;};}function handleError(_0x771675,_0x32af38){_0x32af38=_0x32af38||0x1f4;return function(_0x49741f){logger[_0xe0f5('0xd')](_0x49741f[_0xe0f5('0x1e')]);if(_0x49741f[_0xe0f5('0x1f')]){delete _0x49741f['name'];}_0x771675[_0xe0f5('0x16')](_0x32af38)[_0xe0f5('0x20')](_0x49741f);};}exports[_0xe0f5('0x21')]=function(_0x3e6954,_0x20fa2b){var _0x44f964={},_0x30ec38={},_0x2ee11e={'count':0x0,'rows':[]};var _0x1b9a85=_[_0xe0f5('0x22')](db[_0xe0f5('0x23')][_0xe0f5('0x24')],function(_0x2002fc){return{'name':_0x2002fc['fieldName'],'type':_0x2002fc[_0xe0f5('0x25')][_0xe0f5('0x26')]};});_0x30ec38[_0xe0f5('0x27')]=_[_0xe0f5('0x22')](_0x1b9a85,_0xe0f5('0x1f'));_0x30ec38[_0xe0f5('0x28')]=_[_0xe0f5('0x29')](_0x3e6954[_0xe0f5('0x28')]);_0x30ec38[_0xe0f5('0x2a')]=_[_0xe0f5('0x2b')](_0x30ec38[_0xe0f5('0x27')],_0x30ec38[_0xe0f5('0x28')]);_0x44f964['attributes']=_[_0xe0f5('0x2b')](_0x30ec38['model'],qs[_0xe0f5('0x2c')](_0x3e6954[_0xe0f5('0x28')][_0xe0f5('0x2c')]));_0x44f964['attributes']=_0x44f964[_0xe0f5('0x2d')][_0xe0f5('0x2e')]?_0x44f964['attributes']:_0x30ec38[_0xe0f5('0x27')];if(!_0x3e6954[_0xe0f5('0x28')][_0xe0f5('0x2f')]('nolimit')){_0x44f964['limit']=qs['limit'](_0x3e6954[_0xe0f5('0x28')]['limit']);_0x44f964['offset']=qs[_0xe0f5('0x15')](_0x3e6954[_0xe0f5('0x28')][_0xe0f5('0x15')]);}_0x44f964[_0xe0f5('0x30')]=qs['sort'](_0x3e6954[_0xe0f5('0x28')][_0xe0f5('0x31')]);_0x44f964[_0xe0f5('0x32')]=qs['filters'](_['pick'](_0x3e6954[_0xe0f5('0x28')],_0x30ec38[_0xe0f5('0x2a')]),_0x1b9a85);if(_0x3e6954[_0xe0f5('0x28')]['filter']){_0x44f964['where']=_['merge'](_0x44f964['where'],{'$or':_[_0xe0f5('0x22')](_0x1b9a85,function(_0x499211){if(_0x499211[_0xe0f5('0x25')]!=='VIRTUAL'){var _0x26f04a={};_0x26f04a[_0x499211[_0xe0f5('0x1f')]]={'$like':'%'+_0x3e6954[_0xe0f5('0x28')]['filter']+'%'};return _0x26f04a;}})});}_0x44f964=_['merge']({},_0x44f964,_0x3e6954[_0xe0f5('0x33')]);var _0x1a5f53={'where':_0x44f964[_0xe0f5('0x32')]};return db['Network'][_0xe0f5('0x14')](_0x1a5f53)[_0xe0f5('0x1a')](function(_0x4c5712){_0x2ee11e[_0xe0f5('0x14')]=_0x4c5712;if(_0x3e6954[_0xe0f5('0x28')][_0xe0f5('0x34')]){_0x44f964[_0xe0f5('0x35')]=[{'all':!![]}];}return db[_0xe0f5('0x23')][_0xe0f5('0x36')](_0x44f964);})['then'](function(_0x2f3de7){_0x2ee11e[_0xe0f5('0x37')]=_0x2f3de7;return _0x2ee11e;})[_0xe0f5('0x1a')](respondWithFilteredResult(_0x20fa2b,_0x44f964))[_0xe0f5('0x10')](handleError(_0x20fa2b,null));};exports[_0xe0f5('0x38')]=function(_0x5cd90f,_0x3b4ef0){var _0x44cee5={'raw':!![],'where':{'id':_0x5cd90f[_0xe0f5('0x39')]['id']}},_0x5c7e6d={};_0x5c7e6d[_0xe0f5('0x27')]=_['keys'](db[_0xe0f5('0x23')]['rawAttributes']);_0x5c7e6d[_0xe0f5('0x28')]=_['keys'](_0x5cd90f[_0xe0f5('0x28')]);_0x5c7e6d[_0xe0f5('0x2a')]=_[_0xe0f5('0x2b')](_0x5c7e6d['model'],_0x5c7e6d[_0xe0f5('0x28')]);_0x44cee5['attributes']=_[_0xe0f5('0x2b')](_0x5c7e6d[_0xe0f5('0x27')],qs[_0xe0f5('0x2c')](_0x5cd90f[_0xe0f5('0x28')][_0xe0f5('0x2c')]));_0x44cee5[_0xe0f5('0x2d')]=_0x44cee5[_0xe0f5('0x2d')][_0xe0f5('0x2e')]?_0x44cee5[_0xe0f5('0x2d')]:_0x5c7e6d[_0xe0f5('0x27')];if(_0x5cd90f[_0xe0f5('0x28')][_0xe0f5('0x34')]){_0x44cee5[_0xe0f5('0x35')]=[{'all':!![]}];}_0x44cee5=_[_0xe0f5('0x3a')]({},_0x44cee5,_0x5cd90f['options']);return db[_0xe0f5('0x23')][_0xe0f5('0x3b')](_0x44cee5)['then'](handleEntityNotFound(_0x3b4ef0,null))[_0xe0f5('0x1a')](respondWithResult(_0x3b4ef0,null))[_0xe0f5('0x10')](handleError(_0x3b4ef0,null));};exports[_0xe0f5('0x3c')]=function(_0x2c3af3,_0x5e8a79){var _0xb8837a;return db[_0xe0f5('0x23')][_0xe0f5('0x3c')](_0x2c3af3[_0xe0f5('0x3d')],{'raw':!![]})['then'](function(_0x238262){_0xb8837a=_0x238262;return db[_0xe0f5('0x23')][_0xe0f5('0x36')]({'where':{'type':_0x2c3af3[_0xe0f5('0x3d')][_0xe0f5('0x25')]},'raw':!![]});})[_0xe0f5('0x1a')](function(_0x3bb319){if(_0xb8837a[_0xe0f5('0x25')]['toUpperCase']()=='STUN'){var _0x29f47a=fs[_0xe0f5('0x3e')](path['join'](config[_0xe0f5('0x3f')],_0xe0f5('0x40')),'utf8');var _0x235aea=ejs[_0xe0f5('0x41')](_0x29f47a,{'networks':_0x3bb319||[]});fs[_0xe0f5('0x42')](_0xe0f5('0x43'),_0x235aea);return respondWithRpcPromise(_0xe0f5('0x44'),_0xe0f5('0x3c'),{'module':_0xe0f5('0x45')});}else if(_0xb8837a['type']['toUpperCase']()=='TURN'){var _0x4cfece=fs[_0xe0f5('0x3e')](path[_0xe0f5('0x46')](config['root'],_0xe0f5('0x47')),'utf8');var _0x2f5b1e=ejs['render'](_0x4cfece,{'networks':_0x3bb319||[]});fs[_0xe0f5('0x42')]('/etc/asterisk/turn_xcally.conf',_0x2f5b1e);return respondWithRpcPromise('Reload','create',{'module':_0xe0f5('0x45')});}else{var _0x9f7e8b=fs[_0xe0f5('0x3e')](path['join'](config[_0xe0f5('0x3f')],'server/files/templates/network.ejs'),_0xe0f5('0x48'));var _0x35b74d=ejs[_0xe0f5('0x41')](_0x9f7e8b,{'networks':_0x3bb319||[]});fs['writeFileSync'](util['format'](_0xe0f5('0x49'),_0x2c3af3['body'][_0xe0f5('0x25')][_0xe0f5('0x4a')]()),_0x35b74d);return respondWithRpcPromise('Reload',_0xe0f5('0x3c'),{'module':_0xe0f5('0x4b')});}})[_0xe0f5('0x1a')](function(){return _0xb8837a;})[_0xe0f5('0x1a')](respondWithResult(_0x5e8a79,0xc9))[_0xe0f5('0x10')](handleError(_0x5e8a79,null));};exports[_0xe0f5('0x19')]=function(_0x39c004,_0x51eeeb){var _0x443892;return db[_0xe0f5('0x23')]['find']({'where':{'id':_0x39c004[_0xe0f5('0x39')]['id']}})[_0xe0f5('0x1a')](handleEntityNotFound(_0x51eeeb,null))[_0xe0f5('0x1a')](saveUpdates(_0x39c004['body'],null))[_0xe0f5('0x1a')](function(_0x4f7109){if(_0x4f7109){_0x443892=_0x4f7109;return db[_0xe0f5('0x23')]['findAll']({'where':{'type':_0x443892[_0xe0f5('0x25')]},'raw':!![]});}return null;})[_0xe0f5('0x1a')](function(_0x425beb){if(_0x443892[_0xe0f5('0x25')][_0xe0f5('0x4c')]()=='STUN'){var _0x51b173=fs[_0xe0f5('0x3e')](path[_0xe0f5('0x46')](config['root'],_0xe0f5('0x40')),_0xe0f5('0x48'));var _0x64728=ejs[_0xe0f5('0x41')](_0x51b173,{'networks':_0x425beb||[]});fs['writeFileSync'](_0xe0f5('0x43'),_0x64728);return respondWithRpcPromise(_0xe0f5('0x44'),_0xe0f5('0x19'),{'module':_0xe0f5('0x45')});}else if(_0x443892[_0xe0f5('0x25')][_0xe0f5('0x4c')]()=='TURN'){var _0x2bf438=fs[_0xe0f5('0x3e')](path['join'](config['root'],_0xe0f5('0x47')),_0xe0f5('0x48'));var _0xfeb7ec=ejs[_0xe0f5('0x41')](_0x2bf438,{'networks':_0x425beb||[]});fs[_0xe0f5('0x42')]('/etc/asterisk/turn_xcally.conf',_0xfeb7ec);return respondWithRpcPromise('Reload',_0xe0f5('0x19'),{'module':_0xe0f5('0x45')});}else{var _0xa69011=fs['readFileSync'](path[_0xe0f5('0x46')](config[_0xe0f5('0x3f')],_0xe0f5('0x4d')),_0xe0f5('0x48'));var _0x382841=ejs[_0xe0f5('0x41')](_0xa69011,{'networks':_0x425beb||[]});fs['writeFileSync'](util[_0xe0f5('0x4e')](_0xe0f5('0x49'),_0x39c004[_0xe0f5('0x3d')][_0xe0f5('0x25')][_0xe0f5('0x4a')]()),_0x382841);return respondWithRpcPromise(_0xe0f5('0x44'),_0xe0f5('0x19'),{'module':_0xe0f5('0x4b')});}})[_0xe0f5('0x1a')](function(_0x547cdd){if(_0x547cdd){return _0x443892;}return null;})[_0xe0f5('0x1a')](respondWithResult(_0x51eeeb,null))[_0xe0f5('0x10')](handleError(_0x51eeeb,null));};exports[_0xe0f5('0x1b')]=function(_0x2e8f0d,_0x2be259){var _0x3f038e;return db[_0xe0f5('0x23')][_0xe0f5('0x3b')]({'where':{'id':_0x2e8f0d[_0xe0f5('0x39')]['id']}})['then'](function(_0x5541d9){_0x3f038e=_0x5541d9;return _0x5541d9;})['then'](handleEntityNotFound(_0x2be259,null))[_0xe0f5('0x1a')](removeEntity(_0x2be259,null))[_0xe0f5('0x1a')](function(){if(_0x3f038e){return db[_0xe0f5('0x23')]['findAll']({'where':{'type':_0x3f038e[_0xe0f5('0x25')]},'raw':!![]});}})[_0xe0f5('0x1a')](function(_0x4de5c5){if(_0x3f038e[_0xe0f5('0x25')][_0xe0f5('0x4c')]()==_0xe0f5('0x4f')){var _0x5320e3=fs['readFileSync'](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xe0f5('0x48'));var _0x4b84c2=ejs[_0xe0f5('0x41')](_0x5320e3,{'networks':_0x4de5c5||[]});fs['writeFileSync'](_0xe0f5('0x43'),_0x4b84c2);return respondWithRpcPromise(_0xe0f5('0x44'),_0xe0f5('0x1b'),{'module':'res_stun_monitor.so'});}else if(_0x3f038e[_0xe0f5('0x25')][_0xe0f5('0x4c')]()=='TURN'){var _0x4db444=fs[_0xe0f5('0x3e')](path['join'](config['root'],_0xe0f5('0x47')),_0xe0f5('0x48'));var _0x33e3bb=ejs['render'](_0x4db444,{'networks':_0x4de5c5||[]});fs[_0xe0f5('0x42')](_0xe0f5('0x50'),_0x33e3bb);return respondWithRpcPromise(_0xe0f5('0x44'),_0xe0f5('0x1b'),{'module':_0xe0f5('0x45')});}else{var _0x514f7d=fs['readFileSync'](path[_0xe0f5('0x46')](config['root'],'server/files/templates/network.ejs'),_0xe0f5('0x48'));var _0x596652=ejs[_0xe0f5('0x41')](_0x514f7d,{'networks':_0x4de5c5||[]});fs['writeFileSync'](util['format'](_0xe0f5('0x49'),_0x3f038e['type'][_0xe0f5('0x4a')]()),_0x596652);return respondWithRpcPromise(_0xe0f5('0x44'),_0xe0f5('0x1b'),{'module':_0xe0f5('0x4b')});}})[_0xe0f5('0x10')](handleError(_0x2be259,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f78798c..98cc078 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 _0x4ded=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x564a85,_0x60711c){var _0x500962=function(_0x59dfa6){while(--_0x59dfa6){_0x564a85['push'](_0x564a85['shift']());}};_0x500962(++_0x60711c);}(_0x4ded,0x116));var _0xd4de=function(_0x5e937f,_0x524a70){_0x5e937f=_0x5e937f-0x0;var _0x5bbb7c=_0x4ded[_0x5e937f];return _0x5bbb7c;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var logger=require(_0xd4de('0x2'))(_0xd4de('0x3'));var moment=require(_0xd4de('0x4'));var BPromise=require(_0xd4de('0x5'));var rp=require(_0xd4de('0x6'));var fs=require('fs');var path=require(_0xd4de('0x7'));var rimraf=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var attributes=require(_0xd4de('0xa'));module[_0xd4de('0xb')]=function(_0x554a51,_0x23e5b9){return _0x554a51[_0xd4de('0xc')](_0xd4de('0xd'),attributes,{'tableName':_0xd4de('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x574d=['moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api'];(function(_0x4538f0,_0x20f17f){var _0x2b5ec9=function(_0x4a0612){while(--_0x4a0612){_0x4538f0['push'](_0x4538f0['shift']());}};_0x2b5ec9(++_0x20f17f);}(_0x574d,0xc0));var _0xd574=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x574d[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xd574('0x0'));var util=require(_0xd574('0x1'));var logger=require(_0xd574('0x2'))(_0xd574('0x3'));var moment=require(_0xd574('0x4'));var BPromise=require(_0xd574('0x5'));var rp=require(_0xd574('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd574('0x7'));var config=require(_0xd574('0x8'));var attributes=require(_0xd574('0x9'));module[_0xd574('0xa')]=function(_0x56ecee,_0x16a152){return _0x56ecee[_0xd574('0xb')](_0xd574('0xc'),attributes,{'tableName':_0xd574('0xd'),'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 fc722c1..55744c2 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 _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(_0x525d59,_0x4e959d){var _0x3761bc=function(_0x4a4ba0){while(--_0x4a4ba0){_0x525d59['push'](_0x525d59['shift']());}};_0x3761bc(++_0x4e959d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('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 +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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0xdbae8b,_0x51abbe){_0xdbae8b=_0xdbae8b-0x0;var _0x3e66f5=_0x7a54[_0xdbae8b];return _0x3e66f5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index c08b05e..c94f9ec 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 _0x781d=['../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x1cf9ba,_0x1b2f9b){var _0xaab5c3=function(_0x4214e8){while(--_0x4214e8){_0x1cf9ba['push'](_0x1cf9ba['shift']());}};_0xaab5c3(++_0x1b2f9b);}(_0x781d,0x14a));var _0xd781=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x781d[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd781('0x2'));var router=express[_0xd781('0x3')]();var fs_extra=require(_0xd781('0x4'));var auth=require(_0xd781('0x5'));var interaction=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var controller=require(_0xd781('0x8'));router[_0xd781('0x9')]('/',auth[_0xd781('0xa')](),controller[_0xd781('0xb')]);router['get'](_0xd781('0xc'),auth[_0xd781('0xa')](),controller[_0xd781('0xd')]);router[_0xd781('0x9')]('/:id',auth[_0xd781('0xa')](),controller['show']);router[_0xd781('0x9')](_0xd781('0xe'),auth['isAuthenticated'](),controller[_0xd781('0xf')]);router[_0xd781('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd781('0x10')]);router[_0xd781('0x9')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x12')]);router[_0xd781('0x9')](_0xd781('0x13'),auth[_0xd781('0xa')](),controller[_0xd781('0x14')]);router[_0xd781('0x9')](_0xd781('0x15'),auth['isAuthenticated'](),controller[_0xd781('0x16')]);router[_0xd781('0x17')]('/',auth['isAuthenticated'](),controller[_0xd781('0x18')]);router['post'](_0xd781('0xe'),auth[_0xd781('0xa')](),controller[_0xd781('0x19')]);router[_0xd781('0x17')](_0xd781('0x1a'),auth[_0xd781('0xa')](),controller[_0xd781('0x1b')]);router['post'](_0xd781('0x1c'),controller[_0xd781('0x1d')]);router[_0xd781('0x17')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x1e')]);router[_0xd781('0x17')](_0xd781('0x15'),auth['isAuthenticated'](),controller[_0xd781('0x1f')]);router[_0xd781('0x17')](_0xd781('0x20'),auth[_0xd781('0xa')](),controller[_0xd781('0x21')]);router[_0xd781('0x22')](_0xd781('0x23'),auth['isAuthenticated'](),controller[_0xd781('0x24')]);router['delete']('/:id',auth[_0xd781('0xa')](),controller['destroy']);router[_0xd781('0x25')](_0xd781('0xe'),auth[_0xd781('0xa')](),controller[_0xd781('0x26')]);router[_0xd781('0x25')](_0xd781('0x1a'),auth[_0xd781('0xa')](),controller[_0xd781('0x27')]);router[_0xd781('0x25')]('/:id/users',auth['isAuthenticated'](),controller[_0xd781('0x28')]);module[_0xd781('0x29')]=router; \ No newline at end of file +var _0xf4f4=['show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x1ac1e7,_0x398adf){_0x1ac1e7=_0x1ac1e7-0x0;var _0x121020=_0xf4f4[_0x1ac1e7];return _0x121020;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./openchannelAccount.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0x8')]('/:id',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xd')]);router[_0x4f4f('0x8')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xf')]);router[_0x4f4f('0x8')](_0x4f4f('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4f4f('0x8')](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0x8')](_0x4f4f('0x13'),auth['isAuthenticated'](),controller[_0x4f4f('0x14')]);router['get'](_0x4f4f('0x15'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x16')]);router[_0x4f4f('0x17')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0x18')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x4f4f('0x19')]);router[_0x4f4f('0x17')](_0x4f4f('0x10'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x1a')]);router[_0x4f4f('0x17')](_0x4f4f('0x1b'),controller[_0x4f4f('0x1c')]);router[_0x4f4f('0x17')](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x1d')]);router['post'](_0x4f4f('0x15'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x1e')]);router[_0x4f4f('0x17')](_0x4f4f('0x1f'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x20')]);router[_0x4f4f('0x21')](_0x4f4f('0x22'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x23')]);router[_0x4f4f('0x24')](_0x4f4f('0x22'),auth[_0x4f4f('0x9')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x25')]);router['delete'](_0x4f4f('0x10'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x26')]);router[_0x4f4f('0x24')](_0x4f4f('0x15'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 7a25584..e0f6a5a 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 _0x6544=['setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x6544,0xc8));var _0x4654=function(_0x20d435,_0x1c5415){_0x20d435=_0x20d435-0x0;var _0x54288d=_0x6544[_0x20d435];return _0x54288d;};'use strict';var Sequelize=require(_0x4654('0x0'));var rs=require(_0x4654('0x1'));module[_0x4654('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4654('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4654('0x4')]();}},'replyUri':{'type':Sequelize[_0x4654('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4654('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4654('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4654('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4654('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4654('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4654('0x3')]},'queueTransfer':{'type':Sequelize[_0x4654('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4654('0x7')],'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[_0x4654('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4654('0x6')],'defaultValue':![],'comment':_0x4654('0x8'),'set':function(_0x57ec00){if(!_0x57ec00)this[_0x4654('0x9')]('mandatoryDispositionPauseId',null);this[_0x4654('0x9')](_0x4654('0xa'),_0x57ec00);}}}; \ No newline at end of file +var _0x7c25=['name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7c25,0x15c));var _0x57c2=function(_0x500f88,_0x2a68ee){_0x500f88=_0x500f88-0x0;var _0xb8d903=_0x7c25[_0x500f88];return _0xb8d903;};'use strict';var Sequelize=require(_0x57c2('0x0'));var rs=require(_0x57c2('0x1'));module['exports']={'name':{'type':Sequelize[_0x57c2('0x2')],'unique':_0x57c2('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x57c2('0x2')],'defaultValue':function(){return rs[_0x57c2('0x4')]();}},'replyUri':{'type':Sequelize[_0x57c2('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x57c2('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x57c2('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x57c2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x57c2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x57c2('0x2')]},'queueTransfer':{'type':Sequelize[_0x57c2('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x57c2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x57c2('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x57c2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x57c2('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x57c2('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x57c2('0x7')],'defaultValue':![],'comment':_0x57c2('0x9'),'set':function(_0x24ef1f){if(!_0x24ef1f)this[_0x57c2('0xa')](_0x57c2('0xb'),null);this[_0x57c2('0xa')](_0x57c2('0xc'),_0x24ef1f);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f303d14..941cf6e 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 _0x6ec2=['filters','pick','filter','VIRTUAL','include','rows','show','params','Pause','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','isNil','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','applications','orderBy','priority','account','ListId','contact','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','User','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','catch','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x40a03b,_0x5e8be0){var _0x26cb65=function(_0x4a184a){while(--_0x4a184a){_0x40a03b['push'](_0x40a03b['shift']());}};_0x26cb65(++_0x5e8be0);}(_0x6ec2,0x78));var _0x26ec=function(_0x3732c1,_0x434590){_0x3732c1=_0x3732c1-0x0;var _0x5e4f18=_0x6ec2[_0x3732c1];return _0x5e4f18;};'use strict';var emlformat=require(_0x26ec('0x0'));var rimraf=require(_0x26ec('0x1'));var zipdir=require(_0x26ec('0x2'));var jsonpatch=require(_0x26ec('0x3'));var rp=require(_0x26ec('0x4'));var moment=require(_0x26ec('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x26ec('0x6'));var util=require(_0x26ec('0x7'));var path=require(_0x26ec('0x8'));var sox=require(_0x26ec('0x9'));var csv=require(_0x26ec('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26ec('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x26ec('0xc'));var jsforce=require(_0x26ec('0xd'));var deskjs=require(_0x26ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0x26ec('0xf'));var Papa=require('papaparse');var Redis=require(_0x26ec('0x10'));var authService=require(_0x26ec('0x11'));var qs=require(_0x26ec('0x12'));var as=require(_0x26ec('0x13'));var hardwareService=require(_0x26ec('0x14'));var logger=require(_0x26ec('0x15'))(_0x26ec('0x16'));var utils=require(_0x26ec('0x17'));var config=require(_0x26ec('0x18'));var licenseUtil=require(_0x26ec('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x26ec('0x1a')](config[_0x26ec('0x1b')],{'host':_0x26ec('0x1c'),'port':0x18eb});var socket=require(_0x26ec('0x1d'))(new Redis(config[_0x26ec('0x1b')]));require(_0x26ec('0x1e'))[_0x26ec('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x26ec('0x20')][_0x26ec('0x21')]({'port':0x232c});var client9002=jayson[_0x26ec('0x20')][_0x26ec('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4f9950,_0x4d366c,_0x438985,_0x127385){return new BPromise(function(_0x4bdced,_0x20c407){var _0x49dc68=_0x127385||client;return _0x49dc68[_0x26ec('0x22')](_0x4f9950,_0x438985)[_0x26ec('0x23')](function(_0x50c9de){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4d366c,_0x26ec('0x24'));logger[_0x26ec('0x25')](_0x26ec('0x26'),_0x4d366c,'request\x20sent',JSON['stringify'](_0x50c9de));if(_0x50c9de[_0x26ec('0x27')]){if(_0x50c9de[_0x26ec('0x27')][_0x26ec('0x28')]===0x1f4){logger[_0x26ec('0x27')](_0x26ec('0x29'),_0x4d366c,_0x50c9de[_0x26ec('0x27')]['message']);return _0x20c407(_0x50c9de[_0x26ec('0x27')][_0x26ec('0x2a')]);}logger[_0x26ec('0x27')](_0x26ec('0x29'),_0x4d366c,_0x50c9de[_0x26ec('0x27')]['message']);return _0x4bdced(_0x50c9de['error'][_0x26ec('0x2a')]);}else{logger[_0x26ec('0x2b')](_0x26ec('0x29'),_0x4d366c,'request\x20sent');_0x4bdced(_0x50c9de['result'][_0x26ec('0x2a')]);}})[_0x26ec('0x2c')](function(_0x16aba4){logger[_0x26ec('0x27')](_0x26ec('0x29'),_0x4d366c,_0x16aba4);_0x20c407(_0x16aba4);});});}function respondWithStatusCode(_0x89bd5f,_0x439f78){_0x439f78=_0x439f78||0xcc;return function(_0x4e9cf8){if(_0x4e9cf8){return _0x89bd5f['sendStatus'](_0x439f78);}return _0x89bd5f['status'](_0x439f78)[_0x26ec('0x2d')]();};}function respondWithResult(_0xddd5fc,_0x352bef){_0x352bef=_0x352bef||0xc8;return function(_0x3fd842){if(_0x3fd842){return _0xddd5fc[_0x26ec('0x2e')](_0x352bef)[_0x26ec('0x2f')](_0x3fd842);}};}function respondWithFilteredResult(_0x3268e9,_0x4a1371){return function(_0x30231e){if(_0x30231e){var _0x5d10ba=typeof _0x4a1371[_0x26ec('0x30')]===_0x26ec('0x31')&&typeof _0x4a1371['limit']===_0x26ec('0x31');var _0x2d30e6=_0x30231e[_0x26ec('0x32')];var _0x18999a=_0x5d10ba?0x0:_0x4a1371[_0x26ec('0x30')];var _0x24d390=_0x5d10ba?_0x30231e['count']:_0x4a1371[_0x26ec('0x30')]+_0x4a1371['limit'];var _0x3d8b89;if(_0x24d390>=_0x2d30e6){_0x24d390=_0x2d30e6;_0x3d8b89=0xc8;}else{_0x3d8b89=0xce;}_0x3268e9['status'](_0x3d8b89);return _0x3268e9[_0x26ec('0x33')](_0x26ec('0x34'),_0x18999a+'-'+_0x24d390+'/'+_0x2d30e6)['json'](_0x30231e);}return null;};}function patchUpdates(_0x4555ea){return function(_0x13c4c3){try{jsonpatch[_0x26ec('0x35')](_0x13c4c3,_0x4555ea,!![]);}catch(_0x5fe57f){return BPromise[_0x26ec('0x36')](_0x5fe57f);}return _0x13c4c3[_0x26ec('0x37')]();};}function saveUpdates(_0x4f1806,_0x5bf0b8){return function(_0x56e03c){if(_0x56e03c){return _0x56e03c['update'](_0x4f1806)['then'](function(_0x187e7d){return _0x187e7d;});}return null;};}function removeEntity(_0x2543a6,_0x2737c6){return function(_0x27652d){if(_0x27652d){return _0x27652d[_0x26ec('0x38')]()['then'](function(){var _0xfdd95=_0x27652d[_0x26ec('0x39')]({'plain':!![]});var _0x35a745=_0x26ec('0x3a');return db[_0x26ec('0x3b')]['destroy']({'where':{'type':_0x35a745,'resourceId':_0xfdd95['id']}})[_0x26ec('0x23')](function(){return _0x27652d;});})[_0x26ec('0x23')](function(){_0x2543a6[_0x26ec('0x2e')](0xcc)[_0x26ec('0x2d')]();});}};}function handleEntityNotFound(_0x6b217f,_0x171118){return function(_0x39c514){if(!_0x39c514){_0x6b217f[_0x26ec('0x3c')](0x194);}return _0x39c514;};}function handleError(_0x354adf,_0x16c0ee){_0x16c0ee=_0x16c0ee||0x1f4;return function(_0x48d7cf){logger['error'](_0x48d7cf[_0x26ec('0x3d')]);if(_0x48d7cf[_0x26ec('0x3e')]){delete _0x48d7cf['name'];}_0x354adf[_0x26ec('0x2e')](_0x16c0ee)['send'](_0x48d7cf);};}exports[_0x26ec('0x3f')]=function(_0x1244aa,_0x11fc8c){var _0xb4942e={'include':[{'model':db['Pause'],'as':_0x26ec('0x40')}]},_0x2a0c92={},_0xfb68c9={'count':0x0,'rows':[]};var _0x3441f4=_[_0x26ec('0x41')](db[_0x26ec('0x42')][_0x26ec('0x43')],function(_0x304194){return{'name':_0x304194[_0x26ec('0x44')],'type':_0x304194[_0x26ec('0x45')][_0x26ec('0x46')]};});_0x2a0c92[_0x26ec('0x47')]=_[_0x26ec('0x41')](_0x3441f4,_0x26ec('0x3e'));_0x2a0c92[_0x26ec('0x48')]=_[_0x26ec('0x49')](_0x1244aa[_0x26ec('0x48')]);_0x2a0c92['filters']=_[_0x26ec('0x4a')](_0x2a0c92[_0x26ec('0x47')],_0x2a0c92[_0x26ec('0x48')]);_0xb4942e[_0x26ec('0x4b')]=_[_0x26ec('0x4a')](_0x2a0c92[_0x26ec('0x47')],qs['fields'](_0x1244aa['query'][_0x26ec('0x4c')]));_0xb4942e['attributes']=_0xb4942e[_0x26ec('0x4b')][_0x26ec('0x4d')]?_0xb4942e[_0x26ec('0x4b')]:_0x2a0c92[_0x26ec('0x47')];if(!_0x1244aa[_0x26ec('0x48')][_0x26ec('0x4e')](_0x26ec('0x4f'))){_0xb4942e[_0x26ec('0x50')]=qs['limit'](_0x1244aa[_0x26ec('0x48')][_0x26ec('0x50')]);_0xb4942e[_0x26ec('0x30')]=qs['offset'](_0x1244aa[_0x26ec('0x48')][_0x26ec('0x30')]);}_0xb4942e[_0x26ec('0x51')]=qs[_0x26ec('0x52')](_0x1244aa[_0x26ec('0x48')][_0x26ec('0x52')]);_0xb4942e[_0x26ec('0x53')]=qs[_0x26ec('0x54')](_[_0x26ec('0x55')](_0x1244aa[_0x26ec('0x48')],_0x2a0c92[_0x26ec('0x54')]),_0x3441f4);if(_0x1244aa[_0x26ec('0x48')][_0x26ec('0x56')]){_0xb4942e[_0x26ec('0x53')]=_['merge'](_0xb4942e['where'],{'$or':_[_0x26ec('0x41')](_0x3441f4,function(_0x5be55c){if(_0x5be55c['type']!==_0x26ec('0x57')){var _0xc9eda3={};_0xc9eda3[_0x5be55c[_0x26ec('0x3e')]]={'$like':'%'+_0x1244aa['query']['filter']+'%'};return _0xc9eda3;}})});}_0xb4942e=_['merge']({},_0xb4942e,_0x1244aa['options']);var _0x3faf2b={'where':_0xb4942e['where']};return db[_0x26ec('0x42')][_0x26ec('0x32')](_0x3faf2b)['then'](function(_0x4c1355){_0xfb68c9[_0x26ec('0x32')]=_0x4c1355;if(_0x1244aa[_0x26ec('0x48')]['includeAll']){_0xb4942e[_0x26ec('0x58')]=[{'all':!![]}];}return db[_0x26ec('0x42')]['findAll'](_0xb4942e);})['then'](function(_0x34ee55){_0xfb68c9[_0x26ec('0x59')]=_0x34ee55;return _0xfb68c9;})[_0x26ec('0x23')](respondWithFilteredResult(_0x11fc8c,_0xb4942e))['catch'](handleError(_0x11fc8c,null));};exports[_0x26ec('0x5a')]=function(_0x584c35,_0x3c743a){var _0x179f9f={'raw':![],'where':{'id':_0x584c35[_0x26ec('0x5b')]['id']},'include':[{'model':db[_0x26ec('0x5c')],'as':_0x26ec('0x40')}]},_0x2af53a={};_0x2af53a['model']=_[_0x26ec('0x49')](db[_0x26ec('0x42')]['rawAttributes']);_0x2af53a[_0x26ec('0x48')]=_[_0x26ec('0x49')](_0x584c35['query']);_0x2af53a[_0x26ec('0x54')]=_['intersection'](_0x2af53a['model'],_0x2af53a[_0x26ec('0x48')]);_0x179f9f[_0x26ec('0x4b')]=_[_0x26ec('0x4a')](_0x2af53a['model'],qs['fields'](_0x584c35[_0x26ec('0x48')][_0x26ec('0x4c')]));_0x179f9f[_0x26ec('0x4b')]=_0x179f9f['attributes'][_0x26ec('0x4d')]?_0x179f9f[_0x26ec('0x4b')]:_0x2af53a['model'];if(_0x584c35['query'][_0x26ec('0x5d')]){_0x179f9f['include']=[{'all':!![]}];}_0x179f9f=_[_0x26ec('0x5e')]({},_0x179f9f,_0x584c35[_0x26ec('0x5f')]);return db[_0x26ec('0x42')][_0x26ec('0x60')](_0x179f9f)['then'](handleEntityNotFound(_0x3c743a,null))['then'](respondWithResult(_0x3c743a,null))[_0x26ec('0x2c')](handleError(_0x3c743a,null));};exports[_0x26ec('0x61')]=function(_0x2e1eec,_0x11440c){return db[_0x26ec('0x42')][_0x26ec('0x61')](_0x2e1eec[_0x26ec('0x62')],{})['then'](function(_0x92dd6f){var _0x4a67e4=_0x2e1eec[_0x26ec('0x63')][_0x26ec('0x39')]({'plain':!![]});if(!_0x4a67e4)throw new Error(_0x26ec('0x64'));if(_0x4a67e4[_0x26ec('0x65')]===_0x26ec('0x63')){var _0x5f599c=_0x92dd6f[_0x26ec('0x39')]({'plain':!![]});var _0xefa3aa=_0x26ec('0x3a');return db[_0x26ec('0x66')]['find']({'where':{'name':_0xefa3aa,'userProfileId':_0x4a67e4[_0x26ec('0x67')]},'raw':!![]})[_0x26ec('0x23')](function(_0x4bd26b){if(_0x4bd26b&&_0x4bd26b[_0x26ec('0x68')]===0x0){return db[_0x26ec('0x3b')][_0x26ec('0x61')]({'name':_0x5f599c[_0x26ec('0x3e')],'resourceId':_0x5f599c['id'],'type':_0x4bd26b[_0x26ec('0x3e')],'sectionId':_0x4bd26b['id']},{})[_0x26ec('0x23')](function(){return _0x92dd6f;});}else{return _0x92dd6f;}})[_0x26ec('0x2c')](function(_0x4a9218){logger[_0x26ec('0x27')](_0x26ec('0x69'),_0x4a9218);throw _0x4a9218;});}return _0x92dd6f;})['then'](respondWithResult(_0x11440c,0xc9))[_0x26ec('0x2c')](handleError(_0x11440c,null));};exports[_0x26ec('0x6a')]=function(_0x329899,_0x2d93e9){if(_0x329899[_0x26ec('0x62')]['id']){delete _0x329899[_0x26ec('0x62')]['id'];}return db[_0x26ec('0x42')][_0x26ec('0x60')]({'where':{'id':_0x329899[_0x26ec('0x5b')]['id']},'include':[{'model':db[_0x26ec('0x5c')],'as':_0x26ec('0x40')}]})[_0x26ec('0x23')](handleEntityNotFound(_0x2d93e9,null))[_0x26ec('0x23')](saveUpdates(_0x329899[_0x26ec('0x62')],null))[_0x26ec('0x23')](respondWithResult(_0x2d93e9,null))['catch'](handleError(_0x2d93e9,null));};exports['destroy']=function(_0x4b3718,_0x57144c){return db[_0x26ec('0x42')][_0x26ec('0x60')]({'where':{'id':_0x4b3718[_0x26ec('0x5b')]['id']}})['then'](handleEntityNotFound(_0x57144c,null))[_0x26ec('0x23')](removeEntity(_0x57144c,null))['catch'](handleError(_0x57144c,null));};exports[_0x26ec('0x6b')]=function(_0x80a521,_0x364d24){return db['OpenchannelAccount'][_0x26ec('0x6b')]()[_0x26ec('0x23')](respondWithResult(_0x364d24,null))[_0x26ec('0x2c')](handleError(_0x364d24,null));};exports[_0x26ec('0x6c')]=function(_0x1c0c79,_0x48de36,_0x169a12){if(_0x1c0c79[_0x26ec('0x62')]['id']){delete _0x1c0c79['body']['id'];}return db[_0x26ec('0x42')][_0x26ec('0x60')]({'where':{'id':_0x1c0c79[_0x26ec('0x5b')]['id']}})['then'](handleEntityNotFound(_0x48de36,null))[_0x26ec('0x23')](function(_0xb64f7a){if(_0xb64f7a){_0x1c0c79[_0x26ec('0x62')][_0x26ec('0x6d')]=_0xb64f7a['id'];return db[_0x26ec('0x6e')][_0x26ec('0x61')](_0x1c0c79[_0x26ec('0x62')]);}})[_0x26ec('0x23')](respondWithResult(_0x48de36,null))[_0x26ec('0x2c')](handleError(_0x48de36,null));};exports[_0x26ec('0x6f')]=function(_0x1ab092,_0x6ab7d4,_0x1f5fc4){var _0x2ad951={'raw':![],'where':{}};var _0x20d69e={};var _0x463cba={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x1ab092[_0x26ec('0x5b')]['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x6ab7d4,null))[_0x26ec('0x23')](function(_0x3ca5ce){if(_0x3ca5ce){_0x20d69e[_0x26ec('0x47')]=_[_0x26ec('0x49')](db['Disposition'][_0x26ec('0x43')]);_0x20d69e[_0x26ec('0x48')]=_[_0x26ec('0x49')](_0x1ab092[_0x26ec('0x48')]);_0x20d69e[_0x26ec('0x54')]=_[_0x26ec('0x4a')](_0x20d69e[_0x26ec('0x47')],_0x20d69e[_0x26ec('0x48')]);_0x2ad951[_0x26ec('0x4b')]=_[_0x26ec('0x4a')](_0x20d69e[_0x26ec('0x47')],qs['fields'](_0x1ab092[_0x26ec('0x48')][_0x26ec('0x4c')]));_0x2ad951[_0x26ec('0x4b')]=_0x2ad951['attributes'][_0x26ec('0x4d')]?_0x2ad951[_0x26ec('0x4b')]:_0x20d69e['model'];if(!_0x1ab092[_0x26ec('0x48')]['hasOwnProperty'](_0x26ec('0x4f'))){_0x2ad951[_0x26ec('0x50')]=qs[_0x26ec('0x50')](_0x1ab092[_0x26ec('0x48')][_0x26ec('0x50')]);_0x2ad951[_0x26ec('0x30')]=qs['offset'](_0x1ab092[_0x26ec('0x48')][_0x26ec('0x30')]);}_0x2ad951['order']=qs[_0x26ec('0x52')](_0x1ab092[_0x26ec('0x48')]['sort']);_0x2ad951[_0x26ec('0x53')]=qs['filters'](_[_0x26ec('0x55')](_0x1ab092[_0x26ec('0x48')],_0x20d69e['filters']));_0x2ad951[_0x26ec('0x53')][_0x26ec('0x6d')]=_0x3ca5ce['id'];if(_0x1ab092['query'][_0x26ec('0x56')]){_0x2ad951[_0x26ec('0x53')]=_[_0x26ec('0x5e')](_0x2ad951[_0x26ec('0x53')],{'$or':_[_0x26ec('0x41')](_0x2ad951[_0x26ec('0x4b')],function(_0x2765bc){var _0x5e46c8={};_0x5e46c8[_0x2765bc]={'$like':'%'+_0x1ab092[_0x26ec('0x48')][_0x26ec('0x56')]+'%'};return _0x5e46c8;})});}_0x2ad951=_['merge']({},_0x2ad951,_0x1ab092['options']);return db['Disposition'][_0x26ec('0x32')]({'where':_0x2ad951[_0x26ec('0x53')]})[_0x26ec('0x23')](function(_0x51cf47){_0x463cba[_0x26ec('0x32')]=_0x51cf47;if(_0x1ab092[_0x26ec('0x48')][_0x26ec('0x5d')]){_0x2ad951[_0x26ec('0x58')]=[{'all':!![]}];}return db[_0x26ec('0x6e')][_0x26ec('0x70')](_0x2ad951);})[_0x26ec('0x23')](function(_0x597c97){_0x463cba[_0x26ec('0x59')]=_0x597c97;return _0x463cba;});}})[_0x26ec('0x23')](respondWithFilteredResult(_0x6ab7d4,_0x2ad951))[_0x26ec('0x2c')](handleError(_0x6ab7d4,null));};exports[_0x26ec('0x71')]=function(_0x18a155,_0x457b03,_0x3bbd9c){return db[_0x26ec('0x42')][_0x26ec('0x60')]({'where':{'id':_0x18a155[_0x26ec('0x5b')]['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x457b03,null))[_0x26ec('0x23')](function(_0x260436){if(_0x260436){return _0x260436[_0x26ec('0x71')](_0x18a155[_0x26ec('0x48')][_0x26ec('0x72')]);}})[_0x26ec('0x23')](respondWithStatusCode(_0x457b03,null))[_0x26ec('0x2c')](handleError(_0x457b03,null));};exports[_0x26ec('0x73')]=function(_0x289ca2,_0x3d197f,_0x15d5dd){if(_0x289ca2[_0x26ec('0x62')]['id']){delete _0x289ca2[_0x26ec('0x62')]['id'];}return db[_0x26ec('0x42')][_0x26ec('0x60')]({'where':{'id':_0x289ca2['params']['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x3d197f,null))[_0x26ec('0x23')](function(_0x42ae13){if(_0x42ae13){_0x289ca2[_0x26ec('0x62')][_0x26ec('0x6d')]=_0x42ae13['id'];return db[_0x26ec('0x74')][_0x26ec('0x61')](_0x289ca2[_0x26ec('0x62')]);}})[_0x26ec('0x23')](respondWithResult(_0x3d197f,null))['catch'](handleError(_0x3d197f,null));};exports[_0x26ec('0x75')]=function(_0x3ce8eb,_0x248ca0,_0xa43ab5){var _0x101cfc={'raw':![],'where':{}};var _0x9eaa77={};var _0x13ca0b={'count':0x0,'rows':[]};return db[_0x26ec('0x42')]['findOne']({'where':{'id':_0x3ce8eb[_0x26ec('0x5b')]['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x248ca0,null))['then'](function(_0x2b14c8){if(_0x2b14c8){_0x9eaa77[_0x26ec('0x47')]=_['keys'](db['CannedAnswer'][_0x26ec('0x43')]);_0x9eaa77[_0x26ec('0x48')]=_[_0x26ec('0x49')](_0x3ce8eb[_0x26ec('0x48')]);_0x9eaa77[_0x26ec('0x54')]=_[_0x26ec('0x4a')](_0x9eaa77[_0x26ec('0x47')],_0x9eaa77[_0x26ec('0x48')]);_0x101cfc[_0x26ec('0x4b')]=_[_0x26ec('0x4a')](_0x9eaa77[_0x26ec('0x47')],qs[_0x26ec('0x4c')](_0x3ce8eb['query'][_0x26ec('0x4c')]));_0x101cfc['attributes']=_0x101cfc['attributes']['length']?_0x101cfc['attributes']:_0x9eaa77[_0x26ec('0x47')];if(!_0x3ce8eb[_0x26ec('0x48')][_0x26ec('0x4e')](_0x26ec('0x4f'))){_0x101cfc[_0x26ec('0x50')]=qs['limit'](_0x3ce8eb['query']['limit']);_0x101cfc[_0x26ec('0x30')]=qs[_0x26ec('0x30')](_0x3ce8eb[_0x26ec('0x48')][_0x26ec('0x30')]);}_0x101cfc['order']=qs[_0x26ec('0x52')](_0x3ce8eb['query'][_0x26ec('0x52')]);_0x101cfc[_0x26ec('0x53')]=qs[_0x26ec('0x54')](_[_0x26ec('0x55')](_0x3ce8eb[_0x26ec('0x48')],_0x9eaa77['filters']));_0x101cfc[_0x26ec('0x53')]['OpenchannelAccountId']=_0x2b14c8['id'];if(_0x3ce8eb[_0x26ec('0x48')][_0x26ec('0x56')]){_0x101cfc[_0x26ec('0x53')]=_[_0x26ec('0x5e')](_0x101cfc[_0x26ec('0x53')],{'$or':_['map'](_0x101cfc[_0x26ec('0x4b')],function(_0x5c9f1f){var _0x19ac76={};_0x19ac76[_0x5c9f1f]={'$like':'%'+_0x3ce8eb[_0x26ec('0x48')][_0x26ec('0x56')]+'%'};return _0x19ac76;})});}_0x101cfc=_[_0x26ec('0x5e')]({},_0x101cfc,_0x3ce8eb['options']);return db[_0x26ec('0x74')]['count']({'where':_0x101cfc[_0x26ec('0x53')]})[_0x26ec('0x23')](function(_0x1f3972){_0x13ca0b['count']=_0x1f3972;if(_0x3ce8eb['query'][_0x26ec('0x5d')]){_0x101cfc[_0x26ec('0x58')]=[{'all':!![]}];}return db[_0x26ec('0x74')][_0x26ec('0x70')](_0x101cfc);})['then'](function(_0x53471c){_0x13ca0b[_0x26ec('0x59')]=_0x53471c;return _0x13ca0b;});}})['then'](respondWithFilteredResult(_0x248ca0,_0x101cfc))[_0x26ec('0x2c')](handleError(_0x248ca0,null));};exports['removeAnswers']=function(_0x430bb4,_0x4da032,_0x136140){return db[_0x26ec('0x42')][_0x26ec('0x60')]({'where':{'id':_0x430bb4[_0x26ec('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4da032,null))[_0x26ec('0x23')](function(_0x24f3b8){if(_0x24f3b8){return _0x24f3b8[_0x26ec('0x76')](_0x430bb4['query'][_0x26ec('0x72')]);}})['then'](respondWithStatusCode(_0x4da032,null))[_0x26ec('0x2c')](handleError(_0x4da032,null));};exports[_0x26ec('0x77')]=function(_0x2a6c21,_0x48d67c,_0x1c885f){var _0x6cd0f6={'body':_0x2a6c21[_0x26ec('0x62')],'channel':_0x26ec('0x78')};var _0x44de7e=[];var _0x594632=[];var _0x13ef95={};var _0x14dd26=![];return db[_0x26ec('0x79')]['describe']()[_0x26ec('0x23')](function(_0x4b5cf8){if(!_0x4b5cf8){throw new db['Sequelize'][(_0x26ec('0x7a'))](_0x26ec('0x7b'));}_0x44de7e=_['difference'](_['keys'](_0x4b5cf8),[_0x26ec('0x7c'),_0x26ec('0x7d')]);_0x594632=_[_0x26ec('0x7e')](_['keys'](_0x4b5cf8),[_0x26ec('0x7c'),_0x26ec('0x7d'),_0x26ec('0x7f'),'ListId']);if(_0x2a6c21[_0x26ec('0x62')]['id']){delete _0x2a6c21['body']['id'];}if(_[_0x26ec('0x80')](_0x2a6c21[_0x26ec('0x62')][_0x26ec('0x81')])){throw new db['Sequelize'][(_0x26ec('0x7a'))](_0x26ec('0x82'));}if(_[_0x26ec('0x80')](_0x2a6c21[_0x26ec('0x62')]['body'])||_0x2a6c21[_0x26ec('0x62')][_0x26ec('0x62')]===''){throw new db[(_0x26ec('0x83'))]['ValidationError'](_0x26ec('0x84'));}if(_[_0x26ec('0x80')](_0x2a6c21[_0x26ec('0x62')]['mapKey'])){throw new db[(_0x26ec('0x83'))][(_0x26ec('0x7a'))](_0x26ec('0x85')+_0x594632);}if(!_[_0x26ec('0x86')](_0x594632,_0x2a6c21[_0x26ec('0x62')][_0x26ec('0x87')])){throw new db[(_0x26ec('0x83'))][(_0x26ec('0x7a'))](_0x26ec('0x88')+_0x594632);}_0x13ef95[_0x2a6c21[_0x26ec('0x62')][_0x26ec('0x87')]]=_0x2a6c21[_0x26ec('0x62')][_0x26ec('0x81')];})['then'](function(){return db[_0x26ec('0x42')]['find']({'where':{'id':_0x2a6c21[_0x26ec('0x5b')]['id']},'include':[{'model':db[_0x26ec('0x89')],'as':'List','include':[{'model':db[_0x26ec('0x79')],'as':_0x26ec('0x8a'),'where':_0x13ef95,'limit':0x1,'order':[[_0x26ec('0x7d'),_0x26ec('0x8b')]]}]},{'model':db[_0x26ec('0x8c')],'as':_0x26ec('0x8d')}]});})[_0x26ec('0x23')](handleEntityNotFound(_0x48d67c,null))[_0x26ec('0x23')](function(_0x4978d0){if(_0x4978d0&&_0x4978d0[_0x26ec('0x8e')]){_0x6cd0f6['account']=_0x4978d0;_0x6cd0f6['applications']=_0x4978d0[_0x26ec('0x8d')];_0x6cd0f6['list']=_0x4978d0[_0x26ec('0x8e')];_0x6cd0f6[_0x26ec('0x8f')]=_[_0x26ec('0x90')](_0x6cd0f6[_0x26ec('0x8f')],[_0x26ec('0x91')],['asc']);if(_0x6cd0f6['account']['Applications']){delete _0x6cd0f6[_0x26ec('0x92')][_0x26ec('0x8d')];}if(_0x6cd0f6[_0x26ec('0x92')][_0x26ec('0x8e')]&&_0x6cd0f6[_0x26ec('0x92')][_0x26ec('0x8e')][_0x26ec('0x8a')][_0x26ec('0x4d')]){return _0x6cd0f6[_0x26ec('0x92')][_0x26ec('0x8e')]['Contacts'][0x0];}var _0x486a4e=_[_0x26ec('0x1a')](_0x2a6c21[_0x26ec('0x62')],{'firstName':_0x2a6c21['body']['from'],'ListId':_0x4978d0[_0x26ec('0x93')]});_0x486a4e[_0x2a6c21[_0x26ec('0x62')][_0x26ec('0x87')]]=_0x2a6c21[_0x26ec('0x62')]['from'];return db[_0x26ec('0x79')]['create'](_0x486a4e,{'fields':_0x44de7e,'raw':!![]});}})[_0x26ec('0x23')](handleEntityNotFound(_0x48d67c,null))[_0x26ec('0x23')](function(_0x33a744){_0x6cd0f6[_0x26ec('0x94')]=_0x33a744;if(_0x33a744){var _0x5574c9={'ContactId':_0x33a744['id'],'OpenchannelAccountId':_0x2a6c21['params']['id'],'from':(_0x33a744['firstName']||'')+'\x20'+(_0x33a744['lastName']||'')};var _0x1373ce={'OpenchannelAccountId':_0x2a6c21['params']['id'],'closed':![]};if(_0x2a6c21[_0x26ec('0x62')]['threadId']){_0x1373ce[_0x26ec('0x95')]=_0x2a6c21[_0x26ec('0x62')]['threadId'];return db[_0x26ec('0x96')][_0x26ec('0x60')]({'where':_0x1373ce})[_0x26ec('0x23')](function(_0x18f802){if(_0x18f802){return[_0x18f802,![]];}_0x5574c9[_0x26ec('0x95')]=_0x2a6c21[_0x26ec('0x62')][_0x26ec('0x95')];_0x5574c9[_0x26ec('0x97')]=_0x2a6c21['body'][_0x26ec('0x97')];return db[_0x26ec('0x96')]['create'](_0x5574c9)['then'](function(_0x2b0b3e){return[_0x2b0b3e,!![]];});});}else{_0x1373ce[_0x26ec('0x95')]=null;}_0x1373ce[_0x26ec('0x98')]=_0x33a744['id'];return db['OpenchannelInteraction']['find']({'where':_0x1373ce})['then'](function(_0x50e1ab){if(_0x50e1ab){return[_0x50e1ab,![]];}return db['OpenchannelInteraction'][_0x26ec('0x61')](_0x5574c9)[_0x26ec('0x23')](function(_0x2f8396){return[_0x2f8396,!![]];});});}})[_0x26ec('0x99')](function(_0x1c9101,_0x3f6943){if(_0x1c9101){_0x14dd26=_0x3f6943;if(!_0x3f6943){var _0x207ea5={'from':(_0x6cd0f6['contact'][_0x26ec('0x9a')]||'')+'\x20'+(_0x6cd0f6[_0x26ec('0x94')][_0x26ec('0x9b')]||'')};if(_0x2a6c21[_0x26ec('0x62')][_0x26ec('0x95')]&&_0x2a6c21[_0x26ec('0x62')][_0x26ec('0x9c')]&&_0x2a6c21['body']['threadId']!=_0x2a6c21['body']['messageId']){_0x207ea5[_0x26ec('0x95')]=_0x2a6c21[_0x26ec('0x62')]['messageId'];}return _0x1c9101[_0x26ec('0x6a')](_0x207ea5);}else{return _0x1c9101;}}})['then'](function(_0x1b0f41){_0x6cd0f6['interaction']=_0x1b0f41[_0x26ec('0x39')]({'plain':!![]});_0x6cd0f6[_0x26ec('0x9d')][_0x26ec('0x9e')]=_0x14dd26;if(_0x6cd0f6['interaction'][_0x26ec('0x9e')]){if(_0x6cd0f6[_0x26ec('0x92')][_0x26ec('0x9f')]){_0x6cd0f6[_0x26ec('0x8f')][_0x26ec('0xa0')]({'id':0x0,'priority':_0x6cd0f6['applications']['length']+0x1,'app':_0x26ec('0xa1'),'appdata':_0x26ec('0xa2'),'interval':_0x26ec('0xa3')});}}return db[_0x26ec('0xa4')][_0x26ec('0x61')]({'body':_0x2a6c21['body']['body'],'OpenchannelAccountId':_0x2a6c21[_0x26ec('0x5b')]['id'],'OpenchannelInteractionId':_0x1b0f41['id'],'direction':'in','ContactId':_0x6cd0f6[_0x26ec('0x94')]['id'],'AttachmentId':_0x2a6c21[_0x26ec('0x62')][_0x26ec('0xa5')]});})[_0x26ec('0x23')](function(_0x2ee8e7){_0x6cd0f6[_0x26ec('0x2a')]=_0x2ee8e7;if(!_0x6cd0f6['interaction'][_0x26ec('0xa6')])return;return db['User'][_0x26ec('0x60')]({'attributes':['id',_0x26ec('0x3e')],'where':{'id':_0x6cd0f6[_0x26ec('0x9d')]['UserId']}});})[_0x26ec('0x23')](function(_0x143591){if(_0x143591){_0x6cd0f6[_0x26ec('0x8f')][_0x26ec('0xa7')]({'id':0x0,'priority':0x0,'app':_0x26ec('0xa8'),'appdata':_0x143591['name']+','+(_0x6cd0f6[_0x26ec('0x92')][_0x26ec('0xa9')]||0xa),'interval':_0x26ec('0xa3')});}if(!_0x6cd0f6[_0x26ec('0x9d')][_0x26ec('0xaa')])return;return db[_0x26ec('0xab')]['find']({'attributes':['id',_0x26ec('0x3e')],'where':{'id':_0x6cd0f6[_0x26ec('0x9d')][_0x26ec('0xaa')]}});})[_0x26ec('0x23')](function(_0xdef8cd){if(_0xdef8cd){_0x6cd0f6['applications'][_0x26ec('0xa7')]({'id':0x0,'priority':0x1,'app':_0x26ec('0xac'),'appdata':_0xdef8cd[_0x26ec('0x3e')]+','+(_0x6cd0f6[_0x26ec('0x92')][_0x26ec('0xad')]||0x12c),'interval':_0x26ec('0xa3')});}return respondWithRpcPromise(_0x26ec('0xae'),'startRouting',_0x6cd0f6);})[_0x26ec('0x23')](function(_0x21b8e7){respondWithRpcPromise(_0x26ec('0xaf'),_0x26ec('0xaf'),{'event':'notify','message':_0x21b8e7},client9002);return _0x21b8e7;})[_0x26ec('0x23')](respondWithResult(_0x48d67c,null))[_0x26ec('0x2c')](handleError(_0x48d67c,null));};exports[_0x26ec('0xb0')]=function(_0xd7195f,_0x1debd5){var _0x3c0ed1=_0xd7195f['params']['id'];var _0x4d439d=_0xd7195f[_0x26ec('0x62')];var _0x4abd0e=0xc8;var _0x46d2b3=null;return db[_0x26ec('0xb1')]['transaction']({'isolationLevel':db['sequelize'][_0x26ec('0xb2')][_0x26ec('0xb3')][_0x26ec('0xb4')]},function(_0x17a503){return db['OpenchannelAccount'][_0x26ec('0xb5')]({'where':{'id':_0x3c0ed1},'transaction':_0x17a503})[_0x26ec('0x23')](function(_0x229948){if(_0x229948){return db[_0x26ec('0x8c')][_0x26ec('0x38')]({'where':{'OpenchannelAccountId':_0x3c0ed1},'transaction':_0x17a503})[_0x26ec('0x23')](function(){var _0x243a65=_[_0x26ec('0x41')](_0x4d439d,function(_0x4af2f4){_0x4af2f4[_0x26ec('0x6d')]=_0x3c0ed1;return _0x4af2f4;});return db[_0x26ec('0x8c')]['bulkCreate'](_0x243a65,{'transaction':_0x17a503});});}else{_0x4abd0e=0x194;_0x46d2b3=[];}});})[_0x26ec('0x23')](function(){if(_0x4abd0e!==0x194){return db[_0x26ec('0x8c')][_0x26ec('0xb6')]({'where':{'OpenchannelAccountId':_0x3c0ed1},'order':'priority'})[_0x26ec('0x23')](function(_0x4ee48e){_0x46d2b3=_0x4ee48e;});}})[_0x26ec('0x2c')](function(_0x2de290){_0x4abd0e=0x1f4;logger[_0x26ec('0x27')](_0x2de290['stack']);if(_0x2de290['name']){delete _0x2de290['name'];}_0x46d2b3=_0x2de290;})['finally'](function(){if(_0x46d2b3===null){_0x1debd5[_0x26ec('0x3c')](_0x4abd0e);}else{if(_0x4abd0e===0x1f4){_0x1debd5[_0x26ec('0x2e')](_0x4abd0e)['send'](_0x46d2b3);}else{_0x1debd5[_0x26ec('0x2e')](_0x4abd0e)[_0x26ec('0x2f')](_0x46d2b3);}}});};exports[_0x26ec('0xb7')]=function(_0x10513b,_0x27492d,_0x43b770){var _0x33f661={};var _0x4968a5={};var _0x40c72b;var _0x1c28b4;return db[_0x26ec('0x42')][_0x26ec('0xb5')]({'where':{'id':_0x10513b[_0x26ec('0x5b')]['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x27492d,null))['then'](function(_0x3faae3){if(_0x3faae3){_0x40c72b=_0x3faae3;_0x4968a5[_0x26ec('0x47')]=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x4968a5[_0x26ec('0x48')]=_[_0x26ec('0x49')](_0x10513b[_0x26ec('0x48')]);_0x4968a5[_0x26ec('0x54')]=_[_0x26ec('0x4a')](_0x4968a5[_0x26ec('0x47')],_0x4968a5[_0x26ec('0x48')]);_0x33f661[_0x26ec('0x4b')]=_[_0x26ec('0x4a')](_0x4968a5['model'],qs[_0x26ec('0x4c')](_0x10513b[_0x26ec('0x48')][_0x26ec('0x4c')]));_0x33f661[_0x26ec('0x4b')]=_0x33f661[_0x26ec('0x4b')]['length']?_0x33f661[_0x26ec('0x4b')]:_0x4968a5[_0x26ec('0x47')];_0x33f661[_0x26ec('0x51')]=qs[_0x26ec('0x52')](_0x10513b[_0x26ec('0x48')][_0x26ec('0x52')]);_0x33f661['where']=qs[_0x26ec('0x54')](_['pick'](_0x10513b[_0x26ec('0x48')],_0x4968a5['filters']));if(_0x10513b[_0x26ec('0x48')]['filter']){_0x33f661[_0x26ec('0x53')]=_[_0x26ec('0x5e')](_0x33f661['where'],{'$or':_['map'](_0x33f661[_0x26ec('0x4b')],function(_0x3730dd){var _0x550ef1={};_0x550ef1[_0x3730dd]={'$like':'%'+_0x10513b[_0x26ec('0x48')][_0x26ec('0x56')]+'%'};return _0x550ef1;})});}_0x33f661=_['merge']({},_0x33f661,_0x10513b['options']);return _0x40c72b[_0x26ec('0xb7')](_0x33f661);}})['then'](function(_0x21089c){if(_0x21089c){_0x1c28b4=_0x21089c['length'];if(!_0x10513b[_0x26ec('0x48')][_0x26ec('0x4e')](_0x26ec('0x4f'))){_0x33f661['limit']=qs['limit'](_0x10513b[_0x26ec('0x48')][_0x26ec('0x50')]);_0x33f661[_0x26ec('0x30')]=qs[_0x26ec('0x30')](_0x10513b['query'][_0x26ec('0x30')]);}return _0x40c72b[_0x26ec('0xb7')](_0x33f661);}})[_0x26ec('0x23')](function(_0x18db24){if(_0x18db24){return _0x18db24?{'count':_0x1c28b4,'rows':_0x18db24}:null;}})[_0x26ec('0x23')](respondWithResult(_0x27492d,null))[_0x26ec('0x2c')](handleError(_0x27492d,null));};exports[_0x26ec('0xb8')]=function(_0x44416b,_0x344173,_0x46cfd4){var _0x4fdf95={'raw':![],'where':{}};var _0xa8a550={};var _0x1768e3={'count':0x0,'rows':[]};return db[_0x26ec('0x42')]['findOne']({'where':{'id':_0x44416b[_0x26ec('0x5b')]['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x344173,null))[_0x26ec('0x23')](function(_0x4e5a0d){if(_0x4e5a0d){_0xa8a550[_0x26ec('0x47')]=_['keys'](db['OpenchannelInteraction'][_0x26ec('0x43')]);_0xa8a550['query']=_[_0x26ec('0x49')](_0x44416b[_0x26ec('0x48')]);_0xa8a550[_0x26ec('0x54')]=_[_0x26ec('0x4a')](_0xa8a550[_0x26ec('0x47')],_0xa8a550[_0x26ec('0x48')]);_0x4fdf95[_0x26ec('0x4b')]=_[_0x26ec('0x4a')](_0xa8a550[_0x26ec('0x47')],qs[_0x26ec('0x4c')](_0x44416b[_0x26ec('0x48')][_0x26ec('0x4c')]));_0x4fdf95['attributes']=_0x4fdf95[_0x26ec('0x4b')][_0x26ec('0x4d')]?_0x4fdf95[_0x26ec('0x4b')]:_0xa8a550[_0x26ec('0x47')];if(!_0x44416b[_0x26ec('0x48')][_0x26ec('0x4e')](_0x26ec('0x4f'))){_0x4fdf95[_0x26ec('0x50')]=qs['limit'](_0x44416b['query'][_0x26ec('0x50')]);_0x4fdf95['offset']=qs[_0x26ec('0x30')](_0x44416b['query'][_0x26ec('0x30')]);}_0x4fdf95[_0x26ec('0x51')]=qs[_0x26ec('0x52')](_0x44416b['query'][_0x26ec('0x52')]);_0x4fdf95[_0x26ec('0x53')]=qs[_0x26ec('0x54')](_[_0x26ec('0x55')](_0x44416b[_0x26ec('0x48')],_0xa8a550[_0x26ec('0x54')]));_0x4fdf95[_0x26ec('0x53')][_0x26ec('0x6d')]=_0x4e5a0d['id'];if(_0x44416b['query'][_0x26ec('0x56')]){_0x4fdf95['where']=_[_0x26ec('0x5e')](_0x4fdf95['where'],{'$or':_[_0x26ec('0x41')](_0x4fdf95[_0x26ec('0x4b')],function(_0x438af7){var _0x306a80={};_0x306a80[_0x438af7]={'$like':'%'+_0x44416b['query'][_0x26ec('0x56')]+'%'};return _0x306a80;})});}_0x4fdf95=_[_0x26ec('0x5e')]({},_0x4fdf95,_0x44416b['options']);return db[_0x26ec('0x96')][_0x26ec('0x32')]({'where':_0x4fdf95[_0x26ec('0x53')]})['then'](function(_0xed753d){_0x1768e3['count']=_0xed753d;if(_0x44416b[_0x26ec('0x48')]['includeAll']){_0x4fdf95[_0x26ec('0x58')]=[{'model':db[_0x26ec('0x79')],'as':_0x26ec('0xb9'),'required':![]},{'model':db['User'],'as':_0x26ec('0xba'),'attributes':[_0x26ec('0x3e'),_0x26ec('0xbb'),_0x26ec('0xbc')],'required':![]},{'model':db[_0x26ec('0xbd')],'as':_0x26ec('0xbe'),'attributes':['id','name',_0x26ec('0xbf')],'where':_0x44416b[_0x26ec('0x48')][_0x26ec('0xc0')]?{'id':_0x44416b[_0x26ec('0x48')]['tag']}:undefined,'required':_0x44416b[_0x26ec('0x48')][_0x26ec('0xc0')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x26ec('0x70')](_0x4fdf95);})[_0x26ec('0x23')](function(_0x4e3431){_0x1768e3[_0x26ec('0x59')]=_0x4e3431;return _0x1768e3;});}})['then'](respondWithFilteredResult(_0x344173,_0x4fdf95))['catch'](handleError(_0x344173,null));};exports[_0x26ec('0xc1')]=function(_0x18dbcf,_0xda0a78,_0x2e9dd2){return db[_0x26ec('0x42')][_0x26ec('0x60')]({'where':{'id':_0x18dbcf['params']['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0xda0a78,null))[_0x26ec('0x23')](function(_0xcda910){if(_0xcda910){return _0xcda910[_0x26ec('0xc1')](_0x18dbcf[_0x26ec('0x62')][_0x26ec('0x72')],_[_0x26ec('0xc2')](_0x18dbcf['body'],[_0x26ec('0x72'),'id'])||{})[_0x26ec('0x99')](function(_0x55747d){for(var _0x50ef82=0x0;_0x50ef82<_0x18dbcf[_0x26ec('0x62')]['ids']['length'];_0x50ef82+=0x1){socket[_0x26ec('0xc3')]('userOpenchannelAccount:save',{'UserId':Number(_0x18dbcf[_0x26ec('0x62')][_0x26ec('0x72')][_0x50ef82]),'OpenchannelAccountId':Number(_0x18dbcf[_0x26ec('0x5b')]['id'])});}return _0x55747d;});}})[_0x26ec('0x23')](respondWithResult(_0xda0a78,null))[_0x26ec('0x2c')](handleError(_0xda0a78,null));};exports['removeAgents']=function(_0x5cec80,_0x203b3a,_0x62297e){return db[_0x26ec('0x42')]['find']({'where':{'id':_0x5cec80[_0x26ec('0x5b')]['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x203b3a,null))[_0x26ec('0x23')](function(_0x3f616b){if(_0x3f616b){return _0x3f616b[_0x26ec('0xc4')](_0x5cec80[_0x26ec('0x48')][_0x26ec('0x72')])[_0x26ec('0x23')](function(){if(_[_0x26ec('0xc5')](_0x5cec80[_0x26ec('0x48')][_0x26ec('0x72')])){for(var _0x4b6e33=0x0;_0x4b6e33<_0x5cec80[_0x26ec('0x48')]['ids']['length'];_0x4b6e33+=0x1){socket['emit'](_0x26ec('0xc6'),{'UserId':Number(_0x5cec80[_0x26ec('0x48')][_0x26ec('0x72')][_0x4b6e33]),'OpenchannelAccountId':Number(_0x5cec80[_0x26ec('0x5b')]['id'])});}}else{socket['emit'](_0x26ec('0xc6'),{'UserId':Number(_0x5cec80['query']['ids']),'OpenchannelAccountId':Number(_0x5cec80[_0x26ec('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x203b3a,null))['catch'](handleError(_0x203b3a,null));};exports[_0x26ec('0xc7')]=function(_0x4c0f82,_0x2d060e,_0xa31d01){var _0x1ab6f9={};var _0x4a823e={};var _0x3b92d9;var _0x564c00;return db['OpenchannelAccount'][_0x26ec('0xb5')]({'where':{'id':_0x4c0f82['params']['id']}})['then'](handleEntityNotFound(_0x2d060e,null))[_0x26ec('0x23')](function(_0x1a7b51){if(_0x1a7b51){_0x3b92d9=_0x1a7b51;_0x4a823e[_0x26ec('0x47')]=_['keys'](db[_0x26ec('0xc8')][_0x26ec('0x43')]);_0x4a823e[_0x26ec('0x48')]=_[_0x26ec('0x49')](_0x4c0f82[_0x26ec('0x48')]);_0x4a823e[_0x26ec('0x54')]=_['intersection'](_0x4a823e[_0x26ec('0x47')],_0x4a823e[_0x26ec('0x48')]);_0x1ab6f9['attributes']=_[_0x26ec('0x4a')](_0x4a823e[_0x26ec('0x47')],qs[_0x26ec('0x4c')](_0x4c0f82[_0x26ec('0x48')]['fields']));_0x1ab6f9[_0x26ec('0x4b')]=_0x1ab6f9['attributes']['length']?_0x1ab6f9['attributes']:_0x4a823e[_0x26ec('0x47')];_0x1ab6f9[_0x26ec('0x51')]=qs[_0x26ec('0x52')](_0x4c0f82['query'][_0x26ec('0x52')]);_0x1ab6f9[_0x26ec('0x53')]=qs[_0x26ec('0x54')](_['pick'](_0x4c0f82['query'],_0x4a823e[_0x26ec('0x54')]));if(_0x4c0f82['query'][_0x26ec('0x56')]){_0x1ab6f9[_0x26ec('0x53')]=_[_0x26ec('0x5e')](_0x1ab6f9[_0x26ec('0x53')],{'$or':_[_0x26ec('0x41')](_0x1ab6f9[_0x26ec('0x4b')],function(_0x106f13){var _0x210cc5={};_0x210cc5[_0x106f13]={'$like':'%'+_0x4c0f82['query']['filter']+'%'};return _0x210cc5;})});}_0x1ab6f9=_[_0x26ec('0x5e')]({},_0x1ab6f9,_0x4c0f82['options']);return _0x3b92d9[_0x26ec('0xc7')](_0x1ab6f9);}})[_0x26ec('0x23')](function(_0x4697c6){if(_0x4697c6){_0x564c00=_0x4697c6[_0x26ec('0x4d')];if(!_0x4c0f82[_0x26ec('0x48')][_0x26ec('0x4e')](_0x26ec('0x4f'))){_0x1ab6f9['limit']=qs[_0x26ec('0x50')](_0x4c0f82['query'][_0x26ec('0x50')]);_0x1ab6f9[_0x26ec('0x30')]=qs[_0x26ec('0x30')](_0x4c0f82[_0x26ec('0x48')][_0x26ec('0x30')]);}return _0x3b92d9['getAgents'](_0x1ab6f9);}})[_0x26ec('0x23')](function(_0x4e383b){if(_0x4e383b){return _0x4e383b?{'count':_0x564c00,'rows':_0x4e383b}:null;}})[_0x26ec('0x23')](respondWithResult(_0x2d060e,null))[_0x26ec('0x2c')](handleError(_0x2d060e,null));};exports['send']=function(_0x5cce32,_0x5a9be4,_0x4cad1f){var _0x425a36,_0x1ac026,_0xbdc050;if(_[_0x26ec('0x80')](_0x5cce32[_0x26ec('0x62')]['body'])||_0x5cce32[_0x26ec('0x62')]['body']===''){throw new db[(_0x26ec('0x83'))][(_0x26ec('0x7a'))](_0x26ec('0x84'));}if(_['isNil'](_0x5cce32[_0x26ec('0x62')]['to'])){}_0x425a36=_0x5cce32[_0x26ec('0x62')]['to'];return db[_0x26ec('0x42')][_0x26ec('0xb5')]({'where':{'id':_0x5cce32[_0x26ec('0x5b')]['id']}})[_0x26ec('0x23')](handleEntityNotFound(_0x5a9be4,null))[_0x26ec('0x23')](function(_0x2bca8c){if(_0x2bca8c){return db[_0x26ec('0x42')][_0x26ec('0x60')]({'where':{'id':_0x2bca8c['id']},'include':[{'model':db[_0x26ec('0x89')],'as':_0x26ec('0x8e'),'include':[{'model':db[_0x26ec('0x79')],'as':'Contacts','where':{[_0x2bca8c[_0x26ec('0x87')]]:_0x425a36},'limit':0x1,'order':[[_0x26ec('0x7d'),_0x26ec('0x8b')]]}]}]})[_0x26ec('0x23')](handleEntityNotFound(_0x5a9be4,null))['then'](function(_0x182b74){if(_0x182b74&&_0x182b74[_0x26ec('0x8e')]){_0x1ac026=_0x182b74[_0x26ec('0x39')]({'plain':!![]});if(_0x1ac026[_0x26ec('0x8e')]&&_0x1ac026[_0x26ec('0x8e')][_0x26ec('0x8a')]['length']){return _0x1ac026['List'][_0x26ec('0x8a')][0x0];}return db[_0x26ec('0x79')][_0x26ec('0x61')](_[_0x26ec('0x1a')](_0x5cce32['body'],{'firstName':_0x425a36,[_0x182b74[_0x26ec('0x87')]]:_0x425a36,'phone':_0x425a36,'ListId':_0x1ac026[_0x26ec('0x93')]}));}})['then'](handleEntityNotFound(_0x5a9be4,null))[_0x26ec('0x23')](function(_0x56df70){if(_0x56df70){_0xbdc050=_0x56df70;return db[_0x26ec('0x96')][_0x26ec('0x60')]({'where':{'ContactId':_0xbdc050['id'],'closed':![],'OpenchannelAccountId':_0x1ac026['id']}})[_0x26ec('0x23')](function(_0x322847){if(_0x322847){return[_0x322847,![]];}return db[_0x26ec('0x96')][_0x26ec('0x61')]({'UserId':_0x5cce32[_0x26ec('0x63')]['id'],'ContactId':_0xbdc050['id'],'OpenchannelAccountId':_0x1ac026['id'],'lastMsgDirection':_0x26ec('0xc9'),'firstMsgDirection':_0x26ec('0xc9'),'Messages':[_[_0x26ec('0x5e')](_0x5cce32[_0x26ec('0x62')],{'read':![],'body':_0x5cce32[_0x26ec('0x62')][_0x26ec('0x62')],'OpenchannelAccountId':_0x1ac026['id'],'UserId':_0x5cce32[_0x26ec('0x63')]['id'],'ContactId':_0xbdc050['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x26ec('0xca')}]})[_0x26ec('0x23')](function(_0xfe2b1c){return[_0xfe2b1c,!![]];});});}})[_0x26ec('0x99')](function(_0x34b736,_0x5a2220){if(_0x5a2220){return _0x34b736;}return db[_0x26ec('0xa4')]['create'](_[_0x26ec('0x5e')](_0x5cce32[_0x26ec('0x62')],{'read':![],'body':_0x5cce32['body'][_0x26ec('0x62')],'OpenchannelAccountId':_0x1ac026['id'],'OpenchannelInteractionId':_0x34b736['id'],'UserId':_0x5cce32['user']['id'],'ContactId':_0xbdc050['id']}))[_0x26ec('0x23')](function(_0x5c04d8){_0x34b736[_0x26ec('0xcb')][_0x26ec('0xca')]=[];_0x34b736[_0x26ec('0xcb')][_0x26ec('0xca')]['push'](_0x5c04d8[_0x26ec('0xcb')]);return _0x34b736;});});}})[_0x26ec('0x23')](respondWithResult(_0x5a9be4,null))[_0x26ec('0x2c')](handleError(_0x5a9be4,null));}; \ No newline at end of file +var _0x58b9=['../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','destroy','then','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','model','attributes','intersection','fields','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','show','params','Pause','mandatoryDispositionPause','length','OpenchannelAccount','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','OpenchannelAccountId','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','notify','openchannel','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','User','unshift','agent','waitForTheAssignedAgent','OpenchannelQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','bulkCreate','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','defaults','out','dataValues','Messages','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x10718c,_0xb0e472){var _0x15143b=function(_0x1155b1){while(--_0x1155b1){_0x10718c['push'](_0x10718c['shift']());}};_0x15143b(++_0xb0e472);}(_0x58b9,0xad));var _0x958b=function(_0x1b0ee7,_0x462851){_0x1b0ee7=_0x1b0ee7-0x0;var _0x164904=_0x58b9[_0x1b0ee7];return _0x164904;};'use strict';var emlformat=require(_0x958b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x958b('0x1'));var jsonpatch=require(_0x958b('0x2'));var rp=require(_0x958b('0x3'));var moment=require(_0x958b('0x4'));var BPromise=require(_0x958b('0x5'));var Mustache=require(_0x958b('0x6'));var util=require(_0x958b('0x7'));var path=require(_0x958b('0x8'));var sox=require(_0x958b('0x9'));var csv=require(_0x958b('0xa'));var ejs=require(_0x958b('0xb'));var fs=require('fs');var fs_extra=require(_0x958b('0xc'));var _=require(_0x958b('0xd'));var squel=require(_0x958b('0xe'));var crypto=require(_0x958b('0xf'));var jsforce=require(_0x958b('0x10'));var deskjs=require(_0x958b('0x11'));var toCsv=require(_0x958b('0xa'));var querystring=require(_0x958b('0x12'));var Papa=require('papaparse');var Redis=require(_0x958b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x958b('0x14'));var as=require(_0x958b('0x15'));var hardwareService=require(_0x958b('0x16'));var logger=require('../../config/logger')(_0x958b('0x17'));var utils=require(_0x958b('0x18'));var config=require(_0x958b('0x19'));var licenseUtil=require(_0x958b('0x1a'));var db=require(_0x958b('0x1b'))['db'];config[_0x958b('0x1c')]=_['defaults'](config['redis'],{'host':_0x958b('0x1d'),'port':0x18eb});var socket=require(_0x958b('0x1e'))(new Redis(config['redis']));require(_0x958b('0x1f'))[_0x958b('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x958b('0x21')][_0x958b('0x22')]({'port':0x232c});var client9002=jayson[_0x958b('0x21')][_0x958b('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x514a2c,_0x47de85,_0x21be54,_0x4af2d2){return new BPromise(function(_0x42a20e,_0x2adf07){var _0x7ef5e6=_0x4af2d2||client;return _0x7ef5e6[_0x958b('0x23')](_0x514a2c,_0x21be54)['then'](function(_0x4582b5){logger[_0x958b('0x24')](_0x958b('0x25'),_0x47de85,_0x958b('0x26'));logger['debug'](_0x958b('0x27'),_0x47de85,'request\x20sent',JSON[_0x958b('0x28')](_0x4582b5));if(_0x4582b5[_0x958b('0x29')]){if(_0x4582b5['error'][_0x958b('0x2a')]===0x1f4){logger[_0x958b('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x47de85,_0x4582b5[_0x958b('0x29')][_0x958b('0x2b')]);return _0x2adf07(_0x4582b5[_0x958b('0x29')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x47de85,_0x4582b5[_0x958b('0x29')][_0x958b('0x2b')]);return _0x42a20e(_0x4582b5[_0x958b('0x29')][_0x958b('0x2b')]);}else{logger['info'](_0x958b('0x25'),_0x47de85,_0x958b('0x26'));_0x42a20e(_0x4582b5[_0x958b('0x2c')][_0x958b('0x2b')]);}})[_0x958b('0x2d')](function(_0x4eaf0e){logger['error'](_0x958b('0x25'),_0x47de85,_0x4eaf0e);_0x2adf07(_0x4eaf0e);});});}function respondWithStatusCode(_0x555989,_0x59629e){_0x59629e=_0x59629e||0xcc;return function(_0x28e5da){if(_0x28e5da){return _0x555989[_0x958b('0x2e')](_0x59629e);}return _0x555989[_0x958b('0x2f')](_0x59629e)['end']();};}function respondWithResult(_0x578b19,_0x2123f6){_0x2123f6=_0x2123f6||0xc8;return function(_0x302119){if(_0x302119){return _0x578b19[_0x958b('0x2f')](_0x2123f6)['json'](_0x302119);}};}function respondWithFilteredResult(_0x383dc9,_0x2fa096){return function(_0xd4932b){if(_0xd4932b){var _0x124d86=typeof _0x2fa096[_0x958b('0x30')]===_0x958b('0x31')&&typeof _0x2fa096[_0x958b('0x32')]===_0x958b('0x31');var _0x288bde=_0xd4932b[_0x958b('0x33')];var _0x4703df=_0x124d86?0x0:_0x2fa096['offset'];var _0x567362=_0x124d86?_0xd4932b[_0x958b('0x33')]:_0x2fa096[_0x958b('0x30')]+_0x2fa096[_0x958b('0x32')];var _0x2271f8;if(_0x567362>=_0x288bde){_0x567362=_0x288bde;_0x2271f8=0xc8;}else{_0x2271f8=0xce;}_0x383dc9['status'](_0x2271f8);return _0x383dc9[_0x958b('0x34')]('Content-Range',_0x4703df+'-'+_0x567362+'/'+_0x288bde)[_0x958b('0x35')](_0xd4932b);}return null;};}function patchUpdates(_0x1e10d2){return function(_0x1c4e60){try{jsonpatch[_0x958b('0x36')](_0x1c4e60,_0x1e10d2,!![]);}catch(_0x3d7d48){return BPromise['reject'](_0x3d7d48);}return _0x1c4e60[_0x958b('0x37')]();};}function saveUpdates(_0x334e99,_0x4677e1){return function(_0x579a02){if(_0x579a02){return _0x579a02['update'](_0x334e99)['then'](function(_0x233442){return _0x233442;});}return null;};}function removeEntity(_0x25cd0a,_0x5eb490){return function(_0x1aaa51){if(_0x1aaa51){return _0x1aaa51[_0x958b('0x38')]()[_0x958b('0x39')](function(){var _0x3a1364=_0x1aaa51[_0x958b('0x3a')]({'plain':!![]});var _0x5183b3=_0x958b('0x3b');return db[_0x958b('0x3c')][_0x958b('0x38')]({'where':{'type':_0x5183b3,'resourceId':_0x3a1364['id']}})[_0x958b('0x39')](function(){return _0x1aaa51;});})[_0x958b('0x39')](function(){_0x25cd0a['status'](0xcc)[_0x958b('0x3d')]();});}};}function handleEntityNotFound(_0xb9b711,_0x34ed52){return function(_0x2a8b21){if(!_0x2a8b21){_0xb9b711[_0x958b('0x2e')](0x194);}return _0x2a8b21;};}function handleError(_0x7ab6aa,_0x31811d){_0x31811d=_0x31811d||0x1f4;return function(_0x2028ac){logger[_0x958b('0x29')](_0x2028ac[_0x958b('0x3e')]);if(_0x2028ac[_0x958b('0x3f')]){delete _0x2028ac[_0x958b('0x3f')];}_0x7ab6aa[_0x958b('0x2f')](_0x31811d)[_0x958b('0x40')](_0x2028ac);};}exports[_0x958b('0x41')]=function(_0x1bdeff,_0x4b3141){var _0xd3cbe3={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x42849f={},_0x6fd83b={'count':0x0,'rows':[]};var _0x687dc8=_[_0x958b('0x42')](db['OpenchannelAccount'][_0x958b('0x43')],function(_0x1ca604){return{'name':_0x1ca604[_0x958b('0x44')],'type':_0x1ca604[_0x958b('0x45')]['key']};});_0x42849f['model']=_[_0x958b('0x42')](_0x687dc8,'name');_0x42849f[_0x958b('0x46')]=_[_0x958b('0x47')](_0x1bdeff[_0x958b('0x46')]);_0x42849f['filters']=_['intersection'](_0x42849f[_0x958b('0x48')],_0x42849f[_0x958b('0x46')]);_0xd3cbe3[_0x958b('0x49')]=_[_0x958b('0x4a')](_0x42849f[_0x958b('0x48')],qs[_0x958b('0x4b')](_0x1bdeff[_0x958b('0x46')]['fields']));_0xd3cbe3[_0x958b('0x49')]=_0xd3cbe3[_0x958b('0x49')]['length']?_0xd3cbe3['attributes']:_0x42849f['model'];if(!_0x1bdeff[_0x958b('0x46')]['hasOwnProperty']('nolimit')){_0xd3cbe3['limit']=qs[_0x958b('0x32')](_0x1bdeff['query']['limit']);_0xd3cbe3[_0x958b('0x30')]=qs[_0x958b('0x30')](_0x1bdeff[_0x958b('0x46')]['offset']);}_0xd3cbe3[_0x958b('0x4c')]=qs[_0x958b('0x4d')](_0x1bdeff[_0x958b('0x46')]['sort']);_0xd3cbe3[_0x958b('0x4e')]=qs[_0x958b('0x4f')](_[_0x958b('0x50')](_0x1bdeff[_0x958b('0x46')],_0x42849f[_0x958b('0x4f')]),_0x687dc8);if(_0x1bdeff[_0x958b('0x46')]['filter']){_0xd3cbe3[_0x958b('0x4e')]=_[_0x958b('0x51')](_0xd3cbe3[_0x958b('0x4e')],{'$or':_[_0x958b('0x42')](_0x687dc8,function(_0x277f82){if(_0x277f82[_0x958b('0x45')]!=='VIRTUAL'){var _0x67e52b={};_0x67e52b[_0x277f82['name']]={'$like':'%'+_0x1bdeff[_0x958b('0x46')][_0x958b('0x52')]+'%'};return _0x67e52b;}})});}_0xd3cbe3=_[_0x958b('0x51')]({},_0xd3cbe3,_0x1bdeff[_0x958b('0x53')]);var _0x218b3c={'where':_0xd3cbe3[_0x958b('0x4e')]};return db['OpenchannelAccount'][_0x958b('0x33')](_0x218b3c)[_0x958b('0x39')](function(_0x23f25b){_0x6fd83b[_0x958b('0x33')]=_0x23f25b;if(_0x1bdeff[_0x958b('0x46')][_0x958b('0x54')]){_0xd3cbe3[_0x958b('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x958b('0x56')](_0xd3cbe3);})['then'](function(_0x5e4bc5){_0x6fd83b['rows']=_0x5e4bc5;return _0x6fd83b;})[_0x958b('0x39')](respondWithFilteredResult(_0x4b3141,_0xd3cbe3))[_0x958b('0x2d')](handleError(_0x4b3141,null));};exports[_0x958b('0x57')]=function(_0x20adcf,_0x1c9432){var _0xf41872={'raw':![],'where':{'id':_0x20adcf[_0x958b('0x58')]['id']},'include':[{'model':db[_0x958b('0x59')],'as':_0x958b('0x5a')}]},_0x2ec8a0={};_0x2ec8a0[_0x958b('0x48')]=_['keys'](db['OpenchannelAccount']['rawAttributes']);_0x2ec8a0[_0x958b('0x46')]=_[_0x958b('0x47')](_0x20adcf[_0x958b('0x46')]);_0x2ec8a0['filters']=_['intersection'](_0x2ec8a0[_0x958b('0x48')],_0x2ec8a0[_0x958b('0x46')]);_0xf41872['attributes']=_[_0x958b('0x4a')](_0x2ec8a0[_0x958b('0x48')],qs[_0x958b('0x4b')](_0x20adcf[_0x958b('0x46')]['fields']));_0xf41872['attributes']=_0xf41872[_0x958b('0x49')][_0x958b('0x5b')]?_0xf41872[_0x958b('0x49')]:_0x2ec8a0[_0x958b('0x48')];if(_0x20adcf[_0x958b('0x46')][_0x958b('0x54')]){_0xf41872[_0x958b('0x55')]=[{'all':!![]}];}_0xf41872=_[_0x958b('0x51')]({},_0xf41872,_0x20adcf[_0x958b('0x53')]);return db[_0x958b('0x5c')][_0x958b('0x5d')](_0xf41872)[_0x958b('0x39')](handleEntityNotFound(_0x1c9432,null))[_0x958b('0x39')](respondWithResult(_0x1c9432,null))[_0x958b('0x2d')](handleError(_0x1c9432,null));};exports[_0x958b('0x5e')]=function(_0x5b05a8,_0x1eeb04){return db[_0x958b('0x5c')][_0x958b('0x5e')](_0x5b05a8[_0x958b('0x5f')],{})[_0x958b('0x39')](function(_0x199ad8){var _0x4bf073=_0x5b05a8[_0x958b('0x60')][_0x958b('0x3a')]({'plain':!![]});if(!_0x4bf073)throw new Error(_0x958b('0x61'));if(_0x4bf073[_0x958b('0x62')]===_0x958b('0x60')){var _0x31b1cd=_0x199ad8['get']({'plain':!![]});var _0x5f49b0='OpenchannelAccounts';return db['UserProfileSection'][_0x958b('0x5d')]({'where':{'name':_0x5f49b0,'userProfileId':_0x4bf073[_0x958b('0x63')]},'raw':!![]})['then'](function(_0x1066c6){if(_0x1066c6&&_0x1066c6[_0x958b('0x64')]===0x0){return db[_0x958b('0x3c')][_0x958b('0x5e')]({'name':_0x31b1cd[_0x958b('0x3f')],'resourceId':_0x31b1cd['id'],'type':_0x1066c6[_0x958b('0x3f')],'sectionId':_0x1066c6['id']},{})[_0x958b('0x39')](function(){return _0x199ad8;});}else{return _0x199ad8;}})[_0x958b('0x2d')](function(_0x28dce1){logger[_0x958b('0x29')](_0x958b('0x65'),_0x28dce1);throw _0x28dce1;});}return _0x199ad8;})[_0x958b('0x39')](respondWithResult(_0x1eeb04,0xc9))[_0x958b('0x2d')](handleError(_0x1eeb04,null));};exports['update']=function(_0xf3e3de,_0x23edac){if(_0xf3e3de[_0x958b('0x5f')]['id']){delete _0xf3e3de[_0x958b('0x5f')]['id'];}return db[_0x958b('0x5c')][_0x958b('0x5d')]({'where':{'id':_0xf3e3de[_0x958b('0x58')]['id']},'include':[{'model':db[_0x958b('0x59')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x23edac,null))[_0x958b('0x39')](saveUpdates(_0xf3e3de[_0x958b('0x5f')],null))[_0x958b('0x39')](respondWithResult(_0x23edac,null))[_0x958b('0x2d')](handleError(_0x23edac,null));};exports[_0x958b('0x38')]=function(_0x2f7fd4,_0x25a867){return db['OpenchannelAccount']['find']({'where':{'id':_0x2f7fd4['params']['id']}})['then'](handleEntityNotFound(_0x25a867,null))['then'](removeEntity(_0x25a867,null))[_0x958b('0x2d')](handleError(_0x25a867,null));};exports['describe']=function(_0x381169,_0x1cfe3c){return db[_0x958b('0x5c')][_0x958b('0x66')]()[_0x958b('0x39')](respondWithResult(_0x1cfe3c,null))[_0x958b('0x2d')](handleError(_0x1cfe3c,null));};exports['addDisposition']=function(_0x3cdf70,_0x3636d0,_0x4592dc){if(_0x3cdf70['body']['id']){delete _0x3cdf70[_0x958b('0x5f')]['id'];}return db[_0x958b('0x5c')]['find']({'where':{'id':_0x3cdf70['params']['id']}})[_0x958b('0x39')](handleEntityNotFound(_0x3636d0,null))[_0x958b('0x39')](function(_0x239619){if(_0x239619){_0x3cdf70[_0x958b('0x5f')]['OpenchannelAccountId']=_0x239619['id'];return db[_0x958b('0x67')][_0x958b('0x5e')](_0x3cdf70[_0x958b('0x5f')]);}})['then'](respondWithResult(_0x3636d0,null))[_0x958b('0x2d')](handleError(_0x3636d0,null));};exports[_0x958b('0x68')]=function(_0x510459,_0xc6bf86,_0x34368e){var _0x429b4b={'raw':![],'where':{}};var _0x575e99={};var _0x3e1b6f={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x958b('0x69')]({'where':{'id':_0x510459[_0x958b('0x58')]['id']}})[_0x958b('0x39')](handleEntityNotFound(_0xc6bf86,null))[_0x958b('0x39')](function(_0x189267){if(_0x189267){_0x575e99[_0x958b('0x48')]=_[_0x958b('0x47')](db['Disposition'][_0x958b('0x43')]);_0x575e99[_0x958b('0x46')]=_[_0x958b('0x47')](_0x510459[_0x958b('0x46')]);_0x575e99[_0x958b('0x4f')]=_[_0x958b('0x4a')](_0x575e99[_0x958b('0x48')],_0x575e99['query']);_0x429b4b[_0x958b('0x49')]=_[_0x958b('0x4a')](_0x575e99['model'],qs[_0x958b('0x4b')](_0x510459['query'][_0x958b('0x4b')]));_0x429b4b[_0x958b('0x49')]=_0x429b4b[_0x958b('0x49')][_0x958b('0x5b')]?_0x429b4b[_0x958b('0x49')]:_0x575e99[_0x958b('0x48')];if(!_0x510459[_0x958b('0x46')][_0x958b('0x6a')](_0x958b('0x6b'))){_0x429b4b[_0x958b('0x32')]=qs[_0x958b('0x32')](_0x510459['query'][_0x958b('0x32')]);_0x429b4b[_0x958b('0x30')]=qs[_0x958b('0x30')](_0x510459['query'][_0x958b('0x30')]);}_0x429b4b[_0x958b('0x4c')]=qs[_0x958b('0x4d')](_0x510459[_0x958b('0x46')][_0x958b('0x4d')]);_0x429b4b[_0x958b('0x4e')]=qs[_0x958b('0x4f')](_[_0x958b('0x50')](_0x510459[_0x958b('0x46')],_0x575e99[_0x958b('0x4f')]));_0x429b4b[_0x958b('0x4e')][_0x958b('0x6c')]=_0x189267['id'];if(_0x510459[_0x958b('0x46')]['filter']){_0x429b4b['where']=_[_0x958b('0x51')](_0x429b4b[_0x958b('0x4e')],{'$or':_[_0x958b('0x42')](_0x429b4b[_0x958b('0x49')],function(_0x324ff7){var _0x2b455d={};_0x2b455d[_0x324ff7]={'$like':'%'+_0x510459[_0x958b('0x46')]['filter']+'%'};return _0x2b455d;})});}_0x429b4b=_[_0x958b('0x51')]({},_0x429b4b,_0x510459[_0x958b('0x53')]);return db[_0x958b('0x67')][_0x958b('0x33')]({'where':_0x429b4b[_0x958b('0x4e')]})[_0x958b('0x39')](function(_0x45ea8d){_0x3e1b6f[_0x958b('0x33')]=_0x45ea8d;if(_0x510459[_0x958b('0x46')][_0x958b('0x54')]){_0x429b4b['include']=[{'all':!![]}];}return db[_0x958b('0x67')]['findAll'](_0x429b4b);})[_0x958b('0x39')](function(_0x44b1aa){_0x3e1b6f[_0x958b('0x6d')]=_0x44b1aa;return _0x3e1b6f;});}})[_0x958b('0x39')](respondWithFilteredResult(_0xc6bf86,_0x429b4b))[_0x958b('0x2d')](handleError(_0xc6bf86,null));};exports[_0x958b('0x6e')]=function(_0x366ec8,_0x25161f,_0x475318){return db[_0x958b('0x5c')][_0x958b('0x5d')]({'where':{'id':_0x366ec8[_0x958b('0x58')]['id']}})[_0x958b('0x39')](handleEntityNotFound(_0x25161f,null))[_0x958b('0x39')](function(_0x2ffd8c){if(_0x2ffd8c){return _0x2ffd8c['removeDispositions'](_0x366ec8[_0x958b('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x25161f,null))['catch'](handleError(_0x25161f,null));};exports[_0x958b('0x6f')]=function(_0x2de381,_0x354645,_0x927d76){if(_0x2de381[_0x958b('0x5f')]['id']){delete _0x2de381[_0x958b('0x5f')]['id'];}return db[_0x958b('0x5c')]['find']({'where':{'id':_0x2de381[_0x958b('0x58')]['id']}})['then'](handleEntityNotFound(_0x354645,null))[_0x958b('0x39')](function(_0x27516f){if(_0x27516f){_0x2de381['body'][_0x958b('0x6c')]=_0x27516f['id'];return db[_0x958b('0x70')][_0x958b('0x5e')](_0x2de381[_0x958b('0x5f')]);}})[_0x958b('0x39')](respondWithResult(_0x354645,null))[_0x958b('0x2d')](handleError(_0x354645,null));};exports['getAnswers']=function(_0x235095,_0x43fe79,_0x22cd1f){var _0x40b823={'raw':![],'where':{}};var _0x1d4d11={};var _0x16e934={'count':0x0,'rows':[]};return db[_0x958b('0x5c')][_0x958b('0x69')]({'where':{'id':_0x235095['params']['id']}})[_0x958b('0x39')](handleEntityNotFound(_0x43fe79,null))[_0x958b('0x39')](function(_0x4c194f){if(_0x4c194f){_0x1d4d11[_0x958b('0x48')]=_[_0x958b('0x47')](db[_0x958b('0x70')][_0x958b('0x43')]);_0x1d4d11[_0x958b('0x46')]=_[_0x958b('0x47')](_0x235095[_0x958b('0x46')]);_0x1d4d11['filters']=_[_0x958b('0x4a')](_0x1d4d11[_0x958b('0x48')],_0x1d4d11[_0x958b('0x46')]);_0x40b823[_0x958b('0x49')]=_[_0x958b('0x4a')](_0x1d4d11[_0x958b('0x48')],qs['fields'](_0x235095[_0x958b('0x46')][_0x958b('0x4b')]));_0x40b823[_0x958b('0x49')]=_0x40b823[_0x958b('0x49')][_0x958b('0x5b')]?_0x40b823[_0x958b('0x49')]:_0x1d4d11['model'];if(!_0x235095[_0x958b('0x46')][_0x958b('0x6a')](_0x958b('0x6b'))){_0x40b823[_0x958b('0x32')]=qs[_0x958b('0x32')](_0x235095[_0x958b('0x46')][_0x958b('0x32')]);_0x40b823[_0x958b('0x30')]=qs[_0x958b('0x30')](_0x235095[_0x958b('0x46')][_0x958b('0x30')]);}_0x40b823[_0x958b('0x4c')]=qs[_0x958b('0x4d')](_0x235095[_0x958b('0x46')][_0x958b('0x4d')]);_0x40b823['where']=qs['filters'](_['pick'](_0x235095[_0x958b('0x46')],_0x1d4d11[_0x958b('0x4f')]));_0x40b823[_0x958b('0x4e')][_0x958b('0x6c')]=_0x4c194f['id'];if(_0x235095[_0x958b('0x46')][_0x958b('0x52')]){_0x40b823[_0x958b('0x4e')]=_[_0x958b('0x51')](_0x40b823[_0x958b('0x4e')],{'$or':_['map'](_0x40b823[_0x958b('0x49')],function(_0x59da2d){var _0x111dad={};_0x111dad[_0x59da2d]={'$like':'%'+_0x235095['query']['filter']+'%'};return _0x111dad;})});}_0x40b823=_[_0x958b('0x51')]({},_0x40b823,_0x235095[_0x958b('0x53')]);return db[_0x958b('0x70')]['count']({'where':_0x40b823[_0x958b('0x4e')]})[_0x958b('0x39')](function(_0x40b25f){_0x16e934['count']=_0x40b25f;if(_0x235095[_0x958b('0x46')][_0x958b('0x54')]){_0x40b823[_0x958b('0x55')]=[{'all':!![]}];}return db[_0x958b('0x70')][_0x958b('0x56')](_0x40b823);})[_0x958b('0x39')](function(_0x4beab4){_0x16e934['rows']=_0x4beab4;return _0x16e934;});}})[_0x958b('0x39')](respondWithFilteredResult(_0x43fe79,_0x40b823))[_0x958b('0x2d')](handleError(_0x43fe79,null));};exports['removeAnswers']=function(_0x1ef26c,_0x4e7dee,_0x71e696){return db[_0x958b('0x5c')][_0x958b('0x5d')]({'where':{'id':_0x1ef26c[_0x958b('0x58')]['id']}})[_0x958b('0x39')](handleEntityNotFound(_0x4e7dee,null))[_0x958b('0x39')](function(_0x594637){if(_0x594637){return _0x594637[_0x958b('0x71')](_0x1ef26c['query'][_0x958b('0x72')]);}})[_0x958b('0x39')](respondWithStatusCode(_0x4e7dee,null))['catch'](handleError(_0x4e7dee,null));};exports[_0x958b('0x73')]=function(_0x8ae978,_0x3289e6,_0x26c6f8){var _0x2126a9={'body':_0x8ae978[_0x958b('0x5f')],'channel':_0x958b('0x74')};var _0x4174c=[];var _0x1d04ab=[];var _0xe1f025={};var _0x1ce1ae=![];return db['CmContact'][_0x958b('0x66')]()['then'](function(_0x5a203a){if(!_0x5a203a){throw new db[(_0x958b('0x75'))]['ValidationError'](_0x958b('0x76'));}_0x4174c=_[_0x958b('0x77')](_[_0x958b('0x47')](_0x5a203a),['createdAt',_0x958b('0x78')]);_0x1d04ab=_[_0x958b('0x77')](_[_0x958b('0x47')](_0x5a203a),[_0x958b('0x79'),_0x958b('0x78'),_0x958b('0x7a'),_0x958b('0x7b')]);if(_0x8ae978[_0x958b('0x5f')]['id']){delete _0x8ae978[_0x958b('0x5f')]['id'];}if(_[_0x958b('0x7c')](_0x8ae978[_0x958b('0x5f')][_0x958b('0x7d')])){throw new db[(_0x958b('0x75'))][(_0x958b('0x7e'))]('from\x20is\x20mandatory');}if(_[_0x958b('0x7c')](_0x8ae978['body'][_0x958b('0x5f')])||_0x8ae978[_0x958b('0x5f')][_0x958b('0x5f')]===''){throw new db[(_0x958b('0x75'))][(_0x958b('0x7e'))](_0x958b('0x7f'));}if(_['isNil'](_0x8ae978[_0x958b('0x5f')][_0x958b('0x80')])){throw new db['Sequelize']['ValidationError'](_0x958b('0x81')+_0x1d04ab);}if(!_[_0x958b('0x82')](_0x1d04ab,_0x8ae978[_0x958b('0x5f')][_0x958b('0x80')])){throw new db[(_0x958b('0x75'))][(_0x958b('0x7e'))](_0x958b('0x83')+_0x1d04ab);}_0xe1f025[_0x8ae978[_0x958b('0x5f')][_0x958b('0x80')]]=_0x8ae978[_0x958b('0x5f')][_0x958b('0x7d')];})[_0x958b('0x39')](function(){return db[_0x958b('0x5c')]['find']({'where':{'id':_0x8ae978[_0x958b('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x958b('0x84'),'include':[{'model':db[_0x958b('0x85')],'as':_0x958b('0x86'),'where':_0xe1f025,'limit':0x1,'order':[['updatedAt',_0x958b('0x87')]]}]},{'model':db[_0x958b('0x88')],'as':_0x958b('0x89')}]});})[_0x958b('0x39')](handleEntityNotFound(_0x3289e6,null))[_0x958b('0x39')](function(_0x449e11){if(_0x449e11&&_0x449e11[_0x958b('0x84')]){_0x2126a9[_0x958b('0x8a')]=_0x449e11;_0x2126a9['applications']=_0x449e11[_0x958b('0x89')];_0x2126a9[_0x958b('0x8b')]=_0x449e11[_0x958b('0x84')];_0x2126a9[_0x958b('0x8c')]=_[_0x958b('0x8d')](_0x2126a9[_0x958b('0x8c')],[_0x958b('0x8e')],[_0x958b('0x8f')]);if(_0x2126a9['account'][_0x958b('0x89')]){delete _0x2126a9[_0x958b('0x8a')][_0x958b('0x89')];}if(_0x2126a9[_0x958b('0x8a')][_0x958b('0x84')]&&_0x2126a9[_0x958b('0x8a')][_0x958b('0x84')]['Contacts'][_0x958b('0x5b')]){return _0x2126a9['account']['List'][_0x958b('0x86')][0x0];}var _0x4fb530=_['defaults'](_0x8ae978[_0x958b('0x5f')],{'firstName':_0x8ae978['body'][_0x958b('0x7d')],'ListId':_0x449e11[_0x958b('0x7b')]});_0x4fb530[_0x8ae978[_0x958b('0x5f')][_0x958b('0x80')]]=_0x8ae978[_0x958b('0x5f')]['from'];return db[_0x958b('0x85')][_0x958b('0x5e')](_0x4fb530,{'fields':_0x4174c,'raw':!![]});}})['then'](handleEntityNotFound(_0x3289e6,null))[_0x958b('0x39')](function(_0x3ec657){_0x2126a9[_0x958b('0x90')]=_0x3ec657;if(_0x3ec657){var _0x2adbb6={'ContactId':_0x3ec657['id'],'OpenchannelAccountId':_0x8ae978[_0x958b('0x58')]['id'],'from':(_0x3ec657['firstName']||'')+'\x20'+(_0x3ec657[_0x958b('0x91')]||'')};var _0x1e84de={'OpenchannelAccountId':_0x8ae978['params']['id'],'closed':![]};if(_0x8ae978[_0x958b('0x5f')][_0x958b('0x92')]){_0x1e84de[_0x958b('0x92')]=_0x8ae978[_0x958b('0x5f')][_0x958b('0x92')];return db[_0x958b('0x93')]['find']({'where':_0x1e84de})[_0x958b('0x39')](function(_0xe012ff){if(_0xe012ff){return[_0xe012ff,![]];}_0x2adbb6['threadId']=_0x8ae978[_0x958b('0x5f')][_0x958b('0x92')];_0x2adbb6[_0x958b('0x94')]=_0x8ae978[_0x958b('0x5f')][_0x958b('0x94')];return db[_0x958b('0x93')][_0x958b('0x5e')](_0x2adbb6)[_0x958b('0x39')](function(_0x1b6423){return[_0x1b6423,!![]];});});}else{_0x1e84de[_0x958b('0x92')]=null;}_0x1e84de[_0x958b('0x95')]=_0x3ec657['id'];return db[_0x958b('0x93')][_0x958b('0x5d')]({'where':_0x1e84de})['then'](function(_0x5f598a){if(_0x5f598a){return[_0x5f598a,![]];}return db[_0x958b('0x93')][_0x958b('0x5e')](_0x2adbb6)[_0x958b('0x39')](function(_0x406220){return[_0x406220,!![]];});});}})[_0x958b('0x96')](function(_0x15f4db,_0x409475){if(_0x15f4db){_0x1ce1ae=_0x409475;if(!_0x409475){var _0x3a5d99={'from':(_0x2126a9[_0x958b('0x90')][_0x958b('0x97')]||'')+'\x20'+(_0x2126a9[_0x958b('0x90')][_0x958b('0x91')]||'')};if(_0x8ae978[_0x958b('0x5f')][_0x958b('0x92')]&&_0x8ae978[_0x958b('0x5f')][_0x958b('0x98')]&&_0x8ae978['body'][_0x958b('0x92')]!=_0x8ae978[_0x958b('0x5f')]['messageId']){_0x3a5d99[_0x958b('0x92')]=_0x8ae978[_0x958b('0x5f')][_0x958b('0x98')];}return _0x15f4db['update'](_0x3a5d99);}else{return _0x15f4db;}}})[_0x958b('0x39')](function(_0x70003e){_0x2126a9[_0x958b('0x99')]=_0x70003e[_0x958b('0x3a')]({'plain':!![]});_0x2126a9[_0x958b('0x99')]['created']=_0x1ce1ae;if(_0x2126a9[_0x958b('0x99')][_0x958b('0x9a')]){if(_0x2126a9[_0x958b('0x8a')][_0x958b('0x9b')]){_0x2126a9[_0x958b('0x8c')][_0x958b('0x9c')]({'id':0x0,'priority':_0x2126a9[_0x958b('0x8c')][_0x958b('0x5b')]+0x1,'app':_0x958b('0x9d'),'appdata':_0x958b('0x9e'),'interval':_0x958b('0x9f')});}}return db[_0x958b('0xa0')]['create']({'body':_0x8ae978[_0x958b('0x5f')][_0x958b('0x5f')],'OpenchannelAccountId':_0x8ae978[_0x958b('0x58')]['id'],'OpenchannelInteractionId':_0x70003e['id'],'direction':'in','ContactId':_0x2126a9['contact']['id'],'AttachmentId':_0x8ae978[_0x958b('0x5f')]['AttachmentId']});})[_0x958b('0x39')](function(_0x457632){_0x2126a9[_0x958b('0x2b')]=_0x457632;if(!_0x2126a9[_0x958b('0x99')]['UserId'])return;return db[_0x958b('0xa1')]['find']({'attributes':['id',_0x958b('0x3f')],'where':{'id':_0x2126a9[_0x958b('0x99')]['UserId']}});})[_0x958b('0x39')](function(_0x5ca1c2){if(_0x5ca1c2){_0x2126a9['applications'][_0x958b('0xa2')]({'id':0x0,'priority':0x0,'app':_0x958b('0xa3'),'appdata':_0x5ca1c2[_0x958b('0x3f')]+','+(_0x2126a9[_0x958b('0x8a')][_0x958b('0xa4')]||0xa),'interval':_0x958b('0x9f')});}if(!_0x2126a9[_0x958b('0x99')]['queueId'])return;return db[_0x958b('0xa5')]['find']({'attributes':['id',_0x958b('0x3f')],'where':{'id':_0x2126a9[_0x958b('0x99')][_0x958b('0xa6')]}});})[_0x958b('0x39')](function(_0x5375cd){if(_0x5375cd){_0x2126a9[_0x958b('0x8c')][_0x958b('0xa2')]({'id':0x0,'priority':0x1,'app':_0x958b('0xa7'),'appdata':_0x5375cd[_0x958b('0x3f')]+','+(_0x2126a9['account'][_0x958b('0xa8')]||0x12c),'interval':_0x958b('0x9f')});}return respondWithRpcPromise(_0x958b('0xa9'),_0x958b('0xaa'),_0x2126a9);})[_0x958b('0x39')](function(_0x289e4b){respondWithRpcPromise(_0x958b('0xab'),_0x958b('0xab'),{'event':_0x958b('0x73'),'message':_0x289e4b},client9002);return _0x289e4b;})['then'](respondWithResult(_0x3289e6,null))[_0x958b('0x2d')](handleError(_0x3289e6,null));};exports[_0x958b('0xac')]=function(_0x4d9878,_0x1b5860){var _0x105310=_0x4d9878[_0x958b('0x58')]['id'];var _0x2eeb84=_0x4d9878[_0x958b('0x5f')];var _0x350a83=0xc8;var _0x98194c=null;return db[_0x958b('0xad')][_0x958b('0xae')]({'isolationLevel':db['sequelize']['Transaction'][_0x958b('0xaf')]['READ_COMMITTED']},function(_0x1ab9e5){return db[_0x958b('0x5c')][_0x958b('0x69')]({'where':{'id':_0x105310},'transaction':_0x1ab9e5})[_0x958b('0x39')](function(_0x1ba862){if(_0x1ba862){return db[_0x958b('0x88')][_0x958b('0x38')]({'where':{'OpenchannelAccountId':_0x105310},'transaction':_0x1ab9e5})['then'](function(){var _0x45e38a=_[_0x958b('0x42')](_0x2eeb84,function(_0x204c8e){_0x204c8e[_0x958b('0x6c')]=_0x105310;return _0x204c8e;});return db[_0x958b('0x88')][_0x958b('0xb0')](_0x45e38a,{'transaction':_0x1ab9e5});});}else{_0x350a83=0x194;_0x98194c=[];}});})[_0x958b('0x39')](function(){if(_0x350a83!==0x194){return db[_0x958b('0x88')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x105310},'order':_0x958b('0x8e')})['then'](function(_0x15246d){_0x98194c=_0x15246d;});}})[_0x958b('0x2d')](function(_0x54bb24){_0x350a83=0x1f4;logger['error'](_0x54bb24[_0x958b('0x3e')]);if(_0x54bb24[_0x958b('0x3f')]){delete _0x54bb24[_0x958b('0x3f')];}_0x98194c=_0x54bb24;})['finally'](function(){if(_0x98194c===null){_0x1b5860[_0x958b('0x2e')](_0x350a83);}else{if(_0x350a83===0x1f4){_0x1b5860[_0x958b('0x2f')](_0x350a83)['send'](_0x98194c);}else{_0x1b5860[_0x958b('0x2f')](_0x350a83)[_0x958b('0x35')](_0x98194c);}}});};exports['getApplications']=function(_0x516371,_0x1fc53b,_0x43a32c){var _0x19ba70={};var _0x2faa6d={};var _0x181ae3;var _0x1f468a;return db[_0x958b('0x5c')][_0x958b('0x69')]({'where':{'id':_0x516371[_0x958b('0x58')]['id']}})[_0x958b('0x39')](handleEntityNotFound(_0x1fc53b,null))['then'](function(_0x35041f){if(_0x35041f){_0x181ae3=_0x35041f;_0x2faa6d['model']=_[_0x958b('0x47')](db['OpenchannelApplication'][_0x958b('0x43')]);_0x2faa6d[_0x958b('0x46')]=_[_0x958b('0x47')](_0x516371[_0x958b('0x46')]);_0x2faa6d[_0x958b('0x4f')]=_[_0x958b('0x4a')](_0x2faa6d['model'],_0x2faa6d[_0x958b('0x46')]);_0x19ba70['attributes']=_[_0x958b('0x4a')](_0x2faa6d[_0x958b('0x48')],qs[_0x958b('0x4b')](_0x516371[_0x958b('0x46')]['fields']));_0x19ba70['attributes']=_0x19ba70[_0x958b('0x49')]['length']?_0x19ba70[_0x958b('0x49')]:_0x2faa6d[_0x958b('0x48')];_0x19ba70[_0x958b('0x4c')]=qs['sort'](_0x516371[_0x958b('0x46')][_0x958b('0x4d')]);_0x19ba70['where']=qs[_0x958b('0x4f')](_[_0x958b('0x50')](_0x516371[_0x958b('0x46')],_0x2faa6d[_0x958b('0x4f')]));if(_0x516371[_0x958b('0x46')][_0x958b('0x52')]){_0x19ba70['where']=_[_0x958b('0x51')](_0x19ba70[_0x958b('0x4e')],{'$or':_['map'](_0x19ba70['attributes'],function(_0x112f85){var _0x5c2972={};_0x5c2972[_0x112f85]={'$like':'%'+_0x516371['query'][_0x958b('0x52')]+'%'};return _0x5c2972;})});}_0x19ba70=_['merge']({},_0x19ba70,_0x516371[_0x958b('0x53')]);return _0x181ae3[_0x958b('0xb1')](_0x19ba70);}})['then'](function(_0x4131e6){if(_0x4131e6){_0x1f468a=_0x4131e6[_0x958b('0x5b')];if(!_0x516371[_0x958b('0x46')]['hasOwnProperty']('nolimit')){_0x19ba70[_0x958b('0x32')]=qs[_0x958b('0x32')](_0x516371['query'][_0x958b('0x32')]);_0x19ba70[_0x958b('0x30')]=qs[_0x958b('0x30')](_0x516371[_0x958b('0x46')][_0x958b('0x30')]);}return _0x181ae3['getApplications'](_0x19ba70);}})[_0x958b('0x39')](function(_0x148337){if(_0x148337){return _0x148337?{'count':_0x1f468a,'rows':_0x148337}:null;}})[_0x958b('0x39')](respondWithResult(_0x1fc53b,null))[_0x958b('0x2d')](handleError(_0x1fc53b,null));};exports[_0x958b('0xb2')]=function(_0x2bb240,_0x283640,_0x412e9a){var _0x48f072={'raw':![],'where':{}};var _0x5ba2d2={};var _0x1a5db1={'count':0x0,'rows':[]};return db[_0x958b('0x5c')][_0x958b('0x69')]({'where':{'id':_0x2bb240[_0x958b('0x58')]['id']}})[_0x958b('0x39')](handleEntityNotFound(_0x283640,null))[_0x958b('0x39')](function(_0x50a187){if(_0x50a187){_0x5ba2d2[_0x958b('0x48')]=_[_0x958b('0x47')](db[_0x958b('0x93')][_0x958b('0x43')]);_0x5ba2d2[_0x958b('0x46')]=_[_0x958b('0x47')](_0x2bb240[_0x958b('0x46')]);_0x5ba2d2['filters']=_[_0x958b('0x4a')](_0x5ba2d2[_0x958b('0x48')],_0x5ba2d2['query']);_0x48f072[_0x958b('0x49')]=_[_0x958b('0x4a')](_0x5ba2d2[_0x958b('0x48')],qs[_0x958b('0x4b')](_0x2bb240[_0x958b('0x46')]['fields']));_0x48f072[_0x958b('0x49')]=_0x48f072[_0x958b('0x49')][_0x958b('0x5b')]?_0x48f072['attributes']:_0x5ba2d2[_0x958b('0x48')];if(!_0x2bb240['query'][_0x958b('0x6a')](_0x958b('0x6b'))){_0x48f072[_0x958b('0x32')]=qs[_0x958b('0x32')](_0x2bb240[_0x958b('0x46')][_0x958b('0x32')]);_0x48f072['offset']=qs['offset'](_0x2bb240[_0x958b('0x46')]['offset']);}_0x48f072['order']=qs['sort'](_0x2bb240[_0x958b('0x46')]['sort']);_0x48f072[_0x958b('0x4e')]=qs['filters'](_[_0x958b('0x50')](_0x2bb240[_0x958b('0x46')],_0x5ba2d2[_0x958b('0x4f')]));_0x48f072[_0x958b('0x4e')][_0x958b('0x6c')]=_0x50a187['id'];if(_0x2bb240['query'][_0x958b('0x52')]){_0x48f072[_0x958b('0x4e')]=_[_0x958b('0x51')](_0x48f072['where'],{'$or':_[_0x958b('0x42')](_0x48f072[_0x958b('0x49')],function(_0x176843){var _0x5401d0={};_0x5401d0[_0x176843]={'$like':'%'+_0x2bb240[_0x958b('0x46')][_0x958b('0x52')]+'%'};return _0x5401d0;})});}_0x48f072=_[_0x958b('0x51')]({},_0x48f072,_0x2bb240['options']);return db['OpenchannelInteraction'][_0x958b('0x33')]({'where':_0x48f072[_0x958b('0x4e')]})[_0x958b('0x39')](function(_0x566c42){_0x1a5db1[_0x958b('0x33')]=_0x566c42;if(_0x2bb240[_0x958b('0x46')][_0x958b('0x54')]){_0x48f072['include']=[{'model':db[_0x958b('0x85')],'as':_0x958b('0xb3'),'required':![]},{'model':db['User'],'as':_0x958b('0xb4'),'attributes':[_0x958b('0x3f'),'fullname',_0x958b('0xb5')],'required':![]},{'model':db[_0x958b('0xb6')],'as':_0x958b('0xb7'),'attributes':['id',_0x958b('0x3f'),_0x958b('0xb8')],'where':_0x2bb240['query'][_0x958b('0xb9')]?{'id':_0x2bb240[_0x958b('0x46')][_0x958b('0xb9')]}:undefined,'required':_0x2bb240[_0x958b('0x46')][_0x958b('0xb9')]?!![]:![]}];}return db[_0x958b('0x93')]['findAll'](_0x48f072);})[_0x958b('0x39')](function(_0x5792db){_0x1a5db1[_0x958b('0x6d')]=_0x5792db;return _0x1a5db1;});}})[_0x958b('0x39')](respondWithFilteredResult(_0x283640,_0x48f072))[_0x958b('0x2d')](handleError(_0x283640,null));};exports[_0x958b('0xba')]=function(_0x46697e,_0x2352ab,_0x284d5e){return db[_0x958b('0x5c')]['find']({'where':{'id':_0x46697e['params']['id']}})['then'](handleEntityNotFound(_0x2352ab,null))['then'](function(_0x3467df){if(_0x3467df){return _0x3467df[_0x958b('0xba')](_0x46697e[_0x958b('0x5f')][_0x958b('0x72')],_['omit'](_0x46697e[_0x958b('0x5f')],[_0x958b('0x72'),'id'])||{})[_0x958b('0x96')](function(_0x3fe7a1){for(var _0x14826f=0x0;_0x14826f<_0x46697e[_0x958b('0x5f')][_0x958b('0x72')]['length'];_0x14826f+=0x1){socket[_0x958b('0xbb')](_0x958b('0xbc'),{'UserId':Number(_0x46697e['body'][_0x958b('0x72')][_0x14826f]),'OpenchannelAccountId':Number(_0x46697e[_0x958b('0x58')]['id'])});}return _0x3fe7a1;});}})[_0x958b('0x39')](respondWithResult(_0x2352ab,null))[_0x958b('0x2d')](handleError(_0x2352ab,null));};exports[_0x958b('0xbd')]=function(_0x237f10,_0x4c53c2,_0x17301b){return db['OpenchannelAccount']['find']({'where':{'id':_0x237f10[_0x958b('0x58')]['id']}})[_0x958b('0x39')](handleEntityNotFound(_0x4c53c2,null))[_0x958b('0x39')](function(_0x809de2){if(_0x809de2){return _0x809de2[_0x958b('0xbd')](_0x237f10['query'][_0x958b('0x72')])[_0x958b('0x39')](function(){if(_[_0x958b('0xbe')](_0x237f10[_0x958b('0x46')][_0x958b('0x72')])){for(var _0x1ee1c6=0x0;_0x1ee1c6<_0x237f10[_0x958b('0x46')][_0x958b('0x72')]['length'];_0x1ee1c6+=0x1){socket[_0x958b('0xbb')](_0x958b('0xbf'),{'UserId':Number(_0x237f10[_0x958b('0x46')][_0x958b('0x72')][_0x1ee1c6]),'OpenchannelAccountId':Number(_0x237f10[_0x958b('0x58')]['id'])});}}else{socket[_0x958b('0xbb')](_0x958b('0xbf'),{'UserId':Number(_0x237f10['query'][_0x958b('0x72')]),'OpenchannelAccountId':Number(_0x237f10[_0x958b('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c53c2,null))[_0x958b('0x2d')](handleError(_0x4c53c2,null));};exports[_0x958b('0xc0')]=function(_0x4b5e70,_0x142890,_0x3138fc){var _0x5efa61={};var _0x3a3d05={};var _0x3edd06;var _0x476157;return db[_0x958b('0x5c')][_0x958b('0x69')]({'where':{'id':_0x4b5e70['params']['id']}})[_0x958b('0x39')](handleEntityNotFound(_0x142890,null))[_0x958b('0x39')](function(_0x446f10){if(_0x446f10){_0x3edd06=_0x446f10;_0x3a3d05[_0x958b('0x48')]=_[_0x958b('0x47')](db[_0x958b('0xa1')][_0x958b('0x43')]);_0x3a3d05[_0x958b('0x46')]=_[_0x958b('0x47')](_0x4b5e70[_0x958b('0x46')]);_0x3a3d05['filters']=_[_0x958b('0x4a')](_0x3a3d05[_0x958b('0x48')],_0x3a3d05[_0x958b('0x46')]);_0x5efa61[_0x958b('0x49')]=_[_0x958b('0x4a')](_0x3a3d05[_0x958b('0x48')],qs[_0x958b('0x4b')](_0x4b5e70[_0x958b('0x46')]['fields']));_0x5efa61[_0x958b('0x49')]=_0x5efa61[_0x958b('0x49')][_0x958b('0x5b')]?_0x5efa61[_0x958b('0x49')]:_0x3a3d05[_0x958b('0x48')];_0x5efa61[_0x958b('0x4c')]=qs[_0x958b('0x4d')](_0x4b5e70[_0x958b('0x46')][_0x958b('0x4d')]);_0x5efa61['where']=qs['filters'](_[_0x958b('0x50')](_0x4b5e70[_0x958b('0x46')],_0x3a3d05[_0x958b('0x4f')]));if(_0x4b5e70[_0x958b('0x46')][_0x958b('0x52')]){_0x5efa61[_0x958b('0x4e')]=_[_0x958b('0x51')](_0x5efa61[_0x958b('0x4e')],{'$or':_[_0x958b('0x42')](_0x5efa61['attributes'],function(_0x13789f){var _0x581313={};_0x581313[_0x13789f]={'$like':'%'+_0x4b5e70[_0x958b('0x46')]['filter']+'%'};return _0x581313;})});}_0x5efa61=_['merge']({},_0x5efa61,_0x4b5e70[_0x958b('0x53')]);return _0x3edd06[_0x958b('0xc0')](_0x5efa61);}})[_0x958b('0x39')](function(_0x181e94){if(_0x181e94){_0x476157=_0x181e94[_0x958b('0x5b')];if(!_0x4b5e70[_0x958b('0x46')][_0x958b('0x6a')](_0x958b('0x6b'))){_0x5efa61[_0x958b('0x32')]=qs[_0x958b('0x32')](_0x4b5e70[_0x958b('0x46')][_0x958b('0x32')]);_0x5efa61['offset']=qs[_0x958b('0x30')](_0x4b5e70['query'][_0x958b('0x30')]);}return _0x3edd06[_0x958b('0xc0')](_0x5efa61);}})['then'](function(_0x26254e){if(_0x26254e){return _0x26254e?{'count':_0x476157,'rows':_0x26254e}:null;}})[_0x958b('0x39')](respondWithResult(_0x142890,null))[_0x958b('0x2d')](handleError(_0x142890,null));};exports[_0x958b('0x40')]=function(_0x2c9852,_0x34cbc7,_0x42550b){var _0x41a2b7,_0x58a45a,_0x3178a0;if(_[_0x958b('0x7c')](_0x2c9852[_0x958b('0x5f')][_0x958b('0x5f')])||_0x2c9852[_0x958b('0x5f')][_0x958b('0x5f')]===''){throw new db[(_0x958b('0x75'))]['ValidationError'](_0x958b('0x7f'));}if(_[_0x958b('0x7c')](_0x2c9852[_0x958b('0x5f')]['to'])){}_0x41a2b7=_0x2c9852[_0x958b('0x5f')]['to'];return db[_0x958b('0x5c')][_0x958b('0x69')]({'where':{'id':_0x2c9852[_0x958b('0x58')]['id']}})[_0x958b('0x39')](handleEntityNotFound(_0x34cbc7,null))[_0x958b('0x39')](function(_0x4a9340){if(_0x4a9340){return db[_0x958b('0x5c')][_0x958b('0x5d')]({'where':{'id':_0x4a9340['id']},'include':[{'model':db[_0x958b('0xc1')],'as':_0x958b('0x84'),'include':[{'model':db[_0x958b('0x85')],'as':_0x958b('0x86'),'where':{[_0x4a9340[_0x958b('0x80')]]:_0x41a2b7},'limit':0x1,'order':[[_0x958b('0x78'),_0x958b('0x87')]]}]}]})[_0x958b('0x39')](handleEntityNotFound(_0x34cbc7,null))[_0x958b('0x39')](function(_0x521de5){if(_0x521de5&&_0x521de5[_0x958b('0x84')]){_0x58a45a=_0x521de5[_0x958b('0x3a')]({'plain':!![]});if(_0x58a45a[_0x958b('0x84')]&&_0x58a45a['List']['Contacts']['length']){return _0x58a45a[_0x958b('0x84')][_0x958b('0x86')][0x0];}return db['CmContact'][_0x958b('0x5e')](_[_0x958b('0xc2')](_0x2c9852['body'],{'firstName':_0x41a2b7,[_0x521de5[_0x958b('0x80')]]:_0x41a2b7,'phone':_0x41a2b7,'ListId':_0x58a45a[_0x958b('0x7b')]}));}})[_0x958b('0x39')](handleEntityNotFound(_0x34cbc7,null))['then'](function(_0x1bb7f){if(_0x1bb7f){_0x3178a0=_0x1bb7f;return db[_0x958b('0x93')]['find']({'where':{'ContactId':_0x3178a0['id'],'closed':![],'OpenchannelAccountId':_0x58a45a['id']}})['then'](function(_0x4c40ab){if(_0x4c40ab){return[_0x4c40ab,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x2c9852[_0x958b('0x60')]['id'],'ContactId':_0x3178a0['id'],'OpenchannelAccountId':_0x58a45a['id'],'lastMsgDirection':_0x958b('0xc3'),'firstMsgDirection':_0x958b('0xc3'),'Messages':[_[_0x958b('0x51')](_0x2c9852[_0x958b('0x5f')],{'read':![],'body':_0x2c9852['body']['body'],'OpenchannelAccountId':_0x58a45a['id'],'UserId':_0x2c9852['user']['id'],'ContactId':_0x3178a0['id']})]},{'include':[{'model':db[_0x958b('0xa0')],'as':'Messages'}]})['then'](function(_0x18c46f){return[_0x18c46f,!![]];});});}})['spread'](function(_0x3acb7a,_0x36b710){if(_0x36b710){return _0x3acb7a;}return db[_0x958b('0xa0')][_0x958b('0x5e')](_['merge'](_0x2c9852[_0x958b('0x5f')],{'read':![],'body':_0x2c9852[_0x958b('0x5f')][_0x958b('0x5f')],'OpenchannelAccountId':_0x58a45a['id'],'OpenchannelInteractionId':_0x3acb7a['id'],'UserId':_0x2c9852[_0x958b('0x60')]['id'],'ContactId':_0x3178a0['id']}))['then'](function(_0x2bacf6){_0x3acb7a[_0x958b('0xc4')][_0x958b('0xc5')]=[];_0x3acb7a['dataValues']['Messages']['push'](_0x2bacf6[_0x958b('0xc4')]);return _0x3acb7a;});});}})[_0x958b('0x39')](respondWithResult(_0x34cbc7,null))[_0x958b('0x2d')](handleError(_0x34cbc7,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 96c6a3b..f64240e 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 _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x2a3316,_0xe22ce9){var _0xd2f9e4=function(_0x108cc0){while(--_0x108cc0){_0x2a3316['push'](_0x2a3316['shift']());}};_0xd2f9e4(++_0xe22ce9);}(_0xee5b,0x1f4));var _0xbee5=function(_0x43c98e,_0x329106){_0x43c98e=_0x43c98e-0x0;var _0x5f18db=_0xee5b[_0x43c98e];return _0x5f18db;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x5b02=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','remove','emit','hook'];(function(_0x3b1798,_0x53f3c8){var _0x4b876d=function(_0xb39d1c){while(--_0xb39d1c){_0x3b1798['push'](_0x3b1798['shift']());}};_0x4b876d(++_0x53f3c8);}(_0x5b02,0xe9));var _0x25b0=function(_0x44292a,_0x334da5){_0x44292a=_0x44292a-0x0;var _0x5bebce=_0x5b02[_0x44292a];return _0x5bebce;};'use strict';var EventEmitter=require(_0x25b0('0x0'));var OpenchannelAccount=require(_0x25b0('0x1'))['db'][_0x25b0('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x25b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x25b0('0x4')};function emitEvent(_0x53493e){return function(_0x3e1d20,_0x31c9c2,_0x38dc14){OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e+':'+_0x3e1d20['id'],_0x3e1d20);OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e,_0x3e1d20);_0x38dc14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x25b0('0x6')](e,emitEvent(event));}}module[_0x25b0('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 0fdd838..1ed9cca 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(_0xe9a244,_0x2a6804){var _0x5c52cf=function(_0x4a0b2a){while(--_0x4a0b2a){_0xe9a244['push'](_0xe9a244['shift']());}};_0x5c52cf(++_0x2a6804);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x59eb9e,_0x12afd5){var _0x40e0b9=function(_0x41b2d2){while(--_0x41b2d2){_0x59eb9e['push'](_0x59eb9e['shift']());}};_0x40e0b9(++_0x12afd5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 32fcf57..9ea80f6 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 _0x3495=['../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','redis','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x774575,_0x189c9a){var _0x4b03ea=function(_0x2df665){while(--_0x2df665){_0x774575['push'](_0x774575['shift']());}};_0x4b03ea(++_0x189c9a);}(_0x3495,0x1de));var _0x5349=function(_0x1db0c7,_0x17154e){_0x1db0c7=_0x1db0c7-0x0;var _0x3402bb=_0x3495[_0x1db0c7];return _0x3402bb;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var moment=require(_0x5349('0x2'));var BPromise=require(_0x5349('0x3'));var rs=require(_0x5349('0x4'));var fs=require('fs');var Redis=require(_0x5349('0x5'));var db=require(_0x5349('0x6'))['db'];var utils=require(_0x5349('0x7'));var logger=require(_0x5349('0x8'))('rpc');var config=require(_0x5349('0x9'));var jayson=require(_0x5349('0xa'));var client=jayson['client'][_0x5349('0xb')]({'port':0x232a});config['redis']=_[_0x5349('0xc')](config['redis'],{'host':_0x5349('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5349('0xe')]));require(_0x5349('0xf'))[_0x5349('0x10')](socket);function respondWithRpcPromise(_0x23a1c7,_0x21bf91,_0x3a416e){return new BPromise(function(_0x35d425,_0x4bf160){return client[_0x5349('0x11')](_0x23a1c7,_0x3a416e)['then'](function(_0x2cbd83){logger[_0x5349('0x12')](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));logger[_0x5349('0x15')](_0x5349('0x16'),_0x21bf91,_0x5349('0x14'),JSON[_0x5349('0x17')](_0x2cbd83));if(_0x2cbd83[_0x5349('0x18')]){if(_0x2cbd83[_0x5349('0x18')]['code']===0x1f4){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x4bf160(_0x2cbd83[_0x5349('0x18')][_0x5349('0x19')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x35d425(_0x2cbd83['error'][_0x5349('0x19')]);}else{logger['info'](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));_0x35d425(_0x2cbd83[_0x5349('0x1a')][_0x5349('0x19')]);}})['catch'](function(_0x22d1ca){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x22d1ca);_0x4bf160(_0x22d1ca);});});} \ No newline at end of file +var _0xf4eb=['then','info','OpenchannelAccount,\x20%s,\x20%s','debug','stringify','error','code','message','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./openchannelAccount.socket','register'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0xf4eb,0xec));var _0xbf4e=function(_0x77800c,_0xdedbcf){_0x77800c=_0x77800c-0x0;var _0x22f591=_0xf4eb[_0x77800c];return _0x22f591;};'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});config[_0xbf4e('0x8')]=_['defaults'](config[_0xbf4e('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf4e('0x8')]));require(_0xbf4e('0x9'))[_0xbf4e('0xa')](socket);function respondWithRpcPromise(_0xc86f04,_0x5da823,_0x22668b){return new BPromise(function(_0x177342,_0x580a26){return client['request'](_0xc86f04,_0x22668b)[_0xbf4e('0xb')](function(_0x5a8397){logger[_0xbf4e('0xc')](_0xbf4e('0xd'),_0x5da823,'request\x20sent');logger[_0xbf4e('0xe')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5da823,'request\x20sent',JSON[_0xbf4e('0xf')](_0x5a8397));if(_0x5a8397[_0xbf4e('0x10')]){if(_0x5a8397[_0xbf4e('0x10')][_0xbf4e('0x11')]===0x1f4){logger[_0xbf4e('0x10')](_0xbf4e('0xd'),_0x5da823,_0x5a8397['error']['message']);return _0x580a26(_0x5a8397[_0xbf4e('0x10')][_0xbf4e('0x12')]);}logger[_0xbf4e('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x5da823,_0x5a8397[_0xbf4e('0x10')][_0xbf4e('0x12')]);return _0x177342(_0x5a8397[_0xbf4e('0x10')][_0xbf4e('0x12')]);}else{logger['info'](_0xbf4e('0xd'),_0x5da823,'request\x20sent');_0x177342(_0x5a8397['result']['message']);}})['catch'](function(_0x35992b){logger[_0xbf4e('0x10')](_0xbf4e('0xd'),_0x5da823,_0x35992b);_0x580a26(_0x35992b);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3f26207..52c61b0 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 _0xa74f=['emit','removeListener','length','openchannelAccount:','remove'];(function(_0x1b5d83,_0x4c27b2){var _0x182a50=function(_0x446098){while(--_0x446098){_0x1b5d83['push'](_0x1b5d83['shift']());}};_0x182a50(++_0x4c27b2);}(_0xa74f,0x9a));var _0xfa74=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0xa74f[_0x53bcc3];return _0x47c959;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0xfa74('0x0'),'update'];function createListener(_0x4b5765,_0x29e4c8){return function(_0x110824){_0x29e4c8[_0xfa74('0x1')](_0x4b5765,_0x110824);};}function removeListener(_0x25a9b7,_0x5b367b){return function(){OpenchannelAccountEvents[_0xfa74('0x2')](_0x25a9b7,_0x5b367b);};}exports['register']=function(_0x543cfe){for(var _0x43dd2f=0x0,_0x9ddbd2=events[_0xfa74('0x3')];_0x43dd2f<_0x9ddbd2;_0x43dd2f++){var _0x2d9fa9=events[_0x43dd2f];var _0x287921=createListener(_0xfa74('0x4')+_0x2d9fa9,_0x543cfe);OpenchannelAccountEvents['on'](_0x2d9fa9,_0x287921);}}; \ No newline at end of file +var _0x7d5a=['openchannelAccount:','./openchannelAccount.events','save','remove','update','removeListener','register'];(function(_0x5a9841,_0x950566){var _0xb4f748=function(_0xdecea8){while(--_0xdecea8){_0x5a9841['push'](_0x5a9841['shift']());}};_0xb4f748(++_0x950566);}(_0x7d5a,0x17b));var _0xa7d5=function(_0x5b4f3e,_0x3c7797){_0x5b4f3e=_0x5b4f3e-0x0;var _0x157c8e=_0x7d5a[_0x5b4f3e];return _0x157c8e;};'use strict';var OpenchannelAccountEvents=require(_0xa7d5('0x0'));var events=[_0xa7d5('0x1'),_0xa7d5('0x2'),_0xa7d5('0x3')];function createListener(_0x185fa0,_0x16d639){return function(_0x10df7a){_0x16d639['emit'](_0x185fa0,_0x10df7a);};}function removeListener(_0x5e41d3,_0x36059b){return function(){OpenchannelAccountEvents[_0xa7d5('0x4')](_0x5e41d3,_0x36059b);};}exports[_0xa7d5('0x5')]=function(_0x284432){for(var _0x1e6722=0x0,_0x80431a=events['length'];_0x1e6722<_0x80431a;_0x1e6722++){var _0x21ccfa=events[_0x1e6722];var _0xb5bcd2=createListener(_0xa7d5('0x6')+_0x21ccfa,_0x284432);OpenchannelAccountEvents['on'](_0x21ccfa,_0xb5bcd2);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index ec264bb..51c1c43 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 _0xc533=['show','post','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelApplication.controller','get','/:id','isAuthenticated'];(function(_0x3a2c7f,_0x8ba887){var _0x119342=function(_0x3ce891){while(--_0x3ce891){_0x3a2c7f['push'](_0x3a2c7f['shift']());}};_0x119342(++_0x8ba887);}(_0xc533,0x14f));var _0x3c53=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xc533[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0x3c53('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3c53('0x1'));var express=require(_0x3c53('0x2'));var router=express[_0x3c53('0x3')]();var fs_extra=require(_0x3c53('0x4'));var auth=require(_0x3c53('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3c53('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3c53('0x7')](_0x3c53('0x8'),auth[_0x3c53('0x9')](),controller[_0x3c53('0xa')]);router[_0x3c53('0xb')]('/',auth[_0x3c53('0x9')](),controller['create']);router['put']('/:id',auth[_0x3c53('0x9')](),controller[_0x3c53('0xc')]);router['delete']('/:id',auth[_0x3c53('0x9')](),controller[_0x3c53('0xd')]);module[_0x3c53('0xe')]=router; \ No newline at end of file +var _0x4476=['isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0x35013e,_0x1634b2){var _0x3751f0=function(_0x421bc4){while(--_0x421bc4){_0x35013e['push'](_0x35013e['shift']());}};_0x3751f0(++_0x1634b2);}(_0x4476,0x1be));var _0x6447=function(_0x541a78,_0x219591){_0x541a78=_0x541a78-0x0;var _0x3107f3=_0x4476[_0x541a78];return _0x3107f3;};'use strict';var multer=require(_0x6447('0x0'));var util=require(_0x6447('0x1'));var path=require('path');var timeout=require(_0x6447('0x2'));var express=require('express');var router=express[_0x6447('0x3')]();var fs_extra=require(_0x6447('0x4'));var auth=require(_0x6447('0x5'));var interaction=require(_0x6447('0x6'));var config=require(_0x6447('0x7'));var controller=require(_0x6447('0x8'));router[_0x6447('0x9')]('/',auth[_0x6447('0xa')](),controller[_0x6447('0xb')]);router[_0x6447('0x9')](_0x6447('0xc'),auth[_0x6447('0xa')](),controller[_0x6447('0xd')]);router[_0x6447('0xe')]('/',auth[_0x6447('0xa')](),controller[_0x6447('0xf')]);router[_0x6447('0x10')]('/:id',auth[_0x6447('0xa')](),controller[_0x6447('0x11')]);router[_0x6447('0x12')]('/:id',auth[_0x6447('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 42f6766..a6f24be 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 _0xade1=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x1a342a,_0x1b22e6){var _0x4cfd16=function(_0x281eb3){while(--_0x281eb3){_0x1a342a['push'](_0x1a342a['shift']());}};_0x4cfd16(++_0x1b22e6);}(_0xade1,0x86));var _0x1ade=function(_0x1c93dd,_0x512f76){_0x1c93dd=_0x1c93dd-0x0;var _0x3fed3e=_0xade1[_0x1c93dd];return _0x3fed3e;};'use strict';var Sequelize=require(_0x1ade('0x0'));module[_0x1ade('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1ade('0x2')],'allowNull':![],'defaultValue':_0x1ade('0x3')},'appdata':{'type':Sequelize[_0x1ade('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1ade('0x2')],'defaultValue':_0x1ade('0x5')}}; \ No newline at end of file +var _0x48ba=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x48ba,0x192));var _0xa48b=function(_0x4d2ab4,_0x3bd220){_0x4d2ab4=_0x4d2ab4-0x0;var _0x3da94b=_0x48ba[_0x4d2ab4];return _0x3da94b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xa48b('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xa48b('0x1')],'allowNull':![],'defaultValue':_0xa48b('0x2')},'appdata':{'type':Sequelize[_0xa48b('0x3')]()},'description':{'type':Sequelize[_0xa48b('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa48b('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 0432c0e..dac36e1 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 _0xf5a4=['count','status','set','Content-Range','reject','destroy','error','stack','name','send','map','OpenchannelApplication','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','findAll','rows','show','params','rawAttributes','catch','create','body','update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined'];(function(_0x254849,_0x321ff6){var _0x4f73d1=function(_0x489d88){while(--_0x489d88){_0x254849['push'](_0x254849['shift']());}};_0x4f73d1(++_0x321ff6);}(_0xf5a4,0x111));var _0x4f5a=function(_0x476752,_0x969dcd){_0x476752=_0x476752-0x0;var _0xe74053=_0xf5a4[_0x476752];return _0xe74053;};'use strict';var emlformat=require(_0x4f5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f5a('0x1'));var jsonpatch=require(_0x4f5a('0x2'));var rp=require(_0x4f5a('0x3'));var moment=require(_0x4f5a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4f5a('0x5'));var util=require(_0x4f5a('0x6'));var path=require(_0x4f5a('0x7'));var sox=require(_0x4f5a('0x8'));var csv=require(_0x4f5a('0x9'));var ejs=require(_0x4f5a('0xa'));var fs=require('fs');var fs_extra=require(_0x4f5a('0xb'));var _=require(_0x4f5a('0xc'));var squel=require(_0x4f5a('0xd'));var crypto=require('crypto');var jsforce=require(_0x4f5a('0xe'));var deskjs=require(_0x4f5a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f5a('0x10'));var Papa=require(_0x4f5a('0x11'));var Redis=require(_0x4f5a('0x12'));var authService=require(_0x4f5a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4f5a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f5a('0x15'))('api');var utils=require(_0x4f5a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4f5a('0x17'));var db=require(_0x4f5a('0x18'))['db'];function respondWithStatusCode(_0x12ffed,_0x546626){_0x546626=_0x546626||0xcc;return function(_0x5c9c6e){if(_0x5c9c6e){return _0x12ffed[_0x4f5a('0x19')](_0x546626);}return _0x12ffed['status'](_0x546626)[_0x4f5a('0x1a')]();};}function respondWithResult(_0xc1f8de,_0x2386e6){_0x2386e6=_0x2386e6||0xc8;return function(_0x1ff129){if(_0x1ff129){return _0xc1f8de['status'](_0x2386e6)[_0x4f5a('0x1b')](_0x1ff129);}};}function respondWithFilteredResult(_0x3570d9,_0x5b1ca2){return function(_0x258a2a){if(_0x258a2a){var _0x4fa16d=typeof _0x5b1ca2[_0x4f5a('0x1c')]==='undefined'&&typeof _0x5b1ca2[_0x4f5a('0x1d')]===_0x4f5a('0x1e');var _0x287477=_0x258a2a[_0x4f5a('0x1f')];var _0x6b53d6=_0x4fa16d?0x0:_0x5b1ca2[_0x4f5a('0x1c')];var _0x2d0e22=_0x4fa16d?_0x258a2a['count']:_0x5b1ca2[_0x4f5a('0x1c')]+_0x5b1ca2[_0x4f5a('0x1d')];var _0x1af086;if(_0x2d0e22>=_0x287477){_0x2d0e22=_0x287477;_0x1af086=0xc8;}else{_0x1af086=0xce;}_0x3570d9[_0x4f5a('0x20')](_0x1af086);return _0x3570d9[_0x4f5a('0x21')](_0x4f5a('0x22'),_0x6b53d6+'-'+_0x2d0e22+'/'+_0x287477)[_0x4f5a('0x1b')](_0x258a2a);}return null;};}function patchUpdates(_0x26a435){return function(_0x214954){try{jsonpatch['apply'](_0x214954,_0x26a435,!![]);}catch(_0x59f702){return BPromise[_0x4f5a('0x23')](_0x59f702);}return _0x214954['save']();};}function saveUpdates(_0x1628d3,_0x15fa58){return function(_0x2bbcfd){if(_0x2bbcfd){return _0x2bbcfd['update'](_0x1628d3)['then'](function(_0x1fd5fd){return _0x1fd5fd;});}return null;};}function removeEntity(_0x50f90b,_0x6ee05b){return function(_0x3427a6){if(_0x3427a6){return _0x3427a6[_0x4f5a('0x24')]()['then'](function(){_0x50f90b[_0x4f5a('0x20')](0xcc)[_0x4f5a('0x1a')]();});}};}function handleEntityNotFound(_0x10166c,_0xe5ea2d){return function(_0x59db16){if(!_0x59db16){_0x10166c['sendStatus'](0x194);}return _0x59db16;};}function handleError(_0x1a4b18,_0x55765b){_0x55765b=_0x55765b||0x1f4;return function(_0x1cf819){logger[_0x4f5a('0x25')](_0x1cf819[_0x4f5a('0x26')]);if(_0x1cf819['name']){delete _0x1cf819[_0x4f5a('0x27')];}_0x1a4b18[_0x4f5a('0x20')](_0x55765b)[_0x4f5a('0x28')](_0x1cf819);};}exports['index']=function(_0x26d717,_0xf34fab){var _0x78b135={},_0x4b8772={},_0x1adee0={'count':0x0,'rows':[]};var _0xc13e1a=_[_0x4f5a('0x29')](db[_0x4f5a('0x2a')]['rawAttributes'],function(_0x5371e0){return{'name':_0x5371e0[_0x4f5a('0x2b')],'type':_0x5371e0[_0x4f5a('0x2c')][_0x4f5a('0x2d')]};});_0x4b8772[_0x4f5a('0x2e')]=_[_0x4f5a('0x29')](_0xc13e1a,_0x4f5a('0x27'));_0x4b8772[_0x4f5a('0x2f')]=_[_0x4f5a('0x30')](_0x26d717[_0x4f5a('0x2f')]);_0x4b8772[_0x4f5a('0x31')]=_[_0x4f5a('0x32')](_0x4b8772[_0x4f5a('0x2e')],_0x4b8772[_0x4f5a('0x2f')]);_0x78b135['attributes']=_[_0x4f5a('0x32')](_0x4b8772[_0x4f5a('0x2e')],qs[_0x4f5a('0x33')](_0x26d717[_0x4f5a('0x2f')][_0x4f5a('0x33')]));_0x78b135[_0x4f5a('0x34')]=_0x78b135[_0x4f5a('0x34')][_0x4f5a('0x35')]?_0x78b135[_0x4f5a('0x34')]:_0x4b8772['model'];if(!_0x26d717[_0x4f5a('0x2f')][_0x4f5a('0x36')](_0x4f5a('0x37'))){_0x78b135[_0x4f5a('0x1d')]=qs[_0x4f5a('0x1d')](_0x26d717[_0x4f5a('0x2f')][_0x4f5a('0x1d')]);_0x78b135[_0x4f5a('0x1c')]=qs[_0x4f5a('0x1c')](_0x26d717[_0x4f5a('0x2f')][_0x4f5a('0x1c')]);}_0x78b135[_0x4f5a('0x38')]=qs[_0x4f5a('0x39')](_0x26d717[_0x4f5a('0x2f')][_0x4f5a('0x39')]);_0x78b135['where']=qs[_0x4f5a('0x31')](_[_0x4f5a('0x3a')](_0x26d717[_0x4f5a('0x2f')],_0x4b8772['filters']),_0xc13e1a);if(_0x26d717[_0x4f5a('0x2f')][_0x4f5a('0x3b')]){_0x78b135[_0x4f5a('0x3c')]=_[_0x4f5a('0x3d')](_0x78b135['where'],{'$or':_[_0x4f5a('0x29')](_0xc13e1a,function(_0x5d9ca6){if(_0x5d9ca6[_0x4f5a('0x2c')]!==_0x4f5a('0x3e')){var _0x3b9582={};_0x3b9582[_0x5d9ca6[_0x4f5a('0x27')]]={'$like':'%'+_0x26d717[_0x4f5a('0x2f')]['filter']+'%'};return _0x3b9582;}})});}_0x78b135=_[_0x4f5a('0x3d')]({},_0x78b135,_0x26d717[_0x4f5a('0x3f')]);var _0x1338aa={'where':_0x78b135[_0x4f5a('0x3c')]};return db[_0x4f5a('0x2a')][_0x4f5a('0x1f')](_0x1338aa)[_0x4f5a('0x40')](function(_0x2f2674){_0x1adee0[_0x4f5a('0x1f')]=_0x2f2674;if(_0x26d717[_0x4f5a('0x2f')][_0x4f5a('0x41')]){_0x78b135['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x4f5a('0x42')](_0x78b135);})['then'](function(_0x3569f4){_0x1adee0[_0x4f5a('0x43')]=_0x3569f4;return _0x1adee0;})[_0x4f5a('0x40')](respondWithFilteredResult(_0xf34fab,_0x78b135))['catch'](handleError(_0xf34fab,null));};exports[_0x4f5a('0x44')]=function(_0x1b4448,_0x5ae4a7){var _0x487fd9={'raw':!![],'where':{'id':_0x1b4448[_0x4f5a('0x45')]['id']}},_0x37681d={};_0x37681d['model']=_['keys'](db[_0x4f5a('0x2a')][_0x4f5a('0x46')]);_0x37681d[_0x4f5a('0x2f')]=_[_0x4f5a('0x30')](_0x1b4448[_0x4f5a('0x2f')]);_0x37681d[_0x4f5a('0x31')]=_['intersection'](_0x37681d[_0x4f5a('0x2e')],_0x37681d[_0x4f5a('0x2f')]);_0x487fd9['attributes']=_[_0x4f5a('0x32')](_0x37681d[_0x4f5a('0x2e')],qs['fields'](_0x1b4448[_0x4f5a('0x2f')][_0x4f5a('0x33')]));_0x487fd9[_0x4f5a('0x34')]=_0x487fd9[_0x4f5a('0x34')][_0x4f5a('0x35')]?_0x487fd9[_0x4f5a('0x34')]:_0x37681d[_0x4f5a('0x2e')];if(_0x1b4448[_0x4f5a('0x2f')]['includeAll']){_0x487fd9['include']=[{'all':!![]}];}_0x487fd9=_[_0x4f5a('0x3d')]({},_0x487fd9,_0x1b4448[_0x4f5a('0x3f')]);return db[_0x4f5a('0x2a')]['find'](_0x487fd9)[_0x4f5a('0x40')](handleEntityNotFound(_0x5ae4a7,null))[_0x4f5a('0x40')](respondWithResult(_0x5ae4a7,null))[_0x4f5a('0x47')](handleError(_0x5ae4a7,null));};exports['create']=function(_0x4ecc86,_0x2f5662){return db[_0x4f5a('0x2a')][_0x4f5a('0x48')](_0x4ecc86[_0x4f5a('0x49')],{})[_0x4f5a('0x40')](respondWithResult(_0x2f5662,0xc9))[_0x4f5a('0x47')](handleError(_0x2f5662,null));};exports[_0x4f5a('0x4a')]=function(_0xbd99b4,_0x54f90c){if(_0xbd99b4[_0x4f5a('0x49')]['id']){delete _0xbd99b4[_0x4f5a('0x49')]['id'];}return db[_0x4f5a('0x2a')][_0x4f5a('0x4b')]({'where':{'id':_0xbd99b4[_0x4f5a('0x45')]['id']}})[_0x4f5a('0x40')](handleEntityNotFound(_0x54f90c,null))['then'](saveUpdates(_0xbd99b4[_0x4f5a('0x49')],null))[_0x4f5a('0x40')](respondWithResult(_0x54f90c,null))[_0x4f5a('0x47')](handleError(_0x54f90c,null));};exports[_0x4f5a('0x24')]=function(_0x214e0f,_0x405ab5){return db[_0x4f5a('0x2a')]['find']({'where':{'id':_0x214e0f[_0x4f5a('0x45')]['id']}})['then'](handleEntityNotFound(_0x405ab5,null))[_0x4f5a('0x40')](removeEntity(_0x405ab5,null))[_0x4f5a('0x47')](handleError(_0x405ab5,null));}; \ No newline at end of file +var _0xb589=['filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query'];(function(_0x34e356,_0x5e6e08){var _0x4f0ace=function(_0x2ed8f8){while(--_0x2ed8f8){_0x34e356['push'](_0x34e356['shift']());}};_0x4f0ace(++_0x5e6e08);}(_0xb589,0x1be));var _0x9b58=function(_0x49e6db,_0x1a4546){_0x49e6db=_0x49e6db-0x0;var _0x5a6137=_0xb589[_0x49e6db];return _0x5a6137;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b58('0x0'));var zipdir=require(_0x9b58('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9b58('0x2'));var moment=require(_0x9b58('0x3'));var BPromise=require(_0x9b58('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9b58('0x5'));var sox=require(_0x9b58('0x6'));var csv=require(_0x9b58('0x7'));var ejs=require(_0x9b58('0x8'));var fs=require('fs');var fs_extra=require(_0x9b58('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b58('0xa'));var deskjs=require(_0x9b58('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9b58('0xc'));var Papa=require(_0x9b58('0xd'));var Redis=require(_0x9b58('0xe'));var authService=require(_0x9b58('0xf'));var qs=require(_0x9b58('0x10'));var as=require(_0x9b58('0x11'));var hardwareService=require(_0x9b58('0x12'));var logger=require(_0x9b58('0x13'))(_0x9b58('0x14'));var utils=require('../../config/utils');var config=require(_0x9b58('0x15'));var licenseUtil=require(_0x9b58('0x16'));var db=require(_0x9b58('0x17'))['db'];function respondWithStatusCode(_0x10e516,_0x593d21){_0x593d21=_0x593d21||0xcc;return function(_0x504b01){if(_0x504b01){return _0x10e516[_0x9b58('0x18')](_0x593d21);}return _0x10e516[_0x9b58('0x19')](_0x593d21)['end']();};}function respondWithResult(_0x3df52a,_0x5299b5){_0x5299b5=_0x5299b5||0xc8;return function(_0x67073){if(_0x67073){return _0x3df52a[_0x9b58('0x19')](_0x5299b5)['json'](_0x67073);}};}function respondWithFilteredResult(_0x53e574,_0x285ef2){return function(_0x70fd76){if(_0x70fd76){var _0x56a9b3=typeof _0x285ef2[_0x9b58('0x1a')]===_0x9b58('0x1b')&&typeof _0x285ef2[_0x9b58('0x1c')]===_0x9b58('0x1b');var _0x4dc155=_0x70fd76[_0x9b58('0x1d')];var _0x4656b1=_0x56a9b3?0x0:_0x285ef2['offset'];var _0x41e3be=_0x56a9b3?_0x70fd76[_0x9b58('0x1d')]:_0x285ef2['offset']+_0x285ef2['limit'];var _0x323c05;if(_0x41e3be>=_0x4dc155){_0x41e3be=_0x4dc155;_0x323c05=0xc8;}else{_0x323c05=0xce;}_0x53e574[_0x9b58('0x19')](_0x323c05);return _0x53e574['set'](_0x9b58('0x1e'),_0x4656b1+'-'+_0x41e3be+'/'+_0x4dc155)[_0x9b58('0x1f')](_0x70fd76);}return null;};}function patchUpdates(_0xb75303){return function(_0x3a278c){try{jsonpatch[_0x9b58('0x20')](_0x3a278c,_0xb75303,!![]);}catch(_0x15e68c){return BPromise[_0x9b58('0x21')](_0x15e68c);}return _0x3a278c[_0x9b58('0x22')]();};}function saveUpdates(_0x26cf0f,_0x4c0097){return function(_0x43fdf3){if(_0x43fdf3){return _0x43fdf3[_0x9b58('0x23')](_0x26cf0f)[_0x9b58('0x24')](function(_0xb25795){return _0xb25795;});}return null;};}function removeEntity(_0x2daf60,_0x5c28de){return function(_0x1b5f84){if(_0x1b5f84){return _0x1b5f84[_0x9b58('0x25')]()[_0x9b58('0x24')](function(){_0x2daf60[_0x9b58('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x218fa9,_0x12efd8){return function(_0x24d729){if(!_0x24d729){_0x218fa9['sendStatus'](0x194);}return _0x24d729;};}function handleError(_0x483870,_0x5c19a6){_0x5c19a6=_0x5c19a6||0x1f4;return function(_0x5b8d65){logger[_0x9b58('0x26')](_0x5b8d65[_0x9b58('0x27')]);if(_0x5b8d65[_0x9b58('0x28')]){delete _0x5b8d65[_0x9b58('0x28')];}_0x483870[_0x9b58('0x19')](_0x5c19a6)[_0x9b58('0x29')](_0x5b8d65);};}exports[_0x9b58('0x2a')]=function(_0x31c656,_0x298327){var _0x3f7cb8={},_0x7c0d8e={},_0x28a695={'count':0x0,'rows':[]};var _0x4843eb=_[_0x9b58('0x2b')](db[_0x9b58('0x2c')][_0x9b58('0x2d')],function(_0x1dbc13){return{'name':_0x1dbc13[_0x9b58('0x2e')],'type':_0x1dbc13[_0x9b58('0x2f')][_0x9b58('0x30')]};});_0x7c0d8e[_0x9b58('0x31')]=_['map'](_0x4843eb,_0x9b58('0x28'));_0x7c0d8e['query']=_['keys'](_0x31c656[_0x9b58('0x32')]);_0x7c0d8e[_0x9b58('0x33')]=_[_0x9b58('0x34')](_0x7c0d8e[_0x9b58('0x31')],_0x7c0d8e['query']);_0x3f7cb8[_0x9b58('0x35')]=_[_0x9b58('0x34')](_0x7c0d8e[_0x9b58('0x31')],qs['fields'](_0x31c656['query'][_0x9b58('0x36')]));_0x3f7cb8['attributes']=_0x3f7cb8[_0x9b58('0x35')][_0x9b58('0x37')]?_0x3f7cb8[_0x9b58('0x35')]:_0x7c0d8e[_0x9b58('0x31')];if(!_0x31c656[_0x9b58('0x32')]['hasOwnProperty'](_0x9b58('0x38'))){_0x3f7cb8['limit']=qs[_0x9b58('0x1c')](_0x31c656[_0x9b58('0x32')][_0x9b58('0x1c')]);_0x3f7cb8['offset']=qs['offset'](_0x31c656[_0x9b58('0x32')][_0x9b58('0x1a')]);}_0x3f7cb8[_0x9b58('0x39')]=qs[_0x9b58('0x3a')](_0x31c656['query'][_0x9b58('0x3a')]);_0x3f7cb8[_0x9b58('0x3b')]=qs[_0x9b58('0x33')](_[_0x9b58('0x3c')](_0x31c656['query'],_0x7c0d8e[_0x9b58('0x33')]),_0x4843eb);if(_0x31c656[_0x9b58('0x32')][_0x9b58('0x3d')]){_0x3f7cb8[_0x9b58('0x3b')]=_[_0x9b58('0x3e')](_0x3f7cb8[_0x9b58('0x3b')],{'$or':_['map'](_0x4843eb,function(_0x5c76d1){if(_0x5c76d1[_0x9b58('0x2f')]!==_0x9b58('0x3f')){var _0x27f8e4={};_0x27f8e4[_0x5c76d1[_0x9b58('0x28')]]={'$like':'%'+_0x31c656['query'][_0x9b58('0x3d')]+'%'};return _0x27f8e4;}})});}_0x3f7cb8=_[_0x9b58('0x3e')]({},_0x3f7cb8,_0x31c656['options']);var _0x39aa2b={'where':_0x3f7cb8[_0x9b58('0x3b')]};return db[_0x9b58('0x2c')][_0x9b58('0x1d')](_0x39aa2b)['then'](function(_0x5c1fd4){_0x28a695[_0x9b58('0x1d')]=_0x5c1fd4;if(_0x31c656[_0x9b58('0x32')][_0x9b58('0x40')]){_0x3f7cb8['include']=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x3f7cb8);})['then'](function(_0x3e5b92){_0x28a695[_0x9b58('0x41')]=_0x3e5b92;return _0x28a695;})[_0x9b58('0x24')](respondWithFilteredResult(_0x298327,_0x3f7cb8))[_0x9b58('0x42')](handleError(_0x298327,null));};exports['show']=function(_0x42bd30,_0x2afc28){var _0xc3ca00={'raw':!![],'where':{'id':_0x42bd30[_0x9b58('0x43')]['id']}},_0x238265={};_0x238265[_0x9b58('0x31')]=_['keys'](db[_0x9b58('0x2c')][_0x9b58('0x2d')]);_0x238265[_0x9b58('0x32')]=_['keys'](_0x42bd30['query']);_0x238265[_0x9b58('0x33')]=_[_0x9b58('0x34')](_0x238265[_0x9b58('0x31')],_0x238265['query']);_0xc3ca00['attributes']=_['intersection'](_0x238265[_0x9b58('0x31')],qs[_0x9b58('0x36')](_0x42bd30[_0x9b58('0x32')][_0x9b58('0x36')]));_0xc3ca00[_0x9b58('0x35')]=_0xc3ca00['attributes'][_0x9b58('0x37')]?_0xc3ca00[_0x9b58('0x35')]:_0x238265[_0x9b58('0x31')];if(_0x42bd30['query'][_0x9b58('0x40')]){_0xc3ca00['include']=[{'all':!![]}];}_0xc3ca00=_[_0x9b58('0x3e')]({},_0xc3ca00,_0x42bd30['options']);return db[_0x9b58('0x2c')]['find'](_0xc3ca00)['then'](handleEntityNotFound(_0x2afc28,null))[_0x9b58('0x24')](respondWithResult(_0x2afc28,null))[_0x9b58('0x42')](handleError(_0x2afc28,null));};exports[_0x9b58('0x44')]=function(_0x5348d2,_0x129e4f){return db[_0x9b58('0x2c')][_0x9b58('0x44')](_0x5348d2['body'],{})[_0x9b58('0x24')](respondWithResult(_0x129e4f,0xc9))['catch'](handleError(_0x129e4f,null));};exports['update']=function(_0x29e05a,_0x2267c8){if(_0x29e05a[_0x9b58('0x45')]['id']){delete _0x29e05a[_0x9b58('0x45')]['id'];}return db[_0x9b58('0x2c')][_0x9b58('0x46')]({'where':{'id':_0x29e05a['params']['id']}})[_0x9b58('0x24')](handleEntityNotFound(_0x2267c8,null))[_0x9b58('0x24')](saveUpdates(_0x29e05a[_0x9b58('0x45')],null))[_0x9b58('0x24')](respondWithResult(_0x2267c8,null))['catch'](handleError(_0x2267c8,null));};exports[_0x9b58('0x25')]=function(_0x34200b,_0x468121){return db[_0x9b58('0x2c')][_0x9b58('0x46')]({'where':{'id':_0x34200b['params']['id']}})[_0x9b58('0x24')](handleEntityNotFound(_0x468121,null))[_0x9b58('0x24')](removeEntity(_0x468121,null))['catch'](handleError(_0x468121,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 35b048d..cf359e3 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 _0x84a2=['bluebird','request-promise','path','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1c4903,_0x2c8ecd){var _0x1f0af5=function(_0x90ceaa){while(--_0x90ceaa){_0x1c4903['push'](_0x1c4903['shift']());}};_0x1f0af5(++_0x2c8ecd);}(_0x84a2,0xad));var _0x284a=function(_0x420516,_0x5ce5ca){_0x420516=_0x420516-0x0;var _0x16484e=_0x84a2[_0x420516];return _0x16484e;};'use strict';var _=require(_0x284a('0x0'));var util=require(_0x284a('0x1'));var logger=require(_0x284a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x284a('0x3'));var rp=require(_0x284a('0x4'));var fs=require('fs');var path=require(_0x284a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x202b28,_0x269962){return _0x202b28[_0x284a('0x6')](_0x284a('0x7'),attributes,{'tableName':_0x284a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x284a('0x9'),'collate':_0x284a('0xa')});}; \ No newline at end of file +var _0x4385=['../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4385,0x110));var _0x5438=function(_0x1cd6b6,_0xba5b92){_0x1cd6b6=_0x1cd6b6-0x0;var _0x232529=_0x4385[_0x1cd6b6];return _0x232529;};'use strict';var _=require(_0x5438('0x0'));var util=require(_0x5438('0x1'));var logger=require(_0x5438('0x2'))(_0x5438('0x3'));var moment=require(_0x5438('0x4'));var BPromise=require(_0x5438('0x5'));var rp=require(_0x5438('0x6'));var fs=require('fs');var path=require(_0x5438('0x7'));var rimraf=require('rimraf');var config=require(_0x5438('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0x5438('0x9')]=function(_0x4a410c,_0x483c73){return _0x4a410c[_0x5438('0xa')](_0x5438('0xb'),attributes,{'tableName':_0x5438('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5438('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index cebb212..3bcad8b 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 _0xbe39=['../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','lodash','moment'];(function(_0x1973a8,_0x111bcc){var _0x3033e3=function(_0x2173ad){while(--_0x2173ad){_0x1973a8['push'](_0x1973a8['shift']());}};_0x3033e3(++_0x111bcc);}(_0xbe39,0x14e));var _0x9be3=function(_0x58d939,_0x5cfdae){_0x58d939=_0x58d939-0x0;var _0x1e5115=_0xbe39[_0x58d939];return _0x1e5115;};'use strict';var _=require(_0x9be3('0x0'));var util=require('util');var moment=require(_0x9be3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9be3('0x2'))(_0x9be3('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9be3('0x4')][_0x9be3('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2c9625,_0x4c3c6d,_0xedf782){return new BPromise(function(_0x51622a,_0x44eebe){return client[_0x9be3('0x6')](_0x2c9625,_0xedf782)[_0x9be3('0x7')](function(_0x13ade5){logger[_0x9be3('0x8')]('OpenchannelApplication,\x20%s,\x20%s',_0x4c3c6d,_0x9be3('0x9'));logger[_0x9be3('0xa')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x4c3c6d,_0x9be3('0x9'),JSON[_0x9be3('0xb')](_0x13ade5));if(_0x13ade5[_0x9be3('0xc')]){if(_0x13ade5[_0x9be3('0xc')][_0x9be3('0xd')]===0x1f4){logger['error'](_0x9be3('0xe'),_0x4c3c6d,_0x13ade5[_0x9be3('0xc')]['message']);return _0x44eebe(_0x13ade5[_0x9be3('0xc')][_0x9be3('0xf')]);}logger[_0x9be3('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x4c3c6d,_0x13ade5[_0x9be3('0xc')][_0x9be3('0xf')]);return _0x51622a(_0x13ade5[_0x9be3('0xc')][_0x9be3('0xf')]);}else{logger[_0x9be3('0x8')](_0x9be3('0xe'),_0x4c3c6d,_0x9be3('0x9'));_0x51622a(_0x13ade5[_0x9be3('0x10')][_0x9be3('0xf')]);}})[_0x9be3('0x11')](function(_0xe2e371){logger[_0x9be3('0xc')](_0x9be3('0xe'),_0x4c3c6d,_0xe2e371);_0x44eebe(_0xe2e371);});});}exports[_0x9be3('0x12')]=function(_0x450933){var _0x5588f9=this;return new Promise(function(_0x4447f1,_0x2da9c6){return db[_0x9be3('0x13')][_0x9be3('0x14')](_0x450933[_0x9be3('0x15')],{'raw':_0x450933['options']?_0x450933[_0x9be3('0x16')][_0x9be3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450933['options']?_0x450933[_0x9be3('0x16')]['where']||null:null,'attributes':_0x450933[_0x9be3('0x16')]?_0x450933[_0x9be3('0x16')]['attributes']||null:null,'limit':_0x450933[_0x9be3('0x16')]?_0x450933['options']['limit']||null:null})[_0x9be3('0x7')](function(_0x3a0186){logger['info'](_0x9be3('0x12'),_0x450933);logger[_0x9be3('0xa')](_0x9be3('0x12'),_0x450933,JSON[_0x9be3('0xb')](_0x3a0186));_0x4447f1(_0x3a0186);})['catch'](function(_0x359479){logger['error'](_0x9be3('0x12'),_0x359479[_0x9be3('0xf')],_0x450933);_0x2da9c6(_0x5588f9[_0x9be3('0xc')](0x1f4,_0x359479[_0x9be3('0xf')]));});});}; \ No newline at end of file +var _0x4009=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','where','attributes','then','stringify','lodash','util'];(function(_0x17a605,_0x54306b){var _0x258fba=function(_0x1f8d21){while(--_0x1f8d21){_0x17a605['push'](_0x17a605['shift']());}};_0x258fba(++_0x54306b);}(_0x4009,0x1e4));var _0x9400=function(_0x586740,_0x5d901c){_0x586740=_0x586740-0x0;var _0xdeb5ac=_0x4009[_0x586740];return _0xdeb5ac;};'use strict';var _=require(_0x9400('0x0'));var util=require(_0x9400('0x1'));var moment=require(_0x9400('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9400('0x3'));var db=require(_0x9400('0x4'))['db'];var utils=require(_0x9400('0x5'));var logger=require(_0x9400('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9400('0x7'));var client=jayson[_0x9400('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f63d6,_0x4ec451,_0x32fa1b){return new BPromise(function(_0x48c0b1,_0x4919b4){return client[_0x9400('0x9')](_0x4f63d6,_0x32fa1b)['then'](function(_0x1354f0){logger['info'](_0x9400('0xa'),_0x4ec451,'request\x20sent');logger[_0x9400('0xb')](_0x9400('0xc'),_0x4ec451,_0x9400('0xd'),JSON['stringify'](_0x1354f0));if(_0x1354f0[_0x9400('0xe')]){if(_0x1354f0[_0x9400('0xe')]['code']===0x1f4){logger['error'](_0x9400('0xa'),_0x4ec451,_0x1354f0[_0x9400('0xe')][_0x9400('0xf')]);return _0x4919b4(_0x1354f0[_0x9400('0xe')]['message']);}logger['error'](_0x9400('0xa'),_0x4ec451,_0x1354f0[_0x9400('0xe')][_0x9400('0xf')]);return _0x48c0b1(_0x1354f0['error'][_0x9400('0xf')]);}else{logger[_0x9400('0x10')](_0x9400('0xa'),_0x4ec451,'request\x20sent');_0x48c0b1(_0x1354f0[_0x9400('0x11')]['message']);}})[_0x9400('0x12')](function(_0x47a0c4){logger['error'](_0x9400('0xa'),_0x4ec451,_0x47a0c4);_0x4919b4(_0x47a0c4);});});}exports[_0x9400('0x13')]=function(_0x2cb82a){var _0x1a8cc4=this;return new Promise(function(_0x323081,_0x5532fb){return db[_0x9400('0x14')][_0x9400('0x15')](_0x2cb82a['body'],{'raw':_0x2cb82a[_0x9400('0x16')]?_0x2cb82a[_0x9400('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cb82a[_0x9400('0x16')]?_0x2cb82a['options'][_0x9400('0x17')]||null:null,'attributes':_0x2cb82a[_0x9400('0x16')]?_0x2cb82a[_0x9400('0x16')][_0x9400('0x18')]||null:null,'limit':_0x2cb82a['options']?_0x2cb82a[_0x9400('0x16')]['limit']||null:null})[_0x9400('0x19')](function(_0x54985f){logger[_0x9400('0x10')](_0x9400('0x13'),_0x2cb82a);logger[_0x9400('0xb')]('UpdateOpenchannelApplication',_0x2cb82a,JSON[_0x9400('0x1a')](_0x54985f));_0x323081(_0x54985f);})[_0x9400('0x12')](function(_0x1fbe69){logger[_0x9400('0xe')]('UpdateOpenchannelApplication',_0x1fbe69[_0x9400('0xf')],_0x2cb82a);_0x5532fb(_0x1a8cc4[_0x9400('0xe')](0x1f4,_0x1fbe69[_0x9400('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index bb02c20..675f3d2 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 _0x69a1=['multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','delete','openchannelinteraction:destroy','removeTags'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x69a1,0x7c));var _0x169a=function(_0x1c3225,_0x3c2951){_0x1c3225=_0x1c3225-0x0;var _0x338191=_0x69a1[_0x1c3225];return _0x338191;};'use strict';var multer=require(_0x169a('0x0'));var util=require('util');var path=require(_0x169a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x169a('0x2')]();var fs_extra=require(_0x169a('0x3'));var auth=require(_0x169a('0x4'));var interaction=require(_0x169a('0x5'));var config=require(_0x169a('0x6'));var controller=require(_0x169a('0x7'));router[_0x169a('0x8')]('/',auth[_0x169a('0x9')](),controller[_0x169a('0xa')]);router['get'](_0x169a('0xb'),auth['isAuthenticated'](),controller[_0x169a('0xc')]);router[_0x169a('0x8')](_0x169a('0xd'),auth[_0x169a('0x9')](),controller[_0x169a('0xe')]);router[_0x169a('0x8')](_0x169a('0xf'),auth[_0x169a('0x9')](),controller[_0x169a('0x10')]);router[_0x169a('0x8')]('/:id/download',auth[_0x169a('0x9')](),controller[_0x169a('0x11')]);router[_0x169a('0x12')]('/',auth[_0x169a('0x9')](),controller[_0x169a('0x13')]);router[_0x169a('0x12')](_0x169a('0xf'),auth['isAuthenticated'](),controller[_0x169a('0x14')]);router[_0x169a('0x12')](_0x169a('0x15'),auth['isAuthenticated'](),interaction[_0x169a('0x16')](_0x169a('0x17'),_0x169a('0x18')),controller[_0x169a('0x19')]);router[_0x169a('0x1a')](_0x169a('0xd'),auth[_0x169a('0x9')](),interaction['tracked'](_0x169a('0x17'),'openchannelinteraction:update'),controller[_0x169a('0x1b')]);router[_0x169a('0x1c')](_0x169a('0xd'),auth[_0x169a('0x9')](),interaction[_0x169a('0x16')](_0x169a('0x17'),_0x169a('0x1d')),controller['destroy']);router[_0x169a('0x1c')](_0x169a('0x15'),auth[_0x169a('0x9')](),controller[_0x169a('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xbbdd=['/:id/messages','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','/describe','isAuthenticated','show','getMessages','/:id/download','download','post','create'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xbbdd,0x124));var _0xdbbd=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xbbdd[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0xdbbd('0x0'));var util=require(_0xdbbd('0x1'));var path=require(_0xdbbd('0x2'));var timeout=require(_0xdbbd('0x3'));var express=require('express');var router=express[_0xdbbd('0x4')]();var fs_extra=require(_0xdbbd('0x5'));var auth=require(_0xdbbd('0x6'));var interaction=require(_0xdbbd('0x7'));var config=require('../../config/environment');var controller=require(_0xdbbd('0x8'));router[_0xdbbd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdbbd('0x9')](_0xdbbd('0xa'),auth[_0xdbbd('0xb')](),controller['describe']);router[_0xdbbd('0x9')]('/:id',auth[_0xdbbd('0xb')](),controller[_0xdbbd('0xc')]);router[_0xdbbd('0x9')]('/:id/messages',auth[_0xdbbd('0xb')](),controller[_0xdbbd('0xd')]);router['get'](_0xdbbd('0xe'),auth[_0xdbbd('0xb')](),controller[_0xdbbd('0xf')]);router[_0xdbbd('0x10')]('/',auth[_0xdbbd('0xb')](),controller[_0xdbbd('0x11')]);router['post'](_0xdbbd('0x12'),auth[_0xdbbd('0xb')](),controller['addMessage']);router[_0xdbbd('0x10')](_0xdbbd('0x13'),auth[_0xdbbd('0xb')](),interaction[_0xdbbd('0x14')](_0xdbbd('0x15'),_0xdbbd('0x16')),controller[_0xdbbd('0x17')]);router['put'](_0xdbbd('0x18'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0xdbbd('0x19')),controller[_0xdbbd('0x1a')]);router[_0xdbbd('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0xdbbd('0x14')](_0xdbbd('0x15'),'openchannelinteraction:destroy'),controller[_0xdbbd('0x1c')]);router['delete'](_0xdbbd('0x13'),auth[_0xdbbd('0xb')](),controller[_0xdbbd('0x1d')]);module[_0xdbbd('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 c7b8e02..69d04e6 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 _0x9037=['BOOLEAN','INTEGER','exports','DATE','STRING','ENUM','out'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0x9037,0xbf));var _0x7903=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9037[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x7903('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7903('0x1')]},'disposition':{'type':Sequelize[_0x7903('0x2')]},'secondDisposition':{'type':Sequelize[_0x7903('0x2')]},'thirdDisposition':{'type':Sequelize[_0x7903('0x2')]},'note':{'type':Sequelize[_0x7903('0x2')]},'read1stAt':{'type':Sequelize[_0x7903('0x1')]},'threadId':{'type':Sequelize[_0x7903('0x2')]},'externalUrl':{'type':Sequelize[_0x7903('0x2')]},'lastMsgAt':{'type':Sequelize[_0x7903('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x7903('0x3')]('in',_0x7903('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x7903('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7903('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x7903('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7903('0x6')]}}; \ No newline at end of file +var _0xa6ea=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x610a5f,_0x360ae3){var _0x12bd3d=function(_0x4b9e05){while(--_0x4b9e05){_0x610a5f['push'](_0x610a5f['shift']());}};_0x12bd3d(++_0x360ae3);}(_0xa6ea,0x122));var _0xaa6e=function(_0x434e90,_0x3295cf){_0x434e90=_0x434e90-0x0;var _0x3a0539=_0xa6ea[_0x434e90];return _0x3a0539;};'use strict';var Sequelize=require(_0xaa6e('0x0'));module[_0xaa6e('0x1')]={'closed':{'type':Sequelize[_0xaa6e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaa6e('0x3')]},'disposition':{'type':Sequelize[_0xaa6e('0x4')]},'secondDisposition':{'type':Sequelize[_0xaa6e('0x4')]},'thirdDisposition':{'type':Sequelize[_0xaa6e('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xaa6e('0x3')]},'threadId':{'type':Sequelize[_0xaa6e('0x4')]},'externalUrl':{'type':Sequelize[_0xaa6e('0x4')]},'lastMsgAt':{'type':Sequelize[_0xaa6e('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xaa6e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xaa6e('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xaa6e('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xaa6e('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xaa6e('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 89f46d5..ce0cdf5 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 _0xd11f=['index','map','OpenchannelInteraction','rawAttributes','fieldName','getOptions','findAll','openchannel','user','catch','show','query','type','from','params','keys','intersection','model','fields','attributes','length','includeAll','merge','options','find','create','body','describe','addMessage','ids','getMessages','OpenchannelMessage','filters','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','include','rows','addTags','setTags','spread','Tag','color','removeTags','download','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','zip-dir','moment','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','register','status','undefined','limit','offset','count','set','Content-Range','json','update','then','destroy','end','error','stack','name','send'];(function(_0x326c79,_0x3c202a){var _0x52412e=function(_0x488689){while(--_0x488689){_0x326c79['push'](_0x326c79['shift']());}};_0x52412e(++_0x3c202a);}(_0xd11f,0x1e7));var _0xfd11=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0xd11f[_0x25b24a];return _0x224e68;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xfd11('0x0'));var moment=require(_0xfd11('0x1'));var util=require('util');var path=require(_0xfd11('0x2'));var ejs=require(_0xfd11('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xfd11('0x4'));var qs=require(_0xfd11('0x5'));var pdf=require(_0xfd11('0x6'));var logger=require(_0xfd11('0x7'))('api');var config=require(_0xfd11('0x8'));var db=require(_0xfd11('0x9'))['db'];config[_0xfd11('0xa')]=_['defaults'](config[_0xfd11('0xa')],{'host':_0xfd11('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd11('0xa')]));require('./openchannelInteraction.socket')[_0xfd11('0xc')](socket);function respondWithStatusCode(_0x5c18db,_0x56d364){_0x56d364=_0x56d364||0xcc;return function(_0x13a853){if(_0x13a853){return _0x5c18db['sendStatus'](_0x56d364);}return _0x5c18db['status'](_0x56d364)['end']();};}function respondWithResult(_0x19ba6b,_0x245a75){_0x245a75=_0x245a75||0xc8;return function(_0x2293e3){if(_0x2293e3){return _0x19ba6b[_0xfd11('0xd')](_0x245a75)['json'](_0x2293e3);}};}function respondWithFilteredResult(_0x828f3b,_0x3f0fe0){return function(_0x5488b6){if(_0x5488b6){var _0x33b261=typeof _0x3f0fe0['offset']===_0xfd11('0xe')&&typeof _0x3f0fe0[_0xfd11('0xf')]===_0xfd11('0xe');var _0x2cd8e8=_0x5488b6['count'];var _0x14a953=_0x33b261?0x0:_0x3f0fe0[_0xfd11('0x10')];var _0x5154c1=_0x33b261?_0x5488b6[_0xfd11('0x11')]:_0x3f0fe0[_0xfd11('0x10')]+_0x3f0fe0[_0xfd11('0xf')];var _0x1e80e9;if(_0x5154c1>=_0x2cd8e8){_0x5154c1=_0x2cd8e8;_0x1e80e9=0xc8;}else{_0x1e80e9=0xce;}_0x828f3b[_0xfd11('0xd')](_0x1e80e9);return _0x828f3b[_0xfd11('0x12')](_0xfd11('0x13'),_0x14a953+'-'+_0x5154c1+'/'+_0x2cd8e8)[_0xfd11('0x14')](_0x5488b6);}return null;};}function saveUpdates(_0x4821eb){return function(_0x542078){if(_0x542078){return _0x542078[_0xfd11('0x15')](_0x4821eb)[_0xfd11('0x16')](function(_0x2cd2e6){return _0x2cd2e6;});}return null;};}function removeEntity(_0x3eb578){return function(_0x40ae91){if(_0x40ae91){return _0x40ae91[_0xfd11('0x17')]()[_0xfd11('0x16')](function(){_0x3eb578['status'](0xcc)[_0xfd11('0x18')]();});}};}function handleEntityNotFound(_0x40d2d0){return function(_0x5a5818){if(!_0x5a5818){_0x40d2d0['sendStatus'](0x194);}return _0x5a5818;};}function handleError(_0x1b4d95,_0x5806db){_0x5806db=_0x5806db||0x1f4;return function(_0x17e8d2){logger[_0xfd11('0x19')](_0x17e8d2[_0xfd11('0x1a')]);if(_0x17e8d2[_0xfd11('0x1b')]){delete _0x17e8d2[_0xfd11('0x1b')];}_0x1b4d95[_0xfd11('0xd')](_0x5806db)[_0xfd11('0x1c')](_0x17e8d2);};}exports[_0xfd11('0x1d')]=function(_0x3a663f,_0x192b94){var _0x2883c5={};var _0xd4880c=_[_0xfd11('0x1e')](db[_0xfd11('0x1f')][_0xfd11('0x20')],function(_0x1237a8){return{'name':_0x1237a8[_0xfd11('0x21')],'type':_0x1237a8['type']['key']};});_0x2883c5=qs[_0xfd11('0x22')](_0xd4880c,_0x3a663f);return interaction[_0xfd11('0x23')](_0xfd11('0x24'),_0x3a663f['query'],_0x3a663f[_0xfd11('0x25')],_0x2883c5,_0xd4880c)[_0xfd11('0x16')](respondWithFilteredResult(_0x192b94,_0x2883c5))[_0xfd11('0x26')](handleError(_0x192b94,null));};exports[_0xfd11('0x27')]=function(_0x14ad91,_0x4a289d){var _0x4f5bfb={};if(_0x14ad91[_0xfd11('0x28')][_0xfd11('0x29')]&&_0x14ad91[_0xfd11('0x28')][_0xfd11('0x29')]==='from'){_0x4f5bfb[_0xfd11('0x2a')]=_0x14ad91[_0xfd11('0x2b')]['id'];}else{_0x4f5bfb['id']=_0x14ad91[_0xfd11('0x2b')]['id'];}var _0x2b72a9={'raw':![],'where':_0x4f5bfb},_0x598610={};_0x598610['model']=_[_0xfd11('0x2c')](db['OpenchannelInteraction']['rawAttributes']);_0x598610[_0xfd11('0x28')]=_[_0xfd11('0x2c')](_0x14ad91[_0xfd11('0x28')]);_0x598610['filters']=_[_0xfd11('0x2d')](_0x598610[_0xfd11('0x2e')],_0x598610[_0xfd11('0x28')]);_0x2b72a9['attributes']=_[_0xfd11('0x2d')](_0x598610['model'],qs[_0xfd11('0x2f')](_0x14ad91['query'][_0xfd11('0x2f')]));_0x2b72a9['attributes']=_0x2b72a9[_0xfd11('0x30')][_0xfd11('0x31')]?_0x2b72a9[_0xfd11('0x30')]:_0x598610[_0xfd11('0x2e')];if(_0x14ad91[_0xfd11('0x28')][_0xfd11('0x32')]){_0x2b72a9['include']=[{'all':!![]}];}_0x2b72a9=_[_0xfd11('0x33')]({},_0x2b72a9,_0x14ad91[_0xfd11('0x34')]);return db[_0xfd11('0x1f')][_0xfd11('0x35')](_0x2b72a9)[_0xfd11('0x16')](handleEntityNotFound(_0x4a289d,null))[_0xfd11('0x16')](respondWithResult(_0x4a289d,null))[_0xfd11('0x26')](handleError(_0x4a289d,null));};exports[_0xfd11('0x36')]=function(_0x52b380,_0x463d95){return db[_0xfd11('0x1f')][_0xfd11('0x36')](_0x52b380['body'],{})[_0xfd11('0x16')](respondWithResult(_0x463d95,0xc9))[_0xfd11('0x26')](handleError(_0x463d95,null));};exports[_0xfd11('0x15')]=function(_0x4c6941,_0x4c2445){if(_0x4c6941[_0xfd11('0x37')]['id']){delete _0x4c6941[_0xfd11('0x37')]['id'];}return db[_0xfd11('0x1f')][_0xfd11('0x35')]({'where':{'id':_0x4c6941['params']['id']}})['then'](handleEntityNotFound(_0x4c2445,null))['then'](saveUpdates(_0x4c6941[_0xfd11('0x37')],null))[_0xfd11('0x16')](respondWithResult(_0x4c2445,null))[_0xfd11('0x26')](handleError(_0x4c2445,null));};exports['destroy']=function(_0x36178f,_0x3b3864){return db['OpenchannelInteraction'][_0xfd11('0x35')]({'where':{'id':_0x36178f[_0xfd11('0x2b')]['id']}})[_0xfd11('0x16')](handleEntityNotFound(_0x3b3864,null))['then'](removeEntity(_0x3b3864,null))[_0xfd11('0x26')](handleError(_0x3b3864,null));};exports['describe']=function(_0x3f83bc,_0x212dc8){return db['OpenchannelInteraction'][_0xfd11('0x38')]()['then'](respondWithResult(_0x212dc8,null))['catch'](handleError(_0x212dc8,null));};exports[_0xfd11('0x39')]=function(_0x23cb46,_0x432e4b){return db['OpenchannelMessage'][_0xfd11('0x35')]({'where':{'id':_0x23cb46[_0xfd11('0x2b')]['id']}})[_0xfd11('0x16')](handleEntityNotFound(_0x432e4b,null))[_0xfd11('0x16')](function(_0x348400){if(_0x348400){return _0x348400[_0xfd11('0x39')](_0x23cb46['body'][_0xfd11('0x3a')],_['omit'](_0x23cb46[_0xfd11('0x37')],[_0xfd11('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x432e4b,null))[_0xfd11('0x26')](handleError(_0x432e4b,null));};exports[_0xfd11('0x3b')]=function(_0x29b78c,_0x3d4fdc){var _0x31ca0f={'raw':![],'where':{}};var _0x345476={};var _0xb66663={'count':0x0,'rows':[]};return db[_0xfd11('0x1f')]['findOne']({'where':{'id':_0x29b78c[_0xfd11('0x2b')]['id']}})[_0xfd11('0x16')](handleEntityNotFound(_0x3d4fdc,null))[_0xfd11('0x16')](function(_0x65beec){if(_0x65beec){_0x345476['model']=_[_0xfd11('0x2c')](db[_0xfd11('0x3c')][_0xfd11('0x20')]);_0x345476['query']=_['keys'](_0x29b78c[_0xfd11('0x28')]);_0x345476[_0xfd11('0x3d')]=_[_0xfd11('0x2d')](_0x345476['model'],_0x345476[_0xfd11('0x28')]);_0x31ca0f['attributes']=_[_0xfd11('0x2d')](_0x345476[_0xfd11('0x2e')],qs['fields'](_0x29b78c[_0xfd11('0x28')][_0xfd11('0x2f')]));_0x31ca0f[_0xfd11('0x30')]=_0x31ca0f[_0xfd11('0x30')][_0xfd11('0x31')]?_0x31ca0f['attributes']:_0x345476[_0xfd11('0x2e')];if(!_0x29b78c[_0xfd11('0x28')]['hasOwnProperty'](_0xfd11('0x3e'))){_0x31ca0f['limit']=qs[_0xfd11('0xf')](_0x29b78c['query'][_0xfd11('0xf')]);_0x31ca0f[_0xfd11('0x10')]=qs[_0xfd11('0x10')](_0x29b78c['query'][_0xfd11('0x10')]);}_0x31ca0f[_0xfd11('0x3f')]=qs[_0xfd11('0x40')](_0x29b78c[_0xfd11('0x28')][_0xfd11('0x40')]);_0x31ca0f[_0xfd11('0x41')]=qs[_0xfd11('0x3d')](_[_0xfd11('0x42')](_0x29b78c[_0xfd11('0x28')],_0x345476[_0xfd11('0x3d')]));_0x31ca0f[_0xfd11('0x41')][_0xfd11('0x43')]=_0x65beec['id'];if(_0x29b78c['query'][_0xfd11('0x44')]){_0x31ca0f[_0xfd11('0x41')]=_['merge'](_0x31ca0f[_0xfd11('0x41')],{'$or':_[_0xfd11('0x1e')](_0x31ca0f['attributes'],function(_0x5e54e3){var _0x496ff9={};_0x496ff9[_0x5e54e3]={'$like':'%'+_0x29b78c[_0xfd11('0x28')][_0xfd11('0x44')]+'%'};return _0x496ff9;})});}if(_0x29b78c[_0xfd11('0x28')][_0xfd11('0x45')]){var _0x234217=_0x29b78c[_0xfd11('0x28')][_0xfd11('0x45')][_0xfd11('0x46')](',');var _0x297e2c={};_0x297e2c[_0x234217[0x0]]={'$gte':moment(_0x234217[0x1])[_0xfd11('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x31ca0f[_0xfd11('0x41')]=_[_0xfd11('0x33')](_0x31ca0f['where'],_0x297e2c);}_0x31ca0f=_[_0xfd11('0x33')]({},_0x31ca0f,_0x29b78c[_0xfd11('0x34')]);return db[_0xfd11('0x3c')]['count']({'where':_0x31ca0f[_0xfd11('0x41')]})[_0xfd11('0x16')](function(_0x241e10){_0xb66663[_0xfd11('0x11')]=_0x241e10;if(_0x29b78c[_0xfd11('0x28')][_0xfd11('0x32')]){_0x31ca0f[_0xfd11('0x48')]=[{'all':!![]}];}return db[_0xfd11('0x3c')][_0xfd11('0x23')](_0x31ca0f);})[_0xfd11('0x16')](function(_0x1823dc){_0xb66663[_0xfd11('0x49')]=_0x1823dc;return _0xb66663;});}})[_0xfd11('0x16')](respondWithFilteredResult(_0x3d4fdc,_0x31ca0f))['catch'](handleError(_0x3d4fdc,null));};exports[_0xfd11('0x4a')]=function(_0x1505fb,_0x56ae44){return db[_0xfd11('0x1f')]['find']({'where':{'id':_0x1505fb['params']['id']}})[_0xfd11('0x16')](handleEntityNotFound(_0x56ae44,null))['then'](function(_0xae2dfc){if(_0xae2dfc){return _0xae2dfc[_0xfd11('0x4b')](_0x1505fb[_0xfd11('0x37')][_0xfd11('0x3a')],_['omit'](_0x1505fb[_0xfd11('0x37')],[_0xfd11('0x3a'),'id'])||{})[_0xfd11('0x4c')](function(){return db[_0xfd11('0x4d')][_0xfd11('0x23')]({'attributes':['id','name',_0xfd11('0x4e')],'where':{'id':_0x1505fb['body'][_0xfd11('0x3a')]}});})[_0xfd11('0x16')](function(_0x205a49){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x1505fb[_0xfd11('0x2b')]['id']),'tags':_0x205a49||[]});return{'id':Number(_0x1505fb[_0xfd11('0x2b')]['id']),'tags':_0x205a49||[]};});}})[_0xfd11('0x16')](respondWithResult(_0x56ae44,null))[_0xfd11('0x26')](handleError(_0x56ae44,null));};exports['removeTags']=function(_0x3b9884,_0x54b847){return db[_0xfd11('0x1f')][_0xfd11('0x35')]({'where':{'id':_0x3b9884[_0xfd11('0x2b')]['id']}})[_0xfd11('0x16')](handleEntityNotFound(_0x54b847,null))[_0xfd11('0x16')](function(_0x4e0f77){if(_0x4e0f77){return _0x4e0f77[_0xfd11('0x4f')](_0x3b9884[_0xfd11('0x28')]['ids']);}})[_0xfd11('0x16')](respondWithStatusCode(_0x54b847,null))[_0xfd11('0x26')](handleError(_0x54b847,null));};exports[_0xfd11('0x50')]=function(_0x5492d0,_0x28c782){var _0x2c7fb9=moment()['unix']()['toString']();var _0x9b5ba0=path['join'](config[_0xfd11('0x51')],_0xfd11('0x52'),_0xfd11('0x53'),_0xfd11('0x54'));var _0x534f44=path[_0xfd11('0x55')](config['root'],_0xfd11('0x52'),_0xfd11('0x53'),_0xfd11('0x56'));var _0x3b7de9=path[_0xfd11('0x55')](_0x9b5ba0,_0x2c7fb9);var _0xc56cae=util[_0xfd11('0x47')](_0xfd11('0x57'),_0x5492d0['params']['id'],_0x2c7fb9);var _0x22ff21=path[_0xfd11('0x55')](_0x9b5ba0,_0xc56cae);var _0x5b7f3b=[];_0x5b7f3b[_0xfd11('0x58')]({'model':db['User'],'as':_0xfd11('0x59'),'attributes':['id',_0xfd11('0x5a')],'raw':!![]});_0x5b7f3b[_0xfd11('0x58')]({'model':db[_0xfd11('0x5b')],'as':_0xfd11('0x5c'),'attributes':['id',_0xfd11('0x5d'),_0xfd11('0x5e')],'raw':!![]});if(_0x5492d0[_0xfd11('0x28')]['attachments']){_0x5b7f3b[_0xfd11('0x58')]({'model':db['Attachment'],'as':_0xfd11('0x5f'),'raw':!![]});}var _0x25de8f=[{'model':db[_0xfd11('0x3c')],'as':_0xfd11('0x60'),'attributes':['id',_0xfd11('0x37'),_0xfd11('0x61'),_0xfd11('0x62'),_0xfd11('0x63'),_0xfd11('0x64')],'include':_0x5b7f3b}];_0x25de8f[_0xfd11('0x58')]({'model':db[_0xfd11('0x65')],'as':_0xfd11('0x66'),'attributes':['id',_0xfd11('0x1b')]});_0x25de8f[_0xfd11('0x58')]({'model':db[_0xfd11('0x59')],'as':'Owner','attributes':['id','fullname']});return db[_0xfd11('0x1f')][_0xfd11('0x35')]({'where':{'id':_0x5492d0[_0xfd11('0x2b')]['id']},'include':_0x25de8f})[_0xfd11('0x16')](handleEntityNotFound(_0x28c782,null))[_0xfd11('0x16')](function(_0x5d993c){if(_0x5d993c){var _0x514474=_0x5d993c[_0xfd11('0x67')]({'plain':!![]});fs[_0xfd11('0x68')](_0x3b7de9);var _0x595cfb={'channel':_0xfd11('0x69'),'account':_0x514474[_0xfd11('0x66')][_0xfd11('0x1b')],'agent':_0x514474[_0xfd11('0x6a')]?_0x514474[_0xfd11('0x6a')][_0xfd11('0x5a')]:_0xfd11('0x6b'),'createdAt':moment(_0x514474[_0xfd11('0x61')])[_0xfd11('0x47')](_0xfd11('0x6c'))[_0xfd11('0x6d')](),'closedAt':_0x514474['closed']?moment(_0x514474['closedAt'])[_0xfd11('0x47')](_0xfd11('0x6c'))[_0xfd11('0x6d')]():'','disposition':_0x514474[_0xfd11('0x6e')],'visibility':_0x514474[_0xfd11('0x6f')]?_0xfd11('0x70'):_0xfd11('0x71'),'messages':_(_0x514474[_0xfd11('0x60')])[_0xfd11('0x44')]({'secret':![]})[_0xfd11('0x1e')](function(_0x51332f){if(_0x51332f[_0xfd11('0x5f')]){var _0x4b56da=path['join'](_0x534f44,_0x51332f[_0xfd11('0x5f')]['basename']);if(fs[_0xfd11('0x72')](_0x4b56da)){fs[_0xfd11('0x73')](_0x4b56da)[_0xfd11('0x74')](fs[_0xfd11('0x75')](path['join'](_0x3b7de9,_0x51332f['Attachment'][_0xfd11('0x76')])));}}return{'date':moment(_0x51332f['createdAt'])[_0xfd11('0x47')](_0xfd11('0x6c'))[_0xfd11('0x6d')](),'sender':_0x51332f['direction']===_0xfd11('0x77')?_0x51332f[_0xfd11('0x59')]?_0x51332f[_0xfd11('0x59')]['fullname']:_0xfd11('0x78'):_0x51332f[_0xfd11('0x5c')]['firstName']+(_0x51332f['Contact'][_0xfd11('0x5e')]?'\x20'+_0x51332f[_0xfd11('0x5c')]['lastName']:''),'body':_0x51332f[_0xfd11('0x5f')]?_0x51332f[_0xfd11('0x5f')]['basename']:_0x51332f[_0xfd11('0x37')],'direction':_0x51332f['direction']==='out'?'A':'C','secret':_0x51332f[_0xfd11('0x63')],'read':_0x51332f['read'],'attachment':_0x51332f[_0xfd11('0x5f')]};})['value']()};return ejs[_0xfd11('0x79')](path['join'](config[_0xfd11('0x51')],_0xfd11('0x52'),_0xfd11('0x7a'),_0xfd11('0x7b')),{'interaction':_0x595cfb})[_0xfd11('0x16')](function(_0x2d6930){var _0x175ab4=path[_0xfd11('0x55')](_0x3b7de9,_0xfd11('0x7c')+_0x514474['id']+'-'+_0x2c7fb9+'.pdf');var _0x330cca={'path':_0x175ab4,'channel':'Openchannel','interactionId':_0x514474['id']};return pdf[_0xfd11('0x7d')](_0x2d6930,_0x330cca);})[_0xfd11('0x16')](function(){return new Promise(function(_0x406efd,_0x3e1b94){zipdir(_0x3b7de9,{'saveTo':_0x22ff21},function(_0x44cea8,_0x57f129){if(_0x44cea8)return _0x3e1b94(_0x44cea8);return _0x406efd(_0x57f129);});})[_0xfd11('0x16')](function(){return new Promise(function(_0xea4e26,_0x113839){rimraf(_0x3b7de9,function(_0x201c10){if(_0x201c10)_0x113839(_0x201c10);return _0xea4e26();});});})['then'](function(){return _0x28c782['download'](_0x22ff21,_0xc56cae,function(_0x4d40dc){if(_0x4d40dc){logger[_0xfd11('0x19')](_0xfd11('0x7e'),_0x4d40dc);}else{fs[_0xfd11('0x7f')](_0x22ff21);}});});});}else{return _0x28c782[_0xfd11('0x80')](0xc8);}})[_0xfd11('0x26')](handleError(_0x28c782,null));}; \ No newline at end of file +var _0xbe28=['Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Public','Private','basename','existsSync','createWriteStream','out','System','firstName','Contact','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','offset','undefined','limit','count','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','catch','show','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','create','body','find','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','filter','$gte','split','options','include','rows','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','format','User','fullname','push','CmContact','lastName','attachments','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','mkdirSync'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbe28,0x119));var _0x8be2=function(_0x7a259b,_0xd77da){_0x7a259b=_0x7a259b-0x0;var _0x100721=_0xbe28[_0x7a259b];return _0x100721;};'use strict';var rimraf=require(_0x8be2('0x0'));var zipdir=require('zip-dir');var moment=require(_0x8be2('0x1'));var util=require(_0x8be2('0x2'));var path=require(_0x8be2('0x3'));var ejs=require(_0x8be2('0x4'));var fs=require('fs');var _=require(_0x8be2('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x8be2('0x6'));var pdf=require(_0x8be2('0x7'));var logger=require(_0x8be2('0x8'))(_0x8be2('0x9'));var config=require(_0x8be2('0xa'));var db=require(_0x8be2('0xb'))['db'];config[_0x8be2('0xc')]=_[_0x8be2('0xd')](config[_0x8be2('0xc')],{'host':_0x8be2('0xe'),'port':0x18eb});var socket=require(_0x8be2('0xf'))(new Redis(config[_0x8be2('0xc')]));require(_0x8be2('0x10'))[_0x8be2('0x11')](socket);function respondWithStatusCode(_0x2a7230,_0x4bb7dc){_0x4bb7dc=_0x4bb7dc||0xcc;return function(_0x49c0df){if(_0x49c0df){return _0x2a7230['sendStatus'](_0x4bb7dc);}return _0x2a7230[_0x8be2('0x12')](_0x4bb7dc)[_0x8be2('0x13')]();};}function respondWithResult(_0x422ce8,_0x2397b6){_0x2397b6=_0x2397b6||0xc8;return function(_0x500ec9){if(_0x500ec9){return _0x422ce8[_0x8be2('0x12')](_0x2397b6)[_0x8be2('0x14')](_0x500ec9);}};}function respondWithFilteredResult(_0x16aaff,_0x4609cd){return function(_0x5b31c1){if(_0x5b31c1){var _0x1ff665=typeof _0x4609cd[_0x8be2('0x15')]===_0x8be2('0x16')&&typeof _0x4609cd[_0x8be2('0x17')]===_0x8be2('0x16');var _0x2e8952=_0x5b31c1['count'];var _0x2e3342=_0x1ff665?0x0:_0x4609cd[_0x8be2('0x15')];var _0x1aa32d=_0x1ff665?_0x5b31c1[_0x8be2('0x18')]:_0x4609cd[_0x8be2('0x15')]+_0x4609cd['limit'];var _0x185da0;if(_0x1aa32d>=_0x2e8952){_0x1aa32d=_0x2e8952;_0x185da0=0xc8;}else{_0x185da0=0xce;}_0x16aaff[_0x8be2('0x12')](_0x185da0);return _0x16aaff['set']('Content-Range',_0x2e3342+'-'+_0x1aa32d+'/'+_0x2e8952)[_0x8be2('0x14')](_0x5b31c1);}return null;};}function saveUpdates(_0x1a8860){return function(_0x1166c4){if(_0x1166c4){return _0x1166c4[_0x8be2('0x19')](_0x1a8860)[_0x8be2('0x1a')](function(_0x1b8876){return _0x1b8876;});}return null;};}function removeEntity(_0x3f0db6){return function(_0x677918){if(_0x677918){return _0x677918['destroy']()[_0x8be2('0x1a')](function(){_0x3f0db6['status'](0xcc)[_0x8be2('0x13')]();});}};}function handleEntityNotFound(_0x5ab949){return function(_0x2ea3a5){if(!_0x2ea3a5){_0x5ab949[_0x8be2('0x1b')](0x194);}return _0x2ea3a5;};}function handleError(_0x1880a0,_0x235225){_0x235225=_0x235225||0x1f4;return function(_0x149ae8){logger[_0x8be2('0x1c')](_0x149ae8[_0x8be2('0x1d')]);if(_0x149ae8[_0x8be2('0x1e')]){delete _0x149ae8[_0x8be2('0x1e')];}_0x1880a0[_0x8be2('0x12')](_0x235225)[_0x8be2('0x1f')](_0x149ae8);};}exports[_0x8be2('0x20')]=function(_0x2a91d7,_0x222473){var _0x59e6e2={};var _0x2b1721=_[_0x8be2('0x21')](db[_0x8be2('0x22')][_0x8be2('0x23')],function(_0x2c6d64){return{'name':_0x2c6d64[_0x8be2('0x24')],'type':_0x2c6d64[_0x8be2('0x25')][_0x8be2('0x26')]};});_0x59e6e2=qs[_0x8be2('0x27')](_0x2b1721,_0x2a91d7);return interaction[_0x8be2('0x28')](_0x8be2('0x29'),_0x2a91d7[_0x8be2('0x2a')],_0x2a91d7['user'],_0x59e6e2,_0x2b1721)[_0x8be2('0x1a')](respondWithFilteredResult(_0x222473,_0x59e6e2))[_0x8be2('0x2b')](handleError(_0x222473,null));};exports[_0x8be2('0x2c')]=function(_0x4c8849,_0x3b37e1){var _0xf461cf={};if(_0x4c8849['query']['type']&&_0x4c8849[_0x8be2('0x2a')][_0x8be2('0x25')]===_0x8be2('0x2d')){_0xf461cf['from']=_0x4c8849[_0x8be2('0x2e')]['id'];}else{_0xf461cf['id']=_0x4c8849[_0x8be2('0x2e')]['id'];}var _0x5dcb39={'raw':![],'where':_0xf461cf},_0x504552={};_0x504552[_0x8be2('0x2f')]=_[_0x8be2('0x30')](db['OpenchannelInteraction'][_0x8be2('0x23')]);_0x504552[_0x8be2('0x2a')]=_['keys'](_0x4c8849[_0x8be2('0x2a')]);_0x504552[_0x8be2('0x31')]=_[_0x8be2('0x32')](_0x504552[_0x8be2('0x2f')],_0x504552[_0x8be2('0x2a')]);_0x5dcb39[_0x8be2('0x33')]=_[_0x8be2('0x32')](_0x504552[_0x8be2('0x2f')],qs[_0x8be2('0x34')](_0x4c8849['query'][_0x8be2('0x34')]));_0x5dcb39['attributes']=_0x5dcb39['attributes'][_0x8be2('0x35')]?_0x5dcb39[_0x8be2('0x33')]:_0x504552[_0x8be2('0x2f')];if(_0x4c8849[_0x8be2('0x2a')][_0x8be2('0x36')]){_0x5dcb39['include']=[{'all':!![]}];}_0x5dcb39=_[_0x8be2('0x37')]({},_0x5dcb39,_0x4c8849['options']);return db[_0x8be2('0x22')]['find'](_0x5dcb39)[_0x8be2('0x1a')](handleEntityNotFound(_0x3b37e1,null))[_0x8be2('0x1a')](respondWithResult(_0x3b37e1,null))['catch'](handleError(_0x3b37e1,null));};exports[_0x8be2('0x38')]=function(_0x4ee635,_0x43ba6b){return db[_0x8be2('0x22')]['create'](_0x4ee635[_0x8be2('0x39')],{})[_0x8be2('0x1a')](respondWithResult(_0x43ba6b,0xc9))[_0x8be2('0x2b')](handleError(_0x43ba6b,null));};exports[_0x8be2('0x19')]=function(_0x2ae3e3,_0x42b4ac){if(_0x2ae3e3[_0x8be2('0x39')]['id']){delete _0x2ae3e3[_0x8be2('0x39')]['id'];}return db['OpenchannelInteraction'][_0x8be2('0x3a')]({'where':{'id':_0x2ae3e3[_0x8be2('0x2e')]['id']}})['then'](handleEntityNotFound(_0x42b4ac,null))[_0x8be2('0x1a')](saveUpdates(_0x2ae3e3['body'],null))[_0x8be2('0x1a')](respondWithResult(_0x42b4ac,null))['catch'](handleError(_0x42b4ac,null));};exports[_0x8be2('0x3b')]=function(_0x56bbd9,_0x28f67a){return db[_0x8be2('0x22')][_0x8be2('0x3a')]({'where':{'id':_0x56bbd9[_0x8be2('0x2e')]['id']}})[_0x8be2('0x1a')](handleEntityNotFound(_0x28f67a,null))[_0x8be2('0x1a')](removeEntity(_0x28f67a,null))[_0x8be2('0x2b')](handleError(_0x28f67a,null));};exports[_0x8be2('0x3c')]=function(_0x27abd3,_0x1fd474){return db[_0x8be2('0x22')][_0x8be2('0x3c')]()[_0x8be2('0x1a')](respondWithResult(_0x1fd474,null))['catch'](handleError(_0x1fd474,null));};exports[_0x8be2('0x3d')]=function(_0xd2db45,_0x6d7c2e){return db[_0x8be2('0x3e')][_0x8be2('0x3a')]({'where':{'id':_0xd2db45[_0x8be2('0x2e')]['id']}})['then'](handleEntityNotFound(_0x6d7c2e,null))['then'](function(_0x47fc31){if(_0x47fc31){return _0x47fc31[_0x8be2('0x3d')](_0xd2db45[_0x8be2('0x39')][_0x8be2('0x3f')],_[_0x8be2('0x40')](_0xd2db45[_0x8be2('0x39')],[_0x8be2('0x3f'),'id'])||{});}})['then'](respondWithResult(_0x6d7c2e,null))[_0x8be2('0x2b')](handleError(_0x6d7c2e,null));};exports[_0x8be2('0x41')]=function(_0x5f128c,_0x1d43d4){var _0x76ecc={'raw':![],'where':{}};var _0xe4481e={};var _0x107711={'count':0x0,'rows':[]};return db[_0x8be2('0x22')]['findOne']({'where':{'id':_0x5f128c[_0x8be2('0x2e')]['id']}})[_0x8be2('0x1a')](handleEntityNotFound(_0x1d43d4,null))[_0x8be2('0x1a')](function(_0x26e503){if(_0x26e503){_0xe4481e[_0x8be2('0x2f')]=_[_0x8be2('0x30')](db[_0x8be2('0x3e')][_0x8be2('0x23')]);_0xe4481e[_0x8be2('0x2a')]=_[_0x8be2('0x30')](_0x5f128c[_0x8be2('0x2a')]);_0xe4481e[_0x8be2('0x31')]=_[_0x8be2('0x32')](_0xe4481e[_0x8be2('0x2f')],_0xe4481e[_0x8be2('0x2a')]);_0x76ecc[_0x8be2('0x33')]=_[_0x8be2('0x32')](_0xe4481e['model'],qs[_0x8be2('0x34')](_0x5f128c[_0x8be2('0x2a')]['fields']));_0x76ecc[_0x8be2('0x33')]=_0x76ecc[_0x8be2('0x33')][_0x8be2('0x35')]?_0x76ecc['attributes']:_0xe4481e[_0x8be2('0x2f')];if(!_0x5f128c['query'][_0x8be2('0x42')](_0x8be2('0x43'))){_0x76ecc[_0x8be2('0x17')]=qs['limit'](_0x5f128c[_0x8be2('0x2a')][_0x8be2('0x17')]);_0x76ecc[_0x8be2('0x15')]=qs[_0x8be2('0x15')](_0x5f128c[_0x8be2('0x2a')]['offset']);}_0x76ecc[_0x8be2('0x44')]=qs[_0x8be2('0x45')](_0x5f128c[_0x8be2('0x2a')][_0x8be2('0x45')]);_0x76ecc[_0x8be2('0x46')]=qs[_0x8be2('0x31')](_['pick'](_0x5f128c[_0x8be2('0x2a')],_0xe4481e[_0x8be2('0x31')]));_0x76ecc['where']['OpenchannelInteractionId']=_0x26e503['id'];if(_0x5f128c[_0x8be2('0x2a')][_0x8be2('0x47')]){_0x76ecc[_0x8be2('0x46')]=_['merge'](_0x76ecc[_0x8be2('0x46')],{'$or':_[_0x8be2('0x21')](_0x76ecc[_0x8be2('0x33')],function(_0xddea47){var _0x3997f0={};_0x3997f0[_0xddea47]={'$like':'%'+_0x5f128c['query'][_0x8be2('0x47')]+'%'};return _0x3997f0;})});}if(_0x5f128c['query'][_0x8be2('0x48')]){var _0x3a9836=_0x5f128c[_0x8be2('0x2a')][_0x8be2('0x48')][_0x8be2('0x49')](',');var _0x81a9e2={};_0x81a9e2[_0x3a9836[0x0]]={'$gte':moment(_0x3a9836[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x76ecc[_0x8be2('0x46')]=_['merge'](_0x76ecc['where'],_0x81a9e2);}_0x76ecc=_[_0x8be2('0x37')]({},_0x76ecc,_0x5f128c[_0x8be2('0x4a')]);return db['OpenchannelMessage'][_0x8be2('0x18')]({'where':_0x76ecc[_0x8be2('0x46')]})[_0x8be2('0x1a')](function(_0x296396){_0x107711[_0x8be2('0x18')]=_0x296396;if(_0x5f128c['query'][_0x8be2('0x36')]){_0x76ecc[_0x8be2('0x4b')]=[{'all':!![]}];}return db[_0x8be2('0x3e')][_0x8be2('0x28')](_0x76ecc);})[_0x8be2('0x1a')](function(_0x19e010){_0x107711[_0x8be2('0x4c')]=_0x19e010;return _0x107711;});}})['then'](respondWithFilteredResult(_0x1d43d4,_0x76ecc))[_0x8be2('0x2b')](handleError(_0x1d43d4,null));};exports[_0x8be2('0x4d')]=function(_0x39f0ff,_0x509ff1){return db[_0x8be2('0x22')][_0x8be2('0x3a')]({'where':{'id':_0x39f0ff[_0x8be2('0x2e')]['id']}})[_0x8be2('0x1a')](handleEntityNotFound(_0x509ff1,null))[_0x8be2('0x1a')](function(_0x4a28c9){if(_0x4a28c9){return _0x4a28c9[_0x8be2('0x4e')](_0x39f0ff[_0x8be2('0x39')]['ids'],_[_0x8be2('0x40')](_0x39f0ff[_0x8be2('0x39')],[_0x8be2('0x3f'),'id'])||{})[_0x8be2('0x4f')](function(){return db['Tag'][_0x8be2('0x28')]({'attributes':['id',_0x8be2('0x1e'),_0x8be2('0x50')],'where':{'id':_0x39f0ff[_0x8be2('0x39')][_0x8be2('0x3f')]}});})[_0x8be2('0x1a')](function(_0x5c0308){socket[_0x8be2('0x51')](_0x8be2('0x52'),{'id':Number(_0x39f0ff[_0x8be2('0x2e')]['id']),'tags':_0x5c0308||[]});return{'id':Number(_0x39f0ff[_0x8be2('0x2e')]['id']),'tags':_0x5c0308||[]};});}})['then'](respondWithResult(_0x509ff1,null))['catch'](handleError(_0x509ff1,null));};exports[_0x8be2('0x53')]=function(_0x406828,_0x5c338b){return db[_0x8be2('0x22')][_0x8be2('0x3a')]({'where':{'id':_0x406828['params']['id']}})['then'](handleEntityNotFound(_0x5c338b,null))[_0x8be2('0x1a')](function(_0x4ec620){if(_0x4ec620){return _0x4ec620[_0x8be2('0x53')](_0x406828[_0x8be2('0x2a')]['ids']);}})[_0x8be2('0x1a')](respondWithStatusCode(_0x5c338b,null))[_0x8be2('0x2b')](handleError(_0x5c338b,null));};exports[_0x8be2('0x54')]=function(_0x3c107d,_0x45d969){var _0xd7ff59=moment()[_0x8be2('0x55')]()[_0x8be2('0x56')]();var _0xd755e7=path[_0x8be2('0x57')](config['root'],_0x8be2('0x58'),_0x8be2('0x59'),_0x8be2('0x5a'));var _0x320e05=path[_0x8be2('0x57')](config[_0x8be2('0x5b')],'server',_0x8be2('0x59'),'attachments');var _0x753b64=path[_0x8be2('0x57')](_0xd755e7,_0xd7ff59);var _0x2b9525=util[_0x8be2('0x5c')]('transcript-%d-%s.zip',_0x3c107d[_0x8be2('0x2e')]['id'],_0xd7ff59);var _0x403eeb=path[_0x8be2('0x57')](_0xd755e7,_0x2b9525);var _0x228298=[];_0x228298['push']({'model':db[_0x8be2('0x5d')],'as':_0x8be2('0x5d'),'attributes':['id',_0x8be2('0x5e')],'raw':!![]});_0x228298[_0x8be2('0x5f')]({'model':db[_0x8be2('0x60')],'as':'Contact','attributes':['id','firstName',_0x8be2('0x61')],'raw':!![]});if(_0x3c107d[_0x8be2('0x2a')][_0x8be2('0x62')]){_0x228298[_0x8be2('0x5f')]({'model':db[_0x8be2('0x63')],'as':_0x8be2('0x63'),'raw':!![]});}var _0x2889d9=[{'model':db[_0x8be2('0x3e')],'as':_0x8be2('0x64'),'attributes':['id','body',_0x8be2('0x65'),_0x8be2('0x66'),_0x8be2('0x67'),_0x8be2('0x68')],'include':_0x228298}];_0x2889d9[_0x8be2('0x5f')]({'model':db[_0x8be2('0x69')],'as':_0x8be2('0x6a'),'attributes':['id','name']});_0x2889d9[_0x8be2('0x5f')]({'model':db[_0x8be2('0x5d')],'as':_0x8be2('0x6b'),'attributes':['id',_0x8be2('0x5e')]});return db[_0x8be2('0x22')][_0x8be2('0x3a')]({'where':{'id':_0x3c107d[_0x8be2('0x2e')]['id']},'include':_0x2889d9})[_0x8be2('0x1a')](handleEntityNotFound(_0x45d969,null))[_0x8be2('0x1a')](function(_0x53a8cc){if(_0x53a8cc){var _0x44a934=_0x53a8cc['get']({'plain':!![]});fs[_0x8be2('0x6c')](_0x753b64);var _0x497f89={'channel':_0x8be2('0x6d'),'account':_0x44a934[_0x8be2('0x6a')]['name'],'agent':_0x44a934[_0x8be2('0x6b')]?_0x44a934[_0x8be2('0x6b')][_0x8be2('0x5e')]:_0x8be2('0x6e'),'createdAt':moment(_0x44a934['createdAt'])[_0x8be2('0x5c')](_0x8be2('0x6f'))[_0x8be2('0x56')](),'closedAt':_0x44a934['closed']?moment(_0x44a934[_0x8be2('0x70')])['format'](_0x8be2('0x6f'))[_0x8be2('0x56')]():'','disposition':_0x44a934[_0x8be2('0x71')],'visibility':_0x44a934['threadId']?_0x8be2('0x72'):_0x8be2('0x73'),'messages':_(_0x44a934[_0x8be2('0x64')])[_0x8be2('0x47')]({'secret':![]})[_0x8be2('0x21')](function(_0x36008a){if(_0x36008a[_0x8be2('0x63')]){var _0x5bc338=path[_0x8be2('0x57')](_0x320e05,_0x36008a['Attachment'][_0x8be2('0x74')]);if(fs[_0x8be2('0x75')](_0x5bc338)){fs['createReadStream'](_0x5bc338)['pipe'](fs[_0x8be2('0x76')](path[_0x8be2('0x57')](_0x753b64,_0x36008a[_0x8be2('0x63')]['basename'])));}}return{'date':moment(_0x36008a[_0x8be2('0x65')])[_0x8be2('0x5c')](_0x8be2('0x6f'))['toString'](),'sender':_0x36008a[_0x8be2('0x66')]===_0x8be2('0x77')?_0x36008a[_0x8be2('0x5d')]?_0x36008a[_0x8be2('0x5d')][_0x8be2('0x5e')]:_0x8be2('0x78'):_0x36008a['Contact'][_0x8be2('0x79')]+(_0x36008a['Contact'][_0x8be2('0x61')]?'\x20'+_0x36008a[_0x8be2('0x7a')][_0x8be2('0x61')]:''),'body':_0x36008a[_0x8be2('0x63')]?_0x36008a[_0x8be2('0x63')]['basename']:_0x36008a['body'],'direction':_0x36008a['direction']===_0x8be2('0x77')?'A':'C','secret':_0x36008a[_0x8be2('0x67')],'read':_0x36008a[_0x8be2('0x68')],'attachment':_0x36008a[_0x8be2('0x63')]};})[_0x8be2('0x7b')]()};return ejs[_0x8be2('0x7c')](path[_0x8be2('0x57')](config[_0x8be2('0x5b')],_0x8be2('0x58'),'views',_0x8be2('0x7d')),{'interaction':_0x497f89})[_0x8be2('0x1a')](function(_0x551da2){var _0x18c07f=path[_0x8be2('0x57')](_0x753b64,_0x8be2('0x7e')+_0x44a934['id']+'-'+_0xd7ff59+_0x8be2('0x7f'));var _0x2d46d7={'path':_0x18c07f,'channel':'Openchannel','interactionId':_0x44a934['id']};return pdf['createPdfFromHTML'](_0x551da2,_0x2d46d7);})[_0x8be2('0x1a')](function(){return new Promise(function(_0x529472,_0x398f3b){zipdir(_0x753b64,{'saveTo':_0x403eeb},function(_0x54e547,_0x4cf3ec){if(_0x54e547)return _0x398f3b(_0x54e547);return _0x529472(_0x4cf3ec);});})[_0x8be2('0x1a')](function(){return new Promise(function(_0x261bce,_0x1bd7ff){rimraf(_0x753b64,function(_0x52a447){if(_0x52a447)_0x1bd7ff(_0x52a447);return _0x261bce();});});})[_0x8be2('0x1a')](function(){return _0x45d969['download'](_0x403eeb,_0x2b9525,function(_0x19a2ef){if(_0x19a2ef){logger['error'](_0x8be2('0x80'),_0x19a2ef);}else{fs[_0x8be2('0x81')](_0x403eeb);}});});});}else{return _0x45d969[_0x8be2('0x1b')](0xc8);}})[_0x8be2('0x2b')](handleError(_0x45d969,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 3eb38a2..97c82e5 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 _0x38e5=['OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','map','emit','catch','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0x38e5,0x14e));var _0x538e=function(_0x563f7a,_0x47170c){_0x563f7a=_0x563f7a-0x0;var _0x25930e=_0x38e5[_0x563f7a];return _0x25930e;};'use strict';var EventEmitter=require(_0x538e('0x0'));var OpenchannelInteraction=require(_0x538e('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x538e('0x1'))['db'][_0x538e('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x538e('0x3')](0x0);var events={'afterCreate':_0x538e('0x4'),'afterUpdate':'update','afterDestroy':_0x538e('0x5')};function emitEvent(_0x46c190){return function(_0x20d6f4,_0x1b6d87,_0x228cb7){_0x20d6f4[_0x538e('0x6')]({'attributes':['id'],'raw':!![]})[_0x538e('0x7')](function(_0x2c8556){_0x20d6f4[_0x538e('0x8')]('Users',_0x2c8556[_0x538e('0x9')](function(_0x20f339){return{'id':_0x20f339['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x20d6f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x538e('0x7')](function(_0x429f36){_0x20d6f4['setDataValue']('unreadMessages',_0x429f36['length']);OpenchannelInteractionEvents[_0x538e('0xa')](_0x46c190+':'+_0x20d6f4['id'],_0x20d6f4);OpenchannelInteractionEvents[_0x538e('0xa')](_0x46c190,_0x20d6f4);_0x228cb7(null);})[_0x538e('0xb')](_0x228cb7(null));};}for(var e in events){if(events[_0x538e('0xc')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x538e('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xc866=['then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers'];(function(_0x56de79,_0x1e1dc7){var _0x28baaf=function(_0x5482fb){while(--_0x5482fb){_0x56de79['push'](_0x56de79['shift']());}};_0x28baaf(++_0x1e1dc7);}(_0xc866,0x14d));var _0x6c86=function(_0xc097ec,_0x47e80b){_0xc097ec=_0xc097ec-0x0;var _0x219f0b=_0xc866[_0xc097ec];return _0x219f0b;};'use strict';var EventEmitter=require(_0x6c86('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x6c86('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x6c86('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6c86('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c86('0x4'),'afterDestroy':_0x6c86('0x5')};function emitEvent(_0x324487){return function(_0x31fb91,_0x278acf,_0x424b64){_0x31fb91[_0x6c86('0x6')]({'attributes':['id'],'raw':!![]})[_0x6c86('0x7')](function(_0x4f672c){_0x31fb91[_0x6c86('0x8')](_0x6c86('0x9'),_0x4f672c[_0x6c86('0xa')](function(_0x1e598b){return{'id':_0x1e598b['id']};}));return OpenchannelMessage[_0x6c86('0xb')]({'where':{'OpenchannelInteractionId':_0x31fb91['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6c86('0x7')](function(_0x4c38e9){_0x31fb91['setDataValue']('unreadMessages',_0x4c38e9['length']);OpenchannelInteractionEvents[_0x6c86('0xc')](_0x324487+':'+_0x31fb91['id'],_0x31fb91);OpenchannelInteractionEvents[_0x6c86('0xc')](_0x324487,_0x31fb91);_0x424b64(null);})[_0x6c86('0xd')](_0x424b64(null));};}for(var e in events){if(events[_0x6c86('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x6c86('0xf')](e,emitEvent(event));}}module[_0x6c86('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ffc8194..b509862 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 _0x2c12=['path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xbbf68e,_0x39b9b4){var _0x26363c=function(_0xf637ae){while(--_0xf637ae){_0xbbf68e['push'](_0xbbf68e['shift']());}};_0x26363c(++_0x39b9b4);}(_0x2c12,0x1bb));var _0x22c1=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0x2c12[_0x2e4cbf];return _0x52840f;};'use strict';var _=require(_0x22c1('0x0'));var util=require(_0x22c1('0x1'));var logger=require(_0x22c1('0x2'))(_0x22c1('0x3'));var moment=require(_0x22c1('0x4'));var BPromise=require(_0x22c1('0x5'));var rp=require(_0x22c1('0x6'));var fs=require('fs');var path=require(_0x22c1('0x7'));var rimraf=require('rimraf');var config=require(_0x22c1('0x8'));var attributes=require(_0x22c1('0x9'));module[_0x22c1('0xa')]=function(_0x4d137f,_0x3e9d43){return _0x4d137f[_0x22c1('0xb')](_0x22c1('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x22c1('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0xa91abd,_0x402002,_0x31ed9c){if(_0xa91abd[_0x22c1('0xe')](_0x22c1('0xf'))){_0xa91abd[_0x22c1('0x10')]=moment()[_0x22c1('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31ed9c(null,_0xa91abd);}}});}; \ No newline at end of file +var _0x24d6=['OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0x24d6,0x19c));var _0x624d=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x24d6[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x624d('0x0'))(_0x624d('0x1'));var moment=require(_0x624d('0x2'));var BPromise=require('bluebird');var rp=require(_0x624d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x624d('0x4'));var attributes=require(_0x624d('0x5'));module[_0x624d('0x6')]=function(_0x1008b9,_0xf73c09){return _0x1008b9[_0x624d('0x7')](_0x624d('0x8'),attributes,{'tableName':_0x624d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x624d('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4e048c,_0x485dc5,_0x473caf){if(_0x4e048c[_0x624d('0xb')](_0x624d('0xc'))){_0x4e048c['closedAt']=moment()['format'](_0x624d('0xd'));}_0x473caf(null,_0x4e048c);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 7c1dbb9..8fdee34 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 _0x2ed4=['result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','AddTagsToOpenchannelInteraction','find','then','addTags','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x5be23c,_0x287809){var _0x329fc7=function(_0x2d2d07){while(--_0x2d2d07){_0x5be23c['push'](_0x5be23c['shift']());}};_0x329fc7(++_0x287809);}(_0x2ed4,0x115));var _0x42ed=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0x2ed4[_0x4d8a8f];return _0xfc4adc;};'use strict';var _=require(_0x42ed('0x0'));var util=require(_0x42ed('0x1'));var moment=require(_0x42ed('0x2'));var BPromise=require(_0x42ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x42ed('0x5'));var logger=require('../../config/logger')(_0x42ed('0x6'));var config=require(_0x42ed('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x42ed('0x8')][_0x42ed('0x9')]({'port':0x232a});config['redis']=_[_0x42ed('0xa')](config[_0x42ed('0xb')],{'host':_0x42ed('0xc'),'port':0x18eb});var socket=require(_0x42ed('0xd'))(new Redis(config[_0x42ed('0xb')]));require(_0x42ed('0xe'))[_0x42ed('0xf')](socket);function respondWithRpcPromise(_0x17d059,_0x170d70,_0x107bd2){return new BPromise(function(_0x518364,_0x22809b){return client['request'](_0x17d059,_0x107bd2)['then'](function(_0x226484){logger[_0x42ed('0x10')](_0x42ed('0x11'),_0x170d70,'request\x20sent');logger['debug'](_0x42ed('0x12'),_0x170d70,_0x42ed('0x13'),JSON[_0x42ed('0x14')](_0x226484));if(_0x226484[_0x42ed('0x15')]){if(_0x226484[_0x42ed('0x15')][_0x42ed('0x16')]===0x1f4){logger[_0x42ed('0x15')](_0x42ed('0x11'),_0x170d70,_0x226484[_0x42ed('0x15')][_0x42ed('0x17')]);return _0x22809b(_0x226484['error'][_0x42ed('0x17')]);}logger[_0x42ed('0x15')](_0x42ed('0x11'),_0x170d70,_0x226484[_0x42ed('0x15')]['message']);return _0x518364(_0x226484[_0x42ed('0x15')][_0x42ed('0x17')]);}else{logger[_0x42ed('0x10')](_0x42ed('0x11'),_0x170d70,_0x42ed('0x13'));_0x518364(_0x226484[_0x42ed('0x18')][_0x42ed('0x17')]);}})[_0x42ed('0x19')](function(_0xe4cd55){logger[_0x42ed('0x15')](_0x42ed('0x11'),_0x170d70,_0xe4cd55);_0x22809b(_0xe4cd55);});});}exports[_0x42ed('0x1a')]=function(_0x4e82f8){var _0x134c9f=this;return new Promise(function(_0x49e106,_0x433300){return db[_0x42ed('0x1b')][_0x42ed('0x1c')](_0x4e82f8[_0x42ed('0x1d')],{'raw':_0x4e82f8[_0x42ed('0x1e')]?_0x4e82f8[_0x42ed('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e82f8[_0x42ed('0x1e')]?_0x4e82f8['options'][_0x42ed('0x1f')]||null:null,'attributes':_0x4e82f8[_0x42ed('0x1e')]?_0x4e82f8[_0x42ed('0x1e')][_0x42ed('0x20')]||null:null,'limit':_0x4e82f8[_0x42ed('0x1e')]?_0x4e82f8[_0x42ed('0x1e')][_0x42ed('0x21')]||null:null})['then'](function(_0x4df914){logger['info'](_0x42ed('0x1a'),_0x4e82f8);logger['debug'](_0x42ed('0x1a'),_0x4e82f8,JSON['stringify'](_0x4df914));_0x49e106(_0x4df914);})[_0x42ed('0x19')](function(_0x1386e9){logger[_0x42ed('0x15')](_0x42ed('0x1a'),_0x1386e9[_0x42ed('0x17')],_0x4e82f8);_0x433300(_0x134c9f[_0x42ed('0x15')](0x1f4,_0x1386e9['message']));});});};exports[_0x42ed('0x22')]=function(_0x3a6a92){return new Promise(function(_0x393e73,_0xe3ed29){return db['OpenchannelInteraction'][_0x42ed('0x23')]({'where':_0x3a6a92[_0x42ed('0x1e')]?_0x3a6a92[_0x42ed('0x1e')]['where']||null:null})[_0x42ed('0x24')](function(_0x286488){if(_0x286488){return _0x286488[_0x42ed('0x25')](_0x3a6a92[_0x42ed('0x1d')][_0x42ed('0x26')],_[_0x42ed('0x27')](_0x3a6a92[_0x42ed('0x1d')],[_0x42ed('0x26'),'id'])||{});}})[_0x42ed('0x28')](function(_0x44135d){logger['info'](_0x42ed('0x29'),_0x3a6a92);logger[_0x42ed('0x2a')](_0x42ed('0x29'),_0x3a6a92,JSON[_0x42ed('0x14')](_0x44135d));_0x393e73(_0x44135d);})[_0x42ed('0x19')](function(_0x126915){logger[_0x42ed('0x15')](_0x42ed('0x29'),_0x126915[_0x42ed('0x17')],_0x3a6a92);_0xe3ed29(_this[_0x42ed('0x15')](0x1f4,_0x126915[_0x42ed('0x17')]));});});}; \ No newline at end of file +var _0xa9c2=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4e707b,_0x19dc0d){var _0x4b4672=function(_0x1a11a3){while(--_0x1a11a3){_0x4e707b['push'](_0x4e707b['shift']());}};_0x4b4672(++_0x19dc0d);}(_0xa9c2,0x1dc));var _0x2a9c=function(_0x3567e0,_0x41fd5){_0x3567e0=_0x3567e0-0x0;var _0x3b74bb=_0xa9c2[_0x3567e0];return _0x3b74bb;};'use strict';var _=require(_0x2a9c('0x0'));var util=require(_0x2a9c('0x1'));var moment=require(_0x2a9c('0x2'));var BPromise=require(_0x2a9c('0x3'));var rs=require(_0x2a9c('0x4'));var fs=require('fs');var Redis=require(_0x2a9c('0x5'));var db=require(_0x2a9c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a9c('0x7'))(_0x2a9c('0x8'));var config=require(_0x2a9c('0x9'));var jayson=require(_0x2a9c('0xa'));var client=jayson['client'][_0x2a9c('0xb')]({'port':0x232a});config[_0x2a9c('0xc')]=_[_0x2a9c('0xd')](config[_0x2a9c('0xc')],{'host':_0x2a9c('0xe'),'port':0x18eb});var socket=require(_0x2a9c('0xf'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x2a9c('0x10')](socket);function respondWithRpcPromise(_0x1d1d57,_0x37f6cf,_0x3f6870){return new BPromise(function(_0x309fe8,_0xc164c3){return client['request'](_0x1d1d57,_0x3f6870)[_0x2a9c('0x11')](function(_0x396f5b){logger['info'](_0x2a9c('0x12'),_0x37f6cf,_0x2a9c('0x13'));logger['debug'](_0x2a9c('0x14'),_0x37f6cf,_0x2a9c('0x13'),JSON[_0x2a9c('0x15')](_0x396f5b));if(_0x396f5b[_0x2a9c('0x16')]){if(_0x396f5b[_0x2a9c('0x16')][_0x2a9c('0x17')]===0x1f4){logger[_0x2a9c('0x16')](_0x2a9c('0x12'),_0x37f6cf,_0x396f5b[_0x2a9c('0x16')][_0x2a9c('0x18')]);return _0xc164c3(_0x396f5b[_0x2a9c('0x16')][_0x2a9c('0x18')]);}logger[_0x2a9c('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x37f6cf,_0x396f5b['error']['message']);return _0x309fe8(_0x396f5b[_0x2a9c('0x16')][_0x2a9c('0x18')]);}else{logger[_0x2a9c('0x19')](_0x2a9c('0x12'),_0x37f6cf,_0x2a9c('0x13'));_0x309fe8(_0x396f5b['result'][_0x2a9c('0x18')]);}})[_0x2a9c('0x1a')](function(_0x40ca31){logger[_0x2a9c('0x16')](_0x2a9c('0x12'),_0x37f6cf,_0x40ca31);_0xc164c3(_0x40ca31);});});}exports['UpdateOpenchannelInteraction']=function(_0x369525){var _0x21ce6e=this;return new Promise(function(_0x472af8,_0x5dc5e0){return db[_0x2a9c('0x1b')][_0x2a9c('0x1c')](_0x369525[_0x2a9c('0x1d')],{'raw':_0x369525[_0x2a9c('0x1e')]?_0x369525['options'][_0x2a9c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x369525[_0x2a9c('0x1e')]?_0x369525[_0x2a9c('0x1e')][_0x2a9c('0x20')]||null:null,'attributes':_0x369525[_0x2a9c('0x1e')]?_0x369525['options'][_0x2a9c('0x21')]||null:null,'limit':_0x369525['options']?_0x369525[_0x2a9c('0x1e')][_0x2a9c('0x22')]||null:null})[_0x2a9c('0x11')](function(_0x5aa550){logger[_0x2a9c('0x19')](_0x2a9c('0x23'),_0x369525);logger[_0x2a9c('0x24')]('UpdateOpenchannelInteraction',_0x369525,JSON['stringify'](_0x5aa550));_0x472af8(_0x5aa550);})[_0x2a9c('0x1a')](function(_0x5662bf){logger[_0x2a9c('0x16')](_0x2a9c('0x23'),_0x5662bf[_0x2a9c('0x18')],_0x369525);_0x5dc5e0(_0x21ce6e[_0x2a9c('0x16')](0x1f4,_0x5662bf[_0x2a9c('0x18')]));});});};exports[_0x2a9c('0x25')]=function(_0x252648){return new Promise(function(_0x2c90af,_0x414bd1){return db[_0x2a9c('0x1b')][_0x2a9c('0x26')]({'where':_0x252648['options']?_0x252648[_0x2a9c('0x1e')][_0x2a9c('0x20')]||null:null})[_0x2a9c('0x11')](function(_0x4c18c7){if(_0x4c18c7){return _0x4c18c7[_0x2a9c('0x27')](_0x252648[_0x2a9c('0x1d')][_0x2a9c('0x28')],_[_0x2a9c('0x29')](_0x252648[_0x2a9c('0x1d')],[_0x2a9c('0x28'),'id'])||{});}})[_0x2a9c('0x2a')](function(_0x405fb0){logger[_0x2a9c('0x19')](_0x2a9c('0x2b'),_0x252648);logger[_0x2a9c('0x24')](_0x2a9c('0x2b'),_0x252648,JSON['stringify'](_0x405fb0));_0x2c90af(_0x405fb0);})['catch'](function(_0x5769a3){logger[_0x2a9c('0x16')](_0x2a9c('0x2b'),_0x5769a3[_0x2a9c('0x18')],_0x252648);_0x414bd1(_this[_0x2a9c('0x16')](0x1f4,_0x5769a3[_0x2a9c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index dd0d3e4..58256eb 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 _0x7279=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0xcca49b,_0x377ee8){var _0x2ad172=function(_0x33e6e2){while(--_0x33e6e2){_0xcca49b['push'](_0xcca49b['shift']());}};_0x2ad172(++_0x377ee8);}(_0x7279,0x18c));var _0x9727=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7279[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelInteractionEvents=require(_0x9727('0x0'));var events=[_0x9727('0x1'),_0x9727('0x2'),_0x9727('0x3')];function createListener(_0x4f7fba,_0x1c60ce){return function(_0x51084f){_0x1c60ce['emit'](_0x4f7fba,_0x51084f);};}function removeListener(_0x59a2b9,_0x3b9376){return function(){OpenchannelInteractionEvents[_0x9727('0x4')](_0x59a2b9,_0x3b9376);};}exports[_0x9727('0x5')]=function(_0x5566dc){for(var _0x20c621=0x0,_0x4f0ec4=events[_0x9727('0x6')];_0x20c621<_0x4f0ec4;_0x20c621++){var _0x10156d=events[_0x20c621];var _0x3f877a=createListener(_0x9727('0x7')+_0x10156d,_0x5566dc);OpenchannelInteractionEvents['on'](_0x10156d,_0x3f877a);}}; \ No newline at end of file +var _0x55c6=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','remove'];(function(_0x24c2b9,_0x34f57d){var _0xeee3ea=function(_0x4eb937){while(--_0x4eb937){_0x24c2b9['push'](_0x24c2b9['shift']());}};_0xeee3ea(++_0x34f57d);}(_0x55c6,0x146));var _0x655c=function(_0xdb15e6,_0x34a259){_0xdb15e6=_0xdb15e6-0x0;var _0x66ced8=_0x55c6[_0xdb15e6];return _0x66ced8;};'use strict';var OpenchannelInteractionEvents=require(_0x655c('0x0'));var events=['save',_0x655c('0x1'),_0x655c('0x2')];function createListener(_0x3b8262,_0x39582d){return function(_0x2a8858){_0x39582d[_0x655c('0x3')](_0x3b8262,_0x2a8858);};}function removeListener(_0xbc07bf,_0x5261f7){return function(){OpenchannelInteractionEvents[_0x655c('0x4')](_0xbc07bf,_0x5261f7);};}exports[_0x655c('0x5')]=function(_0x3f7d51){for(var _0x34ac4d=0x0,_0x4a48e5=events[_0x655c('0x6')];_0x34ac4d<_0x4a48e5;_0x34ac4d++){var _0x418862=events[_0x34ac4d];var _0x33a280=createListener(_0x655c('0x7')+_0x418862,_0x3f7d51);OpenchannelInteractionEvents['on'](_0x418862,_0x33a280);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index fa92d02..13086d0 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 _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index b8a758d..564b62b 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 _0x81cb=['DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x359e6c,_0x125100){var _0x310428=function(_0x5e7f1a){while(--_0x5e7f1a){_0x359e6c['push'](_0x359e6c['shift']());}};_0x310428(++_0x125100);}(_0x81cb,0xaa));var _0xb81c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81cb[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb81c('0x0'));module[_0xb81c('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb81c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb81c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb81c('0x4')]('in',_0xb81c('0x5')),'defaultValue':_0xb81c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb81c('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb81c('0x7')]}}; \ No newline at end of file +var _0x1219=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x1219,0x17c));var _0x9121=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1219[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9121('0x0'));module[_0x9121('0x1')]={'body':{'type':Sequelize[_0x9121('0x2')](_0x9121('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9121('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9121('0x5')]('in','out'),'defaultValue':_0x9121('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9121('0x7')]},'providerName':{'type':Sequelize[_0x9121('0x8')]},'providerResponse':{'type':Sequelize[_0x9121('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index b3d12fb..4ca7dfb 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 _0xc015=['RejectMessage','fullname','SIP/%s','reject','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','offset','undefined','count','limit','Content-Range','apply','save','destroy','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','update','describe','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','internal','interface','channel','motionChannel','accept','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0xc015,0x106));var _0x5c01=function(_0x411e71,_0xf9652){_0x411e71=_0x411e71-0x0;var _0x226ae3=_0xc015[_0x411e71];return _0x226ae3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c01('0x0'));var zipdir=require(_0x5c01('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c01('0x2'));var moment=require('moment');var BPromise=require(_0x5c01('0x3'));var Mustache=require(_0x5c01('0x4'));var util=require(_0x5c01('0x5'));var path=require(_0x5c01('0x6'));var sox=require(_0x5c01('0x7'));var csv=require(_0x5c01('0x8'));var ejs=require(_0x5c01('0x9'));var fs=require('fs');var fs_extra=require(_0x5c01('0xa'));var _=require(_0x5c01('0xb'));var squel=require('squel');var crypto=require(_0x5c01('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5c01('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5c01('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c01('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5c01('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c01('0x11'))(_0x5c01('0x12'));var utils=require(_0x5c01('0x13'));var config=require(_0x5c01('0x14'));var licenseUtil=require(_0x5c01('0x15'));var db=require(_0x5c01('0x16'))['db'];config[_0x5c01('0x17')]=_[_0x5c01('0x18')](config[_0x5c01('0x17')],{'host':_0x5c01('0x19'),'port':0x18eb});var socket=require(_0x5c01('0x1a'))(new Redis(config[_0x5c01('0x17')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x5c01('0x1b'));var client=jayson[_0x5c01('0x1c')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c789c,_0xe290e9,_0x2c7777,_0x3ffe15){return new BPromise(function(_0x2c5dc1,_0x15f628){var _0x40b28f=_0x3ffe15||client;return _0x40b28f['request'](_0x5c789c,_0x2c7777)[_0x5c01('0x1d')](function(_0x2cadf0){logger[_0x5c01('0x1e')](_0x5c01('0x1f'),_0xe290e9,_0x5c01('0x20'));logger[_0x5c01('0x21')](_0x5c01('0x22'),_0xe290e9,'request\x20sent',JSON['stringify'](_0x2cadf0));if(_0x2cadf0['error']){if(_0x2cadf0[_0x5c01('0x23')][_0x5c01('0x24')]===0x1f4){logger[_0x5c01('0x23')](_0x5c01('0x1f'),_0xe290e9,_0x2cadf0[_0x5c01('0x23')][_0x5c01('0x25')]);return _0x15f628(_0x2cadf0[_0x5c01('0x23')][_0x5c01('0x25')]);}logger[_0x5c01('0x23')](_0x5c01('0x1f'),_0xe290e9,_0x2cadf0[_0x5c01('0x23')][_0x5c01('0x25')]);return _0x2c5dc1(_0x2cadf0[_0x5c01('0x23')][_0x5c01('0x25')]);}else{logger[_0x5c01('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0xe290e9,_0x5c01('0x20'));_0x2c5dc1(_0x2cadf0[_0x5c01('0x26')][_0x5c01('0x25')]);}})['catch'](function(_0x1529aa){logger[_0x5c01('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0xe290e9,_0x1529aa);_0x15f628(_0x1529aa);});});}function respondWithStatusCode(_0x95520e,_0x50ba07){_0x50ba07=_0x50ba07||0xcc;return function(_0x5c494e){if(_0x5c494e){return _0x95520e[_0x5c01('0x27')](_0x50ba07);}return _0x95520e['status'](_0x50ba07)[_0x5c01('0x28')]();};}function respondWithResult(_0x307449,_0x14cdc4){_0x14cdc4=_0x14cdc4||0xc8;return function(_0x3578f9){if(_0x3578f9){return _0x307449[_0x5c01('0x29')](_0x14cdc4)['json'](_0x3578f9);}};}function respondWithFilteredResult(_0x273cb7,_0x36ed8f){return function(_0x4fe714){if(_0x4fe714){var _0x5c3dc0=typeof _0x36ed8f[_0x5c01('0x2a')]===_0x5c01('0x2b')&&typeof _0x36ed8f['limit']===_0x5c01('0x2b');var _0x241233=_0x4fe714[_0x5c01('0x2c')];var _0x2a0cf7=_0x5c3dc0?0x0:_0x36ed8f['offset'];var _0x1637cc=_0x5c3dc0?_0x4fe714['count']:_0x36ed8f['offset']+_0x36ed8f[_0x5c01('0x2d')];var _0x367900;if(_0x1637cc>=_0x241233){_0x1637cc=_0x241233;_0x367900=0xc8;}else{_0x367900=0xce;}_0x273cb7[_0x5c01('0x29')](_0x367900);return _0x273cb7['set'](_0x5c01('0x2e'),_0x2a0cf7+'-'+_0x1637cc+'/'+_0x241233)['json'](_0x4fe714);}return null;};}function patchUpdates(_0x4917dc){return function(_0x363050){try{jsonpatch[_0x5c01('0x2f')](_0x363050,_0x4917dc,!![]);}catch(_0x5c2fae){return BPromise['reject'](_0x5c2fae);}return _0x363050[_0x5c01('0x30')]();};}function saveUpdates(_0x3139c6,_0x3339bf){return function(_0x18c8de){if(_0x18c8de){return _0x18c8de['update'](_0x3139c6)[_0x5c01('0x1d')](function(_0x1af069){return _0x1af069;});}return null;};}function removeEntity(_0x1396dc,_0x268c43){return function(_0x3eb4d3){if(_0x3eb4d3){return _0x3eb4d3[_0x5c01('0x31')]()['then'](function(){_0x1396dc[_0x5c01('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c1913,_0x170c36){return function(_0xb65dca){if(!_0xb65dca){_0x3c1913[_0x5c01('0x27')](0x194);}return _0xb65dca;};}function handleError(_0x32ee86,_0x2a2874){_0x2a2874=_0x2a2874||0x1f4;return function(_0x11fbd2){logger[_0x5c01('0x23')](_0x11fbd2['stack']);if(_0x11fbd2[_0x5c01('0x32')]){delete _0x11fbd2[_0x5c01('0x32')];}_0x32ee86[_0x5c01('0x29')](_0x2a2874)[_0x5c01('0x33')](_0x11fbd2);};}exports[_0x5c01('0x34')]=function(_0x2bd33d,_0x55e455){var _0x529a74={},_0x325897={},_0x5db14c={'count':0x0,'rows':[]};var _0x1c68f8=_[_0x5c01('0x35')](db[_0x5c01('0x36')][_0x5c01('0x37')],function(_0x248216){return{'name':_0x248216[_0x5c01('0x38')],'type':_0x248216[_0x5c01('0x39')][_0x5c01('0x3a')]};});_0x325897[_0x5c01('0x3b')]=_[_0x5c01('0x35')](_0x1c68f8,_0x5c01('0x32'));_0x325897[_0x5c01('0x3c')]=_[_0x5c01('0x3d')](_0x2bd33d[_0x5c01('0x3c')]);_0x325897['filters']=_[_0x5c01('0x3e')](_0x325897[_0x5c01('0x3b')],_0x325897[_0x5c01('0x3c')]);_0x529a74[_0x5c01('0x3f')]=_[_0x5c01('0x3e')](_0x325897[_0x5c01('0x3b')],qs[_0x5c01('0x40')](_0x2bd33d[_0x5c01('0x3c')][_0x5c01('0x40')]));_0x529a74[_0x5c01('0x3f')]=_0x529a74[_0x5c01('0x3f')]['length']?_0x529a74[_0x5c01('0x3f')]:_0x325897[_0x5c01('0x3b')];if(!_0x2bd33d[_0x5c01('0x3c')][_0x5c01('0x41')](_0x5c01('0x42'))){_0x529a74[_0x5c01('0x2d')]=qs[_0x5c01('0x2d')](_0x2bd33d[_0x5c01('0x3c')][_0x5c01('0x2d')]);_0x529a74[_0x5c01('0x2a')]=qs[_0x5c01('0x2a')](_0x2bd33d['query'][_0x5c01('0x2a')]);}_0x529a74[_0x5c01('0x43')]=qs[_0x5c01('0x44')](_0x2bd33d[_0x5c01('0x3c')]['sort']);_0x529a74[_0x5c01('0x45')]=qs[_0x5c01('0x46')](_[_0x5c01('0x47')](_0x2bd33d[_0x5c01('0x3c')],_0x325897[_0x5c01('0x46')]),_0x1c68f8);if(_0x2bd33d[_0x5c01('0x3c')][_0x5c01('0x48')]){_0x529a74[_0x5c01('0x45')]=_[_0x5c01('0x49')](_0x529a74[_0x5c01('0x45')],{'$or':_[_0x5c01('0x35')](_0x1c68f8,function(_0x1c9958){if(_0x1c9958['type']!==_0x5c01('0x4a')){var _0x323b7c={};_0x323b7c[_0x1c9958[_0x5c01('0x32')]]={'$like':'%'+_0x2bd33d[_0x5c01('0x3c')][_0x5c01('0x48')]+'%'};return _0x323b7c;}})});}_0x529a74=_['merge']({},_0x529a74,_0x2bd33d['options']);var _0x454708={'where':_0x529a74['where']};return db[_0x5c01('0x36')][_0x5c01('0x2c')](_0x454708)['then'](function(_0x59b98d){_0x5db14c['count']=_0x59b98d;if(_0x2bd33d[_0x5c01('0x3c')][_0x5c01('0x4b')]){_0x529a74[_0x5c01('0x4c')]=[{'all':!![]}];}return db[_0x5c01('0x36')][_0x5c01('0x4d')](_0x529a74);})[_0x5c01('0x1d')](function(_0x17b1b0){_0x5db14c[_0x5c01('0x4e')]=_0x17b1b0;return _0x5db14c;})[_0x5c01('0x1d')](respondWithFilteredResult(_0x55e455,_0x529a74))[_0x5c01('0x4f')](handleError(_0x55e455,null));};exports[_0x5c01('0x50')]=function(_0x4abd2b,_0x1501fa){var _0x50737e={'raw':!![],'where':{'id':_0x4abd2b[_0x5c01('0x51')]['id']}},_0x4e947b={};_0x4e947b['model']=_[_0x5c01('0x3d')](db[_0x5c01('0x36')][_0x5c01('0x37')]);_0x4e947b[_0x5c01('0x3c')]=_[_0x5c01('0x3d')](_0x4abd2b[_0x5c01('0x3c')]);_0x4e947b[_0x5c01('0x46')]=_[_0x5c01('0x3e')](_0x4e947b['model'],_0x4e947b[_0x5c01('0x3c')]);_0x50737e[_0x5c01('0x3f')]=_[_0x5c01('0x3e')](_0x4e947b[_0x5c01('0x3b')],qs['fields'](_0x4abd2b[_0x5c01('0x3c')][_0x5c01('0x40')]));_0x50737e[_0x5c01('0x3f')]=_0x50737e[_0x5c01('0x3f')][_0x5c01('0x52')]?_0x50737e[_0x5c01('0x3f')]:_0x4e947b[_0x5c01('0x3b')];if(_0x4abd2b[_0x5c01('0x3c')]['includeAll']){_0x50737e[_0x5c01('0x4c')]=[{'all':!![]}];}_0x50737e=_[_0x5c01('0x49')]({},_0x50737e,_0x4abd2b[_0x5c01('0x53')]);return db[_0x5c01('0x36')][_0x5c01('0x54')](_0x50737e)[_0x5c01('0x1d')](handleEntityNotFound(_0x1501fa,null))[_0x5c01('0x1d')](respondWithResult(_0x1501fa,null))[_0x5c01('0x4f')](handleError(_0x1501fa,null));};exports[_0x5c01('0x55')]=function(_0x24a263,_0x3b2ce5){return db[_0x5c01('0x36')][_0x5c01('0x55')](_0x24a263[_0x5c01('0x56')],{})['then'](respondWithResult(_0x3b2ce5,0xc9))[_0x5c01('0x4f')](handleError(_0x3b2ce5,null));};exports[_0x5c01('0x57')]=function(_0x1ec667,_0x4906bc){if(_0x1ec667['body']['id']){delete _0x1ec667[_0x5c01('0x56')]['id'];}return db[_0x5c01('0x36')][_0x5c01('0x54')]({'where':{'id':_0x1ec667[_0x5c01('0x51')]['id']}})[_0x5c01('0x1d')](handleEntityNotFound(_0x4906bc,null))['then'](saveUpdates(_0x1ec667[_0x5c01('0x56')],null))[_0x5c01('0x1d')](respondWithResult(_0x4906bc,null))[_0x5c01('0x4f')](handleError(_0x4906bc,null));};exports[_0x5c01('0x31')]=function(_0x5fec8b,_0x3e8681){return db[_0x5c01('0x36')][_0x5c01('0x54')]({'where':{'id':_0x5fec8b['params']['id']}})[_0x5c01('0x1d')](handleEntityNotFound(_0x3e8681,null))['then'](removeEntity(_0x3e8681,null))['catch'](handleError(_0x3e8681,null));};exports[_0x5c01('0x58')]=function(_0x2679b1,_0x231b15){return db[_0x5c01('0x36')][_0x5c01('0x58')]()['then'](respondWithResult(_0x231b15,null))['catch'](handleError(_0x231b15,null));};var interaction_log=require(_0x5c01('0x11'))('openchannel-interactions');exports['accept']=function(_0x4af88c,_0x147990,_0x46fcdd){var _0x1c646f={'agent':{},'channel':_0x5c01('0x59')};if(_0x4af88c[_0x5c01('0x56')]['id']){delete _0x4af88c['body']['id'];}_0x4af88c[_0x5c01('0x56')][_0x5c01('0x5a')]=!![];_0x4af88c['body'][_0x5c01('0x5b')]=moment()[_0x5c01('0x5c')](_0x5c01('0x5d'));_0x4af88c[_0x5c01('0x56')][_0x5c01('0x5e')]=_0x4af88c['body']['UserId']||_0x4af88c[_0x5c01('0x5f')]['id'];_0x1c646f[_0x5c01('0x60')]['id']=_0x4af88c[_0x5c01('0x56')][_0x5c01('0x5e')];return db['OpenchannelMessage']['find']({'where':{'id':_0x4af88c['params']['id'],'UserId':null}})[_0x5c01('0x1d')](handleEntityNotFound(_0x147990,null))[_0x5c01('0x1d')](saveUpdates(_0x4af88c[_0x5c01('0x56')],null))['then'](function(_0x4aaae4){if(_0x4aaae4){_0x1c646f[_0x5c01('0x25')]=_0x4aaae4[_0x5c01('0x61')]({'plain':!![]});return db[_0x5c01('0x62')][_0x5c01('0x54')]({'where':{'id':_0x4aaae4[_0x5c01('0x63')]}});}return null;})[_0x5c01('0x1d')](handleEntityNotFound(_0x147990,null))['then'](function(_0x27e8cb){if(_0x27e8cb){return _0x27e8cb[_0x5c01('0x57')]({'UserId':_0x4af88c['body'][_0x5c01('0x5e')],'read1stAt':_[_0x5c01('0x64')](_0x27e8cb['read1stAt'])?moment()['format'](_0x5c01('0x5d')):undefined});}return null;})[_0x5c01('0x1d')](function(_0x5758f3){if(_0x5758f3){_0x1c646f['interaction']=_0x5758f3['get']({'plain':!![]});interaction_log[_0x5c01('0x1e')](_0x5c01('0x65'),_0x4af88c[_0x5c01('0x5f')]['id'],_0x4af88c[_0x5c01('0x5f')][_0x5c01('0x32')],_0x4af88c[_0x5c01('0x5f')][_0x5c01('0x66')],_0x1c646f[_0x5c01('0x67')]['id'],_0x4af88c[_0x5c01('0x56')]?JSON[_0x5c01('0x68')](_0x4af88c['body']):_0x5c01('0x69'));return respondWithRpcPromise(_0x5c01('0x6a'),_0x5c01('0x6b'),_0x1c646f);}return null;})[_0x5c01('0x1d')](function(_0x9e384f){var _0x45cade=_0x5c01('0x6c')+_0x9e384f[_0x5c01('0x25')][_0x5c01('0x6d')];return db[_0x5c01('0x6e')][_0x5c01('0x3c')](_0x45cade,{'type':db[_0x5c01('0x6f')][_0x5c01('0x70')][_0x5c01('0x71')],'raw':!![]})[_0x5c01('0x1d')](function(_0xac46be){return _0xac46be;});})['then'](function(_0x357f3a){if(_0x357f3a){_0x1c646f[_0x5c01('0x25')][_0x5c01('0x72')]=_0x357f3a[0x0];if(!_0x4af88c[_0x5c01('0x56')][_0x5c01('0x5e')])return;return db[_0x5c01('0x73')]['find']({'where':{'id':_0x4af88c[_0x5c01('0x56')][_0x5c01('0x5e')],'role':'agent'},'attributes':['id',_0x5c01('0x32'),'fullname','email',_0x5c01('0x74')],'raw':!![]});}return null;})[_0x5c01('0x1d')](function(_0x311b81){if(!_0x311b81)return null;_0x1c646f[_0x5c01('0x25')][_0x5c01('0x60')]=_0x311b81;return _0x1c646f;})[_0x5c01('0x1d')](function(_0x13fd19){if(_0x13fd19){if(_0x4af88c[_0x5c01('0x56')]['manual']){_0x1c646f[_0x5c01('0x25')][_0x5c01('0x75')]=util[_0x5c01('0x5c')]('SIP/%s',_0x4af88c[_0x5c01('0x5f')][_0x5c01('0x32')]);_0x1c646f[_0x5c01('0x25')][_0x5c01('0x76')]=_0x1c646f['channel'];_0x1c646f['message'][_0x5c01('0x77')]=_0x1c646f['channel'];_0x1c646f[_0x5c01('0x25')]['event']=_0x5c01('0x78');return respondWithRpcPromise(_0x5c01('0x79'),_0x5c01('0x79'),{'event':_0x5c01('0x7a'),'message':_0x1c646f[_0x5c01('0x25')]},client9002)['then'](function(){return _0x1c646f;});}return _0x1c646f;}return null;})['then'](respondWithResult(_0x147990,null))[_0x5c01('0x4f')](handleError(_0x147990,null));};var interaction_log=require(_0x5c01('0x11'))(_0x5c01('0x7b'));exports['reject']=function(_0x2dcc90,_0x2062fd,_0xa3170c){var _0x2a1a7e={'agent':{},'channel':_0x5c01('0x59')};if(_0x2dcc90[_0x5c01('0x56')]['id']){delete _0x2dcc90[_0x5c01('0x56')]['id'];}_0x2dcc90['body'][_0x5c01('0x5e')]=_0x2dcc90[_0x5c01('0x56')][_0x5c01('0x5e')]||_0x2dcc90['user']['id'];_0x2a1a7e[_0x5c01('0x60')]['id']=_0x2dcc90['body'][_0x5c01('0x5e')];return db[_0x5c01('0x36')]['find']({'where':{'id':_0x2dcc90[_0x5c01('0x51')]['id'],'UserId':null}})[_0x5c01('0x1d')](handleEntityNotFound(_0x2062fd,null))[_0x5c01('0x1d')](function(_0x95738e){if(_0x95738e){_0x2a1a7e[_0x5c01('0x25')]=_0x95738e[_0x5c01('0x61')]({'plain':!![]});return db[_0x5c01('0x62')]['find']({'where':{'id':_0x95738e[_0x5c01('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x2062fd,null))[_0x5c01('0x1d')](function(_0x4a1a59){if(_0x4a1a59){_0x2a1a7e[_0x5c01('0x67')]=_0x4a1a59[_0x5c01('0x61')]({'plain':!![]});interaction_log[_0x5c01('0x1e')](_0x5c01('0x7c'),_0x2dcc90[_0x5c01('0x5f')]['id'],_0x2dcc90[_0x5c01('0x5f')][_0x5c01('0x32')],_0x2dcc90[_0x5c01('0x5f')][_0x5c01('0x66')],_0x2a1a7e['interaction']['id'],_0x2dcc90['body']?JSON[_0x5c01('0x68')](_0x2dcc90[_0x5c01('0x56')]):'null');return respondWithRpcPromise(_0x5c01('0x7d'),'rejectMessage',_0x2a1a7e);}return null;})[_0x5c01('0x1d')](function(_0x174b62){var _0x4539a1=_0x5c01('0x6c')+_0x174b62[_0x5c01('0x25')]['ContactId'];return db[_0x5c01('0x6e')][_0x5c01('0x3c')](_0x4539a1,{'type':db[_0x5c01('0x6f')][_0x5c01('0x70')]['SELECT'],'raw':!![]})[_0x5c01('0x1d')](function(_0x5d1547){return _0x5d1547;});})[_0x5c01('0x1d')](function(_0x24e435){if(_0x24e435){_0x2a1a7e['message'][_0x5c01('0x72')]=_0x24e435[0x0];if(!_0x2dcc90['body'][_0x5c01('0x5e')])return;return db[_0x5c01('0x73')][_0x5c01('0x54')]({'where':{'id':_0x2dcc90[_0x5c01('0x56')][_0x5c01('0x5e')],'role':'agent'},'attributes':['id',_0x5c01('0x32'),_0x5c01('0x7e'),'email',_0x5c01('0x74')],'raw':!![]});}return null;})['then'](function(_0x29fcae){if(!_0x29fcae)return null;_0x2a1a7e[_0x5c01('0x25')]['agent']=_0x29fcae;return _0x2a1a7e;})[_0x5c01('0x1d')](function(_0x36babd){if(_0x36babd){_0x36babd[_0x5c01('0x25')][_0x5c01('0x75')]=util[_0x5c01('0x5c')](_0x5c01('0x7f'),_0x2dcc90[_0x5c01('0x5f')][_0x5c01('0x32')]);_0x36babd[_0x5c01('0x25')][_0x5c01('0x76')]=_0x2a1a7e[_0x5c01('0x76')];_0x36babd[_0x5c01('0x25')]['motionChannel']=_0x2a1a7e[_0x5c01('0x76')];_0x36babd[_0x5c01('0x25')]['event']=_0x5c01('0x80');respondWithRpcPromise(_0x5c01('0x79'),_0x5c01('0x79'),{'event':'rejectmessage','message':_0x36babd[_0x5c01('0x25')]},client9002);return _0x2a1a7e;}return null;})[_0x5c01('0x1d')](respondWithResult(_0x2062fd,null))[_0x5c01('0x4f')](handleError(_0x2062fd,null));}; \ No newline at end of file +var _0x4e83=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','email','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','includeAll','findAll','rows','show','rawAttributes','include','merge','options','find','create','body','update','params','describe','openchannel-interactions','openchannel','readAt','format','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage'];(function(_0x3cb048,_0x1d02c0){var _0x3d98cb=function(_0x2594b3){while(--_0x2594b3){_0x3cb048['push'](_0x3cb048['shift']());}};_0x3d98cb(++_0x1d02c0);}(_0x4e83,0x1ae));var _0x34e8=function(_0x2c4260,_0x19882c){_0x2c4260=_0x2c4260-0x0;var _0x13972e=_0x4e83[_0x2c4260];return _0x13972e;};'use strict';var emlformat=require(_0x34e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x34e8('0x1'));var jsonpatch=require(_0x34e8('0x2'));var rp=require(_0x34e8('0x3'));var moment=require(_0x34e8('0x4'));var BPromise=require(_0x34e8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x34e8('0x6'));var ejs=require(_0x34e8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34e8('0x8'));var squel=require(_0x34e8('0x9'));var crypto=require(_0x34e8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x34e8('0xb'));var toCsv=require(_0x34e8('0x6'));var querystring=require(_0x34e8('0xc'));var Papa=require('papaparse');var Redis=require(_0x34e8('0xd'));var authService=require(_0x34e8('0xe'));var qs=require(_0x34e8('0xf'));var as=require(_0x34e8('0x10'));var hardwareService=require(_0x34e8('0x11'));var logger=require(_0x34e8('0x12'))(_0x34e8('0x13'));var utils=require(_0x34e8('0x14'));var config=require(_0x34e8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x34e8('0x16'))['db'];config[_0x34e8('0x17')]=_['defaults'](config[_0x34e8('0x17')],{'host':_0x34e8('0x18'),'port':0x18eb});var socket=require(_0x34e8('0x19'))(new Redis(config[_0x34e8('0x17')]));require(_0x34e8('0x1a'))[_0x34e8('0x1b')](socket);var jayson=require(_0x34e8('0x1c'));var client=jayson[_0x34e8('0x1d')][_0x34e8('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x34e8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4447d3,_0x36adfb,_0x332735,_0x3772d7){return new BPromise(function(_0x4a4d17,_0x35cf64){var _0x37b6ae=_0x3772d7||client;return _0x37b6ae[_0x34e8('0x1f')](_0x4447d3,_0x332735)[_0x34e8('0x20')](function(_0x381484){logger[_0x34e8('0x21')](_0x34e8('0x22'),_0x36adfb,_0x34e8('0x23'));logger[_0x34e8('0x24')](_0x34e8('0x25'),_0x36adfb,_0x34e8('0x23'),JSON['stringify'](_0x381484));if(_0x381484[_0x34e8('0x26')]){if(_0x381484[_0x34e8('0x26')][_0x34e8('0x27')]===0x1f4){logger[_0x34e8('0x26')](_0x34e8('0x22'),_0x36adfb,_0x381484[_0x34e8('0x26')][_0x34e8('0x28')]);return _0x35cf64(_0x381484[_0x34e8('0x26')]['message']);}logger[_0x34e8('0x26')](_0x34e8('0x22'),_0x36adfb,_0x381484['error'][_0x34e8('0x28')]);return _0x4a4d17(_0x381484['error'][_0x34e8('0x28')]);}else{logger[_0x34e8('0x21')](_0x34e8('0x22'),_0x36adfb,'request\x20sent');_0x4a4d17(_0x381484['result'][_0x34e8('0x28')]);}})[_0x34e8('0x29')](function(_0xb8c9f){logger[_0x34e8('0x26')](_0x34e8('0x22'),_0x36adfb,_0xb8c9f);_0x35cf64(_0xb8c9f);});});}function respondWithStatusCode(_0xe098f4,_0x31d68a){_0x31d68a=_0x31d68a||0xcc;return function(_0x5c93e5){if(_0x5c93e5){return _0xe098f4[_0x34e8('0x2a')](_0x31d68a);}return _0xe098f4[_0x34e8('0x2b')](_0x31d68a)[_0x34e8('0x2c')]();};}function respondWithResult(_0x277457,_0xe77c9e){_0xe77c9e=_0xe77c9e||0xc8;return function(_0x23934c){if(_0x23934c){return _0x277457[_0x34e8('0x2b')](_0xe77c9e)[_0x34e8('0x2d')](_0x23934c);}};}function respondWithFilteredResult(_0x2b445a,_0x18490b){return function(_0x3f5421){if(_0x3f5421){var _0x6f4428=typeof _0x18490b[_0x34e8('0x2e')]===_0x34e8('0x2f')&&typeof _0x18490b[_0x34e8('0x30')]===_0x34e8('0x2f');var _0x2eb565=_0x3f5421['count'];var _0x3e7e42=_0x6f4428?0x0:_0x18490b[_0x34e8('0x2e')];var _0x5b951f=_0x6f4428?_0x3f5421[_0x34e8('0x31')]:_0x18490b[_0x34e8('0x2e')]+_0x18490b[_0x34e8('0x30')];var _0x2b7769;if(_0x5b951f>=_0x2eb565){_0x5b951f=_0x2eb565;_0x2b7769=0xc8;}else{_0x2b7769=0xce;}_0x2b445a[_0x34e8('0x2b')](_0x2b7769);return _0x2b445a[_0x34e8('0x32')](_0x34e8('0x33'),_0x3e7e42+'-'+_0x5b951f+'/'+_0x2eb565)[_0x34e8('0x2d')](_0x3f5421);}return null;};}function patchUpdates(_0x5e2fef){return function(_0x1f8171){try{jsonpatch[_0x34e8('0x34')](_0x1f8171,_0x5e2fef,!![]);}catch(_0xbc8217){return BPromise[_0x34e8('0x35')](_0xbc8217);}return _0x1f8171[_0x34e8('0x36')]();};}function saveUpdates(_0x35034c,_0x5594d0){return function(_0x44c9d0){if(_0x44c9d0){return _0x44c9d0['update'](_0x35034c)[_0x34e8('0x20')](function(_0x3580d3){return _0x3580d3;});}return null;};}function removeEntity(_0x59fcc2,_0x351c62){return function(_0x38a525){if(_0x38a525){return _0x38a525[_0x34e8('0x37')]()[_0x34e8('0x20')](function(){_0x59fcc2[_0x34e8('0x2b')](0xcc)[_0x34e8('0x2c')]();});}};}function handleEntityNotFound(_0x168497,_0x547457){return function(_0x5c11bb){if(!_0x5c11bb){_0x168497[_0x34e8('0x2a')](0x194);}return _0x5c11bb;};}function handleError(_0x3e7be9,_0x356269){_0x356269=_0x356269||0x1f4;return function(_0x5988b4){logger[_0x34e8('0x26')](_0x5988b4[_0x34e8('0x38')]);if(_0x5988b4[_0x34e8('0x39')]){delete _0x5988b4[_0x34e8('0x39')];}_0x3e7be9[_0x34e8('0x2b')](_0x356269)[_0x34e8('0x3a')](_0x5988b4);};}exports[_0x34e8('0x3b')]=function(_0x2e4fce,_0x50a32c){var _0x3994c0={},_0x380394={},_0x289405={'count':0x0,'rows':[]};var _0x5c4598=_[_0x34e8('0x3c')](db[_0x34e8('0x3d')]['rawAttributes'],function(_0x5d7ff7){return{'name':_0x5d7ff7[_0x34e8('0x3e')],'type':_0x5d7ff7[_0x34e8('0x3f')]['key']};});_0x380394[_0x34e8('0x40')]=_[_0x34e8('0x3c')](_0x5c4598,_0x34e8('0x39'));_0x380394[_0x34e8('0x41')]=_[_0x34e8('0x42')](_0x2e4fce[_0x34e8('0x41')]);_0x380394[_0x34e8('0x43')]=_[_0x34e8('0x44')](_0x380394[_0x34e8('0x40')],_0x380394['query']);_0x3994c0['attributes']=_[_0x34e8('0x44')](_0x380394['model'],qs[_0x34e8('0x45')](_0x2e4fce[_0x34e8('0x41')][_0x34e8('0x45')]));_0x3994c0[_0x34e8('0x46')]=_0x3994c0['attributes'][_0x34e8('0x47')]?_0x3994c0[_0x34e8('0x46')]:_0x380394[_0x34e8('0x40')];if(!_0x2e4fce[_0x34e8('0x41')][_0x34e8('0x48')]('nolimit')){_0x3994c0[_0x34e8('0x30')]=qs['limit'](_0x2e4fce[_0x34e8('0x41')][_0x34e8('0x30')]);_0x3994c0['offset']=qs[_0x34e8('0x2e')](_0x2e4fce[_0x34e8('0x41')][_0x34e8('0x2e')]);}_0x3994c0[_0x34e8('0x49')]=qs['sort'](_0x2e4fce[_0x34e8('0x41')][_0x34e8('0x4a')]);_0x3994c0['where']=qs['filters'](_[_0x34e8('0x4b')](_0x2e4fce['query'],_0x380394[_0x34e8('0x43')]),_0x5c4598);if(_0x2e4fce['query'][_0x34e8('0x4c')]){_0x3994c0[_0x34e8('0x4d')]=_['merge'](_0x3994c0[_0x34e8('0x4d')],{'$or':_['map'](_0x5c4598,function(_0x44ad37){if(_0x44ad37['type']!==_0x34e8('0x4e')){var _0x3c85d1={};_0x3c85d1[_0x44ad37[_0x34e8('0x39')]]={'$like':'%'+_0x2e4fce[_0x34e8('0x41')][_0x34e8('0x4c')]+'%'};return _0x3c85d1;}})});}_0x3994c0=_['merge']({},_0x3994c0,_0x2e4fce['options']);var _0x14d61d={'where':_0x3994c0[_0x34e8('0x4d')]};return db['OpenchannelMessage'][_0x34e8('0x31')](_0x14d61d)[_0x34e8('0x20')](function(_0x21a5f0){_0x289405['count']=_0x21a5f0;if(_0x2e4fce[_0x34e8('0x41')][_0x34e8('0x4f')]){_0x3994c0['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x34e8('0x50')](_0x3994c0);})['then'](function(_0xe281c7){_0x289405[_0x34e8('0x51')]=_0xe281c7;return _0x289405;})[_0x34e8('0x20')](respondWithFilteredResult(_0x50a32c,_0x3994c0))[_0x34e8('0x29')](handleError(_0x50a32c,null));};exports[_0x34e8('0x52')]=function(_0x3af586,_0x3ad3a3){var _0x373d7b={'raw':!![],'where':{'id':_0x3af586['params']['id']}},_0x2a2ab3={};_0x2a2ab3['model']=_[_0x34e8('0x42')](db[_0x34e8('0x3d')][_0x34e8('0x53')]);_0x2a2ab3[_0x34e8('0x41')]=_[_0x34e8('0x42')](_0x3af586[_0x34e8('0x41')]);_0x2a2ab3[_0x34e8('0x43')]=_[_0x34e8('0x44')](_0x2a2ab3[_0x34e8('0x40')],_0x2a2ab3['query']);_0x373d7b['attributes']=_[_0x34e8('0x44')](_0x2a2ab3[_0x34e8('0x40')],qs[_0x34e8('0x45')](_0x3af586[_0x34e8('0x41')][_0x34e8('0x45')]));_0x373d7b[_0x34e8('0x46')]=_0x373d7b['attributes'][_0x34e8('0x47')]?_0x373d7b[_0x34e8('0x46')]:_0x2a2ab3['model'];if(_0x3af586[_0x34e8('0x41')][_0x34e8('0x4f')]){_0x373d7b[_0x34e8('0x54')]=[{'all':!![]}];}_0x373d7b=_[_0x34e8('0x55')]({},_0x373d7b,_0x3af586[_0x34e8('0x56')]);return db[_0x34e8('0x3d')][_0x34e8('0x57')](_0x373d7b)[_0x34e8('0x20')](handleEntityNotFound(_0x3ad3a3,null))[_0x34e8('0x20')](respondWithResult(_0x3ad3a3,null))[_0x34e8('0x29')](handleError(_0x3ad3a3,null));};exports[_0x34e8('0x58')]=function(_0x2360d9,_0x350a73){return db[_0x34e8('0x3d')][_0x34e8('0x58')](_0x2360d9[_0x34e8('0x59')],{})[_0x34e8('0x20')](respondWithResult(_0x350a73,0xc9))['catch'](handleError(_0x350a73,null));};exports[_0x34e8('0x5a')]=function(_0x3b80e1,_0x18ebef){if(_0x3b80e1[_0x34e8('0x59')]['id']){delete _0x3b80e1[_0x34e8('0x59')]['id'];}return db[_0x34e8('0x3d')][_0x34e8('0x57')]({'where':{'id':_0x3b80e1[_0x34e8('0x5b')]['id']}})[_0x34e8('0x20')](handleEntityNotFound(_0x18ebef,null))[_0x34e8('0x20')](saveUpdates(_0x3b80e1[_0x34e8('0x59')],null))[_0x34e8('0x20')](respondWithResult(_0x18ebef,null))['catch'](handleError(_0x18ebef,null));};exports[_0x34e8('0x37')]=function(_0x18ccf0,_0x2c5bbd){return db[_0x34e8('0x3d')][_0x34e8('0x57')]({'where':{'id':_0x18ccf0[_0x34e8('0x5b')]['id']}})[_0x34e8('0x20')](handleEntityNotFound(_0x2c5bbd,null))[_0x34e8('0x20')](removeEntity(_0x2c5bbd,null))[_0x34e8('0x29')](handleError(_0x2c5bbd,null));};exports[_0x34e8('0x5c')]=function(_0x164b21,_0x24226f){return db[_0x34e8('0x3d')]['describe']()[_0x34e8('0x20')](respondWithResult(_0x24226f,null))['catch'](handleError(_0x24226f,null));};var interaction_log=require('../../config/logger')(_0x34e8('0x5d'));exports['accept']=function(_0xe81a64,_0x527a71,_0x4688db){var _0x5cb7df={'agent':{},'channel':_0x34e8('0x5e')};if(_0xe81a64[_0x34e8('0x59')]['id']){delete _0xe81a64[_0x34e8('0x59')]['id'];}_0xe81a64[_0x34e8('0x59')]['read']=!![];_0xe81a64[_0x34e8('0x59')][_0x34e8('0x5f')]=moment()[_0x34e8('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0xe81a64[_0x34e8('0x59')][_0x34e8('0x61')]=_0xe81a64[_0x34e8('0x59')]['UserId']||_0xe81a64[_0x34e8('0x62')]['id'];_0x5cb7df['agent']['id']=_0xe81a64[_0x34e8('0x59')][_0x34e8('0x61')];return db['OpenchannelMessage'][_0x34e8('0x57')]({'where':{'id':_0xe81a64[_0x34e8('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x527a71,null))['then'](saveUpdates(_0xe81a64['body'],null))[_0x34e8('0x20')](function(_0x34c68d){if(_0x34c68d){_0x5cb7df['message']=_0x34c68d[_0x34e8('0x63')]({'plain':!![]});return db[_0x34e8('0x64')][_0x34e8('0x57')]({'where':{'id':_0x34c68d[_0x34e8('0x65')]}});}return null;})[_0x34e8('0x20')](handleEntityNotFound(_0x527a71,null))[_0x34e8('0x20')](function(_0x464c81){if(_0x464c81){return _0x464c81[_0x34e8('0x5a')]({'UserId':_0xe81a64[_0x34e8('0x59')][_0x34e8('0x61')],'read1stAt':_[_0x34e8('0x66')](_0x464c81['read1stAt'])?moment()[_0x34e8('0x60')](_0x34e8('0x67')):undefined});}return null;})['then'](function(_0xa28850){if(_0xa28850){_0x5cb7df[_0x34e8('0x68')]=_0xa28850['get']({'plain':!![]});interaction_log['info'](_0x34e8('0x69'),_0xe81a64['user']['id'],_0xe81a64['user']['name'],_0xe81a64[_0x34e8('0x62')]['role'],_0x5cb7df[_0x34e8('0x68')]['id'],_0xe81a64[_0x34e8('0x59')]?JSON[_0x34e8('0x6a')](_0xe81a64[_0x34e8('0x59')]):_0x34e8('0x6b'));return respondWithRpcPromise(_0x34e8('0x6c'),_0x34e8('0x6d'),_0x5cb7df);}return null;})[_0x34e8('0x20')](function(_0x101b37){var _0x3c203b=_0x34e8('0x6e')+_0x101b37['message'][_0x34e8('0x6f')];return db[_0x34e8('0x70')][_0x34e8('0x41')](_0x3c203b,{'type':db[_0x34e8('0x71')][_0x34e8('0x72')][_0x34e8('0x73')],'raw':!![]})[_0x34e8('0x20')](function(_0x3e60cf){return _0x3e60cf;});})[_0x34e8('0x20')](function(_0x129a75){if(_0x129a75){_0x5cb7df[_0x34e8('0x28')][_0x34e8('0x74')]=_0x129a75[0x0];if(!_0xe81a64[_0x34e8('0x59')][_0x34e8('0x61')])return;return db[_0x34e8('0x75')][_0x34e8('0x57')]({'where':{'id':_0xe81a64[_0x34e8('0x59')][_0x34e8('0x61')],'role':_0x34e8('0x76')},'attributes':['id',_0x34e8('0x39'),_0x34e8('0x77'),'email',_0x34e8('0x78')],'raw':!![]});}return null;})[_0x34e8('0x20')](function(_0x4f0f49){if(!_0x4f0f49)return null;_0x5cb7df[_0x34e8('0x28')]['agent']=_0x4f0f49;return _0x5cb7df;})[_0x34e8('0x20')](function(_0x477666){if(_0x477666){if(_0xe81a64[_0x34e8('0x59')]['manual']){_0x5cb7df[_0x34e8('0x28')][_0x34e8('0x79')]=util['format'](_0x34e8('0x7a'),_0xe81a64['user'][_0x34e8('0x39')]);_0x5cb7df[_0x34e8('0x28')]['channel']=_0x5cb7df[_0x34e8('0x7b')];_0x5cb7df[_0x34e8('0x28')][_0x34e8('0x7c')]=_0x5cb7df[_0x34e8('0x7b')];_0x5cb7df[_0x34e8('0x28')][_0x34e8('0x7d')]=_0x34e8('0x7e');return respondWithRpcPromise(_0x34e8('0x7f'),_0x34e8('0x7f'),{'event':_0x34e8('0x80'),'message':_0x5cb7df[_0x34e8('0x28')]},client9002)[_0x34e8('0x20')](function(){return _0x5cb7df;});}return _0x5cb7df;}return null;})['then'](respondWithResult(_0x527a71,null))['catch'](handleError(_0x527a71,null));};var interaction_log=require(_0x34e8('0x12'))(_0x34e8('0x5d'));exports[_0x34e8('0x35')]=function(_0x1a6603,_0xa1699a,_0x2f7570){var _0x88d00b={'agent':{},'channel':_0x34e8('0x5e')};if(_0x1a6603[_0x34e8('0x59')]['id']){delete _0x1a6603[_0x34e8('0x59')]['id'];}_0x1a6603[_0x34e8('0x59')][_0x34e8('0x61')]=_0x1a6603[_0x34e8('0x59')][_0x34e8('0x61')]||_0x1a6603['user']['id'];_0x88d00b[_0x34e8('0x76')]['id']=_0x1a6603[_0x34e8('0x59')][_0x34e8('0x61')];return db[_0x34e8('0x3d')][_0x34e8('0x57')]({'where':{'id':_0x1a6603[_0x34e8('0x5b')]['id'],'UserId':null}})[_0x34e8('0x20')](handleEntityNotFound(_0xa1699a,null))[_0x34e8('0x20')](function(_0x4c1bb7){if(_0x4c1bb7){_0x88d00b[_0x34e8('0x28')]=_0x4c1bb7[_0x34e8('0x63')]({'plain':!![]});return db['OpenchannelInteraction'][_0x34e8('0x57')]({'where':{'id':_0x4c1bb7[_0x34e8('0x65')]}});}return null;})[_0x34e8('0x20')](handleEntityNotFound(_0xa1699a,null))[_0x34e8('0x20')](function(_0xd48ef7){if(_0xd48ef7){_0x88d00b[_0x34e8('0x68')]=_0xd48ef7[_0x34e8('0x63')]({'plain':!![]});interaction_log[_0x34e8('0x21')](_0x34e8('0x81'),_0x1a6603[_0x34e8('0x62')]['id'],_0x1a6603[_0x34e8('0x62')]['name'],_0x1a6603[_0x34e8('0x62')][_0x34e8('0x82')],_0x88d00b[_0x34e8('0x68')]['id'],_0x1a6603[_0x34e8('0x59')]?JSON[_0x34e8('0x6a')](_0x1a6603[_0x34e8('0x59')]):'null');return respondWithRpcPromise(_0x34e8('0x83'),_0x34e8('0x84'),_0x88d00b);}return null;})['then'](function(_0xf5c0ba){var _0x2f3a96=_0x34e8('0x6e')+_0xf5c0ba[_0x34e8('0x28')][_0x34e8('0x6f')];return db[_0x34e8('0x70')][_0x34e8('0x41')](_0x2f3a96,{'type':db[_0x34e8('0x71')][_0x34e8('0x72')][_0x34e8('0x73')],'raw':!![]})[_0x34e8('0x20')](function(_0x46e61a){return _0x46e61a;});})[_0x34e8('0x20')](function(_0x6b5eda){if(_0x6b5eda){_0x88d00b[_0x34e8('0x28')][_0x34e8('0x74')]=_0x6b5eda[0x0];if(!_0x1a6603[_0x34e8('0x59')]['UserId'])return;return db['User'][_0x34e8('0x57')]({'where':{'id':_0x1a6603[_0x34e8('0x59')][_0x34e8('0x61')],'role':_0x34e8('0x76')},'attributes':['id',_0x34e8('0x39'),'fullname',_0x34e8('0x85'),_0x34e8('0x78')],'raw':!![]});}return null;})['then'](function(_0x596a50){if(!_0x596a50)return null;_0x88d00b['message']['agent']=_0x596a50;return _0x88d00b;})[_0x34e8('0x20')](function(_0x3d6f51){if(_0x3d6f51){_0x3d6f51['message'][_0x34e8('0x79')]=util[_0x34e8('0x60')]('SIP/%s',_0x1a6603[_0x34e8('0x62')]['name']);_0x3d6f51[_0x34e8('0x28')][_0x34e8('0x7b')]=_0x88d00b['channel'];_0x3d6f51[_0x34e8('0x28')][_0x34e8('0x7c')]=_0x88d00b[_0x34e8('0x7b')];_0x3d6f51['message'][_0x34e8('0x7d')]=_0x34e8('0x35');respondWithRpcPromise('EventManager',_0x34e8('0x7f'),{'event':_0x34e8('0x86'),'message':_0x3d6f51[_0x34e8('0x28')]},client9002);return _0x88d00b;}return null;})[_0x34e8('0x20')](respondWithResult(_0xa1699a,null))['catch'](handleError(_0xa1699a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index e26a0f2..4f23e87 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 _0x811e=['events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x2b346e,_0x2c9c6d){var _0xd36d24=function(_0x3c1f35){while(--_0x3c1f35){_0x2b346e['push'](_0x2b346e['shift']());}};_0xd36d24(++_0x2c9c6d);}(_0x811e,0x1d5));var _0xe811=function(_0x146d9d,_0x58b69a){_0x146d9d=_0x146d9d-0x0;var _0xe0b432=_0x811e[_0x146d9d];return _0xe0b432;};'use strict';var EventEmitter=require(_0xe811('0x0'));var OpenchannelMessage=require(_0xe811('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xe811('0x2')](0x0);var events={'afterCreate':_0xe811('0x3'),'afterUpdate':_0xe811('0x4'),'afterDestroy':_0xe811('0x5')};function emitEvent(_0x56c0a1){return function(_0x4e4c95,_0x1690c9,_0x57c9cb){OpenchannelMessageEvents[_0xe811('0x6')](_0x56c0a1+':'+_0x4e4c95['id'],_0x4e4c95);OpenchannelMessageEvents[_0xe811('0x6')](_0x56c0a1,_0x4e4c95);_0x57c9cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x1d49=['exports','events','OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5ee6fe,_0x2d8da2){var _0x470245=function(_0x3ddaac){while(--_0x3ddaac){_0x5ee6fe['push'](_0x5ee6fe['shift']());}};_0x470245(++_0x2d8da2);}(_0x1d49,0xd0));var _0x91d4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1d49[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x91d4('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x91d4('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x91d4('0x2')](0x0);var events={'afterCreate':_0x91d4('0x3'),'afterUpdate':_0x91d4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x232cf9){return function(_0x10ce0e,_0xeeedeb,_0x7b8d74){OpenchannelMessageEvents[_0x91d4('0x5')](_0x232cf9+':'+_0x10ce0e['id'],_0x10ce0e);OpenchannelMessageEvents[_0x91d4('0x5')](_0x232cf9,_0x10ce0e);_0x7b8d74(null);};}for(var e in events){if(events[_0x91d4('0x6')](e)){var event=events[e];OpenchannelMessage[_0x91d4('0x7')](e,emitEvent(event));}}module[_0x91d4('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 aa5035c..3357568 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 _0xfcd1=['Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','Contact','method','GET','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','describe','find','OpenchannelInteraction','keys','replyUri','info','format'];(function(_0x529c45,_0x3a2462){var _0x3ba70c=function(_0x1e61fa){while(--_0x1e61fa){_0x529c45['push'](_0x529c45['shift']());}};_0x3ba70c(++_0x3a2462);}(_0xfcd1,0x7b));var _0x1fcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfcd1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1fcd('0x0'));var util=require(_0x1fcd('0x1'));var logger=require('../../config/logger')(_0x1fcd('0x2'));var moment=require(_0x1fcd('0x3'));var BPromise=require(_0x1fcd('0x4'));var rp=require(_0x1fcd('0x5'));var fs=require('fs');var path=require(_0x1fcd('0x6'));var rimraf=require('rimraf');var config=require(_0x1fcd('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x1fcd('0x8')]=function(_0x22591d,_0x3c1629){return _0x22591d[_0x1fcd('0x9')](_0x1fcd('0xa'),attributes,{'tableName':_0x1fcd('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x1fcd('0xc')],'type':_0x1fcd('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4243dd,_0x3b939b,_0x4f741d){var _0x514864=_0x22591d[_0x1fcd('0xe')];var _0x3009d1=_0x4243dd[_0x1fcd('0xf')]({'plain':!![]});if(_0x3009d1[_0x1fcd('0x10')][_0x1fcd('0x11')]()==='in'||_0x3009d1[_0x1fcd('0x10')][_0x1fcd('0x11')]()===_0x1fcd('0x12')&&!_0x3009d1[_0x1fcd('0x13')]&&!_[_0x1fcd('0x14')](_0x3009d1[_0x1fcd('0x15')])){_0x514864['OpenchannelInteraction'][_0x1fcd('0x16')]({'where':{'id':_0x3009d1[_0x1fcd('0x17')]}})[_0x1fcd('0x18')](function(_0x51cede){if(_0x51cede){_0x51cede['update']({'lastMsgAt':_0x3009d1[_0x1fcd('0x19')],'lastMsgDirection':_0x3009d1[_0x1fcd('0x10')][_0x1fcd('0x11')]()});}})[_0x1fcd('0x1a')](function(_0x24e347){console[_0x1fcd('0x1b')](_0x24e347);});}if(_0x3009d1['direction']===_0x1fcd('0x12')&&!_0x3009d1['secret']){var _0x47d75c;_0x514864[_0x1fcd('0x1c')][_0x1fcd('0x1d')]()[_0x1fcd('0x18')](function(_0xf3531f){return _0x514864['OpenchannelAccount'][_0x1fcd('0x1e')]({'where':{'id':_0x3009d1['OpenchannelAccountId']},'include':[{'model':_0x514864[_0x1fcd('0x1f')],'as':'Interactions','where':{'id':_0x3009d1[_0x1fcd('0x17')]},'limit':0x1,'include':[{'model':_0x514864['CmContact'],'as':'Contact','attributes':_[_0x1fcd('0x20')](_0xf3531f)}]}]});})[_0x1fcd('0x18')](function(_0x455940){_0x47d75c=_0x455940[_0x1fcd('0xf')]({'plain':!![]});if(_0x47d75c&&_0x47d75c[_0x1fcd('0x21')]){logger[_0x1fcd('0x22')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x1fcd('0x23')](_0x1fcd('0x24'),_0x3009d1['id'],_0x47d75c[_0x1fcd('0x21')]));if(_0x47d75c[_0x1fcd('0x25')]&&_0x47d75c['Interactions'][_0x1fcd('0x26')]){_0x3009d1[_0x1fcd('0x27')]=_[_0x1fcd('0x28')](_0x47d75c['Interactions'][0x0],_0x1fcd('0x29'));_0x3009d1[_0x1fcd('0x29')]=_0x47d75c[_0x1fcd('0x25')][0x0][_0x1fcd('0x29')];}var _0x3b939b={'method':'POST','uri':encodeURI(_0x47d75c[_0x1fcd('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3b939b[_0x1fcd('0x2a')]){case _0x1fcd('0x2b'):_0x3b939b['qs']=_0x3009d1;break;case'POST':_0x3b939b[_0x1fcd('0xc')]=_0x3009d1;break;}return rp(_0x3b939b)[_0x1fcd('0x18')](function(_0x370609){logger[_0x1fcd('0x22')](_0x1fcd('0x2c'),'afterCreate',util[_0x1fcd('0x23')](_0x1fcd('0x2d'),_0x3009d1['id'],_0x47d75c['replyUri']));if(_0x370609[_0x1fcd('0xc')]['threadId']&&_0x370609[_0x1fcd('0xc')][_0x1fcd('0x2e')]!=_0x3009d1[_0x1fcd('0x27')][_0x1fcd('0x2e')]){return _0x514864[_0x1fcd('0x1f')]['update']({'threadId':_0x370609['body'][_0x1fcd('0x2e')]},{'where':{'id':_0x3009d1[_0x1fcd('0x27')]['id']}});}else{return;}})['then'](function(){return _0x4243dd[_0x1fcd('0x2f')]({'read':!![]});})['catch'](function(_0x3796a0){logger[_0x1fcd('0x1b')](_0x1fcd('0x2c'),_0x1fcd('0x30'),util[_0x1fcd('0x31')](_0x3796a0,{'showHidden':![],'depth':null}));_0x4f741d();});}else{_0x4f741d();}})[_0x1fcd('0x32')](function(){_0x4f741d();});}else{_0x4f741d();}}},'charset':_0x1fcd('0x33'),'collate':_0x1fcd('0x34')});}; \ No newline at end of file +var _0x7f78=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','omit','Contact','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x3248f1,_0x390838){var _0x459460=function(_0x22d9e2){while(--_0x22d9e2){_0x3248f1['push'](_0x3248f1['shift']());}};_0x459460(++_0x390838);}(_0x7f78,0x9d));var _0x87f7=function(_0x59328b,_0x3e1186){_0x59328b=_0x59328b-0x0;var _0x2593ea=_0x7f78[_0x59328b];return _0x2593ea;};'use strict';var _=require('lodash');var util=require(_0x87f7('0x0'));var logger=require(_0x87f7('0x1'))(_0x87f7('0x2'));var moment=require(_0x87f7('0x3'));var BPromise=require('bluebird');var rp=require(_0x87f7('0x4'));var fs=require('fs');var path=require(_0x87f7('0x5'));var rimraf=require(_0x87f7('0x6'));var config=require(_0x87f7('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x87f7('0x8')]=function(_0x5d91a4,_0x2f85f9){return _0x5d91a4[_0x87f7('0x9')](_0x87f7('0xa'),attributes,{'tableName':_0x87f7('0xb'),'paranoid':![],'indexes':[{'name':_0x87f7('0xc'),'fields':[_0x87f7('0xd')],'type':_0x87f7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3412db,_0x556ebb,_0x503e6f){var _0x1f2a46=_0x5d91a4[_0x87f7('0xf')];var _0x56d508=_0x3412db[_0x87f7('0x10')]({'plain':!![]});if(_0x56d508['direction'][_0x87f7('0x11')]()==='in'||_0x56d508[_0x87f7('0x12')]['toLowerCase']()===_0x87f7('0x13')&&!_0x56d508[_0x87f7('0x14')]&&!_[_0x87f7('0x15')](_0x56d508['UserId'])){_0x1f2a46[_0x87f7('0x16')][_0x87f7('0x17')]({'where':{'id':_0x56d508['OpenchannelInteractionId']}})[_0x87f7('0x18')](function(_0x1500b0){if(_0x1500b0){_0x1500b0[_0x87f7('0x19')]({'lastMsgAt':_0x56d508[_0x87f7('0x1a')],'lastMsgDirection':_0x56d508[_0x87f7('0x12')]['toLowerCase']()});}})[_0x87f7('0x1b')](function(_0x1d77c8){console[_0x87f7('0x1c')](_0x1d77c8);});}if(_0x56d508[_0x87f7('0x12')]==='out'&&!_0x56d508[_0x87f7('0x14')]){var _0x6b87c1;_0x1f2a46[_0x87f7('0x1d')][_0x87f7('0x1e')]()[_0x87f7('0x18')](function(_0x41e60c){return _0x1f2a46[_0x87f7('0x1f')][_0x87f7('0x20')]({'where':{'id':_0x56d508[_0x87f7('0x21')]},'include':[{'model':_0x1f2a46['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x56d508[_0x87f7('0x22')]},'limit':0x1,'include':[{'model':_0x1f2a46[_0x87f7('0x1d')],'as':'Contact','attributes':_[_0x87f7('0x23')](_0x41e60c)}]}]});})[_0x87f7('0x18')](function(_0x25ed8d){_0x6b87c1=_0x25ed8d[_0x87f7('0x10')]({'plain':!![]});if(_0x6b87c1&&_0x6b87c1['replyUri']){logger[_0x87f7('0x24')](_0x87f7('0x25'),_0x87f7('0x26'),util[_0x87f7('0x27')](_0x87f7('0x28'),_0x56d508['id'],_0x6b87c1[_0x87f7('0x29')]));if(_0x6b87c1[_0x87f7('0x2a')]&&_0x6b87c1['Interactions'][_0x87f7('0x2b')]){_0x56d508['Interaction']=_[_0x87f7('0x2c')](_0x6b87c1[_0x87f7('0x2a')][0x0],_0x87f7('0x2d'));_0x56d508[_0x87f7('0x2d')]=_0x6b87c1['Interactions'][0x0][_0x87f7('0x2d')];}var _0x556ebb={'method':'POST','uri':encodeURI(_0x6b87c1[_0x87f7('0x29')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x556ebb['method']){case'GET':_0x556ebb['qs']=_0x56d508;break;case'POST':_0x556ebb[_0x87f7('0xd')]=_0x56d508;break;}return rp(_0x556ebb)[_0x87f7('0x18')](function(_0x1bb104){logger[_0x87f7('0x24')](_0x87f7('0x25'),_0x87f7('0x26'),util[_0x87f7('0x27')](_0x87f7('0x2e'),_0x56d508['id'],_0x6b87c1['replyUri']));if(_0x1bb104['body'][_0x87f7('0x2f')]&&_0x1bb104['body'][_0x87f7('0x2f')]!=_0x56d508[_0x87f7('0x30')]['threadId']){return _0x1f2a46[_0x87f7('0x16')]['update']({'threadId':_0x1bb104[_0x87f7('0xd')][_0x87f7('0x2f')]},{'where':{'id':_0x56d508['Interaction']['id']}});}else{return;}})[_0x87f7('0x18')](function(){return _0x3412db['update']({'read':!![]});})[_0x87f7('0x1b')](function(_0x4b1bca){logger['error'](_0x87f7('0x25'),_0x87f7('0x26'),util[_0x87f7('0x31')](_0x4b1bca,{'showHidden':![],'depth':null}));_0x503e6f();});}else{_0x503e6f();}})[_0x87f7('0x32')](function(){_0x503e6f();});}else{_0x503e6f();}}},'charset':_0x87f7('0x33'),'collate':_0x87f7('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 24e9cc2..6209904 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45cb57,_0x40230d){var _0x2f0aa1=function(_0x8df780){while(--_0x8df780){_0x45cb57['push'](_0x45cb57['shift']());}};_0x2f0aa1(++_0x40230d);}(_0x1261,0x144));var _0x1126=function(_0x95b616,_0x296372){_0x95b616=_0x95b616-0x0;var _0x596532=_0x1261[_0x95b616];return _0x596532;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x719a3f,_0x5430fa){var _0x2fcd2d=function(_0x56e6a3){while(--_0x56e6a3){_0x719a3f['push'](_0x719a3f['shift']());}};_0x2fcd2d(++_0x5430fa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x196c91,_0x45f8ad){_0x196c91=_0x196c91-0x0;var _0x5268d3=_0x5f2f[_0x196c91];return _0x5268d3;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1c04f1d..a4946ec 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 _0x08f5=['./openchannelMessage.events','save','removeListener','register','length'];(function(_0x190c8e,_0x12bede){var _0xfe6da0=function(_0x45b62a){while(--_0x45b62a){_0x190c8e['push'](_0x190c8e['shift']());}};_0xfe6da0(++_0x12bede);}(_0x08f5,0x172));var _0x508f=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0x08f5[_0x1a8ff0];return _0x3588bf;};'use strict';var OpenchannelMessageEvents=require(_0x508f('0x0'));var events=[_0x508f('0x1'),'remove','update'];function createListener(_0x31c465,_0x3a1204){return function(_0x56c652){_0x3a1204['emit'](_0x31c465,_0x56c652);};}function removeListener(_0x263833,_0x4e2dbf){return function(){OpenchannelMessageEvents[_0x508f('0x2')](_0x263833,_0x4e2dbf);};}exports[_0x508f('0x3')]=function(_0x485f59){for(var _0x45008f=0x0,_0xe9c8f5=events[_0x508f('0x4')];_0x45008f<_0xe9c8f5;_0x45008f++){var _0x1d73b2=events[_0x45008f];var _0x4d260a=createListener('openchannelMessage:'+_0x1d73b2,_0x485f59);OpenchannelMessageEvents['on'](_0x1d73b2,_0x4d260a);}}; \ No newline at end of file +var _0x2cc4=['emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0x58adea,_0x350ab7){var _0x4da5e0=function(_0x119eb8){while(--_0x119eb8){_0x58adea['push'](_0x58adea['shift']());}};_0x4da5e0(++_0x350ab7);}(_0x2cc4,0xdd));var _0x42cc=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x2cc4[_0x2fc012];return _0x2891f9;};'use strict';var OpenchannelMessageEvents=require(_0x42cc('0x0'));var events=[_0x42cc('0x1'),_0x42cc('0x2'),_0x42cc('0x3')];function createListener(_0x20942d,_0x5aae03){return function(_0xbe2261){_0x5aae03[_0x42cc('0x4')](_0x20942d,_0xbe2261);};}function removeListener(_0x48bf64,_0x310268){return function(){OpenchannelMessageEvents[_0x42cc('0x5')](_0x48bf64,_0x310268);};}exports[_0x42cc('0x6')]=function(_0x282927){for(var _0x1dd246=0x0,_0x4fc8d2=events[_0x42cc('0x7')];_0x1dd246<_0x4fc8d2;_0x1dd246++){var _0xd28d27=events[_0x1dd246];var _0x1342f8=createListener(_0x42cc('0x8')+_0xd28d27,_0x282927);OpenchannelMessageEvents['on'](_0xd28d27,_0x1342f8);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index d813c68..60410c3 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 _0xef89=['show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','/describe','isAuthenticated','/:id'];(function(_0x1ebf51,_0x2e0997){var _0x23a06a=function(_0x4ae73b){while(--_0x4ae73b){_0x1ebf51['push'](_0x1ebf51['shift']());}};_0x23a06a(++_0x2e0997);}(_0xef89,0x6a));var _0x9ef8=function(_0x4271f1,_0xdbdc80){_0x4271f1=_0x4271f1-0x0;var _0x1bc9c9=_0xef89[_0x4271f1];return _0x1bc9c9;};'use strict';var multer=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var path=require(_0x9ef8('0x2'));var timeout=require(_0x9ef8('0x3'));var express=require('express');var router=express[_0x9ef8('0x4')]();var fs_extra=require(_0x9ef8('0x5'));var auth=require(_0x9ef8('0x6'));var interaction=require(_0x9ef8('0x7'));var config=require(_0x9ef8('0x8'));var controller=require(_0x9ef8('0x9'));router[_0x9ef8('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9ef8('0xa')](_0x9ef8('0xb'),auth[_0x9ef8('0xc')](),controller['describe']);router[_0x9ef8('0xa')](_0x9ef8('0xd'),auth['isAuthenticated'](),controller[_0x9ef8('0xe')]);router[_0x9ef8('0xa')](_0x9ef8('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9ef8('0xa')](_0x9ef8('0x10'),auth['isAuthenticated'](),controller[_0x9ef8('0x11')]);router['get'](_0x9ef8('0x12'),auth[_0x9ef8('0xc')](),controller[_0x9ef8('0x13')]);router[_0x9ef8('0x14')]('/',auth['isAuthenticated'](),controller[_0x9ef8('0x15')]);router[_0x9ef8('0x14')](_0x9ef8('0x10'),auth[_0x9ef8('0xc')](),controller[_0x9ef8('0x16')]);router['post'](_0x9ef8('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x9ef8('0x17')](_0x9ef8('0xd'),auth[_0x9ef8('0xc')](),controller[_0x9ef8('0x18')]);router['delete'](_0x9ef8('0xd'),auth['isAuthenticated'](),controller[_0x9ef8('0x19')]);router[_0x9ef8('0x1a')](_0x9ef8('0x10'),auth[_0x9ef8('0xc')](),controller[_0x9ef8('0x1b')]);router['delete'](_0x9ef8('0x12'),auth[_0x9ef8('0xc')](),controller[_0x9ef8('0x1c')]);module[_0x9ef8('0x1d')]=router; \ No newline at end of file +var _0xe804=['addAgents','put','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users'];(function(_0x26ffa2,_0x260c3d){var _0x1b4835=function(_0x5626f6){while(--_0x5626f6){_0x26ffa2['push'](_0x26ffa2['shift']());}};_0x1b4835(++_0x260c3d);}(_0xe804,0x83));var _0x4e80=function(_0x2008e2,_0x19488b){_0x2008e2=_0x2008e2-0x0;var _0x5dfea7=_0xe804[_0x2008e2];return _0x5dfea7;};'use strict';var multer=require('multer');var util=require(_0x4e80('0x0'));var path=require(_0x4e80('0x1'));var timeout=require(_0x4e80('0x2'));var express=require(_0x4e80('0x3'));var router=express[_0x4e80('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4e80('0x5'));var interaction=require(_0x4e80('0x6'));var config=require(_0x4e80('0x7'));var controller=require(_0x4e80('0x8'));router[_0x4e80('0x9')]('/',auth[_0x4e80('0xa')](),controller['index']);router[_0x4e80('0x9')](_0x4e80('0xb'),auth[_0x4e80('0xa')](),controller[_0x4e80('0xc')]);router['get'](_0x4e80('0xd'),auth[_0x4e80('0xa')](),controller[_0x4e80('0xe')]);router[_0x4e80('0x9')](_0x4e80('0xf'),auth[_0x4e80('0xa')](),controller[_0x4e80('0x10')]);router[_0x4e80('0x9')](_0x4e80('0x11'),auth['isAuthenticated'](),controller[_0x4e80('0x12')]);router[_0x4e80('0x9')]('/:id/users',auth[_0x4e80('0xa')](),controller[_0x4e80('0x13')]);router[_0x4e80('0x14')]('/',auth[_0x4e80('0xa')](),controller[_0x4e80('0x15')]);router['post'](_0x4e80('0x11'),auth['isAuthenticated'](),controller[_0x4e80('0x16')]);router[_0x4e80('0x14')](_0x4e80('0x17'),auth['isAuthenticated'](),controller[_0x4e80('0x18')]);router[_0x4e80('0x19')](_0x4e80('0xd'),auth['isAuthenticated'](),controller[_0x4e80('0x1a')]);router[_0x4e80('0x1b')](_0x4e80('0xd'),auth[_0x4e80('0xa')](),controller[_0x4e80('0x1c')]);router['delete']('/:id/teams',auth[_0x4e80('0xa')](),controller[_0x4e80('0x1d')]);router[_0x4e80('0x1b')](_0x4e80('0x17'),auth[_0x4e80('0xa')](),controller['removeAgents']);module[_0x4e80('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index adf63bf..60e0752 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 _0xaa5d=['name','ENUM','sequelize','STRING'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xaa5d,0x6e));var _0xdaa5=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0xaa5d[_0x5b3b9b];return _0x47c1d7;};'use strict';var Sequelize=require(_0xdaa5('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaa5('0x1')],'unique':_0xdaa5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdaa5('0x3')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0x1db2=['STRING','name','INTEGER','rrmemory','beepall','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1db2,0x14e));var _0x21db=function(_0x1c4ffc,_0x2d7066){_0x1c4ffc=_0x1c4ffc-0x0;var _0x1e753e=_0x1db2[_0x1c4ffc];return _0x1e753e;};'use strict';var Sequelize=require(_0x21db('0x0'));module[_0x21db('0x1')]={'name':{'type':Sequelize[_0x21db('0x2')],'unique':_0x21db('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x21db('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x21db('0x5'),_0x21db('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index c8ffd5d..76f4d22 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 _0x3a79=['./openchannelQueue.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','OpenchannelQueues','UserProfileResource','destroy','then','error','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','pick','filter','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','ids','Agents','online','interface','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','TeamId','includes','union','compact','transaction','isEmpty','removeAgents','addAgents','omit','spread','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','util','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults'];(function(_0x4c6080,_0x31ba8c){var _0x4b86f9=function(_0x5db233){while(--_0x5db233){_0x4c6080['push'](_0x4c6080['shift']());}};_0x4b86f9(++_0x31ba8c);}(_0x3a79,0xe0));var _0x93a7=function(_0x216ced,_0x5ad19e){_0x216ced=_0x216ced-0x0;var _0x3fed2b=_0x3a79[_0x216ced];return _0x3fed2b;};'use strict';var BPromise=require('bluebird');var util=require(_0x93a7('0x0'));var _=require('lodash');var squel=require('squel');var Redis=require(_0x93a7('0x1'));var qs=require(_0x93a7('0x2'));var logger=require(_0x93a7('0x3'))(_0x93a7('0x4'));var config=require(_0x93a7('0x5'));var db=require('../../mysqldb')['db'];config[_0x93a7('0x6')]=_[_0x93a7('0x7')](config[_0x93a7('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x93a7('0x6')]));require(_0x93a7('0x8'))[_0x93a7('0x9')](socket);function respondWithStatusCode(_0x4726c5,_0x13ebe2){_0x13ebe2=_0x13ebe2||0xcc;return function(_0x5e6baa){if(_0x5e6baa){return _0x4726c5['sendStatus'](_0x13ebe2);}return _0x4726c5['status'](_0x13ebe2)[_0x93a7('0xa')]();};}function respondWithResult(_0x56115c,_0x4fb369){_0x4fb369=_0x4fb369||0xc8;return function(_0x41a9f2){if(_0x41a9f2){return _0x56115c[_0x93a7('0xb')](_0x4fb369)[_0x93a7('0xc')](_0x41a9f2);}};}function respondWithFilteredResult(_0x1a0422,_0x41c244){return function(_0x2a74f1){if(_0x2a74f1){var _0x892616=typeof _0x41c244[_0x93a7('0xd')]===_0x93a7('0xe')&&typeof _0x41c244[_0x93a7('0xf')]===_0x93a7('0xe');var _0x2b35c0=_0x2a74f1[_0x93a7('0x10')];var _0x44ad56=_0x892616?0x0:_0x41c244['offset'];var _0x12b6c0=_0x892616?_0x2a74f1[_0x93a7('0x10')]:_0x41c244[_0x93a7('0xd')]+_0x41c244['limit'];var _0x21e640;if(_0x12b6c0>=_0x2b35c0){_0x12b6c0=_0x2b35c0;_0x21e640=0xc8;}else{_0x21e640=0xce;}_0x1a0422[_0x93a7('0xb')](_0x21e640);return _0x1a0422[_0x93a7('0x11')](_0x93a7('0x12'),_0x44ad56+'-'+_0x12b6c0+'/'+_0x2b35c0)[_0x93a7('0xc')](_0x2a74f1);}return null;};}function saveUpdates(_0x77a106){return function(_0x13c3aa){if(_0x13c3aa){return _0x13c3aa['update'](_0x77a106)['then'](function(_0x1712e1){return _0x1712e1;});}return null;};}function removeEntity(_0x2222e2){return function(_0x2cec0e){if(_0x2cec0e){return _0x2cec0e['destroy']()['then'](function(){var _0x3de31e=_0x2cec0e['get']({'plain':!![]});var _0x2b35e0=_0x93a7('0x13');return db[_0x93a7('0x14')][_0x93a7('0x15')]({'where':{'type':_0x2b35e0,'resourceId':_0x3de31e['id']}})[_0x93a7('0x16')](function(){return _0x2cec0e;});})['then'](function(){_0x2222e2[_0x93a7('0xb')](0xcc)[_0x93a7('0xa')]();});}};}function handleEntityNotFound(_0x280841){return function(_0x49948c){if(!_0x49948c){_0x280841['sendStatus'](0x194);}return _0x49948c;};}function handleError(_0x50584c,_0x56a129){_0x56a129=_0x56a129||0x1f4;return function(_0x41e2ff){logger[_0x93a7('0x17')](_0x41e2ff[_0x93a7('0x18')]);if(_0x41e2ff[_0x93a7('0x19')]){delete _0x41e2ff[_0x93a7('0x19')];}_0x50584c[_0x93a7('0xb')](_0x56a129)[_0x93a7('0x1a')](_0x41e2ff);};}exports['index']=function(_0x490b81,_0x44dc34){var _0x2d389c={};var _0x362942={'count':0x0,'rows':[]};var _0x127fd8=_[_0x93a7('0x1b')](db[_0x93a7('0x1c')][_0x93a7('0x1d')],function(_0x45fbcf){return{'name':_0x45fbcf[_0x93a7('0x1e')],'type':_0x45fbcf[_0x93a7('0x1f')][_0x93a7('0x20')]};});_0x2d389c=qs[_0x93a7('0x21')](_0x127fd8,_0x490b81);var _0x51565f={'where':_0x2d389c[_0x93a7('0x22')]};return db[_0x93a7('0x1c')][_0x93a7('0x10')](_0x51565f)[_0x93a7('0x16')](function(_0x181f44){_0x362942[_0x93a7('0x10')]=_0x181f44;_0x2d389c[_0x93a7('0x23')]=qs[_0x93a7('0x23')](_0x490b81[_0x93a7('0x24')]);return db['OpenchannelQueue'][_0x93a7('0x25')](_0x2d389c);})[_0x93a7('0x16')](function(_0x3b0748){_0x362942[_0x93a7('0x26')]=_0x3b0748;return _0x362942;})[_0x93a7('0x16')](respondWithFilteredResult(_0x44dc34,_0x2d389c))[_0x93a7('0x27')](handleError(_0x44dc34,null));};exports['show']=function(_0xc68e82,_0x8075a1){var _0x2143fe={'raw':!![],'where':{'id':_0xc68e82[_0x93a7('0x28')]['id']}},_0x17ef83={};_0x17ef83[_0x93a7('0x29')]=_[_0x93a7('0x2a')](db[_0x93a7('0x1c')]['rawAttributes']);_0x17ef83[_0x93a7('0x24')]=_[_0x93a7('0x2a')](_0xc68e82[_0x93a7('0x24')]);_0x17ef83[_0x93a7('0x2b')]=_[_0x93a7('0x2c')](_0x17ef83['model'],_0x17ef83['query']);_0x2143fe[_0x93a7('0x2d')]=_[_0x93a7('0x2c')](_0x17ef83[_0x93a7('0x29')],qs[_0x93a7('0x2e')](_0xc68e82['query'][_0x93a7('0x2e')]));_0x2143fe[_0x93a7('0x2d')]=_0x2143fe[_0x93a7('0x2d')][_0x93a7('0x2f')]?_0x2143fe['attributes']:_0x17ef83['model'];if(_0xc68e82[_0x93a7('0x24')]['includeAll']){_0x2143fe[_0x93a7('0x23')]=[{'all':!![]}];}_0x2143fe=_[_0x93a7('0x30')]({},_0x2143fe,_0xc68e82[_0x93a7('0x31')]);return db[_0x93a7('0x1c')][_0x93a7('0x32')](_0x2143fe)[_0x93a7('0x16')](handleEntityNotFound(_0x8075a1,null))['then'](respondWithResult(_0x8075a1,null))['catch'](handleError(_0x8075a1,null));};exports['create']=function(_0x303942,_0x43e7bb){return db[_0x93a7('0x1c')][_0x93a7('0x33')](_0x303942[_0x93a7('0x34')],{})[_0x93a7('0x16')](function(_0x4a85a8){var _0x22f756=_0x303942[_0x93a7('0x35')][_0x93a7('0x36')]({'plain':!![]});if(!_0x22f756)throw new Error(_0x93a7('0x37'));if(_0x22f756['role']==='user'){var _0x124667=_0x4a85a8[_0x93a7('0x36')]({'plain':!![]});var _0x2a3e28=_0x93a7('0x13');return db[_0x93a7('0x38')][_0x93a7('0x32')]({'where':{'name':_0x2a3e28,'userProfileId':_0x22f756[_0x93a7('0x39')]},'raw':!![]})['then'](function(_0xfb0eba){if(_0xfb0eba&&_0xfb0eba[_0x93a7('0x3a')]===0x0){return db[_0x93a7('0x14')]['create']({'name':_0x124667[_0x93a7('0x19')],'resourceId':_0x124667['id'],'type':_0xfb0eba[_0x93a7('0x19')],'sectionId':_0xfb0eba['id']},{})[_0x93a7('0x16')](function(){return _0x4a85a8;});}else{return _0x4a85a8;}})[_0x93a7('0x27')](function(_0x3bd6f7){logger[_0x93a7('0x17')](_0x93a7('0x3b'),_0x3bd6f7);throw _0x3bd6f7;});}return _0x4a85a8;})['then'](respondWithResult(_0x43e7bb,0xc9))[_0x93a7('0x27')](handleError(_0x43e7bb,null));};exports[_0x93a7('0x3c')]=function(_0x4058b8,_0x4d5b34){if(_0x4058b8[_0x93a7('0x34')]['id']){delete _0x4058b8[_0x93a7('0x34')]['id'];}return db[_0x93a7('0x1c')][_0x93a7('0x32')]({'where':{'id':_0x4058b8[_0x93a7('0x28')]['id']}})[_0x93a7('0x16')](handleEntityNotFound(_0x4d5b34,null))['then'](saveUpdates(_0x4058b8[_0x93a7('0x34')],null))[_0x93a7('0x16')](respondWithResult(_0x4d5b34,null))[_0x93a7('0x27')](handleError(_0x4d5b34,null));};exports[_0x93a7('0x15')]=function(_0x270c44,_0x280d56){return db[_0x93a7('0x1c')][_0x93a7('0x32')]({'where':{'id':_0x270c44['params']['id']}})[_0x93a7('0x16')](handleEntityNotFound(_0x280d56,null))['then'](removeEntity(_0x280d56,null))[_0x93a7('0x27')](handleError(_0x280d56,null));};exports['describe']=function(_0x30b06d,_0x2fb05a){return db['OpenchannelQueue'][_0x93a7('0x3d')]()[_0x93a7('0x16')](respondWithResult(_0x2fb05a,null))['catch'](handleError(_0x2fb05a,null));};exports[_0x93a7('0x3e')]=function(_0x598986,_0x3d72f8){var _0x2bce23={'raw':!![],'where':{}},_0x1caf18={},_0x5a9c36;return db[_0x93a7('0x1c')][_0x93a7('0x3f')]({'where':{'id':_0x598986[_0x93a7('0x28')]['id']}})[_0x93a7('0x16')](handleEntityNotFound(_0x3d72f8,null))[_0x93a7('0x16')](function(_0x28a5ee){if(_0x28a5ee){_0x5a9c36=_0x28a5ee[_0x93a7('0x36')]({'plain':!![]});_0x1caf18['model']=_['keys'](db[_0x93a7('0x40')]['rawAttributes']);_0x1caf18['query']=_['keys'](_0x598986[_0x93a7('0x24')]);_0x1caf18[_0x93a7('0x2b')]=_[_0x93a7('0x2c')](_0x1caf18['model'],_0x1caf18[_0x93a7('0x24')]);_0x2bce23['attributes']=_['intersection'](_0x1caf18['model'],qs['fields'](_0x598986[_0x93a7('0x24')][_0x93a7('0x2e')]));_0x2bce23[_0x93a7('0x2d')]=_0x2bce23[_0x93a7('0x2d')][_0x93a7('0x2f')]?_0x2bce23['attributes']:_0x1caf18['model'];if(!_0x598986[_0x93a7('0x24')][_0x93a7('0x41')](_0x93a7('0x42'))){_0x2bce23[_0x93a7('0xf')]=qs[_0x93a7('0xf')](_0x598986[_0x93a7('0x24')][_0x93a7('0xf')]);_0x2bce23[_0x93a7('0xd')]=qs['offset'](_0x598986[_0x93a7('0x24')][_0x93a7('0xd')]);}_0x2bce23[_0x93a7('0x43')]=qs[_0x93a7('0x44')](_0x598986[_0x93a7('0x24')]['sort']);_0x2bce23[_0x93a7('0x22')]=qs['filters'](_[_0x93a7('0x45')](_0x598986[_0x93a7('0x24')],_0x1caf18[_0x93a7('0x2b')]));_0x2bce23['where']['OpenchannelQueueId']=_0x28a5ee['id'];if(_0x598986[_0x93a7('0x24')][_0x93a7('0x46')]){_0x2bce23['where']=_[_0x93a7('0x30')](_0x2bce23[_0x93a7('0x22')],{'$or':_[_0x93a7('0x1b')](_0x2bce23['attributes'],function(_0x1aaae6){var _0x249ab7={};_0x249ab7[_0x1aaae6]={'$like':'%'+_0x598986[_0x93a7('0x24')][_0x93a7('0x46')]+'%'};return _0x249ab7;})});}_0x2bce23=_[_0x93a7('0x30')]({},_0x2bce23,_0x598986[_0x93a7('0x31')]);return db[_0x93a7('0x40')][_0x93a7('0x25')](_0x2bce23);}})[_0x93a7('0x16')](function(_0x1b819e){if(_0x1b819e){return db[_0x93a7('0x47')][_0x93a7('0x48')]({'where':{'id':_[_0x93a7('0x1b')](_0x1b819e,_0x93a7('0x49')),'role':_0x93a7('0x4a')},'attributes':['id',_0x93a7('0x19'),_0x93a7('0x4b'),_0x93a7('0x4c'),_0x93a7('0x4d')]});}})[_0x93a7('0x16')](function(_0x3d3776){if(_0x3d3776){return{'count':_0x3d3776[_0x93a7('0x10')],'rows':_[_0x93a7('0x1b')](_0x3d3776[_0x93a7('0x26')],function(_0xc3c092){return{'membername':_0xc3c092['name'],'UserId':_0xc3c092['id'],'queue_name':_0x5a9c36[_0x93a7('0x19')],'OpenchannelQueueId':_0x5a9c36['id'],'interface':util[_0x93a7('0x4e')](_0x93a7('0x4f'),_0x93a7('0x50'),_0xc3c092[_0x93a7('0x19')]),'penalty':0x0,'paused':_0xc3c092[_0x93a7('0x4b')],'createdAt':_0xc3c092['createdAt'],'updatedAt':_0xc3c092[_0x93a7('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x93a7('0x16')](respondWithFilteredResult(_0x3d72f8,_0x2bce23))[_0x93a7('0x27')](handleError(_0x3d72f8,null));};exports['getTeams']=function(_0x43accc,_0x14dd8c){var _0x2ae023={};var _0x410f56={};var _0x322134;var _0x50baa4;return db['OpenchannelQueue'][_0x93a7('0x3f')]({'where':{'id':_0x43accc[_0x93a7('0x28')]['id']}})[_0x93a7('0x16')](handleEntityNotFound(_0x14dd8c,null))[_0x93a7('0x16')](function(_0x2e829b){if(_0x2e829b){_0x322134=_0x2e829b;_0x410f56['model']=_['keys'](db[_0x93a7('0x51')][_0x93a7('0x1d')]);_0x410f56['query']=_[_0x93a7('0x2a')](_0x43accc[_0x93a7('0x24')]);_0x410f56[_0x93a7('0x2b')]=_[_0x93a7('0x2c')](_0x410f56['model'],_0x410f56['query']);_0x2ae023[_0x93a7('0x2d')]=_['intersection'](_0x410f56[_0x93a7('0x29')],qs['fields'](_0x43accc[_0x93a7('0x24')][_0x93a7('0x2e')]));_0x2ae023[_0x93a7('0x2d')]=_0x2ae023[_0x93a7('0x2d')][_0x93a7('0x2f')]?_0x2ae023[_0x93a7('0x2d')]:_0x410f56['model'];_0x2ae023[_0x93a7('0x43')]=qs[_0x93a7('0x44')](_0x43accc[_0x93a7('0x24')][_0x93a7('0x44')]);_0x2ae023[_0x93a7('0x22')]=qs[_0x93a7('0x2b')](_[_0x93a7('0x45')](_0x43accc[_0x93a7('0x24')],_0x410f56[_0x93a7('0x2b')]));if(_0x43accc[_0x93a7('0x24')][_0x93a7('0x46')]){_0x2ae023['where']=_[_0x93a7('0x30')](_0x2ae023['where'],{'$or':_[_0x93a7('0x1b')](_0x2ae023[_0x93a7('0x2d')],function(_0x1c8767){var _0x541368={};_0x541368[_0x1c8767]={'$like':'%'+_0x43accc[_0x93a7('0x24')][_0x93a7('0x46')]+'%'};return _0x541368;})});}_0x2ae023=_[_0x93a7('0x30')]({},_0x2ae023,_0x43accc['options']);return _0x322134['getTeams'](_0x2ae023);}})['then'](function(_0x59291c){if(_0x59291c){_0x50baa4=_0x59291c[_0x93a7('0x2f')];if(!_0x43accc[_0x93a7('0x24')][_0x93a7('0x41')](_0x93a7('0x42'))){_0x2ae023[_0x93a7('0xf')]=qs['limit'](_0x43accc[_0x93a7('0x24')]['limit']);_0x2ae023[_0x93a7('0xd')]=qs[_0x93a7('0xd')](_0x43accc[_0x93a7('0x24')][_0x93a7('0xd')]);}return _0x322134[_0x93a7('0x52')](_0x2ae023);}})[_0x93a7('0x16')](function(_0x44e6f8){if(_0x44e6f8){return _0x44e6f8?{'count':_0x50baa4,'rows':_0x44e6f8}:null;}})[_0x93a7('0x16')](respondWithResult(_0x14dd8c,null))[_0x93a7('0x27')](handleError(_0x14dd8c,null));};exports['addTeams']=function(_0x16e178,_0x4d976d){var _0x463967=_0x16e178[_0x93a7('0x34')][_0x93a7('0x53')];return db[_0x93a7('0x51')][_0x93a7('0x25')]({'where':{'id':_0x463967},'attributes':['id'],'include':[{'model':db[_0x93a7('0x47')],'as':_0x93a7('0x54'),'attributes':['id',_0x93a7('0x19'),_0x93a7('0x55'),'voicePause',_0x93a7('0x56')],'raw':!![]}]})['then'](function(_0x1891a0){if(_0x1891a0){var _0x2e00f7=_['flatMap'](_0x1891a0,function(_0x44839f){var _0x2316f7=_0x44839f[_0x93a7('0x36')]({'plain':!![]});return _0x2316f7[_0x93a7('0x54')];});return db['OpenchannelQueue']['find']({'where':{'id':_0x16e178['params']['id']}})[_0x93a7('0x16')](function(_0xb31daa){return db['sequelize']['transaction'](function(_0x5a12f0){return _0xb31daa['addTeams'](_0x463967,{'transaction':_0x5a12f0})['then'](function(){return BPromise['each'](_0x2e00f7,function(_0x563a7b){return db['UserOpenchannelQueue'][_0x93a7('0x57')]({'where':{'UserId':_0x563a7b['id'],'OpenchannelQueueId':_0x16e178['params']['id']},'transaction':_0x5a12f0});});})[_0x93a7('0x16')](function(){_0x2e00f7[_0x93a7('0x58')](function(_0x5284c7){socket[_0x93a7('0x59')]('userOpenchannelQueue:save',{'UserId':_0x5284c7['id'],'OpenchannelQueueId':_0xb31daa['id']});});});});});}})[_0x93a7('0x16')](respondWithStatusCode(_0x4d976d,null))[_0x93a7('0x27')](handleError(_0x4d976d,null));};exports[_0x93a7('0x5a')]=function(_0x577a63,_0x222c80){return db[_0x93a7('0x51')]['findAll']({'where':{'id':_0x577a63['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x93a7('0x47')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x222c80,null))[_0x93a7('0x16')](function(_0x2b9a76){var _0x1bb7c2=_[_0x93a7('0x1b')](_0x2b9a76,'id');var _0x639bf7=[];var _0x30ba97=[];var _0x38699a=squel[_0x93a7('0x5b')]();_0x38699a['field'](_0x93a7('0x5c'))[_0x93a7('0x5d')](_0x93a7('0x5e'),'tq')['join'](_0x93a7('0x5f'),'ut',_0x93a7('0x60'))['where'](_0x93a7('0x61'),_0x577a63[_0x93a7('0x28')]['id']);for(var _0x2f0c28=0x0;_0x2f0c28<_0x2b9a76[_0x93a7('0x2f')];_0x2f0c28+=0x1){let _0x1e72e6=_0x2b9a76[_0x2f0c28];for(var _0x5edfda=0x0;_0x5edfda<_0x1e72e6[_0x93a7('0x54')][_0x93a7('0x2f')];_0x5edfda+=0x1){let _0x526249=_0x1e72e6[_0x93a7('0x54')][_0x5edfda];var _0x15075c=_0x38699a['clone']();_0x15075c[_0x93a7('0x22')](_0x93a7('0x62'),_0x526249['id']);_0x30ba97['push'](db[_0x93a7('0x63')][_0x93a7('0x24')](_0x15075c[_0x93a7('0x64')](),{'type':db[_0x93a7('0x63')][_0x93a7('0x65')]['SELECT']})['then'](function(_0x249516){if(_0x249516['length']===0x1){return _0x526249['id'];}else{var _0x24f93b=_['every'](_['map'](_0x249516,_0x93a7('0x66')),function(_0xe57b90){return _[_0x93a7('0x67')](_0x1bb7c2,_0xe57b90);});if(_0x24f93b){return _0x526249['id'];}}}));}}return BPromise['all'](_0x30ba97)[_0x93a7('0x16')](function(_0x4782e3){_0x639bf7=_(_0x639bf7)[_0x93a7('0x68')](_0x4782e3)[_0x93a7('0x69')]()['value']();return db[_0x93a7('0x1c')][_0x93a7('0x32')]({'where':{'id':_0x577a63[_0x93a7('0x28')]['id']}})[_0x93a7('0x16')](function(_0xaaeb4){return db['sequelize'][_0x93a7('0x6a')](function(_0x2b2222){return _0xaaeb4[_0x93a7('0x5a')](_0x577a63['query'][_0x93a7('0x53')],{'transaction':_0x2b2222})['then'](function(){if(!_[_0x93a7('0x6b')](_0x639bf7)){return _0xaaeb4[_0x93a7('0x6c')](_0x639bf7,{'transaction':_0x2b2222});}})[_0x93a7('0x16')](function(){_0x639bf7['forEach'](function(_0x4e0b4b){socket[_0x93a7('0x59')]('userOpenchannelQueue:remove',{'UserId':_0x4e0b4b,'OpenchannelQueueId':_0xaaeb4['id']});});});});});});})['then'](respondWithStatusCode(_0x222c80,null))[_0x93a7('0x27')](handleError(_0x222c80,null));};exports['addAgents']=function(_0x3a526a,_0x4c1ca9){return db['OpenchannelQueue'][_0x93a7('0x32')]({'where':{'id':_0x3a526a[_0x93a7('0x28')]['id']}})[_0x93a7('0x16')](handleEntityNotFound(_0x4c1ca9,null))[_0x93a7('0x16')](function(_0xf8c119){if(_0xf8c119){return _0xf8c119[_0x93a7('0x6d')](_0x3a526a[_0x93a7('0x34')][_0x93a7('0x53')],_[_0x93a7('0x6e')](_0x3a526a[_0x93a7('0x34')],[_0x93a7('0x53'),'id'])||{})[_0x93a7('0x6f')](function(_0x68d686){for(var _0xcc4b6e=0x0;_0xcc4b6e<_0x3a526a[_0x93a7('0x34')]['ids'][_0x93a7('0x2f')];_0xcc4b6e+=0x1){socket['emit'](_0x93a7('0x70'),{'UserId':Number(_0x3a526a[_0x93a7('0x34')]['ids'][_0xcc4b6e]),'OpenchannelQueueId':Number(_0x3a526a[_0x93a7('0x28')]['id'])});}return _0x68d686;});}})[_0x93a7('0x16')](respondWithResult(_0x4c1ca9,null))[_0x93a7('0x27')](handleError(_0x4c1ca9,null));};exports[_0x93a7('0x6c')]=function(_0x2fa5ba,_0x3337c6){return db[_0x93a7('0x1c')]['find']({'where':{'id':_0x2fa5ba['params']['id']}})[_0x93a7('0x16')](handleEntityNotFound(_0x3337c6,null))[_0x93a7('0x16')](function(_0x18c608){if(_0x18c608){return _0x18c608[_0x93a7('0x6c')](_0x2fa5ba[_0x93a7('0x24')]['ids'])[_0x93a7('0x16')](function(){if(_[_0x93a7('0x71')](_0x2fa5ba['query'][_0x93a7('0x53')])){for(var _0x39071f=0x0;_0x39071f<_0x2fa5ba['query'][_0x93a7('0x53')][_0x93a7('0x2f')];_0x39071f+=0x1){socket[_0x93a7('0x59')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2fa5ba['query'][_0x93a7('0x53')][_0x39071f]),'OpenchannelQueueId':Number(_0x2fa5ba[_0x93a7('0x28')]['id'])});}}else{socket[_0x93a7('0x59')](_0x93a7('0x72'),{'UserId':Number(_0x2fa5ba[_0x93a7('0x24')][_0x93a7('0x53')]),'OpenchannelQueueId':Number(_0x2fa5ba[_0x93a7('0x28')]['id'])});}});}})[_0x93a7('0x16')](respondWithStatusCode(_0x3337c6,null))[_0x93a7('0x27')](handleError(_0x3337c6,null));};exports[_0x93a7('0x73')]=function(_0x3d4241,_0x3dd75d){var _0xff62f5={};var _0xa71136={};var _0x20212a;var _0x374e79;return db['OpenchannelQueue'][_0x93a7('0x3f')]({'where':{'id':_0x3d4241[_0x93a7('0x28')]['id']}})[_0x93a7('0x16')](handleEntityNotFound(_0x3dd75d,null))[_0x93a7('0x16')](function(_0x34459f){if(_0x34459f){_0x20212a=_0x34459f;_0xa71136[_0x93a7('0x29')]=_[_0x93a7('0x2a')](db['User'][_0x93a7('0x1d')]);_0xa71136[_0x93a7('0x24')]=_[_0x93a7('0x2a')](_0x3d4241[_0x93a7('0x24')]);_0xa71136[_0x93a7('0x2b')]=_[_0x93a7('0x2c')](_0xa71136[_0x93a7('0x29')],_0xa71136[_0x93a7('0x24')]);_0xff62f5[_0x93a7('0x2d')]=_[_0x93a7('0x2c')](_0xa71136['model'],qs[_0x93a7('0x2e')](_0x3d4241[_0x93a7('0x24')][_0x93a7('0x2e')]));_0xff62f5[_0x93a7('0x2d')]=_0xff62f5[_0x93a7('0x2d')][_0x93a7('0x2f')]?_0xff62f5['attributes']:_0xa71136[_0x93a7('0x29')];_0xff62f5[_0x93a7('0x43')]=qs[_0x93a7('0x44')](_0x3d4241[_0x93a7('0x24')][_0x93a7('0x44')]);_0xff62f5[_0x93a7('0x22')]=qs[_0x93a7('0x2b')](_['pick'](_0x3d4241['query'],_0xa71136['filters']));if(_0x3d4241[_0x93a7('0x24')]['filter']){_0xff62f5[_0x93a7('0x22')]=_[_0x93a7('0x30')](_0xff62f5[_0x93a7('0x22')],{'$or':_['map'](_0xff62f5[_0x93a7('0x2d')],function(_0x210f4b){var _0x4e9384={};_0x4e9384[_0x210f4b]={'$like':'%'+_0x3d4241['query'][_0x93a7('0x46')]+'%'};return _0x4e9384;})});}_0xff62f5=_[_0x93a7('0x30')]({},_0xff62f5,_0x3d4241[_0x93a7('0x31')]);return _0x20212a[_0x93a7('0x73')](_0xff62f5);}})[_0x93a7('0x16')](function(_0x5cadd7){if(_0x5cadd7){_0x374e79=_0x5cadd7[_0x93a7('0x2f')];if(!_0x3d4241['query'][_0x93a7('0x41')](_0x93a7('0x42'))){_0xff62f5[_0x93a7('0xf')]=qs[_0x93a7('0xf')](_0x3d4241[_0x93a7('0x24')][_0x93a7('0xf')]);_0xff62f5[_0x93a7('0xd')]=qs[_0x93a7('0xd')](_0x3d4241['query'][_0x93a7('0xd')]);}return _0x20212a[_0x93a7('0x73')](_0xff62f5);}})['then'](function(_0x45c5d4){if(_0x45c5d4){return _0x45c5d4?{'count':_0x374e79,'rows':_0x45c5d4}:null;}})['then'](respondWithResult(_0x3dd75d,null))[_0x93a7('0x27')](handleError(_0x3dd75d,null));}; \ No newline at end of file +var _0xadad=['set','Content-Range','json','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','send','index','map','OpenchannelQueue','fieldName','type','key','getOptions','where','include','query','findAll','rows','params','model','keys','rawAttributes','filters','intersection','fields','attributes','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','order','sort','OpenchannelQueueId','filter','merge','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','getTeams','hasOwnProperty','limit','addTeams','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','ids','isEmpty','removeAgents','forEach','addAgents','spread','userOpenchannelQueue:save','userOpenchannelQueue:remove','pick','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','sendStatus','status','end','undefined','count','offset'];(function(_0x16848e,_0x8effbf){var _0x1c459c=function(_0xd926d1){while(--_0xd926d1){_0x16848e['push'](_0x16848e['shift']());}};_0x1c459c(++_0x8effbf);}(_0xadad,0xe7));var _0xdada=function(_0x2b012b,_0x463e28){_0x2b012b=_0x2b012b-0x0;var _0x32c4cf=_0xadad[_0x2b012b];return _0x32c4cf;};'use strict';var BPromise=require('bluebird');var util=require(_0xdada('0x0'));var _=require(_0xdada('0x1'));var squel=require(_0xdada('0x2'));var Redis=require(_0xdada('0x3'));var qs=require(_0xdada('0x4'));var logger=require(_0xdada('0x5'))(_0xdada('0x6'));var config=require(_0xdada('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xdada('0x8'),'port':0x18eb});var socket=require(_0xdada('0x9'))(new Redis(config[_0xdada('0xa')]));require(_0xdada('0xb'))[_0xdada('0xc')](socket);function respondWithStatusCode(_0xd3298b,_0x34fd84){_0x34fd84=_0x34fd84||0xcc;return function(_0x4da0a0){if(_0x4da0a0){return _0xd3298b[_0xdada('0xd')](_0x34fd84);}return _0xd3298b[_0xdada('0xe')](_0x34fd84)[_0xdada('0xf')]();};}function respondWithResult(_0x3e14ab,_0x4c8273){_0x4c8273=_0x4c8273||0xc8;return function(_0x364ccd){if(_0x364ccd){return _0x3e14ab['status'](_0x4c8273)['json'](_0x364ccd);}};}function respondWithFilteredResult(_0x1fbf8e,_0x40a2b0){return function(_0x477053){if(_0x477053){var _0x2e81a2=typeof _0x40a2b0['offset']===_0xdada('0x10')&&typeof _0x40a2b0['limit']===_0xdada('0x10');var _0x1e0993=_0x477053[_0xdada('0x11')];var _0x67e48d=_0x2e81a2?0x0:_0x40a2b0[_0xdada('0x12')];var _0x2645c9=_0x2e81a2?_0x477053[_0xdada('0x11')]:_0x40a2b0[_0xdada('0x12')]+_0x40a2b0['limit'];var _0x56036c;if(_0x2645c9>=_0x1e0993){_0x2645c9=_0x1e0993;_0x56036c=0xc8;}else{_0x56036c=0xce;}_0x1fbf8e[_0xdada('0xe')](_0x56036c);return _0x1fbf8e[_0xdada('0x13')](_0xdada('0x14'),_0x67e48d+'-'+_0x2645c9+'/'+_0x1e0993)[_0xdada('0x15')](_0x477053);}return null;};}function saveUpdates(_0x4c8226){return function(_0x349f5e){if(_0x349f5e){return _0x349f5e[_0xdada('0x16')](_0x4c8226)[_0xdada('0x17')](function(_0x15124f){return _0x15124f;});}return null;};}function removeEntity(_0x45f84d){return function(_0x360d8d){if(_0x360d8d){return _0x360d8d['destroy']()[_0xdada('0x17')](function(){var _0x5a48c6=_0x360d8d[_0xdada('0x18')]({'plain':!![]});var _0x21fa30=_0xdada('0x19');return db[_0xdada('0x1a')][_0xdada('0x1b')]({'where':{'type':_0x21fa30,'resourceId':_0x5a48c6['id']}})[_0xdada('0x17')](function(){return _0x360d8d;});})[_0xdada('0x17')](function(){_0x45f84d[_0xdada('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c3fa6){return function(_0x1bfb8d){if(!_0x1bfb8d){_0x5c3fa6[_0xdada('0xd')](0x194);}return _0x1bfb8d;};}function handleError(_0x1b58fc,_0x22fe7f){_0x22fe7f=_0x22fe7f||0x1f4;return function(_0x19cb54){logger[_0xdada('0x1c')](_0x19cb54[_0xdada('0x1d')]);if(_0x19cb54[_0xdada('0x1e')]){delete _0x19cb54['name'];}_0x1b58fc[_0xdada('0xe')](_0x22fe7f)[_0xdada('0x1f')](_0x19cb54);};}exports[_0xdada('0x20')]=function(_0x1d5c96,_0x1f3944){var _0x4e415c={};var _0x484893={'count':0x0,'rows':[]};var _0x1f4701=_[_0xdada('0x21')](db[_0xdada('0x22')]['rawAttributes'],function(_0x55d286){return{'name':_0x55d286[_0xdada('0x23')],'type':_0x55d286[_0xdada('0x24')][_0xdada('0x25')]};});_0x4e415c=qs[_0xdada('0x26')](_0x1f4701,_0x1d5c96);var _0x446d2e={'where':_0x4e415c[_0xdada('0x27')]};return db[_0xdada('0x22')][_0xdada('0x11')](_0x446d2e)[_0xdada('0x17')](function(_0x270fa5){_0x484893[_0xdada('0x11')]=_0x270fa5;_0x4e415c[_0xdada('0x28')]=qs[_0xdada('0x28')](_0x1d5c96[_0xdada('0x29')]);return db[_0xdada('0x22')][_0xdada('0x2a')](_0x4e415c);})[_0xdada('0x17')](function(_0x3e991f){_0x484893[_0xdada('0x2b')]=_0x3e991f;return _0x484893;})[_0xdada('0x17')](respondWithFilteredResult(_0x1f3944,_0x4e415c))['catch'](handleError(_0x1f3944,null));};exports['show']=function(_0x4e410b,_0x8e4991){var _0x5a7dd6={'raw':!![],'where':{'id':_0x4e410b[_0xdada('0x2c')]['id']}},_0x178c0e={};_0x178c0e[_0xdada('0x2d')]=_[_0xdada('0x2e')](db['OpenchannelQueue'][_0xdada('0x2f')]);_0x178c0e['query']=_[_0xdada('0x2e')](_0x4e410b[_0xdada('0x29')]);_0x178c0e[_0xdada('0x30')]=_[_0xdada('0x31')](_0x178c0e[_0xdada('0x2d')],_0x178c0e[_0xdada('0x29')]);_0x5a7dd6['attributes']=_[_0xdada('0x31')](_0x178c0e[_0xdada('0x2d')],qs[_0xdada('0x32')](_0x4e410b[_0xdada('0x29')]['fields']));_0x5a7dd6[_0xdada('0x33')]=_0x5a7dd6[_0xdada('0x33')][_0xdada('0x34')]?_0x5a7dd6[_0xdada('0x33')]:_0x178c0e['model'];if(_0x4e410b[_0xdada('0x29')][_0xdada('0x35')]){_0x5a7dd6['include']=[{'all':!![]}];}_0x5a7dd6=_['merge']({},_0x5a7dd6,_0x4e410b[_0xdada('0x36')]);return db['OpenchannelQueue'][_0xdada('0x37')](_0x5a7dd6)[_0xdada('0x17')](handleEntityNotFound(_0x8e4991,null))['then'](respondWithResult(_0x8e4991,null))['catch'](handleError(_0x8e4991,null));};exports[_0xdada('0x38')]=function(_0x2e64f3,_0x4fa1ba){return db[_0xdada('0x22')][_0xdada('0x38')](_0x2e64f3[_0xdada('0x39')],{})[_0xdada('0x17')](function(_0x5c1607){var _0x15841e=_0x2e64f3[_0xdada('0x3a')][_0xdada('0x18')]({'plain':!![]});if(!_0x15841e)throw new Error(_0xdada('0x3b'));if(_0x15841e[_0xdada('0x3c')]===_0xdada('0x3a')){var _0x317500=_0x5c1607['get']({'plain':!![]});var _0x1d6962=_0xdada('0x19');return db[_0xdada('0x3d')][_0xdada('0x37')]({'where':{'name':_0x1d6962,'userProfileId':_0x15841e[_0xdada('0x3e')]},'raw':!![]})[_0xdada('0x17')](function(_0x7212ed){if(_0x7212ed&&_0x7212ed['autoAssociation']===0x0){return db[_0xdada('0x1a')][_0xdada('0x38')]({'name':_0x317500[_0xdada('0x1e')],'resourceId':_0x317500['id'],'type':_0x7212ed[_0xdada('0x1e')],'sectionId':_0x7212ed['id']},{})[_0xdada('0x17')](function(){return _0x5c1607;});}else{return _0x5c1607;}})[_0xdada('0x3f')](function(_0x22685e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22685e);throw _0x22685e;});}return _0x5c1607;})[_0xdada('0x17')](respondWithResult(_0x4fa1ba,0xc9))[_0xdada('0x3f')](handleError(_0x4fa1ba,null));};exports[_0xdada('0x16')]=function(_0x3b8ad3,_0x2dc096){if(_0x3b8ad3[_0xdada('0x39')]['id']){delete _0x3b8ad3[_0xdada('0x39')]['id'];}return db[_0xdada('0x22')][_0xdada('0x37')]({'where':{'id':_0x3b8ad3[_0xdada('0x2c')]['id']}})[_0xdada('0x17')](handleEntityNotFound(_0x2dc096,null))[_0xdada('0x17')](saveUpdates(_0x3b8ad3[_0xdada('0x39')],null))[_0xdada('0x17')](respondWithResult(_0x2dc096,null))[_0xdada('0x3f')](handleError(_0x2dc096,null));};exports[_0xdada('0x1b')]=function(_0x3f1139,_0x5787c1){return db[_0xdada('0x22')][_0xdada('0x37')]({'where':{'id':_0x3f1139[_0xdada('0x2c')]['id']}})[_0xdada('0x17')](handleEntityNotFound(_0x5787c1,null))[_0xdada('0x17')](removeEntity(_0x5787c1,null))[_0xdada('0x3f')](handleError(_0x5787c1,null));};exports[_0xdada('0x40')]=function(_0x54325d,_0x49faf4){return db[_0xdada('0x22')][_0xdada('0x40')]()[_0xdada('0x17')](respondWithResult(_0x49faf4,null))['catch'](handleError(_0x49faf4,null));};exports[_0xdada('0x41')]=function(_0x40f9,_0xeefcd0){var _0x24c50f={'raw':!![],'where':{}},_0x5e6d22={},_0xb9d4b9;return db['OpenchannelQueue'][_0xdada('0x42')]({'where':{'id':_0x40f9[_0xdada('0x2c')]['id']}})['then'](handleEntityNotFound(_0xeefcd0,null))['then'](function(_0x258084){if(_0x258084){_0xb9d4b9=_0x258084[_0xdada('0x18')]({'plain':!![]});_0x5e6d22[_0xdada('0x2d')]=_[_0xdada('0x2e')](db[_0xdada('0x43')][_0xdada('0x2f')]);_0x5e6d22[_0xdada('0x29')]=_['keys'](_0x40f9[_0xdada('0x29')]);_0x5e6d22[_0xdada('0x30')]=_[_0xdada('0x31')](_0x5e6d22['model'],_0x5e6d22[_0xdada('0x29')]);_0x24c50f[_0xdada('0x33')]=_[_0xdada('0x31')](_0x5e6d22[_0xdada('0x2d')],qs['fields'](_0x40f9['query'][_0xdada('0x32')]));_0x24c50f[_0xdada('0x33')]=_0x24c50f[_0xdada('0x33')][_0xdada('0x34')]?_0x24c50f[_0xdada('0x33')]:_0x5e6d22[_0xdada('0x2d')];if(!_0x40f9['query']['hasOwnProperty'](_0xdada('0x44'))){_0x24c50f['limit']=qs['limit'](_0x40f9[_0xdada('0x29')]['limit']);_0x24c50f[_0xdada('0x12')]=qs[_0xdada('0x12')](_0x40f9[_0xdada('0x29')][_0xdada('0x12')]);}_0x24c50f[_0xdada('0x45')]=qs[_0xdada('0x46')](_0x40f9['query']['sort']);_0x24c50f[_0xdada('0x27')]=qs[_0xdada('0x30')](_['pick'](_0x40f9[_0xdada('0x29')],_0x5e6d22[_0xdada('0x30')]));_0x24c50f[_0xdada('0x27')][_0xdada('0x47')]=_0x258084['id'];if(_0x40f9[_0xdada('0x29')][_0xdada('0x48')]){_0x24c50f['where']=_[_0xdada('0x49')](_0x24c50f['where'],{'$or':_[_0xdada('0x21')](_0x24c50f[_0xdada('0x33')],function(_0x33ef56){var _0x5150e2={};_0x5150e2[_0x33ef56]={'$like':'%'+_0x40f9[_0xdada('0x29')]['filter']+'%'};return _0x5150e2;})});}_0x24c50f=_[_0xdada('0x49')]({},_0x24c50f,_0x40f9['options']);return db[_0xdada('0x43')][_0xdada('0x2a')](_0x24c50f);}})['then'](function(_0x24ef22){if(_0x24ef22){return db[_0xdada('0x4a')][_0xdada('0x4b')]({'where':{'id':_[_0xdada('0x21')](_0x24ef22,_0xdada('0x4c')),'role':_0xdada('0x4d')},'attributes':['id','name',_0xdada('0x4e'),'updatedAt',_0xdada('0x4f')]});}})[_0xdada('0x17')](function(_0x1eca50){if(_0x1eca50){return{'count':_0x1eca50['count'],'rows':_['map'](_0x1eca50[_0xdada('0x2b')],function(_0x3bda49){return{'membername':_0x3bda49[_0xdada('0x1e')],'UserId':_0x3bda49['id'],'queue_name':_0xb9d4b9['name'],'OpenchannelQueueId':_0xb9d4b9['id'],'interface':util[_0xdada('0x50')](_0xdada('0x51'),_0xdada('0x52'),_0x3bda49[_0xdada('0x1e')]),'penalty':0x0,'paused':_0x3bda49[_0xdada('0x4e')],'createdAt':_0x3bda49['createdAt'],'updatedAt':_0x3bda49['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xeefcd0,_0x24c50f))[_0xdada('0x3f')](handleError(_0xeefcd0,null));};exports[_0xdada('0x53')]=function(_0x5699a8,_0x2ae12f){var _0x38a9d2={};var _0x1ebe92={};var _0x359849;var _0x49e934;return db[_0xdada('0x22')][_0xdada('0x42')]({'where':{'id':_0x5699a8[_0xdada('0x2c')]['id']}})[_0xdada('0x17')](handleEntityNotFound(_0x2ae12f,null))[_0xdada('0x17')](function(_0x19ffb1){if(_0x19ffb1){_0x359849=_0x19ffb1;_0x1ebe92[_0xdada('0x2d')]=_[_0xdada('0x2e')](db['Team'][_0xdada('0x2f')]);_0x1ebe92[_0xdada('0x29')]=_[_0xdada('0x2e')](_0x5699a8[_0xdada('0x29')]);_0x1ebe92[_0xdada('0x30')]=_['intersection'](_0x1ebe92[_0xdada('0x2d')],_0x1ebe92[_0xdada('0x29')]);_0x38a9d2[_0xdada('0x33')]=_[_0xdada('0x31')](_0x1ebe92[_0xdada('0x2d')],qs[_0xdada('0x32')](_0x5699a8[_0xdada('0x29')][_0xdada('0x32')]));_0x38a9d2[_0xdada('0x33')]=_0x38a9d2[_0xdada('0x33')][_0xdada('0x34')]?_0x38a9d2['attributes']:_0x1ebe92['model'];_0x38a9d2[_0xdada('0x45')]=qs[_0xdada('0x46')](_0x5699a8[_0xdada('0x29')]['sort']);_0x38a9d2[_0xdada('0x27')]=qs['filters'](_['pick'](_0x5699a8[_0xdada('0x29')],_0x1ebe92[_0xdada('0x30')]));if(_0x5699a8[_0xdada('0x29')][_0xdada('0x48')]){_0x38a9d2[_0xdada('0x27')]=_[_0xdada('0x49')](_0x38a9d2[_0xdada('0x27')],{'$or':_[_0xdada('0x21')](_0x38a9d2[_0xdada('0x33')],function(_0x1db1c1){var _0x275d88={};_0x275d88[_0x1db1c1]={'$like':'%'+_0x5699a8[_0xdada('0x29')][_0xdada('0x48')]+'%'};return _0x275d88;})});}_0x38a9d2=_[_0xdada('0x49')]({},_0x38a9d2,_0x5699a8[_0xdada('0x36')]);return _0x359849[_0xdada('0x53')](_0x38a9d2);}})[_0xdada('0x17')](function(_0x1a981f){if(_0x1a981f){_0x49e934=_0x1a981f[_0xdada('0x34')];if(!_0x5699a8[_0xdada('0x29')][_0xdada('0x54')](_0xdada('0x44'))){_0x38a9d2[_0xdada('0x55')]=qs[_0xdada('0x55')](_0x5699a8[_0xdada('0x29')][_0xdada('0x55')]);_0x38a9d2[_0xdada('0x12')]=qs[_0xdada('0x12')](_0x5699a8['query'][_0xdada('0x12')]);}return _0x359849[_0xdada('0x53')](_0x38a9d2);}})[_0xdada('0x17')](function(_0x553435){if(_0x553435){return _0x553435?{'count':_0x49e934,'rows':_0x553435}:null;}})['then'](respondWithResult(_0x2ae12f,null))['catch'](handleError(_0x2ae12f,null));};exports[_0xdada('0x56')]=function(_0x34fbb1,_0x240404){var _0x4f95f7=_0x34fbb1['body']['ids'];return db[_0xdada('0x57')][_0xdada('0x2a')]({'where':{'id':_0x4f95f7},'attributes':['id'],'include':[{'model':db[_0xdada('0x4a')],'as':_0xdada('0x58'),'attributes':['id','name','online',_0xdada('0x59'),_0xdada('0x5a')],'raw':!![]}]})[_0xdada('0x17')](function(_0x291743){if(_0x291743){var _0x3ea3de=_[_0xdada('0x5b')](_0x291743,function(_0x3072c8){var _0x5128c3=_0x3072c8[_0xdada('0x18')]({'plain':!![]});return _0x5128c3['Agents'];});return db[_0xdada('0x22')][_0xdada('0x37')]({'where':{'id':_0x34fbb1[_0xdada('0x2c')]['id']}})[_0xdada('0x17')](function(_0x11313e){return db[_0xdada('0x5c')][_0xdada('0x5d')](function(_0x27ec3e){return _0x11313e['addTeams'](_0x4f95f7,{'transaction':_0x27ec3e})[_0xdada('0x17')](function(){return BPromise['each'](_0x3ea3de,function(_0x50a5e9){return db[_0xdada('0x43')][_0xdada('0x5e')]({'where':{'UserId':_0x50a5e9['id'],'OpenchannelQueueId':_0x34fbb1[_0xdada('0x2c')]['id']},'transaction':_0x27ec3e});});})[_0xdada('0x17')](function(){_0x3ea3de['forEach'](function(_0x5bbdea){socket[_0xdada('0x5f')]('userOpenchannelQueue:save',{'UserId':_0x5bbdea['id'],'OpenchannelQueueId':_0x11313e['id']});});});});});}})[_0xdada('0x17')](respondWithStatusCode(_0x240404,null))[_0xdada('0x3f')](handleError(_0x240404,null));};exports[_0xdada('0x60')]=function(_0x4e6d51,_0x2b6670){return db['Team'][_0xdada('0x2a')]({'where':{'id':_0x4e6d51[_0xdada('0x29')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdada('0x58'),'attributes':['id'],'raw':!![]}]})[_0xdada('0x17')](handleEntityNotFound(_0x2b6670,null))[_0xdada('0x17')](function(_0x13790b){var _0x599f39=_[_0xdada('0x21')](_0x13790b,'id');var _0x439f71=[];var _0x40a9ca=[];var _0x54db99=squel[_0xdada('0x61')]();_0x54db99[_0xdada('0x62')](_0xdada('0x63'))[_0xdada('0x64')](_0xdada('0x65'),'tq')[_0xdada('0x66')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xdada('0x67'),_0x4e6d51[_0xdada('0x2c')]['id']);for(var _0x4bc5a9=0x0;_0x4bc5a9<_0x13790b[_0xdada('0x34')];_0x4bc5a9+=0x1){let _0x25653c=_0x13790b[_0x4bc5a9];for(var _0x62c215=0x0;_0x62c215<_0x25653c[_0xdada('0x58')]['length'];_0x62c215+=0x1){let _0x4aa16c=_0x25653c[_0xdada('0x58')][_0x62c215];var _0x5e5f07=_0x54db99[_0xdada('0x68')]();_0x5e5f07[_0xdada('0x27')]('ut.UserId\x20=\x20?',_0x4aa16c['id']);_0x40a9ca[_0xdada('0x69')](db[_0xdada('0x5c')][_0xdada('0x29')](_0x5e5f07[_0xdada('0x6a')](),{'type':db[_0xdada('0x5c')][_0xdada('0x6b')][_0xdada('0x6c')]})[_0xdada('0x17')](function(_0x5c7458){if(_0x5c7458[_0xdada('0x34')]===0x1){return _0x4aa16c['id'];}else{var _0x4d5ada=_[_0xdada('0x6d')](_[_0xdada('0x21')](_0x5c7458,_0xdada('0x6e')),function(_0x38b9b6){return _[_0xdada('0x6f')](_0x599f39,_0x38b9b6);});if(_0x4d5ada){return _0x4aa16c['id'];}}}));}}return BPromise[_0xdada('0x70')](_0x40a9ca)['then'](function(_0x164e13){_0x439f71=_(_0x439f71)['union'](_0x164e13)[_0xdada('0x71')]()[_0xdada('0x72')]();return db[_0xdada('0x22')][_0xdada('0x37')]({'where':{'id':_0x4e6d51[_0xdada('0x2c')]['id']}})[_0xdada('0x17')](function(_0x381ea7){return db[_0xdada('0x5c')][_0xdada('0x5d')](function(_0x5d2fba){return _0x381ea7[_0xdada('0x60')](_0x4e6d51[_0xdada('0x29')][_0xdada('0x73')],{'transaction':_0x5d2fba})[_0xdada('0x17')](function(){if(!_[_0xdada('0x74')](_0x439f71)){return _0x381ea7[_0xdada('0x75')](_0x439f71,{'transaction':_0x5d2fba});}})[_0xdada('0x17')](function(){_0x439f71[_0xdada('0x76')](function(_0x44cbd4){socket[_0xdada('0x5f')]('userOpenchannelQueue:remove',{'UserId':_0x44cbd4,'OpenchannelQueueId':_0x381ea7['id']});});});});});});})[_0xdada('0x17')](respondWithStatusCode(_0x2b6670,null))['catch'](handleError(_0x2b6670,null));};exports[_0xdada('0x77')]=function(_0x27075e,_0x39e1ab){return db[_0xdada('0x22')][_0xdada('0x37')]({'where':{'id':_0x27075e[_0xdada('0x2c')]['id']}})['then'](handleEntityNotFound(_0x39e1ab,null))[_0xdada('0x17')](function(_0x30847c){if(_0x30847c){return _0x30847c['addAgents'](_0x27075e[_0xdada('0x39')][_0xdada('0x73')],_['omit'](_0x27075e[_0xdada('0x39')],[_0xdada('0x73'),'id'])||{})[_0xdada('0x78')](function(_0x4697a1){for(var _0x5d08a6=0x0;_0x5d08a6<_0x27075e[_0xdada('0x39')][_0xdada('0x73')]['length'];_0x5d08a6+=0x1){socket[_0xdada('0x5f')](_0xdada('0x79'),{'UserId':Number(_0x27075e[_0xdada('0x39')][_0xdada('0x73')][_0x5d08a6]),'OpenchannelQueueId':Number(_0x27075e[_0xdada('0x2c')]['id'])});}return _0x4697a1;});}})[_0xdada('0x17')](respondWithResult(_0x39e1ab,null))['catch'](handleError(_0x39e1ab,null));};exports['removeAgents']=function(_0x32f5ea,_0x147321){return db[_0xdada('0x22')]['find']({'where':{'id':_0x32f5ea['params']['id']}})[_0xdada('0x17')](handleEntityNotFound(_0x147321,null))['then'](function(_0x105b2e){if(_0x105b2e){return _0x105b2e[_0xdada('0x75')](_0x32f5ea[_0xdada('0x29')][_0xdada('0x73')])[_0xdada('0x17')](function(){if(_['isArray'](_0x32f5ea[_0xdada('0x29')][_0xdada('0x73')])){for(var _0x588e40=0x0;_0x588e40<_0x32f5ea['query'][_0xdada('0x73')][_0xdada('0x34')];_0x588e40+=0x1){socket[_0xdada('0x5f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x32f5ea['query']['ids'][_0x588e40]),'OpenchannelQueueId':Number(_0x32f5ea['params']['id'])});}}else{socket[_0xdada('0x5f')](_0xdada('0x7a'),{'UserId':Number(_0x32f5ea[_0xdada('0x29')][_0xdada('0x73')]),'OpenchannelQueueId':Number(_0x32f5ea['params']['id'])});}});}})['then'](respondWithStatusCode(_0x147321,null))[_0xdada('0x3f')](handleError(_0x147321,null));};exports['getAgents']=function(_0x70fae1,_0xad5cfa){var _0x4759b0={};var _0x231a9f={};var _0x56b54f;var _0x57a9b9;return db[_0xdada('0x22')][_0xdada('0x42')]({'where':{'id':_0x70fae1[_0xdada('0x2c')]['id']}})[_0xdada('0x17')](handleEntityNotFound(_0xad5cfa,null))[_0xdada('0x17')](function(_0x3c4527){if(_0x3c4527){_0x56b54f=_0x3c4527;_0x231a9f['model']=_[_0xdada('0x2e')](db['User']['rawAttributes']);_0x231a9f[_0xdada('0x29')]=_[_0xdada('0x2e')](_0x70fae1['query']);_0x231a9f[_0xdada('0x30')]=_[_0xdada('0x31')](_0x231a9f[_0xdada('0x2d')],_0x231a9f[_0xdada('0x29')]);_0x4759b0[_0xdada('0x33')]=_['intersection'](_0x231a9f['model'],qs[_0xdada('0x32')](_0x70fae1['query'][_0xdada('0x32')]));_0x4759b0[_0xdada('0x33')]=_0x4759b0[_0xdada('0x33')][_0xdada('0x34')]?_0x4759b0[_0xdada('0x33')]:_0x231a9f[_0xdada('0x2d')];_0x4759b0[_0xdada('0x45')]=qs[_0xdada('0x46')](_0x70fae1[_0xdada('0x29')][_0xdada('0x46')]);_0x4759b0[_0xdada('0x27')]=qs[_0xdada('0x30')](_[_0xdada('0x7b')](_0x70fae1[_0xdada('0x29')],_0x231a9f['filters']));if(_0x70fae1[_0xdada('0x29')][_0xdada('0x48')]){_0x4759b0['where']=_[_0xdada('0x49')](_0x4759b0['where'],{'$or':_[_0xdada('0x21')](_0x4759b0[_0xdada('0x33')],function(_0xfa7d8){var _0x361641={};_0x361641[_0xfa7d8]={'$like':'%'+_0x70fae1[_0xdada('0x29')][_0xdada('0x48')]+'%'};return _0x361641;})});}_0x4759b0=_[_0xdada('0x49')]({},_0x4759b0,_0x70fae1[_0xdada('0x36')]);return _0x56b54f[_0xdada('0x7c')](_0x4759b0);}})['then'](function(_0x29599d){if(_0x29599d){_0x57a9b9=_0x29599d[_0xdada('0x34')];if(!_0x70fae1[_0xdada('0x29')][_0xdada('0x54')]('nolimit')){_0x4759b0[_0xdada('0x55')]=qs[_0xdada('0x55')](_0x70fae1[_0xdada('0x29')][_0xdada('0x55')]);_0x4759b0[_0xdada('0x12')]=qs[_0xdada('0x12')](_0x70fae1[_0xdada('0x29')][_0xdada('0x12')]);}return _0x56b54f[_0xdada('0x7c')](_0x4759b0);}})['then'](function(_0x101a96){if(_0x101a96){return _0x101a96?{'count':_0x57a9b9,'rows':_0x101a96}:null;}})['then'](respondWithResult(_0xad5cfa,null))[_0xdada('0x3f')](handleError(_0xad5cfa,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1910781..d09be2b 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 _0x1445=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x815c23,_0x577e3a){var _0x357aa1=function(_0x289b7a){while(--_0x289b7a){_0x815c23['push'](_0x815c23['shift']());}};_0x357aa1(++_0x577e3a);}(_0x1445,0xa3));var _0x5144=function(_0x5a2e3e,_0x34dcf9){_0x5a2e3e=_0x5a2e3e-0x0;var _0x2c8a57=_0x1445[_0x5a2e3e];return _0x2c8a57;};'use strict';var EventEmitter=require(_0x5144('0x0'));var OpenchannelQueue=require(_0x5144('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5144('0x2')](0x0);var events={'afterCreate':_0x5144('0x3'),'afterUpdate':_0x5144('0x4'),'afterDestroy':_0x5144('0x5')};function emitEvent(_0x3fa388){return function(_0x57b220,_0x104eb7,_0x56202e){OpenchannelQueueEvents[_0x5144('0x6')](_0x3fa388+':'+_0x57b220['id'],_0x57b220);OpenchannelQueueEvents[_0x5144('0x6')](_0x3fa388,_0x57b220);_0x56202e(null);};}for(var e in events){if(events[_0x5144('0x7')](e)){var event=events[e];OpenchannelQueue[_0x5144('0x8')](e,emitEvent(event));}}module[_0x5144('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x7178=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x3cd775,_0x27015d){var _0x13fa3b=function(_0xf926fc){while(--_0xf926fc){_0x3cd775['push'](_0x3cd775['shift']());}};_0x13fa3b(++_0x27015d);}(_0x7178,0x92));var _0x8717=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7178[_0x5d6456];return _0x4d66c1;};'use strict';var EventEmitter=require(_0x8717('0x0'));var OpenchannelQueue=require(_0x8717('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8717('0x2')](0x0);var events={'afterCreate':_0x8717('0x3'),'afterUpdate':'update','afterDestroy':_0x8717('0x4')};function emitEvent(_0x244756){return function(_0x2c057e,_0x125837,_0x5de73a){OpenchannelQueueEvents['emit'](_0x244756+':'+_0x2c057e['id'],_0x2c057e);OpenchannelQueueEvents['emit'](_0x244756,_0x2c057e);_0x5de73a(null);};}for(var e in events){if(events[_0x8717('0x5')](e)){var event=events[e];OpenchannelQueue[_0x8717('0x6')](e,emitEvent(event));}}module[_0x8717('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 94fb9de..673a505 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 _0x956b=['../../config/logger','api','bluebird','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x49330c,_0x33369c){var _0x4f72b8=function(_0x3ac5f4){while(--_0x3ac5f4){_0x49330c['push'](_0x49330c['shift']());}};_0x4f72b8(++_0x33369c);}(_0x956b,0x99));var _0xb956=function(_0x1cd356,_0x5b32d4){_0x1cd356=_0x1cd356-0x0;var _0x3c8235=_0x956b[_0x1cd356];return _0x3c8235;};'use strict';var _=require(_0xb956('0x0'));var util=require('util');var logger=require(_0xb956('0x1'))(_0xb956('0x2'));var moment=require('moment');var BPromise=require(_0xb956('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb956('0x4'));var rimraf=require(_0xb956('0x5'));var config=require('../../config/environment');var attributes=require(_0xb956('0x6'));module[_0xb956('0x7')]=function(_0x4ff54a,_0x182fbc){return _0x4ff54a[_0xb956('0x8')](_0xb956('0x9'),attributes,{'tableName':_0xb956('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0f1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','lodash','util','../../config/logger'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0xf0f1,0xcd));var _0x1f0f=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0xf0f1[_0x5179a5];return _0x15c8ce;};'use strict';var _=require(_0x1f0f('0x0'));var util=require(_0x1f0f('0x1'));var logger=require(_0x1f0f('0x2'))(_0x1f0f('0x3'));var moment=require(_0x1f0f('0x4'));var BPromise=require(_0x1f0f('0x5'));var rp=require(_0x1f0f('0x6'));var fs=require('fs');var path=require(_0x1f0f('0x7'));var rimraf=require(_0x1f0f('0x8'));var config=require(_0x1f0f('0x9'));var attributes=require(_0x1f0f('0xa'));module[_0x1f0f('0xb')]=function(_0x11a3a1,_0x57af20){return _0x11a3a1['define'](_0x1f0f('0xc'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 56f45dd..65f61aa 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 _0xa85a=['raw','where','limit','include','map','model','attributes','ShowOpenchannelQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueue,\x20%s,\x20%s','GetOpenchannelQueue','OpenchannelQueue','findAll','options'];(function(_0x54ea43,_0xaec904){var _0x1ecfaa=function(_0x45e574){while(--_0x45e574){_0x54ea43['push'](_0x54ea43['shift']());}};_0x1ecfaa(++_0xaec904);}(_0xa85a,0x104));var _0xaa85=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xa85a[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xaa85('0x0'));var util=require(_0xaa85('0x1'));var moment=require(_0xaa85('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa85('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa85('0x4'))['db'];var utils=require(_0xaa85('0x5'));var logger=require(_0xaa85('0x6'))(_0xaa85('0x7'));var config=require(_0xaa85('0x8'));var jayson=require(_0xaa85('0x9'));var client=jayson[_0xaa85('0xa')][_0xaa85('0xb')]({'port':0x232a});config['redis']=_[_0xaa85('0xc')](config[_0xaa85('0xd')],{'host':_0xaa85('0xe'),'port':0x18eb});var socket=require(_0xaa85('0xf'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xaa85('0x10')](socket);function respondWithRpcPromise(_0x10417b,_0x930f66,_0x5b49a0){return new BPromise(function(_0x319322,_0x46d71c){return client[_0xaa85('0x11')](_0x10417b,_0x5b49a0)[_0xaa85('0x12')](function(_0x56df24){logger[_0xaa85('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x930f66,_0xaa85('0x14'));logger[_0xaa85('0x15')](_0xaa85('0x16'),_0x930f66,'request\x20sent',JSON[_0xaa85('0x17')](_0x56df24));if(_0x56df24['error']){if(_0x56df24[_0xaa85('0x18')][_0xaa85('0x19')]===0x1f4){logger[_0xaa85('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x930f66,_0x56df24[_0xaa85('0x18')][_0xaa85('0x1a')]);return _0x46d71c(_0x56df24[_0xaa85('0x18')][_0xaa85('0x1a')]);}logger[_0xaa85('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x930f66,_0x56df24[_0xaa85('0x18')]['message']);return _0x319322(_0x56df24[_0xaa85('0x18')]['message']);}else{logger[_0xaa85('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x930f66,_0xaa85('0x14'));_0x319322(_0x56df24[_0xaa85('0x1b')][_0xaa85('0x1a')]);}})[_0xaa85('0x1c')](function(_0x295146){logger['error'](_0xaa85('0x1d'),_0x930f66,_0x295146);_0x46d71c(_0x295146);});});}exports[_0xaa85('0x1e')]=function(_0x43b976){var _0x1bd5e1=this;return new Promise(function(_0x2f88e4,_0x57b338){return db[_0xaa85('0x1f')][_0xaa85('0x20')]({'raw':_0x43b976['options']?_0x43b976[_0xaa85('0x21')][_0xaa85('0x22')]===undefined?!![]:![]:!![],'where':_0x43b976[_0xaa85('0x21')]?_0x43b976[_0xaa85('0x21')][_0xaa85('0x23')]||null:null,'attributes':_0x43b976[_0xaa85('0x21')]?_0x43b976[_0xaa85('0x21')]['attributes']||null:null,'limit':_0x43b976[_0xaa85('0x21')]?_0x43b976[_0xaa85('0x21')][_0xaa85('0x24')]||null:null,'include':_0x43b976[_0xaa85('0x21')]?_0x43b976[_0xaa85('0x21')][_0xaa85('0x25')]?_[_0xaa85('0x26')](_0x43b976[_0xaa85('0x21')]['include'],function(_0x5f5519){return{'model':db[_0x5f5519[_0xaa85('0x27')]],'as':_0x5f5519['as'],'attributes':_0x5f5519[_0xaa85('0x28')],'include':_0x5f5519['include']?_[_0xaa85('0x26')](_0x5f5519[_0xaa85('0x25')],function(_0x30ab90){return{'model':db[_0x30ab90[_0xaa85('0x27')]],'as':_0x30ab90['as'],'attributes':_0x30ab90['attributes'],'include':_0x30ab90[_0xaa85('0x25')]?_[_0xaa85('0x26')](_0x30ab90['include'],function(_0x5645a0){return{'model':db[_0x5645a0[_0xaa85('0x27')]],'as':_0x5645a0['as'],'attributes':_0x5645a0[_0xaa85('0x28')]};}):[]};}):[]};}):[]:[]})[_0xaa85('0x12')](function(_0x2d3937){logger['info']('GetOpenchannelQueue',_0x43b976);logger[_0xaa85('0x15')](_0xaa85('0x1e'),_0x43b976,JSON['stringify'](_0x2d3937));_0x2f88e4(_0x2d3937);})[_0xaa85('0x1c')](function(_0x5cee0a){logger['error'](_0xaa85('0x1e'),_0x5cee0a[_0xaa85('0x1a')],_0x43b976);_0x57b338(_0x1bd5e1[_0xaa85('0x18')](0x1f4,_0x5cee0a[_0xaa85('0x1a')]));});});};exports[_0xaa85('0x29')]=function(_0x2ef7ba){var _0x1514be=this;return new Promise(function(_0x5a618d,_0x1a399d){return db[_0xaa85('0x1f')]['find']({'raw':_0x2ef7ba[_0xaa85('0x21')]?_0x2ef7ba['options'][_0xaa85('0x22')]===undefined?!![]:![]:!![],'where':_0x2ef7ba['options']?_0x2ef7ba['options'][_0xaa85('0x23')]||null:null,'attributes':_0x2ef7ba[_0xaa85('0x21')]?_0x2ef7ba['options']['attributes']||null:null,'include':_0x2ef7ba[_0xaa85('0x21')]?_0x2ef7ba[_0xaa85('0x21')]['include']?_[_0xaa85('0x26')](_0x2ef7ba['options'][_0xaa85('0x25')],function(_0x2da278){return{'model':db[_0x2da278[_0xaa85('0x27')]],'as':_0x2da278['as'],'attributes':_0x2da278['attributes'],'include':_0x2da278[_0xaa85('0x25')]?_[_0xaa85('0x26')](_0x2da278[_0xaa85('0x25')],function(_0x2371ec){return{'model':db[_0x2371ec[_0xaa85('0x27')]],'as':_0x2371ec['as'],'attributes':_0x2371ec[_0xaa85('0x28')],'include':_0x2371ec['include']?_[_0xaa85('0x26')](_0x2371ec[_0xaa85('0x25')],function(_0x21e4a5){return{'model':db[_0x21e4a5[_0xaa85('0x27')]],'as':_0x21e4a5['as'],'attributes':_0x21e4a5[_0xaa85('0x28')]};}):[]};}):[]};}):[]:[]})[_0xaa85('0x12')](function(_0x1009a8){logger['info'](_0xaa85('0x29'),_0x2ef7ba);logger[_0xaa85('0x15')](_0xaa85('0x29'),_0x2ef7ba,JSON[_0xaa85('0x17')](_0x1009a8));_0x5a618d(_0x1009a8);})[_0xaa85('0x1c')](function(_0x54bc3d){logger[_0xaa85('0x18')]('ShowOpenchannelQueue',_0x54bc3d['message'],_0x2ef7ba);_0x1a399d(_0x1514be['error'](0x1f4,_0x54bc3d[_0xaa85('0x1a')]));});});}; \ No newline at end of file +var _0x4433=['where','attributes','limit','map','include','model','catch','ShowOpenchannelQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetOpenchannelQueue','OpenchannelQueue','options','raw'];(function(_0x16b764,_0x2cc144){var _0x3d79d0=function(_0x2ec5b1){while(--_0x2ec5b1){_0x16b764['push'](_0x16b764['shift']());}};_0x3d79d0(++_0x2cc144);}(_0x4433,0x138));var _0x3443=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4433[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3443('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3443('0x1'));var rs=require(_0x3443('0x2'));var fs=require('fs');var Redis=require(_0x3443('0x3'));var db=require(_0x3443('0x4'))['db'];var utils=require(_0x3443('0x5'));var logger=require(_0x3443('0x6'))(_0x3443('0x7'));var config=require(_0x3443('0x8'));var jayson=require(_0x3443('0x9'));var client=jayson[_0x3443('0xa')]['http']({'port':0x232a});config[_0x3443('0xb')]=_[_0x3443('0xc')](config[_0x3443('0xb')],{'host':_0x3443('0xd'),'port':0x18eb});var socket=require(_0x3443('0xe'))(new Redis(config[_0x3443('0xb')]));require('./openchannelQueue.socket')[_0x3443('0xf')](socket);function respondWithRpcPromise(_0x37cacd,_0x3c73e1,_0x24218e){return new BPromise(function(_0x1e3acc,_0x370dc0){return client['request'](_0x37cacd,_0x24218e)[_0x3443('0x10')](function(_0x20c077){logger[_0x3443('0x11')](_0x3443('0x12'),_0x3c73e1,_0x3443('0x13'));logger[_0x3443('0x14')](_0x3443('0x15'),_0x3c73e1,_0x3443('0x13'),JSON[_0x3443('0x16')](_0x20c077));if(_0x20c077[_0x3443('0x17')]){if(_0x20c077[_0x3443('0x17')]['code']===0x1f4){logger[_0x3443('0x17')](_0x3443('0x12'),_0x3c73e1,_0x20c077[_0x3443('0x17')][_0x3443('0x18')]);return _0x370dc0(_0x20c077[_0x3443('0x17')][_0x3443('0x18')]);}logger['error'](_0x3443('0x12'),_0x3c73e1,_0x20c077[_0x3443('0x17')][_0x3443('0x18')]);return _0x1e3acc(_0x20c077['error'][_0x3443('0x18')]);}else{logger[_0x3443('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x3c73e1,_0x3443('0x13'));_0x1e3acc(_0x20c077[_0x3443('0x19')][_0x3443('0x18')]);}})['catch'](function(_0xfefadf){logger[_0x3443('0x17')](_0x3443('0x12'),_0x3c73e1,_0xfefadf);_0x370dc0(_0xfefadf);});});}exports[_0x3443('0x1a')]=function(_0x45e256){var _0x103941=this;return new Promise(function(_0x96f4f6,_0x357939){return db[_0x3443('0x1b')]['findAll']({'raw':_0x45e256[_0x3443('0x1c')]?_0x45e256[_0x3443('0x1c')][_0x3443('0x1d')]===undefined?!![]:![]:!![],'where':_0x45e256['options']?_0x45e256[_0x3443('0x1c')][_0x3443('0x1e')]||null:null,'attributes':_0x45e256[_0x3443('0x1c')]?_0x45e256[_0x3443('0x1c')][_0x3443('0x1f')]||null:null,'limit':_0x45e256['options']?_0x45e256[_0x3443('0x1c')][_0x3443('0x20')]||null:null,'include':_0x45e256[_0x3443('0x1c')]?_0x45e256[_0x3443('0x1c')]['include']?_[_0x3443('0x21')](_0x45e256[_0x3443('0x1c')]['include'],function(_0x28eaf0){return{'model':db[_0x28eaf0['model']],'as':_0x28eaf0['as'],'attributes':_0x28eaf0[_0x3443('0x1f')],'include':_0x28eaf0['include']?_[_0x3443('0x21')](_0x28eaf0['include'],function(_0x3b068d){return{'model':db[_0x3b068d['model']],'as':_0x3b068d['as'],'attributes':_0x3b068d[_0x3443('0x1f')],'include':_0x3b068d['include']?_[_0x3443('0x21')](_0x3b068d[_0x3443('0x22')],function(_0x2908b1){return{'model':db[_0x2908b1[_0x3443('0x23')]],'as':_0x2908b1['as'],'attributes':_0x2908b1[_0x3443('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cd1d7){logger[_0x3443('0x11')]('GetOpenchannelQueue',_0x45e256);logger[_0x3443('0x14')](_0x3443('0x1a'),_0x45e256,JSON[_0x3443('0x16')](_0x3cd1d7));_0x96f4f6(_0x3cd1d7);})[_0x3443('0x24')](function(_0x35ef50){logger['error'](_0x3443('0x1a'),_0x35ef50[_0x3443('0x18')],_0x45e256);_0x357939(_0x103941[_0x3443('0x17')](0x1f4,_0x35ef50['message']));});});};exports[_0x3443('0x25')]=function(_0x2f47c0){var _0x16beb7=this;return new Promise(function(_0x27468a,_0x1c0ed9){return db[_0x3443('0x1b')]['find']({'raw':_0x2f47c0[_0x3443('0x1c')]?_0x2f47c0['options'][_0x3443('0x1d')]===undefined?!![]:![]:!![],'where':_0x2f47c0[_0x3443('0x1c')]?_0x2f47c0[_0x3443('0x1c')][_0x3443('0x1e')]||null:null,'attributes':_0x2f47c0['options']?_0x2f47c0['options'][_0x3443('0x1f')]||null:null,'include':_0x2f47c0[_0x3443('0x1c')]?_0x2f47c0[_0x3443('0x1c')][_0x3443('0x22')]?_[_0x3443('0x21')](_0x2f47c0[_0x3443('0x1c')]['include'],function(_0x36ffbe){return{'model':db[_0x36ffbe['model']],'as':_0x36ffbe['as'],'attributes':_0x36ffbe[_0x3443('0x1f')],'include':_0x36ffbe[_0x3443('0x22')]?_['map'](_0x36ffbe[_0x3443('0x22')],function(_0x31aa8b){return{'model':db[_0x31aa8b[_0x3443('0x23')]],'as':_0x31aa8b['as'],'attributes':_0x31aa8b['attributes'],'include':_0x31aa8b['include']?_[_0x3443('0x21')](_0x31aa8b[_0x3443('0x22')],function(_0x2c87c9){return{'model':db[_0x2c87c9[_0x3443('0x23')]],'as':_0x2c87c9['as'],'attributes':_0x2c87c9[_0x3443('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5352e4){logger['info'](_0x3443('0x25'),_0x2f47c0);logger['debug'](_0x3443('0x25'),_0x2f47c0,JSON[_0x3443('0x16')](_0x5352e4));_0x27468a(_0x5352e4);})[_0x3443('0x24')](function(_0x46235f){logger[_0x3443('0x17')]('ShowOpenchannelQueue',_0x46235f[_0x3443('0x18')],_0x2f47c0);_0x1c0ed9(_0x16beb7['error'](0x1f4,_0x46235f[_0x3443('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 83ca355..37d034a 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 _0xe235=['emit','register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update'];(function(_0x2f53c7,_0x121298){var _0x5ee2c3=function(_0x1c88b3){while(--_0x1c88b3){_0x2f53c7['push'](_0x2f53c7['shift']());}};_0x5ee2c3(++_0x121298);}(_0xe235,0xe4));var _0x5e23=function(_0x47db33,_0x55110f){_0x47db33=_0x47db33-0x0;var _0x333cef=_0xe235[_0x47db33];return _0x333cef;};'use strict';var OpenchannelQueueEvents=require(_0x5e23('0x0'));var events=[_0x5e23('0x1'),_0x5e23('0x2'),_0x5e23('0x3')];function createListener(_0x49fc1b,_0x57e9e8){return function(_0x31faa4){_0x57e9e8[_0x5e23('0x4')](_0x49fc1b,_0x31faa4);};}function removeListener(_0x14eee2,_0x5ba17a){return function(){OpenchannelQueueEvents['removeListener'](_0x14eee2,_0x5ba17a);};}exports[_0x5e23('0x5')]=function(_0x37c8a7){for(var _0x1b49b2=0x0,_0x1c9b2b=events[_0x5e23('0x6')];_0x1b49b2<_0x1c9b2b;_0x1b49b2++){var _0xd7f262=events[_0x1b49b2];var _0x1f0008=createListener(_0x5e23('0x7')+_0xd7f262,_0x37c8a7);OpenchannelQueueEvents['on'](_0xd7f262,_0x1f0008);}}; \ No newline at end of file +var _0xe363=['remove','update','emit','removeListener','register','length','openchannelQueue:','save'];(function(_0x3df9eb,_0x5f3272){var _0x197bbc=function(_0x426092){while(--_0x426092){_0x3df9eb['push'](_0x3df9eb['shift']());}};_0x197bbc(++_0x5f3272);}(_0xe363,0x19f));var _0x3e36=function(_0x9689d2,_0x5ed3f8){_0x9689d2=_0x9689d2-0x0;var _0x2f8609=_0xe363[_0x9689d2];return _0x2f8609;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x3e36('0x0'),_0x3e36('0x1'),_0x3e36('0x2')];function createListener(_0xe9d5ab,_0x327928){return function(_0x2b6bcd){_0x327928[_0x3e36('0x3')](_0xe9d5ab,_0x2b6bcd);};}function removeListener(_0x3b29ad,_0x2780b6){return function(){OpenchannelQueueEvents[_0x3e36('0x4')](_0x3b29ad,_0x2780b6);};}exports[_0x3e36('0x5')]=function(_0x17359d){for(var _0x3e7ded=0x0,_0x4d1a8a=events[_0x3e36('0x6')];_0x3e7ded<_0x4d1a8a;_0x3e7ded++){var _0x4e554c=events[_0x3e7ded];var _0x2d66e2=createListener(_0x3e36('0x7')+_0x4e554c,_0x17359d);OpenchannelQueueEvents['on'](_0x4e554c,_0x2d66e2);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 5ad77ed..ca8d736 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 _0x0318=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put'];(function(_0x55c344,_0x1ab810){var _0x301c07=function(_0x40099a){while(--_0x40099a){_0x55c344['push'](_0x55c344['shift']());}};_0x301c07(++_0x1ab810);}(_0x0318,0xe0));var _0x8031=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0318[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x8031('0x0'));var path=require(_0x8031('0x1'));var timeout=require(_0x8031('0x2'));var express=require(_0x8031('0x3'));var router=express[_0x8031('0x4')]();var fs_extra=require(_0x8031('0x5'));var auth=require(_0x8031('0x6'));var interaction=require(_0x8031('0x7'));var config=require(_0x8031('0x8'));var controller=require(_0x8031('0x9'));router[_0x8031('0xa')]('/',auth[_0x8031('0xb')](),controller['index']);router['get'](_0x8031('0xc'),auth[_0x8031('0xb')](),controller[_0x8031('0xd')]);router['get'](_0x8031('0xe'),auth[_0x8031('0xb')](),controller['show']);router[_0x8031('0xf')]('/',auth[_0x8031('0xb')](),controller[_0x8031('0x10')]);router[_0x8031('0x11')](_0x8031('0xe'),auth[_0x8031('0xb')](),controller[_0x8031('0x12')]);router[_0x8031('0x13')]('/:id',auth[_0x8031('0xb')](),controller[_0x8031('0x14')]);module[_0x8031('0x15')]=router; \ No newline at end of file +var _0xfb8c=['destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','isAuthenticated','describe','/:id','show','post','put','update','delete'];(function(_0xa259a0,_0x5dac5a){var _0x3de334=function(_0x485627){while(--_0x485627){_0xa259a0['push'](_0xa259a0['shift']());}};_0x3de334(++_0x5dac5a);}(_0xfb8c,0x1bb));var _0xcfb8=function(_0x15765a,_0x144428){_0x15765a=_0x15765a-0x0;var _0x1fb6c9=_0xfb8c[_0x15765a];return _0x1fb6c9;};'use strict';var multer=require('multer');var util=require(_0xcfb8('0x0'));var path=require('path');var timeout=require(_0xcfb8('0x1'));var express=require(_0xcfb8('0x2'));var router=express[_0xcfb8('0x3')]();var fs_extra=require(_0xcfb8('0x4'));var auth=require(_0xcfb8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router[_0xcfb8('0x6')]('/',auth['isAuthenticated'](),controller[_0xcfb8('0x7')]);router['get']('/describe',auth[_0xcfb8('0x8')](),controller[_0xcfb8('0x9')]);router[_0xcfb8('0x6')](_0xcfb8('0xa'),auth['isAuthenticated'](),controller[_0xcfb8('0xb')]);router[_0xcfb8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcfb8('0xd')](_0xcfb8('0xa'),auth[_0xcfb8('0x8')](),controller[_0xcfb8('0xe')]);router[_0xcfb8('0xf')](_0xcfb8('0xa'),auth[_0xcfb8('0x8')](),controller[_0xcfb8('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 bbd48fd..d2f839c 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 _0x2b17=['STRING','DATE','moment','sequelize','exports'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x2b17,0xca));var _0x72b1=function(_0x439ddd,_0x5d9d2e){_0x439ddd=_0x439ddd-0x0;var _0x33b584=_0x2b17[_0x439ddd];return _0x33b584;};'use strict';var moment=require(_0x72b1('0x0'));var Sequelize=require(_0x72b1('0x1'));module[_0x72b1('0x2')]={'uniqueid':{'type':Sequelize[_0x72b1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x72b1('0x4')]},'exitAt':{'type':Sequelize[_0x72b1('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8135=['exports','STRING','DATE','moment'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x8135,0xdb));var _0x5813=function(_0xd2430b,_0x51de6b){_0xd2430b=_0xd2430b-0x0;var _0x170127=_0x8135[_0xd2430b];return _0x170127;};'use strict';var moment=require(_0x5813('0x0'));var Sequelize=require('sequelize');module[_0x5813('0x1')]={'uniqueid':{'type':Sequelize[_0x5813('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5813('0x2')]},'joinAt':{'type':Sequelize[_0x5813('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5813('0x3')]},'exitAt':{'type':Sequelize[_0x5813('0x3')]},'reason':{'type':Sequelize[_0x5813('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index e2dd216..b315914 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 _0xcd62=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','OpenchannelQueueReport','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','rawAttributes','catch','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xcd62,0x95));var _0x2cd6=function(_0x4ef8f9,_0x125a20){_0x4ef8f9=_0x4ef8f9-0x0;var _0x29cd38=_0xcd62[_0x4ef8f9];return _0x29cd38;};'use strict';var emlformat=require(_0x2cd6('0x0'));var rimraf=require(_0x2cd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2cd6('0x2'));var rp=require(_0x2cd6('0x3'));var moment=require(_0x2cd6('0x4'));var BPromise=require(_0x2cd6('0x5'));var Mustache=require(_0x2cd6('0x6'));var util=require(_0x2cd6('0x7'));var path=require(_0x2cd6('0x8'));var sox=require(_0x2cd6('0x9'));var csv=require(_0x2cd6('0xa'));var ejs=require(_0x2cd6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cd6('0xc'));var squel=require(_0x2cd6('0xd'));var crypto=require(_0x2cd6('0xe'));var jsforce=require(_0x2cd6('0xf'));var deskjs=require(_0x2cd6('0x10'));var toCsv=require(_0x2cd6('0xa'));var querystring=require(_0x2cd6('0x11'));var Papa=require(_0x2cd6('0x12'));var Redis=require(_0x2cd6('0x13'));var authService=require(_0x2cd6('0x14'));var qs=require(_0x2cd6('0x15'));var as=require(_0x2cd6('0x16'));var hardwareService=require(_0x2cd6('0x17'));var logger=require(_0x2cd6('0x18'))(_0x2cd6('0x19'));var utils=require(_0x2cd6('0x1a'));var config=require(_0x2cd6('0x1b'));var licenseUtil=require(_0x2cd6('0x1c'));var db=require(_0x2cd6('0x1d'))['db'];function respondWithStatusCode(_0x54eec3,_0x2f6687){_0x2f6687=_0x2f6687||0xcc;return function(_0x3a82a4){if(_0x3a82a4){return _0x54eec3['sendStatus'](_0x2f6687);}return _0x54eec3[_0x2cd6('0x1e')](_0x2f6687)['end']();};}function respondWithResult(_0x314008,_0x360e2){_0x360e2=_0x360e2||0xc8;return function(_0xa88a7e){if(_0xa88a7e){return _0x314008[_0x2cd6('0x1e')](_0x360e2)[_0x2cd6('0x1f')](_0xa88a7e);}};}function respondWithFilteredResult(_0xd1114e,_0x2f21c4){return function(_0x44acc4){if(_0x44acc4){var _0x39be1b=typeof _0x2f21c4[_0x2cd6('0x20')]===_0x2cd6('0x21')&&typeof _0x2f21c4[_0x2cd6('0x22')]===_0x2cd6('0x21');var _0x382b1a=_0x44acc4[_0x2cd6('0x23')];var _0xff6b18=_0x39be1b?0x0:_0x2f21c4[_0x2cd6('0x20')];var _0x28ff28=_0x39be1b?_0x44acc4[_0x2cd6('0x23')]:_0x2f21c4[_0x2cd6('0x20')]+_0x2f21c4[_0x2cd6('0x22')];var _0x55f61b;if(_0x28ff28>=_0x382b1a){_0x28ff28=_0x382b1a;_0x55f61b=0xc8;}else{_0x55f61b=0xce;}_0xd1114e['status'](_0x55f61b);return _0xd1114e[_0x2cd6('0x24')]('Content-Range',_0xff6b18+'-'+_0x28ff28+'/'+_0x382b1a)[_0x2cd6('0x1f')](_0x44acc4);}return null;};}function patchUpdates(_0xcd5689){return function(_0x2a3265){try{jsonpatch[_0x2cd6('0x25')](_0x2a3265,_0xcd5689,!![]);}catch(_0x4db2bc){return BPromise[_0x2cd6('0x26')](_0x4db2bc);}return _0x2a3265[_0x2cd6('0x27')]();};}function saveUpdates(_0x866096,_0x251475){return function(_0x12b91e){if(_0x12b91e){return _0x12b91e[_0x2cd6('0x28')](_0x866096)[_0x2cd6('0x29')](function(_0x3109e9){return _0x3109e9;});}return null;};}function removeEntity(_0x2f9d34,_0x3cbb59){return function(_0x3d1daa){if(_0x3d1daa){return _0x3d1daa[_0x2cd6('0x2a')]()['then'](function(){_0x2f9d34[_0x2cd6('0x1e')](0xcc)[_0x2cd6('0x2b')]();});}};}function handleEntityNotFound(_0x378b5a,_0x4766f2){return function(_0x248eff){if(!_0x248eff){_0x378b5a[_0x2cd6('0x2c')](0x194);}return _0x248eff;};}function handleError(_0x3b1442,_0x273758){_0x273758=_0x273758||0x1f4;return function(_0x4d3c64){logger['error'](_0x4d3c64[_0x2cd6('0x2d')]);if(_0x4d3c64['name']){delete _0x4d3c64[_0x2cd6('0x2e')];}_0x3b1442[_0x2cd6('0x1e')](_0x273758)[_0x2cd6('0x2f')](_0x4d3c64);};}exports[_0x2cd6('0x30')]=function(_0x1df69c,_0x4097e4){var _0x37b2fd={},_0x3c906d={},_0x5dc927={'count':0x0,'rows':[]};var _0x188cdd=_[_0x2cd6('0x31')](db[_0x2cd6('0x32')]['rawAttributes'],function(_0x1dec1b){return{'name':_0x1dec1b[_0x2cd6('0x33')],'type':_0x1dec1b['type'][_0x2cd6('0x34')]};});_0x3c906d[_0x2cd6('0x35')]=_[_0x2cd6('0x31')](_0x188cdd,_0x2cd6('0x2e'));_0x3c906d['query']=_[_0x2cd6('0x36')](_0x1df69c[_0x2cd6('0x37')]);_0x3c906d[_0x2cd6('0x38')]=_[_0x2cd6('0x39')](_0x3c906d[_0x2cd6('0x35')],_0x3c906d[_0x2cd6('0x37')]);_0x37b2fd[_0x2cd6('0x3a')]=_['intersection'](_0x3c906d[_0x2cd6('0x35')],qs[_0x2cd6('0x3b')](_0x1df69c[_0x2cd6('0x37')]['fields']));_0x37b2fd[_0x2cd6('0x3a')]=_0x37b2fd[_0x2cd6('0x3a')][_0x2cd6('0x3c')]?_0x37b2fd['attributes']:_0x3c906d['model'];if(!_0x1df69c[_0x2cd6('0x37')][_0x2cd6('0x3d')]('nolimit')){_0x37b2fd['limit']=qs[_0x2cd6('0x22')](_0x1df69c[_0x2cd6('0x37')][_0x2cd6('0x22')]);_0x37b2fd[_0x2cd6('0x20')]=qs[_0x2cd6('0x20')](_0x1df69c[_0x2cd6('0x37')][_0x2cd6('0x20')]);}_0x37b2fd['order']=qs['sort'](_0x1df69c[_0x2cd6('0x37')][_0x2cd6('0x3e')]);_0x37b2fd[_0x2cd6('0x3f')]=qs[_0x2cd6('0x38')](_[_0x2cd6('0x40')](_0x1df69c['query'],_0x3c906d[_0x2cd6('0x38')]),_0x188cdd);if(_0x1df69c['query'][_0x2cd6('0x41')]){_0x37b2fd[_0x2cd6('0x3f')]=_['merge'](_0x37b2fd[_0x2cd6('0x3f')],{'$or':_['map'](_0x188cdd,function(_0x1972db){if(_0x1972db[_0x2cd6('0x42')]!=='VIRTUAL'){var _0x154b57={};_0x154b57[_0x1972db[_0x2cd6('0x2e')]]={'$like':'%'+_0x1df69c[_0x2cd6('0x37')][_0x2cd6('0x41')]+'%'};return _0x154b57;}})});}_0x37b2fd=_[_0x2cd6('0x43')]({},_0x37b2fd,_0x1df69c[_0x2cd6('0x44')]);var _0xc9a2fe={'where':_0x37b2fd[_0x2cd6('0x3f')]};return db[_0x2cd6('0x32')]['count'](_0xc9a2fe)[_0x2cd6('0x29')](function(_0xf7e60e){_0x5dc927['count']=_0xf7e60e;if(_0x1df69c[_0x2cd6('0x37')][_0x2cd6('0x45')]){_0x37b2fd[_0x2cd6('0x46')]=[{'all':!![]}];}return db[_0x2cd6('0x32')][_0x2cd6('0x47')](_0x37b2fd);})['then'](function(_0x217609){_0x5dc927[_0x2cd6('0x48')]=_0x217609;return _0x5dc927;})[_0x2cd6('0x29')](respondWithFilteredResult(_0x4097e4,_0x37b2fd))['catch'](handleError(_0x4097e4,null));};exports['show']=function(_0x44f1f1,_0x2a5375){var _0x493115={'raw':!![],'where':{'id':_0x44f1f1['params']['id']}},_0x115cb7={};_0x115cb7[_0x2cd6('0x35')]=_[_0x2cd6('0x36')](db[_0x2cd6('0x32')][_0x2cd6('0x49')]);_0x115cb7[_0x2cd6('0x37')]=_['keys'](_0x44f1f1['query']);_0x115cb7[_0x2cd6('0x38')]=_[_0x2cd6('0x39')](_0x115cb7[_0x2cd6('0x35')],_0x115cb7[_0x2cd6('0x37')]);_0x493115['attributes']=_[_0x2cd6('0x39')](_0x115cb7[_0x2cd6('0x35')],qs[_0x2cd6('0x3b')](_0x44f1f1[_0x2cd6('0x37')][_0x2cd6('0x3b')]));_0x493115[_0x2cd6('0x3a')]=_0x493115[_0x2cd6('0x3a')][_0x2cd6('0x3c')]?_0x493115[_0x2cd6('0x3a')]:_0x115cb7[_0x2cd6('0x35')];if(_0x44f1f1[_0x2cd6('0x37')][_0x2cd6('0x45')]){_0x493115[_0x2cd6('0x46')]=[{'all':!![]}];}_0x493115=_['merge']({},_0x493115,_0x44f1f1[_0x2cd6('0x44')]);return db[_0x2cd6('0x32')]['find'](_0x493115)['then'](handleEntityNotFound(_0x2a5375,null))['then'](respondWithResult(_0x2a5375,null))[_0x2cd6('0x4a')](handleError(_0x2a5375,null));};exports['create']=function(_0x21e948,_0x2fa4eb){return db[_0x2cd6('0x32')][_0x2cd6('0x4b')](_0x21e948[_0x2cd6('0x4c')],{})[_0x2cd6('0x29')](respondWithResult(_0x2fa4eb,0xc9))[_0x2cd6('0x4a')](handleError(_0x2fa4eb,null));};exports['update']=function(_0x35ad72,_0x254488){if(_0x35ad72[_0x2cd6('0x4c')]['id']){delete _0x35ad72[_0x2cd6('0x4c')]['id'];}return db[_0x2cd6('0x32')][_0x2cd6('0x4d')]({'where':{'id':_0x35ad72[_0x2cd6('0x4e')]['id']}})[_0x2cd6('0x29')](handleEntityNotFound(_0x254488,null))[_0x2cd6('0x29')](saveUpdates(_0x35ad72[_0x2cd6('0x4c')],null))['then'](respondWithResult(_0x254488,null))['catch'](handleError(_0x254488,null));};exports[_0x2cd6('0x2a')]=function(_0x41cdf1,_0x449609){return db[_0x2cd6('0x32')]['find']({'where':{'id':_0x41cdf1[_0x2cd6('0x4e')]['id']}})[_0x2cd6('0x29')](handleEntityNotFound(_0x449609,null))[_0x2cd6('0x29')](removeEntity(_0x449609,null))['catch'](handleError(_0x449609,null));};exports[_0x2cd6('0x4f')]=function(_0x1caa0f,_0x23cfd1){return db[_0x2cd6('0x32')]['describe']()[_0x2cd6('0x29')](respondWithResult(_0x23cfd1,null))[_0x2cd6('0x4a')](handleError(_0x23cfd1,null));}; \ No newline at end of file +var _0x7dcb=['eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','offset','count','limit','set','Content-Range','reject','save','update','destroy','error','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','then','include','catch','show','params','length','includeAll','options','find','create','body','describe'];(function(_0xe1f858,_0xb86c44){var _0x367af6=function(_0x40ee87){while(--_0x40ee87){_0xe1f858['push'](_0xe1f858['shift']());}};_0x367af6(++_0xb86c44);}(_0x7dcb,0xdb));var _0xb7dc=function(_0x2c02f3,_0x30623f){_0x2c02f3=_0x2c02f3-0x0;var _0x524648=_0x7dcb[_0x2c02f3];return _0x524648;};'use strict';var emlformat=require(_0xb7dc('0x0'));var rimraf=require(_0xb7dc('0x1'));var zipdir=require(_0xb7dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb7dc('0x3'));var moment=require(_0xb7dc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb7dc('0x5'));var util=require(_0xb7dc('0x6'));var path=require(_0xb7dc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb7dc('0x8'));var fs=require('fs');var fs_extra=require(_0xb7dc('0x9'));var _=require(_0xb7dc('0xa'));var squel=require(_0xb7dc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb7dc('0xc'));var deskjs=require(_0xb7dc('0xd'));var toCsv=require(_0xb7dc('0xe'));var querystring=require('querystring');var Papa=require(_0xb7dc('0xf'));var Redis=require(_0xb7dc('0x10'));var authService=require(_0xb7dc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb7dc('0x12'));var hardwareService=require(_0xb7dc('0x13'));var logger=require('../../config/logger')(_0xb7dc('0x14'));var utils=require(_0xb7dc('0x15'));var config=require(_0xb7dc('0x16'));var licenseUtil=require(_0xb7dc('0x17'));var db=require(_0xb7dc('0x18'))['db'];function respondWithStatusCode(_0x326897,_0x1f094b){_0x1f094b=_0x1f094b||0xcc;return function(_0x392e62){if(_0x392e62){return _0x326897['sendStatus'](_0x1f094b);}return _0x326897['status'](_0x1f094b)[_0xb7dc('0x19')]();};}function respondWithResult(_0x108598,_0x4a6928){_0x4a6928=_0x4a6928||0xc8;return function(_0x303b4c){if(_0x303b4c){return _0x108598[_0xb7dc('0x1a')](_0x4a6928)[_0xb7dc('0x1b')](_0x303b4c);}};}function respondWithFilteredResult(_0x45b042,_0x24cdd2){return function(_0x1b4143){if(_0x1b4143){var _0x40fac0=typeof _0x24cdd2['offset']===_0xb7dc('0x1c')&&typeof _0x24cdd2['limit']==='undefined';var _0x175d91=_0x1b4143['count'];var _0x2a312f=_0x40fac0?0x0:_0x24cdd2[_0xb7dc('0x1d')];var _0x26dbe5=_0x40fac0?_0x1b4143[_0xb7dc('0x1e')]:_0x24cdd2[_0xb7dc('0x1d')]+_0x24cdd2[_0xb7dc('0x1f')];var _0x196ecc;if(_0x26dbe5>=_0x175d91){_0x26dbe5=_0x175d91;_0x196ecc=0xc8;}else{_0x196ecc=0xce;}_0x45b042['status'](_0x196ecc);return _0x45b042[_0xb7dc('0x20')](_0xb7dc('0x21'),_0x2a312f+'-'+_0x26dbe5+'/'+_0x175d91)['json'](_0x1b4143);}return null;};}function patchUpdates(_0x4a8bd1){return function(_0x3a6099){try{jsonpatch['apply'](_0x3a6099,_0x4a8bd1,!![]);}catch(_0x49d157){return BPromise[_0xb7dc('0x22')](_0x49d157);}return _0x3a6099[_0xb7dc('0x23')]();};}function saveUpdates(_0x40fb0a,_0xeebe09){return function(_0x280d76){if(_0x280d76){return _0x280d76[_0xb7dc('0x24')](_0x40fb0a)['then'](function(_0x206b28){return _0x206b28;});}return null;};}function removeEntity(_0x20cc01,_0xbbc4f6){return function(_0x35c0ff){if(_0x35c0ff){return _0x35c0ff[_0xb7dc('0x25')]()['then'](function(){_0x20cc01[_0xb7dc('0x1a')](0xcc)[_0xb7dc('0x19')]();});}};}function handleEntityNotFound(_0x24e304,_0x1ad214){return function(_0x24eab7){if(!_0x24eab7){_0x24e304['sendStatus'](0x194);}return _0x24eab7;};}function handleError(_0x5edcfa,_0x418bc8){_0x418bc8=_0x418bc8||0x1f4;return function(_0xae72d8){logger[_0xb7dc('0x26')](_0xae72d8['stack']);if(_0xae72d8[_0xb7dc('0x27')]){delete _0xae72d8[_0xb7dc('0x27')];}_0x5edcfa['status'](_0x418bc8)[_0xb7dc('0x28')](_0xae72d8);};}exports['index']=function(_0x2d8d95,_0x3fa541){var _0x192df7={},_0x150940={},_0x16d1fc={'count':0x0,'rows':[]};var _0x48a2bc=_[_0xb7dc('0x29')](db[_0xb7dc('0x2a')][_0xb7dc('0x2b')],function(_0x3bde02){return{'name':_0x3bde02[_0xb7dc('0x2c')],'type':_0x3bde02[_0xb7dc('0x2d')][_0xb7dc('0x2e')]};});_0x150940[_0xb7dc('0x2f')]=_['map'](_0x48a2bc,_0xb7dc('0x27'));_0x150940[_0xb7dc('0x30')]=_[_0xb7dc('0x31')](_0x2d8d95[_0xb7dc('0x30')]);_0x150940[_0xb7dc('0x32')]=_[_0xb7dc('0x33')](_0x150940['model'],_0x150940['query']);_0x192df7[_0xb7dc('0x34')]=_[_0xb7dc('0x33')](_0x150940[_0xb7dc('0x2f')],qs[_0xb7dc('0x35')](_0x2d8d95[_0xb7dc('0x30')][_0xb7dc('0x35')]));_0x192df7[_0xb7dc('0x34')]=_0x192df7[_0xb7dc('0x34')]['length']?_0x192df7[_0xb7dc('0x34')]:_0x150940['model'];if(!_0x2d8d95[_0xb7dc('0x30')][_0xb7dc('0x36')]('nolimit')){_0x192df7[_0xb7dc('0x1f')]=qs['limit'](_0x2d8d95[_0xb7dc('0x30')][_0xb7dc('0x1f')]);_0x192df7[_0xb7dc('0x1d')]=qs[_0xb7dc('0x1d')](_0x2d8d95[_0xb7dc('0x30')][_0xb7dc('0x1d')]);}_0x192df7['order']=qs['sort'](_0x2d8d95[_0xb7dc('0x30')][_0xb7dc('0x37')]);_0x192df7[_0xb7dc('0x38')]=qs['filters'](_[_0xb7dc('0x39')](_0x2d8d95[_0xb7dc('0x30')],_0x150940[_0xb7dc('0x32')]),_0x48a2bc);if(_0x2d8d95[_0xb7dc('0x30')][_0xb7dc('0x3a')]){_0x192df7[_0xb7dc('0x38')]=_['merge'](_0x192df7[_0xb7dc('0x38')],{'$or':_[_0xb7dc('0x29')](_0x48a2bc,function(_0x270944){if(_0x270944[_0xb7dc('0x2d')]!==_0xb7dc('0x3b')){var _0x298b56={};_0x298b56[_0x270944['name']]={'$like':'%'+_0x2d8d95[_0xb7dc('0x30')]['filter']+'%'};return _0x298b56;}})});}_0x192df7=_[_0xb7dc('0x3c')]({},_0x192df7,_0x2d8d95['options']);var _0xaff2ec={'where':_0x192df7[_0xb7dc('0x38')]};return db['OpenchannelQueueReport']['count'](_0xaff2ec)[_0xb7dc('0x3d')](function(_0x11876c){_0x16d1fc[_0xb7dc('0x1e')]=_0x11876c;if(_0x2d8d95['query']['includeAll']){_0x192df7[_0xb7dc('0x3e')]=[{'all':!![]}];}return db[_0xb7dc('0x2a')]['findAll'](_0x192df7);})[_0xb7dc('0x3d')](function(_0x54af80){_0x16d1fc['rows']=_0x54af80;return _0x16d1fc;})[_0xb7dc('0x3d')](respondWithFilteredResult(_0x3fa541,_0x192df7))[_0xb7dc('0x3f')](handleError(_0x3fa541,null));};exports[_0xb7dc('0x40')]=function(_0x420e2e,_0x407329){var _0x4a162b={'raw':!![],'where':{'id':_0x420e2e[_0xb7dc('0x41')]['id']}},_0x18b7c6={};_0x18b7c6[_0xb7dc('0x2f')]=_['keys'](db[_0xb7dc('0x2a')]['rawAttributes']);_0x18b7c6[_0xb7dc('0x30')]=_[_0xb7dc('0x31')](_0x420e2e[_0xb7dc('0x30')]);_0x18b7c6[_0xb7dc('0x32')]=_[_0xb7dc('0x33')](_0x18b7c6[_0xb7dc('0x2f')],_0x18b7c6[_0xb7dc('0x30')]);_0x4a162b['attributes']=_[_0xb7dc('0x33')](_0x18b7c6[_0xb7dc('0x2f')],qs[_0xb7dc('0x35')](_0x420e2e[_0xb7dc('0x30')][_0xb7dc('0x35')]));_0x4a162b['attributes']=_0x4a162b['attributes'][_0xb7dc('0x42')]?_0x4a162b[_0xb7dc('0x34')]:_0x18b7c6['model'];if(_0x420e2e['query'][_0xb7dc('0x43')]){_0x4a162b['include']=[{'all':!![]}];}_0x4a162b=_['merge']({},_0x4a162b,_0x420e2e[_0xb7dc('0x44')]);return db[_0xb7dc('0x2a')][_0xb7dc('0x45')](_0x4a162b)[_0xb7dc('0x3d')](handleEntityNotFound(_0x407329,null))[_0xb7dc('0x3d')](respondWithResult(_0x407329,null))[_0xb7dc('0x3f')](handleError(_0x407329,null));};exports['create']=function(_0x26d513,_0x5c6293){return db[_0xb7dc('0x2a')][_0xb7dc('0x46')](_0x26d513['body'],{})[_0xb7dc('0x3d')](respondWithResult(_0x5c6293,0xc9))['catch'](handleError(_0x5c6293,null));};exports[_0xb7dc('0x24')]=function(_0x2df27b,_0x411033){if(_0x2df27b['body']['id']){delete _0x2df27b['body']['id'];}return db[_0xb7dc('0x2a')]['find']({'where':{'id':_0x2df27b[_0xb7dc('0x41')]['id']}})[_0xb7dc('0x3d')](handleEntityNotFound(_0x411033,null))[_0xb7dc('0x3d')](saveUpdates(_0x2df27b[_0xb7dc('0x47')],null))[_0xb7dc('0x3d')](respondWithResult(_0x411033,null))['catch'](handleError(_0x411033,null));};exports[_0xb7dc('0x25')]=function(_0x5aadff,_0x1e56e8){return db[_0xb7dc('0x2a')][_0xb7dc('0x45')]({'where':{'id':_0x5aadff['params']['id']}})[_0xb7dc('0x3d')](handleEntityNotFound(_0x1e56e8,null))[_0xb7dc('0x3d')](removeEntity(_0x1e56e8,null))[_0xb7dc('0x3f')](handleError(_0x1e56e8,null));};exports[_0xb7dc('0x48')]=function(_0x4f2870,_0x2b08cf){return db['OpenchannelQueueReport']['describe']()[_0xb7dc('0x3d')](respondWithResult(_0x2b08cf,null))['catch'](handleError(_0x2b08cf,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2d48593..f48df99 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(_0x3b9c71,_0x52bd2f){var _0x419087=function(_0x474819){while(--_0x474819){_0x3b9c71['push'](_0x3b9c71['shift']());}};_0x419087(++_0x52bd2f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0x5fc3[_0x39ffd1];return _0x31267e;};'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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x165fd5,_0x103c15){var _0x15b980=function(_0x2f3a75){while(--_0x2f3a75){_0x165fd5['push'](_0x165fd5['shift']());}};_0x15b980(++_0x103c15);}(_0xe14b,0x93));var _0xbe14=function(_0x29a120,_0x121196){_0x29a120=_0x29a120-0x0;var _0x49d946=_0xe14b[_0x29a120];return _0x49d946;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 2342c0d..54fd4bf 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 _0xb10b=['then','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb10b,0x12a));var _0xbb10=function(_0xe6e3e2,_0x2b01da){_0xe6e3e2=_0xe6e3e2-0x0;var _0x126571=_0xb10b[_0xe6e3e2];return _0x126571;};'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')]('CreateOpenchannelQueueReport',_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')]));});});};exports[_0xbb10('0x1b')]=function(_0x436104){var _0x7f2377=this;return new Promise(function(_0x395404,_0x3ba6cd){return db[_0xbb10('0x16')]['update'](_0x436104['body'],{'raw':_0x436104['options']?_0x436104[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x436104[_0xbb10('0x18')]?_0x436104['options'][_0xbb10('0x1c')]||null:null,'attributes':_0x436104[_0xbb10('0x18')]?_0x436104[_0xbb10('0x18')][_0xbb10('0x1d')]||null:null,'limit':_0x436104[_0xbb10('0x18')]?_0x436104[_0xbb10('0x18')][_0xbb10('0x1e')]||null:null})['then'](function(_0x3796c7){logger[_0xbb10('0xd')](_0xbb10('0x1b'),_0x436104);logger[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x436104,JSON[_0xbb10('0x11')](_0x3796c7));_0x395404(_0x3796c7);})['catch'](function(_0x221624){logger['error'](_0xbb10('0x1b'),_0x221624['message'],_0x436104);_0x3ba6cd(_0x7f2377[_0xbb10('0x12')](0x1f4,_0x221624[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7fce=['options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','create','body'];(function(_0x1e8b57,_0x1ad0bf){var _0xf1af7f=function(_0x2c547f){while(--_0x2c547f){_0x1e8b57['push'](_0x1e8b57['shift']());}};_0xf1af7f(++_0x1ad0bf);}(_0x7fce,0xdc));var _0xe7fc=function(_0x54bb35,_0x1c6d03){_0x54bb35=_0x54bb35-0x0;var _0x4b3488=_0x7fce[_0x54bb35];return _0x4b3488;};'use strict';var _=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var moment=require(_0xe7fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe7fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7fc('0x5'))(_0xe7fc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7fc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4665f6,_0x161dca,_0x296b2e){return new BPromise(function(_0x19eeef,_0x22fabf){return client['request'](_0x4665f6,_0x296b2e)[_0xe7fc('0x8')](function(_0x4a1209){logger[_0xe7fc('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,_0xe7fc('0xa'));logger[_0xe7fc('0xb')](_0xe7fc('0xc'),_0x161dca,_0xe7fc('0xa'),JSON['stringify'](_0x4a1209));if(_0x4a1209[_0xe7fc('0xd')]){if(_0x4a1209[_0xe7fc('0xd')]['code']===0x1f4){logger['error'](_0xe7fc('0xe'),_0x161dca,_0x4a1209['error'][_0xe7fc('0xf')]);return _0x22fabf(_0x4a1209['error']['message']);}logger[_0xe7fc('0xd')](_0xe7fc('0xe'),_0x161dca,_0x4a1209[_0xe7fc('0xd')][_0xe7fc('0xf')]);return _0x19eeef(_0x4a1209[_0xe7fc('0xd')]['message']);}else{logger[_0xe7fc('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,'request\x20sent');_0x19eeef(_0x4a1209[_0xe7fc('0x10')][_0xe7fc('0xf')]);}})[_0xe7fc('0x11')](function(_0x3a44a6){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,_0x3a44a6);_0x22fabf(_0x3a44a6);});});}exports['CreateOpenchannelQueueReport']=function(_0x4aa4f0){var _0x52902f=this;return new Promise(function(_0x490a99,_0x14515d){return db['OpenchannelQueueReport'][_0xe7fc('0x12')](_0x4aa4f0[_0xe7fc('0x13')],{'raw':_0x4aa4f0[_0xe7fc('0x14')]?_0x4aa4f0[_0xe7fc('0x14')][_0xe7fc('0x15')]===undefined?!![]:![]:!![]})[_0xe7fc('0x8')](function(_0x329051){logger[_0xe7fc('0x9')]('CreateOpenchannelQueueReport',_0x4aa4f0);logger[_0xe7fc('0xb')](_0xe7fc('0x16'),_0x4aa4f0,JSON['stringify'](_0x329051));_0x490a99(_0x329051);})['catch'](function(_0x35bb53){logger[_0xe7fc('0xd')](_0xe7fc('0x16'),_0x35bb53[_0xe7fc('0xf')],_0x4aa4f0);_0x14515d(_0x52902f[_0xe7fc('0xd')](0x1f4,_0x35bb53[_0xe7fc('0xf')]));});});};exports[_0xe7fc('0x17')]=function(_0x1731b6){var _0xb00cb9=this;return new Promise(function(_0x3e7e7e,_0x1d1348){return db[_0xe7fc('0x18')][_0xe7fc('0x19')](_0x1731b6['body'],{'raw':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1a')]||null:null,'attributes':_0x1731b6['options']?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1b')]||null:null,'limit':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1c')]||null:null})[_0xe7fc('0x8')](function(_0x383ca6){logger['info'](_0xe7fc('0x17'),_0x1731b6);logger[_0xe7fc('0xb')]('UpdateOpenchannelQueueReport',_0x1731b6,JSON[_0xe7fc('0x1d')](_0x383ca6));_0x3e7e7e(_0x383ca6);})['catch'](function(_0x39d908){logger[_0xe7fc('0xd')]('UpdateOpenchannelQueueReport',_0x39d908[_0xe7fc('0xf')],_0x1731b6);_0x1d1348(_0xb00cb9['error'](0x1f4,_0x39d908[_0xe7fc('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 24eb513..9424569 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 _0xe827=['post','create','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id'];(function(_0x47e86f,_0xcec17e){var _0xc749bb=function(_0x57bf84){while(--_0x57bf84){_0x47e86f['push'](_0x47e86f['shift']());}};_0xc749bb(++_0xcec17e);}(_0xe827,0x165));var _0x7e82=function(_0x2f8c0b,_0x52ad37){_0x2f8c0b=_0x2f8c0b-0x0;var _0x166059=_0xe827[_0x2f8c0b];return _0x166059;};'use strict';var multer=require(_0x7e82('0x0'));var util=require('util');var path=require(_0x7e82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e82('0x2')]();var fs_extra=require(_0x7e82('0x3'));var auth=require(_0x7e82('0x4'));var interaction=require(_0x7e82('0x5'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x7e82('0x6')]('/',auth[_0x7e82('0x7')](),controller[_0x7e82('0x8')]);router[_0x7e82('0x6')]('/describe',auth[_0x7e82('0x7')](),controller[_0x7e82('0x9')]);router[_0x7e82('0x6')](_0x7e82('0xa'),auth[_0x7e82('0x7')](),controller['show']);router[_0x7e82('0xb')]('/',auth[_0x7e82('0x7')](),controller[_0x7e82('0xc')]);router['put'](_0x7e82('0xa'),auth[_0x7e82('0x7')](),controller['update']);router[_0x7e82('0xd')](_0x7e82('0xa'),auth['isAuthenticated'](),controller[_0x7e82('0xe')]);module[_0x7e82('0xf')]=router; \ No newline at end of file +var _0xa1b5=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','post','put','/:id','update','delete','exports','multer','util','path'];(function(_0x342bc6,_0x2ad779){var _0x120dcb=function(_0x34a76e){while(--_0x34a76e){_0x342bc6['push'](_0x342bc6['shift']());}};_0x120dcb(++_0x2ad779);}(_0xa1b5,0x189));var _0x5a1b=function(_0x2db4f8,_0x28d10e){_0x2db4f8=_0x2db4f8-0x0;var _0xa73db3=_0xa1b5[_0x2db4f8];return _0xa73db3;};'use strict';var multer=require(_0x5a1b('0x0'));var util=require(_0x5a1b('0x1'));var path=require(_0x5a1b('0x2'));var timeout=require('connect-timeout');var express=require(_0x5a1b('0x3'));var router=express[_0x5a1b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5a1b('0x5'));var interaction=require(_0x5a1b('0x6'));var config=require(_0x5a1b('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0x5a1b('0x8')]('/',auth[_0x5a1b('0x9')](),controller[_0x5a1b('0xa')]);router[_0x5a1b('0x8')](_0x5a1b('0xb'),auth[_0x5a1b('0x9')](),controller['describe']);router[_0x5a1b('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5a1b('0xc')]('/',auth[_0x5a1b('0x9')](),controller['create']);router[_0x5a1b('0xd')](_0x5a1b('0xe'),auth[_0x5a1b('0x9')](),controller[_0x5a1b('0xf')]);router[_0x5a1b('0x10')](_0x5a1b('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x5a1b('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b2d08de..76117f9 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x51fa3e,_0xd41d0b){var _0x534719=function(_0x86d3e9){while(--_0x86d3e9){_0x51fa3e['push'](_0x51fa3e['shift']());}};_0x534719(++_0xd41d0b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x00bb[_0x5b644e];return _0x49c6bf;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x2c84f1,_0x3e6d6b){var _0xb4f2d=function(_0x215392){while(--_0x215392){_0x2c84f1['push'](_0x2c84f1['shift']());}};_0xb4f2d(++_0x3e6d6b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0x4b84[_0x148879];return _0x4f7027;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index e215197..7fa9081 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 _0xa4d7=['../../components/auth/service','../../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','reject','update','then','destroy','sendStatus','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0xa4d7,0xc8));var _0x7a4d=function(_0x54ed00,_0x253ac2){_0x54ed00=_0x54ed00-0x0;var _0x2f9a44=_0xa4d7[_0x54ed00];return _0x2f9a44;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7a4d('0x0'));var jsonpatch=require(_0x7a4d('0x1'));var rp=require(_0x7a4d('0x2'));var moment=require('moment');var BPromise=require(_0x7a4d('0x3'));var Mustache=require(_0x7a4d('0x4'));var util=require(_0x7a4d('0x5'));var path=require(_0x7a4d('0x6'));var sox=require(_0x7a4d('0x7'));var csv=require(_0x7a4d('0x8'));var ejs=require(_0x7a4d('0x9'));var fs=require('fs');var fs_extra=require(_0x7a4d('0xa'));var _=require(_0x7a4d('0xb'));var squel=require(_0x7a4d('0xc'));var crypto=require(_0x7a4d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7a4d('0xe'));var toCsv=require(_0x7a4d('0x8'));var querystring=require('querystring');var Papa=require(_0x7a4d('0xf'));var Redis=require('ioredis');var authService=require(_0x7a4d('0x10'));var qs=require(_0x7a4d('0x11'));var as=require(_0x7a4d('0x12'));var hardwareService=require(_0x7a4d('0x13'));var logger=require(_0x7a4d('0x14'))(_0x7a4d('0x15'));var utils=require('../../config/utils');var config=require(_0x7a4d('0x16'));var licenseUtil=require(_0x7a4d('0x17'));var db=require(_0x7a4d('0x18'))['db'];function respondWithStatusCode(_0x575fdb,_0x56a0cb){_0x56a0cb=_0x56a0cb||0xcc;return function(_0x2bf21c){if(_0x2bf21c){return _0x575fdb['sendStatus'](_0x56a0cb);}return _0x575fdb[_0x7a4d('0x19')](_0x56a0cb)[_0x7a4d('0x1a')]();};}function respondWithResult(_0x43244b,_0x35cf11){_0x35cf11=_0x35cf11||0xc8;return function(_0x59538d){if(_0x59538d){return _0x43244b[_0x7a4d('0x19')](_0x35cf11)[_0x7a4d('0x1b')](_0x59538d);}};}function respondWithFilteredResult(_0x45320c,_0x4cfa10){return function(_0x168904){if(_0x168904){var _0x5aa7e1=typeof _0x4cfa10[_0x7a4d('0x1c')]===_0x7a4d('0x1d')&&typeof _0x4cfa10[_0x7a4d('0x1e')]===_0x7a4d('0x1d');var _0x74a288=_0x168904[_0x7a4d('0x1f')];var _0x3e2528=_0x5aa7e1?0x0:_0x4cfa10['offset'];var _0x2ce3a2=_0x5aa7e1?_0x168904['count']:_0x4cfa10[_0x7a4d('0x1c')]+_0x4cfa10[_0x7a4d('0x1e')];var _0x177ca3;if(_0x2ce3a2>=_0x74a288){_0x2ce3a2=_0x74a288;_0x177ca3=0xc8;}else{_0x177ca3=0xce;}_0x45320c[_0x7a4d('0x19')](_0x177ca3);return _0x45320c['set']('Content-Range',_0x3e2528+'-'+_0x2ce3a2+'/'+_0x74a288)[_0x7a4d('0x1b')](_0x168904);}return null;};}function patchUpdates(_0x73cd01){return function(_0x28b4ba){try{jsonpatch['apply'](_0x28b4ba,_0x73cd01,!![]);}catch(_0x18cd3d){return BPromise[_0x7a4d('0x20')](_0x18cd3d);}return _0x28b4ba['save']();};}function saveUpdates(_0x54a995,_0xfea0ab){return function(_0x2e10bf){if(_0x2e10bf){return _0x2e10bf[_0x7a4d('0x21')](_0x54a995)[_0x7a4d('0x22')](function(_0x3619b9){return _0x3619b9;});}return null;};}function removeEntity(_0xffaa59,_0x57fcd5){return function(_0x551daf){if(_0x551daf){return _0x551daf[_0x7a4d('0x23')]()[_0x7a4d('0x22')](function(){_0xffaa59['status'](0xcc)[_0x7a4d('0x1a')]();});}};}function handleEntityNotFound(_0x4a5c6f,_0x35b9cb){return function(_0x593b12){if(!_0x593b12){_0x4a5c6f[_0x7a4d('0x24')](0x194);}return _0x593b12;};}function handleError(_0x5728f2,_0x1c9d08){_0x1c9d08=_0x1c9d08||0x1f4;return function(_0x283a34){logger[_0x7a4d('0x25')](_0x283a34[_0x7a4d('0x26')]);if(_0x283a34[_0x7a4d('0x27')]){delete _0x283a34[_0x7a4d('0x27')];}_0x5728f2[_0x7a4d('0x19')](_0x1c9d08)[_0x7a4d('0x28')](_0x283a34);};}exports['index']=function(_0x4aec0b,_0x33bbaa){var _0x2d21c2={},_0x482e0a={},_0xfa136={'count':0x0,'rows':[]};var _0x2ff7eb=_[_0x7a4d('0x29')](db[_0x7a4d('0x2a')][_0x7a4d('0x2b')],function(_0x2ad4c5){return{'name':_0x2ad4c5[_0x7a4d('0x2c')],'type':_0x2ad4c5[_0x7a4d('0x2d')]['key']};});_0x482e0a[_0x7a4d('0x2e')]=_[_0x7a4d('0x29')](_0x2ff7eb,'name');_0x482e0a[_0x7a4d('0x2f')]=_[_0x7a4d('0x30')](_0x4aec0b[_0x7a4d('0x2f')]);_0x482e0a[_0x7a4d('0x31')]=_['intersection'](_0x482e0a[_0x7a4d('0x2e')],_0x482e0a[_0x7a4d('0x2f')]);_0x2d21c2[_0x7a4d('0x32')]=_[_0x7a4d('0x33')](_0x482e0a['model'],qs[_0x7a4d('0x34')](_0x4aec0b[_0x7a4d('0x2f')]['fields']));_0x2d21c2['attributes']=_0x2d21c2[_0x7a4d('0x32')]['length']?_0x2d21c2[_0x7a4d('0x32')]:_0x482e0a[_0x7a4d('0x2e')];if(!_0x4aec0b[_0x7a4d('0x2f')][_0x7a4d('0x35')](_0x7a4d('0x36'))){_0x2d21c2[_0x7a4d('0x1e')]=qs[_0x7a4d('0x1e')](_0x4aec0b['query'][_0x7a4d('0x1e')]);_0x2d21c2[_0x7a4d('0x1c')]=qs['offset'](_0x4aec0b[_0x7a4d('0x2f')][_0x7a4d('0x1c')]);}_0x2d21c2[_0x7a4d('0x37')]=qs[_0x7a4d('0x38')](_0x4aec0b[_0x7a4d('0x2f')][_0x7a4d('0x38')]);_0x2d21c2[_0x7a4d('0x39')]=qs[_0x7a4d('0x31')](_[_0x7a4d('0x3a')](_0x4aec0b[_0x7a4d('0x2f')],_0x482e0a[_0x7a4d('0x31')]),_0x2ff7eb);if(_0x4aec0b[_0x7a4d('0x2f')]['filter']){_0x2d21c2[_0x7a4d('0x39')]=_['merge'](_0x2d21c2[_0x7a4d('0x39')],{'$or':_['map'](_0x2ff7eb,function(_0x220c18){if(_0x220c18[_0x7a4d('0x2d')]!==_0x7a4d('0x3b')){var _0x21e33e={};_0x21e33e[_0x220c18['name']]={'$like':'%'+_0x4aec0b[_0x7a4d('0x2f')][_0x7a4d('0x3c')]+'%'};return _0x21e33e;}})});}_0x2d21c2=_[_0x7a4d('0x3d')]({},_0x2d21c2,_0x4aec0b[_0x7a4d('0x3e')]);var _0x546e64={'where':_0x2d21c2[_0x7a4d('0x39')]};return db[_0x7a4d('0x2a')][_0x7a4d('0x1f')](_0x546e64)[_0x7a4d('0x22')](function(_0x4ca323){_0xfa136[_0x7a4d('0x1f')]=_0x4ca323;if(_0x4aec0b[_0x7a4d('0x2f')][_0x7a4d('0x3f')]){_0x2d21c2[_0x7a4d('0x40')]=[{'all':!![]}];}return db[_0x7a4d('0x2a')][_0x7a4d('0x41')](_0x2d21c2);})[_0x7a4d('0x22')](function(_0x24ac9a){_0xfa136['rows']=_0x24ac9a;return _0xfa136;})['then'](respondWithFilteredResult(_0x33bbaa,_0x2d21c2))[_0x7a4d('0x42')](handleError(_0x33bbaa,null));};exports['show']=function(_0x570ffb,_0x157c3a){var _0x30d1e0={'raw':!![],'where':{'id':_0x570ffb[_0x7a4d('0x43')]['id']}},_0x3b1e6d={};_0x3b1e6d[_0x7a4d('0x2e')]=_[_0x7a4d('0x30')](db[_0x7a4d('0x2a')]['rawAttributes']);_0x3b1e6d[_0x7a4d('0x2f')]=_[_0x7a4d('0x30')](_0x570ffb[_0x7a4d('0x2f')]);_0x3b1e6d[_0x7a4d('0x31')]=_['intersection'](_0x3b1e6d[_0x7a4d('0x2e')],_0x3b1e6d[_0x7a4d('0x2f')]);_0x30d1e0['attributes']=_['intersection'](_0x3b1e6d['model'],qs['fields'](_0x570ffb[_0x7a4d('0x2f')]['fields']));_0x30d1e0[_0x7a4d('0x32')]=_0x30d1e0[_0x7a4d('0x32')]['length']?_0x30d1e0['attributes']:_0x3b1e6d['model'];if(_0x570ffb['query'][_0x7a4d('0x3f')]){_0x30d1e0[_0x7a4d('0x40')]=[{'all':!![]}];}_0x30d1e0=_[_0x7a4d('0x3d')]({},_0x30d1e0,_0x570ffb['options']);return db[_0x7a4d('0x2a')][_0x7a4d('0x44')](_0x30d1e0)['then'](handleEntityNotFound(_0x157c3a,null))[_0x7a4d('0x22')](respondWithResult(_0x157c3a,null))[_0x7a4d('0x42')](handleError(_0x157c3a,null));};exports[_0x7a4d('0x45')]=function(_0x37af21,_0x87a1bd){return db[_0x7a4d('0x2a')]['create'](_0x37af21[_0x7a4d('0x46')],{})[_0x7a4d('0x22')](respondWithResult(_0x87a1bd,0xc9))[_0x7a4d('0x42')](handleError(_0x87a1bd,null));};exports['update']=function(_0x5eee8f,_0x5521fb){if(_0x5eee8f[_0x7a4d('0x46')]['id']){delete _0x5eee8f[_0x7a4d('0x46')]['id'];}return db[_0x7a4d('0x2a')][_0x7a4d('0x44')]({'where':{'id':_0x5eee8f[_0x7a4d('0x43')]['id']}})[_0x7a4d('0x22')](handleEntityNotFound(_0x5521fb,null))[_0x7a4d('0x22')](saveUpdates(_0x5eee8f[_0x7a4d('0x46')],null))[_0x7a4d('0x22')](respondWithResult(_0x5521fb,null))['catch'](handleError(_0x5521fb,null));};exports['destroy']=function(_0x2a4787,_0x501228){return db[_0x7a4d('0x2a')][_0x7a4d('0x44')]({'where':{'id':_0x2a4787[_0x7a4d('0x43')]['id']}})[_0x7a4d('0x22')](handleEntityNotFound(_0x501228,null))['then'](removeEntity(_0x501228,null))['catch'](handleError(_0x501228,null));};exports[_0x7a4d('0x47')]=function(_0x22fd14,_0x5240d7){return db[_0x7a4d('0x2a')]['describe']()['then'](respondWithResult(_0x5240d7,null))[_0x7a4d('0x42')](handleError(_0x5240d7,null));}; \ No newline at end of file +var _0x5ebd=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','OpenchannelTransferReport','fieldName','type','key','model','query'];(function(_0x2ac980,_0x33829d){var _0x53974d=function(_0x4cd40c){while(--_0x4cd40c){_0x2ac980['push'](_0x2ac980['shift']());}};_0x53974d(++_0x33829d);}(_0x5ebd,0xf9));var _0xd5eb=function(_0xa7efd7,_0x45c885){_0xa7efd7=_0xa7efd7-0x0;var _0x572019=_0x5ebd[_0xa7efd7];return _0x572019;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd5eb('0x0'));var zipdir=require(_0xd5eb('0x1'));var jsonpatch=require(_0xd5eb('0x2'));var rp=require(_0xd5eb('0x3'));var moment=require('moment');var BPromise=require(_0xd5eb('0x4'));var Mustache=require('mustache');var util=require(_0xd5eb('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xd5eb('0x6'));var ejs=require(_0xd5eb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd5eb('0x8'));var crypto=require(_0xd5eb('0x9'));var jsforce=require(_0xd5eb('0xa'));var deskjs=require(_0xd5eb('0xb'));var toCsv=require(_0xd5eb('0x6'));var querystring=require('querystring');var Papa=require(_0xd5eb('0xc'));var Redis=require(_0xd5eb('0xd'));var authService=require(_0xd5eb('0xe'));var qs=require(_0xd5eb('0xf'));var as=require(_0xd5eb('0x10'));var hardwareService=require(_0xd5eb('0x11'));var logger=require(_0xd5eb('0x12'))(_0xd5eb('0x13'));var utils=require(_0xd5eb('0x14'));var config=require(_0xd5eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd5eb('0x16'))['db'];function respondWithStatusCode(_0x271268,_0x4b0d75){_0x4b0d75=_0x4b0d75||0xcc;return function(_0x4ef18e){if(_0x4ef18e){return _0x271268[_0xd5eb('0x17')](_0x4b0d75);}return _0x271268[_0xd5eb('0x18')](_0x4b0d75)['end']();};}function respondWithResult(_0x40d642,_0x9c8d41){_0x9c8d41=_0x9c8d41||0xc8;return function(_0x55771d){if(_0x55771d){return _0x40d642[_0xd5eb('0x18')](_0x9c8d41)[_0xd5eb('0x19')](_0x55771d);}};}function respondWithFilteredResult(_0x2c5448,_0x157e20){return function(_0x445f72){if(_0x445f72){var _0x1af3b0=typeof _0x157e20[_0xd5eb('0x1a')]==='undefined'&&typeof _0x157e20[_0xd5eb('0x1b')]===_0xd5eb('0x1c');var _0x169efe=_0x445f72[_0xd5eb('0x1d')];var _0x3f8072=_0x1af3b0?0x0:_0x157e20['offset'];var _0xd3d104=_0x1af3b0?_0x445f72[_0xd5eb('0x1d')]:_0x157e20['offset']+_0x157e20[_0xd5eb('0x1b')];var _0x436e7e;if(_0xd3d104>=_0x169efe){_0xd3d104=_0x169efe;_0x436e7e=0xc8;}else{_0x436e7e=0xce;}_0x2c5448[_0xd5eb('0x18')](_0x436e7e);return _0x2c5448[_0xd5eb('0x1e')](_0xd5eb('0x1f'),_0x3f8072+'-'+_0xd3d104+'/'+_0x169efe)[_0xd5eb('0x19')](_0x445f72);}return null;};}function patchUpdates(_0x52c708){return function(_0x1d267c){try{jsonpatch['apply'](_0x1d267c,_0x52c708,!![]);}catch(_0x5ba0ef){return BPromise[_0xd5eb('0x20')](_0x5ba0ef);}return _0x1d267c[_0xd5eb('0x21')]();};}function saveUpdates(_0x3c4fd8,_0x2f21a3){return function(_0x317de0){if(_0x317de0){return _0x317de0[_0xd5eb('0x22')](_0x3c4fd8)[_0xd5eb('0x23')](function(_0x537524){return _0x537524;});}return null;};}function removeEntity(_0x4ff43e,_0x12366e){return function(_0x38b3a0){if(_0x38b3a0){return _0x38b3a0['destroy']()['then'](function(){_0x4ff43e[_0xd5eb('0x18')](0xcc)[_0xd5eb('0x24')]();});}};}function handleEntityNotFound(_0x33bc04,_0x5b372a){return function(_0x2bf96e){if(!_0x2bf96e){_0x33bc04['sendStatus'](0x194);}return _0x2bf96e;};}function handleError(_0x5a652e,_0x281b3f){_0x281b3f=_0x281b3f||0x1f4;return function(_0x157f45){logger[_0xd5eb('0x25')](_0x157f45[_0xd5eb('0x26')]);if(_0x157f45['name']){delete _0x157f45[_0xd5eb('0x27')];}_0x5a652e['status'](_0x281b3f)[_0xd5eb('0x28')](_0x157f45);};}exports['index']=function(_0x55b0cb,_0x2f8d51){var _0x5b9164={},_0x4a5983={},_0x4a01ef={'count':0x0,'rows':[]};var _0x245f25=_['map'](db[_0xd5eb('0x29')]['rawAttributes'],function(_0x39f2f3){return{'name':_0x39f2f3[_0xd5eb('0x2a')],'type':_0x39f2f3[_0xd5eb('0x2b')][_0xd5eb('0x2c')]};});_0x4a5983[_0xd5eb('0x2d')]=_['map'](_0x245f25,'name');_0x4a5983[_0xd5eb('0x2e')]=_[_0xd5eb('0x2f')](_0x55b0cb[_0xd5eb('0x2e')]);_0x4a5983[_0xd5eb('0x30')]=_[_0xd5eb('0x31')](_0x4a5983[_0xd5eb('0x2d')],_0x4a5983['query']);_0x5b9164[_0xd5eb('0x32')]=_[_0xd5eb('0x31')](_0x4a5983['model'],qs[_0xd5eb('0x33')](_0x55b0cb[_0xd5eb('0x2e')]['fields']));_0x5b9164[_0xd5eb('0x32')]=_0x5b9164[_0xd5eb('0x32')][_0xd5eb('0x34')]?_0x5b9164['attributes']:_0x4a5983[_0xd5eb('0x2d')];if(!_0x55b0cb[_0xd5eb('0x2e')][_0xd5eb('0x35')]('nolimit')){_0x5b9164[_0xd5eb('0x1b')]=qs[_0xd5eb('0x1b')](_0x55b0cb[_0xd5eb('0x2e')][_0xd5eb('0x1b')]);_0x5b9164['offset']=qs[_0xd5eb('0x1a')](_0x55b0cb[_0xd5eb('0x2e')][_0xd5eb('0x1a')]);}_0x5b9164[_0xd5eb('0x36')]=qs[_0xd5eb('0x37')](_0x55b0cb['query'][_0xd5eb('0x37')]);_0x5b9164[_0xd5eb('0x38')]=qs[_0xd5eb('0x30')](_[_0xd5eb('0x39')](_0x55b0cb[_0xd5eb('0x2e')],_0x4a5983['filters']),_0x245f25);if(_0x55b0cb[_0xd5eb('0x2e')][_0xd5eb('0x3a')]){_0x5b9164[_0xd5eb('0x38')]=_['merge'](_0x5b9164[_0xd5eb('0x38')],{'$or':_['map'](_0x245f25,function(_0x2dbfea){if(_0x2dbfea[_0xd5eb('0x2b')]!==_0xd5eb('0x3b')){var _0x88ff9c={};_0x88ff9c[_0x2dbfea[_0xd5eb('0x27')]]={'$like':'%'+_0x55b0cb[_0xd5eb('0x2e')][_0xd5eb('0x3a')]+'%'};return _0x88ff9c;}})});}_0x5b9164=_[_0xd5eb('0x3c')]({},_0x5b9164,_0x55b0cb[_0xd5eb('0x3d')]);var _0xed74be={'where':_0x5b9164[_0xd5eb('0x38')]};return db[_0xd5eb('0x29')]['count'](_0xed74be)[_0xd5eb('0x23')](function(_0x249ee8){_0x4a01ef[_0xd5eb('0x1d')]=_0x249ee8;if(_0x55b0cb[_0xd5eb('0x2e')][_0xd5eb('0x3e')]){_0x5b9164['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xd5eb('0x3f')](_0x5b9164);})[_0xd5eb('0x23')](function(_0x753b1d){_0x4a01ef[_0xd5eb('0x40')]=_0x753b1d;return _0x4a01ef;})[_0xd5eb('0x23')](respondWithFilteredResult(_0x2f8d51,_0x5b9164))[_0xd5eb('0x41')](handleError(_0x2f8d51,null));};exports[_0xd5eb('0x42')]=function(_0x1c77be,_0x341f89){var _0x3ae0cc={'raw':!![],'where':{'id':_0x1c77be[_0xd5eb('0x43')]['id']}},_0x24d605={};_0x24d605[_0xd5eb('0x2d')]=_['keys'](db[_0xd5eb('0x29')]['rawAttributes']);_0x24d605[_0xd5eb('0x2e')]=_[_0xd5eb('0x2f')](_0x1c77be['query']);_0x24d605['filters']=_['intersection'](_0x24d605[_0xd5eb('0x2d')],_0x24d605[_0xd5eb('0x2e')]);_0x3ae0cc[_0xd5eb('0x32')]=_['intersection'](_0x24d605[_0xd5eb('0x2d')],qs[_0xd5eb('0x33')](_0x1c77be[_0xd5eb('0x2e')][_0xd5eb('0x33')]));_0x3ae0cc[_0xd5eb('0x32')]=_0x3ae0cc['attributes'][_0xd5eb('0x34')]?_0x3ae0cc[_0xd5eb('0x32')]:_0x24d605[_0xd5eb('0x2d')];if(_0x1c77be[_0xd5eb('0x2e')][_0xd5eb('0x3e')]){_0x3ae0cc[_0xd5eb('0x44')]=[{'all':!![]}];}_0x3ae0cc=_[_0xd5eb('0x3c')]({},_0x3ae0cc,_0x1c77be[_0xd5eb('0x3d')]);return db[_0xd5eb('0x29')][_0xd5eb('0x45')](_0x3ae0cc)[_0xd5eb('0x23')](handleEntityNotFound(_0x341f89,null))[_0xd5eb('0x23')](respondWithResult(_0x341f89,null))[_0xd5eb('0x41')](handleError(_0x341f89,null));};exports[_0xd5eb('0x46')]=function(_0x381d15,_0x3b0410){return db[_0xd5eb('0x29')]['create'](_0x381d15[_0xd5eb('0x47')],{})[_0xd5eb('0x23')](respondWithResult(_0x3b0410,0xc9))[_0xd5eb('0x41')](handleError(_0x3b0410,null));};exports['update']=function(_0x12deab,_0x298f23){if(_0x12deab['body']['id']){delete _0x12deab[_0xd5eb('0x47')]['id'];}return db[_0xd5eb('0x29')][_0xd5eb('0x45')]({'where':{'id':_0x12deab[_0xd5eb('0x43')]['id']}})[_0xd5eb('0x23')](handleEntityNotFound(_0x298f23,null))[_0xd5eb('0x23')](saveUpdates(_0x12deab['body'],null))[_0xd5eb('0x23')](respondWithResult(_0x298f23,null))[_0xd5eb('0x41')](handleError(_0x298f23,null));};exports[_0xd5eb('0x48')]=function(_0x5d782d,_0x1bec80){return db[_0xd5eb('0x29')][_0xd5eb('0x45')]({'where':{'id':_0x5d782d[_0xd5eb('0x43')]['id']}})[_0xd5eb('0x23')](handleEntityNotFound(_0x1bec80,null))[_0xd5eb('0x23')](removeEntity(_0x1bec80,null))[_0xd5eb('0x41')](handleError(_0x1bec80,null));};exports[_0xd5eb('0x49')]=function(_0x54622d,_0x3c7013){return db[_0xd5eb('0x29')][_0xd5eb('0x49')]()[_0xd5eb('0x23')](respondWithResult(_0x3c7013,null))[_0xd5eb('0x41')](handleError(_0x3c7013,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a533f04..e71e3c2 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 _0x5121=['bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x498877,_0x324062){var _0x17672e=function(_0x3cd840){while(--_0x3cd840){_0x498877['push'](_0x498877['shift']());}};_0x17672e(++_0x324062);}(_0x5121,0xcd));var _0x1512=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0x5121[_0x2b0a86];return _0x955940;};'use strict';var _=require(_0x1512('0x0'));var util=require(_0x1512('0x1'));var logger=require(_0x1512('0x2'))(_0x1512('0x3'));var moment=require(_0x1512('0x4'));var BPromise=require(_0x1512('0x5'));var rp=require(_0x1512('0x6'));var fs=require('fs');var path=require(_0x1512('0x7'));var rimraf=require(_0x1512('0x8'));var config=require('../../config/environment');var attributes=require(_0x1512('0x9'));module[_0x1512('0xa')]=function(_0x212d0a,_0x22d7c8){return _0x212d0a[_0x1512('0xb')](_0x1512('0xc'),attributes,{'tableName':_0x1512('0xd'),'paranoid':![],'indexes':[{'name':_0x1512('0xe'),'fields':[_0x1512('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xffaf=['./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x22f103,_0xc2dfb6){var _0x3911b1=function(_0x487114){while(--_0x487114){_0x22f103['push'](_0x22f103['shift']());}};_0x3911b1(++_0xc2dfb6);}(_0xffaf,0x10c));var _0xfffa=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0xffaf[_0x5e6bec];return _0x5dc5cf;};'use strict';var _=require(_0xfffa('0x0'));var util=require('util');var logger=require(_0xfffa('0x1'))('api');var moment=require(_0xfffa('0x2'));var BPromise=require(_0xfffa('0x3'));var rp=require(_0xfffa('0x4'));var fs=require('fs');var path=require(_0xfffa('0x5'));var rimraf=require(_0xfffa('0x6'));var config=require('../../config/environment');var attributes=require(_0xfffa('0x7'));module['exports']=function(_0x299474,_0x29cbb9){return _0x299474[_0xfffa('0x8')](_0xfffa('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xfffa('0xa'),'fields':[_0xfffa('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 aec6267..1432140 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 _0x04de=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0x5e9d31,_0x5c1932){var _0x55374a=function(_0x489d23){while(--_0x489d23){_0x5e9d31['push'](_0x5e9d31['shift']());}};_0x55374a(++_0x5c1932);}(_0x04de,0x107));var _0xe04d=function(_0x566250,_0x35ade6){_0x566250=_0x566250-0x0;var _0x30b8e4=_0x04de[_0x566250];return _0x30b8e4;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));var BPromise=require(_0xe04d('0x3'));var rs=require(_0xe04d('0x4'));var fs=require('fs');var Redis=require(_0xe04d('0x5'));var db=require(_0xe04d('0x6'))['db'];var utils=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var config=require(_0xe04d('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x531688,_0x55efb5,_0x210e93){return new BPromise(function(_0x72b1ce,_0x1be121){return client[_0xe04d('0xb')](_0x531688,_0x210e93)[_0xe04d('0xc')](function(_0x2ae3c9){logger[_0xe04d('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x55efb5,_0xe04d('0xe'));logger[_0xe04d('0xf')](_0xe04d('0x10'),_0x55efb5,_0xe04d('0xe'),JSON[_0xe04d('0x11')](_0x2ae3c9));if(_0x2ae3c9[_0xe04d('0x12')]){if(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x13')]===0x1f4){logger[_0xe04d('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x1be121(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x72b1ce(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}else{logger[_0xe04d('0xd')](_0xe04d('0x15'),_0x55efb5,'request\x20sent');_0x72b1ce(_0x2ae3c9[_0xe04d('0x16')]['message']);}})[_0xe04d('0x17')](function(_0x49c063){logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x49c063);_0x1be121(_0x49c063);});});} \ No newline at end of file +var _0x254a=['http','request','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x254a,0x138));var _0xa254=function(_0x350ec3,_0x1dcb41){_0x350ec3=_0x350ec3-0x0;var _0x1eef31=_0x254a[_0x350ec3];return _0x1eef31;};'use strict';var _=require(_0xa254('0x0'));var util=require(_0xa254('0x1'));var moment=require(_0xa254('0x2'));var BPromise=require('bluebird');var rs=require(_0xa254('0x3'));var fs=require('fs');var Redis=require(_0xa254('0x4'));var db=require(_0xa254('0x5'))['db'];var utils=require(_0xa254('0x6'));var logger=require('../../config/logger')(_0xa254('0x7'));var config=require('../../config/environment');var jayson=require(_0xa254('0x8'));var client=jayson[_0xa254('0x9')][_0xa254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597d72,_0x5951b2,_0xaeed42){return new BPromise(function(_0x352a44,_0x50c5a3){return client[_0xa254('0xb')](_0x597d72,_0xaeed42)['then'](function(_0x19d140){logger[_0xa254('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5951b2,'request\x20sent');logger[_0xa254('0xd')](_0xa254('0xe'),_0x5951b2,_0xa254('0xf'),JSON[_0xa254('0x10')](_0x19d140));if(_0x19d140[_0xa254('0x11')]){if(_0x19d140['error'][_0xa254('0x12')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x5951b2,_0x19d140[_0xa254('0x11')][_0xa254('0x13')]);return _0x50c5a3(_0x19d140['error'][_0xa254('0x13')]);}logger[_0xa254('0x11')](_0xa254('0x14'),_0x5951b2,_0x19d140[_0xa254('0x11')][_0xa254('0x13')]);return _0x352a44(_0x19d140['error'][_0xa254('0x13')]);}else{logger[_0xa254('0xc')](_0xa254('0x14'),_0x5951b2,_0xa254('0xf'));_0x352a44(_0x19d140[_0xa254('0x15')][_0xa254('0x13')]);}})[_0xa254('0x16')](function(_0x1f21ae){logger[_0xa254('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5951b2,_0x1f21ae);_0x50c5a3(_0x1f21ae);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index c65ad19..fc8c1ec 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 _0x359d=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x51f78b,_0x3ecad7){var _0x1a83d2=function(_0x3dfea4){while(--_0x3dfea4){_0x51f78b['push'](_0x51f78b['shift']());}};_0x1a83d2(++_0x3ecad7);}(_0x359d,0xeb));var _0xd359=function(_0x5d9ceb,_0x1a49f5){_0x5d9ceb=_0x5d9ceb-0x0;var _0x33ce82=_0x359d[_0x5d9ceb];return _0x33ce82;};'use strict';var multer=require('multer');var util=require(_0xd359('0x0'));var path=require('path');var timeout=require(_0xd359('0x1'));var express=require(_0xd359('0x2'));var router=express[_0xd359('0x3')]();var fs_extra=require(_0xd359('0x4'));var auth=require(_0xd359('0x5'));var interaction=require(_0xd359('0x6'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0xd359('0x7')]('/',auth[_0xd359('0x8')](),controller[_0xd359('0x9')]);router['get'](_0xd359('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd359('0xb')](_0xd359('0xa'),auth[_0xd359('0x8')](),controller[_0xd359('0xc')]);router[_0xd359('0xd')](_0xd359('0xa'),auth['isAuthenticated'](),controller[_0xd359('0xe')]);module[_0xd359('0xf')]=router; \ No newline at end of file +var _0xa6f0=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','show','post','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa6f0,0xea));var _0x0a6f=function(_0x445ca6,_0x2e26ff){_0x445ca6=_0x445ca6-0x0;var _0x20fbf1=_0xa6f0[_0x445ca6];return _0x20fbf1;};'use strict';var multer=require(_0x0a6f('0x0'));var util=require(_0x0a6f('0x1'));var path=require(_0x0a6f('0x2'));var timeout=require(_0x0a6f('0x3'));var express=require(_0x0a6f('0x4'));var router=express[_0x0a6f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0a6f('0x6'));var interaction=require(_0x0a6f('0x7'));var config=require('../../config/environment');var controller=require('./pause.controller');router['get']('/',auth[_0x0a6f('0x8')](),controller[_0x0a6f('0x9')]);router[_0x0a6f('0xa')]('/:id',auth[_0x0a6f('0x8')](),controller[_0x0a6f('0xb')]);router[_0x0a6f('0xc')]('/',auth[_0x0a6f('0x8')](),controller['create']);router[_0x0a6f('0xd')]('/:id',auth[_0x0a6f('0x8')](),controller['update']);router[_0x0a6f('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0a6f('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index dc68c3b..3828af0 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 _0xdd3b=['exports','STRING','sequelize'];(function(_0x161ad6,_0x426d20){var _0x1eb373=function(_0x353bad){while(--_0x353bad){_0x161ad6['push'](_0x161ad6['shift']());}};_0x1eb373(++_0x426d20);}(_0xdd3b,0xfe));var _0xbdd3=function(_0x199ebf,_0x48b072){_0x199ebf=_0x199ebf-0x0;var _0x110cff=_0xdd3b[_0x199ebf];return _0x110cff;};'use strict';var Sequelize=require(_0xbdd3('0x0'));module[_0xbdd3('0x1')]={'name':{'type':Sequelize[_0xbdd3('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x04ef=['exports','name','STRING','sequelize'];(function(_0x2617ee,_0xe08c15){var _0x3e6a64=function(_0x18a4e7){while(--_0x18a4e7){_0x2617ee['push'](_0x2617ee['shift']());}};_0x3e6a64(++_0xe08c15);}(_0x04ef,0x87));var _0xf04e=function(_0x2bd62e,_0x2ca33b){_0x2bd62e=_0x2bd62e-0x0;var _0x288101=_0x04ef[_0x2bd62e];return _0x288101;};'use strict';var Sequelize=require(_0xf04e('0x0'));module[_0xf04e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf04e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xf04e('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 74806e4..1d24432 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 _0x1944=['key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set','json','apply','save','then','destroy','Pauses','UserProfileResource','end','error','stack','name','send','index','map','Pause','rawAttributes'];(function(_0x2bab3f,_0x4ac846){var _0x5b2837=function(_0x41d799){while(--_0x41d799){_0x2bab3f['push'](_0x2bab3f['shift']());}};_0x5b2837(++_0x4ac846);}(_0x1944,0x171));var _0x4194=function(_0x5d5b8f,_0x31cbe2){_0x5d5b8f=_0x5d5b8f-0x0;var _0x3b2c6f=_0x1944[_0x5d5b8f];return _0x3b2c6f;};'use strict';var emlformat=require(_0x4194('0x0'));var rimraf=require(_0x4194('0x1'));var zipdir=require(_0x4194('0x2'));var jsonpatch=require(_0x4194('0x3'));var rp=require(_0x4194('0x4'));var moment=require(_0x4194('0x5'));var BPromise=require(_0x4194('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4194('0x7'));var sox=require(_0x4194('0x8'));var csv=require('to-csv');var ejs=require(_0x4194('0x9'));var fs=require('fs');var fs_extra=require(_0x4194('0xa'));var _=require(_0x4194('0xb'));var squel=require('squel');var crypto=require(_0x4194('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4194('0xd'));var querystring=require('querystring');var Papa=require(_0x4194('0xe'));var Redis=require(_0x4194('0xf'));var authService=require(_0x4194('0x10'));var qs=require(_0x4194('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4194('0x12'));var logger=require('../../config/logger')(_0x4194('0x13'));var utils=require('../../config/utils');var config=require(_0x4194('0x14'));var licenseUtil=require(_0x4194('0x15'));var db=require(_0x4194('0x16'))['db'];function respondWithStatusCode(_0x44f61a,_0x1b9d8d){_0x1b9d8d=_0x1b9d8d||0xcc;return function(_0x3ae853){if(_0x3ae853){return _0x44f61a[_0x4194('0x17')](_0x1b9d8d);}return _0x44f61a['status'](_0x1b9d8d)['end']();};}function respondWithResult(_0x31d432,_0x35d5bc){_0x35d5bc=_0x35d5bc||0xc8;return function(_0x381438){if(_0x381438){return _0x31d432['status'](_0x35d5bc)['json'](_0x381438);}};}function respondWithFilteredResult(_0x5bb6f3,_0xd57c05){return function(_0x302d3b){if(_0x302d3b){var _0x134902=typeof _0xd57c05[_0x4194('0x18')]===_0x4194('0x19')&&typeof _0xd57c05[_0x4194('0x1a')]==='undefined';var _0x11ab55=_0x302d3b[_0x4194('0x1b')];var _0x1eb94e=_0x134902?0x0:_0xd57c05[_0x4194('0x18')];var _0x10e7ce=_0x134902?_0x302d3b[_0x4194('0x1b')]:_0xd57c05[_0x4194('0x18')]+_0xd57c05[_0x4194('0x1a')];var _0x1963ba;if(_0x10e7ce>=_0x11ab55){_0x10e7ce=_0x11ab55;_0x1963ba=0xc8;}else{_0x1963ba=0xce;}_0x5bb6f3[_0x4194('0x1c')](_0x1963ba);return _0x5bb6f3[_0x4194('0x1d')]('Content-Range',_0x1eb94e+'-'+_0x10e7ce+'/'+_0x11ab55)[_0x4194('0x1e')](_0x302d3b);}return null;};}function patchUpdates(_0x5c5092){return function(_0x4dc92a){try{jsonpatch[_0x4194('0x1f')](_0x4dc92a,_0x5c5092,!![]);}catch(_0x50f121){return BPromise['reject'](_0x50f121);}return _0x4dc92a[_0x4194('0x20')]();};}function saveUpdates(_0x4565d5,_0x87113b){return function(_0x168a89){if(_0x168a89){return _0x168a89['update'](_0x4565d5)[_0x4194('0x21')](function(_0x1fe27c){return _0x1fe27c;});}return null;};}function removeEntity(_0x3dd3c9,_0xb7378e){return function(_0x584e59){if(_0x584e59){return _0x584e59[_0x4194('0x22')]()[_0x4194('0x21')](function(){var _0x3e136e=_0x584e59['get']({'plain':!![]});var _0x10b1b0=_0x4194('0x23');return db[_0x4194('0x24')][_0x4194('0x22')]({'where':{'type':_0x10b1b0,'resourceId':_0x3e136e['id']}})[_0x4194('0x21')](function(){return _0x584e59;});})[_0x4194('0x21')](function(){_0x3dd3c9[_0x4194('0x1c')](0xcc)[_0x4194('0x25')]();});}};}function handleEntityNotFound(_0x2d4082,_0x429d75){return function(_0x141a2c){if(!_0x141a2c){_0x2d4082[_0x4194('0x17')](0x194);}return _0x141a2c;};}function handleError(_0xc3290f,_0x219f89){_0x219f89=_0x219f89||0x1f4;return function(_0x404b0f){logger[_0x4194('0x26')](_0x404b0f[_0x4194('0x27')]);if(_0x404b0f[_0x4194('0x28')]){delete _0x404b0f[_0x4194('0x28')];}_0xc3290f[_0x4194('0x1c')](_0x219f89)[_0x4194('0x29')](_0x404b0f);};}exports[_0x4194('0x2a')]=function(_0x2bc18d,_0x537d7d){var _0x4b009c={},_0x476061={},_0x16af41={'count':0x0,'rows':[]};var _0x6249a1=_[_0x4194('0x2b')](db[_0x4194('0x2c')][_0x4194('0x2d')],function(_0x2d3951){return{'name':_0x2d3951['fieldName'],'type':_0x2d3951['type'][_0x4194('0x2e')]};});_0x476061[_0x4194('0x2f')]=_[_0x4194('0x2b')](_0x6249a1,'name');_0x476061[_0x4194('0x30')]=_['keys'](_0x2bc18d[_0x4194('0x30')]);_0x476061[_0x4194('0x31')]=_[_0x4194('0x32')](_0x476061['model'],_0x476061[_0x4194('0x30')]);_0x4b009c['attributes']=_['intersection'](_0x476061[_0x4194('0x2f')],qs[_0x4194('0x33')](_0x2bc18d[_0x4194('0x30')][_0x4194('0x33')]));_0x4b009c[_0x4194('0x34')]=_0x4b009c['attributes'][_0x4194('0x35')]?_0x4b009c[_0x4194('0x34')]:_0x476061[_0x4194('0x2f')];if(!_0x2bc18d[_0x4194('0x30')][_0x4194('0x36')]('nolimit')){_0x4b009c[_0x4194('0x1a')]=qs['limit'](_0x2bc18d[_0x4194('0x30')][_0x4194('0x1a')]);_0x4b009c[_0x4194('0x18')]=qs[_0x4194('0x18')](_0x2bc18d[_0x4194('0x30')]['offset']);}_0x4b009c[_0x4194('0x37')]=qs[_0x4194('0x38')](_0x2bc18d['query']['sort']);_0x4b009c[_0x4194('0x39')]=qs[_0x4194('0x31')](_[_0x4194('0x3a')](_0x2bc18d[_0x4194('0x30')],_0x476061['filters']),_0x6249a1);if(_0x2bc18d[_0x4194('0x30')][_0x4194('0x3b')]){_0x4b009c['where']=_[_0x4194('0x3c')](_0x4b009c['where'],{'$or':_[_0x4194('0x2b')](_0x6249a1,function(_0x5af776){if(_0x5af776['type']!==_0x4194('0x3d')){var _0x36f524={};_0x36f524[_0x5af776[_0x4194('0x28')]]={'$like':'%'+_0x2bc18d[_0x4194('0x30')][_0x4194('0x3b')]+'%'};return _0x36f524;}})});}_0x4b009c=_['merge']({},_0x4b009c,_0x2bc18d[_0x4194('0x3e')]);var _0x24fbee={'where':_0x4b009c[_0x4194('0x39')]};return db[_0x4194('0x2c')][_0x4194('0x1b')](_0x24fbee)[_0x4194('0x21')](function(_0x4557e0){_0x16af41[_0x4194('0x1b')]=_0x4557e0;if(_0x2bc18d[_0x4194('0x30')][_0x4194('0x3f')]){_0x4b009c[_0x4194('0x40')]=[{'all':!![]}];}return db[_0x4194('0x2c')][_0x4194('0x41')](_0x4b009c);})[_0x4194('0x21')](function(_0x384030){_0x16af41[_0x4194('0x42')]=_0x384030;return _0x16af41;})[_0x4194('0x21')](respondWithFilteredResult(_0x537d7d,_0x4b009c))[_0x4194('0x43')](handleError(_0x537d7d,null));};exports[_0x4194('0x44')]=function(_0x18ee7a,_0xc30053){var _0xe42865={'raw':!![],'where':{'id':_0x18ee7a[_0x4194('0x45')]['id']}},_0x3e4a6f={};_0x3e4a6f['model']=_['keys'](db['Pause'][_0x4194('0x2d')]);_0x3e4a6f[_0x4194('0x30')]=_[_0x4194('0x46')](_0x18ee7a[_0x4194('0x30')]);_0x3e4a6f[_0x4194('0x31')]=_[_0x4194('0x32')](_0x3e4a6f[_0x4194('0x2f')],_0x3e4a6f['query']);_0xe42865['attributes']=_[_0x4194('0x32')](_0x3e4a6f[_0x4194('0x2f')],qs['fields'](_0x18ee7a['query'][_0x4194('0x33')]));_0xe42865[_0x4194('0x34')]=_0xe42865[_0x4194('0x34')][_0x4194('0x35')]?_0xe42865[_0x4194('0x34')]:_0x3e4a6f['model'];if(_0x18ee7a[_0x4194('0x30')]['includeAll']){_0xe42865[_0x4194('0x40')]=[{'all':!![]}];}_0xe42865=_[_0x4194('0x3c')]({},_0xe42865,_0x18ee7a[_0x4194('0x3e')]);return db[_0x4194('0x2c')][_0x4194('0x47')](_0xe42865)[_0x4194('0x21')](handleEntityNotFound(_0xc30053,null))[_0x4194('0x21')](respondWithResult(_0xc30053,null))['catch'](handleError(_0xc30053,null));};exports[_0x4194('0x48')]=function(_0x140e96,_0x174e52){return db[_0x4194('0x2c')][_0x4194('0x48')](_0x140e96[_0x4194('0x49')],{})[_0x4194('0x21')](function(_0x5a4459){var _0x56424e=_0x140e96[_0x4194('0x4a')]['get']({'plain':!![]});if(!_0x56424e)throw new Error(_0x4194('0x4b'));if(_0x56424e[_0x4194('0x4c')]==='user'){var _0x25d528=_0x5a4459[_0x4194('0x4d')]({'plain':!![]});var _0x1ba313=_0x4194('0x23');return db[_0x4194('0x4e')][_0x4194('0x47')]({'where':{'name':_0x1ba313,'userProfileId':_0x56424e[_0x4194('0x4f')]},'raw':!![]})[_0x4194('0x21')](function(_0x1ee8d0){if(_0x1ee8d0&&_0x1ee8d0[_0x4194('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x25d528[_0x4194('0x28')],'resourceId':_0x25d528['id'],'type':_0x1ee8d0[_0x4194('0x28')],'sectionId':_0x1ee8d0['id']},{})[_0x4194('0x21')](function(){return _0x5a4459;});}else{return _0x5a4459;}})[_0x4194('0x43')](function(_0x372e6a){logger['error'](_0x4194('0x51'),_0x372e6a);throw _0x372e6a;});}return _0x5a4459;})[_0x4194('0x21')](respondWithResult(_0x174e52,0xc9))[_0x4194('0x43')](handleError(_0x174e52,null));};exports[_0x4194('0x52')]=function(_0x563869,_0x531fbc){if(_0x563869[_0x4194('0x49')]['id']){delete _0x563869[_0x4194('0x49')]['id'];}return db[_0x4194('0x2c')][_0x4194('0x47')]({'where':{'id':_0x563869[_0x4194('0x45')]['id']}})['then'](handleEntityNotFound(_0x531fbc,null))[_0x4194('0x21')](saveUpdates(_0x563869[_0x4194('0x49')],null))[_0x4194('0x21')](respondWithResult(_0x531fbc,null))[_0x4194('0x43')](handleError(_0x531fbc,null));};exports['destroy']=function(_0x4a7fa9,_0x153aae){return db[_0x4194('0x2c')][_0x4194('0x47')]({'where':{'id':_0x4a7fa9[_0x4194('0x45')]['id']}})[_0x4194('0x21')](handleEntityNotFound(_0x153aae,null))[_0x4194('0x21')](removeEntity(_0x153aae,null))[_0x4194('0x43')](handleError(_0x153aae,null));}; \ No newline at end of file +var _0x1a38=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','name','send','index','Pause','fieldName','key','model','query','keys'];(function(_0x212252,_0x565fc8){var _0x438284=function(_0x37225a){while(--_0x37225a){_0x212252['push'](_0x212252['shift']());}};_0x438284(++_0x565fc8);}(_0x1a38,0x121));var _0x81a3=function(_0x3cf4d3,_0x48065e){_0x3cf4d3=_0x3cf4d3-0x0;var _0x4e547b=_0x1a38[_0x3cf4d3];return _0x4e547b;};'use strict';var emlformat=require(_0x81a3('0x0'));var rimraf=require(_0x81a3('0x1'));var zipdir=require(_0x81a3('0x2'));var jsonpatch=require(_0x81a3('0x3'));var rp=require(_0x81a3('0x4'));var moment=require(_0x81a3('0x5'));var BPromise=require(_0x81a3('0x6'));var Mustache=require('mustache');var util=require(_0x81a3('0x7'));var path=require(_0x81a3('0x8'));var sox=require(_0x81a3('0x9'));var csv=require(_0x81a3('0xa'));var ejs=require(_0x81a3('0xb'));var fs=require('fs');var fs_extra=require(_0x81a3('0xc'));var _=require('lodash');var squel=require(_0x81a3('0xd'));var crypto=require(_0x81a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x81a3('0xa'));var querystring=require(_0x81a3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x81a3('0x10'));var qs=require(_0x81a3('0x11'));var as=require(_0x81a3('0x12'));var hardwareService=require(_0x81a3('0x13'));var logger=require(_0x81a3('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x81a3('0x15'));var db=require(_0x81a3('0x16'))['db'];function respondWithStatusCode(_0xc40b46,_0x3a9424){_0x3a9424=_0x3a9424||0xcc;return function(_0x5ccf2d){if(_0x5ccf2d){return _0xc40b46[_0x81a3('0x17')](_0x3a9424);}return _0xc40b46[_0x81a3('0x18')](_0x3a9424)[_0x81a3('0x19')]();};}function respondWithResult(_0x536fb2,_0x51f1e2){_0x51f1e2=_0x51f1e2||0xc8;return function(_0x5825ba){if(_0x5825ba){return _0x536fb2[_0x81a3('0x18')](_0x51f1e2)[_0x81a3('0x1a')](_0x5825ba);}};}function respondWithFilteredResult(_0x2d2f71,_0x538b9c){return function(_0x538ae5){if(_0x538ae5){var _0xe74acc=typeof _0x538b9c[_0x81a3('0x1b')]===_0x81a3('0x1c')&&typeof _0x538b9c['limit']===_0x81a3('0x1c');var _0x3ab91d=_0x538ae5[_0x81a3('0x1d')];var _0x43cd36=_0xe74acc?0x0:_0x538b9c[_0x81a3('0x1b')];var _0x3b326a=_0xe74acc?_0x538ae5['count']:_0x538b9c[_0x81a3('0x1b')]+_0x538b9c[_0x81a3('0x1e')];var _0x3604d8;if(_0x3b326a>=_0x3ab91d){_0x3b326a=_0x3ab91d;_0x3604d8=0xc8;}else{_0x3604d8=0xce;}_0x2d2f71[_0x81a3('0x18')](_0x3604d8);return _0x2d2f71[_0x81a3('0x1f')]('Content-Range',_0x43cd36+'-'+_0x3b326a+'/'+_0x3ab91d)['json'](_0x538ae5);}return null;};}function patchUpdates(_0x2d8ed1){return function(_0xcdb0b1){try{jsonpatch[_0x81a3('0x20')](_0xcdb0b1,_0x2d8ed1,!![]);}catch(_0x14e1f6){return BPromise[_0x81a3('0x21')](_0x14e1f6);}return _0xcdb0b1[_0x81a3('0x22')]();};}function saveUpdates(_0x43d449,_0x3b911f){return function(_0x2bb9e4){if(_0x2bb9e4){return _0x2bb9e4[_0x81a3('0x23')](_0x43d449)[_0x81a3('0x24')](function(_0x4f7fd5){return _0x4f7fd5;});}return null;};}function removeEntity(_0x45e891,_0x1efc03){return function(_0x11d172){if(_0x11d172){return _0x11d172[_0x81a3('0x25')]()[_0x81a3('0x24')](function(){var _0x244eb3=_0x11d172[_0x81a3('0x26')]({'plain':!![]});var _0x1eb7c0=_0x81a3('0x27');return db[_0x81a3('0x28')][_0x81a3('0x25')]({'where':{'type':_0x1eb7c0,'resourceId':_0x244eb3['id']}})['then'](function(){return _0x11d172;});})[_0x81a3('0x24')](function(){_0x45e891[_0x81a3('0x18')](0xcc)[_0x81a3('0x19')]();});}};}function handleEntityNotFound(_0x10fe15,_0x57742c){return function(_0x5d2be8){if(!_0x5d2be8){_0x10fe15[_0x81a3('0x17')](0x194);}return _0x5d2be8;};}function handleError(_0x56c916,_0x3d6a26){_0x3d6a26=_0x3d6a26||0x1f4;return function(_0x59d654){logger[_0x81a3('0x29')](_0x59d654['stack']);if(_0x59d654[_0x81a3('0x2a')]){delete _0x59d654[_0x81a3('0x2a')];}_0x56c916[_0x81a3('0x18')](_0x3d6a26)[_0x81a3('0x2b')](_0x59d654);};}exports[_0x81a3('0x2c')]=function(_0x5d19b9,_0x5d09a2){var _0x57a73c={},_0x85cbcc={},_0x30fe05={'count':0x0,'rows':[]};var _0x5dae9f=_['map'](db[_0x81a3('0x2d')]['rawAttributes'],function(_0x204576){return{'name':_0x204576[_0x81a3('0x2e')],'type':_0x204576['type'][_0x81a3('0x2f')]};});_0x85cbcc[_0x81a3('0x30')]=_['map'](_0x5dae9f,_0x81a3('0x2a'));_0x85cbcc[_0x81a3('0x31')]=_[_0x81a3('0x32')](_0x5d19b9[_0x81a3('0x31')]);_0x85cbcc[_0x81a3('0x33')]=_[_0x81a3('0x34')](_0x85cbcc['model'],_0x85cbcc[_0x81a3('0x31')]);_0x57a73c[_0x81a3('0x35')]=_['intersection'](_0x85cbcc[_0x81a3('0x30')],qs[_0x81a3('0x36')](_0x5d19b9['query']['fields']));_0x57a73c[_0x81a3('0x35')]=_0x57a73c[_0x81a3('0x35')][_0x81a3('0x37')]?_0x57a73c['attributes']:_0x85cbcc['model'];if(!_0x5d19b9[_0x81a3('0x31')][_0x81a3('0x38')](_0x81a3('0x39'))){_0x57a73c[_0x81a3('0x1e')]=qs[_0x81a3('0x1e')](_0x5d19b9[_0x81a3('0x31')][_0x81a3('0x1e')]);_0x57a73c['offset']=qs['offset'](_0x5d19b9[_0x81a3('0x31')][_0x81a3('0x1b')]);}_0x57a73c[_0x81a3('0x3a')]=qs[_0x81a3('0x3b')](_0x5d19b9[_0x81a3('0x31')][_0x81a3('0x3b')]);_0x57a73c[_0x81a3('0x3c')]=qs[_0x81a3('0x33')](_[_0x81a3('0x3d')](_0x5d19b9[_0x81a3('0x31')],_0x85cbcc[_0x81a3('0x33')]),_0x5dae9f);if(_0x5d19b9['query']['filter']){_0x57a73c[_0x81a3('0x3c')]=_['merge'](_0x57a73c[_0x81a3('0x3c')],{'$or':_['map'](_0x5dae9f,function(_0x38acab){if(_0x38acab[_0x81a3('0x3e')]!==_0x81a3('0x3f')){var _0x3598b4={};_0x3598b4[_0x38acab['name']]={'$like':'%'+_0x5d19b9[_0x81a3('0x31')][_0x81a3('0x40')]+'%'};return _0x3598b4;}})});}_0x57a73c=_[_0x81a3('0x41')]({},_0x57a73c,_0x5d19b9[_0x81a3('0x42')]);var _0x2be454={'where':_0x57a73c[_0x81a3('0x3c')]};return db['Pause'][_0x81a3('0x1d')](_0x2be454)[_0x81a3('0x24')](function(_0x14eefc){_0x30fe05[_0x81a3('0x1d')]=_0x14eefc;if(_0x5d19b9['query'][_0x81a3('0x43')]){_0x57a73c[_0x81a3('0x44')]=[{'all':!![]}];}return db[_0x81a3('0x2d')][_0x81a3('0x45')](_0x57a73c);})[_0x81a3('0x24')](function(_0x41cf08){_0x30fe05[_0x81a3('0x46')]=_0x41cf08;return _0x30fe05;})[_0x81a3('0x24')](respondWithFilteredResult(_0x5d09a2,_0x57a73c))[_0x81a3('0x47')](handleError(_0x5d09a2,null));};exports[_0x81a3('0x48')]=function(_0x43614e,_0x1006d1){var _0x4f6c19={'raw':!![],'where':{'id':_0x43614e[_0x81a3('0x49')]['id']}},_0x22655c={};_0x22655c[_0x81a3('0x30')]=_[_0x81a3('0x32')](db[_0x81a3('0x2d')][_0x81a3('0x4a')]);_0x22655c[_0x81a3('0x31')]=_['keys'](_0x43614e[_0x81a3('0x31')]);_0x22655c[_0x81a3('0x33')]=_[_0x81a3('0x34')](_0x22655c[_0x81a3('0x30')],_0x22655c[_0x81a3('0x31')]);_0x4f6c19[_0x81a3('0x35')]=_['intersection'](_0x22655c['model'],qs[_0x81a3('0x36')](_0x43614e['query'][_0x81a3('0x36')]));_0x4f6c19[_0x81a3('0x35')]=_0x4f6c19[_0x81a3('0x35')][_0x81a3('0x37')]?_0x4f6c19[_0x81a3('0x35')]:_0x22655c[_0x81a3('0x30')];if(_0x43614e[_0x81a3('0x31')][_0x81a3('0x43')]){_0x4f6c19[_0x81a3('0x44')]=[{'all':!![]}];}_0x4f6c19=_[_0x81a3('0x41')]({},_0x4f6c19,_0x43614e['options']);return db['Pause'][_0x81a3('0x4b')](_0x4f6c19)[_0x81a3('0x24')](handleEntityNotFound(_0x1006d1,null))['then'](respondWithResult(_0x1006d1,null))['catch'](handleError(_0x1006d1,null));};exports['create']=function(_0x500ecc,_0x243131){return db[_0x81a3('0x2d')][_0x81a3('0x4c')](_0x500ecc['body'],{})[_0x81a3('0x24')](function(_0x4ea43c){var _0x43bd42=_0x500ecc[_0x81a3('0x4d')][_0x81a3('0x26')]({'plain':!![]});if(!_0x43bd42)throw new Error(_0x81a3('0x4e'));if(_0x43bd42[_0x81a3('0x4f')]===_0x81a3('0x4d')){var _0x20a499=_0x4ea43c[_0x81a3('0x26')]({'plain':!![]});var _0x9f91b5='Pauses';return db[_0x81a3('0x50')][_0x81a3('0x4b')]({'where':{'name':_0x9f91b5,'userProfileId':_0x43bd42[_0x81a3('0x51')]},'raw':!![]})[_0x81a3('0x24')](function(_0x1e236e){if(_0x1e236e&&_0x1e236e[_0x81a3('0x52')]===0x0){return db['UserProfileResource'][_0x81a3('0x4c')]({'name':_0x20a499['name'],'resourceId':_0x20a499['id'],'type':_0x1e236e[_0x81a3('0x2a')],'sectionId':_0x1e236e['id']},{})[_0x81a3('0x24')](function(){return _0x4ea43c;});}else{return _0x4ea43c;}})['catch'](function(_0x44ff47){logger[_0x81a3('0x29')](_0x81a3('0x53'),_0x44ff47);throw _0x44ff47;});}return _0x4ea43c;})['then'](respondWithResult(_0x243131,0xc9))[_0x81a3('0x47')](handleError(_0x243131,null));};exports[_0x81a3('0x23')]=function(_0x3e88f3,_0xb949eb){if(_0x3e88f3[_0x81a3('0x54')]['id']){delete _0x3e88f3[_0x81a3('0x54')]['id'];}return db[_0x81a3('0x2d')][_0x81a3('0x4b')]({'where':{'id':_0x3e88f3['params']['id']}})[_0x81a3('0x24')](handleEntityNotFound(_0xb949eb,null))['then'](saveUpdates(_0x3e88f3[_0x81a3('0x54')],null))[_0x81a3('0x24')](respondWithResult(_0xb949eb,null))[_0x81a3('0x47')](handleError(_0xb949eb,null));};exports[_0x81a3('0x25')]=function(_0x4357d6,_0x37acb1){return db[_0x81a3('0x2d')][_0x81a3('0x4b')]({'where':{'id':_0x4357d6[_0x81a3('0x49')]['id']}})[_0x81a3('0x24')](handleEntityNotFound(_0x37acb1,null))[_0x81a3('0x24')](removeEntity(_0x37acb1,null))['catch'](handleError(_0x37acb1,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index acb1d22..165cdcc 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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x563cf9,_0x6f7d23){var _0x4d7ed0=function(_0x59b564){while(--_0x59b564){_0x563cf9['push'](_0x563cf9['shift']());}};_0x4d7ed0(++_0x6f7d23);}(_0xe14b,0x93));var _0xbe14=function(_0x13e5d8,_0x144c9b){_0x13e5d8=_0x13e5d8-0x0;var _0x5b464a=_0xe14b[_0x13e5d8];return _0x5b464a;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x7217,0x19e));var _0x7721=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7217[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 432f584..8fced61 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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x2e781e,_0x1b5395){var _0x3071b3=function(_0x2b9440){while(--_0x2b9440){_0x2e781e['push'](_0x2e781e['shift']());}};_0x3071b3(++_0x1b5395);}(_0xb10b,0x12a));var _0xbb10=function(_0xd63b06,_0x34850f){_0xd63b06=_0xd63b06-0x0;var _0x343035=_0xb10b[_0xd63b06];return _0x343035;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +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(_0x217e5a,_0x288544){var _0x8ac6f3=function(_0x1a0b91){while(--_0x1a0b91){_0x217e5a['push'](_0x217e5a['shift']());}};_0x8ac6f3(++_0x288544);}(_0x7a54,0x106));var _0x47a5=function(_0x54c178,_0xfb0ebc){_0x54c178=_0x54c178-0x0;var _0x294dbe=_0x7a54[_0x54c178];return _0x294dbe;};'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 e4c2756..2010b53 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 _0x4b19=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','index','webhookGet','/:id','show','isAuthenticated','download','diskStorage','root','server/files/plugins','originalname','replace','basename','post','single','file','/webhook','webhookPost','put','update','delete','multer'];(function(_0x1f239e,_0x367b43){var _0x826971=function(_0x2c5777){while(--_0x2c5777){_0x1f239e['push'](_0x1f239e['shift']());}};_0x826971(++_0x367b43);}(_0x4b19,0x195));var _0x94b1=function(_0x23cb78,_0x24dbe6){_0x23cb78=_0x23cb78-0x0;var _0x14aed3=_0x4b19[_0x23cb78];return _0x14aed3;};'use strict';var multer=require(_0x94b1('0x0'));var util=require('util');var path=require(_0x94b1('0x1'));var timeout=require(_0x94b1('0x2'));var express=require(_0x94b1('0x3'));var router=express['Router']();var fs_extra=require(_0x94b1('0x4'));var auth=require(_0x94b1('0x5'));var interaction=require(_0x94b1('0x6'));var config=require('../../config/environment');var controller=require(_0x94b1('0x7'));router[_0x94b1('0x8')]('/',auth['isAuthenticated'](),controller[_0x94b1('0x9')]);router[_0x94b1('0x8')]('/webhook',controller[_0x94b1('0xa')]);router[_0x94b1('0x8')](_0x94b1('0xb'),auth['isAuthenticated'](),controller[_0x94b1('0xc')]);router['get']('/:id/download',auth[_0x94b1('0xd')](),controller[_0x94b1('0xe')]);var upload=multer({'storage':multer[_0x94b1('0xf')]({'destination':function(_0x8ddf47,_0x162995,_0x3aeb91){_0x3aeb91(null,path['join'](config[_0x94b1('0x10')],_0x94b1('0x11')));},'filename':function(_0x340a29,_0x2b378c,_0x5cbf96){_0x2b378c['originalname']=_0x2b378c[_0x94b1('0x12')][_0x94b1('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5cbf96(null,util['format']('%s-%s%s',path[_0x94b1('0x14')](_0x2b378c[_0x94b1('0x12')],path['extname'](_0x2b378c[_0x94b1('0x12')])),Date['now'](),path['extname'](_0x2b378c[_0x94b1('0x12')])));}})});router[_0x94b1('0x15')]('/',upload[_0x94b1('0x16')](_0x94b1('0x17')),controller['upload']);router[_0x94b1('0x15')](_0x94b1('0x18'),controller[_0x94b1('0x19')]);router[_0x94b1('0x1a')](_0x94b1('0xb'),auth[_0x94b1('0xd')](),controller[_0x94b1('0x1b')]);router['delete'](_0x94b1('0xb'),auth[_0x94b1('0xd')](),controller[_0x94b1('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xa41a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','webhookGet','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','/webhook','webhookPost','put','/:id','update','delete','exports','multer'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xa41a,0x6b));var _0xaa41=function(_0x330dfa,_0x202de7){_0x330dfa=_0x330dfa-0x0;var _0x1fdbfe=_0xa41a[_0x330dfa];return _0x1fdbfe;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var fs_extra=require(_0xaa41('0x5'));var auth=require(_0xaa41('0x6'));var interaction=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var controller=require(_0xaa41('0x9'));router['get']('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0xb')]);router['get']('/webhook',controller[_0xaa41('0xc')]);router[_0xaa41('0xd')]('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xd')](_0xaa41('0xf'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x10')]);var upload=multer({'storage':multer[_0xaa41('0x11')]({'destination':function(_0x423a19,_0x1c291e,_0x5c9fc7){_0x5c9fc7(null,path[_0xaa41('0x12')](config[_0xaa41('0x13')],'server/files/plugins'));},'filename':function(_0x54827c,_0x1d0a54,_0x518b5b){_0x1d0a54[_0xaa41('0x14')]=_0x1d0a54[_0xaa41('0x14')][_0xaa41('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x518b5b(null,util[_0xaa41('0x16')](_0xaa41('0x17'),path['basename'](_0x1d0a54[_0xaa41('0x14')],path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])),Date[_0xaa41('0x19')](),path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])));}})});router[_0xaa41('0x1a')]('/',upload['single'](_0xaa41('0x1b')),controller[_0xaa41('0x1c')]);router[_0xaa41('0x1a')](_0xaa41('0x1d'),controller[_0xaa41('0x1e')]);router[_0xaa41('0x1f')](_0xaa41('0x20'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x21')]);router['delete']('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0x22')]);module[_0xaa41('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 5e9bf0b..a47108c 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 _0x25e4=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script','TEXT'];(function(_0x15ea60,_0x3fc946){var _0x5a7d49=function(_0x4ade00){while(--_0x4ade00){_0x15ea60['push'](_0x15ea60['shift']());}};_0x5a7d49(++_0x3fc946);}(_0x25e4,0x112));var _0x425e=function(_0x1cde7d,_0x249890){_0x1cde7d=_0x1cde7d-0x0;var _0x1f8edc=_0x25e4[_0x1cde7d];return _0x1f8edc;};'use strict';var Sequelize=require(_0x425e('0x0'));module['exports']={'name':{'type':Sequelize[_0x425e('0x1')]},'type':{'type':Sequelize[_0x425e('0x2')](_0x425e('0x3'),_0x425e('0x4'))},'description':{'type':Sequelize[_0x425e('0x5')]},'version':{'type':Sequelize[_0x425e('0x5')]},'path':{'type':Sequelize[_0x425e('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x425e('0x2')]('adminOnly',_0x425e('0x6'),_0x425e('0x7'),_0x425e('0x8')),'defaultValue':'always','comment':_0x425e('0x9')},'icon':{'type':Sequelize[_0x425e('0x1')]},'adminUrl':{'type':Sequelize[_0x425e('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x425e('0x1')]}}; \ No newline at end of file +var _0x3be5=['sequelize','STRING','ENUM','html','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never'];(function(_0x3bd53e,_0x456399){var _0x42797c=function(_0x284c93){while(--_0x284c93){_0x3bd53e['push'](_0x3bd53e['shift']());}};_0x42797c(++_0x456399);}(_0x3be5,0x155));var _0x53be=function(_0x1d9850,_0x3bf130){_0x1d9850=_0x1d9850-0x0;var _0x486902=_0x3be5[_0x1d9850];return _0x486902;};'use strict';var Sequelize=require(_0x53be('0x0'));module['exports']={'name':{'type':Sequelize[_0x53be('0x1')]},'type':{'type':Sequelize[_0x53be('0x2')](_0x53be('0x3'),'script')},'description':{'type':Sequelize[_0x53be('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x53be('0x5')],'defaultValue':0x0,'comment':_0x53be('0x6')},'sidebar':{'type':Sequelize[_0x53be('0x2')](_0x53be('0x7'),_0x53be('0x8'),_0x53be('0x9'),_0x53be('0xa')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x53be('0x1')]},'adminUrl':{'type':Sequelize[_0x53be('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x53be('0x1')]},'scriptPath':{'type':Sequelize[_0x53be('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 2651cdd..341d263 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 _0xc9e4=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','include','find','catch','download','params','root','format','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','server/files/plugins','dirname','node_modules/**/*','join','attachments/**/*','close','existsSync','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','userProfileId','user','UserProfileSection','Plugins','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','update','webhookGet','resolve','hostname','http://localhost:','port','encoding','%s%s','headers','content-length','content-type','set','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','method','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver'];(function(_0x499bd9,_0x51a209){var _0x5eb275=function(_0x4ce722){while(--_0x4ce722){_0x499bd9['push'](_0x499bd9['shift']());}};_0x5eb275(++_0x51a209);}(_0xc9e4,0x1ec));var _0x4c9e=function(_0x4ae578,_0x47156f){_0x4ae578=_0x4ae578-0x0;var _0x386e83=_0xc9e4[_0x4ae578];return _0x386e83;};'use strict';var emlformat=require(_0x4c9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c9e('0x1'));var jsonpatch=require(_0x4c9e('0x2'));var rp=require(_0x4c9e('0x3'));var moment=require(_0x4c9e('0x4'));var BPromise=require(_0x4c9e('0x5'));var Mustache=require(_0x4c9e('0x6'));var util=require(_0x4c9e('0x7'));var path=require(_0x4c9e('0x8'));var sox=require('sox');var csv=require(_0x4c9e('0x9'));var ejs=require(_0x4c9e('0xa'));var fs=require('fs');var fs_extra=require(_0x4c9e('0xb'));var _=require(_0x4c9e('0xc'));var squel=require('squel');var crypto=require(_0x4c9e('0xd'));var jsforce=require(_0x4c9e('0xe'));var deskjs=require(_0x4c9e('0xf'));var toCsv=require(_0x4c9e('0x9'));var querystring=require(_0x4c9e('0x10'));var Papa=require(_0x4c9e('0x11'));var extract=require(_0x4c9e('0x12'));var rimraf=require(_0x4c9e('0x13'));var archiver=require(_0x4c9e('0x14'));var Redis=require('ioredis');var authService=require(_0x4c9e('0x15'));var qs=require(_0x4c9e('0x16'));var as=require(_0x4c9e('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4c9e('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4c9e('0x19'));var db=require(_0x4c9e('0x1a'))['db'];config[_0x4c9e('0x1b')]=_[_0x4c9e('0x1c')](config[_0x4c9e('0x1b')],{'host':_0x4c9e('0x1d'),'port':0x18eb});var socket=require(_0x4c9e('0x1e'))(new Redis(config[_0x4c9e('0x1b')]));require('./plugin.socket')[_0x4c9e('0x1f')](socket);function respondWithStatusCode(_0x425cea,_0x4d0507){_0x4d0507=_0x4d0507||0xcc;return function(_0x531114){if(_0x531114){return _0x425cea[_0x4c9e('0x20')](_0x4d0507);}return _0x425cea[_0x4c9e('0x21')](_0x4d0507)[_0x4c9e('0x22')]();};}function respondWithResult(_0x4a7535,_0x27ba29){_0x27ba29=_0x27ba29||0xc8;return function(_0x378edf){if(_0x378edf){return _0x4a7535['status'](_0x27ba29)[_0x4c9e('0x23')](_0x378edf);}};}function respondWithFilteredResult(_0x3b88a3,_0x59b178){return function(_0xc4409a){if(_0xc4409a){var _0x5a0680=typeof _0x59b178[_0x4c9e('0x24')]==='undefined'&&typeof _0x59b178[_0x4c9e('0x25')]===_0x4c9e('0x26');var _0x3ddf44=_0xc4409a[_0x4c9e('0x27')];var _0x53ee4c=_0x5a0680?0x0:_0x59b178['offset'];var _0xfd3adf=_0x5a0680?_0xc4409a['count']:_0x59b178[_0x4c9e('0x24')]+_0x59b178[_0x4c9e('0x25')];var _0x3b3b1e;if(_0xfd3adf>=_0x3ddf44){_0xfd3adf=_0x3ddf44;_0x3b3b1e=0xc8;}else{_0x3b3b1e=0xce;}_0x3b88a3['status'](_0x3b3b1e);return _0x3b88a3['set'](_0x4c9e('0x28'),_0x53ee4c+'-'+_0xfd3adf+'/'+_0x3ddf44)[_0x4c9e('0x23')](_0xc4409a);}return null;};}function patchUpdates(_0xe81c83){return function(_0x3085a1){try{jsonpatch['apply'](_0x3085a1,_0xe81c83,!![]);}catch(_0x3e8fbf){return BPromise['reject'](_0x3e8fbf);}return _0x3085a1[_0x4c9e('0x29')]();};}function saveUpdates(_0x4ee89c,_0x2bb709){return function(_0x547745){if(_0x547745){return _0x547745['update'](_0x4ee89c)[_0x4c9e('0x2a')](function(_0x178fc6){return _0x178fc6;});}return null;};}function removeEntity(_0x366c2c,_0x384623){return function(_0x20776c){if(_0x20776c){return _0x20776c[_0x4c9e('0x2b')]()['then'](function(){var _0x2d7e07=_0x20776c[_0x4c9e('0x2c')]({'plain':!![]});var _0x1afaf7='Plugins';return db[_0x4c9e('0x2d')][_0x4c9e('0x2b')]({'where':{'type':_0x1afaf7,'resourceId':_0x2d7e07['id']}})['then'](function(){return _0x20776c;});})[_0x4c9e('0x2a')](function(){_0x366c2c[_0x4c9e('0x21')](0xcc)[_0x4c9e('0x22')]();});}};}function handleEntityNotFound(_0x9a169c,_0x515f53){return function(_0x5821cd){if(!_0x5821cd){_0x9a169c['sendStatus'](0x194);}return _0x5821cd;};}function handleError(_0x307f5b,_0x449c67){_0x449c67=_0x449c67||0x1f4;return function(_0x298563){logger[_0x4c9e('0x2e')](_0x298563[_0x4c9e('0x2f')]);if(_0x298563['name']){delete _0x298563[_0x4c9e('0x30')];}_0x307f5b[_0x4c9e('0x21')](_0x449c67)[_0x4c9e('0x31')](_0x298563);};}exports[_0x4c9e('0x32')]=function(_0x199f0d,_0x1d5b2b){var _0x930894={},_0x2ffaf7={},_0x32c841={'count':0x0,'rows':[]};var _0x5b6121=_[_0x4c9e('0x33')](db[_0x4c9e('0x34')][_0x4c9e('0x35')],function(_0x26adee){return{'name':_0x26adee[_0x4c9e('0x36')],'type':_0x26adee[_0x4c9e('0x37')][_0x4c9e('0x38')]};});_0x2ffaf7[_0x4c9e('0x39')]=_[_0x4c9e('0x33')](_0x5b6121,_0x4c9e('0x30'));_0x2ffaf7[_0x4c9e('0x3a')]=_[_0x4c9e('0x3b')](_0x199f0d['query']);_0x2ffaf7['filters']=_[_0x4c9e('0x3c')](_0x2ffaf7[_0x4c9e('0x39')],_0x2ffaf7[_0x4c9e('0x3a')]);_0x930894[_0x4c9e('0x3d')]=_['intersection'](_0x2ffaf7[_0x4c9e('0x39')],qs[_0x4c9e('0x3e')](_0x199f0d[_0x4c9e('0x3a')][_0x4c9e('0x3e')]));_0x930894['attributes']=_0x930894[_0x4c9e('0x3d')][_0x4c9e('0x3f')]?_0x930894[_0x4c9e('0x3d')]:_0x2ffaf7['model'];if(!_0x199f0d['query']['hasOwnProperty'](_0x4c9e('0x40'))){_0x930894[_0x4c9e('0x25')]=qs[_0x4c9e('0x25')](_0x199f0d[_0x4c9e('0x3a')][_0x4c9e('0x25')]);_0x930894[_0x4c9e('0x24')]=qs[_0x4c9e('0x24')](_0x199f0d[_0x4c9e('0x3a')][_0x4c9e('0x24')]);}_0x930894[_0x4c9e('0x41')]=qs[_0x4c9e('0x42')](_0x199f0d[_0x4c9e('0x3a')][_0x4c9e('0x42')]);_0x930894[_0x4c9e('0x43')]=qs[_0x4c9e('0x44')](_[_0x4c9e('0x45')](_0x199f0d[_0x4c9e('0x3a')],_0x2ffaf7[_0x4c9e('0x44')]),_0x5b6121);if(_0x199f0d[_0x4c9e('0x3a')][_0x4c9e('0x46')]){_0x930894[_0x4c9e('0x43')]=_['merge'](_0x930894[_0x4c9e('0x43')],{'$or':_['map'](_0x5b6121,function(_0xefc4bb){if(_0xefc4bb['type']!==_0x4c9e('0x47')){var _0x1d83b7={};_0x1d83b7[_0xefc4bb['name']]={'$like':'%'+_0x199f0d[_0x4c9e('0x3a')]['filter']+'%'};return _0x1d83b7;}})});}_0x930894=_[_0x4c9e('0x48')]({},_0x930894,_0x199f0d[_0x4c9e('0x49')]);var _0x9c0f5d={'where':_0x930894['where']};return db['Plugin'][_0x4c9e('0x27')](_0x9c0f5d)[_0x4c9e('0x2a')](function(_0x2ea007){_0x32c841[_0x4c9e('0x27')]=_0x2ea007;if(_0x199f0d[_0x4c9e('0x3a')][_0x4c9e('0x4a')]){_0x930894['include']=[{'all':!![]}];}return db[_0x4c9e('0x34')][_0x4c9e('0x4b')](_0x930894);})[_0x4c9e('0x2a')](function(_0x23953d){_0x32c841[_0x4c9e('0x4c')]=_0x23953d;return _0x32c841;})[_0x4c9e('0x2a')](respondWithFilteredResult(_0x1d5b2b,_0x930894))['catch'](handleError(_0x1d5b2b,null));};exports['show']=function(_0x867da1,_0x53388a){var _0x7d5213={'raw':!![],'where':{'id':_0x867da1['params']['id']}},_0x16e3a3={};_0x16e3a3['model']=_['keys'](db[_0x4c9e('0x34')][_0x4c9e('0x35')]);_0x16e3a3[_0x4c9e('0x3a')]=_[_0x4c9e('0x3b')](_0x867da1[_0x4c9e('0x3a')]);_0x16e3a3['filters']=_[_0x4c9e('0x3c')](_0x16e3a3[_0x4c9e('0x39')],_0x16e3a3[_0x4c9e('0x3a')]);_0x7d5213[_0x4c9e('0x3d')]=_[_0x4c9e('0x3c')](_0x16e3a3[_0x4c9e('0x39')],qs[_0x4c9e('0x3e')](_0x867da1['query'][_0x4c9e('0x3e')]));_0x7d5213['attributes']=_0x7d5213[_0x4c9e('0x3d')][_0x4c9e('0x3f')]?_0x7d5213[_0x4c9e('0x3d')]:_0x16e3a3[_0x4c9e('0x39')];if(_0x867da1['query'][_0x4c9e('0x4a')]){_0x7d5213[_0x4c9e('0x4d')]=[{'all':!![]}];}_0x7d5213=_[_0x4c9e('0x48')]({},_0x7d5213,_0x867da1['options']);return db[_0x4c9e('0x34')][_0x4c9e('0x4e')](_0x7d5213)[_0x4c9e('0x2a')](handleEntityNotFound(_0x53388a,null))['then'](respondWithResult(_0x53388a,null))[_0x4c9e('0x4f')](handleError(_0x53388a,null));};exports[_0x4c9e('0x50')]=function(_0x2907a5,_0x2ea86c,_0x2ceb1b){return db[_0x4c9e('0x34')][_0x4c9e('0x4e')]({'where':{'id':_0x2907a5[_0x4c9e('0x51')]['id']},'attributes':[_0x4c9e('0x30'),_0x4c9e('0x8')],'raw':!![]})[_0x4c9e('0x2a')](handleEntityNotFound(_0x2ea86c,null))[_0x4c9e('0x2a')](function(_0x30a42e){if(_0x30a42e){var _0x1f43b2=path['join'](config[_0x4c9e('0x52')],'server/files/plugins',util[_0x4c9e('0x53')]('%s.zip',path[_0x4c9e('0x54')](_0x30a42e['path'])));var _0x2dfdee=fs['createWriteStream'](_0x1f43b2);var _0x2abea2=archiver(_0x4c9e('0x55'),{'zlib':{'level':0x9}});_0x2abea2['on'](_0x4c9e('0x56'),function(_0x7406ba){if(_0x7406ba[_0x4c9e('0x57')]===_0x4c9e('0x58')){logger[_0x4c9e('0x2e')](_0x7406ba);}else{throw new db[(_0x4c9e('0x59'))][(_0x4c9e('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2abea2['on'](_0x4c9e('0x2e'),function(_0x61a51d){throw new db[(_0x4c9e('0x59'))]['Error'](_0x4c9e('0x5b'));});_0x2abea2[_0x4c9e('0x5c')](_0x2dfdee);_0x2abea2['glob'](_0x4c9e('0x5d'),{'cwd':path['join'](config[_0x4c9e('0x52')],_0x4c9e('0x5e'),path[_0x4c9e('0x5f')](_0x30a42e['path'])),'ignore':[path['join'](path['basename'](_0x30a42e[_0x4c9e('0x8')]),_0x4c9e('0x60')),path[_0x4c9e('0x61')](path[_0x4c9e('0x54')](_0x30a42e[_0x4c9e('0x8')]),_0x4c9e('0x62'))],'nodir':!![]})['finalize']();_0x2dfdee['on'](_0x4c9e('0x63'),function(){if(!fs[_0x4c9e('0x64')](_0x1f43b2)){throw new db['Sequelize'][(_0x4c9e('0x5a'))]('Plugin\x20not\x20found');}return _0x2ea86c[_0x4c9e('0x50')](_0x1f43b2,util[_0x4c9e('0x53')](_0x4c9e('0x65'),path[_0x4c9e('0x54')](_0x30a42e[_0x4c9e('0x8')])),function(_0x18a99c){if(_0x18a99c){throw new db[(_0x4c9e('0x59'))]['Error'](_0x4c9e('0x66'));}fs[_0x4c9e('0x67')](_0x1f43b2);logger[_0x4c9e('0x68')](_0x4c9e('0x69'));logger[_0x4c9e('0x68')](_0x4c9e('0x6a'));});});}return null;})[_0x4c9e('0x4f')](handleError(_0x2ea86c,null));};exports[_0x4c9e('0x6b')]=function(_0x3e44c6,_0x233edd,_0x53c49e){var _0x1240d1=path[_0x4c9e('0x54')](_0x3e44c6[_0x4c9e('0x6c')]['filename'],path[_0x4c9e('0x6d')](_0x3e44c6[_0x4c9e('0x6c')][_0x4c9e('0x6e')]));var _0x495c5e=path['join'](config['root'],_0x4c9e('0x5e'),_0x3e44c6[_0x4c9e('0x6c')][_0x4c9e('0x6e')]);var _0x17ffaf=path[_0x4c9e('0x61')](config[_0x4c9e('0x52')],_0x4c9e('0x5e'),_0x1240d1);logger[_0x4c9e('0x68')](_0x4c9e('0x6f'),_0x495c5e);logger[_0x4c9e('0x68')]('Plugin\x20upload\x20destination:\x20%s',_0x17ffaf);try{fs['chmodSync'](_0x495c5e,parseInt(_0x4c9e('0x70'),0x8));extract(_0x495c5e,{'dir':_0x17ffaf},function(_0x351816){if(_0x351816){logger[_0x4c9e('0x2e')](_0x351816);handleError(_0x351816,!![]);};var _0x2f7726=fs['readdirSync'](_0x17ffaf);if(_0x2f7726['length']>0x1){removeReferences(_0x495c5e,_0x17ffaf);logger[_0x4c9e('0x2e')](_0x4c9e('0x71'));return _0x53c49e(new Error(_0x4c9e('0x71')));}var _0x254857=fs[_0x4c9e('0x72')](path[_0x4c9e('0x61')](_0x17ffaf,_0x2f7726[0x0]));if(_0x254857[_0x4c9e('0x73')]()){removeReferences(_0x495c5e,_0x17ffaf);logger[_0x4c9e('0x2e')](_0x4c9e('0x71'));return _0x53c49e(new Error(_0x4c9e('0x71')));}if(_0x254857[_0x4c9e('0x74')]()){var _0x50b483=fs[_0x4c9e('0x75')](path[_0x4c9e('0x61')](_0x17ffaf,_0x2f7726[0x0]));if(_0x50b483[_0x4c9e('0x3f')]===0x0){removeReferences(_0x495c5e,_0x17ffaf);logger[_0x4c9e('0x2e')](_0x4c9e('0x71'));return _0x53c49e(new Error(_0x4c9e('0x71')));}var _0x435969=_0x50b483[_0x4c9e('0x76')](function(_0x278f5e){return _0x278f5e===_0x4c9e('0x77');});if(!_0x435969){return _0x53c49e(new Error(_0x4c9e('0x78')));}var _0x3ab643=fs[_0x4c9e('0x79')](path['join'](_0x17ffaf,_0x2f7726[0x0],_0x4c9e('0x77')));var _0x1b111a=JSON['parse'](_0x3ab643);if(_0x4c9e('0x26')==typeof _0x1b111a['name']){return _0x53c49e(new Error(_0x4c9e('0x7a')));}if(_0x4c9e('0x26')==typeof _0x1b111a[_0x4c9e('0x37')]){return _0x53c49e(new Error(_0x4c9e('0x7b')));}if(_0x4c9e('0x26')==typeof _0x1b111a[_0x4c9e('0x7c')]){return _0x53c49e(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x4c9e('0x26')==typeof _0x1b111a[_0x4c9e('0x7d')]){return _0x53c49e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1b111a['type']===_0x4c9e('0x7e')){if('undefined'==typeof _0x1b111a[_0x4c9e('0x7d')][_0x4c9e('0x7f')]){return _0x53c49e(new Error(_0x4c9e('0x80')));}if(_0x4c9e('0x26')==typeof _0x1b111a[_0x4c9e('0x7d')][_0x4c9e('0x7f')][_0x4c9e('0x81')]&&_0x4c9e('0x26')==typeof _0x1b111a['parameters'][_0x4c9e('0x7f')][_0x4c9e('0x82')]){return _0x53c49e(new Error(_0x4c9e('0x83')));}}else if(_0x1b111a['type']===_0x4c9e('0x84')){if('undefined'==typeof _0x1b111a[_0x4c9e('0x7d')][_0x4c9e('0x85')]){return _0x53c49e(new Error(_0x4c9e('0x86')));}if('undefined'==typeof _0x1b111a[_0x4c9e('0x7d')][_0x4c9e('0x87')]){return _0x53c49e(new Error(_0x4c9e('0x88')));}}else{return _0x53c49e(new Error(_0x4c9e('0x89')));}var _0x2c9bf0=_0x1b111a[_0x4c9e('0x30')];var _0x489e1a=_0x1b111a[_0x4c9e('0x8a')];var _0x4f4c73=_0x1b111a['type'];var _0x2c1002=_0x1b111a[_0x4c9e('0x8b')]?_0x1b111a[_0x4c9e('0x8b')]:_0x4c9e('0x8c');var _0x40b2af=_0x1b111a[_0x4c9e('0x8d')]?_0x1b111a['icon']:_0x4c9e('0x8e');var _0x206ebd='';var _0x2715b9='';var _0xc454b6='';var _0x5a9434='';var _0x50ffd6=_0x1b111a[_0x4c9e('0x7c')];if(_0x4f4c73===_0x4c9e('0x7e')){if(_0x4c9e('0x26')!=typeof _0x1b111a['parameters']['views'][_0x4c9e('0x81')]){var _0x2187c9=_0x1b111a['parameters'][_0x4c9e('0x7f')][_0x4c9e('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x4c9e('0x8f')](_0x2187c9)){_0x206ebd=path[_0x4c9e('0x61')](_0x4c9e('0x90'),_0x1240d1,_0x2f7726[0x0],_0x2187c9);}else{_0x206ebd=_0x2187c9;}}else{logger[_0x4c9e('0x68')](_0x4c9e('0x91'));}if('undefined'!=typeof _0x1b111a[_0x4c9e('0x7d')][_0x4c9e('0x7f')]['agent']){var _0x514115=_0x1b111a['parameters'][_0x4c9e('0x7f')][_0x4c9e('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x4c9e('0x8f')](_0x514115)){_0x2715b9=path[_0x4c9e('0x61')]('plugins',_0x1240d1,_0x2f7726[0x0],_0x514115);}else{_0x2715b9=_0x514115;}}else{logger[_0x4c9e('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x4f4c73===_0x4c9e('0x84')){_0xc454b6=_0x1b111a['parameters']['scriptName'];_0x5a9434=_0x1b111a[_0x4c9e('0x7d')][_0x4c9e('0x87')];if(_0x4c9e('0x26')!=typeof _0x1b111a[_0x4c9e('0x7d')][_0x4c9e('0x7f')]){if(_0x4c9e('0x26')!=typeof _0x1b111a['parameters'][_0x4c9e('0x7f')]['admin']){var _0x2187c9=_0x1b111a[_0x4c9e('0x7d')][_0x4c9e('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x4c9e('0x8f')](_0x2187c9)){_0x206ebd=path['join'](_0x4c9e('0x90'),_0x1240d1,_0x2f7726[0x0],_0x2187c9);}else{_0x206ebd=_0x2187c9;}}if(_0x4c9e('0x26')!=typeof _0x1b111a[_0x4c9e('0x7d')][_0x4c9e('0x7f')][_0x4c9e('0x82')]){var _0x514115=_0x1b111a[_0x4c9e('0x7d')]['views'][_0x4c9e('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x4c9e('0x8f')](_0x514115)){_0x2715b9=path[_0x4c9e('0x61')](_0x4c9e('0x90'),_0x1240d1,_0x2f7726[0x0],_0x514115);}else{_0x2715b9=_0x514115;}}}}var _0x361fd8={'name':_0x2c9bf0,'description':_0x489e1a,'path':path[_0x4c9e('0x61')](_0x1240d1,_0x2f7726[0x0]),'type':_0x4f4c73,'sidebar':_0x2c1002,'icon':_0x40b2af,'adminUrl':_0x206ebd,'agentUrl':_0x2715b9,'scriptName':_0xc454b6,'scriptPath':_0x5a9434,'version':_0x50ffd6};removeReferences(_0x495c5e,null);return db[_0x4c9e('0x34')][_0x4c9e('0x92')](_0x361fd8)[_0x4c9e('0x2a')](function(_0x20c810){var _0x405e0b={'role':_0x3e44c6[_0x4c9e('0x93')][_0x4c9e('0x94')],'userProfileId':_0x3e44c6[_0x4c9e('0x93')][_0x4c9e('0x95')]};if(!_0x405e0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x405e0b['role']===_0x4c9e('0x96')){var _0x5348d0=_0x20c810[_0x4c9e('0x2c')]({'plain':!![]});return db[_0x4c9e('0x97')][_0x4c9e('0x4e')]({'where':{'name':_0x4c9e('0x98'),'userProfileId':_0x405e0b[_0x4c9e('0x95')]},'raw':!![]})['then'](function(_0xaa2516){if(_0xaa2516&&_0xaa2516['autoAssociation']===0x0){return db[_0x4c9e('0x2d')][_0x4c9e('0x92')]({'name':_0x5348d0[_0x4c9e('0x30')],'resourceId':_0x5348d0['id'],'type':_0xaa2516[_0x4c9e('0x30')],'sectionId':_0xaa2516['id']},{})[_0x4c9e('0x2a')](function(){return _0x20c810;});}else{return _0x20c810;}})[_0x4c9e('0x4f')](function(_0x4271a7){logger['error'](_0x4c9e('0x99'),_0x4271a7);throw _0x4271a7;});}return _0x20c810;})[_0x4c9e('0x2a')](respondWithResult(_0x233edd,null))['catch'](handleError(_0x233edd,null));}});}catch(_0x14efd4){_0x233edd[_0x4c9e('0x21')](0x1f4)[_0x4c9e('0x31')](_0x14efd4);}};function removeReferences(_0x5d567c,_0xff9041){try{if(_0x5d567c){fs[_0x4c9e('0x67')](_0x5d567c);logger[_0x4c9e('0x68')](_0x4c9e('0x9a'));}if(_0xff9041){rimraf(_0xff9041,function(){});logger[_0x4c9e('0x68')]('Extracted\x20folder\x20removed');}}catch(_0x5e9082){logger[_0x4c9e('0x2e')](_0x5e9082);}}exports[_0x4c9e('0x9b')]=function(_0x1f81cc,_0x19f81b,_0x3b0d69){return db[_0x4c9e('0x34')][_0x4c9e('0x4e')]({'where':{'id':_0x1f81cc[_0x4c9e('0x51')]['id']}})[_0x4c9e('0x2a')](handleEntityNotFound(_0x19f81b,null))[_0x4c9e('0x2a')](saveUpdates(_0x1f81cc[_0x4c9e('0x93')],null))['then'](respondWithResult(_0x19f81b,null))[_0x4c9e('0x4f')](handleError(_0x19f81b,null));};exports['delete']=function(_0x360db6,_0x31bb18,_0x468023){return db[_0x4c9e('0x34')][_0x4c9e('0x4e')]({'where':{'id':_0x360db6['params']['id']}})[_0x4c9e('0x2a')](function(_0xeb74e1){if(_0xeb74e1){return _0xeb74e1[_0x4c9e('0x2b')]();}})['then'](function(_0x511971){rimraf(path[_0x4c9e('0x61')](config[_0x4c9e('0x52')],_0x4c9e('0x5e'),path['dirname'](_0x511971[_0x4c9e('0x8')])),function(){});return _0x511971;})['then'](handleEntityNotFound(_0x31bb18,null))[_0x4c9e('0x2a')](respondWithStatusCode(_0x31bb18,null))[_0x4c9e('0x4f')](handleError(_0x31bb18,null));};exports[_0x4c9e('0x9c')]=function(_0x2ae181,_0x1eb183,_0x4bbd8e){return BPromise[_0x4c9e('0x9d')]()[_0x4c9e('0x2a')](function(){if(!_0x2ae181[_0x4c9e('0x3a')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2ae181['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x49181b=_0x2ae181[_0x4c9e('0x3a')][_0x4c9e('0x9e')]?_0x2ae181['query'][_0x4c9e('0x9e')]+':'+_0x2ae181[_0x4c9e('0x3a')]['port']:_0x4c9e('0x9f')+_0x2ae181[_0x4c9e('0x3a')][_0x4c9e('0xa0')];var _0x18e438=_0x2ae181[_0x4c9e('0x3a')][_0x4c9e('0x23')]?_0x2ae181[_0x4c9e('0x3a')][_0x4c9e('0x23')]:!![];var _0x465360=_0x2ae181['query'][_0x4c9e('0xa1')]?_0x2ae181[_0x4c9e('0x3a')]['encoding']:null;var _0x1afc92={'method':_0x2ae181['method'],'uri':util['format'](_0x4c9e('0xa2'),_0x49181b,_0x2ae181[_0x4c9e('0x3a')][_0x4c9e('0x8')]),'json':_0x18e438,'resolveWithFullResponse':!![],'encoding':_0x465360,'qs':_0x2ae181[_0x4c9e('0x3a')]};if(_0x2ae181[_0x4c9e('0xa3')]){_0x1afc92[_0x4c9e('0xa3')]=_0x2ae181['headers'];if(_0x1afc92[_0x4c9e('0xa3')][_0x4c9e('0xa4')]){delete _0x1afc92[_0x4c9e('0xa3')][_0x4c9e('0xa4')];}}if(_0x1afc92[_0x4c9e('0xa3')][_0x4c9e('0xa5')]){delete _0x1afc92[_0x4c9e('0xa3')][_0x4c9e('0xa5')];}return rp(_0x1afc92);})['then'](function(_0x1ecf29){if(_0x1ecf29){_0x1eb183[_0x4c9e('0xa6')](_0x1ecf29['headers']);logger[_0x4c9e('0x68')](_0x1ecf29[_0x4c9e('0x93')]);if(_['endsWith'](_0x2ae181[_0x4c9e('0x3a')][_0x4c9e('0x8')],_0x4c9e('0x50'))&&_0x1ecf29[_0x4c9e('0xa7')]==0x1f4){return _0x1eb183[_0x4c9e('0x20')](_0x1ecf29[_0x4c9e('0xa7')]);}else{return _0x1eb183['status'](_0x1ecf29[_0x4c9e('0xa7')])['send'](_0x1ecf29['body']);}}else{return _0x1eb183[_0x4c9e('0x20')](0xc8);}})[_0x4c9e('0x4f')](handleError(_0x1eb183,null));};exports[_0x4c9e('0xa8')]=function(_0x444f71,_0x42a536,_0x35e944){return BPromise[_0x4c9e('0x9d')]()[_0x4c9e('0x2a')](function(){if(!_0x444f71[_0x4c9e('0x3a')]['path']){throw new Error(_0x4c9e('0xa9'));}if(!_0x444f71[_0x4c9e('0x3a')][_0x4c9e('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0xda6487=_0x444f71[_0x4c9e('0x3a')][_0x4c9e('0x9e')]?_0x444f71[_0x4c9e('0x3a')][_0x4c9e('0x9e')]+':'+_0x444f71[_0x4c9e('0x3a')][_0x4c9e('0xa0')]:_0x4c9e('0x9f')+_0x444f71[_0x4c9e('0x3a')]['port'];var _0x584bbe=_0x444f71[_0x4c9e('0x3a')][_0x4c9e('0x23')]?_0x444f71[_0x4c9e('0x3a')][_0x4c9e('0x23')]:!![];var _0x5da11d=_0x444f71[_0x4c9e('0x3a')][_0x4c9e('0xa1')]?_0x444f71[_0x4c9e('0x3a')][_0x4c9e('0xa1')]:null;var _0x275d2e={'method':_0x444f71[_0x4c9e('0xaa')],'uri':util[_0x4c9e('0x53')](_0x4c9e('0xa2'),_0xda6487,_0x444f71[_0x4c9e('0x3a')][_0x4c9e('0x8')]),'json':_0x584bbe,'resolveWithFullResponse':!![],'encoding':_0x5da11d,'body':_0x444f71[_0x4c9e('0x93')]};if(_0x444f71[_0x4c9e('0xa3')]){_0x275d2e[_0x4c9e('0xa3')]=_0x444f71[_0x4c9e('0xa3')];if(_0x275d2e[_0x4c9e('0xa3')][_0x4c9e('0xa4')]){delete _0x275d2e[_0x4c9e('0xa3')][_0x4c9e('0xa4')];}}if(_0x275d2e[_0x4c9e('0xa3')][_0x4c9e('0xa5')]){delete _0x275d2e[_0x4c9e('0xa3')][_0x4c9e('0xa5')];}return rp(_0x275d2e);})['then'](function(_0x36ce3b){if(_0x36ce3b){_0x42a536[_0x4c9e('0xa6')](_0x36ce3b[_0x4c9e('0xa3')]);logger[_0x4c9e('0x68')](_0x36ce3b[_0x4c9e('0x93')]);return _0x42a536[_0x4c9e('0x21')](_0x36ce3b['statusCode'])[_0x4c9e('0x31')](_0x36ce3b[_0x4c9e('0x93')]);}else{return _0x42a536[_0x4c9e('0x20')](0xc8);}})[_0x4c9e('0x4f')](handleError(_0x42a536,null));}; \ No newline at end of file +var _0xc6bb=['eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','sendStatus','status','offset','limit','undefined','count','json','apply','reject','update','then','destroy','Plugins','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','params','fields','find','download','root','format','createWriteStream','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','**/*','server/files/plugins','dirname','join','finalize','close','Sequelize','Plugin\x20not\x20found','%s.zip','basename','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','filename','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','length','Invalid\x20plugin\x20structure','isDirectory','readdirSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','html','parameters','views','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','admin','test','plugins','agent','scriptName','scriptPath','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','create','send','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','set'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0xc6bb,0x13e));var _0xbc6b=function(_0x5260ed,_0x106050){_0x5260ed=_0x5260ed-0x0;var _0x3b7d14=_0xc6bb[_0x5260ed];return _0x3b7d14;};'use strict';var emlformat=require(_0xbc6b('0x0'));var rimraf=require(_0xbc6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbc6b('0x2'));var moment=require(_0xbc6b('0x3'));var BPromise=require(_0xbc6b('0x4'));var Mustache=require(_0xbc6b('0x5'));var util=require('util');var path=require(_0xbc6b('0x6'));var sox=require(_0xbc6b('0x7'));var csv=require('to-csv');var ejs=require(_0xbc6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbc6b('0x9'));var crypto=require(_0xbc6b('0xa'));var jsforce=require(_0xbc6b('0xb'));var deskjs=require(_0xbc6b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbc6b('0xd'));var Papa=require(_0xbc6b('0xe'));var extract=require(_0xbc6b('0xf'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbc6b('0x10'));var as=require(_0xbc6b('0x11'));var hardwareService=require(_0xbc6b('0x12'));var logger=require('../../config/logger')(_0xbc6b('0x13'));var utils=require(_0xbc6b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbc6b('0x15'));var db=require(_0xbc6b('0x16'))['db'];config[_0xbc6b('0x17')]=_[_0xbc6b('0x18')](config['redis'],{'host':_0xbc6b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc6b('0x17')]));require(_0xbc6b('0x1a'))[_0xbc6b('0x1b')](socket);function respondWithStatusCode(_0xab89f4,_0x8f7cd4){_0x8f7cd4=_0x8f7cd4||0xcc;return function(_0x5e4973){if(_0x5e4973){return _0xab89f4[_0xbc6b('0x1c')](_0x8f7cd4);}return _0xab89f4[_0xbc6b('0x1d')](_0x8f7cd4)['end']();};}function respondWithResult(_0x101140,_0x6b967a){_0x6b967a=_0x6b967a||0xc8;return function(_0x2efa3e){if(_0x2efa3e){return _0x101140[_0xbc6b('0x1d')](_0x6b967a)['json'](_0x2efa3e);}};}function respondWithFilteredResult(_0x564901,_0x38644c){return function(_0x1c3788){if(_0x1c3788){var _0x5a801e=typeof _0x38644c[_0xbc6b('0x1e')]==='undefined'&&typeof _0x38644c[_0xbc6b('0x1f')]===_0xbc6b('0x20');var _0x58a0d6=_0x1c3788[_0xbc6b('0x21')];var _0x3750be=_0x5a801e?0x0:_0x38644c[_0xbc6b('0x1e')];var _0x126f24=_0x5a801e?_0x1c3788[_0xbc6b('0x21')]:_0x38644c['offset']+_0x38644c['limit'];var _0x1050ee;if(_0x126f24>=_0x58a0d6){_0x126f24=_0x58a0d6;_0x1050ee=0xc8;}else{_0x1050ee=0xce;}_0x564901[_0xbc6b('0x1d')](_0x1050ee);return _0x564901['set']('Content-Range',_0x3750be+'-'+_0x126f24+'/'+_0x58a0d6)[_0xbc6b('0x22')](_0x1c3788);}return null;};}function patchUpdates(_0x47ecc2){return function(_0x1528f8){try{jsonpatch[_0xbc6b('0x23')](_0x1528f8,_0x47ecc2,!![]);}catch(_0x596ebf){return BPromise[_0xbc6b('0x24')](_0x596ebf);}return _0x1528f8['save']();};}function saveUpdates(_0x9f3764,_0x294bab){return function(_0x44e3e2){if(_0x44e3e2){return _0x44e3e2[_0xbc6b('0x25')](_0x9f3764)[_0xbc6b('0x26')](function(_0x28669f){return _0x28669f;});}return null;};}function removeEntity(_0x307764,_0x484cd6){return function(_0xead94){if(_0xead94){return _0xead94[_0xbc6b('0x27')]()['then'](function(){var _0x49268b=_0xead94['get']({'plain':!![]});var _0x17063b=_0xbc6b('0x28');return db[_0xbc6b('0x29')][_0xbc6b('0x27')]({'where':{'type':_0x17063b,'resourceId':_0x49268b['id']}})['then'](function(){return _0xead94;});})[_0xbc6b('0x26')](function(){_0x307764['status'](0xcc)[_0xbc6b('0x2a')]();});}};}function handleEntityNotFound(_0xf36ee6,_0x5f4d69){return function(_0x347f9a){if(!_0x347f9a){_0xf36ee6[_0xbc6b('0x1c')](0x194);}return _0x347f9a;};}function handleError(_0xb08531,_0x5b3e76){_0x5b3e76=_0x5b3e76||0x1f4;return function(_0x7cef61){logger[_0xbc6b('0x2b')](_0x7cef61[_0xbc6b('0x2c')]);if(_0x7cef61[_0xbc6b('0x2d')]){delete _0x7cef61[_0xbc6b('0x2d')];}_0xb08531[_0xbc6b('0x1d')](_0x5b3e76)['send'](_0x7cef61);};}exports[_0xbc6b('0x2e')]=function(_0x998c28,_0x21e43d){var _0x3999c5={},_0x49f8ac={},_0x1321c7={'count':0x0,'rows':[]};var _0x9d1b9a=_[_0xbc6b('0x2f')](db['Plugin'][_0xbc6b('0x30')],function(_0x144b74){return{'name':_0x144b74[_0xbc6b('0x31')],'type':_0x144b74[_0xbc6b('0x32')][_0xbc6b('0x33')]};});_0x49f8ac[_0xbc6b('0x34')]=_[_0xbc6b('0x2f')](_0x9d1b9a,_0xbc6b('0x2d'));_0x49f8ac[_0xbc6b('0x35')]=_[_0xbc6b('0x36')](_0x998c28[_0xbc6b('0x35')]);_0x49f8ac['filters']=_[_0xbc6b('0x37')](_0x49f8ac[_0xbc6b('0x34')],_0x49f8ac[_0xbc6b('0x35')]);_0x3999c5[_0xbc6b('0x38')]=_[_0xbc6b('0x37')](_0x49f8ac['model'],qs['fields'](_0x998c28[_0xbc6b('0x35')]['fields']));_0x3999c5['attributes']=_0x3999c5['attributes']['length']?_0x3999c5[_0xbc6b('0x38')]:_0x49f8ac['model'];if(!_0x998c28['query'][_0xbc6b('0x39')](_0xbc6b('0x3a'))){_0x3999c5[_0xbc6b('0x1f')]=qs[_0xbc6b('0x1f')](_0x998c28['query'][_0xbc6b('0x1f')]);_0x3999c5[_0xbc6b('0x1e')]=qs['offset'](_0x998c28[_0xbc6b('0x35')][_0xbc6b('0x1e')]);}_0x3999c5[_0xbc6b('0x3b')]=qs[_0xbc6b('0x3c')](_0x998c28['query']['sort']);_0x3999c5[_0xbc6b('0x3d')]=qs[_0xbc6b('0x3e')](_[_0xbc6b('0x3f')](_0x998c28[_0xbc6b('0x35')],_0x49f8ac[_0xbc6b('0x3e')]),_0x9d1b9a);if(_0x998c28[_0xbc6b('0x35')][_0xbc6b('0x40')]){_0x3999c5[_0xbc6b('0x3d')]=_[_0xbc6b('0x41')](_0x3999c5[_0xbc6b('0x3d')],{'$or':_[_0xbc6b('0x2f')](_0x9d1b9a,function(_0x553c3d){if(_0x553c3d['type']!==_0xbc6b('0x42')){var _0x3cc60c={};_0x3cc60c[_0x553c3d[_0xbc6b('0x2d')]]={'$like':'%'+_0x998c28[_0xbc6b('0x35')]['filter']+'%'};return _0x3cc60c;}})});}_0x3999c5=_[_0xbc6b('0x41')]({},_0x3999c5,_0x998c28[_0xbc6b('0x43')]);var _0x1787b2={'where':_0x3999c5[_0xbc6b('0x3d')]};return db[_0xbc6b('0x44')][_0xbc6b('0x21')](_0x1787b2)['then'](function(_0x5875dd){_0x1321c7[_0xbc6b('0x21')]=_0x5875dd;if(_0x998c28['query'][_0xbc6b('0x45')]){_0x3999c5[_0xbc6b('0x46')]=[{'all':!![]}];}return db[_0xbc6b('0x44')][_0xbc6b('0x47')](_0x3999c5);})['then'](function(_0x52122f){_0x1321c7[_0xbc6b('0x48')]=_0x52122f;return _0x1321c7;})[_0xbc6b('0x26')](respondWithFilteredResult(_0x21e43d,_0x3999c5))[_0xbc6b('0x49')](handleError(_0x21e43d,null));};exports['show']=function(_0x3352f0,_0xdd153b){var _0x23c044={'raw':!![],'where':{'id':_0x3352f0[_0xbc6b('0x4a')]['id']}},_0x30e131={};_0x30e131[_0xbc6b('0x34')]=_[_0xbc6b('0x36')](db[_0xbc6b('0x44')]['rawAttributes']);_0x30e131[_0xbc6b('0x35')]=_[_0xbc6b('0x36')](_0x3352f0[_0xbc6b('0x35')]);_0x30e131[_0xbc6b('0x3e')]=_[_0xbc6b('0x37')](_0x30e131[_0xbc6b('0x34')],_0x30e131['query']);_0x23c044[_0xbc6b('0x38')]=_['intersection'](_0x30e131[_0xbc6b('0x34')],qs['fields'](_0x3352f0[_0xbc6b('0x35')][_0xbc6b('0x4b')]));_0x23c044[_0xbc6b('0x38')]=_0x23c044[_0xbc6b('0x38')]['length']?_0x23c044[_0xbc6b('0x38')]:_0x30e131[_0xbc6b('0x34')];if(_0x3352f0[_0xbc6b('0x35')][_0xbc6b('0x45')]){_0x23c044[_0xbc6b('0x46')]=[{'all':!![]}];}_0x23c044=_['merge']({},_0x23c044,_0x3352f0[_0xbc6b('0x43')]);return db[_0xbc6b('0x44')][_0xbc6b('0x4c')](_0x23c044)[_0xbc6b('0x26')](handleEntityNotFound(_0xdd153b,null))[_0xbc6b('0x26')](respondWithResult(_0xdd153b,null))['catch'](handleError(_0xdd153b,null));};exports[_0xbc6b('0x4d')]=function(_0x3e695d,_0x40b1a6,_0x51e284){return db['Plugin']['find']({'where':{'id':_0x3e695d[_0xbc6b('0x4a')]['id']},'attributes':[_0xbc6b('0x2d'),_0xbc6b('0x6')],'raw':!![]})[_0xbc6b('0x26')](handleEntityNotFound(_0x40b1a6,null))[_0xbc6b('0x26')](function(_0x4618a4){if(_0x4618a4){var _0x3489d7=path['join'](config[_0xbc6b('0x4e')],'server/files/plugins',util[_0xbc6b('0x4f')]('%s.zip',path['basename'](_0x4618a4['path'])));var _0x59a4d1=fs[_0xbc6b('0x50')](_0x3489d7);var _0xe852d0=archiver(_0xbc6b('0x51'),{'zlib':{'level':0x9}});_0xe852d0['on'](_0xbc6b('0x52'),function(_0xdbb27){if(_0xdbb27[_0xbc6b('0x53')]===_0xbc6b('0x54')){logger[_0xbc6b('0x2b')](_0xdbb27);}else{throw new db['Sequelize']['Error'](_0xbc6b('0x55'));}});_0xe852d0['on'](_0xbc6b('0x2b'),function(_0x15c8cf){throw new db['Sequelize'][(_0xbc6b('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0xe852d0['pipe'](_0x59a4d1);_0xe852d0[_0xbc6b('0x57')](_0xbc6b('0x58'),{'cwd':path['join'](config['root'],_0xbc6b('0x59'),path[_0xbc6b('0x5a')](_0x4618a4[_0xbc6b('0x6')])),'ignore':[path[_0xbc6b('0x5b')](path['basename'](_0x4618a4[_0xbc6b('0x6')]),'node_modules/**/*'),path['join'](path['basename'](_0x4618a4[_0xbc6b('0x6')]),'attachments/**/*')],'nodir':!![]})[_0xbc6b('0x5c')]();_0x59a4d1['on'](_0xbc6b('0x5d'),function(){if(!fs['existsSync'](_0x3489d7)){throw new db[(_0xbc6b('0x5e'))]['Error'](_0xbc6b('0x5f'));}return _0x40b1a6[_0xbc6b('0x4d')](_0x3489d7,util[_0xbc6b('0x4f')](_0xbc6b('0x60'),path[_0xbc6b('0x61')](_0x4618a4[_0xbc6b('0x6')])),function(_0x4800c8){if(_0x4800c8){throw new db[(_0xbc6b('0x5e'))][(_0xbc6b('0x56'))](_0xbc6b('0x62'));}fs[_0xbc6b('0x63')](_0x3489d7);logger[_0xbc6b('0x64')](_0xbc6b('0x65'));logger['info']('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x40b1a6,null));};exports['upload']=function(_0x3e7c6e,_0x1216c6,_0x5bd6d5){var _0x1d1474=path[_0xbc6b('0x61')](_0x3e7c6e['file'][_0xbc6b('0x66')],path['extname'](_0x3e7c6e[_0xbc6b('0x67')][_0xbc6b('0x66')]));var _0xe12991=path[_0xbc6b('0x5b')](config[_0xbc6b('0x4e')],'server/files/plugins',_0x3e7c6e[_0xbc6b('0x67')][_0xbc6b('0x66')]);var _0x24522e=path[_0xbc6b('0x5b')](config[_0xbc6b('0x4e')],_0xbc6b('0x59'),_0x1d1474);logger['info'](_0xbc6b('0x68'),_0xe12991);logger[_0xbc6b('0x64')](_0xbc6b('0x69'),_0x24522e);try{fs[_0xbc6b('0x6a')](_0xe12991,parseInt(_0xbc6b('0x6b'),0x8));extract(_0xe12991,{'dir':_0x24522e},function(_0x4d6788){if(_0x4d6788){logger[_0xbc6b('0x2b')](_0x4d6788);handleError(_0x4d6788,!![]);};var _0x244f05=fs['readdirSync'](_0x24522e);if(_0x244f05[_0xbc6b('0x6c')]>0x1){removeReferences(_0xe12991,_0x24522e);logger[_0xbc6b('0x2b')]('Invalid\x20plugin\x20structure');return _0x5bd6d5(new Error(_0xbc6b('0x6d')));}var _0x3df85d=fs['lstatSync'](path[_0xbc6b('0x5b')](_0x24522e,_0x244f05[0x0]));if(_0x3df85d['isFile']()){removeReferences(_0xe12991,_0x24522e);logger['error'](_0xbc6b('0x6d'));return _0x5bd6d5(new Error(_0xbc6b('0x6d')));}if(_0x3df85d[_0xbc6b('0x6e')]()){var _0x5f429d=fs[_0xbc6b('0x6f')](path[_0xbc6b('0x5b')](_0x24522e,_0x244f05[0x0]));if(_0x5f429d['length']===0x0){removeReferences(_0xe12991,_0x24522e);logger[_0xbc6b('0x2b')](_0xbc6b('0x6d'));return _0x5bd6d5(new Error(_0xbc6b('0x6d')));}var _0x18ea54=_0x5f429d['some'](function(_0x1999d3){return _0x1999d3===_0xbc6b('0x70');});if(!_0x18ea54){return _0x5bd6d5(new Error(_0xbc6b('0x71')));}var _0x536d86=fs[_0xbc6b('0x72')](path[_0xbc6b('0x5b')](_0x24522e,_0x244f05[0x0],_0xbc6b('0x70')));var _0x8324ce=JSON[_0xbc6b('0x73')](_0x536d86);if(_0xbc6b('0x20')==typeof _0x8324ce[_0xbc6b('0x2d')]){return _0x5bd6d5(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xbc6b('0x20')==typeof _0x8324ce[_0xbc6b('0x32')]){return _0x5bd6d5(new Error(_0xbc6b('0x74')));}if('undefined'==typeof _0x8324ce[_0xbc6b('0x75')]){return _0x5bd6d5(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xbc6b('0x20')==typeof _0x8324ce['parameters']){return _0x5bd6d5(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x8324ce[_0xbc6b('0x32')]===_0xbc6b('0x76')){if(_0xbc6b('0x20')==typeof _0x8324ce[_0xbc6b('0x77')]['views']){return _0x5bd6d5(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xbc6b('0x20')==typeof _0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x78')]['admin']&&_0xbc6b('0x20')==typeof _0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x78')]['agent']){return _0x5bd6d5(new Error(_0xbc6b('0x79')));}}else if(_0x8324ce[_0xbc6b('0x32')]===_0xbc6b('0x7a')){if(_0xbc6b('0x20')==typeof _0x8324ce[_0xbc6b('0x77')]['scriptName']){return _0x5bd6d5(new Error(_0xbc6b('0x7b')));}if(_0xbc6b('0x20')==typeof _0x8324ce[_0xbc6b('0x77')]['scriptPath']){return _0x5bd6d5(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x5bd6d5(new Error(_0xbc6b('0x7c')));}var _0x47ad7c=_0x8324ce[_0xbc6b('0x2d')];var _0x1bc570=_0x8324ce[_0xbc6b('0x7d')];var _0x28f263=_0x8324ce[_0xbc6b('0x32')];var _0x53bff4=_0x8324ce['sidebar']?_0x8324ce[_0xbc6b('0x7e')]:'always';var _0x24259e=_0x8324ce[_0xbc6b('0x7f')]?_0x8324ce['icon']:_0xbc6b('0x80');var _0x223e03='';var _0x4f1812='';var _0x3e2c6a='';var _0x225369='';var _0x3ba804=_0x8324ce[_0xbc6b('0x75')];if(_0x28f263==='html'){if(_0xbc6b('0x20')!=typeof _0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x78')][_0xbc6b('0x81')]){var _0x2bf005=_0x8324ce['parameters'][_0xbc6b('0x78')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xbc6b('0x82')](_0x2bf005)){_0x223e03=path[_0xbc6b('0x5b')](_0xbc6b('0x83'),_0x1d1474,_0x244f05[0x0],_0x2bf005);}else{_0x223e03=_0x2bf005;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xbc6b('0x20')!=typeof _0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x78')][_0xbc6b('0x84')]){var _0x2e37a2=_0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x78')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2e37a2)){_0x4f1812=path[_0xbc6b('0x5b')](_0xbc6b('0x83'),_0x1d1474,_0x244f05[0x0],_0x2e37a2);}else{_0x4f1812=_0x2e37a2;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x28f263===_0xbc6b('0x7a')){_0x3e2c6a=_0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x85')];_0x225369=_0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x86')];if('undefined'!=typeof _0x8324ce['parameters'][_0xbc6b('0x78')]){if(_0xbc6b('0x20')!=typeof _0x8324ce['parameters'][_0xbc6b('0x78')]['admin']){var _0x2bf005=_0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x78')][_0xbc6b('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2bf005)){_0x223e03=path[_0xbc6b('0x5b')](_0xbc6b('0x83'),_0x1d1474,_0x244f05[0x0],_0x2bf005);}else{_0x223e03=_0x2bf005;}}if(_0xbc6b('0x20')!=typeof _0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x78')]['agent']){var _0x2e37a2=_0x8324ce[_0xbc6b('0x77')][_0xbc6b('0x78')][_0xbc6b('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xbc6b('0x82')](_0x2e37a2)){_0x4f1812=path[_0xbc6b('0x5b')](_0xbc6b('0x83'),_0x1d1474,_0x244f05[0x0],_0x2e37a2);}else{_0x4f1812=_0x2e37a2;}}}}var _0x3484bb={'name':_0x47ad7c,'description':_0x1bc570,'path':path[_0xbc6b('0x5b')](_0x1d1474,_0x244f05[0x0]),'type':_0x28f263,'sidebar':_0x53bff4,'icon':_0x24259e,'adminUrl':_0x223e03,'agentUrl':_0x4f1812,'scriptName':_0x3e2c6a,'scriptPath':_0x225369,'version':_0x3ba804};removeReferences(_0xe12991,null);return db[_0xbc6b('0x44')]['create'](_0x3484bb)[_0xbc6b('0x26')](function(_0x3a7c34){var _0x5ababb={'role':_0x3e7c6e[_0xbc6b('0x87')]['role'],'userProfileId':_0x3e7c6e[_0xbc6b('0x87')][_0xbc6b('0x88')]};if(!_0x5ababb)throw new Error(_0xbc6b('0x89'));if(_0x5ababb[_0xbc6b('0x8a')]==='user'){var _0x119d22=_0x3a7c34[_0xbc6b('0x8b')]({'plain':!![]});return db['UserProfileSection'][_0xbc6b('0x4c')]({'where':{'name':'Plugins','userProfileId':_0x5ababb[_0xbc6b('0x88')]},'raw':!![]})[_0xbc6b('0x26')](function(_0x4ce48a){if(_0x4ce48a&&_0x4ce48a[_0xbc6b('0x8c')]===0x0){return db[_0xbc6b('0x29')][_0xbc6b('0x8d')]({'name':_0x119d22[_0xbc6b('0x2d')],'resourceId':_0x119d22['id'],'type':_0x4ce48a[_0xbc6b('0x2d')],'sectionId':_0x4ce48a['id']},{})[_0xbc6b('0x26')](function(){return _0x3a7c34;});}else{return _0x3a7c34;}})[_0xbc6b('0x49')](function(_0x5ce1bd){logger[_0xbc6b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ce1bd);throw _0x5ce1bd;});}return _0x3a7c34;})[_0xbc6b('0x26')](respondWithResult(_0x1216c6,null))[_0xbc6b('0x49')](handleError(_0x1216c6,null));}});}catch(_0x59931f){_0x1216c6[_0xbc6b('0x1d')](0x1f4)[_0xbc6b('0x8e')](_0x59931f);}};function removeReferences(_0x4fb4c0,_0x2c3c00){try{if(_0x4fb4c0){fs[_0xbc6b('0x63')](_0x4fb4c0);logger[_0xbc6b('0x64')]('Zip\x20archive\x20removed');}if(_0x2c3c00){rimraf(_0x2c3c00,function(){});logger[_0xbc6b('0x64')](_0xbc6b('0x8f'));}}catch(_0x185e20){logger['error'](_0x185e20);}}exports[_0xbc6b('0x25')]=function(_0x5d4060,_0xde76ec,_0x5b1006){return db['Plugin'][_0xbc6b('0x4c')]({'where':{'id':_0x5d4060[_0xbc6b('0x4a')]['id']}})[_0xbc6b('0x26')](handleEntityNotFound(_0xde76ec,null))[_0xbc6b('0x26')](saveUpdates(_0x5d4060[_0xbc6b('0x87')],null))[_0xbc6b('0x26')](respondWithResult(_0xde76ec,null))[_0xbc6b('0x49')](handleError(_0xde76ec,null));};exports['delete']=function(_0x4d8aff,_0x58a58f,_0x899228){return db[_0xbc6b('0x44')][_0xbc6b('0x4c')]({'where':{'id':_0x4d8aff[_0xbc6b('0x4a')]['id']}})[_0xbc6b('0x26')](function(_0x4420ef){if(_0x4420ef){return _0x4420ef['destroy']();}})[_0xbc6b('0x26')](function(_0x10c1f4){rimraf(path[_0xbc6b('0x5b')](config['root'],_0xbc6b('0x59'),path['dirname'](_0x10c1f4[_0xbc6b('0x6')])),function(){});return _0x10c1f4;})[_0xbc6b('0x26')](handleEntityNotFound(_0x58a58f,null))[_0xbc6b('0x26')](respondWithStatusCode(_0x58a58f,null))[_0xbc6b('0x49')](handleError(_0x58a58f,null));};exports[_0xbc6b('0x90')]=function(_0x1608a6,_0x261d09,_0x210b91){return BPromise[_0xbc6b('0x91')]()['then'](function(){if(!_0x1608a6[_0xbc6b('0x35')]['path']){throw new Error(_0xbc6b('0x92'));}if(!_0x1608a6[_0xbc6b('0x35')][_0xbc6b('0x93')]){throw new Error(_0xbc6b('0x94'));}var _0xdce40=_0x1608a6[_0xbc6b('0x35')][_0xbc6b('0x95')]?_0x1608a6['query'][_0xbc6b('0x95')]+':'+_0x1608a6[_0xbc6b('0x35')]['port']:'http://localhost:'+_0x1608a6[_0xbc6b('0x35')][_0xbc6b('0x93')];var _0x5e9dc8=_0x1608a6[_0xbc6b('0x35')][_0xbc6b('0x22')]?_0x1608a6[_0xbc6b('0x35')][_0xbc6b('0x22')]:!![];var _0x2e5773=_0x1608a6['query']['encoding']?_0x1608a6[_0xbc6b('0x35')][_0xbc6b('0x96')]:null;var _0x8314c6={'method':_0x1608a6[_0xbc6b('0x97')],'uri':util['format'](_0xbc6b('0x98'),_0xdce40,_0x1608a6[_0xbc6b('0x35')][_0xbc6b('0x6')]),'json':_0x5e9dc8,'resolveWithFullResponse':!![],'encoding':_0x2e5773,'qs':_0x1608a6['query']};if(_0x1608a6[_0xbc6b('0x99')]){_0x8314c6[_0xbc6b('0x99')]=_0x1608a6[_0xbc6b('0x99')];if(_0x8314c6[_0xbc6b('0x99')][_0xbc6b('0x9a')]){delete _0x8314c6[_0xbc6b('0x99')][_0xbc6b('0x9a')];}}if(_0x8314c6[_0xbc6b('0x99')][_0xbc6b('0x9b')]){delete _0x8314c6[_0xbc6b('0x99')][_0xbc6b('0x9b')];}return rp(_0x8314c6);})[_0xbc6b('0x26')](function(_0x2b36a6){if(_0x2b36a6){_0x261d09['set'](_0x2b36a6[_0xbc6b('0x99')]);logger[_0xbc6b('0x64')](_0x2b36a6[_0xbc6b('0x87')]);if(_[_0xbc6b('0x9c')](_0x1608a6[_0xbc6b('0x35')][_0xbc6b('0x6')],_0xbc6b('0x4d'))&&_0x2b36a6[_0xbc6b('0x9d')]==0x1f4){return _0x261d09['sendStatus'](_0x2b36a6['statusCode']);}else{return _0x261d09[_0xbc6b('0x1d')](_0x2b36a6[_0xbc6b('0x9d')])[_0xbc6b('0x8e')](_0x2b36a6[_0xbc6b('0x87')]);}}else{return _0x261d09[_0xbc6b('0x1c')](0xc8);}})[_0xbc6b('0x49')](handleError(_0x261d09,null));};exports['webhookPost']=function(_0x786b0a,_0x4a1f3a,_0x226877){return BPromise[_0xbc6b('0x91')]()[_0xbc6b('0x26')](function(){if(!_0x786b0a[_0xbc6b('0x35')][_0xbc6b('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x786b0a[_0xbc6b('0x35')][_0xbc6b('0x93')]){throw new Error(_0xbc6b('0x94'));}var _0x46f98a=_0x786b0a[_0xbc6b('0x35')][_0xbc6b('0x95')]?_0x786b0a[_0xbc6b('0x35')][_0xbc6b('0x95')]+':'+_0x786b0a[_0xbc6b('0x35')][_0xbc6b('0x93')]:'http://localhost:'+_0x786b0a['query']['port'];var _0x13e7b4=_0x786b0a[_0xbc6b('0x35')][_0xbc6b('0x22')]?_0x786b0a[_0xbc6b('0x35')][_0xbc6b('0x22')]:!![];var _0x8b977=_0x786b0a['query'][_0xbc6b('0x96')]?_0x786b0a['query'][_0xbc6b('0x96')]:null;var _0x4d1f25={'method':_0x786b0a[_0xbc6b('0x97')],'uri':util[_0xbc6b('0x4f')](_0xbc6b('0x98'),_0x46f98a,_0x786b0a[_0xbc6b('0x35')][_0xbc6b('0x6')]),'json':_0x13e7b4,'resolveWithFullResponse':!![],'encoding':_0x8b977,'body':_0x786b0a['body']};if(_0x786b0a[_0xbc6b('0x99')]){_0x4d1f25[_0xbc6b('0x99')]=_0x786b0a['headers'];if(_0x4d1f25[_0xbc6b('0x99')][_0xbc6b('0x9a')]){delete _0x4d1f25['headers'][_0xbc6b('0x9a')];}}if(_0x4d1f25[_0xbc6b('0x99')][_0xbc6b('0x9b')]){delete _0x4d1f25[_0xbc6b('0x99')][_0xbc6b('0x9b')];}return rp(_0x4d1f25);})[_0xbc6b('0x26')](function(_0x383ede){if(_0x383ede){_0x4a1f3a[_0xbc6b('0x9e')](_0x383ede['headers']);logger[_0xbc6b('0x64')](_0x383ede['body']);return _0x4a1f3a['status'](_0x383ede['statusCode'])['send'](_0x383ede['body']);}else{return _0x4a1f3a[_0xbc6b('0x1c')](0xc8);}})[_0xbc6b('0x49')](handleError(_0x4a1f3a,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index d0d3933..f1d8995 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 _0x4af9=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x550c7d,_0x51b189){var _0x322722=function(_0x357025){while(--_0x357025){_0x550c7d['push'](_0x550c7d['shift']());}};_0x322722(++_0x51b189);}(_0x4af9,0x12c));var _0x94af=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4af9[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x94af('0x0'));var Plugin=require(_0x94af('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x94af('0x2'),'afterUpdate':_0x94af('0x3'),'afterDestroy':_0x94af('0x4')};function emitEvent(_0x2a6642){return function(_0x1362cc,_0x14d407,_0x1a548e){PluginEvents['emit'](_0x2a6642+':'+_0x1362cc['id'],_0x1362cc);PluginEvents[_0x94af('0x5')](_0x2a6642,_0x1362cc);_0x1a548e(null);};}for(var e in events){if(events[_0x94af('0x6')](e)){var event=events[e];Plugin[_0x94af('0x7')](e,emitEvent(event));}}module[_0x94af('0x8')]=PluginEvents; \ No newline at end of file +var _0xbfe8=['emit','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x5acc67,_0x31a073){var _0x263cf8=function(_0x250260){while(--_0x250260){_0x5acc67['push'](_0x5acc67['shift']());}};_0x263cf8(++_0x31a073);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x1f427e,_0x2220bb){_0x1f427e=_0x1f427e-0x0;var _0x551e5e=_0xbfe8[_0x1f427e];return _0x551e5e;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x8bfe('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x8bfe('0x1')](0x0);var events={'afterCreate':_0x8bfe('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x101fc1){return function(_0x31df14,_0x57eb53,_0x134227){PluginEvents[_0x8bfe('0x3')](_0x101fc1+':'+_0x31df14['id'],_0x31df14);PluginEvents[_0x8bfe('0x3')](_0x101fc1,_0x31df14);_0x134227(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x8bfe('0x4')](e,emitEvent(event));}}module[_0x8bfe('0x5')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 655c109..a8460e6 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 _0xab1d=['exports','define','Plugin','plugins','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./plugin.attributes'];(function(_0x205e6a,_0xfa8d0d){var _0x330d5c=function(_0x1856c5){while(--_0x1856c5){_0x205e6a['push'](_0x205e6a['shift']());}};_0x330d5c(++_0xfa8d0d);}(_0xab1d,0x130));var _0xdab1=function(_0x329982,_0x7db665){_0x329982=_0x329982-0x0;var _0x265562=_0xab1d[_0x329982];return _0x265562;};'use strict';var _=require(_0xdab1('0x0'));var util=require(_0xdab1('0x1'));var logger=require(_0xdab1('0x2'))(_0xdab1('0x3'));var moment=require('moment');var BPromise=require(_0xdab1('0x4'));var rp=require(_0xdab1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdab1('0x6'));var config=require('../../config/environment');var attributes=require(_0xdab1('0x7'));module[_0xdab1('0x8')]=function(_0x220554,_0xd0382a){return _0x220554[_0xdab1('0x9')](_0xdab1('0xa'),attributes,{'tableName':_0xdab1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9512=['bluebird','request-promise','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','moment'];(function(_0x40503c,_0x5750c9){var _0x1ad435=function(_0x43e85b){while(--_0x43e85b){_0x40503c['push'](_0x40503c['shift']());}};_0x1ad435(++_0x5750c9);}(_0x9512,0x1ac));var _0x2951=function(_0x5e33f6,_0x2e18e6){_0x5e33f6=_0x5e33f6-0x0;var _0x20cb0f=_0x9512[_0x5e33f6];return _0x20cb0f;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var logger=require(_0x2951('0x2'))('api');var moment=require(_0x2951('0x3'));var BPromise=require(_0x2951('0x4'));var rp=require(_0x2951('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2951('0x6'));var attributes=require(_0x2951('0x7'));module[_0x2951('0x8')]=function(_0x4448b3,_0x363f0d){return _0x4448b3[_0x2951('0x9')](_0x2951('0xa'),attributes,{'tableName':_0x2951('0xb'),'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 556aa2d..573c9ce 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 _0x8138=['code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xfe2951,_0x383c6a){var _0x279db8=function(_0x150beb){while(--_0x150beb){_0xfe2951['push'](_0xfe2951['shift']());}};_0x279db8(++_0x383c6a);}(_0x8138,0x155));var _0x8813=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x8138[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0x8813('0x0'));var util=require(_0x8813('0x1'));var moment=require(_0x8813('0x2'));var BPromise=require('bluebird');var rs=require(_0x8813('0x3'));var fs=require('fs');var Redis=require(_0x8813('0x4'));var db=require(_0x8813('0x5'))['db'];var utils=require(_0x8813('0x6'));var logger=require(_0x8813('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8813('0x8'));var client=jayson[_0x8813('0x9')][_0x8813('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x8813('0xb'),'port':0x18eb});var socket=require(_0x8813('0xc'))(new Redis(config['redis']));require(_0x8813('0xd'))[_0x8813('0xe')](socket);function respondWithRpcPromise(_0x37733f,_0x5c94da,_0x519cab){return new BPromise(function(_0x587fa8,_0x5bb1be){return client[_0x8813('0xf')](_0x37733f,_0x519cab)[_0x8813('0x10')](function(_0x2517db){logger[_0x8813('0x11')](_0x8813('0x12'),_0x5c94da,_0x8813('0x13'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x5c94da,_0x8813('0x13'),JSON[_0x8813('0x14')](_0x2517db));if(_0x2517db[_0x8813('0x15')]){if(_0x2517db[_0x8813('0x15')][_0x8813('0x16')]===0x1f4){logger[_0x8813('0x15')](_0x8813('0x12'),_0x5c94da,_0x2517db['error'][_0x8813('0x17')]);return _0x5bb1be(_0x2517db['error'][_0x8813('0x17')]);}logger[_0x8813('0x15')](_0x8813('0x12'),_0x5c94da,_0x2517db[_0x8813('0x15')]['message']);return _0x587fa8(_0x2517db[_0x8813('0x15')]['message']);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x5c94da,_0x8813('0x13'));_0x587fa8(_0x2517db[_0x8813('0x18')]['message']);}})[_0x8813('0x19')](function(_0x4e89a5){logger[_0x8813('0x15')](_0x8813('0x12'),_0x5c94da,_0x4e89a5);_0x5bb1be(_0x4e89a5);});});}exports[_0x8813('0x1a')]=function(_0x556f8d){var _0x421d95=this;return new Promise(function(_0x1eeaa9,_0x4358ce){return db[_0x8813('0x1b')][_0x8813('0x1c')](_0x556f8d[_0x8813('0x1d')],{'raw':_0x556f8d[_0x8813('0x1e')]?_0x556f8d['options'][_0x8813('0x1f')]===undefined?!![]:![]:!![]})[_0x8813('0x10')](function(_0xea0532){logger[_0x8813('0x11')](_0x8813('0x1a'),_0x556f8d);logger[_0x8813('0x20')](_0x8813('0x1a'),_0x556f8d,JSON[_0x8813('0x14')](_0xea0532));_0x1eeaa9(_0xea0532);})[_0x8813('0x19')](function(_0x22388f){logger[_0x8813('0x15')](_0x8813('0x1a'),_0x22388f[_0x8813('0x17')],_0x556f8d);_0x4358ce(_0x421d95[_0x8813('0x15')](0x1f4,_0x22388f[_0x8813('0x17')]));});});}; \ No newline at end of file +var _0x5e5f=['debug','stringify','error','code','message','CreatePlugin','Plugin','create','body','options','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x5ef8f9,_0x6a3a29){var _0x5cc906=function(_0x1320d9){while(--_0x1320d9){_0x5ef8f9['push'](_0x5ef8f9['shift']());}};_0x5cc906(++_0x6a3a29);}(_0x5e5f,0x1b0));var _0xf5e5=function(_0x36dc04,_0x2b231d){_0x36dc04=_0x36dc04-0x0;var _0x19ae5c=_0x5e5f[_0x36dc04];return _0x19ae5c;};'use strict';var _=require(_0xf5e5('0x0'));var util=require(_0xf5e5('0x1'));var moment=require('moment');var BPromise=require(_0xf5e5('0x2'));var rs=require(_0xf5e5('0x3'));var fs=require('fs');var Redis=require(_0xf5e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf5e5('0x5'))(_0xf5e5('0x6'));var config=require(_0xf5e5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf5e5('0x8')]['http']({'port':0x232a});config[_0xf5e5('0x9')]=_['defaults'](config[_0xf5e5('0x9')],{'host':_0xf5e5('0xa'),'port':0x18eb});var socket=require(_0xf5e5('0xb'))(new Redis(config[_0xf5e5('0x9')]));require('./plugin.socket')[_0xf5e5('0xc')](socket);function respondWithRpcPromise(_0x3bdbb5,_0x4d7301,_0x2b52cf){return new BPromise(function(_0x5719c3,_0x98261b){return client[_0xf5e5('0xd')](_0x3bdbb5,_0x2b52cf)[_0xf5e5('0xe')](function(_0x398ccd){logger[_0xf5e5('0xf')](_0xf5e5('0x10'),_0x4d7301,_0xf5e5('0x11'));logger[_0xf5e5('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x4d7301,_0xf5e5('0x11'),JSON[_0xf5e5('0x13')](_0x398ccd));if(_0x398ccd[_0xf5e5('0x14')]){if(_0x398ccd[_0xf5e5('0x14')][_0xf5e5('0x15')]===0x1f4){logger[_0xf5e5('0x14')](_0xf5e5('0x10'),_0x4d7301,_0x398ccd[_0xf5e5('0x14')][_0xf5e5('0x16')]);return _0x98261b(_0x398ccd[_0xf5e5('0x14')][_0xf5e5('0x16')]);}logger[_0xf5e5('0x14')]('Plugin,\x20%s,\x20%s',_0x4d7301,_0x398ccd[_0xf5e5('0x14')]['message']);return _0x5719c3(_0x398ccd['error']['message']);}else{logger['info'](_0xf5e5('0x10'),_0x4d7301,_0xf5e5('0x11'));_0x5719c3(_0x398ccd['result'][_0xf5e5('0x16')]);}})['catch'](function(_0x182486){logger['error'](_0xf5e5('0x10'),_0x4d7301,_0x182486);_0x98261b(_0x182486);});});}exports[_0xf5e5('0x17')]=function(_0x4229ec){var _0x5e9d17=this;return new Promise(function(_0x6fa539,_0x250b09){return db[_0xf5e5('0x18')][_0xf5e5('0x19')](_0x4229ec[_0xf5e5('0x1a')],{'raw':_0x4229ec[_0xf5e5('0x1b')]?_0x4229ec[_0xf5e5('0x1b')][_0xf5e5('0x1c')]===undefined?!![]:![]:!![]})[_0xf5e5('0xe')](function(_0x412f31){logger[_0xf5e5('0xf')]('CreatePlugin',_0x4229ec);logger[_0xf5e5('0x12')](_0xf5e5('0x17'),_0x4229ec,JSON[_0xf5e5('0x13')](_0x412f31));_0x6fa539(_0x412f31);})[_0xf5e5('0x1d')](function(_0x45073d){logger[_0xf5e5('0x14')](_0xf5e5('0x17'),_0x45073d[_0xf5e5('0x16')],_0x4229ec);_0x250b09(_0x5e9d17['error'](0x1f4,_0x45073d[_0xf5e5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 8458f83..5064b03 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 _0xd96b=['plugin:','./plugin.events','save','emit','removeListener','register'];(function(_0x3abee2,_0x4a21c4){var _0x5031bf=function(_0x1c38a3){while(--_0x1c38a3){_0x3abee2['push'](_0x3abee2['shift']());}};_0x5031bf(++_0x4a21c4);}(_0xd96b,0x127));var _0xbd96=function(_0x520d95,_0x5d6895){_0x520d95=_0x520d95-0x0;var _0x7e0c24=_0xd96b[_0x520d95];return _0x7e0c24;};'use strict';var PluginEvents=require(_0xbd96('0x0'));var events=[_0xbd96('0x1'),'remove','update'];function createListener(_0xcab14d,_0x3c99c5){return function(_0x5cad7e){_0x3c99c5[_0xbd96('0x2')](_0xcab14d,_0x5cad7e);};}function removeListener(_0x354ba7,_0x270894){return function(){PluginEvents[_0xbd96('0x3')](_0x354ba7,_0x270894);};}exports[_0xbd96('0x4')]=function(_0x3382c1){for(var _0x4b1199=0x0,_0x1cc5be=events['length'];_0x4b1199<_0x1cc5be;_0x4b1199++){var _0x599622=events[_0x4b1199];var _0x457112=createListener(_0xbd96('0x5')+_0x599622,_0x3382c1);PluginEvents['on'](_0x599622,_0x457112);}}; \ No newline at end of file +var _0x72de=['removeListener','length','plugin:','save','remove'];(function(_0x1fe66e,_0x5c8978){var _0x11669a=function(_0x4613d3){while(--_0x4613d3){_0x1fe66e['push'](_0x1fe66e['shift']());}};_0x11669a(++_0x5c8978);}(_0x72de,0xc6));var _0xe72d=function(_0x41d413,_0xf934f0){_0x41d413=_0x41d413-0x0;var _0x41136b=_0x72de[_0x41d413];return _0x41136b;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xe72d('0x0'),_0xe72d('0x1'),'update'];function createListener(_0x36f28,_0x354e7e){return function(_0x14f84a){_0x354e7e['emit'](_0x36f28,_0x14f84a);};}function removeListener(_0x40987e,_0x5bb4ba){return function(){PluginEvents[_0xe72d('0x2')](_0x40987e,_0x5bb4ba);};}exports['register']=function(_0x2ad9c6){for(var _0x47d1cf=0x0,_0x2c62f3=events[_0xe72d('0x3')];_0x47d1cf<_0x2c62f3;_0x47d1cf++){var _0x285b53=events[_0x47d1cf];var _0x1ee044=createListener(_0xe72d('0x4')+_0x285b53,_0x2ad9c6);PluginEvents['on'](_0x285b53,_0x1ee044);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index b24c4f2..d550723 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(_0x286dbb,_0x106444){var _0x21ad93=function(_0xa59160){while(--_0xa59160){_0x286dbb['push'](_0x286dbb['shift']());}};_0x21ad93(++_0x106444);}(_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(_0x46602c,_0x48a385){var _0x308ae6=function(_0x501c4b){while(--_0x501c4b){_0x46602c['push'](_0x46602c['shift']());}};_0x308ae6(++_0x48a385);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 8f0c0da..4623212 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 _0x54ef=['bluebird','status','error','name','send','npm\x20install','info','index','list','reject','express','motion2','catch','show','describe','params','then','create','script','join','../../files/plugins','body','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x54ef,0x112));var _0xf54e=function(_0x20e709,_0x5917ff){_0x20e709=_0x20e709-0x0;var _0x14b9ef=_0x54ef[_0x20e709];return _0x14b9ef;};'use strict';var _=require(_0xf54e('0x0'));var pm2=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var path=require(_0xf54e('0x3'));var exec=require(_0xf54e('0x4'))[_0xf54e('0x5')];var BPromise=require(_0xf54e('0x6'));function handleEntityNotFound(_0x8b6bb6,_0x431e36){return function(_0x12d43f){if(!_0x12d43f){_0x8b6bb6['sendStatus'](0x194);;}return _0x12d43f;};}function respondWithResult(_0x55e611,_0x18e84e){_0x18e84e=_0x18e84e||0xc8;return function(_0x99cf9){if(_0x99cf9){return _0x55e611[_0xf54e('0x7')](_0x18e84e)['json'](_0x99cf9);}return null;};}function handleError(_0x27e69b,_0x57a1ce){_0x57a1ce=_0x57a1ce||0x1f4;return function(_0x40a75d){logger[_0xf54e('0x8')](_0x40a75d['stack']);if(_0x40a75d[_0xf54e('0x9')]){delete _0x40a75d[_0xf54e('0x9')];}_0x27e69b[_0xf54e('0x7')](_0x57a1ce)[_0xf54e('0xa')](_0x40a75d);};}function execChildProcess(){return new BPromise(function(_0x5f232a,_0x558502){exec(_0xf54e('0xb'),function(_0x143d66,_0x326eef,_0x553759){logger[_0xf54e('0xc')](_0x326eef);logger['info'](_0x553759);if(_0x143d66){logger['error'](_0x143d66);return _0x558502(_0x143d66);}return _0x5f232a(_0x326eef);});});}exports[_0xf54e('0xd')]=function(_0x2033e9,_0x28f776){return pm2[_0xf54e('0xe')]()['then'](function(_0x331732){if(_0x331732){var _0x1bbeaa=_[_0xf54e('0xf')](_0x331732,function(_0x15f639){return _0x15f639['name']===_0xf54e('0x10')||_0x15f639[_0xf54e('0x9')]===_0xf54e('0x11');});return{'rows':_0x1bbeaa,'count':_0x1bbeaa['length']};}return null;})['then'](respondWithResult(_0x28f776,null))[_0xf54e('0x12')](handleError(_0x28f776,null));};exports[_0xf54e('0x13')]=function(_0x1c02e7,_0x9647f){return pm2[_0xf54e('0x14')](_0x1c02e7[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x9647f,null))[_0xf54e('0x16')](handleEntityNotFound(_0x9647f,null))[_0xf54e('0x12')](handleError(_0x9647f,null));};exports[_0xf54e('0x17')]=function(_0x226c96,_0x50fc66){if(_0x226c96['body'][_0xf54e('0x9')]&&_0x226c96['body'][_0xf54e('0x18')]){var _0x1bfe99=path[_0xf54e('0x19')](__dirname,_0xf54e('0x1a'),_0x226c96[_0xf54e('0x1b')][_0xf54e('0x18')]);var _0x388aa0=process[_0xf54e('0x1c')]();process[_0xf54e('0x1d')](path[_0xf54e('0x1e')](_0x1bfe99));return execChildProcess()[_0xf54e('0x16')](function(_0x5b83df){process[_0xf54e('0x1d')](_0x388aa0);return pm2['start']({'name':_0x226c96[_0xf54e('0x1b')][_0xf54e('0x9')],'script':_0x1bfe99});})[_0xf54e('0x16')](function(_0x474b61){pm2[_0xf54e('0x1f')]();return _0x474b61[0x0];})[_0xf54e('0x16')](respondWithResult(_0x50fc66,0xc9))[_0xf54e('0x12')](handleError(_0x50fc66,null));}else{return _0x50fc66[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x20')});}};exports[_0xf54e('0x21')]=function(_0x39c0ae,_0x2ea001){if(_0x39c0ae['body']['id']){delete _0x39c0ae[_0xf54e('0x1b')]['id'];}var _0x4cbf7c={'online':_0xf54e('0x22'),'stopped':'stop'};if(_0x4cbf7c[_0xf54e('0x23')](_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')])){return pm2[_0x4cbf7c[_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')]]](_0x39c0ae[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x2ea001,0xc8))['catch'](handleError(_0x2ea001,null));}else{return _0x2ea001['status'](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x24')});}};exports[_0xf54e('0x25')]=function(_0x16d00f,_0xb2d4c4){if(_0x16d00f[_0xf54e('0x1b')]['id']){delete _0x16d00f[_0xf54e('0x1b')]['id'];}if(_0x16d00f[_0xf54e('0x15')]['id']){return pm2[_0xf54e('0x26')](_0x16d00f[_0xf54e('0x15')]['id'])['then'](function(_0x5f29d3){pm2[_0xf54e('0x1f')]();return _0x5f29d3[0x0];})[_0xf54e('0x16')](respondWithResult(_0xb2d4c4,null))['catch'](handleError(_0xb2d4c4,null));}else{return _0xb2d4c4[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x27')});}}; \ No newline at end of file +var _0xbec5=['Unknown\x20id','lodash','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','create','body','join','../../files/plugins','script','cwd','dirname','chdir','start','dump','restart','hasOwnProperty','params','destroy'];(function(_0x5a8c89,_0xc5bd76){var _0x115fb3=function(_0x18ceda){while(--_0x18ceda){_0x5a8c89['push'](_0x5a8c89['shift']());}};_0x115fb3(++_0xc5bd76);}(_0xbec5,0xe5));var _0x5bec=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0xbec5[_0x1f7996];return _0x584609;};'use strict';var _=require(_0x5bec('0x0'));var pm2=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var path=require(_0x5bec('0x3'));var exec=require(_0x5bec('0x4'))[_0x5bec('0x5')];var BPromise=require(_0x5bec('0x6'));function handleEntityNotFound(_0x4ee982,_0x1f8933){return function(_0x376cdb){if(!_0x376cdb){_0x4ee982[_0x5bec('0x7')](0x194);;}return _0x376cdb;};}function respondWithResult(_0x4aaac6,_0x3ed67a){_0x3ed67a=_0x3ed67a||0xc8;return function(_0x28a427){if(_0x28a427){return _0x4aaac6[_0x5bec('0x8')](_0x3ed67a)[_0x5bec('0x9')](_0x28a427);}return null;};}function handleError(_0x43d96e,_0x302aae){_0x302aae=_0x302aae||0x1f4;return function(_0x6406a1){logger[_0x5bec('0xa')](_0x6406a1['stack']);if(_0x6406a1[_0x5bec('0xb')]){delete _0x6406a1['name'];}_0x43d96e[_0x5bec('0x8')](_0x302aae)[_0x5bec('0xc')](_0x6406a1);};}function execChildProcess(){return new BPromise(function(_0x117162,_0x4a5482){exec(_0x5bec('0xd'),function(_0x18fa47,_0x16226b,_0x57ffc4){logger[_0x5bec('0xe')](_0x16226b);logger[_0x5bec('0xe')](_0x57ffc4);if(_0x18fa47){logger['error'](_0x18fa47);return _0x4a5482(_0x18fa47);}return _0x117162(_0x16226b);});});}exports[_0x5bec('0xf')]=function(_0xaa984d,_0x35393a){return pm2[_0x5bec('0x10')]()[_0x5bec('0x11')](function(_0xcd6d90){if(_0xcd6d90){var _0x24dcd6=_[_0x5bec('0x12')](_0xcd6d90,function(_0x259588){return _0x259588[_0x5bec('0xb')]===_0x5bec('0x13')||_0x259588[_0x5bec('0xb')]===_0x5bec('0x14');});return{'rows':_0x24dcd6,'count':_0x24dcd6['length']};}return null;})['then'](respondWithResult(_0x35393a,null))[_0x5bec('0x15')](handleError(_0x35393a,null));};exports[_0x5bec('0x16')]=function(_0x31ad9c,_0x1771e7){return pm2['describe'](_0x31ad9c['params']['id'])[_0x5bec('0x11')](respondWithResult(_0x1771e7,null))[_0x5bec('0x11')](handleEntityNotFound(_0x1771e7,null))['catch'](handleError(_0x1771e7,null));};exports[_0x5bec('0x17')]=function(_0xa7e223,_0x32a846){if(_0xa7e223[_0x5bec('0x18')]['name']&&_0xa7e223[_0x5bec('0x18')]['script']){var _0x191c0f=path[_0x5bec('0x19')](__dirname,_0x5bec('0x1a'),_0xa7e223[_0x5bec('0x18')][_0x5bec('0x1b')]);var _0x5e154e=process[_0x5bec('0x1c')]();process['chdir'](path[_0x5bec('0x1d')](_0x191c0f));return execChildProcess()[_0x5bec('0x11')](function(_0x5b2636){process[_0x5bec('0x1e')](_0x5e154e);return pm2[_0x5bec('0x1f')]({'name':_0xa7e223['body'][_0x5bec('0xb')],'script':_0x191c0f});})[_0x5bec('0x11')](function(_0x43d460){pm2[_0x5bec('0x20')]();return _0x43d460[0x0];})[_0x5bec('0x11')](respondWithResult(_0x32a846,0xc9))[_0x5bec('0x15')](handleError(_0x32a846,null));}else{return _0x32a846[_0x5bec('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x2961bd,_0x2cdd2f){if(_0x2961bd[_0x5bec('0x18')]['id']){delete _0x2961bd['body']['id'];}var _0x2b3b2c={'online':_0x5bec('0x21'),'stopped':'stop'};if(_0x2b3b2c[_0x5bec('0x22')](_0x2961bd[_0x5bec('0x18')]['status'])){return pm2[_0x2b3b2c[_0x2961bd['body'][_0x5bec('0x8')]]](_0x2961bd[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](respondWithResult(_0x2cdd2f,0xc8))[_0x5bec('0x15')](handleError(_0x2cdd2f,null));}else{return _0x2cdd2f[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':'Unknown\x20status'});}};exports[_0x5bec('0x24')]=function(_0x59b5b6,_0x45863b){if(_0x59b5b6[_0x5bec('0x18')]['id']){delete _0x59b5b6[_0x5bec('0x18')]['id'];}if(_0x59b5b6[_0x5bec('0x23')]['id']){return pm2['delete'](_0x59b5b6[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](function(_0xfc7d41){pm2['dump']();return _0xfc7d41[0x0];})[_0x5bec('0x11')](respondWithResult(_0x45863b,null))['catch'](handleError(_0x45863b,null));}else{return _0x45863b[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':_0x5bec('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 3b9aff2..d4c5787 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 _0xbb0c=['get','/agents','isAuthenticated','getAgents','/queues','getQueues','express','../../components/auth/service','./realtime.controller'];(function(_0x4d593e,_0x131776){var _0x31e2df=function(_0x4787ec){while(--_0x4787ec){_0x4d593e['push'](_0x4d593e['shift']());}};_0x31e2df(++_0x131776);}(_0xbb0c,0x12f));var _0xcbb0=function(_0x2d687a,_0x2e06ee){_0x2d687a=_0x2d687a-0x0;var _0x17e15d=_0xbb0c[_0x2d687a];return _0x17e15d;};'use strict';var express=require(_0xcbb0('0x0'));var router=express['Router']();var auth=require(_0xcbb0('0x1'));var controller=require(_0xcbb0('0x2'));router[_0xcbb0('0x3')](_0xcbb0('0x4'),auth[_0xcbb0('0x5')](),controller[_0xcbb0('0x6')]);router[_0xcbb0('0x3')](_0xcbb0('0x7'),auth[_0xcbb0('0x5')](),controller[_0xcbb0('0x8')]);module['exports']=router; \ No newline at end of file +var _0x5bae=['/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','/agents','isAuthenticated','getAgents'];(function(_0x226456,_0x42f70d){var _0x45e537=function(_0x33299b){while(--_0x33299b){_0x226456['push'](_0x226456['shift']());}};_0x45e537(++_0x42f70d);}(_0x5bae,0xc1));var _0xe5ba=function(_0x406498,_0x344ba4){_0x406498=_0x406498-0x0;var _0x50a567=_0x5bae[_0x406498];return _0x50a567;};'use strict';var express=require(_0xe5ba('0x0'));var router=express[_0xe5ba('0x1')]();var auth=require(_0xe5ba('0x2'));var controller=require(_0xe5ba('0x3'));router['get'](_0xe5ba('0x4'),auth[_0xe5ba('0x5')](),controller[_0xe5ba('0x6')]);router['get'](_0xe5ba('0x7'),auth['isAuthenticated'](),controller[_0xe5ba('0x8')]);module[_0xe5ba('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index b372cbd..237f866 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 _0xa7ad=['rawAttributes','fieldName','type','role','agent','getOptions','push','sequelize','literal','Pause','forEach','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','getAgentStatus','voice','voiceStatus','Status','getRealtimeAgentsQueryFields','catch','getQueues','toLowerCase','key','name','outbound','dialActive','dialMethod','QueueCampaigns','startCase','Queues','filter','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','offset','undefined','count','limit','status','set','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','channel','sort','includes','globalStatus','validateSortParameter','fields','join','order','then','getRealtimeAgents','rows','getAgentIdsByStatus','length','map','User'];(function(_0x459e7c,_0x15cc0e){var _0x2aca2e=function(_0x36b8b3){while(--_0x36b8b3){_0x459e7c['push'](_0x459e7c['shift']());}};_0x2aca2e(++_0x15cc0e);}(_0xa7ad,0x173));var _0xda7a=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xa7ad[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xda7a('0x0'));var util=require(_0xda7a('0x1'));var rta=require(_0xda7a('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0xda7a('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xda7a('0x4'))[_0xda7a('0x5')];var APIHandleError=require('../../errors/api')['handleError'];function respondWithFilteredResult(_0x26ead1,_0x597772){return function(_0x2c4e96){if(_0x2c4e96){var _0x4a2c8b=typeof _0x597772[_0xda7a('0x6')]===_0xda7a('0x7')&&typeof _0x597772['limit']===_0xda7a('0x7');var _0xf6cfb0=_0x2c4e96[_0xda7a('0x8')];var _0x417441=_0x4a2c8b?0x0:_0x597772[_0xda7a('0x6')];var _0x193b30=_0x4a2c8b?_0x2c4e96['count']:_0x597772[_0xda7a('0x6')]+_0x597772[_0xda7a('0x9')];var _0x1cf589;if(_0x193b30>=_0xf6cfb0){_0x193b30=_0xf6cfb0;_0x1cf589=0xc8;}else{_0x1cf589=0xce;}_0x26ead1[_0xda7a('0xa')](_0x1cf589);return _0x26ead1[_0xda7a('0xb')]('Content-Range',_0x417441+'-'+_0x193b30+'/'+_0xf6cfb0)[_0xda7a('0xc')](_0x2c4e96);}return null;};}exports[_0xda7a('0xd')]=function(_0x1dd3b2,_0x19e6b4){var _0x158b6e={'count':0x0,'rows':[]};var _0x38b818={};var _0x68c01e;var _0x4719e1=utils[_0xda7a('0xe')]();var _0x592248;var _0x4e8814;var _0x5ef5ef=_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x10')];var _0x403779=_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x11')];var _0x2dc54f=_0x1dd3b2['query'][_0xda7a('0x12')];var _0x59f803=_0x403779===_0xda7a('0x13')||_0x403779===_0xda7a('0x14')?!![]:![];var _0x1f5a21=[];var _0x29dd04;var _0x177ac7;Promise['resolve']()['then'](function(){if(_0x1dd3b2[_0xda7a('0xf')]['channel']){if(!utils[_0xda7a('0x15')](_0x1dd3b2[_0xda7a('0xf')]['channel'])){throw new APIBadRequestError(util[_0xda7a('0x16')](_0xda7a('0x17'),_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x18')]));}_0x68c01e=_0x1dd3b2['query'][_0xda7a('0x18')]['toLowerCase']();}if(!_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x19')]||!_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x19')][_0xda7a('0x1a')](_0xda7a('0x1b'))){_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x19')]=rta[_0xda7a('0x1c')](_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x19')]);return;}var _0x4a93c5=rta['getUpdatedSortOptions'](_0x1dd3b2[_0xda7a('0xf')]['sort']);_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x19')]=_0x4a93c5[_0xda7a('0x1d')][_0xda7a('0x1e')](',');_0x29dd04=_0x4a93c5[_0xda7a('0x1f')];})[_0xda7a('0x20')](function(){if(!_0x5ef5ef){return[];}return rta['getAgentIdsByQueues'](_0x5ef5ef,_0x68c01e);})[_0xda7a('0x20')](function(_0x5e1062){_0x1f5a21=_0x5e1062;return rta[_0xda7a('0x21')]();})[_0xda7a('0x20')](function(_0x56b566){_0x4e8814=_0x56b566[_0xda7a('0x22')];if((!_0x403779||_0x59f803)&&!_0x29dd04){return _0x1f5a21;}if(_0x29dd04&&!_0x403779){return rta['getSortedAgentsIdsByStatus'](_0x4e8814,_0x1f5a21,_0x29dd04);}else{return rta[_0xda7a('0x23')](_0x4e8814,_0x1f5a21,_0x403779);}})['then'](function(_0xe8a52e){_0x1f5a21=_0xe8a52e;var _0x30c491=![];if(_0x1f5a21[_0xda7a('0x24')]===0x0){if(_0x5ef5ef||_0x403779){_0x30c491=!![];}if(_0x59f803){_0x30c491=![];}}if(_0x30c491){return _0x158b6e;}var _0x2f8828=_[_0xda7a('0x25')](db[_0xda7a('0x26')][_0xda7a('0x27')],function(_0x3118d3){return{'name':_0x3118d3[_0xda7a('0x28')],'type':_0x3118d3[_0xda7a('0x29')]['key']};});_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x2a')]=_0xda7a('0x2b');_0x38b818=qs[_0xda7a('0x2c')](_0x2f8828,_0x1dd3b2);_0x38b818['raw']=!![];var _0x404d1b=[];if(_0x1f5a21[_0xda7a('0x24')]>0x0){_0x404d1b[_0xda7a('0x2d')]({'id':{'$in':_0x1f5a21}});if(_0x29dd04&&!_0x403779){_0x177ac7=[db[_0xda7a('0x2e')][_0xda7a('0x2f')]('FIELD(id,'+_0x1f5a21+')')];_0x38b818['order']=_0x177ac7;}}if(_0x59f803){_0x4719e1['forEach'](function(_0x4cf399){var _0x46a152=!![];if(_0x403779===_0xda7a('0x14')&&_0x68c01e!==_0x4cf399){_0x46a152=![];}_0x404d1b[_0xda7a('0x2d')]({[_0x4cf399+_0xda7a('0x30')]:_0x46a152});});if(_0x2dc54f){_0x404d1b[_0xda7a('0x2d')]({'pauseType':_0x2dc54f});}}else if(_0x403779){_0x4719e1[_0xda7a('0x31')](function(_0x43166e){_0x404d1b[_0xda7a('0x2d')]({[_0x43166e+'Pause']:![]});});}_0x38b818[_0xda7a('0x32')]=_[_0xda7a('0x33')](_0x38b818['where'],{'$and':_0x404d1b});if(_0x1dd3b2[_0xda7a('0x34')][_0xda7a('0x2a')]===_0xda7a('0x34')){var _0x350d91={'params':{'id':_0x1dd3b2[_0xda7a('0x34')][_0xda7a('0x35')]},'query':{'section':_0xda7a('0x36'),'role':'agent','raw':!![],'ids':_0x1f5a21,'customSorting':_0x177ac7}};if(_0x1dd3b2[_0xda7a('0xf')][_0xda7a('0x37')]){_0x350d91['query'][_0xda7a('0x37')]=!![];}if(_0x59f803){_0x350d91['query'][_0xda7a('0x38')]=_0x404d1b;}_0x350d91[_0xda7a('0xf')]=Object[_0xda7a('0x39')](_0x350d91[_0xda7a('0xf')],_0x1dd3b2[_0xda7a('0xf')]);return db[_0xda7a('0x3a')][_0xda7a('0x3b')](_0x350d91);}return db[_0xda7a('0x26')][_0xda7a('0x3c')](_0x38b818);})['then'](function(_0x3795a2){_0x158b6e[_0xda7a('0x8')]=_0x3795a2[_0xda7a('0x8')];_0x592248=_0x3795a2[_0xda7a('0x22')];return _0x592248[_0xda7a('0x25')](function(_0x57d209){var _0x12e144=_[_0xda7a('0x3d')](_0x4e8814,['id',_0x57d209['id']]);if(_0x12e144){var _0x4c5971=rta[_0xda7a('0x3e')](_0x12e144);_['merge'](_0x57d209,_0x4c5971);}_0x57d209['globalStatus']=rta[_0xda7a('0x3f')](_0x57d209);if(_0x57d209[_0xda7a('0x1b')][_0xda7a('0x1a')](_0xda7a('0x13'))){_0x4719e1[_0xda7a('0x31')](function(_0x35009c){if(_0x57d209[_0x35009c+_0xda7a('0x30')]){if(_0x35009c===_0xda7a('0x40')){if(_0x57d209[_0xda7a('0x41')]!=='talking'){_0x57d209[_0xda7a('0x41')]=_0xda7a('0x13');}}else{_0x57d209[_0x35009c+_0xda7a('0x42')]=_0xda7a('0x13');}}});}return _0x57d209;});})[_0xda7a('0x20')](function(_0x35d8e1){if(!_0x29dd04||_0x177ac7){return _0x35d8e1;}return rta['sortAgentsByStatus'](_0x35d8e1,_0x29dd04);})[_0xda7a('0x20')](function(_0x3815da){var _0x1dfe11=rta[_0xda7a('0x43')]();_0x158b6e[_0xda7a('0x22')]=_0x3815da[_0xda7a('0x25')](function(_0x52113d){return _['pick'](_0x52113d,_0x1dfe11);});return _0x158b6e;})[_0xda7a('0x20')](respondWithFilteredResult(_0x19e6b4,_0x38b818))[_0xda7a('0x44')](APIHandleError(_0x19e6b4));};exports[_0xda7a('0x45')]=function(_0x5caeac,_0x23eca5){var _0x6563ac={'count':0x0,'rows':[]};var _0x4d2209={};var _0x197a0f;var _0x5d6685;var _0x206133;Promise['resolve']()[_0xda7a('0x20')](function(){if(_0x5caeac[_0xda7a('0xf')][_0xda7a('0x18')]){if(!utils[_0xda7a('0x15')](_0x5caeac[_0xda7a('0xf')][_0xda7a('0x18')])){throw new APIBadRequestError(util['format'](_0xda7a('0x17'),_0x5caeac[_0xda7a('0xf')][_0xda7a('0x18')]));}_0x197a0f=_0x5caeac['query'][_0xda7a('0x18')][_0xda7a('0x46')]();}var _0x14ba66=_['startCase'](_0x197a0f)+'Queue';var _0x2de14e=_[_0xda7a('0x25')](db[_0x14ba66]['rawAttributes'],function(_0x3ca0a8){return{'name':_0x3ca0a8[_0xda7a('0x28')],'type':_0x3ca0a8[_0xda7a('0x29')][_0xda7a('0x47')]};});if(!_0x5caeac['query'][_0xda7a('0x1d')]){var _0x3ada8e=['id',_0xda7a('0x48')];if(_0x197a0f===_0xda7a('0x40')){_0x3ada8e[_0xda7a('0x2d')](_0xda7a('0x29'));if(_0x5caeac['query'][_0xda7a('0x29')]===_0xda7a('0x49')){_0x3ada8e[_0xda7a('0x2d')]([_0xda7a('0x4a'),_0xda7a('0x4b')]);}}_0x5caeac[_0xda7a('0xf')][_0xda7a('0x1d')]=_0x3ada8e[_0xda7a('0x1e')](',');}_0x4d2209=qs[_0xda7a('0x2c')](_0x2de14e,_0x5caeac);if(_0x5caeac[_0xda7a('0x34')][_0xda7a('0x2a')]===_0xda7a('0x34')){var _0x3ec210={'params':{'id':_0x5caeac[_0xda7a('0x34')]['userProfileId']},'query':{'section':_0x197a0f===_0xda7a('0x40')&&_0x5caeac['query'][_0xda7a('0x29')]===_0xda7a('0x49')?_0xda7a('0x4c'):_[_0xda7a('0x4d')](_0x197a0f)+_0xda7a('0x4e'),'type':_0x5caeac[_0xda7a('0xf')][_0xda7a('0x29')],'nolimit':!![],'sort':'name','filter':_0x5caeac[_0xda7a('0xf')][_0xda7a('0x4f')]}};_0x3ec210[_0xda7a('0xf')]=Object[_0xda7a('0x39')](_0x3ec210['query'],_0x5caeac[_0xda7a('0xf')]);delete _0x3ec210[_0xda7a('0xf')]['id'];return db[_0xda7a('0x3a')]['getResources'](_0x3ec210);}return db[_0x14ba66][_0xda7a('0x3c')](_0x4d2209);})[_0xda7a('0x20')](function(_0x19b23a){_0x6563ac[_0xda7a('0x8')]=_0x19b23a[_0xda7a('0x8')];_0x5d6685=_0x19b23a['rows'];return rtq[_0xda7a('0x50')](_0x5caeac,_0x197a0f);})['then'](function(_0x1bb573){_0x206133=_0x1bb573[_0xda7a('0x22')];return rtq[_0xda7a('0x51')](_0x5d6685,_0x206133,_0x197a0f,_0x5caeac[_0xda7a('0xf')][_0xda7a('0x29')]);})[_0xda7a('0x20')](function(_0xdad613){_0x6563ac['rows']=_0xdad613;return _0x6563ac;})[_0xda7a('0x20')](respondWithFilteredResult(_0x23eca5,_0x4d2209))['catch'](APIHandleError(_0x23eca5));}; \ No newline at end of file +var _0x0106=['globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','then','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','length','map','User','fieldName','type','key','getOptions','raw','sequelize','FIELD(id,','forEach','push','Pause','where','merge','user','role','userProfileId','Agents','agent','online','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','voiceStatus','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues','Queue','name','voice','dialActive','dialMethod','outbound','startCase','Queues','filter','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../config/utils','APIBadRequestError','../../errors/api','handleError','offset','undefined','limit','count','status','Content-Range','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0x0106,0x187));var _0x6010=function(_0x5d9eae,_0x265fbf){_0x5d9eae=_0x5d9eae-0x0;var _0x5e29f7=_0x0106[_0x5d9eae];return _0x5e29f7;};'use strict';var _=require(_0x6010('0x0'));var util=require(_0x6010('0x1'));var rta=require(_0x6010('0x2'));var rtq=require(_0x6010('0x3'));var qs=require('../../components/parsers/qs');var utils=require(_0x6010('0x4'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require('../../errors/api')[_0x6010('0x5')];var APIHandleError=require(_0x6010('0x6'))[_0x6010('0x7')];function respondWithFilteredResult(_0x4b4f80,_0x5586d8){return function(_0x87c694){if(_0x87c694){var _0x1234bc=typeof _0x5586d8[_0x6010('0x8')]===_0x6010('0x9')&&typeof _0x5586d8[_0x6010('0xa')]==='undefined';var _0x2d2a02=_0x87c694[_0x6010('0xb')];var _0x344d25=_0x1234bc?0x0:_0x5586d8[_0x6010('0x8')];var _0xa589b6=_0x1234bc?_0x87c694[_0x6010('0xb')]:_0x5586d8[_0x6010('0x8')]+_0x5586d8['limit'];var _0x1ff40a;if(_0xa589b6>=_0x2d2a02){_0xa589b6=_0x2d2a02;_0x1ff40a=0xc8;}else{_0x1ff40a=0xce;}_0x4b4f80[_0x6010('0xc')](_0x1ff40a);return _0x4b4f80['set'](_0x6010('0xd'),_0x344d25+'-'+_0xa589b6+'/'+_0x2d2a02)['json'](_0x87c694);}return null;};}exports[_0x6010('0xe')]=function(_0x28d5d2,_0x57f43a){var _0x650c18={'count':0x0,'rows':[]};var _0x37d21a={};var _0x3b18b1;var _0x74ab76=utils[_0x6010('0xf')]();var _0x4b1749;var _0x4ea348;var _0x5c0cbc=_0x28d5d2[_0x6010('0x10')]['globalQueueFilter'];var _0x1ad37b=_0x28d5d2[_0x6010('0x10')][_0x6010('0x11')];var _0x31a843=_0x28d5d2['query'][_0x6010('0x12')];var _0x2c45cc=_0x1ad37b===_0x6010('0x13')||_0x1ad37b===_0x6010('0x14')?!![]:![];var _0x2f043b=[];var _0x28d09b;var _0x471f71;Promise[_0x6010('0x15')]()['then'](function(){if(_0x28d5d2[_0x6010('0x10')][_0x6010('0x16')]){if(!utils[_0x6010('0x17')](_0x28d5d2[_0x6010('0x10')][_0x6010('0x16')])){throw new APIBadRequestError(util[_0x6010('0x18')](_0x6010('0x19'),_0x28d5d2[_0x6010('0x10')][_0x6010('0x16')]));}_0x3b18b1=_0x28d5d2[_0x6010('0x10')][_0x6010('0x16')][_0x6010('0x1a')]();}if(!_0x28d5d2[_0x6010('0x10')]['sort']||!_0x28d5d2[_0x6010('0x10')][_0x6010('0x1b')][_0x6010('0x1c')](_0x6010('0x1d'))){_0x28d5d2[_0x6010('0x10')][_0x6010('0x1b')]=rta[_0x6010('0x1e')](_0x28d5d2[_0x6010('0x10')]['sort']);return;}var _0xc7db0=rta[_0x6010('0x1f')](_0x28d5d2[_0x6010('0x10')]['sort']);_0x28d5d2[_0x6010('0x10')][_0x6010('0x1b')]=_0xc7db0[_0x6010('0x20')][_0x6010('0x21')](',');_0x28d09b=_0xc7db0[_0x6010('0x22')];})[_0x6010('0x23')](function(){if(!_0x5c0cbc){return[];}return rta[_0x6010('0x24')](_0x5c0cbc,_0x3b18b1);})['then'](function(_0x136dc0){_0x2f043b=_0x136dc0;return rta[_0x6010('0x25')]();})['then'](function(_0xb5d269){_0x4ea348=_0xb5d269[_0x6010('0x26')];if((!_0x1ad37b||_0x2c45cc)&&!_0x28d09b){return _0x2f043b;}if(_0x28d09b&&!_0x1ad37b){return rta['getSortedAgentsIdsByStatus'](_0x4ea348,_0x2f043b,_0x28d09b);}else{return rta[_0x6010('0x27')](_0x4ea348,_0x2f043b,_0x1ad37b);}})['then'](function(_0x1cd4b2){_0x2f043b=_0x1cd4b2;var _0x3cdfe2=![];if(_0x2f043b[_0x6010('0x28')]===0x0){if(_0x5c0cbc||_0x1ad37b){_0x3cdfe2=!![];}if(_0x2c45cc){_0x3cdfe2=![];}}if(_0x3cdfe2){return _0x650c18;}var _0x164915=_[_0x6010('0x29')](db[_0x6010('0x2a')]['rawAttributes'],function(_0x46b5fd){return{'name':_0x46b5fd[_0x6010('0x2b')],'type':_0x46b5fd[_0x6010('0x2c')][_0x6010('0x2d')]};});_0x28d5d2['query']['role']='agent';_0x37d21a=qs[_0x6010('0x2e')](_0x164915,_0x28d5d2);_0x37d21a[_0x6010('0x2f')]=!![];var _0x57ade6=[];if(_0x2f043b[_0x6010('0x28')]>0x0){_0x57ade6['push']({'id':{'$in':_0x2f043b}});if(_0x28d09b&&!_0x1ad37b){_0x471f71=[db[_0x6010('0x30')]['literal'](_0x6010('0x31')+_0x2f043b+')')];_0x37d21a[_0x6010('0x22')]=_0x471f71;}}if(_0x2c45cc){_0x74ab76[_0x6010('0x32')](function(_0x5420d4){var _0x582f2b=!![];if(_0x1ad37b===_0x6010('0x14')&&_0x3b18b1!==_0x5420d4){_0x582f2b=![];}_0x57ade6[_0x6010('0x33')]({[_0x5420d4+_0x6010('0x34')]:_0x582f2b});});if(_0x31a843){_0x57ade6[_0x6010('0x33')]({'pauseType':_0x31a843});}}else if(_0x1ad37b){_0x74ab76[_0x6010('0x32')](function(_0x3d429c){_0x57ade6[_0x6010('0x33')]({[_0x3d429c+'Pause']:![]});});}_0x37d21a[_0x6010('0x35')]=_[_0x6010('0x36')](_0x37d21a[_0x6010('0x35')],{'$and':_0x57ade6});if(_0x28d5d2[_0x6010('0x37')][_0x6010('0x38')]===_0x6010('0x37')){var _0x3aa0cb={'params':{'id':_0x28d5d2['user'][_0x6010('0x39')]},'query':{'section':_0x6010('0x3a'),'role':_0x6010('0x3b'),'raw':!![],'ids':_0x2f043b,'customSorting':_0x471f71}};if(_0x28d5d2[_0x6010('0x10')][_0x6010('0x3c')]){_0x3aa0cb[_0x6010('0x10')][_0x6010('0x3c')]=!![];}if(_0x2c45cc){_0x3aa0cb[_0x6010('0x10')]['extraQueryConditions']=_0x57ade6;}_0x3aa0cb['query']=Object[_0x6010('0x3d')](_0x3aa0cb[_0x6010('0x10')],_0x28d5d2[_0x6010('0x10')]);return db[_0x6010('0x3e')][_0x6010('0x3f')](_0x3aa0cb);}return db[_0x6010('0x2a')][_0x6010('0x40')](_0x37d21a);})[_0x6010('0x23')](function(_0x2584e8){_0x650c18[_0x6010('0xb')]=_0x2584e8['count'];_0x4b1749=_0x2584e8[_0x6010('0x26')];return _0x4b1749[_0x6010('0x29')](function(_0x59ea5d){var _0x22f38f=_['find'](_0x4ea348,['id',_0x59ea5d['id']]);if(_0x22f38f){var _0x195ea0=rta[_0x6010('0x41')](_0x22f38f);_[_0x6010('0x36')](_0x59ea5d,_0x195ea0);}_0x59ea5d[_0x6010('0x1d')]=rta['getAgentStatus'](_0x59ea5d);if(_0x59ea5d[_0x6010('0x1d')][_0x6010('0x1c')](_0x6010('0x13'))){_0x74ab76[_0x6010('0x32')](function(_0x5fa074){if(_0x59ea5d[_0x5fa074+'Pause']){if(_0x5fa074==='voice'){if(_0x59ea5d[_0x6010('0x42')]!=='talking'){_0x59ea5d['voiceStatus']='pause';}}else{_0x59ea5d[_0x5fa074+_0x6010('0x43')]=_0x6010('0x13');}}});}return _0x59ea5d;});})[_0x6010('0x23')](function(_0x4aa1f6){if(!_0x28d09b||_0x471f71){return _0x4aa1f6;}return rta[_0x6010('0x44')](_0x4aa1f6,_0x28d09b);})['then'](function(_0x24a00d){var _0x47f623=rta[_0x6010('0x45')]();_0x650c18[_0x6010('0x26')]=_0x24a00d[_0x6010('0x29')](function(_0xfda8fd){return _[_0x6010('0x46')](_0xfda8fd,_0x47f623);});return _0x650c18;})['then'](respondWithFilteredResult(_0x57f43a,_0x37d21a))[_0x6010('0x47')](APIHandleError(_0x57f43a));};exports[_0x6010('0x48')]=function(_0x96ecd8,_0x4a6d56){var _0x56a1d2={'count':0x0,'rows':[]};var _0x7426cd={};var _0x1623cb;var _0x78d7f8;var _0x16ce9f;Promise['resolve']()[_0x6010('0x23')](function(){if(_0x96ecd8[_0x6010('0x10')]['channel']){if(!utils['isValidChannel'](_0x96ecd8[_0x6010('0x10')][_0x6010('0x16')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x96ecd8[_0x6010('0x10')][_0x6010('0x16')]));}_0x1623cb=_0x96ecd8[_0x6010('0x10')][_0x6010('0x16')]['toLowerCase']();}var _0x2af9a3=_['startCase'](_0x1623cb)+_0x6010('0x49');var _0x58a70a=_[_0x6010('0x29')](db[_0x2af9a3]['rawAttributes'],function(_0x35d0bc){return{'name':_0x35d0bc['fieldName'],'type':_0x35d0bc[_0x6010('0x2c')][_0x6010('0x2d')]};});if(!_0x96ecd8['query']['fields']){var _0x5964eb=['id',_0x6010('0x4a')];if(_0x1623cb===_0x6010('0x4b')){_0x5964eb[_0x6010('0x33')](_0x6010('0x2c'));if(_0x96ecd8[_0x6010('0x10')][_0x6010('0x2c')]==='outbound'){_0x5964eb[_0x6010('0x33')]([_0x6010('0x4c'),_0x6010('0x4d')]);}}_0x96ecd8[_0x6010('0x10')][_0x6010('0x20')]=_0x5964eb[_0x6010('0x21')](',');}_0x7426cd=qs['getOptions'](_0x58a70a,_0x96ecd8);if(_0x96ecd8[_0x6010('0x37')][_0x6010('0x38')]===_0x6010('0x37')){var _0x188ad0={'params':{'id':_0x96ecd8[_0x6010('0x37')][_0x6010('0x39')]},'query':{'section':_0x1623cb===_0x6010('0x4b')&&_0x96ecd8['query'][_0x6010('0x2c')]===_0x6010('0x4e')?'QueueCampaigns':_[_0x6010('0x4f')](_0x1623cb)+_0x6010('0x50'),'type':_0x96ecd8['query']['type'],'nolimit':!![],'sort':_0x6010('0x4a'),'filter':_0x96ecd8['query'][_0x6010('0x51')]}};_0x188ad0[_0x6010('0x10')]=Object[_0x6010('0x3d')](_0x188ad0[_0x6010('0x10')],_0x96ecd8[_0x6010('0x10')]);delete _0x188ad0['query']['id'];return db[_0x6010('0x3e')][_0x6010('0x3f')](_0x188ad0);}return db[_0x2af9a3][_0x6010('0x40')](_0x7426cd);})[_0x6010('0x23')](function(_0x222fad){_0x56a1d2[_0x6010('0xb')]=_0x222fad['count'];_0x78d7f8=_0x222fad['rows'];return rtq[_0x6010('0x52')](_0x96ecd8,_0x1623cb);})[_0x6010('0x23')](function(_0x148ca9){_0x16ce9f=_0x148ca9[_0x6010('0x26')];return rtq[_0x6010('0x53')](_0x78d7f8,_0x16ce9f,_0x1623cb,_0x96ecd8[_0x6010('0x10')][_0x6010('0x2c')]);})[_0x6010('0x23')](function(_0x1292b8){_0x56a1d2['rows']=_0x1292b8;return _0x56a1d2;})[_0x6010('0x23')](respondWithFilteredResult(_0x4a6d56,_0x7426cd))[_0x6010('0x47')](APIHandleError(_0x4a6d56));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 28f5a3c..b9ab2d0 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x18806b,_0x1b9505){var _0x527c1e=function(_0x46becc){while(--_0x46becc){_0x18806b['push'](_0x18806b['shift']());}};_0x527c1e(++_0x1b9505);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1074a0,_0x52eabc){var _0x46456f=function(_0x4d9036){while(--_0x4d9036){_0x1074a0['push'](_0x1074a0['shift']());}};_0x46456f(++_0x52eabc);}(_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 diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index ef032e6..cc6ed25 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 _0x972c=['STRING','DATE','INTEGER'];(function(_0x8c366,_0x4fe9f7){var _0x2ca038=function(_0x1d5197){while(--_0x1d5197){_0x8c366['push'](_0x8c366['shift']());}};_0x2ca038(++_0x4fe9f7);}(_0x972c,0xf2));var _0xc972=function(_0x47b08f,_0xa05c34){_0x47b08f=_0x47b08f-0x0;var _0x215509=_0x972c[_0x47b08f];return _0x215509;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xc972('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xc972('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xc972('0x1')]},'starttime':{'type':Sequelize[_0xc972('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc972('0x1')]},'campaigntype':{'type':Sequelize[_0xc972('0x1')]},'membername':{'type':Sequelize[_0xc972('0x1')]}}; \ No newline at end of file +var _0x74f3=['STRING','sequelize','exports','INTEGER','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74f3,0x164));var _0x374f=function(_0x2c3c95,_0x3a91c2){_0x2c3c95=_0x2c3c95-0x0;var _0x43b407=_0x74f3[_0x2c3c95];return _0x43b407;};'use strict';var Sequelize=require(_0x374f('0x0'));module[_0x374f('0x1')]={'state':{'type':Sequelize[_0x374f('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x374f('0x3')]},'uniqueid':{'type':Sequelize[_0x374f('0x4')]},'starttime':{'type':Sequelize[_0x374f('0x3')]},'responsetime':{'type':Sequelize[_0x374f('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x374f('0x4')]},'campaigntype':{'type':Sequelize[_0x374f('0x4')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 4351fbc..4d6d8db 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 _0xe4e3=['api','moment','bluebird','request-promise','path','rimraf','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x101350,_0x5854ee){var _0x214977=function(_0x493346){while(--_0x493346){_0x101350['push'](_0x101350['shift']());}};_0x214977(++_0x5854ee);}(_0xe4e3,0x128));var _0x3e4e=function(_0x25102b,_0x28fe76){_0x25102b=_0x25102b-0x0;var _0x4e38a9=_0xe4e3[_0x25102b];return _0x4e38a9;};'use strict';var _=require(_0x3e4e('0x0'));var util=require(_0x3e4e('0x1'));var logger=require(_0x3e4e('0x2'))(_0x3e4e('0x3'));var moment=require(_0x3e4e('0x4'));var BPromise=require(_0x3e4e('0x5'));var rp=require(_0x3e4e('0x6'));var fs=require('fs');var path=require(_0x3e4e('0x7'));var rimraf=require(_0x3e4e('0x8'));var config=require('../../config/environment');var attributes=require(_0x3e4e('0x9'));module['exports']=function(_0x31da25,_0x3c3984){return _0x31da25[_0x3e4e('0xa')](_0x3e4e('0xb'),attributes,{'tableName':_0x3e4e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4467=['./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x4449fb,_0x1b8b7f){var _0x269014=function(_0x28dcc2){while(--_0x28dcc2){_0x4449fb['push'](_0x4449fb['shift']());}};_0x269014(++_0x1b8b7f);}(_0x4467,0x10c));var _0x7446=function(_0x473e51,_0x34967d){_0x473e51=_0x473e51-0x0;var _0x405f1c=_0x4467[_0x473e51];return _0x405f1c;};'use strict';var _=require(_0x7446('0x0'));var util=require(_0x7446('0x1'));var logger=require(_0x7446('0x2'))('api');var moment=require(_0x7446('0x3'));var BPromise=require(_0x7446('0x4'));var rp=require(_0x7446('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7446('0x6'));var attributes=require(_0x7446('0x7'));module[_0x7446('0x8')]=function(_0x1728cc,_0x4851b4){return _0x1728cc[_0x7446('0x9')]('ReportAgentPreview',attributes,{'tableName':_0x7446('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 9b9dbce..be75534 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 _0x4d5b=['ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','body','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x379a7f,_0x11fb50){var _0x3d3194=function(_0x1a992d){while(--_0x1a992d){_0x379a7f['push'](_0x379a7f['shift']());}};_0x3d3194(++_0x11fb50);}(_0x4d5b,0x1af));var _0xb4d5=function(_0x3c8891,_0x3fa7bb){_0x3c8891=_0x3c8891-0x0;var _0x4c6e00=_0x4d5b[_0x3c8891];return _0x4c6e00;};'use strict';var _=require(_0xb4d5('0x0'));var util=require(_0xb4d5('0x1'));var moment=require(_0xb4d5('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4d5('0x3'));var fs=require('fs');var Redis=require(_0xb4d5('0x4'));var db=require(_0xb4d5('0x5'))['db'];var utils=require(_0xb4d5('0x6'));var logger=require('../../config/logger')(_0xb4d5('0x7'));var config=require(_0xb4d5('0x8'));var jayson=require(_0xb4d5('0x9'));var client=jayson[_0xb4d5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1964aa,_0x4286b,_0x354f14){return new BPromise(function(_0x8431ae,_0x1f6783){return client[_0xb4d5('0xb')](_0x1964aa,_0x354f14)[_0xb4d5('0xc')](function(_0x42d37b){logger[_0xb4d5('0xd')](_0xb4d5('0xe'),_0x4286b,_0xb4d5('0xf'));logger[_0xb4d5('0x10')](_0xb4d5('0x11'),_0x4286b,_0xb4d5('0xf'),JSON['stringify'](_0x42d37b));if(_0x42d37b[_0xb4d5('0x12')]){if(_0x42d37b[_0xb4d5('0x12')][_0xb4d5('0x13')]===0x1f4){logger[_0xb4d5('0x12')](_0xb4d5('0xe'),_0x4286b,_0x42d37b['error'][_0xb4d5('0x14')]);return _0x1f6783(_0x42d37b['error']['message']);}logger[_0xb4d5('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x4286b,_0x42d37b['error'][_0xb4d5('0x14')]);return _0x8431ae(_0x42d37b[_0xb4d5('0x12')]['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x4286b,_0xb4d5('0xf'));_0x8431ae(_0x42d37b[_0xb4d5('0x15')]['message']);}})[_0xb4d5('0x16')](function(_0xec97f0){logger[_0xb4d5('0x12')](_0xb4d5('0xe'),_0x4286b,_0xec97f0);_0x1f6783(_0xec97f0);});});}exports[_0xb4d5('0x17')]=function(_0x3fe8c9){var _0x39ce48=this;return new Promise(function(_0x669ed4,_0x511a9a){return db['ReportAgentPreview']['create'](_0x3fe8c9[_0xb4d5('0x18')],{'raw':_0x3fe8c9[_0xb4d5('0x19')]?_0x3fe8c9[_0xb4d5('0x19')][_0xb4d5('0x1a')]===undefined?!![]:![]:!![]})[_0xb4d5('0xc')](function(_0x68bc20){logger[_0xb4d5('0xd')](_0xb4d5('0x17'),_0x3fe8c9);logger[_0xb4d5('0x10')](_0xb4d5('0x17'),_0x3fe8c9,JSON[_0xb4d5('0x1b')](_0x68bc20));_0x669ed4(_0x68bc20);})['catch'](function(_0x284f85){logger['error'](_0xb4d5('0x17'),_0x284f85[_0xb4d5('0x14')],_0x3fe8c9);_0x511a9a(_0x39ce48['error'](0x1f4,_0x284f85['message']));});});}; \ No newline at end of file +var _0x7fd3=['../../config/logger','../../config/environment','jayson/promise','http','request','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ReportAgentPreview','options','raw','then','info','CreateReportAgentPreview','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2d8af0,_0x305bd8){var _0x5112e8=function(_0x3166d9){while(--_0x3166d9){_0x2d8af0['push'](_0x2d8af0['shift']());}};_0x5112e8(++_0x305bd8);}(_0x7fd3,0x172));var _0x37fd=function(_0x151116,_0x35c3bd){_0x151116=_0x151116-0x0;var _0x33f476=_0x7fd3[_0x151116];return _0x33f476;};'use strict';var _=require(_0x37fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x37fd('0x1'));var rs=require(_0x37fd('0x2'));var fs=require('fs');var Redis=require(_0x37fd('0x3'));var db=require(_0x37fd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x37fd('0x5'))('rpc');var config=require(_0x37fd('0x6'));var jayson=require(_0x37fd('0x7'));var client=jayson['client'][_0x37fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f4fa6,_0x6b960c,_0x1007c5){return new BPromise(function(_0x513fa7,_0x1d1716){return client[_0x37fd('0x9')](_0x2f4fa6,_0x1007c5)['then'](function(_0x10b829){logger['info'](_0x37fd('0xa'),_0x6b960c,'request\x20sent');logger[_0x37fd('0xb')](_0x37fd('0xc'),_0x6b960c,_0x37fd('0xd'),JSON[_0x37fd('0xe')](_0x10b829));if(_0x10b829[_0x37fd('0xf')]){if(_0x10b829['error']['code']===0x1f4){logger[_0x37fd('0xf')](_0x37fd('0xa'),_0x6b960c,_0x10b829['error'][_0x37fd('0x10')]);return _0x1d1716(_0x10b829[_0x37fd('0xf')][_0x37fd('0x10')]);}logger[_0x37fd('0xf')](_0x37fd('0xa'),_0x6b960c,_0x10b829['error'][_0x37fd('0x10')]);return _0x513fa7(_0x10b829['error'][_0x37fd('0x10')]);}else{logger['info'](_0x37fd('0xa'),_0x6b960c,_0x37fd('0xd'));_0x513fa7(_0x10b829[_0x37fd('0x11')][_0x37fd('0x10')]);}})[_0x37fd('0x12')](function(_0x4c7a9b){logger[_0x37fd('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x6b960c,_0x4c7a9b);_0x1d1716(_0x4c7a9b);});});}exports['CreateReportAgentPreview']=function(_0x3cf890){var _0x1cc957=this;return new Promise(function(_0x2e63e3,_0x5049f1){return db[_0x37fd('0x13')]['create'](_0x3cf890['body'],{'raw':_0x3cf890[_0x37fd('0x14')]?_0x3cf890['options'][_0x37fd('0x15')]===undefined?!![]:![]:!![]})[_0x37fd('0x16')](function(_0x1e0fbe){logger[_0x37fd('0x17')]('CreateReportAgentPreview',_0x3cf890);logger['debug'](_0x37fd('0x18'),_0x3cf890,JSON[_0x37fd('0xe')](_0x1e0fbe));_0x2e63e3(_0x1e0fbe);})[_0x37fd('0x12')](function(_0x530366){logger[_0x37fd('0xf')](_0x37fd('0x18'),_0x530366[_0x37fd('0x10')],_0x3cf890);_0x5049f1(_0x1cc957[_0x37fd('0xf')](0x1f4,_0x530366[_0x37fd('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index a53e24d..324d896 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 _0xc61b=['/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agentCapacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues'];(function(_0x1425c8,_0x284f88){var _0x218bd5=function(_0x115571){while(--_0x115571){_0x1425c8['push'](_0x1425c8['shift']());}};_0x218bd5(++_0x284f88);}(_0xc61b,0x1dc));var _0xbc61=function(_0x217ba8,_0x2fd0ae){_0x217ba8=_0x217ba8-0x0;var _0x1ab871=_0xc61b[_0x217ba8];return _0x1ab871;};'use strict';var multer=require('multer');var util=require(_0xbc61('0x0'));var path=require(_0xbc61('0x1'));var express=require(_0xbc61('0x2'));var router=express['Router']();var auth=require(_0xbc61('0x3'));var controller=require(_0xbc61('0x4'));router[_0xbc61('0x5')](_0xbc61('0x6'),auth[_0xbc61('0x7')](),controller['voiceChannels']);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0xbc61('0x7')](),controller[_0xbc61('0x8')]);router['get'](_0xbc61('0x9'),auth[_0xbc61('0x7')](),controller[_0xbc61('0xa')]);router[_0xbc61('0x5')](_0xbc61('0xb'),auth[_0xbc61('0x7')](),controller['voiceQueues']);router['get'](_0xbc61('0xc'),auth['isAuthenticated'](),controller['chatQueues']);router[_0xbc61('0x5')](_0xbc61('0xd'),auth[_0xbc61('0x7')](),controller[_0xbc61('0xe')]);router['get'](_0xbc61('0xf'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x10')]);router[_0xbc61('0x5')](_0xbc61('0x11'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x12')]);router[_0xbc61('0x5')](_0xbc61('0x13'),auth[_0xbc61('0x7')](),controller['smsQueues']);router[_0xbc61('0x5')](_0xbc61('0x14'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x15')]);router[_0xbc61('0x5')](_0xbc61('0x16'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x17')]);router[_0xbc61('0x5')](_0xbc61('0x18'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x19')]);router['get']('/voice/queues/channels',auth[_0xbc61('0x7')](),controller[_0xbc61('0x1a')]);router[_0xbc61('0x5')]('/voice/queues/channels/:uniqueid',auth[_0xbc61('0x7')](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xbc61('0x5')](_0xbc61('0x1b'),auth['isAuthenticated'](),controller[_0xbc61('0x1c')]);router[_0xbc61('0x5')](_0xbc61('0x1d'),auth[_0xbc61('0x7')](),controller['showVoiceQueues']);router[_0xbc61('0x1e')](_0xbc61('0x1d'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x1f')]);router[_0xbc61('0x5')](_0xbc61('0x20'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x21')]);router[_0xbc61('0x5')](_0xbc61('0x22'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x23')]);router[_0xbc61('0x5')]('/agents',auth[_0xbc61('0x7')](),controller['agents']);router[_0xbc61('0x1e')]('/agents/:id/capacity',auth[_0xbc61('0x7')](),controller[_0xbc61('0x24')]);router[_0xbc61('0x5')](_0xbc61('0x25'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x26')]);router[_0xbc61('0x5')]('/trunks',auth['isAuthenticated'](),controller[_0xbc61('0x27')]);router[_0xbc61('0x5')]('/campaigns',auth[_0xbc61('0x7')](),controller[_0xbc61('0x28')]);router['get'](_0xbc61('0x29'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x2a')]);router[_0xbc61('0x5')](_0xbc61('0x2b'),auth['isAuthenticated'](),controller[_0xbc61('0x2c')]);router[_0xbc61('0x5')](_0xbc61('0x2d'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x2e')]);router[_0xbc61('0x5')](_0xbc61('0x2f'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xbc61('0x5')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0xbc61('0x30')]);router[_0xbc61('0x5')]('/sms/queues/waitinginteractions',auth[_0xbc61('0x7')](),controller[_0xbc61('0x31')]);router['get'](_0xbc61('0x32'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0xbc61('0x5')](_0xbc61('0x33'),auth['isAuthenticated'](),controller[_0xbc61('0x34')]);router[_0xbc61('0x35')]('/mail/queues/:id/notify',auth[_0xbc61('0x7')](),controller[_0xbc61('0x36')](_0xbc61('0x37')));router[_0xbc61('0x5')](_0xbc61('0x38'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x39')]);router[_0xbc61('0x35')](_0xbc61('0x3a'),auth[_0xbc61('0x7')](),controller['queueNotify']('chat'));router[_0xbc61('0x5')]('/chat/queues/:id',auth[_0xbc61('0x7')](),controller['showChatQueues']);router[_0xbc61('0x35')](_0xbc61('0x3b'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x36')](_0xbc61('0x3c')));router['get'](_0xbc61('0x3d'),auth['isAuthenticated'](),controller[_0xbc61('0x3e')]);router[_0xbc61('0x35')](_0xbc61('0x3f'),auth[_0xbc61('0x7')](),controller['queueNotify'](_0xbc61('0x40')));router[_0xbc61('0x5')](_0xbc61('0x41'),auth[_0xbc61('0x7')](),controller['showOpenchannelQueues']);router[_0xbc61('0x35')](_0xbc61('0x42'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x36')](_0xbc61('0x43')));router['post'](_0xbc61('0x44'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x36')](_0xbc61('0x45')));router['get'](_0xbc61('0x46'),auth[_0xbc61('0x7')](),controller[_0xbc61('0x47')]);router[_0xbc61('0x5')](_0xbc61('0x48'),auth['isAuthenticated'](),controller[_0xbc61('0x49')]);router[_0xbc61('0x35')](_0xbc61('0x4a'),auth['isAuthenticated'](),controller[_0xbc61('0x4b')]);module[_0xbc61('0x4c')]=router; \ No newline at end of file +var _0x87a1=['/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','/openchannel/queues','/sms/queues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','outboundChannels','/agents','agentCapacity','/telephones','telephones','trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post'];(function(_0x4abb10,_0x26897f){var _0x2494fe=function(_0x44c085){while(--_0x44c085){_0x4abb10['push'](_0x4abb10['shift']());}};_0x2494fe(++_0x26897f);}(_0x87a1,0x1c5));var _0x187a=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x87a1[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x187a('0x0'));var express=require(_0x187a('0x1'));var router=express['Router']();var auth=require(_0x187a('0x2'));var controller=require(_0x187a('0x3'));router[_0x187a('0x4')](_0x187a('0x5'),auth['isAuthenticated'](),controller[_0x187a('0x6')]);router[_0x187a('0x4')](_0x187a('0x7'),auth[_0x187a('0x8')](),controller[_0x187a('0x9')]);router[_0x187a('0x4')](_0x187a('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x187a('0x4')](_0x187a('0xb'),auth[_0x187a('0x8')](),controller[_0x187a('0xc')]);router['get']('/chat/queues',auth[_0x187a('0x8')](),controller[_0x187a('0xd')]);router[_0x187a('0x4')](_0x187a('0xe'),auth['isAuthenticated'](),controller['mailQueues']);router['get']('/mail/accounts',auth[_0x187a('0x8')](),controller['mailAccounts']);router[_0x187a('0x4')](_0x187a('0xf'),auth[_0x187a('0x8')](),controller['openchannelQueues']);router[_0x187a('0x4')](_0x187a('0x10'),auth[_0x187a('0x8')](),controller['smsQueues']);router[_0x187a('0x4')](_0x187a('0x11'),auth[_0x187a('0x8')](),controller[_0x187a('0x12')]);router['get']('/fax/queues',auth[_0x187a('0x8')](),controller[_0x187a('0x13')]);router['get'](_0x187a('0x14'),auth['isAuthenticated'](),controller[_0x187a('0x15')]);router['get'](_0x187a('0x16'),auth[_0x187a('0x8')](),controller[_0x187a('0x17')]);router[_0x187a('0x4')](_0x187a('0x18'),auth[_0x187a('0x8')](),controller[_0x187a('0x19')]);router[_0x187a('0x4')](_0x187a('0x1a'),auth[_0x187a('0x8')](),controller[_0x187a('0x1b')]);router[_0x187a('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x187a('0x8')](),controller[_0x187a('0x1c')]);router[_0x187a('0x4')](_0x187a('0x1d'),auth['isAuthenticated'](),controller[_0x187a('0x1e')]);router[_0x187a('0x1f')]('/voice/queues/:id',auth[_0x187a('0x8')](),controller['updateVoiceQueue']);router[_0x187a('0x4')]('/outbound',auth[_0x187a('0x8')](),controller['outbound']);router['get']('/outbound/channels',auth['isAuthenticated'](),controller[_0x187a('0x20')]);router[_0x187a('0x4')](_0x187a('0x21'),auth[_0x187a('0x8')](),controller['agents']);router[_0x187a('0x1f')]('/agents/:id/capacity',auth[_0x187a('0x8')](),controller[_0x187a('0x22')]);router[_0x187a('0x4')](_0x187a('0x23'),auth[_0x187a('0x8')](),controller[_0x187a('0x24')]);router[_0x187a('0x4')]('/trunks',auth[_0x187a('0x8')](),controller[_0x187a('0x25')]);router['get'](_0x187a('0x26'),auth[_0x187a('0x8')](),controller['campaigns']);router[_0x187a('0x4')]('/fax/accounts',auth[_0x187a('0x8')](),controller[_0x187a('0x27')]);router[_0x187a('0x4')](_0x187a('0x28'),auth[_0x187a('0x8')](),controller[_0x187a('0x29')]);router[_0x187a('0x4')](_0x187a('0x2a'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x187a('0x4')](_0x187a('0x2b'),auth[_0x187a('0x8')](),controller[_0x187a('0x2c')]);router[_0x187a('0x4')](_0x187a('0x2d'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x187a('0x4')](_0x187a('0x2e'),auth[_0x187a('0x8')](),controller[_0x187a('0x2f')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x187a('0x8')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x187a('0x30'),auth['isAuthenticated'](),controller[_0x187a('0x31')]);router[_0x187a('0x32')](_0x187a('0x33'),auth[_0x187a('0x8')](),controller[_0x187a('0x34')](_0x187a('0x35')));router[_0x187a('0x4')]('/mail/queues/:id',auth[_0x187a('0x8')](),controller[_0x187a('0x36')]);router['post'](_0x187a('0x37'),auth[_0x187a('0x8')](),controller[_0x187a('0x34')](_0x187a('0x38')));router[_0x187a('0x4')](_0x187a('0x39'),auth[_0x187a('0x8')](),controller[_0x187a('0x3a')]);router['post'](_0x187a('0x3b'),auth['isAuthenticated'](),controller['queueNotify'](_0x187a('0x3c')));router[_0x187a('0x4')]('/fax/queues/:id',auth[_0x187a('0x8')](),controller[_0x187a('0x3d')]);router[_0x187a('0x32')](_0x187a('0x3e'),auth[_0x187a('0x8')](),controller[_0x187a('0x34')](_0x187a('0x3f')));router['get'](_0x187a('0x40'),auth[_0x187a('0x8')](),controller[_0x187a('0x41')]);router[_0x187a('0x32')](_0x187a('0x42'),auth['isAuthenticated'](),controller[_0x187a('0x34')](_0x187a('0x43')));router['post'](_0x187a('0x44'),auth['isAuthenticated'](),controller[_0x187a('0x34')]('whatsapp'));router['get'](_0x187a('0x45'),auth[_0x187a('0x8')](),controller['showSmsQueues']);router[_0x187a('0x4')](_0x187a('0x46'),auth[_0x187a('0x8')](),controller[_0x187a('0x47')]);router[_0x187a('0x32')]('/agents/:id/notify',auth[_0x187a('0x8')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index afa63db..4977d96 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 _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x2e7c2a,_0x375a1d){var _0x55f9bb=function(_0x1b8d06){while(--_0x1b8d06){_0x2e7c2a['push'](_0x2e7c2a['shift']());}};_0x55f9bb(++_0x375a1d);}(_0xe706,0xa3));var _0x6e70=function(_0x23e5ce,_0x57584d){_0x23e5ce=_0x23e5ce-0x0;var _0x2ce19b=_0xe706[_0x23e5ce];return _0x2ce19b;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x3e14db,_0x5532aa){var _0x2eca42=function(_0x26afa2){while(--_0x26afa2){_0x3e14db['push'](_0x3e14db['shift']());}};_0x2eca42(++_0x5532aa);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index d562aeb..23d3d04 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 _0x14c7=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','/:id','/:id/run','run','post','create','put','update','delete','destroy','exports'];(function(_0x5134d9,_0x9f56e9){var _0x2cb90f=function(_0x24ece5){while(--_0x24ece5){_0x5134d9['push'](_0x5134d9['shift']());}};_0x2cb90f(++_0x9f56e9);}(_0x14c7,0x104));var _0x714c=function(_0x31fe49,_0x414cf0){_0x31fe49=_0x31fe49-0x0;var _0x456084=_0x14c7[_0x31fe49];return _0x456084;};'use strict';var multer=require(_0x714c('0x0'));var util=require(_0x714c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x714c('0x2'));var router=express[_0x714c('0x3')]();var fs_extra=require(_0x714c('0x4'));var auth=require(_0x714c('0x5'));var interaction=require(_0x714c('0x6'));var config=require('../../config/environment');var controller=require(_0x714c('0x7'));router[_0x714c('0x8')]('/',auth[_0x714c('0x9')](),controller['index']);router[_0x714c('0x8')](_0x714c('0xa'),auth[_0x714c('0x9')](),controller['show']);router[_0x714c('0x8')](_0x714c('0xb'),auth['isAuthenticated'](),controller[_0x714c('0xc')]);router[_0x714c('0xd')]('/',auth[_0x714c('0x9')](),controller[_0x714c('0xe')]);router[_0x714c('0xf')](_0x714c('0xa'),auth[_0x714c('0x9')](),controller[_0x714c('0x10')]);router[_0x714c('0x11')](_0x714c('0xa'),auth['isAuthenticated'](),controller[_0x714c('0x12')]);module[_0x714c('0x13')]=router; \ No newline at end of file +var _0x6260=['/:id','exports','multer','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated','/:id/run','run','create'];(function(_0x13ea9e,_0xe8a274){var _0x3f1e3f=function(_0x3a4698){while(--_0x3a4698){_0x13ea9e['push'](_0x13ea9e['shift']());}};_0x3f1e3f(++_0xe8a274);}(_0x6260,0x1e3));var _0x0626=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0x6260[_0x1b4002];return _0x1716f3;};'use strict';var multer=require(_0x0626('0x0'));var util=require(_0x0626('0x1'));var path=require(_0x0626('0x2'));var timeout=require(_0x0626('0x3'));var express=require('express');var router=express[_0x0626('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0626('0x5'));var controller=require('./schedule.controller');router[_0x0626('0x6')]('/',auth[_0x0626('0x7')](),controller['index']);router[_0x0626('0x6')]('/:id',auth[_0x0626('0x7')](),controller['show']);router['get'](_0x0626('0x8'),auth[_0x0626('0x7')](),controller[_0x0626('0x9')]);router['post']('/',auth[_0x0626('0x7')](),controller[_0x0626('0xa')]);router['put'](_0x0626('0xb'),auth[_0x0626('0x7')](),controller['update']);router['delete'](_0x0626('0xb'),auth[_0x0626('0x7')](),controller['destroy']);module[_0x0626('0xc')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 50edbaa..dbd9bc8 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 _0xcdc6=['weeks','days','minutes','csv','xlsx','TEXT','sequelize','exports','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','ENUM','months'];(function(_0x5ee71e,_0x28e6bf){var _0x1675b1=function(_0x5f543c){while(--_0x5f543c){_0x5ee71e['push'](_0x5ee71e['shift']());}};_0x1675b1(++_0x28e6bf);}(_0xcdc6,0x68));var _0x6cdc=function(_0x121eee,_0x94ea3e){_0x121eee=_0x121eee-0x0;var _0x1351c3=_0xcdc6[_0x121eee];return _0x1351c3;};'use strict';var Sequelize=require(_0x6cdc('0x0'));module[_0x6cdc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6cdc('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6cdc('0x3')],'allowNull':![],'defaultValue':_0x6cdc('0x4')},'startAt':{'type':Sequelize[_0x6cdc('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x6cdc('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6cdc('0x6')]('years','quarters',_0x6cdc('0x7'),_0x6cdc('0x8'),_0x6cdc('0x9'),'hours',_0x6cdc('0xa')),'allowNull':![],'defaultValue':_0x6cdc('0x9')},'output':{'type':Sequelize[_0x6cdc('0x6')](_0x6cdc('0xb'),'pdf',_0x6cdc('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x6cdc('0x6')]('custom','default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x6cdc('0x3')]},'cc':{'type':Sequelize[_0x6cdc('0xd')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x6cdc('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfd7a=['default','TEXT','sequelize','BOOLEAN','STRING','DATE','INTEGER','years','quarters','months','weeks','days','hours','minutes','ENUM','xlsx','csv','custom'];(function(_0x1eedd4,_0xe6ba5d){var _0x30635a=function(_0x251ffc){while(--_0x251ffc){_0x1eedd4['push'](_0x1eedd4['shift']());}};_0x30635a(++_0xe6ba5d);}(_0xfd7a,0x1e8));var _0xafd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd7a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xafd7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xafd7('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xafd7('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xafd7('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xafd7('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xafd7('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xafd7('0x5'),_0xafd7('0x6'),_0xafd7('0x7'),_0xafd7('0x8'),_0xafd7('0x9'),_0xafd7('0xa'),_0xafd7('0xb')),'allowNull':![],'defaultValue':_0xafd7('0x9')},'output':{'type':Sequelize[_0xafd7('0xc')]('csv','pdf',_0xafd7('0xd')),'allowNull':![],'defaultValue':_0xafd7('0xe')},'type':{'type':Sequelize['ENUM'](_0xafd7('0xf'),_0xafd7('0x10')),'allowNull':![],'defaultValue':_0xafd7('0xf')},'sendMail':{'type':Sequelize[_0xafd7('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xafd7('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xafd7('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index bfa3986..33369a6 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 _0x1334=['crypto','jsforce','querystring','papaparse','../../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','Content-Range','update','then','destroy','get','Scheduler','error','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','Schedule','findAll','rows','catch','show','params','keys','options','create','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x590ef3,_0x3b2dd2){var _0x4502be=function(_0x2c8011){while(--_0x2c8011){_0x590ef3['push'](_0x590ef3['shift']());}};_0x4502be(++_0x3b2dd2);}(_0x1334,0x1e9));var _0x4133=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0x1334[_0x507ac5];return _0x12c1bc;};'use strict';var emlformat=require(_0x4133('0x0'));var rimraf=require(_0x4133('0x1'));var zipdir=require(_0x4133('0x2'));var jsonpatch=require(_0x4133('0x3'));var rp=require(_0x4133('0x4'));var moment=require(_0x4133('0x5'));var BPromise=require(_0x4133('0x6'));var Mustache=require(_0x4133('0x7'));var util=require('util');var path=require(_0x4133('0x8'));var sox=require(_0x4133('0x9'));var csv=require(_0x4133('0xa'));var ejs=require(_0x4133('0xb'));var fs=require('fs');var fs_extra=require(_0x4133('0xc'));var _=require(_0x4133('0xd'));var squel=require(_0x4133('0xe'));var crypto=require(_0x4133('0xf'));var jsforce=require(_0x4133('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4133('0xa'));var querystring=require(_0x4133('0x11'));var Papa=require(_0x4133('0x12'));var Redis=require('ioredis');var authService=require(_0x4133('0x13'));var qs=require(_0x4133('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4133('0x15'));var logger=require(_0x4133('0x16'))(_0x4133('0x17'));var utils=require(_0x4133('0x18'));var config=require(_0x4133('0x19'));var licenseUtil=require(_0x4133('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x451ad6,_0x48e6d4){_0x48e6d4=_0x48e6d4||0xcc;return function(_0xa111eb){if(_0xa111eb){return _0x451ad6[_0x4133('0x1b')](_0x48e6d4);}return _0x451ad6[_0x4133('0x1c')](_0x48e6d4)[_0x4133('0x1d')]();};}function respondWithResult(_0x1de420,_0x30c7d3){_0x30c7d3=_0x30c7d3||0xc8;return function(_0x51b9f1){if(_0x51b9f1){return _0x1de420[_0x4133('0x1c')](_0x30c7d3)[_0x4133('0x1e')](_0x51b9f1);}};}function respondWithFilteredResult(_0x5ecea4,_0x3320cf){return function(_0x1b482a){if(_0x1b482a){var _0x5b4255=typeof _0x3320cf[_0x4133('0x1f')]===_0x4133('0x20')&&typeof _0x3320cf[_0x4133('0x21')]==='undefined';var _0x3fe59d=_0x1b482a[_0x4133('0x22')];var _0x3f1eff=_0x5b4255?0x0:_0x3320cf[_0x4133('0x1f')];var _0x555404=_0x5b4255?_0x1b482a[_0x4133('0x22')]:_0x3320cf[_0x4133('0x1f')]+_0x3320cf[_0x4133('0x21')];var _0x24551c;if(_0x555404>=_0x3fe59d){_0x555404=_0x3fe59d;_0x24551c=0xc8;}else{_0x24551c=0xce;}_0x5ecea4[_0x4133('0x1c')](_0x24551c);return _0x5ecea4[_0x4133('0x23')](_0x4133('0x24'),_0x3f1eff+'-'+_0x555404+'/'+_0x3fe59d)[_0x4133('0x1e')](_0x1b482a);}return null;};}function patchUpdates(_0x5771fb){return function(_0x2ac0a5){try{jsonpatch['apply'](_0x2ac0a5,_0x5771fb,!![]);}catch(_0x1dcc9a){return BPromise['reject'](_0x1dcc9a);}return _0x2ac0a5['save']();};}function saveUpdates(_0x1aff31,_0x3575d8){return function(_0x50a7c4){if(_0x50a7c4){return _0x50a7c4[_0x4133('0x25')](_0x1aff31)[_0x4133('0x26')](function(_0x537f4b){return _0x537f4b;});}return null;};}function removeEntity(_0x57651d,_0x1c8bb2){return function(_0x15f256){if(_0x15f256){return _0x15f256[_0x4133('0x27')]()[_0x4133('0x26')](function(){var _0x5e3057=_0x15f256[_0x4133('0x28')]({'plain':!![]});var _0xd17728=_0x4133('0x29');return db['UserProfileResource'][_0x4133('0x27')]({'where':{'type':_0xd17728,'resourceId':_0x5e3057['id']}})[_0x4133('0x26')](function(){return _0x15f256;});})[_0x4133('0x26')](function(){_0x57651d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dcb9d,_0x1c60f3){return function(_0x40021a){if(!_0x40021a){_0x4dcb9d['sendStatus'](0x194);}return _0x40021a;};}function handleError(_0x1657bc,_0x1d199d){_0x1d199d=_0x1d199d||0x1f4;return function(_0x2238c3){logger[_0x4133('0x2a')](_0x2238c3['stack']);if(_0x2238c3[_0x4133('0x2b')]){delete _0x2238c3[_0x4133('0x2b')];}_0x1657bc['status'](_0x1d199d)['send'](_0x2238c3);};}exports[_0x4133('0x2c')]=function(_0x23651d,_0x130e43){var _0x415d37={},_0x1602b5={},_0x5b451b={'count':0x0,'rows':[]};var _0x4f70d6=_[_0x4133('0x2d')](db['Schedule'][_0x4133('0x2e')],function(_0x4ea027){return{'name':_0x4ea027[_0x4133('0x2f')],'type':_0x4ea027[_0x4133('0x30')][_0x4133('0x31')]};});_0x1602b5[_0x4133('0x32')]=_[_0x4133('0x2d')](_0x4f70d6,_0x4133('0x2b'));_0x1602b5['query']=_['keys'](_0x23651d[_0x4133('0x33')]);_0x1602b5[_0x4133('0x34')]=_[_0x4133('0x35')](_0x1602b5['model'],_0x1602b5[_0x4133('0x33')]);_0x415d37['attributes']=_[_0x4133('0x35')](_0x1602b5['model'],qs[_0x4133('0x36')](_0x23651d[_0x4133('0x33')][_0x4133('0x36')]));_0x415d37[_0x4133('0x37')]=_0x415d37[_0x4133('0x37')][_0x4133('0x38')]?_0x415d37[_0x4133('0x37')]:_0x1602b5['model'];if(!_0x23651d[_0x4133('0x33')][_0x4133('0x39')](_0x4133('0x3a'))){_0x415d37[_0x4133('0x21')]=qs[_0x4133('0x21')](_0x23651d['query'][_0x4133('0x21')]);_0x415d37[_0x4133('0x1f')]=qs[_0x4133('0x1f')](_0x23651d[_0x4133('0x33')][_0x4133('0x1f')]);}_0x415d37['order']=qs[_0x4133('0x3b')](_0x23651d[_0x4133('0x33')]['sort']);_0x415d37[_0x4133('0x3c')]=qs[_0x4133('0x34')](_['pick'](_0x23651d['query'],_0x1602b5[_0x4133('0x34')]),_0x4f70d6);if(_0x23651d['query'][_0x4133('0x3d')]){_0x415d37['where']=_[_0x4133('0x3e')](_0x415d37[_0x4133('0x3c')],{'$or':_[_0x4133('0x2d')](_0x4f70d6,function(_0x871a04){if(_0x871a04['type']!==_0x4133('0x3f')){var _0x39454f={};_0x39454f[_0x871a04[_0x4133('0x2b')]]={'$like':'%'+_0x23651d[_0x4133('0x33')][_0x4133('0x3d')]+'%'};return _0x39454f;}})});}_0x415d37=_[_0x4133('0x3e')]({},_0x415d37,_0x23651d['options']);var _0x5ec1ce={'where':_0x415d37[_0x4133('0x3c')]};return db['Schedule']['count'](_0x5ec1ce)[_0x4133('0x26')](function(_0x111d58){_0x5b451b['count']=_0x111d58;if(_0x23651d[_0x4133('0x33')][_0x4133('0x40')]){_0x415d37['include']=[{'all':!![]}];}return db[_0x4133('0x41')][_0x4133('0x42')](_0x415d37);})[_0x4133('0x26')](function(_0x122170){_0x5b451b[_0x4133('0x43')]=_0x122170;return _0x5b451b;})[_0x4133('0x26')](respondWithFilteredResult(_0x130e43,_0x415d37))[_0x4133('0x44')](handleError(_0x130e43,null));};exports[_0x4133('0x45')]=function(_0x5755e5,_0x5198e2){var _0x1dc72c={'raw':![],'where':{'id':_0x5755e5[_0x4133('0x46')]['id']}},_0x5a07a0={};_0x5a07a0['model']=_[_0x4133('0x47')](db[_0x4133('0x41')][_0x4133('0x2e')]);_0x5a07a0[_0x4133('0x33')]=_[_0x4133('0x47')](_0x5755e5[_0x4133('0x33')]);_0x5a07a0['filters']=_[_0x4133('0x35')](_0x5a07a0['model'],_0x5a07a0[_0x4133('0x33')]);_0x1dc72c[_0x4133('0x37')]=_[_0x4133('0x35')](_0x5a07a0[_0x4133('0x32')],qs[_0x4133('0x36')](_0x5755e5['query'][_0x4133('0x36')]));_0x1dc72c['attributes']=_0x1dc72c['attributes']['length']?_0x1dc72c[_0x4133('0x37')]:_0x5a07a0['model'];if(_0x5755e5[_0x4133('0x33')][_0x4133('0x40')]){_0x1dc72c['include']=[{'all':!![]}];}_0x1dc72c=_[_0x4133('0x3e')]({},_0x1dc72c,_0x5755e5[_0x4133('0x48')]);return db[_0x4133('0x41')]['find'](_0x1dc72c)[_0x4133('0x26')](handleEntityNotFound(_0x5198e2,null))[_0x4133('0x26')](respondWithResult(_0x5198e2,null))[_0x4133('0x44')](handleError(_0x5198e2,null));};exports[_0x4133('0x49')]=function(_0x19bda0,_0x4aa062){return db[_0x4133('0x41')][_0x4133('0x49')](_0x19bda0['body'],{})[_0x4133('0x26')](function(_0x34788c){var _0x22097f=_0x19bda0[_0x4133('0x4a')][_0x4133('0x28')]({'plain':!![]});if(!_0x22097f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22097f[_0x4133('0x4b')]===_0x4133('0x4a')){var _0x56dcfd=_0x34788c['get']({'plain':!![]});var _0x1051a4=_0x4133('0x29');return db[_0x4133('0x4c')][_0x4133('0x4d')]({'where':{'name':_0x1051a4,'userProfileId':_0x22097f['userProfileId']},'raw':!![]})[_0x4133('0x26')](function(_0x275a5a){if(_0x275a5a&&_0x275a5a[_0x4133('0x4e')]===0x0){return db[_0x4133('0x4f')][_0x4133('0x49')]({'name':_0x56dcfd[_0x4133('0x2b')],'resourceId':_0x56dcfd['id'],'type':_0x275a5a[_0x4133('0x2b')],'sectionId':_0x275a5a['id']},{})[_0x4133('0x26')](function(){return _0x34788c;});}else{return _0x34788c;}})['catch'](function(_0x2aa015){logger[_0x4133('0x2a')](_0x4133('0x50'),_0x2aa015);throw _0x2aa015;});}return _0x34788c;})['then'](respondWithResult(_0x4aa062,0xc9))[_0x4133('0x44')](handleError(_0x4aa062,null));};exports['update']=function(_0xb77eb0,_0x26b2aa){if(_0xb77eb0[_0x4133('0x51')]['id']){delete _0xb77eb0[_0x4133('0x51')]['id'];}return db[_0x4133('0x41')][_0x4133('0x4d')]({'where':{'id':_0xb77eb0['params']['id']}})['then'](handleEntityNotFound(_0x26b2aa,null))[_0x4133('0x26')](saveUpdates(_0xb77eb0[_0x4133('0x51')],null))['then'](respondWithResult(_0x26b2aa,null))[_0x4133('0x44')](handleError(_0x26b2aa,null));};exports[_0x4133('0x27')]=function(_0x18d751,_0x49a2e1){return db[_0x4133('0x41')]['find']({'where':{'id':_0x18d751[_0x4133('0x46')]['id']}})[_0x4133('0x26')](handleEntityNotFound(_0x49a2e1,null))[_0x4133('0x26')](removeEntity(_0x49a2e1,null))[_0x4133('0x44')](handleError(_0x49a2e1,null));};exports['run']=function(_0xf9d41d,_0x5659cd,_0x30f496){var _0x2731b9=require(_0x4133('0x52'));return db[_0x4133('0x41')][_0x4133('0x4d')]({'where':{'id':_0xf9d41d['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5659cd,null))['then'](function(){_0x2731b9[_0x4133('0x53')](_0xf9d41d['params']['id']);})[_0x4133('0x26')](respondWithStatusCode(_0x5659cd,null))[_0x4133('0x44')](handleError(_0x5659cd,null));}; \ No newline at end of file +var _0x903f=['role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','get','Scheduler','error','name','send','index','map','rawAttributes','fieldName','key','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','options','Schedule','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x1c987c,_0x546d03){var _0x3f074c=function(_0x58ae19){while(--_0x58ae19){_0x1c987c['push'](_0x1c987c['shift']());}};_0x3f074c(++_0x546d03);}(_0x903f,0x1b7));var _0xf903=function(_0x178fa2,_0x161ba8){_0x178fa2=_0x178fa2-0x0;var _0x205420=_0x903f[_0x178fa2];return _0x205420;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf903('0x0'));var zipdir=require(_0xf903('0x1'));var jsonpatch=require(_0xf903('0x2'));var rp=require(_0xf903('0x3'));var moment=require(_0xf903('0x4'));var BPromise=require(_0xf903('0x5'));var Mustache=require(_0xf903('0x6'));var util=require(_0xf903('0x7'));var path=require('path');var sox=require(_0xf903('0x8'));var csv=require('to-csv');var ejs=require(_0xf903('0x9'));var fs=require('fs');var fs_extra=require(_0xf903('0xa'));var _=require(_0xf903('0xb'));var squel=require(_0xf903('0xc'));var crypto=require(_0xf903('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf903('0xe'));var toCsv=require(_0xf903('0xf'));var querystring=require(_0xf903('0x10'));var Papa=require(_0xf903('0x11'));var Redis=require(_0xf903('0x12'));var authService=require(_0xf903('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf903('0x14'));var hardwareService=require(_0xf903('0x15'));var logger=require(_0xf903('0x16'))(_0xf903('0x17'));var utils=require(_0xf903('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf903('0x19'))['db'];function respondWithStatusCode(_0x18071b,_0x5d5123){_0x5d5123=_0x5d5123||0xcc;return function(_0x34f75a){if(_0x34f75a){return _0x18071b[_0xf903('0x1a')](_0x5d5123);}return _0x18071b[_0xf903('0x1b')](_0x5d5123)[_0xf903('0x1c')]();};}function respondWithResult(_0x23ea12,_0x3ba63f){_0x3ba63f=_0x3ba63f||0xc8;return function(_0x1ad15c){if(_0x1ad15c){return _0x23ea12['status'](_0x3ba63f)[_0xf903('0x1d')](_0x1ad15c);}};}function respondWithFilteredResult(_0x5ef90e,_0x3360bc){return function(_0x4a2536){if(_0x4a2536){var _0x26f141=typeof _0x3360bc[_0xf903('0x1e')]===_0xf903('0x1f')&&typeof _0x3360bc['limit']===_0xf903('0x1f');var _0x2f844f=_0x4a2536[_0xf903('0x20')];var _0x4ced0d=_0x26f141?0x0:_0x3360bc[_0xf903('0x1e')];var _0x54f444=_0x26f141?_0x4a2536[_0xf903('0x20')]:_0x3360bc['offset']+_0x3360bc['limit'];var _0x145842;if(_0x54f444>=_0x2f844f){_0x54f444=_0x2f844f;_0x145842=0xc8;}else{_0x145842=0xce;}_0x5ef90e[_0xf903('0x1b')](_0x145842);return _0x5ef90e[_0xf903('0x21')]('Content-Range',_0x4ced0d+'-'+_0x54f444+'/'+_0x2f844f)[_0xf903('0x1d')](_0x4a2536);}return null;};}function patchUpdates(_0x43769d){return function(_0xbdb399){try{jsonpatch[_0xf903('0x22')](_0xbdb399,_0x43769d,!![]);}catch(_0x91d894){return BPromise[_0xf903('0x23')](_0x91d894);}return _0xbdb399[_0xf903('0x24')]();};}function saveUpdates(_0x4de23e,_0x5e155f){return function(_0x15e146){if(_0x15e146){return _0x15e146[_0xf903('0x25')](_0x4de23e)[_0xf903('0x26')](function(_0x263cec){return _0x263cec;});}return null;};}function removeEntity(_0x307859,_0x4e4e0e){return function(_0x5388cf){if(_0x5388cf){return _0x5388cf[_0xf903('0x27')]()[_0xf903('0x26')](function(){var _0x58ef86=_0x5388cf[_0xf903('0x28')]({'plain':!![]});var _0x46449e=_0xf903('0x29');return db['UserProfileResource'][_0xf903('0x27')]({'where':{'type':_0x46449e,'resourceId':_0x58ef86['id']}})['then'](function(){return _0x5388cf;});})[_0xf903('0x26')](function(){_0x307859[_0xf903('0x1b')](0xcc)[_0xf903('0x1c')]();});}};}function handleEntityNotFound(_0x16d4e9,_0x25d694){return function(_0x28a69a){if(!_0x28a69a){_0x16d4e9[_0xf903('0x1a')](0x194);}return _0x28a69a;};}function handleError(_0x18ee5a,_0x8db3a1){_0x8db3a1=_0x8db3a1||0x1f4;return function(_0x4ee593){logger[_0xf903('0x2a')](_0x4ee593['stack']);if(_0x4ee593[_0xf903('0x2b')]){delete _0x4ee593[_0xf903('0x2b')];}_0x18ee5a['status'](_0x8db3a1)[_0xf903('0x2c')](_0x4ee593);};}exports[_0xf903('0x2d')]=function(_0x2d7041,_0x1a1ca0){var _0x1fd6e2={},_0x3f109f={},_0x55fec6={'count':0x0,'rows':[]};var _0x284b50=_[_0xf903('0x2e')](db['Schedule'][_0xf903('0x2f')],function(_0x1c2ada){return{'name':_0x1c2ada[_0xf903('0x30')],'type':_0x1c2ada['type'][_0xf903('0x31')]};});_0x3f109f['model']=_[_0xf903('0x2e')](_0x284b50,_0xf903('0x2b'));_0x3f109f['query']=_['keys'](_0x2d7041['query']);_0x3f109f[_0xf903('0x32')]=_['intersection'](_0x3f109f[_0xf903('0x33')],_0x3f109f[_0xf903('0x34')]);_0x1fd6e2[_0xf903('0x35')]=_[_0xf903('0x36')](_0x3f109f[_0xf903('0x33')],qs[_0xf903('0x37')](_0x2d7041[_0xf903('0x34')][_0xf903('0x37')]));_0x1fd6e2[_0xf903('0x35')]=_0x1fd6e2[_0xf903('0x35')][_0xf903('0x38')]?_0x1fd6e2[_0xf903('0x35')]:_0x3f109f[_0xf903('0x33')];if(!_0x2d7041[_0xf903('0x34')][_0xf903('0x39')]('nolimit')){_0x1fd6e2[_0xf903('0x3a')]=qs['limit'](_0x2d7041[_0xf903('0x34')]['limit']);_0x1fd6e2['offset']=qs[_0xf903('0x1e')](_0x2d7041[_0xf903('0x34')][_0xf903('0x1e')]);}_0x1fd6e2[_0xf903('0x3b')]=qs['sort'](_0x2d7041['query'][_0xf903('0x3c')]);_0x1fd6e2[_0xf903('0x3d')]=qs[_0xf903('0x32')](_['pick'](_0x2d7041[_0xf903('0x34')],_0x3f109f[_0xf903('0x32')]),_0x284b50);if(_0x2d7041[_0xf903('0x34')]['filter']){_0x1fd6e2['where']=_[_0xf903('0x3e')](_0x1fd6e2[_0xf903('0x3d')],{'$or':_[_0xf903('0x2e')](_0x284b50,function(_0x55f5e3){if(_0x55f5e3['type']!==_0xf903('0x3f')){var _0x5d3714={};_0x5d3714[_0x55f5e3[_0xf903('0x2b')]]={'$like':'%'+_0x2d7041['query']['filter']+'%'};return _0x5d3714;}})});}_0x1fd6e2=_[_0xf903('0x3e')]({},_0x1fd6e2,_0x2d7041[_0xf903('0x40')]);var _0xb1d342={'where':_0x1fd6e2[_0xf903('0x3d')]};return db[_0xf903('0x41')][_0xf903('0x20')](_0xb1d342)[_0xf903('0x26')](function(_0x574669){_0x55fec6[_0xf903('0x20')]=_0x574669;if(_0x2d7041[_0xf903('0x34')][_0xf903('0x42')]){_0x1fd6e2['include']=[{'all':!![]}];}return db[_0xf903('0x41')][_0xf903('0x43')](_0x1fd6e2);})[_0xf903('0x26')](function(_0x15416e){_0x55fec6[_0xf903('0x44')]=_0x15416e;return _0x55fec6;})[_0xf903('0x26')](respondWithFilteredResult(_0x1a1ca0,_0x1fd6e2))[_0xf903('0x45')](handleError(_0x1a1ca0,null));};exports[_0xf903('0x46')]=function(_0x40eea7,_0x16e0dd){var _0x354059={'raw':![],'where':{'id':_0x40eea7[_0xf903('0x47')]['id']}},_0x18fad4={};_0x18fad4[_0xf903('0x33')]=_['keys'](db[_0xf903('0x41')]['rawAttributes']);_0x18fad4[_0xf903('0x34')]=_['keys'](_0x40eea7[_0xf903('0x34')]);_0x18fad4[_0xf903('0x32')]=_[_0xf903('0x36')](_0x18fad4[_0xf903('0x33')],_0x18fad4[_0xf903('0x34')]);_0x354059[_0xf903('0x35')]=_[_0xf903('0x36')](_0x18fad4['model'],qs[_0xf903('0x37')](_0x40eea7[_0xf903('0x34')][_0xf903('0x37')]));_0x354059[_0xf903('0x35')]=_0x354059['attributes']['length']?_0x354059[_0xf903('0x35')]:_0x18fad4['model'];if(_0x40eea7[_0xf903('0x34')]['includeAll']){_0x354059[_0xf903('0x48')]=[{'all':!![]}];}_0x354059=_[_0xf903('0x3e')]({},_0x354059,_0x40eea7[_0xf903('0x40')]);return db['Schedule'][_0xf903('0x49')](_0x354059)[_0xf903('0x26')](handleEntityNotFound(_0x16e0dd,null))[_0xf903('0x26')](respondWithResult(_0x16e0dd,null))[_0xf903('0x45')](handleError(_0x16e0dd,null));};exports[_0xf903('0x4a')]=function(_0x30eef2,_0x206391){return db[_0xf903('0x41')]['create'](_0x30eef2['body'],{})['then'](function(_0x426f1c){var _0x59e3eb=_0x30eef2[_0xf903('0x4b')][_0xf903('0x28')]({'plain':!![]});if(!_0x59e3eb)throw new Error(_0xf903('0x4c'));if(_0x59e3eb[_0xf903('0x4d')]===_0xf903('0x4b')){var _0x109474=_0x426f1c[_0xf903('0x28')]({'plain':!![]});var _0x225716='Scheduler';return db[_0xf903('0x4e')][_0xf903('0x49')]({'where':{'name':_0x225716,'userProfileId':_0x59e3eb[_0xf903('0x4f')]},'raw':!![]})[_0xf903('0x26')](function(_0x380318){if(_0x380318&&_0x380318[_0xf903('0x50')]===0x0){return db[_0xf903('0x51')][_0xf903('0x4a')]({'name':_0x109474[_0xf903('0x2b')],'resourceId':_0x109474['id'],'type':_0x380318['name'],'sectionId':_0x380318['id']},{})['then'](function(){return _0x426f1c;});}else{return _0x426f1c;}})['catch'](function(_0x1b2e69){logger[_0xf903('0x2a')](_0xf903('0x52'),_0x1b2e69);throw _0x1b2e69;});}return _0x426f1c;})[_0xf903('0x26')](respondWithResult(_0x206391,0xc9))[_0xf903('0x45')](handleError(_0x206391,null));};exports['update']=function(_0x4311f8,_0x5b5da2){if(_0x4311f8[_0xf903('0x53')]['id']){delete _0x4311f8[_0xf903('0x53')]['id'];}return db[_0xf903('0x41')][_0xf903('0x49')]({'where':{'id':_0x4311f8[_0xf903('0x47')]['id']}})[_0xf903('0x26')](handleEntityNotFound(_0x5b5da2,null))[_0xf903('0x26')](saveUpdates(_0x4311f8[_0xf903('0x53')],null))[_0xf903('0x26')](respondWithResult(_0x5b5da2,null))['catch'](handleError(_0x5b5da2,null));};exports[_0xf903('0x27')]=function(_0xe3ec25,_0x366297){return db['Schedule'][_0xf903('0x49')]({'where':{'id':_0xe3ec25[_0xf903('0x47')]['id']}})[_0xf903('0x26')](handleEntityNotFound(_0x366297,null))[_0xf903('0x26')](removeEntity(_0x366297,null))['catch'](handleError(_0x366297,null));};exports[_0xf903('0x54')]=function(_0x979b8e,_0x40e86b,_0x2873ed){var _0x2078b2=require(_0xf903('0x55'));return db[_0xf903('0x41')][_0xf903('0x49')]({'where':{'id':_0x979b8e[_0xf903('0x47')]['id']},'raw':!![]})[_0xf903('0x26')](handleEntityNotFound(_0x40e86b,null))['then'](function(){_0x2078b2[_0xf903('0x54')](_0x979b8e[_0xf903('0x47')]['id']);})['then'](respondWithStatusCode(_0x40e86b,null))[_0xf903('0x45')](handleError(_0x40e86b,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 900a078..4797a48 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 _0x646c=['moment','bluebird','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api'];(function(_0x326ee5,_0x1e9d4f){var _0x905911=function(_0x1a9f14){while(--_0x1a9f14){_0x326ee5['push'](_0x326ee5['shift']());}};_0x905911(++_0x1e9d4f);}(_0x646c,0x182));var _0xc646=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x646c[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xc646('0x0'));var util=require(_0xc646('0x1'));var logger=require(_0xc646('0x2'))(_0xc646('0x3'));var moment=require(_0xc646('0x4'));var BPromise=require(_0xc646('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc646('0x6'));var config=require(_0xc646('0x7'));var attributes=require(_0xc646('0x8'));module[_0xc646('0x9')]=function(_0x20c922,_0x34197f){return _0x20c922[_0xc646('0xa')](_0xc646('0xb'),attributes,{'tableName':_0xc646('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff89=['rimraf','./schedule.attributes','exports','define','Schedule','util','bluebird','request-promise'];(function(_0x4872f4,_0x33fd38){var _0x5c0c9e=function(_0x43f9c0){while(--_0x43f9c0){_0x4872f4['push'](_0x4872f4['shift']());}};_0x5c0c9e(++_0x33fd38);}(_0xff89,0x15d));var _0x9ff8=function(_0xfa8cbe,_0x913238){_0xfa8cbe=_0xfa8cbe-0x0;var _0x19d79c=_0xff89[_0xfa8cbe];return _0x19d79c;};'use strict';var _=require('lodash');var util=require(_0x9ff8('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9ff8('0x1'));var rp=require(_0x9ff8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ff8('0x3'));var config=require('../../config/environment');var attributes=require(_0x9ff8('0x4'));module[_0x9ff8('0x5')]=function(_0x3873c1,_0x138895){return _0x3873c1[_0x9ff8('0x6')](_0x9ff8('0x7'),attributes,{'tableName':'tools_schedules','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 0033cf8..bc18744 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 _0x9991=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','Schedule,\x20%s,\x20%s','message','info'];(function(_0x27488f,_0x58085d){var _0x3a0d9d=function(_0x4e62a8){while(--_0x4e62a8){_0x27488f['push'](_0x27488f['shift']());}};_0x3a0d9d(++_0x58085d);}(_0x9991,0x86));var _0x1999=function(_0x46e3c4,_0x1f888e){_0x46e3c4=_0x46e3c4-0x0;var _0x112169=_0x9991[_0x46e3c4];return _0x112169;};'use strict';var _=require(_0x1999('0x0'));var util=require(_0x1999('0x1'));var moment=require(_0x1999('0x2'));var BPromise=require('bluebird');var rs=require(_0x1999('0x3'));var fs=require('fs');var Redis=require(_0x1999('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1999('0x5'));var logger=require(_0x1999('0x6'))(_0x1999('0x7'));var config=require(_0x1999('0x8'));var jayson=require(_0x1999('0x9'));var client=jayson[_0x1999('0xa')][_0x1999('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2851f8,_0x33ee80,_0x273e48){return new BPromise(function(_0x2d350b,_0x17089a){return client['request'](_0x2851f8,_0x273e48)[_0x1999('0xc')](function(_0x12efbc){logger['info']('Schedule,\x20%s,\x20%s',_0x33ee80,_0x1999('0xd'));logger[_0x1999('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x33ee80,'request\x20sent',JSON[_0x1999('0xf')](_0x12efbc));if(_0x12efbc[_0x1999('0x10')]){if(_0x12efbc['error']['code']===0x1f4){logger[_0x1999('0x10')](_0x1999('0x11'),_0x33ee80,_0x12efbc[_0x1999('0x10')][_0x1999('0x12')]);return _0x17089a(_0x12efbc['error'][_0x1999('0x12')]);}logger[_0x1999('0x10')](_0x1999('0x11'),_0x33ee80,_0x12efbc[_0x1999('0x10')][_0x1999('0x12')]);return _0x2d350b(_0x12efbc[_0x1999('0x10')]['message']);}else{logger[_0x1999('0x13')]('Schedule,\x20%s,\x20%s',_0x33ee80,'request\x20sent');_0x2d350b(_0x12efbc[_0x1999('0x14')][_0x1999('0x12')]);}})[_0x1999('0x15')](function(_0x2fc6ec){logger[_0x1999('0x10')](_0x1999('0x11'),_0x33ee80,_0x2fc6ec);_0x17089a(_0x2fc6ec);});});} \ No newline at end of file +var _0xcad5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util'];(function(_0x32ab4b,_0x21b3ee){var _0x10cd9a=function(_0x47b2e4){while(--_0x47b2e4){_0x32ab4b['push'](_0x32ab4b['shift']());}};_0x10cd9a(++_0x21b3ee);}(_0xcad5,0x1c6));var _0x5cad=function(_0x33a529,_0x46917d){_0x33a529=_0x33a529-0x0;var _0x56f8bf=_0xcad5[_0x33a529];return _0x56f8bf;};'use strict';var _=require(_0x5cad('0x0'));var util=require(_0x5cad('0x1'));var moment=require(_0x5cad('0x2'));var BPromise=require(_0x5cad('0x3'));var rs=require(_0x5cad('0x4'));var fs=require('fs');var Redis=require(_0x5cad('0x5'));var db=require(_0x5cad('0x6'))['db'];var utils=require(_0x5cad('0x7'));var logger=require(_0x5cad('0x8'))(_0x5cad('0x9'));var config=require(_0x5cad('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5cad('0xb')][_0x5cad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x232fca,_0x1e14fd,_0x3c14cb){return new BPromise(function(_0x268b1d,_0x463154){return client['request'](_0x232fca,_0x3c14cb)[_0x5cad('0xd')](function(_0x2e16d0){logger['info'](_0x5cad('0xe'),_0x1e14fd,'request\x20sent');logger[_0x5cad('0xf')](_0x5cad('0x10'),_0x1e14fd,_0x5cad('0x11'),JSON['stringify'](_0x2e16d0));if(_0x2e16d0['error']){if(_0x2e16d0[_0x5cad('0x12')][_0x5cad('0x13')]===0x1f4){logger[_0x5cad('0x12')](_0x5cad('0xe'),_0x1e14fd,_0x2e16d0[_0x5cad('0x12')][_0x5cad('0x14')]);return _0x463154(_0x2e16d0[_0x5cad('0x12')][_0x5cad('0x14')]);}logger[_0x5cad('0x12')]('Schedule,\x20%s,\x20%s',_0x1e14fd,_0x2e16d0[_0x5cad('0x12')][_0x5cad('0x14')]);return _0x268b1d(_0x2e16d0[_0x5cad('0x12')][_0x5cad('0x14')]);}else{logger[_0x5cad('0x15')]('Schedule,\x20%s,\x20%s',_0x1e14fd,_0x5cad('0x11'));_0x268b1d(_0x2e16d0[_0x5cad('0x16')][_0x5cad('0x14')]);}})[_0x5cad('0x17')](function(_0x174880){logger[_0x5cad('0x12')]('Schedule,\x20%s,\x20%s',_0x1e14fd,_0x174880);_0x463154(_0x174880);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ed29838..6247c70 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 _0xe1ce=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','/:id','delete'];(function(_0x2ebecb,_0x45c433){var _0x2ee886=function(_0x59165f){while(--_0x59165f){_0x2ebecb['push'](_0x2ebecb['shift']());}};_0x2ee886(++_0x45c433);}(_0xe1ce,0x9c));var _0xee1c=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xe1ce[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0xee1c('0x0'));var util=require(_0xee1c('0x1'));var path=require(_0xee1c('0x2'));var timeout=require(_0xee1c('0x3'));var express=require('express');var router=express[_0xee1c('0x4')]();var fs_extra=require(_0xee1c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xee1c('0x6'));var config=require(_0xee1c('0x7'));var controller=require(_0xee1c('0x8'));router[_0xee1c('0x9')]('/',auth[_0xee1c('0xa')](),controller[_0xee1c('0xb')]);router['get'](_0xee1c('0xc'),auth[_0xee1c('0xa')](),controller[_0xee1c('0xd')]);router[_0xee1c('0x9')]('/:id',auth[_0xee1c('0xa')](),controller[_0xee1c('0xe')]);router[_0xee1c('0x9')](_0xee1c('0xf'),auth[_0xee1c('0xa')](),controller[_0xee1c('0x10')]);router[_0xee1c('0x11')]('/',auth[_0xee1c('0xa')](),controller['create']);router['put'](_0xee1c('0x12'),auth[_0xee1c('0xa')](),controller['update']);router[_0xee1c('0x13')](_0xee1c('0x12'),auth[_0xee1c('0xa')](),controller[_0xee1c('0x14')]);module[_0xee1c('0x15')]=router; \ No newline at end of file +var _0xfdfb=['get','describe','show','/:id/download','download','post','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index'];(function(_0xe3b694,_0x2cd500){var _0x43033c=function(_0x45ec75){while(--_0x45ec75){_0xe3b694['push'](_0xe3b694['shift']());}};_0x43033c(++_0x2cd500);}(_0xfdfb,0x1c0));var _0xbfdf=function(_0x14592e,_0x1177a6){_0x14592e=_0x14592e-0x0;var _0x5b43ae=_0xfdfb[_0x14592e];return _0x5b43ae;};'use strict';var multer=require(_0xbfdf('0x0'));var util=require(_0xbfdf('0x1'));var path=require(_0xbfdf('0x2'));var timeout=require(_0xbfdf('0x3'));var express=require('express');var router=express[_0xbfdf('0x4')]();var fs_extra=require(_0xbfdf('0x5'));var auth=require(_0xbfdf('0x6'));var interaction=require(_0xbfdf('0x7'));var config=require(_0xbfdf('0x8'));var controller=require(_0xbfdf('0x9'));router['get']('/',auth[_0xbfdf('0xa')](),controller[_0xbfdf('0xb')]);router[_0xbfdf('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xbfdf('0xd')]);router[_0xbfdf('0xc')]('/:id',auth[_0xbfdf('0xa')](),controller[_0xbfdf('0xe')]);router[_0xbfdf('0xc')](_0xbfdf('0xf'),auth[_0xbfdf('0xa')](),controller[_0xbfdf('0x10')]);router[_0xbfdf('0x11')]('/',auth[_0xbfdf('0xa')](),controller[_0xbfdf('0x12')]);router['put'](_0xbfdf('0x13'),auth[_0xbfdf('0xa')](),controller[_0xbfdf('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xbfdf('0x15')]);module[_0xbfdf('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index db34a7f..36112cf 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 _0x81cb=['moment','../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize'];(function(_0x218aa6,_0x39bca7){var _0x4365ca=function(_0x4e47c4){while(--_0x4e47c4){_0x218aa6['push'](_0x218aa6['shift']());}};_0x4365ca(++_0x39bca7);}(_0x81cb,0xaa));var _0xb81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81cb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb81c('0x0'));var moment=require(_0xb81c('0x1'));var path=require('path');var config=require(_0xb81c('0x2'));module[_0xb81c('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb81c('0x4')](_0xb81c('0x5'))?path[_0xb81c('0x6')](this[_0xb81c('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xb81c('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x2666f6){var _0x2a06b2=_0x2666f6[_0xb81c('0x8')](/\\/g,'/');this[_0xb81c('0x9')](_0xb81c('0x5'),_0x2a06b2);}},'rating':{'type':Sequelize[_0xb81c('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb81c('0xa')],'set':function(_0x14b1bf){this[_0xb81c('0x9')](_0xb81c('0xb'),moment()[_0xb81c('0xc')](_0x14b1bf,'ms'));this[_0xb81c('0x9')](_0xb81c('0xd'),moment());this[_0xb81c('0x9')]('duration',_0x14b1bf);}},'startedAt':{'type':Sequelize[_0xb81c('0xe')],'get':function(){return moment(this[_0xb81c('0x4')](_0xb81c('0xb')))[_0xb81c('0xf')](_0xb81c('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xb81c('0xe')],'get':function(){return moment(this['getDataValue'](_0xb81c('0xd')))[_0xb81c('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xb81c('0x11')]();}},'createdAt':{'type':Sequelize[_0xb81c('0xe')],'get':function(){return moment(this['getDataValue'](_0xb81c('0x12')))[_0xb81c('0xf')](_0xb81c('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0xb81c('0xe')],'get':function(){return moment(this[_0xb81c('0x4')]('updatedAt'))[_0xb81c('0xf')](_0xb81c('0x10'))[_0xb81c('0x11')]();}}}; \ No newline at end of file +var _0xc5b3=['startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0xc5b3[_0x31e5cb];return _0x4170df;};'use strict';var Sequelize=require(_0x3c5b('0x0'));var moment=require(_0x3c5b('0x1'));var path=require(_0x3c5b('0x2'));var config=require(_0x3c5b('0x3'));module[_0x3c5b('0x4')]={'format':{'type':Sequelize[_0x3c5b('0x5')],'get':function(){return this[_0x3c5b('0x6')](_0x3c5b('0x7'))?path['extname'](this[_0x3c5b('0x6')](_0x3c5b('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3c5b('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x7a363e){var _0x4730e9=_0x7a363e[_0x3c5b('0x9')](/\\/g,'/');this[_0x3c5b('0xa')](_0x3c5b('0x7'),_0x4730e9);}},'rating':{'type':Sequelize[_0x3c5b('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x3c5b('0xb')],'set':function(_0x5f5df9){this[_0x3c5b('0xa')](_0x3c5b('0xc'),moment()[_0x3c5b('0xd')](_0x5f5df9,'ms'));this[_0x3c5b('0xa')](_0x3c5b('0xe'),moment());this['setDataValue'](_0x3c5b('0xf'),_0x5f5df9);}},'startedAt':{'type':Sequelize[_0x3c5b('0x10')],'get':function(){return moment(this[_0x3c5b('0x6')](_0x3c5b('0xc')))[_0x3c5b('0x11')](_0x3c5b('0x12'))[_0x3c5b('0x13')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x3c5b('0x6')](_0x3c5b('0xe')))[_0x3c5b('0x11')](_0x3c5b('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x3c5b('0x10')],'get':function(){return moment(this['getDataValue'](_0x3c5b('0x14')))[_0x3c5b('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x3c5b('0x13')]();}},'updatedAt':{'type':Sequelize[_0x3c5b('0x10')],'get':function(){return moment(this['getDataValue'](_0x3c5b('0x15')))[_0x3c5b('0x11')](_0x3c5b('0x12'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index d6a3899..54ab8d7 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 _0x46ed=['intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','keys','include','options','find','create','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','params','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','existsSync','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','end','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','filters'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x46ed,0x168));var _0xd46e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x46ed[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){_0x33c2e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x371054,_0x2a5271){return function(_0x21135f){if(!_0x21135f){_0x371054[_0xd46e('0x1a')](0x194);}return _0x21135f;};}function handleError(_0x247b9f,_0x180851){_0x180851=_0x180851||0x1f4;return function(_0x1740d1){logger['error'](_0x1740d1[_0xd46e('0x26')]);if(_0x1740d1[_0xd46e('0x27')]){delete _0x1740d1[_0xd46e('0x27')];}_0x247b9f[_0xd46e('0x1b')](_0x180851)[_0xd46e('0x28')](_0x1740d1);};}exports[_0xd46e('0x29')]=function(_0x58aeef,_0x465d54){var _0x3a1ced={},_0x2d1afe={},_0xa716ce={'count':0x0,'rows':[]};var _0x106edc=_[_0xd46e('0x2a')](db[_0xd46e('0x2b')][_0xd46e('0x2c')],function(_0x18f060){return{'name':_0x18f060[_0xd46e('0x2d')],'type':_0x18f060[_0xd46e('0x2e')][_0xd46e('0x2f')]};});_0x2d1afe[_0xd46e('0x30')]=_['differenceBy'](_[_0xd46e('0x2a')](_0x106edc,_0xd46e('0x27')),[_0xd46e('0x31')]);_0x2d1afe[_0xd46e('0x32')]=_['keys'](_0x58aeef[_0xd46e('0x32')]);_0x2d1afe[_0xd46e('0x33')]=_['intersection'](_0x2d1afe[_0xd46e('0x30')],_0x2d1afe[_0xd46e('0x32')]);_0x3a1ced['attributes']=_[_0xd46e('0x34')](_0x2d1afe[_0xd46e('0x30')],qs[_0xd46e('0x35')](_0x58aeef['query']['fields']));_0x3a1ced[_0xd46e('0x36')]=_0x3a1ced[_0xd46e('0x36')][_0xd46e('0x37')]?_0x3a1ced[_0xd46e('0x36')]:_0x2d1afe[_0xd46e('0x30')];if(!_0x58aeef[_0xd46e('0x32')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x3a1ced['limit']=qs[_0xd46e('0x1d')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1d')]);_0x3a1ced[_0xd46e('0x1c')]=qs[_0xd46e('0x1c')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1c')]);}_0x3a1ced['order']=qs[_0xd46e('0x3a')](_0x58aeef[_0xd46e('0x32')]['sort']);_0x3a1ced[_0xd46e('0x3b')]=qs[_0xd46e('0x33')](_[_0xd46e('0x3c')](_0x58aeef[_0xd46e('0x32')],_0x2d1afe['filters']),_0x106edc);if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]){_0x3a1ced[_0xd46e('0x3b')]=_[_0xd46e('0x3e')](_0x3a1ced[_0xd46e('0x3b')],{'$or':_[_0xd46e('0x2a')](_0x106edc,function(_0x220c57){if(_0x220c57[_0xd46e('0x2e')]!=='VIRTUAL'){var _0x232e6f={};_0x232e6f[_0x220c57[_0xd46e('0x27')]]={'$like':'%'+_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]+'%'};return _0x232e6f;}})});}_0x3a1ced=_[_0xd46e('0x3e')]({},_0x3a1ced,_0x58aeef['options']);var _0x964c66={'where':_0x3a1ced['where']};return db['ScreenRecording']['count'](_0x964c66)['then'](function(_0x17c3d9){_0xa716ce['count']=_0x17c3d9;if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x3a1ced['include']=[{'all':!![]}];}return db[_0xd46e('0x2b')][_0xd46e('0x40')](_0x3a1ced);})[_0xd46e('0x25')](function(_0x31ba12){_0xa716ce[_0xd46e('0x41')]=_0x31ba12;return _0xa716ce;})[_0xd46e('0x25')](respondWithFilteredResult(_0x465d54,_0x3a1ced))[_0xd46e('0x42')](handleError(_0x465d54,null));};exports[_0xd46e('0x43')]=function(_0x3a98e4,_0xec367d){var _0x259e2={'raw':![],'where':{'id':_0x3a98e4['params']['id']}},_0x5ea048={};_0x5ea048['model']=_[_0xd46e('0x44')](db['ScreenRecording'][_0xd46e('0x2c')]);_0x5ea048[_0xd46e('0x32')]=_[_0xd46e('0x44')](_0x3a98e4[_0xd46e('0x32')]);_0x5ea048[_0xd46e('0x33')]=_[_0xd46e('0x34')](_0x5ea048[_0xd46e('0x30')],_0x5ea048[_0xd46e('0x32')]);_0x259e2['attributes']=_[_0xd46e('0x34')](_0x5ea048['model'],qs[_0xd46e('0x35')](_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x35')]));_0x259e2[_0xd46e('0x36')]=_0x259e2[_0xd46e('0x36')]['length']?_0x259e2[_0xd46e('0x36')]:_0x5ea048[_0xd46e('0x30')];if(_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x259e2[_0xd46e('0x45')]=[{'all':!![]}];}_0x259e2=_['merge']({},_0x259e2,_0x3a98e4[_0xd46e('0x46')]);return db[_0xd46e('0x2b')][_0xd46e('0x47')](_0x259e2)[_0xd46e('0x25')](handleEntityNotFound(_0xec367d,null))[_0xd46e('0x25')](respondWithResult(_0xec367d,null))['catch'](handleError(_0xec367d,null));};exports[_0xd46e('0x48')]=function(_0x3ea9e6,_0x45baf1){return db[_0xd46e('0x2b')][_0xd46e('0x48')](_0x3ea9e6[_0xd46e('0x49')],{})[_0xd46e('0x25')](respondWithResult(_0x45baf1,0xc9))[_0xd46e('0x42')](handleError(_0x45baf1,null));};exports['update']=function(_0xf9dab,_0x71a8dc){if(_0xf9dab[_0xd46e('0x49')]['id']){delete _0xf9dab[_0xd46e('0x49')]['id'];}delete _0xf9dab[_0xd46e('0x49')]['duration'];delete _0xf9dab['body'][_0xd46e('0x4a')];delete _0xf9dab[_0xd46e('0x49')][_0xd46e('0x4b')];delete _0xf9dab['body']['value'];return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0xf9dab['params']['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x71a8dc,null))[_0xd46e('0x25')](saveUpdates(_0xf9dab[_0xd46e('0x49')],null))[_0xd46e('0x25')](respondWithResult(_0x71a8dc,null))[_0xd46e('0x42')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x4c')]=function(_0x80ed51,_0x16ca0e){return db['ScreenRecording'][_0xd46e('0x4c')]()[_0xd46e('0x25')](respondWithResult(_0x16ca0e,null))[_0xd46e('0x42')](handleError(_0x16ca0e,null));};exports[_0xd46e('0x4d')]=function(_0x4ec295,_0x56dd9a,_0xced102){var _0x5a4a44=require(_0xd46e('0x4e'));var _0x2af20b=![];var _0x393cb9={};if(_0x4ec295[_0xd46e('0x32')][_0xd46e('0x2e')]&&_0x4ec295[_0xd46e('0x32')]['type']===_0xd46e('0x4f')){_0x393cb9[_0xd46e('0x4f')]=_0x4ec295[_0xd46e('0x50')]['id'];}else{_0x393cb9['id']=_0x4ec295['params']['id'];}return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':_0x393cb9,'attributes':['id',_0xd46e('0x51')],'raw':!![]})[_0xd46e('0x25')](handleEntityNotFound(_0x56dd9a,null))[_0xd46e('0x25')](function(_0x2cc676){if(_0x2cc676){var _0x2760ef=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x2cc676[_0xd46e('0x51')]);var _0x411b19=util[_0xd46e('0x31')](_0xd46e('0x55'),_0x2760ef);if(fs['existsSync'](_0x411b19)){_0x2af20b=!![];return _0x5a4a44[_0xd46e('0x56')](_0x411b19,_0x2760ef,config[_0xd46e('0x57')][_0xd46e('0x58')])[_0xd46e('0x25')](function(){return _0x2cc676;});}return _0x2cc676;}})['then'](function(_0x636f15){if(_0x636f15){var _0x36e18a=path[_0xd46e('0x52')](config[_0xd46e('0x53')],'server/files/screen_recordings',_0x636f15[_0xd46e('0x51')]);if(!fs[_0xd46e('0x59')](_0x36e18a)){throw new db['Sequelize']['ValidationError'](_0xd46e('0x5a'));}if(_0x636f15[_0xd46e('0x5b')]){return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,_0x636f15['filename']+path['extname'](_0x36e18a),function(){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}else{return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,function(_0x1f310d){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}}})[_0xd46e('0x42')](function(_0x2f9fcb){if(_0x2f9fcb[_0xd46e('0x5d')]===_0xd46e('0x5a')){_0x56dd9a[_0xd46e('0x1b')](0x194)[_0xd46e('0x28')](_0xd46e('0x5e'));}else{return handleError(_0x56dd9a,null);}});};exports[_0xd46e('0x5f')]=function(_0x272514,_0x329204){return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0x272514['params']['id']}})[_0xd46e('0x25')](function(_0x1a3771){if(_[_0xd46e('0x60')](_0x1a3771)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1a3771;})[_0xd46e('0x25')](function(_0x313c7e){var _0x4dec29=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x313c7e['value']);logger[_0xd46e('0x61')](_0xd46e('0x62'),_0x4dec29);if(!_[_0xd46e('0x60')](_0x313c7e['value'])&&fs[_0xd46e('0x59')](_0x4dec29)){logger['info'](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}_0x4dec29=_0x4dec29+'.cypher';if(!_[_0xd46e('0x60')](_0x313c7e[_0xd46e('0x51')])&&fs[_0xd46e('0x59')](_0x4dec29)){logger[_0xd46e('0x61')](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}return _0x313c7e;})[_0xd46e('0x25')](function(_0x300ee9){if(!_0x300ee9)throw new InternalError();return _0x300ee9[_0xd46e('0x5f')]();})[_0xd46e('0x25')](function(){_0x329204[_0xd46e('0x1b')](0xcc)[_0xd46e('0x66')]();})[_0xd46e('0x42')](handleError(_0x329204,null));}; \ No newline at end of file +var _0x98a8=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','join','server/files/screen_recordings','value','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x1449cc,_0x4ded1d){var _0x328b60=function(_0x53938c){while(--_0x53938c){_0x1449cc['push'](_0x1449cc['shift']());}};_0x328b60(++_0x4ded1d);}(_0x98a8,0x12c));var _0x898a=function(_0x2d9211,_0x4b0dd0){_0x2d9211=_0x2d9211-0x0;var _0x38b816=_0x98a8[_0x2d9211];return _0x38b816;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x1426e3,_0x5b7719){return function(_0x20bde0){if(!_0x20bde0){_0x1426e3['sendStatus'](0x194);}return _0x20bde0;};}function handleError(_0x513c6b,_0x53ddb2){_0x53ddb2=_0x53ddb2||0x1f4;return function(_0x3678be){logger[_0x898a('0x25')](_0x3678be[_0x898a('0x26')]);if(_0x3678be[_0x898a('0x27')]){delete _0x3678be[_0x898a('0x27')];}_0x513c6b[_0x898a('0x1a')](_0x53ddb2)[_0x898a('0x28')](_0x3678be);};}exports[_0x898a('0x29')]=function(_0xd31922,_0x58149d){var _0x4b3e68={},_0x47f1ed={},_0xe9c33d={'count':0x0,'rows':[]};var _0x62fe93=_[_0x898a('0x2a')](db[_0x898a('0x2b')][_0x898a('0x2c')],function(_0x560000){return{'name':_0x560000[_0x898a('0x2d')],'type':_0x560000[_0x898a('0x2e')][_0x898a('0x2f')]};});_0x47f1ed[_0x898a('0x30')]=_[_0x898a('0x31')](_[_0x898a('0x2a')](_0x62fe93,'name'),[_0x898a('0x32')]);_0x47f1ed[_0x898a('0x33')]=_[_0x898a('0x34')](_0xd31922[_0x898a('0x33')]);_0x47f1ed[_0x898a('0x35')]=_['intersection'](_0x47f1ed['model'],_0x47f1ed[_0x898a('0x33')]);_0x4b3e68[_0x898a('0x36')]=_[_0x898a('0x37')](_0x47f1ed['model'],qs[_0x898a('0x38')](_0xd31922[_0x898a('0x33')][_0x898a('0x38')]));_0x4b3e68[_0x898a('0x36')]=_0x4b3e68[_0x898a('0x36')][_0x898a('0x39')]?_0x4b3e68[_0x898a('0x36')]:_0x47f1ed[_0x898a('0x30')];if(!_0xd31922['query'][_0x898a('0x3a')]('nolimit')){_0x4b3e68['limit']=qs[_0x898a('0x3b')](_0xd31922['query'][_0x898a('0x3b')]);_0x4b3e68['offset']=qs[_0x898a('0x1e')](_0xd31922['query'][_0x898a('0x1e')]);}_0x4b3e68[_0x898a('0x3c')]=qs[_0x898a('0x3d')](_0xd31922['query']['sort']);_0x4b3e68['where']=qs[_0x898a('0x35')](_[_0x898a('0x3e')](_0xd31922['query'],_0x47f1ed[_0x898a('0x35')]),_0x62fe93);if(_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]){_0x4b3e68[_0x898a('0x40')]=_['merge'](_0x4b3e68['where'],{'$or':_[_0x898a('0x2a')](_0x62fe93,function(_0x454c8c){if(_0x454c8c['type']!=='VIRTUAL'){var _0x168f92={};_0x168f92[_0x454c8c[_0x898a('0x27')]]={'$like':'%'+_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]+'%'};return _0x168f92;}})});}_0x4b3e68=_['merge']({},_0x4b3e68,_0xd31922[_0x898a('0x41')]);var _0x369c02={'where':_0x4b3e68['where']};return db['ScreenRecording']['count'](_0x369c02)[_0x898a('0x23')](function(_0x477a9d){_0xe9c33d[_0x898a('0x1d')]=_0x477a9d;if(_0xd31922[_0x898a('0x33')][_0x898a('0x42')]){_0x4b3e68[_0x898a('0x43')]=[{'all':!![]}];}return db[_0x898a('0x2b')][_0x898a('0x44')](_0x4b3e68);})[_0x898a('0x23')](function(_0x235fcf){_0xe9c33d[_0x898a('0x45')]=_0x235fcf;return _0xe9c33d;})[_0x898a('0x23')](respondWithFilteredResult(_0x58149d,_0x4b3e68))[_0x898a('0x46')](handleError(_0x58149d,null));};exports[_0x898a('0x47')]=function(_0x21f307,_0x4c8628){var _0x26ad34={'raw':![],'where':{'id':_0x21f307[_0x898a('0x48')]['id']}},_0x11c437={};_0x11c437['model']=_[_0x898a('0x34')](db[_0x898a('0x2b')][_0x898a('0x2c')]);_0x11c437[_0x898a('0x33')]=_[_0x898a('0x34')](_0x21f307[_0x898a('0x33')]);_0x11c437[_0x898a('0x35')]=_[_0x898a('0x37')](_0x11c437['model'],_0x11c437[_0x898a('0x33')]);_0x26ad34[_0x898a('0x36')]=_[_0x898a('0x37')](_0x11c437[_0x898a('0x30')],qs['fields'](_0x21f307[_0x898a('0x33')][_0x898a('0x38')]));_0x26ad34['attributes']=_0x26ad34[_0x898a('0x36')]['length']?_0x26ad34[_0x898a('0x36')]:_0x11c437['model'];if(_0x21f307['query'][_0x898a('0x42')]){_0x26ad34['include']=[{'all':!![]}];}_0x26ad34=_[_0x898a('0x49')]({},_0x26ad34,_0x21f307[_0x898a('0x41')]);return db['ScreenRecording'][_0x898a('0x4a')](_0x26ad34)[_0x898a('0x23')](handleEntityNotFound(_0x4c8628,null))['then'](respondWithResult(_0x4c8628,null))[_0x898a('0x46')](handleError(_0x4c8628,null));};exports[_0x898a('0x4b')]=function(_0x11a0a3,_0x118240){return db['ScreenRecording'][_0x898a('0x4b')](_0x11a0a3[_0x898a('0x4c')],{})['then'](respondWithResult(_0x118240,0xc9))[_0x898a('0x46')](handleError(_0x118240,null));};exports[_0x898a('0x22')]=function(_0x4ab441,_0x28525b){if(_0x4ab441['body']['id']){delete _0x4ab441[_0x898a('0x4c')]['id'];}delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4d')];delete _0x4ab441['body'][_0x898a('0x4e')];delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4f')];delete _0x4ab441[_0x898a('0x4c')]['value'];return db[_0x898a('0x2b')]['find']({'where':{'id':_0x4ab441[_0x898a('0x48')]['id']}})[_0x898a('0x23')](handleEntityNotFound(_0x28525b,null))[_0x898a('0x23')](saveUpdates(_0x4ab441['body'],null))[_0x898a('0x23')](respondWithResult(_0x28525b,null))[_0x898a('0x46')](handleError(_0x28525b,null));};exports[_0x898a('0x50')]=function(_0x5d325a,_0x52f8c6){return db[_0x898a('0x2b')][_0x898a('0x50')]()[_0x898a('0x23')](respondWithResult(_0x52f8c6,null))[_0x898a('0x46')](handleError(_0x52f8c6,null));};exports[_0x898a('0x51')]=function(_0x36b63a,_0x369f33,_0x6c0f07){var _0x289167=require(_0x898a('0x52'));var _0x2382a9=![];var _0x5e9329={};if(_0x36b63a[_0x898a('0x33')][_0x898a('0x2e')]&&_0x36b63a['query'][_0x898a('0x2e')]==='uniqueid'){_0x5e9329['uniqueid']=_0x36b63a[_0x898a('0x48')]['id'];}else{_0x5e9329['id']=_0x36b63a[_0x898a('0x48')]['id'];}return db[_0x898a('0x2b')]['find']({'where':_0x5e9329,'attributes':['id','value'],'raw':!![]})[_0x898a('0x23')](handleEntityNotFound(_0x369f33,null))[_0x898a('0x23')](function(_0x515725){if(_0x515725){var _0xaa96f7=path[_0x898a('0x53')](config['root'],_0x898a('0x54'),_0x515725[_0x898a('0x55')]);var _0x3122cc=util['format'](_0x898a('0x56'),_0xaa96f7);if(fs[_0x898a('0x57')](_0x3122cc)){_0x2382a9=!![];return _0x289167[_0x898a('0x58')](_0x3122cc,_0xaa96f7,config[_0x898a('0x59')][_0x898a('0x5a')])[_0x898a('0x23')](function(){return _0x515725;});}return _0x515725;}})['then'](function(_0x22a08a){if(_0x22a08a){var _0x4df5f0=path[_0x898a('0x53')](config[_0x898a('0x5b')],_0x898a('0x54'),_0x22a08a[_0x898a('0x55')]);if(!fs[_0x898a('0x57')](_0x4df5f0)){throw new db[(_0x898a('0x5c'))][(_0x898a('0x5d'))](_0x898a('0x5e'));}if(_0x22a08a[_0x898a('0x5f')]){return _0x369f33['download'](_0x4df5f0,_0x22a08a[_0x898a('0x5f')]+path[_0x898a('0x60')](_0x4df5f0),function(){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}else{return _0x369f33[_0x898a('0x51')](_0x4df5f0,function(_0x219976){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}}})[_0x898a('0x46')](function(_0x68fd81){if(_0x68fd81[_0x898a('0x62')]===_0x898a('0x5e')){_0x369f33[_0x898a('0x1a')](0x194)[_0x898a('0x28')](_0x898a('0x63'));}else{return handleError(_0x369f33,null);}});};exports[_0x898a('0x24')]=function(_0x22f9ba,_0x5f42ae){return db[_0x898a('0x2b')][_0x898a('0x4a')]({'where':{'id':_0x22f9ba['params']['id']}})[_0x898a('0x23')](function(_0x4583a1){if(_['isNil'](_0x4583a1)){throw new ReferenceError(_0x898a('0x64'));}return _0x4583a1;})[_0x898a('0x23')](function(_0x21f0f8){var _0x1f3f5b=path['join'](config[_0x898a('0x5b')],_0x898a('0x54'),_0x21f0f8[_0x898a('0x55')]);logger[_0x898a('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x1f3f5b);if(!_[_0x898a('0x66')](_0x21f0f8[_0x898a('0x55')])&&fs['existsSync'](_0x1f3f5b)){logger[_0x898a('0x65')](_0x898a('0x67')+_0x1f3f5b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x898a('0x68')](_0x1f3f5b);}_0x1f3f5b=_0x1f3f5b+'.cypher';if(!_[_0x898a('0x66')](_0x21f0f8['value'])&&fs['existsSync'](_0x1f3f5b)){logger['info'](_0x898a('0x67')+_0x1f3f5b+_0x898a('0x69'));fs[_0x898a('0x68')](_0x1f3f5b);}return _0x21f0f8;})[_0x898a('0x23')](function(_0x5e0535){if(!_0x5e0535)throw new InternalError();return _0x5e0535['destroy']();})[_0x898a('0x23')](function(){_0x5f42ae[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();})[_0x898a('0x46')](handleError(_0x5f42ae,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 50c0312..b50e732 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 _0x82bc=['bluebird','request-promise','path','rimraf','./screenRecording.attributes','exports','define','ScreenRecording','interactionid','util','../../config/logger','api'];(function(_0x1c3386,_0x2868c0){var _0x2cc8e9=function(_0x556aa2){while(--_0x556aa2){_0x1c3386['push'](_0x1c3386['shift']());}};_0x2cc8e9(++_0x2868c0);}(_0x82bc,0xed));var _0xc82b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x82bc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xc82b('0x0'));var logger=require(_0xc82b('0x1'))(_0xc82b('0x2'));var moment=require('moment');var BPromise=require(_0xc82b('0x3'));var rp=require(_0xc82b('0x4'));var fs=require('fs');var path=require(_0xc82b('0x5'));var rimraf=require(_0xc82b('0x6'));var config=require('../../config/environment');var attributes=require(_0xc82b('0x7'));module[_0xc82b('0x8')]=function(_0x2f16c6,_0x2c0187){return _0x2f16c6[_0xc82b('0x9')](_0xc82b('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xc82b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c61=['ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','define'];(function(_0x3ea026,_0xb82d71){var _0x4952da=function(_0x9dfcac){while(--_0x9dfcac){_0x3ea026['push'](_0x3ea026['shift']());}};_0x4952da(++_0xb82d71);}(_0x4c61,0x153));var _0x14c6=function(_0x391cf0,_0x158899){_0x391cf0=_0x391cf0-0x0;var _0x32eacf=_0x4c61[_0x391cf0];return _0x32eacf;};'use strict';var _=require('lodash');var util=require(_0x14c6('0x0'));var logger=require(_0x14c6('0x1'))(_0x14c6('0x2'));var moment=require(_0x14c6('0x3'));var BPromise=require(_0x14c6('0x4'));var rp=require(_0x14c6('0x5'));var fs=require('fs');var path=require(_0x14c6('0x6'));var rimraf=require(_0x14c6('0x7'));var config=require(_0x14c6('0x8'));var attributes=require(_0x14c6('0x9'));module['exports']=function(_0x3e42be,_0xf67275){return _0x3e42be[_0x14c6('0xa')](_0x14c6('0xb'),attributes,{'tableName':_0x14c6('0xc'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x14c6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index be596e5..c0ba2a3 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 _0xf605=['request\x20sent','stringify','error','code','message','info','ScreenRecording,\x20%s,\x20%s','result','catch','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3c9e43,_0x4f60c9){var _0x2678bf=function(_0x180be2){while(--_0x180be2){_0x3c9e43['push'](_0x3c9e43['shift']());}};_0x2678bf(++_0x4f60c9);}(_0xf605,0x139));var _0x5f60=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0xf605[_0x5af97c];return _0x3472ae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5f60('0x0'));var BPromise=require(_0x5f60('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5f60('0x2'));var logger=require('../../config/logger')(_0x5f60('0x3'));var config=require(_0x5f60('0x4'));var jayson=require(_0x5f60('0x5'));var client=jayson[_0x5f60('0x6')][_0x5f60('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b5c7e,_0x3a8c2d,_0x4b82cc){return new BPromise(function(_0x625a72,_0x5448dd){return client[_0x5f60('0x8')](_0x3b5c7e,_0x4b82cc)[_0x5f60('0x9')](function(_0x420791){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x3a8c2d,_0x5f60('0xa'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x3a8c2d,_0x5f60('0xa'),JSON[_0x5f60('0xb')](_0x420791));if(_0x420791[_0x5f60('0xc')]){if(_0x420791[_0x5f60('0xc')][_0x5f60('0xd')]===0x1f4){logger[_0x5f60('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x3a8c2d,_0x420791[_0x5f60('0xc')][_0x5f60('0xe')]);return _0x5448dd(_0x420791['error'][_0x5f60('0xe')]);}logger[_0x5f60('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x3a8c2d,_0x420791[_0x5f60('0xc')][_0x5f60('0xe')]);return _0x625a72(_0x420791[_0x5f60('0xc')][_0x5f60('0xe')]);}else{logger[_0x5f60('0xf')](_0x5f60('0x10'),_0x3a8c2d,'request\x20sent');_0x625a72(_0x420791[_0x5f60('0x11')][_0x5f60('0xe')]);}})[_0x5f60('0x12')](function(_0x16eae7){logger[_0x5f60('0xc')](_0x5f60('0x10'),_0x3a8c2d,_0x16eae7);_0x5448dd(_0x16eae7);});});} \ No newline at end of file +var _0x3029=['info','request\x20sent','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x102561,_0x280d2a){var _0x206ada=function(_0x39de0b){while(--_0x39de0b){_0x102561['push'](_0x102561['shift']());}};_0x206ada(++_0x280d2a);}(_0x3029,0x185));var _0x9302=function(_0x351af1,_0x2770f7){_0x351af1=_0x351af1-0x0;var _0x2aaafd=_0x3029[_0x351af1];return _0x2aaafd;};'use strict';var _=require(_0x9302('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9302('0x1'));var fs=require('fs');var Redis=require(_0x9302('0x2'));var db=require(_0x9302('0x3'))['db'];var utils=require(_0x9302('0x4'));var logger=require(_0x9302('0x5'))(_0x9302('0x6'));var config=require(_0x9302('0x7'));var jayson=require(_0x9302('0x8'));var client=jayson[_0x9302('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd1f3a0,_0x1af393,_0x28e5e6){return new BPromise(function(_0x3e4ddf,_0x44dddf){return client[_0x9302('0xa')](_0xd1f3a0,_0x28e5e6)['then'](function(_0x6504d7){logger[_0x9302('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x1af393,_0x9302('0xc'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1af393,_0x9302('0xc'),JSON[_0x9302('0xd')](_0x6504d7));if(_0x6504d7[_0x9302('0xe')]){if(_0x6504d7[_0x9302('0xe')][_0x9302('0xf')]===0x1f4){logger[_0x9302('0xe')](_0x9302('0x10'),_0x1af393,_0x6504d7[_0x9302('0xe')][_0x9302('0x11')]);return _0x44dddf(_0x6504d7[_0x9302('0xe')]['message']);}logger[_0x9302('0xe')](_0x9302('0x10'),_0x1af393,_0x6504d7[_0x9302('0xe')]['message']);return _0x3e4ddf(_0x6504d7[_0x9302('0xe')][_0x9302('0x11')]);}else{logger[_0x9302('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x1af393,_0x9302('0xc'));_0x3e4ddf(_0x6504d7[_0x9302('0x12')][_0x9302('0x11')]);}})[_0x9302('0x13')](function(_0x58c2d7){logger[_0x9302('0xe')](_0x9302('0x10'),_0x1af393,_0x58c2d7);_0x44dddf(_0x58c2d7);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index e451749..b752df3 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 _0x0065=['logologin','extname','originalname','single','preferred','favicon','addFavicon','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','/now','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','%s%s','post','file','addLogo','server/files/images/logos/','format'];(function(_0x3edc09,_0x1af697){var _0x1aeece=function(_0x2515e5){while(--_0x2515e5){_0x3edc09['push'](_0x3edc09['shift']());}};_0x1aeece(++_0x1af697);}(_0x0065,0xb0));var _0x5006=function(_0x2239c6,_0x43d551){_0x2239c6=_0x2239c6-0x0;var _0xc9ca7b=_0x0065[_0x2239c6];return _0xc9ca7b;};'use strict';var multer=require(_0x5006('0x0'));var util=require(_0x5006('0x1'));var path=require(_0x5006('0x2'));var timeout=require(_0x5006('0x3'));var express=require('express');var router=express[_0x5006('0x4')]();var fs_extra=require(_0x5006('0x5'));var auth=require(_0x5006('0x6'));var interaction=require(_0x5006('0x7'));var config=require(_0x5006('0x8'));var controller=require(_0x5006('0x9'));router['get']('/',auth[_0x5006('0xa')](),controller[_0x5006('0xb')]);router['get'](_0x5006('0xc'),controller['getDate']);router[_0x5006('0xd')](_0x5006('0xe'),controller[_0x5006('0xf')]);router['get'](_0x5006('0x10'),controller[_0x5006('0x11')]);router['get'](_0x5006('0x12'),controller['getLogoLogin']);router['get'](_0x5006('0x13'),controller[_0x5006('0x14')]);router[_0x5006('0xd')](_0x5006('0x15'),controller[_0x5006('0x16')]);router[_0x5006('0xd')](_0x5006('0x17'),controller[_0x5006('0x18')]);var upload=multer({'storage':multer[_0x5006('0x19')]({'destination':function(_0x3879bb,_0x446e87,_0x35ec2b){_0x35ec2b(null,path[_0x5006('0x1a')](config[_0x5006('0x1b')],'server/files/images/logos/'));},'filename':function(_0x11319f,_0x12d993,_0x129042){_0x129042(null,util['format'](_0x5006('0x1c'),'logo',path['extname'](_0x12d993['originalname'])));}})});router[_0x5006('0x1d')](_0x5006('0x10'),upload['single'](_0x5006('0x1e')),controller[_0x5006('0x1f')]);var upload=multer({'storage':multer[_0x5006('0x19')]({'destination':function(_0x198f80,_0x17095f,_0x3091e1){_0x3091e1(null,path['join'](config[_0x5006('0x1b')],_0x5006('0x20')));},'filename':function(_0x38268a,_0xcd21ab,_0x20d654){_0x20d654(null,util[_0x5006('0x21')](_0x5006('0x1c'),_0x5006('0x22'),path[_0x5006('0x23')](_0xcd21ab[_0x5006('0x24')])));}})});router['post'](_0x5006('0x12'),upload[_0x5006('0x25')](_0x5006('0x1e')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x5006('0x19')]({'destination':function(_0x4322ac,_0x2a2d95,_0xd928f9){_0xd928f9(null,path['join'](config['root'],_0x5006('0x20')));},'filename':function(_0xfb11ab,_0x1a772a,_0x1846a0){_0x1846a0(null,util[_0x5006('0x21')](_0x5006('0x1c'),_0x5006('0x26'),path['extname'](_0x1a772a[_0x5006('0x24')])));}})});router[_0x5006('0x1d')](_0x5006('0x15'),upload[_0x5006('0x25')](_0x5006('0x1e')),controller['addPreferred']);var upload=multer({'storage':multer[_0x5006('0x19')]({'destination':function(_0x4695b3,_0x46b109,_0x276fd2){_0x276fd2(null,path[_0x5006('0x1a')](config['root'],_0x5006('0x20')));},'filename':function(_0x2a0bb8,_0x4ee40c,_0x1f7152){_0x1f7152(null,util[_0x5006('0x21')](_0x5006('0x1c'),_0x5006('0x27'),path[_0x5006('0x23')](_0x4ee40c[_0x5006('0x24')])));}})});router[_0x5006('0x1d')](_0x5006('0x17'),upload[_0x5006('0x25')](_0x5006('0x1e')),controller[_0x5006('0x28')]);router['put'](_0x5006('0xe'),auth['isAuthenticated'](),controller[_0x5006('0x29')]);module['exports']=router; \ No newline at end of file +var _0x6de5=['%s%s','logo','extname','post','single','addLogo','root','server/files/images/logos/','logologin','originalname','preferred','addPreferred','favicon','/:id/favicon','file','addFavicon','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','getFavicon','diskStorage','join','format'];(function(_0xb76123,_0x55da5f){var _0xf0d08a=function(_0x82de04){while(--_0x82de04){_0xb76123['push'](_0xb76123['shift']());}};_0xf0d08a(++_0x55da5f);}(_0x6de5,0x1d6));var _0x56de=function(_0x51d96c,_0x464b3d){_0x51d96c=_0x51d96c-0x0;var _0x352217=_0x6de5[_0x51d96c];return _0x352217;};'use strict';var multer=require(_0x56de('0x0'));var util=require(_0x56de('0x1'));var path=require(_0x56de('0x2'));var timeout=require(_0x56de('0x3'));var express=require(_0x56de('0x4'));var router=express[_0x56de('0x5')]();var fs_extra=require(_0x56de('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x56de('0x7'));var config=require(_0x56de('0x8'));var controller=require(_0x56de('0x9'));router[_0x56de('0xa')]('/',auth[_0x56de('0xb')](),controller['index']);router[_0x56de('0xa')](_0x56de('0xc'),controller[_0x56de('0xd')]);router[_0x56de('0xa')]('/:id',controller[_0x56de('0xe')]);router['get'](_0x56de('0xf'),controller[_0x56de('0x10')]);router[_0x56de('0xa')](_0x56de('0x11'),controller[_0x56de('0x12')]);router['get'](_0x56de('0x13'),controller['gdpr']);router[_0x56de('0xa')]('/:id/preferred',controller[_0x56de('0x14')]);router[_0x56de('0xa')]('/:id/favicon',controller[_0x56de('0x15')]);var upload=multer({'storage':multer[_0x56de('0x16')]({'destination':function(_0x106487,_0x2246fe,_0x525b94){_0x525b94(null,path[_0x56de('0x17')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3bfe6f,_0x128660,_0x57a301){_0x57a301(null,util[_0x56de('0x18')](_0x56de('0x19'),_0x56de('0x1a'),path[_0x56de('0x1b')](_0x128660['originalname'])));}})});router[_0x56de('0x1c')]('/:id/logo',upload[_0x56de('0x1d')]('file'),controller[_0x56de('0x1e')]);var upload=multer({'storage':multer[_0x56de('0x16')]({'destination':function(_0x3b7aa8,_0x5de6f,_0x2518de){_0x2518de(null,path[_0x56de('0x17')](config[_0x56de('0x1f')],_0x56de('0x20')));},'filename':function(_0x3c885e,_0xed8276,_0x289893){_0x289893(null,util[_0x56de('0x18')](_0x56de('0x19'),_0x56de('0x21'),path[_0x56de('0x1b')](_0xed8276[_0x56de('0x22')])));}})});router[_0x56de('0x1c')](_0x56de('0x11'),upload[_0x56de('0x1d')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x56de('0x16')]({'destination':function(_0x16e883,_0x210898,_0xa034ad){_0xa034ad(null,path[_0x56de('0x17')](config[_0x56de('0x1f')],'server/files/images/logos/'));},'filename':function(_0x37b1f1,_0x51a024,_0x153369){_0x153369(null,util[_0x56de('0x18')](_0x56de('0x19'),_0x56de('0x23'),path[_0x56de('0x1b')](_0x51a024['originalname'])));}})});router[_0x56de('0x1c')]('/:id/preferred',upload[_0x56de('0x1d')]('file'),controller[_0x56de('0x24')]);var upload=multer({'storage':multer[_0x56de('0x16')]({'destination':function(_0x5b4542,_0x46774e,_0x471d51){_0x471d51(null,path['join'](config[_0x56de('0x1f')],'server/files/images/logos/'));},'filename':function(_0x535526,_0x10695a,_0x49aa00){_0x49aa00(null,util[_0x56de('0x18')]('%s%s',_0x56de('0x25'),path[_0x56de('0x1b')](_0x10695a[_0x56de('0x22')])));}})});router['post'](_0x56de('0x26'),upload[_0x56de('0x1d')](_0x56de('0x27')),controller[_0x56de('0x28')]);router[_0x56de('0x29')](_0x56de('0x2a'),auth[_0x56de('0xb')](),controller[_0x56de('0x2b')]);module[_0x56de('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 37dde03..4498a04 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 _0x3a25=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','exports','INTEGER','min_internal','STRING'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x3a25,0x101));var _0x53a2=function(_0x5730ca,_0xc70b2c){_0x5730ca=_0x5730ca-0x0;var _0x171dde=_0x3a25[_0x5730ca];return _0x171dde;};'use strict';var Sequelize=require('sequelize');module[_0x53a2('0x0')]={'min_internal':{'type':Sequelize[_0x53a2('0x1')](0xb),'unique':_0x53a2('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x53a2('0x1')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x53a2('0x3')],'defaultValue':_0x53a2('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x53a2('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x53a2('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x53a2('0x3')]},'turnusername':{'type':Sequelize[_0x53a2('0x3')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x53a2('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x53a2('0x3')],'defaultValue':_0x53a2('0x6')},'enableEmailPreview':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x53a2('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x53a2('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x53a2('0x3')],'defaultValue':_0x53a2('0x7')},'chatTimeout':{'type':Sequelize[_0x53a2('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x53a2('0x3')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x53a2('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x53a2('0x3')]},'defaultFavicon':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x53a2('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x53a2('0x3')]},'sentiment':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x53a2('0x1')]},'sentimentRegion':{'type':Sequelize[_0x53a2('0x3')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x53a2('0x3')]},'googleSsoEnabled':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x53a2('0x1')](0x2)[_0x53a2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x53a2('0x1')](0x2)[_0x53a2('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x53a2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x53a2('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x53a2('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x53a2('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x53a2('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x53a2('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x53a2('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x13a0=['sequelize','exports','min_mailbox','INTEGER','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x2cf1d5,_0x2bcdfb){var _0x408a2d=function(_0x3a0b04){while(--_0x3a0b04){_0x2cf1d5['push'](_0x2cf1d5['shift']());}};_0x408a2d(++_0x2bcdfb);}(_0x13a0,0x90));var _0x013a=function(_0x27e86e,_0x49d030){_0x27e86e=_0x27e86e-0x0;var _0x57d83e=_0x13a0[_0x27e86e];return _0x57d83e;};'use strict';var Sequelize=require(_0x013a('0x0'));module[_0x013a('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x013a('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x013a('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x013a('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x013a('0x4')]},'defaultLogo':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x013a('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x013a('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x013a('0x4')]},'turnaddr':{'type':Sequelize[_0x013a('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x013a('0x4')]},'pageTitle':{'type':Sequelize[_0x013a('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x013a('0x4')],'defaultValue':_0x013a('0x6')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x013a('0x4')],'defaultValue':_0x013a('0x7')},'chatTimeout':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x013a('0x4')]},'defaultFavicon':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x013a('0x3')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x013a('0x3')]},'sentimentRegion':{'type':Sequelize[_0x013a('0x4')]},'language':{'type':Sequelize[_0x013a('0x4')]},'bucket':{'type':Sequelize[_0x013a('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x013a('0x3')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x013a('0x3')](0x2)[_0x013a('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x013a('0x3')](0x2)[_0x013a('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x013a('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x013a('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x013a('0x3')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x013a('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index d6ae5d6..0ef25f3 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 _0xe20e=['getLogo','getLicense','logo','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','custom','securePassword','addPreferred','default_preferred.png','default','addFavicon','default_favicon.ico','getDate','utcOffset','send','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','save','update','then','destroy','end','stack','name','index','map','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Setting','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','body','addLogo','file','filename','addLogoLogin'];(function(_0x1fce4a,_0x1177be){var _0x3ea026=function(_0x532214){while(--_0x532214){_0x1fce4a['push'](_0x1fce4a['shift']());}};_0x3ea026(++_0x1177be);}(_0xe20e,0x195));var _0xee20=function(_0x7d8e66,_0x599dbd){_0x7d8e66=_0x7d8e66-0x0;var _0x190e52=_0xe20e[_0x7d8e66];return _0x190e52;};'use strict';var emlformat=require(_0xee20('0x0'));var rimraf=require(_0xee20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee20('0x2'));var rp=require(_0xee20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee20('0x4'));var util=require('util');var path=require(_0xee20('0x5'));var sox=require(_0xee20('0x6'));var csv=require(_0xee20('0x7'));var ejs=require(_0xee20('0x8'));var fs=require('fs');var fs_extra=require(_0xee20('0x9'));var _=require(_0xee20('0xa'));var squel=require(_0xee20('0xb'));var crypto=require(_0xee20('0xc'));var jsforce=require(_0xee20('0xd'));var deskjs=require(_0xee20('0xe'));var toCsv=require(_0xee20('0x7'));var querystring=require(_0xee20('0xf'));var Papa=require('papaparse');var Redis=require(_0xee20('0x10'));var authService=require(_0xee20('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee20('0x12'));var logger=require(_0xee20('0x13'))(_0xee20('0x14'));var utils=require(_0xee20('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xee20('0x16'));var db=require(_0xee20('0x17'))['db'];var jayson=require(_0xee20('0x18'));var client=jayson[_0xee20('0x19')][_0xee20('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3d61e8,_0x190e86,_0x5eb7b7,_0x3da816){return new BPromise(function(_0x4e1e75,_0x3f6df3){var _0x18e765=_0x3da816||client;return _0x18e765[_0xee20('0x1b')](_0x3d61e8,_0x5eb7b7)['then'](function(_0x6a910e){logger[_0xee20('0x1c')](_0xee20('0x1d'),_0x190e86,_0xee20('0x1e'));logger[_0xee20('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x190e86,_0xee20('0x1e'),JSON[_0xee20('0x20')](_0x6a910e));if(_0x6a910e['error']){if(_0x6a910e['error'][_0xee20('0x21')]===0x1f4){logger['error'](_0xee20('0x1d'),_0x190e86,_0x6a910e[_0xee20('0x22')][_0xee20('0x23')]);return _0x3f6df3(_0x6a910e[_0xee20('0x22')][_0xee20('0x23')]);}logger['error']('Setting,\x20%s,\x20%s',_0x190e86,_0x6a910e[_0xee20('0x22')][_0xee20('0x23')]);return _0x4e1e75(_0x6a910e[_0xee20('0x22')]['message']);}else{logger[_0xee20('0x1c')](_0xee20('0x1d'),_0x190e86,_0xee20('0x1e'));_0x4e1e75(_0x6a910e[_0xee20('0x24')][_0xee20('0x23')]);}})['catch'](function(_0x337826){logger['error'](_0xee20('0x1d'),_0x190e86,_0x337826);_0x3f6df3(_0x337826);});});}function respondWithStatusCode(_0x4b4134,_0x53a158){_0x53a158=_0x53a158||0xcc;return function(_0xc9af6c){if(_0xc9af6c){return _0x4b4134[_0xee20('0x25')](_0x53a158);}return _0x4b4134[_0xee20('0x26')](_0x53a158)['end']();};}function respondWithResult(_0x47b507,_0x5d0db3){_0x5d0db3=_0x5d0db3||0xc8;return function(_0x1030de){if(_0x1030de){return _0x47b507[_0xee20('0x26')](_0x5d0db3)['json'](_0x1030de);}};}function respondWithFilteredResult(_0x989704,_0x256250){return function(_0xc0e06b){if(_0xc0e06b){var _0x789af8=typeof _0x256250['offset']==='undefined'&&typeof _0x256250[_0xee20('0x27')]===_0xee20('0x28');var _0x378f40=_0xc0e06b[_0xee20('0x29')];var _0x1c3ccf=_0x789af8?0x0:_0x256250[_0xee20('0x2a')];var _0x5c2079=_0x789af8?_0xc0e06b[_0xee20('0x29')]:_0x256250[_0xee20('0x2a')]+_0x256250[_0xee20('0x27')];var _0x5d994a;if(_0x5c2079>=_0x378f40){_0x5c2079=_0x378f40;_0x5d994a=0xc8;}else{_0x5d994a=0xce;}_0x989704[_0xee20('0x26')](_0x5d994a);return _0x989704[_0xee20('0x2b')](_0xee20('0x2c'),_0x1c3ccf+'-'+_0x5c2079+'/'+_0x378f40)[_0xee20('0x2d')](_0xc0e06b);}return null;};}function patchUpdates(_0x458cd9){return function(_0x18cb44){try{jsonpatch[_0xee20('0x2e')](_0x18cb44,_0x458cd9,!![]);}catch(_0x47ac08){return BPromise['reject'](_0x47ac08);}return _0x18cb44[_0xee20('0x2f')]();};}function saveUpdates(_0x151425,_0x5c0078){return function(_0x31cf1a){if(_0x31cf1a){return _0x31cf1a[_0xee20('0x30')](_0x151425)[_0xee20('0x31')](function(_0x3f01d2){return _0x3f01d2;});}return null;};}function removeEntity(_0xd41556,_0x516633){return function(_0x5e49d6){if(_0x5e49d6){return _0x5e49d6[_0xee20('0x32')]()['then'](function(){_0xd41556[_0xee20('0x26')](0xcc)[_0xee20('0x33')]();});}};}function handleEntityNotFound(_0x1f0b8b,_0x1ec302){return function(_0x358e39){if(!_0x358e39){_0x1f0b8b[_0xee20('0x25')](0x194);}return _0x358e39;};}function handleError(_0xe9f98,_0x3bd190){_0x3bd190=_0x3bd190||0x1f4;return function(_0x33a779){logger['error'](_0x33a779[_0xee20('0x34')]);if(_0x33a779[_0xee20('0x35')]){delete _0x33a779[_0xee20('0x35')];}_0xe9f98[_0xee20('0x26')](_0x3bd190)['send'](_0x33a779);};}exports[_0xee20('0x36')]=function(_0x2b52b1,_0x657da7){var _0x4fc165={},_0x348c4f={},_0x806f13={'count':0x0,'rows':[]};var _0x3a212c=_[_0xee20('0x37')](db['Setting']['rawAttributes'],function(_0x3c4628){return{'name':_0x3c4628['fieldName'],'type':_0x3c4628[_0xee20('0x38')][_0xee20('0x39')]};});_0x348c4f[_0xee20('0x3a')]=_[_0xee20('0x37')](_0x3a212c,_0xee20('0x35'));_0x348c4f[_0xee20('0x3b')]=_['keys'](_0x2b52b1[_0xee20('0x3b')]);_0x348c4f[_0xee20('0x3c')]=_['intersection'](_0x348c4f[_0xee20('0x3a')],_0x348c4f[_0xee20('0x3b')]);_0x4fc165['attributes']=_[_0xee20('0x3d')](_0x348c4f[_0xee20('0x3a')],qs[_0xee20('0x3e')](_0x2b52b1['query']['fields']));_0x4fc165['attributes']=_0x4fc165[_0xee20('0x3f')]['length']?_0x4fc165[_0xee20('0x3f')]:_0x348c4f[_0xee20('0x3a')];if(!_0x2b52b1[_0xee20('0x3b')][_0xee20('0x40')](_0xee20('0x41'))){_0x4fc165[_0xee20('0x27')]=qs[_0xee20('0x27')](_0x2b52b1[_0xee20('0x3b')]['limit']);_0x4fc165['offset']=qs[_0xee20('0x2a')](_0x2b52b1[_0xee20('0x3b')][_0xee20('0x2a')]);}_0x4fc165[_0xee20('0x42')]=qs[_0xee20('0x43')](_0x2b52b1['query'][_0xee20('0x43')]);_0x4fc165[_0xee20('0x44')]=qs['filters'](_[_0xee20('0x45')](_0x2b52b1[_0xee20('0x3b')],_0x348c4f[_0xee20('0x3c')]),_0x3a212c);if(_0x2b52b1[_0xee20('0x3b')][_0xee20('0x46')]){_0x4fc165[_0xee20('0x44')]=_[_0xee20('0x47')](_0x4fc165[_0xee20('0x44')],{'$or':_[_0xee20('0x37')](_0x3a212c,function(_0x546de4){if(_0x546de4[_0xee20('0x38')]!==_0xee20('0x48')){var _0x9f556f={};_0x9f556f[_0x546de4['name']]={'$like':'%'+_0x2b52b1[_0xee20('0x3b')][_0xee20('0x46')]+'%'};return _0x9f556f;}})});}_0x4fc165=_[_0xee20('0x47')]({},_0x4fc165,_0x2b52b1[_0xee20('0x49')]);var _0x494b9b={'where':_0x4fc165['where']};return db[_0xee20('0x4a')][_0xee20('0x29')](_0x494b9b)['then'](function(_0x4e20c8){_0x806f13[_0xee20('0x29')]=_0x4e20c8;if(_0x2b52b1['query'][_0xee20('0x4b')]){_0x4fc165['include']=[{'all':!![]}];}return db['Setting'][_0xee20('0x4c')](_0x4fc165);})[_0xee20('0x31')](function(_0x597d10){_0x806f13[_0xee20('0x4d')]=_0x597d10;return _0x806f13;})[_0xee20('0x31')](respondWithFilteredResult(_0x657da7,_0x4fc165))[_0xee20('0x4e')](handleError(_0x657da7,null));};exports[_0xee20('0x4f')]=function(_0x3cac09,_0x10a5c4){var _0x4842aa={'raw':![],'where':{'id':_0x3cac09[_0xee20('0x50')]['id']}},_0x177240={};_0x177240['model']=_[_0xee20('0x51')](db[_0xee20('0x4a')][_0xee20('0x52')]);_0x177240[_0xee20('0x3b')]=_['keys'](_0x3cac09['query']);_0x177240[_0xee20('0x3c')]=_[_0xee20('0x3d')](_0x177240[_0xee20('0x3a')],_0x177240[_0xee20('0x3b')]);_0x4842aa[_0xee20('0x3f')]=_[_0xee20('0x3d')](_0x177240[_0xee20('0x3a')],qs[_0xee20('0x3e')](_0x3cac09[_0xee20('0x3b')][_0xee20('0x3e')]));_0x4842aa[_0xee20('0x3f')]=_0x4842aa[_0xee20('0x3f')][_0xee20('0x53')]?_0x4842aa[_0xee20('0x3f')]:_0x177240['model'];if(_0x3cac09[_0xee20('0x3b')][_0xee20('0x4b')]){_0x4842aa[_0xee20('0x54')]=[{'all':!![]}];}_0x4842aa=_[_0xee20('0x47')]({},_0x4842aa,_0x3cac09[_0xee20('0x49')]);return db['Setting'][_0xee20('0x55')](_0x4842aa)[_0xee20('0x31')](handleEntityNotFound(_0x10a5c4,null))[_0xee20('0x31')](respondWithResult(_0x10a5c4,null))[_0xee20('0x4e')](handleError(_0x10a5c4,null));};exports[_0xee20('0x30')]=function(_0x2fde89,_0x2e3ccc){if(_0x2fde89[_0xee20('0x56')]['id']){delete _0x2fde89['body']['id'];}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x2fde89[_0xee20('0x50')]['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x2e3ccc,null))[_0xee20('0x31')](saveUpdates(_0x2fde89[_0xee20('0x56')],null))['then'](respondWithResult(_0x2e3ccc,null))['catch'](handleError(_0x2e3ccc,null));};exports[_0xee20('0x57')]=function(_0x318a1d,_0x5c6288,_0x4c0501){if(_0x318a1d[_0xee20('0x58')]&&_0x318a1d['file'][_0xee20('0x59')]){_0x318a1d['body']['logo']=_0x318a1d[_0xee20('0x58')][_0xee20('0x59')];}return db[_0xee20('0x4a')]['find']({'where':{'id':_0x318a1d[_0xee20('0x50')]['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x5c6288,null))['then'](saveUpdates(_0x318a1d[_0xee20('0x56')],null))[_0xee20('0x31')](respondWithResult(_0x5c6288,null))['catch'](handleError(_0x5c6288,null));};exports[_0xee20('0x5a')]=function(_0x34c846,_0x2f2012,_0x2884b8){if(_0x34c846['file']&&_0x34c846[_0xee20('0x58')][_0xee20('0x59')]){_0x34c846[_0xee20('0x56')]['loginLogo']=_0x34c846[_0xee20('0x58')][_0xee20('0x59')];}return db[_0xee20('0x4a')]['find']({'where':{'id':_0x34c846[_0xee20('0x50')]['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x2f2012,null))[_0xee20('0x31')](saveUpdates(_0x34c846['body'],null))[_0xee20('0x31')](respondWithResult(_0x2f2012,null))['catch'](handleError(_0x2f2012,null));};var utilLicense=require(_0xee20('0x16'));exports[_0xee20('0x5b')]=function(_0x4ad4cf,_0x232002,_0x362084){var _0x39aa5e='server/files/images/logos';var _0x5a3759={'custom':![]};return utilLicense[_0xee20('0x5c')]()[_0xee20('0x31')](function(_0x42e8f5){if(_0x42e8f5){_0x5a3759=_0x42e8f5;}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x4ad4cf['params']['id']},'attributes':[_0xee20('0x5d'),_0xee20('0x5e'),_0xee20('0x5f'),_0xee20('0x60'),_0xee20('0x61'),_0xee20('0x62'),_0xee20('0x63'),_0xee20('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x232002,null))[_0xee20('0x31')](function(_0x38f94a){if(_0x38f94a){var _0x34c3e1=_0x38f94a['logo']&&fs[_0xee20('0x65')](path[_0xee20('0x66')](config['root'],_0x39aa5e,_[_0xee20('0x67')](_0x38f94a[_0xee20('0x5d')])))?path[_0xee20('0x66')](config[_0xee20('0x68')],_0x39aa5e,_[_0xee20('0x67')](_0x38f94a[_0xee20('0x5d')])):path[_0xee20('0x66')](config['root'],_0x39aa5e,_[_0xee20('0x67')]('default_logo.svg'));var _0x5bac94='default'+_['upperFirst'](_0xee20('0x5d'));if(_0x38f94a[_0x5bac94]||!_0x5a3759['custom']){_0x34c3e1=path[_0xee20('0x66')](config[_0xee20('0x68')],_0x39aa5e,_[_0xee20('0x67')](_0xee20('0x69')));}if(!fs['existsSync'](_0x34c3e1)){throw new db[(_0xee20('0x6a'))][(_0xee20('0x6b'))](_[_0xee20('0x6c')](_0xee20('0x5d'))+_0xee20('0x6d'));}return _0x232002[_0xee20('0x6e')](_0x34c3e1);}})[_0xee20('0x4e')](handleError(_0x232002,null));};var utilLicense=require(_0xee20('0x16'));exports[_0xee20('0x6f')]=function(_0x44c842,_0x250908,_0x58d1d2){var _0x418ba4=_0xee20('0x70');var _0x3881dc={'custom':![]};return utilLicense[_0xee20('0x5c')]()[_0xee20('0x31')](function(_0x22b507){if(_0x22b507){_0x3881dc=_0x22b507;}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x44c842[_0xee20('0x50')]['id']},'attributes':[_0xee20('0x5d'),'loginLogo','preferred','favicon',_0xee20('0x61'),_0xee20('0x62'),_0xee20('0x63'),_0xee20('0x64')],'raw':!![]});})[_0xee20('0x31')](handleEntityNotFound(_0x250908,null))[_0xee20('0x31')](function(_0x15b51a){if(_0x15b51a){var _0x4b1d45=_0x15b51a[_0xee20('0x5e')]&&fs[_0xee20('0x65')](path['join'](config['root'],_0x418ba4,_['toLower'](_0x15b51a[_0xee20('0x5e')])))?path[_0xee20('0x66')](config[_0xee20('0x68')],_0x418ba4,_['toLower'](_0x15b51a['loginLogo'])):path['join'](config[_0xee20('0x68')],_0x418ba4,_[_0xee20('0x67')](_0xee20('0x71')));var _0x5b67db='default'+_[_0xee20('0x6c')]('loginLogo');if(_0x15b51a[_0x5b67db]||!_0x3881dc[_0xee20('0x72')]){_0x4b1d45=path['join'](config[_0xee20('0x68')],_0x418ba4,_[_0xee20('0x67')](_0xee20('0x71')));}if(!fs['existsSync'](_0x4b1d45)){throw new db[(_0xee20('0x6a'))][(_0xee20('0x6b'))](_[_0xee20('0x6c')](_0xee20('0x5e'))+'\x20not\x20found');}return _0x250908[_0xee20('0x6e')](_0x4b1d45);}})[_0xee20('0x4e')](handleError(_0x250908,null));};exports['gdpr']=function(_0x5c74d7,_0x28e804){return db[_0xee20('0x4a')]['find']({'where':{'id':_0x5c74d7['params']['id']},'attributes':[_0xee20('0x73')]})[_0xee20('0x31')](respondWithResult(_0x28e804,null))[_0xee20('0x4e')](handleError(_0x28e804,null));};exports[_0xee20('0x74')]=function(_0x16ac4b,_0x2b61c6,_0x50142a){if(_0x16ac4b[_0xee20('0x58')]&&_0x16ac4b[_0xee20('0x58')]['filename']){_0x16ac4b[_0xee20('0x56')][_0xee20('0x5f')]=_0x16ac4b[_0xee20('0x58')][_0xee20('0x59')];}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x16ac4b[_0xee20('0x50')]['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x2b61c6,null))[_0xee20('0x31')](saveUpdates(_0x16ac4b['body'],null))[_0xee20('0x31')](respondWithResult(_0x2b61c6,null))[_0xee20('0x4e')](handleError(_0x2b61c6,null));};var utilLicense=require(_0xee20('0x16'));exports['getPreferred']=function(_0x2d8866,_0x176382,_0x25ad10){var _0x63ea68=_0xee20('0x70');var _0x4ecaa4={'custom':![]};return utilLicense[_0xee20('0x5c')]()['then'](function(_0x5257b5){if(_0x5257b5){_0x4ecaa4=_0x5257b5;}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x2d8866[_0xee20('0x50')]['id']},'attributes':[_0xee20('0x5d'),_0xee20('0x5e'),_0xee20('0x5f'),_0xee20('0x60'),_0xee20('0x61'),_0xee20('0x62'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x176382,null))[_0xee20('0x31')](function(_0x235edd){if(_0x235edd){var _0x5d6302=_0x235edd[_0xee20('0x5f')]&&fs['existsSync'](path[_0xee20('0x66')](config[_0xee20('0x68')],_0x63ea68,_[_0xee20('0x67')](_0x235edd[_0xee20('0x5f')])))?path[_0xee20('0x66')](config[_0xee20('0x68')],_0x63ea68,_[_0xee20('0x67')](_0x235edd[_0xee20('0x5f')])):path[_0xee20('0x66')](config[_0xee20('0x68')],_0x63ea68,_[_0xee20('0x67')](_0xee20('0x75')));var _0x5e54ba=_0xee20('0x76')+_[_0xee20('0x6c')](_0xee20('0x5f'));if(_0x235edd[_0x5e54ba]||!_0x4ecaa4[_0xee20('0x72')]||!_0x4ecaa4[_0xee20('0x5f')]){_0x5d6302=path[_0xee20('0x66')](config['root'],_0x63ea68,_['toLower'](_0xee20('0x75')));}if(!fs[_0xee20('0x65')](_0x5d6302)){throw new db[(_0xee20('0x6a'))]['ValidationError'](_[_0xee20('0x6c')](_0xee20('0x5f'))+_0xee20('0x6d'));}return _0x176382[_0xee20('0x6e')](_0x5d6302);}})[_0xee20('0x4e')](handleError(_0x176382,null));};exports[_0xee20('0x77')]=function(_0xf14001,_0x30dc05,_0x1190c0){if(_0xf14001[_0xee20('0x58')]&&_0xf14001[_0xee20('0x58')][_0xee20('0x59')]){_0xf14001[_0xee20('0x56')][_0xee20('0x60')]=_0xf14001[_0xee20('0x58')]['filename'];}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0xf14001['params']['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x30dc05,null))[_0xee20('0x31')](saveUpdates(_0xf14001['body'],null))['then'](respondWithResult(_0x30dc05,null))[_0xee20('0x4e')](handleError(_0x30dc05,null));};var utilLicense=require(_0xee20('0x16'));exports['getFavicon']=function(_0x200477,_0x21bf71,_0x414c39){var _0x1dadc7=_0xee20('0x70');var _0x53cff0={'custom':![]};return utilLicense[_0xee20('0x5c')]()[_0xee20('0x31')](function(_0x4e4cee){if(_0x4e4cee){_0x53cff0=_0x4e4cee;}return db[_0xee20('0x4a')]['find']({'where':{'id':_0x200477[_0xee20('0x50')]['id']},'attributes':[_0xee20('0x5d'),_0xee20('0x5e'),_0xee20('0x5f'),_0xee20('0x60'),_0xee20('0x61'),_0xee20('0x62'),_0xee20('0x63'),_0xee20('0x64')],'raw':!![]});})[_0xee20('0x31')](handleEntityNotFound(_0x21bf71,null))[_0xee20('0x31')](function(_0x123804){if(_0x123804){var _0x3cd103=_0x123804[_0xee20('0x60')]&&fs[_0xee20('0x65')](path[_0xee20('0x66')](config[_0xee20('0x68')],_0x1dadc7,_[_0xee20('0x67')](_0x123804[_0xee20('0x60')])))?path[_0xee20('0x66')](config[_0xee20('0x68')],_0x1dadc7,_[_0xee20('0x67')](_0x123804[_0xee20('0x60')])):path[_0xee20('0x66')](config[_0xee20('0x68')],_0x1dadc7,_[_0xee20('0x67')](_0xee20('0x78')));var _0x2055da=_0xee20('0x76')+_[_0xee20('0x6c')](_0xee20('0x60'));if(_0x123804[_0x2055da]||!_0x53cff0[_0xee20('0x72')]){_0x3cd103=path[_0xee20('0x66')](config[_0xee20('0x68')],_0x1dadc7,_[_0xee20('0x67')](_0xee20('0x78')));}if(!fs[_0xee20('0x65')](_0x3cd103)){throw new db[(_0xee20('0x6a'))][(_0xee20('0x6b'))](_[_0xee20('0x6c')]('favicon')+_0xee20('0x6d'));}return _0x21bf71[_0xee20('0x6e')](_0x3cd103);}})['catch'](handleError(_0x21bf71,null));};exports[_0xee20('0x79')]=function(_0xb47286,_0x4c8b5c){var _0x29f341={'offset':moment()[_0xee20('0x7a')]()};_0x29f341['now']=moment()[_0xee20('0x7a')](_0x29f341['offset'])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x4c8b5c[_0xee20('0x26')](0xc8)[_0xee20('0x7b')](_0x29f341);}; \ No newline at end of file +var _0xaafc=['rows','params','length','find','body','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','defaultLogo','defaultPreferred','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','sort','where','filter','merge','VIRTUAL','options','Setting','includeAll','include','findAll'];(function(_0xd770c4,_0x3f99dc){var _0xf8c9ae=function(_0x42b357){while(--_0x42b357){_0xd770c4['push'](_0xd770c4['shift']());}};_0xf8c9ae(++_0x3f99dc);}(_0xaafc,0x18f));var _0xcaaf=function(_0x19242f,_0x17e910){_0x19242f=_0x19242f-0x0;var _0x1cf49d=_0xaafc[_0x19242f];return _0x1cf49d;};'use strict';var emlformat=require(_0xcaaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcaaf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcaaf('0x2'));var moment=require('moment');var BPromise=require(_0xcaaf('0x3'));var Mustache=require(_0xcaaf('0x4'));var util=require(_0xcaaf('0x5'));var path=require(_0xcaaf('0x6'));var sox=require('sox');var csv=require(_0xcaaf('0x7'));var ejs=require(_0xcaaf('0x8'));var fs=require('fs');var fs_extra=require(_0xcaaf('0x9'));var _=require(_0xcaaf('0xa'));var squel=require('squel');var crypto=require(_0xcaaf('0xb'));var jsforce=require(_0xcaaf('0xc'));var deskjs=require(_0xcaaf('0xd'));var toCsv=require(_0xcaaf('0x7'));var querystring=require(_0xcaaf('0xe'));var Papa=require(_0xcaaf('0xf'));var Redis=require(_0xcaaf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcaaf('0x11'));var as=require(_0xcaaf('0x12'));var hardwareService=require(_0xcaaf('0x13'));var logger=require(_0xcaaf('0x14'))('api');var utils=require(_0xcaaf('0x15'));var config=require(_0xcaaf('0x16'));var licenseUtil=require(_0xcaaf('0x17'));var db=require(_0xcaaf('0x18'))['db'];var jayson=require(_0xcaaf('0x19'));var client=jayson[_0xcaaf('0x1a')][_0xcaaf('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1bd138,_0x5009e9,_0x3d442b,_0x2df79f){return new BPromise(function(_0x2491df,_0x106656){var _0x3f10e2=_0x2df79f||client;return _0x3f10e2[_0xcaaf('0x1c')](_0x1bd138,_0x3d442b)['then'](function(_0x5b9537){logger['info'](_0xcaaf('0x1d'),_0x5009e9,_0xcaaf('0x1e'));logger[_0xcaaf('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x5009e9,'request\x20sent',JSON[_0xcaaf('0x20')](_0x5b9537));if(_0x5b9537['error']){if(_0x5b9537[_0xcaaf('0x21')][_0xcaaf('0x22')]===0x1f4){logger[_0xcaaf('0x21')]('Setting,\x20%s,\x20%s',_0x5009e9,_0x5b9537['error']['message']);return _0x106656(_0x5b9537[_0xcaaf('0x21')][_0xcaaf('0x23')]);}logger['error'](_0xcaaf('0x1d'),_0x5009e9,_0x5b9537[_0xcaaf('0x21')][_0xcaaf('0x23')]);return _0x2491df(_0x5b9537[_0xcaaf('0x21')][_0xcaaf('0x23')]);}else{logger['info'](_0xcaaf('0x1d'),_0x5009e9,_0xcaaf('0x1e'));_0x2491df(_0x5b9537['result'][_0xcaaf('0x23')]);}})[_0xcaaf('0x24')](function(_0x4973a3){logger[_0xcaaf('0x21')]('Setting,\x20%s,\x20%s',_0x5009e9,_0x4973a3);_0x106656(_0x4973a3);});});}function respondWithStatusCode(_0x1a4805,_0x523480){_0x523480=_0x523480||0xcc;return function(_0x6c3bc){if(_0x6c3bc){return _0x1a4805[_0xcaaf('0x25')](_0x523480);}return _0x1a4805['status'](_0x523480)[_0xcaaf('0x26')]();};}function respondWithResult(_0x20480a,_0x48c899){_0x48c899=_0x48c899||0xc8;return function(_0x14469d){if(_0x14469d){return _0x20480a['status'](_0x48c899)[_0xcaaf('0x27')](_0x14469d);}};}function respondWithFilteredResult(_0x271557,_0xae97fc){return function(_0x4d19be){if(_0x4d19be){var _0x19db65=typeof _0xae97fc[_0xcaaf('0x28')]===_0xcaaf('0x29')&&typeof _0xae97fc[_0xcaaf('0x2a')]===_0xcaaf('0x29');var _0x208f04=_0x4d19be[_0xcaaf('0x2b')];var _0x799bb5=_0x19db65?0x0:_0xae97fc['offset'];var _0x86d16c=_0x19db65?_0x4d19be[_0xcaaf('0x2b')]:_0xae97fc['offset']+_0xae97fc[_0xcaaf('0x2a')];var _0x14ab02;if(_0x86d16c>=_0x208f04){_0x86d16c=_0x208f04;_0x14ab02=0xc8;}else{_0x14ab02=0xce;}_0x271557[_0xcaaf('0x2c')](_0x14ab02);return _0x271557['set'](_0xcaaf('0x2d'),_0x799bb5+'-'+_0x86d16c+'/'+_0x208f04)['json'](_0x4d19be);}return null;};}function patchUpdates(_0x2d7316){return function(_0x1d3454){try{jsonpatch[_0xcaaf('0x2e')](_0x1d3454,_0x2d7316,!![]);}catch(_0x26cd9f){return BPromise['reject'](_0x26cd9f);}return _0x1d3454[_0xcaaf('0x2f')]();};}function saveUpdates(_0x11e509,_0x2f5727){return function(_0x214227){if(_0x214227){return _0x214227[_0xcaaf('0x30')](_0x11e509)['then'](function(_0x34a47e){return _0x34a47e;});}return null;};}function removeEntity(_0xa615a6,_0x5e2c80){return function(_0x53c3ea){if(_0x53c3ea){return _0x53c3ea[_0xcaaf('0x31')]()[_0xcaaf('0x32')](function(){_0xa615a6[_0xcaaf('0x2c')](0xcc)[_0xcaaf('0x26')]();});}};}function handleEntityNotFound(_0x57774f,_0x57e376){return function(_0x5615d3){if(!_0x5615d3){_0x57774f[_0xcaaf('0x25')](0x194);}return _0x5615d3;};}function handleError(_0x310112,_0x24cf44){_0x24cf44=_0x24cf44||0x1f4;return function(_0x326114){logger[_0xcaaf('0x21')](_0x326114[_0xcaaf('0x33')]);if(_0x326114['name']){delete _0x326114[_0xcaaf('0x34')];}_0x310112['status'](_0x24cf44)[_0xcaaf('0x35')](_0x326114);};}exports[_0xcaaf('0x36')]=function(_0x24e5c8,_0x524d70){var _0x4156e2={},_0x210bed={},_0x3761ce={'count':0x0,'rows':[]};var _0x226fc3=_['map'](db['Setting'][_0xcaaf('0x37')],function(_0x4eb9e0){return{'name':_0x4eb9e0[_0xcaaf('0x38')],'type':_0x4eb9e0[_0xcaaf('0x39')][_0xcaaf('0x3a')]};});_0x210bed[_0xcaaf('0x3b')]=_[_0xcaaf('0x3c')](_0x226fc3,'name');_0x210bed['query']=_[_0xcaaf('0x3d')](_0x24e5c8[_0xcaaf('0x3e')]);_0x210bed[_0xcaaf('0x3f')]=_[_0xcaaf('0x40')](_0x210bed[_0xcaaf('0x3b')],_0x210bed['query']);_0x4156e2[_0xcaaf('0x41')]=_['intersection'](_0x210bed[_0xcaaf('0x3b')],qs[_0xcaaf('0x42')](_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x42')]));_0x4156e2['attributes']=_0x4156e2['attributes']['length']?_0x4156e2[_0xcaaf('0x41')]:_0x210bed['model'];if(!_0x24e5c8[_0xcaaf('0x3e')]['hasOwnProperty']('nolimit')){_0x4156e2['limit']=qs['limit'](_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x2a')]);_0x4156e2[_0xcaaf('0x28')]=qs['offset'](_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x28')]);}_0x4156e2['order']=qs[_0xcaaf('0x43')](_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x43')]);_0x4156e2[_0xcaaf('0x44')]=qs['filters'](_['pick'](_0x24e5c8[_0xcaaf('0x3e')],_0x210bed[_0xcaaf('0x3f')]),_0x226fc3);if(_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x45')]){_0x4156e2['where']=_[_0xcaaf('0x46')](_0x4156e2['where'],{'$or':_[_0xcaaf('0x3c')](_0x226fc3,function(_0x21b5fc){if(_0x21b5fc[_0xcaaf('0x39')]!==_0xcaaf('0x47')){var _0x1d5971={};_0x1d5971[_0x21b5fc[_0xcaaf('0x34')]]={'$like':'%'+_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x45')]+'%'};return _0x1d5971;}})});}_0x4156e2=_[_0xcaaf('0x46')]({},_0x4156e2,_0x24e5c8[_0xcaaf('0x48')]);var _0x14dda8={'where':_0x4156e2['where']};return db[_0xcaaf('0x49')][_0xcaaf('0x2b')](_0x14dda8)['then'](function(_0x185f25){_0x3761ce['count']=_0x185f25;if(_0x24e5c8[_0xcaaf('0x3e')][_0xcaaf('0x4a')]){_0x4156e2[_0xcaaf('0x4b')]=[{'all':!![]}];}return db[_0xcaaf('0x49')][_0xcaaf('0x4c')](_0x4156e2);})[_0xcaaf('0x32')](function(_0x1c0179){_0x3761ce[_0xcaaf('0x4d')]=_0x1c0179;return _0x3761ce;})[_0xcaaf('0x32')](respondWithFilteredResult(_0x524d70,_0x4156e2))[_0xcaaf('0x24')](handleError(_0x524d70,null));};exports['show']=function(_0x57c09b,_0x472a00){var _0xedb069={'raw':![],'where':{'id':_0x57c09b[_0xcaaf('0x4e')]['id']}},_0x2127f1={};_0x2127f1[_0xcaaf('0x3b')]=_[_0xcaaf('0x3d')](db[_0xcaaf('0x49')][_0xcaaf('0x37')]);_0x2127f1['query']=_[_0xcaaf('0x3d')](_0x57c09b[_0xcaaf('0x3e')]);_0x2127f1['filters']=_[_0xcaaf('0x40')](_0x2127f1[_0xcaaf('0x3b')],_0x2127f1[_0xcaaf('0x3e')]);_0xedb069[_0xcaaf('0x41')]=_[_0xcaaf('0x40')](_0x2127f1[_0xcaaf('0x3b')],qs[_0xcaaf('0x42')](_0x57c09b[_0xcaaf('0x3e')][_0xcaaf('0x42')]));_0xedb069[_0xcaaf('0x41')]=_0xedb069[_0xcaaf('0x41')][_0xcaaf('0x4f')]?_0xedb069['attributes']:_0x2127f1[_0xcaaf('0x3b')];if(_0x57c09b[_0xcaaf('0x3e')][_0xcaaf('0x4a')]){_0xedb069[_0xcaaf('0x4b')]=[{'all':!![]}];}_0xedb069=_[_0xcaaf('0x46')]({},_0xedb069,_0x57c09b[_0xcaaf('0x48')]);return db[_0xcaaf('0x49')][_0xcaaf('0x50')](_0xedb069)[_0xcaaf('0x32')](handleEntityNotFound(_0x472a00,null))['then'](respondWithResult(_0x472a00,null))[_0xcaaf('0x24')](handleError(_0x472a00,null));};exports[_0xcaaf('0x30')]=function(_0x3eb140,_0xcdf3fc){if(_0x3eb140[_0xcaaf('0x51')]['id']){delete _0x3eb140[_0xcaaf('0x51')]['id'];}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x3eb140[_0xcaaf('0x4e')]['id']}})[_0xcaaf('0x32')](handleEntityNotFound(_0xcdf3fc,null))[_0xcaaf('0x32')](saveUpdates(_0x3eb140[_0xcaaf('0x51')],null))[_0xcaaf('0x32')](respondWithResult(_0xcdf3fc,null))[_0xcaaf('0x24')](handleError(_0xcdf3fc,null));};exports[_0xcaaf('0x52')]=function(_0x57fbce,_0x234189,_0x4d4888){if(_0x57fbce[_0xcaaf('0x53')]&&_0x57fbce[_0xcaaf('0x53')][_0xcaaf('0x54')]){_0x57fbce['body'][_0xcaaf('0x55')]=_0x57fbce['file']['filename'];}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x57fbce[_0xcaaf('0x4e')]['id']}})[_0xcaaf('0x32')](handleEntityNotFound(_0x234189,null))[_0xcaaf('0x32')](saveUpdates(_0x57fbce['body'],null))['then'](respondWithResult(_0x234189,null))[_0xcaaf('0x24')](handleError(_0x234189,null));};exports[_0xcaaf('0x56')]=function(_0x14173f,_0x47a73a,_0x5c80b3){if(_0x14173f[_0xcaaf('0x53')]&&_0x14173f[_0xcaaf('0x53')][_0xcaaf('0x54')]){_0x14173f[_0xcaaf('0x51')]['loginLogo']=_0x14173f['file'][_0xcaaf('0x54')];}return db['Setting'][_0xcaaf('0x50')]({'where':{'id':_0x14173f['params']['id']}})['then'](handleEntityNotFound(_0x47a73a,null))[_0xcaaf('0x32')](saveUpdates(_0x14173f[_0xcaaf('0x51')],null))[_0xcaaf('0x32')](respondWithResult(_0x47a73a,null))['catch'](handleError(_0x47a73a,null));};var utilLicense=require(_0xcaaf('0x17'));exports[_0xcaaf('0x57')]=function(_0x5ac758,_0x2c27db,_0x541863){var _0x1a1ec3=_0xcaaf('0x58');var _0x202297={'custom':![]};return utilLicense[_0xcaaf('0x59')]()['then'](function(_0x1a52b3){if(_0x1a52b3){_0x202297=_0x1a52b3;}return db[_0xcaaf('0x49')]['find']({'where':{'id':_0x5ac758[_0xcaaf('0x4e')]['id']},'attributes':[_0xcaaf('0x55'),_0xcaaf('0x5a'),_0xcaaf('0x5b'),_0xcaaf('0x5c'),'defaultLogo',_0xcaaf('0x5d'),'defaultPreferred',_0xcaaf('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x2c27db,null))[_0xcaaf('0x32')](function(_0x48ce22){if(_0x48ce22){var _0x17e7c9=_0x48ce22[_0xcaaf('0x55')]&&fs[_0xcaaf('0x5f')](path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x1a1ec3,_[_0xcaaf('0x62')](_0x48ce22[_0xcaaf('0x55')])))?path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x1a1ec3,_[_0xcaaf('0x62')](_0x48ce22[_0xcaaf('0x55')])):path[_0xcaaf('0x60')](config['root'],_0x1a1ec3,_['toLower'](_0xcaaf('0x63')));var _0x419394=_0xcaaf('0x64')+_[_0xcaaf('0x65')](_0xcaaf('0x55'));if(_0x48ce22[_0x419394]||!_0x202297[_0xcaaf('0x66')]){_0x17e7c9=path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x1a1ec3,_['toLower'](_0xcaaf('0x63')));}if(!fs[_0xcaaf('0x5f')](_0x17e7c9)){throw new db[(_0xcaaf('0x67'))][(_0xcaaf('0x68'))](_['upperFirst'](_0xcaaf('0x55'))+'\x20not\x20found');}return _0x2c27db[_0xcaaf('0x69')](_0x17e7c9);}})[_0xcaaf('0x24')](handleError(_0x2c27db,null));};var utilLicense=require(_0xcaaf('0x17'));exports[_0xcaaf('0x6a')]=function(_0x27b1c8,_0x49c08c,_0x239b36){var _0x3b52d3=_0xcaaf('0x58');var _0x1e9d65={'custom':![]};return utilLicense[_0xcaaf('0x59')]()['then'](function(_0x1b1165){if(_0x1b1165){_0x1e9d65=_0x1b1165;}return db['Setting'][_0xcaaf('0x50')]({'where':{'id':_0x27b1c8[_0xcaaf('0x4e')]['id']},'attributes':['logo',_0xcaaf('0x5a'),_0xcaaf('0x5b'),'favicon',_0xcaaf('0x6b'),_0xcaaf('0x5d'),_0xcaaf('0x6c'),_0xcaaf('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x49c08c,null))[_0xcaaf('0x32')](function(_0x4cd0ba){if(_0x4cd0ba){var _0x5bfa5b=_0x4cd0ba['loginLogo']&&fs[_0xcaaf('0x5f')](path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3b52d3,_[_0xcaaf('0x62')](_0x4cd0ba[_0xcaaf('0x5a')])))?path[_0xcaaf('0x60')](config['root'],_0x3b52d3,_[_0xcaaf('0x62')](_0x4cd0ba[_0xcaaf('0x5a')])):path['join'](config[_0xcaaf('0x61')],_0x3b52d3,_[_0xcaaf('0x62')]('default_loginLogo.svg'));var _0x4eb5bf='default'+_['upperFirst'](_0xcaaf('0x5a'));if(_0x4cd0ba[_0x4eb5bf]||!_0x1e9d65[_0xcaaf('0x66')]){_0x5bfa5b=path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3b52d3,_[_0xcaaf('0x62')]('default_loginLogo.svg'));}if(!fs[_0xcaaf('0x5f')](_0x5bfa5b)){throw new db['Sequelize'][(_0xcaaf('0x68'))](_['upperFirst']('loginLogo')+_0xcaaf('0x6d'));}return _0x49c08c[_0xcaaf('0x69')](_0x5bfa5b);}})[_0xcaaf('0x24')](handleError(_0x49c08c,null));};exports[_0xcaaf('0x6e')]=function(_0x3bcc5f,_0x46cefb){return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x3bcc5f['params']['id']},'attributes':[_0xcaaf('0x6f')]})[_0xcaaf('0x32')](respondWithResult(_0x46cefb,null))[_0xcaaf('0x24')](handleError(_0x46cefb,null));};exports[_0xcaaf('0x70')]=function(_0x1fbdf1,_0x20bdc0,_0x2e774c){if(_0x1fbdf1[_0xcaaf('0x53')]&&_0x1fbdf1[_0xcaaf('0x53')][_0xcaaf('0x54')]){_0x1fbdf1[_0xcaaf('0x51')][_0xcaaf('0x5b')]=_0x1fbdf1[_0xcaaf('0x53')]['filename'];}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x1fbdf1[_0xcaaf('0x4e')]['id']}})['then'](handleEntityNotFound(_0x20bdc0,null))[_0xcaaf('0x32')](saveUpdates(_0x1fbdf1['body'],null))['then'](respondWithResult(_0x20bdc0,null))[_0xcaaf('0x24')](handleError(_0x20bdc0,null));};var utilLicense=require(_0xcaaf('0x17'));exports[_0xcaaf('0x71')]=function(_0x4dee30,_0x2a0e9c,_0xc5d2c6){var _0x3166e6=_0xcaaf('0x58');var _0x1b1e62={'custom':![]};return utilLicense[_0xcaaf('0x59')]()['then'](function(_0x35e49c){if(_0x35e49c){_0x1b1e62=_0x35e49c;}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x4dee30['params']['id']},'attributes':[_0xcaaf('0x55'),_0xcaaf('0x5a'),_0xcaaf('0x5b'),_0xcaaf('0x5c'),_0xcaaf('0x6b'),_0xcaaf('0x5d'),_0xcaaf('0x6c'),_0xcaaf('0x5e')],'raw':!![]});})[_0xcaaf('0x32')](handleEntityNotFound(_0x2a0e9c,null))[_0xcaaf('0x32')](function(_0x39265b){if(_0x39265b){var _0x5adec6=_0x39265b[_0xcaaf('0x5b')]&&fs[_0xcaaf('0x5f')](path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3166e6,_['toLower'](_0x39265b[_0xcaaf('0x5b')])))?path['join'](config[_0xcaaf('0x61')],_0x3166e6,_[_0xcaaf('0x62')](_0x39265b[_0xcaaf('0x5b')])):path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3166e6,_['toLower']('default_preferred.png'));var _0x105cb6=_0xcaaf('0x64')+_['upperFirst'](_0xcaaf('0x5b'));if(_0x39265b[_0x105cb6]||!_0x1b1e62['custom']||!_0x1b1e62[_0xcaaf('0x5b')]){_0x5adec6=path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x3166e6,_[_0xcaaf('0x62')](_0xcaaf('0x72')));}if(!fs[_0xcaaf('0x5f')](_0x5adec6)){throw new db[(_0xcaaf('0x67'))][(_0xcaaf('0x68'))](_[_0xcaaf('0x65')](_0xcaaf('0x5b'))+_0xcaaf('0x6d'));}return _0x2a0e9c[_0xcaaf('0x69')](_0x5adec6);}})[_0xcaaf('0x24')](handleError(_0x2a0e9c,null));};exports['addFavicon']=function(_0x57e3dc,_0x1c2fac,_0x153674){if(_0x57e3dc[_0xcaaf('0x53')]&&_0x57e3dc[_0xcaaf('0x53')]['filename']){_0x57e3dc[_0xcaaf('0x51')][_0xcaaf('0x5c')]=_0x57e3dc[_0xcaaf('0x53')][_0xcaaf('0x54')];}return db[_0xcaaf('0x49')][_0xcaaf('0x50')]({'where':{'id':_0x57e3dc[_0xcaaf('0x4e')]['id']}})[_0xcaaf('0x32')](handleEntityNotFound(_0x1c2fac,null))[_0xcaaf('0x32')](saveUpdates(_0x57e3dc['body'],null))[_0xcaaf('0x32')](respondWithResult(_0x1c2fac,null))['catch'](handleError(_0x1c2fac,null));};var utilLicense=require(_0xcaaf('0x17'));exports['getFavicon']=function(_0x516832,_0x33c027,_0x3c98b2){var _0x4c98ec='server/files/images/logos';var _0x2ae4e4={'custom':![]};return utilLicense[_0xcaaf('0x59')]()[_0xcaaf('0x32')](function(_0x3f15cd){if(_0x3f15cd){_0x2ae4e4=_0x3f15cd;}return db[_0xcaaf('0x49')]['find']({'where':{'id':_0x516832[_0xcaaf('0x4e')]['id']},'attributes':['logo','loginLogo',_0xcaaf('0x5b'),_0xcaaf('0x5c'),_0xcaaf('0x6b'),'defaultLoginLogo',_0xcaaf('0x6c'),'defaultFavicon'],'raw':!![]});})[_0xcaaf('0x32')](handleEntityNotFound(_0x33c027,null))[_0xcaaf('0x32')](function(_0x4c2f3e){if(_0x4c2f3e){var _0x50cb0f=_0x4c2f3e[_0xcaaf('0x5c')]&&fs[_0xcaaf('0x5f')](path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x4c98ec,_[_0xcaaf('0x62')](_0x4c2f3e[_0xcaaf('0x5c')])))?path['join'](config['root'],_0x4c98ec,_[_0xcaaf('0x62')](_0x4c2f3e[_0xcaaf('0x5c')])):path[_0xcaaf('0x60')](config[_0xcaaf('0x61')],_0x4c98ec,_[_0xcaaf('0x62')](_0xcaaf('0x73')));var _0x5b8042=_0xcaaf('0x64')+_[_0xcaaf('0x65')](_0xcaaf('0x5c'));if(_0x4c2f3e[_0x5b8042]||!_0x2ae4e4[_0xcaaf('0x66')]){_0x50cb0f=path['join'](config[_0xcaaf('0x61')],_0x4c98ec,_[_0xcaaf('0x62')](_0xcaaf('0x73')));}if(!fs[_0xcaaf('0x5f')](_0x50cb0f)){throw new db[(_0xcaaf('0x67'))]['ValidationError'](_[_0xcaaf('0x65')]('favicon')+'\x20not\x20found');}return _0x33c027['download'](_0x50cb0f);}})['catch'](handleError(_0x33c027,null));};exports['getDate']=function(_0x223d8a,_0x4c9e1b){var _0x5cae69={'offset':moment()['utcOffset']()};_0x5cae69['now']=moment()[_0xcaaf('0x74')](_0x5cae69[_0xcaaf('0x28')])[_0xcaaf('0x75')](_0xcaaf('0x76'));return _0x4c9e1b[_0xcaaf('0x2c')](0xc8)[_0xcaaf('0x35')](_0x5cae69);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index f071288..3ed0dc7 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x20a530,_0x5976e1){var _0x5e9e67=function(_0x966c44){while(--_0x966c44){_0x20a530['push'](_0x20a530['shift']());}};_0x5e9e67(++_0x5976e1);}(_0xe14b,0x93));var _0xbe14=function(_0x247631,_0x17f06c){_0x247631=_0x247631-0x0;var _0x450300=_0xe14b[_0x247631];return _0x450300;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index b30acee..93e7126 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 _0xd33b=['../../config/logger','../../config/environment','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd33b,0xbf));var _0xbd33=function(_0x4915a2,_0x562f66){_0x4915a2=_0x4915a2-0x0;var _0x294cd3=_0xd33b[_0x4915a2];return _0x294cd3;};'use strict';var _=require(_0xbd33('0x0'));var util=require(_0xbd33('0x1'));var moment=require('moment');var BPromise=require(_0xbd33('0x2'));var rs=require(_0xbd33('0x3'));var fs=require('fs');var Redis=require(_0xbd33('0x4'));var db=require(_0xbd33('0x5'))['db'];var utils=require(_0xbd33('0x6'));var logger=require(_0xbd33('0x7'))('rpc');var config=require(_0xbd33('0x8'));var jayson=require(_0xbd33('0x9'));var client=jayson[_0xbd33('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8a3603,_0x4d7503,_0x454d85){return new BPromise(function(_0x341def,_0x270aca){return client[_0xbd33('0xb')](_0x8a3603,_0x454d85)['then'](function(_0x53f5f9){logger[_0xbd33('0xc')](_0xbd33('0xd'),_0x4d7503,_0xbd33('0xe'));logger['debug'](_0xbd33('0xf'),_0x4d7503,_0xbd33('0xe'),JSON[_0xbd33('0x10')](_0x53f5f9));if(_0x53f5f9[_0xbd33('0x11')]){if(_0x53f5f9[_0xbd33('0x11')][_0xbd33('0x12')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x4d7503,_0x53f5f9[_0xbd33('0x11')][_0xbd33('0x13')]);return _0x270aca(_0x53f5f9['error'][_0xbd33('0x13')]);}logger[_0xbd33('0x11')](_0xbd33('0xd'),_0x4d7503,_0x53f5f9['error'][_0xbd33('0x13')]);return _0x341def(_0x53f5f9[_0xbd33('0x11')][_0xbd33('0x13')]);}else{logger[_0xbd33('0xc')]('Setting,\x20%s,\x20%s',_0x4d7503,_0xbd33('0xe'));_0x341def(_0x53f5f9['result']['message']);}})[_0xbd33('0x14')](function(_0x54f4fd){logger['error'](_0xbd33('0xd'),_0x4d7503,_0x54f4fd);_0x270aca(_0x54f4fd);});});}exports[_0xbd33('0x15')]=function(_0x5c2171){var _0x5d0e6f=this;return new Promise(function(_0x46310c,_0x413210){return db[_0xbd33('0x16')][_0xbd33('0x17')]({'raw':_0x5c2171[_0xbd33('0x18')]?_0x5c2171[_0xbd33('0x18')][_0xbd33('0x19')]===undefined?!![]:![]:!![],'where':_0x5c2171[_0xbd33('0x18')]?_0x5c2171[_0xbd33('0x18')][_0xbd33('0x1a')]||null:null,'attributes':_0x5c2171['options']?_0x5c2171[_0xbd33('0x18')][_0xbd33('0x1b')]||null:null,'include':_0x5c2171['options']?_0x5c2171['options']['include']?_['map'](_0x5c2171[_0xbd33('0x18')][_0xbd33('0x1c')],function(_0x35e14e){return{'model':db[_0x35e14e['model']],'as':_0x35e14e['as'],'attributes':_0x35e14e[_0xbd33('0x1b')],'include':_0x35e14e['include']?_[_0xbd33('0x1d')](_0x35e14e[_0xbd33('0x1c')],function(_0x4b8c8f){return{'model':db[_0x4b8c8f[_0xbd33('0x1e')]],'as':_0x4b8c8f['as'],'attributes':_0x4b8c8f[_0xbd33('0x1b')],'include':_0x4b8c8f[_0xbd33('0x1c')]?_[_0xbd33('0x1d')](_0x4b8c8f[_0xbd33('0x1c')],function(_0x9c863d){return{'model':db[_0x9c863d['model']],'as':_0x9c863d['as'],'attributes':_0x9c863d[_0xbd33('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbd33('0x1f')](function(_0x1f2ba2){logger[_0xbd33('0xc')]('ShowSetting',_0x5c2171);logger[_0xbd33('0x20')]('ShowSetting',_0x5c2171,JSON[_0xbd33('0x10')](_0x1f2ba2));_0x46310c(_0x1f2ba2);})[_0xbd33('0x14')](function(_0x1045da){logger[_0xbd33('0x11')](_0xbd33('0x15'),_0x1045da[_0xbd33('0x13')],_0x5c2171);_0x413210(_0x5d0e6f[_0xbd33('0x11')](0x1f4,_0x1045da[_0xbd33('0x13')]));});});}; \ No newline at end of file +var _0x7421=['raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','ShowSetting','Setting','options'];(function(_0x2a9fa6,_0x73e948){var _0x129740=function(_0xd6868){while(--_0xd6868){_0x2a9fa6['push'](_0x2a9fa6['shift']());}};_0x129740(++_0x73e948);}(_0x7421,0xc6));var _0x1742=function(_0x1f1263,_0x42f60e){_0x1f1263=_0x1f1263-0x0;var _0x3769a6=_0x7421[_0x1f1263];return _0x3769a6;};'use strict';var _=require(_0x1742('0x0'));var util=require(_0x1742('0x1'));var moment=require(_0x1742('0x2'));var BPromise=require(_0x1742('0x3'));var rs=require(_0x1742('0x4'));var fs=require('fs');var Redis=require(_0x1742('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1742('0x6'));var logger=require(_0x1742('0x7'))(_0x1742('0x8'));var config=require('../../config/environment');var jayson=require(_0x1742('0x9'));var client=jayson[_0x1742('0xa')][_0x1742('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xaed450,_0x7c5b67,_0x50efab){return new BPromise(function(_0x354567,_0x35d97a){return client[_0x1742('0xc')](_0xaed450,_0x50efab)[_0x1742('0xd')](function(_0x1a5f38){logger[_0x1742('0xe')](_0x1742('0xf'),_0x7c5b67,'request\x20sent');logger[_0x1742('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x7c5b67,_0x1742('0x11'),JSON[_0x1742('0x12')](_0x1a5f38));if(_0x1a5f38['error']){if(_0x1a5f38[_0x1742('0x13')]['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x7c5b67,_0x1a5f38[_0x1742('0x13')][_0x1742('0x14')]);return _0x35d97a(_0x1a5f38[_0x1742('0x13')][_0x1742('0x14')]);}logger[_0x1742('0x13')]('Setting,\x20%s,\x20%s',_0x7c5b67,_0x1a5f38['error'][_0x1742('0x14')]);return _0x354567(_0x1a5f38[_0x1742('0x13')][_0x1742('0x14')]);}else{logger[_0x1742('0xe')]('Setting,\x20%s,\x20%s',_0x7c5b67,_0x1742('0x11'));_0x354567(_0x1a5f38[_0x1742('0x15')][_0x1742('0x14')]);}})[_0x1742('0x16')](function(_0xdb067c){logger[_0x1742('0x13')](_0x1742('0xf'),_0x7c5b67,_0xdb067c);_0x35d97a(_0xdb067c);});});}exports[_0x1742('0x17')]=function(_0x59a0a4){var _0x29df16=this;return new Promise(function(_0x38d216,_0x200d9e){return db[_0x1742('0x18')]['find']({'raw':_0x59a0a4[_0x1742('0x19')]?_0x59a0a4[_0x1742('0x19')][_0x1742('0x1a')]===undefined?!![]:![]:!![],'where':_0x59a0a4[_0x1742('0x19')]?_0x59a0a4[_0x1742('0x19')][_0x1742('0x1b')]||null:null,'attributes':_0x59a0a4[_0x1742('0x19')]?_0x59a0a4[_0x1742('0x19')][_0x1742('0x1c')]||null:null,'include':_0x59a0a4[_0x1742('0x19')]?_0x59a0a4[_0x1742('0x19')][_0x1742('0x1d')]?_['map'](_0x59a0a4['options'][_0x1742('0x1d')],function(_0x1f076d){return{'model':db[_0x1f076d['model']],'as':_0x1f076d['as'],'attributes':_0x1f076d[_0x1742('0x1c')],'include':_0x1f076d[_0x1742('0x1d')]?_[_0x1742('0x1e')](_0x1f076d['include'],function(_0x24042a){return{'model':db[_0x24042a[_0x1742('0x1f')]],'as':_0x24042a['as'],'attributes':_0x24042a[_0x1742('0x1c')],'include':_0x24042a[_0x1742('0x1d')]?_[_0x1742('0x1e')](_0x24042a[_0x1742('0x1d')],function(_0x2b0cb7){return{'model':db[_0x2b0cb7['model']],'as':_0x2b0cb7['as'],'attributes':_0x2b0cb7['attributes']};}):[]};}):[]};}):[]:[]})[_0x1742('0xd')](function(_0x3bce3a){logger[_0x1742('0xe')]('ShowSetting',_0x59a0a4);logger[_0x1742('0x10')](_0x1742('0x17'),_0x59a0a4,JSON[_0x1742('0x12')](_0x3bce3a));_0x38d216(_0x3bce3a);})[_0x1742('0x16')](function(_0x42dfcb){logger[_0x1742('0x13')](_0x1742('0x17'),_0x42dfcb[_0x1742('0x14')],_0x59a0a4);_0x200d9e(_0x29df16['error'](0x1f4,_0x42dfcb[_0x1742('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index a22bc38..2bebe6c 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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x54fc1f,_0x1703c2){var _0x53f699=function(_0x3fad74){while(--_0x3fad74){_0x54fc1f['push'](_0x54fc1f['shift']());}};_0x53f699(++_0x1703c2);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x189b40,_0x2583e7){var _0x56c2a7=function(_0x5b6666){while(--_0x5b6666){_0x189b40['push'](_0x189b40['shift']());}};_0x56c2a7(++_0x2583e7);}(_0x7a54,0x106));var _0x47a5=function(_0x911cf6,_0x3a16c8){_0x911cf6=_0x911cf6-0x0;var _0x52c6fb=_0x7a54[_0x911cf6];return _0x52c6fb;};'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['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index efc8808..8c4034d 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 _0x5f4f=['name','generate','ENUM','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x3041b7,_0x3a9223){var _0x2d6953=function(_0x30eccf){while(--_0x30eccf){_0x3041b7['push'](_0x3041b7['shift']());}};_0x2d6953(++_0x3a9223);}(_0x5f4f,0xf9));var _0xf5f4=function(_0x5cbace,_0x33943c){_0x5cbace=_0x5cbace-0x0;var _0x6de5b8=_0x5f4f[_0x5cbace];return _0x6de5b8;};'use strict';var Sequelize=require(_0xf5f4('0x0'));var rs=require(_0xf5f4('0x1'));module[_0xf5f4('0x2')]={'name':{'type':Sequelize[_0xf5f4('0x3')],'unique':_0xf5f4('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xf5f4('0x3')],'defaultValue':function(){return rs[_0xf5f4('0x5')]();}},'phone':{'type':Sequelize[_0xf5f4('0x3')]},'type':{'type':Sequelize[_0xf5f4('0x6')]('twilio',_0xf5f4('0x7'),_0xf5f4('0x8'),_0xf5f4('0x9'),_0xf5f4('0xa'),_0xf5f4('0xb'),_0xf5f4('0xc'),_0xf5f4('0xd'),_0xf5f4('0xe'),_0xf5f4('0xf'))},'accountSid':{'type':Sequelize[_0xf5f4('0x3')]},'authId':{'type':Sequelize[_0xf5f4('0x3')]},'authToken':{'type':Sequelize[_0xf5f4('0x3')]},'smsMethod':{'type':Sequelize[_0xf5f4('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xf5f4('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xf5f4('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xf5f4('0x3')]},'senderString':{'type':Sequelize[_0xf5f4('0x3')]},'deliveryReport':{'type':Sequelize[_0xf5f4('0x10')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf5f4('0x11')],'defaultValue':function(){return _0xf5f4('0x12');}},'notificationSound':{'type':Sequelize[_0xf5f4('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf5f4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf5f4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf5f4('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf5f4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf5f4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf5f4('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf5f4('0x13')],'comment':_0xf5f4('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xf5f4('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x28fc39){if(!_0x28fc39)this[_0xf5f4('0x15')]('mandatoryDispositionPauseId',null);this[_0xf5f4('0x15')](_0xf5f4('0x16'),_0x28fc39);}}}; \ No newline at end of file +var _0x9529=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports','name','STRING','generate','ENUM','skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT'];(function(_0x514738,_0x10a84b){var _0x5c95ed=function(_0x5aa223){while(--_0x5aa223){_0x514738['push'](_0x514738['shift']());}};_0x5c95ed(++_0x10a84b);}(_0x9529,0x1a7));var _0x9952=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9529[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x9952('0x0'));var rs=require(_0x9952('0x1'));module[_0x9952('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x9952('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9952('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x9952('0x4')],'defaultValue':function(){return rs[_0x9952('0x5')]();}},'phone':{'type':Sequelize[_0x9952('0x4')]},'type':{'type':Sequelize[_0x9952('0x6')]('twilio',_0x9952('0x7'),_0x9952('0x8'),_0x9952('0x9'),'plivo',_0x9952('0xa'),_0x9952('0xb'),_0x9952('0xc'),_0x9952('0xd'),_0x9952('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x9952('0x4')]},'authToken':{'type':Sequelize[_0x9952('0x4')]},'smsMethod':{'type':Sequelize[_0x9952('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9952('0x4')]},'password':{'type':Sequelize[_0x9952('0x4')]},'apiKey':{'type':Sequelize[_0x9952('0x4')]},'applicationId':{'type':Sequelize[_0x9952('0x4')]},'accountId':{'type':Sequelize[_0x9952('0x4')]},'senderString':{'type':Sequelize[_0x9952('0x4')]},'deliveryReport':{'type':Sequelize[_0x9952('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x9952('0x4')]},'notificationTemplate':{'type':Sequelize[_0x9952('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9952('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9952('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9952('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9952('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9952('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9952('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9952('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9952('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9952('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9952('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x9952('0xf')],'defaultValue':![],'comment':_0x9952('0x13'),'set':function(_0x4435a5){if(!_0x4435a5)this['setDataValue'](_0x9952('0x14'),null);this[_0x9952('0x15')]('mandatoryDisposition',_0x4435a5);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 4b805ca..dad281c 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 _0x6e9c=['fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','ListId','out','spread','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','Pause','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','SmsAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','Contacts','DESC','omit','contact','SmsInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x6e9c,0x11d));var _0xc6e9=function(_0x3b8664,_0x1e4a88){_0x3b8664=_0x3b8664-0x0;var _0x27d94c=_0x6e9c[_0x3b8664];return _0x27d94c;};'use strict';var emlformat=require(_0xc6e9('0x0'));var rimraf=require(_0xc6e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc6e9('0x2'));var moment=require(_0xc6e9('0x3'));var BPromise=require(_0xc6e9('0x4'));var Mustache=require(_0xc6e9('0x5'));var util=require(_0xc6e9('0x6'));var path=require('path');var sox=require(_0xc6e9('0x7'));var csv=require('to-csv');var ejs=require(_0xc6e9('0x8'));var fs=require('fs');var fs_extra=require(_0xc6e9('0x9'));var _=require(_0xc6e9('0xa'));var squel=require(_0xc6e9('0xb'));var crypto=require(_0xc6e9('0xc'));var jsforce=require(_0xc6e9('0xd'));var deskjs=require(_0xc6e9('0xe'));var toCsv=require(_0xc6e9('0xf'));var querystring=require('querystring');var Papa=require(_0xc6e9('0x10'));var Redis=require(_0xc6e9('0x11'));var authService=require(_0xc6e9('0x12'));var qs=require(_0xc6e9('0x13'));var as=require(_0xc6e9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc6e9('0x15'));var utils=require(_0xc6e9('0x16'));var config=require(_0xc6e9('0x17'));var licenseUtil=require(_0xc6e9('0x18'));var db=require('../../mysqldb')['db'];config[_0xc6e9('0x19')]=_[_0xc6e9('0x1a')](config[_0xc6e9('0x19')],{'host':_0xc6e9('0x1b'),'port':0x18eb});var socket=require(_0xc6e9('0x1c'))(new Redis(config[_0xc6e9('0x19')]));require(_0xc6e9('0x1d'))[_0xc6e9('0x1e')](socket);var jayson=require(_0xc6e9('0x1f'));var client=jayson[_0xc6e9('0x20')][_0xc6e9('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x443438,_0x3c87c0,_0x22b409,_0x5c5950){return new BPromise(function(_0x22b75f,_0x127bf1){var _0x2e4425=_0x5c5950||client;return _0x2e4425[_0xc6e9('0x22')](_0x443438,_0x22b409)[_0xc6e9('0x23')](function(_0x387743){logger[_0xc6e9('0x24')](_0xc6e9('0x25'),_0x3c87c0,_0xc6e9('0x26'));logger[_0xc6e9('0x27')](_0xc6e9('0x28'),_0x3c87c0,_0xc6e9('0x26'),JSON[_0xc6e9('0x29')](_0x387743));if(_0x387743[_0xc6e9('0x2a')]){if(_0x387743['error'][_0xc6e9('0x2b')]===0x1f4){logger[_0xc6e9('0x2a')](_0xc6e9('0x25'),_0x3c87c0,_0x387743[_0xc6e9('0x2a')]['message']);return _0x127bf1(_0x387743[_0xc6e9('0x2a')]['message']);}logger[_0xc6e9('0x2a')](_0xc6e9('0x25'),_0x3c87c0,_0x387743[_0xc6e9('0x2a')][_0xc6e9('0x2c')]);return _0x22b75f(_0x387743[_0xc6e9('0x2a')][_0xc6e9('0x2c')]);}else{logger['info'](_0xc6e9('0x25'),_0x3c87c0,_0xc6e9('0x26'));_0x22b75f(_0x387743[_0xc6e9('0x2d')]['message']);}})['catch'](function(_0x58b919){logger[_0xc6e9('0x2a')](_0xc6e9('0x25'),_0x3c87c0,_0x58b919);_0x127bf1(_0x58b919);});});}function respondWithStatusCode(_0x49275e,_0x1b83d8){_0x1b83d8=_0x1b83d8||0xcc;return function(_0x45b763){if(_0x45b763){return _0x49275e['sendStatus'](_0x1b83d8);}return _0x49275e[_0xc6e9('0x2e')](_0x1b83d8)[_0xc6e9('0x2f')]();};}function respondWithResult(_0x5e4875,_0x94c00){_0x94c00=_0x94c00||0xc8;return function(_0x540367){if(_0x540367){return _0x5e4875[_0xc6e9('0x2e')](_0x94c00)[_0xc6e9('0x30')](_0x540367);}};}function respondWithFilteredResult(_0x6cee06,_0x46793d){return function(_0x3e85d9){if(_0x3e85d9){var _0x2d5ba5=typeof _0x46793d[_0xc6e9('0x31')]===_0xc6e9('0x32')&&typeof _0x46793d[_0xc6e9('0x33')]===_0xc6e9('0x32');var _0x176d30=_0x3e85d9[_0xc6e9('0x34')];var _0x4c7ad0=_0x2d5ba5?0x0:_0x46793d[_0xc6e9('0x31')];var _0x3853ef=_0x2d5ba5?_0x3e85d9[_0xc6e9('0x34')]:_0x46793d[_0xc6e9('0x31')]+_0x46793d[_0xc6e9('0x33')];var _0x4e57dc;if(_0x3853ef>=_0x176d30){_0x3853ef=_0x176d30;_0x4e57dc=0xc8;}else{_0x4e57dc=0xce;}_0x6cee06[_0xc6e9('0x2e')](_0x4e57dc);return _0x6cee06[_0xc6e9('0x35')](_0xc6e9('0x36'),_0x4c7ad0+'-'+_0x3853ef+'/'+_0x176d30)[_0xc6e9('0x30')](_0x3e85d9);}return null;};}function patchUpdates(_0x4ad8fa){return function(_0x299ccd){try{jsonpatch[_0xc6e9('0x37')](_0x299ccd,_0x4ad8fa,!![]);}catch(_0x5126cc){return BPromise[_0xc6e9('0x38')](_0x5126cc);}return _0x299ccd[_0xc6e9('0x39')]();};}function saveUpdates(_0x484f23,_0x1607f5){return function(_0x3ff742){if(_0x3ff742){return _0x3ff742[_0xc6e9('0x3a')](_0x484f23)[_0xc6e9('0x23')](function(_0x598587){return _0x598587;});}return null;};}function removeEntity(_0x39af0f,_0xe49737){return function(_0x539a71){if(_0x539a71){return _0x539a71[_0xc6e9('0x3b')]()[_0xc6e9('0x23')](function(){var _0x5cfcd3=_0x539a71[_0xc6e9('0x3c')]({'plain':!![]});var _0x5a7655=_0xc6e9('0x3d');return db[_0xc6e9('0x3e')][_0xc6e9('0x3b')]({'where':{'type':_0x5a7655,'resourceId':_0x5cfcd3['id']}})['then'](function(){return _0x539a71;});})[_0xc6e9('0x23')](function(){_0x39af0f[_0xc6e9('0x2e')](0xcc)[_0xc6e9('0x2f')]();});}};}function handleEntityNotFound(_0x55bae5,_0x5d86c8){return function(_0x3ef60f){if(!_0x3ef60f){_0x55bae5[_0xc6e9('0x3f')](0x194);}return _0x3ef60f;};}function handleError(_0xed70f3,_0x5ee2d8){_0x5ee2d8=_0x5ee2d8||0x1f4;return function(_0x5c18de){logger[_0xc6e9('0x2a')](_0x5c18de[_0xc6e9('0x40')]);if(_0x5c18de['name']){delete _0x5c18de[_0xc6e9('0x41')];}_0xed70f3[_0xc6e9('0x2e')](_0x5ee2d8)[_0xc6e9('0x42')](_0x5c18de);};}exports[_0xc6e9('0x43')]=function(_0x39fd8c,_0x4f0d92){var _0x2afa50={'include':[{'model':db['Pause'],'as':_0xc6e9('0x44')}]},_0x26adb6={},_0x9733da={'count':0x0,'rows':[]};var _0x30decf=_[_0xc6e9('0x45')](db[_0xc6e9('0x46')]['rawAttributes'],function(_0x2b2c32){return{'name':_0x2b2c32[_0xc6e9('0x47')],'type':_0x2b2c32[_0xc6e9('0x48')]['key']};});_0x26adb6[_0xc6e9('0x49')]=_[_0xc6e9('0x45')](_0x30decf,_0xc6e9('0x41'));_0x26adb6[_0xc6e9('0x4a')]=_[_0xc6e9('0x4b')](_0x39fd8c[_0xc6e9('0x4a')]);_0x26adb6[_0xc6e9('0x4c')]=_['intersection'](_0x26adb6[_0xc6e9('0x49')],_0x26adb6[_0xc6e9('0x4a')]);_0x2afa50[_0xc6e9('0x4d')]=_[_0xc6e9('0x4e')](_0x26adb6['model'],qs['fields'](_0x39fd8c[_0xc6e9('0x4a')][_0xc6e9('0x4f')]));_0x2afa50[_0xc6e9('0x4d')]=_0x2afa50[_0xc6e9('0x4d')][_0xc6e9('0x50')]?_0x2afa50[_0xc6e9('0x4d')]:_0x26adb6[_0xc6e9('0x49')];if(!_0x39fd8c[_0xc6e9('0x4a')][_0xc6e9('0x51')]('nolimit')){_0x2afa50[_0xc6e9('0x33')]=qs['limit'](_0x39fd8c['query'][_0xc6e9('0x33')]);_0x2afa50[_0xc6e9('0x31')]=qs[_0xc6e9('0x31')](_0x39fd8c[_0xc6e9('0x4a')][_0xc6e9('0x31')]);}_0x2afa50[_0xc6e9('0x52')]=qs['sort'](_0x39fd8c['query'][_0xc6e9('0x53')]);_0x2afa50[_0xc6e9('0x54')]=qs[_0xc6e9('0x4c')](_[_0xc6e9('0x55')](_0x39fd8c[_0xc6e9('0x4a')],_0x26adb6[_0xc6e9('0x4c')]),_0x30decf);if(_0x39fd8c[_0xc6e9('0x4a')][_0xc6e9('0x56')]){_0x2afa50[_0xc6e9('0x54')]=_[_0xc6e9('0x57')](_0x2afa50['where'],{'$or':_[_0xc6e9('0x45')](_0x30decf,function(_0x85cae8){if(_0x85cae8[_0xc6e9('0x48')]!==_0xc6e9('0x58')){var _0x183706={};_0x183706[_0x85cae8[_0xc6e9('0x41')]]={'$like':'%'+_0x39fd8c[_0xc6e9('0x4a')]['filter']+'%'};return _0x183706;}})});}_0x2afa50=_['merge']({},_0x2afa50,_0x39fd8c[_0xc6e9('0x59')]);var _0x115e3e={'where':_0x2afa50[_0xc6e9('0x54')]};return db[_0xc6e9('0x46')][_0xc6e9('0x34')](_0x115e3e)[_0xc6e9('0x23')](function(_0x46e51d){_0x9733da[_0xc6e9('0x34')]=_0x46e51d;if(_0x39fd8c[_0xc6e9('0x4a')][_0xc6e9('0x5a')]){_0x2afa50[_0xc6e9('0x5b')]=[{'all':!![]}];}return db['SmsAccount'][_0xc6e9('0x5c')](_0x2afa50);})[_0xc6e9('0x23')](function(_0x5b33c5){_0x9733da[_0xc6e9('0x5d')]=_0x5b33c5;return _0x9733da;})[_0xc6e9('0x23')](respondWithFilteredResult(_0x4f0d92,_0x2afa50))[_0xc6e9('0x5e')](handleError(_0x4f0d92,null));};exports['show']=function(_0x3ac40d,_0x39b232){var _0x3d42a6={'raw':![],'where':{'id':_0x3ac40d[_0xc6e9('0x5f')]['id']},'include':[{'model':db[_0xc6e9('0x60')],'as':_0xc6e9('0x44')}]},_0x32ab7a={};_0x32ab7a[_0xc6e9('0x49')]=_[_0xc6e9('0x4b')](db[_0xc6e9('0x46')][_0xc6e9('0x61')]);_0x32ab7a['query']=_['keys'](_0x3ac40d[_0xc6e9('0x4a')]);_0x32ab7a[_0xc6e9('0x4c')]=_[_0xc6e9('0x4e')](_0x32ab7a['model'],_0x32ab7a[_0xc6e9('0x4a')]);_0x3d42a6['attributes']=_[_0xc6e9('0x4e')](_0x32ab7a['model'],qs[_0xc6e9('0x4f')](_0x3ac40d[_0xc6e9('0x4a')][_0xc6e9('0x4f')]));_0x3d42a6[_0xc6e9('0x4d')]=_0x3d42a6[_0xc6e9('0x4d')][_0xc6e9('0x50')]?_0x3d42a6['attributes']:_0x32ab7a[_0xc6e9('0x49')];if(_0x3ac40d[_0xc6e9('0x4a')][_0xc6e9('0x5a')]){_0x3d42a6['include']=[{'all':!![]}];}_0x3d42a6=_['merge']({},_0x3d42a6,_0x3ac40d[_0xc6e9('0x59')]);return db[_0xc6e9('0x46')][_0xc6e9('0x62')](_0x3d42a6)[_0xc6e9('0x23')](handleEntityNotFound(_0x39b232,null))[_0xc6e9('0x23')](respondWithResult(_0x39b232,null))['catch'](handleError(_0x39b232,null));};exports[_0xc6e9('0x63')]=function(_0x30fbf3,_0x3f4cd9){return db[_0xc6e9('0x46')]['create'](_0x30fbf3[_0xc6e9('0x64')],{})['then'](function(_0x1109b8){var _0x14dc2b=_0x30fbf3[_0xc6e9('0x65')]['get']({'plain':!![]});if(!_0x14dc2b)throw new Error(_0xc6e9('0x66'));if(_0x14dc2b['role']===_0xc6e9('0x65')){var _0x138cfa=_0x1109b8[_0xc6e9('0x3c')]({'plain':!![]});var _0x39300a=_0xc6e9('0x3d');return db[_0xc6e9('0x67')][_0xc6e9('0x62')]({'where':{'name':_0x39300a,'userProfileId':_0x14dc2b[_0xc6e9('0x68')]},'raw':!![]})[_0xc6e9('0x23')](function(_0x2817de){if(_0x2817de&&_0x2817de[_0xc6e9('0x69')]===0x0){return db[_0xc6e9('0x3e')][_0xc6e9('0x63')]({'name':_0x138cfa[_0xc6e9('0x41')],'resourceId':_0x138cfa['id'],'type':_0x2817de[_0xc6e9('0x41')],'sectionId':_0x2817de['id']},{})[_0xc6e9('0x23')](function(){return _0x1109b8;});}else{return _0x1109b8;}})[_0xc6e9('0x5e')](function(_0x7b5181){logger[_0xc6e9('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7b5181);throw _0x7b5181;});}return _0x1109b8;})[_0xc6e9('0x23')](respondWithResult(_0x3f4cd9,0xc9))[_0xc6e9('0x5e')](handleError(_0x3f4cd9,null));};exports[_0xc6e9('0x3a')]=function(_0x5be2ae,_0x143255){if(_0x5be2ae[_0xc6e9('0x64')]['id']){delete _0x5be2ae[_0xc6e9('0x64')]['id'];}return db['SmsAccount'][_0xc6e9('0x62')]({'where':{'id':_0x5be2ae[_0xc6e9('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0xc6e9('0x44')}]})['then'](handleEntityNotFound(_0x143255,null))[_0xc6e9('0x23')](saveUpdates(_0x5be2ae['body'],null))[_0xc6e9('0x23')](respondWithResult(_0x143255,null))[_0xc6e9('0x5e')](handleError(_0x143255,null));};exports[_0xc6e9('0x3b')]=function(_0xf5a7d4,_0x4fb7df){return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0xf5a7d4['params']['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0x4fb7df,null))[_0xc6e9('0x23')](removeEntity(_0x4fb7df,null))[_0xc6e9('0x5e')](handleError(_0x4fb7df,null));};exports[_0xc6e9('0x6a')]=function(_0x524db6,_0x11385f){return db[_0xc6e9('0x46')][_0xc6e9('0x6a')]()[_0xc6e9('0x23')](respondWithResult(_0x11385f,null))[_0xc6e9('0x5e')](handleError(_0x11385f,null));};exports['addDisposition']=function(_0x51dc2e,_0x4703f4,_0x274587){if(_0x51dc2e[_0xc6e9('0x64')]['id']){delete _0x51dc2e[_0xc6e9('0x64')]['id'];}return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0x51dc2e['params']['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0x4703f4,null))[_0xc6e9('0x23')](function(_0x2e4fcb){if(_0x2e4fcb){_0x51dc2e[_0xc6e9('0x64')][_0xc6e9('0x6b')]=_0x2e4fcb['id'];return db[_0xc6e9('0x6c')][_0xc6e9('0x63')](_0x51dc2e[_0xc6e9('0x64')]);}})[_0xc6e9('0x23')](respondWithResult(_0x4703f4,null))[_0xc6e9('0x5e')](handleError(_0x4703f4,null));};exports[_0xc6e9('0x6d')]=function(_0x54c738,_0x56f3d2,_0x321307){var _0x380b72={'raw':![],'where':{}};var _0x2c840a={};var _0x1ab208={'count':0x0,'rows':[]};return db[_0xc6e9('0x46')][_0xc6e9('0x6e')]({'where':{'id':_0x54c738[_0xc6e9('0x5f')]['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0x56f3d2,null))['then'](function(_0x193d9b){if(_0x193d9b){_0x2c840a[_0xc6e9('0x49')]=_[_0xc6e9('0x4b')](db[_0xc6e9('0x6c')][_0xc6e9('0x61')]);_0x2c840a[_0xc6e9('0x4a')]=_['keys'](_0x54c738[_0xc6e9('0x4a')]);_0x2c840a['filters']=_['intersection'](_0x2c840a[_0xc6e9('0x49')],_0x2c840a['query']);_0x380b72[_0xc6e9('0x4d')]=_[_0xc6e9('0x4e')](_0x2c840a[_0xc6e9('0x49')],qs[_0xc6e9('0x4f')](_0x54c738[_0xc6e9('0x4a')][_0xc6e9('0x4f')]));_0x380b72[_0xc6e9('0x4d')]=_0x380b72[_0xc6e9('0x4d')][_0xc6e9('0x50')]?_0x380b72[_0xc6e9('0x4d')]:_0x2c840a['model'];if(!_0x54c738['query']['hasOwnProperty'](_0xc6e9('0x6f'))){_0x380b72[_0xc6e9('0x33')]=qs[_0xc6e9('0x33')](_0x54c738['query']['limit']);_0x380b72['offset']=qs[_0xc6e9('0x31')](_0x54c738[_0xc6e9('0x4a')][_0xc6e9('0x31')]);}_0x380b72[_0xc6e9('0x52')]=qs['sort'](_0x54c738['query']['sort']);_0x380b72[_0xc6e9('0x54')]=qs[_0xc6e9('0x4c')](_[_0xc6e9('0x55')](_0x54c738[_0xc6e9('0x4a')],_0x2c840a['filters']));_0x380b72[_0xc6e9('0x54')]['SmsAccountId']=_0x193d9b['id'];if(_0x54c738[_0xc6e9('0x4a')][_0xc6e9('0x56')]){_0x380b72[_0xc6e9('0x54')]=_[_0xc6e9('0x57')](_0x380b72[_0xc6e9('0x54')],{'$or':_[_0xc6e9('0x45')](_0x380b72['attributes'],function(_0x28ed5d){var _0x2ca584={};_0x2ca584[_0x28ed5d]={'$like':'%'+_0x54c738[_0xc6e9('0x4a')]['filter']+'%'};return _0x2ca584;})});}_0x380b72=_[_0xc6e9('0x57')]({},_0x380b72,_0x54c738[_0xc6e9('0x59')]);return db[_0xc6e9('0x6c')][_0xc6e9('0x34')]({'where':_0x380b72['where']})['then'](function(_0xcc20a6){_0x1ab208[_0xc6e9('0x34')]=_0xcc20a6;if(_0x54c738['query'][_0xc6e9('0x5a')]){_0x380b72[_0xc6e9('0x5b')]=[{'all':!![]}];}return db[_0xc6e9('0x6c')][_0xc6e9('0x5c')](_0x380b72);})['then'](function(_0x48c5a5){_0x1ab208['rows']=_0x48c5a5;return _0x1ab208;});}})[_0xc6e9('0x23')](respondWithFilteredResult(_0x56f3d2,_0x380b72))[_0xc6e9('0x5e')](handleError(_0x56f3d2,null));};exports[_0xc6e9('0x70')]=function(_0x416c2c,_0x1171ae,_0x23363a){return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0x416c2c['params']['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0x1171ae,null))[_0xc6e9('0x23')](function(_0x461122){if(_0x461122){return _0x461122[_0xc6e9('0x70')](_0x416c2c[_0xc6e9('0x4a')]['ids']);}})[_0xc6e9('0x23')](respondWithStatusCode(_0x1171ae,null))[_0xc6e9('0x5e')](handleError(_0x1171ae,null));};exports['addAnswer']=function(_0x1fd321,_0x21f863,_0x3fb516){if(_0x1fd321[_0xc6e9('0x64')]['id']){delete _0x1fd321[_0xc6e9('0x64')]['id'];}return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0x1fd321[_0xc6e9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x21f863,null))[_0xc6e9('0x23')](function(_0x1f51f9){if(_0x1f51f9){_0x1fd321[_0xc6e9('0x64')][_0xc6e9('0x6b')]=_0x1f51f9['id'];return db['CannedAnswer']['create'](_0x1fd321[_0xc6e9('0x64')]);}})[_0xc6e9('0x23')](respondWithResult(_0x21f863,null))[_0xc6e9('0x5e')](handleError(_0x21f863,null));};exports[_0xc6e9('0x71')]=function(_0x38c4d8,_0x3b3591,_0x45ed07){var _0x26333d={'raw':![],'where':{}};var _0x493df9={};var _0x28ed62={'count':0x0,'rows':[]};return db[_0xc6e9('0x46')][_0xc6e9('0x6e')]({'where':{'id':_0x38c4d8[_0xc6e9('0x5f')]['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0x3b3591,null))[_0xc6e9('0x23')](function(_0x1b566f){if(_0x1b566f){_0x493df9[_0xc6e9('0x49')]=_[_0xc6e9('0x4b')](db['CannedAnswer'][_0xc6e9('0x61')]);_0x493df9['query']=_[_0xc6e9('0x4b')](_0x38c4d8[_0xc6e9('0x4a')]);_0x493df9[_0xc6e9('0x4c')]=_['intersection'](_0x493df9['model'],_0x493df9['query']);_0x26333d[_0xc6e9('0x4d')]=_[_0xc6e9('0x4e')](_0x493df9[_0xc6e9('0x49')],qs['fields'](_0x38c4d8[_0xc6e9('0x4a')][_0xc6e9('0x4f')]));_0x26333d['attributes']=_0x26333d[_0xc6e9('0x4d')][_0xc6e9('0x50')]?_0x26333d['attributes']:_0x493df9[_0xc6e9('0x49')];if(!_0x38c4d8['query']['hasOwnProperty'](_0xc6e9('0x6f'))){_0x26333d[_0xc6e9('0x33')]=qs[_0xc6e9('0x33')](_0x38c4d8[_0xc6e9('0x4a')][_0xc6e9('0x33')]);_0x26333d[_0xc6e9('0x31')]=qs[_0xc6e9('0x31')](_0x38c4d8['query'][_0xc6e9('0x31')]);}_0x26333d[_0xc6e9('0x52')]=qs[_0xc6e9('0x53')](_0x38c4d8[_0xc6e9('0x4a')]['sort']);_0x26333d[_0xc6e9('0x54')]=qs[_0xc6e9('0x4c')](_[_0xc6e9('0x55')](_0x38c4d8[_0xc6e9('0x4a')],_0x493df9[_0xc6e9('0x4c')]));_0x26333d[_0xc6e9('0x54')][_0xc6e9('0x6b')]=_0x1b566f['id'];if(_0x38c4d8[_0xc6e9('0x4a')][_0xc6e9('0x56')]){_0x26333d[_0xc6e9('0x54')]=_[_0xc6e9('0x57')](_0x26333d[_0xc6e9('0x54')],{'$or':_[_0xc6e9('0x45')](_0x26333d[_0xc6e9('0x4d')],function(_0x4b4862){var _0x3a74e9={};_0x3a74e9[_0x4b4862]={'$like':'%'+_0x38c4d8[_0xc6e9('0x4a')][_0xc6e9('0x56')]+'%'};return _0x3a74e9;})});}_0x26333d=_[_0xc6e9('0x57')]({},_0x26333d,_0x38c4d8[_0xc6e9('0x59')]);return db['CannedAnswer']['count']({'where':_0x26333d[_0xc6e9('0x54')]})[_0xc6e9('0x23')](function(_0x31cd09){_0x28ed62['count']=_0x31cd09;if(_0x38c4d8[_0xc6e9('0x4a')][_0xc6e9('0x5a')]){_0x26333d[_0xc6e9('0x5b')]=[{'all':!![]}];}return db[_0xc6e9('0x72')][_0xc6e9('0x5c')](_0x26333d);})[_0xc6e9('0x23')](function(_0x2b17c2){_0x28ed62['rows']=_0x2b17c2;return _0x28ed62;});}})[_0xc6e9('0x23')](respondWithFilteredResult(_0x3b3591,_0x26333d))[_0xc6e9('0x5e')](handleError(_0x3b3591,null));};exports[_0xc6e9('0x73')]=function(_0x917824,_0x386f5f,_0x10e3fb){return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0x917824[_0xc6e9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x386f5f,null))[_0xc6e9('0x23')](function(_0x5868d4){if(_0x5868d4){return _0x5868d4['removeAnswers'](_0x917824['query'][_0xc6e9('0x74')]);}})['then'](respondWithStatusCode(_0x386f5f,null))[_0xc6e9('0x5e')](handleError(_0x386f5f,null));};exports[_0xc6e9('0x75')]=function(_0x272392,_0x42a683,_0x318ef3){var _0x33487f={'channel':_0xc6e9('0x76')};var _0x138c85=[];var _0x38529f=[];var _0x2c23ec={};return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0x272392[_0xc6e9('0x5f')]['id']},'include':[{'model':db[_0xc6e9('0x77')],'as':_0xc6e9('0x78')}]})[_0xc6e9('0x23')](handleEntityNotFound(_0x42a683,null))[_0xc6e9('0x23')](function(_0x32d6b1){_0x33487f[_0xc6e9('0x79')]=_0x32d6b1;_0x33487f[_0xc6e9('0x7a')]=_[_0xc6e9('0x7b')](_0x32d6b1[_0xc6e9('0x78')],[_0xc6e9('0x7c')],[_0xc6e9('0x7d')]);if(_0x33487f[_0xc6e9('0x79')]['Applications']){delete _0x33487f['account'][_0xc6e9('0x78')];}return db['CmContact']['describe']();})[_0xc6e9('0x23')](function(_0x5b2fe1){if(!_0x5b2fe1){throw new db[(_0xc6e9('0x7e'))][(_0xc6e9('0x7f'))](_0xc6e9('0x80'));}_0x138c85=_[_0xc6e9('0x81')](_['keys'](_0x5b2fe1),[_0xc6e9('0x82'),_0xc6e9('0x83')]);_0x38529f=_[_0xc6e9('0x81')](_['keys'](_0x5b2fe1),[_0xc6e9('0x82'),_0xc6e9('0x83'),_0xc6e9('0x84'),'ListId']);_0x33487f[_0xc6e9('0x64')]={'mapKey':_0xc6e9('0x85')};if(_0x33487f[_0xc6e9('0x79')]['type']){switch(_0x33487f[_0xc6e9('0x79')][_0xc6e9('0x48')]){case _0xc6e9('0x86'):_0x33487f['body'][_0xc6e9('0x87')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x88')];_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x64')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x89')];_0x33487f['body'][_0xc6e9('0x8a')]=_0x272392['body'][_0xc6e9('0x8b')];break;case _0xc6e9('0x8c'):_0x33487f['body'][_0xc6e9('0x87')]='+'+_0x272392[_0xc6e9('0x64')][_0xc6e9('0x8d')];_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x64')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x8e')];break;case _0xc6e9('0x8f'):_0x33487f[_0xc6e9('0x64')]['from']=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x87')];_0x33487f['body'][_0xc6e9('0x64')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x2c')];break;case'clicksend':_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')]=_0x272392['body'][_0xc6e9('0x87')];_0x33487f['body'][_0xc6e9('0x64')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x64')];_0x33487f[_0xc6e9('0x64')]['messageId']=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x90')];break;case _0xc6e9('0x91'):_0x33487f[_0xc6e9('0x64')]['from']=_0x272392[_0xc6e9('0x64')]['From'];_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x64')]=_0x272392['body'][_0xc6e9('0x92')];_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x8a')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x93')];break;case _0xc6e9('0x94'):_0x33487f['body'][_0xc6e9('0x87')]='+'+_0x272392[_0xc6e9('0x64')][_0xc6e9('0x95')][0x0][_0xc6e9('0x87')];_0x33487f[_0xc6e9('0x64')]['body']=_0x272392['body'][_0xc6e9('0x95')][0x0][_0xc6e9('0x8e')];_0x33487f[_0xc6e9('0x64')]['messageId']=_0x272392['body'][_0xc6e9('0x95')][0x0]['messageId'];break;case _0xc6e9('0x96'):_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x97')];_0x33487f[_0xc6e9('0x64')]['body']=_0x272392[_0xc6e9('0x64')]['segmentedMessage']['message'];break;case _0xc6e9('0x98'):_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x99')];_0x33487f[_0xc6e9('0x64')]['body']=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x8e')];_0x33487f['body'][_0xc6e9('0x8a')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x9a')];break;case'bandwidth':_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x8a')]=_0x272392[_0xc6e9('0x64')][0x0]['message']['id'];_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')]=_0x272392[_0xc6e9('0x64')][0x0][_0xc6e9('0x2c')][_0xc6e9('0x87')];_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x64')]=_0x272392[_0xc6e9('0x64')][0x0][_0xc6e9('0x2c')][_0xc6e9('0x8e')];break;case _0xc6e9('0x9b'):_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')]=_0x272392['body'][_0xc6e9('0x87')];_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x64')]=_0x272392[_0xc6e9('0x64')][_0xc6e9('0x2c')];_0x33487f['body'][_0xc6e9('0x8a')]=_0x272392[_0xc6e9('0x64')]['refid'];break;}}if(_0x33487f[_0xc6e9('0x64')]['id']){delete _0x33487f[_0xc6e9('0x64')]['id'];}if(_['isNil'](_0x33487f[_0xc6e9('0x64')]['from'])){throw new db[(_0xc6e9('0x7e'))][(_0xc6e9('0x7f'))](_0xc6e9('0x9c'));}if(_[_0xc6e9('0x9d')](_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x64')])||_0x33487f['body'][_0xc6e9('0x64')]===''){throw new db[(_0xc6e9('0x7e'))]['ValidationError'](_0xc6e9('0x9e'));}if(_[_0xc6e9('0x9d')](_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x9f')])){throw new db[(_0xc6e9('0x7e'))][(_0xc6e9('0x7f'))](_0xc6e9('0xa0')+_0x38529f);}if(!_[_0xc6e9('0xa1')](_0x38529f,_0x33487f['body'][_0xc6e9('0x9f')])){throw new db[(_0xc6e9('0x7e'))][(_0xc6e9('0x7f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x38529f);}_0x2c23ec[_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x9f')]]=_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')];return db[_0xc6e9('0xa2')][_0xc6e9('0x62')]({'where':{'id':_0x33487f[_0xc6e9('0x79')]['ListId']},'include':[{'model':db[_0xc6e9('0xa3')],'as':_0xc6e9('0xa4'),'where':_0x2c23ec,'limit':0x1,'order':[[_0xc6e9('0x83'),_0xc6e9('0xa5')]]}]});})[_0xc6e9('0x23')](handleEntityNotFound(_0x42a683,null))[_0xc6e9('0x23')](function(_0x3f1595){if(_0x3f1595){_0x33487f['list']=_[_0xc6e9('0xa6')](_0x3f1595,[_0xc6e9('0xa4')]);if(_0x3f1595[_0xc6e9('0xa4')][_0xc6e9('0x50')]){return _0x3f1595[_0xc6e9('0xa4')][0x0];}var _0x61486b=_[_0xc6e9('0x1a')](_0x33487f['body'],{'firstName':_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')],'ListId':_0x3f1595['id']});_0x61486b[_0x33487f['body'][_0xc6e9('0x9f')]]=_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')];return db[_0xc6e9('0xa3')][_0xc6e9('0x63')](_0x61486b,{'fields':_0x138c85,'raw':!![]});}})['then'](handleEntityNotFound(_0x42a683,null))['then'](function(_0x41f874){if(_0x41f874){_0x33487f[_0xc6e9('0xa7')]=_0x41f874;var _0x24939a={'ContactId':_0x41f874['id'],'phone':_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')],'SmsAccountId':_0x272392[_0xc6e9('0x5f')]['id']};var _0x3ebf8a={'ContactId':_0x41f874['id'],'SmsAccountId':_0x272392[_0xc6e9('0x5f')]['id'],'closed':![]};return db[_0xc6e9('0xa8')][_0xc6e9('0x62')]({'where':_0x3ebf8a})[_0xc6e9('0x23')](function(_0x1166ad){if(_0x1166ad){return[_0x1166ad,![]];}return db['SmsInteraction'][_0xc6e9('0x63')](_0x24939a)[_0xc6e9('0x23')](function(_0x1b4337){return[_0x1b4337,!![]];});});}})['spread'](function(_0x4bdb50,_0xa67f0f){_0x33487f['interaction']=_0x4bdb50[_0xc6e9('0x3c')]({'plain':!![]});_0x33487f[_0xc6e9('0xa9')]['created']=![];if(_0xa67f0f){if(_0x33487f['account'][_0xc6e9('0xaa')]){_0x33487f[_0xc6e9('0x7a')][_0xc6e9('0xab')]({'id':0x0,'priority':_0x33487f[_0xc6e9('0x7a')][_0xc6e9('0x50')]+0x1,'app':_0xc6e9('0xac'),'appdata':_0xc6e9('0xad'),'interval':_0xc6e9('0xae')});}_0x33487f[_0xc6e9('0xa9')]['created']=!![];}return db[_0xc6e9('0xaf')][_0xc6e9('0x63')]({'phone':_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x87')],'messageId':_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x8a')],'body':_0x33487f[_0xc6e9('0x64')][_0xc6e9('0x64')],'SmsAccountId':_0x272392[_0xc6e9('0x5f')]['id'],'SmsInteractionId':_0x4bdb50['id'],'direction':'in','ContactId':_0x4bdb50[_0xc6e9('0xb0')],'AttachmentId':_0x33487f['body'][_0xc6e9('0xb1')]});})[_0xc6e9('0x23')](function(_0x431142){_0x33487f['message']=_0x431142;if(!_0x33487f[_0xc6e9('0xa9')][_0xc6e9('0xb2')])return;return db[_0xc6e9('0xb3')][_0xc6e9('0x62')]({'attributes':['id',_0xc6e9('0x41')],'where':{'id':_0x33487f[_0xc6e9('0xa9')][_0xc6e9('0xb2')]}});})['then'](function(_0x4475d5){if(_0x4475d5){_0x33487f[_0xc6e9('0x7a')][_0xc6e9('0xb4')]({'id':0x0,'priority':0x0,'app':_0xc6e9('0xb5'),'appdata':_0x4475d5[_0xc6e9('0x41')]+','+(_0x33487f[_0xc6e9('0x79')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x33487f[_0xc6e9('0xa9')][_0xc6e9('0xb6')])return;return db[_0xc6e9('0xb7')][_0xc6e9('0x62')]({'attributes':['id','name'],'where':{'id':_0x33487f[_0xc6e9('0xa9')][_0xc6e9('0xb6')]}});})[_0xc6e9('0x23')](function(_0x35a4c6){if(_0x35a4c6){_0x33487f[_0xc6e9('0x7a')][_0xc6e9('0xb4')]({'id':0x0,'priority':0x1,'app':_0xc6e9('0xb8'),'appdata':_0x35a4c6[_0xc6e9('0x41')]+','+(_0x33487f[_0xc6e9('0x79')][_0xc6e9('0xb9')]||0x12c),'interval':_0xc6e9('0xae')});}return respondWithRpcPromise(_0xc6e9('0xba'),_0xc6e9('0xbb'),_0x33487f);})['then'](function(_0x30563a){if(_0x30563a){var _0x790618=0xc8;var _0xbaf5b8=_0xc6e9('0xbc');logger[_0xc6e9('0x24')](_0xc6e9('0x28'),_0xbaf5b8,_0x790618,'entity\x20found');logger[_0xc6e9('0x27')](_0xc6e9('0xbd'),_0xbaf5b8,_0x790618,_0xc6e9('0xbe'),JSON[_0xc6e9('0x29')](_0x30563a));if(_0x33487f['account']['type']==='twilio'){return _0x42a683[_0xc6e9('0x2e')](_0x790618)[_0xc6e9('0x35')](_0xc6e9('0xbf'),'text/xml')['send'](_0xc6e9('0xc0'));}else{return _0x42a683[_0xc6e9('0x2e')](_0x790618)['json'](_0x30563a);}}})['catch'](handleError(_0x42a683,null));};exports[_0xc6e9('0xc1')]=function(_0x508c9,_0x50c78a){var _0x11afbf=_0x508c9['params']['id'];var _0x285fab=_0x508c9[_0xc6e9('0x64')];var _0x45f73f=0xc8;var _0x3bf6c5=null;return db[_0xc6e9('0xc2')]['transaction']({'isolationLevel':db[_0xc6e9('0xc2')][_0xc6e9('0xc3')][_0xc6e9('0xc4')][_0xc6e9('0xc5')]},function(_0x5b7feb){return db['SmsAccount'][_0xc6e9('0x6e')]({'where':{'id':_0x11afbf},'transaction':_0x5b7feb})[_0xc6e9('0x23')](function(_0x1aa7f6){if(_0x1aa7f6){return db['SmsApplication'][_0xc6e9('0x3b')]({'where':{'SmsAccountId':_0x11afbf},'transaction':_0x5b7feb})['then'](function(){var _0x133a3b=_[_0xc6e9('0x45')](_0x285fab,function(_0x2d9626){_0x2d9626[_0xc6e9('0x6b')]=_0x11afbf;return _0x2d9626;});return db['SmsApplication'][_0xc6e9('0xc6')](_0x133a3b,{'transaction':_0x5b7feb});});}else{_0x45f73f=0x194;_0x3bf6c5=[];}});})[_0xc6e9('0x23')](function(){if(_0x45f73f!==0x194){return db['SmsApplication'][_0xc6e9('0xc7')]({'where':{'SmsAccountId':_0x11afbf},'order':_0xc6e9('0x7c')})['then'](function(_0x19d441){_0x3bf6c5=_0x19d441;});}})[_0xc6e9('0x5e')](function(_0x8e2588){_0x45f73f=0x1f4;logger[_0xc6e9('0x2a')](_0x8e2588['stack']);if(_0x8e2588[_0xc6e9('0x41')]){delete _0x8e2588[_0xc6e9('0x41')];}_0x3bf6c5=_0x8e2588;})[_0xc6e9('0xc8')](function(){if(_0x3bf6c5===null){_0x50c78a[_0xc6e9('0x3f')](_0x45f73f);}else{if(_0x45f73f===0x1f4){_0x50c78a[_0xc6e9('0x2e')](_0x45f73f)[_0xc6e9('0x42')](_0x3bf6c5);}else{_0x50c78a[_0xc6e9('0x2e')](_0x45f73f)[_0xc6e9('0x30')](_0x3bf6c5);}}});};exports[_0xc6e9('0xc9')]=function(_0x4f1504,_0x4a5e4b,_0x37c739){var _0x94eba6={};var _0x51245a={};var _0x131f8b;var _0x3aa668;return db[_0xc6e9('0x46')][_0xc6e9('0x6e')]({'where':{'id':_0x4f1504['params']['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0x4a5e4b,null))[_0xc6e9('0x23')](function(_0x4d0729){if(_0x4d0729){_0x131f8b=_0x4d0729;_0x51245a[_0xc6e9('0x49')]=_[_0xc6e9('0x4b')](db[_0xc6e9('0x77')][_0xc6e9('0x61')]);_0x51245a['query']=_[_0xc6e9('0x4b')](_0x4f1504[_0xc6e9('0x4a')]);_0x51245a[_0xc6e9('0x4c')]=_[_0xc6e9('0x4e')](_0x51245a[_0xc6e9('0x49')],_0x51245a[_0xc6e9('0x4a')]);_0x94eba6['attributes']=_['intersection'](_0x51245a[_0xc6e9('0x49')],qs[_0xc6e9('0x4f')](_0x4f1504[_0xc6e9('0x4a')][_0xc6e9('0x4f')]));_0x94eba6[_0xc6e9('0x4d')]=_0x94eba6['attributes'][_0xc6e9('0x50')]?_0x94eba6[_0xc6e9('0x4d')]:_0x51245a[_0xc6e9('0x49')];_0x94eba6[_0xc6e9('0x52')]=qs[_0xc6e9('0x53')](_0x4f1504[_0xc6e9('0x4a')][_0xc6e9('0x53')]);_0x94eba6[_0xc6e9('0x54')]=qs['filters'](_[_0xc6e9('0x55')](_0x4f1504[_0xc6e9('0x4a')],_0x51245a[_0xc6e9('0x4c')]));if(_0x4f1504[_0xc6e9('0x4a')][_0xc6e9('0x56')]){_0x94eba6['where']=_[_0xc6e9('0x57')](_0x94eba6['where'],{'$or':_['map'](_0x94eba6[_0xc6e9('0x4d')],function(_0x283518){var _0x3fe9b7={};_0x3fe9b7[_0x283518]={'$like':'%'+_0x4f1504[_0xc6e9('0x4a')][_0xc6e9('0x56')]+'%'};return _0x3fe9b7;})});}_0x94eba6=_[_0xc6e9('0x57')]({},_0x94eba6,_0x4f1504[_0xc6e9('0x59')]);return _0x131f8b[_0xc6e9('0xc9')](_0x94eba6);}})['then'](function(_0x32632a){if(_0x32632a){_0x3aa668=_0x32632a['length'];if(!_0x4f1504[_0xc6e9('0x4a')][_0xc6e9('0x51')](_0xc6e9('0x6f'))){_0x94eba6[_0xc6e9('0x33')]=qs[_0xc6e9('0x33')](_0x4f1504['query'][_0xc6e9('0x33')]);_0x94eba6['offset']=qs['offset'](_0x4f1504['query'][_0xc6e9('0x31')]);}return _0x131f8b[_0xc6e9('0xc9')](_0x94eba6);}})['then'](function(_0x11da6f){if(_0x11da6f){return _0x11da6f?{'count':_0x3aa668,'rows':_0x11da6f}:null;}})[_0xc6e9('0x23')](respondWithResult(_0x4a5e4b,null))[_0xc6e9('0x5e')](handleError(_0x4a5e4b,null));};exports[_0xc6e9('0xca')]=function(_0x1931eb,_0x3425ff,_0x1b3912){var _0x5da22b={'raw':![],'where':{}};var _0x3cdf85={};var _0x2d3413={'count':0x0,'rows':[]};return db[_0xc6e9('0x46')][_0xc6e9('0x6e')]({'where':{'id':_0x1931eb['params']['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0x3425ff,null))[_0xc6e9('0x23')](function(_0x162bf3){if(_0x162bf3){_0x3cdf85[_0xc6e9('0x49')]=_[_0xc6e9('0x4b')](db[_0xc6e9('0xa8')][_0xc6e9('0x61')]);_0x3cdf85['query']=_['keys'](_0x1931eb[_0xc6e9('0x4a')]);_0x3cdf85[_0xc6e9('0x4c')]=_['intersection'](_0x3cdf85[_0xc6e9('0x49')],_0x3cdf85[_0xc6e9('0x4a')]);_0x5da22b[_0xc6e9('0x4d')]=_[_0xc6e9('0x4e')](_0x3cdf85[_0xc6e9('0x49')],qs[_0xc6e9('0x4f')](_0x1931eb[_0xc6e9('0x4a')][_0xc6e9('0x4f')]));_0x5da22b[_0xc6e9('0x4d')]=_0x5da22b[_0xc6e9('0x4d')][_0xc6e9('0x50')]?_0x5da22b['attributes']:_0x3cdf85[_0xc6e9('0x49')];if(!_0x1931eb['query']['hasOwnProperty']('nolimit')){_0x5da22b[_0xc6e9('0x33')]=qs[_0xc6e9('0x33')](_0x1931eb[_0xc6e9('0x4a')][_0xc6e9('0x33')]);_0x5da22b[_0xc6e9('0x31')]=qs['offset'](_0x1931eb[_0xc6e9('0x4a')][_0xc6e9('0x31')]);}_0x5da22b[_0xc6e9('0x52')]=qs['sort'](_0x1931eb['query'][_0xc6e9('0x53')]);_0x5da22b[_0xc6e9('0x54')]=qs['filters'](_['pick'](_0x1931eb['query'],_0x3cdf85['filters']));_0x5da22b[_0xc6e9('0x54')][_0xc6e9('0x6b')]=_0x162bf3['id'];if(_0x1931eb[_0xc6e9('0x4a')][_0xc6e9('0x56')]){_0x5da22b['where']=_[_0xc6e9('0x57')](_0x5da22b[_0xc6e9('0x54')],{'$or':_[_0xc6e9('0x45')](_0x5da22b[_0xc6e9('0x4d')],function(_0x1322a0){var _0x1230d6={};_0x1230d6[_0x1322a0]={'$like':'%'+_0x1931eb[_0xc6e9('0x4a')][_0xc6e9('0x56')]+'%'};return _0x1230d6;})});}_0x5da22b=_[_0xc6e9('0x57')]({},_0x5da22b,_0x1931eb[_0xc6e9('0x59')]);return db[_0xc6e9('0xa8')][_0xc6e9('0x34')]({'where':_0x5da22b[_0xc6e9('0x54')]})[_0xc6e9('0x23')](function(_0x1a76d4){_0x2d3413['count']=_0x1a76d4;if(_0x1931eb[_0xc6e9('0x4a')][_0xc6e9('0x5a')]){_0x5da22b[_0xc6e9('0x5b')]=[{'model':db[_0xc6e9('0xa3')],'as':_0xc6e9('0xcb'),'required':![]},{'model':db[_0xc6e9('0xb3')],'as':_0xc6e9('0xcc'),'attributes':[_0xc6e9('0x41'),_0xc6e9('0xcd'),_0xc6e9('0xce')],'required':![]},{'model':db[_0xc6e9('0xcf')],'as':_0xc6e9('0xd0'),'attributes':['id',_0xc6e9('0x41'),_0xc6e9('0xd1')],'where':_0x1931eb[_0xc6e9('0x4a')][_0xc6e9('0xd2')]?{'id':_0x1931eb[_0xc6e9('0x4a')][_0xc6e9('0xd2')]}:undefined,'required':_0x1931eb[_0xc6e9('0x4a')]['tag']?!![]:![]}];}return db[_0xc6e9('0xa8')][_0xc6e9('0x5c')](_0x5da22b);})[_0xc6e9('0x23')](function(_0x538f0b){_0x2d3413['rows']=_0x538f0b;return _0x2d3413;});}})[_0xc6e9('0x23')](respondWithFilteredResult(_0x3425ff,_0x5da22b))[_0xc6e9('0x5e')](handleError(_0x3425ff,null));};exports[_0xc6e9('0x42')]=function(_0x415576,_0x2729b2,_0x1b5ab4){var _0x285e68,_0x3e7dfa,_0x58434c;if(_[_0xc6e9('0x9d')](_0x415576[_0xc6e9('0x64')][_0xc6e9('0x64')])||_0x415576['body'][_0xc6e9('0x64')]===''){throw new db['Sequelize'][(_0xc6e9('0x7f'))](_0xc6e9('0x9e'));}if(_[_0xc6e9('0x9d')](_0x415576['body']['to'])){throw new db[(_0xc6e9('0x7e'))]['ValidationError'](_0xc6e9('0xd3'));}_0x285e68=_0x415576[_0xc6e9('0x64')]['to'];return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0x415576['params']['id']},'include':[{'model':db[_0xc6e9('0xa2')],'as':_0xc6e9('0xd4'),'include':[{'model':db[_0xc6e9('0xa3')],'as':_0xc6e9('0xa4'),'where':{'mobile':_0x285e68},'limit':0x1,'order':[[_0xc6e9('0x83'),'DESC']]}]}]})[_0xc6e9('0x23')](handleEntityNotFound(_0x2729b2,null))[_0xc6e9('0x23')](function(_0x3f7266){if(_0x3f7266&&_0x3f7266[_0xc6e9('0xd4')]){_0x3e7dfa=_0x3f7266['get']({'plain':!![]});if(_0x3e7dfa[_0xc6e9('0xd4')]&&_0x3e7dfa[_0xc6e9('0xd4')][_0xc6e9('0xa4')][_0xc6e9('0x50')]){return _0x3e7dfa['List']['Contacts'][0x0];}return db[_0xc6e9('0xa3')][_0xc6e9('0x63')](_['defaults'](_0x415576[_0xc6e9('0x64')],{'firstName':_0x285e68,'mobile':_0x285e68,'phone':_0x285e68,'ListId':_0x3e7dfa[_0xc6e9('0xd5')]}));}})[_0xc6e9('0x23')](handleEntityNotFound(_0x2729b2,null))[_0xc6e9('0x23')](function(_0x24b700){if(_0x24b700){_0x58434c=_0x24b700;return db[_0xc6e9('0xa8')][_0xc6e9('0x62')]({'where':{'ContactId':_0x58434c['id'],'closed':![],'SmsAccountId':_0x3e7dfa['id']}})[_0xc6e9('0x23')](function(_0x42bdc1){if(_0x42bdc1){return[_0x42bdc1,![]];}return db[_0xc6e9('0xa8')][_0xc6e9('0x63')]({'UserId':_0x415576[_0xc6e9('0x65')]['id'],'ContactId':_0x58434c['id'],'SmsAccountId':_0x3e7dfa['id'],'phone':_0x285e68,'firstMsgDirection':_0xc6e9('0xd6'),'Messages':[_[_0xc6e9('0x57')](_0x415576[_0xc6e9('0x64')],{'read':![],'body':_0x415576[_0xc6e9('0x64')][_0xc6e9('0x64')],'phone':_0x285e68,'SmsAccountId':_0x3e7dfa['id'],'UserId':_0x415576[_0xc6e9('0x65')]['id'],'ContactId':_0x58434c['id']})]},{'include':[{'model':db[_0xc6e9('0xaf')],'as':'Messages'}]})[_0xc6e9('0x23')](function(_0x1fc7f6){return[_0x1fc7f6,!![]];});});}})[_0xc6e9('0xd7')](function(_0x16ade7,_0x273f9c){if(_0x273f9c){return _0x16ade7;}return db[_0xc6e9('0xaf')][_0xc6e9('0x63')](_[_0xc6e9('0x57')](_0x415576[_0xc6e9('0x64')],{'read':![],'body':_0x415576[_0xc6e9('0x64')]['body'],'phone':_0x285e68,'SmsAccountId':_0x3e7dfa['id'],'SmsInteractionId':_0x16ade7['id'],'UserId':_0x415576[_0xc6e9('0x65')]['id'],'ContactId':_0x58434c['id']}))[_0xc6e9('0x23')](function(_0x4e5e79){_0x16ade7[_0xc6e9('0xd8')][_0xc6e9('0xd9')]=[];_0x16ade7[_0xc6e9('0xd8')][_0xc6e9('0xd9')][_0xc6e9('0xab')](_0x4e5e79[_0xc6e9('0xd8')]);return _0x16ade7;});})[_0xc6e9('0x23')](respondWithResult(_0x2729b2,null))['catch'](handleError(_0x2729b2,null));};exports[_0xc6e9('0x2e')]=function(_0x1dec1e,_0x1722be,_0x19729e){if(_0x1dec1e['body']['id']){delete _0x1dec1e[_0xc6e9('0x64')]['id'];}var _0x124b7e,_0x104413,_0x2f39d6;return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0x1dec1e[_0xc6e9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1722be,null))['then'](function(_0xf0ddf3){if(_0xf0ddf3){_0x2f39d6=_0xf0ddf3;logger[_0xc6e9('0x27')](_0xc6e9('0x28'),_0xc6e9('0x2e'),_0xc6e9('0xda'),_0xf0ddf3['type'],util[_0xc6e9('0xdb')](_0x1dec1e[_0xc6e9('0x64')],{'showHidden':![],'depth':null}));switch(_0xf0ddf3['type']){case _0xc6e9('0x8c'):if(_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0xdc')]&&_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0x2e')]){_0x104413=_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0x2e')];return db[_0xc6e9('0xaf')][_0xc6e9('0x62')]({'where':{'messageId':_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0xdc')]}});}break;case'connectel':if(_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0xdd')]&&_0x1dec1e['body'][_0xc6e9('0xde')]){_0x104413=_0x1dec1e[_0xc6e9('0x64')]['statusInt'];return db['SmsMessage'][_0xc6e9('0x62')]({'where':{'messageId':_0x1dec1e['body'][_0xc6e9('0xdd')]}});}break;case _0xc6e9('0xdf'):if(_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0x90')]&&_0x1dec1e['body']['status_code']){_0x104413=_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0xe0')];return db['SmsMessage']['find']({'where':{'messageId':_0x1dec1e[_0xc6e9('0x64')]['message_id']}});}break;case'infobip':var _0x9948f9=_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0x95')][0x0];if(_0x9948f9[_0xc6e9('0x8a')]&&_0x9948f9[_0xc6e9('0x2e')][_0xc6e9('0xe1')]===_0xc6e9('0xe2')){_0x104413=_0x9948f9[_0xc6e9('0x2e')][_0xc6e9('0xe1')];return db[_0xc6e9('0xaf')][_0xc6e9('0x62')]({'where':{'messageId':_0x9948f9[_0xc6e9('0x8a')]}});}break;case _0xc6e9('0x98'):if(_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0x8a')]&&_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0x2e')]){_0x104413=_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0x2e')];return db[_0xc6e9('0xaf')][_0xc6e9('0x62')]({'where':{'messageId':_0x1dec1e[_0xc6e9('0x64')]['messageId']}});}break;case'bandwidth':if(_0x1dec1e[_0xc6e9('0x64')][0x0][_0xc6e9('0x2c')]['id']){_0x104413=_0x1dec1e[_0xc6e9('0x64')][0x0][_0xc6e9('0x48')];return db[_0xc6e9('0xaf')][_0xc6e9('0x62')]({'where':{'messageId':_0x1dec1e[_0xc6e9('0x64')][0x0]['message']['id']}});}break;case _0xc6e9('0x9b'):if(_0x1dec1e['body'][_0xc6e9('0xe3')]&&_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0x2e')]){_0x104413=_0x1dec1e[_0xc6e9('0x64')]['status'];return db['SmsMessage'][_0xc6e9('0x62')]({'where':{'messageId':_0x1dec1e['body']['redif']}});}break;}}})[_0xc6e9('0x23')](handleEntityNotFound(_0x1722be,null))[_0xc6e9('0x23')](function(_0x29687d){if(_0x29687d){_0x124b7e=_0x29687d;switch(_0x2f39d6[_0xc6e9('0x48')]){case _0xc6e9('0x8c'):if(_0x104413==='DELIVERED'){return _0x124b7e[_0xc6e9('0x3a')]({'read':!![]});}else{logger[_0xc6e9('0x2a')](_0xc6e9('0x28'),_0xc6e9('0x2e'),_0xc6e9('0x8c'),util[_0xc6e9('0xdb')](_0x1dec1e[_0xc6e9('0x64')],{'showHidden':![],'depth':null}));}break;case _0xc6e9('0x8f'):if(_0x104413==='1'){return _0x124b7e['update']({'read':!![]});}else{logger[_0xc6e9('0x2a')](_0xc6e9('0x28'),_0xc6e9('0x2e'),_0xc6e9('0x8c'),util['inspect'](_0x1dec1e[_0xc6e9('0x64')],{'showHidden':![],'depth':null}));}break;case _0xc6e9('0xdf'):if(!_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0xe4')]&&_0x104413>=0xc8&&_0x104413<=0xce){return _0x124b7e[_0xc6e9('0x3a')]({'read':!![]});}else{logger[_0xc6e9('0x2a')](_0xc6e9('0x28'),_0xc6e9('0x2e'),_0xc6e9('0xdf'),util[_0xc6e9('0xdb')](_0x1dec1e[_0xc6e9('0x64')],{'showHidden':![],'depth':null}));}break;case _0xc6e9('0x94'):var _0x2394d1=_0x1dec1e[_0xc6e9('0x64')][_0xc6e9('0x95')][0x0];if(_0x2394d1[_0xc6e9('0x2e')][_0xc6e9('0xe1')]===_0xc6e9('0xe2')){return _0x124b7e[_0xc6e9('0x3a')]({'read':!![]});}else{logger[_0xc6e9('0x2a')](_0xc6e9('0x28'),_0xc6e9('0x2e'),'infobip',util[_0xc6e9('0xdb')](_0x1dec1e[_0xc6e9('0x64')],{'showHidden':![],'depth':null}));}break;case _0xc6e9('0x98'):if(_0x104413==_0xc6e9('0xe5')||_0x104413==_0xc6e9('0xe6')){return _0x124b7e[_0xc6e9('0x3a')]({'read':!![]});}else{logger[_0xc6e9('0x2a')](_0xc6e9('0x28'),_0xc6e9('0x2e'),_0xc6e9('0x98'),util[_0xc6e9('0xdb')](_0x1dec1e[_0xc6e9('0x64')],{'showHidden':![],'depth':null}));}break;case _0xc6e9('0xe7'):if(_0x104413==_0xc6e9('0xe8')){return _0x124b7e[_0xc6e9('0x3a')]({'read':!![]});}else{logger['error'](_0xc6e9('0x28'),'status','bandwidth',util['inspect'](_0x1dec1e[_0xc6e9('0x64')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x104413===_0xc6e9('0xe9')||_0x104413===_0xc6e9('0xea')){return _0x124b7e[_0xc6e9('0x3a')]({'read':!![]});}else{logger[_0xc6e9('0x2a')](_0xc6e9('0x28'),_0xc6e9('0x2e'),_0xc6e9('0x9b'),util['inspect'](_0x1dec1e[_0xc6e9('0x64')],{'showHidden':![],'depth':null}));}break;}return _0x124b7e;}})['then'](respondWithResult(_0x1722be,null))['catch'](handleError(_0x1722be,null));};exports[_0xc6e9('0xeb')]=function(_0x175d33,_0x4b1003,_0x5a6d30){var _0x31dd10,_0x48f43d,_0x3a49b4;return db['SmsAccount'][_0xc6e9('0x62')]({'where':{'id':_0x175d33[_0xc6e9('0x5f')]['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0x4b1003,null))[_0xc6e9('0x23')](function(_0x2b8bf7){if(_0x2b8bf7){_0x3a49b4=_0x2b8bf7;logger[_0xc6e9('0x27')](_0xc6e9('0x28'),_0xc6e9('0x2e'),_0xc6e9('0xda'),_0x2b8bf7[_0xc6e9('0x48')],util[_0xc6e9('0xdb')](_0x175d33['query'],{'showHidden':![],'depth':null}));switch(_0x2b8bf7['type']){case _0xc6e9('0x96'):if(_0x175d33[_0xc6e9('0x4a')][_0xc6e9('0xec')]&&_0x175d33[_0xc6e9('0x4a')][_0xc6e9('0xed')]){_0x48f43d=_0x175d33['query'][_0xc6e9('0xed')];return db[_0xc6e9('0xaf')][_0xc6e9('0x62')]({'where':{'messageId':_0x175d33[_0xc6e9('0x4a')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x4b1003,null))[_0xc6e9('0x23')](function(_0x27bc43){if(_0x27bc43){_0x31dd10=_0x27bc43;switch(_0x3a49b4[_0xc6e9('0x48')]){case'csc':if(_0x48f43d==='2'||_0x48f43d==='6'){return _0x31dd10['update']({'read':!![]});}else{logger['error'](_0xc6e9('0x28'),_0xc6e9('0x2e'),_0xc6e9('0x96'),util[_0xc6e9('0xdb')](_0x175d33[_0xc6e9('0x4a')],{'showHidden':![],'depth':null}));};break;}return _0x31dd10;}})['then'](respondWithResult(_0x4b1003,null))[_0xc6e9('0x5e')](handleError(_0x4b1003,null));};exports[_0xc6e9('0xee')]=function(_0x37211f,_0xac8e70,_0x15b833){return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0x37211f[_0xc6e9('0x5f')]['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0xac8e70,null))[_0xc6e9('0x23')](function(_0x76e4a0){if(_0x76e4a0){return _0x76e4a0[_0xc6e9('0xee')](_0x37211f[_0xc6e9('0x64')][_0xc6e9('0x74')],_[_0xc6e9('0xa6')](_0x37211f[_0xc6e9('0x64')],[_0xc6e9('0x74'),'id'])||{})['spread'](function(_0x31bfdd){for(var _0x1fa172=0x0;_0x1fa172<_0x37211f[_0xc6e9('0x64')][_0xc6e9('0x74')][_0xc6e9('0x50')];_0x1fa172+=0x1){socket[_0xc6e9('0xef')](_0xc6e9('0xf0'),{'UserId':Number(_0x37211f[_0xc6e9('0x64')][_0xc6e9('0x74')][_0x1fa172]),'SmsAccountId':Number(_0x37211f[_0xc6e9('0x5f')]['id'])});}return _0x31bfdd;});}})['then'](respondWithResult(_0xac8e70,null))['catch'](handleError(_0xac8e70,null));};exports[_0xc6e9('0xf1')]=function(_0x238884,_0x5287bb,_0x10189b){return db[_0xc6e9('0x46')][_0xc6e9('0x62')]({'where':{'id':_0x238884['params']['id']}})['then'](handleEntityNotFound(_0x5287bb,null))['then'](function(_0x2fece9){if(_0x2fece9){return _0x2fece9['removeAgents'](_0x238884[_0xc6e9('0x4a')][_0xc6e9('0x74')])[_0xc6e9('0x23')](function(){if(_[_0xc6e9('0xf2')](_0x238884[_0xc6e9('0x4a')][_0xc6e9('0x74')])){for(var _0x5c2454=0x0;_0x5c2454<_0x238884[_0xc6e9('0x4a')]['ids']['length'];_0x5c2454+=0x1){socket[_0xc6e9('0xef')](_0xc6e9('0xf3'),{'UserId':Number(_0x238884[_0xc6e9('0x4a')][_0xc6e9('0x74')][_0x5c2454]),'SmsAccountId':Number(_0x238884[_0xc6e9('0x5f')]['id'])});}}else{socket[_0xc6e9('0xef')](_0xc6e9('0xf3'),{'UserId':Number(_0x238884[_0xc6e9('0x4a')][_0xc6e9('0x74')]),'SmsAccountId':Number(_0x238884[_0xc6e9('0x5f')]['id'])});}});}})[_0xc6e9('0x23')](respondWithStatusCode(_0x5287bb,null))[_0xc6e9('0x5e')](handleError(_0x5287bb,null));};exports['getAgents']=function(_0x5beabf,_0x112a7d,_0x433586){var _0x54937a={};var _0x5d9a1c={};var _0x38b9b2;var _0x461335;return db[_0xc6e9('0x46')][_0xc6e9('0x6e')]({'where':{'id':_0x5beabf[_0xc6e9('0x5f')]['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0x112a7d,null))['then'](function(_0x131455){if(_0x131455){_0x38b9b2=_0x131455;_0x5d9a1c[_0xc6e9('0x49')]=_[_0xc6e9('0x4b')](db[_0xc6e9('0xb3')][_0xc6e9('0x61')]);_0x5d9a1c[_0xc6e9('0x4a')]=_[_0xc6e9('0x4b')](_0x5beabf['query']);_0x5d9a1c[_0xc6e9('0x4c')]=_[_0xc6e9('0x4e')](_0x5d9a1c['model'],_0x5d9a1c[_0xc6e9('0x4a')]);_0x54937a[_0xc6e9('0x4d')]=_['intersection'](_0x5d9a1c[_0xc6e9('0x49')],qs[_0xc6e9('0x4f')](_0x5beabf[_0xc6e9('0x4a')][_0xc6e9('0x4f')]));_0x54937a[_0xc6e9('0x4d')]=_0x54937a[_0xc6e9('0x4d')][_0xc6e9('0x50')]?_0x54937a['attributes']:_0x5d9a1c['model'];_0x54937a[_0xc6e9('0x52')]=qs['sort'](_0x5beabf[_0xc6e9('0x4a')][_0xc6e9('0x53')]);_0x54937a['where']=qs[_0xc6e9('0x4c')](_[_0xc6e9('0x55')](_0x5beabf[_0xc6e9('0x4a')],_0x5d9a1c[_0xc6e9('0x4c')]));if(_0x5beabf[_0xc6e9('0x4a')][_0xc6e9('0x56')]){_0x54937a['where']=_['merge'](_0x54937a[_0xc6e9('0x54')],{'$or':_[_0xc6e9('0x45')](_0x54937a[_0xc6e9('0x4d')],function(_0x32541a){var _0x3b63db={};_0x3b63db[_0x32541a]={'$like':'%'+_0x5beabf[_0xc6e9('0x4a')][_0xc6e9('0x56')]+'%'};return _0x3b63db;})});}_0x54937a=_[_0xc6e9('0x57')]({},_0x54937a,_0x5beabf[_0xc6e9('0x59')]);return _0x38b9b2[_0xc6e9('0xf4')](_0x54937a);}})['then'](function(_0x415595){if(_0x415595){_0x461335=_0x415595[_0xc6e9('0x50')];if(!_0x5beabf[_0xc6e9('0x4a')]['hasOwnProperty']('nolimit')){_0x54937a[_0xc6e9('0x33')]=qs[_0xc6e9('0x33')](_0x5beabf[_0xc6e9('0x4a')][_0xc6e9('0x33')]);_0x54937a[_0xc6e9('0x31')]=qs[_0xc6e9('0x31')](_0x5beabf[_0xc6e9('0x4a')][_0xc6e9('0x31')]);}return _0x38b9b2['getAgents'](_0x54937a);}})[_0xc6e9('0x23')](function(_0x17e00d){if(_0x17e00d){return _0x17e00d?{'count':_0x461335,'rows':_0x17e00d}:null;}})[_0xc6e9('0x23')](respondWithResult(_0x112a7d,null))[_0xc6e9('0x5e')](handleError(_0x112a7d,null));}; \ No newline at end of file +var _0x9a4a=['clickatell','fromNumber','text','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','ListId','DESC','list','omit','Contacts','defaults','contact','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','queueId','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','debug','stringify','set','Content-Type','text/xml','\x0a','json','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','findAndCountAll','finally','getApplications','SmsInteraction','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','Messages','spread','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','bandwidth','redif','connectel','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','received\x20delivery\x20report\x20from','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','offset','undefined','count','Content-Range','apply','reject','save','get','SmsAccounts','destroy','stack','name','send','Pause','SmsAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','type','VIRTUAL','merge','options','include','rows','show','params','mandatoryDispositionPause','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','sort','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','Applications','account','applications','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','twilio','From','messageId','skebby','sender','from','clicksend','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage'];(function(_0x310a59,_0x22933b){var _0x5dfab5=function(_0x1caf1d){while(--_0x1caf1d){_0x310a59['push'](_0x310a59['shift']());}};_0x5dfab5(++_0x22933b);}(_0x9a4a,0x13d));var _0xa9a4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9a4a[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa9a4('0x0'));var jsonpatch=require(_0xa9a4('0x1'));var rp=require(_0xa9a4('0x2'));var moment=require(_0xa9a4('0x3'));var BPromise=require(_0xa9a4('0x4'));var Mustache=require(_0xa9a4('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa9a4('0x6'));var csv=require(_0xa9a4('0x7'));var ejs=require(_0xa9a4('0x8'));var fs=require('fs');var fs_extra=require(_0xa9a4('0x9'));var _=require(_0xa9a4('0xa'));var squel=require(_0xa9a4('0xb'));var crypto=require('crypto');var jsforce=require(_0xa9a4('0xc'));var deskjs=require(_0xa9a4('0xd'));var toCsv=require(_0xa9a4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa9a4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9a4('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa9a4('0x10'))['db'];config[_0xa9a4('0x11')]=_['defaults'](config[_0xa9a4('0x11')],{'host':_0xa9a4('0x12'),'port':0x18eb});var socket=require(_0xa9a4('0x13'))(new Redis(config['redis']));require(_0xa9a4('0x14'))[_0xa9a4('0x15')](socket);var jayson=require(_0xa9a4('0x16'));var client=jayson[_0xa9a4('0x17')]['http']({'port':0x232c});function respondWithRpcPromise(_0x797827,_0x4e8911,_0x421e61,_0x341309){return new BPromise(function(_0x5b9317,_0x1f4053){var _0x4e02f5=_0x341309||client;return _0x4e02f5[_0xa9a4('0x18')](_0x797827,_0x421e61)[_0xa9a4('0x19')](function(_0x253649){logger[_0xa9a4('0x1a')](_0xa9a4('0x1b'),_0x4e8911,_0xa9a4('0x1c'));logger['debug'](_0xa9a4('0x1d'),_0x4e8911,'request\x20sent',JSON['stringify'](_0x253649));if(_0x253649[_0xa9a4('0x1e')]){if(_0x253649[_0xa9a4('0x1e')]['code']===0x1f4){logger[_0xa9a4('0x1e')]('SmsAccount,\x20%s,\x20%s',_0x4e8911,_0x253649['error']['message']);return _0x1f4053(_0x253649[_0xa9a4('0x1e')]['message']);}logger['error'](_0xa9a4('0x1b'),_0x4e8911,_0x253649[_0xa9a4('0x1e')][_0xa9a4('0x1f')]);return _0x5b9317(_0x253649['error'][_0xa9a4('0x1f')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x4e8911,_0xa9a4('0x1c'));_0x5b9317(_0x253649[_0xa9a4('0x20')][_0xa9a4('0x1f')]);}})[_0xa9a4('0x21')](function(_0x1d8491){logger['error'](_0xa9a4('0x1b'),_0x4e8911,_0x1d8491);_0x1f4053(_0x1d8491);});});}function respondWithStatusCode(_0x3690b7,_0x1ea762){_0x1ea762=_0x1ea762||0xcc;return function(_0x259ee3){if(_0x259ee3){return _0x3690b7[_0xa9a4('0x22')](_0x1ea762);}return _0x3690b7[_0xa9a4('0x23')](_0x1ea762)[_0xa9a4('0x24')]();};}function respondWithResult(_0x12c671,_0x19c2d1){_0x19c2d1=_0x19c2d1||0xc8;return function(_0x534472){if(_0x534472){return _0x12c671[_0xa9a4('0x23')](_0x19c2d1)['json'](_0x534472);}};}function respondWithFilteredResult(_0xe78529,_0x52fe78){return function(_0x490d0b){if(_0x490d0b){var _0x8a660c=typeof _0x52fe78[_0xa9a4('0x25')]===_0xa9a4('0x26')&&typeof _0x52fe78['limit']===_0xa9a4('0x26');var _0x7615f6=_0x490d0b[_0xa9a4('0x27')];var _0x3e7ec2=_0x8a660c?0x0:_0x52fe78[_0xa9a4('0x25')];var _0x1f4800=_0x8a660c?_0x490d0b[_0xa9a4('0x27')]:_0x52fe78[_0xa9a4('0x25')]+_0x52fe78['limit'];var _0x1c68e8;if(_0x1f4800>=_0x7615f6){_0x1f4800=_0x7615f6;_0x1c68e8=0xc8;}else{_0x1c68e8=0xce;}_0xe78529[_0xa9a4('0x23')](_0x1c68e8);return _0xe78529['set'](_0xa9a4('0x28'),_0x3e7ec2+'-'+_0x1f4800+'/'+_0x7615f6)['json'](_0x490d0b);}return null;};}function patchUpdates(_0x3859a7){return function(_0xf93611){try{jsonpatch[_0xa9a4('0x29')](_0xf93611,_0x3859a7,!![]);}catch(_0x352a6a){return BPromise[_0xa9a4('0x2a')](_0x352a6a);}return _0xf93611[_0xa9a4('0x2b')]();};}function saveUpdates(_0x359e2c,_0x2c8cb3){return function(_0x4b949c){if(_0x4b949c){return _0x4b949c['update'](_0x359e2c)['then'](function(_0x400eef){return _0x400eef;});}return null;};}function removeEntity(_0x343a86,_0x53be51){return function(_0x55397f){if(_0x55397f){return _0x55397f['destroy']()['then'](function(){var _0x3ae9b6=_0x55397f[_0xa9a4('0x2c')]({'plain':!![]});var _0xfc9525=_0xa9a4('0x2d');return db['UserProfileResource'][_0xa9a4('0x2e')]({'where':{'type':_0xfc9525,'resourceId':_0x3ae9b6['id']}})[_0xa9a4('0x19')](function(){return _0x55397f;});})[_0xa9a4('0x19')](function(){_0x343a86[_0xa9a4('0x23')](0xcc)[_0xa9a4('0x24')]();});}};}function handleEntityNotFound(_0x3b5f55,_0x5c0571){return function(_0x55edba){if(!_0x55edba){_0x3b5f55[_0xa9a4('0x22')](0x194);}return _0x55edba;};}function handleError(_0x3cb37b,_0x558bc1){_0x558bc1=_0x558bc1||0x1f4;return function(_0x5d3830){logger[_0xa9a4('0x1e')](_0x5d3830[_0xa9a4('0x2f')]);if(_0x5d3830['name']){delete _0x5d3830[_0xa9a4('0x30')];}_0x3cb37b['status'](_0x558bc1)[_0xa9a4('0x31')](_0x5d3830);};}exports['index']=function(_0x11abdd,_0x53d6dd){var _0x45c0c5={'include':[{'model':db[_0xa9a4('0x32')],'as':'mandatoryDispositionPause'}]},_0x41ed49={},_0x28d1d2={'count':0x0,'rows':[]};var _0x1d37b4=_['map'](db[_0xa9a4('0x33')][_0xa9a4('0x34')],function(_0x19e458){return{'name':_0x19e458[_0xa9a4('0x35')],'type':_0x19e458['type'][_0xa9a4('0x36')]};});_0x41ed49[_0xa9a4('0x37')]=_[_0xa9a4('0x38')](_0x1d37b4,_0xa9a4('0x30'));_0x41ed49[_0xa9a4('0x39')]=_[_0xa9a4('0x3a')](_0x11abdd[_0xa9a4('0x39')]);_0x41ed49[_0xa9a4('0x3b')]=_[_0xa9a4('0x3c')](_0x41ed49['model'],_0x41ed49[_0xa9a4('0x39')]);_0x45c0c5['attributes']=_[_0xa9a4('0x3c')](_0x41ed49[_0xa9a4('0x37')],qs[_0xa9a4('0x3d')](_0x11abdd[_0xa9a4('0x39')]['fields']));_0x45c0c5[_0xa9a4('0x3e')]=_0x45c0c5['attributes'][_0xa9a4('0x3f')]?_0x45c0c5[_0xa9a4('0x3e')]:_0x41ed49['model'];if(!_0x11abdd[_0xa9a4('0x39')][_0xa9a4('0x40')](_0xa9a4('0x41'))){_0x45c0c5['limit']=qs[_0xa9a4('0x42')](_0x11abdd[_0xa9a4('0x39')][_0xa9a4('0x42')]);_0x45c0c5[_0xa9a4('0x25')]=qs[_0xa9a4('0x25')](_0x11abdd['query'][_0xa9a4('0x25')]);}_0x45c0c5[_0xa9a4('0x43')]=qs['sort'](_0x11abdd[_0xa9a4('0x39')]['sort']);_0x45c0c5[_0xa9a4('0x44')]=qs[_0xa9a4('0x3b')](_[_0xa9a4('0x45')](_0x11abdd['query'],_0x41ed49[_0xa9a4('0x3b')]),_0x1d37b4);if(_0x11abdd['query'][_0xa9a4('0x46')]){_0x45c0c5[_0xa9a4('0x44')]=_['merge'](_0x45c0c5[_0xa9a4('0x44')],{'$or':_[_0xa9a4('0x38')](_0x1d37b4,function(_0xc8c2f4){if(_0xc8c2f4[_0xa9a4('0x47')]!==_0xa9a4('0x48')){var _0x13e180={};_0x13e180[_0xc8c2f4['name']]={'$like':'%'+_0x11abdd['query'][_0xa9a4('0x46')]+'%'};return _0x13e180;}})});}_0x45c0c5=_[_0xa9a4('0x49')]({},_0x45c0c5,_0x11abdd[_0xa9a4('0x4a')]);var _0x4ee0f7={'where':_0x45c0c5[_0xa9a4('0x44')]};return db[_0xa9a4('0x33')][_0xa9a4('0x27')](_0x4ee0f7)[_0xa9a4('0x19')](function(_0x1f6402){_0x28d1d2[_0xa9a4('0x27')]=_0x1f6402;if(_0x11abdd['query']['includeAll']){_0x45c0c5[_0xa9a4('0x4b')]=[{'all':!![]}];}return db[_0xa9a4('0x33')]['findAll'](_0x45c0c5);})[_0xa9a4('0x19')](function(_0x2bfb74){_0x28d1d2[_0xa9a4('0x4c')]=_0x2bfb74;return _0x28d1d2;})[_0xa9a4('0x19')](respondWithFilteredResult(_0x53d6dd,_0x45c0c5))[_0xa9a4('0x21')](handleError(_0x53d6dd,null));};exports[_0xa9a4('0x4d')]=function(_0x370729,_0xe3b51c){var _0x589fa6={'raw':![],'where':{'id':_0x370729[_0xa9a4('0x4e')]['id']},'include':[{'model':db[_0xa9a4('0x32')],'as':_0xa9a4('0x4f')}]},_0x2c01f8={};_0x2c01f8[_0xa9a4('0x37')]=_[_0xa9a4('0x3a')](db[_0xa9a4('0x33')][_0xa9a4('0x34')]);_0x2c01f8[_0xa9a4('0x39')]=_[_0xa9a4('0x3a')](_0x370729[_0xa9a4('0x39')]);_0x2c01f8[_0xa9a4('0x3b')]=_[_0xa9a4('0x3c')](_0x2c01f8[_0xa9a4('0x37')],_0x2c01f8[_0xa9a4('0x39')]);_0x589fa6[_0xa9a4('0x3e')]=_[_0xa9a4('0x3c')](_0x2c01f8[_0xa9a4('0x37')],qs[_0xa9a4('0x3d')](_0x370729[_0xa9a4('0x39')][_0xa9a4('0x3d')]));_0x589fa6[_0xa9a4('0x3e')]=_0x589fa6[_0xa9a4('0x3e')][_0xa9a4('0x3f')]?_0x589fa6['attributes']:_0x2c01f8[_0xa9a4('0x37')];if(_0x370729[_0xa9a4('0x39')][_0xa9a4('0x50')]){_0x589fa6[_0xa9a4('0x4b')]=[{'all':!![]}];}_0x589fa6=_[_0xa9a4('0x49')]({},_0x589fa6,_0x370729['options']);return db[_0xa9a4('0x33')][_0xa9a4('0x51')](_0x589fa6)[_0xa9a4('0x19')](handleEntityNotFound(_0xe3b51c,null))[_0xa9a4('0x19')](respondWithResult(_0xe3b51c,null))['catch'](handleError(_0xe3b51c,null));};exports[_0xa9a4('0x52')]=function(_0x15dccd,_0x22ca8b){return db[_0xa9a4('0x33')][_0xa9a4('0x52')](_0x15dccd[_0xa9a4('0x53')],{})['then'](function(_0x413d61){var _0x30285b=_0x15dccd['user']['get']({'plain':!![]});if(!_0x30285b)throw new Error(_0xa9a4('0x54'));if(_0x30285b['role']===_0xa9a4('0x55')){var _0x390c28=_0x413d61[_0xa9a4('0x2c')]({'plain':!![]});var _0x35a066=_0xa9a4('0x2d');return db[_0xa9a4('0x56')]['find']({'where':{'name':_0x35a066,'userProfileId':_0x30285b[_0xa9a4('0x57')]},'raw':!![]})['then'](function(_0x7fe969){if(_0x7fe969&&_0x7fe969[_0xa9a4('0x58')]===0x0){return db[_0xa9a4('0x59')][_0xa9a4('0x52')]({'name':_0x390c28[_0xa9a4('0x30')],'resourceId':_0x390c28['id'],'type':_0x7fe969['name'],'sectionId':_0x7fe969['id']},{})[_0xa9a4('0x19')](function(){return _0x413d61;});}else{return _0x413d61;}})[_0xa9a4('0x21')](function(_0x113442){logger['error'](_0xa9a4('0x5a'),_0x113442);throw _0x113442;});}return _0x413d61;})[_0xa9a4('0x19')](respondWithResult(_0x22ca8b,0xc9))[_0xa9a4('0x21')](handleError(_0x22ca8b,null));};exports[_0xa9a4('0x5b')]=function(_0x58aed1,_0x1c0a4f){if(_0x58aed1[_0xa9a4('0x53')]['id']){delete _0x58aed1[_0xa9a4('0x53')]['id'];}return db['SmsAccount'][_0xa9a4('0x51')]({'where':{'id':_0x58aed1[_0xa9a4('0x4e')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x1c0a4f,null))[_0xa9a4('0x19')](saveUpdates(_0x58aed1[_0xa9a4('0x53')],null))[_0xa9a4('0x19')](respondWithResult(_0x1c0a4f,null))['catch'](handleError(_0x1c0a4f,null));};exports[_0xa9a4('0x2e')]=function(_0x401711,_0xbf9ba6){return db[_0xa9a4('0x33')][_0xa9a4('0x51')]({'where':{'id':_0x401711['params']['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0xbf9ba6,null))[_0xa9a4('0x19')](removeEntity(_0xbf9ba6,null))['catch'](handleError(_0xbf9ba6,null));};exports[_0xa9a4('0x5c')]=function(_0x36392b,_0xb324e2){return db[_0xa9a4('0x33')][_0xa9a4('0x5c')]()[_0xa9a4('0x19')](respondWithResult(_0xb324e2,null))[_0xa9a4('0x21')](handleError(_0xb324e2,null));};exports[_0xa9a4('0x5d')]=function(_0x4c39e6,_0x50ba36,_0x15ed26){if(_0x4c39e6['body']['id']){delete _0x4c39e6['body']['id'];}return db[_0xa9a4('0x33')]['find']({'where':{'id':_0x4c39e6['params']['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x50ba36,null))[_0xa9a4('0x19')](function(_0x457b2f){if(_0x457b2f){_0x4c39e6['body'][_0xa9a4('0x5e')]=_0x457b2f['id'];return db[_0xa9a4('0x5f')][_0xa9a4('0x52')](_0x4c39e6[_0xa9a4('0x53')]);}})[_0xa9a4('0x19')](respondWithResult(_0x50ba36,null))[_0xa9a4('0x21')](handleError(_0x50ba36,null));};exports[_0xa9a4('0x60')]=function(_0x4cc389,_0x5e0f48,_0x2463e9){var _0x3df836={'raw':![],'where':{}};var _0x3d6f03={};var _0x1260d9={'count':0x0,'rows':[]};return db[_0xa9a4('0x33')][_0xa9a4('0x61')]({'where':{'id':_0x4cc389[_0xa9a4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e0f48,null))[_0xa9a4('0x19')](function(_0x308ba6){if(_0x308ba6){_0x3d6f03[_0xa9a4('0x37')]=_['keys'](db[_0xa9a4('0x5f')][_0xa9a4('0x34')]);_0x3d6f03[_0xa9a4('0x39')]=_[_0xa9a4('0x3a')](_0x4cc389[_0xa9a4('0x39')]);_0x3d6f03[_0xa9a4('0x3b')]=_[_0xa9a4('0x3c')](_0x3d6f03[_0xa9a4('0x37')],_0x3d6f03[_0xa9a4('0x39')]);_0x3df836[_0xa9a4('0x3e')]=_[_0xa9a4('0x3c')](_0x3d6f03['model'],qs[_0xa9a4('0x3d')](_0x4cc389[_0xa9a4('0x39')][_0xa9a4('0x3d')]));_0x3df836['attributes']=_0x3df836[_0xa9a4('0x3e')]['length']?_0x3df836['attributes']:_0x3d6f03[_0xa9a4('0x37')];if(!_0x4cc389[_0xa9a4('0x39')][_0xa9a4('0x40')](_0xa9a4('0x41'))){_0x3df836['limit']=qs[_0xa9a4('0x42')](_0x4cc389[_0xa9a4('0x39')][_0xa9a4('0x42')]);_0x3df836[_0xa9a4('0x25')]=qs[_0xa9a4('0x25')](_0x4cc389[_0xa9a4('0x39')][_0xa9a4('0x25')]);}_0x3df836['order']=qs[_0xa9a4('0x62')](_0x4cc389[_0xa9a4('0x39')][_0xa9a4('0x62')]);_0x3df836[_0xa9a4('0x44')]=qs[_0xa9a4('0x3b')](_[_0xa9a4('0x45')](_0x4cc389[_0xa9a4('0x39')],_0x3d6f03[_0xa9a4('0x3b')]));_0x3df836[_0xa9a4('0x44')]['SmsAccountId']=_0x308ba6['id'];if(_0x4cc389[_0xa9a4('0x39')][_0xa9a4('0x46')]){_0x3df836[_0xa9a4('0x44')]=_['merge'](_0x3df836[_0xa9a4('0x44')],{'$or':_['map'](_0x3df836['attributes'],function(_0xd98c7a){var _0x399a7f={};_0x399a7f[_0xd98c7a]={'$like':'%'+_0x4cc389[_0xa9a4('0x39')][_0xa9a4('0x46')]+'%'};return _0x399a7f;})});}_0x3df836=_[_0xa9a4('0x49')]({},_0x3df836,_0x4cc389[_0xa9a4('0x4a')]);return db['Disposition']['count']({'where':_0x3df836[_0xa9a4('0x44')]})[_0xa9a4('0x19')](function(_0x51140b){_0x1260d9['count']=_0x51140b;if(_0x4cc389[_0xa9a4('0x39')]['includeAll']){_0x3df836[_0xa9a4('0x4b')]=[{'all':!![]}];}return db[_0xa9a4('0x5f')][_0xa9a4('0x63')](_0x3df836);})[_0xa9a4('0x19')](function(_0xf29ed9){_0x1260d9[_0xa9a4('0x4c')]=_0xf29ed9;return _0x1260d9;});}})[_0xa9a4('0x19')](respondWithFilteredResult(_0x5e0f48,_0x3df836))[_0xa9a4('0x21')](handleError(_0x5e0f48,null));};exports['removeDispositions']=function(_0x1e09c0,_0x5a1e2a,_0x2d4aa2){return db[_0xa9a4('0x33')][_0xa9a4('0x51')]({'where':{'id':_0x1e09c0[_0xa9a4('0x4e')]['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x5a1e2a,null))[_0xa9a4('0x19')](function(_0x551f6f){if(_0x551f6f){return _0x551f6f[_0xa9a4('0x64')](_0x1e09c0[_0xa9a4('0x39')][_0xa9a4('0x65')]);}})[_0xa9a4('0x19')](respondWithStatusCode(_0x5a1e2a,null))[_0xa9a4('0x21')](handleError(_0x5a1e2a,null));};exports[_0xa9a4('0x66')]=function(_0x2c5bbb,_0x48a056,_0x3ec04d){if(_0x2c5bbb[_0xa9a4('0x53')]['id']){delete _0x2c5bbb['body']['id'];}return db[_0xa9a4('0x33')]['find']({'where':{'id':_0x2c5bbb[_0xa9a4('0x4e')]['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x48a056,null))[_0xa9a4('0x19')](function(_0x152fff){if(_0x152fff){_0x2c5bbb[_0xa9a4('0x53')]['SmsAccountId']=_0x152fff['id'];return db[_0xa9a4('0x67')][_0xa9a4('0x52')](_0x2c5bbb[_0xa9a4('0x53')]);}})['then'](respondWithResult(_0x48a056,null))['catch'](handleError(_0x48a056,null));};exports['getAnswers']=function(_0x2a0b92,_0x3c059b,_0x2de7bf){var _0x471cec={'raw':![],'where':{}};var _0x5f5b69={};var _0x1e89f2={'count':0x0,'rows':[]};return db[_0xa9a4('0x33')][_0xa9a4('0x61')]({'where':{'id':_0x2a0b92[_0xa9a4('0x4e')]['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x3c059b,null))[_0xa9a4('0x19')](function(_0xbe6421){if(_0xbe6421){_0x5f5b69[_0xa9a4('0x37')]=_[_0xa9a4('0x3a')](db[_0xa9a4('0x67')][_0xa9a4('0x34')]);_0x5f5b69[_0xa9a4('0x39')]=_['keys'](_0x2a0b92[_0xa9a4('0x39')]);_0x5f5b69['filters']=_[_0xa9a4('0x3c')](_0x5f5b69['model'],_0x5f5b69[_0xa9a4('0x39')]);_0x471cec[_0xa9a4('0x3e')]=_[_0xa9a4('0x3c')](_0x5f5b69['model'],qs[_0xa9a4('0x3d')](_0x2a0b92['query'][_0xa9a4('0x3d')]));_0x471cec[_0xa9a4('0x3e')]=_0x471cec['attributes'][_0xa9a4('0x3f')]?_0x471cec[_0xa9a4('0x3e')]:_0x5f5b69['model'];if(!_0x2a0b92['query'][_0xa9a4('0x40')](_0xa9a4('0x41'))){_0x471cec[_0xa9a4('0x42')]=qs[_0xa9a4('0x42')](_0x2a0b92[_0xa9a4('0x39')][_0xa9a4('0x42')]);_0x471cec[_0xa9a4('0x25')]=qs[_0xa9a4('0x25')](_0x2a0b92['query'][_0xa9a4('0x25')]);}_0x471cec[_0xa9a4('0x43')]=qs['sort'](_0x2a0b92[_0xa9a4('0x39')][_0xa9a4('0x62')]);_0x471cec['where']=qs[_0xa9a4('0x3b')](_[_0xa9a4('0x45')](_0x2a0b92[_0xa9a4('0x39')],_0x5f5b69[_0xa9a4('0x3b')]));_0x471cec[_0xa9a4('0x44')][_0xa9a4('0x5e')]=_0xbe6421['id'];if(_0x2a0b92[_0xa9a4('0x39')][_0xa9a4('0x46')]){_0x471cec['where']=_[_0xa9a4('0x49')](_0x471cec['where'],{'$or':_['map'](_0x471cec[_0xa9a4('0x3e')],function(_0x1baa69){var _0x5ca68b={};_0x5ca68b[_0x1baa69]={'$like':'%'+_0x2a0b92['query']['filter']+'%'};return _0x5ca68b;})});}_0x471cec=_[_0xa9a4('0x49')]({},_0x471cec,_0x2a0b92[_0xa9a4('0x4a')]);return db[_0xa9a4('0x67')]['count']({'where':_0x471cec[_0xa9a4('0x44')]})[_0xa9a4('0x19')](function(_0x4e3aff){_0x1e89f2['count']=_0x4e3aff;if(_0x2a0b92[_0xa9a4('0x39')]['includeAll']){_0x471cec[_0xa9a4('0x4b')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa9a4('0x63')](_0x471cec);})[_0xa9a4('0x19')](function(_0xfb8d67){_0x1e89f2['rows']=_0xfb8d67;return _0x1e89f2;});}})[_0xa9a4('0x19')](respondWithFilteredResult(_0x3c059b,_0x471cec))['catch'](handleError(_0x3c059b,null));};exports[_0xa9a4('0x68')]=function(_0x2a5e05,_0x2fe06f,_0x3c05b4){return db[_0xa9a4('0x33')][_0xa9a4('0x51')]({'where':{'id':_0x2a5e05[_0xa9a4('0x4e')]['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x2fe06f,null))['then'](function(_0x229c79){if(_0x229c79){return _0x229c79[_0xa9a4('0x68')](_0x2a5e05[_0xa9a4('0x39')][_0xa9a4('0x65')]);}})['then'](respondWithStatusCode(_0x2fe06f,null))[_0xa9a4('0x21')](handleError(_0x2fe06f,null));};exports[_0xa9a4('0x69')]=function(_0x1b3a39,_0x43d86f,_0x5ba17f){var _0xb86d1c={'channel':_0xa9a4('0x6a')};var _0x447d67=[];var _0x5e6976=[];var _0x5b4453={};return db['SmsAccount'][_0xa9a4('0x51')]({'where':{'id':_0x1b3a39[_0xa9a4('0x4e')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xa9a4('0x6b')}]})['then'](handleEntityNotFound(_0x43d86f,null))[_0xa9a4('0x19')](function(_0x535e64){_0xb86d1c[_0xa9a4('0x6c')]=_0x535e64;_0xb86d1c[_0xa9a4('0x6d')]=_['orderBy'](_0x535e64[_0xa9a4('0x6b')],[_0xa9a4('0x6e')],['asc']);if(_0xb86d1c[_0xa9a4('0x6c')][_0xa9a4('0x6b')]){delete _0xb86d1c[_0xa9a4('0x6c')][_0xa9a4('0x6b')];}return db[_0xa9a4('0x6f')][_0xa9a4('0x5c')]();})[_0xa9a4('0x19')](function(_0x2c9424){if(!_0x2c9424){throw new db[(_0xa9a4('0x70'))][(_0xa9a4('0x71'))](_0xa9a4('0x72'));}_0x447d67=_['difference'](_['keys'](_0x2c9424),[_0xa9a4('0x73'),'updatedAt']);_0x5e6976=_['difference'](_[_0xa9a4('0x3a')](_0x2c9424),['createdAt',_0xa9a4('0x74'),_0xa9a4('0x75'),'ListId']);_0xb86d1c[_0xa9a4('0x53')]={'mapKey':'mobile'};if(_0xb86d1c[_0xa9a4('0x6c')][_0xa9a4('0x47')]){switch(_0xb86d1c[_0xa9a4('0x6c')][_0xa9a4('0x47')]){case _0xa9a4('0x76'):_0xb86d1c['body']['from']=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x77')];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x53')]=_0x1b3a39[_0xa9a4('0x53')]['Body'];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x78')]=_0x1b3a39[_0xa9a4('0x53')]['MessageSid'];break;case _0xa9a4('0x79'):_0xb86d1c[_0xa9a4('0x53')]['from']='+'+_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x7a')];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x53')]=_0x1b3a39[_0xa9a4('0x53')]['text'];break;case'connectel':_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x7b')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x7b')];_0xb86d1c['body'][_0xa9a4('0x53')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x1f')];break;case _0xa9a4('0x7c'):_0xb86d1c[_0xa9a4('0x53')]['from']=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x7b')];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x53')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x53')];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x78')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x7d')];break;case _0xa9a4('0x7e'):_0xb86d1c[_0xa9a4('0x53')]['from']=_0x1b3a39[_0xa9a4('0x53')]['From'];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x53')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x7f')];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x78')]=_0x1b3a39[_0xa9a4('0x53')]['MessageUUID'];break;case _0xa9a4('0x80'):_0xb86d1c['body']['from']='+'+_0x1b3a39['body'][_0xa9a4('0x81')][0x0][_0xa9a4('0x7b')];_0xb86d1c['body'][_0xa9a4('0x53')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x81')][0x0]['text'];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x78')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x81')][0x0][_0xa9a4('0x78')];break;case _0xa9a4('0x82'):_0xb86d1c[_0xa9a4('0x53')]['from']=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x83')];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x53')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x84')]['message'];break;case _0xa9a4('0x85'):_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x7b')]=_0x1b3a39['body'][_0xa9a4('0x86')];_0xb86d1c[_0xa9a4('0x53')]['body']=_0x1b3a39[_0xa9a4('0x53')]['text'];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x78')]=_0x1b3a39[_0xa9a4('0x53')]['replyMessageId'];break;case'bandwidth':_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x78')]=_0x1b3a39[_0xa9a4('0x53')][0x0][_0xa9a4('0x1f')]['id'];_0xb86d1c['body']['from']=_0x1b3a39[_0xa9a4('0x53')][0x0][_0xa9a4('0x1f')][_0xa9a4('0x7b')];_0xb86d1c[_0xa9a4('0x53')]['body']=_0x1b3a39['body'][0x0][_0xa9a4('0x1f')][_0xa9a4('0x87')];break;case _0xa9a4('0x88'):_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x7b')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x7b')];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x53')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x1f')];_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x78')]=_0x1b3a39[_0xa9a4('0x53')][_0xa9a4('0x89')];break;}}if(_0xb86d1c[_0xa9a4('0x53')]['id']){delete _0xb86d1c['body']['id'];}if(_[_0xa9a4('0x8a')](_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x7b')])){throw new db['Sequelize'][(_0xa9a4('0x71'))]('from\x20is\x20mandatory');}if(_[_0xa9a4('0x8a')](_0xb86d1c[_0xa9a4('0x53')]['body'])||_0xb86d1c['body'][_0xa9a4('0x53')]===''){throw new db[(_0xa9a4('0x70'))][(_0xa9a4('0x71'))](_0xa9a4('0x8b'));}if(_[_0xa9a4('0x8a')](_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x8c')])){throw new db['Sequelize'][(_0xa9a4('0x71'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e6976);}if(!_[_0xa9a4('0x8d')](_0x5e6976,_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x8c')])){throw new db[(_0xa9a4('0x70'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e6976);}_0x5b4453[_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x8c')]]=_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x7b')];return db['CmList'][_0xa9a4('0x51')]({'where':{'id':_0xb86d1c[_0xa9a4('0x6c')][_0xa9a4('0x8e')]},'include':[{'model':db[_0xa9a4('0x6f')],'as':'Contacts','where':_0x5b4453,'limit':0x1,'order':[[_0xa9a4('0x74'),_0xa9a4('0x8f')]]}]});})[_0xa9a4('0x19')](handleEntityNotFound(_0x43d86f,null))[_0xa9a4('0x19')](function(_0x40b9bb){if(_0x40b9bb){_0xb86d1c[_0xa9a4('0x90')]=_[_0xa9a4('0x91')](_0x40b9bb,['Contacts']);if(_0x40b9bb[_0xa9a4('0x92')][_0xa9a4('0x3f')]){return _0x40b9bb[_0xa9a4('0x92')][0x0];}var _0x70f314=_[_0xa9a4('0x93')](_0xb86d1c['body'],{'firstName':_0xb86d1c[_0xa9a4('0x53')]['from'],'ListId':_0x40b9bb['id']});_0x70f314[_0xb86d1c['body']['mapKey']]=_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x7b')];return db[_0xa9a4('0x6f')][_0xa9a4('0x52')](_0x70f314,{'fields':_0x447d67,'raw':!![]});}})[_0xa9a4('0x19')](handleEntityNotFound(_0x43d86f,null))[_0xa9a4('0x19')](function(_0x4c8f0d){if(_0x4c8f0d){_0xb86d1c[_0xa9a4('0x94')]=_0x4c8f0d;var _0x299a02={'ContactId':_0x4c8f0d['id'],'phone':_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x7b')],'SmsAccountId':_0x1b3a39[_0xa9a4('0x4e')]['id']};var _0x3c1e02={'ContactId':_0x4c8f0d['id'],'SmsAccountId':_0x1b3a39['params']['id'],'closed':![]};return db['SmsInteraction'][_0xa9a4('0x51')]({'where':_0x3c1e02})[_0xa9a4('0x19')](function(_0x1e2924){if(_0x1e2924){return[_0x1e2924,![]];}return db['SmsInteraction'][_0xa9a4('0x52')](_0x299a02)['then'](function(_0x383779){return[_0x383779,!![]];});});}})['spread'](function(_0x2a8ead,_0x565102){_0xb86d1c[_0xa9a4('0x95')]=_0x2a8ead[_0xa9a4('0x2c')]({'plain':!![]});_0xb86d1c[_0xa9a4('0x95')][_0xa9a4('0x96')]=![];if(_0x565102){if(_0xb86d1c['account'][_0xa9a4('0x97')]){_0xb86d1c['applications'][_0xa9a4('0x98')]({'id':0x0,'priority':_0xb86d1c[_0xa9a4('0x6d')][_0xa9a4('0x3f')]+0x1,'app':_0xa9a4('0x99'),'appdata':'unmanaged','interval':_0xa9a4('0x9a')});}_0xb86d1c[_0xa9a4('0x95')][_0xa9a4('0x96')]=!![];}return db[_0xa9a4('0x9b')][_0xa9a4('0x52')]({'phone':_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x7b')],'messageId':_0xb86d1c['body']['messageId'],'body':_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x53')],'SmsAccountId':_0x1b3a39[_0xa9a4('0x4e')]['id'],'SmsInteractionId':_0x2a8ead['id'],'direction':'in','ContactId':_0x2a8ead[_0xa9a4('0x9c')],'AttachmentId':_0xb86d1c[_0xa9a4('0x53')][_0xa9a4('0x9d')]});})[_0xa9a4('0x19')](function(_0x471b42){_0xb86d1c[_0xa9a4('0x1f')]=_0x471b42;if(!_0xb86d1c[_0xa9a4('0x95')]['UserId'])return;return db[_0xa9a4('0x9e')][_0xa9a4('0x51')]({'attributes':['id',_0xa9a4('0x30')],'where':{'id':_0xb86d1c[_0xa9a4('0x95')][_0xa9a4('0x9f')]}});})[_0xa9a4('0x19')](function(_0x26f8f7){if(_0x26f8f7){_0xb86d1c[_0xa9a4('0x6d')][_0xa9a4('0xa0')]({'id':0x0,'priority':0x0,'app':_0xa9a4('0xa1'),'appdata':_0x26f8f7['name']+','+(_0xb86d1c[_0xa9a4('0x6c')][_0xa9a4('0xa2')]||0xa),'interval':_0xa9a4('0x9a')});}if(!_0xb86d1c[_0xa9a4('0x95')][_0xa9a4('0xa3')])return;return db['SmsQueue'][_0xa9a4('0x51')]({'attributes':['id',_0xa9a4('0x30')],'where':{'id':_0xb86d1c['interaction'][_0xa9a4('0xa3')]}});})[_0xa9a4('0x19')](function(_0x33e360){if(_0x33e360){_0xb86d1c[_0xa9a4('0x6d')][_0xa9a4('0xa0')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x33e360[_0xa9a4('0x30')]+','+(_0xb86d1c[_0xa9a4('0x6c')][_0xa9a4('0xa4')]||0x12c),'interval':_0xa9a4('0x9a')});}return respondWithRpcPromise(_0xa9a4('0xa5'),_0xa9a4('0xa6'),_0xb86d1c);})[_0xa9a4('0x19')](function(_0x8fb0b2){if(_0x8fb0b2){var _0x557f6e=0xc8;var _0xa2c346=_0xa9a4('0xa7');logger['info'](_0xa9a4('0x1d'),_0xa2c346,_0x557f6e,_0xa9a4('0xa8'));logger[_0xa9a4('0xa9')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xa2c346,_0x557f6e,'entity\x20found',JSON[_0xa9a4('0xaa')](_0x8fb0b2));if(_0xb86d1c[_0xa9a4('0x6c')]['type']===_0xa9a4('0x76')){return _0x43d86f[_0xa9a4('0x23')](_0x557f6e)[_0xa9a4('0xab')](_0xa9a4('0xac'),_0xa9a4('0xad'))['send'](_0xa9a4('0xae'));}else{return _0x43d86f['status'](_0x557f6e)[_0xa9a4('0xaf')](_0x8fb0b2);}}})[_0xa9a4('0x21')](handleError(_0x43d86f,null));};exports[_0xa9a4('0xb0')]=function(_0x414f89,_0xf68d51){var _0x26f696=_0x414f89[_0xa9a4('0x4e')]['id'];var _0x2afb90=_0x414f89[_0xa9a4('0x53')];var _0x188769=0xc8;var _0x5f586c=null;return db[_0xa9a4('0xb1')]['transaction']({'isolationLevel':db[_0xa9a4('0xb1')][_0xa9a4('0xb2')][_0xa9a4('0xb3')][_0xa9a4('0xb4')]},function(_0x3cc2f3){return db[_0xa9a4('0x33')]['findOne']({'where':{'id':_0x26f696},'transaction':_0x3cc2f3})['then'](function(_0x1a5f34){if(_0x1a5f34){return db['SmsApplication'][_0xa9a4('0x2e')]({'where':{'SmsAccountId':_0x26f696},'transaction':_0x3cc2f3})[_0xa9a4('0x19')](function(){var _0x544014=_[_0xa9a4('0x38')](_0x2afb90,function(_0x1803e6){_0x1803e6[_0xa9a4('0x5e')]=_0x26f696;return _0x1803e6;});return db[_0xa9a4('0xb5')]['bulkCreate'](_0x544014,{'transaction':_0x3cc2f3});});}else{_0x188769=0x194;_0x5f586c=[];}});})[_0xa9a4('0x19')](function(){if(_0x188769!==0x194){return db[_0xa9a4('0xb5')][_0xa9a4('0xb6')]({'where':{'SmsAccountId':_0x26f696},'order':'priority'})[_0xa9a4('0x19')](function(_0x252d28){_0x5f586c=_0x252d28;});}})[_0xa9a4('0x21')](function(_0x507280){_0x188769=0x1f4;logger[_0xa9a4('0x1e')](_0x507280[_0xa9a4('0x2f')]);if(_0x507280[_0xa9a4('0x30')]){delete _0x507280['name'];}_0x5f586c=_0x507280;})[_0xa9a4('0xb7')](function(){if(_0x5f586c===null){_0xf68d51[_0xa9a4('0x22')](_0x188769);}else{if(_0x188769===0x1f4){_0xf68d51['status'](_0x188769)[_0xa9a4('0x31')](_0x5f586c);}else{_0xf68d51[_0xa9a4('0x23')](_0x188769)[_0xa9a4('0xaf')](_0x5f586c);}}});};exports[_0xa9a4('0xb8')]=function(_0x891c57,_0x1b21b4,_0x26f773){var _0x36f4c6={};var _0x2b0cd3={};var _0x3da67b;var _0x1e00c4;return db[_0xa9a4('0x33')][_0xa9a4('0x61')]({'where':{'id':_0x891c57[_0xa9a4('0x4e')]['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x1b21b4,null))['then'](function(_0x20a351){if(_0x20a351){_0x3da67b=_0x20a351;_0x2b0cd3[_0xa9a4('0x37')]=_['keys'](db[_0xa9a4('0xb5')][_0xa9a4('0x34')]);_0x2b0cd3[_0xa9a4('0x39')]=_[_0xa9a4('0x3a')](_0x891c57[_0xa9a4('0x39')]);_0x2b0cd3[_0xa9a4('0x3b')]=_[_0xa9a4('0x3c')](_0x2b0cd3[_0xa9a4('0x37')],_0x2b0cd3[_0xa9a4('0x39')]);_0x36f4c6[_0xa9a4('0x3e')]=_[_0xa9a4('0x3c')](_0x2b0cd3[_0xa9a4('0x37')],qs[_0xa9a4('0x3d')](_0x891c57['query'][_0xa9a4('0x3d')]));_0x36f4c6[_0xa9a4('0x3e')]=_0x36f4c6['attributes'][_0xa9a4('0x3f')]?_0x36f4c6[_0xa9a4('0x3e')]:_0x2b0cd3[_0xa9a4('0x37')];_0x36f4c6[_0xa9a4('0x43')]=qs['sort'](_0x891c57[_0xa9a4('0x39')]['sort']);_0x36f4c6[_0xa9a4('0x44')]=qs[_0xa9a4('0x3b')](_[_0xa9a4('0x45')](_0x891c57['query'],_0x2b0cd3['filters']));if(_0x891c57[_0xa9a4('0x39')]['filter']){_0x36f4c6[_0xa9a4('0x44')]=_[_0xa9a4('0x49')](_0x36f4c6['where'],{'$or':_[_0xa9a4('0x38')](_0x36f4c6[_0xa9a4('0x3e')],function(_0x413f2d){var _0x4e93aa={};_0x4e93aa[_0x413f2d]={'$like':'%'+_0x891c57[_0xa9a4('0x39')][_0xa9a4('0x46')]+'%'};return _0x4e93aa;})});}_0x36f4c6=_[_0xa9a4('0x49')]({},_0x36f4c6,_0x891c57[_0xa9a4('0x4a')]);return _0x3da67b[_0xa9a4('0xb8')](_0x36f4c6);}})[_0xa9a4('0x19')](function(_0x552c70){if(_0x552c70){_0x1e00c4=_0x552c70['length'];if(!_0x891c57[_0xa9a4('0x39')][_0xa9a4('0x40')](_0xa9a4('0x41'))){_0x36f4c6[_0xa9a4('0x42')]=qs[_0xa9a4('0x42')](_0x891c57[_0xa9a4('0x39')]['limit']);_0x36f4c6[_0xa9a4('0x25')]=qs['offset'](_0x891c57[_0xa9a4('0x39')][_0xa9a4('0x25')]);}return _0x3da67b[_0xa9a4('0xb8')](_0x36f4c6);}})['then'](function(_0x4a7f23){if(_0x4a7f23){return _0x4a7f23?{'count':_0x1e00c4,'rows':_0x4a7f23}:null;}})[_0xa9a4('0x19')](respondWithResult(_0x1b21b4,null))['catch'](handleError(_0x1b21b4,null));};exports['getInteractions']=function(_0x4ccd60,_0x558eba,_0x5d5c3a){var _0x47b72d={'raw':![],'where':{}};var _0x29e147={};var _0x191024={'count':0x0,'rows':[]};return db[_0xa9a4('0x33')]['findOne']({'where':{'id':_0x4ccd60[_0xa9a4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x558eba,null))['then'](function(_0x474271){if(_0x474271){_0x29e147[_0xa9a4('0x37')]=_['keys'](db[_0xa9a4('0xb9')]['rawAttributes']);_0x29e147[_0xa9a4('0x39')]=_[_0xa9a4('0x3a')](_0x4ccd60['query']);_0x29e147[_0xa9a4('0x3b')]=_['intersection'](_0x29e147[_0xa9a4('0x37')],_0x29e147[_0xa9a4('0x39')]);_0x47b72d[_0xa9a4('0x3e')]=_['intersection'](_0x29e147[_0xa9a4('0x37')],qs[_0xa9a4('0x3d')](_0x4ccd60[_0xa9a4('0x39')][_0xa9a4('0x3d')]));_0x47b72d[_0xa9a4('0x3e')]=_0x47b72d[_0xa9a4('0x3e')][_0xa9a4('0x3f')]?_0x47b72d[_0xa9a4('0x3e')]:_0x29e147[_0xa9a4('0x37')];if(!_0x4ccd60[_0xa9a4('0x39')][_0xa9a4('0x40')](_0xa9a4('0x41'))){_0x47b72d[_0xa9a4('0x42')]=qs['limit'](_0x4ccd60['query'][_0xa9a4('0x42')]);_0x47b72d['offset']=qs['offset'](_0x4ccd60[_0xa9a4('0x39')][_0xa9a4('0x25')]);}_0x47b72d['order']=qs[_0xa9a4('0x62')](_0x4ccd60[_0xa9a4('0x39')][_0xa9a4('0x62')]);_0x47b72d[_0xa9a4('0x44')]=qs[_0xa9a4('0x3b')](_[_0xa9a4('0x45')](_0x4ccd60[_0xa9a4('0x39')],_0x29e147['filters']));_0x47b72d[_0xa9a4('0x44')][_0xa9a4('0x5e')]=_0x474271['id'];if(_0x4ccd60[_0xa9a4('0x39')][_0xa9a4('0x46')]){_0x47b72d[_0xa9a4('0x44')]=_[_0xa9a4('0x49')](_0x47b72d[_0xa9a4('0x44')],{'$or':_[_0xa9a4('0x38')](_0x47b72d['attributes'],function(_0x4bbcb6){var _0x4e5002={};_0x4e5002[_0x4bbcb6]={'$like':'%'+_0x4ccd60['query'][_0xa9a4('0x46')]+'%'};return _0x4e5002;})});}_0x47b72d=_[_0xa9a4('0x49')]({},_0x47b72d,_0x4ccd60[_0xa9a4('0x4a')]);return db[_0xa9a4('0xb9')]['count']({'where':_0x47b72d[_0xa9a4('0x44')]})[_0xa9a4('0x19')](function(_0x382561){_0x191024['count']=_0x382561;if(_0x4ccd60['query']['includeAll']){_0x47b72d[_0xa9a4('0x4b')]=[{'model':db[_0xa9a4('0x6f')],'as':_0xa9a4('0xba'),'required':![]},{'model':db[_0xa9a4('0x9e')],'as':_0xa9a4('0xbb'),'attributes':[_0xa9a4('0x30'),_0xa9a4('0xbc'),_0xa9a4('0xbd')],'required':![]},{'model':db[_0xa9a4('0xbe')],'as':_0xa9a4('0xbf'),'attributes':['id','name',_0xa9a4('0xc0')],'where':_0x4ccd60[_0xa9a4('0x39')][_0xa9a4('0xc1')]?{'id':_0x4ccd60['query']['tag']}:undefined,'required':_0x4ccd60[_0xa9a4('0x39')][_0xa9a4('0xc1')]?!![]:![]}];}return db[_0xa9a4('0xb9')][_0xa9a4('0x63')](_0x47b72d);})['then'](function(_0x52c7cb){_0x191024[_0xa9a4('0x4c')]=_0x52c7cb;return _0x191024;});}})[_0xa9a4('0x19')](respondWithFilteredResult(_0x558eba,_0x47b72d))[_0xa9a4('0x21')](handleError(_0x558eba,null));};exports[_0xa9a4('0x31')]=function(_0x513b67,_0x2b4819,_0x30d7ee){var _0x3a4807,_0x4d385c,_0x4b1196;if(_[_0xa9a4('0x8a')](_0x513b67[_0xa9a4('0x53')]['body'])||_0x513b67['body'][_0xa9a4('0x53')]===''){throw new db['Sequelize'][(_0xa9a4('0x71'))](_0xa9a4('0x8b'));}if(_[_0xa9a4('0x8a')](_0x513b67[_0xa9a4('0x53')]['to'])){throw new db[(_0xa9a4('0x70'))][(_0xa9a4('0x71'))](_0xa9a4('0xc2'));}_0x3a4807=_0x513b67[_0xa9a4('0x53')]['to'];return db[_0xa9a4('0x33')]['find']({'where':{'id':_0x513b67['params']['id']},'include':[{'model':db[_0xa9a4('0xc3')],'as':_0xa9a4('0xc4'),'include':[{'model':db[_0xa9a4('0x6f')],'as':'Contacts','where':{'mobile':_0x3a4807},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x2b4819,null))[_0xa9a4('0x19')](function(_0x2bc35d){if(_0x2bc35d&&_0x2bc35d[_0xa9a4('0xc4')]){_0x4d385c=_0x2bc35d[_0xa9a4('0x2c')]({'plain':!![]});if(_0x4d385c[_0xa9a4('0xc4')]&&_0x4d385c[_0xa9a4('0xc4')][_0xa9a4('0x92')][_0xa9a4('0x3f')]){return _0x4d385c[_0xa9a4('0xc4')][_0xa9a4('0x92')][0x0];}return db[_0xa9a4('0x6f')]['create'](_['defaults'](_0x513b67[_0xa9a4('0x53')],{'firstName':_0x3a4807,'mobile':_0x3a4807,'phone':_0x3a4807,'ListId':_0x4d385c[_0xa9a4('0x8e')]}));}})[_0xa9a4('0x19')](handleEntityNotFound(_0x2b4819,null))[_0xa9a4('0x19')](function(_0x227a00){if(_0x227a00){_0x4b1196=_0x227a00;return db[_0xa9a4('0xb9')][_0xa9a4('0x51')]({'where':{'ContactId':_0x4b1196['id'],'closed':![],'SmsAccountId':_0x4d385c['id']}})['then'](function(_0x34df51){if(_0x34df51){return[_0x34df51,![]];}return db[_0xa9a4('0xb9')][_0xa9a4('0x52')]({'UserId':_0x513b67[_0xa9a4('0x55')]['id'],'ContactId':_0x4b1196['id'],'SmsAccountId':_0x4d385c['id'],'phone':_0x3a4807,'firstMsgDirection':_0xa9a4('0xc5'),'Messages':[_[_0xa9a4('0x49')](_0x513b67[_0xa9a4('0x53')],{'read':![],'body':_0x513b67[_0xa9a4('0x53')][_0xa9a4('0x53')],'phone':_0x3a4807,'SmsAccountId':_0x4d385c['id'],'UserId':_0x513b67[_0xa9a4('0x55')]['id'],'ContactId':_0x4b1196['id']})]},{'include':[{'model':db[_0xa9a4('0x9b')],'as':_0xa9a4('0xc6')}]})[_0xa9a4('0x19')](function(_0x16b8ce){return[_0x16b8ce,!![]];});});}})[_0xa9a4('0xc7')](function(_0x2662bc,_0xb68fea){if(_0xb68fea){return _0x2662bc;}return db[_0xa9a4('0x9b')]['create'](_[_0xa9a4('0x49')](_0x513b67[_0xa9a4('0x53')],{'read':![],'body':_0x513b67[_0xa9a4('0x53')][_0xa9a4('0x53')],'phone':_0x3a4807,'SmsAccountId':_0x4d385c['id'],'SmsInteractionId':_0x2662bc['id'],'UserId':_0x513b67['user']['id'],'ContactId':_0x4b1196['id']}))[_0xa9a4('0x19')](function(_0xfe6dd2){_0x2662bc[_0xa9a4('0xc8')][_0xa9a4('0xc6')]=[];_0x2662bc[_0xa9a4('0xc8')][_0xa9a4('0xc6')][_0xa9a4('0x98')](_0xfe6dd2['dataValues']);return _0x2662bc;});})['then'](respondWithResult(_0x2b4819,null))['catch'](handleError(_0x2b4819,null));};exports[_0xa9a4('0x23')]=function(_0x43d4f4,_0x31d24c,_0x72f996){if(_0x43d4f4[_0xa9a4('0x53')]['id']){delete _0x43d4f4[_0xa9a4('0x53')]['id'];}var _0x32e0ce,_0x162c02,_0x20b329;return db['SmsAccount']['find']({'where':{'id':_0x43d4f4['params']['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x31d24c,null))[_0xa9a4('0x19')](function(_0x5efb87){if(_0x5efb87){_0x20b329=_0x5efb87;logger[_0xa9a4('0xa9')](_0xa9a4('0x1d'),_0xa9a4('0x23'),'received\x20delivery\x20report\x20from',_0x5efb87[_0xa9a4('0x47')],util[_0xa9a4('0xc9')](_0x43d4f4['body'],{'showHidden':![],'depth':null}));switch(_0x5efb87[_0xa9a4('0x47')]){case _0xa9a4('0x79'):if(_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0xca')]&&_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0x23')]){_0x162c02=_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0x23')];return db['SmsMessage']['find']({'where':{'messageId':_0x43d4f4[_0xa9a4('0x53')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0xcb')]&&_0x43d4f4['body']['statusInt']){_0x162c02=_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0xcc')];return db[_0xa9a4('0x9b')][_0xa9a4('0x51')]({'where':{'messageId':_0x43d4f4[_0xa9a4('0x53')]['requestid']}});}break;case _0xa9a4('0x7c'):if(_0x43d4f4[_0xa9a4('0x53')]['message_id']&&_0x43d4f4[_0xa9a4('0x53')]['status_code']){_0x162c02=_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0xcd')];return db[_0xa9a4('0x9b')][_0xa9a4('0x51')]({'where':{'messageId':_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0x7d')]}});}break;case _0xa9a4('0x80'):var _0x2a0012=_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0x81')][0x0];if(_0x2a0012[_0xa9a4('0x78')]&&_0x2a0012['status'][_0xa9a4('0xce')]===_0xa9a4('0xcf')){_0x162c02=_0x2a0012[_0xa9a4('0x23')]['groupName'];return db[_0xa9a4('0x9b')][_0xa9a4('0x51')]({'where':{'messageId':_0x2a0012[_0xa9a4('0x78')]}});}break;case'clickatell':if(_0x43d4f4['body'][_0xa9a4('0x78')]&&_0x43d4f4[_0xa9a4('0x53')]['status']){_0x162c02=_0x43d4f4[_0xa9a4('0x53')]['status'];return db[_0xa9a4('0x9b')]['find']({'where':{'messageId':_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0x78')]}});}break;case _0xa9a4('0xd0'):if(_0x43d4f4[_0xa9a4('0x53')][0x0][_0xa9a4('0x1f')]['id']){_0x162c02=_0x43d4f4[_0xa9a4('0x53')][0x0][_0xa9a4('0x47')];return db[_0xa9a4('0x9b')]['find']({'where':{'messageId':_0x43d4f4['body'][0x0][_0xa9a4('0x1f')]['id']}});}break;case'intelepeer':if(_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0xd1')]&&_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0x23')]){_0x162c02=_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0x23')];return db[_0xa9a4('0x9b')][_0xa9a4('0x51')]({'where':{'messageId':_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0xd1')]}});}break;}}})[_0xa9a4('0x19')](handleEntityNotFound(_0x31d24c,null))[_0xa9a4('0x19')](function(_0x13360f){if(_0x13360f){_0x32e0ce=_0x13360f;switch(_0x20b329[_0xa9a4('0x47')]){case'skebby':if(_0x162c02===_0xa9a4('0xcf')){return _0x32e0ce[_0xa9a4('0x5b')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa9a4('0x23'),_0xa9a4('0x79'),util[_0xa9a4('0xc9')](_0x43d4f4[_0xa9a4('0x53')],{'showHidden':![],'depth':null}));}break;case _0xa9a4('0xd2'):if(_0x162c02==='1'){return _0x32e0ce[_0xa9a4('0x5b')]({'read':!![]});}else{logger[_0xa9a4('0x1e')](_0xa9a4('0x1d'),_0xa9a4('0x23'),_0xa9a4('0x79'),util['inspect'](_0x43d4f4['body'],{'showHidden':![],'depth':null}));}break;case _0xa9a4('0x7c'):if(!_0x43d4f4[_0xa9a4('0x53')][_0xa9a4('0xd3')]&&_0x162c02>=0xc8&&_0x162c02<=0xce){return _0x32e0ce[_0xa9a4('0x5b')]({'read':!![]});}else{logger[_0xa9a4('0x1e')](_0xa9a4('0x1d'),_0xa9a4('0x23'),_0xa9a4('0x7c'),util[_0xa9a4('0xc9')](_0x43d4f4[_0xa9a4('0x53')],{'showHidden':![],'depth':null}));}break;case _0xa9a4('0x80'):var _0x503922=_0x43d4f4[_0xa9a4('0x53')]['results'][0x0];if(_0x503922['status']['groupName']===_0xa9a4('0xcf')){return _0x32e0ce[_0xa9a4('0x5b')]({'read':!![]});}else{logger[_0xa9a4('0x1e')](_0xa9a4('0x1d'),_0xa9a4('0x23'),_0xa9a4('0x80'),util[_0xa9a4('0xc9')](_0x43d4f4[_0xa9a4('0x53')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x162c02==_0xa9a4('0xd4')||_0x162c02==_0xa9a4('0xd5')){return _0x32e0ce[_0xa9a4('0x5b')]({'read':!![]});}else{logger['error'](_0xa9a4('0x1d'),_0xa9a4('0x23'),_0xa9a4('0x85'),util['inspect'](_0x43d4f4[_0xa9a4('0x53')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x162c02==_0xa9a4('0xd6')){return _0x32e0ce[_0xa9a4('0x5b')]({'read':!![]});}else{logger[_0xa9a4('0x1e')](_0xa9a4('0x1d'),'status','bandwidth',util[_0xa9a4('0xc9')](_0x43d4f4[_0xa9a4('0x53')],{'showHidden':![],'depth':null}));}break;case _0xa9a4('0x88'):if(_0x162c02==='DELIVRD'||_0x162c02===_0xa9a4('0xd7')){return _0x32e0ce[_0xa9a4('0x5b')]({'read':!![]});}else{logger['error'](_0xa9a4('0x1d'),'status',_0xa9a4('0x88'),util[_0xa9a4('0xc9')](_0x43d4f4[_0xa9a4('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x32e0ce;}})[_0xa9a4('0x19')](respondWithResult(_0x31d24c,null))[_0xa9a4('0x21')](handleError(_0x31d24c,null));};exports['statusGet']=function(_0x4ebd3c,_0x4dfade,_0x1a43fc){var _0x3afadc,_0x5bbdff,_0x15d261;return db[_0xa9a4('0x33')][_0xa9a4('0x51')]({'where':{'id':_0x4ebd3c[_0xa9a4('0x4e')]['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x4dfade,null))[_0xa9a4('0x19')](function(_0x54a1f1){if(_0x54a1f1){_0x15d261=_0x54a1f1;logger[_0xa9a4('0xa9')](_0xa9a4('0x1d'),_0xa9a4('0x23'),_0xa9a4('0xd8'),_0x54a1f1['type'],util[_0xa9a4('0xc9')](_0x4ebd3c[_0xa9a4('0x39')],{'showHidden':![],'depth':null}));switch(_0x54a1f1[_0xa9a4('0x47')]){case _0xa9a4('0x82'):if(_0x4ebd3c['query'][_0xa9a4('0xd9')]&&_0x4ebd3c[_0xa9a4('0x39')]['state']){_0x5bbdff=_0x4ebd3c[_0xa9a4('0x39')]['state'];return db[_0xa9a4('0x9b')]['find']({'where':{'messageId':_0x4ebd3c[_0xa9a4('0x39')]['message-id']}});}break;}}})[_0xa9a4('0x19')](handleEntityNotFound(_0x4dfade,null))[_0xa9a4('0x19')](function(_0x5cd38b){if(_0x5cd38b){_0x3afadc=_0x5cd38b;switch(_0x15d261['type']){case _0xa9a4('0x82'):if(_0x5bbdff==='2'||_0x5bbdff==='6'){return _0x3afadc[_0xa9a4('0x5b')]({'read':!![]});}else{logger['error'](_0xa9a4('0x1d'),_0xa9a4('0x23'),_0xa9a4('0x82'),util[_0xa9a4('0xc9')](_0x4ebd3c['query'],{'showHidden':![],'depth':null}));};break;}return _0x3afadc;}})[_0xa9a4('0x19')](respondWithResult(_0x4dfade,null))[_0xa9a4('0x21')](handleError(_0x4dfade,null));};exports[_0xa9a4('0xda')]=function(_0xe7518c,_0x50dca9,_0x525803){return db['SmsAccount'][_0xa9a4('0x51')]({'where':{'id':_0xe7518c[_0xa9a4('0x4e')]['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x50dca9,null))[_0xa9a4('0x19')](function(_0x4b658f){if(_0x4b658f){return _0x4b658f['addAgents'](_0xe7518c[_0xa9a4('0x53')][_0xa9a4('0x65')],_[_0xa9a4('0x91')](_0xe7518c[_0xa9a4('0x53')],[_0xa9a4('0x65'),'id'])||{})[_0xa9a4('0xc7')](function(_0x5581e9){for(var _0x4e7e50=0x0;_0x4e7e50<_0xe7518c[_0xa9a4('0x53')][_0xa9a4('0x65')][_0xa9a4('0x3f')];_0x4e7e50+=0x1){socket['emit'](_0xa9a4('0xdb'),{'UserId':Number(_0xe7518c[_0xa9a4('0x53')][_0xa9a4('0x65')][_0x4e7e50]),'SmsAccountId':Number(_0xe7518c[_0xa9a4('0x4e')]['id'])});}return _0x5581e9;});}})['then'](respondWithResult(_0x50dca9,null))['catch'](handleError(_0x50dca9,null));};exports[_0xa9a4('0xdc')]=function(_0x5372e3,_0x23d587,_0x23a5b1){return db['SmsAccount'][_0xa9a4('0x51')]({'where':{'id':_0x5372e3['params']['id']}})[_0xa9a4('0x19')](handleEntityNotFound(_0x23d587,null))[_0xa9a4('0x19')](function(_0xcae6eb){if(_0xcae6eb){return _0xcae6eb[_0xa9a4('0xdc')](_0x5372e3[_0xa9a4('0x39')][_0xa9a4('0x65')])[_0xa9a4('0x19')](function(){if(_[_0xa9a4('0xdd')](_0x5372e3[_0xa9a4('0x39')][_0xa9a4('0x65')])){for(var _0x3a6c16=0x0;_0x3a6c16<_0x5372e3[_0xa9a4('0x39')][_0xa9a4('0x65')][_0xa9a4('0x3f')];_0x3a6c16+=0x1){socket['emit'](_0xa9a4('0xde'),{'UserId':Number(_0x5372e3[_0xa9a4('0x39')][_0xa9a4('0x65')][_0x3a6c16]),'SmsAccountId':Number(_0x5372e3[_0xa9a4('0x4e')]['id'])});}}else{socket[_0xa9a4('0xdf')](_0xa9a4('0xde'),{'UserId':Number(_0x5372e3['query']['ids']),'SmsAccountId':Number(_0x5372e3[_0xa9a4('0x4e')]['id'])});}});}})[_0xa9a4('0x19')](respondWithStatusCode(_0x23d587,null))[_0xa9a4('0x21')](handleError(_0x23d587,null));};exports[_0xa9a4('0xe0')]=function(_0x1f23c5,_0x1334e5,_0xc222d5){var _0x11b1eb={};var _0x5c15d7={};var _0x372eb5;var _0x2b8d60;return db[_0xa9a4('0x33')][_0xa9a4('0x61')]({'where':{'id':_0x1f23c5[_0xa9a4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1334e5,null))[_0xa9a4('0x19')](function(_0x49ea1e){if(_0x49ea1e){_0x372eb5=_0x49ea1e;_0x5c15d7[_0xa9a4('0x37')]=_[_0xa9a4('0x3a')](db[_0xa9a4('0x9e')]['rawAttributes']);_0x5c15d7[_0xa9a4('0x39')]=_['keys'](_0x1f23c5['query']);_0x5c15d7['filters']=_[_0xa9a4('0x3c')](_0x5c15d7[_0xa9a4('0x37')],_0x5c15d7['query']);_0x11b1eb[_0xa9a4('0x3e')]=_['intersection'](_0x5c15d7[_0xa9a4('0x37')],qs[_0xa9a4('0x3d')](_0x1f23c5[_0xa9a4('0x39')][_0xa9a4('0x3d')]));_0x11b1eb[_0xa9a4('0x3e')]=_0x11b1eb['attributes'][_0xa9a4('0x3f')]?_0x11b1eb[_0xa9a4('0x3e')]:_0x5c15d7[_0xa9a4('0x37')];_0x11b1eb[_0xa9a4('0x43')]=qs['sort'](_0x1f23c5['query'][_0xa9a4('0x62')]);_0x11b1eb[_0xa9a4('0x44')]=qs[_0xa9a4('0x3b')](_[_0xa9a4('0x45')](_0x1f23c5[_0xa9a4('0x39')],_0x5c15d7[_0xa9a4('0x3b')]));if(_0x1f23c5['query']['filter']){_0x11b1eb[_0xa9a4('0x44')]=_[_0xa9a4('0x49')](_0x11b1eb[_0xa9a4('0x44')],{'$or':_[_0xa9a4('0x38')](_0x11b1eb[_0xa9a4('0x3e')],function(_0x132673){var _0x1ee883={};_0x1ee883[_0x132673]={'$like':'%'+_0x1f23c5[_0xa9a4('0x39')]['filter']+'%'};return _0x1ee883;})});}_0x11b1eb=_[_0xa9a4('0x49')]({},_0x11b1eb,_0x1f23c5['options']);return _0x372eb5[_0xa9a4('0xe0')](_0x11b1eb);}})[_0xa9a4('0x19')](function(_0x4e0f44){if(_0x4e0f44){_0x2b8d60=_0x4e0f44[_0xa9a4('0x3f')];if(!_0x1f23c5['query'][_0xa9a4('0x40')]('nolimit')){_0x11b1eb[_0xa9a4('0x42')]=qs[_0xa9a4('0x42')](_0x1f23c5['query']['limit']);_0x11b1eb[_0xa9a4('0x25')]=qs[_0xa9a4('0x25')](_0x1f23c5[_0xa9a4('0x39')][_0xa9a4('0x25')]);}return _0x372eb5[_0xa9a4('0xe0')](_0x11b1eb);}})[_0xa9a4('0x19')](function(_0x23e3b8){if(_0x23e3b8){return _0x23e3b8?{'count':_0x2b8d60,'rows':_0x23e3b8}:null;}})[_0xa9a4('0x19')](respondWithResult(_0x1334e5,null))[_0xa9a4('0x21')](handleError(_0x1334e5,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 60d817c..95b6ce0 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 _0x33e3=['update','emit','exports','../../mysqldb','SmsAccount','save'];(function(_0x2c9e0c,_0x552e66){var _0x45fc89=function(_0x1b444a){while(--_0x1b444a){_0x2c9e0c['push'](_0x2c9e0c['shift']());}};_0x45fc89(++_0x552e66);}(_0x33e3,0x1e9));var _0x333e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x33e3[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x333e('0x0'))['db'][_0x333e('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x333e('0x2'),'afterUpdate':_0x333e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3babca){return function(_0x3ea31a,_0x36c4a3,_0x47bc77){SmsAccountEvents[_0x333e('0x4')](_0x3babca+':'+_0x3ea31a['id'],_0x3ea31a);SmsAccountEvents[_0x333e('0x4')](_0x3babca,_0x3ea31a);_0x47bc77(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x333e('0x5')]=SmsAccountEvents; \ No newline at end of file +var _0x19a6=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x524bf9,_0x47462b){var _0x550148=function(_0x1589b1){while(--_0x1589b1){_0x524bf9['push'](_0x524bf9['shift']());}};_0x550148(++_0x47462b);}(_0x19a6,0xe6));var _0x619a=function(_0x5ab465,_0x41a84d){_0x5ab465=_0x5ab465-0x0;var _0x56f6bc=_0x19a6[_0x5ab465];return _0x56f6bc;};'use strict';var EventEmitter=require(_0x619a('0x0'));var SmsAccount=require(_0x619a('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x619a('0x2')](0x0);var events={'afterCreate':_0x619a('0x3'),'afterUpdate':_0x619a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4560a1){return function(_0xf43243,_0x55648f,_0x117ec0){SmsAccountEvents[_0x619a('0x5')](_0x4560a1+':'+_0xf43243['id'],_0xf43243);SmsAccountEvents[_0x619a('0x5')](_0x4560a1,_0xf43243);_0x117ec0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x619a('0x6')](e,emitEvent(event));}}module[_0x619a('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index b21ff61..cdb72a1 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 _0x7760=['moment','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts','lodash','api'];(function(_0x880051,_0x451dfc){var _0x4325d1=function(_0x243034){while(--_0x243034){_0x880051['push'](_0x880051['shift']());}};_0x4325d1(++_0x451dfc);}(_0x7760,0x1e2));var _0x0776=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x7760[_0x1147ab];return _0x55cb5a;};'use strict';var _=require(_0x0776('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0776('0x1'));var moment=require(_0x0776('0x2'));var BPromise=require('bluebird');var rp=require(_0x0776('0x3'));var fs=require('fs');var path=require(_0x0776('0x4'));var rimraf=require(_0x0776('0x5'));var config=require(_0x0776('0x6'));var attributes=require(_0x0776('0x7'));module[_0x0776('0x8')]=function(_0x39469a,_0x512cb8){return _0x39469a[_0x0776('0x9')]('SmsAccount',attributes,{'tableName':_0x0776('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb216=['sms_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb216,0xc4));var _0x6b21=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xb216[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require(_0x6b21('0x0'));var logger=require(_0x6b21('0x1'))('api');var moment=require(_0x6b21('0x2'));var BPromise=require(_0x6b21('0x3'));var rp=require(_0x6b21('0x4'));var fs=require('fs');var path=require(_0x6b21('0x5'));var rimraf=require(_0x6b21('0x6'));var config=require(_0x6b21('0x7'));var attributes=require(_0x6b21('0x8'));module[_0x6b21('0x9')]=function(_0x1c6449,_0x38292b){return _0x1c6449[_0x6b21('0xa')](_0x6b21('0xb'),attributes,{'tableName':_0x6b21('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 b4a44fd..3b05c9b 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 _0x7570=['then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7570,0x191));var _0x0757=function(_0x15e10b,_0x3ed403){_0x15e10b=_0x15e10b-0x0;var _0x587126=_0x7570[_0x15e10b];return _0x587126;};'use strict';var _=require(_0x0757('0x0'));var util=require(_0x0757('0x1'));var moment=require('moment');var BPromise=require(_0x0757('0x2'));var rs=require(_0x0757('0x3'));var fs=require('fs');var Redis=require(_0x0757('0x4'));var db=require(_0x0757('0x5'))['db'];var utils=require(_0x0757('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0757('0x7'));var client=jayson[_0x0757('0x8')][_0x0757('0x9')]({'port':0x232a});config[_0x0757('0xa')]=_[_0x0757('0xb')](config['redis'],{'host':_0x0757('0xc'),'port':0x18eb});var socket=require(_0x0757('0xd'))(new Redis(config['redis']));require(_0x0757('0xe'))[_0x0757('0xf')](socket);function respondWithRpcPromise(_0x1c37bd,_0x23619d,_0x424bce){return new BPromise(function(_0x2f6c03,_0xfd9965){return client[_0x0757('0x10')](_0x1c37bd,_0x424bce)[_0x0757('0x11')](function(_0x3472d0){logger[_0x0757('0x12')](_0x0757('0x13'),_0x23619d,'request\x20sent');logger[_0x0757('0x14')](_0x0757('0x15'),_0x23619d,'request\x20sent',JSON[_0x0757('0x16')](_0x3472d0));if(_0x3472d0['error']){if(_0x3472d0[_0x0757('0x17')][_0x0757('0x18')]===0x1f4){logger[_0x0757('0x17')](_0x0757('0x13'),_0x23619d,_0x3472d0['error'][_0x0757('0x19')]);return _0xfd9965(_0x3472d0[_0x0757('0x17')][_0x0757('0x19')]);}logger[_0x0757('0x17')](_0x0757('0x13'),_0x23619d,_0x3472d0[_0x0757('0x17')][_0x0757('0x19')]);return _0x2f6c03(_0x3472d0[_0x0757('0x17')][_0x0757('0x19')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x23619d,_0x0757('0x1a'));_0x2f6c03(_0x3472d0[_0x0757('0x1b')][_0x0757('0x19')]);}})[_0x0757('0x1c')](function(_0x1c4701){logger[_0x0757('0x17')](_0x0757('0x13'),_0x23619d,_0x1c4701);_0xfd9965(_0x1c4701);});});}exports[_0x0757('0x1d')]=function(_0x2e45a6){var _0xc250d2=this;return new Promise(function(_0x22161a,_0x233a41){return db[_0x0757('0x1e')][_0x0757('0x1f')]({'raw':_0x2e45a6[_0x0757('0x20')]?_0x2e45a6[_0x0757('0x20')][_0x0757('0x21')]===undefined?!![]:![]:!![],'where':_0x2e45a6['options']?_0x2e45a6[_0x0757('0x20')]['where']||null:null,'attributes':_0x2e45a6[_0x0757('0x20')]?_0x2e45a6[_0x0757('0x20')][_0x0757('0x22')]||null:null,'include':_0x2e45a6[_0x0757('0x20')]?_0x2e45a6[_0x0757('0x20')][_0x0757('0x23')]?_['map'](_0x2e45a6[_0x0757('0x20')][_0x0757('0x23')],function(_0x5334f2){return{'model':db[_0x5334f2[_0x0757('0x24')]],'as':_0x5334f2['as'],'attributes':_0x5334f2['attributes'],'include':_0x5334f2[_0x0757('0x23')]?_[_0x0757('0x25')](_0x5334f2[_0x0757('0x23')],function(_0x1a0a9e){return{'model':db[_0x1a0a9e[_0x0757('0x24')]],'as':_0x1a0a9e['as'],'attributes':_0x1a0a9e[_0x0757('0x22')],'include':_0x1a0a9e[_0x0757('0x23')]?_[_0x0757('0x25')](_0x1a0a9e[_0x0757('0x23')],function(_0x177727){return{'model':db[_0x177727[_0x0757('0x24')]],'as':_0x177727['as'],'attributes':_0x177727[_0x0757('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x881ab7){logger[_0x0757('0x12')]('ShowSmsAccount',_0x2e45a6);logger['debug'](_0x0757('0x1d'),_0x2e45a6,JSON[_0x0757('0x16')](_0x881ab7));_0x22161a(_0x881ab7);})['catch'](function(_0x5357b1){logger[_0x0757('0x17')]('ShowSmsAccount',_0x5357b1[_0x0757('0x19')],_0x2e45a6);_0x233a41(_0xc250d2['error'](0x1f4,_0x5357b1[_0x0757('0x19')]));});});}; \ No newline at end of file +var _0xd97e=['rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSmsAccount','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x42eabb,_0x1c8ecb){var _0x2d4655=function(_0x4e6550){while(--_0x4e6550){_0x42eabb['push'](_0x42eabb['shift']());}};_0x2d4655(++_0x1c8ecb);}(_0xd97e,0x127));var _0xed97=function(_0x332409,_0x83f394){_0x332409=_0x332409-0x0;var _0xafa14e=_0xd97e[_0x332409];return _0xafa14e;};'use strict';var _=require(_0xed97('0x0'));var util=require(_0xed97('0x1'));var moment=require(_0xed97('0x2'));var BPromise=require(_0xed97('0x3'));var rs=require(_0xed97('0x4'));var fs=require('fs');var Redis=require(_0xed97('0x5'));var db=require(_0xed97('0x6'))['db'];var utils=require(_0xed97('0x7'));var logger=require(_0xed97('0x8'))(_0xed97('0x9'));var config=require(_0xed97('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xed97('0xb')][_0xed97('0xc')]({'port':0x232a});config[_0xed97('0xd')]=_[_0xed97('0xe')](config[_0xed97('0xd')],{'host':_0xed97('0xf'),'port':0x18eb});var socket=require(_0xed97('0x10'))(new Redis(config['redis']));require(_0xed97('0x11'))['register'](socket);function respondWithRpcPromise(_0x117319,_0x2c359e,_0x20006a){return new BPromise(function(_0x15cc96,_0x2bdcaa){return client[_0xed97('0x12')](_0x117319,_0x20006a)[_0xed97('0x13')](function(_0x20e02f){logger[_0xed97('0x14')](_0xed97('0x15'),_0x2c359e,_0xed97('0x16'));logger[_0xed97('0x17')](_0xed97('0x18'),_0x2c359e,_0xed97('0x16'),JSON[_0xed97('0x19')](_0x20e02f));if(_0x20e02f[_0xed97('0x1a')]){if(_0x20e02f[_0xed97('0x1a')][_0xed97('0x1b')]===0x1f4){logger[_0xed97('0x1a')](_0xed97('0x15'),_0x2c359e,_0x20e02f['error'][_0xed97('0x1c')]);return _0x2bdcaa(_0x20e02f[_0xed97('0x1a')][_0xed97('0x1c')]);}logger[_0xed97('0x1a')](_0xed97('0x15'),_0x2c359e,_0x20e02f['error']['message']);return _0x15cc96(_0x20e02f['error'][_0xed97('0x1c')]);}else{logger[_0xed97('0x14')](_0xed97('0x15'),_0x2c359e,_0xed97('0x16'));_0x15cc96(_0x20e02f['result']['message']);}})[_0xed97('0x1d')](function(_0x54b0dc){logger[_0xed97('0x1a')](_0xed97('0x15'),_0x2c359e,_0x54b0dc);_0x2bdcaa(_0x54b0dc);});});}exports[_0xed97('0x1e')]=function(_0x4c3c12){var _0x3d3c7c=this;return new Promise(function(_0x117e98,_0x45e0db){return db['SmsAccount'][_0xed97('0x1f')]({'raw':_0x4c3c12[_0xed97('0x20')]?_0x4c3c12[_0xed97('0x20')][_0xed97('0x21')]===undefined?!![]:![]:!![],'where':_0x4c3c12[_0xed97('0x20')]?_0x4c3c12[_0xed97('0x20')]['where']||null:null,'attributes':_0x4c3c12['options']?_0x4c3c12['options'][_0xed97('0x22')]||null:null,'include':_0x4c3c12[_0xed97('0x20')]?_0x4c3c12[_0xed97('0x20')][_0xed97('0x23')]?_[_0xed97('0x24')](_0x4c3c12['options']['include'],function(_0x4b0ce3){return{'model':db[_0x4b0ce3[_0xed97('0x25')]],'as':_0x4b0ce3['as'],'attributes':_0x4b0ce3[_0xed97('0x22')],'include':_0x4b0ce3[_0xed97('0x23')]?_['map'](_0x4b0ce3[_0xed97('0x23')],function(_0x1190dd){return{'model':db[_0x1190dd[_0xed97('0x25')]],'as':_0x1190dd['as'],'attributes':_0x1190dd[_0xed97('0x22')],'include':_0x1190dd[_0xed97('0x23')]?_['map'](_0x1190dd['include'],function(_0x5745cd){return{'model':db[_0x5745cd['model']],'as':_0x5745cd['as'],'attributes':_0x5745cd[_0xed97('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30b87b){logger[_0xed97('0x14')](_0xed97('0x1e'),_0x4c3c12);logger['debug'](_0xed97('0x1e'),_0x4c3c12,JSON['stringify'](_0x30b87b));_0x117e98(_0x30b87b);})['catch'](function(_0x4c1c21){logger['error'](_0xed97('0x1e'),_0x4c1c21[_0xed97('0x1c')],_0x4c3c12);_0x45e0db(_0x3d3c7c[_0xed97('0x1a')](0x1f4,_0x4c1c21[_0xed97('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 72f05f8..595af56 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 09dda96..1b7a7a7 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x7e992f,_0x3e7785){var _0x162b36=function(_0x2be8d7){while(--_0x2be8d7){_0x7e992f['push'](_0x7e992f['shift']());}};_0x162b36(++_0x3e7785);}(_0x7217,0x19e));var _0x7721=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7217[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x343362,_0x1ce4d9){var _0x4f1572=function(_0xfc60d7){while(--_0xfc60d7){_0x343362['push'](_0x343362['shift']());}};_0x4f1572(++_0x1ce4d9);}(_0x55ca,0x126));var _0xa55c=function(_0x449b54,_0x3776f3){_0x449b54=_0x449b54-0x0;var _0x32d6b9=_0x55ca[_0x449b54];return _0x32d6b9;};'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')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1dc6238..355940e 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 _0x5164=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x36c5d6,_0x36bccb){var _0x153fd2=function(_0x247546){while(--_0x247546){_0x36c5d6['push'](_0x36c5d6['shift']());}};_0x153fd2(++_0x36bccb);}(_0x5164,0x1da));var _0x4516=function(_0x21c930,_0x61331c){_0x21c930=_0x21c930-0x0;var _0x335803=_0x5164[_0x21c930];return _0x335803;};'use strict';var Sequelize=require(_0x4516('0x0'));module[_0x4516('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4516('0x2')],'allowNull':![],'defaultValue':_0x4516('0x3')},'appdata':{'type':Sequelize[_0x4516('0x4')]()},'description':{'type':Sequelize[_0x4516('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4516('0x5')}}; \ No newline at end of file +var _0xc4ba=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x404eed,_0x5390c5){var _0xd45887=function(_0x1ee42b){while(--_0x1ee42b){_0x404eed['push'](_0x404eed['shift']());}};_0xd45887(++_0x5390c5);}(_0xc4ba,0x93));var _0xac4b=function(_0x104116,_0x618e32){_0x104116=_0x104116-0x0;var _0x357573=_0xc4ba[_0x104116];return _0x357573;};'use strict';var Sequelize=require(_0xac4b('0x0'));module[_0xac4b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xac4b('0x2')],'allowNull':![],'defaultValue':_0xac4b('0x3')},'appdata':{'type':Sequelize[_0xac4b('0x4')]()},'description':{'type':Sequelize[_0xac4b('0x2')]},'interval':{'type':Sequelize[_0xac4b('0x2')],'defaultValue':_0xac4b('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 5061734..cfd55d7 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 _0xc871=['rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','include','rows','catch','show','keys','includeAll','find','create','body','params','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','SmsApplication'];(function(_0x3cfd57,_0x537cf5){var _0x527d26=function(_0x37d396){while(--_0x37d396){_0x3cfd57['push'](_0x3cfd57['shift']());}};_0x527d26(++_0x537cf5);}(_0xc871,0x1d5));var _0x1c87=function(_0xa8b178,_0x3c4d19){_0xa8b178=_0xa8b178-0x0;var _0x46d5a6=_0xc871[_0xa8b178];return _0x46d5a6;};'use strict';var emlformat=require(_0x1c87('0x0'));var rimraf=require(_0x1c87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c87('0x2'));var moment=require(_0x1c87('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1c87('0x4'));var util=require(_0x1c87('0x5'));var path=require(_0x1c87('0x6'));var sox=require(_0x1c87('0x7'));var csv=require(_0x1c87('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c87('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1c87('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1c87('0xb'));var toCsv=require(_0x1c87('0x8'));var querystring=require(_0x1c87('0xc'));var Papa=require('papaparse');var Redis=require(_0x1c87('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1c87('0xe'));var as=require(_0x1c87('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c87('0x10'))(_0x1c87('0x11'));var utils=require('../../config/utils');var config=require(_0x1c87('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c87('0x13'))['db'];function respondWithStatusCode(_0x179eee,_0x717cd6){_0x717cd6=_0x717cd6||0xcc;return function(_0x3dff63){if(_0x3dff63){return _0x179eee[_0x1c87('0x14')](_0x717cd6);}return _0x179eee[_0x1c87('0x15')](_0x717cd6)['end']();};}function respondWithResult(_0xda944d,_0x38b228){_0x38b228=_0x38b228||0xc8;return function(_0x3a1dd2){if(_0x3a1dd2){return _0xda944d['status'](_0x38b228)[_0x1c87('0x16')](_0x3a1dd2);}};}function respondWithFilteredResult(_0x3326a8,_0x2b1263){return function(_0x3fd837){if(_0x3fd837){var _0x2d68f9=typeof _0x2b1263[_0x1c87('0x17')]===_0x1c87('0x18')&&typeof _0x2b1263[_0x1c87('0x19')]==='undefined';var _0x90541f=_0x3fd837[_0x1c87('0x1a')];var _0x549c53=_0x2d68f9?0x0:_0x2b1263[_0x1c87('0x17')];var _0x10b2cd=_0x2d68f9?_0x3fd837[_0x1c87('0x1a')]:_0x2b1263[_0x1c87('0x17')]+_0x2b1263[_0x1c87('0x19')];var _0x53628e;if(_0x10b2cd>=_0x90541f){_0x10b2cd=_0x90541f;_0x53628e=0xc8;}else{_0x53628e=0xce;}_0x3326a8[_0x1c87('0x15')](_0x53628e);return _0x3326a8[_0x1c87('0x1b')](_0x1c87('0x1c'),_0x549c53+'-'+_0x10b2cd+'/'+_0x90541f)[_0x1c87('0x16')](_0x3fd837);}return null;};}function patchUpdates(_0x1faedd){return function(_0x4ce27e){try{jsonpatch[_0x1c87('0x1d')](_0x4ce27e,_0x1faedd,!![]);}catch(_0x3d2a04){return BPromise[_0x1c87('0x1e')](_0x3d2a04);}return _0x4ce27e[_0x1c87('0x1f')]();};}function saveUpdates(_0x18bcdb,_0xedca75){return function(_0x3c73ee){if(_0x3c73ee){return _0x3c73ee[_0x1c87('0x20')](_0x18bcdb)[_0x1c87('0x21')](function(_0x26cd16){return _0x26cd16;});}return null;};}function removeEntity(_0x509e2d,_0x73c797){return function(_0x3af242){if(_0x3af242){return _0x3af242[_0x1c87('0x22')]()[_0x1c87('0x21')](function(){_0x509e2d[_0x1c87('0x15')](0xcc)[_0x1c87('0x23')]();});}};}function handleEntityNotFound(_0x14cf12,_0x3ffd2d){return function(_0x255a73){if(!_0x255a73){_0x14cf12['sendStatus'](0x194);}return _0x255a73;};}function handleError(_0xe16410,_0x285355){_0x285355=_0x285355||0x1f4;return function(_0x2a05de){logger[_0x1c87('0x24')](_0x2a05de[_0x1c87('0x25')]);if(_0x2a05de[_0x1c87('0x26')]){delete _0x2a05de[_0x1c87('0x26')];}_0xe16410[_0x1c87('0x15')](_0x285355)['send'](_0x2a05de);};}exports[_0x1c87('0x27')]=function(_0x127e78,_0x4d58c8){var _0x2720c4={},_0x3e384={},_0x2f4d34={'count':0x0,'rows':[]};var _0x53c8b4=_[_0x1c87('0x28')](db[_0x1c87('0x29')][_0x1c87('0x2a')],function(_0x47a510){return{'name':_0x47a510[_0x1c87('0x2b')],'type':_0x47a510[_0x1c87('0x2c')][_0x1c87('0x2d')]};});_0x3e384['model']=_[_0x1c87('0x28')](_0x53c8b4,_0x1c87('0x26'));_0x3e384[_0x1c87('0x2e')]=_['keys'](_0x127e78[_0x1c87('0x2e')]);_0x3e384['filters']=_[_0x1c87('0x2f')](_0x3e384[_0x1c87('0x30')],_0x3e384[_0x1c87('0x2e')]);_0x2720c4[_0x1c87('0x31')]=_[_0x1c87('0x2f')](_0x3e384[_0x1c87('0x30')],qs[_0x1c87('0x32')](_0x127e78[_0x1c87('0x2e')][_0x1c87('0x32')]));_0x2720c4[_0x1c87('0x31')]=_0x2720c4[_0x1c87('0x31')][_0x1c87('0x33')]?_0x2720c4[_0x1c87('0x31')]:_0x3e384[_0x1c87('0x30')];if(!_0x127e78[_0x1c87('0x2e')][_0x1c87('0x34')](_0x1c87('0x35'))){_0x2720c4[_0x1c87('0x19')]=qs['limit'](_0x127e78[_0x1c87('0x2e')][_0x1c87('0x19')]);_0x2720c4[_0x1c87('0x17')]=qs[_0x1c87('0x17')](_0x127e78[_0x1c87('0x2e')][_0x1c87('0x17')]);}_0x2720c4[_0x1c87('0x36')]=qs[_0x1c87('0x37')](_0x127e78[_0x1c87('0x2e')][_0x1c87('0x37')]);_0x2720c4[_0x1c87('0x38')]=qs['filters'](_[_0x1c87('0x39')](_0x127e78['query'],_0x3e384[_0x1c87('0x3a')]),_0x53c8b4);if(_0x127e78['query'][_0x1c87('0x3b')]){_0x2720c4[_0x1c87('0x38')]=_['merge'](_0x2720c4[_0x1c87('0x38')],{'$or':_[_0x1c87('0x28')](_0x53c8b4,function(_0x520fa0){if(_0x520fa0[_0x1c87('0x2c')]!==_0x1c87('0x3c')){var _0x1efe75={};_0x1efe75[_0x520fa0[_0x1c87('0x26')]]={'$like':'%'+_0x127e78[_0x1c87('0x2e')][_0x1c87('0x3b')]+'%'};return _0x1efe75;}})});}_0x2720c4=_[_0x1c87('0x3d')]({},_0x2720c4,_0x127e78[_0x1c87('0x3e')]);var _0x3167e3={'where':_0x2720c4[_0x1c87('0x38')]};return db['SmsApplication'][_0x1c87('0x1a')](_0x3167e3)[_0x1c87('0x21')](function(_0x196470){_0x2f4d34['count']=_0x196470;if(_0x127e78[_0x1c87('0x2e')]['includeAll']){_0x2720c4[_0x1c87('0x3f')]=[{'all':!![]}];}return db[_0x1c87('0x29')]['findAll'](_0x2720c4);})[_0x1c87('0x21')](function(_0x19a4ec){_0x2f4d34[_0x1c87('0x40')]=_0x19a4ec;return _0x2f4d34;})[_0x1c87('0x21')](respondWithFilteredResult(_0x4d58c8,_0x2720c4))[_0x1c87('0x41')](handleError(_0x4d58c8,null));};exports[_0x1c87('0x42')]=function(_0x53c782,_0x25ba66){var _0x133c02={'raw':!![],'where':{'id':_0x53c782['params']['id']}},_0x4a6296={};_0x4a6296['model']=_[_0x1c87('0x43')](db[_0x1c87('0x29')][_0x1c87('0x2a')]);_0x4a6296['query']=_['keys'](_0x53c782['query']);_0x4a6296[_0x1c87('0x3a')]=_[_0x1c87('0x2f')](_0x4a6296[_0x1c87('0x30')],_0x4a6296[_0x1c87('0x2e')]);_0x133c02[_0x1c87('0x31')]=_[_0x1c87('0x2f')](_0x4a6296['model'],qs[_0x1c87('0x32')](_0x53c782[_0x1c87('0x2e')][_0x1c87('0x32')]));_0x133c02[_0x1c87('0x31')]=_0x133c02[_0x1c87('0x31')][_0x1c87('0x33')]?_0x133c02[_0x1c87('0x31')]:_0x4a6296[_0x1c87('0x30')];if(_0x53c782[_0x1c87('0x2e')][_0x1c87('0x44')]){_0x133c02[_0x1c87('0x3f')]=[{'all':!![]}];}_0x133c02=_[_0x1c87('0x3d')]({},_0x133c02,_0x53c782[_0x1c87('0x3e')]);return db['SmsApplication'][_0x1c87('0x45')](_0x133c02)['then'](handleEntityNotFound(_0x25ba66,null))[_0x1c87('0x21')](respondWithResult(_0x25ba66,null))[_0x1c87('0x41')](handleError(_0x25ba66,null));};exports[_0x1c87('0x46')]=function(_0x5a7993,_0x201361){return db[_0x1c87('0x29')][_0x1c87('0x46')](_0x5a7993[_0x1c87('0x47')],{})['then'](respondWithResult(_0x201361,0xc9))[_0x1c87('0x41')](handleError(_0x201361,null));};exports[_0x1c87('0x20')]=function(_0x1e82df,_0x2abcba){if(_0x1e82df[_0x1c87('0x47')]['id']){delete _0x1e82df['body']['id'];}return db[_0x1c87('0x29')][_0x1c87('0x45')]({'where':{'id':_0x1e82df[_0x1c87('0x48')]['id']}})['then'](handleEntityNotFound(_0x2abcba,null))['then'](saveUpdates(_0x1e82df[_0x1c87('0x47')],null))[_0x1c87('0x21')](respondWithResult(_0x2abcba,null))[_0x1c87('0x41')](handleError(_0x2abcba,null));};exports['destroy']=function(_0x566ad9,_0x260963){return db[_0x1c87('0x29')][_0x1c87('0x45')]({'where':{'id':_0x566ad9[_0x1c87('0x48')]['id']}})[_0x1c87('0x21')](handleEntityNotFound(_0x260963,null))[_0x1c87('0x21')](removeEntity(_0x260963,null))[_0x1c87('0x41')](handleError(_0x260963,null));}; \ No newline at end of file +var _0x8e3b=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e3b,0x151));var _0xb8e3=function(_0x5ed652,_0x531731){_0x5ed652=_0x5ed652-0x0;var _0x3c0826=_0x8e3b[_0x5ed652];return _0x3c0826;};'use strict';var emlformat=require(_0xb8e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8e3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb8e3('0x2'));var BPromise=require(_0xb8e3('0x3'));var Mustache=require(_0xb8e3('0x4'));var util=require(_0xb8e3('0x5'));var path=require(_0xb8e3('0x6'));var sox=require(_0xb8e3('0x7'));var csv=require(_0xb8e3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8e3('0x9'));var _=require(_0xb8e3('0xa'));var squel=require(_0xb8e3('0xb'));var crypto=require(_0xb8e3('0xc'));var jsforce=require(_0xb8e3('0xd'));var deskjs=require(_0xb8e3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb8e3('0xf'));var Papa=require(_0xb8e3('0x10'));var Redis=require(_0xb8e3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb8e3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb8e3('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8e3('0x14'))['db'];function respondWithStatusCode(_0x3c4c8e,_0x5052d3){_0x5052d3=_0x5052d3||0xcc;return function(_0xca3fd7){if(_0xca3fd7){return _0x3c4c8e[_0xb8e3('0x15')](_0x5052d3);}return _0x3c4c8e['status'](_0x5052d3)[_0xb8e3('0x16')]();};}function respondWithResult(_0x2fb7e8,_0x33ff12){_0x33ff12=_0x33ff12||0xc8;return function(_0x43ef74){if(_0x43ef74){return _0x2fb7e8[_0xb8e3('0x17')](_0x33ff12)[_0xb8e3('0x18')](_0x43ef74);}};}function respondWithFilteredResult(_0x57e93c,_0xf5e285){return function(_0x135062){if(_0x135062){var _0x5480e1=typeof _0xf5e285[_0xb8e3('0x19')]==='undefined'&&typeof _0xf5e285[_0xb8e3('0x1a')]===_0xb8e3('0x1b');var _0x396afd=_0x135062[_0xb8e3('0x1c')];var _0x1a92fd=_0x5480e1?0x0:_0xf5e285[_0xb8e3('0x19')];var _0x4c7d5c=_0x5480e1?_0x135062[_0xb8e3('0x1c')]:_0xf5e285[_0xb8e3('0x19')]+_0xf5e285[_0xb8e3('0x1a')];var _0x47afaf;if(_0x4c7d5c>=_0x396afd){_0x4c7d5c=_0x396afd;_0x47afaf=0xc8;}else{_0x47afaf=0xce;}_0x57e93c[_0xb8e3('0x17')](_0x47afaf);return _0x57e93c[_0xb8e3('0x1d')](_0xb8e3('0x1e'),_0x1a92fd+'-'+_0x4c7d5c+'/'+_0x396afd)[_0xb8e3('0x18')](_0x135062);}return null;};}function patchUpdates(_0x3295bb){return function(_0xae60b9){try{jsonpatch[_0xb8e3('0x1f')](_0xae60b9,_0x3295bb,!![]);}catch(_0x3ec3af){return BPromise[_0xb8e3('0x20')](_0x3ec3af);}return _0xae60b9['save']();};}function saveUpdates(_0x1cd174,_0x37e1ee){return function(_0x271734){if(_0x271734){return _0x271734[_0xb8e3('0x21')](_0x1cd174)[_0xb8e3('0x22')](function(_0x16310c){return _0x16310c;});}return null;};}function removeEntity(_0x4397be,_0x4ecc8b){return function(_0x35197a){if(_0x35197a){return _0x35197a[_0xb8e3('0x23')]()[_0xb8e3('0x22')](function(){_0x4397be[_0xb8e3('0x17')](0xcc)[_0xb8e3('0x16')]();});}};}function handleEntityNotFound(_0x4e02ec,_0x3149dd){return function(_0x93f7cc){if(!_0x93f7cc){_0x4e02ec[_0xb8e3('0x15')](0x194);}return _0x93f7cc;};}function handleError(_0x14cffa,_0x57f6b8){_0x57f6b8=_0x57f6b8||0x1f4;return function(_0x3a200f){logger[_0xb8e3('0x24')](_0x3a200f[_0xb8e3('0x25')]);if(_0x3a200f[_0xb8e3('0x26')]){delete _0x3a200f['name'];}_0x14cffa[_0xb8e3('0x17')](_0x57f6b8)[_0xb8e3('0x27')](_0x3a200f);};}exports[_0xb8e3('0x28')]=function(_0x569b3e,_0x45a321){var _0x18ce4d={},_0x340e03={},_0x50ed96={'count':0x0,'rows':[]};var _0x4db37b=_[_0xb8e3('0x29')](db[_0xb8e3('0x2a')][_0xb8e3('0x2b')],function(_0x4d2fd4){return{'name':_0x4d2fd4[_0xb8e3('0x2c')],'type':_0x4d2fd4[_0xb8e3('0x2d')][_0xb8e3('0x2e')]};});_0x340e03[_0xb8e3('0x2f')]=_[_0xb8e3('0x29')](_0x4db37b,_0xb8e3('0x26'));_0x340e03[_0xb8e3('0x30')]=_[_0xb8e3('0x31')](_0x569b3e[_0xb8e3('0x30')]);_0x340e03[_0xb8e3('0x32')]=_[_0xb8e3('0x33')](_0x340e03[_0xb8e3('0x2f')],_0x340e03[_0xb8e3('0x30')]);_0x18ce4d[_0xb8e3('0x34')]=_[_0xb8e3('0x33')](_0x340e03['model'],qs[_0xb8e3('0x35')](_0x569b3e[_0xb8e3('0x30')][_0xb8e3('0x35')]));_0x18ce4d[_0xb8e3('0x34')]=_0x18ce4d[_0xb8e3('0x34')][_0xb8e3('0x36')]?_0x18ce4d[_0xb8e3('0x34')]:_0x340e03[_0xb8e3('0x2f')];if(!_0x569b3e[_0xb8e3('0x30')]['hasOwnProperty']('nolimit')){_0x18ce4d[_0xb8e3('0x1a')]=qs[_0xb8e3('0x1a')](_0x569b3e[_0xb8e3('0x30')][_0xb8e3('0x1a')]);_0x18ce4d[_0xb8e3('0x19')]=qs[_0xb8e3('0x19')](_0x569b3e[_0xb8e3('0x30')][_0xb8e3('0x19')]);}_0x18ce4d['order']=qs[_0xb8e3('0x37')](_0x569b3e[_0xb8e3('0x30')][_0xb8e3('0x37')]);_0x18ce4d[_0xb8e3('0x38')]=qs[_0xb8e3('0x32')](_['pick'](_0x569b3e[_0xb8e3('0x30')],_0x340e03[_0xb8e3('0x32')]),_0x4db37b);if(_0x569b3e['query'][_0xb8e3('0x39')]){_0x18ce4d[_0xb8e3('0x38')]=_[_0xb8e3('0x3a')](_0x18ce4d[_0xb8e3('0x38')],{'$or':_[_0xb8e3('0x29')](_0x4db37b,function(_0x28c778){if(_0x28c778[_0xb8e3('0x2d')]!=='VIRTUAL'){var _0x420e0a={};_0x420e0a[_0x28c778[_0xb8e3('0x26')]]={'$like':'%'+_0x569b3e[_0xb8e3('0x30')][_0xb8e3('0x39')]+'%'};return _0x420e0a;}})});}_0x18ce4d=_[_0xb8e3('0x3a')]({},_0x18ce4d,_0x569b3e['options']);var _0x5766dc={'where':_0x18ce4d[_0xb8e3('0x38')]};return db[_0xb8e3('0x2a')][_0xb8e3('0x1c')](_0x5766dc)['then'](function(_0x486bf9){_0x50ed96['count']=_0x486bf9;if(_0x569b3e['query'][_0xb8e3('0x3b')]){_0x18ce4d[_0xb8e3('0x3c')]=[{'all':!![]}];}return db[_0xb8e3('0x2a')][_0xb8e3('0x3d')](_0x18ce4d);})[_0xb8e3('0x22')](function(_0x322ca2){_0x50ed96[_0xb8e3('0x3e')]=_0x322ca2;return _0x50ed96;})['then'](respondWithFilteredResult(_0x45a321,_0x18ce4d))[_0xb8e3('0x3f')](handleError(_0x45a321,null));};exports[_0xb8e3('0x40')]=function(_0x4bd1c8,_0x2bbc33){var _0x37cd88={'raw':!![],'where':{'id':_0x4bd1c8[_0xb8e3('0x41')]['id']}},_0x2139ec={};_0x2139ec[_0xb8e3('0x2f')]=_[_0xb8e3('0x31')](db[_0xb8e3('0x2a')][_0xb8e3('0x2b')]);_0x2139ec[_0xb8e3('0x30')]=_[_0xb8e3('0x31')](_0x4bd1c8[_0xb8e3('0x30')]);_0x2139ec[_0xb8e3('0x32')]=_[_0xb8e3('0x33')](_0x2139ec[_0xb8e3('0x2f')],_0x2139ec[_0xb8e3('0x30')]);_0x37cd88['attributes']=_['intersection'](_0x2139ec[_0xb8e3('0x2f')],qs[_0xb8e3('0x35')](_0x4bd1c8[_0xb8e3('0x30')]['fields']));_0x37cd88[_0xb8e3('0x34')]=_0x37cd88[_0xb8e3('0x34')][_0xb8e3('0x36')]?_0x37cd88['attributes']:_0x2139ec[_0xb8e3('0x2f')];if(_0x4bd1c8[_0xb8e3('0x30')][_0xb8e3('0x3b')]){_0x37cd88[_0xb8e3('0x3c')]=[{'all':!![]}];}_0x37cd88=_['merge']({},_0x37cd88,_0x4bd1c8[_0xb8e3('0x42')]);return db[_0xb8e3('0x2a')][_0xb8e3('0x43')](_0x37cd88)[_0xb8e3('0x22')](handleEntityNotFound(_0x2bbc33,null))[_0xb8e3('0x22')](respondWithResult(_0x2bbc33,null))[_0xb8e3('0x3f')](handleError(_0x2bbc33,null));};exports[_0xb8e3('0x44')]=function(_0x409b7a,_0x3f6c82){return db[_0xb8e3('0x2a')][_0xb8e3('0x44')](_0x409b7a['body'],{})['then'](respondWithResult(_0x3f6c82,0xc9))[_0xb8e3('0x3f')](handleError(_0x3f6c82,null));};exports['update']=function(_0x3ed372,_0x9e568f){if(_0x3ed372[_0xb8e3('0x45')]['id']){delete _0x3ed372[_0xb8e3('0x45')]['id'];}return db[_0xb8e3('0x2a')]['find']({'where':{'id':_0x3ed372[_0xb8e3('0x41')]['id']}})['then'](handleEntityNotFound(_0x9e568f,null))[_0xb8e3('0x22')](saveUpdates(_0x3ed372[_0xb8e3('0x45')],null))[_0xb8e3('0x22')](respondWithResult(_0x9e568f,null))[_0xb8e3('0x3f')](handleError(_0x9e568f,null));};exports[_0xb8e3('0x23')]=function(_0x38df9f,_0x47a428){return db[_0xb8e3('0x2a')][_0xb8e3('0x43')]({'where':{'id':_0x38df9f[_0xb8e3('0x41')]['id']}})[_0xb8e3('0x22')](handleEntityNotFound(_0x47a428,null))['then'](removeEntity(_0x47a428,null))[_0xb8e3('0x3f')](handleError(_0x47a428,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 8478a6a..f85c3c2 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 _0x91f8=['define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','exports'];(function(_0x31c480,_0x13f64a){var _0x3687ce=function(_0x46fbc0){while(--_0x46fbc0){_0x31c480['push'](_0x31c480['shift']());}};_0x3687ce(++_0x13f64a);}(_0x91f8,0x13f));var _0x891f=function(_0x435b2f,_0x4c44da){_0x435b2f=_0x435b2f-0x0;var _0x181648=_0x91f8[_0x435b2f];return _0x181648;};'use strict';var _=require(_0x891f('0x0'));var util=require(_0x891f('0x1'));var logger=require(_0x891f('0x2'))(_0x891f('0x3'));var moment=require(_0x891f('0x4'));var BPromise=require(_0x891f('0x5'));var rp=require(_0x891f('0x6'));var fs=require('fs');var path=require(_0x891f('0x7'));var rimraf=require('rimraf');var config=require(_0x891f('0x8'));var attributes=require(_0x891f('0x9'));module[_0x891f('0xa')]=function(_0x892594,_0x59a2e4){return _0x892594[_0x891f('0xb')]('SmsApplication',attributes,{'tableName':_0x891f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x891f('0xd'),'collate':_0x891f('0xe')});}; \ No newline at end of file +var _0xf352=['../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x29975a,_0x2ca253){var _0x41bcac=function(_0x4023ba){while(--_0x4023ba){_0x29975a['push'](_0x29975a['shift']());}};_0x41bcac(++_0x2ca253);}(_0xf352,0x1ac));var _0x2f35=function(_0x2b4ffc,_0x4d4e33){_0x2b4ffc=_0x2b4ffc-0x0;var _0x402eea=_0xf352[_0x2b4ffc];return _0x402eea;};'use strict';var _=require(_0x2f35('0x0'));var util=require(_0x2f35('0x1'));var logger=require(_0x2f35('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2f35('0x3'));var rp=require(_0x2f35('0x4'));var fs=require('fs');var path=require(_0x2f35('0x5'));var rimraf=require(_0x2f35('0x6'));var config=require(_0x2f35('0x7'));var attributes=require(_0x2f35('0x8'));module[_0x2f35('0x9')]=function(_0x25308e,_0x3bea5a){return _0x25308e[_0x2f35('0xa')](_0x2f35('0xb'),attributes,{'tableName':_0x2f35('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f35('0xd'),'collate':_0x2f35('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 54f4065..84fb743 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 _0x61d0=['http','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x29ccaf,_0x2f2df3){var _0x2b0431=function(_0xb1bbd4){while(--_0xb1bbd4){_0x29ccaf['push'](_0x29ccaf['shift']());}};_0x2b0431(++_0x2f2df3);}(_0x61d0,0x187));var _0x061d=function(_0x2df4cc,_0x1233c6){_0x2df4cc=_0x2df4cc-0x0;var _0x40af8d=_0x61d0[_0x2df4cc];return _0x40af8d;};'use strict';var _=require(_0x061d('0x0'));var util=require('util');var moment=require(_0x061d('0x1'));var BPromise=require(_0x061d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x061d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x061d('0x4'));var logger=require(_0x061d('0x5'))('rpc');var config=require(_0x061d('0x6'));var jayson=require(_0x061d('0x7'));var client=jayson[_0x061d('0x8')][_0x061d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1edb0c,_0x476cbf,_0x362bdd){return new BPromise(function(_0x572b0e,_0x4b6606){return client['request'](_0x1edb0c,_0x362bdd)[_0x061d('0xa')](function(_0x5d5a4b){logger[_0x061d('0xb')](_0x061d('0xc'),_0x476cbf,'request\x20sent');logger[_0x061d('0xd')](_0x061d('0xe'),_0x476cbf,_0x061d('0xf'),JSON[_0x061d('0x10')](_0x5d5a4b));if(_0x5d5a4b[_0x061d('0x11')]){if(_0x5d5a4b[_0x061d('0x11')][_0x061d('0x12')]===0x1f4){logger['error'](_0x061d('0xc'),_0x476cbf,_0x5d5a4b[_0x061d('0x11')][_0x061d('0x13')]);return _0x4b6606(_0x5d5a4b[_0x061d('0x11')][_0x061d('0x13')]);}logger[_0x061d('0x11')](_0x061d('0xc'),_0x476cbf,_0x5d5a4b[_0x061d('0x11')][_0x061d('0x13')]);return _0x572b0e(_0x5d5a4b[_0x061d('0x11')]['message']);}else{logger[_0x061d('0xb')](_0x061d('0xc'),_0x476cbf,_0x061d('0xf'));_0x572b0e(_0x5d5a4b['result'][_0x061d('0x13')]);}})['catch'](function(_0x571fa8){logger[_0x061d('0x11')](_0x061d('0xc'),_0x476cbf,_0x571fa8);_0x4b6606(_0x571fa8);});});} \ No newline at end of file +var _0x390a=['jayson/promise','client','request','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x343037,_0x42614f){var _0x373734=function(_0x391364){while(--_0x391364){_0x343037['push'](_0x343037['shift']());}};_0x373734(++_0x42614f);}(_0x390a,0xc9));var _0xa390=function(_0x2a8fe7,_0x50e959){_0x2a8fe7=_0x2a8fe7-0x0;var _0x267c6a=_0x390a[_0x2a8fe7];return _0x267c6a;};'use strict';var _=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var moment=require(_0xa390('0x2'));var BPromise=require(_0xa390('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa390('0x4'));var db=require(_0xa390('0x5'))['db'];var utils=require(_0xa390('0x6'));var logger=require(_0xa390('0x7'))('rpc');var config=require(_0xa390('0x8'));var jayson=require(_0xa390('0x9'));var client=jayson[_0xa390('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d49cc,_0x1f9de0,_0x53bfb4){return new BPromise(function(_0x492418,_0xc8cd85){return client[_0xa390('0xb')](_0x2d49cc,_0x53bfb4)[_0xa390('0xc')](function(_0x226003){logger[_0xa390('0xd')]('SmsApplication,\x20%s,\x20%s',_0x1f9de0,'request\x20sent');logger[_0xa390('0xe')](_0xa390('0xf'),_0x1f9de0,_0xa390('0x10'),JSON['stringify'](_0x226003));if(_0x226003[_0xa390('0x11')]){if(_0x226003[_0xa390('0x11')]['code']===0x1f4){logger[_0xa390('0x11')](_0xa390('0x12'),_0x1f9de0,_0x226003['error']['message']);return _0xc8cd85(_0x226003[_0xa390('0x11')][_0xa390('0x13')]);}logger['error'](_0xa390('0x12'),_0x1f9de0,_0x226003['error']['message']);return _0x492418(_0x226003['error'][_0xa390('0x13')]);}else{logger['info'](_0xa390('0x12'),_0x1f9de0,_0xa390('0x10'));_0x492418(_0x226003['result'][_0xa390('0x13')]);}})[_0xa390('0x14')](function(_0x59d609){logger[_0xa390('0x11')]('SmsApplication,\x20%s,\x20%s',_0x1f9de0,_0x59d609);_0xc8cd85(_0x59d609);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 898d1be..1c49481 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 _0x4fc2=['removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy'];(function(_0x477db7,_0xaab0bd){var _0x46963c=function(_0x22470c){while(--_0x22470c){_0x477db7['push'](_0x477db7['shift']());}};_0x46963c(++_0xaab0bd);}(_0x4fc2,0x111));var _0x24fc=function(_0x329cde,_0x1d23b7){_0x329cde=_0x329cde-0x0;var _0x29cb1c=_0x4fc2[_0x329cde];return _0x29cb1c;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['show']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['post']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x13')]);router['post'](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0x16'),auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x18')),controller[_0x24fc('0x19')]);router[_0x24fc('0x1a')]('/:id',auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x1b')),controller[_0x24fc('0x1c')]);router[_0x24fc('0x1d')](_0x24fc('0xe'),auth['isAuthenticated'](),interaction[_0x24fc('0x1e')](_0x24fc('0x17'),_0x24fc('0x1f')),controller[_0x24fc('0x20')]);router['delete'](_0x24fc('0x16'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x21')]);module['exports']=router; \ No newline at end of file +var _0x3423=['/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0x9')](_0x3342('0xe'),auth[_0x3342('0xa')](),controller['show']);router['get'](_0x3342('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x3342('0xa')](),controller[_0x3342('0x10')]);router['post']('/',auth[_0x3342('0xa')](),controller['create']);router[_0x3342('0x11')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x11')](_0x3342('0x13'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x16')),controller['addTags']);router[_0x3342('0x17')](_0x3342('0xe'),auth['isAuthenticated'](),interaction[_0x3342('0x14')](_0x3342('0x15'),'smsinteraction:update'),controller['update']);router[_0x3342('0x18')](_0x3342('0xe'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x19')),controller[_0x3342('0x1a')]);router[_0x3342('0x18')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x1b')]);module[_0x3342('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 2ecff50..c0567fe 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 _0xf682=['BOOLEAN','STRING','ENUM','out','DATE','INTEGER','sequelize','moment','exports'];(function(_0xd8a8af,_0x1e93f0){var _0x5b7278=function(_0x458800){while(--_0x458800){_0xd8a8af['push'](_0xd8a8af['shift']());}};_0x5b7278(++_0x1e93f0);}(_0xf682,0x12f));var _0x2f68=function(_0xc94dce,_0x375f40){_0xc94dce=_0xc94dce-0x0;var _0x586b74=_0xf682[_0xc94dce];return _0x586b74;};'use strict';var Sequelize=require(_0x2f68('0x0'));var moment=require(_0x2f68('0x1'));module[_0x2f68('0x2')]={'closed':{'type':Sequelize[_0x2f68('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2f68('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2f68('0x4')]},'note':{'type':Sequelize[_0x2f68('0x4')]},'phone':{'type':Sequelize[_0x2f68('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2f68('0x5')]('in',_0x2f68('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2f68('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x2f68('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2f68('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2f68('0x8')]}}; \ No newline at end of file +var _0x9158=['exports','DATE','STRING','ENUM','out','BOOLEAN','sequelize','moment'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0x9158,0x16e));var _0x8915=function(_0x195054,_0x1bef65){_0x195054=_0x195054-0x0;var _0x308cbe=_0x9158[_0x195054];return _0x308cbe;};'use strict';var Sequelize=require(_0x8915('0x0'));var moment=require(_0x8915('0x1'));module[_0x8915('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8915('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8915('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8915('0x4')]},'read1stAt':{'type':Sequelize[_0x8915('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8915('0x5')]('in',_0x8915('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8915('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8915('0x5')]('in',_0x8915('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8915('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 3dc4697..5cdbeb8 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 _0xfd87=['createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','key','getOptions','findAll','sms','query','catch','show','params','keys','filters','intersection','model','attributes','fields','length','merge','options','create','body','find','describe','addMessage','SmsMessage','omit','ids','getMessages','nolimit','sort','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','files','tmp','transcript-%d-%s.zip','User','push','CmContact','firstName','Messages','direction','secret','Account','Owner','fullname','get','Sms','N.A.','createdAt','closed','closedAt','disposition','out','Contact','lastName','read','renderFile','root','server','views','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x7fd8('0x0'));var zipdir=require(_0x7fd8('0x1'));var moment=require(_0x7fd8('0x2'));var BPromise=require(_0x7fd8('0x3'));var util=require(_0x7fd8('0x4'));var path=require(_0x7fd8('0x5'));var ejs=require(_0x7fd8('0x6'));var fs=require('fs');var _=require(_0x7fd8('0x7'));var Redis=require(_0x7fd8('0x8'));var interaction=require(_0x7fd8('0x9'));var qs=require(_0x7fd8('0xa'));var pdf=require('../../components/export/pdf');var logger=require(_0x7fd8('0xb'))(_0x7fd8('0xc'));var config=require('../../config/environment');var db=require(_0x7fd8('0xd'))['db'];config[_0x7fd8('0xe')]=_[_0x7fd8('0xf')](config[_0x7fd8('0xe')],{'host':_0x7fd8('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fd8('0xe')]));require(_0x7fd8('0x11'))[_0x7fd8('0x12')](socket);function respondWithStatusCode(_0x596d03,_0x5486fc){_0x5486fc=_0x5486fc||0xcc;return function(_0x4948d0){if(_0x4948d0){return _0x596d03[_0x7fd8('0x13')](_0x5486fc);}return _0x596d03['status'](_0x5486fc)[_0x7fd8('0x14')]();};}function respondWithResult(_0x1a2d5d,_0x125628){_0x125628=_0x125628||0xc8;return function(_0x566901){if(_0x566901){return _0x1a2d5d[_0x7fd8('0x15')](_0x125628)[_0x7fd8('0x16')](_0x566901);}};}function respondWithFilteredResult(_0xe84aa7,_0x9e50da){return function(_0x20d1c5){if(_0x20d1c5){var _0x5b7061=typeof _0x9e50da[_0x7fd8('0x17')]===_0x7fd8('0x18')&&typeof _0x9e50da[_0x7fd8('0x19')]===_0x7fd8('0x18');var _0x250a02=_0x20d1c5[_0x7fd8('0x1a')];var _0x1a4a52=_0x5b7061?0x0:_0x9e50da[_0x7fd8('0x17')];var _0x2a8818=_0x5b7061?_0x20d1c5[_0x7fd8('0x1a')]:_0x9e50da[_0x7fd8('0x17')]+_0x9e50da['limit'];var _0x5de005;if(_0x2a8818>=_0x250a02){_0x2a8818=_0x250a02;_0x5de005=0xc8;}else{_0x5de005=0xce;}_0xe84aa7['status'](_0x5de005);return _0xe84aa7[_0x7fd8('0x1b')](_0x7fd8('0x1c'),_0x1a4a52+'-'+_0x2a8818+'/'+_0x250a02)['json'](_0x20d1c5);}return null;};}function saveUpdates(_0x39e301){return function(_0xb6f53b){if(_0xb6f53b){return _0xb6f53b[_0x7fd8('0x1d')](_0x39e301)[_0x7fd8('0x1e')](function(_0x3ab724){return _0x3ab724;});}return null;};}function removeEntity(_0xa440a4){return function(_0x2edf31){if(_0x2edf31){return _0x2edf31[_0x7fd8('0x1f')]()['then'](function(){_0xa440a4[_0x7fd8('0x15')](0xcc)[_0x7fd8('0x14')]();});}};}function handleEntityNotFound(_0x223e62){return function(_0x13417d){if(!_0x13417d){_0x223e62[_0x7fd8('0x13')](0x194);}return _0x13417d;};}function handleError(_0x7d1205,_0x4f8563){_0x4f8563=_0x4f8563||0x1f4;return function(_0xecd3f3){logger[_0x7fd8('0x20')](_0xecd3f3[_0x7fd8('0x21')]);if(_0xecd3f3[_0x7fd8('0x22')]){delete _0xecd3f3['name'];}_0x7d1205[_0x7fd8('0x15')](_0x4f8563)[_0x7fd8('0x23')](_0xecd3f3);};}exports[_0x7fd8('0x24')]=function(_0x33ab3d,_0x561dd1){var _0x49f6cf={};var _0x54b7f0=_[_0x7fd8('0x25')](db[_0x7fd8('0x26')][_0x7fd8('0x27')],function(_0xd8168f){return{'name':_0xd8168f[_0x7fd8('0x28')],'type':_0xd8168f['type'][_0x7fd8('0x29')]};});_0x49f6cf=qs[_0x7fd8('0x2a')](_0x54b7f0,_0x33ab3d);return interaction[_0x7fd8('0x2b')](_0x7fd8('0x2c'),_0x33ab3d[_0x7fd8('0x2d')],_0x33ab3d['user'],_0x49f6cf,_0x54b7f0)['then'](respondWithFilteredResult(_0x561dd1,_0x49f6cf))[_0x7fd8('0x2e')](handleError(_0x561dd1,null));};exports[_0x7fd8('0x2f')]=function(_0x3919b1,_0x4319b8){var _0x573ed0={'raw':![],'where':{'id':_0x3919b1[_0x7fd8('0x30')]['id']}},_0x4fc63a={};_0x4fc63a['model']=_[_0x7fd8('0x31')](db[_0x7fd8('0x26')][_0x7fd8('0x27')]);_0x4fc63a['query']=_[_0x7fd8('0x31')](_0x3919b1['query']);_0x4fc63a[_0x7fd8('0x32')]=_[_0x7fd8('0x33')](_0x4fc63a[_0x7fd8('0x34')],_0x4fc63a[_0x7fd8('0x2d')]);_0x573ed0[_0x7fd8('0x35')]=_[_0x7fd8('0x33')](_0x4fc63a[_0x7fd8('0x34')],qs['fields'](_0x3919b1[_0x7fd8('0x2d')][_0x7fd8('0x36')]));_0x573ed0[_0x7fd8('0x35')]=_0x573ed0[_0x7fd8('0x35')][_0x7fd8('0x37')]?_0x573ed0[_0x7fd8('0x35')]:_0x4fc63a[_0x7fd8('0x34')];if(_0x3919b1[_0x7fd8('0x2d')]['includeAll']){_0x573ed0['include']=[{'all':!![]}];}_0x573ed0=_[_0x7fd8('0x38')]({},_0x573ed0,_0x3919b1[_0x7fd8('0x39')]);return db[_0x7fd8('0x26')]['find'](_0x573ed0)[_0x7fd8('0x1e')](handleEntityNotFound(_0x4319b8,null))['then'](respondWithResult(_0x4319b8,null))['catch'](handleError(_0x4319b8,null));};exports[_0x7fd8('0x3a')]=function(_0x3cb612,_0x298dd6){return db[_0x7fd8('0x26')][_0x7fd8('0x3a')](_0x3cb612[_0x7fd8('0x3b')],{})[_0x7fd8('0x1e')](respondWithResult(_0x298dd6,0xc9))[_0x7fd8('0x2e')](handleError(_0x298dd6,null));};exports['update']=function(_0x3766a0,_0x50acd8){if(_0x3766a0['body']['id']){delete _0x3766a0[_0x7fd8('0x3b')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x3766a0['params']['id']}})[_0x7fd8('0x1e')](handleEntityNotFound(_0x50acd8,null))[_0x7fd8('0x1e')](saveUpdates(_0x3766a0['body'],null))[_0x7fd8('0x1e')](respondWithResult(_0x50acd8,null))[_0x7fd8('0x2e')](handleError(_0x50acd8,null));};exports[_0x7fd8('0x1f')]=function(_0x5d8d3d,_0x5b8803){return db['SmsInteraction'][_0x7fd8('0x3c')]({'where':{'id':_0x5d8d3d[_0x7fd8('0x30')]['id']}})[_0x7fd8('0x1e')](handleEntityNotFound(_0x5b8803,null))[_0x7fd8('0x1e')](removeEntity(_0x5b8803,null))[_0x7fd8('0x2e')](handleError(_0x5b8803,null));};exports[_0x7fd8('0x3d')]=function(_0x2b5abb,_0x501f59){return db['SmsInteraction']['describe']()[_0x7fd8('0x1e')](respondWithResult(_0x501f59,null))[_0x7fd8('0x2e')](handleError(_0x501f59,null));};exports[_0x7fd8('0x3e')]=function(_0x558874,_0x313df5){return db[_0x7fd8('0x3f')][_0x7fd8('0x3c')]({'where':{'id':_0x558874[_0x7fd8('0x30')]['id']}})['then'](handleEntityNotFound(_0x313df5,null))[_0x7fd8('0x1e')](function(_0x1225ec){if(_0x1225ec){return _0x1225ec['addMessage'](_0x558874[_0x7fd8('0x3b')]['ids'],_[_0x7fd8('0x40')](_0x558874[_0x7fd8('0x3b')],[_0x7fd8('0x41'),'id'])||{});}})[_0x7fd8('0x1e')](respondWithResult(_0x313df5,null))['catch'](handleError(_0x313df5,null));};exports[_0x7fd8('0x42')]=function(_0x34ffb6,_0x2b7128){var _0x3e0efd={'raw':![],'where':{}};var _0x365e6f={};var _0x26eb1c={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x34ffb6['params']['id']}})[_0x7fd8('0x1e')](handleEntityNotFound(_0x2b7128,null))[_0x7fd8('0x1e')](function(_0x5364fe){if(_0x5364fe){_0x365e6f['model']=_[_0x7fd8('0x31')](db[_0x7fd8('0x3f')]['rawAttributes']);_0x365e6f[_0x7fd8('0x2d')]=_[_0x7fd8('0x31')](_0x34ffb6[_0x7fd8('0x2d')]);_0x365e6f['filters']=_[_0x7fd8('0x33')](_0x365e6f[_0x7fd8('0x34')],_0x365e6f['query']);_0x3e0efd[_0x7fd8('0x35')]=_['intersection'](_0x365e6f[_0x7fd8('0x34')],qs[_0x7fd8('0x36')](_0x34ffb6[_0x7fd8('0x2d')][_0x7fd8('0x36')]));_0x3e0efd[_0x7fd8('0x35')]=_0x3e0efd[_0x7fd8('0x35')][_0x7fd8('0x37')]?_0x3e0efd[_0x7fd8('0x35')]:_0x365e6f['model'];if(!_0x34ffb6[_0x7fd8('0x2d')]['hasOwnProperty'](_0x7fd8('0x43'))){_0x3e0efd[_0x7fd8('0x19')]=qs['limit'](_0x34ffb6[_0x7fd8('0x2d')][_0x7fd8('0x19')]);_0x3e0efd['offset']=qs['offset'](_0x34ffb6['query'][_0x7fd8('0x17')]);}_0x3e0efd['order']=qs[_0x7fd8('0x44')](_0x34ffb6[_0x7fd8('0x2d')][_0x7fd8('0x44')]);_0x3e0efd[_0x7fd8('0x45')]=qs[_0x7fd8('0x32')](_['pick'](_0x34ffb6['query'],_0x365e6f[_0x7fd8('0x32')]));_0x3e0efd[_0x7fd8('0x45')][_0x7fd8('0x46')]=_0x5364fe['id'];if(_0x34ffb6[_0x7fd8('0x2d')]['filter']){_0x3e0efd[_0x7fd8('0x45')]=_['merge'](_0x3e0efd[_0x7fd8('0x45')],{'$or':_[_0x7fd8('0x25')](_0x3e0efd[_0x7fd8('0x35')],function(_0x1a6a03){var _0x32160c={};_0x32160c[_0x1a6a03]={'$like':'%'+_0x34ffb6[_0x7fd8('0x2d')][_0x7fd8('0x47')]+'%'};return _0x32160c;})});}if(_0x34ffb6[_0x7fd8('0x2d')][_0x7fd8('0x48')]){var _0x20f460=_0x34ffb6[_0x7fd8('0x2d')]['$gte'][_0x7fd8('0x49')](',');var _0x28b0ba={};_0x28b0ba[_0x20f460[0x0]]={'$gte':moment(_0x20f460[0x1])[_0x7fd8('0x4a')](_0x7fd8('0x4b'))};_0x3e0efd[_0x7fd8('0x45')]=_['merge'](_0x3e0efd['where'],_0x28b0ba);}_0x3e0efd=_['merge']({},_0x3e0efd,_0x34ffb6[_0x7fd8('0x39')]);return db[_0x7fd8('0x3f')][_0x7fd8('0x1a')]({'where':_0x3e0efd[_0x7fd8('0x45')]})[_0x7fd8('0x1e')](function(_0x1a6d14){_0x26eb1c[_0x7fd8('0x1a')]=_0x1a6d14;if(_0x34ffb6['query']['includeAll']){_0x3e0efd[_0x7fd8('0x4c')]=[{'all':!![]}];}return db['SmsMessage'][_0x7fd8('0x2b')](_0x3e0efd);})[_0x7fd8('0x1e')](function(_0x5ed4ff){_0x26eb1c[_0x7fd8('0x4d')]=_0x5ed4ff;return _0x26eb1c;});}})[_0x7fd8('0x1e')](respondWithFilteredResult(_0x2b7128,_0x3e0efd))['catch'](handleError(_0x2b7128,null));};exports[_0x7fd8('0x4e')]=function(_0x468fbe,_0x21d235){return db[_0x7fd8('0x26')][_0x7fd8('0x3c')]({'where':{'id':_0x468fbe[_0x7fd8('0x30')]['id']}})[_0x7fd8('0x1e')](handleEntityNotFound(_0x21d235,null))['then'](function(_0x16d36e){if(_0x16d36e){return _0x16d36e[_0x7fd8('0x4f')](_0x468fbe[_0x7fd8('0x3b')][_0x7fd8('0x41')],_[_0x7fd8('0x40')](_0x468fbe['body'],[_0x7fd8('0x41'),'id'])||{})[_0x7fd8('0x50')](function(){return db[_0x7fd8('0x51')]['findAll']({'attributes':['id','name',_0x7fd8('0x52')],'where':{'id':_0x468fbe[_0x7fd8('0x3b')][_0x7fd8('0x41')]}});})[_0x7fd8('0x1e')](function(_0x16c870){socket[_0x7fd8('0x53')]('smsInteractionTags:save',{'id':Number(_0x468fbe[_0x7fd8('0x30')]['id']),'tags':_0x16c870||[]});return{'id':Number(_0x468fbe[_0x7fd8('0x30')]['id']),'tags':_0x16c870||[]};});}})[_0x7fd8('0x1e')](respondWithResult(_0x21d235,null))[_0x7fd8('0x2e')](handleError(_0x21d235,null));};exports['removeTags']=function(_0x41c9e2,_0x6118d7){return db[_0x7fd8('0x26')][_0x7fd8('0x3c')]({'where':{'id':_0x41c9e2[_0x7fd8('0x30')]['id']}})[_0x7fd8('0x1e')](handleEntityNotFound(_0x6118d7,null))[_0x7fd8('0x1e')](function(_0x118582){if(_0x118582){return _0x118582[_0x7fd8('0x54')](_0x41c9e2[_0x7fd8('0x2d')][_0x7fd8('0x41')]);}})[_0x7fd8('0x1e')](respondWithStatusCode(_0x6118d7,null))[_0x7fd8('0x2e')](handleError(_0x6118d7,null));};exports[_0x7fd8('0x55')]=function(_0x5cb9a0,_0x48e1cc){var _0x3bca72=moment()[_0x7fd8('0x56')]()[_0x7fd8('0x57')]();var _0x432d5b=path[_0x7fd8('0x58')](config['root'],'server',_0x7fd8('0x59'),_0x7fd8('0x5a'));var _0x520ea8=path['join'](_0x432d5b,_0x3bca72);var _0x489bf3=util[_0x7fd8('0x4a')](_0x7fd8('0x5b'),_0x5cb9a0[_0x7fd8('0x30')]['id'],_0x3bca72);var _0x23b3dd=path[_0x7fd8('0x58')](_0x432d5b,_0x489bf3);var _0x4fe173=[];_0x4fe173['push']({'model':db[_0x7fd8('0x5c')],'as':_0x7fd8('0x5c'),'attributes':['id','fullname'],'raw':!![]});_0x4fe173[_0x7fd8('0x5d')]({'model':db[_0x7fd8('0x5e')],'as':'Contact','attributes':['id',_0x7fd8('0x5f'),'lastName'],'raw':!![]});var _0xed205a=[{'model':db['SmsMessage'],'as':_0x7fd8('0x60'),'attributes':['id','body','createdAt',_0x7fd8('0x61'),_0x7fd8('0x62'),'read'],'include':_0x4fe173}];_0xed205a[_0x7fd8('0x5d')]({'model':db['SmsAccount'],'as':_0x7fd8('0x63'),'attributes':['id',_0x7fd8('0x22')]});_0xed205a[_0x7fd8('0x5d')]({'model':db[_0x7fd8('0x5c')],'as':_0x7fd8('0x64'),'attributes':['id',_0x7fd8('0x65')]});return db['SmsInteraction']['find']({'where':{'id':_0x5cb9a0[_0x7fd8('0x30')]['id']},'include':_0xed205a})['then'](handleEntityNotFound(_0x48e1cc,null))['then'](function(_0x19cbd8){if(_0x19cbd8){var _0x1a67b2=_0x19cbd8[_0x7fd8('0x66')]({'plain':!![]});fs['mkdirSync'](_0x520ea8);var _0x484eb0={'channel':_0x7fd8('0x67'),'account':_0x1a67b2[_0x7fd8('0x63')][_0x7fd8('0x22')],'agent':_0x1a67b2[_0x7fd8('0x64')]?_0x1a67b2[_0x7fd8('0x64')]['fullname']:_0x7fd8('0x68'),'createdAt':moment(_0x1a67b2[_0x7fd8('0x69')])[_0x7fd8('0x4a')](_0x7fd8('0x4b'))[_0x7fd8('0x57')](),'closedAt':_0x1a67b2[_0x7fd8('0x6a')]?moment(_0x1a67b2[_0x7fd8('0x6b')])[_0x7fd8('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7fd8('0x57')]():'','disposition':_0x1a67b2[_0x7fd8('0x6c')],'messages':_(_0x1a67b2[_0x7fd8('0x60')])['filter']({'secret':![]})[_0x7fd8('0x25')](function(_0x4394f3){return{'date':moment(_0x4394f3[_0x7fd8('0x69')])[_0x7fd8('0x4a')](_0x7fd8('0x4b'))[_0x7fd8('0x57')](),'sender':_0x4394f3['direction']===_0x7fd8('0x6d')?_0x4394f3[_0x7fd8('0x5c')]?_0x4394f3[_0x7fd8('0x5c')][_0x7fd8('0x65')]:'System':_0x4394f3[_0x7fd8('0x6e')][_0x7fd8('0x5f')]+(_0x4394f3[_0x7fd8('0x6e')][_0x7fd8('0x6f')]?'\x20'+_0x4394f3[_0x7fd8('0x6e')][_0x7fd8('0x6f')]:''),'body':_0x4394f3['body'],'direction':_0x4394f3['direction']==='out'?'A':'C','secret':_0x4394f3[_0x7fd8('0x62')],'read':_0x4394f3[_0x7fd8('0x70')]};})['value']()};return ejs[_0x7fd8('0x71')](path['join'](config[_0x7fd8('0x72')],_0x7fd8('0x73'),_0x7fd8('0x74'),_0x7fd8('0x75')),{'interaction':_0x484eb0})[_0x7fd8('0x1e')](function(_0x376980){var _0x158a4f=path[_0x7fd8('0x58')](_0x520ea8,_0x7fd8('0x76')+_0x1a67b2['id']+'-'+_0x3bca72+_0x7fd8('0x77'));var _0x1016b4={'path':_0x158a4f,'channel':_0x7fd8('0x67'),'interactionId':_0x1a67b2['id']};return pdf[_0x7fd8('0x78')](_0x376980,_0x1016b4);})['then'](function(){return new BPromise(function(_0x2a20d3,_0x13601e){zipdir(_0x520ea8,{'saveTo':_0x23b3dd},function(_0x286603,_0x3c353c){if(_0x286603)return _0x13601e(_0x286603);return _0x2a20d3(_0x3c353c);});})[_0x7fd8('0x1e')](function(){return new BPromise(function(_0x4e38ae,_0x38f228){rimraf(_0x520ea8,function(_0x525490){if(_0x525490)_0x38f228(_0x525490);return _0x4e38ae();});});})[_0x7fd8('0x1e')](function(){return _0x48e1cc[_0x7fd8('0x55')](_0x23b3dd,_0x489bf3,function(_0x58f956){if(_0x58f956){console[_0x7fd8('0x79')](_0x7fd8('0x7a'),_0x58f956);}else{fs[_0x7fd8('0x7b')](_0x23b3dd);}});});});}else{return _0x48e1cc[_0x7fd8('0x13')](0xc8);}})[_0x7fd8('0x2e')](handleError(_0x48e1cc,null));}; \ No newline at end of file +var _0xe255=['closedAt','disposition','Messages','out','System','Contact','read','value','renderFile','views','transcript-','.pdf','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','catch','show','params','model','keys','SmsInteraction','filters','intersection','fields','length','includeAll','include','merge','create','body','find','addMessage','SmsMessage','ids','getMessages','findOne','attributes','nolimit','pick','filter','where','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','join','root','server','files','tmp','format','push','User','fullname','CmContact','firstName','lastName','createdAt','direction','secret','SmsAccount','Owner','get','mkdirSync','Sms','Account','N.A.','closed'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0xe255,0x86));var _0x5e25=function(_0x258fed,_0x2a02dd){_0x258fed=_0x258fed-0x0;var _0x3a8b64=_0xe255[_0x258fed];return _0x3a8b64;};'use strict';var rimraf=require(_0x5e25('0x0'));var zipdir=require(_0x5e25('0x1'));var moment=require(_0x5e25('0x2'));var BPromise=require(_0x5e25('0x3'));var util=require(_0x5e25('0x4'));var path=require(_0x5e25('0x5'));var ejs=require(_0x5e25('0x6'));var fs=require('fs');var _=require(_0x5e25('0x7'));var Redis=require(_0x5e25('0x8'));var interaction=require(_0x5e25('0x9'));var qs=require(_0x5e25('0xa'));var pdf=require(_0x5e25('0xb'));var logger=require(_0x5e25('0xc'))(_0x5e25('0xd'));var config=require(_0x5e25('0xe'));var db=require('../../mysqldb')['db'];config[_0x5e25('0xf')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e25('0x10'))(new Redis(config['redis']));require(_0x5e25('0x11'))['register'](socket);function respondWithStatusCode(_0x4b160c,_0x167ef1){_0x167ef1=_0x167ef1||0xcc;return function(_0x473f35){if(_0x473f35){return _0x4b160c[_0x5e25('0x12')](_0x167ef1);}return _0x4b160c[_0x5e25('0x13')](_0x167ef1)[_0x5e25('0x14')]();};}function respondWithResult(_0x1735c5,_0x4fe942){_0x4fe942=_0x4fe942||0xc8;return function(_0x1e6fc3){if(_0x1e6fc3){return _0x1735c5['status'](_0x4fe942)[_0x5e25('0x15')](_0x1e6fc3);}};}function respondWithFilteredResult(_0x11a5f7,_0x5c3c05){return function(_0x3d03a7){if(_0x3d03a7){var _0x278de5=typeof _0x5c3c05[_0x5e25('0x16')]===_0x5e25('0x17')&&typeof _0x5c3c05['limit']===_0x5e25('0x17');var _0x467bb1=_0x3d03a7[_0x5e25('0x18')];var _0x30a10a=_0x278de5?0x0:_0x5c3c05[_0x5e25('0x16')];var _0x19d4f7=_0x278de5?_0x3d03a7[_0x5e25('0x18')]:_0x5c3c05['offset']+_0x5c3c05[_0x5e25('0x19')];var _0x587f87;if(_0x19d4f7>=_0x467bb1){_0x19d4f7=_0x467bb1;_0x587f87=0xc8;}else{_0x587f87=0xce;}_0x11a5f7[_0x5e25('0x13')](_0x587f87);return _0x11a5f7[_0x5e25('0x1a')](_0x5e25('0x1b'),_0x30a10a+'-'+_0x19d4f7+'/'+_0x467bb1)['json'](_0x3d03a7);}return null;};}function saveUpdates(_0x531108){return function(_0x2d470e){if(_0x2d470e){return _0x2d470e[_0x5e25('0x1c')](_0x531108)[_0x5e25('0x1d')](function(_0x47009d){return _0x47009d;});}return null;};}function removeEntity(_0x485bde){return function(_0x2629d0){if(_0x2629d0){return _0x2629d0[_0x5e25('0x1e')]()[_0x5e25('0x1d')](function(){_0x485bde[_0x5e25('0x13')](0xcc)[_0x5e25('0x14')]();});}};}function handleEntityNotFound(_0x46111f){return function(_0x5e3f89){if(!_0x5e3f89){_0x46111f[_0x5e25('0x12')](0x194);}return _0x5e3f89;};}function handleError(_0xb8d76d,_0x22111d){_0x22111d=_0x22111d||0x1f4;return function(_0x265df6){logger[_0x5e25('0x1f')](_0x265df6[_0x5e25('0x20')]);if(_0x265df6['name']){delete _0x265df6[_0x5e25('0x21')];}_0xb8d76d[_0x5e25('0x13')](_0x22111d)[_0x5e25('0x22')](_0x265df6);};}exports[_0x5e25('0x23')]=function(_0x5886f5,_0x480ef1){var _0x4d1a91={};var _0xa7f1cc=_[_0x5e25('0x24')](db['SmsInteraction'][_0x5e25('0x25')],function(_0x3962c2){return{'name':_0x3962c2[_0x5e25('0x26')],'type':_0x3962c2[_0x5e25('0x27')][_0x5e25('0x28')]};});_0x4d1a91=qs[_0x5e25('0x29')](_0xa7f1cc,_0x5886f5);return interaction[_0x5e25('0x2a')](_0x5e25('0x2b'),_0x5886f5[_0x5e25('0x2c')],_0x5886f5['user'],_0x4d1a91,_0xa7f1cc)[_0x5e25('0x1d')](respondWithFilteredResult(_0x480ef1,_0x4d1a91))[_0x5e25('0x2d')](handleError(_0x480ef1,null));};exports[_0x5e25('0x2e')]=function(_0x4edb7f,_0x1f37d9){var _0x18ba4b={'raw':![],'where':{'id':_0x4edb7f[_0x5e25('0x2f')]['id']}},_0x2317a2={};_0x2317a2[_0x5e25('0x30')]=_[_0x5e25('0x31')](db[_0x5e25('0x32')][_0x5e25('0x25')]);_0x2317a2[_0x5e25('0x2c')]=_['keys'](_0x4edb7f[_0x5e25('0x2c')]);_0x2317a2[_0x5e25('0x33')]=_['intersection'](_0x2317a2[_0x5e25('0x30')],_0x2317a2['query']);_0x18ba4b['attributes']=_[_0x5e25('0x34')](_0x2317a2[_0x5e25('0x30')],qs[_0x5e25('0x35')](_0x4edb7f['query'][_0x5e25('0x35')]));_0x18ba4b['attributes']=_0x18ba4b['attributes'][_0x5e25('0x36')]?_0x18ba4b['attributes']:_0x2317a2['model'];if(_0x4edb7f[_0x5e25('0x2c')][_0x5e25('0x37')]){_0x18ba4b[_0x5e25('0x38')]=[{'all':!![]}];}_0x18ba4b=_[_0x5e25('0x39')]({},_0x18ba4b,_0x4edb7f['options']);return db[_0x5e25('0x32')]['find'](_0x18ba4b)[_0x5e25('0x1d')](handleEntityNotFound(_0x1f37d9,null))[_0x5e25('0x1d')](respondWithResult(_0x1f37d9,null))[_0x5e25('0x2d')](handleError(_0x1f37d9,null));};exports['create']=function(_0x7f8815,_0x21e7cb){return db['SmsInteraction'][_0x5e25('0x3a')](_0x7f8815[_0x5e25('0x3b')],{})[_0x5e25('0x1d')](respondWithResult(_0x21e7cb,0xc9))[_0x5e25('0x2d')](handleError(_0x21e7cb,null));};exports[_0x5e25('0x1c')]=function(_0x275c1d,_0x349683){if(_0x275c1d[_0x5e25('0x3b')]['id']){delete _0x275c1d[_0x5e25('0x3b')]['id'];}return db[_0x5e25('0x32')][_0x5e25('0x3c')]({'where':{'id':_0x275c1d[_0x5e25('0x2f')]['id']}})[_0x5e25('0x1d')](handleEntityNotFound(_0x349683,null))[_0x5e25('0x1d')](saveUpdates(_0x275c1d[_0x5e25('0x3b')],null))[_0x5e25('0x1d')](respondWithResult(_0x349683,null))[_0x5e25('0x2d')](handleError(_0x349683,null));};exports[_0x5e25('0x1e')]=function(_0xc4e039,_0x4c6067){return db[_0x5e25('0x32')][_0x5e25('0x3c')]({'where':{'id':_0xc4e039[_0x5e25('0x2f')]['id']}})[_0x5e25('0x1d')](handleEntityNotFound(_0x4c6067,null))[_0x5e25('0x1d')](removeEntity(_0x4c6067,null))[_0x5e25('0x2d')](handleError(_0x4c6067,null));};exports['describe']=function(_0x4e6c0d,_0x264266){return db[_0x5e25('0x32')]['describe']()[_0x5e25('0x1d')](respondWithResult(_0x264266,null))[_0x5e25('0x2d')](handleError(_0x264266,null));};exports[_0x5e25('0x3d')]=function(_0x47eae6,_0x563dbd){return db[_0x5e25('0x3e')][_0x5e25('0x3c')]({'where':{'id':_0x47eae6['params']['id']}})[_0x5e25('0x1d')](handleEntityNotFound(_0x563dbd,null))['then'](function(_0x1e7884){if(_0x1e7884){return _0x1e7884[_0x5e25('0x3d')](_0x47eae6[_0x5e25('0x3b')][_0x5e25('0x3f')],_['omit'](_0x47eae6[_0x5e25('0x3b')],[_0x5e25('0x3f'),'id'])||{});}})[_0x5e25('0x1d')](respondWithResult(_0x563dbd,null))['catch'](handleError(_0x563dbd,null));};exports[_0x5e25('0x40')]=function(_0x46a253,_0x4235fe){var _0x3f56a3={'raw':![],'where':{}};var _0x261cb6={};var _0x36254a={'count':0x0,'rows':[]};return db[_0x5e25('0x32')][_0x5e25('0x41')]({'where':{'id':_0x46a253[_0x5e25('0x2f')]['id']}})[_0x5e25('0x1d')](handleEntityNotFound(_0x4235fe,null))['then'](function(_0x12757a){if(_0x12757a){_0x261cb6['model']=_[_0x5e25('0x31')](db[_0x5e25('0x3e')]['rawAttributes']);_0x261cb6[_0x5e25('0x2c')]=_[_0x5e25('0x31')](_0x46a253[_0x5e25('0x2c')]);_0x261cb6[_0x5e25('0x33')]=_[_0x5e25('0x34')](_0x261cb6[_0x5e25('0x30')],_0x261cb6[_0x5e25('0x2c')]);_0x3f56a3[_0x5e25('0x42')]=_[_0x5e25('0x34')](_0x261cb6['model'],qs[_0x5e25('0x35')](_0x46a253['query']['fields']));_0x3f56a3[_0x5e25('0x42')]=_0x3f56a3[_0x5e25('0x42')][_0x5e25('0x36')]?_0x3f56a3[_0x5e25('0x42')]:_0x261cb6[_0x5e25('0x30')];if(!_0x46a253['query']['hasOwnProperty'](_0x5e25('0x43'))){_0x3f56a3[_0x5e25('0x19')]=qs[_0x5e25('0x19')](_0x46a253[_0x5e25('0x2c')][_0x5e25('0x19')]);_0x3f56a3[_0x5e25('0x16')]=qs['offset'](_0x46a253[_0x5e25('0x2c')][_0x5e25('0x16')]);}_0x3f56a3['order']=qs['sort'](_0x46a253['query']['sort']);_0x3f56a3['where']=qs[_0x5e25('0x33')](_[_0x5e25('0x44')](_0x46a253[_0x5e25('0x2c')],_0x261cb6[_0x5e25('0x33')]));_0x3f56a3['where']['SmsInteractionId']=_0x12757a['id'];if(_0x46a253[_0x5e25('0x2c')][_0x5e25('0x45')]){_0x3f56a3[_0x5e25('0x46')]=_[_0x5e25('0x39')](_0x3f56a3['where'],{'$or':_[_0x5e25('0x24')](_0x3f56a3[_0x5e25('0x42')],function(_0x4fbc05){var _0x413e4b={};_0x413e4b[_0x4fbc05]={'$like':'%'+_0x46a253[_0x5e25('0x2c')][_0x5e25('0x45')]+'%'};return _0x413e4b;})});}if(_0x46a253['query']['$gte']){var _0x38a8cc=_0x46a253[_0x5e25('0x2c')]['$gte'][_0x5e25('0x47')](',');var _0x106865={};_0x106865[_0x38a8cc[0x0]]={'$gte':moment(_0x38a8cc[0x1])['format'](_0x5e25('0x48'))};_0x3f56a3[_0x5e25('0x46')]=_['merge'](_0x3f56a3['where'],_0x106865);}_0x3f56a3=_['merge']({},_0x3f56a3,_0x46a253['options']);return db[_0x5e25('0x3e')][_0x5e25('0x18')]({'where':_0x3f56a3[_0x5e25('0x46')]})['then'](function(_0x1c136b){_0x36254a['count']=_0x1c136b;if(_0x46a253[_0x5e25('0x2c')][_0x5e25('0x37')]){_0x3f56a3['include']=[{'all':!![]}];}return db['SmsMessage'][_0x5e25('0x2a')](_0x3f56a3);})[_0x5e25('0x1d')](function(_0x39506b){_0x36254a[_0x5e25('0x49')]=_0x39506b;return _0x36254a;});}})['then'](respondWithFilteredResult(_0x4235fe,_0x3f56a3))[_0x5e25('0x2d')](handleError(_0x4235fe,null));};exports[_0x5e25('0x4a')]=function(_0x27d72c,_0x622c01){return db[_0x5e25('0x32')][_0x5e25('0x3c')]({'where':{'id':_0x27d72c['params']['id']}})[_0x5e25('0x1d')](handleEntityNotFound(_0x622c01,null))[_0x5e25('0x1d')](function(_0x3b50c8){if(_0x3b50c8){return _0x3b50c8[_0x5e25('0x4b')](_0x27d72c[_0x5e25('0x3b')][_0x5e25('0x3f')],_['omit'](_0x27d72c[_0x5e25('0x3b')],[_0x5e25('0x3f'),'id'])||{})[_0x5e25('0x4c')](function(){return db[_0x5e25('0x4d')][_0x5e25('0x2a')]({'attributes':['id',_0x5e25('0x21'),_0x5e25('0x4e')],'where':{'id':_0x27d72c[_0x5e25('0x3b')][_0x5e25('0x3f')]}});})[_0x5e25('0x1d')](function(_0xf85fd1){socket[_0x5e25('0x4f')]('smsInteractionTags:save',{'id':Number(_0x27d72c[_0x5e25('0x2f')]['id']),'tags':_0xf85fd1||[]});return{'id':Number(_0x27d72c['params']['id']),'tags':_0xf85fd1||[]};});}})[_0x5e25('0x1d')](respondWithResult(_0x622c01,null))[_0x5e25('0x2d')](handleError(_0x622c01,null));};exports[_0x5e25('0x50')]=function(_0x2453ea,_0x5f4740){return db[_0x5e25('0x32')][_0x5e25('0x3c')]({'where':{'id':_0x2453ea['params']['id']}})[_0x5e25('0x1d')](handleEntityNotFound(_0x5f4740,null))[_0x5e25('0x1d')](function(_0x5297fb){if(_0x5297fb){return _0x5297fb['removeTags'](_0x2453ea[_0x5e25('0x2c')][_0x5e25('0x3f')]);}})[_0x5e25('0x1d')](respondWithStatusCode(_0x5f4740,null))[_0x5e25('0x2d')](handleError(_0x5f4740,null));};exports['download']=function(_0x5b3b52,_0x5a8221){var _0x521fb7=moment()[_0x5e25('0x51')]()[_0x5e25('0x52')]();var _0x48a4f2=path[_0x5e25('0x53')](config[_0x5e25('0x54')],_0x5e25('0x55'),_0x5e25('0x56'),_0x5e25('0x57'));var _0x524447=path[_0x5e25('0x53')](_0x48a4f2,_0x521fb7);var _0x427573=util[_0x5e25('0x58')]('transcript-%d-%s.zip',_0x5b3b52['params']['id'],_0x521fb7);var _0x12c3c4=path['join'](_0x48a4f2,_0x427573);var _0x1e0a5b=[];_0x1e0a5b[_0x5e25('0x59')]({'model':db[_0x5e25('0x5a')],'as':_0x5e25('0x5a'),'attributes':['id',_0x5e25('0x5b')],'raw':!![]});_0x1e0a5b[_0x5e25('0x59')]({'model':db[_0x5e25('0x5c')],'as':'Contact','attributes':['id',_0x5e25('0x5d'),_0x5e25('0x5e')],'raw':!![]});var _0x2eb0bd=[{'model':db[_0x5e25('0x3e')],'as':'Messages','attributes':['id',_0x5e25('0x3b'),_0x5e25('0x5f'),_0x5e25('0x60'),_0x5e25('0x61'),'read'],'include':_0x1e0a5b}];_0x2eb0bd[_0x5e25('0x59')]({'model':db[_0x5e25('0x62')],'as':'Account','attributes':['id','name']});_0x2eb0bd[_0x5e25('0x59')]({'model':db[_0x5e25('0x5a')],'as':_0x5e25('0x63'),'attributes':['id',_0x5e25('0x5b')]});return db['SmsInteraction'][_0x5e25('0x3c')]({'where':{'id':_0x5b3b52[_0x5e25('0x2f')]['id']},'include':_0x2eb0bd})[_0x5e25('0x1d')](handleEntityNotFound(_0x5a8221,null))[_0x5e25('0x1d')](function(_0x500b8e){if(_0x500b8e){var _0x57aca7=_0x500b8e[_0x5e25('0x64')]({'plain':!![]});fs[_0x5e25('0x65')](_0x524447);var _0x51d49a={'channel':_0x5e25('0x66'),'account':_0x57aca7[_0x5e25('0x67')][_0x5e25('0x21')],'agent':_0x57aca7['Owner']?_0x57aca7[_0x5e25('0x63')][_0x5e25('0x5b')]:_0x5e25('0x68'),'createdAt':moment(_0x57aca7[_0x5e25('0x5f')])[_0x5e25('0x58')](_0x5e25('0x48'))[_0x5e25('0x52')](),'closedAt':_0x57aca7[_0x5e25('0x69')]?moment(_0x57aca7[_0x5e25('0x6a')])[_0x5e25('0x58')](_0x5e25('0x48'))[_0x5e25('0x52')]():'','disposition':_0x57aca7[_0x5e25('0x6b')],'messages':_(_0x57aca7[_0x5e25('0x6c')])['filter']({'secret':![]})[_0x5e25('0x24')](function(_0x2d90b2){return{'date':moment(_0x2d90b2[_0x5e25('0x5f')])[_0x5e25('0x58')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5e25('0x52')](),'sender':_0x2d90b2[_0x5e25('0x60')]===_0x5e25('0x6d')?_0x2d90b2['User']?_0x2d90b2[_0x5e25('0x5a')][_0x5e25('0x5b')]:_0x5e25('0x6e'):_0x2d90b2[_0x5e25('0x6f')]['firstName']+(_0x2d90b2[_0x5e25('0x6f')][_0x5e25('0x5e')]?'\x20'+_0x2d90b2[_0x5e25('0x6f')]['lastName']:''),'body':_0x2d90b2['body'],'direction':_0x2d90b2['direction']===_0x5e25('0x6d')?'A':'C','secret':_0x2d90b2['secret'],'read':_0x2d90b2[_0x5e25('0x70')]};})[_0x5e25('0x71')]()};return ejs[_0x5e25('0x72')](path[_0x5e25('0x53')](config[_0x5e25('0x54')],_0x5e25('0x55'),_0x5e25('0x73'),'downloadInteraction.ejs'),{'interaction':_0x51d49a})['then'](function(_0x22637c){var _0xafde52=path['join'](_0x524447,_0x5e25('0x74')+_0x57aca7['id']+'-'+_0x521fb7+_0x5e25('0x75'));var _0x16c885={'path':_0xafde52,'channel':_0x5e25('0x66'),'interactionId':_0x57aca7['id']};return pdf['createPdfFromHTML'](_0x22637c,_0x16c885);})[_0x5e25('0x1d')](function(){return new BPromise(function(_0x4c4767,_0x107a6b){zipdir(_0x524447,{'saveTo':_0x12c3c4},function(_0x5b2c54,_0x4d01b1){if(_0x5b2c54)return _0x107a6b(_0x5b2c54);return _0x4c4767(_0x4d01b1);});})[_0x5e25('0x1d')](function(){return new BPromise(function(_0x3d0f01,_0x3ffc02){rimraf(_0x524447,function(_0x187c98){if(_0x187c98)_0x3ffc02(_0x187c98);return _0x3d0f01();});});})[_0x5e25('0x1d')](function(){return _0x5a8221['download'](_0x12c3c4,_0x427573,function(_0x1e2e7b){if(_0x1e2e7b){console[_0x5e25('0x76')]('err',_0x1e2e7b);}else{fs[_0x5e25('0x77')](_0x12c3c4);}});});});}else{return _0x5a8221[_0x5e25('0x12')](0xc8);}})[_0x5e25('0x2d')](handleError(_0x5a8221,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 34eea45..a98e56a 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 _0x4325=['Users','map','findAll','then','setDataValue','length','emit','catch','exports','events','../../mysqldb','SmsMessage','setMaxListeners','remove','getUsers'];(function(_0x19e67f,_0x1a8a9d){var _0x1e64a2=function(_0x43aa08){while(--_0x43aa08){_0x19e67f['push'](_0x19e67f['shift']());}};_0x1e64a2(++_0x1a8a9d);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x5432('0x0'));var SmsInteraction=require(_0x5432('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x5432('0x1'))['db'][_0x5432('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5432('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5432('0x4')};function emitEvent(_0x36ce53){return function(_0xad26e9,_0x4acbe4,_0x209e2e){_0xad26e9[_0x5432('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x106ec9){_0xad26e9['setDataValue'](_0x5432('0x6'),_0x106ec9[_0x5432('0x7')](function(_0x40e756){return{'id':_0x40e756['id']};}));return SmsMessage[_0x5432('0x8')]({'where':{'SmsInteractionId':_0xad26e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5432('0x9')](function(_0x4a9a51){_0xad26e9[_0x5432('0xa')]('unreadMessages',_0x4a9a51[_0x5432('0xb')]);SmsInteractionEvents[_0x5432('0xc')](_0x36ce53+':'+_0xad26e9['id'],_0xad26e9);SmsInteractionEvents[_0x5432('0xc')](_0x36ce53,_0xad26e9);_0x209e2e(null);})[_0x5432('0xd')](_0x209e2e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5432('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0x4cf8=['unreadMessages','length','emit','catch','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','findAll'];(function(_0x14c9c3,_0x11b74b){var _0x32198a=function(_0x43426b){while(--_0x43426b){_0x14c9c3['push'](_0x14c9c3['shift']());}};_0x32198a(++_0x11b74b);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x2f3947,_0x2ee083){_0x2f3947=_0x2f3947-0x0;var _0x3e6ab7=_0x4cf8[_0x2f3947];return _0x3e6ab7;};'use strict';var EventEmitter=require(_0x84cf('0x0'));var SmsInteraction=require(_0x84cf('0x1'))['db'][_0x84cf('0x2')];var SmsMessage=require(_0x84cf('0x1'))['db'][_0x84cf('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x84cf('0x4')](0x0);var events={'afterCreate':_0x84cf('0x5'),'afterUpdate':_0x84cf('0x6'),'afterDestroy':_0x84cf('0x7')};function emitEvent(_0x2d38c0){return function(_0x5844d7,_0x2c613d,_0x50ade2){_0x5844d7['getUsers']({'attributes':['id'],'raw':!![]})[_0x84cf('0x8')](function(_0x56c5cc){_0x5844d7[_0x84cf('0x9')](_0x84cf('0xa'),_0x56c5cc['map'](function(_0x2e0b79){return{'id':_0x2e0b79['id']};}));return SmsMessage[_0x84cf('0xb')]({'where':{'SmsInteractionId':_0x5844d7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xfb5398){_0x5844d7[_0x84cf('0x9')](_0x84cf('0xc'),_0xfb5398[_0x84cf('0xd')]);SmsInteractionEvents['emit'](_0x2d38c0+':'+_0x5844d7['id'],_0x5844d7);SmsInteractionEvents[_0x84cf('0xe')](_0x2d38c0,_0x5844d7);_0x50ade2(null);})[_0x84cf('0xf')](_0x50ade2(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x84cf('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index cd0e81b..ba9f343 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 _0x5e96=['SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define'];(function(_0x2abad8,_0xd04adf){var _0x836ca3=function(_0x5edd94){while(--_0x5edd94){_0x2abad8['push'](_0x2abad8['shift']());}};_0x836ca3(++_0xd04adf);}(_0x5e96,0x18d));var _0x65e9=function(_0x5aa518,_0x4ef60c){_0x5aa518=_0x5aa518-0x0;var _0x2e6287=_0x5e96[_0x5aa518];return _0x2e6287;};'use strict';var _=require(_0x65e9('0x0'));var util=require('util');var logger=require(_0x65e9('0x1'))(_0x65e9('0x2'));var moment=require(_0x65e9('0x3'));var BPromise=require(_0x65e9('0x4'));var rp=require(_0x65e9('0x5'));var fs=require('fs');var path=require(_0x65e9('0x6'));var rimraf=require(_0x65e9('0x7'));var config=require('../../config/environment');var attributes=require(_0x65e9('0x8'));module[_0x65e9('0x9')]=function(_0x343b2c,_0x15c900){return _0x343b2c[_0x65e9('0xa')](_0x65e9('0xb'),attributes,{'tableName':_0x65e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f2170,_0x3f219d,_0x4a3edd){if(_0x2f2170[_0x65e9('0xd')]('closed')){_0x2f2170[_0x65e9('0xe')]=moment()[_0x65e9('0xf')](_0x65e9('0x10'));}_0x4a3edd(null,_0x2f2170);}}});}; \ No newline at end of file +var _0x6f44=['bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment'];(function(_0x42dd2e,_0x1c12ee){var _0x18121a=function(_0x4b83fd){while(--_0x4b83fd){_0x42dd2e['push'](_0x42dd2e['shift']());}};_0x18121a(++_0x1c12ee);}(_0x6f44,0x169));var _0x46f4=function(_0x13d1b3,_0x394ef4){_0x13d1b3=_0x13d1b3-0x0;var _0x21b56c=_0x6f44[_0x13d1b3];return _0x21b56c;};'use strict';var _=require('lodash');var util=require(_0x46f4('0x0'));var logger=require(_0x46f4('0x1'))('api');var moment=require(_0x46f4('0x2'));var BPromise=require(_0x46f4('0x3'));var rp=require(_0x46f4('0x4'));var fs=require('fs');var path=require(_0x46f4('0x5'));var rimraf=require(_0x46f4('0x6'));var config=require(_0x46f4('0x7'));var attributes=require(_0x46f4('0x8'));module['exports']=function(_0x3783b2,_0x28be89){return _0x3783b2[_0x46f4('0x9')](_0x46f4('0xa'),attributes,{'tableName':_0x46f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a499e,_0x94ec2d,_0x3c9a3f){if(_0x1a499e['changed'](_0x46f4('0xc'))){_0x1a499e['closedAt']=moment()['format'](_0x46f4('0xd'));}_0x3c9a3f(null,_0x1a499e);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 267ef9a..e70917e 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 _0x19a8=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','update','body','options','where','attributes','limit','debug','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','AddTags'];(function(_0x2598b3,_0x1cc0a8){var _0x55607f=function(_0x3b37fd){while(--_0x3b37fd){_0x2598b3['push'](_0x2598b3['shift']());}};_0x55607f(++_0x1cc0a8);}(_0x19a8,0x1d9));var _0x819a=function(_0x20e9a3,_0x4077ec){_0x20e9a3=_0x20e9a3-0x0;var _0x5560b5=_0x19a8[_0x20e9a3];return _0x5560b5;};'use strict';var _=require('lodash');var util=require(_0x819a('0x0'));var moment=require(_0x819a('0x1'));var BPromise=require(_0x819a('0x2'));var rs=require(_0x819a('0x3'));var fs=require('fs');var Redis=require(_0x819a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x819a('0x5'));var logger=require(_0x819a('0x6'))(_0x819a('0x7'));var config=require(_0x819a('0x8'));var jayson=require(_0x819a('0x9'));var client=jayson['client'][_0x819a('0xa')]({'port':0x232a});config[_0x819a('0xb')]=_[_0x819a('0xc')](config[_0x819a('0xb')],{'host':_0x819a('0xd'),'port':0x18eb});var socket=require(_0x819a('0xe'))(new Redis(config[_0x819a('0xb')]));require(_0x819a('0xf'))[_0x819a('0x10')](socket);function respondWithRpcPromise(_0x362ebd,_0x278756,_0x58cda5){return new BPromise(function(_0x21e0a,_0x18fc5d){return client[_0x819a('0x11')](_0x362ebd,_0x58cda5)[_0x819a('0x12')](function(_0xc0afa4){logger[_0x819a('0x13')](_0x819a('0x14'),_0x278756,_0x819a('0x15'));logger['debug'](_0x819a('0x16'),_0x278756,_0x819a('0x15'),JSON[_0x819a('0x17')](_0xc0afa4));if(_0xc0afa4[_0x819a('0x18')]){if(_0xc0afa4[_0x819a('0x18')]['code']===0x1f4){logger[_0x819a('0x18')](_0x819a('0x14'),_0x278756,_0xc0afa4['error'][_0x819a('0x19')]);return _0x18fc5d(_0xc0afa4[_0x819a('0x18')][_0x819a('0x19')]);}logger[_0x819a('0x18')](_0x819a('0x14'),_0x278756,_0xc0afa4[_0x819a('0x18')][_0x819a('0x19')]);return _0x21e0a(_0xc0afa4[_0x819a('0x18')][_0x819a('0x19')]);}else{logger[_0x819a('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x278756,_0x819a('0x15'));_0x21e0a(_0xc0afa4[_0x819a('0x1a')]['message']);}})[_0x819a('0x1b')](function(_0x2abfdd){logger['error'](_0x819a('0x14'),_0x278756,_0x2abfdd);_0x18fc5d(_0x2abfdd);});});}exports[_0x819a('0x1c')]=function(_0x186308){var _0x5f0161=this;return new Promise(function(_0x25e9b6,_0x32f38a){return db['SmsInteraction'][_0x819a('0x1d')](_0x186308[_0x819a('0x1e')],{'raw':_0x186308[_0x819a('0x1f')]?_0x186308[_0x819a('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x186308[_0x819a('0x1f')]?_0x186308[_0x819a('0x1f')][_0x819a('0x20')]||null:null,'attributes':_0x186308[_0x819a('0x1f')]?_0x186308[_0x819a('0x1f')][_0x819a('0x21')]||null:null,'limit':_0x186308['options']?_0x186308[_0x819a('0x1f')][_0x819a('0x22')]||null:null})[_0x819a('0x12')](function(_0xa492e1){logger[_0x819a('0x13')](_0x819a('0x1c'),_0x186308);logger[_0x819a('0x23')]('UpdateSmsInteraction',_0x186308,JSON['stringify'](_0xa492e1));_0x25e9b6(_0xa492e1);})[_0x819a('0x1b')](function(_0x2d30e6){logger[_0x819a('0x18')](_0x819a('0x1c'),_0x2d30e6[_0x819a('0x19')],_0x186308);_0x32f38a(_0x5f0161[_0x819a('0x18')](0x1f4,_0x2d30e6[_0x819a('0x19')]));});});};exports[_0x819a('0x24')]=function(_0x260c38){return new Promise(function(_0x1243f7,_0x522315){return db[_0x819a('0x25')][_0x819a('0x26')]({'where':_0x260c38[_0x819a('0x1f')]?_0x260c38[_0x819a('0x1f')][_0x819a('0x20')]||null:null})[_0x819a('0x12')](function(_0x5c09d1){if(_0x5c09d1){return _0x5c09d1[_0x819a('0x27')](_0x260c38[_0x819a('0x1e')][_0x819a('0x28')],_[_0x819a('0x29')](_0x260c38['body'],[_0x819a('0x28'),'id'])||{});}})['spread'](function(_0x400cbd){logger['info'](_0x819a('0x2a'),_0x260c38);logger[_0x819a('0x23')]('AddTags',_0x260c38,JSON[_0x819a('0x17')](_0x400cbd));_0x1243f7(_0x400cbd);})[_0x819a('0x1b')](function(_0x5cc61e){logger[_0x819a('0x18')](_0x819a('0x2a'),_0x5cc61e[_0x819a('0x19')],_0x260c38);_0x522315(_this[_0x819a('0x18')](0x1f4,_0x5cc61e[_0x819a('0x19')]));});});}; \ No newline at end of file +var _0x366d=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','stringify','catch','addTags','ids','spread','AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x366d,0x1a8));var _0xd366=function(_0x13aaa5,_0x1409b5){_0x13aaa5=_0x13aaa5-0x0;var _0x34c2fa=_0x366d[_0x13aaa5];return _0x34c2fa;};'use strict';var _=require('lodash');var util=require(_0xd366('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd366('0x1'));var fs=require('fs');var Redis=require(_0xd366('0x2'));var db=require(_0xd366('0x3'))['db'];var utils=require(_0xd366('0x4'));var logger=require(_0xd366('0x5'))(_0xd366('0x6'));var config=require(_0xd366('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd366('0x8')][_0xd366('0x9')]({'port':0x232a});config[_0xd366('0xa')]=_[_0xd366('0xb')](config[_0xd366('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd366('0xc'))(new Redis(config[_0xd366('0xa')]));require(_0xd366('0xd'))[_0xd366('0xe')](socket);function respondWithRpcPromise(_0x2c5bc0,_0x363313,_0x3d1bb5){return new BPromise(function(_0xc330b2,_0xf91bac){return client['request'](_0x2c5bc0,_0x3d1bb5)[_0xd366('0xf')](function(_0x2976f0){logger[_0xd366('0x10')](_0xd366('0x11'),_0x363313,'request\x20sent');logger[_0xd366('0x12')](_0xd366('0x13'),_0x363313,_0xd366('0x14'),JSON['stringify'](_0x2976f0));if(_0x2976f0[_0xd366('0x15')]){if(_0x2976f0['error'][_0xd366('0x16')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x363313,_0x2976f0['error'][_0xd366('0x17')]);return _0xf91bac(_0x2976f0[_0xd366('0x15')]['message']);}logger[_0xd366('0x15')](_0xd366('0x11'),_0x363313,_0x2976f0['error']['message']);return _0xc330b2(_0x2976f0[_0xd366('0x15')][_0xd366('0x17')]);}else{logger[_0xd366('0x10')](_0xd366('0x11'),_0x363313,_0xd366('0x14'));_0xc330b2(_0x2976f0[_0xd366('0x18')][_0xd366('0x17')]);}})['catch'](function(_0x51f1dd){logger[_0xd366('0x15')](_0xd366('0x11'),_0x363313,_0x51f1dd);_0xf91bac(_0x51f1dd);});});}exports[_0xd366('0x19')]=function(_0x425e6b){var _0x386bac=this;return new Promise(function(_0x219556,_0x4b0f0a){return db[_0xd366('0x1a')][_0xd366('0x1b')](_0x425e6b[_0xd366('0x1c')],{'raw':_0x425e6b[_0xd366('0x1d')]?_0x425e6b[_0xd366('0x1d')][_0xd366('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x425e6b[_0xd366('0x1d')]?_0x425e6b[_0xd366('0x1d')][_0xd366('0x1f')]||null:null,'attributes':_0x425e6b[_0xd366('0x1d')]?_0x425e6b['options']['attributes']||null:null,'limit':_0x425e6b['options']?_0x425e6b[_0xd366('0x1d')][_0xd366('0x20')]||null:null})[_0xd366('0xf')](function(_0x274773){logger['info'](_0xd366('0x19'),_0x425e6b);logger[_0xd366('0x12')](_0xd366('0x19'),_0x425e6b,JSON[_0xd366('0x21')](_0x274773));_0x219556(_0x274773);})[_0xd366('0x22')](function(_0x249b86){logger[_0xd366('0x15')](_0xd366('0x19'),_0x249b86['message'],_0x425e6b);_0x4b0f0a(_0x386bac[_0xd366('0x15')](0x1f4,_0x249b86[_0xd366('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x38b1cc){return new Promise(function(_0x4731b6,_0x22a6ac){return db[_0xd366('0x1a')]['find']({'where':_0x38b1cc[_0xd366('0x1d')]?_0x38b1cc[_0xd366('0x1d')][_0xd366('0x1f')]||null:null})[_0xd366('0xf')](function(_0x157857){if(_0x157857){return _0x157857[_0xd366('0x23')](_0x38b1cc[_0xd366('0x1c')][_0xd366('0x24')],_['omit'](_0x38b1cc['body'],[_0xd366('0x24'),'id'])||{});}})[_0xd366('0x25')](function(_0x5bccdd){logger['info'](_0xd366('0x26'),_0x38b1cc);logger[_0xd366('0x12')](_0xd366('0x26'),_0x38b1cc,JSON[_0xd366('0x21')](_0x5bccdd));_0x4731b6(_0x5bccdd);})[_0xd366('0x22')](function(_0xa4a68f){logger[_0xd366('0x15')](_0xd366('0x26'),_0xa4a68f['message'],_0x38b1cc);_0x22a6ac(_this['error'](0x1f4,_0xa4a68f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 8c74ecc..debe4b7 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 _0x5984=['emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','update'];(function(_0x57fe95,_0x4c5989){var _0x1baf35=function(_0x5522bc){while(--_0x5522bc){_0x57fe95['push'](_0x57fe95['shift']());}};_0x1baf35(++_0x4c5989);}(_0x5984,0x13d));var _0x4598=function(_0x13c377,_0x498416){_0x13c377=_0x13c377-0x0;var _0x36f033=_0x5984[_0x13c377];return _0x36f033;};'use strict';var SmsInteractionEvents=require(_0x4598('0x0'));var events=[_0x4598('0x1'),'remove',_0x4598('0x2')];function createListener(_0x39a601,_0xa3fe32){return function(_0x2deea5){_0xa3fe32[_0x4598('0x3')](_0x39a601,_0x2deea5);};}function removeListener(_0x54eb70,_0x32bb2c){return function(){SmsInteractionEvents[_0x4598('0x4')](_0x54eb70,_0x32bb2c);};}exports[_0x4598('0x5')]=function(_0x188670){for(var _0x89c25f=0x0,_0x516e65=events[_0x4598('0x6')];_0x89c25f<_0x516e65;_0x89c25f++){var _0x148416=events[_0x89c25f];var _0x1d98e3=createListener(_0x4598('0x7')+_0x148416,_0x188670);SmsInteractionEvents['on'](_0x148416,_0x1d98e3);}}; \ No newline at end of file +var _0x1239=['register','length','smsInteraction:','./smsInteraction.events','save','remove','update','emit','removeListener'];(function(_0x1def75,_0x4cf279){var _0x2fc454=function(_0x4575c6){while(--_0x4575c6){_0x1def75['push'](_0x1def75['shift']());}};_0x2fc454(++_0x4cf279);}(_0x1239,0x17d));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var SmsInteractionEvents=require(_0x9123('0x0'));var events=[_0x9123('0x1'),_0x9123('0x2'),_0x9123('0x3')];function createListener(_0x56b5b6,_0x46256a){return function(_0x166e87){_0x46256a[_0x9123('0x4')](_0x56b5b6,_0x166e87);};}function removeListener(_0xcf1e97,_0x598443){return function(){SmsInteractionEvents[_0x9123('0x5')](_0xcf1e97,_0x598443);};}exports[_0x9123('0x6')]=function(_0x3426cc){for(var _0x1cf200=0x0,_0x1ef41b=events[_0x9123('0x7')];_0x1cf200<_0x1ef41b;_0x1cf200++){var _0x94a40b=events[_0x1cf200];var _0x5ef1cf=createListener(_0x9123('0x8')+_0x94a40b,_0x3426cc);SmsInteractionEvents['on'](_0x94a40b,_0x5ef1cf);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 94a7893..74aeae6 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 _0x4070=['status','update','put','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','show','post','sms','smsmessage:create','create','/:id/status'];(function(_0x1056fc,_0x42dd68){var _0x527459=function(_0x2003e6){while(--_0x2003e6){_0x1056fc['push'](_0x1056fc['shift']());}};_0x527459(++_0x42dd68);}(_0x4070,0x12b));var _0x0407=function(_0x28c807,_0x5647ac){_0x28c807=_0x28c807-0x0;var _0x1266d2=_0x4070[_0x28c807];return _0x1266d2;};'use strict';var multer=require(_0x0407('0x0'));var util=require('util');var path=require(_0x0407('0x1'));var timeout=require(_0x0407('0x2'));var express=require(_0x0407('0x3'));var router=express[_0x0407('0x4')]();var fs_extra=require(_0x0407('0x5'));var auth=require(_0x0407('0x6'));var interaction=require(_0x0407('0x7'));var config=require(_0x0407('0x8'));var controller=require('./smsMessage.controller');router[_0x0407('0x9')]('/',auth['isAuthenticated'](),controller[_0x0407('0xa')]);router[_0x0407('0x9')](_0x0407('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x0407('0x9')](_0x0407('0xc'),auth[_0x0407('0xd')](),controller[_0x0407('0xe')]);router[_0x0407('0xf')]('/',auth[_0x0407('0xd')](),interaction['tracked'](_0x0407('0x10'),_0x0407('0x11')),controller[_0x0407('0x12')]);router[_0x0407('0xf')](_0x0407('0x13'),controller[_0x0407('0x14')]);router['put']('/:id',auth[_0x0407('0xd')](),controller[_0x0407('0x15')]);router[_0x0407('0x16')]('/:id/accept',auth['isAuthenticated'](),controller[_0x0407('0x17')]);router['put'](_0x0407('0x18'),auth[_0x0407('0xd')](),controller[_0x0407('0x19')]);router[_0x0407('0x1a')](_0x0407('0xc'),auth[_0x0407('0xd')](),controller[_0x0407('0x1b')]);module[_0x0407('0x1c')]=router; \ No newline at end of file +var _0x9803=['put','/:id/accept','accept','reject','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','sms','smsmessage:create','create','post','/:id/status','status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9803,0x113));var _0x3980=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x9803[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x3980('0x0'));var util=require(_0x3980('0x1'));var path=require(_0x3980('0x2'));var timeout=require(_0x3980('0x3'));var express=require(_0x3980('0x4'));var router=express['Router']();var fs_extra=require(_0x3980('0x5'));var auth=require(_0x3980('0x6'));var interaction=require(_0x3980('0x7'));var config=require(_0x3980('0x8'));var controller=require(_0x3980('0x9'));router[_0x3980('0xa')]('/',auth['isAuthenticated'](),controller[_0x3980('0xb')]);router[_0x3980('0xa')](_0x3980('0xc'),auth[_0x3980('0xd')](),controller[_0x3980('0xe')]);router[_0x3980('0xa')](_0x3980('0xf'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x3980('0x10'),_0x3980('0x11')),controller[_0x3980('0x12')]);router[_0x3980('0x13')](_0x3980('0x14'),controller[_0x3980('0x15')]);router[_0x3980('0x16')]('/:id',auth[_0x3980('0xd')](),controller['update']);router['put'](_0x3980('0x17'),auth['isAuthenticated'](),controller[_0x3980('0x18')]);router[_0x3980('0x16')]('/:id/reject',auth[_0x3980('0xd')](),controller[_0x3980('0x19')]);router[_0x3980('0x1a')](_0x3980('0xf'),auth[_0x3980('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3922c77..1482c6c 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 _0x80ce=['BOOLEAN','out','STRING','TEXT','medium'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0x80ce,0xae));var _0xe80c=function(_0x38a83a,_0x4eff6a){_0x38a83a=_0x38a83a-0x0;var _0x349dd7=_0x80ce[_0x38a83a];return _0x349dd7;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xe80c('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xe80c('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe80c('0x2')),'defaultValue':_0xe80c('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe80c('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe80c('0x3')]},'providerResponse':{'type':Sequelize[_0xe80c('0x4')]}}; \ No newline at end of file +var _0x609b=['DATE','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x42d57b,_0x4e962d){var _0x43ec08=function(_0x5e1b65){while(--_0x5e1b65){_0x42d57b['push'](_0x42d57b['shift']());}};_0x43ec08(++_0x4e962d);}(_0x609b,0x1b7));var _0xb609=function(_0x52e030,_0x5d0cf0){_0x52e030=_0x52e030-0x0;var _0x4d8fda=_0x609b[_0x52e030];return _0x4d8fda;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xb609('0x0')](_0xb609('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb609('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb609('0x3')),'defaultValue':_0xb609('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb609('0x4')](0xbe)},'phone':{'type':Sequelize[_0xb609('0x4')]},'readAt':{'type':Sequelize[_0xb609('0x5')]},'secret':{'type':Sequelize[_0xb609('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb609('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3ced4a8..4741a04 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 _0x30d4=['model','map','query','keys','filters','attributes','intersection','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','find','create','update','body','describe','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','sms-interactions','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./smsMessage.socket','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','status','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key'];(function(_0x3908ad,_0x54ccd7){var _0x22f133=function(_0xd29958){while(--_0xd29958){_0x3908ad['push'](_0x3908ad['shift']());}};_0x22f133(++_0x54ccd7);}(_0x30d4,0xed));var _0x430d=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x30d4[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require(_0x430d('0x0'));var rimraf=require(_0x430d('0x1'));var zipdir=require(_0x430d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x430d('0x3'));var moment=require('moment');var BPromise=require(_0x430d('0x4'));var Mustache=require(_0x430d('0x5'));var util=require('util');var path=require(_0x430d('0x6'));var sox=require(_0x430d('0x7'));var csv=require(_0x430d('0x8'));var ejs=require(_0x430d('0x9'));var fs=require('fs');var fs_extra=require(_0x430d('0xa'));var _=require('lodash');var squel=require(_0x430d('0xb'));var crypto=require(_0x430d('0xc'));var jsforce=require(_0x430d('0xd'));var deskjs=require(_0x430d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x430d('0xf'));var Redis=require(_0x430d('0x10'));var authService=require(_0x430d('0x11'));var qs=require(_0x430d('0x12'));var as=require(_0x430d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x430d('0x14'))(_0x430d('0x15'));var utils=require(_0x430d('0x16'));var config=require(_0x430d('0x17'));var licenseUtil=require(_0x430d('0x18'));var db=require(_0x430d('0x19'))['db'];config[_0x430d('0x1a')]=_['defaults'](config[_0x430d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x430d('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x430d('0x1c')][_0x430d('0x1d')]({'port':0x232c});var client9002=jayson[_0x430d('0x1c')][_0x430d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xd58ed3,_0x597048,_0x4a67b9,_0x3e3fac){return new BPromise(function(_0x19e448,_0x4fc8de){var _0xa1b0a=_0x3e3fac||client;return _0xa1b0a[_0x430d('0x1e')](_0xd58ed3,_0x4a67b9)['then'](function(_0x573422){logger[_0x430d('0x1f')](_0x430d('0x20'),_0x597048,_0x430d('0x21'));logger[_0x430d('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x597048,_0x430d('0x21'),JSON[_0x430d('0x23')](_0x573422));if(_0x573422[_0x430d('0x24')]){if(_0x573422[_0x430d('0x24')]['code']===0x1f4){logger['error'](_0x430d('0x20'),_0x597048,_0x573422[_0x430d('0x24')]['message']);return _0x4fc8de(_0x573422[_0x430d('0x24')][_0x430d('0x25')]);}logger[_0x430d('0x24')]('SmsMessage,\x20%s,\x20%s',_0x597048,_0x573422[_0x430d('0x24')][_0x430d('0x25')]);return _0x19e448(_0x573422[_0x430d('0x24')][_0x430d('0x25')]);}else{logger[_0x430d('0x1f')]('SmsMessage,\x20%s,\x20%s',_0x597048,'request\x20sent');_0x19e448(_0x573422[_0x430d('0x26')][_0x430d('0x25')]);}})['catch'](function(_0x4622c2){logger[_0x430d('0x24')](_0x430d('0x20'),_0x597048,_0x4622c2);_0x4fc8de(_0x4622c2);});});}function respondWithStatusCode(_0x5d004c,_0x5c46e5){_0x5c46e5=_0x5c46e5||0xcc;return function(_0x5f11a1){if(_0x5f11a1){return _0x5d004c[_0x430d('0x27')](_0x5c46e5);}return _0x5d004c['status'](_0x5c46e5)[_0x430d('0x28')]();};}function respondWithResult(_0x19f1d1,_0x44da24){_0x44da24=_0x44da24||0xc8;return function(_0x5a3fa3){if(_0x5a3fa3){return _0x19f1d1['status'](_0x44da24)[_0x430d('0x29')](_0x5a3fa3);}};}function respondWithFilteredResult(_0x4bfb7b,_0x1dbca2){return function(_0x3db5c3){if(_0x3db5c3){var _0x37df46=typeof _0x1dbca2[_0x430d('0x2a')]===_0x430d('0x2b')&&typeof _0x1dbca2['limit']===_0x430d('0x2b');var _0x38bf20=_0x3db5c3[_0x430d('0x2c')];var _0x32907d=_0x37df46?0x0:_0x1dbca2[_0x430d('0x2a')];var _0x2dfe1c=_0x37df46?_0x3db5c3[_0x430d('0x2c')]:_0x1dbca2[_0x430d('0x2a')]+_0x1dbca2[_0x430d('0x2d')];var _0x4a3614;if(_0x2dfe1c>=_0x38bf20){_0x2dfe1c=_0x38bf20;_0x4a3614=0xc8;}else{_0x4a3614=0xce;}_0x4bfb7b['status'](_0x4a3614);return _0x4bfb7b['set'](_0x430d('0x2e'),_0x32907d+'-'+_0x2dfe1c+'/'+_0x38bf20)[_0x430d('0x29')](_0x3db5c3);}return null;};}function patchUpdates(_0x4d9bf1){return function(_0x1f19c1){try{jsonpatch[_0x430d('0x2f')](_0x1f19c1,_0x4d9bf1,!![]);}catch(_0xcfede5){return BPromise['reject'](_0xcfede5);}return _0x1f19c1[_0x430d('0x30')]();};}function saveUpdates(_0x28ac59,_0xe6397c){return function(_0x531785){if(_0x531785){return _0x531785['update'](_0x28ac59)[_0x430d('0x31')](function(_0x44a1d2){return _0x44a1d2;});}return null;};}function removeEntity(_0x578a3f,_0x4385d5){return function(_0x3eb8c2){if(_0x3eb8c2){return _0x3eb8c2[_0x430d('0x32')]()[_0x430d('0x31')](function(){_0x578a3f[_0x430d('0x33')](0xcc)[_0x430d('0x28')]();});}};}function handleEntityNotFound(_0x3c2278,_0x1cd9f3){return function(_0x3dbc61){if(!_0x3dbc61){_0x3c2278[_0x430d('0x27')](0x194);}return _0x3dbc61;};}function handleError(_0x23a1e6,_0x10ef06){_0x10ef06=_0x10ef06||0x1f4;return function(_0x486476){logger[_0x430d('0x24')](_0x486476[_0x430d('0x34')]);if(_0x486476[_0x430d('0x35')]){delete _0x486476[_0x430d('0x35')];}_0x23a1e6[_0x430d('0x33')](_0x10ef06)[_0x430d('0x36')](_0x486476);};}exports[_0x430d('0x37')]=function(_0x1f063a,_0x20f019){var _0x463fde={},_0x2e518d={},_0xb9987={'count':0x0,'rows':[]};var _0x5e574b=_['map'](db[_0x430d('0x38')][_0x430d('0x39')],function(_0x5c8424){return{'name':_0x5c8424[_0x430d('0x3a')],'type':_0x5c8424[_0x430d('0x3b')][_0x430d('0x3c')]};});_0x2e518d[_0x430d('0x3d')]=_[_0x430d('0x3e')](_0x5e574b,'name');_0x2e518d[_0x430d('0x3f')]=_[_0x430d('0x40')](_0x1f063a['query']);_0x2e518d[_0x430d('0x41')]=_['intersection'](_0x2e518d[_0x430d('0x3d')],_0x2e518d[_0x430d('0x3f')]);_0x463fde[_0x430d('0x42')]=_[_0x430d('0x43')](_0x2e518d[_0x430d('0x3d')],qs['fields'](_0x1f063a[_0x430d('0x3f')]['fields']));_0x463fde['attributes']=_0x463fde[_0x430d('0x42')][_0x430d('0x44')]?_0x463fde[_0x430d('0x42')]:_0x2e518d[_0x430d('0x3d')];if(!_0x1f063a[_0x430d('0x3f')]['hasOwnProperty'](_0x430d('0x45'))){_0x463fde[_0x430d('0x2d')]=qs[_0x430d('0x2d')](_0x1f063a[_0x430d('0x3f')][_0x430d('0x2d')]);_0x463fde[_0x430d('0x2a')]=qs[_0x430d('0x2a')](_0x1f063a[_0x430d('0x3f')]['offset']);}_0x463fde[_0x430d('0x46')]=qs[_0x430d('0x47')](_0x1f063a[_0x430d('0x3f')]['sort']);_0x463fde[_0x430d('0x48')]=qs[_0x430d('0x41')](_[_0x430d('0x49')](_0x1f063a[_0x430d('0x3f')],_0x2e518d[_0x430d('0x41')]),_0x5e574b);if(_0x1f063a[_0x430d('0x3f')][_0x430d('0x4a')]){_0x463fde[_0x430d('0x48')]=_[_0x430d('0x4b')](_0x463fde[_0x430d('0x48')],{'$or':_[_0x430d('0x3e')](_0x5e574b,function(_0x10a269){if(_0x10a269[_0x430d('0x3b')]!==_0x430d('0x4c')){var _0xd0b90e={};_0xd0b90e[_0x10a269['name']]={'$like':'%'+_0x1f063a[_0x430d('0x3f')][_0x430d('0x4a')]+'%'};return _0xd0b90e;}})});}_0x463fde=_[_0x430d('0x4b')]({},_0x463fde,_0x1f063a['options']);var _0x149ec8={'where':_0x463fde[_0x430d('0x48')]};return db[_0x430d('0x38')]['count'](_0x149ec8)['then'](function(_0xcba4df){_0xb9987[_0x430d('0x2c')]=_0xcba4df;if(_0x1f063a[_0x430d('0x3f')][_0x430d('0x4d')]){_0x463fde['include']=[{'all':!![]}];}return db[_0x430d('0x38')][_0x430d('0x4e')](_0x463fde);})[_0x430d('0x31')](function(_0x27e58e){_0xb9987[_0x430d('0x4f')]=_0x27e58e;return _0xb9987;})[_0x430d('0x31')](respondWithFilteredResult(_0x20f019,_0x463fde))[_0x430d('0x50')](handleError(_0x20f019,null));};exports[_0x430d('0x51')]=function(_0x27ddfd,_0x1a0b7f){var _0x2ca06a={'raw':!![],'where':{'id':_0x27ddfd[_0x430d('0x52')]['id']}},_0x5b2eba={};_0x5b2eba['model']=_[_0x430d('0x40')](db['SmsMessage']['rawAttributes']);_0x5b2eba[_0x430d('0x3f')]=_[_0x430d('0x40')](_0x27ddfd[_0x430d('0x3f')]);_0x5b2eba[_0x430d('0x41')]=_[_0x430d('0x43')](_0x5b2eba[_0x430d('0x3d')],_0x5b2eba['query']);_0x2ca06a[_0x430d('0x42')]=_['intersection'](_0x5b2eba[_0x430d('0x3d')],qs[_0x430d('0x53')](_0x27ddfd[_0x430d('0x3f')][_0x430d('0x53')]));_0x2ca06a[_0x430d('0x42')]=_0x2ca06a[_0x430d('0x42')][_0x430d('0x44')]?_0x2ca06a[_0x430d('0x42')]:_0x5b2eba[_0x430d('0x3d')];if(_0x27ddfd[_0x430d('0x3f')]['includeAll']){_0x2ca06a[_0x430d('0x54')]=[{'all':!![]}];}_0x2ca06a=_['merge']({},_0x2ca06a,_0x27ddfd['options']);return db[_0x430d('0x38')][_0x430d('0x55')](_0x2ca06a)[_0x430d('0x31')](handleEntityNotFound(_0x1a0b7f,null))['then'](respondWithResult(_0x1a0b7f,null))['catch'](handleError(_0x1a0b7f,null));};exports[_0x430d('0x56')]=function(_0x54c37b,_0x3351df){return db[_0x430d('0x38')]['create'](_0x54c37b['body'],{})['then'](respondWithResult(_0x3351df,0xc9))[_0x430d('0x50')](handleError(_0x3351df,null));};exports[_0x430d('0x57')]=function(_0xa2fef6,_0x5f4e60){if(_0xa2fef6[_0x430d('0x58')]['id']){delete _0xa2fef6['body']['id'];}return db['SmsMessage']['find']({'where':{'id':_0xa2fef6[_0x430d('0x52')]['id']}})[_0x430d('0x31')](handleEntityNotFound(_0x5f4e60,null))['then'](saveUpdates(_0xa2fef6[_0x430d('0x58')],null))[_0x430d('0x31')](respondWithResult(_0x5f4e60,null))['catch'](handleError(_0x5f4e60,null));};exports['destroy']=function(_0x437b7c,_0x2b7e0c){return db[_0x430d('0x38')][_0x430d('0x55')]({'where':{'id':_0x437b7c[_0x430d('0x52')]['id']}})['then'](handleEntityNotFound(_0x2b7e0c,null))[_0x430d('0x31')](removeEntity(_0x2b7e0c,null))[_0x430d('0x50')](handleError(_0x2b7e0c,null));};exports['describe']=function(_0x5f2e97,_0x5f064f){return db[_0x430d('0x38')][_0x430d('0x59')]()[_0x430d('0x31')](respondWithResult(_0x5f064f,null))[_0x430d('0x50')](handleError(_0x5f064f,null));};var interaction_log=require(_0x430d('0x14'))('sms-interactions');exports[_0x430d('0x5a')]=function(_0x5b3e1b,_0xa7bb3f,_0x2194d9){var _0x640f82={'agent':{},'channel':_0x430d('0x5b')};if(_0x5b3e1b[_0x430d('0x58')]['id']){delete _0x5b3e1b[_0x430d('0x58')]['id'];}_0x5b3e1b[_0x430d('0x58')][_0x430d('0x5c')]=!![];_0x5b3e1b[_0x430d('0x58')][_0x430d('0x5d')]=moment()[_0x430d('0x5e')](_0x430d('0x5f'));_0x5b3e1b[_0x430d('0x58')][_0x430d('0x60')]=_0x5b3e1b[_0x430d('0x58')][_0x430d('0x60')]||_0x5b3e1b[_0x430d('0x61')]['id'];_0x640f82[_0x430d('0x62')]['id']=_0x5b3e1b[_0x430d('0x58')][_0x430d('0x60')];return db[_0x430d('0x38')]['find']({'where':{'id':_0x5b3e1b[_0x430d('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xa7bb3f,null))[_0x430d('0x31')](saveUpdates(_0x5b3e1b[_0x430d('0x58')],null))[_0x430d('0x31')](function(_0x1fc2de){if(_0x1fc2de){_0x640f82[_0x430d('0x25')]=_0x1fc2de[_0x430d('0x63')]({'plain':!![]});return db[_0x430d('0x64')]['find']({'where':{'id':_0x1fc2de[_0x430d('0x65')]}});}return null;})[_0x430d('0x31')](handleEntityNotFound(_0xa7bb3f,null))[_0x430d('0x31')](function(_0x3b0064){if(_0x3b0064){return _0x3b0064['update']({'UserId':_0x5b3e1b[_0x430d('0x58')][_0x430d('0x60')],'read1stAt':_['isNil'](_0x3b0064[_0x430d('0x66')])?moment()[_0x430d('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x430d('0x31')](function(_0x366389){if(_0x366389){_0x640f82[_0x430d('0x67')]=_0x366389[_0x430d('0x63')]({'plain':!![]});interaction_log['info'](_0x430d('0x68'),_0x5b3e1b[_0x430d('0x61')]['id'],_0x5b3e1b[_0x430d('0x61')][_0x430d('0x35')],_0x5b3e1b[_0x430d('0x61')][_0x430d('0x69')],_0x640f82[_0x430d('0x67')]['id'],_0x5b3e1b[_0x430d('0x58')]?JSON[_0x430d('0x23')](_0x5b3e1b[_0x430d('0x58')]):_0x430d('0x6a'));return respondWithRpcPromise(_0x430d('0x6b'),_0x430d('0x6c'),_0x640f82);}return null;})['then'](function(_0x36aabb){var _0x3cbcbe='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x36aabb[_0x430d('0x25')][_0x430d('0x6d')];return db['sequelize'][_0x430d('0x3f')](_0x3cbcbe,{'type':db[_0x430d('0x6e')][_0x430d('0x6f')][_0x430d('0x70')],'raw':!![]})[_0x430d('0x31')](function(_0x503a1a){return _0x503a1a;});})[_0x430d('0x31')](function(_0x3559ef){if(_0x3559ef){_0x640f82['message'][_0x430d('0x71')]=_0x3559ef[0x0];if(!_0x5b3e1b[_0x430d('0x58')]['UserId'])return;return db[_0x430d('0x72')][_0x430d('0x55')]({'where':{'id':_0x5b3e1b[_0x430d('0x58')][_0x430d('0x60')],'role':_0x430d('0x62')},'attributes':['id','name',_0x430d('0x73'),_0x430d('0x74'),_0x430d('0x75')],'raw':!![]});}return null;})['then'](function(_0x1964be){if(!_0x1964be)return null;_0x640f82['message'][_0x430d('0x62')]=_0x1964be;return _0x640f82;})[_0x430d('0x31')](function(_0x5da79c){if(_0x5da79c){if(_0x5b3e1b['body'][_0x430d('0x76')]){_0x640f82[_0x430d('0x25')][_0x430d('0x77')]=util[_0x430d('0x5e')](_0x430d('0x78'),_0x5b3e1b[_0x430d('0x61')][_0x430d('0x35')]);_0x640f82[_0x430d('0x25')]['channel']=_0x640f82[_0x430d('0x79')];_0x640f82['message'][_0x430d('0x7a')]=_0x640f82['channel'];_0x640f82[_0x430d('0x25')]['event']=_0x430d('0x5a');return respondWithRpcPromise(_0x430d('0x7b'),_0x430d('0x7b'),{'event':_0x430d('0x7c'),'message':_0x640f82[_0x430d('0x25')]},client9002)[_0x430d('0x31')](function(){return _0x640f82;});}return _0x640f82;}return null;})[_0x430d('0x31')](respondWithResult(_0xa7bb3f,null))[_0x430d('0x50')](handleError(_0xa7bb3f,null));};var interaction_log=require('../../config/logger')(_0x430d('0x7d'));exports['reject']=function(_0x34d5e5,_0x7464d7,_0x2ac9a8){var _0x5cd60a={'agent':{},'channel':_0x430d('0x5b')};if(_0x34d5e5[_0x430d('0x58')]['id']){delete _0x34d5e5[_0x430d('0x58')]['id'];}_0x34d5e5[_0x430d('0x58')][_0x430d('0x60')]=_0x34d5e5['body']['UserId']||_0x34d5e5[_0x430d('0x61')]['id'];_0x5cd60a[_0x430d('0x62')]['id']=_0x34d5e5[_0x430d('0x58')][_0x430d('0x60')];return db[_0x430d('0x38')]['find']({'where':{'id':_0x34d5e5[_0x430d('0x52')]['id'],'UserId':null}})[_0x430d('0x31')](handleEntityNotFound(_0x7464d7,null))[_0x430d('0x31')](function(_0x4b4530){if(_0x4b4530){_0x5cd60a[_0x430d('0x25')]=_0x4b4530[_0x430d('0x63')]({'plain':!![]});return db[_0x430d('0x64')][_0x430d('0x55')]({'where':{'id':_0x4b4530[_0x430d('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x7464d7,null))[_0x430d('0x31')](function(_0x403935){if(_0x403935){_0x5cd60a[_0x430d('0x67')]=_0x403935[_0x430d('0x63')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34d5e5[_0x430d('0x61')]['id'],_0x34d5e5[_0x430d('0x61')][_0x430d('0x35')],_0x34d5e5[_0x430d('0x61')]['role'],_0x5cd60a[_0x430d('0x67')]['id'],_0x34d5e5[_0x430d('0x58')]?JSON[_0x430d('0x23')](_0x34d5e5[_0x430d('0x58')]):_0x430d('0x6a'));return respondWithRpcPromise(_0x430d('0x7e'),_0x430d('0x7f'),_0x5cd60a);}return null;})[_0x430d('0x31')](function(_0x4416f2){var _0x261ce3=_0x430d('0x80')+_0x4416f2[_0x430d('0x25')][_0x430d('0x6d')];return db[_0x430d('0x81')]['query'](_0x261ce3,{'type':db[_0x430d('0x6e')][_0x430d('0x6f')][_0x430d('0x70')],'raw':!![]})[_0x430d('0x31')](function(_0x1b76fe){return _0x1b76fe;});})[_0x430d('0x31')](function(_0xe36623){if(_0xe36623){_0x5cd60a['message'][_0x430d('0x71')]=_0xe36623[0x0];if(!_0x34d5e5['body']['UserId'])return;return db['User'][_0x430d('0x55')]({'where':{'id':_0x34d5e5[_0x430d('0x58')][_0x430d('0x60')],'role':'agent'},'attributes':['id',_0x430d('0x35'),_0x430d('0x73'),_0x430d('0x74'),_0x430d('0x75')],'raw':!![]});}return null;})[_0x430d('0x31')](function(_0x383412){if(!_0x383412)return null;_0x5cd60a['message'][_0x430d('0x62')]=_0x383412;return _0x5cd60a;})[_0x430d('0x31')](function(_0x3bcb39){if(_0x3bcb39){_0x3bcb39[_0x430d('0x25')][_0x430d('0x77')]=util['format'](_0x430d('0x78'),_0x34d5e5[_0x430d('0x61')][_0x430d('0x35')]);_0x3bcb39[_0x430d('0x25')][_0x430d('0x79')]=_0x5cd60a['channel'];_0x3bcb39[_0x430d('0x25')][_0x430d('0x7a')]=_0x5cd60a[_0x430d('0x79')];_0x3bcb39['message']['event']='reject';respondWithRpcPromise(_0x430d('0x7b'),_0x430d('0x7b'),{'event':_0x430d('0x82'),'message':_0x3bcb39[_0x430d('0x25')]},client9002);return _0x5cd60a;}return null;})[_0x430d('0x31')](respondWithResult(_0x7464d7,null))[_0x430d('0x50')](handleError(_0x7464d7,null));};exports['status']=function(_0x2483bd,_0x4b5c2c,_0x4c015e){if(_0x2483bd['body']['id']){delete _0x2483bd['body']['id'];}var _0x4625f1;return db[_0x430d('0x38')]['find']({'where':{'id':_0x2483bd[_0x430d('0x52')]['id']}})[_0x430d('0x31')](handleEntityNotFound(_0x4b5c2c,null))[_0x430d('0x31')](function(_0x391d7d){if(_0x391d7d){_0x4625f1=_0x391d7d;return db[_0x430d('0x83')][_0x430d('0x55')]({'where':{'id':_0x391d7d['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x4b5c2c,null))[_0x430d('0x31')](function(_0x1ea196){if(_0x1ea196){logger[_0x430d('0x22')](_0x430d('0x84'),_0x430d('0x33'),_0x430d('0x85'),_0x1ea196[_0x430d('0x3b')],util[_0x430d('0x86')](_0x2483bd['body'],{'showHidden':![],'depth':null}));switch(_0x1ea196[_0x430d('0x3b')]){case _0x430d('0x87'):if(_0x2483bd[_0x430d('0x58')][_0x430d('0x88')]&&_0x2483bd['body'][_0x430d('0x88')]===_0x4625f1[_0x430d('0x89')]){return _0x4625f1[_0x430d('0x57')]({'read':!![]});}else{logger[_0x430d('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x430d('0x87'),util[_0x430d('0x86')](_0x2483bd[_0x430d('0x58')],{'showHidden':![],'depth':null}));}break;case _0x430d('0x8a'):if(_0x2483bd[_0x430d('0x58')]['MessageUUID']&&_0x2483bd[_0x430d('0x58')]['MessageUUID']===_0x4625f1[_0x430d('0x89')]&&_[_0x430d('0x8b')]([_0x430d('0x8c'),_0x430d('0x8d')],_0x2483bd['body'][_0x430d('0x8e')])>=0x0){return _0x4625f1['update']({'read':!![]});}else{logger[_0x430d('0x24')](_0x430d('0x8f'),'status',_0x430d('0x90'),util[_0x430d('0x86')](_0x2483bd[_0x430d('0x58')],{'showHidden':![],'depth':null}));}break;case _0x430d('0x91'):var _0x5d6295=_0x2483bd[_0x430d('0x58')][_0x430d('0x92')][0x0];if(_0x5d6295[_0x430d('0x33')][_0x430d('0x93')]===_0x430d('0x94')){return _0x4625f1[_0x430d('0x57')]({'read':!![]});}else{logger['error'](_0x430d('0x8f'),'status',_0x430d('0x91'),util[_0x430d('0x86')](_0x2483bd[_0x430d('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x4625f1;}})[_0x430d('0x31')](respondWithResult(_0x4b5c2c,null))[_0x430d('0x50')](handleError(_0x4b5c2c,null));}; \ No newline at end of file +var _0xe458=['params','create','body','find','../../config/logger','sms-interactions','accept','sms','read','readAt','UserId','agent','SmsInteraction','SmsInteractionId','isNil','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','motionChannel','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','groupName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','Content-Range','apply','reject','save','update','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0xe458,0x160));var _0x8e45=function(_0x25e691,_0x4b1e8b){_0x25e691=_0x25e691-0x0;var _0x1d9a82=_0xe458[_0x25e691];return _0x1d9a82;};'use strict';var emlformat=require(_0x8e45('0x0'));var rimraf=require(_0x8e45('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e45('0x2'));var rp=require(_0x8e45('0x3'));var moment=require(_0x8e45('0x4'));var BPromise=require(_0x8e45('0x5'));var Mustache=require(_0x8e45('0x6'));var util=require(_0x8e45('0x7'));var path=require(_0x8e45('0x8'));var sox=require(_0x8e45('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e45('0xa'));var _=require(_0x8e45('0xb'));var squel=require(_0x8e45('0xc'));var crypto=require(_0x8e45('0xd'));var jsforce=require(_0x8e45('0xe'));var deskjs=require(_0x8e45('0xf'));var toCsv=require(_0x8e45('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8e45('0x11'));var as=require(_0x8e45('0x12'));var hardwareService=require(_0x8e45('0x13'));var logger=require('../../config/logger')(_0x8e45('0x14'));var utils=require(_0x8e45('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8e45('0x16'));var db=require(_0x8e45('0x17'))['db'];config['redis']=_[_0x8e45('0x18')](config[_0x8e45('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e45('0x1a'))(new Redis(config[_0x8e45('0x19')]));require(_0x8e45('0x1b'))['register'](socket);var jayson=require(_0x8e45('0x1c'));var client=jayson[_0x8e45('0x1d')][_0x8e45('0x1e')]({'port':0x232c});var client9002=jayson[_0x8e45('0x1d')][_0x8e45('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x368526,_0x46a39b,_0x2e1eeb,_0x1cc1d8){return new BPromise(function(_0x23071d,_0x3e8be2){var _0x1bbcec=_0x1cc1d8||client;return _0x1bbcec[_0x8e45('0x1f')](_0x368526,_0x2e1eeb)[_0x8e45('0x20')](function(_0x88e7e3){logger[_0x8e45('0x21')](_0x8e45('0x22'),_0x46a39b,'request\x20sent');logger[_0x8e45('0x23')](_0x8e45('0x24'),_0x46a39b,_0x8e45('0x25'),JSON[_0x8e45('0x26')](_0x88e7e3));if(_0x88e7e3[_0x8e45('0x27')]){if(_0x88e7e3['error'][_0x8e45('0x28')]===0x1f4){logger[_0x8e45('0x27')](_0x8e45('0x22'),_0x46a39b,_0x88e7e3[_0x8e45('0x27')]['message']);return _0x3e8be2(_0x88e7e3[_0x8e45('0x27')]['message']);}logger[_0x8e45('0x27')](_0x8e45('0x22'),_0x46a39b,_0x88e7e3[_0x8e45('0x27')][_0x8e45('0x29')]);return _0x23071d(_0x88e7e3[_0x8e45('0x27')][_0x8e45('0x29')]);}else{logger[_0x8e45('0x21')](_0x8e45('0x22'),_0x46a39b,_0x8e45('0x25'));_0x23071d(_0x88e7e3[_0x8e45('0x2a')][_0x8e45('0x29')]);}})[_0x8e45('0x2b')](function(_0x224695){logger['error'](_0x8e45('0x22'),_0x46a39b,_0x224695);_0x3e8be2(_0x224695);});});}function respondWithStatusCode(_0x1fbc5b,_0x46f919){_0x46f919=_0x46f919||0xcc;return function(_0x2afbb4){if(_0x2afbb4){return _0x1fbc5b[_0x8e45('0x2c')](_0x46f919);}return _0x1fbc5b[_0x8e45('0x2d')](_0x46f919)[_0x8e45('0x2e')]();};}function respondWithResult(_0x236834,_0x3be24d){_0x3be24d=_0x3be24d||0xc8;return function(_0x581892){if(_0x581892){return _0x236834[_0x8e45('0x2d')](_0x3be24d)['json'](_0x581892);}};}function respondWithFilteredResult(_0xb0295d,_0x30b004){return function(_0x4e9f5c){if(_0x4e9f5c){var _0x185021=typeof _0x30b004[_0x8e45('0x2f')]===_0x8e45('0x30')&&typeof _0x30b004[_0x8e45('0x31')]===_0x8e45('0x30');var _0x16986f=_0x4e9f5c['count'];var _0x330cba=_0x185021?0x0:_0x30b004[_0x8e45('0x2f')];var _0x572a98=_0x185021?_0x4e9f5c['count']:_0x30b004[_0x8e45('0x2f')]+_0x30b004['limit'];var _0x59de90;if(_0x572a98>=_0x16986f){_0x572a98=_0x16986f;_0x59de90=0xc8;}else{_0x59de90=0xce;}_0xb0295d['status'](_0x59de90);return _0xb0295d['set'](_0x8e45('0x32'),_0x330cba+'-'+_0x572a98+'/'+_0x16986f)['json'](_0x4e9f5c);}return null;};}function patchUpdates(_0x2d1a3d){return function(_0x35214c){try{jsonpatch[_0x8e45('0x33')](_0x35214c,_0x2d1a3d,!![]);}catch(_0x453f71){return BPromise[_0x8e45('0x34')](_0x453f71);}return _0x35214c[_0x8e45('0x35')]();};}function saveUpdates(_0x361bbb,_0x3c9125){return function(_0x38a531){if(_0x38a531){return _0x38a531[_0x8e45('0x36')](_0x361bbb)[_0x8e45('0x20')](function(_0x4790b2){return _0x4790b2;});}return null;};}function removeEntity(_0x172266,_0x3e9924){return function(_0x1d5aa0){if(_0x1d5aa0){return _0x1d5aa0['destroy']()[_0x8e45('0x20')](function(){_0x172266[_0x8e45('0x2d')](0xcc)[_0x8e45('0x2e')]();});}};}function handleEntityNotFound(_0xfdf28d,_0x1f5529){return function(_0x329eab){if(!_0x329eab){_0xfdf28d[_0x8e45('0x2c')](0x194);}return _0x329eab;};}function handleError(_0x30943a,_0x3f3be7){_0x3f3be7=_0x3f3be7||0x1f4;return function(_0x4c32e9){logger['error'](_0x4c32e9[_0x8e45('0x37')]);if(_0x4c32e9[_0x8e45('0x38')]){delete _0x4c32e9[_0x8e45('0x38')];}_0x30943a['status'](_0x3f3be7)['send'](_0x4c32e9);};}exports[_0x8e45('0x39')]=function(_0x26290b,_0x18c62f){var _0x2ea817={},_0x1b0940={},_0xb5fcbf={'count':0x0,'rows':[]};var _0x398cad=_[_0x8e45('0x3a')](db[_0x8e45('0x3b')][_0x8e45('0x3c')],function(_0x1c0503){return{'name':_0x1c0503[_0x8e45('0x3d')],'type':_0x1c0503[_0x8e45('0x3e')][_0x8e45('0x3f')]};});_0x1b0940[_0x8e45('0x40')]=_[_0x8e45('0x3a')](_0x398cad,_0x8e45('0x38'));_0x1b0940['query']=_[_0x8e45('0x41')](_0x26290b['query']);_0x1b0940[_0x8e45('0x42')]=_[_0x8e45('0x43')](_0x1b0940[_0x8e45('0x40')],_0x1b0940[_0x8e45('0x44')]);_0x2ea817[_0x8e45('0x45')]=_[_0x8e45('0x43')](_0x1b0940['model'],qs[_0x8e45('0x46')](_0x26290b[_0x8e45('0x44')]['fields']));_0x2ea817[_0x8e45('0x45')]=_0x2ea817[_0x8e45('0x45')][_0x8e45('0x47')]?_0x2ea817[_0x8e45('0x45')]:_0x1b0940[_0x8e45('0x40')];if(!_0x26290b[_0x8e45('0x44')]['hasOwnProperty'](_0x8e45('0x48'))){_0x2ea817[_0x8e45('0x31')]=qs[_0x8e45('0x31')](_0x26290b[_0x8e45('0x44')][_0x8e45('0x31')]);_0x2ea817[_0x8e45('0x2f')]=qs['offset'](_0x26290b[_0x8e45('0x44')][_0x8e45('0x2f')]);}_0x2ea817[_0x8e45('0x49')]=qs[_0x8e45('0x4a')](_0x26290b[_0x8e45('0x44')][_0x8e45('0x4a')]);_0x2ea817[_0x8e45('0x4b')]=qs[_0x8e45('0x42')](_[_0x8e45('0x4c')](_0x26290b[_0x8e45('0x44')],_0x1b0940[_0x8e45('0x42')]),_0x398cad);if(_0x26290b[_0x8e45('0x44')][_0x8e45('0x4d')]){_0x2ea817[_0x8e45('0x4b')]=_[_0x8e45('0x4e')](_0x2ea817[_0x8e45('0x4b')],{'$or':_[_0x8e45('0x3a')](_0x398cad,function(_0x248245){if(_0x248245[_0x8e45('0x3e')]!==_0x8e45('0x4f')){var _0x26a281={};_0x26a281[_0x248245['name']]={'$like':'%'+_0x26290b[_0x8e45('0x44')]['filter']+'%'};return _0x26a281;}})});}_0x2ea817=_[_0x8e45('0x4e')]({},_0x2ea817,_0x26290b['options']);var _0x2f07df={'where':_0x2ea817[_0x8e45('0x4b')]};return db[_0x8e45('0x3b')][_0x8e45('0x50')](_0x2f07df)[_0x8e45('0x20')](function(_0x2b99d9){_0xb5fcbf[_0x8e45('0x50')]=_0x2b99d9;if(_0x26290b[_0x8e45('0x44')][_0x8e45('0x51')]){_0x2ea817[_0x8e45('0x52')]=[{'all':!![]}];}return db[_0x8e45('0x3b')][_0x8e45('0x53')](_0x2ea817);})[_0x8e45('0x20')](function(_0x48e896){_0xb5fcbf[_0x8e45('0x54')]=_0x48e896;return _0xb5fcbf;})[_0x8e45('0x20')](respondWithFilteredResult(_0x18c62f,_0x2ea817))['catch'](handleError(_0x18c62f,null));};exports[_0x8e45('0x55')]=function(_0x514aed,_0x4bf793){var _0x25d1aa={'raw':!![],'where':{'id':_0x514aed[_0x8e45('0x56')]['id']}},_0x55f30b={};_0x55f30b['model']=_[_0x8e45('0x41')](db[_0x8e45('0x3b')][_0x8e45('0x3c')]);_0x55f30b[_0x8e45('0x44')]=_['keys'](_0x514aed['query']);_0x55f30b[_0x8e45('0x42')]=_[_0x8e45('0x43')](_0x55f30b['model'],_0x55f30b[_0x8e45('0x44')]);_0x25d1aa[_0x8e45('0x45')]=_[_0x8e45('0x43')](_0x55f30b['model'],qs[_0x8e45('0x46')](_0x514aed[_0x8e45('0x44')]['fields']));_0x25d1aa[_0x8e45('0x45')]=_0x25d1aa[_0x8e45('0x45')][_0x8e45('0x47')]?_0x25d1aa[_0x8e45('0x45')]:_0x55f30b['model'];if(_0x514aed[_0x8e45('0x44')][_0x8e45('0x51')]){_0x25d1aa[_0x8e45('0x52')]=[{'all':!![]}];}_0x25d1aa=_['merge']({},_0x25d1aa,_0x514aed['options']);return db[_0x8e45('0x3b')]['find'](_0x25d1aa)['then'](handleEntityNotFound(_0x4bf793,null))[_0x8e45('0x20')](respondWithResult(_0x4bf793,null))['catch'](handleError(_0x4bf793,null));};exports[_0x8e45('0x57')]=function(_0x8f876a,_0x1a2683){return db['SmsMessage'][_0x8e45('0x57')](_0x8f876a[_0x8e45('0x58')],{})[_0x8e45('0x20')](respondWithResult(_0x1a2683,0xc9))[_0x8e45('0x2b')](handleError(_0x1a2683,null));};exports['update']=function(_0x454344,_0x2e3068){if(_0x454344[_0x8e45('0x58')]['id']){delete _0x454344[_0x8e45('0x58')]['id'];}return db[_0x8e45('0x3b')][_0x8e45('0x59')]({'where':{'id':_0x454344[_0x8e45('0x56')]['id']}})['then'](handleEntityNotFound(_0x2e3068,null))[_0x8e45('0x20')](saveUpdates(_0x454344[_0x8e45('0x58')],null))['then'](respondWithResult(_0x2e3068,null))[_0x8e45('0x2b')](handleError(_0x2e3068,null));};exports['destroy']=function(_0x518b72,_0x589cbd){return db['SmsMessage'][_0x8e45('0x59')]({'where':{'id':_0x518b72[_0x8e45('0x56')]['id']}})[_0x8e45('0x20')](handleEntityNotFound(_0x589cbd,null))['then'](removeEntity(_0x589cbd,null))[_0x8e45('0x2b')](handleError(_0x589cbd,null));};exports['describe']=function(_0x57ed43,_0x1b9161){return db[_0x8e45('0x3b')]['describe']()[_0x8e45('0x20')](respondWithResult(_0x1b9161,null))[_0x8e45('0x2b')](handleError(_0x1b9161,null));};var interaction_log=require(_0x8e45('0x5a'))(_0x8e45('0x5b'));exports[_0x8e45('0x5c')]=function(_0x244315,_0x5ef3f9,_0x55d640){var _0x3a73d5={'agent':{},'channel':_0x8e45('0x5d')};if(_0x244315[_0x8e45('0x58')]['id']){delete _0x244315['body']['id'];}_0x244315[_0x8e45('0x58')][_0x8e45('0x5e')]=!![];_0x244315[_0x8e45('0x58')][_0x8e45('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x244315[_0x8e45('0x58')][_0x8e45('0x60')]=_0x244315[_0x8e45('0x58')][_0x8e45('0x60')]||_0x244315['user']['id'];_0x3a73d5[_0x8e45('0x61')]['id']=_0x244315[_0x8e45('0x58')][_0x8e45('0x60')];return db[_0x8e45('0x3b')][_0x8e45('0x59')]({'where':{'id':_0x244315[_0x8e45('0x56')]['id'],'UserId':null}})[_0x8e45('0x20')](handleEntityNotFound(_0x5ef3f9,null))['then'](saveUpdates(_0x244315[_0x8e45('0x58')],null))[_0x8e45('0x20')](function(_0x251ad2){if(_0x251ad2){_0x3a73d5[_0x8e45('0x29')]=_0x251ad2['get']({'plain':!![]});return db[_0x8e45('0x62')]['find']({'where':{'id':_0x251ad2[_0x8e45('0x63')]}});}return null;})[_0x8e45('0x20')](handleEntityNotFound(_0x5ef3f9,null))[_0x8e45('0x20')](function(_0x96f789){if(_0x96f789){return _0x96f789[_0x8e45('0x36')]({'UserId':_0x244315[_0x8e45('0x58')][_0x8e45('0x60')],'read1stAt':_[_0x8e45('0x64')](_0x96f789['read1stAt'])?moment()[_0x8e45('0x65')](_0x8e45('0x66')):undefined});}return null;})[_0x8e45('0x20')](function(_0x4f9587){if(_0x4f9587){_0x3a73d5[_0x8e45('0x67')]=_0x4f9587['get']({'plain':!![]});interaction_log[_0x8e45('0x21')](_0x8e45('0x68'),_0x244315['user']['id'],_0x244315['user'][_0x8e45('0x38')],_0x244315[_0x8e45('0x69')][_0x8e45('0x6a')],_0x3a73d5['interaction']['id'],_0x244315[_0x8e45('0x58')]?JSON[_0x8e45('0x26')](_0x244315[_0x8e45('0x58')]):_0x8e45('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3a73d5);}return null;})[_0x8e45('0x20')](function(_0x3a3ea1){var _0x5a7210='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3a3ea1[_0x8e45('0x29')]['ContactId'];return db['sequelize'][_0x8e45('0x44')](_0x5a7210,{'type':db['Sequelize'][_0x8e45('0x6c')]['SELECT'],'raw':!![]})[_0x8e45('0x20')](function(_0x175c79){return _0x175c79;});})['then'](function(_0x4b2379){if(_0x4b2379){_0x3a73d5['message'][_0x8e45('0x6d')]=_0x4b2379[0x0];if(!_0x244315[_0x8e45('0x58')][_0x8e45('0x60')])return;return db[_0x8e45('0x6e')][_0x8e45('0x59')]({'where':{'id':_0x244315[_0x8e45('0x58')]['UserId'],'role':_0x8e45('0x61')},'attributes':['id',_0x8e45('0x38'),_0x8e45('0x6f'),_0x8e45('0x70'),_0x8e45('0x71')],'raw':!![]});}return null;})[_0x8e45('0x20')](function(_0xe986d0){if(!_0xe986d0)return null;_0x3a73d5[_0x8e45('0x29')][_0x8e45('0x61')]=_0xe986d0;return _0x3a73d5;})[_0x8e45('0x20')](function(_0x1e3488){if(_0x1e3488){if(_0x244315[_0x8e45('0x58')]['manual']){_0x3a73d5[_0x8e45('0x29')][_0x8e45('0x72')]=util[_0x8e45('0x65')](_0x8e45('0x73'),_0x244315[_0x8e45('0x69')][_0x8e45('0x38')]);_0x3a73d5['message']['channel']=_0x3a73d5[_0x8e45('0x74')];_0x3a73d5[_0x8e45('0x29')]['motionChannel']=_0x3a73d5['channel'];_0x3a73d5[_0x8e45('0x29')][_0x8e45('0x75')]=_0x8e45('0x5c');return respondWithRpcPromise('EventManager',_0x8e45('0x76'),{'event':_0x8e45('0x77'),'message':_0x3a73d5[_0x8e45('0x29')]},client9002)[_0x8e45('0x20')](function(){return _0x3a73d5;});}return _0x3a73d5;}return null;})[_0x8e45('0x20')](respondWithResult(_0x5ef3f9,null))['catch'](handleError(_0x5ef3f9,null));};var interaction_log=require('../../config/logger')(_0x8e45('0x5b'));exports[_0x8e45('0x34')]=function(_0xead9d,_0x6b5179,_0x4b1b30){var _0x5bc62d={'agent':{},'channel':_0x8e45('0x5d')};if(_0xead9d[_0x8e45('0x58')]['id']){delete _0xead9d[_0x8e45('0x58')]['id'];}_0xead9d[_0x8e45('0x58')][_0x8e45('0x60')]=_0xead9d['body'][_0x8e45('0x60')]||_0xead9d[_0x8e45('0x69')]['id'];_0x5bc62d[_0x8e45('0x61')]['id']=_0xead9d[_0x8e45('0x58')][_0x8e45('0x60')];return db[_0x8e45('0x3b')][_0x8e45('0x59')]({'where':{'id':_0xead9d['params']['id'],'UserId':null}})[_0x8e45('0x20')](handleEntityNotFound(_0x6b5179,null))[_0x8e45('0x20')](function(_0x223506){if(_0x223506){_0x5bc62d[_0x8e45('0x29')]=_0x223506['get']({'plain':!![]});return db[_0x8e45('0x62')][_0x8e45('0x59')]({'where':{'id':_0x223506['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x6b5179,null))[_0x8e45('0x20')](function(_0x435cde){if(_0x435cde){_0x5bc62d['interaction']=_0x435cde[_0x8e45('0x78')]({'plain':!![]});interaction_log[_0x8e45('0x21')](_0x8e45('0x79'),_0xead9d[_0x8e45('0x69')]['id'],_0xead9d[_0x8e45('0x69')]['name'],_0xead9d[_0x8e45('0x69')][_0x8e45('0x6a')],_0x5bc62d['interaction']['id'],_0xead9d['body']?JSON[_0x8e45('0x26')](_0xead9d['body']):_0x8e45('0x6b'));return respondWithRpcPromise(_0x8e45('0x7a'),'rejectMessage',_0x5bc62d);}return null;})[_0x8e45('0x20')](function(_0x219c8d){var _0x525238=_0x8e45('0x7b')+_0x219c8d[_0x8e45('0x29')][_0x8e45('0x7c')];return db[_0x8e45('0x7d')]['query'](_0x525238,{'type':db[_0x8e45('0x7e')][_0x8e45('0x6c')][_0x8e45('0x7f')],'raw':!![]})[_0x8e45('0x20')](function(_0x23c918){return _0x23c918;});})['then'](function(_0xc8aa73){if(_0xc8aa73){_0x5bc62d[_0x8e45('0x29')]['contact']=_0xc8aa73[0x0];if(!_0xead9d['body'][_0x8e45('0x60')])return;return db[_0x8e45('0x6e')][_0x8e45('0x59')]({'where':{'id':_0xead9d['body'][_0x8e45('0x60')],'role':'agent'},'attributes':['id',_0x8e45('0x38'),_0x8e45('0x6f'),_0x8e45('0x70'),_0x8e45('0x71')],'raw':!![]});}return null;})[_0x8e45('0x20')](function(_0x4fc409){if(!_0x4fc409)return null;_0x5bc62d['message'][_0x8e45('0x61')]=_0x4fc409;return _0x5bc62d;})[_0x8e45('0x20')](function(_0x836fd1){if(_0x836fd1){_0x836fd1[_0x8e45('0x29')][_0x8e45('0x72')]=util['format'](_0x8e45('0x73'),_0xead9d['user']['name']);_0x836fd1['message'][_0x8e45('0x74')]=_0x5bc62d['channel'];_0x836fd1[_0x8e45('0x29')][_0x8e45('0x80')]=_0x5bc62d['channel'];_0x836fd1[_0x8e45('0x29')][_0x8e45('0x75')]=_0x8e45('0x34');respondWithRpcPromise(_0x8e45('0x76'),_0x8e45('0x76'),{'event':_0x8e45('0x81'),'message':_0x836fd1[_0x8e45('0x29')]},client9002);return _0x5bc62d;}return null;})[_0x8e45('0x20')](respondWithResult(_0x6b5179,null))[_0x8e45('0x2b')](handleError(_0x6b5179,null));};exports['status']=function(_0x47702e,_0x4ac1ee,_0x1f0cfe){if(_0x47702e[_0x8e45('0x58')]['id']){delete _0x47702e['body']['id'];}var _0x3595e1;return db['SmsMessage'][_0x8e45('0x59')]({'where':{'id':_0x47702e[_0x8e45('0x56')]['id']}})[_0x8e45('0x20')](handleEntityNotFound(_0x4ac1ee,null))[_0x8e45('0x20')](function(_0x39d3ba){if(_0x39d3ba){_0x3595e1=_0x39d3ba;return db['SmsAccount'][_0x8e45('0x59')]({'where':{'id':_0x39d3ba[_0x8e45('0x82')]}});}})[_0x8e45('0x20')](handleEntityNotFound(_0x4ac1ee,null))[_0x8e45('0x20')](function(_0x4b2ce1){if(_0x4b2ce1){logger[_0x8e45('0x23')](_0x8e45('0x24'),_0x8e45('0x2d'),_0x8e45('0x83'),_0x4b2ce1['type'],util[_0x8e45('0x84')](_0x47702e[_0x8e45('0x58')],{'showHidden':![],'depth':null}));switch(_0x4b2ce1[_0x8e45('0x3e')]){case _0x8e45('0x85'):if(_0x47702e[_0x8e45('0x58')]['MessageSid']&&_0x47702e[_0x8e45('0x58')][_0x8e45('0x86')]===_0x3595e1[_0x8e45('0x87')]){return _0x3595e1[_0x8e45('0x36')]({'read':!![]});}else{logger[_0x8e45('0x27')](_0x8e45('0x88'),_0x8e45('0x2d'),_0x8e45('0x85'),util[_0x8e45('0x84')](_0x47702e['body'],{'showHidden':![],'depth':null}));}break;case _0x8e45('0x89'):if(_0x47702e[_0x8e45('0x58')][_0x8e45('0x8a')]&&_0x47702e[_0x8e45('0x58')][_0x8e45('0x8a')]===_0x3595e1[_0x8e45('0x87')]&&_[_0x8e45('0x8b')]([_0x8e45('0x8c'),_0x8e45('0x8d')],_0x47702e[_0x8e45('0x58')][_0x8e45('0x8e')])>=0x0){return _0x3595e1[_0x8e45('0x36')]({'read':!![]});}else{logger[_0x8e45('0x27')](_0x8e45('0x88'),_0x8e45('0x2d'),_0x8e45('0x8f'),util[_0x8e45('0x84')](_0x47702e['body'],{'showHidden':![],'depth':null}));}break;case _0x8e45('0x90'):var _0x6b5ada=_0x47702e[_0x8e45('0x58')]['results'][0x0];if(_0x6b5ada[_0x8e45('0x2d')][_0x8e45('0x91')]==='DELIVERED'){return _0x3595e1[_0x8e45('0x36')]({'read':!![]});}else{logger['error'](_0x8e45('0x88'),_0x8e45('0x2d'),_0x8e45('0x90'),util[_0x8e45('0x84')](_0x47702e[_0x8e45('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x3595e1;}})['then'](respondWithResult(_0x4ac1ee,null))['catch'](handleError(_0x4ac1ee,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index c389e7d..4728d0e 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 _0xc154=['SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x203b91,_0x32bf95){var _0x1a0b27=function(_0x31e210){while(--_0x31e210){_0x203b91['push'](_0x203b91['shift']());}};_0x1a0b27(++_0x32bf95);}(_0xc154,0x1e4));var _0x4c15=function(_0xe906b9,_0x2f2527){_0xe906b9=_0xe906b9-0x0;var _0x597872=_0xc154[_0xe906b9];return _0x597872;};'use strict';var EventEmitter=require(_0x4c15('0x0'));var SmsMessage=require(_0x4c15('0x1'))['db'][_0x4c15('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4c15('0x3')](0x0);var events={'afterCreate':_0x4c15('0x4'),'afterUpdate':_0x4c15('0x5'),'afterDestroy':'remove'};function emitEvent(_0x31d729){return function(_0x129de9,_0x1af88f,_0x3d27e1){SmsMessageEvents[_0x4c15('0x6')](_0x31d729+':'+_0x129de9['id'],_0x129de9);SmsMessageEvents[_0x4c15('0x6')](_0x31d729,_0x129de9);_0x3d27e1(null);};}for(var e in events){if(events[_0x4c15('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x4c15('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x65b9=['emit','exports','events','../../mysqldb','save','update','remove'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x65b9,0x80));var _0x965b=function(_0x39b2d1,_0x5abefc){_0x39b2d1=_0x39b2d1-0x0;var _0x128750=_0x65b9[_0x39b2d1];return _0x128750;};'use strict';var EventEmitter=require(_0x965b('0x0'));var SmsMessage=require(_0x965b('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x965b('0x2'),'afterUpdate':_0x965b('0x3'),'afterDestroy':_0x965b('0x4')};function emitEvent(_0x1bae4b){return function(_0x34525a,_0xe972c,_0x1e3dbe){SmsMessageEvents[_0x965b('0x5')](_0x1bae4b+':'+_0x34525a['id'],_0x34525a);SmsMessageEvents[_0x965b('0x5')](_0x1bae4b,_0x34525a);_0x1e3dbe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x965b('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 246cfbe..b7adc6a 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 _0x411e=['https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','md5','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','message','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','body','phone','remote','/api/sms/messages/','token','sid','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','password'];(function(_0x2710c8,_0x47c204){var _0x1ac5e6=function(_0x48f013){while(--_0x48f013){_0x2710c8['push'](_0x2710c8['shift']());}};_0x1ac5e6(++_0x47c204);}(_0x411e,0x138));var _0xe411=function(_0x58b301,_0x45e991){_0x58b301=_0x58b301-0x0;var _0x2171b3=_0x411e[_0x58b301];return _0x2171b3;};'use strict';var _=require(_0xe411('0x0'));var util=require(_0xe411('0x1'));var logger=require(_0xe411('0x2'))(_0xe411('0x3'));var moment=require(_0xe411('0x4'));var BPromise=require(_0xe411('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe411('0x6'));var rimraf=require('rimraf');var config=require(_0xe411('0x7'));var attributes=require(_0xe411('0x8'));module[_0xe411('0x9')]=function(_0x3c3a93,_0x33fd15){return _0x3c3a93[_0xe411('0xa')](_0xe411('0xb'),attributes,{'tableName':_0xe411('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xe411('0xd')]},{'name':_0xe411('0xe'),'fields':['body'],'type':_0xe411('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12f2fe,_0xbad2b5,_0x252892){var _0x3dc6c4=_0x3c3a93['models'];var _0x2465b2=_0x12f2fe[_0xe411('0x10')]({'plain':!![]});if(_0x2465b2[_0xe411('0x11')][_0xe411('0x12')]()==='in'||_0x2465b2['direction'][_0xe411('0x12')]()===_0xe411('0x13')&&!_0x2465b2[_0xe411('0x14')]&&!_[_0xe411('0x15')](_0x2465b2[_0xe411('0x16')])&&!_['isNil'](_0x2465b2[_0xe411('0x17')])){_0x3dc6c4[_0xe411('0x18')]['findOne']({'where':{'id':_0x2465b2[_0xe411('0x17')]}})[_0xe411('0x19')](function(_0x368469){if(_0x368469){_0x368469[_0xe411('0x1a')]({'lastMsgAt':_0x2465b2[_0xe411('0x1b')],'lastMsgDirection':_0x2465b2[_0xe411('0x11')][_0xe411('0x12')]()});}})[_0xe411('0x1c')](function(_0x1298df){console[_0xe411('0x1d')](_0x1298df);});}if(_0x2465b2[_0xe411('0x11')]===_0xe411('0x13')&&!_0x2465b2[_0xe411('0x14')]){var _0xeeeccf;_0x3dc6c4[_0xe411('0x1e')][_0xe411('0x1f')]({'where':{'id':_0x2465b2[_0xe411('0x20')]},'raw':!![]})[_0xe411('0x19')](function(_0x309833){_0xeeeccf=_0x309833;if(_0xeeeccf&&_0xeeeccf[_0xe411('0x21')]){switch(_0xeeeccf[_0xe411('0x21')]){case'twilio':var _0xde4865=require(_0xe411('0x22'));if(_0xeeeccf[_0xe411('0x23')]&&_0xeeeccf[_0xe411('0x24')]&&_0xeeeccf['phone']){var _0x3514ef=new _0xde4865(_0xeeeccf[_0xe411('0x23')],_0xeeeccf['authToken']);_0x3514ef[_0xe411('0x25')]['create']({'body':_0x2465b2[_0xe411('0x26')],'to':_0x2465b2[_0xe411('0x27')],'from':_0xeeeccf[_0xe411('0x27')],'statusCallback':_0xeeeccf[_0xe411('0x28')]+_0xe411('0x29')+_0x2465b2['id']+'/status?token='+_0xeeeccf[_0xe411('0x2a')]})[_0xe411('0x19')](function(_0x200796){if(_0x200796[_0xe411('0x2b')]){return _0x12f2fe[_0xe411('0x1a')]({'messageId':_0x200796[_0xe411('0x2b')]});}})[_0xe411('0x1c')](function(_0xad5d46){logger[_0xe411('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe411('0x2c'),_0xe411('0x22'),util['inspect'](_0xad5d46,{'showHidden':![],'depth':null}));});}else{logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xe411('0x2e'):var _0x1b8a1a=_0xe411('0x2f');if(_0xeeeccf[_0xe411('0x30')]&&_0xeeeccf['password']){var _0xaa8d16={'recipient':[_0x2465b2[_0xe411('0x27')]],'message':_0x2465b2['body'],'message_type':_0xeeeccf[_0xe411('0x31')]};if(_0xeeeccf[_0xe411('0x31')]&&_0xeeeccf[_0xe411('0x31')]!=='SI'){_0xaa8d16['sender']=_0xeeeccf[_0xe411('0x27')];}var _0x27bfc8={'url':_0x1b8a1a+_0xe411('0x32')+_0xeeeccf[_0xe411('0x30')]+_0xe411('0x33')+_0xeeeccf['password'],'method':_0xe411('0x34')};rp(_0x27bfc8)['then'](function(_0x20c0ef){var _0x41e19a=_0x20c0ef[_0xe411('0x35')](';');var _0x5ac06f={'user_key':_0x41e19a[0x0],'session_key':_0x41e19a[0x1]};_0x27bfc8={'url':_0x1b8a1a+_0xe411('0x36'),'method':_0xe411('0x37'),'headers':{'user_key':_0x5ac06f[_0xe411('0x38')],'Session_key':_0x5ac06f['session_key']},'json':!![],'body':_0xaa8d16};return rp(_0x27bfc8);})[_0xe411('0x19')](function(_0x16fcd7){if(_0x16fcd7[_0xe411('0x39')]>=0x1){var _0x10dde6={'messageId':_0x16fcd7[_0xe411('0x3a')]};if(_0xeeeccf[_0xe411('0x31')]!=='GP'||!_0xeeeccf[_0xe411('0x3b')]){_0x10dde6['read']=!![];}return _0x12f2fe[_0xe411('0x1a')](_0x10dde6);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe411('0x2c'),_0xe411('0x2e'),util[_0xe411('0x3c')](_0x16fcd7,{'showHidden':![],'depth':null}));}})[_0xe411('0x1c')](function(_0x4816f9){return logger[_0xe411('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe411('0x2c'),_0xe411('0x2e'),util[_0xe411('0x3c')](_0x4816f9,{'showHidden':![],'depth':null}));});}else{logger[_0xe411('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe411('0x2c'),_0xe411('0x2e'),_0xe411('0x3d'));}break;case _0xe411('0x3e'):if(_0xeeeccf[_0xe411('0x24')]){var _0x4a2ac3={'recipient':_0x2465b2['phone'],'message':_0x2465b2[_0xe411('0x26')],'sender':_0xeeeccf[_0xe411('0x3f')]||_0xeeeccf[_0xe411('0x27')],'authorization':_0xeeeccf[_0xe411('0x24')]};var _0xbad2b5={'method':_0xe411('0x37'),'uri':_0xe411('0x40'),'body':_0x4a2ac3,'json':!![]};rp(_0xbad2b5)['then'](function(_0x281a8e){var _0xb796b1={'messageId':_0x281a8e['requestid']};if(!_0xeeeccf[_0xe411('0x3b')]){_0xb796b1[_0xe411('0x41')]=!![];}return _0x12f2fe[_0xe411('0x1a')](_0xb796b1);})[_0xe411('0x1c')](function(_0x29e92c){logger[_0xe411('0x1d')](_0xe411('0x2d'),'afterCreate',_0xe411('0x3e'),util[_0xe411('0x3c')](_0x29e92c,{'showHidden':![],'depth':null}));});}else{logger[_0xe411('0x1d')](_0xe411('0x2d'),'afterCreate','connectel',_0xe411('0x42'));}break;case _0xe411('0x43'):if(_0xeeeccf[_0xe411('0x30')]&&_0xeeeccf['password']){var _0x4a2ac3={'messages':[{'source':_0xe411('0x44'),'to':_0x2465b2['phone'],'body':_0x2465b2[_0xe411('0x26')],'from':_0xeeeccf[_0xe411('0x3f')]||_0xeeeccf['phone']}]};var _0x1720ba=util[_0xe411('0x45')](_0xe411('0x46'),_0xeeeccf[_0xe411('0x30')],_0xeeeccf[_0xe411('0x47')]);var _0xbad2b5={'method':_0xe411('0x37'),'uri':_0xe411('0x48'),'body':_0x4a2ac3,'headers':{'Authorization':util[_0xe411('0x45')](_0xe411('0x49'),new Buffer(_0x1720ba)[_0xe411('0x4a')](_0xe411('0x4b')))},'json':!![]};rp(_0xbad2b5)[_0xe411('0x19')](function(_0x4fa5e3){if(_0x4fa5e3[_0xe411('0x4c')]>=0xc8&&_0x4fa5e3[_0xe411('0x4c')]<=0xce){if(_0x4fa5e3[_0xe411('0x4d')]&&_0x4fa5e3['data'][_0xe411('0x4e')]>0x0){var _0xacb84b=_['head'](_0x4fa5e3[_0xe411('0x4d')][_0xe411('0x25')]);var _0x3f081b={'messageId':_0xacb84b[_0xe411('0x4f')]};if(!_0xeeeccf['deliveryReport']){_0x3f081b[_0xe411('0x41')]=!![];}return _0x12f2fe[_0xe411('0x1a')](_0x3f081b);}else{logger[_0xe411('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe411('0x2c'),'clickSend',util['inspect'](_0x4fa5e3,{'showHidden':![],'depth':null}));}}else{logger[_0xe411('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe411('0x50'),util[_0xe411('0x3c')](_0x4fa5e3,{'showHidden':![],'depth':null}));}})[_0xe411('0x1c')](function(_0xfff012){logger['error'](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x50'),util[_0xe411('0x3c')](_0xfff012,{'showHidden':![],'depth':null}));});}else{logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x50'),_0xe411('0x3d'));}break;case _0xe411('0x51'):if(_0xeeeccf[_0xe411('0x52')]&&_0xeeeccf[_0xe411('0x24')]){var _0x4a2ac3={'dst':_0x2465b2[_0xe411('0x27')],'text':_0x2465b2[_0xe411('0x26')],'src':_0xeeeccf['senderString']||_0xeeeccf['phone'],'url':_0xeeeccf[_0xe411('0x28')]+_0xe411('0x29')+_0x2465b2['id']+_0xe411('0x53')+_0xeeeccf[_0xe411('0x2a')]};var _0x1720ba=util['format'](_0xe411('0x46'),_0xeeeccf['authId'],_0xeeeccf[_0xe411('0x24')]);var _0xbad2b5={'method':'POST','uri':util[_0xe411('0x45')](_0xe411('0x54'),_0xeeeccf[_0xe411('0x52')]),'body':_0x4a2ac3,'headers':{'Authorization':util[_0xe411('0x45')]('Basic\x20%s',new Buffer(_0x1720ba)[_0xe411('0x4a')]('base64'))},'json':!![]};rp(_0xbad2b5)[_0xe411('0x19')](function(_0x2489ce){var _0x1ea2fa={'messageId':_0x2489ce[_0xe411('0x55')][0x0]};return _0x12f2fe['update'](_0x1ea2fa);})['catch'](function(_0x533080){logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x51'),util[_0xe411('0x3c')](_0x533080,{'showHidden':![],'depth':null}));});}else{logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),'plivo',_0xe411('0x56'));}break;case _0xe411('0x57'):if(_0xeeeccf[_0xe411('0x30')]&&_0xeeeccf[_0xe411('0x47')]){if(_0xeeeccf[_0xe411('0x58')]){var _0x658673={'method':_0xe411('0x37'),'uri':_0xeeeccf[_0xe411('0x58')]+_0xe411('0x59'),'body':{'username':_0xeeeccf[_0xe411('0x30')],'password':_0xeeeccf[_0xe411('0x47')]},'json':!![]};return rp(_0x658673)['then'](function(_0xa4a9a5){var _0x390288={'method':_0xe411('0x37'),'uri':_0xeeeccf[_0xe411('0x58')]+_0xe411('0x5a'),'body':{'messages':[{'from':_0xeeeccf[_0xe411('0x27')],'destinations':[{'to':_0x2465b2[_0xe411('0x27')]}],'text':_0x2465b2[_0xe411('0x26')],'notifyUrl':_0xeeeccf['remote']+_0xe411('0x29')+_0x2465b2['id']+_0xe411('0x53')+_0xeeeccf['token'],'notifyContentType':_0xe411('0x5b'),'callbackData':_0xeeeccf[_0xe411('0x27')]+';'+_0x2465b2[_0xe411('0x26')]}]},'headers':{'Authorization':_0xe411('0x5c')+_0xa4a9a5[_0xe411('0x2a')]},'json':!![]};return rp(_0x390288)[_0xe411('0x19')](function(_0x33f1fe){if(_0x33f1fe['messages']){var _0x26279c={'messageId':_0x33f1fe[_0xe411('0x25')][0x0][_0xe411('0xd')]};if(!_0xeeeccf[_0xe411('0x3b')]){_0x26279c[_0xe411('0x41')]=!![];}return _0x12f2fe[_0xe411('0x1a')](_0x26279c);}else{return logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x57'),util[_0xe411('0x3c')](_0x33f1fe,{'showHidden':![],'depth':null}));}});})[_0xe411('0x1c')](function(_0x3cc44d){return logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x57'),util[_0xe411('0x3c')](_0x3cc44d,{'showHidden':![],'depth':null}));});}else{logger[_0xe411('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe411('0x2c'),_0xe411('0x57'),_0xe411('0x5d'));}}else{logger['error'](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x57'),_0xe411('0x3d'));}break;case _0xe411('0x5e'):var _0x5d3d80=require(_0xe411('0x5f'));if(_0xeeeccf[_0xe411('0x60')]){var _0x170c81={};_0x170c81[_0xe411('0x61')]=_0xeeeccf['username'];_0x170c81['phone']=_0x2465b2[_0xe411('0x27')];_0x170c81['sender']=_0xeeeccf[_0xe411('0x27')];_0x170c81[_0xe411('0x62')]=_0x2465b2[_0xe411('0x26')];_0x170c81[_0xe411('0x63')]=+new Date();var _0x353909='';var _0x1f55ce='';var _0x27458c=Object[_0xe411('0x64')](_0x170c81);_0x27458c[_0xe411('0x65')]();for(var _0x1c3f90=0x0;_0x1c3f90<_0x27458c[_0xe411('0x66')];_0x1c3f90++){if(_0x353909!=''){_0x353909+='&';}_0x353909+=_0x27458c[_0x1c3f90]+'='+encodeURIComponent(_0x170c81[_0x27458c[_0x1c3f90]]);_0x1f55ce+=_0x170c81[_0x27458c[_0x1c3f90]];}_0x1f55ce+=_0xeeeccf['apiKey'];_0x1f55ce=_0x5d3d80['createHash'](_0xe411('0x67'))[_0xe411('0x1a')](_0x1f55ce)[_0xe411('0x68')](_0xe411('0x69'));if(_0x353909!==''){_0x353909+='&';}_0x353909+=_0xe411('0x6a')+_0x1f55ce;var _0x27bfc8={'method':_0xe411('0x34'),'uri':_0xeeeccf[_0xe411('0x58')]+_0xe411('0x6b')+_0x353909,'json':!![]};return rp(_0x27bfc8)[_0xe411('0x19')](function(_0x4323f8){var _0x8b38d3=Object[_0xe411('0x64')](_0x4323f8);if(_0x4323f8[_0x8b38d3[0x0]]['error']&&parseInt(_0x4323f8[_0x8b38d3[0x0]][_0xe411('0x1d')])===0x0){var _0x40c249={'messageId':_0x4323f8[_0x8b38d3[0x0]]['id_sms']};if(!_0xeeeccf['deliveryReport']){_0x40c249[_0xe411('0x41')]=!![];}return _0x12f2fe[_0xe411('0x1a')](_0x40c249);}else{return logger[_0xe411('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe411('0x2c'),_0xe411('0x5e'),util[_0xe411('0x3c')](_0x4323f8[_0xe411('0x1d')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1ccd01){return logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x5e'),util[_0xe411('0x3c')](_0x1ccd01,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x5e'),_0xe411('0x6c'));}break;case _0xe411('0x6d'):if(_0xeeeccf[_0xe411('0x60')]){var _0x3d7d25={'method':_0xe411('0x37'),'uri':_0xe411('0x6e'),'headers':{'Authorization':_0xeeeccf['apiKey']},'body':{'content':_0x2465b2[_0xe411('0x26')],'to':[_0x2465b2[_0xe411('0x27')]],'from':_0xeeeccf[_0xe411('0x27')],'binary':![],'clientMessageId':'uuid','charset':_0xe411('0x6f')},'json':!![]};rp(_0x3d7d25)['then'](function(_0x474ec5){if(!_0x474ec5[_0xe411('0x1d')]){var _0x9cc788={'messageId':_0x474ec5[_0xe411('0x25')][0x0][_0xe411('0x70')]};if(!_0xeeeccf[_0xe411('0x3b')]){_0x9cc788[_0xe411('0x41')]=!![];}return _0x12f2fe['update'](_0x9cc788);}else{return logger[_0xe411('0x1d')](_0xe411('0x2d'),'afterCreate','clickatell',util[_0xe411('0x3c')](_0x474ec5[_0xe411('0x1d')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x374c32){return logger['error'](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x6d'),util[_0xe411('0x3c')](_0x374c32,{'showHidden':![],'depth':null}));});}else{logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x6d'),_0xe411('0x6c'));}break;case _0xe411('0x71'):if(_0xeeeccf[_0xe411('0x30')]&&_0xeeeccf[_0xe411('0x47')]){var _0x1720ba=util[_0xe411('0x45')](_0xe411('0x46'),_0xeeeccf[_0xe411('0x30')],_0xeeeccf['password']);var _0xbad2b5={'method':_0xe411('0x37'),'uri':_0xe411('0x72')+_0xeeeccf['accountId']+_0xe411('0x73'),'body':{'to':[_0x2465b2[_0xe411('0x27')]],'text':_0x2465b2[_0xe411('0x26')],'from':_0xeeeccf[_0xe411('0x27')],'applicationId':_0xeeeccf[_0xe411('0x74')]},'headers':{'Authorization':util[_0xe411('0x45')](_0xe411('0x49'),new Buffer(_0x1720ba)[_0xe411('0x4a')]('base64'))},'json':!![]};rp(_0xbad2b5)[_0xe411('0x19')](function(_0x5444f6){if(_0x5444f6['id']){var _0x25219f={'messageId':_0x5444f6['id']};return _0x12f2fe[_0xe411('0x1a')](_0x25219f);}else{logger[_0xe411('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util[_0xe411('0x3c')](_0x5444f6,{'showHidden':![],'depth':null}));}})[_0xe411('0x1c')](function(_0x328b20){logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),'bandwidth',util[_0xe411('0x3c')](_0x328b20,{'showHidden':![],'depth':null}));});}else{logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x71'),_0xe411('0x3d'));}break;case _0xe411('0x75'):if(_0xeeeccf[_0xe411('0x60')]){var _0x4db531={};var _0x27bfc8={'method':_0xe411('0x37'),'uri':_0xe411('0x76'),'headers':{'Authorization':'Bearer\x20'+_0xeeeccf[_0xe411('0x60')],'Content-Type':'application/json'},'body':{'from':_0xeeeccf[_0xe411('0x27')],'to':_0x2465b2[_0xe411('0x27')],'text':_0x2465b2[_0xe411('0x26')]},'json':!![]};return rp(_0x27bfc8)[_0xe411('0x19')](function(_0x3e31a1){if(_0x3e31a1[_0xe411('0x77')]==0xca){_0x4db531['message']=_0x3e31a1;var _0x587277={'method':'POST','uri':_0xe411('0x78'),'headers':{'Authorization':_0xe411('0x79')+_0xeeeccf['apiKey'],'Content-Type':_0xe411('0x5b')},'body':{'refid':_0x4db531[_0xe411('0x7a')][_0xe411('0x7b')]},'json':!![]};return rp(_0x587277)[_0xe411('0x19')](function(_0x51cf76){_0x4db531[_0xe411('0x7c')]=_0x51cf76;var _0x4d2a76={'messageId':_0x4db531[_0xe411('0x7a')]['refid'],'read':!![]};return _0x12f2fe[_0xe411('0x1a')](_0x4d2a76);});}else{return logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x75'),util[_0xe411('0x3c')](_0x3e31a1,{'showHidden':![],'depth':null}));}})[_0xe411('0x1c')](function(_0xb4379a){return logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),'intelepeer',util['inspect'](_0xb4379a,{'showHidden':![],'depth':null}));});}else{return logger[_0xe411('0x1d')](_0xe411('0x2d'),_0xe411('0x2c'),_0xe411('0x75'),_0xe411('0x7d'));}break;}}})[_0xe411('0x7e')](function(){_0x252892();});}else{_0x252892();}}},'charset':_0xe411('0x7f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7a32=['hex','/external/get/send.php?','id_sms','UTF-8','clickatell','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','finally','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','createdAt','catch','error','secret','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','sender','login?username=','&password=','password','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','data','queued_count','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','length','createHash','md5'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7a32,0x103));var _0x27a3=function(_0x74bfd0,_0x16172a){_0x74bfd0=_0x74bfd0-0x0;var _0x24b779=_0x7a32[_0x74bfd0];return _0x24b779;};'use strict';var _=require(_0x27a3('0x0'));var util=require(_0x27a3('0x1'));var logger=require('../../config/logger')(_0x27a3('0x2'));var moment=require(_0x27a3('0x3'));var BPromise=require(_0x27a3('0x4'));var rp=require(_0x27a3('0x5'));var fs=require('fs');var path=require(_0x27a3('0x6'));var rimraf=require(_0x27a3('0x7'));var config=require(_0x27a3('0x8'));var attributes=require('./smsMessage.attributes');module[_0x27a3('0x9')]=function(_0x465b7d,_0x117700){return _0x465b7d[_0x27a3('0xa')](_0x27a3('0xb'),attributes,{'tableName':_0x27a3('0xc'),'paranoid':![],'indexes':[{'name':_0x27a3('0xd'),'fields':['messageId']},{'name':_0x27a3('0xe'),'fields':[_0x27a3('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e1619,_0x5c3219,_0x462cde){var _0x46559e=_0x465b7d[_0x27a3('0x10')];var _0x26072e=_0x5e1619[_0x27a3('0x11')]({'plain':!![]});if(_0x26072e[_0x27a3('0x12')][_0x27a3('0x13')]()==='in'||_0x26072e['direction'][_0x27a3('0x13')]()===_0x27a3('0x14')&&!_0x26072e['secret']&&!_[_0x27a3('0x15')](_0x26072e[_0x27a3('0x16')])&&!_[_0x27a3('0x15')](_0x26072e[_0x27a3('0x17')])){_0x46559e[_0x27a3('0x18')][_0x27a3('0x19')]({'where':{'id':_0x26072e[_0x27a3('0x17')]}})[_0x27a3('0x1a')](function(_0x3d45f4){if(_0x3d45f4){_0x3d45f4['update']({'lastMsgAt':_0x26072e[_0x27a3('0x1b')],'lastMsgDirection':_0x26072e['direction'][_0x27a3('0x13')]()});}})[_0x27a3('0x1c')](function(_0x3598fe){console[_0x27a3('0x1d')](_0x3598fe);});}if(_0x26072e[_0x27a3('0x12')]==='out'&&!_0x26072e[_0x27a3('0x1e')]){var _0x40fcc0;_0x46559e[_0x27a3('0x1f')]['find']({'where':{'id':_0x26072e[_0x27a3('0x20')]},'raw':!![]})['then'](function(_0x45dc09){_0x40fcc0=_0x45dc09;if(_0x40fcc0&&_0x40fcc0['type']){switch(_0x40fcc0[_0x27a3('0x21')]){case _0x27a3('0x22'):var _0x341166=require(_0x27a3('0x22'));if(_0x40fcc0[_0x27a3('0x23')]&&_0x40fcc0[_0x27a3('0x24')]&&_0x40fcc0[_0x27a3('0x25')]){var _0x7e8410=new _0x341166(_0x40fcc0[_0x27a3('0x23')],_0x40fcc0[_0x27a3('0x24')]);_0x7e8410[_0x27a3('0x26')][_0x27a3('0x27')]({'body':_0x26072e[_0x27a3('0xf')],'to':_0x26072e[_0x27a3('0x25')],'from':_0x40fcc0[_0x27a3('0x25')],'statusCallback':_0x40fcc0[_0x27a3('0x28')]+_0x27a3('0x29')+_0x26072e['id']+'/status?token='+_0x40fcc0[_0x27a3('0x2a')]})['then'](function(_0x520ff2){if(_0x520ff2[_0x27a3('0x2b')]){return _0x5e1619[_0x27a3('0x2c')]({'messageId':_0x520ff2[_0x27a3('0x2b')]});}})['catch'](function(_0x5df597){logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x22'),util['inspect'](_0x5df597,{'showHidden':![],'depth':null}));});}else{logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x22'),_0x27a3('0x2f'));}break;case _0x27a3('0x30'):var _0x41bce8='https://api.skebby.it/API/v1.0/REST/';if(_0x40fcc0[_0x27a3('0x31')]&&_0x40fcc0['password']){var _0x289276={'recipient':[_0x26072e[_0x27a3('0x25')]],'message':_0x26072e[_0x27a3('0xf')],'message_type':_0x40fcc0[_0x27a3('0x32')]};if(_0x40fcc0['smsMethod']&&_0x40fcc0[_0x27a3('0x32')]!=='SI'){_0x289276[_0x27a3('0x33')]=_0x40fcc0[_0x27a3('0x25')];}var _0x59406f={'url':_0x41bce8+_0x27a3('0x34')+_0x40fcc0['username']+_0x27a3('0x35')+_0x40fcc0[_0x27a3('0x36')],'method':_0x27a3('0x37')};rp(_0x59406f)[_0x27a3('0x1a')](function(_0xbb6ad8){var _0x2a2c98=_0xbb6ad8[_0x27a3('0x38')](';');var _0x2ff24b={'user_key':_0x2a2c98[0x0],'session_key':_0x2a2c98[0x1]};_0x59406f={'url':_0x41bce8+_0x27a3('0x39'),'method':_0x27a3('0x3a'),'headers':{'user_key':_0x2ff24b[_0x27a3('0x3b')],'Session_key':_0x2ff24b['session_key']},'json':!![],'body':_0x289276};return rp(_0x59406f);})[_0x27a3('0x1a')](function(_0x3c69ff){if(_0x3c69ff[_0x27a3('0x3c')]>=0x1){var _0x3a159b={'messageId':_0x3c69ff[_0x27a3('0x3d')]};if(_0x40fcc0[_0x27a3('0x32')]!=='GP'||!_0x40fcc0[_0x27a3('0x3e')]){_0x3a159b[_0x27a3('0x3f')]=!![];}return _0x5e1619['update'](_0x3a159b);}else{return logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x30'),util['inspect'](_0x3c69ff,{'showHidden':![],'depth':null}));}})[_0x27a3('0x1c')](function(_0x37db2a){return logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x30'),util[_0x27a3('0x40')](_0x37db2a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x30'),_0x27a3('0x41'));}break;case _0x27a3('0x42'):if(_0x40fcc0[_0x27a3('0x24')]){var _0x5b5fe7={'recipient':_0x26072e[_0x27a3('0x25')],'message':_0x26072e['body'],'sender':_0x40fcc0['senderString']||_0x40fcc0['phone'],'authorization':_0x40fcc0[_0x27a3('0x24')]};var _0x5c3219={'method':_0x27a3('0x3a'),'uri':_0x27a3('0x43'),'body':_0x5b5fe7,'json':!![]};rp(_0x5c3219)[_0x27a3('0x1a')](function(_0x1446c9){var _0x41cd85={'messageId':_0x1446c9['requestid']};if(!_0x40fcc0[_0x27a3('0x3e')]){_0x41cd85[_0x27a3('0x3f')]=!![];}return _0x5e1619['update'](_0x41cd85);})['catch'](function(_0x2c637d){logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x42'),util[_0x27a3('0x40')](_0x2c637d,{'showHidden':![],'depth':null}));});}else{logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x42'),_0x27a3('0x44'));}break;case _0x27a3('0x45'):if(_0x40fcc0[_0x27a3('0x31')]&&_0x40fcc0[_0x27a3('0x36')]){var _0x5b5fe7={'messages':[{'source':_0x27a3('0x46'),'to':_0x26072e[_0x27a3('0x25')],'body':_0x26072e[_0x27a3('0xf')],'from':_0x40fcc0[_0x27a3('0x47')]||_0x40fcc0[_0x27a3('0x25')]}]};var _0x55e419=util[_0x27a3('0x48')](_0x27a3('0x49'),_0x40fcc0['username'],_0x40fcc0[_0x27a3('0x36')]);var _0x5c3219={'method':_0x27a3('0x3a'),'uri':_0x27a3('0x4a'),'body':_0x5b5fe7,'headers':{'Authorization':util[_0x27a3('0x48')](_0x27a3('0x4b'),new Buffer(_0x55e419)['toString'](_0x27a3('0x4c')))},'json':!![]};rp(_0x5c3219)[_0x27a3('0x1a')](function(_0x554fbe){if(_0x554fbe['http_code']>=0xc8&&_0x554fbe['http_code']<=0xce){if(_0x554fbe[_0x27a3('0x4d')]&&_0x554fbe[_0x27a3('0x4d')][_0x27a3('0x4e')]>0x0){var _0x5c7562=_['head'](_0x554fbe[_0x27a3('0x4d')][_0x27a3('0x26')]);var _0x5386eb={'messageId':_0x5c7562[_0x27a3('0x4f')]};if(!_0x40fcc0[_0x27a3('0x3e')]){_0x5386eb[_0x27a3('0x3f')]=!![];}return _0x5e1619[_0x27a3('0x2c')](_0x5386eb);}else{logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x50'),util[_0x27a3('0x40')](_0x554fbe,{'showHidden':![],'depth':null}));}}else{logger[_0x27a3('0x1d')](_0x27a3('0x2d'),'afterCreate','clickSend',util[_0x27a3('0x40')](_0x554fbe,{'showHidden':![],'depth':null}));}})[_0x27a3('0x1c')](function(_0x51b6ad){logger[_0x27a3('0x1d')](_0x27a3('0x2d'),'afterCreate',_0x27a3('0x50'),util[_0x27a3('0x40')](_0x51b6ad,{'showHidden':![],'depth':null}));});}else{logger[_0x27a3('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x27a3('0x50'),_0x27a3('0x41'));}break;case _0x27a3('0x51'):if(_0x40fcc0[_0x27a3('0x52')]&&_0x40fcc0[_0x27a3('0x24')]){var _0x5b5fe7={'dst':_0x26072e[_0x27a3('0x25')],'text':_0x26072e[_0x27a3('0xf')],'src':_0x40fcc0[_0x27a3('0x47')]||_0x40fcc0[_0x27a3('0x25')],'url':_0x40fcc0[_0x27a3('0x28')]+_0x27a3('0x29')+_0x26072e['id']+_0x27a3('0x53')+_0x40fcc0[_0x27a3('0x2a')]};var _0x55e419=util[_0x27a3('0x48')](_0x27a3('0x49'),_0x40fcc0['authId'],_0x40fcc0[_0x27a3('0x24')]);var _0x5c3219={'method':'POST','uri':util['format'](_0x27a3('0x54'),_0x40fcc0[_0x27a3('0x52')]),'body':_0x5b5fe7,'headers':{'Authorization':util[_0x27a3('0x48')](_0x27a3('0x4b'),new Buffer(_0x55e419)[_0x27a3('0x55')](_0x27a3('0x4c')))},'json':!![]};rp(_0x5c3219)[_0x27a3('0x1a')](function(_0x186682){var _0xa4c0c3={'messageId':_0x186682[_0x27a3('0x56')][0x0]};return _0x5e1619[_0x27a3('0x2c')](_0xa4c0c3);})[_0x27a3('0x1c')](function(_0x19dce0){logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x51'),util[_0x27a3('0x40')](_0x19dce0,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x27a3('0x51'),_0x27a3('0x57'));}break;case _0x27a3('0x58'):if(_0x40fcc0[_0x27a3('0x31')]&&_0x40fcc0['password']){if(_0x40fcc0['baseUrl']){var _0xd7af32={'method':_0x27a3('0x3a'),'uri':_0x40fcc0['baseUrl']+'/auth/1/session','body':{'username':_0x40fcc0[_0x27a3('0x31')],'password':_0x40fcc0[_0x27a3('0x36')]},'json':!![]};return rp(_0xd7af32)['then'](function(_0x443c32){var _0x398d3a={'method':_0x27a3('0x3a'),'uri':_0x40fcc0['baseUrl']+_0x27a3('0x59'),'body':{'messages':[{'from':_0x40fcc0['phone'],'destinations':[{'to':_0x26072e['phone']}],'text':_0x26072e['body'],'notifyUrl':_0x40fcc0[_0x27a3('0x28')]+_0x27a3('0x29')+_0x26072e['id']+_0x27a3('0x53')+_0x40fcc0[_0x27a3('0x2a')],'notifyContentType':_0x27a3('0x5a'),'callbackData':_0x40fcc0['phone']+';'+_0x26072e[_0x27a3('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x443c32[_0x27a3('0x2a')]},'json':!![]};return rp(_0x398d3a)[_0x27a3('0x1a')](function(_0x57c332){if(_0x57c332[_0x27a3('0x26')]){var _0x4d946c={'messageId':_0x57c332['messages'][0x0][_0x27a3('0xd')]};if(!_0x40fcc0[_0x27a3('0x3e')]){_0x4d946c['read']=!![];}return _0x5e1619['update'](_0x4d946c);}else{return logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x58'),util[_0x27a3('0x40')](_0x57c332,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x27b303){return logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x58'),util[_0x27a3('0x40')](_0x27b303,{'showHidden':![],'depth':null}));});}else{logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),'infobip',_0x27a3('0x5b'));}}else{logger[_0x27a3('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27a3('0x2e'),_0x27a3('0x58'),_0x27a3('0x41'));}break;case _0x27a3('0x5c'):var _0x1dcb66=require('crypto');if(_0x40fcc0[_0x27a3('0x5d')]){var _0x28f2b7={};_0x28f2b7[_0x27a3('0x5e')]=_0x40fcc0[_0x27a3('0x31')];_0x28f2b7[_0x27a3('0x25')]=_0x26072e['phone'];_0x28f2b7[_0x27a3('0x33')]=_0x40fcc0['phone'];_0x28f2b7[_0x27a3('0x5f')]=_0x26072e[_0x27a3('0xf')];_0x28f2b7[_0x27a3('0x60')]=+new Date();var _0x2daf58='';var _0x2749b4='';var _0x2f03b2=Object[_0x27a3('0x61')](_0x28f2b7);_0x2f03b2['sort']();for(var _0x2767eb=0x0;_0x2767eb<_0x2f03b2[_0x27a3('0x62')];_0x2767eb++){if(_0x2daf58!=''){_0x2daf58+='&';}_0x2daf58+=_0x2f03b2[_0x2767eb]+'='+encodeURIComponent(_0x28f2b7[_0x2f03b2[_0x2767eb]]);_0x2749b4+=_0x28f2b7[_0x2f03b2[_0x2767eb]];}_0x2749b4+=_0x40fcc0['apiKey'];_0x2749b4=_0x1dcb66[_0x27a3('0x63')](_0x27a3('0x64'))[_0x27a3('0x2c')](_0x2749b4)['digest'](_0x27a3('0x65'));if(_0x2daf58!==''){_0x2daf58+='&';}_0x2daf58+='signature='+_0x2749b4;var _0x59406f={'method':_0x27a3('0x37'),'uri':_0x40fcc0['baseUrl']+_0x27a3('0x66')+_0x2daf58,'json':!![]};return rp(_0x59406f)['then'](function(_0x2746a2){var _0x4b2b2b=Object['keys'](_0x2746a2);if(_0x2746a2[_0x4b2b2b[0x0]][_0x27a3('0x1d')]&&parseInt(_0x2746a2[_0x4b2b2b[0x0]][_0x27a3('0x1d')])===0x0){var _0xc26693={'messageId':_0x2746a2[_0x4b2b2b[0x0]][_0x27a3('0x67')]};if(!_0x40fcc0[_0x27a3('0x3e')]){_0xc26693['read']=!![];}return _0x5e1619['update'](_0xc26693);}else{return logger['error'](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x5c'),util['inspect'](_0x2746a2[_0x27a3('0x1d')],{'showHidden':![],'depth':null}));}})[_0x27a3('0x1c')](function(_0x14f404){return logger['error'](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x5c'),util[_0x27a3('0x40')](_0x14f404,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x27a3('0x2d'),'afterCreate',_0x27a3('0x5c'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x40fcc0[_0x27a3('0x5d')]){var _0x305c3c={'method':_0x27a3('0x3a'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x40fcc0['apiKey']},'body':{'content':_0x26072e[_0x27a3('0xf')],'to':[_0x26072e['phone']],'from':_0x40fcc0['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x27a3('0x68')},'json':!![]};rp(_0x305c3c)[_0x27a3('0x1a')](function(_0x12e6e2){if(!_0x12e6e2[_0x27a3('0x1d')]){var _0xa49f84={'messageId':_0x12e6e2[_0x27a3('0x26')][0x0]['apiMessageId']};if(!_0x40fcc0[_0x27a3('0x3e')]){_0xa49f84[_0x27a3('0x3f')]=!![];}return _0x5e1619[_0x27a3('0x2c')](_0xa49f84);}else{return logger[_0x27a3('0x1d')](_0x27a3('0x2d'),'afterCreate',_0x27a3('0x69'),util[_0x27a3('0x40')](_0x12e6e2[_0x27a3('0x1d')],{'showHidden':![],'depth':null}));}})[_0x27a3('0x1c')](function(_0xa8d68f){return logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x69'),util[_0x27a3('0x40')](_0xa8d68f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27a3('0x2e'),'clickatell',_0x27a3('0x6a'));}break;case'bandwidth':if(_0x40fcc0[_0x27a3('0x31')]&&_0x40fcc0['password']){var _0x55e419=util[_0x27a3('0x48')](_0x27a3('0x49'),_0x40fcc0['username'],_0x40fcc0[_0x27a3('0x36')]);var _0x5c3219={'method':_0x27a3('0x3a'),'uri':_0x27a3('0x6b')+_0x40fcc0['accountId']+_0x27a3('0x6c'),'body':{'to':[_0x26072e[_0x27a3('0x25')]],'text':_0x26072e[_0x27a3('0xf')],'from':_0x40fcc0[_0x27a3('0x25')],'applicationId':_0x40fcc0[_0x27a3('0x6d')]},'headers':{'Authorization':util[_0x27a3('0x48')](_0x27a3('0x4b'),new Buffer(_0x55e419)[_0x27a3('0x55')](_0x27a3('0x4c')))},'json':!![]};rp(_0x5c3219)[_0x27a3('0x1a')](function(_0xabf8ec){if(_0xabf8ec['id']){var _0x1cfc1b={'messageId':_0xabf8ec['id']};return _0x5e1619[_0x27a3('0x2c')](_0x1cfc1b);}else{logger[_0x27a3('0x1d')](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x6e'),util[_0x27a3('0x40')](_0xabf8ec,{'showHidden':![],'depth':null}));}})[_0x27a3('0x1c')](function(_0x2655bb){logger[_0x27a3('0x1d')](_0x27a3('0x2d'),'afterCreate',_0x27a3('0x6e'),util['inspect'](_0x2655bb,{'showHidden':![],'depth':null}));});}else{logger[_0x27a3('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27a3('0x2e'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0x27a3('0x6f'):if(_0x40fcc0[_0x27a3('0x5d')]){var _0x487a7b={};var _0x59406f={'method':_0x27a3('0x3a'),'uri':_0x27a3('0x70'),'headers':{'Authorization':_0x27a3('0x71')+_0x40fcc0['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x40fcc0[_0x27a3('0x25')],'to':_0x26072e['phone'],'text':_0x26072e[_0x27a3('0xf')]},'json':!![]};return rp(_0x59406f)[_0x27a3('0x1a')](function(_0x3abc71){if(_0x3abc71['code']==0xca){_0x487a7b[_0x27a3('0x72')]=_0x3abc71;var _0x390ad3={'method':_0x27a3('0x3a'),'uri':_0x27a3('0x73'),'headers':{'Authorization':_0x27a3('0x71')+_0x40fcc0[_0x27a3('0x5d')],'Content-Type':_0x27a3('0x5a')},'body':{'refid':_0x487a7b[_0x27a3('0x72')][_0x27a3('0x74')]},'json':!![]};return rp(_0x390ad3)['then'](function(_0x3996b8){_0x487a7b[_0x27a3('0x75')]=_0x3996b8;var _0x35b3f7={'messageId':_0x487a7b['message'][_0x27a3('0x74')],'read':!![]};return _0x5e1619['update'](_0x35b3f7);});}else{return logger['error'](_0x27a3('0x2d'),_0x27a3('0x2e'),_0x27a3('0x6f'),util[_0x27a3('0x40')](_0x3abc71,{'showHidden':![],'depth':null}));}})[_0x27a3('0x1c')](function(_0x5eaf68){return logger['error'](_0x27a3('0x2d'),_0x27a3('0x2e'),'intelepeer',util[_0x27a3('0x40')](_0x5eaf68,{'showHidden':![],'depth':null}));});}else{return logger[_0x27a3('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27a3('0x2e'),_0x27a3('0x6f'),'Token\x20not\x20received');}break;}}})[_0x27a3('0x76')](function(){_0x462cde();});}else{_0x462cde();}}},'charset':_0x27a3('0x77'),'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 428c4ea..96d5546 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 _0xc4ad=['CreateSmsMessage','SmsMessage','create','body','options','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4ab992,_0x5ed1d1){var _0x908e70=function(_0x248fa5){while(--_0x248fa5){_0x4ab992['push'](_0x4ab992['shift']());}};_0x908e70(++_0x5ed1d1);}(_0xc4ad,0x93));var _0xdc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdc4a('0x0'));var util=require(_0xdc4a('0x1'));var moment=require(_0xdc4a('0x2'));var BPromise=require(_0xdc4a('0x3'));var rs=require(_0xdc4a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc4a('0x5'))['db'];var utils=require(_0xdc4a('0x6'));var logger=require(_0xdc4a('0x7'))(_0xdc4a('0x8'));var config=require(_0xdc4a('0x9'));var jayson=require(_0xdc4a('0xa'));var client=jayson[_0xdc4a('0xb')]['http']({'port':0x232a});config[_0xdc4a('0xc')]=_[_0xdc4a('0xd')](config['redis'],{'host':_0xdc4a('0xe'),'port':0x18eb});var socket=require(_0xdc4a('0xf'))(new Redis(config[_0xdc4a('0xc')]));require(_0xdc4a('0x10'))[_0xdc4a('0x11')](socket);function respondWithRpcPromise(_0x16806b,_0x568126,_0x3282b8){return new BPromise(function(_0x18fcb9,_0x425f4d){return client['request'](_0x16806b,_0x3282b8)[_0xdc4a('0x12')](function(_0x205e0d){logger[_0xdc4a('0x13')](_0xdc4a('0x14'),_0x568126,_0xdc4a('0x15'));logger['debug'](_0xdc4a('0x16'),_0x568126,'request\x20sent',JSON['stringify'](_0x205e0d));if(_0x205e0d[_0xdc4a('0x17')]){if(_0x205e0d[_0xdc4a('0x17')][_0xdc4a('0x18')]===0x1f4){logger[_0xdc4a('0x17')](_0xdc4a('0x14'),_0x568126,_0x205e0d[_0xdc4a('0x17')][_0xdc4a('0x19')]);return _0x425f4d(_0x205e0d[_0xdc4a('0x17')][_0xdc4a('0x19')]);}logger[_0xdc4a('0x17')](_0xdc4a('0x14'),_0x568126,_0x205e0d[_0xdc4a('0x17')][_0xdc4a('0x19')]);return _0x18fcb9(_0x205e0d[_0xdc4a('0x17')][_0xdc4a('0x19')]);}else{logger[_0xdc4a('0x13')](_0xdc4a('0x14'),_0x568126,'request\x20sent');_0x18fcb9(_0x205e0d[_0xdc4a('0x1a')][_0xdc4a('0x19')]);}})[_0xdc4a('0x1b')](function(_0x2a3a4b){logger[_0xdc4a('0x17')](_0xdc4a('0x14'),_0x568126,_0x2a3a4b);_0x425f4d(_0x2a3a4b);});});}exports[_0xdc4a('0x1c')]=function(_0x34aa57){var _0x57d0a5=this;return new Promise(function(_0x459052,_0x2e5c5f){return db[_0xdc4a('0x1d')][_0xdc4a('0x1e')](_0x34aa57[_0xdc4a('0x1f')],{'raw':_0x34aa57['options']?_0x34aa57[_0xdc4a('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xdc4a('0x12')](function(_0xe97d78){logger[_0xdc4a('0x13')](_0xdc4a('0x1c'),_0x34aa57);logger[_0xdc4a('0x21')](_0xdc4a('0x1c'),_0x34aa57,JSON[_0xdc4a('0x22')](_0xe97d78));_0x459052(_0xe97d78);})['catch'](function(_0x3f98cc){logger['error']('CreateSmsMessage',_0x3f98cc[_0xdc4a('0x19')],_0x34aa57);_0x2e5c5f(_0x57d0a5[_0xdc4a('0x17')](0x1f4,_0x3f98cc[_0xdc4a('0x19')]));});});}; \ No newline at end of file +var _0x2076=['result','catch','CreateSmsMessage','create','options','raw','stringify','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x5a3212,_0x48e701){var _0x2b3f8d=function(_0x4bf56c){while(--_0x4bf56c){_0x5a3212['push'](_0x5a3212['shift']());}};_0x2b3f8d(++_0x48e701);}(_0x2076,0xc7));var _0x6207=function(_0x517251,_0x2718e1){_0x517251=_0x517251-0x0;var _0x540892=_0x2076[_0x517251];return _0x540892;};'use strict';var _=require('lodash');var util=require(_0x6207('0x0'));var moment=require('moment');var BPromise=require(_0x6207('0x1'));var rs=require(_0x6207('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6207('0x3'))['db'];var utils=require(_0x6207('0x4'));var logger=require(_0x6207('0x5'))(_0x6207('0x6'));var config=require(_0x6207('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6207('0x8')][_0x6207('0x9')]({'port':0x232a});config[_0x6207('0xa')]=_[_0x6207('0xb')](config['redis'],{'host':_0x6207('0xc'),'port':0x18eb});var socket=require(_0x6207('0xd'))(new Redis(config[_0x6207('0xa')]));require('./smsMessage.socket')[_0x6207('0xe')](socket);function respondWithRpcPromise(_0x594983,_0x2905be,_0x512078){return new BPromise(function(_0x24d4a0,_0x49e5e1){return client[_0x6207('0xf')](_0x594983,_0x512078)[_0x6207('0x10')](function(_0x55c387){logger['info'](_0x6207('0x11'),_0x2905be,_0x6207('0x12'));logger[_0x6207('0x13')](_0x6207('0x14'),_0x2905be,_0x6207('0x12'),JSON['stringify'](_0x55c387));if(_0x55c387[_0x6207('0x15')]){if(_0x55c387[_0x6207('0x15')][_0x6207('0x16')]===0x1f4){logger[_0x6207('0x15')](_0x6207('0x11'),_0x2905be,_0x55c387[_0x6207('0x15')]['message']);return _0x49e5e1(_0x55c387[_0x6207('0x15')][_0x6207('0x17')]);}logger[_0x6207('0x15')](_0x6207('0x11'),_0x2905be,_0x55c387[_0x6207('0x15')][_0x6207('0x17')]);return _0x24d4a0(_0x55c387[_0x6207('0x15')][_0x6207('0x17')]);}else{logger[_0x6207('0x18')](_0x6207('0x11'),_0x2905be,'request\x20sent');_0x24d4a0(_0x55c387[_0x6207('0x19')][_0x6207('0x17')]);}})[_0x6207('0x1a')](function(_0x14d72b){logger[_0x6207('0x15')]('SmsMessage,\x20%s,\x20%s',_0x2905be,_0x14d72b);_0x49e5e1(_0x14d72b);});});}exports[_0x6207('0x1b')]=function(_0x38ba5f){var _0x28f09f=this;return new Promise(function(_0x57adb9,_0x1347a5){return db['SmsMessage'][_0x6207('0x1c')](_0x38ba5f['body'],{'raw':_0x38ba5f[_0x6207('0x1d')]?_0x38ba5f['options'][_0x6207('0x1e')]===undefined?!![]:![]:!![]})[_0x6207('0x10')](function(_0x191bb1){logger[_0x6207('0x18')](_0x6207('0x1b'),_0x38ba5f);logger[_0x6207('0x13')]('CreateSmsMessage',_0x38ba5f,JSON[_0x6207('0x1f')](_0x191bb1));_0x57adb9(_0x191bb1);})[_0x6207('0x1a')](function(_0x352a01){logger[_0x6207('0x15')](_0x6207('0x1b'),_0x352a01['message'],_0x38ba5f);_0x1347a5(_0x28f09f[_0x6207('0x15')](0x1f4,_0x352a01['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index da8a050..d4d212c 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 _0x28a1=['update','removeListener','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x5c0454,_0x8aa1a5){var _0x183e03=function(_0x44b1a6){while(--_0x44b1a6){_0x5c0454['push'](_0x5c0454['shift']());}};_0x183e03(++_0x8aa1a5);}(_0x28a1,0x170));var _0x128a=function(_0x4e21ba,_0x18097f){_0x4e21ba=_0x4e21ba-0x0;var _0x55b94b=_0x28a1[_0x4e21ba];return _0x55b94b;};'use strict';var SmsMessageEvents=require(_0x128a('0x0'));var events=[_0x128a('0x1'),_0x128a('0x2'),_0x128a('0x3')];function createListener(_0x5e3d3a,_0x184222){return function(_0x39608d){_0x184222['emit'](_0x5e3d3a,_0x39608d);};}function removeListener(_0x5b4729,_0x8743d8){return function(){SmsMessageEvents[_0x128a('0x4')](_0x5b4729,_0x8743d8);};}exports['register']=function(_0x15cd78){for(var _0x4d726c=0x0,_0x3b41da=events[_0x128a('0x5')];_0x4d726c<_0x3b41da;_0x4d726c++){var _0x3e5f0a=events[_0x4d726c];var _0x2199d3=createListener(_0x128a('0x6')+_0x3e5f0a,_0x15cd78);SmsMessageEvents['on'](_0x3e5f0a,_0x2199d3);}}; \ No newline at end of file +var _0xfe7e=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','remove'];(function(_0x1b8665,_0x286b0d){var _0x44a76f=function(_0x4e8567){while(--_0x4e8567){_0x1b8665['push'](_0x1b8665['shift']());}};_0x44a76f(++_0x286b0d);}(_0xfe7e,0x1b6));var _0xefe7=function(_0x34d3b6,_0x14e24b){_0x34d3b6=_0x34d3b6-0x0;var _0x5ccbc3=_0xfe7e[_0x34d3b6];return _0x5ccbc3;};'use strict';var SmsMessageEvents=require(_0xefe7('0x0'));var events=['save',_0xefe7('0x1'),_0xefe7('0x2')];function createListener(_0xaf1cbf,_0x21918e){return function(_0x20f350){_0x21918e[_0xefe7('0x3')](_0xaf1cbf,_0x20f350);};}function removeListener(_0x5174db,_0x1868fd){return function(){SmsMessageEvents[_0xefe7('0x4')](_0x5174db,_0x1868fd);};}exports[_0xefe7('0x5')]=function(_0x389c96){for(var _0x1543b4=0x0,_0xc10af7=events[_0xefe7('0x6')];_0x1543b4<_0xc10af7;_0x1543b4++){var _0x2aa44b=events[_0x1543b4];var _0x48b9ef=createListener(_0xefe7('0x7')+_0x2aa44b,_0x389c96);SmsMessageEvents['on'](_0x2aa44b,_0x48b9ef);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 4682a2e..98a879f 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 _0x74d1=['/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5be2fe,_0x413804){var _0x41ce61=function(_0x1c6a9e){while(--_0x1c6a9e){_0x5be2fe['push'](_0x5be2fe['shift']());}};_0x41ce61(++_0x413804);}(_0x74d1,0x111));var _0x174d=function(_0x3184f0,_0x31266e){_0x3184f0=_0x3184f0-0x0;var _0x4e2094=_0x74d1[_0x3184f0];return _0x4e2094;};'use strict';var multer=require('multer');var util=require(_0x174d('0x0'));var path=require(_0x174d('0x1'));var timeout=require(_0x174d('0x2'));var express=require(_0x174d('0x3'));var router=express['Router']();var fs_extra=require(_0x174d('0x4'));var auth=require(_0x174d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x174d('0x6'));var controller=require('./smsQueue.controller');router[_0x174d('0x7')]('/',auth[_0x174d('0x8')](),controller[_0x174d('0x9')]);router['get'](_0x174d('0xa'),auth[_0x174d('0x8')](),controller[_0x174d('0xb')]);router['get'](_0x174d('0xc'),auth[_0x174d('0x8')](),controller['show']);router[_0x174d('0x7')]('/:id/members',auth[_0x174d('0x8')](),controller['getMembers']);router['get'](_0x174d('0xd'),auth['isAuthenticated'](),controller[_0x174d('0xe')]);router[_0x174d('0x7')](_0x174d('0xf'),auth[_0x174d('0x8')](),controller[_0x174d('0x10')]);router[_0x174d('0x11')]('/',auth[_0x174d('0x8')](),controller['create']);router[_0x174d('0x11')]('/:id/teams',auth[_0x174d('0x8')](),controller[_0x174d('0x12')]);router[_0x174d('0x11')](_0x174d('0xf'),auth[_0x174d('0x8')](),controller['addAgents']);router[_0x174d('0x13')](_0x174d('0xc'),auth['isAuthenticated'](),controller[_0x174d('0x14')]);router[_0x174d('0x15')](_0x174d('0xc'),auth[_0x174d('0x8')](),controller[_0x174d('0x16')]);router[_0x174d('0x15')](_0x174d('0xd'),auth[_0x174d('0x8')](),controller[_0x174d('0x17')]);router[_0x174d('0x15')](_0x174d('0xf'),auth['isAuthenticated'](),controller[_0x174d('0x18')]);module[_0x174d('0x19')]=router; \ No newline at end of file +var _0x77db=['/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members'];(function(_0x10d756,_0x56251){var _0x268d04=function(_0x689d04){while(--_0x689d04){_0x10d756['push'](_0x10d756['shift']());}};_0x268d04(++_0x56251);}(_0x77db,0x1d0));var _0xb77d=function(_0x157c81,_0x2c0224){_0x157c81=_0x157c81-0x0;var _0x1bfb12=_0x77db[_0x157c81];return _0x1bfb12;};'use strict';var multer=require(_0xb77d('0x0'));var util=require('util');var path=require(_0xb77d('0x1'));var timeout=require(_0xb77d('0x2'));var express=require('express');var router=express[_0xb77d('0x3')]();var fs_extra=require(_0xb77d('0x4'));var auth=require(_0xb77d('0x5'));var interaction=require(_0xb77d('0x6'));var config=require(_0xb77d('0x7'));var controller=require(_0xb77d('0x8'));router[_0xb77d('0x9')]('/',auth[_0xb77d('0xa')](),controller['index']);router[_0xb77d('0x9')](_0xb77d('0xb'),auth['isAuthenticated'](),controller[_0xb77d('0xc')]);router[_0xb77d('0x9')](_0xb77d('0xd'),auth[_0xb77d('0xa')](),controller[_0xb77d('0xe')]);router['get'](_0xb77d('0xf'),auth[_0xb77d('0xa')](),controller['getMembers']);router[_0xb77d('0x9')](_0xb77d('0x10'),auth[_0xb77d('0xa')](),controller[_0xb77d('0x11')]);router['get'](_0xb77d('0x12'),auth[_0xb77d('0xa')](),controller[_0xb77d('0x13')]);router[_0xb77d('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb77d('0x14')](_0xb77d('0x10'),auth[_0xb77d('0xa')](),controller[_0xb77d('0x15')]);router[_0xb77d('0x14')](_0xb77d('0x12'),auth[_0xb77d('0xa')](),controller[_0xb77d('0x16')]);router[_0xb77d('0x17')](_0xb77d('0xd'),auth[_0xb77d('0xa')](),controller[_0xb77d('0x18')]);router[_0xb77d('0x19')](_0xb77d('0xd'),auth[_0xb77d('0xa')](),controller[_0xb77d('0x1a')]);router[_0xb77d('0x19')]('/:id/teams',auth[_0xb77d('0xa')](),controller[_0xb77d('0x1b')]);router[_0xb77d('0x19')](_0xb77d('0x12'),auth[_0xb77d('0xa')](),controller[_0xb77d('0x1c')]);module[_0xb77d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 5d73697..2dfced9 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 _0x492d=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x2c9056,_0x552f14){var _0x3e6959=function(_0x556247){while(--_0x556247){_0x2c9056['push'](_0x2c9056['shift']());}};_0x3e6959(++_0x552f14);}(_0x492d,0x124));var _0xd492=function(_0x275c4b,_0x4b69d3){_0x275c4b=_0x275c4b-0x0;var _0x52ae30=_0x492d[_0x275c4b];return _0x52ae30;};'use strict';var Sequelize=require(_0xd492('0x0'));module[_0xd492('0x1')]={'name':{'type':Sequelize[_0xd492('0x2')],'unique':_0xd492('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd492('0x2')]},'timeout':{'type':Sequelize[_0xd492('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd492('0x5'),_0xd492('0x6'),_0xd492('0x7'))}}; \ No newline at end of file +var _0x7245=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7245,0x159));var _0x5724=function(_0xec808c,_0x134b4d){_0xec808c=_0xec808c-0x0;var _0x449acf=_0x7245[_0xec808c];return _0x449acf;};'use strict';var Sequelize=require(_0x5724('0x0'));module[_0x5724('0x1')]={'name':{'type':Sequelize[_0x5724('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5724('0x2')]},'timeout':{'type':Sequelize[_0x5724('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5724('0x4')]('rrmemory',_0x5724('0x5'),_0x5724('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 966a4e4..5b42232 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 _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','map','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0xadb5,0xad));var _0x5adb=function(_0x1809d6,_0x5b926e){_0x1809d6=_0x1809d6-0x0;var _0x56835a=_0xadb5[_0x1809d6];return _0x56835a;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserSmsQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'SmsQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['SmsQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['SmsQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'SmsQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'SmsQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'SmsQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'SmsQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['SmsQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file +var _0x0b0e=['userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','update','SmsQueues','destroy','then','error','stack','name','send','SmsQueue','fieldName','type','key','getOptions','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','nolimit','order','sort','where','SmsQueueId','filter','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','pick','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x0b0e,0x187));var _0xe0b0=function(_0x435dde,_0x2a2fa3){_0x435dde=_0x435dde-0x0;var _0x4aca2d=_0x0b0e[_0x435dde];return _0x4aca2d;};'use strict';var BPromise=require(_0xe0b0('0x0'));var util=require('util');var _=require(_0xe0b0('0x1'));var squel=require('squel');var Redis=require(_0xe0b0('0x2'));var qs=require(_0xe0b0('0x3'));var logger=require(_0xe0b0('0x4'))(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var db=require(_0xe0b0('0x7'))['db'];config[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](config[_0xe0b0('0x8')],{'host':_0xe0b0('0xa'),'port':0x18eb});var socket=require(_0xe0b0('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe0b0('0xc')](socket);function respondWithStatusCode(_0x435060,_0xc4a085){_0xc4a085=_0xc4a085||0xcc;return function(_0x2ac27e){if(_0x2ac27e){return _0x435060['sendStatus'](_0xc4a085);}return _0x435060[_0xe0b0('0xd')](_0xc4a085)[_0xe0b0('0xe')]();};}function respondWithResult(_0x553d4f,_0x1fef28){_0x1fef28=_0x1fef28||0xc8;return function(_0x2f32b6){if(_0x2f32b6){return _0x553d4f['status'](_0x1fef28)[_0xe0b0('0xf')](_0x2f32b6);}};}function respondWithFilteredResult(_0x2cdad2,_0x39b1c2){return function(_0x585615){if(_0x585615){var _0x3068c0=typeof _0x39b1c2[_0xe0b0('0x10')]===_0xe0b0('0x11')&&typeof _0x39b1c2[_0xe0b0('0x12')]===_0xe0b0('0x11');var _0x4d2bf7=_0x585615[_0xe0b0('0x13')];var _0x154de6=_0x3068c0?0x0:_0x39b1c2[_0xe0b0('0x10')];var _0x24babd=_0x3068c0?_0x585615[_0xe0b0('0x13')]:_0x39b1c2['offset']+_0x39b1c2[_0xe0b0('0x12')];var _0x5adb01;if(_0x24babd>=_0x4d2bf7){_0x24babd=_0x4d2bf7;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x2cdad2[_0xe0b0('0xd')](_0x5adb01);return _0x2cdad2[_0xe0b0('0x14')]('Content-Range',_0x154de6+'-'+_0x24babd+'/'+_0x4d2bf7)[_0xe0b0('0xf')](_0x585615);}return null;};}function saveUpdates(_0x4a4cc0){return function(_0x2d6fb6){if(_0x2d6fb6){return _0x2d6fb6[_0xe0b0('0x15')](_0x4a4cc0)['then'](function(_0x54a3eb){return _0x54a3eb;});}return null;};}function removeEntity(_0x46bb44){return function(_0x50a441){if(_0x50a441){return _0x50a441['destroy']()['then'](function(){var _0x1920ee=_0x50a441['get']({'plain':!![]});var _0x52598b=_0xe0b0('0x16');return db['UserProfileResource'][_0xe0b0('0x17')]({'where':{'type':_0x52598b,'resourceId':_0x1920ee['id']}})['then'](function(){return _0x50a441;});})[_0xe0b0('0x18')](function(){_0x46bb44[_0xe0b0('0xd')](0xcc)[_0xe0b0('0xe')]();});}};}function handleEntityNotFound(_0x310a6d){return function(_0x2cf6a1){if(!_0x2cf6a1){_0x310a6d['sendStatus'](0x194);}return _0x2cf6a1;};}function handleError(_0x4cae54,_0x2fa820){_0x2fa820=_0x2fa820||0x1f4;return function(_0x5512bb){logger[_0xe0b0('0x19')](_0x5512bb[_0xe0b0('0x1a')]);if(_0x5512bb['name']){delete _0x5512bb[_0xe0b0('0x1b')];}_0x4cae54['status'](_0x2fa820)[_0xe0b0('0x1c')](_0x5512bb);};}exports['index']=function(_0x28586d,_0x576352){var _0x3e5c88={};var _0x4de537={'count':0x0,'rows':[]};var _0x4700cc=_['map'](db[_0xe0b0('0x1d')]['rawAttributes'],function(_0x362aba){return{'name':_0x362aba[_0xe0b0('0x1e')],'type':_0x362aba[_0xe0b0('0x1f')][_0xe0b0('0x20')]};});_0x3e5c88=qs[_0xe0b0('0x21')](_0x4700cc,_0x28586d);var _0x10745d={'where':_0x3e5c88['where']};return db[_0xe0b0('0x1d')][_0xe0b0('0x13')](_0x10745d)['then'](function(_0x15e13b){_0x4de537[_0xe0b0('0x13')]=_0x15e13b;_0x3e5c88[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x28586d[_0xe0b0('0x23')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x24')](_0x3e5c88);})['then'](function(_0x1854b8){_0x4de537[_0xe0b0('0x25')]=_0x1854b8;return _0x4de537;})['then'](respondWithFilteredResult(_0x576352,_0x3e5c88))['catch'](handleError(_0x576352,null));};exports[_0xe0b0('0x26')]=function(_0x33e672,_0x422575){var _0x3f81d5={'raw':!![],'where':{'id':_0x33e672['params']['id']}},_0x2ab1b1={};_0x2ab1b1[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db[_0xe0b0('0x1d')][_0xe0b0('0x29')]);_0x2ab1b1[_0xe0b0('0x23')]=_['keys'](_0x33e672[_0xe0b0('0x23')]);_0x2ab1b1[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],_0x2ab1b1[_0xe0b0('0x23')]);_0x3f81d5[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3f81d5[_0xe0b0('0x2c')]=_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x3f81d5[_0xe0b0('0x2c')]:_0x2ab1b1['model'];if(_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2f')]){_0x3f81d5[_0xe0b0('0x22')]=[{'all':!![]}];}_0x3f81d5=_[_0xe0b0('0x30')]({},_0x3f81d5,_0x33e672[_0xe0b0('0x31')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x32')](_0x3f81d5)['then'](handleEntityNotFound(_0x422575,null))['then'](respondWithResult(_0x422575,null))['catch'](handleError(_0x422575,null));};exports['create']=function(_0x26137c,_0xc3d967){return db[_0xe0b0('0x1d')]['create'](_0x26137c[_0xe0b0('0x33')],{})[_0xe0b0('0x18')](function(_0x1cd705){var _0x297c64=_0x26137c['user'][_0xe0b0('0x34')]({'plain':!![]});if(!_0x297c64)throw new Error(_0xe0b0('0x35'));if(_0x297c64[_0xe0b0('0x36')]===_0xe0b0('0x37')){var _0x4265e3=_0x1cd705[_0xe0b0('0x34')]({'plain':!![]});var _0x8b745=_0xe0b0('0x16');return db[_0xe0b0('0x38')]['find']({'where':{'name':_0x8b745,'userProfileId':_0x297c64[_0xe0b0('0x39')]},'raw':!![]})['then'](function(_0x34178d){if(_0x34178d&&_0x34178d[_0xe0b0('0x3a')]===0x0){return db[_0xe0b0('0x3b')][_0xe0b0('0x3c')]({'name':_0x4265e3['name'],'resourceId':_0x4265e3['id'],'type':_0x34178d[_0xe0b0('0x1b')],'sectionId':_0x34178d['id']},{})[_0xe0b0('0x18')](function(){return _0x1cd705;});}else{return _0x1cd705;}})[_0xe0b0('0x3d')](function(_0x402a0e){logger[_0xe0b0('0x19')](_0xe0b0('0x3e'),_0x402a0e);throw _0x402a0e;});}return _0x1cd705;})[_0xe0b0('0x18')](respondWithResult(_0xc3d967,0xc9))[_0xe0b0('0x3d')](handleError(_0xc3d967,null));};exports['update']=function(_0x2aad80,_0x309bbf){if(_0x2aad80['body']['id']){delete _0x2aad80['body']['id'];}return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x2aad80['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x309bbf,null))[_0xe0b0('0x18')](saveUpdates(_0x2aad80[_0xe0b0('0x33')],null))[_0xe0b0('0x18')](respondWithResult(_0x309bbf,null))[_0xe0b0('0x3d')](handleError(_0x309bbf,null));};exports['destroy']=function(_0x5d2fa2,_0x51c580){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x5d2fa2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x51c580,null))[_0xe0b0('0x18')](removeEntity(_0x51c580,null))[_0xe0b0('0x3d')](handleError(_0x51c580,null));};exports[_0xe0b0('0x3f')]=function(_0x16ccca,_0x5c6f94){return db['SmsQueue'][_0xe0b0('0x3f')]()[_0xe0b0('0x18')](respondWithResult(_0x5c6f94,null))[_0xe0b0('0x3d')](handleError(_0x5c6f94,null));};exports[_0xe0b0('0x40')]=function(_0x1bf77d,_0x575c7d){var _0x3b1474={'raw':!![],'where':{}},_0x11d4fd={},_0x534340;return db['SmsQueue']['findOne']({'where':{'id':_0x1bf77d[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x575c7d,null))[_0xe0b0('0x18')](function(_0x364877){if(_0x364877){_0x534340=_0x364877['get']({'plain':!![]});_0x11d4fd[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db['UserSmsQueue']['rawAttributes']);_0x11d4fd[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x1bf77d['query']);_0x11d4fd[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x11d4fd['model'],_0x11d4fd['query']);_0x3b1474[_0xe0b0('0x2c')]=_['intersection'](_0x11d4fd[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3b1474[_0xe0b0('0x2c')]=_0x3b1474[_0xe0b0('0x2c')]['length']?_0x3b1474['attributes']:_0x11d4fd[_0xe0b0('0x27')];if(!_0x1bf77d['query']['hasOwnProperty'](_0xe0b0('0x42'))){_0x3b1474[_0xe0b0('0x12')]=qs['limit'](_0x1bf77d['query'][_0xe0b0('0x12')]);_0x3b1474[_0xe0b0('0x10')]=qs[_0xe0b0('0x10')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x10')]);}_0x3b1474[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x1bf77d['query'][_0xe0b0('0x44')]);_0x3b1474['where']=qs[_0xe0b0('0x2a')](_['pick'](_0x1bf77d['query'],_0x11d4fd[_0xe0b0('0x2a')]));_0x3b1474[_0xe0b0('0x45')][_0xe0b0('0x46')]=_0x364877['id'];if(_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x3b1474[_0xe0b0('0x45')]=_[_0xe0b0('0x30')](_0x3b1474[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x3b1474['attributes'],function(_0x253ab0){var _0x57ccc9={};_0x57ccc9[_0x253ab0]={'$like':'%'+_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x57ccc9;})});}_0x3b1474=_[_0xe0b0('0x30')]({},_0x3b1474,_0x1bf77d[_0xe0b0('0x31')]);return db[_0xe0b0('0x49')][_0xe0b0('0x24')](_0x3b1474);}})['then'](function(_0x1a057c){if(_0x1a057c){return db[_0xe0b0('0x4a')][_0xe0b0('0x4b')]({'where':{'id':_[_0xe0b0('0x48')](_0x1a057c,_0xe0b0('0x4c')),'role':_0xe0b0('0x4d')},'attributes':['id',_0xe0b0('0x1b'),_0xe0b0('0x4e'),_0xe0b0('0x4f'),_0xe0b0('0x50')]});}})[_0xe0b0('0x18')](function(_0x18ab99){if(_0x18ab99){return{'count':_0x18ab99[_0xe0b0('0x13')],'rows':_[_0xe0b0('0x48')](_0x18ab99[_0xe0b0('0x25')],function(_0x34c642){return{'membername':_0x34c642[_0xe0b0('0x1b')],'UserId':_0x34c642['id'],'queue_name':_0x534340[_0xe0b0('0x1b')],'SmsQueueId':_0x534340['id'],'interface':util['format'](_0xe0b0('0x51'),_0xe0b0('0x52'),_0x34c642[_0xe0b0('0x1b')]),'penalty':0x0,'paused':_0x34c642[_0xe0b0('0x4e')],'createdAt':_0x34c642[_0xe0b0('0x50')],'updatedAt':_0x34c642[_0xe0b0('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x18')](respondWithFilteredResult(_0x575c7d,_0x3b1474))['catch'](handleError(_0x575c7d,null));};exports['getTeams']=function(_0x139014,_0x2a0415){var _0x157556={};var _0x47ecc1={};var _0x117d20;var _0x13fb4b;return db[_0xe0b0('0x1d')][_0xe0b0('0x53')]({'where':{'id':_0x139014[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a0415,null))[_0xe0b0('0x18')](function(_0x242120){if(_0x242120){_0x117d20=_0x242120;_0x47ecc1[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x54')][_0xe0b0('0x29')]);_0x47ecc1['query']=_[_0xe0b0('0x28')](_0x139014['query']);_0x47ecc1['filters']=_[_0xe0b0('0x2b')](_0x47ecc1['model'],_0x47ecc1['query']);_0x157556[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x47ecc1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x139014['query'][_0xe0b0('0x2d')]));_0x157556[_0xe0b0('0x2c')]=_0x157556[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x157556[_0xe0b0('0x2c')]:_0x47ecc1[_0xe0b0('0x27')];_0x157556[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x139014['query']['sort']);_0x157556[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x139014['query'],_0x47ecc1['filters']));if(_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x157556['where']=_['merge'](_0x157556[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x157556[_0xe0b0('0x2c')],function(_0x29175a){var _0x3b263f={};_0x3b263f[_0x29175a]={'$like':'%'+_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3b263f;})});}_0x157556=_[_0xe0b0('0x30')]({},_0x157556,_0x139014['options']);return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0x1673bc){if(_0x1673bc){_0x13fb4b=_0x1673bc['length'];if(!_0x139014['query']['hasOwnProperty']('nolimit')){_0x157556['limit']=qs['limit'](_0x139014[_0xe0b0('0x23')]['limit']);_0x157556['offset']=qs[_0xe0b0('0x10')](_0x139014[_0xe0b0('0x23')][_0xe0b0('0x10')]);}return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0xd0629e){if(_0xd0629e){return _0xd0629e?{'count':_0x13fb4b,'rows':_0xd0629e}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x2a0415,null))[_0xe0b0('0x3d')](handleError(_0x2a0415,null));};exports['addTeams']=function(_0x3097fb,_0x5da8fd){var _0x86e90=_0x3097fb[_0xe0b0('0x33')][_0xe0b0('0x57')];return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x86e90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x58'),'attributes':['id','name',_0xe0b0('0x59'),_0xe0b0('0x5a'),_0xe0b0('0x5b')],'raw':!![]}]})[_0xe0b0('0x18')](function(_0x4a78f8){if(_0x4a78f8){var _0x311f79=_[_0xe0b0('0x5c')](_0x4a78f8,function(_0x49deef){var _0x4cf60a=_0x49deef[_0xe0b0('0x34')]({'plain':!![]});return _0x4cf60a[_0xe0b0('0x58')];});return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x3097fb[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](function(_0x34f4ff){return db[_0xe0b0('0x5d')][_0xe0b0('0x5e')](function(_0x24571b){return _0x34f4ff['addTeams'](_0x86e90,{'transaction':_0x24571b})['then'](function(){return BPromise[_0xe0b0('0x5f')](_0x311f79,function(_0x4880d5){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4880d5['id'],'SmsQueueId':_0x3097fb['params']['id']},'transaction':_0x24571b});});})[_0xe0b0('0x18')](function(){_0x311f79['forEach'](function(_0x654d2b){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':_0x654d2b['id'],'SmsQueueId':_0x34f4ff['id']});});});});});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x5da8fd,null))['catch'](handleError(_0x5da8fd,null));};exports[_0xe0b0('0x62')]=function(_0x948708,_0x5a0817){return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')]},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0817,null))['then'](function(_0x545694){var _0x5c258b=_[_0xe0b0('0x48')](_0x545694,'id');var _0x567e1a=[];var _0x3c09af=[];var _0x5f4aaf=squel[_0xe0b0('0x63')]();_0x5f4aaf[_0xe0b0('0x64')](_0xe0b0('0x65'))[_0xe0b0('0x66')](_0xe0b0('0x67'),'tq')[_0xe0b0('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948708[_0xe0b0('0x41')]['id']);for(var _0x261381=0x0;_0x261381<_0x545694[_0xe0b0('0x2e')];_0x261381+=0x1){let _0x4377f7=_0x545694[_0x261381];for(var _0x2c1149=0x0;_0x2c1149<_0x4377f7['Agents'][_0xe0b0('0x2e')];_0x2c1149+=0x1){let _0x39a07b=_0x4377f7[_0xe0b0('0x58')][_0x2c1149];var _0xc6090e=_0x5f4aaf[_0xe0b0('0x69')]();_0xc6090e[_0xe0b0('0x45')](_0xe0b0('0x6a'),_0x39a07b['id']);_0x3c09af[_0xe0b0('0x6b')](db[_0xe0b0('0x5d')]['query'](_0xc6090e['toString'](),{'type':db[_0xe0b0('0x5d')][_0xe0b0('0x6c')]['SELECT']})[_0xe0b0('0x18')](function(_0x4593f1){if(_0x4593f1[_0xe0b0('0x2e')]===0x1){return _0x39a07b['id'];}else{var _0x3fcffd=_[_0xe0b0('0x6d')](_[_0xe0b0('0x48')](_0x4593f1,_0xe0b0('0x6e')),function(_0xc8eba3){return _['includes'](_0x5c258b,_0xc8eba3);});if(_0x3fcffd){return _0x39a07b['id'];}}}));}}return BPromise['all'](_0x3c09af)['then'](function(_0xc19743){_0x567e1a=_(_0x567e1a)[_0xe0b0('0x6f')](_0xc19743)['compact']()[_0xe0b0('0x70')]();return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x948708[_0xe0b0('0x41')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x5e')](function(_0x266835){return _0x56c4b9['removeTeams'](_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')],{'transaction':_0x266835})['then'](function(){if(!_['isEmpty'](_0x567e1a)){return _0x56c4b9[_0xe0b0('0x71')](_0x567e1a,{'transaction':_0x266835});}})['then'](function(){_0x567e1a[_0xe0b0('0x72')](function(_0x5f06c0){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':_0x5f06c0,'SmsQueueId':_0x56c4b9['id']});});});});});});})[_0xe0b0('0x18')](respondWithStatusCode(_0x5a0817,null))[_0xe0b0('0x3d')](handleError(_0x5a0817,null));};exports[_0xe0b0('0x74')]=function(_0x1ec7c2,_0x434dfa){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x1ec7c2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x434dfa,null))[_0xe0b0('0x18')](function(_0x2b40eb){if(_0x2b40eb){return _0x2b40eb['addAgents'](_0x1ec7c2[_0xe0b0('0x33')]['ids'],_[_0xe0b0('0x75')](_0x1ec7c2[_0xe0b0('0x33')],['ids','id'])||{})[_0xe0b0('0x76')](function(_0x4e4b45){for(var _0x528932=0x0;_0x528932<_0x1ec7c2[_0xe0b0('0x33')]['ids']['length'];_0x528932+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':Number(_0x1ec7c2[_0xe0b0('0x33')][_0xe0b0('0x57')][_0x528932]),'SmsQueueId':Number(_0x1ec7c2[_0xe0b0('0x41')]['id'])});}return _0x4e4b45;});}})[_0xe0b0('0x18')](respondWithResult(_0x434dfa,null))['catch'](handleError(_0x434dfa,null));};exports[_0xe0b0('0x71')]=function(_0x4609d5,_0x421b3b){return db['SmsQueue'][_0xe0b0('0x32')]({'where':{'id':_0x4609d5[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x421b3b,null))['then'](function(_0x33f89a){if(_0x33f89a){return _0x33f89a['removeAgents'](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])[_0xe0b0('0x18')](function(){if(_[_0xe0b0('0x77')](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])){for(var _0x3d70d7=0x0;_0x3d70d7<_0x4609d5['query'][_0xe0b0('0x57')][_0xe0b0('0x2e')];_0x3d70d7+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')]['ids'][_0x3d70d7]),'SmsQueueId':Number(_0x4609d5['params']['id'])});}}else{socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')]),'SmsQueueId':Number(_0x4609d5[_0xe0b0('0x41')]['id'])});}});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x421b3b,null))[_0xe0b0('0x3d')](handleError(_0x421b3b,null));};exports[_0xe0b0('0x78')]=function(_0x932e,_0x1b3f4d){var _0x4fe048={};var _0xac45e6={};var _0x401c4b;var _0x3e18a3;return db[_0xe0b0('0x1d')]['findOne']({'where':{'id':_0x932e[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x1b3f4d,null))[_0xe0b0('0x18')](function(_0x116c16){if(_0x116c16){_0x401c4b=_0x116c16;_0xac45e6[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x4a')]['rawAttributes']);_0xac45e6[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x932e[_0xe0b0('0x23')]);_0xac45e6[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0xac45e6['model'],_0xac45e6['query']);_0x4fe048[_0xe0b0('0x2c')]=_['intersection'](_0xac45e6[_0xe0b0('0x27')],qs['fields'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x4fe048[_0xe0b0('0x2c')]=_0x4fe048[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x4fe048[_0xe0b0('0x2c')]:_0xac45e6[_0xe0b0('0x27')];_0x4fe048['order']=qs['sort'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x44')]);_0x4fe048[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x932e[_0xe0b0('0x23')],_0xac45e6[_0xe0b0('0x2a')]));if(_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x4fe048[_0xe0b0('0x45')]=_['merge'](_0x4fe048['where'],{'$or':_[_0xe0b0('0x48')](_0x4fe048[_0xe0b0('0x2c')],function(_0x187465){var _0x3f9e6b={};_0x3f9e6b[_0x187465]={'$like':'%'+_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3f9e6b;})});}_0x4fe048=_[_0xe0b0('0x30')]({},_0x4fe048,_0x932e['options']);return _0x401c4b['getAgents'](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x1ea4d5){if(_0x1ea4d5){_0x3e18a3=_0x1ea4d5[_0xe0b0('0x2e')];if(!_0x932e[_0xe0b0('0x23')][_0xe0b0('0x79')](_0xe0b0('0x42'))){_0x4fe048[_0xe0b0('0x12')]=qs[_0xe0b0('0x12')](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x12')]);_0x4fe048['offset']=qs[_0xe0b0('0x10')](_0x932e[_0xe0b0('0x23')]['offset']);}return _0x401c4b[_0xe0b0('0x78')](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x3615f9){if(_0x3615f9){return _0x3615f9?{'count':_0x3e18a3,'rows':_0x3615f9}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x1b3f4d,null))[_0xe0b0('0x3d')](handleError(_0x1b3f4d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index bc24c2a..627fac0 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 _0xf88c=['../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x185809,_0x34571d){var _0x1e87d6=function(_0x221b4a){while(--_0x221b4a){_0x185809['push'](_0x185809['shift']());}};_0x1e87d6(++_0x34571d);}(_0xf88c,0xbc));var _0xcf88=function(_0x218a1b,_0x542459){_0x218a1b=_0x218a1b-0x0;var _0x584459=_0xf88c[_0x218a1b];return _0x584459;};'use strict';var EventEmitter=require(_0xcf88('0x0'));var SmsQueue=require(_0xcf88('0x1'))['db'][_0xcf88('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xcf88('0x3')](0x0);var events={'afterCreate':_0xcf88('0x4'),'afterUpdate':_0xcf88('0x5'),'afterDestroy':'remove'};function emitEvent(_0x32c624){return function(_0x27a3ef,_0x78c3b,_0x413c39){SmsQueueEvents[_0xcf88('0x6')](_0x32c624+':'+_0x27a3ef['id'],_0x27a3ef);SmsQueueEvents['emit'](_0x32c624,_0x27a3ef);_0x413c39(null);};}for(var e in events){if(events[_0xcf88('0x7')](e)){var event=events[e];SmsQueue[_0xcf88('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xb06f=['../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0xb06f,0x86));var _0xfb06=function(_0x404441,_0x1a1e60){_0x404441=_0x404441-0x0;var _0x2e5277=_0xb06f[_0x404441];return _0x2e5277;};'use strict';var EventEmitter=require(_0xfb06('0x0'));var SmsQueue=require(_0xfb06('0x1'))['db'][_0xfb06('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xfb06('0x3')](0x0);var events={'afterCreate':_0xfb06('0x4'),'afterUpdate':_0xfb06('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1c00a9){return function(_0xe5cb5f,_0x6d7531,_0x3be9fb){SmsQueueEvents[_0xfb06('0x6')](_0x1c00a9+':'+_0xe5cb5f['id'],_0xe5cb5f);SmsQueueEvents[_0xfb06('0x6')](_0x1c00a9,_0xe5cb5f);_0x3be9fb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xfb06('0x7')](e,emitEvent(event));}}module[_0xfb06('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 4d80197..d23187a 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 _0xd128=['lodash','util','bluebird','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0xfb977,_0x17e051){var _0x4561f3=function(_0x3da8c6){while(--_0x3da8c6){_0xfb977['push'](_0xfb977['shift']());}};_0x4561f3(++_0x17e051);}(_0xd128,0x132));var _0x8d12=function(_0xd80de1,_0x518a43){_0xd80de1=_0xd80de1-0x0;var _0x3c47a2=_0xd128[_0xd80de1];return _0x3c47a2;};'use strict';var _=require(_0x8d12('0x0'));var util=require(_0x8d12('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8d12('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8d12('0x3'));var config=require(_0x8d12('0x4'));var attributes=require(_0x8d12('0x5'));module[_0x8d12('0x6')]=function(_0xb7f9f0,_0x2bffaf){return _0xb7f9f0[_0x8d12('0x7')](_0x8d12('0x8'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c29=['define','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x57a248,_0x32a0eb){var _0x58335f=function(_0x2d6bd3){while(--_0x2d6bd3){_0x57a248['push'](_0x57a248['shift']());}};_0x58335f(++_0x32a0eb);}(_0x1c29,0x148));var _0x91c2=function(_0x438eb7,_0x576401){_0x438eb7=_0x438eb7-0x0;var _0x1a6739=_0x1c29[_0x438eb7];return _0x1a6739;};'use strict';var _=require('lodash');var util=require(_0x91c2('0x0'));var logger=require(_0x91c2('0x1'))(_0x91c2('0x2'));var moment=require(_0x91c2('0x3'));var BPromise=require(_0x91c2('0x4'));var rp=require(_0x91c2('0x5'));var fs=require('fs');var path=require(_0x91c2('0x6'));var rimraf=require(_0x91c2('0x7'));var config=require(_0x91c2('0x8'));var attributes=require(_0x91c2('0x9'));module['exports']=function(_0xebeaa,_0x178d0c){return _0xebeaa[_0x91c2('0xa')](_0x91c2('0xb'),attributes,{'tableName':_0x91c2('0xc'),'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 717c1fc..0bc29ca 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 _0xe6ff=['register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','attributes','limit','map','include','model','GetSmsQueue','raw','ShowSmsQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0x24fd7a,_0x473931){var _0x463ccf=function(_0x5b1e5b){while(--_0x5b1e5b){_0x24fd7a['push'](_0x24fd7a['shift']());}};_0x463ccf(++_0x473931);}(_0xe6ff,0xfa));var _0xfe6f=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xe6ff[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xfe6f('0x0'));var util=require(_0xfe6f('0x1'));var moment=require('moment');var BPromise=require(_0xfe6f('0x2'));var rs=require(_0xfe6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe6f('0x4'))['db'];var utils=require(_0xfe6f('0x5'));var logger=require('../../config/logger')(_0xfe6f('0x6'));var config=require(_0xfe6f('0x7'));var jayson=require(_0xfe6f('0x8'));var client=jayson[_0xfe6f('0x9')][_0xfe6f('0xa')]({'port':0x232a});config[_0xfe6f('0xb')]=_[_0xfe6f('0xc')](config[_0xfe6f('0xb')],{'host':_0xfe6f('0xd'),'port':0x18eb});var socket=require(_0xfe6f('0xe'))(new Redis(config[_0xfe6f('0xb')]));require(_0xfe6f('0xf'))[_0xfe6f('0x10')](socket);function respondWithRpcPromise(_0x3215b2,_0x4a4b0f,_0x6d2928){return new BPromise(function(_0x4c9088,_0x504eeb){return client['request'](_0x3215b2,_0x6d2928)[_0xfe6f('0x11')](function(_0x3e9dd5){logger[_0xfe6f('0x12')](_0xfe6f('0x13'),_0x4a4b0f,_0xfe6f('0x14'));logger[_0xfe6f('0x15')](_0xfe6f('0x16'),_0x4a4b0f,_0xfe6f('0x14'),JSON[_0xfe6f('0x17')](_0x3e9dd5));if(_0x3e9dd5['error']){if(_0x3e9dd5[_0xfe6f('0x18')]['code']===0x1f4){logger[_0xfe6f('0x18')](_0xfe6f('0x13'),_0x4a4b0f,_0x3e9dd5['error'][_0xfe6f('0x19')]);return _0x504eeb(_0x3e9dd5['error']['message']);}logger[_0xfe6f('0x18')](_0xfe6f('0x13'),_0x4a4b0f,_0x3e9dd5['error']['message']);return _0x4c9088(_0x3e9dd5['error']['message']);}else{logger[_0xfe6f('0x12')]('SmsQueue,\x20%s,\x20%s',_0x4a4b0f,'request\x20sent');_0x4c9088(_0x3e9dd5[_0xfe6f('0x1a')]['message']);}})[_0xfe6f('0x1b')](function(_0x343b4c){logger['error'](_0xfe6f('0x13'),_0x4a4b0f,_0x343b4c);_0x504eeb(_0x343b4c);});});}exports['GetSmsQueue']=function(_0x2d549d){var _0x5c8f48=this;return new Promise(function(_0x109d06,_0x27276a){return db['SmsQueue'][_0xfe6f('0x1c')]({'raw':_0x2d549d['options']?_0x2d549d[_0xfe6f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2d549d[_0xfe6f('0x1d')]?_0x2d549d['options']['where']||null:null,'attributes':_0x2d549d[_0xfe6f('0x1d')]?_0x2d549d[_0xfe6f('0x1d')][_0xfe6f('0x1e')]||null:null,'limit':_0x2d549d[_0xfe6f('0x1d')]?_0x2d549d[_0xfe6f('0x1d')][_0xfe6f('0x1f')]||null:null,'include':_0x2d549d[_0xfe6f('0x1d')]?_0x2d549d[_0xfe6f('0x1d')]['include']?_[_0xfe6f('0x20')](_0x2d549d[_0xfe6f('0x1d')][_0xfe6f('0x21')],function(_0x2cb5ce){return{'model':db[_0x2cb5ce[_0xfe6f('0x22')]],'as':_0x2cb5ce['as'],'attributes':_0x2cb5ce[_0xfe6f('0x1e')],'include':_0x2cb5ce[_0xfe6f('0x21')]?_[_0xfe6f('0x20')](_0x2cb5ce['include'],function(_0x1c992d){return{'model':db[_0x1c992d[_0xfe6f('0x22')]],'as':_0x1c992d['as'],'attributes':_0x1c992d[_0xfe6f('0x1e')],'include':_0x1c992d[_0xfe6f('0x21')]?_[_0xfe6f('0x20')](_0x1c992d['include'],function(_0x1a3f47){return{'model':db[_0x1a3f47[_0xfe6f('0x22')]],'as':_0x1a3f47['as'],'attributes':_0x1a3f47[_0xfe6f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfe6f('0x11')](function(_0x506318){logger[_0xfe6f('0x12')]('GetSmsQueue',_0x2d549d);logger[_0xfe6f('0x15')](_0xfe6f('0x23'),_0x2d549d,JSON[_0xfe6f('0x17')](_0x506318));_0x109d06(_0x506318);})[_0xfe6f('0x1b')](function(_0x279dd8){logger[_0xfe6f('0x18')](_0xfe6f('0x23'),_0x279dd8['message'],_0x2d549d);_0x27276a(_0x5c8f48[_0xfe6f('0x18')](0x1f4,_0x279dd8[_0xfe6f('0x19')]));});});};exports['ShowSmsQueue']=function(_0x5673c4){var _0x71a41e=this;return new Promise(function(_0x31cde3,_0xf5cb25){return db['SmsQueue']['find']({'raw':_0x5673c4['options']?_0x5673c4[_0xfe6f('0x1d')][_0xfe6f('0x24')]===undefined?!![]:![]:!![],'where':_0x5673c4[_0xfe6f('0x1d')]?_0x5673c4[_0xfe6f('0x1d')]['where']||null:null,'attributes':_0x5673c4[_0xfe6f('0x1d')]?_0x5673c4[_0xfe6f('0x1d')][_0xfe6f('0x1e')]||null:null,'include':_0x5673c4['options']?_0x5673c4[_0xfe6f('0x1d')][_0xfe6f('0x21')]?_[_0xfe6f('0x20')](_0x5673c4[_0xfe6f('0x1d')][_0xfe6f('0x21')],function(_0x40c551){return{'model':db[_0x40c551[_0xfe6f('0x22')]],'as':_0x40c551['as'],'attributes':_0x40c551[_0xfe6f('0x1e')],'include':_0x40c551[_0xfe6f('0x21')]?_[_0xfe6f('0x20')](_0x40c551[_0xfe6f('0x21')],function(_0x5c3737){return{'model':db[_0x5c3737[_0xfe6f('0x22')]],'as':_0x5c3737['as'],'attributes':_0x5c3737[_0xfe6f('0x1e')],'include':_0x5c3737[_0xfe6f('0x21')]?_[_0xfe6f('0x20')](_0x5c3737[_0xfe6f('0x21')],function(_0x3496a8){return{'model':db[_0x3496a8[_0xfe6f('0x22')]],'as':_0x3496a8['as'],'attributes':_0x3496a8[_0xfe6f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfe6f('0x11')](function(_0xcb7bda){logger[_0xfe6f('0x12')](_0xfe6f('0x25'),_0x5673c4);logger[_0xfe6f('0x15')](_0xfe6f('0x25'),_0x5673c4,JSON['stringify'](_0xcb7bda));_0x31cde3(_0xcb7bda);})[_0xfe6f('0x1b')](function(_0x54d70b){logger['error'](_0xfe6f('0x25'),_0x54d70b[_0xfe6f('0x19')],_0x5673c4);_0xf5cb25(_0x71a41e[_0xfe6f('0x18')](0x1f4,_0x54d70b[_0xfe6f('0x19')]));});});}; \ No newline at end of file +var _0xc7ca=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','where','include','map','attributes','model','GetSmsQueue','find','raw','ShowSmsQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x256cc1,_0x568424){var _0x330d0a=function(_0x4c8cc1){while(--_0x4c8cc1){_0x256cc1['push'](_0x256cc1['shift']());}};_0x330d0a(++_0x568424);}(_0xc7ca,0x8e));var _0xac7c=function(_0x4222b4,_0x4dd8a3){_0x4222b4=_0x4222b4-0x0;var _0x383df0=_0xc7ca[_0x4222b4];return _0x383df0;};'use strict';var _=require('lodash');var util=require(_0xac7c('0x0'));var moment=require(_0xac7c('0x1'));var BPromise=require(_0xac7c('0x2'));var rs=require(_0xac7c('0x3'));var fs=require('fs');var Redis=require(_0xac7c('0x4'));var db=require(_0xac7c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xac7c('0x6'))(_0xac7c('0x7'));var config=require(_0xac7c('0x8'));var jayson=require(_0xac7c('0x9'));var client=jayson[_0xac7c('0xa')]['http']({'port':0x232a});config[_0xac7c('0xb')]=_['defaults'](config['redis'],{'host':_0xac7c('0xc'),'port':0x18eb});var socket=require(_0xac7c('0xd'))(new Redis(config[_0xac7c('0xb')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1b8c56,_0x534c34,_0x4144b9){return new BPromise(function(_0x40b5ee,_0x442b92){return client[_0xac7c('0xe')](_0x1b8c56,_0x4144b9)[_0xac7c('0xf')](function(_0x48cb4a){logger[_0xac7c('0x10')](_0xac7c('0x11'),_0x534c34,_0xac7c('0x12'));logger[_0xac7c('0x13')](_0xac7c('0x14'),_0x534c34,_0xac7c('0x12'),JSON[_0xac7c('0x15')](_0x48cb4a));if(_0x48cb4a['error']){if(_0x48cb4a[_0xac7c('0x16')]['code']===0x1f4){logger[_0xac7c('0x16')](_0xac7c('0x11'),_0x534c34,_0x48cb4a[_0xac7c('0x16')][_0xac7c('0x17')]);return _0x442b92(_0x48cb4a[_0xac7c('0x16')][_0xac7c('0x17')]);}logger[_0xac7c('0x16')](_0xac7c('0x11'),_0x534c34,_0x48cb4a[_0xac7c('0x16')]['message']);return _0x40b5ee(_0x48cb4a['error'][_0xac7c('0x17')]);}else{logger[_0xac7c('0x10')](_0xac7c('0x11'),_0x534c34,_0xac7c('0x12'));_0x40b5ee(_0x48cb4a[_0xac7c('0x18')][_0xac7c('0x17')]);}})[_0xac7c('0x19')](function(_0x31d0ff){logger[_0xac7c('0x16')](_0xac7c('0x11'),_0x534c34,_0x31d0ff);_0x442b92(_0x31d0ff);});});}exports['GetSmsQueue']=function(_0x1b273a){var _0x159da1=this;return new Promise(function(_0x42810e,_0x21ae3b){return db['SmsQueue'][_0xac7c('0x1a')]({'raw':_0x1b273a['options']?_0x1b273a[_0xac7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1b273a[_0xac7c('0x1b')]?_0x1b273a[_0xac7c('0x1b')][_0xac7c('0x1c')]||null:null,'attributes':_0x1b273a[_0xac7c('0x1b')]?_0x1b273a['options']['attributes']||null:null,'limit':_0x1b273a[_0xac7c('0x1b')]?_0x1b273a['options']['limit']||null:null,'include':_0x1b273a[_0xac7c('0x1b')]?_0x1b273a[_0xac7c('0x1b')][_0xac7c('0x1d')]?_[_0xac7c('0x1e')](_0x1b273a[_0xac7c('0x1b')][_0xac7c('0x1d')],function(_0x52648b){return{'model':db[_0x52648b['model']],'as':_0x52648b['as'],'attributes':_0x52648b[_0xac7c('0x1f')],'include':_0x52648b[_0xac7c('0x1d')]?_[_0xac7c('0x1e')](_0x52648b[_0xac7c('0x1d')],function(_0x2acdf3){return{'model':db[_0x2acdf3[_0xac7c('0x20')]],'as':_0x2acdf3['as'],'attributes':_0x2acdf3[_0xac7c('0x1f')],'include':_0x2acdf3[_0xac7c('0x1d')]?_[_0xac7c('0x1e')](_0x2acdf3[_0xac7c('0x1d')],function(_0x2628dd){return{'model':db[_0x2628dd[_0xac7c('0x20')]],'as':_0x2628dd['as'],'attributes':_0x2628dd['attributes']};}):[]};}):[]};}):[]:[]})[_0xac7c('0xf')](function(_0x12d7ea){logger[_0xac7c('0x10')](_0xac7c('0x21'),_0x1b273a);logger[_0xac7c('0x13')](_0xac7c('0x21'),_0x1b273a,JSON['stringify'](_0x12d7ea));_0x42810e(_0x12d7ea);})[_0xac7c('0x19')](function(_0x230a7d){logger['error'](_0xac7c('0x21'),_0x230a7d['message'],_0x1b273a);_0x21ae3b(_0x159da1['error'](0x1f4,_0x230a7d[_0xac7c('0x17')]));});});};exports['ShowSmsQueue']=function(_0x519329){var _0x3b9c1=this;return new Promise(function(_0x5a512f,_0x45a45c){return db['SmsQueue'][_0xac7c('0x22')]({'raw':_0x519329[_0xac7c('0x1b')]?_0x519329[_0xac7c('0x1b')][_0xac7c('0x23')]===undefined?!![]:![]:!![],'where':_0x519329['options']?_0x519329[_0xac7c('0x1b')][_0xac7c('0x1c')]||null:null,'attributes':_0x519329[_0xac7c('0x1b')]?_0x519329[_0xac7c('0x1b')][_0xac7c('0x1f')]||null:null,'include':_0x519329[_0xac7c('0x1b')]?_0x519329[_0xac7c('0x1b')][_0xac7c('0x1d')]?_[_0xac7c('0x1e')](_0x519329[_0xac7c('0x1b')]['include'],function(_0x314703){return{'model':db[_0x314703['model']],'as':_0x314703['as'],'attributes':_0x314703[_0xac7c('0x1f')],'include':_0x314703[_0xac7c('0x1d')]?_[_0xac7c('0x1e')](_0x314703[_0xac7c('0x1d')],function(_0x55733a){return{'model':db[_0x55733a['model']],'as':_0x55733a['as'],'attributes':_0x55733a['attributes'],'include':_0x55733a[_0xac7c('0x1d')]?_[_0xac7c('0x1e')](_0x55733a['include'],function(_0x161acf){return{'model':db[_0x161acf[_0xac7c('0x20')]],'as':_0x161acf['as'],'attributes':_0x161acf[_0xac7c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d72de){logger[_0xac7c('0x10')]('ShowSmsQueue',_0x519329);logger[_0xac7c('0x13')](_0xac7c('0x24'),_0x519329,JSON[_0xac7c('0x15')](_0x3d72de));_0x5a512f(_0x3d72de);})['catch'](function(_0x5893ec){logger[_0xac7c('0x16')](_0xac7c('0x24'),_0x5893ec[_0xac7c('0x17')],_0x519329);_0x45a45c(_0x3b9c1[_0xac7c('0x16')](0x1f4,_0x5893ec['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index a99b9f4..36748fd 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 _0x6469=['update','length','smsQueue:','./smsQueue.events','remove'];(function(_0x480113,_0xebe8c7){var _0x520d93=function(_0x5c92d2){while(--_0x5c92d2){_0x480113['push'](_0x480113['shift']());}};_0x520d93(++_0xebe8c7);}(_0x6469,0x134));var _0x9646=function(_0x313691,_0x271217){_0x313691=_0x313691-0x0;var _0x5c3ea2=_0x6469[_0x313691];return _0x5c3ea2;};'use strict';var SmsQueueEvents=require(_0x9646('0x0'));var events=['save',_0x9646('0x1'),_0x9646('0x2')];function createListener(_0x25b984,_0x1028ed){return function(_0x384871){_0x1028ed['emit'](_0x25b984,_0x384871);};}function removeListener(_0x2847e1,_0x24eaf8){return function(){SmsQueueEvents['removeListener'](_0x2847e1,_0x24eaf8);};}exports['register']=function(_0x1be76f){for(var _0x599fae=0x0,_0xb4e446=events[_0x9646('0x3')];_0x599fae<_0xb4e446;_0x599fae++){var _0x51183a=events[_0x599fae];var _0x1e767c=createListener(_0x9646('0x4')+_0x51183a,_0x1be76f);SmsQueueEvents['on'](_0x51183a,_0x1e767c);}}; \ No newline at end of file +var _0xe5af=['remove','update','emit','removeListener','register','length','./smsQueue.events','save'];(function(_0x27c339,_0x4ab0d7){var _0x4433a8=function(_0x33286c){while(--_0x33286c){_0x27c339['push'](_0x27c339['shift']());}};_0x4433a8(++_0x4ab0d7);}(_0xe5af,0x1ae));var _0xfe5a=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0xe5af[_0x20714a];return _0x15e877;};'use strict';var SmsQueueEvents=require(_0xfe5a('0x0'));var events=[_0xfe5a('0x1'),_0xfe5a('0x2'),_0xfe5a('0x3')];function createListener(_0x30b92f,_0x440d90){return function(_0x34cb5b){_0x440d90[_0xfe5a('0x4')](_0x30b92f,_0x34cb5b);};}function removeListener(_0x175677,_0x278ee7){return function(){SmsQueueEvents[_0xfe5a('0x5')](_0x175677,_0x278ee7);};}exports[_0xfe5a('0x6')]=function(_0x33c43e){for(var _0x4d5170=0x0,_0x3b539d=events[_0xfe5a('0x7')];_0x4d5170<_0x3b539d;_0x4d5170++){var _0x218275=events[_0x4d5170];var _0x159fdf=createListener('smsQueue:'+_0x218275,_0x33c43e);SmsQueueEvents['on'](_0x218275,_0x159fdf);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 4f53c87..f7605ae 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 _0xf3fe=['destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete'];(function(_0x247a33,_0x5a517d){var _0x13d4c5=function(_0x3fa781){while(--_0x3fa781){_0x247a33['push'](_0x247a33['shift']());}};_0x13d4c5(++_0x5a517d);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x6f7b07,_0x5077f6){_0x6f7b07=_0x6f7b07-0x0;var _0x299377=_0xf3fe[_0x6f7b07];return _0x299377;};'use strict';var multer=require('multer');var util=require(_0xef3f('0x0'));var path=require(_0xef3f('0x1'));var timeout=require(_0xef3f('0x2'));var express=require(_0xef3f('0x3'));var router=express[_0xef3f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xef3f('0x5'));var interaction=require(_0xef3f('0x6'));var config=require(_0xef3f('0x7'));var controller=require(_0xef3f('0x8'));router[_0xef3f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xef3f('0x9')](_0xef3f('0xa'),auth[_0xef3f('0xb')](),controller[_0xef3f('0xc')]);router[_0xef3f('0x9')](_0xef3f('0xd'),auth[_0xef3f('0xb')](),controller[_0xef3f('0xe')]);router[_0xef3f('0xf')]('/',auth['isAuthenticated'](),controller[_0xef3f('0x10')]);router['put'](_0xef3f('0xd'),auth[_0xef3f('0xb')](),controller[_0xef3f('0x11')]);router[_0xef3f('0x12')]('/:id',auth[_0xef3f('0xb')](),controller[_0xef3f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xfcda=['/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xfcda,0x198));var _0xafcd=function(_0x3c9164,_0x302ae3){_0x3c9164=_0x3c9164-0x0;var _0x431176=_0xfcda[_0x3c9164];return _0x431176;};'use strict';var multer=require(_0xafcd('0x0'));var util=require(_0xafcd('0x1'));var path=require('path');var timeout=require(_0xafcd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xafcd('0x3'));var interaction=require(_0xafcd('0x4'));var config=require(_0xafcd('0x5'));var controller=require(_0xafcd('0x6'));router[_0xafcd('0x7')]('/',auth[_0xafcd('0x8')](),controller[_0xafcd('0x9')]);router['get'](_0xafcd('0xa'),auth['isAuthenticated'](),controller[_0xafcd('0xb')]);router[_0xafcd('0x7')](_0xafcd('0xc'),auth[_0xafcd('0x8')](),controller[_0xafcd('0xd')]);router[_0xafcd('0xe')]('/',auth['isAuthenticated'](),controller[_0xafcd('0xf')]);router[_0xafcd('0x10')](_0xafcd('0xc'),auth[_0xafcd('0x8')](),controller[_0xafcd('0x11')]);router[_0xafcd('0x12')](_0xafcd('0xc'),auth[_0xafcd('0x8')](),controller[_0xafcd('0x13')]);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 fccbd43..d2fada0 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 _0x66c7=['STRING','DATE','exports'];(function(_0x2022b7,_0x298b2e){var _0x1077ca=function(_0x47a408){while(--_0x47a408){_0x2022b7['push'](_0x2022b7['shift']());}};_0x1077ca(++_0x298b2e);}(_0x66c7,0x19d));var _0x766c=function(_0x23e004,_0x31a72b){_0x23e004=_0x23e004-0x0;var _0x3af90d=_0x66c7[_0x23e004];return _0x3af90d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x766c('0x0')]={'uniqueid':{'type':Sequelize[_0x766c('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x766c('0x2')]},'leaveAt':{'type':Sequelize[_0x766c('0x2')]},'acceptAt':{'type':Sequelize[_0x766c('0x2')]},'exitAt':{'type':Sequelize[_0x766c('0x2')]},'reason':{'type':Sequelize[_0x766c('0x1')]}}; \ No newline at end of file +var _0x4fef=['STRING','DATE','moment','sequelize','exports'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x4fef,0x1dd));var _0xf4fe=function(_0x4cd600,_0x457e44){_0x4cd600=_0x4cd600-0x0;var _0x395b1c=_0x4fef[_0x4cd600];return _0x395b1c;};'use strict';var moment=require(_0xf4fe('0x0'));var Sequelize=require(_0xf4fe('0x1'));module[_0xf4fe('0x2')]={'uniqueid':{'type':Sequelize[_0xf4fe('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf4fe('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf4fe('0x4')]},'exitAt':{'type':Sequelize[_0xf4fe('0x4')]},'reason':{'type':Sequelize[_0xf4fe('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 1010292..6f4c2ba 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 _0xecbb=['filter','options','includeAll','include','findAll','rows','catch','show','keys','create','body','update','params','destroy','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','end','error','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL'];(function(_0x267f88,_0x5edf18){var _0x5932ac=function(_0x1be538){while(--_0x1be538){_0x267f88['push'](_0x267f88['shift']());}};_0x5932ac(++_0x5edf18);}(_0xecbb,0x140));var _0xbecb=function(_0x32048c,_0x3cc91d){_0x32048c=_0x32048c-0x0;var _0x3bb3e3=_0xecbb[_0x32048c];return _0x3bb3e3;};'use strict';var emlformat=require(_0xbecb('0x0'));var rimraf=require(_0xbecb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbecb('0x2'));var moment=require(_0xbecb('0x3'));var BPromise=require(_0xbecb('0x4'));var Mustache=require(_0xbecb('0x5'));var util=require(_0xbecb('0x6'));var path=require(_0xbecb('0x7'));var sox=require(_0xbecb('0x8'));var csv=require(_0xbecb('0x9'));var ejs=require(_0xbecb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbecb('0xb'));var squel=require(_0xbecb('0xc'));var crypto=require(_0xbecb('0xd'));var jsforce=require(_0xbecb('0xe'));var deskjs=require(_0xbecb('0xf'));var toCsv=require(_0xbecb('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbecb('0x10'));var authService=require(_0xbecb('0x11'));var qs=require(_0xbecb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbecb('0x13'));var logger=require(_0xbecb('0x14'))(_0xbecb('0x15'));var utils=require('../../config/utils');var config=require(_0xbecb('0x16'));var licenseUtil=require(_0xbecb('0x17'));var db=require(_0xbecb('0x18'))['db'];function respondWithStatusCode(_0xa2e1e,_0x1ea670){_0x1ea670=_0x1ea670||0xcc;return function(_0x418e0f){if(_0x418e0f){return _0xa2e1e[_0xbecb('0x19')](_0x1ea670);}return _0xa2e1e[_0xbecb('0x1a')](_0x1ea670)['end']();};}function respondWithResult(_0x37b9c1,_0x2f9f2c){_0x2f9f2c=_0x2f9f2c||0xc8;return function(_0x41102d){if(_0x41102d){return _0x37b9c1['status'](_0x2f9f2c)['json'](_0x41102d);}};}function respondWithFilteredResult(_0x1136c6,_0x9aa7b8){return function(_0x165605){if(_0x165605){var _0x36d7c8=typeof _0x9aa7b8[_0xbecb('0x1b')]===_0xbecb('0x1c')&&typeof _0x9aa7b8['limit']===_0xbecb('0x1c');var _0x55dfa4=_0x165605[_0xbecb('0x1d')];var _0xd43278=_0x36d7c8?0x0:_0x9aa7b8[_0xbecb('0x1b')];var _0x2ae741=_0x36d7c8?_0x165605[_0xbecb('0x1d')]:_0x9aa7b8[_0xbecb('0x1b')]+_0x9aa7b8[_0xbecb('0x1e')];var _0x5240fe;if(_0x2ae741>=_0x55dfa4){_0x2ae741=_0x55dfa4;_0x5240fe=0xc8;}else{_0x5240fe=0xce;}_0x1136c6['status'](_0x5240fe);return _0x1136c6[_0xbecb('0x1f')](_0xbecb('0x20'),_0xd43278+'-'+_0x2ae741+'/'+_0x55dfa4)[_0xbecb('0x21')](_0x165605);}return null;};}function patchUpdates(_0x564c51){return function(_0x199389){try{jsonpatch['apply'](_0x199389,_0x564c51,!![]);}catch(_0x429aa8){return BPromise[_0xbecb('0x22')](_0x429aa8);}return _0x199389[_0xbecb('0x23')]();};}function saveUpdates(_0x4b4d53,_0x50ab2d){return function(_0x1c5f2e){if(_0x1c5f2e){return _0x1c5f2e['update'](_0x4b4d53)[_0xbecb('0x24')](function(_0x5d5354){return _0x5d5354;});}return null;};}function removeEntity(_0x48d4cf,_0x56ef88){return function(_0x7d178b){if(_0x7d178b){return _0x7d178b['destroy']()[_0xbecb('0x24')](function(){_0x48d4cf[_0xbecb('0x1a')](0xcc)[_0xbecb('0x25')]();});}};}function handleEntityNotFound(_0x3d984e,_0x458638){return function(_0x102c86){if(!_0x102c86){_0x3d984e[_0xbecb('0x19')](0x194);}return _0x102c86;};}function handleError(_0x33cc36,_0x163889){_0x163889=_0x163889||0x1f4;return function(_0x5414fb){logger[_0xbecb('0x26')](_0x5414fb['stack']);if(_0x5414fb['name']){delete _0x5414fb[_0xbecb('0x27')];}_0x33cc36[_0xbecb('0x1a')](_0x163889)[_0xbecb('0x28')](_0x5414fb);};}exports[_0xbecb('0x29')]=function(_0x3a579b,_0x41f181){var _0xcbd7dd={},_0x3cc64c={},_0x355363={'count':0x0,'rows':[]};var _0x234942=_['map'](db[_0xbecb('0x2a')][_0xbecb('0x2b')],function(_0x39d21d){return{'name':_0x39d21d[_0xbecb('0x2c')],'type':_0x39d21d[_0xbecb('0x2d')][_0xbecb('0x2e')]};});_0x3cc64c[_0xbecb('0x2f')]=_[_0xbecb('0x30')](_0x234942,_0xbecb('0x27'));_0x3cc64c[_0xbecb('0x31')]=_['keys'](_0x3a579b['query']);_0x3cc64c[_0xbecb('0x32')]=_[_0xbecb('0x33')](_0x3cc64c[_0xbecb('0x2f')],_0x3cc64c[_0xbecb('0x31')]);_0xcbd7dd[_0xbecb('0x34')]=_[_0xbecb('0x33')](_0x3cc64c[_0xbecb('0x2f')],qs[_0xbecb('0x35')](_0x3a579b[_0xbecb('0x31')]['fields']));_0xcbd7dd['attributes']=_0xcbd7dd[_0xbecb('0x34')]['length']?_0xcbd7dd['attributes']:_0x3cc64c[_0xbecb('0x2f')];if(!_0x3a579b[_0xbecb('0x31')][_0xbecb('0x36')]('nolimit')){_0xcbd7dd[_0xbecb('0x1e')]=qs[_0xbecb('0x1e')](_0x3a579b[_0xbecb('0x31')][_0xbecb('0x1e')]);_0xcbd7dd[_0xbecb('0x1b')]=qs[_0xbecb('0x1b')](_0x3a579b['query']['offset']);}_0xcbd7dd[_0xbecb('0x37')]=qs[_0xbecb('0x38')](_0x3a579b[_0xbecb('0x31')][_0xbecb('0x38')]);_0xcbd7dd[_0xbecb('0x39')]=qs[_0xbecb('0x32')](_['pick'](_0x3a579b[_0xbecb('0x31')],_0x3cc64c['filters']),_0x234942);if(_0x3a579b[_0xbecb('0x31')]['filter']){_0xcbd7dd[_0xbecb('0x39')]=_[_0xbecb('0x3a')](_0xcbd7dd[_0xbecb('0x39')],{'$or':_[_0xbecb('0x30')](_0x234942,function(_0x2c417c){if(_0x2c417c['type']!==_0xbecb('0x3b')){var _0x1e52f6={};_0x1e52f6[_0x2c417c[_0xbecb('0x27')]]={'$like':'%'+_0x3a579b[_0xbecb('0x31')][_0xbecb('0x3c')]+'%'};return _0x1e52f6;}})});}_0xcbd7dd=_['merge']({},_0xcbd7dd,_0x3a579b[_0xbecb('0x3d')]);var _0x68dcdb={'where':_0xcbd7dd[_0xbecb('0x39')]};return db[_0xbecb('0x2a')]['count'](_0x68dcdb)[_0xbecb('0x24')](function(_0x30b162){_0x355363[_0xbecb('0x1d')]=_0x30b162;if(_0x3a579b[_0xbecb('0x31')][_0xbecb('0x3e')]){_0xcbd7dd[_0xbecb('0x3f')]=[{'all':!![]}];}return db[_0xbecb('0x2a')][_0xbecb('0x40')](_0xcbd7dd);})[_0xbecb('0x24')](function(_0x1c81f7){_0x355363[_0xbecb('0x41')]=_0x1c81f7;return _0x355363;})[_0xbecb('0x24')](respondWithFilteredResult(_0x41f181,_0xcbd7dd))[_0xbecb('0x42')](handleError(_0x41f181,null));};exports[_0xbecb('0x43')]=function(_0x2b8f6a,_0x4a212e){var _0x188723={'raw':!![],'where':{'id':_0x2b8f6a['params']['id']}},_0xef95fe={};_0xef95fe[_0xbecb('0x2f')]=_[_0xbecb('0x44')](db[_0xbecb('0x2a')][_0xbecb('0x2b')]);_0xef95fe[_0xbecb('0x31')]=_['keys'](_0x2b8f6a[_0xbecb('0x31')]);_0xef95fe['filters']=_['intersection'](_0xef95fe[_0xbecb('0x2f')],_0xef95fe[_0xbecb('0x31')]);_0x188723[_0xbecb('0x34')]=_[_0xbecb('0x33')](_0xef95fe[_0xbecb('0x2f')],qs['fields'](_0x2b8f6a[_0xbecb('0x31')]['fields']));_0x188723['attributes']=_0x188723[_0xbecb('0x34')]['length']?_0x188723[_0xbecb('0x34')]:_0xef95fe[_0xbecb('0x2f')];if(_0x2b8f6a['query'][_0xbecb('0x3e')]){_0x188723[_0xbecb('0x3f')]=[{'all':!![]}];}_0x188723=_['merge']({},_0x188723,_0x2b8f6a['options']);return db['SmsQueueReport']['find'](_0x188723)['then'](handleEntityNotFound(_0x4a212e,null))[_0xbecb('0x24')](respondWithResult(_0x4a212e,null))[_0xbecb('0x42')](handleError(_0x4a212e,null));};exports[_0xbecb('0x45')]=function(_0x1c5ebb,_0x5dbf30){return db[_0xbecb('0x2a')][_0xbecb('0x45')](_0x1c5ebb[_0xbecb('0x46')],{})[_0xbecb('0x24')](respondWithResult(_0x5dbf30,0xc9))[_0xbecb('0x42')](handleError(_0x5dbf30,null));};exports[_0xbecb('0x47')]=function(_0xe82017,_0x31f8d2){if(_0xe82017[_0xbecb('0x46')]['id']){delete _0xe82017[_0xbecb('0x46')]['id'];}return db[_0xbecb('0x2a')]['find']({'where':{'id':_0xe82017[_0xbecb('0x48')]['id']}})['then'](handleEntityNotFound(_0x31f8d2,null))[_0xbecb('0x24')](saveUpdates(_0xe82017['body'],null))[_0xbecb('0x24')](respondWithResult(_0x31f8d2,null))[_0xbecb('0x42')](handleError(_0x31f8d2,null));};exports[_0xbecb('0x49')]=function(_0x3ad9ab,_0x5a1c17){return db[_0xbecb('0x2a')][_0xbecb('0x4a')]({'where':{'id':_0x3ad9ab[_0xbecb('0x48')]['id']}})[_0xbecb('0x24')](handleEntityNotFound(_0x5a1c17,null))[_0xbecb('0x24')](removeEntity(_0x5a1c17,null))[_0xbecb('0x42')](handleError(_0x5a1c17,null));};exports['describe']=function(_0x52ef04,_0x158b11){return db[_0xbecb('0x2a')][_0xbecb('0x4b')]()[_0xbecb('0x24')](respondWithResult(_0x158b11,null))[_0xbecb('0x42')](handleError(_0x158b11,null));}; \ No newline at end of file +var _0xf016=['fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','stack','name','map','SmsQueueReport','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xf016,0x8c));var _0x6f01=function(_0x85f9bd,_0x39d69b){_0x85f9bd=_0x85f9bd-0x0;var _0x49a39f=_0xf016[_0x85f9bd];return _0x49a39f;};'use strict';var emlformat=require(_0x6f01('0x0'));var rimraf=require(_0x6f01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f01('0x2'));var rp=require(_0x6f01('0x3'));var moment=require('moment');var BPromise=require(_0x6f01('0x4'));var Mustache=require(_0x6f01('0x5'));var util=require(_0x6f01('0x6'));var path=require(_0x6f01('0x7'));var sox=require(_0x6f01('0x8'));var csv=require('to-csv');var ejs=require(_0x6f01('0x9'));var fs=require('fs');var fs_extra=require(_0x6f01('0xa'));var _=require(_0x6f01('0xb'));var squel=require(_0x6f01('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6f01('0xd'));var toCsv=require(_0x6f01('0xe'));var querystring=require(_0x6f01('0xf'));var Papa=require(_0x6f01('0x10'));var Redis=require('ioredis');var authService=require(_0x6f01('0x11'));var qs=require(_0x6f01('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f01('0x13'));var logger=require(_0x6f01('0x14'))(_0x6f01('0x15'));var utils=require(_0x6f01('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6f01('0x17'));var db=require(_0x6f01('0x18'))['db'];function respondWithStatusCode(_0x1512b4,_0x4ff120){_0x4ff120=_0x4ff120||0xcc;return function(_0x485223){if(_0x485223){return _0x1512b4[_0x6f01('0x19')](_0x4ff120);}return _0x1512b4['status'](_0x4ff120)[_0x6f01('0x1a')]();};}function respondWithResult(_0x2b84c3,_0x5a1be3){_0x5a1be3=_0x5a1be3||0xc8;return function(_0x1fbaa6){if(_0x1fbaa6){return _0x2b84c3[_0x6f01('0x1b')](_0x5a1be3)[_0x6f01('0x1c')](_0x1fbaa6);}};}function respondWithFilteredResult(_0x44119e,_0x34f1de){return function(_0x473de8){if(_0x473de8){var _0xa12fbd=typeof _0x34f1de['offset']===_0x6f01('0x1d')&&typeof _0x34f1de[_0x6f01('0x1e')]===_0x6f01('0x1d');var _0x239180=_0x473de8[_0x6f01('0x1f')];var _0x5e8868=_0xa12fbd?0x0:_0x34f1de['offset'];var _0x4e0c0a=_0xa12fbd?_0x473de8[_0x6f01('0x1f')]:_0x34f1de[_0x6f01('0x20')]+_0x34f1de[_0x6f01('0x1e')];var _0xc8666f;if(_0x4e0c0a>=_0x239180){_0x4e0c0a=_0x239180;_0xc8666f=0xc8;}else{_0xc8666f=0xce;}_0x44119e[_0x6f01('0x1b')](_0xc8666f);return _0x44119e['set'](_0x6f01('0x21'),_0x5e8868+'-'+_0x4e0c0a+'/'+_0x239180)[_0x6f01('0x1c')](_0x473de8);}return null;};}function patchUpdates(_0x9230e3){return function(_0x24aadc){try{jsonpatch[_0x6f01('0x22')](_0x24aadc,_0x9230e3,!![]);}catch(_0x981f92){return BPromise[_0x6f01('0x23')](_0x981f92);}return _0x24aadc[_0x6f01('0x24')]();};}function saveUpdates(_0x181da2,_0x8661a7){return function(_0x34dbce){if(_0x34dbce){return _0x34dbce['update'](_0x181da2)[_0x6f01('0x25')](function(_0x3924ac){return _0x3924ac;});}return null;};}function removeEntity(_0x1d9258,_0x51fafc){return function(_0x12acb7){if(_0x12acb7){return _0x12acb7[_0x6f01('0x26')]()[_0x6f01('0x25')](function(){_0x1d9258[_0x6f01('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x186b96,_0x1b7def){return function(_0x1f08a7){if(!_0x1f08a7){_0x186b96[_0x6f01('0x19')](0x194);}return _0x1f08a7;};}function handleError(_0x16e189,_0x8d01a9){_0x8d01a9=_0x8d01a9||0x1f4;return function(_0x24dfa0){logger['error'](_0x24dfa0[_0x6f01('0x27')]);if(_0x24dfa0[_0x6f01('0x28')]){delete _0x24dfa0['name'];}_0x16e189[_0x6f01('0x1b')](_0x8d01a9)['send'](_0x24dfa0);};}exports['index']=function(_0x5493ef,_0x33e3de){var _0x5c956d={},_0x5b4382={},_0x2326f8={'count':0x0,'rows':[]};var _0x371270=_[_0x6f01('0x29')](db[_0x6f01('0x2a')]['rawAttributes'],function(_0x520ee5){return{'name':_0x520ee5['fieldName'],'type':_0x520ee5[_0x6f01('0x2b')][_0x6f01('0x2c')]};});_0x5b4382[_0x6f01('0x2d')]=_[_0x6f01('0x29')](_0x371270,_0x6f01('0x28'));_0x5b4382['query']=_[_0x6f01('0x2e')](_0x5493ef['query']);_0x5b4382[_0x6f01('0x2f')]=_[_0x6f01('0x30')](_0x5b4382['model'],_0x5b4382[_0x6f01('0x31')]);_0x5c956d['attributes']=_['intersection'](_0x5b4382[_0x6f01('0x2d')],qs[_0x6f01('0x32')](_0x5493ef['query'][_0x6f01('0x32')]));_0x5c956d[_0x6f01('0x33')]=_0x5c956d['attributes'][_0x6f01('0x34')]?_0x5c956d[_0x6f01('0x33')]:_0x5b4382[_0x6f01('0x2d')];if(!_0x5493ef[_0x6f01('0x31')][_0x6f01('0x35')](_0x6f01('0x36'))){_0x5c956d[_0x6f01('0x1e')]=qs[_0x6f01('0x1e')](_0x5493ef[_0x6f01('0x31')]['limit']);_0x5c956d[_0x6f01('0x20')]=qs['offset'](_0x5493ef[_0x6f01('0x31')][_0x6f01('0x20')]);}_0x5c956d['order']=qs['sort'](_0x5493ef[_0x6f01('0x31')][_0x6f01('0x37')]);_0x5c956d[_0x6f01('0x38')]=qs[_0x6f01('0x2f')](_[_0x6f01('0x39')](_0x5493ef[_0x6f01('0x31')],_0x5b4382['filters']),_0x371270);if(_0x5493ef[_0x6f01('0x31')][_0x6f01('0x3a')]){_0x5c956d['where']=_['merge'](_0x5c956d[_0x6f01('0x38')],{'$or':_[_0x6f01('0x29')](_0x371270,function(_0x45b2ff){if(_0x45b2ff[_0x6f01('0x2b')]!==_0x6f01('0x3b')){var _0x5b624a={};_0x5b624a[_0x45b2ff['name']]={'$like':'%'+_0x5493ef[_0x6f01('0x31')]['filter']+'%'};return _0x5b624a;}})});}_0x5c956d=_[_0x6f01('0x3c')]({},_0x5c956d,_0x5493ef[_0x6f01('0x3d')]);var _0x2e14ca={'where':_0x5c956d[_0x6f01('0x38')]};return db[_0x6f01('0x2a')]['count'](_0x2e14ca)[_0x6f01('0x25')](function(_0x5097d7){_0x2326f8[_0x6f01('0x1f')]=_0x5097d7;if(_0x5493ef[_0x6f01('0x31')]['includeAll']){_0x5c956d[_0x6f01('0x3e')]=[{'all':!![]}];}return db[_0x6f01('0x2a')][_0x6f01('0x3f')](_0x5c956d);})[_0x6f01('0x25')](function(_0x28e085){_0x2326f8[_0x6f01('0x40')]=_0x28e085;return _0x2326f8;})[_0x6f01('0x25')](respondWithFilteredResult(_0x33e3de,_0x5c956d))[_0x6f01('0x41')](handleError(_0x33e3de,null));};exports[_0x6f01('0x42')]=function(_0x217c92,_0xcd2d6b){var _0x32e1c1={'raw':!![],'where':{'id':_0x217c92[_0x6f01('0x43')]['id']}},_0x592bcd={};_0x592bcd[_0x6f01('0x2d')]=_[_0x6f01('0x2e')](db[_0x6f01('0x2a')][_0x6f01('0x44')]);_0x592bcd['query']=_['keys'](_0x217c92[_0x6f01('0x31')]);_0x592bcd[_0x6f01('0x2f')]=_['intersection'](_0x592bcd[_0x6f01('0x2d')],_0x592bcd[_0x6f01('0x31')]);_0x32e1c1[_0x6f01('0x33')]=_['intersection'](_0x592bcd['model'],qs[_0x6f01('0x32')](_0x217c92[_0x6f01('0x31')][_0x6f01('0x32')]));_0x32e1c1[_0x6f01('0x33')]=_0x32e1c1[_0x6f01('0x33')][_0x6f01('0x34')]?_0x32e1c1['attributes']:_0x592bcd[_0x6f01('0x2d')];if(_0x217c92[_0x6f01('0x31')][_0x6f01('0x45')]){_0x32e1c1['include']=[{'all':!![]}];}_0x32e1c1=_['merge']({},_0x32e1c1,_0x217c92[_0x6f01('0x3d')]);return db[_0x6f01('0x2a')][_0x6f01('0x46')](_0x32e1c1)['then'](handleEntityNotFound(_0xcd2d6b,null))['then'](respondWithResult(_0xcd2d6b,null))[_0x6f01('0x41')](handleError(_0xcd2d6b,null));};exports[_0x6f01('0x47')]=function(_0xc58d9f,_0x34a7db){return db['SmsQueueReport'][_0x6f01('0x47')](_0xc58d9f[_0x6f01('0x48')],{})['then'](respondWithResult(_0x34a7db,0xc9))[_0x6f01('0x41')](handleError(_0x34a7db,null));};exports[_0x6f01('0x49')]=function(_0x204d92,_0x4e0fc5){if(_0x204d92[_0x6f01('0x48')]['id']){delete _0x204d92[_0x6f01('0x48')]['id'];}return db[_0x6f01('0x2a')][_0x6f01('0x46')]({'where':{'id':_0x204d92[_0x6f01('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e0fc5,null))['then'](saveUpdates(_0x204d92[_0x6f01('0x48')],null))[_0x6f01('0x25')](respondWithResult(_0x4e0fc5,null))[_0x6f01('0x41')](handleError(_0x4e0fc5,null));};exports[_0x6f01('0x26')]=function(_0xa0687e,_0x2ebc1f){return db[_0x6f01('0x2a')]['find']({'where':{'id':_0xa0687e[_0x6f01('0x43')]['id']}})[_0x6f01('0x25')](handleEntityNotFound(_0x2ebc1f,null))[_0x6f01('0x25')](removeEntity(_0x2ebc1f,null))[_0x6f01('0x41')](handleError(_0x2ebc1f,null));};exports[_0x6f01('0x4a')]=function(_0xd1cff3,_0x17da30){return db[_0x6f01('0x2a')][_0x6f01('0x4a')]()['then'](respondWithResult(_0x17da30,null))['catch'](handleError(_0x17da30,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 61138f8..3b29a2e 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x216f3c,_0x46eb91){var _0x28f716=function(_0x5f368c){while(--_0x5f368c){_0x216f3c['push'](_0x216f3c['shift']());}};_0x28f716(++_0x46eb91);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x1f8f4e,_0xa56726){var _0x44e3ed=function(_0xe14fef){while(--_0xe14fef){_0x1f8f4e['push'](_0x1f8f4e['shift']());}};_0x44e3ed(++_0xa56726);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xb7e7[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 6bee867..f53f46e 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 _0x2238=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','debug','UpdateSmsQueueReport','options','raw','where','attributes','limit','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2238,0x11f));var _0x8223=function(_0x11ae90,_0x264184){_0x11ae90=_0x11ae90-0x0;var _0x9bf663=_0x2238[_0x11ae90];return _0x9bf663;};'use strict';var _=require(_0x8223('0x0'));var util=require(_0x8223('0x1'));var moment=require(_0x8223('0x2'));var BPromise=require(_0x8223('0x3'));var rs=require(_0x8223('0x4'));var fs=require('fs');var Redis=require(_0x8223('0x5'));var db=require(_0x8223('0x6'))['db'];var utils=require(_0x8223('0x7'));var logger=require(_0x8223('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8223('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39c133,_0x2d17cb,_0x21beac){return new BPromise(function(_0x446092,_0x390933){return client['request'](_0x39c133,_0x21beac)[_0x8223('0xa')](function(_0x279de9){logger[_0x8223('0xb')](_0x8223('0xc'),_0x2d17cb,_0x8223('0xd'));logger['debug'](_0x8223('0xe'),_0x2d17cb,'request\x20sent',JSON[_0x8223('0xf')](_0x279de9));if(_0x279de9['error']){if(_0x279de9[_0x8223('0x10')][_0x8223('0x11')]===0x1f4){logger['error'](_0x8223('0xc'),_0x2d17cb,_0x279de9[_0x8223('0x10')][_0x8223('0x12')]);return _0x390933(_0x279de9[_0x8223('0x10')]['message']);}logger[_0x8223('0x10')](_0x8223('0xc'),_0x2d17cb,_0x279de9[_0x8223('0x10')]['message']);return _0x446092(_0x279de9[_0x8223('0x10')][_0x8223('0x12')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x2d17cb,_0x8223('0xd'));_0x446092(_0x279de9[_0x8223('0x13')][_0x8223('0x12')]);}})[_0x8223('0x14')](function(_0x2c47c3){logger['error'](_0x8223('0xc'),_0x2d17cb,_0x2c47c3);_0x390933(_0x2c47c3);});});}exports[_0x8223('0x15')]=function(_0x16586c){var _0x2e06f4=this;return new Promise(function(_0x2d41cf,_0x3765f7){return db[_0x8223('0x16')][_0x8223('0x17')](_0x16586c[_0x8223('0x18')],{'raw':_0x16586c['options']?_0x16586c['options']['raw']===undefined?!![]:![]:!![]})[_0x8223('0xa')](function(_0x3062b4){logger[_0x8223('0xb')](_0x8223('0x15'),_0x16586c);logger[_0x8223('0x19')](_0x8223('0x15'),_0x16586c,JSON['stringify'](_0x3062b4));_0x2d41cf(_0x3062b4);})['catch'](function(_0x39090f){logger[_0x8223('0x10')](_0x8223('0x15'),_0x39090f[_0x8223('0x12')],_0x16586c);_0x3765f7(_0x2e06f4['error'](0x1f4,_0x39090f[_0x8223('0x12')]));});});};exports[_0x8223('0x1a')]=function(_0x16ff34){var _0x593e06=this;return new Promise(function(_0x45aa13,_0x5053a9){return db[_0x8223('0x16')]['update'](_0x16ff34[_0x8223('0x18')],{'raw':_0x16ff34[_0x8223('0x1b')]?_0x16ff34[_0x8223('0x1b')][_0x8223('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ff34[_0x8223('0x1b')]?_0x16ff34['options'][_0x8223('0x1d')]||null:null,'attributes':_0x16ff34[_0x8223('0x1b')]?_0x16ff34[_0x8223('0x1b')][_0x8223('0x1e')]||null:null,'limit':_0x16ff34[_0x8223('0x1b')]?_0x16ff34['options'][_0x8223('0x1f')]||null:null})[_0x8223('0xa')](function(_0x478b5d){logger[_0x8223('0xb')]('UpdateSmsQueueReport',_0x16ff34);logger[_0x8223('0x19')](_0x8223('0x1a'),_0x16ff34,JSON[_0x8223('0xf')](_0x478b5d));_0x45aa13(_0x478b5d);})[_0x8223('0x14')](function(_0x96c23f){logger['error'](_0x8223('0x1a'),_0x96c23f['message'],_0x16ff34);_0x5053a9(_0x593e06['error'](0x1f4,_0x96c23f['message']));});});}; \ No newline at end of file +var _0x7404=['CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','catch','UpdateSmsQueueReport','where','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x3fd9cc,_0x57816b){var _0x53e052=function(_0x5288f8){while(--_0x5288f8){_0x3fd9cc['push'](_0x3fd9cc['shift']());}};_0x53e052(++_0x57816b);}(_0x7404,0xbf));var _0x4740=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7404[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x4740('0x0'));var util=require(_0x4740('0x1'));var moment=require(_0x4740('0x2'));var BPromise=require('bluebird');var rs=require(_0x4740('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4740('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4740('0x5'))(_0x4740('0x6'));var config=require(_0x4740('0x7'));var jayson=require(_0x4740('0x8'));var client=jayson['client'][_0x4740('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c9046,_0x2cf10e,_0x5818b4){return new BPromise(function(_0x2dd1ab,_0x4c5e88){return client[_0x4740('0xa')](_0x2c9046,_0x5818b4)[_0x4740('0xb')](function(_0x30fe13){logger[_0x4740('0xc')](_0x4740('0xd'),_0x2cf10e,_0x4740('0xe'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2cf10e,_0x4740('0xe'),JSON[_0x4740('0xf')](_0x30fe13));if(_0x30fe13[_0x4740('0x10')]){if(_0x30fe13[_0x4740('0x10')]['code']===0x1f4){logger[_0x4740('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x2cf10e,_0x30fe13[_0x4740('0x10')]['message']);return _0x4c5e88(_0x30fe13[_0x4740('0x10')][_0x4740('0x11')]);}logger[_0x4740('0x10')](_0x4740('0xd'),_0x2cf10e,_0x30fe13[_0x4740('0x10')]['message']);return _0x2dd1ab(_0x30fe13[_0x4740('0x10')][_0x4740('0x11')]);}else{logger['info'](_0x4740('0xd'),_0x2cf10e,_0x4740('0xe'));_0x2dd1ab(_0x30fe13[_0x4740('0x12')][_0x4740('0x11')]);}})['catch'](function(_0xdcfb17){logger[_0x4740('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x2cf10e,_0xdcfb17);_0x4c5e88(_0xdcfb17);});});}exports[_0x4740('0x13')]=function(_0x4719d2){var _0x3e2671=this;return new Promise(function(_0x1aff17,_0x15dd88){return db[_0x4740('0x14')][_0x4740('0x15')](_0x4719d2[_0x4740('0x16')],{'raw':_0x4719d2[_0x4740('0x17')]?_0x4719d2[_0x4740('0x17')][_0x4740('0x18')]===undefined?!![]:![]:!![]})[_0x4740('0xb')](function(_0x8084bb){logger['info'](_0x4740('0x13'),_0x4719d2);logger[_0x4740('0x19')](_0x4740('0x13'),_0x4719d2,JSON[_0x4740('0xf')](_0x8084bb));_0x1aff17(_0x8084bb);})[_0x4740('0x1a')](function(_0x4a5be9){logger[_0x4740('0x10')]('CreateSmsQueueReport',_0x4a5be9[_0x4740('0x11')],_0x4719d2);_0x15dd88(_0x3e2671['error'](0x1f4,_0x4a5be9[_0x4740('0x11')]));});});};exports[_0x4740('0x1b')]=function(_0x580b16){var _0x591a95=this;return new Promise(function(_0x468d69,_0x15a228){return db[_0x4740('0x14')]['update'](_0x580b16[_0x4740('0x16')],{'raw':_0x580b16['options']?_0x580b16[_0x4740('0x17')][_0x4740('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x580b16[_0x4740('0x17')]?_0x580b16['options'][_0x4740('0x1c')]||null:null,'attributes':_0x580b16[_0x4740('0x17')]?_0x580b16[_0x4740('0x17')]['attributes']||null:null,'limit':_0x580b16[_0x4740('0x17')]?_0x580b16[_0x4740('0x17')][_0x4740('0x1d')]||null:null})[_0x4740('0xb')](function(_0x1ce3f7){logger[_0x4740('0xc')]('UpdateSmsQueueReport',_0x580b16);logger[_0x4740('0x19')](_0x4740('0x1b'),_0x580b16,JSON[_0x4740('0xf')](_0x1ce3f7));_0x468d69(_0x1ce3f7);})['catch'](function(_0x2d15e6){logger[_0x4740('0x10')](_0x4740('0x1b'),_0x2d15e6['message'],_0x580b16);_0x15a228(_0x591a95[_0x4740('0x10')](0x1f4,_0x2d15e6[_0x4740('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index a185e37..5046193 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 _0x3eea=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2b57c1,_0x38603c){var _0x156094=function(_0x246ca5){while(--_0x246ca5){_0x2b57c1['push'](_0x2b57c1['shift']());}};_0x156094(++_0x38603c);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xd80e12,_0x53c433){_0xd80e12=_0xd80e12-0x0;var _0x10cb7d=_0x3eea[_0xd80e12];return _0x10cb7d;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['get'](_0xa3ee('0xe'),auth['isAuthenticated'](),controller[_0xa3ee('0xf')]);router['post']('/',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x10')]);router[_0xa3ee('0x11')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x12')]);router['delete']('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x13')]);module[_0xa3ee('0x14')]=router; \ No newline at end of file +var _0x4f17=['put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','post','create'];(function(_0x5456dd,_0x3b19b3){var _0x2ee279=function(_0x1b17b7){while(--_0x1b17b7){_0x5456dd['push'](_0x5456dd['shift']());}};_0x2ee279(++_0x3b19b3);}(_0x4f17,0x9e));var _0x74f1=function(_0x153faa,_0x75f2a){_0x153faa=_0x153faa-0x0;var _0x43c32a=_0x4f17[_0x153faa];return _0x43c32a;};'use strict';var multer=require(_0x74f1('0x0'));var util=require('util');var path=require(_0x74f1('0x1'));var timeout=require(_0x74f1('0x2'));var express=require('express');var router=express[_0x74f1('0x3')]();var fs_extra=require(_0x74f1('0x4'));var auth=require(_0x74f1('0x5'));var interaction=require(_0x74f1('0x6'));var config=require(_0x74f1('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x74f1('0x8')](),controller['index']);router[_0x74f1('0x9')]('/describe',auth[_0x74f1('0x8')](),controller[_0x74f1('0xa')]);router[_0x74f1('0x9')]('/:id',auth[_0x74f1('0x8')](),controller['show']);router[_0x74f1('0xb')]('/',auth['isAuthenticated'](),controller[_0x74f1('0xc')]);router[_0x74f1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x74f1('0xe')]);router[_0x74f1('0xf')](_0x74f1('0x10'),auth[_0x74f1('0x8')](),controller[_0x74f1('0x11')]);module[_0x74f1('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 951afa5..9f171d3 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2a7be1,_0x172286){var _0x483a8e=function(_0x1dbffa){while(--_0x1dbffa){_0x2a7be1['push'](_0x2a7be1['shift']());}};_0x483a8e(++_0x172286);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xcb91[_0x1147ab];return _0x55cb5a;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x273dae,_0x1163a9){var _0x24ad3b=function(_0x58ea58){while(--_0x58ea58){_0x273dae['push'](_0x273dae['shift']());}};_0x24ad3b(++_0x1163a9);}(_0xaa88,0x137));var _0x8aa8=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xaa88[_0xf71120];return _0xbe2fd3;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 7a91798..2ae322b 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 _0x6773=['request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../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','SmsTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','catch','params','length','find','create','body','describe','eml-format','fast-json-patch'];(function(_0x2be0b6,_0xec5feb){var _0x159c43=function(_0x247189){while(--_0x247189){_0x2be0b6['push'](_0x2be0b6['shift']());}};_0x159c43(++_0xec5feb);}(_0x6773,0x16b));var _0x3677=function(_0x53538f,_0x3b129d){_0x53538f=_0x53538f-0x0;var _0x4a5ffc=_0x6773[_0x53538f];return _0x4a5ffc;};'use strict';var emlformat=require(_0x3677('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3677('0x1'));var rp=require(_0x3677('0x2'));var moment=require(_0x3677('0x3'));var BPromise=require(_0x3677('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3677('0x5'));var sox=require(_0x3677('0x6'));var csv=require(_0x3677('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3677('0x8'));var squel=require(_0x3677('0x9'));var crypto=require(_0x3677('0xa'));var jsforce=require(_0x3677('0xb'));var deskjs=require(_0x3677('0xc'));var toCsv=require(_0x3677('0x7'));var querystring=require(_0x3677('0xd'));var Papa=require('papaparse');var Redis=require(_0x3677('0xe'));var authService=require(_0x3677('0xf'));var qs=require(_0x3677('0x10'));var as=require(_0x3677('0x11'));var hardwareService=require(_0x3677('0x12'));var logger=require(_0x3677('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3677('0x14'));var licenseUtil=require(_0x3677('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5537d6,_0x2203f6){_0x2203f6=_0x2203f6||0xcc;return function(_0x557be0){if(_0x557be0){return _0x5537d6[_0x3677('0x16')](_0x2203f6);}return _0x5537d6[_0x3677('0x17')](_0x2203f6)[_0x3677('0x18')]();};}function respondWithResult(_0x4e61b5,_0x1b59bc){_0x1b59bc=_0x1b59bc||0xc8;return function(_0x42a85a){if(_0x42a85a){return _0x4e61b5['status'](_0x1b59bc)[_0x3677('0x19')](_0x42a85a);}};}function respondWithFilteredResult(_0x3d863f,_0x3d3c2c){return function(_0xdd9237){if(_0xdd9237){var _0x4f56e6=typeof _0x3d3c2c[_0x3677('0x1a')]===_0x3677('0x1b')&&typeof _0x3d3c2c[_0x3677('0x1c')]===_0x3677('0x1b');var _0x591779=_0xdd9237['count'];var _0x1a7af8=_0x4f56e6?0x0:_0x3d3c2c[_0x3677('0x1a')];var _0x5666e5=_0x4f56e6?_0xdd9237[_0x3677('0x1d')]:_0x3d3c2c['offset']+_0x3d3c2c[_0x3677('0x1c')];var _0x2bbcd3;if(_0x5666e5>=_0x591779){_0x5666e5=_0x591779;_0x2bbcd3=0xc8;}else{_0x2bbcd3=0xce;}_0x3d863f[_0x3677('0x17')](_0x2bbcd3);return _0x3d863f[_0x3677('0x1e')](_0x3677('0x1f'),_0x1a7af8+'-'+_0x5666e5+'/'+_0x591779)[_0x3677('0x19')](_0xdd9237);}return null;};}function patchUpdates(_0x58d4a7){return function(_0xa3bbfa){try{jsonpatch[_0x3677('0x20')](_0xa3bbfa,_0x58d4a7,!![]);}catch(_0x1bf191){return BPromise[_0x3677('0x21')](_0x1bf191);}return _0xa3bbfa[_0x3677('0x22')]();};}function saveUpdates(_0x186f78,_0x34bef5){return function(_0xf06e88){if(_0xf06e88){return _0xf06e88[_0x3677('0x23')](_0x186f78)[_0x3677('0x24')](function(_0x5710d5){return _0x5710d5;});}return null;};}function removeEntity(_0x53bffb,_0x3119e8){return function(_0x37ab31){if(_0x37ab31){return _0x37ab31[_0x3677('0x25')]()[_0x3677('0x24')](function(){_0x53bffb[_0x3677('0x17')](0xcc)[_0x3677('0x18')]();});}};}function handleEntityNotFound(_0x421f89,_0x9eee30){return function(_0x36be27){if(!_0x36be27){_0x421f89[_0x3677('0x16')](0x194);}return _0x36be27;};}function handleError(_0x3eb876,_0x3d2e47){_0x3d2e47=_0x3d2e47||0x1f4;return function(_0x55aaf7){logger[_0x3677('0x26')](_0x55aaf7[_0x3677('0x27')]);if(_0x55aaf7['name']){delete _0x55aaf7['name'];}_0x3eb876[_0x3677('0x17')](_0x3d2e47)[_0x3677('0x28')](_0x55aaf7);};}exports[_0x3677('0x29')]=function(_0x81dba4,_0x5e3032){var _0xe72b90={},_0x4e9e3e={},_0x17ecdb={'count':0x0,'rows':[]};var _0xb8ac3a=_[_0x3677('0x2a')](db[_0x3677('0x2b')][_0x3677('0x2c')],function(_0xfcccc1){return{'name':_0xfcccc1[_0x3677('0x2d')],'type':_0xfcccc1[_0x3677('0x2e')][_0x3677('0x2f')]};});_0x4e9e3e[_0x3677('0x30')]=_[_0x3677('0x2a')](_0xb8ac3a,_0x3677('0x31'));_0x4e9e3e[_0x3677('0x32')]=_[_0x3677('0x33')](_0x81dba4[_0x3677('0x32')]);_0x4e9e3e['filters']=_[_0x3677('0x34')](_0x4e9e3e[_0x3677('0x30')],_0x4e9e3e[_0x3677('0x32')]);_0xe72b90[_0x3677('0x35')]=_[_0x3677('0x34')](_0x4e9e3e['model'],qs['fields'](_0x81dba4[_0x3677('0x32')][_0x3677('0x36')]));_0xe72b90[_0x3677('0x35')]=_0xe72b90[_0x3677('0x35')]['length']?_0xe72b90['attributes']:_0x4e9e3e['model'];if(!_0x81dba4[_0x3677('0x32')]['hasOwnProperty'](_0x3677('0x37'))){_0xe72b90[_0x3677('0x1c')]=qs[_0x3677('0x1c')](_0x81dba4[_0x3677('0x32')]['limit']);_0xe72b90['offset']=qs[_0x3677('0x1a')](_0x81dba4[_0x3677('0x32')][_0x3677('0x1a')]);}_0xe72b90[_0x3677('0x38')]=qs[_0x3677('0x39')](_0x81dba4[_0x3677('0x32')]['sort']);_0xe72b90[_0x3677('0x3a')]=qs[_0x3677('0x3b')](_[_0x3677('0x3c')](_0x81dba4['query'],_0x4e9e3e[_0x3677('0x3b')]),_0xb8ac3a);if(_0x81dba4['query'][_0x3677('0x3d')]){_0xe72b90[_0x3677('0x3a')]=_[_0x3677('0x3e')](_0xe72b90[_0x3677('0x3a')],{'$or':_[_0x3677('0x2a')](_0xb8ac3a,function(_0x34b28a){if(_0x34b28a[_0x3677('0x2e')]!==_0x3677('0x3f')){var _0x3bcc9c={};_0x3bcc9c[_0x34b28a[_0x3677('0x31')]]={'$like':'%'+_0x81dba4[_0x3677('0x32')]['filter']+'%'};return _0x3bcc9c;}})});}_0xe72b90=_[_0x3677('0x3e')]({},_0xe72b90,_0x81dba4['options']);var _0x2ec682={'where':_0xe72b90[_0x3677('0x3a')]};return db[_0x3677('0x2b')]['count'](_0x2ec682)['then'](function(_0x566f4f){_0x17ecdb['count']=_0x566f4f;if(_0x81dba4[_0x3677('0x32')][_0x3677('0x40')]){_0xe72b90[_0x3677('0x41')]=[{'all':!![]}];}return db[_0x3677('0x2b')]['findAll'](_0xe72b90);})[_0x3677('0x24')](function(_0x112135){_0x17ecdb['rows']=_0x112135;return _0x17ecdb;})[_0x3677('0x24')](respondWithFilteredResult(_0x5e3032,_0xe72b90))[_0x3677('0x42')](handleError(_0x5e3032,null));};exports['show']=function(_0x128cd3,_0x7081ce){var _0x36d746={'raw':!![],'where':{'id':_0x128cd3[_0x3677('0x43')]['id']}},_0x5e802f={};_0x5e802f[_0x3677('0x30')]=_[_0x3677('0x33')](db[_0x3677('0x2b')][_0x3677('0x2c')]);_0x5e802f[_0x3677('0x32')]=_[_0x3677('0x33')](_0x128cd3[_0x3677('0x32')]);_0x5e802f[_0x3677('0x3b')]=_[_0x3677('0x34')](_0x5e802f[_0x3677('0x30')],_0x5e802f[_0x3677('0x32')]);_0x36d746[_0x3677('0x35')]=_['intersection'](_0x5e802f[_0x3677('0x30')],qs[_0x3677('0x36')](_0x128cd3[_0x3677('0x32')]['fields']));_0x36d746[_0x3677('0x35')]=_0x36d746[_0x3677('0x35')][_0x3677('0x44')]?_0x36d746[_0x3677('0x35')]:_0x5e802f[_0x3677('0x30')];if(_0x128cd3[_0x3677('0x32')][_0x3677('0x40')]){_0x36d746[_0x3677('0x41')]=[{'all':!![]}];}_0x36d746=_[_0x3677('0x3e')]({},_0x36d746,_0x128cd3['options']);return db['SmsTransferReport'][_0x3677('0x45')](_0x36d746)['then'](handleEntityNotFound(_0x7081ce,null))[_0x3677('0x24')](respondWithResult(_0x7081ce,null))[_0x3677('0x42')](handleError(_0x7081ce,null));};exports['create']=function(_0x4fe50d,_0x418954){return db[_0x3677('0x2b')][_0x3677('0x46')](_0x4fe50d['body'],{})[_0x3677('0x24')](respondWithResult(_0x418954,0xc9))[_0x3677('0x42')](handleError(_0x418954,null));};exports[_0x3677('0x23')]=function(_0x428419,_0x2bf960){if(_0x428419[_0x3677('0x47')]['id']){delete _0x428419[_0x3677('0x47')]['id'];}return db[_0x3677('0x2b')][_0x3677('0x45')]({'where':{'id':_0x428419[_0x3677('0x43')]['id']}})['then'](handleEntityNotFound(_0x2bf960,null))[_0x3677('0x24')](saveUpdates(_0x428419[_0x3677('0x47')],null))['then'](respondWithResult(_0x2bf960,null))[_0x3677('0x42')](handleError(_0x2bf960,null));};exports[_0x3677('0x25')]=function(_0x245eeb,_0x166344){return db[_0x3677('0x2b')][_0x3677('0x45')]({'where':{'id':_0x245eeb[_0x3677('0x43')]['id']}})[_0x3677('0x24')](handleEntityNotFound(_0x166344,null))[_0x3677('0x24')](removeEntity(_0x166344,null))[_0x3677('0x42')](handleError(_0x166344,null));};exports['describe']=function(_0x5c0dd6,_0x5b27e4){return db[_0x3677('0x2b')][_0x3677('0x48')]()[_0x3677('0x24')](respondWithResult(_0x5b27e4,null))[_0x3677('0x42')](handleError(_0x5b27e4,null));}; \ No newline at end of file +var _0xf3a5=['json','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','pick','filters','merge','filter','options','SmsTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x2f8734,_0x2d440b){var _0x1fd851=function(_0x1df2ae){while(--_0x1df2ae){_0x2f8734['push'](_0x2f8734['shift']());}};_0x1fd851(++_0x2d440b);}(_0xf3a5,0x73));var _0x5f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5f3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f3a('0x1'));var jsonpatch=require(_0x5f3a('0x2'));var rp=require(_0x5f3a('0x3'));var moment=require('moment');var BPromise=require(_0x5f3a('0x4'));var Mustache=require('mustache');var util=require(_0x5f3a('0x5'));var path=require(_0x5f3a('0x6'));var sox=require(_0x5f3a('0x7'));var csv=require(_0x5f3a('0x8'));var ejs=require(_0x5f3a('0x9'));var fs=require('fs');var fs_extra=require(_0x5f3a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f3a('0xb'));var jsforce=require(_0x5f3a('0xc'));var deskjs=require(_0x5f3a('0xd'));var toCsv=require(_0x5f3a('0x8'));var querystring=require(_0x5f3a('0xe'));var Papa=require(_0x5f3a('0xf'));var Redis=require(_0x5f3a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f3a('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5f3a('0x12'));var licenseUtil=require(_0x5f3a('0x13'));var db=require(_0x5f3a('0x14'))['db'];function respondWithStatusCode(_0x1ff9c8,_0x6c6d0c){_0x6c6d0c=_0x6c6d0c||0xcc;return function(_0x30c8b7){if(_0x30c8b7){return _0x1ff9c8[_0x5f3a('0x15')](_0x6c6d0c);}return _0x1ff9c8[_0x5f3a('0x16')](_0x6c6d0c)[_0x5f3a('0x17')]();};}function respondWithResult(_0x3ff7bb,_0x4815c9){_0x4815c9=_0x4815c9||0xc8;return function(_0x21355e){if(_0x21355e){return _0x3ff7bb['status'](_0x4815c9)['json'](_0x21355e);}};}function respondWithFilteredResult(_0x3a8775,_0x3be63b){return function(_0x5410d5){if(_0x5410d5){var _0x2df9df=typeof _0x3be63b[_0x5f3a('0x18')]===_0x5f3a('0x19')&&typeof _0x3be63b[_0x5f3a('0x1a')]===_0x5f3a('0x19');var _0x562f94=_0x5410d5[_0x5f3a('0x1b')];var _0xddda45=_0x2df9df?0x0:_0x3be63b[_0x5f3a('0x18')];var _0x243f15=_0x2df9df?_0x5410d5[_0x5f3a('0x1b')]:_0x3be63b[_0x5f3a('0x18')]+_0x3be63b[_0x5f3a('0x1a')];var _0x234168;if(_0x243f15>=_0x562f94){_0x243f15=_0x562f94;_0x234168=0xc8;}else{_0x234168=0xce;}_0x3a8775[_0x5f3a('0x16')](_0x234168);return _0x3a8775[_0x5f3a('0x1c')]('Content-Range',_0xddda45+'-'+_0x243f15+'/'+_0x562f94)[_0x5f3a('0x1d')](_0x5410d5);}return null;};}function patchUpdates(_0x56ad57){return function(_0x1625f7){try{jsonpatch[_0x5f3a('0x1e')](_0x1625f7,_0x56ad57,!![]);}catch(_0x22ba93){return BPromise[_0x5f3a('0x1f')](_0x22ba93);}return _0x1625f7[_0x5f3a('0x20')]();};}function saveUpdates(_0x4baae8,_0x345f78){return function(_0x281d9d){if(_0x281d9d){return _0x281d9d[_0x5f3a('0x21')](_0x4baae8)[_0x5f3a('0x22')](function(_0x3eb7aa){return _0x3eb7aa;});}return null;};}function removeEntity(_0x169543,_0x3be139){return function(_0xfbdfde){if(_0xfbdfde){return _0xfbdfde['destroy']()[_0x5f3a('0x22')](function(){_0x169543['status'](0xcc)[_0x5f3a('0x17')]();});}};}function handleEntityNotFound(_0x415e82,_0x1098f8){return function(_0xb9c95){if(!_0xb9c95){_0x415e82['sendStatus'](0x194);}return _0xb9c95;};}function handleError(_0x1d79ab,_0x182c81){_0x182c81=_0x182c81||0x1f4;return function(_0x6c3c7f){logger[_0x5f3a('0x23')](_0x6c3c7f[_0x5f3a('0x24')]);if(_0x6c3c7f['name']){delete _0x6c3c7f[_0x5f3a('0x25')];}_0x1d79ab[_0x5f3a('0x16')](_0x182c81)['send'](_0x6c3c7f);};}exports[_0x5f3a('0x26')]=function(_0x23917e,_0x303d6e){var _0xd8608e={},_0x903f7f={},_0x313956={'count':0x0,'rows':[]};var _0x4df035=_[_0x5f3a('0x27')](db['SmsTransferReport'][_0x5f3a('0x28')],function(_0x4811c0){return{'name':_0x4811c0[_0x5f3a('0x29')],'type':_0x4811c0[_0x5f3a('0x2a')][_0x5f3a('0x2b')]};});_0x903f7f[_0x5f3a('0x2c')]=_[_0x5f3a('0x27')](_0x4df035,_0x5f3a('0x25'));_0x903f7f[_0x5f3a('0x2d')]=_[_0x5f3a('0x2e')](_0x23917e[_0x5f3a('0x2d')]);_0x903f7f['filters']=_[_0x5f3a('0x2f')](_0x903f7f[_0x5f3a('0x2c')],_0x903f7f['query']);_0xd8608e['attributes']=_[_0x5f3a('0x2f')](_0x903f7f[_0x5f3a('0x2c')],qs[_0x5f3a('0x30')](_0x23917e[_0x5f3a('0x2d')][_0x5f3a('0x30')]));_0xd8608e[_0x5f3a('0x31')]=_0xd8608e[_0x5f3a('0x31')][_0x5f3a('0x32')]?_0xd8608e[_0x5f3a('0x31')]:_0x903f7f['model'];if(!_0x23917e[_0x5f3a('0x2d')]['hasOwnProperty']('nolimit')){_0xd8608e['limit']=qs[_0x5f3a('0x1a')](_0x23917e[_0x5f3a('0x2d')][_0x5f3a('0x1a')]);_0xd8608e[_0x5f3a('0x18')]=qs[_0x5f3a('0x18')](_0x23917e[_0x5f3a('0x2d')][_0x5f3a('0x18')]);}_0xd8608e[_0x5f3a('0x33')]=qs[_0x5f3a('0x34')](_0x23917e[_0x5f3a('0x2d')][_0x5f3a('0x34')]);_0xd8608e[_0x5f3a('0x35')]=qs['filters'](_[_0x5f3a('0x36')](_0x23917e[_0x5f3a('0x2d')],_0x903f7f[_0x5f3a('0x37')]),_0x4df035);if(_0x23917e['query']['filter']){_0xd8608e[_0x5f3a('0x35')]=_[_0x5f3a('0x38')](_0xd8608e[_0x5f3a('0x35')],{'$or':_[_0x5f3a('0x27')](_0x4df035,function(_0x446491){if(_0x446491[_0x5f3a('0x2a')]!=='VIRTUAL'){var _0x541c97={};_0x541c97[_0x446491[_0x5f3a('0x25')]]={'$like':'%'+_0x23917e[_0x5f3a('0x2d')][_0x5f3a('0x39')]+'%'};return _0x541c97;}})});}_0xd8608e=_[_0x5f3a('0x38')]({},_0xd8608e,_0x23917e[_0x5f3a('0x3a')]);var _0xa41b4f={'where':_0xd8608e['where']};return db[_0x5f3a('0x3b')]['count'](_0xa41b4f)['then'](function(_0xee043d){_0x313956[_0x5f3a('0x1b')]=_0xee043d;if(_0x23917e[_0x5f3a('0x2d')][_0x5f3a('0x3c')]){_0xd8608e[_0x5f3a('0x3d')]=[{'all':!![]}];}return db[_0x5f3a('0x3b')][_0x5f3a('0x3e')](_0xd8608e);})[_0x5f3a('0x22')](function(_0x371ccd){_0x313956[_0x5f3a('0x3f')]=_0x371ccd;return _0x313956;})[_0x5f3a('0x22')](respondWithFilteredResult(_0x303d6e,_0xd8608e))[_0x5f3a('0x40')](handleError(_0x303d6e,null));};exports[_0x5f3a('0x41')]=function(_0x4e5bf5,_0x7a981b){var _0x47459b={'raw':!![],'where':{'id':_0x4e5bf5[_0x5f3a('0x42')]['id']}},_0x1c1b4a={};_0x1c1b4a['model']=_[_0x5f3a('0x2e')](db['SmsTransferReport'][_0x5f3a('0x28')]);_0x1c1b4a['query']=_['keys'](_0x4e5bf5['query']);_0x1c1b4a[_0x5f3a('0x37')]=_[_0x5f3a('0x2f')](_0x1c1b4a['model'],_0x1c1b4a['query']);_0x47459b[_0x5f3a('0x31')]=_[_0x5f3a('0x2f')](_0x1c1b4a['model'],qs[_0x5f3a('0x30')](_0x4e5bf5['query'][_0x5f3a('0x30')]));_0x47459b[_0x5f3a('0x31')]=_0x47459b['attributes']['length']?_0x47459b[_0x5f3a('0x31')]:_0x1c1b4a[_0x5f3a('0x2c')];if(_0x4e5bf5[_0x5f3a('0x2d')]['includeAll']){_0x47459b[_0x5f3a('0x3d')]=[{'all':!![]}];}_0x47459b=_[_0x5f3a('0x38')]({},_0x47459b,_0x4e5bf5[_0x5f3a('0x3a')]);return db[_0x5f3a('0x3b')][_0x5f3a('0x43')](_0x47459b)[_0x5f3a('0x22')](handleEntityNotFound(_0x7a981b,null))[_0x5f3a('0x22')](respondWithResult(_0x7a981b,null))['catch'](handleError(_0x7a981b,null));};exports[_0x5f3a('0x44')]=function(_0x2cce4e,_0x41318b){return db['SmsTransferReport'][_0x5f3a('0x44')](_0x2cce4e[_0x5f3a('0x45')],{})[_0x5f3a('0x22')](respondWithResult(_0x41318b,0xc9))['catch'](handleError(_0x41318b,null));};exports[_0x5f3a('0x21')]=function(_0x2e274b,_0x3dbffc){if(_0x2e274b['body']['id']){delete _0x2e274b[_0x5f3a('0x45')]['id'];}return db['SmsTransferReport'][_0x5f3a('0x43')]({'where':{'id':_0x2e274b['params']['id']}})[_0x5f3a('0x22')](handleEntityNotFound(_0x3dbffc,null))['then'](saveUpdates(_0x2e274b[_0x5f3a('0x45')],null))[_0x5f3a('0x22')](respondWithResult(_0x3dbffc,null))[_0x5f3a('0x40')](handleError(_0x3dbffc,null));};exports[_0x5f3a('0x46')]=function(_0x3d09f4,_0x41e735){return db[_0x5f3a('0x3b')][_0x5f3a('0x43')]({'where':{'id':_0x3d09f4[_0x5f3a('0x42')]['id']}})[_0x5f3a('0x22')](handleEntityNotFound(_0x41e735,null))[_0x5f3a('0x22')](removeEntity(_0x41e735,null))['catch'](handleError(_0x41e735,null));};exports[_0x5f3a('0x47')]=function(_0xc207e1,_0x1415e0){return db[_0x5f3a('0x3b')]['describe']()[_0x5f3a('0x22')](respondWithResult(_0x1415e0,null))[_0x5f3a('0x40')](handleError(_0x1415e0,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index b01d9ca..c1c8bb2 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 _0x6817=['bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x17b331,_0x15a809){var _0x1ef0d5=function(_0x576a49){while(--_0x576a49){_0x17b331['push'](_0x17b331['shift']());}};_0x1ef0d5(++_0x15a809);}(_0x6817,0xf8));var _0x7681=function(_0x299eb6,_0x20fd6f){_0x299eb6=_0x299eb6-0x0;var _0x4ce3d5=_0x6817[_0x299eb6];return _0x4ce3d5;};'use strict';var _=require('lodash');var util=require(_0x7681('0x0'));var logger=require(_0x7681('0x1'))(_0x7681('0x2'));var moment=require(_0x7681('0x3'));var BPromise=require(_0x7681('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7681('0x5'));var rimraf=require(_0x7681('0x6'));var config=require(_0x7681('0x7'));var attributes=require(_0x7681('0x8'));module[_0x7681('0x9')]=function(_0x3f8b86,_0x1688f4){return _0x3f8b86[_0x7681('0xa')](_0x7681('0xb'),attributes,{'tableName':_0x7681('0xc'),'paranoid':![],'indexes':[{'name':_0x7681('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c5b=['SmsTransferReport','report_sms_transfer','uniqueid','../../config/logger','api','moment','path','../../config/environment','./smsTransferReport.attributes','exports','define'];(function(_0x5d1eb5,_0x3c652a){var _0x1fe92f=function(_0x9092ad){while(--_0x9092ad){_0x5d1eb5['push'](_0x5d1eb5['shift']());}};_0x1fe92f(++_0x3c652a);}(_0x1c5b,0x184));var _0xb1c5=function(_0x1c3d7f,_0x46b1c2){_0x1c3d7f=_0x1c3d7f-0x0;var _0x238e21=_0x1c5b[_0x1c3d7f];return _0x238e21;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb1c5('0x0'))(_0xb1c5('0x1'));var moment=require(_0xb1c5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1c5('0x3'));var rimraf=require('rimraf');var config=require(_0xb1c5('0x4'));var attributes=require(_0xb1c5('0x5'));module[_0xb1c5('0x6')]=function(_0x2f1a57,_0x4a05e9){return _0x2f1a57[_0xb1c5('0x7')](_0xb1c5('0x8'),attributes,{'tableName':_0xb1c5('0x9'),'paranoid':![],'indexes':[{'name':_0xb1c5('0xa'),'fields':[_0xb1c5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index db3197c..b9c7cd0 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 _0x975f=['client','http','request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x44869f,_0x5b885f){var _0x406374=function(_0x2af400){while(--_0x2af400){_0x44869f['push'](_0x44869f['shift']());}};_0x406374(++_0x5b885f);}(_0x975f,0x109));var _0xf975=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0x975f[_0x4704dc];return _0x254d81;};'use strict';var _=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf975('0x2'));var fs=require('fs');var Redis=require(_0xf975('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf975('0x4'));var logger=require(_0xf975('0x5'))(_0xf975('0x6'));var config=require(_0xf975('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf975('0x8')][_0xf975('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36f6cf,_0x2018ea,_0x51a37c){return new BPromise(function(_0x194d30,_0x43cf7a){return client[_0xf975('0xa')](_0x36f6cf,_0x51a37c)['then'](function(_0x2e2ab1){logger[_0xf975('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x2018ea,_0xf975('0xc'));logger[_0xf975('0xd')](_0xf975('0xe'),_0x2018ea,_0xf975('0xc'),JSON[_0xf975('0xf')](_0x2e2ab1));if(_0x2e2ab1[_0xf975('0x10')]){if(_0x2e2ab1[_0xf975('0x10')]['code']===0x1f4){logger[_0xf975('0x10')](_0xf975('0x11'),_0x2018ea,_0x2e2ab1['error'][_0xf975('0x12')]);return _0x43cf7a(_0x2e2ab1[_0xf975('0x10')][_0xf975('0x12')]);}logger[_0xf975('0x10')](_0xf975('0x11'),_0x2018ea,_0x2e2ab1[_0xf975('0x10')][_0xf975('0x12')]);return _0x194d30(_0x2e2ab1['error'][_0xf975('0x12')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x2018ea,_0xf975('0xc'));_0x194d30(_0x2e2ab1[_0xf975('0x13')][_0xf975('0x12')]);}})[_0xf975('0x14')](function(_0x300312){logger[_0xf975('0x10')](_0xf975('0x11'),_0x2018ea,_0x300312);_0x43cf7a(_0x300312);});});} \ No newline at end of file +var _0x92bc=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x31a4a6,_0x4272b){var _0x23966b=function(_0x148941){while(--_0x148941){_0x31a4a6['push'](_0x31a4a6['shift']());}};_0x23966b(++_0x4272b);}(_0x92bc,0x106));var _0xc92b=function(_0x985bb5,_0x3f15c8){_0x985bb5=_0x985bb5-0x0;var _0x31123c=_0x92bc[_0x985bb5];return _0x31123c;};'use strict';var _=require(_0xc92b('0x0'));var util=require(_0xc92b('0x1'));var moment=require(_0xc92b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc92b('0x3'));var db=require(_0xc92b('0x4'))['db'];var utils=require(_0xc92b('0x5'));var logger=require(_0xc92b('0x6'))('rpc');var config=require(_0xc92b('0x7'));var jayson=require(_0xc92b('0x8'));var client=jayson[_0xc92b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ed947,_0x1e2b43,_0x439122){return new BPromise(function(_0x498856,_0x10d280){return client[_0xc92b('0xa')](_0x5ed947,_0x439122)[_0xc92b('0xb')](function(_0x54b0bb){logger[_0xc92b('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x1e2b43,'request\x20sent');logger[_0xc92b('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x1e2b43,_0xc92b('0xe'),JSON[_0xc92b('0xf')](_0x54b0bb));if(_0x54b0bb[_0xc92b('0x10')]){if(_0x54b0bb[_0xc92b('0x10')][_0xc92b('0x11')]===0x1f4){logger[_0xc92b('0x10')](_0xc92b('0x12'),_0x1e2b43,_0x54b0bb[_0xc92b('0x10')][_0xc92b('0x13')]);return _0x10d280(_0x54b0bb[_0xc92b('0x10')][_0xc92b('0x13')]);}logger[_0xc92b('0x10')](_0xc92b('0x12'),_0x1e2b43,_0x54b0bb[_0xc92b('0x10')]['message']);return _0x498856(_0x54b0bb[_0xc92b('0x10')][_0xc92b('0x13')]);}else{logger['info'](_0xc92b('0x12'),_0x1e2b43,_0xc92b('0xe'));_0x498856(_0x54b0bb[_0xc92b('0x14')][_0xc92b('0x13')]);}})[_0xc92b('0x15')](function(_0x38bb69){logger[_0xc92b('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x1e2b43,_0x38bb69);_0x10d280(_0x38bb69);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index db805b9..43d98ef 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 _0x0c12=['delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','join','originalname','replace','%s-%s%s','basename','extname','now','single','create','update'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0c12,0x153));var _0x20c1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0c12[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x20c1('0x0'));var util=require('util');var path=require(_0x20c1('0x1'));var timeout=require(_0x20c1('0x2'));var express=require(_0x20c1('0x3'));var router=express[_0x20c1('0x4')]();var fs_extra=require(_0x20c1('0x5'));var auth=require(_0x20c1('0x6'));var interaction=require(_0x20c1('0x7'));var config=require(_0x20c1('0x8'));var controller=require(_0x20c1('0x9'));router[_0x20c1('0xa')]('/',auth[_0x20c1('0xb')](),controller[_0x20c1('0xc')]);router[_0x20c1('0xa')](_0x20c1('0xd'),auth[_0x20c1('0xb')](),controller[_0x20c1('0xe')]);router['get']('/:id/download',auth[_0x20c1('0xb')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x102e62,_0x26dca6,_0x74f727){_0x74f727(null,path[_0x20c1('0xf')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x2d90fb,_0x4cfcbe,_0x20d18f){_0x4cfcbe[_0x20c1('0x10')]=_0x4cfcbe['originalname'][_0x20c1('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20d18f(null,util['format'](_0x20c1('0x12'),path[_0x20c1('0x13')](_0x4cfcbe[_0x20c1('0x10')],path[_0x20c1('0x14')](_0x4cfcbe[_0x20c1('0x10')])),Date[_0x20c1('0x15')](),path[_0x20c1('0x14')](_0x4cfcbe[_0x20c1('0x10')])));}})});router['post']('/',upload[_0x20c1('0x16')]('file'),controller[_0x20c1('0x17')]);router['put']('/:id',auth[_0x20c1('0xb')](),controller[_0x20c1('0x18')]);router['delete'](_0x20c1('0xd'),auth[_0x20c1('0xb')](),controller[_0x20c1('0x19')]);module['exports']=router; \ No newline at end of file +var _0x8be9=['isAuthenticated','/:id','show','/:id/download','download','root','server/files/sounds/original/','originalname','replace','%s-%s%s','extname','now','post','file','create','put','update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get'];(function(_0x42a105,_0x268e67){var _0x428223=function(_0x5a6a3f){while(--_0x5a6a3f){_0x42a105['push'](_0x42a105['shift']());}};_0x428223(++_0x268e67);}(_0x8be9,0x1b6));var _0x98be=function(_0x374c12,_0x21baf2){_0x374c12=_0x374c12-0x0;var _0x23b010=_0x8be9[_0x374c12];return _0x23b010;};'use strict';var multer=require('multer');var util=require(_0x98be('0x0'));var path=require(_0x98be('0x1'));var timeout=require(_0x98be('0x2'));var express=require(_0x98be('0x3'));var router=express['Router']();var fs_extra=require(_0x98be('0x4'));var auth=require(_0x98be('0x5'));var interaction=require(_0x98be('0x6'));var config=require(_0x98be('0x7'));var controller=require(_0x98be('0x8'));router[_0x98be('0x9')]('/',auth[_0x98be('0xa')](),controller['index']);router[_0x98be('0x9')](_0x98be('0xb'),auth[_0x98be('0xa')](),controller[_0x98be('0xc')]);router[_0x98be('0x9')](_0x98be('0xd'),auth[_0x98be('0xa')](),controller[_0x98be('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x270822,_0x47aa16,_0x1bd524){_0x1bd524(null,path['join'](config[_0x98be('0xf')],_0x98be('0x10')));},'filename':function(_0xb922ab,_0xb0f910,_0x5609cc){_0xb0f910['originalname']=_0xb0f910[_0x98be('0x11')][_0x98be('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5609cc(null,util['format'](_0x98be('0x13'),path['basename'](_0xb0f910[_0x98be('0x11')],path[_0x98be('0x14')](_0xb0f910[_0x98be('0x11')])),Date[_0x98be('0x15')](),path[_0x98be('0x14')](_0xb0f910[_0x98be('0x11')])));}})});router[_0x98be('0x16')]('/',upload['single'](_0x98be('0x17')),controller[_0x98be('0x18')]);router[_0x98be('0x19')](_0x98be('0xb'),auth['isAuthenticated'](),controller[_0x98be('0x1a')]);router[_0x98be('0x1b')]('/:id',auth[_0x98be('0xa')](),controller[_0x98be('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 3b9f695..d19c0a2 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 _0x4495=['STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x4495,0xf4));var _0x5449=function(_0x4881f0,_0x44c214){_0x4881f0=_0x4881f0-0x0;var _0x4220ed=_0x4495[_0x4881f0];return _0x4220ed;};'use strict';var Sequelize=require(_0x5449('0x0'));module[_0x5449('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x5449('0x2')]},'display_name':{'type':Sequelize[_0x5449('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x5449('0x2')]},'original_duration':{'type':Sequelize[_0x5449('0x3')]},'original_sampleCount':{'type':Sequelize[_0x5449('0x4')]},'original_channelCount':{'type':Sequelize[_0x5449('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x5449('0x5')]},'converted_format':{'type':Sequelize[_0x5449('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x5449('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x5449('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x761d=['name','FLOAT','BIGINT','INTEGER','exports','STRING'];(function(_0x3b7891,_0x557a09){var _0x1d6669=function(_0x39f8a1){while(--_0x39f8a1){_0x3b7891['push'](_0x3b7891['shift']());}};_0x1d6669(++_0x557a09);}(_0x761d,0x148));var _0xd761=function(_0x82f124,_0x121665){_0x82f124=_0x82f124-0x0;var _0x51209a=_0x761d[_0x82f124];return _0x51209a;};'use strict';var Sequelize=require('sequelize');module[_0xd761('0x0')]={'name':{'type':Sequelize[_0xd761('0x1')],'unique':_0xd761('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd761('0x1')]},'display_name':{'type':Sequelize[_0xd761('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xd761('0x1')]},'original_format':{'type':Sequelize[_0xd761('0x1')]},'original_duration':{'type':Sequelize[_0xd761('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xd761('0x4')]},'original_sampleRate':{'type':Sequelize[_0xd761('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xd761('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xd761('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index e1ee36b..caa951d 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 _0xf635=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','model','query','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','Sound','findAll','rows','params','keys','intersection','include','find','download','converted_format','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','join','format','catch','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','src','original_duration','duration','original_sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','%s.%s','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0xf635,0x15c));var _0x5f63=function(_0x261bbf,_0x567f53){_0x261bbf=_0x261bbf-0x0;var _0x3434e5=_0xf635[_0x261bbf];return _0x3434e5;};'use strict';var emlformat=require(_0x5f63('0x0'));var rimraf=require(_0x5f63('0x1'));var zipdir=require(_0x5f63('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f63('0x3'));var moment=require(_0x5f63('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5f63('0x5'));var path=require(_0x5f63('0x6'));var sox=require(_0x5f63('0x7'));var csv=require(_0x5f63('0x8'));var ejs=require(_0x5f63('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f63('0xa'));var squel=require(_0x5f63('0xb'));var crypto=require(_0x5f63('0xc'));var jsforce=require(_0x5f63('0xd'));var deskjs=require(_0x5f63('0xe'));var toCsv=require(_0x5f63('0x8'));var querystring=require(_0x5f63('0xf'));var Papa=require(_0x5f63('0x10'));var Redis=require(_0x5f63('0x11'));var authService=require(_0x5f63('0x12'));var qs=require(_0x5f63('0x13'));var as=require(_0x5f63('0x14'));var hardwareService=require(_0x5f63('0x15'));var logger=require(_0x5f63('0x16'))('api');var utils=require(_0x5f63('0x17'));var config=require(_0x5f63('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f63('0x19'))['db'];function respondWithStatusCode(_0x2847ee,_0x2f13bf){_0x2f13bf=_0x2f13bf||0xcc;return function(_0x2e7123){if(_0x2e7123){return _0x2847ee[_0x5f63('0x1a')](_0x2f13bf);}return _0x2847ee[_0x5f63('0x1b')](_0x2f13bf)[_0x5f63('0x1c')]();};}function respondWithResult(_0x3f1f09,_0x2490ee){_0x2490ee=_0x2490ee||0xc8;return function(_0x39d6e5){if(_0x39d6e5){return _0x3f1f09[_0x5f63('0x1b')](_0x2490ee)[_0x5f63('0x1d')](_0x39d6e5);}};}function respondWithFilteredResult(_0x1476be,_0x3d94ea){return function(_0x2cf5a6){if(_0x2cf5a6){var _0x25ccfd=typeof _0x3d94ea[_0x5f63('0x1e')]===_0x5f63('0x1f')&&typeof _0x3d94ea[_0x5f63('0x20')]===_0x5f63('0x1f');var _0x2ca579=_0x2cf5a6[_0x5f63('0x21')];var _0x3f2145=_0x25ccfd?0x0:_0x3d94ea[_0x5f63('0x1e')];var _0x5883f4=_0x25ccfd?_0x2cf5a6['count']:_0x3d94ea[_0x5f63('0x1e')]+_0x3d94ea[_0x5f63('0x20')];var _0x21748a;if(_0x5883f4>=_0x2ca579){_0x5883f4=_0x2ca579;_0x21748a=0xc8;}else{_0x21748a=0xce;}_0x1476be[_0x5f63('0x1b')](_0x21748a);return _0x1476be[_0x5f63('0x22')]('Content-Range',_0x3f2145+'-'+_0x5883f4+'/'+_0x2ca579)[_0x5f63('0x1d')](_0x2cf5a6);}return null;};}function patchUpdates(_0x55d52e){return function(_0x436c81){try{jsonpatch[_0x5f63('0x23')](_0x436c81,_0x55d52e,!![]);}catch(_0x1585a0){return BPromise[_0x5f63('0x24')](_0x1585a0);}return _0x436c81['save']();};}function saveUpdates(_0x1419b4,_0x55a4ef){return function(_0x3fc1b7){if(_0x3fc1b7){return _0x3fc1b7['update'](_0x1419b4)[_0x5f63('0x25')](function(_0x906fbc){return _0x906fbc;});}return null;};}function removeEntity(_0x336bfe,_0x111788){return function(_0x360846){if(_0x360846){return _0x360846[_0x5f63('0x26')]()[_0x5f63('0x25')](function(){var _0x2da191=_0x360846[_0x5f63('0x27')]({'plain':!![]});var _0x5ff077=_0x5f63('0x28');return db[_0x5f63('0x29')][_0x5f63('0x26')]({'where':{'type':_0x5ff077,'resourceId':_0x2da191['id']}})[_0x5f63('0x25')](function(){return _0x360846;});})['then'](function(){_0x336bfe[_0x5f63('0x1b')](0xcc)[_0x5f63('0x1c')]();});}};}function handleEntityNotFound(_0x2b1bf6,_0x27d305){return function(_0x37ca61){if(!_0x37ca61){_0x2b1bf6[_0x5f63('0x1a')](0x194);}return _0x37ca61;};}function handleError(_0x7ee6fa,_0x5cb57e){_0x5cb57e=_0x5cb57e||0x1f4;return function(_0x3ab2a8){logger[_0x5f63('0x2a')](_0x3ab2a8[_0x5f63('0x2b')]);if(_0x3ab2a8['name']){delete _0x3ab2a8[_0x5f63('0x2c')];}_0x7ee6fa[_0x5f63('0x1b')](_0x5cb57e)[_0x5f63('0x2d')](_0x3ab2a8);};}exports[_0x5f63('0x2e')]=function(_0x2939c1,_0x58a7aa){var _0x32308a={},_0xb0928e={},_0x281de8={'count':0x0,'rows':[]};var _0x4f5fd2=_[_0x5f63('0x2f')](db['Sound']['rawAttributes'],function(_0x2e9c48){return{'name':_0x2e9c48[_0x5f63('0x30')],'type':_0x2e9c48[_0x5f63('0x31')][_0x5f63('0x32')]};});_0xb0928e[_0x5f63('0x33')]=_[_0x5f63('0x2f')](_0x4f5fd2,_0x5f63('0x2c'));_0xb0928e[_0x5f63('0x34')]=_['keys'](_0x2939c1['query']);_0xb0928e['filters']=_['intersection'](_0xb0928e[_0x5f63('0x33')],_0xb0928e[_0x5f63('0x34')]);_0x32308a[_0x5f63('0x35')]=_['intersection'](_0xb0928e[_0x5f63('0x33')],qs['fields'](_0x2939c1[_0x5f63('0x34')][_0x5f63('0x36')]));_0x32308a[_0x5f63('0x35')]=_0x32308a[_0x5f63('0x35')][_0x5f63('0x37')]?_0x32308a[_0x5f63('0x35')]:_0xb0928e[_0x5f63('0x33')];if(!_0x2939c1[_0x5f63('0x34')]['hasOwnProperty'](_0x5f63('0x38'))){_0x32308a['limit']=qs[_0x5f63('0x20')](_0x2939c1[_0x5f63('0x34')][_0x5f63('0x20')]);_0x32308a['offset']=qs[_0x5f63('0x1e')](_0x2939c1['query'][_0x5f63('0x1e')]);}_0x32308a[_0x5f63('0x39')]=qs[_0x5f63('0x3a')](_0x2939c1[_0x5f63('0x34')][_0x5f63('0x3a')]);_0x32308a[_0x5f63('0x3b')]=qs[_0x5f63('0x3c')](_['pick'](_0x2939c1[_0x5f63('0x34')],_0xb0928e[_0x5f63('0x3c')]),_0x4f5fd2);if(_0x2939c1['query'][_0x5f63('0x3d')]){_0x32308a[_0x5f63('0x3b')]=_[_0x5f63('0x3e')](_0x32308a['where'],{'$or':_[_0x5f63('0x2f')](_0x4f5fd2,function(_0x2695ee){if(_0x2695ee[_0x5f63('0x31')]!==_0x5f63('0x3f')){var _0x17c6e3={};_0x17c6e3[_0x2695ee['name']]={'$like':'%'+_0x2939c1[_0x5f63('0x34')][_0x5f63('0x3d')]+'%'};return _0x17c6e3;}})});}_0x32308a=_[_0x5f63('0x3e')]({},_0x32308a,_0x2939c1[_0x5f63('0x40')]);var _0x208d3b={'where':_0x32308a[_0x5f63('0x3b')]};return db['Sound']['count'](_0x208d3b)[_0x5f63('0x25')](function(_0x5d54d4){_0x281de8[_0x5f63('0x21')]=_0x5d54d4;if(_0x2939c1[_0x5f63('0x34')][_0x5f63('0x41')]){_0x32308a['include']=[{'all':!![]}];}return db[_0x5f63('0x42')][_0x5f63('0x43')](_0x32308a);})[_0x5f63('0x25')](function(_0x55dfc6){_0x281de8[_0x5f63('0x44')]=_0x55dfc6;return _0x281de8;})['then'](respondWithFilteredResult(_0x58a7aa,_0x32308a))['catch'](handleError(_0x58a7aa,null));};exports['show']=function(_0x1ca923,_0x89e91e){var _0x5d74a5={'raw':!![],'where':{'id':_0x1ca923[_0x5f63('0x45')]['id']}},_0x5a2b40={};_0x5a2b40['model']=_[_0x5f63('0x46')](db[_0x5f63('0x42')]['rawAttributes']);_0x5a2b40['query']=_[_0x5f63('0x46')](_0x1ca923[_0x5f63('0x34')]);_0x5a2b40[_0x5f63('0x3c')]=_[_0x5f63('0x47')](_0x5a2b40[_0x5f63('0x33')],_0x5a2b40['query']);_0x5d74a5[_0x5f63('0x35')]=_[_0x5f63('0x47')](_0x5a2b40['model'],qs[_0x5f63('0x36')](_0x1ca923[_0x5f63('0x34')]['fields']));_0x5d74a5['attributes']=_0x5d74a5[_0x5f63('0x35')][_0x5f63('0x37')]?_0x5d74a5['attributes']:_0x5a2b40[_0x5f63('0x33')];if(_0x1ca923[_0x5f63('0x34')][_0x5f63('0x41')]){_0x5d74a5[_0x5f63('0x48')]=[{'all':!![]}];}_0x5d74a5=_[_0x5f63('0x3e')]({},_0x5d74a5,_0x1ca923[_0x5f63('0x40')]);return db[_0x5f63('0x42')][_0x5f63('0x49')](_0x5d74a5)[_0x5f63('0x25')](handleEntityNotFound(_0x89e91e,null))[_0x5f63('0x25')](respondWithResult(_0x89e91e,null))['catch'](handleError(_0x89e91e,null));};exports[_0x5f63('0x4a')]=function(_0x11eb80,_0x3cb831,_0x108d66){return db['Sound'][_0x5f63('0x49')]({'where':{'id':_0x11eb80[_0x5f63('0x45')]['id']},'attributes':[_0x5f63('0x2c'),'save_name',_0x5f63('0x4b')],'raw':!![]})[_0x5f63('0x25')](handleEntityNotFound(_0x3cb831,null))[_0x5f63('0x25')](function(_0x4ba866){if(_0x4ba866){if(!fs['existsSync'](path['join'](config[_0x5f63('0x4c')],_0x5f63('0x4d'),_0x4ba866[_0x5f63('0x4e')]+'.'+_0x4ba866['converted_format']))){throw new db[(_0x5f63('0x4f'))][(_0x5f63('0x50'))](_0x5f63('0x51'));}return _0x3cb831['download'](path[_0x5f63('0x52')](config[_0x5f63('0x4c')],_0x5f63('0x4d'),util[_0x5f63('0x53')]('%s.%s',_0x4ba866[_0x5f63('0x4e')],_0x4ba866[_0x5f63('0x4b')])),util['format']('%s.%s',_0x4ba866['name'],_0x4ba866[_0x5f63('0x4b')]));}return null;})[_0x5f63('0x54')](handleError(_0x3cb831,null));};exports['create']=function(_0x32a948,_0x3826e9,_0x4694c8){var _0x1de006={'name':path[_0x5f63('0x55')](_0x32a948[_0x5f63('0x56')][_0x5f63('0x57')],path[_0x5f63('0x58')](_0x32a948[_0x5f63('0x56')][_0x5f63('0x57')])),'save_name':path[_0x5f63('0x55')](_0x32a948[_0x5f63('0x56')][_0x5f63('0x59')],path['extname'](_0x32a948[_0x5f63('0x56')][_0x5f63('0x59')])),'original_format':path[_0x5f63('0x58')](_0x32a948[_0x5f63('0x56')][_0x5f63('0x57')])['substring'](0x1),'converted_format':_0x5f63('0x5a')};var _0x1d4446=path[_0x5f63('0x52')](config[_0x5f63('0x4c')],_0x5f63('0x5b'),_0x32a948[_0x5f63('0x56')][_0x5f63('0x59')]);var _0x4e68bb=path[_0x5f63('0x52')](config['root'],_0x5f63('0x4d'),util[_0x5f63('0x53')]('%s.%s',path[_0x5f63('0x55')](_0x32a948[_0x5f63('0x56')][_0x5f63('0x59')],path[_0x5f63('0x58')](_0x32a948['file'][_0x5f63('0x59')])),_0x1de006[_0x5f63('0x4b')]));logger[_0x5f63('0x5c')](_0x5f63('0x5d'),_0x1d4446);logger[_0x5f63('0x5c')](_0x5f63('0x5e'),_0x4e68bb);try{fs[_0x5f63('0x5f')](_0x1d4446,parseInt('0777',0x8));var _0x3b073d=sox[_0x5f63('0x60')](_0x1d4446,_0x4e68bb,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3b073d['on'](_0x5f63('0x2a'),function(_0x37d439){fs['unlinkSync'](_0x1d4446);_0x3826e9[_0x5f63('0x1b')](0x1f4)[_0x5f63('0x2d')](_0x37d439);});_0x3b073d['on'](_0x5f63('0x61'),function(_0xc3bf72){_0x1de006[_0x5f63('0x62')]=isNaN(_0xc3bf72[_0x5f63('0x63')])?null:_0xc3bf72[_0x5f63('0x63')]*0x3e8;_0x1de006[_0x5f63('0x64')]=isNaN(_0xc3bf72['sampleCount'])?null:_0xc3bf72['sampleCount'];_0x1de006[_0x5f63('0x65')]=isNaN(_0xc3bf72[_0x5f63('0x66')])?null:_0xc3bf72[_0x5f63('0x66')];_0x1de006[_0x5f63('0x67')]=isNaN(_0xc3bf72[_0x5f63('0x68')])?null:_0xc3bf72[_0x5f63('0x68')];_0x1de006['original_sampleRate']=isNaN(_0xc3bf72[_0x5f63('0x69')])?null:_0xc3bf72['sampleRate'];});_0x3b073d['on']('dest',function(_0x3cacf2){_0x1de006['converted_duration']=isNaN(_0x3cacf2[_0x5f63('0x63')])?null:_0x3cacf2['duration']*0x3e8;_0x1de006['converted_sampleCount']=isNaN(_0x3cacf2[_0x5f63('0x6a')])?null:_0x3cacf2[_0x5f63('0x6a')];_0x1de006[_0x5f63('0x6b')]=isNaN(_0x3cacf2[_0x5f63('0x66')])?null:_0x3cacf2[_0x5f63('0x66')];_0x1de006[_0x5f63('0x6c')]=isNaN(_0x3cacf2['bitRate'])?null:_0x3cacf2['bitRate'];_0x1de006[_0x5f63('0x6d')]=isNaN(_0x3cacf2['sampleRate'])?null:_0x3cacf2[_0x5f63('0x69')];});_0x3b073d['on'](_0x5f63('0x1c'),function(){fs[_0x5f63('0x5f')](_0x4e68bb,parseInt('0777',0x8));return db[_0x5f63('0x42')][_0x5f63('0x6e')](_0x1de006)[_0x5f63('0x25')](function(_0x1b9190){var _0x3fcfe4={'role':_0x32a948[_0x5f63('0x6f')]['role'],'userProfileId':_0x32a948[_0x5f63('0x6f')][_0x5f63('0x70')]};if(!_0x3fcfe4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fcfe4[_0x5f63('0x71')]==='user'){var _0x4412e5=_0x1b9190['get']({'plain':!![]});return db[_0x5f63('0x72')][_0x5f63('0x49')]({'where':{'name':_0x5f63('0x28'),'userProfileId':_0x3fcfe4[_0x5f63('0x70')]},'raw':!![]})[_0x5f63('0x25')](function(_0x217c99){if(_0x217c99&&_0x217c99[_0x5f63('0x73')]===0x0){return db[_0x5f63('0x29')]['create']({'name':_0x4412e5[_0x5f63('0x2c')],'resourceId':_0x4412e5['id'],'type':_0x217c99[_0x5f63('0x2c')],'sectionId':_0x217c99['id']},{})['then'](function(){return _0x1b9190;});}else{return _0x1b9190;}})['catch'](function(_0x6030ee){logger[_0x5f63('0x2a')](_0x5f63('0x74'),_0x6030ee);throw _0x6030ee;});}return _0x1b9190;})['then'](respondWithResult(_0x3826e9,null))['catch'](handleError(_0x3826e9,null));});_0x3b073d[_0x5f63('0x75')]();}catch(_0x513c23){_0x3826e9[_0x5f63('0x1b')](0x1f4)['send'](_0x513c23);}};exports['update']=function(_0x495a06,_0x5f470a,_0x190d73){return db[_0x5f63('0x42')]['find']({'where':{'id':_0x495a06[_0x5f63('0x45')]['id']}})['then'](handleEntityNotFound(_0x5f470a,null))['then'](saveUpdates(_[_0x5f63('0x76')](_0x495a06[_0x5f63('0x6f')],[_0x5f63('0x2c'),_0x5f63('0x77')]),null))[_0x5f63('0x25')](respondWithResult(_0x5f470a,null))['catch'](handleError(_0x5f470a,null));};exports['delete']=function(_0x3fb0a7,_0xd15c21,_0x4116a7){return db[_0x5f63('0x42')]['find']({'where':{'id':_0x3fb0a7[_0x5f63('0x45')]['id']}})[_0x5f63('0x25')](function(_0x1468d9){if(_0x1468d9){return _0x1468d9[_0x5f63('0x26')]();}})['then'](function(_0x544718){var _0x6c4251=path[_0x5f63('0x52')](config[_0x5f63('0x4c')],_0x5f63('0x5b'),util['format'](_0x5f63('0x78'),_0x544718[_0x5f63('0x4e')],_0x544718['original_format']));var _0x49ab74=path[_0x5f63('0x52')](config['root'],_0x5f63('0x4d'),util[_0x5f63('0x53')](_0x5f63('0x78'),_0x544718[_0x5f63('0x4e')],_0x544718[_0x5f63('0x4b')]));fs[_0x5f63('0x79')](_0x6c4251);fs[_0x5f63('0x79')](_0x49ab74);return _0x544718;})[_0x5f63('0x25')](function(_0x1fd1e0){if(_0x1fd1e0){return _0xd15c21['status'](0xcc)[_0x5f63('0x1c')]();}})[_0x5f63('0x25')](handleEntityNotFound(_0xd15c21,null))[_0x5f63('0x54')](handleError(_0xd15c21,null));}; \ No newline at end of file +var _0x3e57=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','model','query','attributes','intersection','fields','length','hasOwnProperty','limit','where','filters','merge','type','VIRTUAL','options','includeAll','include','catch','params','keys','rawAttributes','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','format','%s.%s','create','file','extname','originalname','basename','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x3e57,0x83));var _0x73e5=function(_0x46d87a,_0x5183db){_0x46d87a=_0x46d87a-0x0;var _0x115296=_0x3e57[_0x46d87a];return _0x115296;};'use strict';var emlformat=require(_0x73e5('0x0'));var rimraf=require(_0x73e5('0x1'));var zipdir=require(_0x73e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73e5('0x3'));var moment=require(_0x73e5('0x4'));var BPromise=require(_0x73e5('0x5'));var Mustache=require(_0x73e5('0x6'));var util=require(_0x73e5('0x7'));var path=require('path');var sox=require(_0x73e5('0x8'));var csv=require(_0x73e5('0x9'));var ejs=require(_0x73e5('0xa'));var fs=require('fs');var fs_extra=require(_0x73e5('0xb'));var _=require(_0x73e5('0xc'));var squel=require('squel');var crypto=require(_0x73e5('0xd'));var jsforce=require(_0x73e5('0xe'));var deskjs=require(_0x73e5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x73e5('0x10'));var Papa=require(_0x73e5('0x11'));var Redis=require(_0x73e5('0x12'));var authService=require(_0x73e5('0x13'));var qs=require(_0x73e5('0x14'));var as=require(_0x73e5('0x15'));var hardwareService=require(_0x73e5('0x16'));var logger=require(_0x73e5('0x17'))(_0x73e5('0x18'));var utils=require(_0x73e5('0x19'));var config=require(_0x73e5('0x1a'));var licenseUtil=require(_0x73e5('0x1b'));var db=require(_0x73e5('0x1c'))['db'];function respondWithStatusCode(_0x218d7c,_0x561822){_0x561822=_0x561822||0xcc;return function(_0x4ba74c){if(_0x4ba74c){return _0x218d7c[_0x73e5('0x1d')](_0x561822);}return _0x218d7c[_0x73e5('0x1e')](_0x561822)[_0x73e5('0x1f')]();};}function respondWithResult(_0x27ff1a,_0xe2ea41){_0xe2ea41=_0xe2ea41||0xc8;return function(_0x2378ce){if(_0x2378ce){return _0x27ff1a[_0x73e5('0x1e')](_0xe2ea41)[_0x73e5('0x20')](_0x2378ce);}};}function respondWithFilteredResult(_0x1f52a1,_0xcdb952){return function(_0x44f1dc){if(_0x44f1dc){var _0x5258a5=typeof _0xcdb952['offset']==='undefined'&&typeof _0xcdb952['limit']===_0x73e5('0x21');var _0x297877=_0x44f1dc[_0x73e5('0x22')];var _0x2bb2b4=_0x5258a5?0x0:_0xcdb952[_0x73e5('0x23')];var _0x16c49d=_0x5258a5?_0x44f1dc[_0x73e5('0x22')]:_0xcdb952[_0x73e5('0x23')]+_0xcdb952['limit'];var _0x2ead95;if(_0x16c49d>=_0x297877){_0x16c49d=_0x297877;_0x2ead95=0xc8;}else{_0x2ead95=0xce;}_0x1f52a1['status'](_0x2ead95);return _0x1f52a1[_0x73e5('0x24')](_0x73e5('0x25'),_0x2bb2b4+'-'+_0x16c49d+'/'+_0x297877)[_0x73e5('0x20')](_0x44f1dc);}return null;};}function patchUpdates(_0x2b5364){return function(_0xc08d8b){try{jsonpatch[_0x73e5('0x26')](_0xc08d8b,_0x2b5364,!![]);}catch(_0x217580){return BPromise[_0x73e5('0x27')](_0x217580);}return _0xc08d8b[_0x73e5('0x28')]();};}function saveUpdates(_0xb95ddd,_0x3b5f42){return function(_0x5c8811){if(_0x5c8811){return _0x5c8811[_0x73e5('0x29')](_0xb95ddd)['then'](function(_0x3ee38e){return _0x3ee38e;});}return null;};}function removeEntity(_0x1e9bb2,_0x4a749a){return function(_0x113787){if(_0x113787){return _0x113787[_0x73e5('0x2a')]()[_0x73e5('0x2b')](function(){var _0x4ac339=_0x113787[_0x73e5('0x2c')]({'plain':!![]});var _0x55fd98=_0x73e5('0x2d');return db[_0x73e5('0x2e')][_0x73e5('0x2a')]({'where':{'type':_0x55fd98,'resourceId':_0x4ac339['id']}})[_0x73e5('0x2b')](function(){return _0x113787;});})[_0x73e5('0x2b')](function(){_0x1e9bb2[_0x73e5('0x1e')](0xcc)[_0x73e5('0x1f')]();});}};}function handleEntityNotFound(_0x556601,_0x19be5e){return function(_0x554299){if(!_0x554299){_0x556601[_0x73e5('0x1d')](0x194);}return _0x554299;};}function handleError(_0x411c82,_0x33031f){_0x33031f=_0x33031f||0x1f4;return function(_0x58926){logger[_0x73e5('0x2f')](_0x58926[_0x73e5('0x30')]);if(_0x58926['name']){delete _0x58926[_0x73e5('0x31')];}_0x411c82['status'](_0x33031f)[_0x73e5('0x32')](_0x58926);};}exports[_0x73e5('0x33')]=function(_0x299cfd,_0x1338ac){var _0x5c5af6={},_0x5d3747={},_0x3b9a96={'count':0x0,'rows':[]};var _0xaecf99=_[_0x73e5('0x34')](db[_0x73e5('0x35')]['rawAttributes'],function(_0x555a6c){return{'name':_0x555a6c['fieldName'],'type':_0x555a6c['type']['key']};});_0x5d3747[_0x73e5('0x36')]=_[_0x73e5('0x34')](_0xaecf99,_0x73e5('0x31'));_0x5d3747[_0x73e5('0x37')]=_['keys'](_0x299cfd[_0x73e5('0x37')]);_0x5d3747['filters']=_['intersection'](_0x5d3747[_0x73e5('0x36')],_0x5d3747[_0x73e5('0x37')]);_0x5c5af6[_0x73e5('0x38')]=_[_0x73e5('0x39')](_0x5d3747[_0x73e5('0x36')],qs[_0x73e5('0x3a')](_0x299cfd['query']['fields']));_0x5c5af6[_0x73e5('0x38')]=_0x5c5af6['attributes'][_0x73e5('0x3b')]?_0x5c5af6[_0x73e5('0x38')]:_0x5d3747[_0x73e5('0x36')];if(!_0x299cfd[_0x73e5('0x37')][_0x73e5('0x3c')]('nolimit')){_0x5c5af6['limit']=qs[_0x73e5('0x3d')](_0x299cfd[_0x73e5('0x37')][_0x73e5('0x3d')]);_0x5c5af6[_0x73e5('0x23')]=qs[_0x73e5('0x23')](_0x299cfd[_0x73e5('0x37')][_0x73e5('0x23')]);}_0x5c5af6['order']=qs['sort'](_0x299cfd[_0x73e5('0x37')]['sort']);_0x5c5af6[_0x73e5('0x3e')]=qs['filters'](_['pick'](_0x299cfd[_0x73e5('0x37')],_0x5d3747[_0x73e5('0x3f')]),_0xaecf99);if(_0x299cfd['query']['filter']){_0x5c5af6[_0x73e5('0x3e')]=_[_0x73e5('0x40')](_0x5c5af6['where'],{'$or':_['map'](_0xaecf99,function(_0x8e1d02){if(_0x8e1d02[_0x73e5('0x41')]!==_0x73e5('0x42')){var _0x43d459={};_0x43d459[_0x8e1d02[_0x73e5('0x31')]]={'$like':'%'+_0x299cfd[_0x73e5('0x37')]['filter']+'%'};return _0x43d459;}})});}_0x5c5af6=_[_0x73e5('0x40')]({},_0x5c5af6,_0x299cfd[_0x73e5('0x43')]);var _0x5639a1={'where':_0x5c5af6[_0x73e5('0x3e')]};return db['Sound'][_0x73e5('0x22')](_0x5639a1)[_0x73e5('0x2b')](function(_0xb9ba13){_0x3b9a96[_0x73e5('0x22')]=_0xb9ba13;if(_0x299cfd[_0x73e5('0x37')][_0x73e5('0x44')]){_0x5c5af6[_0x73e5('0x45')]=[{'all':!![]}];}return db[_0x73e5('0x35')]['findAll'](_0x5c5af6);})[_0x73e5('0x2b')](function(_0x41453){_0x3b9a96['rows']=_0x41453;return _0x3b9a96;})[_0x73e5('0x2b')](respondWithFilteredResult(_0x1338ac,_0x5c5af6))[_0x73e5('0x46')](handleError(_0x1338ac,null));};exports['show']=function(_0x15d5c1,_0x1d1362){var _0x44810f={'raw':!![],'where':{'id':_0x15d5c1[_0x73e5('0x47')]['id']}},_0xa31bf6={};_0xa31bf6['model']=_[_0x73e5('0x48')](db[_0x73e5('0x35')][_0x73e5('0x49')]);_0xa31bf6[_0x73e5('0x37')]=_[_0x73e5('0x48')](_0x15d5c1[_0x73e5('0x37')]);_0xa31bf6['filters']=_[_0x73e5('0x39')](_0xa31bf6[_0x73e5('0x36')],_0xa31bf6[_0x73e5('0x37')]);_0x44810f[_0x73e5('0x38')]=_[_0x73e5('0x39')](_0xa31bf6[_0x73e5('0x36')],qs['fields'](_0x15d5c1[_0x73e5('0x37')][_0x73e5('0x3a')]));_0x44810f[_0x73e5('0x38')]=_0x44810f['attributes'][_0x73e5('0x3b')]?_0x44810f['attributes']:_0xa31bf6['model'];if(_0x15d5c1[_0x73e5('0x37')][_0x73e5('0x44')]){_0x44810f['include']=[{'all':!![]}];}_0x44810f=_['merge']({},_0x44810f,_0x15d5c1[_0x73e5('0x43')]);return db[_0x73e5('0x35')][_0x73e5('0x4a')](_0x44810f)['then'](handleEntityNotFound(_0x1d1362,null))[_0x73e5('0x2b')](respondWithResult(_0x1d1362,null))[_0x73e5('0x46')](handleError(_0x1d1362,null));};exports[_0x73e5('0x4b')]=function(_0x7cd9e9,_0x520a69,_0x2efbca){return db[_0x73e5('0x35')][_0x73e5('0x4a')]({'where':{'id':_0x7cd9e9[_0x73e5('0x47')]['id']},'attributes':[_0x73e5('0x31'),_0x73e5('0x4c'),'converted_format'],'raw':!![]})[_0x73e5('0x2b')](handleEntityNotFound(_0x520a69,null))[_0x73e5('0x2b')](function(_0x2a2ae5){if(_0x2a2ae5){if(!fs[_0x73e5('0x4d')](path[_0x73e5('0x4e')](config[_0x73e5('0x4f')],_0x73e5('0x50'),_0x2a2ae5['save_name']+'.'+_0x2a2ae5[_0x73e5('0x51')]))){throw new db['Sequelize'][(_0x73e5('0x52'))](_0x73e5('0x53'));}return _0x520a69['download'](path['join'](config[_0x73e5('0x4f')],_0x73e5('0x50'),util['format']('%s.%s',_0x2a2ae5[_0x73e5('0x4c')],_0x2a2ae5[_0x73e5('0x51')])),util[_0x73e5('0x54')](_0x73e5('0x55'),_0x2a2ae5['name'],_0x2a2ae5['converted_format']));}return null;})[_0x73e5('0x46')](handleError(_0x520a69,null));};exports[_0x73e5('0x56')]=function(_0x3b0b21,_0x178f4d,_0x4d5742){var _0x168ba9={'name':path['basename'](_0x3b0b21[_0x73e5('0x57')]['originalname'],path[_0x73e5('0x58')](_0x3b0b21[_0x73e5('0x57')][_0x73e5('0x59')])),'save_name':path[_0x73e5('0x5a')](_0x3b0b21[_0x73e5('0x57')]['filename'],path[_0x73e5('0x58')](_0x3b0b21[_0x73e5('0x57')][_0x73e5('0x5b')])),'original_format':path[_0x73e5('0x58')](_0x3b0b21[_0x73e5('0x57')][_0x73e5('0x59')])[_0x73e5('0x5c')](0x1),'converted_format':'wav'};var _0x1d8306=path['join'](config[_0x73e5('0x4f')],_0x73e5('0x5d'),_0x3b0b21['file'][_0x73e5('0x5b')]);var _0x4c7584=path[_0x73e5('0x4e')](config[_0x73e5('0x4f')],'server/files/sounds/converted',util[_0x73e5('0x54')](_0x73e5('0x55'),path[_0x73e5('0x5a')](_0x3b0b21['file'][_0x73e5('0x5b')],path[_0x73e5('0x58')](_0x3b0b21['file']['filename'])),_0x168ba9[_0x73e5('0x51')]));logger[_0x73e5('0x5e')](_0x73e5('0x5f'),_0x1d8306);logger[_0x73e5('0x5e')](_0x73e5('0x60'),_0x4c7584);try{fs[_0x73e5('0x61')](_0x1d8306,parseInt(_0x73e5('0x62'),0x8));var _0x352227=sox[_0x73e5('0x63')](_0x1d8306,_0x4c7584,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x352227['on'](_0x73e5('0x2f'),function(_0x20a55b){fs['unlinkSync'](_0x1d8306);_0x178f4d['status'](0x1f4)[_0x73e5('0x32')](_0x20a55b);});_0x352227['on'](_0x73e5('0x64'),function(_0x2c7d4e){_0x168ba9[_0x73e5('0x65')]=isNaN(_0x2c7d4e[_0x73e5('0x66')])?null:_0x2c7d4e[_0x73e5('0x66')]*0x3e8;_0x168ba9[_0x73e5('0x67')]=isNaN(_0x2c7d4e[_0x73e5('0x68')])?null:_0x2c7d4e['sampleCount'];_0x168ba9[_0x73e5('0x69')]=isNaN(_0x2c7d4e[_0x73e5('0x6a')])?null:_0x2c7d4e[_0x73e5('0x6a')];_0x168ba9[_0x73e5('0x6b')]=isNaN(_0x2c7d4e[_0x73e5('0x6c')])?null:_0x2c7d4e[_0x73e5('0x6c')];_0x168ba9['original_sampleRate']=isNaN(_0x2c7d4e['sampleRate'])?null:_0x2c7d4e[_0x73e5('0x6d')];});_0x352227['on'](_0x73e5('0x6e'),function(_0x4699e2){_0x168ba9[_0x73e5('0x6f')]=isNaN(_0x4699e2[_0x73e5('0x66')])?null:_0x4699e2[_0x73e5('0x66')]*0x3e8;_0x168ba9[_0x73e5('0x70')]=isNaN(_0x4699e2['sampleCount'])?null:_0x4699e2[_0x73e5('0x68')];_0x168ba9[_0x73e5('0x71')]=isNaN(_0x4699e2[_0x73e5('0x6a')])?null:_0x4699e2[_0x73e5('0x6a')];_0x168ba9[_0x73e5('0x72')]=isNaN(_0x4699e2['bitRate'])?null:_0x4699e2[_0x73e5('0x6c')];_0x168ba9[_0x73e5('0x73')]=isNaN(_0x4699e2[_0x73e5('0x6d')])?null:_0x4699e2[_0x73e5('0x6d')];});_0x352227['on'](_0x73e5('0x1f'),function(){fs[_0x73e5('0x61')](_0x4c7584,parseInt(_0x73e5('0x62'),0x8));return db[_0x73e5('0x35')][_0x73e5('0x56')](_0x168ba9)[_0x73e5('0x2b')](function(_0x572b74){var _0x2602ef={'role':_0x3b0b21[_0x73e5('0x74')]['role'],'userProfileId':_0x3b0b21[_0x73e5('0x74')][_0x73e5('0x75')]};if(!_0x2602ef)throw new Error(_0x73e5('0x76'));if(_0x2602ef[_0x73e5('0x77')]===_0x73e5('0x78')){var _0x293ab1=_0x572b74[_0x73e5('0x2c')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Sounds','userProfileId':_0x2602ef[_0x73e5('0x75')]},'raw':!![]})['then'](function(_0x10f0b7){if(_0x10f0b7&&_0x10f0b7['autoAssociation']===0x0){return db[_0x73e5('0x2e')][_0x73e5('0x56')]({'name':_0x293ab1[_0x73e5('0x31')],'resourceId':_0x293ab1['id'],'type':_0x10f0b7['name'],'sectionId':_0x10f0b7['id']},{})['then'](function(){return _0x572b74;});}else{return _0x572b74;}})['catch'](function(_0x574aef){logger[_0x73e5('0x2f')](_0x73e5('0x79'),_0x574aef);throw _0x574aef;});}return _0x572b74;})[_0x73e5('0x2b')](respondWithResult(_0x178f4d,null))[_0x73e5('0x46')](handleError(_0x178f4d,null));});_0x352227[_0x73e5('0x7a')]();}catch(_0x165b73){_0x178f4d[_0x73e5('0x1e')](0x1f4)['send'](_0x165b73);}};exports[_0x73e5('0x29')]=function(_0x1629ab,_0x13da4b,_0x49053a){return db['Sound']['find']({'where':{'id':_0x1629ab[_0x73e5('0x47')]['id']}})[_0x73e5('0x2b')](handleEntityNotFound(_0x13da4b,null))[_0x73e5('0x2b')](saveUpdates(_[_0x73e5('0x7b')](_0x1629ab[_0x73e5('0x74')],[_0x73e5('0x31'),_0x73e5('0x7c')]),null))[_0x73e5('0x2b')](respondWithResult(_0x13da4b,null))[_0x73e5('0x46')](handleError(_0x13da4b,null));};exports['delete']=function(_0x359271,_0x1efce5,_0x1e935e){return db['Sound'][_0x73e5('0x4a')]({'where':{'id':_0x359271[_0x73e5('0x47')]['id']}})[_0x73e5('0x2b')](function(_0x53e2e0){if(_0x53e2e0){return _0x53e2e0['destroy']();}})[_0x73e5('0x2b')](function(_0x49e9f6){var _0x9dca56=path['join'](config[_0x73e5('0x4f')],_0x73e5('0x5d'),util[_0x73e5('0x54')](_0x73e5('0x55'),_0x49e9f6['save_name'],_0x49e9f6[_0x73e5('0x7d')]));var _0x54bebf=path[_0x73e5('0x4e')](config['root'],_0x73e5('0x50'),util['format'](_0x73e5('0x55'),_0x49e9f6['save_name'],_0x49e9f6[_0x73e5('0x51')]));fs['unlinkSync'](_0x9dca56);fs['unlinkSync'](_0x54bebf);return _0x49e9f6;})['then'](function(_0x12c561){if(_0x12c561){return _0x1efce5[_0x73e5('0x1e')](0xcc)[_0x73e5('0x1f')]();}})['then'](handleEntityNotFound(_0x1efce5,null))['catch'](handleError(_0x1efce5,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 4894936..3a133ee 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 _0x50f2=['request-promise','path','rimraf','../../config/environment','./sound.attributes','Sound','tools_sounds','lodash','../../config/logger','api','bluebird'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x50f2,0x167));var _0x250f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x50f2[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x250f('0x0'));var util=require('util');var logger=require(_0x250f('0x1'))(_0x250f('0x2'));var moment=require('moment');var BPromise=require(_0x250f('0x3'));var rp=require(_0x250f('0x4'));var fs=require('fs');var path=require(_0x250f('0x5'));var rimraf=require(_0x250f('0x6'));var config=require(_0x250f('0x7'));var attributes=require(_0x250f('0x8'));module['exports']=function(_0x3cb112,_0x4a631e){return _0x3cb112['define'](_0x250f('0x9'),attributes,{'tableName':_0x250f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x132c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x132c,0xa6));var _0xc132=function(_0x3b4882,_0x3e9bba){_0x3b4882=_0x3b4882-0x0;var _0x5499a9=_0x132c[_0x3b4882];return _0x5499a9;};'use strict';var _=require('lodash');var util=require(_0xc132('0x0'));var logger=require(_0xc132('0x1'))(_0xc132('0x2'));var moment=require(_0xc132('0x3'));var BPromise=require(_0xc132('0x4'));var rp=require(_0xc132('0x5'));var fs=require('fs');var path=require(_0xc132('0x6'));var rimraf=require(_0xc132('0x7'));var config=require(_0xc132('0x8'));var attributes=require(_0xc132('0x9'));module[_0xc132('0xa')]=function(_0x5c709b,_0x1a8988){return _0x5c709b[_0xc132('0xb')](_0xc132('0xc'),attributes,{'tableName':_0xc132('0xd'),'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 3aa8bc0..a24a123 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 _0x74ac=['where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowSound','Sound','find','options','raw'];(function(_0x4a4f46,_0xe93bad){var _0x5aaece=function(_0x30d23f){while(--_0x30d23f){_0x4a4f46['push'](_0x4a4f46['shift']());}};_0x5aaece(++_0xe93bad);}(_0x74ac,0x185));var _0xc74a=function(_0x1cc34f,_0x27dbf2){_0x1cc34f=_0x1cc34f-0x0;var _0x333522=_0x74ac[_0x1cc34f];return _0x333522;};'use strict';var _=require(_0xc74a('0x0'));var util=require(_0xc74a('0x1'));var moment=require(_0xc74a('0x2'));var BPromise=require(_0xc74a('0x3'));var rs=require(_0xc74a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc74a('0x5'));var logger=require(_0xc74a('0x6'))('rpc');var config=require(_0xc74a('0x7'));var jayson=require(_0xc74a('0x8'));var client=jayson[_0xc74a('0x9')][_0xc74a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xec4605,_0x5885f6,_0x33fcea){return new BPromise(function(_0x5c8e55,_0x7bb57c){return client[_0xc74a('0xb')](_0xec4605,_0x33fcea)[_0xc74a('0xc')](function(_0x9e0fe9){logger[_0xc74a('0xd')](_0xc74a('0xe'),_0x5885f6,_0xc74a('0xf'));logger[_0xc74a('0x10')]('Sound,\x20%s,\x20%s,\x20%s',_0x5885f6,'request\x20sent',JSON['stringify'](_0x9e0fe9));if(_0x9e0fe9[_0xc74a('0x11')]){if(_0x9e0fe9[_0xc74a('0x11')][_0xc74a('0x12')]===0x1f4){logger[_0xc74a('0x11')](_0xc74a('0xe'),_0x5885f6,_0x9e0fe9[_0xc74a('0x11')]['message']);return _0x7bb57c(_0x9e0fe9[_0xc74a('0x11')]['message']);}logger[_0xc74a('0x11')]('Sound,\x20%s,\x20%s',_0x5885f6,_0x9e0fe9[_0xc74a('0x11')][_0xc74a('0x13')]);return _0x5c8e55(_0x9e0fe9[_0xc74a('0x11')]['message']);}else{logger['info']('Sound,\x20%s,\x20%s',_0x5885f6,'request\x20sent');_0x5c8e55(_0x9e0fe9[_0xc74a('0x14')]['message']);}})[_0xc74a('0x15')](function(_0x1c8eb0){logger[_0xc74a('0x11')](_0xc74a('0xe'),_0x5885f6,_0x1c8eb0);_0x7bb57c(_0x1c8eb0);});});}exports[_0xc74a('0x16')]=function(_0x1e2e2b){var _0x4d9937=this;return new Promise(function(_0x4c33b7,_0x55fa82){return db[_0xc74a('0x17')][_0xc74a('0x18')]({'raw':_0x1e2e2b[_0xc74a('0x19')]?_0x1e2e2b[_0xc74a('0x19')][_0xc74a('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e2e2b[_0xc74a('0x19')]?_0x1e2e2b['options'][_0xc74a('0x1b')]||null:null,'attributes':_0x1e2e2b[_0xc74a('0x19')]?_0x1e2e2b[_0xc74a('0x19')]['attributes']||null:null,'include':_0x1e2e2b[_0xc74a('0x19')]?_0x1e2e2b[_0xc74a('0x19')][_0xc74a('0x1c')]?_[_0xc74a('0x1d')](_0x1e2e2b['options'][_0xc74a('0x1c')],function(_0x118026){return{'model':db[_0x118026[_0xc74a('0x1e')]],'as':_0x118026['as'],'attributes':_0x118026[_0xc74a('0x1f')],'include':_0x118026[_0xc74a('0x1c')]?_[_0xc74a('0x1d')](_0x118026[_0xc74a('0x1c')],function(_0x1e834d){return{'model':db[_0x1e834d[_0xc74a('0x1e')]],'as':_0x1e834d['as'],'attributes':_0x1e834d['attributes'],'include':_0x1e834d['include']?_[_0xc74a('0x1d')](_0x1e834d[_0xc74a('0x1c')],function(_0x5eb945){return{'model':db[_0x5eb945[_0xc74a('0x1e')]],'as':_0x5eb945['as'],'attributes':_0x5eb945[_0xc74a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc74a('0xc')](function(_0x25df91){logger['info'](_0xc74a('0x16'),_0x1e2e2b);logger[_0xc74a('0x10')](_0xc74a('0x16'),_0x1e2e2b,JSON['stringify'](_0x25df91));_0x4c33b7(_0x25df91);})[_0xc74a('0x15')](function(_0x419cc2){logger[_0xc74a('0x11')](_0xc74a('0x16'),_0x419cc2[_0xc74a('0x13')],_0x1e2e2b);_0x55fa82(_0x4d9937[_0xc74a('0x11')](0x1f4,_0x419cc2[_0xc74a('0x13')]));});});}; \ No newline at end of file +var _0x3454=['http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x47c9b1,_0x119667){var _0x314445=function(_0x547906){while(--_0x547906){_0x47c9b1['push'](_0x47c9b1['shift']());}};_0x314445(++_0x119667);}(_0x3454,0x13f));var _0x4345=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3454[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4345('0x0'));var util=require('util');var moment=require(_0x4345('0x1'));var BPromise=require(_0x4345('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4345('0x3'));var db=require(_0x4345('0x4'))['db'];var utils=require(_0x4345('0x5'));var logger=require(_0x4345('0x6'))(_0x4345('0x7'));var config=require(_0x4345('0x8'));var jayson=require(_0x4345('0x9'));var client=jayson[_0x4345('0xa')][_0x4345('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d2a98,_0x4f0a20,_0x5d9e5c){return new BPromise(function(_0x3fd9f6,_0x24aa55){return client[_0x4345('0xc')](_0x4d2a98,_0x5d9e5c)[_0x4345('0xd')](function(_0x52d103){logger[_0x4345('0xe')](_0x4345('0xf'),_0x4f0a20,_0x4345('0x10'));logger['debug'](_0x4345('0x11'),_0x4f0a20,_0x4345('0x10'),JSON[_0x4345('0x12')](_0x52d103));if(_0x52d103[_0x4345('0x13')]){if(_0x52d103[_0x4345('0x13')][_0x4345('0x14')]===0x1f4){logger[_0x4345('0x13')](_0x4345('0xf'),_0x4f0a20,_0x52d103[_0x4345('0x13')][_0x4345('0x15')]);return _0x24aa55(_0x52d103[_0x4345('0x13')][_0x4345('0x15')]);}logger[_0x4345('0x13')](_0x4345('0xf'),_0x4f0a20,_0x52d103[_0x4345('0x13')]['message']);return _0x3fd9f6(_0x52d103['error']['message']);}else{logger[_0x4345('0xe')]('Sound,\x20%s,\x20%s',_0x4f0a20,'request\x20sent');_0x3fd9f6(_0x52d103[_0x4345('0x16')][_0x4345('0x15')]);}})[_0x4345('0x17')](function(_0x159b2d){logger[_0x4345('0x13')](_0x4345('0xf'),_0x4f0a20,_0x159b2d);_0x24aa55(_0x159b2d);});});}exports[_0x4345('0x18')]=function(_0x461d19){var _0x25c2f8=this;return new Promise(function(_0x5ef90d,_0x69d863){return db[_0x4345('0x19')]['find']({'raw':_0x461d19[_0x4345('0x1a')]?_0x461d19['options'][_0x4345('0x1b')]===undefined?!![]:![]:!![],'where':_0x461d19[_0x4345('0x1a')]?_0x461d19[_0x4345('0x1a')][_0x4345('0x1c')]||null:null,'attributes':_0x461d19['options']?_0x461d19[_0x4345('0x1a')][_0x4345('0x1d')]||null:null,'include':_0x461d19[_0x4345('0x1a')]?_0x461d19[_0x4345('0x1a')][_0x4345('0x1e')]?_[_0x4345('0x1f')](_0x461d19[_0x4345('0x1a')]['include'],function(_0xebcb96){return{'model':db[_0xebcb96[_0x4345('0x20')]],'as':_0xebcb96['as'],'attributes':_0xebcb96['attributes'],'include':_0xebcb96['include']?_[_0x4345('0x1f')](_0xebcb96[_0x4345('0x1e')],function(_0x482738){return{'model':db[_0x482738[_0x4345('0x20')]],'as':_0x482738['as'],'attributes':_0x482738[_0x4345('0x1d')],'include':_0x482738[_0x4345('0x1e')]?_[_0x4345('0x1f')](_0x482738[_0x4345('0x1e')],function(_0x3fff2e){return{'model':db[_0x3fff2e[_0x4345('0x20')]],'as':_0x3fff2e['as'],'attributes':_0x3fff2e[_0x4345('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4345('0xd')](function(_0x394b8c){logger[_0x4345('0xe')](_0x4345('0x18'),_0x461d19);logger['debug'](_0x4345('0x18'),_0x461d19,JSON[_0x4345('0x12')](_0x394b8c));_0x5ef90d(_0x394b8c);})['catch'](function(_0x208340){logger[_0x4345('0x13')](_0x4345('0x18'),_0x208340[_0x4345('0x15')],_0x461d19);_0x69d863(_0x25c2f8[_0x4345('0x13')](0x1f4,_0x208340['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index b4a2dcd..cd3b231 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 _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1ed010,_0x734e0b){_0x1ed010=_0x1ed010-0x0;var _0x6e22bf=_0x0b0e[_0x1ed010];return _0x6e22bf;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('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(_0x5c1c68,_0x4e17ed){var _0x33d4e0=function(_0xb22944){while(--_0xb22944){_0x5c1c68['push'](_0x5c1c68['shift']());}};_0x33d4e0(++_0x4e17ed);}(_0x14a0,0x8e));var _0x014a=function(_0x3d501a,_0x16323b){_0x3d501a=_0x3d501a-0x0;var _0x4a822e=_0x14a0[_0x3d501a];return _0x4a822e;};'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 32d8181..077ac1a 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 _0x32b6=['ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x32b6,0x1e8));var _0x632b=function(_0x8b1c68,_0x194a8f){_0x8b1c68=_0x8b1c68-0x0;var _0xff63e=_0x32b6[_0x8b1c68];return _0xff63e;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'uniqueid':{'type':Sequelize[_0x632b('0x2')]},'body':{'type':Sequelize[_0x632b('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x632b('0x4')]('in',_0x632b('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x632b('0x2')]},'providerResponse':{'type':Sequelize[_0x632b('0x3')]}}; \ No newline at end of file +var _0x3041=['STRING','TEXT','out','sequelize','exports'];(function(_0x1d6b01,_0x43a6e6){var _0x48ddcf=function(_0x2d9e0e){while(--_0x2d9e0e){_0x1d6b01['push'](_0x1d6b01['shift']());}};_0x48ddcf(++_0x43a6e6);}(_0x3041,0x19d));var _0x1304=function(_0x4f3dee,_0x46bb90){_0x4f3dee=_0x4f3dee-0x0;var _0x291aad=_0x3041[_0x4f3dee];return _0x291aad;};'use strict';var Sequelize=require(_0x1304('0x0'));module[_0x1304('0x1')]={'uniqueid':{'type':Sequelize[_0x1304('0x2')]},'body':{'type':Sequelize[_0x1304('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1304('0x4')),'defaultValue':_0x1304('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x1304('0x2')]},'providerResponse':{'type':Sequelize[_0x1304('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 35afce9..5dd6d87 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 _0xb36b=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','SquareMessage','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','name','index','rawAttributes','fieldName','type','key','map','query','intersection','model'];(function(_0x220f80,_0x3ae3ca){var _0x543748=function(_0x5248a3){while(--_0x5248a3){_0x220f80['push'](_0x220f80['shift']());}};_0x543748(++_0x3ae3ca);}(_0xb36b,0xac));var _0xbb36=function(_0x33b63a,_0x4572fc){_0x33b63a=_0x33b63a-0x0;var _0x44678e=_0xb36b[_0x33b63a];return _0x44678e;};'use strict';var emlformat=require(_0xbb36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb36('0x1'));var jsonpatch=require(_0xbb36('0x2'));var rp=require(_0xbb36('0x3'));var moment=require(_0xbb36('0x4'));var BPromise=require(_0xbb36('0x5'));var Mustache=require('mustache');var util=require(_0xbb36('0x6'));var path=require(_0xbb36('0x7'));var sox=require(_0xbb36('0x8'));var csv=require(_0xbb36('0x9'));var ejs=require(_0xbb36('0xa'));var fs=require('fs');var fs_extra=require(_0xbb36('0xb'));var _=require(_0xbb36('0xc'));var squel=require(_0xbb36('0xd'));var crypto=require(_0xbb36('0xe'));var jsforce=require(_0xbb36('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbb36('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbb36('0x11'));var qs=require(_0xbb36('0x12'));var as=require(_0xbb36('0x13'));var hardwareService=require(_0xbb36('0x14'));var logger=require(_0xbb36('0x15'))('api');var utils=require(_0xbb36('0x16'));var config=require(_0xbb36('0x17'));var licenseUtil=require(_0xbb36('0x18'));var db=require(_0xbb36('0x19'))['db'];function respondWithStatusCode(_0x55d7ba,_0x248529){_0x248529=_0x248529||0xcc;return function(_0x119403){if(_0x119403){return _0x55d7ba[_0xbb36('0x1a')](_0x248529);}return _0x55d7ba[_0xbb36('0x1b')](_0x248529)[_0xbb36('0x1c')]();};}function respondWithResult(_0x326c44,_0x3e8ceb){_0x3e8ceb=_0x3e8ceb||0xc8;return function(_0x8811d8){if(_0x8811d8){return _0x326c44[_0xbb36('0x1b')](_0x3e8ceb)[_0xbb36('0x1d')](_0x8811d8);}};}function respondWithFilteredResult(_0x8325a8,_0x4d022e){return function(_0x595c49){if(_0x595c49){var _0x3c5820=typeof _0x4d022e[_0xbb36('0x1e')]===_0xbb36('0x1f')&&typeof _0x4d022e[_0xbb36('0x20')]===_0xbb36('0x1f');var _0x18af40=_0x595c49[_0xbb36('0x21')];var _0x15c49a=_0x3c5820?0x0:_0x4d022e[_0xbb36('0x1e')];var _0x519a97=_0x3c5820?_0x595c49['count']:_0x4d022e[_0xbb36('0x1e')]+_0x4d022e[_0xbb36('0x20')];var _0x156918;if(_0x519a97>=_0x18af40){_0x519a97=_0x18af40;_0x156918=0xc8;}else{_0x156918=0xce;}_0x8325a8[_0xbb36('0x1b')](_0x156918);return _0x8325a8[_0xbb36('0x22')](_0xbb36('0x23'),_0x15c49a+'-'+_0x519a97+'/'+_0x18af40)[_0xbb36('0x1d')](_0x595c49);}return null;};}function patchUpdates(_0x22d35e){return function(_0x19a820){try{jsonpatch['apply'](_0x19a820,_0x22d35e,!![]);}catch(_0x617822){return BPromise[_0xbb36('0x24')](_0x617822);}return _0x19a820['save']();};}function saveUpdates(_0x2c92d2,_0x3b7358){return function(_0x1571f1){if(_0x1571f1){return _0x1571f1[_0xbb36('0x25')](_0x2c92d2)[_0xbb36('0x26')](function(_0x1e688b){return _0x1e688b;});}return null;};}function removeEntity(_0x5033e5,_0x523db7){return function(_0x42fd9c){if(_0x42fd9c){return _0x42fd9c['destroy']()[_0xbb36('0x26')](function(){_0x5033e5[_0xbb36('0x1b')](0xcc)[_0xbb36('0x1c')]();});}};}function handleEntityNotFound(_0xc1239,_0x218c99){return function(_0x537b24){if(!_0x537b24){_0xc1239[_0xbb36('0x1a')](0x194);}return _0x537b24;};}function handleError(_0x34c51e,_0x49b825){_0x49b825=_0x49b825||0x1f4;return function(_0x105e1d){logger['error'](_0x105e1d[_0xbb36('0x27')]);if(_0x105e1d[_0xbb36('0x28')]){delete _0x105e1d['name'];}_0x34c51e[_0xbb36('0x1b')](_0x49b825)['send'](_0x105e1d);};}exports[_0xbb36('0x29')]=function(_0x7c9948,_0x4b5f9c){var _0x4a3b55={},_0x1f6059={},_0x4e417a={'count':0x0,'rows':[]};var _0x24f231=_['map'](db['SquareMessage'][_0xbb36('0x2a')],function(_0x3df68e){return{'name':_0x3df68e[_0xbb36('0x2b')],'type':_0x3df68e[_0xbb36('0x2c')][_0xbb36('0x2d')]};});_0x1f6059['model']=_[_0xbb36('0x2e')](_0x24f231,'name');_0x1f6059[_0xbb36('0x2f')]=_['keys'](_0x7c9948[_0xbb36('0x2f')]);_0x1f6059['filters']=_[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x31')],_0x1f6059[_0xbb36('0x2f')]);_0x4a3b55[_0xbb36('0x32')]=_[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x31')],qs[_0xbb36('0x33')](_0x7c9948['query'][_0xbb36('0x33')]));_0x4a3b55['attributes']=_0x4a3b55[_0xbb36('0x32')][_0xbb36('0x34')]?_0x4a3b55['attributes']:_0x1f6059['model'];if(!_0x7c9948[_0xbb36('0x2f')][_0xbb36('0x35')](_0xbb36('0x36'))){_0x4a3b55[_0xbb36('0x20')]=qs[_0xbb36('0x20')](_0x7c9948['query'][_0xbb36('0x20')]);_0x4a3b55[_0xbb36('0x1e')]=qs[_0xbb36('0x1e')](_0x7c9948[_0xbb36('0x2f')]['offset']);}_0x4a3b55[_0xbb36('0x37')]=qs[_0xbb36('0x38')](_0x7c9948[_0xbb36('0x2f')]['sort']);_0x4a3b55[_0xbb36('0x39')]=qs[_0xbb36('0x3a')](_['pick'](_0x7c9948['query'],_0x1f6059[_0xbb36('0x3a')]),_0x24f231);if(_0x7c9948[_0xbb36('0x2f')]['filter']){_0x4a3b55['where']=_['merge'](_0x4a3b55['where'],{'$or':_[_0xbb36('0x2e')](_0x24f231,function(_0x43c926){if(_0x43c926['type']!=='VIRTUAL'){var _0x23cb6e={};_0x23cb6e[_0x43c926['name']]={'$like':'%'+_0x7c9948[_0xbb36('0x2f')]['filter']+'%'};return _0x23cb6e;}})});}_0x4a3b55=_[_0xbb36('0x3b')]({},_0x4a3b55,_0x7c9948[_0xbb36('0x3c')]);var _0x4f6709={'where':_0x4a3b55[_0xbb36('0x39')]};return db[_0xbb36('0x3d')]['count'](_0x4f6709)[_0xbb36('0x26')](function(_0x20c1d1){_0x4e417a[_0xbb36('0x21')]=_0x20c1d1;if(_0x7c9948['query'][_0xbb36('0x3e')]){_0x4a3b55['include']=[{'all':!![]}];}return db[_0xbb36('0x3d')][_0xbb36('0x3f')](_0x4a3b55);})[_0xbb36('0x26')](function(_0x4b4ea8){_0x4e417a[_0xbb36('0x40')]=_0x4b4ea8;return _0x4e417a;})['then'](respondWithFilteredResult(_0x4b5f9c,_0x4a3b55))['catch'](handleError(_0x4b5f9c,null));};exports[_0xbb36('0x41')]=function(_0x5622c8,_0x4433dc){var _0xbadba5={'raw':!![],'where':{'id':_0x5622c8[_0xbb36('0x42')]['id']}},_0x446b7d={};_0x446b7d['model']=_[_0xbb36('0x43')](db[_0xbb36('0x3d')]['rawAttributes']);_0x446b7d[_0xbb36('0x2f')]=_['keys'](_0x5622c8[_0xbb36('0x2f')]);_0x446b7d[_0xbb36('0x3a')]=_[_0xbb36('0x30')](_0x446b7d[_0xbb36('0x31')],_0x446b7d[_0xbb36('0x2f')]);_0xbadba5[_0xbb36('0x32')]=_[_0xbb36('0x30')](_0x446b7d['model'],qs[_0xbb36('0x33')](_0x5622c8[_0xbb36('0x2f')]['fields']));_0xbadba5[_0xbb36('0x32')]=_0xbadba5[_0xbb36('0x32')][_0xbb36('0x34')]?_0xbadba5[_0xbb36('0x32')]:_0x446b7d[_0xbb36('0x31')];if(_0x5622c8[_0xbb36('0x2f')][_0xbb36('0x3e')]){_0xbadba5[_0xbb36('0x44')]=[{'all':!![]}];}_0xbadba5=_['merge']({},_0xbadba5,_0x5622c8[_0xbb36('0x3c')]);return db[_0xbb36('0x3d')][_0xbb36('0x45')](_0xbadba5)[_0xbb36('0x26')](handleEntityNotFound(_0x4433dc,null))[_0xbb36('0x26')](respondWithResult(_0x4433dc,null))[_0xbb36('0x46')](handleError(_0x4433dc,null));};exports['create']=function(_0x4b5d9f,_0x3d7134){return db[_0xbb36('0x3d')][_0xbb36('0x47')](_0x4b5d9f['body'],{})[_0xbb36('0x26')](respondWithResult(_0x3d7134,0xc9))[_0xbb36('0x46')](handleError(_0x3d7134,null));};exports[_0xbb36('0x25')]=function(_0x422c4e,_0x4e62b3){if(_0x422c4e['body']['id']){delete _0x422c4e[_0xbb36('0x48')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x422c4e['params']['id']}})[_0xbb36('0x26')](handleEntityNotFound(_0x4e62b3,null))[_0xbb36('0x26')](saveUpdates(_0x422c4e[_0xbb36('0x48')],null))[_0xbb36('0x26')](respondWithResult(_0x4e62b3,null))['catch'](handleError(_0x4e62b3,null));};exports[_0xbb36('0x49')]=function(_0x56c6cf,_0x534ca4){return db['SquareMessage'][_0xbb36('0x45')]({'where':{'id':_0x56c6cf[_0xbb36('0x42')]['id']}})[_0xbb36('0x26')](handleEntityNotFound(_0x534ca4,null))[_0xbb36('0x26')](removeEntity(_0x534ca4,null))[_0xbb36('0x46')](handleError(_0x534ca4,null));}; \ No newline at end of file +var _0xb310=['set','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','undefined','limit','count','offset'];(function(_0x47d454,_0xf3253a){var _0x1188b9=function(_0x1b6f8d){while(--_0x1b6f8d){_0x47d454['push'](_0x47d454['shift']());}};_0x1188b9(++_0xf3253a);}(_0xb310,0x115));var _0x0b31=function(_0xb3c8cf,_0x81a29b){_0xb3c8cf=_0xb3c8cf-0x0;var _0x3f5085=_0xb310[_0xb3c8cf];return _0x3f5085;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0b31('0x0'));var jsonpatch=require(_0x0b31('0x1'));var rp=require('request-promise');var moment=require(_0x0b31('0x2'));var BPromise=require(_0x0b31('0x3'));var Mustache=require(_0x0b31('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0b31('0x5'));var csv=require(_0x0b31('0x6'));var ejs=require(_0x0b31('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b31('0x8'));var squel=require(_0x0b31('0x9'));var crypto=require(_0x0b31('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0b31('0x6'));var querystring=require('querystring');var Papa=require(_0x0b31('0xb'));var Redis=require(_0x0b31('0xc'));var authService=require(_0x0b31('0xd'));var qs=require(_0x0b31('0xe'));var as=require(_0x0b31('0xf'));var hardwareService=require(_0x0b31('0x10'));var logger=require(_0x0b31('0x11'))(_0x0b31('0x12'));var utils=require(_0x0b31('0x13'));var config=require(_0x0b31('0x14'));var licenseUtil=require(_0x0b31('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31211c,_0x26436b){_0x26436b=_0x26436b||0xcc;return function(_0x587a2e){if(_0x587a2e){return _0x31211c['sendStatus'](_0x26436b);}return _0x31211c['status'](_0x26436b)['end']();};}function respondWithResult(_0x22a39f,_0x101730){_0x101730=_0x101730||0xc8;return function(_0x2b6262){if(_0x2b6262){return _0x22a39f[_0x0b31('0x16')](_0x101730)['json'](_0x2b6262);}};}function respondWithFilteredResult(_0xa05f78,_0x3197e0){return function(_0x53acde){if(_0x53acde){var _0xf98d30=typeof _0x3197e0['offset']===_0x0b31('0x17')&&typeof _0x3197e0[_0x0b31('0x18')]===_0x0b31('0x17');var _0x5f5a59=_0x53acde[_0x0b31('0x19')];var _0x132223=_0xf98d30?0x0:_0x3197e0[_0x0b31('0x1a')];var _0x19312b=_0xf98d30?_0x53acde[_0x0b31('0x19')]:_0x3197e0[_0x0b31('0x1a')]+_0x3197e0[_0x0b31('0x18')];var _0x5a9f52;if(_0x19312b>=_0x5f5a59){_0x19312b=_0x5f5a59;_0x5a9f52=0xc8;}else{_0x5a9f52=0xce;}_0xa05f78[_0x0b31('0x16')](_0x5a9f52);return _0xa05f78[_0x0b31('0x1b')](_0x0b31('0x1c'),_0x132223+'-'+_0x19312b+'/'+_0x5f5a59)[_0x0b31('0x1d')](_0x53acde);}return null;};}function patchUpdates(_0x4a5017){return function(_0xa5e9d7){try{jsonpatch[_0x0b31('0x1e')](_0xa5e9d7,_0x4a5017,!![]);}catch(_0x43b7f0){return BPromise[_0x0b31('0x1f')](_0x43b7f0);}return _0xa5e9d7[_0x0b31('0x20')]();};}function saveUpdates(_0x4a8b61,_0x22634a){return function(_0x31c689){if(_0x31c689){return _0x31c689['update'](_0x4a8b61)[_0x0b31('0x21')](function(_0xe82732){return _0xe82732;});}return null;};}function removeEntity(_0x37a2c4,_0x185415){return function(_0x251cd5){if(_0x251cd5){return _0x251cd5[_0x0b31('0x22')]()['then'](function(){_0x37a2c4[_0x0b31('0x16')](0xcc)[_0x0b31('0x23')]();});}};}function handleEntityNotFound(_0x6e1a5f,_0x56f67b){return function(_0x4e0a03){if(!_0x4e0a03){_0x6e1a5f['sendStatus'](0x194);}return _0x4e0a03;};}function handleError(_0x57d74f,_0x28e3df){_0x28e3df=_0x28e3df||0x1f4;return function(_0x5915ad){logger[_0x0b31('0x24')](_0x5915ad[_0x0b31('0x25')]);if(_0x5915ad['name']){delete _0x5915ad[_0x0b31('0x26')];}_0x57d74f[_0x0b31('0x16')](_0x28e3df)[_0x0b31('0x27')](_0x5915ad);};}exports[_0x0b31('0x28')]=function(_0x25b6b4,_0x27d03b){var _0xb6ba6b={},_0x48172a={},_0x258377={'count':0x0,'rows':[]};var _0x875b74=_[_0x0b31('0x29')](db[_0x0b31('0x2a')][_0x0b31('0x2b')],function(_0x2a844f){return{'name':_0x2a844f[_0x0b31('0x2c')],'type':_0x2a844f[_0x0b31('0x2d')][_0x0b31('0x2e')]};});_0x48172a[_0x0b31('0x2f')]=_['map'](_0x875b74,'name');_0x48172a[_0x0b31('0x30')]=_['keys'](_0x25b6b4[_0x0b31('0x30')]);_0x48172a[_0x0b31('0x31')]=_[_0x0b31('0x32')](_0x48172a[_0x0b31('0x2f')],_0x48172a['query']);_0xb6ba6b[_0x0b31('0x33')]=_[_0x0b31('0x32')](_0x48172a[_0x0b31('0x2f')],qs[_0x0b31('0x34')](_0x25b6b4[_0x0b31('0x30')][_0x0b31('0x34')]));_0xb6ba6b[_0x0b31('0x33')]=_0xb6ba6b[_0x0b31('0x33')][_0x0b31('0x35')]?_0xb6ba6b[_0x0b31('0x33')]:_0x48172a[_0x0b31('0x2f')];if(!_0x25b6b4[_0x0b31('0x30')][_0x0b31('0x36')](_0x0b31('0x37'))){_0xb6ba6b[_0x0b31('0x18')]=qs[_0x0b31('0x18')](_0x25b6b4[_0x0b31('0x30')][_0x0b31('0x18')]);_0xb6ba6b['offset']=qs['offset'](_0x25b6b4[_0x0b31('0x30')][_0x0b31('0x1a')]);}_0xb6ba6b[_0x0b31('0x38')]=qs[_0x0b31('0x39')](_0x25b6b4[_0x0b31('0x30')][_0x0b31('0x39')]);_0xb6ba6b['where']=qs[_0x0b31('0x31')](_[_0x0b31('0x3a')](_0x25b6b4[_0x0b31('0x30')],_0x48172a[_0x0b31('0x31')]),_0x875b74);if(_0x25b6b4[_0x0b31('0x30')][_0x0b31('0x3b')]){_0xb6ba6b[_0x0b31('0x3c')]=_[_0x0b31('0x3d')](_0xb6ba6b['where'],{'$or':_[_0x0b31('0x29')](_0x875b74,function(_0x121f96){if(_0x121f96['type']!==_0x0b31('0x3e')){var _0x189793={};_0x189793[_0x121f96[_0x0b31('0x26')]]={'$like':'%'+_0x25b6b4[_0x0b31('0x30')]['filter']+'%'};return _0x189793;}})});}_0xb6ba6b=_['merge']({},_0xb6ba6b,_0x25b6b4[_0x0b31('0x3f')]);var _0x44574e={'where':_0xb6ba6b['where']};return db['SquareMessage']['count'](_0x44574e)['then'](function(_0x42cb25){_0x258377[_0x0b31('0x19')]=_0x42cb25;if(_0x25b6b4[_0x0b31('0x30')][_0x0b31('0x40')]){_0xb6ba6b[_0x0b31('0x41')]=[{'all':!![]}];}return db[_0x0b31('0x2a')][_0x0b31('0x42')](_0xb6ba6b);})[_0x0b31('0x21')](function(_0x51d5e8){_0x258377[_0x0b31('0x43')]=_0x51d5e8;return _0x258377;})[_0x0b31('0x21')](respondWithFilteredResult(_0x27d03b,_0xb6ba6b))[_0x0b31('0x44')](handleError(_0x27d03b,null));};exports[_0x0b31('0x45')]=function(_0x5ac7cb,_0x3cbe36){var _0x184a6a={'raw':!![],'where':{'id':_0x5ac7cb[_0x0b31('0x46')]['id']}},_0x4f3d81={};_0x4f3d81['model']=_[_0x0b31('0x47')](db[_0x0b31('0x2a')][_0x0b31('0x2b')]);_0x4f3d81[_0x0b31('0x30')]=_[_0x0b31('0x47')](_0x5ac7cb[_0x0b31('0x30')]);_0x4f3d81[_0x0b31('0x31')]=_[_0x0b31('0x32')](_0x4f3d81['model'],_0x4f3d81[_0x0b31('0x30')]);_0x184a6a[_0x0b31('0x33')]=_[_0x0b31('0x32')](_0x4f3d81[_0x0b31('0x2f')],qs[_0x0b31('0x34')](_0x5ac7cb['query'][_0x0b31('0x34')]));_0x184a6a[_0x0b31('0x33')]=_0x184a6a[_0x0b31('0x33')]['length']?_0x184a6a['attributes']:_0x4f3d81[_0x0b31('0x2f')];if(_0x5ac7cb[_0x0b31('0x30')][_0x0b31('0x40')]){_0x184a6a[_0x0b31('0x41')]=[{'all':!![]}];}_0x184a6a=_[_0x0b31('0x3d')]({},_0x184a6a,_0x5ac7cb[_0x0b31('0x3f')]);return db[_0x0b31('0x2a')][_0x0b31('0x48')](_0x184a6a)[_0x0b31('0x21')](handleEntityNotFound(_0x3cbe36,null))[_0x0b31('0x21')](respondWithResult(_0x3cbe36,null))[_0x0b31('0x44')](handleError(_0x3cbe36,null));};exports['create']=function(_0xc2750,_0x51fe49){return db[_0x0b31('0x2a')][_0x0b31('0x49')](_0xc2750[_0x0b31('0x4a')],{})[_0x0b31('0x21')](respondWithResult(_0x51fe49,0xc9))[_0x0b31('0x44')](handleError(_0x51fe49,null));};exports[_0x0b31('0x4b')]=function(_0x3dab5c,_0x138780){if(_0x3dab5c[_0x0b31('0x4a')]['id']){delete _0x3dab5c[_0x0b31('0x4a')]['id'];}return db['SquareMessage'][_0x0b31('0x48')]({'where':{'id':_0x3dab5c[_0x0b31('0x46')]['id']}})[_0x0b31('0x21')](handleEntityNotFound(_0x138780,null))[_0x0b31('0x21')](saveUpdates(_0x3dab5c[_0x0b31('0x4a')],null))['then'](respondWithResult(_0x138780,null))[_0x0b31('0x44')](handleError(_0x138780,null));};exports[_0x0b31('0x22')]=function(_0x52233a,_0x4f41fa){return db[_0x0b31('0x2a')][_0x0b31('0x48')]({'where':{'id':_0x52233a[_0x0b31('0x46')]['id']}})[_0x0b31('0x21')](handleEntityNotFound(_0x4f41fa,null))[_0x0b31('0x21')](removeEntity(_0x4f41fa,null))[_0x0b31('0x44')](handleError(_0x4f41fa,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index ab2537e..7f6c123 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 _0x0997=['../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x0997,0xd8));var _0x7099=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0997[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7099('0x0'));var util=require(_0x7099('0x1'));var logger=require(_0x7099('0x2'))(_0x7099('0x3'));var moment=require(_0x7099('0x4'));var BPromise=require(_0x7099('0x5'));var rp=require(_0x7099('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7099('0x7'));var config=require(_0x7099('0x8'));var attributes=require(_0x7099('0x9'));module[_0x7099('0xa')]=function(_0x36685f,_0x24e809){return _0x36685f[_0x7099('0xb')](_0x7099('0xc'),attributes,{'tableName':_0x7099('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcabd=['api','moment','request-promise','../../config/environment','define','square_messages','lodash','util'];(function(_0x365131,_0x393450){var _0xc515d2=function(_0x18b385){while(--_0x18b385){_0x365131['push'](_0x365131['shift']());}};_0xc515d2(++_0x393450);}(_0xcabd,0x96));var _0xdcab=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xcabd[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xdcab('0x0'));var util=require(_0xdcab('0x1'));var logger=require('../../config/logger')(_0xdcab('0x2'));var moment=require(_0xdcab('0x3'));var BPromise=require('bluebird');var rp=require(_0xdcab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdcab('0x5'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x1b9b3c,_0x1d6e3b){return _0x1b9b3c[_0xdcab('0x6')]('SquareMessage',attributes,{'tableName':_0xdcab('0x7'),'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 b6d0486..16dd21b 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 _0x1111=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','CreateSquareMessage','SquareMessage','options','raw','stringify','lodash','util','moment','bluebird'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x1111,0x88));var _0x1111=function(_0x2dd36b,_0x15d3e8){_0x2dd36b=_0x2dd36b-0x0;var _0x3b0124=_0x1111[_0x2dd36b];return _0x3b0124;};'use strict';var _=require(_0x1111('0x0'));var util=require(_0x1111('0x1'));var moment=require(_0x1111('0x2'));var BPromise=require(_0x1111('0x3'));var rs=require(_0x1111('0x4'));var fs=require('fs');var Redis=require(_0x1111('0x5'));var db=require(_0x1111('0x6'))['db'];var utils=require(_0x1111('0x7'));var logger=require(_0x1111('0x8'))(_0x1111('0x9'));var config=require(_0x1111('0xa'));var jayson=require(_0x1111('0xb'));var client=jayson['client'][_0x1111('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10f81e,_0x47ddee,_0x4eecaa){return new BPromise(function(_0x1da5a6,_0x74905){return client[_0x1111('0xd')](_0x10f81e,_0x4eecaa)[_0x1111('0xe')](function(_0x4215ce){logger[_0x1111('0xf')](_0x1111('0x10'),_0x47ddee,_0x1111('0x11'));logger[_0x1111('0x12')](_0x1111('0x13'),_0x47ddee,_0x1111('0x11'),JSON['stringify'](_0x4215ce));if(_0x4215ce[_0x1111('0x14')]){if(_0x4215ce[_0x1111('0x14')][_0x1111('0x15')]===0x1f4){logger[_0x1111('0x14')](_0x1111('0x10'),_0x47ddee,_0x4215ce[_0x1111('0x14')][_0x1111('0x16')]);return _0x74905(_0x4215ce[_0x1111('0x14')][_0x1111('0x16')]);}logger[_0x1111('0x14')](_0x1111('0x10'),_0x47ddee,_0x4215ce[_0x1111('0x14')][_0x1111('0x16')]);return _0x1da5a6(_0x4215ce[_0x1111('0x14')]['message']);}else{logger['info'](_0x1111('0x10'),_0x47ddee,_0x1111('0x11'));_0x1da5a6(_0x4215ce['result'][_0x1111('0x16')]);}})['catch'](function(_0x560d4b){logger['error'](_0x1111('0x10'),_0x47ddee,_0x560d4b);_0x74905(_0x560d4b);});});}exports[_0x1111('0x17')]=function(_0x335d73){var _0xe0ea6b=this;return new Promise(function(_0x16d887,_0x1d27ad){return db[_0x1111('0x18')]['create'](_0x335d73['body'],{'raw':_0x335d73[_0x1111('0x19')]?_0x335d73['options'][_0x1111('0x1a')]===undefined?!![]:![]:!![]})[_0x1111('0xe')](function(_0x16a27e){logger[_0x1111('0xf')](_0x1111('0x17'),_0x335d73);logger[_0x1111('0x12')](_0x1111('0x17'),_0x335d73,JSON[_0x1111('0x1b')](_0x16a27e));_0x16d887(_0x16a27e);})['catch'](function(_0x1f075d){logger[_0x1111('0x14')]('CreateSquareMessage',_0x1f075d[_0x1111('0x16')],_0x335d73);_0x1d27ad(_0xe0ea6b[_0x1111('0x14')](0x1f4,_0x1f075d['message']));});});}; \ No newline at end of file +var _0x530c=['SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug'];(function(_0x5a8aa3,_0x2294d5){var _0x5d0458=function(_0x62d096){while(--_0x62d096){_0x5a8aa3['push'](_0x5a8aa3['shift']());}};_0x5d0458(++_0x2294d5);}(_0x530c,0xbc));var _0xc530=function(_0x25981f,_0x392e24){_0x25981f=_0x25981f-0x0;var _0x2aacbf=_0x530c[_0x25981f];return _0x2aacbf;};'use strict';var _=require(_0xc530('0x0'));var util=require(_0xc530('0x1'));var moment=require(_0xc530('0x2'));var BPromise=require(_0xc530('0x3'));var rs=require(_0xc530('0x4'));var fs=require('fs');var Redis=require(_0xc530('0x5'));var db=require(_0xc530('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc530('0x7'));var config=require(_0xc530('0x8'));var jayson=require(_0xc530('0x9'));var client=jayson[_0xc530('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa3e811,_0x5b6e93,_0x49ffe2){return new BPromise(function(_0x17f2f6,_0x512049){return client[_0xc530('0xb')](_0xa3e811,_0x49ffe2)['then'](function(_0x4b8102){logger[_0xc530('0xc')]('SquareMessage,\x20%s,\x20%s',_0x5b6e93,_0xc530('0xd'));logger[_0xc530('0xe')](_0xc530('0xf'),_0x5b6e93,'request\x20sent',JSON[_0xc530('0x10')](_0x4b8102));if(_0x4b8102[_0xc530('0x11')]){if(_0x4b8102[_0xc530('0x11')][_0xc530('0x12')]===0x1f4){logger[_0xc530('0x11')](_0xc530('0x13'),_0x5b6e93,_0x4b8102[_0xc530('0x11')][_0xc530('0x14')]);return _0x512049(_0x4b8102[_0xc530('0x11')][_0xc530('0x14')]);}logger['error'](_0xc530('0x13'),_0x5b6e93,_0x4b8102[_0xc530('0x11')][_0xc530('0x14')]);return _0x17f2f6(_0x4b8102['error'][_0xc530('0x14')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x5b6e93,_0xc530('0xd'));_0x17f2f6(_0x4b8102[_0xc530('0x15')]['message']);}})[_0xc530('0x16')](function(_0x4386b9){logger[_0xc530('0x11')](_0xc530('0x13'),_0x5b6e93,_0x4386b9);_0x512049(_0x4386b9);});});}exports['CreateSquareMessage']=function(_0x255559){var _0x39a63e=this;return new Promise(function(_0xf6a2b9,_0x108661){return db[_0xc530('0x17')][_0xc530('0x18')](_0x255559[_0xc530('0x19')],{'raw':_0x255559[_0xc530('0x1a')]?_0x255559['options'][_0xc530('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x21178f){logger[_0xc530('0xc')](_0xc530('0x1c'),_0x255559);logger[_0xc530('0xe')](_0xc530('0x1c'),_0x255559,JSON[_0xc530('0x10')](_0x21178f));_0xf6a2b9(_0x21178f);})[_0xc530('0x16')](function(_0x388a5f){logger['error'](_0xc530('0x1c'),_0x388a5f['message'],_0x255559);_0x108661(_0x39a63e[_0xc530('0x11')](0x1f4,_0x388a5f[_0xc530('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 310f640..49d79f6 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 _0xec8c=['exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','test','post','put','delete','destroy'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0xec8c,0xde));var _0xcec8=function(_0x424c0f,_0x31a27d){_0x424c0f=_0x424c0f-0x0;var _0x265bf4=_0xec8c[_0x424c0f];return _0x265bf4;};'use strict';var multer=require('multer');var util=require(_0xcec8('0x0'));var path=require('path');var timeout=require(_0xcec8('0x1'));var express=require(_0xcec8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcec8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcec8('0x4'));var controller=require(_0xcec8('0x5'));router[_0xcec8('0x6')]('/',auth[_0xcec8('0x7')](),controller[_0xcec8('0x8')]);router[_0xcec8('0x6')](_0xcec8('0x9'),auth[_0xcec8('0x7')](),controller[_0xcec8('0xa')]);router[_0xcec8('0x6')]('/:id/test',auth[_0xcec8('0x7')](),timeout('15s'),controller[_0xcec8('0xb')]);router[_0xcec8('0xc')]('/',auth[_0xcec8('0x7')](),controller['create']);router[_0xcec8('0xd')]('/:id',auth[_0xcec8('0x7')](),controller['update']);router[_0xcec8('0xe')](_0xcec8('0x9'),auth[_0xcec8('0x7')](),controller[_0xcec8('0xf')]);module[_0xcec8('0x10')]=router; \ No newline at end of file +var _0x5307=['get','index','/:id','isAuthenticated','15s','test','create','put','delete','destroy','exports','util','express','fs-extra','../../components/interaction/service'];(function(_0x4978fa,_0x573026){var _0x2f548c=function(_0x3195e4){while(--_0x3195e4){_0x4978fa['push'](_0x4978fa['shift']());}};_0x2f548c(++_0x573026);}(_0x5307,0x1be));var _0x7530=function(_0x49a072,_0x3bd0a3){_0x49a072=_0x49a072-0x0;var _0x346944=_0x5307[_0x49a072];return _0x346944;};'use strict';var multer=require('multer');var util=require(_0x7530('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7530('0x1'));var router=express['Router']();var fs_extra=require(_0x7530('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7530('0x3'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0x7530('0x4')]('/',auth['isAuthenticated'](),controller[_0x7530('0x5')]);router[_0x7530('0x4')](_0x7530('0x6'),auth[_0x7530('0x7')](),controller['show']);router[_0x7530('0x4')]('/:id/test',auth[_0x7530('0x7')](),timeout(_0x7530('0x8')),controller[_0x7530('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7530('0xa')]);router[_0x7530('0xb')](_0x7530('0x6'),auth[_0x7530('0x7')](),controller['update']);router[_0x7530('0xc')](_0x7530('0x6'),auth['isAuthenticated'](),controller[_0x7530('0xd')]);module[_0x7530('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index d36bff2..786566a 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 _0xad8a=['STRING','sequelize','exports'];(function(_0x4241c1,_0x2993b){var _0x166ec5=function(_0x1d1a1f){while(--_0x1d1a1f){_0x4241c1['push'](_0x4241c1['shift']());}};_0x166ec5(++_0x2993b);}(_0xad8a,0x130));var _0xaad8=function(_0x5f4940,_0x299817){_0x5f4940=_0x5f4940-0x0;var _0x4e053b=_0xad8a[_0x5f4940];return _0x4e053b;};'use strict';var Sequelize=require(_0xaad8('0x0'));module[_0xaad8('0x1')]={'name':{'type':Sequelize[_0xaad8('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xaad8('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xceb1=['STRING','exports'];(function(_0x1b4b06,_0x11eff9){var _0x2689b1=function(_0x1a4ef0){while(--_0x1a4ef0){_0x1b4b06['push'](_0x1b4b06['shift']());}};_0x2689b1(++_0x11eff9);}(_0xceb1,0x13b));var _0x1ceb=function(_0x3307c8,_0x69a04b){_0x3307c8=_0x3307c8-0x0;var _0x2e2cb3=_0xceb1[_0x3307c8];return _0x2e2cb3;};'use strict';var Sequelize=require('sequelize');module[_0x1ceb('0x0')]={'name':{'type':Sequelize[_0x1ceb('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x1ceb('0x1')]},'description':{'type':Sequelize[_0x1ceb('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 81eebb1..a99ec71 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 _0x92ab=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','catch','show','params','include','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','body','test','odbc','openSync','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x92ab,0x1a7));var _0xb92a=function(_0x2a9831,_0x42f7e8){_0x2a9831=_0x2a9831-0x0;var _0x184c16=_0x92ab[_0x2a9831];return _0x184c16;};'use strict';var emlformat=require(_0xb92a('0x0'));var rimraf=require(_0xb92a('0x1'));var zipdir=require(_0xb92a('0x2'));var jsonpatch=require(_0xb92a('0x3'));var rp=require(_0xb92a('0x4'));var moment=require(_0xb92a('0x5'));var BPromise=require(_0xb92a('0x6'));var Mustache=require(_0xb92a('0x7'));var util=require(_0xb92a('0x8'));var path=require('path');var sox=require(_0xb92a('0x9'));var csv=require(_0xb92a('0xa'));var ejs=require(_0xb92a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb92a('0xc'));var squel=require(_0xb92a('0xd'));var crypto=require(_0xb92a('0xe'));var jsforce=require(_0xb92a('0xf'));var deskjs=require(_0xb92a('0x10'));var toCsv=require(_0xb92a('0xa'));var querystring=require(_0xb92a('0x11'));var Papa=require(_0xb92a('0x12'));var Redis=require(_0xb92a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb92a('0x14'));var as=require(_0xb92a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb92a('0x16'))('api');var utils=require(_0xb92a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb92a('0x18'));var db=require(_0xb92a('0x19'))['db'];function respondWithStatusCode(_0xbb88e4,_0x31e3e3){_0x31e3e3=_0x31e3e3||0xcc;return function(_0x83c761){if(_0x83c761){return _0xbb88e4[_0xb92a('0x1a')](_0x31e3e3);}return _0xbb88e4['status'](_0x31e3e3)[_0xb92a('0x1b')]();};}function respondWithResult(_0x3e80de,_0x26a32d){_0x26a32d=_0x26a32d||0xc8;return function(_0x38e3ee){if(_0x38e3ee){return _0x3e80de[_0xb92a('0x1c')](_0x26a32d)['json'](_0x38e3ee);}};}function respondWithFilteredResult(_0x11b109,_0x217c02){return function(_0x3851b7){if(_0x3851b7){var _0x117625=typeof _0x217c02['offset']===_0xb92a('0x1d')&&typeof _0x217c02[_0xb92a('0x1e')]===_0xb92a('0x1d');var _0x575078=_0x3851b7[_0xb92a('0x1f')];var _0x4a0864=_0x117625?0x0:_0x217c02[_0xb92a('0x20')];var _0x26d205=_0x117625?_0x3851b7[_0xb92a('0x1f')]:_0x217c02['offset']+_0x217c02[_0xb92a('0x1e')];var _0x3ac182;if(_0x26d205>=_0x575078){_0x26d205=_0x575078;_0x3ac182=0xc8;}else{_0x3ac182=0xce;}_0x11b109[_0xb92a('0x1c')](_0x3ac182);return _0x11b109['set'](_0xb92a('0x21'),_0x4a0864+'-'+_0x26d205+'/'+_0x575078)[_0xb92a('0x22')](_0x3851b7);}return null;};}function patchUpdates(_0x3d49b8){return function(_0x16dc5e){try{jsonpatch[_0xb92a('0x23')](_0x16dc5e,_0x3d49b8,!![]);}catch(_0x39f31e){return BPromise[_0xb92a('0x24')](_0x39f31e);}return _0x16dc5e[_0xb92a('0x25')]();};}function saveUpdates(_0x736a1f,_0x9dbb2c){return function(_0x210023){if(_0x210023){return _0x210023[_0xb92a('0x26')](_0x736a1f)[_0xb92a('0x27')](function(_0x5e0fdf){return _0x5e0fdf;});}return null;};}function removeEntity(_0x3ee4f5,_0x2d06d5){return function(_0x200589){if(_0x200589){return _0x200589[_0xb92a('0x28')]()[_0xb92a('0x27')](function(){var _0xccde96=_0x200589[_0xb92a('0x29')]({'plain':!![]});var _0x35add5='ODBC';return db[_0xb92a('0x2a')][_0xb92a('0x28')]({'where':{'type':_0x35add5,'resourceId':_0xccde96['id']}})[_0xb92a('0x27')](function(){return _0x200589;});})[_0xb92a('0x27')](function(){_0x3ee4f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bef9a,_0x155170){return function(_0x53b9c0){if(!_0x53b9c0){_0x1bef9a[_0xb92a('0x1a')](0x194);}return _0x53b9c0;};}function handleError(_0x15d187,_0x37a46f){_0x37a46f=_0x37a46f||0x1f4;return function(_0x26d9f1){logger['error'](_0x26d9f1[_0xb92a('0x2b')]);if(_0x26d9f1[_0xb92a('0x2c')]){delete _0x26d9f1['name'];}_0x15d187['status'](_0x37a46f)['send'](_0x26d9f1);};}exports[_0xb92a('0x2d')]=function(_0x1c21ca,_0x3ef2e9){var _0x40e837={},_0x4d3952={},_0x4dee73={'count':0x0,'rows':[]};var _0x2c375b=_[_0xb92a('0x2e')](db[_0xb92a('0x2f')][_0xb92a('0x30')],function(_0x150895){return{'name':_0x150895[_0xb92a('0x31')],'type':_0x150895[_0xb92a('0x32')][_0xb92a('0x33')]};});_0x4d3952['model']=_[_0xb92a('0x2e')](_0x2c375b,_0xb92a('0x2c'));_0x4d3952['query']=_[_0xb92a('0x34')](_0x1c21ca[_0xb92a('0x35')]);_0x4d3952[_0xb92a('0x36')]=_['intersection'](_0x4d3952[_0xb92a('0x37')],_0x4d3952[_0xb92a('0x35')]);_0x40e837['attributes']=_[_0xb92a('0x38')](_0x4d3952[_0xb92a('0x37')],qs[_0xb92a('0x39')](_0x1c21ca['query'][_0xb92a('0x39')]));_0x40e837[_0xb92a('0x3a')]=_0x40e837[_0xb92a('0x3a')][_0xb92a('0x3b')]?_0x40e837[_0xb92a('0x3a')]:_0x4d3952[_0xb92a('0x37')];if(!_0x1c21ca['query'][_0xb92a('0x3c')]('nolimit')){_0x40e837[_0xb92a('0x1e')]=qs[_0xb92a('0x1e')](_0x1c21ca[_0xb92a('0x35')][_0xb92a('0x1e')]);_0x40e837['offset']=qs['offset'](_0x1c21ca[_0xb92a('0x35')][_0xb92a('0x20')]);}_0x40e837[_0xb92a('0x3d')]=qs[_0xb92a('0x3e')](_0x1c21ca[_0xb92a('0x35')][_0xb92a('0x3e')]);_0x40e837[_0xb92a('0x3f')]=qs[_0xb92a('0x36')](_['pick'](_0x1c21ca[_0xb92a('0x35')],_0x4d3952['filters']),_0x2c375b);if(_0x1c21ca[_0xb92a('0x35')][_0xb92a('0x40')]){_0x40e837['where']=_[_0xb92a('0x41')](_0x40e837[_0xb92a('0x3f')],{'$or':_[_0xb92a('0x2e')](_0x2c375b,function(_0x72a7c1){if(_0x72a7c1[_0xb92a('0x32')]!==_0xb92a('0x42')){var _0x2c90fe={};_0x2c90fe[_0x72a7c1[_0xb92a('0x2c')]]={'$like':'%'+_0x1c21ca['query']['filter']+'%'};return _0x2c90fe;}})});}_0x40e837=_[_0xb92a('0x41')]({},_0x40e837,_0x1c21ca['options']);var _0x3253d2={'where':_0x40e837[_0xb92a('0x3f')]};return db[_0xb92a('0x2f')][_0xb92a('0x1f')](_0x3253d2)['then'](function(_0x55fd49){_0x4dee73[_0xb92a('0x1f')]=_0x55fd49;if(_0x1c21ca['query'][_0xb92a('0x43')]){_0x40e837['include']=[{'all':!![]}];}return db[_0xb92a('0x2f')]['findAll'](_0x40e837);})['then'](function(_0x2f5d05){_0x4dee73['rows']=_0x2f5d05;return _0x4dee73;})['then'](respondWithFilteredResult(_0x3ef2e9,_0x40e837))[_0xb92a('0x44')](handleError(_0x3ef2e9,null));};exports[_0xb92a('0x45')]=function(_0x598f30,_0x37e342){var _0x16044d={'raw':!![],'where':{'id':_0x598f30[_0xb92a('0x46')]['id']}},_0x109938={};_0x109938['model']=_[_0xb92a('0x34')](db[_0xb92a('0x2f')]['rawAttributes']);_0x109938[_0xb92a('0x35')]=_['keys'](_0x598f30[_0xb92a('0x35')]);_0x109938[_0xb92a('0x36')]=_[_0xb92a('0x38')](_0x109938[_0xb92a('0x37')],_0x109938[_0xb92a('0x35')]);_0x16044d[_0xb92a('0x3a')]=_[_0xb92a('0x38')](_0x109938[_0xb92a('0x37')],qs[_0xb92a('0x39')](_0x598f30[_0xb92a('0x35')][_0xb92a('0x39')]));_0x16044d[_0xb92a('0x3a')]=_0x16044d[_0xb92a('0x3a')]['length']?_0x16044d[_0xb92a('0x3a')]:_0x109938[_0xb92a('0x37')];if(_0x598f30[_0xb92a('0x35')][_0xb92a('0x43')]){_0x16044d[_0xb92a('0x47')]=[{'all':!![]}];}_0x16044d=_[_0xb92a('0x41')]({},_0x16044d,_0x598f30['options']);return db[_0xb92a('0x2f')][_0xb92a('0x48')](_0x16044d)[_0xb92a('0x27')](handleEntityNotFound(_0x37e342,null))[_0xb92a('0x27')](respondWithResult(_0x37e342,null))[_0xb92a('0x44')](handleError(_0x37e342,null));};exports[_0xb92a('0x49')]=function(_0x5630ec,_0x2b9bda){return db[_0xb92a('0x2f')][_0xb92a('0x49')](_0x5630ec['body'],{})[_0xb92a('0x27')](function(_0x59f60c){var _0x5d681d=_0x5630ec[_0xb92a('0x4a')][_0xb92a('0x29')]({'plain':!![]});if(!_0x5d681d)throw new Error(_0xb92a('0x4b'));if(_0x5d681d[_0xb92a('0x4c')]===_0xb92a('0x4a')){var _0xd65c4d=_0x59f60c[_0xb92a('0x29')]({'plain':!![]});var _0x2c5137='ODBC';return db[_0xb92a('0x4d')][_0xb92a('0x48')]({'where':{'name':_0x2c5137,'userProfileId':_0x5d681d[_0xb92a('0x4e')]},'raw':!![]})[_0xb92a('0x27')](function(_0x2d0cd2){if(_0x2d0cd2&&_0x2d0cd2[_0xb92a('0x4f')]===0x0){return db[_0xb92a('0x2a')][_0xb92a('0x49')]({'name':_0xd65c4d[_0xb92a('0x2c')],'resourceId':_0xd65c4d['id'],'type':_0x2d0cd2['name'],'sectionId':_0x2d0cd2['id']},{})[_0xb92a('0x27')](function(){return _0x59f60c;});}else{return _0x59f60c;}})[_0xb92a('0x44')](function(_0xe672f8){logger[_0xb92a('0x50')](_0xb92a('0x51'),_0xe672f8);throw _0xe672f8;});}return _0x59f60c;})['then'](respondWithResult(_0x2b9bda,0xc9))['catch'](handleError(_0x2b9bda,null));};exports[_0xb92a('0x26')]=function(_0x18c9c2,_0x2aae01){if(_0x18c9c2[_0xb92a('0x52')]['id']){delete _0x18c9c2[_0xb92a('0x52')]['id'];}return db[_0xb92a('0x2f')][_0xb92a('0x48')]({'where':{'id':_0x18c9c2[_0xb92a('0x46')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x2aae01,null))['then'](saveUpdates(_0x18c9c2[_0xb92a('0x52')],null))['then'](respondWithResult(_0x2aae01,null))[_0xb92a('0x44')](handleError(_0x2aae01,null));};exports[_0xb92a('0x28')]=function(_0x2aaf8e,_0x558e24){return db[_0xb92a('0x2f')]['find']({'where':{'id':_0x2aaf8e[_0xb92a('0x46')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x558e24,null))[_0xb92a('0x27')](removeEntity(_0x558e24,null))[_0xb92a('0x44')](handleError(_0x558e24,null));};exports[_0xb92a('0x53')]=function(_0x2f7b21,_0x1b9ba5,_0x3814ff){var _0x20d028;return db['SquareOdbc']['find']({'where':{'id':_0x2f7b21[_0xb92a('0x46')]['id']},'attributes':['id','dsn']})[_0xb92a('0x27')](handleEntityNotFound(_0x1b9ba5,null))[_0xb92a('0x27')](function(_0x480c4b){if(_0x480c4b){var _0x237e93=require(_0xb92a('0x54'))();_0x237e93[_0xb92a('0x55')](_0x480c4b[_0xb92a('0x56')]);_0x237e93[_0xb92a('0x57')]();return _0x480c4b;}})['then'](respondWithResult(_0x1b9ba5,null))[_0xb92a('0x44')](handleError(_0x1b9ba5,null));}; \ No newline at end of file +var _0xbf1c=['reject','save','then','destroy','get','ODBC','error','stack','name','send','index','SquareOdbc','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','update','body','dsn','odbc','openSync','closeSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x328399,_0x425986){var _0x9923f8=function(_0x685273){while(--_0x685273){_0x328399['push'](_0x328399['shift']());}};_0x9923f8(++_0x425986);}(_0xbf1c,0x8e));var _0xcbf1=function(_0x3c24e7,_0x2031f6){_0x3c24e7=_0x3c24e7-0x0;var _0x41cbe9=_0xbf1c[_0x3c24e7];return _0x41cbe9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcbf1('0x0'));var zipdir=require(_0xcbf1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbf1('0x2'));var moment=require(_0xcbf1('0x3'));var BPromise=require(_0xcbf1('0x4'));var Mustache=require(_0xcbf1('0x5'));var util=require(_0xcbf1('0x6'));var path=require('path');var sox=require(_0xcbf1('0x7'));var csv=require('to-csv');var ejs=require(_0xcbf1('0x8'));var fs=require('fs');var fs_extra=require(_0xcbf1('0x9'));var _=require(_0xcbf1('0xa'));var squel=require(_0xcbf1('0xb'));var crypto=require(_0xcbf1('0xc'));var jsforce=require(_0xcbf1('0xd'));var deskjs=require(_0xcbf1('0xe'));var toCsv=require(_0xcbf1('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcbf1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcbf1('0x11'));var as=require(_0xcbf1('0x12'));var hardwareService=require(_0xcbf1('0x13'));var logger=require(_0xcbf1('0x14'))(_0xcbf1('0x15'));var utils=require(_0xcbf1('0x16'));var config=require(_0xcbf1('0x17'));var licenseUtil=require(_0xcbf1('0x18'));var db=require(_0xcbf1('0x19'))['db'];function respondWithStatusCode(_0x31a296,_0x29750c){_0x29750c=_0x29750c||0xcc;return function(_0x380969){if(_0x380969){return _0x31a296[_0xcbf1('0x1a')](_0x29750c);}return _0x31a296[_0xcbf1('0x1b')](_0x29750c)[_0xcbf1('0x1c')]();};}function respondWithResult(_0x2cb3b9,_0x52dd74){_0x52dd74=_0x52dd74||0xc8;return function(_0x41cc27){if(_0x41cc27){return _0x2cb3b9[_0xcbf1('0x1b')](_0x52dd74)[_0xcbf1('0x1d')](_0x41cc27);}};}function respondWithFilteredResult(_0x21aa39,_0x56f733){return function(_0xb13f01){if(_0xb13f01){var _0x2ac802=typeof _0x56f733[_0xcbf1('0x1e')]===_0xcbf1('0x1f')&&typeof _0x56f733[_0xcbf1('0x20')]===_0xcbf1('0x1f');var _0x43b8bd=_0xb13f01[_0xcbf1('0x21')];var _0x170b29=_0x2ac802?0x0:_0x56f733['offset'];var _0x2ebd3b=_0x2ac802?_0xb13f01[_0xcbf1('0x21')]:_0x56f733['offset']+_0x56f733[_0xcbf1('0x20')];var _0x3d5a53;if(_0x2ebd3b>=_0x43b8bd){_0x2ebd3b=_0x43b8bd;_0x3d5a53=0xc8;}else{_0x3d5a53=0xce;}_0x21aa39[_0xcbf1('0x1b')](_0x3d5a53);return _0x21aa39[_0xcbf1('0x22')]('Content-Range',_0x170b29+'-'+_0x2ebd3b+'/'+_0x43b8bd)[_0xcbf1('0x1d')](_0xb13f01);}return null;};}function patchUpdates(_0xd52ce9){return function(_0x2c8712){try{jsonpatch[_0xcbf1('0x23')](_0x2c8712,_0xd52ce9,!![]);}catch(_0xf7c743){return BPromise[_0xcbf1('0x24')](_0xf7c743);}return _0x2c8712[_0xcbf1('0x25')]();};}function saveUpdates(_0x541758,_0x2b5f17){return function(_0x5be8bb){if(_0x5be8bb){return _0x5be8bb['update'](_0x541758)[_0xcbf1('0x26')](function(_0x33d67e){return _0x33d67e;});}return null;};}function removeEntity(_0x1322bb,_0x222270){return function(_0x1f940e){if(_0x1f940e){return _0x1f940e[_0xcbf1('0x27')]()['then'](function(){var _0x44cd32=_0x1f940e[_0xcbf1('0x28')]({'plain':!![]});var _0x4d8e38=_0xcbf1('0x29');return db['UserProfileResource'][_0xcbf1('0x27')]({'where':{'type':_0x4d8e38,'resourceId':_0x44cd32['id']}})[_0xcbf1('0x26')](function(){return _0x1f940e;});})[_0xcbf1('0x26')](function(){_0x1322bb[_0xcbf1('0x1b')](0xcc)[_0xcbf1('0x1c')]();});}};}function handleEntityNotFound(_0x583e71,_0x477b55){return function(_0x127135){if(!_0x127135){_0x583e71[_0xcbf1('0x1a')](0x194);}return _0x127135;};}function handleError(_0x38e8b2,_0x56e42c){_0x56e42c=_0x56e42c||0x1f4;return function(_0x339fba){logger[_0xcbf1('0x2a')](_0x339fba[_0xcbf1('0x2b')]);if(_0x339fba[_0xcbf1('0x2c')]){delete _0x339fba[_0xcbf1('0x2c')];}_0x38e8b2[_0xcbf1('0x1b')](_0x56e42c)[_0xcbf1('0x2d')](_0x339fba);};}exports[_0xcbf1('0x2e')]=function(_0x18ff99,_0x4f8181){var _0x5f5130={},_0xe3c853={},_0x2c33cc={'count':0x0,'rows':[]};var _0x319d73=_['map'](db[_0xcbf1('0x2f')]['rawAttributes'],function(_0x1b82d8){return{'name':_0x1b82d8[_0xcbf1('0x30')],'type':_0x1b82d8[_0xcbf1('0x31')][_0xcbf1('0x32')]};});_0xe3c853[_0xcbf1('0x33')]=_[_0xcbf1('0x34')](_0x319d73,_0xcbf1('0x2c'));_0xe3c853[_0xcbf1('0x35')]=_[_0xcbf1('0x36')](_0x18ff99[_0xcbf1('0x35')]);_0xe3c853['filters']=_[_0xcbf1('0x37')](_0xe3c853['model'],_0xe3c853[_0xcbf1('0x35')]);_0x5f5130[_0xcbf1('0x38')]=_[_0xcbf1('0x37')](_0xe3c853[_0xcbf1('0x33')],qs['fields'](_0x18ff99[_0xcbf1('0x35')][_0xcbf1('0x39')]));_0x5f5130[_0xcbf1('0x38')]=_0x5f5130[_0xcbf1('0x38')][_0xcbf1('0x3a')]?_0x5f5130['attributes']:_0xe3c853['model'];if(!_0x18ff99[_0xcbf1('0x35')][_0xcbf1('0x3b')](_0xcbf1('0x3c'))){_0x5f5130[_0xcbf1('0x20')]=qs['limit'](_0x18ff99[_0xcbf1('0x35')][_0xcbf1('0x20')]);_0x5f5130[_0xcbf1('0x1e')]=qs[_0xcbf1('0x1e')](_0x18ff99['query'][_0xcbf1('0x1e')]);}_0x5f5130[_0xcbf1('0x3d')]=qs['sort'](_0x18ff99[_0xcbf1('0x35')][_0xcbf1('0x3e')]);_0x5f5130[_0xcbf1('0x3f')]=qs['filters'](_[_0xcbf1('0x40')](_0x18ff99['query'],_0xe3c853[_0xcbf1('0x41')]),_0x319d73);if(_0x18ff99['query'][_0xcbf1('0x42')]){_0x5f5130[_0xcbf1('0x3f')]=_[_0xcbf1('0x43')](_0x5f5130[_0xcbf1('0x3f')],{'$or':_[_0xcbf1('0x34')](_0x319d73,function(_0x5a9649){if(_0x5a9649[_0xcbf1('0x31')]!=='VIRTUAL'){var _0x19749a={};_0x19749a[_0x5a9649[_0xcbf1('0x2c')]]={'$like':'%'+_0x18ff99[_0xcbf1('0x35')]['filter']+'%'};return _0x19749a;}})});}_0x5f5130=_[_0xcbf1('0x43')]({},_0x5f5130,_0x18ff99[_0xcbf1('0x44')]);var _0x58f0e4={'where':_0x5f5130['where']};return db[_0xcbf1('0x2f')]['count'](_0x58f0e4)[_0xcbf1('0x26')](function(_0x3e095b){_0x2c33cc[_0xcbf1('0x21')]=_0x3e095b;if(_0x18ff99[_0xcbf1('0x35')][_0xcbf1('0x45')]){_0x5f5130[_0xcbf1('0x46')]=[{'all':!![]}];}return db[_0xcbf1('0x2f')][_0xcbf1('0x47')](_0x5f5130);})[_0xcbf1('0x26')](function(_0x3380c0){_0x2c33cc[_0xcbf1('0x48')]=_0x3380c0;return _0x2c33cc;})[_0xcbf1('0x26')](respondWithFilteredResult(_0x4f8181,_0x5f5130))[_0xcbf1('0x49')](handleError(_0x4f8181,null));};exports['show']=function(_0x558215,_0x46b809){var _0xb6177f={'raw':!![],'where':{'id':_0x558215[_0xcbf1('0x4a')]['id']}},_0x37427c={};_0x37427c[_0xcbf1('0x33')]=_[_0xcbf1('0x36')](db[_0xcbf1('0x2f')][_0xcbf1('0x4b')]);_0x37427c[_0xcbf1('0x35')]=_[_0xcbf1('0x36')](_0x558215[_0xcbf1('0x35')]);_0x37427c[_0xcbf1('0x41')]=_[_0xcbf1('0x37')](_0x37427c[_0xcbf1('0x33')],_0x37427c[_0xcbf1('0x35')]);_0xb6177f[_0xcbf1('0x38')]=_[_0xcbf1('0x37')](_0x37427c[_0xcbf1('0x33')],qs[_0xcbf1('0x39')](_0x558215[_0xcbf1('0x35')][_0xcbf1('0x39')]));_0xb6177f[_0xcbf1('0x38')]=_0xb6177f[_0xcbf1('0x38')][_0xcbf1('0x3a')]?_0xb6177f[_0xcbf1('0x38')]:_0x37427c[_0xcbf1('0x33')];if(_0x558215[_0xcbf1('0x35')][_0xcbf1('0x45')]){_0xb6177f[_0xcbf1('0x46')]=[{'all':!![]}];}_0xb6177f=_['merge']({},_0xb6177f,_0x558215[_0xcbf1('0x44')]);return db[_0xcbf1('0x2f')][_0xcbf1('0x4c')](_0xb6177f)['then'](handleEntityNotFound(_0x46b809,null))[_0xcbf1('0x26')](respondWithResult(_0x46b809,null))['catch'](handleError(_0x46b809,null));};exports[_0xcbf1('0x4d')]=function(_0x34952a,_0x280024){return db[_0xcbf1('0x2f')]['create'](_0x34952a['body'],{})[_0xcbf1('0x26')](function(_0x368d9f){var _0x1aa729=_0x34952a[_0xcbf1('0x4e')]['get']({'plain':!![]});if(!_0x1aa729)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1aa729[_0xcbf1('0x4f')]===_0xcbf1('0x4e')){var _0x290d46=_0x368d9f[_0xcbf1('0x28')]({'plain':!![]});var _0x4f16a4=_0xcbf1('0x29');return db[_0xcbf1('0x50')]['find']({'where':{'name':_0x4f16a4,'userProfileId':_0x1aa729[_0xcbf1('0x51')]},'raw':!![]})[_0xcbf1('0x26')](function(_0x5c3a77){if(_0x5c3a77&&_0x5c3a77[_0xcbf1('0x52')]===0x0){return db['UserProfileResource'][_0xcbf1('0x4d')]({'name':_0x290d46[_0xcbf1('0x2c')],'resourceId':_0x290d46['id'],'type':_0x5c3a77[_0xcbf1('0x2c')],'sectionId':_0x5c3a77['id']},{})['then'](function(){return _0x368d9f;});}else{return _0x368d9f;}})[_0xcbf1('0x49')](function(_0x2d5a3a){logger[_0xcbf1('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d5a3a);throw _0x2d5a3a;});}return _0x368d9f;})[_0xcbf1('0x26')](respondWithResult(_0x280024,0xc9))[_0xcbf1('0x49')](handleError(_0x280024,null));};exports[_0xcbf1('0x53')]=function(_0x51b97d,_0x47a8ff){if(_0x51b97d[_0xcbf1('0x54')]['id']){delete _0x51b97d[_0xcbf1('0x54')]['id'];}return db[_0xcbf1('0x2f')]['find']({'where':{'id':_0x51b97d[_0xcbf1('0x4a')]['id']}})[_0xcbf1('0x26')](handleEntityNotFound(_0x47a8ff,null))[_0xcbf1('0x26')](saveUpdates(_0x51b97d[_0xcbf1('0x54')],null))['then'](respondWithResult(_0x47a8ff,null))['catch'](handleError(_0x47a8ff,null));};exports[_0xcbf1('0x27')]=function(_0x47f402,_0x27fcc7){return db[_0xcbf1('0x2f')]['find']({'where':{'id':_0x47f402[_0xcbf1('0x4a')]['id']}})[_0xcbf1('0x26')](handleEntityNotFound(_0x27fcc7,null))[_0xcbf1('0x26')](removeEntity(_0x27fcc7,null))[_0xcbf1('0x49')](handleError(_0x27fcc7,null));};exports['test']=function(_0x3d7257,_0x45b52f,_0x7f93ef){var _0x2e9272;return db[_0xcbf1('0x2f')][_0xcbf1('0x4c')]({'where':{'id':_0x3d7257[_0xcbf1('0x4a')]['id']},'attributes':['id',_0xcbf1('0x55')]})[_0xcbf1('0x26')](handleEntityNotFound(_0x45b52f,null))[_0xcbf1('0x26')](function(_0x5769aa){if(_0x5769aa){var _0x461dfc=require(_0xcbf1('0x56'))();_0x461dfc[_0xcbf1('0x57')](_0x5769aa[_0xcbf1('0x55')]);_0x461dfc[_0xcbf1('0x58')]();return _0x5769aa;}})[_0xcbf1('0x26')](respondWithResult(_0x45b52f,null))[_0xcbf1('0x49')](handleError(_0x45b52f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 9df9a85..9e18406 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 _0x8c37=['rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x437545,_0x4ab48b){var _0x408060=function(_0x564586){while(--_0x564586){_0x437545['push'](_0x437545['shift']());}};_0x408060(++_0x4ab48b);}(_0x8c37,0x1c2));var _0x78c3=function(_0x3c0d7c,_0x4f1312){_0x3c0d7c=_0x3c0d7c-0x0;var _0x4c6271=_0x8c37[_0x3c0d7c];return _0x4c6271;};'use strict';var _=require('lodash');var util=require(_0x78c3('0x0'));var logger=require(_0x78c3('0x1'))('api');var moment=require(_0x78c3('0x2'));var BPromise=require(_0x78c3('0x3'));var rp=require(_0x78c3('0x4'));var fs=require('fs');var path=require(_0x78c3('0x5'));var rimraf=require(_0x78c3('0x6'));var config=require(_0x78c3('0x7'));var attributes=require(_0x78c3('0x8'));module[_0x78c3('0x9')]=function(_0x29e821,_0xe7ff0a){return _0x29e821[_0x78c3('0xa')](_0x78c3('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x675d=['lodash','../../config/logger','api','path','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc'];(function(_0x35b205,_0x24e696){var _0x20ecb2=function(_0xead3ac){while(--_0xead3ac){_0x35b205['push'](_0x35b205['shift']());}};_0x20ecb2(++_0x24e696);}(_0x675d,0xd8));var _0xd675=function(_0xfcd857,_0x7f3ac2){_0xfcd857=_0xfcd857-0x0;var _0x600e05=_0x675d[_0xfcd857];return _0x600e05;};'use strict';var _=require(_0xd675('0x0'));var util=require('util');var logger=require(_0xd675('0x1'))(_0xd675('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd675('0x3'));var rimraf=require('rimraf');var config=require(_0xd675('0x4'));var attributes=require(_0xd675('0x5'));module['exports']=function(_0x3e8555,_0x188124){return _0x3e8555[_0xd675('0x6')](_0xd675('0x7'),attributes,{'tableName':_0xd675('0x8'),'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 ffcd46e..0251e70 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 _0x5e9f=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','ShowSquareOdbc','find','options','raw','where','attributes','include','model','map','debug','lodash','util','bluebird'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5e9f,0x171));var _0xf5e9=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5e9f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xf5e9('0x0'));var util=require(_0xf5e9('0x1'));var moment=require('moment');var BPromise=require(_0xf5e9('0x2'));var rs=require(_0xf5e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5e9('0x4'))['db'];var utils=require(_0xf5e9('0x5'));var logger=require(_0xf5e9('0x6'))(_0xf5e9('0x7'));var config=require(_0xf5e9('0x8'));var jayson=require(_0xf5e9('0x9'));var client=jayson[_0xf5e9('0xa')][_0xf5e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fa41f,_0xc9560b,_0x38a3e8){return new BPromise(function(_0x3e3630,_0x4b11ea){return client['request'](_0x2fa41f,_0x38a3e8)[_0xf5e9('0xc')](function(_0x5824c2){logger[_0xf5e9('0xd')]('SquareOdbc,\x20%s,\x20%s',_0xc9560b,_0xf5e9('0xe'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0xc9560b,_0xf5e9('0xe'),JSON[_0xf5e9('0xf')](_0x5824c2));if(_0x5824c2['error']){if(_0x5824c2[_0xf5e9('0x10')][_0xf5e9('0x11')]===0x1f4){logger[_0xf5e9('0x10')]('SquareOdbc,\x20%s,\x20%s',_0xc9560b,_0x5824c2[_0xf5e9('0x10')]['message']);return _0x4b11ea(_0x5824c2['error'][_0xf5e9('0x12')]);}logger['error'](_0xf5e9('0x13'),_0xc9560b,_0x5824c2[_0xf5e9('0x10')][_0xf5e9('0x12')]);return _0x3e3630(_0x5824c2[_0xf5e9('0x10')][_0xf5e9('0x12')]);}else{logger['info'](_0xf5e9('0x13'),_0xc9560b,_0xf5e9('0xe'));_0x3e3630(_0x5824c2[_0xf5e9('0x14')]['message']);}})['catch'](function(_0x5eec68){logger[_0xf5e9('0x10')]('SquareOdbc,\x20%s,\x20%s',_0xc9560b,_0x5eec68);_0x4b11ea(_0x5eec68);});});}exports[_0xf5e9('0x15')]=function(_0x31f7bd){var _0x4c8ec0=this;return new Promise(function(_0x5b4dc8,_0x1281d3){return db['SquareOdbc'][_0xf5e9('0x16')]({'raw':_0x31f7bd[_0xf5e9('0x17')]?_0x31f7bd['options'][_0xf5e9('0x18')]===undefined?!![]:![]:!![],'where':_0x31f7bd[_0xf5e9('0x17')]?_0x31f7bd[_0xf5e9('0x17')][_0xf5e9('0x19')]||null:null,'attributes':_0x31f7bd['options']?_0x31f7bd[_0xf5e9('0x17')][_0xf5e9('0x1a')]||null:null,'include':_0x31f7bd[_0xf5e9('0x17')]?_0x31f7bd[_0xf5e9('0x17')][_0xf5e9('0x1b')]?_['map'](_0x31f7bd[_0xf5e9('0x17')][_0xf5e9('0x1b')],function(_0x52d49d){return{'model':db[_0x52d49d[_0xf5e9('0x1c')]],'as':_0x52d49d['as'],'attributes':_0x52d49d[_0xf5e9('0x1a')],'include':_0x52d49d[_0xf5e9('0x1b')]?_[_0xf5e9('0x1d')](_0x52d49d[_0xf5e9('0x1b')],function(_0xe6b81e){return{'model':db[_0xe6b81e[_0xf5e9('0x1c')]],'as':_0xe6b81e['as'],'attributes':_0xe6b81e[_0xf5e9('0x1a')],'include':_0xe6b81e[_0xf5e9('0x1b')]?_[_0xf5e9('0x1d')](_0xe6b81e['include'],function(_0x4d1a4a){return{'model':db[_0x4d1a4a[_0xf5e9('0x1c')]],'as':_0x4d1a4a['as'],'attributes':_0x4d1a4a['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5e9('0xc')](function(_0x5b095d){logger[_0xf5e9('0xd')](_0xf5e9('0x15'),_0x31f7bd);logger[_0xf5e9('0x1e')](_0xf5e9('0x15'),_0x31f7bd,JSON['stringify'](_0x5b095d));_0x5b4dc8(_0x5b095d);})['catch'](function(_0x476a5c){logger[_0xf5e9('0x10')]('ShowSquareOdbc',_0x476a5c[_0xf5e9('0x12')],_0x31f7bd);_0x1281d3(_0x4c8ec0['error'](0x1f4,_0x476a5c[_0xf5e9('0x12')]));});});}; \ No newline at end of file +var _0xb368=['stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','error','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','attributes','include','map','model','debug'];(function(_0x4eb695,_0x2ba2be){var _0x3c7faf=function(_0x5856a6){while(--_0x5856a6){_0x4eb695['push'](_0x4eb695['shift']());}};_0x3c7faf(++_0x2ba2be);}(_0xb368,0x1e1));var _0x8b36=function(_0x259001,_0x2e2542){_0x259001=_0x259001-0x0;var _0x3ae63c=_0xb368[_0x259001];return _0x3ae63c;};'use strict';var _=require(_0x8b36('0x0'));var util=require(_0x8b36('0x1'));var moment=require('moment');var BPromise=require(_0x8b36('0x2'));var rs=require(_0x8b36('0x3'));var fs=require('fs');var Redis=require(_0x8b36('0x4'));var db=require(_0x8b36('0x5'))['db'];var utils=require(_0x8b36('0x6'));var logger=require('../../config/logger')(_0x8b36('0x7'));var config=require(_0x8b36('0x8'));var jayson=require(_0x8b36('0x9'));var client=jayson[_0x8b36('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16fff1,_0x66bea,_0x47fc1f){return new BPromise(function(_0x38b427,_0x386bc6){return client[_0x8b36('0xb')](_0x16fff1,_0x47fc1f)[_0x8b36('0xc')](function(_0x36a238){logger[_0x8b36('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x66bea,'request\x20sent');logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x66bea,_0x8b36('0xe'),JSON['stringify'](_0x36a238));if(_0x36a238[_0x8b36('0xf')]){if(_0x36a238[_0x8b36('0xf')]['code']===0x1f4){logger[_0x8b36('0xf')](_0x8b36('0x10'),_0x66bea,_0x36a238['error']['message']);return _0x386bc6(_0x36a238[_0x8b36('0xf')][_0x8b36('0x11')]);}logger[_0x8b36('0xf')](_0x8b36('0x10'),_0x66bea,_0x36a238[_0x8b36('0xf')][_0x8b36('0x11')]);return _0x38b427(_0x36a238[_0x8b36('0xf')][_0x8b36('0x11')]);}else{logger['info'](_0x8b36('0x10'),_0x66bea,_0x8b36('0xe'));_0x38b427(_0x36a238[_0x8b36('0x12')][_0x8b36('0x11')]);}})[_0x8b36('0x13')](function(_0x48685a){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x66bea,_0x48685a);_0x386bc6(_0x48685a);});});}exports[_0x8b36('0x14')]=function(_0xe4721b){var _0x45de54=this;return new Promise(function(_0x17e603,_0x15be81){return db[_0x8b36('0x15')]['find']({'raw':_0xe4721b[_0x8b36('0x16')]?_0xe4721b[_0x8b36('0x16')][_0x8b36('0x17')]===undefined?!![]:![]:!![],'where':_0xe4721b['options']?_0xe4721b[_0x8b36('0x16')]['where']||null:null,'attributes':_0xe4721b['options']?_0xe4721b['options'][_0x8b36('0x18')]||null:null,'include':_0xe4721b[_0x8b36('0x16')]?_0xe4721b[_0x8b36('0x16')][_0x8b36('0x19')]?_[_0x8b36('0x1a')](_0xe4721b[_0x8b36('0x16')][_0x8b36('0x19')],function(_0x71a3f8){return{'model':db[_0x71a3f8['model']],'as':_0x71a3f8['as'],'attributes':_0x71a3f8[_0x8b36('0x18')],'include':_0x71a3f8['include']?_[_0x8b36('0x1a')](_0x71a3f8[_0x8b36('0x19')],function(_0x390e71){return{'model':db[_0x390e71[_0x8b36('0x1b')]],'as':_0x390e71['as'],'attributes':_0x390e71[_0x8b36('0x18')],'include':_0x390e71[_0x8b36('0x19')]?_[_0x8b36('0x1a')](_0x390e71[_0x8b36('0x19')],function(_0x232940){return{'model':db[_0x232940[_0x8b36('0x1b')]],'as':_0x232940['as'],'attributes':_0x232940[_0x8b36('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8b36('0xc')](function(_0x2af9da){logger['info']('ShowSquareOdbc',_0xe4721b);logger[_0x8b36('0x1c')]('ShowSquareOdbc',_0xe4721b,JSON[_0x8b36('0x1d')](_0x2af9da));_0x17e603(_0x2af9da);})[_0x8b36('0x13')](function(_0x1dc8f1){logger['error'](_0x8b36('0x14'),_0x1dc8f1['message'],_0xe4721b);_0x15be81(_0x45de54[_0x8b36('0xf')](0x1f4,_0x1dc8f1['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 90e23e6..2e1da84 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 _0xf831=['create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf831,0x65));var _0x1f83=function(_0x4fed54,_0x5da189){_0x4fed54=_0x4fed54-0x0;var _0x5b3a03=_0xf831[_0x4fed54];return _0x5b3a03;};'use strict';var multer=require('multer');var util=require(_0x1f83('0x0'));var path=require(_0x1f83('0x1'));var timeout=require(_0x1f83('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1f83('0x3'));var auth=require(_0x1f83('0x4'));var interaction=require(_0x1f83('0x5'));var config=require('../../config/environment');var controller=require(_0x1f83('0x6'));router[_0x1f83('0x7')]('/',auth[_0x1f83('0x8')](),controller[_0x1f83('0x9')]);router[_0x1f83('0x7')](_0x1f83('0xa'),auth[_0x1f83('0x8')](),controller[_0x1f83('0xb')]);router[_0x1f83('0xc')]('/',auth[_0x1f83('0x8')](),controller[_0x1f83('0xd')]);router[_0x1f83('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1f83('0xf')]);router[_0x1f83('0x10')]('/:id',auth[_0x1f83('0x8')](),controller[_0x1f83('0x11')]);module[_0x1f83('0x12')]=router; \ No newline at end of file +var _0x5e00=['/:id','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put'];(function(_0x40ef1c,_0x5916a9){var _0x1858b3=function(_0x2b8ddb){while(--_0x2b8ddb){_0x40ef1c['push'](_0x40ef1c['shift']());}};_0x1858b3(++_0x5916a9);}(_0x5e00,0x1cb));var _0x05e0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5e00[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x05e0('0x0'));var util=require(_0x05e0('0x1'));var path=require(_0x05e0('0x2'));var timeout=require(_0x05e0('0x3'));var express=require('express');var router=express[_0x05e0('0x4')]();var fs_extra=require(_0x05e0('0x5'));var auth=require(_0x05e0('0x6'));var interaction=require(_0x05e0('0x7'));var config=require(_0x05e0('0x8'));var controller=require('./squareProject.controller');router[_0x05e0('0x9')]('/',auth[_0x05e0('0xa')](),controller[_0x05e0('0xb')]);router[_0x05e0('0x9')]('/:id',auth[_0x05e0('0xa')](),controller[_0x05e0('0xc')]);router[_0x05e0('0xd')]('/',auth['isAuthenticated'](),controller[_0x05e0('0xe')]);router[_0x05e0('0xf')](_0x05e0('0x10'),auth['isAuthenticated'](),controller[_0x05e0('0x11')]);router['delete'](_0x05e0('0x10'),auth[_0x05e0('0xa')](),controller['destroy']);module[_0x05e0('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 9e01970..247741e 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 _0xd0e4=['getDataValue','preproduction','production','utf8','DATE','sequelize','exports','STRING','name','BLOB','long'];(function(_0x48f3dc,_0x3d7afb){var _0x1a4dc3=function(_0xa233d6){while(--_0xa233d6){_0x48f3dc['push'](_0x48f3dc['shift']());}};_0x1a4dc3(++_0x3d7afb);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x5bd8b3,_0x26a7ac){_0x5bd8b3=_0x5bd8b3-0x0;var _0x323c25=_0xd0e4[_0x5bd8b3];return _0x323c25;};'use strict';var Sequelize=require(_0x4d0e('0x0'));module[_0x4d0e('0x1')]={'name':{'type':Sequelize[_0x4d0e('0x2')],'unique':_0x4d0e('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x4d0e('0x4')](_0x4d0e('0x5')),'get':function(){if(this[_0x4d0e('0x6')](_0x4d0e('0x7'))){return this[_0x4d0e('0x6')]('preproduction')['toString']('utf8');}}},'production':{'type':Sequelize[_0x4d0e('0x4')](_0x4d0e('0x5')),'get':function(){if(this['getDataValue'](_0x4d0e('0x8'))){return this[_0x4d0e('0x6')]('production')['toString'](_0x4d0e('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x4d0e('0xa')]}}; \ No newline at end of file +var _0x0e79=['BLOB','long','getDataValue','preproduction','toString','utf8','DATE','sequelize','exports','STRING','name'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0e79,0xac));var _0x90e7=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x0e79[_0xf0bcac];return _0x4e4c65;};'use strict';var Sequelize=require(_0x90e7('0x0'));module[_0x90e7('0x1')]={'name':{'type':Sequelize[_0x90e7('0x2')],'unique':_0x90e7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x90e7('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x90e7('0x4')](_0x90e7('0x5')),'get':function(){if(this[_0x90e7('0x6')](_0x90e7('0x7'))){return this[_0x90e7('0x6')](_0x90e7('0x7'))[_0x90e7('0x8')](_0x90e7('0x9'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x90e7('0x6')]('production')){return this[_0x90e7('0x6')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x90e7('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 180dde9..5168c72 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 _0xbebe=['map','filters','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','SquareProject','findAll','rows','catch','show','keys','includeAll','find','body','user','role','UserProfileSection','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','limit','undefined','count','offset','set','Content-Range','destroy','then','get','UserProfileResource','publish','agi','stringify','end','sendStatus','stack','name','rawAttributes','fieldName','type','model'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbebe,0x1c1));var _0xebeb=function(_0x3d5f86,_0x16f9c8){_0x3d5f86=_0x3d5f86-0x0;var _0x90b14d=_0xbebe[_0x3d5f86];return _0x90b14d;};'use strict';var _=require(_0xebeb('0x0'));var Redis=require(_0xebeb('0x1'));var qs=require(_0xebeb('0x2'));var logger=require(_0xebeb('0x3'))(_0xebeb('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xebeb('0x5')]=_[_0xebeb('0x6')](config[_0xebeb('0x5')],{'host':_0xebeb('0x7'),'port':0x18eb});var socket=require(_0xebeb('0x8'))(new Redis(config[_0xebeb('0x5')]));require(_0xebeb('0x9'))[_0xebeb('0xa')](socket);function respondWithResult(_0x3b9666,_0x8e3361){_0x8e3361=_0x8e3361||0xc8;return function(_0x4bc306){if(_0x4bc306){return _0x3b9666[_0xebeb('0xb')](_0x8e3361)[_0xebeb('0xc')](_0x4bc306);}};}function respondWithFilteredResult(_0x59661a,_0x21eb30){return function(_0x1c1255){if(_0x1c1255){var _0x2653f1=typeof _0x21eb30['offset']==='undefined'&&typeof _0x21eb30[_0xebeb('0xd')]===_0xebeb('0xe');var _0x4e6ac0=_0x1c1255[_0xebeb('0xf')];var _0x325142=_0x2653f1?0x0:_0x21eb30[_0xebeb('0x10')];var _0xdf7b26=_0x2653f1?_0x1c1255['count']:_0x21eb30[_0xebeb('0x10')]+_0x21eb30[_0xebeb('0xd')];var _0x3ab814;if(_0xdf7b26>=_0x4e6ac0){_0xdf7b26=_0x4e6ac0;_0x3ab814=0xc8;}else{_0x3ab814=0xce;}_0x59661a['status'](_0x3ab814);return _0x59661a[_0xebeb('0x11')](_0xebeb('0x12'),_0x325142+'-'+_0xdf7b26+'/'+_0x4e6ac0)[_0xebeb('0xc')](_0x1c1255);}return null;};}function saveUpdates(_0x28f392){return function(_0x88995a){if(_0x88995a){return _0x88995a['update'](_0x28f392)['then'](function(_0x302e60){return _0x302e60;});}return null;};}function removeEntity(_0x5d1c58){return function(_0x3d0a39){if(_0x3d0a39){return _0x3d0a39[_0xebeb('0x13')]()[_0xebeb('0x14')](function(){var _0x11c78a=_0x3d0a39[_0xebeb('0x15')]({'plain':!![]});var _0x39dc75='SquareProjects';return db[_0xebeb('0x16')]['destroy']({'where':{'type':_0x39dc75,'resourceId':_0x11c78a['id']}})['then'](function(){return _0x3d0a39;});})['then'](function(){var _0x706c1f=new Redis(config[_0xebeb('0x5')]);_0x706c1f[_0xebeb('0x17')](_0xebeb('0x18'),JSON[_0xebeb('0x19')]({'id':_0x3d0a39['id'],'deleted':!![]}));})[_0xebeb('0x14')](function(){_0x5d1c58[_0xebeb('0xb')](0xcc)[_0xebeb('0x1a')]();});}};}function handleEntityNotFound(_0x283e70){return function(_0x507619){if(!_0x507619){_0x283e70[_0xebeb('0x1b')](0x194);}return _0x507619;};}function handleError(_0x27d377,_0x4d8ce){_0x4d8ce=_0x4d8ce||0x1f4;return function(_0x311afd){logger['error'](_0x311afd[_0xebeb('0x1c')]);if(_0x311afd[_0xebeb('0x1d')]){delete _0x311afd['name'];}_0x27d377['status'](_0x4d8ce)['send'](_0x311afd);};}exports['index']=function(_0x436e41,_0x54c396){var _0x2b25c7={},_0x4a126e={},_0x58f95f={'count':0x0,'rows':[]};var _0x54873c=_['map'](db['SquareProject'][_0xebeb('0x1e')],function(_0x35754f){return{'name':_0x35754f[_0xebeb('0x1f')],'type':_0x35754f[_0xebeb('0x20')]['key']};});_0x4a126e[_0xebeb('0x21')]=_[_0xebeb('0x22')](_0x54873c,_0xebeb('0x1d'));_0x4a126e['query']=_['keys'](_0x436e41['query']);_0x4a126e[_0xebeb('0x23')]=_['intersection'](_0x4a126e[_0xebeb('0x21')],_0x4a126e[_0xebeb('0x24')]);_0x2b25c7['attributes']=_[_0xebeb('0x25')](_0x4a126e[_0xebeb('0x21')],qs['fields'](_0x436e41['query'][_0xebeb('0x26')]));_0x2b25c7['attributes']=_0x2b25c7[_0xebeb('0x27')][_0xebeb('0x28')]?_0x2b25c7['attributes']:_0x4a126e[_0xebeb('0x21')];if(!_0x436e41[_0xebeb('0x24')]['hasOwnProperty'](_0xebeb('0x29'))){_0x2b25c7[_0xebeb('0xd')]=qs['limit'](_0x436e41[_0xebeb('0x24')][_0xebeb('0xd')]);_0x2b25c7['offset']=qs['offset'](_0x436e41[_0xebeb('0x24')][_0xebeb('0x10')]);}_0x2b25c7[_0xebeb('0x2a')]=qs[_0xebeb('0x2b')](_0x436e41[_0xebeb('0x24')][_0xebeb('0x2b')]);_0x2b25c7[_0xebeb('0x2c')]=qs[_0xebeb('0x23')](_[_0xebeb('0x2d')](_0x436e41[_0xebeb('0x24')],_0x4a126e['filters']),_0x54873c);if(_0x436e41[_0xebeb('0x24')]['filter']){_0x2b25c7[_0xebeb('0x2c')]=_[_0xebeb('0x2e')](_0x2b25c7['where'],{'$or':_[_0xebeb('0x22')](_0x54873c,function(_0x477c60){if(_0x477c60['type']!==_0xebeb('0x2f')){var _0x3a8db4={};_0x3a8db4[_0x477c60['name']]={'$like':'%'+_0x436e41[_0xebeb('0x24')][_0xebeb('0x30')]+'%'};return _0x3a8db4;}})});}_0x2b25c7=_[_0xebeb('0x2e')]({},_0x2b25c7,_0x436e41[_0xebeb('0x31')]);var _0x65e862={'where':_0x2b25c7[_0xebeb('0x2c')]};return db['SquareProject']['count'](_0x65e862)['then'](function(_0xba9bc1){_0x58f95f[_0xebeb('0xf')]=_0xba9bc1;if(_0x436e41[_0xebeb('0x24')]['includeAll']){_0x2b25c7[_0xebeb('0x32')]=[{'all':!![]}];}return db[_0xebeb('0x33')][_0xebeb('0x34')](_0x2b25c7);})[_0xebeb('0x14')](function(_0x1c9152){_0x58f95f[_0xebeb('0x35')]=_0x1c9152;return _0x58f95f;})[_0xebeb('0x14')](respondWithFilteredResult(_0x54c396,_0x2b25c7))[_0xebeb('0x36')](handleError(_0x54c396,null));};exports[_0xebeb('0x37')]=function(_0x1336b5,_0x39ba96){var _0x538351={'raw':![],'where':{'id':_0x1336b5['params']['id']}},_0x2bf781={};_0x2bf781[_0xebeb('0x21')]=_['keys'](db['SquareProject'][_0xebeb('0x1e')]);_0x2bf781[_0xebeb('0x24')]=_[_0xebeb('0x38')](_0x1336b5[_0xebeb('0x24')]);_0x2bf781[_0xebeb('0x23')]=_[_0xebeb('0x25')](_0x2bf781[_0xebeb('0x21')],_0x2bf781[_0xebeb('0x24')]);_0x538351['attributes']=_[_0xebeb('0x25')](_0x2bf781['model'],qs[_0xebeb('0x26')](_0x1336b5[_0xebeb('0x24')][_0xebeb('0x26')]));_0x538351[_0xebeb('0x27')]=_0x538351[_0xebeb('0x27')]['length']?_0x538351['attributes']:_0x2bf781[_0xebeb('0x21')];if(_0x1336b5[_0xebeb('0x24')][_0xebeb('0x39')]){_0x538351['include']=[{'all':!![]}];}_0x538351=_[_0xebeb('0x2e')]({},_0x538351,_0x1336b5[_0xebeb('0x31')]);return db[_0xebeb('0x33')][_0xebeb('0x3a')](_0x538351)[_0xebeb('0x14')](handleEntityNotFound(_0x39ba96,null))[_0xebeb('0x14')](respondWithResult(_0x39ba96,null))['catch'](handleError(_0x39ba96,null));};exports['create']=function(_0x4d39d9,_0x4876d8){return db['SquareProject']['create'](_0x4d39d9[_0xebeb('0x3b')],{})['then'](function(_0x121be5){var _0x10f0ad=_0x4d39d9[_0xebeb('0x3c')][_0xebeb('0x15')]({'plain':!![]});if(!_0x10f0ad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10f0ad[_0xebeb('0x3d')]===_0xebeb('0x3c')){var _0x2f4265=_0x121be5[_0xebeb('0x15')]({'plain':!![]});var _0x7cb2f8='SquareProjects';return db[_0xebeb('0x3e')][_0xebeb('0x3a')]({'where':{'name':_0x7cb2f8,'userProfileId':_0x10f0ad[_0xebeb('0x3f')]},'raw':!![]})[_0xebeb('0x14')](function(_0x25146d){if(_0x25146d&&_0x25146d['autoAssociation']===0x0){return db[_0xebeb('0x16')][_0xebeb('0x40')]({'name':_0x2f4265[_0xebeb('0x1d')],'resourceId':_0x2f4265['id'],'type':_0x25146d[_0xebeb('0x1d')],'sectionId':_0x25146d['id']},{})[_0xebeb('0x14')](function(){return _0x121be5;});}else{return _0x121be5;}})[_0xebeb('0x36')](function(_0x16fd92){logger[_0xebeb('0x41')](_0xebeb('0x42'),_0x16fd92);throw _0x16fd92;});}return _0x121be5;})['then'](respondWithResult(_0x4876d8,0xc9))[_0xebeb('0x36')](handleError(_0x4876d8,null));};exports[_0xebeb('0x43')]=function(_0x2a30ac,_0x572e0d){if(_0x2a30ac[_0xebeb('0x3b')]['id']){delete _0x2a30ac[_0xebeb('0x3b')]['id'];}return db[_0xebeb('0x33')][_0xebeb('0x3a')]({'where':{'id':_0x2a30ac[_0xebeb('0x44')]['id']}})[_0xebeb('0x14')](handleEntityNotFound(_0x572e0d,null))[_0xebeb('0x14')](saveUpdates(_0x2a30ac[_0xebeb('0x3b')],null))[_0xebeb('0x14')](function(_0x2ff195){if(!_0x2ff195)return;var _0x40a115=_0x2ff195['get']({'plain':!![]});return _0x40a115;})[_0xebeb('0x14')](function(_0x5d4069){var _0x3efeec=new Redis(config['redis']);_0x3efeec[_0xebeb('0x17')](_0xebeb('0x18'),JSON[_0xebeb('0x19')](_[_0xebeb('0x2d')](_0x5d4069,['id',_0xebeb('0x1d'),'production'])));return _0x5d4069;})[_0xebeb('0x14')](respondWithResult(_0x572e0d,null))[_0xebeb('0x36')](handleError(_0x572e0d,null));};exports['destroy']=function(_0x18d9a7,_0x3868f7){return db[_0xebeb('0x33')][_0xebeb('0x3a')]({'where':{'id':_0x18d9a7[_0xebeb('0x44')]['id']}})[_0xebeb('0x14')](handleEntityNotFound(_0x3868f7,null))[_0xebeb('0x14')](removeEntity(_0x3868f7,null))[_0xebeb('0x36')](handleError(_0x3868f7,null));}; \ No newline at end of file +var _0x85d9=['query','keys','filters','intersection','model','fields','attributes','nolimit','limit','order','sort','where','pick','merge','includeAll','findAll','rows','catch','show','params','length','include','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','publish','agi','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','status','json','offset','undefined','count','set','Content-Range','update','then','destroy','UserProfileResource','sendStatus','error','name','index','map','SquareProject','rawAttributes','fieldName','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85d9,0x15e));var _0x985d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x85d9[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x985d('0x0'));var Redis=require(_0x985d('0x1'));var qs=require(_0x985d('0x2'));var logger=require(_0x985d('0x3'))(_0x985d('0x4'));var config=require('../../config/environment');var db=require(_0x985d('0x5'))['db'];config[_0x985d('0x6')]=_['defaults'](config[_0x985d('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x985d('0x7'))(new Redis(config[_0x985d('0x6')]));require('./squareProject.socket')['register'](socket);function respondWithResult(_0x6eb76d,_0x13ef2b){_0x13ef2b=_0x13ef2b||0xc8;return function(_0x196a78){if(_0x196a78){return _0x6eb76d[_0x985d('0x8')](_0x13ef2b)[_0x985d('0x9')](_0x196a78);}};}function respondWithFilteredResult(_0x1ce5f7,_0x3ff007){return function(_0x480dff){if(_0x480dff){var _0xe3053b=typeof _0x3ff007[_0x985d('0xa')]===_0x985d('0xb')&&typeof _0x3ff007['limit']===_0x985d('0xb');var _0x46b093=_0x480dff[_0x985d('0xc')];var _0x5f28cc=_0xe3053b?0x0:_0x3ff007[_0x985d('0xa')];var _0x1fc986=_0xe3053b?_0x480dff[_0x985d('0xc')]:_0x3ff007[_0x985d('0xa')]+_0x3ff007['limit'];var _0x18833c;if(_0x1fc986>=_0x46b093){_0x1fc986=_0x46b093;_0x18833c=0xc8;}else{_0x18833c=0xce;}_0x1ce5f7[_0x985d('0x8')](_0x18833c);return _0x1ce5f7[_0x985d('0xd')](_0x985d('0xe'),_0x5f28cc+'-'+_0x1fc986+'/'+_0x46b093)['json'](_0x480dff);}return null;};}function saveUpdates(_0x139319){return function(_0x1f08dd){if(_0x1f08dd){return _0x1f08dd[_0x985d('0xf')](_0x139319)[_0x985d('0x10')](function(_0x165233){return _0x165233;});}return null;};}function removeEntity(_0x221a53){return function(_0x409029){if(_0x409029){return _0x409029[_0x985d('0x11')]()[_0x985d('0x10')](function(){var _0x4f2ecb=_0x409029['get']({'plain':!![]});var _0x3063b1='SquareProjects';return db[_0x985d('0x12')][_0x985d('0x11')]({'where':{'type':_0x3063b1,'resourceId':_0x4f2ecb['id']}})[_0x985d('0x10')](function(){return _0x409029;});})[_0x985d('0x10')](function(){var _0x52ed73=new Redis(config['redis']);_0x52ed73['publish']('agi',JSON['stringify']({'id':_0x409029['id'],'deleted':!![]}));})[_0x985d('0x10')](function(){_0x221a53[_0x985d('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ab3c0){return function(_0x331cd6){if(!_0x331cd6){_0x1ab3c0[_0x985d('0x13')](0x194);}return _0x331cd6;};}function handleError(_0x390329,_0x1ebdf9){_0x1ebdf9=_0x1ebdf9||0x1f4;return function(_0x2f4fa0){logger[_0x985d('0x14')](_0x2f4fa0['stack']);if(_0x2f4fa0[_0x985d('0x15')]){delete _0x2f4fa0[_0x985d('0x15')];}_0x390329[_0x985d('0x8')](_0x1ebdf9)['send'](_0x2f4fa0);};}exports[_0x985d('0x16')]=function(_0x5b9ef2,_0x2817ee){var _0x374667={},_0x5861f3={},_0x4523d1={'count':0x0,'rows':[]};var _0x1fc337=_[_0x985d('0x17')](db[_0x985d('0x18')][_0x985d('0x19')],function(_0x74bda8){return{'name':_0x74bda8[_0x985d('0x1a')],'type':_0x74bda8[_0x985d('0x1b')]['key']};});_0x5861f3['model']=_[_0x985d('0x17')](_0x1fc337,_0x985d('0x15'));_0x5861f3[_0x985d('0x1c')]=_[_0x985d('0x1d')](_0x5b9ef2[_0x985d('0x1c')]);_0x5861f3[_0x985d('0x1e')]=_[_0x985d('0x1f')](_0x5861f3[_0x985d('0x20')],_0x5861f3[_0x985d('0x1c')]);_0x374667['attributes']=_[_0x985d('0x1f')](_0x5861f3[_0x985d('0x20')],qs[_0x985d('0x21')](_0x5b9ef2[_0x985d('0x1c')]['fields']));_0x374667[_0x985d('0x22')]=_0x374667['attributes']['length']?_0x374667[_0x985d('0x22')]:_0x5861f3[_0x985d('0x20')];if(!_0x5b9ef2['query']['hasOwnProperty'](_0x985d('0x23'))){_0x374667[_0x985d('0x24')]=qs[_0x985d('0x24')](_0x5b9ef2[_0x985d('0x1c')]['limit']);_0x374667[_0x985d('0xa')]=qs['offset'](_0x5b9ef2[_0x985d('0x1c')][_0x985d('0xa')]);}_0x374667[_0x985d('0x25')]=qs[_0x985d('0x26')](_0x5b9ef2[_0x985d('0x1c')][_0x985d('0x26')]);_0x374667[_0x985d('0x27')]=qs[_0x985d('0x1e')](_[_0x985d('0x28')](_0x5b9ef2[_0x985d('0x1c')],_0x5861f3['filters']),_0x1fc337);if(_0x5b9ef2[_0x985d('0x1c')]['filter']){_0x374667[_0x985d('0x27')]=_['merge'](_0x374667[_0x985d('0x27')],{'$or':_[_0x985d('0x17')](_0x1fc337,function(_0x144fc1){if(_0x144fc1[_0x985d('0x1b')]!=='VIRTUAL'){var _0x52b9bc={};_0x52b9bc[_0x144fc1[_0x985d('0x15')]]={'$like':'%'+_0x5b9ef2[_0x985d('0x1c')]['filter']+'%'};return _0x52b9bc;}})});}_0x374667=_[_0x985d('0x29')]({},_0x374667,_0x5b9ef2['options']);var _0x221e72={'where':_0x374667[_0x985d('0x27')]};return db[_0x985d('0x18')][_0x985d('0xc')](_0x221e72)[_0x985d('0x10')](function(_0xa76a56){_0x4523d1[_0x985d('0xc')]=_0xa76a56;if(_0x5b9ef2[_0x985d('0x1c')][_0x985d('0x2a')]){_0x374667['include']=[{'all':!![]}];}return db[_0x985d('0x18')][_0x985d('0x2b')](_0x374667);})['then'](function(_0x16648f){_0x4523d1[_0x985d('0x2c')]=_0x16648f;return _0x4523d1;})['then'](respondWithFilteredResult(_0x2817ee,_0x374667))[_0x985d('0x2d')](handleError(_0x2817ee,null));};exports[_0x985d('0x2e')]=function(_0x4de710,_0xc8c1d6){var _0x4afbf2={'raw':![],'where':{'id':_0x4de710[_0x985d('0x2f')]['id']}},_0x512ce0={};_0x512ce0['model']=_[_0x985d('0x1d')](db[_0x985d('0x18')][_0x985d('0x19')]);_0x512ce0['query']=_['keys'](_0x4de710['query']);_0x512ce0[_0x985d('0x1e')]=_['intersection'](_0x512ce0[_0x985d('0x20')],_0x512ce0[_0x985d('0x1c')]);_0x4afbf2[_0x985d('0x22')]=_['intersection'](_0x512ce0[_0x985d('0x20')],qs['fields'](_0x4de710['query'][_0x985d('0x21')]));_0x4afbf2['attributes']=_0x4afbf2[_0x985d('0x22')][_0x985d('0x30')]?_0x4afbf2[_0x985d('0x22')]:_0x512ce0['model'];if(_0x4de710[_0x985d('0x1c')]['includeAll']){_0x4afbf2[_0x985d('0x31')]=[{'all':!![]}];}_0x4afbf2=_[_0x985d('0x29')]({},_0x4afbf2,_0x4de710['options']);return db[_0x985d('0x18')]['find'](_0x4afbf2)[_0x985d('0x10')](handleEntityNotFound(_0xc8c1d6,null))[_0x985d('0x10')](respondWithResult(_0xc8c1d6,null))[_0x985d('0x2d')](handleError(_0xc8c1d6,null));};exports[_0x985d('0x32')]=function(_0x400c74,_0x21b2b4){return db['SquareProject'][_0x985d('0x32')](_0x400c74[_0x985d('0x33')],{})[_0x985d('0x10')](function(_0x63dd9f){var _0x4b0c5d=_0x400c74[_0x985d('0x34')][_0x985d('0x35')]({'plain':!![]});if(!_0x4b0c5d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b0c5d[_0x985d('0x36')]===_0x985d('0x34')){var _0x302087=_0x63dd9f[_0x985d('0x35')]({'plain':!![]});var _0x4e3b3f='SquareProjects';return db[_0x985d('0x37')][_0x985d('0x38')]({'where':{'name':_0x4e3b3f,'userProfileId':_0x4b0c5d[_0x985d('0x39')]},'raw':!![]})[_0x985d('0x10')](function(_0x5da536){if(_0x5da536&&_0x5da536[_0x985d('0x3a')]===0x0){return db[_0x985d('0x12')][_0x985d('0x32')]({'name':_0x302087['name'],'resourceId':_0x302087['id'],'type':_0x5da536[_0x985d('0x15')],'sectionId':_0x5da536['id']},{})[_0x985d('0x10')](function(){return _0x63dd9f;});}else{return _0x63dd9f;}})[_0x985d('0x2d')](function(_0x5297d1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5297d1);throw _0x5297d1;});}return _0x63dd9f;})[_0x985d('0x10')](respondWithResult(_0x21b2b4,0xc9))[_0x985d('0x2d')](handleError(_0x21b2b4,null));};exports[_0x985d('0xf')]=function(_0x4d50fd,_0x1232b0){if(_0x4d50fd[_0x985d('0x33')]['id']){delete _0x4d50fd[_0x985d('0x33')]['id'];}return db['SquareProject'][_0x985d('0x38')]({'where':{'id':_0x4d50fd[_0x985d('0x2f')]['id']}})[_0x985d('0x10')](handleEntityNotFound(_0x1232b0,null))['then'](saveUpdates(_0x4d50fd[_0x985d('0x33')],null))[_0x985d('0x10')](function(_0x20308c){if(!_0x20308c)return;var _0x4d8c4e=_0x20308c[_0x985d('0x35')]({'plain':!![]});return _0x4d8c4e;})[_0x985d('0x10')](function(_0x1a181a){var _0x11350d=new Redis(config[_0x985d('0x6')]);_0x11350d[_0x985d('0x3b')](_0x985d('0x3c'),JSON[_0x985d('0x3d')](_[_0x985d('0x28')](_0x1a181a,['id',_0x985d('0x15'),_0x985d('0x3e')])));return _0x1a181a;})[_0x985d('0x10')](respondWithResult(_0x1232b0,null))[_0x985d('0x2d')](handleError(_0x1232b0,null));};exports[_0x985d('0x11')]=function(_0x270dd4,_0x53d0ff){return db[_0x985d('0x18')][_0x985d('0x38')]({'where':{'id':_0x270dd4[_0x985d('0x2f')]['id']}})[_0x985d('0x10')](handleEntityNotFound(_0x53d0ff,null))['then'](removeEntity(_0x53d0ff,null))[_0x985d('0x2d')](handleError(_0x53d0ff,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e17c697..68ababb 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 _0xa0f2=['hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4fdc46,_0x2a3759){var _0x2c178a=function(_0x59ead9){while(--_0x59ead9){_0x4fdc46['push'](_0x4fdc46['shift']());}};_0x2c178a(++_0x2a3759);}(_0xa0f2,0x16a));var _0x2a0f=function(_0x5be8ac,_0x1a9d12){_0x5be8ac=_0x5be8ac-0x0;var _0x2afdfd=_0xa0f2[_0x5be8ac];return _0x2afdfd;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x2a0f('0x0'))['db'][_0x2a0f('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2a0f('0x2')](0x0);var events={'afterCreate':_0x2a0f('0x3'),'afterUpdate':_0x2a0f('0x4'),'afterDestroy':_0x2a0f('0x5')};function emitEvent(_0x5cd9ca){return function(_0x3b2d88,_0x10445f,_0x4906af){SquareProjectEvents[_0x2a0f('0x6')](_0x5cd9ca+':'+_0x3b2d88['id'],_0x3b2d88);SquareProjectEvents[_0x2a0f('0x6')](_0x5cd9ca,_0x3b2d88);_0x4906af(null);};}for(var e in events){if(events[_0x2a0f('0x7')](e)){var event=events[e];SquareProject[_0x2a0f('0x8')](e,emitEvent(event));}}module[_0x2a0f('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xa45f=['SquareProject','setMaxListeners','update','remove','emit','exports'];(function(_0x23883d,_0x3c46b8){var _0xb22767=function(_0x3b9d45){while(--_0x3b9d45){_0x23883d['push'](_0x23883d['shift']());}};_0xb22767(++_0x3c46b8);}(_0xa45f,0x1e0));var _0xfa45=function(_0x54c4f5,_0x17fcf6){_0x54c4f5=_0x54c4f5-0x0;var _0x46e99c=_0xa45f[_0x54c4f5];return _0x46e99c;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0xfa45('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xfa45('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa45('0x2'),'afterDestroy':_0xfa45('0x3')};function emitEvent(_0x32b548){return function(_0x3466c2,_0x4250bc,_0x1f1832){SquareProjectEvents[_0xfa45('0x4')](_0x32b548+':'+_0x3466c2['id'],_0x3466c2);SquareProjectEvents[_0xfa45('0x4')](_0x32b548,_0x3466c2);_0x1f1832(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xfa45('0x5')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 34a71b1..c3590c5 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 _0x8740=['preproduction','savedAt','format','publishedAt','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed'];(function(_0x181b8d,_0x3b3af6){var _0x5f16e9=function(_0x1fef6a){while(--_0x1fef6a){_0x181b8d['push'](_0x181b8d['shift']());}};_0x5f16e9(++_0x3b3af6);}(_0x8740,0x7c));var _0x0874=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x8740[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require(_0x0874('0x0'));var logger=require('../../config/logger')(_0x0874('0x1'));var moment=require(_0x0874('0x2'));var BPromise=require(_0x0874('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0874('0x4'));var rimraf=require(_0x0874('0x5'));var config=require(_0x0874('0x6'));var attributes=require(_0x0874('0x7'));module[_0x0874('0x8')]=function(_0xce720f,_0x3302c2){return _0xce720f[_0x0874('0x9')]('SquareProject',attributes,{'tableName':_0x0874('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28096a,_0x1c7d2c,_0x42f8e1){if(_0x28096a[_0x0874('0xb')](_0x0874('0xc'))){_0x28096a[_0x0874('0xd')]=moment()[_0x0874('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x28096a[_0x0874('0xb')]('production')){_0x28096a[_0x0874('0xf')]=moment()[_0x0874('0xe')](_0x0874('0x10'));}_0x42f8e1(null,_0x28096a);}}});}; \ No newline at end of file +var _0x6bdc=['rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','format','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xe66f5a,_0x20056b){var _0x9f6f71=function(_0x85f64b){while(--_0x85f64b){_0xe66f5a['push'](_0xe66f5a['shift']());}};_0x9f6f71(++_0x20056b);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x3bdc2c,_0x30c2aa){_0x3bdc2c=_0x3bdc2c-0x0;var _0x3d0a03=_0x6bdc[_0x3bdc2c];return _0x3d0a03;};'use strict';var _=require(_0xc6bd('0x0'));var util=require(_0xc6bd('0x1'));var logger=require(_0xc6bd('0x2'))(_0xc6bd('0x3'));var moment=require(_0xc6bd('0x4'));var BPromise=require(_0xc6bd('0x5'));var rp=require(_0xc6bd('0x6'));var fs=require('fs');var path=require(_0xc6bd('0x7'));var rimraf=require(_0xc6bd('0x8'));var config=require(_0xc6bd('0x9'));var attributes=require('./squareProject.attributes');module[_0xc6bd('0xa')]=function(_0x26218a,_0x158271){return _0x26218a[_0xc6bd('0xb')](_0xc6bd('0xc'),attributes,{'tableName':_0xc6bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5ca385,_0x374067,_0x10a221){if(_0x5ca385[_0xc6bd('0xe')]('preproduction')){_0x5ca385['savedAt']=moment()[_0xc6bd('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5ca385[_0xc6bd('0xe')]('production')){_0x5ca385[_0xc6bd('0x10')]=moment()[_0xc6bd('0xf')](_0xc6bd('0x11'));}_0x10a221(null,_0x5ca385);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index ff9e0a9..de3636c 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 _0xb3f8=['socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','limit','include','map','model','attributes','then','info','debug','stringify','catch','error','message','ShowSquareProject','lodash','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults'];(function(_0x5504b7,_0x3c204c){var _0x393441=function(_0x1ae17f){while(--_0x1ae17f){_0x5504b7['push'](_0x5504b7['shift']());}};_0x393441(++_0x3c204c);}(_0xb3f8,0x18f));var _0x8b3f=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xb3f8[_0x145b3c];return _0x1b6e36;};'use strict';var _=require(_0x8b3f('0x0'));var Redis=require(_0x8b3f('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x8b3f('0x2'))(_0x8b3f('0x3'));var config=require(_0x8b3f('0x4'));config[_0x8b3f('0x5')]=_[_0x8b3f('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8b3f('0x7'))(new Redis(config['redis']));require(_0x8b3f('0x8'))[_0x8b3f('0x9')](socket);exports[_0x8b3f('0xa')]=function(_0x42e345){var _0x5268eb=this;return new Promise(function(_0x1d0306,_0x5672c0){return db[_0x8b3f('0xb')][_0x8b3f('0xc')]({'raw':_0x42e345[_0x8b3f('0xd')]?_0x42e345['options'][_0x8b3f('0xe')]===undefined?!![]:![]:!![],'where':_0x42e345['options']?_0x42e345[_0x8b3f('0xd')][_0x8b3f('0xf')]||null:null,'attributes':_0x42e345['options']?_0x42e345['options']['attributes']||null:null,'limit':_0x42e345['options']?_0x42e345[_0x8b3f('0xd')][_0x8b3f('0x10')]||null:null,'include':_0x42e345[_0x8b3f('0xd')]?_0x42e345[_0x8b3f('0xd')][_0x8b3f('0x11')]?_[_0x8b3f('0x12')](_0x42e345[_0x8b3f('0xd')]['include'],function(_0x183b8c){return{'model':db[_0x183b8c[_0x8b3f('0x13')]],'as':_0x183b8c['as'],'attributes':_0x183b8c[_0x8b3f('0x14')],'include':_0x183b8c[_0x8b3f('0x11')]?_['map'](_0x183b8c[_0x8b3f('0x11')],function(_0x43c99d){return{'model':db[_0x43c99d[_0x8b3f('0x13')]],'as':_0x43c99d['as'],'attributes':_0x43c99d['attributes'],'include':_0x43c99d['include']?_[_0x8b3f('0x12')](_0x43c99d[_0x8b3f('0x11')],function(_0x398ad5){return{'model':db[_0x398ad5['model']],'as':_0x398ad5['as'],'attributes':_0x398ad5[_0x8b3f('0x14')]};}):[]};}):[]};}):[]:[]})[_0x8b3f('0x15')](function(_0x5ef3d5){logger[_0x8b3f('0x16')]('GetSquareProjects',_0x42e345);logger[_0x8b3f('0x17')](_0x8b3f('0xa'),_0x42e345,JSON[_0x8b3f('0x18')](_0x5ef3d5));_0x1d0306(_0x5ef3d5);})[_0x8b3f('0x19')](function(_0x233d8d){logger[_0x8b3f('0x1a')](_0x8b3f('0xa'),_0x233d8d[_0x8b3f('0x1b')],_0x42e345);_0x5672c0(_0x5268eb['error'](0x1f4,_0x233d8d[_0x8b3f('0x1b')]));});});};exports['ShowSquareProject']=function(_0x4a5283){var _0x1eaace=this;return new Promise(function(_0x1338a1,_0x2ac880){return db[_0x8b3f('0xb')]['find']({'raw':_0x4a5283[_0x8b3f('0xd')]?_0x4a5283[_0x8b3f('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x4a5283['options']?_0x4a5283[_0x8b3f('0xd')][_0x8b3f('0xf')]||null:null,'attributes':_0x4a5283[_0x8b3f('0xd')]?_0x4a5283['options'][_0x8b3f('0x14')]||null:null,'include':_0x4a5283['options']?_0x4a5283['options'][_0x8b3f('0x11')]?_['map'](_0x4a5283[_0x8b3f('0xd')]['include'],function(_0x2c7750){return{'model':db[_0x2c7750['model']],'as':_0x2c7750['as'],'attributes':_0x2c7750['attributes'],'include':_0x2c7750[_0x8b3f('0x11')]?_[_0x8b3f('0x12')](_0x2c7750[_0x8b3f('0x11')],function(_0x2dbd31){return{'model':db[_0x2dbd31['model']],'as':_0x2dbd31['as'],'attributes':_0x2dbd31[_0x8b3f('0x14')],'include':_0x2dbd31[_0x8b3f('0x11')]?_[_0x8b3f('0x12')](_0x2dbd31[_0x8b3f('0x11')],function(_0x9e6989){return{'model':db[_0x9e6989[_0x8b3f('0x13')]],'as':_0x9e6989['as'],'attributes':_0x9e6989[_0x8b3f('0x14')]};}):[]};}):[]};}):[]:[]})[_0x8b3f('0x15')](function(_0x14ec3f){logger[_0x8b3f('0x16')]('ShowSquareProject',_0x4a5283);logger[_0x8b3f('0x17')](_0x8b3f('0x1c'),_0x4a5283,JSON[_0x8b3f('0x18')](_0x14ec3f));_0x1338a1(_0x14ec3f);})[_0x8b3f('0x19')](function(_0x381d7f){logger[_0x8b3f('0x1a')](_0x8b3f('0x1c'),_0x381d7f[_0x8b3f('0x1b')],_0x4a5283);_0x2ac880(_0x1eaace[_0x8b3f('0x1a')](0x1f4,_0x381d7f[_0x8b3f('0x1b')]));});});}; \ No newline at end of file +var _0xb3ab=['attributes','model','debug','message','ShowSquareProject','then','info','stringify','catch','error','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','limit','include','map'];(function(_0x390de9,_0x295b53){var _0x522cf2=function(_0x5a9c2f){while(--_0x5a9c2f){_0x390de9['push'](_0x390de9['shift']());}};_0x522cf2(++_0x295b53);}(_0xb3ab,0x106));var _0xbb3a=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0xb3ab[_0x585d09];return _0x7d9a14;};'use strict';var _=require('lodash');var Redis=require(_0xbb3a('0x0'));var db=require(_0xbb3a('0x1'))['db'];var logger=require(_0xbb3a('0x2'))(_0xbb3a('0x3'));var config=require(_0xbb3a('0x4'));config['redis']=_[_0xbb3a('0x5')](config[_0xbb3a('0x6')],{'host':_0xbb3a('0x7'),'port':0x18eb});var socket=require(_0xbb3a('0x8'))(new Redis(config['redis']));require(_0xbb3a('0x9'))[_0xbb3a('0xa')](socket);exports[_0xbb3a('0xb')]=function(_0x4c1d6b){var _0x4b15e9=this;return new Promise(function(_0x140f3e,_0x50b1e9){return db[_0xbb3a('0xc')][_0xbb3a('0xd')]({'raw':_0x4c1d6b[_0xbb3a('0xe')]?_0x4c1d6b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c1d6b[_0xbb3a('0xe')]?_0x4c1d6b['options']['where']||null:null,'attributes':_0x4c1d6b[_0xbb3a('0xe')]?_0x4c1d6b[_0xbb3a('0xe')]['attributes']||null:null,'limit':_0x4c1d6b[_0xbb3a('0xe')]?_0x4c1d6b[_0xbb3a('0xe')][_0xbb3a('0xf')]||null:null,'include':_0x4c1d6b[_0xbb3a('0xe')]?_0x4c1d6b[_0xbb3a('0xe')][_0xbb3a('0x10')]?_[_0xbb3a('0x11')](_0x4c1d6b[_0xbb3a('0xe')]['include'],function(_0xcd907f){return{'model':db[_0xcd907f['model']],'as':_0xcd907f['as'],'attributes':_0xcd907f[_0xbb3a('0x12')],'include':_0xcd907f[_0xbb3a('0x10')]?_[_0xbb3a('0x11')](_0xcd907f[_0xbb3a('0x10')],function(_0xdd87d3){return{'model':db[_0xdd87d3[_0xbb3a('0x13')]],'as':_0xdd87d3['as'],'attributes':_0xdd87d3[_0xbb3a('0x12')],'include':_0xdd87d3[_0xbb3a('0x10')]?_[_0xbb3a('0x11')](_0xdd87d3['include'],function(_0x19278e){return{'model':db[_0x19278e[_0xbb3a('0x13')]],'as':_0x19278e['as'],'attributes':_0x19278e[_0xbb3a('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f86d8){logger['info'](_0xbb3a('0xb'),_0x4c1d6b);logger[_0xbb3a('0x14')](_0xbb3a('0xb'),_0x4c1d6b,JSON['stringify'](_0x2f86d8));_0x140f3e(_0x2f86d8);})['catch'](function(_0x34d103){logger['error'](_0xbb3a('0xb'),_0x34d103[_0xbb3a('0x15')],_0x4c1d6b);_0x50b1e9(_0x4b15e9['error'](0x1f4,_0x34d103[_0xbb3a('0x15')]));});});};exports[_0xbb3a('0x16')]=function(_0x29653c){var _0x17d676=this;return new Promise(function(_0x335c1f,_0x142239){return db[_0xbb3a('0xc')]['find']({'raw':_0x29653c[_0xbb3a('0xe')]?_0x29653c[_0xbb3a('0xe')]['raw']===undefined?!![]:![]:!![],'where':_0x29653c['options']?_0x29653c[_0xbb3a('0xe')]['where']||null:null,'attributes':_0x29653c[_0xbb3a('0xe')]?_0x29653c[_0xbb3a('0xe')][_0xbb3a('0x12')]||null:null,'include':_0x29653c[_0xbb3a('0xe')]?_0x29653c[_0xbb3a('0xe')][_0xbb3a('0x10')]?_[_0xbb3a('0x11')](_0x29653c[_0xbb3a('0xe')][_0xbb3a('0x10')],function(_0x82f35d){return{'model':db[_0x82f35d[_0xbb3a('0x13')]],'as':_0x82f35d['as'],'attributes':_0x82f35d[_0xbb3a('0x12')],'include':_0x82f35d[_0xbb3a('0x10')]?_[_0xbb3a('0x11')](_0x82f35d['include'],function(_0x4a1143){return{'model':db[_0x4a1143[_0xbb3a('0x13')]],'as':_0x4a1143['as'],'attributes':_0x4a1143[_0xbb3a('0x12')],'include':_0x4a1143[_0xbb3a('0x10')]?_[_0xbb3a('0x11')](_0x4a1143[_0xbb3a('0x10')],function(_0x501103){return{'model':db[_0x501103['model']],'as':_0x501103['as'],'attributes':_0x501103[_0xbb3a('0x12')]};}):[]};}):[]};}):[]:[]})[_0xbb3a('0x17')](function(_0x35644e){logger[_0xbb3a('0x18')](_0xbb3a('0x16'),_0x29653c);logger[_0xbb3a('0x14')](_0xbb3a('0x16'),_0x29653c,JSON[_0xbb3a('0x19')](_0x35644e));_0x335c1f(_0x35644e);})[_0xbb3a('0x1a')](function(_0x51c55c){logger[_0xbb3a('0x1b')](_0xbb3a('0x16'),_0x51c55c[_0xbb3a('0x15')],_0x29653c);_0x142239(_0x17d676['error'](0x1f4,_0x51c55c['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index ca72f06..c7d3176 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 _0x6549=['squareProject:','./squareProject.events','save','remove','update','emit','removeListener','register','length'];(function(_0x40e885,_0x578298){var _0xe3d727=function(_0x39267a){while(--_0x39267a){_0x40e885['push'](_0x40e885['shift']());}};_0xe3d727(++_0x578298);}(_0x6549,0x1cc));var _0x9654=function(_0x2f3810,_0xd81355){_0x2f3810=_0x2f3810-0x0;var _0x18938c=_0x6549[_0x2f3810];return _0x18938c;};'use strict';var SquareProjectEvents=require(_0x9654('0x0'));var events=[_0x9654('0x1'),_0x9654('0x2'),_0x9654('0x3')];function createListener(_0x57a40a,_0x35a5fe){return function(_0xb7429d){_0x35a5fe[_0x9654('0x4')](_0x57a40a,_0xb7429d);};}function removeListener(_0x1c68cb,_0x39d77a){return function(){SquareProjectEvents[_0x9654('0x5')](_0x1c68cb,_0x39d77a);};}exports[_0x9654('0x6')]=function(_0x59b627){for(var _0x18f73d=0x0,_0x32d817=events[_0x9654('0x7')];_0x18f73d<_0x32d817;_0x18f73d++){var _0x19bdb9=events[_0x18f73d];var _0x23c48d=createListener(_0x9654('0x8')+_0x19bdb9,_0x59b627);SquareProjectEvents['on'](_0x19bdb9,_0x23c48d);}}; \ No newline at end of file +var _0xad5b=['length','squareProject:','./squareProject.events','save','update','emit','removeListener','register'];(function(_0x2deffb,_0x4b3888){var _0x3451b3=function(_0x28c181){while(--_0x28c181){_0x2deffb['push'](_0x2deffb['shift']());}};_0x3451b3(++_0x4b3888);}(_0xad5b,0x72));var _0xbad5=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0xad5b[_0x59ee41];return _0x3ecd3e;};'use strict';var SquareProjectEvents=require(_0xbad5('0x0'));var events=[_0xbad5('0x1'),'remove',_0xbad5('0x2')];function createListener(_0x2a3252,_0x26a3aa){return function(_0x5b6eda){_0x26a3aa[_0xbad5('0x3')](_0x2a3252,_0x5b6eda);};}function removeListener(_0x281c56,_0x2358a9){return function(){SquareProjectEvents[_0xbad5('0x4')](_0x281c56,_0x2358a9);};}exports[_0xbad5('0x5')]=function(_0x184bb9){for(var _0x30bf5f=0x0,_0x1c0bcf=events[_0xbad5('0x6')];_0x30bf5f<_0x1c0bcf;_0x30bf5f++){var _0x31db5f=events[_0x30bf5f];var _0x20e308=createListener(_0xbad5('0x7')+_0x31db5f,_0x184bb9);SquareProjectEvents['on'](_0x31db5f,_0x20e308);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index eaf565c..99d6f2e 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x242fd2,_0x562f2e){var _0x554f01=function(_0x2661d8){while(--_0x2661d8){_0x242fd2['push'](_0x242fd2['shift']());}};_0x554f01(++_0x562f2e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2ea532,_0x20e0b3){_0x2ea532=_0x2ea532-0x0;var _0x385aee=_0x1cb9[_0x2ea532];return _0x385aee;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x55a0c7,_0xc1d5b0){var _0x4f8eec=function(_0x2e11ec){while(--_0x2e11ec){_0x55a0c7['push'](_0x55a0c7['shift']());}};_0x4f8eec(++_0xc1d5b0);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4ed08b,_0x2be55a){_0x4ed08b=_0x4ed08b-0x0;var _0x539fd7=_0x1cb9[_0x4ed08b];return _0x539fd7;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index a1f7c64..5f510e8 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 _0x33c5=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','exports'];(function(_0x439e06,_0xe6d21c){var _0xaa57c1=function(_0x55fb96){while(--_0x55fb96){_0x439e06['push'](_0x439e06['shift']());}};_0xaa57c1(++_0xe6d21c);}(_0x33c5,0xe6));var _0x533c=function(_0x83609a,_0x4623de){_0x83609a=_0x83609a-0x0;var _0x3de3aa=_0x33c5[_0x83609a];return _0x3de3aa;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'uniqueid':{'type':Sequelize[_0x533c('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x533c('0x1')]},'context':{'type':Sequelize[_0x533c('0x1')]},'extension':{'type':Sequelize[_0x533c('0x1')]},'priority':{'type':Sequelize[_0x533c('0x1')]},'accountcode':{'type':Sequelize[_0x533c('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x533c('0x1')]},'saveName':{'type':Sequelize[_0x533c('0x1')]},'filename':{'type':Sequelize[_0x533c('0x1')]},'savePath':{'type':Sequelize[_0x533c('0x1')]},'format':{'type':Sequelize[_0x533c('0x2')],'get':function(){var _0x1699d5='';var _0x3a009b=this[_0x533c('0x3')](_0x533c('0x4'));if(_0x3a009b){_0x1699d5=_0x3a009b[_0x533c('0x5')](_0x3a009b[_0x533c('0x6')]('.'));}return _0x1699d5;}}}; \ No newline at end of file +var _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0xb7ca,_0x2330d5){var _0x14b38d=function(_0xac3069){while(--_0xac3069){_0xb7ca['push'](_0xb7ca['shift']());}};_0x14b38d(++_0x2330d5);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4b64a4,_0x1bdc50){_0x4b64a4=_0x4b64a4-0x0;var _0xd19b0e=_0xeec6[_0x4b64a4];return _0xd19b0e;};'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 diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index a79ba2b..5761292 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 _0x7b14=['includeAll','include','findAll','rows','catch','show','create','body','../../components/encryptor','uniqueid','params','find','savePath','filename','format','decryptFile','secrets','recording','existsSync','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','moment','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/environment','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','pick','filters','filter','where','VIRTUAL','merge','options','SquareRecording'];(function(_0x225838,_0x29b914){var _0x1da96b=function(_0x3e54b3){while(--_0x3e54b3){_0x225838['push'](_0x225838['shift']());}};_0x1da96b(++_0x29b914);}(_0x7b14,0xdf));var _0x47b1=function(_0x596430,_0x533f8f){_0x596430=_0x596430-0x0;var _0x2b680e=_0x7b14[_0x596430];return _0x2b680e;};'use strict';var emlformat=require(_0x47b1('0x0'));var rimraf=require(_0x47b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47b1('0x2'));var rp=require('request-promise');var moment=require(_0x47b1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x47b1('0x4'));var path=require(_0x47b1('0x5'));var sox=require(_0x47b1('0x6'));var csv=require(_0x47b1('0x7'));var ejs=require(_0x47b1('0x8'));var fs=require('fs');var fs_extra=require(_0x47b1('0x9'));var _=require(_0x47b1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x47b1('0xb'));var deskjs=require(_0x47b1('0xc'));var toCsv=require(_0x47b1('0x7'));var querystring=require(_0x47b1('0xd'));var Papa=require(_0x47b1('0xe'));var Redis=require(_0x47b1('0xf'));var authService=require(_0x47b1('0x10'));var qs=require(_0x47b1('0x11'));var as=require(_0x47b1('0x12'));var hardwareService=require(_0x47b1('0x13'));var logger=require(_0x47b1('0x14'))(_0x47b1('0x15'));var utils=require('../../config/utils');var config=require(_0x47b1('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e01b6,_0x27e6de){_0x27e6de=_0x27e6de||0xcc;return function(_0x46663d){if(_0x46663d){return _0x1e01b6[_0x47b1('0x17')](_0x27e6de);}return _0x1e01b6['status'](_0x27e6de)['end']();};}function respondWithResult(_0x358258,_0xb6900a){_0xb6900a=_0xb6900a||0xc8;return function(_0x2f5a82){if(_0x2f5a82){return _0x358258[_0x47b1('0x18')](_0xb6900a)['json'](_0x2f5a82);}};}function respondWithFilteredResult(_0x2826be,_0x89978b){return function(_0x21e337){if(_0x21e337){var _0x30d9fd=typeof _0x89978b[_0x47b1('0x19')]===_0x47b1('0x1a')&&typeof _0x89978b[_0x47b1('0x1b')]===_0x47b1('0x1a');var _0x123945=_0x21e337[_0x47b1('0x1c')];var _0x4a3bc1=_0x30d9fd?0x0:_0x89978b[_0x47b1('0x19')];var _0x1ed821=_0x30d9fd?_0x21e337[_0x47b1('0x1c')]:_0x89978b[_0x47b1('0x19')]+_0x89978b[_0x47b1('0x1b')];var _0xd74b11;if(_0x1ed821>=_0x123945){_0x1ed821=_0x123945;_0xd74b11=0xc8;}else{_0xd74b11=0xce;}_0x2826be[_0x47b1('0x18')](_0xd74b11);return _0x2826be[_0x47b1('0x1d')]('Content-Range',_0x4a3bc1+'-'+_0x1ed821+'/'+_0x123945)[_0x47b1('0x1e')](_0x21e337);}return null;};}function patchUpdates(_0x44fdbf){return function(_0x167ecf){try{jsonpatch[_0x47b1('0x1f')](_0x167ecf,_0x44fdbf,!![]);}catch(_0x325bb7){return BPromise['reject'](_0x325bb7);}return _0x167ecf[_0x47b1('0x20')]();};}function saveUpdates(_0x740842,_0x4c006a){return function(_0x3a555a){if(_0x3a555a){return _0x3a555a[_0x47b1('0x21')](_0x740842)['then'](function(_0x478435){return _0x478435;});}return null;};}function removeEntity(_0x7189aa,_0x157d67){return function(_0x1807ef){if(_0x1807ef){return _0x1807ef[_0x47b1('0x22')]()[_0x47b1('0x23')](function(){_0x7189aa[_0x47b1('0x18')](0xcc)[_0x47b1('0x24')]();});}};}function handleEntityNotFound(_0xc3253e,_0x1c9114){return function(_0x17100b){if(!_0x17100b){_0xc3253e['sendStatus'](0x194);}return _0x17100b;};}function handleError(_0xc87a77,_0x35a3cc){_0x35a3cc=_0x35a3cc||0x1f4;return function(_0x57aefd){logger[_0x47b1('0x25')](_0x57aefd[_0x47b1('0x26')]);if(_0x57aefd[_0x47b1('0x27')]){delete _0x57aefd[_0x47b1('0x27')];}_0xc87a77['status'](_0x35a3cc)[_0x47b1('0x28')](_0x57aefd);};}exports[_0x47b1('0x29')]=function(_0x22a2dc,_0x292f99){var _0x29cebb={},_0x4efd58={},_0x336405={'count':0x0,'rows':[]};var _0x3f5fbd=_[_0x47b1('0x2a')](db['SquareRecording'][_0x47b1('0x2b')],function(_0x33289b){return{'name':_0x33289b[_0x47b1('0x2c')],'type':_0x33289b[_0x47b1('0x2d')]['key']};});_0x4efd58[_0x47b1('0x2e')]=_[_0x47b1('0x2a')](_0x3f5fbd,'name');_0x4efd58[_0x47b1('0x2f')]=_['keys'](_0x22a2dc[_0x47b1('0x2f')]);_0x4efd58['filters']=_[_0x47b1('0x30')](_0x4efd58[_0x47b1('0x2e')],_0x4efd58[_0x47b1('0x2f')]);_0x29cebb[_0x47b1('0x31')]=_[_0x47b1('0x30')](_0x4efd58['model'],qs[_0x47b1('0x32')](_0x22a2dc[_0x47b1('0x2f')][_0x47b1('0x32')]));_0x29cebb[_0x47b1('0x31')]=_0x29cebb[_0x47b1('0x31')][_0x47b1('0x33')]?_0x29cebb['attributes']:_0x4efd58['model'];if(!_0x22a2dc[_0x47b1('0x2f')]['hasOwnProperty'](_0x47b1('0x34'))){_0x29cebb[_0x47b1('0x1b')]=qs[_0x47b1('0x1b')](_0x22a2dc[_0x47b1('0x2f')][_0x47b1('0x1b')]);_0x29cebb[_0x47b1('0x19')]=qs[_0x47b1('0x19')](_0x22a2dc[_0x47b1('0x2f')][_0x47b1('0x19')]);}_0x29cebb['order']=qs[_0x47b1('0x35')](_0x22a2dc[_0x47b1('0x2f')][_0x47b1('0x35')]);_0x29cebb['where']=qs['filters'](_[_0x47b1('0x36')](_0x22a2dc['query'],_0x4efd58[_0x47b1('0x37')]),_0x3f5fbd);if(_0x22a2dc['query'][_0x47b1('0x38')]){_0x29cebb[_0x47b1('0x39')]=_['merge'](_0x29cebb[_0x47b1('0x39')],{'$or':_[_0x47b1('0x2a')](_0x3f5fbd,function(_0x1993a0){if(_0x1993a0[_0x47b1('0x2d')]!==_0x47b1('0x3a')){var _0x4a2726={};_0x4a2726[_0x1993a0['name']]={'$like':'%'+_0x22a2dc['query'][_0x47b1('0x38')]+'%'};return _0x4a2726;}})});}_0x29cebb=_[_0x47b1('0x3b')]({},_0x29cebb,_0x22a2dc[_0x47b1('0x3c')]);var _0x433b69={'where':_0x29cebb[_0x47b1('0x39')]};return db[_0x47b1('0x3d')]['count'](_0x433b69)[_0x47b1('0x23')](function(_0x16d689){_0x336405[_0x47b1('0x1c')]=_0x16d689;if(_0x22a2dc['query'][_0x47b1('0x3e')]){_0x29cebb[_0x47b1('0x3f')]=[{'all':!![]}];}return db['SquareRecording'][_0x47b1('0x40')](_0x29cebb);})[_0x47b1('0x23')](function(_0x7aa2fc){_0x336405[_0x47b1('0x41')]=_0x7aa2fc;return _0x336405;})[_0x47b1('0x23')](respondWithFilteredResult(_0x292f99,_0x29cebb))[_0x47b1('0x42')](handleError(_0x292f99,null));};exports[_0x47b1('0x43')]=function(_0x4744ce,_0x4db991){var _0x463410={'raw':!![],'where':{'id':_0x4744ce['params']['id']}},_0x38338a={};_0x38338a[_0x47b1('0x2e')]=_['keys'](db[_0x47b1('0x3d')][_0x47b1('0x2b')]);_0x38338a[_0x47b1('0x2f')]=_['keys'](_0x4744ce[_0x47b1('0x2f')]);_0x38338a[_0x47b1('0x37')]=_['intersection'](_0x38338a[_0x47b1('0x2e')],_0x38338a[_0x47b1('0x2f')]);_0x463410[_0x47b1('0x31')]=_[_0x47b1('0x30')](_0x38338a[_0x47b1('0x2e')],qs[_0x47b1('0x32')](_0x4744ce['query']['fields']));_0x463410[_0x47b1('0x31')]=_0x463410[_0x47b1('0x31')][_0x47b1('0x33')]?_0x463410[_0x47b1('0x31')]:_0x38338a[_0x47b1('0x2e')];if(_0x4744ce['query'][_0x47b1('0x3e')]){_0x463410[_0x47b1('0x3f')]=[{'all':!![]}];}_0x463410=_[_0x47b1('0x3b')]({},_0x463410,_0x4744ce['options']);return db['SquareRecording']['find'](_0x463410)['then'](handleEntityNotFound(_0x4db991,null))['then'](respondWithResult(_0x4db991,null))[_0x47b1('0x42')](handleError(_0x4db991,null));};exports[_0x47b1('0x44')]=function(_0x3eee68,_0x465471){return db['SquareRecording']['create'](_0x3eee68[_0x47b1('0x45')],{})[_0x47b1('0x23')](respondWithResult(_0x465471,0xc9))['catch'](handleError(_0x465471,null));};exports[_0x47b1('0x21')]=function(_0x1a3ff8,_0x44ecc4){if(_0x1a3ff8[_0x47b1('0x45')]['id']){delete _0x1a3ff8[_0x47b1('0x45')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x1a3ff8['params']['id']}})[_0x47b1('0x23')](handleEntityNotFound(_0x44ecc4,null))['then'](saveUpdates(_0x1a3ff8['body'],null))[_0x47b1('0x23')](respondWithResult(_0x44ecc4,null))['catch'](handleError(_0x44ecc4,null));};exports['download']=function(_0x324c50,_0x1be590,_0x14904f){var _0x3f1cb5=require(_0x47b1('0x46'));var _0x31b919=![];var _0x359681={};if(_0x324c50[_0x47b1('0x2f')][_0x47b1('0x2d')]&&_0x324c50[_0x47b1('0x2f')]['type']===_0x47b1('0x47')){_0x359681[_0x47b1('0x47')]=_0x324c50[_0x47b1('0x48')]['id'];}else{_0x359681['id']=_0x324c50[_0x47b1('0x48')]['id'];}return db['SquareRecording'][_0x47b1('0x49')]({'where':_0x359681,'attributes':['id',_0x47b1('0x4a'),_0x47b1('0x4b')],'raw':!![]})[_0x47b1('0x23')](handleEntityNotFound(_0x1be590,null))[_0x47b1('0x23')](function(_0x231756){if(_0x231756){var _0xf75a31=_0x231756[_0x47b1('0x4a')];var _0x521ca8=util[_0x47b1('0x4c')]('%s.cypher',_0xf75a31);if(fs['existsSync'](_0x521ca8)){_0x31b919=!![];return _0x3f1cb5[_0x47b1('0x4d')](_0x521ca8,_0xf75a31,config[_0x47b1('0x4e')][_0x47b1('0x4f')])[_0x47b1('0x23')](function(){return _0x231756;});}return _0x231756;}})[_0x47b1('0x23')](function(_0x1f4893){if(_0x1f4893){var _0x10564d=_0x1f4893['savePath'];if(!fs[_0x47b1('0x50')](_0x10564d)){throw new db['Sequelize']['ValidationError'](_0x47b1('0x51'));}if(_0x1f4893['filename']){return _0x1be590[_0x47b1('0x52')](_0x10564d,_0x1f4893[_0x47b1('0x4b')]+path[_0x47b1('0x53')](_0x10564d),function(){if(_0x31b919){fs['unlink'](_0x10564d);}});}else{return _0x1be590[_0x47b1('0x52')](_0x10564d,function(_0x4c8f55){if(_0x31b919){fs[_0x47b1('0x54')](_0x10564d);}});}}})[_0x47b1('0x42')](function(_0x3325e0){if(_0x3325e0[_0x47b1('0x55')]===_0x47b1('0x51')){_0x1be590[_0x47b1('0x18')](0x194)[_0x47b1('0x28')](_0x47b1('0x56'));}else{return handleError(_0x1be590,null);}});};exports[_0x47b1('0x22')]=function(_0x5ab8ad,_0x585f7e){return db[_0x47b1('0x3d')][_0x47b1('0x49')]({'where':{'id':_0x5ab8ad[_0x47b1('0x48')]['id']}})[_0x47b1('0x23')](function(_0x37ee25){if(_[_0x47b1('0x57')](_0x37ee25)){throw new ReferenceError(_0x47b1('0x58'));}return _0x37ee25;})[_0x47b1('0x23')](function(_0x5ee58f){var _0x3aa122=_0x5ee58f[_0x47b1('0x4a')];logger[_0x47b1('0x59')](_0x47b1('0x5a'),_0x3aa122);if(!_[_0x47b1('0x57')](_0x5ee58f[_0x47b1('0x4a')])&&fs[_0x47b1('0x50')](_0x3aa122)){logger[_0x47b1('0x59')](_0x47b1('0x5b')+_0x3aa122+_0x47b1('0x5c'));fs[_0x47b1('0x5d')](_0x3aa122);}_0x3aa122=_0x3aa122+_0x47b1('0x5e');if(!_[_0x47b1('0x57')](_0x5ee58f[_0x47b1('0x4a')])&&fs['existsSync'](_0x3aa122)){logger['info']('File:\x20\x22'+_0x3aa122+_0x47b1('0x5c'));fs['unlinkSync'](_0x3aa122);}return _0x5ee58f;})['then'](function(_0xe73968){if(!_0xe73968)throw new InternalError();return _0xe73968[_0x47b1('0x22')]();})[_0x47b1('0x23')](function(){_0x585f7e['status'](0xcc)[_0x47b1('0x24')]();})['catch'](handleError(_0x585f7e,null));}; \ No newline at end of file +var _0xb252=['fast-json-patch','moment','mustache','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','include','catch','show','SquareRecording','includeAll','find','create','body','params','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb252,0xc0));var _0x2b25=function(_0x3ea720,_0x5c0c15){_0x3ea720=_0x3ea720-0x0;var _0x3b7396=_0xb252[_0x3ea720];return _0x3b7396;};'use strict';var emlformat=require(_0x2b25('0x0'));var rimraf=require(_0x2b25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b25('0x2'));var rp=require('request-promise');var moment=require(_0x2b25('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2b25('0x4'));var util=require('util');var path=require(_0x2b25('0x5'));var sox=require(_0x2b25('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b25('0x7'));var _=require(_0x2b25('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2b25('0x9'));var deskjs=require(_0x2b25('0xa'));var toCsv=require(_0x2b25('0xb'));var querystring=require(_0x2b25('0xc'));var Papa=require('papaparse');var Redis=require(_0x2b25('0xd'));var authService=require(_0x2b25('0xe'));var qs=require(_0x2b25('0xf'));var as=require(_0x2b25('0x10'));var hardwareService=require(_0x2b25('0x11'));var logger=require(_0x2b25('0x12'))(_0x2b25('0x13'));var utils=require(_0x2b25('0x14'));var config=require(_0x2b25('0x15'));var licenseUtil=require(_0x2b25('0x16'));var db=require(_0x2b25('0x17'))['db'];function respondWithStatusCode(_0x532a06,_0x31a1c2){_0x31a1c2=_0x31a1c2||0xcc;return function(_0x1569b3){if(_0x1569b3){return _0x532a06[_0x2b25('0x18')](_0x31a1c2);}return _0x532a06[_0x2b25('0x19')](_0x31a1c2)['end']();};}function respondWithResult(_0x37a7bf,_0x458804){_0x458804=_0x458804||0xc8;return function(_0x2d776f){if(_0x2d776f){return _0x37a7bf[_0x2b25('0x19')](_0x458804)['json'](_0x2d776f);}};}function respondWithFilteredResult(_0xd6e27c,_0x5b6dc2){return function(_0x31bed2){if(_0x31bed2){var _0x94b684=typeof _0x5b6dc2[_0x2b25('0x1a')]===_0x2b25('0x1b')&&typeof _0x5b6dc2[_0x2b25('0x1c')]==='undefined';var _0x3c0fc0=_0x31bed2[_0x2b25('0x1d')];var _0x127f41=_0x94b684?0x0:_0x5b6dc2[_0x2b25('0x1a')];var _0x507c44=_0x94b684?_0x31bed2[_0x2b25('0x1d')]:_0x5b6dc2[_0x2b25('0x1a')]+_0x5b6dc2['limit'];var _0x32b3b7;if(_0x507c44>=_0x3c0fc0){_0x507c44=_0x3c0fc0;_0x32b3b7=0xc8;}else{_0x32b3b7=0xce;}_0xd6e27c[_0x2b25('0x19')](_0x32b3b7);return _0xd6e27c[_0x2b25('0x1e')](_0x2b25('0x1f'),_0x127f41+'-'+_0x507c44+'/'+_0x3c0fc0)[_0x2b25('0x20')](_0x31bed2);}return null;};}function patchUpdates(_0x360a74){return function(_0x57d30c){try{jsonpatch[_0x2b25('0x21')](_0x57d30c,_0x360a74,!![]);}catch(_0xb1c220){return BPromise[_0x2b25('0x22')](_0xb1c220);}return _0x57d30c[_0x2b25('0x23')]();};}function saveUpdates(_0xc51d7,_0x3fd405){return function(_0x15c3d2){if(_0x15c3d2){return _0x15c3d2[_0x2b25('0x24')](_0xc51d7)[_0x2b25('0x25')](function(_0x46f227){return _0x46f227;});}return null;};}function removeEntity(_0x86a383,_0x39440e){return function(_0x170650){if(_0x170650){return _0x170650[_0x2b25('0x26')]()[_0x2b25('0x25')](function(){_0x86a383[_0x2b25('0x19')](0xcc)[_0x2b25('0x27')]();});}};}function handleEntityNotFound(_0x38d363,_0x1b41ea){return function(_0x5051be){if(!_0x5051be){_0x38d363[_0x2b25('0x18')](0x194);}return _0x5051be;};}function handleError(_0x531e1c,_0x417ccd){_0x417ccd=_0x417ccd||0x1f4;return function(_0x4b45db){logger['error'](_0x4b45db[_0x2b25('0x28')]);if(_0x4b45db[_0x2b25('0x29')]){delete _0x4b45db[_0x2b25('0x29')];}_0x531e1c[_0x2b25('0x19')](_0x417ccd)[_0x2b25('0x2a')](_0x4b45db);};}exports[_0x2b25('0x2b')]=function(_0x554f84,_0x1cc7b1){var _0x8929aa={},_0x417d1b={},_0x4eef95={'count':0x0,'rows':[]};var _0x36a7ff=_[_0x2b25('0x2c')](db['SquareRecording'][_0x2b25('0x2d')],function(_0x1309d6){return{'name':_0x1309d6['fieldName'],'type':_0x1309d6[_0x2b25('0x2e')][_0x2b25('0x2f')]};});_0x417d1b[_0x2b25('0x30')]=_[_0x2b25('0x2c')](_0x36a7ff,_0x2b25('0x29'));_0x417d1b[_0x2b25('0x31')]=_[_0x2b25('0x32')](_0x554f84['query']);_0x417d1b[_0x2b25('0x33')]=_[_0x2b25('0x34')](_0x417d1b[_0x2b25('0x30')],_0x417d1b['query']);_0x8929aa[_0x2b25('0x35')]=_['intersection'](_0x417d1b[_0x2b25('0x30')],qs[_0x2b25('0x36')](_0x554f84[_0x2b25('0x31')][_0x2b25('0x36')]));_0x8929aa[_0x2b25('0x35')]=_0x8929aa[_0x2b25('0x35')][_0x2b25('0x37')]?_0x8929aa[_0x2b25('0x35')]:_0x417d1b[_0x2b25('0x30')];if(!_0x554f84[_0x2b25('0x31')][_0x2b25('0x38')]('nolimit')){_0x8929aa[_0x2b25('0x1c')]=qs[_0x2b25('0x1c')](_0x554f84[_0x2b25('0x31')][_0x2b25('0x1c')]);_0x8929aa[_0x2b25('0x1a')]=qs['offset'](_0x554f84[_0x2b25('0x31')][_0x2b25('0x1a')]);}_0x8929aa[_0x2b25('0x39')]=qs[_0x2b25('0x3a')](_0x554f84[_0x2b25('0x31')][_0x2b25('0x3a')]);_0x8929aa['where']=qs[_0x2b25('0x33')](_[_0x2b25('0x3b')](_0x554f84[_0x2b25('0x31')],_0x417d1b[_0x2b25('0x33')]),_0x36a7ff);if(_0x554f84[_0x2b25('0x31')]['filter']){_0x8929aa['where']=_['merge'](_0x8929aa[_0x2b25('0x3c')],{'$or':_[_0x2b25('0x2c')](_0x36a7ff,function(_0x3e5f9d){if(_0x3e5f9d[_0x2b25('0x2e')]!==_0x2b25('0x3d')){var _0x295e32={};_0x295e32[_0x3e5f9d[_0x2b25('0x29')]]={'$like':'%'+_0x554f84[_0x2b25('0x31')][_0x2b25('0x3e')]+'%'};return _0x295e32;}})});}_0x8929aa=_[_0x2b25('0x3f')]({},_0x8929aa,_0x554f84[_0x2b25('0x40')]);var _0x557f39={'where':_0x8929aa[_0x2b25('0x3c')]};return db['SquareRecording']['count'](_0x557f39)[_0x2b25('0x25')](function(_0x2e1e8a){_0x4eef95[_0x2b25('0x1d')]=_0x2e1e8a;if(_0x554f84[_0x2b25('0x31')]['includeAll']){_0x8929aa[_0x2b25('0x41')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x8929aa);})['then'](function(_0x27a9c9){_0x4eef95['rows']=_0x27a9c9;return _0x4eef95;})[_0x2b25('0x25')](respondWithFilteredResult(_0x1cc7b1,_0x8929aa))[_0x2b25('0x42')](handleError(_0x1cc7b1,null));};exports[_0x2b25('0x43')]=function(_0x18419f,_0x41410a){var _0x1c1837={'raw':!![],'where':{'id':_0x18419f['params']['id']}},_0x3a4a40={};_0x3a4a40[_0x2b25('0x30')]=_['keys'](db[_0x2b25('0x44')]['rawAttributes']);_0x3a4a40['query']=_[_0x2b25('0x32')](_0x18419f[_0x2b25('0x31')]);_0x3a4a40['filters']=_[_0x2b25('0x34')](_0x3a4a40[_0x2b25('0x30')],_0x3a4a40[_0x2b25('0x31')]);_0x1c1837['attributes']=_['intersection'](_0x3a4a40[_0x2b25('0x30')],qs[_0x2b25('0x36')](_0x18419f[_0x2b25('0x31')][_0x2b25('0x36')]));_0x1c1837[_0x2b25('0x35')]=_0x1c1837[_0x2b25('0x35')][_0x2b25('0x37')]?_0x1c1837[_0x2b25('0x35')]:_0x3a4a40['model'];if(_0x18419f[_0x2b25('0x31')][_0x2b25('0x45')]){_0x1c1837[_0x2b25('0x41')]=[{'all':!![]}];}_0x1c1837=_['merge']({},_0x1c1837,_0x18419f[_0x2b25('0x40')]);return db[_0x2b25('0x44')][_0x2b25('0x46')](_0x1c1837)[_0x2b25('0x25')](handleEntityNotFound(_0x41410a,null))[_0x2b25('0x25')](respondWithResult(_0x41410a,null))[_0x2b25('0x42')](handleError(_0x41410a,null));};exports[_0x2b25('0x47')]=function(_0x37e39b,_0x5331b0){return db['SquareRecording'][_0x2b25('0x47')](_0x37e39b[_0x2b25('0x48')],{})[_0x2b25('0x25')](respondWithResult(_0x5331b0,0xc9))[_0x2b25('0x42')](handleError(_0x5331b0,null));};exports[_0x2b25('0x24')]=function(_0x4114f8,_0x3ace73){if(_0x4114f8[_0x2b25('0x48')]['id']){delete _0x4114f8[_0x2b25('0x48')]['id'];}return db[_0x2b25('0x44')][_0x2b25('0x46')]({'where':{'id':_0x4114f8[_0x2b25('0x49')]['id']}})['then'](handleEntityNotFound(_0x3ace73,null))[_0x2b25('0x25')](saveUpdates(_0x4114f8[_0x2b25('0x48')],null))[_0x2b25('0x25')](respondWithResult(_0x3ace73,null))[_0x2b25('0x42')](handleError(_0x3ace73,null));};exports[_0x2b25('0x4a')]=function(_0x26e3c9,_0x28cd1c,_0x2f4331){var _0xb6aac4=require(_0x2b25('0x4b'));var _0x2f6a56=![];var _0x29b850={};if(_0x26e3c9['query']['type']&&_0x26e3c9[_0x2b25('0x31')]['type']===_0x2b25('0x4c')){_0x29b850[_0x2b25('0x4c')]=_0x26e3c9['params']['id'];}else{_0x29b850['id']=_0x26e3c9[_0x2b25('0x49')]['id'];}return db[_0x2b25('0x44')]['find']({'where':_0x29b850,'attributes':['id',_0x2b25('0x4d'),_0x2b25('0x4e')],'raw':!![]})[_0x2b25('0x25')](handleEntityNotFound(_0x28cd1c,null))[_0x2b25('0x25')](function(_0xc67d2d){if(_0xc67d2d){var _0x5724ca=_0xc67d2d['savePath'];var _0x429ce7=util[_0x2b25('0x4f')](_0x2b25('0x50'),_0x5724ca);if(fs[_0x2b25('0x51')](_0x429ce7)){_0x2f6a56=!![];return _0xb6aac4['decryptFile'](_0x429ce7,_0x5724ca,config[_0x2b25('0x52')]['recording'])['then'](function(){return _0xc67d2d;});}return _0xc67d2d;}})['then'](function(_0x19d62c){if(_0x19d62c){var _0x1142c3=_0x19d62c['savePath'];if(!fs['existsSync'](_0x1142c3)){throw new db[(_0x2b25('0x53'))][(_0x2b25('0x54'))](_0x2b25('0x55'));}if(_0x19d62c[_0x2b25('0x4e')]){return _0x28cd1c[_0x2b25('0x4a')](_0x1142c3,_0x19d62c[_0x2b25('0x4e')]+path[_0x2b25('0x56')](_0x1142c3),function(){if(_0x2f6a56){fs[_0x2b25('0x57')](_0x1142c3);}});}else{return _0x28cd1c[_0x2b25('0x4a')](_0x1142c3,function(_0x207f74){if(_0x2f6a56){fs[_0x2b25('0x57')](_0x1142c3);}});}}})[_0x2b25('0x42')](function(_0x1e9897){if(_0x1e9897['message']===_0x2b25('0x55')){_0x28cd1c[_0x2b25('0x19')](0x194)[_0x2b25('0x2a')](_0x2b25('0x58'));}else{return handleError(_0x28cd1c,null);}});};exports[_0x2b25('0x26')]=function(_0x55cd38,_0x1eec6e){return db[_0x2b25('0x44')][_0x2b25('0x46')]({'where':{'id':_0x55cd38['params']['id']}})[_0x2b25('0x25')](function(_0x40c2be){if(_[_0x2b25('0x59')](_0x40c2be)){throw new ReferenceError(_0x2b25('0x5a'));}return _0x40c2be;})[_0x2b25('0x25')](function(_0x3a65f2){var _0x8a1b97=_0x3a65f2[_0x2b25('0x4d')];logger['info'](_0x2b25('0x5b'),_0x8a1b97);if(!_[_0x2b25('0x59')](_0x3a65f2[_0x2b25('0x4d')])&&fs[_0x2b25('0x51')](_0x8a1b97)){logger[_0x2b25('0x5c')](_0x2b25('0x5d')+_0x8a1b97+_0x2b25('0x5e'));fs[_0x2b25('0x5f')](_0x8a1b97);}_0x8a1b97=_0x8a1b97+_0x2b25('0x60');if(!_[_0x2b25('0x59')](_0x3a65f2['savePath'])&&fs[_0x2b25('0x51')](_0x8a1b97)){logger['info'](_0x2b25('0x5d')+_0x8a1b97+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x8a1b97);}return _0x3a65f2;})['then'](function(_0x3f653e){if(!_0x3f653e)throw new InternalError();return _0x3f653e[_0x2b25('0x26')]();})['then'](function(){_0x1eec6e[_0x2b25('0x19')](0xcc)['end']();})['catch'](handleError(_0x1eec6e,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 2b6c4ac..8870459 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 _0xc6ac=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x139a11,_0x4efd0e){_0x139a11=_0x139a11-0x0;var _0x1502e=_0xc6ac[_0x139a11];return _0x1502e;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc36=['square_recordings','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','SquareRecording'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc36,0x169));var _0x6bc3=function(_0x194af6,_0x3860a3){_0x194af6=_0x194af6-0x0;var _0x5b8045=_0xbc36[_0x194af6];return _0x5b8045;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var logger=require(_0x6bc3('0x1'))(_0x6bc3('0x2'));var moment=require(_0x6bc3('0x3'));var BPromise=require(_0x6bc3('0x4'));var rp=require(_0x6bc3('0x5'));var fs=require('fs');var path=require(_0x6bc3('0x6'));var rimraf=require(_0x6bc3('0x7'));var config=require(_0x6bc3('0x8'));var attributes=require(_0x6bc3('0x9'));module['exports']=function(_0x1c47e8,_0x4715c8){return _0x1c47e8['define'](_0x6bc3('0xa'),attributes,{'tableName':_0x6bc3('0xb'),'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 8579ca1..cdd0b71 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 _0x75d7=['error','message','result','catch','CreateSquareRecording','create','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5913de,_0x27ad85){var _0x3d3094=function(_0xa1b8db){while(--_0xa1b8db){_0x5913de['push'](_0x5913de['shift']());}};_0x3d3094(++_0x27ad85);}(_0x75d7,0x10e));var _0x775d=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0x75d7[_0xdbd4f7];return _0x5c3f9d;};'use strict';var _=require(_0x775d('0x0'));var util=require(_0x775d('0x1'));var moment=require(_0x775d('0x2'));var BPromise=require(_0x775d('0x3'));var rs=require(_0x775d('0x4'));var fs=require('fs');var Redis=require(_0x775d('0x5'));var db=require(_0x775d('0x6'))['db'];var utils=require(_0x775d('0x7'));var logger=require(_0x775d('0x8'))(_0x775d('0x9'));var config=require('../../config/environment');var jayson=require(_0x775d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25d7ff,_0xa377ad,_0x3a247f){return new BPromise(function(_0x19a66f,_0x3ae48e){return client['request'](_0x25d7ff,_0x3a247f)['then'](function(_0x24c3c2){logger[_0x775d('0xb')](_0x775d('0xc'),_0xa377ad,_0x775d('0xd'));logger['debug'](_0x775d('0xe'),_0xa377ad,_0x775d('0xd'),JSON[_0x775d('0xf')](_0x24c3c2));if(_0x24c3c2[_0x775d('0x10')]){if(_0x24c3c2['error']['code']===0x1f4){logger['error'](_0x775d('0xc'),_0xa377ad,_0x24c3c2['error']['message']);return _0x3ae48e(_0x24c3c2[_0x775d('0x10')][_0x775d('0x11')]);}logger[_0x775d('0x10')](_0x775d('0xc'),_0xa377ad,_0x24c3c2[_0x775d('0x10')]['message']);return _0x19a66f(_0x24c3c2[_0x775d('0x10')]['message']);}else{logger[_0x775d('0xb')](_0x775d('0xc'),_0xa377ad,_0x775d('0xd'));_0x19a66f(_0x24c3c2[_0x775d('0x12')]['message']);}})[_0x775d('0x13')](function(_0x4388cc){logger[_0x775d('0x10')]('SquareRecording,\x20%s,\x20%s',_0xa377ad,_0x4388cc);_0x3ae48e(_0x4388cc);});});}exports[_0x775d('0x14')]=function(_0x142175){var _0x242c6f=this;return new Promise(function(_0x3949a6,_0x386ae1){return db['SquareRecording'][_0x775d('0x15')](_0x142175['body'],{'raw':_0x142175[_0x775d('0x16')]?_0x142175[_0x775d('0x16')][_0x775d('0x17')]===undefined?!![]:![]:!![]})[_0x775d('0x18')](function(_0x49de7f){logger[_0x775d('0xb')]('CreateSquareRecording',_0x142175);logger[_0x775d('0x19')](_0x775d('0x14'),_0x142175,JSON[_0x775d('0xf')](_0x49de7f));_0x3949a6(_0x49de7f);})['catch'](function(_0x8022b2){logger['error'](_0x775d('0x14'),_0x8022b2['message'],_0x142175);_0x386ae1(_0x242c6f[_0x775d('0x10')](0x1f4,_0x8022b2['message']));});});}; \ No newline at end of file +var _0x5938=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','result','CreateSquareRecording','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x67e566,_0x7ade41){var _0x17070d=function(_0x21a608){while(--_0x21a608){_0x67e566['push'](_0x67e566['shift']());}};_0x17070d(++_0x7ade41);}(_0x5938,0x8a));var _0x8593=function(_0x59e673,_0x1d86cc){_0x59e673=_0x59e673-0x0;var _0x454806=_0x5938[_0x59e673];return _0x454806;};'use strict';var _=require(_0x8593('0x0'));var util=require(_0x8593('0x1'));var moment=require(_0x8593('0x2'));var BPromise=require(_0x8593('0x3'));var rs=require(_0x8593('0x4'));var fs=require('fs');var Redis=require(_0x8593('0x5'));var db=require(_0x8593('0x6'))['db'];var utils=require(_0x8593('0x7'));var logger=require('../../config/logger')(_0x8593('0x8'));var config=require(_0x8593('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8593('0xa')][_0x8593('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xec1d39,_0x2de17c,_0x34fe85){return new BPromise(function(_0x4f01df,_0x3b4bb8){return client[_0x8593('0xc')](_0xec1d39,_0x34fe85)[_0x8593('0xd')](function(_0x422608){logger[_0x8593('0xe')]('SquareRecording,\x20%s,\x20%s',_0x2de17c,'request\x20sent');logger[_0x8593('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x2de17c,_0x8593('0x10'),JSON[_0x8593('0x11')](_0x422608));if(_0x422608[_0x8593('0x12')]){if(_0x422608[_0x8593('0x12')][_0x8593('0x13')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x2de17c,_0x422608['error'][_0x8593('0x14')]);return _0x3b4bb8(_0x422608[_0x8593('0x12')]['message']);}logger[_0x8593('0x12')](_0x8593('0x15'),_0x2de17c,_0x422608[_0x8593('0x12')]['message']);return _0x4f01df(_0x422608[_0x8593('0x12')][_0x8593('0x14')]);}else{logger[_0x8593('0xe')]('SquareRecording,\x20%s,\x20%s',_0x2de17c,_0x8593('0x10'));_0x4f01df(_0x422608[_0x8593('0x16')][_0x8593('0x14')]);}})['catch'](function(_0x56789e){logger[_0x8593('0x12')](_0x8593('0x15'),_0x2de17c,_0x56789e);_0x3b4bb8(_0x56789e);});});}exports[_0x8593('0x17')]=function(_0x26c412){var _0x3ee00f=this;return new Promise(function(_0x4d5286,_0x2de38f){return db['SquareRecording'][_0x8593('0x18')](_0x26c412[_0x8593('0x19')],{'raw':_0x26c412[_0x8593('0x1a')]?_0x26c412[_0x8593('0x1a')][_0x8593('0x1b')]===undefined?!![]:![]:!![]})[_0x8593('0xd')](function(_0xab9ddc){logger[_0x8593('0xe')](_0x8593('0x17'),_0x26c412);logger[_0x8593('0xf')](_0x8593('0x17'),_0x26c412,JSON['stringify'](_0xab9ddc));_0x4d5286(_0xab9ddc);})[_0x8593('0x1c')](function(_0x51c4ef){logger[_0x8593('0x12')](_0x8593('0x17'),_0x51c4ef[_0x8593('0x14')],_0x26c412);_0x2de38f(_0x3ee00f[_0x8593('0x12')](0x1f4,_0x51c4ef[_0x8593('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b79dacb..ef2a8ba 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(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_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 +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(_0x1be790,_0x112549){var _0x7668c8=function(_0x47a470){while(--_0x47a470){_0x1be790['push'](_0x1be790['shift']());}};_0x7668c8(++_0x112549);}(_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 7bda945..69f32e9 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 _0xb5c7=['DATE','sequelize','exports','STRING'];(function(_0x4ec862,_0x2379e8){var _0x13d84a=function(_0x15308a){while(--_0x15308a){_0x4ec862['push'](_0x4ec862['shift']());}};_0x13d84a(++_0x2379e8);}(_0xb5c7,0x18d));var _0x7b5c=function(_0x45e408,_0x1d4839){_0x45e408=_0x45e408-0x0;var _0x23334a=_0xb5c7[_0x45e408];return _0x23334a;};'use strict';var Sequelize=require(_0x7b5c('0x0'));module[_0x7b5c('0x1')]={'network':{'type':Sequelize[_0x7b5c('0x2')]},'network_script':{'type':Sequelize[_0x7b5c('0x2')]},'request':{'type':Sequelize[_0x7b5c('0x2')]},'channel':{'type':Sequelize[_0x7b5c('0x2')]},'language':{'type':Sequelize[_0x7b5c('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7b5c('0x2')]},'version':{'type':Sequelize[_0x7b5c('0x2')]},'callerid':{'type':Sequelize[_0x7b5c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x7b5c('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x7b5c('0x2')]},'callingtns':{'type':Sequelize[_0x7b5c('0x2')]},'dnid':{'type':Sequelize[_0x7b5c('0x2')]},'rdnis':{'type':Sequelize[_0x7b5c('0x2')]},'context':{'type':Sequelize[_0x7b5c('0x2')]},'extension':{'type':Sequelize[_0x7b5c('0x2')]},'priority':{'type':Sequelize[_0x7b5c('0x2')]},'enhanced':{'type':Sequelize[_0x7b5c('0x2')]},'accountcode':{'type':Sequelize[_0x7b5c('0x2')]},'threadid':{'type':Sequelize[_0x7b5c('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7b5c('0x3')]},'leaveAt':{'type':Sequelize[_0x7b5c('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa57f=['STRING','DATE','exports'];(function(_0x15d3c0,_0x26c7d8){var _0x43a177=function(_0x1f97fb){while(--_0x1f97fb){_0x15d3c0['push'](_0x15d3c0['shift']());}};_0x43a177(++_0x26c7d8);}(_0xa57f,0x77));var _0xfa57=function(_0x1fed79,_0x4d61ce){_0x1fed79=_0x1fed79-0x0;var _0x2b16b3=_0xa57f[_0x1fed79];return _0x2b16b3;};'use strict';var Sequelize=require('sequelize');module[_0xfa57('0x0')]={'network':{'type':Sequelize[_0xfa57('0x1')]},'network_script':{'type':Sequelize[_0xfa57('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfa57('0x1')]},'type':{'type':Sequelize[_0xfa57('0x1')]},'uniqueid':{'type':Sequelize[_0xfa57('0x1')]},'version':{'type':Sequelize[_0xfa57('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfa57('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xfa57('0x1')]},'callington':{'type':Sequelize[_0xfa57('0x1')]},'callingtns':{'type':Sequelize[_0xfa57('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xfa57('0x1')]},'context':{'type':Sequelize[_0xfa57('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xfa57('0x1')]},'accountcode':{'type':Sequelize[_0xfa57('0x1')]},'threadid':{'type':Sequelize[_0xfa57('0x1')]},'project_name':{'type':Sequelize[_0xfa57('0x1')]},'joinAt':{'type':Sequelize[_0xfa57('0x2')]},'leaveAt':{'type':Sequelize[_0xfa57('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 2d35785..1089118 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 _0xebbb=['limit','count','set','Content-Range','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','keys','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','intersection','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x48570e,_0xbf3c6c){var _0x393daf=function(_0x546d9c){while(--_0x546d9c){_0x48570e['push'](_0x48570e['shift']());}};_0x393daf(++_0xbf3c6c);}(_0xebbb,0x75));var _0xbebb=function(_0x1a6e4e,_0x5bad07){_0x1a6e4e=_0x1a6e4e-0x0;var _0x2f2d21=_0xebbb[_0x1a6e4e];return _0x2f2d21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbebb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbebb('0x1'));var rp=require(_0xbebb('0x2'));var moment=require(_0xbebb('0x3'));var BPromise=require(_0xbebb('0x4'));var Mustache=require(_0xbebb('0x5'));var util=require(_0xbebb('0x6'));var path=require(_0xbebb('0x7'));var sox=require('sox');var csv=require(_0xbebb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbebb('0x9'));var _=require(_0xbebb('0xa'));var squel=require(_0xbebb('0xb'));var crypto=require('crypto');var jsforce=require(_0xbebb('0xc'));var deskjs=require(_0xbebb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbebb('0xe'));var Redis=require(_0xbebb('0xf'));var authService=require(_0xbebb('0x10'));var qs=require(_0xbebb('0x11'));var as=require(_0xbebb('0x12'));var hardwareService=require(_0xbebb('0x13'));var logger=require(_0xbebb('0x14'))('api');var utils=require(_0xbebb('0x15'));var config=require(_0xbebb('0x16'));var licenseUtil=require(_0xbebb('0x17'));var db=require(_0xbebb('0x18'))['db'];function respondWithStatusCode(_0x225d64,_0x296c3e){_0x296c3e=_0x296c3e||0xcc;return function(_0x73ac67){if(_0x73ac67){return _0x225d64[_0xbebb('0x19')](_0x296c3e);}return _0x225d64[_0xbebb('0x1a')](_0x296c3e)[_0xbebb('0x1b')]();};}function respondWithResult(_0x509c05,_0x470121){_0x470121=_0x470121||0xc8;return function(_0x1636ac){if(_0x1636ac){return _0x509c05['status'](_0x470121)[_0xbebb('0x1c')](_0x1636ac);}};}function respondWithFilteredResult(_0x68e4fb,_0x135059){return function(_0x378b9d){if(_0x378b9d){var _0x1f9fc3=typeof _0x135059[_0xbebb('0x1d')]===_0xbebb('0x1e')&&typeof _0x135059[_0xbebb('0x1f')]==='undefined';var _0x800b7=_0x378b9d[_0xbebb('0x20')];var _0x4d8e4f=_0x1f9fc3?0x0:_0x135059[_0xbebb('0x1d')];var _0x426497=_0x1f9fc3?_0x378b9d[_0xbebb('0x20')]:_0x135059['offset']+_0x135059[_0xbebb('0x1f')];var _0x5bb188;if(_0x426497>=_0x800b7){_0x426497=_0x800b7;_0x5bb188=0xc8;}else{_0x5bb188=0xce;}_0x68e4fb[_0xbebb('0x1a')](_0x5bb188);return _0x68e4fb[_0xbebb('0x21')](_0xbebb('0x22'),_0x4d8e4f+'-'+_0x426497+'/'+_0x800b7)[_0xbebb('0x1c')](_0x378b9d);}return null;};}function patchUpdates(_0x54310d){return function(_0x52a85d){try{jsonpatch['apply'](_0x52a85d,_0x54310d,!![]);}catch(_0x55a320){return BPromise['reject'](_0x55a320);}return _0x52a85d[_0xbebb('0x23')]();};}function saveUpdates(_0x48c200,_0x270d47){return function(_0x6102c1){if(_0x6102c1){return _0x6102c1[_0xbebb('0x24')](_0x48c200)[_0xbebb('0x25')](function(_0x15a5c4){return _0x15a5c4;});}return null;};}function removeEntity(_0x312e2c,_0x4fc40f){return function(_0x446e8c){if(_0x446e8c){return _0x446e8c['destroy']()[_0xbebb('0x25')](function(){_0x312e2c[_0xbebb('0x1a')](0xcc)[_0xbebb('0x1b')]();});}};}function handleEntityNotFound(_0x34324d,_0x34de8b){return function(_0x33552d){if(!_0x33552d){_0x34324d[_0xbebb('0x19')](0x194);}return _0x33552d;};}function handleError(_0x5b8d04,_0x28ebdc){_0x28ebdc=_0x28ebdc||0x1f4;return function(_0x66c549){logger[_0xbebb('0x26')](_0x66c549[_0xbebb('0x27')]);if(_0x66c549[_0xbebb('0x28')]){delete _0x66c549[_0xbebb('0x28')];}_0x5b8d04[_0xbebb('0x1a')](_0x28ebdc)[_0xbebb('0x29')](_0x66c549);};}exports[_0xbebb('0x2a')]=function(_0x4b274b,_0x2b6f11){var _0x230e3e={},_0x48d217={},_0x1ebeae={'count':0x0,'rows':[]};var _0x4fd07d=_[_0xbebb('0x2b')](db[_0xbebb('0x2c')][_0xbebb('0x2d')],function(_0x19e42c){return{'name':_0x19e42c[_0xbebb('0x2e')],'type':_0x19e42c['type']['key']};});_0x48d217['model']=_['map'](_0x4fd07d,_0xbebb('0x28'));_0x48d217['query']=_[_0xbebb('0x2f')](_0x4b274b['query']);_0x48d217['filters']=_['intersection'](_0x48d217[_0xbebb('0x30')],_0x48d217[_0xbebb('0x31')]);_0x230e3e[_0xbebb('0x32')]=_['intersection'](_0x48d217['model'],qs[_0xbebb('0x33')](_0x4b274b['query']['fields']));_0x230e3e[_0xbebb('0x32')]=_0x230e3e[_0xbebb('0x32')][_0xbebb('0x34')]?_0x230e3e[_0xbebb('0x32')]:_0x48d217['model'];if(!_0x4b274b['query'][_0xbebb('0x35')]('nolimit')){_0x230e3e['limit']=qs['limit'](_0x4b274b[_0xbebb('0x31')]['limit']);_0x230e3e['offset']=qs[_0xbebb('0x1d')](_0x4b274b['query']['offset']);}_0x230e3e[_0xbebb('0x36')]=qs[_0xbebb('0x37')](_0x4b274b[_0xbebb('0x31')]['sort']);_0x230e3e[_0xbebb('0x38')]=qs[_0xbebb('0x39')](_[_0xbebb('0x3a')](_0x4b274b[_0xbebb('0x31')],_0x48d217[_0xbebb('0x39')]),_0x4fd07d);if(_0x4b274b['query'][_0xbebb('0x3b')]){_0x230e3e[_0xbebb('0x38')]=_[_0xbebb('0x3c')](_0x230e3e[_0xbebb('0x38')],{'$or':_['map'](_0x4fd07d,function(_0x25a1cf){if(_0x25a1cf[_0xbebb('0x3d')]!=='VIRTUAL'){var _0x1f492e={};_0x1f492e[_0x25a1cf['name']]={'$like':'%'+_0x4b274b['query']['filter']+'%'};return _0x1f492e;}})});}_0x230e3e=_[_0xbebb('0x3c')]({},_0x230e3e,_0x4b274b[_0xbebb('0x3e')]);var _0x184d37={'where':_0x230e3e[_0xbebb('0x38')]};return db[_0xbebb('0x2c')][_0xbebb('0x20')](_0x184d37)[_0xbebb('0x25')](function(_0x477b59){_0x1ebeae[_0xbebb('0x20')]=_0x477b59;if(_0x4b274b['query'][_0xbebb('0x3f')]){_0x230e3e[_0xbebb('0x40')]=[{'all':!![]}];}return db[_0xbebb('0x2c')][_0xbebb('0x41')](_0x230e3e);})[_0xbebb('0x25')](function(_0x442894){_0x1ebeae[_0xbebb('0x42')]=_0x442894;return _0x1ebeae;})[_0xbebb('0x25')](respondWithFilteredResult(_0x2b6f11,_0x230e3e))[_0xbebb('0x43')](handleError(_0x2b6f11,null));};exports['show']=function(_0x295b52,_0x5a116a){var _0x321edb={'raw':!![],'where':{'id':_0x295b52[_0xbebb('0x44')]['id']}},_0x574f00={};_0x574f00[_0xbebb('0x30')]=_['keys'](db[_0xbebb('0x2c')][_0xbebb('0x2d')]);_0x574f00['query']=_[_0xbebb('0x2f')](_0x295b52[_0xbebb('0x31')]);_0x574f00[_0xbebb('0x39')]=_[_0xbebb('0x45')](_0x574f00[_0xbebb('0x30')],_0x574f00[_0xbebb('0x31')]);_0x321edb[_0xbebb('0x32')]=_[_0xbebb('0x45')](_0x574f00['model'],qs['fields'](_0x295b52['query'][_0xbebb('0x33')]));_0x321edb[_0xbebb('0x32')]=_0x321edb[_0xbebb('0x32')]['length']?_0x321edb[_0xbebb('0x32')]:_0x574f00['model'];if(_0x295b52[_0xbebb('0x31')][_0xbebb('0x3f')]){_0x321edb[_0xbebb('0x40')]=[{'all':!![]}];}_0x321edb=_[_0xbebb('0x3c')]({},_0x321edb,_0x295b52[_0xbebb('0x3e')]);return db['SquareReport']['find'](_0x321edb)[_0xbebb('0x25')](handleEntityNotFound(_0x5a116a,null))[_0xbebb('0x25')](respondWithResult(_0x5a116a,null))[_0xbebb('0x43')](handleError(_0x5a116a,null));};exports['create']=function(_0x154b6f,_0xcb578a){return db[_0xbebb('0x2c')][_0xbebb('0x46')](_0x154b6f['body'],{})[_0xbebb('0x25')](respondWithResult(_0xcb578a,0xc9))[_0xbebb('0x43')](handleError(_0xcb578a,null));};exports[_0xbebb('0x24')]=function(_0xd3ea7c,_0x3ec001){if(_0xd3ea7c[_0xbebb('0x47')]['id']){delete _0xd3ea7c[_0xbebb('0x47')]['id'];}return db[_0xbebb('0x2c')][_0xbebb('0x48')]({'where':{'id':_0xd3ea7c[_0xbebb('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ec001,null))[_0xbebb('0x25')](saveUpdates(_0xd3ea7c[_0xbebb('0x47')],null))[_0xbebb('0x25')](respondWithResult(_0x3ec001,null))[_0xbebb('0x43')](handleError(_0x3ec001,null));};exports['destroy']=function(_0x4f21bb,_0xb5fe2b){return db[_0xbebb('0x2c')][_0xbebb('0x48')]({'where':{'id':_0x4f21bb['params']['id']}})[_0xbebb('0x25')](handleEntityNotFound(_0xb5fe2b,null))[_0xbebb('0x25')](removeEntity(_0xb5fe2b,null))[_0xbebb('0x43')](handleError(_0xb5fe2b,null));};exports['describe']=function(_0x434b6b,_0x239884){return db[_0xbebb('0x2c')][_0xbebb('0x49')]()['then'](respondWithResult(_0x239884,null))[_0xbebb('0x43')](handleError(_0x239884,null));}; \ No newline at end of file +var _0x0604=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','map','rawAttributes','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','SquareReport','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x17518d,_0x21e45e){var _0x1db386=function(_0x288740){while(--_0x288740){_0x17518d['push'](_0x17518d['shift']());}};_0x1db386(++_0x21e45e);}(_0x0604,0x10a));var _0x4060=function(_0x4189d8,_0x64a03e){_0x4189d8=_0x4189d8-0x0;var _0x48fc6a=_0x0604[_0x4189d8];return _0x48fc6a;};'use strict';var emlformat=require(_0x4060('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4060('0x1'));var jsonpatch=require(_0x4060('0x2'));var rp=require(_0x4060('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4060('0x4'));var util=require(_0x4060('0x5'));var path=require(_0x4060('0x6'));var sox=require('sox');var csv=require(_0x4060('0x7'));var ejs=require(_0x4060('0x8'));var fs=require('fs');var fs_extra=require(_0x4060('0x9'));var _=require(_0x4060('0xa'));var squel=require(_0x4060('0xb'));var crypto=require(_0x4060('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4060('0xd'));var toCsv=require(_0x4060('0x7'));var querystring=require(_0x4060('0xe'));var Papa=require('papaparse');var Redis=require(_0x4060('0xf'));var authService=require(_0x4060('0x10'));var qs=require(_0x4060('0x11'));var as=require(_0x4060('0x12'));var hardwareService=require(_0x4060('0x13'));var logger=require(_0x4060('0x14'))(_0x4060('0x15'));var utils=require('../../config/utils');var config=require(_0x4060('0x16'));var licenseUtil=require(_0x4060('0x17'));var db=require(_0x4060('0x18'))['db'];function respondWithStatusCode(_0x2a3929,_0xe8e094){_0xe8e094=_0xe8e094||0xcc;return function(_0x29f8ac){if(_0x29f8ac){return _0x2a3929[_0x4060('0x19')](_0xe8e094);}return _0x2a3929['status'](_0xe8e094)[_0x4060('0x1a')]();};}function respondWithResult(_0x442f4a,_0x18e32a){_0x18e32a=_0x18e32a||0xc8;return function(_0xb65e26){if(_0xb65e26){return _0x442f4a[_0x4060('0x1b')](_0x18e32a)['json'](_0xb65e26);}};}function respondWithFilteredResult(_0x1f6d2d,_0xa8f6b4){return function(_0x550421){if(_0x550421){var _0x251491=typeof _0xa8f6b4[_0x4060('0x1c')]===_0x4060('0x1d')&&typeof _0xa8f6b4[_0x4060('0x1e')]==='undefined';var _0x15fe52=_0x550421[_0x4060('0x1f')];var _0x31e343=_0x251491?0x0:_0xa8f6b4['offset'];var _0x303b74=_0x251491?_0x550421['count']:_0xa8f6b4['offset']+_0xa8f6b4[_0x4060('0x1e')];var _0x409153;if(_0x303b74>=_0x15fe52){_0x303b74=_0x15fe52;_0x409153=0xc8;}else{_0x409153=0xce;}_0x1f6d2d[_0x4060('0x1b')](_0x409153);return _0x1f6d2d[_0x4060('0x20')](_0x4060('0x21'),_0x31e343+'-'+_0x303b74+'/'+_0x15fe52)['json'](_0x550421);}return null;};}function patchUpdates(_0xab37d){return function(_0x4b0fec){try{jsonpatch[_0x4060('0x22')](_0x4b0fec,_0xab37d,!![]);}catch(_0x3974f6){return BPromise[_0x4060('0x23')](_0x3974f6);}return _0x4b0fec['save']();};}function saveUpdates(_0x1cb044,_0x13fb77){return function(_0x15cbf6){if(_0x15cbf6){return _0x15cbf6[_0x4060('0x24')](_0x1cb044)['then'](function(_0x35647d){return _0x35647d;});}return null;};}function removeEntity(_0x18e4e1,_0x2b2425){return function(_0x26dce2){if(_0x26dce2){return _0x26dce2[_0x4060('0x25')]()[_0x4060('0x26')](function(){_0x18e4e1['status'](0xcc)[_0x4060('0x1a')]();});}};}function handleEntityNotFound(_0x93fe41,_0x2c2521){return function(_0x37a326){if(!_0x37a326){_0x93fe41[_0x4060('0x19')](0x194);}return _0x37a326;};}function handleError(_0x22cc8c,_0x3ae6b9){_0x3ae6b9=_0x3ae6b9||0x1f4;return function(_0x594c85){logger[_0x4060('0x27')](_0x594c85['stack']);if(_0x594c85[_0x4060('0x28')]){delete _0x594c85[_0x4060('0x28')];}_0x22cc8c[_0x4060('0x1b')](_0x3ae6b9)[_0x4060('0x29')](_0x594c85);};}exports['index']=function(_0x4efcb7,_0x481ce6){var _0x26fb68={},_0xdcf9a={},_0x4176cc={'count':0x0,'rows':[]};var _0x4ab60c=_[_0x4060('0x2a')](db['SquareReport'][_0x4060('0x2b')],function(_0x6ccf8){return{'name':_0x6ccf8['fieldName'],'type':_0x6ccf8[_0x4060('0x2c')]['key']};});_0xdcf9a[_0x4060('0x2d')]=_[_0x4060('0x2a')](_0x4ab60c,_0x4060('0x28'));_0xdcf9a['query']=_[_0x4060('0x2e')](_0x4efcb7[_0x4060('0x2f')]);_0xdcf9a['filters']=_['intersection'](_0xdcf9a[_0x4060('0x2d')],_0xdcf9a['query']);_0x26fb68[_0x4060('0x30')]=_[_0x4060('0x31')](_0xdcf9a[_0x4060('0x2d')],qs[_0x4060('0x32')](_0x4efcb7[_0x4060('0x2f')][_0x4060('0x32')]));_0x26fb68[_0x4060('0x30')]=_0x26fb68[_0x4060('0x30')][_0x4060('0x33')]?_0x26fb68[_0x4060('0x30')]:_0xdcf9a['model'];if(!_0x4efcb7[_0x4060('0x2f')][_0x4060('0x34')](_0x4060('0x35'))){_0x26fb68['limit']=qs[_0x4060('0x1e')](_0x4efcb7[_0x4060('0x2f')]['limit']);_0x26fb68[_0x4060('0x1c')]=qs[_0x4060('0x1c')](_0x4efcb7[_0x4060('0x2f')][_0x4060('0x1c')]);}_0x26fb68[_0x4060('0x36')]=qs[_0x4060('0x37')](_0x4efcb7[_0x4060('0x2f')]['sort']);_0x26fb68[_0x4060('0x38')]=qs[_0x4060('0x39')](_[_0x4060('0x3a')](_0x4efcb7['query'],_0xdcf9a['filters']),_0x4ab60c);if(_0x4efcb7[_0x4060('0x2f')][_0x4060('0x3b')]){_0x26fb68[_0x4060('0x38')]=_[_0x4060('0x3c')](_0x26fb68['where'],{'$or':_[_0x4060('0x2a')](_0x4ab60c,function(_0x27e5f9){if(_0x27e5f9[_0x4060('0x2c')]!=='VIRTUAL'){var _0x385f9a={};_0x385f9a[_0x27e5f9['name']]={'$like':'%'+_0x4efcb7[_0x4060('0x2f')][_0x4060('0x3b')]+'%'};return _0x385f9a;}})});}_0x26fb68=_[_0x4060('0x3c')]({},_0x26fb68,_0x4efcb7[_0x4060('0x3d')]);var _0x28e6dd={'where':_0x26fb68[_0x4060('0x38')]};return db[_0x4060('0x3e')]['count'](_0x28e6dd)['then'](function(_0x4be517){_0x4176cc['count']=_0x4be517;if(_0x4efcb7['query'][_0x4060('0x3f')]){_0x26fb68[_0x4060('0x40')]=[{'all':!![]}];}return db[_0x4060('0x3e')][_0x4060('0x41')](_0x26fb68);})[_0x4060('0x26')](function(_0x17d9fb){_0x4176cc['rows']=_0x17d9fb;return _0x4176cc;})[_0x4060('0x26')](respondWithFilteredResult(_0x481ce6,_0x26fb68))[_0x4060('0x42')](handleError(_0x481ce6,null));};exports[_0x4060('0x43')]=function(_0x21c902,_0x5e97f1){var _0x845631={'raw':!![],'where':{'id':_0x21c902[_0x4060('0x44')]['id']}},_0x10bc59={};_0x10bc59[_0x4060('0x2d')]=_[_0x4060('0x2e')](db[_0x4060('0x3e')][_0x4060('0x2b')]);_0x10bc59[_0x4060('0x2f')]=_[_0x4060('0x2e')](_0x21c902[_0x4060('0x2f')]);_0x10bc59[_0x4060('0x39')]=_[_0x4060('0x31')](_0x10bc59['model'],_0x10bc59[_0x4060('0x2f')]);_0x845631[_0x4060('0x30')]=_[_0x4060('0x31')](_0x10bc59[_0x4060('0x2d')],qs[_0x4060('0x32')](_0x21c902[_0x4060('0x2f')]['fields']));_0x845631[_0x4060('0x30')]=_0x845631[_0x4060('0x30')][_0x4060('0x33')]?_0x845631[_0x4060('0x30')]:_0x10bc59[_0x4060('0x2d')];if(_0x21c902[_0x4060('0x2f')]['includeAll']){_0x845631[_0x4060('0x40')]=[{'all':!![]}];}_0x845631=_[_0x4060('0x3c')]({},_0x845631,_0x21c902[_0x4060('0x3d')]);return db['SquareReport'][_0x4060('0x45')](_0x845631)[_0x4060('0x26')](handleEntityNotFound(_0x5e97f1,null))[_0x4060('0x26')](respondWithResult(_0x5e97f1,null))[_0x4060('0x42')](handleError(_0x5e97f1,null));};exports[_0x4060('0x46')]=function(_0x2d73e6,_0x18fffe){return db[_0x4060('0x3e')][_0x4060('0x46')](_0x2d73e6[_0x4060('0x47')],{})[_0x4060('0x26')](respondWithResult(_0x18fffe,0xc9))[_0x4060('0x42')](handleError(_0x18fffe,null));};exports[_0x4060('0x24')]=function(_0x4c533d,_0x1953d0){if(_0x4c533d['body']['id']){delete _0x4c533d[_0x4060('0x47')]['id'];}return db[_0x4060('0x3e')]['find']({'where':{'id':_0x4c533d[_0x4060('0x44')]['id']}})[_0x4060('0x26')](handleEntityNotFound(_0x1953d0,null))[_0x4060('0x26')](saveUpdates(_0x4c533d['body'],null))['then'](respondWithResult(_0x1953d0,null))[_0x4060('0x42')](handleError(_0x1953d0,null));};exports[_0x4060('0x25')]=function(_0x17e2d1,_0x4aca89){return db['SquareReport'][_0x4060('0x45')]({'where':{'id':_0x17e2d1[_0x4060('0x44')]['id']}})['then'](handleEntityNotFound(_0x4aca89,null))[_0x4060('0x26')](removeEntity(_0x4aca89,null))['catch'](handleError(_0x4aca89,null));};exports['describe']=function(_0x47afbb,_0x515b16){return db[_0x4060('0x3e')][_0x4060('0x48')]()[_0x4060('0x26')](respondWithResult(_0x515b16,null))[_0x4060('0x42')](handleError(_0x515b16,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index fa9c931..6184db6 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 _0xd4ae=['rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','util','path'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd4ae,0xf0));var _0xed4a=function(_0x4a325a,_0x2c154c){_0x4a325a=_0x4a325a-0x0;var _0x2597a1=_0xd4ae[_0x4a325a];return _0x2597a1;};'use strict';var _=require('lodash');var util=require(_0xed4a('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xed4a('0x1'));var rimraf=require(_0xed4a('0x2'));var config=require(_0xed4a('0x3'));var attributes=require(_0xed4a('0x4'));module['exports']=function(_0x25fdc6,_0x8cc1c7){return _0x25fdc6[_0xed4a('0x5')](_0xed4a('0x6'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xed4a('0x7'),'fields':[_0xed4a('0x8'),_0xed4a('0x9')]},{'name':_0xed4a('0xa'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x658c=['request-promise','path','../../config/environment','./squareReport.attributes','exports','define','uid_pname','project_name','leaveAt','lodash','util','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x658c,0xdb));var _0xc658=function(_0x274bb4,_0x34f2a7){_0x274bb4=_0x274bb4-0x0;var _0x471910=_0x658c[_0x274bb4];return _0x471910;};'use strict';var _=require(_0xc658('0x0'));var util=require(_0xc658('0x1'));var logger=require('../../config/logger')(_0xc658('0x2'));var moment=require(_0xc658('0x3'));var BPromise=require(_0xc658('0x4'));var rp=require(_0xc658('0x5'));var fs=require('fs');var path=require(_0xc658('0x6'));var rimraf=require('rimraf');var config=require(_0xc658('0x7'));var attributes=require(_0xc658('0x8'));module[_0xc658('0x9')]=function(_0x512f74,_0x169c52){return _0x512f74[_0xc658('0xa')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xc658('0xb'),'fields':['uniqueid',_0xc658('0xc')]},{'name':_0xc658('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 0c418d4..91aac7d 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 _0xbff4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareReport','body','options','raw','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring'];(function(_0x569cbc,_0x5f5db2){var _0x54a5f5=function(_0xc7f075){while(--_0xc7f075){_0x569cbc['push'](_0x569cbc['shift']());}};_0x54a5f5(++_0x5f5db2);}(_0xbff4,0x88));var _0x4bff=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xbff4[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0x4bff('0x0'));var util=require('util');var moment=require(_0x4bff('0x1'));var BPromise=require(_0x4bff('0x2'));var rs=require(_0x4bff('0x3'));var fs=require('fs');var Redis=require(_0x4bff('0x4'));var db=require(_0x4bff('0x5'))['db'];var utils=require(_0x4bff('0x6'));var logger=require(_0x4bff('0x7'))('rpc');var config=require(_0x4bff('0x8'));var jayson=require(_0x4bff('0x9'));var client=jayson[_0x4bff('0xa')][_0x4bff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26ef1d,_0xa5b205,_0x269ce8){return new BPromise(function(_0x2d4f66,_0xaff7fe){return client[_0x4bff('0xc')](_0x26ef1d,_0x269ce8)[_0x4bff('0xd')](function(_0x421ff8){logger['info'](_0x4bff('0xe'),_0xa5b205,_0x4bff('0xf'));logger[_0x4bff('0x10')](_0x4bff('0x11'),_0xa5b205,_0x4bff('0xf'),JSON[_0x4bff('0x12')](_0x421ff8));if(_0x421ff8[_0x4bff('0x13')]){if(_0x421ff8[_0x4bff('0x13')][_0x4bff('0x14')]===0x1f4){logger[_0x4bff('0x13')](_0x4bff('0xe'),_0xa5b205,_0x421ff8['error'][_0x4bff('0x15')]);return _0xaff7fe(_0x421ff8[_0x4bff('0x13')]['message']);}logger[_0x4bff('0x13')]('SquareReport,\x20%s,\x20%s',_0xa5b205,_0x421ff8['error'][_0x4bff('0x15')]);return _0x2d4f66(_0x421ff8[_0x4bff('0x13')][_0x4bff('0x15')]);}else{logger[_0x4bff('0x16')](_0x4bff('0xe'),_0xa5b205,_0x4bff('0xf'));_0x2d4f66(_0x421ff8[_0x4bff('0x17')][_0x4bff('0x15')]);}})[_0x4bff('0x18')](function(_0x1c6248){logger[_0x4bff('0x13')](_0x4bff('0xe'),_0xa5b205,_0x1c6248);_0xaff7fe(_0x1c6248);});});}exports['CreateSquareReport']=function(_0x476e6b){var _0x345c08=this;return new Promise(function(_0x12ade4,_0x4b0510){return db[_0x4bff('0x19')]['create'](_0x476e6b[_0x4bff('0x1a')],{'raw':_0x476e6b[_0x4bff('0x1b')]?_0x476e6b[_0x4bff('0x1b')][_0x4bff('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x54c011){logger[_0x4bff('0x16')](_0x4bff('0x1d'),_0x476e6b);logger[_0x4bff('0x10')](_0x4bff('0x1d'),_0x476e6b,JSON[_0x4bff('0x12')](_0x54c011));_0x12ade4(_0x54c011);})['catch'](function(_0x27ae75){logger[_0x4bff('0x13')](_0x4bff('0x1d'),_0x27ae75[_0x4bff('0x15')],_0x476e6b);_0x4b0510(_0x345c08[_0x4bff('0x13')](0x1f4,_0x27ae75[_0x4bff('0x15')]));});});};exports[_0x4bff('0x1e')]=function(_0x1b120f){var _0x5f1434=this;return new Promise(function(_0x315769,_0x49de18){return db[_0x4bff('0x19')][_0x4bff('0x1f')](_0x1b120f[_0x4bff('0x1a')],{'raw':_0x1b120f[_0x4bff('0x1b')]?_0x1b120f[_0x4bff('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b120f[_0x4bff('0x1b')]?_0x1b120f[_0x4bff('0x1b')][_0x4bff('0x20')]||null:null,'attributes':_0x1b120f[_0x4bff('0x1b')]?_0x1b120f[_0x4bff('0x1b')][_0x4bff('0x21')]||null:null,'limit':_0x1b120f[_0x4bff('0x1b')]?_0x1b120f[_0x4bff('0x1b')][_0x4bff('0x22')]||null:null})[_0x4bff('0xd')](function(_0x2b816f){logger['info'](_0x4bff('0x1e'),_0x1b120f);logger[_0x4bff('0x10')](_0x4bff('0x1e'),_0x1b120f,JSON['stringify'](_0x2b816f));_0x315769(_0x2b816f);})['catch'](function(_0x54866a){logger[_0x4bff('0x13')](_0x4bff('0x1e'),_0x54866a['message'],_0x1b120f);_0x49de18(_0x5f1434[_0x4bff('0x13')](0x1f4,_0x54866a['message']));});});}; \ No newline at end of file +var _0x2224=['SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateSquareReport','SquareReport','create','body','options','raw','then','UpdateSquareReport','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','SquareReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2631f6,_0x552ce5){var _0x45917c=function(_0x14b140){while(--_0x14b140){_0x2631f6['push'](_0x2631f6['shift']());}};_0x45917c(++_0x552ce5);}(_0x2224,0x100));var _0x4222=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0x2224[_0x158f01];return _0x5ef74e;};'use strict';var _=require(_0x4222('0x0'));var util=require(_0x4222('0x1'));var moment=require(_0x4222('0x2'));var BPromise=require(_0x4222('0x3'));var rs=require(_0x4222('0x4'));var fs=require('fs');var Redis=require(_0x4222('0x5'));var db=require(_0x4222('0x6'))['db'];var utils=require(_0x4222('0x7'));var logger=require(_0x4222('0x8'))(_0x4222('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4222('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4592cc,_0x5b77cd,_0x4b2942){return new BPromise(function(_0x1c8462,_0x56bf1e){return client['request'](_0x4592cc,_0x4b2942)['then'](function(_0x4ac95f){logger['info'](_0x4222('0xb'),_0x5b77cd,_0x4222('0xc'));logger[_0x4222('0xd')](_0x4222('0xe'),_0x5b77cd,'request\x20sent',JSON[_0x4222('0xf')](_0x4ac95f));if(_0x4ac95f[_0x4222('0x10')]){if(_0x4ac95f[_0x4222('0x10')][_0x4222('0x11')]===0x1f4){logger[_0x4222('0x10')](_0x4222('0xb'),_0x5b77cd,_0x4ac95f[_0x4222('0x10')][_0x4222('0x12')]);return _0x56bf1e(_0x4ac95f['error']['message']);}logger['error'](_0x4222('0xb'),_0x5b77cd,_0x4ac95f[_0x4222('0x10')][_0x4222('0x12')]);return _0x1c8462(_0x4ac95f[_0x4222('0x10')]['message']);}else{logger[_0x4222('0x13')](_0x4222('0xb'),_0x5b77cd,'request\x20sent');_0x1c8462(_0x4ac95f['result']['message']);}})['catch'](function(_0x431be2){logger[_0x4222('0x10')](_0x4222('0xb'),_0x5b77cd,_0x431be2);_0x56bf1e(_0x431be2);});});}exports[_0x4222('0x14')]=function(_0x497d3b){var _0x28e7d4=this;return new Promise(function(_0x5e6349,_0x3fb012){return db[_0x4222('0x15')][_0x4222('0x16')](_0x497d3b[_0x4222('0x17')],{'raw':_0x497d3b[_0x4222('0x18')]?_0x497d3b[_0x4222('0x18')][_0x4222('0x19')]===undefined?!![]:![]:!![]})[_0x4222('0x1a')](function(_0x1f0c03){logger[_0x4222('0x13')](_0x4222('0x14'),_0x497d3b);logger[_0x4222('0xd')](_0x4222('0x14'),_0x497d3b,JSON[_0x4222('0xf')](_0x1f0c03));_0x5e6349(_0x1f0c03);})['catch'](function(_0x5b8391){logger[_0x4222('0x10')]('CreateSquareReport',_0x5b8391[_0x4222('0x12')],_0x497d3b);_0x3fb012(_0x28e7d4[_0x4222('0x10')](0x1f4,_0x5b8391[_0x4222('0x12')]));});});};exports[_0x4222('0x1b')]=function(_0x112141){var _0x59375c=this;return new Promise(function(_0x351334,_0x162986){return db[_0x4222('0x15')]['update'](_0x112141[_0x4222('0x17')],{'raw':_0x112141[_0x4222('0x18')]?_0x112141[_0x4222('0x18')][_0x4222('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x112141[_0x4222('0x18')]?_0x112141['options']['where']||null:null,'attributes':_0x112141[_0x4222('0x18')]?_0x112141[_0x4222('0x18')][_0x4222('0x1c')]||null:null,'limit':_0x112141[_0x4222('0x18')]?_0x112141['options']['limit']||null:null})[_0x4222('0x1a')](function(_0x4d8ede){logger[_0x4222('0x13')]('UpdateSquareReport',_0x112141);logger[_0x4222('0xd')](_0x4222('0x1b'),_0x112141,JSON[_0x4222('0xf')](_0x4d8ede));_0x351334(_0x4d8ede);})[_0x4222('0x1d')](function(_0x3bb3fd){logger[_0x4222('0x10')](_0x4222('0x1b'),_0x3bb3fd[_0x4222('0x12')],_0x112141);_0x162986(_0x59375c[_0x4222('0x10')](0x1f4,_0x3bb3fd[_0x4222('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 2cef29c..712c3ff 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 _0xcfed=['put','update','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x25876f,_0x1cde81){var _0x12b939=function(_0x1593f8){while(--_0x1593f8){_0x25876f['push'](_0x25876f['shift']());}};_0x12b939(++_0x1cde81);}(_0xcfed,0xe2));var _0xdcfe=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xcfed[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xdcfe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdcfe('0x1'));var express=require(_0xdcfe('0x2'));var router=express[_0xdcfe('0x3')]();var fs_extra=require(_0xdcfe('0x4'));var auth=require(_0xdcfe('0x5'));var interaction=require(_0xdcfe('0x6'));var config=require('../../config/environment');var controller=require(_0xdcfe('0x7'));router[_0xdcfe('0x8')]('/',auth[_0xdcfe('0x9')](),controller[_0xdcfe('0xa')]);router[_0xdcfe('0x8')](_0xdcfe('0xb'),auth[_0xdcfe('0x9')](),controller[_0xdcfe('0xc')]);router['get']('/:id',auth[_0xdcfe('0x9')](),controller[_0xdcfe('0xd')]);router[_0xdcfe('0xe')]('/',auth['isAuthenticated'](),controller[_0xdcfe('0xf')]);router[_0xdcfe('0x10')]('/:id',auth[_0xdcfe('0x9')](),controller[_0xdcfe('0x11')]);router[_0xdcfe('0x12')](_0xdcfe('0x13'),auth[_0xdcfe('0x9')](),controller[_0xdcfe('0x14')]);module[_0xdcfe('0x15')]=router; \ No newline at end of file +var _0x4f0a=['isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','get'];(function(_0x436f7a,_0x4789fb){var _0x3fc682=function(_0x4def0d){while(--_0x4def0d){_0x436f7a['push'](_0x436f7a['shift']());}};_0x3fc682(++_0x4789fb);}(_0x4f0a,0x83));var _0xa4f0=function(_0x1f9503,_0x8e450b){_0x1f9503=_0x1f9503-0x0;var _0xaab94f=_0x4f0a[_0x1f9503];return _0xaab94f;};'use strict';var multer=require(_0xa4f0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa4f0('0x1'));var express=require('express');var router=express[_0xa4f0('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa4f0('0x3'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xa4f0('0x4')]('/',auth[_0xa4f0('0x5')](),controller[_0xa4f0('0x6')]);router[_0xa4f0('0x4')](_0xa4f0('0x7'),auth[_0xa4f0('0x5')](),controller[_0xa4f0('0x8')]);router[_0xa4f0('0x4')]('/:id',auth[_0xa4f0('0x5')](),controller[_0xa4f0('0x9')]);router[_0xa4f0('0xa')]('/',auth[_0xa4f0('0x5')](),controller['create']);router[_0xa4f0('0xb')](_0xa4f0('0xc'),auth[_0xa4f0('0x5')](),controller[_0xa4f0('0xd')]);router[_0xa4f0('0xe')](_0xa4f0('0xc'),auth[_0xa4f0('0x5')](),controller[_0xa4f0('0xf')]);module[_0xa4f0('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 9465b4c..f5cfdf9 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 _0x10da=['exports','STRING','TEXT'];(function(_0x598475,_0x4405d2){var _0x304ec2=function(_0xc8cb7b){while(--_0xc8cb7b){_0x598475['push'](_0x598475['shift']());}};_0x304ec2(++_0x4405d2);}(_0x10da,0xea));var _0xa10d=function(_0x2b48a9,_0x2ff169){_0x2b48a9=_0x2b48a9-0x0;var _0x4b926c=_0x10da[_0x2b48a9];return _0x4b926c;};'use strict';var Sequelize=require('sequelize');module[_0xa10d('0x0')]={'uniqueid':{'type':Sequelize[_0xa10d('0x1')]},'node':{'type':Sequelize[_0xa10d('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xa10d('0x2')]},'project_name':{'type':Sequelize[_0xa10d('0x1')]},'callerid':{'type':Sequelize[_0xa10d('0x1')]}}; \ No newline at end of file +var _0xaa5e=['TEXT','sequelize','exports','STRING'];(function(_0x3fa631,_0x24392c){var _0x5c9dec=function(_0x36d01a){while(--_0x36d01a){_0x3fa631['push'](_0x3fa631['shift']());}};_0x5c9dec(++_0x24392c);}(_0xaa5e,0x10d));var _0xeaa5=function(_0x2d2f01,_0x3963e8){_0x2d2f01=_0x2d2f01-0x0;var _0x58a187=_0xaa5e[_0x2d2f01];return _0x58a187;};'use strict';var Sequelize=require(_0xeaa5('0x0'));module[_0xeaa5('0x1')]={'uniqueid':{'type':Sequelize[_0xeaa5('0x2')]},'node':{'type':Sequelize[_0xeaa5('0x2')]},'application':{'type':Sequelize[_0xeaa5('0x2')]},'data':{'type':Sequelize[_0xeaa5('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xeaa5('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 3c0b964..f4cc4ab 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 _0x6595=['sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','SquareDetailsReport','rawAttributes','fields','include','find','create','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','keys','attributes','intersection','length','nolimit','order'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0x6595,0xb2));var _0x5659=function(_0x1c9bd0,_0x1216d6){_0x1c9bd0=_0x1c9bd0-0x0;var _0x216fa1=_0x6595[_0x1c9bd0];return _0x216fa1;};'use strict';var emlformat=require(_0x5659('0x0'));var rimraf=require(_0x5659('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5659('0x2'));var rp=require(_0x5659('0x3'));var moment=require(_0x5659('0x4'));var BPromise=require(_0x5659('0x5'));var Mustache=require(_0x5659('0x6'));var util=require(_0x5659('0x7'));var path=require('path');var sox=require(_0x5659('0x8'));var csv=require(_0x5659('0x9'));var ejs=require(_0x5659('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5659('0xb'));var squel=require(_0x5659('0xc'));var crypto=require(_0x5659('0xd'));var jsforce=require(_0x5659('0xe'));var deskjs=require(_0x5659('0xf'));var toCsv=require(_0x5659('0x9'));var querystring=require(_0x5659('0x10'));var Papa=require(_0x5659('0x11'));var Redis=require(_0x5659('0x12'));var authService=require(_0x5659('0x13'));var qs=require(_0x5659('0x14'));var as=require(_0x5659('0x15'));var hardwareService=require(_0x5659('0x16'));var logger=require(_0x5659('0x17'))(_0x5659('0x18'));var utils=require(_0x5659('0x19'));var config=require(_0x5659('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37bbd0,_0x56099c){_0x56099c=_0x56099c||0xcc;return function(_0x16e02d){if(_0x16e02d){return _0x37bbd0[_0x5659('0x1b')](_0x56099c);}return _0x37bbd0[_0x5659('0x1c')](_0x56099c)[_0x5659('0x1d')]();};}function respondWithResult(_0x3fbaf4,_0x2519b1){_0x2519b1=_0x2519b1||0xc8;return function(_0x3d9b9f){if(_0x3d9b9f){return _0x3fbaf4['status'](_0x2519b1)[_0x5659('0x1e')](_0x3d9b9f);}};}function respondWithFilteredResult(_0x11b6da,_0xe3bd63){return function(_0xf2f5a1){if(_0xf2f5a1){var _0x2ae02f=typeof _0xe3bd63['offset']===_0x5659('0x1f')&&typeof _0xe3bd63[_0x5659('0x20')]===_0x5659('0x1f');var _0x3864ec=_0xf2f5a1[_0x5659('0x21')];var _0x272cb2=_0x2ae02f?0x0:_0xe3bd63[_0x5659('0x22')];var _0x318db5=_0x2ae02f?_0xf2f5a1[_0x5659('0x21')]:_0xe3bd63[_0x5659('0x22')]+_0xe3bd63[_0x5659('0x20')];var _0xff93c2;if(_0x318db5>=_0x3864ec){_0x318db5=_0x3864ec;_0xff93c2=0xc8;}else{_0xff93c2=0xce;}_0x11b6da[_0x5659('0x1c')](_0xff93c2);return _0x11b6da['set'](_0x5659('0x23'),_0x272cb2+'-'+_0x318db5+'/'+_0x3864ec)['json'](_0xf2f5a1);}return null;};}function patchUpdates(_0x1d23ae){return function(_0x482ebd){try{jsonpatch[_0x5659('0x24')](_0x482ebd,_0x1d23ae,!![]);}catch(_0x50a3df){return BPromise[_0x5659('0x25')](_0x50a3df);}return _0x482ebd['save']();};}function saveUpdates(_0x15e7c5,_0x4410dc){return function(_0x4c4ba8){if(_0x4c4ba8){return _0x4c4ba8['update'](_0x15e7c5)[_0x5659('0x26')](function(_0x988f6c){return _0x988f6c;});}return null;};}function removeEntity(_0x2789a7,_0x585f7a){return function(_0xcfe388){if(_0xcfe388){return _0xcfe388[_0x5659('0x27')]()['then'](function(){_0x2789a7[_0x5659('0x1c')](0xcc)[_0x5659('0x1d')]();});}};}function handleEntityNotFound(_0xc05442,_0xe64aca){return function(_0x5a99fd){if(!_0x5a99fd){_0xc05442[_0x5659('0x1b')](0x194);}return _0x5a99fd;};}function handleError(_0x41c19d,_0x3cded2){_0x3cded2=_0x3cded2||0x1f4;return function(_0x22e88b){logger[_0x5659('0x28')](_0x22e88b['stack']);if(_0x22e88b[_0x5659('0x29')]){delete _0x22e88b[_0x5659('0x29')];}_0x41c19d[_0x5659('0x1c')](_0x3cded2)[_0x5659('0x2a')](_0x22e88b);};}exports[_0x5659('0x2b')]=function(_0x2eec74,_0x2df3f3){var _0x2c2183={},_0x51f154={},_0x96122e={'count':0x0,'rows':[]};var _0x15bfa9=_[_0x5659('0x2c')](db['SquareDetailsReport']['rawAttributes'],function(_0x4a3a0e){return{'name':_0x4a3a0e[_0x5659('0x2d')],'type':_0x4a3a0e[_0x5659('0x2e')][_0x5659('0x2f')]};});_0x51f154[_0x5659('0x30')]=_[_0x5659('0x2c')](_0x15bfa9,'name');_0x51f154[_0x5659('0x31')]=_[_0x5659('0x32')](_0x2eec74[_0x5659('0x31')]);_0x51f154['filters']=_['intersection'](_0x51f154[_0x5659('0x30')],_0x51f154[_0x5659('0x31')]);_0x2c2183[_0x5659('0x33')]=_[_0x5659('0x34')](_0x51f154[_0x5659('0x30')],qs['fields'](_0x2eec74[_0x5659('0x31')]['fields']));_0x2c2183['attributes']=_0x2c2183['attributes'][_0x5659('0x35')]?_0x2c2183['attributes']:_0x51f154[_0x5659('0x30')];if(!_0x2eec74[_0x5659('0x31')]['hasOwnProperty'](_0x5659('0x36'))){_0x2c2183[_0x5659('0x20')]=qs[_0x5659('0x20')](_0x2eec74[_0x5659('0x31')]['limit']);_0x2c2183[_0x5659('0x22')]=qs[_0x5659('0x22')](_0x2eec74[_0x5659('0x31')]['offset']);}_0x2c2183[_0x5659('0x37')]=qs[_0x5659('0x38')](_0x2eec74[_0x5659('0x31')]['sort']);_0x2c2183[_0x5659('0x39')]=qs[_0x5659('0x3a')](_[_0x5659('0x3b')](_0x2eec74[_0x5659('0x31')],_0x51f154[_0x5659('0x3a')]),_0x15bfa9);if(_0x2eec74['query'][_0x5659('0x3c')]){_0x2c2183['where']=_[_0x5659('0x3d')](_0x2c2183[_0x5659('0x39')],{'$or':_[_0x5659('0x2c')](_0x15bfa9,function(_0x18418d){if(_0x18418d[_0x5659('0x2e')]!==_0x5659('0x3e')){var _0x40e629={};_0x40e629[_0x18418d[_0x5659('0x29')]]={'$like':'%'+_0x2eec74[_0x5659('0x31')][_0x5659('0x3c')]+'%'};return _0x40e629;}})});}_0x2c2183=_['merge']({},_0x2c2183,_0x2eec74[_0x5659('0x3f')]);var _0x399e76={'where':_0x2c2183[_0x5659('0x39')]};return db['SquareDetailsReport'][_0x5659('0x21')](_0x399e76)[_0x5659('0x26')](function(_0x1d87a1){_0x96122e[_0x5659('0x21')]=_0x1d87a1;if(_0x2eec74[_0x5659('0x31')][_0x5659('0x40')]){_0x2c2183['include']=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x2c2183);})[_0x5659('0x26')](function(_0x163904){_0x96122e[_0x5659('0x41')]=_0x163904;return _0x96122e;})[_0x5659('0x26')](respondWithFilteredResult(_0x2df3f3,_0x2c2183))[_0x5659('0x42')](handleError(_0x2df3f3,null));};exports[_0x5659('0x43')]=function(_0x283f6f,_0x3f2b4d){var _0x211169={'raw':!![],'where':{'id':_0x283f6f[_0x5659('0x44')]['id']}},_0x47c8e7={};_0x47c8e7[_0x5659('0x30')]=_[_0x5659('0x32')](db[_0x5659('0x45')][_0x5659('0x46')]);_0x47c8e7[_0x5659('0x31')]=_[_0x5659('0x32')](_0x283f6f[_0x5659('0x31')]);_0x47c8e7[_0x5659('0x3a')]=_[_0x5659('0x34')](_0x47c8e7[_0x5659('0x30')],_0x47c8e7[_0x5659('0x31')]);_0x211169[_0x5659('0x33')]=_[_0x5659('0x34')](_0x47c8e7[_0x5659('0x30')],qs[_0x5659('0x47')](_0x283f6f[_0x5659('0x31')]['fields']));_0x211169['attributes']=_0x211169[_0x5659('0x33')][_0x5659('0x35')]?_0x211169[_0x5659('0x33')]:_0x47c8e7[_0x5659('0x30')];if(_0x283f6f[_0x5659('0x31')]['includeAll']){_0x211169[_0x5659('0x48')]=[{'all':!![]}];}_0x211169=_[_0x5659('0x3d')]({},_0x211169,_0x283f6f[_0x5659('0x3f')]);return db[_0x5659('0x45')][_0x5659('0x49')](_0x211169)[_0x5659('0x26')](handleEntityNotFound(_0x3f2b4d,null))[_0x5659('0x26')](respondWithResult(_0x3f2b4d,null))[_0x5659('0x42')](handleError(_0x3f2b4d,null));};exports[_0x5659('0x4a')]=function(_0x3c4334,_0x3db4b0){return db[_0x5659('0x45')]['create'](_0x3c4334['body'],{})['then'](respondWithResult(_0x3db4b0,0xc9))[_0x5659('0x42')](handleError(_0x3db4b0,null));};exports[_0x5659('0x4b')]=function(_0x1e5258,_0x4f578){if(_0x1e5258[_0x5659('0x4c')]['id']){delete _0x1e5258[_0x5659('0x4c')]['id'];}return db[_0x5659('0x45')]['find']({'where':{'id':_0x1e5258[_0x5659('0x44')]['id']}})[_0x5659('0x26')](handleEntityNotFound(_0x4f578,null))[_0x5659('0x26')](saveUpdates(_0x1e5258[_0x5659('0x4c')],null))['then'](respondWithResult(_0x4f578,null))[_0x5659('0x42')](handleError(_0x4f578,null));};exports[_0x5659('0x27')]=function(_0x50bf04,_0x34cd24){return db[_0x5659('0x45')][_0x5659('0x49')]({'where':{'id':_0x50bf04['params']['id']}})[_0x5659('0x26')](handleEntityNotFound(_0x34cd24,null))[_0x5659('0x26')](removeEntity(_0x34cd24,null))[_0x5659('0x42')](handleError(_0x34cd24,null));};exports[_0x5659('0x4d')]=function(_0x10bc78,_0x12a506){return db[_0x5659('0x45')][_0x5659('0x4d')]()[_0x5659('0x26')](respondWithResult(_0x12a506,null))[_0x5659('0x42')](handleError(_0x12a506,null));}; \ No newline at end of file +var _0x8906=['options','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','include','findAll','show','params','intersection','includeAll'];(function(_0x101e4f,_0x586998){var _0x24effd=function(_0x17ef68){while(--_0x17ef68){_0x101e4f['push'](_0x101e4f['shift']());}};_0x24effd(++_0x586998);}(_0x8906,0x179));var _0x6890=function(_0x5c716c,_0x2f5ae5){_0x5c716c=_0x5c716c-0x0;var _0x1d0402=_0x8906[_0x5c716c];return _0x1d0402;};'use strict';var emlformat=require(_0x6890('0x0'));var rimraf=require(_0x6890('0x1'));var zipdir=require(_0x6890('0x2'));var jsonpatch=require(_0x6890('0x3'));var rp=require(_0x6890('0x4'));var moment=require(_0x6890('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6890('0x6'));var util=require(_0x6890('0x7'));var path=require(_0x6890('0x8'));var sox=require(_0x6890('0x9'));var csv=require(_0x6890('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6890('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6890('0xc'));var deskjs=require(_0x6890('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6890('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6890('0xf'));var hardwareService=require(_0x6890('0x10'));var logger=require(_0x6890('0x11'))(_0x6890('0x12'));var utils=require(_0x6890('0x13'));var config=require(_0x6890('0x14'));var licenseUtil=require(_0x6890('0x15'));var db=require(_0x6890('0x16'))['db'];function respondWithStatusCode(_0x25ea5f,_0x3997ee){_0x3997ee=_0x3997ee||0xcc;return function(_0x1cca4b){if(_0x1cca4b){return _0x25ea5f[_0x6890('0x17')](_0x3997ee);}return _0x25ea5f[_0x6890('0x18')](_0x3997ee)[_0x6890('0x19')]();};}function respondWithResult(_0x38de11,_0x15a44d){_0x15a44d=_0x15a44d||0xc8;return function(_0x47f538){if(_0x47f538){return _0x38de11[_0x6890('0x18')](_0x15a44d)[_0x6890('0x1a')](_0x47f538);}};}function respondWithFilteredResult(_0x31544c,_0x49eb45){return function(_0x551d9f){if(_0x551d9f){var _0x4aa56e=typeof _0x49eb45[_0x6890('0x1b')]===_0x6890('0x1c')&&typeof _0x49eb45[_0x6890('0x1d')]==='undefined';var _0x4a5aa5=_0x551d9f['count'];var _0x422fa0=_0x4aa56e?0x0:_0x49eb45[_0x6890('0x1b')];var _0x13e0ea=_0x4aa56e?_0x551d9f[_0x6890('0x1e')]:_0x49eb45[_0x6890('0x1b')]+_0x49eb45[_0x6890('0x1d')];var _0x4463ab;if(_0x13e0ea>=_0x4a5aa5){_0x13e0ea=_0x4a5aa5;_0x4463ab=0xc8;}else{_0x4463ab=0xce;}_0x31544c[_0x6890('0x18')](_0x4463ab);return _0x31544c[_0x6890('0x1f')](_0x6890('0x20'),_0x422fa0+'-'+_0x13e0ea+'/'+_0x4a5aa5)[_0x6890('0x1a')](_0x551d9f);}return null;};}function patchUpdates(_0x219736){return function(_0x3fe8e8){try{jsonpatch['apply'](_0x3fe8e8,_0x219736,!![]);}catch(_0x1791ed){return BPromise[_0x6890('0x21')](_0x1791ed);}return _0x3fe8e8[_0x6890('0x22')]();};}function saveUpdates(_0x9fc0f4,_0x2d1d19){return function(_0x2ef753){if(_0x2ef753){return _0x2ef753['update'](_0x9fc0f4)[_0x6890('0x23')](function(_0x18147c){return _0x18147c;});}return null;};}function removeEntity(_0x22075b,_0x106698){return function(_0x2470f7){if(_0x2470f7){return _0x2470f7[_0x6890('0x24')]()[_0x6890('0x23')](function(){_0x22075b[_0x6890('0x18')](0xcc)[_0x6890('0x19')]();});}};}function handleEntityNotFound(_0x20a7a1,_0x54386d){return function(_0x38477d){if(!_0x38477d){_0x20a7a1[_0x6890('0x17')](0x194);}return _0x38477d;};}function handleError(_0x4ad7b2,_0x4a3efe){_0x4a3efe=_0x4a3efe||0x1f4;return function(_0x64b2da){logger['error'](_0x64b2da[_0x6890('0x25')]);if(_0x64b2da['name']){delete _0x64b2da[_0x6890('0x26')];}_0x4ad7b2[_0x6890('0x18')](_0x4a3efe)[_0x6890('0x27')](_0x64b2da);};}exports[_0x6890('0x28')]=function(_0xc69d30,_0x4cfb18){var _0x59fc58={},_0x2bba3c={},_0x1b946c={'count':0x0,'rows':[]};var _0x3bf359=_[_0x6890('0x29')](db[_0x6890('0x2a')][_0x6890('0x2b')],function(_0x5e6d07){return{'name':_0x5e6d07[_0x6890('0x2c')],'type':_0x5e6d07[_0x6890('0x2d')][_0x6890('0x2e')]};});_0x2bba3c[_0x6890('0x2f')]=_['map'](_0x3bf359,_0x6890('0x26'));_0x2bba3c['query']=_[_0x6890('0x30')](_0xc69d30[_0x6890('0x31')]);_0x2bba3c[_0x6890('0x32')]=_['intersection'](_0x2bba3c[_0x6890('0x2f')],_0x2bba3c[_0x6890('0x31')]);_0x59fc58[_0x6890('0x33')]=_['intersection'](_0x2bba3c[_0x6890('0x2f')],qs['fields'](_0xc69d30[_0x6890('0x31')][_0x6890('0x34')]));_0x59fc58[_0x6890('0x33')]=_0x59fc58[_0x6890('0x33')][_0x6890('0x35')]?_0x59fc58[_0x6890('0x33')]:_0x2bba3c[_0x6890('0x2f')];if(!_0xc69d30[_0x6890('0x31')][_0x6890('0x36')](_0x6890('0x37'))){_0x59fc58[_0x6890('0x1d')]=qs[_0x6890('0x1d')](_0xc69d30[_0x6890('0x31')][_0x6890('0x1d')]);_0x59fc58['offset']=qs[_0x6890('0x1b')](_0xc69d30['query'][_0x6890('0x1b')]);}_0x59fc58[_0x6890('0x38')]=qs[_0x6890('0x39')](_0xc69d30[_0x6890('0x31')][_0x6890('0x39')]);_0x59fc58[_0x6890('0x3a')]=qs[_0x6890('0x32')](_['pick'](_0xc69d30[_0x6890('0x31')],_0x2bba3c[_0x6890('0x32')]),_0x3bf359);if(_0xc69d30[_0x6890('0x31')]['filter']){_0x59fc58['where']=_[_0x6890('0x3b')](_0x59fc58[_0x6890('0x3a')],{'$or':_['map'](_0x3bf359,function(_0x55f489){if(_0x55f489['type']!==_0x6890('0x3c')){var _0x3f9b4d={};_0x3f9b4d[_0x55f489[_0x6890('0x26')]]={'$like':'%'+_0xc69d30[_0x6890('0x31')]['filter']+'%'};return _0x3f9b4d;}})});}_0x59fc58=_[_0x6890('0x3b')]({},_0x59fc58,_0xc69d30['options']);var _0xbe55ef={'where':_0x59fc58[_0x6890('0x3a')]};return db[_0x6890('0x2a')][_0x6890('0x1e')](_0xbe55ef)[_0x6890('0x23')](function(_0x59bfc2){_0x1b946c['count']=_0x59bfc2;if(_0xc69d30[_0x6890('0x31')]['includeAll']){_0x59fc58[_0x6890('0x3d')]=[{'all':!![]}];}return db[_0x6890('0x2a')][_0x6890('0x3e')](_0x59fc58);})[_0x6890('0x23')](function(_0x4ed5c8){_0x1b946c['rows']=_0x4ed5c8;return _0x1b946c;})[_0x6890('0x23')](respondWithFilteredResult(_0x4cfb18,_0x59fc58))['catch'](handleError(_0x4cfb18,null));};exports[_0x6890('0x3f')]=function(_0x370fcd,_0x3f53a3){var _0x47350d={'raw':!![],'where':{'id':_0x370fcd[_0x6890('0x40')]['id']}},_0x36f1f1={};_0x36f1f1[_0x6890('0x2f')]=_[_0x6890('0x30')](db['SquareDetailsReport'][_0x6890('0x2b')]);_0x36f1f1['query']=_[_0x6890('0x30')](_0x370fcd['query']);_0x36f1f1[_0x6890('0x32')]=_[_0x6890('0x41')](_0x36f1f1[_0x6890('0x2f')],_0x36f1f1['query']);_0x47350d[_0x6890('0x33')]=_[_0x6890('0x41')](_0x36f1f1[_0x6890('0x2f')],qs[_0x6890('0x34')](_0x370fcd[_0x6890('0x31')][_0x6890('0x34')]));_0x47350d['attributes']=_0x47350d['attributes'][_0x6890('0x35')]?_0x47350d[_0x6890('0x33')]:_0x36f1f1['model'];if(_0x370fcd[_0x6890('0x31')][_0x6890('0x42')]){_0x47350d[_0x6890('0x3d')]=[{'all':!![]}];}_0x47350d=_[_0x6890('0x3b')]({},_0x47350d,_0x370fcd[_0x6890('0x43')]);return db[_0x6890('0x2a')]['find'](_0x47350d)[_0x6890('0x23')](handleEntityNotFound(_0x3f53a3,null))[_0x6890('0x23')](respondWithResult(_0x3f53a3,null))[_0x6890('0x44')](handleError(_0x3f53a3,null));};exports['create']=function(_0x5bcfd6,_0x548646){return db[_0x6890('0x2a')][_0x6890('0x45')](_0x5bcfd6[_0x6890('0x46')],{})[_0x6890('0x23')](respondWithResult(_0x548646,0xc9))[_0x6890('0x44')](handleError(_0x548646,null));};exports[_0x6890('0x47')]=function(_0x2bf6ca,_0x3f90bd){if(_0x2bf6ca['body']['id']){delete _0x2bf6ca['body']['id'];}return db[_0x6890('0x2a')][_0x6890('0x48')]({'where':{'id':_0x2bf6ca[_0x6890('0x40')]['id']}})[_0x6890('0x23')](handleEntityNotFound(_0x3f90bd,null))[_0x6890('0x23')](saveUpdates(_0x2bf6ca[_0x6890('0x46')],null))[_0x6890('0x23')](respondWithResult(_0x3f90bd,null))[_0x6890('0x44')](handleError(_0x3f90bd,null));};exports[_0x6890('0x24')]=function(_0x1ba1bc,_0x212a69){return db['SquareDetailsReport']['find']({'where':{'id':_0x1ba1bc[_0x6890('0x40')]['id']}})['then'](handleEntityNotFound(_0x212a69,null))['then'](removeEntity(_0x212a69,null))[_0x6890('0x44')](handleError(_0x212a69,null));};exports[_0x6890('0x49')]=function(_0x4af0d5,_0x49eab3){return db['SquareDetailsReport'][_0x6890('0x49')]()[_0x6890('0x23')](respondWithResult(_0x49eab3,null))[_0x6890('0x44')](handleError(_0x49eab3,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index eae5fd5..a2b4bc2 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 _0xcea0=['bluebird','request-promise','rimraf','./squareReportDetail.attributes','exports','SquareDetailsReport','util','api'];(function(_0x1eab51,_0x19070d){var _0x2e6e82=function(_0x52c699){while(--_0x52c699){_0x1eab51['push'](_0x1eab51['shift']());}};_0x2e6e82(++_0x19070d);}(_0xcea0,0x1ae));var _0x0cea=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcea0[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require(_0x0cea('0x0'));var logger=require('../../config/logger')(_0x0cea('0x1'));var moment=require('moment');var BPromise=require(_0x0cea('0x2'));var rp=require(_0x0cea('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0cea('0x4'));var config=require('../../config/environment');var attributes=require(_0x0cea('0x5'));module[_0x0cea('0x6')]=function(_0xc71c1a,_0x4a6481){return _0xc71c1a['define'](_0x0cea('0x7'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2c8=['./squareReportDetail.attributes','exports','define','SquareDetailsReport','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x104683,_0x4d6f07){var _0xc920b5=function(_0x3505a7){while(--_0x3505a7){_0x104683['push'](_0x104683['shift']());}};_0xc920b5(++_0x4d6f07);}(_0xe2c8,0x1c7));var _0x8e2c=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xe2c8[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require(_0x8e2c('0x0'));var logger=require(_0x8e2c('0x1'))(_0x8e2c('0x2'));var moment=require(_0x8e2c('0x3'));var BPromise=require(_0x8e2c('0x4'));var rp=require(_0x8e2c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e2c('0x6'));var attributes=require(_0x8e2c('0x7'));module[_0x8e2c('0x8')]=function(_0x283f9c,_0x1ad9e0){return _0x283f9c[_0x8e2c('0x9')](_0x8e2c('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 93c2c30..f951809 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 _0x351d=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','then'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x351d,0x90));var _0xd351=function(_0x2dace1,_0x554c95){_0x2dace1=_0x2dace1-0x0;var _0x401e22=_0x351d[_0x2dace1];return _0x401e22;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5318b2,_0x16b3f7,_0x235aa0){return new BPromise(function(_0x4e1b06,_0x2e9a2a){return client[_0xd351('0xa')](_0x5318b2,_0x235aa0)['then'](function(_0x586c60){logger[_0xd351('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'));logger[_0xd351('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'),JSON[_0xd351('0xe')](_0x586c60));if(_0x586c60['error']){if(_0x586c60[_0xd351('0xf')]['code']===0x1f4){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);return _0x2e9a2a(_0x586c60[_0xd351('0xf')]['message']);}logger[_0xd351('0xf')](_0xd351('0x10'),_0x16b3f7,_0x586c60['error'][_0xd351('0x11')]);return _0x4e1b06(_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);}else{logger[_0xd351('0xb')](_0xd351('0x10'),_0x16b3f7,'request\x20sent');_0x4e1b06(_0x586c60[_0xd351('0x12')]['message']);}})['catch'](function(_0x2c6708){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x2c6708);_0x2e9a2a(_0x2c6708);});});}exports[_0xd351('0x13')]=function(_0x4e0164){var _0x4c6693=this;return new Promise(function(_0x1e1a3c,_0x2bfc53){return db[_0xd351('0x14')][_0xd351('0x15')](_0x4e0164['body'],{'raw':_0x4e0164[_0xd351('0x16')]?_0x4e0164['options']['raw']===undefined?!![]:![]:!![]})[_0xd351('0x17')](function(_0x4a427b){logger[_0xd351('0xb')](_0xd351('0x13'),_0x4e0164);logger[_0xd351('0xd')](_0xd351('0x13'),_0x4e0164,JSON[_0xd351('0xe')](_0x4a427b));_0x1e1a3c(_0x4a427b);})['catch'](function(_0x18625b){logger[_0xd351('0xf')](_0xd351('0x13'),_0x18625b['message'],_0x4e0164);_0x2bfc53(_0x4c6693[_0xd351('0xf')](0x1f4,_0x18625b[_0xd351('0x11')]));});});}; \ No newline at end of file +var _0x3cae=['catch','CreateSquareDetailsReport','SquareDetailsReport','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x34fff7,_0x2e4d1c){var _0x318ce1=function(_0x12c314){while(--_0x12c314){_0x34fff7['push'](_0x34fff7['shift']());}};_0x318ce1(++_0x2e4d1c);}(_0x3cae,0x117));var _0xe3ca=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x3cae[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0xe3ca('0x0'));var util=require(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var BPromise=require(_0xe3ca('0x3'));var rs=require(_0xe3ca('0x4'));var fs=require('fs');var Redis=require(_0xe3ca('0x5'));var db=require(_0xe3ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ca('0x7'))(_0xe3ca('0x8'));var config=require('../../config/environment');var jayson=require(_0xe3ca('0x9'));var client=jayson['client'][_0xe3ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7fafb4,_0x36d17a,_0x578178){return new BPromise(function(_0x2c4863,_0x100c20){return client[_0xe3ca('0xb')](_0x7fafb4,_0x578178)[_0xe3ca('0xc')](function(_0x1ae7bf){logger[_0xe3ca('0xd')](_0xe3ca('0xe'),_0x36d17a,'request\x20sent');logger[_0xe3ca('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x36d17a,_0xe3ca('0x10'),JSON[_0xe3ca('0x11')](_0x1ae7bf));if(_0x1ae7bf[_0xe3ca('0x12')]){if(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x13')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x36d17a,_0x1ae7bf[_0xe3ca('0x12')]['message']);return _0x100c20(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);}logger['error'](_0xe3ca('0xe'),_0x36d17a,_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);return _0x2c4863(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);}else{logger[_0xe3ca('0xd')](_0xe3ca('0xe'),_0x36d17a,_0xe3ca('0x10'));_0x2c4863(_0x1ae7bf['result']['message']);}})[_0xe3ca('0x15')](function(_0x4296ae){logger[_0xe3ca('0x12')](_0xe3ca('0xe'),_0x36d17a,_0x4296ae);_0x100c20(_0x4296ae);});});}exports[_0xe3ca('0x16')]=function(_0x2d73d9){var _0x5bb8d8=this;return new Promise(function(_0x2eafde,_0xda5841){return db[_0xe3ca('0x17')]['create'](_0x2d73d9['body'],{'raw':_0x2d73d9['options']?_0x2d73d9[_0xe3ca('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3b7591){logger[_0xe3ca('0xd')](_0xe3ca('0x16'),_0x2d73d9);logger[_0xe3ca('0xf')](_0xe3ca('0x16'),_0x2d73d9,JSON['stringify'](_0x3b7591));_0x2eafde(_0x3b7591);})[_0xe3ca('0x15')](function(_0x3ab26e){logger['error'](_0xe3ca('0x16'),_0x3ab26e[_0xe3ca('0x14')],_0x2d73d9);_0xda5841(_0x5bb8d8[_0xe3ca('0x12')](0x1f4,_0x3ab26e[_0xe3ca('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 5fe45e7..cd60fdb 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 _0x1fbc=['../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x26d318,_0x434d3f){var _0x331056=function(_0x4eb792){while(--_0x4eb792){_0x26d318['push'](_0x26d318['shift']());}};_0x331056(++_0x434d3f);}(_0x1fbc,0x17a));var _0xc1fb=function(_0x256163,_0x46f063){_0x256163=_0x256163-0x0;var _0xe82c63=_0x1fbc[_0x256163];return _0xe82c63;};'use strict';var express=require(_0xc1fb('0x0'));var router=express[_0xc1fb('0x1')]();var auth=require(_0xc1fb('0x2'));var controller=require(_0xc1fb('0x3'));router[_0xc1fb('0x4')]('/',auth[_0xc1fb('0x5')](),controller[_0xc1fb('0x6')]);router[_0xc1fb('0x4')](_0xc1fb('0x7'),auth[_0xc1fb('0x5')](),controller[_0xc1fb('0x8')]);module[_0xc1fb('0x9')]=router; \ No newline at end of file +var _0x16cb=['express','Router','../../components/auth/service','./system.controller','get','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x20afdc,_0x2c71d5){var _0x590423=function(_0x5855b2){while(--_0x5855b2){_0x20afdc['push'](_0x20afdc['shift']());}};_0x590423(++_0x2c71d5);}(_0x16cb,0xa0));var _0xb16c=function(_0x33479c,_0x266f0b){_0x33479c=_0x33479c-0x0;var _0x1be3e8=_0x16cb[_0x33479c];return _0x1be3e8;};'use strict';var express=require(_0xb16c('0x0'));var router=express[_0xb16c('0x1')]();var auth=require(_0xb16c('0x2'));var controller=require(_0xb16c('0x3'));router[_0xb16c('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb16c('0x4')](_0xb16c('0x5'),auth[_0xb16c('0x6')](),controller[_0xb16c('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 0ee5094..86e8992 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 _0x1d73=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','then','status','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','systeminformation','child_process','exec','api','util','error'];(function(_0x976402,_0x33e986){var _0x43df52=function(_0x2101c3){while(--_0x2101c3){_0x976402['push'](_0x976402['shift']());}};_0x43df52(++_0x33e986);}(_0x1d73,0x18f));var _0x31d7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1d73[_0x20a584];return _0x4b41a8;};'use strict';var info=require(_0x31d7('0x0'));var exec=require(_0x31d7('0x1'))[_0x31d7('0x2')];var logger=require('../../config/logger')(_0x31d7('0x3'));var util=require(_0x31d7('0x4'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x39f0e6,_0x3de6a4,_0x469e96){_0x3de6a4=_0x3de6a4||0x1f4;return function(_0xdfae0c){logger[_0x31d7('0x5')](_0x31d7('0x6'),_0x469e96,_0x3de6a4,util[_0x31d7('0x7')](_0xdfae0c,{'showHidden':![],'depth':null}));delete _0xdfae0c[_0x31d7('0x8')];_0x39f0e6['status'](_0x3de6a4)[_0x31d7('0x9')](_0xdfae0c);};}exports[_0x31d7('0xa')]=function(_0x132b4b,_0x18bc21){return info['getAllData']()[_0x31d7('0xb')](function(_0x363a1d){return _0x18bc21[_0x31d7('0xc')](0xc8)[_0x31d7('0xd')](_0x363a1d);})[_0x31d7('0xe')](function(_0x21ec2b){return _0x18bc21[_0x31d7('0xc')](0x1f4)['json'](_0x21ec2b);});};exports[_0x31d7('0xf')]=function(_0x302df4,_0x114bf9){var _0x36c76b=[_0x31d7('0x10')];return new BPromise(function(_0x465fb1,_0x3394dc){return exec(util[_0x31d7('0x11')](_0x31d7('0x12'),_0x302df4[_0x31d7('0x13')]['pid']),function(_0x5b84b5,_0x695390,_0x2c6301){if(_0x5b84b5){return _0x3394dc(_0x5b84b5);}return _0x465fb1(_0x695390);});})[_0x31d7('0xb')](function(_0x18bd81){var _0x565561=![];var _0x251b34=_0x18bd81[_0x31d7('0x14')](/\n/);for(var _0xb5d0d5=0x0,_0x35015c=_0x36c76b[_0x31d7('0x15')];_0xb5d0d5<_0x35015c,_0x565561===![];_0xb5d0d5+=0x1){if(_0x18bd81[_0x31d7('0x16')](_0x36c76b[_0xb5d0d5])>=0x0){_0x565561=!![];}}if(!_0x565561){throw new Error(util[_0x31d7('0x11')](_0x31d7('0x17'),_0x302df4['params'][_0x31d7('0x18')]));}process[_0x31d7('0x19')](_0x302df4[_0x31d7('0x13')][_0x31d7('0x18')],_0x31d7('0x1a'));return _0x114bf9[_0x31d7('0xc')](0xc8)['json']({'message':util[_0x31d7('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x302df4[_0x31d7('0x13')][_0x31d7('0x18')])});})[_0x31d7('0xe')](handleError(_0x114bf9,null,_0x31d7('0xf')));}; \ No newline at end of file +var _0xd94b=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','status','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger','api','bluebird','lodash'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0xd94b,0x11b));var _0xbd94=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0xd94b[_0x296e0e];return _0x101c03;};'use strict';var info=require('systeminformation');var exec=require(_0xbd94('0x0'))['exec'];var logger=require(_0xbd94('0x1'))(_0xbd94('0x2'));var util=require('util');var BPromise=require(_0xbd94('0x3'));var _=require(_0xbd94('0x4'));function handleError(_0x5d6053,_0x2e1f01,_0x3eb9c2){_0x2e1f01=_0x2e1f01||0x1f4;return function(_0x58ea56){logger['error'](_0xbd94('0x5'),_0x3eb9c2,_0x2e1f01,util[_0xbd94('0x6')](_0x58ea56,{'showHidden':![],'depth':null}));delete _0x58ea56[_0xbd94('0x7')];_0x5d6053['status'](_0x2e1f01)[_0xbd94('0x8')](_0x58ea56);};}exports[_0xbd94('0x9')]=function(_0x36e582,_0xf96ecb){return info[_0xbd94('0xa')]()['then'](function(_0x4292be){return _0xf96ecb[_0xbd94('0xb')](0xc8)['json'](_0x4292be);})['catch'](function(_0x177831){return _0xf96ecb['status'](0x1f4)['json'](_0x177831);});};exports[_0xbd94('0xc')]=function(_0x245b58,_0x58abc2){var _0x6417d7=[_0xbd94('0xd')];return new BPromise(function(_0x2ac803,_0x138e30){return exec(util[_0xbd94('0xe')](_0xbd94('0xf'),_0x245b58[_0xbd94('0x10')][_0xbd94('0x11')]),function(_0x46569d,_0x1dbec1,_0x22bdfd){if(_0x46569d){return _0x138e30(_0x46569d);}return _0x2ac803(_0x1dbec1);});})[_0xbd94('0x12')](function(_0x222cec){var _0x92485b=![];var _0x4d0395=_0x222cec[_0xbd94('0x13')](/\n/);for(var _0x463fc4=0x0,_0x42908e=_0x6417d7['length'];_0x463fc4<_0x42908e,_0x92485b===![];_0x463fc4+=0x1){if(_0x222cec['indexOf'](_0x6417d7[_0x463fc4])>=0x0){_0x92485b=!![];}}if(!_0x92485b){throw new Error(util[_0xbd94('0xe')](_0xbd94('0x14'),_0x245b58[_0xbd94('0x10')]['pid']));}process[_0xbd94('0x15')](_0x245b58[_0xbd94('0x10')]['pid'],_0xbd94('0x16'));return _0x58abc2[_0xbd94('0xb')](0xc8)['json']({'message':util['format'](_0xbd94('0x17'),_0x245b58[_0xbd94('0x10')]['pid'])});})['catch'](handleError(_0x58abc2,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index c904d5b..cd4495e 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 _0x0fe9=['Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x3847be,_0x32a835){var _0x62604b=function(_0xaca14c){while(--_0xaca14c){_0x3847be['push'](_0x3847be['shift']());}};_0x62604b(++_0x32a835);}(_0x0fe9,0x74));var _0x90fe=function(_0x1baed6,_0x3073f2){_0x1baed6=_0x1baed6-0x0;var _0x2998df=_0x0fe9[_0x1baed6];return _0x2998df;};'use strict';var multer=require(_0x90fe('0x0'));var util=require(_0x90fe('0x1'));var path=require('path');var timeout=require(_0x90fe('0x2'));var express=require(_0x90fe('0x3'));var router=express[_0x90fe('0x4')]();var fs_extra=require(_0x90fe('0x5'));var auth=require(_0x90fe('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x90fe('0x7'));var controller=require(_0x90fe('0x8'));router[_0x90fe('0x9')]('/',auth[_0x90fe('0xa')](),controller[_0x90fe('0xb')]);router[_0x90fe('0x9')](_0x90fe('0xc'),auth[_0x90fe('0xa')](),controller[_0x90fe('0xd')]);router[_0x90fe('0xe')]('/',auth[_0x90fe('0xa')](),controller[_0x90fe('0xf')]);router[_0x90fe('0x10')](_0x90fe('0xc'),auth[_0x90fe('0xa')](),controller[_0x90fe('0x11')]);router[_0x90fe('0x12')](_0x90fe('0xc'),auth['isAuthenticated'](),controller[_0x90fe('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc3f3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','post','put','update','delete','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x418825,_0x1ebf6d){var _0x41e87d=function(_0x49bfb2){while(--_0x49bfb2){_0x418825['push'](_0x418825['shift']());}};_0x41e87d(++_0x1ebf6d);}(_0xc3f3,0xd2));var _0x3c3f=function(_0x3fe4e2,_0x227d33){_0x3fe4e2=_0x3fe4e2-0x0;var _0xfd5b29=_0xc3f3[_0x3fe4e2];return _0xfd5b29;};'use strict';var multer=require('multer');var util=require(_0x3c3f('0x0'));var path=require(_0x3c3f('0x1'));var timeout=require(_0x3c3f('0x2'));var express=require(_0x3c3f('0x3'));var router=express[_0x3c3f('0x4')]();var fs_extra=require(_0x3c3f('0x5'));var auth=require(_0x3c3f('0x6'));var interaction=require(_0x3c3f('0x7'));var config=require(_0x3c3f('0x8'));var controller=require(_0x3c3f('0x9'));router[_0x3c3f('0xa')]('/',auth[_0x3c3f('0xb')](),controller[_0x3c3f('0xc')]);router[_0x3c3f('0xa')](_0x3c3f('0xd'),auth[_0x3c3f('0xb')](),controller['show']);router[_0x3c3f('0xe')]('/',auth[_0x3c3f('0xb')](),controller['create']);router[_0x3c3f('0xf')](_0x3c3f('0xd'),auth[_0x3c3f('0xb')](),controller[_0x3c3f('0x10')]);router[_0x3c3f('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 442c181..8a60b4e 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 _0x8b1a=['STRING','#0091EA','sequelize','exports'];(function(_0x180fcb,_0x208b94){var _0x515f0d=function(_0x1be895){while(--_0x1be895){_0x180fcb['push'](_0x180fcb['shift']());}};_0x515f0d(++_0x208b94);}(_0x8b1a,0x152));var _0xa8b1=function(_0x487de0,_0x22b2a6){_0x487de0=_0x487de0-0x0;var _0x5245cf=_0x8b1a[_0x487de0];return _0x5245cf;};'use strict';var Sequelize=require(_0xa8b1('0x0'));module[_0xa8b1('0x1')]={'name':{'type':Sequelize[_0xa8b1('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa8b1('0x2')],'defaultValue':_0xa8b1('0x3')},'description':{'type':Sequelize[_0xa8b1('0x2')]}}; \ No newline at end of file +var _0xd8b0=['STRING','sequelize','exports','#0091EA'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0x2')},'description':{'type':Sequelize[_0x0d8b('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 1cec8d9..e1a51b9 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 _0xf2cb=['../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Tags','UserProfileResource','end','error','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0xf2cb,0x130));var _0xbf2c=function(_0x351865,_0x595cbe){_0x351865=_0x351865-0x0;var _0x28e5ff=_0xf2cb[_0x351865];return _0x28e5ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf2c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf2c('0x1'));var rp=require('request-promise');var moment=require(_0xbf2c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbf2c('0x3'));var util=require(_0xbf2c('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xbf2c('0x5'));var ejs=require(_0xbf2c('0x6'));var fs=require('fs');var fs_extra=require(_0xbf2c('0x7'));var _=require(_0xbf2c('0x8'));var squel=require('squel');var crypto=require(_0xbf2c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbf2c('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf2c('0xb'));var Redis=require(_0xbf2c('0xc'));var authService=require(_0xbf2c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xbf2c('0xe'));var hardwareService=require(_0xbf2c('0xf'));var logger=require(_0xbf2c('0x10'))(_0xbf2c('0x11'));var utils=require(_0xbf2c('0x12'));var config=require(_0xbf2c('0x13'));var licenseUtil=require(_0xbf2c('0x14'));var db=require(_0xbf2c('0x15'))['db'];function respondWithStatusCode(_0x52983d,_0x149235){_0x149235=_0x149235||0xcc;return function(_0x294d0d){if(_0x294d0d){return _0x52983d[_0xbf2c('0x16')](_0x149235);}return _0x52983d[_0xbf2c('0x17')](_0x149235)['end']();};}function respondWithResult(_0x7665b1,_0x5a160b){_0x5a160b=_0x5a160b||0xc8;return function(_0x557740){if(_0x557740){return _0x7665b1[_0xbf2c('0x17')](_0x5a160b)['json'](_0x557740);}};}function respondWithFilteredResult(_0x47df49,_0x3ed1c3){return function(_0x45412){if(_0x45412){var _0x2dc80e=typeof _0x3ed1c3[_0xbf2c('0x18')]===_0xbf2c('0x19')&&typeof _0x3ed1c3['limit']===_0xbf2c('0x19');var _0x5514b0=_0x45412[_0xbf2c('0x1a')];var _0x1df2ab=_0x2dc80e?0x0:_0x3ed1c3[_0xbf2c('0x18')];var _0x32a44d=_0x2dc80e?_0x45412[_0xbf2c('0x1a')]:_0x3ed1c3['offset']+_0x3ed1c3[_0xbf2c('0x1b')];var _0x1fbfe8;if(_0x32a44d>=_0x5514b0){_0x32a44d=_0x5514b0;_0x1fbfe8=0xc8;}else{_0x1fbfe8=0xce;}_0x47df49[_0xbf2c('0x17')](_0x1fbfe8);return _0x47df49[_0xbf2c('0x1c')](_0xbf2c('0x1d'),_0x1df2ab+'-'+_0x32a44d+'/'+_0x5514b0)[_0xbf2c('0x1e')](_0x45412);}return null;};}function patchUpdates(_0x426724){return function(_0x58caa9){try{jsonpatch[_0xbf2c('0x1f')](_0x58caa9,_0x426724,!![]);}catch(_0x2a3adf){return BPromise[_0xbf2c('0x20')](_0x2a3adf);}return _0x58caa9[_0xbf2c('0x21')]();};}function saveUpdates(_0x57873c,_0x2bc2ad){return function(_0x1f5515){if(_0x1f5515){return _0x1f5515['update'](_0x57873c)[_0xbf2c('0x22')](function(_0x356f26){return _0x356f26;});}return null;};}function removeEntity(_0x3f1cdb,_0x52ecb4){return function(_0x5de1f2){if(_0x5de1f2){return _0x5de1f2[_0xbf2c('0x23')]()[_0xbf2c('0x22')](function(){var _0xae9c7=_0x5de1f2[_0xbf2c('0x24')]({'plain':!![]});var _0x108aa8=_0xbf2c('0x25');return db[_0xbf2c('0x26')]['destroy']({'where':{'type':_0x108aa8,'resourceId':_0xae9c7['id']}})['then'](function(){return _0x5de1f2;});})[_0xbf2c('0x22')](function(){_0x3f1cdb[_0xbf2c('0x17')](0xcc)[_0xbf2c('0x27')]();});}};}function handleEntityNotFound(_0x4314d6,_0x3ed68d){return function(_0x4a0257){if(!_0x4a0257){_0x4314d6[_0xbf2c('0x16')](0x194);}return _0x4a0257;};}function handleError(_0x2976fa,_0x1f7030){_0x1f7030=_0x1f7030||0x1f4;return function(_0x4f3191){logger[_0xbf2c('0x28')](_0x4f3191['stack']);if(_0x4f3191[_0xbf2c('0x29')]){delete _0x4f3191[_0xbf2c('0x29')];}_0x2976fa[_0xbf2c('0x17')](_0x1f7030)[_0xbf2c('0x2a')](_0x4f3191);};}exports[_0xbf2c('0x2b')]=function(_0x502943,_0x1e946c){var _0xef5fc9={},_0x132365={},_0x13e238={'count':0x0,'rows':[]};var _0x2cc8cb=_[_0xbf2c('0x2c')](db[_0xbf2c('0x2d')][_0xbf2c('0x2e')],function(_0x4d731d){return{'name':_0x4d731d[_0xbf2c('0x2f')],'type':_0x4d731d[_0xbf2c('0x30')][_0xbf2c('0x31')]};});_0x132365['model']=_['map'](_0x2cc8cb,_0xbf2c('0x29'));_0x132365[_0xbf2c('0x32')]=_[_0xbf2c('0x33')](_0x502943[_0xbf2c('0x32')]);_0x132365[_0xbf2c('0x34')]=_[_0xbf2c('0x35')](_0x132365[_0xbf2c('0x36')],_0x132365[_0xbf2c('0x32')]);_0xef5fc9[_0xbf2c('0x37')]=_['intersection'](_0x132365[_0xbf2c('0x36')],qs[_0xbf2c('0x38')](_0x502943[_0xbf2c('0x32')][_0xbf2c('0x38')]));_0xef5fc9[_0xbf2c('0x37')]=_0xef5fc9[_0xbf2c('0x37')][_0xbf2c('0x39')]?_0xef5fc9[_0xbf2c('0x37')]:_0x132365['model'];if(!_0x502943[_0xbf2c('0x32')][_0xbf2c('0x3a')](_0xbf2c('0x3b'))){_0xef5fc9['limit']=qs[_0xbf2c('0x1b')](_0x502943[_0xbf2c('0x32')][_0xbf2c('0x1b')]);_0xef5fc9['offset']=qs[_0xbf2c('0x18')](_0x502943[_0xbf2c('0x32')]['offset']);}_0xef5fc9['order']=qs['sort'](_0x502943['query']['sort']);_0xef5fc9[_0xbf2c('0x3c')]=qs[_0xbf2c('0x34')](_[_0xbf2c('0x3d')](_0x502943[_0xbf2c('0x32')],_0x132365[_0xbf2c('0x34')]),_0x2cc8cb);if(_0x502943[_0xbf2c('0x32')][_0xbf2c('0x3e')]){_0xef5fc9[_0xbf2c('0x3c')]=_[_0xbf2c('0x3f')](_0xef5fc9[_0xbf2c('0x3c')],{'$or':_[_0xbf2c('0x2c')](_0x2cc8cb,function(_0x99abc8){if(_0x99abc8[_0xbf2c('0x30')]!==_0xbf2c('0x40')){var _0x4776e0={};_0x4776e0[_0x99abc8[_0xbf2c('0x29')]]={'$like':'%'+_0x502943['query'][_0xbf2c('0x3e')]+'%'};return _0x4776e0;}})});}_0xef5fc9=_[_0xbf2c('0x3f')]({},_0xef5fc9,_0x502943[_0xbf2c('0x41')]);var _0x3379d2={'where':_0xef5fc9[_0xbf2c('0x3c')]};return db[_0xbf2c('0x2d')][_0xbf2c('0x1a')](_0x3379d2)[_0xbf2c('0x22')](function(_0x500e0b){_0x13e238[_0xbf2c('0x1a')]=_0x500e0b;if(_0x502943[_0xbf2c('0x32')][_0xbf2c('0x42')]){_0xef5fc9[_0xbf2c('0x43')]=[{'all':!![]}];}return db['Tag'][_0xbf2c('0x44')](_0xef5fc9);})['then'](function(_0x369bdc){_0x13e238[_0xbf2c('0x45')]=_0x369bdc;return _0x13e238;})[_0xbf2c('0x22')](respondWithFilteredResult(_0x1e946c,_0xef5fc9))[_0xbf2c('0x46')](handleError(_0x1e946c,null));};exports[_0xbf2c('0x47')]=function(_0x14107c,_0x4c2a1e){var _0x365710={'raw':!![],'where':{'id':_0x14107c['params']['id']}},_0x55c3d7={};_0x55c3d7[_0xbf2c('0x36')]=_['keys'](db['Tag'][_0xbf2c('0x2e')]);_0x55c3d7[_0xbf2c('0x32')]=_['keys'](_0x14107c[_0xbf2c('0x32')]);_0x55c3d7['filters']=_[_0xbf2c('0x35')](_0x55c3d7['model'],_0x55c3d7[_0xbf2c('0x32')]);_0x365710[_0xbf2c('0x37')]=_[_0xbf2c('0x35')](_0x55c3d7[_0xbf2c('0x36')],qs[_0xbf2c('0x38')](_0x14107c[_0xbf2c('0x32')]['fields']));_0x365710[_0xbf2c('0x37')]=_0x365710[_0xbf2c('0x37')][_0xbf2c('0x39')]?_0x365710[_0xbf2c('0x37')]:_0x55c3d7[_0xbf2c('0x36')];if(_0x14107c['query']['includeAll']){_0x365710[_0xbf2c('0x43')]=[{'all':!![]}];}_0x365710=_['merge']({},_0x365710,_0x14107c[_0xbf2c('0x41')]);return db[_0xbf2c('0x2d')][_0xbf2c('0x48')](_0x365710)[_0xbf2c('0x22')](handleEntityNotFound(_0x4c2a1e,null))[_0xbf2c('0x22')](respondWithResult(_0x4c2a1e,null))[_0xbf2c('0x46')](handleError(_0x4c2a1e,null));};exports[_0xbf2c('0x49')]=function(_0x1c3b78,_0x128e97){return db[_0xbf2c('0x2d')][_0xbf2c('0x49')](_0x1c3b78['body'],{})[_0xbf2c('0x22')](function(_0x22af02){var _0x90276=_0x1c3b78[_0xbf2c('0x4a')]['get']({'plain':!![]});if(!_0x90276)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x90276['role']===_0xbf2c('0x4a')){var _0x2451ba=_0x22af02['get']({'plain':!![]});var _0x5a0c37='Tags';return db[_0xbf2c('0x4b')][_0xbf2c('0x48')]({'where':{'name':_0x5a0c37,'userProfileId':_0x90276[_0xbf2c('0x4c')]},'raw':!![]})[_0xbf2c('0x22')](function(_0x3a8d9a){if(_0x3a8d9a&&_0x3a8d9a[_0xbf2c('0x4d')]===0x0){return db['UserProfileResource'][_0xbf2c('0x49')]({'name':_0x2451ba[_0xbf2c('0x29')],'resourceId':_0x2451ba['id'],'type':_0x3a8d9a[_0xbf2c('0x29')],'sectionId':_0x3a8d9a['id']},{})[_0xbf2c('0x22')](function(){return _0x22af02;});}else{return _0x22af02;}})[_0xbf2c('0x46')](function(_0x3166dd){logger[_0xbf2c('0x28')](_0xbf2c('0x4e'),_0x3166dd);throw _0x3166dd;});}return _0x22af02;})['then'](respondWithResult(_0x128e97,0xc9))['catch'](handleError(_0x128e97,null));};exports['update']=function(_0x3a62f9,_0x2b0ec3){if(_0x3a62f9[_0xbf2c('0x4f')]['id']){delete _0x3a62f9[_0xbf2c('0x4f')]['id'];}return db['Tag'][_0xbf2c('0x48')]({'where':{'id':_0x3a62f9[_0xbf2c('0x50')]['id']}})['then'](handleEntityNotFound(_0x2b0ec3,null))[_0xbf2c('0x22')](saveUpdates(_0x3a62f9[_0xbf2c('0x4f')],null))[_0xbf2c('0x22')](respondWithResult(_0x2b0ec3,null))['catch'](handleError(_0x2b0ec3,null));};exports['destroy']=function(_0x4b6253,_0x49cae6){return db[_0xbf2c('0x2d')][_0xbf2c('0x48')]({'where':{'id':_0x4b6253[_0xbf2c('0x50')]['id']}})[_0xbf2c('0x22')](handleEntityNotFound(_0x49cae6,null))[_0xbf2c('0x22')](removeEntity(_0x49cae6,null))['catch'](handleError(_0x49cae6,null));}; \ No newline at end of file +var _0x0b78=['model','map','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','includeAll','include','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../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','apply','reject','save','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','rawAttributes','type','key'];(function(_0x31e38e,_0xabf87d){var _0x2d38b7=function(_0xa37bfc){while(--_0xa37bfc){_0x31e38e['push'](_0x31e38e['shift']());}};_0x2d38b7(++_0xabf87d);}(_0x0b78,0x1ad));var _0x80b7=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0b78[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x80b7('0x0'));var rimraf=require(_0x80b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80b7('0x2'));var rp=require(_0x80b7('0x3'));var moment=require('moment');var BPromise=require(_0x80b7('0x4'));var Mustache=require('mustache');var util=require(_0x80b7('0x5'));var path=require(_0x80b7('0x6'));var sox=require(_0x80b7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80b7('0x8'));var _=require('lodash');var squel=require(_0x80b7('0x9'));var crypto=require(_0x80b7('0xa'));var jsforce=require(_0x80b7('0xb'));var deskjs=require(_0x80b7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x80b7('0xd'));var Papa=require(_0x80b7('0xe'));var Redis=require(_0x80b7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x80b7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80b7('0x11'));var logger=require(_0x80b7('0x12'))(_0x80b7('0x13'));var utils=require(_0x80b7('0x14'));var config=require(_0x80b7('0x15'));var licenseUtil=require(_0x80b7('0x16'));var db=require(_0x80b7('0x17'))['db'];function respondWithStatusCode(_0x145241,_0x323d06){_0x323d06=_0x323d06||0xcc;return function(_0x366e34){if(_0x366e34){return _0x145241[_0x80b7('0x18')](_0x323d06);}return _0x145241['status'](_0x323d06)[_0x80b7('0x19')]();};}function respondWithResult(_0x401ad3,_0x527c5b){_0x527c5b=_0x527c5b||0xc8;return function(_0x2ee168){if(_0x2ee168){return _0x401ad3[_0x80b7('0x1a')](_0x527c5b)['json'](_0x2ee168);}};}function respondWithFilteredResult(_0x46822c,_0x3b6b13){return function(_0x21ea65){if(_0x21ea65){var _0x2c0c4e=typeof _0x3b6b13[_0x80b7('0x1b')]===_0x80b7('0x1c')&&typeof _0x3b6b13[_0x80b7('0x1d')]===_0x80b7('0x1c');var _0x2d4008=_0x21ea65[_0x80b7('0x1e')];var _0x4c12b1=_0x2c0c4e?0x0:_0x3b6b13[_0x80b7('0x1b')];var _0x1d62ed=_0x2c0c4e?_0x21ea65[_0x80b7('0x1e')]:_0x3b6b13[_0x80b7('0x1b')]+_0x3b6b13['limit'];var _0x48c356;if(_0x1d62ed>=_0x2d4008){_0x1d62ed=_0x2d4008;_0x48c356=0xc8;}else{_0x48c356=0xce;}_0x46822c[_0x80b7('0x1a')](_0x48c356);return _0x46822c[_0x80b7('0x1f')](_0x80b7('0x20'),_0x4c12b1+'-'+_0x1d62ed+'/'+_0x2d4008)[_0x80b7('0x21')](_0x21ea65);}return null;};}function patchUpdates(_0x574e5c){return function(_0x4f6eec){try{jsonpatch[_0x80b7('0x22')](_0x4f6eec,_0x574e5c,!![]);}catch(_0x3aed77){return BPromise[_0x80b7('0x23')](_0x3aed77);}return _0x4f6eec[_0x80b7('0x24')]();};}function saveUpdates(_0x527d0f,_0x18d407){return function(_0x4c3bed){if(_0x4c3bed){return _0x4c3bed['update'](_0x527d0f)[_0x80b7('0x25')](function(_0xdab5e0){return _0xdab5e0;});}return null;};}function removeEntity(_0x65d31d,_0x155c00){return function(_0x3f3aa5){if(_0x3f3aa5){return _0x3f3aa5[_0x80b7('0x26')]()[_0x80b7('0x25')](function(){var _0x8fa95e=_0x3f3aa5[_0x80b7('0x27')]({'plain':!![]});var _0x1e751a=_0x80b7('0x28');return db[_0x80b7('0x29')][_0x80b7('0x26')]({'where':{'type':_0x1e751a,'resourceId':_0x8fa95e['id']}})[_0x80b7('0x25')](function(){return _0x3f3aa5;});})[_0x80b7('0x25')](function(){_0x65d31d['status'](0xcc)[_0x80b7('0x19')]();});}};}function handleEntityNotFound(_0x1661be,_0x5e3f6f){return function(_0x370bfb){if(!_0x370bfb){_0x1661be[_0x80b7('0x18')](0x194);}return _0x370bfb;};}function handleError(_0x17d845,_0x5497e2){_0x5497e2=_0x5497e2||0x1f4;return function(_0x1b7715){logger[_0x80b7('0x2a')](_0x1b7715[_0x80b7('0x2b')]);if(_0x1b7715[_0x80b7('0x2c')]){delete _0x1b7715[_0x80b7('0x2c')];}_0x17d845[_0x80b7('0x1a')](_0x5497e2)[_0x80b7('0x2d')](_0x1b7715);};}exports[_0x80b7('0x2e')]=function(_0x3fbdf3,_0x940c7a){var _0x3fb3da={},_0x44c3ec={},_0xf35e83={'count':0x0,'rows':[]};var _0x4ae8ad=_['map'](db[_0x80b7('0x2f')][_0x80b7('0x30')],function(_0x4fa26a){return{'name':_0x4fa26a['fieldName'],'type':_0x4fa26a[_0x80b7('0x31')][_0x80b7('0x32')]};});_0x44c3ec[_0x80b7('0x33')]=_[_0x80b7('0x34')](_0x4ae8ad,_0x80b7('0x2c'));_0x44c3ec[_0x80b7('0x35')]=_['keys'](_0x3fbdf3[_0x80b7('0x35')]);_0x44c3ec[_0x80b7('0x36')]=_[_0x80b7('0x37')](_0x44c3ec[_0x80b7('0x33')],_0x44c3ec['query']);_0x3fb3da[_0x80b7('0x38')]=_[_0x80b7('0x37')](_0x44c3ec['model'],qs[_0x80b7('0x39')](_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x39')]));_0x3fb3da[_0x80b7('0x38')]=_0x3fb3da[_0x80b7('0x38')][_0x80b7('0x3a')]?_0x3fb3da[_0x80b7('0x38')]:_0x44c3ec[_0x80b7('0x33')];if(!_0x3fbdf3['query']['hasOwnProperty']('nolimit')){_0x3fb3da[_0x80b7('0x1d')]=qs[_0x80b7('0x1d')](_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x1d')]);_0x3fb3da[_0x80b7('0x1b')]=qs[_0x80b7('0x1b')](_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x1b')]);}_0x3fb3da['order']=qs[_0x80b7('0x3b')](_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x3b')]);_0x3fb3da[_0x80b7('0x3c')]=qs[_0x80b7('0x36')](_[_0x80b7('0x3d')](_0x3fbdf3['query'],_0x44c3ec[_0x80b7('0x36')]),_0x4ae8ad);if(_0x3fbdf3['query'][_0x80b7('0x3e')]){_0x3fb3da[_0x80b7('0x3c')]=_['merge'](_0x3fb3da['where'],{'$or':_[_0x80b7('0x34')](_0x4ae8ad,function(_0x5e21eb){if(_0x5e21eb['type']!==_0x80b7('0x3f')){var _0x2f3b26={};_0x2f3b26[_0x5e21eb['name']]={'$like':'%'+_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x3e')]+'%'};return _0x2f3b26;}})});}_0x3fb3da=_['merge']({},_0x3fb3da,_0x3fbdf3['options']);var _0x2fdd6d={'where':_0x3fb3da[_0x80b7('0x3c')]};return db[_0x80b7('0x2f')][_0x80b7('0x1e')](_0x2fdd6d)[_0x80b7('0x25')](function(_0x21d4f2){_0xf35e83['count']=_0x21d4f2;if(_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x40')]){_0x3fb3da[_0x80b7('0x41')]=[{'all':!![]}];}return db[_0x80b7('0x2f')]['findAll'](_0x3fb3da);})[_0x80b7('0x25')](function(_0x5741ec){_0xf35e83[_0x80b7('0x42')]=_0x5741ec;return _0xf35e83;})[_0x80b7('0x25')](respondWithFilteredResult(_0x940c7a,_0x3fb3da))[_0x80b7('0x43')](handleError(_0x940c7a,null));};exports[_0x80b7('0x44')]=function(_0x132a0d,_0x3be2eb){var _0x3e77e4={'raw':!![],'where':{'id':_0x132a0d[_0x80b7('0x45')]['id']}},_0x39cd2c={};_0x39cd2c[_0x80b7('0x33')]=_[_0x80b7('0x46')](db[_0x80b7('0x2f')][_0x80b7('0x30')]);_0x39cd2c['query']=_[_0x80b7('0x46')](_0x132a0d[_0x80b7('0x35')]);_0x39cd2c['filters']=_[_0x80b7('0x37')](_0x39cd2c['model'],_0x39cd2c['query']);_0x3e77e4[_0x80b7('0x38')]=_['intersection'](_0x39cd2c['model'],qs[_0x80b7('0x39')](_0x132a0d[_0x80b7('0x35')]['fields']));_0x3e77e4[_0x80b7('0x38')]=_0x3e77e4[_0x80b7('0x38')][_0x80b7('0x3a')]?_0x3e77e4['attributes']:_0x39cd2c[_0x80b7('0x33')];if(_0x132a0d[_0x80b7('0x35')][_0x80b7('0x40')]){_0x3e77e4[_0x80b7('0x41')]=[{'all':!![]}];}_0x3e77e4=_['merge']({},_0x3e77e4,_0x132a0d['options']);return db['Tag'][_0x80b7('0x47')](_0x3e77e4)[_0x80b7('0x25')](handleEntityNotFound(_0x3be2eb,null))[_0x80b7('0x25')](respondWithResult(_0x3be2eb,null))[_0x80b7('0x43')](handleError(_0x3be2eb,null));};exports[_0x80b7('0x48')]=function(_0x44b23d,_0x398925){return db[_0x80b7('0x2f')]['create'](_0x44b23d['body'],{})[_0x80b7('0x25')](function(_0x13ebaa){var _0x3d01c6=_0x44b23d[_0x80b7('0x49')][_0x80b7('0x27')]({'plain':!![]});if(!_0x3d01c6)throw new Error(_0x80b7('0x4a'));if(_0x3d01c6['role']===_0x80b7('0x49')){var _0x36e5a5=_0x13ebaa['get']({'plain':!![]});var _0x12dc7b=_0x80b7('0x28');return db[_0x80b7('0x4b')]['find']({'where':{'name':_0x12dc7b,'userProfileId':_0x3d01c6['userProfileId']},'raw':!![]})[_0x80b7('0x25')](function(_0x66202){if(_0x66202&&_0x66202[_0x80b7('0x4c')]===0x0){return db[_0x80b7('0x29')][_0x80b7('0x48')]({'name':_0x36e5a5[_0x80b7('0x2c')],'resourceId':_0x36e5a5['id'],'type':_0x66202['name'],'sectionId':_0x66202['id']},{})[_0x80b7('0x25')](function(){return _0x13ebaa;});}else{return _0x13ebaa;}})[_0x80b7('0x43')](function(_0xeece0a){logger[_0x80b7('0x2a')](_0x80b7('0x4d'),_0xeece0a);throw _0xeece0a;});}return _0x13ebaa;})['then'](respondWithResult(_0x398925,0xc9))['catch'](handleError(_0x398925,null));};exports[_0x80b7('0x4e')]=function(_0x2129d3,_0x274708){if(_0x2129d3['body']['id']){delete _0x2129d3[_0x80b7('0x4f')]['id'];}return db['Tag'][_0x80b7('0x47')]({'where':{'id':_0x2129d3[_0x80b7('0x45')]['id']}})[_0x80b7('0x25')](handleEntityNotFound(_0x274708,null))[_0x80b7('0x25')](saveUpdates(_0x2129d3[_0x80b7('0x4f')],null))[_0x80b7('0x25')](respondWithResult(_0x274708,null))[_0x80b7('0x43')](handleError(_0x274708,null));};exports[_0x80b7('0x26')]=function(_0x43ea4f,_0x4f2588){return db[_0x80b7('0x2f')][_0x80b7('0x47')]({'where':{'id':_0x43ea4f[_0x80b7('0x45')]['id']}})[_0x80b7('0x25')](handleEntityNotFound(_0x4f2588,null))['then'](removeEntity(_0x4f2588,null))[_0x80b7('0x43')](handleError(_0x4f2588,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ab7a467..0d14db4 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 _0x433e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api'];(function(_0x810025,_0x34bb04){var _0x4dbc81=function(_0x2c3907){while(--_0x2c3907){_0x810025['push'](_0x810025['shift']());}};_0x4dbc81(++_0x34bb04);}(_0x433e,0xbf));var _0xe433=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x433e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe433('0x0'));var util=require(_0xe433('0x1'));var logger=require(_0xe433('0x2'))(_0xe433('0x3'));var moment=require(_0xe433('0x4'));var BPromise=require(_0xe433('0x5'));var rp=require(_0xe433('0x6'));var fs=require('fs');var path=require(_0xe433('0x7'));var rimraf=require(_0xe433('0x8'));var config=require(_0xe433('0x9'));var attributes=require(_0xe433('0xa'));module[_0xe433('0xb')]=function(_0xa9ee0c,_0x299204){return _0xa9ee0c[_0xe433('0xc')](_0xe433('0xd'),attributes,{'tableName':_0xe433('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64b7=['rimraf','../../config/environment','./tag.attributes','define','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x64b7,0x194));var _0x764b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x64b7[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x764b('0x0'));var logger=require(_0x764b('0x1'))(_0x764b('0x2'));var moment=require('moment');var BPromise=require(_0x764b('0x3'));var rp=require(_0x764b('0x4'));var fs=require('fs');var path=require(_0x764b('0x5'));var rimraf=require(_0x764b('0x6'));var config=require(_0x764b('0x7'));var attributes=require(_0x764b('0x8'));module['exports']=function(_0x40bed4,_0x32950b){return _0x40bed4[_0x764b('0x9')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 54905b9..8b74c13 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 _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x174db5,_0xe9f757){var _0x45d5e5=function(_0x307a0f){while(--_0x307a0f){_0x174db5['push'](_0x174db5['shift']());}};_0x45d5e5(++_0xe9f757);}(_0xac9d,0x14d));var _0xdac9=function(_0x46390e,_0x39d20f){_0x46390e=_0x46390e-0x0;var _0x4db91c=_0xac9d[_0x46390e];return _0x4db91c;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file +var _0xf725=['http','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x17742b,_0x5cda43){var _0x511d76=function(_0x3a9b33){while(--_0x3a9b33){_0x17742b['push'](_0x17742b['shift']());}};_0x511d76(++_0x5cda43);}(_0xf725,0x7e));var _0x5f72=function(_0x37ad38,_0x535d6f){_0x37ad38=_0x37ad38-0x0;var _0xd5e337=_0xf725[_0x37ad38];return _0xd5e337;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));var BPromise=require(_0x5f72('0x3'));var rs=require(_0x5f72('0x4'));var fs=require('fs');var Redis=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];var utils=require(_0x5f72('0x7'));var logger=require(_0x5f72('0x8'))(_0x5f72('0x9'));var config=require('../../config/environment');var jayson=require(_0x5f72('0xa'));var client=jayson[_0x5f72('0xb')][_0x5f72('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193393,_0x148af8,_0x4961d1){return new BPromise(function(_0x158aa3,_0x523365){return client['request'](_0x193393,_0x4961d1)[_0x5f72('0xd')](function(_0x3f189d){logger['info'](_0x5f72('0xe'),_0x148af8,_0x5f72('0xf'));logger['debug'](_0x5f72('0x10'),_0x148af8,_0x5f72('0xf'),JSON[_0x5f72('0x11')](_0x3f189d));if(_0x3f189d[_0x5f72('0x12')]){if(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x13')]===0x1f4){logger[_0x5f72('0x12')]('Tag,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);return _0x523365(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);}logger[_0x5f72('0x12')]('Tag,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')]['message']);return _0x158aa3(_0x3f189d['error'][_0x5f72('0x14')]);}else{logger['info'](_0x5f72('0xe'),_0x148af8,'request\x20sent');_0x158aa3(_0x3f189d[_0x5f72('0x15')]['message']);}})[_0x5f72('0x16')](function(_0x2c7ac6){logger['error'](_0x5f72('0xe'),_0x148af8,_0x2c7ac6);_0x523365(_0x2c7ac6);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e3a9a27..021555d 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_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'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 218a9cb..d027eda 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 _0xd8b0=['exports','sequelize'];(function(_0x5ddc22,_0x1cea5c){var _0x34f1cd=function(_0x456cba){while(--_0x456cba){_0x5ddc22['push'](_0x5ddc22['shift']());}};_0x34f1cd(++_0x1cea5c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x89e4d7,_0x478805){var _0x5411ef=function(_0x236ae1){while(--_0x236ae1){_0x89e4d7['push'](_0x89e4d7['shift']());}};_0x5411ef(++_0x478805);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 7055cb4..47df09d 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 _0xc8e5=['upsert','VoicePrefixId','spread','removeAgents','isArray','Queue:remove','findOne','rawAttributes','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','map','Team','fieldName','type','query','keys','filters','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','intersection','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','body','params','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','QueryTypes','VoiceQueueId','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','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','UserProfileResource','Teams','getQueues','channel','toLowerCase','Queue','order','pick','capitalize','addQueues','isValidChannel','ValidationError','Unknown\x20channel','add','Queues','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','defaults','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','format','SIP/%s','all'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xc8e5,0x137));var _0x5c8e=function(_0x4670a6,_0x3818ee){_0x4670a6=_0x4670a6-0x0;var _0xe6fcce=_0xc8e5[_0x4670a6];return _0xe6fcce;};'use strict';var emlformat=require(_0x5c8e('0x0'));var rimraf=require(_0x5c8e('0x1'));var zipdir=require(_0x5c8e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c8e('0x3'));var moment=require(_0x5c8e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5c8e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5c8e('0x6'));var ejs=require(_0x5c8e('0x7'));var fs=require('fs');var fs_extra=require(_0x5c8e('0x8'));var _=require(_0x5c8e('0x9'));var squel=require(_0x5c8e('0xa'));var crypto=require('crypto');var jsforce=require(_0x5c8e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5c8e('0x6'));var querystring=require(_0x5c8e('0xc'));var Papa=require(_0x5c8e('0xd'));var Redis=require(_0x5c8e('0xe'));var authService=require(_0x5c8e('0xf'));var qs=require(_0x5c8e('0x10'));var as=require(_0x5c8e('0x11'));var hardwareService=require(_0x5c8e('0x12'));var logger=require(_0x5c8e('0x13'))(_0x5c8e('0x14'));var utils=require(_0x5c8e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5c8e('0x16'))(new Redis(config['redis']));require(_0x5c8e('0x17'))[_0x5c8e('0x18')](socket);function respondWithStatusCode(_0x19f1d7,_0x1f2684){_0x1f2684=_0x1f2684||0xcc;return function(_0x185eaa){if(_0x185eaa){return _0x19f1d7[_0x5c8e('0x19')](_0x1f2684);}return _0x19f1d7[_0x5c8e('0x1a')](_0x1f2684)[_0x5c8e('0x1b')]();};}function respondWithResult(_0x3d7cb1,_0x2ea754){_0x2ea754=_0x2ea754||0xc8;return function(_0x1d0616){if(_0x1d0616){return _0x3d7cb1[_0x5c8e('0x1a')](_0x2ea754)[_0x5c8e('0x1c')](_0x1d0616);}};}function respondWithFilteredResult(_0x30a070,_0x5bb922){return function(_0x2d7867){if(_0x2d7867){var _0x54a68c=typeof _0x5bb922[_0x5c8e('0x1d')]===_0x5c8e('0x1e')&&typeof _0x5bb922[_0x5c8e('0x1f')]===_0x5c8e('0x1e');var _0x53d9a0=_0x2d7867[_0x5c8e('0x20')];var _0xd61ccf=_0x54a68c?0x0:_0x5bb922[_0x5c8e('0x1d')];var _0xaa5ef1=_0x54a68c?_0x2d7867['count']:_0x5bb922['offset']+_0x5bb922[_0x5c8e('0x1f')];var _0x5871de;if(_0xaa5ef1>=_0x53d9a0){_0xaa5ef1=_0x53d9a0;_0x5871de=0xc8;}else{_0x5871de=0xce;}_0x30a070['status'](_0x5871de);return _0x30a070['set'](_0x5c8e('0x21'),_0xd61ccf+'-'+_0xaa5ef1+'/'+_0x53d9a0)['json'](_0x2d7867);}return null;};}function patchUpdates(_0x32372a){return function(_0x2c6fc6){try{jsonpatch[_0x5c8e('0x22')](_0x2c6fc6,_0x32372a,!![]);}catch(_0x2acec3){return BPromise[_0x5c8e('0x23')](_0x2acec3);}return _0x2c6fc6[_0x5c8e('0x24')]();};}function saveUpdates(_0x159d9a,_0x4443b1){return function(_0x17dba4){if(_0x17dba4){return _0x17dba4[_0x5c8e('0x25')](_0x159d9a)[_0x5c8e('0x26')](function(_0x56eadd){return _0x56eadd;});}return null;};}function handleEntityNotFound(_0xd13962,_0x4b426f){return function(_0x3ffc7b){if(!_0x3ffc7b){_0xd13962[_0x5c8e('0x19')](0x194);}return _0x3ffc7b;};}function handleError(_0x3e5269,_0x54cb8a){_0x54cb8a=_0x54cb8a||0x1f4;return function(_0x4c23e8){logger[_0x5c8e('0x27')](_0x4c23e8['stack']);if(_0x4c23e8[_0x5c8e('0x28')]){delete _0x4c23e8[_0x5c8e('0x28')];}_0x3e5269[_0x5c8e('0x1a')](_0x54cb8a)[_0x5c8e('0x29')](_0x4c23e8);};}exports['index']=function(_0x1908f7,_0x2521b8){var _0x28306f={},_0x126319={},_0x19605f={'count':0x0,'rows':[]};var _0x28ca5a=_[_0x5c8e('0x2a')](db[_0x5c8e('0x2b')]['rawAttributes'],function(_0x13ad86){return{'name':_0x13ad86[_0x5c8e('0x2c')],'type':_0x13ad86[_0x5c8e('0x2d')]['key']};});_0x126319['model']=_[_0x5c8e('0x2a')](_0x28ca5a,_0x5c8e('0x28'));_0x126319[_0x5c8e('0x2e')]=_[_0x5c8e('0x2f')](_0x1908f7['query']);_0x126319[_0x5c8e('0x30')]=_['intersection'](_0x126319['model'],_0x126319[_0x5c8e('0x2e')]);_0x28306f[_0x5c8e('0x31')]=_['intersection'](_0x126319['model'],qs['fields'](_0x1908f7[_0x5c8e('0x2e')][_0x5c8e('0x32')]));_0x28306f[_0x5c8e('0x31')]=_0x28306f['attributes'][_0x5c8e('0x33')]?_0x28306f[_0x5c8e('0x31')]:_0x126319[_0x5c8e('0x34')];if(!_0x1908f7[_0x5c8e('0x2e')][_0x5c8e('0x35')](_0x5c8e('0x36'))){_0x28306f[_0x5c8e('0x1f')]=qs['limit'](_0x1908f7[_0x5c8e('0x2e')][_0x5c8e('0x1f')]);_0x28306f[_0x5c8e('0x1d')]=qs['offset'](_0x1908f7[_0x5c8e('0x2e')]['offset']);}_0x28306f['order']=qs['sort'](_0x1908f7[_0x5c8e('0x2e')][_0x5c8e('0x37')]);_0x28306f[_0x5c8e('0x38')]=qs[_0x5c8e('0x30')](_['pick'](_0x1908f7[_0x5c8e('0x2e')],_0x126319[_0x5c8e('0x30')]),_0x28ca5a);if(_0x1908f7[_0x5c8e('0x2e')][_0x5c8e('0x39')]){_0x28306f[_0x5c8e('0x38')]=_[_0x5c8e('0x3a')](_0x28306f[_0x5c8e('0x38')],{'$or':_['map'](_0x28ca5a,function(_0x29a675){if(_0x29a675['type']!==_0x5c8e('0x3b')){var _0x5792b0={};_0x5792b0[_0x29a675[_0x5c8e('0x28')]]={'$like':'%'+_0x1908f7[_0x5c8e('0x2e')][_0x5c8e('0x39')]+'%'};return _0x5792b0;}})});}_0x28306f=_[_0x5c8e('0x3a')]({},_0x28306f,_0x1908f7[_0x5c8e('0x3c')]);var _0x3c5d3f={'where':_0x28306f[_0x5c8e('0x38')]};return db['Team'][_0x5c8e('0x20')](_0x3c5d3f)['then'](function(_0x46984b){_0x19605f['count']=_0x46984b;if(_0x1908f7[_0x5c8e('0x2e')][_0x5c8e('0x3d')]){_0x28306f['include']=[{'all':!![]}];}return db[_0x5c8e('0x2b')]['findAll'](_0x28306f);})[_0x5c8e('0x26')](function(_0x438263){_0x19605f[_0x5c8e('0x3e')]=_0x438263;return _0x19605f;})[_0x5c8e('0x26')](respondWithFilteredResult(_0x2521b8,_0x28306f))['catch'](handleError(_0x2521b8,null));};exports[_0x5c8e('0x3f')]=function(_0x513a58,_0x34c1b0){var _0x21fd98={'raw':![],'where':{'id':_0x513a58['params']['id']}},_0xeeb0a0={};_0xeeb0a0[_0x5c8e('0x34')]=_[_0x5c8e('0x2f')](db[_0x5c8e('0x2b')]['rawAttributes']);_0xeeb0a0[_0x5c8e('0x2e')]=_['keys'](_0x513a58[_0x5c8e('0x2e')]);_0xeeb0a0['filters']=_[_0x5c8e('0x40')](_0xeeb0a0['model'],_0xeeb0a0[_0x5c8e('0x2e')]);_0x21fd98[_0x5c8e('0x31')]=_['intersection'](_0xeeb0a0[_0x5c8e('0x34')],qs['fields'](_0x513a58[_0x5c8e('0x2e')][_0x5c8e('0x32')]));_0x21fd98[_0x5c8e('0x31')]=_0x21fd98[_0x5c8e('0x31')]['length']?_0x21fd98[_0x5c8e('0x31')]:_0xeeb0a0['model'];if(_0x513a58['query'][_0x5c8e('0x3d')]){_0x21fd98['include']=[{'all':!![]}];}_0x21fd98=_[_0x5c8e('0x3a')]({},_0x21fd98,_0x513a58[_0x5c8e('0x3c')]);return db['Team'][_0x5c8e('0x41')](_0x21fd98)[_0x5c8e('0x26')](handleEntityNotFound(_0x34c1b0,null))[_0x5c8e('0x26')](respondWithResult(_0x34c1b0,null))['catch'](handleError(_0x34c1b0,null));};exports['create']=function(_0x3d213a,_0x139f51){return db[_0x5c8e('0x2b')][_0x5c8e('0x42')](_0x3d213a['body'],{})[_0x5c8e('0x26')](function(_0x326c08){var _0x5d4118=_0x3d213a[_0x5c8e('0x43')][_0x5c8e('0x44')]({'plain':!![]});if(!_0x5d4118)throw new Error(_0x5c8e('0x45'));if(_0x5d4118[_0x5c8e('0x46')]===_0x5c8e('0x43')){var _0x5498c3=_0x326c08['get']({'plain':!![]});var _0x47b8f1='Teams';return db[_0x5c8e('0x47')][_0x5c8e('0x41')]({'where':{'name':_0x47b8f1,'userProfileId':_0x5d4118['userProfileId']},'raw':!![]})[_0x5c8e('0x26')](function(_0x4b4965){if(_0x4b4965&&_0x4b4965[_0x5c8e('0x48')]===0x0){return db['UserProfileResource'][_0x5c8e('0x42')]({'name':_0x5498c3[_0x5c8e('0x28')],'resourceId':_0x5498c3['id'],'type':_0x4b4965[_0x5c8e('0x28')],'sectionId':_0x4b4965['id']},{})[_0x5c8e('0x26')](function(){return _0x326c08;});}else{return _0x326c08;}})[_0x5c8e('0x49')](function(_0x1d8d5a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d8d5a);throw _0x1d8d5a;});}return _0x326c08;})['then'](respondWithResult(_0x139f51,0xc9))['catch'](handleError(_0x139f51,null));};exports[_0x5c8e('0x25')]=function(_0x444fa0,_0x49d958){if(_0x444fa0[_0x5c8e('0x4a')]['id']){delete _0x444fa0['body']['id'];}return db[_0x5c8e('0x2b')][_0x5c8e('0x41')]({'where':{'id':_0x444fa0[_0x5c8e('0x4b')]['id']}})[_0x5c8e('0x26')](handleEntityNotFound(_0x49d958,null))[_0x5c8e('0x26')](saveUpdates(_0x444fa0[_0x5c8e('0x4a')],null))[_0x5c8e('0x26')](respondWithResult(_0x49d958,null))['catch'](handleError(_0x49d958,null));};exports[_0x5c8e('0x4c')]=function(_0x4b9fc9,_0x5f039c){var _0x37003d=_0x4b9fc9[_0x5c8e('0x4b')]['id'];var _0x21b747=[];return db[_0x5c8e('0x4d')][_0x5c8e('0x4e')](function(_0x271f8e){var _0x4793b8=_0x5c8e('0x4f')+_0x37003d;return db[_0x5c8e('0x4d')]['query'](_0x4793b8,{'type':db[_0x5c8e('0x50')]['QueryTypes'][_0x5c8e('0x51')],'raw':!![],'transaction':_0x271f8e})[_0x5c8e('0x26')](function(_0xdf88c2){_0x21b747=_['map'](_0xdf88c2,function(_0x363327){return Number(_0x363327[_0x5c8e('0x52')]);});})['then'](function(){var _0x2bee71='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x37003d;return db[_0x5c8e('0x4d')][_0x5c8e('0x2e')](_0x2bee71,{'type':db[_0x5c8e('0x50')][_0x5c8e('0x53')][_0x5c8e('0x51')],'raw':!![],'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(_0x49fdbd){var _0x40314c=_['map'](_0x49fdbd,function(_0x211877){return Number(_0x211877[_0x5c8e('0x54')]);});return db['UserVoiceQueue'][_0x5c8e('0x4c')]({'where':{'UserId':{'$in':_0x21b747},'VoiceQueueId':{'$in':_0x40314c}},'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(){var _0x5e64d4=_0x5c8e('0x55')+_0x37003d;return db[_0x5c8e('0x4d')][_0x5c8e('0x2e')](_0x5e64d4,{'type':db[_0x5c8e('0x50')][_0x5c8e('0x53')][_0x5c8e('0x51')],'raw':!![],'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(_0x1b9b80){var _0x56a1b9=_[_0x5c8e('0x2a')](_0x1b9b80,function(_0x455642){return Number(_0x455642['MailQueueId']);});return db[_0x5c8e('0x56')][_0x5c8e('0x4c')]({'where':{'UserId':{'$in':_0x21b747},'MailQueueId':{'$in':_0x56a1b9}},'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(){var _0x12017d=_0x5c8e('0x57')+_0x37003d;return db[_0x5c8e('0x4d')][_0x5c8e('0x2e')](_0x12017d,{'type':db[_0x5c8e('0x50')][_0x5c8e('0x53')][_0x5c8e('0x51')],'raw':!![],'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(_0x3bec98){var _0x1e10fa=_[_0x5c8e('0x2a')](_0x3bec98,function(_0x3465c0){return Number(_0x3465c0[_0x5c8e('0x58')]);});return db[_0x5c8e('0x59')][_0x5c8e('0x4c')]({'where':{'UserId':{'$in':_0x21b747},'SmsQueueId':{'$in':_0x1e10fa}},'transaction':_0x271f8e});})['then'](function(){var _0x3672cd=_0x5c8e('0x5a')+_0x37003d;return db[_0x5c8e('0x4d')][_0x5c8e('0x2e')](_0x3672cd,{'type':db[_0x5c8e('0x50')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(_0x2e1f97){var _0x65dff9=_[_0x5c8e('0x2a')](_0x2e1f97,function(_0x5af33a){return Number(_0x5af33a[_0x5c8e('0x5b')]);});return db['UserChatQueue'][_0x5c8e('0x4c')]({'where':{'UserId':{'$in':_0x21b747},'ChatQueueId':{'$in':_0x65dff9}},'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(){var _0x212fb0=_0x5c8e('0x5c')+_0x37003d;return db[_0x5c8e('0x4d')][_0x5c8e('0x2e')](_0x212fb0,{'type':db[_0x5c8e('0x50')][_0x5c8e('0x53')][_0x5c8e('0x51')],'raw':!![],'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(_0x39d064){var _0x4e4c49=_[_0x5c8e('0x2a')](_0x39d064,function(_0x113087){return Number(_0x113087[_0x5c8e('0x5d')]);});return db[_0x5c8e('0x5e')]['destroy']({'where':{'UserId':{'$in':_0x21b747},'FaxQueueId':{'$in':_0x4e4c49}},'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(){var _0x4419e5=_0x5c8e('0x5f')+_0x37003d;return db['sequelize'][_0x5c8e('0x2e')](_0x4419e5,{'type':db[_0x5c8e('0x50')][_0x5c8e('0x53')][_0x5c8e('0x51')],'raw':!![],'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(_0x28af98){var _0x3d13fd=_[_0x5c8e('0x2a')](_0x28af98,function(_0x411389){return Number(_0x411389['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x5c8e('0x4c')]({'where':{'UserId':{'$in':_0x21b747},'OpenchannelQueueId':{'$in':_0x3d13fd}},'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(){var _0x37c999=_0x5c8e('0x60')+_0x37003d;return db[_0x5c8e('0x4d')]['query'](_0x37c999,{'type':db['Sequelize'][_0x5c8e('0x53')][_0x5c8e('0x51')],'raw':!![],'transaction':_0x271f8e});})['then'](function(_0x1d1b46){var _0x5f5125=_['map'](_0x1d1b46,function(_0x2ced77){return Number(_0x2ced77[_0x5c8e('0x61')]);});return db[_0x5c8e('0x62')][_0x5c8e('0x4c')]({'where':{'UserId':{'$in':_0x21b747},'WhatsappQueueId':{'$in':_0x5f5125}},'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(){return db[_0x5c8e('0x63')]['find']({'where':{'TeamId':_0x37003d}});})['then'](function(_0x2852ad){if(_0x2852ad===null){return;}return db[_0x5c8e('0x64')][_0x5c8e('0x4c')]({'where':{'UserId':{'$in':_0x21b747},'VoicePrefixId':_0x2852ad['VoicePrefixId']},'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(){return db['Team']['destroy']({'where':{'id':_0x37003d},'cascade':!![],'transaction':_0x271f8e});})[_0x5c8e('0x26')](function(_0x2dc198){if(_0x2dc198===0x0){_0x5f039c['sendStatus'](0x194);}else{return db[_0x5c8e('0x65')][_0x5c8e('0x4c')]({'where':{'type':_0x5c8e('0x66'),'resourceId':_0x37003d},'cascade':!![],'transaction':_0x271f8e})[_0x5c8e('0x26')](function(){_0x5f039c[_0x5c8e('0x1a')](0xcc)[_0x5c8e('0x1b')]();});}})[_0x5c8e('0x49')](function(_0x37bfc3){_0x5f039c['status'](0x1f4)[_0x5c8e('0x29')](_0x37bfc3);});});};exports[_0x5c8e('0x67')]=function(_0x4d7745,_0x2ceb60,_0x54c351){return db[_0x5c8e('0x2b')]['findOne']({'where':{'id':_0x4d7745[_0x5c8e('0x4b')]['id']}})[_0x5c8e('0x26')](handleEntityNotFound(_0x2ceb60,null))['then'](function(_0x3265b4){if(!_0x4d7745[_0x5c8e('0x2e')][_0x5c8e('0x68')]||!utils['isValidChannel'](_0x4d7745[_0x5c8e('0x2e')][_0x5c8e('0x68')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}var _0x3e73a5={};var _0x3b00d0={};_0x3b00d0[_0x5c8e('0x34')]=_[_0x5c8e('0x2f')](db[_['capitalize'](_0x4d7745['query'][_0x5c8e('0x68')][_0x5c8e('0x69')]())+_0x5c8e('0x6a')]['rawAttributes']);_0x3b00d0[_0x5c8e('0x2e')]=_[_0x5c8e('0x2f')](_0x4d7745[_0x5c8e('0x2e')]);_0x3b00d0['filters']=_[_0x5c8e('0x40')](_0x3b00d0[_0x5c8e('0x34')],_0x3b00d0[_0x5c8e('0x2e')]);_0x3e73a5[_0x5c8e('0x31')]=_[_0x5c8e('0x40')](_0x3b00d0[_0x5c8e('0x34')],qs[_0x5c8e('0x32')](_0x4d7745['query']['fields']));_0x3e73a5[_0x5c8e('0x31')]=_0x3e73a5['attributes'][_0x5c8e('0x33')]?_0x3e73a5[_0x5c8e('0x31')]:_0x3b00d0['model'];_0x3e73a5[_0x5c8e('0x1f')]=qs['limit'](_0x4d7745['query']['limit']);_0x3e73a5[_0x5c8e('0x1d')]=qs[_0x5c8e('0x1d')](_0x4d7745[_0x5c8e('0x2e')][_0x5c8e('0x1d')]);_0x3e73a5[_0x5c8e('0x6b')]=qs[_0x5c8e('0x37')](_0x4d7745[_0x5c8e('0x2e')][_0x5c8e('0x37')]);_0x3e73a5[_0x5c8e('0x38')]=qs[_0x5c8e('0x30')](_[_0x5c8e('0x6c')](_0x4d7745[_0x5c8e('0x2e')],_0x3b00d0[_0x5c8e('0x30')]));_0x3e73a5=_[_0x5c8e('0x3a')]({},_0x3e73a5,_0x4d7745[_0x5c8e('0x3c')]);return _0x3265b4[_0x5c8e('0x44')+_[_0x5c8e('0x6d')](_0x4d7745[_0x5c8e('0x2e')][_0x5c8e('0x68')][_0x5c8e('0x69')]())+'Queues'](_0x3e73a5);})[_0x5c8e('0x26')](respondWithResult(_0x2ceb60,null))[_0x5c8e('0x49')](handleError(_0x2ceb60,null));};exports[_0x5c8e('0x6e')]=function(_0x4c536b,_0x20ca77,_0x4d94c6){return db[_0x5c8e('0x2b')]['findOne']({'where':{'id':_0x4c536b['params']['id']}})[_0x5c8e('0x26')](function(_0x2aa7c1){if(_0x2aa7c1){if(!_0x4c536b[_0x5c8e('0x4a')][_0x5c8e('0x68')]||!utils[_0x5c8e('0x6f')](_0x4c536b[_0x5c8e('0x4a')][_0x5c8e('0x68')])){throw new db[(_0x5c8e('0x50'))][(_0x5c8e('0x70'))](_0x5c8e('0x71'));}return _0x2aa7c1[_0x5c8e('0x72')+_[_0x5c8e('0x6d')](_0x4c536b[_0x5c8e('0x4a')][_0x5c8e('0x68')][_0x5c8e('0x69')]())+_0x5c8e('0x73')](_0x4c536b[_0x5c8e('0x4a')][_0x5c8e('0x74')]);}return null;})[_0x5c8e('0x26')](handleEntityNotFound(_0x20ca77,null))[_0x5c8e('0x26')](respondWithStatusCode(_0x20ca77,null))[_0x5c8e('0x49')](handleError(_0x20ca77,null));};exports[_0x5c8e('0x75')]=function(_0x123c79,_0x9de35d,_0x47db8a){return db[_0x5c8e('0x2b')]['findOne']({'where':{'id':_0x123c79[_0x5c8e('0x4b')]['id']}})[_0x5c8e('0x26')](function(_0x149437){if(_0x149437){if(!_0x123c79['query'][_0x5c8e('0x68')]||!utils['isValidChannel'](_0x123c79[_0x5c8e('0x2e')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x149437['remove'+_[_0x5c8e('0x6d')](_0x123c79[_0x5c8e('0x2e')][_0x5c8e('0x68')][_0x5c8e('0x69')]())+_0x5c8e('0x73')](_0x123c79[_0x5c8e('0x2e')][_0x5c8e('0x74')]);}return null;})['then'](handleEntityNotFound(_0x9de35d,null))[_0x5c8e('0x26')](respondWithStatusCode(_0x9de35d,null))[_0x5c8e('0x49')](handleError(_0x9de35d,null));};exports[_0x5c8e('0x76')]=function(_0x3e4c19,_0xa1cf26){var _0x23058c=_['isArray'](_0x3e4c19[_0x5c8e('0x4a')][_0x5c8e('0x74')])?_0x3e4c19['body'][_0x5c8e('0x74')]:[_0x3e4c19[_0x5c8e('0x4a')]['ids']];var _0x119736=_0x3e4c19[_0x5c8e('0x4b')]['id'];return db[_0x5c8e('0x2b')]['find']({'where':{'id':_0x119736}})[_0x5c8e('0x26')](handleEntityNotFound(_0xa1cf26,null))['then'](function(_0x12073e){if(_0x12073e){var _0xde4290=[_0x5c8e('0x77'),_0x5c8e('0x78'),_0x5c8e('0x79'),_0x5c8e('0x7a'),_0x5c8e('0x7b'),_0x5c8e('0x7c'),_0x5c8e('0x7d')];return db[_0x5c8e('0x4d')]['transaction'](function(_0x5c2743){var _0x534c59=_[_0x5c8e('0x2a')](_0xde4290,function(_0x43377a){var _0x1d7496={'attributes':['id','name']};if(_0x43377a===_0x5c8e('0x77')){_0x1d7496[_0x5c8e('0x7e')]={'attributes':[_0x5c8e('0x7f')]};}return _0x12073e[_0x5c8e('0x44')+_0x43377a+_0x5c8e('0x73')](_0x1d7496)['then'](function(_0x5325a7){var _0x36d87b=_[_0x5c8e('0x2a')](_0x5325a7,function(_0x3a4b18){var _0x5857eb=_['map'](_0x23058c,function(_0xf5a1ec){var _0x2bb301={'where':{'UserId':_0xf5a1ec,[_0x43377a+_0x5c8e('0x80')]:_0x3a4b18['id']},'transaction':_0x5c2743};if(_0x43377a===_0x5c8e('0x77')){_0x2bb301[_0x5c8e('0x81')]={'penalty':_0x3a4b18[_0x5c8e('0x82')][_0x5c8e('0x7f')]};}return db[_0x5c8e('0x83')+_0x43377a+_0x5c8e('0x6a')][_0x5c8e('0x84')](_0x2bb301)['then'](function(){socket[_0x5c8e('0x85')](_0x5c8e('0x43')+_0x43377a+_0x5c8e('0x86'),{'UserId':_0xf5a1ec,[_0x43377a+'QueueId']:_0x3a4b18['id']});if(_0x43377a!==_0x5c8e('0x77')){return;}return db[_0x5c8e('0x83')]['findAll']({'where':{'id':_0x23058c,'online':0x1},'attributes':['id',_0x5c8e('0x28'),_0x5c8e('0x87'),_0x5c8e('0x88'),_0x5c8e('0x89')],'raw':!![]})['then'](function(_0x35519a){var _0x1534b1=_[_0x5c8e('0x2a')](_0x35519a,function(_0x5dff79){return db[_0x5c8e('0x8a')]['upsert']({'membername':_0x5dff79[_0x5c8e('0x28')],'UserId':_0x5dff79['id'],'queue_name':_0x3a4b18[_0x5c8e('0x28')],'VoiceQueueId':_0x3a4b18['id'],'interface':_['isNil'](_0x5dff79[_0x5c8e('0x89')])?util[_0x5c8e('0x8b')](_0x5c8e('0x8c'),_0x5dff79[_0x5c8e('0x28')]):_0x5dff79['interface'],'paused':_0x5dff79[_0x5c8e('0x88')]||![],'penalty':_0x3a4b18[_0x5c8e('0x82')]['penalty']},{'transaction':_0x5c2743});});return Promise[_0x5c8e('0x8d')](_0x1534b1);});});});return Promise[_0x5c8e('0x8d')](_0x5857eb);});return Promise[_0x5c8e('0x8d')](_0x36d87b);})[_0x5c8e('0x26')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x119736}})[_0x5c8e('0x26')](function(_0x60cc5c){if(_0x60cc5c){var _0x9de4c4=_[_0x5c8e('0x2a')](_0x23058c,function(_0x4dcd62){db[_0x5c8e('0x64')][_0x5c8e('0x8e')]({'UserId':_0x4dcd62,'VoicePrefixId':_0x60cc5c[_0x5c8e('0x8f')]});});return Promise[_0x5c8e('0x8d')](_0x9de4c4);}});});});return Promise[_0x5c8e('0x8d')](_0x534c59)['then'](function(){return _0x12073e[_0x5c8e('0x76')](_0x23058c,{'transaction':_0x5c2743})[_0x5c8e('0x90')](function(_0x376b00){return _0x376b00;});});});}})[_0x5c8e('0x26')](respondWithResult(_0xa1cf26,null))['catch'](handleError(_0xa1cf26,null));};exports[_0x5c8e('0x91')]=function(_0x5051a1,_0x51c9c5){var _0x425329=_[_0x5c8e('0x92')](_0x5051a1[_0x5c8e('0x2e')]['ids'])?_0x5051a1[_0x5c8e('0x2e')][_0x5c8e('0x74')]:[_0x5051a1[_0x5c8e('0x2e')]['ids']];var _0x156894=_0x5051a1['params']['id'];return db['Team'][_0x5c8e('0x41')]({'where':{'id':_0x156894}})['then'](handleEntityNotFound(_0x51c9c5,null))[_0x5c8e('0x26')](function(_0x3a9e04){if(_0x3a9e04){var _0x1eef6e=[_0x5c8e('0x77'),'Chat',_0x5c8e('0x79'),'Sms','Fax',_0x5c8e('0x7c'),_0x5c8e('0x7d')];return db['sequelize'][_0x5c8e('0x4e')](function(_0x1b5fe2){var _0x300b18=_[_0x5c8e('0x2a')](_0x1eef6e,function(_0x5cc564){var _0x45cd67={'attributes':['id',_0x5c8e('0x28')]};return _0x3a9e04['get'+_0x5cc564+'Queues'](_0x45cd67)[_0x5c8e('0x26')](function(_0x5e06ca){var _0x4af1a9=_[_0x5c8e('0x2a')](_0x5e06ca,function(_0x498339){return _0x498339['removeAgents'](_0x425329,{'transaction':_0x1b5fe2})[_0x5c8e('0x26')](function(){var _0xc7280b=_['map'](_0x425329,function(_0x5e9c69){socket[_0x5c8e('0x85')](_0x5c8e('0x43')+_0x5cc564+_0x5c8e('0x93'),{'UserId':Number(_0x5e9c69),[_0x5cc564+'QueueId']:_0x498339['id']});if(_0x5cc564!==_0x5c8e('0x77')){return;}return db['UserVoiceQueueRt'][_0x5c8e('0x4c')]({'where':{'VoiceQueueId':_0x498339['id'],'UserId':_0x5e9c69},'transaction':_0x1b5fe2});});return Promise['all'](_0xc7280b);});});return Promise[_0x5c8e('0x8d')](_0x4af1a9);});});return Promise[_0x5c8e('0x8d')](_0x300b18)['then'](function(){return _0x3a9e04[_0x5c8e('0x91')](_0x425329,{'transaction':_0x1b5fe2});})[_0x5c8e('0x26')](function(){return db[_0x5c8e('0x63')][_0x5c8e('0x94')]({'where':{'teamId':_0x156894}})[_0x5c8e('0x26')](function(_0x10a040){if(_0x10a040){var _0x6ec0eb=_[_0x5c8e('0x2a')](_0x425329,function(_0x220b26){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x220b26,'VoicePrefixId':_0x10a040[_0x5c8e('0x8f')]}});});return Promise[_0x5c8e('0x8d')](_0x6ec0eb);}});});});}})[_0x5c8e('0x26')](respondWithStatusCode(_0x51c9c5,null))[_0x5c8e('0x49')](handleError(_0x51c9c5,null));};exports['getAgents']=function(_0x2a3a92,_0x872071,_0x165bee){var _0xe20082={};var _0xdad082={};var _0x349896;var _0x50c419;return db['Team'][_0x5c8e('0x94')]({'where':{'id':_0x2a3a92[_0x5c8e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x872071,null))[_0x5c8e('0x26')](function(_0x32affe){if(_0x32affe){_0x349896=_0x32affe;_0xdad082[_0x5c8e('0x34')]=_[_0x5c8e('0x2f')](db[_0x5c8e('0x83')][_0x5c8e('0x95')]);_0xdad082[_0x5c8e('0x2e')]=_[_0x5c8e('0x2f')](_0x2a3a92[_0x5c8e('0x2e')]);_0xdad082[_0x5c8e('0x30')]=_[_0x5c8e('0x40')](_0xdad082[_0x5c8e('0x34')],_0xdad082[_0x5c8e('0x2e')]);_0xe20082[_0x5c8e('0x31')]=_[_0x5c8e('0x40')](_0xdad082[_0x5c8e('0x34')],qs[_0x5c8e('0x32')](_0x2a3a92[_0x5c8e('0x2e')]['fields']));_0xe20082['attributes']=_0xe20082[_0x5c8e('0x31')][_0x5c8e('0x33')]?_0xe20082[_0x5c8e('0x31')]:_0xdad082[_0x5c8e('0x34')];_0xe20082[_0x5c8e('0x6b')]=qs[_0x5c8e('0x37')](_0x2a3a92[_0x5c8e('0x2e')][_0x5c8e('0x37')]);_0xe20082['where']=qs[_0x5c8e('0x30')](_['pick'](_0x2a3a92[_0x5c8e('0x2e')],_0xdad082[_0x5c8e('0x30')]));if(_0x2a3a92[_0x5c8e('0x2e')]['filter']){_0xe20082[_0x5c8e('0x38')]=_['merge'](_0xe20082['where'],{'$or':_['map'](_0xe20082['attributes'],function(_0x43f73d){var _0x302a18={};_0x302a18[_0x43f73d]={'$like':'%'+_0x2a3a92['query']['filter']+'%'};return _0x302a18;})});}_0xe20082=_[_0x5c8e('0x3a')]({},_0xe20082,_0x2a3a92[_0x5c8e('0x3c')]);return _0x349896[_0x5c8e('0x96')](_0xe20082);}})[_0x5c8e('0x26')](function(_0x5291f9){if(_0x5291f9){_0x50c419=_0x5291f9['length'];if(!_0x2a3a92[_0x5c8e('0x2e')][_0x5c8e('0x35')](_0x5c8e('0x36'))){_0xe20082[_0x5c8e('0x1f')]=qs[_0x5c8e('0x1f')](_0x2a3a92[_0x5c8e('0x2e')][_0x5c8e('0x1f')]);_0xe20082[_0x5c8e('0x1d')]=qs['offset'](_0x2a3a92[_0x5c8e('0x2e')][_0x5c8e('0x1d')]);}return _0x349896[_0x5c8e('0x96')](_0xe20082);}})[_0x5c8e('0x26')](function(_0x3d8a74){if(_0x3d8a74){return _0x3d8a74?{'count':_0x50c419,'rows':_0x3d8a74}:null;}})['then'](respondWithResult(_0x872071,null))[_0x5c8e('0x49')](handleError(_0x872071,null));}; \ No newline at end of file +var _0x53eb=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./team.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','name','send','index','map','Team','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','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','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','Queue','length','Queues','ValidationError','add','toLowerCase','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','transaction','penalty','QueueId','TeamVoiceQueue','User','Queue:save','voicePause','interface','upsert','isNil','format','SIP/%s','all','UserVoicePrefix','spread','removeAgents','Mail','emit','Queue:remove','getAgents','order','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x53eb,0x12d));var _0xb53e=function(_0x520a7f,_0x2e6481){_0x520a7f=_0x520a7f-0x0;var _0x5b61b8=_0x53eb[_0x520a7f];return _0x5b61b8;};'use strict';var emlformat=require(_0xb53e('0x0'));var rimraf=require(_0xb53e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb53e('0x2'));var rp=require(_0xb53e('0x3'));var moment=require('moment');var BPromise=require(_0xb53e('0x4'));var Mustache=require(_0xb53e('0x5'));var util=require(_0xb53e('0x6'));var path=require(_0xb53e('0x7'));var sox=require(_0xb53e('0x8'));var csv=require(_0xb53e('0x9'));var ejs=require(_0xb53e('0xa'));var fs=require('fs');var fs_extra=require(_0xb53e('0xb'));var _=require('lodash');var squel=require(_0xb53e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb53e('0xd'));var toCsv=require(_0xb53e('0x9'));var querystring=require(_0xb53e('0xe'));var Papa=require(_0xb53e('0xf'));var Redis=require(_0xb53e('0x10'));var authService=require(_0xb53e('0x11'));var qs=require(_0xb53e('0x12'));var as=require(_0xb53e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb53e('0x14'));var utils=require(_0xb53e('0x15'));var config=require(_0xb53e('0x16'));var licenseUtil=require(_0xb53e('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb53e('0x18')](config['redis'],{'host':_0xb53e('0x19'),'port':0x18eb});var socket=require(_0xb53e('0x1a'))(new Redis(config[_0xb53e('0x1b')]));require(_0xb53e('0x1c'))['register'](socket);function respondWithStatusCode(_0x525141,_0x36d5d1){_0x36d5d1=_0x36d5d1||0xcc;return function(_0x19739c){if(_0x19739c){return _0x525141[_0xb53e('0x1d')](_0x36d5d1);}return _0x525141[_0xb53e('0x1e')](_0x36d5d1)[_0xb53e('0x1f')]();};}function respondWithResult(_0x4655d8,_0x28eff4){_0x28eff4=_0x28eff4||0xc8;return function(_0x4a54fc){if(_0x4a54fc){return _0x4655d8[_0xb53e('0x1e')](_0x28eff4)['json'](_0x4a54fc);}};}function respondWithFilteredResult(_0x1bac54,_0x3e95d2){return function(_0x4a2133){if(_0x4a2133){var _0x2cbee9=typeof _0x3e95d2[_0xb53e('0x20')]===_0xb53e('0x21')&&typeof _0x3e95d2[_0xb53e('0x22')]===_0xb53e('0x21');var _0x222ebd=_0x4a2133[_0xb53e('0x23')];var _0x80cc79=_0x2cbee9?0x0:_0x3e95d2[_0xb53e('0x20')];var _0x189b52=_0x2cbee9?_0x4a2133[_0xb53e('0x23')]:_0x3e95d2['offset']+_0x3e95d2['limit'];var _0x433513;if(_0x189b52>=_0x222ebd){_0x189b52=_0x222ebd;_0x433513=0xc8;}else{_0x433513=0xce;}_0x1bac54[_0xb53e('0x1e')](_0x433513);return _0x1bac54[_0xb53e('0x24')](_0xb53e('0x25'),_0x80cc79+'-'+_0x189b52+'/'+_0x222ebd)[_0xb53e('0x26')](_0x4a2133);}return null;};}function patchUpdates(_0xdac758){return function(_0x268e07){try{jsonpatch[_0xb53e('0x27')](_0x268e07,_0xdac758,!![]);}catch(_0x12ce63){return BPromise[_0xb53e('0x28')](_0x12ce63);}return _0x268e07[_0xb53e('0x29')]();};}function saveUpdates(_0x289107,_0x5cfc31){return function(_0x3fd13e){if(_0x3fd13e){return _0x3fd13e[_0xb53e('0x2a')](_0x289107)[_0xb53e('0x2b')](function(_0x1d44e3){return _0x1d44e3;});}return null;};}function handleEntityNotFound(_0x735466,_0x4e6adb){return function(_0x437f10){if(!_0x437f10){_0x735466['sendStatus'](0x194);}return _0x437f10;};}function handleError(_0x42d22a,_0x354d3b){_0x354d3b=_0x354d3b||0x1f4;return function(_0x4dbfd5){logger['error'](_0x4dbfd5['stack']);if(_0x4dbfd5['name']){delete _0x4dbfd5[_0xb53e('0x2c')];}_0x42d22a['status'](_0x354d3b)[_0xb53e('0x2d')](_0x4dbfd5);};}exports[_0xb53e('0x2e')]=function(_0x39f8bb,_0x32cc0d){var _0x53418f={},_0x2dd900={},_0x4274d2={'count':0x0,'rows':[]};var _0x121020=_[_0xb53e('0x2f')](db[_0xb53e('0x30')][_0xb53e('0x31')],function(_0x5c0cc3){return{'name':_0x5c0cc3[_0xb53e('0x32')],'type':_0x5c0cc3['type'][_0xb53e('0x33')]};});_0x2dd900[_0xb53e('0x34')]=_[_0xb53e('0x2f')](_0x121020,_0xb53e('0x2c'));_0x2dd900[_0xb53e('0x35')]=_['keys'](_0x39f8bb[_0xb53e('0x35')]);_0x2dd900[_0xb53e('0x36')]=_[_0xb53e('0x37')](_0x2dd900[_0xb53e('0x34')],_0x2dd900['query']);_0x53418f[_0xb53e('0x38')]=_[_0xb53e('0x37')](_0x2dd900[_0xb53e('0x34')],qs[_0xb53e('0x39')](_0x39f8bb[_0xb53e('0x35')][_0xb53e('0x39')]));_0x53418f['attributes']=_0x53418f[_0xb53e('0x38')]['length']?_0x53418f['attributes']:_0x2dd900['model'];if(!_0x39f8bb[_0xb53e('0x35')][_0xb53e('0x3a')](_0xb53e('0x3b'))){_0x53418f[_0xb53e('0x22')]=qs[_0xb53e('0x22')](_0x39f8bb[_0xb53e('0x35')][_0xb53e('0x22')]);_0x53418f[_0xb53e('0x20')]=qs[_0xb53e('0x20')](_0x39f8bb['query'][_0xb53e('0x20')]);}_0x53418f['order']=qs['sort'](_0x39f8bb['query'][_0xb53e('0x3c')]);_0x53418f[_0xb53e('0x3d')]=qs[_0xb53e('0x36')](_[_0xb53e('0x3e')](_0x39f8bb[_0xb53e('0x35')],_0x2dd900['filters']),_0x121020);if(_0x39f8bb[_0xb53e('0x35')]['filter']){_0x53418f[_0xb53e('0x3d')]=_[_0xb53e('0x3f')](_0x53418f['where'],{'$or':_[_0xb53e('0x2f')](_0x121020,function(_0xf9d11d){if(_0xf9d11d[_0xb53e('0x40')]!==_0xb53e('0x41')){var _0x2ba3bc={};_0x2ba3bc[_0xf9d11d[_0xb53e('0x2c')]]={'$like':'%'+_0x39f8bb[_0xb53e('0x35')][_0xb53e('0x42')]+'%'};return _0x2ba3bc;}})});}_0x53418f=_['merge']({},_0x53418f,_0x39f8bb[_0xb53e('0x43')]);var _0x48358e={'where':_0x53418f[_0xb53e('0x3d')]};return db['Team'][_0xb53e('0x23')](_0x48358e)[_0xb53e('0x2b')](function(_0x279d56){_0x4274d2[_0xb53e('0x23')]=_0x279d56;if(_0x39f8bb[_0xb53e('0x35')][_0xb53e('0x44')]){_0x53418f[_0xb53e('0x45')]=[{'all':!![]}];}return db[_0xb53e('0x30')][_0xb53e('0x46')](_0x53418f);})[_0xb53e('0x2b')](function(_0x590e01){_0x4274d2[_0xb53e('0x47')]=_0x590e01;return _0x4274d2;})[_0xb53e('0x2b')](respondWithFilteredResult(_0x32cc0d,_0x53418f))[_0xb53e('0x48')](handleError(_0x32cc0d,null));};exports[_0xb53e('0x49')]=function(_0x130e0b,_0x50a74e){var _0x147e31={'raw':![],'where':{'id':_0x130e0b['params']['id']}},_0x2a98bf={};_0x2a98bf[_0xb53e('0x34')]=_[_0xb53e('0x4a')](db['Team'][_0xb53e('0x31')]);_0x2a98bf[_0xb53e('0x35')]=_['keys'](_0x130e0b[_0xb53e('0x35')]);_0x2a98bf[_0xb53e('0x36')]=_['intersection'](_0x2a98bf[_0xb53e('0x34')],_0x2a98bf['query']);_0x147e31[_0xb53e('0x38')]=_[_0xb53e('0x37')](_0x2a98bf[_0xb53e('0x34')],qs['fields'](_0x130e0b['query'][_0xb53e('0x39')]));_0x147e31[_0xb53e('0x38')]=_0x147e31['attributes']['length']?_0x147e31[_0xb53e('0x38')]:_0x2a98bf[_0xb53e('0x34')];if(_0x130e0b[_0xb53e('0x35')][_0xb53e('0x44')]){_0x147e31[_0xb53e('0x45')]=[{'all':!![]}];}_0x147e31=_['merge']({},_0x147e31,_0x130e0b[_0xb53e('0x43')]);return db['Team'][_0xb53e('0x4b')](_0x147e31)[_0xb53e('0x2b')](handleEntityNotFound(_0x50a74e,null))[_0xb53e('0x2b')](respondWithResult(_0x50a74e,null))[_0xb53e('0x48')](handleError(_0x50a74e,null));};exports['create']=function(_0x31c7a4,_0xdcfdb4){return db[_0xb53e('0x30')][_0xb53e('0x4c')](_0x31c7a4[_0xb53e('0x4d')],{})[_0xb53e('0x2b')](function(_0x4aeaa4){var _0x4b3bec=_0x31c7a4[_0xb53e('0x4e')][_0xb53e('0x4f')]({'plain':!![]});if(!_0x4b3bec)throw new Error(_0xb53e('0x50'));if(_0x4b3bec[_0xb53e('0x51')]===_0xb53e('0x4e')){var _0x53d0b8=_0x4aeaa4['get']({'plain':!![]});var _0x3c482e=_0xb53e('0x52');return db[_0xb53e('0x53')][_0xb53e('0x4b')]({'where':{'name':_0x3c482e,'userProfileId':_0x4b3bec['userProfileId']},'raw':!![]})['then'](function(_0x129e9c){if(_0x129e9c&&_0x129e9c[_0xb53e('0x54')]===0x0){return db[_0xb53e('0x55')][_0xb53e('0x4c')]({'name':_0x53d0b8[_0xb53e('0x2c')],'resourceId':_0x53d0b8['id'],'type':_0x129e9c[_0xb53e('0x2c')],'sectionId':_0x129e9c['id']},{})[_0xb53e('0x2b')](function(){return _0x4aeaa4;});}else{return _0x4aeaa4;}})['catch'](function(_0x5c6b2d){logger['error'](_0xb53e('0x56'),_0x5c6b2d);throw _0x5c6b2d;});}return _0x4aeaa4;})[_0xb53e('0x2b')](respondWithResult(_0xdcfdb4,0xc9))[_0xb53e('0x48')](handleError(_0xdcfdb4,null));};exports[_0xb53e('0x2a')]=function(_0x4e3dc8,_0x2ce960){if(_0x4e3dc8[_0xb53e('0x4d')]['id']){delete _0x4e3dc8[_0xb53e('0x4d')]['id'];}return db['Team'][_0xb53e('0x4b')]({'where':{'id':_0x4e3dc8[_0xb53e('0x57')]['id']}})[_0xb53e('0x2b')](handleEntityNotFound(_0x2ce960,null))['then'](saveUpdates(_0x4e3dc8['body'],null))[_0xb53e('0x2b')](respondWithResult(_0x2ce960,null))['catch'](handleError(_0x2ce960,null));};exports[_0xb53e('0x58')]=function(_0x19e77f,_0x3586e1){var _0x4be765=_0x19e77f[_0xb53e('0x57')]['id'];var _0xce438a=[];return db[_0xb53e('0x59')]['transaction'](function(_0x58d719){var _0xc659c0='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x4be765;return db[_0xb53e('0x59')][_0xb53e('0x35')](_0xc659c0,{'type':db[_0xb53e('0x5a')][_0xb53e('0x5b')][_0xb53e('0x5c')],'raw':!![],'transaction':_0x58d719})[_0xb53e('0x2b')](function(_0x4ba075){_0xce438a=_[_0xb53e('0x2f')](_0x4ba075,function(_0x262dd4){return Number(_0x262dd4['UserId']);});})['then'](function(){var _0x38c17b=_0xb53e('0x5d')+_0x4be765;return db[_0xb53e('0x59')]['query'](_0x38c17b,{'type':db[_0xb53e('0x5a')][_0xb53e('0x5b')]['SELECT'],'raw':!![],'transaction':_0x58d719});})[_0xb53e('0x2b')](function(_0xbff5c2){var _0x546cbc=_[_0xb53e('0x2f')](_0xbff5c2,function(_0x2cc87e){return Number(_0x2cc87e[_0xb53e('0x5e')]);});return db[_0xb53e('0x5f')][_0xb53e('0x58')]({'where':{'UserId':{'$in':_0xce438a},'VoiceQueueId':{'$in':_0x546cbc}},'transaction':_0x58d719});})[_0xb53e('0x2b')](function(){var _0x55a0f5=_0xb53e('0x60')+_0x4be765;return db[_0xb53e('0x59')][_0xb53e('0x35')](_0x55a0f5,{'type':db[_0xb53e('0x5a')][_0xb53e('0x5b')]['SELECT'],'raw':!![],'transaction':_0x58d719});})[_0xb53e('0x2b')](function(_0x14d30e){var _0x5a73bc=_[_0xb53e('0x2f')](_0x14d30e,function(_0x499201){return Number(_0x499201[_0xb53e('0x61')]);});return db['UserMailQueue'][_0xb53e('0x58')]({'where':{'UserId':{'$in':_0xce438a},'MailQueueId':{'$in':_0x5a73bc}},'transaction':_0x58d719});})[_0xb53e('0x2b')](function(){var _0x357c5c=_0xb53e('0x62')+_0x4be765;return db[_0xb53e('0x59')][_0xb53e('0x35')](_0x357c5c,{'type':db[_0xb53e('0x5a')]['QueryTypes'][_0xb53e('0x5c')],'raw':!![],'transaction':_0x58d719});})['then'](function(_0x5bb7da){var _0x184866=_['map'](_0x5bb7da,function(_0x57fdbc){return Number(_0x57fdbc[_0xb53e('0x63')]);});return db[_0xb53e('0x64')]['destroy']({'where':{'UserId':{'$in':_0xce438a},'SmsQueueId':{'$in':_0x184866}},'transaction':_0x58d719});})[_0xb53e('0x2b')](function(){var _0x1c6ec5='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4be765;return db[_0xb53e('0x59')][_0xb53e('0x35')](_0x1c6ec5,{'type':db[_0xb53e('0x5a')][_0xb53e('0x5b')]['SELECT'],'raw':!![],'transaction':_0x58d719});})['then'](function(_0x45d5c1){var _0x1b4b1a=_[_0xb53e('0x2f')](_0x45d5c1,function(_0x226066){return Number(_0x226066[_0xb53e('0x65')]);});return db[_0xb53e('0x66')][_0xb53e('0x58')]({'where':{'UserId':{'$in':_0xce438a},'ChatQueueId':{'$in':_0x1b4b1a}},'transaction':_0x58d719});})[_0xb53e('0x2b')](function(){var _0x351a67=_0xb53e('0x67')+_0x4be765;return db[_0xb53e('0x59')][_0xb53e('0x35')](_0x351a67,{'type':db[_0xb53e('0x5a')][_0xb53e('0x5b')][_0xb53e('0x5c')],'raw':!![],'transaction':_0x58d719});})[_0xb53e('0x2b')](function(_0x401995){var _0xb71b33=_[_0xb53e('0x2f')](_0x401995,function(_0x386b22){return Number(_0x386b22[_0xb53e('0x68')]);});return db[_0xb53e('0x69')][_0xb53e('0x58')]({'where':{'UserId':{'$in':_0xce438a},'FaxQueueId':{'$in':_0xb71b33}},'transaction':_0x58d719});})[_0xb53e('0x2b')](function(){var _0x1a5286=_0xb53e('0x6a')+_0x4be765;return db[_0xb53e('0x59')][_0xb53e('0x35')](_0x1a5286,{'type':db[_0xb53e('0x5a')][_0xb53e('0x5b')][_0xb53e('0x5c')],'raw':!![],'transaction':_0x58d719});})[_0xb53e('0x2b')](function(_0x9271d0){var _0x3ce913=_[_0xb53e('0x2f')](_0x9271d0,function(_0x3c7652){return Number(_0x3c7652[_0xb53e('0x6b')]);});return db[_0xb53e('0x6c')]['destroy']({'where':{'UserId':{'$in':_0xce438a},'OpenchannelQueueId':{'$in':_0x3ce913}},'transaction':_0x58d719});})['then'](function(){var _0x6f946c=_0xb53e('0x6d')+_0x4be765;return db[_0xb53e('0x59')][_0xb53e('0x35')](_0x6f946c,{'type':db[_0xb53e('0x5a')][_0xb53e('0x5b')][_0xb53e('0x5c')],'raw':!![],'transaction':_0x58d719});})[_0xb53e('0x2b')](function(_0x45a723){var _0x38a988=_[_0xb53e('0x2f')](_0x45a723,function(_0x4e19e0){return Number(_0x4e19e0['WhatsappQueueId']);});return db[_0xb53e('0x6e')][_0xb53e('0x58')]({'where':{'UserId':{'$in':_0xce438a},'WhatsappQueueId':{'$in':_0x38a988}},'transaction':_0x58d719});})[_0xb53e('0x2b')](function(){return db[_0xb53e('0x6f')]['find']({'where':{'TeamId':_0x4be765}});})[_0xb53e('0x2b')](function(_0x526ed3){if(_0x526ed3===null){return;}return db['UserVoicePrefix'][_0xb53e('0x58')]({'where':{'UserId':{'$in':_0xce438a},'VoicePrefixId':_0x526ed3[_0xb53e('0x70')]},'transaction':_0x58d719});})['then'](function(){return db[_0xb53e('0x30')][_0xb53e('0x58')]({'where':{'id':_0x4be765},'cascade':!![],'transaction':_0x58d719});})['then'](function(_0x3068ad){if(_0x3068ad===0x0){_0x3586e1[_0xb53e('0x1d')](0x194);}else{return db[_0xb53e('0x55')][_0xb53e('0x58')]({'where':{'type':'Teams','resourceId':_0x4be765},'cascade':!![],'transaction':_0x58d719})[_0xb53e('0x2b')](function(){_0x3586e1['status'](0xcc)[_0xb53e('0x1f')]();});}})[_0xb53e('0x48')](function(_0x14c602){_0x3586e1['status'](0x1f4)[_0xb53e('0x2d')](_0x14c602);});});};exports[_0xb53e('0x71')]=function(_0x8218ba,_0x39b2d8,_0x492c04){return db[_0xb53e('0x30')][_0xb53e('0x72')]({'where':{'id':_0x8218ba[_0xb53e('0x57')]['id']}})[_0xb53e('0x2b')](handleEntityNotFound(_0x39b2d8,null))[_0xb53e('0x2b')](function(_0x5e1b1c){if(!_0x8218ba['query'][_0xb53e('0x73')]||!utils[_0xb53e('0x74')](_0x8218ba[_0xb53e('0x35')]['channel'])){throw new db[(_0xb53e('0x5a'))]['ValidationError'](_0xb53e('0x75'));}var _0x445f7e={};var _0x3e12d7={};_0x3e12d7[_0xb53e('0x34')]=_[_0xb53e('0x4a')](db[_[_0xb53e('0x76')](_0x8218ba[_0xb53e('0x35')]['channel']['toLowerCase']())+_0xb53e('0x77')][_0xb53e('0x31')]);_0x3e12d7['query']=_[_0xb53e('0x4a')](_0x8218ba['query']);_0x3e12d7['filters']=_['intersection'](_0x3e12d7[_0xb53e('0x34')],_0x3e12d7['query']);_0x445f7e[_0xb53e('0x38')]=_[_0xb53e('0x37')](_0x3e12d7[_0xb53e('0x34')],qs[_0xb53e('0x39')](_0x8218ba['query'][_0xb53e('0x39')]));_0x445f7e['attributes']=_0x445f7e[_0xb53e('0x38')][_0xb53e('0x78')]?_0x445f7e['attributes']:_0x3e12d7[_0xb53e('0x34')];_0x445f7e[_0xb53e('0x22')]=qs[_0xb53e('0x22')](_0x8218ba[_0xb53e('0x35')]['limit']);_0x445f7e[_0xb53e('0x20')]=qs[_0xb53e('0x20')](_0x8218ba[_0xb53e('0x35')][_0xb53e('0x20')]);_0x445f7e['order']=qs[_0xb53e('0x3c')](_0x8218ba[_0xb53e('0x35')]['sort']);_0x445f7e[_0xb53e('0x3d')]=qs[_0xb53e('0x36')](_['pick'](_0x8218ba[_0xb53e('0x35')],_0x3e12d7[_0xb53e('0x36')]));_0x445f7e=_['merge']({},_0x445f7e,_0x8218ba[_0xb53e('0x43')]);return _0x5e1b1c[_0xb53e('0x4f')+_[_0xb53e('0x76')](_0x8218ba['query'][_0xb53e('0x73')]['toLowerCase']())+_0xb53e('0x79')](_0x445f7e);})[_0xb53e('0x2b')](respondWithResult(_0x39b2d8,null))[_0xb53e('0x48')](handleError(_0x39b2d8,null));};exports['addQueues']=function(_0x59d588,_0x407c77,_0x6babab){return db[_0xb53e('0x30')][_0xb53e('0x72')]({'where':{'id':_0x59d588[_0xb53e('0x57')]['id']}})[_0xb53e('0x2b')](function(_0x518518){if(_0x518518){if(!_0x59d588[_0xb53e('0x4d')][_0xb53e('0x73')]||!utils['isValidChannel'](_0x59d588[_0xb53e('0x4d')][_0xb53e('0x73')])){throw new db[(_0xb53e('0x5a'))][(_0xb53e('0x7a'))](_0xb53e('0x75'));}return _0x518518[_0xb53e('0x7b')+_[_0xb53e('0x76')](_0x59d588[_0xb53e('0x4d')]['channel'][_0xb53e('0x7c')]())+_0xb53e('0x79')](_0x59d588[_0xb53e('0x4d')][_0xb53e('0x7d')]);}return null;})[_0xb53e('0x2b')](handleEntityNotFound(_0x407c77,null))['then'](respondWithStatusCode(_0x407c77,null))[_0xb53e('0x48')](handleError(_0x407c77,null));};exports[_0xb53e('0x7e')]=function(_0x9ae84f,_0x14ea72,_0x153713){return db[_0xb53e('0x30')][_0xb53e('0x72')]({'where':{'id':_0x9ae84f['params']['id']}})[_0xb53e('0x2b')](function(_0xaa4e39){if(_0xaa4e39){if(!_0x9ae84f[_0xb53e('0x35')][_0xb53e('0x73')]||!utils[_0xb53e('0x74')](_0x9ae84f[_0xb53e('0x35')][_0xb53e('0x73')])){throw new db['Sequelize'][(_0xb53e('0x7a'))](_0xb53e('0x75'));}return _0xaa4e39[_0xb53e('0x7f')+_[_0xb53e('0x76')](_0x9ae84f[_0xb53e('0x35')]['channel'][_0xb53e('0x7c')]())+'Queues'](_0x9ae84f['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x14ea72,null))[_0xb53e('0x2b')](respondWithStatusCode(_0x14ea72,null))[_0xb53e('0x48')](handleError(_0x14ea72,null));};exports[_0xb53e('0x80')]=function(_0x28d6e1,_0x650c94){var _0x4990a2=_[_0xb53e('0x81')](_0x28d6e1[_0xb53e('0x4d')][_0xb53e('0x7d')])?_0x28d6e1['body'][_0xb53e('0x7d')]:[_0x28d6e1[_0xb53e('0x4d')][_0xb53e('0x7d')]];var _0x355b5a=_0x28d6e1['params']['id'];return db[_0xb53e('0x30')][_0xb53e('0x4b')]({'where':{'id':_0x355b5a}})[_0xb53e('0x2b')](handleEntityNotFound(_0x650c94,null))[_0xb53e('0x2b')](function(_0x2321ea){if(_0x2321ea){var _0x1162a3=[_0xb53e('0x82'),_0xb53e('0x83'),'Mail',_0xb53e('0x84'),_0xb53e('0x85'),_0xb53e('0x86'),_0xb53e('0x87')];return db[_0xb53e('0x59')][_0xb53e('0x88')](function(_0x3ebd1f){var _0x18bdd1=_[_0xb53e('0x2f')](_0x1162a3,function(_0x5958e4){var _0x39b604={'attributes':['id',_0xb53e('0x2c')]};if(_0x5958e4===_0xb53e('0x82')){_0x39b604['through']={'attributes':[_0xb53e('0x89')]};}return _0x2321ea[_0xb53e('0x4f')+_0x5958e4+_0xb53e('0x79')](_0x39b604)[_0xb53e('0x2b')](function(_0xa2ba9){var _0x50becb=_[_0xb53e('0x2f')](_0xa2ba9,function(_0x31e619){var _0xaf60d6=_[_0xb53e('0x2f')](_0x4990a2,function(_0x50a1c0){var _0x1bbc0e={'where':{'UserId':_0x50a1c0,[_0x5958e4+_0xb53e('0x8a')]:_0x31e619['id']},'transaction':_0x3ebd1f};if(_0x5958e4===_0xb53e('0x82')){_0x1bbc0e[_0xb53e('0x18')]={'penalty':_0x31e619[_0xb53e('0x8b')][_0xb53e('0x89')]};}return db[_0xb53e('0x8c')+_0x5958e4+_0xb53e('0x77')]['findOrCreate'](_0x1bbc0e)[_0xb53e('0x2b')](function(){socket['emit'](_0xb53e('0x4e')+_0x5958e4+_0xb53e('0x8d'),{'UserId':_0x50a1c0,[_0x5958e4+_0xb53e('0x8a')]:_0x31e619['id']});if(_0x5958e4!==_0xb53e('0x82')){return;}return db[_0xb53e('0x8c')][_0xb53e('0x46')]({'where':{'id':_0x4990a2,'online':0x1},'attributes':['id',_0xb53e('0x2c'),'online',_0xb53e('0x8e'),_0xb53e('0x8f')],'raw':!![]})[_0xb53e('0x2b')](function(_0x1c5617){var _0x49de7a=_[_0xb53e('0x2f')](_0x1c5617,function(_0x49e37f){return db['UserVoiceQueueRt'][_0xb53e('0x90')]({'membername':_0x49e37f[_0xb53e('0x2c')],'UserId':_0x49e37f['id'],'queue_name':_0x31e619[_0xb53e('0x2c')],'VoiceQueueId':_0x31e619['id'],'interface':_[_0xb53e('0x91')](_0x49e37f[_0xb53e('0x8f')])?util[_0xb53e('0x92')](_0xb53e('0x93'),_0x49e37f[_0xb53e('0x2c')]):_0x49e37f[_0xb53e('0x8f')],'paused':_0x49e37f['voicePause']||![],'penalty':_0x31e619[_0xb53e('0x8b')]['penalty']},{'transaction':_0x3ebd1f});});return Promise['all'](_0x49de7a);});});});return Promise[_0xb53e('0x94')](_0xaf60d6);});return Promise['all'](_0x50becb);})[_0xb53e('0x2b')](function(){return db[_0xb53e('0x6f')][_0xb53e('0x72')]({'where':{'teamId':_0x355b5a}})[_0xb53e('0x2b')](function(_0x300995){if(_0x300995){var _0x2b9c4d=_[_0xb53e('0x2f')](_0x4990a2,function(_0x529967){db[_0xb53e('0x95')][_0xb53e('0x90')]({'UserId':_0x529967,'VoicePrefixId':_0x300995[_0xb53e('0x70')]});});return Promise[_0xb53e('0x94')](_0x2b9c4d);}});});});return Promise[_0xb53e('0x94')](_0x18bdd1)[_0xb53e('0x2b')](function(){return _0x2321ea[_0xb53e('0x80')](_0x4990a2,{'transaction':_0x3ebd1f})[_0xb53e('0x96')](function(_0x4288e6){return _0x4288e6;});});});}})['then'](respondWithResult(_0x650c94,null))[_0xb53e('0x48')](handleError(_0x650c94,null));};exports[_0xb53e('0x97')]=function(_0x58c6db,_0x2525b0){var _0x36b4a7=_[_0xb53e('0x81')](_0x58c6db['query']['ids'])?_0x58c6db[_0xb53e('0x35')]['ids']:[_0x58c6db[_0xb53e('0x35')][_0xb53e('0x7d')]];var _0x22a5d4=_0x58c6db[_0xb53e('0x57')]['id'];return db[_0xb53e('0x30')][_0xb53e('0x4b')]({'where':{'id':_0x22a5d4}})[_0xb53e('0x2b')](handleEntityNotFound(_0x2525b0,null))[_0xb53e('0x2b')](function(_0x248f0d){if(_0x248f0d){var _0x8a6486=[_0xb53e('0x82'),_0xb53e('0x83'),_0xb53e('0x98'),_0xb53e('0x84'),_0xb53e('0x85'),'Openchannel',_0xb53e('0x87')];return db[_0xb53e('0x59')][_0xb53e('0x88')](function(_0x2e8c22){var _0x9e4330=_[_0xb53e('0x2f')](_0x8a6486,function(_0x15c836){var _0x3dff4f={'attributes':['id',_0xb53e('0x2c')]};return _0x248f0d[_0xb53e('0x4f')+_0x15c836+_0xb53e('0x79')](_0x3dff4f)['then'](function(_0x1bce37){var _0x44d7e1=_[_0xb53e('0x2f')](_0x1bce37,function(_0x4a689b){return _0x4a689b['removeAgents'](_0x36b4a7,{'transaction':_0x2e8c22})['then'](function(){var _0x504b88=_[_0xb53e('0x2f')](_0x36b4a7,function(_0x1c19ce){socket[_0xb53e('0x99')](_0xb53e('0x4e')+_0x15c836+_0xb53e('0x9a'),{'UserId':Number(_0x1c19ce),[_0x15c836+'QueueId']:_0x4a689b['id']});if(_0x15c836!==_0xb53e('0x82')){return;}return db['UserVoiceQueueRt'][_0xb53e('0x58')]({'where':{'VoiceQueueId':_0x4a689b['id'],'UserId':_0x1c19ce},'transaction':_0x2e8c22});});return Promise['all'](_0x504b88);});});return Promise[_0xb53e('0x94')](_0x44d7e1);});});return Promise[_0xb53e('0x94')](_0x9e4330)[_0xb53e('0x2b')](function(){return _0x248f0d['removeAgents'](_0x36b4a7,{'transaction':_0x2e8c22});})['then'](function(){return db[_0xb53e('0x6f')][_0xb53e('0x72')]({'where':{'teamId':_0x22a5d4}})[_0xb53e('0x2b')](function(_0x2b1e2a){if(_0x2b1e2a){var _0x918699=_[_0xb53e('0x2f')](_0x36b4a7,function(_0x29161b){db[_0xb53e('0x95')]['destroy']({'where':{'UserId':_0x29161b,'VoicePrefixId':_0x2b1e2a[_0xb53e('0x70')]}});});return Promise[_0xb53e('0x94')](_0x918699);}});});});}})['then'](respondWithStatusCode(_0x2525b0,null))[_0xb53e('0x48')](handleError(_0x2525b0,null));};exports[_0xb53e('0x9b')]=function(_0x3cc335,_0x201386,_0x4f9691){var _0x103bbf={};var _0x273cdf={};var _0x2285ed;var _0x304cbc;return db[_0xb53e('0x30')][_0xb53e('0x72')]({'where':{'id':_0x3cc335['params']['id']}})[_0xb53e('0x2b')](handleEntityNotFound(_0x201386,null))[_0xb53e('0x2b')](function(_0x48a3b1){if(_0x48a3b1){_0x2285ed=_0x48a3b1;_0x273cdf[_0xb53e('0x34')]=_[_0xb53e('0x4a')](db['User'][_0xb53e('0x31')]);_0x273cdf['query']=_['keys'](_0x3cc335[_0xb53e('0x35')]);_0x273cdf[_0xb53e('0x36')]=_[_0xb53e('0x37')](_0x273cdf[_0xb53e('0x34')],_0x273cdf[_0xb53e('0x35')]);_0x103bbf[_0xb53e('0x38')]=_[_0xb53e('0x37')](_0x273cdf[_0xb53e('0x34')],qs['fields'](_0x3cc335['query'][_0xb53e('0x39')]));_0x103bbf[_0xb53e('0x38')]=_0x103bbf[_0xb53e('0x38')]['length']?_0x103bbf['attributes']:_0x273cdf[_0xb53e('0x34')];_0x103bbf[_0xb53e('0x9c')]=qs[_0xb53e('0x3c')](_0x3cc335[_0xb53e('0x35')][_0xb53e('0x3c')]);_0x103bbf[_0xb53e('0x3d')]=qs[_0xb53e('0x36')](_[_0xb53e('0x3e')](_0x3cc335[_0xb53e('0x35')],_0x273cdf[_0xb53e('0x36')]));if(_0x3cc335[_0xb53e('0x35')][_0xb53e('0x42')]){_0x103bbf[_0xb53e('0x3d')]=_[_0xb53e('0x3f')](_0x103bbf[_0xb53e('0x3d')],{'$or':_[_0xb53e('0x2f')](_0x103bbf[_0xb53e('0x38')],function(_0x367846){var _0x5521ad={};_0x5521ad[_0x367846]={'$like':'%'+_0x3cc335[_0xb53e('0x35')][_0xb53e('0x42')]+'%'};return _0x5521ad;})});}_0x103bbf=_[_0xb53e('0x3f')]({},_0x103bbf,_0x3cc335[_0xb53e('0x43')]);return _0x2285ed[_0xb53e('0x9b')](_0x103bbf);}})[_0xb53e('0x2b')](function(_0x5df224){if(_0x5df224){_0x304cbc=_0x5df224[_0xb53e('0x78')];if(!_0x3cc335[_0xb53e('0x35')][_0xb53e('0x3a')](_0xb53e('0x3b'))){_0x103bbf[_0xb53e('0x22')]=qs[_0xb53e('0x22')](_0x3cc335['query']['limit']);_0x103bbf[_0xb53e('0x20')]=qs[_0xb53e('0x20')](_0x3cc335[_0xb53e('0x35')][_0xb53e('0x20')]);}return _0x2285ed['getAgents'](_0x103bbf);}})[_0xb53e('0x2b')](function(_0x2f8fda){if(_0x2f8fda){return _0x2f8fda?{'count':_0x304cbc,'rows':_0x2f8fda}:null;}})['then'](respondWithResult(_0x201386,null))[_0xb53e('0x48')](handleError(_0x201386,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a58b054..bf8521c 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 _0xf904=['hasOwnProperty','hook','setMaxListeners','save','remove','emit'];(function(_0x584513,_0x37c6c9){var _0xe4a14e=function(_0x4aadc0){while(--_0x4aadc0){_0x584513['push'](_0x584513['shift']());}};_0xe4a14e(++_0x37c6c9);}(_0xf904,0x164));var _0x4f90=function(_0x31b74c,_0x30f8cd){_0x31b74c=_0x31b74c-0x0;var _0x2b4f1c=_0xf904[_0x31b74c];return _0x2b4f1c;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x4f90('0x0')](0x0);var events={'afterCreate':_0x4f90('0x1'),'afterUpdate':'update','afterDestroy':_0x4f90('0x2')};function emitEvent(_0x5b2bcc){return function(_0x37ca61,_0x447163,_0x47d69a){TeamEvents[_0x4f90('0x3')](_0x5b2bcc+':'+_0x37ca61['id'],_0x37ca61);TeamEvents[_0x4f90('0x3')](_0x5b2bcc,_0x37ca61);_0x47d69a(null);};}for(var e in events){if(events[_0x4f90('0x4')](e)){var event=events[e];Team[_0x4f90('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xfc06=['events','../../mysqldb','Team','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x25ab93,_0x1fb8bc){var _0x32b80a=function(_0x53bfaf){while(--_0x53bfaf){_0x25ab93['push'](_0x25ab93['shift']());}};_0x32b80a(++_0x1fb8bc);}(_0xfc06,0x136));var _0x6fc0=function(_0x14f703,_0x28d228){_0x14f703=_0x14f703-0x0;var _0x51eb29=_0xfc06[_0x14f703];return _0x51eb29;};'use strict';var EventEmitter=require(_0x6fc0('0x0'));var Team=require(_0x6fc0('0x1'))['db'][_0x6fc0('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6fc0('0x3'),'afterUpdate':_0x6fc0('0x4'),'afterDestroy':_0x6fc0('0x5')};function emitEvent(_0x2d84e0){return function(_0x238326,_0xd835fd,_0x4e438c){TeamEvents[_0x6fc0('0x6')](_0x2d84e0+':'+_0x238326['id'],_0x238326);TeamEvents[_0x6fc0('0x6')](_0x2d84e0,_0x238326);_0x4e438c(null);};}for(var e in events){if(events[_0x6fc0('0x7')](e)){var event=events[e];Team[_0x6fc0('0x8')](e,emitEvent(event));}}module[_0x6fc0('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index d6cb741..b4686b2 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 _0x7efb=['setDataValue','channel','catch','exports','define','teams','Chat','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','./team.attributes','get','Queues','then','map'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x7efb,0x118));var _0xb7ef=function(_0x29a0b6,_0x5af744){_0x29a0b6=_0x29a0b6-0x0;var _0x32a427=_0x7efb[_0x29a0b6];return _0x32a427;};'use strict';var _=require('lodash');var attributes=require(_0xb7ef('0x0'));function getQueuesByChannel(_0x57f3eb,_0x1ffaa7){var _0x133f05=_0xb7ef('0x1')+_0x1ffaa7+_0xb7ef('0x2');return _0x57f3eb[_0x133f05]()[_0xb7ef('0x3')](function(_0x583354){return _[_0xb7ef('0x4')](_0x583354,function(_0x1d0011){_0x1d0011[_0xb7ef('0x5')](_0xb7ef('0x6'),_0x1ffaa7);return _0x1d0011;});})[_0xb7ef('0x7')](function(_0x57dda6){throw _0x57dda6;});}module[_0xb7ef('0x8')]=function(_0x431d2a){return _0x431d2a[_0xb7ef('0x9')]('Team',attributes,{'tableName':_0xb7ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3a7efa=this;var _0x4d688f=[_0xb7ef('0xb'),'Fax',_0xb7ef('0xc'),_0xb7ef('0xd'),_0xb7ef('0xe'),_0xb7ef('0xf'),_0xb7ef('0x10')];return Promise[_0xb7ef('0x11')]()[_0xb7ef('0x3')](function(){var _0x116f61=_[_0xb7ef('0x4')](_0x4d688f,function(_0x11bbbd){return getQueuesByChannel(_0x3a7efa,_0x11bbbd);});return Promise[_0xb7ef('0x12')](_0x116f61);})[_0xb7ef('0x7')](function(_0x22f884){throw _0x22f884;});}}});}; \ No newline at end of file +var _0x3dc7=['Queues','then','channel','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Whatsapp','resolve','map','all','lodash','./team.attributes'];(function(_0x11d5ab,_0x240a07){var _0x3c698c=function(_0x32ccef){while(--_0x32ccef){_0x11d5ab['push'](_0x11d5ab['shift']());}};_0x3c698c(++_0x240a07);}(_0x3dc7,0x174));var _0x73dc=function(_0x3c3d93,_0x461938){_0x3c3d93=_0x3c3d93-0x0;var _0x5a17c9=_0x3dc7[_0x3c3d93];return _0x5a17c9;};'use strict';var _=require(_0x73dc('0x0'));var attributes=require(_0x73dc('0x1'));function getQueuesByChannel(_0x43e6c1,_0x3d4d3a){var _0x55e5f9='get'+_0x3d4d3a+_0x73dc('0x2');return _0x43e6c1[_0x55e5f9]()[_0x73dc('0x3')](function(_0x3ef70c){return _['map'](_0x3ef70c,function(_0x3d6770){_0x3d6770['setDataValue'](_0x73dc('0x4'),_0x3d4d3a);return _0x3d6770;});})['catch'](function(_0x36eff5){throw _0x36eff5;});}module['exports']=function(_0x130a39){return _0x130a39[_0x73dc('0x5')](_0x73dc('0x6'),attributes,{'tableName':_0x73dc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5ed251=this;var _0x31d12e=[_0x73dc('0x8'),_0x73dc('0x9'),_0x73dc('0xa'),_0x73dc('0xb'),_0x73dc('0xc'),'Voice',_0x73dc('0xd')];return Promise[_0x73dc('0xe')]()[_0x73dc('0x3')](function(){var _0x4afac2=_[_0x73dc('0xf')](_0x31d12e,function(_0x4649a7){return getQueuesByChannel(_0x5ed251,_0x4649a7);});return Promise[_0x73dc('0x10')](_0x4afac2);})['catch'](function(_0x3eb103){throw _0x3eb103;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 1af65fd..cc726bf 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 _0xb81e=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x39c087,_0x12568b){var _0x14a8fd=function(_0x12adeb){while(--_0x12adeb){_0x39c087['push'](_0x39c087['shift']());}};_0x14a8fd(++_0x12568b);}(_0xb81e,0xc6));var _0xeb81=function(_0x2f820b,_0x1ff6be){_0x2f820b=_0x2f820b-0x0;var _0x2abb4c=_0xb81e[_0x2f820b];return _0x2abb4c;};'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(_0xeb81('0x0'));var db=require(_0xeb81('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb81('0x2'))(_0xeb81('0x3'));var config=require(_0xeb81('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xeb81('0x5')][_0xeb81('0x6')]({'port':0x232a});config[_0xeb81('0x7')]=_['defaults'](config[_0xeb81('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xeb81('0x8'))[_0xeb81('0x9')](socket);function respondWithRpcPromise(_0x59f8d5,_0x3414f2,_0x168d6d){return new BPromise(function(_0x1c197f,_0x490063){return client[_0xeb81('0xa')](_0x59f8d5,_0x168d6d)[_0xeb81('0xb')](function(_0x450e0a){logger[_0xeb81('0xc')](_0xeb81('0xd'),_0x3414f2,'request\x20sent');logger[_0xeb81('0xe')](_0xeb81('0xf'),_0x3414f2,_0xeb81('0x10'),JSON[_0xeb81('0x11')](_0x450e0a));if(_0x450e0a[_0xeb81('0x12')]){if(_0x450e0a[_0xeb81('0x12')][_0xeb81('0x13')]===0x1f4){logger[_0xeb81('0x12')](_0xeb81('0xd'),_0x3414f2,_0x450e0a[_0xeb81('0x12')][_0xeb81('0x14')]);return _0x490063(_0x450e0a['error'][_0xeb81('0x14')]);}logger[_0xeb81('0x12')](_0xeb81('0xd'),_0x3414f2,_0x450e0a['error'][_0xeb81('0x14')]);return _0x1c197f(_0x450e0a[_0xeb81('0x12')][_0xeb81('0x14')]);}else{logger[_0xeb81('0xc')](_0xeb81('0xd'),_0x3414f2,_0xeb81('0x10'));_0x1c197f(_0x450e0a[_0xeb81('0x15')][_0xeb81('0x14')]);}})['catch'](function(_0x664a97){logger[_0xeb81('0x12')](_0xeb81('0xd'),_0x3414f2,_0x664a97);_0x490063(_0x664a97);});});} \ No newline at end of file +var _0x4718=['stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./team.socket','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s'];(function(_0x1d7300,_0x17f109){var _0x46ee98=function(_0x5ee16a){while(--_0x5ee16a){_0x1d7300['push'](_0x1d7300['shift']());}};_0x46ee98(++_0x17f109);}(_0x4718,0x6d));var _0x8471=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0x4718[_0x60286b];return _0x5dff69;};'use strict';var _=require(_0x8471('0x0'));var util=require('util');var moment=require(_0x8471('0x1'));var BPromise=require(_0x8471('0x2'));var rs=require(_0x8471('0x3'));var fs=require('fs');var Redis=require(_0x8471('0x4'));var db=require(_0x8471('0x5'))['db'];var utils=require(_0x8471('0x6'));var logger=require(_0x8471('0x7'))(_0x8471('0x8'));var config=require(_0x8471('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8471('0xa')]({'port':0x232a});config[_0x8471('0xb')]=_[_0x8471('0xc')](config[_0x8471('0xb')],{'host':_0x8471('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8471('0xb')]));require(_0x8471('0xe'))['register'](socket);function respondWithRpcPromise(_0x143296,_0x4b9ac9,_0x5d5497){return new BPromise(function(_0x56e66a,_0xa22e99){return client[_0x8471('0xf')](_0x143296,_0x5d5497)['then'](function(_0x42408b){logger[_0x8471('0x10')](_0x8471('0x11'),_0x4b9ac9,_0x8471('0x12'));logger[_0x8471('0x13')](_0x8471('0x14'),_0x4b9ac9,_0x8471('0x12'),JSON[_0x8471('0x15')](_0x42408b));if(_0x42408b[_0x8471('0x16')]){if(_0x42408b[_0x8471('0x16')]['code']===0x1f4){logger['error'](_0x8471('0x11'),_0x4b9ac9,_0x42408b[_0x8471('0x16')][_0x8471('0x17')]);return _0xa22e99(_0x42408b[_0x8471('0x16')][_0x8471('0x17')]);}logger[_0x8471('0x16')](_0x8471('0x11'),_0x4b9ac9,_0x42408b[_0x8471('0x16')]['message']);return _0x56e66a(_0x42408b[_0x8471('0x16')][_0x8471('0x17')]);}else{logger['info'](_0x8471('0x11'),_0x4b9ac9,_0x8471('0x12'));_0x56e66a(_0x42408b[_0x8471('0x18')][_0x8471('0x17')]);}})[_0x8471('0x19')](function(_0x5bff37){logger[_0x8471('0x16')](_0x8471('0x11'),_0x4b9ac9,_0x5bff37);_0xa22e99(_0x5bff37);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index b90f305..f0cbcfd 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 _0x9173=['removeListener','register','length','team:','./team.events','save','update','emit'];(function(_0x839ba5,_0x1c4d54){var _0x5babda=function(_0x271a69){while(--_0x271a69){_0x839ba5['push'](_0x839ba5['shift']());}};_0x5babda(++_0x1c4d54);}(_0x9173,0xb4));var _0x3917=function(_0x3affb2,_0x4cf1b0){_0x3affb2=_0x3affb2-0x0;var _0x3a3685=_0x9173[_0x3affb2];return _0x3a3685;};'use strict';var TeamEvents=require(_0x3917('0x0'));var events=[_0x3917('0x1'),'remove',_0x3917('0x2')];function createListener(_0x30989e,_0x282f74){return function(_0x5df798){_0x282f74[_0x3917('0x3')](_0x30989e,_0x5df798);};}function removeListener(_0x5e0739,_0xb4eb06){return function(){TeamEvents[_0x3917('0x4')](_0x5e0739,_0xb4eb06);};}exports[_0x3917('0x5')]=function(_0x403e03){for(var _0x2dace9=0x0,_0x48d592=events[_0x3917('0x6')];_0x2dace9<_0x48d592;_0x2dace9++){var _0x27f513=events[_0x2dace9];var _0x11267b=createListener(_0x3917('0x7')+_0x27f513,_0x403e03);TeamEvents['on'](_0x27f513,_0x11267b);}}; \ No newline at end of file +var _0x3868=['save','remove','update','emit','register','length','team:'];(function(_0xd66229,_0x1f9154){var _0x4f84cc=function(_0x1d7589){while(--_0x1d7589){_0xd66229['push'](_0xd66229['shift']());}};_0x4f84cc(++_0x1f9154);}(_0x3868,0x118));var _0x8386=function(_0x278b87,_0x38b872){_0x278b87=_0x278b87-0x0;var _0x498f8b=_0x3868[_0x278b87];return _0x498f8b;};'use strict';var TeamEvents=require('./team.events');var events=[_0x8386('0x0'),_0x8386('0x1'),_0x8386('0x2')];function createListener(_0x838a8a,_0x4269d6){return function(_0x2f6286){_0x4269d6[_0x8386('0x3')](_0x838a8a,_0x2f6286);};}function removeListener(_0x59e6a2,_0xf3ae8d){return function(){TeamEvents['removeListener'](_0x59e6a2,_0xf3ae8d);};}exports[_0x8386('0x4')]=function(_0x909b22){for(var _0x33234a=0x0,_0x12cf18=events[_0x8386('0x5')];_0x33234a<_0x12cf18;_0x33234a++){var _0x3a5738=events[_0x33234a];var _0xabaf66=createListener(_0x8386('0x6')+_0x3a5738,_0x909b22);TeamEvents['on'](_0x3a5738,_0xabaf66);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index d069139..57381fa 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 _0x191a=['INTEGER','sequelize'];(function(_0x3de3ec,_0x36425d){var _0x3eb1da=function(_0x323da1){while(--_0x323da1){_0x3de3ec['push'](_0x3de3ec['shift']());}};_0x3eb1da(++_0x36425d);}(_0x191a,0xef));var _0xa191=function(_0x9f374c,_0x396804){_0x9f374c=_0x9f374c-0x0;var _0x53cfbb=_0x191a[_0x9f374c];return _0x53cfbb;};'use strict';var Sequelize=require(_0xa191('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xa191('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xa191('0x1')]}}; \ No newline at end of file +var _0x7117=['sequelize','exports','INTEGER'];(function(_0x579fe0,_0x42ecdb){var _0x5607eb=function(_0x4c60f8){while(--_0x4c60f8){_0x579fe0['push'](_0x579fe0['shift']());}};_0x5607eb(++_0x42ecdb);}(_0x7117,0x1ec));var _0x7711=function(_0x317d2f,_0x54583e){_0x317d2f=_0x317d2f-0x0;var _0x1f73f5=_0x7117[_0x317d2f];return _0x1f73f5;};'use strict';var Sequelize=require(_0x7711('0x0'));module[_0x7711('0x1')]={'TeamId':{'type':Sequelize[_0x7711('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7711('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 24d5390..aa4c985 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 _0x2182=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x3abe53,_0x6ecab6){var _0x40151f=function(_0x1f0eab){while(--_0x1f0eab){_0x3abe53['push'](_0x3abe53['shift']());}};_0x40151f(++_0x6ecab6);}(_0x2182,0xea));var _0x2218=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2182[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x2218('0x0'));var util=require(_0x2218('0x1'));var logger=require(_0x2218('0x2'))(_0x2218('0x3'));var moment=require('moment');var BPromise=require(_0x2218('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2218('0x5'));var rimraf=require(_0x2218('0x6'));var config=require(_0x2218('0x7'));var attributes=require(_0x2218('0x8'));module[_0x2218('0x9')]=function(_0x1e2df1,_0x199cb3){return _0x1e2df1[_0x2218('0xa')](_0x2218('0xb'),attributes,{'tableName':_0x2218('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2250=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','lodash'];(function(_0x4843cf,_0x480cb5){var _0x52ad78=function(_0xc6def3){while(--_0xc6def3){_0x4843cf['push'](_0x4843cf['shift']());}};_0x52ad78(++_0x480cb5);}(_0x2250,0x178));var _0x0225=function(_0x4f1749,_0x998e73){_0x4f1749=_0x4f1749-0x0;var _0x9a9ab3=_0x2250[_0x4f1749];return _0x9a9ab3;};'use strict';var _=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var logger=require(_0x0225('0x2'))(_0x0225('0x3'));var moment=require(_0x0225('0x4'));var BPromise=require(_0x0225('0x5'));var rp=require(_0x0225('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0225('0x7'));var config=require(_0x0225('0x8'));var attributes=require(_0x0225('0x9'));module[_0x0225('0xa')]=function(_0x3d3895,_0x3779fe){return _0x3d3895[_0x0225('0xb')](_0x0225('0xc'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index fc3d40f..79aa7d2 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1b377b,_0x4d5d82){var _0x22ca1b=function(_0x1520b1){while(--_0x1520b1){_0x1b377b['push'](_0x1b377b['shift']());}};_0x22ca1b(++_0x4d5d82);}(_0xe706,0xa3));var _0x6e70=function(_0x229764,_0x3687f1){_0x229764=_0x229764-0x0;var _0x143dea=_0xe706[_0x229764];return _0x143dea;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x50bb41,_0x4da1d6){var _0x512809=function(_0x5019f8){while(--_0x5019f8){_0x50bb41['push'](_0x50bb41['shift']());}};_0x512809(++_0x4da1d6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 2f42851..7db2d52 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 _0x1b8c=['sequelize','INTEGER'];(function(_0x1f4d0f,_0x596b2f){var _0x4e0a9e=function(_0x2a49f7){while(--_0x2a49f7){_0x1f4d0f['push'](_0x1f4d0f['shift']());}};_0x4e0a9e(++_0x596b2f);}(_0x1b8c,0x130));var _0xc1b8=function(_0x132de5,_0x1f766c){_0x132de5=_0x132de5-0x0;var _0xadbe5c=_0x1b8c[_0x132de5];return _0xadbe5c;};'use strict';var Sequelize=require(_0xc1b8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc1b8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd23c=['sequelize','exports','INTEGER'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd23c,0xdb));var _0xcd23=function(_0x5a9251,_0x5ea255){_0x5a9251=_0x5a9251-0x0;var _0x3abfcc=_0xd23c[_0x5a9251];return _0x3abfcc;};'use strict';var Sequelize=require(_0xcd23('0x0'));module[_0xcd23('0x1')]={'penalty':{'type':Sequelize[_0xcd23('0x2')],'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 b5c43ab..0d48cd3 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 _0x5a52=['team_has_voice_queues','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue'];(function(_0x2b684a,_0x889e94){var _0x29b872=function(_0x6ee02c){while(--_0x6ee02c){_0x2b684a['push'](_0x2b684a['shift']());}};_0x29b872(++_0x889e94);}(_0x5a52,0x18d));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x25a5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x25a5('0x1'));var BPromise=require(_0x25a5('0x2'));var rp=require(_0x25a5('0x3'));var fs=require('fs');var path=require(_0x25a5('0x4'));var rimraf=require(_0x25a5('0x5'));var config=require(_0x25a5('0x6'));var attributes=require(_0x25a5('0x7'));module[_0x25a5('0x8')]=function(_0x5db751,_0x2c210a){return _0x5db751['define'](_0x25a5('0x9'),attributes,{'tableName':_0x25a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4be6=['team_has_voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define'];(function(_0x5d050e,_0x21dbca){var _0x5e2976=function(_0x34d559){while(--_0x34d559){_0x5d050e['push'](_0x5d050e['shift']());}};_0x5e2976(++_0x21dbca);}(_0x4be6,0xb5));var _0x64be=function(_0x237a43,_0x54832e){_0x237a43=_0x237a43-0x0;var _0x311e1c=_0x4be6[_0x237a43];return _0x311e1c;};'use strict';var _=require('lodash');var util=require(_0x64be('0x0'));var logger=require(_0x64be('0x1'))(_0x64be('0x2'));var moment=require(_0x64be('0x3'));var BPromise=require(_0x64be('0x4'));var rp=require(_0x64be('0x5'));var fs=require('fs');var path=require(_0x64be('0x6'));var rimraf=require(_0x64be('0x7'));var config=require(_0x64be('0x8'));var attributes=require(_0x64be('0x9'));module['exports']=function(_0x131822,_0x2430e2){return _0x131822[_0x64be('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x64be('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 05de1ed..5a36bab 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 _0x238f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x7f1644,_0x268f86){var _0x5518b0=function(_0x977aba){while(--_0x977aba){_0x7f1644['push'](_0x7f1644['shift']());}};_0x5518b0(++_0x268f86);}(_0x238f,0xa5));var _0xf238=function(_0x795aed,_0xb01ab7){_0x795aed=_0x795aed-0x0;var _0x1f0d15=_0x238f[_0x795aed];return _0x1f0d15;};'use strict';var _=require(_0xf238('0x0'));var util=require(_0xf238('0x1'));var moment=require(_0xf238('0x2'));var BPromise=require('bluebird');var rs=require(_0xf238('0x3'));var fs=require('fs');var Redis=require(_0xf238('0x4'));var db=require(_0xf238('0x5'))['db'];var utils=require(_0xf238('0x6'));var logger=require(_0xf238('0x7'))(_0xf238('0x8'));var config=require('../../config/environment');var jayson=require(_0xf238('0x9'));var client=jayson[_0xf238('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x549a61,_0x355a13,_0x5432d0){return new BPromise(function(_0x430297,_0x2d59db){return client[_0xf238('0xb')](_0x549a61,_0x5432d0)[_0xf238('0xc')](function(_0x5a88c2){logger[_0xf238('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x355a13,_0xf238('0xe'));logger[_0xf238('0xf')](_0xf238('0x10'),_0x355a13,_0xf238('0xe'),JSON[_0xf238('0x11')](_0x5a88c2));if(_0x5a88c2[_0xf238('0x12')]){if(_0x5a88c2[_0xf238('0x12')][_0xf238('0x13')]===0x1f4){logger['error'](_0xf238('0x14'),_0x355a13,_0x5a88c2[_0xf238('0x12')][_0xf238('0x15')]);return _0x2d59db(_0x5a88c2['error'][_0xf238('0x15')]);}logger[_0xf238('0x12')](_0xf238('0x14'),_0x355a13,_0x5a88c2[_0xf238('0x12')][_0xf238('0x15')]);return _0x430297(_0x5a88c2['error'][_0xf238('0x15')]);}else{logger['info'](_0xf238('0x14'),_0x355a13,_0xf238('0xe'));_0x430297(_0x5a88c2[_0xf238('0x16')][_0xf238('0x15')]);}})[_0xf238('0x17')](function(_0xdcf24e){logger[_0xf238('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x355a13,_0xdcf24e);_0x2d59db(_0xdcf24e);});});} \ No newline at end of file +var _0x4ea3=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4ea3,0x70));var _0x34ea=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4ea3[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index f9484a6..e140749 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 _0x9851=['../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','show','post','create','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x420b71,_0x520a35){var _0x4c3a20=function(_0x3f9a22){while(--_0x3f9a22){_0x420b71['push'](_0x420b71['shift']());}};_0x4c3a20(++_0x520a35);}(_0x9851,0x1f1));var _0x1985=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9851[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1985('0x0'));var util=require('util');var path=require(_0x1985('0x1'));var timeout=require(_0x1985('0x2'));var express=require(_0x1985('0x3'));var router=express[_0x1985('0x4')]();var fs_extra=require(_0x1985('0x5'));var auth=require(_0x1985('0x6'));var interaction=require(_0x1985('0x7'));var config=require(_0x1985('0x8'));var controller=require(_0x1985('0x9'));router[_0x1985('0xa')]('/',auth['isAuthenticated'](),controller[_0x1985('0xb')]);router[_0x1985('0xa')](_0x1985('0xc'),auth['isAuthenticated'](),controller[_0x1985('0xd')]);router[_0x1985('0xe')]('/',auth['isAuthenticated'](),controller[_0x1985('0xf')]);router['put'](_0x1985('0xc'),auth[_0x1985('0x10')](),controller[_0x1985('0x11')]);router[_0x1985('0x12')](_0x1985('0xc'),auth[_0x1985('0x10')](),controller[_0x1985('0x13')]);module[_0x1985('0x14')]=router; \ No newline at end of file +var _0x9582=['/:id','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index'];(function(_0x164274,_0x478d54){var _0x3a31e9=function(_0x5daa76){while(--_0x5daa76){_0x164274['push'](_0x164274['shift']());}};_0x3a31e9(++_0x478d54);}(_0x9582,0x95));var _0x2958=function(_0x11023f,_0x387b9e){_0x11023f=_0x11023f-0x0;var _0x4a7b54=_0x9582[_0x11023f];return _0x4a7b54;};'use strict';var multer=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var path=require(_0x2958('0x2'));var timeout=require(_0x2958('0x3'));var express=require(_0x2958('0x4'));var router=express[_0x2958('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2958('0x6'));var interaction=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var controller=require(_0x2958('0x9'));router[_0x2958('0xa')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0xc')]);router[_0x2958('0xa')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller['show']);router['post']('/',auth[_0x2958('0xb')](),controller['create']);router[_0x2958('0xe')]('/:id',auth[_0x2958('0xb')](),controller['update']);router[_0x2958('0xf')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller[_0x2958('0x10')]);module[_0x2958('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 802c20b..3aa5910 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 _0x6cfe=['sequelize','STRING','TEXT'];(function(_0x2c41e6,_0x556d0e){var _0x15d99e=function(_0x5b01e7){while(--_0x5b01e7){_0x2c41e6['push'](_0x2c41e6['shift']());}};_0x15d99e(++_0x556d0e);}(_0x6cfe,0x144));var _0xe6cf=function(_0x152fae,_0x30c109){_0x152fae=_0x152fae-0x0;var _0x320f5e=_0x6cfe[_0x152fae];return _0x320f5e;};'use strict';var Sequelize=require(_0xe6cf('0x0'));module['exports']={'name':{'type':Sequelize[_0xe6cf('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xe6cf('0x2')]}}; \ No newline at end of file +var _0xd548=['exports','STRING','TEXT','sequelize'];(function(_0x2ccab9,_0x566445){var _0x58ee1f=function(_0x10cba3){while(--_0x10cba3){_0x2ccab9['push'](_0x2ccab9['shift']());}};_0x58ee1f(++_0x566445);}(_0xd548,0xdb));var _0x8d54=function(_0x4e1d35,_0x45157e){_0x4e1d35=_0x4e1d35-0x0;var _0x59aca6=_0xd548[_0x4e1d35];return _0x59aca6;};'use strict';var Sequelize=require(_0x8d54('0x0'));module[_0x8d54('0x1')]={'name':{'type':Sequelize[_0x8d54('0x2')]},'description':{'type':Sequelize[_0x8d54('0x2')]},'html':{'type':Sequelize[_0x8d54('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 2f1f769..0a4497b 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 _0x114a=['Content-Range','apply','reject','save','then','destroy','get','sendStatus','stack','name','index','Template','rawAttributes','fieldName','type','key','map','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','status','set'];(function(_0x61ec9a,_0x4dc173){var _0x17a1c7=function(_0x3d32a9){while(--_0x3d32a9){_0x61ec9a['push'](_0x61ec9a['shift']());}};_0x17a1c7(++_0x4dc173);}(_0x114a,0x195));var _0xa114=function(_0x305d65,_0x56e367){_0x305d65=_0x305d65-0x0;var _0x37f8cc=_0x114a[_0x305d65];return _0x37f8cc;};'use strict';var emlformat=require(_0xa114('0x0'));var rimraf=require(_0xa114('0x1'));var zipdir=require(_0xa114('0x2'));var jsonpatch=require(_0xa114('0x3'));var rp=require(_0xa114('0x4'));var moment=require(_0xa114('0x5'));var BPromise=require(_0xa114('0x6'));var Mustache=require(_0xa114('0x7'));var util=require('util');var path=require(_0xa114('0x8'));var sox=require('sox');var csv=require(_0xa114('0x9'));var ejs=require(_0xa114('0xa'));var fs=require('fs');var fs_extra=require(_0xa114('0xb'));var _=require(_0xa114('0xc'));var squel=require(_0xa114('0xd'));var crypto=require(_0xa114('0xe'));var jsforce=require(_0xa114('0xf'));var deskjs=require(_0xa114('0x10'));var toCsv=require(_0xa114('0x9'));var querystring=require('querystring');var Papa=require(_0xa114('0x11'));var Redis=require(_0xa114('0x12'));var authService=require(_0xa114('0x13'));var qs=require(_0xa114('0x14'));var as=require(_0xa114('0x15'));var hardwareService=require(_0xa114('0x16'));var logger=require(_0xa114('0x17'))('api');var utils=require(_0xa114('0x18'));var config=require(_0xa114('0x19'));var licenseUtil=require(_0xa114('0x1a'));var db=require(_0xa114('0x1b'))['db'];function respondWithStatusCode(_0x59dd2c,_0x2260d7){_0x2260d7=_0x2260d7||0xcc;return function(_0x4d50eb){if(_0x4d50eb){return _0x59dd2c['sendStatus'](_0x2260d7);}return _0x59dd2c['status'](_0x2260d7)[_0xa114('0x1c')]();};}function respondWithResult(_0x4ddb66,_0x21c6dd){_0x21c6dd=_0x21c6dd||0xc8;return function(_0x2a26b3){if(_0x2a26b3){return _0x4ddb66['status'](_0x21c6dd)[_0xa114('0x1d')](_0x2a26b3);}};}function respondWithFilteredResult(_0x16055b,_0x3033bc){return function(_0x3e1274){if(_0x3e1274){var _0x13b211=typeof _0x3033bc[_0xa114('0x1e')]===_0xa114('0x1f')&&typeof _0x3033bc['limit']==='undefined';var _0x5d11ef=_0x3e1274[_0xa114('0x20')];var _0x14f8ee=_0x13b211?0x0:_0x3033bc[_0xa114('0x1e')];var _0x47c03c=_0x13b211?_0x3e1274[_0xa114('0x20')]:_0x3033bc[_0xa114('0x1e')]+_0x3033bc['limit'];var _0x193c86;if(_0x47c03c>=_0x5d11ef){_0x47c03c=_0x5d11ef;_0x193c86=0xc8;}else{_0x193c86=0xce;}_0x16055b[_0xa114('0x21')](_0x193c86);return _0x16055b[_0xa114('0x22')](_0xa114('0x23'),_0x14f8ee+'-'+_0x47c03c+'/'+_0x5d11ef)[_0xa114('0x1d')](_0x3e1274);}return null;};}function patchUpdates(_0x36d0b9){return function(_0x4d68aa){try{jsonpatch[_0xa114('0x24')](_0x4d68aa,_0x36d0b9,!![]);}catch(_0x3d31bd){return BPromise[_0xa114('0x25')](_0x3d31bd);}return _0x4d68aa[_0xa114('0x26')]();};}function saveUpdates(_0x4ab73b,_0x3db86b){return function(_0x28ef37){if(_0x28ef37){return _0x28ef37['update'](_0x4ab73b)[_0xa114('0x27')](function(_0x3ec6e5){return _0x3ec6e5;});}return null;};}function removeEntity(_0x1dd721,_0x598c25){return function(_0x59a0b9){if(_0x59a0b9){return _0x59a0b9[_0xa114('0x28')]()[_0xa114('0x27')](function(){var _0x5130f1=_0x59a0b9[_0xa114('0x29')]({'plain':!![]});var _0x14a64e='Templates';return db['UserProfileResource'][_0xa114('0x28')]({'where':{'type':_0x14a64e,'resourceId':_0x5130f1['id']}})[_0xa114('0x27')](function(){return _0x59a0b9;});})['then'](function(){_0x1dd721[_0xa114('0x21')](0xcc)[_0xa114('0x1c')]();});}};}function handleEntityNotFound(_0x37c7be,_0x1e776b){return function(_0x33390f){if(!_0x33390f){_0x37c7be[_0xa114('0x2a')](0x194);}return _0x33390f;};}function handleError(_0x559a41,_0x211f22){_0x211f22=_0x211f22||0x1f4;return function(_0x8286a3){logger['error'](_0x8286a3[_0xa114('0x2b')]);if(_0x8286a3['name']){delete _0x8286a3[_0xa114('0x2c')];}_0x559a41[_0xa114('0x21')](_0x211f22)['send'](_0x8286a3);};}exports[_0xa114('0x2d')]=function(_0x1ab1ca,_0x15b0bb){var _0x1e4588={},_0x150ac1={},_0x36ecea={'count':0x0,'rows':[]};var _0x5249be=_['map'](db[_0xa114('0x2e')][_0xa114('0x2f')],function(_0xf09e3c){return{'name':_0xf09e3c[_0xa114('0x30')],'type':_0xf09e3c[_0xa114('0x31')][_0xa114('0x32')]};});_0x150ac1['model']=_[_0xa114('0x33')](_0x5249be,_0xa114('0x2c'));_0x150ac1['query']=_[_0xa114('0x34')](_0x1ab1ca[_0xa114('0x35')]);_0x150ac1[_0xa114('0x36')]=_['intersection'](_0x150ac1[_0xa114('0x37')],_0x150ac1['query']);_0x1e4588[_0xa114('0x38')]=_[_0xa114('0x39')](_0x150ac1[_0xa114('0x37')],qs[_0xa114('0x3a')](_0x1ab1ca['query'][_0xa114('0x3a')]));_0x1e4588[_0xa114('0x38')]=_0x1e4588[_0xa114('0x38')][_0xa114('0x3b')]?_0x1e4588[_0xa114('0x38')]:_0x150ac1[_0xa114('0x37')];if(!_0x1ab1ca[_0xa114('0x35')][_0xa114('0x3c')](_0xa114('0x3d'))){_0x1e4588[_0xa114('0x3e')]=qs[_0xa114('0x3e')](_0x1ab1ca[_0xa114('0x35')][_0xa114('0x3e')]);_0x1e4588[_0xa114('0x1e')]=qs[_0xa114('0x1e')](_0x1ab1ca[_0xa114('0x35')]['offset']);}_0x1e4588[_0xa114('0x3f')]=qs[_0xa114('0x40')](_0x1ab1ca['query'][_0xa114('0x40')]);_0x1e4588['where']=qs['filters'](_[_0xa114('0x41')](_0x1ab1ca['query'],_0x150ac1[_0xa114('0x36')]),_0x5249be);if(_0x1ab1ca[_0xa114('0x35')][_0xa114('0x42')]){_0x1e4588[_0xa114('0x43')]=_[_0xa114('0x44')](_0x1e4588[_0xa114('0x43')],{'$or':_[_0xa114('0x33')](_0x5249be,function(_0x24b080){if(_0x24b080[_0xa114('0x31')]!==_0xa114('0x45')){var _0x5ebf3c={};_0x5ebf3c[_0x24b080['name']]={'$like':'%'+_0x1ab1ca[_0xa114('0x35')]['filter']+'%'};return _0x5ebf3c;}})});}_0x1e4588=_[_0xa114('0x44')]({},_0x1e4588,_0x1ab1ca['options']);var _0xcfe67f={'where':_0x1e4588['where']};return db[_0xa114('0x2e')][_0xa114('0x20')](_0xcfe67f)[_0xa114('0x27')](function(_0x42d829){_0x36ecea[_0xa114('0x20')]=_0x42d829;if(_0x1ab1ca[_0xa114('0x35')][_0xa114('0x46')]){_0x1e4588[_0xa114('0x47')]=[{'all':!![]}];}return db[_0xa114('0x2e')][_0xa114('0x48')](_0x1e4588);})[_0xa114('0x27')](function(_0x5d9a81){_0x36ecea[_0xa114('0x49')]=_0x5d9a81;return _0x36ecea;})[_0xa114('0x27')](respondWithFilteredResult(_0x15b0bb,_0x1e4588))['catch'](handleError(_0x15b0bb,null));};exports['show']=function(_0x191be1,_0x2f8b21){var _0x624443={'raw':!![],'where':{'id':_0x191be1['params']['id']}},_0x22cf2c={};_0x22cf2c[_0xa114('0x37')]=_[_0xa114('0x34')](db[_0xa114('0x2e')]['rawAttributes']);_0x22cf2c[_0xa114('0x35')]=_[_0xa114('0x34')](_0x191be1[_0xa114('0x35')]);_0x22cf2c[_0xa114('0x36')]=_[_0xa114('0x39')](_0x22cf2c[_0xa114('0x37')],_0x22cf2c[_0xa114('0x35')]);_0x624443[_0xa114('0x38')]=_[_0xa114('0x39')](_0x22cf2c[_0xa114('0x37')],qs[_0xa114('0x3a')](_0x191be1[_0xa114('0x35')][_0xa114('0x3a')]));_0x624443[_0xa114('0x38')]=_0x624443['attributes'][_0xa114('0x3b')]?_0x624443[_0xa114('0x38')]:_0x22cf2c[_0xa114('0x37')];if(_0x191be1[_0xa114('0x35')][_0xa114('0x46')]){_0x624443['include']=[{'all':!![]}];}_0x624443=_[_0xa114('0x44')]({},_0x624443,_0x191be1['options']);return db['Template'][_0xa114('0x4a')](_0x624443)[_0xa114('0x27')](handleEntityNotFound(_0x2f8b21,null))[_0xa114('0x27')](respondWithResult(_0x2f8b21,null))[_0xa114('0x4b')](handleError(_0x2f8b21,null));};exports['create']=function(_0x2a2f1c,_0x443b81){return db['Template'][_0xa114('0x4c')](_0x2a2f1c[_0xa114('0x4d')],{})[_0xa114('0x27')](function(_0x9d2eb5){var _0x3b863f=_0x2a2f1c[_0xa114('0x4e')][_0xa114('0x29')]({'plain':!![]});if(!_0x3b863f)throw new Error(_0xa114('0x4f'));if(_0x3b863f[_0xa114('0x50')]===_0xa114('0x4e')){var _0x108934=_0x9d2eb5['get']({'plain':!![]});var _0x3aadf5=_0xa114('0x51');return db['UserProfileSection'][_0xa114('0x4a')]({'where':{'name':_0x3aadf5,'userProfileId':_0x3b863f['userProfileId']},'raw':!![]})[_0xa114('0x27')](function(_0x230d6b){if(_0x230d6b&&_0x230d6b[_0xa114('0x52')]===0x0){return db[_0xa114('0x53')][_0xa114('0x4c')]({'name':_0x108934[_0xa114('0x2c')],'resourceId':_0x108934['id'],'type':_0x230d6b['name'],'sectionId':_0x230d6b['id']},{})[_0xa114('0x27')](function(){return _0x9d2eb5;});}else{return _0x9d2eb5;}})['catch'](function(_0x407ff3){logger[_0xa114('0x54')](_0xa114('0x55'),_0x407ff3);throw _0x407ff3;});}return _0x9d2eb5;})['then'](respondWithResult(_0x443b81,0xc9))[_0xa114('0x4b')](handleError(_0x443b81,null));};exports[_0xa114('0x56')]=function(_0x20f481,_0x2b9f0a){if(_0x20f481[_0xa114('0x4d')]['id']){delete _0x20f481[_0xa114('0x4d')]['id'];}return db['Template'][_0xa114('0x4a')]({'where':{'id':_0x20f481[_0xa114('0x57')]['id']}})[_0xa114('0x27')](handleEntityNotFound(_0x2b9f0a,null))[_0xa114('0x27')](saveUpdates(_0x20f481[_0xa114('0x4d')],null))[_0xa114('0x27')](respondWithResult(_0x2b9f0a,null))[_0xa114('0x4b')](handleError(_0x2b9f0a,null));};exports[_0xa114('0x28')]=function(_0x4d4021,_0x2f298a){return db[_0xa114('0x2e')][_0xa114('0x4a')]({'where':{'id':_0x4d4021[_0xa114('0x57')]['id']}})[_0xa114('0x27')](handleEntityNotFound(_0x2f298a,null))[_0xa114('0x27')](removeEntity(_0x2f298a,null))['catch'](handleError(_0x2f298a,null));}; \ No newline at end of file +var _0x8fc2=['rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','reject','update','then','destroy','get','Templates','end','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','Template','includeAll','findAll','catch','params','length','include','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8fc2,0xa4));var _0x28fc=function(_0xca8b27,_0x3d49bd){_0xca8b27=_0xca8b27-0x0;var _0x4e668d=_0x8fc2[_0xca8b27];return _0x4e668d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28fc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28fc('0x1'));var rp=require('request-promise');var moment=require(_0x28fc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x28fc('0x3'));var util=require(_0x28fc('0x4'));var path=require(_0x28fc('0x5'));var sox=require(_0x28fc('0x6'));var csv=require(_0x28fc('0x7'));var ejs=require(_0x28fc('0x8'));var fs=require('fs');var fs_extra=require(_0x28fc('0x9'));var _=require(_0x28fc('0xa'));var squel=require(_0x28fc('0xb'));var crypto=require('crypto');var jsforce=require(_0x28fc('0xc'));var deskjs=require(_0x28fc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x28fc('0xe'));var Papa=require('papaparse');var Redis=require(_0x28fc('0xf'));var authService=require(_0x28fc('0x10'));var qs=require(_0x28fc('0x11'));var as=require(_0x28fc('0x12'));var hardwareService=require(_0x28fc('0x13'));var logger=require(_0x28fc('0x14'))(_0x28fc('0x15'));var utils=require(_0x28fc('0x16'));var config=require(_0x28fc('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2112a9,_0x503cf8){_0x503cf8=_0x503cf8||0xcc;return function(_0x45e93f){if(_0x45e93f){return _0x2112a9[_0x28fc('0x18')](_0x503cf8);}return _0x2112a9['status'](_0x503cf8)['end']();};}function respondWithResult(_0x2e0461,_0x1471ce){_0x1471ce=_0x1471ce||0xc8;return function(_0x425583){if(_0x425583){return _0x2e0461[_0x28fc('0x19')](_0x1471ce)[_0x28fc('0x1a')](_0x425583);}};}function respondWithFilteredResult(_0x293df6,_0x22d229){return function(_0x2cae22){if(_0x2cae22){var _0x2d6d1e=typeof _0x22d229['offset']===_0x28fc('0x1b')&&typeof _0x22d229[_0x28fc('0x1c')]===_0x28fc('0x1b');var _0x384915=_0x2cae22[_0x28fc('0x1d')];var _0x5c2140=_0x2d6d1e?0x0:_0x22d229[_0x28fc('0x1e')];var _0x142a98=_0x2d6d1e?_0x2cae22[_0x28fc('0x1d')]:_0x22d229[_0x28fc('0x1e')]+_0x22d229[_0x28fc('0x1c')];var _0x3b1feb;if(_0x142a98>=_0x384915){_0x142a98=_0x384915;_0x3b1feb=0xc8;}else{_0x3b1feb=0xce;}_0x293df6[_0x28fc('0x19')](_0x3b1feb);return _0x293df6['set']('Content-Range',_0x5c2140+'-'+_0x142a98+'/'+_0x384915)['json'](_0x2cae22);}return null;};}function patchUpdates(_0x18b50f){return function(_0xa94a31){try{jsonpatch['apply'](_0xa94a31,_0x18b50f,!![]);}catch(_0x366116){return BPromise[_0x28fc('0x1f')](_0x366116);}return _0xa94a31['save']();};}function saveUpdates(_0x2573c5,_0x7e22d3){return function(_0x35e82b){if(_0x35e82b){return _0x35e82b[_0x28fc('0x20')](_0x2573c5)[_0x28fc('0x21')](function(_0x1666e9){return _0x1666e9;});}return null;};}function removeEntity(_0x6872bd,_0x111d3a){return function(_0x16710a){if(_0x16710a){return _0x16710a[_0x28fc('0x22')]()[_0x28fc('0x21')](function(){var _0x56b1ab=_0x16710a[_0x28fc('0x23')]({'plain':!![]});var _0x10b17a=_0x28fc('0x24');return db['UserProfileResource'][_0x28fc('0x22')]({'where':{'type':_0x10b17a,'resourceId':_0x56b1ab['id']}})[_0x28fc('0x21')](function(){return _0x16710a;});})[_0x28fc('0x21')](function(){_0x6872bd[_0x28fc('0x19')](0xcc)[_0x28fc('0x25')]();});}};}function handleEntityNotFound(_0x42852a,_0x30cc93){return function(_0x53dee2){if(!_0x53dee2){_0x42852a[_0x28fc('0x18')](0x194);}return _0x53dee2;};}function handleError(_0x42c7eb,_0x4dd678){_0x4dd678=_0x4dd678||0x1f4;return function(_0x594166){logger['error'](_0x594166[_0x28fc('0x26')]);if(_0x594166[_0x28fc('0x27')]){delete _0x594166['name'];}_0x42c7eb['status'](_0x4dd678)[_0x28fc('0x28')](_0x594166);};}exports[_0x28fc('0x29')]=function(_0x344cbc,_0x24ac4d){var _0xbcdb79={},_0x37260d={},_0x5a5cc8={'count':0x0,'rows':[]};var _0x57f188=_[_0x28fc('0x2a')](db['Template']['rawAttributes'],function(_0xfe8f81){return{'name':_0xfe8f81[_0x28fc('0x2b')],'type':_0xfe8f81[_0x28fc('0x2c')][_0x28fc('0x2d')]};});_0x37260d[_0x28fc('0x2e')]=_[_0x28fc('0x2a')](_0x57f188,_0x28fc('0x27'));_0x37260d[_0x28fc('0x2f')]=_[_0x28fc('0x30')](_0x344cbc[_0x28fc('0x2f')]);_0x37260d[_0x28fc('0x31')]=_['intersection'](_0x37260d[_0x28fc('0x2e')],_0x37260d[_0x28fc('0x2f')]);_0xbcdb79[_0x28fc('0x32')]=_[_0x28fc('0x33')](_0x37260d['model'],qs['fields'](_0x344cbc[_0x28fc('0x2f')][_0x28fc('0x34')]));_0xbcdb79[_0x28fc('0x32')]=_0xbcdb79[_0x28fc('0x32')]['length']?_0xbcdb79[_0x28fc('0x32')]:_0x37260d[_0x28fc('0x2e')];if(!_0x344cbc['query'][_0x28fc('0x35')](_0x28fc('0x36'))){_0xbcdb79[_0x28fc('0x1c')]=qs[_0x28fc('0x1c')](_0x344cbc['query'][_0x28fc('0x1c')]);_0xbcdb79[_0x28fc('0x1e')]=qs[_0x28fc('0x1e')](_0x344cbc['query'][_0x28fc('0x1e')]);}_0xbcdb79[_0x28fc('0x37')]=qs[_0x28fc('0x38')](_0x344cbc[_0x28fc('0x2f')][_0x28fc('0x38')]);_0xbcdb79[_0x28fc('0x39')]=qs[_0x28fc('0x31')](_[_0x28fc('0x3a')](_0x344cbc[_0x28fc('0x2f')],_0x37260d[_0x28fc('0x31')]),_0x57f188);if(_0x344cbc[_0x28fc('0x2f')]['filter']){_0xbcdb79[_0x28fc('0x39')]=_['merge'](_0xbcdb79['where'],{'$or':_[_0x28fc('0x2a')](_0x57f188,function(_0x4ea0ab){if(_0x4ea0ab['type']!==_0x28fc('0x3b')){var _0x1b1d51={};_0x1b1d51[_0x4ea0ab[_0x28fc('0x27')]]={'$like':'%'+_0x344cbc[_0x28fc('0x2f')][_0x28fc('0x3c')]+'%'};return _0x1b1d51;}})});}_0xbcdb79=_['merge']({},_0xbcdb79,_0x344cbc[_0x28fc('0x3d')]);var _0x40c4bd={'where':_0xbcdb79['where']};return db[_0x28fc('0x3e')][_0x28fc('0x1d')](_0x40c4bd)['then'](function(_0x342beb){_0x5a5cc8[_0x28fc('0x1d')]=_0x342beb;if(_0x344cbc[_0x28fc('0x2f')][_0x28fc('0x3f')]){_0xbcdb79['include']=[{'all':!![]}];}return db[_0x28fc('0x3e')][_0x28fc('0x40')](_0xbcdb79);})[_0x28fc('0x21')](function(_0x5cf471){_0x5a5cc8['rows']=_0x5cf471;return _0x5a5cc8;})[_0x28fc('0x21')](respondWithFilteredResult(_0x24ac4d,_0xbcdb79))[_0x28fc('0x41')](handleError(_0x24ac4d,null));};exports['show']=function(_0x328b0b,_0x449d41){var _0x3bb85a={'raw':!![],'where':{'id':_0x328b0b[_0x28fc('0x42')]['id']}},_0x1cb52a={};_0x1cb52a[_0x28fc('0x2e')]=_[_0x28fc('0x30')](db[_0x28fc('0x3e')]['rawAttributes']);_0x1cb52a['query']=_[_0x28fc('0x30')](_0x328b0b[_0x28fc('0x2f')]);_0x1cb52a[_0x28fc('0x31')]=_[_0x28fc('0x33')](_0x1cb52a[_0x28fc('0x2e')],_0x1cb52a[_0x28fc('0x2f')]);_0x3bb85a[_0x28fc('0x32')]=_[_0x28fc('0x33')](_0x1cb52a['model'],qs[_0x28fc('0x34')](_0x328b0b[_0x28fc('0x2f')][_0x28fc('0x34')]));_0x3bb85a['attributes']=_0x3bb85a['attributes'][_0x28fc('0x43')]?_0x3bb85a[_0x28fc('0x32')]:_0x1cb52a[_0x28fc('0x2e')];if(_0x328b0b['query'][_0x28fc('0x3f')]){_0x3bb85a[_0x28fc('0x44')]=[{'all':!![]}];}_0x3bb85a=_[_0x28fc('0x45')]({},_0x3bb85a,_0x328b0b[_0x28fc('0x3d')]);return db[_0x28fc('0x3e')]['find'](_0x3bb85a)['then'](handleEntityNotFound(_0x449d41,null))[_0x28fc('0x21')](respondWithResult(_0x449d41,null))[_0x28fc('0x41')](handleError(_0x449d41,null));};exports[_0x28fc('0x46')]=function(_0x4846bc,_0x5bbbdb){return db[_0x28fc('0x3e')][_0x28fc('0x46')](_0x4846bc[_0x28fc('0x47')],{})['then'](function(_0x136440){var _0x164336=_0x4846bc[_0x28fc('0x48')][_0x28fc('0x23')]({'plain':!![]});if(!_0x164336)throw new Error(_0x28fc('0x49'));if(_0x164336[_0x28fc('0x4a')]===_0x28fc('0x48')){var _0x47fe30=_0x136440[_0x28fc('0x23')]({'plain':!![]});var _0x5b15d4=_0x28fc('0x24');return db[_0x28fc('0x4b')]['find']({'where':{'name':_0x5b15d4,'userProfileId':_0x164336[_0x28fc('0x4c')]},'raw':!![]})['then'](function(_0x536730){if(_0x536730&&_0x536730[_0x28fc('0x4d')]===0x0){return db[_0x28fc('0x4e')][_0x28fc('0x46')]({'name':_0x47fe30[_0x28fc('0x27')],'resourceId':_0x47fe30['id'],'type':_0x536730['name'],'sectionId':_0x536730['id']},{})[_0x28fc('0x21')](function(){return _0x136440;});}else{return _0x136440;}})['catch'](function(_0x4d3873){logger[_0x28fc('0x4f')](_0x28fc('0x50'),_0x4d3873);throw _0x4d3873;});}return _0x136440;})['then'](respondWithResult(_0x5bbbdb,0xc9))[_0x28fc('0x41')](handleError(_0x5bbbdb,null));};exports[_0x28fc('0x20')]=function(_0x197614,_0x2a8d24){if(_0x197614[_0x28fc('0x47')]['id']){delete _0x197614[_0x28fc('0x47')]['id'];}return db[_0x28fc('0x3e')][_0x28fc('0x51')]({'where':{'id':_0x197614[_0x28fc('0x42')]['id']}})[_0x28fc('0x21')](handleEntityNotFound(_0x2a8d24,null))[_0x28fc('0x21')](saveUpdates(_0x197614[_0x28fc('0x47')],null))[_0x28fc('0x21')](respondWithResult(_0x2a8d24,null))[_0x28fc('0x41')](handleError(_0x2a8d24,null));};exports['destroy']=function(_0x3c47e8,_0x1b11ac){return db[_0x28fc('0x3e')][_0x28fc('0x51')]({'where':{'id':_0x3c47e8['params']['id']}})[_0x28fc('0x21')](handleEntityNotFound(_0x1b11ac,null))['then'](removeEntity(_0x1b11ac,null))[_0x28fc('0x41')](handleError(_0x1b11ac,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 3eddc1a..82a0558 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 _0xef33=['util','../../config/logger','api','moment','path','../../config/environment','exports','Template','tools_templates','lodash'];(function(_0x19176b,_0x1012fd){var _0x5807b3=function(_0x3a7bd8){while(--_0x3a7bd8){_0x19176b['push'](_0x19176b['shift']());}};_0x5807b3(++_0x1012fd);}(_0xef33,0x18f));var _0x3ef3=function(_0x21dde3,_0x4c27da){_0x21dde3=_0x21dde3-0x0;var _0xabf61f=_0xef33[_0x21dde3];return _0xabf61f;};'use strict';var _=require(_0x3ef3('0x0'));var util=require(_0x3ef3('0x1'));var logger=require(_0x3ef3('0x2'))(_0x3ef3('0x3'));var moment=require(_0x3ef3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ef3('0x5'));var rimraf=require('rimraf');var config=require(_0x3ef3('0x6'));var attributes=require('./template.attributes');module[_0x3ef3('0x7')]=function(_0xa867fb,_0x25d0c5){return _0xa867fb['define'](_0x3ef3('0x8'),attributes,{'tableName':_0x3ef3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa193=['bluebird','request-promise','path','rimraf','exports','Template','tools_templates','lodash','../../config/logger','api','moment'];(function(_0x1446ae,_0x2fa4ac){var _0x2af625=function(_0xe86c5b){while(--_0xe86c5b){_0x1446ae['push'](_0x1446ae['shift']());}};_0x2af625(++_0x2fa4ac);}(_0xa193,0x6a));var _0x3a19=function(_0x46d369,_0x443cc5){_0x46d369=_0x46d369-0x0;var _0x533347=_0xa193[_0x46d369];return _0x533347;};'use strict';var _=require(_0x3a19('0x0'));var util=require('util');var logger=require(_0x3a19('0x1'))(_0x3a19('0x2'));var moment=require(_0x3a19('0x3'));var BPromise=require(_0x3a19('0x4'));var rp=require(_0x3a19('0x5'));var fs=require('fs');var path=require(_0x3a19('0x6'));var rimraf=require(_0x3a19('0x7'));var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0x3a19('0x8')]=function(_0x39eb1e,_0x49cc18){return _0x39eb1e['define'](_0x3a19('0x9'),attributes,{'tableName':_0x3a19('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index e4b3444..ea66f4e 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 _0xda8c=['client','then','info','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','result','GetTemplate','Template','findAll','options','raw','attributes','limit','include','map','model','debug','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xda8c,0xb2));var _0xcda8=function(_0x1e5f0c,_0x31aa12){_0x1e5f0c=_0x1e5f0c-0x0;var _0x3d083b=_0xda8c[_0x1e5f0c];return _0x3d083b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcda8('0x0'));var rs=require(_0xcda8('0x1'));var fs=require('fs');var Redis=require(_0xcda8('0x2'));var db=require(_0xcda8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcda8('0x4'))(_0xcda8('0x5'));var config=require(_0xcda8('0x6'));var jayson=require(_0xcda8('0x7'));var client=jayson[_0xcda8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ab14a,_0x590b3f,_0x47fe0f){return new BPromise(function(_0x310518,_0x15e322){return client['request'](_0x3ab14a,_0x47fe0f)[_0xcda8('0x9')](function(_0x1f7164){logger[_0xcda8('0xa')]('Template,\x20%s,\x20%s',_0x590b3f,'request\x20sent');logger['debug'](_0xcda8('0xb'),_0x590b3f,_0xcda8('0xc'),JSON[_0xcda8('0xd')](_0x1f7164));if(_0x1f7164[_0xcda8('0xe')]){if(_0x1f7164[_0xcda8('0xe')][_0xcda8('0xf')]===0x1f4){logger[_0xcda8('0xe')](_0xcda8('0x10'),_0x590b3f,_0x1f7164['error'][_0xcda8('0x11')]);return _0x15e322(_0x1f7164[_0xcda8('0xe')][_0xcda8('0x11')]);}logger[_0xcda8('0xe')](_0xcda8('0x10'),_0x590b3f,_0x1f7164[_0xcda8('0xe')][_0xcda8('0x11')]);return _0x310518(_0x1f7164[_0xcda8('0xe')]['message']);}else{logger['info'](_0xcda8('0x10'),_0x590b3f,'request\x20sent');_0x310518(_0x1f7164[_0xcda8('0x12')][_0xcda8('0x11')]);}})['catch'](function(_0x688a59){logger['error'](_0xcda8('0x10'),_0x590b3f,_0x688a59);_0x15e322(_0x688a59);});});}exports[_0xcda8('0x13')]=function(_0x313f20){var _0x4b6ec2=this;return new Promise(function(_0x54b4e9,_0x3f6352){return db[_0xcda8('0x14')][_0xcda8('0x15')]({'raw':_0x313f20[_0xcda8('0x16')]?_0x313f20[_0xcda8('0x16')][_0xcda8('0x17')]===undefined?!![]:![]:!![],'where':_0x313f20[_0xcda8('0x16')]?_0x313f20[_0xcda8('0x16')]['where']||null:null,'attributes':_0x313f20['options']?_0x313f20['options'][_0xcda8('0x18')]||null:null,'limit':_0x313f20[_0xcda8('0x16')]?_0x313f20[_0xcda8('0x16')][_0xcda8('0x19')]||null:null,'include':_0x313f20[_0xcda8('0x16')]?_0x313f20[_0xcda8('0x16')][_0xcda8('0x1a')]?_[_0xcda8('0x1b')](_0x313f20['options'][_0xcda8('0x1a')],function(_0x534ec9){return{'model':db[_0x534ec9[_0xcda8('0x1c')]],'as':_0x534ec9['as'],'attributes':_0x534ec9[_0xcda8('0x18')],'include':_0x534ec9[_0xcda8('0x1a')]?_[_0xcda8('0x1b')](_0x534ec9[_0xcda8('0x1a')],function(_0x1015c2){return{'model':db[_0x1015c2[_0xcda8('0x1c')]],'as':_0x1015c2['as'],'attributes':_0x1015c2['attributes'],'include':_0x1015c2[_0xcda8('0x1a')]?_[_0xcda8('0x1b')](_0x1015c2[_0xcda8('0x1a')],function(_0x5041c5){return{'model':db[_0x5041c5['model']],'as':_0x5041c5['as'],'attributes':_0x5041c5['attributes']};}):[]};}):[]};}):[]:[]})[_0xcda8('0x9')](function(_0x1a01c7){logger[_0xcda8('0xa')](_0xcda8('0x13'),_0x313f20);logger[_0xcda8('0x1d')](_0xcda8('0x13'),_0x313f20,JSON['stringify'](_0x1a01c7));_0x54b4e9(_0x1a01c7);})[_0xcda8('0x1e')](function(_0x2d6bc3){logger['error'](_0xcda8('0x13'),_0x2d6bc3[_0xcda8('0x11')],_0x313f20);_0x3f6352(_0x4b6ec2[_0xcda8('0xe')](0x1f4,_0x2d6bc3[_0xcda8('0x11')]));});});}; \ No newline at end of file +var _0x7566=['Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTemplate','Template','options','raw','where','map','include','model','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Template,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x258f47,_0x33eb88){var _0x517530=function(_0x27d95c){while(--_0x27d95c){_0x258f47['push'](_0x258f47['shift']());}};_0x517530(++_0x33eb88);}(_0x7566,0x164));var _0x6756=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x7566[_0x3932eb];return _0x5316e5;};'use strict';var _=require(_0x6756('0x0'));var util=require(_0x6756('0x1'));var moment=require(_0x6756('0x2'));var BPromise=require(_0x6756('0x3'));var rs=require(_0x6756('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6756('0x5'))['db'];var utils=require(_0x6756('0x6'));var logger=require(_0x6756('0x7'))(_0x6756('0x8'));var config=require(_0x6756('0x9'));var jayson=require(_0x6756('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12c07b,_0x53bcda,_0x31a20e){return new BPromise(function(_0x3873d,_0x4d23a1){return client[_0x6756('0xb')](_0x12c07b,_0x31a20e)['then'](function(_0x4c72f3){logger[_0x6756('0xc')](_0x6756('0xd'),_0x53bcda,_0x6756('0xe'));logger[_0x6756('0xf')](_0x6756('0x10'),_0x53bcda,'request\x20sent',JSON[_0x6756('0x11')](_0x4c72f3));if(_0x4c72f3['error']){if(_0x4c72f3[_0x6756('0x12')]['code']===0x1f4){logger[_0x6756('0x12')]('Template,\x20%s,\x20%s',_0x53bcda,_0x4c72f3[_0x6756('0x12')][_0x6756('0x13')]);return _0x4d23a1(_0x4c72f3['error'][_0x6756('0x13')]);}logger[_0x6756('0x12')](_0x6756('0xd'),_0x53bcda,_0x4c72f3[_0x6756('0x12')][_0x6756('0x13')]);return _0x3873d(_0x4c72f3[_0x6756('0x12')]['message']);}else{logger['info'](_0x6756('0xd'),_0x53bcda,_0x6756('0xe'));_0x3873d(_0x4c72f3[_0x6756('0x14')]['message']);}})[_0x6756('0x15')](function(_0x507b82){logger[_0x6756('0x12')](_0x6756('0xd'),_0x53bcda,_0x507b82);_0x4d23a1(_0x507b82);});});}exports[_0x6756('0x16')]=function(_0x35f4c6){var _0x470faa=this;return new Promise(function(_0xdbef0a,_0x1af220){return db[_0x6756('0x17')]['findAll']({'raw':_0x35f4c6[_0x6756('0x18')]?_0x35f4c6[_0x6756('0x18')][_0x6756('0x19')]===undefined?!![]:![]:!![],'where':_0x35f4c6['options']?_0x35f4c6[_0x6756('0x18')][_0x6756('0x1a')]||null:null,'attributes':_0x35f4c6[_0x6756('0x18')]?_0x35f4c6['options']['attributes']||null:null,'limit':_0x35f4c6[_0x6756('0x18')]?_0x35f4c6[_0x6756('0x18')]['limit']||null:null,'include':_0x35f4c6[_0x6756('0x18')]?_0x35f4c6[_0x6756('0x18')]['include']?_[_0x6756('0x1b')](_0x35f4c6[_0x6756('0x18')][_0x6756('0x1c')],function(_0x162507){return{'model':db[_0x162507[_0x6756('0x1d')]],'as':_0x162507['as'],'attributes':_0x162507['attributes'],'include':_0x162507[_0x6756('0x1c')]?_['map'](_0x162507[_0x6756('0x1c')],function(_0x4166aa){return{'model':db[_0x4166aa[_0x6756('0x1d')]],'as':_0x4166aa['as'],'attributes':_0x4166aa[_0x6756('0x1e')],'include':_0x4166aa[_0x6756('0x1c')]?_[_0x6756('0x1b')](_0x4166aa[_0x6756('0x1c')],function(_0x43d301){return{'model':db[_0x43d301[_0x6756('0x1d')]],'as':_0x43d301['as'],'attributes':_0x43d301[_0x6756('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc15563){logger['info'](_0x6756('0x16'),_0x35f4c6);logger['debug'](_0x6756('0x16'),_0x35f4c6,JSON[_0x6756('0x11')](_0xc15563));_0xdbef0a(_0xc15563);})[_0x6756('0x15')](function(_0x34df0b){logger[_0x6756('0x12')]('GetTemplate',_0x34df0b['message'],_0x35f4c6);_0x1af220(_0x470faa[_0x6756('0x12')](0x1f4,_0x34df0b[_0x6756('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 4df8811..45136ed 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 _0xb7e2=['../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','put','update','delete','destroy','multer','path','express','fs-extra','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7e2,0x103));var _0x2b7e=function(_0x1d5564,_0x152f8f){_0x1d5564=_0x1d5564-0x0;var _0x78fde0=_0xb7e2[_0x1d5564];return _0x78fde0;};'use strict';var multer=require(_0x2b7e('0x0'));var util=require('util');var path=require(_0x2b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x2b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x2b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2b7e('0x4'));var config=require(_0x2b7e('0x5'));var controller=require(_0x2b7e('0x6'));router[_0x2b7e('0x7')]('/',auth[_0x2b7e('0x8')](),controller[_0x2b7e('0x9')]);router['get'](_0x2b7e('0xa'),auth[_0x2b7e('0x8')](),controller[_0x2b7e('0xb')]);router['get'](_0x2b7e('0xc'),auth[_0x2b7e('0x8')](),controller[_0x2b7e('0xd')]);router[_0x2b7e('0x7')](_0x2b7e('0xe'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x2b7e('0x7')](_0x2b7e('0xf'),auth[_0x2b7e('0x8')](),controller[_0x2b7e('0x10')]);router[_0x2b7e('0x11')]('/',auth[_0x2b7e('0x8')](),controller[_0x2b7e('0x12')]);router['post'](_0x2b7e('0xc'),auth[_0x2b7e('0x8')](),controller[_0x2b7e('0x13')]);router[_0x2b7e('0x11')]('/:id/any_conditions',auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x2b7e('0x11')]('/:id/actions',auth[_0x2b7e('0x8')](),controller['addAction']);router[_0x2b7e('0x14')]('/:id',auth[_0x2b7e('0x8')](),controller[_0x2b7e('0x15')]);router[_0x2b7e('0x16')]('/:id',auth[_0x2b7e('0x8')](),controller[_0x2b7e('0x17')]);module['exports']=router; \ No newline at end of file +var _0x7f68=['../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','put','/:id','destroy','multer','path','express','fs-extra'];(function(_0x3c3eff,_0x4d67bd){var _0x37feb=function(_0x3a34ee){while(--_0x3a34ee){_0x3c3eff['push'](_0x3c3eff['shift']());}};_0x37feb(++_0x4d67bd);}(_0x7f68,0x11a));var _0x87f6=function(_0x55e3fb,_0x120bd9){_0x55e3fb=_0x55e3fb-0x0;var _0x2d85e9=_0x7f68[_0x55e3fb];return _0x2d85e9;};'use strict';var multer=require(_0x87f6('0x0'));var util=require('util');var path=require(_0x87f6('0x1'));var timeout=require('connect-timeout');var express=require(_0x87f6('0x2'));var router=express['Router']();var fs_extra=require(_0x87f6('0x3'));var auth=require(_0x87f6('0x4'));var interaction=require(_0x87f6('0x5'));var config=require('../../config/environment');var controller=require(_0x87f6('0x6'));router[_0x87f6('0x7')]('/',auth[_0x87f6('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x87f6('0x7')](_0x87f6('0x9'),auth[_0x87f6('0x8')](),controller[_0x87f6('0xa')]);router['get'](_0x87f6('0xb'),auth[_0x87f6('0x8')](),controller[_0x87f6('0xc')]);router[_0x87f6('0x7')]('/:id/actions',auth[_0x87f6('0x8')](),controller[_0x87f6('0xd')]);router[_0x87f6('0xe')]('/',auth[_0x87f6('0x8')](),controller[_0x87f6('0xf')]);router['post']('/:id/all_conditions',auth[_0x87f6('0x8')](),controller[_0x87f6('0x10')]);router[_0x87f6('0xe')](_0x87f6('0xb'),auth[_0x87f6('0x8')](),controller[_0x87f6('0x11')]);router[_0x87f6('0xe')](_0x87f6('0x12'),auth[_0x87f6('0x8')](),controller['addAction']);router[_0x87f6('0x13')](_0x87f6('0x14'),auth[_0x87f6('0x8')](),controller['update']);router['delete'](_0x87f6('0x14'),auth[_0x87f6('0x8')](),controller[_0x87f6('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index a8231d5..7d5cead 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 _0xb891=['BOOLEAN','sequelize','STRING'];(function(_0x296d0e,_0xe264d){var _0x45ce2f=function(_0xa1ef60){while(--_0xa1ef60){_0x296d0e['push'](_0x296d0e['shift']());}};_0x45ce2f(++_0xe264d);}(_0xb891,0x18d));var _0x1b89=function(_0x53d98f,_0x16fd94){_0x53d98f=_0x53d98f-0x0;var _0x17a75f=_0xb891[_0x53d98f];return _0x17a75f;};'use strict';var Sequelize=require(_0x1b89('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1b89('0x1')]},'status':{'type':Sequelize[_0x1b89('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe94e=['STRING','sequelize','exports'];(function(_0x101315,_0x192c90){var _0x403d39=function(_0x4890f7){while(--_0x4890f7){_0x101315['push'](_0x101315['shift']());}};_0x403d39(++_0x192c90);}(_0xe94e,0x100));var _0xee94=function(_0x3312f1,_0x437dd7){_0x3312f1=_0x3312f1-0x0;var _0x32e537=_0xe94e[_0x3312f1];return _0x32e537;};'use strict';var Sequelize=require(_0xee94('0x0'));module[_0xee94('0x1')]={'name':{'type':Sequelize[_0xee94('0x2')]},'channel':{'type':Sequelize[_0xee94('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index e393c9b..456a8f0 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 _0x3ac9=['type','options','include','findAll','rows','catch','show','keys','attributes','includeAll','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','intersection','hasOwnProperty','getAnyConditions','findOne','nolimit','addAction','TriggerId','Action','getActions','eml-format','rimraf','moment','bluebird','util','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','query','fields','length','order','sort','where','filters','pick','filter','merge'];(function(_0x24f77c,_0x305996){var _0x395cbd=function(_0x57680c){while(--_0x57680c){_0x24f77c['push'](_0x24f77c['shift']());}};_0x395cbd(++_0x305996);}(_0x3ac9,0x80));var _0x93ac=function(_0x43de93,_0x5daf15){_0x43de93=_0x43de93-0x0;var _0x168e48=_0x3ac9[_0x43de93];return _0x168e48;};'use strict';var emlformat=require(_0x93ac('0x0'));var rimraf=require(_0x93ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x93ac('0x2'));var BPromise=require(_0x93ac('0x3'));var Mustache=require('mustache');var util=require(_0x93ac('0x4'));var path=require('path');var sox=require(_0x93ac('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ac('0x6'));var _=require(_0x93ac('0x7'));var squel=require('squel');var crypto=require(_0x93ac('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x93ac('0x9'));var toCsv=require(_0x93ac('0xa'));var querystring=require(_0x93ac('0xb'));var Papa=require('papaparse');var Redis=require(_0x93ac('0xc'));var authService=require(_0x93ac('0xd'));var qs=require(_0x93ac('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93ac('0xf'));var logger=require(_0x93ac('0x10'))('api');var utils=require(_0x93ac('0x11'));var config=require(_0x93ac('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x93ac('0x13'))['db'];function respondWithStatusCode(_0x284f3a,_0x5a90cf){_0x5a90cf=_0x5a90cf||0xcc;return function(_0x3da30d){if(_0x3da30d){return _0x284f3a[_0x93ac('0x14')](_0x5a90cf);}return _0x284f3a[_0x93ac('0x15')](_0x5a90cf)[_0x93ac('0x16')]();};}function respondWithResult(_0x2da9ee,_0x360f9d){_0x360f9d=_0x360f9d||0xc8;return function(_0x537dbf){if(_0x537dbf){return _0x2da9ee[_0x93ac('0x15')](_0x360f9d)[_0x93ac('0x17')](_0x537dbf);}};}function respondWithFilteredResult(_0x558c6c,_0x3153fb){return function(_0x45ae20){if(_0x45ae20){var _0x19f94f=typeof _0x3153fb[_0x93ac('0x18')]==='undefined'&&typeof _0x3153fb['limit']===_0x93ac('0x19');var _0x567eb4=_0x45ae20[_0x93ac('0x1a')];var _0x7a9fa8=_0x19f94f?0x0:_0x3153fb[_0x93ac('0x18')];var _0x907424=_0x19f94f?_0x45ae20[_0x93ac('0x1a')]:_0x3153fb[_0x93ac('0x18')]+_0x3153fb[_0x93ac('0x1b')];var _0x12cb79;if(_0x907424>=_0x567eb4){_0x907424=_0x567eb4;_0x12cb79=0xc8;}else{_0x12cb79=0xce;}_0x558c6c[_0x93ac('0x15')](_0x12cb79);return _0x558c6c['set']('Content-Range',_0x7a9fa8+'-'+_0x907424+'/'+_0x567eb4)[_0x93ac('0x17')](_0x45ae20);}return null;};}function patchUpdates(_0x50a043){return function(_0x24e619){try{jsonpatch[_0x93ac('0x1c')](_0x24e619,_0x50a043,!![]);}catch(_0x217527){return BPromise[_0x93ac('0x1d')](_0x217527);}return _0x24e619[_0x93ac('0x1e')]();};}function saveUpdates(_0x1d9179,_0x7f75c4){return function(_0x2982dc){if(_0x2982dc){return _0x2982dc[_0x93ac('0x1f')](_0x1d9179)['then'](function(_0x36f312){return _0x36f312;});}return null;};}function removeEntity(_0x3cecfc,_0x5be991){return function(_0x388a5b){if(_0x388a5b){return _0x388a5b[_0x93ac('0x20')]()[_0x93ac('0x21')](function(){var _0x4b1069=_0x388a5b['get']({'plain':!![]});var _0x27dd32='Triggers';return db[_0x93ac('0x22')][_0x93ac('0x20')]({'where':{'type':_0x27dd32,'resourceId':_0x4b1069['id']}})['then'](function(){return _0x388a5b;});})[_0x93ac('0x21')](function(){_0x3cecfc[_0x93ac('0x15')](0xcc)[_0x93ac('0x16')]();});}};}function handleEntityNotFound(_0x23300f,_0x4cce79){return function(_0x522119){if(!_0x522119){_0x23300f[_0x93ac('0x14')](0x194);}return _0x522119;};}function handleError(_0x537be6,_0x501d7b){_0x501d7b=_0x501d7b||0x1f4;return function(_0x442ad4){logger[_0x93ac('0x23')](_0x442ad4[_0x93ac('0x24')]);if(_0x442ad4[_0x93ac('0x25')]){delete _0x442ad4['name'];}_0x537be6[_0x93ac('0x15')](_0x501d7b)[_0x93ac('0x26')](_0x442ad4);};}exports[_0x93ac('0x27')]=function(_0x2cf54e,_0x1b1c8c){var _0x2308c2={},_0x5036c3={},_0x18b7d2={'count':0x0,'rows':[]};var _0x4962bd=_[_0x93ac('0x28')](db[_0x93ac('0x29')][_0x93ac('0x2a')],function(_0x4453e2){return{'name':_0x4453e2[_0x93ac('0x2b')],'type':_0x4453e2['type'][_0x93ac('0x2c')]};});_0x5036c3[_0x93ac('0x2d')]=_[_0x93ac('0x28')](_0x4962bd,_0x93ac('0x25'));_0x5036c3[_0x93ac('0x2e')]=_['keys'](_0x2cf54e[_0x93ac('0x2e')]);_0x5036c3['filters']=_['intersection'](_0x5036c3['model'],_0x5036c3[_0x93ac('0x2e')]);_0x2308c2['attributes']=_['intersection'](_0x5036c3[_0x93ac('0x2d')],qs[_0x93ac('0x2f')](_0x2cf54e['query'][_0x93ac('0x2f')]));_0x2308c2['attributes']=_0x2308c2['attributes'][_0x93ac('0x30')]?_0x2308c2['attributes']:_0x5036c3[_0x93ac('0x2d')];if(!_0x2cf54e['query']['hasOwnProperty']('nolimit')){_0x2308c2['limit']=qs['limit'](_0x2cf54e[_0x93ac('0x2e')][_0x93ac('0x1b')]);_0x2308c2[_0x93ac('0x18')]=qs['offset'](_0x2cf54e[_0x93ac('0x2e')]['offset']);}_0x2308c2[_0x93ac('0x31')]=qs[_0x93ac('0x32')](_0x2cf54e[_0x93ac('0x2e')][_0x93ac('0x32')]);_0x2308c2[_0x93ac('0x33')]=qs[_0x93ac('0x34')](_[_0x93ac('0x35')](_0x2cf54e['query'],_0x5036c3[_0x93ac('0x34')]),_0x4962bd);if(_0x2cf54e[_0x93ac('0x2e')][_0x93ac('0x36')]){_0x2308c2[_0x93ac('0x33')]=_[_0x93ac('0x37')](_0x2308c2[_0x93ac('0x33')],{'$or':_['map'](_0x4962bd,function(_0x572b36){if(_0x572b36[_0x93ac('0x38')]!=='VIRTUAL'){var _0x5af555={};_0x5af555[_0x572b36['name']]={'$like':'%'+_0x2cf54e['query'][_0x93ac('0x36')]+'%'};return _0x5af555;}})});}_0x2308c2=_[_0x93ac('0x37')]({},_0x2308c2,_0x2cf54e[_0x93ac('0x39')]);var _0x10f4fe={'where':_0x2308c2[_0x93ac('0x33')]};return db[_0x93ac('0x29')]['count'](_0x10f4fe)[_0x93ac('0x21')](function(_0x464053){_0x18b7d2['count']=_0x464053;if(_0x2cf54e[_0x93ac('0x2e')]['includeAll']){_0x2308c2[_0x93ac('0x3a')]=[{'all':!![]}];}return db[_0x93ac('0x29')][_0x93ac('0x3b')](_0x2308c2);})['then'](function(_0x26fcf9){_0x18b7d2[_0x93ac('0x3c')]=_0x26fcf9;return _0x18b7d2;})['then'](respondWithFilteredResult(_0x1b1c8c,_0x2308c2))[_0x93ac('0x3d')](handleError(_0x1b1c8c,null));};exports[_0x93ac('0x3e')]=function(_0x4e4dd7,_0x6fdee1){var _0xa99848={'raw':![],'where':{'id':_0x4e4dd7['params']['id']}},_0xada03f={};_0xada03f[_0x93ac('0x2d')]=_['keys'](db[_0x93ac('0x29')][_0x93ac('0x2a')]);_0xada03f[_0x93ac('0x2e')]=_[_0x93ac('0x3f')](_0x4e4dd7['query']);_0xada03f[_0x93ac('0x34')]=_['intersection'](_0xada03f['model'],_0xada03f['query']);_0xa99848['attributes']=_['intersection'](_0xada03f[_0x93ac('0x2d')],qs['fields'](_0x4e4dd7[_0x93ac('0x2e')]['fields']));_0xa99848['attributes']=_0xa99848[_0x93ac('0x40')]['length']?_0xa99848['attributes']:_0xada03f['model'];if(_0x4e4dd7[_0x93ac('0x2e')][_0x93ac('0x41')]){_0xa99848[_0x93ac('0x3a')]=[{'all':!![]}];}_0xa99848=_[_0x93ac('0x37')]({},_0xa99848,_0x4e4dd7[_0x93ac('0x39')]);return db[_0x93ac('0x29')][_0x93ac('0x42')](_0xa99848)[_0x93ac('0x21')](handleEntityNotFound(_0x6fdee1,null))[_0x93ac('0x21')](respondWithResult(_0x6fdee1,null))[_0x93ac('0x3d')](handleError(_0x6fdee1,null));};exports['create']=function(_0x4951af,_0x4b26fe){return db[_0x93ac('0x29')]['create'](_0x4951af[_0x93ac('0x43')],{})[_0x93ac('0x21')](function(_0x1ac959){var _0x396e96=_0x4951af[_0x93ac('0x44')][_0x93ac('0x45')]({'plain':!![]});if(!_0x396e96)throw new Error(_0x93ac('0x46'));if(_0x396e96[_0x93ac('0x47')]===_0x93ac('0x44')){var _0x53e4c3=_0x1ac959[_0x93ac('0x45')]({'plain':!![]});var _0x143771=_0x93ac('0x48');return db['UserProfileSection'][_0x93ac('0x42')]({'where':{'name':_0x143771,'userProfileId':_0x396e96[_0x93ac('0x49')]},'raw':!![]})[_0x93ac('0x21')](function(_0x25facf){if(_0x25facf&&_0x25facf[_0x93ac('0x4a')]===0x0){return db[_0x93ac('0x22')][_0x93ac('0x4b')]({'name':_0x53e4c3['name'],'resourceId':_0x53e4c3['id'],'type':_0x25facf[_0x93ac('0x25')],'sectionId':_0x25facf['id']},{})[_0x93ac('0x21')](function(){return _0x1ac959;});}else{return _0x1ac959;}})[_0x93ac('0x3d')](function(_0x11c9e8){logger[_0x93ac('0x23')](_0x93ac('0x4c'),_0x11c9e8);throw _0x11c9e8;});}return _0x1ac959;})[_0x93ac('0x21')](respondWithResult(_0x4b26fe,0xc9))[_0x93ac('0x3d')](handleError(_0x4b26fe,null));};exports[_0x93ac('0x1f')]=function(_0x583131,_0x2034ed){if(_0x583131[_0x93ac('0x43')]['id']){delete _0x583131[_0x93ac('0x43')]['id'];}return db['Trigger'][_0x93ac('0x42')]({'where':{'id':_0x583131[_0x93ac('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2034ed,null))[_0x93ac('0x21')](saveUpdates(_0x583131[_0x93ac('0x43')],null))[_0x93ac('0x21')](respondWithResult(_0x2034ed,null))['catch'](handleError(_0x2034ed,null));};exports[_0x93ac('0x20')]=function(_0x38a4ad,_0x25bcc4){return db[_0x93ac('0x29')][_0x93ac('0x42')]({'where':{'id':_0x38a4ad['params']['id']}})[_0x93ac('0x21')](handleEntityNotFound(_0x25bcc4,null))[_0x93ac('0x21')](removeEntity(_0x25bcc4,null))[_0x93ac('0x3d')](handleError(_0x25bcc4,null));};exports[_0x93ac('0x4e')]=function(_0x499844,_0x565031,_0x2a3767){if(_0x499844[_0x93ac('0x43')]['id']){delete _0x499844[_0x93ac('0x43')]['id'];}return db[_0x93ac('0x29')][_0x93ac('0x42')]({'where':{'id':_0x499844['params']['id']}})['then'](handleEntityNotFound(_0x565031,null))[_0x93ac('0x21')](function(_0x26c378){if(_0x26c378){_0x499844[_0x93ac('0x43')][_0x93ac('0x4f')]=_0x26c378['id'];return db[_0x93ac('0x50')][_0x93ac('0x4b')](_0x499844[_0x93ac('0x43')]);}})['then'](respondWithResult(_0x565031,null))[_0x93ac('0x3d')](handleError(_0x565031,null));};exports[_0x93ac('0x51')]=function(_0x4906ae,_0x110913,_0x3d25b3){if(_0x4906ae[_0x93ac('0x43')]['id']){delete _0x4906ae[_0x93ac('0x43')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4906ae['params']['id']}})[_0x93ac('0x21')](handleEntityNotFound(_0x110913,null))[_0x93ac('0x21')](function(_0x31a479){if(_0x31a479){_0x4906ae[_0x93ac('0x43')]['TriggerAnyId']=_0x31a479['id'];return db['Condition'][_0x93ac('0x4b')](_0x4906ae[_0x93ac('0x43')]);}})[_0x93ac('0x21')](respondWithResult(_0x110913,null))[_0x93ac('0x3d')](handleError(_0x110913,null));};exports[_0x93ac('0x52')]=function(_0x2c5f86,_0x5f471a,_0x4b9e58){var _0xd3f72f={};var _0x43642d={};var _0x36b176;var _0x404497;return db[_0x93ac('0x29')]['findOne']({'where':{'id':_0x2c5f86[_0x93ac('0x4d')]['id']}})[_0x93ac('0x21')](handleEntityNotFound(_0x5f471a,null))['then'](function(_0x400b55){if(_0x400b55){_0x36b176=_0x400b55;_0x43642d[_0x93ac('0x2d')]=_[_0x93ac('0x3f')](db['Condition'][_0x93ac('0x2a')]);_0x43642d['query']=_['keys'](_0x2c5f86[_0x93ac('0x2e')]);_0x43642d[_0x93ac('0x34')]=_[_0x93ac('0x53')](_0x43642d[_0x93ac('0x2d')],_0x43642d['query']);_0xd3f72f[_0x93ac('0x40')]=_[_0x93ac('0x53')](_0x43642d[_0x93ac('0x2d')],qs[_0x93ac('0x2f')](_0x2c5f86[_0x93ac('0x2e')][_0x93ac('0x2f')]));_0xd3f72f[_0x93ac('0x40')]=_0xd3f72f['attributes'][_0x93ac('0x30')]?_0xd3f72f['attributes']:_0x43642d[_0x93ac('0x2d')];_0xd3f72f[_0x93ac('0x31')]=qs['sort'](_0x2c5f86[_0x93ac('0x2e')]['sort']);_0xd3f72f['where']=qs['filters'](_[_0x93ac('0x35')](_0x2c5f86[_0x93ac('0x2e')],_0x43642d[_0x93ac('0x34')]));if(_0x2c5f86[_0x93ac('0x2e')][_0x93ac('0x36')]){_0xd3f72f[_0x93ac('0x33')]=_['merge'](_0xd3f72f[_0x93ac('0x33')],{'$or':_[_0x93ac('0x28')](_0xd3f72f[_0x93ac('0x40')],function(_0x24a513){var _0x25315d={};_0x25315d[_0x24a513]={'$like':'%'+_0x2c5f86[_0x93ac('0x2e')]['filter']+'%'};return _0x25315d;})});}_0xd3f72f=_[_0x93ac('0x37')]({},_0xd3f72f,_0x2c5f86['options']);return _0x36b176[_0x93ac('0x52')](_0xd3f72f);}})[_0x93ac('0x21')](function(_0x383b56){if(_0x383b56){_0x404497=_0x383b56[_0x93ac('0x30')];if(!_0x2c5f86[_0x93ac('0x2e')][_0x93ac('0x54')]('nolimit')){_0xd3f72f[_0x93ac('0x1b')]=qs[_0x93ac('0x1b')](_0x2c5f86[_0x93ac('0x2e')]['limit']);_0xd3f72f[_0x93ac('0x18')]=qs[_0x93ac('0x18')](_0x2c5f86[_0x93ac('0x2e')][_0x93ac('0x18')]);}return _0x36b176['getAllConditions'](_0xd3f72f);}})[_0x93ac('0x21')](function(_0x3f5722){if(_0x3f5722){return _0x3f5722?{'count':_0x404497,'rows':_0x3f5722}:null;}})[_0x93ac('0x21')](respondWithResult(_0x5f471a,null))['catch'](handleError(_0x5f471a,null));};exports[_0x93ac('0x55')]=function(_0x563d6d,_0x2a9aa8,_0x31563f){var _0x5c9f85={};var _0x35f0d5={};var _0x4db610;var _0x5fe08e;return db['Trigger'][_0x93ac('0x56')]({'where':{'id':_0x563d6d['params']['id']}})[_0x93ac('0x21')](handleEntityNotFound(_0x2a9aa8,null))[_0x93ac('0x21')](function(_0x18989d){if(_0x18989d){_0x4db610=_0x18989d;_0x35f0d5[_0x93ac('0x2d')]=_[_0x93ac('0x3f')](db[_0x93ac('0x50')][_0x93ac('0x2a')]);_0x35f0d5[_0x93ac('0x2e')]=_[_0x93ac('0x3f')](_0x563d6d[_0x93ac('0x2e')]);_0x35f0d5[_0x93ac('0x34')]=_['intersection'](_0x35f0d5[_0x93ac('0x2d')],_0x35f0d5['query']);_0x5c9f85['attributes']=_['intersection'](_0x35f0d5[_0x93ac('0x2d')],qs[_0x93ac('0x2f')](_0x563d6d[_0x93ac('0x2e')][_0x93ac('0x2f')]));_0x5c9f85[_0x93ac('0x40')]=_0x5c9f85[_0x93ac('0x40')][_0x93ac('0x30')]?_0x5c9f85[_0x93ac('0x40')]:_0x35f0d5[_0x93ac('0x2d')];_0x5c9f85[_0x93ac('0x31')]=qs[_0x93ac('0x32')](_0x563d6d[_0x93ac('0x2e')][_0x93ac('0x32')]);_0x5c9f85[_0x93ac('0x33')]=qs[_0x93ac('0x34')](_[_0x93ac('0x35')](_0x563d6d['query'],_0x35f0d5[_0x93ac('0x34')]));if(_0x563d6d[_0x93ac('0x2e')][_0x93ac('0x36')]){_0x5c9f85[_0x93ac('0x33')]=_['merge'](_0x5c9f85['where'],{'$or':_[_0x93ac('0x28')](_0x5c9f85['attributes'],function(_0x516095){var _0x1aa99a={};_0x1aa99a[_0x516095]={'$like':'%'+_0x563d6d[_0x93ac('0x2e')]['filter']+'%'};return _0x1aa99a;})});}_0x5c9f85=_[_0x93ac('0x37')]({},_0x5c9f85,_0x563d6d[_0x93ac('0x39')]);return _0x4db610[_0x93ac('0x55')](_0x5c9f85);}})['then'](function(_0x2140d0){if(_0x2140d0){_0x5fe08e=_0x2140d0['length'];if(!_0x563d6d[_0x93ac('0x2e')][_0x93ac('0x54')](_0x93ac('0x57'))){_0x5c9f85[_0x93ac('0x1b')]=qs['limit'](_0x563d6d['query'][_0x93ac('0x1b')]);_0x5c9f85[_0x93ac('0x18')]=qs[_0x93ac('0x18')](_0x563d6d[_0x93ac('0x2e')]['offset']);}return _0x4db610['getAnyConditions'](_0x5c9f85);}})[_0x93ac('0x21')](function(_0x57202e){if(_0x57202e){return _0x57202e?{'count':_0x5fe08e,'rows':_0x57202e}:null;}})[_0x93ac('0x21')](respondWithResult(_0x2a9aa8,null))['catch'](handleError(_0x2a9aa8,null));};exports[_0x93ac('0x58')]=function(_0x12a236,_0x4f3f18,_0x4e5994){if(_0x12a236[_0x93ac('0x43')]['id']){delete _0x12a236[_0x93ac('0x43')]['id'];}return db[_0x93ac('0x29')][_0x93ac('0x42')]({'where':{'id':_0x12a236[_0x93ac('0x4d')]['id']}})[_0x93ac('0x21')](handleEntityNotFound(_0x4f3f18,null))[_0x93ac('0x21')](function(_0x346923){if(_0x346923){_0x12a236['body'][_0x93ac('0x59')]=_0x346923['id'];return db[_0x93ac('0x5a')]['create'](_0x12a236['body']);}})[_0x93ac('0x21')](respondWithResult(_0x4f3f18,null))[_0x93ac('0x3d')](handleError(_0x4f3f18,null));};exports['getActions']=function(_0xd7ab3c,_0x10a869,_0x30e5fb){var _0x287a1e={};var _0x369ddf={};var _0x3f452f;var _0x376357;return db[_0x93ac('0x29')][_0x93ac('0x56')]({'where':{'id':_0xd7ab3c[_0x93ac('0x4d')]['id']}})[_0x93ac('0x21')](handleEntityNotFound(_0x10a869,null))[_0x93ac('0x21')](function(_0x4079c5){if(_0x4079c5){_0x3f452f=_0x4079c5;_0x369ddf[_0x93ac('0x2d')]=_[_0x93ac('0x3f')](db[_0x93ac('0x5a')][_0x93ac('0x2a')]);_0x369ddf[_0x93ac('0x2e')]=_[_0x93ac('0x3f')](_0xd7ab3c[_0x93ac('0x2e')]);_0x369ddf['filters']=_[_0x93ac('0x53')](_0x369ddf[_0x93ac('0x2d')],_0x369ddf[_0x93ac('0x2e')]);_0x287a1e[_0x93ac('0x40')]=_['intersection'](_0x369ddf['model'],qs[_0x93ac('0x2f')](_0xd7ab3c[_0x93ac('0x2e')][_0x93ac('0x2f')]));_0x287a1e[_0x93ac('0x40')]=_0x287a1e[_0x93ac('0x40')][_0x93ac('0x30')]?_0x287a1e['attributes']:_0x369ddf[_0x93ac('0x2d')];_0x287a1e['order']=qs[_0x93ac('0x32')](_0xd7ab3c[_0x93ac('0x2e')][_0x93ac('0x32')]);_0x287a1e[_0x93ac('0x33')]=qs[_0x93ac('0x34')](_[_0x93ac('0x35')](_0xd7ab3c[_0x93ac('0x2e')],_0x369ddf['filters']));if(_0xd7ab3c[_0x93ac('0x2e')][_0x93ac('0x36')]){_0x287a1e['where']=_[_0x93ac('0x37')](_0x287a1e[_0x93ac('0x33')],{'$or':_[_0x93ac('0x28')](_0x287a1e[_0x93ac('0x40')],function(_0x310f56){var _0x3b4a1d={};_0x3b4a1d[_0x310f56]={'$like':'%'+_0xd7ab3c[_0x93ac('0x2e')]['filter']+'%'};return _0x3b4a1d;})});}_0x287a1e=_[_0x93ac('0x37')]({},_0x287a1e,_0xd7ab3c['options']);return _0x3f452f[_0x93ac('0x5b')](_0x287a1e);}})['then'](function(_0x342b79){if(_0x342b79){_0x376357=_0x342b79[_0x93ac('0x30')];if(!_0xd7ab3c[_0x93ac('0x2e')]['hasOwnProperty'](_0x93ac('0x57'))){_0x287a1e[_0x93ac('0x1b')]=qs[_0x93ac('0x1b')](_0xd7ab3c[_0x93ac('0x2e')][_0x93ac('0x1b')]);_0x287a1e[_0x93ac('0x18')]=qs[_0x93ac('0x18')](_0xd7ab3c[_0x93ac('0x2e')]['offset']);}return _0x3f452f[_0x93ac('0x5b')](_0x287a1e);}})[_0x93ac('0x21')](function(_0x29dc73){if(_0x29dc73){return _0x29dc73?{'count':_0x376357,'rows':_0x29dc73}:null;}})[_0x93ac('0x21')](respondWithResult(_0x10a869,null))[_0x93ac('0x3d')](handleError(_0x10a869,null));}; \ No newline at end of file +var _0x3555=['name','send','index','map','Trigger','fieldName','type','key','model','query','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','options','includeAll','findAll','catch','show','params','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','TriggerAnyId','Condition','getAllConditions','findOne','hasOwnProperty','nolimit','getAnyConditions','addAction','TriggerId','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','get','UserProfileResource','destroy','error','stack'];(function(_0x27dd1f,_0x2b649e){var _0x1cabfa=function(_0x1a6a36){while(--_0x1a6a36){_0x27dd1f['push'](_0x27dd1f['shift']());}};_0x1cabfa(++_0x2b649e);}(_0x3555,0xea));var _0x5355=function(_0x1e7931,_0x10795d){_0x1e7931=_0x1e7931-0x0;var _0x2cc4c7=_0x3555[_0x1e7931];return _0x2cc4c7;};'use strict';var emlformat=require(_0x5355('0x0'));var rimraf=require(_0x5355('0x1'));var zipdir=require(_0x5355('0x2'));var jsonpatch=require(_0x5355('0x3'));var rp=require(_0x5355('0x4'));var moment=require(_0x5355('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5355('0x6'));var sox=require('sox');var csv=require(_0x5355('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5355('0x8'));var _=require(_0x5355('0x9'));var squel=require(_0x5355('0xa'));var crypto=require('crypto');var jsforce=require(_0x5355('0xb'));var deskjs=require(_0x5355('0xc'));var toCsv=require(_0x5355('0x7'));var querystring=require(_0x5355('0xd'));var Papa=require(_0x5355('0xe'));var Redis=require(_0x5355('0xf'));var authService=require(_0x5355('0x10'));var qs=require(_0x5355('0x11'));var as=require(_0x5355('0x12'));var hardwareService=require(_0x5355('0x13'));var logger=require(_0x5355('0x14'))(_0x5355('0x15'));var utils=require(_0x5355('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5355('0x17'))['db'];function respondWithStatusCode(_0x581d73,_0xbcf786){_0xbcf786=_0xbcf786||0xcc;return function(_0x5370b8){if(_0x5370b8){return _0x581d73[_0x5355('0x18')](_0xbcf786);}return _0x581d73[_0x5355('0x19')](_0xbcf786)[_0x5355('0x1a')]();};}function respondWithResult(_0x3618ae,_0x38d9b9){_0x38d9b9=_0x38d9b9||0xc8;return function(_0x45e0af){if(_0x45e0af){return _0x3618ae['status'](_0x38d9b9)[_0x5355('0x1b')](_0x45e0af);}};}function respondWithFilteredResult(_0x4df86c,_0x55166c){return function(_0x282dbc){if(_0x282dbc){var _0x179005=typeof _0x55166c['offset']===_0x5355('0x1c')&&typeof _0x55166c[_0x5355('0x1d')]==='undefined';var _0xcdc94a=_0x282dbc[_0x5355('0x1e')];var _0x4eb072=_0x179005?0x0:_0x55166c[_0x5355('0x1f')];var _0x9458f4=_0x179005?_0x282dbc[_0x5355('0x1e')]:_0x55166c['offset']+_0x55166c['limit'];var _0x31f9cd;if(_0x9458f4>=_0xcdc94a){_0x9458f4=_0xcdc94a;_0x31f9cd=0xc8;}else{_0x31f9cd=0xce;}_0x4df86c[_0x5355('0x19')](_0x31f9cd);return _0x4df86c[_0x5355('0x20')]('Content-Range',_0x4eb072+'-'+_0x9458f4+'/'+_0xcdc94a)[_0x5355('0x1b')](_0x282dbc);}return null;};}function patchUpdates(_0x487772){return function(_0x3014ac){try{jsonpatch['apply'](_0x3014ac,_0x487772,!![]);}catch(_0x3ec955){return BPromise[_0x5355('0x21')](_0x3ec955);}return _0x3014ac[_0x5355('0x22')]();};}function saveUpdates(_0x5174cd,_0x1d427e){return function(_0x19cfb8){if(_0x19cfb8){return _0x19cfb8[_0x5355('0x23')](_0x5174cd)[_0x5355('0x24')](function(_0x1076a0){return _0x1076a0;});}return null;};}function removeEntity(_0x27196e,_0x146ca7){return function(_0x4a20d5){if(_0x4a20d5){return _0x4a20d5['destroy']()[_0x5355('0x24')](function(){var _0xe398dc=_0x4a20d5[_0x5355('0x25')]({'plain':!![]});var _0x2767c8='Triggers';return db[_0x5355('0x26')][_0x5355('0x27')]({'where':{'type':_0x2767c8,'resourceId':_0xe398dc['id']}})['then'](function(){return _0x4a20d5;});})[_0x5355('0x24')](function(){_0x27196e[_0x5355('0x19')](0xcc)[_0x5355('0x1a')]();});}};}function handleEntityNotFound(_0x29a4e3,_0x4d52b9){return function(_0x43051c){if(!_0x43051c){_0x29a4e3[_0x5355('0x18')](0x194);}return _0x43051c;};}function handleError(_0x1a26ab,_0x372148){_0x372148=_0x372148||0x1f4;return function(_0x1d1de1){logger[_0x5355('0x28')](_0x1d1de1[_0x5355('0x29')]);if(_0x1d1de1[_0x5355('0x2a')]){delete _0x1d1de1[_0x5355('0x2a')];}_0x1a26ab[_0x5355('0x19')](_0x372148)[_0x5355('0x2b')](_0x1d1de1);};}exports[_0x5355('0x2c')]=function(_0x2aec94,_0x501c60){var _0x42a218={},_0x198e97={},_0x354fd2={'count':0x0,'rows':[]};var _0x46c695=_[_0x5355('0x2d')](db[_0x5355('0x2e')]['rawAttributes'],function(_0x18e17c){return{'name':_0x18e17c[_0x5355('0x2f')],'type':_0x18e17c[_0x5355('0x30')][_0x5355('0x31')]};});_0x198e97[_0x5355('0x32')]=_[_0x5355('0x2d')](_0x46c695,_0x5355('0x2a'));_0x198e97['query']=_['keys'](_0x2aec94[_0x5355('0x33')]);_0x198e97['filters']=_[_0x5355('0x34')](_0x198e97[_0x5355('0x32')],_0x198e97[_0x5355('0x33')]);_0x42a218[_0x5355('0x35')]=_[_0x5355('0x34')](_0x198e97[_0x5355('0x32')],qs['fields'](_0x2aec94[_0x5355('0x33')][_0x5355('0x36')]));_0x42a218[_0x5355('0x35')]=_0x42a218[_0x5355('0x35')][_0x5355('0x37')]?_0x42a218[_0x5355('0x35')]:_0x198e97[_0x5355('0x32')];if(!_0x2aec94[_0x5355('0x33')]['hasOwnProperty']('nolimit')){_0x42a218[_0x5355('0x1d')]=qs['limit'](_0x2aec94[_0x5355('0x33')][_0x5355('0x1d')]);_0x42a218[_0x5355('0x1f')]=qs[_0x5355('0x1f')](_0x2aec94[_0x5355('0x33')]['offset']);}_0x42a218[_0x5355('0x38')]=qs[_0x5355('0x39')](_0x2aec94[_0x5355('0x33')]['sort']);_0x42a218[_0x5355('0x3a')]=qs['filters'](_[_0x5355('0x3b')](_0x2aec94[_0x5355('0x33')],_0x198e97[_0x5355('0x3c')]),_0x46c695);if(_0x2aec94[_0x5355('0x33')][_0x5355('0x3d')]){_0x42a218[_0x5355('0x3a')]=_[_0x5355('0x3e')](_0x42a218[_0x5355('0x3a')],{'$or':_['map'](_0x46c695,function(_0x5206c0){if(_0x5206c0[_0x5355('0x30')]!=='VIRTUAL'){var _0x24b776={};_0x24b776[_0x5206c0[_0x5355('0x2a')]]={'$like':'%'+_0x2aec94[_0x5355('0x33')][_0x5355('0x3d')]+'%'};return _0x24b776;}})});}_0x42a218=_[_0x5355('0x3e')]({},_0x42a218,_0x2aec94[_0x5355('0x3f')]);var _0x43ce89={'where':_0x42a218[_0x5355('0x3a')]};return db[_0x5355('0x2e')]['count'](_0x43ce89)[_0x5355('0x24')](function(_0x52ceb5){_0x354fd2['count']=_0x52ceb5;if(_0x2aec94[_0x5355('0x33')][_0x5355('0x40')]){_0x42a218['include']=[{'all':!![]}];}return db[_0x5355('0x2e')][_0x5355('0x41')](_0x42a218);})[_0x5355('0x24')](function(_0x2079d3){_0x354fd2['rows']=_0x2079d3;return _0x354fd2;})[_0x5355('0x24')](respondWithFilteredResult(_0x501c60,_0x42a218))[_0x5355('0x42')](handleError(_0x501c60,null));};exports[_0x5355('0x43')]=function(_0x475b91,_0x537d77){var _0x4eaf56={'raw':![],'where':{'id':_0x475b91[_0x5355('0x44')]['id']}},_0x4fde94={};_0x4fde94[_0x5355('0x32')]=_[_0x5355('0x45')](db['Trigger'][_0x5355('0x46')]);_0x4fde94[_0x5355('0x33')]=_[_0x5355('0x45')](_0x475b91[_0x5355('0x33')]);_0x4fde94['filters']=_[_0x5355('0x34')](_0x4fde94[_0x5355('0x32')],_0x4fde94[_0x5355('0x33')]);_0x4eaf56['attributes']=_[_0x5355('0x34')](_0x4fde94[_0x5355('0x32')],qs[_0x5355('0x36')](_0x475b91[_0x5355('0x33')][_0x5355('0x36')]));_0x4eaf56[_0x5355('0x35')]=_0x4eaf56[_0x5355('0x35')][_0x5355('0x37')]?_0x4eaf56[_0x5355('0x35')]:_0x4fde94['model'];if(_0x475b91[_0x5355('0x33')][_0x5355('0x40')]){_0x4eaf56[_0x5355('0x47')]=[{'all':!![]}];}_0x4eaf56=_[_0x5355('0x3e')]({},_0x4eaf56,_0x475b91['options']);return db[_0x5355('0x2e')][_0x5355('0x48')](_0x4eaf56)[_0x5355('0x24')](handleEntityNotFound(_0x537d77,null))[_0x5355('0x24')](respondWithResult(_0x537d77,null))['catch'](handleError(_0x537d77,null));};exports[_0x5355('0x49')]=function(_0x4e6e92,_0x4cad73){return db[_0x5355('0x2e')][_0x5355('0x49')](_0x4e6e92[_0x5355('0x4a')],{})[_0x5355('0x24')](function(_0x4d0887){var _0x27e3d3=_0x4e6e92[_0x5355('0x4b')][_0x5355('0x25')]({'plain':!![]});if(!_0x27e3d3)throw new Error(_0x5355('0x4c'));if(_0x27e3d3[_0x5355('0x4d')]===_0x5355('0x4b')){var _0x578836=_0x4d0887[_0x5355('0x25')]({'plain':!![]});var _0x575d6b=_0x5355('0x4e');return db['UserProfileSection'][_0x5355('0x48')]({'where':{'name':_0x575d6b,'userProfileId':_0x27e3d3['userProfileId']},'raw':!![]})['then'](function(_0x10f5de){if(_0x10f5de&&_0x10f5de['autoAssociation']===0x0){return db[_0x5355('0x26')][_0x5355('0x49')]({'name':_0x578836[_0x5355('0x2a')],'resourceId':_0x578836['id'],'type':_0x10f5de[_0x5355('0x2a')],'sectionId':_0x10f5de['id']},{})[_0x5355('0x24')](function(){return _0x4d0887;});}else{return _0x4d0887;}})[_0x5355('0x42')](function(_0xf95aa1){logger[_0x5355('0x28')](_0x5355('0x4f'),_0xf95aa1);throw _0xf95aa1;});}return _0x4d0887;})[_0x5355('0x24')](respondWithResult(_0x4cad73,0xc9))['catch'](handleError(_0x4cad73,null));};exports[_0x5355('0x23')]=function(_0x27a63d,_0x5068b7){if(_0x27a63d[_0x5355('0x4a')]['id']){delete _0x27a63d[_0x5355('0x4a')]['id'];}return db[_0x5355('0x2e')][_0x5355('0x48')]({'where':{'id':_0x27a63d[_0x5355('0x44')]['id']}})['then'](handleEntityNotFound(_0x5068b7,null))['then'](saveUpdates(_0x27a63d[_0x5355('0x4a')],null))['then'](respondWithResult(_0x5068b7,null))['catch'](handleError(_0x5068b7,null));};exports[_0x5355('0x27')]=function(_0xa043b6,_0x3ad67e){return db[_0x5355('0x2e')][_0x5355('0x48')]({'where':{'id':_0xa043b6[_0x5355('0x44')]['id']}})[_0x5355('0x24')](handleEntityNotFound(_0x3ad67e,null))[_0x5355('0x24')](removeEntity(_0x3ad67e,null))['catch'](handleError(_0x3ad67e,null));};exports[_0x5355('0x50')]=function(_0x45fbc4,_0x271799,_0x4f936c){if(_0x45fbc4[_0x5355('0x4a')]['id']){delete _0x45fbc4['body']['id'];}return db[_0x5355('0x2e')][_0x5355('0x48')]({'where':{'id':_0x45fbc4[_0x5355('0x44')]['id']}})[_0x5355('0x24')](handleEntityNotFound(_0x271799,null))[_0x5355('0x24')](function(_0x402ee9){if(_0x402ee9){_0x45fbc4[_0x5355('0x4a')][_0x5355('0x51')]=_0x402ee9['id'];return db['Condition']['create'](_0x45fbc4[_0x5355('0x4a')]);}})[_0x5355('0x24')](respondWithResult(_0x271799,null))[_0x5355('0x42')](handleError(_0x271799,null));};exports['addAnyCondition']=function(_0x162c73,_0x4ed28a,_0x5c1759){if(_0x162c73[_0x5355('0x4a')]['id']){delete _0x162c73[_0x5355('0x4a')]['id'];}return db['Trigger'][_0x5355('0x48')]({'where':{'id':_0x162c73[_0x5355('0x44')]['id']}})[_0x5355('0x24')](handleEntityNotFound(_0x4ed28a,null))['then'](function(_0xe5f4cd){if(_0xe5f4cd){_0x162c73[_0x5355('0x4a')][_0x5355('0x52')]=_0xe5f4cd['id'];return db[_0x5355('0x53')][_0x5355('0x49')](_0x162c73[_0x5355('0x4a')]);}})['then'](respondWithResult(_0x4ed28a,null))[_0x5355('0x42')](handleError(_0x4ed28a,null));};exports[_0x5355('0x54')]=function(_0x37b877,_0x26c385,_0x4d371e){var _0x2404e8={};var _0x592227={};var _0x2ae217;var _0x58bf11;return db['Trigger'][_0x5355('0x55')]({'where':{'id':_0x37b877['params']['id']}})[_0x5355('0x24')](handleEntityNotFound(_0x26c385,null))[_0x5355('0x24')](function(_0x504b0d){if(_0x504b0d){_0x2ae217=_0x504b0d;_0x592227[_0x5355('0x32')]=_['keys'](db[_0x5355('0x53')][_0x5355('0x46')]);_0x592227['query']=_[_0x5355('0x45')](_0x37b877['query']);_0x592227[_0x5355('0x3c')]=_['intersection'](_0x592227['model'],_0x592227[_0x5355('0x33')]);_0x2404e8[_0x5355('0x35')]=_['intersection'](_0x592227[_0x5355('0x32')],qs['fields'](_0x37b877['query']['fields']));_0x2404e8[_0x5355('0x35')]=_0x2404e8[_0x5355('0x35')]['length']?_0x2404e8[_0x5355('0x35')]:_0x592227['model'];_0x2404e8[_0x5355('0x38')]=qs['sort'](_0x37b877[_0x5355('0x33')][_0x5355('0x39')]);_0x2404e8[_0x5355('0x3a')]=qs[_0x5355('0x3c')](_['pick'](_0x37b877[_0x5355('0x33')],_0x592227[_0x5355('0x3c')]));if(_0x37b877[_0x5355('0x33')][_0x5355('0x3d')]){_0x2404e8[_0x5355('0x3a')]=_[_0x5355('0x3e')](_0x2404e8[_0x5355('0x3a')],{'$or':_['map'](_0x2404e8[_0x5355('0x35')],function(_0x2b3103){var _0x2c5cfe={};_0x2c5cfe[_0x2b3103]={'$like':'%'+_0x37b877[_0x5355('0x33')][_0x5355('0x3d')]+'%'};return _0x2c5cfe;})});}_0x2404e8=_[_0x5355('0x3e')]({},_0x2404e8,_0x37b877[_0x5355('0x3f')]);return _0x2ae217[_0x5355('0x54')](_0x2404e8);}})[_0x5355('0x24')](function(_0xdfb10a){if(_0xdfb10a){_0x58bf11=_0xdfb10a[_0x5355('0x37')];if(!_0x37b877[_0x5355('0x33')][_0x5355('0x56')](_0x5355('0x57'))){_0x2404e8[_0x5355('0x1d')]=qs['limit'](_0x37b877[_0x5355('0x33')]['limit']);_0x2404e8['offset']=qs[_0x5355('0x1f')](_0x37b877[_0x5355('0x33')][_0x5355('0x1f')]);}return _0x2ae217[_0x5355('0x54')](_0x2404e8);}})[_0x5355('0x24')](function(_0x5b4fdc){if(_0x5b4fdc){return _0x5b4fdc?{'count':_0x58bf11,'rows':_0x5b4fdc}:null;}})[_0x5355('0x24')](respondWithResult(_0x26c385,null))['catch'](handleError(_0x26c385,null));};exports[_0x5355('0x58')]=function(_0x231cb3,_0x173815,_0x28da79){var _0x5b5410={};var _0x14d6e9={};var _0x2cf4ea;var _0x3b3166;return db[_0x5355('0x2e')][_0x5355('0x55')]({'where':{'id':_0x231cb3[_0x5355('0x44')]['id']}})[_0x5355('0x24')](handleEntityNotFound(_0x173815,null))[_0x5355('0x24')](function(_0x34258f){if(_0x34258f){_0x2cf4ea=_0x34258f;_0x14d6e9[_0x5355('0x32')]=_[_0x5355('0x45')](db['Condition'][_0x5355('0x46')]);_0x14d6e9[_0x5355('0x33')]=_['keys'](_0x231cb3[_0x5355('0x33')]);_0x14d6e9[_0x5355('0x3c')]=_[_0x5355('0x34')](_0x14d6e9[_0x5355('0x32')],_0x14d6e9[_0x5355('0x33')]);_0x5b5410[_0x5355('0x35')]=_[_0x5355('0x34')](_0x14d6e9[_0x5355('0x32')],qs[_0x5355('0x36')](_0x231cb3['query'][_0x5355('0x36')]));_0x5b5410[_0x5355('0x35')]=_0x5b5410[_0x5355('0x35')]['length']?_0x5b5410[_0x5355('0x35')]:_0x14d6e9[_0x5355('0x32')];_0x5b5410[_0x5355('0x38')]=qs[_0x5355('0x39')](_0x231cb3[_0x5355('0x33')][_0x5355('0x39')]);_0x5b5410[_0x5355('0x3a')]=qs[_0x5355('0x3c')](_[_0x5355('0x3b')](_0x231cb3['query'],_0x14d6e9[_0x5355('0x3c')]));if(_0x231cb3[_0x5355('0x33')][_0x5355('0x3d')]){_0x5b5410[_0x5355('0x3a')]=_[_0x5355('0x3e')](_0x5b5410[_0x5355('0x3a')],{'$or':_[_0x5355('0x2d')](_0x5b5410[_0x5355('0x35')],function(_0x43ff77){var _0x5af7b9={};_0x5af7b9[_0x43ff77]={'$like':'%'+_0x231cb3[_0x5355('0x33')][_0x5355('0x3d')]+'%'};return _0x5af7b9;})});}_0x5b5410=_['merge']({},_0x5b5410,_0x231cb3[_0x5355('0x3f')]);return _0x2cf4ea['getAnyConditions'](_0x5b5410);}})[_0x5355('0x24')](function(_0x240a1e){if(_0x240a1e){_0x3b3166=_0x240a1e['length'];if(!_0x231cb3[_0x5355('0x33')][_0x5355('0x56')](_0x5355('0x57'))){_0x5b5410[_0x5355('0x1d')]=qs[_0x5355('0x1d')](_0x231cb3[_0x5355('0x33')][_0x5355('0x1d')]);_0x5b5410[_0x5355('0x1f')]=qs['offset'](_0x231cb3[_0x5355('0x33')][_0x5355('0x1f')]);}return _0x2cf4ea[_0x5355('0x58')](_0x5b5410);}})['then'](function(_0x4ee50c){if(_0x4ee50c){return _0x4ee50c?{'count':_0x3b3166,'rows':_0x4ee50c}:null;}})['then'](respondWithResult(_0x173815,null))['catch'](handleError(_0x173815,null));};exports[_0x5355('0x59')]=function(_0x45de75,_0x4bbeb9,_0x2f3bff){if(_0x45de75[_0x5355('0x4a')]['id']){delete _0x45de75[_0x5355('0x4a')]['id'];}return db['Trigger'][_0x5355('0x48')]({'where':{'id':_0x45de75[_0x5355('0x44')]['id']}})[_0x5355('0x24')](handleEntityNotFound(_0x4bbeb9,null))[_0x5355('0x24')](function(_0x395347){if(_0x395347){_0x45de75['body'][_0x5355('0x5a')]=_0x395347['id'];return db['Action']['create'](_0x45de75[_0x5355('0x4a')]);}})[_0x5355('0x24')](respondWithResult(_0x4bbeb9,null))[_0x5355('0x42')](handleError(_0x4bbeb9,null));};exports[_0x5355('0x5b')]=function(_0x497c38,_0x58d138,_0x34cc08){var _0x55d943={};var _0x45ebab={};var _0x3d0b36;var _0x2f1c5e;return db[_0x5355('0x2e')][_0x5355('0x55')]({'where':{'id':_0x497c38[_0x5355('0x44')]['id']}})[_0x5355('0x24')](handleEntityNotFound(_0x58d138,null))[_0x5355('0x24')](function(_0x3b159c){if(_0x3b159c){_0x3d0b36=_0x3b159c;_0x45ebab['model']=_[_0x5355('0x45')](db['Action']['rawAttributes']);_0x45ebab[_0x5355('0x33')]=_['keys'](_0x497c38[_0x5355('0x33')]);_0x45ebab[_0x5355('0x3c')]=_[_0x5355('0x34')](_0x45ebab[_0x5355('0x32')],_0x45ebab[_0x5355('0x33')]);_0x55d943['attributes']=_[_0x5355('0x34')](_0x45ebab[_0x5355('0x32')],qs['fields'](_0x497c38[_0x5355('0x33')][_0x5355('0x36')]));_0x55d943[_0x5355('0x35')]=_0x55d943[_0x5355('0x35')][_0x5355('0x37')]?_0x55d943[_0x5355('0x35')]:_0x45ebab[_0x5355('0x32')];_0x55d943['order']=qs[_0x5355('0x39')](_0x497c38[_0x5355('0x33')][_0x5355('0x39')]);_0x55d943[_0x5355('0x3a')]=qs[_0x5355('0x3c')](_['pick'](_0x497c38[_0x5355('0x33')],_0x45ebab[_0x5355('0x3c')]));if(_0x497c38[_0x5355('0x33')][_0x5355('0x3d')]){_0x55d943[_0x5355('0x3a')]=_[_0x5355('0x3e')](_0x55d943['where'],{'$or':_[_0x5355('0x2d')](_0x55d943['attributes'],function(_0x263269){var _0x1f9af2={};_0x1f9af2[_0x263269]={'$like':'%'+_0x497c38[_0x5355('0x33')][_0x5355('0x3d')]+'%'};return _0x1f9af2;})});}_0x55d943=_['merge']({},_0x55d943,_0x497c38['options']);return _0x3d0b36['getActions'](_0x55d943);}})[_0x5355('0x24')](function(_0x49ed5b){if(_0x49ed5b){_0x2f1c5e=_0x49ed5b[_0x5355('0x37')];if(!_0x497c38[_0x5355('0x33')]['hasOwnProperty'](_0x5355('0x57'))){_0x55d943[_0x5355('0x1d')]=qs[_0x5355('0x1d')](_0x497c38[_0x5355('0x33')]['limit']);_0x55d943[_0x5355('0x1f')]=qs['offset'](_0x497c38['query'][_0x5355('0x1f')]);}return _0x3d0b36[_0x5355('0x5b')](_0x55d943);}})[_0x5355('0x24')](function(_0x19f4e8){if(_0x19f4e8){return _0x19f4e8?{'count':_0x2f1c5e,'rows':_0x19f4e8}:null;}})[_0x5355('0x24')](respondWithResult(_0x58d138,null))[_0x5355('0x42')](handleError(_0x58d138,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 492b915..42616af 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 _0xf4d9=['./trigger.attributes','define','tools_triggers','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2c8099,_0xbaba59){var _0x11f346=function(_0x6fe3c8){while(--_0x6fe3c8){_0x2c8099['push'](_0x2c8099['shift']());}};_0x11f346(++_0xbaba59);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x1245c3,_0x3d5351){_0x1245c3=_0x1245c3-0x0;var _0x47ba48=_0xf4d9[_0x1245c3];return _0x47ba48;};'use strict';var _=require(_0x9f4d('0x0'));var util=require('util');var logger=require(_0x9f4d('0x1'))(_0x9f4d('0x2'));var moment=require(_0x9f4d('0x3'));var BPromise=require(_0x9f4d('0x4'));var rp=require(_0x9f4d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f4d('0x6'));var config=require(_0x9f4d('0x7'));var attributes=require(_0x9f4d('0x8'));module['exports']=function(_0x191f1c,_0x370059){return _0x191f1c[_0x9f4d('0x9')]('Trigger',attributes,{'tableName':_0x9f4d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5455=['util','../../config/logger','api','moment','bluebird','request-promise','path','./trigger.attributes','exports','define','Trigger'];(function(_0x17f57a,_0x302cee){var _0x4e24fd=function(_0x5a2f7b){while(--_0x5a2f7b){_0x17f57a['push'](_0x17f57a['shift']());}};_0x4e24fd(++_0x302cee);}(_0x5455,0x197));var _0x5545=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5455[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0x5545('0x0'));var logger=require(_0x5545('0x1'))(_0x5545('0x2'));var moment=require(_0x5545('0x3'));var BPromise=require(_0x5545('0x4'));var rp=require(_0x5545('0x5'));var fs=require('fs');var path=require(_0x5545('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5545('0x7'));module[_0x5545('0x8')]=function(_0x5c22f1,_0x5a6ac7){return _0x5c22f1[_0x5545('0x9')](_0x5545('0xa'),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 f3aa5eb..1c647b6 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 _0xba79=['error','code','message','Trigger,\x20%s,\x20%s','info','catch','GetTrigger','Trigger','options','raw','where','attributes','limit','include','model','map','debug','find','ShowTrigger','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xba79,0x153));var _0x9ba7=function(_0x51b51a,_0x2f156c){_0x51b51a=_0x51b51a-0x0;var _0x40bcd6=_0xba79[_0x51b51a];return _0x40bcd6;};'use strict';var _=require(_0x9ba7('0x0'));var util=require(_0x9ba7('0x1'));var moment=require(_0x9ba7('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ba7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9ba7('0x4'));var logger=require(_0x9ba7('0x5'))(_0x9ba7('0x6'));var config=require(_0x9ba7('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c10fa,_0x13ebfa,_0x5e90f8){return new BPromise(function(_0x118de6,_0xb43f3d){return client[_0x9ba7('0x8')](_0x1c10fa,_0x5e90f8)[_0x9ba7('0x9')](function(_0x15869d){logger['info']('Trigger,\x20%s,\x20%s',_0x13ebfa,'request\x20sent');logger['debug'](_0x9ba7('0xa'),_0x13ebfa,_0x9ba7('0xb'),JSON[_0x9ba7('0xc')](_0x15869d));if(_0x15869d[_0x9ba7('0xd')]){if(_0x15869d[_0x9ba7('0xd')][_0x9ba7('0xe')]===0x1f4){logger[_0x9ba7('0xd')]('Trigger,\x20%s,\x20%s',_0x13ebfa,_0x15869d[_0x9ba7('0xd')]['message']);return _0xb43f3d(_0x15869d['error'][_0x9ba7('0xf')]);}logger['error'](_0x9ba7('0x10'),_0x13ebfa,_0x15869d[_0x9ba7('0xd')][_0x9ba7('0xf')]);return _0x118de6(_0x15869d[_0x9ba7('0xd')]['message']);}else{logger[_0x9ba7('0x11')](_0x9ba7('0x10'),_0x13ebfa,_0x9ba7('0xb'));_0x118de6(_0x15869d['result'][_0x9ba7('0xf')]);}})[_0x9ba7('0x12')](function(_0xb06eb1){logger[_0x9ba7('0xd')]('Trigger,\x20%s,\x20%s',_0x13ebfa,_0xb06eb1);_0xb43f3d(_0xb06eb1);});});}exports[_0x9ba7('0x13')]=function(_0x4144d0){var _0x3ce66a=this;return new Promise(function(_0x1e8b39,_0x547352){return db[_0x9ba7('0x14')]['findAll']({'raw':_0x4144d0['options']?_0x4144d0[_0x9ba7('0x15')][_0x9ba7('0x16')]===undefined?!![]:![]:!![],'where':_0x4144d0[_0x9ba7('0x15')]?_0x4144d0[_0x9ba7('0x15')][_0x9ba7('0x17')]||null:null,'attributes':_0x4144d0[_0x9ba7('0x15')]?_0x4144d0[_0x9ba7('0x15')][_0x9ba7('0x18')]||null:null,'limit':_0x4144d0[_0x9ba7('0x15')]?_0x4144d0[_0x9ba7('0x15')][_0x9ba7('0x19')]||null:null,'include':_0x4144d0[_0x9ba7('0x15')]?_0x4144d0['options']['include']?_['map'](_0x4144d0['options'][_0x9ba7('0x1a')],function(_0x285374){return{'model':db[_0x285374[_0x9ba7('0x1b')]],'as':_0x285374['as'],'attributes':_0x285374[_0x9ba7('0x18')],'include':_0x285374[_0x9ba7('0x1a')]?_[_0x9ba7('0x1c')](_0x285374[_0x9ba7('0x1a')],function(_0x3ac188){return{'model':db[_0x3ac188['model']],'as':_0x3ac188['as'],'attributes':_0x3ac188[_0x9ba7('0x18')],'include':_0x3ac188[_0x9ba7('0x1a')]?_[_0x9ba7('0x1c')](_0x3ac188['include'],function(_0x425397){return{'model':db[_0x425397['model']],'as':_0x425397['as'],'attributes':_0x425397[_0x9ba7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57cbd6){logger['info'](_0x9ba7('0x13'),_0x4144d0);logger[_0x9ba7('0x1d')](_0x9ba7('0x13'),_0x4144d0,JSON[_0x9ba7('0xc')](_0x57cbd6));_0x1e8b39(_0x57cbd6);})['catch'](function(_0x270da2){logger[_0x9ba7('0xd')](_0x9ba7('0x13'),_0x270da2[_0x9ba7('0xf')],_0x4144d0);_0x547352(_0x3ce66a[_0x9ba7('0xd')](0x1f4,_0x270da2['message']));});});};exports['ShowTrigger']=function(_0x13d1ed){var _0x5314a9=this;return new Promise(function(_0x54a5c4,_0x553799){return db[_0x9ba7('0x14')][_0x9ba7('0x1e')]({'raw':_0x13d1ed[_0x9ba7('0x15')]?_0x13d1ed['options'][_0x9ba7('0x16')]===undefined?!![]:![]:!![],'where':_0x13d1ed['options']?_0x13d1ed[_0x9ba7('0x15')]['where']||null:null,'attributes':_0x13d1ed['options']?_0x13d1ed['options'][_0x9ba7('0x18')]||null:null,'include':_0x13d1ed[_0x9ba7('0x15')]?_0x13d1ed[_0x9ba7('0x15')][_0x9ba7('0x1a')]?_[_0x9ba7('0x1c')](_0x13d1ed[_0x9ba7('0x15')][_0x9ba7('0x1a')],function(_0x588378){return{'model':db[_0x588378['model']],'as':_0x588378['as'],'attributes':_0x588378['attributes'],'include':_0x588378['include']?_[_0x9ba7('0x1c')](_0x588378['include'],function(_0x378b42){return{'model':db[_0x378b42[_0x9ba7('0x1b')]],'as':_0x378b42['as'],'attributes':_0x378b42['attributes'],'include':_0x378b42[_0x9ba7('0x1a')]?_[_0x9ba7('0x1c')](_0x378b42[_0x9ba7('0x1a')],function(_0x2ac067){return{'model':db[_0x2ac067[_0x9ba7('0x1b')]],'as':_0x2ac067['as'],'attributes':_0x2ac067['attributes']};}):[]};}):[]};}):[]:[]})[_0x9ba7('0x9')](function(_0x124f37){logger[_0x9ba7('0x11')]('ShowTrigger',_0x13d1ed);logger[_0x9ba7('0x1d')](_0x9ba7('0x1f'),_0x13d1ed,JSON[_0x9ba7('0xc')](_0x124f37));_0x54a5c4(_0x124f37);})[_0x9ba7('0x12')](function(_0x1dc06a){logger[_0x9ba7('0xd')](_0x9ba7('0x1f'),_0x1dc06a[_0x9ba7('0xf')],_0x13d1ed);_0x553799(_0x5314a9[_0x9ba7('0xd')](0x1f4,_0x1dc06a[_0x9ba7('0xf')]));});});}; \ No newline at end of file +var _0xaa1e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','result','catch','Trigger','findAll','options','raw','where','attributes','include','map','model','then','GetTrigger','ShowTrigger','debug','lodash','util','moment'];(function(_0x13d4b8,_0x15415d){var _0x3d3aac=function(_0x375975){while(--_0x375975){_0x13d4b8['push'](_0x13d4b8['shift']());}};_0x3d3aac(++_0x15415d);}(_0xaa1e,0x100));var _0xeaa1=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0xaa1e[_0x187279];return _0x3da59d;};'use strict';var _=require(_0xeaa1('0x0'));var util=require(_0xeaa1('0x1'));var moment=require(_0xeaa1('0x2'));var BPromise=require(_0xeaa1('0x3'));var rs=require(_0xeaa1('0x4'));var fs=require('fs');var Redis=require(_0xeaa1('0x5'));var db=require(_0xeaa1('0x6'))['db'];var utils=require(_0xeaa1('0x7'));var logger=require(_0xeaa1('0x8'))(_0xeaa1('0x9'));var config=require('../../config/environment');var jayson=require(_0xeaa1('0xa'));var client=jayson[_0xeaa1('0xb')][_0xeaa1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x326f2f,_0x4f9661,_0x5192cc){return new BPromise(function(_0x111f46,_0x4e5faf){return client[_0xeaa1('0xd')](_0x326f2f,_0x5192cc)['then'](function(_0xc96815){logger['info'](_0xeaa1('0xe'),_0x4f9661,_0xeaa1('0xf'));logger['debug'](_0xeaa1('0x10'),_0x4f9661,_0xeaa1('0xf'),JSON[_0xeaa1('0x11')](_0xc96815));if(_0xc96815['error']){if(_0xc96815['error'][_0xeaa1('0x12')]===0x1f4){logger['error'](_0xeaa1('0xe'),_0x4f9661,_0xc96815['error']['message']);return _0x4e5faf(_0xc96815['error'][_0xeaa1('0x13')]);}logger[_0xeaa1('0x14')](_0xeaa1('0xe'),_0x4f9661,_0xc96815[_0xeaa1('0x14')]['message']);return _0x111f46(_0xc96815['error']['message']);}else{logger[_0xeaa1('0x15')](_0xeaa1('0xe'),_0x4f9661,'request\x20sent');_0x111f46(_0xc96815[_0xeaa1('0x16')][_0xeaa1('0x13')]);}})[_0xeaa1('0x17')](function(_0x432543){logger[_0xeaa1('0x14')]('Trigger,\x20%s,\x20%s',_0x4f9661,_0x432543);_0x4e5faf(_0x432543);});});}exports['GetTrigger']=function(_0x40a413){var _0x3a403c=this;return new Promise(function(_0x5aae66,_0x156a57){return db[_0xeaa1('0x18')][_0xeaa1('0x19')]({'raw':_0x40a413[_0xeaa1('0x1a')]?_0x40a413['options'][_0xeaa1('0x1b')]===undefined?!![]:![]:!![],'where':_0x40a413[_0xeaa1('0x1a')]?_0x40a413['options'][_0xeaa1('0x1c')]||null:null,'attributes':_0x40a413[_0xeaa1('0x1a')]?_0x40a413['options'][_0xeaa1('0x1d')]||null:null,'limit':_0x40a413[_0xeaa1('0x1a')]?_0x40a413['options']['limit']||null:null,'include':_0x40a413[_0xeaa1('0x1a')]?_0x40a413['options'][_0xeaa1('0x1e')]?_[_0xeaa1('0x1f')](_0x40a413[_0xeaa1('0x1a')][_0xeaa1('0x1e')],function(_0x207b19){return{'model':db[_0x207b19['model']],'as':_0x207b19['as'],'attributes':_0x207b19[_0xeaa1('0x1d')],'include':_0x207b19[_0xeaa1('0x1e')]?_['map'](_0x207b19['include'],function(_0x2da351){return{'model':db[_0x2da351[_0xeaa1('0x20')]],'as':_0x2da351['as'],'attributes':_0x2da351[_0xeaa1('0x1d')],'include':_0x2da351[_0xeaa1('0x1e')]?_[_0xeaa1('0x1f')](_0x2da351[_0xeaa1('0x1e')],function(_0x54ffb7){return{'model':db[_0x54ffb7[_0xeaa1('0x20')]],'as':_0x54ffb7['as'],'attributes':_0x54ffb7[_0xeaa1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeaa1('0x21')](function(_0x777cd1){logger['info'](_0xeaa1('0x22'),_0x40a413);logger['debug'](_0xeaa1('0x22'),_0x40a413,JSON[_0xeaa1('0x11')](_0x777cd1));_0x5aae66(_0x777cd1);})['catch'](function(_0x59ae03){logger[_0xeaa1('0x14')](_0xeaa1('0x22'),_0x59ae03[_0xeaa1('0x13')],_0x40a413);_0x156a57(_0x3a403c[_0xeaa1('0x14')](0x1f4,_0x59ae03[_0xeaa1('0x13')]));});});};exports[_0xeaa1('0x23')]=function(_0xeb90c9){var _0x28178f=this;return new Promise(function(_0x2c1570,_0x221246){return db[_0xeaa1('0x18')]['find']({'raw':_0xeb90c9[_0xeaa1('0x1a')]?_0xeb90c9['options']['raw']===undefined?!![]:![]:!![],'where':_0xeb90c9[_0xeaa1('0x1a')]?_0xeb90c9['options']['where']||null:null,'attributes':_0xeb90c9[_0xeaa1('0x1a')]?_0xeb90c9['options'][_0xeaa1('0x1d')]||null:null,'include':_0xeb90c9[_0xeaa1('0x1a')]?_0xeb90c9[_0xeaa1('0x1a')]['include']?_[_0xeaa1('0x1f')](_0xeb90c9[_0xeaa1('0x1a')][_0xeaa1('0x1e')],function(_0x39c309){return{'model':db[_0x39c309[_0xeaa1('0x20')]],'as':_0x39c309['as'],'attributes':_0x39c309['attributes'],'include':_0x39c309[_0xeaa1('0x1e')]?_[_0xeaa1('0x1f')](_0x39c309[_0xeaa1('0x1e')],function(_0xa781ed){return{'model':db[_0xa781ed[_0xeaa1('0x20')]],'as':_0xa781ed['as'],'attributes':_0xa781ed[_0xeaa1('0x1d')],'include':_0xa781ed[_0xeaa1('0x1e')]?_[_0xeaa1('0x1f')](_0xa781ed['include'],function(_0x5e4103){return{'model':db[_0x5e4103[_0xeaa1('0x20')]],'as':_0x5e4103['as'],'attributes':_0x5e4103[_0xeaa1('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42e51c){logger[_0xeaa1('0x15')](_0xeaa1('0x23'),_0xeb90c9);logger[_0xeaa1('0x24')](_0xeaa1('0x23'),_0xeb90c9,JSON[_0xeaa1('0x11')](_0x42e51c));_0x2c1570(_0x42e51c);})[_0xeaa1('0x17')](function(_0x597f28){logger[_0xeaa1('0x14')](_0xeaa1('0x23'),_0x597f28[_0xeaa1('0x13')],_0xeb90c9);_0x221246(_0x28178f[_0xeaa1('0x14')](0x1f4,_0x597f28[_0xeaa1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index bee5b2d..29f2d9a 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 _0xe76f=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','update','delete','/:id','destroy'];(function(_0x3789b9,_0x5c2f00){var _0x4d020d=function(_0x170650){while(--_0x170650){_0x3789b9['push'](_0x3789b9['shift']());}};_0x4d020d(++_0x5c2f00);}(_0xe76f,0x17d));var _0xfe76=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xe76f[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0xfe76('0x0'));var util=require(_0xfe76('0x1'));var path=require(_0xfe76('0x2'));var timeout=require(_0xfe76('0x3'));var express=require(_0xfe76('0x4'));var router=express['Router']();var fs_extra=require(_0xfe76('0x5'));var auth=require(_0xfe76('0x6'));var interaction=require(_0xfe76('0x7'));var config=require('../../config/environment');var controller=require('./trunk.controller');router[_0xfe76('0x8')]('/',auth[_0xfe76('0x9')](),controller[_0xfe76('0xa')]);router[_0xfe76('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xfe76('0xb')]);router['post']('/:id/clone',auth[_0xfe76('0x9')](),controller['clone']);router[_0xfe76('0xc')]('/',auth[_0xfe76('0x9')](),controller['create']);router[_0xfe76('0xd')]('/:id',auth[_0xfe76('0x9')](),controller[_0xfe76('0xe')]);router[_0xfe76('0xf')](_0xfe76('0x10'),auth[_0xfe76('0x9')](),controller[_0xfe76('0x11')]);module[_0xfe76('0x12')]=router; \ No newline at end of file +var _0x0aeb=['get','isAuthenticated','index','/:id','/:id/clone','clone','post','create','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller'];(function(_0x14271b,_0x303f86){var _0x2d8f24=function(_0x2bc179){while(--_0x2bc179){_0x14271b['push'](_0x14271b['shift']());}};_0x2d8f24(++_0x303f86);}(_0x0aeb,0x13d));var _0xb0ae=function(_0x16a7cb,_0x292bd8){_0x16a7cb=_0x16a7cb-0x0;var _0x2915b7=_0x0aeb[_0x16a7cb];return _0x2915b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb0ae('0x0'));var timeout=require(_0xb0ae('0x1'));var express=require('express');var router=express[_0xb0ae('0x2')]();var fs_extra=require(_0xb0ae('0x3'));var auth=require(_0xb0ae('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb0ae('0x5'));var controller=require(_0xb0ae('0x6'));router[_0xb0ae('0x7')]('/',auth[_0xb0ae('0x8')](),controller[_0xb0ae('0x9')]);router[_0xb0ae('0x7')](_0xb0ae('0xa'),auth[_0xb0ae('0x8')](),controller['show']);router['post'](_0xb0ae('0xb'),auth[_0xb0ae('0x8')](),controller[_0xb0ae('0xc')]);router[_0xb0ae('0xd')]('/',auth[_0xb0ae('0x8')](),controller[_0xb0ae('0xe')]);router['put'](_0xb0ae('0xa'),auth[_0xb0ae('0x8')](),controller[_0xb0ae('0xf')]);router['delete']('/:id',auth[_0xb0ae('0x8')](),controller[_0xb0ae('0x10')]);module[_0xb0ae('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 2a5500c..be0f2be 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 _0xddb9=['getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','passive','actpass','dynamic','sequelize','exports','name','ENUM','friend','user','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xddb9,0x88));var _0x9ddb=function(_0x38fb7a,_0x3b3f40){_0x38fb7a=_0x38fb7a-0x0;var _0x139937=_0xddb9[_0x38fb7a];return _0x139937;};'use strict';var Sequelize=require(_0x9ddb('0x0'));module[_0x9ddb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9ddb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x4'),_0x9ddb('0x5'),'peer'),'allowNull':![],'defaultValue':_0x9ddb('0x4')},'context':{'type':Sequelize[_0x9ddb('0x6')],'allowNull':![],'defaultValue':_0x9ddb('0x7')},'callingpres':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x8'),_0x9ddb('0x9'),_0x9ddb('0xa'),_0x9ddb('0xb'),_0x9ddb('0xc'),_0x9ddb('0xd'),_0x9ddb('0xe'),_0x9ddb('0xf'))},'deny':{'type':Sequelize[_0x9ddb('0x6')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x9ddb('0x6')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x9ddb('0x6')]},'transport':{'type':Sequelize[_0x9ddb('0x6')],'defaultValue':_0x9ddb('0x10'),'set':function(_0x3fd0d8){this[_0x9ddb('0x11')](_0x9ddb('0x12'),_0x3fd0d8?_0x3fd0d8[_0x9ddb('0x13')](','):null);},'get':function(){return this[_0x9ddb('0x14')](_0x9ddb('0x12'))?this['getDataValue'](_0x9ddb('0x12'))[_0x9ddb('0x15')](','):null;},'comment':_0x9ddb('0x16')},'dtmfmode':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x17'),_0x9ddb('0x18'),'shortinfo',_0x9ddb('0x19'),_0x9ddb('0x1a')),'defaultValue':_0x9ddb('0x17')},'directmedia':{'type':Sequelize[_0x9ddb('0x3')]('yes','no',_0x9ddb('0x1b'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9ddb('0x6')]},'directmediadeny':{'type':Sequelize[_0x9ddb('0x6')]},'nat':{'type':Sequelize[_0x9ddb('0x6')],'defaultValue':_0x9ddb('0x1d'),'set':function(_0x5b896d){this['setDataValue']('nat',_0x5b896d?_0x5b896d[_0x9ddb('0x13')](','):null);},'get':function(){return this[_0x9ddb('0x14')](_0x9ddb('0x1e'))?this[_0x9ddb('0x14')]('nat')['split'](','):null;},'comment':_0x9ddb('0x1f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9ddb('0x6')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9ddb('0x6')]},'language':{'type':Sequelize[_0x9ddb('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9ddb('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9ddb('0x6')],'defaultValue':_0x9ddb('0x20')},'allow':{'type':Sequelize[_0x9ddb('0x6')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x581b79){this[_0x9ddb('0x11')]('allow',_0x581b79?_0x581b79[_0x9ddb('0x13')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9ddb('0x14')]('allow')?this['getDataValue'](_0x9ddb('0x21'))[_0x9ddb('0x15')](';'):null;},'comment':_0x9ddb('0x22')},'autoframing':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no')},'insecure':{'type':Sequelize[_0x9ddb('0x6')],'defaultValue':_0x9ddb('0x23'),'set':function(_0x216938){this[_0x9ddb('0x11')](_0x9ddb('0x24'),_0x216938?_0x216938[_0x9ddb('0x13')](','):null);},'get':function(){return this[_0x9ddb('0x14')](_0x9ddb('0x24'))?this[_0x9ddb('0x14')](_0x9ddb('0x24'))[_0x9ddb('0x15')](','):null;},'comment':_0x9ddb('0x25')},'trustrpid':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no',_0x9ddb('0x26'))},'promiscredir':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x9ddb('0x1c'),'no')},'accountcode':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'setvar':{'type':Sequelize[_0x9ddb('0x6')]},'callerid':{'type':Sequelize[_0x9ddb('0x6')],'defaultValue':_0x9ddb('0x28')},'amaflags':{'type':Sequelize[_0x9ddb('0x6')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x9ddb('0x1c')},'busylevel':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x9ddb('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x9ddb('0x1c'),'no')},'subscribecontext':{'type':Sequelize[_0x9ddb('0x6')]},'template':{'type':Sequelize[_0x9ddb('0x6')]},'videosupport':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no')},'mailbox':{'type':Sequelize[_0x9ddb('0x6')]},'session_timers':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x29'),_0x9ddb('0x2a'),_0x9ddb('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x9ddb('0x2c'),_0x9ddb('0x2d')),'defaultValue':_0x9ddb('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x9ddb('0x6')]},'regexten':{'type':Sequelize[_0x9ddb('0x6')]},'fromdomain':{'type':Sequelize[_0x9ddb('0x6')]},'fromuser':{'type':Sequelize[_0x9ddb('0x6')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no'),'defaultValue':_0x9ddb('0x1c')},'keepalive':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x9ddb('0x6')]},'rtptimeout':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x9ddb('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9ddb('0x6')]},'callbackextension':{'type':Sequelize[_0x9ddb('0x6')]},'timert1':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'timerb':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x9ddb('0x6')]},'contactdeny':{'type':Sequelize[_0x9ddb('0x6')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x9ddb('0x6')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'encryption':{'type':Sequelize[_0x9ddb('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x9ddb('0x1c'),'no')},'force_avp':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no')},'icesupport':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no')},'dtlsenable':{'type':Sequelize[_0x9ddb('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no',_0x9ddb('0x2f'),_0x9ddb('0x30'))},'dtlsrekey':{'type':Sequelize[_0x9ddb('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9ddb('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x9ddb('0x6')]},'dtlscipher':{'type':Sequelize[_0x9ddb('0x6')]},'dtlscafile':{'type':Sequelize[_0x9ddb('0x6')]},'dtlscapath':{'type':Sequelize[_0x9ddb('0x6')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x9ddb('0x31'),_0x9ddb('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9ddb('0x6')]},'usereqphone':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9ddb('0x6')]},'recordofffeature':{'type':Sequelize[_0x9ddb('0x6')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9ddb('0x3')](_0x9ddb('0x1c'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x9ddb('0x6')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x9ddb('0x6')]},'description':{'type':Sequelize[_0x9ddb('0x6')]},'host':{'type':Sequelize[_0x9ddb('0x6')],'defaultValue':_0x9ddb('0x33')},'canreinvite':{'type':Sequelize['ENUM'](_0x9ddb('0x1c'),'no','nonat','update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9ddb('0x6')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9ddb('0x6')],'defaultValue':'no'}}; \ No newline at end of file +var _0x4707=['actpass','dynamic','BOOLEAN','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','nonat','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','certificate','active','passive'];(function(_0x503f4d,_0x476e97){var _0x4ce6d1=function(_0x17b5fc){while(--_0x17b5fc){_0x503f4d['push'](_0x503f4d['shift']());}};_0x4ce6d1(++_0x476e97);}(_0x4707,0x13e));var _0x7470=function(_0x17650a,_0x381b6e){_0x17650a=_0x17650a-0x0;var _0x2c4aef=_0x4707[_0x17650a];return _0x2c4aef;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7470('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x2'),'user',_0x7470('0x3')),'allowNull':![],'defaultValue':_0x7470('0x2')},'context':{'type':Sequelize[_0x7470('0x4')],'allowNull':![],'defaultValue':_0x7470('0x5')},'callingpres':{'type':Sequelize[_0x7470('0x1')]('ALLOWED_NOT_SCREENED',_0x7470('0x6'),_0x7470('0x7'),_0x7470('0x8'),_0x7470('0x9'),_0x7470('0xa'),_0x7470('0xb'),_0x7470('0xc'))},'deny':{'type':Sequelize[_0x7470('0x4')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x7470('0x4')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x7470('0x4')]},'transport':{'type':Sequelize[_0x7470('0x4')],'defaultValue':'udp','set':function(_0x3af22f){this['setDataValue'](_0x7470('0xd'),_0x3af22f?_0x3af22f[_0x7470('0xe')](','):null);},'get':function(){return this[_0x7470('0xf')](_0x7470('0xd'))?this[_0x7470('0xf')](_0x7470('0xd'))[_0x7470('0x10')](','):null;},'comment':_0x7470('0x11')},'dtmfmode':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x12'),'info',_0x7470('0x13'),'inband',_0x7470('0x14')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no',_0x7470('0x16'),'update',_0x7470('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7470('0x1')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x7470('0x4')]},'nat':{'type':Sequelize[_0x7470('0x4')],'defaultValue':'force_rport,comedia','set':function(_0x45bc9f){this['setDataValue']('nat',_0x45bc9f?_0x45bc9f[_0x7470('0xe')](','):null);},'get':function(){return this[_0x7470('0xf')](_0x7470('0x18'))?this['getDataValue'](_0x7470('0x18'))[_0x7470('0x10')](','):null;},'comment':_0x7470('0x19')},'callgroup':{'type':Sequelize[_0x7470('0x4')]},'namedcallgroup':{'type':Sequelize[_0x7470('0x4')]},'pickupgroup':{'type':Sequelize[_0x7470('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x7470('0x4')]},'language':{'type':Sequelize[_0x7470('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7470('0x4')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7470('0x4')],'defaultValue':_0x7470('0x1a')},'allow':{'type':Sequelize[_0x7470('0x4')],'allowNull':![],'defaultValue':_0x7470('0x1b'),'set':function(_0x4d6888){this['setDataValue'](_0x7470('0x1c'),_0x4d6888?_0x4d6888[_0x7470('0xe')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x7470('0xf')](_0x7470('0x1c'))?this[_0x7470('0xf')](_0x7470('0x1c'))[_0x7470('0x10')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x7470('0x1d'),'set':function(_0x46d7b8){this['setDataValue'](_0x7470('0x1e'),_0x46d7b8?_0x46d7b8[_0x7470('0xe')](','):null);},'get':function(){return this[_0x7470('0xf')](_0x7470('0x1e'))?this['getDataValue'](_0x7470('0x1e'))[_0x7470('0x10')](','):null;},'comment':_0x7470('0x1f')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no','never')},'promiscredir':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x7470('0x15'),'no')},'accountcode':{'type':Sequelize[_0x7470('0x20')](0xb)},'setvar':{'type':Sequelize[_0x7470('0x4')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x7470('0x21')},'amaflags':{'type':Sequelize[_0x7470('0x4')]},'callcounter':{'type':Sequelize[_0x7470('0x1')]('yes','no'),'defaultValue':_0x7470('0x15')},'busylevel':{'type':Sequelize[_0x7470('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x7470('0x1')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7470('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x7470('0x4')]},'template':{'type':Sequelize[_0x7470('0x4')]},'videosupport':{'type':Sequelize[_0x7470('0x1')]('yes','no',_0x7470('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0x7470('0x23'),'refuse',_0x7470('0x24'))},'session_expires':{'type':Sequelize[_0x7470('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x7470('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x25'),_0x7470('0x26')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x7470('0x4')]},'regexten':{'type':Sequelize[_0x7470('0x4')]},'fromdomain':{'type':Sequelize[_0x7470('0x4')]},'fromuser':{'type':Sequelize[_0x7470('0x4')]},'port':{'type':Sequelize[_0x7470('0x20')](0x5)},'qualify':{'type':Sequelize[_0x7470('0x1')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x7470('0x4')]},'defaultuser':{'type':Sequelize[_0x7470('0x4')]},'rtptimeout':{'type':Sequelize[_0x7470('0x20')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7470('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x7470('0x20')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x7470('0x20')](0xb)},'contactpermit':{'type':Sequelize[_0x7470('0x4')]},'contactdeny':{'type':Sequelize[_0x7470('0x4')]},'contactacl':{'type':Sequelize[_0x7470('0x4')]},'unsolicited_mailbox':{'type':Sequelize[_0x7470('0x4')]},'use_q850_reason':{'type':Sequelize[_0x7470('0x4')]},'maxforwards':{'type':Sequelize[_0x7470('0x20')](0xb)},'encryption':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no')},'force_avp':{'type':Sequelize[_0x7470('0x1')]('yes','no')},'icesupport':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x7470('0x1')]('yes','no','fingerprint',_0x7470('0x27'))},'dtlsrekey':{'type':Sequelize[_0x7470('0x20')](0xb)},'dtlscertfile':{'type':Sequelize[_0x7470('0x4')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x7470('0x4')]},'dtlscafile':{'type':Sequelize[_0x7470('0x4')]},'dtlscapath':{'type':Sequelize[_0x7470('0x4')]},'dtlssetup':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x28'),_0x7470('0x29'),_0x7470('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x7470('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x7470('0x4')]},'call_limit':{'type':Sequelize[_0x7470('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0x7470('0x1')](_0x7470('0x15'),'no')},'vmexten':{'type':Sequelize[_0x7470('0x4')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7470('0x4')]},'host':{'type':Sequelize[_0x7470('0x4')],'defaultValue':_0x7470('0x2b')},'canreinvite':{'type':Sequelize['ENUM'](_0x7470('0x15'),'no',_0x7470('0x16'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7470('0x4')]},'otherFields':{'type':Sequelize[_0x7470('0x4')]},'active':{'type':Sequelize[_0x7470('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7470('0x4')],'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 54b180d..88e5e44 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 _0x55ca=['catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','send','Trunk','rawAttributes','type','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','length','options','find','clone','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','Reload','chan_sip.so','readFileSync','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x483e25,_0x4ad841){var _0x48a61b=function(_0x30b0e3){while(--_0x30b0e3){_0x483e25['push'](_0x483e25['shift']());}};_0x48a61b(++_0x4ad841);}(_0x55ca,0x126));var _0xa55c=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x55ca[_0x154192];return _0x3c2792;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x576044,_0x5a3672,_0x59ea8d,_0x18ee85){return new BPromise(function(_0x3930e4,_0x462cd6){var _0x938bd6=_0x18ee85||client;return _0x938bd6[_0xa55c('0x19')](_0x576044,_0x59ea8d)[_0xa55c('0x1a')](function(_0x4e0b2f){logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,_0xa55c('0x1d'));logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x5a3672,_0xa55c('0x1d'),JSON[_0xa55c('0x20')](_0x4e0b2f));if(_0x4e0b2f[_0xa55c('0x21')]){if(_0x4e0b2f[_0xa55c('0x21')]['code']===0x1f4){logger[_0xa55c('0x21')](_0xa55c('0x1c'),_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x462cd6(_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x3930e4(_0x4e0b2f[_0xa55c('0x21')]['message']);}else{logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,'request\x20sent');_0x3930e4(_0x4e0b2f[_0xa55c('0x23')][_0xa55c('0x22')]);}})[_0xa55c('0x24')](function(_0x1965f1){logger[_0xa55c('0x21')]('Trunk,\x20%s,\x20%s',_0x5a3672,_0x1965f1);_0x462cd6(_0x1965f1);});});}function respondWithStatusCode(_0x1fc828,_0x504c24){_0x504c24=_0x504c24||0xcc;return function(_0x5ba836){if(_0x5ba836){return _0x1fc828['sendStatus'](_0x504c24);}return _0x1fc828[_0xa55c('0x25')](_0x504c24)['end']();};}function respondWithResult(_0x3ecbe7,_0x190757){_0x190757=_0x190757||0xc8;return function(_0x3f64de){if(_0x3f64de){return _0x3ecbe7[_0xa55c('0x25')](_0x190757)[_0xa55c('0x26')](_0x3f64de);}};}function respondWithFilteredResult(_0x170ba4,_0x1da633){return function(_0x11e7f7){if(_0x11e7f7){var _0x192df2=typeof _0x1da633[_0xa55c('0x27')]===_0xa55c('0x28')&&typeof _0x1da633['limit']===_0xa55c('0x28');var _0x28814f=_0x11e7f7[_0xa55c('0x29')];var _0x906caa=_0x192df2?0x0:_0x1da633['offset'];var _0x1377b0=_0x192df2?_0x11e7f7[_0xa55c('0x29')]:_0x1da633[_0xa55c('0x27')]+_0x1da633[_0xa55c('0x2a')];var _0x45ee8d;if(_0x1377b0>=_0x28814f){_0x1377b0=_0x28814f;_0x45ee8d=0xc8;}else{_0x45ee8d=0xce;}_0x170ba4[_0xa55c('0x25')](_0x45ee8d);return _0x170ba4['set'](_0xa55c('0x2b'),_0x906caa+'-'+_0x1377b0+'/'+_0x28814f)['json'](_0x11e7f7);}return null;};}function patchUpdates(_0x35c9c2){return function(_0x1d730b){try{jsonpatch[_0xa55c('0x2c')](_0x1d730b,_0x35c9c2,!![]);}catch(_0x223813){return BPromise['reject'](_0x223813);}return _0x1d730b[_0xa55c('0x2d')]();};}function saveUpdates(_0x2096ae,_0x331e58){return function(_0x20da31){if(_0x20da31){return _0x20da31[_0xa55c('0x2e')](_0x2096ae)[_0xa55c('0x1a')](function(_0x29748a){return _0x29748a;});}return null;};}function removeEntity(_0x24d44d,_0x2808e9){return function(_0xcbaf2e){if(_0xcbaf2e){return _0xcbaf2e[_0xa55c('0x2f')]()['then'](function(){var _0x54ca97=_0xcbaf2e[_0xa55c('0x30')]({'plain':!![]});var _0x19733e='Trunks';return db[_0xa55c('0x31')][_0xa55c('0x2f')]({'where':{'type':_0x19733e,'resourceId':_0x54ca97['id']}})[_0xa55c('0x1a')](function(){return _0xcbaf2e;});})[_0xa55c('0x1a')](function(){_0x24d44d[_0xa55c('0x25')](0xcc)[_0xa55c('0x32')]();});}};}function handleEntityNotFound(_0x3ce1b3,_0x222d4b){return function(_0x3959e3){if(!_0x3959e3){_0x3ce1b3['sendStatus'](0x194);}return _0x3959e3;};}function handleError(_0x5f3e99,_0x4b23d3){_0x4b23d3=_0x4b23d3||0x1f4;return function(_0x3fd75f){logger[_0xa55c('0x21')](_0x3fd75f[_0xa55c('0x33')]);if(_0x3fd75f['name']){delete _0x3fd75f[_0xa55c('0x34')];}_0x5f3e99['status'](_0x4b23d3)[_0xa55c('0x35')](_0x3fd75f);};}exports['index']=function(_0x18c6f1,_0x39267c){var _0x3c0ec1={},_0x4d3eb5={},_0x7c4a47={'count':0x0,'rows':[]};var _0x30f23b=_['map'](db[_0xa55c('0x36')][_0xa55c('0x37')],function(_0x4d9083){return{'name':_0x4d9083['fieldName'],'type':_0x4d9083[_0xa55c('0x38')]['key']};});_0x4d3eb5[_0xa55c('0x39')]=_[_0xa55c('0x3a')](_0x30f23b,'name');_0x4d3eb5['query']=_['keys'](_0x18c6f1['query']);_0x4d3eb5[_0xa55c('0x3b')]=_[_0xa55c('0x3c')](_0x4d3eb5[_0xa55c('0x39')],_0x4d3eb5[_0xa55c('0x3d')]);_0x3c0ec1[_0xa55c('0x3e')]=_['intersection'](_0x4d3eb5[_0xa55c('0x39')],qs[_0xa55c('0x3f')](_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x3f')]));_0x3c0ec1[_0xa55c('0x3e')]=_0x3c0ec1[_0xa55c('0x3e')]['length']?_0x3c0ec1[_0xa55c('0x3e')]:_0x4d3eb5['model'];if(!_0x18c6f1['query'][_0xa55c('0x40')](_0xa55c('0x41'))){_0x3c0ec1['limit']=qs[_0xa55c('0x2a')](_0x18c6f1['query']['limit']);_0x3c0ec1[_0xa55c('0x27')]=qs[_0xa55c('0x27')](_0x18c6f1[_0xa55c('0x3d')]['offset']);}_0x3c0ec1[_0xa55c('0x42')]=qs[_0xa55c('0x43')](_0x18c6f1['query'][_0xa55c('0x43')]);_0x3c0ec1['where']=qs[_0xa55c('0x3b')](_[_0xa55c('0x44')](_0x18c6f1['query'],_0x4d3eb5[_0xa55c('0x3b')]),_0x30f23b);if(_0x18c6f1[_0xa55c('0x3d')]['filter']){_0x3c0ec1[_0xa55c('0x45')]=_[_0xa55c('0x46')](_0x3c0ec1[_0xa55c('0x45')],{'$or':_['map'](_0x30f23b,function(_0x334f52){if(_0x334f52['type']!==_0xa55c('0x47')){var _0x3a8af4={};_0x3a8af4[_0x334f52[_0xa55c('0x34')]]={'$like':'%'+_0x18c6f1['query'][_0xa55c('0x48')]+'%'};return _0x3a8af4;}})});}_0x3c0ec1=_[_0xa55c('0x46')]({},_0x3c0ec1,_0x18c6f1['options']);var _0x3d19f5={'where':_0x3c0ec1[_0xa55c('0x45')]};return db['Trunk'][_0xa55c('0x29')](_0x3d19f5)[_0xa55c('0x1a')](function(_0x52f9a7){_0x7c4a47[_0xa55c('0x29')]=_0x52f9a7;if(_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x49')]){_0x3c0ec1[_0xa55c('0x4a')]=[{'all':!![]}];}return db['Trunk'][_0xa55c('0x4b')](_0x3c0ec1);})['then'](function(_0x2157d6){_0x7c4a47[_0xa55c('0x4c')]=_0x2157d6;return _0x7c4a47;})[_0xa55c('0x1a')](respondWithFilteredResult(_0x39267c,_0x3c0ec1))['catch'](handleError(_0x39267c,null));};exports[_0xa55c('0x4d')]=function(_0x250b00,_0x574fe9){var _0x5be06={'raw':![],'where':{'id':_0x250b00[_0xa55c('0x4e')]['id']}},_0x34de95={};_0x34de95[_0xa55c('0x39')]=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x34de95[_0xa55c('0x3d')]=_[_0xa55c('0x4f')](_0x250b00[_0xa55c('0x3d')]);_0x34de95['filters']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],_0x34de95[_0xa55c('0x3d')]);_0x5be06['attributes']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],qs['fields'](_0x250b00[_0xa55c('0x3d')]['fields']));_0x5be06[_0xa55c('0x3e')]=_0x5be06[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x5be06[_0xa55c('0x3e')]:_0x34de95[_0xa55c('0x39')];if(_0x250b00['query'][_0xa55c('0x49')]){_0x5be06[_0xa55c('0x4a')]=[{'all':!![]}];}_0x5be06=_['merge']({},_0x5be06,_0x250b00[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x5be06)[_0xa55c('0x1a')](handleEntityNotFound(_0x574fe9,null))['then'](respondWithResult(_0x574fe9,null))['catch'](handleError(_0x574fe9,null));};exports[_0xa55c('0x53')]=function(_0x250dea,_0x3ca5b8){var _0x44ac57={'where':{'id':_0x250dea[_0xa55c('0x4e')]['id']}},_0x54cbde={};_0x54cbde['model']=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x44ac57[_0xa55c('0x3e')]=_[_0xa55c('0x3c')](_0x54cbde['model'],qs[_0xa55c('0x3f')](_0x250dea['query'][_0xa55c('0x3f')]));_0x44ac57[_0xa55c('0x3e')]=_0x44ac57[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x44ac57[_0xa55c('0x3e')]:_0x54cbde[_0xa55c('0x39')];if(_0x250dea[_0xa55c('0x3d')]['includeAll']){_0x44ac57[_0xa55c('0x4a')]=[{'all':!![]}];}_0x44ac57=_[_0xa55c('0x46')]({},_0x44ac57,_0x250dea[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x44ac57)['then'](handleEntityNotFound(_0x3ca5b8,null))[_0xa55c('0x1a')](function(_0x3cd40d){if(_0x3cd40d){var _0x28bac4=_0x3cd40d[_0xa55c('0x30')]({'plain':!![]});_0x28bac4=qs[_0xa55c('0x54')](_0x28bac4,['id','createdAt',_0xa55c('0x55')]);_0x250dea[_0xa55c('0x56')]=_[_0xa55c('0x54')](_0x250dea[_0xa55c('0x56')],['id',_0xa55c('0x57'),'updatedAt']);return db[_0xa55c('0x36')]['create'](_[_0xa55c('0x46')](_0x28bac4,_0x250dea['body']),{'include':_0x250dea[_0xa55c('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x1a')](function(_0x1333da){var _0x21d6b4=_0x250dea[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x21d6b4)throw new Error(_0xa55c('0x59'));if(_0x21d6b4[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0x14b515=_0x1333da[_0xa55c('0x30')]({'plain':!![]});var _0x51c736=_0xa55c('0x5b');return db[_0xa55c('0x5c')]['find']({'where':{'name':_0x51c736,'userProfileId':_0x21d6b4[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x3e3b4b){if(_0x3e3b4b&&_0x3e3b4b[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')][_0xa55c('0x5f')]({'name':_0x14b515[_0xa55c('0x34')],'resourceId':_0x14b515['id'],'type':_0x3e3b4b[_0xa55c('0x34')],'sectionId':_0x3e3b4b['id']},{})['then'](function(){return _0x1333da;});}else{return _0x1333da;}})[_0xa55c('0x24')](function(_0x475131){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x475131);throw _0x475131;});}return _0x1333da;});}})[_0xa55c('0x1a')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x24')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x5f')]=function(_0x4249c1,_0x25d5a1,_0x4a08ca){var _0x347562;return db[_0xa55c('0x36')][_0xa55c('0x5f')](_0x4249c1[_0xa55c('0x56')],{'raw':!![]})[_0xa55c('0x1a')](function(_0x10e711){_0x347562=_0x10e711;return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x3178a6){var _0x3bbc4b=fs['readFileSync'](path[_0xa55c('0x61')](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0x129bb4=fs['readFileSync'](path['join'](config[_0xa55c('0x64')],_0xa55c('0x65')),_0xa55c('0x63'));var _0x42529f=ejs['render'](_0x3bbc4b,{'trunks':_0x3178a6||[]});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x42529f);if(_0x347562[_0xa55c('0x68')]){var _0x3a9910=ejs[_0xa55c('0x69')](_0x129bb4,{'trunks':_0x3178a6||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x3a9910);}})[_0xa55c('0x1a')](function(){return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x5f'),{'module':_0xa55c('0x6b')});})[_0xa55c('0x1a')](function(){var _0x4b2032=_0x4249c1[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x4b2032)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b2032[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0xa340fb=_0x347562['get']({'plain':!![]});return db[_0xa55c('0x5c')][_0xa55c('0x52')]({'where':{'name':_0xa55c('0x5b'),'userProfileId':_0x4b2032[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x506f74){if(_0x506f74&&_0x506f74[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')]['create']({'name':_0xa340fb['name'],'resourceId':_0xa340fb['id'],'type':_0x506f74[_0xa55c('0x34')],'sectionId':_0x506f74['id']},{})['then'](function(){return _0x347562;});}else{return _0x347562;}})[_0xa55c('0x24')](function(_0x5ca0bc){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x5ca0bc);throw _0x5ca0bc;});}return _0x347562;})[_0xa55c('0x1a')](respondWithResult(_0x25d5a1,0xc9))[_0xa55c('0x24')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x2e')]=function(_0xff7b1c,_0x16dfc6,_0x5d8551){var _0x463195;return db[_0xa55c('0x36')][_0xa55c('0x52')]({'where':{'id':_0xff7b1c[_0xa55c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x16dfc6,null))[_0xa55c('0x1a')](saveUpdates(_0xff7b1c[_0xa55c('0x56')],null))[_0xa55c('0x1a')](function(_0x2298ac){if(_0x2298ac){_0x463195=_0x2298ac;return db['Trunk']['findAll']({'raw':!![]});}})[_0xa55c('0x1a')](function(_0x428872){if(_0x428872){var _0x12e3a8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0xd33c9c=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x65')),'utf8');var _0x19497b=ejs['render'](_0x12e3a8,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x19497b);var _0x36ded7=ejs[_0xa55c('0x69')](_0xd33c9c,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x36ded7);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2e'),{'module':_0xa55c('0x6b')});}return null;})[_0xa55c('0x1a')](function(_0x576a1b){if(_0x576a1b){return _0x463195;}})['then'](respondWithResult(_0x16dfc6,null))[_0xa55c('0x24')](handleError(_0x16dfc6,null));};exports[_0xa55c('0x2f')]=function(_0xc2ad5c,_0x256db0,_0x1622cb){var _0x137728;return db['Trunk'][_0xa55c('0x52')]({'where':{'id':_0xc2ad5c[_0xa55c('0x4e')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x256db0,null))[_0xa55c('0x1a')](removeEntity(_0x256db0,null))[_0xa55c('0x1a')](function(){return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x58b670){var _0x25d09d=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x62')),'utf8');var _0x2685d8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x65')),_0xa55c('0x63'));var _0x5c2229=ejs['render'](_0x25d09d,{'trunks':_0x58b670});var _0x579726=ejs['render'](_0x2685d8,{'trunks':_0x58b670});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x5c2229);fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x579726);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2f'),{'module':'chan_sip.so'});})[_0xa55c('0x24')](handleError(_0x256db0,null));}; \ No newline at end of file +var _0x9c44=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','clone','find','omit','createdAt','body','updatedAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','/etc/asterisk/sip_xcally_registers.conf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','get','Trunks','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type'];(function(_0xaee9b2,_0x4f74cf){var _0x8c26c1=function(_0x252b5a){while(--_0x252b5a){_0xaee9b2['push'](_0xaee9b2['shift']());}};_0x8c26c1(++_0x4f74cf);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x16')][_0x49c4('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fd9,_0x1909fe,_0x280996,_0x21f15a){return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c=_0x21f15a||client;return _0x18211c[_0x49c4('0x18')](_0x5f2fd9,_0x280996)[_0x49c4('0x19')](function(_0x58d177){logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));logger[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x1909fe,'request\x20sent',JSON[_0x49c4('0x1f')](_0x58d177));if(_0x58d177[_0x49c4('0x20')]){if(_0x58d177['error']['code']===0x1f4){logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')]['message']);return _0x12777c(_0x58d177[_0x49c4('0x20')]['message']);}logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);return _0x2decee(_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);}else{logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));_0x2decee(_0x58d177['result']['message']);}})['catch'](function(_0x1c99b1){logger['error']('Trunk,\x20%s,\x20%s',_0x1909fe,_0x1c99b1);_0x12777c(_0x1c99b1);});});}function respondWithStatusCode(_0x2263ae,_0x15581b){_0x15581b=_0x15581b||0xcc;return function(_0x26c640){if(_0x26c640){return _0x2263ae[_0x49c4('0x22')](_0x15581b);}return _0x2263ae['status'](_0x15581b)['end']();};}function respondWithResult(_0x180276,_0x9cb797){_0x9cb797=_0x9cb797||0xc8;return function(_0x565423){if(_0x565423){return _0x180276[_0x49c4('0x23')](_0x9cb797)[_0x49c4('0x24')](_0x565423);}};}function respondWithFilteredResult(_0x210159,_0xa7a826){return function(_0x531d92){if(_0x531d92){var _0x543ea2=typeof _0xa7a826[_0x49c4('0x25')]==='undefined'&&typeof _0xa7a826[_0x49c4('0x26')]===_0x49c4('0x27');var _0x3f1708=_0x531d92[_0x49c4('0x28')];var _0x5987ae=_0x543ea2?0x0:_0xa7a826[_0x49c4('0x25')];var _0x2b2793=_0x543ea2?_0x531d92[_0x49c4('0x28')]:_0xa7a826[_0x49c4('0x25')]+_0xa7a826[_0x49c4('0x26')];var _0x29f835;if(_0x2b2793>=_0x3f1708){_0x2b2793=_0x3f1708;_0x29f835=0xc8;}else{_0x29f835=0xce;}_0x210159[_0x49c4('0x23')](_0x29f835);return _0x210159[_0x49c4('0x29')](_0x49c4('0x2a'),_0x5987ae+'-'+_0x2b2793+'/'+_0x3f1708)[_0x49c4('0x24')](_0x531d92);}return null;};}function patchUpdates(_0x46f7ea){return function(_0x4ea6ea){try{jsonpatch['apply'](_0x4ea6ea,_0x46f7ea,!![]);}catch(_0x59eb84){return BPromise[_0x49c4('0x2b')](_0x59eb84);}return _0x4ea6ea[_0x49c4('0x2c')]();};}function saveUpdates(_0x1eb035,_0x27e467){return function(_0x28eb47){if(_0x28eb47){return _0x28eb47['update'](_0x1eb035)[_0x49c4('0x19')](function(_0x116eb4){return _0x116eb4;});}return null;};}function removeEntity(_0x2e7a69,_0x24bba9){return function(_0x58e252){if(_0x58e252){return _0x58e252['destroy']()[_0x49c4('0x19')](function(){var _0x9a1bed=_0x58e252[_0x49c4('0x2d')]({'plain':!![]});var _0x13b3b4=_0x49c4('0x2e');return db['UserProfileResource'][_0x49c4('0x2f')]({'where':{'type':_0x13b3b4,'resourceId':_0x9a1bed['id']}})[_0x49c4('0x19')](function(){return _0x58e252;});})[_0x49c4('0x19')](function(){_0x2e7a69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x85dce2,_0x1991e9){return function(_0x3bec0a){if(!_0x3bec0a){_0x85dce2[_0x49c4('0x22')](0x194);}return _0x3bec0a;};}function handleError(_0x2b45a1,_0x2cf897){_0x2cf897=_0x2cf897||0x1f4;return function(_0x1d1557){logger[_0x49c4('0x20')](_0x1d1557[_0x49c4('0x30')]);if(_0x1d1557['name']){delete _0x1d1557[_0x49c4('0x31')];}_0x2b45a1['status'](_0x2cf897)[_0x49c4('0x32')](_0x1d1557);};}exports[_0x49c4('0x33')]=function(_0x2625a6,_0x1c2830){var _0x4ed4f8={},_0x335f0c={},_0x31f3ff={'count':0x0,'rows':[]};var _0x1c910a=_['map'](db[_0x49c4('0x34')][_0x49c4('0x35')],function(_0x178987){return{'name':_0x178987[_0x49c4('0x36')],'type':_0x178987[_0x49c4('0x37')][_0x49c4('0x38')]};});_0x335f0c[_0x49c4('0x39')]=_[_0x49c4('0x3a')](_0x1c910a,_0x49c4('0x31'));_0x335f0c[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2625a6['query']);_0x335f0c[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],_0x335f0c[_0x49c4('0x3b')]);_0x4ed4f8[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x4ed4f8[_0x49c4('0x3f')]=_0x4ed4f8[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x4ed4f8['attributes']:_0x335f0c[_0x49c4('0x39')];if(!_0x2625a6['query'][_0x49c4('0x42')](_0x49c4('0x43'))){_0x4ed4f8[_0x49c4('0x26')]=qs[_0x49c4('0x26')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x26')]);_0x4ed4f8['offset']=qs['offset'](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x25')]);}_0x4ed4f8[_0x49c4('0x44')]=qs[_0x49c4('0x45')](_0x2625a6['query'][_0x49c4('0x45')]);_0x4ed4f8[_0x49c4('0x46')]=qs[_0x49c4('0x3d')](_[_0x49c4('0x47')](_0x2625a6[_0x49c4('0x3b')],_0x335f0c[_0x49c4('0x3d')]),_0x1c910a);if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x48')]){_0x4ed4f8[_0x49c4('0x46')]=_['merge'](_0x4ed4f8[_0x49c4('0x46')],{'$or':_['map'](_0x1c910a,function(_0x33696e){if(_0x33696e[_0x49c4('0x37')]!==_0x49c4('0x49')){var _0x258abe={};_0x258abe[_0x33696e[_0x49c4('0x31')]]={'$like':'%'+_0x2625a6['query'][_0x49c4('0x48')]+'%'};return _0x258abe;}})});}_0x4ed4f8=_[_0x49c4('0x4a')]({},_0x4ed4f8,_0x2625a6[_0x49c4('0x4b')]);var _0x254d07={'where':_0x4ed4f8[_0x49c4('0x46')]};return db[_0x49c4('0x34')][_0x49c4('0x28')](_0x254d07)['then'](function(_0x3bac1b){_0x31f3ff['count']=_0x3bac1b;if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x4c')]){_0x4ed4f8[_0x49c4('0x4d')]=[{'all':!![]}];}return db[_0x49c4('0x34')][_0x49c4('0x4e')](_0x4ed4f8);})[_0x49c4('0x19')](function(_0x2c6be1){_0x31f3ff['rows']=_0x2c6be1;return _0x31f3ff;})[_0x49c4('0x19')](respondWithFilteredResult(_0x1c2830,_0x4ed4f8))[_0x49c4('0x4f')](handleError(_0x1c2830,null));};exports['show']=function(_0x1e1ac4,_0xaece5f){var _0xfbe179={'raw':![],'where':{'id':_0x1e1ac4['params']['id']}},_0x242afc={};_0x242afc['model']=_[_0x49c4('0x3c')](db['Trunk'][_0x49c4('0x35')]);_0x242afc[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x1e1ac4[_0x49c4('0x3b')]);_0x242afc[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],_0x242afc['query']);_0xfbe179[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x1e1ac4[_0x49c4('0x3b')][_0x49c4('0x40')]));_0xfbe179[_0x49c4('0x3f')]=_0xfbe179[_0x49c4('0x3f')][_0x49c4('0x41')]?_0xfbe179[_0x49c4('0x3f')]:_0x242afc['model'];if(_0x1e1ac4['query'][_0x49c4('0x4c')]){_0xfbe179[_0x49c4('0x4d')]=[{'all':!![]}];}_0xfbe179=_['merge']({},_0xfbe179,_0x1e1ac4['options']);return db[_0x49c4('0x34')]['find'](_0xfbe179)['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x19')](respondWithResult(_0xaece5f,null))[_0x49c4('0x4f')](handleError(_0xaece5f,null));};exports[_0x49c4('0x50')]=function(_0x38c480,_0x2884ca){var _0x16949a={'where':{'id':_0x38c480['params']['id']}},_0x35724e={};_0x35724e[_0x49c4('0x39')]=_[_0x49c4('0x3c')](db[_0x49c4('0x34')][_0x49c4('0x35')]);_0x16949a[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x35724e['model'],qs['fields'](_0x38c480[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x16949a[_0x49c4('0x3f')]=_0x16949a[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x16949a[_0x49c4('0x3f')]:_0x35724e[_0x49c4('0x39')];if(_0x38c480['query'][_0x49c4('0x4c')]){_0x16949a[_0x49c4('0x4d')]=[{'all':!![]}];}_0x16949a=_['merge']({},_0x16949a,_0x38c480[_0x49c4('0x4b')]);return db['Trunk'][_0x49c4('0x51')](_0x16949a)[_0x49c4('0x19')](handleEntityNotFound(_0x2884ca,null))[_0x49c4('0x19')](function(_0x2fe89a){if(_0x2fe89a){var _0x845f7e=_0x2fe89a[_0x49c4('0x2d')]({'plain':!![]});_0x845f7e=qs[_0x49c4('0x52')](_0x845f7e,['id',_0x49c4('0x53'),'updatedAt']);_0x38c480[_0x49c4('0x54')]=_[_0x49c4('0x52')](_0x38c480['body'],['id',_0x49c4('0x53'),_0x49c4('0x55')]);return db['Trunk'][_0x49c4('0x56')](_[_0x49c4('0x4a')](_0x845f7e,_0x38c480['body']),{'include':_0x38c480['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc43386){var _0x54947d=_0x38c480[_0x49c4('0x57')][_0x49c4('0x2d')]({'plain':!![]});if(!_0x54947d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54947d[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x5ac9f0=_0xc43386[_0x49c4('0x2d')]({'plain':!![]});var _0x3dcf4c=_0x49c4('0x2e');return db[_0x49c4('0x59')]['find']({'where':{'name':_0x3dcf4c,'userProfileId':_0x54947d[_0x49c4('0x5a')]},'raw':!![]})[_0x49c4('0x19')](function(_0x3cc604){if(_0x3cc604&&_0x3cc604[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x5ac9f0['name'],'resourceId':_0x5ac9f0['id'],'type':_0x3cc604['name'],'sectionId':_0x3cc604['id']},{})['then'](function(){return _0xc43386;});}else{return _0xc43386;}})['catch'](function(_0x302251){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x302251);throw _0x302251;});}return _0xc43386;});}})[_0x49c4('0x19')](respondWithResult(_0x2884ca,0xc9))['catch'](handleError(_0x2884ca,null));};exports['create']=function(_0x340523,_0x109b81,_0x342326){var _0x295ad0;return db[_0x49c4('0x34')][_0x49c4('0x56')](_0x340523[_0x49c4('0x54')],{'raw':!![]})[_0x49c4('0x19')](function(_0x4d49e0){_0x295ad0=_0x4d49e0;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x264902){var _0x1a5d4c=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x13d951=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x2d5f63=ejs[_0x49c4('0x63')](_0x1a5d4c,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x2d5f63);if(_0x295ad0['registry']){var _0x5ec201=ejs[_0x49c4('0x63')](_0x13d951,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x5ec201);}})[_0x49c4('0x19')](function(){return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x56'),{'module':_0x49c4('0x67')});})['then'](function(){var _0x5a14a5=_0x340523['user'][_0x49c4('0x2d')]({'plain':!![]});if(!_0x5a14a5)throw new Error(_0x49c4('0x68'));if(_0x5a14a5[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x118fc4=_0x295ad0[_0x49c4('0x2d')]({'plain':!![]});return db[_0x49c4('0x59')][_0x49c4('0x51')]({'where':{'name':_0x49c4('0x2e'),'userProfileId':_0x5a14a5['userProfileId']},'raw':!![]})[_0x49c4('0x19')](function(_0x10fb84){if(_0x10fb84&&_0x10fb84[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x118fc4[_0x49c4('0x31')],'resourceId':_0x118fc4['id'],'type':_0x10fb84[_0x49c4('0x31')],'sectionId':_0x10fb84['id']},{})[_0x49c4('0x19')](function(){return _0x295ad0;});}else{return _0x295ad0;}})[_0x49c4('0x4f')](function(_0x2fd749){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x2fd749);throw _0x2fd749;});}return _0x295ad0;})['then'](respondWithResult(_0x109b81,0xc9))[_0x49c4('0x4f')](handleError(_0x109b81,null));};exports[_0x49c4('0x69')]=function(_0x85540f,_0x18e82b,_0x1e948a){var _0x4a204d;return db['Trunk'][_0x49c4('0x51')]({'where':{'id':_0x85540f['params']['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x18e82b,null))['then'](saveUpdates(_0x85540f[_0x49c4('0x54')],null))[_0x49c4('0x19')](function(_0x3b03dd){if(_0x3b03dd){_0x4a204d=_0x3b03dd;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});}})[_0x49c4('0x19')](function(_0x38d7d3){if(_0x38d7d3){var _0x2ceada=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x46477f=fs[_0x49c4('0x5d')](path['join'](config[_0x49c4('0x5f')],_0x49c4('0x62')),'utf8');var _0x15bee0=ejs['render'](_0x2ceada,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x15bee0);var _0x1f14a6=ejs[_0x49c4('0x63')](_0x46477f,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x1f14a6);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x69'),{'module':'chan_sip.so'});}return null;})[_0x49c4('0x19')](function(_0x167e41){if(_0x167e41){return _0x4a204d;}})['then'](respondWithResult(_0x18e82b,null))[_0x49c4('0x4f')](handleError(_0x18e82b,null));};exports[_0x49c4('0x2f')]=function(_0x57b137,_0x37fef1,_0x993d00){var _0x25989a;return db[_0x49c4('0x34')]['find']({'where':{'id':_0x57b137[_0x49c4('0x6a')]['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x37fef1,null))['then'](removeEntity(_0x37fef1,null))[_0x49c4('0x19')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x507078){var _0x50fd24=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config['root'],_0x49c4('0x60')),'utf8');var _0x578f4b=fs['readFileSync'](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x4a5f0b=ejs['render'](_0x50fd24,{'trunks':_0x507078});var _0x348693=ejs['render'](_0x578f4b,{'trunks':_0x507078});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a5f0b);fs[_0x49c4('0x64')](_0x49c4('0x6b'),_0x348693);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x2f'),{'module':_0x49c4('0x67')});})[_0x49c4('0x4f')](handleError(_0x37fef1,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 0766109..c120f02 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 _0xa60e=['path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util','../../config/logger','moment'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa60e,0xce));var _0xea60=function(_0x5c5406,_0x481887){_0x5c5406=_0x5c5406-0x0;var _0x20aaa8=_0xa60e[_0x5c5406];return _0x20aaa8;};'use strict';var _=require('lodash');var util=require(_0xea60('0x0'));var logger=require(_0xea60('0x1'))('api');var moment=require(_0xea60('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xea60('0x3'));var rimraf=require(_0xea60('0x4'));var config=require(_0xea60('0x5'));var attributes=require(_0xea60('0x6'));module[_0xea60('0x7')]=function(_0x1d7283,_0x240c42){return _0x1d7283[_0xea60('0x8')](_0xea60('0x9'),attributes,{'tableName':_0xea60('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18f9=['define','tools_trunks','api','moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0x1f28aa,_0x2b89d4){var _0x256ae5=function(_0x3154b8){while(--_0x3154b8){_0x1f28aa['push'](_0x1f28aa['shift']());}};_0x256ae5(++_0x2b89d4);}(_0x18f9,0x19c));var _0x918f=function(_0x101134,_0x1ed1d3){_0x101134=_0x101134-0x0;var _0xc47acc=_0x18f9[_0x101134];return _0xc47acc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x918f('0x0'));var moment=require(_0x918f('0x1'));var BPromise=require('bluebird');var rp=require(_0x918f('0x2'));var fs=require('fs');var path=require(_0x918f('0x3'));var rimraf=require(_0x918f('0x4'));var config=require(_0x918f('0x5'));var attributes=require(_0x918f('0x6'));module[_0x918f('0x7')]=function(_0x25b68c,_0x127b62){return _0x25b68c[_0x918f('0x8')]('Trunk',attributes,{'tableName':_0x918f('0x9'),'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 7a57e66..a82d361 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 _0x85a7=['then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','debug','find','raw','ShowTrunk','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1e6b8f,_0x6ff9a6){var _0x552c45=function(_0x1dc6ec){while(--_0x1dc6ec){_0x1e6b8f['push'](_0x1e6b8f['shift']());}};_0x552c45(++_0x6ff9a6);}(_0x85a7,0x180));var _0x785a=function(_0x45a18f,_0x432a93){_0x45a18f=_0x45a18f-0x0;var _0x45cbf6=_0x85a7[_0x45a18f];return _0x45cbf6;};'use strict';var _=require('lodash');var util=require(_0x785a('0x0'));var moment=require(_0x785a('0x1'));var BPromise=require(_0x785a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x785a('0x3'));var db=require(_0x785a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x785a('0x5'))(_0x785a('0x6'));var config=require(_0x785a('0x7'));var jayson=require(_0x785a('0x8'));var client=jayson[_0x785a('0x9')][_0x785a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cdf8c,_0x2af811,_0x3ad4ec){return new BPromise(function(_0x55d8a1,_0x4fdd42){return client[_0x785a('0xb')](_0x2cdf8c,_0x3ad4ec)[_0x785a('0xc')](function(_0x54cede){logger[_0x785a('0xd')]('Trunk,\x20%s,\x20%s',_0x2af811,_0x785a('0xe'));logger['debug'](_0x785a('0xf'),_0x2af811,'request\x20sent',JSON['stringify'](_0x54cede));if(_0x54cede[_0x785a('0x10')]){if(_0x54cede[_0x785a('0x10')][_0x785a('0x11')]===0x1f4){logger[_0x785a('0x10')]('Trunk,\x20%s,\x20%s',_0x2af811,_0x54cede[_0x785a('0x10')][_0x785a('0x12')]);return _0x4fdd42(_0x54cede['error'][_0x785a('0x12')]);}logger[_0x785a('0x10')](_0x785a('0x13'),_0x2af811,_0x54cede[_0x785a('0x10')][_0x785a('0x12')]);return _0x55d8a1(_0x54cede[_0x785a('0x10')][_0x785a('0x12')]);}else{logger[_0x785a('0xd')](_0x785a('0x13'),_0x2af811,_0x785a('0xe'));_0x55d8a1(_0x54cede['result'][_0x785a('0x12')]);}})[_0x785a('0x14')](function(_0x37236a){logger[_0x785a('0x10')]('Trunk,\x20%s,\x20%s',_0x2af811,_0x37236a);_0x4fdd42(_0x37236a);});});}exports[_0x785a('0x15')]=function(_0x1b7742){var _0x117e58=this;return new Promise(function(_0x281876,_0x42cf0a){return db[_0x785a('0x16')][_0x785a('0x17')]({'raw':_0x1b7742[_0x785a('0x18')]?_0x1b7742[_0x785a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1b7742['options']?_0x1b7742['options'][_0x785a('0x19')]||null:null,'attributes':_0x1b7742[_0x785a('0x18')]?_0x1b7742[_0x785a('0x18')][_0x785a('0x1a')]||null:null,'limit':_0x1b7742[_0x785a('0x18')]?_0x1b7742[_0x785a('0x18')][_0x785a('0x1b')]||null:null,'include':_0x1b7742[_0x785a('0x18')]?_0x1b7742[_0x785a('0x18')][_0x785a('0x1c')]?_[_0x785a('0x1d')](_0x1b7742[_0x785a('0x18')][_0x785a('0x1c')],function(_0x438d49){return{'model':db[_0x438d49[_0x785a('0x1e')]],'as':_0x438d49['as'],'attributes':_0x438d49[_0x785a('0x1a')],'include':_0x438d49['include']?_[_0x785a('0x1d')](_0x438d49[_0x785a('0x1c')],function(_0x1c7cf5){return{'model':db[_0x1c7cf5[_0x785a('0x1e')]],'as':_0x1c7cf5['as'],'attributes':_0x1c7cf5[_0x785a('0x1a')],'include':_0x1c7cf5[_0x785a('0x1c')]?_[_0x785a('0x1d')](_0x1c7cf5[_0x785a('0x1c')],function(_0x233cae){return{'model':db[_0x233cae[_0x785a('0x1e')]],'as':_0x233cae['as'],'attributes':_0x233cae[_0x785a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x785a('0xc')](function(_0x3d62c3){logger[_0x785a('0xd')](_0x785a('0x15'),_0x1b7742);logger[_0x785a('0x1f')](_0x785a('0x15'),_0x1b7742,JSON['stringify'](_0x3d62c3));_0x281876(_0x3d62c3);})[_0x785a('0x14')](function(_0x3466be){logger[_0x785a('0x10')]('GetTrunk',_0x3466be[_0x785a('0x12')],_0x1b7742);_0x42cf0a(_0x117e58[_0x785a('0x10')](0x1f4,_0x3466be[_0x785a('0x12')]));});});};exports['ShowTrunk']=function(_0x10f29e){var _0xe923f3=this;return new Promise(function(_0x1b8f79,_0x2088b7){return db[_0x785a('0x16')][_0x785a('0x20')]({'raw':_0x10f29e[_0x785a('0x18')]?_0x10f29e[_0x785a('0x18')][_0x785a('0x21')]===undefined?!![]:![]:!![],'where':_0x10f29e[_0x785a('0x18')]?_0x10f29e[_0x785a('0x18')][_0x785a('0x19')]||null:null,'attributes':_0x10f29e[_0x785a('0x18')]?_0x10f29e['options'][_0x785a('0x1a')]||null:null,'include':_0x10f29e['options']?_0x10f29e[_0x785a('0x18')][_0x785a('0x1c')]?_[_0x785a('0x1d')](_0x10f29e['options']['include'],function(_0x2079d5){return{'model':db[_0x2079d5['model']],'as':_0x2079d5['as'],'attributes':_0x2079d5[_0x785a('0x1a')],'include':_0x2079d5[_0x785a('0x1c')]?_[_0x785a('0x1d')](_0x2079d5[_0x785a('0x1c')],function(_0x1f9fa4){return{'model':db[_0x1f9fa4[_0x785a('0x1e')]],'as':_0x1f9fa4['as'],'attributes':_0x1f9fa4['attributes'],'include':_0x1f9fa4[_0x785a('0x1c')]?_[_0x785a('0x1d')](_0x1f9fa4[_0x785a('0x1c')],function(_0x85d290){return{'model':db[_0x85d290[_0x785a('0x1e')]],'as':_0x85d290['as'],'attributes':_0x85d290['attributes']};}):[]};}):[]};}):[]:[]})[_0x785a('0xc')](function(_0x3596a9){logger[_0x785a('0xd')](_0x785a('0x22'),_0x10f29e);logger['debug'](_0x785a('0x22'),_0x10f29e,JSON[_0x785a('0x23')](_0x3596a9));_0x1b8f79(_0x3596a9);})[_0x785a('0x14')](function(_0x9ec050){logger['error'](_0x785a('0x22'),_0x9ec050['message'],_0x10f29e);_0x2088b7(_0xe923f3[_0x785a('0x10')](0x1f4,_0x9ec050[_0x785a('0x12')]));});});}; \ No newline at end of file +var _0xa6f6=['options','raw','where','limit','include','map','model','attributes','ShowTrunk','find','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa6f6,0x13c));var _0x6a6f=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xa6f6[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0x6a6f('0x0'));var util=require(_0x6a6f('0x1'));var moment=require(_0x6a6f('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a6f('0x5'))('rpc');var config=require(_0x6a6f('0x6'));var jayson=require(_0x6a6f('0x7'));var client=jayson['client'][_0x6a6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x240406,_0x4d73b1,_0x1c9efd){return new BPromise(function(_0x335954,_0x22ccc0){return client['request'](_0x240406,_0x1c9efd)[_0x6a6f('0x9')](function(_0x1a489b){logger[_0x6a6f('0xa')](_0x6a6f('0xb'),_0x4d73b1,_0x6a6f('0xc'));logger[_0x6a6f('0xd')](_0x6a6f('0xe'),_0x4d73b1,'request\x20sent',JSON[_0x6a6f('0xf')](_0x1a489b));if(_0x1a489b[_0x6a6f('0x10')]){if(_0x1a489b[_0x6a6f('0x10')][_0x6a6f('0x11')]===0x1f4){logger[_0x6a6f('0x10')](_0x6a6f('0xb'),_0x4d73b1,_0x1a489b[_0x6a6f('0x10')][_0x6a6f('0x12')]);return _0x22ccc0(_0x1a489b[_0x6a6f('0x10')][_0x6a6f('0x12')]);}logger[_0x6a6f('0x10')](_0x6a6f('0xb'),_0x4d73b1,_0x1a489b['error'][_0x6a6f('0x12')]);return _0x335954(_0x1a489b[_0x6a6f('0x10')][_0x6a6f('0x12')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x4d73b1,_0x6a6f('0xc'));_0x335954(_0x1a489b[_0x6a6f('0x13')][_0x6a6f('0x12')]);}})[_0x6a6f('0x14')](function(_0x3dd8b3){logger[_0x6a6f('0x10')](_0x6a6f('0xb'),_0x4d73b1,_0x3dd8b3);_0x22ccc0(_0x3dd8b3);});});}exports[_0x6a6f('0x15')]=function(_0x192fd7){var _0x41875b=this;return new Promise(function(_0x55ef22,_0x183877){return db[_0x6a6f('0x16')][_0x6a6f('0x17')]({'raw':_0x192fd7[_0x6a6f('0x18')]?_0x192fd7['options'][_0x6a6f('0x19')]===undefined?!![]:![]:!![],'where':_0x192fd7[_0x6a6f('0x18')]?_0x192fd7['options'][_0x6a6f('0x1a')]||null:null,'attributes':_0x192fd7[_0x6a6f('0x18')]?_0x192fd7[_0x6a6f('0x18')]['attributes']||null:null,'limit':_0x192fd7[_0x6a6f('0x18')]?_0x192fd7[_0x6a6f('0x18')][_0x6a6f('0x1b')]||null:null,'include':_0x192fd7[_0x6a6f('0x18')]?_0x192fd7[_0x6a6f('0x18')][_0x6a6f('0x1c')]?_[_0x6a6f('0x1d')](_0x192fd7[_0x6a6f('0x18')][_0x6a6f('0x1c')],function(_0x582a4a){return{'model':db[_0x582a4a[_0x6a6f('0x1e')]],'as':_0x582a4a['as'],'attributes':_0x582a4a[_0x6a6f('0x1f')],'include':_0x582a4a[_0x6a6f('0x1c')]?_[_0x6a6f('0x1d')](_0x582a4a[_0x6a6f('0x1c')],function(_0x4d56db){return{'model':db[_0x4d56db[_0x6a6f('0x1e')]],'as':_0x4d56db['as'],'attributes':_0x4d56db[_0x6a6f('0x1f')],'include':_0x4d56db[_0x6a6f('0x1c')]?_['map'](_0x4d56db[_0x6a6f('0x1c')],function(_0x4812c3){return{'model':db[_0x4812c3['model']],'as':_0x4812c3['as'],'attributes':_0x4812c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a6f('0x9')](function(_0xf5d322){logger['info'](_0x6a6f('0x15'),_0x192fd7);logger['debug']('GetTrunk',_0x192fd7,JSON[_0x6a6f('0xf')](_0xf5d322));_0x55ef22(_0xf5d322);})[_0x6a6f('0x14')](function(_0x3f6833){logger[_0x6a6f('0x10')](_0x6a6f('0x15'),_0x3f6833[_0x6a6f('0x12')],_0x192fd7);_0x183877(_0x41875b[_0x6a6f('0x10')](0x1f4,_0x3f6833[_0x6a6f('0x12')]));});});};exports[_0x6a6f('0x20')]=function(_0x452751){var _0x167714=this;return new Promise(function(_0x311bad,_0x2b68bc){return db[_0x6a6f('0x16')][_0x6a6f('0x21')]({'raw':_0x452751[_0x6a6f('0x18')]?_0x452751['options'][_0x6a6f('0x19')]===undefined?!![]:![]:!![],'where':_0x452751[_0x6a6f('0x18')]?_0x452751['options'][_0x6a6f('0x1a')]||null:null,'attributes':_0x452751[_0x6a6f('0x18')]?_0x452751['options'][_0x6a6f('0x1f')]||null:null,'include':_0x452751[_0x6a6f('0x18')]?_0x452751[_0x6a6f('0x18')][_0x6a6f('0x1c')]?_['map'](_0x452751[_0x6a6f('0x18')][_0x6a6f('0x1c')],function(_0x566aae){return{'model':db[_0x566aae['model']],'as':_0x566aae['as'],'attributes':_0x566aae[_0x6a6f('0x1f')],'include':_0x566aae[_0x6a6f('0x1c')]?_['map'](_0x566aae[_0x6a6f('0x1c')],function(_0x1817a7){return{'model':db[_0x1817a7[_0x6a6f('0x1e')]],'as':_0x1817a7['as'],'attributes':_0x1817a7[_0x6a6f('0x1f')],'include':_0x1817a7[_0x6a6f('0x1c')]?_['map'](_0x1817a7[_0x6a6f('0x1c')],function(_0x514cae){return{'model':db[_0x514cae[_0x6a6f('0x1e')]],'as':_0x514cae['as'],'attributes':_0x514cae['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a6f('0x9')](function(_0x2f7725){logger[_0x6a6f('0xa')]('ShowTrunk',_0x452751);logger[_0x6a6f('0xd')]('ShowTrunk',_0x452751,JSON[_0x6a6f('0xf')](_0x2f7725));_0x311bad(_0x2f7725);})[_0x6a6f('0x14')](function(_0x267428){logger[_0x6a6f('0x10')]('ShowTrunk',_0x267428[_0x6a6f('0x12')],_0x452751);_0x2b68bc(_0x167714[_0x6a6f('0x10')](0x1f4,_0x267428[_0x6a6f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index c2662f3..e736381 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 _0x4b6d=['../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update','exports','express','Router'];(function(_0x38db51,_0x27fb07){var _0x333e6a=function(_0x373b93){while(--_0x373b93){_0x38db51['push'](_0x38db51['shift']());}};_0x333e6a(++_0x27fb07);}(_0x4b6d,0x7c));var _0xd4b6=function(_0x13c117,_0x556d26){_0x13c117=_0x13c117-0x0;var _0x22f56a=_0x4b6d[_0x13c117];return _0x22f56a;};'use strict';var express=require(_0xd4b6('0x0'));var router=express[_0xd4b6('0x1')]();var auth=require(_0xd4b6('0x2'));var controller=require(_0xd4b6('0x3'));router[_0xd4b6('0x4')](_0xd4b6('0x5'),auth[_0xd4b6('0x6')](),controller[_0xd4b6('0x7')]);module[_0xd4b6('0x8')]=router; \ No newline at end of file +var _0x515b=['exports','express','/:id','isAuthenticated'];(function(_0x2b1fb2,_0x1f50fd){var _0x265975=function(_0x5a8d59){while(--_0x5a8d59){_0x2b1fb2['push'](_0x2b1fb2['shift']());}};_0x265975(++_0x1f50fd);}(_0x515b,0xd5));var _0xb515=function(_0x5d8e5e,_0x257e02){_0x5d8e5e=_0x5d8e5e-0x0;var _0x15a8d3=_0x515b[_0x5d8e5e];return _0x15a8d3;};'use strict';var express=require(_0xb515('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router['put'](_0xb515('0x1'),auth[_0xb515('0x2')](),controller['update']);module[_0xb515('0x3')]=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 ce09c4b..ca2e556 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 _0x8f5f=['TEXT','INTEGER','UserId','error','warning','info','debug','exports','ENUM','BOOLEAN'];(function(_0x3cec8c,_0x3f6c1d){var _0x38032e=function(_0x4ef75b){while(--_0x4ef75b){_0x3cec8c['push'](_0x3cec8c['shift']());}};_0x38032e(++_0x3f6c1d);}(_0x8f5f,0x1e3));var _0xf8f5=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x8f5f[_0x44afa4];return _0xcad289;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xf8f5('0x0'),_0xf8f5('0x1'),_0xf8f5('0x2'),_0xf8f5('0x3')];module[_0xf8f5('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf8f5('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf8f5('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf8f5('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xf8f5('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf8f5('0x8')],'unique':_0xf8f5('0x9')}}; \ No newline at end of file +var _0x9731=['debug','exports','ENUM','BOOLEAN','DATE','UserId','sequelize','error','warning','info'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x9731,0xa6));var _0x1973=function(_0x42b364,_0x1e23fe){_0x42b364=_0x42b364-0x0;var _0x257a8b=_0x9731[_0x42b364];return _0x257a8b;};'use strict';var Sequelize=require(_0x1973('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x1973('0x1'),_0x1973('0x2'),_0x1973('0x3'),_0x1973('0x4')];module[_0x1973('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x1973('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x1973('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x1973('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x1973('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x1973('0x9')}}; \ 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 d8b118b..e531607 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 _0xf72b=['defaults','status','json','update','sendStatus','error','stack','name','send','user','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','body','catch','lodash','../../config/logger','../../config/environment','../../mysqldb','redis','./user-setting.socket','register'];(function(_0x234e34,_0x113745){var _0x50d089=function(_0x4dfa19){while(--_0x4dfa19){_0x234e34['push'](_0x234e34['shift']());}};_0x50d089(++_0x113745);}(_0xf72b,0x1d9));var _0xbf72=function(_0x4f738d,_0xde8321){_0x4f738d=_0x4f738d-0x0;var _0x4630be=_0xf72b[_0x4f738d];return _0x4630be;};'use strict';var _=require(_0xbf72('0x0'));var Redis=require('ioredis');var logger=require(_0xbf72('0x1'))('api');var config=require(_0xbf72('0x2'));var db=require(_0xbf72('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xbf72('0x4')]));require(_0xbf72('0x5'))[_0xbf72('0x6')](socket);config[_0xbf72('0x4')]=_[_0xbf72('0x7')](config[_0xbf72('0x4')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x41c11d,_0xc0842b){_0xc0842b=_0xc0842b||0xc8;return function(_0x119807){if(_0x119807){return _0x41c11d[_0xbf72('0x8')](_0xc0842b)[_0xbf72('0x9')](_0x119807);}};}function saveUpdates(_0x1b6d38){return function(_0x59e665){if(_0x59e665){return _0x59e665[_0xbf72('0xa')](_0x1b6d38)['then'](function(_0x2ca1f8){return _0x2ca1f8;});}return null;};}function handleEntityNotFound(_0x1f2be0){return function(_0x4d211c){if(!_0x4d211c){_0x1f2be0[_0xbf72('0xb')](0x194);}return _0x4d211c;};}function handleError(_0x1c3453,_0x1853eb){_0x1853eb=_0x1853eb||0x1f4;return function(_0x145acb){logger[_0xbf72('0xc')](_0x145acb[_0xbf72('0xd')]);if(_0x145acb[_0xbf72('0xe')]){delete _0x145acb[_0xbf72('0xe')];}_0x1c3453['status'](_0x1853eb)[_0xbf72('0xf')](_0x145acb);};}exports[_0xbf72('0xa')]=function(_0x57cccf,_0x5d8c85){if(_0x57cccf[_0xbf72('0x10')]['role']!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x57cccf[_0xbf72('0x11')]['id'])))throw new Error(_0xbf72('0x12'));return db[_0xbf72('0x13')][_0xbf72('0x14')]({'where':{'id':_0x57cccf[_0xbf72('0x11')]['id']}})[_0xbf72('0x15')](handleEntityNotFound(_0x5d8c85,null))['then'](saveUpdates(_0x57cccf[_0xbf72('0x16')],null))[_0xbf72('0x15')](respondWithResult(_0x5d8c85,null))[_0xbf72('0x17')](handleError(_0x5d8c85,null));}; \ No newline at end of file +var _0xb63f=['redis','./user-setting.socket','register','update','sendStatus','error','name','status','send','role','admin','Unauthorized','params','UserSetting','then','body','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xb63f,0xa3));var _0xfb63=function(_0x813d0a,_0x4fd3d7){_0x813d0a=_0x813d0a-0x0;var _0x241352=_0xb63f[_0x813d0a];return _0x241352;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0xfb63('0x0'))(_0xfb63('0x1'));var config=require(_0xfb63('0x2'));var db=require(_0xfb63('0x3'))['db'];var socket=require(_0xfb63('0x4'))(new Redis(config[_0xfb63('0x5')]));require(_0xfb63('0x6'))[_0xfb63('0x7')](socket);config[_0xfb63('0x5')]=_['defaults'](config[_0xfb63('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x284c59,_0xcf49af){_0xcf49af=_0xcf49af||0xc8;return function(_0x51bc4f){if(_0x51bc4f){return _0x284c59['status'](_0xcf49af)['json'](_0x51bc4f);}};}function saveUpdates(_0x2b1a0f){return function(_0x2441c4){if(_0x2441c4){return _0x2441c4[_0xfb63('0x8')](_0x2b1a0f)['then'](function(_0x3f021b){return _0x3f021b;});}return null;};}function handleEntityNotFound(_0x5adf74){return function(_0xb36a3){if(!_0xb36a3){_0x5adf74[_0xfb63('0x9')](0x194);}return _0xb36a3;};}function handleError(_0x22b710,_0x697b6f){_0x697b6f=_0x697b6f||0x1f4;return function(_0x204976){logger[_0xfb63('0xa')](_0x204976['stack']);if(_0x204976['name']){delete _0x204976[_0xfb63('0xb')];}_0x22b710[_0xfb63('0xc')](_0x697b6f)[_0xfb63('0xd')](_0x204976);};}exports['update']=function(_0x2e0b54,_0x3b425f){if(_0x2e0b54['user'][_0xfb63('0xe')]!==_0xfb63('0xf'))throw new Error(_0xfb63('0x10'));if(isNaN(Number(_0x2e0b54[_0xfb63('0x11')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xfb63('0x12')]['find']({'where':{'id':_0x2e0b54[_0xfb63('0x11')]['id']}})[_0xfb63('0x13')](handleEntityNotFound(_0x3b425f,null))[_0xfb63('0x13')](saveUpdates(_0x2e0b54[_0xfb63('0x14')],null))[_0xfb63('0x13')](respondWithResult(_0x3b425f,null))['catch'](handleError(_0x3b425f,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 5ffc1c6..7d90bea 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 _0x7995=['hasOwnProperty','exports','events','../../mysqldb','UserSetting','update','emit'];(function(_0x21125f,_0x8079f8){var _0x2f421d=function(_0x231299){while(--_0x231299){_0x21125f['push'](_0x21125f['shift']());}};_0x2f421d(++_0x8079f8);}(_0x7995,0xf7));var _0x5799=function(_0x380ade,_0x3698d9){_0x380ade=_0x380ade-0x0;var _0x4d421a=_0x7995[_0x380ade];return _0x4d421a;};'use strict';var EventEmitter=require(_0x5799('0x0'));var UserSetting=require(_0x5799('0x1'))['db'][_0x5799('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5799('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5ad6a1){return function(_0x39c573,_0x4c0970,_0x35d4be){UserSettingEvents['emit'](_0x5ad6a1+':'+_0x39c573['id'],_0x39c573);UserSettingEvents[_0x5799('0x4')](_0x5ad6a1,_0x39c573);_0x35d4be(null);};}for(var e in events){if(events[_0x5799('0x5')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x5799('0x6')]=UserSettingEvents; \ No newline at end of file +var _0xb92e=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb92e,0x65));var _0xeb92=function(_0x2bc78d,_0x31a288){_0x2bc78d=_0x2bc78d-0x0;var _0x5d96c9=_0xb92e[_0x2bc78d];return _0x5d96c9;};'use strict';var EventEmitter=require(_0xeb92('0x0'));var UserSetting=require(_0xeb92('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xeb92('0x2')](0x0);var events={'afterCreate':_0xeb92('0x3'),'afterUpdate':_0xeb92('0x4'),'afterDestroy':_0xeb92('0x5')};function emitEvent(_0x41ae90){return function(_0x2e1a4e,_0x1c6181,_0x2e6772){UserSettingEvents[_0xeb92('0x6')](_0x41ae90+':'+_0x2e1a4e['id'],_0x2e1a4e);UserSettingEvents[_0xeb92('0x6')](_0x41ae90,_0x2e1a4e);_0x2e6772(null);};}for(var e in events){if(events[_0xeb92('0x7')](e)){var event=events[e];UserSetting[_0xeb92('0x8')](e,emitEvent(event));}}module[_0xeb92('0x9')]=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 478a990..8fd3897 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 _0x049e=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','user_settings'];(function(_0x52de48,_0x5bc748){var _0x18f4c0=function(_0x44459e){while(--_0x44459e){_0x52de48['push'](_0x52de48['shift']());}};_0x18f4c0(++_0x5bc748);}(_0x049e,0x16a));var _0xe049=function(_0x4cba56,_0x5b2c44){_0x4cba56=_0x4cba56-0x0;var _0x3cc9f3=_0x049e[_0x4cba56];return _0x3cc9f3;};'use strict';var attributes=require(_0xe049('0x0'));module[_0xe049('0x1')]=function(_0x5efb24){return _0x5efb24[_0xe049('0x2')]('UserSetting',attributes,{'tableName':_0xe049('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13cc6a){if(!_0x13cc6a[_0xe049('0x4')])_0x13cc6a[_0xe049('0x5')]=null;else if(_0x13cc6a[_0xe049('0x5')]===null)_0x13cc6a['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0xc584=['exports','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x16f78c,_0x5c99ee){var _0x2d0ea2=function(_0x10d319){while(--_0x10d319){_0x16f78c['push'](_0x16f78c['shift']());}};_0x2d0ea2(++_0x5c99ee);}(_0xc584,0xa8));var _0x4c58=function(_0x3253f3,_0x1c57d8){_0x3253f3=_0x3253f3-0x0;var _0x598c26=_0xc584[_0x3253f3];return _0x598c26;};'use strict';var attributes=require('./user-setting.attributes');module[_0x4c58('0x0')]=function(_0x1d0f9e){return _0x1d0f9e['define']('UserSetting',attributes,{'tableName':_0x4c58('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5502e6){if(!_0x5502e6[_0x4c58('0x2')])_0x5502e6[_0x4c58('0x3')]=null;else if(_0x5502e6[_0x4c58('0x3')]===null)_0x5502e6['clientSideLoggingEnabledSince']=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 7d255c7..cefad67 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 _0xb7d2=['user-setting:update','user-setting:update:user-','UserId','register','user-setting:','./user-setting.events','emit'];(function(_0x1862f1,_0x1cc924){var _0x51b0b9=function(_0xc1b5c5){while(--_0xc1b5c5){_0x1862f1['push'](_0x1862f1['shift']());}};_0x51b0b9(++_0x1cc924);}(_0xb7d2,0x1b7));var _0x2b7d=function(_0x46c0bb,_0x33f86a){_0x46c0bb=_0x46c0bb-0x0;var _0x75a353=_0xb7d2[_0x46c0bb];return _0x75a353;};'use strict';var UserSettingEvents=require(_0x2b7d('0x0'));var events=['save','remove','update'];function createListener(_0xac91f5,_0x46b429){return function(_0x540ebe){_0x46b429[_0x2b7d('0x1')](_0xac91f5,_0x540ebe);if(_0xac91f5===_0x2b7d('0x2')){_0x46b429[_0x2b7d('0x1')](_0x2b7d('0x3')+_0x540ebe[_0x2b7d('0x4')],_0x540ebe);}};}exports[_0x2b7d('0x5')]=function(_0x5efd6b){for(var _0x3695cb=0x0,_0x28b827=events['length'];_0x3695cb<_0x28b827;_0x3695cb++){var _0x332de2=events[_0x3695cb];var _0x11bbee=createListener(_0x2b7d('0x6')+_0x332de2,_0x5efd6b);UserSettingEvents['on'](_0x332de2,_0x11bbee);}}; \ No newline at end of file +var _0xd227=['user-setting:update:user-','register','length','user-setting:','save','remove','update','emit','user-setting:update'];(function(_0x38dbe1,_0x3c5202){var _0x5d1f86=function(_0x4904f8){while(--_0x4904f8){_0x38dbe1['push'](_0x38dbe1['shift']());}};_0x5d1f86(++_0x3c5202);}(_0xd227,0xa6));var _0x7d22=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xd227[_0x41582d];return _0x59c504;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x7d22('0x0'),_0x7d22('0x1'),_0x7d22('0x2')];function createListener(_0x3a4ff4,_0x37dbfb){return function(_0x2671c8){_0x37dbfb[_0x7d22('0x3')](_0x3a4ff4,_0x2671c8);if(_0x3a4ff4===_0x7d22('0x4')){_0x37dbfb[_0x7d22('0x3')](_0x7d22('0x5')+_0x2671c8['UserId'],_0x2671c8);}};}exports[_0x7d22('0x6')]=function(_0x302adc){for(var _0x4b093e=0x0,_0x42a6d7=events[_0x7d22('0x7')];_0x4b093e<_0x42a6d7;_0x4b093e++){var _0x55b19e=events[_0x4b093e];var _0x3c14dd=createListener(_0x7d22('0x8')+_0x55b19e,_0x302adc);UserSettingEvents['on'](_0x55b19e,_0x3c14dd);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 37fde9f..4762b9b 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 _0xe897=['pause','/:id/unpause','unpause','addTeams','addChatInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','/whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause'];(function(_0x3d8a12,_0x2e6f30){var _0x3dbb5d=function(_0x4b60aa){while(--_0x4b60aa){_0x3d8a12['push'](_0x3d8a12['shift']());}};_0x3dbb5d(++_0x2e6f30);}(_0xe897,0x16d));var _0x7e89=function(_0x52c15c,_0x2b87e0){_0x52c15c=_0x52c15c-0x0;var _0x4641bd=_0xe897[_0x52c15c];return _0x4641bd;};'use strict';var multer=require('multer');var util=require(_0x7e89('0x0'));var path=require(_0x7e89('0x1'));var timeout=require(_0x7e89('0x2'));var express=require(_0x7e89('0x3'));var router=express[_0x7e89('0x4')]();var fs_extra=require(_0x7e89('0x5'));var auth=require(_0x7e89('0x6'));var interaction=require(_0x7e89('0x7'));var config=require('../../config/environment');var controller=require(_0x7e89('0x8'));router[_0x7e89('0x9')]('/',auth[_0x7e89('0xa')](),controller['index']);router[_0x7e89('0x9')]('/describe',auth[_0x7e89('0xa')](),controller['describe']);router[_0x7e89('0x9')](_0x7e89('0xb'),auth[_0x7e89('0xa')](),controller['whoami']);router[_0x7e89('0x9')]('/presence',auth[_0x7e89('0xa')](),controller[_0x7e89('0xc')]);router['get'](_0x7e89('0xd'),auth[_0x7e89('0xa')](),controller[_0x7e89('0xe')]);router[_0x7e89('0x9')](_0x7e89('0xf'),controller[_0x7e89('0x10')]);router[_0x7e89('0x9')](_0x7e89('0x11'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x12')]);router['get'](_0x7e89('0x13'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x14')]);router[_0x7e89('0x9')]('/:id/queues',auth[_0x7e89('0xa')](),controller[_0x7e89('0x15')]);router[_0x7e89('0x9')]('/:id/queues_rt',auth[_0x7e89('0xa')](),controller['getVoiceQueuesRt']);router['get'](_0x7e89('0x16'),auth['isAuthenticated'](),controller[_0x7e89('0x17')]);router[_0x7e89('0x9')](_0x7e89('0x18'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x19')]);router[_0x7e89('0x9')](_0x7e89('0x1a'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x1b')]);router['get'](_0x7e89('0x1c'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x1d')]);router[_0x7e89('0x9')]('/:id/openchannel/interactions',auth[_0x7e89('0xa')](),controller[_0x7e89('0x1e')]);router[_0x7e89('0x9')]('/:id/mail/interactions',auth[_0x7e89('0xa')](),controller['getMailInteractions']);router[_0x7e89('0x9')]('/:id/sms/interactions',auth[_0x7e89('0xa')](),controller[_0x7e89('0x1f')]);router[_0x7e89('0x9')]('/:id/fax/interactions',auth[_0x7e89('0xa')](),controller[_0x7e89('0x20')]);router[_0x7e89('0x9')](_0x7e89('0x21'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x22')]);router[_0x7e89('0x9')](_0x7e89('0x23'),auth['isAuthenticated'](),controller[_0x7e89('0x24')]);router[_0x7e89('0x9')](_0x7e89('0x25'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x7e89('0x26'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x27')]);router[_0x7e89('0x9')](_0x7e89('0x28'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x29')]);router['get'](_0x7e89('0x2a'),auth[_0x7e89('0xa')](),controller['getFaxAccounts']);router[_0x7e89('0x9')](_0x7e89('0x2b'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x2c')]);router['get'](_0x7e89('0x2d'),auth['isAuthenticated'](),controller[_0x7e89('0x2e')]);router[_0x7e89('0x9')](_0x7e89('0x2f'),auth[_0x7e89('0xa')](),controller['getSmsAccounts']);router[_0x7e89('0x9')](_0x7e89('0x30'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x31')]);router[_0x7e89('0x9')](_0x7e89('0x32'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x33')]);router[_0x7e89('0x9')]('/:id/scheduled_calls',auth[_0x7e89('0xa')](),controller['getScheduledCalls']);router[_0x7e89('0x9')](_0x7e89('0x34'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x35')]);router[_0x7e89('0x36')](_0x7e89('0x13'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x37')]);router[_0x7e89('0x36')]('/',auth[_0x7e89('0xa')](),controller[_0x7e89('0x38')]);router['post'](_0x7e89('0x39'),auth['isAuthenticated'](),controller[_0x7e89('0x3a')]);router[_0x7e89('0x36')]('/:id/queues',auth[_0x7e89('0xa')](),controller[_0x7e89('0x3b')]);var upload=multer({'storage':multer[_0x7e89('0x3c')]({'destination':function(_0x1d7902,_0x2b1424,_0x1a1535){_0x1a1535(null,path['join'](config[_0x7e89('0x3d')],_0x7e89('0x3e')));},'filename':function(_0xf77aab,_0x4b026f,_0x205716){_0x205716(null,util[_0x7e89('0x3f')](_0x7e89('0x40'),Date[_0x7e89('0x41')](),_0x4b026f[_0x7e89('0x42')]));}})});router[_0x7e89('0x36')]('/:id/avatar',upload[_0x7e89('0x43')](_0x7e89('0x44')),controller[_0x7e89('0x45')]);router[_0x7e89('0x36')](_0x7e89('0x46'),auth['isAuthenticated'](),controller[_0x7e89('0x47')]);router[_0x7e89('0x36')](_0x7e89('0x48'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x49')]);router[_0x7e89('0x36')](_0x7e89('0x4a'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x4b')]);router[_0x7e89('0x36')](_0x7e89('0x4c'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x4d')]);router[_0x7e89('0x36')]('/:id/teams',auth[_0x7e89('0xa')](),controller[_0x7e89('0x4e')]);router['post']('/:id/chat_interactions',auth[_0x7e89('0xa')](),controller[_0x7e89('0x4f')]);router['post']('/:id/mail_interactions',auth[_0x7e89('0xa')](),controller['addMailInteractions']);router[_0x7e89('0x36')]('/:id/fax_interactions',auth[_0x7e89('0xa')](),controller[_0x7e89('0x50')]);router[_0x7e89('0x36')](_0x7e89('0x51'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x52')]);router[_0x7e89('0x36')](_0x7e89('0x53'),auth[_0x7e89('0xa')](),controller['addOpenchannelInteractions']);router[_0x7e89('0x36')](_0x7e89('0x54'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x55')]);router[_0x7e89('0x36')](_0x7e89('0x2a'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x56')]);router[_0x7e89('0x36')](_0x7e89('0x2b'),auth['isAuthenticated'](),controller['addMailAccounts']);router['post'](_0x7e89('0x2d'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x57')]);router[_0x7e89('0x36')](_0x7e89('0x2f'),auth[_0x7e89('0xa')](),controller['addSmsAccounts']);router['post'](_0x7e89('0x30'),auth[_0x7e89('0xa')](),controller['addChatWebsites']);router[_0x7e89('0x36')](_0x7e89('0x32'),auth[_0x7e89('0xa')](),controller['addWhatsappAccounts']);router[_0x7e89('0x36')](_0x7e89('0x34'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x58')]);router[_0x7e89('0x59')](_0x7e89('0xd'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x5a')]);router['put'](_0x7e89('0x5b'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x5c')]);router[_0x7e89('0x5d')]('/:id/queues',auth[_0x7e89('0xa')](),controller[_0x7e89('0x5e')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x7e89('0x5f')]);router['delete']('/:id',auth[_0x7e89('0xa')](),controller['destroy']);router[_0x7e89('0x5d')](_0x7e89('0x60'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x61')]);router[_0x7e89('0x5d')](_0x7e89('0x62'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x7e89('0x5d')](_0x7e89('0x63'),auth[_0x7e89('0xa')](),controller['removeFaxInteractions']);router['delete'](_0x7e89('0x51'),auth['isAuthenticated'](),controller[_0x7e89('0x64')]);router['delete'](_0x7e89('0x53'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x65')]);router['delete']('/:id/whatsapp_interactions',auth[_0x7e89('0xa')](),controller['removeWhatsappInteractions']);router[_0x7e89('0x5d')](_0x7e89('0x2a'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x66')]);router[_0x7e89('0x5d')](_0x7e89('0x2b'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x67')]);router[_0x7e89('0x5d')](_0x7e89('0x2d'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x68')]);router['delete'](_0x7e89('0x2f'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x7e89('0x5d')](_0x7e89('0x30'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x69')]);router['delete'](_0x7e89('0x32'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x6a')]);router[_0x7e89('0x5d')](_0x7e89('0x34'),auth[_0x7e89('0xa')](),controller[_0x7e89('0x6b')]);router[_0x7e89('0x36')](_0x7e89('0x6c'),auth[_0x7e89('0xa')](),controller['messengerSoundNotification']);module[_0x7e89('0x6d')]=router; \ No newline at end of file +var _0xf963=['/:id','/:id/avatar','getAvatar','/:id/contacts','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','format','now','originalname','addAvatar','/:id/login','login','logout','pause','/:id/unpause','/:id/teams','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','createApiKey','put','update','delete','removeTeams','destroy','/:id/mail_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','get','/describe','/whoami','getPresence'];(function(_0x50ccac,_0x39ce48){var _0x3fcfbe=function(_0x490b8d){while(--_0x490b8d){_0x50ccac['push'](_0x50ccac['shift']());}};_0x3fcfbe(++_0x39ce48);}(_0xf963,0x11d));var _0x3f96=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xf963[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0x3f96('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3f96('0x1'));var express=require(_0x3f96('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3f96('0x3'));var interaction=require(_0x3f96('0x4'));var config=require(_0x3f96('0x5'));var controller=require(_0x3f96('0x6'));router['get']('/',auth[_0x3f96('0x7')](),controller['index']);router[_0x3f96('0x8')](_0x3f96('0x9'),auth[_0x3f96('0x7')](),controller['describe']);router[_0x3f96('0x8')](_0x3f96('0xa'),auth['isAuthenticated'](),controller['whoami']);router['get']('/presence',auth[_0x3f96('0x7')](),controller[_0x3f96('0xb')]);router[_0x3f96('0x8')](_0x3f96('0xc'),auth[_0x3f96('0x7')](),controller['show']);router[_0x3f96('0x8')](_0x3f96('0xd'),controller[_0x3f96('0xe')]);router[_0x3f96('0x8')]('/:id/open_tabs',auth[_0x3f96('0x7')](),controller['getOpenTabs']);router[_0x3f96('0x8')](_0x3f96('0xf'),auth[_0x3f96('0x7')](),controller['getContacts']);router[_0x3f96('0x8')]('/:id/queues',auth[_0x3f96('0x7')](),controller['getQueues']);router['get']('/:id/queues_rt',auth[_0x3f96('0x7')](),controller[_0x3f96('0x10')]);router[_0x3f96('0x8')](_0x3f96('0x11'),auth['isAuthenticated'](),controller[_0x3f96('0x12')]);router[_0x3f96('0x8')](_0x3f96('0x13'),auth['isAuthenticated'](),controller[_0x3f96('0x14')]);router[_0x3f96('0x8')](_0x3f96('0x15'),auth['isAuthenticated'](),controller[_0x3f96('0x16')]);router[_0x3f96('0x8')](_0x3f96('0x17'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x18')]);router[_0x3f96('0x8')]('/:id/openchannel/interactions',auth[_0x3f96('0x7')](),controller['getOpenchannelInteractions']);router[_0x3f96('0x8')](_0x3f96('0x19'),auth['isAuthenticated'](),controller[_0x3f96('0x1a')]);router[_0x3f96('0x8')]('/:id/sms/interactions',auth[_0x3f96('0x7')](),controller[_0x3f96('0x1b')]);router[_0x3f96('0x8')](_0x3f96('0x1c'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x1d')]);router[_0x3f96('0x8')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0x3f96('0x1e')]);router['get']('/:id/teams',auth[_0x3f96('0x7')](),controller['getTeams']);router[_0x3f96('0x8')]('/:id/lists',auth[_0x3f96('0x7')](),controller[_0x3f96('0x1f')]);router[_0x3f96('0x8')](_0x3f96('0x20'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x21')]);router['get'](_0x3f96('0x22'),auth[_0x3f96('0x7')](),controller['getVoicePrefixes']);router[_0x3f96('0x8')](_0x3f96('0x23'),auth['isAuthenticated'](),controller[_0x3f96('0x24')]);router['get'](_0x3f96('0x25'),auth['isAuthenticated'](),controller[_0x3f96('0x26')]);router[_0x3f96('0x8')](_0x3f96('0x27'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x28')]);router[_0x3f96('0x8')](_0x3f96('0x29'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x2a')]);router[_0x3f96('0x8')](_0x3f96('0x2b'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x2c')]);router['get']('/:id/whatsapp_accounts',auth[_0x3f96('0x7')](),controller['getWhatsappAccounts']);router[_0x3f96('0x8')](_0x3f96('0x2d'),auth['isAuthenticated'](),controller[_0x3f96('0x2e')]);router['get'](_0x3f96('0x2f'),auth['isAuthenticated'](),controller[_0x3f96('0x30')]);router[_0x3f96('0x31')]('/:id/contacts',auth[_0x3f96('0x7')](),controller['addContacts']);router[_0x3f96('0x31')]('/',auth['isAuthenticated'](),controller[_0x3f96('0x32')]);router[_0x3f96('0x31')](_0x3f96('0x33'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x34')]);router['post'](_0x3f96('0x35'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x36')]);var upload=multer({'storage':multer[_0x3f96('0x37')]({'destination':function(_0x25c73f,_0x1393f7,_0x53dc5f){_0x53dc5f(null,path[_0x3f96('0x38')](config[_0x3f96('0x39')],'server/files/images/'));},'filename':function(_0x466ef3,_0x932c72,_0x477abe){_0x477abe(null,util[_0x3f96('0x3a')]('%s-%s',Date[_0x3f96('0x3b')](),_0x932c72[_0x3f96('0x3c')]));}})});router['post'](_0x3f96('0xd'),upload['single']('file'),controller[_0x3f96('0x3d')]);router[_0x3f96('0x31')](_0x3f96('0x3e'),auth['isAuthenticated'](),controller[_0x3f96('0x3f')]);router[_0x3f96('0x31')]('/:id/logout',auth[_0x3f96('0x7')](),controller[_0x3f96('0x40')]);router[_0x3f96('0x31')]('/:id/pause',auth[_0x3f96('0x7')](),controller[_0x3f96('0x41')]);router[_0x3f96('0x31')](_0x3f96('0x42'),auth[_0x3f96('0x7')](),controller['unpause']);router[_0x3f96('0x31')](_0x3f96('0x43'),auth[_0x3f96('0x7')](),controller['addTeams']);router['post']('/:id/chat_interactions',auth[_0x3f96('0x7')](),controller[_0x3f96('0x44')]);router[_0x3f96('0x31')]('/:id/mail_interactions',auth[_0x3f96('0x7')](),controller['addMailInteractions']);router[_0x3f96('0x31')](_0x3f96('0x45'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x46')]);router[_0x3f96('0x31')](_0x3f96('0x47'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x48')]);router[_0x3f96('0x31')](_0x3f96('0x49'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x4a')]);router[_0x3f96('0x31')](_0x3f96('0x4b'),auth['isAuthenticated'](),controller[_0x3f96('0x4c')]);router[_0x3f96('0x31')](_0x3f96('0x23'),auth['isAuthenticated'](),controller[_0x3f96('0x4d')]);router[_0x3f96('0x31')](_0x3f96('0x25'),auth['isAuthenticated'](),controller[_0x3f96('0x4e')]);router[_0x3f96('0x31')](_0x3f96('0x27'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x4f')]);router[_0x3f96('0x31')](_0x3f96('0x29'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x50')]);router[_0x3f96('0x31')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x3f96('0x51')]);router[_0x3f96('0x31')](_0x3f96('0x52'),auth[_0x3f96('0x7')](),controller['addWhatsappAccounts']);router[_0x3f96('0x31')](_0x3f96('0x2f'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x53')]);router[_0x3f96('0x54')](_0x3f96('0xc'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x55')]);router[_0x3f96('0x54')]('/:id/password',auth['isAuthenticated'](),controller['changePassword']);router[_0x3f96('0x56')](_0x3f96('0x35'),auth[_0x3f96('0x7')](),controller['removeQueues']);router[_0x3f96('0x56')]('/:id/teams',auth[_0x3f96('0x7')](),controller[_0x3f96('0x57')]);router[_0x3f96('0x56')](_0x3f96('0xc'),auth['isAuthenticated'](),controller[_0x3f96('0x58')]);router['delete']('/:id/chat_interactions',auth[_0x3f96('0x7')](),controller['removeChatInteractions']);router[_0x3f96('0x56')](_0x3f96('0x59'),auth[_0x3f96('0x7')](),controller['removeMailInteractions']);router[_0x3f96('0x56')](_0x3f96('0x45'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x5a')]);router[_0x3f96('0x56')](_0x3f96('0x47'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x5b')]);router[_0x3f96('0x56')]('/:id/openchannel_interactions',auth[_0x3f96('0x7')](),controller[_0x3f96('0x5c')]);router[_0x3f96('0x56')]('/:id/whatsapp_interactions',auth[_0x3f96('0x7')](),controller['removeWhatsappInteractions']);router[_0x3f96('0x56')]('/:id/fax_accounts',auth[_0x3f96('0x7')](),controller['removeFaxAccounts']);router[_0x3f96('0x56')]('/:id/mail_accounts',auth[_0x3f96('0x7')](),controller['removeMailAccounts']);router[_0x3f96('0x56')](_0x3f96('0x27'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x5d')]);router[_0x3f96('0x56')](_0x3f96('0x29'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x5e')]);router[_0x3f96('0x56')](_0x3f96('0x2b'),auth['isAuthenticated'](),controller[_0x3f96('0x5f')]);router['delete'](_0x3f96('0x52'),auth[_0x3f96('0x7')](),controller['removeWhatsappAccounts']);router[_0x3f96('0x56')](_0x3f96('0x2f'),auth[_0x3f96('0x7')](),controller[_0x3f96('0x60')]);router[_0x3f96('0x31')](_0x3f96('0x61'),auth['isAuthenticated'](),controller[_0x3f96('0x62')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index cbfa09b..663dd7c 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 _0x1472=['udp','transport','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','join','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<>','accept','refuse','originate','uac','uas','active','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','icesupport','dtlsenable','dtlsverify','dtlssetup','rtcp_mux','avpf','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','telephone','local','INTEGER','accountcode','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','friend','user','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x4f99c4,_0x38bc87){var _0x9a9d6d=function(_0x334245){while(--_0x334245){_0x4f99c4['push'](_0x4f99c4['shift']());}};_0x9a9d6d(++_0x38bc87);}(_0x1472,0x188));var _0x2147=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0x1472[_0xce9195];return _0x530fe6;};'use strict';var Sequelize=require(_0x2147('0x0'));var moment=require(_0x2147('0x1'));var util=require(_0x2147('0x2'));var _=require('lodash');module[_0x2147('0x3')]={'name':{'type':Sequelize[_0x2147('0x4')],'allowNull':![],'unique':_0x2147('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x55740d){this[_0x2147('0x6')](_0x2147('0x5'),_0x55740d);this[_0x2147('0x6')]('defaultuser',_0x55740d);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x2147('0x4')],'allowNull':![],'set':function(_0x3ce967){this[_0x2147('0x6')]('fullname',_0x3ce967);this[_0x2147('0x6')](_0x2147('0x7'),util[_0x2147('0x8')](_0x2147('0x9'),_0x3ce967,this['getDataValue'](_0x2147('0xa'))));}},'alias':{'type':Sequelize[_0x2147('0x4')]},'email':{'type':Sequelize[_0x2147('0x4')],'allowNull':![],'unique':_0x2147('0xb'),'validate':{'isEmail':!![]},'set':function(_0x221df0){if(_0x221df0){this[_0x2147('0x6')](_0x2147('0xb'),_0x221df0[_0x2147('0xc')]());}}},'role':{'type':Sequelize[_0x2147('0xd')]('admin','user','agent',_0x2147('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x2147('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x2147('0xf')},'internal':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':![],'unique':_0x2147('0xa'),'set':function(_0x2900d5){this[_0x2147('0x6')](_0x2147('0xa'),_0x2900d5);this[_0x2147('0x6')](_0x2147('0x11'),_0x2900d5);this[_0x2147('0x6')]('callerid',util[_0x2147('0x8')]('\x22%s\x22\x20<%s>',this[_0x2147('0x12')]('fullname'),_0x2900d5));}},'salt':{'type':Sequelize[_0x2147('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x2147('0x4')]},'address':{'type':Sequelize[_0x2147('0x4')]},'zipcode':{'type':Sequelize[_0x2147('0x4')]},'userpic':{'type':Sequelize[_0x2147('0x4')]},'city':{'type':Sequelize[_0x2147('0x4')]},'country':{'type':Sequelize[_0x2147('0x4')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2147('0x4')],'defaultValue':_0x2147('0x14')},'lastPauseAt':{'type':Sequelize[_0x2147('0x15')]},'chatCapacity':{'type':Sequelize[_0x2147('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x2147('0x10')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x2147('0x10')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x2147('0x10')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x2147('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x2147('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x16'),_0x2147('0x17'),'peer'),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![],'defaultValue':_0x2147('0x18')},'callingpres':{'type':Sequelize['ENUM'](_0x2147('0x19'),_0x2147('0x1a'),_0x2147('0x1b'),_0x2147('0x1c'),_0x2147('0x1d'),_0x2147('0x1e'),_0x2147('0x1f'),_0x2147('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2147('0x21'),'set':function(_0xcfffda){this[_0x2147('0x6')](_0x2147('0x22'),_0xcfffda?_0xcfffda['join'](','):null);},'get':function(){return this[_0x2147('0x12')](_0x2147('0x22'))?this['getDataValue'](_0x2147('0x22'))[_0x2147('0x23')](','):null;},'comment':_0x2147('0x24')},'dtmfmode':{'type':Sequelize['ENUM'](_0x2147('0x25'),'info',_0x2147('0x26'),_0x2147('0x27'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no',_0x2147('0x29'),_0x2147('0x2a'),_0x2147('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![],'defaultValue':_0x2147('0x2c'),'set':function(_0x3c76b9){this[_0x2147('0x6')](_0x2147('0x2d'),_0x3c76b9?_0x3c76b9[_0x2147('0x2e')](','):null);},'get':function(){return this[_0x2147('0x12')]('nat')?this[_0x2147('0x12')](_0x2147('0x2d'))[_0x2147('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x2147('0x4')]},'namedcallgroup':{'type':Sequelize[_0x2147('0x4')]},'pickupgroup':{'type':Sequelize[_0x2147('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x2147('0x4')]},'language':{'type':Sequelize[_0x2147('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2147('0x4')]},'disallow':{'type':Sequelize[_0x2147('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x2147('0x4')],'allowNull':![],'defaultValue':_0x2147('0x2f'),'set':function(_0x3516f6){this[_0x2147('0x6')](_0x2147('0x30'),_0x3516f6?_0x3516f6['join'](';'):_0x2147('0x2f'));},'get':function(){return this[_0x2147('0x12')](_0x2147('0x30'))?this[_0x2147('0x12')](_0x2147('0x30'))['split'](';'):null;},'comment':_0x2147('0x31')},'autoframing':{'type':Sequelize['ENUM'](_0x2147('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x237ae3){this[_0x2147('0x6')](_0x2147('0x32'),_0x237ae3?_0x237ae3[_0x2147('0x2e')](','):null);},'get':function(){return this[_0x2147('0x12')](_0x2147('0x32'))?this['getDataValue'](_0x2147('0x32'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no',_0x2147('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2147('0xd')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2147('0x34')},'amaflags':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x2147('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x2147('0xd')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2147('0xd')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x2147('0xd')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x2147('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x35'),_0x2147('0x36'),_0x2147('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x38'),_0x2147('0x39')),'allowNull':!![],'defaultValue':_0x2147('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![],'defaultValue':_0x2147('0x28')},'keepalive':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2147('0xd')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x2147('0x3a'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2147('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2147('0xd')](_0x2147('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat','update',_0x2147('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x2147('0x15')]},'passwordResetAt':{'type':Sequelize[_0x2147('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x2147('0x3c')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x27e1f5){this[_0x2147('0x6')](_0x2147('0x3d'),_0x27e1f5);var _0x3f9d74=this[_0x2147('0x3e')]({'plain':!![]});switch(_0x27e1f5){case 0x0:case 0x1:var _0x46f8f2=_0x3f9d74[_0x2147('0x22')]?_[_0x2147('0x3f')](_0x3f9d74[_0x2147('0x22')])?_0x3f9d74[_0x2147('0x22')][_0x2147('0x2e')]():_0x3f9d74['transport']:'udp';if(_0x46f8f2===_0x2147('0x40')){_0x46f8f2='udp';}this['setDataValue']('transport',_0x46f8f2);this['setDataValue'](_0x2147('0x41'),'no');this[_0x2147('0x6')]('avpf',null);this[_0x2147('0x6')]('force_avp',null);this[_0x2147('0x6')](_0x2147('0x42'),null);this['setDataValue'](_0x2147('0x43'),null);this[_0x2147('0x6')](_0x2147('0x44'),null);this[_0x2147('0x6')](_0x2147('0x45'),null);this[_0x2147('0x6')]('dtlscertfile',null);this[_0x2147('0x6')]('dtlsprivatekey',null);this[_0x2147('0x6')](_0x2147('0x46'),'no');break;case 0x2:this[_0x2147('0x6')](_0x2147('0x22'),_0x2147('0x40'));this[_0x2147('0x6')](_0x2147('0x41'),'yes');this[_0x2147('0x6')](_0x2147('0x47'),'yes');this['setDataValue']('force_avp',_0x2147('0x28'));this[_0x2147('0x6')]('icesupport','yes');this[_0x2147('0x6')](_0x2147('0x43'),_0x2147('0x28'));this[_0x2147('0x6')](_0x2147('0x44'),'no');this[_0x2147('0x6')](_0x2147('0x45'),_0x2147('0x48'));this[_0x2147('0x6')](_0x2147('0x49'),_0x3f9d74[_0x2147('0x49')]||_0x2147('0x4a'));this[_0x2147('0x6')](_0x2147('0x4b'),_0x3f9d74['dtlsprivatekey']||_0x2147('0x4c'));this['setDataValue'](_0x2147('0x46'),_0x2147('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x2147('0x3c')],'set':function(_0x41fc28){this[_0x2147('0x6')](_0x2147('0x4d'),_0x41fc28?_0x41fc28[_0x2147('0x2e')](','):[]);},'get':function(){return this['getDataValue'](_0x2147('0x4d'))?_['map'](this[_0x2147('0x12')](_0x2147('0x4d'))[_0x2147('0x23')](','),function(_0x118341){return parseInt(_0x118341,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x2147('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x2147('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x2147('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2147('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2147('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2147('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x2147('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2147('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2147('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x2147('0x12')](_0x2147('0x4e')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0x2147('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x2147('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![],'set':function(_0x566be1){if(typeof _0x566be1===_0x2147('0x4f')){var _0x38244e=_0x566be1==='1'?!![]:_0x566be1==='0'?![]:_0x566be1===_0x2147('0x50')?!![]:_0x566be1===_0x2147('0x51')?![]:![];this[_0x2147('0x6')]('screenrecording',_0x38244e);}else{this[_0x2147('0x6')](_0x2147('0x52'),_0x566be1);}}},'blocked':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![],'set':function(_0x5e3c0d){this['setDataValue']('blocked',_0x5e3c0d);if(_0x5e3c0d===!![]){this[_0x2147('0x6')]('blockedAt',moment());this[_0x2147('0x6')]('loginAttempts',0x0);}else{this['setDataValue'](_0x2147('0x53'),null);}}},'blockedAt':{'type':Sequelize[_0x2147('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x2147('0x10')](0x5)[_0x2147('0x54')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x2147('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2147('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x2147('0x10')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x2147('0x10')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x2147('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x2147('0x10')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x2147('0x10')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4bcc=['INTEGER','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','outgoing','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','TEXT','showWebBar','get','isArray','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','wss','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','exports','STRING','name','The\x20name\x20of\x20the\x20user','fullname','setDataValue','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','user','local','callerid','format','BOOLEAN','DATE','DEFAULT\x20PAUSE'];(function(_0x1fc709,_0x5efeab){var _0xb4a0b0=function(_0x317298){while(--_0x317298){_0x1fc709['push'](_0x1fc709['shift']());}};_0xb4a0b0(++_0x5efeab);}(_0x4bcc,0x149));var _0xc4bc=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x4bcc[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xc4bc('0x0'));var moment=require('moment');var util=require('util');var _=require('lodash');module[_0xc4bc('0x1')]={'name':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':![],'unique':_0xc4bc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x387c3f){this['setDataValue']('name',_0x387c3f);this['setDataValue']('defaultuser',_0x387c3f);},'comment':_0xc4bc('0x4')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x126e8c){this['setDataValue'](_0xc4bc('0x5'),_0x126e8c);this[_0xc4bc('0x6')]('callerid',util['format'](_0xc4bc('0x7'),_0x126e8c,this[_0xc4bc('0x8')](_0xc4bc('0x9'))));}},'alias':{'type':Sequelize[_0xc4bc('0x2')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc4bc('0xa'),'validate':{'isEmail':!![]},'set':function(_0x2e090b){if(_0x2e090b){this[_0xc4bc('0x6')](_0xc4bc('0xa'),_0x2e090b['toLowerCase']());}}},'role':{'type':Sequelize[_0xc4bc('0xb')]('admin',_0xc4bc('0xc'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xc4bc('0x2')],'defaultValue':_0xc4bc('0xd')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xc4bc('0x9'),'set':function(_0x464047){this[_0xc4bc('0x6')](_0xc4bc('0x9'),_0x464047);this[_0xc4bc('0x6')]('accountcode',_0x464047);this[_0xc4bc('0x6')](_0xc4bc('0xe'),util[_0xc4bc('0xf')](_0xc4bc('0x7'),this[_0xc4bc('0x8')](_0xc4bc('0x5')),_0x464047));}},'salt':{'type':Sequelize[_0xc4bc('0x2')]},'phone':{'type':Sequelize[_0xc4bc('0x2')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xc4bc('0x2')]},'zipcode':{'type':Sequelize[_0xc4bc('0x2')]},'userpic':{'type':Sequelize[_0xc4bc('0x2')]},'city':{'type':Sequelize[_0xc4bc('0x2')]},'country':{'type':Sequelize[_0xc4bc('0x2')]},'online':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xc4bc('0x11')]},'voicePause':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xc4bc('0x2')],'defaultValue':_0xc4bc('0x12')},'lastPauseAt':{'type':Sequelize[_0xc4bc('0x11')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xc4bc('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xc4bc('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x14'),_0xc4bc('0xc'),'peer'),'allowNull':!![],'defaultValue':_0xc4bc('0x14')},'context':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![],'defaultValue':_0xc4bc('0x15')},'callingpres':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x16'),_0xc4bc('0x17'),_0xc4bc('0x18'),'ALLOWED','PROHIB_NOT_SCREENED',_0xc4bc('0x19'),_0xc4bc('0x1a'),_0xc4bc('0x1b')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xc4bc('0x1c'),'set':function(_0x4e1d42){this[_0xc4bc('0x6')]('transport',_0x4e1d42?_0x4e1d42[_0xc4bc('0x1d')](','):null);},'get':function(){return this[_0xc4bc('0x8')](_0xc4bc('0x1e'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0xc4bc('0x1f')},'dtmfmode':{'type':Sequelize[_0xc4bc('0xb')]('rfc2833',_0xc4bc('0x20'),_0xc4bc('0x21'),_0xc4bc('0x22'),_0xc4bc('0x23')),'allowNull':!![],'defaultValue':_0xc4bc('0x24')},'directmedia':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no',_0xc4bc('0x26'),'update',_0xc4bc('0x27')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xc4bc('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x508c5c){this['setDataValue'](_0xc4bc('0x28'),_0x508c5c?_0x508c5c[_0xc4bc('0x1d')](','):null);},'get':function(){return this[_0xc4bc('0x8')](_0xc4bc('0x28'))?this[_0xc4bc('0x8')](_0xc4bc('0x28'))[_0xc4bc('0x29')](','):null;},'comment':_0xc4bc('0x2a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xc4bc('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc4bc('0x2')]},'disallow':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':![],'defaultValue':_0xc4bc('0x2b')},'allow':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x592e31){this[_0xc4bc('0x6')](_0xc4bc('0x2c'),_0x592e31?_0x592e31['join'](';'):_0xc4bc('0x2d'));},'get':function(){return this['getDataValue'](_0xc4bc('0x2c'))?this['getDataValue'](_0xc4bc('0x2c'))['split'](';'):null;},'comment':_0xc4bc('0x2e')},'autoframing':{'type':Sequelize[_0xc4bc('0xb')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![],'set':function(_0xdffcae){this[_0xc4bc('0x6')](_0xc4bc('0x2f'),_0xdffcae?_0xdffcae[_0xc4bc('0x1d')](','):null);},'get':function(){return this[_0xc4bc('0x8')](_0xc4bc('0x2f'))?this[_0xc4bc('0x8')](_0xc4bc('0x2f'))[_0xc4bc('0x29')](','):null;},'comment':_0xc4bc('0x30')},'trustrpid':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xc4bc('0x25'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xc4bc('0xb')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xc4bc('0x31')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![],'defaultValue':_0xc4bc('0x25')},'busylevel':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xc4bc('0x25'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc4bc('0xb')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc4bc('0xb')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xc4bc('0x25'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc4bc('0xb')]('yes','no',_0xc4bc('0x32')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc4bc('0xb')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xc4bc('0xb')]('accept',_0xc4bc('0x33'),_0xc4bc('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x35'),_0xc4bc('0x36')),'allowNull':!![],'defaultValue':_0xc4bc('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![],'defaultValue':_0xc4bc('0x25')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xc4bc('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xc4bc('0x25'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc4bc('0xb')]('yes','no',_0xc4bc('0x37'),_0xc4bc('0x38')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x39'),_0xc4bc('0x3a'),_0xc4bc('0x3b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc4bc('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xc4bc('0xb')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc4bc('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no',_0xc4bc('0x26'),_0xc4bc('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xc4bc('0x11')]},'passwordResetAt':{'type':Sequelize[_0xc4bc('0x11')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc4bc('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x512ed9){this[_0xc4bc('0x6')](_0xc4bc('0x3e'),_0x512ed9);var _0x9e29cc=this[_0xc4bc('0x3f')]({'plain':!![]});switch(_0x512ed9){case 0x0:case 0x1:var _0xbc2016=_0x9e29cc[_0xc4bc('0x1e')]?_[_0xc4bc('0x40')](_0x9e29cc[_0xc4bc('0x1e')])?_0x9e29cc['transport'][_0xc4bc('0x1d')]():_0x9e29cc[_0xc4bc('0x1e')]:_0xc4bc('0x1c');if(_0xbc2016==='wss'){_0xbc2016=_0xc4bc('0x1c');}this['setDataValue'](_0xc4bc('0x1e'),_0xbc2016);this[_0xc4bc('0x6')]('encryption','no');this['setDataValue'](_0xc4bc('0x41'),null);this[_0xc4bc('0x6')](_0xc4bc('0x42'),null);this[_0xc4bc('0x6')](_0xc4bc('0x43'),null);this[_0xc4bc('0x6')](_0xc4bc('0x44'),null);this[_0xc4bc('0x6')](_0xc4bc('0x45'),null);this[_0xc4bc('0x6')](_0xc4bc('0x46'),null);this[_0xc4bc('0x6')]('dtlscertfile',null);this[_0xc4bc('0x6')](_0xc4bc('0x47'),null);this[_0xc4bc('0x6')](_0xc4bc('0x48'),'no');break;case 0x2:this[_0xc4bc('0x6')](_0xc4bc('0x1e'),_0xc4bc('0x49'));this[_0xc4bc('0x6')]('encryption',_0xc4bc('0x25'));this[_0xc4bc('0x6')](_0xc4bc('0x41'),_0xc4bc('0x25'));this['setDataValue'](_0xc4bc('0x42'),_0xc4bc('0x25'));this['setDataValue'](_0xc4bc('0x43'),'yes');this[_0xc4bc('0x6')](_0xc4bc('0x44'),'yes');this[_0xc4bc('0x6')](_0xc4bc('0x45'),'no');this['setDataValue'](_0xc4bc('0x46'),_0xc4bc('0x3b'));this[_0xc4bc('0x6')]('dtlscertfile',_0x9e29cc[_0xc4bc('0x4a')]||_0xc4bc('0x4b'));this[_0xc4bc('0x6')](_0xc4bc('0x47'),_0x9e29cc['dtlsprivatekey']||_0xc4bc('0x4c'));this['setDataValue'](_0xc4bc('0x48'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x34ab0b){this['setDataValue']('permissions',_0x34ab0b?_0x34ab0b[_0xc4bc('0x1d')](','):[]);},'get':function(){return this[_0xc4bc('0x8')](_0xc4bc('0x4d'))?_[_0xc4bc('0x4e')](this[_0xc4bc('0x8')](_0xc4bc('0x4d'))['split'](','),function(_0x566444){return parseInt(_0x566444,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc4bc('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc4bc('0x2')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc4bc('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc4bc('0xb')](_0xc4bc('0x25'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xc4bc('0x2')]},'phoneBarEnableJaws':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc4bc('0x4f')],'get':function(){return this[_0xc4bc('0x8')](_0xc4bc('0x50'))?this['getDataValue'](_0xc4bc('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'interface':{'type':Sequelize[_0xc4bc('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![],'set':function(_0x1f1056){if(typeof _0x1f1056===_0xc4bc('0x51')){var _0x385e0a=_0x1f1056==='1'?!![]:_0x1f1056==='0'?![]:_0x1f1056===_0xc4bc('0x52')?!![]:_0x1f1056==='false'?![]:![];this[_0xc4bc('0x6')](_0xc4bc('0x53'),_0x385e0a);}else{this['setDataValue'](_0xc4bc('0x53'),_0x1f1056);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xfcaaea){this[_0xc4bc('0x6')](_0xc4bc('0x54'),_0xfcaaea);if(_0xfcaaea===!![]){this[_0xc4bc('0x6')](_0xc4bc('0x55'),moment());this[_0xc4bc('0x6')](_0xc4bc('0x56'),0x0);}else{this[_0xc4bc('0x6')](_0xc4bc('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0xc4bc('0x11')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc4bc('0x13')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xc4bc('0x10')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xc4bc('0x13')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index c0bb28f..e868dd2 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 _0xc27c=['../../config/utils','../../config/license/util','../../errors/api','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','status','json','offset','undefined','limit','count','set','Content-Range','update','role','emit','userNotification:recalc:','destroy','then','get','Users','user','Agents','agent','filter','ignore','map','value','find','name','end','error','stack','rawAttributes','key','password','salt','previousPasswords','resetPasswordExpires','md5secret','includes','index','where','User','query','include','true','userSetting','attributes','findAll','rows','openTabs','length','push','dataValues','fax','mail','whatsapp','all','catch','show','params','getOptions','includeAll','UserSetting','merge','options','sms','openchannel','body','describe','addContacts','ids','omit','Setting','findById','securePassword','validatePasswordPattern','max','internal','min_internal','sequelize','QueryTypes','SELECT','isNil','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','105','106','108','109','111','114','115','create','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','UserProfileSection','Telephones','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','VoiceQueue','format','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Queue:remove','addAvatar','file','filename','getAvatar','server/files/images/logos/default_profile.png','userpic','existsSync','root','server/files/images/','download','join','getOpenTabs','chat','CHAT','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','createdAt','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tags','color','tag','getQueues','keys','filters','intersection','fields','model','order','sort','pick','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','bulkCreate','isMiddleware','resolve','pause','updateAttributes','SIP/%s','type','DEFAULT\x20PAUSE','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','whatsappPause','pauseType','lastPauseAt','unpause','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','addAgent','getDataValue','TeamVoicePrefix','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','flattenDeep','UserVoicePrefix','VoicePrefixId','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','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','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$ne','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$contains','$contained','firstName','lastName','CmContact','Contact','dialActive','Queue','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','token','apiKeyNonce','API\x20key\x20not\x20available','whoami','send','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','idle','teams','queues','flatten','col','asc','desc','substring','uniqBy','orderBy','getRealtimeAgents','voiceStatus','unavailable','busy','charAt','toUpperCase','slice','select','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','toString','OpenTabs','messengerSoundNotification','enabled','moment','util','path','lodash','squel','ioredis','../../components/auth/service','../../components/contacts','api'];(function(_0x4011c5,_0x137d91){var _0x4b1d64=function(_0x254d64){while(--_0x254d64){_0x4011c5['push'](_0x4011c5['shift']());}};_0x4b1d64(++_0x137d91);}(_0xc27c,0x182));var _0xcc27=function(_0xfcbe93,_0x4e9582){_0xfcbe93=_0xfcbe93-0x0;var _0x4b2151=_0xc27c[_0xfcbe93];return _0x4b2151;};'use strict';var moment=require(_0xcc27('0x0'));var util=require(_0xcc27('0x1'));var path=require(_0xcc27('0x2'));var fs=require('fs');var _=require(_0xcc27('0x3'));var squel=require(_0xcc27('0x4'));var Redis=require(_0xcc27('0x5'));var authService=require(_0xcc27('0x6'));var contacts=require(_0xcc27('0x7'));var qs=require('../../components/parsers/qs');var rta=require('../../components/realtime/agents');var logger=require('../../config/logger')(_0xcc27('0x8'));var utils=require(_0xcc27('0x9'));var config=require('../../config/environment');var licenseUtil=require(_0xcc27('0xa'));var APIBadRequestError=require(_0xcc27('0xb'))['APIBadRequestError'];var APINotFoundError=require(_0xcc27('0xb'))[_0xcc27('0xc')];var APIForbiddenError=require(_0xcc27('0xb'))['APIForbiddenrror'];var APIHandleError=require('../../errors/api')[_0xcc27('0xd')];var db=require(_0xcc27('0xe'))['db'];var socket=require(_0xcc27('0xf'))(new Redis(config[_0xcc27('0x10')]));require(_0xcc27('0x11'))[_0xcc27('0x12')](socket);config['redis']=_[_0xcc27('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var values;function respondWithStatusCode(_0x3eda02,_0x317e0a){_0x317e0a=_0x317e0a||0xcc;return function(_0x365525){if(_0x365525){return _0x3eda02['sendStatus'](_0x317e0a);}return _0x3eda02[_0xcc27('0x14')](_0x317e0a)['end']();};}function respondWithResult(_0x366110,_0x2067f1){_0x2067f1=_0x2067f1||0xc8;return function(_0x3867ba){if(_0x3867ba){return _0x366110[_0xcc27('0x14')](_0x2067f1)[_0xcc27('0x15')](_0x3867ba);}};}function respondWithFilteredResult(_0x1b7502,_0x1dac72){return function(_0x2c8a54){if(_0x2c8a54){var _0x28349=typeof _0x1dac72[_0xcc27('0x16')]===_0xcc27('0x17')&&typeof _0x1dac72[_0xcc27('0x18')]===_0xcc27('0x17');var _0x321822=_0x2c8a54[_0xcc27('0x19')];var _0x1ddd98=_0x28349?0x0:_0x1dac72[_0xcc27('0x16')];var _0xed70af=_0x28349?_0x2c8a54[_0xcc27('0x19')]:_0x1dac72[_0xcc27('0x16')]+_0x1dac72['limit'];var _0x3da76b;if(_0xed70af>=_0x321822){_0xed70af=_0x321822;_0x3da76b=0xc8;}else{_0x3da76b=0xce;}_0x1b7502['status'](_0x3da76b);return _0x1b7502[_0xcc27('0x1a')](_0xcc27('0x1b'),_0x1ddd98+'-'+_0xed70af+'/'+_0x321822)['json'](_0x2c8a54);}return null;};}function saveUpdates(_0x4ac9ba){return function(_0x2835e6){if(_0x2835e6){return _0x2835e6[_0xcc27('0x1c')](_0x4ac9ba)['then'](function(_0x30a7ab){if(_0x30a7ab[_0xcc27('0x1d')]==='agent'){socket[_0xcc27('0x1e')](_0xcc27('0x1f')+_0x30a7ab['id'],_0x30a7ab);}return _0x30a7ab;});}return null;};}function removeEntity(_0x4725f8,_0x52913a){return function(_0x163706){if(_0x163706){return _0x163706[_0xcc27('0x20')]({'transaction':_0x52913a})[_0xcc27('0x21')](function(){var _0x4a58d3=_0x163706[_0xcc27('0x22')]({'plain':!![]});if(_0x4a58d3[_0xcc27('0x1d')]==='admin')return;var _0x7ea148=[{'name':_0xcc27('0x23'),'value':_0xcc27('0x24'),'ignore':!![]},{'name':_0xcc27('0x25'),'value':_0xcc27('0x26'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x4abd20=_(_0x7ea148)[_0xcc27('0x27')](_0xcc27('0x28'))[_0xcc27('0x29')](_0xcc27('0x2a'))[_0xcc27('0x2a')]();if(_['includes'](_0x4abd20,_0x4a58d3[_0xcc27('0x1d')])){return;}var _0x1b9198=_[_0xcc27('0x2b')](_0x7ea148,[_0xcc27('0x2a'),_0x4a58d3[_0xcc27('0x1d')]])[_0xcc27('0x2c')];return db['UserProfileResource'][_0xcc27('0x20')]({'where':{'type':_0x1b9198,'resourceId':_0x4a58d3['id']},'transaction':_0x52913a})[_0xcc27('0x21')](function(){return _0x163706;});})[_0xcc27('0x21')](function(){_0x4725f8[_0xcc27('0x14')](0xcc)[_0xcc27('0x2d')]();});}};}function handleEntityNotFound(_0x3b2222){return function(_0x237147){if(!_0x237147){_0x3b2222['sendStatus'](0x194);}return _0x237147;};}function handleError(_0x2ef6d,_0x400727){_0x400727=_0x400727||0x1f4;return function(_0x4aebb0){logger[_0xcc27('0x2e')](_0x4aebb0[_0xcc27('0x2f')]);if(_0x4aebb0[_0xcc27('0x2c')]){delete _0x4aebb0['name'];}_0x2ef6d[_0xcc27('0x14')](_0x400727)['send'](_0x4aebb0);};}function getUserAttributes(){return _(db['User'][_0xcc27('0x30')])[_0xcc27('0x29')](function(_0xbe1a29){return{'name':_0xbe1a29['fieldName'],'type':_0xbe1a29['type'][_0xcc27('0x31')]};})[_0xcc27('0x27')](function(_0x33d73f){return![_0xcc27('0x32'),_0xcc27('0x33'),_0xcc27('0x34'),'resetPasswordToken',_0xcc27('0x35'),_0xcc27('0x36')][_0xcc27('0x37')](_0x33d73f[_0xcc27('0x2c')]);})[_0xcc27('0x2a')]();}exports[_0xcc27('0x38')]=function(_0xec82b7,_0x4f7002){var _0x255de6={},_0x34df03={'count':0x0,'rows':[]};var _0x49f843=getUserAttributes();_0x255de6=qs['getOptions'](_0x49f843,_0xec82b7);var _0xdd71c3={'where':_0x255de6[_0xcc27('0x39')]};return db[_0xcc27('0x3a')][_0xcc27('0x19')](_0xdd71c3)[_0xcc27('0x21')](function(_0x384df8){_0x34df03['count']=_0x384df8;if(_0xec82b7[_0xcc27('0x3b')]['includeAll']){_0x255de6[_0xcc27('0x3c')]=[{'all':!![]}];}if(_0xec82b7[_0xcc27('0x3b')]['userSetting']===_0xcc27('0x3d')){_0x255de6[_0xcc27('0x3c')]=[{'model':db['UserSetting'],'as':_0xcc27('0x3e')}];}if(!_[_0xcc27('0x37')](_0x255de6[_0xcc27('0x3f')],'id')){_0x255de6[_0xcc27('0x3f')]['push']('id');}return db[_0xcc27('0x3a')][_0xcc27('0x40')](_0x255de6);})['then'](function(_0x5ebc82){_0x34df03[_0xcc27('0x41')]=_0x5ebc82;if(_0xec82b7['query'][_0xcc27('0x42')]===_0xcc27('0x3d')){var _0x53ac40=[];for(var _0x4e959a=0x0;_0x4e959a<_0x34df03[_0xcc27('0x41')][_0xcc27('0x43')];_0x4e959a++){_0x53ac40[_0xcc27('0x44')](get_open_tabs('chat',_0x34df03['rows'][_0x4e959a][_0xcc27('0x45')]));_0x53ac40['push'](get_open_tabs('sms',_0x34df03['rows'][_0x4e959a][_0xcc27('0x45')]));_0x53ac40['push'](get_open_tabs(_0xcc27('0x46'),_0x34df03[_0xcc27('0x41')][_0x4e959a][_0xcc27('0x45')]));_0x53ac40['push'](get_open_tabs(_0xcc27('0x47'),_0x34df03[_0xcc27('0x41')][_0x4e959a][_0xcc27('0x45')]));_0x53ac40['push'](get_open_tabs('openchannel',_0x34df03[_0xcc27('0x41')][_0x4e959a][_0xcc27('0x45')]));_0x53ac40['push'](get_open_tabs(_0xcc27('0x48'),_0x34df03['rows'][_0x4e959a]['dataValues']));}return Promise[_0xcc27('0x49')](_0x53ac40)[_0xcc27('0x21')](function(){return _0x34df03;});}else{return _0x34df03;}})[_0xcc27('0x21')](respondWithFilteredResult(_0x4f7002,_0x255de6))[_0xcc27('0x4a')](handleError(_0x4f7002,null));};exports[_0xcc27('0x4b')]=function(_0x6a4c5d,_0x5b302f){var _0x146844=getUserAttributes();_0x6a4c5d[_0xcc27('0x3b')]['id']=_0x6a4c5d[_0xcc27('0x4c')]['id'];var _0x531eb0=qs[_0xcc27('0x4d')](_0x146844,_0x6a4c5d);if(_0x6a4c5d['query'][_0xcc27('0x4e')]){_0x531eb0[_0xcc27('0x3c')]=[{'all':!![]}];}if(_0x6a4c5d['query'][_0xcc27('0x3e')]===_0xcc27('0x3d')){_0x531eb0[_0xcc27('0x3c')]=[{'model':db[_0xcc27('0x4f')],'as':_0xcc27('0x3e')}];}_0x531eb0=_[_0xcc27('0x50')]({},_0x531eb0,_0x6a4c5d[_0xcc27('0x51')]);if(!_[_0xcc27('0x37')](_0x531eb0[_0xcc27('0x3f')],'id')){_0x531eb0['attributes'][_0xcc27('0x44')]('id');}return db[_0xcc27('0x3a')][_0xcc27('0x2b')](_0x531eb0)[_0xcc27('0x21')](handleEntityNotFound(_0x5b302f,null))['then'](function(_0x2c1486){var _0x5adae4=[];values=_0x2c1486;if(_0x6a4c5d[_0xcc27('0x3b')][_0xcc27('0x42')]===_0xcc27('0x3d')){_0x5adae4[_0xcc27('0x44')](get_open_tabs('chat',_0x2c1486[_0xcc27('0x45')]));_0x5adae4[_0xcc27('0x44')](get_open_tabs(_0xcc27('0x52'),_0x2c1486[_0xcc27('0x45')]));_0x5adae4[_0xcc27('0x44')](get_open_tabs(_0xcc27('0x53'),_0x2c1486[_0xcc27('0x45')]));_0x5adae4[_0xcc27('0x44')](get_open_tabs('whatsapp',_0x2c1486['dataValues']));_0x5adae4['push'](get_open_tabs(_0xcc27('0x46'),_0x2c1486[_0xcc27('0x45')]));_0x5adae4[_0xcc27('0x44')](get_open_tabs('mail',_0x2c1486[_0xcc27('0x45')]));return Promise[_0xcc27('0x49')](_0x5adae4);}else{return values;}})[_0xcc27('0x21')](function(){return values;})[_0xcc27('0x21')](respondWithResult(_0x5b302f,null))[_0xcc27('0x4a')](handleError(_0x5b302f,null));};exports[_0xcc27('0x1c')]=function(_0x37e98a,_0x287aa8){if(_0x37e98a[_0xcc27('0x54')]['id']){delete _0x37e98a[_0xcc27('0x54')]['id'];}delete _0x37e98a[_0xcc27('0x54')][_0xcc27('0x1d')];return db[_0xcc27('0x3a')]['find']({'where':{'id':_0x37e98a[_0xcc27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x287aa8,null))[_0xcc27('0x21')](saveUpdates(_0x37e98a['body'],null))['then'](respondWithResult(_0x287aa8,null))['catch'](handleError(_0x287aa8,null));};exports[_0xcc27('0x55')]=function(_0x2292ff,_0x2d90b5){return db['User'][_0xcc27('0x55')]()['then'](respondWithResult(_0x2d90b5,null))[_0xcc27('0x4a')](handleError(_0x2d90b5,null));};exports[_0xcc27('0x56')]=function(_0x2ec9eb,_0x1896bf){return db[_0xcc27('0x3a')]['find']({'where':{'id':_0x2ec9eb[_0xcc27('0x4c')]['id']}})[_0xcc27('0x21')](handleEntityNotFound(_0x1896bf,null))['then'](function(_0x20e540){if(_0x20e540){return _0x20e540['addContacts'](_0x2ec9eb['body'][_0xcc27('0x57')],_[_0xcc27('0x58')](_0x2ec9eb[_0xcc27('0x54')],[_0xcc27('0x57'),'id'])||{});}})[_0xcc27('0x21')](respondWithResult(_0x1896bf,null))['catch'](handleError(_0x1896bf,null));};function validateUser(_0x472a50){return new Promise(function(_0xffee2b,_0x492cce){if(_0x472a50['internal'])return _0xffee2b(_0x472a50);return db[_0xcc27('0x59')][_0xcc27('0x5a')](0x1)[_0xcc27('0x21')](function(_0x8ea687){if(_0x8ea687[_0xcc27('0x5b')])authService[_0xcc27('0x5c')](_0x472a50[_0xcc27('0x32')]);db[_0xcc27('0x3a')][_0xcc27('0x5d')](_0xcc27('0x5e'))[_0xcc27('0x21')](function(_0x13ed98){if(_['isNil'](_0x13ed98)){_0x472a50[_0xcc27('0x5e')]=_0x8ea687[_0xcc27('0x5f')]||0x1;return;}if(_['isNil'](_0x8ea687[_0xcc27('0x5f')])||_0x8ea687[_0xcc27('0x5f')]===_0x13ed98){_0x472a50['internal']=_0x13ed98+0x1;return;}if(_0x8ea687[_0xcc27('0x5f')]>_0x13ed98){_0x472a50[_0xcc27('0x5e')]=_0x8ea687['min_internal'];return;}return db[_0xcc27('0x60')][_0xcc27('0x3b')]('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[_0xcc27('0x60')][_0xcc27('0x61')][_0xcc27('0x62')]})[_0xcc27('0x21')](function(_0x1b49fe){if(_0x1b49fe&&_0x1b49fe[_0xcc27('0x43')]){for(var _0x2a4205=0x0,_0x411a64=_0x1b49fe[_0xcc27('0x43')];_0x2a4205<_0x411a64&&_[_0xcc27('0x63')](_0x472a50['internal']);_0x2a4205++){if(_0x8ea687[_0xcc27('0x5f')]<=_0x1b49fe[_0x2a4205]['from']){_0x472a50[_0xcc27('0x5e')]=_0x1b49fe[_0x2a4205][_0xcc27('0x64')];}else if(_0x8ea687[_0xcc27('0x5f')]>_0x1b49fe[_0x2a4205]['from']&&_0x8ea687['min_internal']<=_0x1b49fe[_0x2a4205]['to']){_0x472a50[_0xcc27('0x5e')]=_0x8ea687['min_internal'];}}}if(_[_0xcc27('0x63')](_0x472a50[_0xcc27('0x5e')])){_0x472a50[_0xcc27('0x5e')]=_0x13ed98+0x1;}return _0xffee2b(_0x472a50);});});})[_0xcc27('0x4a')](function(_0x5a9499){_0x492cce(_0x5a9499);});});}function updateUser(_0x1ad948){return new Promise(function(_0x446a08,_0x331d33){try{if(_0x1ad948[_0xcc27('0x65')]){_0x1ad948[_0xcc27('0x66')]=_0x1ad948[_0xcc27('0x5e')];_0x1ad948[_0xcc27('0x67')]={'mailbox':_0x1ad948[_0xcc27('0x5e')],'password':_0x1ad948[_0xcc27('0x32')],'fullname':_0x1ad948[_0xcc27('0x68')],'email':_0x1ad948[_0xcc27('0x69')]};}if(_0x1ad948[_0xcc27('0x1d')]===_0xcc27('0x26')){if(!_0x1ad948['permissions'])_0x1ad948[_0xcc27('0x6a')]=[_0xcc27('0x6b'),_0xcc27('0x6c'),_0xcc27('0x6d'),_0xcc27('0x6e'),_0xcc27('0x6f'),'104',_0xcc27('0x70'),_0xcc27('0x71'),'107',_0xcc27('0x72'),_0xcc27('0x73'),'100',_0xcc27('0x74'),_0xcc27('0x75'),_0xcc27('0x76')];}_0x446a08(_0x1ad948);}catch(_0x4acbc3){_0x331d33(_0x4acbc3);}});}exports[_0xcc27('0x77')]=function(_0x52ced5,_0x268f32){if(_0x52ced5[_0xcc27('0x24')][_0xcc27('0x1d')]===_0xcc27('0x26'))throw new Error('Unauthorized');if(_0x52ced5[_0xcc27('0x54')][_0xcc27('0x1d')]==='user'&&_0x52ced5[_0xcc27('0x24')][_0xcc27('0x1d')]!==_0xcc27('0x78')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x52ced5[_0xcc27('0x54')][_0xcc27('0x1d')]===_0xcc27('0x78')&&_0x52ced5[_0xcc27('0x24')][_0xcc27('0x1d')]!==_0xcc27('0x78')){throw new Error(_0xcc27('0x79'));}return licenseUtil[_0xcc27('0x7a')]([_0x52ced5['body']])['then'](function(){return validateUser(_0x52ced5['body']);})[_0xcc27('0x21')](function(_0x46300d){return updateUser(_0x46300d)[_0xcc27('0x21')](function(_0x251a82){if(_0x251a82['role']===_0xcc27('0x78')){_0x251a82[_0xcc27('0x7b')]=_0x52ced5[_0xcc27('0x24')][_0xcc27('0x7b')];delete _0x251a82['userProfileId'];}return _0x251a82;});})[_0xcc27('0x21')](function(_0x28d15c){return db['User'][_0xcc27('0x77')](_0x28d15c,{'include':[{'model':db[_0xcc27('0x67')],'as':'VoiceMail'}]});})[_0xcc27('0x21')](function(_0x6eae6b){if(_0x52ced5[_0xcc27('0x54')]['role']===_0xcc27('0x24'))return _0x6eae6b;if(_0x52ced5[_0xcc27('0x24')][_0xcc27('0x1d')]!==_0xcc27('0x24'))return _0x6eae6b;return db[_0xcc27('0x7c')][_0xcc27('0x2b')]({'where':{'name':_0x6eae6b[_0xcc27('0x1d')]===_0xcc27('0x26')?_0xcc27('0x25'):_0xcc27('0x7d'),'userProfileId':_0x52ced5[_0xcc27('0x24')][_0xcc27('0x7e')]},'raw':!![]})[_0xcc27('0x21')](function(_0x3f57b7){if(!_0x3f57b7||_0x3f57b7[_0xcc27('0x7f')]!=0x0)return _0x6eae6b;return db[_0xcc27('0x80')][_0xcc27('0x77')]({'name':_0x6eae6b[_0xcc27('0x2c')],'resourceId':_0x6eae6b['id'],'type':_0x3f57b7[_0xcc27('0x2c')],'sectionId':_0x3f57b7['id']},{})[_0xcc27('0x21')](function(){return _0x6eae6b;});})['catch'](function(_0x33ecb5){logger[_0xcc27('0x2e')](_0xcc27('0x81'),_0x33ecb5);throw _0x33ecb5;});})[_0xcc27('0x21')](respondWithResult(_0x268f32,0xc9))[_0xcc27('0x4a')](handleError(_0x268f32,null));};exports['bulkCreate']=function(_0x3e9684,_0xdd4d3b){var _0x170267=_0x3e9684[_0xcc27('0x54')];var _0x528003=[];if(_0x3e9684[_0xcc27('0x24')]['role']==='agent')throw new Error(_0xcc27('0x82'));if(_['some'](_0x170267,['role',_0xcc27('0x24')])&&_0x3e9684['user'][_0xcc27('0x1d')]!==_0xcc27('0x78')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xcc27('0x83')](_0x170267,[_0xcc27('0x1d'),_0xcc27('0x78')])&&_0x3e9684[_0xcc27('0x24')][_0xcc27('0x1d')]!==_0xcc27('0x78')){throw new Error(_0xcc27('0x84'));}return licenseUtil[_0xcc27('0x7a')](_0x170267)[_0xcc27('0x21')](function(){return validateUser(_0x170267[0x0]);})[_0xcc27('0x21')](function(){for(var _0x1b6917=0x1;_0x1b6917<_0x170267['length'];_0x1b6917++){var _0x8b658=_0x170267[_0x1b6917-0x1][_0xcc27('0x5e')];if(!_0x170267[_0x1b6917][_0xcc27('0x5e')])_0x170267[_0x1b6917][_0xcc27('0x5e')]=_0x8b658+0x1;_0x528003[_0xcc27('0x44')](validateUser(_0x170267[_0x1b6917]));}return Promise['all'](_0x528003);})['then'](function(){_0x528003=[];for(var _0x1f24a0=0x0;_0x1f24a0<_0x170267[_0xcc27('0x43')];_0x1f24a0++){_0x528003[_0xcc27('0x44')](updateUser(_0x170267[_0x1f24a0]));}return Promise[_0xcc27('0x49')](_0x528003);})['then'](function(){_0x528003=_0x170267[_0xcc27('0x29')](function(_0x4c07c6){return db[_0xcc27('0x3a')]['create'](_0x4c07c6,{'include':[{'model':db[_0xcc27('0x67')],'as':'VoiceMail'}]})[_0xcc27('0x21')](function(_0x164429){_0x4c07c6['id']=_0x164429['id'];return _0x4c07c6;});});return Promise[_0xcc27('0x49')](_0x528003);})['then'](function(_0x49021a){if(_0x3e9684[_0xcc27('0x54')]['role']===_0xcc27('0x24'))return _0x49021a;if(_0x3e9684[_0xcc27('0x24')][_0xcc27('0x1d')]!==_0xcc27('0x24'))return _0x49021a;var _0x46c00e=_[_0xcc27('0x83')](_0x49021a,function(_0x33c6da){return _0x33c6da[_0xcc27('0x1d')]===_0xcc27('0x26')||_0x33c6da[_0xcc27('0x1d')]==='telephone';});if(!_0x46c00e)return _0x49021a;return db[_0xcc27('0x7c')][_0xcc27('0x40')]({'where':{'name':{'$or':[_0xcc27('0x25'),_0xcc27('0x7d')]},'userProfileId':_0x3e9684[_0xcc27('0x24')][_0xcc27('0x7e')]},'raw':!![]})[_0xcc27('0x21')](function(_0xeecac0){if(_[_0xcc27('0x85')](_0xeecac0)||!_[_0xcc27('0x83')](_0xeecac0,[_0xcc27('0x7f'),0x0]))return _0x49021a;_0x528003=[];var _0x164916=_(_0xeecac0)[_0xcc27('0x29')](function(_0x8eb242){if(_0x8eb242[_0xcc27('0x7f')]===0x1)return;return _0x8eb242['name']===_0xcc27('0x25')?_0xcc27('0x26'):'telephone';})[_0xcc27('0x86')]()[_0xcc27('0x2a')]();for(var _0x55e232=0x0;_0x55e232<_0x49021a[_0xcc27('0x43')];_0x55e232++){if(!_[_0xcc27('0x37')](_0x164916,_0x49021a[_0x55e232][_0xcc27('0x1d')]))return;var _0x1fed44=_0x49021a[_0x55e232][_0xcc27('0x1d')]===_0xcc27('0x26')?_0xcc27('0x25'):_0xcc27('0x7d');_0x528003[_0xcc27('0x44')](db[_0xcc27('0x80')][_0xcc27('0x77')]({'name':_0x49021a[_0x55e232][_0xcc27('0x2c')],'resourceId':_0x49021a[_0x55e232]['id'],'type':_0x1fed44,'sectionId':_['find'](_0xeecac0,[_0xcc27('0x2c'),_0x1fed44])['id']},{}));}return Promise[_0xcc27('0x49')](_0x528003);});})[_0xcc27('0x21')](respondWithResult(_0xdd4d3b,0xc9))[_0xcc27('0x4a')](handleError(_0xdd4d3b,null));};exports[_0xcc27('0x87')]=function(_0x13196c,_0x12571c){if(_0x13196c[_0xcc27('0x54')]['id']){delete _0x13196c[_0xcc27('0x54')]['id'];}return db[_0xcc27('0x3a')][_0xcc27('0x2b')]({'where':{'id':_0x13196c[_0xcc27('0x4c')]['id']}})[_0xcc27('0x21')](function(_0x36dd2a){if(!_0x36dd2a)return null;if(_0x36dd2a['id']===_0x13196c[_0xcc27('0x24')]['id']){if(!_0x13196c[_0xcc27('0x54')][_0xcc27('0x88')]||!_0x13196c[_0xcc27('0x54')]['newPassword']){throw new db[(_0xcc27('0x89'))][(_0xcc27('0x8a'))](_0xcc27('0x8b'));}if(!_0x36dd2a[_0xcc27('0x8c')](_0x13196c[_0xcc27('0x54')][_0xcc27('0x88')])){throw new db[(_0xcc27('0x89'))][(_0xcc27('0x8a'))](_0xcc27('0x8d'));}if(_0x13196c['body'][_0xcc27('0x88')]===_0x13196c['body'][_0xcc27('0x8e')]){throw new db['Sequelize'][(_0xcc27('0x8a'))](_0xcc27('0x8f'));}}else if(_0x13196c['user'][_0xcc27('0x1d')]===_0xcc27('0x78')){if(!_0x13196c['body']['newPassword']){throw new db['Sequelize'][(_0xcc27('0x8a'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x13196c[_0xcc27('0x24')]['role']==='user'){if(!_0x13196c[_0xcc27('0x54')][_0xcc27('0x8e')]){throw new db[(_0xcc27('0x89'))][(_0xcc27('0x8a'))](_0xcc27('0x90'));}if(_0x36dd2a[_0xcc27('0x1d')]!==_0xcc27('0x26')){throw new db[(_0xcc27('0x89'))][(_0xcc27('0x8a'))](_0xcc27('0x82'));}}else{throw new db['Sequelize'][(_0xcc27('0x8a'))]('Unauthorized');}return _0x36dd2a;})['then'](handleEntityNotFound(_0x12571c,null))['then'](function(_0x197b70){return db[_0xcc27('0x59')][_0xcc27('0x91')]({'attributes':['id',_0xcc27('0x5b'),_0xcc27('0x92'),_0xcc27('0x93')]})[_0xcc27('0x21')](function(_0xf9a752){if(_0xf9a752[_0xcc27('0x5b')])authService[_0xcc27('0x5c')](_0x13196c['body']['newPassword']);if(!_0xf9a752[_0xcc27('0x92')]||!_0x197b70[_0xcc27('0x34')])return _0x197b70;authService[_0xcc27('0x94')](_0x13196c['body'][_0xcc27('0x8e')],_0x197b70[_0xcc27('0x34')],_0xf9a752['passwordHistoryLimit']);return _0x197b70;})['then'](saveUpdates({'password':_0x13196c[_0xcc27('0x54')][_0xcc27('0x8e')],'passwordResetAt':_0x13196c[_0xcc27('0x24')]['id']==_0x13196c['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x13196c[_0xcc27('0x54')][_0xcc27('0x8e')],_0x197b70[_0xcc27('0x34')])},null));})['then'](respondWithResult(_0x12571c,null))['catch'](handleError(_0x12571c,null));};exports[_0xcc27('0x95')]=function(_0x18531f,_0x4dbc88){var _0x153321=_0x18531f[_0xcc27('0x54')][_0xcc27('0x96')];return db['User']['find']({'where':{'id':_0x18531f[_0xcc27('0x4c')]['id']},'attributes':['id',_0xcc27('0x2c'),'role',_0xcc27('0x97'),_0xcc27('0x98'),_0xcc27('0x99'),_0xcc27('0x9a')]})[_0xcc27('0x21')](handleEntityNotFound(_0x4dbc88,null))[_0xcc27('0x21')](function(_0x11638e){if(_0x11638e){if(!utils['isValidChannel'](_0x153321)){throw new db[(_0xcc27('0x89'))]['ValidationError'](_0xcc27('0x9b'));}return _0x11638e['add'+_[_0xcc27('0x9c')](_0x153321[_0xcc27('0x9d')]())+_0xcc27('0x9e')](_0x18531f[_0xcc27('0x54')][_0xcc27('0x57')],{'penalty':_0x18531f['body'][_0xcc27('0x9f')]||0x0})[_0xcc27('0xa0')](function(_0x15dc97){for(var _0x19cde7=0x0;_0x19cde7<_0x18531f['body'][_0xcc27('0x57')][_0xcc27('0x43')];_0x19cde7+=0x1){var _0x208698={'UserId':Number(_0x18531f[_0xcc27('0x4c')]['id'])};_0x208698[_[_0xcc27('0x9c')](_0x153321[_0xcc27('0x9d')]())+_0xcc27('0xa1')]=Number(_0x18531f[_0xcc27('0x54')][_0xcc27('0x57')][_0x19cde7]);socket[_0xcc27('0x1e')](_0xcc27('0x24')+_['capitalize'](_0x153321['toLowerCase']())+_0xcc27('0xa2'),_0x208698);}return _0x15dc97;})[_0xcc27('0x21')](function(){if(_0x153321===_0xcc27('0xa3')){return db[_0xcc27('0xa4')][_0xcc27('0x40')]({'where':{'id':_0x18531f[_0xcc27('0x54')]['ids']||[]},'raw':!![],'attributes':['id',_0xcc27('0x2c')]});}})[_0xcc27('0x21')](function(_0x55f7e6){var _0x531c50=_0x11638e[_0xcc27('0x22')]({'plain':!![]});var _0x384004=[];if(_0x153321===_0xcc27('0xa3')&&_0x531c50[_0xcc27('0x1d')]==='agent'&&_0x531c50[_0xcc27('0x97')]){for(let _0x250414=0x0;_0x250414<_0x55f7e6[_0xcc27('0x43')];_0x250414+=0x1){_0x384004[_0xcc27('0x44')]({'membername':_0x531c50['name'],'UserId':_0x531c50['id'],'queue_name':_0x55f7e6[_0x250414][_0xcc27('0x2c')],'VoiceQueueId':_0x55f7e6[_0x250414]['id'],'interface':_[_0xcc27('0x63')](_0x531c50['interface'])?util[_0xcc27('0xa5')]('SIP/%s',_0x531c50[_0xcc27('0x2c')]):_0x531c50['interface'],'paused':_0x531c50[_0xcc27('0x99')]||![],'penalty':_0x18531f['body'][_0xcc27('0x9f')]||0x0});}return Promise[_0xcc27('0x49')](_0x384004['map'](function(_0xbce443){return db[_0xcc27('0xa6')][_0xcc27('0xa7')](_0xbce443);}));}return _0x11638e;});}})[_0xcc27('0x21')](respondWithStatusCode(_0x4dbc88,null))[_0xcc27('0x4a')](handleError(_0x4dbc88,null));};exports[_0xcc27('0xa8')]=function(_0x34c1dc,_0x2ca355){var _0x19b3ac,_0x5725f7;return db[_0xcc27('0x3a')][_0xcc27('0x2b')]({'where':{'id':_0x34c1dc[_0xcc27('0x4c')]['id']},'attributes':['id',_0xcc27('0x2c'),'role']})[_0xcc27('0x21')](handleEntityNotFound(_0x2ca355,null))[_0xcc27('0x21')](function(_0x381622){if(_0x381622){_0x19b3ac=_0x381622;if(!_0x34c1dc[_0xcc27('0x3b')][_0xcc27('0x96')]||!utils[_0xcc27('0xa9')](_0x34c1dc['query']['channel'])){throw new db[(_0xcc27('0x89'))]['ValidationError'](_0xcc27('0x9b'));}return _0x381622['remove'+_[_0xcc27('0x9c')](_0x34c1dc['query'][_0xcc27('0x96')][_0xcc27('0x9d')]())+_0xcc27('0x9e')](_0x34c1dc[_0xcc27('0x3b')][_0xcc27('0x57')]);}})[_0xcc27('0x21')](function(_0x43c608){if(_['isArray'](_0x34c1dc[_0xcc27('0x3b')][_0xcc27('0x57')])){for(var _0x2064b6=0x0;_0x2064b6<_0x34c1dc[_0xcc27('0x3b')]['ids'][_0xcc27('0x43')];_0x2064b6+=0x1){_0x5725f7={'UserId':Number(_0x34c1dc[_0xcc27('0x4c')]['id'])};_0x5725f7[_[_0xcc27('0x9c')](_0x34c1dc[_0xcc27('0x3b')][_0xcc27('0x96')][_0xcc27('0x9d')]())+_0xcc27('0xa1')]=Number(_0x34c1dc[_0xcc27('0x3b')][_0xcc27('0x57')][_0x2064b6]);socket['emit'](_0xcc27('0x24')+_[_0xcc27('0x9c')](_0x34c1dc[_0xcc27('0x3b')][_0xcc27('0x96')]['toLowerCase']())+'Queue:remove',_0x5725f7);}}else{_0x5725f7={'UserId':Number(_0x34c1dc[_0xcc27('0x4c')]['id'])};_0x5725f7[_[_0xcc27('0x9c')](_0x34c1dc[_0xcc27('0x3b')]['channel']['toLowerCase']())+'QueueId']=Number(_0x34c1dc[_0xcc27('0x3b')]['ids']);socket['emit']('user'+_[_0xcc27('0x9c')](_0x34c1dc[_0xcc27('0x3b')][_0xcc27('0x96')][_0xcc27('0x9d')]())+_0xcc27('0xaa'),_0x5725f7);}return _0x43c608;})['then'](function(){if(_0x34c1dc[_0xcc27('0x3b')][_0xcc27('0x96')]===_0xcc27('0xa3')){return db['UserVoiceQueueRt'][_0xcc27('0x20')]({'where':{'UserId':_0x34c1dc[_0xcc27('0x4c')]['id'],'VoiceQueueId':_0x34c1dc[_0xcc27('0x3b')]['ids']},'individualHooks':!![]})[_0xcc27('0x21')](function(){return _0x19b3ac;});}return _0x19b3ac;})[_0xcc27('0x21')](respondWithStatusCode(_0x2ca355,null))[_0xcc27('0x4a')](handleError(_0x2ca355,null));};exports[_0xcc27('0xab')]=function(_0x33b95b,_0x505791){_0x33b95b[_0xcc27('0x54')]['userpic']=_0x33b95b[_0xcc27('0xac')][_0xcc27('0xad')];return db[_0xcc27('0x3a')]['find']({'where':{'id':_0x33b95b[_0xcc27('0x4c')]['id']}})[_0xcc27('0x21')](handleEntityNotFound(_0x505791,null))[_0xcc27('0x21')](saveUpdates(_0x33b95b['body'],null))['then'](respondWithResult(_0x505791,null))[_0xcc27('0x4a')](handleError(_0x505791,null));};exports[_0xcc27('0xae')]=function(_0x15f467,_0x3e2b51){var _0x5afa5c=path['join'](config['root'],_0xcc27('0xaf'));return db['User'][_0xcc27('0x2b')]({'where':{'id':_0x15f467[_0xcc27('0x4c')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xcc27('0x21')](handleEntityNotFound(_0x3e2b51,null))['then'](function(_0x567e9a){if(_0x567e9a){if(_[_0xcc27('0x63')](_0x567e9a[_0xcc27('0xb0')])){return _0x3e2b51['download'](_0x5afa5c);}else{if(!fs[_0xcc27('0xb1')](path['join'](config[_0xcc27('0xb2')],_0xcc27('0xb3'),_0x567e9a[_0xcc27('0xb0')]))){return _0x3e2b51['download'](_0x5afa5c);}return _0x3e2b51[_0xcc27('0xb4')](path[_0xcc27('0xb5')](config[_0xcc27('0xb2')],_0xcc27('0xb3'),_0x567e9a[_0xcc27('0xb0')]));}}})['catch'](handleError(_0x3e2b51,null));};exports[_0xcc27('0xb6')]=function(_0x44f9d4,_0x5d58ec){return db[_0xcc27('0x3a')]['find']({'where':{'id':_0x44f9d4[_0xcc27('0x4c')]['id']},'attributes':['id']})[_0xcc27('0x21')](handleEntityNotFound(_0x5d58ec,null))[_0xcc27('0x21')](function(_0x4d8341){var _0x74e247=[];values=_0x4d8341['dataValues'];_0x74e247[_0xcc27('0x44')](get_open_tabs(_0xcc27('0xb7'),_0x4d8341['dataValues']));_0x74e247['push'](get_open_tabs(_0xcc27('0x52'),_0x4d8341[_0xcc27('0x45')]));_0x74e247[_0xcc27('0x44')](get_open_tabs('openchannel',_0x4d8341[_0xcc27('0x45')]));_0x74e247[_0xcc27('0x44')](get_open_tabs('whatsapp',_0x4d8341[_0xcc27('0x45')]));_0x74e247[_0xcc27('0x44')](get_open_tabs('fax',_0x4d8341[_0xcc27('0x45')]));_0x74e247[_0xcc27('0x44')](get_open_tabs('mail',_0x4d8341[_0xcc27('0x45')]));return Promise['all'](_0x74e247);})[_0xcc27('0x21')](function(_0x51961a){if(_0x51961a){var _0x2cdaac=_[_0xcc27('0x29')](values['ChatOpenTabs'],function(_0x4b0c0e){return{'channel':_0xcc27('0xb8'),'id':_0x4b0c0e['id'],'createdAt':_0x4b0c0e['createdAt']};});var _0x225db8=_['map'](values[_0xcc27('0xb9')],function(_0x4d5a37){return{'channel':_0xcc27('0xba'),'id':_0x4d5a37['id'],'createdAt':_0x4d5a37['createdAt']};});var _0x21f285=_[_0xcc27('0x29')](values[_0xcc27('0xbb')],function(_0xfc3910){return{'channel':_0xcc27('0xbc'),'id':_0xfc3910['id'],'createdAt':_0xfc3910[_0xcc27('0xbd')]};});var _0x2ea3b6=_['map'](values[_0xcc27('0xbe')],function(_0x5cb7e9){return{'channel':'MAIL','id':_0x5cb7e9['id'],'createdAt':_0x5cb7e9[_0xcc27('0xbd')]};});var _0x4f73a8=_[_0xcc27('0x29')](values[_0xcc27('0xbf')],function(_0x37ff32){return{'channel':_0xcc27('0xc0'),'id':_0x37ff32['id'],'createdAt':_0x37ff32[_0xcc27('0xbd')]};});var _0x54cfc6=_[_0xcc27('0x29')](values[_0xcc27('0xc1')],function(_0x1ef4cb){return{'channel':_0xcc27('0xc2'),'id':_0x1ef4cb['id'],'createdAt':_0x1ef4cb[_0xcc27('0xbd')]};});var _0x1c384a=_[_0xcc27('0xc3')](_0x2cdaac,_0x225db8,_0x21f285,_0x2ea3b6,_0x4f73a8,_0x54cfc6);var _0x533e38={'count':_0x1c384a['length'],'rows':_0x1c384a};return _0x533e38;}else return null;})[_0xcc27('0x21')](respondWithResult(_0x5d58ec,null))[_0xcc27('0x4a')](handleError(_0x5d58ec,null));};exports[_0xcc27('0xc4')]=function(_0x5dd38e,_0x527f0c){var _0x31bbf1={};return db[_0xcc27('0x3a')]['findOne']({'where':{'id':_0x5dd38e[_0xcc27('0x4c')]['id']}})[_0xcc27('0x21')](function(_0x57be68){if(!_0x57be68){throw new APINotFoundError(util[_0xcc27('0xa5')](_0xcc27('0xc5'),_0x5dd38e[_0xcc27('0x4c')]['id']));}return contacts[_0xcc27('0x55')]();})[_0xcc27('0x21')](function(_0x19a34c){_0x5dd38e[_0xcc27('0x3b')]['User']=_0x5dd38e[_0xcc27('0x4c')]['id'];_0x31bbf1=qs[_0xcc27('0x4d')](_0x19a34c,_0x5dd38e);if(_0x5dd38e[_0xcc27('0x3b')][_0xcc27('0xc6')](_0xcc27('0x4e'))){_0x31bbf1[_0xcc27('0x3c')]=[{'model':db[_0xcc27('0xc7')],'as':_0xcc27('0xc8'),'required':![]},{'model':db['Tag'],'as':_0xcc27('0xc9'),'attributes':['id',_0xcc27('0x2c'),_0xcc27('0xca')],'where':_0x5dd38e['query'][_0xcc27('0xcb')]?{'id':_0x5dd38e[_0xcc27('0x3b')][_0xcc27('0xcb')]}:undefined,'required':_0x5dd38e[_0xcc27('0x3b')]['tag']?!![]:![]}];}return contacts[_0xcc27('0x40')](_0x5dd38e['query'],_0x5dd38e[_0xcc27('0x24')],_0x31bbf1,_0x19a34c);})[_0xcc27('0x21')](respondWithFilteredResult(_0x527f0c,_0x31bbf1))[_0xcc27('0x4a')](APIHandleError(_0x527f0c));};exports[_0xcc27('0xcc')]=function(_0x42a13a,_0x30dfc0){var _0xfee61f;var _0x2ceb8f={};var _0x559c00;return db['User'][_0xcc27('0x91')]({'where':{'id':_0x42a13a[_0xcc27('0x4c')]['id']},'attributes':['id',_0xcc27('0x2c'),_0xcc27('0x1d')]})[_0xcc27('0x21')](handleEntityNotFound(_0x30dfc0,null))[_0xcc27('0x21')](function(_0x4c9be5){if(!utils['isValidChannel'](_0x42a13a['query']['channel'])){throw new db[(_0xcc27('0x89'))][(_0xcc27('0x8a'))](_0xcc27('0x9b'));}_0xfee61f=_0x4c9be5;var _0x330692={};_0x330692['model']=_['keys'](db[_['capitalize'](_0x42a13a['query'][_0xcc27('0x96')])+'Queue'][_0xcc27('0x30')]);_0x330692[_0xcc27('0x3b')]=_[_0xcc27('0xcd')](_0x42a13a[_0xcc27('0x3b')]);_0x330692[_0xcc27('0xce')]=_['intersection'](_0x330692['model'],_0x330692['query']);_0x2ceb8f[_0xcc27('0x3f')]=_[_0xcc27('0xcf')](_0x330692['model'],qs['fields'](_0x42a13a['query'][_0xcc27('0xd0')]));_0x2ceb8f['attributes']=_0x2ceb8f[_0xcc27('0x3f')][_0xcc27('0x43')]?_0x2ceb8f[_0xcc27('0x3f')]:_0x330692[_0xcc27('0xd1')];_0x2ceb8f[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0x42a13a[_0xcc27('0x3b')][_0xcc27('0xd3')]);_0x2ceb8f[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_[_0xcc27('0xd4')](_0x42a13a['query'],_0x330692[_0xcc27('0xce')]));if(_0x42a13a[_0xcc27('0x3b')][_0xcc27('0x27')]){_0x2ceb8f[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x2ceb8f[_0xcc27('0x39')],{'$or':_['map'](_0x2ceb8f[_0xcc27('0x3f')],function(_0x36f994){var _0xa66ca3={};_0xa66ca3[_0x36f994]={'$like':'%'+_0x42a13a[_0xcc27('0x3b')][_0xcc27('0x27')]+'%'};return _0xa66ca3;})});}_0x2ceb8f=_['merge']({},_0x2ceb8f,_0x42a13a[_0xcc27('0x51')]);switch(_0xfee61f['role']){case'admin':return db[_[_0xcc27('0x9c')](_0x42a13a[_0xcc27('0x3b')][_0xcc27('0x96')])+'Queue'][_0xcc27('0x40')](_0x2ceb8f);case'user':case _0xcc27('0x26'):return _0xfee61f[_0xcc27('0x22')+_[_0xcc27('0x9c')](_0x42a13a['query'][_0xcc27('0x96')])+'Queues'](_0x2ceb8f);default:throw new db[(_0xcc27('0x89'))][(_0xcc27('0x8a'))](_0xcc27('0xd5'));}})[_0xcc27('0x21')](function(_0x225bf1){_0x559c00=_0x225bf1[_0xcc27('0x43')];if(!_0x42a13a[_0xcc27('0x3b')][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0x2ceb8f[_0xcc27('0x18')]=qs[_0xcc27('0x18')](_0x42a13a[_0xcc27('0x3b')][_0xcc27('0x18')]);_0x2ceb8f[_0xcc27('0x16')]=qs['offset'](_0x42a13a[_0xcc27('0x3b')][_0xcc27('0x16')]);}switch(_0xfee61f[_0xcc27('0x1d')]){case'admin':return db[_[_0xcc27('0x9c')](_0x42a13a[_0xcc27('0x3b')][_0xcc27('0x96')])+'Queue'][_0xcc27('0x40')](_0x2ceb8f);case _0xcc27('0x24'):case _0xcc27('0x26'):return _0xfee61f[_0xcc27('0x22')+_[_0xcc27('0x9c')](_0x42a13a['query'][_0xcc27('0x96')])+_0xcc27('0x9e')](_0x2ceb8f);}})[_0xcc27('0x21')](function(_0x5cc45){return{'count':_0x559c00,'rows':_0x5cc45};})[_0xcc27('0x21')](respondWithResult(_0x30dfc0,null))[_0xcc27('0x4a')](handleError(_0x30dfc0,null));};exports[_0xcc27('0xd7')]=function(_0x57916b,_0x5b2dad){var _0x26fe03={};var _0x4e6dba={};var _0x274dab;var _0x26eb57;return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x57916b[_0xcc27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5b2dad,null))[_0xcc27('0x21')](function(_0x90b883){if(_0x90b883){_0x274dab=_0x90b883;_0x4e6dba['model']=_[_0xcc27('0xcd')](db[_0xcc27('0xa6')][_0xcc27('0x30')]);_0x4e6dba[_0xcc27('0x3b')]=_[_0xcc27('0xcd')](_0x57916b[_0xcc27('0x3b')]);_0x4e6dba['filters']=_[_0xcc27('0xcf')](_0x4e6dba[_0xcc27('0xd1')],_0x4e6dba['query']);_0x26fe03[_0xcc27('0x3f')]=_[_0xcc27('0xcf')](_0x4e6dba[_0xcc27('0xd1')],qs[_0xcc27('0xd0')](_0x57916b[_0xcc27('0x3b')]['fields']));_0x26fe03[_0xcc27('0x3f')]=_0x26fe03[_0xcc27('0x3f')][_0xcc27('0x43')]?_0x26fe03[_0xcc27('0x3f')]:_0x4e6dba[_0xcc27('0xd1')];_0x26fe03[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0x57916b['query']['sort']);_0x26fe03[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_['pick'](_0x57916b[_0xcc27('0x3b')],_0x4e6dba[_0xcc27('0xce')]));if(_0x57916b[_0xcc27('0x3b')][_0xcc27('0x27')]){_0x26fe03[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x26fe03[_0xcc27('0x39')],{'$or':_[_0xcc27('0x29')](_0x26fe03[_0xcc27('0x3f')],function(_0x1b53ff){var _0x3fd7c1={};_0x3fd7c1[_0x1b53ff]={'$like':'%'+_0x57916b[_0xcc27('0x3b')][_0xcc27('0x27')]+'%'};return _0x3fd7c1;})});}_0x26fe03=_[_0xcc27('0x50')]({},_0x26fe03,_0x57916b[_0xcc27('0x51')]);return _0x274dab[_0xcc27('0xd7')](_0x26fe03);}})[_0xcc27('0x21')](function(_0x1a21c9){if(_0x1a21c9){_0x26eb57=_0x1a21c9['length'];if(!_0x57916b[_0xcc27('0x3b')]['hasOwnProperty']('nolimit')){_0x26fe03[_0xcc27('0x18')]=qs['limit'](_0x57916b[_0xcc27('0x3b')][_0xcc27('0x18')]);_0x26fe03[_0xcc27('0x16')]=qs['offset'](_0x57916b[_0xcc27('0x3b')]['offset']);}return _0x274dab['getVoiceQueuesRt'](_0x26fe03);}})[_0xcc27('0x21')](function(_0x352ef0){if(_0x352ef0){return _0x352ef0?{'count':_0x26eb57,'rows':_0x352ef0}:null;}})['then'](respondWithResult(_0x5b2dad,null))[_0xcc27('0x4a')](handleError(_0x5b2dad,null));};exports[_0xcc27('0xd8')]=function(_0x5ac34a,_0x1f0a20){var _0x5e9051={};var _0x7ad18d={};var _0x4b2024;var _0x3cf889;return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x5ac34a[_0xcc27('0x4c')]['id']}})[_0xcc27('0x21')](handleEntityNotFound(_0x1f0a20,null))[_0xcc27('0x21')](function(_0x10c3a2){if(_0x10c3a2){_0x4b2024=_0x10c3a2;_0x7ad18d[_0xcc27('0xd1')]=_[_0xcc27('0xcd')](db[_0xcc27('0xd9')][_0xcc27('0x30')]);_0x7ad18d[_0xcc27('0x3b')]=_[_0xcc27('0xcd')](_0x5ac34a[_0xcc27('0x3b')]);_0x7ad18d[_0xcc27('0xce')]=_[_0xcc27('0xcf')](_0x7ad18d[_0xcc27('0xd1')],_0x7ad18d[_0xcc27('0x3b')]);_0x5e9051[_0xcc27('0x3f')]=_[_0xcc27('0xcf')](_0x7ad18d['model'],qs[_0xcc27('0xd0')](_0x5ac34a[_0xcc27('0x3b')][_0xcc27('0xd0')]));_0x5e9051[_0xcc27('0x3f')]=_0x5e9051[_0xcc27('0x3f')][_0xcc27('0x43')]?_0x5e9051['attributes']:_0x7ad18d[_0xcc27('0xd1')];_0x5e9051[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0x5ac34a['query']['sort']);_0x5e9051[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_[_0xcc27('0xd4')](_0x5ac34a['query'],_0x7ad18d[_0xcc27('0xce')]));if(_0x5ac34a[_0xcc27('0x3b')][_0xcc27('0x27')]){_0x5e9051[_0xcc27('0x39')]=_['merge'](_0x5e9051['where'],{'$or':_[_0xcc27('0x29')](_0x5e9051['attributes'],function(_0x144979){var _0x27e879={};_0x27e879[_0x144979]={'$like':'%'+_0x5ac34a[_0xcc27('0x3b')][_0xcc27('0x27')]+'%'};return _0x27e879;})});}_0x5e9051=_[_0xcc27('0x50')]({},_0x5e9051,_0x5ac34a[_0xcc27('0x51')]);return _0x4b2024[_0xcc27('0xd8')](_0x5e9051);}})[_0xcc27('0x21')](function(_0x4049a6){if(_0x4049a6){_0x3cf889=_0x4049a6['length'];if(!_0x5ac34a[_0xcc27('0x3b')][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0x5e9051[_0xcc27('0x18')]=qs['limit'](_0x5ac34a[_0xcc27('0x3b')]['limit']);_0x5e9051[_0xcc27('0x16')]=qs[_0xcc27('0x16')](_0x5ac34a[_0xcc27('0x3b')][_0xcc27('0x16')]);}return _0x4b2024[_0xcc27('0xd8')](_0x5e9051);}})[_0xcc27('0x21')](function(_0x9372c2){if(_0x9372c2){return _0x9372c2?{'count':_0x3cf889,'rows':_0x9372c2}:null;}})['then'](respondWithResult(_0x1f0a20,null))[_0xcc27('0x4a')](handleError(_0x1f0a20,null));};exports[_0xcc27('0xda')]=function(_0x290577,_0x56083a){var _0x5a9965={'raw':!![],'where':{}};var _0xaa9bbe={};var _0x572891={'count':0x0,'rows':[]};return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x290577[_0xcc27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x56083a,null))[_0xcc27('0x21')](function(_0x4b9def){if(_0x4b9def){_0xaa9bbe['model']=_[_0xcc27('0xcd')](db[_0xcc27('0xdb')]['rawAttributes']);_0xaa9bbe[_0xcc27('0x3b')]=_[_0xcc27('0xcd')](_0x290577[_0xcc27('0x3b')]);_0xaa9bbe[_0xcc27('0xce')]=_['intersection'](_0xaa9bbe[_0xcc27('0xd1')],_0xaa9bbe[_0xcc27('0x3b')]);_0x5a9965[_0xcc27('0x3f')]=_['intersection'](_0xaa9bbe[_0xcc27('0xd1')],qs[_0xcc27('0xd0')](_0x290577[_0xcc27('0x3b')][_0xcc27('0xd0')]));_0x5a9965[_0xcc27('0x3f')]=_0x5a9965[_0xcc27('0x3f')][_0xcc27('0x43')]?_0x5a9965['attributes']:_0xaa9bbe[_0xcc27('0xd1')];if(!_0x290577[_0xcc27('0x3b')][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0x5a9965[_0xcc27('0x18')]=qs[_0xcc27('0x18')](_0x290577[_0xcc27('0x3b')][_0xcc27('0x18')]);_0x5a9965[_0xcc27('0x16')]=qs['offset'](_0x290577['query']['offset']);}_0x5a9965[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0x290577[_0xcc27('0x3b')][_0xcc27('0xd3')]);_0x5a9965[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_[_0xcc27('0xd4')](_0x290577['query'],_0xaa9bbe['filters']));_0x5a9965[_0xcc27('0x39')][_0xcc27('0xdc')]=_0x4b9def['id'];if(_0x290577['query'][_0xcc27('0x27')]){_0x5a9965[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x5a9965[_0xcc27('0x39')],{'$or':_[_0xcc27('0x29')](_0x5a9965[_0xcc27('0x3f')],function(_0x107991){var _0x1a7dcc={};_0x1a7dcc[_0x107991]={'$like':'%'+_0x290577[_0xcc27('0x3b')][_0xcc27('0x27')]+'%'};return _0x1a7dcc;})});}_0x5a9965=_['merge']({},_0x5a9965,_0x290577[_0xcc27('0x51')]);return db[_0xcc27('0xdb')][_0xcc27('0x19')]({'where':_0x5a9965[_0xcc27('0x39')]})[_0xcc27('0x21')](function(_0x55ad13){_0x572891[_0xcc27('0x19')]=_0x55ad13;if(_0x290577[_0xcc27('0x3b')][_0xcc27('0x4e')]){_0x5a9965[_0xcc27('0x3c')]=[{'all':!![]}];}return db['VoiceRecording'][_0xcc27('0x40')](_0x5a9965);})[_0xcc27('0x21')](function(_0x2d5c43){_0x572891[_0xcc27('0x41')]=_0x2d5c43;return _0x572891;});}})[_0xcc27('0x21')](respondWithFilteredResult(_0x56083a,_0x5a9965))[_0xcc27('0x4a')](handleError(_0x56083a,null));};exports['getScreenRecordings']=function(_0x39f211,_0x4a8276){var _0x1ad9fe={'raw':!![],'where':{}};var _0x2492d1={};var _0x313d76={'count':0x0,'rows':[]};return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x39f211[_0xcc27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a8276,null))[_0xcc27('0x21')](function(_0x44de3f){if(_0x44de3f){_0x2492d1[_0xcc27('0xd1')]=_['keys'](db[_0xcc27('0xdd')]['rawAttributes']);_0x2492d1['query']=_[_0xcc27('0xcd')](_0x39f211['query']);_0x2492d1[_0xcc27('0xce')]=_[_0xcc27('0xcf')](_0x2492d1[_0xcc27('0xd1')],_0x2492d1['query']);_0x1ad9fe['attributes']=_[_0xcc27('0xcf')](_0x2492d1[_0xcc27('0xd1')],qs[_0xcc27('0xd0')](_0x39f211[_0xcc27('0x3b')][_0xcc27('0xd0')]));_0x1ad9fe[_0xcc27('0x3f')]=_0x1ad9fe['attributes'][_0xcc27('0x43')]?_0x1ad9fe[_0xcc27('0x3f')]:_0x2492d1['model'];if(!_0x39f211[_0xcc27('0x3b')][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0x1ad9fe[_0xcc27('0x18')]=qs[_0xcc27('0x18')](_0x39f211[_0xcc27('0x3b')][_0xcc27('0x18')]);_0x1ad9fe[_0xcc27('0x16')]=qs[_0xcc27('0x16')](_0x39f211['query']['offset']);}_0x1ad9fe[_0xcc27('0xd2')]=qs['sort'](_0x39f211[_0xcc27('0x3b')][_0xcc27('0xd3')]);_0x1ad9fe[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_[_0xcc27('0xd4')](_0x39f211[_0xcc27('0x3b')],_0x2492d1[_0xcc27('0xce')]));_0x1ad9fe[_0xcc27('0x39')][_0xcc27('0xdc')]=_0x44de3f['id'];if(_0x39f211[_0xcc27('0x3b')][_0xcc27('0x27')]){_0x1ad9fe[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x1ad9fe[_0xcc27('0x39')],{'$or':_[_0xcc27('0x29')](_0x1ad9fe[_0xcc27('0x3f')],function(_0x2972e4){var _0x45fa65={};_0x45fa65[_0x2972e4]={'$like':'%'+_0x39f211[_0xcc27('0x3b')][_0xcc27('0x27')]+'%'};return _0x45fa65;})});}_0x1ad9fe=_[_0xcc27('0x50')]({},_0x1ad9fe,_0x39f211[_0xcc27('0x51')]);return db['ScreenRecording'][_0xcc27('0x19')]({'where':_0x1ad9fe['where']})[_0xcc27('0x21')](function(_0x326f3d){_0x313d76[_0xcc27('0x19')]=_0x326f3d;if(_0x39f211[_0xcc27('0x3b')][_0xcc27('0x4e')]){_0x1ad9fe[_0xcc27('0x3c')]=[{'all':!![]}];}return db[_0xcc27('0xdd')][_0xcc27('0x40')](_0x1ad9fe);})[_0xcc27('0x21')](function(_0x5b5791){_0x313d76['rows']=_0x5b5791;return _0x313d76;});}})[_0xcc27('0x21')](respondWithFilteredResult(_0x4a8276,_0x1ad9fe))[_0xcc27('0x4a')](handleError(_0x4a8276,null));};exports['getChatInteractions']=function(_0x582182,_0x4a84e6){var _0x3be683={};var _0x1ba9ce={};var _0x534356;var _0x4e4359;return db['User']['findOne']({'where':{'id':_0x582182[_0xcc27('0x4c')]['id']}})[_0xcc27('0x21')](handleEntityNotFound(_0x4a84e6,null))[_0xcc27('0x21')](function(_0x1b9a5d){if(_0x1b9a5d){_0x534356=_0x1b9a5d;_0x1ba9ce[_0xcc27('0xd1')]=_['keys'](db[_0xcc27('0xde')][_0xcc27('0x30')]);_0x1ba9ce[_0xcc27('0x3b')]=_[_0xcc27('0xcd')](_0x582182[_0xcc27('0x3b')]);_0x1ba9ce[_0xcc27('0xce')]=_[_0xcc27('0xcf')](_0x1ba9ce[_0xcc27('0xd1')],_0x1ba9ce['query']);_0x3be683[_0xcc27('0x3f')]=_['intersection'](_0x1ba9ce[_0xcc27('0xd1')],qs['fields'](_0x582182['query'][_0xcc27('0xd0')]));_0x3be683[_0xcc27('0x3f')]=_0x3be683['attributes'][_0xcc27('0x43')]?_0x3be683[_0xcc27('0x3f')]:_0x1ba9ce['model'];_0x3be683[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0x582182[_0xcc27('0x3b')][_0xcc27('0xd3')]);_0x3be683[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_[_0xcc27('0xd4')](_0x582182[_0xcc27('0x3b')],_0x1ba9ce[_0xcc27('0xce')]));if(_0x582182[_0xcc27('0x3b')][_0xcc27('0x27')]){_0x3be683[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x3be683[_0xcc27('0x39')],{'$or':_['map'](_0x3be683[_0xcc27('0x3f')],function(_0x5ad0c5){var _0x584d7b={};_0x584d7b[_0x5ad0c5]={'$like':'%'+_0x582182['query'][_0xcc27('0x27')]+'%'};return _0x584d7b;})});}_0x3be683=_[_0xcc27('0x50')]({},_0x3be683,_0x582182[_0xcc27('0x51')]);return _0x534356['getChatInteractions'](_0x3be683);}})['then'](function(_0x33c288){if(_0x33c288){_0x4e4359=_0x33c288[_0xcc27('0x43')];if(!_0x582182['query'][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0x3be683[_0xcc27('0x18')]=qs[_0xcc27('0x18')](_0x582182['query'][_0xcc27('0x18')]);_0x3be683['offset']=qs['offset'](_0x582182[_0xcc27('0x3b')][_0xcc27('0x16')]);}return _0x534356[_0xcc27('0xdf')](_0x3be683);}})[_0xcc27('0x21')](function(_0x17d841){if(_0x17d841){return _0x17d841?{'count':_0x4e4359,'rows':_0x17d841}:null;}})[_0xcc27('0x21')](respondWithResult(_0x4a84e6,null))['catch'](handleError(_0x4a84e6,null));};exports[_0xcc27('0xe0')]=function(_0x56b9bf,_0x58ea53){var _0x489207={};var _0x19a767={};var _0x14cbbd;var _0x119609;return db[_0xcc27('0x3a')]['findOne']({'where':{'id':_0x56b9bf['params']['id']}})[_0xcc27('0x21')](handleEntityNotFound(_0x58ea53,null))[_0xcc27('0x21')](function(_0x4da7a5){if(_0x4da7a5){_0x14cbbd=_0x4da7a5;_0x19a767[_0xcc27('0xd1')]=_[_0xcc27('0xcd')](db[_0xcc27('0xe1')][_0xcc27('0x30')]);_0x19a767['query']=_[_0xcc27('0xcd')](_0x56b9bf[_0xcc27('0x3b')]);_0x19a767[_0xcc27('0xce')]=_['intersection'](_0x19a767[_0xcc27('0xd1')],_0x19a767['query']);_0x489207['attributes']=_[_0xcc27('0xcf')](_0x19a767[_0xcc27('0xd1')],qs[_0xcc27('0xd0')](_0x56b9bf[_0xcc27('0x3b')][_0xcc27('0xd0')]));_0x489207['attributes']=_0x489207[_0xcc27('0x3f')]['length']?_0x489207[_0xcc27('0x3f')]:_0x19a767[_0xcc27('0xd1')];_0x489207[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0x56b9bf[_0xcc27('0x3b')]['sort']);_0x489207[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_[_0xcc27('0xd4')](_0x56b9bf[_0xcc27('0x3b')],_0x19a767[_0xcc27('0xce')]));if(_0x56b9bf[_0xcc27('0x3b')][_0xcc27('0x27')]){_0x489207[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x489207['where'],{'$or':_[_0xcc27('0x29')](_0x489207[_0xcc27('0x3f')],function(_0x311426){var _0x52b223={};_0x52b223[_0x311426]={'$like':'%'+_0x56b9bf[_0xcc27('0x3b')][_0xcc27('0x27')]+'%'};return _0x52b223;})});}_0x489207=_['merge']({},_0x489207,_0x56b9bf[_0xcc27('0x51')]);return _0x14cbbd[_0xcc27('0xe0')](_0x489207);}})[_0xcc27('0x21')](function(_0x3d7e92){if(_0x3d7e92){_0x119609=_0x3d7e92[_0xcc27('0x43')];if(!_0x56b9bf[_0xcc27('0x3b')][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0x489207['limit']=qs[_0xcc27('0x18')](_0x56b9bf[_0xcc27('0x3b')][_0xcc27('0x18')]);_0x489207[_0xcc27('0x16')]=qs['offset'](_0x56b9bf[_0xcc27('0x3b')]['offset']);}return _0x14cbbd[_0xcc27('0xe0')](_0x489207);}})[_0xcc27('0x21')](function(_0x15291a){if(_0x15291a){return _0x15291a?{'count':_0x119609,'rows':_0x15291a}:null;}})[_0xcc27('0x21')](respondWithResult(_0x58ea53,null))[_0xcc27('0x4a')](handleError(_0x58ea53,null));};exports['getMailInteractions']=function(_0x1d874d,_0x2240d4){var _0x44f177={'raw':!![],'where':{}};var _0x494128={};var _0x877685={'count':0x0,'rows':[]};return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x1d874d[_0xcc27('0x4c')]['id']}})[_0xcc27('0x21')](handleEntityNotFound(_0x2240d4,null))['then'](function(_0x2c4691){if(_0x2c4691){_0x494128[_0xcc27('0xd1')]=_['keys'](db[_0xcc27('0xe2')][_0xcc27('0x30')]);_0x494128[_0xcc27('0x3b')]=_['keys'](_0x1d874d[_0xcc27('0x3b')]);_0x494128[_0xcc27('0xce')]=_['intersection'](_0x494128['model'],_0x494128[_0xcc27('0x3b')]);_0x44f177['attributes']=_[_0xcc27('0xcf')](_0x494128['model'],qs[_0xcc27('0xd0')](_0x1d874d['query'][_0xcc27('0xd0')]));_0x44f177[_0xcc27('0x3f')]=_0x44f177[_0xcc27('0x3f')]['length']?_0x44f177[_0xcc27('0x3f')]:_0x494128['model'];if(!_0x1d874d['query'][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0x44f177[_0xcc27('0x18')]=qs['limit'](_0x1d874d[_0xcc27('0x3b')]['limit']);_0x44f177[_0xcc27('0x16')]=qs['offset'](_0x1d874d['query'][_0xcc27('0x16')]);}_0x44f177[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0x1d874d[_0xcc27('0x3b')][_0xcc27('0xd3')]);_0x44f177[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_[_0xcc27('0xd4')](_0x1d874d[_0xcc27('0x3b')],_0x494128[_0xcc27('0xce')]));_0x44f177[_0xcc27('0x39')]['UserId']=_0x2c4691['id'];if(_0x1d874d[_0xcc27('0x3b')][_0xcc27('0x27')]){_0x44f177['where']=_[_0xcc27('0x50')](_0x44f177[_0xcc27('0x39')],{'$or':_['map'](_0x44f177[_0xcc27('0x3f')],function(_0x16b103){var _0x5a5667={};_0x5a5667[_0x16b103]={'$like':'%'+_0x1d874d[_0xcc27('0x3b')][_0xcc27('0x27')]+'%'};return _0x5a5667;})});}_0x44f177=_[_0xcc27('0x50')]({},_0x44f177,_0x1d874d[_0xcc27('0x51')]);return db[_0xcc27('0xe2')][_0xcc27('0x19')]({'where':_0x44f177['where']})[_0xcc27('0x21')](function(_0x53ec59){_0x877685[_0xcc27('0x19')]=_0x53ec59;if(_0x1d874d['query'][_0xcc27('0x4e')]){_0x44f177[_0xcc27('0x3c')]=[{'all':!![]}];}return db[_0xcc27('0xe2')]['findAll'](_0x44f177);})[_0xcc27('0x21')](function(_0x143853){_0x877685[_0xcc27('0x41')]=_0x143853;return _0x877685;});}})[_0xcc27('0x21')](respondWithFilteredResult(_0x2240d4,_0x44f177))[_0xcc27('0x4a')](handleError(_0x2240d4,null));};exports['getSmsInteractions']=function(_0x1bce43,_0x93fba4){var _0x5e00d8={};var _0x566e91={};var _0x329dab;var _0x13b941;return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x1bce43[_0xcc27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x93fba4,null))[_0xcc27('0x21')](function(_0x1fd308){if(_0x1fd308){_0x329dab=_0x1fd308;_0x566e91[_0xcc27('0xd1')]=_[_0xcc27('0xcd')](db['SmsInteraction'][_0xcc27('0x30')]);_0x566e91[_0xcc27('0x3b')]=_[_0xcc27('0xcd')](_0x1bce43['query']);_0x566e91[_0xcc27('0xce')]=_[_0xcc27('0xcf')](_0x566e91[_0xcc27('0xd1')],_0x566e91[_0xcc27('0x3b')]);_0x5e00d8[_0xcc27('0x3f')]=_[_0xcc27('0xcf')](_0x566e91[_0xcc27('0xd1')],qs[_0xcc27('0xd0')](_0x1bce43[_0xcc27('0x3b')][_0xcc27('0xd0')]));_0x5e00d8[_0xcc27('0x3f')]=_0x5e00d8[_0xcc27('0x3f')][_0xcc27('0x43')]?_0x5e00d8[_0xcc27('0x3f')]:_0x566e91[_0xcc27('0xd1')];_0x5e00d8['order']=qs[_0xcc27('0xd3')](_0x1bce43[_0xcc27('0x3b')][_0xcc27('0xd3')]);_0x5e00d8[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_[_0xcc27('0xd4')](_0x1bce43[_0xcc27('0x3b')],_0x566e91[_0xcc27('0xce')]));if(_0x1bce43[_0xcc27('0x3b')][_0xcc27('0x27')]){_0x5e00d8[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x5e00d8[_0xcc27('0x39')],{'$or':_[_0xcc27('0x29')](_0x5e00d8[_0xcc27('0x3f')],function(_0x38aa41){var _0xffcaa5={};_0xffcaa5[_0x38aa41]={'$like':'%'+_0x1bce43[_0xcc27('0x3b')][_0xcc27('0x27')]+'%'};return _0xffcaa5;})});}_0x5e00d8=_['merge']({},_0x5e00d8,_0x1bce43[_0xcc27('0x51')]);return _0x329dab['getSmsInteractions'](_0x5e00d8);}})[_0xcc27('0x21')](function(_0x5ecbc7){if(_0x5ecbc7){_0x13b941=_0x5ecbc7[_0xcc27('0x43')];if(!_0x1bce43['query'][_0xcc27('0xc6')]('nolimit')){_0x5e00d8[_0xcc27('0x18')]=qs[_0xcc27('0x18')](_0x1bce43[_0xcc27('0x3b')]['limit']);_0x5e00d8[_0xcc27('0x16')]=qs['offset'](_0x1bce43[_0xcc27('0x3b')][_0xcc27('0x16')]);}return _0x329dab['getSmsInteractions'](_0x5e00d8);}})['then'](function(_0x743120){if(_0x743120){return _0x743120?{'count':_0x13b941,'rows':_0x743120}:null;}})['then'](respondWithResult(_0x93fba4,null))[_0xcc27('0x4a')](handleError(_0x93fba4,null));};exports[_0xcc27('0xe3')]=function(_0x445265,_0x1e71d8){var _0xc8eb04={};var _0x432a03={};var _0x245a48;var _0x3d5a52;return db[_0xcc27('0x3a')]['findOne']({'where':{'id':_0x445265[_0xcc27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e71d8,null))[_0xcc27('0x21')](function(_0x28da65){if(_0x28da65){_0x245a48=_0x28da65;_0x432a03[_0xcc27('0xd1')]=_['keys'](db[_0xcc27('0xe4')]['rawAttributes']);_0x432a03['query']=_[_0xcc27('0xcd')](_0x445265[_0xcc27('0x3b')]);_0x432a03[_0xcc27('0xce')]=_[_0xcc27('0xcf')](_0x432a03[_0xcc27('0xd1')],_0x432a03[_0xcc27('0x3b')]);_0xc8eb04[_0xcc27('0x3f')]=_['intersection'](_0x432a03[_0xcc27('0xd1')],qs[_0xcc27('0xd0')](_0x445265[_0xcc27('0x3b')][_0xcc27('0xd0')]));_0xc8eb04[_0xcc27('0x3f')]=_0xc8eb04[_0xcc27('0x3f')][_0xcc27('0x43')]?_0xc8eb04[_0xcc27('0x3f')]:_0x432a03[_0xcc27('0xd1')];_0xc8eb04['order']=qs[_0xcc27('0xd3')](_0x445265[_0xcc27('0x3b')][_0xcc27('0xd3')]);_0xc8eb04[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_['pick'](_0x445265[_0xcc27('0x3b')],_0x432a03['filters']));if(_0x445265[_0xcc27('0x3b')]['filter']){_0xc8eb04[_0xcc27('0x39')]=_['merge'](_0xc8eb04[_0xcc27('0x39')],{'$or':_[_0xcc27('0x29')](_0xc8eb04[_0xcc27('0x3f')],function(_0x471cff){var _0x1ad346={};_0x1ad346[_0x471cff]={'$like':'%'+_0x445265[_0xcc27('0x3b')]['filter']+'%'};return _0x1ad346;})});}_0xc8eb04=_[_0xcc27('0x50')]({},_0xc8eb04,_0x445265[_0xcc27('0x51')]);return _0x245a48[_0xcc27('0xe3')](_0xc8eb04);}})[_0xcc27('0x21')](function(_0x9b5532){if(_0x9b5532){_0x3d5a52=_0x9b5532[_0xcc27('0x43')];if(!_0x445265[_0xcc27('0x3b')][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0xc8eb04[_0xcc27('0x18')]=qs['limit'](_0x445265[_0xcc27('0x3b')]['limit']);_0xc8eb04['offset']=qs['offset'](_0x445265[_0xcc27('0x3b')][_0xcc27('0x16')]);}return _0x245a48['getFaxInteractions'](_0xc8eb04);}})[_0xcc27('0x21')](function(_0xdd1b1d){if(_0xdd1b1d){return _0xdd1b1d?{'count':_0x3d5a52,'rows':_0xdd1b1d}:null;}})[_0xcc27('0x21')](respondWithResult(_0x1e71d8,null))['catch'](handleError(_0x1e71d8,null));};exports['getWhatsappInteractions']=function(_0xdb6086,_0x5e4695){var _0x757282={};var _0xa76fc1={};var _0x3dc225;var _0x20b3e6;return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0xdb6086[_0xcc27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5e4695,null))[_0xcc27('0x21')](function(_0x194025){if(_0x194025){_0x3dc225=_0x194025;_0xa76fc1[_0xcc27('0xd1')]=_[_0xcc27('0xcd')](db[_0xcc27('0xe5')][_0xcc27('0x30')]);_0xa76fc1[_0xcc27('0x3b')]=_[_0xcc27('0xcd')](_0xdb6086['query']);_0xa76fc1[_0xcc27('0xce')]=_[_0xcc27('0xcf')](_0xa76fc1[_0xcc27('0xd1')],_0xa76fc1[_0xcc27('0x3b')]);_0x757282[_0xcc27('0x3f')]=_['intersection'](_0xa76fc1[_0xcc27('0xd1')],qs['fields'](_0xdb6086[_0xcc27('0x3b')][_0xcc27('0xd0')]));_0x757282[_0xcc27('0x3f')]=_0x757282['attributes'][_0xcc27('0x43')]?_0x757282[_0xcc27('0x3f')]:_0xa76fc1[_0xcc27('0xd1')];_0x757282[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0xdb6086['query'][_0xcc27('0xd3')]);_0x757282[_0xcc27('0x39')]=qs['filters'](_[_0xcc27('0xd4')](_0xdb6086[_0xcc27('0x3b')],_0xa76fc1['filters']));if(_0xdb6086['query'][_0xcc27('0x27')]){_0x757282[_0xcc27('0x39')]=_['merge'](_0x757282[_0xcc27('0x39')],{'$or':_['map'](_0x757282[_0xcc27('0x3f')],function(_0xf36b1a){var _0x137a2b={};_0x137a2b[_0xf36b1a]={'$like':'%'+_0xdb6086['query'][_0xcc27('0x27')]+'%'};return _0x137a2b;})});}_0x757282=_['merge']({},_0x757282,_0xdb6086[_0xcc27('0x51')]);return _0x3dc225[_0xcc27('0xe6')](_0x757282);}})[_0xcc27('0x21')](function(_0x562780){if(_0x562780){_0x20b3e6=_0x562780[_0xcc27('0x43')];if(!_0xdb6086['query'][_0xcc27('0xc6')]('nolimit')){_0x757282[_0xcc27('0x18')]=qs[_0xcc27('0x18')](_0xdb6086[_0xcc27('0x3b')][_0xcc27('0x18')]);_0x757282['offset']=qs[_0xcc27('0x16')](_0xdb6086['query'][_0xcc27('0x16')]);}return _0x3dc225[_0xcc27('0xe6')](_0x757282);}})[_0xcc27('0x21')](function(_0x322726){if(_0x322726){return _0x322726?{'count':_0x20b3e6,'rows':_0x322726}:null;}})[_0xcc27('0x21')](respondWithResult(_0x5e4695,null))[_0xcc27('0x4a')](handleError(_0x5e4695,null));};exports[_0xcc27('0xe7')]=function(_0x381ba4,_0x51f340,_0x318f6a){var _0x28b057;var _0x1f6df1;var _0x3d8f94;var _0x168b5d=!_['isNil'](_0x381ba4[_0xcc27('0x4c')]['id'])?_0x381ba4[_0xcc27('0x4c')]['id']:!_[_0xcc27('0x63')](_0x381ba4['user']['id'])?_0x381ba4[_0xcc27('0x24')]['id']:null;return db[_0xcc27('0x3a')][_0xcc27('0x2b')]({'where':{'id':_0x168b5d,'role':{'$or':[_0xcc27('0x78'),_0xcc27('0x24'),'agent']}},'attributes':['id','name','phone','mobile',_0xcc27('0x1d'),'internal',_0xcc27('0x98')]})[_0xcc27('0x21')](function(_0xf7a566){if(_0xf7a566){if(_0xf7a566[_0xcc27('0x1d')]==='agent'){_0x28b057=_0xf7a566;if(_0x381ba4[_0xcc27('0x54')][_0xcc27('0x9a')]){_0x3d8f94=util[_0xcc27('0xa5')](_0xcc27('0xe8'),_0x28b057[_0x381ba4[_0xcc27('0x54')][_0xcc27('0x9a')]]);}else if(_0x381ba4['body']['intrf']){_0x3d8f94=util[_0xcc27('0xa5')]('SIP/%s',_0x381ba4[_0xcc27('0x54')][_0xcc27('0xe9')]);}else{_0x3d8f94=util['format']('SIP/%s',_0x28b057[_0xcc27('0x2c')]);}socket['to'](util[_0xcc27('0xa5')](_0xcc27('0xea'),_0x28b057[_0xcc27('0x2c')]))['emit'](_0xcc27('0xeb'),{'user':{'id':_0x28b057['id'],'name':_0x28b057[_0xcc27('0x2c')]},'ip':_0x381ba4[_0xcc27('0xec')][_0xcc27('0xed')]||_0x381ba4[_0xcc27('0xee')][_0xcc27('0xef')]||_0x381ba4[_0xcc27('0xf0')][_0xcc27('0xef')]||_0x381ba4[_0xcc27('0xee')][_0xcc27('0xf0')][_0xcc27('0xef')]});return db[_0xcc27('0xa6')][_0xcc27('0x20')]({'where':{'membername':_0x28b057[_0xcc27('0x2c')]},'individualHooks':!![]});}}else{throw new db[(_0xcc27('0x89'))]['ValidationError'](_0xcc27('0xf1'));}})[_0xcc27('0x21')](function(){if(_0x28b057){return _0x28b057[_0xcc27('0xf2')]({'raw':!![]});}})[_0xcc27('0x21')](function(_0x5d6e9a){if(_0x28b057){if(_0x5d6e9a){_0x1f6df1=_0x5d6e9a;if(_0x1f6df1[_0xcc27('0x43')]){var _0x14944a=_0x1f6df1[_0xcc27('0x29')](function(_0x513ebb){var _0x4efa32={'membername':_0x28b057[_0xcc27('0x2c')],'UserId':_0x28b057['id'],'queue_name':_0x513ebb['name'],'VoiceQueueId':_0x513ebb['id'],'interface':_0x3d8f94,'paused':_0x28b057[_0xcc27('0x98')]||![],'penalty':_0x513ebb[_0xcc27('0xf3')]||0x0};return db[_0xcc27('0xa6')][_0xcc27('0xa7')](_0x4efa32);});return Promise['all'](_0x14944a);}}}})[_0xcc27('0x21')](function(){if(_0x28b057){return db[_0xcc27('0xf4')][_0xcc27('0x40')]({'where':{'membername':_0x28b057[_0xcc27('0x2c')],'exitAt':null}});}})['then'](function(_0x533821){if(_0x28b057){var _0x4cec24=[];_0x533821[_0xcc27('0xf5')](function(_0x3112d3){_0x4cec24[_0xcc27('0x44')](_0x3112d3[_0xcc27('0x1c')]({'exitAt':moment()[_0xcc27('0xa5')](_0xcc27('0xf6'))}));});return Promise[_0xcc27('0x49')](_0x4cec24);}})[_0xcc27('0x21')](function(){if(_0x28b057){var _0x56ef72=[];var _0x2e1086=[];var _0x398ea4=utils[_0xcc27('0xf7')]();var _0x3392aa={'membername':_0x28b057[_0xcc27('0x2c')],'interface':_0x3d8f94,'enterAt':moment()['format'](_0xcc27('0xf6')),'role':_0x28b057[_0xcc27('0x1d')],'internal':_0x28b057[_0xcc27('0x5e')]};_0x398ea4[_0xcc27('0xf5')](function(_0x51eafe){_0x56ef72['push'](_['merge']({'channel':_0x51eafe,'type':'LOGIN','data1':_0x381ba4[_0xcc27('0x54')][_0xcc27('0xf8')],'data2':_0x3d8f94},_0x3392aa));if(_0x28b057[_0xcc27('0x98')]){_0x2e1086['push'](_[_0xcc27('0x50')]({'channel':_0x51eafe,'type':_0xcc27('0xf9'),'data1':'LOGININPAUSE'},_0x3392aa));}});return db[_0xcc27('0xf4')][_0xcc27('0xfa')](_0x56ef72[_0xcc27('0xc3')](_0x2e1086),{'individualHooks':!![]});}})['then'](function(){if(_0x28b057){return _0x28b057[_0xcc27('0x1c')]({'online':!![],'lastLoginAt':moment()[_0xcc27('0xa5')](_0xcc27('0xf6')),'voicePause':_0x28b057['loginInPause']||![],'mailPause':_0x28b057[_0xcc27('0x98')]||![],'chatPause':_0x28b057[_0xcc27('0x98')]||![],'faxPause':_0x28b057[_0xcc27('0x98')]||![],'smsPause':_0x28b057['loginInPause']||![],'openchannelPause':_0x28b057['loginInPause']||![],'whatsappPause':_0x28b057[_0xcc27('0x98')]||![],'pauseType':_0x28b057[_0xcc27('0x98')]?'LOGININPAUSE':null,'interface':_0x3d8f94,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xcc27('0x21')](function(_0x24bf83){if(_0x381ba4[_0xcc27('0xfb')]){return _0x318f6a();}else{return Promise[_0xcc27('0xfc')](_0x24bf83)[_0xcc27('0x21')](respondWithResult(_0x51f340,null));}})[_0xcc27('0x4a')](handleError(_0x51f340,null));};exports['logout']=function(_0x15082a,_0x3ae490){var _0x186e31;return db[_0xcc27('0x3a')][_0xcc27('0x2b')]({'where':{'id':_0x15082a[_0xcc27('0x4c')]['id'],'role':_0xcc27('0x26')},'attributes':['id',_0xcc27('0x2c'),_0xcc27('0x1d')]})['then'](handleEntityNotFound(_0x3ae490,null))[_0xcc27('0x21')](function(_0x5a9a9f){if(_0x5a9a9f){_0x186e31=_0x5a9a9f;return db[_0xcc27('0xa6')][_0xcc27('0x20')]({'where':{'membername':_0x186e31[_0xcc27('0x2c')]},'individualHooks':!![]});}})[_0xcc27('0x21')](function(){return db[_0xcc27('0xf4')]['findAll']({'where':{'membername':_0x186e31['name'],'exitAt':null}});})[_0xcc27('0x21')](function(_0x4ea6ad){var _0x6144c7=[];_0x4ea6ad['forEach'](function(_0x2d2961){_0x6144c7[_0xcc27('0x44')](_0x2d2961[_0xcc27('0x1c')]({'exitAt':moment()[_0xcc27('0xa5')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xcc27('0x49')](_0x6144c7);})[_0xcc27('0x21')](function(){return _0x186e31[_0xcc27('0x1c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xcc27('0x21')](respondWithResult(_0x3ae490,null))['catch'](handleError(_0x3ae490,null));};exports[_0xcc27('0xfd')]=function(_0x417cd4,_0x2e6ae2){var _0x4cf00e;return db[_0xcc27('0xa6')][_0xcc27('0x1c')]({'paused':0x1},{'where':{'UserId':_0x417cd4[_0xcc27('0x4c')]['id']},'individualHooks':!![]})[_0xcc27('0x21')](function(){return db[_0xcc27('0x3a')][_0xcc27('0x2b')]({'where':{'id':_0x417cd4['params']['id'],'role':_0xcc27('0x26')},'attributes':['id','name','role',_0xcc27('0x5e'),_0xcc27('0x9a'),_0xcc27('0x97')]});})[_0xcc27('0x21')](handleEntityNotFound(_0x2e6ae2,null))[_0xcc27('0x21')](function(_0x2ee51c){if(_0x2ee51c){_0x4cf00e=_0x2ee51c;return db[_0xcc27('0xf4')][_0xcc27('0x40')]({'where':{'membername':_0x4cf00e['name'],'type':_0xcc27('0xf9'),'exitAt':null}});}})['then'](function(_0x241f90){if(_0x241f90[_0xcc27('0x43')]){var _0x38887a=moment()[_0xcc27('0xa5')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x20aaf3=0x0,_0x37dab5=_0x241f90[_0xcc27('0x43')];_0x20aaf3<_0x37dab5;_0x20aaf3++){_0x241f90[_0x20aaf3][_0xcc27('0xfe')]({'exitAt':_0x38887a});}}})['then'](function(){var _0x44331b=[];var _0x246a1d=utils[_0xcc27('0xf7')]();_0x246a1d[_0xcc27('0xf5')](function(_0x3b173f){_0x44331b[_0xcc27('0x44')]({'channel':_0x3b173f,'membername':_0x4cf00e[_0xcc27('0x2c')],'interface':_[_0xcc27('0x63')](_0x4cf00e[_0xcc27('0x9a')])?util['format'](_0xcc27('0xff'),_0x4cf00e[_0xcc27('0x2c')]):_0x4cf00e[_0xcc27('0x9a')],'type':_0xcc27('0xf9'),'enterAt':moment()['format'](_0xcc27('0xf6')),'data1':_0x417cd4[_0xcc27('0x54')][_0xcc27('0x100')]||_0xcc27('0x101'),'role':_0x4cf00e[_0xcc27('0x1d')],'internal':_0x4cf00e[_0xcc27('0x5e')]});});return db[_0xcc27('0xf4')][_0xcc27('0xfa')](_0x44331b,{'individualHooks':!![]});})['then'](function(){return _0x4cf00e[_0xcc27('0x1c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x417cd4['body'][_0xcc27('0x100')]||_0xcc27('0x101'),'lastPauseAt':moment()[_0xcc27('0xa5')](_0xcc27('0xf6'))});})[_0xcc27('0x21')](respondWithResult(_0x2e6ae2,null))[_0xcc27('0x4a')](handleError(_0x2e6ae2,null));};exports['unpause']=function(_0x968a78,_0x5a40dd){if(_0x968a78[_0xcc27('0x54')][_0xcc27('0x96')]&&!utils[_0xcc27('0xa9')](_0x968a78[_0xcc27('0x54')]['channel'])){throw new APIBadRequestError(util[_0xcc27('0xa5')](_0xcc27('0x102'),_0x968a78[_0xcc27('0x54')]['channel']));}return db[_0xcc27('0x3a')]['find']({'where':{'id':_0x968a78[_0xcc27('0x4c')]['id']},'attributes':['id','name',_0xcc27('0x1d'),'internal',_0xcc27('0x9a'),_0xcc27('0x97'),'voicePause',_0xcc27('0x103'),_0xcc27('0x104'),_0xcc27('0x105'),'openchannelPause','smsPause',_0xcc27('0x106'),_0xcc27('0x107'),_0xcc27('0x108')]})[_0xcc27('0x21')](function(_0x21daa3){if(!_0x21daa3){throw new APINotFoundError(util[_0xcc27('0xa5')](_0xcc27('0xc5'),_0x968a78[_0xcc27('0x4c')]['id']));}return _0x21daa3[_0xcc27('0x109')](_0x968a78[_0xcc27('0x54')]['channel']);})[_0xcc27('0x21')](respondWithResult(_0x5a40dd,null))[_0xcc27('0x4a')](APIHandleError(_0x5a40dd));};exports[_0xcc27('0x10a')]=function(_0x24e9ae,_0x1c715f){var _0x1202b0={};var _0x2259f3={};var _0x4e9c1f;var _0x372be9;return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x24e9ae[_0xcc27('0x4c')]['id']}})[_0xcc27('0x21')](handleEntityNotFound(_0x1c715f,null))[_0xcc27('0x21')](function(_0x21a10e){if(_0x21a10e){_0x4e9c1f=_0x21a10e;_0x2259f3[_0xcc27('0xd1')]=_[_0xcc27('0xcd')](db[_0xcc27('0x10b')][_0xcc27('0x30')]);_0x2259f3['query']=_[_0xcc27('0xcd')](_0x24e9ae[_0xcc27('0x3b')]);_0x2259f3['filters']=_['intersection'](_0x2259f3['model'],_0x2259f3['query']);_0x1202b0[_0xcc27('0x3f')]=_[_0xcc27('0xcf')](_0x2259f3[_0xcc27('0xd1')],qs['fields'](_0x24e9ae[_0xcc27('0x3b')][_0xcc27('0xd0')]));_0x1202b0['attributes']=_0x1202b0[_0xcc27('0x3f')][_0xcc27('0x43')]?_0x1202b0[_0xcc27('0x3f')]:_0x2259f3[_0xcc27('0xd1')];_0x1202b0[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0x24e9ae[_0xcc27('0x3b')][_0xcc27('0xd3')]);_0x1202b0[_0xcc27('0x39')]=qs['filters'](_['pick'](_0x24e9ae[_0xcc27('0x3b')],_0x2259f3[_0xcc27('0xce')]));if(_0x24e9ae[_0xcc27('0x3b')]['filter']){_0x1202b0[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x1202b0[_0xcc27('0x39')],{'$or':_[_0xcc27('0x29')](_0x1202b0[_0xcc27('0x3f')],function(_0x1f896f){var _0x382ff4={};_0x382ff4[_0x1f896f]={'$like':'%'+_0x24e9ae['query']['filter']+'%'};return _0x382ff4;})});}_0x1202b0=_[_0xcc27('0x50')]({},_0x1202b0,_0x24e9ae['options']);return _0x4e9c1f[_0xcc27('0x10a')](_0x1202b0);}})[_0xcc27('0x21')](function(_0x21c0b1){if(_0x21c0b1){_0x372be9=_0x21c0b1[_0xcc27('0x43')];if(!_0x24e9ae[_0xcc27('0x3b')][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0x1202b0[_0xcc27('0x18')]=qs[_0xcc27('0x18')](_0x24e9ae['query'][_0xcc27('0x18')]);_0x1202b0[_0xcc27('0x16')]=qs['offset'](_0x24e9ae[_0xcc27('0x3b')][_0xcc27('0x16')]);}return _0x4e9c1f[_0xcc27('0x10a')](_0x1202b0);}})['then'](function(_0x38af6a){if(_0x38af6a){return _0x38af6a?{'count':_0x372be9,'rows':_0x38af6a}:null;}})['then'](respondWithResult(_0x1c715f,null))[_0xcc27('0x4a')](handleError(_0x1c715f,null));};exports[_0xcc27('0x10c')]=function(_0x476e7b,_0x4cb7bb){var _0x29bbf2=_0x476e7b[_0xcc27('0x4c')]['id'];var _0x202a26=_0x476e7b['body']?_0x476e7b[_0xcc27('0x54')]['ids']:null;var _0x49ea21=[];return Promise['resolve']()[_0xcc27('0x21')](function(){if(!_0x202a26)throw new APIBadRequestError(_0xcc27('0x10d'));})['then'](function(){return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x29bbf2}});})[_0xcc27('0x21')](function(_0x1d1f0f){if(!_0x1d1f0f)throw new APINotFoundError(util['format'](_0xcc27('0xc5'),_0x476e7b[_0xcc27('0x4c')]['id']));return db['sequelize'][_0xcc27('0x10e')](function(_0x9affd0){return _0x1d1f0f[_0xcc27('0x10c')](_0x202a26,{'transaction':_0x9affd0})[_0xcc27('0x21')](function(){return db[_0xcc27('0x10b')][_0xcc27('0x40')]({'where':{'id':{'$in':_0x202a26}}});})[_0xcc27('0x21')](function(_0x2e7d98){var _0x46652b=_['map'](_0x2e7d98,function(_0x4e5eb6){return _0x4e5eb6[_0xcc27('0x10f')]();});return Promise[_0xcc27('0x49')](_0x46652b);})['then'](function(_0x5e4f6d){_0x49ea21=_['flattenDeep'](_0x5e4f6d);var _0x151cd9=_[_0xcc27('0x29')](_0x49ea21,function(_0x24fdea){return _0x24fdea[_0xcc27('0x110')](_0x1d1f0f['id'],{'transaction':_0x9affd0});});return Promise['all'](_0x151cd9);})[_0xcc27('0x21')](function(){if(!_0x1d1f0f[_0xcc27('0x97')])return;var _0xbe730=_['filter'](_0x49ea21,function(_0x180adb){return _0x180adb[_0xcc27('0x111')]('channel')==='Voice';});var _0x57be76=_[_0xcc27('0x29')](_0xbe730,function(_0x303a7b){return db['UserVoiceQueueRt'][_0xcc27('0xa7')]({'membername':_0x1d1f0f[_0xcc27('0x2c')],'UserId':_0x1d1f0f['id'],'queue_name':_0x303a7b['name'],'VoiceQueueId':_0x303a7b['id'],'interface':_[_0xcc27('0x63')](_0x1d1f0f['interface'])?util[_0xcc27('0xa5')](_0xcc27('0xff'),_0x1d1f0f[_0xcc27('0x2c')]):_0x1d1f0f['interface'],'paused':_0x1d1f0f[_0xcc27('0x99')]||![],'penalty':_0x1d1f0f[_0xcc27('0x9f')]},{'transaction':_0x9affd0});});return Promise[_0xcc27('0x49')](_0x57be76);})[_0xcc27('0x21')](function(){return db[_0xcc27('0x112')][_0xcc27('0x40')]({'where':{'teamId':{'$in':_0x202a26}}});})['then'](function(_0x5166f4){var _0x221371=_['map'](_0x5166f4,function(_0x125be5){return db['UserVoicePrefix'][_0xcc27('0x77')]({'UserId':_0x1d1f0f['id'],'VoicePrefixId':_0x125be5['VoicePrefixId']},{'transaction':_0x9affd0});});return Promise[_0xcc27('0x49')](_0x221371);});});})[_0xcc27('0x21')](function(){for(var _0x36325a=0x0;_0x36325a<_0x49ea21['length'];_0x36325a++){var _0x444b5c=_0x49ea21[_0x36325a][_0xcc27('0x111')](_0xcc27('0x96'));var _0x40e5d2=_0x444b5c+_0xcc27('0xa1');socket[_0xcc27('0x1e')]('user'+_0x444b5c+_0xcc27('0xa2'),{'UserId':_0x29bbf2,['queueField']:_0x49ea21[_0x36325a]['id']});}})[_0xcc27('0x21')](respondWithStatusCode(_0x4cb7bb,null))[_0xcc27('0x4a')](APIHandleError(_0x4cb7bb));};exports[_0xcc27('0x113')]=function(_0x548386,_0x9ec0da){var _0x4f0713=_0x548386[_0xcc27('0x4c')]['id'];var _0x1c4ef0=null;if(_0x548386[_0xcc27('0x3b')][_0xcc27('0x57')]){_0x1c4ef0=_[_0xcc27('0x114')](_0x548386[_0xcc27('0x3b')][_0xcc27('0x57')])?_0x548386['query'][_0xcc27('0x57')]:[_0x548386['query'][_0xcc27('0x57')]];}var _0x2d1d60=[];return Promise[_0xcc27('0xfc')]()[_0xcc27('0x21')](function(){if(!_0x1c4ef0)throw new APIBadRequestError(_0xcc27('0x115'));})[_0xcc27('0x21')](function(){return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x4f0713}});})[_0xcc27('0x21')](function(_0x3b8ff2){if(!_0x3b8ff2)throw new APINotFoundError(util[_0xcc27('0xa5')](_0xcc27('0xc5'),_0x548386[_0xcc27('0x4c')]['id']));return db[_0xcc27('0x60')][_0xcc27('0x10e')](function(_0xc6281a){return _0x3b8ff2[_0xcc27('0x113')](_0x1c4ef0,{'transaction':_0xc6281a})['then'](function(){return db['Team'][_0xcc27('0x40')]({'where':{'id':{'$in':_0x1c4ef0}}});})['then'](function(_0x5c2bbd){var _0x32fca3=_['map'](_0x5c2bbd,function(_0x11767b){return _0x11767b[_0xcc27('0x10f')]();});return Promise[_0xcc27('0x49')](_0x32fca3);})['then'](function(_0x149777){_0x2d1d60=_[_0xcc27('0x116')](_0x149777);var _0x447d1e=_[_0xcc27('0x29')](_0x2d1d60,function(_0x5217e4){return _0x5217e4['removeAgent'](_0x3b8ff2['id'],{'transaction':_0xc6281a});});return Promise['all'](_0x447d1e);})[_0xcc27('0x21')](function(){if(!_0x3b8ff2[_0xcc27('0x97')])return;var _0x53f71e=_[_0xcc27('0x27')](_0x2d1d60,function(_0x2150d4){return _0x2150d4['getDataValue'](_0xcc27('0x96'))==='Voice';});var _0x56de04=_[_0xcc27('0x29')](_0x53f71e,function(_0x5c8205){return db[_0xcc27('0xa6')][_0xcc27('0x20')]({'where':{'VoiceQueueId':_0x5c8205['id'],'UserId':_0x3b8ff2['id']},'transaction':_0xc6281a});});return Promise[_0xcc27('0x49')](_0x56de04);})[_0xcc27('0x21')](function(){return db[_0xcc27('0x112')]['findAll']({'where':{'teamId':{'$in':_0x1c4ef0}}});})['then'](function(_0x3fd6d4){var _0x48339b=_[_0xcc27('0x29')](_0x3fd6d4,function(_0x44a820){return db[_0xcc27('0x117')]['destroy']({'where':{'UserId':_0x3b8ff2['id'],'VoicePrefixId':_0x44a820[_0xcc27('0x118')]}},{'transaction':_0xc6281a});});return Promise['all'](_0x48339b);});});})[_0xcc27('0x21')](function(){for(var _0x233b76=0x0;_0x233b76<_0x2d1d60['length'];_0x233b76++){var _0xb36985=_0x2d1d60[_0x233b76]['getDataValue'](_0xcc27('0x96'));var _0x51dbb7=_0xb36985+_0xcc27('0xa1');socket[_0xcc27('0x1e')]('user'+_0xb36985+'Queue:remove',{'UserId':_0x4f0713,['queueField']:_0x2d1d60[_0x233b76]['id']});}})[_0xcc27('0x21')](respondWithStatusCode(_0x9ec0da,null))[_0xcc27('0x4a')](APIHandleError(_0x9ec0da));};exports[_0xcc27('0x119')]=function(_0x201d4,_0x30f113){var _0x3581ff={};var _0x4704f6={};var _0x402715;var _0x552c23;return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0x201d4[_0xcc27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x30f113,null))[_0xcc27('0x21')](function(_0x2bd719){if(_0x2bd719){_0x402715=_0x2bd719;_0x4704f6['model']=_['keys'](db[_0xcc27('0xc7')][_0xcc27('0x30')]);_0x4704f6[_0xcc27('0x3b')]=_[_0xcc27('0xcd')](_0x201d4['query']);_0x4704f6[_0xcc27('0xce')]=_[_0xcc27('0xcf')](_0x4704f6['model'],_0x4704f6[_0xcc27('0x3b')]);_0x3581ff[_0xcc27('0x3f')]=_[_0xcc27('0xcf')](_0x4704f6['model'],qs[_0xcc27('0xd0')](_0x201d4[_0xcc27('0x3b')]['fields']));_0x3581ff['attributes']=_0x3581ff[_0xcc27('0x3f')][_0xcc27('0x43')]?_0x3581ff[_0xcc27('0x3f')]:_0x4704f6[_0xcc27('0xd1')];_0x3581ff[_0xcc27('0xd2')]=qs['sort'](_0x201d4[_0xcc27('0x3b')]['sort']);_0x3581ff[_0xcc27('0x39')]=qs[_0xcc27('0xce')](_[_0xcc27('0xd4')](_0x201d4[_0xcc27('0x3b')],_0x4704f6[_0xcc27('0xce')]));if(_0x201d4['query']['filter']){_0x3581ff[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x3581ff[_0xcc27('0x39')],{'$or':_[_0xcc27('0x29')](_0x3581ff['attributes'],function(_0x1724a1){var _0x42fcac={};_0x42fcac[_0x1724a1]={'$like':'%'+_0x201d4['query'][_0xcc27('0x27')]+'%'};return _0x42fcac;})});}_0x3581ff=_[_0xcc27('0x50')]({},_0x3581ff,_0x201d4[_0xcc27('0x51')]);return _0x402715[_0xcc27('0x119')](_0x3581ff);}})[_0xcc27('0x21')](function(_0x23fb8){if(_0x23fb8){_0x552c23=_0x23fb8['length'];if(!_0x201d4[_0xcc27('0x3b')][_0xcc27('0xc6')](_0xcc27('0xd6'))){_0x3581ff[_0xcc27('0x18')]=qs[_0xcc27('0x18')](_0x201d4[_0xcc27('0x3b')]['limit']);_0x3581ff[_0xcc27('0x16')]=qs['offset'](_0x201d4['query']['offset']);}return _0x402715['getLists'](_0x3581ff);}})[_0xcc27('0x21')](function(_0xb89c75){if(_0xb89c75){return _0xb89c75?{'count':_0x552c23,'rows':_0xb89c75}:null;}})[_0xcc27('0x21')](respondWithResult(_0x30f113,null))['catch'](handleError(_0x30f113,null));};exports[_0xcc27('0x11a')]=function(_0xb6efa9,_0x285637){var _0x37acfa={};var _0x19d592={};var _0x166a5e;return db[_0xcc27('0x3a')][_0xcc27('0x91')]({'where':{'id':_0xb6efa9[_0xcc27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x285637,null))['then'](function(_0x4af3f4){if(_0x4af3f4){_0x166a5e=_0x4af3f4;_0x19d592['model']=_[_0xcc27('0xcd')](db[_0xcc27('0x3a')]['rawAttributes']);_0x19d592['query']=_['keys'](_0xb6efa9[_0xcc27('0x3b')]);_0x19d592[_0xcc27('0xce')]=_[_0xcc27('0xcf')](_0x19d592[_0xcc27('0xd1')],_0x19d592['query']);_0x37acfa[_0xcc27('0x3f')]=_[_0xcc27('0xcf')](_0x19d592[_0xcc27('0xd1')],qs[_0xcc27('0xd0')](_0xb6efa9['query'][_0xcc27('0xd0')]));_0x37acfa[_0xcc27('0x3f')]=_0x37acfa[_0xcc27('0x3f')][_0xcc27('0x43')]?_0x37acfa[_0xcc27('0x3f')]:_0x19d592[_0xcc27('0xd1')];_0x37acfa[_0xcc27('0xd2')]=qs[_0xcc27('0xd3')](_0xb6efa9['query'][_0xcc27('0xd3')]);_0x37acfa[_0xcc27('0x39')]=qs['filters'](_[_0xcc27('0xd4')](_0xb6efa9[_0xcc27('0x3b')],_0x19d592[_0xcc27('0xce')]));if(_0xb6efa9[_0xcc27('0x3b')][_0xcc27('0x27')]){_0x37acfa[_0xcc27('0x39')]=_[_0xcc27('0x50')](_0x37acfa[_0xcc27('0x39')],{'$or':_[_0xcc27('0x29')](_0x37acfa[_0xcc27('0x3f')],function(_0x2fd73e){var _0x155e0b={};_0x155e0b[_0x2fd73e]={'$like':'%'+_0xb6efa9[_0xcc27('0x3b')][_0xcc27('0x27')]+'%'};return _0x155e0b;})});}_0x37acfa[_0xcc27('0xd1')]=db[_0xcc27('0x3a')];_0x37acfa['as']=_0xcc27('0x25');_0x37acfa=_[_0xcc27('0x50')]({},_0x37acfa,_0xb6efa9[_0xcc27('0x51')]);return _0x166a5e[_0xcc27('0xf2')]({'include':[_0x37acfa]});}})[_0xcc27('0x21')](function(_0x435d57){if(_0x435d57){var _0x3d0025={},_0x1c3b74=[];for(var _0x39b042=0x0;_0x39b042<_0x435d57[_0xcc27('0x43')];_0x39b042+=0x1){for(var _0x39f4f9=0x0,_0xc79972;_0x39f4f9<_0x435d57[_0x39b042][_0xcc27('0x25')][_0xcc27('0x43')];_0x39f4f9+=0x1){_0xc79972=_0x435d57[_0x39b042][_0xcc27('0x25')][_0x39f4f9]['get']({'plain':!![]});_0x3d0025[_0xc79972['id']]=_0xc79972;}}_0x3d0025=_['values'](_0x3d0025);for(var _0x17e715=qs[_0xcc27('0x16')](_0xb6efa9['query'][_0xcc27('0x16')]);_0x17e715<_0x3d0025['length']&&_0x1c3b74[_0xcc27('0x43')]=_0x5c5dc4){_0x22238b=_0x5c5dc4;_0x374be2=0xc8;}else{_0x374be2=0xce;}_0x4536f5['status'](_0x374be2);return _0x4536f5[_0x47e3('0x1e')](_0x47e3('0x1f'),_0x2b1045+'-'+_0x22238b+'/'+_0x5c5dc4)[_0x47e3('0x19')](_0x23e752);}return null;};}function saveUpdates(_0x1ef65b){return function(_0xec9f7d){if(_0xec9f7d){return _0xec9f7d[_0x47e3('0x20')](_0x1ef65b)[_0x47e3('0x21')](function(_0x49c657){if(_0x49c657[_0x47e3('0x22')]==='agent'){socket[_0x47e3('0x23')](_0x47e3('0x24')+_0x49c657['id'],_0x49c657);}return _0x49c657;});}return null;};}function removeEntity(_0x41ecd8,_0x535b59){return function(_0xc8c18f){if(_0xc8c18f){return _0xc8c18f[_0x47e3('0x25')]({'transaction':_0x535b59})[_0x47e3('0x21')](function(){var _0x556d97=_0xc8c18f[_0x47e3('0x26')]({'plain':!![]});if(_0x556d97[_0x47e3('0x22')]===_0x47e3('0x27'))return;var _0x346acb=[{'name':_0x47e3('0x28'),'value':_0x47e3('0x29'),'ignore':!![]},{'name':_0x47e3('0x2a'),'value':_0x47e3('0x2b'),'ignore':![]},{'name':_0x47e3('0x2c'),'value':'telephone','ignore':![]}];var _0x23b0c1=_(_0x346acb)['filter'](_0x47e3('0x2d'))[_0x47e3('0x2e')](_0x47e3('0x2f'))[_0x47e3('0x2f')]();if(_[_0x47e3('0x30')](_0x23b0c1,_0x556d97[_0x47e3('0x22')])){return;}var _0x25a413=_[_0x47e3('0x31')](_0x346acb,[_0x47e3('0x2f'),_0x556d97[_0x47e3('0x22')]])[_0x47e3('0x32')];return db[_0x47e3('0x33')][_0x47e3('0x25')]({'where':{'type':_0x25a413,'resourceId':_0x556d97['id']},'transaction':_0x535b59})[_0x47e3('0x21')](function(){return _0xc8c18f;});})[_0x47e3('0x21')](function(){_0x41ecd8[_0x47e3('0x17')](0xcc)[_0x47e3('0x18')]();});}};}function handleEntityNotFound(_0x57e516){return function(_0x34c09b){if(!_0x34c09b){_0x57e516[_0x47e3('0x16')](0x194);}return _0x34c09b;};}function handleError(_0x40442f,_0x42d3a5){_0x42d3a5=_0x42d3a5||0x1f4;return function(_0x4edac7){logger['error'](_0x4edac7[_0x47e3('0x34')]);if(_0x4edac7['name']){delete _0x4edac7[_0x47e3('0x32')];}_0x40442f[_0x47e3('0x17')](_0x42d3a5)[_0x47e3('0x35')](_0x4edac7);};}function getUserAttributes(){return _(db[_0x47e3('0x36')]['rawAttributes'])[_0x47e3('0x2e')](function(_0x393c2c){return{'name':_0x393c2c['fieldName'],'type':_0x393c2c[_0x47e3('0x37')][_0x47e3('0x38')]};})[_0x47e3('0x39')](function(_0xbe7e2b){return![_0x47e3('0x3a'),_0x47e3('0x3b'),_0x47e3('0x3c'),'resetPasswordToken',_0x47e3('0x3d'),'md5secret'][_0x47e3('0x30')](_0xbe7e2b[_0x47e3('0x32')]);})[_0x47e3('0x2f')]();}exports['index']=function(_0x35cecc,_0x53e176){var _0xa4b06e={},_0x105570={'count':0x0,'rows':[]};var _0x4ab0b0=getUserAttributes();_0xa4b06e=qs[_0x47e3('0x3e')](_0x4ab0b0,_0x35cecc);var _0x31cce2={'where':_0xa4b06e[_0x47e3('0x3f')]};return db[_0x47e3('0x36')][_0x47e3('0x1d')](_0x31cce2)[_0x47e3('0x21')](function(_0x493a92){_0x105570[_0x47e3('0x1d')]=_0x493a92;if(_0x35cecc[_0x47e3('0x40')][_0x47e3('0x41')]){_0xa4b06e[_0x47e3('0x42')]=[{'all':!![]}];}if(_0x35cecc[_0x47e3('0x40')][_0x47e3('0x43')]==='true'){_0xa4b06e['include']=[{'model':db[_0x47e3('0x44')],'as':_0x47e3('0x43')}];}if(!_[_0x47e3('0x30')](_0xa4b06e[_0x47e3('0x45')],'id')){_0xa4b06e[_0x47e3('0x45')][_0x47e3('0x46')]('id');}return db[_0x47e3('0x36')][_0x47e3('0x47')](_0xa4b06e);})[_0x47e3('0x21')](function(_0x238389){_0x105570[_0x47e3('0x48')]=_0x238389;if(_0x35cecc[_0x47e3('0x40')]['openTabs']===_0x47e3('0x49')){var _0x537e28=[];for(var _0x279ba0=0x0;_0x279ba0<_0x105570[_0x47e3('0x48')][_0x47e3('0x4a')];_0x279ba0++){_0x537e28['push'](get_open_tabs('chat',_0x105570[_0x47e3('0x48')][_0x279ba0]['dataValues']));_0x537e28[_0x47e3('0x46')](get_open_tabs(_0x47e3('0x4b'),_0x105570['rows'][_0x279ba0][_0x47e3('0x4c')]));_0x537e28[_0x47e3('0x46')](get_open_tabs(_0x47e3('0x4d'),_0x105570[_0x47e3('0x48')][_0x279ba0][_0x47e3('0x4c')]));_0x537e28['push'](get_open_tabs(_0x47e3('0x4e'),_0x105570[_0x47e3('0x48')][_0x279ba0][_0x47e3('0x4c')]));_0x537e28['push'](get_open_tabs('openchannel',_0x105570['rows'][_0x279ba0]['dataValues']));_0x537e28[_0x47e3('0x46')](get_open_tabs(_0x47e3('0x4f'),_0x105570['rows'][_0x279ba0][_0x47e3('0x4c')]));}return Promise[_0x47e3('0x50')](_0x537e28)[_0x47e3('0x21')](function(){return _0x105570;});}else{return _0x105570;}})[_0x47e3('0x21')](respondWithFilteredResult(_0x53e176,_0xa4b06e))[_0x47e3('0x51')](handleError(_0x53e176,null));};exports[_0x47e3('0x52')]=function(_0x22f0bf,_0x21be4f){var _0x489bd2=getUserAttributes();_0x22f0bf[_0x47e3('0x40')]['id']=_0x22f0bf[_0x47e3('0x53')]['id'];var _0x1c7420=qs[_0x47e3('0x3e')](_0x489bd2,_0x22f0bf);if(_0x22f0bf[_0x47e3('0x40')][_0x47e3('0x41')]){_0x1c7420['include']=[{'all':!![]}];}if(_0x22f0bf[_0x47e3('0x40')][_0x47e3('0x43')]===_0x47e3('0x49')){_0x1c7420[_0x47e3('0x42')]=[{'model':db[_0x47e3('0x44')],'as':_0x47e3('0x43')}];}_0x1c7420=_[_0x47e3('0x54')]({},_0x1c7420,_0x22f0bf[_0x47e3('0x55')]);if(!_['includes'](_0x1c7420['attributes'],'id')){_0x1c7420['attributes']['push']('id');}return db[_0x47e3('0x36')][_0x47e3('0x31')](_0x1c7420)['then'](handleEntityNotFound(_0x21be4f,null))[_0x47e3('0x21')](function(_0xf30b1e){var _0x1cd1d8=[];values=_0xf30b1e;if(_0x22f0bf[_0x47e3('0x40')][_0x47e3('0x56')]==='true'){_0x1cd1d8[_0x47e3('0x46')](get_open_tabs(_0x47e3('0x57'),_0xf30b1e[_0x47e3('0x4c')]));_0x1cd1d8[_0x47e3('0x46')](get_open_tabs(_0x47e3('0x4b'),_0xf30b1e[_0x47e3('0x4c')]));_0x1cd1d8['push'](get_open_tabs('openchannel',_0xf30b1e[_0x47e3('0x4c')]));_0x1cd1d8['push'](get_open_tabs(_0x47e3('0x4f'),_0xf30b1e['dataValues']));_0x1cd1d8['push'](get_open_tabs('fax',_0xf30b1e['dataValues']));_0x1cd1d8['push'](get_open_tabs(_0x47e3('0x4e'),_0xf30b1e[_0x47e3('0x4c')]));return Promise['all'](_0x1cd1d8);}else{return values;}})[_0x47e3('0x21')](function(){return values;})['then'](respondWithResult(_0x21be4f,null))[_0x47e3('0x51')](handleError(_0x21be4f,null));};exports[_0x47e3('0x20')]=function(_0x55fac7,_0x2337ac){if(_0x55fac7[_0x47e3('0x58')]['id']){delete _0x55fac7[_0x47e3('0x58')]['id'];}delete _0x55fac7['body'][_0x47e3('0x22')];return db[_0x47e3('0x36')][_0x47e3('0x31')]({'where':{'id':_0x55fac7[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x2337ac,null))[_0x47e3('0x21')](saveUpdates(_0x55fac7['body'],null))['then'](respondWithResult(_0x2337ac,null))[_0x47e3('0x51')](handleError(_0x2337ac,null));};exports['describe']=function(_0x34ccd5,_0x2feb61){return db[_0x47e3('0x36')][_0x47e3('0x59')]()[_0x47e3('0x21')](respondWithResult(_0x2feb61,null))[_0x47e3('0x51')](handleError(_0x2feb61,null));};exports['addContacts']=function(_0x307ed4,_0x1f9a50){return db['User'][_0x47e3('0x31')]({'where':{'id':_0x307ed4[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x1f9a50,null))[_0x47e3('0x21')](function(_0x51927f){if(_0x51927f){return _0x51927f[_0x47e3('0x5a')](_0x307ed4[_0x47e3('0x58')]['ids'],_['omit'](_0x307ed4['body'],[_0x47e3('0x5b'),'id'])||{});}})[_0x47e3('0x21')](respondWithResult(_0x1f9a50,null))['catch'](handleError(_0x1f9a50,null));};function validateUser(_0x3e199b){return new Promise(function(_0xb791dd,_0x2d90ca){if(_0x3e199b[_0x47e3('0x5c')])return _0xb791dd(_0x3e199b);return db[_0x47e3('0x5d')][_0x47e3('0x5e')](0x1)[_0x47e3('0x21')](function(_0x5b8ae1){if(_0x5b8ae1['securePassword'])authService['validatePasswordPattern'](_0x3e199b[_0x47e3('0x3a')]);db[_0x47e3('0x36')][_0x47e3('0x5f')](_0x47e3('0x5c'))[_0x47e3('0x21')](function(_0x39a5e3){if(_['isNil'](_0x39a5e3)){_0x3e199b[_0x47e3('0x5c')]=_0x5b8ae1['min_internal']||0x1;return;}if(_[_0x47e3('0x60')](_0x5b8ae1[_0x47e3('0x61')])||_0x5b8ae1[_0x47e3('0x61')]===_0x39a5e3){_0x3e199b['internal']=_0x39a5e3+0x1;return;}if(_0x5b8ae1[_0x47e3('0x61')]>_0x39a5e3){_0x3e199b[_0x47e3('0x5c')]=_0x5b8ae1[_0x47e3('0x61')];return;}return db[_0x47e3('0x62')][_0x47e3('0x40')](_0x47e3('0x63'),{'type':db[_0x47e3('0x62')]['QueryTypes']['SELECT']})['then'](function(_0x12868a){if(_0x12868a&&_0x12868a[_0x47e3('0x4a')]){for(var _0x1fe438=0x0,_0x5cd882=_0x12868a['length'];_0x1fe438<_0x5cd882&&_[_0x47e3('0x60')](_0x3e199b[_0x47e3('0x5c')]);_0x1fe438++){if(_0x5b8ae1[_0x47e3('0x61')]<=_0x12868a[_0x1fe438]['from']){_0x3e199b['internal']=_0x12868a[_0x1fe438][_0x47e3('0x64')];}else if(_0x5b8ae1['min_internal']>_0x12868a[_0x1fe438]['from']&&_0x5b8ae1['min_internal']<=_0x12868a[_0x1fe438]['to']){_0x3e199b['internal']=_0x5b8ae1['min_internal'];}}}if(_['isNil'](_0x3e199b[_0x47e3('0x5c')])){_0x3e199b[_0x47e3('0x5c')]=_0x39a5e3+0x1;}return _0xb791dd(_0x3e199b);});});})[_0x47e3('0x51')](function(_0x3a5389){_0x2d90ca(_0x3a5389);});});}function updateUser(_0xd33c53){return new Promise(function(_0x42ff1d,_0x284127){try{if(_0xd33c53[_0x47e3('0x65')]){_0xd33c53['mailbox']=_0xd33c53['internal'];_0xd33c53[_0x47e3('0x66')]={'mailbox':_0xd33c53[_0x47e3('0x5c')],'password':_0xd33c53['password'],'fullname':_0xd33c53[_0x47e3('0x67')],'email':_0xd33c53[_0x47e3('0x68')]};}if(_0xd33c53[_0x47e3('0x22')]===_0x47e3('0x2b')){if(!_0xd33c53[_0x47e3('0x69')])_0xd33c53['permissions']=[_0x47e3('0x6a'),'102',_0x47e3('0x6b'),_0x47e3('0x6c'),'110',_0x47e3('0x6d'),_0x47e3('0x6e'),_0x47e3('0x6f'),_0x47e3('0x70'),_0x47e3('0x71'),_0x47e3('0x72'),_0x47e3('0x73'),_0x47e3('0x74'),_0x47e3('0x75'),'115'];}_0x42ff1d(_0xd33c53);}catch(_0x8cae17){_0x284127(_0x8cae17);}});}exports[_0x47e3('0x76')]=function(_0x3e6e5f,_0xffad7e){if(_0x3e6e5f[_0x47e3('0x29')][_0x47e3('0x22')]==='agent')throw new Error(_0x47e3('0x77'));if(_0x3e6e5f[_0x47e3('0x58')]['role']==='user'&&_0x3e6e5f[_0x47e3('0x29')][_0x47e3('0x22')]!==_0x47e3('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3e6e5f['body'][_0x47e3('0x22')]===_0x47e3('0x27')&&_0x3e6e5f[_0x47e3('0x29')][_0x47e3('0x22')]!==_0x47e3('0x27')){throw new Error(_0x47e3('0x78'));}return licenseUtil['checkUserLimits']([_0x3e6e5f['body']])[_0x47e3('0x21')](function(){return validateUser(_0x3e6e5f[_0x47e3('0x58')]);})[_0x47e3('0x21')](function(_0x70bad0){return updateUser(_0x70bad0)['then'](function(_0x4f5e47){if(_0x4f5e47['role']==='admin'){_0x4f5e47[_0x47e3('0x79')]=_0x3e6e5f[_0x47e3('0x29')][_0x47e3('0x79')];delete _0x4f5e47[_0x47e3('0x7a')];}return _0x4f5e47;});})[_0x47e3('0x21')](function(_0xb88bf6){return db[_0x47e3('0x36')]['create'](_0xb88bf6,{'include':[{'model':db['VoiceMail'],'as':_0x47e3('0x66')}]});})[_0x47e3('0x21')](function(_0x534015){if(_0x3e6e5f[_0x47e3('0x58')]['role']===_0x47e3('0x29'))return _0x534015;if(_0x3e6e5f[_0x47e3('0x29')][_0x47e3('0x22')]!==_0x47e3('0x29'))return _0x534015;return db[_0x47e3('0x7b')][_0x47e3('0x31')]({'where':{'name':_0x534015[_0x47e3('0x22')]==='agent'?_0x47e3('0x2a'):_0x47e3('0x2c'),'userProfileId':_0x3e6e5f['user'][_0x47e3('0x7a')]},'raw':!![]})['then'](function(_0x59be93){if(!_0x59be93||_0x59be93[_0x47e3('0x7c')]!=0x0)return _0x534015;return db['UserProfileResource'][_0x47e3('0x76')]({'name':_0x534015[_0x47e3('0x32')],'resourceId':_0x534015['id'],'type':_0x59be93[_0x47e3('0x32')],'sectionId':_0x59be93['id']},{})['then'](function(){return _0x534015;});})[_0x47e3('0x51')](function(_0x506070){logger[_0x47e3('0x7d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x506070);throw _0x506070;});})[_0x47e3('0x21')](respondWithResult(_0xffad7e,0xc9))[_0x47e3('0x51')](handleError(_0xffad7e,null));};exports['bulkCreate']=function(_0x53afa2,_0x5678a8){var _0x5db4de=_0x53afa2[_0x47e3('0x58')];var _0xb57fba=[];if(_0x53afa2[_0x47e3('0x29')][_0x47e3('0x22')]==='agent')throw new Error('Unauthorized');if(_['some'](_0x5db4de,['role',_0x47e3('0x29')])&&_0x53afa2[_0x47e3('0x29')]['role']!==_0x47e3('0x27')){throw new Error(_0x47e3('0x7e'));}if(_[_0x47e3('0x7f')](_0x5db4de,[_0x47e3('0x22'),_0x47e3('0x27')])&&_0x53afa2[_0x47e3('0x29')][_0x47e3('0x22')]!==_0x47e3('0x27')){throw new Error(_0x47e3('0x80'));}return licenseUtil['checkUserLimits'](_0x5db4de)[_0x47e3('0x21')](function(){return validateUser(_0x5db4de[0x0]);})[_0x47e3('0x21')](function(){for(var _0x1f1a8e=0x1;_0x1f1a8e<_0x5db4de['length'];_0x1f1a8e++){var _0x3861ef=_0x5db4de[_0x1f1a8e-0x1]['internal'];if(!_0x5db4de[_0x1f1a8e]['internal'])_0x5db4de[_0x1f1a8e][_0x47e3('0x5c')]=_0x3861ef+0x1;_0xb57fba[_0x47e3('0x46')](validateUser(_0x5db4de[_0x1f1a8e]));}return Promise[_0x47e3('0x50')](_0xb57fba);})[_0x47e3('0x21')](function(){_0xb57fba=[];for(var _0x4a0f4b=0x0;_0x4a0f4b<_0x5db4de[_0x47e3('0x4a')];_0x4a0f4b++){_0xb57fba[_0x47e3('0x46')](updateUser(_0x5db4de[_0x4a0f4b]));}return Promise[_0x47e3('0x50')](_0xb57fba);})['then'](function(){_0xb57fba=_0x5db4de[_0x47e3('0x2e')](function(_0x12ff61){return db[_0x47e3('0x36')][_0x47e3('0x76')](_0x12ff61,{'include':[{'model':db[_0x47e3('0x66')],'as':'VoiceMail'}]})[_0x47e3('0x21')](function(_0x3b7b54){_0x12ff61['id']=_0x3b7b54['id'];return _0x12ff61;});});return Promise[_0x47e3('0x50')](_0xb57fba);})[_0x47e3('0x21')](function(_0x9c8315){if(_0x53afa2[_0x47e3('0x58')][_0x47e3('0x22')]===_0x47e3('0x29'))return _0x9c8315;if(_0x53afa2[_0x47e3('0x29')][_0x47e3('0x22')]!==_0x47e3('0x29'))return _0x9c8315;var _0x3b917b=_[_0x47e3('0x7f')](_0x9c8315,function(_0x29929b){return _0x29929b[_0x47e3('0x22')]==='agent'||_0x29929b[_0x47e3('0x22')]==='telephone';});if(!_0x3b917b)return _0x9c8315;return db[_0x47e3('0x7b')][_0x47e3('0x47')]({'where':{'name':{'$or':[_0x47e3('0x2a'),_0x47e3('0x2c')]},'userProfileId':_0x53afa2[_0x47e3('0x29')][_0x47e3('0x7a')]},'raw':!![]})[_0x47e3('0x21')](function(_0x5ed3b4){if(_[_0x47e3('0x81')](_0x5ed3b4)||!_[_0x47e3('0x7f')](_0x5ed3b4,[_0x47e3('0x7c'),0x0]))return _0x9c8315;_0xb57fba=[];var _0xa34ae0=_(_0x5ed3b4)[_0x47e3('0x2e')](function(_0x156488){if(_0x156488[_0x47e3('0x7c')]===0x1)return;return _0x156488[_0x47e3('0x32')]===_0x47e3('0x2a')?_0x47e3('0x2b'):_0x47e3('0x82');})[_0x47e3('0x83')]()[_0x47e3('0x2f')]();for(var _0x4b79b2=0x0;_0x4b79b2<_0x9c8315[_0x47e3('0x4a')];_0x4b79b2++){if(!_['includes'](_0xa34ae0,_0x9c8315[_0x4b79b2][_0x47e3('0x22')]))return;var _0x2988e3=_0x9c8315[_0x4b79b2][_0x47e3('0x22')]==='agent'?_0x47e3('0x2a'):'Telephones';_0xb57fba[_0x47e3('0x46')](db['UserProfileResource'][_0x47e3('0x76')]({'name':_0x9c8315[_0x4b79b2][_0x47e3('0x32')],'resourceId':_0x9c8315[_0x4b79b2]['id'],'type':_0x2988e3,'sectionId':_['find'](_0x5ed3b4,['name',_0x2988e3])['id']},{}));}return Promise[_0x47e3('0x50')](_0xb57fba);});})[_0x47e3('0x21')](respondWithResult(_0x5678a8,0xc9))['catch'](handleError(_0x5678a8,null));};exports[_0x47e3('0x84')]=function(_0x1632be,_0xcc6606){if(_0x1632be['body']['id']){delete _0x1632be['body']['id'];}return db[_0x47e3('0x36')]['find']({'where':{'id':_0x1632be[_0x47e3('0x53')]['id']}})['then'](function(_0x1da4eb){if(!_0x1da4eb)return null;if(_0x1da4eb['id']===_0x1632be[_0x47e3('0x29')]['id']){if(!_0x1632be[_0x47e3('0x58')][_0x47e3('0x85')]||!_0x1632be['body'][_0x47e3('0x86')]){throw new db[(_0x47e3('0x87'))][(_0x47e3('0x88'))](_0x47e3('0x89'));}if(!_0x1da4eb[_0x47e3('0x8a')](_0x1632be[_0x47e3('0x58')][_0x47e3('0x85')])){throw new db['Sequelize'][(_0x47e3('0x88'))]('Wrong\x20credentials');}if(_0x1632be['body'][_0x47e3('0x85')]===_0x1632be['body']['newPassword']){throw new db['Sequelize'][(_0x47e3('0x88'))](_0x47e3('0x8b'));}}else if(_0x1632be['user'][_0x47e3('0x22')]===_0x47e3('0x27')){if(!_0x1632be[_0x47e3('0x58')][_0x47e3('0x86')]){throw new db[(_0x47e3('0x87'))][(_0x47e3('0x88'))](_0x47e3('0x8c'));}}else if(_0x1632be[_0x47e3('0x29')][_0x47e3('0x22')]===_0x47e3('0x29')){if(!_0x1632be[_0x47e3('0x58')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0x47e3('0x8c'));}if(_0x1da4eb[_0x47e3('0x22')]!==_0x47e3('0x2b')){throw new db['Sequelize'][(_0x47e3('0x88'))](_0x47e3('0x77'));}}else{throw new db[(_0x47e3('0x87'))][(_0x47e3('0x88'))](_0x47e3('0x77'));}return _0x1da4eb;})[_0x47e3('0x21')](handleEntityNotFound(_0xcc6606,null))[_0x47e3('0x21')](function(_0x293683){return db[_0x47e3('0x5d')][_0x47e3('0x8d')]({'attributes':['id','securePassword',_0x47e3('0x8e'),'passwordHistoryLimit']})[_0x47e3('0x21')](function(_0x10aedd){if(_0x10aedd['securePassword'])authService[_0x47e3('0x8f')](_0x1632be[_0x47e3('0x58')][_0x47e3('0x86')]);if(!_0x10aedd[_0x47e3('0x8e')]||!_0x293683[_0x47e3('0x3c')])return _0x293683;authService[_0x47e3('0x90')](_0x1632be[_0x47e3('0x58')][_0x47e3('0x86')],_0x293683[_0x47e3('0x3c')],_0x10aedd[_0x47e3('0x91')]);return _0x293683;})[_0x47e3('0x21')](saveUpdates({'password':_0x1632be[_0x47e3('0x58')][_0x47e3('0x86')],'passwordResetAt':_0x1632be[_0x47e3('0x29')]['id']==_0x1632be[_0x47e3('0x53')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x1632be[_0x47e3('0x58')][_0x47e3('0x86')],_0x293683[_0x47e3('0x3c')])},null));})[_0x47e3('0x21')](respondWithResult(_0xcc6606,null))[_0x47e3('0x51')](handleError(_0xcc6606,null));};exports[_0x47e3('0x92')]=function(_0x140ff0,_0x4cdd57){var _0x1410d1=_0x140ff0['body'][_0x47e3('0x93')];return db[_0x47e3('0x36')][_0x47e3('0x31')]({'where':{'id':_0x140ff0[_0x47e3('0x53')]['id']},'attributes':['id',_0x47e3('0x32'),_0x47e3('0x22'),_0x47e3('0x94'),_0x47e3('0x95'),_0x47e3('0x96'),'interface']})[_0x47e3('0x21')](handleEntityNotFound(_0x4cdd57,null))[_0x47e3('0x21')](function(_0x17c117){if(_0x17c117){if(!utils[_0x47e3('0x97')](_0x1410d1)){throw new db['Sequelize'][(_0x47e3('0x88'))](_0x47e3('0x98'));}return _0x17c117[_0x47e3('0x99')+_[_0x47e3('0x9a')](_0x1410d1[_0x47e3('0x9b')]())+_0x47e3('0x9c')](_0x140ff0['body']['ids'],{'penalty':_0x140ff0[_0x47e3('0x58')]['penalty']||0x0})['spread'](function(_0x3f7ae5){for(var _0x12bf51=0x0;_0x12bf51<_0x140ff0[_0x47e3('0x58')][_0x47e3('0x5b')]['length'];_0x12bf51+=0x1){var _0x164f97={'UserId':Number(_0x140ff0['params']['id'])};_0x164f97[_[_0x47e3('0x9a')](_0x1410d1[_0x47e3('0x9b')]())+_0x47e3('0x9d')]=Number(_0x140ff0[_0x47e3('0x58')][_0x47e3('0x5b')][_0x12bf51]);socket['emit'](_0x47e3('0x29')+_[_0x47e3('0x9a')](_0x1410d1[_0x47e3('0x9b')]())+_0x47e3('0x9e'),_0x164f97);}return _0x3f7ae5;})[_0x47e3('0x21')](function(){if(_0x1410d1===_0x47e3('0x9f')){return db[_0x47e3('0xa0')][_0x47e3('0x47')]({'where':{'id':_0x140ff0[_0x47e3('0x58')][_0x47e3('0x5b')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x47e3('0x21')](function(_0x5a7a1c){var _0x1765b8=_0x17c117[_0x47e3('0x26')]({'plain':!![]});var _0x456512=[];if(_0x1410d1===_0x47e3('0x9f')&&_0x1765b8[_0x47e3('0x22')]===_0x47e3('0x2b')&&_0x1765b8[_0x47e3('0x94')]){for(let _0x30cb31=0x0;_0x30cb31<_0x5a7a1c['length'];_0x30cb31+=0x1){_0x456512[_0x47e3('0x46')]({'membername':_0x1765b8[_0x47e3('0x32')],'UserId':_0x1765b8['id'],'queue_name':_0x5a7a1c[_0x30cb31][_0x47e3('0x32')],'VoiceQueueId':_0x5a7a1c[_0x30cb31]['id'],'interface':_['isNil'](_0x1765b8[_0x47e3('0xa1')])?util[_0x47e3('0xa2')](_0x47e3('0xa3'),_0x1765b8[_0x47e3('0x32')]):_0x1765b8['interface'],'paused':_0x1765b8['voicePause']||![],'penalty':_0x140ff0[_0x47e3('0x58')][_0x47e3('0xa4')]||0x0});}return Promise[_0x47e3('0x50')](_0x456512[_0x47e3('0x2e')](function(_0x183a59){return db[_0x47e3('0xa5')][_0x47e3('0xa6')](_0x183a59);}));}return _0x17c117;});}})[_0x47e3('0x21')](respondWithStatusCode(_0x4cdd57,null))['catch'](handleError(_0x4cdd57,null));};exports[_0x47e3('0xa7')]=function(_0x2af081,_0x360613){var _0x107348,_0x278e7c;return db[_0x47e3('0x36')][_0x47e3('0x31')]({'where':{'id':_0x2af081[_0x47e3('0x53')]['id']},'attributes':['id','name',_0x47e3('0x22')]})[_0x47e3('0x21')](handleEntityNotFound(_0x360613,null))['then'](function(_0x1fdb1f){if(_0x1fdb1f){_0x107348=_0x1fdb1f;if(!_0x2af081[_0x47e3('0x40')][_0x47e3('0x93')]||!utils['isValidChannel'](_0x2af081[_0x47e3('0x40')]['channel'])){throw new db[(_0x47e3('0x87'))][(_0x47e3('0x88'))](_0x47e3('0x98'));}return _0x1fdb1f[_0x47e3('0xa8')+_[_0x47e3('0x9a')](_0x2af081[_0x47e3('0x40')][_0x47e3('0x93')][_0x47e3('0x9b')]())+_0x47e3('0x9c')](_0x2af081[_0x47e3('0x40')][_0x47e3('0x5b')]);}})[_0x47e3('0x21')](function(_0x20ab31){if(_[_0x47e3('0xa9')](_0x2af081[_0x47e3('0x40')][_0x47e3('0x5b')])){for(var _0x505ef0=0x0;_0x505ef0<_0x2af081[_0x47e3('0x40')]['ids'][_0x47e3('0x4a')];_0x505ef0+=0x1){_0x278e7c={'UserId':Number(_0x2af081[_0x47e3('0x53')]['id'])};_0x278e7c[_[_0x47e3('0x9a')](_0x2af081[_0x47e3('0x40')][_0x47e3('0x93')][_0x47e3('0x9b')]())+'QueueId']=Number(_0x2af081['query']['ids'][_0x505ef0]);socket[_0x47e3('0x23')](_0x47e3('0x29')+_[_0x47e3('0x9a')](_0x2af081[_0x47e3('0x40')][_0x47e3('0x93')]['toLowerCase']())+_0x47e3('0xaa'),_0x278e7c);}}else{_0x278e7c={'UserId':Number(_0x2af081[_0x47e3('0x53')]['id'])};_0x278e7c[_['capitalize'](_0x2af081[_0x47e3('0x40')][_0x47e3('0x93')][_0x47e3('0x9b')]())+_0x47e3('0x9d')]=Number(_0x2af081['query'][_0x47e3('0x5b')]);socket[_0x47e3('0x23')](_0x47e3('0x29')+_[_0x47e3('0x9a')](_0x2af081[_0x47e3('0x40')]['channel'][_0x47e3('0x9b')]())+'Queue:remove',_0x278e7c);}return _0x20ab31;})[_0x47e3('0x21')](function(){if(_0x2af081[_0x47e3('0x40')][_0x47e3('0x93')]===_0x47e3('0x9f')){return db[_0x47e3('0xa5')][_0x47e3('0x25')]({'where':{'UserId':_0x2af081[_0x47e3('0x53')]['id'],'VoiceQueueId':_0x2af081[_0x47e3('0x40')]['ids']},'individualHooks':!![]})['then'](function(){return _0x107348;});}return _0x107348;})[_0x47e3('0x21')](respondWithStatusCode(_0x360613,null))[_0x47e3('0x51')](handleError(_0x360613,null));};exports['addAvatar']=function(_0x74a07e,_0x4258c3){_0x74a07e[_0x47e3('0x58')]['userpic']=_0x74a07e[_0x47e3('0xab')][_0x47e3('0xac')];return db['User'][_0x47e3('0x31')]({'where':{'id':_0x74a07e['params']['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x4258c3,null))[_0x47e3('0x21')](saveUpdates(_0x74a07e[_0x47e3('0x58')],null))[_0x47e3('0x21')](respondWithResult(_0x4258c3,null))[_0x47e3('0x51')](handleError(_0x4258c3,null));};exports[_0x47e3('0xad')]=function(_0xd56c4c,_0x2a2b9c){var _0x29c56b=path['join'](config[_0x47e3('0xae')],_0x47e3('0xaf'));return db[_0x47e3('0x36')][_0x47e3('0x31')]({'where':{'id':_0xd56c4c['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x47e3('0x21')](handleEntityNotFound(_0x2a2b9c,null))[_0x47e3('0x21')](function(_0x39c856){if(_0x39c856){if(_[_0x47e3('0x60')](_0x39c856[_0x47e3('0xb0')])){return _0x2a2b9c[_0x47e3('0xb1')](_0x29c56b);}else{if(!fs[_0x47e3('0xb2')](path[_0x47e3('0xb3')](config[_0x47e3('0xae')],_0x47e3('0xb4'),_0x39c856[_0x47e3('0xb0')]))){return _0x2a2b9c['download'](_0x29c56b);}return _0x2a2b9c['download'](path[_0x47e3('0xb3')](config['root'],_0x47e3('0xb4'),_0x39c856[_0x47e3('0xb0')]));}}})[_0x47e3('0x51')](handleError(_0x2a2b9c,null));};exports[_0x47e3('0xb5')]=function(_0x525466,_0x427615){return db[_0x47e3('0x36')][_0x47e3('0x31')]({'where':{'id':_0x525466['params']['id']},'attributes':['id']})[_0x47e3('0x21')](handleEntityNotFound(_0x427615,null))[_0x47e3('0x21')](function(_0x1a9446){var _0x5433e8=[];values=_0x1a9446['dataValues'];_0x5433e8[_0x47e3('0x46')](get_open_tabs(_0x47e3('0x57'),_0x1a9446[_0x47e3('0x4c')]));_0x5433e8[_0x47e3('0x46')](get_open_tabs(_0x47e3('0x4b'),_0x1a9446[_0x47e3('0x4c')]));_0x5433e8[_0x47e3('0x46')](get_open_tabs(_0x47e3('0xb6'),_0x1a9446[_0x47e3('0x4c')]));_0x5433e8[_0x47e3('0x46')](get_open_tabs(_0x47e3('0x4f'),_0x1a9446[_0x47e3('0x4c')]));_0x5433e8['push'](get_open_tabs(_0x47e3('0x4d'),_0x1a9446[_0x47e3('0x4c')]));_0x5433e8[_0x47e3('0x46')](get_open_tabs(_0x47e3('0x4e'),_0x1a9446[_0x47e3('0x4c')]));return Promise[_0x47e3('0x50')](_0x5433e8);})[_0x47e3('0x21')](function(_0x4cd12d){if(_0x4cd12d){var _0x775de=_[_0x47e3('0x2e')](values['ChatOpenTabs'],function(_0x553c4d){return{'channel':'CHAT','id':_0x553c4d['id'],'createdAt':_0x553c4d[_0x47e3('0xb7')]};});var _0x5e792c=_['map'](values['FaxOpenTabs'],function(_0x37f989){return{'channel':_0x47e3('0xb8'),'id':_0x37f989['id'],'createdAt':_0x37f989[_0x47e3('0xb7')]};});var _0x40d111=_[_0x47e3('0x2e')](values[_0x47e3('0xb9')],function(_0x384b5e){return{'channel':_0x47e3('0xba'),'id':_0x384b5e['id'],'createdAt':_0x384b5e[_0x47e3('0xb7')]};});var _0x2e7ee8=_[_0x47e3('0x2e')](values[_0x47e3('0xbb')],function(_0x1181dd){return{'channel':_0x47e3('0xbc'),'id':_0x1181dd['id'],'createdAt':_0x1181dd[_0x47e3('0xb7')]};});var _0x4299ff=_[_0x47e3('0x2e')](values[_0x47e3('0xbd')],function(_0x31a0e6){return{'channel':'SMS','id':_0x31a0e6['id'],'createdAt':_0x31a0e6[_0x47e3('0xb7')]};});var _0x41679d=_[_0x47e3('0x2e')](values[_0x47e3('0xbe')],function(_0x210018){return{'channel':'WHATSAPP','id':_0x210018['id'],'createdAt':_0x210018['createdAt']};});var _0x408ec0=_[_0x47e3('0xbf')](_0x775de,_0x5e792c,_0x40d111,_0x2e7ee8,_0x4299ff,_0x41679d);var _0x3f70fb={'count':_0x408ec0['length'],'rows':_0x408ec0};return _0x3f70fb;}else return null;})[_0x47e3('0x21')](respondWithResult(_0x427615,null))[_0x47e3('0x51')](handleError(_0x427615,null));};exports[_0x47e3('0xc0')]=function(_0x31fac8,_0x266b5f){var _0x2e2fc2={};return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x31fac8[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](function(_0x484908){if(!_0x484908){throw new APINotFoundError(util['format'](_0x47e3('0xc1'),_0x31fac8[_0x47e3('0x53')]['id']));}return contacts['describe']();})[_0x47e3('0x21')](function(_0x5ef816){_0x31fac8[_0x47e3('0x40')][_0x47e3('0x36')]=_0x31fac8[_0x47e3('0x53')]['id'];_0x2e2fc2=qs[_0x47e3('0x3e')](_0x5ef816,_0x31fac8);if(_0x31fac8[_0x47e3('0x40')]['hasOwnProperty'](_0x47e3('0x41'))){_0x2e2fc2[_0x47e3('0x42')]=[{'model':db[_0x47e3('0xc2')],'as':'List','required':![]},{'model':db[_0x47e3('0xc3')],'as':'Tags','attributes':['id',_0x47e3('0x32'),_0x47e3('0xc4')],'where':_0x31fac8[_0x47e3('0x40')][_0x47e3('0xc5')]?{'id':_0x31fac8[_0x47e3('0x40')]['tag']}:undefined,'required':_0x31fac8[_0x47e3('0x40')][_0x47e3('0xc5')]?!![]:![]}];}return contacts['findAll'](_0x31fac8[_0x47e3('0x40')],_0x31fac8['user'],_0x2e2fc2,_0x5ef816);})['then'](respondWithFilteredResult(_0x266b5f,_0x2e2fc2))[_0x47e3('0x51')](APIHandleError(_0x266b5f));};exports['getQueues']=function(_0x3147ac,_0x471108){var _0x24347b;var _0xcf5ee7={};var _0x351709;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x3147ac[_0x47e3('0x53')]['id']},'attributes':['id',_0x47e3('0x32'),_0x47e3('0x22')]})['then'](handleEntityNotFound(_0x471108,null))[_0x47e3('0x21')](function(_0x25fae7){if(!utils[_0x47e3('0x97')](_0x3147ac[_0x47e3('0x40')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}_0x24347b=_0x25fae7;var _0xc9db34={};_0xc9db34[_0x47e3('0xc6')]=_[_0x47e3('0xc7')](db[_[_0x47e3('0x9a')](_0x3147ac['query']['channel'])+_0x47e3('0xc8')][_0x47e3('0xc9')]);_0xc9db34[_0x47e3('0x40')]=_[_0x47e3('0xc7')](_0x3147ac[_0x47e3('0x40')]);_0xc9db34[_0x47e3('0xca')]=_[_0x47e3('0xcb')](_0xc9db34[_0x47e3('0xc6')],_0xc9db34[_0x47e3('0x40')]);_0xcf5ee7['attributes']=_[_0x47e3('0xcb')](_0xc9db34['model'],qs[_0x47e3('0xcc')](_0x3147ac[_0x47e3('0x40')][_0x47e3('0xcc')]));_0xcf5ee7[_0x47e3('0x45')]=_0xcf5ee7[_0x47e3('0x45')][_0x47e3('0x4a')]?_0xcf5ee7[_0x47e3('0x45')]:_0xc9db34['model'];_0xcf5ee7[_0x47e3('0xcd')]=qs['sort'](_0x3147ac['query'][_0x47e3('0xce')]);_0xcf5ee7[_0x47e3('0x3f')]=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0x3147ac['query'],_0xc9db34['filters']));if(_0x3147ac[_0x47e3('0x40')]['filter']){_0xcf5ee7[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0xcf5ee7['where'],{'$or':_[_0x47e3('0x2e')](_0xcf5ee7[_0x47e3('0x45')],function(_0x6b1e78){var _0x830bb2={};_0x830bb2[_0x6b1e78]={'$like':'%'+_0x3147ac['query'][_0x47e3('0x39')]+'%'};return _0x830bb2;})});}_0xcf5ee7=_[_0x47e3('0x54')]({},_0xcf5ee7,_0x3147ac[_0x47e3('0x55')]);switch(_0x24347b['role']){case'admin':return db[_[_0x47e3('0x9a')](_0x3147ac['query'][_0x47e3('0x93')])+_0x47e3('0xc8')][_0x47e3('0x47')](_0xcf5ee7);case _0x47e3('0x29'):case _0x47e3('0x2b'):return _0x24347b[_0x47e3('0x26')+_['capitalize'](_0x3147ac[_0x47e3('0x40')][_0x47e3('0x93')])+_0x47e3('0x9c')](_0xcf5ee7);default:throw new db[(_0x47e3('0x87'))][(_0x47e3('0x88'))](_0x47e3('0xd0'));}})[_0x47e3('0x21')](function(_0x3ea6bc){_0x351709=_0x3ea6bc['length'];if(!_0x3147ac[_0x47e3('0x40')][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0xcf5ee7[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0x3147ac[_0x47e3('0x40')][_0x47e3('0x1b')]);_0xcf5ee7['offset']=qs[_0x47e3('0x1a')](_0x3147ac[_0x47e3('0x40')]['offset']);}switch(_0x24347b[_0x47e3('0x22')]){case _0x47e3('0x27'):return db[_[_0x47e3('0x9a')](_0x3147ac[_0x47e3('0x40')][_0x47e3('0x93')])+_0x47e3('0xc8')][_0x47e3('0x47')](_0xcf5ee7);case'user':case _0x47e3('0x2b'):return _0x24347b[_0x47e3('0x26')+_[_0x47e3('0x9a')](_0x3147ac[_0x47e3('0x40')][_0x47e3('0x93')])+_0x47e3('0x9c')](_0xcf5ee7);}})[_0x47e3('0x21')](function(_0x473448){return{'count':_0x351709,'rows':_0x473448};})[_0x47e3('0x21')](respondWithResult(_0x471108,null))[_0x47e3('0x51')](handleError(_0x471108,null));};exports[_0x47e3('0xd3')]=function(_0xdde83,_0x357f11){var _0x2b2de8={};var _0x2d7a39={};var _0xa000b5;var _0x1f282d;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0xdde83[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x357f11,null))[_0x47e3('0x21')](function(_0x1aa56f){if(_0x1aa56f){_0xa000b5=_0x1aa56f;_0x2d7a39[_0x47e3('0xc6')]=_['keys'](db['UserVoiceQueueRt'][_0x47e3('0xc9')]);_0x2d7a39['query']=_[_0x47e3('0xc7')](_0xdde83[_0x47e3('0x40')]);_0x2d7a39[_0x47e3('0xca')]=_['intersection'](_0x2d7a39[_0x47e3('0xc6')],_0x2d7a39[_0x47e3('0x40')]);_0x2b2de8[_0x47e3('0x45')]=_['intersection'](_0x2d7a39[_0x47e3('0xc6')],qs['fields'](_0xdde83[_0x47e3('0x40')][_0x47e3('0xcc')]));_0x2b2de8['attributes']=_0x2b2de8[_0x47e3('0x45')][_0x47e3('0x4a')]?_0x2b2de8[_0x47e3('0x45')]:_0x2d7a39[_0x47e3('0xc6')];_0x2b2de8[_0x47e3('0xcd')]=qs[_0x47e3('0xce')](_0xdde83[_0x47e3('0x40')][_0x47e3('0xce')]);_0x2b2de8['where']=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0xdde83[_0x47e3('0x40')],_0x2d7a39[_0x47e3('0xca')]));if(_0xdde83[_0x47e3('0x40')][_0x47e3('0x39')]){_0x2b2de8['where']=_[_0x47e3('0x54')](_0x2b2de8[_0x47e3('0x3f')],{'$or':_[_0x47e3('0x2e')](_0x2b2de8[_0x47e3('0x45')],function(_0x584027){var _0x2c64bc={};_0x2c64bc[_0x584027]={'$like':'%'+_0xdde83[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0x2c64bc;})});}_0x2b2de8=_[_0x47e3('0x54')]({},_0x2b2de8,_0xdde83[_0x47e3('0x55')]);return _0xa000b5[_0x47e3('0xd3')](_0x2b2de8);}})[_0x47e3('0x21')](function(_0x4c3919){if(_0x4c3919){_0x1f282d=_0x4c3919[_0x47e3('0x4a')];if(!_0xdde83[_0x47e3('0x40')]['hasOwnProperty'](_0x47e3('0xd2'))){_0x2b2de8[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0xdde83[_0x47e3('0x40')][_0x47e3('0x1b')]);_0x2b2de8[_0x47e3('0x1a')]=qs[_0x47e3('0x1a')](_0xdde83[_0x47e3('0x40')][_0x47e3('0x1a')]);}return _0xa000b5['getVoiceQueuesRt'](_0x2b2de8);}})[_0x47e3('0x21')](function(_0x31c53b){if(_0x31c53b){return _0x31c53b?{'count':_0x1f282d,'rows':_0x31c53b}:null;}})[_0x47e3('0x21')](respondWithResult(_0x357f11,null))[_0x47e3('0x51')](handleError(_0x357f11,null));};exports['getGroups']=function(_0x52865e,_0x344893){var _0x14b098={};var _0x5ca82a={};var _0x4dcd79;var _0x5a663e;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x52865e[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x344893,null))[_0x47e3('0x21')](function(_0x390a84){if(_0x390a84){_0x4dcd79=_0x390a84;_0x5ca82a[_0x47e3('0xc6')]=_[_0x47e3('0xc7')](db[_0x47e3('0xd4')][_0x47e3('0xc9')]);_0x5ca82a[_0x47e3('0x40')]=_[_0x47e3('0xc7')](_0x52865e['query']);_0x5ca82a['filters']=_[_0x47e3('0xcb')](_0x5ca82a['model'],_0x5ca82a[_0x47e3('0x40')]);_0x14b098[_0x47e3('0x45')]=_['intersection'](_0x5ca82a[_0x47e3('0xc6')],qs[_0x47e3('0xcc')](_0x52865e['query'][_0x47e3('0xcc')]));_0x14b098[_0x47e3('0x45')]=_0x14b098[_0x47e3('0x45')][_0x47e3('0x4a')]?_0x14b098[_0x47e3('0x45')]:_0x5ca82a[_0x47e3('0xc6')];_0x14b098[_0x47e3('0xcd')]=qs[_0x47e3('0xce')](_0x52865e[_0x47e3('0x40')][_0x47e3('0xce')]);_0x14b098['where']=qs['filters'](_['pick'](_0x52865e[_0x47e3('0x40')],_0x5ca82a['filters']));if(_0x52865e[_0x47e3('0x40')]['filter']){_0x14b098[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0x14b098['where'],{'$or':_['map'](_0x14b098[_0x47e3('0x45')],function(_0x5888b6){var _0xb1bd4a={};_0xb1bd4a[_0x5888b6]={'$like':'%'+_0x52865e[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0xb1bd4a;})});}_0x14b098=_['merge']({},_0x14b098,_0x52865e['options']);return _0x4dcd79[_0x47e3('0xd5')](_0x14b098);}})[_0x47e3('0x21')](function(_0x4997c){if(_0x4997c){_0x5a663e=_0x4997c[_0x47e3('0x4a')];if(!_0x52865e[_0x47e3('0x40')][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0x14b098[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0x52865e[_0x47e3('0x40')]['limit']);_0x14b098[_0x47e3('0x1a')]=qs[_0x47e3('0x1a')](_0x52865e[_0x47e3('0x40')][_0x47e3('0x1a')]);}return _0x4dcd79[_0x47e3('0xd5')](_0x14b098);}})[_0x47e3('0x21')](function(_0x2a47b9){if(_0x2a47b9){return _0x2a47b9?{'count':_0x5a663e,'rows':_0x2a47b9}:null;}})[_0x47e3('0x21')](respondWithResult(_0x344893,null))[_0x47e3('0x51')](handleError(_0x344893,null));};exports[_0x47e3('0xd6')]=function(_0x17d955,_0x4464e1){var _0x1e9934={'raw':!![],'where':{}};var _0x2e01c9={};var _0x47bd66={'count':0x0,'rows':[]};return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x17d955[_0x47e3('0x53')]['id']}})['then'](handleEntityNotFound(_0x4464e1,null))['then'](function(_0x2760e6){if(_0x2760e6){_0x2e01c9['model']=_[_0x47e3('0xc7')](db[_0x47e3('0xd7')][_0x47e3('0xc9')]);_0x2e01c9['query']=_['keys'](_0x17d955[_0x47e3('0x40')]);_0x2e01c9['filters']=_[_0x47e3('0xcb')](_0x2e01c9['model'],_0x2e01c9['query']);_0x1e9934[_0x47e3('0x45')]=_[_0x47e3('0xcb')](_0x2e01c9['model'],qs[_0x47e3('0xcc')](_0x17d955[_0x47e3('0x40')][_0x47e3('0xcc')]));_0x1e9934[_0x47e3('0x45')]=_0x1e9934[_0x47e3('0x45')]['length']?_0x1e9934[_0x47e3('0x45')]:_0x2e01c9['model'];if(!_0x17d955['query'][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0x1e9934[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0x17d955[_0x47e3('0x40')][_0x47e3('0x1b')]);_0x1e9934[_0x47e3('0x1a')]=qs[_0x47e3('0x1a')](_0x17d955[_0x47e3('0x40')][_0x47e3('0x1a')]);}_0x1e9934['order']=qs['sort'](_0x17d955['query'][_0x47e3('0xce')]);_0x1e9934['where']=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0x17d955['query'],_0x2e01c9[_0x47e3('0xca')]));_0x1e9934[_0x47e3('0x3f')]['UserId']=_0x2760e6['id'];if(_0x17d955[_0x47e3('0x40')][_0x47e3('0x39')]){_0x1e9934[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0x1e9934[_0x47e3('0x3f')],{'$or':_[_0x47e3('0x2e')](_0x1e9934[_0x47e3('0x45')],function(_0x1ddb66){var _0x245799={};_0x245799[_0x1ddb66]={'$like':'%'+_0x17d955[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0x245799;})});}_0x1e9934=_[_0x47e3('0x54')]({},_0x1e9934,_0x17d955[_0x47e3('0x55')]);return db[_0x47e3('0xd7')][_0x47e3('0x1d')]({'where':_0x1e9934['where']})[_0x47e3('0x21')](function(_0x5b9b81){_0x47bd66['count']=_0x5b9b81;if(_0x17d955[_0x47e3('0x40')][_0x47e3('0x41')]){_0x1e9934[_0x47e3('0x42')]=[{'all':!![]}];}return db['VoiceRecording'][_0x47e3('0x47')](_0x1e9934);})[_0x47e3('0x21')](function(_0x5f5602){_0x47bd66['rows']=_0x5f5602;return _0x47bd66;});}})['then'](respondWithFilteredResult(_0x4464e1,_0x1e9934))[_0x47e3('0x51')](handleError(_0x4464e1,null));};exports[_0x47e3('0xd8')]=function(_0x7009ac,_0x1f30a9){var _0x80481={'raw':!![],'where':{}};var _0x3d3f61={};var _0x50eb73={'count':0x0,'rows':[]};return db[_0x47e3('0x36')]['findOne']({'where':{'id':_0x7009ac[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x1f30a9,null))['then'](function(_0x5ca788){if(_0x5ca788){_0x3d3f61[_0x47e3('0xc6')]=_[_0x47e3('0xc7')](db[_0x47e3('0xd9')][_0x47e3('0xc9')]);_0x3d3f61[_0x47e3('0x40')]=_[_0x47e3('0xc7')](_0x7009ac['query']);_0x3d3f61['filters']=_[_0x47e3('0xcb')](_0x3d3f61[_0x47e3('0xc6')],_0x3d3f61[_0x47e3('0x40')]);_0x80481[_0x47e3('0x45')]=_[_0x47e3('0xcb')](_0x3d3f61['model'],qs[_0x47e3('0xcc')](_0x7009ac[_0x47e3('0x40')][_0x47e3('0xcc')]));_0x80481[_0x47e3('0x45')]=_0x80481[_0x47e3('0x45')][_0x47e3('0x4a')]?_0x80481[_0x47e3('0x45')]:_0x3d3f61[_0x47e3('0xc6')];if(!_0x7009ac[_0x47e3('0x40')][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0x80481[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0x7009ac[_0x47e3('0x40')][_0x47e3('0x1b')]);_0x80481[_0x47e3('0x1a')]=qs[_0x47e3('0x1a')](_0x7009ac[_0x47e3('0x40')][_0x47e3('0x1a')]);}_0x80481[_0x47e3('0xcd')]=qs[_0x47e3('0xce')](_0x7009ac['query'][_0x47e3('0xce')]);_0x80481[_0x47e3('0x3f')]=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0x7009ac[_0x47e3('0x40')],_0x3d3f61[_0x47e3('0xca')]));_0x80481[_0x47e3('0x3f')][_0x47e3('0xda')]=_0x5ca788['id'];if(_0x7009ac['query'][_0x47e3('0x39')]){_0x80481['where']=_['merge'](_0x80481[_0x47e3('0x3f')],{'$or':_['map'](_0x80481['attributes'],function(_0x2cf5f2){var _0xc0b270={};_0xc0b270[_0x2cf5f2]={'$like':'%'+_0x7009ac[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0xc0b270;})});}_0x80481=_[_0x47e3('0x54')]({},_0x80481,_0x7009ac['options']);return db[_0x47e3('0xd9')]['count']({'where':_0x80481[_0x47e3('0x3f')]})[_0x47e3('0x21')](function(_0x41cd70){_0x50eb73['count']=_0x41cd70;if(_0x7009ac[_0x47e3('0x40')][_0x47e3('0x41')]){_0x80481[_0x47e3('0x42')]=[{'all':!![]}];}return db['ScreenRecording'][_0x47e3('0x47')](_0x80481);})[_0x47e3('0x21')](function(_0x1060ae){_0x50eb73[_0x47e3('0x48')]=_0x1060ae;return _0x50eb73;});}})[_0x47e3('0x21')](respondWithFilteredResult(_0x1f30a9,_0x80481))['catch'](handleError(_0x1f30a9,null));};exports[_0x47e3('0xdb')]=function(_0x588d10,_0x143c73){var _0x476afa={};var _0x4edf98={};var _0x5cd2ce;var _0x128ce3;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x588d10[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x143c73,null))[_0x47e3('0x21')](function(_0x3970f5){if(_0x3970f5){_0x5cd2ce=_0x3970f5;_0x4edf98[_0x47e3('0xc6')]=_[_0x47e3('0xc7')](db['ChatInteraction'][_0x47e3('0xc9')]);_0x4edf98['query']=_[_0x47e3('0xc7')](_0x588d10[_0x47e3('0x40')]);_0x4edf98[_0x47e3('0xca')]=_[_0x47e3('0xcb')](_0x4edf98['model'],_0x4edf98[_0x47e3('0x40')]);_0x476afa[_0x47e3('0x45')]=_['intersection'](_0x4edf98[_0x47e3('0xc6')],qs[_0x47e3('0xcc')](_0x588d10['query'][_0x47e3('0xcc')]));_0x476afa[_0x47e3('0x45')]=_0x476afa[_0x47e3('0x45')]['length']?_0x476afa[_0x47e3('0x45')]:_0x4edf98['model'];_0x476afa['order']=qs[_0x47e3('0xce')](_0x588d10[_0x47e3('0x40')]['sort']);_0x476afa[_0x47e3('0x3f')]=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0x588d10['query'],_0x4edf98['filters']));if(_0x588d10['query'][_0x47e3('0x39')]){_0x476afa['where']=_[_0x47e3('0x54')](_0x476afa[_0x47e3('0x3f')],{'$or':_['map'](_0x476afa[_0x47e3('0x45')],function(_0x19fb3e){var _0x519946={};_0x519946[_0x19fb3e]={'$like':'%'+_0x588d10[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0x519946;})});}_0x476afa=_[_0x47e3('0x54')]({},_0x476afa,_0x588d10[_0x47e3('0x55')]);return _0x5cd2ce[_0x47e3('0xdb')](_0x476afa);}})['then'](function(_0x3b7398){if(_0x3b7398){_0x128ce3=_0x3b7398[_0x47e3('0x4a')];if(!_0x588d10['query'][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0x476afa[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0x588d10['query'][_0x47e3('0x1b')]);_0x476afa['offset']=qs[_0x47e3('0x1a')](_0x588d10['query'][_0x47e3('0x1a')]);}return _0x5cd2ce[_0x47e3('0xdb')](_0x476afa);}})['then'](function(_0x19dcdc){if(_0x19dcdc){return _0x19dcdc?{'count':_0x128ce3,'rows':_0x19dcdc}:null;}})[_0x47e3('0x21')](respondWithResult(_0x143c73,null))[_0x47e3('0x51')](handleError(_0x143c73,null));};exports[_0x47e3('0xdc')]=function(_0x1e82a2,_0x3abe1d){var _0x1132ab={};var _0x3d492d={};var _0x177507;var _0x5aaaed;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x1e82a2[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x3abe1d,null))[_0x47e3('0x21')](function(_0x1577f0){if(_0x1577f0){_0x177507=_0x1577f0;_0x3d492d['model']=_[_0x47e3('0xc7')](db[_0x47e3('0xdd')][_0x47e3('0xc9')]);_0x3d492d[_0x47e3('0x40')]=_[_0x47e3('0xc7')](_0x1e82a2['query']);_0x3d492d[_0x47e3('0xca')]=_[_0x47e3('0xcb')](_0x3d492d['model'],_0x3d492d[_0x47e3('0x40')]);_0x1132ab[_0x47e3('0x45')]=_['intersection'](_0x3d492d['model'],qs[_0x47e3('0xcc')](_0x1e82a2[_0x47e3('0x40')][_0x47e3('0xcc')]));_0x1132ab[_0x47e3('0x45')]=_0x1132ab[_0x47e3('0x45')][_0x47e3('0x4a')]?_0x1132ab[_0x47e3('0x45')]:_0x3d492d[_0x47e3('0xc6')];_0x1132ab['order']=qs['sort'](_0x1e82a2[_0x47e3('0x40')]['sort']);_0x1132ab[_0x47e3('0x3f')]=qs[_0x47e3('0xca')](_['pick'](_0x1e82a2[_0x47e3('0x40')],_0x3d492d[_0x47e3('0xca')]));if(_0x1e82a2['query'][_0x47e3('0x39')]){_0x1132ab[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0x1132ab[_0x47e3('0x3f')],{'$or':_[_0x47e3('0x2e')](_0x1132ab[_0x47e3('0x45')],function(_0x2af205){var _0x1eacfe={};_0x1eacfe[_0x2af205]={'$like':'%'+_0x1e82a2[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0x1eacfe;})});}_0x1132ab=_[_0x47e3('0x54')]({},_0x1132ab,_0x1e82a2[_0x47e3('0x55')]);return _0x177507['getOpenchannelInteractions'](_0x1132ab);}})[_0x47e3('0x21')](function(_0x5f4be8){if(_0x5f4be8){_0x5aaaed=_0x5f4be8[_0x47e3('0x4a')];if(!_0x1e82a2[_0x47e3('0x40')][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0x1132ab['limit']=qs[_0x47e3('0x1b')](_0x1e82a2[_0x47e3('0x40')][_0x47e3('0x1b')]);_0x1132ab['offset']=qs[_0x47e3('0x1a')](_0x1e82a2[_0x47e3('0x40')][_0x47e3('0x1a')]);}return _0x177507[_0x47e3('0xdc')](_0x1132ab);}})[_0x47e3('0x21')](function(_0x4df74f){if(_0x4df74f){return _0x4df74f?{'count':_0x5aaaed,'rows':_0x4df74f}:null;}})[_0x47e3('0x21')](respondWithResult(_0x3abe1d,null))[_0x47e3('0x51')](handleError(_0x3abe1d,null));};exports['getMailInteractions']=function(_0x1532d2,_0x38411b){var _0x486594={'raw':!![],'where':{}};var _0x418924={};var _0x23920c={'count':0x0,'rows':[]};return db[_0x47e3('0x36')]['findOne']({'where':{'id':_0x1532d2[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x38411b,null))[_0x47e3('0x21')](function(_0x4ab17e){if(_0x4ab17e){_0x418924[_0x47e3('0xc6')]=_[_0x47e3('0xc7')](db[_0x47e3('0xde')]['rawAttributes']);_0x418924[_0x47e3('0x40')]=_[_0x47e3('0xc7')](_0x1532d2[_0x47e3('0x40')]);_0x418924[_0x47e3('0xca')]=_[_0x47e3('0xcb')](_0x418924[_0x47e3('0xc6')],_0x418924[_0x47e3('0x40')]);_0x486594[_0x47e3('0x45')]=_['intersection'](_0x418924[_0x47e3('0xc6')],qs[_0x47e3('0xcc')](_0x1532d2[_0x47e3('0x40')][_0x47e3('0xcc')]));_0x486594[_0x47e3('0x45')]=_0x486594[_0x47e3('0x45')][_0x47e3('0x4a')]?_0x486594[_0x47e3('0x45')]:_0x418924[_0x47e3('0xc6')];if(!_0x1532d2[_0x47e3('0x40')][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0x486594['limit']=qs[_0x47e3('0x1b')](_0x1532d2['query'][_0x47e3('0x1b')]);_0x486594[_0x47e3('0x1a')]=qs[_0x47e3('0x1a')](_0x1532d2[_0x47e3('0x40')]['offset']);}_0x486594[_0x47e3('0xcd')]=qs[_0x47e3('0xce')](_0x1532d2[_0x47e3('0x40')][_0x47e3('0xce')]);_0x486594[_0x47e3('0x3f')]=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0x1532d2[_0x47e3('0x40')],_0x418924[_0x47e3('0xca')]));_0x486594[_0x47e3('0x3f')][_0x47e3('0xda')]=_0x4ab17e['id'];if(_0x1532d2[_0x47e3('0x40')][_0x47e3('0x39')]){_0x486594[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0x486594[_0x47e3('0x3f')],{'$or':_[_0x47e3('0x2e')](_0x486594[_0x47e3('0x45')],function(_0x30a010){var _0x23c372={};_0x23c372[_0x30a010]={'$like':'%'+_0x1532d2[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0x23c372;})});}_0x486594=_[_0x47e3('0x54')]({},_0x486594,_0x1532d2[_0x47e3('0x55')]);return db[_0x47e3('0xde')][_0x47e3('0x1d')]({'where':_0x486594[_0x47e3('0x3f')]})[_0x47e3('0x21')](function(_0x436da0){_0x23920c[_0x47e3('0x1d')]=_0x436da0;if(_0x1532d2[_0x47e3('0x40')][_0x47e3('0x41')]){_0x486594[_0x47e3('0x42')]=[{'all':!![]}];}return db[_0x47e3('0xde')][_0x47e3('0x47')](_0x486594);})['then'](function(_0x16b503){_0x23920c[_0x47e3('0x48')]=_0x16b503;return _0x23920c;});}})[_0x47e3('0x21')](respondWithFilteredResult(_0x38411b,_0x486594))[_0x47e3('0x51')](handleError(_0x38411b,null));};exports[_0x47e3('0xdf')]=function(_0x2541a6,_0x4212f4){var _0x39661d={};var _0x55e90b={};var _0x1e2479;var _0x369dee;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x2541a6[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x4212f4,null))[_0x47e3('0x21')](function(_0x283f96){if(_0x283f96){_0x1e2479=_0x283f96;_0x55e90b[_0x47e3('0xc6')]=_[_0x47e3('0xc7')](db[_0x47e3('0xe0')][_0x47e3('0xc9')]);_0x55e90b[_0x47e3('0x40')]=_['keys'](_0x2541a6[_0x47e3('0x40')]);_0x55e90b[_0x47e3('0xca')]=_[_0x47e3('0xcb')](_0x55e90b[_0x47e3('0xc6')],_0x55e90b[_0x47e3('0x40')]);_0x39661d[_0x47e3('0x45')]=_[_0x47e3('0xcb')](_0x55e90b[_0x47e3('0xc6')],qs['fields'](_0x2541a6[_0x47e3('0x40')]['fields']));_0x39661d['attributes']=_0x39661d[_0x47e3('0x45')][_0x47e3('0x4a')]?_0x39661d[_0x47e3('0x45')]:_0x55e90b[_0x47e3('0xc6')];_0x39661d[_0x47e3('0xcd')]=qs[_0x47e3('0xce')](_0x2541a6[_0x47e3('0x40')][_0x47e3('0xce')]);_0x39661d['where']=qs[_0x47e3('0xca')](_['pick'](_0x2541a6[_0x47e3('0x40')],_0x55e90b[_0x47e3('0xca')]));if(_0x2541a6[_0x47e3('0x40')][_0x47e3('0x39')]){_0x39661d[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0x39661d[_0x47e3('0x3f')],{'$or':_['map'](_0x39661d[_0x47e3('0x45')],function(_0xb79b71){var _0x3f00b9={};_0x3f00b9[_0xb79b71]={'$like':'%'+_0x2541a6[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0x3f00b9;})});}_0x39661d=_[_0x47e3('0x54')]({},_0x39661d,_0x2541a6['options']);return _0x1e2479[_0x47e3('0xdf')](_0x39661d);}})[_0x47e3('0x21')](function(_0x36d0a2){if(_0x36d0a2){_0x369dee=_0x36d0a2['length'];if(!_0x2541a6['query'][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0x39661d[_0x47e3('0x1b')]=qs['limit'](_0x2541a6[_0x47e3('0x40')][_0x47e3('0x1b')]);_0x39661d[_0x47e3('0x1a')]=qs['offset'](_0x2541a6['query']['offset']);}return _0x1e2479[_0x47e3('0xdf')](_0x39661d);}})[_0x47e3('0x21')](function(_0x10d744){if(_0x10d744){return _0x10d744?{'count':_0x369dee,'rows':_0x10d744}:null;}})[_0x47e3('0x21')](respondWithResult(_0x4212f4,null))[_0x47e3('0x51')](handleError(_0x4212f4,null));};exports['getFaxInteractions']=function(_0x63da64,_0x413a6b){var _0x4e3bc3={};var _0xf9cbb2={};var _0x3744b1;var _0x46d66c;return db['User'][_0x47e3('0x8d')]({'where':{'id':_0x63da64[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x413a6b,null))[_0x47e3('0x21')](function(_0x263565){if(_0x263565){_0x3744b1=_0x263565;_0xf9cbb2[_0x47e3('0xc6')]=_[_0x47e3('0xc7')](db[_0x47e3('0xe1')]['rawAttributes']);_0xf9cbb2[_0x47e3('0x40')]=_['keys'](_0x63da64['query']);_0xf9cbb2[_0x47e3('0xca')]=_[_0x47e3('0xcb')](_0xf9cbb2[_0x47e3('0xc6')],_0xf9cbb2[_0x47e3('0x40')]);_0x4e3bc3[_0x47e3('0x45')]=_[_0x47e3('0xcb')](_0xf9cbb2[_0x47e3('0xc6')],qs['fields'](_0x63da64[_0x47e3('0x40')][_0x47e3('0xcc')]));_0x4e3bc3[_0x47e3('0x45')]=_0x4e3bc3['attributes']['length']?_0x4e3bc3[_0x47e3('0x45')]:_0xf9cbb2['model'];_0x4e3bc3['order']=qs['sort'](_0x63da64[_0x47e3('0x40')][_0x47e3('0xce')]);_0x4e3bc3['where']=qs['filters'](_[_0x47e3('0xcf')](_0x63da64[_0x47e3('0x40')],_0xf9cbb2['filters']));if(_0x63da64[_0x47e3('0x40')][_0x47e3('0x39')]){_0x4e3bc3[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0x4e3bc3[_0x47e3('0x3f')],{'$or':_[_0x47e3('0x2e')](_0x4e3bc3['attributes'],function(_0x4a68c8){var _0x45e5a4={};_0x45e5a4[_0x4a68c8]={'$like':'%'+_0x63da64[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0x45e5a4;})});}_0x4e3bc3=_[_0x47e3('0x54')]({},_0x4e3bc3,_0x63da64[_0x47e3('0x55')]);return _0x3744b1['getFaxInteractions'](_0x4e3bc3);}})['then'](function(_0x24b431){if(_0x24b431){_0x46d66c=_0x24b431[_0x47e3('0x4a')];if(!_0x63da64[_0x47e3('0x40')]['hasOwnProperty'](_0x47e3('0xd2'))){_0x4e3bc3[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0x63da64[_0x47e3('0x40')]['limit']);_0x4e3bc3[_0x47e3('0x1a')]=qs[_0x47e3('0x1a')](_0x63da64[_0x47e3('0x40')]['offset']);}return _0x3744b1[_0x47e3('0xe2')](_0x4e3bc3);}})[_0x47e3('0x21')](function(_0x5cc9e7){if(_0x5cc9e7){return _0x5cc9e7?{'count':_0x46d66c,'rows':_0x5cc9e7}:null;}})[_0x47e3('0x21')](respondWithResult(_0x413a6b,null))[_0x47e3('0x51')](handleError(_0x413a6b,null));};exports[_0x47e3('0xe3')]=function(_0x606e46,_0x3eda7a){var _0x88d98b={};var _0x2cec7d={};var _0x2bc64d;var _0x547f19;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x606e46[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x3eda7a,null))[_0x47e3('0x21')](function(_0x1c01c0){if(_0x1c01c0){_0x2bc64d=_0x1c01c0;_0x2cec7d['model']=_[_0x47e3('0xc7')](db[_0x47e3('0xe4')][_0x47e3('0xc9')]);_0x2cec7d[_0x47e3('0x40')]=_[_0x47e3('0xc7')](_0x606e46[_0x47e3('0x40')]);_0x2cec7d[_0x47e3('0xca')]=_[_0x47e3('0xcb')](_0x2cec7d[_0x47e3('0xc6')],_0x2cec7d[_0x47e3('0x40')]);_0x88d98b['attributes']=_[_0x47e3('0xcb')](_0x2cec7d[_0x47e3('0xc6')],qs[_0x47e3('0xcc')](_0x606e46[_0x47e3('0x40')][_0x47e3('0xcc')]));_0x88d98b[_0x47e3('0x45')]=_0x88d98b[_0x47e3('0x45')]['length']?_0x88d98b['attributes']:_0x2cec7d[_0x47e3('0xc6')];_0x88d98b['order']=qs[_0x47e3('0xce')](_0x606e46[_0x47e3('0x40')][_0x47e3('0xce')]);_0x88d98b[_0x47e3('0x3f')]=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0x606e46['query'],_0x2cec7d['filters']));if(_0x606e46[_0x47e3('0x40')]['filter']){_0x88d98b['where']=_[_0x47e3('0x54')](_0x88d98b[_0x47e3('0x3f')],{'$or':_['map'](_0x88d98b[_0x47e3('0x45')],function(_0x465def){var _0x4b14cf={};_0x4b14cf[_0x465def]={'$like':'%'+_0x606e46['query']['filter']+'%'};return _0x4b14cf;})});}_0x88d98b=_[_0x47e3('0x54')]({},_0x88d98b,_0x606e46[_0x47e3('0x55')]);return _0x2bc64d[_0x47e3('0xe3')](_0x88d98b);}})['then'](function(_0x23e604){if(_0x23e604){_0x547f19=_0x23e604[_0x47e3('0x4a')];if(!_0x606e46[_0x47e3('0x40')]['hasOwnProperty'](_0x47e3('0xd2'))){_0x88d98b[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0x606e46[_0x47e3('0x40')][_0x47e3('0x1b')]);_0x88d98b[_0x47e3('0x1a')]=qs[_0x47e3('0x1a')](_0x606e46['query'][_0x47e3('0x1a')]);}return _0x2bc64d[_0x47e3('0xe3')](_0x88d98b);}})[_0x47e3('0x21')](function(_0xbe6ec2){if(_0xbe6ec2){return _0xbe6ec2?{'count':_0x547f19,'rows':_0xbe6ec2}:null;}})['then'](respondWithResult(_0x3eda7a,null))[_0x47e3('0x51')](handleError(_0x3eda7a,null));};exports[_0x47e3('0xe5')]=function(_0x57b403,_0x901eab,_0x1f5fff){var _0x443bdb;var _0x37a366;var _0x92671f;var _0x4eaa73=!_['isNil'](_0x57b403[_0x47e3('0x53')]['id'])?_0x57b403[_0x47e3('0x53')]['id']:!_[_0x47e3('0x60')](_0x57b403[_0x47e3('0x29')]['id'])?_0x57b403['user']['id']:null;return db[_0x47e3('0x36')][_0x47e3('0x31')]({'where':{'id':_0x4eaa73,'role':{'$or':[_0x47e3('0x27'),_0x47e3('0x29'),'agent']}},'attributes':['id',_0x47e3('0x32'),_0x47e3('0xe6'),_0x47e3('0xe7'),'role','internal',_0x47e3('0x95')]})['then'](function(_0x4540cb){if(_0x4540cb){if(_0x4540cb[_0x47e3('0x22')]===_0x47e3('0x2b')){_0x443bdb=_0x4540cb;if(_0x57b403[_0x47e3('0x58')][_0x47e3('0xa1')]){_0x92671f=util[_0x47e3('0xa2')](_0x47e3('0xe8'),_0x443bdb[_0x57b403[_0x47e3('0x58')][_0x47e3('0xa1')]]);}else if(_0x57b403[_0x47e3('0x58')][_0x47e3('0xe9')]){_0x92671f=util['format']('SIP/%s',_0x57b403[_0x47e3('0x58')][_0x47e3('0xe9')]);}else{_0x92671f=util[_0x47e3('0xa2')](_0x47e3('0xa3'),_0x443bdb[_0x47e3('0x32')]);}socket['to'](util[_0x47e3('0xa2')](_0x47e3('0xea'),_0x443bdb[_0x47e3('0x32')]))[_0x47e3('0x23')](_0x47e3('0xeb'),{'user':{'id':_0x443bdb['id'],'name':_0x443bdb[_0x47e3('0x32')]},'ip':_0x57b403[_0x47e3('0xec')][_0x47e3('0xed')]||_0x57b403[_0x47e3('0xee')][_0x47e3('0xef')]||_0x57b403['socket'][_0x47e3('0xef')]||_0x57b403['connection']['socket'][_0x47e3('0xef')]});return db[_0x47e3('0xa5')][_0x47e3('0x25')]({'where':{'membername':_0x443bdb[_0x47e3('0x32')]},'individualHooks':!![]});}}else{throw new db[(_0x47e3('0x87'))][(_0x47e3('0x88'))](_0x47e3('0xf0'));}})[_0x47e3('0x21')](function(){if(_0x443bdb){return _0x443bdb[_0x47e3('0xf1')]({'raw':!![]});}})['then'](function(_0x28b6a8){if(_0x443bdb){if(_0x28b6a8){_0x37a366=_0x28b6a8;if(_0x37a366['length']){var _0xfdc262=_0x37a366[_0x47e3('0x2e')](function(_0x4028fb){var _0x3e15ec={'membername':_0x443bdb[_0x47e3('0x32')],'UserId':_0x443bdb['id'],'queue_name':_0x4028fb[_0x47e3('0x32')],'VoiceQueueId':_0x4028fb['id'],'interface':_0x92671f,'paused':_0x443bdb[_0x47e3('0x95')]||![],'penalty':_0x4028fb[_0x47e3('0xf2')]||0x0};return db['UserVoiceQueueRt'][_0x47e3('0xa6')](_0x3e15ec);});return Promise['all'](_0xfdc262);}}}})['then'](function(){if(_0x443bdb){return db[_0x47e3('0xf3')][_0x47e3('0x47')]({'where':{'membername':_0x443bdb[_0x47e3('0x32')],'exitAt':null}});}})[_0x47e3('0x21')](function(_0x1e541f){if(_0x443bdb){var _0x2aaa4d=[];_0x1e541f[_0x47e3('0xf4')](function(_0x4f83f7){_0x2aaa4d[_0x47e3('0x46')](_0x4f83f7[_0x47e3('0x20')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x47e3('0x50')](_0x2aaa4d);}})[_0x47e3('0x21')](function(){if(_0x443bdb){var _0x6aec25=[];var _0x5ab9fb=[];var _0x4ea974=utils[_0x47e3('0xf5')]();var _0x240cfe={'membername':_0x443bdb['name'],'interface':_0x92671f,'enterAt':moment()[_0x47e3('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x443bdb[_0x47e3('0x22')],'internal':_0x443bdb[_0x47e3('0x5c')]};_0x4ea974['forEach'](function(_0x49da50){_0x6aec25[_0x47e3('0x46')](_[_0x47e3('0x54')]({'channel':_0x49da50,'type':'LOGIN','data1':_0x57b403[_0x47e3('0x58')]['device'],'data2':_0x92671f},_0x240cfe));if(_0x443bdb[_0x47e3('0x95')]){_0x5ab9fb[_0x47e3('0x46')](_[_0x47e3('0x54')]({'channel':_0x49da50,'type':_0x47e3('0xf6'),'data1':_0x47e3('0xf7')},_0x240cfe));}});return db['MemberReport']['bulkCreate'](_0x6aec25['concat'](_0x5ab9fb),{'individualHooks':!![]});}})[_0x47e3('0x21')](function(){if(_0x443bdb){return _0x443bdb[_0x47e3('0x20')]({'online':!![],'lastLoginAt':moment()['format'](_0x47e3('0xf8')),'voicePause':_0x443bdb['loginInPause']||![],'mailPause':_0x443bdb[_0x47e3('0x95')]||![],'chatPause':_0x443bdb[_0x47e3('0x95')]||![],'faxPause':_0x443bdb[_0x47e3('0x95')]||![],'smsPause':_0x443bdb[_0x47e3('0x95')]||![],'openchannelPause':_0x443bdb[_0x47e3('0x95')]||![],'whatsappPause':_0x443bdb['loginInPause']||![],'pauseType':_0x443bdb[_0x47e3('0x95')]?_0x47e3('0xf7'):null,'interface':_0x92671f,'lastPauseAt':moment()[_0x47e3('0xa2')](_0x47e3('0xf8'))});}})['then'](function(_0x310c15){if(_0x57b403['isMiddleware']){return _0x1f5fff();}else{return Promise['resolve'](_0x310c15)[_0x47e3('0x21')](respondWithResult(_0x901eab,null));}})[_0x47e3('0x51')](handleError(_0x901eab,null));};exports['logout']=function(_0x5a9aaa,_0x550a2e){var _0x5635d1;return db['User'][_0x47e3('0x31')]({'where':{'id':_0x5a9aaa[_0x47e3('0x53')]['id'],'role':'agent'},'attributes':['id',_0x47e3('0x32'),_0x47e3('0x22')]})[_0x47e3('0x21')](handleEntityNotFound(_0x550a2e,null))[_0x47e3('0x21')](function(_0x347df7){if(_0x347df7){_0x5635d1=_0x347df7;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x5635d1[_0x47e3('0x32')]},'individualHooks':!![]});}})[_0x47e3('0x21')](function(){return db[_0x47e3('0xf3')][_0x47e3('0x47')]({'where':{'membername':_0x5635d1[_0x47e3('0x32')],'exitAt':null}});})[_0x47e3('0x21')](function(_0x50597a){var _0x161ffe=[];_0x50597a[_0x47e3('0xf4')](function(_0x4676ef){_0x161ffe[_0x47e3('0x46')](_0x4676ef[_0x47e3('0x20')]({'exitAt':moment()[_0x47e3('0xa2')](_0x47e3('0xf8'))}));});return Promise[_0x47e3('0x50')](_0x161ffe);})['then'](function(){return _0x5635d1[_0x47e3('0x20')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x550a2e,null))[_0x47e3('0x51')](handleError(_0x550a2e,null));};exports[_0x47e3('0xf9')]=function(_0x1e0c73,_0x5582cb){var _0x3b3835;return db[_0x47e3('0xa5')][_0x47e3('0x20')]({'paused':0x1},{'where':{'UserId':_0x1e0c73[_0x47e3('0x53')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x47e3('0x36')][_0x47e3('0x31')]({'where':{'id':_0x1e0c73['params']['id'],'role':_0x47e3('0x2b')},'attributes':['id','name',_0x47e3('0x22'),_0x47e3('0x5c'),_0x47e3('0xa1'),_0x47e3('0x94')]});})['then'](handleEntityNotFound(_0x5582cb,null))[_0x47e3('0x21')](function(_0x5d6013){if(_0x5d6013){_0x3b3835=_0x5d6013;return db[_0x47e3('0xf3')][_0x47e3('0x47')]({'where':{'membername':_0x3b3835[_0x47e3('0x32')],'type':_0x47e3('0xf6'),'exitAt':null}});}})[_0x47e3('0x21')](function(_0x3562d9){if(_0x3562d9['length']){var _0xfb660e=moment()[_0x47e3('0xa2')](_0x47e3('0xf8'));for(var _0x4dab5a=0x0,_0x52d19e=_0x3562d9[_0x47e3('0x4a')];_0x4dab5a<_0x52d19e;_0x4dab5a++){_0x3562d9[_0x4dab5a][_0x47e3('0xfa')]({'exitAt':_0xfb660e});}}})[_0x47e3('0x21')](function(){var _0x15f8c2=[];var _0x1e659c=utils['getChannels']();_0x1e659c[_0x47e3('0xf4')](function(_0x4ddf96){_0x15f8c2['push']({'channel':_0x4ddf96,'membername':_0x3b3835['name'],'interface':_[_0x47e3('0x60')](_0x3b3835[_0x47e3('0xa1')])?util[_0x47e3('0xa2')](_0x47e3('0xa3'),_0x3b3835[_0x47e3('0x32')]):_0x3b3835[_0x47e3('0xa1')],'type':_0x47e3('0xf6'),'enterAt':moment()[_0x47e3('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1e0c73[_0x47e3('0x58')]['type']||'DEFAULT\x20PAUSE','role':_0x3b3835[_0x47e3('0x22')],'internal':_0x3b3835[_0x47e3('0x5c')]});});return db[_0x47e3('0xf3')][_0x47e3('0xfb')](_0x15f8c2,{'individualHooks':!![]});})['then'](function(){return _0x3b3835['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1e0c73[_0x47e3('0x58')][_0x47e3('0x37')]||_0x47e3('0xfc'),'lastPauseAt':moment()[_0x47e3('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x5582cb,null))['catch'](handleError(_0x5582cb,null));};exports['unpause']=function(_0xe93707,_0x5c5722){if(_0xe93707['body'][_0x47e3('0x93')]&&!utils[_0x47e3('0x97')](_0xe93707['body'][_0x47e3('0x93')])){throw new APIBadRequestError(util[_0x47e3('0xa2')](_0x47e3('0xfd'),_0xe93707[_0x47e3('0x58')][_0x47e3('0x93')]));}return db[_0x47e3('0x36')][_0x47e3('0x31')]({'where':{'id':_0xe93707[_0x47e3('0x53')]['id']},'attributes':['id',_0x47e3('0x32'),_0x47e3('0x22'),_0x47e3('0x5c'),_0x47e3('0xa1'),_0x47e3('0x94'),_0x47e3('0x96'),_0x47e3('0xfe'),_0x47e3('0xff'),_0x47e3('0x100'),_0x47e3('0x101'),'smsPause',_0x47e3('0x102'),_0x47e3('0x103'),_0x47e3('0x104')]})[_0x47e3('0x21')](function(_0x17c2a2){if(!_0x17c2a2){throw new APINotFoundError(util[_0x47e3('0xa2')](_0x47e3('0xc1'),_0xe93707[_0x47e3('0x53')]['id']));}return _0x17c2a2[_0x47e3('0x105')](_0xe93707[_0x47e3('0x58')]['channel']);})[_0x47e3('0x21')](respondWithResult(_0x5c5722,null))[_0x47e3('0x51')](APIHandleError(_0x5c5722));};exports[_0x47e3('0x106')]=function(_0x5ce188,_0x4e9a67){var _0xec2793={};var _0x17a701={};var _0x22e989;var _0x5666f3;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x5ce188['params']['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x4e9a67,null))[_0x47e3('0x21')](function(_0x2f2460){if(_0x2f2460){_0x22e989=_0x2f2460;_0x17a701['model']=_['keys'](db[_0x47e3('0x107')][_0x47e3('0xc9')]);_0x17a701[_0x47e3('0x40')]=_[_0x47e3('0xc7')](_0x5ce188[_0x47e3('0x40')]);_0x17a701[_0x47e3('0xca')]=_[_0x47e3('0xcb')](_0x17a701[_0x47e3('0xc6')],_0x17a701[_0x47e3('0x40')]);_0xec2793['attributes']=_[_0x47e3('0xcb')](_0x17a701[_0x47e3('0xc6')],qs[_0x47e3('0xcc')](_0x5ce188[_0x47e3('0x40')][_0x47e3('0xcc')]));_0xec2793[_0x47e3('0x45')]=_0xec2793['attributes'][_0x47e3('0x4a')]?_0xec2793[_0x47e3('0x45')]:_0x17a701[_0x47e3('0xc6')];_0xec2793[_0x47e3('0xcd')]=qs['sort'](_0x5ce188[_0x47e3('0x40')][_0x47e3('0xce')]);_0xec2793['where']=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0x5ce188['query'],_0x17a701[_0x47e3('0xca')]));if(_0x5ce188['query']['filter']){_0xec2793[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0xec2793[_0x47e3('0x3f')],{'$or':_[_0x47e3('0x2e')](_0xec2793[_0x47e3('0x45')],function(_0x12f4da){var _0x39b403={};_0x39b403[_0x12f4da]={'$like':'%'+_0x5ce188[_0x47e3('0x40')]['filter']+'%'};return _0x39b403;})});}_0xec2793=_[_0x47e3('0x54')]({},_0xec2793,_0x5ce188[_0x47e3('0x55')]);return _0x22e989[_0x47e3('0x106')](_0xec2793);}})[_0x47e3('0x21')](function(_0x20f380){if(_0x20f380){_0x5666f3=_0x20f380[_0x47e3('0x4a')];if(!_0x5ce188[_0x47e3('0x40')][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0xec2793[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0x5ce188['query'][_0x47e3('0x1b')]);_0xec2793['offset']=qs[_0x47e3('0x1a')](_0x5ce188[_0x47e3('0x40')]['offset']);}return _0x22e989[_0x47e3('0x106')](_0xec2793);}})[_0x47e3('0x21')](function(_0x4be855){if(_0x4be855){return _0x4be855?{'count':_0x5666f3,'rows':_0x4be855}:null;}})['then'](respondWithResult(_0x4e9a67,null))[_0x47e3('0x51')](handleError(_0x4e9a67,null));};exports[_0x47e3('0x108')]=function(_0xc173ce,_0x4bf987){var _0x39646a=_0xc173ce[_0x47e3('0x53')]['id'];var _0x51ba35=_0xc173ce[_0x47e3('0x58')]?_0xc173ce[_0x47e3('0x58')]['ids']:null;var _0x1db87b=[];return Promise['resolve']()['then'](function(){if(!_0x51ba35)throw new APIBadRequestError(_0x47e3('0x109'));})[_0x47e3('0x21')](function(){return db[_0x47e3('0x36')]['findOne']({'where':{'id':_0x39646a}});})[_0x47e3('0x21')](function(_0x218700){if(!_0x218700)throw new APINotFoundError(util[_0x47e3('0xa2')](_0x47e3('0xc1'),_0xc173ce[_0x47e3('0x53')]['id']));return db['sequelize'][_0x47e3('0x10a')](function(_0xfb5766){return _0x218700[_0x47e3('0x108')](_0x51ba35,{'transaction':_0xfb5766})[_0x47e3('0x21')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x51ba35}}});})[_0x47e3('0x21')](function(_0x2168da){var _0x359b98=_[_0x47e3('0x2e')](_0x2168da,function(_0x2f6e1f){return _0x2f6e1f[_0x47e3('0x10b')]();});return Promise[_0x47e3('0x50')](_0x359b98);})[_0x47e3('0x21')](function(_0x33f9b6){_0x1db87b=_[_0x47e3('0x10c')](_0x33f9b6);var _0x4f4056=_['map'](_0x1db87b,function(_0x4b3d5e){return _0x4b3d5e[_0x47e3('0x10d')](_0x218700['id'],{'transaction':_0xfb5766});});return Promise[_0x47e3('0x50')](_0x4f4056);})[_0x47e3('0x21')](function(){if(!_0x218700[_0x47e3('0x94')])return;var _0x3e9349=_[_0x47e3('0x39')](_0x1db87b,function(_0x487d70){return _0x487d70[_0x47e3('0x10e')](_0x47e3('0x93'))==='Voice';});var _0x4a688c=_[_0x47e3('0x2e')](_0x3e9349,function(_0x241013){return db[_0x47e3('0xa5')]['upsert']({'membername':_0x218700['name'],'UserId':_0x218700['id'],'queue_name':_0x241013[_0x47e3('0x32')],'VoiceQueueId':_0x241013['id'],'interface':_['isNil'](_0x218700[_0x47e3('0xa1')])?util['format'](_0x47e3('0xa3'),_0x218700[_0x47e3('0x32')]):_0x218700[_0x47e3('0xa1')],'paused':_0x218700[_0x47e3('0x96')]||![],'penalty':_0x218700[_0x47e3('0xa4')]},{'transaction':_0xfb5766});});return Promise[_0x47e3('0x50')](_0x4a688c);})[_0x47e3('0x21')](function(){return db[_0x47e3('0x10f')][_0x47e3('0x47')]({'where':{'teamId':{'$in':_0x51ba35}}});})['then'](function(_0x2dff62){var _0x14ffb2=_[_0x47e3('0x2e')](_0x2dff62,function(_0x2312af){return db[_0x47e3('0x110')][_0x47e3('0x76')]({'UserId':_0x218700['id'],'VoicePrefixId':_0x2312af['VoicePrefixId']},{'transaction':_0xfb5766});});return Promise[_0x47e3('0x50')](_0x14ffb2);});});})[_0x47e3('0x21')](function(){for(var _0x100752=0x0;_0x100752<_0x1db87b['length'];_0x100752++){var _0x50e5e6=_0x1db87b[_0x100752][_0x47e3('0x10e')]('channel');var _0x598536=_0x50e5e6+_0x47e3('0x9d');socket['emit'](_0x47e3('0x29')+_0x50e5e6+'Queue:save',{'UserId':_0x39646a,['queueField']:_0x1db87b[_0x100752]['id']});}})[_0x47e3('0x21')](respondWithStatusCode(_0x4bf987,null))['catch'](APIHandleError(_0x4bf987));};exports[_0x47e3('0x111')]=function(_0x56c657,_0x433bf3){var _0x23c59e=_0x56c657[_0x47e3('0x53')]['id'];var _0x3b9e2a=null;if(_0x56c657['query'][_0x47e3('0x5b')]){_0x3b9e2a=_['isArray'](_0x56c657['query'][_0x47e3('0x5b')])?_0x56c657['query']['ids']:[_0x56c657[_0x47e3('0x40')]['ids']];}var _0x34ccb6=[];return Promise[_0x47e3('0x112')]()[_0x47e3('0x21')](function(){if(!_0x3b9e2a)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x47e3('0x21')](function(){return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x23c59e}});})[_0x47e3('0x21')](function(_0xe1ab7f){if(!_0xe1ab7f)throw new APINotFoundError(util[_0x47e3('0xa2')](_0x47e3('0xc1'),_0x56c657[_0x47e3('0x53')]['id']));return db[_0x47e3('0x62')][_0x47e3('0x10a')](function(_0x3b4ad0){return _0xe1ab7f[_0x47e3('0x111')](_0x3b9e2a,{'transaction':_0x3b4ad0})[_0x47e3('0x21')](function(){return db['Team'][_0x47e3('0x47')]({'where':{'id':{'$in':_0x3b9e2a}}});})[_0x47e3('0x21')](function(_0x5b9b19){var _0x2f1b68=_['map'](_0x5b9b19,function(_0x1f779b){return _0x1f779b[_0x47e3('0x10b')]();});return Promise['all'](_0x2f1b68);})[_0x47e3('0x21')](function(_0x314052){_0x34ccb6=_['flattenDeep'](_0x314052);var _0x54c866=_[_0x47e3('0x2e')](_0x34ccb6,function(_0x21b259){return _0x21b259['removeAgent'](_0xe1ab7f['id'],{'transaction':_0x3b4ad0});});return Promise[_0x47e3('0x50')](_0x54c866);})[_0x47e3('0x21')](function(){if(!_0xe1ab7f['online'])return;var _0x2061ac=_[_0x47e3('0x39')](_0x34ccb6,function(_0x52b7cc){return _0x52b7cc[_0x47e3('0x10e')](_0x47e3('0x93'))===_0x47e3('0x113');});var _0x44ee6c=_['map'](_0x2061ac,function(_0x5342c3){return db['UserVoiceQueueRt'][_0x47e3('0x25')]({'where':{'VoiceQueueId':_0x5342c3['id'],'UserId':_0xe1ab7f['id']},'transaction':_0x3b4ad0});});return Promise[_0x47e3('0x50')](_0x44ee6c);})[_0x47e3('0x21')](function(){return db[_0x47e3('0x10f')][_0x47e3('0x47')]({'where':{'teamId':{'$in':_0x3b9e2a}}});})[_0x47e3('0x21')](function(_0x2d1fbf){var _0x27a870=_[_0x47e3('0x2e')](_0x2d1fbf,function(_0x5c019a){return db[_0x47e3('0x110')]['destroy']({'where':{'UserId':_0xe1ab7f['id'],'VoicePrefixId':_0x5c019a[_0x47e3('0x114')]}},{'transaction':_0x3b4ad0});});return Promise['all'](_0x27a870);});});})[_0x47e3('0x21')](function(){for(var _0x37ea99=0x0;_0x37ea99<_0x34ccb6[_0x47e3('0x4a')];_0x37ea99++){var _0x345ee8=_0x34ccb6[_0x37ea99][_0x47e3('0x10e')](_0x47e3('0x93'));var _0x2cfcf9=_0x345ee8+_0x47e3('0x9d');socket[_0x47e3('0x23')]('user'+_0x345ee8+_0x47e3('0xaa'),{'UserId':_0x23c59e,['queueField']:_0x34ccb6[_0x37ea99]['id']});}})[_0x47e3('0x21')](respondWithStatusCode(_0x433bf3,null))['catch'](APIHandleError(_0x433bf3));};exports['getLists']=function(_0x4d4226,_0x298757){var _0xd7da96={};var _0x33e47e={};var _0x5b7d17;var _0x1f9024;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x4d4226[_0x47e3('0x53')]['id']}})['then'](handleEntityNotFound(_0x298757,null))[_0x47e3('0x21')](function(_0x341af7){if(_0x341af7){_0x5b7d17=_0x341af7;_0x33e47e[_0x47e3('0xc6')]=_[_0x47e3('0xc7')](db[_0x47e3('0xc2')]['rawAttributes']);_0x33e47e[_0x47e3('0x40')]=_[_0x47e3('0xc7')](_0x4d4226[_0x47e3('0x40')]);_0x33e47e[_0x47e3('0xca')]=_['intersection'](_0x33e47e[_0x47e3('0xc6')],_0x33e47e[_0x47e3('0x40')]);_0xd7da96[_0x47e3('0x45')]=_['intersection'](_0x33e47e['model'],qs[_0x47e3('0xcc')](_0x4d4226[_0x47e3('0x40')]['fields']));_0xd7da96[_0x47e3('0x45')]=_0xd7da96[_0x47e3('0x45')]['length']?_0xd7da96[_0x47e3('0x45')]:_0x33e47e['model'];_0xd7da96['order']=qs[_0x47e3('0xce')](_0x4d4226[_0x47e3('0x40')][_0x47e3('0xce')]);_0xd7da96[_0x47e3('0x3f')]=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0x4d4226[_0x47e3('0x40')],_0x33e47e[_0x47e3('0xca')]));if(_0x4d4226[_0x47e3('0x40')][_0x47e3('0x39')]){_0xd7da96[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0xd7da96[_0x47e3('0x3f')],{'$or':_[_0x47e3('0x2e')](_0xd7da96[_0x47e3('0x45')],function(_0x5f735f){var _0x23de55={};_0x23de55[_0x5f735f]={'$like':'%'+_0x4d4226[_0x47e3('0x40')]['filter']+'%'};return _0x23de55;})});}_0xd7da96=_[_0x47e3('0x54')]({},_0xd7da96,_0x4d4226[_0x47e3('0x55')]);return _0x5b7d17[_0x47e3('0x115')](_0xd7da96);}})['then'](function(_0x169180){if(_0x169180){_0x1f9024=_0x169180[_0x47e3('0x4a')];if(!_0x4d4226[_0x47e3('0x40')][_0x47e3('0xd1')](_0x47e3('0xd2'))){_0xd7da96[_0x47e3('0x1b')]=qs[_0x47e3('0x1b')](_0x4d4226[_0x47e3('0x40')][_0x47e3('0x1b')]);_0xd7da96['offset']=qs[_0x47e3('0x1a')](_0x4d4226[_0x47e3('0x40')][_0x47e3('0x1a')]);}return _0x5b7d17[_0x47e3('0x115')](_0xd7da96);}})[_0x47e3('0x21')](function(_0x181405){if(_0x181405){return _0x181405?{'count':_0x1f9024,'rows':_0x181405}:null;}})[_0x47e3('0x21')](respondWithResult(_0x298757,null))[_0x47e3('0x51')](handleError(_0x298757,null));};exports[_0x47e3('0x116')]=function(_0x1ffd3e,_0x2d3fe2){var _0x48aded={};var _0x174ac7={};var _0x3272f8;return db[_0x47e3('0x36')][_0x47e3('0x8d')]({'where':{'id':_0x1ffd3e[_0x47e3('0x53')]['id']}})[_0x47e3('0x21')](handleEntityNotFound(_0x2d3fe2,null))[_0x47e3('0x21')](function(_0x1e5c47){if(_0x1e5c47){_0x3272f8=_0x1e5c47;_0x174ac7[_0x47e3('0xc6')]=_['keys'](db[_0x47e3('0x36')][_0x47e3('0xc9')]);_0x174ac7[_0x47e3('0x40')]=_[_0x47e3('0xc7')](_0x1ffd3e[_0x47e3('0x40')]);_0x174ac7['filters']=_[_0x47e3('0xcb')](_0x174ac7[_0x47e3('0xc6')],_0x174ac7[_0x47e3('0x40')]);_0x48aded['attributes']=_[_0x47e3('0xcb')](_0x174ac7[_0x47e3('0xc6')],qs[_0x47e3('0xcc')](_0x1ffd3e['query'][_0x47e3('0xcc')]));_0x48aded[_0x47e3('0x45')]=_0x48aded[_0x47e3('0x45')][_0x47e3('0x4a')]?_0x48aded[_0x47e3('0x45')]:_0x174ac7[_0x47e3('0xc6')];_0x48aded[_0x47e3('0xcd')]=qs[_0x47e3('0xce')](_0x1ffd3e[_0x47e3('0x40')]['sort']);_0x48aded[_0x47e3('0x3f')]=qs[_0x47e3('0xca')](_[_0x47e3('0xcf')](_0x1ffd3e[_0x47e3('0x40')],_0x174ac7[_0x47e3('0xca')]));if(_0x1ffd3e[_0x47e3('0x40')][_0x47e3('0x39')]){_0x48aded[_0x47e3('0x3f')]=_[_0x47e3('0x54')](_0x48aded[_0x47e3('0x3f')],{'$or':_[_0x47e3('0x2e')](_0x48aded[_0x47e3('0x45')],function(_0x26f0c1){var _0x39a8cb={};_0x39a8cb[_0x26f0c1]={'$like':'%'+_0x1ffd3e[_0x47e3('0x40')][_0x47e3('0x39')]+'%'};return _0x39a8cb;})});}_0x48aded['model']=db[_0x47e3('0x36')];_0x48aded['as']=_0x47e3('0x2a');_0x48aded=_[_0x47e3('0x54')]({},_0x48aded,_0x1ffd3e[_0x47e3('0x55')]);return _0x3272f8[_0x47e3('0xf1')]({'include':[_0x48aded]});}})['then'](function(_0x5edb7c){if(_0x5edb7c){var _0x4596a0={},_0x4363de=[];for(var _0x37adf5=0x0;_0x37adf5<_0x5edb7c[_0x47e3('0x4a')];_0x37adf5+=0x1){for(var _0x40f2d1=0x0,_0x3b017d;_0x40f2d1<_0x5edb7c[_0x37adf5]['Agents'][_0x47e3('0x4a')];_0x40f2d1+=0x1){_0x3b017d=_0x5edb7c[_0x37adf5][_0x47e3('0x2a')][_0x40f2d1]['get']({'plain':!![]});_0x4596a0[_0x3b017d['id']]=_0x3b017d;}}_0x4596a0=_['values'](_0x4596a0);for(var _0x502499=qs[_0x47e3('0x1a')](_0x1ffd3e[_0x47e3('0x40')][_0x47e3('0x1a')]);_0x502499<_0x4596a0[_0x47e3('0x4a')]&&_0x4363de[_0x47e3('0x4a')]=_0x596179['agents']){throw new Error(_0x0358('0x55'));}})['then'](function(){if(_0xa80e2f){return db[_0x0358('0x49')][_0x0358('0x4a')]({'where':{'membername':_0xa80e2f['name']},'individualHooks':!![]});}})[_0x0358('0x16')](function(){if(_0xa80e2f){return _0xa80e2f[_0x0358('0x56')]({'raw':!![]});}})[_0x0358('0x16')](function(_0x147585){if(_0xa80e2f){if(_0x147585){var _0x32b88d=[];_0x2754c8=_0x147585;if(_0x2754c8[_0x0358('0x29')]){for(var _0x5d2e7f=0x0;_0x5d2e7f<_0x2754c8[_0x0358('0x29')];_0x5d2e7f++){_0x32b88d[_0x0358('0x2f')](db[_0x0358('0x49')][_0x0358('0x57')]({'membername':_0xa80e2f[_0x0358('0x21')],'UserId':_0xa80e2f['id'],'queue_name':_0x2754c8[_0x5d2e7f]['name'],'VoiceQueueId':_0x2754c8[_0x5d2e7f]['id'],'interface':_0x15bbda,'paused':_0xa80e2f['loginInPause']||![],'penalty':_0x2754c8[_0x5d2e7f][_0x0358('0x58')]||0x0}));}return BPromise[_0x0358('0x4b')](_0x32b88d);}}}})['then'](function(){if(_0xa80e2f){return db[_0x0358('0x33')]['findAll']({'where':{'membername':_0xa80e2f[_0x0358('0x21')],'exitAt':null}});}})['then'](function(_0x5523a0){if(_0xa80e2f){if(_0x5523a0&&_0x5523a0[_0x0358('0x29')]){var _0x52997e=[];_0x5523a0[_0x0358('0x2e')](function(_0xe54784){_0x52997e[_0x0358('0x2f')](_0xe54784[_0x0358('0x26')]({'exitAt':moment()[_0x0358('0x2a')](_0x0358('0x2b'))}));});return BPromise['all'](_0x52997e);}}})['then'](function(){if(_0xa80e2f){var _0x4ead8c=[];var _0x387987=[];var _0x1f1a0a=utils[_0x0358('0x2d')]();var _0x3febdf={'membername':_0xa80e2f[_0x0358('0x21')],'interface':_0x15bbda,'enterAt':moment()[_0x0358('0x2a')](_0x0358('0x2b')),'role':_0xa80e2f[_0x0358('0x22')],'internal':_0xa80e2f[_0x0358('0x23')]};_0x1f1a0a[_0x0358('0x2e')](function(_0x41546e){_0x4ead8c[_0x0358('0x2f')](_[_0x0358('0x59')]({'channel':_0x41546e,'type':_0x0358('0x5a'),'data1':'callysquare','data2':_0x15bbda},_0x3febdf));if(_0xa80e2f[_0x0358('0x4f')]){_0x387987['push'](_[_0x0358('0x59')]({'channel':_0x41546e,'type':_0x0358('0x28'),'data1':_0x0358('0x5b')},_0x3febdf));}});return db['MemberReport'][_0x0358('0x34')](_0x4ead8c[_0x0358('0x5c')](_0x387987),{'individualHooks':!![]});}})['then'](function(){if(_0xa80e2f){return _0xa80e2f['update']({'online':!![],'lastLoginAt':moment()[_0x0358('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xa80e2f[_0x0358('0x4f')]||![],'mailPause':_0xa80e2f[_0x0358('0x4f')]||![],'chatPause':_0xa80e2f[_0x0358('0x4f')]||![],'faxPause':_0xa80e2f['loginInPause']||![],'smsPause':_0xa80e2f[_0x0358('0x4f')]||![],'openchannelPause':_0xa80e2f[_0x0358('0x4f')]||![],'pauseType':_0xa80e2f[_0x0358('0x4f')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x0358('0x2b')),'interface':_0x15bbda});}})[_0x0358('0x16')](function(_0x3dbbb0){_0x32f5c4(_0x3dbbb0);})['catch'](function(_0x56818c){_0x53f8c6(_0x1c148a[_0x0358('0x1a')](0x1f4,_0x56818c['message']));});});}; \ No newline at end of file +var _0x01c5=['map','attributes','model','then','info','stringify','catch','error','message','ShowUser','find','raw','debug','PauseUser','where','name','role','interface','format','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','MemberReport','PAUSE','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','forEach','push','isNil','SIP/%s','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','User','findOne','online','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','params','unpause','system','LogoutUser','LoginUser','phone','internal','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','loginInPause','all','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','bluebird','ioredis','redis','defaults','localhost','./user.socket','GetUser','findAll','options','include'];(function(_0x26eed3,_0x239482){var _0x109a1c=function(_0x4151e4){while(--_0x4151e4){_0x26eed3['push'](_0x26eed3['shift']());}};_0x109a1c(++_0x239482);}(_0x01c5,0x1ec));var _0x501c=function(_0x1b1389,_0x213f8d){_0x1b1389=_0x1b1389-0x0;var _0x4f5e73=_0x01c5[_0x1b1389];return _0x4f5e73;};'use strict';var _=require(_0x501c('0x0'));var util=require(_0x501c('0x1'));var moment=require('moment');var BPromise=require(_0x501c('0x2'));var Redis=require(_0x501c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');config[_0x501c('0x4')]=_[_0x501c('0x5')](config[_0x501c('0x4')],{'host':_0x501c('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x501c('0x7'))['register'](socket);exports[_0x501c('0x8')]=function(_0x557841){var _0x492376=this;return new Promise(function(_0x19aa71,_0x27b063){return db['User'][_0x501c('0x9')]({'raw':_0x557841[_0x501c('0xa')]?_0x557841[_0x501c('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x557841['options']?_0x557841[_0x501c('0xa')]['where']||null:null,'attributes':_0x557841['options']?_0x557841[_0x501c('0xa')]['attributes']||null:null,'limit':_0x557841[_0x501c('0xa')]?_0x557841[_0x501c('0xa')]['limit']||null:null,'include':_0x557841['options']?_0x557841[_0x501c('0xa')][_0x501c('0xb')]?_[_0x501c('0xc')](_0x557841[_0x501c('0xa')]['include'],function(_0x58dab1){return{'model':db[_0x58dab1['model']],'as':_0x58dab1['as'],'attributes':_0x58dab1[_0x501c('0xd')],'include':_0x58dab1['include']?_[_0x501c('0xc')](_0x58dab1[_0x501c('0xb')],function(_0x34b667){return{'model':db[_0x34b667[_0x501c('0xe')]],'as':_0x34b667['as'],'attributes':_0x34b667['attributes'],'include':_0x34b667[_0x501c('0xb')]?_[_0x501c('0xc')](_0x34b667['include'],function(_0x2cab80){return{'model':db[_0x2cab80[_0x501c('0xe')]],'as':_0x2cab80['as'],'attributes':_0x2cab80[_0x501c('0xd')]};}):[]};}):[]};}):[]:[]})[_0x501c('0xf')](function(_0x397002){logger[_0x501c('0x10')](_0x501c('0x8'),_0x557841);logger['debug']('GetUser',_0x557841,JSON[_0x501c('0x11')](_0x397002));_0x19aa71(_0x397002);})[_0x501c('0x12')](function(_0x293ddb){logger[_0x501c('0x13')](_0x501c('0x8'),_0x293ddb[_0x501c('0x14')],_0x557841);_0x27b063(_0x492376['error'](0x1f4,_0x293ddb[_0x501c('0x14')]));});});};exports[_0x501c('0x15')]=function(_0xfa3ce){var _0xd5e52f=this;return new Promise(function(_0x5c01cf,_0x8239b0){return db['User'][_0x501c('0x16')]({'raw':_0xfa3ce[_0x501c('0xa')]?_0xfa3ce[_0x501c('0xa')][_0x501c('0x17')]===undefined?!![]:![]:!![],'where':_0xfa3ce[_0x501c('0xa')]?_0xfa3ce[_0x501c('0xa')]['where']||null:null,'attributes':_0xfa3ce[_0x501c('0xa')]?_0xfa3ce[_0x501c('0xa')]['attributes']||null:null,'include':_0xfa3ce[_0x501c('0xa')]?_0xfa3ce[_0x501c('0xa')]['include']?_['map'](_0xfa3ce[_0x501c('0xa')]['include'],function(_0x5c6be4){return{'model':db[_0x5c6be4[_0x501c('0xe')]],'as':_0x5c6be4['as'],'attributes':_0x5c6be4[_0x501c('0xd')],'include':_0x5c6be4['include']?_['map'](_0x5c6be4[_0x501c('0xb')],function(_0x5c17b3){return{'model':db[_0x5c17b3[_0x501c('0xe')]],'as':_0x5c17b3['as'],'attributes':_0x5c17b3['attributes'],'include':_0x5c17b3[_0x501c('0xb')]?_[_0x501c('0xc')](_0x5c17b3[_0x501c('0xb')],function(_0x465b18){return{'model':db[_0x465b18[_0x501c('0xe')]],'as':_0x465b18['as'],'attributes':_0x465b18['attributes']};}):[]};}):[]};}):[]:[]})[_0x501c('0xf')](function(_0x483f9a){logger[_0x501c('0x10')]('ShowUser',_0xfa3ce);logger[_0x501c('0x18')]('ShowUser',_0xfa3ce,JSON['stringify'](_0x483f9a));_0x5c01cf(_0x483f9a);})['catch'](function(_0x91ea1){logger[_0x501c('0x13')]('ShowUser',_0x91ea1['message'],_0xfa3ce);_0x8239b0(_0xd5e52f[_0x501c('0x13')](0x1f4,_0x91ea1[_0x501c('0x14')]));});});};exports[_0x501c('0x19')]=function(_0x3dc5c1){var _0x41edda;return db['User'][_0x501c('0x16')]({'where':_0x3dc5c1[_0x501c('0xa')][_0x501c('0x1a')]||{},'attributes':['id',_0x501c('0x1b'),_0x501c('0x1c'),'internal',_0x501c('0x1d')]})[_0x501c('0xf')](function(_0x58c9cd){if(!_0x58c9cd){throw new Error(util[_0x501c('0x1e')](_0x501c('0x1f'),_0x3dc5c1['params']['id']));}_0x41edda=_0x58c9cd;return db[_0x501c('0x20')][_0x501c('0x21')]({'paused':0x1},{'where':{'UserId':_0x41edda['id']},'individualHooks':!![]});})[_0x501c('0xf')](function(){return db[_0x501c('0x22')][_0x501c('0x9')]({'where':{'membername':_0x41edda[_0x501c('0x1b')],'type':_0x501c('0x23'),'exitAt':null}});})[_0x501c('0xf')](function(_0x355ca6){if(_0x355ca6&&_0x355ca6['length']){var _0x2b663a=moment()[_0x501c('0x1e')](_0x501c('0x24'));for(var _0x4be546=0x0,_0x10fdfb=_0x355ca6[_0x501c('0x25')];_0x4be546<_0x10fdfb;_0x4be546++){_0x355ca6[_0x4be546][_0x501c('0x26')]({'exitAt':_0x2b663a});}}})['then'](function(){var _0x405120=[];var _0x15cd06=utils['getChannels']();_0x15cd06[_0x501c('0x27')](function(_0x3db54a){_0x405120[_0x501c('0x28')]({'channel':_0x3db54a,'membername':_0x41edda[_0x501c('0x1b')],'interface':_[_0x501c('0x29')](_0x41edda[_0x501c('0x1d')])?util[_0x501c('0x1e')](_0x501c('0x2a'),_0x41edda[_0x501c('0x1b')]):_0x41edda['interface'],'type':_0x501c('0x23'),'enterAt':moment()['format'](_0x501c('0x24')),'data1':_0x3dc5c1[_0x501c('0x2b')][_0x501c('0x2c')]||'DEFAULT\x20PAUSE','role':_0x41edda['role'],'internal':_0x41edda['internal'],'uniqueid':_0x3dc5c1[_0x501c('0x2b')][_0x501c('0x2d')]||null});});return db[_0x501c('0x22')][_0x501c('0x2e')](_0x405120,{'individualHooks':!![]});})[_0x501c('0xf')](function(){return _0x41edda['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3dc5c1[_0x501c('0x2b')][_0x501c('0x2c')]||_0x501c('0x2f'),'lastPauseAt':moment()['format'](_0x501c('0x24'))});})[_0x501c('0x12')](function(_0x8e7830){throw _0x8e7830;});};exports[_0x501c('0x30')]=function(_0x47cf79){return Promise['resolve']()[_0x501c('0xf')](function(){if(_0x47cf79[_0x501c('0x2b')][_0x501c('0x31')]&&!utils[_0x501c('0x32')](_0x47cf79[_0x501c('0x2b')]['channel'])){throw new Error(util[_0x501c('0x1e')](_0x501c('0x33'),_0x47cf79[_0x501c('0x2b')][_0x501c('0x31')]));}return db[_0x501c('0x34')][_0x501c('0x35')]({'where':_0x47cf79[_0x501c('0xa')]['where']||{},'attributes':['id','name','role','internal',_0x501c('0x1d'),_0x501c('0x36'),'voicePause','mailPause',_0x501c('0x37'),_0x501c('0x38'),_0x501c('0x39'),_0x501c('0x3a'),_0x501c('0x3b'),'pauseType','lastPauseAt']});})[_0x501c('0xf')](function(_0x4357be){if(!_0x4357be){throw new Error(util[_0x501c('0x1e')](_0x501c('0x1f'),_0x47cf79[_0x501c('0x3c')]['id']));}return _0x4357be[_0x501c('0x3d')](_0x47cf79[_0x501c('0x2b')]['channel'],_0x501c('0x3e'));})[_0x501c('0x12')](function(_0x57c21c){throw _0x57c21c;});};exports[_0x501c('0x3f')]=function(_0x250183){var _0x4affc6=this;return new Promise(function(_0x550529,_0x44757c){var _0x306b22;return db[_0x501c('0x34')][_0x501c('0x35')]({'where':_0x250183[_0x501c('0xa')][_0x501c('0x1a')]||{},'attributes':['id',_0x501c('0x1b')]})['then'](function(_0x2ea83e){if(_0x2ea83e){_0x306b22=_0x2ea83e;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x306b22[_0x501c('0x1b')]},'individualHooks':!![]});}})['then'](function(){if(_0x306b22){return db[_0x501c('0x22')][_0x501c('0x9')]({'where':{'membername':_0x306b22[_0x501c('0x1b')],'exitAt':null}});}})['then'](function(_0x266b99){if(_0x306b22){if(_0x266b99&&_0x266b99[_0x501c('0x25')]){var _0x3c06ff=[];_0x266b99[_0x501c('0x27')](function(_0x53a45a){_0x3c06ff[_0x501c('0x28')](_0x53a45a[_0x501c('0x21')]({'exitAt':moment()[_0x501c('0x1e')](_0x501c('0x24'))}));});return BPromise['all'](_0x3c06ff);}}})[_0x501c('0xf')](function(){if(_0x306b22){return _0x306b22[_0x501c('0x21')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x501c('0xf')](function(_0x20d8fa){_0x550529(_0x20d8fa);})[_0x501c('0x12')](function(_0x22a7f5){_0x44757c(_0x4affc6['error'](0x1f4,_0x22a7f5[_0x501c('0x14')]));});});};exports[_0x501c('0x40')]=function(_0x46e86c){var _0x109ea3=this;return new Promise(function(_0x3db6ff,_0x299e5a){var _0x7367aa;var _0x50c290;var _0xfa165d;var _0x3a4ec9;return db[_0x501c('0x34')][_0x501c('0x35')]({'where':_0x46e86c[_0x501c('0xa')]['where']||{},'attributes':['id',_0x501c('0x1b'),'role','mobile',_0x501c('0x41'),_0x501c('0x42'),'loginInPause','interface']})[_0x501c('0xf')](function(_0x1e9a28){if(_0x1e9a28){_0x7367aa=_0x1e9a28;_0x3a4ec9=_0x46e86c[_0x501c('0x2b')][_0x501c('0x1d')]?_0x46e86c[_0x501c('0x2b')][_0x501c('0x1d')]:util[_0x501c('0x1e')](_0x501c('0x2a'),_0x7367aa[_0x501c('0x1b')]);return db['User'][_0x501c('0x43')]({'where':{'role':_0x501c('0x44'),'online':!![],'id':{'$ne':_0x7367aa['id']}}});}})[_0x501c('0xf')](function(_0x2ad7e3){if(_0x2ad7e3){_0xfa165d=_0x2ad7e3;return require(_0x501c('0x45'))[_0x501c('0x46')]();}})['then'](function(_0x2dbeae){if(_0x2dbeae&&_0x2dbeae[_0x501c('0x47')]&&_0xfa165d>=_0x2dbeae[_0x501c('0x47')]){throw new Error(_0x501c('0x48'));}})[_0x501c('0xf')](function(){if(_0x7367aa){return db[_0x501c('0x20')][_0x501c('0x49')]({'where':{'membername':_0x7367aa[_0x501c('0x1b')]},'individualHooks':!![]});}})['then'](function(){if(_0x7367aa){return _0x7367aa[_0x501c('0x4a')]({'raw':!![]});}})[_0x501c('0xf')](function(_0xd20185){if(_0x7367aa){if(_0xd20185){var _0x247347=[];_0x50c290=_0xd20185;if(_0x50c290[_0x501c('0x25')]){for(var _0x15a1da=0x0;_0x15a1da<_0x50c290[_0x501c('0x25')];_0x15a1da++){_0x247347[_0x501c('0x28')](db[_0x501c('0x20')][_0x501c('0x4b')]({'membername':_0x7367aa[_0x501c('0x1b')],'UserId':_0x7367aa['id'],'queue_name':_0x50c290[_0x15a1da][_0x501c('0x1b')],'VoiceQueueId':_0x50c290[_0x15a1da]['id'],'interface':_0x3a4ec9,'paused':_0x7367aa[_0x501c('0x4c')]||![],'penalty':_0x50c290[_0x15a1da]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x501c('0x4d')](_0x247347);}}}})[_0x501c('0xf')](function(){if(_0x7367aa){return db[_0x501c('0x22')]['findAll']({'where':{'membername':_0x7367aa[_0x501c('0x1b')],'exitAt':null}});}})['then'](function(_0x40bbca){if(_0x7367aa){if(_0x40bbca&&_0x40bbca[_0x501c('0x25')]){var _0x6d8ad5=[];_0x40bbca[_0x501c('0x27')](function(_0x3d2b56){_0x6d8ad5[_0x501c('0x28')](_0x3d2b56['update']({'exitAt':moment()['format'](_0x501c('0x24'))}));});return BPromise[_0x501c('0x4d')](_0x6d8ad5);}}})[_0x501c('0xf')](function(){if(_0x7367aa){var _0x4d6caa=[];var _0x5870a1=[];var _0x5933e2=utils[_0x501c('0x4e')]();var _0x41321a={'membername':_0x7367aa[_0x501c('0x1b')],'interface':_0x3a4ec9,'enterAt':moment()['format'](_0x501c('0x24')),'role':_0x7367aa[_0x501c('0x1c')],'internal':_0x7367aa[_0x501c('0x42')]};_0x5933e2[_0x501c('0x27')](function(_0x4582f7){_0x4d6caa['push'](_[_0x501c('0x4f')]({'channel':_0x4582f7,'type':_0x501c('0x50'),'data1':_0x501c('0x51'),'data2':_0x3a4ec9},_0x41321a));if(_0x7367aa[_0x501c('0x4c')]){_0x5870a1[_0x501c('0x28')](_['merge']({'channel':_0x4582f7,'type':_0x501c('0x23'),'data1':_0x501c('0x52')},_0x41321a));}});return db[_0x501c('0x22')][_0x501c('0x2e')](_0x4d6caa[_0x501c('0x53')](_0x5870a1),{'individualHooks':!![]});}})[_0x501c('0xf')](function(){if(_0x7367aa){return _0x7367aa[_0x501c('0x21')]({'online':!![],'lastLoginAt':moment()[_0x501c('0x1e')](_0x501c('0x24')),'voicePause':_0x7367aa[_0x501c('0x4c')]||![],'mailPause':_0x7367aa[_0x501c('0x4c')]||![],'chatPause':_0x7367aa[_0x501c('0x4c')]||![],'faxPause':_0x7367aa[_0x501c('0x4c')]||![],'smsPause':_0x7367aa[_0x501c('0x4c')]||![],'openchannelPause':_0x7367aa['loginInPause']||![],'pauseType':_0x7367aa[_0x501c('0x4c')]?_0x501c('0x52'):null,'lastPauseAt':moment()[_0x501c('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3a4ec9});}})[_0x501c('0xf')](function(_0x43d2ab){_0x3db6ff(_0x43d2ab);})[_0x501c('0x12')](function(_0x457101){_0x299e5a(_0x109ea3[_0x501c('0x13')](0x1f4,_0x457101[_0x501c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 614901e..50794cf 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 _0x23b1=['length','./user.events','save','remove','update','emit','removeListener','register'];(function(_0x2ed6a6,_0x47fcf4){var _0x12d470=function(_0x258d79){while(--_0x258d79){_0x2ed6a6['push'](_0x2ed6a6['shift']());}};_0x12d470(++_0x47fcf4);}(_0x23b1,0x161));var _0x123b=function(_0xb260b9,_0x1ccb5f){_0xb260b9=_0xb260b9-0x0;var _0x51bec8=_0x23b1[_0xb260b9];return _0x51bec8;};'use strict';var UserEvents=require(_0x123b('0x0'));var events=[_0x123b('0x1'),_0x123b('0x2'),_0x123b('0x3')];function createListener(_0x3742a2,_0x5e9393){return function(_0x5b30f3){_0x5e9393[_0x123b('0x4')](_0x3742a2,_0x5b30f3);};}function removeListener(_0x4de8bd,_0x1d15f6){return function(){UserEvents[_0x123b('0x5')](_0x4de8bd,_0x1d15f6);};}exports[_0x123b('0x6')]=function(_0x4caccd){for(var _0x4b5fc6=0x0,_0x2671e5=events[_0x123b('0x7')];_0x4b5fc6<_0x2671e5;_0x4b5fc6++){var _0x24341c=events[_0x4b5fc6];var _0x10e468=createListener('user:'+_0x24341c,_0x4caccd);UserEvents['on'](_0x24341c,_0x10e468);}}; \ No newline at end of file +var _0x7126=['register','length','user:','remove','update'];(function(_0x26b9cb,_0x12bc4c){var _0x3f44e6=function(_0x1a5a4e){while(--_0x1a5a4e){_0x26b9cb['push'](_0x26b9cb['shift']());}};_0x3f44e6(++_0x12bc4c);}(_0x7126,0x17a));var _0x6712=function(_0x44cf7f,_0x8822a1){_0x44cf7f=_0x44cf7f-0x0;var _0x4e8513=_0x7126[_0x44cf7f];return _0x4e8513;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x6712('0x0'),_0x6712('0x1')];function createListener(_0x2603e5,_0x15a7b8){return function(_0x329d71){_0x15a7b8['emit'](_0x2603e5,_0x329d71);};}function removeListener(_0x37d334,_0x5551f6){return function(){UserEvents['removeListener'](_0x37d334,_0x5551f6);};}exports[_0x6712('0x2')]=function(_0xc53fb6){for(var _0x183dfd=0x0,_0x4d9ffb=events[_0x6712('0x3')];_0x183dfd<_0x4d9ffb;_0x183dfd++){var _0x33f2e5=events[_0x183dfd];var _0xdf59f1=createListener(_0x6712('0x4')+_0x33f2e5,_0xc53fb6);UserEvents['on'](_0x33f2e5,_0xdf59f1);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index f30e707..b2a26cc 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1e1c4e,_0x32fe91){var _0x560a02=function(_0x498413){while(--_0x498413){_0x1e1c4e['push'](_0x1e1c4e['shift']());}};_0x560a02(++_0x32fe91);}(_0x70e0,0x17b));var _0x070e=function(_0x2d63f5,_0x3dc038){_0x2d63f5=_0x2d63f5-0x0;var _0x45a78d=_0x70e0[_0x2d63f5];return _0x45a78d;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3c52c9,_0x410736){var _0x5b5155=function(_0x13df04){while(--_0x13df04){_0x3c52c9['push'](_0x3c52c9['shift']());}};_0x5b5155(++_0x410736);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xcb91[_0x54edc9];return _0x2ae7a9;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 4aeefeb..c7649e3 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 _0x903e=['INTEGER','exports'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x903e,0x195));var _0xe903=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x903e[_0x421cf8];return _0x145c48;};'use strict';var Sequelize=require('sequelize');module[_0xe903('0x0')]={'penalty':{'type':Sequelize[_0xe903('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xde51=['INTEGER','exports'];(function(_0x1a8caa,_0x195483){var _0x9021fe=function(_0x2eef64){while(--_0x2eef64){_0x1a8caa['push'](_0x1a8caa['shift']());}};_0x9021fe(++_0x195483);}(_0xde51,0xb7));var _0x1de5=function(_0x3bc298,_0x583d14){_0x3bc298=_0x3bc298-0x0;var _0x31bf58=_0xde51[_0x3bc298];return _0x31bf58;};'use strict';var Sequelize=require('sequelize');module[_0x1de5('0x0')]={'penalty':{'type':Sequelize[_0x1de5('0x1')],'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 7dde699..8a803d3 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 _0x500d=['rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x25341e,_0x2584dc){var _0x4c12b4=function(_0x52f5d3){while(--_0x52f5d3){_0x25341e['push'](_0x25341e['shift']());}};_0x4c12b4(++_0x2584dc);}(_0x500d,0x13e));var _0xd500=function(_0x1b7171,_0x533d9a){_0x1b7171=_0x1b7171-0x0;var _0x3c3db2=_0x500d[_0x1b7171];return _0x3c3db2;};'use strict';var _=require(_0xd500('0x0'));var util=require(_0xd500('0x1'));var logger=require(_0xd500('0x2'))(_0xd500('0x3'));var moment=require(_0xd500('0x4'));var BPromise=require('bluebird');var rp=require(_0xd500('0x5'));var fs=require('fs');var path=require(_0xd500('0x6'));var rimraf=require(_0xd500('0x7'));var config=require(_0xd500('0x8'));var attributes=require(_0xd500('0x9'));module[_0xd500('0xa')]=function(_0x8a744d,_0x5f16e4){return _0x8a744d['define'](_0xd500('0xb'),attributes,{'tableName':_0xd500('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21a3=['../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1184f7,_0x5a0081){var _0x23209e=function(_0xc9c768){while(--_0xc9c768){_0x1184f7['push'](_0x1184f7['shift']());}};_0x23209e(++_0x5a0081);}(_0x21a3,0x123));var _0x321a=function(_0x2aba0e,_0x1872be){_0x2aba0e=_0x2aba0e-0x0;var _0x3f277e=_0x21a3[_0x2aba0e];return _0x3f277e;};'use strict';var _=require(_0x321a('0x0'));var util=require(_0x321a('0x1'));var logger=require(_0x321a('0x2'))(_0x321a('0x3'));var moment=require('moment');var BPromise=require(_0x321a('0x4'));var rp=require(_0x321a('0x5'));var fs=require('fs');var path=require(_0x321a('0x6'));var rimraf=require(_0x321a('0x7'));var config=require(_0x321a('0x8'));var attributes=require(_0x321a('0x9'));module[_0x321a('0xa')]=function(_0x259068,_0x4d7986){return _0x259068[_0x321a('0xb')]('UserChatQueue',attributes,{'tableName':_0x321a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 845fbde..cd90b31 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 _0xe4de=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4f3a24,_0x12f8de){var _0x240187=function(_0x5ad39a){while(--_0x5ad39a){_0x4f3a24['push'](_0x4f3a24['shift']());}};_0x240187(++_0x12f8de);}(_0xe4de,0x171));var _0xee4d=function(_0xa42665,_0x528bb1){_0xa42665=_0xa42665-0x0;var _0x4ea856=_0xe4de[_0xa42665];return _0x4ea856;};'use strict';var _=require(_0xee4d('0x0'));var util=require('util');var moment=require(_0xee4d('0x1'));var BPromise=require(_0xee4d('0x2'));var rs=require(_0xee4d('0x3'));var fs=require('fs');var Redis=require(_0xee4d('0x4'));var db=require(_0xee4d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xee4d('0x6'))(_0xee4d('0x7'));var config=require(_0xee4d('0x8'));var jayson=require(_0xee4d('0x9'));var client=jayson['client'][_0xee4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cf65e,_0x490e87,_0x1178c9){return new BPromise(function(_0x47fd7f,_0x28159e){return client[_0xee4d('0xb')](_0x3cf65e,_0x1178c9)[_0xee4d('0xc')](function(_0x416c9f){logger[_0xee4d('0xd')](_0xee4d('0xe'),_0x490e87,_0xee4d('0xf'));logger['debug'](_0xee4d('0x10'),_0x490e87,_0xee4d('0xf'),JSON[_0xee4d('0x11')](_0x416c9f));if(_0x416c9f['error']){if(_0x416c9f[_0xee4d('0x12')][_0xee4d('0x13')]===0x1f4){logger[_0xee4d('0x12')](_0xee4d('0xe'),_0x490e87,_0x416c9f[_0xee4d('0x12')][_0xee4d('0x14')]);return _0x28159e(_0x416c9f[_0xee4d('0x12')][_0xee4d('0x14')]);}logger[_0xee4d('0x12')](_0xee4d('0xe'),_0x490e87,_0x416c9f['error']['message']);return _0x47fd7f(_0x416c9f[_0xee4d('0x12')][_0xee4d('0x14')]);}else{logger[_0xee4d('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x490e87,_0xee4d('0xf'));_0x47fd7f(_0x416c9f[_0xee4d('0x15')][_0xee4d('0x14')]);}})[_0xee4d('0x16')](function(_0x53337e){logger[_0xee4d('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x490e87,_0x53337e);_0x28159e(_0x53337e);});});} \ No newline at end of file +var _0x4b78=['jayson/promise','client','http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserChatQueue,\x20%s,\x20%s','message','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x4a0e77,_0x472eca){var _0x156f6a=function(_0x535157){while(--_0x535157){_0x4a0e77['push'](_0x4a0e77['shift']());}};_0x156f6a(++_0x472eca);}(_0x4b78,0x1c3));var _0x84b7=function(_0xfb28e7,_0x14c023){_0xfb28e7=_0xfb28e7-0x0;var _0xb080d8=_0x4b78[_0xfb28e7];return _0xb080d8;};'use strict';var _=require('lodash');var util=require(_0x84b7('0x0'));var moment=require('moment');var BPromise=require(_0x84b7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84b7('0x2'))['db'];var utils=require(_0x84b7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x84b7('0x4'));var jayson=require(_0x84b7('0x5'));var client=jayson[_0x84b7('0x6')][_0x84b7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c532e,_0x522eec,_0x3402e9){return new BPromise(function(_0x4db8f4,_0x58ef81){return client[_0x84b7('0x8')](_0x1c532e,_0x3402e9)[_0x84b7('0x9')](function(_0x34fcce){logger[_0x84b7('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x522eec,_0x84b7('0xb'));logger[_0x84b7('0xc')](_0x84b7('0xd'),_0x522eec,_0x84b7('0xb'),JSON[_0x84b7('0xe')](_0x34fcce));if(_0x34fcce[_0x84b7('0xf')]){if(_0x34fcce[_0x84b7('0xf')]['code']===0x1f4){logger['error'](_0x84b7('0x10'),_0x522eec,_0x34fcce[_0x84b7('0xf')]['message']);return _0x58ef81(_0x34fcce[_0x84b7('0xf')]['message']);}logger[_0x84b7('0xf')](_0x84b7('0x10'),_0x522eec,_0x34fcce[_0x84b7('0xf')]['message']);return _0x4db8f4(_0x34fcce[_0x84b7('0xf')][_0x84b7('0x11')]);}else{logger[_0x84b7('0xa')](_0x84b7('0x10'),_0x522eec,_0x84b7('0xb'));_0x4db8f4(_0x34fcce['result'][_0x84b7('0x11')]);}})[_0x84b7('0x12')](function(_0x50a792){logger[_0x84b7('0xf')](_0x84b7('0x10'),_0x522eec,_0x50a792);_0x58ef81(_0x50a792);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 997e503..13a9e4d 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xe34b68,_0x5c65e3){var _0x167dba=function(_0x1a1572){while(--_0x1a1572){_0xe34b68['push'](_0xe34b68['shift']());}};_0x167dba(++_0x5c65e3);}(_0x70e0,0x17b));var _0x070e=function(_0x31c772,_0x2adbc2){_0x31c772=_0x31c772-0x0;var _0x3c2c14=_0x70e0[_0x31c772];return _0x3c2c14;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5f402e,_0x296f88){var _0x553cd6=function(_0x2add2f){while(--_0x2add2f){_0x5f402e['push'](_0x5f402e['shift']());}};_0x553cd6(++_0x296f88);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0xcb91[_0x5e2152];return _0x5ddcf6;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index fa9dcd2..ad85ec5 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 _0x92d2=['INTEGER'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x92d2,0x11d));var _0x292d=function(_0x219a86,_0x595831){_0x219a86=_0x219a86-0x0;var _0x2be5ad=_0x92d2[_0x219a86];return _0x2be5ad;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x292d('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x292d('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7730=['exports','INTEGER','STRING','sequelize'];(function(_0x48c19b,_0x44f658){var _0x20234f=function(_0x1bcb62){while(--_0x1bcb62){_0x48c19b['push'](_0x48c19b['shift']());}};_0x20234f(++_0x44f658);}(_0x7730,0x11b));var _0x0773=function(_0x9ae685,_0x2c6652){_0x9ae685=_0x9ae685-0x0;var _0x4c492e=_0x7730[_0x9ae685];return _0x4c492e;};'use strict';var Sequelize=require(_0x0773('0x0'));module[_0x0773('0x1')]={'penalty':{'type':Sequelize[_0x0773('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0773('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index d68b36a..a804fa9 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 _0x57be=['../../config/environment','./userFaxQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x58b0cd,_0x2573ec){var _0x2db2af=function(_0x468064){while(--_0x468064){_0x58b0cd['push'](_0x58b0cd['shift']());}};_0x2db2af(++_0x2573ec);}(_0x57be,0x16f));var _0xe57b=function(_0x4c0c15,_0xd0cb77){_0x4c0c15=_0x4c0c15-0x0;var _0x1492e0=_0x57be[_0x4c0c15];return _0x1492e0;};'use strict';var _=require(_0xe57b('0x0'));var util=require(_0xe57b('0x1'));var logger=require(_0xe57b('0x2'))(_0xe57b('0x3'));var moment=require(_0xe57b('0x4'));var BPromise=require('bluebird');var rp=require(_0xe57b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe57b('0x6'));var config=require(_0xe57b('0x7'));var attributes=require(_0xe57b('0x8'));module[_0xe57b('0x9')]=function(_0x28fb08,_0x5a86c9){return _0x28fb08[_0xe57b('0xa')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f82=['moment','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','../../config/logger'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x8f82,0xee));var _0x28f8=function(_0x2dc55e,_0x46b490){_0x2dc55e=_0x2dc55e-0x0;var _0x3893e0=_0x8f82[_0x2dc55e];return _0x3893e0;};'use strict';var _=require(_0x28f8('0x0'));var util=require('util');var logger=require(_0x28f8('0x1'))('api');var moment=require(_0x28f8('0x2'));var BPromise=require('bluebird');var rp=require(_0x28f8('0x3'));var fs=require('fs');var path=require(_0x28f8('0x4'));var rimraf=require('rimraf');var config=require(_0x28f8('0x5'));var attributes=require(_0x28f8('0x6'));module[_0x28f8('0x7')]=function(_0x22314f,_0x5f33fb){return _0x22314f[_0x28f8('0x8')](_0x28f8('0x9'),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 706e547..95cf827 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 _0xad7a=['client','http','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xad7a,0x1d5));var _0xaad7=function(_0xc1db69,_0x2e5643){_0xc1db69=_0xc1db69-0x0;var _0x31a911=_0xad7a[_0xc1db69];return _0x31a911;};'use strict';var _=require(_0xaad7('0x0'));var util=require(_0xaad7('0x1'));var moment=require(_0xaad7('0x2'));var BPromise=require(_0xaad7('0x3'));var rs=require(_0xaad7('0x4'));var fs=require('fs');var Redis=require(_0xaad7('0x5'));var db=require(_0xaad7('0x6'))['db'];var utils=require(_0xaad7('0x7'));var logger=require(_0xaad7('0x8'))(_0xaad7('0x9'));var config=require('../../config/environment');var jayson=require(_0xaad7('0xa'));var client=jayson[_0xaad7('0xb')][_0xaad7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe6c5ea,_0x27ef0a,_0x546ade){return new BPromise(function(_0xaa9986,_0x35542e){return client['request'](_0xe6c5ea,_0x546ade)['then'](function(_0x579c8d){logger['info'](_0xaad7('0xd'),_0x27ef0a,_0xaad7('0xe'));logger[_0xaad7('0xf')](_0xaad7('0x10'),_0x27ef0a,_0xaad7('0xe'),JSON[_0xaad7('0x11')](_0x579c8d));if(_0x579c8d[_0xaad7('0x12')]){if(_0x579c8d['error'][_0xaad7('0x13')]===0x1f4){logger[_0xaad7('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x27ef0a,_0x579c8d[_0xaad7('0x12')][_0xaad7('0x14')]);return _0x35542e(_0x579c8d[_0xaad7('0x12')][_0xaad7('0x14')]);}logger[_0xaad7('0x12')](_0xaad7('0xd'),_0x27ef0a,_0x579c8d['error']['message']);return _0xaa9986(_0x579c8d['error'][_0xaad7('0x14')]);}else{logger[_0xaad7('0x15')](_0xaad7('0xd'),_0x27ef0a,_0xaad7('0xe'));_0xaa9986(_0x579c8d[_0xaad7('0x16')][_0xaad7('0x14')]);}})[_0xaad7('0x17')](function(_0xe227be){logger['error'](_0xaad7('0xd'),_0x27ef0a,_0xe227be);_0x35542e(_0xe227be);});});} \ No newline at end of file +var _0x678f=['then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5aedc7,_0x102a15){var _0x54a4ce=function(_0x260b2f){while(--_0x260b2f){_0x5aedc7['push'](_0x5aedc7['shift']());}};_0x54a4ce(++_0x102a15);}(_0x678f,0x94));var _0xf678=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0x678f[_0x11ba83];return _0x3f3925;};'use strict';var _=require(_0xf678('0x0'));var util=require(_0xf678('0x1'));var moment=require(_0xf678('0x2'));var BPromise=require(_0xf678('0x3'));var rs=require(_0xf678('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf678('0x5'))['db'];var utils=require(_0xf678('0x6'));var logger=require('../../config/logger')(_0xf678('0x7'));var config=require(_0xf678('0x8'));var jayson=require(_0xf678('0x9'));var client=jayson[_0xf678('0xa')][_0xf678('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51728d,_0x2e9264,_0x50d330){return new BPromise(function(_0xa0fd05,_0x4e30ae){return client[_0xf678('0xc')](_0x51728d,_0x50d330)[_0xf678('0xd')](function(_0x31e8a7){logger[_0xf678('0xe')](_0xf678('0xf'),_0x2e9264,'request\x20sent');logger[_0xf678('0x10')](_0xf678('0x11'),_0x2e9264,_0xf678('0x12'),JSON[_0xf678('0x13')](_0x31e8a7));if(_0x31e8a7[_0xf678('0x14')]){if(_0x31e8a7[_0xf678('0x14')][_0xf678('0x15')]===0x1f4){logger[_0xf678('0x14')](_0xf678('0xf'),_0x2e9264,_0x31e8a7[_0xf678('0x14')][_0xf678('0x16')]);return _0x4e30ae(_0x31e8a7[_0xf678('0x14')]['message']);}logger[_0xf678('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x2e9264,_0x31e8a7[_0xf678('0x14')][_0xf678('0x16')]);return _0xa0fd05(_0x31e8a7['error'][_0xf678('0x16')]);}else{logger[_0xf678('0xe')](_0xf678('0xf'),_0x2e9264,_0xf678('0x12'));_0xa0fd05(_0x31e8a7['result']['message']);}})['catch'](function(_0x557639){logger[_0xf678('0x14')](_0xf678('0xf'),_0x2e9264,_0x557639);_0x4e30ae(_0x557639);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 25bb36c..10ee453 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4f4cb0,_0x1afb1b){var _0x5c242d=function(_0x8b60c7){while(--_0x8b60c7){_0x4f4cb0['push'](_0x4f4cb0['shift']());}};_0x5c242d(++_0x1afb1b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x455150,_0x274121){_0x455150=_0x455150-0x0;var _0x12ca9c=_0xcb91[_0x455150];return _0x12ca9c;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index ed6de0b..43894c8 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 _0x1e6a=['exports','INTEGER','sequelize'];(function(_0x3ddb9d,_0x198e83){var _0x910650=function(_0x1e6ed9){while(--_0x1e6ed9){_0x3ddb9d['push'](_0x3ddb9d['shift']());}};_0x910650(++_0x198e83);}(_0x1e6a,0xe9));var _0xa1e6=function(_0x15f71a,_0x4a4d5f){_0x15f71a=_0x15f71a-0x0;var _0x16f0b5=_0x1e6a[_0x15f71a];return _0x16f0b5;};'use strict';var Sequelize=require(_0xa1e6('0x0'));module[_0xa1e6('0x1')]={'penalty':{'type':Sequelize[_0xa1e6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe50b=['INTEGER','sequelize','exports'];(function(_0x4aa4d3,_0x2b1f9c){var _0x22b3f9=function(_0x1a01d3){while(--_0x1a01d3){_0x4aa4d3['push'](_0x4aa4d3['shift']());}};_0x22b3f9(++_0x2b1f9c);}(_0xe50b,0x18d));var _0xbe50=function(_0x11edf7,_0x498d22){_0x11edf7=_0x11edf7-0x0;var _0x48952a=_0xe50b[_0x11edf7];return _0x48952a;};'use strict';var Sequelize=require(_0xbe50('0x0'));module[_0xbe50('0x1')]={'penalty':{'type':Sequelize[_0xbe50('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index d3805eb..dfc12be 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 _0x90b8=['user_has_mail_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x372a6c,_0x4df0ee){var _0x51128f=function(_0x5f2a3f){while(--_0x5f2a3f){_0x372a6c['push'](_0x372a6c['shift']());}};_0x51128f(++_0x4df0ee);}(_0x90b8,0x16d));var _0x890b=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x90b8[_0x211632];return _0x5a1da1;};'use strict';var _=require(_0x890b('0x0'));var util=require(_0x890b('0x1'));var logger=require(_0x890b('0x2'))(_0x890b('0x3'));var moment=require(_0x890b('0x4'));var BPromise=require('bluebird');var rp=require(_0x890b('0x5'));var fs=require('fs');var path=require(_0x890b('0x6'));var rimraf=require(_0x890b('0x7'));var config=require(_0x890b('0x8'));var attributes=require(_0x890b('0x9'));module[_0x890b('0xa')]=function(_0x1512ff,_0x243fd1){return _0x1512ff[_0x890b('0xb')](_0x890b('0xc'),attributes,{'tableName':_0x890b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x17ba=['api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','../../config/logger'];(function(_0x7951d3,_0x555709){var _0x1bf52a=function(_0xd33047){while(--_0xd33047){_0x7951d3['push'](_0x7951d3['shift']());}};_0x1bf52a(++_0x555709);}(_0x17ba,0xb2));var _0xa17b=function(_0x1b76df,_0xf33629){_0x1b76df=_0x1b76df-0x0;var _0x27d9ff=_0x17ba[_0x1b76df];return _0x27d9ff;};'use strict';var _=require(_0xa17b('0x0'));var util=require('util');var logger=require(_0xa17b('0x1'))(_0xa17b('0x2'));var moment=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var rp=require(_0xa17b('0x5'));var fs=require('fs');var path=require(_0xa17b('0x6'));var rimraf=require(_0xa17b('0x7'));var config=require('../../config/environment');var attributes=require(_0xa17b('0x8'));module[_0xa17b('0x9')]=function(_0x17ba8d,_0x42985a){return _0x17ba8d['define'](_0xa17b('0xa'),attributes,{'tableName':_0xa17b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 8f47911..4124c55 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5dac9a,_0x152d56){var _0x3d4eab=function(_0x5bae8f){while(--_0x5bae8f){_0x5dac9a['push'](_0x5dac9a['shift']());}};_0x3d4eab(++_0x152d56);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\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 +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x7217,0x19e));var _0x7721=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7217[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 2980543..f6fbdab 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 _0x00b0=['../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','exports','path','express','Router','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x00b0,0x1d0));var _0x000b=function(_0x35b502,_0x4b7e8a){_0x35b502=_0x35b502-0x0;var _0x36debf=_0x00b0[_0x35b502];return _0x36debf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x000b('0x0'));var timeout=require('connect-timeout');var express=require(_0x000b('0x1'));var router=express[_0x000b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x000b('0x3'));var interaction=require(_0x000b('0x4'));var config=require(_0x000b('0x5'));var controller=require(_0x000b('0x6'));router['post']('/',auth[_0x000b('0x7')](),controller['sendUserNotification']);module[_0x000b('0x8')]=router; \ No newline at end of file +var _0x98d8=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','post','isAuthenticated','exports','multer','util'];(function(_0xca2faf,_0x2cc810){var _0x25f703=function(_0x44763b){while(--_0x44763b){_0xca2faf['push'](_0xca2faf['shift']());}};_0x25f703(++_0x2cc810);}(_0x98d8,0x142));var _0x898d=function(_0x2fc5d4,_0x514199){_0x2fc5d4=_0x2fc5d4-0x0;var _0x3b273c=_0x98d8[_0x2fc5d4];return _0x3b273c;};'use strict';var multer=require(_0x898d('0x0'));var util=require(_0x898d('0x1'));var path=require(_0x898d('0x2'));var timeout=require(_0x898d('0x3'));var express=require(_0x898d('0x4'));var router=express[_0x898d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x898d('0x6'));var interaction=require(_0x898d('0x7'));var config=require(_0x898d('0x8'));var controller=require('./userNotification.controller');router[_0x898d('0x9')]('/',auth[_0x898d('0xa')](),controller['sendUserNotification']);module[_0x898d('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 36c64e1..0c306da 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 _0xfc6b=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x156102,_0x43debe){var _0x12fc76=function(_0x4d49ee){while(--_0x4d49ee){_0x156102['push'](_0x156102['shift']());}};_0x12fc76(++_0x43debe);}(_0xfc6b,0x105));var _0xbfc6=function(_0x17863d,_0x29ac6a){_0x17863d=_0x17863d-0x0;var _0x269c7d=_0xfc6b[_0x17863d];return _0x269c7d;};'use strict';var Sequelize=require(_0xbfc6('0x0'));module['exports']={'body':{'type':Sequelize[_0xbfc6('0x1')]},'senderName':{'type':Sequelize[_0xbfc6('0x2')]},'recipientsId':{'type':Sequelize[_0xbfc6('0x1')]},'recipientsDescription':{'type':Sequelize[_0xbfc6('0x2')]},'beep':{'type':Sequelize[_0xbfc6('0x3')]}}; \ No newline at end of file +var _0x9399=['exports','STRING','BOOLEAN'];(function(_0x57abda,_0x585594){var _0x2e1195=function(_0x16f48c){while(--_0x16f48c){_0x57abda['push'](_0x57abda['shift']());}};_0x2e1195(++_0x585594);}(_0x9399,0x177));var _0x9939=function(_0x37c99c,_0x5a9325){_0x37c99c=_0x37c99c-0x0;var _0x302573=_0x9399[_0x37c99c];return _0x302573;};'use strict';var Sequelize=require('sequelize');module[_0x9939('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x9939('0x1')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x9939('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f8422b9..889da9c 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 _0x22b5=['reject','save','then','destroy','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','openchannelqueue','whatsappqueue','team','some','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','create','forEach','userNotification:send','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','catch','startCase','model','union','ids','includes','queue','all','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply'];(function(_0x476bf4,_0x5e8a43){var _0x2f170b=function(_0x2f0c5e){while(--_0x2f0c5e){_0x476bf4['push'](_0x476bf4['shift']());}};_0x2f170b(++_0x5e8a43);}(_0x22b5,0x1a5));var _0x522b=function(_0x23d160,_0x15e4dc){_0x23d160=_0x23d160-0x0;var _0x5df430=_0x22b5[_0x23d160];return _0x5df430;};'use strict';var emlformat=require(_0x522b('0x0'));var rimraf=require(_0x522b('0x1'));var zipdir=require(_0x522b('0x2'));var jsonpatch=require(_0x522b('0x3'));var rp=require(_0x522b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x522b('0x5'));var util=require('util');var path=require(_0x522b('0x6'));var sox=require(_0x522b('0x7'));var csv=require(_0x522b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x522b('0x9'));var squel=require(_0x522b('0xa'));var crypto=require(_0x522b('0xb'));var jsforce=require(_0x522b('0xc'));var deskjs=require(_0x522b('0xd'));var toCsv=require(_0x522b('0x8'));var querystring=require(_0x522b('0xe'));var Papa=require(_0x522b('0xf'));var Redis=require(_0x522b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x522b('0x11'));var as=require(_0x522b('0x12'));var hardwareService=require(_0x522b('0x13'));var logger=require(_0x522b('0x14'))('api');var utils=require(_0x522b('0x15'));var config=require(_0x522b('0x16'));var licenseUtil=require(_0x522b('0x17'));var db=require(_0x522b('0x18'))['db'];config[_0x522b('0x19')]=_[_0x522b('0x1a')](config[_0x522b('0x19')],{'host':_0x522b('0x1b'),'port':0x18eb});var socket=require(_0x522b('0x1c'))(new Redis(config[_0x522b('0x19')]));require('./userNotification.socket')[_0x522b('0x1d')](socket);function respondWithStatusCode(_0x2fc3cf,_0x3fe8f3){_0x3fe8f3=_0x3fe8f3||0xcc;return function(_0x5ecccb){if(_0x5ecccb){return _0x2fc3cf[_0x522b('0x1e')](_0x3fe8f3);}return _0x2fc3cf[_0x522b('0x1f')](_0x3fe8f3)[_0x522b('0x20')]();};}function respondWithResult(_0x218d23,_0x172503){_0x172503=_0x172503||0xc8;return function(_0x30adc5){if(_0x30adc5){return _0x218d23[_0x522b('0x1f')](_0x172503)[_0x522b('0x21')](_0x30adc5);}};}function respondWithFilteredResult(_0x2ca801,_0x1766a9){return function(_0x573eed){if(_0x573eed){var _0x1230cb=typeof _0x1766a9[_0x522b('0x22')]==='undefined'&&typeof _0x1766a9[_0x522b('0x23')]==='undefined';var _0x396d47=_0x573eed['count'];var _0x21c53b=_0x1230cb?0x0:_0x1766a9['offset'];var _0x5225bc=_0x1230cb?_0x573eed[_0x522b('0x24')]:_0x1766a9[_0x522b('0x22')]+_0x1766a9[_0x522b('0x23')];var _0x71ec3e;if(_0x5225bc>=_0x396d47){_0x5225bc=_0x396d47;_0x71ec3e=0xc8;}else{_0x71ec3e=0xce;}_0x2ca801['status'](_0x71ec3e);return _0x2ca801['set'](_0x522b('0x25'),_0x21c53b+'-'+_0x5225bc+'/'+_0x396d47)[_0x522b('0x21')](_0x573eed);}return null;};}function patchUpdates(_0x3ed520){return function(_0x2d59b3){try{jsonpatch[_0x522b('0x26')](_0x2d59b3,_0x3ed520,!![]);}catch(_0x484b56){return BPromise[_0x522b('0x27')](_0x484b56);}return _0x2d59b3[_0x522b('0x28')]();};}function saveUpdates(_0x55fdd8,_0x18c587){return function(_0x5793ac){if(_0x5793ac){return _0x5793ac['update'](_0x55fdd8)[_0x522b('0x29')](function(_0x4fed08){return _0x4fed08;});}return null;};}function removeEntity(_0x43eb61,_0x57d81b){return function(_0x579456){if(_0x579456){return _0x579456[_0x522b('0x2a')]()[_0x522b('0x29')](function(){_0x43eb61[_0x522b('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e432f,_0x3d55fe){return function(_0x418a16){if(!_0x418a16){_0x4e432f[_0x522b('0x1e')](0x194);}return _0x418a16;};}function handleError(_0x32cef3,_0x1ca362){_0x1ca362=_0x1ca362||0x1f4;return function(_0x14f8e4){logger['error'](_0x14f8e4[_0x522b('0x2b')]);if(_0x14f8e4[_0x522b('0x2c')]){delete _0x14f8e4[_0x522b('0x2c')];}_0x32cef3[_0x522b('0x1f')](_0x1ca362)[_0x522b('0x2d')](_0x14f8e4);};}exports[_0x522b('0x2e')]=function(_0x229736,_0x14cfec,_0x306611){if(!_0x229736[_0x522b('0x2f')][_0x522b('0x30')]('text')&&!_0x229736[_0x522b('0x2f')][_0x522b('0x30')](_0x522b('0x31'))){throw new db[(_0x522b('0x32'))][(_0x522b('0x33'))](_0x522b('0x34'));}else{if(_0x229736[_0x522b('0x2f')][_0x522b('0x30')](_0x522b('0x31'))&&!_0x229736[_0x522b('0x2f')][_0x522b('0x30')](_0x522b('0x35'))){throw new db[(_0x522b('0x32'))][(_0x522b('0x33'))](_0x522b('0x36'));}if(!_0x229736['body'][_0x522b('0x30')](_0x522b('0x37'))){throw new db['Sequelize'][(_0x522b('0x33'))](_0x522b('0x38'));}else{try{var _0x421377=JSON[_0x522b('0x39')](_0x229736[_0x522b('0x2f')][_0x522b('0x37')]);}catch(_0x470be6){logger['error'](_0x470be6);throw new db[(_0x522b('0x32'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x2cfa16=[_0x522b('0x3a'),'faxqueue','mailqueue',_0x522b('0x3b'),'smsqueue','voicequeue',_0x522b('0x3c'),_0x522b('0x3d'),'user'];if(_[_0x522b('0x3e')](_0x421377,function(_0x97b94a){return!_['includes'](_0x2cfa16,_0x97b94a['model'][_0x522b('0x3f')]());})){throw new db[(_0x522b('0x32'))][(_0x522b('0x33'))](_0x522b('0x40'));}}}var _0x55bb79={};_0x55bb79[_0x522b('0x41')]=_0x229736[_0x522b('0x2f')]['hasOwnProperty'](_0x522b('0x41'))?_0x229736[_0x522b('0x2f')][_0x522b('0x41')]:_0x229736[_0x522b('0x42')]['fullname'];_0x55bb79[_0x522b('0x43')]=_[_0x522b('0x44')](_0x229736[_0x522b('0x2f')]['recipientsDescription'])?null:_0x229736[_0x522b('0x2f')][_0x522b('0x43')];_0x55bb79[_0x522b('0x45')]=_0x229736['body'][_0x522b('0x45')]||![];_0x55bb79[_0x522b('0x46')]=_0x229736[_0x522b('0x42')]['id'];return getContent(_0x229736['body'])[_0x522b('0x29')](function(_0x510848){_0x55bb79['body']=_0x510848;return getRecipients(_0x421377);})[_0x522b('0x29')](function(_0x46abe7){_0x55bb79[_0x522b('0x47')]=_[_0x522b('0x48')](_0x46abe7)[_0x522b('0x49')](',');return db[_0x522b('0x4a')]['transaction'](function(_0xc5c812){return db['UserNotification'][_0x522b('0x4b')](_0x55bb79,{'raw':!![],'transaction':_0xc5c812})[_0x522b('0x29')](function(_0x461339){var _0x1e8c02={'sender':_0x55bb79[_0x522b('0x41')],'description':_0x55bb79[_0x522b('0x43')],'content':_0x55bb79[_0x522b('0x2f')],'beep':_0x55bb79[_0x522b('0x45')]};_0x46abe7[_0x522b('0x4c')](function(_0xfde342){_0x1e8c02['recipient']=_0xfde342;socket['emit'](_0x522b('0x4d'),_0x1e8c02);});return _0x461339;});});})[_0x522b('0x29')](respondWithResult(_0x14cfec,0xc9))['catch'](handleError(_0x14cfec,null));};function getContent(_0x2b0985){return new BPromise(function(_0x445654,_0x253641){if(_0x2b0985[_0x522b('0x4e')]){_0x445654(_0x2b0985[_0x522b('0x4e')]);return;}return db['Template'][_0x522b('0x4f')]({'attributes':[_0x522b('0x50')],'where':{'id':_0x2b0985[_0x522b('0x31')]},'raw':!![]})[_0x522b('0x29')](function(_0xe60010){if(!_0xe60010)throw new db[(_0x522b('0x32'))][(_0x522b('0x33'))](_0x522b('0x51'));var _0x11904e=Mustache['render'](_0xe60010[_0x522b('0x50')],_0x2b0985['view']);_0x445654(_0x11904e);})[_0x522b('0x52')](function(_0x22c033){_0x253641(_0x22c033);});});}function getRecipients(_0x180564){return new BPromise(function(_0xc4889,_0xc9aebd){var _0x515367=[];var _0x490d40=[];_0x180564[_0x522b('0x4c')](function(_0x223959){var _0x9cc429=_[_0x522b('0x53')](_0x223959[_0x522b('0x54')][_0x522b('0x3f')]());if(_0x9cc429==='User'){_0x515367=_[_0x522b('0x55')](_0x515367,_0x223959[_0x522b('0x56')]);}else{if(_[_0x522b('0x57')](_0x9cc429,_0x522b('0x58')))_0x9cc429=_0x9cc429['replace'](_0x522b('0x58'),'Queue');_0x223959[_0x522b('0x56')][_0x522b('0x4c')](function(_0x2e5b2d){_0x490d40['push'](getAgents(_0x9cc429,_0x2e5b2d));});}});return BPromise[_0x522b('0x59')](_0x490d40)[_0x522b('0x29')](function(_0x273382){_0x515367=_[_0x522b('0x55')](_0x515367,_['flatten'](_0x273382));_0xc4889(_0x515367);})['catch'](function(_0x99093b){_0xc9aebd(_0x99093b);});});}function getAgents(_0x303ff3,_0xd27290){return new BPromise(function(_0x4a68db,_0x4e1d2a){return db[_0x303ff3]['findOne']({'where':{'id':_0xd27290}})['then'](function(_0x416313){return _0x416313[_0x522b('0x5a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3998cb){var _0xa83a20=_[_0x522b('0x5b')](_0x3998cb,'id');_0x4a68db(_0xa83a20);});})[_0x522b('0x52')](function(_0x5a8c88){_0x4e1d2a(_0x5a8c88);});});} \ No newline at end of file +var _0xcdc8=['mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','error','stack','name','body','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','hasOwnProperty','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','then','recipientsId','sortBy','create','forEach','userNotification:send','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','catch','startCase','User','queue','replace','Queue','push','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xc836ed,_0x187a88){var _0x5b2a81=function(_0x221470){while(--_0x221470){_0xc836ed['push'](_0xc836ed['shift']());}};_0x5b2a81(++_0x187a88);}(_0xcdc8,0x175));var _0x8cdc=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xcdc8[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0x8cdc('0x0'));var rimraf=require(_0x8cdc('0x1'));var zipdir=require(_0x8cdc('0x2'));var jsonpatch=require(_0x8cdc('0x3'));var rp=require(_0x8cdc('0x4'));var moment=require(_0x8cdc('0x5'));var BPromise=require(_0x8cdc('0x6'));var Mustache=require(_0x8cdc('0x7'));var util=require(_0x8cdc('0x8'));var path=require(_0x8cdc('0x9'));var sox=require(_0x8cdc('0xa'));var csv=require('to-csv');var ejs=require(_0x8cdc('0xb'));var fs=require('fs');var fs_extra=require(_0x8cdc('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8cdc('0xd'));var deskjs=require(_0x8cdc('0xe'));var toCsv=require(_0x8cdc('0xf'));var querystring=require(_0x8cdc('0x10'));var Papa=require(_0x8cdc('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8cdc('0x12'));var as=require(_0x8cdc('0x13'));var hardwareService=require(_0x8cdc('0x14'));var logger=require(_0x8cdc('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x8cdc('0x16'));var licenseUtil=require(_0x8cdc('0x17'));var db=require(_0x8cdc('0x18'))['db'];config[_0x8cdc('0x19')]=_[_0x8cdc('0x1a')](config[_0x8cdc('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8cdc('0x1b'))(new Redis(config[_0x8cdc('0x19')]));require(_0x8cdc('0x1c'))[_0x8cdc('0x1d')](socket);function respondWithStatusCode(_0x573bc1,_0x2a9fbf){_0x2a9fbf=_0x2a9fbf||0xcc;return function(_0x546e7c){if(_0x546e7c){return _0x573bc1[_0x8cdc('0x1e')](_0x2a9fbf);}return _0x573bc1[_0x8cdc('0x1f')](_0x2a9fbf)[_0x8cdc('0x20')]();};}function respondWithResult(_0x2caaa4,_0x4623d9){_0x4623d9=_0x4623d9||0xc8;return function(_0x3deb8e){if(_0x3deb8e){return _0x2caaa4[_0x8cdc('0x1f')](_0x4623d9)[_0x8cdc('0x21')](_0x3deb8e);}};}function respondWithFilteredResult(_0x331615,_0x15e846){return function(_0x33947a){if(_0x33947a){var _0x4445a7=typeof _0x15e846['offset']===_0x8cdc('0x22')&&typeof _0x15e846[_0x8cdc('0x23')]===_0x8cdc('0x22');var _0x535f5a=_0x33947a[_0x8cdc('0x24')];var _0x3d9b67=_0x4445a7?0x0:_0x15e846[_0x8cdc('0x25')];var _0x427914=_0x4445a7?_0x33947a[_0x8cdc('0x24')]:_0x15e846['offset']+_0x15e846['limit'];var _0x14fe2c;if(_0x427914>=_0x535f5a){_0x427914=_0x535f5a;_0x14fe2c=0xc8;}else{_0x14fe2c=0xce;}_0x331615[_0x8cdc('0x1f')](_0x14fe2c);return _0x331615[_0x8cdc('0x26')](_0x8cdc('0x27'),_0x3d9b67+'-'+_0x427914+'/'+_0x535f5a)[_0x8cdc('0x21')](_0x33947a);}return null;};}function patchUpdates(_0x32af37){return function(_0x5b8fe1){try{jsonpatch['apply'](_0x5b8fe1,_0x32af37,!![]);}catch(_0x6132a2){return BPromise[_0x8cdc('0x28')](_0x6132a2);}return _0x5b8fe1[_0x8cdc('0x29')]();};}function saveUpdates(_0x153d93,_0x184903){return function(_0x369c19){if(_0x369c19){return _0x369c19[_0x8cdc('0x2a')](_0x153d93)['then'](function(_0x16057d){return _0x16057d;});}return null;};}function removeEntity(_0x44462b,_0x13ddaa){return function(_0x2f3ef6){if(_0x2f3ef6){return _0x2f3ef6['destroy']()['then'](function(){_0x44462b[_0x8cdc('0x1f')](0xcc)[_0x8cdc('0x20')]();});}};}function handleEntityNotFound(_0x440d4c,_0x13ba5e){return function(_0x5e6888){if(!_0x5e6888){_0x440d4c['sendStatus'](0x194);}return _0x5e6888;};}function handleError(_0x161262,_0x2d52b3){_0x2d52b3=_0x2d52b3||0x1f4;return function(_0x1111a1){logger[_0x8cdc('0x2b')](_0x1111a1[_0x8cdc('0x2c')]);if(_0x1111a1[_0x8cdc('0x2d')]){delete _0x1111a1['name'];}_0x161262[_0x8cdc('0x1f')](_0x2d52b3)['send'](_0x1111a1);};}exports['sendUserNotification']=function(_0x4732da,_0x5cd57a,_0xeb2a17){if(!_0x4732da[_0x8cdc('0x2e')]['hasOwnProperty'](_0x8cdc('0x2f'))&&!_0x4732da[_0x8cdc('0x2e')]['hasOwnProperty'](_0x8cdc('0x30'))){throw new db['Sequelize'][(_0x8cdc('0x31'))](_0x8cdc('0x32'));}else{if(_0x4732da['body']['hasOwnProperty'](_0x8cdc('0x30'))&&!_0x4732da[_0x8cdc('0x2e')][_0x8cdc('0x33')](_0x8cdc('0x34'))){throw new db[(_0x8cdc('0x35'))][(_0x8cdc('0x31'))](_0x8cdc('0x36'));}if(!_0x4732da[_0x8cdc('0x2e')][_0x8cdc('0x33')](_0x8cdc('0x37'))){throw new db[(_0x8cdc('0x35'))][(_0x8cdc('0x31'))](_0x8cdc('0x38'));}else{try{var _0x28ea34=JSON[_0x8cdc('0x39')](_0x4732da['body'][_0x8cdc('0x37')]);}catch(_0x4db255){logger[_0x8cdc('0x2b')](_0x4db255);throw new db[(_0x8cdc('0x35'))][(_0x8cdc('0x31'))](_0x8cdc('0x3a'));}var _0x463b6c=[_0x8cdc('0x3b'),_0x8cdc('0x3c'),_0x8cdc('0x3d'),_0x8cdc('0x3e'),_0x8cdc('0x3f'),'voicequeue',_0x8cdc('0x40'),'team',_0x8cdc('0x41')];if(_[_0x8cdc('0x42')](_0x28ea34,function(_0xc2263f){return!_['includes'](_0x463b6c,_0xc2263f[_0x8cdc('0x43')][_0x8cdc('0x44')]());})){throw new db['Sequelize'][(_0x8cdc('0x31'))](_0x8cdc('0x45'));}}}var _0x3dfbc3={};_0x3dfbc3[_0x8cdc('0x46')]=_0x4732da[_0x8cdc('0x2e')][_0x8cdc('0x33')](_0x8cdc('0x46'))?_0x4732da[_0x8cdc('0x2e')]['senderName']:_0x4732da['user'][_0x8cdc('0x47')];_0x3dfbc3[_0x8cdc('0x48')]=_['isEmpty'](_0x4732da[_0x8cdc('0x2e')]['recipientsDescription'])?null:_0x4732da['body'][_0x8cdc('0x48')];_0x3dfbc3['beep']=_0x4732da[_0x8cdc('0x2e')][_0x8cdc('0x49')]||![];_0x3dfbc3[_0x8cdc('0x4a')]=_0x4732da[_0x8cdc('0x41')]['id'];return getContent(_0x4732da[_0x8cdc('0x2e')])['then'](function(_0x270c0f){_0x3dfbc3[_0x8cdc('0x2e')]=_0x270c0f;return getRecipients(_0x28ea34);})[_0x8cdc('0x4b')](function(_0x115b1a){_0x3dfbc3[_0x8cdc('0x4c')]=_[_0x8cdc('0x4d')](_0x115b1a)['join'](',');return db['sequelize']['transaction'](function(_0xce4156){return db['UserNotification'][_0x8cdc('0x4e')](_0x3dfbc3,{'raw':!![],'transaction':_0xce4156})[_0x8cdc('0x4b')](function(_0x5434bc){var _0x19b50e={'sender':_0x3dfbc3['senderName'],'description':_0x3dfbc3[_0x8cdc('0x48')],'content':_0x3dfbc3[_0x8cdc('0x2e')],'beep':_0x3dfbc3[_0x8cdc('0x49')]};_0x115b1a[_0x8cdc('0x4f')](function(_0x3270bd){_0x19b50e['recipient']=_0x3270bd;socket['emit'](_0x8cdc('0x50'),_0x19b50e);});return _0x5434bc;});});})['then'](respondWithResult(_0x5cd57a,0xc9))['catch'](handleError(_0x5cd57a,null));};function getContent(_0x5545c8){return new BPromise(function(_0x545929,_0x41edb4){if(_0x5545c8[_0x8cdc('0x2f')]){_0x545929(_0x5545c8[_0x8cdc('0x2f')]);return;}return db[_0x8cdc('0x51')]['findOne']({'attributes':[_0x8cdc('0x52')],'where':{'id':_0x5545c8[_0x8cdc('0x30')]},'raw':!![]})['then'](function(_0x1204a1){if(!_0x1204a1)throw new db[(_0x8cdc('0x35'))][(_0x8cdc('0x31'))](_0x8cdc('0x53'));var _0x4a5b81=Mustache['render'](_0x1204a1[_0x8cdc('0x52')],_0x5545c8[_0x8cdc('0x34')]);_0x545929(_0x4a5b81);})[_0x8cdc('0x54')](function(_0x773c38){_0x41edb4(_0x773c38);});});}function getRecipients(_0x103333){return new BPromise(function(_0x5962d6,_0x1967ae){var _0x1ef99b=[];var _0x4dc07d=[];_0x103333[_0x8cdc('0x4f')](function(_0x27226c){var _0x55ee80=_[_0x8cdc('0x55')](_0x27226c[_0x8cdc('0x43')][_0x8cdc('0x44')]());if(_0x55ee80===_0x8cdc('0x56')){_0x1ef99b=_['union'](_0x1ef99b,_0x27226c['ids']);}else{if(_['includes'](_0x55ee80,_0x8cdc('0x57')))_0x55ee80=_0x55ee80[_0x8cdc('0x58')](_0x8cdc('0x57'),_0x8cdc('0x59'));_0x27226c['ids']['forEach'](function(_0x1a73be){_0x4dc07d[_0x8cdc('0x5a')](getAgents(_0x55ee80,_0x1a73be));});}});return BPromise['all'](_0x4dc07d)[_0x8cdc('0x4b')](function(_0x73901f){_0x1ef99b=_['union'](_0x1ef99b,_[_0x8cdc('0x5b')](_0x73901f));_0x5962d6(_0x1ef99b);})['catch'](function(_0x2a0dc9){_0x1967ae(_0x2a0dc9);});});}function getAgents(_0x2b9693,_0x5488d1){return new BPromise(function(_0x3091d3,_0x2fcd8a){return db[_0x2b9693][_0x8cdc('0x5c')]({'where':{'id':_0x5488d1}})[_0x8cdc('0x4b')](function(_0x2eb011){return _0x2eb011[_0x8cdc('0x5d')]({'attributes':['id'],'raw':!![]})[_0x8cdc('0x4b')](function(_0x1c42fb){var _0x25b7de=_[_0x8cdc('0x5e')](_0x1c42fb,'id');_0x3091d3(_0x25b7de);});})[_0x8cdc('0x54')](function(_0x5001dd){_0x2fcd8a(_0x5001dd);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index f0bc782..ce6814c 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 _0x8172=['setMaxListeners','save','emit','hasOwnProperty','exports','events','../../mysqldb','UserNotification'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x8172,0x1c5));var _0x2817=function(_0x3c151d,_0x5f3cfe){_0x3c151d=_0x3c151d-0x0;var _0x5dd26e=_0x8172[_0x3c151d];return _0x5dd26e;};'use strict';var EventEmitter=require(_0x2817('0x0'));var UserNotification=require(_0x2817('0x1'))['db'][_0x2817('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x2817('0x3')](0x0);var events={'afterCreate':_0x2817('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1349c0){return function(_0x52bd5a,_0x47a30c,_0x2c65b6){UserNotificationEvents[_0x2817('0x5')](_0x1349c0+':'+_0x52bd5a['id'],_0x52bd5a);UserNotificationEvents[_0x2817('0x5')](_0x1349c0,_0x52bd5a);_0x2c65b6(null);};}for(var e in events){if(events[_0x2817('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x2817('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xbbbb=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xe24289,_0x2076e2){var _0x53af0a=function(_0x587a3c){while(--_0x587a3c){_0xe24289['push'](_0xe24289['shift']());}};_0x53af0a(++_0x2076e2);}(_0xbbbb,0x13e));var _0xbbbb=function(_0x39d174,_0x1d2287){_0x39d174=_0x39d174-0x0;var _0x487dcf=_0xbbbb[_0x39d174];return _0x487dcf;};'use strict';var EventEmitter=require(_0xbbbb('0x0'));var UserNotification=require(_0xbbbb('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xbbbb('0x2')](0x0);var events={'afterCreate':_0xbbbb('0x3'),'afterUpdate':_0xbbbb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b56a4){return function(_0x2bfc49,_0x1692a8,_0x56703c){UserNotificationEvents['emit'](_0x2b56a4+':'+_0x2bfc49['id'],_0x2bfc49);UserNotificationEvents[_0xbbbb('0x5')](_0x2b56a4,_0x2bfc49);_0x56703c(null);};}for(var e in events){if(events[_0xbbbb('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xbbbb('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 4357eee..95d3638 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 _0x7a3e=['exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x45eaaf,_0x615293){var _0x1d4947=function(_0x4f291f){while(--_0x4f291f){_0x45eaaf['push'](_0x45eaaf['shift']());}};_0x1d4947(++_0x615293);}(_0x7a3e,0x65));var _0xe7a3=function(_0x5857ce,_0x433fce){_0x5857ce=_0x5857ce-0x0;var _0x5d56a7=_0x7a3e[_0x5857ce];return _0x5d56a7;};'use strict';var _=require(_0xe7a3('0x0'));var util=require(_0xe7a3('0x1'));var logger=require(_0xe7a3('0x2'))(_0xe7a3('0x3'));var moment=require(_0xe7a3('0x4'));var BPromise=require(_0xe7a3('0x5'));var rp=require(_0xe7a3('0x6'));var fs=require('fs');var path=require(_0xe7a3('0x7'));var rimraf=require(_0xe7a3('0x8'));var config=require(_0xe7a3('0x9'));var attributes=require(_0xe7a3('0xa'));module[_0xe7a3('0xb')]=function(_0x4765b5,_0x515c1c){return _0x4765b5['define'](_0xe7a3('0xc'),attributes,{'tableName':_0xe7a3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe7a3('0xe'),'collate':_0xe7a3('0xf')});}; \ No newline at end of file +var _0x13b6=['moment','bluebird','path','rimraf','../../config/environment','exports','UserNotification','utf8mb4','lodash','../../config/logger','api'];(function(_0x4da339,_0x4d93e0){var _0x4fc038=function(_0x2600d2){while(--_0x2600d2){_0x4da339['push'](_0x4da339['shift']());}};_0x4fc038(++_0x4d93e0);}(_0x13b6,0x97));var _0x613b=function(_0x12460d,_0x35d3db){_0x12460d=_0x12460d-0x0;var _0x8f6313=_0x13b6[_0x12460d];return _0x8f6313;};'use strict';var _=require(_0x613b('0x0'));var util=require('util');var logger=require(_0x613b('0x1'))(_0x613b('0x2'));var moment=require(_0x613b('0x3'));var BPromise=require(_0x613b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x613b('0x5'));var rimraf=require(_0x613b('0x6'));var config=require(_0x613b('0x7'));var attributes=require('./userNotification.attributes');module[_0x613b('0x8')]=function(_0x1c746e,_0x312a27){return _0x1c746e['define'](_0x613b('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x613b('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 563a8f1..00f937f 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 _0xcc80=['info','catch','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','request','then','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message'];(function(_0x360680,_0x4e2466){var _0x1fd2ea=function(_0x1c224e){while(--_0x1c224e){_0x360680['push'](_0x360680['shift']());}};_0x1fd2ea(++_0x4e2466);}(_0xcc80,0x75));var _0x0cc8=function(_0x5e94fe,_0x32b0f6){_0x5e94fe=_0x5e94fe-0x0;var _0x2c0114=_0xcc80[_0x5e94fe];return _0x2c0114;};'use strict';var _=require('lodash');var util=require(_0x0cc8('0x0'));var moment=require('moment');var BPromise=require(_0x0cc8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0cc8('0x2'));var logger=require(_0x0cc8('0x3'))(_0x0cc8('0x4'));var config=require(_0x0cc8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0cc8('0x6')][_0x0cc8('0x7')]({'port':0x232a});config[_0x0cc8('0x8')]=_[_0x0cc8('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0cc8('0xa'))(new Redis(config[_0x0cc8('0x8')]));require(_0x0cc8('0xb'))[_0x0cc8('0xc')](socket);function respondWithRpcPromise(_0x56ed66,_0x2268d8,_0xefcf49){return new BPromise(function(_0x533bcd,_0x3aebc2){return client[_0x0cc8('0xd')](_0x56ed66,_0xefcf49)[_0x0cc8('0xe')](function(_0x26a085){logger['info']('UserNotification,\x20%s,\x20%s',_0x2268d8,_0x0cc8('0xf'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x2268d8,_0x0cc8('0xf'),JSON[_0x0cc8('0x10')](_0x26a085));if(_0x26a085[_0x0cc8('0x11')]){if(_0x26a085[_0x0cc8('0x11')][_0x0cc8('0x12')]===0x1f4){logger[_0x0cc8('0x11')](_0x0cc8('0x13'),_0x2268d8,_0x26a085[_0x0cc8('0x11')][_0x0cc8('0x14')]);return _0x3aebc2(_0x26a085[_0x0cc8('0x11')][_0x0cc8('0x14')]);}logger[_0x0cc8('0x11')](_0x0cc8('0x13'),_0x2268d8,_0x26a085[_0x0cc8('0x11')][_0x0cc8('0x14')]);return _0x533bcd(_0x26a085[_0x0cc8('0x11')][_0x0cc8('0x14')]);}else{logger[_0x0cc8('0x15')](_0x0cc8('0x13'),_0x2268d8,_0x0cc8('0xf'));_0x533bcd(_0x26a085['result'][_0x0cc8('0x14')]);}})[_0x0cc8('0x16')](function(_0x2d7e6e){logger[_0x0cc8('0x11')](_0x0cc8('0x13'),_0x2268d8,_0x2d7e6e);_0x3aebc2(_0x2d7e6e);});});} \ No newline at end of file +var _0xf18a=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x56762b,_0x50d38d){var _0x2d42cf=function(_0x56d2e6){while(--_0x56d2e6){_0x56762b['push'](_0x56762b['shift']());}};_0x2d42cf(++_0x50d38d);}(_0xf18a,0x95));var _0xaf18=function(_0x51f9a3,_0x374532){_0x51f9a3=_0x51f9a3-0x0;var _0x57608c=_0xf18a[_0x51f9a3];return _0x57608c;};'use strict';var _=require(_0xaf18('0x0'));var util=require(_0xaf18('0x1'));var moment=require(_0xaf18('0x2'));var BPromise=require(_0xaf18('0x3'));var rs=require(_0xaf18('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaf18('0x5'));var logger=require(_0xaf18('0x6'))(_0xaf18('0x7'));var config=require(_0xaf18('0x8'));var jayson=require(_0xaf18('0x9'));var client=jayson['client'][_0xaf18('0xa')]({'port':0x232a});config['redis']=_[_0xaf18('0xb')](config[_0xaf18('0xc')],{'host':_0xaf18('0xd'),'port':0x18eb});var socket=require(_0xaf18('0xe'))(new Redis(config[_0xaf18('0xc')]));require(_0xaf18('0xf'))[_0xaf18('0x10')](socket);function respondWithRpcPromise(_0x5dd342,_0x51069a,_0x4cb44e){return new BPromise(function(_0x21aaa6,_0xe38ff4){return client[_0xaf18('0x11')](_0x5dd342,_0x4cb44e)[_0xaf18('0x12')](function(_0x3bbc30){logger[_0xaf18('0x13')](_0xaf18('0x14'),_0x51069a,_0xaf18('0x15'));logger['debug'](_0xaf18('0x16'),_0x51069a,_0xaf18('0x15'),JSON[_0xaf18('0x17')](_0x3bbc30));if(_0x3bbc30[_0xaf18('0x18')]){if(_0x3bbc30[_0xaf18('0x18')][_0xaf18('0x19')]===0x1f4){logger[_0xaf18('0x18')]('UserNotification,\x20%s,\x20%s',_0x51069a,_0x3bbc30[_0xaf18('0x18')][_0xaf18('0x1a')]);return _0xe38ff4(_0x3bbc30[_0xaf18('0x18')][_0xaf18('0x1a')]);}logger['error'](_0xaf18('0x14'),_0x51069a,_0x3bbc30[_0xaf18('0x18')]['message']);return _0x21aaa6(_0x3bbc30[_0xaf18('0x18')]['message']);}else{logger[_0xaf18('0x13')](_0xaf18('0x14'),_0x51069a,_0xaf18('0x15'));_0x21aaa6(_0x3bbc30[_0xaf18('0x1b')]['message']);}})[_0xaf18('0x1c')](function(_0x5af32f){logger[_0xaf18('0x18')](_0xaf18('0x14'),_0x51069a,_0x5af32f);_0xe38ff4(_0x5af32f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 7d20ee6..037dccf 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 _0x7984=['./userNotification.events','save','update','userNotification:'];(function(_0x11e216,_0xf7592b){var _0x51839f=function(_0xd2fa82){while(--_0xd2fa82){_0x11e216['push'](_0x11e216['shift']());}};_0x51839f(++_0xf7592b);}(_0x7984,0xac));var _0x4798=function(_0x38d4f7,_0x17c1e8){_0x38d4f7=_0x38d4f7-0x0;var _0x40428c=_0x7984[_0x38d4f7];return _0x40428c;};'use strict';var UserNotificationEvents=require(_0x4798('0x0'));var events=[_0x4798('0x1'),'remove',_0x4798('0x2')];function createListener(_0x19f494,_0x1203f8){return function(_0x28df02){_0x1203f8['emit'](_0x19f494,_0x28df02);};}function removeListener(_0x26de54,_0x5ae34d){return function(){UserNotificationEvents['removeListener'](_0x26de54,_0x5ae34d);};}exports['register']=function(_0x43f2d5){for(var _0x565f3d=0x0,_0x5777cc=events['length'];_0x565f3d<_0x5777cc;_0x565f3d++){var _0x2ca19d=events[_0x565f3d];var _0x7ba9d7=createListener(_0x4798('0x3')+_0x2ca19d,_0x43f2d5);UserNotificationEvents['on'](_0x2ca19d,_0x7ba9d7);}}; \ No newline at end of file +var _0xeafc=['save','update','removeListener','register','length','userNotification:'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xeafc,0x1bc));var _0xceaf=function(_0x3b7e6f,_0x1565b5){_0x3b7e6f=_0x3b7e6f-0x0;var _0x4873c3=_0xeafc[_0x3b7e6f];return _0x4873c3;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xceaf('0x0'),'remove',_0xceaf('0x1')];function createListener(_0x397ab6,_0x1a6c7c){return function(_0x4f937a){_0x1a6c7c['emit'](_0x397ab6,_0x4f937a);};}function removeListener(_0x43ab34,_0x298f58){return function(){UserNotificationEvents[_0xceaf('0x2')](_0x43ab34,_0x298f58);};}exports[_0xceaf('0x3')]=function(_0x483545){for(var _0x352318=0x0,_0x35b0c5=events[_0xceaf('0x4')];_0x352318<_0x35b0c5;_0x352318++){var _0x37cf6f=events[_0x352318];var _0x40a22f=createListener(_0xceaf('0x5')+_0x37cf6f,_0x483545);UserNotificationEvents['on'](_0x37cf6f,_0x40a22f);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 80bca91..e66994c 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x18b115,_0x5a9467){var _0x2e504d=function(_0x42765e){while(--_0x42765e){_0x18b115['push'](_0x18b115['shift']());}};_0x2e504d(++_0x5a9467);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0xcb91[_0x553a87];return _0x12d1e6;};'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 +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2db59f,_0x236c36){var _0x8e74b8=function(_0x230da4){while(--_0x230da4){_0x2db59f['push'](_0x2db59f['shift']());}};_0x8e74b8(++_0x236c36);}(_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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 7f1d5a3..c07354d 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 _0x5111=['sequelize','exports','INTEGER'];(function(_0x4057f9,_0x17c5b5){var _0x5552b7=function(_0xeb792f){while(--_0xeb792f){_0x4057f9['push'](_0x4057f9['shift']());}};_0x5552b7(++_0x17c5b5);}(_0x5111,0x132));var _0x1511=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5111[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1511('0x0'));module[_0x1511('0x1')]={'penalty':{'type':Sequelize[_0x1511('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x81a3=['INTEGER','sequelize','exports'];(function(_0x4d179b,_0x2077fc){var _0x2737f0=function(_0x48e32e){while(--_0x48e32e){_0x4d179b['push'](_0x4d179b['shift']());}};_0x2737f0(++_0x2077fc);}(_0x81a3,0x1e4));var _0x381a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x81a3[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x381a('0x0'));module[_0x381a('0x1')]={'penalty':{'type':Sequelize[_0x381a('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index e0a636b..cb09cbc 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 _0x8fa9=['lodash','util','moment','bluebird','path','../../config/environment','define','UserOpenchannelQueue'];(function(_0x1559a5,_0x41924e){var _0x17a783=function(_0x152c63){while(--_0x152c63){_0x1559a5['push'](_0x1559a5['shift']());}};_0x17a783(++_0x41924e);}(_0x8fa9,0x158));var _0x98fa=function(_0x3ed1f6,_0x22466f){_0x3ed1f6=_0x3ed1f6-0x0;var _0xe257b0=_0x8fa9[_0x3ed1f6];return _0xe257b0;};'use strict';var _=require(_0x98fa('0x0'));var util=require(_0x98fa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x98fa('0x2'));var BPromise=require(_0x98fa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98fa('0x4'));var rimraf=require('rimraf');var config=require(_0x98fa('0x5'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x41ef0e,_0x44247f){return _0x41ef0e[_0x98fa('0x6')](_0x98fa('0x7'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4720=['./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x27454c,_0x91eaa9){var _0x1b1e4a=function(_0x4caf9f){while(--_0x4caf9f){_0x27454c['push'](_0x27454c['shift']());}};_0x1b1e4a(++_0x91eaa9);}(_0x4720,0x143));var _0x0472=function(_0x23f3fe,_0x37a19c){_0x23f3fe=_0x23f3fe-0x0;var _0x1b1cb1=_0x4720[_0x23f3fe];return _0x1b1cb1;};'use strict';var _=require(_0x0472('0x0'));var util=require(_0x0472('0x1'));var logger=require(_0x0472('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0472('0x3'));var rp=require(_0x0472('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0472('0x5'));var config=require(_0x0472('0x6'));var attributes=require(_0x0472('0x7'));module[_0x0472('0x8')]=function(_0x435fb9,_0x2ea4fb){return _0x435fb9['define'](_0x0472('0x9'),attributes,{'tableName':_0x0472('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 979b375..7765ea2 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 _0x0d9e=['result','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x3a5112,_0x271062){var _0x3a5236=function(_0x4c74b1){while(--_0x4c74b1){_0x3a5112['push'](_0x3a5112['shift']());}};_0x3a5236(++_0x271062);}(_0x0d9e,0x91));var _0xe0d9=function(_0x27220c,_0x374d56){_0x27220c=_0x27220c-0x0;var _0x494e9d=_0x0d9e[_0x27220c];return _0x494e9d;};'use strict';var _=require('lodash');var util=require(_0xe0d9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0d9('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0d9('0x2'))(_0xe0d9('0x3'));var config=require(_0xe0d9('0x4'));var jayson=require(_0xe0d9('0x5'));var client=jayson['client'][_0xe0d9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c9d2e,_0x4b30e9,_0x751593){return new BPromise(function(_0x2a964d,_0x413d78){return client['request'](_0x1c9d2e,_0x751593)[_0xe0d9('0x7')](function(_0x5215ad){logger[_0xe0d9('0x8')](_0xe0d9('0x9'),_0x4b30e9,'request\x20sent');logger[_0xe0d9('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4b30e9,_0xe0d9('0xb'),JSON['stringify'](_0x5215ad));if(_0x5215ad[_0xe0d9('0xc')]){if(_0x5215ad[_0xe0d9('0xc')][_0xe0d9('0xd')]===0x1f4){logger[_0xe0d9('0xc')](_0xe0d9('0x9'),_0x4b30e9,_0x5215ad[_0xe0d9('0xc')][_0xe0d9('0xe')]);return _0x413d78(_0x5215ad[_0xe0d9('0xc')][_0xe0d9('0xe')]);}logger[_0xe0d9('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4b30e9,_0x5215ad['error'][_0xe0d9('0xe')]);return _0x2a964d(_0x5215ad[_0xe0d9('0xc')][_0xe0d9('0xe')]);}else{logger[_0xe0d9('0x8')](_0xe0d9('0x9'),_0x4b30e9,'request\x20sent');_0x2a964d(_0x5215ad[_0xe0d9('0xf')][_0xe0d9('0xe')]);}})['catch'](function(_0x5de035){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4b30e9,_0x5de035);_0x413d78(_0x5de035);});});} \ No newline at end of file +var _0x865c=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x154b97,_0x12421e){var _0x551bc4=function(_0x8804a){while(--_0x8804a){_0x154b97['push'](_0x154b97['shift']());}};_0x551bc4(++_0x12421e);}(_0x865c,0xee));var _0xc865=function(_0x667d80,_0x589736){_0x667d80=_0x667d80-0x0;var _0x4faeed=_0x865c[_0x667d80];return _0x4faeed;};'use strict';var _=require(_0xc865('0x0'));var util=require(_0xc865('0x1'));var moment=require(_0xc865('0x2'));var BPromise=require('bluebird');var rs=require(_0xc865('0x3'));var fs=require('fs');var Redis=require(_0xc865('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc865('0x5'));var logger=require(_0xc865('0x6'))(_0xc865('0x7'));var config=require(_0xc865('0x8'));var jayson=require(_0xc865('0x9'));var client=jayson[_0xc865('0xa')][_0xc865('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ce703,_0x438dff,_0xba0bcd){return new BPromise(function(_0x1e6cb9,_0x23fd4d){return client[_0xc865('0xc')](_0x4ce703,_0xba0bcd)[_0xc865('0xd')](function(_0x769760){logger[_0xc865('0xe')](_0xc865('0xf'),_0x438dff,'request\x20sent');logger[_0xc865('0x10')](_0xc865('0x11'),_0x438dff,_0xc865('0x12'),JSON[_0xc865('0x13')](_0x769760));if(_0x769760[_0xc865('0x14')]){if(_0x769760[_0xc865('0x14')][_0xc865('0x15')]===0x1f4){logger[_0xc865('0x14')](_0xc865('0xf'),_0x438dff,_0x769760[_0xc865('0x14')]['message']);return _0x23fd4d(_0x769760[_0xc865('0x14')][_0xc865('0x16')]);}logger[_0xc865('0x14')](_0xc865('0xf'),_0x438dff,_0x769760[_0xc865('0x14')][_0xc865('0x16')]);return _0x1e6cb9(_0x769760[_0xc865('0x14')][_0xc865('0x16')]);}else{logger[_0xc865('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x438dff,'request\x20sent');_0x1e6cb9(_0x769760[_0xc865('0x17')]['message']);}})[_0xc865('0x18')](function(_0x4abd08){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x438dff,_0x4abd08);_0x23fd4d(_0x4abd08);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 8e5ca8c..85848fe 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 _0x1e7a=['/:id','show','/:id/sections','/:id/resources','post','create','addSections','destroy','delete','removeSections','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x222b46,_0x5c894a){var _0x1f7314=function(_0x5c14e9){while(--_0x5c14e9){_0x222b46['push'](_0x222b46['shift']());}};_0x1f7314(++_0x5c894a);}(_0x1e7a,0xe3));var _0xa1e7=function(_0x5925f6,_0x291a73){_0x5925f6=_0x5925f6-0x0;var _0x4739c4=_0x1e7a[_0x5925f6];return _0x4739c4;};'use strict';var multer=require(_0xa1e7('0x0'));var util=require(_0xa1e7('0x1'));var path=require('path');var timeout=require(_0xa1e7('0x2'));var express=require(_0xa1e7('0x3'));var router=express[_0xa1e7('0x4')]();var fs_extra=require(_0xa1e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa1e7('0x6'));var config=require(_0xa1e7('0x7'));var controller=require('./userProfile.controller');router[_0xa1e7('0x8')]('/',auth[_0xa1e7('0x9')](),controller[_0xa1e7('0xa')]);router[_0xa1e7('0x8')](_0xa1e7('0xb'),auth[_0xa1e7('0x9')](),controller[_0xa1e7('0xc')]);router[_0xa1e7('0x8')](_0xa1e7('0xd'),auth['isAuthenticated'](),controller[_0xa1e7('0xe')]);router[_0xa1e7('0x8')](_0xa1e7('0xf'),auth[_0xa1e7('0x9')](),controller['getSections']);router[_0xa1e7('0x8')](_0xa1e7('0x10'),auth[_0xa1e7('0x9')](),controller['getResources']);router[_0xa1e7('0x11')]('/',auth[_0xa1e7('0x9')](),controller[_0xa1e7('0x12')]);router['post']('/:id/clone',auth[_0xa1e7('0x9')](),controller['clone']);router[_0xa1e7('0x11')](_0xa1e7('0xf'),auth['isAuthenticated'](),controller[_0xa1e7('0x13')]);router[_0xa1e7('0x11')](_0xa1e7('0x10'),auth[_0xa1e7('0x9')](),controller['addResources']);router['put'](_0xa1e7('0xd'),auth[_0xa1e7('0x9')](),controller['update']);router['delete'](_0xa1e7('0xd'),auth[_0xa1e7('0x9')](),controller[_0xa1e7('0x14')]);router[_0xa1e7('0x15')]('/:id/sections',auth[_0xa1e7('0x9')](),controller[_0xa1e7('0x16')]);router[_0xa1e7('0x15')](_0xa1e7('0x10'),auth['isAuthenticated'](),controller['removeResources']);module[_0xa1e7('0x17')]=router; \ No newline at end of file +var _0x9488=['removeSections','removeResources','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','/:id','getSections','getResources','/:id/clone','clone','post','/:id/sections','addSections','/:id/resources','put','update','delete'];(function(_0x42d2b9,_0x173c09){var _0x49a75c=function(_0x3ff048){while(--_0x3ff048){_0x42d2b9['push'](_0x42d2b9['shift']());}};_0x49a75c(++_0x173c09);}(_0x9488,0x1e2));var _0x8948=function(_0x42c8cd,_0x4cd331){_0x42c8cd=_0x42c8cd-0x0;var _0x4cd48a=_0x9488[_0x42c8cd];return _0x4cd48a;};'use strict';var multer=require(_0x8948('0x0'));var util=require(_0x8948('0x1'));var path=require(_0x8948('0x2'));var timeout=require(_0x8948('0x3'));var express=require('express');var router=express[_0x8948('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8948('0x5'));var interaction=require(_0x8948('0x6'));var config=require('../../config/environment');var controller=require(_0x8948('0x7'));router[_0x8948('0x8')]('/',auth[_0x8948('0x9')](),controller['index']);router[_0x8948('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8948('0x8')](_0x8948('0xa'),auth[_0x8948('0x9')](),controller['show']);router['get']('/:id/sections',auth[_0x8948('0x9')](),controller[_0x8948('0xb')]);router['get']('/:id/resources',auth[_0x8948('0x9')](),controller[_0x8948('0xc')]);router['post']('/',auth[_0x8948('0x9')](),controller['create']);router['post'](_0x8948('0xd'),auth[_0x8948('0x9')](),controller[_0x8948('0xe')]);router[_0x8948('0xf')](_0x8948('0x10'),auth['isAuthenticated'](),controller[_0x8948('0x11')]);router['post'](_0x8948('0x12'),auth[_0x8948('0x9')](),controller['addResources']);router[_0x8948('0x13')](_0x8948('0xa'),auth[_0x8948('0x9')](),controller[_0x8948('0x14')]);router[_0x8948('0x15')]('/:id',auth[_0x8948('0x9')](),controller['destroy']);router[_0x8948('0x15')](_0x8948('0x10'),auth[_0x8948('0x9')](),controller[_0x8948('0x16')]);router['delete']('/:id/resources',auth[_0x8948('0x9')](),controller[_0x8948('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 5f733e7..1eb0466 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 _0x9362=['BOOLEAN','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x37320f,_0x40ac81){var _0x341eff=function(_0x3904f9){while(--_0x3904f9){_0x37320f['push'](_0x37320f['shift']());}};_0x341eff(++_0x40ac81);}(_0x9362,0xa2));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2936('0x0')],'allowNull':![],'unique':_0x2936('0x1')},'crudPermissions':{'type':Sequelize[_0x2936('0x0')],'set':function(_0x58ac99){this[_0x2936('0x2')](_0x2936('0x3'),_0x58ac99?_0x58ac99[_0x2936('0x4')](''):[]);},'get':function(){return this[_0x2936('0x5')](_0x2936('0x3'))?this['getDataValue'](_0x2936('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2936('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x2936('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x2936('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x2936('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x2936('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x2936('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2936('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x83af=['split','BOOLEAN','sequelize','exports','name','STRING','setDataValue','join','getDataValue','crudPermissions'];(function(_0xd5e806,_0x42112c){var _0x1db253=function(_0x5abc2a){while(--_0x5abc2a){_0xd5e806['push'](_0xd5e806['shift']());}};_0x1db253(++_0x42112c);}(_0x83af,0x98));var _0xf83a=function(_0x1be790,_0x112549){_0x1be790=_0x1be790-0x0;var _0x7668c8=_0x83af[_0x1be790];return _0x7668c8;};'use strict';var Sequelize=require(_0xf83a('0x0'));module[_0xf83a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf83a('0x2')},'crudPermissions':{'type':Sequelize[_0xf83a('0x3')],'set':function(_0x4a73ff){this[_0xf83a('0x4')]('crudPermissions',_0x4a73ff?_0x4a73ff[_0xf83a('0x5')](''):[]);},'get':function(){return this[_0xf83a('0x6')](_0xf83a('0x7'))?this[_0xf83a('0x6')](_0xf83a('0x7'))[_0xf83a('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf83a('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf83a('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf83a('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf83a('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf83a('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf83a('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf83a('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 44785eb..0fd6c71 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 _0xede2=['stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','UserProfile','includeAll','include','findAll','rows','show','params','find','catch','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','update','destroy','describe','addSections','UserProfileSection','each','removeSections','ids','getSections','enabled','isEmpty','subsections','includes','concat','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','then','error'];(function(_0x13ee7b,_0x118ca9){var _0x153c52=function(_0x2c4014){while(--_0x2c4014){_0x13ee7b['push'](_0x13ee7b['shift']());}};_0x153c52(++_0x118ca9);}(_0xede2,0x142));var _0x2ede=function(_0x25f99c,_0x31269f){_0x25f99c=_0x25f99c-0x0;var _0x1ea795=_0xede2[_0x25f99c];return _0x1ea795;};'use strict';var emlformat=require(_0x2ede('0x0'));var rimraf=require(_0x2ede('0x1'));var zipdir=require(_0x2ede('0x2'));var jsonpatch=require(_0x2ede('0x3'));var rp=require(_0x2ede('0x4'));var moment=require('moment');var BPromise=require(_0x2ede('0x5'));var Mustache=require('mustache');var util=require(_0x2ede('0x6'));var path=require(_0x2ede('0x7'));var sox=require(_0x2ede('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ede('0x9'));var _=require('lodash');var squel=require(_0x2ede('0xa'));var crypto=require(_0x2ede('0xb'));var jsforce=require(_0x2ede('0xc'));var deskjs=require(_0x2ede('0xd'));var toCsv=require(_0x2ede('0xe'));var querystring=require(_0x2ede('0xf'));var Papa=require(_0x2ede('0x10'));var Redis=require(_0x2ede('0x11'));var authService=require(_0x2ede('0x12'));var qs=require(_0x2ede('0x13'));var as=require(_0x2ede('0x14'));var hardwareService=require(_0x2ede('0x15'));var logger=require('../../config/logger')(_0x2ede('0x16'));var utils=require(_0x2ede('0x17'));var config=require(_0x2ede('0x18'));var licenseUtil=require(_0x2ede('0x19'));var db=require(_0x2ede('0x1a'))['db'];config[_0x2ede('0x1b')]=_['defaults'](config[_0x2ede('0x1b')],{'host':_0x2ede('0x1c'),'port':0x18eb});var socket=require(_0x2ede('0x1d'))(new Redis(config[_0x2ede('0x1b')]));require(_0x2ede('0x1e'))['register'](socket);function respondWithStatusCode(_0x5d9488,_0x54c274){_0x54c274=_0x54c274||0xcc;return function(_0x24203f){if(_0x24203f){return _0x5d9488[_0x2ede('0x1f')](_0x54c274);}return _0x5d9488['status'](_0x54c274)[_0x2ede('0x20')]();};}function respondWithResult(_0x453733,_0x4648e4){_0x4648e4=_0x4648e4||0xc8;return function(_0x1831d7){if(_0x1831d7){return _0x453733[_0x2ede('0x21')](_0x4648e4)['json'](_0x1831d7);}};}function respondWithFilteredResult(_0x4c3f96,_0x18dc5f){return function(_0xa641ef){if(_0xa641ef){var _0x5cd393=typeof _0x18dc5f[_0x2ede('0x22')]===_0x2ede('0x23')&&typeof _0x18dc5f[_0x2ede('0x24')]===_0x2ede('0x23');var _0xa745d=_0xa641ef['count'];var _0x41ca46=_0x5cd393?0x0:_0x18dc5f[_0x2ede('0x22')];var _0x355bc5=_0x5cd393?_0xa641ef[_0x2ede('0x25')]:_0x18dc5f[_0x2ede('0x22')]+_0x18dc5f[_0x2ede('0x24')];var _0x45558b;if(_0x355bc5>=_0xa745d){_0x355bc5=_0xa745d;_0x45558b=0xc8;}else{_0x45558b=0xce;}_0x4c3f96[_0x2ede('0x21')](_0x45558b);return _0x4c3f96['set'](_0x2ede('0x26'),_0x41ca46+'-'+_0x355bc5+'/'+_0xa745d)[_0x2ede('0x27')](_0xa641ef);}return null;};}function patchUpdates(_0x985028){return function(_0x523379){try{jsonpatch[_0x2ede('0x28')](_0x523379,_0x985028,!![]);}catch(_0x5894ee){return BPromise[_0x2ede('0x29')](_0x5894ee);}return _0x523379['save']();};}function saveUpdates(_0x2abf8e,_0x4d9ac5){return function(_0x1d4a04){if(_0x1d4a04){return _0x1d4a04['update'](_0x2abf8e)[_0x2ede('0x2a')](function(_0x51bbc8){return _0x51bbc8;});}return null;};}function removeEntity(_0x2ca73b,_0x4aa6c8){return function(_0x19f581){if(_0x19f581){return _0x19f581['destroy']()[_0x2ede('0x2a')](function(){_0x2ca73b[_0x2ede('0x21')](0xcc)[_0x2ede('0x20')]();});}};}function handleEntityNotFound(_0x28aa81,_0x56f81f){return function(_0x2db5bf){if(!_0x2db5bf){_0x28aa81[_0x2ede('0x1f')](0x194);}return _0x2db5bf;};}function handleError(_0x980121,_0x34e361){_0x34e361=_0x34e361||0x1f4;return function(_0x50e2bc){logger[_0x2ede('0x2b')](_0x50e2bc[_0x2ede('0x2c')]);if(_0x50e2bc['name']){delete _0x50e2bc[_0x2ede('0x2d')];}_0x980121[_0x2ede('0x21')](_0x34e361)[_0x2ede('0x2e')](_0x50e2bc);};}exports[_0x2ede('0x2f')]=function(_0x4cba56,_0xefae3d){var _0xe280fc={},_0x5b8775={},_0x16bcf2={'count':0x0,'rows':[]};var _0x2900e4=_[_0x2ede('0x30')](db['UserProfile'][_0x2ede('0x31')],function(_0x43f71d){return{'name':_0x43f71d[_0x2ede('0x32')],'type':_0x43f71d[_0x2ede('0x33')][_0x2ede('0x34')]};});_0x5b8775[_0x2ede('0x35')]=_[_0x2ede('0x30')](_0x2900e4,_0x2ede('0x2d'));_0x5b8775['query']=_[_0x2ede('0x36')](_0x4cba56[_0x2ede('0x37')]);_0x5b8775[_0x2ede('0x38')]=_[_0x2ede('0x39')](_0x5b8775[_0x2ede('0x35')],_0x5b8775[_0x2ede('0x37')]);_0xe280fc['attributes']=_[_0x2ede('0x39')](_0x5b8775[_0x2ede('0x35')],qs[_0x2ede('0x3a')](_0x4cba56[_0x2ede('0x37')][_0x2ede('0x3a')]));_0xe280fc['attributes']=_0xe280fc[_0x2ede('0x3b')][_0x2ede('0x3c')]?_0xe280fc[_0x2ede('0x3b')]:_0x5b8775[_0x2ede('0x35')];if(!_0x4cba56[_0x2ede('0x37')][_0x2ede('0x3d')]('nolimit')){_0xe280fc[_0x2ede('0x24')]=qs['limit'](_0x4cba56['query'][_0x2ede('0x24')]);_0xe280fc[_0x2ede('0x22')]=qs[_0x2ede('0x22')](_0x4cba56[_0x2ede('0x37')]['offset']);}_0xe280fc[_0x2ede('0x3e')]=qs['sort'](_0x4cba56['query'][_0x2ede('0x3f')]);_0xe280fc['where']=qs['filters'](_[_0x2ede('0x40')](_0x4cba56[_0x2ede('0x37')],_0x5b8775[_0x2ede('0x38')]),_0x2900e4);if(_0x4cba56[_0x2ede('0x37')][_0x2ede('0x41')]){_0xe280fc['where']=_[_0x2ede('0x42')](_0xe280fc[_0x2ede('0x43')],{'$or':_[_0x2ede('0x30')](_0x2900e4,function(_0x5dca5){if(_0x5dca5[_0x2ede('0x33')]!==_0x2ede('0x44')){var _0x3240cb={};_0x3240cb[_0x5dca5[_0x2ede('0x2d')]]={'$like':'%'+_0x4cba56[_0x2ede('0x37')][_0x2ede('0x41')]+'%'};return _0x3240cb;}})});}_0xe280fc=_['merge']({},_0xe280fc,_0x4cba56[_0x2ede('0x45')]);var _0x2bfb89={'where':_0xe280fc['where']};return db[_0x2ede('0x46')][_0x2ede('0x25')](_0x2bfb89)[_0x2ede('0x2a')](function(_0x404e52){_0x16bcf2[_0x2ede('0x25')]=_0x404e52;if(_0x4cba56['query'][_0x2ede('0x47')]){_0xe280fc[_0x2ede('0x48')]=[{'all':!![]}];}return db[_0x2ede('0x46')][_0x2ede('0x49')](_0xe280fc);})[_0x2ede('0x2a')](function(_0x2ddea2){_0x16bcf2[_0x2ede('0x4a')]=_0x2ddea2;return _0x16bcf2;})[_0x2ede('0x2a')](respondWithFilteredResult(_0xefae3d,_0xe280fc))['catch'](handleError(_0xefae3d,null));};exports[_0x2ede('0x4b')]=function(_0x58456b,_0x2debd8){var _0x60ef39={'raw':![],'where':{'id':_0x58456b[_0x2ede('0x4c')]['id']}},_0x139a68={};_0x139a68[_0x2ede('0x35')]=_['keys'](db[_0x2ede('0x46')][_0x2ede('0x31')]);_0x139a68['query']=_[_0x2ede('0x36')](_0x58456b[_0x2ede('0x37')]);_0x139a68['filters']=_[_0x2ede('0x39')](_0x139a68[_0x2ede('0x35')],_0x139a68[_0x2ede('0x37')]);_0x60ef39['attributes']=_[_0x2ede('0x39')](_0x139a68[_0x2ede('0x35')],qs[_0x2ede('0x3a')](_0x58456b[_0x2ede('0x37')][_0x2ede('0x3a')]));_0x60ef39['attributes']=_0x60ef39['attributes'][_0x2ede('0x3c')]?_0x60ef39['attributes']:_0x139a68[_0x2ede('0x35')];if(_0x58456b[_0x2ede('0x37')][_0x2ede('0x47')]){_0x60ef39[_0x2ede('0x48')]=[{'all':!![]}];}_0x60ef39=_[_0x2ede('0x42')]({},_0x60ef39,_0x58456b[_0x2ede('0x45')]);return db[_0x2ede('0x46')][_0x2ede('0x4d')](_0x60ef39)[_0x2ede('0x2a')](handleEntityNotFound(_0x2debd8,null))[_0x2ede('0x2a')](respondWithResult(_0x2debd8,null))[_0x2ede('0x4e')](handleError(_0x2debd8,null));};exports['create']=function(_0x48cd77,_0xeee5e4){return db[_0x2ede('0x46')][_0x2ede('0x4f')](_0x48cd77[_0x2ede('0x50')],{})[_0x2ede('0x2a')](respondWithResult(_0xeee5e4,0xc9))[_0x2ede('0x4e')](handleError(_0xeee5e4,null));};exports[_0x2ede('0x51')]=function(_0x2f350b,_0x3994b8){var _0x395e59={'where':{'id':_0x2f350b[_0x2ede('0x4c')]['id']}},_0xd11e9f={};_0xd11e9f['model']=_[_0x2ede('0x36')](db[_0x2ede('0x46')][_0x2ede('0x31')]);_0x395e59[_0x2ede('0x3b')]=_[_0x2ede('0x39')](_0xd11e9f['model'],qs[_0x2ede('0x3a')](_0x2f350b['query'][_0x2ede('0x3a')]));_0x395e59[_0x2ede('0x3b')]=_0x395e59[_0x2ede('0x3b')][_0x2ede('0x3c')]?_0x395e59[_0x2ede('0x3b')]:_0xd11e9f[_0x2ede('0x35')];if(_0x2f350b['query']['includeAll']){_0x395e59[_0x2ede('0x48')]=[{'all':!![]}];}_0x395e59=_[_0x2ede('0x42')]({},_0x395e59,_0x2f350b['options']);return db['UserProfile'][_0x2ede('0x4d')](_0x395e59)[_0x2ede('0x2a')](handleEntityNotFound(_0x3994b8,null))[_0x2ede('0x2a')](function(_0x221b5b){if(_0x221b5b){var _0x9fc7d8=_0x221b5b[_0x2ede('0x52')]({'plain':!![]});_0x9fc7d8=qs[_0x2ede('0x53')](_0x9fc7d8,['id',_0x2ede('0x54'),_0x2ede('0x55'),_0x2ede('0x56')]);_0x2f350b[_0x2ede('0x50')]=_[_0x2ede('0x53')](_0x2f350b[_0x2ede('0x50')],['id',_0x2ede('0x54'),_0x2ede('0x55')]);return db[_0x2ede('0x57')][_0x2ede('0x58')](function(_0xae0402){return db[_0x2ede('0x46')][_0x2ede('0x4f')](_[_0x2ede('0x42')](_0x9fc7d8,_0x2f350b[_0x2ede('0x50')]),{'include':_0x2f350b[_0x2ede('0x37')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0xae0402})[_0x2ede('0x2a')](function(_0x1bf3da){var _0x57c49c=_0x1bf3da['get']({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2f350b['params']['id']},'raw':!![]})[_0x2ede('0x2a')](function(_0x1bf0a7){if(_0x1bf0a7){return BPromise['each'](_0x1bf0a7,function(_0x26fdd7){return new BPromise(function(_0x56ba83,_0x17f60d){if(_0x26fdd7['autoAssociation']===null||_0x26fdd7[_0x2ede('0x59')]===0x1)_0x56ba83(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x26fdd7['id']},'raw':!![]})[_0x2ede('0x2a')](function(_0x2cc94d){var _0x2f2f57=_[_0x2ede('0x30')](_0x2cc94d,function(_0x39f5b6){return qs['omit'](_0x39f5b6,['id',_0x2ede('0x54'),_0x2ede('0x55'),_0x2ede('0x5a')]);});_0x56ba83(_0x2f2f57);})[_0x2ede('0x4e')](function(_0x310100){_0x17f60d(_0x310100);});})[_0x2ede('0x2a')](function(_0x263b5f){var _0x44a845=qs[_0x2ede('0x53')](_0x26fdd7,['id','createdAt',_0x2ede('0x55')]);_0x44a845[_0x2ede('0x5b')]=_0x57c49c['id'];if(_0x263b5f)_0x44a845[_0x2ede('0x5c')]=_0x263b5f;return _0x44a845;})[_0x2ede('0x2a')](function(_0x4db83c){return db['UserProfileSection'][_0x2ede('0x4f')](_0x4db83c,{'include':[{'model':db[_0x2ede('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0xae0402});});})[_0x2ede('0x2a')](function(){return _0x57c49c;});}});});});}})[_0x2ede('0x2a')](respondWithResult(_0x3994b8,0xc9))[_0x2ede('0x4e')](handleError(_0x3994b8,null));};exports[_0x2ede('0x5e')]=function(_0x35dadf,_0x5aaa4b){if(_0x35dadf[_0x2ede('0x50')]['id']){delete _0x35dadf[_0x2ede('0x50')]['id'];}return db['UserProfile'][_0x2ede('0x4d')]({'where':{'id':_0x35dadf['params']['id']}})[_0x2ede('0x2a')](handleEntityNotFound(_0x5aaa4b,null))[_0x2ede('0x2a')](saveUpdates(_0x35dadf[_0x2ede('0x50')],null))[_0x2ede('0x2a')](respondWithResult(_0x5aaa4b,null))['catch'](handleError(_0x5aaa4b,null));};exports[_0x2ede('0x5f')]=function(_0x1ca7e0,_0x1f4362){return db[_0x2ede('0x46')][_0x2ede('0x4d')]({'where':{'id':_0x1ca7e0[_0x2ede('0x4c')]['id']}})[_0x2ede('0x2a')](handleEntityNotFound(_0x1f4362,null))[_0x2ede('0x2a')](removeEntity(_0x1f4362,null))[_0x2ede('0x4e')](handleError(_0x1f4362,null));};exports[_0x2ede('0x60')]=function(_0x220f52,_0x3cddf0){return db[_0x2ede('0x46')][_0x2ede('0x60')]()[_0x2ede('0x2a')](respondWithResult(_0x3cddf0,null))[_0x2ede('0x4e')](handleError(_0x3cddf0,null));};exports[_0x2ede('0x61')]=function(_0x16197e,_0x3693c6){var _0x28024a=_0x16197e['body'];return db[_0x2ede('0x46')][_0x2ede('0x4d')]({'where':{'id':_0x16197e[_0x2ede('0x4c')]['id']}})[_0x2ede('0x2a')](handleEntityNotFound(_0x3693c6,null))[_0x2ede('0x2a')](function(_0x5e4bf1){if(_0x5e4bf1){return db[_0x2ede('0x57')][_0x2ede('0x58')](function(_0x5e0511){return db[_0x2ede('0x62')][_0x2ede('0x5f')]({'where':{'userProfileId':_0x16197e['params']['id'],'sectionId':_['map'](_0x28024a,function(_0x552a2c){return _0x552a2c[_0x2ede('0x5a')];})},'transaction':_0x5e0511})['then'](function(){var _0x4ee835=_[_0x2ede('0x30')](_0x28024a,function(_0x13f93c){_0x13f93c['userProfileId']=_0x16197e[_0x2ede('0x4c')]['id'];return _0x13f93c;});var _0xbe1575=[];return BPromise[_0x2ede('0x63')](_0x4ee835,function(_0x57009b){return db['UserProfileSection'][_0x2ede('0x4f')](_0x57009b,{'include':[{'model':db['UserProfileResource'],'as':_0x2ede('0x5c')}],'raw':!![],'transaction':_0x5e0511})[_0x2ede('0x2a')](function(_0x1cb6ae){_0xbe1575['push'](_0x1cb6ae[_0x2ede('0x52')]({'plain':!![]}));});})[_0x2ede('0x2a')](function(){return _0xbe1575;});});});}})['then'](function(_0x2ad3b7){return _0x2ad3b7;})[_0x2ede('0x2a')](respondWithResult(_0x3693c6,null))['catch'](handleError(_0x3693c6,null));};exports[_0x2ede('0x64')]=function(_0x2222c8,_0x1c5342){var _0x526c30;return db[_0x2ede('0x46')]['find']({'where':{'id':_0x2222c8[_0x2ede('0x4c')]['id']},'attributes':['id','name']})[_0x2ede('0x2a')](handleEntityNotFound(_0x1c5342,null))[_0x2ede('0x2a')](function(_0x5090f0){if(_0x5090f0){_0x526c30=_0x5090f0;return db[_0x2ede('0x62')]['destroy']({'where':{'userProfileId':_0x2222c8[_0x2ede('0x4c')]['id'],'sectionId':_0x2222c8[_0x2ede('0x37')][_0x2ede('0x65')]}});}})[_0x2ede('0x2a')](function(){return _0x526c30;})[_0x2ede('0x2a')](respondWithStatusCode(_0x1c5342,null))[_0x2ede('0x4e')](handleError(_0x1c5342,null));};exports[_0x2ede('0x66')]=function(_0x1990e2,_0xf174d7){var _0xf5ab9d=[];var _0x8f4c99=[];return db[_0x2ede('0x62')][_0x2ede('0x49')]({'where':{'userProfileId':_0x1990e2['params']['id']},'raw':!![]})[_0x2ede('0x2a')](function(_0x5bf3b2){_0xf5ab9d=_[_0x2ede('0x41')](_0x5bf3b2,function(_0xd12005){return _0xd12005[_0x2ede('0x67')]===0x1||_['includes']([0x3eb,0x709],_0xd12005[_0x2ede('0x5a')]);});if(!_[_0x2ede('0x68')](_0xf5ab9d)){return _[_0x2ede('0x30')](_0xf5ab9d,function(_0x1cef6a){return _0x1cef6a[_0x2ede('0x5a')];});}else{return;}})[_0x2ede('0x2a')](function(_0x531335){if(_0x531335)_0x8f4c99=_0x531335;if(_['includes'](_0x8f4c99,0x64)){var _0x4a1070=_[_0x2ede('0x4d')](_0xf5ab9d,{'sectionId':0x64});return hasDefaultDashboard(_0x4a1070)[_0x2ede('0x2a')](function(_0x26df8b){return _[_0x2ede('0x30')](_0xf5ab9d,function(_0x5acedd){if(_0x5acedd[_0x2ede('0x5a')]===0x64){_0x5acedd[_0x2ede('0x69')]=_0x26df8b;}return _0x5acedd;});});}else{return;}})[_0x2ede('0x2a')](function(_0x30e8e9){if(_0x30e8e9)_0xf5ab9d=_0x30e8e9;if(_[_0x2ede('0x6a')](_0x8f4c99,0x3eb)){var _0x26664b=_[_0x2ede('0x4d')](_0xf5ab9d,{'sectionId':0x3eb});return getCustomDashboards(_0x26664b)[_0x2ede('0x2a')](function(_0x1b629e){return _[_0x2ede('0x30')](_0xf5ab9d,function(_0x56fa73){if(_0x26664b[_0x2ede('0x67')]){if(_0x56fa73[_0x2ede('0x5a')]===0x3eb){_0x56fa73[_0x2ede('0x69')]=_0x1b629e;}}else{if(_0x56fa73[_0x2ede('0x5a')]===0x64){if(!_0x56fa73[_0x2ede('0x69')]){_0x56fa73[_0x2ede('0x69')]=[];}_0x56fa73['subsections']=_0x56fa73[_0x2ede('0x69')][_0x2ede('0x6b')](_0x1b629e);}}return _0x56fa73;});});}else{return;}})['then'](function(_0x4a2946){if(_0x4a2946)_0xf5ab9d=_0x4a2946;if(_['includes'](_0x8f4c99,0x709)){var _0x34a049=_[_0x2ede('0x4d')](_0xf5ab9d,{'sectionId':0x709});return getPlugins(_0x34a049)[_0x2ede('0x2a')](function(_0x463d4e){if(_0x34a049[_0x2ede('0x67')]){return _[_0x2ede('0x30')](_0xf5ab9d,function(_0x57871d){if(_0x57871d[_0x2ede('0x5a')]===0x709){_0x57871d[_0x2ede('0x69')]=_0x463d4e;}return _0x57871d;});}else{var _0x1aede4={'sectionId':0x76c,'enabled':0x1,'subsections':_0x463d4e};var _0x4ca6d8=_[_0x2ede('0x30')](_0xf5ab9d);_0x4ca6d8[_0x2ede('0x6c')](_0x1aede4);return _0x4ca6d8;}});}else{return;}})[_0x2ede('0x2a')](function(_0x432978){if(_0x432978)_0xf5ab9d=_0x432978;return _[_0x2ede('0x41')](_0xf5ab9d,[_0x2ede('0x67'),0x1]);})[_0x2ede('0x2a')](respondWithResult(_0xf174d7,null))[_0x2ede('0x4e')](handleError(_0xf174d7,null));};function hasDefaultDashboard(_0x4041d1){var _0x401202=[0x65];return new BPromise(function(_0x304579,_0x248eec){try{if(_0x4041d1[_0x2ede('0x59')]){_0x304579(_0x401202);}else{return db[_0x2ede('0x5d')][_0x2ede('0x6d')]({'where':{'sectionId':_0x4041d1['id']},'raw':!![]})[_0x2ede('0x2a')](function(_0x4a6a5c){_0x4a6a5c?_0x304579(_0x401202):_0x304579();});}}catch(_0x49d34a){_0x248eec(_0x49d34a);}});}function getCustomDashboards(_0x5a8fec){var _0x14fb7f=[];return new BPromise(function(_0x1b3d42,_0x3cdac8){try{if(_0x5a8fec[_0x2ede('0x59')]){return db[_0x2ede('0x6e')][_0x2ede('0x49')]({'raw':!![]})[_0x2ede('0x2a')](function(_0x5d82d3){_0x5d82d3[_0x2ede('0x6f')](function(_0x1fce35){_0x14fb7f[_0x2ede('0x6c')](_0x1fce35['id']+0x1869f);});_0x1b3d42(_0x14fb7f);});}else{return db[_0x2ede('0x5d')]['findAll']({'where':{'sectionId':_0x5a8fec['id']},'raw':!![]})['then'](function(_0x243172){_0x243172[_0x2ede('0x6f')](function(_0x49d219){_0x14fb7f[_0x2ede('0x6c')](_0x49d219[_0x2ede('0x70')]+0x1869f);});_0x1b3d42(_0x14fb7f);});}}catch(_0x1f9a9b){_0x3cdac8(_0x1f9a9b);}});}function getPlugins(_0x14a403){var _0x42cc82=[];return new BPromise(function(_0x44b2cb,_0x2045f4){try{if(_0x14a403[_0x2ede('0x59')]){return db[_0x2ede('0x71')][_0x2ede('0x49')]({'raw':!![]})[_0x2ede('0x2a')](function(_0xaa0157){_0xaa0157[_0x2ede('0x6f')](function(_0x518fef){_0x42cc82['push'](_0x518fef['id']+0x15b38);});_0x44b2cb(_0x42cc82);});}else{return db[_0x2ede('0x5d')]['findAll']({'where':{'sectionId':_0x14a403['id']},'raw':!![]})['then'](function(_0x7b089c){_0x7b089c[_0x2ede('0x6f')](function(_0x331aa8){_0x42cc82[_0x2ede('0x6c')](_0x331aa8['resourceId']+0x15b38);});_0x44b2cb(_0x42cc82);});}}catch(_0x4038e9){_0x2045f4(_0x4038e9);}});}exports[_0x2ede('0x72')]=function(_0x16bd5a,_0x1ea821){return db[_0x2ede('0x46')][_0x2ede('0x4d')]({'where':{'id':_0x16bd5a['params']['id']}})['then'](handleEntityNotFound(_0x1ea821,null))['then'](function(_0x1c2724){if(_0x1c2724){return db['sequelize'][_0x2ede('0x58')](function(_0x35533b){return db[_0x2ede('0x62')][_0x2ede('0x49')]({'where':{'userProfileId':_0x16bd5a[_0x2ede('0x4c')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4298fe){if(_0x4298fe){return db[_0x2ede('0x62')][_0x2ede('0x5f')]({'where':{'userProfileId':_0x16bd5a[_0x2ede('0x4c')]['id'],'id':_[_0x2ede('0x30')](_0x4298fe,function(_0x684952){return _0x684952['id'];})},'transaction':_0x35533b});}})[_0x2ede('0x2a')](function(_0x42ebd5){var _0x3baa93=_[_0x2ede('0x30')](_0x16bd5a['body'],function(_0x41d0ba){_0x41d0ba['userProfileId']=_0x16bd5a['params']['id'];return _0x41d0ba;});return db[_0x2ede('0x62')][_0x2ede('0x73')](_0x3baa93,{'raw':!![],'transaction':_0x35533b});})[_0x2ede('0x2a')](function(_0x323c1d){var _0x327925=_[_0x2ede('0x41')](_[_0x2ede('0x30')](_0x323c1d,function(_0x3a3408){return _0x3a3408[_0x2ede('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x327925){return db[_0x2ede('0x62')]['findAll']({'where':{'userProfileId':_0x16bd5a[_0x2ede('0x4c')]['id'],'sectionId':_['map'](_0x327925,function(_0x1f41bd){return _0x1f41bd[_0x2ede('0x5a')];})},'attributes':['id',_0x2ede('0x5a')],'raw':!![]})['then'](function(_0x4ae936){var _0x3fbee7=_[_0x2ede('0x30')](_0x16bd5a[_0x2ede('0x50')],function(_0x339607){_0x339607[_0x2ede('0x5b')]=_0x16bd5a[_0x2ede('0x4c')]['id'];return _0x339607;});return db['UserProfileResource'][_0x2ede('0x73')](_0x3fbee7,{'raw':!![],'transaction':_0x35533b});});}})[_0x2ede('0x4e')](handleError(_0x1ea821,null));});}})[_0x2ede('0x2a')](function(_0x1392cb){var _0x25450a=_[_0x2ede('0x30')](_0x1392cb,function(_0x4c3119){return _0x4c3119['get']({'plain':!![]});});})['then'](respondWithResult(_0x1ea821,null))[_0x2ede('0x4e')](handleError(_0x1ea821,null));};exports[_0x2ede('0x74')]=function(_0x2244b4,_0x2dbaba,_0x121420){return db[_0x2ede('0x46')]['find']({'where':{'id':_0x2244b4[_0x2ede('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2dbaba,null))[_0x2ede('0x2a')](function(_0x61f691){if(_0x61f691){return _0x61f691['removeResources'](_0x2244b4[_0x2ede('0x37')][_0x2ede('0x65')]);}})['then'](respondWithStatusCode(_0x2dbaba,null))[_0x2ede('0x4e')](handleError(_0x2dbaba,null));};exports[_0x2ede('0x75')]=function(_0x2563dc,_0x3b3ec1){var _0x9f01bc={};if(!_0x2563dc['query'][_0x2ede('0x76')])throw new Error(_0x2ede('0x77'));if(!_0x2563dc[_0x2ede('0x37')][_0x2ede('0x3d')](_0x2ede('0x78'))){_0x9f01bc[_0x2ede('0x24')]=qs[_0x2ede('0x24')](_0x2563dc[_0x2ede('0x37')][_0x2ede('0x24')]);_0x9f01bc[_0x2ede('0x22')]=qs[_0x2ede('0x22')](_0x2563dc[_0x2ede('0x37')][_0x2ede('0x22')]);}return db[_0x2ede('0x46')][_0x2ede('0x4d')]({'where':{'id':_0x2563dc['params']['id']}})[_0x2ede('0x2a')](function(_0x19ec79){if(!_0x19ec79)throw new Error(_0x2ede('0x79')+_0x2563dc['params']['id']);return db['UserProfile']['getResources'](_0x2563dc);})['then'](respondWithFilteredResult(_0x3b3ec1,_0x9f01bc))[_0x2ede('0x4e')](handleError(_0x3b3ec1,null));}; \ No newline at end of file +var _0xb453=['lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','name','send','index','UserProfile','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','clone','includeAll','include','omit','createdAt','crudPermissions','updatedAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','sequelize','push','ids','getSections','enabled','includes','isEmpty','subsections','concat','forEach','resourceId','addResources','bulkCreate','get','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra'];(function(_0x22981b,_0xeb458d){var _0x57d79c=function(_0x1baad7){while(--_0x1baad7){_0x22981b['push'](_0x22981b['shift']());}};_0x57d79c(++_0xeb458d);}(_0xb453,0x68));var _0x3b45=function(_0x561900,_0x579599){_0x561900=_0x561900-0x0;var _0x4a0f7c=_0xb453[_0x561900];return _0x4a0f7c;};'use strict';var emlformat=require(_0x3b45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b45('0x1'));var jsonpatch=require(_0x3b45('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3b45('0x3'));var Mustache=require('mustache');var util=require(_0x3b45('0x4'));var path=require(_0x3b45('0x5'));var sox=require(_0x3b45('0x6'));var csv=require('to-csv');var ejs=require(_0x3b45('0x7'));var fs=require('fs');var fs_extra=require(_0x3b45('0x8'));var _=require(_0x3b45('0x9'));var squel=require('squel');var crypto=require(_0x3b45('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3b45('0xb'));var toCsv=require(_0x3b45('0xc'));var querystring=require('querystring');var Papa=require(_0x3b45('0xd'));var Redis=require(_0x3b45('0xe'));var authService=require(_0x3b45('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b45('0x10'));var logger=require('../../config/logger')(_0x3b45('0x11'));var utils=require(_0x3b45('0x12'));var config=require(_0x3b45('0x13'));var licenseUtil=require(_0x3b45('0x14'));var db=require('../../mysqldb')['db'];config[_0x3b45('0x15')]=_[_0x3b45('0x16')](config['redis'],{'host':_0x3b45('0x17'),'port':0x18eb});var socket=require(_0x3b45('0x18'))(new Redis(config[_0x3b45('0x15')]));require(_0x3b45('0x19'))[_0x3b45('0x1a')](socket);function respondWithStatusCode(_0x26b476,_0x4dff42){_0x4dff42=_0x4dff42||0xcc;return function(_0x30bf97){if(_0x30bf97){return _0x26b476[_0x3b45('0x1b')](_0x4dff42);}return _0x26b476[_0x3b45('0x1c')](_0x4dff42)[_0x3b45('0x1d')]();};}function respondWithResult(_0x3f3d35,_0x41e804){_0x41e804=_0x41e804||0xc8;return function(_0x34fd65){if(_0x34fd65){return _0x3f3d35[_0x3b45('0x1c')](_0x41e804)[_0x3b45('0x1e')](_0x34fd65);}};}function respondWithFilteredResult(_0x19586f,_0x5ec321){return function(_0x445b04){if(_0x445b04){var _0x5b1106=typeof _0x5ec321[_0x3b45('0x1f')]===_0x3b45('0x20')&&typeof _0x5ec321[_0x3b45('0x21')]==='undefined';var _0x32daf7=_0x445b04[_0x3b45('0x22')];var _0x37beec=_0x5b1106?0x0:_0x5ec321[_0x3b45('0x1f')];var _0x2c1965=_0x5b1106?_0x445b04[_0x3b45('0x22')]:_0x5ec321[_0x3b45('0x1f')]+_0x5ec321[_0x3b45('0x21')];var _0x6d78f0;if(_0x2c1965>=_0x32daf7){_0x2c1965=_0x32daf7;_0x6d78f0=0xc8;}else{_0x6d78f0=0xce;}_0x19586f[_0x3b45('0x1c')](_0x6d78f0);return _0x19586f[_0x3b45('0x23')](_0x3b45('0x24'),_0x37beec+'-'+_0x2c1965+'/'+_0x32daf7)[_0x3b45('0x1e')](_0x445b04);}return null;};}function patchUpdates(_0x16e306){return function(_0x3885bd){try{jsonpatch[_0x3b45('0x25')](_0x3885bd,_0x16e306,!![]);}catch(_0x425cb8){return BPromise[_0x3b45('0x26')](_0x425cb8);}return _0x3885bd[_0x3b45('0x27')]();};}function saveUpdates(_0x329ca7,_0x1c2ee4){return function(_0x4d57d3){if(_0x4d57d3){return _0x4d57d3[_0x3b45('0x28')](_0x329ca7)['then'](function(_0x225139){return _0x225139;});}return null;};}function removeEntity(_0xc7cc5a,_0xbe3435){return function(_0x335b75){if(_0x335b75){return _0x335b75['destroy']()['then'](function(){_0xc7cc5a[_0x3b45('0x1c')](0xcc)[_0x3b45('0x1d')]();});}};}function handleEntityNotFound(_0x57793f,_0x48d8e4){return function(_0x123fc8){if(!_0x123fc8){_0x57793f[_0x3b45('0x1b')](0x194);}return _0x123fc8;};}function handleError(_0x12a164,_0x4a568d){_0x4a568d=_0x4a568d||0x1f4;return function(_0x19ecde){logger[_0x3b45('0x29')](_0x19ecde['stack']);if(_0x19ecde[_0x3b45('0x2a')]){delete _0x19ecde[_0x3b45('0x2a')];}_0x12a164['status'](_0x4a568d)[_0x3b45('0x2b')](_0x19ecde);};}exports[_0x3b45('0x2c')]=function(_0x1f635c,_0x38e941){var _0x2256e9={},_0x268cc8={},_0x24caa3={'count':0x0,'rows':[]};var _0x503fae=_['map'](db[_0x3b45('0x2d')][_0x3b45('0x2e')],function(_0x56c692){return{'name':_0x56c692[_0x3b45('0x2f')],'type':_0x56c692[_0x3b45('0x30')][_0x3b45('0x31')]};});_0x268cc8['model']=_['map'](_0x503fae,'name');_0x268cc8[_0x3b45('0x32')]=_[_0x3b45('0x33')](_0x1f635c[_0x3b45('0x32')]);_0x268cc8['filters']=_[_0x3b45('0x34')](_0x268cc8[_0x3b45('0x35')],_0x268cc8[_0x3b45('0x32')]);_0x2256e9['attributes']=_[_0x3b45('0x34')](_0x268cc8[_0x3b45('0x35')],qs[_0x3b45('0x36')](_0x1f635c[_0x3b45('0x32')][_0x3b45('0x36')]));_0x2256e9[_0x3b45('0x37')]=_0x2256e9[_0x3b45('0x37')][_0x3b45('0x38')]?_0x2256e9[_0x3b45('0x37')]:_0x268cc8[_0x3b45('0x35')];if(!_0x1f635c[_0x3b45('0x32')][_0x3b45('0x39')](_0x3b45('0x3a'))){_0x2256e9[_0x3b45('0x21')]=qs[_0x3b45('0x21')](_0x1f635c[_0x3b45('0x32')][_0x3b45('0x21')]);_0x2256e9[_0x3b45('0x1f')]=qs[_0x3b45('0x1f')](_0x1f635c[_0x3b45('0x32')][_0x3b45('0x1f')]);}_0x2256e9[_0x3b45('0x3b')]=qs[_0x3b45('0x3c')](_0x1f635c['query'][_0x3b45('0x3c')]);_0x2256e9[_0x3b45('0x3d')]=qs[_0x3b45('0x3e')](_[_0x3b45('0x3f')](_0x1f635c[_0x3b45('0x32')],_0x268cc8[_0x3b45('0x3e')]),_0x503fae);if(_0x1f635c['query'][_0x3b45('0x40')]){_0x2256e9[_0x3b45('0x3d')]=_[_0x3b45('0x41')](_0x2256e9[_0x3b45('0x3d')],{'$or':_[_0x3b45('0x42')](_0x503fae,function(_0x10c9d0){if(_0x10c9d0['type']!==_0x3b45('0x43')){var _0x5e0bc0={};_0x5e0bc0[_0x10c9d0[_0x3b45('0x2a')]]={'$like':'%'+_0x1f635c[_0x3b45('0x32')][_0x3b45('0x40')]+'%'};return _0x5e0bc0;}})});}_0x2256e9=_['merge']({},_0x2256e9,_0x1f635c[_0x3b45('0x44')]);var _0x1bc831={'where':_0x2256e9[_0x3b45('0x3d')]};return db[_0x3b45('0x2d')][_0x3b45('0x22')](_0x1bc831)[_0x3b45('0x45')](function(_0x580f52){_0x24caa3[_0x3b45('0x22')]=_0x580f52;if(_0x1f635c[_0x3b45('0x32')]['includeAll']){_0x2256e9['include']=[{'all':!![]}];}return db[_0x3b45('0x2d')][_0x3b45('0x46')](_0x2256e9);})['then'](function(_0x350237){_0x24caa3['rows']=_0x350237;return _0x24caa3;})['then'](respondWithFilteredResult(_0x38e941,_0x2256e9))[_0x3b45('0x47')](handleError(_0x38e941,null));};exports[_0x3b45('0x48')]=function(_0x4bd10c,_0x52f0f8){var _0x4d53a9={'raw':![],'where':{'id':_0x4bd10c[_0x3b45('0x49')]['id']}},_0xaac662={};_0xaac662[_0x3b45('0x35')]=_[_0x3b45('0x33')](db[_0x3b45('0x2d')][_0x3b45('0x2e')]);_0xaac662[_0x3b45('0x32')]=_['keys'](_0x4bd10c['query']);_0xaac662[_0x3b45('0x3e')]=_['intersection'](_0xaac662['model'],_0xaac662['query']);_0x4d53a9[_0x3b45('0x37')]=_[_0x3b45('0x34')](_0xaac662[_0x3b45('0x35')],qs[_0x3b45('0x36')](_0x4bd10c[_0x3b45('0x32')][_0x3b45('0x36')]));_0x4d53a9['attributes']=_0x4d53a9[_0x3b45('0x37')][_0x3b45('0x38')]?_0x4d53a9[_0x3b45('0x37')]:_0xaac662['model'];if(_0x4bd10c[_0x3b45('0x32')]['includeAll']){_0x4d53a9['include']=[{'all':!![]}];}_0x4d53a9=_[_0x3b45('0x41')]({},_0x4d53a9,_0x4bd10c[_0x3b45('0x44')]);return db[_0x3b45('0x2d')][_0x3b45('0x4a')](_0x4d53a9)['then'](handleEntityNotFound(_0x52f0f8,null))[_0x3b45('0x45')](respondWithResult(_0x52f0f8,null))[_0x3b45('0x47')](handleError(_0x52f0f8,null));};exports[_0x3b45('0x4b')]=function(_0x983118,_0xb601b4){return db[_0x3b45('0x2d')]['create'](_0x983118[_0x3b45('0x4c')],{})[_0x3b45('0x45')](respondWithResult(_0xb601b4,0xc9))[_0x3b45('0x47')](handleError(_0xb601b4,null));};exports[_0x3b45('0x4d')]=function(_0x358467,_0x44bcde){var _0xf3875c={'where':{'id':_0x358467[_0x3b45('0x49')]['id']}},_0x5097d2={};_0x5097d2[_0x3b45('0x35')]=_[_0x3b45('0x33')](db['UserProfile'][_0x3b45('0x2e')]);_0xf3875c['attributes']=_[_0x3b45('0x34')](_0x5097d2[_0x3b45('0x35')],qs[_0x3b45('0x36')](_0x358467[_0x3b45('0x32')][_0x3b45('0x36')]));_0xf3875c['attributes']=_0xf3875c[_0x3b45('0x37')][_0x3b45('0x38')]?_0xf3875c[_0x3b45('0x37')]:_0x5097d2[_0x3b45('0x35')];if(_0x358467['query'][_0x3b45('0x4e')]){_0xf3875c[_0x3b45('0x4f')]=[{'all':!![]}];}_0xf3875c=_['merge']({},_0xf3875c,_0x358467[_0x3b45('0x44')]);return db[_0x3b45('0x2d')][_0x3b45('0x4a')](_0xf3875c)[_0x3b45('0x45')](handleEntityNotFound(_0x44bcde,null))[_0x3b45('0x45')](function(_0x1e4929){if(_0x1e4929){var _0x13966f=_0x1e4929['get']({'plain':!![]});_0x13966f=qs[_0x3b45('0x50')](_0x13966f,['id',_0x3b45('0x51'),'updatedAt',_0x3b45('0x52')]);_0x358467[_0x3b45('0x4c')]=_[_0x3b45('0x50')](_0x358467[_0x3b45('0x4c')],['id',_0x3b45('0x51'),_0x3b45('0x53')]);return db['sequelize'][_0x3b45('0x54')](function(_0x300654){return db[_0x3b45('0x2d')][_0x3b45('0x4b')](_[_0x3b45('0x41')](_0x13966f,_0x358467[_0x3b45('0x4c')]),{'include':_0x358467[_0x3b45('0x32')][_0x3b45('0x4e')]?[{'all':!![]}]:undefined,'transaction':_0x300654})[_0x3b45('0x45')](function(_0x5ab5ff){var _0x334888=_0x5ab5ff['get']({'plain':!![]});return db[_0x3b45('0x55')][_0x3b45('0x46')]({'where':{'userProfileId':_0x358467[_0x3b45('0x49')]['id']},'raw':!![]})[_0x3b45('0x45')](function(_0x487277){if(_0x487277){return BPromise[_0x3b45('0x56')](_0x487277,function(_0x46aad8){return new BPromise(function(_0x1520f3,_0x307317){if(_0x46aad8['autoAssociation']===null||_0x46aad8[_0x3b45('0x57')]===0x1)_0x1520f3(null);return db[_0x3b45('0x58')][_0x3b45('0x46')]({'where':{'sectionId':_0x46aad8['id']},'raw':!![]})[_0x3b45('0x45')](function(_0x5f0cfe){var _0x4d607d=_[_0x3b45('0x42')](_0x5f0cfe,function(_0x34d9d9){return qs[_0x3b45('0x50')](_0x34d9d9,['id',_0x3b45('0x51'),_0x3b45('0x53'),_0x3b45('0x59')]);});_0x1520f3(_0x4d607d);})['catch'](function(_0x551cee){_0x307317(_0x551cee);});})[_0x3b45('0x45')](function(_0x2f5b30){var _0x5236ce=qs['omit'](_0x46aad8,['id','createdAt',_0x3b45('0x53')]);_0x5236ce[_0x3b45('0x5a')]=_0x334888['id'];if(_0x2f5b30)_0x5236ce['Resources']=_0x2f5b30;return _0x5236ce;})[_0x3b45('0x45')](function(_0x2a979f){return db[_0x3b45('0x55')]['create'](_0x2a979f,{'include':[{'model':db[_0x3b45('0x58')],'as':_0x3b45('0x5b')}],'raw':!![],'transaction':_0x300654});});})[_0x3b45('0x45')](function(){return _0x334888;});}});});});}})[_0x3b45('0x45')](respondWithResult(_0x44bcde,0xc9))[_0x3b45('0x47')](handleError(_0x44bcde,null));};exports[_0x3b45('0x28')]=function(_0x47bda3,_0x582667){if(_0x47bda3['body']['id']){delete _0x47bda3[_0x3b45('0x4c')]['id'];}return db[_0x3b45('0x2d')]['find']({'where':{'id':_0x47bda3[_0x3b45('0x49')]['id']}})[_0x3b45('0x45')](handleEntityNotFound(_0x582667,null))['then'](saveUpdates(_0x47bda3[_0x3b45('0x4c')],null))['then'](respondWithResult(_0x582667,null))[_0x3b45('0x47')](handleError(_0x582667,null));};exports[_0x3b45('0x5c')]=function(_0x5c4067,_0x45c22f){return db[_0x3b45('0x2d')]['find']({'where':{'id':_0x5c4067[_0x3b45('0x49')]['id']}})[_0x3b45('0x45')](handleEntityNotFound(_0x45c22f,null))[_0x3b45('0x45')](removeEntity(_0x45c22f,null))['catch'](handleError(_0x45c22f,null));};exports['describe']=function(_0x16fe2e,_0x5b1716){return db[_0x3b45('0x2d')][_0x3b45('0x5d')]()[_0x3b45('0x45')](respondWithResult(_0x5b1716,null))[_0x3b45('0x47')](handleError(_0x5b1716,null));};exports[_0x3b45('0x5e')]=function(_0xfb1742,_0x2da002){var _0x5bfb43=_0xfb1742[_0x3b45('0x4c')];return db[_0x3b45('0x2d')][_0x3b45('0x4a')]({'where':{'id':_0xfb1742[_0x3b45('0x49')]['id']}})['then'](handleEntityNotFound(_0x2da002,null))[_0x3b45('0x45')](function(_0x3b98c5){if(_0x3b98c5){return db[_0x3b45('0x5f')][_0x3b45('0x54')](function(_0x5d7fe6){return db[_0x3b45('0x55')][_0x3b45('0x5c')]({'where':{'userProfileId':_0xfb1742['params']['id'],'sectionId':_['map'](_0x5bfb43,function(_0x344cc4){return _0x344cc4[_0x3b45('0x59')];})},'transaction':_0x5d7fe6})[_0x3b45('0x45')](function(){var _0x2edbc9=_[_0x3b45('0x42')](_0x5bfb43,function(_0x127d7d){_0x127d7d[_0x3b45('0x5a')]=_0xfb1742[_0x3b45('0x49')]['id'];return _0x127d7d;});var _0x3bda28=[];return BPromise[_0x3b45('0x56')](_0x2edbc9,function(_0x3e5c73){return db[_0x3b45('0x55')][_0x3b45('0x4b')](_0x3e5c73,{'include':[{'model':db['UserProfileResource'],'as':_0x3b45('0x5b')}],'raw':!![],'transaction':_0x5d7fe6})[_0x3b45('0x45')](function(_0x5a8570){_0x3bda28[_0x3b45('0x60')](_0x5a8570['get']({'plain':!![]}));});})[_0x3b45('0x45')](function(){return _0x3bda28;});});});}})[_0x3b45('0x45')](function(_0x378ac1){return _0x378ac1;})[_0x3b45('0x45')](respondWithResult(_0x2da002,null))['catch'](handleError(_0x2da002,null));};exports['removeSections']=function(_0x36d547,_0x4700b3){var _0x2e6859;return db[_0x3b45('0x2d')][_0x3b45('0x4a')]({'where':{'id':_0x36d547['params']['id']},'attributes':['id',_0x3b45('0x2a')]})[_0x3b45('0x45')](handleEntityNotFound(_0x4700b3,null))[_0x3b45('0x45')](function(_0x6abfaf){if(_0x6abfaf){_0x2e6859=_0x6abfaf;return db[_0x3b45('0x55')]['destroy']({'where':{'userProfileId':_0x36d547[_0x3b45('0x49')]['id'],'sectionId':_0x36d547[_0x3b45('0x32')][_0x3b45('0x61')]}});}})['then'](function(){return _0x2e6859;})[_0x3b45('0x45')](respondWithStatusCode(_0x4700b3,null))[_0x3b45('0x47')](handleError(_0x4700b3,null));};exports[_0x3b45('0x62')]=function(_0x3940a1,_0x524b3f){var _0x265551=[];var _0x21e251=[];return db['UserProfileSection'][_0x3b45('0x46')]({'where':{'userProfileId':_0x3940a1[_0x3b45('0x49')]['id']},'raw':!![]})['then'](function(_0x46d109){_0x265551=_['filter'](_0x46d109,function(_0x327736){return _0x327736[_0x3b45('0x63')]===0x1||_[_0x3b45('0x64')]([0x3eb,0x709],_0x327736[_0x3b45('0x59')]);});if(!_[_0x3b45('0x65')](_0x265551)){return _[_0x3b45('0x42')](_0x265551,function(_0x2e893f){return _0x2e893f[_0x3b45('0x59')];});}else{return;}})[_0x3b45('0x45')](function(_0x4920ed){if(_0x4920ed)_0x21e251=_0x4920ed;if(_[_0x3b45('0x64')](_0x21e251,0x64)){var _0x4e6742=_[_0x3b45('0x4a')](_0x265551,{'sectionId':0x64});return hasDefaultDashboard(_0x4e6742)['then'](function(_0x5f3aa5){return _[_0x3b45('0x42')](_0x265551,function(_0x5c22d7){if(_0x5c22d7[_0x3b45('0x59')]===0x64){_0x5c22d7[_0x3b45('0x66')]=_0x5f3aa5;}return _0x5c22d7;});});}else{return;}})[_0x3b45('0x45')](function(_0xf653ea){if(_0xf653ea)_0x265551=_0xf653ea;if(_['includes'](_0x21e251,0x3eb)){var _0x355818=_['find'](_0x265551,{'sectionId':0x3eb});return getCustomDashboards(_0x355818)[_0x3b45('0x45')](function(_0x45faf5){return _[_0x3b45('0x42')](_0x265551,function(_0x3c465f){if(_0x355818[_0x3b45('0x63')]){if(_0x3c465f[_0x3b45('0x59')]===0x3eb){_0x3c465f[_0x3b45('0x66')]=_0x45faf5;}}else{if(_0x3c465f[_0x3b45('0x59')]===0x64){if(!_0x3c465f[_0x3b45('0x66')]){_0x3c465f[_0x3b45('0x66')]=[];}_0x3c465f[_0x3b45('0x66')]=_0x3c465f['subsections'][_0x3b45('0x67')](_0x45faf5);}}return _0x3c465f;});});}else{return;}})[_0x3b45('0x45')](function(_0x3342ae){if(_0x3342ae)_0x265551=_0x3342ae;if(_[_0x3b45('0x64')](_0x21e251,0x709)){var _0x1ac3dd=_[_0x3b45('0x4a')](_0x265551,{'sectionId':0x709});return getPlugins(_0x1ac3dd)['then'](function(_0x1ffe90){if(_0x1ac3dd[_0x3b45('0x63')]){return _[_0x3b45('0x42')](_0x265551,function(_0x241637){if(_0x241637['sectionId']===0x709){_0x241637[_0x3b45('0x66')]=_0x1ffe90;}return _0x241637;});}else{var _0x3408e0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1ffe90};var _0x250d9c=_[_0x3b45('0x42')](_0x265551);_0x250d9c[_0x3b45('0x60')](_0x3408e0);return _0x250d9c;}});}else{return;}})[_0x3b45('0x45')](function(_0xfa67e2){if(_0xfa67e2)_0x265551=_0xfa67e2;return _['filter'](_0x265551,['enabled',0x1]);})['then'](respondWithResult(_0x524b3f,null))[_0x3b45('0x47')](handleError(_0x524b3f,null));};function hasDefaultDashboard(_0x358bec){var _0xce46e1=[0x65];return new BPromise(function(_0x524ebb,_0x12e4ab){try{if(_0x358bec['autoAssociation']){_0x524ebb(_0xce46e1);}else{return db[_0x3b45('0x58')]['findOne']({'where':{'sectionId':_0x358bec['id']},'raw':!![]})[_0x3b45('0x45')](function(_0x16014a){_0x16014a?_0x524ebb(_0xce46e1):_0x524ebb();});}}catch(_0x7b1646){_0x12e4ab(_0x7b1646);}});}function getCustomDashboards(_0x1ee7e5){var _0x800e11=[];return new BPromise(function(_0x3651e3,_0x4a820a){try{if(_0x1ee7e5['autoAssociation']){return db['Dashboard']['findAll']({'raw':!![]})[_0x3b45('0x45')](function(_0x282270){_0x282270[_0x3b45('0x68')](function(_0x462cd4){_0x800e11['push'](_0x462cd4['id']+0x1869f);});_0x3651e3(_0x800e11);});}else{return db['UserProfileResource'][_0x3b45('0x46')]({'where':{'sectionId':_0x1ee7e5['id']},'raw':!![]})[_0x3b45('0x45')](function(_0x415a21){_0x415a21[_0x3b45('0x68')](function(_0x2ca51f){_0x800e11[_0x3b45('0x60')](_0x2ca51f[_0x3b45('0x69')]+0x1869f);});_0x3651e3(_0x800e11);});}}catch(_0x5b669e){_0x4a820a(_0x5b669e);}});}function getPlugins(_0x889860){var _0x3ad6c2=[];return new BPromise(function(_0x5149aa,_0x30c15d){try{if(_0x889860['autoAssociation']){return db['Plugin'][_0x3b45('0x46')]({'raw':!![]})[_0x3b45('0x45')](function(_0x4702a3){_0x4702a3[_0x3b45('0x68')](function(_0x1a8334){_0x3ad6c2[_0x3b45('0x60')](_0x1a8334['id']+0x15b38);});_0x5149aa(_0x3ad6c2);});}else{return db[_0x3b45('0x58')]['findAll']({'where':{'sectionId':_0x889860['id']},'raw':!![]})['then'](function(_0xc7adad){_0xc7adad['forEach'](function(_0x1c6964){_0x3ad6c2[_0x3b45('0x60')](_0x1c6964['resourceId']+0x15b38);});_0x5149aa(_0x3ad6c2);});}}catch(_0x2cbc53){_0x30c15d(_0x2cbc53);}});}exports[_0x3b45('0x6a')]=function(_0x410d21,_0x2ecf5){return db[_0x3b45('0x2d')][_0x3b45('0x4a')]({'where':{'id':_0x410d21[_0x3b45('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ecf5,null))[_0x3b45('0x45')](function(_0x1ef1fc){if(_0x1ef1fc){return db['sequelize'][_0x3b45('0x54')](function(_0x235a44){return db['UserProfileSection'][_0x3b45('0x46')]({'where':{'userProfileId':_0x410d21['params']['id']},'attributes':['id'],'raw':!![]})[_0x3b45('0x45')](function(_0x3bf3cf){if(_0x3bf3cf){return db[_0x3b45('0x55')][_0x3b45('0x5c')]({'where':{'userProfileId':_0x410d21[_0x3b45('0x49')]['id'],'id':_['map'](_0x3bf3cf,function(_0x1e759b){return _0x1e759b['id'];})},'transaction':_0x235a44});}})['then'](function(_0x2c2ead){var _0x211ae1=_[_0x3b45('0x42')](_0x410d21['body'],function(_0x1c75f4){_0x1c75f4[_0x3b45('0x5a')]=_0x410d21[_0x3b45('0x49')]['id'];return _0x1c75f4;});return db[_0x3b45('0x55')][_0x3b45('0x6b')](_0x211ae1,{'raw':!![],'transaction':_0x235a44});})[_0x3b45('0x45')](function(_0x3afe80){var _0x42da0e=_[_0x3b45('0x40')](_[_0x3b45('0x42')](_0x3afe80,function(_0x38609a){return _0x38609a[_0x3b45('0x6c')]({'plain':!![]});}),{'includeAll':![]});if(_0x42da0e){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x410d21[_0x3b45('0x49')]['id'],'sectionId':_[_0x3b45('0x42')](_0x42da0e,function(_0x522027){return _0x522027['sectionId'];})},'attributes':['id',_0x3b45('0x59')],'raw':!![]})[_0x3b45('0x45')](function(_0x594cea){var _0x2005fa=_[_0x3b45('0x42')](_0x410d21[_0x3b45('0x4c')],function(_0x5e8903){_0x5e8903[_0x3b45('0x5a')]=_0x410d21['params']['id'];return _0x5e8903;});return db[_0x3b45('0x58')]['bulkCreate'](_0x2005fa,{'raw':!![],'transaction':_0x235a44});});}})[_0x3b45('0x47')](handleError(_0x2ecf5,null));});}})[_0x3b45('0x45')](function(_0x51f6f3){var _0x39e6f3=_[_0x3b45('0x42')](_0x51f6f3,function(_0x17d188){return _0x17d188[_0x3b45('0x6c')]({'plain':!![]});});})[_0x3b45('0x45')](respondWithResult(_0x2ecf5,null))['catch'](handleError(_0x2ecf5,null));};exports[_0x3b45('0x6d')]=function(_0x3f123c,_0x354559,_0x450deb){return db[_0x3b45('0x2d')][_0x3b45('0x4a')]({'where':{'id':_0x3f123c[_0x3b45('0x49')]['id']}})[_0x3b45('0x45')](handleEntityNotFound(_0x354559,null))[_0x3b45('0x45')](function(_0x810263){if(_0x810263){return _0x810263[_0x3b45('0x6d')](_0x3f123c[_0x3b45('0x32')][_0x3b45('0x61')]);}})['then'](respondWithStatusCode(_0x354559,null))['catch'](handleError(_0x354559,null));};exports[_0x3b45('0x6e')]=function(_0x2fe056,_0x1321d3){var _0x47d2b9={};if(!_0x2fe056[_0x3b45('0x32')][_0x3b45('0x6f')])throw new Error(_0x3b45('0x70'));if(!_0x2fe056['query']['hasOwnProperty'](_0x3b45('0x3a'))){_0x47d2b9[_0x3b45('0x21')]=qs[_0x3b45('0x21')](_0x2fe056[_0x3b45('0x32')][_0x3b45('0x21')]);_0x47d2b9[_0x3b45('0x1f')]=qs[_0x3b45('0x1f')](_0x2fe056['query'][_0x3b45('0x1f')]);}return db[_0x3b45('0x2d')][_0x3b45('0x4a')]({'where':{'id':_0x2fe056[_0x3b45('0x49')]['id']}})[_0x3b45('0x45')](function(_0x41bab5){if(!_0x41bab5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x2fe056[_0x3b45('0x49')]['id']);return db[_0x3b45('0x2d')][_0x3b45('0x6e')](_0x2fe056);})[_0x3b45('0x45')](respondWithFilteredResult(_0x1321d3,_0x47d2b9))[_0x3b45('0x47')](handleError(_0x1321d3,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 5d0ba16..9a4c143 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 _0x1967=['exports','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2ef408,_0x19470c){var _0x36f2cc=function(_0x5d46ea){while(--_0x5d46ea){_0x2ef408['push'](_0x2ef408['shift']());}};_0x36f2cc(++_0x19470c);}(_0x1967,0x173));var _0x7196=function(_0x19c4ba,_0x3b008d){_0x19c4ba=_0x19c4ba-0x0;var _0x319c21=_0x1967[_0x19c4ba];return _0x319c21;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x7196('0x0'))['db'][_0x7196('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7196('0x2')](0x0);var events={'afterCreate':_0x7196('0x3'),'afterUpdate':_0x7196('0x4'),'afterDestroy':_0x7196('0x5')};function emitEvent(_0x302f34){return function(_0x1aaddd,_0x458ae8,_0x3ae43f){UserProfileEvents['emit'](_0x302f34+':'+_0x1aaddd['id'],_0x1aaddd);UserProfileEvents[_0x7196('0x6')](_0x302f34,_0x1aaddd);_0x3ae43f(null);};}for(var e in events){if(events[_0x7196('0x7')](e)){var event=events[e];UserProfile[_0x7196('0x8')](e,emitEvent(event));}}module[_0x7196('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x9264=['hasOwnProperty','hook','events','../../mysqldb','UserProfile','setMaxListeners','remove'];(function(_0x4d72b2,_0x140189){var _0x4f6fff=function(_0x37d1f4){while(--_0x37d1f4){_0x4d72b2['push'](_0x4d72b2['shift']());}};_0x4f6fff(++_0x140189);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4926('0x0'));var UserProfile=require(_0x4926('0x1'))['db'][_0x4926('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4926('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4926('0x4')};function emitEvent(_0x483fdd){return function(_0x49b167,_0x1a2246,_0x4e0848){UserProfileEvents['emit'](_0x483fdd+':'+_0x49b167['id'],_0x49b167);UserProfileEvents['emit'](_0x483fdd,_0x49b167);_0x4e0848(null);};}for(var e in events){if(events[_0x4926('0x5')](e)){var event=events[e];UserProfile[_0x4926('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index c9af45c..9ced233 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 _0xdca0=['OpenTabs','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','length','find','all','isEmpty','push','autoAssociation','keys','filters','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','color','tag','Agents','openTabs','chat','sms','dataValues','mail','openchannel','lodash','./userProfile.attributes','squel','models','field','filter','value','then','map','model','findAll','name','catch','resolve','UserProfileResource','associatedResources','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','contacts','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','internalroutes','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','role','agent','Telephones','membername','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','Campaign','MailQueue','mailaccounts','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','voicequeues','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','triggers','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','ui.createdAt','_interactions','where','ui.UserId\x20=\x20?','query','toString'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdca0,0xe6));var _0x0dca=function(_0x1b2bd2,_0x491f68){_0x1b2bd2=_0x1b2bd2-0x0;var _0x34a271=_0xdca0[_0x1b2bd2];return _0x34a271;};'use strict';var _=require(_0x0dca('0x0'));var attributes=require(_0x0dca('0x1'));var squel=require(_0x0dca('0x2'));module['exports']=function(_0x4598b1){var _0x4fd571=_0x4598b1[_0x0dca('0x3')];function _0xa55f45(_0x1269bc,_0x576d1c){return new Promise(function(_0x475cbf,_0x454efa){if(!_0x576d1c)return _0x475cbf(null);var _0x520157=_0x576d1c['filter']?{[_0x576d1c['filter'][_0x0dca('0x4')]]:_0x576d1c[_0x0dca('0x5')][_0x0dca('0x6')]}:undefined;return _0x4fd571[_0x1269bc]['findAll']({'where':_0x520157,'raw':!![]})[_0x0dca('0x7')](function(_0x266a2d){_0x576d1c['associatedResources']=_[_0x0dca('0x8')](_0x266a2d,'id');_0x475cbf(_0x576d1c);})['catch'](function(_0x4ee1be){_0x454efa(_0x4ee1be);});});}function _0x2fa6ee(_0x12cf3d,_0x10dafd){return new Promise(function(_0x351f10,_0x8179cf){var _0x4d3b2d=_0x12cf3d[_0x0dca('0x5')]?{[_0x12cf3d[_0x0dca('0x5')][_0x0dca('0x4')]]:_0x12cf3d[_0x0dca('0x5')][_0x0dca('0x6')]}:undefined;return _0x4fd571[_0x12cf3d[_0x0dca('0x9')]][_0x0dca('0xa')]({'where':_0x4d3b2d,'raw':!![]})['then'](function(_0x547e9d){_0x10dafd['associatedResources']=_[_0x0dca('0x8')](_0x547e9d,function(_0x218980){return _0x218980[_0x0dca('0xb')];});_0x351f10(_0x10dafd);})[_0x0dca('0xc')](function(_0x55a1c2){_0x8179cf(_0x55a1c2);});});}function _0x2b23dd(_0xfbd4ad,_0x270d1b,_0x342343){if(!_0x270d1b)return Promise[_0x0dca('0xd')](null);return new Promise(function(_0x95c407,_0x5748de){return _0x4fd571[_0x0dca('0xe')][_0x0dca('0xa')]({'where':{'sectionId':_0x270d1b['id']},'raw':!![]})[_0x0dca('0x7')](function(_0x5eef13){if(_0xfbd4ad['field']&&_0xfbd4ad['field']!=='id'){_0x270d1b[_0x0dca('0xf')]=_['map'](_0x5eef13,function(_0x5c22b9){return _0x5c22b9[_0xfbd4ad['field']];});}else{if(_0x342343===_0x0dca('0x10')){_0x270d1b[_0x0dca('0xf')]=_['map'](_0x5eef13,function(_0x1a7188){return{'id':_0x1a7188[_0x0dca('0x11')],'type':_0x1a7188[_0x0dca('0x12')]};});}else{_0x270d1b[_0x0dca('0xf')]=_[_0x0dca('0x8')](_0x5eef13,function(_0x68cffd){return _0x68cffd[_0x0dca('0x11')];});}}_0x95c407(_0x270d1b);})[_0x0dca('0xc')](function(_0x201e7a){_0x5748de(_0x201e7a);});});}function _0x2e3d22(_0x36f744,_0x225984){var _0x3e0f04={'parentSections':[]};switch(_0x36f744[_0x0dca('0x13')]()){case _0x0dca('0x14'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x16');break;case _0x0dca('0x17'):_0x3e0f04[_0x0dca('0x15')]='SquareOdbc';break;case _0x0dca('0x18'):_0x3e0f04[_0x0dca('0x15')]='SquareRecording';_0x3e0f04[_0x0dca('0x19')]=[{'name':_0x0dca('0x1a'),'field':'name','foreignKey':_0x0dca('0x1b')}];break;case'projects':_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x1c');break;case _0x0dca('0x1d'):_0x3e0f04[_0x0dca('0x15')]='CmContact';_0x3e0f04['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0x0dca('0x1e')}];break;case _0x0dca('0x1f'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x20');break;case'companies':_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x21');break;case _0x0dca('0x22'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x23');break;case'chatqueues':_0x3e0f04['childModel']=_0x0dca('0x24');break;case _0x0dca('0x25'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x26');break;case _0x0dca('0x27'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x28');break;case _0x0dca('0x29'):_0x3e0f04[_0x0dca('0x15')]='FaxAccount';break;case'inboundroutes':case _0x0dca('0x2a'):case'outboundroutes':_0x3e0f04['childModel']='VoiceExtension';break;case _0x0dca('0x2b'):_0x3e0f04[_0x0dca('0x15')]='VoiceContext';break;case _0x0dca('0x2c'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x2d');break;case _0x0dca('0x2e'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x2f');_0x3e0f04[_0x0dca('0x19')]=[{'name':'Agents','field':_0x0dca('0xb'),'foreignKey':'membername','model':_0x0dca('0x30'),'filter':{'field':_0x0dca('0x31'),'value':[_0x0dca('0x32')]}},{'name':_0x0dca('0x33'),'field':'name','foreignKey':_0x0dca('0x34'),'model':_0x0dca('0x30'),'filter':{'field':_0x0dca('0x31'),'value':[_0x0dca('0x35')]}},{'name':_0x0dca('0x36'),'field':_0x0dca('0xb'),'foreignKey':'queue','model':_0x0dca('0x37'),'filter':{'field':_0x0dca('0x12'),'value':[_0x0dca('0x38')]}},{'name':_0x0dca('0x39'),'field':_0x0dca('0xb'),'foreignKey':'queue','model':_0x0dca('0x37'),'filter':{'field':_0x0dca('0x12'),'value':[_0x0dca('0x3a')]}}];break;case _0x0dca('0x3b'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x3c');break;case _0x0dca('0x3d'):_0x3e0f04['childModel']='VoiceChanSpy';break;case _0x0dca('0x3e'):_0x3e0f04[_0x0dca('0x15')]='VoicePrefix';break;case'ivrcampaigns':_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x3f');break;case'mailqueues':_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x40');break;case _0x0dca('0x41'):_0x3e0f04[_0x0dca('0x15')]='MailAccount';break;case'mailsubstatuses':_0x3e0f04[_0x0dca('0x15')]='MailSubstatus';break;case _0x0dca('0x42'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x43');break;case _0x0dca('0x44'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x45');break;case _0x0dca('0x46'):_0x3e0f04[_0x0dca('0x15')]='SmsQueue';break;case'smsaccounts':_0x3e0f04['childModel']='SmsAccount';break;case _0x0dca('0x47'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x48');break;case _0x0dca('0x49'):_0x3e0f04[_0x0dca('0x15')]='WhatsappAccount';break;case _0x0dca('0x4a'):_0x3e0f04['childModel']='Team';break;case _0x0dca('0x4b'):case'queuecampaigns':_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x37');if(_0x225984){_0x3e0f04[_0x0dca('0x19')]=[{'name':_0x0dca('0x36')},{'name':_0x0dca('0x39')}];}break;case _0x0dca('0x4c'):case _0x0dca('0x4d'):case _0x0dca('0x4e'):_0x3e0f04['childModel']=_0x0dca('0x30');if(_0x225984){_0x3e0f04[_0x0dca('0x19')]=[{'name':_0x0dca('0x4f'),'filter':{'field':_0x0dca('0x31'),'value':[_0x0dca('0x50'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x0dca('0x33')}];}break;case _0x0dca('0x51'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x52');break;case _0x0dca('0x53'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x54');break;case _0x0dca('0x55'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x56');break;case'sugarcrmaccounts':_0x3e0f04[_0x0dca('0x15')]='SugarcrmAccount';break;case'deskaccounts':_0x3e0f04['childModel']=_0x0dca('0x57');break;case _0x0dca('0x58'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x59');break;case _0x0dca('0x5a'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x30');break;case _0x0dca('0x5b'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x5c');break;case _0x0dca('0x5d'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x5e');break;case _0x0dca('0x5f'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x60');break;case'intervals':_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x61');break;case _0x0dca('0x62'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x63');break;case _0x0dca('0x64'):_0x3e0f04['childModel']=_0x0dca('0x65');break;case _0x0dca('0x66'):_0x3e0f04[_0x0dca('0x15')]='Sound';break;case _0x0dca('0x67'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x68');break;case _0x0dca('0x69'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x6a');break;case _0x0dca('0x6b'):_0x3e0f04['childModel']='Trigger';break;case'trunks':_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x6c');break;case _0x0dca('0x6d'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x6e');break;case _0x0dca('0x6f'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x70');break;case _0x0dca('0x71'):_0x3e0f04[_0x0dca('0x15')]='AnalyticExtractedReport';_0x3e0f04['parentSections']=[{'name':_0x0dca('0x72'),'field':'id','foreignKey':_0x0dca('0x73')}];break;case _0x0dca('0x74'):_0x3e0f04[_0x0dca('0x15')]=_0x0dca('0x75');break;}return _0x3e0f04;}function _0x4a1a3f(_0x1c0bbf,_0x55f5e0){var _0x47074f=_0x1c0bbf[_0x0dca('0x76')](0x0)[_0x0dca('0x77')]()+_0x1c0bbf[_0x0dca('0x78')](0x1);var _0x5a906c={'type':_0x4fd571[_0x0dca('0x79')][_0x0dca('0x7a')][_0x0dca('0x7b')],'raw':!![]};return new Promise(function(_0xd822ac,_0x14abbe){var _0xc672a5=squel[_0x0dca('0x7c')]()[_0x0dca('0x4')]('ui.'+_0x47074f+_0x0dca('0x7d'),'id')['field'](_0x0dca('0x7e'))['from']('user_has_'+_0x1c0bbf+_0x0dca('0x7f'),'ui')[_0x0dca('0x80')](_0x0dca('0x81'),_0x55f5e0['id']);return _0x4fd571['sequelize'][_0x0dca('0x82')](_0xc672a5[_0x0dca('0x83')](),_0x5a906c)['then'](function(_0x2fb7ce){_0x55f5e0[_0x47074f+_0x0dca('0x84')]=_0x2fb7ce;_0xd822ac(_0x2fb7ce);})[_0x0dca('0xc')](function(_0x1038f9){_0x14abbe(_0x1038f9);});});}return _0x4598b1['define'](_0x0dca('0x85'),attributes,{'tableName':_0x0dca('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2f8b99){var _0x4a4a67=require('../../components/parsers/qs');var _0x273b59={'raw':_0x2f8b99[_0x0dca('0x82')]['raw'],'where':{}};var _0x114787={};var _0x2329b0={'count':0x0,'rows':[]};var _0x170a52=_0x2f8b99[_0x0dca('0x82')]['section'];var _0x559e59=_0x2f8b99[_0x0dca('0x82')][_0x0dca('0x87')]||![];var _0x44e476=_0x2e3d22(_0x170a52,_0x559e59);if(!_0x44e476['childModel'])throw new Error(_0x0dca('0x88')+_0x170a52+'\x27');var _0x309437=[{'name':_0x170a52}];if(!_['isEmpty'](_0x44e476[_0x0dca('0x19')]))_0x309437=_0x44e476[_0x0dca('0x19')];var _0x41d071=[];for(var _0x19cb6b=0x0;_0x19cb6b<_0x309437[_0x0dca('0x89')];_0x19cb6b++){_0x41d071['push'](_0x4fd571['UserProfileSection'][_0x0dca('0x8a')]({'where':{'userProfileId':_0x2f8b99['params']['id'],'name':_0x309437[_0x19cb6b][_0x0dca('0xb')]},'raw':!![]}));}return Promise[_0x0dca('0x8b')](_0x41d071)['then'](function(_0x5b6838){var _0xf97de8=_[_0x0dca('0x5')](_0x5b6838,function(_0x5953f9){return _0x5953f9?_0x5953f9:undefined;});var _0x236e86=_[_0x0dca('0x5')](_0x309437,['ignore',!![]]);var _0x2d7ff0=_[_0x0dca('0x8c')](_0xf97de8)&&_['isEmpty'](_0x236e86)?null:_['union'](_0x236e86,_0xf97de8);if(!_0x2d7ff0)return null;var _0x526d3c=[];for(var _0x215e22=0x0;_0x215e22<_0x2d7ff0[_0x0dca('0x89')];_0x215e22++){var _0x4e586c=_['find'](_0x309437,function(_0x12b43e){return _0x2d7ff0[_0x215e22]?_0x12b43e[_0x0dca('0xb')]===_0x2d7ff0[_0x215e22]['name']:null;});if(_0x4e586c){if(_0x2d7ff0[_0x215e22]['ignore']){_0x526d3c[_0x0dca('0x8d')](_0xa55f45(_0x44e476['childModel'],_0x2d7ff0[_0x215e22]));}else{if(!_0x2d7ff0[_0x215e22][_0x0dca('0x8e')]){_0x526d3c[_0x0dca('0x8d')](_0x2b23dd(_0x4e586c,_0x2d7ff0[_0x215e22],_0x44e476[_0x0dca('0x15')]));}else{if(_0x4e586c[_0x0dca('0x9')]){_0x526d3c[_0x0dca('0x8d')](_0x2fa6ee(_0x4e586c,_0x2d7ff0[_0x215e22]));}}}}}return Promise[_0x0dca('0x8b')](_0x526d3c);})[_0x0dca('0x7')](function(_0xa5348f){var _0x78fd24=_0xa5348f;var _0x455937=null;if(_0x78fd24){_0x455937=_0x78fd24[_0x0dca('0x89')]===0x1?_0x78fd24[0x0]:null;}if(!_0x455937&&!_0x78fd24)return _0x2329b0;var _0x152fcf=_0x4fd571[_0x44e476[_0x0dca('0x15')]]['rawAttributes'];_0x114787[_0x0dca('0x9')]=_[_0x0dca('0x8f')](_0x152fcf);_0x114787[_0x0dca('0x82')]=_['keys'](_0x2f8b99['query']);_0x114787[_0x0dca('0x90')]=_['intersection'](_0x114787[_0x0dca('0x9')],_0x114787[_0x0dca('0x82')]);_0x273b59['attributes']=_['intersection'](_0x114787['model'],_0x4a4a67[_0x0dca('0x91')](_0x2f8b99['query'][_0x0dca('0x91')]));_0x273b59[_0x0dca('0x92')]=_0x273b59['attributes'][_0x0dca('0x89')]?_0x273b59[_0x0dca('0x92')]:_0x114787['model'];if(!_0x2f8b99['query'][_0x0dca('0x93')](_0x0dca('0x94'))){_0x273b59[_0x0dca('0x95')]=_0x4a4a67[_0x0dca('0x95')](_0x2f8b99[_0x0dca('0x82')]['limit']);_0x273b59[_0x0dca('0x96')]=_0x4a4a67['offset'](_0x2f8b99[_0x0dca('0x82')][_0x0dca('0x96')]);}_0x273b59[_0x0dca('0x97')]=_0x4a4a67[_0x0dca('0x98')](_0x2f8b99[_0x0dca('0x82')][_0x0dca('0x98')]);_0x273b59[_0x0dca('0x80')]=_0x4a4a67[_0x0dca('0x90')](_[_0x0dca('0x99')](_0x2f8b99['query'],_0x114787[_0x0dca('0x90')]));if(_0x2f8b99[_0x0dca('0x82')][_0x0dca('0x5')]){_0x273b59['where']=_[_0x0dca('0x9a')](_0x273b59['where'],{'$or':_['map'](_0x152fcf,function(_0x5baccf){if(_0x5baccf[_0x0dca('0x12')][_0x0dca('0x9b')]!==_0x0dca('0x9c')){var _0x3b651d={};_0x3b651d[_0x5baccf[_0x0dca('0x4')]]={'$like':'%'+_0x2f8b99[_0x0dca('0x82')][_0x0dca('0x5')]+'%'};return _0x3b651d;}})});}var _0x28f765=[];var _0x55d345=null;var _0x3bcda7={};if(_0x455937){_0x55d345=_['find'](_0x309437,[_0x0dca('0xb'),_0x455937[_0x0dca('0xb')]]);if(_0x55d345[_0x0dca('0x4')]){_0x3bcda7={};if(_0x44e476['childModel']===_0x0dca('0x10')){_0x3bcda7[_0x55d345['foreignKey']]=_[_0x0dca('0x8')](_0x455937[_0x0dca('0xf')],'id');}else{_0x3bcda7[_0x55d345['foreignKey']]=_0x455937[_0x0dca('0xf')];}_0x28f765[_0x0dca('0x8d')](_0x3bcda7);}else{_0x273b59[_0x0dca('0x80')]['id']=_0x455937['associatedResources'];}}else{for(var _0xc7b47a=0x0;_0xc7b47a<_0x78fd24[_0x0dca('0x89')];_0xc7b47a++){_0x55d345=_[_0x0dca('0x8a')](_0x309437,['name',_0x78fd24[_0xc7b47a][_0x0dca('0xb')]]);if(_0x55d345[_0x0dca('0x4')]){_0x3bcda7={};_0x3bcda7[_0x55d345[_0x0dca('0x9d')]]=_0x78fd24[_0xc7b47a]['associatedResources'];_0x28f765['push'](_0x3bcda7);}else{if(!_0x273b59[_0x0dca('0x80')]['id'])_0x273b59[_0x0dca('0x80')]['id']=[];_0x78fd24[_0xc7b47a]['associatedResources'][_0x0dca('0x9e')](function(_0x483e5a){_0x273b59[_0x0dca('0x80')]['id'][_0x0dca('0x8d')](_0x483e5a);});}}}if(!_['isEmpty'](_0x28f765)){_0x273b59[_0x0dca('0x80')]=_['merge'](_0x273b59['where'],{'$and':{'$or':_0x28f765}});}_0x273b59=_['merge']({},_0x273b59,_0x2f8b99['options']);if(_0x455937&&!_0x455937[_0x0dca('0x8e')]&&_0x44e476['childModel']==='AnalyticExtractedReport'){if(_0x2f8b99[_0x0dca('0x82')][_0x0dca('0x9f')]){_0x273b59[_0x0dca('0xa0')]=[{'all':!![]}];}return _0x4fd571[_0x44e476[_0x0dca('0x15')]][_0x0dca('0xa')](_0x273b59)[_0x0dca('0x7')](function(_0x55b0ca){var _0xead0f1=[];_0x55b0ca[_0x0dca('0x9e')](function(_0xad2af0){var _0x566db4;switch(_0xad2af0[_0x0dca('0xa1')]){case _0x0dca('0xa2'):_0x566db4=_['find'](_0x455937[_0x0dca('0xf')],function(_0x203dbf){return _0x203dbf['id']===_0xad2af0[_0x0dca('0x73')]&&_0x203dbf[_0x0dca('0x12')]===_0x0dca('0xa3');});break;case _0x0dca('0xa4'):_0x566db4=_[_0x0dca('0x8a')](_0x455937[_0x0dca('0xf')],function(_0x3efb35){return _0x3efb35['id']===_0xad2af0[_0x0dca('0x73')]&&_0x3efb35['type']===_0x0dca('0xa5');});break;}if(_0x566db4)_0xead0f1[_0x0dca('0x8d')](_0xad2af0);});_0x2329b0[_0x0dca('0xa6')]=_0xead0f1[_0x0dca('0x89')];_0x2329b0[_0x0dca('0xa7')]=_0xead0f1;return _0x2329b0;});}else{if(!_[_0x0dca('0x8c')](_0x2f8b99[_0x0dca('0x82')]['ids'])){_0x273b59[_0x0dca('0x80')]['id']=_0x273b59[_0x0dca('0x80')]['id']?_['intersection'](_0x273b59[_0x0dca('0x80')]['id'],_0x2f8b99[_0x0dca('0x82')][_0x0dca('0xa8')]):_0x2f8b99[_0x0dca('0x82')][_0x0dca('0xa8')];if(_0x2f8b99['query'][_0x0dca('0xa9')]){_0x273b59[_0x0dca('0x97')]=_0x2f8b99['query'][_0x0dca('0xa9')];}}if(_0x2f8b99[_0x0dca('0x82')][_0x0dca('0xaa')]){_0x273b59[_0x0dca('0x80')]=_[_0x0dca('0x9a')](_0x273b59['where'],{'$and':_0x2f8b99['query']['extraQueryConditions']});}return _0x4fd571[_0x44e476['childModel']]['count']({'where':_0x273b59[_0x0dca('0x80')]})[_0x0dca('0x7')](function(_0x3a9d97){_0x2329b0[_0x0dca('0xa6')]=_0x3a9d97;if(_0x2f8b99[_0x0dca('0x82')][_0x0dca('0x9f')]){if(_0x44e476[_0x0dca('0x15')]==='CmContact'){_0x273b59[_0x0dca('0xa0')]=[{'model':_0x4fd571[_0x0dca('0x68')],'as':_0x0dca('0xab'),'attributes':['id','name',_0x0dca('0xac')],'required':_0x2f8b99[_0x0dca('0x82')]['tag']?!![]:![]},{'model':_0x4fd571[_0x0dca('0x68')],'as':'ThroughTags','attributes':['id',_0x0dca('0xb'),_0x0dca('0xac')],'through':_0x2f8b99[_0x0dca('0x82')][_0x0dca('0xad')]?{'attributes':[],'where':{'TagId':_0x2f8b99[_0x0dca('0x82')][_0x0dca('0xad')]||undefined}}:{},'required':_0x2f8b99[_0x0dca('0x82')][_0x0dca('0xad')]?!![]:![]}];}else{_0x273b59[_0x0dca('0xa0')]=[{'all':!![]}];}}return _0x4fd571[_0x44e476[_0x0dca('0x15')]][_0x0dca('0xa')](_0x273b59);})[_0x0dca('0x7')](function(_0x3ce531){_0x2329b0[_0x0dca('0xa7')]=_0x3ce531;if(_0x170a52===_0x0dca('0xae')&&_0x2f8b99[_0x0dca('0x82')][_0x0dca('0xaf')]==='true'){var _0x69594b=[];for(var _0x1413b2=0x0;_0x1413b2<_0x2329b0['rows']['length'];_0x1413b2++){_0x69594b['push'](_0x4a1a3f(_0x0dca('0xb0'),_0x2329b0['rows'][_0x1413b2]['dataValues']));_0x69594b[_0x0dca('0x8d')](_0x4a1a3f(_0x0dca('0xb1'),_0x2329b0[_0x0dca('0xa7')][_0x1413b2][_0x0dca('0xb2')]));_0x69594b['push'](_0x4a1a3f('fax',_0x2329b0['rows'][_0x1413b2][_0x0dca('0xb2')]));_0x69594b[_0x0dca('0x8d')](_0x4a1a3f(_0x0dca('0xb3'),_0x2329b0['rows'][_0x1413b2][_0x0dca('0xb2')]));_0x69594b[_0x0dca('0x8d')](_0x4a1a3f(_0x0dca('0xb4'),_0x2329b0[_0x0dca('0xa7')][_0x1413b2][_0x0dca('0xb2')]));_0x69594b[_0x0dca('0x8d')](_0x4a1a3f('whatsapp',_0x2329b0[_0x0dca('0xa7')][_0x1413b2]['dataValues']));}return Promise[_0x0dca('0x8b')](_0x69594b)[_0x0dca('0x7')](function(){return _0x2329b0;});}return _0x2329b0;});}});}}});}; \ No newline at end of file +var _0xb131=['voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','agents','telephones','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','Interval','pauses','Pause','Sound','tags','Tag','triggers','Trigger','Trunk','Variable','plugins','Plugin','extractedreports','Reports','reportId','toUpperCase','Sequelize','QueryTypes','ui.','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','ignore','union','all','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','DefaultReports','CustomReports','count','ids','customSorting','Tags','tag','color','rows','openTabs','true','dataValues','sms','fax','mail','openchannel','whatsapp','./userProfile.attributes','squel','models','filter','field','value','findAll','then','map','catch','model','associatedResources','resolve','AnalyticExtractedReport','type','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext'];(function(_0x1265a4,_0x46f8b2){var _0x5cba1c=function(_0x1687a5){while(--_0x1687a5){_0x1265a4['push'](_0x1265a4['shift']());}};_0x5cba1c(++_0x46f8b2);}(_0xb131,0x8c));var _0x1b13=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0xb131[_0x164af1];return _0x5d81a2;};'use strict';var _=require('lodash');var attributes=require(_0x1b13('0x0'));var squel=require(_0x1b13('0x1'));module['exports']=function(_0x4cbbed){var _0x38eb08=_0x4cbbed[_0x1b13('0x2')];function _0x3aa9bb(_0x381562,_0x20fca6){return new Promise(function(_0x4c5678,_0x5b0c21){if(!_0x20fca6)return _0x4c5678(null);var _0x20fc50=_0x20fca6[_0x1b13('0x3')]?{[_0x20fca6[_0x1b13('0x3')][_0x1b13('0x4')]]:_0x20fca6[_0x1b13('0x3')][_0x1b13('0x5')]}:undefined;return _0x38eb08[_0x381562][_0x1b13('0x6')]({'where':_0x20fc50,'raw':!![]})[_0x1b13('0x7')](function(_0x291bfd){_0x20fca6['associatedResources']=_[_0x1b13('0x8')](_0x291bfd,'id');_0x4c5678(_0x20fca6);})[_0x1b13('0x9')](function(_0x581b05){_0x5b0c21(_0x581b05);});});}function _0x5ef0cd(_0x54cce8,_0x57153c){return new Promise(function(_0x2b82d0,_0x3cbce6){var _0x58fa79=_0x54cce8[_0x1b13('0x3')]?{[_0x54cce8[_0x1b13('0x3')]['field']]:_0x54cce8[_0x1b13('0x3')][_0x1b13('0x5')]}:undefined;return _0x38eb08[_0x54cce8[_0x1b13('0xa')]][_0x1b13('0x6')]({'where':_0x58fa79,'raw':!![]})['then'](function(_0x46deaa){_0x57153c[_0x1b13('0xb')]=_[_0x1b13('0x8')](_0x46deaa,function(_0x1218b){return _0x1218b['name'];});_0x2b82d0(_0x57153c);})['catch'](function(_0x50d05c){_0x3cbce6(_0x50d05c);});});}function _0x287c1d(_0x1b2ee4,_0x18f89b,_0x402bbc){if(!_0x18f89b)return Promise[_0x1b13('0xc')](null);return new Promise(function(_0x1b1b05,_0x6e1d4c){return _0x38eb08['UserProfileResource']['findAll']({'where':{'sectionId':_0x18f89b['id']},'raw':!![]})[_0x1b13('0x7')](function(_0x1fd5ca){if(_0x1b2ee4[_0x1b13('0x4')]&&_0x1b2ee4[_0x1b13('0x4')]!=='id'){_0x18f89b[_0x1b13('0xb')]=_[_0x1b13('0x8')](_0x1fd5ca,function(_0x10e13b){return _0x10e13b[_0x1b2ee4['field']];});}else{if(_0x402bbc===_0x1b13('0xd')){_0x18f89b['associatedResources']=_[_0x1b13('0x8')](_0x1fd5ca,function(_0x75929){return{'id':_0x75929['resourceId'],'type':_0x75929[_0x1b13('0xe')]};});}else{_0x18f89b['associatedResources']=_[_0x1b13('0x8')](_0x1fd5ca,function(_0x5529de){return _0x5529de['resourceId'];});}}_0x1b1b05(_0x18f89b);})[_0x1b13('0x9')](function(_0x398c3f){_0x6e1d4c(_0x398c3f);});});}function _0x485cbc(_0x4193d1,_0x47ca2b){var _0x206018={'parentSections':[]};switch(_0x4193d1[_0x1b13('0xf')]()){case'squareprojects':_0x206018[_0x1b13('0x10')]=_0x1b13('0x11');break;case _0x1b13('0x12'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x13');break;case'squarerecordings':_0x206018[_0x1b13('0x10')]='SquareRecording';_0x206018[_0x1b13('0x14')]=[{'name':_0x1b13('0x15'),'field':_0x1b13('0x16'),'foreignKey':_0x1b13('0x17')}];break;case _0x1b13('0x18'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x19');break;case _0x1b13('0x1a'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x1b');_0x206018[_0x1b13('0x14')]=[{'name':_0x1b13('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0x1b13('0x1d'):_0x206018[_0x1b13('0x10')]='CmList';break;case _0x1b13('0x1e'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x1f');break;case _0x1b13('0x20'):_0x206018['childModel']='CmCustomField';break;case _0x1b13('0x21'):_0x206018['childModel']=_0x1b13('0x22');break;case _0x1b13('0x23'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x24');break;case _0x1b13('0x25'):_0x206018[_0x1b13('0x10')]='FaxQueue';break;case _0x1b13('0x26'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x27');break;case _0x1b13('0x28'):case _0x1b13('0x29'):case'outboundroutes':_0x206018[_0x1b13('0x10')]=_0x1b13('0x2a');break;case _0x1b13('0x2b'):_0x206018['childModel']=_0x1b13('0x2c');break;case _0x1b13('0x2d'):_0x206018[_0x1b13('0x10')]='VoiceMail';break;case _0x1b13('0x2e'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x2f');_0x206018['parentSections']=[{'name':_0x1b13('0x30'),'field':_0x1b13('0x16'),'foreignKey':_0x1b13('0x31'),'model':_0x1b13('0x32'),'filter':{'field':_0x1b13('0x33'),'value':['agent']}},{'name':_0x1b13('0x34'),'field':_0x1b13('0x16'),'foreignKey':_0x1b13('0x31'),'model':'User','filter':{'field':_0x1b13('0x33'),'value':[_0x1b13('0x35')]}},{'name':_0x1b13('0x36'),'field':_0x1b13('0x16'),'foreignKey':_0x1b13('0x37'),'model':_0x1b13('0x38'),'filter':{'field':_0x1b13('0xe'),'value':[_0x1b13('0x39')]}},{'name':_0x1b13('0x3a'),'field':_0x1b13('0x16'),'foreignKey':_0x1b13('0x37'),'model':_0x1b13('0x38'),'filter':{'field':'type','value':['outbound']}}];break;case _0x1b13('0x3b'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x3c');break;case _0x1b13('0x3d'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x3e');break;case _0x1b13('0x3f'):_0x206018['childModel']=_0x1b13('0x40');break;case _0x1b13('0x41'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x42');break;case'mailqueues':_0x206018[_0x1b13('0x10')]=_0x1b13('0x43');break;case _0x1b13('0x44'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x45');break;case _0x1b13('0x46'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x47');break;case _0x1b13('0x48'):_0x206018['childModel']=_0x1b13('0x49');break;case _0x1b13('0x4a'):_0x206018['childModel']=_0x1b13('0x4b');break;case _0x1b13('0x4c'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x4d');break;case _0x1b13('0x4e'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x4f');break;case'whatsappqueues':_0x206018[_0x1b13('0x10')]='WhatsappQueue';break;case _0x1b13('0x50'):_0x206018['childModel']=_0x1b13('0x51');break;case _0x1b13('0x52'):_0x206018['childModel']=_0x1b13('0x53');break;case _0x1b13('0x54'):case'queuecampaigns':_0x206018[_0x1b13('0x10')]='VoiceQueue';if(_0x47ca2b){_0x206018['parentSections']=[{'name':'VoiceQueues'},{'name':_0x1b13('0x3a')}];}break;case'users':case _0x1b13('0x55'):case _0x1b13('0x56'):_0x206018['childModel']=_0x1b13('0x32');if(_0x47ca2b){_0x206018[_0x1b13('0x14')]=[{'name':'Users','filter':{'field':_0x1b13('0x33'),'value':[_0x1b13('0x57'),_0x1b13('0x58')]},'ignore':!![]},{'name':_0x1b13('0x30')},{'name':'Telephones'}];}break;case _0x1b13('0x59'):_0x206018['childModel']='ZendeskAccount';break;case _0x1b13('0x5a'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x5b');break;case _0x1b13('0x5c'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x5d');break;case _0x1b13('0x5e'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x5f');break;case _0x1b13('0x60'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x61');break;case'zohoaccounts':_0x206018[_0x1b13('0x10')]=_0x1b13('0x62');break;case'vtigeraccounts':_0x206018[_0x1b13('0x10')]='User';break;case _0x1b13('0x63'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x64');break;case _0x1b13('0x65'):_0x206018[_0x1b13('0x10')]='Disposition';break;case _0x1b13('0x66'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x67');break;case'intervals':_0x206018[_0x1b13('0x10')]=_0x1b13('0x68');break;case _0x1b13('0x69'):_0x206018['childModel']=_0x1b13('0x6a');break;case'scheduler':_0x206018[_0x1b13('0x10')]='Schedule';break;case'sounds':_0x206018[_0x1b13('0x10')]=_0x1b13('0x6b');break;case _0x1b13('0x6c'):_0x206018[_0x1b13('0x10')]=_0x1b13('0x6d');break;case'templates':_0x206018['childModel']='Template';break;case _0x1b13('0x6e'):_0x206018['childModel']=_0x1b13('0x6f');break;case'trunks':_0x206018[_0x1b13('0x10')]=_0x1b13('0x70');break;case'variables':_0x206018['childModel']=_0x1b13('0x71');break;case _0x1b13('0x72'):_0x206018['childModel']=_0x1b13('0x73');break;case _0x1b13('0x74'):_0x206018[_0x1b13('0x10')]='AnalyticExtractedReport';_0x206018['parentSections']=[{'name':_0x1b13('0x75'),'field':'id','foreignKey':_0x1b13('0x76')}];break;case'metrics':_0x206018[_0x1b13('0x10')]='AnalyticMetric';break;}return _0x206018;}function _0x8d64f3(_0x48b830,_0x1d58dd){var _0x549ed0=_0x48b830['charAt'](0x0)[_0x1b13('0x77')]()+_0x48b830['slice'](0x1);var _0x38e2be={'type':_0x38eb08[_0x1b13('0x78')][_0x1b13('0x79')]['SELECT'],'raw':!![]};return new Promise(function(_0x217ee1,_0x362b47){var _0xe5165f=squel['select']()[_0x1b13('0x4')](_0x1b13('0x7a')+_0x549ed0+'InteractionId','id')['field'](_0x1b13('0x7b'))[_0x1b13('0x7c')](_0x1b13('0x7d')+_0x48b830+'_interactions','ui')[_0x1b13('0x7e')](_0x1b13('0x7f'),_0x1d58dd['id']);return _0x38eb08['sequelize'][_0x1b13('0x80')](_0xe5165f[_0x1b13('0x81')](),_0x38e2be)[_0x1b13('0x7')](function(_0x28200b){_0x1d58dd[_0x549ed0+_0x1b13('0x82')]=_0x28200b;_0x217ee1(_0x28200b);})['catch'](function(_0x3e5a81){_0x362b47(_0x3e5a81);});});}return _0x4cbbed[_0x1b13('0x83')](_0x1b13('0x84'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x11a2ad){var _0x5dca52=require(_0x1b13('0x85'));var _0x19c3f2={'raw':_0x11a2ad[_0x1b13('0x80')][_0x1b13('0x86')],'where':{}};var _0x1d7be2={};var _0xac3553={'count':0x0,'rows':[]};var _0x194f12=_0x11a2ad['query'][_0x1b13('0x87')];var _0x110e2d=_0x11a2ad[_0x1b13('0x80')][_0x1b13('0x88')]||![];var _0x3c50e8=_0x485cbc(_0x194f12,_0x110e2d);if(!_0x3c50e8['childModel'])throw new Error(_0x1b13('0x89')+_0x194f12+'\x27');var _0x582fec=[{'name':_0x194f12}];if(!_[_0x1b13('0x8a')](_0x3c50e8[_0x1b13('0x14')]))_0x582fec=_0x3c50e8[_0x1b13('0x14')];var _0x4711e0=[];for(var _0x26a708=0x0;_0x26a708<_0x582fec[_0x1b13('0x8b')];_0x26a708++){_0x4711e0[_0x1b13('0x8c')](_0x38eb08['UserProfileSection'][_0x1b13('0x8d')]({'where':{'userProfileId':_0x11a2ad[_0x1b13('0x8e')]['id'],'name':_0x582fec[_0x26a708][_0x1b13('0x16')]},'raw':!![]}));}return Promise['all'](_0x4711e0)[_0x1b13('0x7')](function(_0x24a794){var _0x24bd91=_['filter'](_0x24a794,function(_0x3c312b){return _0x3c312b?_0x3c312b:undefined;});var _0x1e966a=_[_0x1b13('0x3')](_0x582fec,[_0x1b13('0x8f'),!![]]);var _0x1929cb=_[_0x1b13('0x8a')](_0x24bd91)&&_['isEmpty'](_0x1e966a)?null:_[_0x1b13('0x90')](_0x1e966a,_0x24bd91);if(!_0x1929cb)return null;var _0x5cfc21=[];for(var _0x4f74e3=0x0;_0x4f74e3<_0x1929cb['length'];_0x4f74e3++){var _0x4d0025=_[_0x1b13('0x8d')](_0x582fec,function(_0x2cc30d){return _0x1929cb[_0x4f74e3]?_0x2cc30d['name']===_0x1929cb[_0x4f74e3]['name']:null;});if(_0x4d0025){if(_0x1929cb[_0x4f74e3][_0x1b13('0x8f')]){_0x5cfc21['push'](_0x3aa9bb(_0x3c50e8['childModel'],_0x1929cb[_0x4f74e3]));}else{if(!_0x1929cb[_0x4f74e3]['autoAssociation']){_0x5cfc21[_0x1b13('0x8c')](_0x287c1d(_0x4d0025,_0x1929cb[_0x4f74e3],_0x3c50e8[_0x1b13('0x10')]));}else{if(_0x4d0025[_0x1b13('0xa')]){_0x5cfc21[_0x1b13('0x8c')](_0x5ef0cd(_0x4d0025,_0x1929cb[_0x4f74e3]));}}}}}return Promise[_0x1b13('0x91')](_0x5cfc21);})['then'](function(_0x3b893c){var _0x219971=_0x3b893c;var _0x33290a=null;if(_0x219971){_0x33290a=_0x219971[_0x1b13('0x8b')]===0x1?_0x219971[0x0]:null;}if(!_0x33290a&&!_0x219971)return _0xac3553;var _0x209500=_0x38eb08[_0x3c50e8['childModel']]['rawAttributes'];_0x1d7be2[_0x1b13('0xa')]=_[_0x1b13('0x92')](_0x209500);_0x1d7be2[_0x1b13('0x80')]=_['keys'](_0x11a2ad[_0x1b13('0x80')]);_0x1d7be2[_0x1b13('0x93')]=_[_0x1b13('0x94')](_0x1d7be2[_0x1b13('0xa')],_0x1d7be2[_0x1b13('0x80')]);_0x19c3f2['attributes']=_[_0x1b13('0x94')](_0x1d7be2[_0x1b13('0xa')],_0x5dca52['fields'](_0x11a2ad[_0x1b13('0x80')][_0x1b13('0x95')]));_0x19c3f2[_0x1b13('0x96')]=_0x19c3f2[_0x1b13('0x96')][_0x1b13('0x8b')]?_0x19c3f2[_0x1b13('0x96')]:_0x1d7be2[_0x1b13('0xa')];if(!_0x11a2ad['query'][_0x1b13('0x97')](_0x1b13('0x98'))){_0x19c3f2[_0x1b13('0x99')]=_0x5dca52[_0x1b13('0x99')](_0x11a2ad[_0x1b13('0x80')][_0x1b13('0x99')]);_0x19c3f2['offset']=_0x5dca52[_0x1b13('0x9a')](_0x11a2ad['query'][_0x1b13('0x9a')]);}_0x19c3f2[_0x1b13('0x9b')]=_0x5dca52[_0x1b13('0x9c')](_0x11a2ad[_0x1b13('0x80')][_0x1b13('0x9c')]);_0x19c3f2[_0x1b13('0x7e')]=_0x5dca52[_0x1b13('0x93')](_[_0x1b13('0x9d')](_0x11a2ad[_0x1b13('0x80')],_0x1d7be2[_0x1b13('0x93')]));if(_0x11a2ad[_0x1b13('0x80')][_0x1b13('0x3')]){_0x19c3f2[_0x1b13('0x7e')]=_[_0x1b13('0x9e')](_0x19c3f2[_0x1b13('0x7e')],{'$or':_[_0x1b13('0x8')](_0x209500,function(_0x256864){if(_0x256864[_0x1b13('0xe')]['key']!==_0x1b13('0x9f')){var _0x2f5b37={};_0x2f5b37[_0x256864[_0x1b13('0x4')]]={'$like':'%'+_0x11a2ad['query'][_0x1b13('0x3')]+'%'};return _0x2f5b37;}})});}var _0x587d3a=[];var _0x107434=null;var _0xd18975={};if(_0x33290a){_0x107434=_[_0x1b13('0x8d')](_0x582fec,[_0x1b13('0x16'),_0x33290a['name']]);if(_0x107434['field']){_0xd18975={};if(_0x3c50e8[_0x1b13('0x10')]===_0x1b13('0xd')){_0xd18975[_0x107434[_0x1b13('0xa0')]]=_[_0x1b13('0x8')](_0x33290a[_0x1b13('0xb')],'id');}else{_0xd18975[_0x107434[_0x1b13('0xa0')]]=_0x33290a[_0x1b13('0xb')];}_0x587d3a[_0x1b13('0x8c')](_0xd18975);}else{_0x19c3f2[_0x1b13('0x7e')]['id']=_0x33290a['associatedResources'];}}else{for(var _0x406a97=0x0;_0x406a97<_0x219971['length'];_0x406a97++){_0x107434=_[_0x1b13('0x8d')](_0x582fec,[_0x1b13('0x16'),_0x219971[_0x406a97]['name']]);if(_0x107434[_0x1b13('0x4')]){_0xd18975={};_0xd18975[_0x107434[_0x1b13('0xa0')]]=_0x219971[_0x406a97][_0x1b13('0xb')];_0x587d3a['push'](_0xd18975);}else{if(!_0x19c3f2['where']['id'])_0x19c3f2['where']['id']=[];_0x219971[_0x406a97][_0x1b13('0xb')][_0x1b13('0xa1')](function(_0x3ba71e){_0x19c3f2['where']['id'][_0x1b13('0x8c')](_0x3ba71e);});}}}if(!_[_0x1b13('0x8a')](_0x587d3a)){_0x19c3f2[_0x1b13('0x7e')]=_[_0x1b13('0x9e')](_0x19c3f2[_0x1b13('0x7e')],{'$and':{'$or':_0x587d3a}});}_0x19c3f2=_['merge']({},_0x19c3f2,_0x11a2ad[_0x1b13('0xa2')]);if(_0x33290a&&!_0x33290a[_0x1b13('0xa3')]&&_0x3c50e8[_0x1b13('0x10')]===_0x1b13('0xd')){if(_0x11a2ad[_0x1b13('0x80')][_0x1b13('0xa4')]){_0x19c3f2[_0x1b13('0xa5')]=[{'all':!![]}];}return _0x38eb08[_0x3c50e8[_0x1b13('0x10')]][_0x1b13('0x6')](_0x19c3f2)[_0x1b13('0x7')](function(_0x5e789b){var _0x75f788=[];_0x5e789b[_0x1b13('0xa1')](function(_0x167b58){var _0x5414dc;switch(_0x167b58[_0x1b13('0xa6')]){case _0x1b13('0xa7'):_0x5414dc=_[_0x1b13('0x8d')](_0x33290a[_0x1b13('0xb')],function(_0x490a4f){return _0x490a4f['id']===_0x167b58[_0x1b13('0x76')]&&_0x490a4f[_0x1b13('0xe')]===_0x1b13('0xa8');});break;case'custom':_0x5414dc=_['find'](_0x33290a[_0x1b13('0xb')],function(_0x3d9333){return _0x3d9333['id']===_0x167b58['reportId']&&_0x3d9333[_0x1b13('0xe')]===_0x1b13('0xa9');});break;}if(_0x5414dc)_0x75f788[_0x1b13('0x8c')](_0x167b58);});_0xac3553[_0x1b13('0xaa')]=_0x75f788[_0x1b13('0x8b')];_0xac3553['rows']=_0x75f788;return _0xac3553;});}else{if(!_[_0x1b13('0x8a')](_0x11a2ad[_0x1b13('0x80')][_0x1b13('0xab')])){_0x19c3f2[_0x1b13('0x7e')]['id']=_0x19c3f2[_0x1b13('0x7e')]['id']?_[_0x1b13('0x94')](_0x19c3f2[_0x1b13('0x7e')]['id'],_0x11a2ad[_0x1b13('0x80')][_0x1b13('0xab')]):_0x11a2ad[_0x1b13('0x80')][_0x1b13('0xab')];if(_0x11a2ad[_0x1b13('0x80')][_0x1b13('0xac')]){_0x19c3f2[_0x1b13('0x9b')]=_0x11a2ad[_0x1b13('0x80')]['customSorting'];}}if(_0x11a2ad[_0x1b13('0x80')]['extraQueryConditions']){_0x19c3f2[_0x1b13('0x7e')]=_['merge'](_0x19c3f2['where'],{'$and':_0x11a2ad['query']['extraQueryConditions']});}return _0x38eb08[_0x3c50e8[_0x1b13('0x10')]][_0x1b13('0xaa')]({'where':_0x19c3f2[_0x1b13('0x7e')]})[_0x1b13('0x7')](function(_0x38a640){_0xac3553[_0x1b13('0xaa')]=_0x38a640;if(_0x11a2ad[_0x1b13('0x80')][_0x1b13('0xa4')]){if(_0x3c50e8[_0x1b13('0x10')]==='CmContact'){_0x19c3f2[_0x1b13('0xa5')]=[{'model':_0x38eb08[_0x1b13('0x6d')],'as':_0x1b13('0xad'),'attributes':['id','name','color'],'required':_0x11a2ad['query'][_0x1b13('0xae')]?!![]:![]},{'model':_0x38eb08['Tag'],'as':'ThroughTags','attributes':['id','name',_0x1b13('0xaf')],'through':_0x11a2ad[_0x1b13('0x80')][_0x1b13('0xae')]?{'attributes':[],'where':{'TagId':_0x11a2ad['query'][_0x1b13('0xae')]||undefined}}:{},'required':_0x11a2ad[_0x1b13('0x80')][_0x1b13('0xae')]?!![]:![]}];}else{_0x19c3f2[_0x1b13('0xa5')]=[{'all':!![]}];}}return _0x38eb08[_0x3c50e8['childModel']][_0x1b13('0x6')](_0x19c3f2);})[_0x1b13('0x7')](function(_0x263189){_0xac3553[_0x1b13('0xb0')]=_0x263189;if(_0x194f12==='Agents'&&_0x11a2ad[_0x1b13('0x80')][_0x1b13('0xb1')]===_0x1b13('0xb2')){var _0x58c4a4=[];for(var _0x36a5e4=0x0;_0x36a5e4<_0xac3553[_0x1b13('0xb0')][_0x1b13('0x8b')];_0x36a5e4++){_0x58c4a4[_0x1b13('0x8c')](_0x8d64f3('chat',_0xac3553['rows'][_0x36a5e4][_0x1b13('0xb3')]));_0x58c4a4['push'](_0x8d64f3(_0x1b13('0xb4'),_0xac3553[_0x1b13('0xb0')][_0x36a5e4][_0x1b13('0xb3')]));_0x58c4a4[_0x1b13('0x8c')](_0x8d64f3(_0x1b13('0xb5'),_0xac3553['rows'][_0x36a5e4][_0x1b13('0xb3')]));_0x58c4a4[_0x1b13('0x8c')](_0x8d64f3(_0x1b13('0xb6'),_0xac3553[_0x1b13('0xb0')][_0x36a5e4][_0x1b13('0xb3')]));_0x58c4a4['push'](_0x8d64f3(_0x1b13('0xb7'),_0xac3553[_0x1b13('0xb0')][_0x36a5e4][_0x1b13('0xb3')]));_0x58c4a4[_0x1b13('0x8c')](_0x8d64f3(_0x1b13('0xb8'),_0xac3553[_0x1b13('0xb0')][_0x36a5e4][_0x1b13('0xb3')]));}return Promise[_0x1b13('0x91')](_0x58c4a4)[_0x1b13('0x7')](function(){return _0xac3553;});}return _0xac3553;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8512a3d..48f252e 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 _0xca84=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','request\x20sent','error','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca84,0xf5));var _0x4ca8=function(_0x279eef,_0x2f56ce){_0x279eef=_0x279eef-0x0;var _0x44f487=_0xca84[_0x279eef];return _0x44f487;};'use strict';var _=require(_0x4ca8('0x0'));var util=require(_0x4ca8('0x1'));var moment=require(_0x4ca8('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ca8('0x3'));var fs=require('fs');var Redis=require(_0x4ca8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ca8('0x5'));var logger=require(_0x4ca8('0x6'))(_0x4ca8('0x7'));var config=require(_0x4ca8('0x8'));var jayson=require(_0x4ca8('0x9'));var client=jayson[_0x4ca8('0xa')][_0x4ca8('0xb')]({'port':0x232a});config[_0x4ca8('0xc')]=_[_0x4ca8('0xd')](config[_0x4ca8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ca8('0xe'))(new Redis(config['redis']));require(_0x4ca8('0xf'))['register'](socket);function respondWithRpcPromise(_0x2f1198,_0x57db27,_0x41991d){return new BPromise(function(_0x53ffa,_0x3cc932){return client[_0x4ca8('0x10')](_0x2f1198,_0x41991d)[_0x4ca8('0x11')](function(_0x45e7d0){logger[_0x4ca8('0x12')]('UserProfile,\x20%s,\x20%s',_0x57db27,'request\x20sent');logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x57db27,_0x4ca8('0x13'),JSON['stringify'](_0x45e7d0));if(_0x45e7d0[_0x4ca8('0x14')]){if(_0x45e7d0[_0x4ca8('0x14')]['code']===0x1f4){logger['error'](_0x4ca8('0x15'),_0x57db27,_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);return _0x3cc932(_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);}logger[_0x4ca8('0x14')](_0x4ca8('0x15'),_0x57db27,_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);return _0x53ffa(_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);}else{logger[_0x4ca8('0x12')]('UserProfile,\x20%s,\x20%s',_0x57db27,_0x4ca8('0x13'));_0x53ffa(_0x45e7d0[_0x4ca8('0x17')][_0x4ca8('0x16')]);}})[_0x4ca8('0x18')](function(_0x28fe2b){logger['error'](_0x4ca8('0x15'),_0x57db27,_0x28fe2b);_0x3cc932(_0x28fe2b);});});} \ No newline at end of file +var _0x6337=['http','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5d31f3,_0x4239b0){var _0x1cc88c=function(_0x1be8fc){while(--_0x1be8fc){_0x5d31f3['push'](_0x5d31f3['shift']());}};_0x1cc88c(++_0x4239b0);}(_0x6337,0x18a));var _0x7633=function(_0x17aa94,_0x4f59ae){_0x17aa94=_0x17aa94-0x0;var _0x266214=_0x6337[_0x17aa94];return _0x266214;};'use strict';var _=require('lodash');var util=require(_0x7633('0x0'));var moment=require(_0x7633('0x1'));var BPromise=require(_0x7633('0x2'));var rs=require(_0x7633('0x3'));var fs=require('fs');var Redis=require(_0x7633('0x4'));var db=require(_0x7633('0x5'))['db'];var utils=require(_0x7633('0x6'));var logger=require(_0x7633('0x7'))(_0x7633('0x8'));var config=require('../../config/environment');var jayson=require(_0x7633('0x9'));var client=jayson[_0x7633('0xa')][_0x7633('0xb')]({'port':0x232a});config['redis']=_[_0x7633('0xc')](config['redis'],{'host':_0x7633('0xd'),'port':0x18eb});var socket=require(_0x7633('0xe'))(new Redis(config['redis']));require(_0x7633('0xf'))['register'](socket);function respondWithRpcPromise(_0x35a196,_0x4c0f0a,_0x174d9f){return new BPromise(function(_0x2404e4,_0x59e518){return client[_0x7633('0x10')](_0x35a196,_0x174d9f)[_0x7633('0x11')](function(_0x332283){logger['info'](_0x7633('0x12'),_0x4c0f0a,_0x7633('0x13'));logger[_0x7633('0x14')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x4c0f0a,_0x7633('0x13'),JSON[_0x7633('0x15')](_0x332283));if(_0x332283[_0x7633('0x16')]){if(_0x332283['error']['code']===0x1f4){logger['error'](_0x7633('0x12'),_0x4c0f0a,_0x332283[_0x7633('0x16')][_0x7633('0x17')]);return _0x59e518(_0x332283[_0x7633('0x16')][_0x7633('0x17')]);}logger[_0x7633('0x16')](_0x7633('0x12'),_0x4c0f0a,_0x332283[_0x7633('0x16')][_0x7633('0x17')]);return _0x2404e4(_0x332283['error'][_0x7633('0x17')]);}else{logger[_0x7633('0x18')](_0x7633('0x12'),_0x4c0f0a,_0x7633('0x13'));_0x2404e4(_0x332283[_0x7633('0x19')]['message']);}})[_0x7633('0x1a')](function(_0x30b58b){logger[_0x7633('0x16')](_0x7633('0x12'),_0x4c0f0a,_0x30b58b);_0x59e518(_0x30b58b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index fd34cd4..d82017a 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 _0x9ce6=['removeListener','register','length','userProfile:','save','remove','update'];(function(_0x3a9d93,_0x360cbc){var _0x254ba7=function(_0xe716e1){while(--_0xe716e1){_0x3a9d93['push'](_0x3a9d93['shift']());}};_0x254ba7(++_0x360cbc);}(_0x9ce6,0x100));var _0x69ce=function(_0x4bcfb2,_0x43c1d1){_0x4bcfb2=_0x4bcfb2-0x0;var _0x25579b=_0x9ce6[_0x4bcfb2];return _0x25579b;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x69ce('0x0'),_0x69ce('0x1'),_0x69ce('0x2')];function createListener(_0x2cfd13,_0xbcdfff){return function(_0x4c2415){_0xbcdfff['emit'](_0x2cfd13,_0x4c2415);};}function removeListener(_0x2f604b,_0x1f9e38){return function(){UserProfileEvents[_0x69ce('0x3')](_0x2f604b,_0x1f9e38);};}exports[_0x69ce('0x4')]=function(_0x39c34c){for(var _0x4d039a=0x0,_0x5e4aa7=events[_0x69ce('0x5')];_0x4d039a<_0x5e4aa7;_0x4d039a++){var _0x478e97=events[_0x4d039a];var _0xdc162a=createListener(_0x69ce('0x6')+_0x478e97,_0x39c34c);UserProfileEvents['on'](_0x478e97,_0xdc162a);}}; \ No newline at end of file +var _0x01b0=['emit','removeListener','register','length','userProfile:','./userProfile.events','update'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x01b0,0x124));var _0x001b=function(_0x49ca83,_0x1a0151){_0x49ca83=_0x49ca83-0x0;var _0x44e261=_0x01b0[_0x49ca83];return _0x44e261;};'use strict';var UserProfileEvents=require(_0x001b('0x0'));var events=['save','remove',_0x001b('0x1')];function createListener(_0x1a8c4e,_0xb73abe){return function(_0x12b81c){_0xb73abe[_0x001b('0x2')](_0x1a8c4e,_0x12b81c);};}function removeListener(_0x22a8fd,_0x343fc7){return function(){UserProfileEvents[_0x001b('0x3')](_0x22a8fd,_0x343fc7);};}exports[_0x001b('0x4')]=function(_0x457cb6){for(var _0x14a31f=0x0,_0x166d38=events[_0x001b('0x5')];_0x14a31f<_0x166d38;_0x14a31f++){var _0x556606=events[_0x14a31f];var _0x4eb5ee=createListener(_0x001b('0x6')+_0x556606,_0x457cb6);UserProfileEvents['on'](_0x556606,_0x4eb5ee);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 5608ad9..5bfdce7 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 _0x0009=['create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','post'];(function(_0x17d133,_0x3aebc5){var _0xf4f7a2=function(_0x30277d){while(--_0x30277d){_0x17d133['push'](_0x17d133['shift']());}};_0xf4f7a2(++_0x3aebc5);}(_0x0009,0x94));var _0x9000=function(_0x5c5f2f,_0x4325f3){_0x5c5f2f=_0x5c5f2f-0x0;var _0x4ecef=_0x0009[_0x5c5f2f];return _0x4ecef;};'use strict';var multer=require(_0x9000('0x0'));var util=require(_0x9000('0x1'));var path=require('path');var timeout=require(_0x9000('0x2'));var express=require(_0x9000('0x3'));var router=express[_0x9000('0x4')]();var fs_extra=require(_0x9000('0x5'));var auth=require(_0x9000('0x6'));var interaction=require(_0x9000('0x7'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x9000('0x8')]('/',auth[_0x9000('0x9')](),controller['index']);router[_0x9000('0x8')]('/describe',auth[_0x9000('0x9')](),controller[_0x9000('0xa')]);router[_0x9000('0x8')](_0x9000('0xb'),auth[_0x9000('0x9')](),controller[_0x9000('0xc')]);router[_0x9000('0xd')]('/',auth[_0x9000('0x9')](),controller[_0x9000('0xe')]);router[_0x9000('0xf')](_0x9000('0xb'),auth[_0x9000('0x9')](),controller[_0x9000('0x10')]);router['delete']('/:id',auth[_0x9000('0x9')](),controller[_0x9000('0x11')]);module['exports']=router; \ No newline at end of file +var _0x03aa=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','describe','/:id','create','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x03aa,0xe3));var _0xa03a=function(_0x220d12,_0x3a96bc){_0x220d12=_0x220d12-0x0;var _0x52cb63=_0x03aa[_0x220d12];return _0x52cb63;};'use strict';var multer=require(_0xa03a('0x0'));var util=require(_0xa03a('0x1'));var path=require('path');var timeout=require(_0xa03a('0x2'));var express=require(_0xa03a('0x3'));var router=express[_0xa03a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa03a('0x5'));var controller=require('./userProfileResource.controller');router[_0xa03a('0x6')]('/',auth[_0xa03a('0x7')](),controller[_0xa03a('0x8')]);router[_0xa03a('0x6')]('/describe',auth[_0xa03a('0x7')](),controller[_0xa03a('0x9')]);router['get'](_0xa03a('0xa'),auth[_0xa03a('0x7')](),controller['show']);router['post']('/',auth[_0xa03a('0x7')](),controller[_0xa03a('0xb')]);router['put'](_0xa03a('0xa'),auth[_0xa03a('0x7')](),controller[_0xa03a('0xc')]);router[_0xa03a('0xd')](_0xa03a('0xa'),auth[_0xa03a('0x7')](),controller[_0xa03a('0xe')]);module[_0xa03a('0xf')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 98a5e7b..a949b07 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 _0xf4d3=['STRING','sequelize','INTEGER'];(function(_0x5b4b22,_0x1191e3){var _0x2febc0=function(_0x1287e3){while(--_0x1287e3){_0x5b4b22['push'](_0x5b4b22['shift']());}};_0x2febc0(++_0x1191e3);}(_0xf4d3,0x91));var _0x3f4d=function(_0x425d67,_0x5cdb40){_0x425d67=_0x425d67-0x0;var _0x49b609=_0xf4d3[_0x425d67];return _0x49b609;};'use strict';var Sequelize=require(_0x3f4d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3f4d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3f4d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7653=['STRING','INTEGER','sequelize','exports'];(function(_0x7371d,_0x5d145a){var _0x238e70=function(_0x46b5e2){while(--_0x46b5e2){_0x7371d['push'](_0x7371d['shift']());}};_0x238e70(++_0x5d145a);}(_0x7653,0x1ca));var _0x3765=function(_0x55c8e3,_0x4addd4){_0x55c8e3=_0x55c8e3-0x0;var _0x7e6c2c=_0x7653[_0x55c8e3];return _0x7e6c2c;};'use strict';var Sequelize=require(_0x3765('0x0'));module[_0x3765('0x1')]={'name':{'type':Sequelize[_0x3765('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3765('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x3765('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 85bffe7..d60f11f 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 _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','UserProfileResource','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x533fd6,_0x3a7083){var _0x5a447d=function(_0x41e7e9){while(--_0x41e7e9){_0x533fd6['push'](_0x533fd6['shift']());}};_0x5a447d(++_0x3a7083);}(_0xb016,0x159));var _0x6b01=function(_0x4d52fa,_0x2a72a2){_0x4d52fa=_0x4d52fa-0x0;var _0x4002a5=_0xb016[_0x4d52fa];return _0x4002a5;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['UserProfileResource'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,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','UserProfileResource','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(_0x1ad07b,_0x551d55){var _0x2c447f=function(_0x43340b){while(--_0x43340b){_0x1ad07b['push'](_0x1ad07b['shift']());}};_0x2c447f(++_0x551d55);}(_0x430c,0x1a1));var _0xc430=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0x430c[_0x2ad008];return _0x4538cf;};'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/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index cf76b66..9757e9a 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 _0x1106=['define','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./userProfileResource.attributes'];(function(_0x52bd65,_0x160646){var _0x13fd57=function(_0xe84392){while(--_0xe84392){_0x52bd65['push'](_0x52bd65['shift']());}};_0x13fd57(++_0x160646);}(_0x1106,0xdc));var _0x6110=function(_0x1fd5e7,_0x176f82){_0x1fd5e7=_0x1fd5e7-0x0;var _0x3a2021=_0x1106[_0x1fd5e7];return _0x3a2021;};'use strict';var _=require(_0x6110('0x0'));var util=require(_0x6110('0x1'));var logger=require(_0x6110('0x2'))('api');var moment=require(_0x6110('0x3'));var BPromise=require(_0x6110('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6110('0x5'));var rimraf=require(_0x6110('0x6'));var config=require('../../config/environment');var attributes=require(_0x6110('0x7'));module['exports']=function(_0x135472,_0x2bb106){return _0x135472[_0x6110('0x8')]('UserProfileResource',attributes,{'tableName':_0x6110('0x9'),'paranoid':![],'indexes':[{'name':_0x6110('0xa'),'fields':['resourceId',_0x6110('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7351=['request-promise','path','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment'];(function(_0x430748,_0x50fae2){var _0x3952e6=function(_0x5ecc78){while(--_0x5ecc78){_0x430748['push'](_0x430748['shift']());}};_0x3952e6(++_0x50fae2);}(_0x7351,0xb1));var _0x1735=function(_0x1d649b,_0x522270){_0x1d649b=_0x1d649b-0x0;var _0x516d26=_0x7351[_0x1d649b];return _0x516d26;};'use strict';var _=require(_0x1735('0x0'));var util=require(_0x1735('0x1'));var logger=require(_0x1735('0x2'))(_0x1735('0x3'));var moment=require(_0x1735('0x4'));var BPromise=require('bluebird');var rp=require(_0x1735('0x5'));var fs=require('fs');var path=require(_0x1735('0x6'));var rimraf=require('rimraf');var config=require(_0x1735('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x1735('0x8')]=function(_0x53c640,_0x3dd7a6){return _0x53c640[_0x1735('0x9')](_0x1735('0xa'),attributes,{'tableName':_0x1735('0xb'),'paranoid':![],'indexes':[{'name':_0x1735('0xc'),'fields':['resourceId',_0x1735('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 91e5651..8573459 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 _0x9bb6=['stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x202a6d,_0x5bef9e){var _0x28fa4f=function(_0x622c88){while(--_0x622c88){_0x202a6d['push'](_0x202a6d['shift']());}};_0x28fa4f(++_0x5bef9e);}(_0x9bb6,0x15f));var _0x69bb=function(_0x1fa68b,_0x152e4e){_0x1fa68b=_0x1fa68b-0x0;var _0x32a3c6=_0x9bb6[_0x1fa68b];return _0x32a3c6;};'use strict';var _=require('lodash');var util=require(_0x69bb('0x0'));var moment=require('moment');var BPromise=require(_0x69bb('0x1'));var rs=require(_0x69bb('0x2'));var fs=require('fs');var Redis=require(_0x69bb('0x3'));var db=require(_0x69bb('0x4'))['db'];var utils=require(_0x69bb('0x5'));var logger=require(_0x69bb('0x6'))(_0x69bb('0x7'));var config=require(_0x69bb('0x8'));var jayson=require(_0x69bb('0x9'));var client=jayson['client'][_0x69bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x416a36,_0x545722,_0x5f262f){return new BPromise(function(_0x1c3054,_0x5b3eb7){return client[_0x69bb('0xb')](_0x416a36,_0x5f262f)['then'](function(_0x1e33ae){logger[_0x69bb('0xc')](_0x69bb('0xd'),_0x545722,_0x69bb('0xe'));logger[_0x69bb('0xf')](_0x69bb('0x10'),_0x545722,_0x69bb('0xe'),JSON[_0x69bb('0x11')](_0x1e33ae));if(_0x1e33ae[_0x69bb('0x12')]){if(_0x1e33ae[_0x69bb('0x12')][_0x69bb('0x13')]===0x1f4){logger['error'](_0x69bb('0xd'),_0x545722,_0x1e33ae['error'][_0x69bb('0x14')]);return _0x5b3eb7(_0x1e33ae[_0x69bb('0x12')]['message']);}logger[_0x69bb('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x545722,_0x1e33ae[_0x69bb('0x12')][_0x69bb('0x14')]);return _0x1c3054(_0x1e33ae[_0x69bb('0x12')]['message']);}else{logger[_0x69bb('0xc')](_0x69bb('0xd'),_0x545722,'request\x20sent');_0x1c3054(_0x1e33ae[_0x69bb('0x15')][_0x69bb('0x14')]);}})[_0x69bb('0x16')](function(_0x4b9143){logger[_0x69bb('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x545722,_0x4b9143);_0x5b3eb7(_0x4b9143);});});} \ No newline at end of file +var _0xbc62=['jayson/promise','client','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1ad5d9,_0x525670){var _0x5ded9a=function(_0x36613b){while(--_0x36613b){_0x1ad5d9['push'](_0x1ad5d9['shift']());}};_0x5ded9a(++_0x525670);}(_0xbc62,0xf3));var _0x2bc6=function(_0x353ea9,_0x2e0591){_0x353ea9=_0x353ea9-0x0;var _0xd1c45b=_0xbc62[_0x353ea9];return _0xd1c45b;};'use strict';var _=require(_0x2bc6('0x0'));var util=require('util');var moment=require(_0x2bc6('0x1'));var BPromise=require(_0x2bc6('0x2'));var rs=require(_0x2bc6('0x3'));var fs=require('fs');var Redis=require(_0x2bc6('0x4'));var db=require(_0x2bc6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2bc6('0x6'))(_0x2bc6('0x7'));var config=require(_0x2bc6('0x8'));var jayson=require(_0x2bc6('0x9'));var client=jayson[_0x2bc6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fb7e0,_0x5a2b2a,_0x4718fa){return new BPromise(function(_0x143765,_0x31f7e9){return client[_0x2bc6('0xb')](_0x3fb7e0,_0x4718fa)[_0x2bc6('0xc')](function(_0x2441b4){logger['info'](_0x2bc6('0xd'),_0x5a2b2a,_0x2bc6('0xe'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x5a2b2a,_0x2bc6('0xe'),JSON[_0x2bc6('0xf')](_0x2441b4));if(_0x2441b4[_0x2bc6('0x10')]){if(_0x2441b4[_0x2bc6('0x10')][_0x2bc6('0x11')]===0x1f4){logger[_0x2bc6('0x10')](_0x2bc6('0xd'),_0x5a2b2a,_0x2441b4['error'][_0x2bc6('0x12')]);return _0x31f7e9(_0x2441b4['error']['message']);}logger[_0x2bc6('0x10')](_0x2bc6('0xd'),_0x5a2b2a,_0x2441b4[_0x2bc6('0x10')][_0x2bc6('0x12')]);return _0x143765(_0x2441b4['error'][_0x2bc6('0x12')]);}else{logger[_0x2bc6('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x5a2b2a,'request\x20sent');_0x143765(_0x2441b4[_0x2bc6('0x14')][_0x2bc6('0x12')]);}})['catch'](function(_0x4ba02a){logger[_0x2bc6('0x10')](_0x2bc6('0xd'),_0x5a2b2a,_0x4ba02a);_0x31f7e9(_0x4ba02a);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index a7dbc95..335dbb3 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 _0x4359=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x274ffb,_0x5a4d27){var _0x4ccbcc=function(_0x3470d){while(--_0x3470d){_0x274ffb['push'](_0x274ffb['shift']());}};_0x4ccbcc(++_0x5a4d27);}(_0x4359,0x132));var _0x9435=function(_0x9654f6,_0x4cde9c){_0x9654f6=_0x9654f6-0x0;var _0xeba80d=_0x4359[_0x9654f6];return _0xeba80d;};'use strict';var multer=require('multer');var util=require(_0x9435('0x0'));var path=require('path');var timeout=require(_0x9435('0x1'));var express=require(_0x9435('0x2'));var router=express[_0x9435('0x3')]();var fs_extra=require(_0x9435('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9435('0x5'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x9435('0x6')](),controller[_0x9435('0x7')]);router[_0x9435('0x8')]('/describe',auth[_0x9435('0x6')](),controller[_0x9435('0x9')]);router[_0x9435('0x8')](_0x9435('0xa'),auth[_0x9435('0x6')](),controller[_0x9435('0xb')]);router[_0x9435('0xc')]('/',auth['isAuthenticated'](),controller[_0x9435('0xd')]);router[_0x9435('0xe')](_0x9435('0xa'),auth[_0x9435('0x6')](),controller[_0x9435('0xf')]);router[_0x9435('0x10')](_0x9435('0xa'),auth[_0x9435('0x6')](),controller[_0x9435('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe131=['create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x26b30a,_0xfb3217){var _0x269187=function(_0x468148){while(--_0x468148){_0x26b30a['push'](_0x26b30a['shift']());}};_0x269187(++_0xfb3217);}(_0xe131,0xf7));var _0x1e13=function(_0x29796d,_0x171343){_0x29796d=_0x29796d-0x0;var _0x2a946c=_0xe131[_0x29796d];return _0x2a946c;};'use strict';var multer=require(_0x1e13('0x0'));var util=require(_0x1e13('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1e13('0x2'));var router=express[_0x1e13('0x3')]();var fs_extra=require(_0x1e13('0x4'));var auth=require(_0x1e13('0x5'));var interaction=require(_0x1e13('0x6'));var config=require(_0x1e13('0x7'));var controller=require(_0x1e13('0x8'));router[_0x1e13('0x9')]('/',auth['isAuthenticated'](),controller[_0x1e13('0xa')]);router[_0x1e13('0x9')](_0x1e13('0xb'),auth[_0x1e13('0xc')](),controller[_0x1e13('0xd')]);router[_0x1e13('0x9')](_0x1e13('0xe'),auth[_0x1e13('0xc')](),controller[_0x1e13('0xf')]);router[_0x1e13('0x10')]('/',auth[_0x1e13('0xc')](),controller[_0x1e13('0x11')]);router[_0x1e13('0x12')](_0x1e13('0xe'),auth[_0x1e13('0xc')](),controller[_0x1e13('0x13')]);router[_0x1e13('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1e13('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index f75bbed..28e0aa1 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 _0x2547=['BOOLEAN','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER'];(function(_0x58106d,_0x135852){var _0x3fcf5a=function(_0x1e1a1d){while(--_0x1e1a1d){_0x58106d['push'](_0x58106d['shift']());}};_0x3fcf5a(++_0x135852);}(_0x2547,0x1cd));var _0x7254=function(_0x27e0af,_0x3dcfeb){_0x27e0af=_0x27e0af-0x0;var _0x265a26=_0x2547[_0x27e0af];return _0x265a26;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'name':{'type':Sequelize[_0x7254('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x7254('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x7254('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x7254('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x7254('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x7254('0x1')],'set':function(_0x265ebf){this['setDataValue'](_0x7254('0x4'),_0x265ebf?_0x265ebf[_0x7254('0x5')](''):[]);},'get':function(){return this[_0x7254('0x6')](_0x7254('0x4'))?this['getDataValue'](_0x7254('0x4'))[_0x7254('0x7')](''):[];}}}; \ No newline at end of file +var _0x7916=['getDataValue','sequelize','STRING','BOOLEAN','crudPermissions'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0x7916,0x128));var _0x6791=function(_0x5a359a,_0x8af0d0){_0x5a359a=_0x5a359a-0x0;var _0x117628=_0x7916[_0x5a359a];return _0x117628;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6791('0x1')],'set':function(_0x330476){this['setDataValue'](_0x6791('0x3'),_0x330476?_0x330476['join'](''):[]);},'get':function(){return this[_0x6791('0x4')](_0x6791('0x3'))?this['getDataValue'](_0x6791('0x3'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index ac91b11..4852c03 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 _0x2dcc=['sendStatus','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','params','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x4ceb43,_0xa9161a){var _0x32cabc=function(_0x38fd12){while(--_0x38fd12){_0x4ceb43['push'](_0x4ceb43['shift']());}};_0x32cabc(++_0xa9161a);}(_0x2dcc,0x1a2));var _0xc2dc=function(_0x142925,_0x216626){_0x142925=_0x142925-0x0;var _0x44f867=_0x2dcc[_0x142925];return _0x44f867;};'use strict';var emlformat=require(_0xc2dc('0x0'));var rimraf=require(_0xc2dc('0x1'));var zipdir=require(_0xc2dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc2dc('0x3'));var moment=require(_0xc2dc('0x4'));var BPromise=require(_0xc2dc('0x5'));var Mustache=require(_0xc2dc('0x6'));var util=require('util');var path=require(_0xc2dc('0x7'));var sox=require(_0xc2dc('0x8'));var csv=require(_0xc2dc('0x9'));var ejs=require(_0xc2dc('0xa'));var fs=require('fs');var fs_extra=require(_0xc2dc('0xb'));var _=require('lodash');var squel=require(_0xc2dc('0xc'));var crypto=require(_0xc2dc('0xd'));var jsforce=require(_0xc2dc('0xe'));var deskjs=require(_0xc2dc('0xf'));var toCsv=require(_0xc2dc('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc2dc('0x10'));var authService=require(_0xc2dc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc2dc('0x12'));var hardwareService=require(_0xc2dc('0x13'));var logger=require(_0xc2dc('0x14'))(_0xc2dc('0x15'));var utils=require('../../config/utils');var config=require(_0xc2dc('0x16'));var licenseUtil=require(_0xc2dc('0x17'));var db=require(_0xc2dc('0x18'))['db'];function respondWithStatusCode(_0x5284aa,_0x229e86){_0x229e86=_0x229e86||0xcc;return function(_0x2d6c75){if(_0x2d6c75){return _0x5284aa['sendStatus'](_0x229e86);}return _0x5284aa[_0xc2dc('0x19')](_0x229e86)[_0xc2dc('0x1a')]();};}function respondWithResult(_0x3338dd,_0x5bdedd){_0x5bdedd=_0x5bdedd||0xc8;return function(_0x326ae1){if(_0x326ae1){return _0x3338dd[_0xc2dc('0x19')](_0x5bdedd)['json'](_0x326ae1);}};}function respondWithFilteredResult(_0x5cfb91,_0x43675c){return function(_0x5279c2){if(_0x5279c2){var _0x22d2ca=typeof _0x43675c[_0xc2dc('0x1b')]==='undefined'&&typeof _0x43675c[_0xc2dc('0x1c')]==='undefined';var _0x3cd198=_0x5279c2[_0xc2dc('0x1d')];var _0x43718c=_0x22d2ca?0x0:_0x43675c[_0xc2dc('0x1b')];var _0x16485a=_0x22d2ca?_0x5279c2[_0xc2dc('0x1d')]:_0x43675c['offset']+_0x43675c['limit'];var _0x24ddcf;if(_0x16485a>=_0x3cd198){_0x16485a=_0x3cd198;_0x24ddcf=0xc8;}else{_0x24ddcf=0xce;}_0x5cfb91[_0xc2dc('0x19')](_0x24ddcf);return _0x5cfb91[_0xc2dc('0x1e')](_0xc2dc('0x1f'),_0x43718c+'-'+_0x16485a+'/'+_0x3cd198)['json'](_0x5279c2);}return null;};}function patchUpdates(_0x2cc641){return function(_0x482a87){try{jsonpatch[_0xc2dc('0x20')](_0x482a87,_0x2cc641,!![]);}catch(_0x316d91){return BPromise[_0xc2dc('0x21')](_0x316d91);}return _0x482a87[_0xc2dc('0x22')]();};}function saveUpdates(_0x34ee5b,_0x210cc2){return function(_0x3cdd1b){if(_0x3cdd1b){return _0x3cdd1b[_0xc2dc('0x23')](_0x34ee5b)[_0xc2dc('0x24')](function(_0x27a94f){return _0x27a94f;});}return null;};}function removeEntity(_0x10d851,_0x343984){return function(_0x5ade15){if(_0x5ade15){return _0x5ade15[_0xc2dc('0x25')]()[_0xc2dc('0x24')](function(){_0x10d851['status'](0xcc)[_0xc2dc('0x1a')]();});}};}function handleEntityNotFound(_0x42b4cc,_0x246ac5){return function(_0x32d9c7){if(!_0x32d9c7){_0x42b4cc[_0xc2dc('0x26')](0x194);}return _0x32d9c7;};}function handleError(_0x5f1551,_0x53a91a){_0x53a91a=_0x53a91a||0x1f4;return function(_0x358edc){logger[_0xc2dc('0x27')](_0x358edc[_0xc2dc('0x28')]);if(_0x358edc[_0xc2dc('0x29')]){delete _0x358edc['name'];}_0x5f1551[_0xc2dc('0x19')](_0x53a91a)[_0xc2dc('0x2a')](_0x358edc);};}exports[_0xc2dc('0x2b')]=function(_0x36b97e,_0x3ce0e5){var _0x2532f1={},_0x4e9b98={},_0x293ce6={'count':0x0,'rows':[]};var _0x1b436d=_[_0xc2dc('0x2c')](db[_0xc2dc('0x2d')][_0xc2dc('0x2e')],function(_0x580802){return{'name':_0x580802[_0xc2dc('0x2f')],'type':_0x580802['type'][_0xc2dc('0x30')]};});_0x4e9b98[_0xc2dc('0x31')]=_[_0xc2dc('0x2c')](_0x1b436d,_0xc2dc('0x29'));_0x4e9b98[_0xc2dc('0x32')]=_[_0xc2dc('0x33')](_0x36b97e['query']);_0x4e9b98[_0xc2dc('0x34')]=_[_0xc2dc('0x35')](_0x4e9b98[_0xc2dc('0x31')],_0x4e9b98['query']);_0x2532f1[_0xc2dc('0x36')]=_[_0xc2dc('0x35')](_0x4e9b98['model'],qs[_0xc2dc('0x37')](_0x36b97e[_0xc2dc('0x32')][_0xc2dc('0x37')]));_0x2532f1['attributes']=_0x2532f1['attributes'][_0xc2dc('0x38')]?_0x2532f1[_0xc2dc('0x36')]:_0x4e9b98['model'];if(!_0x36b97e[_0xc2dc('0x32')][_0xc2dc('0x39')](_0xc2dc('0x3a'))){_0x2532f1[_0xc2dc('0x1c')]=qs['limit'](_0x36b97e[_0xc2dc('0x32')][_0xc2dc('0x1c')]);_0x2532f1[_0xc2dc('0x1b')]=qs[_0xc2dc('0x1b')](_0x36b97e[_0xc2dc('0x32')]['offset']);}_0x2532f1[_0xc2dc('0x3b')]=qs[_0xc2dc('0x3c')](_0x36b97e[_0xc2dc('0x32')]['sort']);_0x2532f1['where']=qs[_0xc2dc('0x34')](_['pick'](_0x36b97e[_0xc2dc('0x32')],_0x4e9b98['filters']),_0x1b436d);if(_0x36b97e[_0xc2dc('0x32')][_0xc2dc('0x3d')]){_0x2532f1[_0xc2dc('0x3e')]=_[_0xc2dc('0x3f')](_0x2532f1['where'],{'$or':_[_0xc2dc('0x2c')](_0x1b436d,function(_0x49f7f1){if(_0x49f7f1['type']!==_0xc2dc('0x40')){var _0x36536a={};_0x36536a[_0x49f7f1['name']]={'$like':'%'+_0x36b97e['query'][_0xc2dc('0x3d')]+'%'};return _0x36536a;}})});}_0x2532f1=_[_0xc2dc('0x3f')]({},_0x2532f1,_0x36b97e[_0xc2dc('0x41')]);var _0xb70b3f={'where':_0x2532f1[_0xc2dc('0x3e')]};return db[_0xc2dc('0x2d')][_0xc2dc('0x1d')](_0xb70b3f)['then'](function(_0x50fc5d){_0x293ce6[_0xc2dc('0x1d')]=_0x50fc5d;if(_0x36b97e[_0xc2dc('0x32')][_0xc2dc('0x42')]){_0x2532f1[_0xc2dc('0x43')]=[{'all':!![]}];}return db[_0xc2dc('0x2d')][_0xc2dc('0x44')](_0x2532f1);})[_0xc2dc('0x24')](function(_0x4e6168){_0x293ce6['rows']=_0x4e6168;return _0x293ce6;})[_0xc2dc('0x24')](respondWithFilteredResult(_0x3ce0e5,_0x2532f1))['catch'](handleError(_0x3ce0e5,null));};exports[_0xc2dc('0x45')]=function(_0x440175,_0x26d4f9){var _0x2fa09c={'raw':![],'where':{'id':_0x440175['params']['id']}},_0x2ae50b={};_0x2ae50b[_0xc2dc('0x31')]=_[_0xc2dc('0x33')](db[_0xc2dc('0x2d')]['rawAttributes']);_0x2ae50b['query']=_['keys'](_0x440175['query']);_0x2ae50b[_0xc2dc('0x34')]=_[_0xc2dc('0x35')](_0x2ae50b[_0xc2dc('0x31')],_0x2ae50b[_0xc2dc('0x32')]);_0x2fa09c[_0xc2dc('0x36')]=_[_0xc2dc('0x35')](_0x2ae50b['model'],qs[_0xc2dc('0x37')](_0x440175[_0xc2dc('0x32')][_0xc2dc('0x37')]));_0x2fa09c[_0xc2dc('0x36')]=_0x2fa09c[_0xc2dc('0x36')][_0xc2dc('0x38')]?_0x2fa09c[_0xc2dc('0x36')]:_0x2ae50b[_0xc2dc('0x31')];if(_0x440175[_0xc2dc('0x32')][_0xc2dc('0x42')]){_0x2fa09c['include']=[{'all':!![]}];}_0x2fa09c=_[_0xc2dc('0x3f')]({},_0x2fa09c,_0x440175[_0xc2dc('0x41')]);return db['UserProfileSection'][_0xc2dc('0x46')](_0x2fa09c)[_0xc2dc('0x24')](handleEntityNotFound(_0x26d4f9,null))['then'](respondWithResult(_0x26d4f9,null))['catch'](handleError(_0x26d4f9,null));};exports[_0xc2dc('0x47')]=function(_0x5e689a,_0x3b573c){return db[_0xc2dc('0x2d')][_0xc2dc('0x47')](_0x5e689a['body'],{})[_0xc2dc('0x24')](respondWithResult(_0x3b573c,0xc9))['catch'](handleError(_0x3b573c,null));};exports[_0xc2dc('0x23')]=function(_0x509e12,_0x1a91be){if(_0x509e12['body']['id']){delete _0x509e12[_0xc2dc('0x48')]['id'];}return db[_0xc2dc('0x2d')][_0xc2dc('0x46')]({'where':{'id':_0x509e12[_0xc2dc('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a91be,null))[_0xc2dc('0x24')](saveUpdates(_0x509e12[_0xc2dc('0x48')],null))[_0xc2dc('0x24')](respondWithResult(_0x1a91be,null))[_0xc2dc('0x4a')](handleError(_0x1a91be,null));};exports[_0xc2dc('0x25')]=function(_0x5a6cf0,_0x34c2f6){return db[_0xc2dc('0x2d')][_0xc2dc('0x46')]({'where':{'id':_0x5a6cf0['params']['id']}})[_0xc2dc('0x24')](handleEntityNotFound(_0x34c2f6,null))[_0xc2dc('0x24')](removeEntity(_0x34c2f6,null))[_0xc2dc('0x4a')](handleError(_0x34c2f6,null));};exports[_0xc2dc('0x4b')]=function(_0x34b7ec,_0x4add84){return db[_0xc2dc('0x2d')][_0xc2dc('0x4b')]()[_0xc2dc('0x24')](respondWithResult(_0x4add84,null))['catch'](handleError(_0x4add84,null));}; \ No newline at end of file +var _0x6245=['offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','crypto','to-csv','querystring','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'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0x6245,0x7d));var _0x5624=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x6245[_0x4715d2];return _0x141811;};'use strict';var emlformat=require(_0x5624('0x0'));var rimraf=require(_0x5624('0x1'));var zipdir=require(_0x5624('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5624('0x3'));var moment=require('moment');var BPromise=require(_0x5624('0x4'));var Mustache=require(_0x5624('0x5'));var util=require(_0x5624('0x6'));var path=require(_0x5624('0x7'));var sox=require(_0x5624('0x8'));var csv=require('to-csv');var ejs=require(_0x5624('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5624('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5624('0xb'));var querystring=require(_0x5624('0xc'));var Papa=require(_0x5624('0xd'));var Redis=require(_0x5624('0xe'));var authService=require(_0x5624('0xf'));var qs=require(_0x5624('0x10'));var as=require(_0x5624('0x11'));var hardwareService=require(_0x5624('0x12'));var logger=require(_0x5624('0x13'))(_0x5624('0x14'));var utils=require(_0x5624('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5624('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x573c4f,_0x4cd39b){_0x4cd39b=_0x4cd39b||0xcc;return function(_0x1256ca){if(_0x1256ca){return _0x573c4f[_0x5624('0x17')](_0x4cd39b);}return _0x573c4f[_0x5624('0x18')](_0x4cd39b)[_0x5624('0x19')]();};}function respondWithResult(_0x584496,_0x63977f){_0x63977f=_0x63977f||0xc8;return function(_0x4b2e00){if(_0x4b2e00){return _0x584496[_0x5624('0x18')](_0x63977f)['json'](_0x4b2e00);}};}function respondWithFilteredResult(_0x4b7841,_0x578352){return function(_0x366851){if(_0x366851){var _0x31feca=typeof _0x578352['offset']===_0x5624('0x1a')&&typeof _0x578352['limit']===_0x5624('0x1a');var _0x487c20=_0x366851['count'];var _0xabea62=_0x31feca?0x0:_0x578352[_0x5624('0x1b')];var _0x32f61b=_0x31feca?_0x366851['count']:_0x578352[_0x5624('0x1b')]+_0x578352['limit'];var _0xac277d;if(_0x32f61b>=_0x487c20){_0x32f61b=_0x487c20;_0xac277d=0xc8;}else{_0xac277d=0xce;}_0x4b7841['status'](_0xac277d);return _0x4b7841[_0x5624('0x1c')](_0x5624('0x1d'),_0xabea62+'-'+_0x32f61b+'/'+_0x487c20)[_0x5624('0x1e')](_0x366851);}return null;};}function patchUpdates(_0x424bc6){return function(_0x24531e){try{jsonpatch[_0x5624('0x1f')](_0x24531e,_0x424bc6,!![]);}catch(_0x398f69){return BPromise[_0x5624('0x20')](_0x398f69);}return _0x24531e[_0x5624('0x21')]();};}function saveUpdates(_0x37020f,_0x938a51){return function(_0x4f6839){if(_0x4f6839){return _0x4f6839[_0x5624('0x22')](_0x37020f)[_0x5624('0x23')](function(_0x1b1465){return _0x1b1465;});}return null;};}function removeEntity(_0x37c3ce,_0x2123ce){return function(_0x288bbc){if(_0x288bbc){return _0x288bbc[_0x5624('0x24')]()[_0x5624('0x23')](function(){_0x37c3ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe12717,_0x2bb17d){return function(_0x58bf1d){if(!_0x58bf1d){_0xe12717[_0x5624('0x17')](0x194);}return _0x58bf1d;};}function handleError(_0x42d172,_0x20dedb){_0x20dedb=_0x20dedb||0x1f4;return function(_0x56ad8c){logger[_0x5624('0x25')](_0x56ad8c[_0x5624('0x26')]);if(_0x56ad8c[_0x5624('0x27')]){delete _0x56ad8c[_0x5624('0x27')];}_0x42d172['status'](_0x20dedb)[_0x5624('0x28')](_0x56ad8c);};}exports['index']=function(_0x404fe6,_0x23e4fd){var _0x309135={},_0xeef5bd={},_0x37528b={'count':0x0,'rows':[]};var _0x1cff39=_[_0x5624('0x29')](db[_0x5624('0x2a')][_0x5624('0x2b')],function(_0x320695){return{'name':_0x320695[_0x5624('0x2c')],'type':_0x320695[_0x5624('0x2d')][_0x5624('0x2e')]};});_0xeef5bd['model']=_[_0x5624('0x29')](_0x1cff39,'name');_0xeef5bd['query']=_[_0x5624('0x2f')](_0x404fe6[_0x5624('0x30')]);_0xeef5bd['filters']=_[_0x5624('0x31')](_0xeef5bd[_0x5624('0x32')],_0xeef5bd[_0x5624('0x30')]);_0x309135[_0x5624('0x33')]=_[_0x5624('0x31')](_0xeef5bd[_0x5624('0x32')],qs[_0x5624('0x34')](_0x404fe6['query'][_0x5624('0x34')]));_0x309135[_0x5624('0x33')]=_0x309135[_0x5624('0x33')]['length']?_0x309135['attributes']:_0xeef5bd['model'];if(!_0x404fe6['query'][_0x5624('0x35')](_0x5624('0x36'))){_0x309135[_0x5624('0x37')]=qs[_0x5624('0x37')](_0x404fe6[_0x5624('0x30')]['limit']);_0x309135['offset']=qs[_0x5624('0x1b')](_0x404fe6['query'][_0x5624('0x1b')]);}_0x309135[_0x5624('0x38')]=qs[_0x5624('0x39')](_0x404fe6[_0x5624('0x30')][_0x5624('0x39')]);_0x309135[_0x5624('0x3a')]=qs[_0x5624('0x3b')](_[_0x5624('0x3c')](_0x404fe6[_0x5624('0x30')],_0xeef5bd[_0x5624('0x3b')]),_0x1cff39);if(_0x404fe6['query'][_0x5624('0x3d')]){_0x309135['where']=_[_0x5624('0x3e')](_0x309135['where'],{'$or':_[_0x5624('0x29')](_0x1cff39,function(_0x1feff5){if(_0x1feff5[_0x5624('0x2d')]!==_0x5624('0x3f')){var _0x57389b={};_0x57389b[_0x1feff5[_0x5624('0x27')]]={'$like':'%'+_0x404fe6[_0x5624('0x30')][_0x5624('0x3d')]+'%'};return _0x57389b;}})});}_0x309135=_[_0x5624('0x3e')]({},_0x309135,_0x404fe6[_0x5624('0x40')]);var _0x282f8a={'where':_0x309135[_0x5624('0x3a')]};return db[_0x5624('0x2a')]['count'](_0x282f8a)[_0x5624('0x23')](function(_0x53780a){_0x37528b['count']=_0x53780a;if(_0x404fe6[_0x5624('0x30')][_0x5624('0x41')]){_0x309135[_0x5624('0x42')]=[{'all':!![]}];}return db['UserProfileSection'][_0x5624('0x43')](_0x309135);})[_0x5624('0x23')](function(_0x27d84d){_0x37528b[_0x5624('0x44')]=_0x27d84d;return _0x37528b;})['then'](respondWithFilteredResult(_0x23e4fd,_0x309135))[_0x5624('0x45')](handleError(_0x23e4fd,null));};exports[_0x5624('0x46')]=function(_0x6fd6b5,_0x267f68){var _0x37edcd={'raw':![],'where':{'id':_0x6fd6b5[_0x5624('0x47')]['id']}},_0x4d7872={};_0x4d7872[_0x5624('0x32')]=_['keys'](db['UserProfileSection'][_0x5624('0x2b')]);_0x4d7872[_0x5624('0x30')]=_[_0x5624('0x2f')](_0x6fd6b5[_0x5624('0x30')]);_0x4d7872[_0x5624('0x3b')]=_[_0x5624('0x31')](_0x4d7872[_0x5624('0x32')],_0x4d7872[_0x5624('0x30')]);_0x37edcd[_0x5624('0x33')]=_[_0x5624('0x31')](_0x4d7872[_0x5624('0x32')],qs[_0x5624('0x34')](_0x6fd6b5['query'][_0x5624('0x34')]));_0x37edcd[_0x5624('0x33')]=_0x37edcd[_0x5624('0x33')]['length']?_0x37edcd[_0x5624('0x33')]:_0x4d7872[_0x5624('0x32')];if(_0x6fd6b5[_0x5624('0x30')][_0x5624('0x41')]){_0x37edcd['include']=[{'all':!![]}];}_0x37edcd=_[_0x5624('0x3e')]({},_0x37edcd,_0x6fd6b5[_0x5624('0x40')]);return db[_0x5624('0x2a')][_0x5624('0x48')](_0x37edcd)['then'](handleEntityNotFound(_0x267f68,null))['then'](respondWithResult(_0x267f68,null))[_0x5624('0x45')](handleError(_0x267f68,null));};exports[_0x5624('0x49')]=function(_0x4a8417,_0x19e7a8){return db[_0x5624('0x2a')][_0x5624('0x49')](_0x4a8417['body'],{})[_0x5624('0x23')](respondWithResult(_0x19e7a8,0xc9))[_0x5624('0x45')](handleError(_0x19e7a8,null));};exports['update']=function(_0x3a61bc,_0x3c26ef){if(_0x3a61bc['body']['id']){delete _0x3a61bc[_0x5624('0x4a')]['id'];}return db['UserProfileSection'][_0x5624('0x48')]({'where':{'id':_0x3a61bc[_0x5624('0x47')]['id']}})[_0x5624('0x23')](handleEntityNotFound(_0x3c26ef,null))[_0x5624('0x23')](saveUpdates(_0x3a61bc[_0x5624('0x4a')],null))[_0x5624('0x23')](respondWithResult(_0x3c26ef,null))[_0x5624('0x45')](handleError(_0x3c26ef,null));};exports[_0x5624('0x24')]=function(_0x5bb653,_0x632b38){return db[_0x5624('0x2a')][_0x5624('0x48')]({'where':{'id':_0x5bb653[_0x5624('0x47')]['id']}})['then'](handleEntityNotFound(_0x632b38,null))[_0x5624('0x23')](removeEntity(_0x632b38,null))[_0x5624('0x45')](handleError(_0x632b38,null));};exports[_0x5624('0x4b')]=function(_0x3da1f3,_0xb6cbf9){return db[_0x5624('0x2a')][_0x5624('0x4b')]()[_0x5624('0x23')](respondWithResult(_0xb6cbf9,null))[_0x5624('0x45')](handleError(_0xb6cbf9,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 5f21cbd..33436e5 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 _0xd889=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','sectionId'];(function(_0xa25342,_0x24522b){var _0x52be43=function(_0x1ea0e9){while(--_0x1ea0e9){_0xa25342['push'](_0xa25342['shift']());}};_0x52be43(++_0x24522b);}(_0xd889,0x17a));var _0x9d88=function(_0x5da5db,_0x4ef4c5){_0x5da5db=_0x5da5db-0x0;var _0x4812cd=_0xd889[_0x5da5db];return _0x4812cd;};'use strict';var _=require('lodash');var util=require(_0x9d88('0x0'));var logger=require(_0x9d88('0x1'))(_0x9d88('0x2'));var moment=require(_0x9d88('0x3'));var BPromise=require('bluebird');var rp=require(_0x9d88('0x4'));var fs=require('fs');var path=require(_0x9d88('0x5'));var rimraf=require(_0x9d88('0x6'));var config=require(_0x9d88('0x7'));var attributes=require(_0x9d88('0x8'));module[_0x9d88('0x9')]=function(_0x3cb4fa,_0x386759){return _0x3cb4fa[_0x9d88('0xa')]('UserProfileSection',attributes,{'tableName':_0x9d88('0xb'),'paranoid':![],'indexes':[{'name':_0x9d88('0xc'),'fields':[_0x9d88('0xd'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x60c1=['compositeIndex','sectionId','userProfileId','api','moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','define','UserProfileSection'];(function(_0x17c884,_0x15717c){var _0x45a91b=function(_0x2af201){while(--_0x2af201){_0x17c884['push'](_0x17c884['shift']());}};_0x45a91b(++_0x15717c);}(_0x60c1,0x12f));var _0x160c=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x60c1[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x160c('0x0'));var moment=require(_0x160c('0x1'));var BPromise=require(_0x160c('0x2'));var rp=require(_0x160c('0x3'));var fs=require('fs');var path=require(_0x160c('0x4'));var rimraf=require(_0x160c('0x5'));var config=require('../../config/environment');var attributes=require(_0x160c('0x6'));module['exports']=function(_0x4f6405,_0x584c99){return _0x4f6405[_0x160c('0x7')](_0x160c('0x8'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x160c('0x9'),'fields':[_0x160c('0xa'),_0x160c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 661f5f7..eed9314 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 _0x184d=['info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then'];(function(_0x47b1e5,_0x323bb5){var _0x357067=function(_0x289140){while(--_0x289140){_0x47b1e5['push'](_0x47b1e5['shift']());}};_0x357067(++_0x323bb5);}(_0x184d,0x1b8));var _0xd184=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x184d[_0x2112d4];return _0x434972;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd184('0x0'));var BPromise=require(_0xd184('0x1'));var rs=require(_0xd184('0x2'));var fs=require('fs');var Redis=require(_0xd184('0x3'));var db=require(_0xd184('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd184('0x5'));var config=require(_0xd184('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd184('0x7')][_0xd184('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ea48b,_0x3c54e6,_0x55350e){return new BPromise(function(_0x210a7b,_0x4a7174){return client['request'](_0x5ea48b,_0x55350e)[_0xd184('0x9')](function(_0x28ff2f){logger[_0xd184('0xa')](_0xd184('0xb'),_0x3c54e6,'request\x20sent');logger[_0xd184('0xc')](_0xd184('0xd'),_0x3c54e6,'request\x20sent',JSON[_0xd184('0xe')](_0x28ff2f));if(_0x28ff2f[_0xd184('0xf')]){if(_0x28ff2f['error']['code']===0x1f4){logger[_0xd184('0xf')](_0xd184('0xb'),_0x3c54e6,_0x28ff2f['error']['message']);return _0x4a7174(_0x28ff2f[_0xd184('0xf')]['message']);}logger[_0xd184('0xf')](_0xd184('0xb'),_0x3c54e6,_0x28ff2f[_0xd184('0xf')][_0xd184('0x10')]);return _0x210a7b(_0x28ff2f['error'][_0xd184('0x10')]);}else{logger['info'](_0xd184('0xb'),_0x3c54e6,_0xd184('0x11'));_0x210a7b(_0x28ff2f['result'][_0xd184('0x10')]);}})['catch'](function(_0x3f36b4){logger[_0xd184('0xf')](_0xd184('0xb'),_0x3c54e6,_0x3f36b4);_0x4a7174(_0x3f36b4);});});} \ No newline at end of file +var _0x6cb7=['request\x20sent','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x6cb7,0xa3));var _0x76cb=function(_0x4108a5,_0x532562){_0x4108a5=_0x4108a5-0x0;var _0x2a2f0a=_0x6cb7[_0x4108a5];return _0x2a2f0a;};'use strict';var _=require(_0x76cb('0x0'));var util=require(_0x76cb('0x1'));var moment=require(_0x76cb('0x2'));var BPromise=require(_0x76cb('0x3'));var rs=require(_0x76cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x76cb('0x6'));var config=require(_0x76cb('0x7'));var jayson=require(_0x76cb('0x8'));var client=jayson['client'][_0x76cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34ee93,_0x1c62d6,_0x5c1dfe){return new BPromise(function(_0x1c6c81,_0x1076cd){return client[_0x76cb('0xa')](_0x34ee93,_0x5c1dfe)['then'](function(_0x44a586){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x1c62d6,'request\x20sent');logger[_0x76cb('0xb')](_0x76cb('0xc'),_0x1c62d6,_0x76cb('0xd'),JSON[_0x76cb('0xe')](_0x44a586));if(_0x44a586[_0x76cb('0xf')]){if(_0x44a586[_0x76cb('0xf')][_0x76cb('0x10')]===0x1f4){logger[_0x76cb('0xf')](_0x76cb('0x11'),_0x1c62d6,_0x44a586[_0x76cb('0xf')][_0x76cb('0x12')]);return _0x1076cd(_0x44a586[_0x76cb('0xf')][_0x76cb('0x12')]);}logger['error'](_0x76cb('0x11'),_0x1c62d6,_0x44a586['error']['message']);return _0x1c6c81(_0x44a586[_0x76cb('0xf')][_0x76cb('0x12')]);}else{logger[_0x76cb('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x1c62d6,_0x76cb('0xd'));_0x1c6c81(_0x44a586[_0x76cb('0x14')]['message']);}})[_0x76cb('0x15')](function(_0x351dab){logger[_0x76cb('0xf')](_0x76cb('0x11'),_0x1c62d6,_0x351dab);_0x1076cd(_0x351dab);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index bb61c31..50dc3db 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5cc55c,_0x9d0ac3){var _0x5d1301=function(_0x3eeac4){while(--_0x3eeac4){_0x5cc55c['push'](_0x5cc55c['shift']());}};_0x5d1301(++_0x9d0ac3);}(_0x70e0,0x17b));var _0x070e=function(_0xf2d2d6,_0x3aae44){_0xf2d2d6=_0xf2d2d6-0x0;var _0x1f32d5=_0x70e0[_0xf2d2d6];return _0x1f32d5;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x332383,_0x3874bd){var _0x3bb6c7=function(_0xd782ee){while(--_0xd782ee){_0x332383['push'](_0x332383['shift']());}};_0x3bb6c7(++_0x3874bd);}(_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 diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 01ce9ba..53dc566 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 _0xbc6c=['exports'];(function(_0x18a994,_0x34f2c9){var _0x374e65=function(_0x2756b9){while(--_0x2756b9){_0x18a994['push'](_0x18a994['shift']());}};_0x374e65(++_0x34f2c9);}(_0xbc6c,0x1b1));var _0xcbc6=function(_0x5f523f,_0x3e4f04){_0x5f523f=_0x5f523f-0x0;var _0x4cfa34=_0xbc6c[_0x5f523f];return _0x4cfa34;};'use strict';var Sequelize=require('sequelize');module[_0xcbc6('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5ebd=['INTEGER','exports'];(function(_0x2fedc0,_0x45aa2b){var _0x4e453=function(_0x57dabb){while(--_0x57dabb){_0x2fedc0['push'](_0x2fedc0['shift']());}};_0x4e453(++_0x45aa2b);}(_0x5ebd,0xf9));var _0xd5eb=function(_0x51b362,_0x2a3af3){_0x51b362=_0x51b362-0x0;var _0x18bd6=_0x5ebd[_0x51b362];return _0x18bd6;};'use strict';var Sequelize=require('sequelize');module[_0xd5eb('0x0')]={'penalty':{'type':Sequelize[_0xd5eb('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 758592d..bbac156 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 _0xd117=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0xd117,0x182));var _0x7d11=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0xd117[_0x60286b];return _0x5dff69;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb46f=['request-promise','path','../../config/environment','exports','define','UserSmsQueue','lodash','util','api','moment','bluebird'];(function(_0x49de76,_0x533e91){var _0xe360c1=function(_0x581631){while(--_0x581631){_0x49de76['push'](_0x49de76['shift']());}};_0xe360c1(++_0x533e91);}(_0xb46f,0xb6));var _0xfb46=function(_0x12d3ed,_0x4e391d){_0x12d3ed=_0x12d3ed-0x0;var _0x190946=_0xb46f[_0x12d3ed];return _0x190946;};'use strict';var _=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var logger=require('../../config/logger')(_0xfb46('0x2'));var moment=require(_0xfb46('0x3'));var BPromise=require(_0xfb46('0x4'));var rp=require(_0xfb46('0x5'));var fs=require('fs');var path=require(_0xfb46('0x6'));var rimraf=require('rimraf');var config=require(_0xfb46('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xfb46('0x8')]=function(_0x3a5255,_0x186da6){return _0x3a5255[_0xfb46('0x9')](_0xfb46('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 1dafb35..c003e73 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 _0x58e1=['../../config/logger','rpc','../../config/environment','http','request','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserSmsQueue,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x417155,_0x484285){var _0x25b014=function(_0x287f71){while(--_0x287f71){_0x417155['push'](_0x417155['shift']());}};_0x25b014(++_0x484285);}(_0x58e1,0x16f));var _0x158e=function(_0x2c93a2,_0x1c1e3b){_0x2c93a2=_0x2c93a2-0x0;var _0x5bde6c=_0x58e1[_0x2c93a2];return _0x5bde6c;};'use strict';var _=require('lodash');var util=require(_0x158e('0x0'));var moment=require(_0x158e('0x1'));var BPromise=require(_0x158e('0x2'));var rs=require(_0x158e('0x3'));var fs=require('fs');var Redis=require(_0x158e('0x4'));var db=require(_0x158e('0x5'))['db'];var utils=require(_0x158e('0x6'));var logger=require(_0x158e('0x7'))(_0x158e('0x8'));var config=require(_0x158e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x158e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e3519,_0x262e84,_0x4189c1){return new BPromise(function(_0x56ce52,_0x4fdc07){return client[_0x158e('0xb')](_0x2e3519,_0x4189c1)['then'](function(_0x455d19){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x262e84,_0x158e('0xc'));logger[_0x158e('0xd')](_0x158e('0xe'),_0x262e84,_0x158e('0xc'),JSON['stringify'](_0x455d19));if(_0x455d19[_0x158e('0xf')]){if(_0x455d19[_0x158e('0xf')][_0x158e('0x10')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x262e84,_0x455d19[_0x158e('0xf')]['message']);return _0x4fdc07(_0x455d19['error'][_0x158e('0x11')]);}logger['error'](_0x158e('0x12'),_0x262e84,_0x455d19['error'][_0x158e('0x11')]);return _0x56ce52(_0x455d19[_0x158e('0xf')][_0x158e('0x11')]);}else{logger[_0x158e('0x13')](_0x158e('0x12'),_0x262e84,_0x158e('0xc'));_0x56ce52(_0x455d19[_0x158e('0x14')][_0x158e('0x11')]);}})[_0x158e('0x15')](function(_0x4a7e9f){logger[_0x158e('0xf')](_0x158e('0x12'),_0x262e84,_0x4a7e9f);_0x4fdc07(_0x4a7e9f);});});} \ No newline at end of file +var _0xcfec=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x480e9a,_0xd5afa0){var _0x22f890=function(_0x44fb02){while(--_0x44fb02){_0x480e9a['push'](_0x480e9a['shift']());}};_0x22f890(++_0xd5afa0);}(_0xcfec,0x1eb));var _0xccfe=function(_0x35f6b4,_0x505966){_0x35f6b4=_0x35f6b4-0x0;var _0x10f072=_0xcfec[_0x35f6b4];return _0x10f072;};'use strict';var _=require('lodash');var util=require(_0xccfe('0x0'));var moment=require(_0xccfe('0x1'));var BPromise=require(_0xccfe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xccfe('0x3'))['db'];var utils=require(_0xccfe('0x4'));var logger=require(_0xccfe('0x5'))(_0xccfe('0x6'));var config=require('../../config/environment');var jayson=require(_0xccfe('0x7'));var client=jayson[_0xccfe('0x8')][_0xccfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ba33c,_0x279c9f,_0x33e425){return new BPromise(function(_0x4d0189,_0x49fc9a){return client['request'](_0x4ba33c,_0x33e425)[_0xccfe('0xa')](function(_0x4d69c2){logger['info'](_0xccfe('0xb'),_0x279c9f,_0xccfe('0xc'));logger[_0xccfe('0xd')](_0xccfe('0xe'),_0x279c9f,_0xccfe('0xc'),JSON['stringify'](_0x4d69c2));if(_0x4d69c2['error']){if(_0x4d69c2[_0xccfe('0xf')][_0xccfe('0x10')]===0x1f4){logger[_0xccfe('0xf')](_0xccfe('0xb'),_0x279c9f,_0x4d69c2[_0xccfe('0xf')][_0xccfe('0x11')]);return _0x49fc9a(_0x4d69c2['error'][_0xccfe('0x11')]);}logger[_0xccfe('0xf')](_0xccfe('0xb'),_0x279c9f,_0x4d69c2[_0xccfe('0xf')][_0xccfe('0x11')]);return _0x4d0189(_0x4d69c2[_0xccfe('0xf')][_0xccfe('0x11')]);}else{logger[_0xccfe('0x12')](_0xccfe('0xb'),_0x279c9f,_0xccfe('0xc'));_0x4d0189(_0x4d69c2[_0xccfe('0x13')]['message']);}})[_0xccfe('0x14')](function(_0x2ec65d){logger[_0xccfe('0xf')](_0xccfe('0xb'),_0x279c9f,_0x2ec65d);_0x49fc9a(_0x2ec65d);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 2091685..bcf043c 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 _0x225b=['INTEGER'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0x225b,0x195));var _0xb225=function(_0xb136a,_0x1f5155){_0xb136a=_0xb136a-0x0;var _0xaa74f1=_0x225b[_0xb136a];return _0xaa74f1;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xb225('0x0')]}}; \ No newline at end of file +var _0xc62f=['INTEGER'];(function(_0x437531,_0x3f8ebd){var _0x156d3a=function(_0x443a74){while(--_0x443a74){_0x437531['push'](_0x437531['shift']());}};_0x156d3a(++_0x3f8ebd);}(_0xc62f,0x1c9));var _0xfc62=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xc62f[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xfc62('0x0')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c74b90b..3a9ad26 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(_0x51e4f9,_0x4461ee){var _0x321b46=function(_0xb5ed9b){while(--_0xb5ed9b){_0x51e4f9['push'](_0x51e4f9['shift']());}};_0x321b46(++_0x4461ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x4ab9e3,_0x36207c){var _0x791e03=function(_0x3070b0){while(--_0x3070b0){_0x4ab9e3['push'](_0x4ab9e3['shift']());}};_0x791e03(++_0x36207c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 f34e4ae..4d57ac9 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4fb570,_0x4236b4){var _0x5d9448=function(_0xca452d){while(--_0xca452d){_0x4fb570['push'](_0x4fb570['shift']());}};_0x5d9448(++_0x4236b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0xc34967,_0x4f9747){var _0x2f6a16=function(_0x4cd4b7){while(--_0x4cd4b7){_0xc34967['push'](_0xc34967['shift']());}};_0x2f6a16(++_0x4f9747);}(_0xe706,0xa3));var _0x6e70=function(_0x3645e5,_0x1e9457){_0x3645e5=_0x3645e5-0x0;var _0x25f856=_0xe706[_0x3645e5];return _0x25f856;};'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 62ab030..9aed067 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 _0x29f9=['INTEGER'];(function(_0x23a111,_0xca7e3f){var _0x5df896=function(_0x25647d){while(--_0x25647d){_0x23a111['push'](_0x23a111['shift']());}};_0x5df896(++_0xca7e3f);}(_0x29f9,0x1e2));var _0x929f=function(_0x14d79f,_0x38e42c){_0x14d79f=_0x14d79f-0x0;var _0x45c31b=_0x29f9[_0x14d79f];return _0x45c31b;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x929f('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7573=['sequelize','exports','INTEGER'];(function(_0x2f9d3e,_0x3d4dd2){var _0x1b0306=function(_0x43cc6e){while(--_0x43cc6e){_0x2f9d3e['push'](_0x2f9d3e['shift']());}};_0x1b0306(++_0x3d4dd2);}(_0x7573,0x72));var _0x3757=function(_0x25a3c9,_0x33dc39){_0x25a3c9=_0x25a3c9-0x0;var _0x5733d2=_0x7573[_0x25a3c9];return _0x5733d2;};'use strict';var Sequelize=require(_0x3757('0x0'));module[_0x3757('0x1')]={'penalty':{'type':Sequelize[_0x3757('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 965a104..1bbb86f 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 _0x3933=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue'];(function(_0x13d33a,_0x1989d5){var _0x5e877f=function(_0x148b8c){while(--_0x148b8c){_0x13d33a['push'](_0x13d33a['shift']());}};_0x5e877f(++_0x1989d5);}(_0x3933,0x1d4));var _0x3393=function(_0x82ca6b,_0x283e8d){_0x82ca6b=_0x82ca6b-0x0;var _0x5cc951=_0x3933[_0x82ca6b];return _0x5cc951;};'use strict';var _=require(_0x3393('0x0'));var util=require(_0x3393('0x1'));var logger=require(_0x3393('0x2'))(_0x3393('0x3'));var moment=require(_0x3393('0x4'));var BPromise=require(_0x3393('0x5'));var rp=require(_0x3393('0x6'));var fs=require('fs');var path=require(_0x3393('0x7'));var rimraf=require(_0x3393('0x8'));var config=require(_0x3393('0x9'));var attributes=require(_0x3393('0xa'));module['exports']=function(_0xe276f2,_0x2d067e){return _0xe276f2[_0x3393('0xb')](_0x3393('0xc'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf8d=['define','UserVoiceQueue','lodash','util','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x1d044d,_0x389c9c){var _0x3afc63=function(_0x5ac383){while(--_0x5ac383){_0x1d044d['push'](_0x1d044d['shift']());}};_0x3afc63(++_0x389c9c);}(_0xdf8d,0x1c4));var _0xddf8=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xdf8d[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0xddf8('0x0'));var util=require(_0xddf8('0x1'));var logger=require('../../config/logger')(_0xddf8('0x2'));var moment=require('moment');var BPromise=require(_0xddf8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddf8('0x4'));var rimraf=require(_0xddf8('0x5'));var config=require(_0xddf8('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0xddf8('0x7')]=function(_0x16d525,_0x12b8f9){return _0x16d525[_0xddf8('0x8')](_0xddf8('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 21b4efd..e0febd8 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 _0xd9eb=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x409e95,_0x3c96e2){var _0xd7fdc=function(_0x25d427){while(--_0x25d427){_0x409e95['push'](_0x409e95['shift']());}};_0xd7fdc(++_0x3c96e2);}(_0xd9eb,0x1ec));var _0xbd9e=function(_0x2a5864,_0x2b9396){_0x2a5864=_0x2a5864-0x0;var _0x490ab6=_0xd9eb[_0x2a5864];return _0x490ab6;};'use strict';var _=require(_0xbd9e('0x0'));var util=require('util');var moment=require(_0xbd9e('0x1'));var BPromise=require(_0xbd9e('0x2'));var rs=require(_0xbd9e('0x3'));var fs=require('fs');var Redis=require(_0xbd9e('0x4'));var db=require(_0xbd9e('0x5'))['db'];var utils=require(_0xbd9e('0x6'));var logger=require(_0xbd9e('0x7'))(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var jayson=require(_0xbd9e('0xa'));var client=jayson[_0xbd9e('0xb')][_0xbd9e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x137264,_0x3970f6,_0x111f55){return new BPromise(function(_0x410711,_0x59db05){return client[_0xbd9e('0xd')](_0x137264,_0x111f55)[_0xbd9e('0xe')](function(_0x4db56d){logger[_0xbd9e('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x3970f6,_0xbd9e('0x10'));logger[_0xbd9e('0x11')](_0xbd9e('0x12'),_0x3970f6,_0xbd9e('0x10'),JSON[_0xbd9e('0x13')](_0x4db56d));if(_0x4db56d[_0xbd9e('0x14')]){if(_0x4db56d[_0xbd9e('0x14')]['code']===0x1f4){logger[_0xbd9e('0x14')](_0xbd9e('0x15'),_0x3970f6,_0x4db56d[_0xbd9e('0x14')][_0xbd9e('0x16')]);return _0x59db05(_0x4db56d[_0xbd9e('0x14')][_0xbd9e('0x16')]);}logger[_0xbd9e('0x14')](_0xbd9e('0x15'),_0x3970f6,_0x4db56d[_0xbd9e('0x14')][_0xbd9e('0x16')]);return _0x410711(_0x4db56d[_0xbd9e('0x14')][_0xbd9e('0x16')]);}else{logger[_0xbd9e('0xf')](_0xbd9e('0x15'),_0x3970f6,_0xbd9e('0x10'));_0x410711(_0x4db56d[_0xbd9e('0x17')][_0xbd9e('0x16')]);}})[_0xbd9e('0x18')](function(_0x21a3c1){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x3970f6,_0x21a3c1);_0x59db05(_0x21a3c1);});});} \ No newline at end of file +var _0x67ad=['../../config/environment','jayson/promise','client','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c7f1d,_0x29180d){var _0x23dbfe=function(_0x3cace2){while(--_0x3cace2){_0x2c7f1d['push'](_0x2c7f1d['shift']());}};_0x23dbfe(++_0x29180d);}(_0x67ad,0x189));var _0xd67a=function(_0x3b42f5,_0x7aab72){_0x3b42f5=_0x3b42f5-0x0;var _0x3efb04=_0x67ad[_0x3b42f5];return _0x3efb04;};'use strict';var _=require('lodash');var util=require(_0xd67a('0x0'));var moment=require('moment');var BPromise=require(_0xd67a('0x1'));var rs=require(_0xd67a('0x2'));var fs=require('fs');var Redis=require(_0xd67a('0x3'));var db=require(_0xd67a('0x4'))['db'];var utils=require(_0xd67a('0x5'));var logger=require(_0xd67a('0x6'))('rpc');var config=require(_0xd67a('0x7'));var jayson=require(_0xd67a('0x8'));var client=jayson[_0xd67a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x577405,_0x395756,_0x4be87f){return new BPromise(function(_0x2ae902,_0x36314b){return client[_0xd67a('0xa')](_0x577405,_0x4be87f)[_0xd67a('0xb')](function(_0x3a91b3){logger['info'](_0xd67a('0xc'),_0x395756,_0xd67a('0xd'));logger[_0xd67a('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x395756,'request\x20sent',JSON[_0xd67a('0xf')](_0x3a91b3));if(_0x3a91b3['error']){if(_0x3a91b3[_0xd67a('0x10')]['code']===0x1f4){logger[_0xd67a('0x10')](_0xd67a('0xc'),_0x395756,_0x3a91b3[_0xd67a('0x10')][_0xd67a('0x11')]);return _0x36314b(_0x3a91b3[_0xd67a('0x10')][_0xd67a('0x11')]);}logger['error'](_0xd67a('0xc'),_0x395756,_0x3a91b3[_0xd67a('0x10')][_0xd67a('0x11')]);return _0x2ae902(_0x3a91b3['error']['message']);}else{logger[_0xd67a('0x12')](_0xd67a('0xc'),_0x395756,_0xd67a('0xd'));_0x2ae902(_0x3a91b3[_0xd67a('0x13')][_0xd67a('0x11')]);}})['catch'](function(_0x4bde11){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x395756,_0x4bde11);_0x36314b(_0x4bde11);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 2cb105c..6eeda19 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5b4a57,_0x14107a){var _0x2a0c34=function(_0x51f0e6){while(--_0x51f0e6){_0x5b4a57['push'](_0x5b4a57['shift']());}};_0x2a0c34(++_0x14107a);}(_0x70e0,0x17b));var _0x070e=function(_0x57517b,_0x5547c2){_0x57517b=_0x57517b-0x0;var _0x4f1248=_0x70e0[_0x57517b];return _0x4f1248;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x433355,_0x1f20f4){var _0x34944d=function(_0x5ad163){while(--_0x5ad163){_0x433355['push'](_0x433355['shift']());}};_0x34944d(++_0x1f20f4);}(_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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index b3fea66..27f1ba8 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 _0xd447=['exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xd447,0xc8));var _0x7d44=function(_0x3844d1,_0x1104aa){_0x3844d1=_0x3844d1-0x0;var _0x43955e=_0xd447[_0x3844d1];return _0x43955e;};'use strict';var Sequelize=require('sequelize');module[_0x7d44('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7d44('0x1')},'membername':{'type':Sequelize[_0x7d44('0x2')],'allowNull':![],'comment':_0x7d44('0x1')},'UserId':{'type':Sequelize[_0x7d44('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7d44('0x2')],'allowNull':![],'unique':_0x7d44('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x7d44('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d44('0x4'),'comment':_0x7d44('0x1')},'penalty':{'type':Sequelize[_0x7d44('0x3')](0xb),'defaultValue':0x0,'comment':_0x7d44('0x1')},'paused':{'type':Sequelize[_0x7d44('0x3')](0xb),'defaultValue':0x0,'comment':_0x7d44('0x1')}}; \ No newline at end of file +var _0xccf7=['INTEGER','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0xccf7,0x156));var _0x7ccf=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0xccf7[_0x387dc1];return _0x17567c;};'use strict';var Sequelize=require(_0x7ccf('0x0'));module[_0x7ccf('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7ccf('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x7ccf('0x2')},'UserId':{'type':Sequelize[_0x7ccf('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7ccf('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x7ccf('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x7ccf('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x7ccf('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ad7f095..270a1cd 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 _0xa664=['save','remove','emit','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x12fa44,_0x52f3eb){var _0x5347a2=function(_0x2ab8a3){while(--_0x2ab8a3){_0x12fa44['push'](_0x12fa44['shift']());}};_0x5347a2(++_0x52f3eb);}(_0xa664,0x154));var _0x4a66=function(_0x13937c,_0x184718){_0x13937c=_0x13937c-0x0;var _0x41617b=_0xa664[_0x13937c];return _0x41617b;};'use strict';var EventEmitter=require(_0x4a66('0x0'));var UserVoiceQueueRt=require(_0x4a66('0x1'))['db'][_0x4a66('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4a66('0x3')](0x0);var events={'afterCreate':_0x4a66('0x4'),'afterUpdate':'update','afterDestroy':_0x4a66('0x5')};function emitEvent(_0xec2e35){return function(_0x3e440e,_0x44f8d5,_0x199065){UserVoiceQueueRtEvents[_0x4a66('0x6')](_0xec2e35+':'+_0x3e440e['id'],_0x3e440e);UserVoiceQueueRtEvents[_0x4a66('0x6')](_0xec2e35,_0x3e440e);_0x199065(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x4a66('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x1664=['emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1664,0xc0));var _0x4166=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x1664[_0x2d2c16];return _0x53f2fb;};'use strict';var EventEmitter=require(_0x4166('0x0'));var UserVoiceQueueRt=require(_0x4166('0x1'))['db'][_0x4166('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4166('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4166('0x4'),'afterDestroy':_0x4166('0x5')};function emitEvent(_0x3a36a2){return function(_0x1de90c,_0x3df3fb,_0xc93614){UserVoiceQueueRtEvents[_0x4166('0x6')](_0x3a36a2+':'+_0x1de90c['id'],_0x1de90c);UserVoiceQueueRtEvents[_0x4166('0x6')](_0x3a36a2,_0x1de90c);_0xc93614(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x4166('0x7')](e,emitEvent(event));}}module[_0x4166('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 4871101..848375e 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 _0x7250=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x57e2f6,_0x340178){var _0x5c222e=function(_0x57105c){while(--_0x57105c){_0x57e2f6['push'](_0x57e2f6['shift']());}};_0x5c222e(++_0x340178);}(_0x7250,0x13f));var _0x0725=function(_0x4abb00,_0x259cce){_0x4abb00=_0x4abb00-0x0;var _0x506274=_0x7250[_0x4abb00];return _0x506274;};'use strict';var _=require(_0x0725('0x0'));var util=require('util');var logger=require(_0x0725('0x1'))(_0x0725('0x2'));var moment=require(_0x0725('0x3'));var BPromise=require('bluebird');var rp=require(_0x0725('0x4'));var fs=require('fs');var path=require(_0x0725('0x5'));var rimraf=require('rimraf');var config=require(_0x0725('0x6'));var attributes=require(_0x0725('0x7'));module[_0x0725('0x8')]=function(_0xac4031,_0x4f8b07){return _0xac4031['define'](_0x0725('0x9'),attributes,{'tableName':_0x0725('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1985=['request-promise','rimraf','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x1985,0x1a8));var _0x5198=function(_0x5e6571,_0x3514a6){_0x5e6571=_0x5e6571-0x0;var _0x2cc2cf=_0x1985[_0x5e6571];return _0x2cc2cf;};'use strict';var _=require(_0x5198('0x0'));var util=require(_0x5198('0x1'));var logger=require(_0x5198('0x2'))('api');var moment=require(_0x5198('0x3'));var BPromise=require(_0x5198('0x4'));var rp=require(_0x5198('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5198('0x6'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x5198('0x7')]=function(_0x51c5d8,_0x459973){return _0x51c5d8[_0x5198('0x8')](_0x5198('0x9'),attributes,{'tableName':_0x5198('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 75d7813..1897677 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 _0xe06b=['options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','then','stringify','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll'];(function(_0x5e9367,_0x593734){var _0x4bc030=function(_0x1a35e1){while(--_0x1a35e1){_0x5e9367['push'](_0x5e9367['shift']());}};_0x4bc030(++_0x593734);}(_0xe06b,0x14d));var _0xbe06=function(_0x37de0e,_0x5414fc){_0x37de0e=_0x37de0e-0x0;var _0x35da79=_0xe06b[_0x37de0e];return _0x35da79;};'use strict';var _=require(_0xbe06('0x0'));var util=require(_0xbe06('0x1'));var moment=require('moment');var BPromise=require(_0xbe06('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe06('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe06('0x4'))('rpc');var config=require(_0xbe06('0x5'));var jayson=require(_0xbe06('0x6'));var client=jayson[_0xbe06('0x7')][_0xbe06('0x8')]({'port':0x232a});config['redis']=_[_0xbe06('0x9')](config[_0xbe06('0xa')],{'host':_0xbe06('0xb'),'port':0x18eb});var socket=require(_0xbe06('0xc'))(new Redis(config[_0xbe06('0xa')]));require('./userVoiceQueueRt.socket')[_0xbe06('0xd')](socket);function respondWithRpcPromise(_0x51d009,_0x169c31,_0x675322){return new BPromise(function(_0x41088e,_0xffe2e2){return client['request'](_0x51d009,_0x675322)['then'](function(_0x43e11e){logger[_0xbe06('0xe')](_0xbe06('0xf'),_0x169c31,'request\x20sent');logger[_0xbe06('0x10')](_0xbe06('0x11'),_0x169c31,_0xbe06('0x12'),JSON['stringify'](_0x43e11e));if(_0x43e11e[_0xbe06('0x13')]){if(_0x43e11e[_0xbe06('0x13')][_0xbe06('0x14')]===0x1f4){logger['error'](_0xbe06('0xf'),_0x169c31,_0x43e11e['error'][_0xbe06('0x15')]);return _0xffe2e2(_0x43e11e['error'][_0xbe06('0x15')]);}logger['error'](_0xbe06('0xf'),_0x169c31,_0x43e11e[_0xbe06('0x13')][_0xbe06('0x15')]);return _0x41088e(_0x43e11e[_0xbe06('0x13')][_0xbe06('0x15')]);}else{logger[_0xbe06('0xe')](_0xbe06('0xf'),_0x169c31,_0xbe06('0x12'));_0x41088e(_0x43e11e[_0xbe06('0x16')][_0xbe06('0x15')]);}})[_0xbe06('0x17')](function(_0x1de48b){logger[_0xbe06('0x13')](_0xbe06('0xf'),_0x169c31,_0x1de48b);_0xffe2e2(_0x1de48b);});});}exports[_0xbe06('0x18')]=function(_0x34bca3){var _0x4a25d=this;return new Promise(function(_0x326f60,_0x571865){return db[_0xbe06('0x19')][_0xbe06('0x1a')]({'raw':_0x34bca3[_0xbe06('0x1b')]?_0x34bca3[_0xbe06('0x1b')][_0xbe06('0x1c')]===undefined?!![]:![]:!![],'where':_0x34bca3[_0xbe06('0x1b')]?_0x34bca3[_0xbe06('0x1b')][_0xbe06('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xbe06('0x1e'),db[_0xbe06('0x1f')]['fn']('IF',db[_0xbe06('0x1f')][_0xbe06('0x20')](_0xbe06('0x21')))),'outboundQueuePauses']]})[_0xbe06('0x22')](function(_0x33fe48){logger[_0xbe06('0xe')](_0xbe06('0x18'),_0x34bca3);logger[_0xbe06('0x10')]('GetVoiceQueueRtPauses',_0x34bca3,JSON[_0xbe06('0x23')](_0x33fe48));_0x326f60(_0x33fe48);})[_0xbe06('0x17')](function(_0x2f5a7d){logger['error'](_0xbe06('0x18'),_0x2f5a7d['message'],_0x34bca3);_0x571865(_0x4a25d['error'](0x1f4,_0x2f5a7d[_0xbe06('0x15')]));});});}; \ No newline at end of file +var _0x9913=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','findAll','options','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses','stringify','lodash','util','moment','bluebird','ioredis'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0x9913,0x163));var _0x3991=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x9913[_0x2797c6];return _0x54809f;};'use strict';var _=require(_0x3991('0x0'));var util=require(_0x3991('0x1'));var moment=require(_0x3991('0x2'));var BPromise=require(_0x3991('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3991('0x4'));var db=require(_0x3991('0x5'))['db'];var utils=require(_0x3991('0x6'));var logger=require(_0x3991('0x7'))(_0x3991('0x8'));var config=require(_0x3991('0x9'));var jayson=require(_0x3991('0xa'));var client=jayson[_0x3991('0xb')][_0x3991('0xc')]({'port':0x232a});config[_0x3991('0xd')]=_[_0x3991('0xe')](config['redis'],{'host':_0x3991('0xf'),'port':0x18eb});var socket=require(_0x3991('0x10'))(new Redis(config[_0x3991('0xd')]));require('./userVoiceQueueRt.socket')[_0x3991('0x11')](socket);function respondWithRpcPromise(_0x267488,_0x55e178,_0x5f7226){return new BPromise(function(_0x50229e,_0x3591dc){return client[_0x3991('0x12')](_0x267488,_0x5f7226)['then'](function(_0x4a1212){logger[_0x3991('0x13')](_0x3991('0x14'),_0x55e178,'request\x20sent');logger[_0x3991('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x55e178,'request\x20sent',JSON['stringify'](_0x4a1212));if(_0x4a1212[_0x3991('0x16')]){if(_0x4a1212[_0x3991('0x16')][_0x3991('0x17')]===0x1f4){logger[_0x3991('0x16')](_0x3991('0x14'),_0x55e178,_0x4a1212[_0x3991('0x16')]['message']);return _0x3591dc(_0x4a1212['error'][_0x3991('0x18')]);}logger[_0x3991('0x16')](_0x3991('0x14'),_0x55e178,_0x4a1212[_0x3991('0x16')]['message']);return _0x50229e(_0x4a1212[_0x3991('0x16')]['message']);}else{logger['info'](_0x3991('0x14'),_0x55e178,_0x3991('0x19'));_0x50229e(_0x4a1212[_0x3991('0x1a')][_0x3991('0x18')]);}})[_0x3991('0x1b')](function(_0x2c746d){logger['error'](_0x3991('0x14'),_0x55e178,_0x2c746d);_0x3591dc(_0x2c746d);});});}exports['GetVoiceQueueRtPauses']=function(_0x5263e9){var _0x2a5999=this;return new Promise(function(_0x4a2c59,_0x515ebd){return db['UserVoiceQueueRt'][_0x3991('0x1c')]({'raw':_0x5263e9['options']?_0x5263e9[_0x3991('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5263e9[_0x3991('0x1d')]?_0x5263e9[_0x3991('0x1d')]['where']||null:null,'attributes':[[db[_0x3991('0x1e')]['fn'](_0x3991('0x1f'),db[_0x3991('0x1e')]['fn']('IF',db[_0x3991('0x1e')][_0x3991('0x20')](_0x3991('0x21')))),'outboundQueuePauses']]})['then'](function(_0x133d6a){logger[_0x3991('0x13')](_0x3991('0x22'),_0x5263e9);logger['debug']('GetVoiceQueueRtPauses',_0x5263e9,JSON[_0x3991('0x23')](_0x133d6a));_0x4a2c59(_0x133d6a);})[_0x3991('0x1b')](function(_0x25a84a){logger[_0x3991('0x16')](_0x3991('0x22'),_0x25a84a['message'],_0x5263e9);_0x515ebd(_0x2a5999[_0x3991('0x16')](0x1f4,_0x25a84a[_0x3991('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index d4103dd..6bd5253 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 _0xafc4=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','emit'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0xafc4,0x69));var _0x4afc=function(_0xd3adea,_0x59280c){_0xd3adea=_0xd3adea-0x0;var _0x55dea6=_0xafc4[_0xd3adea];return _0x55dea6;};'use strict';var UserVoiceQueueRtEvents=require(_0x4afc('0x0'));var events=['save',_0x4afc('0x1'),'update'];function createListener(_0x10aede,_0x11789f){return function(_0x20e443){_0x11789f[_0x4afc('0x2')](_0x10aede,_0x20e443);};}function removeListener(_0x4d9dbd,_0x49f417){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4d9dbd,_0x49f417);};}exports[_0x4afc('0x3')]=function(_0x471d45){for(var _0x16953b=0x0,_0x1bb281=events[_0x4afc('0x4')];_0x16953b<_0x1bb281;_0x16953b++){var _0xaf053d=events[_0x16953b];var _0x5e1e29=createListener(_0x4afc('0x5')+_0xaf053d,_0x471d45);UserVoiceQueueRtEvents['on'](_0xaf053d,_0x5e1e29);}}; \ No newline at end of file +var _0x8ce1=['removeListener','register','./userVoiceQueueRt.events','save','remove','update'];(function(_0xeb47c,_0x4e96fb){var _0x27c084=function(_0x893b56){while(--_0x893b56){_0xeb47c['push'](_0xeb47c['shift']());}};_0x27c084(++_0x4e96fb);}(_0x8ce1,0x152));var _0x18ce=function(_0x52728f,_0xb1756d){_0x52728f=_0x52728f-0x0;var _0xe1afff=_0x8ce1[_0x52728f];return _0xe1afff;};'use strict';var UserVoiceQueueRtEvents=require(_0x18ce('0x0'));var events=[_0x18ce('0x1'),_0x18ce('0x2'),_0x18ce('0x3')];function createListener(_0x2bb843,_0x2a3465){return function(_0x2617a2){_0x2a3465['emit'](_0x2bb843,_0x2617a2);};}function removeListener(_0x194532,_0xcffe1d){return function(){UserVoiceQueueRtEvents[_0x18ce('0x4')](_0x194532,_0xcffe1d);};}exports[_0x18ce('0x5')]=function(_0x532604){for(var _0x17d12a=0x0,_0x2008ca=events['length'];_0x17d12a<_0x2008ca;_0x17d12a++){var _0x3481fe=events[_0x17d12a];var _0x3e7646=createListener('userVoiceQueueRt:'+_0x3481fe,_0x532604);UserVoiceQueueRtEvents['on'](_0x3481fe,_0x3e7646);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 927d211..9c3aa03 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5b6dd2,_0x43f939){var _0x4a62e8=function(_0xa07ca4){while(--_0xa07ca4){_0x5b6dd2['push'](_0x5b6dd2['shift']());}};_0x4a62e8(++_0x43f939);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1bce32,_0x17b4ac){var _0x33d708=function(_0xd76f65){while(--_0xd76f65){_0x1bce32['push'](_0x1bce32['shift']());}};_0x33d708(++_0x17b4ac);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index c61b661..0746b2b 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 _0x0bc3=['INTEGER','sequelize'];(function(_0x2fc1d8,_0x16edcd){var _0x4015b7=function(_0x2183e6){while(--_0x2183e6){_0x2fc1d8['push'](_0x2fc1d8['shift']());}};_0x4015b7(++_0x16edcd);}(_0x0bc3,0x6f));var _0x30bc=function(_0x4c9b9d,_0x30777a){_0x4c9b9d=_0x4c9b9d-0x0;var _0x231e5a=_0x0bc3[_0x4c9b9d];return _0x231e5a;};'use strict';var Sequelize=require(_0x30bc('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x30bc('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3066=['exports','INTEGER'];(function(_0x4f0c71,_0xe1e8a){var _0x54a6e7=function(_0x146c9f){while(--_0x146c9f){_0x4f0c71['push'](_0x4f0c71['shift']());}};_0x54a6e7(++_0xe1e8a);}(_0x3066,0x136));var _0x6306=function(_0x3e4b9e,_0x3614bf){_0x3e4b9e=_0x3e4b9e-0x0;var _0x18e97c=_0x3066[_0x3e4b9e];return _0x18e97c;};'use strict';var Sequelize=require('sequelize');module[_0x6306('0x0')]={'penalty':{'type':Sequelize[_0x6306('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 6f8c059..bb177ae 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 _0x83dc=['user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','UserWhatsappQueue'];(function(_0x161e33,_0x1c7e1b){var _0x43a186=function(_0x13201f){while(--_0x13201f){_0x161e33['push'](_0x161e33['shift']());}};_0x43a186(++_0x1c7e1b);}(_0x83dc,0x85));var _0xc83d=function(_0x542f80,_0x26c87e){_0x542f80=_0x542f80-0x0;var _0x25e5d1=_0x83dc[_0x542f80];return _0x25e5d1;};'use strict';var _=require(_0xc83d('0x0'));var util=require(_0xc83d('0x1'));var logger=require(_0xc83d('0x2'))('api');var moment=require(_0xc83d('0x3'));var BPromise=require(_0xc83d('0x4'));var rp=require(_0xc83d('0x5'));var fs=require('fs');var path=require(_0xc83d('0x6'));var rimraf=require(_0xc83d('0x7'));var config=require(_0xc83d('0x8'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0xc22ba2,_0x35251d){return _0xc22ba2[_0xc83d('0x9')](_0xc83d('0xa'),attributes,{'tableName':_0xc83d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a50=['../../config/environment','exports','user_has_whatsapp_queues','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x46fc2c,_0x299b9c){var _0x3d181b=function(_0x1d7dfd){while(--_0x1d7dfd){_0x46fc2c['push'](_0x46fc2c['shift']());}};_0x3d181b(++_0x299b9c);}(_0x9a50,0x1e0));var _0x09a5=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0x9a50[_0x580971];return _0x16d873;};'use strict';var _=require('lodash');var util=require(_0x09a5('0x0'));var logger=require(_0x09a5('0x1'))(_0x09a5('0x2'));var moment=require('moment');var BPromise=require(_0x09a5('0x3'));var rp=require(_0x09a5('0x4'));var fs=require('fs');var path=require(_0x09a5('0x5'));var rimraf=require('rimraf');var config=require(_0x09a5('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0x09a5('0x7')]=function(_0x386d0d,_0x4f9300){return _0x386d0d['define']('UserWhatsappQueue',attributes,{'tableName':_0x09a5('0x8'),'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 3e839ff..5e65678 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 _0x0195=['../../config/environment','request','then','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x46cd9a,_0x2a2630){var _0x3b2905=function(_0x3b482b){while(--_0x3b482b){_0x46cd9a['push'](_0x46cd9a['shift']());}};_0x3b2905(++_0x2a2630);}(_0x0195,0x173));var _0x5019=function(_0x341041,_0x42abfb){_0x341041=_0x341041-0x0;var _0x4449e7=_0x0195[_0x341041];return _0x4449e7;};'use strict';var _=require(_0x5019('0x0'));var util=require(_0x5019('0x1'));var moment=require('moment');var BPromise=require(_0x5019('0x2'));var rs=require(_0x5019('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5019('0x4'))['db'];var utils=require(_0x5019('0x5'));var logger=require('../../config/logger')(_0x5019('0x6'));var config=require(_0x5019('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cbacf,_0xda5190,_0x1590dc){return new BPromise(function(_0x46b3e5,_0xc73471){return client[_0x5019('0x8')](_0x3cbacf,_0x1590dc)[_0x5019('0x9')](function(_0x19969d){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0xda5190,_0x5019('0xa'));logger[_0x5019('0xb')](_0x5019('0xc'),_0xda5190,_0x5019('0xa'),JSON[_0x5019('0xd')](_0x19969d));if(_0x19969d[_0x5019('0xe')]){if(_0x19969d[_0x5019('0xe')][_0x5019('0xf')]===0x1f4){logger[_0x5019('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0xda5190,_0x19969d[_0x5019('0xe')][_0x5019('0x10')]);return _0xc73471(_0x19969d['error'][_0x5019('0x10')]);}logger[_0x5019('0xe')](_0x5019('0x11'),_0xda5190,_0x19969d[_0x5019('0xe')][_0x5019('0x10')]);return _0x46b3e5(_0x19969d['error'][_0x5019('0x10')]);}else{logger[_0x5019('0x12')](_0x5019('0x11'),_0xda5190,_0x5019('0xa'));_0x46b3e5(_0x19969d[_0x5019('0x13')][_0x5019('0x10')]);}})[_0x5019('0x14')](function(_0x4506a4){logger[_0x5019('0xe')](_0x5019('0x11'),_0xda5190,_0x4506a4);_0xc73471(_0x4506a4);});});} \ No newline at end of file +var _0x61f9=['code','UserWhatsappQueue,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20cd08,_0x405a30){var _0x83b9b0=function(_0x591fc8){while(--_0x591fc8){_0x20cd08['push'](_0x20cd08['shift']());}};_0x83b9b0(++_0x405a30);}(_0x61f9,0xc2));var _0x961f=function(_0x8a634f,_0x33cfee){_0x8a634f=_0x8a634f-0x0;var _0xabda9a=_0x61f9[_0x8a634f];return _0xabda9a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x961f('0x0'));var BPromise=require(_0x961f('0x1'));var rs=require(_0x961f('0x2'));var fs=require('fs');var Redis=require(_0x961f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x961f('0x4'));var jayson=require(_0x961f('0x5'));var client=jayson[_0x961f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44f9ca,_0x4ba9ed,_0x219349){return new BPromise(function(_0x41f7c5,_0x169600){return client[_0x961f('0x7')](_0x44f9ca,_0x219349)[_0x961f('0x8')](function(_0xc64ee6){logger[_0x961f('0x9')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4ba9ed,_0x961f('0xa'));logger[_0x961f('0xb')](_0x961f('0xc'),_0x4ba9ed,_0x961f('0xa'),JSON[_0x961f('0xd')](_0xc64ee6));if(_0xc64ee6[_0x961f('0xe')]){if(_0xc64ee6['error'][_0x961f('0xf')]===0x1f4){logger[_0x961f('0xe')](_0x961f('0x10'),_0x4ba9ed,_0xc64ee6[_0x961f('0xe')][_0x961f('0x11')]);return _0x169600(_0xc64ee6[_0x961f('0xe')][_0x961f('0x11')]);}logger[_0x961f('0xe')](_0x961f('0x10'),_0x4ba9ed,_0xc64ee6[_0x961f('0xe')][_0x961f('0x11')]);return _0x41f7c5(_0xc64ee6[_0x961f('0xe')][_0x961f('0x11')]);}else{logger[_0x961f('0x9')](_0x961f('0x10'),_0x4ba9ed,'request\x20sent');_0x41f7c5(_0xc64ee6[_0x961f('0x12')][_0x961f('0x11')]);}})['catch'](function(_0x1783f5){logger[_0x961f('0xe')](_0x961f('0x10'),_0x4ba9ed,_0x1783f5);_0x169600(_0x1783f5);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 324425b..7b4ac5f 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 _0xd2ce=['get','index','/:id','show','isAuthenticated','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4360da,_0x84f6cc){var _0x42c667=function(_0x15b2de){while(--_0x15b2de){_0x4360da['push'](_0x4360da['shift']());}};_0x42c667(++_0x84f6cc);}(_0xd2ce,0x13c));var _0xed2c=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xd2ce[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require('multer');var util=require(_0xed2c('0x0'));var path=require('path');var timeout=require(_0xed2c('0x1'));var express=require(_0xed2c('0x2'));var router=express[_0xed2c('0x3')]();var fs_extra=require(_0xed2c('0x4'));var auth=require(_0xed2c('0x5'));var interaction=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var controller=require('./variable.controller');router[_0xed2c('0x8')]('/',auth['isAuthenticated'](),controller[_0xed2c('0x9')]);router[_0xed2c('0x8')](_0xed2c('0xa'),auth['isAuthenticated'](),controller[_0xed2c('0xb')]);router['post']('/',auth[_0xed2c('0xc')](),controller[_0xed2c('0xd')]);router['put']('/:id',auth[_0xed2c('0xc')](),controller[_0xed2c('0xe')]);router[_0xed2c('0xf')](_0xed2c('0xa'),auth['isAuthenticated'](),controller[_0xed2c('0x10')]);module[_0xed2c('0x11')]=router; \ No newline at end of file +var _0x1cc7=['exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','post','create','put','destroy'];(function(_0x62baf9,_0xf91b55){var _0x39a59f=function(_0x560d82){while(--_0x560d82){_0x62baf9['push'](_0x62baf9['shift']());}};_0x39a59f(++_0xf91b55);}(_0x1cc7,0x15a));var _0x71cc=function(_0x14eb1a,_0x218430){_0x14eb1a=_0x14eb1a-0x0;var _0x104ee7=_0x1cc7[_0x14eb1a];return _0x104ee7;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./variable.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x9')]);router[_0x71cc('0xa')]('/',auth['isAuthenticated'](),controller[_0x71cc('0xb')]);router[_0x71cc('0xc')](_0x71cc('0x8'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x71cc('0x6')](),controller[_0x71cc('0xd')]);module[_0x71cc('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index ea40512..500d081 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 _0x351f=['STRING','name','sequelize','exports'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0x351f,0xd6));var _0xf351=function(_0x484ccd,_0x5bce31){_0x484ccd=_0x484ccd-0x0;var _0x3a871d=_0x351f[_0x484ccd];return _0x3a871d;};'use strict';var Sequelize=require(_0xf351('0x0'));module[_0xf351('0x1')]={'name':{'type':Sequelize[_0xf351('0x2')],'unique':_0xf351('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1233=['exports','STRING'];(function(_0x50d620,_0x190c1e){var _0x3f652a=function(_0xa8cec){while(--_0xa8cec){_0x50d620['push'](_0x50d620['shift']());}};_0x3f652a(++_0x190c1e);}(_0x1233,0x1ca));var _0x3123=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x1233[_0x43b584];return _0x48f27b;};'use strict';var Sequelize=require('sequelize');module[_0x3123('0x0')]={'name':{'type':Sequelize[_0x3123('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3123('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index cf42183..7621ec8 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 _0x6b32=['../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','get','Variables','UserProfileResource','destroy','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','Variable','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x4d6c7c,_0x27ddb6){var _0x251050=function(_0x2d54d7){while(--_0x2d54d7){_0x4d6c7c['push'](_0x4d6c7c['shift']());}};_0x251050(++_0x27ddb6);}(_0x6b32,0x183));var _0x26b3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6b32[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x26b3('0x0'));var rimraf=require(_0x26b3('0x1'));var zipdir=require(_0x26b3('0x2'));var jsonpatch=require(_0x26b3('0x3'));var rp=require(_0x26b3('0x4'));var moment=require(_0x26b3('0x5'));var BPromise=require(_0x26b3('0x6'));var Mustache=require(_0x26b3('0x7'));var util=require(_0x26b3('0x8'));var path=require(_0x26b3('0x9'));var sox=require(_0x26b3('0xa'));var csv=require(_0x26b3('0xb'));var ejs=require(_0x26b3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x26b3('0xd'));var crypto=require(_0x26b3('0xe'));var jsforce=require(_0x26b3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x26b3('0xb'));var querystring=require(_0x26b3('0x10'));var Papa=require(_0x26b3('0x11'));var Redis=require('ioredis');var authService=require(_0x26b3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x26b3('0x13'));var hardwareService=require(_0x26b3('0x14'));var logger=require('../../config/logger')(_0x26b3('0x15'));var utils=require('../../config/utils');var config=require(_0x26b3('0x16'));var licenseUtil=require(_0x26b3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37d966,_0x86ee0c){_0x86ee0c=_0x86ee0c||0xcc;return function(_0x31e807){if(_0x31e807){return _0x37d966[_0x26b3('0x18')](_0x86ee0c);}return _0x37d966['status'](_0x86ee0c)['end']();};}function respondWithResult(_0x254dc3,_0x29df90){_0x29df90=_0x29df90||0xc8;return function(_0x2fbc7c){if(_0x2fbc7c){return _0x254dc3['status'](_0x29df90)[_0x26b3('0x19')](_0x2fbc7c);}};}function respondWithFilteredResult(_0x1f04e8,_0x482861){return function(_0x3a449c){if(_0x3a449c){var _0x1c851c=typeof _0x482861[_0x26b3('0x1a')]===_0x26b3('0x1b')&&typeof _0x482861[_0x26b3('0x1c')]===_0x26b3('0x1b');var _0x5d41fd=_0x3a449c[_0x26b3('0x1d')];var _0xa5a16a=_0x1c851c?0x0:_0x482861['offset'];var _0x427a03=_0x1c851c?_0x3a449c[_0x26b3('0x1d')]:_0x482861['offset']+_0x482861[_0x26b3('0x1c')];var _0x25df65;if(_0x427a03>=_0x5d41fd){_0x427a03=_0x5d41fd;_0x25df65=0xc8;}else{_0x25df65=0xce;}_0x1f04e8[_0x26b3('0x1e')](_0x25df65);return _0x1f04e8[_0x26b3('0x1f')](_0x26b3('0x20'),_0xa5a16a+'-'+_0x427a03+'/'+_0x5d41fd)[_0x26b3('0x19')](_0x3a449c);}return null;};}function patchUpdates(_0x3bb058){return function(_0x17bde3){try{jsonpatch[_0x26b3('0x21')](_0x17bde3,_0x3bb058,!![]);}catch(_0xbf27fe){return BPromise[_0x26b3('0x22')](_0xbf27fe);}return _0x17bde3[_0x26b3('0x23')]();};}function saveUpdates(_0x5565f2,_0x3dbb5f){return function(_0x4181da){if(_0x4181da){return _0x4181da['update'](_0x5565f2)[_0x26b3('0x24')](function(_0x4979f2){return _0x4979f2;});}return null;};}function removeEntity(_0x4fb9a6,_0x414996){return function(_0x3cbfd8){if(_0x3cbfd8){return _0x3cbfd8['destroy']()[_0x26b3('0x24')](function(){var _0x28df8a=_0x3cbfd8[_0x26b3('0x25')]({'plain':!![]});var _0x56df05=_0x26b3('0x26');return db[_0x26b3('0x27')][_0x26b3('0x28')]({'where':{'type':_0x56df05,'resourceId':_0x28df8a['id']}})[_0x26b3('0x24')](function(){return _0x3cbfd8;});})[_0x26b3('0x24')](function(){_0x4fb9a6[_0x26b3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6ae55b,_0x8f7f1e){return function(_0x319a58){if(!_0x319a58){_0x6ae55b[_0x26b3('0x18')](0x194);}return _0x319a58;};}function handleError(_0x5b5b52,_0x33698c){_0x33698c=_0x33698c||0x1f4;return function(_0x89a8ec){logger['error'](_0x89a8ec['stack']);if(_0x89a8ec[_0x26b3('0x29')]){delete _0x89a8ec[_0x26b3('0x29')];}_0x5b5b52[_0x26b3('0x1e')](_0x33698c)[_0x26b3('0x2a')](_0x89a8ec);};}exports[_0x26b3('0x2b')]=function(_0x3b2690,_0x5710d0){var _0x1dafcd={},_0x2eec70={},_0x561767={'count':0x0,'rows':[]};var _0x2ee385=_[_0x26b3('0x2c')](db['Variable'][_0x26b3('0x2d')],function(_0x10adfa){return{'name':_0x10adfa[_0x26b3('0x2e')],'type':_0x10adfa[_0x26b3('0x2f')][_0x26b3('0x30')]};});_0x2eec70['model']=_[_0x26b3('0x2c')](_0x2ee385,_0x26b3('0x29'));_0x2eec70['query']=_[_0x26b3('0x31')](_0x3b2690[_0x26b3('0x32')]);_0x2eec70[_0x26b3('0x33')]=_[_0x26b3('0x34')](_0x2eec70[_0x26b3('0x35')],_0x2eec70[_0x26b3('0x32')]);_0x1dafcd[_0x26b3('0x36')]=_[_0x26b3('0x34')](_0x2eec70[_0x26b3('0x35')],qs[_0x26b3('0x37')](_0x3b2690['query'][_0x26b3('0x37')]));_0x1dafcd[_0x26b3('0x36')]=_0x1dafcd[_0x26b3('0x36')][_0x26b3('0x38')]?_0x1dafcd[_0x26b3('0x36')]:_0x2eec70['model'];if(!_0x3b2690[_0x26b3('0x32')][_0x26b3('0x39')]('nolimit')){_0x1dafcd[_0x26b3('0x1c')]=qs[_0x26b3('0x1c')](_0x3b2690['query'][_0x26b3('0x1c')]);_0x1dafcd[_0x26b3('0x1a')]=qs[_0x26b3('0x1a')](_0x3b2690[_0x26b3('0x32')][_0x26b3('0x1a')]);}_0x1dafcd[_0x26b3('0x3a')]=qs[_0x26b3('0x3b')](_0x3b2690[_0x26b3('0x32')]['sort']);_0x1dafcd[_0x26b3('0x3c')]=qs[_0x26b3('0x33')](_['pick'](_0x3b2690[_0x26b3('0x32')],_0x2eec70[_0x26b3('0x33')]),_0x2ee385);if(_0x3b2690[_0x26b3('0x32')][_0x26b3('0x3d')]){_0x1dafcd[_0x26b3('0x3c')]=_[_0x26b3('0x3e')](_0x1dafcd['where'],{'$or':_[_0x26b3('0x2c')](_0x2ee385,function(_0xf57a7c){if(_0xf57a7c[_0x26b3('0x2f')]!=='VIRTUAL'){var _0x473c27={};_0x473c27[_0xf57a7c['name']]={'$like':'%'+_0x3b2690[_0x26b3('0x32')][_0x26b3('0x3d')]+'%'};return _0x473c27;}})});}_0x1dafcd=_[_0x26b3('0x3e')]({},_0x1dafcd,_0x3b2690[_0x26b3('0x3f')]);var _0x529689={'where':_0x1dafcd[_0x26b3('0x3c')]};return db[_0x26b3('0x40')]['count'](_0x529689)[_0x26b3('0x24')](function(_0x57021d){_0x561767[_0x26b3('0x1d')]=_0x57021d;if(_0x3b2690['query'][_0x26b3('0x41')]){_0x1dafcd[_0x26b3('0x42')]=[{'all':!![]}];}return db[_0x26b3('0x40')][_0x26b3('0x43')](_0x1dafcd);})[_0x26b3('0x24')](function(_0x1242e4){_0x561767[_0x26b3('0x44')]=_0x1242e4;return _0x561767;})[_0x26b3('0x24')](respondWithFilteredResult(_0x5710d0,_0x1dafcd))[_0x26b3('0x45')](handleError(_0x5710d0,null));};exports[_0x26b3('0x46')]=function(_0x32e8e2,_0x168c16){var _0x2b2017={'raw':!![],'where':{'id':_0x32e8e2[_0x26b3('0x47')]['id']}},_0xc05346={};_0xc05346[_0x26b3('0x35')]=_[_0x26b3('0x31')](db[_0x26b3('0x40')][_0x26b3('0x2d')]);_0xc05346[_0x26b3('0x32')]=_[_0x26b3('0x31')](_0x32e8e2[_0x26b3('0x32')]);_0xc05346[_0x26b3('0x33')]=_['intersection'](_0xc05346['model'],_0xc05346[_0x26b3('0x32')]);_0x2b2017['attributes']=_['intersection'](_0xc05346[_0x26b3('0x35')],qs[_0x26b3('0x37')](_0x32e8e2[_0x26b3('0x32')][_0x26b3('0x37')]));_0x2b2017['attributes']=_0x2b2017[_0x26b3('0x36')][_0x26b3('0x38')]?_0x2b2017[_0x26b3('0x36')]:_0xc05346[_0x26b3('0x35')];if(_0x32e8e2[_0x26b3('0x32')]['includeAll']){_0x2b2017['include']=[{'all':!![]}];}_0x2b2017=_[_0x26b3('0x3e')]({},_0x2b2017,_0x32e8e2[_0x26b3('0x3f')]);return db[_0x26b3('0x40')][_0x26b3('0x48')](_0x2b2017)['then'](handleEntityNotFound(_0x168c16,null))['then'](respondWithResult(_0x168c16,null))[_0x26b3('0x45')](handleError(_0x168c16,null));};exports[_0x26b3('0x49')]=function(_0x1488c0,_0x32596e){return db[_0x26b3('0x40')]['create'](_0x1488c0[_0x26b3('0x4a')],{})[_0x26b3('0x24')](function(_0x3a6973){var _0x3c0512=_0x1488c0[_0x26b3('0x4b')][_0x26b3('0x25')]({'plain':!![]});if(!_0x3c0512)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c0512[_0x26b3('0x4c')]===_0x26b3('0x4b')){var _0x20c0cb=_0x3a6973[_0x26b3('0x25')]({'plain':!![]});var _0x1f621b=_0x26b3('0x26');return db[_0x26b3('0x4d')][_0x26b3('0x48')]({'where':{'name':_0x1f621b,'userProfileId':_0x3c0512[_0x26b3('0x4e')]},'raw':!![]})['then'](function(_0x8ee6a4){if(_0x8ee6a4&&_0x8ee6a4[_0x26b3('0x4f')]===0x0){return db['UserProfileResource'][_0x26b3('0x49')]({'name':_0x20c0cb['name'],'resourceId':_0x20c0cb['id'],'type':_0x8ee6a4[_0x26b3('0x29')],'sectionId':_0x8ee6a4['id']},{})[_0x26b3('0x24')](function(){return _0x3a6973;});}else{return _0x3a6973;}})[_0x26b3('0x45')](function(_0x3f537c){logger['error'](_0x26b3('0x50'),_0x3f537c);throw _0x3f537c;});}return _0x3a6973;})[_0x26b3('0x24')](respondWithResult(_0x32596e,0xc9))[_0x26b3('0x45')](handleError(_0x32596e,null));};exports[_0x26b3('0x51')]=function(_0x27675a,_0x53d851){if(_0x27675a[_0x26b3('0x4a')]['id']){delete _0x27675a[_0x26b3('0x4a')]['id'];}return db[_0x26b3('0x40')]['find']({'where':{'id':_0x27675a[_0x26b3('0x47')]['id']}})[_0x26b3('0x24')](handleEntityNotFound(_0x53d851,null))[_0x26b3('0x24')](saveUpdates(_0x27675a[_0x26b3('0x4a')],null))[_0x26b3('0x24')](respondWithResult(_0x53d851,null))[_0x26b3('0x45')](handleError(_0x53d851,null));};exports['destroy']=function(_0x238431,_0x187a77){return db[_0x26b3('0x40')][_0x26b3('0x48')]({'where':{'id':_0x238431[_0x26b3('0x47')]['id']}})[_0x26b3('0x24')](handleEntityNotFound(_0x187a77,null))[_0x26b3('0x24')](removeEntity(_0x187a77,null))[_0x26b3('0x45')](handleError(_0x187a77,null));}; \ No newline at end of file +var _0x1e31=['find','create','body','user','UserProfileSection','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','get','Variables','UserProfileResource','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','Variable','findAll','rows','show','params','keys','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e31,0x101));var _0x11e3=function(_0x23afc2,_0xd0ec0b){_0x23afc2=_0x23afc2-0x0;var _0xa5f21a=_0x1e31[_0x23afc2];return _0xa5f21a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11e3('0x0'));var zipdir=require(_0x11e3('0x1'));var jsonpatch=require(_0x11e3('0x2'));var rp=require('request-promise');var moment=require(_0x11e3('0x3'));var BPromise=require(_0x11e3('0x4'));var Mustache=require(_0x11e3('0x5'));var util=require(_0x11e3('0x6'));var path=require(_0x11e3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x11e3('0x8'));var fs=require('fs');var fs_extra=require(_0x11e3('0x9'));var _=require(_0x11e3('0xa'));var squel=require(_0x11e3('0xb'));var crypto=require(_0x11e3('0xc'));var jsforce=require(_0x11e3('0xd'));var deskjs=require(_0x11e3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x11e3('0xf'));var Papa=require(_0x11e3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x11e3('0x11'));var as=require(_0x11e3('0x12'));var hardwareService=require(_0x11e3('0x13'));var logger=require(_0x11e3('0x14'))(_0x11e3('0x15'));var utils=require(_0x11e3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x11e3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcac3f5,_0x545627){_0x545627=_0x545627||0xcc;return function(_0x17c189){if(_0x17c189){return _0xcac3f5[_0x11e3('0x18')](_0x545627);}return _0xcac3f5[_0x11e3('0x19')](_0x545627)[_0x11e3('0x1a')]();};}function respondWithResult(_0x54c390,_0x16a8a9){_0x16a8a9=_0x16a8a9||0xc8;return function(_0x529eb0){if(_0x529eb0){return _0x54c390['status'](_0x16a8a9)[_0x11e3('0x1b')](_0x529eb0);}};}function respondWithFilteredResult(_0x258c13,_0x32ba17){return function(_0x57da34){if(_0x57da34){var _0xacddab=typeof _0x32ba17[_0x11e3('0x1c')]==='undefined'&&typeof _0x32ba17[_0x11e3('0x1d')]==='undefined';var _0x386e39=_0x57da34[_0x11e3('0x1e')];var _0x415231=_0xacddab?0x0:_0x32ba17['offset'];var _0x557e3c=_0xacddab?_0x57da34[_0x11e3('0x1e')]:_0x32ba17['offset']+_0x32ba17['limit'];var _0x5c0a37;if(_0x557e3c>=_0x386e39){_0x557e3c=_0x386e39;_0x5c0a37=0xc8;}else{_0x5c0a37=0xce;}_0x258c13[_0x11e3('0x19')](_0x5c0a37);return _0x258c13[_0x11e3('0x1f')]('Content-Range',_0x415231+'-'+_0x557e3c+'/'+_0x386e39)[_0x11e3('0x1b')](_0x57da34);}return null;};}function patchUpdates(_0x5ea3b2){return function(_0x189f7f){try{jsonpatch[_0x11e3('0x20')](_0x189f7f,_0x5ea3b2,!![]);}catch(_0x1ebba6){return BPromise[_0x11e3('0x21')](_0x1ebba6);}return _0x189f7f[_0x11e3('0x22')]();};}function saveUpdates(_0x233f49,_0x3941d9){return function(_0x38e9b4){if(_0x38e9b4){return _0x38e9b4[_0x11e3('0x23')](_0x233f49)['then'](function(_0x55196d){return _0x55196d;});}return null;};}function removeEntity(_0x4e8717,_0x1bb228){return function(_0x104980){if(_0x104980){return _0x104980[_0x11e3('0x24')]()['then'](function(){var _0x19e138=_0x104980[_0x11e3('0x25')]({'plain':!![]});var _0x496a6b=_0x11e3('0x26');return db[_0x11e3('0x27')][_0x11e3('0x24')]({'where':{'type':_0x496a6b,'resourceId':_0x19e138['id']}})[_0x11e3('0x28')](function(){return _0x104980;});})[_0x11e3('0x28')](function(){_0x4e8717[_0x11e3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa808d0,_0xc9a045){return function(_0x27a110){if(!_0x27a110){_0xa808d0[_0x11e3('0x18')](0x194);}return _0x27a110;};}function handleError(_0x2575b2,_0x407aae){_0x407aae=_0x407aae||0x1f4;return function(_0x3ddf13){logger['error'](_0x3ddf13[_0x11e3('0x29')]);if(_0x3ddf13['name']){delete _0x3ddf13[_0x11e3('0x2a')];}_0x2575b2[_0x11e3('0x19')](_0x407aae)[_0x11e3('0x2b')](_0x3ddf13);};}exports[_0x11e3('0x2c')]=function(_0x32b385,_0x4f97f0){var _0x1ebdd5={},_0x2bb204={},_0x33ab83={'count':0x0,'rows':[]};var _0x393d2f=_[_0x11e3('0x2d')](db['Variable'][_0x11e3('0x2e')],function(_0x2e97c0){return{'name':_0x2e97c0[_0x11e3('0x2f')],'type':_0x2e97c0[_0x11e3('0x30')][_0x11e3('0x31')]};});_0x2bb204[_0x11e3('0x32')]=_[_0x11e3('0x2d')](_0x393d2f,_0x11e3('0x2a'));_0x2bb204[_0x11e3('0x33')]=_['keys'](_0x32b385['query']);_0x2bb204[_0x11e3('0x34')]=_[_0x11e3('0x35')](_0x2bb204[_0x11e3('0x32')],_0x2bb204[_0x11e3('0x33')]);_0x1ebdd5[_0x11e3('0x36')]=_[_0x11e3('0x35')](_0x2bb204[_0x11e3('0x32')],qs[_0x11e3('0x37')](_0x32b385[_0x11e3('0x33')][_0x11e3('0x37')]));_0x1ebdd5[_0x11e3('0x36')]=_0x1ebdd5[_0x11e3('0x36')][_0x11e3('0x38')]?_0x1ebdd5[_0x11e3('0x36')]:_0x2bb204[_0x11e3('0x32')];if(!_0x32b385[_0x11e3('0x33')][_0x11e3('0x39')](_0x11e3('0x3a'))){_0x1ebdd5[_0x11e3('0x1d')]=qs['limit'](_0x32b385[_0x11e3('0x33')][_0x11e3('0x1d')]);_0x1ebdd5[_0x11e3('0x1c')]=qs[_0x11e3('0x1c')](_0x32b385[_0x11e3('0x33')][_0x11e3('0x1c')]);}_0x1ebdd5[_0x11e3('0x3b')]=qs['sort'](_0x32b385[_0x11e3('0x33')][_0x11e3('0x3c')]);_0x1ebdd5[_0x11e3('0x3d')]=qs['filters'](_[_0x11e3('0x3e')](_0x32b385[_0x11e3('0x33')],_0x2bb204[_0x11e3('0x34')]),_0x393d2f);if(_0x32b385['query'][_0x11e3('0x3f')]){_0x1ebdd5[_0x11e3('0x3d')]=_['merge'](_0x1ebdd5['where'],{'$or':_[_0x11e3('0x2d')](_0x393d2f,function(_0x5628d1){if(_0x5628d1[_0x11e3('0x30')]!==_0x11e3('0x40')){var _0xd5de31={};_0xd5de31[_0x5628d1['name']]={'$like':'%'+_0x32b385['query']['filter']+'%'};return _0xd5de31;}})});}_0x1ebdd5=_[_0x11e3('0x41')]({},_0x1ebdd5,_0x32b385['options']);var _0x347462={'where':_0x1ebdd5['where']};return db['Variable'][_0x11e3('0x1e')](_0x347462)[_0x11e3('0x28')](function(_0x5bca4e){_0x33ab83[_0x11e3('0x1e')]=_0x5bca4e;if(_0x32b385[_0x11e3('0x33')][_0x11e3('0x42')]){_0x1ebdd5[_0x11e3('0x43')]=[{'all':!![]}];}return db[_0x11e3('0x44')][_0x11e3('0x45')](_0x1ebdd5);})['then'](function(_0x9cf9d9){_0x33ab83[_0x11e3('0x46')]=_0x9cf9d9;return _0x33ab83;})[_0x11e3('0x28')](respondWithFilteredResult(_0x4f97f0,_0x1ebdd5))['catch'](handleError(_0x4f97f0,null));};exports[_0x11e3('0x47')]=function(_0x349366,_0x7eb240){var _0x5ddb81={'raw':!![],'where':{'id':_0x349366[_0x11e3('0x48')]['id']}},_0x366c2a={};_0x366c2a['model']=_[_0x11e3('0x49')](db[_0x11e3('0x44')][_0x11e3('0x2e')]);_0x366c2a[_0x11e3('0x33')]=_[_0x11e3('0x49')](_0x349366[_0x11e3('0x33')]);_0x366c2a['filters']=_[_0x11e3('0x35')](_0x366c2a[_0x11e3('0x32')],_0x366c2a[_0x11e3('0x33')]);_0x5ddb81[_0x11e3('0x36')]=_[_0x11e3('0x35')](_0x366c2a[_0x11e3('0x32')],qs[_0x11e3('0x37')](_0x349366[_0x11e3('0x33')][_0x11e3('0x37')]));_0x5ddb81[_0x11e3('0x36')]=_0x5ddb81['attributes'][_0x11e3('0x38')]?_0x5ddb81[_0x11e3('0x36')]:_0x366c2a[_0x11e3('0x32')];if(_0x349366[_0x11e3('0x33')][_0x11e3('0x42')]){_0x5ddb81[_0x11e3('0x43')]=[{'all':!![]}];}_0x5ddb81=_[_0x11e3('0x41')]({},_0x5ddb81,_0x349366[_0x11e3('0x4a')]);return db[_0x11e3('0x44')][_0x11e3('0x4b')](_0x5ddb81)[_0x11e3('0x28')](handleEntityNotFound(_0x7eb240,null))[_0x11e3('0x28')](respondWithResult(_0x7eb240,null))['catch'](handleError(_0x7eb240,null));};exports[_0x11e3('0x4c')]=function(_0x5e46a3,_0x1d0ce6){return db[_0x11e3('0x44')][_0x11e3('0x4c')](_0x5e46a3[_0x11e3('0x4d')],{})[_0x11e3('0x28')](function(_0x42ee5a){var _0x58c9e2=_0x5e46a3[_0x11e3('0x4e')][_0x11e3('0x25')]({'plain':!![]});if(!_0x58c9e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58c9e2['role']===_0x11e3('0x4e')){var _0x72566a=_0x42ee5a['get']({'plain':!![]});var _0x4d30bf=_0x11e3('0x26');return db[_0x11e3('0x4f')][_0x11e3('0x4b')]({'where':{'name':_0x4d30bf,'userProfileId':_0x58c9e2['userProfileId']},'raw':!![]})[_0x11e3('0x28')](function(_0x20d39c){if(_0x20d39c&&_0x20d39c['autoAssociation']===0x0){return db['UserProfileResource'][_0x11e3('0x4c')]({'name':_0x72566a[_0x11e3('0x2a')],'resourceId':_0x72566a['id'],'type':_0x20d39c['name'],'sectionId':_0x20d39c['id']},{})[_0x11e3('0x28')](function(){return _0x42ee5a;});}else{return _0x42ee5a;}})[_0x11e3('0x50')](function(_0x54f552){logger[_0x11e3('0x51')](_0x11e3('0x52'),_0x54f552);throw _0x54f552;});}return _0x42ee5a;})[_0x11e3('0x28')](respondWithResult(_0x1d0ce6,0xc9))[_0x11e3('0x50')](handleError(_0x1d0ce6,null));};exports['update']=function(_0x510628,_0x56241c){if(_0x510628['body']['id']){delete _0x510628['body']['id'];}return db[_0x11e3('0x44')][_0x11e3('0x4b')]({'where':{'id':_0x510628[_0x11e3('0x48')]['id']}})['then'](handleEntityNotFound(_0x56241c,null))[_0x11e3('0x28')](saveUpdates(_0x510628[_0x11e3('0x4d')],null))[_0x11e3('0x28')](respondWithResult(_0x56241c,null))[_0x11e3('0x50')](handleError(_0x56241c,null));};exports[_0x11e3('0x24')]=function(_0x47a418,_0x303847){return db[_0x11e3('0x44')][_0x11e3('0x4b')]({'where':{'id':_0x47a418[_0x11e3('0x48')]['id']}})[_0x11e3('0x28')](handleEntityNotFound(_0x303847,null))[_0x11e3('0x28')](removeEntity(_0x303847,null))['catch'](handleError(_0x303847,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 076fbda..6f7b916 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 _0xb44f=['path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1fcf0e,_0x4fc15f){var _0x30db67=function(_0x21e0a8){while(--_0x21e0a8){_0x1fcf0e['push'](_0x1fcf0e['shift']());}};_0x30db67(++_0x4fc15f);}(_0xb44f,0x165));var _0xfb44=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb44f[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xfb44('0x0'));var util=require(_0xfb44('0x1'));var logger=require(_0xfb44('0x2'))(_0xfb44('0x3'));var moment=require(_0xfb44('0x4'));var BPromise=require(_0xfb44('0x5'));var rp=require(_0xfb44('0x6'));var fs=require('fs');var path=require(_0xfb44('0x7'));var rimraf=require(_0xfb44('0x8'));var config=require(_0xfb44('0x9'));var attributes=require(_0xfb44('0xa'));module['exports']=function(_0xb881c7,_0x5a6795){return _0xb881c7[_0xfb44('0xb')](_0xfb44('0xc'),attributes,{'tableName':_0xfb44('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3b5=['./variable.attributes','define','Variable','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3b5,0x1b3));var _0x5d3b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd3b5[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x5d3b('0x0'));var logger=require(_0x5d3b('0x1'))('api');var moment=require(_0x5d3b('0x2'));var BPromise=require(_0x5d3b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5d3b('0x4'));var config=require(_0x5d3b('0x5'));var attributes=require(_0x5d3b('0x6'));module['exports']=function(_0x5a7ed6,_0x4ab497){return _0x5a7ed6[_0x5d3b('0x7')](_0x5d3b('0x8'),attributes,{'tableName':'tools_variables','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 e98e9dc..089d667 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x38ba02,_0x512355){var _0x2a6071=function(_0x10a64f){while(--_0x10a64f){_0x38ba02['push'](_0x38ba02['shift']());}};_0x2a6071(++_0x512355);}(_0xabce,0x103));var _0xeabc=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xabce[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x448e1e,_0x3ffa46){var _0x147280=function(_0x2daad9){while(--_0x2daad9){_0x448e1e['push'](_0x448e1e['shift']());}};_0x147280(++_0x3ffa46);}(_0xabce,0x103));var _0xeabc=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xabce[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 4b0d247..49a3d61 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 _0x1e4e=['migrations','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','restart','/migrations'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0x1e4e,0x1c3));var _0xe1e4=function(_0x32df8b,_0x284235){_0x32df8b=_0x32df8b-0x0;var _0x4d75ec=_0x1e4e[_0x32df8b];return _0x4d75ec;};'use strict';var express=require(_0xe1e4('0x0'));var router=express[_0xe1e4('0x1')]();var auth=require(_0xe1e4('0x2'));var controller=require(_0xe1e4('0x3'));router[_0xe1e4('0x4')]('/',controller[_0xe1e4('0x5')]);router['get'](_0xe1e4('0x6'),auth[_0xe1e4('0x7')](),auth[_0xe1e4('0x8')](),controller[_0xe1e4('0x9')]);router[_0xe1e4('0x4')](_0xe1e4('0xa'),auth[_0xe1e4('0x7')](),auth[_0xe1e4('0x8')](),controller[_0xe1e4('0xb')]);router['get']('/pull',auth[_0xe1e4('0x7')](),auth['canUpdate'](),controller['pull']);router[_0xe1e4('0x4')]('/restart',auth[_0xe1e4('0x7')](),controller[_0xe1e4('0xc')]);router[_0xe1e4('0x4')](_0xe1e4('0xd'),controller[_0xe1e4('0xe')]);module['exports']=router; \ No newline at end of file +var _0xb076=['reset','canUpdate','pull','/restart','restart','/migrations','express','Router','../../components/auth/service','get','index','isAuthenticated'];(function(_0x121868,_0x1ca372){var _0x437173=function(_0x532f0b){while(--_0x532f0b){_0x121868['push'](_0x121868['shift']());}};_0x437173(++_0x1ca372);}(_0xb076,0xd2));var _0x6b07=function(_0x28ff9f,_0x2cc4b5){_0x28ff9f=_0x28ff9f-0x0;var _0x4967ae=_0xb076[_0x28ff9f];return _0x4967ae;};'use strict';var express=require(_0x6b07('0x0'));var router=express[_0x6b07('0x1')]();var auth=require(_0x6b07('0x2'));var controller=require('./version.controller');router[_0x6b07('0x3')]('/',controller[_0x6b07('0x4')]);router['get']('/fetch',auth[_0x6b07('0x5')](),auth['canUpdate'](),controller['fetch']);router[_0x6b07('0x3')]('/reset',auth[_0x6b07('0x5')](),auth['canUpdate'](),controller[_0x6b07('0x6')]);router[_0x6b07('0x3')]('/pull',auth[_0x6b07('0x5')](),auth[_0x6b07('0x7')](),controller[_0x6b07('0x8')]);router['get'](_0x6b07('0x9'),auth['isAuthenticated'](),controller[_0x6b07('0xa')]);router[_0x6b07('0x3')](_0x6b07('0xb'),controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 58e4d6a..04f3809 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 _0x9ca3=['json','origin','error','info','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','version','push','sort','sequelize','Migration','constructor','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','2.0.0','status'];(function(_0x472085,_0xb4b247){var _0x5f1d0a=function(_0x2a677c){while(--_0x2a677c){_0x472085['push'](_0x472085['shift']());}};_0x5f1d0a(++_0xb4b247);}(_0x9ca3,0xb6));var _0x39ca=function(_0x210214,_0x5b921b){_0x210214=_0x210214-0x0;var _0x117145=_0x9ca3[_0x210214];return _0x117145;};'use strict';var Umzug=require('umzug');var path=require(_0x39ca('0x0'));var fs=require('fs');var _=require(_0x39ca('0x1'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0x39ca('0x2'));var exec=require(_0x39ca('0x3'))[_0x39ca('0x4')];var db=require(_0x39ca('0x5'))['db'];var config=require(_0x39ca('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x39ca('0x7'))(_0x39ca('0x8'));var git=require(_0x39ca('0x9'))(config[_0x39ca('0xa')]);exports[_0x39ca('0xb')]=function(_0x2f39a2,_0xa46923){var _0x3ad753={'current':module[_0x39ca('0xc')]['version'],'phonebar':0x2};if(_0x2f39a2[_0x39ca('0xd')]&&_0x2f39a2[_0x39ca('0xd')][_0x39ca('0xe')]){return git[_0x39ca('0xf')]()['tags'](function(_0x23c3ce,_0x3682b9){_0x3ad753[_0x39ca('0xe')]=(_0x23c3ce?module[_0x39ca('0xc')]['version']:_0x3682b9[_0x39ca('0xe')])||_0x39ca('0x10');return _0xa46923[_0x39ca('0x11')](0xc8)[_0x39ca('0x12')](_0x3ad753);});}else{return _0xa46923[_0x39ca('0x11')](0xc8)[_0x39ca('0x12')](_0x3ad753);}};exports[_0x39ca('0xf')]=function(_0x5aecb2,_0x28de48){return git[_0x39ca('0xf')]([_0x39ca('0x13'),'master'],function(_0x9a269b){if(_0x9a269b){logger[_0x39ca('0x14')](_0x9a269b);return _0x28de48['status'](0x1f4)[_0x39ca('0x12')](_0x9a269b);}logger[_0x39ca('0x15')]('git\x20fetch');return _0x28de48[_0x39ca('0x11')](0xc8)[_0x39ca('0x12')]({'output':_0x39ca('0x16')});});};exports['reset']=function(_0xa70975,_0x42bf03){return git[_0x39ca('0x17')]([_0x39ca('0x18'),'FETCH_HEAD'],function(_0x3bd37e){if(_0x3bd37e){logger[_0x39ca('0x14')](_0x3bd37e);return _0x42bf03[_0x39ca('0x11')](0x1f4)[_0x39ca('0x12')](_0x3bd37e);}logger['info'](_0x39ca('0x19'));return _0x42bf03[_0x39ca('0x11')](0xc8)[_0x39ca('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x39ca('0x1a')]=function(_0x501cf0,_0x49050c){exec('npm\x20install\x20--production',function(_0x140ed3,_0x5a85a5,_0x31c82f){logger[_0x39ca('0x15')](_0x5a85a5);logger[_0x39ca('0x15')](_0x31c82f);if(_0x140ed3){logger[_0x39ca('0x14')](_0x140ed3);return _0x49050c['status'](0x1f4)['json'](_0x140ed3);}return _0x49050c[_0x39ca('0x11')](0xc8)[_0x39ca('0x12')]({'output':_0x5a85a5});});};exports[_0x39ca('0x1b')]=function(_0x275ee2,_0x625773){return pm2[_0x39ca('0x1b')](_0x39ca('0x1c'))[_0x39ca('0x1d')](function(_0x4c1876){logger[_0x39ca('0x15')]('pm2\x20restart\x20motion\x20%s',_0x4c1876);return _0x625773[_0x39ca('0x11')](0xc8)['json']({'output':_0x39ca('0x1e')});})[_0x39ca('0x1f')](function(_0x3bff10){logger[_0x39ca('0x14')](_0x3bff10);return _0x625773[_0x39ca('0x11')](0x1f4)[_0x39ca('0x12')](_0x3bff10);});};exports[_0x39ca('0x20')]=function(_0x1d0c4e,_0x41426d){var _0x2dae96=fs[_0x39ca('0x21')](path[_0x39ca('0x22')](config[_0x39ca('0xa')],_0x39ca('0x23'),_0x39ca('0x20')));var _0x247274=[];for(var _0x63102f=0x0;_0x63102f<_0x2dae96[_0x39ca('0x24')];_0x63102f++){var _0x1d252b=_0x2dae96[_0x63102f][_0x39ca('0x25')](_0x39ca('0x26'),'');if(compareVersions(module[_0x39ca('0xc')][_0x39ca('0x27')],_0x1d252b)===-0x1){_0x247274[_0x39ca('0x28')](_0x1d252b);}}if(_0x247274['length']){var _0x33f180=_0x247274[_0x39ca('0x29')](compareVersions);var _0xcf9a1b=new Umzug({'storage':_0x39ca('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':_0x39ca('0x2b'),'columnName':_0x39ca('0x27')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0x39ca('0x2a')][_0x39ca('0x2c')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x39ca('0x22')](config[_0x39ca('0xa')],'server',_0x39ca('0x20')),'pattern':/\.js$/}});_0xcf9a1b['up']({'migrations':_[_0x39ca('0x2d')](_0x33f180,function(_0x5a178d){return _0x5a178d+'.js';})})['then'](function(){return _0x41426d[_0x39ca('0x11')](0xc8)[_0x39ca('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x39ca('0xc')]['version']+_0x39ca('0x2e')+_[_0x39ca('0x2f')](_0x33f180),'migrations':_['join'](_0x33f180)});})[_0x39ca('0x1f')](function(_0x10fa2a){if(_0x10fa2a instanceof db[_0x39ca('0x2a')][_0x39ca('0x30')]){return _0x41426d[_0x39ca('0x11')](0xc8)[_0x39ca('0x12')]({'output':_0x39ca('0x31')});}else{return _0x41426d[_0x39ca('0x11')](0x1f4)[_0x39ca('0x12')](_0x10fa2a);}});}else{return _0x41426d['status'](0xc8)[_0x39ca('0x12')]({'output':_0x39ca('0x31')});}}; \ No newline at end of file +var _0x955b=['status','json','origin','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','replace','.js','push','length','sort','Migration','getQueryInterface','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0'];(function(_0x25eb1a,_0x586b2e){var _0x456f7d=function(_0x2a4706){while(--_0x2a4706){_0x25eb1a['push'](_0x25eb1a['shift']());}};_0x456f7d(++_0x586b2e);}(_0x955b,0x17c));var _0xb955=function(_0x314c95,_0x1c544e){_0x314c95=_0x314c95-0x0;var _0x36ce33=_0x955b[_0x314c95];return _0x36ce33;};'use strict';var Umzug=require(_0xb955('0x0'));var path=require(_0xb955('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xb955('0x2'))(module,_0xb955('0x3'));var compareVersions=require(_0xb955('0x4'));var exec=require(_0xb955('0x5'))['exec'];var db=require(_0xb955('0x6'))['db'];var config=require(_0xb955('0x7'));var pm2=require(_0xb955('0x8'));var logger=require('../../config/logger')(_0xb955('0x9'));var git=require(_0xb955('0xa'))(config[_0xb955('0xb')]);exports[_0xb955('0xc')]=function(_0x3514a3,_0x37de5e){var _0x720afe={'current':module[_0xb955('0xd')][_0xb955('0x3')],'phonebar':0x2};if(_0x3514a3[_0xb955('0xe')]&&_0x3514a3[_0xb955('0xe')][_0xb955('0xf')]){return git[_0xb955('0x10')]()[_0xb955('0x11')](function(_0x427ff9,_0x3a8c76){_0x720afe['latest']=(_0x427ff9?module[_0xb955('0xd')][_0xb955('0x3')]:_0x3a8c76[_0xb955('0xf')])||_0xb955('0x12');return _0x37de5e[_0xb955('0x13')](0xc8)['json'](_0x720afe);});}else{return _0x37de5e[_0xb955('0x13')](0xc8)[_0xb955('0x14')](_0x720afe);}};exports[_0xb955('0x10')]=function(_0x1e5c30,_0x181a36){return git[_0xb955('0x10')]([_0xb955('0x15'),_0xb955('0x16')],function(_0x323f49){if(_0x323f49){logger['error'](_0x323f49);return _0x181a36[_0xb955('0x13')](0x1f4)[_0xb955('0x14')](_0x323f49);}logger[_0xb955('0x17')](_0xb955('0x18'));return _0x181a36['status'](0xc8)[_0xb955('0x14')]({'output':_0xb955('0x19')});});};exports[_0xb955('0x1a')]=function(_0x39f23d,_0x37214d){return git[_0xb955('0x1a')]([_0xb955('0x1b'),_0xb955('0x1c')],function(_0x374d6b){if(_0x374d6b){logger['error'](_0x374d6b);return _0x37214d[_0xb955('0x13')](0x1f4)[_0xb955('0x14')](_0x374d6b);}logger['info'](_0xb955('0x1d'));return _0x37214d[_0xb955('0x13')](0xc8)[_0xb955('0x14')]({'output':_0xb955('0x1e')});});};exports['pull']=function(_0x1ffceb,_0x3de261){exec(_0xb955('0x1f'),function(_0x184756,_0x3605b9,_0x4ab0b2){logger[_0xb955('0x17')](_0x3605b9);logger[_0xb955('0x17')](_0x4ab0b2);if(_0x184756){logger[_0xb955('0x20')](_0x184756);return _0x3de261[_0xb955('0x13')](0x1f4)[_0xb955('0x14')](_0x184756);}return _0x3de261[_0xb955('0x13')](0xc8)['json']({'output':_0x3605b9});});};exports[_0xb955('0x21')]=function(_0x164a4f,_0x43bbfe){return pm2[_0xb955('0x21')](_0xb955('0x22'))[_0xb955('0x23')](function(_0x3a8548){logger['info'](_0xb955('0x24'),_0x3a8548);return _0x43bbfe['status'](0xc8)[_0xb955('0x14')]({'output':_0xb955('0x25')});})[_0xb955('0x26')](function(_0x464989){logger['error'](_0x464989);return _0x43bbfe[_0xb955('0x13')](0x1f4)[_0xb955('0x14')](_0x464989);});};exports[_0xb955('0x27')]=function(_0x390218,_0x3e4e58){var _0x999ca3=fs[_0xb955('0x28')](path[_0xb955('0x29')](config[_0xb955('0xb')],_0xb955('0x2a'),'migrations'));var _0x17a40a=[];for(var _0x456163=0x0;_0x456163<_0x999ca3['length'];_0x456163++){var _0x2686f2=_0x999ca3[_0x456163][_0xb955('0x2b')](_0xb955('0x2c'),'');if(compareVersions(module[_0xb955('0xd')]['version'],_0x2686f2)===-0x1){_0x17a40a[_0xb955('0x2d')](_0x2686f2);}}if(_0x17a40a[_0xb955('0x2e')]){var _0x5d404c=_0x17a40a[_0xb955('0x2f')](compareVersions);var _0x324579=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xb955('0x30')],'modelName':_0xb955('0x30'),'columnName':_0xb955('0x3')},'migrations':{'params':[db['sequelize'][_0xb955('0x31')](),db[_0xb955('0x32')][_0xb955('0x33')],function(){throw new Error(_0xb955('0x34'));}],'path':path['join'](config[_0xb955('0xb')],_0xb955('0x2a'),_0xb955('0x27')),'pattern':/\.js$/}});_0x324579['up']({'migrations':_[_0xb955('0x35')](_0x5d404c,function(_0x57b6ce){return _0x57b6ce+_0xb955('0x2c');})})[_0xb955('0x23')](function(){return _0x3e4e58[_0xb955('0x13')](0xc8)[_0xb955('0x14')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xb955('0xd')][_0xb955('0x3')]+'\x20to\x20'+_[_0xb955('0x36')](_0x5d404c),'migrations':_[_0xb955('0x29')](_0x5d404c)});})['catch'](function(_0x138219){if(_0x138219 instanceof db[_0xb955('0x32')][_0xb955('0x37')]){return _0x3e4e58[_0xb955('0x13')](0xc8)['json']({'output':_0xb955('0x38')});}else{return _0x3e4e58[_0xb955('0x13')](0x1f4)[_0xb955('0x14')](_0x138219);}});}else{return _0x3e4e58[_0xb955('0x13')](0xc8)[_0xb955('0x14')]({'output':_0xb955('0x38')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 4ed0f05..3dfd1a5 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 _0x1bde=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','show','create','put','/:id','update','delete','destroy','multer','path','fs-extra','../../components/auth/service'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x1bde,0x11d));var _0xe1bd=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x1bde[_0x34e752];return _0x7c6347;};'use strict';var multer=require(_0xe1bd('0x0'));var util=require('util');var path=require(_0xe1bd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe1bd('0x2'));var auth=require(_0xe1bd('0x3'));var interaction=require(_0xe1bd('0x4'));var config=require(_0xe1bd('0x5'));var controller=require(_0xe1bd('0x6'));router[_0xe1bd('0x7')]('/',auth[_0xe1bd('0x8')](),controller['index']);router[_0xe1bd('0x7')](_0xe1bd('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xe1bd('0x7')]('/:id',auth[_0xe1bd('0x8')](),controller[_0xe1bd('0xa')]);router['post']('/',auth[_0xe1bd('0x8')](),controller[_0xe1bd('0xb')]);router[_0xe1bd('0xc')](_0xe1bd('0xd'),auth['isAuthenticated'](),controller[_0xe1bd('0xe')]);router[_0xe1bd('0xf')]('/:id',auth[_0xe1bd('0x8')](),controller[_0xe1bd('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa84c=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa84c,0xef));var _0xca84=function(_0x4b2d7e,_0x1e24a9){_0x4b2d7e=_0x4b2d7e-0x0;var _0x55a0cc=_0xa84c[_0x4b2d7e];return _0x55a0cc;};'use strict';var multer=require(_0xca84('0x0'));var util=require('util');var path=require(_0xca84('0x1'));var timeout=require('connect-timeout');var express=require(_0xca84('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xca84('0x3'));var interaction=require(_0xca84('0x4'));var config=require(_0xca84('0x5'));var controller=require('./voiceAgentReport.controller');router[_0xca84('0x6')]('/',auth[_0xca84('0x7')](),controller[_0xca84('0x8')]);router[_0xca84('0x6')](_0xca84('0x9'),auth[_0xca84('0x7')](),controller[_0xca84('0xa')]);router['get'](_0xca84('0xb'),auth[_0xca84('0x7')](),controller['show']);router[_0xca84('0xc')]('/',auth[_0xca84('0x7')](),controller[_0xca84('0xd')]);router[_0xca84('0xe')](_0xca84('0xb'),auth[_0xca84('0x7')](),controller['update']);router['delete']('/:id',auth[_0xca84('0x7')](),controller['destroy']);module[_0xca84('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index cba336c..3169108 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 _0x6132=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0x6132,0xf3));var _0x2613=function(_0x1497cb,_0x19cc18){_0x1497cb=_0x1497cb-0x0;var _0x735cde=_0x6132[_0x1497cb];return _0x735cde;};'use strict';var Sequelize=require('sequelize');module[_0x2613('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2613('0x1')]},'calleridnum':{'type':Sequelize[_0x2613('0x1')]},'calleridname':{'type':Sequelize[_0x2613('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2613('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x2613('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x2613('0x2')]},'agentdumpAt':{'type':Sequelize[_0x2613('0x2')]},'holdtime':{'type':Sequelize[_0x2613('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x2613('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x2613('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2613('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x2613('0x1')]},'channel':{'type':Sequelize[_0x2613('0x1')]},'channelstate':{'type':Sequelize[_0x2613('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2613('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2613('0x1')]},'connectedlinename':{'type':Sequelize[_0x2613('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x2613('0x1')]},'context':{'type':Sequelize[_0x2613('0x1')]},'exten':{'type':Sequelize[_0x2613('0x1')]},'priority':{'type':Sequelize[_0x2613('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x2613('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2613('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2613('0x1')]},'destcalleridname':{'type':Sequelize[_0x2613('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2613('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x2613('0x1')]},'destlanguage':{'type':Sequelize[_0x2613('0x1')]},'destaccountcode':{'type':Sequelize[_0x2613('0x1')]},'destcontext':{'type':Sequelize[_0x2613('0x1')]},'destexten':{'type':Sequelize[_0x2613('0x1')]},'destpriority':{'type':Sequelize[_0x2613('0x1')]},'destuniqueid':{'type':Sequelize[_0x2613('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2613('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x2613('0x1')]},'transfer':{'type':Sequelize[_0x2613('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2613('0x1')],'comment':_0x2613('0x5')},'transferexten':{'type':Sequelize[_0x2613('0x1')]},'transferuniqueid':{'type':Sequelize[_0x2613('0x1')]},'agententerreason':{'type':Sequelize[_0x2613('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa8b1=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x175479,_0x434797){var _0x549315=function(_0x29a397){while(--_0x29a397){_0x175479['push'](_0x175479['shift']());}};_0x549315(++_0x434797);}(_0xa8b1,0x182));var _0x1a8b=function(_0x21a88,_0x4b1128){_0x21a88=_0x21a88-0x0;var _0x5b9bb4=_0xa8b1[_0x21a88];return _0x5b9bb4;};'use strict';var Sequelize=require(_0x1a8b('0x0'));module[_0x1a8b('0x1')]={'type':{'type':Sequelize[_0x1a8b('0x2')]},'uniqueid':{'type':Sequelize[_0x1a8b('0x2')]},'calleridnum':{'type':Sequelize[_0x1a8b('0x2')]},'calleridname':{'type':Sequelize[_0x1a8b('0x2')]},'queue':{'type':Sequelize[_0x1a8b('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x1a8b('0x3')]},'agentconnectAt':{'type':Sequelize[_0x1a8b('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x1a8b('0x3')]},'agentdumpAt':{'type':Sequelize[_0x1a8b('0x3')]},'holdtime':{'type':Sequelize[_0x1a8b('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x1a8b('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x1a8b('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x1a8b('0x4')]},'agentacw':{'type':Sequelize[_0x1a8b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1a8b('0x4')]},'reason':{'type':Sequelize[_0x1a8b('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1a8b('0x2')]},'channelstate':{'type':Sequelize[_0x1a8b('0x4')]},'channelstatedesc':{'type':Sequelize[_0x1a8b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1a8b('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1a8b('0x2')]},'accountcode':{'type':Sequelize[_0x1a8b('0x2')]},'context':{'type':Sequelize[_0x1a8b('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x1a8b('0x2')]},'destchannelstate':{'type':Sequelize[_0x1a8b('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x1a8b('0x2')]},'destcalleridname':{'type':Sequelize[_0x1a8b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1a8b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1a8b('0x2')]},'destlanguage':{'type':Sequelize[_0x1a8b('0x2')]},'destaccountcode':{'type':Sequelize[_0x1a8b('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x1a8b('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x1a8b('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x1a8b('0x2')]},'transfer':{'type':Sequelize[_0x1a8b('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1a8b('0x2')],'comment':_0x1a8b('0x6')},'transferexten':{'type':Sequelize[_0x1a8b('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x1a8b('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 1627a1f..09a4385 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(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 2a8569d..afbbdc6 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 _0xa74a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','VoiceAgentReport','report_agent','destuniqueid','lodash','util'];(function(_0x57537f,_0x76ed18){var _0x58ad18=function(_0x151b0e){while(--_0x151b0e){_0x57537f['push'](_0x57537f['shift']());}};_0x58ad18(++_0x76ed18);}(_0xa74a,0x66));var _0xaa74=function(_0x39e1a8,_0x18eb95){_0x39e1a8=_0x39e1a8-0x0;var _0x456146=_0xa74a[_0x39e1a8];return _0x456146;};'use strict';var _=require(_0xaa74('0x0'));var util=require(_0xaa74('0x1'));var logger=require(_0xaa74('0x2'))(_0xaa74('0x3'));var moment=require(_0xaa74('0x4'));var BPromise=require(_0xaa74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa74('0x6'));var rimraf=require(_0xaa74('0x7'));var config=require(_0xaa74('0x8'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x24eee1,_0x44250c){return _0x24eee1[_0xaa74('0x9')](_0xaa74('0xa'),attributes,{'tableName':_0xaa74('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xaa74('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','destuniqueid'];(function(_0x2c275b,_0x370f23){var _0x54e7da=function(_0x1656ee){while(--_0x1656ee){_0x2c275b['push'](_0x2c275b['shift']());}};_0x54e7da(++_0x370f23);}(_0x008c,0x188));var _0xc008=function(_0x1920ad,_0x4e7462){_0x1920ad=_0x1920ad-0x0;var _0x1024af=_0x008c[_0x1920ad];return _0x1024af;};'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')]('VoiceAgentReport',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xc008('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 895c705..1f2d714 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 _0x489f=['limit','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','debug','request\x20sent','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','update','where','attributes'];(function(_0x3cfbc0,_0x5960d8){var _0x319cb3=function(_0x4ecb02){while(--_0x4ecb02){_0x3cfbc0['push'](_0x3cfbc0['shift']());}};_0x319cb3(++_0x5960d8);}(_0x489f,0x138));var _0xf489=function(_0x10da24,_0x26e5ff){_0x10da24=_0x10da24-0x0;var _0x48faf5=_0x489f[_0x10da24];return _0x48faf5;};'use strict';var _=require(_0xf489('0x0'));var util=require(_0xf489('0x1'));var moment=require(_0xf489('0x2'));var BPromise=require(_0xf489('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf489('0x4'));var logger=require(_0xf489('0x5'))('rpc');var config=require(_0xf489('0x6'));var jayson=require(_0xf489('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x22c66b,_0x1e4dc5,_0x5198c8){return new BPromise(function(_0x418067,_0x1f1bb2){return client[_0xf489('0x8')](_0x22c66b,_0x5198c8)['then'](function(_0xc4c5a7){logger[_0xf489('0x9')]('VoiceAgentReport,\x20%s,\x20%s',_0x1e4dc5,'request\x20sent');logger[_0xf489('0xa')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1e4dc5,_0xf489('0xb'),JSON['stringify'](_0xc4c5a7));if(_0xc4c5a7[_0xf489('0xc')]){if(_0xc4c5a7[_0xf489('0xc')][_0xf489('0xd')]===0x1f4){logger['error'](_0xf489('0xe'),_0x1e4dc5,_0xc4c5a7[_0xf489('0xc')][_0xf489('0xf')]);return _0x1f1bb2(_0xc4c5a7[_0xf489('0xc')]['message']);}logger[_0xf489('0xc')](_0xf489('0xe'),_0x1e4dc5,_0xc4c5a7[_0xf489('0xc')][_0xf489('0xf')]);return _0x418067(_0xc4c5a7[_0xf489('0xc')][_0xf489('0xf')]);}else{logger[_0xf489('0x9')](_0xf489('0xe'),_0x1e4dc5,_0xf489('0xb'));_0x418067(_0xc4c5a7[_0xf489('0x10')]['message']);}})[_0xf489('0x11')](function(_0x2972a6){logger[_0xf489('0xc')](_0xf489('0xe'),_0x1e4dc5,_0x2972a6);_0x1f1bb2(_0x2972a6);});});}exports[_0xf489('0x12')]=function(_0x17dd09){var _0x4f1005=this;return new Promise(function(_0x586f09,_0x594f6c){return db[_0xf489('0x13')][_0xf489('0x14')](_0x17dd09[_0xf489('0x15')],{'raw':_0x17dd09[_0xf489('0x16')]?_0x17dd09['options'][_0xf489('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5285af){logger[_0xf489('0x9')](_0xf489('0x12'),_0x17dd09);logger[_0xf489('0xa')](_0xf489('0x12'),_0x17dd09,JSON[_0xf489('0x18')](_0x5285af));_0x586f09(_0x5285af);})[_0xf489('0x11')](function(_0x55dbb2){logger[_0xf489('0xc')](_0xf489('0x12'),_0x55dbb2[_0xf489('0xf')],_0x17dd09);_0x594f6c(_0x4f1005[_0xf489('0xc')](0x1f4,_0x55dbb2[_0xf489('0xf')]));});});};exports[_0xf489('0x19')]=function(_0x55a521){var _0x592a0c=this;return new Promise(function(_0x526a3c,_0xdedc0c){return db[_0xf489('0x13')][_0xf489('0x1a')](_0x55a521[_0xf489('0x15')],{'raw':_0x55a521[_0xf489('0x16')]?_0x55a521['options'][_0xf489('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55a521['options']?_0x55a521['options'][_0xf489('0x1b')]||null:null,'attributes':_0x55a521[_0xf489('0x16')]?_0x55a521[_0xf489('0x16')][_0xf489('0x1c')]||null:null,'limit':_0x55a521[_0xf489('0x16')]?_0x55a521[_0xf489('0x16')][_0xf489('0x1d')]||null:null})[_0xf489('0x1e')](function(_0x5258ba){logger[_0xf489('0x9')](_0xf489('0x19'),_0x55a521);logger[_0xf489('0xa')](_0xf489('0x19'),_0x55a521,JSON['stringify'](_0x5258ba));_0x526a3c(_0x5258ba);})[_0xf489('0x11')](function(_0x157d99){logger['error'](_0xf489('0x19'),_0x157d99[_0xf489('0xf')],_0x55a521);_0xdedc0c(_0x592a0c[_0xf489('0xc')](0x1f4,_0x157d99[_0xf489('0xf')]));});});}; \ No newline at end of file +var _0x67cc=['error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','UpdateVoiceAgentReport','update','body','raw','where','limit','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x24d03b,_0x530302){var _0x49a524=function(_0x420cdf){while(--_0x420cdf){_0x24d03b['push'](_0x24d03b['shift']());}};_0x49a524(++_0x530302);}(_0x67cc,0x145));var _0xc67c=function(_0x3c82e2,_0x2bff81){_0x3c82e2=_0x3c82e2-0x0;var _0x1317b8=_0x67cc[_0x3c82e2];return _0x1317b8;};'use strict';var _=require(_0xc67c('0x0'));var util=require(_0xc67c('0x1'));var moment=require(_0xc67c('0x2'));var BPromise=require(_0xc67c('0x3'));var rs=require(_0xc67c('0x4'));var fs=require('fs');var Redis=require(_0xc67c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc67c('0x6'))(_0xc67c('0x7'));var config=require('../../config/environment');var jayson=require(_0xc67c('0x8'));var client=jayson[_0xc67c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbb3c6c,_0x2ce55f,_0x37043b){return new BPromise(function(_0x205588,_0x359c19){return client['request'](_0xbb3c6c,_0x37043b)[_0xc67c('0xa')](function(_0x21814e){logger['info'](_0xc67c('0xb'),_0x2ce55f,_0xc67c('0xc'));logger[_0xc67c('0xd')](_0xc67c('0xe'),_0x2ce55f,_0xc67c('0xc'),JSON[_0xc67c('0xf')](_0x21814e));if(_0x21814e[_0xc67c('0x10')]){if(_0x21814e[_0xc67c('0x10')]['code']===0x1f4){logger[_0xc67c('0x10')](_0xc67c('0xb'),_0x2ce55f,_0x21814e['error'][_0xc67c('0x11')]);return _0x359c19(_0x21814e[_0xc67c('0x10')][_0xc67c('0x11')]);}logger['error'](_0xc67c('0xb'),_0x2ce55f,_0x21814e[_0xc67c('0x10')][_0xc67c('0x11')]);return _0x205588(_0x21814e[_0xc67c('0x10')][_0xc67c('0x11')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x2ce55f,'request\x20sent');_0x205588(_0x21814e[_0xc67c('0x12')][_0xc67c('0x11')]);}})[_0xc67c('0x13')](function(_0x283347){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x2ce55f,_0x283347);_0x359c19(_0x283347);});});}exports[_0xc67c('0x14')]=function(_0x5d63ab){var _0xc0ebdb=this;return new Promise(function(_0x1fda78,_0x3c0d3a){return db[_0xc67c('0x15')][_0xc67c('0x16')](_0x5d63ab['body'],{'raw':_0x5d63ab[_0xc67c('0x17')]?_0x5d63ab[_0xc67c('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x37c8a2){logger['info'](_0xc67c('0x14'),_0x5d63ab);logger[_0xc67c('0xd')](_0xc67c('0x14'),_0x5d63ab,JSON[_0xc67c('0xf')](_0x37c8a2));_0x1fda78(_0x37c8a2);})[_0xc67c('0x13')](function(_0x5cdde8){logger[_0xc67c('0x10')]('CreateVoiceAgentReport',_0x5cdde8[_0xc67c('0x11')],_0x5d63ab);_0x3c0d3a(_0xc0ebdb[_0xc67c('0x10')](0x1f4,_0x5cdde8[_0xc67c('0x11')]));});});};exports[_0xc67c('0x18')]=function(_0x5c0617){var _0x3cbeb9=this;return new Promise(function(_0x1e2db2,_0x414367){return db[_0xc67c('0x15')][_0xc67c('0x19')](_0x5c0617[_0xc67c('0x1a')],{'raw':_0x5c0617[_0xc67c('0x17')]?_0x5c0617[_0xc67c('0x17')][_0xc67c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c0617['options']?_0x5c0617[_0xc67c('0x17')][_0xc67c('0x1c')]||null:null,'attributes':_0x5c0617[_0xc67c('0x17')]?_0x5c0617[_0xc67c('0x17')]['attributes']||null:null,'limit':_0x5c0617[_0xc67c('0x17')]?_0x5c0617[_0xc67c('0x17')][_0xc67c('0x1d')]||null:null})[_0xc67c('0xa')](function(_0xb5cb27){logger[_0xc67c('0x1e')]('UpdateVoiceAgentReport',_0x5c0617);logger[_0xc67c('0xd')](_0xc67c('0x18'),_0x5c0617,JSON[_0xc67c('0xf')](_0xb5cb27));_0x1e2db2(_0xb5cb27);})['catch'](function(_0x435c3a){logger[_0xc67c('0x10')](_0xc67c('0x18'),_0x435c3a[_0xc67c('0x11')],_0x5c0617);_0x414367(_0x3cbeb9[_0xc67c('0x10')](0x1f4,_0x435c3a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e253952..b52ae1c 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 _0xe0ae=['exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','index','get','/describe','isAuthenticated','show','post','put','/:id','update'];(function(_0x4d2f38,_0x310b0c){var _0x4d76f2=function(_0x29cc76){while(--_0x29cc76){_0x4d2f38['push'](_0x4d2f38['shift']());}};_0x4d76f2(++_0x310b0c);}(_0xe0ae,0xa1));var _0xee0a=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0xe0ae[_0x5ac1e5];return _0x1bccc6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee0a('0x0'));var timeout=require(_0xee0a('0x1'));var express=require('express');var router=express[_0xee0a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xee0a('0x3'));var interaction=require(_0xee0a('0x4'));var config=require('../../config/environment');var controller=require(_0xee0a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xee0a('0x6')]);router[_0xee0a('0x7')](_0xee0a('0x8'),auth[_0xee0a('0x9')](),controller['describe']);router[_0xee0a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xee0a('0xa')]);router[_0xee0a('0xb')]('/',auth[_0xee0a('0x9')](),controller['create']);router[_0xee0a('0xc')](_0xee0a('0xd'),auth['isAuthenticated'](),controller[_0xee0a('0xe')]);router['delete'](_0xee0a('0xd'),auth[_0xee0a('0x9')](),controller['destroy']);module[_0xee0a('0xf')]=router; \ No newline at end of file +var _0x7fbe=['/describe','describe','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x321154,_0x132339){var _0x18451c=function(_0x40de57){while(--_0x40de57){_0x321154['push'](_0x321154['shift']());}};_0x18451c(++_0x132339);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3c5bf1,_0x30bb33){_0x3c5bf1=_0x3c5bf1-0x0;var _0x2dc4d3=_0x7fbe[_0x3c5bf1];return _0x2dc4d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index adf188a..37f0915 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 _0x437b=['INTEGER','sequelize','ENUM','internal','outbound','inbound-fax','dialer','STRING','DATE'];(function(_0x1c8151,_0x1e51d6){var _0xf06d6e=function(_0x550ac6){while(--_0x550ac6){_0x1c8151['push'](_0x1c8151['shift']());}};_0xf06d6e(++_0x1e51d6);}(_0x437b,0x1a8));var _0xb437=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x437b[_0x30c649];return _0x3edfb9;};'use strict';var Sequelize=require(_0xb437('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb437('0x1')]('inbound',_0xb437('0x2'),_0xb437('0x3'),_0xb437('0x4'),'outbound-fax',_0xb437('0x5'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb437('0x6')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xb437('0x6')]},'destinationcontext':{'type':Sequelize[_0xb437('0x6')]},'callerid':{'type':Sequelize[_0xb437('0x6')]},'channel':{'type':Sequelize[_0xb437('0x6')]},'destinationchannel':{'type':Sequelize[_0xb437('0x6')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xb437('0x7')]},'systemanswertime':{'type':Sequelize[_0xb437('0x7')]},'answertime':{'type':Sequelize[_0xb437('0x7')]},'endtime':{'type':Sequelize[_0xb437('0x7')]},'duration':{'type':Sequelize[_0xb437('0x8')]},'billableseconds':{'type':Sequelize[_0xb437('0x8')]},'mohtime':{'type':Sequelize[_0xb437('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb437('0x6')]},'amaflags':{'type':Sequelize[_0xb437('0x6')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb437('0x6')]},'prefix':{'type':Sequelize[_0xb437('0x6')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xb437('0x6')]}}; \ No newline at end of file +var _0xcdec=['DATE','INTEGER','sequelize','exports','STRING','inbound','outbound','inbound-fax','outbound-fax'];(function(_0x27b617,_0x2446d8){var _0x208304=function(_0x646630){while(--_0x646630){_0x27b617['push'](_0x27b617['shift']());}};_0x208304(++_0x2446d8);}(_0xcdec,0x173));var _0xccde=function(_0x28db5c,_0x52a7fe){_0x28db5c=_0x28db5c-0x0;var _0x506857=_0xcdec[_0x28db5c];return _0x506857;};'use strict';var Sequelize=require(_0xccde('0x0'));module[_0xccde('0x1')]={'uniqueid':{'type':Sequelize[_0xccde('0x2')]},'type':{'type':Sequelize['ENUM'](_0xccde('0x3'),'internal',_0xccde('0x4'),_0xccde('0x5'),_0xccde('0x6'),'dialer')},'tag':{'type':Sequelize[_0xccde('0x2')]},'accountcode':{'type':Sequelize[_0xccde('0x2')]},'source':{'type':Sequelize[_0xccde('0x2')]},'destination':{'type':Sequelize[_0xccde('0x2')]},'destinationcontext':{'type':Sequelize[_0xccde('0x2')]},'callerid':{'type':Sequelize[_0xccde('0x2')]},'channel':{'type':Sequelize[_0xccde('0x2')]},'destinationchannel':{'type':Sequelize[_0xccde('0x2')]},'lastapplication':{'type':Sequelize[_0xccde('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xccde('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xccde('0x7')]},'endtime':{'type':Sequelize[_0xccde('0x7')]},'duration':{'type':Sequelize[_0xccde('0x8')]},'billableseconds':{'type':Sequelize[_0xccde('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xccde('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xccde('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xccde('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xccde('0x2')]},'note':{'type':Sequelize[_0xccde('0x2')]},'prefix':{'type':Sequelize[_0xccde('0x2')]},'routeid':{'type':Sequelize[_0xccde('0x8')]},'sipcallid':{'type':Sequelize[_0xccde('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 065a124..6a8ae09 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 _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xadb5,0xad));var _0x5adb=function(_0x29f436,_0x17892a){_0x29f436=_0x29f436-0x0;var _0x1d3313=_0xadb5[_0x29f436];return _0x1d3313;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x2ef3,0xba));var _0x32ef=function(_0x451e20,_0x280edb){_0x451e20=_0x451e20-0x0;var _0x4c514f=_0x2ef3[_0x451e20];return _0x4c514f;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 7987087..c5667de 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 _0x8954=['api','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger'];(function(_0x10915f,_0x53c2c9){var _0x401079=function(_0x5ba556){while(--_0x5ba556){_0x10915f['push'](_0x10915f['shift']());}};_0x401079(++_0x53c2c9);}(_0x8954,0x136));var _0x4895=function(_0x5c846d,_0x5c02ce){_0x5c846d=_0x5c846d-0x0;var _0xd064e4=_0x8954[_0x5c846d];return _0xd064e4;};'use strict';var _=require(_0x4895('0x0'));var util=require('util');var logger=require(_0x4895('0x1'))(_0x4895('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4895('0x3'));var rimraf=require(_0x4895('0x4'));var config=require(_0x4895('0x5'));var attributes=require(_0x4895('0x6'));module[_0x4895('0x7')]=function(_0x48cbde,_0x179f79){return _0x48cbde[_0x4895('0x8')](_0x4895('0x9'),attributes,{'tableName':_0x4895('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4895('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x081a=['moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util','api'];(function(_0x446a62,_0x32bb6d){var _0x16a711=function(_0x33a33d){while(--_0x33a33d){_0x446a62['push'](_0x446a62['shift']());}};_0x16a711(++_0x32bb6d);}(_0x081a,0x176));var _0xa081=function(_0x19e38e,_0xb15cc7){_0x19e38e=_0x19e38e-0x0;var _0x14bec3=_0x081a[_0x19e38e];return _0x14bec3;};'use strict';var _=require(_0xa081('0x0'));var util=require(_0xa081('0x1'));var logger=require('../../config/logger')(_0xa081('0x2'));var moment=require(_0xa081('0x3'));var BPromise=require(_0xa081('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa081('0x5'));var rimraf=require(_0xa081('0x6'));var config=require(_0xa081('0x7'));var attributes=require(_0xa081('0x8'));module[_0xa081('0x9')]=function(_0x19cf1d,_0x448dce){return _0x19cf1d[_0xa081('0xa')](_0xa081('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xa081('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 3ab5a6c..415b3fc 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 _0x9773=['VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','GetVoiceCallReport','VoiceCallReport','options','raw','limit','map','model','include','attributes','then','catch','CreateVoiceCallReport','create','UpdateVoiceCallReport','body','where','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x9773,0x1bc));var _0x3977=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9773[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3977('0x0'));var util=require(_0x3977('0x1'));var moment=require(_0x3977('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3977('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3977('0x4'));var logger=require(_0x3977('0x5'))(_0x3977('0x6'));var config=require(_0x3977('0x7'));var jayson=require(_0x3977('0x8'));var client=jayson[_0x3977('0x9')][_0x3977('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3761a7,_0x209502,_0x239a88){return new BPromise(function(_0x3ba4f6,_0x1b08b5){return client[_0x3977('0xb')](_0x3761a7,_0x239a88)['then'](function(_0x408e98){logger['info'](_0x3977('0xc'),_0x209502,_0x3977('0xd'));logger[_0x3977('0xe')](_0x3977('0xf'),_0x209502,_0x3977('0xd'),JSON[_0x3977('0x10')](_0x408e98));if(_0x408e98['error']){if(_0x408e98['error'][_0x3977('0x11')]===0x1f4){logger[_0x3977('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x209502,_0x408e98[_0x3977('0x12')][_0x3977('0x13')]);return _0x1b08b5(_0x408e98['error'][_0x3977('0x13')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x209502,_0x408e98[_0x3977('0x12')]['message']);return _0x3ba4f6(_0x408e98['error'][_0x3977('0x13')]);}else{logger[_0x3977('0x14')](_0x3977('0xc'),_0x209502,_0x3977('0xd'));_0x3ba4f6(_0x408e98[_0x3977('0x15')][_0x3977('0x13')]);}})['catch'](function(_0x3cd4ef){logger[_0x3977('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x209502,_0x3cd4ef);_0x1b08b5(_0x3cd4ef);});});}exports[_0x3977('0x16')]=function(_0x54835d){var _0x378aed=this;return new Promise(function(_0x402b32,_0x130816){return db[_0x3977('0x17')]['findAll']({'raw':_0x54835d[_0x3977('0x18')]?_0x54835d[_0x3977('0x18')][_0x3977('0x19')]===undefined?!![]:![]:!![],'where':_0x54835d['options']?_0x54835d[_0x3977('0x18')]['where']||null:null,'attributes':_0x54835d[_0x3977('0x18')]?_0x54835d['options']['attributes']||null:null,'limit':_0x54835d[_0x3977('0x18')]?_0x54835d['options'][_0x3977('0x1a')]||null:null,'include':_0x54835d[_0x3977('0x18')]?_0x54835d[_0x3977('0x18')]['include']?_[_0x3977('0x1b')](_0x54835d['options']['include'],function(_0x18a91a){return{'model':db[_0x18a91a[_0x3977('0x1c')]],'as':_0x18a91a['as'],'attributes':_0x18a91a['attributes'],'include':_0x18a91a[_0x3977('0x1d')]?_[_0x3977('0x1b')](_0x18a91a[_0x3977('0x1d')],function(_0x23f2d6){return{'model':db[_0x23f2d6[_0x3977('0x1c')]],'as':_0x23f2d6['as'],'attributes':_0x23f2d6[_0x3977('0x1e')],'include':_0x23f2d6[_0x3977('0x1d')]?_[_0x3977('0x1b')](_0x23f2d6[_0x3977('0x1d')],function(_0xa59838){return{'model':db[_0xa59838['model']],'as':_0xa59838['as'],'attributes':_0xa59838[_0x3977('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3977('0x1f')](function(_0x275b28){logger['info'](_0x3977('0x16'),_0x54835d);logger[_0x3977('0xe')](_0x3977('0x16'),_0x54835d,JSON[_0x3977('0x10')](_0x275b28));_0x402b32(_0x275b28);})[_0x3977('0x20')](function(_0x42d99a){logger[_0x3977('0x12')](_0x3977('0x16'),_0x42d99a['message'],_0x54835d);_0x130816(_0x378aed[_0x3977('0x12')](0x1f4,_0x42d99a[_0x3977('0x13')]));});});};exports[_0x3977('0x21')]=function(_0x5e30bd){var _0x26213a=this;return new Promise(function(_0x2dd380,_0x282e66){return db[_0x3977('0x17')][_0x3977('0x22')](_0x5e30bd['body'],{'raw':_0x5e30bd[_0x3977('0x18')]?_0x5e30bd[_0x3977('0x18')][_0x3977('0x19')]===undefined?!![]:![]:!![]})[_0x3977('0x1f')](function(_0x3e898b){logger[_0x3977('0x14')](_0x3977('0x21'),_0x5e30bd);logger['debug'](_0x3977('0x21'),_0x5e30bd,JSON[_0x3977('0x10')](_0x3e898b));_0x2dd380(_0x3e898b);})['catch'](function(_0x53e083){logger[_0x3977('0x12')]('CreateVoiceCallReport',_0x53e083[_0x3977('0x13')],_0x5e30bd);_0x282e66(_0x26213a['error'](0x1f4,_0x53e083['message']));});});};exports[_0x3977('0x23')]=function(_0x468efe){var _0x4b178f=this;return new Promise(function(_0x37993a,_0x127934){return db[_0x3977('0x17')]['update'](_0x468efe[_0x3977('0x24')],{'raw':_0x468efe['options']?_0x468efe[_0x3977('0x18')][_0x3977('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x468efe[_0x3977('0x18')]?_0x468efe[_0x3977('0x18')][_0x3977('0x25')]||null:null,'attributes':_0x468efe[_0x3977('0x18')]?_0x468efe[_0x3977('0x18')]['attributes']||null:null,'limit':_0x468efe[_0x3977('0x18')]?_0x468efe[_0x3977('0x18')][_0x3977('0x1a')]||null:null})['then'](function(_0x48384e){logger['info']('UpdateVoiceCallReport',_0x468efe);logger[_0x3977('0xe')](_0x3977('0x23'),_0x468efe,JSON[_0x3977('0x10')](_0x48384e));_0x37993a(_0x48384e);})[_0x3977('0x20')](function(_0xdc992c){logger[_0x3977('0x12')](_0x3977('0x23'),_0xdc992c[_0x3977('0x13')],_0x468efe);_0x127934(_0x4b178f[_0x3977('0x12')](0x1f4,_0xdc992c[_0x3977('0x13')]));});});}; \ No newline at end of file +var _0xea84=['catch','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','limit','include','model','map','stringify','CreateVoiceCallReport','create','raw','UpdateVoiceCallReport','update','body','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x56042f,_0x34da04){var _0x2299f6=function(_0x27577d){while(--_0x27577d){_0x56042f['push'](_0x56042f['shift']());}};_0x2299f6(++_0x34da04);}(_0xea84,0xca));var _0x4ea8=function(_0x448ab9,_0x4bc383){_0x448ab9=_0x448ab9-0x0;var _0x4b7945=_0xea84[_0x448ab9];return _0x4b7945;};'use strict';var _=require('lodash');var util=require(_0x4ea8('0x0'));var moment=require('moment');var BPromise=require(_0x4ea8('0x1'));var rs=require(_0x4ea8('0x2'));var fs=require('fs');var Redis=require(_0x4ea8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ea8('0x4'));var logger=require('../../config/logger')(_0x4ea8('0x5'));var config=require('../../config/environment');var jayson=require(_0x4ea8('0x6'));var client=jayson[_0x4ea8('0x7')][_0x4ea8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47cd07,_0x5dda96,_0x56078d){return new BPromise(function(_0x404a9a,_0x15549e){return client[_0x4ea8('0x9')](_0x47cd07,_0x56078d)[_0x4ea8('0xa')](function(_0x490ef5){logger[_0x4ea8('0xb')](_0x4ea8('0xc'),_0x5dda96,_0x4ea8('0xd'));logger[_0x4ea8('0xe')](_0x4ea8('0xf'),_0x5dda96,_0x4ea8('0xd'),JSON['stringify'](_0x490ef5));if(_0x490ef5[_0x4ea8('0x10')]){if(_0x490ef5[_0x4ea8('0x10')][_0x4ea8('0x11')]===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x5dda96,_0x490ef5[_0x4ea8('0x10')][_0x4ea8('0x12')]);return _0x15549e(_0x490ef5[_0x4ea8('0x10')]['message']);}logger[_0x4ea8('0x10')](_0x4ea8('0xc'),_0x5dda96,_0x490ef5[_0x4ea8('0x10')]['message']);return _0x404a9a(_0x490ef5['error'][_0x4ea8('0x12')]);}else{logger[_0x4ea8('0xb')](_0x4ea8('0xc'),_0x5dda96,_0x4ea8('0xd'));_0x404a9a(_0x490ef5[_0x4ea8('0x13')][_0x4ea8('0x12')]);}})[_0x4ea8('0x14')](function(_0x5159ad){logger[_0x4ea8('0x10')](_0x4ea8('0xc'),_0x5dda96,_0x5159ad);_0x15549e(_0x5159ad);});});}exports[_0x4ea8('0x15')]=function(_0x280753){var _0x592720=this;return new Promise(function(_0x595c08,_0x10d5db){return db[_0x4ea8('0x16')][_0x4ea8('0x17')]({'raw':_0x280753[_0x4ea8('0x18')]?_0x280753['options']['raw']===undefined?!![]:![]:!![],'where':_0x280753[_0x4ea8('0x18')]?_0x280753[_0x4ea8('0x18')]['where']||null:null,'attributes':_0x280753[_0x4ea8('0x18')]?_0x280753['options'][_0x4ea8('0x19')]||null:null,'limit':_0x280753[_0x4ea8('0x18')]?_0x280753[_0x4ea8('0x18')][_0x4ea8('0x1a')]||null:null,'include':_0x280753[_0x4ea8('0x18')]?_0x280753[_0x4ea8('0x18')][_0x4ea8('0x1b')]?_['map'](_0x280753[_0x4ea8('0x18')][_0x4ea8('0x1b')],function(_0x5ef12b){return{'model':db[_0x5ef12b['model']],'as':_0x5ef12b['as'],'attributes':_0x5ef12b[_0x4ea8('0x19')],'include':_0x5ef12b['include']?_['map'](_0x5ef12b[_0x4ea8('0x1b')],function(_0x32af7b){return{'model':db[_0x32af7b[_0x4ea8('0x1c')]],'as':_0x32af7b['as'],'attributes':_0x32af7b[_0x4ea8('0x19')],'include':_0x32af7b[_0x4ea8('0x1b')]?_[_0x4ea8('0x1d')](_0x32af7b['include'],function(_0x444bac){return{'model':db[_0x444bac[_0x4ea8('0x1c')]],'as':_0x444bac['as'],'attributes':_0x444bac[_0x4ea8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4ea8('0xa')](function(_0x5a2161){logger[_0x4ea8('0xb')](_0x4ea8('0x15'),_0x280753);logger[_0x4ea8('0xe')](_0x4ea8('0x15'),_0x280753,JSON[_0x4ea8('0x1e')](_0x5a2161));_0x595c08(_0x5a2161);})[_0x4ea8('0x14')](function(_0x12170c){logger['error']('GetVoiceCallReport',_0x12170c[_0x4ea8('0x12')],_0x280753);_0x10d5db(_0x592720[_0x4ea8('0x10')](0x1f4,_0x12170c[_0x4ea8('0x12')]));});});};exports[_0x4ea8('0x1f')]=function(_0x1ac27f){var _0x21eb34=this;return new Promise(function(_0x3ac780,_0x4a9b51){return db['VoiceCallReport'][_0x4ea8('0x20')](_0x1ac27f['body'],{'raw':_0x1ac27f[_0x4ea8('0x18')]?_0x1ac27f[_0x4ea8('0x18')][_0x4ea8('0x21')]===undefined?!![]:![]:!![]})[_0x4ea8('0xa')](function(_0x72ae98){logger[_0x4ea8('0xb')](_0x4ea8('0x1f'),_0x1ac27f);logger[_0x4ea8('0xe')](_0x4ea8('0x1f'),_0x1ac27f,JSON[_0x4ea8('0x1e')](_0x72ae98));_0x3ac780(_0x72ae98);})[_0x4ea8('0x14')](function(_0x4ed31f){logger[_0x4ea8('0x10')](_0x4ea8('0x1f'),_0x4ed31f['message'],_0x1ac27f);_0x4a9b51(_0x21eb34[_0x4ea8('0x10')](0x1f4,_0x4ed31f[_0x4ea8('0x12')]));});});};exports[_0x4ea8('0x22')]=function(_0x173d49){var _0x3bedf1=this;return new Promise(function(_0x37c51a,_0x11f7f2){return db[_0x4ea8('0x16')][_0x4ea8('0x23')](_0x173d49[_0x4ea8('0x24')],{'raw':_0x173d49[_0x4ea8('0x18')]?_0x173d49['options'][_0x4ea8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x173d49[_0x4ea8('0x18')]?_0x173d49['options']['where']||null:null,'attributes':_0x173d49[_0x4ea8('0x18')]?_0x173d49['options'][_0x4ea8('0x19')]||null:null,'limit':_0x173d49[_0x4ea8('0x18')]?_0x173d49[_0x4ea8('0x18')][_0x4ea8('0x1a')]||null:null})[_0x4ea8('0xa')](function(_0x4b53fc){logger[_0x4ea8('0xb')](_0x4ea8('0x22'),_0x173d49);logger['debug']('UpdateVoiceCallReport',_0x173d49,JSON['stringify'](_0x4b53fc));_0x37c51a(_0x4b53fc);})[_0x4ea8('0x14')](function(_0x1dc387){logger[_0x4ea8('0x10')](_0x4ea8('0x22'),_0x1dc387[_0x4ea8('0x12')],_0x173d49);_0x11f7f2(_0x3bedf1[_0x4ea8('0x10')](0x1f4,_0x1dc387['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9af7420..5b973fa 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 _0xfa16=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x2f9726,_0x256a31){var _0x49ba24=function(_0x5845d7){while(--_0x5845d7){_0x2f9726['push'](_0x2f9726['shift']());}};_0x49ba24(++_0x256a31);}(_0xfa16,0x12d));var _0x6fa1=function(_0x4b0ed8,_0x1f2b83){_0x4b0ed8=_0x4b0ed8-0x0;var _0x879519=_0xfa16[_0x4b0ed8];return _0x879519;};'use strict';var multer=require('multer');var util=require(_0x6fa1('0x0'));var path=require('path');var timeout=require(_0x6fa1('0x1'));var express=require(_0x6fa1('0x2'));var router=express[_0x6fa1('0x3')]();var fs_extra=require(_0x6fa1('0x4'));var auth=require(_0x6fa1('0x5'));var interaction=require(_0x6fa1('0x6'));var config=require('../../config/environment');var controller=require(_0x6fa1('0x7'));router['get']('/',auth[_0x6fa1('0x8')](),controller[_0x6fa1('0x9')]);router[_0x6fa1('0xa')](_0x6fa1('0xb'),auth[_0x6fa1('0x8')](),controller[_0x6fa1('0xc')]);router[_0x6fa1('0xd')]('/',auth[_0x6fa1('0x8')](),controller[_0x6fa1('0xe')]);router[_0x6fa1('0xf')]('/:id',auth[_0x6fa1('0x8')](),controller[_0x6fa1('0x10')]);router[_0x6fa1('0x11')](_0x6fa1('0xb'),auth[_0x6fa1('0x8')](),controller[_0x6fa1('0x12')]);module[_0x6fa1('0x13')]=router; \ No newline at end of file +var _0xdc4b=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','show','post','create','/:id','delete','destroy','exports'];(function(_0x5304c0,_0x240d71){var _0x11d983=function(_0x4c3e13){while(--_0x4c3e13){_0x5304c0['push'](_0x5304c0['shift']());}};_0x11d983(++_0x240d71);}(_0xdc4b,0x66));var _0xbdc4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xdc4b[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xbdc4('0x0'));var util=require(_0xbdc4('0x1'));var path=require(_0xbdc4('0x2'));var timeout=require(_0xbdc4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbdc4('0x4'));var interaction=require(_0xbdc4('0x5'));var config=require(_0xbdc4('0x6'));var controller=require(_0xbdc4('0x7'));router[_0xbdc4('0x8')]('/',auth[_0xbdc4('0x9')](),controller['index']);router[_0xbdc4('0x8')]('/:id',auth[_0xbdc4('0x9')](),controller[_0xbdc4('0xa')]);router[_0xbdc4('0xb')]('/',auth[_0xbdc4('0x9')](),controller[_0xbdc4('0xc')]);router['put'](_0xbdc4('0xd'),auth[_0xbdc4('0x9')](),controller['update']);router[_0xbdc4('0xe')](_0xbdc4('0xd'),auth[_0xbdc4('0x9')](),controller[_0xbdc4('0xf')]);module[_0xbdc4('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 9ed3df2..03ff3b6 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 _0x4d24=['join','getDataValue','split','BOOLEAN','exports','STRING','setDataValue','options'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0x4d24,0x17c));var _0x44d2=function(_0x1d5913,_0x1fc39d){_0x1d5913=_0x1d5913-0x0;var _0x2f5e0a=_0x4d24[_0x1d5913];return _0x2f5e0a;};'use strict';var Sequelize=require('sequelize');module[_0x44d2('0x0')]={'name':{'type':Sequelize[_0x44d2('0x1')]},'prefix':{'type':Sequelize[_0x44d2('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x44d2('0x1')],'set':function(_0x55b273){this[_0x44d2('0x2')](_0x44d2('0x3'),_0x55b273?_0x55b273[_0x44d2('0x4')](''):[]);},'get':function(){return this[_0x44d2('0x5')](_0x44d2('0x3'))?this[_0x44d2('0x5')]('options')[_0x44d2('0x6')](''):[];}},'auth':{'type':Sequelize[_0x44d2('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x44d2('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x44d2('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdd9d=['name','options','join','getDataValue','split','sequelize','exports','STRING'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0xdd9d,0xf5));var _0xddd9=function(_0x5a45b4,_0x220d69){_0x5a45b4=_0x5a45b4-0x0;var _0x58e14f=_0xdd9d[_0x5a45b4];return _0x58e14f;};'use strict';var Sequelize=require(_0xddd9('0x0'));module[_0xddd9('0x1')]={'name':{'type':Sequelize[_0xddd9('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xddd9('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xddd9('0x2')],'set':function(_0x5d7737){this['setDataValue'](_0xddd9('0x4'),_0x5d7737?_0x5d7737[_0xddd9('0x5')](''):[]);},'get':function(){return this[_0xddd9('0x6')](_0xddd9('0x4'))?this[_0xddd9('0x6')](_0xddd9('0x4'))[_0xddd9('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xddd9('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xddd9('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 485f31c..fdd8902 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 _0x9090=['then','destroy','get','ChanSpies','UserProfileResource','error','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','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','limit','Content-Range','apply','reject','save','update'];(function(_0x4cbbdb,_0x3b3fa7){var _0x1840f1=function(_0x4082e3){while(--_0x4082e3){_0x4cbbdb['push'](_0x4cbbdb['shift']());}};_0x1840f1(++_0x3b3fa7);}(_0x9090,0x17f));var _0x0909=function(_0x564b56,_0x33a602){_0x564b56=_0x564b56-0x0;var _0x153222=_0x9090[_0x564b56];return _0x153222;};'use strict';var emlformat=require(_0x0909('0x0'));var rimraf=require(_0x0909('0x1'));var zipdir=require(_0x0909('0x2'));var jsonpatch=require(_0x0909('0x3'));var rp=require(_0x0909('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0909('0x5'));var util=require(_0x0909('0x6'));var path=require(_0x0909('0x7'));var sox=require('sox');var csv=require(_0x0909('0x8'));var ejs=require(_0x0909('0x9'));var fs=require('fs');var fs_extra=require(_0x0909('0xa'));var _=require(_0x0909('0xb'));var squel=require(_0x0909('0xc'));var crypto=require(_0x0909('0xd'));var jsforce=require(_0x0909('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0909('0x8'));var querystring=require(_0x0909('0xf'));var Papa=require('papaparse');var Redis=require(_0x0909('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0909('0x11'));var as=require(_0x0909('0x12'));var hardwareService=require(_0x0909('0x13'));var logger=require(_0x0909('0x14'))('api');var utils=require(_0x0909('0x15'));var config=require(_0x0909('0x16'));var licenseUtil=require(_0x0909('0x17'));var db=require(_0x0909('0x18'))['db'];function respondWithStatusCode(_0x4e900a,_0x32f71a){_0x32f71a=_0x32f71a||0xcc;return function(_0x18c223){if(_0x18c223){return _0x4e900a[_0x0909('0x19')](_0x32f71a);}return _0x4e900a[_0x0909('0x1a')](_0x32f71a)[_0x0909('0x1b')]();};}function respondWithResult(_0xad78e9,_0x3bdd30){_0x3bdd30=_0x3bdd30||0xc8;return function(_0x1811da){if(_0x1811da){return _0xad78e9[_0x0909('0x1a')](_0x3bdd30)[_0x0909('0x1c')](_0x1811da);}};}function respondWithFilteredResult(_0x48ee40,_0x2c5892){return function(_0x1eb8be){if(_0x1eb8be){var _0x96edb6=typeof _0x2c5892[_0x0909('0x1d')]===_0x0909('0x1e')&&typeof _0x2c5892[_0x0909('0x1f')]===_0x0909('0x1e');var _0x14e44c=_0x1eb8be['count'];var _0x3a7089=_0x96edb6?0x0:_0x2c5892[_0x0909('0x1d')];var _0x14976d=_0x96edb6?_0x1eb8be['count']:_0x2c5892[_0x0909('0x1d')]+_0x2c5892[_0x0909('0x1f')];var _0x11455d;if(_0x14976d>=_0x14e44c){_0x14976d=_0x14e44c;_0x11455d=0xc8;}else{_0x11455d=0xce;}_0x48ee40['status'](_0x11455d);return _0x48ee40['set'](_0x0909('0x20'),_0x3a7089+'-'+_0x14976d+'/'+_0x14e44c)['json'](_0x1eb8be);}return null;};}function patchUpdates(_0xf0efcb){return function(_0x2ccf21){try{jsonpatch[_0x0909('0x21')](_0x2ccf21,_0xf0efcb,!![]);}catch(_0x3037c1){return BPromise[_0x0909('0x22')](_0x3037c1);}return _0x2ccf21[_0x0909('0x23')]();};}function saveUpdates(_0x4eec68,_0x46b384){return function(_0x519c9f){if(_0x519c9f){return _0x519c9f[_0x0909('0x24')](_0x4eec68)[_0x0909('0x25')](function(_0x2ea745){return _0x2ea745;});}return null;};}function removeEntity(_0x3e71b9,_0x332b07){return function(_0x510ba6){if(_0x510ba6){return _0x510ba6[_0x0909('0x26')]()[_0x0909('0x25')](function(){var _0x4503db=_0x510ba6[_0x0909('0x27')]({'plain':!![]});var _0xc879d8=_0x0909('0x28');return db[_0x0909('0x29')][_0x0909('0x26')]({'where':{'type':_0xc879d8,'resourceId':_0x4503db['id']}})[_0x0909('0x25')](function(){return _0x510ba6;});})[_0x0909('0x25')](function(){_0x3e71b9['status'](0xcc)[_0x0909('0x1b')]();});}};}function handleEntityNotFound(_0x4c57c6,_0x48f73f){return function(_0x387f4d){if(!_0x387f4d){_0x4c57c6[_0x0909('0x19')](0x194);}return _0x387f4d;};}function handleError(_0x482587,_0x34f7b9){_0x34f7b9=_0x34f7b9||0x1f4;return function(_0x33ce47){logger[_0x0909('0x2a')](_0x33ce47['stack']);if(_0x33ce47[_0x0909('0x2b')]){delete _0x33ce47[_0x0909('0x2b')];}_0x482587[_0x0909('0x1a')](_0x34f7b9)[_0x0909('0x2c')](_0x33ce47);};}exports[_0x0909('0x2d')]=function(_0x5470e4,_0x1bd9ae){var _0x569ef9={},_0x250fd0={},_0x2fd839={'count':0x0,'rows':[]};var _0x4b6805=_[_0x0909('0x2e')](db[_0x0909('0x2f')]['rawAttributes'],function(_0x3c53ce){return{'name':_0x3c53ce[_0x0909('0x30')],'type':_0x3c53ce[_0x0909('0x31')][_0x0909('0x32')]};});_0x250fd0[_0x0909('0x33')]=_['map'](_0x4b6805,_0x0909('0x2b'));_0x250fd0[_0x0909('0x34')]=_[_0x0909('0x35')](_0x5470e4[_0x0909('0x34')]);_0x250fd0['filters']=_[_0x0909('0x36')](_0x250fd0[_0x0909('0x33')],_0x250fd0[_0x0909('0x34')]);_0x569ef9[_0x0909('0x37')]=_[_0x0909('0x36')](_0x250fd0[_0x0909('0x33')],qs[_0x0909('0x38')](_0x5470e4['query']['fields']));_0x569ef9[_0x0909('0x37')]=_0x569ef9[_0x0909('0x37')][_0x0909('0x39')]?_0x569ef9[_0x0909('0x37')]:_0x250fd0[_0x0909('0x33')];if(!_0x5470e4['query'][_0x0909('0x3a')]('nolimit')){_0x569ef9[_0x0909('0x1f')]=qs[_0x0909('0x1f')](_0x5470e4[_0x0909('0x34')][_0x0909('0x1f')]);_0x569ef9[_0x0909('0x1d')]=qs['offset'](_0x5470e4[_0x0909('0x34')]['offset']);}_0x569ef9[_0x0909('0x3b')]=qs[_0x0909('0x3c')](_0x5470e4[_0x0909('0x34')][_0x0909('0x3c')]);_0x569ef9[_0x0909('0x3d')]=qs[_0x0909('0x3e')](_[_0x0909('0x3f')](_0x5470e4[_0x0909('0x34')],_0x250fd0[_0x0909('0x3e')]),_0x4b6805);if(_0x5470e4[_0x0909('0x34')]['filter']){_0x569ef9[_0x0909('0x3d')]=_['merge'](_0x569ef9[_0x0909('0x3d')],{'$or':_['map'](_0x4b6805,function(_0x1b78fa){if(_0x1b78fa[_0x0909('0x31')]!==_0x0909('0x40')){var _0xeda5de={};_0xeda5de[_0x1b78fa[_0x0909('0x2b')]]={'$like':'%'+_0x5470e4[_0x0909('0x34')][_0x0909('0x41')]+'%'};return _0xeda5de;}})});}_0x569ef9=_[_0x0909('0x42')]({},_0x569ef9,_0x5470e4[_0x0909('0x43')]);var _0x57f18b={'where':_0x569ef9[_0x0909('0x3d')]};return db['VoiceChanSpy'][_0x0909('0x44')](_0x57f18b)['then'](function(_0x347bde){_0x2fd839[_0x0909('0x44')]=_0x347bde;if(_0x5470e4[_0x0909('0x34')][_0x0909('0x45')]){_0x569ef9['include']=[{'all':!![]}];}return db[_0x0909('0x2f')][_0x0909('0x46')](_0x569ef9);})[_0x0909('0x25')](function(_0x3e808e){_0x2fd839[_0x0909('0x47')]=_0x3e808e;return _0x2fd839;})['then'](respondWithFilteredResult(_0x1bd9ae,_0x569ef9))[_0x0909('0x48')](handleError(_0x1bd9ae,null));};exports[_0x0909('0x49')]=function(_0x4a55f7,_0x339857){var _0x587477={'raw':![],'where':{'id':_0x4a55f7['params']['id']}},_0x2dc419={};_0x2dc419['model']=_[_0x0909('0x35')](db[_0x0909('0x2f')]['rawAttributes']);_0x2dc419['query']=_[_0x0909('0x35')](_0x4a55f7['query']);_0x2dc419[_0x0909('0x3e')]=_[_0x0909('0x36')](_0x2dc419['model'],_0x2dc419['query']);_0x587477['attributes']=_[_0x0909('0x36')](_0x2dc419[_0x0909('0x33')],qs[_0x0909('0x38')](_0x4a55f7[_0x0909('0x34')]['fields']));_0x587477[_0x0909('0x37')]=_0x587477[_0x0909('0x37')][_0x0909('0x39')]?_0x587477[_0x0909('0x37')]:_0x2dc419['model'];if(_0x4a55f7['query'][_0x0909('0x45')]){_0x587477[_0x0909('0x4a')]=[{'all':!![]}];}_0x587477=_[_0x0909('0x42')]({},_0x587477,_0x4a55f7[_0x0909('0x43')]);return db[_0x0909('0x2f')][_0x0909('0x4b')](_0x587477)[_0x0909('0x25')](handleEntityNotFound(_0x339857,null))[_0x0909('0x25')](respondWithResult(_0x339857,null))['catch'](handleError(_0x339857,null));};exports[_0x0909('0x4c')]=function(_0x2eaf27,_0x5e8f34){return db[_0x0909('0x2f')]['create'](_0x2eaf27[_0x0909('0x4d')],{})[_0x0909('0x25')](function(_0x1de467){var _0x1b3f7c=_0x2eaf27[_0x0909('0x4e')][_0x0909('0x27')]({'plain':!![]});if(!_0x1b3f7c)throw new Error(_0x0909('0x4f'));if(_0x1b3f7c['role']===_0x0909('0x4e')){var _0x253884=_0x1de467[_0x0909('0x27')]({'plain':!![]});var _0x3ca8cf=_0x0909('0x28');return db[_0x0909('0x50')]['find']({'where':{'name':_0x3ca8cf,'userProfileId':_0x1b3f7c[_0x0909('0x51')]},'raw':!![]})['then'](function(_0x47adaf){if(_0x47adaf&&_0x47adaf['autoAssociation']===0x0){return db['UserProfileResource'][_0x0909('0x4c')]({'name':_0x253884[_0x0909('0x2b')],'resourceId':_0x253884['id'],'type':_0x47adaf['name'],'sectionId':_0x47adaf['id']},{})['then'](function(){return _0x1de467;});}else{return _0x1de467;}})[_0x0909('0x48')](function(_0x14b649){logger[_0x0909('0x2a')](_0x0909('0x52'),_0x14b649);throw _0x14b649;});}return _0x1de467;})[_0x0909('0x25')](respondWithResult(_0x5e8f34,0xc9))[_0x0909('0x48')](handleError(_0x5e8f34,null));};exports[_0x0909('0x24')]=function(_0x3502b6,_0x5c1122){if(_0x3502b6['body']['id']){delete _0x3502b6[_0x0909('0x4d')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x3502b6[_0x0909('0x53')]['id']}})[_0x0909('0x25')](handleEntityNotFound(_0x5c1122,null))[_0x0909('0x25')](saveUpdates(_0x3502b6[_0x0909('0x4d')],null))[_0x0909('0x25')](respondWithResult(_0x5c1122,null))[_0x0909('0x48')](handleError(_0x5c1122,null));};exports[_0x0909('0x26')]=function(_0xe430a2,_0x1f7c1b){return db[_0x0909('0x2f')]['find']({'where':{'id':_0xe430a2[_0x0909('0x53')]['id']}})[_0x0909('0x25')](handleEntityNotFound(_0x1f7c1b,null))[_0x0909('0x25')](removeEntity(_0x1f7c1b,null))[_0x0909('0x48')](handleError(_0x1f7c1b,null));}; \ No newline at end of file +var _0x151b=['catch','show','params','find','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x4642d0,_0x1d5b64){var _0x22197f=function(_0x5b68b9){while(--_0x5b68b9){_0x4642d0['push'](_0x4642d0['shift']());}};_0x22197f(++_0x1d5b64);}(_0x151b,0x153));var _0xb151=function(_0x30679e,_0x453b6e){_0x30679e=_0x30679e-0x0;var _0x590a61=_0x151b[_0x30679e];return _0x590a61;};'use strict';var emlformat=require(_0xb151('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb151('0x1'));var rp=require('request-promise');var moment=require(_0xb151('0x2'));var BPromise=require(_0xb151('0x3'));var Mustache=require(_0xb151('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb151('0x5'));var csv=require(_0xb151('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb151('0x7'));var _=require('lodash');var squel=require(_0xb151('0x8'));var crypto=require(_0xb151('0x9'));var jsforce=require(_0xb151('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb151('0xb'));var Papa=require(_0xb151('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb151('0xd'));var as=require(_0xb151('0xe'));var hardwareService=require(_0xb151('0xf'));var logger=require(_0xb151('0x10'))(_0xb151('0x11'));var utils=require(_0xb151('0x12'));var config=require(_0xb151('0x13'));var licenseUtil=require(_0xb151('0x14'));var db=require(_0xb151('0x15'))['db'];function respondWithStatusCode(_0x143fbd,_0x4e54ca){_0x4e54ca=_0x4e54ca||0xcc;return function(_0x1ae9b4){if(_0x1ae9b4){return _0x143fbd['sendStatus'](_0x4e54ca);}return _0x143fbd[_0xb151('0x16')](_0x4e54ca)[_0xb151('0x17')]();};}function respondWithResult(_0x27f878,_0xfd071d){_0xfd071d=_0xfd071d||0xc8;return function(_0x4af767){if(_0x4af767){return _0x27f878[_0xb151('0x16')](_0xfd071d)[_0xb151('0x18')](_0x4af767);}};}function respondWithFilteredResult(_0x3df79d,_0x5b12e5){return function(_0x56ea81){if(_0x56ea81){var _0x5b2faa=typeof _0x5b12e5['offset']===_0xb151('0x19')&&typeof _0x5b12e5['limit']===_0xb151('0x19');var _0x4b21c0=_0x56ea81['count'];var _0x35aa2f=_0x5b2faa?0x0:_0x5b12e5[_0xb151('0x1a')];var _0x2ca10b=_0x5b2faa?_0x56ea81[_0xb151('0x1b')]:_0x5b12e5[_0xb151('0x1a')]+_0x5b12e5[_0xb151('0x1c')];var _0x1e2b38;if(_0x2ca10b>=_0x4b21c0){_0x2ca10b=_0x4b21c0;_0x1e2b38=0xc8;}else{_0x1e2b38=0xce;}_0x3df79d['status'](_0x1e2b38);return _0x3df79d[_0xb151('0x1d')](_0xb151('0x1e'),_0x35aa2f+'-'+_0x2ca10b+'/'+_0x4b21c0)['json'](_0x56ea81);}return null;};}function patchUpdates(_0x1fe113){return function(_0x22b1cd){try{jsonpatch[_0xb151('0x1f')](_0x22b1cd,_0x1fe113,!![]);}catch(_0x3a211a){return BPromise[_0xb151('0x20')](_0x3a211a);}return _0x22b1cd[_0xb151('0x21')]();};}function saveUpdates(_0x3f375d,_0x8ab45){return function(_0x49c2e){if(_0x49c2e){return _0x49c2e[_0xb151('0x22')](_0x3f375d)['then'](function(_0x432dce){return _0x432dce;});}return null;};}function removeEntity(_0x23cb48,_0x37768a){return function(_0x41c508){if(_0x41c508){return _0x41c508[_0xb151('0x23')]()[_0xb151('0x24')](function(){var _0xd22ee1=_0x41c508[_0xb151('0x25')]({'plain':!![]});var _0x31f1a7='ChanSpies';return db[_0xb151('0x26')][_0xb151('0x23')]({'where':{'type':_0x31f1a7,'resourceId':_0xd22ee1['id']}})[_0xb151('0x24')](function(){return _0x41c508;});})[_0xb151('0x24')](function(){_0x23cb48[_0xb151('0x16')](0xcc)[_0xb151('0x17')]();});}};}function handleEntityNotFound(_0x46f28c,_0x2dc1b4){return function(_0x5b6f83){if(!_0x5b6f83){_0x46f28c[_0xb151('0x27')](0x194);}return _0x5b6f83;};}function handleError(_0x51e156,_0x20ff34){_0x20ff34=_0x20ff34||0x1f4;return function(_0x32c933){logger['error'](_0x32c933[_0xb151('0x28')]);if(_0x32c933['name']){delete _0x32c933[_0xb151('0x29')];}_0x51e156[_0xb151('0x16')](_0x20ff34)[_0xb151('0x2a')](_0x32c933);};}exports[_0xb151('0x2b')]=function(_0x3ed573,_0x444af1){var _0x3d070b={},_0x3a9389={},_0x51acd7={'count':0x0,'rows':[]};var _0x37722e=_[_0xb151('0x2c')](db[_0xb151('0x2d')][_0xb151('0x2e')],function(_0x940cdf){return{'name':_0x940cdf[_0xb151('0x2f')],'type':_0x940cdf[_0xb151('0x30')]['key']};});_0x3a9389[_0xb151('0x31')]=_[_0xb151('0x2c')](_0x37722e,_0xb151('0x29'));_0x3a9389[_0xb151('0x32')]=_[_0xb151('0x33')](_0x3ed573['query']);_0x3a9389['filters']=_[_0xb151('0x34')](_0x3a9389[_0xb151('0x31')],_0x3a9389[_0xb151('0x32')]);_0x3d070b[_0xb151('0x35')]=_['intersection'](_0x3a9389[_0xb151('0x31')],qs['fields'](_0x3ed573[_0xb151('0x32')][_0xb151('0x36')]));_0x3d070b[_0xb151('0x35')]=_0x3d070b[_0xb151('0x35')][_0xb151('0x37')]?_0x3d070b[_0xb151('0x35')]:_0x3a9389[_0xb151('0x31')];if(!_0x3ed573[_0xb151('0x32')][_0xb151('0x38')](_0xb151('0x39'))){_0x3d070b[_0xb151('0x1c')]=qs['limit'](_0x3ed573[_0xb151('0x32')][_0xb151('0x1c')]);_0x3d070b[_0xb151('0x1a')]=qs['offset'](_0x3ed573[_0xb151('0x32')][_0xb151('0x1a')]);}_0x3d070b[_0xb151('0x3a')]=qs[_0xb151('0x3b')](_0x3ed573[_0xb151('0x32')][_0xb151('0x3b')]);_0x3d070b[_0xb151('0x3c')]=qs[_0xb151('0x3d')](_[_0xb151('0x3e')](_0x3ed573[_0xb151('0x32')],_0x3a9389[_0xb151('0x3d')]),_0x37722e);if(_0x3ed573['query'][_0xb151('0x3f')]){_0x3d070b['where']=_[_0xb151('0x40')](_0x3d070b[_0xb151('0x3c')],{'$or':_[_0xb151('0x2c')](_0x37722e,function(_0x38558c){if(_0x38558c[_0xb151('0x30')]!==_0xb151('0x41')){var _0x88a7={};_0x88a7[_0x38558c['name']]={'$like':'%'+_0x3ed573[_0xb151('0x32')][_0xb151('0x3f')]+'%'};return _0x88a7;}})});}_0x3d070b=_[_0xb151('0x40')]({},_0x3d070b,_0x3ed573[_0xb151('0x42')]);var _0x802eba={'where':_0x3d070b[_0xb151('0x3c')]};return db[_0xb151('0x2d')][_0xb151('0x1b')](_0x802eba)[_0xb151('0x24')](function(_0x3c8533){_0x51acd7[_0xb151('0x1b')]=_0x3c8533;if(_0x3ed573[_0xb151('0x32')][_0xb151('0x43')]){_0x3d070b[_0xb151('0x44')]=[{'all':!![]}];}return db[_0xb151('0x2d')][_0xb151('0x45')](_0x3d070b);})[_0xb151('0x24')](function(_0x4075bf){_0x51acd7[_0xb151('0x46')]=_0x4075bf;return _0x51acd7;})[_0xb151('0x24')](respondWithFilteredResult(_0x444af1,_0x3d070b))[_0xb151('0x47')](handleError(_0x444af1,null));};exports[_0xb151('0x48')]=function(_0x272eb5,_0x214df7){var _0x4ae517={'raw':![],'where':{'id':_0x272eb5[_0xb151('0x49')]['id']}},_0x434693={};_0x434693[_0xb151('0x31')]=_[_0xb151('0x33')](db[_0xb151('0x2d')][_0xb151('0x2e')]);_0x434693['query']=_[_0xb151('0x33')](_0x272eb5[_0xb151('0x32')]);_0x434693[_0xb151('0x3d')]=_[_0xb151('0x34')](_0x434693[_0xb151('0x31')],_0x434693[_0xb151('0x32')]);_0x4ae517[_0xb151('0x35')]=_[_0xb151('0x34')](_0x434693[_0xb151('0x31')],qs[_0xb151('0x36')](_0x272eb5['query'][_0xb151('0x36')]));_0x4ae517['attributes']=_0x4ae517[_0xb151('0x35')][_0xb151('0x37')]?_0x4ae517[_0xb151('0x35')]:_0x434693['model'];if(_0x272eb5[_0xb151('0x32')]['includeAll']){_0x4ae517[_0xb151('0x44')]=[{'all':!![]}];}_0x4ae517=_[_0xb151('0x40')]({},_0x4ae517,_0x272eb5[_0xb151('0x42')]);return db[_0xb151('0x2d')][_0xb151('0x4a')](_0x4ae517)['then'](handleEntityNotFound(_0x214df7,null))[_0xb151('0x24')](respondWithResult(_0x214df7,null))['catch'](handleError(_0x214df7,null));};exports[_0xb151('0x4b')]=function(_0x3c9ce1,_0x964b2b){return db[_0xb151('0x2d')]['create'](_0x3c9ce1[_0xb151('0x4c')],{})[_0xb151('0x24')](function(_0x438597){var _0x2cb92c=_0x3c9ce1['user'][_0xb151('0x25')]({'plain':!![]});if(!_0x2cb92c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cb92c[_0xb151('0x4d')]===_0xb151('0x4e')){var _0x433df2=_0x438597[_0xb151('0x25')]({'plain':!![]});var _0x211e0c='ChanSpies';return db['UserProfileSection'][_0xb151('0x4a')]({'where':{'name':_0x211e0c,'userProfileId':_0x2cb92c[_0xb151('0x4f')]},'raw':!![]})[_0xb151('0x24')](function(_0x26a13d){if(_0x26a13d&&_0x26a13d[_0xb151('0x50')]===0x0){return db['UserProfileResource'][_0xb151('0x4b')]({'name':_0x433df2['name'],'resourceId':_0x433df2['id'],'type':_0x26a13d[_0xb151('0x29')],'sectionId':_0x26a13d['id']},{})['then'](function(){return _0x438597;});}else{return _0x438597;}})[_0xb151('0x47')](function(_0x21c382){logger['error'](_0xb151('0x51'),_0x21c382);throw _0x21c382;});}return _0x438597;})[_0xb151('0x24')](respondWithResult(_0x964b2b,0xc9))[_0xb151('0x47')](handleError(_0x964b2b,null));};exports[_0xb151('0x22')]=function(_0x2e4389,_0x68746e){if(_0x2e4389['body']['id']){delete _0x2e4389['body']['id'];}return db['VoiceChanSpy'][_0xb151('0x4a')]({'where':{'id':_0x2e4389[_0xb151('0x49')]['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x68746e,null))[_0xb151('0x24')](saveUpdates(_0x2e4389[_0xb151('0x4c')],null))['then'](respondWithResult(_0x68746e,null))[_0xb151('0x47')](handleError(_0x68746e,null));};exports['destroy']=function(_0x4d5644,_0x43a2bf){return db[_0xb151('0x2d')]['find']({'where':{'id':_0x4d5644['params']['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x43a2bf,null))[_0xb151('0x24')](removeEntity(_0x43a2bf,null))[_0xb151('0x47')](handleError(_0x43a2bf,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 548ace0..7c47727 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 _0xbb2a=['context','from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','options','join','record','StopMixMonitor','length','concat','internal','User','name','agent','then','catch','exports','models','voice_chanspy','VoiceExtension','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes'];(function(_0x5554f3,_0x490882){var _0x3c4d1a=function(_0x356693){while(--_0x356693){_0x5554f3['push'](_0x5554f3['shift']());}};_0x3c4d1a(++_0x490882);}(_0xbb2a,0x15b));var _0xabb2=function(_0x3f7d24,_0x3ce1d5){_0x3f7d24=_0x3f7d24-0x0;var _0x143f6e=_0xbb2a[_0x3f7d24];return _0x143f6e;};'use strict';var _=require(_0xabb2('0x0'));var util=require(_0xabb2('0x1'));var BPromise=require(_0xabb2('0x2'));var attributes=require(_0xabb2('0x3'));var getUserApplications=function(_0x30df58,_0x2bf568,_0x1ca23b){var _0x38fdbc=0x1;var _0x75fef4=[];var _0x196654={'context':_0x2bf568[_0xabb2('0x4')]||_0xabb2('0x5'),'exten':util[_0xabb2('0x6')](_0xabb2('0x7'),_0x30df58[_0xabb2('0x8')],_0x1ca23b),'type':_0xabb2('0x9'),'isApp':![],'ChanSpyId':_0x30df58['id'],'UserId':_0x2bf568['id']};_0x75fef4[_0xabb2('0xa')](_['merge']({'app':_0xabb2('0xb'),'appdata':util['format'](_0xabb2('0xc'),_0xabb2('0xd')),'priority':_0x38fdbc++},_0x196654));if(_0x30df58['record']){_0x75fef4['push'](_[_0xabb2('0xe')]({'app':_0xabb2('0xf'),'appdata':util[_0xabb2('0x6')](_0xabb2('0x10'),_0x30df58[_0xabb2('0x11')]),'priority':_0x38fdbc++},_0x196654));}if(_0x30df58[_0xabb2('0x12')]){_0x75fef4['push'](_[_0xabb2('0xe')]({'app':_0xabb2('0x13'),'appdata':_0x30df58[_0xabb2('0x14')],'priority':_0x38fdbc++},_0x196654));}_0x75fef4[_0xabb2('0xa')](_[_0xabb2('0xe')]({'app':_0xabb2('0x15'),'appdata':util[_0xabb2('0x6')]('SIP/%s,%s',_0x2bf568['name'],_0x30df58[_0xabb2('0x16')]?_0x30df58[_0xabb2('0x16')][_0xabb2('0x17')](''):''),'priority':_0x38fdbc++},_0x196654));if(_0x30df58[_0xabb2('0x18')]){_0x75fef4[_0xabb2('0xa')](_[_0xabb2('0xe')]({'app':_0xabb2('0x19'),'priority':_0x38fdbc++},_0x196654));}return _0x75fef4;};var getChanSpyApplications=function(_0x21a849,_0x2418d0){var _0x4dd310=[];for(var _0x3b0e99=0x0,_0x376d44=0x1;_0x3b0e99<_0x2418d0[_0xabb2('0x1a')];_0x3b0e99++,_0x376d44=0x1){_0x4dd310=_0x4dd310[_0xabb2('0x1b')](getUserApplications(_0x21a849,_0x2418d0[_0x3b0e99],_0x2418d0[_0x3b0e99][_0xabb2('0x1c')]));if(_0x2418d0[_0x3b0e99][_0xabb2('0x1c')]!=_0x2418d0[_0x3b0e99]['name']){_0x4dd310=_0x4dd310[_0xabb2('0x1b')](getUserApplications(_0x21a849,_0x2418d0[_0x3b0e99],_0x2418d0[_0x3b0e99]['name']));}}return _0x4dd310;};var getChanSpyPromise=function(_0x1176c2,_0x59b254){return new BPromise(function(_0x39d4e6,_0x215123){return _0x1176c2[_0xabb2('0x1d')]['findAll']({'attributes':['id',_0xabb2('0x1e'),_0xabb2('0x1c')],'where':{'role':_0xabb2('0x1f'),'chanspy':!![]},'raw':!![]})[_0xabb2('0x20')](function(_0x1f1235){if(_0x1f1235){return _0x39d4e6(getChanSpyApplications(_0x59b254,_0x1f1235));}return _0x39d4e6([]);})[_0xabb2('0x21')](function(_0x477693){_0x215123(_0x477693);});});};module[_0xabb2('0x22')]=function(_0x2ca359,_0x6ff406){var _0x1f9018=_0x2ca359[_0xabb2('0x23')];return _0x2ca359['define']('VoiceChanSpy',attributes,{'tableName':_0xabb2('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x258174,_0x541c52,_0x3ef4f8){return getChanSpyPromise(_0x1f9018,_0x258174)[_0xabb2('0x20')](function(_0x2bb5cb){if(_0x2bb5cb&&_0x2bb5cb['length']){return _0x1f9018[_0xabb2('0x25')][_0xabb2('0x26')](_0x2bb5cb);}})[_0xabb2('0x20')](function(){_0x3ef4f8();})[_0xabb2('0x21')](function(_0x452fe4){_0x3ef4f8(_0x452fe4);});},'afterUpdate':function(_0x29ed67,_0x56c334,_0x13af90){return _0x1f9018[_0xabb2('0x25')]['destroy']({'where':{'ChanSpyId':_0x29ed67['id']}})[_0xabb2('0x20')](function(){return getChanSpyPromise(_0x1f9018,_0x29ed67);})[_0xabb2('0x20')](function(_0x5d43f2){if(_0x5d43f2&&_0x5d43f2[_0xabb2('0x1a')]){return _0x1f9018[_0xabb2('0x25')][_0xabb2('0x26')](_0x5d43f2);}})[_0xabb2('0x20')](function(){_0x13af90();})['catch'](function(_0x28001d){_0x13af90(_0x28001d);});},'afterDestroy':function(_0x3a5aee,_0xc05711,_0x4dfce6){return _0x1f9018[_0xabb2('0x25')]['destroy']({'where':{'ChanSpyId':_0x3a5aee['id']}})[_0xabb2('0x20')](function(){_0x4dfce6();})[_0xabb2('0x21')](function(_0x399131){_0x4dfce6(_0x399131);});}}});}; \ No newline at end of file +var _0x95f6=['from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','define','voice_chanspy','then','bulkCreate','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context'];(function(_0x422db0,_0x33be5b){var _0x355e09=function(_0x2b00a4){while(--_0x2b00a4){_0x422db0['push'](_0x422db0['shift']());}};_0x355e09(++_0x33be5b);}(_0x95f6,0xb9));var _0x695f=function(_0x95975e,_0x51412c){_0x95975e=_0x95975e-0x0;var _0x5d4933=_0x95f6[_0x95975e];return _0x5d4933;};'use strict';var _=require(_0x695f('0x0'));var util=require(_0x695f('0x1'));var BPromise=require(_0x695f('0x2'));var attributes=require(_0x695f('0x3'));var getUserApplications=function(_0x3bac87,_0x346b6c,_0x5539bb){var _0x40649a=0x1;var _0x490ccb=[];var _0x274ea3={'context':_0x346b6c[_0x695f('0x4')]||_0x695f('0x5'),'exten':util[_0x695f('0x6')](_0x695f('0x7'),_0x3bac87[_0x695f('0x8')],_0x5539bb),'type':_0x695f('0x9'),'isApp':![],'ChanSpyId':_0x3bac87['id'],'UserId':_0x346b6c['id']};_0x490ccb[_0x695f('0xa')](_[_0x695f('0xb')]({'app':'Set','appdata':util[_0x695f('0x6')](_0x695f('0xc'),_0x695f('0xd')),'priority':_0x40649a++},_0x274ea3));if(_0x3bac87[_0x695f('0xe')]){_0x490ccb[_0x695f('0xa')](_['merge']({'app':_0x695f('0xf'),'appdata':util[_0x695f('0x6')]('${UNIQUEID}.%s,a',_0x3bac87[_0x695f('0x10')]),'priority':_0x40649a++},_0x274ea3));}if(_0x3bac87['auth']){_0x490ccb[_0x695f('0xa')](_[_0x695f('0xb')]({'app':_0x695f('0x11'),'appdata':_0x3bac87[_0x695f('0x12')],'priority':_0x40649a++},_0x274ea3));}_0x490ccb[_0x695f('0xa')](_[_0x695f('0xb')]({'app':_0x695f('0x13'),'appdata':util[_0x695f('0x6')](_0x695f('0x14'),_0x346b6c[_0x695f('0x15')],_0x3bac87[_0x695f('0x16')]?_0x3bac87['options'][_0x695f('0x17')](''):''),'priority':_0x40649a++},_0x274ea3));if(_0x3bac87['record']){_0x490ccb['push'](_[_0x695f('0xb')]({'app':_0x695f('0x18'),'priority':_0x40649a++},_0x274ea3));}return _0x490ccb;};var getChanSpyApplications=function(_0x86fa94,_0x2a3ede){var _0x23eae4=[];for(var _0x480f5f=0x0,_0x7799be=0x1;_0x480f5f<_0x2a3ede[_0x695f('0x19')];_0x480f5f++,_0x7799be=0x1){_0x23eae4=_0x23eae4[_0x695f('0x1a')](getUserApplications(_0x86fa94,_0x2a3ede[_0x480f5f],_0x2a3ede[_0x480f5f]['internal']));if(_0x2a3ede[_0x480f5f][_0x695f('0x1b')]!=_0x2a3ede[_0x480f5f][_0x695f('0x15')]){_0x23eae4=_0x23eae4[_0x695f('0x1a')](getUserApplications(_0x86fa94,_0x2a3ede[_0x480f5f],_0x2a3ede[_0x480f5f][_0x695f('0x15')]));}}return _0x23eae4;};var getChanSpyPromise=function(_0x38dba9,_0xb1014d){return new BPromise(function(_0x234058,_0x40376f){return _0x38dba9[_0x695f('0x1c')][_0x695f('0x1d')]({'attributes':['id',_0x695f('0x15'),'internal'],'where':{'role':_0x695f('0x1e'),'chanspy':!![]},'raw':!![]})['then'](function(_0x4f2655){if(_0x4f2655){return _0x234058(getChanSpyApplications(_0xb1014d,_0x4f2655));}return _0x234058([]);})[_0x695f('0x1f')](function(_0x6985ac){_0x40376f(_0x6985ac);});});};module['exports']=function(_0xb7638f,_0x2bec16){var _0x135c1b=_0xb7638f['models'];return _0xb7638f[_0x695f('0x20')]('VoiceChanSpy',attributes,{'tableName':_0x695f('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x19fcd5,_0x1f64fe,_0x2ec4e3){return getChanSpyPromise(_0x135c1b,_0x19fcd5)[_0x695f('0x22')](function(_0x6cebdf){if(_0x6cebdf&&_0x6cebdf[_0x695f('0x19')]){return _0x135c1b['VoiceExtension'][_0x695f('0x23')](_0x6cebdf);}})[_0x695f('0x22')](function(){_0x2ec4e3();})[_0x695f('0x1f')](function(_0x7faeff){_0x2ec4e3(_0x7faeff);});},'afterUpdate':function(_0x34c686,_0x46cf35,_0x34e8e5){return _0x135c1b[_0x695f('0x24')][_0x695f('0x25')]({'where':{'ChanSpyId':_0x34c686['id']}})['then'](function(){return getChanSpyPromise(_0x135c1b,_0x34c686);})['then'](function(_0x111f89){if(_0x111f89&&_0x111f89[_0x695f('0x19')]){return _0x135c1b[_0x695f('0x24')]['bulkCreate'](_0x111f89);}})[_0x695f('0x22')](function(){_0x34e8e5();})[_0x695f('0x1f')](function(_0x239541){_0x34e8e5(_0x239541);});},'afterDestroy':function(_0x52e24d,_0x54e9d9,_0x5c2bae){return _0x135c1b['VoiceExtension'][_0x695f('0x25')]({'where':{'ChanSpyId':_0x52e24d['id']}})[_0x695f('0x22')](function(){_0x5c2bae();})[_0x695f('0x1f')](function(_0x256821){_0x5c2bae(_0x256821);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 92c264a..3c8a9eb 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(_0x1b745b,_0x3e2d40){var _0x120a9d=function(_0x882a6c){while(--_0x882a6c){_0x1b745b['push'](_0x1b745b['shift']());}};_0x120a9d(++_0x3e2d40);}(_0x9348,0x10d));var _0x8934=function(_0x2f9b9c,_0x4be5b9){_0x2f9b9c=_0x2f9b9c-0x0;var _0x1ef60c=_0x9348[_0x2f9b9c];return _0x1ef60c;};'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 _0x0427=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceChanSpy,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5a907f,_0x59b500){var _0x1032a7=function(_0x3c41ac){while(--_0x3c41ac){_0x5a907f['push'](_0x5a907f['shift']());}};_0x1032a7(++_0x59b500);}(_0x0427,0x137));var _0x7042=function(_0x23ad7b,_0x2cac4a){_0x23ad7b=_0x23ad7b-0x0;var _0x438d2a=_0x0427[_0x23ad7b];return _0x438d2a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7042('0x0'));var BPromise=require(_0x7042('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7042('0x2'));var db=require(_0x7042('0x3'))['db'];var utils=require(_0x7042('0x4'));var logger=require(_0x7042('0x5'))(_0x7042('0x6'));var config=require(_0x7042('0x7'));var jayson=require(_0x7042('0x8'));var client=jayson['client'][_0x7042('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f24b5,_0x25c552,_0x346aa8){return new BPromise(function(_0x295b19,_0x978169){return client[_0x7042('0xa')](_0x2f24b5,_0x346aa8)[_0x7042('0xb')](function(_0x3bd534){logger['info'](_0x7042('0xc'),_0x25c552,'request\x20sent');logger['debug']('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x25c552,'request\x20sent',JSON[_0x7042('0xd')](_0x3bd534));if(_0x3bd534['error']){if(_0x3bd534[_0x7042('0xe')][_0x7042('0xf')]===0x1f4){logger[_0x7042('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x25c552,_0x3bd534['error'][_0x7042('0x10')]);return _0x978169(_0x3bd534[_0x7042('0xe')][_0x7042('0x10')]);}logger[_0x7042('0xe')](_0x7042('0xc'),_0x25c552,_0x3bd534[_0x7042('0xe')]['message']);return _0x295b19(_0x3bd534[_0x7042('0xe')][_0x7042('0x10')]);}else{logger[_0x7042('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x25c552,_0x7042('0x12'));_0x295b19(_0x3bd534[_0x7042('0x13')]['message']);}})[_0x7042('0x14')](function(_0x590edd){logger['error'](_0x7042('0xc'),_0x25c552,_0x590edd);_0x978169(_0x590edd);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 2fe07e1..466ca09 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 _0x51f1=['/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceContext.controller','get','isAuthenticated','index'];(function(_0x426ab4,_0x3aa799){var _0x290c07=function(_0x41ffe4){while(--_0x41ffe4){_0x426ab4['push'](_0x426ab4['shift']());}};_0x290c07(++_0x3aa799);}(_0x51f1,0x115));var _0x151f=function(_0x4cc17e,_0xbff357){_0x4cc17e=_0x4cc17e-0x0;var _0x4ee2e9=_0x51f1[_0x4cc17e];return _0x4ee2e9;};'use strict';var multer=require(_0x151f('0x0'));var util=require('util');var path=require(_0x151f('0x1'));var timeout=require(_0x151f('0x2'));var express=require(_0x151f('0x3'));var router=express[_0x151f('0x4')]();var fs_extra=require(_0x151f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x151f('0x6'));var controller=require(_0x151f('0x7'));router[_0x151f('0x8')]('/',auth[_0x151f('0x9')](),controller[_0x151f('0xa')]);router[_0x151f('0x8')](_0x151f('0xb'),auth[_0x151f('0x9')](),controller['show']);router[_0x151f('0xc')]('/',auth[_0x151f('0x9')](),controller[_0x151f('0xd')]);router['put'](_0x151f('0xb'),auth[_0x151f('0x9')](),controller[_0x151f('0xe')]);router[_0x151f('0xf')](_0x151f('0xb'),auth[_0x151f('0x9')](),controller[_0x151f('0x10')]);module[_0x151f('0x11')]=router; \ No newline at end of file +var _0x46af=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x34deef,_0x1b25ec){var _0x4e1e80=function(_0x594503){while(--_0x594503){_0x34deef['push'](_0x34deef['shift']());}};_0x4e1e80(++_0x1b25ec);}(_0x46af,0xf0));var _0xf46a=function(_0x28f6b6,_0x5a98bb){_0x28f6b6=_0x28f6b6-0x0;var _0x46f736=_0x46af[_0x28f6b6];return _0x46f736;};'use strict';var multer=require(_0xf46a('0x0'));var util=require(_0xf46a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf46a('0x2'));var router=express[_0xf46a('0x3')]();var fs_extra=require(_0xf46a('0x4'));var auth=require(_0xf46a('0x5'));var interaction=require(_0xf46a('0x6'));var config=require(_0xf46a('0x7'));var controller=require(_0xf46a('0x8'));router[_0xf46a('0x9')]('/',auth[_0xf46a('0xa')](),controller[_0xf46a('0xb')]);router['get'](_0xf46a('0xc'),auth[_0xf46a('0xa')](),controller[_0xf46a('0xd')]);router[_0xf46a('0xe')]('/',auth[_0xf46a('0xa')](),controller['create']);router[_0xf46a('0xf')](_0xf46a('0xc'),auth['isAuthenticated'](),controller[_0xf46a('0x10')]);router[_0xf46a('0x11')]('/:id',auth[_0xf46a('0xa')](),controller[_0xf46a('0x12')]);module[_0xf46a('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 41e74dd..0e39e88 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 _0xb51c=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x28cbc5,_0x326e44){var _0x310541=function(_0x23a322){while(--_0x23a322){_0x28cbc5['push'](_0x28cbc5['shift']());}};_0x310541(++_0x326e44);}(_0xb51c,0x1a9));var _0xcb51=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb51c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xcb51('0x0'));module[_0xcb51('0x1')]={'name':{'type':Sequelize[_0xcb51('0x2')],'unique':_0xcb51('0x3')},'description':{'type':Sequelize[_0xcb51('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xcb51('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x05e5=['BOOLEAN','sequelize','STRING','name'];(function(_0x17fdb4,_0x1b484e){var _0x3bdc6c=function(_0xfc8121){while(--_0xfc8121){_0x17fdb4['push'](_0x17fdb4['shift']());}};_0x3bdc6c(++_0x1b484e);}(_0x05e5,0x185));var _0x505e=function(_0x13184d,_0x6bdeb0){_0x13184d=_0x13184d-0x0;var _0x384a96=_0x05e5[_0x13184d];return _0x384a96;};'use strict';var Sequelize=require(_0x505e('0x0'));module['exports']={'name':{'type':Sequelize[_0x505e('0x1')],'unique':_0x505e('0x2')},'description':{'type':Sequelize[_0x505e('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x505e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index b7c750d..6c084c0 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 _0x67b2=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','save','UserProfileResource','destroy','sendStatus','send','map','VoiceContext','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','find','create','findAll','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','readFileSync','writeFileSync','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs'];(function(_0x1a2926,_0x4de87d){var _0x3931d7=function(_0x59c032){while(--_0x59c032){_0x1a2926['push'](_0x1a2926['shift']());}};_0x3931d7(++_0x4de87d);}(_0x67b2,0xb9));var _0x267b=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0x67b2[_0x3299d1];return _0x44356e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x267b('0x0'));var zipdir=require(_0x267b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x267b('0x2'));var moment=require(_0x267b('0x3'));var BPromise=require(_0x267b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x267b('0x5'));var sox=require(_0x267b('0x6'));var csv=require(_0x267b('0x7'));var ejs=require(_0x267b('0x8'));var fs=require('fs');var fs_extra=require(_0x267b('0x9'));var _=require(_0x267b('0xa'));var squel=require('squel');var crypto=require(_0x267b('0xb'));var jsforce=require(_0x267b('0xc'));var deskjs=require(_0x267b('0xd'));var toCsv=require(_0x267b('0x7'));var querystring=require(_0x267b('0xe'));var Papa=require(_0x267b('0xf'));var Redis=require(_0x267b('0x10'));var authService=require(_0x267b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x267b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x267b('0x13'));var licenseUtil=require(_0x267b('0x14'));var db=require(_0x267b('0x15'))['db'];var jayson=require(_0x267b('0x16'));var client=jayson[_0x267b('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46835c,_0x50574c,_0x1ef084,_0x54f061){return new BPromise(function(_0x2fb0fe,_0x3ef882){var _0x2b5130=_0x54f061||client;return _0x2b5130['request'](_0x46835c,_0x1ef084)[_0x267b('0x18')](function(_0x3c533f){logger[_0x267b('0x19')](_0x267b('0x1a'),_0x50574c,'request\x20sent');logger[_0x267b('0x1b')](_0x267b('0x1c'),_0x50574c,_0x267b('0x1d'),JSON[_0x267b('0x1e')](_0x3c533f));if(_0x3c533f[_0x267b('0x1f')]){if(_0x3c533f[_0x267b('0x1f')][_0x267b('0x20')]===0x1f4){logger[_0x267b('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x50574c,_0x3c533f[_0x267b('0x1f')][_0x267b('0x21')]);return _0x3ef882(_0x3c533f[_0x267b('0x1f')][_0x267b('0x21')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x50574c,_0x3c533f[_0x267b('0x1f')]['message']);return _0x2fb0fe(_0x3c533f[_0x267b('0x1f')]['message']);}else{logger[_0x267b('0x19')]('VoiceContext,\x20%s,\x20%s',_0x50574c,_0x267b('0x1d'));_0x2fb0fe(_0x3c533f[_0x267b('0x22')][_0x267b('0x21')]);}})[_0x267b('0x23')](function(_0x53623e){logger[_0x267b('0x1f')](_0x267b('0x1a'),_0x50574c,_0x53623e);_0x3ef882(_0x53623e);});});}function respondWithStatusCode(_0x4994b0,_0x40bd08){_0x40bd08=_0x40bd08||0xcc;return function(_0x198193){if(_0x198193){return _0x4994b0['sendStatus'](_0x40bd08);}return _0x4994b0[_0x267b('0x24')](_0x40bd08)[_0x267b('0x25')]();};}function respondWithResult(_0x4e48c6,_0x116b34){_0x116b34=_0x116b34||0xc8;return function(_0x4bd15e){if(_0x4bd15e){return _0x4e48c6[_0x267b('0x24')](_0x116b34)[_0x267b('0x26')](_0x4bd15e);}};}function respondWithFilteredResult(_0x4a8567,_0x4675ec){return function(_0x4c7ba7){if(_0x4c7ba7){var _0x5879e3=typeof _0x4675ec[_0x267b('0x27')]===_0x267b('0x28')&&typeof _0x4675ec[_0x267b('0x29')]===_0x267b('0x28');var _0x30af44=_0x4c7ba7['count'];var _0x40ba3a=_0x5879e3?0x0:_0x4675ec[_0x267b('0x27')];var _0x21dca8=_0x5879e3?_0x4c7ba7[_0x267b('0x2a')]:_0x4675ec['offset']+_0x4675ec[_0x267b('0x29')];var _0x4b8e40;if(_0x21dca8>=_0x30af44){_0x21dca8=_0x30af44;_0x4b8e40=0xc8;}else{_0x4b8e40=0xce;}_0x4a8567[_0x267b('0x24')](_0x4b8e40);return _0x4a8567['set'](_0x267b('0x2b'),_0x40ba3a+'-'+_0x21dca8+'/'+_0x30af44)[_0x267b('0x26')](_0x4c7ba7);}return null;};}function patchUpdates(_0x22d390){return function(_0x4bf119){try{jsonpatch['apply'](_0x4bf119,_0x22d390,!![]);}catch(_0x52fa1a){return BPromise['reject'](_0x52fa1a);}return _0x4bf119[_0x267b('0x2c')]();};}function saveUpdates(_0x402cd4,_0x2d6467){return function(_0x4244c3){if(_0x4244c3){return _0x4244c3['update'](_0x402cd4)[_0x267b('0x18')](function(_0xaf0e32){return _0xaf0e32;});}return null;};}function removeEntity(_0x39dbda,_0x456091){return function(_0xdb6f84){if(_0xdb6f84){return _0xdb6f84['destroy']()['then'](function(){var _0x3e272c=_0xdb6f84['get']({'plain':!![]});var _0x5bda8a='Contexts';return db[_0x267b('0x2d')][_0x267b('0x2e')]({'where':{'type':_0x5bda8a,'resourceId':_0x3e272c['id']}})[_0x267b('0x18')](function(){return _0xdb6f84;});})[_0x267b('0x18')](function(){_0x39dbda['status'](0xcc)[_0x267b('0x25')]();});}};}function handleEntityNotFound(_0x335ab7,_0x28ec3b){return function(_0x4cc8b5){if(!_0x4cc8b5){_0x335ab7[_0x267b('0x2f')](0x194);}return _0x4cc8b5;};}function handleError(_0x44c14a,_0x10a0e7){_0x10a0e7=_0x10a0e7||0x1f4;return function(_0x4de6b7){logger[_0x267b('0x1f')](_0x4de6b7['stack']);if(_0x4de6b7['name']){delete _0x4de6b7['name'];}_0x44c14a['status'](_0x10a0e7)[_0x267b('0x30')](_0x4de6b7);};}exports['index']=function(_0x238824,_0x13e8b5){var _0x42f9ed={},_0x4f9c8b={},_0x317f42={'count':0x0,'rows':[]};var _0x3f76cf=_[_0x267b('0x31')](db[_0x267b('0x32')][_0x267b('0x33')],function(_0x50429e){return{'name':_0x50429e[_0x267b('0x34')],'type':_0x50429e['type'][_0x267b('0x35')]};});_0x4f9c8b[_0x267b('0x36')]=_['map'](_0x3f76cf,_0x267b('0x37'));_0x4f9c8b[_0x267b('0x38')]=_[_0x267b('0x39')](_0x238824[_0x267b('0x38')]);_0x4f9c8b[_0x267b('0x3a')]=_[_0x267b('0x3b')](_0x4f9c8b[_0x267b('0x36')],_0x4f9c8b[_0x267b('0x38')]);_0x42f9ed[_0x267b('0x3c')]=_[_0x267b('0x3b')](_0x4f9c8b[_0x267b('0x36')],qs[_0x267b('0x3d')](_0x238824['query']['fields']));_0x42f9ed[_0x267b('0x3c')]=_0x42f9ed['attributes'][_0x267b('0x3e')]?_0x42f9ed[_0x267b('0x3c')]:_0x4f9c8b[_0x267b('0x36')];if(!_0x238824[_0x267b('0x38')]['hasOwnProperty']('nolimit')){_0x42f9ed[_0x267b('0x29')]=qs[_0x267b('0x29')](_0x238824[_0x267b('0x38')]['limit']);_0x42f9ed[_0x267b('0x27')]=qs['offset'](_0x238824[_0x267b('0x38')][_0x267b('0x27')]);}_0x42f9ed['order']=qs[_0x267b('0x3f')](_0x238824[_0x267b('0x38')][_0x267b('0x3f')]);_0x42f9ed['where']=qs['filters'](_[_0x267b('0x40')](_0x238824[_0x267b('0x38')],_0x4f9c8b[_0x267b('0x3a')]),_0x3f76cf);if(_0x238824[_0x267b('0x38')][_0x267b('0x41')]){_0x42f9ed[_0x267b('0x42')]=_[_0x267b('0x43')](_0x42f9ed[_0x267b('0x42')],{'$or':_[_0x267b('0x31')](_0x3f76cf,function(_0x77207b){if(_0x77207b['type']!==_0x267b('0x44')){var _0x58e6aa={};_0x58e6aa[_0x77207b[_0x267b('0x37')]]={'$like':'%'+_0x238824[_0x267b('0x38')]['filter']+'%'};return _0x58e6aa;}})});}_0x42f9ed=_[_0x267b('0x43')]({},_0x42f9ed,_0x238824[_0x267b('0x45')]);var _0xe66cdf={'where':_0x42f9ed['where']};return db['VoiceContext'][_0x267b('0x2a')](_0xe66cdf)['then'](function(_0x346446){_0x317f42[_0x267b('0x2a')]=_0x346446;if(_0x238824['query'][_0x267b('0x46')]){_0x42f9ed[_0x267b('0x47')]=[{'all':!![]}];}return db[_0x267b('0x32')]['findAll'](_0x42f9ed);})[_0x267b('0x18')](function(_0x4074fb){_0x317f42[_0x267b('0x48')]=_0x4074fb;return _0x317f42;})['then'](respondWithFilteredResult(_0x13e8b5,_0x42f9ed))[_0x267b('0x23')](handleError(_0x13e8b5,null));};exports['show']=function(_0x4ec497,_0x2b14e3){var _0x345a6f={'raw':![],'where':{'id':_0x4ec497[_0x267b('0x49')]['id']}},_0x379b35={};_0x379b35[_0x267b('0x36')]=_[_0x267b('0x39')](db[_0x267b('0x32')][_0x267b('0x33')]);_0x379b35[_0x267b('0x38')]=_['keys'](_0x4ec497['query']);_0x379b35[_0x267b('0x3a')]=_[_0x267b('0x3b')](_0x379b35[_0x267b('0x36')],_0x379b35['query']);_0x345a6f['attributes']=_[_0x267b('0x3b')](_0x379b35[_0x267b('0x36')],qs[_0x267b('0x3d')](_0x4ec497[_0x267b('0x38')][_0x267b('0x3d')]));_0x345a6f[_0x267b('0x3c')]=_0x345a6f[_0x267b('0x3c')][_0x267b('0x3e')]?_0x345a6f['attributes']:_0x379b35['model'];if(_0x4ec497['query'][_0x267b('0x46')]){_0x345a6f[_0x267b('0x47')]=[{'all':!![]}];}_0x345a6f=_[_0x267b('0x43')]({},_0x345a6f,_0x4ec497[_0x267b('0x45')]);return db['VoiceContext'][_0x267b('0x4a')](_0x345a6f)[_0x267b('0x18')](handleEntityNotFound(_0x2b14e3,null))[_0x267b('0x18')](respondWithResult(_0x2b14e3,null))[_0x267b('0x23')](handleError(_0x2b14e3,null));};exports[_0x267b('0x4b')]=function(_0x42d600,_0x2b01d5,_0x334637){var _0x3b7717;return db[_0x267b('0x32')]['create'](_0x42d600['body'],{'raw':!![]})[_0x267b('0x18')](function(_0x2e4f18){_0x3b7717=_0x2e4f18;return db['VoiceContext'][_0x267b('0x4c')]({'raw':!![]});})['then'](function(_0x55ea93){var _0x24c3ac=fs['readFileSync'](path[_0x267b('0x4d')](config[_0x267b('0x4e')],_0x267b('0x4f')),_0x267b('0x50'));var _0x45601d=ejs[_0x267b('0x51')](_0x24c3ac,{'contexts':_0x55ea93||[]});fs['writeFileSync'](_0x267b('0x52'),_0x45601d);})[_0x267b('0x18')](function(){return respondWithRpcPromise(_0x267b('0x53'),'create',{'module':_0x267b('0x54')});})[_0x267b('0x18')](function(){var _0x529c4d=_0x42d600[_0x267b('0x55')][_0x267b('0x56')]({'plain':!![]});if(!_0x529c4d)throw new Error(_0x267b('0x57'));if(_0x529c4d[_0x267b('0x58')]==='user'){var _0x4cc326=_0x3b7717[_0x267b('0x56')]({'plain':!![]});return db[_0x267b('0x59')][_0x267b('0x4a')]({'where':{'name':_0x267b('0x5a'),'userProfileId':_0x529c4d[_0x267b('0x5b')]},'raw':!![]})['then'](function(_0xc12df1){if(_0xc12df1&&_0xc12df1['autoAssociation']===0x0){return db['UserProfileResource'][_0x267b('0x4b')]({'name':_0x4cc326[_0x267b('0x37')],'resourceId':_0x4cc326['id'],'type':_0xc12df1['name'],'sectionId':_0xc12df1['id']},{})[_0x267b('0x18')](function(){return _0x3b7717;});}else{return _0x3b7717;}})['catch'](function(_0x17795a){logger['error'](_0x267b('0x5c'),_0x17795a);throw _0x17795a;});}return _0x3b7717;})[_0x267b('0x18')](respondWithResult(_0x2b01d5,0xc9))[_0x267b('0x23')](handleError(_0x2b01d5,null));};exports[_0x267b('0x5d')]=function(_0x15c31c,_0xa7d2a0,_0x5c22a1){var _0x44964f;return db[_0x267b('0x32')][_0x267b('0x4a')]({'where':{'id':_0x15c31c[_0x267b('0x49')]['id']}})[_0x267b('0x18')](handleEntityNotFound(_0xa7d2a0,null))[_0x267b('0x18')](saveUpdates(_0x15c31c[_0x267b('0x5e')],null))['then'](function(_0x37df6c){if(_0x37df6c){_0x44964f=_0x37df6c;return db[_0x267b('0x32')][_0x267b('0x4c')]({'raw':!![]});}})[_0x267b('0x18')](function(_0xa8cf20){var _0x156e0d=fs['readFileSync'](path[_0x267b('0x4d')](config[_0x267b('0x4e')],_0x267b('0x4f')),_0x267b('0x50'));var _0x524bce=ejs['render'](_0x156e0d,{'contexts':_0xa8cf20||[]});fs['writeFileSync'](_0x267b('0x52'),_0x524bce);})[_0x267b('0x18')](function(){return respondWithRpcPromise(_0x267b('0x53'),_0x267b('0x5d'),{'module':_0x267b('0x54')});})[_0x267b('0x18')](function(){return _0x44964f;})['then'](respondWithResult(_0xa7d2a0,null))['catch'](handleError(_0xa7d2a0,null));};exports['destroy']=function(_0x332295,_0x5e31c9,_0x3569d6){var _0x5970c7;return db[_0x267b('0x32')][_0x267b('0x4a')]({'where':{'id':_0x332295[_0x267b('0x49')]['id']}})[_0x267b('0x18')](handleEntityNotFound(_0x5e31c9,null))[_0x267b('0x18')](removeEntity(_0x5e31c9,null))[_0x267b('0x18')](function(){return db[_0x267b('0x32')][_0x267b('0x4c')]({'raw':!![]});})['then'](function(_0x29264c){var _0x5b25a2=fs[_0x267b('0x5f')](path[_0x267b('0x4d')](config[_0x267b('0x4e')],_0x267b('0x4f')),_0x267b('0x50'));var _0x3ed087=ejs[_0x267b('0x51')](_0x5b25a2,{'contexts':_0x29264c});fs[_0x267b('0x60')](_0x267b('0x52'),_0x3ed087);return respondWithRpcPromise(_0x267b('0x53'),_0x267b('0x2e'),{'module':_0x267b('0x54')});})['catch'](handleError(_0x5e31c9,null));}; \ No newline at end of file +var _0x82ba=['api','../../config/utils','../../config/license/util','client','http','request','info','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','sendStatus','status','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','get','Contexts','end','stack','name','send','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','params','includeAll','find','create','body','readFileSync','join','root','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3606ca,_0x3ce4d9){var _0x19ef0f=function(_0x321691){while(--_0x321691){_0x3606ca['push'](_0x3606ca['shift']());}};_0x19ef0f(++_0x3ce4d9);}(_0x82ba,0x188));var _0xa82b=function(_0x295f06,_0xf7b516){_0x295f06=_0x295f06-0x0;var _0x1609cc=_0x82ba[_0x295f06];return _0x1609cc;};'use strict';var emlformat=require(_0xa82b('0x0'));var rimraf=require(_0xa82b('0x1'));var zipdir=require(_0xa82b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa82b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa82b('0x4'));var util=require(_0xa82b('0x5'));var path=require(_0xa82b('0x6'));var sox=require(_0xa82b('0x7'));var csv=require(_0xa82b('0x8'));var ejs=require(_0xa82b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa82b('0xa'));var crypto=require('crypto');var jsforce=require(_0xa82b('0xb'));var deskjs=require(_0xa82b('0xc'));var toCsv=require(_0xa82b('0x8'));var querystring=require(_0xa82b('0xd'));var Papa=require(_0xa82b('0xe'));var Redis=require('ioredis');var authService=require(_0xa82b('0xf'));var qs=require(_0xa82b('0x10'));var as=require(_0xa82b('0x11'));var hardwareService=require(_0xa82b('0x12'));var logger=require(_0xa82b('0x13'))(_0xa82b('0x14'));var utils=require(_0xa82b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa82b('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xa82b('0x17')][_0xa82b('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2b1581,_0x540ea9,_0x3bd2d0,_0x474ba6){return new BPromise(function(_0x2079f2,_0x27fe7d){var _0x39eb40=_0x474ba6||client;return _0x39eb40[_0xa82b('0x19')](_0x2b1581,_0x3bd2d0)['then'](function(_0x200f33){logger[_0xa82b('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x540ea9,_0xa82b('0x1b'));logger[_0xa82b('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x540ea9,_0xa82b('0x1b'),JSON[_0xa82b('0x1d')](_0x200f33));if(_0x200f33['error']){if(_0x200f33[_0xa82b('0x1e')][_0xa82b('0x1f')]===0x1f4){logger[_0xa82b('0x1e')](_0xa82b('0x20'),_0x540ea9,_0x200f33[_0xa82b('0x1e')][_0xa82b('0x21')]);return _0x27fe7d(_0x200f33['error']['message']);}logger['error'](_0xa82b('0x20'),_0x540ea9,_0x200f33[_0xa82b('0x1e')][_0xa82b('0x21')]);return _0x2079f2(_0x200f33[_0xa82b('0x1e')][_0xa82b('0x21')]);}else{logger[_0xa82b('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x540ea9,_0xa82b('0x1b'));_0x2079f2(_0x200f33[_0xa82b('0x22')][_0xa82b('0x21')]);}})['catch'](function(_0x5a74c3){logger['error'](_0xa82b('0x20'),_0x540ea9,_0x5a74c3);_0x27fe7d(_0x5a74c3);});});}function respondWithStatusCode(_0xc07a50,_0x4fd38e){_0x4fd38e=_0x4fd38e||0xcc;return function(_0x5b3cd8){if(_0x5b3cd8){return _0xc07a50[_0xa82b('0x23')](_0x4fd38e);}return _0xc07a50[_0xa82b('0x24')](_0x4fd38e)['end']();};}function respondWithResult(_0x454870,_0x23ebf5){_0x23ebf5=_0x23ebf5||0xc8;return function(_0x36f21e){if(_0x36f21e){return _0x454870[_0xa82b('0x24')](_0x23ebf5)['json'](_0x36f21e);}};}function respondWithFilteredResult(_0x4362b4,_0x36ba91){return function(_0x5eff0){if(_0x5eff0){var _0x4f5e25=typeof _0x36ba91['offset']===_0xa82b('0x25')&&typeof _0x36ba91[_0xa82b('0x26')]===_0xa82b('0x25');var _0x3c613c=_0x5eff0[_0xa82b('0x27')];var _0x3b0393=_0x4f5e25?0x0:_0x36ba91['offset'];var _0x273419=_0x4f5e25?_0x5eff0['count']:_0x36ba91['offset']+_0x36ba91[_0xa82b('0x26')];var _0xfe32b6;if(_0x273419>=_0x3c613c){_0x273419=_0x3c613c;_0xfe32b6=0xc8;}else{_0xfe32b6=0xce;}_0x4362b4[_0xa82b('0x24')](_0xfe32b6);return _0x4362b4[_0xa82b('0x28')]('Content-Range',_0x3b0393+'-'+_0x273419+'/'+_0x3c613c)[_0xa82b('0x29')](_0x5eff0);}return null;};}function patchUpdates(_0x50d834){return function(_0x93a670){try{jsonpatch[_0xa82b('0x2a')](_0x93a670,_0x50d834,!![]);}catch(_0x56ae41){return BPromise[_0xa82b('0x2b')](_0x56ae41);}return _0x93a670[_0xa82b('0x2c')]();};}function saveUpdates(_0x4c731f,_0x2defb3){return function(_0x34c40f){if(_0x34c40f){return _0x34c40f[_0xa82b('0x2d')](_0x4c731f)['then'](function(_0x12b363){return _0x12b363;});}return null;};}function removeEntity(_0x49ff3a,_0x3942b7){return function(_0x22c3ee){if(_0x22c3ee){return _0x22c3ee[_0xa82b('0x2e')]()[_0xa82b('0x2f')](function(){var _0x2f01cc=_0x22c3ee[_0xa82b('0x30')]({'plain':!![]});var _0x409db7=_0xa82b('0x31');return db['UserProfileResource']['destroy']({'where':{'type':_0x409db7,'resourceId':_0x2f01cc['id']}})[_0xa82b('0x2f')](function(){return _0x22c3ee;});})['then'](function(){_0x49ff3a[_0xa82b('0x24')](0xcc)[_0xa82b('0x32')]();});}};}function handleEntityNotFound(_0x575154,_0x5e2f25){return function(_0x5d0b66){if(!_0x5d0b66){_0x575154['sendStatus'](0x194);}return _0x5d0b66;};}function handleError(_0x22bb75,_0x5ef400){_0x5ef400=_0x5ef400||0x1f4;return function(_0x2c3e98){logger[_0xa82b('0x1e')](_0x2c3e98[_0xa82b('0x33')]);if(_0x2c3e98[_0xa82b('0x34')]){delete _0x2c3e98[_0xa82b('0x34')];}_0x22bb75[_0xa82b('0x24')](_0x5ef400)[_0xa82b('0x35')](_0x2c3e98);};}exports[_0xa82b('0x36')]=function(_0x262958,_0x440d8c){var _0x1225a0={},_0x3c023b={},_0x83358e={'count':0x0,'rows':[]};var _0x5724f3=_['map'](db[_0xa82b('0x37')][_0xa82b('0x38')],function(_0x4ffc4b){return{'name':_0x4ffc4b[_0xa82b('0x39')],'type':_0x4ffc4b[_0xa82b('0x3a')][_0xa82b('0x3b')]};});_0x3c023b[_0xa82b('0x3c')]=_[_0xa82b('0x3d')](_0x5724f3,_0xa82b('0x34'));_0x3c023b[_0xa82b('0x3e')]=_[_0xa82b('0x3f')](_0x262958[_0xa82b('0x3e')]);_0x3c023b[_0xa82b('0x40')]=_[_0xa82b('0x41')](_0x3c023b[_0xa82b('0x3c')],_0x3c023b[_0xa82b('0x3e')]);_0x1225a0['attributes']=_[_0xa82b('0x41')](_0x3c023b['model'],qs[_0xa82b('0x42')](_0x262958[_0xa82b('0x3e')][_0xa82b('0x42')]));_0x1225a0[_0xa82b('0x43')]=_0x1225a0[_0xa82b('0x43')][_0xa82b('0x44')]?_0x1225a0[_0xa82b('0x43')]:_0x3c023b[_0xa82b('0x3c')];if(!_0x262958[_0xa82b('0x3e')][_0xa82b('0x45')](_0xa82b('0x46'))){_0x1225a0['limit']=qs[_0xa82b('0x26')](_0x262958[_0xa82b('0x3e')][_0xa82b('0x26')]);_0x1225a0['offset']=qs['offset'](_0x262958[_0xa82b('0x3e')][_0xa82b('0x47')]);}_0x1225a0[_0xa82b('0x48')]=qs[_0xa82b('0x49')](_0x262958[_0xa82b('0x3e')][_0xa82b('0x49')]);_0x1225a0[_0xa82b('0x4a')]=qs[_0xa82b('0x40')](_[_0xa82b('0x4b')](_0x262958[_0xa82b('0x3e')],_0x3c023b[_0xa82b('0x40')]),_0x5724f3);if(_0x262958[_0xa82b('0x3e')][_0xa82b('0x4c')]){_0x1225a0[_0xa82b('0x4a')]=_[_0xa82b('0x4d')](_0x1225a0[_0xa82b('0x4a')],{'$or':_['map'](_0x5724f3,function(_0x261d37){if(_0x261d37[_0xa82b('0x3a')]!==_0xa82b('0x4e')){var _0x4e4fbd={};_0x4e4fbd[_0x261d37['name']]={'$like':'%'+_0x262958[_0xa82b('0x3e')][_0xa82b('0x4c')]+'%'};return _0x4e4fbd;}})});}_0x1225a0=_['merge']({},_0x1225a0,_0x262958['options']);var _0x4c7179={'where':_0x1225a0[_0xa82b('0x4a')]};return db[_0xa82b('0x37')][_0xa82b('0x27')](_0x4c7179)[_0xa82b('0x2f')](function(_0x71c0fd){_0x83358e[_0xa82b('0x27')]=_0x71c0fd;if(_0x262958[_0xa82b('0x3e')]['includeAll']){_0x1225a0[_0xa82b('0x4f')]=[{'all':!![]}];}return db[_0xa82b('0x37')][_0xa82b('0x50')](_0x1225a0);})['then'](function(_0x4718d7){_0x83358e['rows']=_0x4718d7;return _0x83358e;})[_0xa82b('0x2f')](respondWithFilteredResult(_0x440d8c,_0x1225a0))[_0xa82b('0x51')](handleError(_0x440d8c,null));};exports['show']=function(_0xadb827,_0x5b59b7){var _0x4f807a={'raw':![],'where':{'id':_0xadb827[_0xa82b('0x52')]['id']}},_0x801dcb={};_0x801dcb[_0xa82b('0x3c')]=_['keys'](db[_0xa82b('0x37')][_0xa82b('0x38')]);_0x801dcb[_0xa82b('0x3e')]=_['keys'](_0xadb827['query']);_0x801dcb['filters']=_[_0xa82b('0x41')](_0x801dcb['model'],_0x801dcb[_0xa82b('0x3e')]);_0x4f807a[_0xa82b('0x43')]=_[_0xa82b('0x41')](_0x801dcb[_0xa82b('0x3c')],qs[_0xa82b('0x42')](_0xadb827[_0xa82b('0x3e')][_0xa82b('0x42')]));_0x4f807a[_0xa82b('0x43')]=_0x4f807a[_0xa82b('0x43')][_0xa82b('0x44')]?_0x4f807a[_0xa82b('0x43')]:_0x801dcb[_0xa82b('0x3c')];if(_0xadb827[_0xa82b('0x3e')][_0xa82b('0x53')]){_0x4f807a['include']=[{'all':!![]}];}_0x4f807a=_[_0xa82b('0x4d')]({},_0x4f807a,_0xadb827['options']);return db[_0xa82b('0x37')][_0xa82b('0x54')](_0x4f807a)[_0xa82b('0x2f')](handleEntityNotFound(_0x5b59b7,null))[_0xa82b('0x2f')](respondWithResult(_0x5b59b7,null))['catch'](handleError(_0x5b59b7,null));};exports[_0xa82b('0x55')]=function(_0x31e5b2,_0x5e1d4e,_0x2e950b){var _0x3833ad;return db[_0xa82b('0x37')]['create'](_0x31e5b2[_0xa82b('0x56')],{'raw':!![]})[_0xa82b('0x2f')](function(_0x2b46ac){_0x3833ad=_0x2b46ac;return db[_0xa82b('0x37')]['findAll']({'raw':!![]});})[_0xa82b('0x2f')](function(_0x10bf24){var _0x388bbe=fs[_0xa82b('0x57')](path[_0xa82b('0x58')](config[_0xa82b('0x59')],'server/files/templates/context.ejs'),_0xa82b('0x5a'));var _0x47773f=ejs[_0xa82b('0x5b')](_0x388bbe,{'contexts':_0x10bf24||[]});fs[_0xa82b('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x47773f);})[_0xa82b('0x2f')](function(){return respondWithRpcPromise(_0xa82b('0x5d'),_0xa82b('0x55'),{'module':_0xa82b('0x5e')});})[_0xa82b('0x2f')](function(){var _0x12d856=_0x31e5b2[_0xa82b('0x5f')][_0xa82b('0x30')]({'plain':!![]});if(!_0x12d856)throw new Error(_0xa82b('0x60'));if(_0x12d856[_0xa82b('0x61')]==='user'){var _0x1775f4=_0x3833ad[_0xa82b('0x30')]({'plain':!![]});return db['UserProfileSection'][_0xa82b('0x54')]({'where':{'name':_0xa82b('0x31'),'userProfileId':_0x12d856[_0xa82b('0x62')]},'raw':!![]})[_0xa82b('0x2f')](function(_0x4f39dc){if(_0x4f39dc&&_0x4f39dc['autoAssociation']===0x0){return db[_0xa82b('0x63')][_0xa82b('0x55')]({'name':_0x1775f4['name'],'resourceId':_0x1775f4['id'],'type':_0x4f39dc[_0xa82b('0x34')],'sectionId':_0x4f39dc['id']},{})['then'](function(){return _0x3833ad;});}else{return _0x3833ad;}})[_0xa82b('0x51')](function(_0x1b2b63){logger[_0xa82b('0x1e')](_0xa82b('0x64'),_0x1b2b63);throw _0x1b2b63;});}return _0x3833ad;})[_0xa82b('0x2f')](respondWithResult(_0x5e1d4e,0xc9))[_0xa82b('0x51')](handleError(_0x5e1d4e,null));};exports[_0xa82b('0x2d')]=function(_0x1d7de3,_0x3f4dfe,_0x6ec19e){var _0x52fd17;return db[_0xa82b('0x37')][_0xa82b('0x54')]({'where':{'id':_0x1d7de3[_0xa82b('0x52')]['id']}})[_0xa82b('0x2f')](handleEntityNotFound(_0x3f4dfe,null))[_0xa82b('0x2f')](saveUpdates(_0x1d7de3['body'],null))['then'](function(_0x371984){if(_0x371984){_0x52fd17=_0x371984;return db['VoiceContext'][_0xa82b('0x50')]({'raw':!![]});}})['then'](function(_0x427cc6){var _0x42a96f=fs['readFileSync'](path[_0xa82b('0x58')](config[_0xa82b('0x59')],_0xa82b('0x65')),_0xa82b('0x5a'));var _0x5482ef=ejs[_0xa82b('0x5b')](_0x42a96f,{'contexts':_0x427cc6||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x5482ef);})['then'](function(){return respondWithRpcPromise('Reload',_0xa82b('0x2d'),{'module':_0xa82b('0x5e')});})[_0xa82b('0x2f')](function(){return _0x52fd17;})['then'](respondWithResult(_0x3f4dfe,null))['catch'](handleError(_0x3f4dfe,null));};exports[_0xa82b('0x2e')]=function(_0x47134a,_0x1a23d9,_0x2eb42a){var _0x4ded06;return db[_0xa82b('0x37')]['find']({'where':{'id':_0x47134a[_0xa82b('0x52')]['id']}})[_0xa82b('0x2f')](handleEntityNotFound(_0x1a23d9,null))[_0xa82b('0x2f')](removeEntity(_0x1a23d9,null))['then'](function(){return db[_0xa82b('0x37')][_0xa82b('0x50')]({'raw':!![]});})[_0xa82b('0x2f')](function(_0x2964c1){var _0x44c143=fs[_0xa82b('0x57')](path[_0xa82b('0x58')](config[_0xa82b('0x59')],_0xa82b('0x65')),_0xa82b('0x5a'));var _0x1dab40=ejs[_0xa82b('0x5b')](_0x44c143,{'contexts':_0x2964c1});fs[_0xa82b('0x5c')](_0xa82b('0x66'),_0x1dab40);return respondWithRpcPromise(_0xa82b('0x5d'),_0xa82b('0x2e'),{'module':_0xa82b('0x5e')});})[_0xa82b('0x51')](handleError(_0x1a23d9,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 059523a..eb0d317 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 _0x2080=['rimraf','./voiceContext.attributes','exports','define','voice_contexts','../../config/logger','api','moment','bluebird','path'];(function(_0x3ec818,_0x59e4dc){var _0x2aabc7=function(_0x501ae9){while(--_0x501ae9){_0x3ec818['push'](_0x3ec818['shift']());}};_0x2aabc7(++_0x59e4dc);}(_0x2080,0x19f));var _0x0208=function(_0xab8ffa,_0x29179d){_0xab8ffa=_0xab8ffa-0x0;var _0x173c69=_0x2080[_0xab8ffa];return _0x173c69;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0208('0x0'))(_0x0208('0x1'));var moment=require(_0x0208('0x2'));var BPromise=require(_0x0208('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0208('0x4'));var rimraf=require(_0x0208('0x5'));var config=require('../../config/environment');var attributes=require(_0x0208('0x6'));module[_0x0208('0x7')]=function(_0x2f21c1,_0x115952){return _0x2f21c1[_0x0208('0x8')]('VoiceContext',attributes,{'tableName':_0x0208('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa805=['util','../../config/logger','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x2eb794,_0x27550f){var _0x64e283=function(_0x27abde){while(--_0x27abde){_0x2eb794['push'](_0x2eb794['shift']());}};_0x64e283(++_0x27550f);}(_0xa805,0xb4));var _0x5a80=function(_0x1e44a1,_0x537516){_0x1e44a1=_0x1e44a1-0x0;var _0x2404b6=_0xa805[_0x1e44a1];return _0x2404b6;};'use strict';var _=require('lodash');var util=require(_0x5a80('0x0'));var logger=require(_0x5a80('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a80('0x2'));var rimraf=require(_0x5a80('0x3'));var config=require(_0x5a80('0x4'));var attributes=require(_0x5a80('0x5'));module[_0x5a80('0x6')]=function(_0x3c9b5b,_0xbedc31){return _0x3c9b5b[_0x5a80('0x7')](_0x5a80('0x8'),attributes,{'tableName':'voice_contexts','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 b4b7318..dc55917 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 _0x737e=['moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x290492,_0x18cfad){var _0x52b5bf=function(_0x3c3c63){while(--_0x3c3c63){_0x290492['push'](_0x290492['shift']());}};_0x52b5bf(++_0x18cfad);}(_0x737e,0x1cc));var _0xe737=function(_0x93d656,_0x2ac5d4){_0x93d656=_0x93d656-0x0;var _0x3c851a=_0x737e[_0x93d656];return _0x3c851a;};'use strict';var _=require(_0xe737('0x0'));var util=require(_0xe737('0x1'));var moment=require(_0xe737('0x2'));var BPromise=require(_0xe737('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe737('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe737('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe737('0x6'));var jayson=require(_0xe737('0x7'));var client=jayson[_0xe737('0x8')][_0xe737('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f4836,_0x57f186,_0xdb6b84){return new BPromise(function(_0x5c6c94,_0x262760){return client[_0xe737('0xa')](_0x2f4836,_0xdb6b84)[_0xe737('0xb')](function(_0x4ab21d){logger[_0xe737('0xc')]('VoiceContext,\x20%s,\x20%s',_0x57f186,_0xe737('0xd'));logger[_0xe737('0xe')](_0xe737('0xf'),_0x57f186,_0xe737('0xd'),JSON[_0xe737('0x10')](_0x4ab21d));if(_0x4ab21d[_0xe737('0x11')]){if(_0x4ab21d[_0xe737('0x11')][_0xe737('0x12')]===0x1f4){logger[_0xe737('0x11')](_0xe737('0x13'),_0x57f186,_0x4ab21d[_0xe737('0x11')][_0xe737('0x14')]);return _0x262760(_0x4ab21d[_0xe737('0x11')]['message']);}logger[_0xe737('0x11')](_0xe737('0x13'),_0x57f186,_0x4ab21d[_0xe737('0x11')][_0xe737('0x14')]);return _0x5c6c94(_0x4ab21d[_0xe737('0x11')][_0xe737('0x14')]);}else{logger[_0xe737('0xc')](_0xe737('0x13'),_0x57f186,_0xe737('0xd'));_0x5c6c94(_0x4ab21d[_0xe737('0x15')][_0xe737('0x14')]);}})['catch'](function(_0x7e5fad){logger[_0xe737('0x11')]('VoiceContext,\x20%s,\x20%s',_0x57f186,_0x7e5fad);_0x262760(_0x7e5fad);});});} \ No newline at end of file +var _0x7426=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','moment','bluebird','randomstring'];(function(_0x12f530,_0x54df42){var _0x374ce3=function(_0x42ab43){while(--_0x42ab43){_0x12f530['push'](_0x12f530['shift']());}};_0x374ce3(++_0x54df42);}(_0x7426,0x1df));var _0x6742=function(_0xc99795,_0x16db2d){_0xc99795=_0xc99795-0x0;var _0x2a2818=_0x7426[_0xc99795];return _0x2a2818;};'use strict';var _=require('lodash');var util=require(_0x6742('0x0'));var moment=require(_0x6742('0x1'));var BPromise=require(_0x6742('0x2'));var rs=require(_0x6742('0x3'));var fs=require('fs');var Redis=require(_0x6742('0x4'));var db=require(_0x6742('0x5'))['db'];var utils=require(_0x6742('0x6'));var logger=require(_0x6742('0x7'))(_0x6742('0x8'));var config=require('../../config/environment');var jayson=require(_0x6742('0x9'));var client=jayson['client'][_0x6742('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14219c,_0x1e82ea,_0x4a65d8){return new BPromise(function(_0x596067,_0x2736ca){return client[_0x6742('0xb')](_0x14219c,_0x4a65d8)[_0x6742('0xc')](function(_0x36176e){logger[_0x6742('0xd')](_0x6742('0xe'),_0x1e82ea,'request\x20sent');logger[_0x6742('0xf')](_0x6742('0x10'),_0x1e82ea,'request\x20sent',JSON[_0x6742('0x11')](_0x36176e));if(_0x36176e[_0x6742('0x12')]){if(_0x36176e[_0x6742('0x12')][_0x6742('0x13')]===0x1f4){logger[_0x6742('0x12')](_0x6742('0xe'),_0x1e82ea,_0x36176e['error']['message']);return _0x2736ca(_0x36176e[_0x6742('0x12')][_0x6742('0x14')]);}logger['error'](_0x6742('0xe'),_0x1e82ea,_0x36176e[_0x6742('0x12')][_0x6742('0x14')]);return _0x596067(_0x36176e[_0x6742('0x12')][_0x6742('0x14')]);}else{logger[_0x6742('0xd')]('VoiceContext,\x20%s,\x20%s',_0x1e82ea,_0x6742('0x15'));_0x596067(_0x36176e[_0x6742('0x16')][_0x6742('0x14')]);}})['catch'](function(_0x126b46){logger[_0x6742('0x12')](_0x6742('0xe'),_0x1e82ea,_0x126b46);_0x2736ca(_0x126b46);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index a2e13af..6fc4704 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 _0xa4de=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x23a6b3,_0x171b52){var _0x8bca9b=function(_0x2fda9d){while(--_0x2fda9d){_0x23a6b3['push'](_0x23a6b3['shift']());}};_0x8bca9b(++_0x171b52);}(_0xa4de,0x10d));var _0xea4d=function(_0x3d880c,_0x10606e){_0x3d880c=_0x3d880c-0x0;var _0x3686df=_0xa4de[_0x3d880c];return _0x3686df;};'use strict';var multer=require(_0xea4d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xea4d('0x1'));var express=require(_0xea4d('0x2'));var router=express[_0xea4d('0x3')]();var fs_extra=require(_0xea4d('0x4'));var auth=require(_0xea4d('0x5'));var interaction=require(_0xea4d('0x6'));var config=require(_0xea4d('0x7'));var controller=require(_0xea4d('0x8'));router[_0xea4d('0x9')]('/',auth[_0xea4d('0xa')](),controller[_0xea4d('0xb')]);router[_0xea4d('0x9')]('/describe',auth[_0xea4d('0xa')](),controller['describe']);router[_0xea4d('0x9')](_0xea4d('0xc'),auth[_0xea4d('0xa')](),controller[_0xea4d('0xd')]);router[_0xea4d('0xe')]('/',auth[_0xea4d('0xa')](),controller[_0xea4d('0xf')]);router[_0xea4d('0x10')](_0xea4d('0xc'),auth[_0xea4d('0xa')](),controller[_0xea4d('0x11')]);router[_0xea4d('0x12')]('/:id',auth[_0xea4d('0xa')](),controller[_0xea4d('0x13')]);module[_0xea4d('0x14')]=router; \ No newline at end of file +var _0x9783=['put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voiceDialReport.controller','/describe','isAuthenticated','describe','/:id','post','create'];(function(_0x88322c,_0x1d30c1){var _0x401ddd=function(_0x1443e1){while(--_0x1443e1){_0x88322c['push'](_0x88322c['shift']());}};_0x401ddd(++_0x1d30c1);}(_0x9783,0x146));var _0x3978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9783[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3978('0x0'));var util=require(_0x3978('0x1'));var path=require(_0x3978('0x2'));var timeout=require(_0x3978('0x3'));var express=require('express');var router=express[_0x3978('0x4')]();var fs_extra=require(_0x3978('0x5'));var auth=require(_0x3978('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3978('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3978('0x8'),auth[_0x3978('0x9')](),controller[_0x3978('0xa')]);router['get'](_0x3978('0xb'),auth[_0x3978('0x9')](),controller['show']);router[_0x3978('0xc')]('/',auth['isAuthenticated'](),controller[_0x3978('0xd')]);router[_0x3978('0xe')](_0x3978('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x3978('0xf')](_0x3978('0xb'),auth[_0x3978('0x9')](),controller['destroy']);module[_0x3978('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index e47cec5..dab1e12 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 _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x173a3b,_0x1202f3){var _0x491b7f=function(_0x4371f2){while(--_0x4371f2){_0x173a3b['push'](_0x173a3b['shift']());}};_0x491b7f(++_0x1202f3);}(_0xedd9,0xfc));var _0x9edd=function(_0x581361,_0x37a6c1){_0x581361=_0x581361-0x0;var _0x21a291=_0xedd9[_0x581361];return _0x21a291;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file +var _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x59871b,_0x3a0bd8){var _0x227d73=function(_0xd22b3f){while(--_0xd22b3f){_0x59871b['push'](_0x59871b['shift']());}};_0x227d73(++_0x3a0bd8);}(_0xedd9,0xfc));var _0x9edd=function(_0x5063e0,_0x1009d1){_0x5063e0=_0x5063e0-0x0;var _0x560921=_0xedd9[_0x5063e0];return _0x560921;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 1763b04..30ecbee 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 _0x136c=['attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','rows','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','apply','reject','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection'];(function(_0x229756,_0x33e3f4){var _0x11c53f=function(_0xb87f81){while(--_0xb87f81){_0x229756['push'](_0x229756['shift']());}};_0x11c53f(++_0x33e3f4);}(_0x136c,0xf1));var _0xc136=function(_0x3a2c37,_0x4a7bc6){_0x3a2c37=_0x3a2c37-0x0;var _0x3ed66c=_0x136c[_0x3a2c37];return _0x3ed66c;};'use strict';var emlformat=require(_0xc136('0x0'));var rimraf=require(_0xc136('0x1'));var zipdir=require(_0xc136('0x2'));var jsonpatch=require(_0xc136('0x3'));var rp=require('request-promise');var moment=require(_0xc136('0x4'));var BPromise=require(_0xc136('0x5'));var Mustache=require(_0xc136('0x6'));var util=require(_0xc136('0x7'));var path=require(_0xc136('0x8'));var sox=require(_0xc136('0x9'));var csv=require(_0xc136('0xa'));var ejs=require(_0xc136('0xb'));var fs=require('fs');var fs_extra=require(_0xc136('0xc'));var _=require(_0xc136('0xd'));var squel=require('squel');var crypto=require(_0xc136('0xe'));var jsforce=require(_0xc136('0xf'));var deskjs=require(_0xc136('0x10'));var toCsv=require(_0xc136('0xa'));var querystring=require(_0xc136('0x11'));var Papa=require(_0xc136('0x12'));var Redis=require(_0xc136('0x13'));var authService=require(_0xc136('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc136('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc136('0x16'))(_0xc136('0x17'));var utils=require(_0xc136('0x18'));var config=require(_0xc136('0x19'));var licenseUtil=require(_0xc136('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9226db,_0x3aa1a4){_0x3aa1a4=_0x3aa1a4||0xcc;return function(_0x5d08aa){if(_0x5d08aa){return _0x9226db[_0xc136('0x1b')](_0x3aa1a4);}return _0x9226db[_0xc136('0x1c')](_0x3aa1a4)['end']();};}function respondWithResult(_0x33e8e4,_0x16e88b){_0x16e88b=_0x16e88b||0xc8;return function(_0x17a3a3){if(_0x17a3a3){return _0x33e8e4[_0xc136('0x1c')](_0x16e88b)['json'](_0x17a3a3);}};}function respondWithFilteredResult(_0x3fd1fc,_0x296a15){return function(_0x592f09){if(_0x592f09){var _0x2fda07=typeof _0x296a15['offset']===_0xc136('0x1d')&&typeof _0x296a15[_0xc136('0x1e')]===_0xc136('0x1d');var _0x548608=_0x592f09['count'];var _0x1538cc=_0x2fda07?0x0:_0x296a15['offset'];var _0x42cc6=_0x2fda07?_0x592f09[_0xc136('0x1f')]:_0x296a15[_0xc136('0x20')]+_0x296a15[_0xc136('0x1e')];var _0x329acb;if(_0x42cc6>=_0x548608){_0x42cc6=_0x548608;_0x329acb=0xc8;}else{_0x329acb=0xce;}_0x3fd1fc[_0xc136('0x1c')](_0x329acb);return _0x3fd1fc['set']('Content-Range',_0x1538cc+'-'+_0x42cc6+'/'+_0x548608)['json'](_0x592f09);}return null;};}function patchUpdates(_0x547ca1){return function(_0x226177){try{jsonpatch[_0xc136('0x21')](_0x226177,_0x547ca1,!![]);}catch(_0x3feef2){return BPromise[_0xc136('0x22')](_0x3feef2);}return _0x226177['save']();};}function saveUpdates(_0x47e61c,_0x2da3b6){return function(_0x2edd98){if(_0x2edd98){return _0x2edd98[_0xc136('0x23')](_0x47e61c)[_0xc136('0x24')](function(_0x57060c){return _0x57060c;});}return null;};}function removeEntity(_0x165617,_0x3fc526){return function(_0x27da0c){if(_0x27da0c){return _0x27da0c[_0xc136('0x25')]()[_0xc136('0x24')](function(){_0x165617['status'](0xcc)[_0xc136('0x26')]();});}};}function handleEntityNotFound(_0x49416a,_0x1ab7b4){return function(_0x19f663){if(!_0x19f663){_0x49416a['sendStatus'](0x194);}return _0x19f663;};}function handleError(_0x9282b1,_0x3111bd){_0x3111bd=_0x3111bd||0x1f4;return function(_0x1e6580){logger[_0xc136('0x27')](_0x1e6580['stack']);if(_0x1e6580[_0xc136('0x28')]){delete _0x1e6580[_0xc136('0x28')];}_0x9282b1[_0xc136('0x1c')](_0x3111bd)[_0xc136('0x29')](_0x1e6580);};}exports['index']=function(_0x40444a,_0x51b058){var _0x22a4fc={},_0x4e697f={},_0x5dd730={'count':0x0,'rows':[]};var _0x3bb38f=_[_0xc136('0x2a')](db['VoiceDialReport'][_0xc136('0x2b')],function(_0x236584){return{'name':_0x236584[_0xc136('0x2c')],'type':_0x236584['type'][_0xc136('0x2d')]};});_0x4e697f[_0xc136('0x2e')]=_[_0xc136('0x2a')](_0x3bb38f,_0xc136('0x28'));_0x4e697f[_0xc136('0x2f')]=_[_0xc136('0x30')](_0x40444a[_0xc136('0x2f')]);_0x4e697f[_0xc136('0x31')]=_[_0xc136('0x32')](_0x4e697f[_0xc136('0x2e')],_0x4e697f[_0xc136('0x2f')]);_0x22a4fc[_0xc136('0x33')]=_['intersection'](_0x4e697f[_0xc136('0x2e')],qs[_0xc136('0x34')](_0x40444a[_0xc136('0x2f')]['fields']));_0x22a4fc[_0xc136('0x33')]=_0x22a4fc['attributes'][_0xc136('0x35')]?_0x22a4fc[_0xc136('0x33')]:_0x4e697f[_0xc136('0x2e')];if(!_0x40444a[_0xc136('0x2f')][_0xc136('0x36')]('nolimit')){_0x22a4fc['limit']=qs[_0xc136('0x1e')](_0x40444a['query']['limit']);_0x22a4fc[_0xc136('0x20')]=qs[_0xc136('0x20')](_0x40444a[_0xc136('0x2f')][_0xc136('0x20')]);}_0x22a4fc['order']=qs[_0xc136('0x37')](_0x40444a[_0xc136('0x2f')][_0xc136('0x37')]);_0x22a4fc[_0xc136('0x38')]=qs['filters'](_[_0xc136('0x39')](_0x40444a[_0xc136('0x2f')],_0x4e697f[_0xc136('0x31')]),_0x3bb38f);if(_0x40444a['query'][_0xc136('0x3a')]){_0x22a4fc['where']=_[_0xc136('0x3b')](_0x22a4fc[_0xc136('0x38')],{'$or':_[_0xc136('0x2a')](_0x3bb38f,function(_0x3b7114){if(_0x3b7114['type']!==_0xc136('0x3c')){var _0x882a78={};_0x882a78[_0x3b7114[_0xc136('0x28')]]={'$like':'%'+_0x40444a[_0xc136('0x2f')][_0xc136('0x3a')]+'%'};return _0x882a78;}})});}_0x22a4fc=_['merge']({},_0x22a4fc,_0x40444a[_0xc136('0x3d')]);var _0x1fe2b2={'where':_0x22a4fc['where']};return db[_0xc136('0x3e')][_0xc136('0x1f')](_0x1fe2b2)[_0xc136('0x24')](function(_0x12da60){_0x5dd730[_0xc136('0x1f')]=_0x12da60;if(_0x40444a[_0xc136('0x2f')][_0xc136('0x3f')]){_0x22a4fc[_0xc136('0x40')]=[{'all':!![]}];}return db[_0xc136('0x3e')][_0xc136('0x41')](_0x22a4fc);})[_0xc136('0x24')](function(_0x1972f4){_0x5dd730[_0xc136('0x42')]=_0x1972f4;return _0x5dd730;})[_0xc136('0x24')](respondWithFilteredResult(_0x51b058,_0x22a4fc))['catch'](handleError(_0x51b058,null));};exports['show']=function(_0x34b2a1,_0x20ff66){var _0x3997f9={'raw':!![],'where':{'id':_0x34b2a1['params']['id']}},_0x4f3be5={};_0x4f3be5[_0xc136('0x2e')]=_[_0xc136('0x30')](db[_0xc136('0x3e')][_0xc136('0x2b')]);_0x4f3be5[_0xc136('0x2f')]=_[_0xc136('0x30')](_0x34b2a1[_0xc136('0x2f')]);_0x4f3be5[_0xc136('0x31')]=_[_0xc136('0x32')](_0x4f3be5[_0xc136('0x2e')],_0x4f3be5[_0xc136('0x2f')]);_0x3997f9['attributes']=_[_0xc136('0x32')](_0x4f3be5[_0xc136('0x2e')],qs[_0xc136('0x34')](_0x34b2a1[_0xc136('0x2f')][_0xc136('0x34')]));_0x3997f9[_0xc136('0x33')]=_0x3997f9[_0xc136('0x33')][_0xc136('0x35')]?_0x3997f9[_0xc136('0x33')]:_0x4f3be5[_0xc136('0x2e')];if(_0x34b2a1[_0xc136('0x2f')][_0xc136('0x3f')]){_0x3997f9[_0xc136('0x40')]=[{'all':!![]}];}_0x3997f9=_[_0xc136('0x3b')]({},_0x3997f9,_0x34b2a1[_0xc136('0x3d')]);return db[_0xc136('0x3e')][_0xc136('0x43')](_0x3997f9)[_0xc136('0x24')](handleEntityNotFound(_0x20ff66,null))['then'](respondWithResult(_0x20ff66,null))[_0xc136('0x44')](handleError(_0x20ff66,null));};exports[_0xc136('0x45')]=function(_0x362b10,_0x4ea54e){return db[_0xc136('0x3e')][_0xc136('0x45')](_0x362b10['body'],{})[_0xc136('0x24')](respondWithResult(_0x4ea54e,0xc9))[_0xc136('0x44')](handleError(_0x4ea54e,null));};exports[_0xc136('0x23')]=function(_0x3c34d8,_0x200ba0){if(_0x3c34d8[_0xc136('0x46')]['id']){delete _0x3c34d8[_0xc136('0x46')]['id'];}return db[_0xc136('0x3e')][_0xc136('0x43')]({'where':{'id':_0x3c34d8[_0xc136('0x47')]['id']}})[_0xc136('0x24')](handleEntityNotFound(_0x200ba0,null))['then'](saveUpdates(_0x3c34d8[_0xc136('0x46')],null))[_0xc136('0x24')](respondWithResult(_0x200ba0,null))['catch'](handleError(_0x200ba0,null));};exports[_0xc136('0x25')]=function(_0x455289,_0x5e3bef){return db[_0xc136('0x3e')][_0xc136('0x43')]({'where':{'id':_0x455289['params']['id']}})[_0xc136('0x24')](handleEntityNotFound(_0x5e3bef,null))['then'](removeEntity(_0x5e3bef,null))['catch'](handleError(_0x5e3bef,null));};exports[_0xc136('0x48')]=function(_0xe6e3ac,_0x382e68){return db[_0xc136('0x3e')][_0xc136('0x48')]()[_0xc136('0x24')](respondWithResult(_0x382e68,null))[_0xc136('0x44')](handleError(_0x382e68,null));}; \ No newline at end of file +var _0x4c1f=['path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','index','VoiceDialReport','fieldName','type','key','model','map','query','filters','fields','attributes','length','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','keys','rawAttributes','intersection','include','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x4c1f,0x166));var _0xf4c1=function(_0x4a2d11,_0x19643d){_0x4a2d11=_0x4a2d11-0x0;var _0x4d77f0=_0x4c1f[_0x4a2d11];return _0x4d77f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4c1('0x0'));var zipdir=require(_0xf4c1('0x1'));var jsonpatch=require(_0xf4c1('0x2'));var rp=require(_0xf4c1('0x3'));var moment=require(_0xf4c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4c1('0x5'));var util=require(_0xf4c1('0x6'));var path=require(_0xf4c1('0x7'));var sox=require(_0xf4c1('0x8'));var csv=require(_0xf4c1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4c1('0xa'));var squel=require(_0xf4c1('0xb'));var crypto=require('crypto');var jsforce=require(_0xf4c1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf4c1('0x9'));var querystring=require(_0xf4c1('0xd'));var Papa=require(_0xf4c1('0xe'));var Redis=require('ioredis');var authService=require(_0xf4c1('0xf'));var qs=require(_0xf4c1('0x10'));var as=require(_0xf4c1('0x11'));var hardwareService=require(_0xf4c1('0x12'));var logger=require(_0xf4c1('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf4c1('0x14'));var licenseUtil=require(_0xf4c1('0x15'));var db=require(_0xf4c1('0x16'))['db'];function respondWithStatusCode(_0x544baf,_0x4271bc){_0x4271bc=_0x4271bc||0xcc;return function(_0x295bdd){if(_0x295bdd){return _0x544baf['sendStatus'](_0x4271bc);}return _0x544baf[_0xf4c1('0x17')](_0x4271bc)['end']();};}function respondWithResult(_0x2509d3,_0x255307){_0x255307=_0x255307||0xc8;return function(_0x34e6ae){if(_0x34e6ae){return _0x2509d3[_0xf4c1('0x17')](_0x255307)['json'](_0x34e6ae);}};}function respondWithFilteredResult(_0x3c46c4,_0x1b19d0){return function(_0x57dd54){if(_0x57dd54){var _0x5672c6=typeof _0x1b19d0['offset']===_0xf4c1('0x18')&&typeof _0x1b19d0['limit']===_0xf4c1('0x18');var _0x54ac2b=_0x57dd54['count'];var _0x2684ba=_0x5672c6?0x0:_0x1b19d0[_0xf4c1('0x19')];var _0x5f0a2a=_0x5672c6?_0x57dd54[_0xf4c1('0x1a')]:_0x1b19d0[_0xf4c1('0x19')]+_0x1b19d0[_0xf4c1('0x1b')];var _0x5a984e;if(_0x5f0a2a>=_0x54ac2b){_0x5f0a2a=_0x54ac2b;_0x5a984e=0xc8;}else{_0x5a984e=0xce;}_0x3c46c4['status'](_0x5a984e);return _0x3c46c4[_0xf4c1('0x1c')](_0xf4c1('0x1d'),_0x2684ba+'-'+_0x5f0a2a+'/'+_0x54ac2b)[_0xf4c1('0x1e')](_0x57dd54);}return null;};}function patchUpdates(_0xd7d66){return function(_0x1f57c2){try{jsonpatch[_0xf4c1('0x1f')](_0x1f57c2,_0xd7d66,!![]);}catch(_0x4c5776){return BPromise[_0xf4c1('0x20')](_0x4c5776);}return _0x1f57c2[_0xf4c1('0x21')]();};}function saveUpdates(_0x315c00,_0x1f33e6){return function(_0x3535d6){if(_0x3535d6){return _0x3535d6['update'](_0x315c00)[_0xf4c1('0x22')](function(_0x12ba13){return _0x12ba13;});}return null;};}function removeEntity(_0x1c444d,_0x1fb259){return function(_0x5013c8){if(_0x5013c8){return _0x5013c8[_0xf4c1('0x23')]()['then'](function(){_0x1c444d[_0xf4c1('0x17')](0xcc)[_0xf4c1('0x24')]();});}};}function handleEntityNotFound(_0x566a2e,_0x430216){return function(_0x9d2b4a){if(!_0x9d2b4a){_0x566a2e[_0xf4c1('0x25')](0x194);}return _0x9d2b4a;};}function handleError(_0x3b7e1e,_0xfdb0d5){_0xfdb0d5=_0xfdb0d5||0x1f4;return function(_0x423a91){logger['error'](_0x423a91[_0xf4c1('0x26')]);if(_0x423a91['name']){delete _0x423a91[_0xf4c1('0x27')];}_0x3b7e1e[_0xf4c1('0x17')](_0xfdb0d5)[_0xf4c1('0x28')](_0x423a91);};}exports[_0xf4c1('0x29')]=function(_0x36a6e8,_0x198e8e){var _0x3cf09b={},_0x4d7b90={},_0xbc1939={'count':0x0,'rows':[]};var _0x1564d6=_['map'](db[_0xf4c1('0x2a')]['rawAttributes'],function(_0x1bacd3){return{'name':_0x1bacd3[_0xf4c1('0x2b')],'type':_0x1bacd3[_0xf4c1('0x2c')][_0xf4c1('0x2d')]};});_0x4d7b90[_0xf4c1('0x2e')]=_[_0xf4c1('0x2f')](_0x1564d6,'name');_0x4d7b90['query']=_['keys'](_0x36a6e8[_0xf4c1('0x30')]);_0x4d7b90[_0xf4c1('0x31')]=_['intersection'](_0x4d7b90[_0xf4c1('0x2e')],_0x4d7b90['query']);_0x3cf09b['attributes']=_['intersection'](_0x4d7b90[_0xf4c1('0x2e')],qs['fields'](_0x36a6e8['query'][_0xf4c1('0x32')]));_0x3cf09b[_0xf4c1('0x33')]=_0x3cf09b[_0xf4c1('0x33')][_0xf4c1('0x34')]?_0x3cf09b[_0xf4c1('0x33')]:_0x4d7b90[_0xf4c1('0x2e')];if(!_0x36a6e8['query']['hasOwnProperty'](_0xf4c1('0x35'))){_0x3cf09b['limit']=qs[_0xf4c1('0x1b')](_0x36a6e8[_0xf4c1('0x30')][_0xf4c1('0x1b')]);_0x3cf09b[_0xf4c1('0x19')]=qs[_0xf4c1('0x19')](_0x36a6e8['query']['offset']);}_0x3cf09b['order']=qs[_0xf4c1('0x36')](_0x36a6e8[_0xf4c1('0x30')][_0xf4c1('0x36')]);_0x3cf09b[_0xf4c1('0x37')]=qs[_0xf4c1('0x31')](_[_0xf4c1('0x38')](_0x36a6e8['query'],_0x4d7b90[_0xf4c1('0x31')]),_0x1564d6);if(_0x36a6e8[_0xf4c1('0x30')][_0xf4c1('0x39')]){_0x3cf09b[_0xf4c1('0x37')]=_[_0xf4c1('0x3a')](_0x3cf09b[_0xf4c1('0x37')],{'$or':_[_0xf4c1('0x2f')](_0x1564d6,function(_0x11bc1a){if(_0x11bc1a['type']!=='VIRTUAL'){var _0x6196c7={};_0x6196c7[_0x11bc1a['name']]={'$like':'%'+_0x36a6e8[_0xf4c1('0x30')][_0xf4c1('0x39')]+'%'};return _0x6196c7;}})});}_0x3cf09b=_[_0xf4c1('0x3a')]({},_0x3cf09b,_0x36a6e8['options']);var _0x334dc4={'where':_0x3cf09b[_0xf4c1('0x37')]};return db[_0xf4c1('0x2a')][_0xf4c1('0x1a')](_0x334dc4)[_0xf4c1('0x22')](function(_0x263a56){_0xbc1939[_0xf4c1('0x1a')]=_0x263a56;if(_0x36a6e8[_0xf4c1('0x30')][_0xf4c1('0x3b')]){_0x3cf09b['include']=[{'all':!![]}];}return db[_0xf4c1('0x2a')][_0xf4c1('0x3c')](_0x3cf09b);})[_0xf4c1('0x22')](function(_0x2166ef){_0xbc1939[_0xf4c1('0x3d')]=_0x2166ef;return _0xbc1939;})[_0xf4c1('0x22')](respondWithFilteredResult(_0x198e8e,_0x3cf09b))[_0xf4c1('0x3e')](handleError(_0x198e8e,null));};exports[_0xf4c1('0x3f')]=function(_0x1769ba,_0x36f5e5){var _0x1e40e7={'raw':!![],'where':{'id':_0x1769ba['params']['id']}},_0x552071={};_0x552071['model']=_[_0xf4c1('0x40')](db['VoiceDialReport'][_0xf4c1('0x41')]);_0x552071[_0xf4c1('0x30')]=_['keys'](_0x1769ba[_0xf4c1('0x30')]);_0x552071[_0xf4c1('0x31')]=_[_0xf4c1('0x42')](_0x552071[_0xf4c1('0x2e')],_0x552071['query']);_0x1e40e7[_0xf4c1('0x33')]=_[_0xf4c1('0x42')](_0x552071['model'],qs['fields'](_0x1769ba['query']['fields']));_0x1e40e7[_0xf4c1('0x33')]=_0x1e40e7['attributes']['length']?_0x1e40e7[_0xf4c1('0x33')]:_0x552071[_0xf4c1('0x2e')];if(_0x1769ba[_0xf4c1('0x30')][_0xf4c1('0x3b')]){_0x1e40e7[_0xf4c1('0x43')]=[{'all':!![]}];}_0x1e40e7=_[_0xf4c1('0x3a')]({},_0x1e40e7,_0x1769ba[_0xf4c1('0x44')]);return db['VoiceDialReport'][_0xf4c1('0x45')](_0x1e40e7)[_0xf4c1('0x22')](handleEntityNotFound(_0x36f5e5,null))[_0xf4c1('0x22')](respondWithResult(_0x36f5e5,null))['catch'](handleError(_0x36f5e5,null));};exports[_0xf4c1('0x46')]=function(_0x203ce0,_0x21c3f8){return db[_0xf4c1('0x2a')][_0xf4c1('0x46')](_0x203ce0[_0xf4c1('0x47')],{})[_0xf4c1('0x22')](respondWithResult(_0x21c3f8,0xc9))[_0xf4c1('0x3e')](handleError(_0x21c3f8,null));};exports['update']=function(_0x15a970,_0x56328f){if(_0x15a970[_0xf4c1('0x47')]['id']){delete _0x15a970[_0xf4c1('0x47')]['id'];}return db['VoiceDialReport'][_0xf4c1('0x45')]({'where':{'id':_0x15a970[_0xf4c1('0x48')]['id']}})[_0xf4c1('0x22')](handleEntityNotFound(_0x56328f,null))[_0xf4c1('0x22')](saveUpdates(_0x15a970['body'],null))[_0xf4c1('0x22')](respondWithResult(_0x56328f,null))[_0xf4c1('0x3e')](handleError(_0x56328f,null));};exports[_0xf4c1('0x23')]=function(_0x3d0941,_0x741e59){return db[_0xf4c1('0x2a')]['find']({'where':{'id':_0x3d0941[_0xf4c1('0x48')]['id']}})[_0xf4c1('0x22')](handleEntityNotFound(_0x741e59,null))[_0xf4c1('0x22')](removeEntity(_0x741e59,null))[_0xf4c1('0x3e')](handleError(_0x741e59,null));};exports['describe']=function(_0x57f6d8,_0x180f74){return db[_0xf4c1('0x2a')]['describe']()['then'](respondWithResult(_0x180f74,null))[_0xf4c1('0x3e')](handleError(_0x180f74,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 23d6ea6..fdb3c9a 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 _0xdc03=['define','report_dial','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x2aa992,_0x8558f5){var _0x56e549=function(_0x312d50){while(--_0x312d50){_0x2aa992['push'](_0x2aa992['shift']());}};_0x56e549(++_0x8558f5);}(_0xdc03,0x65));var _0x3dc0=function(_0x279c57,_0x4a77a2){_0x279c57=_0x279c57-0x0;var _0x22b263=_0xdc03[_0x279c57];return _0x22b263;};'use strict';var _=require(_0x3dc0('0x0'));var util=require('util');var logger=require(_0x3dc0('0x1'))(_0x3dc0('0x2'));var moment=require('moment');var BPromise=require(_0x3dc0('0x3'));var rp=require(_0x3dc0('0x4'));var fs=require('fs');var path=require(_0x3dc0('0x5'));var rimraf=require(_0x3dc0('0x6'));var config=require(_0x3dc0('0x7'));var attributes=require(_0x3dc0('0x8'));module['exports']=function(_0x3c5407,_0x20c408){return _0x3c5407[_0x3dc0('0x9')]('VoiceDialReport',attributes,{'tableName':_0x3dc0('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2f1=['moment','bluebird','request-promise','rimraf','../../config/environment','VoiceDialReport','uniqueid','lodash','util','api'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xf2f1,0xed));var _0x1f2f=function(_0x457585,_0x47e33a){_0x457585=_0x457585-0x0;var _0x1f96e1=_0xf2f1[_0x457585];return _0x1f96e1;};'use strict';var _=require(_0x1f2f('0x0'));var util=require(_0x1f2f('0x1'));var logger=require('../../config/logger')(_0x1f2f('0x2'));var moment=require(_0x1f2f('0x3'));var BPromise=require(_0x1f2f('0x4'));var rp=require(_0x1f2f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f2f('0x6'));var config=require(_0x1f2f('0x7'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x36117a,_0x2ec747){return _0x36117a['define'](_0x1f2f('0x8'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x1f2f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 1cc755e..56a7e34 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 _0x3bd6=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','info','UpdateVoiceDialReport','update','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x273219,_0x531528){var _0x233a8e=function(_0x3d779f){while(--_0x3d779f){_0x273219['push'](_0x273219['shift']());}};_0x233a8e(++_0x531528);}(_0x3bd6,0x192));var _0x63bd=function(_0x4a8c74,_0x41dc25){_0x4a8c74=_0x4a8c74-0x0;var _0x459b7f=_0x3bd6[_0x4a8c74];return _0x459b7f;};'use strict';var _=require(_0x63bd('0x0'));var util=require(_0x63bd('0x1'));var moment=require(_0x63bd('0x2'));var BPromise=require('bluebird');var rs=require(_0x63bd('0x3'));var fs=require('fs');var Redis=require(_0x63bd('0x4'));var db=require(_0x63bd('0x5'))['db'];var utils=require(_0x63bd('0x6'));var logger=require(_0x63bd('0x7'))('rpc');var config=require(_0x63bd('0x8'));var jayson=require(_0x63bd('0x9'));var client=jayson[_0x63bd('0xa')][_0x63bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16d181,_0x2c4746,_0x29b595){return new BPromise(function(_0x1c4c2e,_0x46c4cc){return client[_0x63bd('0xc')](_0x16d181,_0x29b595)[_0x63bd('0xd')](function(_0x544ec1){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x2c4746,'request\x20sent');logger[_0x63bd('0xe')](_0x63bd('0xf'),_0x2c4746,_0x63bd('0x10'),JSON[_0x63bd('0x11')](_0x544ec1));if(_0x544ec1[_0x63bd('0x12')]){if(_0x544ec1['error'][_0x63bd('0x13')]===0x1f4){logger[_0x63bd('0x12')](_0x63bd('0x14'),_0x2c4746,_0x544ec1['error'][_0x63bd('0x15')]);return _0x46c4cc(_0x544ec1[_0x63bd('0x12')][_0x63bd('0x15')]);}logger[_0x63bd('0x12')](_0x63bd('0x14'),_0x2c4746,_0x544ec1[_0x63bd('0x12')][_0x63bd('0x15')]);return _0x1c4c2e(_0x544ec1[_0x63bd('0x12')]['message']);}else{logger['info'](_0x63bd('0x14'),_0x2c4746,_0x63bd('0x10'));_0x1c4c2e(_0x544ec1[_0x63bd('0x16')][_0x63bd('0x15')]);}})[_0x63bd('0x17')](function(_0x3310c6){logger[_0x63bd('0x12')](_0x63bd('0x14'),_0x2c4746,_0x3310c6);_0x46c4cc(_0x3310c6);});});}exports[_0x63bd('0x18')]=function(_0x1270ea){var _0x498553=this;return new Promise(function(_0x368252,_0x480090){return db[_0x63bd('0x19')][_0x63bd('0x1a')](_0x1270ea[_0x63bd('0x1b')],{'raw':_0x1270ea[_0x63bd('0x1c')]?_0x1270ea[_0x63bd('0x1c')][_0x63bd('0x1d')]===undefined?!![]:![]:!![]})[_0x63bd('0xd')](function(_0x16cf2d){logger[_0x63bd('0x1e')](_0x63bd('0x18'),_0x1270ea);logger[_0x63bd('0xe')]('CreateVoiceDialReport',_0x1270ea,JSON['stringify'](_0x16cf2d));_0x368252(_0x16cf2d);})[_0x63bd('0x17')](function(_0x54327b){logger[_0x63bd('0x12')](_0x63bd('0x18'),_0x54327b[_0x63bd('0x15')],_0x1270ea);_0x480090(_0x498553[_0x63bd('0x12')](0x1f4,_0x54327b[_0x63bd('0x15')]));});});};exports[_0x63bd('0x1f')]=function(_0xd57f47){var _0x2605bc=this;return new Promise(function(_0x304629,_0x39e822){return db[_0x63bd('0x19')][_0x63bd('0x20')](_0xd57f47['body'],{'raw':_0xd57f47['options']?_0xd57f47[_0x63bd('0x1c')][_0x63bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd57f47[_0x63bd('0x1c')]?_0xd57f47['options']['where']||null:null,'attributes':_0xd57f47['options']?_0xd57f47[_0x63bd('0x1c')][_0x63bd('0x21')]||null:null,'limit':_0xd57f47['options']?_0xd57f47['options']['limit']||null:null})['then'](function(_0x2aa96c){logger['info'](_0x63bd('0x1f'),_0xd57f47);logger[_0x63bd('0xe')](_0x63bd('0x1f'),_0xd57f47,JSON[_0x63bd('0x11')](_0x2aa96c));_0x304629(_0x2aa96c);})[_0x63bd('0x17')](function(_0x4dfa1c){logger[_0x63bd('0x12')]('UpdateVoiceDialReport',_0x4dfa1c[_0x63bd('0x15')],_0xd57f47);_0x39e822(_0x2605bc['error'](0x1f4,_0x4dfa1c[_0x63bd('0x15')]));});});}; \ No newline at end of file +var _0xe7a8=['raw','CreateVoiceDialReport','catch','UpdateVoiceDialReport','VoiceDialReport','attributes','limit','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','create','body','options'];(function(_0x512d04,_0x4a9118){var _0x45abd6=function(_0x5cf0bd){while(--_0x5cf0bd){_0x512d04['push'](_0x512d04['shift']());}};_0x45abd6(++_0x4a9118);}(_0xe7a8,0x98));var _0x8e7a=function(_0x3fbeef,_0x2840b4){_0x3fbeef=_0x3fbeef-0x0;var _0x14ec1f=_0xe7a8[_0x3fbeef];return _0x14ec1f;};'use strict';var _=require('lodash');var util=require(_0x8e7a('0x0'));var moment=require('moment');var BPromise=require(_0x8e7a('0x1'));var rs=require(_0x8e7a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e7a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e7a('0x4'))(_0x8e7a('0x5'));var config=require(_0x8e7a('0x6'));var jayson=require(_0x8e7a('0x7'));var client=jayson['client'][_0x8e7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ffd27,_0x4fc04e,_0x38df07){return new BPromise(function(_0x4e7d5c,_0x5cb65b){return client['request'](_0x4ffd27,_0x38df07)[_0x8e7a('0x9')](function(_0xd99a2b){logger[_0x8e7a('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x4fc04e,'request\x20sent');logger[_0x8e7a('0xb')](_0x8e7a('0xc'),_0x4fc04e,_0x8e7a('0xd'),JSON[_0x8e7a('0xe')](_0xd99a2b));if(_0xd99a2b[_0x8e7a('0xf')]){if(_0xd99a2b[_0x8e7a('0xf')][_0x8e7a('0x10')]===0x1f4){logger[_0x8e7a('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x4fc04e,_0xd99a2b[_0x8e7a('0xf')][_0x8e7a('0x11')]);return _0x5cb65b(_0xd99a2b[_0x8e7a('0xf')][_0x8e7a('0x11')]);}logger[_0x8e7a('0xf')](_0x8e7a('0x12'),_0x4fc04e,_0xd99a2b[_0x8e7a('0xf')][_0x8e7a('0x11')]);return _0x4e7d5c(_0xd99a2b[_0x8e7a('0xf')]['message']);}else{logger[_0x8e7a('0xa')](_0x8e7a('0x12'),_0x4fc04e,'request\x20sent');_0x4e7d5c(_0xd99a2b['result'][_0x8e7a('0x11')]);}})['catch'](function(_0x3bd3f6){logger[_0x8e7a('0xf')](_0x8e7a('0x12'),_0x4fc04e,_0x3bd3f6);_0x5cb65b(_0x3bd3f6);});});}exports['CreateVoiceDialReport']=function(_0x10014b){var _0x5a4d9f=this;return new Promise(function(_0x148d9e,_0x35f11d){return db['VoiceDialReport'][_0x8e7a('0x13')](_0x10014b[_0x8e7a('0x14')],{'raw':_0x10014b['options']?_0x10014b[_0x8e7a('0x15')][_0x8e7a('0x16')]===undefined?!![]:![]:!![]})[_0x8e7a('0x9')](function(_0x4a7455){logger[_0x8e7a('0xa')](_0x8e7a('0x17'),_0x10014b);logger[_0x8e7a('0xb')](_0x8e7a('0x17'),_0x10014b,JSON[_0x8e7a('0xe')](_0x4a7455));_0x148d9e(_0x4a7455);})[_0x8e7a('0x18')](function(_0x5d992e){logger[_0x8e7a('0xf')]('CreateVoiceDialReport',_0x5d992e[_0x8e7a('0x11')],_0x10014b);_0x35f11d(_0x5a4d9f[_0x8e7a('0xf')](0x1f4,_0x5d992e[_0x8e7a('0x11')]));});});};exports[_0x8e7a('0x19')]=function(_0x451a44){var _0x57dd69=this;return new Promise(function(_0x980ba6,_0x38772d){return db[_0x8e7a('0x1a')]['update'](_0x451a44[_0x8e7a('0x14')],{'raw':_0x451a44['options']?_0x451a44['options'][_0x8e7a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x451a44[_0x8e7a('0x15')]?_0x451a44[_0x8e7a('0x15')]['where']||null:null,'attributes':_0x451a44[_0x8e7a('0x15')]?_0x451a44[_0x8e7a('0x15')][_0x8e7a('0x1b')]||null:null,'limit':_0x451a44[_0x8e7a('0x15')]?_0x451a44[_0x8e7a('0x15')][_0x8e7a('0x1c')]||null:null})[_0x8e7a('0x9')](function(_0x34232b){logger['info'](_0x8e7a('0x19'),_0x451a44);logger[_0x8e7a('0xb')](_0x8e7a('0x19'),_0x451a44,JSON[_0x8e7a('0xe')](_0x34232b));_0x980ba6(_0x34232b);})[_0x8e7a('0x18')](function(_0x2a1ecd){logger[_0x8e7a('0xf')](_0x8e7a('0x19'),_0x2a1ecd[_0x8e7a('0x11')],_0x451a44);_0x38772d(_0x57dd69[_0x8e7a('0xf')](0x1f4,_0x2a1ecd['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 147a839..5e21c1f 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 _0xa743=['update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','post','/:id/applications','put'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0xa743,0x1e9));var _0x3a74=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0xa743[_0x50f0a9];return _0x5a33d9;};'use strict';var multer=require(_0x3a74('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3a74('0x1'));var express=require(_0x3a74('0x2'));var router=express[_0x3a74('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3a74('0x4'));var interaction=require(_0x3a74('0x5'));var config=require('../../config/environment');var controller=require(_0x3a74('0x6'));router['get']('/',auth[_0x3a74('0x7')](),controller[_0x3a74('0x8')]);router[_0x3a74('0x9')](_0x3a74('0xa'),auth[_0x3a74('0x7')](),controller[_0x3a74('0xb')]);router['post']('/',auth[_0x3a74('0x7')](),controller['create']);router[_0x3a74('0xc')](_0x3a74('0xd'),auth['isAuthenticated'](),controller['addApplications']);router[_0x3a74('0xe')]('/:id',auth[_0x3a74('0x7')](),controller[_0x3a74('0xf')]);router[_0x3a74('0x10')]('/:id',auth[_0x3a74('0x7')](),controller['destroy']);module[_0x3a74('0x11')]=router; \ No newline at end of file +var _0xe301=['destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','get','show','post','create','/:id/applications','addApplications','/:id','update','delete'];(function(_0x10303a,_0x4b369a){var _0x4d34bf=function(_0x506df5){while(--_0x506df5){_0x10303a['push'](_0x10303a['shift']());}};_0x4d34bf(++_0x4b369a);}(_0xe301,0x1ba));var _0x1e30=function(_0x31ff4c,_0x40af88){_0x31ff4c=_0x31ff4c-0x0;var _0x38d95a=_0xe301[_0x31ff4c];return _0x38d95a;};'use strict';var multer=require('multer');var util=require(_0x1e30('0x0'));var path=require(_0x1e30('0x1'));var timeout=require('connect-timeout');var express=require(_0x1e30('0x2'));var router=express['Router']();var fs_extra=require(_0x1e30('0x3'));var auth=require(_0x1e30('0x4'));var interaction=require(_0x1e30('0x5'));var config=require(_0x1e30('0x6'));var controller=require(_0x1e30('0x7'));router['get']('/',auth[_0x1e30('0x8')](),controller['index']);router[_0x1e30('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1e30('0xa')]);router[_0x1e30('0xb')]('/',auth[_0x1e30('0x8')](),controller[_0x1e30('0xc')]);router[_0x1e30('0xb')](_0x1e30('0xd'),auth[_0x1e30('0x8')](),controller[_0x1e30('0xe')]);router['put'](_0x1e30('0xf'),auth['isAuthenticated'](),controller[_0x1e30('0x10')]);router[_0x1e30('0x11')](_0x1e30('0xf'),auth[_0x1e30('0x8')](),controller[_0x1e30('0x12')]);module[_0x1e30('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 0909bbc..7a5c74d 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 _0x2ddb=['compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','STRING'];(function(_0x4acd2b,_0x2f01a9){var _0x5caf90=function(_0x15b8c1){while(--_0x15b8c1){_0x4acd2b['push'](_0x4acd2b['shift']());}};_0x5caf90(++_0x2f01a9);}(_0x2ddb,0x1c9));var _0xb2dd=function(_0x2e0721,_0x10ee64){_0x2e0721=_0x2e0721-0x0;var _0x401ce1=_0x2ddb[_0x2e0721];return _0x401ce1;};'use strict';var Sequelize=require(_0xb2dd('0x0'));module['exports']={'context':{'type':Sequelize[_0xb2dd('0x1')],'allowNull':![],'unique':_0xb2dd('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xb2dd('0x1')],'allowNull':![],'unique':_0xb2dd('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xb2dd('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb2dd('0x3')},'appdata':{'type':Sequelize[_0xb2dd('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb2dd('0x4')](_0xb2dd('0x5'),_0xb2dd('0x6'),_0xb2dd('0x7'),_0xb2dd('0x8'),_0xb2dd('0x9'),_0xb2dd('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xb2dd('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb2dd('0xb')},'IntervalId':{'type':Sequelize[_0xb2dd('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb2dd('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xb2dd('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xb2dd('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xb2dd('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xb2dd('0xe')},'answer':{'type':Sequelize[_0xb2dd('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xb2dd('0xf')],'get':function(_0x5cac9b){return this['getDataValue'](_0xb2dd('0x10'));}},'alias':{'type':Sequelize[_0xb2dd('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x2068=['compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','system','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','sequelize','STRING'];(function(_0x3b199a,_0x37a6a3){var _0x3716bb=function(_0x304f4c){while(--_0x304f4c){_0x3b199a['push'](_0x3b199a['shift']());}};_0x3716bb(++_0x37a6a3);}(_0x2068,0x1de));var _0x8206=function(_0x2e65dc,_0x79dc84){_0x2e65dc=_0x2e65dc-0x0;var _0x24db4f=_0x2068[_0x2e65dc];return _0x24db4f;};'use strict';var Sequelize=require(_0x8206('0x0'));module['exports']={'context':{'type':Sequelize[_0x8206('0x1')],'allowNull':![],'unique':_0x8206('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x8206('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x8206('0x2')},'tag':{'type':Sequelize[_0x8206('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x8206('0x1')],'allowNull':![],'defaultValue':_0x8206('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x8206('0x4')](_0x8206('0x5'),_0x8206('0x6'),'internal',_0x8206('0x7'),'outbound-fax',_0x8206('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x8206('0x1')]},'interval':{'type':Sequelize[_0x8206('0x1')],'allowNull':![],'defaultValue':_0x8206('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x8206('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x8206('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x8206('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x8206('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x8206('0xb')]},'recordingFormat':{'type':Sequelize[_0x8206('0x1')],'defaultValue':_0x8206('0xc')},'answer':{'type':Sequelize[_0x8206('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x8206('0xd')],'get':function(_0xd17b5b){return this[_0x8206('0xe')]('exten');}},'alias':{'type':Sequelize[_0x8206('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 71df242..6febb14 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 _0x3c52=['description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','value','includes','type','name','UserProfileResource','stack','send','index','map','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','VoiceExtension','includeAll','include','findAll','catch','show','params','find','create','startsWith','exten','body','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','UserProfileSection','userProfileId','error','update','context'];(function(_0x118e84,_0x2cd37f){var _0x109798=function(_0xfcf0b6){while(--_0xfcf0b6){_0x118e84['push'](_0x118e84['shift']());}};_0x109798(++_0x2cd37f);}(_0x3c52,0x184));var _0x23c5=function(_0x4936ba,_0x56845c){_0x4936ba=_0x4936ba-0x0;var _0x3d4c39=_0x3c52[_0x4936ba];return _0x3d4c39;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x23c5('0x0'));var logger=require('../../config/logger')(_0x23c5('0x1'));var config=require(_0x23c5('0x2'));var db=require(_0x23c5('0x3'))['db'];config[_0x23c5('0x4')]=_[_0x23c5('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x23c5('0x6'))(new Redis(config['redis']));require(_0x23c5('0x7'))[_0x23c5('0x8')](socket);function respondWithStatusCode(_0x160d6b,_0x6d92c4){_0x6d92c4=_0x6d92c4||0xcc;return function(_0x271605){if(_0x271605){return _0x160d6b[_0x23c5('0x9')](_0x6d92c4);}return _0x160d6b[_0x23c5('0xa')](_0x6d92c4)[_0x23c5('0xb')]();};}function respondWithResult(_0x401be5,_0x378712){_0x378712=_0x378712||0xc8;return function(_0x41be87){if(_0x41be87){return _0x401be5['status'](_0x378712)[_0x23c5('0xc')](_0x41be87);}};}function respondWithFilteredResult(_0xc55f0c,_0x3b4c0e){return function(_0x23785b){if(_0x23785b){var _0x4bb579=typeof _0x3b4c0e[_0x23c5('0xd')]===_0x23c5('0xe')&&typeof _0x3b4c0e[_0x23c5('0xf')]===_0x23c5('0xe');var _0x4dfc39=_0x23785b[_0x23c5('0x10')];var _0x19c974=_0x4bb579?0x0:_0x3b4c0e[_0x23c5('0xd')];var _0x4a0dde=_0x4bb579?_0x23785b[_0x23c5('0x10')]:_0x3b4c0e['offset']+_0x3b4c0e[_0x23c5('0xf')];var _0x2fd916;if(_0x4a0dde>=_0x4dfc39){_0x4a0dde=_0x4dfc39;_0x2fd916=0xc8;}else{_0x2fd916=0xce;}_0xc55f0c[_0x23c5('0xa')](_0x2fd916);return _0xc55f0c[_0x23c5('0x11')](_0x23c5('0x12'),_0x19c974+'-'+_0x4a0dde+'/'+_0x4dfc39)[_0x23c5('0xc')](_0x23785b);}return null;};}function removeEntity(_0x45c989){return function(_0x287265){if(_0x287265){return _0x287265[_0x23c5('0x13')]()[_0x23c5('0x14')](function(){var _0x1db04d=_0x287265[_0x23c5('0x15')]({'plain':!![]});var _0x1b03e3=[{'name':_0x23c5('0x16'),'value':_0x23c5('0x17'),'ignore':![]},{'name':_0x23c5('0x18'),'value':_0x23c5('0x19'),'ignore':![]},{'name':_0x23c5('0x1a'),'value':'internal','ignore':![]}];var _0xe95d74=_(_0x1b03e3)[_0x23c5('0x1b')](_0x23c5('0x1c'))['map'](_0x23c5('0x1d'))[_0x23c5('0x1d')]();if(_[_0x23c5('0x1e')](_0xe95d74,_0x1db04d[_0x23c5('0x1f')])){return;}var _0x24598e=_['find'](_0x1b03e3,[_0x23c5('0x1d'),_0x1db04d['type']])[_0x23c5('0x20')];return db[_0x23c5('0x21')][_0x23c5('0x13')]({'where':{'type':_0x24598e,'resourceId':_0x1db04d['id']}})[_0x23c5('0x14')](function(){return _0x287265;});})[_0x23c5('0x14')](function(){_0x45c989['status'](0xcc)[_0x23c5('0xb')]();});}};}function handleEntityNotFound(_0x23cc94){return function(_0x1182bc){if(!_0x1182bc){_0x23cc94['sendStatus'](0x194);}return _0x1182bc;};}function handleError(_0x456f2d,_0x2c07b3){_0x2c07b3=_0x2c07b3||0x1f4;return function(_0x55ed97){logger['error'](_0x55ed97[_0x23c5('0x22')]);if(_0x55ed97[_0x23c5('0x20')]){delete _0x55ed97['name'];}_0x456f2d['status'](_0x2c07b3)[_0x23c5('0x23')](_0x55ed97);};}exports[_0x23c5('0x24')]=function(_0x298c6e,_0xe3b00c){var _0x26c77d={},_0x12e210={},_0x4c6a65={'count':0x0,'rows':[]};var _0x56efcf=_[_0x23c5('0x25')](db['VoiceExtension'][_0x23c5('0x26')],function(_0xd821f9){return{'name':_0xd821f9['fieldName'],'type':_0xd821f9['type'][_0x23c5('0x27')]};});_0x12e210['model']=_[_0x23c5('0x25')](_0x56efcf,_0x23c5('0x20'));_0x12e210[_0x23c5('0x28')]=_[_0x23c5('0x29')](_0x298c6e['query']);_0x12e210[_0x23c5('0x2a')]=_[_0x23c5('0x2b')](_0x12e210[_0x23c5('0x2c')],_0x12e210[_0x23c5('0x28')]);_0x26c77d[_0x23c5('0x2d')]=_['intersection'](_0x12e210['model'],qs[_0x23c5('0x2e')](_0x298c6e[_0x23c5('0x28')][_0x23c5('0x2e')]));_0x26c77d[_0x23c5('0x2d')]=_0x26c77d[_0x23c5('0x2d')]['length']?_0x26c77d[_0x23c5('0x2d')]:_0x12e210[_0x23c5('0x2c')];if(!_0x298c6e[_0x23c5('0x28')][_0x23c5('0x2f')](_0x23c5('0x30'))){_0x26c77d[_0x23c5('0xf')]=qs[_0x23c5('0xf')](_0x298c6e[_0x23c5('0x28')][_0x23c5('0xf')]);_0x26c77d[_0x23c5('0xd')]=qs[_0x23c5('0xd')](_0x298c6e[_0x23c5('0x28')]['offset']);}_0x26c77d[_0x23c5('0x31')]=qs['sort'](_0x298c6e[_0x23c5('0x28')][_0x23c5('0x32')]);_0x26c77d[_0x23c5('0x33')]=qs[_0x23c5('0x2a')](_[_0x23c5('0x34')](_0x298c6e[_0x23c5('0x28')],_0x12e210[_0x23c5('0x2a')]),_0x56efcf);if(_0x298c6e['query'][_0x23c5('0x1b')]){_0x26c77d['where']=_[_0x23c5('0x35')](_0x26c77d['where'],{'$or':_[_0x23c5('0x25')](_0x56efcf,function(_0x27708c){if(_0x27708c[_0x23c5('0x1f')]!=='VIRTUAL'){var _0x13b035={};_0x13b035[_0x27708c[_0x23c5('0x20')]]={'$like':'%'+_0x298c6e[_0x23c5('0x28')][_0x23c5('0x1b')]+'%'};return _0x13b035;}})});}_0x26c77d=_[_0x23c5('0x35')]({},_0x26c77d,_0x298c6e[_0x23c5('0x36')]);var _0xe8e65b={'where':_0x26c77d['where']};return db[_0x23c5('0x37')][_0x23c5('0x10')](_0xe8e65b)[_0x23c5('0x14')](function(_0x48e4f4){_0x4c6a65[_0x23c5('0x10')]=_0x48e4f4;if(_0x298c6e[_0x23c5('0x28')][_0x23c5('0x38')]){_0x26c77d[_0x23c5('0x39')]=[{'all':!![]}];}return db[_0x23c5('0x37')][_0x23c5('0x3a')](_0x26c77d);})['then'](function(_0x3b28a5){_0x4c6a65['rows']=_0x3b28a5;return _0x4c6a65;})['then'](respondWithFilteredResult(_0xe3b00c,_0x26c77d))[_0x23c5('0x3b')](handleError(_0xe3b00c,null));};exports[_0x23c5('0x3c')]=function(_0x1cf3bc,_0x373e3c){var _0x35ad86={'raw':![],'where':{'id':_0x1cf3bc[_0x23c5('0x3d')]['id']}},_0x1709e0={};_0x1709e0[_0x23c5('0x2c')]=_[_0x23c5('0x29')](db[_0x23c5('0x37')]['rawAttributes']);_0x1709e0[_0x23c5('0x28')]=_[_0x23c5('0x29')](_0x1cf3bc[_0x23c5('0x28')]);_0x1709e0[_0x23c5('0x2a')]=_[_0x23c5('0x2b')](_0x1709e0[_0x23c5('0x2c')],_0x1709e0[_0x23c5('0x28')]);_0x35ad86[_0x23c5('0x2d')]=_['intersection'](_0x1709e0[_0x23c5('0x2c')],qs[_0x23c5('0x2e')](_0x1cf3bc[_0x23c5('0x28')][_0x23c5('0x2e')]));_0x35ad86[_0x23c5('0x2d')]=_0x35ad86['attributes']['length']?_0x35ad86[_0x23c5('0x2d')]:_0x1709e0[_0x23c5('0x2c')];if(_0x1cf3bc[_0x23c5('0x28')]['includeAll']){_0x35ad86[_0x23c5('0x39')]=[{'all':!![]}];}_0x35ad86=_[_0x23c5('0x35')]({},_0x35ad86,_0x1cf3bc['options']);return db[_0x23c5('0x37')][_0x23c5('0x3e')](_0x35ad86)[_0x23c5('0x14')](handleEntityNotFound(_0x373e3c,null))[_0x23c5('0x14')](respondWithResult(_0x373e3c,null))['catch'](handleError(_0x373e3c,null));};exports[_0x23c5('0x13')]=function(_0x5b1829,_0x3910a2){return db[_0x23c5('0x37')][_0x23c5('0x3e')]({'where':{'id':_0x5b1829[_0x23c5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3910a2,null))[_0x23c5('0x14')](removeEntity(_0x3910a2,null))[_0x23c5('0x3b')](handleError(_0x3910a2,null));};exports[_0x23c5('0x3f')]=function(_0x591342,_0x4d0c1e){if(_0x591342['body'][_0x23c5('0x1f')]===_0x23c5('0x19')&&!_[_0x23c5('0x40')](_0x591342['body'][_0x23c5('0x41')],'_')){_0x591342[_0x23c5('0x42')][_0x23c5('0x41')]='_'[_0x23c5('0x43')](_0x591342[_0x23c5('0x42')][_0x23c5('0x41')]);}return db[_0x23c5('0x37')][_0x23c5('0x3f')](_0x591342['body'],{'raw':![]})[_0x23c5('0x14')](function(_0xc50c52){var _0x293fe6=_0x591342[_0x23c5('0x44')][_0x23c5('0x15')]({'plain':!![]});if(!_0x293fe6)throw new Error(_0x23c5('0x45'));if(_0x293fe6[_0x23c5('0x46')]===_0x23c5('0x44')){var _0x363cfe=_0xc50c52[_0x23c5('0x15')]({'plain':!![]});var _0x1aa6e9=[{'name':_0x23c5('0x16'),'value':_0x23c5('0x17')},{'name':_0x23c5('0x18'),'value':_0x23c5('0x19')},{'name':_0x23c5('0x1a'),'value':_0x23c5('0x47')}];var _0x3f5196=_['find'](_0x1aa6e9,[_0x23c5('0x1d'),_0x363cfe[_0x23c5('0x1f')]])['name'];return db[_0x23c5('0x48')][_0x23c5('0x3e')]({'where':{'name':_0x3f5196,'userProfileId':_0x293fe6[_0x23c5('0x49')]},'raw':!![]})['then'](function(_0x117fac){if(_0x117fac&&_0x117fac['autoAssociation']===0x0){return db[_0x23c5('0x21')]['create']({'name':_0x363cfe[_0x23c5('0x20')],'resourceId':_0x363cfe['id'],'type':_0x117fac[_0x23c5('0x20')],'sectionId':_0x117fac['id']},{})[_0x23c5('0x14')](function(){return _0xc50c52;});}else{return _0xc50c52;}})[_0x23c5('0x3b')](function(_0x1b108a){logger[_0x23c5('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b108a);throw _0x1b108a;});}return _0xc50c52;})[_0x23c5('0x14')](respondWithResult(_0x4d0c1e,0xc9))['catch'](handleError(_0x4d0c1e,null));};exports[_0x23c5('0x4b')]=function(_0x4ade1a,_0x17b39e){if(_0x4ade1a['body']['id']){delete _0x4ade1a[_0x23c5('0x42')]['id'];}return db[_0x23c5('0x37')][_0x23c5('0x3e')]({'where':{'id':_0x4ade1a[_0x23c5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x17b39e,null))[_0x23c5('0x14')](function(_0x76c77){if(_0x76c77){return db[_0x23c5('0x37')][_0x23c5('0x4b')](_[_0x23c5('0x34')](_0x4ade1a[_0x23c5('0x42')],[_0x23c5('0x41'),_0x23c5('0x4c'),_0x23c5('0x4d'),_0x23c5('0x4e'),_0x23c5('0x4f'),_0x23c5('0x50'),_0x23c5('0x51')]),{'where':{'context':_0x76c77[_0x23c5('0x4c')],'exten':_0x76c77[_0x23c5('0x41')]},'individualHooks':!![]})[_0x23c5('0x14')](function(_0x8d4e45){return _0x8d4e45;});}return null;})[_0x23c5('0x14')](respondWithStatusCode(_0x17b39e,null))[_0x23c5('0x3b')](handleError(_0x17b39e,null));};exports[_0x23c5('0x52')]=function(_0x254279,_0x5c17cb){var _0x4a085b=_0x254279[_0x23c5('0x3d')]['id'];var _0x2d0a83=_0x254279[_0x23c5('0x42')];var _0xdacafb=0xc8;var _0x2c1e55=null;return db[_0x23c5('0x53')]['transaction']({'isolationLevel':db['sequelize'][_0x23c5('0x54')][_0x23c5('0x55')][_0x23c5('0x56')]},function(_0x53c0eb){return db[_0x23c5('0x37')][_0x23c5('0x57')]({'where':{'id':_0x4a085b},'transaction':_0x53c0eb})['then'](function(_0x2a4205){if(_0x2a4205){return db['VoiceExtension'][_0x23c5('0x13')]({'where':{'VoiceExtensionId':_0x4a085b},'transaction':_0x53c0eb})[_0x23c5('0x14')](function(){var _0x36dd4a=_[_0x23c5('0x25')](_0x2d0a83,function(_0xdbe303){_0xdbe303[_0x23c5('0x58')]=_0x4a085b;_0xdbe303['isApp']=!![];return _0xdbe303;});return _0x2a4205[_0x23c5('0x59')](_0x36dd4a);})[_0x23c5('0x14')](function(_0x4aefea){return db[_0x23c5('0x37')]['bulkCreate'](_0x4aefea,{'transaction':_0x53c0eb});});}else{_0xdacafb=0x194;_0x2c1e55=[];}});})[_0x23c5('0x14')](function(){if(_0xdacafb!==0x194){return db[_0x23c5('0x37')][_0x23c5('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4a085b},'order':_0x23c5('0x5b')})[_0x23c5('0x14')](function(_0x49d4a8){_0x2c1e55=_0x49d4a8;});}})[_0x23c5('0x3b')](function(_0x937368){_0xdacafb=0x1f4;logger[_0x23c5('0x4a')](_0x937368['stack']);if(_0x937368[_0x23c5('0x20')]){delete _0x937368[_0x23c5('0x20')];}_0x2c1e55=_0x937368;})[_0x23c5('0x5c')](function(){if(_0x2c1e55===null){_0x5c17cb[_0x23c5('0x9')](_0xdacafb);}else{if(_0xdacafb===0x1f4){_0x5c17cb[_0x23c5('0xa')](_0xdacafb)['send'](_0x2c1e55);}else{_0x5c17cb['status'](_0xdacafb)['json'](_0x2c1e55);}}});}; \ No newline at end of file +var _0xfd86=['./voiceExtension.socket','status','json','offset','count','set','Content-Range','destroy','then','get','inbound','internal','filter','map','value','includes','type','find','name','UserProfileResource','sendStatus','error','stack','index','VoiceExtension','rawAttributes','key','model','query','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','outbound','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','OutboundRoutes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','alias','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','send','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter'];(function(_0xa18665,_0x5d6110){var _0x521a06=function(_0xfc6c56){while(--_0xfc6c56){_0xa18665['push'](_0xa18665['shift']());}};_0x521a06(++_0x5d6110);}(_0xfd86,0xa8));var _0x6fd8=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xfd86[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x6fd8('0x0'));var Redis=require('ioredis');var qs=require(_0x6fd8('0x1'));var logger=require(_0x6fd8('0x2'))(_0x6fd8('0x3'));var config=require('../../config/environment');var db=require(_0x6fd8('0x4'))['db'];config[_0x6fd8('0x5')]=_[_0x6fd8('0x6')](config[_0x6fd8('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fd8('0x7'))(new Redis(config[_0x6fd8('0x5')]));require(_0x6fd8('0x8'))['register'](socket);function respondWithStatusCode(_0x3a9ac9,_0x48573d){_0x48573d=_0x48573d||0xcc;return function(_0x64310a){if(_0x64310a){return _0x3a9ac9['sendStatus'](_0x48573d);}return _0x3a9ac9[_0x6fd8('0x9')](_0x48573d)['end']();};}function respondWithResult(_0x2a0b52,_0x17e38e){_0x17e38e=_0x17e38e||0xc8;return function(_0x15e9f4){if(_0x15e9f4){return _0x2a0b52[_0x6fd8('0x9')](_0x17e38e)[_0x6fd8('0xa')](_0x15e9f4);}};}function respondWithFilteredResult(_0x4232c6,_0x3d73a1){return function(_0x2af01a){if(_0x2af01a){var _0x134bcf=typeof _0x3d73a1[_0x6fd8('0xb')]==='undefined'&&typeof _0x3d73a1['limit']==='undefined';var _0x70fbe8=_0x2af01a['count'];var _0x4ac834=_0x134bcf?0x0:_0x3d73a1[_0x6fd8('0xb')];var _0x586ad6=_0x134bcf?_0x2af01a[_0x6fd8('0xc')]:_0x3d73a1['offset']+_0x3d73a1['limit'];var _0x23e4cf;if(_0x586ad6>=_0x70fbe8){_0x586ad6=_0x70fbe8;_0x23e4cf=0xc8;}else{_0x23e4cf=0xce;}_0x4232c6[_0x6fd8('0x9')](_0x23e4cf);return _0x4232c6[_0x6fd8('0xd')](_0x6fd8('0xe'),_0x4ac834+'-'+_0x586ad6+'/'+_0x70fbe8)[_0x6fd8('0xa')](_0x2af01a);}return null;};}function removeEntity(_0xa9d576){return function(_0x2d43ef){if(_0x2d43ef){return _0x2d43ef[_0x6fd8('0xf')]()[_0x6fd8('0x10')](function(){var _0x3773b6=_0x2d43ef[_0x6fd8('0x11')]({'plain':!![]});var _0x5562fe=[{'name':'InboundRoutes','value':_0x6fd8('0x12'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0x6fd8('0x13'),'ignore':![]}];var _0x55614f=_(_0x5562fe)[_0x6fd8('0x14')]('ignore')[_0x6fd8('0x15')](_0x6fd8('0x16'))[_0x6fd8('0x16')]();if(_[_0x6fd8('0x17')](_0x55614f,_0x3773b6[_0x6fd8('0x18')])){return;}var _0x535608=_[_0x6fd8('0x19')](_0x5562fe,['value',_0x3773b6['type']])[_0x6fd8('0x1a')];return db[_0x6fd8('0x1b')][_0x6fd8('0xf')]({'where':{'type':_0x535608,'resourceId':_0x3773b6['id']}})['then'](function(){return _0x2d43ef;});})['then'](function(){_0xa9d576['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x247a1d){return function(_0x331979){if(!_0x331979){_0x247a1d[_0x6fd8('0x1c')](0x194);}return _0x331979;};}function handleError(_0x48a9fc,_0x2e3073){_0x2e3073=_0x2e3073||0x1f4;return function(_0x1b82ee){logger[_0x6fd8('0x1d')](_0x1b82ee[_0x6fd8('0x1e')]);if(_0x1b82ee[_0x6fd8('0x1a')]){delete _0x1b82ee[_0x6fd8('0x1a')];}_0x48a9fc[_0x6fd8('0x9')](_0x2e3073)['send'](_0x1b82ee);};}exports[_0x6fd8('0x1f')]=function(_0x19403f,_0x2a4582){var _0x280b80={},_0x5b1a78={},_0x47c97c={'count':0x0,'rows':[]};var _0x48fd84=_[_0x6fd8('0x15')](db[_0x6fd8('0x20')][_0x6fd8('0x21')],function(_0x4a479a){return{'name':_0x4a479a['fieldName'],'type':_0x4a479a[_0x6fd8('0x18')][_0x6fd8('0x22')]};});_0x5b1a78[_0x6fd8('0x23')]=_[_0x6fd8('0x15')](_0x48fd84,_0x6fd8('0x1a'));_0x5b1a78[_0x6fd8('0x24')]=_['keys'](_0x19403f[_0x6fd8('0x24')]);_0x5b1a78[_0x6fd8('0x25')]=_['intersection'](_0x5b1a78['model'],_0x5b1a78[_0x6fd8('0x24')]);_0x280b80[_0x6fd8('0x26')]=_['intersection'](_0x5b1a78[_0x6fd8('0x23')],qs[_0x6fd8('0x27')](_0x19403f['query'][_0x6fd8('0x27')]));_0x280b80[_0x6fd8('0x26')]=_0x280b80[_0x6fd8('0x26')][_0x6fd8('0x28')]?_0x280b80[_0x6fd8('0x26')]:_0x5b1a78[_0x6fd8('0x23')];if(!_0x19403f['query'][_0x6fd8('0x29')]('nolimit')){_0x280b80[_0x6fd8('0x2a')]=qs['limit'](_0x19403f[_0x6fd8('0x24')]['limit']);_0x280b80[_0x6fd8('0xb')]=qs[_0x6fd8('0xb')](_0x19403f['query'][_0x6fd8('0xb')]);}_0x280b80[_0x6fd8('0x2b')]=qs[_0x6fd8('0x2c')](_0x19403f[_0x6fd8('0x24')][_0x6fd8('0x2c')]);_0x280b80[_0x6fd8('0x2d')]=qs[_0x6fd8('0x25')](_['pick'](_0x19403f[_0x6fd8('0x24')],_0x5b1a78['filters']),_0x48fd84);if(_0x19403f[_0x6fd8('0x24')]['filter']){_0x280b80[_0x6fd8('0x2d')]=_['merge'](_0x280b80[_0x6fd8('0x2d')],{'$or':_[_0x6fd8('0x15')](_0x48fd84,function(_0x59afcb){if(_0x59afcb['type']!==_0x6fd8('0x2e')){var _0x455606={};_0x455606[_0x59afcb[_0x6fd8('0x1a')]]={'$like':'%'+_0x19403f['query'][_0x6fd8('0x14')]+'%'};return _0x455606;}})});}_0x280b80=_[_0x6fd8('0x2f')]({},_0x280b80,_0x19403f[_0x6fd8('0x30')]);var _0x27c3bb={'where':_0x280b80['where']};return db[_0x6fd8('0x20')][_0x6fd8('0xc')](_0x27c3bb)[_0x6fd8('0x10')](function(_0xf2dc0a){_0x47c97c[_0x6fd8('0xc')]=_0xf2dc0a;if(_0x19403f[_0x6fd8('0x24')][_0x6fd8('0x31')]){_0x280b80[_0x6fd8('0x32')]=[{'all':!![]}];}return db[_0x6fd8('0x20')][_0x6fd8('0x33')](_0x280b80);})[_0x6fd8('0x10')](function(_0x5e2959){_0x47c97c[_0x6fd8('0x34')]=_0x5e2959;return _0x47c97c;})[_0x6fd8('0x10')](respondWithFilteredResult(_0x2a4582,_0x280b80))[_0x6fd8('0x35')](handleError(_0x2a4582,null));};exports[_0x6fd8('0x36')]=function(_0x226dcb,_0x114e77){var _0x57ca27={'raw':![],'where':{'id':_0x226dcb[_0x6fd8('0x37')]['id']}},_0x59e1e1={};_0x59e1e1['model']=_['keys'](db['VoiceExtension']['rawAttributes']);_0x59e1e1[_0x6fd8('0x24')]=_['keys'](_0x226dcb[_0x6fd8('0x24')]);_0x59e1e1[_0x6fd8('0x25')]=_[_0x6fd8('0x38')](_0x59e1e1['model'],_0x59e1e1[_0x6fd8('0x24')]);_0x57ca27['attributes']=_[_0x6fd8('0x38')](_0x59e1e1[_0x6fd8('0x23')],qs[_0x6fd8('0x27')](_0x226dcb[_0x6fd8('0x24')][_0x6fd8('0x27')]));_0x57ca27[_0x6fd8('0x26')]=_0x57ca27[_0x6fd8('0x26')]['length']?_0x57ca27[_0x6fd8('0x26')]:_0x59e1e1[_0x6fd8('0x23')];if(_0x226dcb['query']['includeAll']){_0x57ca27['include']=[{'all':!![]}];}_0x57ca27=_[_0x6fd8('0x2f')]({},_0x57ca27,_0x226dcb[_0x6fd8('0x30')]);return db['VoiceExtension']['find'](_0x57ca27)['then'](handleEntityNotFound(_0x114e77,null))[_0x6fd8('0x10')](respondWithResult(_0x114e77,null))[_0x6fd8('0x35')](handleError(_0x114e77,null));};exports['destroy']=function(_0x5acdb6,_0x29e4b3){return db[_0x6fd8('0x20')][_0x6fd8('0x19')]({'where':{'id':_0x5acdb6[_0x6fd8('0x37')]['id']}})[_0x6fd8('0x10')](handleEntityNotFound(_0x29e4b3,null))[_0x6fd8('0x10')](removeEntity(_0x29e4b3,null))['catch'](handleError(_0x29e4b3,null));};exports[_0x6fd8('0x39')]=function(_0x3367bf,_0x2b63da){if(_0x3367bf[_0x6fd8('0x3a')][_0x6fd8('0x18')]===_0x6fd8('0x3b')&&!_[_0x6fd8('0x3c')](_0x3367bf[_0x6fd8('0x3a')][_0x6fd8('0x3d')],'_')){_0x3367bf[_0x6fd8('0x3a')][_0x6fd8('0x3d')]='_'[_0x6fd8('0x3e')](_0x3367bf[_0x6fd8('0x3a')][_0x6fd8('0x3d')]);}return db[_0x6fd8('0x20')][_0x6fd8('0x39')](_0x3367bf[_0x6fd8('0x3a')],{'raw':![]})[_0x6fd8('0x10')](function(_0x39faa2){var _0x3f9a23=_0x3367bf['user'][_0x6fd8('0x11')]({'plain':!![]});if(!_0x3f9a23)throw new Error(_0x6fd8('0x3f'));if(_0x3f9a23[_0x6fd8('0x40')]==='user'){var _0x874d78=_0x39faa2[_0x6fd8('0x11')]({'plain':!![]});var _0x650850=[{'name':_0x6fd8('0x41'),'value':'inbound'},{'name':_0x6fd8('0x42'),'value':_0x6fd8('0x3b')},{'name':'InternalRoutes','value':'internal'}];var _0x526672=_[_0x6fd8('0x19')](_0x650850,[_0x6fd8('0x16'),_0x874d78['type']])[_0x6fd8('0x1a')];return db[_0x6fd8('0x43')]['find']({'where':{'name':_0x526672,'userProfileId':_0x3f9a23['userProfileId']},'raw':!![]})[_0x6fd8('0x10')](function(_0x345d84){if(_0x345d84&&_0x345d84[_0x6fd8('0x44')]===0x0){return db[_0x6fd8('0x1b')][_0x6fd8('0x39')]({'name':_0x874d78[_0x6fd8('0x1a')],'resourceId':_0x874d78['id'],'type':_0x345d84[_0x6fd8('0x1a')],'sectionId':_0x345d84['id']},{})[_0x6fd8('0x10')](function(){return _0x39faa2;});}else{return _0x39faa2;}})[_0x6fd8('0x35')](function(_0x56f29e){logger[_0x6fd8('0x1d')](_0x6fd8('0x45'),_0x56f29e);throw _0x56f29e;});}return _0x39faa2;})[_0x6fd8('0x10')](respondWithResult(_0x2b63da,0xc9))[_0x6fd8('0x35')](handleError(_0x2b63da,null));};exports[_0x6fd8('0x46')]=function(_0x140224,_0x1ea4d8){if(_0x140224[_0x6fd8('0x3a')]['id']){delete _0x140224[_0x6fd8('0x3a')]['id'];}return db['VoiceExtension'][_0x6fd8('0x19')]({'where':{'id':_0x140224[_0x6fd8('0x37')]['id']}})[_0x6fd8('0x10')](handleEntityNotFound(_0x1ea4d8,null))[_0x6fd8('0x10')](function(_0x220d67){if(_0x220d67){return db[_0x6fd8('0x20')]['update'](_['pick'](_0x140224[_0x6fd8('0x3a')],[_0x6fd8('0x3d'),_0x6fd8('0x47'),_0x6fd8('0x48'),_0x6fd8('0x49'),'cutdigits','mandatoryDisposition',_0x6fd8('0x4a')]),{'where':{'context':_0x220d67['context'],'exten':_0x220d67[_0x6fd8('0x3d')]},'individualHooks':!![]})[_0x6fd8('0x10')](function(_0x2d2077){return _0x2d2077;});}return null;})[_0x6fd8('0x10')](respondWithStatusCode(_0x1ea4d8,null))[_0x6fd8('0x35')](handleError(_0x1ea4d8,null));};exports[_0x6fd8('0x4b')]=function(_0xc778cc,_0x5a9d18){var _0x131ede=_0xc778cc[_0x6fd8('0x37')]['id'];var _0x26a3cb=_0xc778cc[_0x6fd8('0x3a')];var _0x350cdf=0xc8;var _0x4f904d=null;return db[_0x6fd8('0x4c')][_0x6fd8('0x4d')]({'isolationLevel':db['sequelize']['Transaction'][_0x6fd8('0x4e')][_0x6fd8('0x4f')]},function(_0x3efbe2){return db[_0x6fd8('0x20')][_0x6fd8('0x50')]({'where':{'id':_0x131ede},'transaction':_0x3efbe2})[_0x6fd8('0x10')](function(_0xc491ce){if(_0xc491ce){return db['VoiceExtension'][_0x6fd8('0xf')]({'where':{'VoiceExtensionId':_0x131ede},'transaction':_0x3efbe2})[_0x6fd8('0x10')](function(){var _0x48d8a3=_[_0x6fd8('0x15')](_0x26a3cb,function(_0x4f307f){_0x4f307f[_0x6fd8('0x51')]=_0x131ede;_0x4f307f[_0x6fd8('0x52')]=!![];return _0x4f307f;});return _0xc491ce[_0x6fd8('0x53')](_0x48d8a3);})[_0x6fd8('0x10')](function(_0x2759fb){return db[_0x6fd8('0x20')][_0x6fd8('0x54')](_0x2759fb,{'transaction':_0x3efbe2});});}else{_0x350cdf=0x194;_0x4f904d=[];}});})[_0x6fd8('0x10')](function(){if(_0x350cdf!==0x194){return db[_0x6fd8('0x20')][_0x6fd8('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x131ede},'order':_0x6fd8('0x56')})['then'](function(_0x137a1b){_0x4f904d=_0x137a1b;});}})['catch'](function(_0x49042d){_0x350cdf=0x1f4;logger[_0x6fd8('0x1d')](_0x49042d[_0x6fd8('0x1e')]);if(_0x49042d['name']){delete _0x49042d[_0x6fd8('0x1a')];}_0x4f904d=_0x49042d;})['finally'](function(){if(_0x4f904d===null){_0x5a9d18[_0x6fd8('0x1c')](_0x350cdf);}else{if(_0x350cdf===0x1f4){_0x5a9d18[_0x6fd8('0x9')](_0x350cdf)[_0x6fd8('0x57')](_0x4f904d);}else{_0x5a9d18[_0x6fd8('0x9')](_0x350cdf)[_0x6fd8('0xa')](_0x4f904d);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2a7c790..c609ef7 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 _0xfc44=['VoiceExtension','save','remove','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5ec62e,_0x1a717b){var _0xe5416f=function(_0x38af18){while(--_0x38af18){_0x5ec62e['push'](_0x5ec62e['shift']());}};_0xe5416f(++_0x1a717b);}(_0xfc44,0x15c));var _0x4fc4=function(_0x3de690,_0x4ed3ed){_0x3de690=_0x3de690-0x0;var _0x88d098=_0xfc44[_0x3de690];return _0x88d098;};'use strict';var EventEmitter=require(_0x4fc4('0x0'));var VoiceExtension=require(_0x4fc4('0x1'))['db'][_0x4fc4('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4fc4('0x3'),'afterUpdate':'update','afterDestroy':_0x4fc4('0x4')};function emitEvent(_0x36ef4c){return function(_0x29387a,_0x12d1f0,_0x163491){VoiceExtensionEvents['emit'](_0x36ef4c+':'+_0x29387a['id'],_0x29387a);VoiceExtensionEvents['emit'](_0x36ef4c,_0x29387a);_0x163491(null);};}for(var e in events){if(events[_0x4fc4('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x4fc4('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0xff40=['remove','emit','hasOwnProperty','exports','events','VoiceExtension','setMaxListeners','save','update'];(function(_0x3a8415,_0x57a81c){var _0x547dae=function(_0x7c2b62){while(--_0x7c2b62){_0x3a8415['push'](_0x3a8415['shift']());}};_0x547dae(++_0x57a81c);}(_0xff40,0xa6));var _0x0ff4=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xff40[_0x21aec3];return _0x288bbc;};'use strict';var EventEmitter=require(_0x0ff4('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x0ff4('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0ff4('0x2')](0x0);var events={'afterCreate':_0x0ff4('0x3'),'afterUpdate':_0x0ff4('0x4'),'afterDestroy':_0x0ff4('0x5')};function emitEvent(_0x33dee7){return function(_0x55fbbe,_0x41badc,_0x1e0ab7){VoiceExtensionEvents[_0x0ff4('0x6')](_0x33dee7+':'+_0x55fbbe['id'],_0x55fbbe);VoiceExtensionEvents['emit'](_0x33dee7,_0x55fbbe);_0x1e0ab7(null);};}for(var e in events){if(events[_0x0ff4('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x0ff4('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 87406ea..cb7e64c 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 _0x693d=['playback','includes','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','trunk','timeout','options','url','split','phone','param','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','then','length','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer'];(function(_0x2bbe9b,_0x5a21eb){var _0x52d000=function(_0x4f00c2){while(--_0x4f00c2){_0x2bbe9b['push'](_0x2bbe9b['shift']());}};_0x52d000(++_0x5a21eb);}(_0x693d,0x153));var _0xd693=function(_0x1fc845,_0x422760){_0x1fc845=_0x1fc845-0x0;var _0x14fd5a=_0x693d[_0x1fc845];return _0x14fd5a;};'use strict';var _=require(_0xd693('0x0'));var attributes=require(_0xd693('0x1'));module[_0xd693('0x2')]=function(_0x45370d){var _0x36e3da=_0x45370d[_0xd693('0x3')];function _0x3bd63d(_0x167a63){var _0x36f9b9=0x2;var _0x4c18df=[{'type':_0x167a63[_0xd693('0x4')],'app':_0xd693('0x5'),'appdata':'CDR(type)='+_0x167a63['type'],'context':_0x167a63[_0xd693('0x6')],'exten':_0x167a63[_0xd693('0x7')],'priority':_0x36f9b9++,'VoiceExtensionId':_0x167a63['id']},{'type':_0x167a63[_0xd693('0x4')],'app':_0x167a63[_0xd693('0x8')]?_0xd693('0x5'):_0xd693('0x9'),'appdata':_0x167a63[_0xd693('0x8')]?_0xd693('0xa')+_0x167a63[_0xd693('0x8')]:_0xd693('0xb'),'context':_0x167a63[_0xd693('0x6')],'exten':_0x167a63[_0xd693('0x7')],'priority':_0x36f9b9++,'VoiceExtensionId':_0x167a63['id']}];if(_0x167a63[_0xd693('0x4')]===_0xd693('0xc')){_0x4c18df[_0xd693('0xd')]({'type':_0xd693('0xc'),'app':_0xd693('0x5'),'appdata':_0xd693('0xe')+_0x167a63['id'],'context':_0x167a63['context'],'exten':_0x167a63['exten'],'priority':_0x36f9b9++,'VoiceExtensionId':_0x167a63['id']});}_0x4c18df[_0xd693('0xd')]({'type':_0x167a63['type'],'app':_0xd693('0x5'),'appdata':_0xd693('0xf'),'context':_0x167a63[_0xd693('0x6')],'exten':_0x167a63['exten'],'priority':_0x36f9b9++,'VoiceExtensionId':_0x167a63['id']},{'type':_0x167a63['type'],'app':_0xd693('0x5'),'appdata':_0xd693('0x10'),'context':_0x167a63[_0xd693('0x6')],'exten':_0x167a63[_0xd693('0x7')],'priority':_0x36f9b9++,'VoiceExtensionId':_0x167a63['id']},{'type':_0x167a63[_0xd693('0x4')],'app':_0xd693('0x5'),'appdata':_0xd693('0x11'),'context':_0x167a63[_0xd693('0x6')],'exten':_0x167a63[_0xd693('0x7')],'priority':_0x36f9b9++,'VoiceExtensionId':_0x167a63['id']});return _0x4c18df;}function _0xc39f4a(_0x4cf70a){var _0x13d16a=0x2;var _0x2ac52f=[{'type':'outbound','app':_0xd693('0x5'),'appdata':_0xd693('0x12'),'context':_0x4cf70a['context'],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':_0x4cf70a['alias']?_0xd693('0x5'):'NoOp','appdata':_0x4cf70a[_0xd693('0x8')]?'CDR(routeAlias)='+_0x4cf70a['alias']:'No\x20alias\x20set','context':_0x4cf70a[_0xd693('0x6')],'exten':_0x4cf70a['exten'],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':'Set','appdata':'CDR(destination)='+(_0x4cf70a['cutdigits']?'${EXTEN:'+_0x4cf70a[_0xd693('0x14')]+'}':_0xd693('0x15')),'context':_0x4cf70a[_0xd693('0x6')],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':'Set','appdata':_0xd693('0xe')+_0x4cf70a['id'],'context':_0x4cf70a[_0xd693('0x6')],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':_0xd693('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x13d16a+0x2)+_0xd693('0x17')+(_0x13d16a+0x1)+')','context':_0x4cf70a['context'],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':_0xd693('0x5'),'appdata':_0x4cf70a[_0xd693('0x14')]?_0xd693('0x18')+_0x4cf70a[_0xd693('0x14')]+'}':_0xd693('0x19'),'context':_0x4cf70a[_0xd693('0x6')],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':_0xd693('0x5'),'appdata':_0xd693('0xf'),'context':_0x4cf70a['context'],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':'Set','appdata':_0xd693('0x10'),'context':_0x4cf70a[_0xd693('0x6')],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':_0xd693('0x5'),'appdata':_0xd693('0x11'),'context':_0x4cf70a[_0xd693('0x6')],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':_0xd693('0x5'),'appdata':_0xd693('0x1a')+_0x4cf70a['id'],'context':_0x4cf70a[_0xd693('0x6')],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']}];if(_0x4cf70a[_0xd693('0x1b')](_0xd693('0x1c'))&&_0x4cf70a[_0xd693('0x1c')]!==_0xd693('0x1d')){_0x2ac52f['push']({'type':_0xd693('0x13'),'app':_0xd693('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4cf70a[_0xd693('0x6')],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']},{'type':_0xd693('0x13'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x4cf70a[_0xd693('0x1c')]||_0xd693('0x1e'),'context':_0x4cf70a[_0xd693('0x6')],'exten':_0x4cf70a[_0xd693('0x7')],'priority':_0x13d16a++,'VoiceExtensionId':_0x4cf70a['id']});}return _0x2ac52f;}function _0x520576(_0x214b67,_0x3e1fa1){var _0x521066=[{'name':_0xd693('0x1f'),'param':0x0},{'name':_0xd693('0x20'),'param':0x1},{'name':_0xd693('0x21'),'param':0x2},{'name':_0xd693('0x22'),'param':0x3}];var _0x44757d={};var _0x488b64=_0x3e1fa1['split'](',');var _0x1fd7fc=[];for(var _0x306d70=0x0;_0x306d70<_0x521066['length'];_0x306d70++){switch(_0x521066[_0x306d70]['name']){case'trunk':_0x44757d[_0xd693('0x1f')]=_0x488b64[_0x521066[_0x306d70]['param']][_0xd693('0x23')]('/')[0x1];_0x44757d[_0xd693('0x24')]=_0x488b64[_0x521066[_0x306d70][_0xd693('0x25')]][_0xd693('0x23')]('/')[0x2];_0x44757d[_0xd693('0x26')]=_0x44757d[_0xd693('0x24')]?_0x44757d[_0xd693('0x24')][_0xd693('0x23')]('$')[0x0]:undefined;_0x44757d['phone']=_0x214b67[_0xd693('0x14')]?(_0x44757d[_0xd693('0x26')]||'')+'${EXTEN:'+_0x214b67[_0xd693('0x14')]+'}':(_0x44757d['prefix']||'')+_0xd693('0x15');_0x1fd7fc[_0x521066[_0x306d70][_0xd693('0x25')]]=[_0xd693('0x27'),_0x44757d[_0xd693('0x1f')],_0x44757d[_0xd693('0x24')]][_0xd693('0x28')]('/');break;case _0xd693('0x21'):_0x44757d[_0xd693('0x21')]=_0x488b64[_0x521066[_0x306d70][_0xd693('0x25')]];if(_0x214b67['recordingFormat']!==_0xd693('0x1d')){if(_0x44757d[_0xd693('0x21')][_0xd693('0x29')](_0xd693('0x2a'))<0x0){_0x44757d[_0xd693('0x21')]+=_0xd693('0x2a');}}else{_0x44757d[_0xd693('0x21')]=_0x44757d[_0xd693('0x21')]['replace']('U(xcally-mixmonitor-context)','');}_0x1fd7fc[_0x521066[_0x306d70][_0xd693('0x25')]]=_0x44757d['options'];break;default:_0x1fd7fc[_0x521066[_0x306d70][_0xd693('0x25')]]=_0x488b64[_0x521066[_0x306d70]['param']];}}return _0x1fd7fc[_0xd693('0x28')](',');}function _0x28315a(_0xe554ea,_0x28ca66,_0x29c704){return new Promise(function(_0x457ef0,_0x358034){var _0xbf255c=[];if(_[_0xd693('0x2b')](_0x28ca66))return _0x457ef0(_0xbf255c);_0x36e3da[_0xd693('0x2c')][_0xd693('0x2d')]({'attributes':['id',_0xd693('0x2e'),'IntervalId'],'raw':!![]})[_0xd693('0x2f')](function(_0x30eff4){for(var _0x23b8d7=0x0,_0x197f48=0x0;_0x23b8d7<_0x28ca66[_0xd693('0x30')];_0x23b8d7++,_0x197f48=0x0){var _0x38ab57=_0x28ca66[_0x23b8d7];var _0x85b9ea=[];var _0x3e7c46=[];delete _0x38ab57['id'];if(_0x38ab57[_0xd693('0x2e')]!==_0xd693('0x31')){_0x38ab57[_0xd693('0x32')]=[_0x38ab57[_0xd693('0x2e')]];}else{_0x38ab57[_0xd693('0x32')]=_0x38ab57[_0xd693('0x33')]?_[_0xd693('0x34')](_[_0xd693('0x35')](_0x30eff4,{'IntervalId':_0x38ab57['IntervalId']}),'interval'):[];}_0x38ab57['context']=_0xe554ea['context'];_0x38ab57[_0xd693('0x7')]=_0xe554ea['exten'];if(_0x38ab57[_0xd693('0x4')])_0x38ab57['type']=_0x38ab57['type'][_0xd693('0x36')]();if(_0xe554ea[_0xd693('0x4')]==='outbound'){if(_0x38ab57['hasOwnProperty'](_0xd693('0x37'))&&_0x38ab57[_0xd693('0x37')]&&_0x38ab57[_0xd693('0x37')]!=='--'){_0x85b9ea['push']({'type':_0x38ab57[_0xd693('0x4')]['toLowerCase'](),'app':'Set','appdata':_0xd693('0x38')+_0x38ab57[_0xd693('0x37')],'context':_0xe554ea[_0xd693('0x6')],'exten':_0xe554ea[_0xd693('0x7')],'priority':_0x38ab57[_0xd693('0x32')][_0xd693('0x30')]+_0x29c704+_0x197f48++,'VoiceExtensionId':_0xe554ea['id']});}_0x85b9ea['push']({'type':_0x38ab57['type'][_0xd693('0x36')](),'app':_0xd693('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x38ab57[_0xd693('0x39')]?_0xd693('0x3a')+_0x38ab57['callerID']+')':_0xd693('0x3b')),'context':_0xe554ea[_0xd693('0x6')],'exten':_0xe554ea['exten'],'priority':_0x38ab57[_0xd693('0x32')]['length']+_0x29c704+_0x197f48++,'VoiceExtensionId':_0xe554ea['id']});}else{if(_0x38ab57[_0xd693('0x1b')](_0xd693('0x3c'))){if(['queue',_0xd693('0x3d')][_0xd693('0x3e')](_0x38ab57['app'][_0xd693('0x36')]())&&_0x38ab57[_0xd693('0x3f')]!==_0xd693('0x40')){if(_0x38ab57['answer']){_0x85b9ea['push']({'type':_0x38ab57[_0xd693('0x4')][_0xd693('0x36')](),'app':_0xd693('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xe554ea[_0xd693('0x6')],'exten':_0xe554ea['exten'],'priority':_0x38ab57[_0xd693('0x32')][_0xd693('0x30')]+_0x29c704+_0x197f48++,'VoiceExtensionId':_0xe554ea['id']});_0x85b9ea[_0xd693('0xd')]({'type':_0x38ab57[_0xd693('0x4')][_0xd693('0x36')](),'app':_0xd693('0x5'),'appdata':_0xd693('0x41'),'context':_0xe554ea[_0xd693('0x6')],'exten':_0xe554ea[_0xd693('0x7')],'priority':_0x38ab57[_0xd693('0x32')][_0xd693('0x30')]+_0x29c704+_0x197f48++,'VoiceExtensionId':_0xe554ea['id']});}else{_0x85b9ea['push']({'type':_0x38ab57[_0xd693('0x4')][_0xd693('0x36')](),'app':_0xd693('0x16'),'appdata':_0xd693('0x42'),'context':_0xe554ea[_0xd693('0x6')],'exten':_0xe554ea['exten'],'priority':_0x38ab57[_0xd693('0x32')][_0xd693('0x30')]+_0x29c704+_0x197f48++,'VoiceExtensionId':_0xe554ea['id']});_0x85b9ea['push']({'type':_0x38ab57['type'][_0xd693('0x36')](),'app':'Set','appdata':_0xd693('0x43'),'context':_0xe554ea[_0xd693('0x6')],'exten':_0xe554ea['exten'],'priority':_0x38ab57['intervals'][_0xd693('0x30')]+_0x29c704+_0x197f48++,'VoiceExtensionId':_0xe554ea['id']});}}}}for(var _0x56b304=0x0;_0x56b304<_0x38ab57['intervals'][_0xd693('0x30')];_0x56b304++){var _0x4b1f21=_0x29c704+_0x38ab57[_0xd693('0x32')][_0xd693('0x30')];var _0x46a400=_0x56b304===_0x38ab57[_0xd693('0x32')][_0xd693('0x30')]-0x1?_0x29c704+_0x85b9ea['length']+_0x3e7c46['length']+0x2:_0x29c704+_0x56b304+0x1;_0x85b9ea['splice'](_0x56b304,0x0,{'type':_0xe554ea[_0xd693('0x4')],'app':_0xd693('0x44'),'appdata':_0x38ab57[_0xd693('0x32')][_0x56b304]+'?'+_0xe554ea['context']+',${EXTEN},'+_0x4b1f21+':'+_0xe554ea[_0xd693('0x6')]+_0xd693('0x45')+_0x46a400,'exten':_0xe554ea[_0xd693('0x7')],'context':_0xe554ea[_0xd693('0x6')],'priority':_0x29c704+_0x56b304,'VoiceExtensionId':_0xe554ea['id']});}if(_0x38ab57[_0xd693('0x3f')]==='outboundDial'){_0x38ab57[_0xd693('0x46')]=_0x520576(_0xe554ea,_0x38ab57[_0xd693('0x46')]);}if(_0x38ab57[_0xd693('0x3f')]==='agi'){_0x85b9ea[_0xd693('0xd')]({'type':_0x38ab57['type'][_0xd693('0x36')](),'app':_0xd693('0x5'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0xe554ea[_0xd693('0x6')],'exten':_0xe554ea[_0xd693('0x7')],'priority':_0x38ab57['intervals']['length']+_0x29c704+_0x197f48++,'VoiceExtensionId':_0xe554ea['id']});}_0x38ab57[_0xd693('0x47')]=_0x85b9ea[_0xd693('0x30')]?_[_0xd693('0x48')](_0x85b9ea)[_0xd693('0x47')]+0x1:_0x29c704;_0xbf255c=_[_0xd693('0x49')](_0xbf255c,_0x85b9ea,[_0x38ab57],_0x3e7c46);_0x29c704=_[_0xd693('0x48')](_0xbf255c)['priority']+0x1;}return _0x457ef0(_0xbf255c);})[_0xd693('0x4a')](function(_0x1390d8){_0x358034(_0x1390d8);});});}return _0x45370d[_0xd693('0x4b')](_0xd693('0x4c'),attributes,{'tableName':_0xd693('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x373c8b){var _0x1570ee=this[_0xd693('0x4e')]({'plain':!![]});var _0x2b557f=_0x1570ee[_0xd693('0x4')]===_0xd693('0x13')?_0xc39f4a(_0x1570ee):_0x3bd63d(_0x1570ee);return _0x28315a(_0x1570ee,_0x373c8b,_[_0xd693('0x48')](_0x2b557f)[_0xd693('0x47')]+0x1)[_0xd693('0x2f')](function(_0x1184e2){var _0x4b6de6=_[_0xd693('0x49')](_0x2b557f,_0x1184e2);_0x4b6de6[_0xd693('0xd')]({'type':_0x1570ee[_0xd693('0x4')],'app':_0xd693('0x4f'),'exten':_0x1570ee[_0xd693('0x7')],'context':_0x1570ee[_0xd693('0x6')],'priority':_[_0xd693('0x48')](_0x4b6de6)['priority']+0x1,'VoiceExtensionId':_0x1570ee['id']});return _0x4b6de6;});}}});}; \ No newline at end of file +var _0xeb17=['$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','voice_extensions','get','Hangup','lodash','exports','models','type','Set','CDR(type)=','exten','alias','NoOp','No\x20alias\x20set','push','inbound','CDR(routeid)=','context','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','name','param','phone','prefix','SIP','join','options','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','*,*,*,*','intervals','map','tag','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','includes','app','appType'];(function(_0x283932,_0x54f315){var _0x5531a3=function(_0x2c6b16){while(--_0x2c6b16){_0x283932['push'](_0x283932['shift']());}};_0x5531a3(++_0x54f315);}(_0xeb17,0x165));var _0x7eb1=function(_0x4b59d3,_0x95ea6b){_0x4b59d3=_0x4b59d3-0x0;var _0x1a9d7d=_0xeb17[_0x4b59d3];return _0x1a9d7d;};'use strict';var _=require(_0x7eb1('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x7eb1('0x1')]=function(_0x23f2f2){var _0x2b0e9d=_0x23f2f2[_0x7eb1('0x2')];function _0x576fd5(_0x4b7354){var _0xc11960=0x2;var _0xd9f8cb=[{'type':_0x4b7354[_0x7eb1('0x3')],'app':_0x7eb1('0x4'),'appdata':_0x7eb1('0x5')+_0x4b7354['type'],'context':_0x4b7354['context'],'exten':_0x4b7354[_0x7eb1('0x6')],'priority':_0xc11960++,'VoiceExtensionId':_0x4b7354['id']},{'type':_0x4b7354[_0x7eb1('0x3')],'app':_0x4b7354[_0x7eb1('0x7')]?_0x7eb1('0x4'):_0x7eb1('0x8'),'appdata':_0x4b7354[_0x7eb1('0x7')]?'CDR(routeAlias)='+_0x4b7354['alias']:_0x7eb1('0x9'),'context':_0x4b7354['context'],'exten':_0x4b7354[_0x7eb1('0x6')],'priority':_0xc11960++,'VoiceExtensionId':_0x4b7354['id']}];if(_0x4b7354[_0x7eb1('0x3')]==='inbound'){_0xd9f8cb[_0x7eb1('0xa')]({'type':_0x7eb1('0xb'),'app':_0x7eb1('0x4'),'appdata':_0x7eb1('0xc')+_0x4b7354['id'],'context':_0x4b7354[_0x7eb1('0xd')],'exten':_0x4b7354[_0x7eb1('0x6')],'priority':_0xc11960++,'VoiceExtensionId':_0x4b7354['id']});}_0xd9f8cb['push']({'type':_0x4b7354[_0x7eb1('0x3')],'app':_0x7eb1('0x4'),'appdata':_0x7eb1('0xe'),'context':_0x4b7354[_0x7eb1('0xd')],'exten':_0x4b7354[_0x7eb1('0x6')],'priority':_0xc11960++,'VoiceExtensionId':_0x4b7354['id']},{'type':_0x4b7354[_0x7eb1('0x3')],'app':_0x7eb1('0x4'),'appdata':_0x7eb1('0xf'),'context':_0x4b7354['context'],'exten':_0x4b7354[_0x7eb1('0x6')],'priority':_0xc11960++,'VoiceExtensionId':_0x4b7354['id']},{'type':_0x4b7354[_0x7eb1('0x3')],'app':'Set','appdata':_0x7eb1('0x10'),'context':_0x4b7354['context'],'exten':_0x4b7354[_0x7eb1('0x6')],'priority':_0xc11960++,'VoiceExtensionId':_0x4b7354['id']});return _0xd9f8cb;}function _0x5097d3(_0x1d0c8b){var _0x2384dc=0x2;var _0x416008=[{'type':'outbound','app':'Set','appdata':'CDR(type)=outbound','context':_0x1d0c8b['context'],'exten':_0x1d0c8b[_0x7eb1('0x6')],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':_0x7eb1('0x11'),'app':_0x1d0c8b[_0x7eb1('0x7')]?_0x7eb1('0x4'):_0x7eb1('0x8'),'appdata':_0x1d0c8b[_0x7eb1('0x7')]?_0x7eb1('0x12')+_0x1d0c8b[_0x7eb1('0x7')]:'No\x20alias\x20set','context':_0x1d0c8b[_0x7eb1('0xd')],'exten':_0x1d0c8b[_0x7eb1('0x6')],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':'outbound','app':_0x7eb1('0x4'),'appdata':_0x7eb1('0x13')+(_0x1d0c8b[_0x7eb1('0x14')]?_0x7eb1('0x15')+_0x1d0c8b[_0x7eb1('0x14')]+'}':_0x7eb1('0x16')),'context':_0x1d0c8b['context'],'exten':_0x1d0c8b[_0x7eb1('0x6')],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':_0x7eb1('0x11'),'app':'Set','appdata':_0x7eb1('0xc')+_0x1d0c8b['id'],'context':_0x1d0c8b['context'],'exten':_0x1d0c8b[_0x7eb1('0x6')],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':_0x7eb1('0x11'),'app':_0x7eb1('0x17'),'appdata':_0x7eb1('0x18')+(_0x2384dc+0x2)+_0x7eb1('0x19')+(_0x2384dc+0x1)+')','context':_0x1d0c8b['context'],'exten':_0x1d0c8b[_0x7eb1('0x6')],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':_0x7eb1('0x11'),'app':_0x7eb1('0x4'),'appdata':_0x1d0c8b[_0x7eb1('0x14')]?_0x7eb1('0x1a')+_0x1d0c8b[_0x7eb1('0x14')]+'}':_0x7eb1('0x1b'),'context':_0x1d0c8b[_0x7eb1('0xd')],'exten':_0x1d0c8b[_0x7eb1('0x6')],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':_0x7eb1('0x11'),'app':_0x7eb1('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1d0c8b['context'],'exten':_0x1d0c8b['exten'],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':'outbound','app':_0x7eb1('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1d0c8b[_0x7eb1('0xd')],'exten':_0x1d0c8b[_0x7eb1('0x6')],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':_0x7eb1('0x11'),'app':_0x7eb1('0x4'),'appdata':_0x7eb1('0x10'),'context':_0x1d0c8b[_0x7eb1('0xd')],'exten':_0x1d0c8b[_0x7eb1('0x6')],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':_0x7eb1('0x11'),'app':_0x7eb1('0x4'),'appdata':_0x7eb1('0x1c')+_0x1d0c8b['id'],'context':_0x1d0c8b[_0x7eb1('0xd')],'exten':_0x1d0c8b['exten'],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']}];if(_0x1d0c8b[_0x7eb1('0x1d')]('recordingFormat')&&_0x1d0c8b[_0x7eb1('0x1e')]!=='none'){_0x416008[_0x7eb1('0xa')]({'type':_0x7eb1('0x11'),'app':_0x7eb1('0x4'),'appdata':_0x7eb1('0x1f'),'context':_0x1d0c8b[_0x7eb1('0xd')],'exten':_0x1d0c8b[_0x7eb1('0x6')],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']},{'type':_0x7eb1('0x11'),'app':_0x7eb1('0x4'),'appdata':_0x7eb1('0x20')+_0x1d0c8b[_0x7eb1('0x1e')]||_0x7eb1('0x21'),'context':_0x1d0c8b[_0x7eb1('0xd')],'exten':_0x1d0c8b['exten'],'priority':_0x2384dc++,'VoiceExtensionId':_0x1d0c8b['id']});}return _0x416008;}function _0x20e0e3(_0x8df3e5,_0x4ec39f){var _0x2e384b=[{'name':_0x7eb1('0x22'),'param':0x0},{'name':_0x7eb1('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':_0x7eb1('0x24'),'param':0x3}];var _0x3ca719={};var _0x184f64=_0x4ec39f[_0x7eb1('0x25')](',');var _0x54b2a8=[];for(var _0x3c62be=0x0;_0x3c62be<_0x2e384b[_0x7eb1('0x26')];_0x3c62be++){switch(_0x2e384b[_0x3c62be][_0x7eb1('0x27')]){case'trunk':_0x3ca719[_0x7eb1('0x22')]=_0x184f64[_0x2e384b[_0x3c62be][_0x7eb1('0x28')]][_0x7eb1('0x25')]('/')[0x1];_0x3ca719[_0x7eb1('0x29')]=_0x184f64[_0x2e384b[_0x3c62be][_0x7eb1('0x28')]][_0x7eb1('0x25')]('/')[0x2];_0x3ca719['prefix']=_0x3ca719[_0x7eb1('0x29')]?_0x3ca719[_0x7eb1('0x29')]['split']('$')[0x0]:undefined;_0x3ca719[_0x7eb1('0x29')]=_0x8df3e5[_0x7eb1('0x14')]?(_0x3ca719[_0x7eb1('0x2a')]||'')+_0x7eb1('0x15')+_0x8df3e5[_0x7eb1('0x14')]+'}':(_0x3ca719[_0x7eb1('0x2a')]||'')+'${EXTEN}';_0x54b2a8[_0x2e384b[_0x3c62be][_0x7eb1('0x28')]]=[_0x7eb1('0x2b'),_0x3ca719['trunk'],_0x3ca719[_0x7eb1('0x29')]][_0x7eb1('0x2c')]('/');break;case _0x7eb1('0x2d'):_0x3ca719[_0x7eb1('0x2d')]=_0x184f64[_0x2e384b[_0x3c62be]['param']];if(_0x8df3e5['recordingFormat']!==_0x7eb1('0x2e')){if(_0x3ca719[_0x7eb1('0x2d')][_0x7eb1('0x2f')]('U(xcally-mixmonitor-context)')<0x0){_0x3ca719[_0x7eb1('0x2d')]+=_0x7eb1('0x30');}}else{_0x3ca719[_0x7eb1('0x2d')]=_0x3ca719[_0x7eb1('0x2d')][_0x7eb1('0x31')]('U(xcally-mixmonitor-context)','');}_0x54b2a8[_0x2e384b[_0x3c62be][_0x7eb1('0x28')]]=_0x3ca719[_0x7eb1('0x2d')];break;default:_0x54b2a8[_0x2e384b[_0x3c62be][_0x7eb1('0x28')]]=_0x184f64[_0x2e384b[_0x3c62be]['param']];}}return _0x54b2a8['join'](',');}function _0x3691f9(_0x2c377d,_0xb5c169,_0x58c443){return new Promise(function(_0x4ccf25,_0x4415e8){var _0x6dac20=[];if(_[_0x7eb1('0x32')](_0xb5c169))return _0x4ccf25(_0x6dac20);_0x2b0e9d[_0x7eb1('0x33')]['findAll']({'attributes':['id',_0x7eb1('0x34'),_0x7eb1('0x35')],'raw':!![]})[_0x7eb1('0x36')](function(_0x33090a){for(var _0x3934b7=0x0,_0xf2683c=0x0;_0x3934b7<_0xb5c169[_0x7eb1('0x26')];_0x3934b7++,_0xf2683c=0x0){var _0x56b413=_0xb5c169[_0x3934b7];var _0x21dbe5=[];var _0x3b188e=[];delete _0x56b413['id'];if(_0x56b413[_0x7eb1('0x34')]!==_0x7eb1('0x37')){_0x56b413[_0x7eb1('0x38')]=[_0x56b413[_0x7eb1('0x34')]];}else{_0x56b413[_0x7eb1('0x38')]=_0x56b413[_0x7eb1('0x35')]?_[_0x7eb1('0x39')](_['filter'](_0x33090a,{'IntervalId':_0x56b413[_0x7eb1('0x35')]}),_0x7eb1('0x34')):[];}_0x56b413[_0x7eb1('0xd')]=_0x2c377d[_0x7eb1('0xd')];_0x56b413[_0x7eb1('0x6')]=_0x2c377d[_0x7eb1('0x6')];if(_0x56b413['type'])_0x56b413[_0x7eb1('0x3')]=_0x56b413[_0x7eb1('0x3')]['toLowerCase']();if(_0x2c377d[_0x7eb1('0x3')]==='outbound'){if(_0x56b413['hasOwnProperty'](_0x7eb1('0x3a'))&&_0x56b413['tag']&&_0x56b413['tag']!=='--'){_0x21dbe5[_0x7eb1('0xa')]({'type':_0x56b413['type'][_0x7eb1('0x3b')](),'app':_0x7eb1('0x4'),'appdata':'CDR(tag)='+_0x56b413['tag'],'context':_0x2c377d[_0x7eb1('0xd')],'exten':_0x2c377d[_0x7eb1('0x6')],'priority':_0x56b413[_0x7eb1('0x38')][_0x7eb1('0x26')]+_0x58c443+_0xf2683c++,'VoiceExtensionId':_0x2c377d['id']});}_0x21dbe5[_0x7eb1('0xa')]({'type':_0x56b413[_0x7eb1('0x3')][_0x7eb1('0x3b')](),'app':_0x7eb1('0x17'),'appdata':_0x7eb1('0x3c')+(_0x56b413[_0x7eb1('0x3d')]?_0x7eb1('0x3e')+_0x56b413[_0x7eb1('0x3d')]+')':_0x7eb1('0x3f')),'context':_0x2c377d['context'],'exten':_0x2c377d['exten'],'priority':_0x56b413[_0x7eb1('0x38')]['length']+_0x58c443+_0xf2683c++,'VoiceExtensionId':_0x2c377d['id']});}else{if(_0x56b413[_0x7eb1('0x1d')]('answer')){if([_0x7eb1('0x40'),'playback'][_0x7eb1('0x41')](_0x56b413[_0x7eb1('0x42')][_0x7eb1('0x3b')]())&&_0x56b413[_0x7eb1('0x43')]!=='custom'){if(_0x56b413['answer']){_0x21dbe5[_0x7eb1('0xa')]({'type':_0x56b413[_0x7eb1('0x3')]['toLowerCase'](),'app':_0x7eb1('0x17'),'appdata':_0x7eb1('0x44'),'context':_0x2c377d[_0x7eb1('0xd')],'exten':_0x2c377d['exten'],'priority':_0x56b413[_0x7eb1('0x38')]['length']+_0x58c443+_0xf2683c++,'VoiceExtensionId':_0x2c377d['id']});_0x21dbe5[_0x7eb1('0xa')]({'type':_0x56b413[_0x7eb1('0x3')][_0x7eb1('0x3b')](),'app':'Set','appdata':_0x7eb1('0x45'),'context':_0x2c377d[_0x7eb1('0xd')],'exten':_0x2c377d[_0x7eb1('0x6')],'priority':_0x56b413[_0x7eb1('0x38')][_0x7eb1('0x26')]+_0x58c443+_0xf2683c++,'VoiceExtensionId':_0x2c377d['id']});}else{_0x21dbe5[_0x7eb1('0xa')]({'type':_0x56b413[_0x7eb1('0x3')]['toLowerCase'](),'app':_0x7eb1('0x17'),'appdata':_0x7eb1('0x46'),'context':_0x2c377d['context'],'exten':_0x2c377d['exten'],'priority':_0x56b413[_0x7eb1('0x38')][_0x7eb1('0x26')]+_0x58c443+_0xf2683c++,'VoiceExtensionId':_0x2c377d['id']});_0x21dbe5[_0x7eb1('0xa')]({'type':_0x56b413['type'][_0x7eb1('0x3b')](),'app':_0x7eb1('0x4'),'appdata':_0x7eb1('0x47'),'context':_0x2c377d[_0x7eb1('0xd')],'exten':_0x2c377d[_0x7eb1('0x6')],'priority':_0x56b413[_0x7eb1('0x38')][_0x7eb1('0x26')]+_0x58c443+_0xf2683c++,'VoiceExtensionId':_0x2c377d['id']});}}}}for(var _0x1392e4=0x0;_0x1392e4<_0x56b413[_0x7eb1('0x38')]['length'];_0x1392e4++){var _0x24216c=_0x58c443+_0x56b413[_0x7eb1('0x38')][_0x7eb1('0x26')];var _0x74fb22=_0x1392e4===_0x56b413['intervals'][_0x7eb1('0x26')]-0x1?_0x58c443+_0x21dbe5[_0x7eb1('0x26')]+_0x3b188e['length']+0x2:_0x58c443+_0x1392e4+0x1;_0x21dbe5[_0x7eb1('0x48')](_0x1392e4,0x0,{'type':_0x2c377d[_0x7eb1('0x3')],'app':_0x7eb1('0x49'),'appdata':_0x56b413['intervals'][_0x1392e4]+'?'+_0x2c377d['context']+_0x7eb1('0x4a')+_0x24216c+':'+_0x2c377d[_0x7eb1('0xd')]+',${EXTEN},'+_0x74fb22,'exten':_0x2c377d[_0x7eb1('0x6')],'context':_0x2c377d[_0x7eb1('0xd')],'priority':_0x58c443+_0x1392e4,'VoiceExtensionId':_0x2c377d['id']});}if(_0x56b413['appType']===_0x7eb1('0x4b')){_0x56b413[_0x7eb1('0x4c')]=_0x20e0e3(_0x2c377d,_0x56b413['appdata']);}if(_0x56b413[_0x7eb1('0x43')]==='agi'){_0x21dbe5[_0x7eb1('0xa')]({'type':_0x56b413[_0x7eb1('0x3')][_0x7eb1('0x3b')](),'app':'Set','appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x2c377d[_0x7eb1('0xd')],'exten':_0x2c377d[_0x7eb1('0x6')],'priority':_0x56b413[_0x7eb1('0x38')][_0x7eb1('0x26')]+_0x58c443+_0xf2683c++,'VoiceExtensionId':_0x2c377d['id']});}_0x56b413[_0x7eb1('0x4d')]=_0x21dbe5[_0x7eb1('0x26')]?_[_0x7eb1('0x4e')](_0x21dbe5)[_0x7eb1('0x4d')]+0x1:_0x58c443;_0x6dac20=_[_0x7eb1('0x4f')](_0x6dac20,_0x21dbe5,[_0x56b413],_0x3b188e);_0x58c443=_['last'](_0x6dac20)['priority']+0x1;}return _0x4ccf25(_0x6dac20);})[_0x7eb1('0x50')](function(_0x11cb31){_0x4415e8(_0x11cb31);});});}return _0x23f2f2[_0x7eb1('0x51')]('VoiceExtension',attributes,{'tableName':_0x7eb1('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3a73ca){var _0xf80529=this[_0x7eb1('0x53')]({'plain':!![]});var _0x4037b3=_0xf80529['type']===_0x7eb1('0x11')?_0x5097d3(_0xf80529):_0x576fd5(_0xf80529);return _0x3691f9(_0xf80529,_0x3a73ca,_[_0x7eb1('0x4e')](_0x4037b3)['priority']+0x1)[_0x7eb1('0x36')](function(_0x4cecdb){var _0x3dccfb=_[_0x7eb1('0x4f')](_0x4037b3,_0x4cecdb);_0x3dccfb[_0x7eb1('0xa')]({'type':_0xf80529['type'],'app':_0x7eb1('0x54'),'exten':_0xf80529[_0x7eb1('0x6')],'context':_0xf80529[_0x7eb1('0xd')],'priority':_[_0x7eb1('0x4e')](_0x3dccfb)[_0x7eb1('0x4d')]+0x1,'VoiceExtensionId':_0xf80529['id']});return _0x3dccfb;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index b36219e..b9ca4a2 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 _0xd86a=['error','message','result','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','include','map','model','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x10bfa9,_0x2668df){var _0xc94cb0=function(_0x40fab0){while(--_0x40fab0){_0x10bfa9['push'](_0x10bfa9['shift']());}};_0xc94cb0(++_0x2668df);}(_0xd86a,0xf3));var _0xad86=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0xd86a[_0x2d2ca2];return _0x48489d;};'use strict';var _=require(_0xad86('0x0'));var util=require(_0xad86('0x1'));var moment=require(_0xad86('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad86('0x3'));var db=require(_0xad86('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xad86('0x5'));var config=require(_0xad86('0x6'));var jayson=require(_0xad86('0x7'));var client=jayson[_0xad86('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xad86('0x9')],{'host':_0xad86('0xa'),'port':0x18eb});var socket=require(_0xad86('0xb'))(new Redis(config[_0xad86('0x9')]));require(_0xad86('0xc'))[_0xad86('0xd')](socket);function respondWithRpcPromise(_0x3ff5c2,_0x58a7cc,_0x2f446f){return new BPromise(function(_0x382632,_0x378249){return client[_0xad86('0xe')](_0x3ff5c2,_0x2f446f)[_0xad86('0xf')](function(_0x5c87b4){logger[_0xad86('0x10')](_0xad86('0x11'),_0x58a7cc,'request\x20sent');logger[_0xad86('0x12')](_0xad86('0x13'),_0x58a7cc,'request\x20sent',JSON[_0xad86('0x14')](_0x5c87b4));if(_0x5c87b4['error']){if(_0x5c87b4[_0xad86('0x15')]['code']===0x1f4){logger[_0xad86('0x15')](_0xad86('0x11'),_0x58a7cc,_0x5c87b4['error'][_0xad86('0x16')]);return _0x378249(_0x5c87b4[_0xad86('0x15')]['message']);}logger[_0xad86('0x15')](_0xad86('0x11'),_0x58a7cc,_0x5c87b4[_0xad86('0x15')][_0xad86('0x16')]);return _0x382632(_0x5c87b4[_0xad86('0x15')][_0xad86('0x16')]);}else{logger[_0xad86('0x10')](_0xad86('0x11'),_0x58a7cc,'request\x20sent');_0x382632(_0x5c87b4[_0xad86('0x17')][_0xad86('0x16')]);}})['catch'](function(_0xe55083){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x58a7cc,_0xe55083);_0x378249(_0xe55083);});});}exports[_0xad86('0x18')]=function(_0x273e3b){var _0x17ff5a=this;return new Promise(function(_0x22ba56,_0x3447ab){return db[_0xad86('0x19')][_0xad86('0x1a')]({'raw':_0x273e3b['options']?_0x273e3b[_0xad86('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x273e3b['options']?_0x273e3b['options']['where']||null:null,'attributes':_0x273e3b['options']?_0x273e3b[_0xad86('0x1b')][_0xad86('0x1c')]||null:null,'limit':_0x273e3b['options']?_0x273e3b[_0xad86('0x1b')][_0xad86('0x1d')]||null:null,'include':_0x273e3b[_0xad86('0x1b')]?_0x273e3b[_0xad86('0x1b')][_0xad86('0x1e')]?_[_0xad86('0x1f')](_0x273e3b[_0xad86('0x1b')][_0xad86('0x1e')],function(_0xbf74fc){return{'model':db[_0xbf74fc['model']],'as':_0xbf74fc['as'],'attributes':_0xbf74fc[_0xad86('0x1c')],'include':_0xbf74fc[_0xad86('0x1e')]?_['map'](_0xbf74fc['include'],function(_0x8693f5){return{'model':db[_0x8693f5[_0xad86('0x20')]],'as':_0x8693f5['as'],'attributes':_0x8693f5[_0xad86('0x1c')],'include':_0x8693f5['include']?_[_0xad86('0x1f')](_0x8693f5['include'],function(_0x13d725){return{'model':db[_0x13d725[_0xad86('0x20')]],'as':_0x13d725['as'],'attributes':_0x13d725[_0xad86('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xad86('0xf')](function(_0x3f769b){logger[_0xad86('0x10')]('GetVoiceExtension',_0x273e3b);logger[_0xad86('0x12')](_0xad86('0x18'),_0x273e3b,JSON[_0xad86('0x14')](_0x3f769b));_0x22ba56(_0x3f769b);})['catch'](function(_0x453619){logger[_0xad86('0x15')](_0xad86('0x18'),_0x453619[_0xad86('0x16')],_0x273e3b);_0x3447ab(_0x17ff5a[_0xad86('0x15')](0x1f4,_0x453619['message']));});});}; \ No newline at end of file +var _0x5031=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','map','include','model','stringify','lodash','util','moment','bluebird'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x5031,0x144));var _0x1503=function(_0xf175f7,_0x49a9b2){_0xf175f7=_0xf175f7-0x0;var _0x3e49a0=_0x5031[_0xf175f7];return _0x3e49a0;};'use strict';var _=require(_0x1503('0x0'));var util=require(_0x1503('0x1'));var moment=require(_0x1503('0x2'));var BPromise=require(_0x1503('0x3'));var rs=require(_0x1503('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1503('0x5'));var logger=require(_0x1503('0x6'))(_0x1503('0x7'));var config=require(_0x1503('0x8'));var jayson=require(_0x1503('0x9'));var client=jayson[_0x1503('0xa')][_0x1503('0xb')]({'port':0x232a});config[_0x1503('0xc')]=_[_0x1503('0xd')](config['redis'],{'host':_0x1503('0xe'),'port':0x18eb});var socket=require(_0x1503('0xf'))(new Redis(config['redis']));require(_0x1503('0x10'))[_0x1503('0x11')](socket);function respondWithRpcPromise(_0x285307,_0xef165d,_0x3b056c){return new BPromise(function(_0x477fab,_0x32a232){return client[_0x1503('0x12')](_0x285307,_0x3b056c)[_0x1503('0x13')](function(_0x1bb027){logger['info'](_0x1503('0x14'),_0xef165d,_0x1503('0x15'));logger[_0x1503('0x16')](_0x1503('0x17'),_0xef165d,_0x1503('0x15'),JSON['stringify'](_0x1bb027));if(_0x1bb027[_0x1503('0x18')]){if(_0x1bb027[_0x1503('0x18')][_0x1503('0x19')]===0x1f4){logger[_0x1503('0x18')](_0x1503('0x14'),_0xef165d,_0x1bb027[_0x1503('0x18')][_0x1503('0x1a')]);return _0x32a232(_0x1bb027[_0x1503('0x18')][_0x1503('0x1a')]);}logger[_0x1503('0x18')](_0x1503('0x14'),_0xef165d,_0x1bb027[_0x1503('0x18')][_0x1503('0x1a')]);return _0x477fab(_0x1bb027[_0x1503('0x18')][_0x1503('0x1a')]);}else{logger[_0x1503('0x1b')](_0x1503('0x14'),_0xef165d,_0x1503('0x15'));_0x477fab(_0x1bb027[_0x1503('0x1c')]['message']);}})[_0x1503('0x1d')](function(_0x264b05){logger[_0x1503('0x18')](_0x1503('0x14'),_0xef165d,_0x264b05);_0x32a232(_0x264b05);});});}exports[_0x1503('0x1e')]=function(_0x501f7c){var _0x55058d=this;return new Promise(function(_0x4c69bc,_0x57a7ea){return db[_0x1503('0x1f')][_0x1503('0x20')]({'raw':_0x501f7c[_0x1503('0x21')]?_0x501f7c[_0x1503('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x501f7c[_0x1503('0x21')]?_0x501f7c[_0x1503('0x21')][_0x1503('0x22')]||null:null,'attributes':_0x501f7c[_0x1503('0x21')]?_0x501f7c[_0x1503('0x21')][_0x1503('0x23')]||null:null,'limit':_0x501f7c[_0x1503('0x21')]?_0x501f7c[_0x1503('0x21')][_0x1503('0x24')]||null:null,'include':_0x501f7c['options']?_0x501f7c[_0x1503('0x21')]['include']?_[_0x1503('0x25')](_0x501f7c[_0x1503('0x21')][_0x1503('0x26')],function(_0x223cf2){return{'model':db[_0x223cf2['model']],'as':_0x223cf2['as'],'attributes':_0x223cf2[_0x1503('0x23')],'include':_0x223cf2[_0x1503('0x26')]?_[_0x1503('0x25')](_0x223cf2[_0x1503('0x26')],function(_0x366d14){return{'model':db[_0x366d14[_0x1503('0x27')]],'as':_0x366d14['as'],'attributes':_0x366d14['attributes'],'include':_0x366d14[_0x1503('0x26')]?_[_0x1503('0x25')](_0x366d14[_0x1503('0x26')],function(_0xc5ccef){return{'model':db[_0xc5ccef[_0x1503('0x27')]],'as':_0xc5ccef['as'],'attributes':_0xc5ccef[_0x1503('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1503('0x13')](function(_0x2cb8fa){logger[_0x1503('0x1b')](_0x1503('0x1e'),_0x501f7c);logger['debug'](_0x1503('0x1e'),_0x501f7c,JSON[_0x1503('0x28')](_0x2cb8fa));_0x4c69bc(_0x2cb8fa);})[_0x1503('0x1d')](function(_0x53acd7){logger['error']('GetVoiceExtension',_0x53acd7[_0x1503('0x1a')],_0x501f7c);_0x57a7ea(_0x55058d['error'](0x1f4,_0x53acd7['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index edeaec7..9766fbb 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0xe82e26,_0x126b16){var _0x56f4d6=function(_0x244a1){while(--_0x244a1){_0xe82e26['push'](_0xe82e26['shift']());}};_0x56f4d6(++_0x126b16);}(_0xabce,0x103));var _0xeabc=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xabce[_0x3826ad];return _0x17b900;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x984265,_0x3e0cfa){var _0x16efe6=function(_0x12cdbe){while(--_0x12cdbe){_0x984265['push'](_0x984265['shift']());}};_0x16efe6(++_0x3e0cfa);}(_0xabce,0x103));var _0xeabc=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xabce[_0x34021d];return _0x16597b;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index bf2138f..f1a634a 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 _0xfcf0=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','put'];(function(_0x36bfe9,_0x4e69eb){var _0x175f0e=function(_0x5f08ac){while(--_0x5f08ac){_0x36bfe9['push'](_0x36bfe9['shift']());}};_0x175f0e(++_0x4e69eb);}(_0xfcf0,0x138));var _0x0fcf=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xfcf0[_0xaa6a4];return _0xdc31a4;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x10')]('/',auth[_0x0fcf('0xa')](),controller['create']);router[_0x0fcf('0x11')]('/:id',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x12')]);router[_0x0fcf('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x0fcf('0x14')]);module[_0x0fcf('0x15')]=router; \ No newline at end of file +var _0x7b84=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3240ba,_0x4ebc6a){var _0x2fe5a7=function(_0x528076){while(--_0x528076){_0x3240ba['push'](_0x3240ba['shift']());}};_0x2fe5a7(++_0x4ebc6a);}(_0x7b84,0x17c));var _0x47b8=function(_0x48addc,_0x48c4aa){_0x48addc=_0x48addc-0x0;var _0x1e5094=_0x7b84[_0x48addc];return _0x1e5094;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0x11')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0x13')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);router[_0x47b8('0x15')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x16')]);module[_0x47b8('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 5ece40f..a56101c 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 _0xc48b=['mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','getDataValue','fullname'];(function(_0x1cb9ab,_0x2efaf7){var _0x480bf8=function(_0x5f3dc1){while(--_0x5f3dc1){_0x1cb9ab['push'](_0x1cb9ab['shift']());}};_0x480bf8(++_0x2efaf7);}(_0xc48b,0x88));var _0xbc48=function(_0x1c3331,_0x49ecd7){_0x1c3331=_0x1c3331-0x0;var _0x4a2b9f=_0xc48b[_0x1c3331];return _0x4a2b9f;};'use strict';var Sequelize=require(_0xbc48('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xbc48('0x1')]},'context':{'type':Sequelize[_0xbc48('0x1')],'defaultValue':_0xbc48('0x2'),'unique':_0xbc48('0x3')},'mailbox':{'type':Sequelize[_0xbc48('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xbc48('0x1')]},'fullname':{'type':Sequelize[_0xbc48('0x1')]},'email':{'type':Sequelize[_0xbc48('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3847ba){this[_0xbc48('0x4')]('email',typeof _0x3847ba===_0xbc48('0x5')&&_0x3847ba[_0xbc48('0x6')]()?_0x3847ba['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xbc48('0x1')],'defaultValue':_0xbc48('0x7')},'attach':{'type':Sequelize[_0xbc48('0x8')]('yes','no'),'defaultValue':_0xbc48('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xbc48('0x8')](_0xbc48('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xbc48('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xbc48('0x8')](_0xbc48('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xbc48('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xbc48('0x8')](_0xbc48('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xbc48('0x8')](_0xbc48('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xbc48('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xbc48('0x8')](_0xbc48('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xbc48('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xbc48('0x8')](_0xbc48('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xbc48('0x8')](_0xbc48('0x9'),'no'),'defaultValue':_0xbc48('0x9'),'allowNull':![]},'stamp':{'type':_0xbc48('0xa')},'emailsubject':{'type':Sequelize[_0xbc48('0x1')]},'emailbody':{'type':Sequelize[_0xbc48('0x1')]},'maxsecs':{'type':Sequelize[_0xbc48('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xbc48('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xbc48('0xc')](_0xbc48('0xd'))+'\x20-\x20'+this[_0xbc48('0xc')](_0xbc48('0xe'));}}}; \ No newline at end of file +var _0x8535=['email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','setDataValue'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0x8535,0x109));var _0x5853=function(_0x538744,_0x4c3573){_0x538744=_0x538744-0x0;var _0x485407=_0x8535[_0x538744];return _0x485407;};'use strict';var Sequelize=require(_0x5853('0x0'));module[_0x5853('0x1')]={'customer_id':{'type':Sequelize[_0x5853('0x2')]},'context':{'type':Sequelize[_0x5853('0x2')],'defaultValue':_0x5853('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x5853('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5853('0x2')],'validate':{'isEmail':!![]},'set':function(_0x3b2509){this[_0x5853('0x4')](_0x5853('0x5'),typeof _0x3b2509==='string'&&_0x3b2509['trim']()?_0x3b2509[_0x5853('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x5853('0x2')],'defaultValue':_0x5853('0x7')},'attach':{'type':Sequelize[_0x5853('0x8')](_0x5853('0x9'),'no'),'defaultValue':_0x5853('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x5853('0x9'),'no'),'defaultValue':_0x5853('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x5853('0x2')]},'callback':{'type':Sequelize[_0x5853('0x2')]},'review':{'type':Sequelize[_0x5853('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x5853('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5853('0x8')](_0x5853('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x5853('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5853('0x8')](_0x5853('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5853('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5853('0x8')]('yes','no'),'defaultValue':_0x5853('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5853('0x8')](_0x5853('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5853('0x8')](_0x5853('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5853('0x8')](_0x5853('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x5853('0xb')},'emailsubject':{'type':Sequelize[_0x5853('0x2')]},'emailbody':{'type':Sequelize[_0x5853('0x2')]},'maxsecs':{'type':Sequelize[_0x5853('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5853('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5853('0xd')],'get':function(){return this['getDataValue'](_0x5853('0xe'))+_0x5853('0xf')+this[_0x5853('0x10')](_0x5853('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 24031ca..b8f483f 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 _0x5eb8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','VoiceMail','findAll','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','VoiceMailMessage','pick','filter','mailbox'];(function(_0x1c9b8e,_0x444821){var _0x35a635=function(_0x4c40f6){while(--_0x4c40f6){_0x1c9b8e['push'](_0x1c9b8e['shift']());}};_0x35a635(++_0x444821);}(_0x5eb8,0xb0));var _0x85eb=function(_0x77d76e,_0x106ed2){_0x77d76e=_0x77d76e-0x0;var _0x5620c8=_0x5eb8[_0x77d76e];return _0x5620c8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];function respondWithStatusCode(_0x784583,_0x2f42ba){_0x2f42ba=_0x2f42ba||0xcc;return function(_0x259f72){if(_0x259f72){return _0x784583['sendStatus'](_0x2f42ba);}return _0x784583['status'](_0x2f42ba)[_0x85eb('0x19')]();};}function respondWithResult(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xc8;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1a')](_0x18ca53)[_0x85eb('0x1b')](_0x23a82a);}};}function respondWithFilteredResult(_0x183b0c,_0x49efdf){return function(_0x2e5c0a){if(_0x2e5c0a){var _0x59237b=typeof _0x49efdf[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x49efdf[_0x85eb('0x1e')]===_0x85eb('0x1d');var _0x5dbeda=_0x2e5c0a['count'];var _0x50d2a8=_0x59237b?0x0:_0x49efdf[_0x85eb('0x1c')];var _0x39ca96=_0x59237b?_0x2e5c0a[_0x85eb('0x1f')]:_0x49efdf[_0x85eb('0x1c')]+_0x49efdf[_0x85eb('0x1e')];var _0x34f875;if(_0x39ca96>=_0x5dbeda){_0x39ca96=_0x5dbeda;_0x34f875=0xc8;}else{_0x34f875=0xce;}_0x183b0c['status'](_0x34f875);return _0x183b0c[_0x85eb('0x20')](_0x85eb('0x21'),_0x50d2a8+'-'+_0x39ca96+'/'+_0x5dbeda)[_0x85eb('0x1b')](_0x2e5c0a);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x22')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x23')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x24')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x25')]()[_0x85eb('0x26')](function(){var _0x312b3e=_0x1426c8[_0x85eb('0x27')]({'plain':!![]});var _0x5dfc96=_0x85eb('0x28');return db[_0x85eb('0x29')][_0x85eb('0x25')]({'where':{'type':_0x5dfc96,'resourceId':_0x312b3e['id']}})[_0x85eb('0x26')](function(){return _0x1426c8;});})[_0x85eb('0x26')](function(){_0x5b48d9['status'](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x792d3a,_0x291557){return function(_0x3e7eb9){if(!_0x3e7eb9){_0x792d3a[_0x85eb('0x2a')](0x194);}return _0x3e7eb9;};}function handleError(_0x29d262,_0x50541a){_0x50541a=_0x50541a||0x1f4;return function(_0x562792){logger[_0x85eb('0x2b')](_0x562792['stack']);if(_0x562792[_0x85eb('0x2c')]){delete _0x562792['name'];}_0x29d262[_0x85eb('0x1a')](_0x50541a)[_0x85eb('0x2d')](_0x562792);};}exports[_0x85eb('0x2e')]=function(_0x1d9278,_0xa67e1c){var _0xf4ac13={},_0x41ed76={},_0x5decd5={'count':0x0,'rows':[]};var _0x237f19=_[_0x85eb('0x2f')](db['VoiceMail'][_0x85eb('0x30')],function(_0x5af2de){return{'name':_0x5af2de['fieldName'],'type':_0x5af2de[_0x85eb('0x31')][_0x85eb('0x32')]};});_0x41ed76[_0x85eb('0x33')]=_[_0x85eb('0x2f')](_0x237f19,_0x85eb('0x2c'));_0x41ed76[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x1d9278[_0x85eb('0x34')]);_0x41ed76[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x41ed76['model'],_0x41ed76[_0x85eb('0x34')]);_0xf4ac13[_0x85eb('0x38')]=_['intersection'](_0x41ed76['model'],qs[_0x85eb('0x39')](_0x1d9278[_0x85eb('0x34')][_0x85eb('0x39')]));_0xf4ac13[_0x85eb('0x38')]=_0xf4ac13[_0x85eb('0x38')][_0x85eb('0x3a')]?_0xf4ac13[_0x85eb('0x38')]:_0x41ed76[_0x85eb('0x33')];if(!_0x1d9278[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0xf4ac13[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x1d9278[_0x85eb('0x34')]['limit']);_0xf4ac13[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x1d9278['query']['offset']);}_0xf4ac13[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x1d9278['query'][_0x85eb('0x3e')]);_0xf4ac13['where']=qs[_0x85eb('0x36')](_['pick'](_0x1d9278[_0x85eb('0x34')],_0x41ed76['filters']),_0x237f19);if(_0x1d9278[_0x85eb('0x34')]['filter']){_0xf4ac13[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0xf4ac13['where'],{'$or':_[_0x85eb('0x2f')](_0x237f19,function(_0x5a1c15){if(_0x5a1c15[_0x85eb('0x31')]!==_0x85eb('0x41')){var _0x5c0156={};_0x5c0156[_0x5a1c15[_0x85eb('0x2c')]]={'$like':'%'+_0x1d9278['query']['filter']+'%'};return _0x5c0156;}})});}_0xf4ac13=_[_0x85eb('0x40')]({},_0xf4ac13,_0x1d9278['options']);var _0x17cc20={'where':_0xf4ac13[_0x85eb('0x3f')]};return db['VoiceMail']['count'](_0x17cc20)[_0x85eb('0x26')](function(_0x422ec3){_0x5decd5['count']=_0x422ec3;if(_0x1d9278['query'][_0x85eb('0x42')]){_0xf4ac13[_0x85eb('0x43')]=[{'all':!![]}];}return db[_0x85eb('0x44')][_0x85eb('0x45')](_0xf4ac13);})[_0x85eb('0x26')](function(_0x5b7411){_0x5decd5[_0x85eb('0x46')]=_0x5b7411;return _0x5decd5;})[_0x85eb('0x26')](respondWithFilteredResult(_0xa67e1c,_0xf4ac13))[_0x85eb('0x47')](handleError(_0xa67e1c,null));};exports[_0x85eb('0x48')]=function(_0x2ed39d,_0xbc43a7){var _0x40e2a2={'raw':!![],'where':{'id':_0x2ed39d[_0x85eb('0x49')]['id']}},_0x3e11a8={};_0x3e11a8['model']=_[_0x85eb('0x35')](db[_0x85eb('0x44')]['rawAttributes']);_0x3e11a8[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x2ed39d[_0x85eb('0x34')]);_0x3e11a8[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],_0x3e11a8['query']);_0x40e2a2[_0x85eb('0x38')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x39')]));_0x40e2a2[_0x85eb('0x38')]=_0x40e2a2[_0x85eb('0x38')]['length']?_0x40e2a2[_0x85eb('0x38')]:_0x3e11a8[_0x85eb('0x33')];if(_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x42')]){_0x40e2a2[_0x85eb('0x43')]=[{'all':!![]}];}_0x40e2a2=_[_0x85eb('0x40')]({},_0x40e2a2,_0x2ed39d[_0x85eb('0x4a')]);return db[_0x85eb('0x44')][_0x85eb('0x4b')](_0x40e2a2)[_0x85eb('0x26')](handleEntityNotFound(_0xbc43a7,null))[_0x85eb('0x26')](respondWithResult(_0xbc43a7,null))[_0x85eb('0x47')](handleError(_0xbc43a7,null));};exports['create']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x44')]['create'](_0x11da79[_0x85eb('0x4c')],{})[_0x85eb('0x26')](function(_0x2cf928){var _0xd2f302=_0x11da79[_0x85eb('0x4d')]['get']({'plain':!![]});if(!_0xd2f302)throw new Error(_0x85eb('0x4e'));if(_0xd2f302[_0x85eb('0x4f')]===_0x85eb('0x4d')){var _0x50e264=_0x2cf928[_0x85eb('0x27')]({'plain':!![]});var _0x4550fd=_0x85eb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4550fd,'userProfileId':_0xd2f302[_0x85eb('0x50')]},'raw':!![]})['then'](function(_0x5ed98a){if(_0x5ed98a&&_0x5ed98a[_0x85eb('0x51')]===0x0){return db['UserProfileResource'][_0x85eb('0x52')]({'name':_0x50e264[_0x85eb('0x2c')],'resourceId':_0x50e264['id'],'type':_0x5ed98a['name'],'sectionId':_0x5ed98a['id']},{})['then'](function(){return _0x2cf928;});}else{return _0x2cf928;}})[_0x85eb('0x47')](function(_0x249511){logger[_0x85eb('0x2b')](_0x85eb('0x53'),_0x249511);throw _0x249511;});}return _0x2cf928;})[_0x85eb('0x26')](respondWithResult(_0x2c951b,0xc9))['catch'](handleError(_0x2c951b,null));};exports[_0x85eb('0x24')]=function(_0x30062e,_0x270bb2){if(_0x30062e[_0x85eb('0x4c')]['id']){delete _0x30062e[_0x85eb('0x4c')]['id'];}return db['VoiceMail'][_0x85eb('0x4b')]({'where':{'id':_0x30062e['params']['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x270bb2,null))[_0x85eb('0x26')](saveUpdates(_0x30062e['body'],null))[_0x85eb('0x26')](respondWithResult(_0x270bb2,null))[_0x85eb('0x47')](handleError(_0x270bb2,null));};exports[_0x85eb('0x25')]=function(_0x26e04a,_0x214ef7){return db[_0x85eb('0x44')]['find']({'where':{'id':_0x26e04a[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x214ef7,null))[_0x85eb('0x26')](removeEntity(_0x214ef7,null))[_0x85eb('0x47')](handleError(_0x214ef7,null));};exports['getMessages']=function(_0x152452,_0x2a0f8b,_0x4a3af9){return db[_0x85eb('0x44')]['findOne']({'where':{'id':_0x152452[_0x85eb('0x49')]['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x2a0f8b,null))[_0x85eb('0x26')](function(_0x13c0b3){var _0x45a201;var _0x15d4a7={},_0x5a729e={};_0x5a729e[_0x85eb('0x33')]=_[_0x85eb('0x35')](db[_0x85eb('0x54')][_0x85eb('0x30')]);_0x5a729e[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x152452[_0x85eb('0x34')]);_0x5a729e[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],_0x5a729e[_0x85eb('0x34')]);_0x15d4a7['attributes']=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x152452[_0x85eb('0x34')][_0x85eb('0x39')]));_0x15d4a7[_0x85eb('0x38')]=_0x15d4a7['attributes'][_0x85eb('0x3a')]?_0x15d4a7['attributes']:_0x5a729e[_0x85eb('0x33')];if(!_0x152452[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0x15d4a7[_0x85eb('0x1e')]=qs['limit'](_0x152452[_0x85eb('0x34')][_0x85eb('0x1e')]);_0x15d4a7[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x152452[_0x85eb('0x34')][_0x85eb('0x1c')]);}_0x15d4a7[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x152452['query'][_0x85eb('0x3e')]);_0x15d4a7['where']=qs[_0x85eb('0x36')](_[_0x85eb('0x55')](_0x152452[_0x85eb('0x34')],_0x5a729e[_0x85eb('0x36')]));if(_0x152452[_0x85eb('0x34')]['filter']){_0x15d4a7[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'$or':_[_0x85eb('0x2f')](_0x15d4a7[_0x85eb('0x38')],function(_0x419b24){var _0x562ffa={};_0x562ffa[_0x419b24]={'$like':'%'+_0x152452['query'][_0x85eb('0x56')]+'%'};return _0x562ffa;})});}_0x15d4a7['where']=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'mailboxuser':_0x13c0b3[_0x85eb('0x57')]});_0x15d4a7=_[_0x85eb('0x40')]({},_0x15d4a7,_0x152452[_0x85eb('0x4a')]);return db[_0x85eb('0x54')]['findAndCountAll'](_0x15d4a7)[_0x85eb('0x26')](respondWithFilteredResult(_0x2a0f8b,_0x15d4a7));})[_0x85eb('0x47')](handleError(_0x2a0f8b,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(_0x103c4c,_0x285348){var _0x3fc15e=function(_0x40e0e6){while(--_0x40e0e6){_0x103c4c['push'](_0x103c4c['shift']());}};_0x3fc15e(++_0x285348);}(_0x750a,0x140));var _0xa750=function(_0x37ca56,_0x58c108){_0x37ca56=_0x37ca56-0x0;var _0x1b5bd8=_0x750a[_0x37ca56];return _0x1b5bd8;};'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 77497d4..c601d44 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 _0x8d3b=['rimraf','./voiceMail.attributes','exports','VoiceMail','mailbox_context','mailbox','context','util','../../config/logger','api','moment','bluebird','path'];(function(_0x26e624,_0x5f42e3){var _0x4112c9=function(_0x504dab){while(--_0x504dab){_0x26e624['push'](_0x26e624['shift']());}};_0x4112c9(++_0x5f42e3);}(_0x8d3b,0x1a7));var _0xb8d3=function(_0x25885c,_0x461da6){_0x25885c=_0x25885c-0x0;var _0x3a6e9c=_0x8d3b[_0x25885c];return _0x3a6e9c;};'use strict';var _=require('lodash');var util=require(_0xb8d3('0x0'));var logger=require(_0xb8d3('0x1'))(_0xb8d3('0x2'));var moment=require(_0xb8d3('0x3'));var BPromise=require(_0xb8d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8d3('0x5'));var rimraf=require(_0xb8d3('0x6'));var config=require('../../config/environment');var attributes=require(_0xb8d3('0x7'));module[_0xb8d3('0x8')]=function(_0x42569f,_0x1d1d1a){return _0x42569f['define'](_0xb8d3('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xb8d3('0xa'),'fields':[_0xb8d3('0xb'),_0xb8d3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x89c0=['exports','mailbox','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x43c3f9,_0x1861cb){var _0x4f4f54=function(_0x53ac81){while(--_0x53ac81){_0x43c3f9['push'](_0x43c3f9['shift']());}};_0x4f4f54(++_0x1861cb);}(_0x89c0,0x173));var _0x089c=function(_0xf35556,_0x4a66d7){_0xf35556=_0xf35556-0x0;var _0x50d811=_0x89c0[_0xf35556];return _0x50d811;};'use strict';var _=require(_0x089c('0x0'));var util=require('util');var logger=require(_0x089c('0x1'))(_0x089c('0x2'));var moment=require(_0x089c('0x3'));var BPromise=require('bluebird');var rp=require(_0x089c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x089c('0x5'));var config=require(_0x089c('0x6'));var attributes=require('./voiceMail.attributes');module[_0x089c('0x7')]=function(_0x4cfe82,_0xc6c193){return _0x4cfe82['define']('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x089c('0x8'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 5204714..5eb8328 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 _0x36fe=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xfb86c9,_0x5beb16){var _0x48fa5a=function(_0x45347f){while(--_0x45347f){_0xfb86c9['push'](_0xfb86c9['shift']());}};_0x48fa5a(++_0x5beb16);}(_0x36fe,0x186));var _0xe36f=function(_0x57a5e5,_0x18b0d6){_0x57a5e5=_0x57a5e5-0x0;var _0x354012=_0x36fe[_0x57a5e5];return _0x354012;};'use strict';var _=require(_0xe36f('0x0'));var util=require('util');var moment=require(_0xe36f('0x1'));var BPromise=require(_0xe36f('0x2'));var rs=require(_0xe36f('0x3'));var fs=require('fs');var Redis=require(_0xe36f('0x4'));var db=require(_0xe36f('0x5'))['db'];var utils=require(_0xe36f('0x6'));var logger=require(_0xe36f('0x7'))(_0xe36f('0x8'));var config=require(_0xe36f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe36f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5abdc8,_0x56f93a,_0x36017f){return new BPromise(function(_0x321c2f,_0x29c0e6){return client[_0xe36f('0xb')](_0x5abdc8,_0x36017f)[_0xe36f('0xc')](function(_0x1b9435){logger['info'](_0xe36f('0xd'),_0x56f93a,_0xe36f('0xe'));logger[_0xe36f('0xf')](_0xe36f('0x10'),_0x56f93a,'request\x20sent',JSON[_0xe36f('0x11')](_0x1b9435));if(_0x1b9435[_0xe36f('0x12')]){if(_0x1b9435[_0xe36f('0x12')]['code']===0x1f4){logger['error'](_0xe36f('0xd'),_0x56f93a,_0x1b9435['error'][_0xe36f('0x13')]);return _0x29c0e6(_0x1b9435[_0xe36f('0x12')][_0xe36f('0x13')]);}logger['error'](_0xe36f('0xd'),_0x56f93a,_0x1b9435[_0xe36f('0x12')]['message']);return _0x321c2f(_0x1b9435['error'][_0xe36f('0x13')]);}else{logger[_0xe36f('0x14')](_0xe36f('0xd'),_0x56f93a,_0xe36f('0xe'));_0x321c2f(_0x1b9435[_0xe36f('0x15')][_0xe36f('0x13')]);}})['catch'](function(_0x37ee1e){logger[_0xe36f('0x12')](_0xe36f('0xd'),_0x56f93a,_0x37ee1e);_0x29c0e6(_0x37ee1e);});});} \ No newline at end of file +var _0xe8ba=['rpc','../../config/environment','jayson/promise','client','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/logger'];(function(_0x3b5879,_0x246fd3){var _0x1bf70f=function(_0x23cf29){while(--_0x23cf29){_0x3b5879['push'](_0x3b5879['shift']());}};_0x1bf70f(++_0x246fd3);}(_0xe8ba,0x112));var _0xae8b=function(_0x9a97ae,_0x2eaf94){_0x9a97ae=_0x9a97ae-0x0;var _0x5f1653=_0xe8ba[_0x9a97ae];return _0x5f1653;};'use strict';var _=require(_0xae8b('0x0'));var util=require(_0xae8b('0x1'));var moment=require(_0xae8b('0x2'));var BPromise=require(_0xae8b('0x3'));var rs=require(_0xae8b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xae8b('0x5'))(_0xae8b('0x6'));var config=require(_0xae8b('0x7'));var jayson=require(_0xae8b('0x8'));var client=jayson[_0xae8b('0x9')][_0xae8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50bed3,_0x211dc9,_0x33bda6){return new BPromise(function(_0xf6bdbf,_0x362d08){return client['request'](_0x50bed3,_0x33bda6)['then'](function(_0x2a08ba){logger[_0xae8b('0xb')](_0xae8b('0xc'),_0x211dc9,_0xae8b('0xd'));logger[_0xae8b('0xe')](_0xae8b('0xf'),_0x211dc9,_0xae8b('0xd'),JSON['stringify'](_0x2a08ba));if(_0x2a08ba[_0xae8b('0x10')]){if(_0x2a08ba[_0xae8b('0x10')][_0xae8b('0x11')]===0x1f4){logger[_0xae8b('0x10')](_0xae8b('0xc'),_0x211dc9,_0x2a08ba[_0xae8b('0x10')][_0xae8b('0x12')]);return _0x362d08(_0x2a08ba[_0xae8b('0x10')][_0xae8b('0x12')]);}logger['error'](_0xae8b('0xc'),_0x211dc9,_0x2a08ba[_0xae8b('0x10')][_0xae8b('0x12')]);return _0xf6bdbf(_0x2a08ba[_0xae8b('0x10')]['message']);}else{logger[_0xae8b('0xb')]('VoiceMail,\x20%s,\x20%s',_0x211dc9,_0xae8b('0xd'));_0xf6bdbf(_0x2a08ba['result'][_0xae8b('0x12')]);}})[_0xae8b('0x13')](function(_0x36071e){logger[_0xae8b('0x10')](_0xae8b('0xc'),_0x211dc9,_0x36071e);_0x362d08(_0x36071e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9b1a8cd..f6bab48 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 _0x29b9=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','download','post','create','put','/:id','delete','destroy','exports','multer','connect-timeout'];(function(_0xa7f815,_0x1dc996){var _0x3e52d8=function(_0x27afbd){while(--_0x27afbd){_0xa7f815['push'](_0xa7f815['shift']());}};_0x3e52d8(++_0x1dc996);}(_0x29b9,0x154));var _0x929b=function(_0x4d95a6,_0x1f4a03){_0x4d95a6=_0x4d95a6-0x0;var _0x4855a5=_0x29b9[_0x4d95a6];return _0x4855a5;};'use strict';var multer=require(_0x929b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x929b('0x1'));var express=require(_0x929b('0x2'));var router=express[_0x929b('0x3')]();var fs_extra=require(_0x929b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x929b('0x5'));var config=require(_0x929b('0x6'));var controller=require('./voiceMailMessage.controller');router[_0x929b('0x7')]('/',auth['isAuthenticated'](),controller[_0x929b('0x8')]);router['get']('/:id',auth[_0x929b('0x9')](),controller['show']);router[_0x929b('0x7')]('/:id/download',auth[_0x929b('0x9')](),controller[_0x929b('0xa')]);router[_0x929b('0xb')]('/',auth[_0x929b('0x9')](),controller[_0x929b('0xc')]);router[_0x929b('0xd')](_0x929b('0xe'),auth[_0x929b('0x9')](),controller['update']);router[_0x929b('0xf')](_0x929b('0xe'),auth[_0x929b('0x9')](),controller[_0x929b('0x10')]);module[_0x929b('0x11')]=router; \ No newline at end of file +var _0xba7b=['Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','put','update','exports','multer','util','connect-timeout','express'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xba7b,0x1e2));var _0xbba7=function(_0x164c32,_0x555ec0){_0x164c32=_0x164c32-0x0;var _0x27a832=_0xba7b[_0x164c32];return _0x27a832;};'use strict';var multer=require(_0xbba7('0x0'));var util=require(_0xbba7('0x1'));var path=require('path');var timeout=require(_0xbba7('0x2'));var express=require(_0xbba7('0x3'));var router=express[_0xbba7('0x4')]();var fs_extra=require(_0xbba7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbba7('0x6'));var config=require('../../config/environment');var controller=require(_0xbba7('0x7'));router[_0xbba7('0x8')]('/',auth[_0xbba7('0x9')](),controller['index']);router[_0xbba7('0x8')](_0xbba7('0xa'),auth[_0xbba7('0x9')](),controller[_0xbba7('0xb')]);router['get'](_0xbba7('0xc'),auth[_0xbba7('0x9')](),controller[_0xbba7('0xd')]);router[_0xbba7('0xe')]('/',auth[_0xbba7('0x9')](),controller['create']);router[_0xbba7('0xf')]('/:id',auth[_0xbba7('0x9')](),controller[_0xbba7('0x10')]);router['delete'](_0xbba7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xbba7('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 2c08b92..4f215e1 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 _0xf0f8=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x18b0ef,_0xdcc8b2){var _0x2efe01=function(_0x1cae64){while(--_0x1cae64){_0x18b0ef['push'](_0x18b0ef['shift']());}};_0x2efe01(++_0xdcc8b2);}(_0xf0f8,0x1ba));var _0x8f0f=function(_0x208d1c,_0x430e00){_0x208d1c=_0x208d1c-0x0;var _0x573991=_0xf0f8[_0x208d1c];return _0x573991;};'use strict';var Sequelize=require('sequelize');module[_0x8f0f('0x0')]={'name':{'type':Sequelize[_0x8f0f('0x1')],'get':function(_0x245cd6){return this[_0x8f0f('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x8f0f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8f0f('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x8f0f('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x8f0f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8f0f('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x8f0f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x8f0f('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8f0f('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x8f0f('0x5')](_0x8f0f('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x8f0f('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8f0f('0x4')],'defaultValue':''},'stamp':{'type':_0x8f0f('0x7'),'defaultValue':Sequelize[_0x8f0f('0x8')](_0x8f0f('0x9'))}}; \ No newline at end of file +var _0x60d0=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','getDataValue','STRING','BLOB'];(function(_0x4d6efb,_0x30d83c){var _0x35d839=function(_0x5ade95){while(--_0x5ade95){_0x4d6efb['push'](_0x4d6efb['shift']());}};_0x35d839(++_0x30d83c);}(_0x60d0,0xec));var _0x060d=function(_0x47d05a,_0x48f75c){_0x47d05a=_0x47d05a-0x0;var _0x2d3f53=_0x60d0[_0x47d05a];return _0x2d3f53;};'use strict';var Sequelize=require('sequelize');module[_0x060d('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b995d){return this[_0x060d('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x060d('0x2')],'defaultValue':''},'context':{'type':Sequelize[_0x060d('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x060d('0x2')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x060d('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x060d('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x060d('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x060d('0x2')],'defaultValue':''},'recording':{'type':Sequelize[_0x060d('0x3')](_0x060d('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x060d('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x060d('0x2')],'defaultValue':''},'stamp':{'type':_0x060d('0x5'),'defaultValue':Sequelize[_0x060d('0x6')](_0x060d('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 2e39e46..4e97fb2 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 _0x813f=['length','find','create','body','update','params','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','end','sendStatus','error','stack','name','index','map','VoiceMailMessage','fieldName','type','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes'];(function(_0x2ffe71,_0x488129){var _0x35d657=function(_0x33da48){while(--_0x33da48){_0x2ffe71['push'](_0x2ffe71['shift']());}};_0x35d657(++_0x488129);}(_0x813f,0x179));var _0xf813=function(_0x2d6ebc,_0x370b3c){_0x2d6ebc=_0x2d6ebc-0x0;var _0x36668c=_0x813f[_0x2d6ebc];return _0x36668c;};'use strict';var emlformat=require(_0xf813('0x0'));var rimraf=require(_0xf813('0x1'));var zipdir=require(_0xf813('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf813('0x3'));var moment=require(_0xf813('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf813('0x5'));var util=require(_0xf813('0x6'));var path=require(_0xf813('0x7'));var sox=require(_0xf813('0x8'));var csv=require('to-csv');var ejs=require(_0xf813('0x9'));var fs=require('fs');var fs_extra=require(_0xf813('0xa'));var _=require(_0xf813('0xb'));var squel=require(_0xf813('0xc'));var crypto=require(_0xf813('0xd'));var jsforce=require(_0xf813('0xe'));var deskjs=require(_0xf813('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf813('0x10'));var Papa=require(_0xf813('0x11'));var Redis=require(_0xf813('0x12'));var authService=require(_0xf813('0x13'));var qs=require(_0xf813('0x14'));var as=require(_0xf813('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf813('0x16'))(_0xf813('0x17'));var utils=require('../../config/utils');var config=require(_0xf813('0x18'));var licenseUtil=require(_0xf813('0x19'));var db=require(_0xf813('0x1a'))['db'];function respondWithStatusCode(_0x21841f,_0x4f9a07){_0x4f9a07=_0x4f9a07||0xcc;return function(_0x29f7ef){if(_0x29f7ef){return _0x21841f['sendStatus'](_0x4f9a07);}return _0x21841f[_0xf813('0x1b')](_0x4f9a07)['end']();};}function respondWithResult(_0x450e22,_0x4bd36d){_0x4bd36d=_0x4bd36d||0xc8;return function(_0x2e459e){if(_0x2e459e){return _0x450e22[_0xf813('0x1b')](_0x4bd36d)[_0xf813('0x1c')](_0x2e459e);}};}function respondWithFilteredResult(_0x2ff2b3,_0x1580d8){return function(_0x30bee7){if(_0x30bee7){var _0x931f3=typeof _0x1580d8[_0xf813('0x1d')]===_0xf813('0x1e')&&typeof _0x1580d8[_0xf813('0x1f')]===_0xf813('0x1e');var _0x5c2f9f=_0x30bee7[_0xf813('0x20')];var _0x2b4cdb=_0x931f3?0x0:_0x1580d8[_0xf813('0x1d')];var _0x253f91=_0x931f3?_0x30bee7['count']:_0x1580d8[_0xf813('0x1d')]+_0x1580d8[_0xf813('0x1f')];var _0x19679d;if(_0x253f91>=_0x5c2f9f){_0x253f91=_0x5c2f9f;_0x19679d=0xc8;}else{_0x19679d=0xce;}_0x2ff2b3['status'](_0x19679d);return _0x2ff2b3[_0xf813('0x21')](_0xf813('0x22'),_0x2b4cdb+'-'+_0x253f91+'/'+_0x5c2f9f)[_0xf813('0x1c')](_0x30bee7);}return null;};}function patchUpdates(_0x8b6a57){return function(_0x2b273f){try{jsonpatch[_0xf813('0x23')](_0x2b273f,_0x8b6a57,!![]);}catch(_0x1619e3){return BPromise['reject'](_0x1619e3);}return _0x2b273f[_0xf813('0x24')]();};}function saveUpdates(_0x7117d9,_0x3ebe32){return function(_0x24ca98){if(_0x24ca98){return _0x24ca98['update'](_0x7117d9)['then'](function(_0x2dd70d){return _0x2dd70d;});}return null;};}function removeEntity(_0x3c60f3,_0x420f2f){return function(_0x1483ed){if(_0x1483ed){return _0x1483ed[_0xf813('0x25')]()[_0xf813('0x26')](function(){_0x3c60f3[_0xf813('0x1b')](0xcc)[_0xf813('0x27')]();});}};}function handleEntityNotFound(_0x38f4c5,_0xe904e4){return function(_0x152295){if(!_0x152295){_0x38f4c5[_0xf813('0x28')](0x194);}return _0x152295;};}function handleError(_0x3bfd07,_0x309358){_0x309358=_0x309358||0x1f4;return function(_0xe7bfa2){logger[_0xf813('0x29')](_0xe7bfa2[_0xf813('0x2a')]);if(_0xe7bfa2[_0xf813('0x2b')]){delete _0xe7bfa2[_0xf813('0x2b')];}_0x3bfd07[_0xf813('0x1b')](_0x309358)['send'](_0xe7bfa2);};}exports[_0xf813('0x2c')]=function(_0x2e7683,_0x2f1272){var _0x4b20e5={},_0x3d67b0={},_0x51170e={'count':0x0,'rows':[]};var _0x2e722a=_[_0xf813('0x2d')](db[_0xf813('0x2e')]['rawAttributes'],function(_0x17d76b){return{'name':_0x17d76b[_0xf813('0x2f')],'type':_0x17d76b[_0xf813('0x30')]['key']};});_0x3d67b0[_0xf813('0x31')]=_[_0xf813('0x32')](_['map'](_0x2e722a,_0xf813('0x2b')),[_0xf813('0x2b')]);_0x3d67b0[_0xf813('0x33')]=_[_0xf813('0x34')](_0x2e7683[_0xf813('0x33')]);_0x3d67b0[_0xf813('0x35')]=_[_0xf813('0x36')](_0x3d67b0[_0xf813('0x31')],_0x3d67b0[_0xf813('0x33')]);_0x4b20e5[_0xf813('0x37')]=_['intersection'](_0x3d67b0[_0xf813('0x31')],qs[_0xf813('0x38')](_0x2e7683['query'][_0xf813('0x38')]));_0x4b20e5['attributes']=_0x4b20e5[_0xf813('0x37')]['length']?_0x4b20e5[_0xf813('0x37')]:_0x3d67b0['model'];if(!_0x2e7683['query'][_0xf813('0x39')](_0xf813('0x3a'))){_0x4b20e5['limit']=qs['limit'](_0x2e7683['query'][_0xf813('0x1f')]);_0x4b20e5[_0xf813('0x1d')]=qs['offset'](_0x2e7683[_0xf813('0x33')][_0xf813('0x1d')]);}_0x4b20e5[_0xf813('0x3b')]=qs[_0xf813('0x3c')](_0x2e7683[_0xf813('0x33')][_0xf813('0x3c')]);_0x4b20e5[_0xf813('0x3d')]=qs[_0xf813('0x35')](_[_0xf813('0x3e')](_0x2e7683[_0xf813('0x33')],_0x3d67b0['filters']),_0x2e722a);if(_0x2e7683['query'][_0xf813('0x3f')]){_0x4b20e5[_0xf813('0x3d')]=_[_0xf813('0x40')](_0x4b20e5['where'],{'$or':_[_0xf813('0x2d')](_0x2e722a,function(_0x93b4e8){if(_0x93b4e8[_0xf813('0x30')]!=='VIRTUAL'){var _0x1802a7={};_0x1802a7[_0x93b4e8[_0xf813('0x2b')]]={'$like':'%'+_0x2e7683['query'][_0xf813('0x3f')]+'%'};return _0x1802a7;}})});}_0x4b20e5=_['merge']({},_0x4b20e5,_0x2e7683[_0xf813('0x41')]);var _0x34a90e={'where':_0x4b20e5[_0xf813('0x3d')]};return db[_0xf813('0x2e')][_0xf813('0x20')](_0x34a90e)['then'](function(_0x22c923){_0x51170e[_0xf813('0x20')]=_0x22c923;if(_0x2e7683['query'][_0xf813('0x42')]){_0x4b20e5[_0xf813('0x43')]=[{'all':!![]}];}return db[_0xf813('0x2e')][_0xf813('0x44')](_0x4b20e5);})[_0xf813('0x26')](function(_0x38299b){_0x51170e[_0xf813('0x45')]=_0x38299b;return _0x51170e;})['then'](respondWithFilteredResult(_0x2f1272,_0x4b20e5))[_0xf813('0x46')](handleError(_0x2f1272,null));};exports[_0xf813('0x47')]=function(_0x427c21,_0xf4b75a){var _0x18b114={'raw':!![],'where':{'id':_0x427c21['params']['id']}},_0x46b9c4={};_0x46b9c4[_0xf813('0x31')]=_[_0xf813('0x34')](db[_0xf813('0x2e')][_0xf813('0x48')]);_0x46b9c4[_0xf813('0x33')]=_[_0xf813('0x34')](_0x427c21[_0xf813('0x33')]);_0x46b9c4[_0xf813('0x35')]=_['intersection'](_0x46b9c4[_0xf813('0x31')],_0x46b9c4[_0xf813('0x33')]);_0x18b114[_0xf813('0x37')]=_[_0xf813('0x36')](_0x46b9c4[_0xf813('0x31')],qs[_0xf813('0x38')](_0x427c21[_0xf813('0x33')][_0xf813('0x38')]));_0x18b114['attributes']=_0x18b114['attributes'][_0xf813('0x49')]?_0x18b114[_0xf813('0x37')]:_0x46b9c4[_0xf813('0x31')];if(_0x427c21[_0xf813('0x33')][_0xf813('0x42')]){_0x18b114['include']=[{'all':!![]}];}_0x18b114=_['merge']({},_0x18b114,_0x427c21[_0xf813('0x41')]);return db[_0xf813('0x2e')][_0xf813('0x4a')](_0x18b114)[_0xf813('0x26')](handleEntityNotFound(_0xf4b75a,null))[_0xf813('0x26')](respondWithResult(_0xf4b75a,null))[_0xf813('0x46')](handleError(_0xf4b75a,null));};exports[_0xf813('0x4b')]=function(_0x2182aa,_0x175218){return db['VoiceMailMessage'][_0xf813('0x4b')](_0x2182aa[_0xf813('0x4c')],{})[_0xf813('0x26')](respondWithResult(_0x175218,0xc9))[_0xf813('0x46')](handleError(_0x175218,null));};exports[_0xf813('0x4d')]=function(_0xad0fa2,_0x48a91e){if(_0xad0fa2[_0xf813('0x4c')]['id']){delete _0xad0fa2[_0xf813('0x4c')]['id'];}return db['VoiceMailMessage'][_0xf813('0x4a')]({'where':{'id':_0xad0fa2[_0xf813('0x4e')]['id']}})['then'](handleEntityNotFound(_0x48a91e,null))[_0xf813('0x26')](saveUpdates(_0xad0fa2[_0xf813('0x4c')],null))[_0xf813('0x26')](respondWithResult(_0x48a91e,null))['catch'](handleError(_0x48a91e,null));};exports['destroy']=function(_0x30a344,_0x4d7ca2){return db[_0xf813('0x2e')][_0xf813('0x4a')]({'where':{'id':_0x30a344['params']['id']}})[_0xf813('0x26')](handleEntityNotFound(_0x4d7ca2,null))['then'](removeEntity(_0x4d7ca2,null))[_0xf813('0x46')](handleError(_0x4d7ca2,null));};exports[_0xf813('0x4f')]=function(_0x51eb60,_0x4ce8d1,_0x220cfd){return db[_0xf813('0x2e')][_0xf813('0x4a')]({'where':{'id':_0x51eb60[_0xf813('0x4e')]['id']},'attributes':['id',_0xf813('0x50'),'msg_id']})['then'](handleEntityNotFound(_0x4ce8d1,null))['then'](function(_0x22d1a7){if(_0x22d1a7){if(!_0x22d1a7[_0xf813('0x50')]){throw new db[(_0xf813('0x51'))][(_0xf813('0x52'))](_0xf813('0x53'));}var _0x2b301b={'Content-Type':_0xf813('0x54'),'Content-Disposition':_0xf813('0x55')};if(_0x22d1a7[_0xf813('0x56')]){_0x2b301b['Content-Disposition']=_0xf813('0x57')+_0x22d1a7[_0xf813('0x56')]+_0xf813('0x58');}_0x4ce8d1[_0xf813('0x21')](_0x2b301b);return _0x4ce8d1[_0xf813('0x59')](new Buffer(_0x22d1a7['recording']));}})[_0xf813('0x46')](handleError(_0x4ce8d1,null));}; \ No newline at end of file +var _0x7b02=['filter','merge','VIRTUAL','options','includeAll','findAll','then','rows','catch','show','params','fields','find','create','body','download','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x875110,_0x7873af){var _0x39758a=function(_0x251608){while(--_0x251608){_0x875110['push'](_0x875110['shift']());}};_0x39758a(++_0x7873af);}(_0x7b02,0x15e));var _0x27b0=function(_0x1e6f7b,_0x1bf57f){_0x1e6f7b=_0x1e6f7b-0x0;var _0x55edf5=_0x7b02[_0x1e6f7b];return _0x55edf5;};'use strict';var emlformat=require(_0x27b0('0x0'));var rimraf=require(_0x27b0('0x1'));var zipdir=require(_0x27b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27b0('0x3'));var moment=require(_0x27b0('0x4'));var BPromise=require(_0x27b0('0x5'));var Mustache=require(_0x27b0('0x6'));var util=require('util');var path=require(_0x27b0('0x7'));var sox=require('sox');var csv=require(_0x27b0('0x8'));var ejs=require(_0x27b0('0x9'));var fs=require('fs');var fs_extra=require(_0x27b0('0xa'));var _=require(_0x27b0('0xb'));var squel=require(_0x27b0('0xc'));var crypto=require(_0x27b0('0xd'));var jsforce=require(_0x27b0('0xe'));var deskjs=require(_0x27b0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27b0('0x10'));var Papa=require('papaparse');var Redis=require(_0x27b0('0x11'));var authService=require(_0x27b0('0x12'));var qs=require(_0x27b0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x27b0('0x14'));var logger=require(_0x27b0('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x27b0('0x16'))['db'];function respondWithStatusCode(_0x573877,_0xaf9d53){_0xaf9d53=_0xaf9d53||0xcc;return function(_0x61b280){if(_0x61b280){return _0x573877[_0x27b0('0x17')](_0xaf9d53);}return _0x573877[_0x27b0('0x18')](_0xaf9d53)[_0x27b0('0x19')]();};}function respondWithResult(_0x23e744,_0x5495d1){_0x5495d1=_0x5495d1||0xc8;return function(_0xdec90c){if(_0xdec90c){return _0x23e744['status'](_0x5495d1)[_0x27b0('0x1a')](_0xdec90c);}};}function respondWithFilteredResult(_0x8fda06,_0x25c0eb){return function(_0x245461){if(_0x245461){var _0x5a60e9=typeof _0x25c0eb[_0x27b0('0x1b')]===_0x27b0('0x1c')&&typeof _0x25c0eb[_0x27b0('0x1d')]===_0x27b0('0x1c');var _0x106d69=_0x245461[_0x27b0('0x1e')];var _0x1953c6=_0x5a60e9?0x0:_0x25c0eb[_0x27b0('0x1b')];var _0x124738=_0x5a60e9?_0x245461[_0x27b0('0x1e')]:_0x25c0eb[_0x27b0('0x1b')]+_0x25c0eb[_0x27b0('0x1d')];var _0x39e105;if(_0x124738>=_0x106d69){_0x124738=_0x106d69;_0x39e105=0xc8;}else{_0x39e105=0xce;}_0x8fda06['status'](_0x39e105);return _0x8fda06[_0x27b0('0x1f')]('Content-Range',_0x1953c6+'-'+_0x124738+'/'+_0x106d69)[_0x27b0('0x1a')](_0x245461);}return null;};}function patchUpdates(_0x2e1daf){return function(_0x3a1664){try{jsonpatch[_0x27b0('0x20')](_0x3a1664,_0x2e1daf,!![]);}catch(_0x1ddd1c){return BPromise[_0x27b0('0x21')](_0x1ddd1c);}return _0x3a1664[_0x27b0('0x22')]();};}function saveUpdates(_0x9a65ac,_0x35c537){return function(_0x4af482){if(_0x4af482){return _0x4af482[_0x27b0('0x23')](_0x9a65ac)['then'](function(_0x23ab54){return _0x23ab54;});}return null;};}function removeEntity(_0x414533,_0x28cdae){return function(_0x11c035){if(_0x11c035){return _0x11c035[_0x27b0('0x24')]()['then'](function(){_0x414533[_0x27b0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x443245,_0x462a1a){return function(_0x15a01a){if(!_0x15a01a){_0x443245[_0x27b0('0x17')](0x194);}return _0x15a01a;};}function handleError(_0x2f1e32,_0x65df0d){_0x65df0d=_0x65df0d||0x1f4;return function(_0x46a4e1){logger[_0x27b0('0x25')](_0x46a4e1[_0x27b0('0x26')]);if(_0x46a4e1[_0x27b0('0x27')]){delete _0x46a4e1['name'];}_0x2f1e32[_0x27b0('0x18')](_0x65df0d)[_0x27b0('0x28')](_0x46a4e1);};}exports[_0x27b0('0x29')]=function(_0x331673,_0x1c6370){var _0x4159e4={},_0x1c7a06={},_0xbe6f12={'count':0x0,'rows':[]};var _0x322aab=_['map'](db[_0x27b0('0x2a')][_0x27b0('0x2b')],function(_0x320a86){return{'name':_0x320a86[_0x27b0('0x2c')],'type':_0x320a86[_0x27b0('0x2d')]['key']};});_0x1c7a06[_0x27b0('0x2e')]=_['differenceBy'](_[_0x27b0('0x2f')](_0x322aab,'name'),[_0x27b0('0x27')]);_0x1c7a06[_0x27b0('0x30')]=_[_0x27b0('0x31')](_0x331673[_0x27b0('0x30')]);_0x1c7a06[_0x27b0('0x32')]=_[_0x27b0('0x33')](_0x1c7a06[_0x27b0('0x2e')],_0x1c7a06[_0x27b0('0x30')]);_0x4159e4[_0x27b0('0x34')]=_['intersection'](_0x1c7a06['model'],qs['fields'](_0x331673[_0x27b0('0x30')]['fields']));_0x4159e4[_0x27b0('0x34')]=_0x4159e4[_0x27b0('0x34')][_0x27b0('0x35')]?_0x4159e4[_0x27b0('0x34')]:_0x1c7a06[_0x27b0('0x2e')];if(!_0x331673[_0x27b0('0x30')][_0x27b0('0x36')](_0x27b0('0x37'))){_0x4159e4[_0x27b0('0x1d')]=qs[_0x27b0('0x1d')](_0x331673['query']['limit']);_0x4159e4[_0x27b0('0x1b')]=qs[_0x27b0('0x1b')](_0x331673[_0x27b0('0x30')][_0x27b0('0x1b')]);}_0x4159e4[_0x27b0('0x38')]=qs[_0x27b0('0x39')](_0x331673[_0x27b0('0x30')][_0x27b0('0x39')]);_0x4159e4[_0x27b0('0x3a')]=qs[_0x27b0('0x32')](_[_0x27b0('0x3b')](_0x331673[_0x27b0('0x30')],_0x1c7a06[_0x27b0('0x32')]),_0x322aab);if(_0x331673[_0x27b0('0x30')][_0x27b0('0x3c')]){_0x4159e4[_0x27b0('0x3a')]=_[_0x27b0('0x3d')](_0x4159e4[_0x27b0('0x3a')],{'$or':_[_0x27b0('0x2f')](_0x322aab,function(_0x3b01b6){if(_0x3b01b6['type']!==_0x27b0('0x3e')){var _0x30fbe8={};_0x30fbe8[_0x3b01b6[_0x27b0('0x27')]]={'$like':'%'+_0x331673['query'][_0x27b0('0x3c')]+'%'};return _0x30fbe8;}})});}_0x4159e4=_['merge']({},_0x4159e4,_0x331673[_0x27b0('0x3f')]);var _0x3bb636={'where':_0x4159e4[_0x27b0('0x3a')]};return db[_0x27b0('0x2a')][_0x27b0('0x1e')](_0x3bb636)['then'](function(_0x4ffef9){_0xbe6f12['count']=_0x4ffef9;if(_0x331673[_0x27b0('0x30')][_0x27b0('0x40')]){_0x4159e4['include']=[{'all':!![]}];}return db[_0x27b0('0x2a')][_0x27b0('0x41')](_0x4159e4);})[_0x27b0('0x42')](function(_0x3e8828){_0xbe6f12[_0x27b0('0x43')]=_0x3e8828;return _0xbe6f12;})['then'](respondWithFilteredResult(_0x1c6370,_0x4159e4))[_0x27b0('0x44')](handleError(_0x1c6370,null));};exports[_0x27b0('0x45')]=function(_0x1bd3f9,_0x2e4fb0){var _0x4cda38={'raw':!![],'where':{'id':_0x1bd3f9[_0x27b0('0x46')]['id']}},_0x4804fb={};_0x4804fb[_0x27b0('0x2e')]=_['keys'](db[_0x27b0('0x2a')]['rawAttributes']);_0x4804fb[_0x27b0('0x30')]=_[_0x27b0('0x31')](_0x1bd3f9[_0x27b0('0x30')]);_0x4804fb[_0x27b0('0x32')]=_[_0x27b0('0x33')](_0x4804fb[_0x27b0('0x2e')],_0x4804fb[_0x27b0('0x30')]);_0x4cda38[_0x27b0('0x34')]=_[_0x27b0('0x33')](_0x4804fb[_0x27b0('0x2e')],qs[_0x27b0('0x47')](_0x1bd3f9[_0x27b0('0x30')][_0x27b0('0x47')]));_0x4cda38[_0x27b0('0x34')]=_0x4cda38[_0x27b0('0x34')][_0x27b0('0x35')]?_0x4cda38[_0x27b0('0x34')]:_0x4804fb[_0x27b0('0x2e')];if(_0x1bd3f9[_0x27b0('0x30')]['includeAll']){_0x4cda38['include']=[{'all':!![]}];}_0x4cda38=_[_0x27b0('0x3d')]({},_0x4cda38,_0x1bd3f9[_0x27b0('0x3f')]);return db[_0x27b0('0x2a')][_0x27b0('0x48')](_0x4cda38)[_0x27b0('0x42')](handleEntityNotFound(_0x2e4fb0,null))[_0x27b0('0x42')](respondWithResult(_0x2e4fb0,null))['catch'](handleError(_0x2e4fb0,null));};exports[_0x27b0('0x49')]=function(_0x36d1d3,_0x232652){return db[_0x27b0('0x2a')][_0x27b0('0x49')](_0x36d1d3[_0x27b0('0x4a')],{})[_0x27b0('0x42')](respondWithResult(_0x232652,0xc9))['catch'](handleError(_0x232652,null));};exports[_0x27b0('0x23')]=function(_0x10f718,_0x331184){if(_0x10f718[_0x27b0('0x4a')]['id']){delete _0x10f718['body']['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x10f718[_0x27b0('0x46')]['id']}})[_0x27b0('0x42')](handleEntityNotFound(_0x331184,null))[_0x27b0('0x42')](saveUpdates(_0x10f718[_0x27b0('0x4a')],null))[_0x27b0('0x42')](respondWithResult(_0x331184,null))[_0x27b0('0x44')](handleError(_0x331184,null));};exports['destroy']=function(_0x2df9df,_0x6f80f9){return db[_0x27b0('0x2a')]['find']({'where':{'id':_0x2df9df[_0x27b0('0x46')]['id']}})[_0x27b0('0x42')](handleEntityNotFound(_0x6f80f9,null))['then'](removeEntity(_0x6f80f9,null))[_0x27b0('0x44')](handleError(_0x6f80f9,null));};exports[_0x27b0('0x4b')]=function(_0x5180db,_0x3404a8,_0x36b312){return db[_0x27b0('0x2a')][_0x27b0('0x48')]({'where':{'id':_0x5180db[_0x27b0('0x46')]['id']},'attributes':['id',_0x27b0('0x4c'),'msg_id']})['then'](handleEntityNotFound(_0x3404a8,null))[_0x27b0('0x42')](function(_0x3dfb78){if(_0x3dfb78){if(!_0x3dfb78[_0x27b0('0x4c')]){throw new db['Sequelize'][(_0x27b0('0x4d'))](_0x27b0('0x4e'));}var _0x4682c1={'Content-Type':_0x27b0('0x4f'),'Content-Disposition':'attachment'};if(_0x3dfb78[_0x27b0('0x50')]){_0x4682c1['Content-Disposition']=_0x27b0('0x51')+_0x3dfb78['msg_id']+'.wav\x22';}_0x3404a8[_0x27b0('0x1f')](_0x4682c1);return _0x3404a8[_0x27b0('0x28')](new Buffer(_0x3dfb78['recording']));}})['catch'](handleError(_0x3404a8,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 56cabd5..a8564f9 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 _0x9998=['../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9998,0xa2));var _0x8999=function(_0x33a648,_0x4bb66a){_0x33a648=_0x33a648-0x0;var _0x2f1529=_0x9998[_0x33a648];return _0x2f1529;};'use strict';var _=require('lodash');var util=require(_0x8999('0x0'));var logger=require(_0x8999('0x1'))(_0x8999('0x2'));var moment=require(_0x8999('0x3'));var BPromise=require(_0x8999('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8999('0x5'));var rimraf=require(_0x8999('0x6'));var config=require(_0x8999('0x7'));var attributes=require(_0x8999('0x8'));module[_0x8999('0x9')]=function(_0x26239b,_0x45f813){return _0x26239b[_0x8999('0xa')](_0x8999('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x8999('0xc'),'fields':[_0x8999('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe827=['rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xe827,0x165));var _0x7e82=function(_0x210690,_0x63eada){_0x210690=_0x210690-0x0;var _0x390ed2=_0xe827[_0x210690];return _0x390ed2;};'use strict';var _=require(_0x7e82('0x0'));var util=require(_0x7e82('0x1'));var logger=require(_0x7e82('0x2'))(_0x7e82('0x3'));var moment=require('moment');var BPromise=require(_0x7e82('0x4'));var rp=require(_0x7e82('0x5'));var fs=require('fs');var path=require(_0x7e82('0x6'));var rimraf=require(_0x7e82('0x7'));var config=require('../../config/environment');var attributes=require(_0x7e82('0x8'));module[_0x7e82('0x9')]=function(_0x3d71a8,_0x98b02b){return _0x3d71a8[_0x7e82('0xa')](_0x7e82('0xb'),attributes,{'tableName':_0x7e82('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x7e82('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 209f90c..3e938a9 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 _0x853f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMailMessage,\x20%s,\x20%s','message','bluebird'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x853f,0x1af));var _0xf853=function(_0x533deb,_0x5b482f){_0x533deb=_0x533deb-0x0;var _0x1ce679=_0x853f[_0x533deb];return _0x1ce679;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf853('0x0'));var rs=require(_0xf853('0x1'));var fs=require('fs');var Redis=require(_0xf853('0x2'));var db=require(_0xf853('0x3'))['db'];var utils=require(_0xf853('0x4'));var logger=require(_0xf853('0x5'))(_0xf853('0x6'));var config=require('../../config/environment');var jayson=require(_0xf853('0x7'));var client=jayson[_0xf853('0x8')][_0xf853('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52368b,_0x3d0092,_0x223d55){return new BPromise(function(_0x183eca,_0x705448){return client['request'](_0x52368b,_0x223d55)['then'](function(_0x178550){logger[_0xf853('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x3d0092,_0xf853('0xb'));logger[_0xf853('0xc')](_0xf853('0xd'),_0x3d0092,_0xf853('0xb'),JSON[_0xf853('0xe')](_0x178550));if(_0x178550[_0xf853('0xf')]){if(_0x178550[_0xf853('0xf')]['code']===0x1f4){logger[_0xf853('0xf')](_0xf853('0x10'),_0x3d0092,_0x178550['error'][_0xf853('0x11')]);return _0x705448(_0x178550[_0xf853('0xf')][_0xf853('0x11')]);}logger[_0xf853('0xf')](_0xf853('0x10'),_0x3d0092,_0x178550[_0xf853('0xf')][_0xf853('0x11')]);return _0x183eca(_0x178550[_0xf853('0xf')][_0xf853('0x11')]);}else{logger[_0xf853('0xa')](_0xf853('0x10'),_0x3d0092,_0xf853('0xb'));_0x183eca(_0x178550['result'][_0xf853('0x11')]);}})['catch'](function(_0x4b5c73){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x3d0092,_0x4b5c73);_0x705448(_0x4b5c73);});});} \ No newline at end of file +var _0x1e35=['rpc','../../config/environment','jayson/promise','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x55f931,_0x45d32f){var _0x4ff9e9=function(_0x34ce7b){while(--_0x34ce7b){_0x55f931['push'](_0x55f931['shift']());}};_0x4ff9e9(++_0x45d32f);}(_0x1e35,0xa1));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x51e3('0x0'));var util=require(_0x51e3('0x1'));var moment=require('moment');var BPromise=require(_0x51e3('0x2'));var rs=require(_0x51e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51e3('0x4'))['db'];var utils=require(_0x51e3('0x5'));var logger=require(_0x51e3('0x6'))(_0x51e3('0x7'));var config=require(_0x51e3('0x8'));var jayson=require(_0x51e3('0x9'));var client=jayson['client'][_0x51e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46b2ba,_0x39cb67,_0x25c7e6){return new BPromise(function(_0xdd528a,_0x16f36d){return client[_0x51e3('0xb')](_0x46b2ba,_0x25c7e6)[_0x51e3('0xc')](function(_0x30ad1b){logger['info'](_0x51e3('0xd'),_0x39cb67,_0x51e3('0xe'));logger['debug'](_0x51e3('0xf'),_0x39cb67,_0x51e3('0xe'),JSON[_0x51e3('0x10')](_0x30ad1b));if(_0x30ad1b[_0x51e3('0x11')]){if(_0x30ad1b[_0x51e3('0x11')][_0x51e3('0x12')]===0x1f4){logger['error'](_0x51e3('0xd'),_0x39cb67,_0x30ad1b[_0x51e3('0x11')][_0x51e3('0x13')]);return _0x16f36d(_0x30ad1b['error'][_0x51e3('0x13')]);}logger['error'](_0x51e3('0xd'),_0x39cb67,_0x30ad1b['error'][_0x51e3('0x13')]);return _0xdd528a(_0x30ad1b[_0x51e3('0x11')][_0x51e3('0x13')]);}else{logger['info'](_0x51e3('0xd'),_0x39cb67,'request\x20sent');_0xdd528a(_0x30ad1b['result'][_0x51e3('0x13')]);}})[_0x51e3('0x14')](function(_0x5a4411){logger[_0x51e3('0x11')](_0x51e3('0xd'),_0x39cb67,_0x5a4411);_0x16f36d(_0x5a4411);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3605840..e6a46e7 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 _0xf46f=['put','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','getSounds','post','/:id/sounds'];(function(_0x377da6,_0xbff901){var _0x5bfa78=function(_0x2f52a0){while(--_0x2f52a0){_0x377da6['push'](_0x377da6['shift']());}};_0x5bfa78(++_0xbff901);}(_0xf46f,0x123));var _0xff46=function(_0x16c639,_0x1ab07d){_0x16c639=_0x16c639-0x0;var _0x3ec39f=_0xf46f[_0x16c639];return _0x3ec39f;};'use strict';var multer=require(_0xff46('0x0'));var util=require(_0xff46('0x1'));var path=require(_0xff46('0x2'));var timeout=require(_0xff46('0x3'));var express=require('express');var router=express[_0xff46('0x4')]();var fs_extra=require(_0xff46('0x5'));var auth=require(_0xff46('0x6'));var interaction=require(_0xff46('0x7'));var config=require('../../config/environment');var controller=require(_0xff46('0x8'));router[_0xff46('0x9')]('/',auth[_0xff46('0xa')](),controller[_0xff46('0xb')]);router[_0xff46('0x9')](_0xff46('0xc'),auth['isAuthenticated'](),controller[_0xff46('0xd')]);router[_0xff46('0x9')]('/:id/sounds',auth['isAuthenticated'](),controller[_0xff46('0xe')]);router[_0xff46('0xf')]('/',auth[_0xff46('0xa')](),controller['create']);router[_0xff46('0xf')](_0xff46('0x10'),auth[_0xff46('0xa')](),controller['addSound']);router[_0xff46('0x11')](_0xff46('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xff46('0x12')](_0xff46('0xc'),auth[_0xff46('0xa')](),controller['destroy']);router[_0xff46('0x12')](_0xff46('0x13'),auth[_0xff46('0xa')](),controller[_0xff46('0x14')]);module[_0xff46('0x15')]=router; \ No newline at end of file +var _0x794b=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sounds','getSounds','post','create','addSound','/:id','update','delete','destroy','removeSound','multer','util'];(function(_0x366494,_0x497c8a){var _0xf041a6=function(_0x18ddb5){while(--_0x18ddb5){_0x366494['push'](_0x366494['shift']());}};_0xf041a6(++_0x497c8a);}(_0x794b,0xd0));var _0xb794=function(_0x4b1d35,_0x1627ab){_0x4b1d35=_0x4b1d35-0x0;var _0x5d6bb7=_0x794b[_0x4b1d35];return _0x5d6bb7;};'use strict';var multer=require(_0xb794('0x0'));var util=require(_0xb794('0x1'));var path=require(_0xb794('0x2'));var timeout=require(_0xb794('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb794('0x4'));var auth=require(_0xb794('0x5'));var interaction=require(_0xb794('0x6'));var config=require(_0xb794('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0xb794('0x8')]('/',auth[_0xb794('0x9')](),controller[_0xb794('0xa')]);router[_0xb794('0x8')]('/:id',auth[_0xb794('0x9')](),controller['show']);router['get'](_0xb794('0xb'),auth[_0xb794('0x9')](),controller[_0xb794('0xc')]);router[_0xb794('0xd')]('/',auth[_0xb794('0x9')](),controller[_0xb794('0xe')]);router[_0xb794('0xd')](_0xb794('0xb'),auth[_0xb794('0x9')](),controller[_0xb794('0xf')]);router['put'](_0xb794('0x10'),auth[_0xb794('0x9')](),controller[_0xb794('0x11')]);router[_0xb794('0x12')](_0xb794('0x10'),auth[_0xb794('0x9')](),controller[_0xb794('0x13')]);router[_0xb794('0x12')]('/:id/sounds/:id2',auth[_0xb794('0x9')](),controller[_0xb794('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c8c50fa..416f7b9 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 _0x082f=['exports','STRING','name','custom','mp3nb','quietmp3nb','mp3','files','alpha','BOOLEAN','sequelize'];(function(_0xa788d6,_0x5b1ad8){var _0x336074=function(_0x43652f){while(--_0x43652f){_0xa788d6['push'](_0xa788d6['shift']());}};_0x336074(++_0x5b1ad8);}(_0x082f,0x175));var _0xf082=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x082f[_0x220afa];return _0x1b79d1;};'use strict';var Sequelize=require(_0xf082('0x0'));module[_0xf082('0x1')]={'name':{'type':Sequelize[_0xf082('0x2')],'allowNull':![],'unique':_0xf082('0x3')},'mode':{'type':Sequelize['ENUM'](_0xf082('0x4'),'files',_0xf082('0x5'),_0xf082('0x6'),'quietmp3',_0xf082('0x7')),'allowNull':!![],'defaultValue':_0xf082('0x8')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xf082('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf082('0x2')],'allowNull':!![],'defaultValue':_0xf082('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xf082('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x59b4=['mp3','alpha','TIMESTAMP','sequelize','STRING','ENUM','custom','files','mp3nb','quietmp3nb'];(function(_0x46b4aa,_0x303110){var _0x192019=function(_0x46621b){while(--_0x46621b){_0x46b4aa['push'](_0x46b4aa['shift']());}};_0x192019(++_0x303110);}(_0x59b4,0xcb));var _0x459b=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x59b4[_0x474bc0];return _0x4b24cf;};'use strict';var Sequelize=require(_0x459b('0x0'));module['exports']={'name':{'type':Sequelize[_0x459b('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x459b('0x2')](_0x459b('0x3'),_0x459b('0x4'),_0x459b('0x5'),_0x459b('0x6'),'quietmp3',_0x459b('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x459b('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x459b('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x459b('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x459b('0x1')],'allowNull':!![],'defaultValue':_0x459b('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x459b('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 3f4dd5f..aec2388 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 _0xaf9f=['Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','readdirSync','forEach','unlinkSync','join','ValidationError','message','addSound','Sound','save_name','converted_format','server/files/sounds/converted','basename','extname','root','server/files/moh','format','%s.%s','symlinkSync','findOne','removeSound','Sequelize','getSounds','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','Content-Range','json','apply','save','update','then','get','MusicOnHolds','destroy','error','name','send','map','VoiceMusicOnHold','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','options','find','body','create','sequelize','transaction','mode','files','directory','mkdirSync','0777','user'];(function(_0x3d15af,_0x13e28d){var _0x45cab4=function(_0x15f5f9){while(--_0x15f5f9){_0x3d15af['push'](_0x3d15af['shift']());}};_0x45cab4(++_0x13e28d);}(_0xaf9f,0xf0));var _0xfaf9=function(_0x34a6e9,_0x25cabe){_0x34a6e9=_0x34a6e9-0x0;var _0x11015c=_0xaf9f[_0x34a6e9];return _0x11015c;};'use strict';var emlformat=require(_0xfaf9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfaf9('0x1'));var rp=require(_0xfaf9('0x2'));var moment=require(_0xfaf9('0x3'));var BPromise=require(_0xfaf9('0x4'));var Mustache=require(_0xfaf9('0x5'));var util=require(_0xfaf9('0x6'));var path=require(_0xfaf9('0x7'));var sox=require('sox');var csv=require(_0xfaf9('0x8'));var ejs=require(_0xfaf9('0x9'));var fs=require('fs');var fs_extra=require(_0xfaf9('0xa'));var _=require(_0xfaf9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfaf9('0xc'));var toCsv=require(_0xfaf9('0x8'));var querystring=require('querystring');var Papa=require(_0xfaf9('0xd'));var Redis=require(_0xfaf9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfaf9('0xf'));var as=require(_0xfaf9('0x10'));var hardwareService=require(_0xfaf9('0x11'));var logger=require('../../config/logger')(_0xfaf9('0x12'));var utils=require(_0xfaf9('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfaf9('0x14'));var db=require(_0xfaf9('0x15'))['db'];function respondWithStatusCode(_0x386908,_0x245f73){_0x245f73=_0x245f73||0xcc;return function(_0x45c3d1){if(_0x45c3d1){return _0x386908[_0xfaf9('0x16')](_0x245f73);}return _0x386908['status'](_0x245f73)[_0xfaf9('0x17')]();};}function respondWithResult(_0x4d33e6,_0x1e3204){_0x1e3204=_0x1e3204||0xc8;return function(_0x1d8574){if(_0x1d8574){return _0x4d33e6[_0xfaf9('0x18')](_0x1e3204)['json'](_0x1d8574);}};}function respondWithFilteredResult(_0x47bebf,_0x5d9e0e){return function(_0x495071){if(_0x495071){var _0x14481a=typeof _0x5d9e0e[_0xfaf9('0x19')]==='undefined'&&typeof _0x5d9e0e[_0xfaf9('0x1a')]==='undefined';var _0x5d1bf1=_0x495071[_0xfaf9('0x1b')];var _0x5d4973=_0x14481a?0x0:_0x5d9e0e['offset'];var _0x1bcfed=_0x14481a?_0x495071[_0xfaf9('0x1b')]:_0x5d9e0e['offset']+_0x5d9e0e[_0xfaf9('0x1a')];var _0x2e55d5;if(_0x1bcfed>=_0x5d1bf1){_0x1bcfed=_0x5d1bf1;_0x2e55d5=0xc8;}else{_0x2e55d5=0xce;}_0x47bebf[_0xfaf9('0x18')](_0x2e55d5);return _0x47bebf['set'](_0xfaf9('0x1c'),_0x5d4973+'-'+_0x1bcfed+'/'+_0x5d1bf1)[_0xfaf9('0x1d')](_0x495071);}return null;};}function patchUpdates(_0x47efcb){return function(_0x576a47){try{jsonpatch[_0xfaf9('0x1e')](_0x576a47,_0x47efcb,!![]);}catch(_0x4beab4){return BPromise['reject'](_0x4beab4);}return _0x576a47[_0xfaf9('0x1f')]();};}function saveUpdates(_0xdf313f,_0x46a9ce){return function(_0x2d9617){if(_0x2d9617){return _0x2d9617[_0xfaf9('0x20')](_0xdf313f)[_0xfaf9('0x21')](function(_0x520a6a){return _0x520a6a;});}return null;};}function removeEntity(_0x4810be,_0x440e52){return function(_0x4cb13f){if(_0x4cb13f){return _0x4cb13f['destroy']()['then'](function(){var _0x9a9a96=_0x4cb13f[_0xfaf9('0x22')]({'plain':!![]});var _0x3054dd=_0xfaf9('0x23');return db['UserProfileResource'][_0xfaf9('0x24')]({'where':{'type':_0x3054dd,'resourceId':_0x9a9a96['id']}})['then'](function(){return _0x4cb13f;});})[_0xfaf9('0x21')](function(){_0x4810be[_0xfaf9('0x18')](0xcc)[_0xfaf9('0x17')]();});}};}function handleEntityNotFound(_0xf2e52c,_0x5e36ac){return function(_0x313615){if(!_0x313615){_0xf2e52c[_0xfaf9('0x16')](0x194);}return _0x313615;};}function handleError(_0x3415c8,_0x5bbbb9){_0x5bbbb9=_0x5bbbb9||0x1f4;return function(_0xab8495){logger[_0xfaf9('0x25')](_0xab8495['stack']);if(_0xab8495[_0xfaf9('0x26')]){delete _0xab8495[_0xfaf9('0x26')];}_0x3415c8['status'](_0x5bbbb9)[_0xfaf9('0x27')](_0xab8495);};}exports['index']=function(_0x397d86,_0x4516a5){var _0x4e1c6d={},_0x4c9096={},_0x479c21={'count':0x0,'rows':[]};var _0x185d9f=_[_0xfaf9('0x28')](db[_0xfaf9('0x29')]['rawAttributes'],function(_0x4c2264){return{'name':_0x4c2264[_0xfaf9('0x2a')],'type':_0x4c2264[_0xfaf9('0x2b')][_0xfaf9('0x2c')]};});_0x4c9096['model']=_['map'](_0x185d9f,_0xfaf9('0x26'));_0x4c9096[_0xfaf9('0x2d')]=_[_0xfaf9('0x2e')](_0x397d86[_0xfaf9('0x2d')]);_0x4c9096[_0xfaf9('0x2f')]=_[_0xfaf9('0x30')](_0x4c9096[_0xfaf9('0x31')],_0x4c9096[_0xfaf9('0x2d')]);_0x4e1c6d[_0xfaf9('0x32')]=_[_0xfaf9('0x30')](_0x4c9096[_0xfaf9('0x31')],qs[_0xfaf9('0x33')](_0x397d86[_0xfaf9('0x2d')][_0xfaf9('0x33')]));_0x4e1c6d[_0xfaf9('0x32')]=_0x4e1c6d[_0xfaf9('0x32')]['length']?_0x4e1c6d['attributes']:_0x4c9096[_0xfaf9('0x31')];if(!_0x397d86[_0xfaf9('0x2d')][_0xfaf9('0x34')](_0xfaf9('0x35'))){_0x4e1c6d['limit']=qs['limit'](_0x397d86[_0xfaf9('0x2d')][_0xfaf9('0x1a')]);_0x4e1c6d[_0xfaf9('0x19')]=qs[_0xfaf9('0x19')](_0x397d86[_0xfaf9('0x2d')][_0xfaf9('0x19')]);}_0x4e1c6d[_0xfaf9('0x36')]=qs[_0xfaf9('0x37')](_0x397d86[_0xfaf9('0x2d')][_0xfaf9('0x37')]);delete _0x397d86[_0xfaf9('0x2d')][_0xfaf9('0x37')];_0x4e1c6d['where']=qs[_0xfaf9('0x2f')](_[_0xfaf9('0x38')](_0x397d86[_0xfaf9('0x2d')],_0x4c9096[_0xfaf9('0x2f')]),_0x185d9f);if(_0x397d86[_0xfaf9('0x2d')]['filter']){_0x4e1c6d[_0xfaf9('0x39')]=_[_0xfaf9('0x3a')](_0x4e1c6d['where'],{'$or':_[_0xfaf9('0x28')](_0x185d9f,function(_0xc9dde2){if(_0xc9dde2[_0xfaf9('0x2b')]!==_0xfaf9('0x3b')){var _0x1cee7a={};_0x1cee7a[_0xc9dde2['name']]={'$like':'%'+_0x397d86[_0xfaf9('0x2d')][_0xfaf9('0x3c')]+'%'};return _0x1cee7a;}})});}_0x4e1c6d=_['merge']({},_0x4e1c6d,_0x397d86['options']);var _0x56b43d={'where':_0x4e1c6d[_0xfaf9('0x39')]};return db[_0xfaf9('0x29')][_0xfaf9('0x1b')](_0x56b43d)[_0xfaf9('0x21')](function(_0x23bd50){_0x479c21[_0xfaf9('0x1b')]=_0x23bd50;if(_0x397d86[_0xfaf9('0x2d')]['includeAll']){_0x4e1c6d[_0xfaf9('0x3d')]=[{'all':!![]}];}return db[_0xfaf9('0x29')][_0xfaf9('0x3e')](_0x4e1c6d);})[_0xfaf9('0x21')](function(_0x53b40f){_0x479c21[_0xfaf9('0x3f')]=_0x53b40f;return _0x479c21;})[_0xfaf9('0x21')](respondWithFilteredResult(_0x4516a5,_0x4e1c6d))[_0xfaf9('0x40')](handleError(_0x4516a5,null));};exports['show']=function(_0x4ee96f,_0x2431a4){var _0x3041f0={'raw':![],'where':{'id':_0x4ee96f[_0xfaf9('0x41')]['id']}},_0x11afc6={};_0x11afc6[_0xfaf9('0x31')]=_[_0xfaf9('0x2e')](db['VoiceMusicOnHold'][_0xfaf9('0x42')]);_0x11afc6[_0xfaf9('0x2d')]=_[_0xfaf9('0x2e')](_0x4ee96f[_0xfaf9('0x2d')]);_0x11afc6[_0xfaf9('0x2f')]=_[_0xfaf9('0x30')](_0x11afc6[_0xfaf9('0x31')],_0x11afc6[_0xfaf9('0x2d')]);_0x3041f0['attributes']=_[_0xfaf9('0x30')](_0x11afc6[_0xfaf9('0x31')],qs[_0xfaf9('0x33')](_0x4ee96f[_0xfaf9('0x2d')][_0xfaf9('0x33')]));_0x3041f0[_0xfaf9('0x32')]=_0x3041f0[_0xfaf9('0x32')][_0xfaf9('0x43')]?_0x3041f0[_0xfaf9('0x32')]:_0x11afc6['model'];if(_0x4ee96f[_0xfaf9('0x2d')][_0xfaf9('0x44')]){_0x3041f0['include']=[{'all':!![]}];}_0x3041f0=_[_0xfaf9('0x3a')]({},_0x3041f0,_0x4ee96f[_0xfaf9('0x45')]);return db[_0xfaf9('0x29')][_0xfaf9('0x46')](_0x3041f0)['then'](handleEntityNotFound(_0x2431a4,null))[_0xfaf9('0x21')](respondWithResult(_0x2431a4,null))['catch'](handleError(_0x2431a4,null));};exports['update']=function(_0x1eecf1,_0x69ae2d){if(_0x1eecf1['body']['id']){delete _0x1eecf1['body']['id'];}return db[_0xfaf9('0x29')]['find']({'where':{'id':_0x1eecf1[_0xfaf9('0x41')]['id']}})[_0xfaf9('0x21')](handleEntityNotFound(_0x69ae2d,null))[_0xfaf9('0x21')](saveUpdates(_0x1eecf1[_0xfaf9('0x47')],null))[_0xfaf9('0x21')](respondWithResult(_0x69ae2d,null))[_0xfaf9('0x40')](handleError(_0x69ae2d,null));};exports[_0xfaf9('0x48')]=function(_0x31b257,_0x123743,_0x60ebb0){return db[_0xfaf9('0x49')][_0xfaf9('0x4a')](function(_0x52c918){if(_0x31b257[_0xfaf9('0x47')][_0xfaf9('0x4b')]===_0xfaf9('0x4c')){_0x31b257[_0xfaf9('0x47')][_0xfaf9('0x4d')]=path['join'](config['root'],'server/files/moh',_0x31b257[_0xfaf9('0x47')][_0xfaf9('0x26')]);}return db[_0xfaf9('0x29')]['create'](_0x31b257[_0xfaf9('0x47')],{'transaction':_0x52c918})[_0xfaf9('0x21')](function(_0x4ca517){if(_0x31b257['body'][_0xfaf9('0x4b')]==='files'){fs[_0xfaf9('0x4e')](_0x4ca517[_0xfaf9('0x4d')],parseInt(_0xfaf9('0x4f'),0x8));}var _0x291ed1=_0x31b257[_0xfaf9('0x50')][_0xfaf9('0x22')]({'plain':!![]});if(!_0x291ed1)throw new Error(_0xfaf9('0x51'));if(_0x291ed1['role']==='user'){var _0x16cf2d=_0x4ca517['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xfaf9('0x23'),'userProfileId':_0x291ed1[_0xfaf9('0x52')]},'raw':!![]})['then'](function(_0x19853e){if(_0x19853e&&_0x19853e[_0xfaf9('0x53')]===0x0){return db[_0xfaf9('0x54')]['create']({'name':_0x16cf2d[_0xfaf9('0x26')],'resourceId':_0x16cf2d['id'],'type':_0x19853e[_0xfaf9('0x26')],'sectionId':_0x19853e['id']},{})[_0xfaf9('0x21')](function(){return _0x4ca517;});}else{return _0x4ca517;}})[_0xfaf9('0x40')](function(_0x165f25){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x165f25);});}return _0x4ca517;});})[_0xfaf9('0x21')](respondWithResult(_0x123743,0xc9))[_0xfaf9('0x40')](handleError(_0x123743,null));};exports['destroy']=function(_0x554785,_0x316e73,_0x2d53bf){var _0x19242e;return db[_0xfaf9('0x29')]['find']({'where':{'id':_0x554785['params']['id']}})[_0xfaf9('0x21')](function(_0x4e9602){if(_0x4e9602){return db[_0xfaf9('0x49')]['transaction'](function(_0x32adbb){return _0x4e9602[_0xfaf9('0x24')]({'transaction':_0x32adbb,'raw':!![]})['then'](function(_0x298d52){if(_0x298d52[_0xfaf9('0x4d')]){fs[_0xfaf9('0x55')](_0x298d52[_0xfaf9('0x4d')])[_0xfaf9('0x56')](function(_0x450a48){fs[_0xfaf9('0x57')](path[_0xfaf9('0x58')](_0x298d52[_0xfaf9('0x4d')],_0x450a48));});fs['rmdirSync'](_0x298d52[_0xfaf9('0x4d')]);}return _0x298d52;});})[_0xfaf9('0x40')](function(_0x5deb8b){throw new db['Sequelize'][(_0xfaf9('0x59'))](_0x5deb8b[_0xfaf9('0x5a')]);});}})[_0xfaf9('0x21')](handleEntityNotFound(_0x316e73,null))[_0xfaf9('0x21')](removeEntity(_0x316e73,null))[_0xfaf9('0x40')](handleError(_0x316e73,null));};exports[_0xfaf9('0x5b')]=function(_0x5afdd2,_0x153293,_0x3d1487){return db[_0xfaf9('0x49')]['transaction'](function(_0x3e6fad){var _0xd94920;return db[_0xfaf9('0x29')][_0xfaf9('0x46')]({'where':{'id':_0x5afdd2[_0xfaf9('0x41')]['id']}})[_0xfaf9('0x21')](function(_0x2d340b){if(_0x2d340b){_0xd94920=_0x2d340b;return _0x2d340b[_0xfaf9('0x5b')](_0x5afdd2[_0xfaf9('0x47')]['id'],{'transaction':_0x3e6fad});}})[_0xfaf9('0x21')](function(_0x1ea60b){if(_0x1ea60b){return db[_0xfaf9('0x5c')]['findOne']({'where':{'id':_0x5afdd2[_0xfaf9('0x47')]['id']},'attributes':['id','name',_0xfaf9('0x5d'),_0xfaf9('0x5e'),'createdAt'],'raw':!![]});}})['then'](function(_0x421c49){if(_0x421c49){var _0x24698a=path[_0xfaf9('0x58')](config['root'],_0xfaf9('0x5f'),util['format']('%s.%s',path[_0xfaf9('0x60')](_0x421c49[_0xfaf9('0x5d')],path[_0xfaf9('0x61')](_0x421c49[_0xfaf9('0x5d')])),_0x421c49[_0xfaf9('0x5e')]));var _0x3cfe0d=path[_0xfaf9('0x58')](config[_0xfaf9('0x62')],_0xfaf9('0x63'),_0xd94920[_0xfaf9('0x26')],util[_0xfaf9('0x64')](_0xfaf9('0x65'),_0x421c49[_0xfaf9('0x26')],_0x421c49[_0xfaf9('0x5e')]));fs[_0xfaf9('0x66')](_0x24698a,_0x3cfe0d);return _0x421c49;}})[_0xfaf9('0x40')](function(_0x1795b0){throw new db['Sequelize']['ValidationError'](_0x1795b0[_0xfaf9('0x5a')]);});})['then'](handleEntityNotFound(_0x153293,null))[_0xfaf9('0x21')](respondWithResult(_0x153293,0xc9))[_0xfaf9('0x40')](handleError(_0x153293,null));};exports['removeSound']=function(_0x26783d,_0x5557cd,_0x32d36c){return db[_0xfaf9('0x49')][_0xfaf9('0x4a')](function(_0x55e51e){var _0x2fc6f0;return db[_0xfaf9('0x29')][_0xfaf9('0x67')]({'where':{'id':_0x26783d[_0xfaf9('0x41')]['id']}})[_0xfaf9('0x21')](handleEntityNotFound(_0x5557cd,null))[_0xfaf9('0x21')](function(_0x5da6aa){if(_0x5da6aa){_0x2fc6f0=_0x5da6aa;return _0x5da6aa[_0xfaf9('0x68')](_0x26783d[_0xfaf9('0x41')]['id2']);}})[_0xfaf9('0x21')](function(_0x55aac7){if(_0x55aac7){return db[_0xfaf9('0x5c')][_0xfaf9('0x67')]({'where':{'id':_0x26783d[_0xfaf9('0x41')]['id2']},'attributes':['id',_0xfaf9('0x26'),_0xfaf9('0x5d'),_0xfaf9('0x5e'),'createdAt'],'raw':!![]});}})['then'](function(_0x1833fb){if(_0x1833fb){fs[_0xfaf9('0x57')](path[_0xfaf9('0x58')](_0x2fc6f0[_0xfaf9('0x4d')],util['format'](_0xfaf9('0x65'),_0x1833fb[_0xfaf9('0x26')],_0x1833fb[_0xfaf9('0x5e')])));return _0x1833fb;}})[_0xfaf9('0x40')](function(_0x257f1b){throw new db[(_0xfaf9('0x69'))]['ValidationError'](_0x257f1b[_0xfaf9('0x5a')]);});})[_0xfaf9('0x21')](handleEntityNotFound(_0x5557cd,null))[_0xfaf9('0x21')](respondWithStatusCode(_0x5557cd,0xcc))[_0xfaf9('0x40')](handleError(_0x5557cd,null));};exports[_0xfaf9('0x6a')]=function(_0x1d5010,_0x235026,_0x8f1e0){var _0x677c8c={};var _0x5b0310={};var _0x45dd24;var _0x31ac82;return db['VoiceMusicOnHold'][_0xfaf9('0x67')]({'where':{'id':_0x1d5010['params']['id']}})['then'](handleEntityNotFound(_0x235026,null))['then'](function(_0x452f91){if(_0x452f91){_0x45dd24=_0x452f91;_0x5b0310[_0xfaf9('0x31')]=_[_0xfaf9('0x2e')](db[_0xfaf9('0x5c')][_0xfaf9('0x42')]);_0x5b0310[_0xfaf9('0x2d')]=_[_0xfaf9('0x2e')](_0x1d5010[_0xfaf9('0x2d')]);_0x5b0310[_0xfaf9('0x2f')]=_[_0xfaf9('0x30')](_0x5b0310[_0xfaf9('0x31')],_0x5b0310[_0xfaf9('0x2d')]);_0x677c8c[_0xfaf9('0x32')]=_['intersection'](_0x5b0310['model'],qs[_0xfaf9('0x33')](_0x1d5010[_0xfaf9('0x2d')][_0xfaf9('0x33')]));_0x677c8c[_0xfaf9('0x32')]=_0x677c8c['attributes'][_0xfaf9('0x43')]?_0x677c8c[_0xfaf9('0x32')]:_0x5b0310[_0xfaf9('0x31')];_0x677c8c[_0xfaf9('0x36')]=qs[_0xfaf9('0x37')](_0x1d5010[_0xfaf9('0x2d')][_0xfaf9('0x37')]);_0x677c8c['where']=qs[_0xfaf9('0x2f')](_['pick'](_0x1d5010[_0xfaf9('0x2d')],_0x5b0310[_0xfaf9('0x2f')]));if(_0x1d5010[_0xfaf9('0x2d')][_0xfaf9('0x3c')]){_0x677c8c['where']=_[_0xfaf9('0x3a')](_0x677c8c['where'],{'$or':_[_0xfaf9('0x28')](_0x677c8c[_0xfaf9('0x32')],function(_0x375ea2){var _0x7e7a57={};_0x7e7a57[_0x375ea2]={'$like':'%'+_0x1d5010[_0xfaf9('0x2d')][_0xfaf9('0x3c')]+'%'};return _0x7e7a57;})});}_0x677c8c=_[_0xfaf9('0x3a')]({},_0x677c8c,_0x1d5010[_0xfaf9('0x45')]);return _0x45dd24['getSounds'](_0x677c8c);}})[_0xfaf9('0x21')](function(_0x57691d){if(_0x57691d){_0x31ac82=_0x57691d['length'];if(!_0x1d5010[_0xfaf9('0x2d')][_0xfaf9('0x34')](_0xfaf9('0x35'))){_0x677c8c[_0xfaf9('0x1a')]=qs[_0xfaf9('0x1a')](_0x1d5010[_0xfaf9('0x2d')][_0xfaf9('0x1a')]);_0x677c8c[_0xfaf9('0x19')]=qs[_0xfaf9('0x19')](_0x1d5010[_0xfaf9('0x2d')][_0xfaf9('0x19')]);}return _0x45dd24['getSounds'](_0x677c8c);}})['then'](function(_0x72c7bf){if(_0x72c7bf){return _0x72c7bf?{'count':_0x31ac82,'rows':_0x72c7bf}:null;}})[_0xfaf9('0x21')](respondWithResult(_0x235026,null))[_0xfaf9('0x40')](handleError(_0x235026,null));}; \ No newline at end of file +var _0x593f=['mode','directory','join','root','server/files/moh','files','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','getSounds','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','json','reject','save','destroy','then','get','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceMusicOnHold','include','findAll','catch','show','params','find','update','body','create','sequelize'];(function(_0x1b65cb,_0x3f0770){var _0x47dacb=function(_0x2efd49){while(--_0x2efd49){_0x1b65cb['push'](_0x1b65cb['shift']());}};_0x47dacb(++_0x3f0770);}(_0x593f,0x174));var _0xf593=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x593f[_0x503950];return _0x1657a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf593('0x0'));var zipdir=require(_0xf593('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf593('0x2'));var moment=require(_0xf593('0x3'));var BPromise=require(_0xf593('0x4'));var Mustache=require('mustache');var util=require(_0xf593('0x5'));var path=require(_0xf593('0x6'));var sox=require(_0xf593('0x7'));var csv=require(_0xf593('0x8'));var ejs=require(_0xf593('0x9'));var fs=require('fs');var fs_extra=require(_0xf593('0xa'));var _=require(_0xf593('0xb'));var squel=require('squel');var crypto=require(_0xf593('0xc'));var jsforce=require(_0xf593('0xd'));var deskjs=require(_0xf593('0xe'));var toCsv=require(_0xf593('0x8'));var querystring=require(_0xf593('0xf'));var Papa=require('papaparse');var Redis=require(_0xf593('0x10'));var authService=require(_0xf593('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf593('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf593('0x13'))(_0xf593('0x14'));var utils=require('../../config/utils');var config=require(_0xf593('0x15'));var licenseUtil=require(_0xf593('0x16'));var db=require(_0xf593('0x17'))['db'];function respondWithStatusCode(_0x3b3134,_0x552414){_0x552414=_0x552414||0xcc;return function(_0x5b8e1c){if(_0x5b8e1c){return _0x3b3134[_0xf593('0x18')](_0x552414);}return _0x3b3134['status'](_0x552414)[_0xf593('0x19')]();};}function respondWithResult(_0x41cb8b,_0xb965e3){_0xb965e3=_0xb965e3||0xc8;return function(_0x1d3645){if(_0x1d3645){return _0x41cb8b[_0xf593('0x1a')](_0xb965e3)['json'](_0x1d3645);}};}function respondWithFilteredResult(_0x487062,_0x4e2653){return function(_0xffc16c){if(_0xffc16c){var _0x3fbd49=typeof _0x4e2653[_0xf593('0x1b')]===_0xf593('0x1c')&&typeof _0x4e2653[_0xf593('0x1d')]===_0xf593('0x1c');var _0x259e02=_0xffc16c[_0xf593('0x1e')];var _0x383573=_0x3fbd49?0x0:_0x4e2653[_0xf593('0x1b')];var _0x463cf1=_0x3fbd49?_0xffc16c[_0xf593('0x1e')]:_0x4e2653[_0xf593('0x1b')]+_0x4e2653[_0xf593('0x1d')];var _0x13c7da;if(_0x463cf1>=_0x259e02){_0x463cf1=_0x259e02;_0x13c7da=0xc8;}else{_0x13c7da=0xce;}_0x487062[_0xf593('0x1a')](_0x13c7da);return _0x487062['set']('Content-Range',_0x383573+'-'+_0x463cf1+'/'+_0x259e02)[_0xf593('0x1f')](_0xffc16c);}return null;};}function patchUpdates(_0x413bd5){return function(_0x8f3023){try{jsonpatch['apply'](_0x8f3023,_0x413bd5,!![]);}catch(_0x5b8567){return BPromise[_0xf593('0x20')](_0x5b8567);}return _0x8f3023[_0xf593('0x21')]();};}function saveUpdates(_0x2870d0,_0x4eee38){return function(_0x3e858f){if(_0x3e858f){return _0x3e858f['update'](_0x2870d0)['then'](function(_0x20c083){return _0x20c083;});}return null;};}function removeEntity(_0x3d9cd2,_0x3f2482){return function(_0x5894ad){if(_0x5894ad){return _0x5894ad[_0xf593('0x22')]()[_0xf593('0x23')](function(){var _0x1e87c0=_0x5894ad[_0xf593('0x24')]({'plain':!![]});var _0x6f3e85='MusicOnHolds';return db[_0xf593('0x25')]['destroy']({'where':{'type':_0x6f3e85,'resourceId':_0x1e87c0['id']}})[_0xf593('0x23')](function(){return _0x5894ad;});})['then'](function(){_0x3d9cd2[_0xf593('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22bedc,_0x1f01fd){return function(_0x1c558a){if(!_0x1c558a){_0x22bedc['sendStatus'](0x194);}return _0x1c558a;};}function handleError(_0x19337b,_0x18498d){_0x18498d=_0x18498d||0x1f4;return function(_0x56b2b4){logger[_0xf593('0x26')](_0x56b2b4[_0xf593('0x27')]);if(_0x56b2b4[_0xf593('0x28')]){delete _0x56b2b4['name'];}_0x19337b['status'](_0x18498d)['send'](_0x56b2b4);};}exports[_0xf593('0x29')]=function(_0x28c16b,_0x50c97b){var _0xca0b5c={},_0x5d4e30={},_0x28bff2={'count':0x0,'rows':[]};var _0x1fe6dc=_[_0xf593('0x2a')](db['VoiceMusicOnHold'][_0xf593('0x2b')],function(_0x18aa5b){return{'name':_0x18aa5b[_0xf593('0x2c')],'type':_0x18aa5b[_0xf593('0x2d')][_0xf593('0x2e')]};});_0x5d4e30[_0xf593('0x2f')]=_[_0xf593('0x2a')](_0x1fe6dc,_0xf593('0x28'));_0x5d4e30[_0xf593('0x30')]=_[_0xf593('0x31')](_0x28c16b[_0xf593('0x30')]);_0x5d4e30[_0xf593('0x32')]=_[_0xf593('0x33')](_0x5d4e30[_0xf593('0x2f')],_0x5d4e30['query']);_0xca0b5c[_0xf593('0x34')]=_[_0xf593('0x33')](_0x5d4e30[_0xf593('0x2f')],qs[_0xf593('0x35')](_0x28c16b[_0xf593('0x30')]['fields']));_0xca0b5c[_0xf593('0x34')]=_0xca0b5c[_0xf593('0x34')][_0xf593('0x36')]?_0xca0b5c['attributes']:_0x5d4e30['model'];if(!_0x28c16b[_0xf593('0x30')][_0xf593('0x37')](_0xf593('0x38'))){_0xca0b5c[_0xf593('0x1d')]=qs[_0xf593('0x1d')](_0x28c16b[_0xf593('0x30')][_0xf593('0x1d')]);_0xca0b5c[_0xf593('0x1b')]=qs[_0xf593('0x1b')](_0x28c16b[_0xf593('0x30')][_0xf593('0x1b')]);}_0xca0b5c[_0xf593('0x39')]=qs[_0xf593('0x3a')](_0x28c16b[_0xf593('0x30')][_0xf593('0x3a')]);delete _0x28c16b['query'][_0xf593('0x3a')];_0xca0b5c[_0xf593('0x3b')]=qs[_0xf593('0x32')](_[_0xf593('0x3c')](_0x28c16b['query'],_0x5d4e30[_0xf593('0x32')]),_0x1fe6dc);if(_0x28c16b[_0xf593('0x30')][_0xf593('0x3d')]){_0xca0b5c[_0xf593('0x3b')]=_['merge'](_0xca0b5c['where'],{'$or':_['map'](_0x1fe6dc,function(_0x427c9f){if(_0x427c9f[_0xf593('0x2d')]!==_0xf593('0x3e')){var _0x23afba={};_0x23afba[_0x427c9f[_0xf593('0x28')]]={'$like':'%'+_0x28c16b[_0xf593('0x30')]['filter']+'%'};return _0x23afba;}})});}_0xca0b5c=_[_0xf593('0x3f')]({},_0xca0b5c,_0x28c16b[_0xf593('0x40')]);var _0x173914={'where':_0xca0b5c['where']};return db[_0xf593('0x41')]['count'](_0x173914)[_0xf593('0x23')](function(_0x455f5f){_0x28bff2[_0xf593('0x1e')]=_0x455f5f;if(_0x28c16b[_0xf593('0x30')]['includeAll']){_0xca0b5c[_0xf593('0x42')]=[{'all':!![]}];}return db[_0xf593('0x41')][_0xf593('0x43')](_0xca0b5c);})[_0xf593('0x23')](function(_0x50d2a3){_0x28bff2['rows']=_0x50d2a3;return _0x28bff2;})[_0xf593('0x23')](respondWithFilteredResult(_0x50c97b,_0xca0b5c))[_0xf593('0x44')](handleError(_0x50c97b,null));};exports[_0xf593('0x45')]=function(_0x1c5237,_0x273938){var _0x1a67a9={'raw':![],'where':{'id':_0x1c5237[_0xf593('0x46')]['id']}},_0x1ffd13={};_0x1ffd13[_0xf593('0x2f')]=_[_0xf593('0x31')](db[_0xf593('0x41')][_0xf593('0x2b')]);_0x1ffd13[_0xf593('0x30')]=_[_0xf593('0x31')](_0x1c5237['query']);_0x1ffd13[_0xf593('0x32')]=_[_0xf593('0x33')](_0x1ffd13['model'],_0x1ffd13[_0xf593('0x30')]);_0x1a67a9[_0xf593('0x34')]=_[_0xf593('0x33')](_0x1ffd13[_0xf593('0x2f')],qs['fields'](_0x1c5237['query'][_0xf593('0x35')]));_0x1a67a9[_0xf593('0x34')]=_0x1a67a9[_0xf593('0x34')][_0xf593('0x36')]?_0x1a67a9[_0xf593('0x34')]:_0x1ffd13[_0xf593('0x2f')];if(_0x1c5237[_0xf593('0x30')]['includeAll']){_0x1a67a9[_0xf593('0x42')]=[{'all':!![]}];}_0x1a67a9=_[_0xf593('0x3f')]({},_0x1a67a9,_0x1c5237['options']);return db[_0xf593('0x41')][_0xf593('0x47')](_0x1a67a9)[_0xf593('0x23')](handleEntityNotFound(_0x273938,null))[_0xf593('0x23')](respondWithResult(_0x273938,null))[_0xf593('0x44')](handleError(_0x273938,null));};exports[_0xf593('0x48')]=function(_0x38d859,_0x3e3d17){if(_0x38d859[_0xf593('0x49')]['id']){delete _0x38d859[_0xf593('0x49')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x38d859[_0xf593('0x46')]['id']}})[_0xf593('0x23')](handleEntityNotFound(_0x3e3d17,null))[_0xf593('0x23')](saveUpdates(_0x38d859[_0xf593('0x49')],null))[_0xf593('0x23')](respondWithResult(_0x3e3d17,null))['catch'](handleError(_0x3e3d17,null));};exports[_0xf593('0x4a')]=function(_0x13d023,_0x28684e,_0xe2dd3d){return db[_0xf593('0x4b')]['transaction'](function(_0x4d4ac4){if(_0x13d023[_0xf593('0x49')][_0xf593('0x4c')]==='files'){_0x13d023['body'][_0xf593('0x4d')]=path[_0xf593('0x4e')](config[_0xf593('0x4f')],_0xf593('0x50'),_0x13d023['body']['name']);}return db['VoiceMusicOnHold'][_0xf593('0x4a')](_0x13d023[_0xf593('0x49')],{'transaction':_0x4d4ac4})['then'](function(_0x561747){if(_0x13d023[_0xf593('0x49')][_0xf593('0x4c')]===_0xf593('0x51')){fs[_0xf593('0x52')](_0x561747[_0xf593('0x4d')],parseInt(_0xf593('0x53'),0x8));}var _0x4c537c=_0x13d023[_0xf593('0x54')]['get']({'plain':!![]});if(!_0x4c537c)throw new Error(_0xf593('0x55'));if(_0x4c537c[_0xf593('0x56')]==='user'){var _0xdecb81=_0x561747[_0xf593('0x24')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xf593('0x57'),'userProfileId':_0x4c537c[_0xf593('0x58')]},'raw':!![]})[_0xf593('0x23')](function(_0x54cba8){if(_0x54cba8&&_0x54cba8['autoAssociation']===0x0){return db[_0xf593('0x25')]['create']({'name':_0xdecb81[_0xf593('0x28')],'resourceId':_0xdecb81['id'],'type':_0x54cba8[_0xf593('0x28')],'sectionId':_0x54cba8['id']},{})['then'](function(){return _0x561747;});}else{return _0x561747;}})[_0xf593('0x44')](function(_0x1a53af){logger[_0xf593('0x26')](_0xf593('0x59'),_0x1a53af);});}return _0x561747;});})[_0xf593('0x23')](respondWithResult(_0x28684e,0xc9))[_0xf593('0x44')](handleError(_0x28684e,null));};exports[_0xf593('0x22')]=function(_0x118f90,_0x56776c,_0x1f4968){var _0x237fe7;return db[_0xf593('0x41')][_0xf593('0x47')]({'where':{'id':_0x118f90[_0xf593('0x46')]['id']}})[_0xf593('0x23')](function(_0x51693d){if(_0x51693d){return db['sequelize'][_0xf593('0x5a')](function(_0x120cab){return _0x51693d[_0xf593('0x22')]({'transaction':_0x120cab,'raw':!![]})['then'](function(_0x12e58a){if(_0x12e58a['directory']){fs[_0xf593('0x5b')](_0x12e58a[_0xf593('0x4d')])['forEach'](function(_0x20cae8){fs[_0xf593('0x5c')](path[_0xf593('0x4e')](_0x12e58a['directory'],_0x20cae8));});fs[_0xf593('0x5d')](_0x12e58a['directory']);}return _0x12e58a;});})['catch'](function(_0x4dae51){throw new db[(_0xf593('0x5e'))][(_0xf593('0x5f'))](_0x4dae51[_0xf593('0x60')]);});}})['then'](handleEntityNotFound(_0x56776c,null))[_0xf593('0x23')](removeEntity(_0x56776c,null))['catch'](handleError(_0x56776c,null));};exports[_0xf593('0x61')]=function(_0x148786,_0x46e531,_0x315028){return db[_0xf593('0x4b')]['transaction'](function(_0x5c8a3d){var _0x53da01;return db[_0xf593('0x41')][_0xf593('0x47')]({'where':{'id':_0x148786[_0xf593('0x46')]['id']}})['then'](function(_0xc40aa4){if(_0xc40aa4){_0x53da01=_0xc40aa4;return _0xc40aa4[_0xf593('0x61')](_0x148786[_0xf593('0x49')]['id'],{'transaction':_0x5c8a3d});}})['then'](function(_0xeaaa3d){if(_0xeaaa3d){return db[_0xf593('0x62')][_0xf593('0x63')]({'where':{'id':_0x148786['body']['id']},'attributes':['id',_0xf593('0x28'),_0xf593('0x64'),_0xf593('0x65'),_0xf593('0x66')],'raw':!![]});}})[_0xf593('0x23')](function(_0x4fdf02){if(_0x4fdf02){var _0x190a14=path[_0xf593('0x4e')](config['root'],_0xf593('0x67'),util[_0xf593('0x68')](_0xf593('0x69'),path[_0xf593('0x6a')](_0x4fdf02[_0xf593('0x64')],path[_0xf593('0x6b')](_0x4fdf02[_0xf593('0x64')])),_0x4fdf02[_0xf593('0x65')]));var _0x4861c6=path[_0xf593('0x4e')](config[_0xf593('0x4f')],'server/files/moh',_0x53da01[_0xf593('0x28')],util[_0xf593('0x68')](_0xf593('0x69'),_0x4fdf02[_0xf593('0x28')],_0x4fdf02['converted_format']));fs[_0xf593('0x6c')](_0x190a14,_0x4861c6);return _0x4fdf02;}})['catch'](function(_0x4ee7eb){throw new db['Sequelize']['ValidationError'](_0x4ee7eb[_0xf593('0x60')]);});})[_0xf593('0x23')](handleEntityNotFound(_0x46e531,null))[_0xf593('0x23')](respondWithResult(_0x46e531,0xc9))[_0xf593('0x44')](handleError(_0x46e531,null));};exports[_0xf593('0x6d')]=function(_0x43c066,_0x158ebe,_0x48a95){return db[_0xf593('0x4b')][_0xf593('0x5a')](function(_0x2103ad){var _0x37cbbb;return db[_0xf593('0x41')]['findOne']({'where':{'id':_0x43c066[_0xf593('0x46')]['id']}})[_0xf593('0x23')](handleEntityNotFound(_0x158ebe,null))[_0xf593('0x23')](function(_0x10f720){if(_0x10f720){_0x37cbbb=_0x10f720;return _0x10f720[_0xf593('0x6d')](_0x43c066[_0xf593('0x46')][_0xf593('0x6e')]);}})[_0xf593('0x23')](function(_0x1709b3){if(_0x1709b3){return db['Sound'][_0xf593('0x63')]({'where':{'id':_0x43c066[_0xf593('0x46')]['id2']},'attributes':['id',_0xf593('0x28'),_0xf593('0x64'),_0xf593('0x65'),_0xf593('0x66')],'raw':!![]});}})['then'](function(_0x26fc7c){if(_0x26fc7c){fs[_0xf593('0x5c')](path[_0xf593('0x4e')](_0x37cbbb[_0xf593('0x4d')],util['format'](_0xf593('0x69'),_0x26fc7c[_0xf593('0x28')],_0x26fc7c['converted_format'])));return _0x26fc7c;}})['catch'](function(_0x16644c){throw new db[(_0xf593('0x5e'))][(_0xf593('0x5f'))](_0x16644c[_0xf593('0x60')]);});})[_0xf593('0x23')](handleEntityNotFound(_0x158ebe,null))[_0xf593('0x23')](respondWithStatusCode(_0x158ebe,0xcc))[_0xf593('0x44')](handleError(_0x158ebe,null));};exports[_0xf593('0x6f')]=function(_0x46f46d,_0x1cee8b,_0x21eff8){var _0x233184={};var _0x94903f={};var _0x3d55de;var _0x315856;return db['VoiceMusicOnHold'][_0xf593('0x63')]({'where':{'id':_0x46f46d[_0xf593('0x46')]['id']}})['then'](handleEntityNotFound(_0x1cee8b,null))[_0xf593('0x23')](function(_0x5e7cfb){if(_0x5e7cfb){_0x3d55de=_0x5e7cfb;_0x94903f[_0xf593('0x2f')]=_['keys'](db[_0xf593('0x62')][_0xf593('0x2b')]);_0x94903f[_0xf593('0x30')]=_[_0xf593('0x31')](_0x46f46d[_0xf593('0x30')]);_0x94903f[_0xf593('0x32')]=_[_0xf593('0x33')](_0x94903f[_0xf593('0x2f')],_0x94903f[_0xf593('0x30')]);_0x233184[_0xf593('0x34')]=_['intersection'](_0x94903f[_0xf593('0x2f')],qs[_0xf593('0x35')](_0x46f46d['query'][_0xf593('0x35')]));_0x233184[_0xf593('0x34')]=_0x233184[_0xf593('0x34')][_0xf593('0x36')]?_0x233184[_0xf593('0x34')]:_0x94903f[_0xf593('0x2f')];_0x233184['order']=qs['sort'](_0x46f46d[_0xf593('0x30')][_0xf593('0x3a')]);_0x233184[_0xf593('0x3b')]=qs[_0xf593('0x32')](_[_0xf593('0x3c')](_0x46f46d[_0xf593('0x30')],_0x94903f[_0xf593('0x32')]));if(_0x46f46d[_0xf593('0x30')][_0xf593('0x3d')]){_0x233184[_0xf593('0x3b')]=_[_0xf593('0x3f')](_0x233184['where'],{'$or':_['map'](_0x233184[_0xf593('0x34')],function(_0x5bbb5e){var _0xb27344={};_0xb27344[_0x5bbb5e]={'$like':'%'+_0x46f46d['query'][_0xf593('0x3d')]+'%'};return _0xb27344;})});}_0x233184=_[_0xf593('0x3f')]({},_0x233184,_0x46f46d['options']);return _0x3d55de[_0xf593('0x6f')](_0x233184);}})['then'](function(_0x43b992){if(_0x43b992){_0x315856=_0x43b992[_0xf593('0x36')];if(!_0x46f46d['query'][_0xf593('0x37')]('nolimit')){_0x233184[_0xf593('0x1d')]=qs[_0xf593('0x1d')](_0x46f46d[_0xf593('0x30')][_0xf593('0x1d')]);_0x233184[_0xf593('0x1b')]=qs[_0xf593('0x1b')](_0x46f46d['query'][_0xf593('0x1b')]);}return _0x3d55de[_0xf593('0x6f')](_0x233184);}})['then'](function(_0xd222a3){if(_0xd222a3){return _0xd222a3?{'count':_0x315856,'rows':_0xd222a3}:null;}})[_0xf593('0x23')](respondWithResult(_0x1cee8b,null))['catch'](handleError(_0x1cee8b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 2ae6294..1ec99d0 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 _0x9719=['voice_musiconhold','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold'];(function(_0x23fcad,_0x2b4c2e){var _0x3e4d60=function(_0x2a25a9){while(--_0x2a25a9){_0x23fcad['push'](_0x23fcad['shift']());}};_0x3e4d60(++_0x2b4c2e);}(_0x9719,0x1e5));var _0x9971=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x9719[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x9971('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9971('0x1'));var BPromise=require(_0x9971('0x2'));var rp=require(_0x9971('0x3'));var fs=require('fs');var path=require(_0x9971('0x4'));var rimraf=require(_0x9971('0x5'));var config=require(_0x9971('0x6'));var attributes=require(_0x9971('0x7'));module['exports']=function(_0x5c1868,_0x91fcf2){return _0x5c1868[_0x9971('0x8')](_0x9971('0x9'),attributes,{'tableName':_0x9971('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f4f=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0x8f4f,0x1ac));var _0xf8f4=function(_0x5ab136,_0x5a0be0){_0x5ab136=_0x5ab136-0x0;var _0x5791bb=_0x8f4f[_0x5ab136];return _0x5791bb;};'use strict';var _=require(_0xf8f4('0x0'));var util=require(_0xf8f4('0x1'));var logger=require(_0xf8f4('0x2'))(_0xf8f4('0x3'));var moment=require(_0xf8f4('0x4'));var BPromise=require(_0xf8f4('0x5'));var rp=require(_0xf8f4('0x6'));var fs=require('fs');var path=require(_0xf8f4('0x7'));var rimraf=require(_0xf8f4('0x8'));var config=require(_0xf8f4('0x9'));var attributes=require(_0xf8f4('0xa'));module[_0xf8f4('0xb')]=function(_0x1c6b9a,_0x125555){return _0x1c6b9a[_0xf8f4('0xc')](_0xf8f4('0xd'),attributes,{'tableName':_0xf8f4('0xe'),'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 e709fd2..df3d8c6 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x45ea53,_0x3952ba){var _0x568900=function(_0x3dae23){while(--_0x3dae23){_0x45ea53['push'](_0x45ea53['shift']());}};_0x568900(++_0x3952ba);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +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(_0xae3985,_0x284843){var _0x1e91a3=function(_0x1e43c8){while(--_0x1e43c8){_0xae3985['push'](_0xae3985['shift']());}};_0x1e91a3(++_0x284843);}(_0x70e0,0x17b));var _0x070e=function(_0x4c5ea3,_0xd6bdcf){_0x4c5ea3=_0x4c5ea3-0x0;var _0x3fd6ff=_0x70e0[_0x4c5ea3];return _0x3fd6ff;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index ba5c8e6..e9e3919 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 _0x39b3=['exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','create','post','addAgents','/:id/teams','update','delete','removeAgents','removeTeams'];(function(_0x4e6d56,_0x3a7f7b){var _0x415041=function(_0x187bdd){while(--_0x187bdd){_0x4e6d56['push'](_0x4e6d56['shift']());}};_0x415041(++_0x3a7f7b);}(_0x39b3,0xc9));var _0x339b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x39b3[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x339b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x339b('0x1'));var express=require('express');var router=express[_0x339b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x339b('0x3'));var interaction=require(_0x339b('0x4'));var config=require(_0x339b('0x5'));var controller=require(_0x339b('0x6'));router[_0x339b('0x7')]('/',auth[_0x339b('0x8')](),controller[_0x339b('0x9')]);router[_0x339b('0x7')](_0x339b('0xa'),auth[_0x339b('0x8')](),controller[_0x339b('0xb')]);router[_0x339b('0x7')](_0x339b('0xc'),auth[_0x339b('0x8')](),controller[_0x339b('0xd')]);router[_0x339b('0x7')](_0x339b('0xe'),auth[_0x339b('0x8')](),controller[_0x339b('0xf')]);router[_0x339b('0x7')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router['post']('/',auth[_0x339b('0x8')](),controller[_0x339b('0x10')]);router[_0x339b('0x11')](_0x339b('0xe'),auth['isAuthenticated'](),controller[_0x339b('0x12')]);router[_0x339b('0x11')](_0x339b('0x13'),auth[_0x339b('0x8')](),controller['addTeams']);router['put']('/:id',auth[_0x339b('0x8')](),controller[_0x339b('0x14')]);router['delete'](_0x339b('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x339b('0x15')](_0x339b('0xe'),auth[_0x339b('0x8')](),controller[_0x339b('0x16')]);router[_0x339b('0x15')]('/:id/teams',auth[_0x339b('0x8')](),controller[_0x339b('0x17')]);module[_0x339b('0x18')]=router; \ No newline at end of file +var _0x3821=['../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','getAgents','/:id/teams','getTeams','post','create','/:id/users','addTeams','/:id','update','delete','destroy','removeAgents','exports','multer','connect-timeout','fs-extra'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x3821,0xf7));var _0x1382=function(_0x1ff2c6,_0x21c9b8){_0x1ff2c6=_0x1ff2c6-0x0;var _0x308eb9=_0x3821[_0x1ff2c6];return _0x308eb9;};'use strict';var multer=require(_0x1382('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1382('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1382('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x1382('0x3'));var config=require(_0x1382('0x4'));var controller=require(_0x1382('0x5'));router[_0x1382('0x6')]('/',auth[_0x1382('0x7')](),controller[_0x1382('0x8')]);router[_0x1382('0x6')](_0x1382('0x9'),auth[_0x1382('0x7')](),controller[_0x1382('0xa')]);router[_0x1382('0x6')]('/:id',auth[_0x1382('0x7')](),controller[_0x1382('0xb')]);router[_0x1382('0x6')]('/:id/users',auth[_0x1382('0x7')](),controller[_0x1382('0xc')]);router[_0x1382('0x6')](_0x1382('0xd'),auth[_0x1382('0x7')](),controller[_0x1382('0xe')]);router[_0x1382('0xf')]('/',auth[_0x1382('0x7')](),controller[_0x1382('0x10')]);router[_0x1382('0xf')](_0x1382('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0x1382('0xf')](_0x1382('0xd'),auth['isAuthenticated'](),controller[_0x1382('0x12')]);router['put'](_0x1382('0x13'),auth['isAuthenticated'](),controller[_0x1382('0x14')]);router[_0x1382('0x15')](_0x1382('0x13'),auth[_0x1382('0x7')](),controller[_0x1382('0x16')]);router[_0x1382('0x15')](_0x1382('0x11'),auth[_0x1382('0x7')](),controller[_0x1382('0x17')]);router[_0x1382('0x15')](_0x1382('0xd'),auth[_0x1382('0x7')](),controller['removeTeams']);module[_0x1382('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 88b651e..b59b439 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 _0x04c0=['getDataValue','INTEGER','STRING','name','VIRTUAL','system-'];(function(_0x58ff04,_0x172b1e){var _0x464257=function(_0x3227af){while(--_0x3227af){_0x58ff04['push'](_0x58ff04['shift']());}};_0x464257(++_0x172b1e);}(_0x04c0,0x6e));var _0x004c=function(_0x32d592,_0x1d8461){_0x32d592=_0x32d592-0x0;var _0x1309f1=_0x04c0[_0x32d592];return _0x1309f1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x004c('0x0')],'allowNull':![],'unique':_0x004c('0x1')},'prefix':{'type':Sequelize[_0x004c('0x2')],'get':function(_0x52b931){return _0x004c('0x3')+this[_0x004c('0x4')](_0x004c('0x1'))+'-';}},'description':{'type':Sequelize[_0x004c('0x0')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x004c('0x5')]}}; \ No newline at end of file +var _0xf1a3=['STRING','INTEGER','sequelize','exports','name','VIRTUAL','system-'];(function(_0x4fc1b5,_0x161ecc){var _0x540747=function(_0x230be3){while(--_0x230be3){_0x4fc1b5['push'](_0x4fc1b5['shift']());}};_0x540747(++_0x161ecc);}(_0xf1a3,0x72));var _0x3f1a=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xf1a3[_0x5d80de];return _0x1c7556;};'use strict';var Sequelize=require(_0x3f1a('0x0'));module[_0x3f1a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3f1a('0x2')},'prefix':{'type':Sequelize[_0x3f1a('0x3')],'get':function(_0x5d5929){return _0x3f1a('0x4')+this['getDataValue'](_0x3f1a('0x2'))+'-';}},'description':{'type':Sequelize[_0x3f1a('0x5')]},'callerIdAll':{'type':Sequelize[_0x3f1a('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x3f1a('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 9ff7fec..4752549 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 _0xb03e=['from','team_has_voice_prefixes','join','user_has_teams','clone','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','index','VoicePrefix','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','keys','fields','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','Agents','online','flatMap','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId'];(function(_0x4ee8f2,_0x3b3dd8){var _0x2c5675=function(_0x3387ab){while(--_0x3387ab){_0x4ee8f2['push'](_0x4ee8f2['shift']());}};_0x2c5675(++_0x3b3dd8);}(_0xb03e,0x1eb));var _0xeb03=function(_0x53e7ba,_0x29f614){_0x53e7ba=_0x53e7ba-0x0;var _0x99aafd=_0xb03e[_0x53e7ba];return _0x99aafd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];config[_0xeb03('0x1b')]=_[_0xeb03('0x1c')](config[_0xeb03('0x1b')],{'host':_0xeb03('0x1d'),'port':0x18eb});var socket=require(_0xeb03('0x1e'))(new Redis(config[_0xeb03('0x1b')]));require('./voicePrefix.socket')[_0xeb03('0x1f')](socket);function respondWithStatusCode(_0x100bef,_0x372c71){_0x372c71=_0x372c71||0xcc;return function(_0x33f9ba){if(_0x33f9ba){return _0x100bef['sendStatus'](_0x372c71);}return _0x100bef[_0xeb03('0x20')](_0x372c71)[_0xeb03('0x21')]();};}function respondWithResult(_0x3f26ef,_0x478989){_0x478989=_0x478989||0xc8;return function(_0x7ce874){if(_0x7ce874){return _0x3f26ef[_0xeb03('0x20')](_0x478989)[_0xeb03('0x22')](_0x7ce874);}};}function respondWithFilteredResult(_0x44716c,_0x42fa4e){return function(_0x1b4cbd){if(_0x1b4cbd){var _0x167a33=typeof _0x42fa4e[_0xeb03('0x23')]===_0xeb03('0x24')&&typeof _0x42fa4e[_0xeb03('0x25')]===_0xeb03('0x24');var _0x2c238d=_0x1b4cbd[_0xeb03('0x26')];var _0x19bddf=_0x167a33?0x0:_0x42fa4e['offset'];var _0x1bea3f=_0x167a33?_0x1b4cbd[_0xeb03('0x26')]:_0x42fa4e[_0xeb03('0x23')]+_0x42fa4e[_0xeb03('0x25')];var _0xe5a1c2;if(_0x1bea3f>=_0x2c238d){_0x1bea3f=_0x2c238d;_0xe5a1c2=0xc8;}else{_0xe5a1c2=0xce;}_0x44716c[_0xeb03('0x20')](_0xe5a1c2);return _0x44716c[_0xeb03('0x27')](_0xeb03('0x28'),_0x19bddf+'-'+_0x1bea3f+'/'+_0x2c238d)[_0xeb03('0x22')](_0x1b4cbd);}return null;};}function patchUpdates(_0x5a704b){return function(_0x712ac2){try{jsonpatch[_0xeb03('0x29')](_0x712ac2,_0x5a704b,!![]);}catch(_0x11ea85){return BPromise[_0xeb03('0x2a')](_0x11ea85);}return _0x712ac2[_0xeb03('0x2b')]();};}function saveUpdates(_0x5dcda3,_0x638353){return function(_0x406864){if(_0x406864){return _0x406864[_0xeb03('0x2c')](_0x5dcda3)[_0xeb03('0x2d')](function(_0x3f276a){return _0x3f276a;});}return null;};}function removeEntity(_0x119697,_0xb04f34){return function(_0x3f68f3){if(_0x3f68f3){return _0x3f68f3[_0xeb03('0x2e')]()['then'](function(){var _0x832372=_0x3f68f3[_0xeb03('0x2f')]({'plain':!![]});var _0x2683f9=_0xeb03('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x2683f9,'resourceId':_0x832372['id']}})[_0xeb03('0x2d')](function(){return _0x3f68f3;});})['then'](function(){_0x119697[_0xeb03('0x20')](0xcc)[_0xeb03('0x21')]();});}};}function handleEntityNotFound(_0x160a37,_0x5db8bb){return function(_0xd4c8ec){if(!_0xd4c8ec){_0x160a37['sendStatus'](0x194);}return _0xd4c8ec;};}function handleError(_0x5cb729,_0x49e316){_0x49e316=_0x49e316||0x1f4;return function(_0x538d19){logger[_0xeb03('0x31')](_0x538d19[_0xeb03('0x32')]);if(_0x538d19['name']){delete _0x538d19['name'];}_0x5cb729['status'](_0x49e316)['send'](_0x538d19);};}exports[_0xeb03('0x33')]=function(_0x3655c3,_0x32aff7){var _0x2d2ddd={},_0x19fa35={},_0x5234dc={'count':0x0,'rows':[]};var _0x13efc6=_['map'](db[_0xeb03('0x34')][_0xeb03('0x35')],function(_0x19ceae){return{'name':_0x19ceae[_0xeb03('0x36')],'type':_0x19ceae[_0xeb03('0x37')][_0xeb03('0x38')]};});_0x19fa35[_0xeb03('0x39')]=_[_0xeb03('0x3a')](_0x13efc6,'name');_0x19fa35[_0xeb03('0x3b')]=_['keys'](_0x3655c3[_0xeb03('0x3b')]);_0x19fa35[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x19fa35[_0xeb03('0x39')],_0x19fa35[_0xeb03('0x3b')]);_0x2d2ddd[_0xeb03('0x3e')]=_['intersection'](_0x19fa35[_0xeb03('0x39')],qs['fields'](_0x3655c3['query']['fields']));_0x2d2ddd[_0xeb03('0x3e')]=_0x2d2ddd[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x2d2ddd[_0xeb03('0x3e')]:_0x19fa35[_0xeb03('0x39')];if(!_0x3655c3['query'][_0xeb03('0x40')](_0xeb03('0x41'))){_0x2d2ddd[_0xeb03('0x25')]=qs['limit'](_0x3655c3['query'][_0xeb03('0x25')]);_0x2d2ddd[_0xeb03('0x23')]=qs[_0xeb03('0x23')](_0x3655c3['query'][_0xeb03('0x23')]);}_0x2d2ddd[_0xeb03('0x42')]=qs['sort'](_0x3655c3['query'][_0xeb03('0x43')]);_0x2d2ddd[_0xeb03('0x44')]=qs['filters'](_[_0xeb03('0x45')](_0x3655c3[_0xeb03('0x3b')],_0x19fa35[_0xeb03('0x3c')]),_0x13efc6);if(_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x2d2ddd[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x2d2ddd[_0xeb03('0x44')],{'$or':_[_0xeb03('0x3a')](_0x13efc6,function(_0x286f48){if(_0x286f48[_0xeb03('0x37')]!==_0xeb03('0x48')){var _0x2a9348={};_0x2a9348[_0x286f48[_0xeb03('0x49')]]={'$like':'%'+_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x46')]+'%'};return _0x2a9348;}})});}_0x2d2ddd=_[_0xeb03('0x47')]({},_0x2d2ddd,_0x3655c3[_0xeb03('0x4a')]);var _0x35e53d={'where':_0x2d2ddd[_0xeb03('0x44')]};return db[_0xeb03('0x34')][_0xeb03('0x26')](_0x35e53d)[_0xeb03('0x2d')](function(_0x5bb7d9){_0x5234dc['count']=_0x5bb7d9;if(_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x4b')]){_0x2d2ddd[_0xeb03('0x4c')]=[{'all':!![]}];}return db[_0xeb03('0x34')][_0xeb03('0x4d')](_0x2d2ddd);})[_0xeb03('0x2d')](function(_0x103c78){_0x5234dc[_0xeb03('0x4e')]=_0x103c78;return _0x5234dc;})['then'](respondWithFilteredResult(_0x32aff7,_0x2d2ddd))[_0xeb03('0x4f')](handleError(_0x32aff7,null));};exports[_0xeb03('0x50')]=function(_0x275d4d,_0xe9dcb0){var _0x528c0f={'raw':![],'where':{'id':_0x275d4d['params']['id']}},_0x57f59e={};_0x57f59e[_0xeb03('0x39')]=_['keys'](db['VoicePrefix']['rawAttributes']);_0x57f59e[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x275d4d[_0xeb03('0x3b')]);_0x57f59e[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x57f59e[_0xeb03('0x39')],_0x57f59e['query']);_0x528c0f[_0xeb03('0x3e')]=_['intersection'](_0x57f59e['model'],qs[_0xeb03('0x52')](_0x275d4d[_0xeb03('0x3b')][_0xeb03('0x52')]));_0x528c0f['attributes']=_0x528c0f[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x528c0f[_0xeb03('0x3e')]:_0x57f59e[_0xeb03('0x39')];if(_0x275d4d[_0xeb03('0x3b')]['includeAll']){_0x528c0f[_0xeb03('0x4c')]=[{'all':!![]}];}_0x528c0f=_['merge']({},_0x528c0f,_0x275d4d[_0xeb03('0x4a')]);return db[_0xeb03('0x34')][_0xeb03('0x53')](_0x528c0f)[_0xeb03('0x2d')](handleEntityNotFound(_0xe9dcb0,null))[_0xeb03('0x2d')](respondWithResult(_0xe9dcb0,null))[_0xeb03('0x4f')](handleError(_0xe9dcb0,null));};exports[_0xeb03('0x2e')]=function(_0x292319,_0x38c993){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x292319[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x38c993,null))[_0xeb03('0x2d')](removeEntity(_0x38c993,null))[_0xeb03('0x4f')](handleError(_0x38c993,null));};exports[_0xeb03('0x55')]=function(_0xf5c1ab,_0x79b7c6){return db[_0xeb03('0x34')][_0xeb03('0x55')]()[_0xeb03('0x2d')](respondWithResult(_0x79b7c6,null))[_0xeb03('0x4f')](handleError(_0x79b7c6,null));};exports[_0xeb03('0x56')]=function(_0x365520,_0x509d79){var _0x17112e;return db[_0xeb03('0x57')][_0xeb03('0x58')](function(_0x5405b4){return db[_0xeb03('0x34')][_0xeb03('0x56')](_0x365520[_0xeb03('0x59')],{'transaction':_0x5405b4})[_0xeb03('0x2d')](function(_0x103da5){_0x17112e=_0x103da5[_0xeb03('0x2f')]({'plain':!![]});return db[_0xeb03('0x5a')][_0xeb03('0x53')]({'where':{'id':_0x17112e[_0xeb03('0x5b')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x46f52e){return createVoicePrefixExtensions(_0x17112e,_0x46f52e,_0x5405b4);});});})[_0xeb03('0x2d')](function(){var _0xf9beaf=_0x365520[_0xeb03('0x5c')]['get']({'plain':!![]});if(!_0xf9beaf)throw new Error(_0xeb03('0x5d'));if(_0xf9beaf[_0xeb03('0x5e')]===_0xeb03('0x5c')){var _0x259db7=_0x17112e;return db[_0xeb03('0x5f')][_0xeb03('0x53')]({'where':{'name':_0xeb03('0x30'),'userProfileId':_0xf9beaf[_0xeb03('0x60')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x23406a){if(_0x23406a&&_0x23406a['autoAssociation']===0x0){return db[_0xeb03('0x61')][_0xeb03('0x56')]({'name':_0x259db7[_0xeb03('0x49')],'resourceId':_0x259db7['id'],'type':_0x23406a[_0xeb03('0x49')],'sectionId':_0x23406a['id']},{})['then'](function(){return _0x17112e;});}else{return _0x17112e;}})[_0xeb03('0x4f')](function(_0x68e1b7){logger[_0xeb03('0x31')](_0xeb03('0x62'),_0x68e1b7);throw _0x68e1b7;});}return _0x17112e;})[_0xeb03('0x2d')](respondWithResult(_0x509d79,null))['catch'](handleError(_0x509d79,null));};function Extension(_0x43efc3,_0x10beeb,_0x28e488,_0x5e1361){this[_0xeb03('0x63')]=_0xeb03('0x64');this['exten']=_0x43efc3;this[_0xeb03('0x65')]=_0x28e488;this[_0xeb03('0x37')]=_0xeb03('0x66');this['description']=_0xeb03('0x67');this[_0xeb03('0x68')]=_0x10beeb;this['appdata']=_0x5e1361;}function createVoicePrefixExtensions(_0x3eb482,_0xfeb8e2,_0x1972fb){return new BPromise(function(_0x3ac2de,_0x3963a7){var _0x38618e=new Extension(formatPrefixName(_0x3eb482[_0xeb03('0x69')]),0x1,_0xeb03('0x6a'),'Voice\x20Prefix');_0x38618e[_0xeb03('0x6b')]=_0x3eb482['id'];return db['VoiceExtension'][_0xeb03('0x56')](_0x38618e,{'transaction':_0x1972fb})[_0xeb03('0x2d')](function(_0x3a9518){var _0x59d0c7=_0x3a9518[_0xeb03('0x2f')]({'plain':!![]});var _0x1508f6=_[_0xeb03('0x3a')](addVoicePrefixExtensions(_0x3eb482,_0xfeb8e2),function(_0x467a9d){_0x467a9d['VoiceExtensionId']=_0x59d0c7['id'];_0x467a9d[_0xeb03('0x6b')]=_0x3eb482['id'];return _0x467a9d;});return db[_0xeb03('0x5a')]['bulkCreate'](_0x1508f6,{'transaction':_0x1972fb})['then'](function(_0x583518){if(!_0x583518){return _0x3963a7(_0xeb03('0x6c'));}else{return _0x3ac2de(_0x583518);}})[_0xeb03('0x4f')](function(_0x9148a6){return _0x3963a7(_0x9148a6);});});;});};function addVoicePrefixExtensions(_0x16ad3a,_0x3da5f4){var _0x461777=[];var _0x443fc9=formatPrefixName(_0x16ad3a[_0xeb03('0x69')]);_0x461777[_0xeb03('0x6d')](new Extension(_0x443fc9,0x2,'Set','CDR(prefix)='+_0x16ad3a[_0xeb03('0x49')]));if(_0x16ad3a[_0xeb03('0x6e')]){_0x461777['push'](new Extension(_0x443fc9,0x3,_0xeb03('0x6f'),_0xeb03('0x70')+_0x16ad3a[_0xeb03('0x6e')]));}else{_0x461777[_0xeb03('0x6d')](new Extension(_0x443fc9,0x3,'NoOp','No\x20callerid\x20available'));}_0x461777[_0xeb03('0x6d')](new Extension(_0x443fc9,0x4,_0xeb03('0x71'),_0x3da5f4[_0xeb03('0x63')]+','+_0xeb03('0x72')+(0x8+_0x16ad3a[_0xeb03('0x49')][_0xeb03('0x3f')])+'}'+','+0x1));return _0x461777;}function formatPrefixName(_0x1a8057){var _0x2ee5c1='_';for(var _0x2e67a4=0x0;_0x2e67a4<_0x1a8057[_0xeb03('0x3f')];_0x2e67a4++){if(_0x1a8057[_0xeb03('0x73')](_0x2e67a4)=='-'){_0x2ee5c1+=_0x1a8057['charAt'](_0x2e67a4);}else{_0x2ee5c1+='['+_0x1a8057['charAt'](_0x2e67a4)+']';}}_0x2ee5c1+='.';return _0x2ee5c1;}exports[_0xeb03('0x2c')]=function(_0x4e52a4,_0x1099ff,_0x4cf4f1){var _0x30623a=_0x4e52a4['body'];_0x30623a[_0xeb03('0x69')]=_0xeb03('0x74')+_0x30623a['name']+'-';return db[_0xeb03('0x57')]['transaction'](function(_0x45f0aa){return db['VoicePrefix'][_0xeb03('0x2c')](_0x30623a,{'where':{'id':_0x30623a['id']},'transaction':_0x45f0aa})['then'](function(){return db['VoiceExtension'][_0xeb03('0x2e')]({'where':{'VoicePrefixId':_0x30623a['id']},'transaction':_0x45f0aa})[_0xeb03('0x2d')](function(){return db[_0xeb03('0x5a')][_0xeb03('0x53')]({'where':{'id':_0x30623a[_0xeb03('0x5b')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x39c15d){return createVoicePrefixExtensions(_0x30623a,_0x39c15d,_0x45f0aa);});});});})['then'](function(){return db[_0xeb03('0x34')][_0xeb03('0x75')](_0x30623a['id']);})[_0xeb03('0x2d')](respondWithResult(_0x1099ff,null))[_0xeb03('0x4f')](handleError(_0x1099ff,null));};exports[_0xeb03('0x76')]=function(_0x126a7f,_0x137a98,_0x4fff6e){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x126a7f[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x137a98,null))[_0xeb03('0x2d')](function(_0xcd7ab1){if(_0xcd7ab1){return _0xcd7ab1[_0xeb03('0x76')](_0x126a7f[_0xeb03('0x59')]['ids'],_[_0xeb03('0x77')](_0x126a7f[_0xeb03('0x59')],[_0xeb03('0x78'),'id'])||{})[_0xeb03('0x79')](function(_0x17c010){for(var _0x5ace77=0x0;_0x5ace77<_0x126a7f[_0xeb03('0x59')][_0xeb03('0x78')][_0xeb03('0x3f')];_0x5ace77+=0x1){socket[_0xeb03('0x7a')](_0xeb03('0x7b'),{'UserId':Number(_0x126a7f[_0xeb03('0x59')][_0xeb03('0x78')][_0x5ace77]),'VoicePrefixId':Number(_0x126a7f['params']['id'])});}return _0x17c010;});}})[_0xeb03('0x2d')](respondWithResult(_0x137a98,null))[_0xeb03('0x4f')](handleError(_0x137a98,null));};exports[_0xeb03('0x7c')]=function(_0x21dfab,_0x396329,_0x48dc21){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x21dfab[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x396329,null))[_0xeb03('0x2d')](function(_0x215759){if(_0x215759){return _0x215759[_0xeb03('0x7c')](_0x21dfab['query'][_0xeb03('0x78')])[_0xeb03('0x2d')](function(){if(_[_0xeb03('0x7d')](_0x21dfab[_0xeb03('0x3b')][_0xeb03('0x78')])){for(var _0x388fbd=0x0;_0x388fbd<_0x21dfab['query'][_0xeb03('0x78')][_0xeb03('0x3f')];_0x388fbd+=0x1){socket[_0xeb03('0x7a')]('userVoicePrefix:remove',{'UserId':Number(_0x21dfab[_0xeb03('0x3b')][_0xeb03('0x78')][_0x388fbd]),'VoicePrefixId':Number(_0x21dfab[_0xeb03('0x54')]['id'])});}}else{socket[_0xeb03('0x7a')](_0xeb03('0x7e'),{'UserId':Number(_0x21dfab[_0xeb03('0x3b')][_0xeb03('0x78')]),'VoicePrefixId':Number(_0x21dfab['params']['id'])});}});}})['then'](respondWithStatusCode(_0x396329,null))[_0xeb03('0x4f')](handleError(_0x396329,null));};exports[_0xeb03('0x7f')]=function(_0x3630a7,_0xe55200,_0x511e5a){var _0x8ba377={};var _0x42c477={};var _0x5b60a4;var _0x45fd83;return db[_0xeb03('0x34')][_0xeb03('0x80')]({'where':{'id':_0x3630a7[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0xe55200,null))[_0xeb03('0x2d')](function(_0x5ea593){if(_0x5ea593){_0x5b60a4=_0x5ea593;_0x42c477[_0xeb03('0x39')]=_[_0xeb03('0x51')](db[_0xeb03('0x81')][_0xeb03('0x35')]);_0x42c477[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x3630a7[_0xeb03('0x3b')]);_0x42c477[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x42c477[_0xeb03('0x39')],_0x42c477['query']);_0x8ba377[_0xeb03('0x3e')]=_[_0xeb03('0x3d')](_0x42c477['model'],qs[_0xeb03('0x52')](_0x3630a7[_0xeb03('0x3b')]['fields']));_0x8ba377[_0xeb03('0x3e')]=_0x8ba377[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x8ba377[_0xeb03('0x3e')]:_0x42c477[_0xeb03('0x39')];_0x8ba377['order']=qs['sort'](_0x3630a7['query'][_0xeb03('0x43')]);_0x8ba377['where']=qs[_0xeb03('0x3c')](_[_0xeb03('0x45')](_0x3630a7[_0xeb03('0x3b')],_0x42c477[_0xeb03('0x3c')]));if(_0x3630a7[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x8ba377[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x8ba377[_0xeb03('0x44')],{'$or':_[_0xeb03('0x3a')](_0x8ba377[_0xeb03('0x3e')],function(_0x27a388){var _0x4ec45c={};_0x4ec45c[_0x27a388]={'$like':'%'+_0x3630a7['query'][_0xeb03('0x46')]+'%'};return _0x4ec45c;})});}_0x8ba377=_['merge']({},_0x8ba377,_0x3630a7['options']);return _0x5b60a4[_0xeb03('0x7f')](_0x8ba377);}})[_0xeb03('0x2d')](function(_0x502b25){if(_0x502b25){_0x45fd83=_0x502b25['length'];if(!_0x3630a7[_0xeb03('0x3b')][_0xeb03('0x40')]('nolimit')){_0x8ba377[_0xeb03('0x25')]=qs[_0xeb03('0x25')](_0x3630a7[_0xeb03('0x3b')][_0xeb03('0x25')]);_0x8ba377[_0xeb03('0x23')]=qs['offset'](_0x3630a7[_0xeb03('0x3b')]['offset']);}return _0x5b60a4['getAgents'](_0x8ba377);}})[_0xeb03('0x2d')](function(_0x2d12eb){if(_0x2d12eb){return _0x2d12eb?{'count':_0x45fd83,'rows':_0x2d12eb}:null;}})[_0xeb03('0x2d')](respondWithResult(_0xe55200,null))[_0xeb03('0x4f')](handleError(_0xe55200,null));};exports['getTeams']=function(_0x4b59f4,_0xf9f2d3,_0x847253){var _0x70343f={};var _0x2d6225={};var _0x388642;var _0x3dc483;return db[_0xeb03('0x34')][_0xeb03('0x80')]({'where':{'id':_0x4b59f4['params']['id']}})['then'](handleEntityNotFound(_0xf9f2d3,null))[_0xeb03('0x2d')](function(_0x5741d4){if(_0x5741d4){_0x388642=_0x5741d4;_0x2d6225[_0xeb03('0x39')]=_['keys'](db[_0xeb03('0x82')][_0xeb03('0x35')]);_0x2d6225[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x4b59f4[_0xeb03('0x3b')]);_0x2d6225[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x2d6225[_0xeb03('0x39')],_0x2d6225['query']);_0x70343f['attributes']=_[_0xeb03('0x3d')](_0x2d6225[_0xeb03('0x39')],qs[_0xeb03('0x52')](_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x52')]));_0x70343f['attributes']=_0x70343f[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x70343f['attributes']:_0x2d6225[_0xeb03('0x39')];_0x70343f[_0xeb03('0x42')]=qs[_0xeb03('0x43')](_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x43')]);_0x70343f[_0xeb03('0x44')]=qs[_0xeb03('0x3c')](_[_0xeb03('0x45')](_0x4b59f4[_0xeb03('0x3b')],_0x2d6225[_0xeb03('0x3c')]));if(_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x70343f[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x70343f['where'],{'$or':_[_0xeb03('0x3a')](_0x70343f[_0xeb03('0x3e')],function(_0x4c6b85){var _0x1f3ee1={};_0x1f3ee1[_0x4c6b85]={'$like':'%'+_0x4b59f4['query'][_0xeb03('0x46')]+'%'};return _0x1f3ee1;})});}_0x70343f=_['merge']({},_0x70343f,_0x4b59f4[_0xeb03('0x4a')]);return _0x388642[_0xeb03('0x83')](_0x70343f);}})[_0xeb03('0x2d')](function(_0x1df994){if(_0x1df994){_0x3dc483=_0x1df994[_0xeb03('0x3f')];if(!_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x40')](_0xeb03('0x41'))){_0x70343f['limit']=qs[_0xeb03('0x25')](_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x25')]);_0x70343f[_0xeb03('0x23')]=qs['offset'](_0x4b59f4[_0xeb03('0x3b')]['offset']);}return _0x388642[_0xeb03('0x83')](_0x70343f);}})[_0xeb03('0x2d')](function(_0x423ddd){if(_0x423ddd){return _0x423ddd?{'count':_0x3dc483,'rows':_0x423ddd}:null;}})[_0xeb03('0x2d')](respondWithResult(_0xf9f2d3,null))['catch'](handleError(_0xf9f2d3,null));};exports[_0xeb03('0x84')]=function(_0x473d63,_0x1fc15a,_0x45f4d3){var _0x5095a6=_0x473d63[_0xeb03('0x59')]['ids'];var _0x4e0fd8;return db['Team'][_0xeb03('0x4d')]({'where':{'id':_0x5095a6},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb03('0x85'),'attributes':['id',_0xeb03('0x49'),_0xeb03('0x86'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x50b2c5){if(_0x50b2c5){_0x4e0fd8=_0x50b2c5;var _0x5c7f6e=_[_0xeb03('0x87')](_0x50b2c5,function(_0x392aaa){var _0x117c5e=_0x392aaa[_0xeb03('0x2f')]({'plain':!![]});return _0x117c5e[_0xeb03('0x85')];});return db[_0xeb03('0x34')]['find']({'where':{'id':_0x473d63[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](function(_0x2d8bca){return db[_0xeb03('0x57')]['transaction'](function(_0x5c49c9){return _0x2d8bca[_0xeb03('0x84')](_0x5095a6,{'transaction':_0x5c49c9})[_0xeb03('0x2d')](function(){return BPromise['each'](_0x4e0fd8,function(_0xc7a504){return db[_0xeb03('0x88')][_0xeb03('0x89')]({'TeamId':_0xc7a504['id'],'VoicePrefixId':_0x473d63[_0xeb03('0x54')]['id']},{'transaction':_0x5c49c9});});})[_0xeb03('0x2d')](function(){return BPromise[_0xeb03('0x8a')](_0x5c7f6e,function(_0x11cc99){return db['UserVoicePrefix'][_0xeb03('0x8b')]({'where':{'UserId':_0x11cc99['id'],'VoicePrefixId':_0x473d63[_0xeb03('0x54')]['id']},'transaction':_0x5c49c9});});})[_0xeb03('0x2d')](function(){_0x5c7f6e[_0xeb03('0x8c')](function(_0x1f2ebe){socket[_0xeb03('0x7a')](_0xeb03('0x7b'),{'UserId':_0x1f2ebe['id'],'VoicePrefixId':_0x2d8bca['id']});});});});});}})[_0xeb03('0x2d')](respondWithStatusCode(_0x1fc15a,null))['catch'](handleError(_0x1fc15a,null));};exports[_0xeb03('0x8d')]=function(_0x5e0e2b,_0x497a5b,_0x188d39){return db[_0xeb03('0x82')]['findAll']({'where':{'id':_0x5e0e2b[_0xeb03('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xeb03('0x81')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xeb03('0x2d')](handleEntityNotFound(_0x497a5b,null))[_0xeb03('0x2d')](function(_0xd6f37b){var _0x1522d4=_[_0xeb03('0x3a')](_0xd6f37b,'id');var _0x47b648=[];var _0x15a726=[];var _0x226569=squel[_0xeb03('0x8e')]();_0x226569[_0xeb03('0x8f')](_0xeb03('0x90'))[_0xeb03('0x91')](_0xeb03('0x92'),'tq')[_0xeb03('0x93')](_0xeb03('0x94'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoicePrefixId\x20=\x20?',_0x5e0e2b[_0xeb03('0x54')]['id']);for(var _0x40a6ce=0x0;_0x40a6ce<_0xd6f37b[_0xeb03('0x3f')];_0x40a6ce+=0x1){let _0x2f640d=_0xd6f37b[_0x40a6ce];for(var _0x546ebe=0x0;_0x546ebe<_0x2f640d['Agents']['length'];_0x546ebe+=0x1){let _0x3d861f=_0x2f640d[_0xeb03('0x85')][_0x546ebe];var _0x2c89c4=_0x226569[_0xeb03('0x95')]();_0x2c89c4[_0xeb03('0x44')]('ut.UserId\x20=\x20?',_0x3d861f['id']);_0x15a726[_0xeb03('0x6d')](db[_0xeb03('0x57')]['query'](_0x2c89c4[_0xeb03('0x96')](),{'type':db['sequelize']['QueryTypes'][_0xeb03('0x97')]})[_0xeb03('0x2d')](function(_0x123742){if(_0x123742['length']===0x1){return _0x3d861f['id'];}else{var _0x243689=_[_0xeb03('0x98')](_['map'](_0x123742,_0xeb03('0x99')),function(_0x5eb15a){return _['includes'](_0x1522d4,_0x5eb15a);});if(_0x243689){return _0x3d861f['id'];}}}));}}return BPromise[_0xeb03('0x9a')](_0x15a726)[_0xeb03('0x2d')](function(_0x366054){_0x47b648=_(_0x47b648)[_0xeb03('0x9b')](_0x366054)[_0xeb03('0x9c')]()[_0xeb03('0x9d')]();return db['VoicePrefix'][_0xeb03('0x53')]({'where':{'id':_0x5e0e2b[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](function(_0x1f0387){return db[_0xeb03('0x57')][_0xeb03('0x58')](function(_0xf0d912){return _0x1f0387[_0xeb03('0x8d')](_0x5e0e2b[_0xeb03('0x3b')][_0xeb03('0x78')],{'transaction':_0xf0d912})[_0xeb03('0x2d')](function(){if(!_[_0xeb03('0x9e')](_0x47b648)){return _0x1f0387[_0xeb03('0x7c')](_0x47b648,{'transaction':_0xf0d912});}})[_0xeb03('0x2d')](function(){_0x47b648[_0xeb03('0x8c')](function(_0x1a0bb5){socket[_0xeb03('0x7a')](_0xeb03('0x7e'),{'UserId':_0x1a0bb5,'VoicePrefixId':_0x1f0387['id']});});});});});});})[_0xeb03('0x2d')](respondWithStatusCode(_0x497a5b,null))[_0xeb03('0x4f')](handleError(_0x497a5b,null));}; \ No newline at end of file +var _0x84a0=['query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','online','voicePause','interface','flatMap','Agents','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84a0,0x66));var _0x084a=function(_0x5ed624,_0x322f34){_0x5ed624=_0x5ed624-0x0;var _0x59bfba=_0x84a0[_0x5ed624];return _0x59bfba;};'use strict';var emlformat=require(_0x084a('0x0'));var rimraf=require(_0x084a('0x1'));var zipdir=require(_0x084a('0x2'));var jsonpatch=require(_0x084a('0x3'));var rp=require('request-promise');var moment=require(_0x084a('0x4'));var BPromise=require(_0x084a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x084a('0x6'));var sox=require(_0x084a('0x7'));var csv=require('to-csv');var ejs=require(_0x084a('0x8'));var fs=require('fs');var fs_extra=require(_0x084a('0x9'));var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0xe'));var querystring=require(_0x084a('0xf'));var Papa=require(_0x084a('0x10'));var Redis=require(_0x084a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x084a('0x12'));var hardwareService=require(_0x084a('0x13'));var logger=require(_0x084a('0x14'))(_0x084a('0x15'));var utils=require(_0x084a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x084a('0x17'))['db'];config[_0x084a('0x18')]=_[_0x084a('0x19')](config[_0x084a('0x18')],{'host':_0x084a('0x1a'),'port':0x18eb});var socket=require(_0x084a('0x1b'))(new Redis(config[_0x084a('0x18')]));require(_0x084a('0x1c'))['register'](socket);function respondWithStatusCode(_0x4277c9,_0x4b9cc5){_0x4b9cc5=_0x4b9cc5||0xcc;return function(_0x225de0){if(_0x225de0){return _0x4277c9[_0x084a('0x1d')](_0x4b9cc5);}return _0x4277c9[_0x084a('0x1e')](_0x4b9cc5)[_0x084a('0x1f')]();};}function respondWithResult(_0xd20527,_0x4cbd16){_0x4cbd16=_0x4cbd16||0xc8;return function(_0x443ebb){if(_0x443ebb){return _0xd20527['status'](_0x4cbd16)[_0x084a('0x20')](_0x443ebb);}};}function respondWithFilteredResult(_0x355b45,_0x4af43e){return function(_0xf2c333){if(_0xf2c333){var _0x32c729=typeof _0x4af43e[_0x084a('0x21')]===_0x084a('0x22')&&typeof _0x4af43e[_0x084a('0x23')]===_0x084a('0x22');var _0x447a19=_0xf2c333[_0x084a('0x24')];var _0x3f60cf=_0x32c729?0x0:_0x4af43e[_0x084a('0x21')];var _0x3c7fd6=_0x32c729?_0xf2c333[_0x084a('0x24')]:_0x4af43e[_0x084a('0x21')]+_0x4af43e[_0x084a('0x23')];var _0xf0dd98;if(_0x3c7fd6>=_0x447a19){_0x3c7fd6=_0x447a19;_0xf0dd98=0xc8;}else{_0xf0dd98=0xce;}_0x355b45['status'](_0xf0dd98);return _0x355b45[_0x084a('0x25')](_0x084a('0x26'),_0x3f60cf+'-'+_0x3c7fd6+'/'+_0x447a19)[_0x084a('0x20')](_0xf2c333);}return null;};}function patchUpdates(_0x2d62bf){return function(_0x1c3f6c){try{jsonpatch['apply'](_0x1c3f6c,_0x2d62bf,!![]);}catch(_0x755c24){return BPromise[_0x084a('0x27')](_0x755c24);}return _0x1c3f6c[_0x084a('0x28')]();};}function saveUpdates(_0x1f2c9f,_0x18b43d){return function(_0x3cdc1e){if(_0x3cdc1e){return _0x3cdc1e['update'](_0x1f2c9f)[_0x084a('0x29')](function(_0x2af138){return _0x2af138;});}return null;};}function removeEntity(_0x54233b,_0x5b1474){return function(_0x8806d5){if(_0x8806d5){return _0x8806d5[_0x084a('0x2a')]()[_0x084a('0x29')](function(){var _0x4c5658=_0x8806d5['get']({'plain':!![]});var _0x4874fe='VoicePrefixes';return db[_0x084a('0x2b')]['destroy']({'where':{'type':_0x4874fe,'resourceId':_0x4c5658['id']}})['then'](function(){return _0x8806d5;});})['then'](function(){_0x54233b[_0x084a('0x1e')](0xcc)[_0x084a('0x1f')]();});}};}function handleEntityNotFound(_0x388062,_0x2c4149){return function(_0x3be7a6){if(!_0x3be7a6){_0x388062[_0x084a('0x1d')](0x194);}return _0x3be7a6;};}function handleError(_0x378de6,_0x16053f){_0x16053f=_0x16053f||0x1f4;return function(_0x5e6ea8){logger[_0x084a('0x2c')](_0x5e6ea8[_0x084a('0x2d')]);if(_0x5e6ea8['name']){delete _0x5e6ea8[_0x084a('0x2e')];}_0x378de6[_0x084a('0x1e')](_0x16053f)[_0x084a('0x2f')](_0x5e6ea8);};}exports[_0x084a('0x30')]=function(_0x448ae9,_0x202602){var _0x3a99fe={},_0x1e971a={},_0x50cb54={'count':0x0,'rows':[]};var _0x2f59a6=_[_0x084a('0x31')](db[_0x084a('0x32')][_0x084a('0x33')],function(_0x49c9db){return{'name':_0x49c9db['fieldName'],'type':_0x49c9db[_0x084a('0x34')][_0x084a('0x35')]};});_0x1e971a[_0x084a('0x36')]=_[_0x084a('0x31')](_0x2f59a6,_0x084a('0x2e'));_0x1e971a['query']=_[_0x084a('0x37')](_0x448ae9[_0x084a('0x38')]);_0x1e971a[_0x084a('0x39')]=_['intersection'](_0x1e971a[_0x084a('0x36')],_0x1e971a[_0x084a('0x38')]);_0x3a99fe[_0x084a('0x3a')]=_['intersection'](_0x1e971a['model'],qs['fields'](_0x448ae9[_0x084a('0x38')][_0x084a('0x3b')]));_0x3a99fe[_0x084a('0x3a')]=_0x3a99fe['attributes'][_0x084a('0x3c')]?_0x3a99fe[_0x084a('0x3a')]:_0x1e971a[_0x084a('0x36')];if(!_0x448ae9[_0x084a('0x38')][_0x084a('0x3d')](_0x084a('0x3e'))){_0x3a99fe[_0x084a('0x23')]=qs[_0x084a('0x23')](_0x448ae9[_0x084a('0x38')][_0x084a('0x23')]);_0x3a99fe[_0x084a('0x21')]=qs[_0x084a('0x21')](_0x448ae9[_0x084a('0x38')][_0x084a('0x21')]);}_0x3a99fe[_0x084a('0x3f')]=qs['sort'](_0x448ae9[_0x084a('0x38')][_0x084a('0x40')]);_0x3a99fe[_0x084a('0x41')]=qs[_0x084a('0x39')](_[_0x084a('0x42')](_0x448ae9[_0x084a('0x38')],_0x1e971a[_0x084a('0x39')]),_0x2f59a6);if(_0x448ae9[_0x084a('0x38')][_0x084a('0x43')]){_0x3a99fe['where']=_[_0x084a('0x44')](_0x3a99fe[_0x084a('0x41')],{'$or':_[_0x084a('0x31')](_0x2f59a6,function(_0x432eb7){if(_0x432eb7[_0x084a('0x34')]!==_0x084a('0x45')){var _0x515743={};_0x515743[_0x432eb7[_0x084a('0x2e')]]={'$like':'%'+_0x448ae9[_0x084a('0x38')]['filter']+'%'};return _0x515743;}})});}_0x3a99fe=_[_0x084a('0x44')]({},_0x3a99fe,_0x448ae9[_0x084a('0x46')]);var _0x68e0d6={'where':_0x3a99fe['where']};return db[_0x084a('0x32')][_0x084a('0x24')](_0x68e0d6)['then'](function(_0x3e2b92){_0x50cb54[_0x084a('0x24')]=_0x3e2b92;if(_0x448ae9['query']['includeAll']){_0x3a99fe[_0x084a('0x47')]=[{'all':!![]}];}return db[_0x084a('0x32')][_0x084a('0x48')](_0x3a99fe);})[_0x084a('0x29')](function(_0x1e2a2d){_0x50cb54[_0x084a('0x49')]=_0x1e2a2d;return _0x50cb54;})[_0x084a('0x29')](respondWithFilteredResult(_0x202602,_0x3a99fe))[_0x084a('0x4a')](handleError(_0x202602,null));};exports[_0x084a('0x4b')]=function(_0x8b61f5,_0x30f8a4){var _0x593cc8={'raw':![],'where':{'id':_0x8b61f5[_0x084a('0x4c')]['id']}},_0x51dbda={};_0x51dbda[_0x084a('0x36')]=_[_0x084a('0x37')](db['VoicePrefix'][_0x084a('0x33')]);_0x51dbda[_0x084a('0x38')]=_[_0x084a('0x37')](_0x8b61f5[_0x084a('0x38')]);_0x51dbda[_0x084a('0x39')]=_['intersection'](_0x51dbda[_0x084a('0x36')],_0x51dbda['query']);_0x593cc8[_0x084a('0x3a')]=_[_0x084a('0x4d')](_0x51dbda[_0x084a('0x36')],qs['fields'](_0x8b61f5['query'][_0x084a('0x3b')]));_0x593cc8[_0x084a('0x3a')]=_0x593cc8['attributes'][_0x084a('0x3c')]?_0x593cc8[_0x084a('0x3a')]:_0x51dbda[_0x084a('0x36')];if(_0x8b61f5[_0x084a('0x38')]['includeAll']){_0x593cc8[_0x084a('0x47')]=[{'all':!![]}];}_0x593cc8=_[_0x084a('0x44')]({},_0x593cc8,_0x8b61f5[_0x084a('0x46')]);return db[_0x084a('0x32')]['find'](_0x593cc8)[_0x084a('0x29')](handleEntityNotFound(_0x30f8a4,null))[_0x084a('0x29')](respondWithResult(_0x30f8a4,null))[_0x084a('0x4a')](handleError(_0x30f8a4,null));};exports[_0x084a('0x2a')]=function(_0x5a718c,_0x502d9a){return db[_0x084a('0x32')][_0x084a('0x4e')]({'where':{'id':_0x5a718c[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](handleEntityNotFound(_0x502d9a,null))[_0x084a('0x29')](removeEntity(_0x502d9a,null))[_0x084a('0x4a')](handleError(_0x502d9a,null));};exports[_0x084a('0x4f')]=function(_0x12c3a8,_0xf6ce0d){return db[_0x084a('0x32')][_0x084a('0x4f')]()[_0x084a('0x29')](respondWithResult(_0xf6ce0d,null))['catch'](handleError(_0xf6ce0d,null));};exports[_0x084a('0x50')]=function(_0x37fce4,_0x29fa4b){var _0x39edc1;return db[_0x084a('0x51')][_0x084a('0x52')](function(_0xa5362){return db['VoicePrefix'][_0x084a('0x50')](_0x37fce4[_0x084a('0x53')],{'transaction':_0xa5362})[_0x084a('0x29')](function(_0x54aa6c){_0x39edc1=_0x54aa6c['get']({'plain':!![]});return db[_0x084a('0x54')]['find']({'where':{'id':_0x39edc1[_0x084a('0x55')]},'raw':!![]})[_0x084a('0x29')](function(_0x490ad9){return createVoicePrefixExtensions(_0x39edc1,_0x490ad9,_0xa5362);});});})[_0x084a('0x29')](function(){var _0x54e9a5=_0x37fce4['user'][_0x084a('0x56')]({'plain':!![]});if(!_0x54e9a5)throw new Error(_0x084a('0x57'));if(_0x54e9a5[_0x084a('0x58')]===_0x084a('0x59')){var _0x2a8056=_0x39edc1;return db[_0x084a('0x5a')][_0x084a('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x54e9a5[_0x084a('0x5b')]},'raw':!![]})[_0x084a('0x29')](function(_0x3d7f0a){if(_0x3d7f0a&&_0x3d7f0a['autoAssociation']===0x0){return db[_0x084a('0x2b')][_0x084a('0x50')]({'name':_0x2a8056[_0x084a('0x2e')],'resourceId':_0x2a8056['id'],'type':_0x3d7f0a[_0x084a('0x2e')],'sectionId':_0x3d7f0a['id']},{})['then'](function(){return _0x39edc1;});}else{return _0x39edc1;}})[_0x084a('0x4a')](function(_0x58fe64){logger[_0x084a('0x2c')](_0x084a('0x5c'),_0x58fe64);throw _0x58fe64;});}return _0x39edc1;})[_0x084a('0x29')](respondWithResult(_0x29fa4b,null))['catch'](handleError(_0x29fa4b,null));};function Extension(_0x589e38,_0xd37003,_0x2f228c,_0x598075){this[_0x084a('0x5d')]='from-sip';this['exten']=_0x589e38;this[_0x084a('0x5e')]=_0x2f228c;this[_0x084a('0x34')]=_0x084a('0x5f');this[_0x084a('0x60')]=_0x084a('0x61');this[_0x084a('0x62')]=_0xd37003;this[_0x084a('0x63')]=_0x598075;}function createVoicePrefixExtensions(_0x5ab9d6,_0x114aa5,_0x50fe69){return new BPromise(function(_0x445563,_0x12588a){var _0x3668eb=new Extension(formatPrefixName(_0x5ab9d6['prefix']),0x1,_0x084a('0x64'),_0x084a('0x65'));_0x3668eb['VoicePrefixId']=_0x5ab9d6['id'];return db[_0x084a('0x54')]['create'](_0x3668eb,{'transaction':_0x50fe69})['then'](function(_0x1c40f3){var _0x534db3=_0x1c40f3['get']({'plain':!![]});var _0x2368f5=_[_0x084a('0x31')](addVoicePrefixExtensions(_0x5ab9d6,_0x114aa5),function(_0x495304){_0x495304['VoiceExtensionId']=_0x534db3['id'];_0x495304[_0x084a('0x66')]=_0x5ab9d6['id'];return _0x495304;});return db[_0x084a('0x54')][_0x084a('0x67')](_0x2368f5,{'transaction':_0x50fe69})[_0x084a('0x29')](function(_0x45e2d3){if(!_0x45e2d3){return _0x12588a(_0x084a('0x68'));}else{return _0x445563(_0x45e2d3);}})[_0x084a('0x4a')](function(_0x560f60){return _0x12588a(_0x560f60);});});;});};function addVoicePrefixExtensions(_0x51e090,_0x2ba35a){var _0x36ba24=[];var _0x5c77a3=formatPrefixName(_0x51e090[_0x084a('0x69')]);_0x36ba24[_0x084a('0x6a')](new Extension(_0x5c77a3,0x2,_0x084a('0x6b'),_0x084a('0x6c')+_0x51e090['name']));if(_0x51e090[_0x084a('0x6d')]){_0x36ba24[_0x084a('0x6a')](new Extension(_0x5c77a3,0x3,_0x084a('0x6b'),'PREFIX-CALLERIDALL='+_0x51e090['callerIdAll']));}else{_0x36ba24[_0x084a('0x6a')](new Extension(_0x5c77a3,0x3,_0x084a('0x64'),_0x084a('0x6e')));}_0x36ba24[_0x084a('0x6a')](new Extension(_0x5c77a3,0x4,_0x084a('0x6f'),_0x2ba35a[_0x084a('0x5d')]+','+_0x084a('0x70')+(0x8+_0x51e090['name'][_0x084a('0x3c')])+'}'+','+0x1));return _0x36ba24;}function formatPrefixName(_0x51a066){var _0x4e713c='_';for(var _0x24a553=0x0;_0x24a553<_0x51a066[_0x084a('0x3c')];_0x24a553++){if(_0x51a066[_0x084a('0x71')](_0x24a553)=='-'){_0x4e713c+=_0x51a066['charAt'](_0x24a553);}else{_0x4e713c+='['+_0x51a066[_0x084a('0x71')](_0x24a553)+']';}}_0x4e713c+='.';return _0x4e713c;}exports['update']=function(_0x1eb7be,_0x1054ea,_0x2417b4){var _0x12cef4=_0x1eb7be[_0x084a('0x53')];_0x12cef4[_0x084a('0x69')]='system-'+_0x12cef4['name']+'-';return db[_0x084a('0x51')][_0x084a('0x52')](function(_0x782285){return db[_0x084a('0x32')][_0x084a('0x72')](_0x12cef4,{'where':{'id':_0x12cef4['id']},'transaction':_0x782285})[_0x084a('0x29')](function(){return db['VoiceExtension'][_0x084a('0x2a')]({'where':{'VoicePrefixId':_0x12cef4['id']},'transaction':_0x782285})[_0x084a('0x29')](function(){return db[_0x084a('0x54')][_0x084a('0x4e')]({'where':{'id':_0x12cef4[_0x084a('0x55')]},'raw':!![]})[_0x084a('0x29')](function(_0x537578){return createVoicePrefixExtensions(_0x12cef4,_0x537578,_0x782285);});});});})['then'](function(){return db[_0x084a('0x32')][_0x084a('0x73')](_0x12cef4['id']);})[_0x084a('0x29')](respondWithResult(_0x1054ea,null))[_0x084a('0x4a')](handleError(_0x1054ea,null));};exports[_0x084a('0x74')]=function(_0xb287e7,_0x3824db,_0x26cd70){return db[_0x084a('0x32')][_0x084a('0x4e')]({'where':{'id':_0xb287e7['params']['id']}})['then'](handleEntityNotFound(_0x3824db,null))['then'](function(_0x2216d4){if(_0x2216d4){return _0x2216d4[_0x084a('0x74')](_0xb287e7['body'][_0x084a('0x75')],_[_0x084a('0x76')](_0xb287e7[_0x084a('0x53')],[_0x084a('0x75'),'id'])||{})['spread'](function(_0x50cb3a){for(var _0x30ea2a=0x0;_0x30ea2a<_0xb287e7[_0x084a('0x53')][_0x084a('0x75')][_0x084a('0x3c')];_0x30ea2a+=0x1){socket[_0x084a('0x77')](_0x084a('0x78'),{'UserId':Number(_0xb287e7[_0x084a('0x53')]['ids'][_0x30ea2a]),'VoicePrefixId':Number(_0xb287e7[_0x084a('0x4c')]['id'])});}return _0x50cb3a;});}})[_0x084a('0x29')](respondWithResult(_0x3824db,null))[_0x084a('0x4a')](handleError(_0x3824db,null));};exports[_0x084a('0x79')]=function(_0x3dcafb,_0x31b89a,_0x14617e){return db['VoicePrefix'][_0x084a('0x4e')]({'where':{'id':_0x3dcafb[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](handleEntityNotFound(_0x31b89a,null))[_0x084a('0x29')](function(_0x417048){if(_0x417048){return _0x417048[_0x084a('0x79')](_0x3dcafb[_0x084a('0x38')][_0x084a('0x75')])[_0x084a('0x29')](function(){if(_[_0x084a('0x7a')](_0x3dcafb[_0x084a('0x38')]['ids'])){for(var _0x2932b6=0x0;_0x2932b6<_0x3dcafb[_0x084a('0x38')]['ids'][_0x084a('0x3c')];_0x2932b6+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3dcafb[_0x084a('0x38')][_0x084a('0x75')][_0x2932b6]),'VoicePrefixId':Number(_0x3dcafb['params']['id'])});}}else{socket[_0x084a('0x77')](_0x084a('0x7b'),{'UserId':Number(_0x3dcafb[_0x084a('0x38')][_0x084a('0x75')]),'VoicePrefixId':Number(_0x3dcafb[_0x084a('0x4c')]['id'])});}});}})[_0x084a('0x29')](respondWithStatusCode(_0x31b89a,null))[_0x084a('0x4a')](handleError(_0x31b89a,null));};exports[_0x084a('0x7c')]=function(_0x1916b1,_0x8074aa,_0xe03abd){var _0x7c85e3={};var _0x19ea24={};var _0x18cf1e;var _0x3b8dda;return db['VoicePrefix'][_0x084a('0x7d')]({'where':{'id':_0x1916b1[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](handleEntityNotFound(_0x8074aa,null))[_0x084a('0x29')](function(_0x1a99b2){if(_0x1a99b2){_0x18cf1e=_0x1a99b2;_0x19ea24[_0x084a('0x36')]=_[_0x084a('0x37')](db[_0x084a('0x7e')]['rawAttributes']);_0x19ea24['query']=_[_0x084a('0x37')](_0x1916b1[_0x084a('0x38')]);_0x19ea24['filters']=_['intersection'](_0x19ea24[_0x084a('0x36')],_0x19ea24['query']);_0x7c85e3[_0x084a('0x3a')]=_['intersection'](_0x19ea24[_0x084a('0x36')],qs[_0x084a('0x3b')](_0x1916b1[_0x084a('0x38')][_0x084a('0x3b')]));_0x7c85e3['attributes']=_0x7c85e3['attributes']['length']?_0x7c85e3[_0x084a('0x3a')]:_0x19ea24[_0x084a('0x36')];_0x7c85e3[_0x084a('0x3f')]=qs['sort'](_0x1916b1[_0x084a('0x38')][_0x084a('0x40')]);_0x7c85e3['where']=qs[_0x084a('0x39')](_[_0x084a('0x42')](_0x1916b1['query'],_0x19ea24[_0x084a('0x39')]));if(_0x1916b1[_0x084a('0x38')][_0x084a('0x43')]){_0x7c85e3['where']=_['merge'](_0x7c85e3[_0x084a('0x41')],{'$or':_['map'](_0x7c85e3[_0x084a('0x3a')],function(_0x67d92b){var _0x11894e={};_0x11894e[_0x67d92b]={'$like':'%'+_0x1916b1[_0x084a('0x38')][_0x084a('0x43')]+'%'};return _0x11894e;})});}_0x7c85e3=_[_0x084a('0x44')]({},_0x7c85e3,_0x1916b1['options']);return _0x18cf1e[_0x084a('0x7c')](_0x7c85e3);}})['then'](function(_0x5ce185){if(_0x5ce185){_0x3b8dda=_0x5ce185[_0x084a('0x3c')];if(!_0x1916b1[_0x084a('0x38')][_0x084a('0x3d')](_0x084a('0x3e'))){_0x7c85e3[_0x084a('0x23')]=qs[_0x084a('0x23')](_0x1916b1['query']['limit']);_0x7c85e3[_0x084a('0x21')]=qs[_0x084a('0x21')](_0x1916b1[_0x084a('0x38')]['offset']);}return _0x18cf1e[_0x084a('0x7c')](_0x7c85e3);}})[_0x084a('0x29')](function(_0x4eb3da){if(_0x4eb3da){return _0x4eb3da?{'count':_0x3b8dda,'rows':_0x4eb3da}:null;}})['then'](respondWithResult(_0x8074aa,null))[_0x084a('0x4a')](handleError(_0x8074aa,null));};exports['getTeams']=function(_0x5c93b2,_0x135e46,_0x2d9c66){var _0x57d90c={};var _0x42d267={};var _0x2ee08a;var _0x4f40c4;return db[_0x084a('0x32')][_0x084a('0x7d')]({'where':{'id':_0x5c93b2[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](handleEntityNotFound(_0x135e46,null))[_0x084a('0x29')](function(_0x29cdb8){if(_0x29cdb8){_0x2ee08a=_0x29cdb8;_0x42d267['model']=_['keys'](db[_0x084a('0x7f')][_0x084a('0x33')]);_0x42d267['query']=_[_0x084a('0x37')](_0x5c93b2['query']);_0x42d267[_0x084a('0x39')]=_[_0x084a('0x4d')](_0x42d267[_0x084a('0x36')],_0x42d267[_0x084a('0x38')]);_0x57d90c[_0x084a('0x3a')]=_[_0x084a('0x4d')](_0x42d267['model'],qs['fields'](_0x5c93b2[_0x084a('0x38')][_0x084a('0x3b')]));_0x57d90c[_0x084a('0x3a')]=_0x57d90c[_0x084a('0x3a')][_0x084a('0x3c')]?_0x57d90c['attributes']:_0x42d267[_0x084a('0x36')];_0x57d90c[_0x084a('0x3f')]=qs[_0x084a('0x40')](_0x5c93b2[_0x084a('0x38')]['sort']);_0x57d90c[_0x084a('0x41')]=qs[_0x084a('0x39')](_[_0x084a('0x42')](_0x5c93b2[_0x084a('0x38')],_0x42d267[_0x084a('0x39')]));if(_0x5c93b2[_0x084a('0x38')][_0x084a('0x43')]){_0x57d90c[_0x084a('0x41')]=_[_0x084a('0x44')](_0x57d90c[_0x084a('0x41')],{'$or':_[_0x084a('0x31')](_0x57d90c['attributes'],function(_0x5ed84e){var _0x35df86={};_0x35df86[_0x5ed84e]={'$like':'%'+_0x5c93b2['query'][_0x084a('0x43')]+'%'};return _0x35df86;})});}_0x57d90c=_[_0x084a('0x44')]({},_0x57d90c,_0x5c93b2[_0x084a('0x46')]);return _0x2ee08a[_0x084a('0x80')](_0x57d90c);}})[_0x084a('0x29')](function(_0x5412d1){if(_0x5412d1){_0x4f40c4=_0x5412d1[_0x084a('0x3c')];if(!_0x5c93b2[_0x084a('0x38')]['hasOwnProperty'](_0x084a('0x3e'))){_0x57d90c[_0x084a('0x23')]=qs[_0x084a('0x23')](_0x5c93b2['query'][_0x084a('0x23')]);_0x57d90c[_0x084a('0x21')]=qs[_0x084a('0x21')](_0x5c93b2[_0x084a('0x38')][_0x084a('0x21')]);}return _0x2ee08a[_0x084a('0x80')](_0x57d90c);}})[_0x084a('0x29')](function(_0x37d422){if(_0x37d422){return _0x37d422?{'count':_0x4f40c4,'rows':_0x37d422}:null;}})['then'](respondWithResult(_0x135e46,null))[_0x084a('0x4a')](handleError(_0x135e46,null));};exports[_0x084a('0x81')]=function(_0x355c04,_0x8b89d0,_0x5db744){var _0x45a53a=_0x355c04[_0x084a('0x53')][_0x084a('0x75')];var _0xab0f66;return db[_0x084a('0x7f')][_0x084a('0x48')]({'where':{'id':_0x45a53a},'attributes':['id'],'include':[{'model':db[_0x084a('0x7e')],'as':'Agents','attributes':['id',_0x084a('0x2e'),_0x084a('0x82'),_0x084a('0x83'),_0x084a('0x84')],'raw':!![]}]})[_0x084a('0x29')](function(_0x4087bf){if(_0x4087bf){_0xab0f66=_0x4087bf;var _0x88598d=_[_0x084a('0x85')](_0x4087bf,function(_0x1106ff){var _0x3339d4=_0x1106ff[_0x084a('0x56')]({'plain':!![]});return _0x3339d4[_0x084a('0x86')];});return db[_0x084a('0x32')][_0x084a('0x4e')]({'where':{'id':_0x355c04[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](function(_0x378b74){return db['sequelize'][_0x084a('0x52')](function(_0x383bb8){return _0x378b74[_0x084a('0x81')](_0x45a53a,{'transaction':_0x383bb8})[_0x084a('0x29')](function(){return BPromise['each'](_0xab0f66,function(_0x133f4c){return db[_0x084a('0x87')][_0x084a('0x88')]({'TeamId':_0x133f4c['id'],'VoicePrefixId':_0x355c04[_0x084a('0x4c')]['id']},{'transaction':_0x383bb8});});})[_0x084a('0x29')](function(){return BPromise[_0x084a('0x89')](_0x88598d,function(_0x5b5c6c){return db['UserVoicePrefix'][_0x084a('0x8a')]({'where':{'UserId':_0x5b5c6c['id'],'VoicePrefixId':_0x355c04[_0x084a('0x4c')]['id']},'transaction':_0x383bb8});});})[_0x084a('0x29')](function(){_0x88598d[_0x084a('0x8b')](function(_0x3dd10e){socket[_0x084a('0x77')](_0x084a('0x78'),{'UserId':_0x3dd10e['id'],'VoicePrefixId':_0x378b74['id']});});});});});}})[_0x084a('0x29')](respondWithStatusCode(_0x8b89d0,null))['catch'](handleError(_0x8b89d0,null));};exports[_0x084a('0x8c')]=function(_0x294cca,_0x3be1f3,_0x1c6dec){return db['Team']['findAll']({'where':{'id':_0x294cca[_0x084a('0x38')][_0x084a('0x75')]},'attributes':['id'],'include':[{'model':db[_0x084a('0x7e')],'as':_0x084a('0x86'),'attributes':['id'],'raw':!![]}]})[_0x084a('0x29')](handleEntityNotFound(_0x3be1f3,null))['then'](function(_0x57ed50){var _0x5288ea=_[_0x084a('0x31')](_0x57ed50,'id');var _0x19aff1=[];var _0x5dab17=[];var _0x3983b1=squel[_0x084a('0x8d')]();_0x3983b1['field'](_0x084a('0x8e'))[_0x084a('0x8f')](_0x084a('0x90'),'tq')['join'](_0x084a('0x91'),'ut',_0x084a('0x92'))[_0x084a('0x41')](_0x084a('0x93'),_0x294cca[_0x084a('0x4c')]['id']);for(var _0x1d6333=0x0;_0x1d6333<_0x57ed50['length'];_0x1d6333+=0x1){let _0x277932=_0x57ed50[_0x1d6333];for(var _0x5f16a1=0x0;_0x5f16a1<_0x277932[_0x084a('0x86')]['length'];_0x5f16a1+=0x1){let _0x4156fa=_0x277932[_0x084a('0x86')][_0x5f16a1];var _0x43f940=_0x3983b1[_0x084a('0x94')]();_0x43f940[_0x084a('0x41')](_0x084a('0x95'),_0x4156fa['id']);_0x5dab17[_0x084a('0x6a')](db[_0x084a('0x51')][_0x084a('0x38')](_0x43f940[_0x084a('0x96')](),{'type':db[_0x084a('0x51')][_0x084a('0x97')]['SELECT']})[_0x084a('0x29')](function(_0x44f94e){if(_0x44f94e[_0x084a('0x3c')]===0x1){return _0x4156fa['id'];}else{var _0x4725a0=_[_0x084a('0x98')](_[_0x084a('0x31')](_0x44f94e,_0x084a('0x99')),function(_0x13b3f0){return _['includes'](_0x5288ea,_0x13b3f0);});if(_0x4725a0){return _0x4156fa['id'];}}}));}}return BPromise['all'](_0x5dab17)['then'](function(_0x1bcb9d){_0x19aff1=_(_0x19aff1)[_0x084a('0x9a')](_0x1bcb9d)[_0x084a('0x9b')]()[_0x084a('0x9c')]();return db[_0x084a('0x32')][_0x084a('0x4e')]({'where':{'id':_0x294cca[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](function(_0x1997ee){return db[_0x084a('0x51')][_0x084a('0x52')](function(_0x1f5843){return _0x1997ee[_0x084a('0x8c')](_0x294cca[_0x084a('0x38')][_0x084a('0x75')],{'transaction':_0x1f5843})[_0x084a('0x29')](function(){if(!_[_0x084a('0x9d')](_0x19aff1)){return _0x1997ee[_0x084a('0x79')](_0x19aff1,{'transaction':_0x1f5843});}})[_0x084a('0x29')](function(){_0x19aff1[_0x084a('0x8b')](function(_0x2ee2a7){socket['emit'](_0x084a('0x7b'),{'UserId':_0x2ee2a7,'VoicePrefixId':_0x1997ee['id']});});});});});});})[_0x084a('0x29')](respondWithStatusCode(_0x3be1f3,null))[_0x084a('0x4a')](handleError(_0x3be1f3,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index f43d49b..9248cac 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 _0x19ff=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0xcf323,_0x34c2d3){var _0x1cfa63=function(_0x3a99f7){while(--_0x3a99f7){_0xcf323['push'](_0xcf323['shift']());}};_0x1cfa63(++_0x34c2d3);}(_0x19ff,0xb3));var _0xf19f=function(_0x94a089,_0x3ee538){_0x94a089=_0x94a089-0x0;var _0x14c0c6=_0x19ff[_0x94a089];return _0x14c0c6;};'use strict';var EventEmitter=require(_0xf19f('0x0'));var VoicePrefix=require(_0xf19f('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf19f('0x2'),'afterUpdate':_0xf19f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x26aaf7){return function(_0x458c6d,_0x25cab2,_0x24775f){VoicePrefixEvents[_0xf19f('0x4')](_0x26aaf7+':'+_0x458c6d['id'],_0x458c6d);VoicePrefixEvents[_0xf19f('0x4')](_0x26aaf7,_0x458c6d);_0x24775f(null);};}for(var e in events){if(events[_0xf19f('0x5')](e)){var event=events[e];VoicePrefix[_0xf19f('0x6')](e,emitEvent(event));}}module[_0xf19f('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x4533=['exports','../../mysqldb','VoicePrefix','save','update','hasOwnProperty','hook'];(function(_0x282f9a,_0x63dff){var _0x52528c=function(_0xcf1c4c){while(--_0xcf1c4c){_0x282f9a['push'](_0x282f9a['shift']());}};_0x52528c(++_0x63dff);}(_0x4533,0x1f2));var _0x3453=function(_0x2a4b4f,_0x1b150b){_0x2a4b4f=_0x2a4b4f-0x0;var _0x521fab=_0x4533[_0x2a4b4f];return _0x521fab;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x3453('0x0'))['db'][_0x3453('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3453('0x2'),'afterUpdate':_0x3453('0x3'),'afterDestroy':'remove'};function emitEvent(_0x450fe9){return function(_0x250bea,_0x2453c0,_0x2878a9){VoicePrefixEvents['emit'](_0x450fe9+':'+_0x250bea['id'],_0x250bea);VoicePrefixEvents['emit'](_0x450fe9,_0x250bea);_0x2878a9(null);};}for(var e in events){if(events[_0x3453('0x4')](e)){var event=events[e];VoicePrefix[_0x3453('0x5')](e,emitEvent(event));}}module[_0x3453('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index f726a91..d3847e4 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 _0xc804=['VoicePrefix','voice_prefixes','lodash','api','request-promise','rimraf','./voicePrefix.attributes','exports','define'];(function(_0x4a0c01,_0x189914){var _0x4e1e40=function(_0x208b5e){while(--_0x208b5e){_0x4a0c01['push'](_0x4a0c01['shift']());}};_0x4e1e40(++_0x189914);}(_0xc804,0x1d6));var _0x4c80=function(_0x424782,_0x4e0177){_0x424782=_0x424782-0x0;var _0x172c35=_0xc804[_0x424782];return _0x172c35;};'use strict';var _=require(_0x4c80('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4c80('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4c80('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c80('0x3'));var config=require('../../config/environment');var attributes=require(_0x4c80('0x4'));module[_0x4c80('0x5')]=function(_0x728b03,_0x33af72){return _0x728b03[_0x4c80('0x6')](_0x4c80('0x7'),attributes,{'tableName':_0x4c80('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa641=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','../../config/logger','api'];(function(_0x3869c8,_0x2ff137){var _0x4caf60=function(_0x224384){while(--_0x224384){_0x3869c8['push'](_0x3869c8['shift']());}};_0x4caf60(++_0x2ff137);}(_0xa641,0x189));var _0x1a64=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xa641[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x1a64('0x0'));var util=require('util');var logger=require(_0x1a64('0x1'))(_0x1a64('0x2'));var moment=require(_0x1a64('0x3'));var BPromise=require(_0x1a64('0x4'));var rp=require(_0x1a64('0x5'));var fs=require('fs');var path=require(_0x1a64('0x6'));var rimraf=require(_0x1a64('0x7'));var config=require(_0x1a64('0x8'));var attributes=require('./voicePrefix.attributes');module[_0x1a64('0x9')]=function(_0xe13a6d,_0x4424b6){return _0xe13a6d[_0x1a64('0xa')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 0750b72..262b049 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 _0x5430=['moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util'];(function(_0x52006f,_0x35cfdf){var _0x441eff=function(_0x218eb2){while(--_0x218eb2){_0x52006f['push'](_0x52006f['shift']());}};_0x441eff(++_0x35cfdf);}(_0x5430,0x10c));var _0x0543=function(_0x2706c2,_0x13a213){_0x2706c2=_0x2706c2-0x0;var _0x350d74=_0x5430[_0x2706c2];return _0x350d74;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});config[_0x0543('0xa')]=_[_0x0543('0xb')](config['redis'],{'host':_0x0543('0xc'),'port':0x18eb});var socket=require(_0x0543('0xd'))(new Redis(config[_0x0543('0xa')]));require(_0x0543('0xe'))[_0x0543('0xf')](socket);function respondWithRpcPromise(_0x94b9e7,_0x56003c,_0x1ed7cc){return new BPromise(function(_0x1ac048,_0x52c9b7){return client[_0x0543('0x10')](_0x94b9e7,_0x1ed7cc)[_0x0543('0x11')](function(_0x2bb810){logger[_0x0543('0x12')](_0x0543('0x13'),_0x56003c,_0x0543('0x14'));logger[_0x0543('0x15')](_0x0543('0x16'),_0x56003c,_0x0543('0x14'),JSON[_0x0543('0x17')](_0x2bb810));if(_0x2bb810[_0x0543('0x18')]){if(_0x2bb810[_0x0543('0x18')]['code']===0x1f4){logger[_0x0543('0x18')](_0x0543('0x13'),_0x56003c,_0x2bb810['error']['message']);return _0x52c9b7(_0x2bb810[_0x0543('0x18')][_0x0543('0x19')]);}logger[_0x0543('0x18')](_0x0543('0x13'),_0x56003c,_0x2bb810[_0x0543('0x18')]['message']);return _0x1ac048(_0x2bb810[_0x0543('0x18')][_0x0543('0x19')]);}else{logger[_0x0543('0x12')](_0x0543('0x13'),_0x56003c,_0x0543('0x14'));_0x1ac048(_0x2bb810[_0x0543('0x1a')][_0x0543('0x19')]);}})['catch'](function(_0x37b084){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x56003c,_0x37b084);_0x52c9b7(_0x37b084);});});} \ No newline at end of file +var _0xe635=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x56dd93,_0x34508b){var _0x4f9b13=function(_0x1266e1){while(--_0x1266e1){_0x56dd93['push'](_0x56dd93['shift']());}};_0x4f9b13(++_0x34508b);}(_0xe635,0x1be));var _0x5e63=function(_0x53fff6,_0x38b206){_0x53fff6=_0x53fff6-0x0;var _0xc344e5=_0xe635[_0x53fff6];return _0xc344e5;};'use strict';var _=require(_0x5e63('0x0'));var util=require(_0x5e63('0x1'));var moment=require(_0x5e63('0x2'));var BPromise=require(_0x5e63('0x3'));var rs=require(_0x5e63('0x4'));var fs=require('fs');var Redis=require(_0x5e63('0x5'));var db=require(_0x5e63('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5e63('0x7'));var config=require(_0x5e63('0x8'));var jayson=require(_0x5e63('0x9'));var client=jayson[_0x5e63('0xa')][_0x5e63('0xb')]({'port':0x232a});config[_0x5e63('0xc')]=_[_0x5e63('0xd')](config[_0x5e63('0xc')],{'host':_0x5e63('0xe'),'port':0x18eb});var socket=require(_0x5e63('0xf'))(new Redis(config['redis']));require(_0x5e63('0x10'))[_0x5e63('0x11')](socket);function respondWithRpcPromise(_0x307b83,_0x1b8208,_0x5d025f){return new BPromise(function(_0xd64e99,_0x2e9340){return client['request'](_0x307b83,_0x5d025f)[_0x5e63('0x12')](function(_0x2ac738){logger['info'](_0x5e63('0x13'),_0x1b8208,'request\x20sent');logger[_0x5e63('0x14')](_0x5e63('0x15'),_0x1b8208,_0x5e63('0x16'),JSON[_0x5e63('0x17')](_0x2ac738));if(_0x2ac738['error']){if(_0x2ac738['error']['code']===0x1f4){logger[_0x5e63('0x18')](_0x5e63('0x13'),_0x1b8208,_0x2ac738['error'][_0x5e63('0x19')]);return _0x2e9340(_0x2ac738[_0x5e63('0x18')][_0x5e63('0x19')]);}logger['error'](_0x5e63('0x13'),_0x1b8208,_0x2ac738[_0x5e63('0x18')][_0x5e63('0x19')]);return _0xd64e99(_0x2ac738[_0x5e63('0x18')][_0x5e63('0x19')]);}else{logger['info'](_0x5e63('0x13'),_0x1b8208,_0x5e63('0x16'));_0xd64e99(_0x2ac738[_0x5e63('0x1a')][_0x5e63('0x19')]);}})[_0x5e63('0x1b')](function(_0x4a6013){logger[_0x5e63('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x1b8208,_0x4a6013);_0x2e9340(_0x4a6013);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 0f5b867..8cbf0ee 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 _0xfd3a=['save','remove','update','emit','removeListener','length','./voicePrefix.events'];(function(_0x3047dd,_0x350bc9){var _0x2729e2=function(_0x2a5d17){while(--_0x2a5d17){_0x3047dd['push'](_0x3047dd['shift']());}};_0x2729e2(++_0x350bc9);}(_0xfd3a,0x179));var _0xafd3=function(_0x32d76b,_0x1c412b){_0x32d76b=_0x32d76b-0x0;var _0x3923e2=_0xfd3a[_0x32d76b];return _0x3923e2;};'use strict';var VoicePrefixEvents=require(_0xafd3('0x0'));var events=[_0xafd3('0x1'),_0xafd3('0x2'),_0xafd3('0x3')];function createListener(_0x4ce05e,_0x488608){return function(_0x160b0d){_0x488608[_0xafd3('0x4')](_0x4ce05e,_0x160b0d);};}function removeListener(_0x328118,_0x415217){return function(){VoicePrefixEvents[_0xafd3('0x5')](_0x328118,_0x415217);};}exports['register']=function(_0x9db715){for(var _0x1a72eb=0x0,_0x1f7e16=events[_0xafd3('0x6')];_0x1a72eb<_0x1f7e16;_0x1a72eb++){var _0xd2d780=events[_0x1a72eb];var _0x4c4dcd=createListener('voicePrefix:'+_0xd2d780,_0x9db715);VoicePrefixEvents['on'](_0xd2d780,_0x4c4dcd);}}; \ No newline at end of file +var _0xbd3b=['removeListener','length','voicePrefix:','./voicePrefix.events','save','remove','emit'];(function(_0x5b44b4,_0x4d0e2b){var _0x1596fb=function(_0x5ebb7a){while(--_0x5ebb7a){_0x5b44b4['push'](_0x5b44b4['shift']());}};_0x1596fb(++_0x4d0e2b);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x170994,_0x5adc66){_0x170994=_0x170994-0x0;var _0x3c89a3=_0xbd3b[_0x170994];return _0x3c89a3;};'use strict';var VoicePrefixEvents=require(_0xbbd3('0x0'));var events=[_0xbbd3('0x1'),_0xbbd3('0x2'),'update'];function createListener(_0x5e9577,_0xe94b7b){return function(_0x1cf5ef){_0xe94b7b[_0xbbd3('0x3')](_0x5e9577,_0x1cf5ef);};}function removeListener(_0x4e911b,_0x173684){return function(){VoicePrefixEvents[_0xbbd3('0x4')](_0x4e911b,_0x173684);};}exports['register']=function(_0x2e1bcb){for(var _0x494774=0x0,_0x3cc5d9=events[_0xbbd3('0x5')];_0x494774<_0x3cc5d9;_0x494774++){var _0x44f331=events[_0x494774];var _0x4b8667=createListener(_0xbbd3('0x6')+_0x44f331,_0x2e1bcb);VoicePrefixEvents['on'](_0x44f331,_0x4b8667);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 56be963..ccb9a0e 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(_0x3aa28f,_0x13242c){var _0x325b0d=function(_0xb5b73a){while(--_0xb5b73a){_0x3aa28f['push'](_0x3aa28f['shift']());}};_0x325b0d(++_0x13242c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 _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(_0xf9bcaf,_0x3c9230){var _0x1dff25=function(_0x4905bf){while(--_0x4905bf){_0xf9bcaf['push'](_0xf9bcaf['shift']());}};_0x1dff25(++_0x3c9230);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index f83c1b6..fda1df7 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 _0x4266=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','name','ENUM','inbound','outbound','STRING','default','ringall','rrmemory','linear','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','preview','booked','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','predictive','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x31259d,_0x1f27bd){var _0x49f3bf=function(_0x2bab9c){while(--_0x2bab9c){_0x31259d['push'](_0x31259d['shift']());}};_0x49f3bf(++_0x1f27bd);}(_0x4266,0x149));var _0x6426=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x4266[_0x2ec461];return _0x28603d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6426('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x2'),_0x6426('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x6426('0x4')],'defaultValue':_0x6426('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x6426('0x6'),'leastrecent','fewestcalls','random',_0x6426('0x7'),_0x6426('0x8'),'wrandom',_0x6426('0x9')),'allowNull':![],'defaultValue':_0x6426('0x6'),'set':function(_0x1d3934){this[_0x6426('0xa')]('strategy',_0x1d3934?_0x1d3934:_0x6426('0x7'));},'get':function(){var _0x36bbd5=this[_0x6426('0xb')](_0x6426('0xc'));var _0x5c658f=this[_0x6426('0xb')](_0x6426('0xd'));var _0x4ef039=this[_0x6426('0xb')](_0x6426('0xe'));if(_0x36bbd5===_0x6426('0x3')){if(_0x5c658f===_0x6426('0xf')){return null;}if(_0x5c658f===_0x6426('0x10')&&![_0x6426('0x7'),_0x6426('0x11')][_0x6426('0x12')](_0x4ef039)){this[_0x6426('0xa')](_0x6426('0xe'),_0x6426('0x7'));}}return _0x4ef039;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x6426('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x6426('0x13')](0xb)},'timeout':{'type':Sequelize[_0x6426('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x6426('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6426('0x4')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x6426('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no'),'defaultValue':_0x6426('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x6426('0x14'),'no',_0x6426('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x6426('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x6426('0x1')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x6426('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x6426('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6426('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x6426('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x6426('0x1')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x6426('0x1')]('yes','no'),'defaultValue':_0x6426('0x14')},'announce_holdtime':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no',_0x6426('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x6426('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x6426('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x6426('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x6426('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6426('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x6426('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x6426('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x6426('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x6426('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x6426('0x4')]},'queue_quantity2':{'type':Sequelize[_0x6426('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0x6426('0x4')]},'queue_less_than':{'type':Sequelize[_0x6426('0x4')]},'periodic_announce':{'type':Sequelize[_0x6426('0x17')],'set':function(_0x2b3bd2){this[_0x6426('0xa')](_0x6426('0x18'),_0x2b3bd2?_0x2b3bd2[_0x6426('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x6426('0x18'))?this[_0x6426('0xb')]('periodic_announce')[_0x6426('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x6426('0x4')],'defaultValue':_0x6426('0x14'),'set':function(_0x2490f8){this[_0x6426('0xa')]('joinempty',_0x2490f8?_0x2490f8[_0x6426('0x19')](','):undefined);},'get':function(){return this[_0x6426('0xb')](_0x6426('0x1b'))?this[_0x6426('0xb')]('joinempty')[_0x6426('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x6426('0x4')],'defaultValue':'no','set':function(_0x38ca40){this[_0x6426('0xa')](_0x6426('0x1c'),_0x38ca40?_0x38ca40['join'](','):undefined);},'get':function(){return this[_0x6426('0xb')](_0x6426('0x1c'))?this[_0x6426('0xb')](_0x6426('0x1c'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x6426('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x6426('0x4')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x6426('0x1d')],'defaultValue':0x0,'set':function(_0x1e1b9f){this[_0x6426('0xa')](_0x6426('0x1e'),_0x1e1b9f);if(_0x1e1b9f){if(this[_0x6426('0xb')](_0x6426('0x1f'))<0x2){this[_0x6426('0xa')](_0x6426('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x6426('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x6426('0x1d')],'defaultValue':0x0,'comment':_0x6426('0x20')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x6426('0x21'),'power',_0x6426('0x22'),_0x6426('0x10')),'defaultValue':_0x6426('0x21'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x6426('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6426('0x23')},'dialLimitQueue':{'type':Sequelize[_0x6426('0x13')](0x4)[_0x6426('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x6426('0x25')](0x2)[_0x6426('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x6426('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x27'),'dropRate'),'defaultValue':'dropRate','comment':_0x6426('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x6426('0x25')](0x2)[_0x6426('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x6426('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x6426('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6426('0x29')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x6426('0x2a'),'comment':_0x6426('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6426('0x2c')},'dialQueueProject':{'type':Sequelize[_0x6426('0x4')],'comment':_0x6426('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6426('0x13')](0x5)[_0x6426('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6426('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x6426('0x13')](0x5)[_0x6426('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6426('0x2f')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x3,'comment':_0x6426('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6426('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6426('0x31')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6426('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6426('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6426('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x6426('0x1')]('always','never',_0x6426('0x32')),'defaultValue':_0x6426('0x33')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6426('0x34')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6426('0x35')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x6426('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6426('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6426('0x13')](0x9)[_0x6426('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6426('0x37')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6426('0x13')](0x9)[_0x6426('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6426('0x38')},'dialAMDMinWordLength':{'type':Sequelize[_0x6426('0x13')](0x9)[_0x6426('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6426('0x13')](0x9)[_0x6426('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6426('0x13')](0x9)[_0x6426('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6426('0x39')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6426('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6426('0x3a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6426('0x13')](0x9)[_0x6426('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6426('0x3b')},'dialRecallMeTimeout':{'type':Sequelize[_0x6426('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x6426('0x3c')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6426('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6426('0x1')](_0x6426('0x3e'),_0x6426('0x3f')),'defaultValue':_0x6426('0x3e')},'dialQueueProject2':{'type':Sequelize[_0x6426('0x4')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x6426('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6426('0x40')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6426('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6426('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6426('0x13')](0x5)[_0x6426('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6426('0x42')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x6426('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6426('0x43')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6426('0x44')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6426('0x13')](0x5)[_0x6426('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6426('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6426('0x46')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6426('0x13')](0x5)[_0x6426('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6426('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6426('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6426('0x13')](0x5)[_0x6426('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6426('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6426('0x13')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6426('0x4a'),'set':function(_0x5e0af3){if(!_0x5e0af3)this[_0x6426('0xa')](_0x6426('0x4b'),null);this[_0x6426('0xa')](_0x6426('0x4c'),_0x5e0af3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x6426('0x13')](0x3)[_0x6426('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xaf48=['random','rrmemory','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','preview','booked','includes','INTEGER','yes','all','once','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','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','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','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','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','outbound','default','ringall','fewestcalls'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xaf48,0x191));var _0x8af4=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xaf48[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x8af4('0x0'));module[_0x8af4('0x1')]={'name':{'type':Sequelize[_0x8af4('0x2')],'allowNull':![],'unique':_0x8af4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8af4('0x4')]('inbound',_0x8af4('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':_0x8af4('0x6')},'announce':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x8af4('0x7'),'leastrecent',_0x8af4('0x8'),_0x8af4('0x9'),_0x8af4('0xa'),'linear','wrandom',_0x8af4('0xb')),'allowNull':![],'defaultValue':_0x8af4('0x7'),'set':function(_0x292bbd){this[_0x8af4('0xc')](_0x8af4('0xd'),_0x292bbd?_0x292bbd:'rrmemory');},'get':function(){var _0x4f304e=this[_0x8af4('0xe')](_0x8af4('0xf'));var _0x34dbb5=this[_0x8af4('0xe')](_0x8af4('0x10'));var _0x3ab502=this[_0x8af4('0xe')](_0x8af4('0xd'));if(_0x4f304e===_0x8af4('0x5')){if(_0x34dbb5===_0x8af4('0x11')){return null;}if(_0x34dbb5===_0x8af4('0x12')&&![_0x8af4('0xa'),'roundrobin'][_0x8af4('0x13')](_0x3ab502)){this[_0x8af4('0xc')](_0x8af4('0xd'),_0x8af4('0xa'));}}return _0x3ab502;}},'servicelevel':{'type':Sequelize[_0x8af4('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8af4('0x14')](0xb)},'timeout':{'type':Sequelize[_0x8af4('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8af4('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8af4('0x2')]},'weight':{'type':Sequelize[_0x8af4('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8af4('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x8af4('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x8af4('0x4')](_0x8af4('0x15'),'no',_0x8af4('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x8af4('0x4')](_0x8af4('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x8af4('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8af4('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8af4('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x8af4('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8af4('0x4')](_0x8af4('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8af4('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8af4('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8af4('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8af4('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8af4('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x8af4('0x15'),'no'),'defaultValue':_0x8af4('0x15')},'announce_holdtime':{'type':Sequelize[_0x8af4('0x4')](_0x8af4('0x15'),'no',_0x8af4('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x8af4('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8af4('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8af4('0x2')]},'queue_youarenext':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8af4('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x8af4('0x2')]},'queue_quantity2':{'type':Sequelize[_0x8af4('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x8af4('0x2')]},'queue_less_than':{'type':Sequelize[_0x8af4('0x2')]},'periodic_announce':{'type':Sequelize[_0x8af4('0x18')],'set':function(_0x541d37){this[_0x8af4('0xc')]('periodic_announce',_0x541d37?_0x541d37[_0x8af4('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x8af4('0x1a'))?this[_0x8af4('0xe')](_0x8af4('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x8af4('0x15'),'set':function(_0x39a193){this[_0x8af4('0xc')](_0x8af4('0x1b'),_0x39a193?_0x39a193[_0x8af4('0x19')](','):undefined);},'get':function(){return this[_0x8af4('0xe')]('joinempty')?this[_0x8af4('0xe')]('joinempty')[_0x8af4('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':'no','set':function(_0x5ee438){this[_0x8af4('0xc')](_0x8af4('0x1d'),_0x5ee438?_0x5ee438['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x8af4('0x1d'))?this[_0x8af4('0xe')](_0x8af4('0x1d'))[_0x8af4('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8af4('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x8af4('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8af4('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x8af4('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x8af4('0x1e')],'defaultValue':0x0,'set':function(_0x2ed72e){this[_0x8af4('0xc')](_0x8af4('0x1f'),_0x2ed72e);if(_0x2ed72e){if(this[_0x8af4('0xe')]('wrapuptime')<0x2){this[_0x8af4('0xc')](_0x8af4('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8af4('0x1e')],'defaultValue':0x0,'comment':_0x8af4('0x21')},'dialMethod':{'type':Sequelize[_0x8af4('0x4')](_0x8af4('0x11'),_0x8af4('0x22'),_0x8af4('0x23'),_0x8af4('0x24'),_0x8af4('0x12')),'defaultValue':_0x8af4('0x22'),'comment':_0x8af4('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x8af4('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8af4('0x27')},'dialLimitQueue':{'type':Sequelize[_0x8af4('0x14')](0x4)[_0x8af4('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8af4('0x28')},'dialPowerLevel':{'type':Sequelize[_0x8af4('0x29')](0x2)[_0x8af4('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8af4('0x2a')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x8af4('0x2b'),_0x8af4('0x2c')),'defaultValue':_0x8af4('0x2c'),'comment':_0x8af4('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x8af4('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8af4('0x2e')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x8af4('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8af4('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8af4('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8af4('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8af4('0x30')},'dialQueueOptions':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':'tTxX','comment':_0x8af4('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x8af4('0x14')](0x3)[_0x8af4('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x8af4('0x2')],'comment':_0x8af4('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8af4('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8af4('0x14')](0x5)[_0x8af4('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x8af4('0x14')](0x3)[_0x8af4('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8af4('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8af4('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8af4('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8af4('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x8af4('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8af4('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8af4('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8af4('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8af4('0x37')},'dialTimezone':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':_0x8af4('0x38')},'dialPrefix':{'type':Sequelize[_0x8af4('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8af4('0x39'),_0x8af4('0x3a'),_0x8af4('0x3b')),'defaultValue':_0x8af4('0x39')},'dialAMDActive':{'type':Sequelize[_0x8af4('0x1e')],'defaultValue':0x0,'comment':_0x8af4('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x8af4('0x14')](0x9)[_0x8af4('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x8af4('0x14')](0x9)[_0x8af4('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8af4('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8af4('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8af4('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8af4('0x14')](0x9)[_0x8af4('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8af4('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x8af4('0x14')](0x9)[_0x8af4('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8af4('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8af4('0x14')](0x9)[_0x8af4('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8af4('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x8af4('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8af4('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x8af4('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8af4('0x14')](0x9)[_0x8af4('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x8af4('0x14')](0x5)[_0x8af4('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8af4('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x8af4('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x8af4('0x4')]('DESC','ASC'),'defaultValue':_0x8af4('0x44')},'dialQueueProject2':{'type':Sequelize[_0x8af4('0x2')],'comment':_0x8af4('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8af4('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8af4('0x14')](0x3)[_0x8af4('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8af4('0x45')},'dialCutDigit':{'type':Sequelize[_0x8af4('0x14')](0x3)[_0x8af4('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8af4('0x14')](0x3)[_0x8af4('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8af4('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8af4('0x46')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8af4('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x8af4('0x14')](0x5)[_0x8af4('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8af4('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8af4('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8af4('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8af4('0x14')](0x5)[_0x8af4('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8af4('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x8af4('0x14')](0x3)[_0x8af4('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8af4('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8af4('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8af4('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8af4('0x14')](0x3)[_0x8af4('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8af4('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8af4('0x14')](0x5)[_0x8af4('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8af4('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8af4('0x14')],'allowNull':!![],'comment':_0x8af4('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x8af4('0x1e')],'defaultValue':![],'comment':_0x8af4('0x50'),'set':function(_0x39069f){if(!_0x39069f)this[_0x8af4('0xc')](_0x8af4('0x51'),null);this['setDataValue']('mandatoryDisposition',_0x39069f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x8af4('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8af4('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8af4('0x14')](0x3)[_0x8af4('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8af4('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 49ca865..33f5c55 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 _0x7217=['toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','ids','emit','userVoiceQueue:remove','addAgents','isEmpty','removeAgents','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','scheduledAt','ContactId','ListId','phone','CmListId','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','cm_hopper','fromQuery','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','type','find','name','UserProfileResource','end','error','send','index','VoiceQueue','fieldName','getOptions','where','include','query','findAll','rows','catch','params','model','keys','rawAttributes','filters','attributes','intersection','fields','length','options','create','user','role','outbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','omit','createdAt','updatedAt','body','merge','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','limit','order','sort','pick','VoiceQueueId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','online','flatMap','penalty','sequelize','transaction','addTeams','upsert','each','UserVoiceQueueRt','isNil','interface','format','SIP/%s','voicePause','forEach','userVoiceQueue:save','removeTeams','Agents','select','field','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0x7217,0x19e));var _0x7721=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x7217[_0x3635ce];return _0x97ecd0;};'use strict';var moment=require(_0x7721('0x0'));var BPromise=require('bluebird');var util=require(_0x7721('0x1'));var _=require(_0x7721('0x2'));var squel=require(_0x7721('0x3'));var Redis=require(_0x7721('0x4'));var qs=require(_0x7721('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x7721('0x6'));var db=require(_0x7721('0x7'))['db'];config[_0x7721('0x8')]=_[_0x7721('0x9')](config[_0x7721('0x8')],{'host':_0x7721('0xa'),'port':0x18eb});var socket=require(_0x7721('0xb'))(new Redis(config[_0x7721('0x8')]));require(_0x7721('0xc'))[_0x7721('0xd')](socket);function respondWithStatusCode(_0x3e6368,_0x2a66cb){_0x2a66cb=_0x2a66cb||0xcc;return function(_0xfa8835){if(_0xfa8835){return _0x3e6368[_0x7721('0xe')](_0x2a66cb);}return _0x3e6368[_0x7721('0xf')](_0x2a66cb)['end']();};}function respondWithResult(_0x461d1a,_0x29bc8f){_0x29bc8f=_0x29bc8f||0xc8;return function(_0x8729a6){if(_0x8729a6){return _0x461d1a[_0x7721('0xf')](_0x29bc8f)[_0x7721('0x10')](_0x8729a6);}};}function respondWithFilteredResult(_0x409b37,_0x1e7fd7){return function(_0x27b36b){if(_0x27b36b){var _0x55b4ca=typeof _0x1e7fd7[_0x7721('0x11')]===_0x7721('0x12')&&typeof _0x1e7fd7['limit']===_0x7721('0x12');var _0x30da54=_0x27b36b[_0x7721('0x13')];var _0x2e9752=_0x55b4ca?0x0:_0x1e7fd7['offset'];var _0x3cbce8=_0x55b4ca?_0x27b36b[_0x7721('0x13')]:_0x1e7fd7['offset']+_0x1e7fd7['limit'];var _0x4b183e;if(_0x3cbce8>=_0x30da54){_0x3cbce8=_0x30da54;_0x4b183e=0xc8;}else{_0x4b183e=0xce;}_0x409b37[_0x7721('0xf')](_0x4b183e);return _0x409b37[_0x7721('0x14')](_0x7721('0x15'),_0x2e9752+'-'+_0x3cbce8+'/'+_0x30da54)[_0x7721('0x10')](_0x27b36b);}return null;};}function saveUpdates(_0x5ed94b){return function(_0x20f669){if(_0x20f669){return _0x20f669['update'](_0x5ed94b)[_0x7721('0x16')](function(_0x5cb0e6){return _0x5cb0e6;});}return null;};}function removeEntity(_0xfec626){return function(_0x4e96fb){if(_0x4e96fb){return _0x4e96fb[_0x7721('0x17')]()[_0x7721('0x16')](function(){var _0x2286e5=_0x4e96fb[_0x7721('0x18')]({'plain':!![]});var _0x402820=[{'name':_0x7721('0x19'),'value':_0x7721('0x1a'),'ignore':![]},{'name':_0x7721('0x1b'),'value':'outbound','ignore':![]}];var _0x288f7e=_(_0x402820)[_0x7721('0x1c')](_0x7721('0x1d'))[_0x7721('0x1e')]('value')[_0x7721('0x1f')]();if(_['includes'](_0x288f7e,_0x2286e5[_0x7721('0x20')])){return;}var _0x288e3a=_[_0x7721('0x21')](_0x402820,[_0x7721('0x1f'),_0x2286e5[_0x7721('0x20')]])[_0x7721('0x22')];return db[_0x7721('0x23')]['destroy']({'where':{'type':_0x288e3a,'resourceId':_0x2286e5['id']}})[_0x7721('0x16')](function(){return _0x4e96fb;});})[_0x7721('0x16')](function(){_0xfec626[_0x7721('0xf')](0xcc)[_0x7721('0x24')]();});}};}function handleEntityNotFound(_0x40d550){return function(_0x16355a){if(!_0x16355a){_0x40d550[_0x7721('0xe')](0x194);}return _0x16355a;};}function handleError(_0xf753f1,_0x40f367){_0x40f367=_0x40f367||0x1f4;return function(_0x52316e){logger[_0x7721('0x25')](_0x52316e['stack']);if(_0x52316e['name']){delete _0x52316e[_0x7721('0x22')];}_0xf753f1[_0x7721('0xf')](_0x40f367)[_0x7721('0x26')](_0x52316e);};}exports[_0x7721('0x27')]=function(_0x1ea4d,_0x37b9f0){var _0xd7d703={};var _0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x1e')](db[_0x7721('0x28')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x29')],'type':_0x4a25c9[_0x7721('0x20')]['key']};});_0xd7d703=qs[_0x7721('0x2a')](_0x5c54f0,_0x1ea4d);var _0x4651b5={'where':_0xd7d703[_0x7721('0x2b')]};return db['VoiceQueue'][_0x7721('0x13')](_0x4651b5)[_0x7721('0x16')](function(_0x1492d4){_0x1da2d8[_0x7721('0x13')]=_0x1492d4;_0xd7d703[_0x7721('0x2c')]=qs['include'](_0x1ea4d[_0x7721('0x2d')]);return db[_0x7721('0x28')][_0x7721('0x2e')](_0xd7d703);})['then'](function(_0x35de7a){_0x1da2d8[_0x7721('0x2f')]=_0x35de7a;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x37b9f0,_0xd7d703))[_0x7721('0x30')](handleError(_0x37b9f0,null));};exports['show']=function(_0x2d6ba0,_0x326c50){var _0x19d082={'raw':![],'where':{'id':_0x2d6ba0[_0x7721('0x31')]['id']}},_0x1d894b={};_0x1d894b[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x28')][_0x7721('0x34')]);_0x1d894b[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x2d6ba0['query']);_0x1d894b[_0x7721('0x35')]=_['intersection'](_0x1d894b[_0x7721('0x32')],_0x1d894b[_0x7721('0x2d')]);_0x19d082[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1d894b[_0x7721('0x32')],qs[_0x7721('0x38')](_0x2d6ba0['query']['fields']));_0x19d082['attributes']=_0x19d082['attributes'][_0x7721('0x39')]?_0x19d082[_0x7721('0x36')]:_0x1d894b[_0x7721('0x32')];if(_0x2d6ba0[_0x7721('0x2d')]['includeAll']){_0x19d082[_0x7721('0x2c')]=[{'all':!![]}];}_0x19d082=_['merge']({},_0x19d082,_0x2d6ba0[_0x7721('0x3a')]);return db[_0x7721('0x28')]['find'](_0x19d082)[_0x7721('0x16')](handleEntityNotFound(_0x326c50,null))[_0x7721('0x16')](respondWithResult(_0x326c50,null))['catch'](handleError(_0x326c50,null));};exports['create']=function(_0x3d84d3,_0xfc4dc4){return db[_0x7721('0x28')][_0x7721('0x3b')](_0x3d84d3['body'],{})[_0x7721('0x16')](function(_0x120de9){var _0x40ce8c=_0x3d84d3[_0x7721('0x3c')][_0x7721('0x18')]({'plain':!![]});if(!_0x40ce8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40ce8c[_0x7721('0x3d')]==='user'){var _0xaa3216=_0x120de9['get']({'plain':!![]});var _0x2333b8=[{'name':_0x7721('0x19'),'value':_0x7721('0x1a')},{'name':'QueueCampaigns','value':_0x7721('0x3e')}];var _0x11d853=_[_0x7721('0x21')](_0x2333b8,['value',_0xaa3216[_0x7721('0x20')]])[_0x7721('0x22')];return db[_0x7721('0x3f')][_0x7721('0x21')]({'where':{'name':_0x11d853,'userProfileId':_0x40ce8c[_0x7721('0x40')]},'raw':!![]})[_0x7721('0x16')](function(_0x463ccc){if(_0x463ccc&&_0x463ccc['autoAssociation']===0x0){return db['UserProfileResource'][_0x7721('0x3b')]({'name':_0xaa3216[_0x7721('0x22')],'resourceId':_0xaa3216['id'],'type':_0x463ccc[_0x7721('0x22')],'sectionId':_0x463ccc['id']},{})[_0x7721('0x16')](function(){return _0x120de9;});}else{return _0x120de9;}})[_0x7721('0x30')](function(_0x15181b){logger[_0x7721('0x25')](_0x7721('0x41'),_0x15181b);throw _0x15181b;});}return _0x120de9;})[_0x7721('0x16')](respondWithResult(_0xfc4dc4,0xc9))[_0x7721('0x30')](handleError(_0xfc4dc4,null));};exports['clone']=function(_0x578867,_0x5ed70d){var _0x6a4664={'where':{'id':_0x578867[_0x7721('0x31')]['id']}},_0x151f69={};_0x151f69['model']=_[_0x7721('0x33')](db[_0x7721('0x28')]['rawAttributes']);_0x6a4664[_0x7721('0x36')]=_['intersection'](_0x151f69[_0x7721('0x32')],qs['fields'](_0x578867[_0x7721('0x2d')][_0x7721('0x38')]));_0x6a4664[_0x7721('0x36')]=_0x6a4664['attributes'][_0x7721('0x39')]?_0x6a4664[_0x7721('0x36')]:_0x151f69['model'];if(_0x578867[_0x7721('0x2d')][_0x7721('0x42')]){_0x6a4664[_0x7721('0x2c')]=[{'all':!![]}];}_0x6a4664=_['merge']({},_0x6a4664,_0x578867[_0x7721('0x3a')]);return db['VoiceQueue'][_0x7721('0x21')](_0x6a4664)[_0x7721('0x16')](handleEntityNotFound(_0x5ed70d,null))[_0x7721('0x16')](function(_0x443503){if(_0x443503){var _0x1c95d8=_0x443503[_0x7721('0x18')]({'plain':!![]});_0x1c95d8=qs[_0x7721('0x43')](_0x1c95d8,['id',_0x7721('0x44'),_0x7721('0x45')]);_0x578867[_0x7721('0x46')]=_[_0x7721('0x43')](_0x578867[_0x7721('0x46')],['id',_0x7721('0x44'),_0x7721('0x45')]);return db[_0x7721('0x28')]['create'](_[_0x7721('0x47')](_0x1c95d8,_0x578867[_0x7721('0x46')]),{'include':_0x578867[_0x7721('0x2d')][_0x7721('0x42')]?[{'all':!![]}]:undefined})[_0x7721('0x16')](function(_0x315127){var _0x267f5e=_0x578867['user'][_0x7721('0x18')]({'plain':!![]});if(!_0x267f5e)throw new Error(_0x7721('0x48'));if(_0x267f5e[_0x7721('0x3d')]===_0x7721('0x3c')){var _0x1f1e84=_0x315127[_0x7721('0x18')]({'plain':!![]});var _0x7fbd6c=[{'name':_0x7721('0x19'),'value':_0x7721('0x1a')},{'name':_0x7721('0x1b'),'value':_0x7721('0x3e')}];var _0x52e870=_[_0x7721('0x21')](_0x7fbd6c,[_0x7721('0x1f'),_0x1f1e84[_0x7721('0x20')]])[_0x7721('0x22')];return db[_0x7721('0x3f')][_0x7721('0x21')]({'where':{'name':_0x52e870,'userProfileId':_0x267f5e[_0x7721('0x40')]},'raw':!![]})[_0x7721('0x16')](function(_0x360882){if(_0x360882&&_0x360882[_0x7721('0x49')]===0x0){return db[_0x7721('0x23')][_0x7721('0x3b')]({'name':_0x1f1e84[_0x7721('0x22')],'resourceId':_0x1f1e84['id'],'type':_0x360882[_0x7721('0x22')],'sectionId':_0x360882['id']},{})[_0x7721('0x16')](function(){return _0x315127;});}else{return _0x315127;}})['catch'](function(_0x50e9e9){logger['error'](_0x7721('0x41'),_0x50e9e9);throw _0x50e9e9;});}return _0x315127;});}})['then'](respondWithResult(_0x5ed70d,0xc9))['catch'](handleError(_0x5ed70d,null));};exports['update']=function(_0x5d7036,_0x47925a){if(_0x5d7036[_0x7721('0x46')]['id']){delete _0x5d7036[_0x7721('0x46')]['id'];}return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0x5d7036['params']['id']}})['then'](handleEntityNotFound(_0x47925a,null))['then'](saveUpdates(_0x5d7036[_0x7721('0x46')],null))['then'](respondWithResult(_0x47925a,null))['catch'](handleError(_0x47925a,null));};exports['destroy']=function(_0x160292,_0x2e9155){return db[_0x7721('0x28')]['find']({'where':{'id':_0x160292[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x2e9155,null))[_0x7721('0x16')](removeEntity(_0x2e9155,null))[_0x7721('0x30')](handleError(_0x2e9155,null));};exports[_0x7721('0x4a')]=function(_0x16e80b,_0xad43ce){var _0x3e3301={'raw':![],'where':{}};var _0x127f46={};var _0x197b73={'count':0x0,'rows':[]};return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x16e80b[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0xad43ce,null))[_0x7721('0x16')](function(_0x4cbd28){if(_0x4cbd28){_0x127f46[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x4c')][_0x7721('0x34')]);_0x127f46['query']=_[_0x7721('0x33')](_0x16e80b[_0x7721('0x2d')]);_0x127f46['filters']=_[_0x7721('0x37')](_0x127f46['model'],_0x127f46[_0x7721('0x2d')]);_0x3e3301[_0x7721('0x36')]=_[_0x7721('0x37')](_0x127f46[_0x7721('0x32')],qs[_0x7721('0x38')](_0x16e80b[_0x7721('0x2d')][_0x7721('0x38')]));_0x3e3301[_0x7721('0x36')]=_0x3e3301[_0x7721('0x36')]['length']?_0x3e3301[_0x7721('0x36')]:_0x127f46[_0x7721('0x32')];if(!_0x16e80b[_0x7721('0x2d')][_0x7721('0x4d')](_0x7721('0x4e'))){_0x3e3301[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x16e80b['query'][_0x7721('0x4f')]);_0x3e3301[_0x7721('0x11')]=qs['offset'](_0x16e80b[_0x7721('0x2d')]['offset']);}_0x3e3301[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x16e80b[_0x7721('0x2d')][_0x7721('0x51')]);_0x3e3301[_0x7721('0x2b')]=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x16e80b['query'],_0x127f46[_0x7721('0x35')]));_0x3e3301[_0x7721('0x2b')][_0x7721('0x53')]=_0x4cbd28['id'];if(_0x16e80b['query']['filter']){_0x3e3301['where']=_['merge'](_0x3e3301['where'],{'$or':_[_0x7721('0x1e')](_0x3e3301[_0x7721('0x36')],function(_0x580473){var _0x2d4b3a={};_0x2d4b3a[_0x580473]={'$like':'%'+_0x16e80b[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x2d4b3a;})});}_0x3e3301=_[_0x7721('0x47')]({},_0x3e3301,_0x16e80b['options']);return db[_0x7721('0x4c')][_0x7721('0x13')]({'where':_0x3e3301[_0x7721('0x2b')]})[_0x7721('0x16')](function(_0x3cf3fd){_0x197b73['count']=_0x3cf3fd;if(_0x16e80b[_0x7721('0x2d')][_0x7721('0x42')]){_0x3e3301[_0x7721('0x2c')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3e3301);})[_0x7721('0x16')](function(_0x752564){_0x197b73[_0x7721('0x2f')]=_0x752564;return _0x197b73;});}})[_0x7721('0x16')](respondWithFilteredResult(_0xad43ce,_0x3e3301))[_0x7721('0x30')](handleError(_0xad43ce,null));};exports['getHopperHistories']=function(_0x4ba35e,_0x263070){var _0x1bd97e={'raw':!![],'where':{}};var _0x68de4={};var _0x3c66b3={'count':0x0,'rows':[]};return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x4ba35e[_0x7721('0x31')]['id']}})['then'](handleEntityNotFound(_0x263070,null))[_0x7721('0x16')](function(_0x413185){if(_0x413185){_0x68de4[_0x7721('0x32')]=_['keys'](db[_0x7721('0x54')][_0x7721('0x34')]);_0x68de4[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x4ba35e['query']);_0x68de4['filters']=_[_0x7721('0x37')](_0x68de4[_0x7721('0x32')],_0x68de4[_0x7721('0x2d')]);_0x1bd97e[_0x7721('0x36')]=_[_0x7721('0x37')](_0x68de4[_0x7721('0x32')],qs['fields'](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x38')]));_0x1bd97e[_0x7721('0x36')]=_0x1bd97e['attributes'][_0x7721('0x39')]?_0x1bd97e[_0x7721('0x36')]:_0x68de4[_0x7721('0x32')];if(!_0x4ba35e[_0x7721('0x2d')][_0x7721('0x4d')]('nolimit')){_0x1bd97e[_0x7721('0x4f')]=qs['limit'](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x4f')]);_0x1bd97e[_0x7721('0x11')]=qs[_0x7721('0x11')](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x11')]);}_0x1bd97e[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x51')]);_0x1bd97e[_0x7721('0x2b')]=qs['filters'](_[_0x7721('0x52')](_0x4ba35e[_0x7721('0x2d')],_0x68de4[_0x7721('0x35')]));_0x1bd97e['where'][_0x7721('0x53')]=_0x413185['id'];if(_0x4ba35e[_0x7721('0x2d')][_0x7721('0x1c')]){_0x1bd97e[_0x7721('0x2b')]=_[_0x7721('0x47')](_0x1bd97e['where'],{'$or':_[_0x7721('0x1e')](_0x1bd97e[_0x7721('0x36')],function(_0x44326d){var _0x21b365={};_0x21b365[_0x44326d]={'$like':'%'+_0x4ba35e[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x21b365;})});}_0x1bd97e=_['merge']({},_0x1bd97e,_0x4ba35e[_0x7721('0x3a')]);return db[_0x7721('0x54')]['count']({'where':_0x1bd97e[_0x7721('0x2b')]})['then'](function(_0x453792){_0x3c66b3[_0x7721('0x13')]=_0x453792;if(_0x4ba35e['query'][_0x7721('0x42')]){_0x1bd97e['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1bd97e);})[_0x7721('0x16')](function(_0x20f12e){_0x3c66b3[_0x7721('0x2f')]=_0x20f12e;return _0x3c66b3;});}})['then'](respondWithFilteredResult(_0x263070,_0x1bd97e))['catch'](handleError(_0x263070,null));};exports['getHopperFinals']=function(_0x355aa8,_0x3f7923){var _0x3c9334={'raw':!![],'where':{}};var _0x4220cf={};var _0x3b02d7={'count':0x0,'rows':[]};return db[_0x7721('0x28')]['findOne']({'where':{'id':_0x355aa8[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x3f7923,null))[_0x7721('0x16')](function(_0xcf5304){if(_0xcf5304){_0x4220cf[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x55')][_0x7721('0x34')]);_0x4220cf[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x355aa8[_0x7721('0x2d')]);_0x4220cf[_0x7721('0x35')]=_['intersection'](_0x4220cf['model'],_0x4220cf[_0x7721('0x2d')]);_0x3c9334[_0x7721('0x36')]=_['intersection'](_0x4220cf[_0x7721('0x32')],qs['fields'](_0x355aa8['query'][_0x7721('0x38')]));_0x3c9334['attributes']=_0x3c9334['attributes'][_0x7721('0x39')]?_0x3c9334[_0x7721('0x36')]:_0x4220cf[_0x7721('0x32')];if(!_0x355aa8[_0x7721('0x2d')][_0x7721('0x4d')]('nolimit')){_0x3c9334[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x355aa8[_0x7721('0x2d')][_0x7721('0x4f')]);_0x3c9334['offset']=qs['offset'](_0x355aa8[_0x7721('0x2d')][_0x7721('0x11')]);}_0x3c9334['order']=qs[_0x7721('0x51')](_0x355aa8[_0x7721('0x2d')]['sort']);_0x3c9334['where']=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x355aa8[_0x7721('0x2d')],_0x4220cf[_0x7721('0x35')]));_0x3c9334[_0x7721('0x2b')][_0x7721('0x53')]=_0xcf5304['id'];if(_0x355aa8[_0x7721('0x2d')][_0x7721('0x1c')]){_0x3c9334['where']=_[_0x7721('0x47')](_0x3c9334[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x3c9334[_0x7721('0x36')],function(_0xe1c795){var _0x9b5f60={};_0x9b5f60[_0xe1c795]={'$like':'%'+_0x355aa8[_0x7721('0x2d')]['filter']+'%'};return _0x9b5f60;})});}_0x3c9334=_[_0x7721('0x47')]({},_0x3c9334,_0x355aa8[_0x7721('0x3a')]);return db['CmHopperFinal'][_0x7721('0x13')]({'where':_0x3c9334[_0x7721('0x2b')]})[_0x7721('0x16')](function(_0xb8547a){_0x3b02d7[_0x7721('0x13')]=_0xb8547a;if(_0x355aa8[_0x7721('0x2d')][_0x7721('0x42')]){_0x3c9334[_0x7721('0x2c')]=[{'all':!![]}];}return db[_0x7721('0x55')][_0x7721('0x2e')](_0x3c9334);})['then'](function(_0x418954){_0x3b02d7[_0x7721('0x2f')]=_0x418954;return _0x3b02d7;});}})[_0x7721('0x16')](respondWithFilteredResult(_0x3f7923,_0x3c9334))[_0x7721('0x30')](handleError(_0x3f7923,null));};exports[_0x7721('0x56')]=function(_0x47653d,_0x12869b){var _0x1cfee2={'raw':!![],'where':{}};var _0x425327={};var _0x42ee11={'count':0x0,'rows':[]};return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x47653d[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x12869b,null))[_0x7721('0x16')](function(_0x461938){if(_0x461938){_0x425327[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x57')][_0x7721('0x34')]);_0x425327['query']=_[_0x7721('0x33')](_0x47653d['query']);_0x425327[_0x7721('0x35')]=_[_0x7721('0x37')](_0x425327[_0x7721('0x32')],_0x425327[_0x7721('0x2d')]);_0x1cfee2[_0x7721('0x36')]=_['intersection'](_0x425327['model'],qs['fields'](_0x47653d['query'][_0x7721('0x38')]));_0x1cfee2[_0x7721('0x36')]=_0x1cfee2[_0x7721('0x36')][_0x7721('0x39')]?_0x1cfee2[_0x7721('0x36')]:_0x425327['model'];if(!_0x47653d[_0x7721('0x2d')]['hasOwnProperty'](_0x7721('0x4e'))){_0x1cfee2[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x47653d[_0x7721('0x2d')][_0x7721('0x4f')]);_0x1cfee2[_0x7721('0x11')]=qs['offset'](_0x47653d[_0x7721('0x2d')]['offset']);}_0x1cfee2['order']=qs[_0x7721('0x51')](_0x47653d[_0x7721('0x2d')][_0x7721('0x51')]);_0x1cfee2[_0x7721('0x2b')]=qs[_0x7721('0x35')](_['pick'](_0x47653d[_0x7721('0x2d')],_0x425327[_0x7721('0x35')]));_0x1cfee2[_0x7721('0x2b')][_0x7721('0x53')]=_0x461938['id'];if(_0x47653d[_0x7721('0x2d')][_0x7721('0x1c')]){_0x1cfee2[_0x7721('0x2b')]=_['merge'](_0x1cfee2[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x1cfee2[_0x7721('0x36')],function(_0x193326){var _0x1dbf47={};_0x1dbf47[_0x193326]={'$like':'%'+_0x47653d['query'][_0x7721('0x1c')]+'%'};return _0x1dbf47;})});}_0x1cfee2=_[_0x7721('0x47')]({},_0x1cfee2,_0x47653d[_0x7721('0x3a')]);return db['CmHopperBlack'][_0x7721('0x13')]({'where':_0x1cfee2[_0x7721('0x2b')]})['then'](function(_0x29403d){_0x42ee11[_0x7721('0x13')]=_0x29403d;if(_0x47653d[_0x7721('0x2d')][_0x7721('0x42')]){_0x1cfee2['include']=[{'all':!![]}];}return db[_0x7721('0x57')]['findAll'](_0x1cfee2);})[_0x7721('0x16')](function(_0x1c50c2){_0x42ee11['rows']=_0x1c50c2;return _0x42ee11;});}})[_0x7721('0x16')](respondWithFilteredResult(_0x12869b,_0x1cfee2))[_0x7721('0x30')](handleError(_0x12869b,null));};exports['getTeams']=function(_0x29968c,_0x11733f){var _0x5e3816={};var _0x7fd3e8={};var _0x52e8b1;var _0x240b0a;return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x29968c['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x11733f,null))['then'](function(_0x5a00be){if(_0x5a00be){_0x52e8b1=_0x5a00be;_0x7fd3e8[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x58')][_0x7721('0x34')]);_0x7fd3e8[_0x7721('0x2d')]=_['keys'](_0x29968c[_0x7721('0x2d')]);_0x7fd3e8[_0x7721('0x35')]=_[_0x7721('0x37')](_0x7fd3e8[_0x7721('0x32')],_0x7fd3e8[_0x7721('0x2d')]);_0x5e3816['attributes']=_[_0x7721('0x37')](_0x7fd3e8['model'],qs[_0x7721('0x38')](_0x29968c['query']['fields']));_0x5e3816[_0x7721('0x36')]=_0x5e3816['attributes']['length']?_0x5e3816[_0x7721('0x36')]:_0x7fd3e8[_0x7721('0x32')];_0x5e3816[_0x7721('0x50')]=qs['sort'](_0x29968c[_0x7721('0x2d')]['sort']);_0x5e3816['where']=qs['filters'](_[_0x7721('0x52')](_0x29968c[_0x7721('0x2d')],_0x7fd3e8[_0x7721('0x35')]));if(_0x29968c[_0x7721('0x2d')][_0x7721('0x1c')]){_0x5e3816[_0x7721('0x2b')]=_[_0x7721('0x47')](_0x5e3816[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x5e3816[_0x7721('0x36')],function(_0x25bf32){var _0x4ec3c6={};_0x4ec3c6[_0x25bf32]={'$like':'%'+_0x29968c[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x4ec3c6;})});}_0x5e3816=_[_0x7721('0x47')]({},_0x5e3816,_0x29968c[_0x7721('0x3a')]);return _0x52e8b1[_0x7721('0x59')](_0x5e3816);}})[_0x7721('0x16')](function(_0xc7e4e9){if(_0xc7e4e9){_0x240b0a=_0xc7e4e9['length'];if(!_0x29968c['query'][_0x7721('0x4d')](_0x7721('0x4e'))){_0x5e3816[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x29968c['query'][_0x7721('0x4f')]);_0x5e3816['offset']=qs[_0x7721('0x11')](_0x29968c['query'][_0x7721('0x11')]);}return _0x52e8b1[_0x7721('0x59')](_0x5e3816);}})[_0x7721('0x16')](function(_0x249a5b){if(_0x249a5b){return _0x249a5b?{'count':_0x240b0a,'rows':_0x249a5b}:null;}})[_0x7721('0x16')](respondWithResult(_0x11733f,null))[_0x7721('0x30')](handleError(_0x11733f,null));};exports['addTeams']=function(_0x509f2d,_0x4d2644){var _0x2b0968=_0x509f2d['body'][_0x7721('0x5a')];var _0x186ada=_['map'](_0x2b0968,'id');return db[_0x7721('0x58')][_0x7721('0x2e')]({'where':{'id':_0x186ada},'attributes':['id'],'include':[{'model':db[_0x7721('0x5b')],'as':'Agents','attributes':['id',_0x7721('0x22'),_0x7721('0x5c'),'voicePause','interface'],'raw':!![]}]})[_0x7721('0x16')](function(_0xc85b9){if(_0xc85b9){var _0x58be49=_[_0x7721('0x5d')](_0xc85b9,function(_0x283716){var _0x4cd26e=_0x283716['get']({'plain':!![]});_0x4cd26e['Agents']['forEach'](function(_0x19be6b){_0x19be6b[_0x7721('0x5e')]=_[_0x7721('0x21')](_0x2b0968,{'id':_0x4cd26e['id']})['penalty'];});return _0x4cd26e['Agents'];});return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0x509f2d[_0x7721('0x31')]['id']}})[_0x7721('0x16')](function(_0x14711c){return db[_0x7721('0x5f')][_0x7721('0x60')](function(_0x435455){return _0x14711c[_0x7721('0x61')](_0x186ada,{'transaction':_0x435455})['then'](function(){return BPromise['each'](_0x2b0968,function(_0x415445){return db['TeamVoiceQueue'][_0x7721('0x62')]({'TeamId':_0x415445['id'],'VoiceQueueId':_0x509f2d['params']['id'],'penalty':_0x415445[_0x7721('0x5e')]},{'transaction':_0x435455});});})['then'](function(){return BPromise[_0x7721('0x63')](_0x58be49,function(_0x14341e){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x14341e['id'],'VoiceQueueId':_0x509f2d[_0x7721('0x31')]['id']},'defaults':{'penalty':_0x14341e[_0x7721('0x5e')]},'transaction':_0x435455});});})[_0x7721('0x16')](function(){return BPromise[_0x7721('0x63')](_[_0x7721('0x1c')](_0x58be49,{'online':!![]}),function(_0x5e69d7){return db[_0x7721('0x64')][_0x7721('0x62')]({'membername':_0x5e69d7[_0x7721('0x22')],'UserId':_0x5e69d7['id'],'queue_name':_0x14711c['name'],'VoiceQueueId':_0x14711c['id'],'interface':_[_0x7721('0x65')](_0x5e69d7[_0x7721('0x66')])?util[_0x7721('0x67')](_0x7721('0x68'),_0x5e69d7[_0x7721('0x22')]):_0x5e69d7[_0x7721('0x66')],'paused':_0x5e69d7[_0x7721('0x69')]||![],'penalty':_0x5e69d7[_0x7721('0x5e')]},{'transaction':_0x435455});});})[_0x7721('0x16')](function(){_0x58be49[_0x7721('0x6a')](function(_0x2a2d8a){socket['emit'](_0x7721('0x6b'),{'UserId':_0x2a2d8a['id'],'VoiceQueueId':_0x14711c['id']});});});});});}})[_0x7721('0x16')](respondWithStatusCode(_0x4d2644,null))[_0x7721('0x30')](handleError(_0x4d2644,null));};exports[_0x7721('0x6c')]=function(_0xcb843e,_0x35d3f1){return db[_0x7721('0x58')]['findAll']({'where':{'id':_0xcb843e[_0x7721('0x2d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7721('0x5b')],'as':_0x7721('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x7721('0x16')](handleEntityNotFound(_0x35d3f1,null))[_0x7721('0x16')](function(_0x37b607){var _0x3d6d41=_['map'](_0x37b607,'id');var _0xbce1b=[];var _0x4d3ad1=[];var _0x4028fa=squel[_0x7721('0x6e')]();_0x4028fa[_0x7721('0x6f')]('tq.TeamId')[_0x7721('0x70')](_0x7721('0x71'),'tq')[_0x7721('0x72')](_0x7721('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7721('0x2b')](_0x7721('0x74'),_0xcb843e[_0x7721('0x31')]['id']);for(var _0x980f26=0x0;_0x980f26<_0x37b607['length'];_0x980f26+=0x1){let _0x40dd5e=_0x37b607[_0x980f26];for(var _0x3d143a=0x0;_0x3d143a<_0x40dd5e[_0x7721('0x6d')][_0x7721('0x39')];_0x3d143a+=0x1){let _0x53fa66=_0x40dd5e[_0x7721('0x6d')][_0x3d143a];var _0x1a95e6=_0x4028fa[_0x7721('0x75')]();_0x1a95e6[_0x7721('0x2b')](_0x7721('0x76'),_0x53fa66['id']);_0x4d3ad1[_0x7721('0x77')](db[_0x7721('0x5f')][_0x7721('0x2d')](_0x1a95e6[_0x7721('0x78')](),{'type':db['sequelize'][_0x7721('0x79')][_0x7721('0x7a')]})[_0x7721('0x16')](function(_0x1c246b){if(_0x1c246b[_0x7721('0x39')]===0x1){return _0x53fa66['id'];}else{var _0x31447d=_[_0x7721('0x7b')](_[_0x7721('0x1e')](_0x1c246b,_0x7721('0x7c')),function(_0x14fd97){return _[_0x7721('0x7d')](_0x3d6d41,_0x14fd97);});if(_0x31447d){return _0x53fa66['id'];}}}));}}return BPromise[_0x7721('0x7e')](_0x4d3ad1)[_0x7721('0x16')](function(_0x18ccdf){_0xbce1b=_(_0xbce1b)[_0x7721('0x7f')](_0x18ccdf)[_0x7721('0x80')]()['value']();return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0xcb843e[_0x7721('0x31')]['id']}})[_0x7721('0x16')](function(_0x157310){return db[_0x7721('0x5f')][_0x7721('0x60')](function(_0xdd0e7a){return _0x157310[_0x7721('0x6c')](_0xcb843e[_0x7721('0x2d')][_0x7721('0x81')],{'transaction':_0xdd0e7a})[_0x7721('0x16')](function(){if(!_['isEmpty'](_0xbce1b)){return _0x157310['removeAgents'](_0xbce1b,{'transaction':_0xdd0e7a})[_0x7721('0x16')](function(){return db[_0x7721('0x64')][_0x7721('0x17')]({'where':{'VoiceQueueId':_0xcb843e[_0x7721('0x31')]['id'],'UserId':_0xbce1b},'transaction':_0xdd0e7a});});}})[_0x7721('0x16')](function(){_0xbce1b['forEach'](function(_0x1ebc86){socket[_0x7721('0x82')](_0x7721('0x83'),{'UserId':_0x1ebc86,'VoiceQueueId':_0x157310['id']});});});});});});})[_0x7721('0x16')](respondWithStatusCode(_0x35d3f1,null))[_0x7721('0x30')](handleError(_0x35d3f1,null));};exports[_0x7721('0x84')]=function(_0xc0f448,_0x3dc688){var _0x298aca,_0x45b430;return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0xc0f448['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x3dc688,null))[_0x7721('0x16')](function(_0x16e0cd){if(_0x16e0cd){_0x45b430=_0x16e0cd;return _0x16e0cd['addAgents'](_0xc0f448[_0x7721('0x46')][_0x7721('0x81')],_[_0x7721('0x43')](_0xc0f448['body'],[_0x7721('0x81'),'id'])||{})['spread'](function(_0x5f3dd2){for(var _0xa73193=0x0;_0xa73193<_0xc0f448[_0x7721('0x46')][_0x7721('0x81')][_0x7721('0x39')];_0xa73193+=0x1){socket['emit'](_0x7721('0x6b'),{'UserId':Number(_0xc0f448[_0x7721('0x46')][_0x7721('0x81')][_0xa73193]),'VoiceQueueId':Number(_0xc0f448[_0x7721('0x31')]['id'])});}return _0x5f3dd2;});}})[_0x7721('0x16')](function(_0x5b12c7){_0x298aca=_0x5b12c7||[];if(_0x45b430){return db[_0x7721('0x5b')][_0x7721('0x2e')]({'where':{'id':_0xc0f448[_0x7721('0x46')][_0x7721('0x81')]},'attributes':['id',_0x7721('0x22'),_0x7721('0x5c'),_0x7721('0x69'),_0x7721('0x66')],'raw':!![]});}})[_0x7721('0x16')](function(_0x385c86){if(!_[_0x7721('0x85')](_0x385c86)){var _0xc18d1a=[];for(var _0x9575b3=0x0;_0x9575b3<_0x385c86[_0x7721('0x39')];_0x9575b3++){if(_0x385c86[_0x9575b3][_0x7721('0x5c')]){_0xc18d1a[_0x7721('0x77')](db[_0x7721('0x64')][_0x7721('0x62')]({'membername':_0x385c86[_0x9575b3][_0x7721('0x22')],'UserId':_0x385c86[_0x9575b3]['id'],'queue_name':_0x45b430[_0x7721('0x22')],'VoiceQueueId':_0x45b430['id'],'interface':_[_0x7721('0x65')](_0x385c86[_0x9575b3][_0x7721('0x66')])?util['format'](_0x7721('0x68'),_0x385c86[_0x9575b3]['name']):_0x385c86[_0x9575b3][_0x7721('0x66')],'paused':_0x385c86[_0x9575b3][_0x7721('0x69')]||![],'penalty':_0xc0f448[_0x7721('0x46')][_0x7721('0x5e')]||0x0}));}}return BPromise['all'](_0xc18d1a);}})[_0x7721('0x16')](function(){return _0x298aca;})[_0x7721('0x16')](respondWithResult(_0x3dc688,null))['catch'](handleError(_0x3dc688,null));};exports[_0x7721('0x86')]=function(_0x3a8f89,_0x52aae1){return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0x3a8f89[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x52aae1,null))[_0x7721('0x16')](function(_0x55c43c){if(_0x55c43c){return _0x55c43c['removeAgents'](_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')])['then'](function(){if(_['isArray'](_0x3a8f89[_0x7721('0x2d')]['ids'])){for(var _0x1c23e3=0x0;_0x1c23e3<_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')]['length'];_0x1c23e3+=0x1){socket[_0x7721('0x82')](_0x7721('0x83'),{'UserId':Number(_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')][_0x1c23e3]),'VoiceQueueId':Number(_0x3a8f89[_0x7721('0x31')]['id'])});}}else{socket[_0x7721('0x82')](_0x7721('0x83'),{'UserId':Number(_0x3a8f89[_0x7721('0x2d')]['ids']),'VoiceQueueId':Number(_0x3a8f89[_0x7721('0x31')]['id'])});}});}})[_0x7721('0x16')](function(_0x3c3c7e){return db[_0x7721('0x64')][_0x7721('0x17')]({'where':{'VoiceQueueId':_0x3a8f89['params']['id'],'UserId':_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')]}})[_0x7721('0x16')](function(){return _0x3c3c7e;});})[_0x7721('0x16')](respondWithStatusCode(_0x52aae1,null))[_0x7721('0x30')](handleError(_0x52aae1,null));};exports[_0x7721('0x87')]=function(_0x16b110,_0x366323){var _0x14b49e={};var _0x12f568={};var _0x259640;var _0x4a0e50;return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x16b110[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x366323,null))[_0x7721('0x16')](function(_0x25e4db){if(_0x25e4db){_0x259640=_0x25e4db;_0x12f568[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x5b')][_0x7721('0x34')]);_0x12f568[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x16b110[_0x7721('0x2d')]);_0x12f568[_0x7721('0x35')]=_[_0x7721('0x37')](_0x12f568['model'],_0x12f568[_0x7721('0x2d')]);_0x14b49e['attributes']=_['intersection'](_0x12f568[_0x7721('0x32')],qs['fields'](_0x16b110[_0x7721('0x2d')][_0x7721('0x38')]));_0x14b49e[_0x7721('0x36')]=_0x14b49e[_0x7721('0x36')]['length']?_0x14b49e['attributes']:_0x12f568[_0x7721('0x32')];_0x14b49e[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x16b110[_0x7721('0x2d')][_0x7721('0x51')]);_0x14b49e[_0x7721('0x2b')]=qs[_0x7721('0x35')](_['pick'](_0x16b110[_0x7721('0x2d')],_0x12f568['filters']));if(_0x16b110[_0x7721('0x2d')][_0x7721('0x1c')]){_0x14b49e[_0x7721('0x2b')]=_[_0x7721('0x47')](_0x14b49e[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x14b49e[_0x7721('0x36')],function(_0x184f1b){var _0xa257a0={};_0xa257a0[_0x184f1b]={'$like':'%'+_0x16b110[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0xa257a0;})});}_0x14b49e=_[_0x7721('0x47')]({},_0x14b49e,_0x16b110[_0x7721('0x3a')]);return _0x259640[_0x7721('0x87')](_0x14b49e);}})[_0x7721('0x16')](function(_0x1ee0c1){if(_0x1ee0c1){_0x4a0e50=_0x1ee0c1[_0x7721('0x39')];if(!_0x16b110[_0x7721('0x2d')]['hasOwnProperty'](_0x7721('0x4e'))){_0x14b49e[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x16b110[_0x7721('0x2d')][_0x7721('0x4f')]);_0x14b49e[_0x7721('0x11')]=qs['offset'](_0x16b110[_0x7721('0x2d')][_0x7721('0x11')]);}return _0x259640[_0x7721('0x87')](_0x14b49e);}})['then'](function(_0x1bdadb){if(_0x1bdadb){return _0x1bdadb?{'count':_0x4a0e50,'rows':_0x1bdadb}:null;}})['then'](respondWithResult(_0x366323,null))[_0x7721('0x30')](handleError(_0x366323,null));};exports['getMembers']=function(_0xe5e55f,_0x17ce3b){var _0xbc0a80={};var _0xf2dc08={};var _0x5b493a;var _0x45024c;return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0xe5e55f[_0x7721('0x31')]['id']}})['then'](handleEntityNotFound(_0x17ce3b,null))['then'](function(_0x12b255){if(_0x12b255){_0x5b493a=_0x12b255;_0xf2dc08['model']=_[_0x7721('0x33')](db[_0x7721('0x64')][_0x7721('0x34')]);_0xf2dc08[_0x7721('0x2d')]=_[_0x7721('0x33')](_0xe5e55f[_0x7721('0x2d')]);_0xf2dc08[_0x7721('0x35')]=_[_0x7721('0x37')](_0xf2dc08[_0x7721('0x32')],_0xf2dc08['query']);_0xbc0a80[_0x7721('0x36')]=_[_0x7721('0x37')](_0xf2dc08[_0x7721('0x32')],qs['fields'](_0xe5e55f['query'][_0x7721('0x38')]));_0xbc0a80[_0x7721('0x36')]=_0xbc0a80[_0x7721('0x36')][_0x7721('0x39')]?_0xbc0a80[_0x7721('0x36')]:_0xf2dc08[_0x7721('0x32')];_0xbc0a80['order']=qs[_0x7721('0x51')](_0xe5e55f[_0x7721('0x2d')]['sort']);_0xbc0a80[_0x7721('0x2b')]=qs['filters'](_[_0x7721('0x52')](_0xe5e55f['query'],_0xf2dc08[_0x7721('0x35')]));if(_0xe5e55f['query']['filter']){_0xbc0a80['where']=_[_0x7721('0x47')](_0xbc0a80['where'],{'$or':_['map'](_0xbc0a80['attributes'],function(_0x52a1ee){var _0x41c991={};_0x41c991[_0x52a1ee]={'$like':'%'+_0xe5e55f[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x41c991;})});}_0xbc0a80=_[_0x7721('0x47')]({},_0xbc0a80,_0xe5e55f[_0x7721('0x3a')]);return _0x5b493a['getMembers'](_0xbc0a80);}})[_0x7721('0x16')](function(_0x22d4e0){if(_0x22d4e0){_0x45024c=_0x22d4e0['length'];if(!_0xe5e55f[_0x7721('0x2d')][_0x7721('0x4d')](_0x7721('0x4e'))){_0xbc0a80[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0xe5e55f[_0x7721('0x2d')][_0x7721('0x4f')]);_0xbc0a80[_0x7721('0x11')]=qs['offset'](_0xe5e55f[_0x7721('0x2d')][_0x7721('0x11')]);}return _0x5b493a[_0x7721('0x88')](_0xbc0a80);}})[_0x7721('0x16')](function(_0x2fbb00){return _0x2fbb00?{'count':_0x45024c,'rows':_0x2fbb00}:null;})[_0x7721('0x16')](respondWithResult(_0x17ce3b,null))[_0x7721('0x30')](handleError(_0x17ce3b,null));};exports[_0x7721('0x89')]=function(_0x561235,_0x12ad4d){var _0x226081={};var _0x17c3e7={};var _0x250cbf;var _0x255b22;return db['VoiceQueue'][_0x7721('0x4b')]({'where':{'id':_0x561235[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x12ad4d,null))[_0x7721('0x16')](function(_0x396880){if(_0x396880){_0x250cbf=_0x396880;_0x17c3e7['model']=_[_0x7721('0x33')](db[_0x7721('0x8a')]['rawAttributes']);_0x17c3e7[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x561235[_0x7721('0x2d')]);_0x17c3e7[_0x7721('0x35')]=_[_0x7721('0x37')](_0x17c3e7['model'],_0x17c3e7[_0x7721('0x2d')]);_0x226081[_0x7721('0x36')]=_['intersection'](_0x17c3e7['model'],qs[_0x7721('0x38')](_0x561235[_0x7721('0x2d')][_0x7721('0x38')]));_0x226081['attributes']=_0x226081[_0x7721('0x36')]['length']?_0x226081['attributes']:_0x17c3e7[_0x7721('0x32')];_0x226081[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x561235[_0x7721('0x2d')][_0x7721('0x51')]);_0x226081['where']=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x561235[_0x7721('0x2d')],_0x17c3e7[_0x7721('0x35')]));if(_0x561235[_0x7721('0x2d')]['filter']){_0x226081[_0x7721('0x2b')]=_['merge'](_0x226081[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x226081[_0x7721('0x36')],function(_0x5209ff){var _0x2583c1={};_0x2583c1[_0x5209ff]={'$like':'%'+_0x561235['query'][_0x7721('0x1c')]+'%'};return _0x2583c1;})});}_0x226081=_[_0x7721('0x47')]({},_0x226081,_0x561235[_0x7721('0x3a')]);return _0x250cbf[_0x7721('0x89')](_0x226081);}})[_0x7721('0x16')](function(_0x3235d8){if(_0x3235d8){_0x255b22=_0x3235d8[_0x7721('0x39')];if(!_0x561235[_0x7721('0x2d')][_0x7721('0x4d')](_0x7721('0x4e'))){_0x226081['limit']=qs[_0x7721('0x4f')](_0x561235[_0x7721('0x2d')][_0x7721('0x4f')]);_0x226081[_0x7721('0x11')]=qs[_0x7721('0x11')](_0x561235['query'][_0x7721('0x11')]);}return _0x250cbf[_0x7721('0x89')](_0x226081);}})[_0x7721('0x16')](function(_0x501e31){if(_0x501e31){return _0x501e31?{'count':_0x255b22,'rows':_0x501e31}:null;}})[_0x7721('0x16')](respondWithResult(_0x12ad4d,null))[_0x7721('0x30')](handleError(_0x12ad4d,null));};exports[_0x7721('0x8b')]=function(_0xe325e1,_0x1aa1fc){var _0x560be6=moment()[_0x7721('0x67')](_0x7721('0x8c'));var _0x1bd066,_0xaa15c5;return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0xe325e1[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x1aa1fc,null))[_0x7721('0x16')](function(_0x42ffff){if(_0x42ffff){_0xaa15c5=_0x42ffff;return _0x42ffff[_0x7721('0x8b')](_0xe325e1[_0x7721('0x46')][_0x7721('0x81')],_[_0x7721('0x43')](_0xe325e1[_0x7721('0x46')],[_0x7721('0x81'),'id'])||{});}return null;})[_0x7721('0x8d')](function(_0x3f19f5){var _0x28f11a;_0x1bd066=_0x3f19f5||[];var _0x3bc8f3=[];if(_0x3f19f5){for(var _0x26cea3=0x0;_0x26cea3<_0x3f19f5[_0x7721('0x39')];_0x26cea3+=0x1){var _0x57e928=_0x3f19f5[_0x26cea3]['get']({'plain':!![]});_0xaa15c5[_0x7721('0x8e')]=_0xe325e1[_0x7721('0x46')][_0x7721('0x8e')]?_0xe325e1[_0x7721('0x46')]['dialCheckDuplicateType']:_0xaa15c5[_0x7721('0x8e')];switch(_0xaa15c5['dialCheckDuplicateType']){case _0x7721('0x8f'):_0x28f11a=squel[_0x7721('0x90')]()[_0x7721('0x91')]('cm_hopper')['fromQuery'](['phone',_0x7721('0x92'),_0x7721('0x93'),_0x7721('0x94'),_0x7721('0x53'),_0x7721('0x44'),'updatedAt'],squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x95'),'phone')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x92'))[_0x7721('0x6f')]('id','ContactId')[_0x7721('0x6f')](_0x57e928[_0x7721('0x96')][_0x7721('0x78')](),'ListId')[_0x7721('0x6f')](_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27','createdAt')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27','updatedAt')['from'](_0x7721('0x97'))[_0x7721('0x2b')](_0x7721('0x98'))[_0x7721('0x2b')](_0x7721('0x99'),_0x57e928['CmListId'][_0x7721('0x78')]())[_0x7721('0x2b')](_0x7721('0x9a'))[_0x7721('0x2b')](_0x7721('0x9b'),squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x9c'))[_0x7721('0x70')](_0x7721('0x9d'))['where'](_0x7721('0x74'),_0xe325e1[_0x7721('0x31')]['id']['toString']()))[_0x7721('0x2b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7721('0x6e')]()['field'](_0x7721('0x9e'))['from']('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0xe325e1[_0x7721('0x31')]['id']['toString']())))[_0x7721('0x78')]();break;case _0x7721('0x9f'):_0x28f11a=squel[_0x7721('0x90')]()[_0x7721('0x91')](_0x7721('0xa0'))[_0x7721('0xa1')](['phone',_0x7721('0x92'),_0x7721('0x93'),'ListId','VoiceQueueId',_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()['field'](_0x7721('0x95'),_0x7721('0x95'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x92'))[_0x7721('0x6f')]('id','ContactId')[_0x7721('0x6f')](_0x57e928[_0x7721('0x96')][_0x7721('0x78')](),_0x7721('0x94'))[_0x7721('0x6f')](_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))['field']('\x27'+_0x560be6+'\x27','createdAt')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x45'))['from'](_0x7721('0x97'))['where']('deletedAt\x20IS\x20NULL')[_0x7721('0x2b')]('ListId\x20=\x20?',_0x57e928[_0x7721('0x96')]['toString']())[_0x7721('0x2b')](_0x7721('0x9a'))['where'](_0x7721('0x9b'),squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x9e'))[_0x7721('0x70')]('cm_hopper')[_0x7721('0x2b')](_0x7721('0x74'),_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')]())))[_0x7721('0x78')]();break;default:_0x28f11a=squel[_0x7721('0x90')]()[_0x7721('0x91')]('cm_hopper')[_0x7721('0xa1')]([_0x7721('0x95'),_0x7721('0x92'),_0x7721('0x93'),_0x7721('0x94'),'VoiceQueueId',_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x95'),_0x7721('0x95'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x92'))[_0x7721('0x6f')]('id',_0x7721('0x93'))['field'](_0x57e928['CmListId'][_0x7721('0x78')](),'ListId')['field'](_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x44'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x45'))[_0x7721('0x70')](_0x7721('0x97'))[_0x7721('0x2b')](_0x7721('0x98'))[_0x7721('0x2b')](_0x7721('0x99'),_0x57e928[_0x7721('0x96')][_0x7721('0x78')]())[_0x7721('0x2b')]('phone\x20IS\x20NOT\x20NULL'))[_0x7721('0x78')]();}_0x3bc8f3[_0x7721('0x77')](db[_0x7721('0x5f')][_0x7721('0x2d')](_0x28f11a));}return BPromise[_0x7721('0x7e')](_0x3bc8f3);}})[_0x7721('0x16')](function(){var _0x5f53b3=[];var _0x8fc283=squel[_0x7721('0x90')]()['into'](_0x7721('0xa2'))['fromQuery']([_0x7721('0xa3'),_0x7721('0x95'),_0x7721('0xa4'),_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0xa5'))[_0x7721('0x6f')](_0x7721('0xa6'))[_0x7721('0x6f')](_0x7721('0xa7'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27','createdAt')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x45'))[_0x7721('0x70')](_0x7721('0xa8'),'ci')[_0x7721('0x72')](_0x7721('0xa0'),'h',_0x7721('0xa9'))['where'](_0x7721('0xaa'),_0x560be6)[_0x7721('0x2b')](_0x7721('0xab'),'PHONE'))[_0x7721('0x78')]();_0x5f53b3['push'](db['sequelize'][_0x7721('0x2d')](_0x8fc283));return BPromise[_0x7721('0x7e')](_0x5f53b3);})['then'](function(){return _0x1bd066;})[_0x7721('0x16')](respondWithResult(_0x1aa1fc,null))[_0x7721('0x30')](handleError(_0x1aa1fc,null));};exports[_0x7721('0xac')]=function(_0xbc4f13,_0x50f4bd){return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0xbc4f13['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x50f4bd,null))[_0x7721('0x16')](function(_0x537831){if(_0x537831){return _0x537831[_0x7721('0xac')](_0xbc4f13[_0x7721('0x2d')][_0x7721('0x81')]);}})[_0x7721('0x16')](function(_0x49548e){if(_0x49548e){return db['CmHopper'][_0x7721('0x17')]({'where':{'ListId':_0xbc4f13[_0x7721('0x2d')][_0x7721('0x81')],'VoiceQueueId':_0xbc4f13[_0x7721('0x31')]['id']}})['then'](function(){return _0x49548e;});}})['then'](respondWithStatusCode(_0x50f4bd,null))[_0x7721('0x30')](handleError(_0x50f4bd,null));};exports[_0x7721('0xad')]=function(_0x4ea8ac,_0x226556){var _0x4bd023={};var _0x50de45={};var _0x51ac8f;var _0x27ed5e;return db['VoiceQueue'][_0x7721('0x4b')]({'where':{'id':_0x4ea8ac[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x226556,null))['then'](function(_0x4893c0){if(_0x4893c0){_0x51ac8f=_0x4893c0;_0x50de45[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x8a')][_0x7721('0x34')]);_0x50de45[_0x7721('0x2d')]=_['keys'](_0x4ea8ac[_0x7721('0x2d')]);_0x50de45[_0x7721('0x35')]=_[_0x7721('0x37')](_0x50de45[_0x7721('0x32')],_0x50de45[_0x7721('0x2d')]);_0x4bd023['attributes']=_[_0x7721('0x37')](_0x50de45[_0x7721('0x32')],qs[_0x7721('0x38')](_0x4ea8ac[_0x7721('0x2d')][_0x7721('0x38')]));_0x4bd023[_0x7721('0x36')]=_0x4bd023['attributes']['length']?_0x4bd023[_0x7721('0x36')]:_0x50de45[_0x7721('0x32')];_0x4bd023[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x4ea8ac[_0x7721('0x2d')][_0x7721('0x51')]);_0x4bd023[_0x7721('0x2b')]=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x4ea8ac[_0x7721('0x2d')],_0x50de45[_0x7721('0x35')]));if(_0x4ea8ac['query'][_0x7721('0x1c')]){_0x4bd023[_0x7721('0x2b')]=_['merge'](_0x4bd023[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x4bd023[_0x7721('0x36')],function(_0x400273){var _0x42c438={};_0x42c438[_0x400273]={'$like':'%'+_0x4ea8ac[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x42c438;})});}_0x4bd023=_[_0x7721('0x47')]({},_0x4bd023,_0x4ea8ac[_0x7721('0x3a')]);return _0x51ac8f[_0x7721('0xad')](_0x4bd023);}})[_0x7721('0x16')](function(_0x1192a8){if(_0x1192a8){_0x27ed5e=_0x1192a8[_0x7721('0x39')];if(!_0x4ea8ac['query'][_0x7721('0x4d')](_0x7721('0x4e'))){_0x4bd023['limit']=qs[_0x7721('0x4f')](_0x4ea8ac['query'][_0x7721('0x4f')]);_0x4bd023[_0x7721('0x11')]=qs['offset'](_0x4ea8ac['query'][_0x7721('0x11')]);}return _0x51ac8f['getBlackLists'](_0x4bd023);}})[_0x7721('0x16')](function(_0x2f7067){if(_0x2f7067){return _0x2f7067?{'count':_0x27ed5e,'rows':_0x2f7067}:null;}})[_0x7721('0x16')](respondWithResult(_0x226556,null))[_0x7721('0x30')](handleError(_0x226556,null));};exports[_0x7721('0xae')]=function(_0x376f37,_0x5b157e){var _0x4b84b9;return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0x376f37[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x5b157e,null))[_0x7721('0x16')](function(_0x39d43b){if(_0x39d43b){return _0x39d43b['addBlackLists'](_0x376f37['body'][_0x7721('0x81')],_[_0x7721('0x43')](_0x376f37[_0x7721('0x46')],[_0x7721('0x81'),'id'])||{});}return null;})[_0x7721('0x8d')](function(_0x430304){var _0x469b6b;_0x4b84b9=_0x430304||[];var _0x6766c6=[];if(_0x430304){for(var _0x37877c=0x0;_0x37877c<_0x430304['length'];_0x37877c+=0x1){var _0x259eaa=_0x430304[_0x37877c][_0x7721('0x18')]({'plain':!![]});_0x469b6b=squel['insert']()['into'](_0x7721('0xaf'))[_0x7721('0xa1')]([_0x7721('0x95'),'ContactId',_0x7721('0x94'),_0x7721('0x53'),_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()['field'](_0x7721('0x95'),'phone')[_0x7721('0x6f')]('id','ContactId')[_0x7721('0x6f')](_0x259eaa['CmListId'][_0x7721('0x78')](),_0x7721('0x94'))[_0x7721('0x6f')](_0x376f37[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))['field'](_0x7721('0xb0'),_0x7721('0x44'))[_0x7721('0x6f')](_0x7721('0xb0'),'updatedAt')[_0x7721('0x70')](_0x7721('0x97'))['where'](_0x7721('0x98'))[_0x7721('0x2b')](_0x7721('0x99'),_0x259eaa['CmListId']['toString']())[_0x7721('0x2b')]('phone\x20IS\x20NOT\x20NULL'))[_0x7721('0x78')]();_0x6766c6[_0x7721('0x77')](db['sequelize'][_0x7721('0x2d')](_0x469b6b));}return BPromise[_0x7721('0x7e')](_0x6766c6);}})['then'](function(){return _0x4b84b9;})[_0x7721('0x16')](respondWithResult(_0x5b157e,null))[_0x7721('0x30')](handleError(_0x5b157e,null));};exports[_0x7721('0xb1')]=function(_0x37da70,_0x54616a){return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0x37da70[_0x7721('0x31')]['id']}})['then'](handleEntityNotFound(_0x54616a,null))[_0x7721('0x16')](function(_0x174e79){if(_0x174e79){return _0x174e79['removeBlackLists'](_0x37da70[_0x7721('0x2d')]['ids']);}})[_0x7721('0x16')](function(_0x4c1b63){if(_0x4c1b63){return db[_0x7721('0x57')][_0x7721('0x17')]({'where':{'ListId':_0x37da70[_0x7721('0x2d')][_0x7721('0x81')],'VoiceQueueId':_0x37da70[_0x7721('0x31')]['id']}})['then'](function(){return _0x4c1b63;});}})[_0x7721('0x16')](respondWithStatusCode(_0x54616a,null))[_0x7721('0x30')](handleError(_0x54616a,null));}; \ No newline at end of file +var _0x7fbe=['send','VoiceQueue','rawAttributes','fieldName','key','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','inbound','outbound','update','getHoppers','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','CmHopperHistory','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','interface','format','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','emit','online','isNil','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','VoiceQueues','QueueCampaigns','filter','map','value','type','name','sendStatus','error'];(function(_0x338c8c,_0x19df14){var _0x371a9a=function(_0x4da3fe){while(--_0x4da3fe){_0x338c8c['push'](_0x338c8c['shift']());}};_0x371a9a(++_0x19df14);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x510cd9,_0x551300){_0x510cd9=_0x510cd9-0x0;var _0x2b1f61=_0x7fbe[_0x510cd9];return _0x2b1f61;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe7fb('0x0'));var _=require(_0xe7fb('0x1'));var squel=require(_0xe7fb('0x2'));var Redis=require(_0xe7fb('0x3'));var qs=require(_0xe7fb('0x4'));var logger=require(_0xe7fb('0x5'))(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var db=require(_0xe7fb('0x8'))['db'];config[_0xe7fb('0x9')]=_[_0xe7fb('0xa')](config[_0xe7fb('0x9')],{'host':_0xe7fb('0xb'),'port':0x18eb});var socket=require(_0xe7fb('0xc'))(new Redis(config['redis']));require(_0xe7fb('0xd'))[_0xe7fb('0xe')](socket);function respondWithStatusCode(_0x1d0741,_0x190a7a){_0x190a7a=_0x190a7a||0xcc;return function(_0x4ba197){if(_0x4ba197){return _0x1d0741['sendStatus'](_0x190a7a);}return _0x1d0741[_0xe7fb('0xf')](_0x190a7a)[_0xe7fb('0x10')]();};}function respondWithResult(_0x41a514,_0x348a73){_0x348a73=_0x348a73||0xc8;return function(_0x2a2223){if(_0x2a2223){return _0x41a514[_0xe7fb('0xf')](_0x348a73)[_0xe7fb('0x11')](_0x2a2223);}};}function respondWithFilteredResult(_0x3c07f3,_0x325035){return function(_0x2fe8ab){if(_0x2fe8ab){var _0x2437d4=typeof _0x325035[_0xe7fb('0x12')]===_0xe7fb('0x13')&&typeof _0x325035[_0xe7fb('0x14')]===_0xe7fb('0x13');var _0x598729=_0x2fe8ab[_0xe7fb('0x15')];var _0x2225e5=_0x2437d4?0x0:_0x325035['offset'];var _0x30015a=_0x2437d4?_0x2fe8ab[_0xe7fb('0x15')]:_0x325035['offset']+_0x325035[_0xe7fb('0x14')];var _0x559129;if(_0x30015a>=_0x598729){_0x30015a=_0x598729;_0x559129=0xc8;}else{_0x559129=0xce;}_0x3c07f3[_0xe7fb('0xf')](_0x559129);return _0x3c07f3[_0xe7fb('0x16')](_0xe7fb('0x17'),_0x2225e5+'-'+_0x30015a+'/'+_0x598729)[_0xe7fb('0x11')](_0x2fe8ab);}return null;};}function saveUpdates(_0x562262){return function(_0x892b0f){if(_0x892b0f){return _0x892b0f['update'](_0x562262)[_0xe7fb('0x18')](function(_0x546463){return _0x546463;});}return null;};}function removeEntity(_0x1e77fd){return function(_0x4708f7){if(_0x4708f7){return _0x4708f7[_0xe7fb('0x19')]()[_0xe7fb('0x18')](function(){var _0x5df1a1=_0x4708f7[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d1c87=[{'name':_0xe7fb('0x1b'),'value':'inbound','ignore':![]},{'name':_0xe7fb('0x1c'),'value':'outbound','ignore':![]}];var _0xa5af01=_(_0x5d1c87)[_0xe7fb('0x1d')]('ignore')[_0xe7fb('0x1e')](_0xe7fb('0x1f'))[_0xe7fb('0x1f')]();if(_['includes'](_0xa5af01,_0x5df1a1[_0xe7fb('0x20')])){return;}var _0x469ead=_['find'](_0x5d1c87,['value',_0x5df1a1['type']])[_0xe7fb('0x21')];return db['UserProfileResource']['destroy']({'where':{'type':_0x469ead,'resourceId':_0x5df1a1['id']}})[_0xe7fb('0x18')](function(){return _0x4708f7;});})[_0xe7fb('0x18')](function(){_0x1e77fd[_0xe7fb('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c930){return function(_0x2b69c4){if(!_0x2b69c4){_0x6c930[_0xe7fb('0x22')](0x194);}return _0x2b69c4;};}function handleError(_0x1ceed8,_0x392d75){_0x392d75=_0x392d75||0x1f4;return function(_0x16237a){logger[_0xe7fb('0x23')](_0x16237a['stack']);if(_0x16237a['name']){delete _0x16237a[_0xe7fb('0x21')];}_0x1ceed8[_0xe7fb('0xf')](_0x392d75)[_0xe7fb('0x24')](_0x16237a);};}exports['index']=function(_0xb1f2f4,_0x251807){var _0xd3fffe={};var _0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x1e')](db[_0xe7fb('0x25')][_0xe7fb('0x26')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x27')],'type':_0x4ce993[_0xe7fb('0x20')][_0xe7fb('0x28')]};});_0xd3fffe=qs['getOptions'](_0x219554,_0xb1f2f4);var _0x517d70={'where':_0xd3fffe[_0xe7fb('0x29')]};return db['VoiceQueue'][_0xe7fb('0x15')](_0x517d70)[_0xe7fb('0x18')](function(_0xe49053){_0x5f265f[_0xe7fb('0x15')]=_0xe49053;_0xd3fffe['include']=qs[_0xe7fb('0x2a')](_0xb1f2f4[_0xe7fb('0x2b')]);return db[_0xe7fb('0x25')][_0xe7fb('0x2c')](_0xd3fffe);})[_0xe7fb('0x18')](function(_0x480819){_0x5f265f[_0xe7fb('0x2d')]=_0x480819;return _0x5f265f;})[_0xe7fb('0x18')](respondWithFilteredResult(_0x251807,_0xd3fffe))[_0xe7fb('0x2e')](handleError(_0x251807,null));};exports[_0xe7fb('0x2f')]=function(_0x46f430,_0x25e925){var _0x1bc72d={'raw':![],'where':{'id':_0x46f430[_0xe7fb('0x30')]['id']}},_0x147eb1={};_0x147eb1['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')][_0xe7fb('0x26')]);_0x147eb1['query']=_[_0xe7fb('0x31')](_0x46f430[_0xe7fb('0x2b')]);_0x147eb1[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],_0x147eb1[_0xe7fb('0x2b')]);_0x1bc72d[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x1bc72d[_0xe7fb('0x35')]=_0x1bc72d[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x1bc72d[_0xe7fb('0x35')]:_0x147eb1[_0xe7fb('0x34')];if(_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x1bc72d['include']=[{'all':!![]}];}_0x1bc72d=_[_0xe7fb('0x39')]({},_0x1bc72d,_0x46f430[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x1bc72d)['then'](handleEntityNotFound(_0x25e925,null))[_0xe7fb('0x18')](respondWithResult(_0x25e925,null))[_0xe7fb('0x2e')](handleError(_0x25e925,null));};exports[_0xe7fb('0x3c')]=function(_0x413a13,_0x49fe9d){return db[_0xe7fb('0x25')][_0xe7fb('0x3c')](_0x413a13[_0xe7fb('0x3d')],{})[_0xe7fb('0x18')](function(_0x468d16){var _0xb729fc=_0x413a13['user'][_0xe7fb('0x1a')]({'plain':!![]});if(!_0xb729fc)throw new Error(_0xe7fb('0x3e'));if(_0xb729fc[_0xe7fb('0x3f')]==='user'){var _0x36a341=_0x468d16[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d42ac=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x900d67=_[_0xe7fb('0x3b')](_0x5d42ac,[_0xe7fb('0x1f'),_0x36a341['type']])[_0xe7fb('0x21')];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x900d67,'userProfileId':_0xb729fc[_0xe7fb('0x40')]},'raw':!![]})['then'](function(_0x108a16){if(_0x108a16&&_0x108a16[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x36a341['name'],'resourceId':_0x36a341['id'],'type':_0x108a16[_0xe7fb('0x21')],'sectionId':_0x108a16['id']},{})[_0xe7fb('0x18')](function(){return _0x468d16;});}else{return _0x468d16;}})[_0xe7fb('0x2e')](function(_0x56a84f){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x56a84f);throw _0x56a84f;});}return _0x468d16;})[_0xe7fb('0x18')](respondWithResult(_0x49fe9d,0xc9))[_0xe7fb('0x2e')](handleError(_0x49fe9d,null));};exports[_0xe7fb('0x44')]=function(_0x5a1ce1,_0x2eb999){var _0x4df4aa={'where':{'id':_0x5a1ce1[_0xe7fb('0x30')]['id']}},_0x2c72dd={};_0x2c72dd[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')]['rawAttributes']);_0x4df4aa[_0xe7fb('0x35')]=_['intersection'](_0x2c72dd['model'],qs[_0xe7fb('0x36')](_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4df4aa['attributes']=_0x4df4aa[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x4df4aa['attributes']:_0x2c72dd['model'];if(_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4df4aa[_0xe7fb('0x2a')]=[{'all':!![]}];}_0x4df4aa=_[_0xe7fb('0x39')]({},_0x4df4aa,_0x5a1ce1[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x4df4aa)[_0xe7fb('0x18')](handleEntityNotFound(_0x2eb999,null))['then'](function(_0x925a5e){if(_0x925a5e){var _0x5cc28f=_0x925a5e[_0xe7fb('0x1a')]({'plain':!![]});_0x5cc28f=qs[_0xe7fb('0x45')](_0x5cc28f,['id','createdAt',_0xe7fb('0x46')]);_0x5a1ce1['body']=_[_0xe7fb('0x45')](_0x5a1ce1['body'],['id',_0xe7fb('0x47'),'updatedAt']);return db[_0xe7fb('0x25')]['create'](_[_0xe7fb('0x39')](_0x5cc28f,_0x5a1ce1[_0xe7fb('0x3d')]),{'include':_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]?[{'all':!![]}]:undefined})[_0xe7fb('0x18')](function(_0x2f959d){var _0x2f4760=_0x5a1ce1['user']['get']({'plain':!![]});if(!_0x2f4760)throw new Error(_0xe7fb('0x3e'));if(_0x2f4760['role']==='user'){var _0x4c3eb7=_0x2f959d['get']({'plain':!![]});var _0x539252=[{'name':_0xe7fb('0x1b'),'value':_0xe7fb('0x48')},{'name':_0xe7fb('0x1c'),'value':_0xe7fb('0x49')}];var _0x59c92d=_[_0xe7fb('0x3b')](_0x539252,[_0xe7fb('0x1f'),_0x4c3eb7[_0xe7fb('0x20')]])['name'];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x59c92d,'userProfileId':_0x2f4760[_0xe7fb('0x40')]},'raw':!![]})[_0xe7fb('0x18')](function(_0x4f4ba3){if(_0x4f4ba3&&_0x4f4ba3[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x4c3eb7[_0xe7fb('0x21')],'resourceId':_0x4c3eb7['id'],'type':_0x4f4ba3['name'],'sectionId':_0x4f4ba3['id']},{})['then'](function(){return _0x2f959d;});}else{return _0x2f959d;}})[_0xe7fb('0x2e')](function(_0x3104c2){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x3104c2);throw _0x3104c2;});}return _0x2f959d;});}})[_0xe7fb('0x18')](respondWithResult(_0x2eb999,0xc9))['catch'](handleError(_0x2eb999,null));};exports[_0xe7fb('0x4a')]=function(_0x349a2a,_0x23755b){if(_0x349a2a['body']['id']){delete _0x349a2a['body']['id'];}return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x349a2a[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23755b,null))[_0xe7fb('0x18')](saveUpdates(_0x349a2a[_0xe7fb('0x3d')],null))['then'](respondWithResult(_0x23755b,null))[_0xe7fb('0x2e')](handleError(_0x23755b,null));};exports[_0xe7fb('0x19')]=function(_0x2cd4e5,_0x1aef59){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x2cd4e5['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1aef59,null))['then'](removeEntity(_0x1aef59,null))[_0xe7fb('0x2e')](handleError(_0x1aef59,null));};exports[_0xe7fb('0x4b')]=function(_0x116c7e,_0x1b24fd){var _0x5925e6={'raw':![],'where':{}};var _0x47ac92={};var _0x2789a4={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x116c7e[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1b24fd,null))['then'](function(_0x4096d4){if(_0x4096d4){_0x47ac92['model']=_[_0xe7fb('0x31')](db['CmHopper']['rawAttributes']);_0x47ac92[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x116c7e[_0xe7fb('0x2b')]);_0x47ac92['filters']=_[_0xe7fb('0x33')](_0x47ac92[_0xe7fb('0x34')],_0x47ac92[_0xe7fb('0x2b')]);_0x5925e6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x47ac92['model'],qs[_0xe7fb('0x36')](_0x116c7e[_0xe7fb('0x2b')]['fields']));_0x5925e6[_0xe7fb('0x35')]=_0x5925e6[_0xe7fb('0x35')]['length']?_0x5925e6[_0xe7fb('0x35')]:_0x47ac92['model'];if(!_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x5925e6['limit']=qs[_0xe7fb('0x14')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x5925e6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0x5925e6[_0xe7fb('0x4f')]=qs['sort'](_0x116c7e['query'][_0xe7fb('0x50')]);_0x5925e6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x116c7e['query'],_0x47ac92[_0xe7fb('0x32')]));_0x5925e6[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4096d4['id'];if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x5925e6[_0xe7fb('0x29')]=_[_0xe7fb('0x39')](_0x5925e6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x5925e6[_0xe7fb('0x35')],function(_0x1ff5e7){var _0xf423ab={};_0xf423ab[_0x1ff5e7]={'$like':'%'+_0x116c7e[_0xe7fb('0x2b')]['filter']+'%'};return _0xf423ab;})});}_0x5925e6=_['merge']({},_0x5925e6,_0x116c7e[_0xe7fb('0x3a')]);return db[_0xe7fb('0x52')][_0xe7fb('0x15')]({'where':_0x5925e6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x562493){_0x2789a4[_0xe7fb('0x15')]=_0x562493;if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x5925e6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x52')][_0xe7fb('0x2c')](_0x5925e6);})[_0xe7fb('0x18')](function(_0x1e6256){_0x2789a4[_0xe7fb('0x2d')]=_0x1e6256;return _0x2789a4;});}})['then'](respondWithFilteredResult(_0x1b24fd,_0x5925e6))[_0xe7fb('0x2e')](handleError(_0x1b24fd,null));};exports['getHopperHistories']=function(_0x279663,_0x2f13f2){var _0x2a2079={'raw':!![],'where':{}};var _0x31c159={};var _0x318d06={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x279663[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x2f13f2,null))[_0xe7fb('0x18')](function(_0x15d881){if(_0x15d881){_0x31c159[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x53')][_0xe7fb('0x26')]);_0x31c159[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x279663[_0xe7fb('0x2b')]);_0x31c159[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x31c159['model'],_0x31c159['query']);_0x2a2079['attributes']=_[_0xe7fb('0x33')](_0x31c159[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x279663[_0xe7fb('0x2b')]['fields']));_0x2a2079[_0xe7fb('0x35')]=_0x2a2079[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2a2079[_0xe7fb('0x35')]:_0x31c159['model'];if(!_0x279663[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2a2079[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2a2079['offset']=qs[_0xe7fb('0x12')](_0x279663['query'][_0xe7fb('0x12')]);}_0x2a2079['order']=qs[_0xe7fb('0x50')](_0x279663[_0xe7fb('0x2b')]['sort']);_0x2a2079[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x279663[_0xe7fb('0x2b')],_0x31c159['filters']));_0x2a2079[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x15d881['id'];if(_0x279663[_0xe7fb('0x2b')]['filter']){_0x2a2079[_0xe7fb('0x29')]=_['merge'](_0x2a2079['where'],{'$or':_['map'](_0x2a2079[_0xe7fb('0x35')],function(_0x27019a){var _0x4a8a65={};_0x4a8a65[_0x27019a]={'$like':'%'+_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4a8a65;})});}_0x2a2079=_[_0xe7fb('0x39')]({},_0x2a2079,_0x279663[_0xe7fb('0x3a')]);return db[_0xe7fb('0x53')][_0xe7fb('0x15')]({'where':_0x2a2079[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x42190e){_0x318d06[_0xe7fb('0x15')]=_0x42190e;if(_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x2a2079[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x53')][_0xe7fb('0x2c')](_0x2a2079);})[_0xe7fb('0x18')](function(_0x3c5bd9){_0x318d06[_0xe7fb('0x2d')]=_0x3c5bd9;return _0x318d06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x2f13f2,_0x2a2079))[_0xe7fb('0x2e')](handleError(_0x2f13f2,null));};exports['getHopperFinals']=function(_0x47568c,_0x185ac0){var _0xc3958f={'raw':!![],'where':{}};var _0x1b8fdb={};var _0x19fe06={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x47568c['params']['id']}})['then'](handleEntityNotFound(_0x185ac0,null))[_0xe7fb('0x18')](function(_0x4e1865){if(_0x4e1865){_0x1b8fdb[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['CmHopperFinal'][_0xe7fb('0x26')]);_0x1b8fdb[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x47568c[_0xe7fb('0x2b')]);_0x1b8fdb[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x1b8fdb['model'],_0x1b8fdb[_0xe7fb('0x2b')]);_0xc3958f[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x1b8fdb[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x47568c[_0xe7fb('0x2b')]['fields']));_0xc3958f['attributes']=_0xc3958f['attributes'][_0xe7fb('0x37')]?_0xc3958f[_0xe7fb('0x35')]:_0x1b8fdb[_0xe7fb('0x34')];if(!_0x47568c['query'][_0xe7fb('0x4d')]('nolimit')){_0xc3958f[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0xc3958f['offset']=qs[_0xe7fb('0x12')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0xc3958f[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0xc3958f[_0xe7fb('0x29')]=qs['filters'](_['pick'](_0x47568c[_0xe7fb('0x2b')],_0x1b8fdb['filters']));_0xc3958f[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4e1865['id'];if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0xc3958f['where']=_['merge'](_0xc3958f[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0xc3958f['attributes'],function(_0x21cb12){var _0x431d21={};_0x431d21[_0x21cb12]={'$like':'%'+_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x431d21;})});}_0xc3958f=_[_0xe7fb('0x39')]({},_0xc3958f,_0x47568c[_0xe7fb('0x3a')]);return db['CmHopperFinal'][_0xe7fb('0x15')]({'where':_0xc3958f[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x2607b9){_0x19fe06[_0xe7fb('0x15')]=_0x2607b9;if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0xc3958f[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x55')][_0xe7fb('0x2c')](_0xc3958f);})[_0xe7fb('0x18')](function(_0x3b1a90){_0x19fe06[_0xe7fb('0x2d')]=_0x3b1a90;return _0x19fe06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x185ac0,_0xc3958f))[_0xe7fb('0x2e')](handleError(_0x185ac0,null));};exports[_0xe7fb('0x56')]=function(_0x27c100,_0x19e86f){var _0x4b4cf6={'raw':!![],'where':{}};var _0x173d85={};var _0xa1368a={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x27c100['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x19e86f,null))[_0xe7fb('0x18')](function(_0x4ca09c){if(_0x4ca09c){_0x173d85[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x57')]['rawAttributes']);_0x173d85[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x27c100['query']);_0x173d85['filters']=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],_0x173d85[_0xe7fb('0x2b')]);_0x4b4cf6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],qs['fields'](_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4b4cf6[_0xe7fb('0x35')]=_0x4b4cf6['attributes'][_0xe7fb('0x37')]?_0x4b4cf6[_0xe7fb('0x35')]:_0x173d85[_0xe7fb('0x34')];if(!_0x27c100[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x4b4cf6[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x27c100['query'][_0xe7fb('0x14')]);_0x4b4cf6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x27c100[_0xe7fb('0x2b')]['offset']);}_0x4b4cf6[_0xe7fb('0x4f')]=qs['sort'](_0x27c100[_0xe7fb('0x2b')]['sort']);_0x4b4cf6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x27c100['query'],_0x173d85[_0xe7fb('0x32')]));_0x4b4cf6['where'][_0xe7fb('0x51')]=_0x4ca09c['id'];if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x4b4cf6[_0xe7fb('0x29')]=_['merge'](_0x4b4cf6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x4b4cf6[_0xe7fb('0x35')],function(_0x27a822){var _0x5505e5={};_0x5505e5[_0x27a822]={'$like':'%'+_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x5505e5;})});}_0x4b4cf6=_[_0xe7fb('0x39')]({},_0x4b4cf6,_0x27c100[_0xe7fb('0x3a')]);return db[_0xe7fb('0x57')]['count']({'where':_0x4b4cf6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x54233){_0xa1368a[_0xe7fb('0x15')]=_0x54233;if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4b4cf6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x57')][_0xe7fb('0x2c')](_0x4b4cf6);})['then'](function(_0x795e32){_0xa1368a[_0xe7fb('0x2d')]=_0x795e32;return _0xa1368a;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x19e86f,_0x4b4cf6))[_0xe7fb('0x2e')](handleError(_0x19e86f,null));};exports[_0xe7fb('0x58')]=function(_0x16f2b1,_0x3a8154){var _0x51335c={};var _0x4f4772={};var _0x4ef7b4;var _0x1bcee7;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x16f2b1['params']['id']}})['then'](handleEntityNotFound(_0x3a8154,null))[_0xe7fb('0x18')](function(_0x5bd869){if(_0x5bd869){_0x4ef7b4=_0x5bd869;_0x4f4772[_0xe7fb('0x34')]=_['keys'](db[_0xe7fb('0x59')][_0xe7fb('0x26')]);_0x4f4772[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x16f2b1[_0xe7fb('0x2b')]);_0x4f4772[_0xe7fb('0x32')]=_['intersection'](_0x4f4772[_0xe7fb('0x34')],_0x4f4772[_0xe7fb('0x2b')]);_0x51335c[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x4f4772[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x16f2b1[_0xe7fb('0x2b')]['fields']));_0x51335c[_0xe7fb('0x35')]=_0x51335c[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x51335c[_0xe7fb('0x35')]:_0x4f4772['model'];_0x51335c[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x51335c[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x16f2b1['query'],_0x4f4772['filters']));if(_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x51335c['where']=_[_0xe7fb('0x39')](_0x51335c['where'],{'$or':_[_0xe7fb('0x1e')](_0x51335c[_0xe7fb('0x35')],function(_0x220d72){var _0x5ea91d={};_0x5ea91d[_0x220d72]={'$like':'%'+_0x16f2b1['query'][_0xe7fb('0x1d')]+'%'};return _0x5ea91d;})});}_0x51335c=_['merge']({},_0x51335c,_0x16f2b1['options']);return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x3b073e){if(_0x3b073e){_0x1bcee7=_0x3b073e[_0xe7fb('0x37')];if(!_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x51335c[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x51335c[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x249d6f){if(_0x249d6f){return _0x249d6f?{'count':_0x1bcee7,'rows':_0x249d6f}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x3a8154,null))['catch'](handleError(_0x3a8154,null));};exports[_0xe7fb('0x5a')]=function(_0x19ebe2,_0x3406ed){var _0x1631cc=_0x19ebe2['body'][_0xe7fb('0x5b')];var _0x21ee89=_[_0xe7fb('0x1e')](_0x1631cc,'id');return db[_0xe7fb('0x59')][_0xe7fb('0x2c')]({'where':{'id':_0x21ee89},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe7fb('0x21'),'online','voicePause','interface'],'raw':!![]}]})[_0xe7fb('0x18')](function(_0x5a97c8){if(_0x5a97c8){var _0x503ae2=_['flatMap'](_0x5a97c8,function(_0x2ccf71){var _0x35be16=_0x2ccf71[_0xe7fb('0x1a')]({'plain':!![]});_0x35be16[_0xe7fb('0x5c')][_0xe7fb('0x5d')](function(_0x1db971){_0x1db971['penalty']=_['find'](_0x1631cc,{'id':_0x35be16['id']})[_0xe7fb('0x5e')];});return _0x35be16['Agents'];});return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x19ebe2[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x3891ed){return db[_0xe7fb('0x5f')]['transaction'](function(_0x4aa499){return _0x3891ed[_0xe7fb('0x5a')](_0x21ee89,{'transaction':_0x4aa499})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x1631cc,function(_0x7a7a6b){return db[_0xe7fb('0x61')][_0xe7fb('0x62')]({'TeamId':_0x7a7a6b['id'],'VoiceQueueId':_0x19ebe2['params']['id'],'penalty':_0x7a7a6b[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x503ae2,function(_0x33d638){return db[_0xe7fb('0x63')]['findOrCreate']({'where':{'UserId':_0x33d638['id'],'VoiceQueueId':_0x19ebe2[_0xe7fb('0x30')]['id']},'defaults':{'penalty':_0x33d638[_0xe7fb('0x5e')]},'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise['each'](_['filter'](_0x503ae2,{'online':!![]}),function(_0x5d30ef){return db[_0xe7fb('0x64')]['upsert']({'membername':_0x5d30ef['name'],'UserId':_0x5d30ef['id'],'queue_name':_0x3891ed[_0xe7fb('0x21')],'VoiceQueueId':_0x3891ed['id'],'interface':_['isNil'](_0x5d30ef[_0xe7fb('0x65')])?util[_0xe7fb('0x66')](_0xe7fb('0x67'),_0x5d30ef[_0xe7fb('0x21')]):_0x5d30ef[_0xe7fb('0x65')],'paused':_0x5d30ef[_0xe7fb('0x68')]||![],'penalty':_0x5d30ef[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})['then'](function(){_0x503ae2[_0xe7fb('0x5d')](function(_0x16e9d4){socket['emit'](_0xe7fb('0x69'),{'UserId':_0x16e9d4['id'],'VoiceQueueId':_0x3891ed['id']});});});});});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x3406ed,null))[_0xe7fb('0x2e')](handleError(_0x3406ed,null));};exports[_0xe7fb('0x6a')]=function(_0x366acb,_0x4d2c92){return db['Team'][_0xe7fb('0x2c')]({'where':{'id':_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xe7fb('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe7fb('0x18')](handleEntityNotFound(_0x4d2c92,null))[_0xe7fb('0x18')](function(_0x2e276c){var _0x4efcdc=_[_0xe7fb('0x1e')](_0x2e276c,'id');var _0x146fc9=[];var _0x470718=[];var _0x55048c=squel[_0xe7fb('0x6d')]();_0x55048c[_0xe7fb('0x6e')]('tq.TeamId')[_0xe7fb('0x6f')](_0xe7fb('0x70'),'tq')['join'](_0xe7fb('0x71'),'ut',_0xe7fb('0x72'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x366acb[_0xe7fb('0x30')]['id']);for(var _0x5d9b58=0x0;_0x5d9b58<_0x2e276c['length'];_0x5d9b58+=0x1){let _0x5986f1=_0x2e276c[_0x5d9b58];for(var _0x23ec12=0x0;_0x23ec12<_0x5986f1[_0xe7fb('0x5c')][_0xe7fb('0x37')];_0x23ec12+=0x1){let _0x36be03=_0x5986f1['Agents'][_0x23ec12];var _0x29de1e=_0x55048c[_0xe7fb('0x44')]();_0x29de1e['where']('ut.UserId\x20=\x20?',_0x36be03['id']);_0x470718[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x29de1e[_0xe7fb('0x75')](),{'type':db[_0xe7fb('0x5f')]['QueryTypes'][_0xe7fb('0x76')]})[_0xe7fb('0x18')](function(_0xe52155){if(_0xe52155['length']===0x1){return _0x36be03['id'];}else{var _0x20b1fc=_[_0xe7fb('0x77')](_['map'](_0xe52155,_0xe7fb('0x78')),function(_0x6ec6b6){return _[_0xe7fb('0x79')](_0x4efcdc,_0x6ec6b6);});if(_0x20b1fc){return _0x36be03['id'];}}}));}}return BPromise[_0xe7fb('0x7a')](_0x470718)['then'](function(_0x4ed327){_0x146fc9=_(_0x146fc9)[_0xe7fb('0x7b')](_0x4ed327)[_0xe7fb('0x7c')]()[_0xe7fb('0x1f')]();return db['VoiceQueue'][_0xe7fb('0x3b')]({'where':{'id':_0x366acb[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x49fb4b){return db[_0xe7fb('0x5f')][_0xe7fb('0x7d')](function(_0x362fe1){return _0x49fb4b['removeTeams'](_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')],{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){if(!_[_0xe7fb('0x7e')](_0x146fc9)){return _0x49fb4b[_0xe7fb('0x7f')](_0x146fc9,{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x366acb['params']['id'],'UserId':_0x146fc9},'transaction':_0x362fe1});});}})[_0xe7fb('0x18')](function(){_0x146fc9[_0xe7fb('0x5d')](function(_0x5dadac){socket['emit'](_0xe7fb('0x80'),{'UserId':_0x5dadac,'VoiceQueueId':_0x49fb4b['id']});});});});});});})[_0xe7fb('0x18')](respondWithStatusCode(_0x4d2c92,null))[_0xe7fb('0x2e')](handleError(_0x4d2c92,null));};exports[_0xe7fb('0x81')]=function(_0x4b58de,_0x4386ea){var _0x41c771,_0x489c9d;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4b58de[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x4386ea,null))[_0xe7fb('0x18')](function(_0x39fef6){if(_0x39fef6){_0x489c9d=_0x39fef6;return _0x39fef6[_0xe7fb('0x81')](_0x4b58de['body'][_0xe7fb('0x6b')],_['omit'](_0x4b58de[_0xe7fb('0x3d')],['ids','id'])||{})['spread'](function(_0x260067){for(var _0xed4af4=0x0;_0xed4af4<_0x4b58de[_0xe7fb('0x3d')][_0xe7fb('0x6b')][_0xe7fb('0x37')];_0xed4af4+=0x1){socket[_0xe7fb('0x82')](_0xe7fb('0x69'),{'UserId':Number(_0x4b58de['body'][_0xe7fb('0x6b')][_0xed4af4]),'VoiceQueueId':Number(_0x4b58de[_0xe7fb('0x30')]['id'])});}return _0x260067;});}})[_0xe7fb('0x18')](function(_0x19a7ec){_0x41c771=_0x19a7ec||[];if(_0x489c9d){return db[_0xe7fb('0x6c')][_0xe7fb('0x2c')]({'where':{'id':_0x4b58de[_0xe7fb('0x3d')]['ids']},'attributes':['id',_0xe7fb('0x21'),_0xe7fb('0x83'),_0xe7fb('0x68'),'interface'],'raw':!![]});}})[_0xe7fb('0x18')](function(_0x52c758){if(!_['isEmpty'](_0x52c758)){var _0x4930c6=[];for(var _0x1a3d44=0x0;_0x1a3d44<_0x52c758[_0xe7fb('0x37')];_0x1a3d44++){if(_0x52c758[_0x1a3d44]['online']){_0x4930c6[_0xe7fb('0x74')](db[_0xe7fb('0x64')]['upsert']({'membername':_0x52c758[_0x1a3d44]['name'],'UserId':_0x52c758[_0x1a3d44]['id'],'queue_name':_0x489c9d[_0xe7fb('0x21')],'VoiceQueueId':_0x489c9d['id'],'interface':_[_0xe7fb('0x84')](_0x52c758[_0x1a3d44][_0xe7fb('0x65')])?util['format'](_0xe7fb('0x67'),_0x52c758[_0x1a3d44][_0xe7fb('0x21')]):_0x52c758[_0x1a3d44]['interface'],'paused':_0x52c758[_0x1a3d44]['voicePause']||![],'penalty':_0x4b58de[_0xe7fb('0x3d')]['penalty']||0x0}));}}return BPromise['all'](_0x4930c6);}})['then'](function(){return _0x41c771;})[_0xe7fb('0x18')](respondWithResult(_0x4386ea,null))[_0xe7fb('0x2e')](handleError(_0x4386ea,null));};exports['removeAgents']=function(_0x35b5ad,_0x55c935){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x35b5ad[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x55c935,null))[_0xe7fb('0x18')](function(_0x4736bf){if(_0x4736bf){return _0x4736bf[_0xe7fb('0x7f')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])[_0xe7fb('0x18')](function(){if(_[_0xe7fb('0x85')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])){for(var _0x5744a8=0x0;_0x5744a8<_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')]['length'];_0x5744a8+=0x1){socket['emit'](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad['query'][_0xe7fb('0x6b')][_0x5744a8]),'VoiceQueueId':Number(_0x35b5ad[_0xe7fb('0x30')]['id'])});}}else{socket[_0xe7fb('0x82')](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad[_0xe7fb('0x2b')]['ids']),'VoiceQueueId':Number(_0x35b5ad['params']['id'])});}});}})[_0xe7fb('0x18')](function(_0x27b153){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x35b5ad[_0xe7fb('0x30')]['id'],'UserId':_0x35b5ad['query'][_0xe7fb('0x6b')]}})['then'](function(){return _0x27b153;});})[_0xe7fb('0x18')](respondWithStatusCode(_0x55c935,null))[_0xe7fb('0x2e')](handleError(_0x55c935,null));};exports['getAgents']=function(_0x5d0f05,_0x519e35){var _0x16ae95={};var _0xb1a3fa={};var _0x59e676;var _0x577895;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x5d0f05['params']['id']}})['then'](handleEntityNotFound(_0x519e35,null))[_0xe7fb('0x18')](function(_0xe1613c){if(_0xe1613c){_0x59e676=_0xe1613c;_0xb1a3fa[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['User'][_0xe7fb('0x26')]);_0xb1a3fa[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x5d0f05[_0xe7fb('0x2b')]);_0xb1a3fa[_0xe7fb('0x32')]=_['intersection'](_0xb1a3fa['model'],_0xb1a3fa[_0xe7fb('0x2b')]);_0x16ae95[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0xb1a3fa[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x5d0f05['query'][_0xe7fb('0x36')]));_0x16ae95['attributes']=_0x16ae95['attributes'][_0xe7fb('0x37')]?_0x16ae95[_0xe7fb('0x35')]:_0xb1a3fa[_0xe7fb('0x34')];_0x16ae95[_0xe7fb('0x4f')]=qs['sort'](_0x5d0f05[_0xe7fb('0x2b')]['sort']);_0x16ae95['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x5d0f05[_0xe7fb('0x2b')],_0xb1a3fa[_0xe7fb('0x32')]));if(_0x5d0f05[_0xe7fb('0x2b')]['filter']){_0x16ae95['where']=_[_0xe7fb('0x39')](_0x16ae95['where'],{'$or':_['map'](_0x16ae95[_0xe7fb('0x35')],function(_0x5763dd){var _0x4cab2f={};_0x4cab2f[_0x5763dd]={'$like':'%'+_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4cab2f;})});}_0x16ae95=_[_0xe7fb('0x39')]({},_0x16ae95,_0x5d0f05[_0xe7fb('0x3a')]);return _0x59e676[_0xe7fb('0x86')](_0x16ae95);}})['then'](function(_0xcf6d2){if(_0xcf6d2){_0x577895=_0xcf6d2['length'];if(!_0x5d0f05['query'][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x16ae95[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x16ae95[_0xe7fb('0x12')]=qs['offset'](_0x5d0f05['query'][_0xe7fb('0x12')]);}return _0x59e676['getAgents'](_0x16ae95);}})[_0xe7fb('0x18')](function(_0x51ff1e){if(_0x51ff1e){return _0x51ff1e?{'count':_0x577895,'rows':_0x51ff1e}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x519e35,null))['catch'](handleError(_0x519e35,null));};exports[_0xe7fb('0x87')]=function(_0x4407ee,_0x56869b){var _0x2139e3={};var _0x2e0e13={};var _0x23e1db;var _0x2a2fa6;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x4407ee[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x56869b,null))[_0xe7fb('0x18')](function(_0x454ef0){if(_0x454ef0){_0x23e1db=_0x454ef0;_0x2e0e13['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x64')][_0xe7fb('0x26')]);_0x2e0e13[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4407ee[_0xe7fb('0x2b')]);_0x2e0e13[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],_0x2e0e13[_0xe7fb('0x2b')]);_0x2139e3[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x4407ee[_0xe7fb('0x2b')]['fields']));_0x2139e3['attributes']=_0x2139e3[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2139e3[_0xe7fb('0x35')]:_0x2e0e13[_0xe7fb('0x34')];_0x2139e3[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x2139e3['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4407ee[_0xe7fb('0x2b')],_0x2e0e13[_0xe7fb('0x32')]));if(_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x2139e3['where']=_[_0xe7fb('0x39')](_0x2139e3[_0xe7fb('0x29')],{'$or':_['map'](_0x2139e3[_0xe7fb('0x35')],function(_0x5dde83){var _0x21d86e={};_0x21d86e[_0x5dde83]={'$like':'%'+_0x4407ee['query'][_0xe7fb('0x1d')]+'%'};return _0x21d86e;})});}_0x2139e3=_[_0xe7fb('0x39')]({},_0x2139e3,_0x4407ee['options']);return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})[_0xe7fb('0x18')](function(_0x5892cd){if(_0x5892cd){_0x2a2fa6=_0x5892cd['length'];if(!_0x4407ee['query']['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2139e3[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2139e3[_0xe7fb('0x12')]=qs['offset'](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})['then'](function(_0x3c56ad){return _0x3c56ad?{'count':_0x2a2fa6,'rows':_0x3c56ad}:null;})['then'](respondWithResult(_0x56869b,null))[_0xe7fb('0x2e')](handleError(_0x56869b,null));};exports['getLists']=function(_0x4880a7,_0x27669f){var _0x3d8b9a={};var _0x3503ac={};var _0x413843;var _0x55ce0f;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x4880a7[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x27669f,null))[_0xe7fb('0x18')](function(_0x21d9b0){if(_0x21d9b0){_0x413843=_0x21d9b0;_0x3503ac[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x3503ac[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4880a7[_0xe7fb('0x2b')]);_0x3503ac[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],_0x3503ac[_0xe7fb('0x2b')]);_0x3d8b9a['attributes']=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],qs['fields'](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x3d8b9a[_0xe7fb('0x35')]=_0x3d8b9a['attributes'][_0xe7fb('0x37')]?_0x3d8b9a[_0xe7fb('0x35')]:_0x3503ac[_0xe7fb('0x34')];_0x3d8b9a[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4880a7[_0xe7fb('0x2b')]['sort']);_0x3d8b9a[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4880a7['query'],_0x3503ac[_0xe7fb('0x32')]));if(_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x3d8b9a[_0xe7fb('0x29')]=_['merge'](_0x3d8b9a[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x3d8b9a[_0xe7fb('0x35')],function(_0x39ffed){var _0x47e833={};_0x47e833[_0x39ffed]={'$like':'%'+_0x4880a7['query'][_0xe7fb('0x1d')]+'%'};return _0x47e833;})});}_0x3d8b9a=_[_0xe7fb('0x39')]({},_0x3d8b9a,_0x4880a7[_0xe7fb('0x3a')]);return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})['then'](function(_0x57750a){if(_0x57750a){_0x55ce0f=_0x57750a[_0xe7fb('0x37')];if(!_0x4880a7['query'][_0xe7fb('0x4d')]('nolimit')){_0x3d8b9a[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x3d8b9a[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})[_0xe7fb('0x18')](function(_0x14014d){if(_0x14014d){return _0x14014d?{'count':_0x55ce0f,'rows':_0x14014d}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x27669f,null))[_0xe7fb('0x2e')](handleError(_0x27669f,null));};exports[_0xe7fb('0x8a')]=function(_0x4d9a76,_0x23a49e){var _0x30651f=moment()[_0xe7fb('0x66')](_0xe7fb('0x8b'));var _0x582862,_0x5b6da5;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4d9a76[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23a49e,null))['then'](function(_0x4e09d8){if(_0x4e09d8){_0x5b6da5=_0x4e09d8;return _0x4e09d8[_0xe7fb('0x8a')](_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x6b')],_[_0xe7fb('0x45')](_0x4d9a76[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x2e2167){var _0xd7f440;_0x582862=_0x2e2167||[];var _0xc8055f=[];if(_0x2e2167){for(var _0x45b449=0x0;_0x45b449<_0x2e2167['length'];_0x45b449+=0x1){var _0x366c06=_0x2e2167[_0x45b449][_0xe7fb('0x1a')]({'plain':!![]});_0x5b6da5[_0xe7fb('0x8d')]=_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]?_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]:_0x5b6da5[_0xe7fb('0x8d')];switch(_0x5b6da5['dialCheckDuplicateType']){case _0xe7fb('0x8e'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))['fromQuery']([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()['field'](_0xe7fb('0x92'),_0xe7fb('0x92'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))['field']('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x4d9a76[_0xe7fb('0x30')]['id']['toString'](),'VoiceQueueId')[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27','createdAt')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')]('cm_contacts')[_0xe7fb('0x29')](_0xe7fb('0x97'))['where'](_0xe7fb('0x98'),_0x366c06['CmListId'][_0xe7fb('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe7fb('0x29')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe7fb('0x6e')](_0xe7fb('0x99'))['from'](_0xe7fb('0x9a'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')]()))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel['select']()['field'](_0xe7fb('0x9c'))['from']('cm_hopper')[_0xe7fb('0x29')]('VoiceQueueId\x20=\x20?',_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;case _0xe7fb('0x9d'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),'scheduledAt',_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x92'),_0xe7fb('0x92'))['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))['field'](_0x4d9a76['params']['id']['toString'](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06['CmListId']['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0'))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x9c'))['from'](_0xe7fb('0x91'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;default:_0xd7f440=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),'ListId',_0xe7fb('0x51'),'createdAt','updatedAt'],squel['select']()[_0xe7fb('0x6e')]('phone','phone')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id','ContactId')[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')]['toString'](),_0xe7fb('0x95'))['field'](_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06[_0xe7fb('0x96')]['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();}_0xc8055f['push'](db[_0xe7fb('0x5f')]['query'](_0xd7f440));}return BPromise[_0xe7fb('0x7a')](_0xc8055f);}})[_0xe7fb('0x18')](function(){var _0x20b22f=[];var _0x2e22c1=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0xa1'))['fromQuery']([_0xe7fb('0xa2'),_0xe7fb('0x92'),_0xe7fb('0xa3'),'createdAt',_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0xa4'))[_0xe7fb('0x6e')]('ci.item')[_0xe7fb('0x6e')](_0xe7fb('0xa5'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0xa6'),'ci')[_0xe7fb('0xa7')]('cm_hopper','h',_0xe7fb('0xa8'))[_0xe7fb('0x29')]('h.scheduledat=?',_0x30651f)[_0xe7fb('0x29')]('ci.ItemClass=?',_0xe7fb('0xa9')))[_0xe7fb('0x75')]();_0x20b22f[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x2e22c1));return BPromise[_0xe7fb('0x7a')](_0x20b22f);})[_0xe7fb('0x18')](function(){return _0x582862;})['then'](respondWithResult(_0x23a49e,null))[_0xe7fb('0x2e')](handleError(_0x23a49e,null));};exports[_0xe7fb('0xaa')]=function(_0x3c04f4,_0x290cc3){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x3c04f4['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x290cc3,null))[_0xe7fb('0x18')](function(_0x3ed48f){if(_0x3ed48f){return _0x3ed48f['removeLists'](_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')]);}})[_0xe7fb('0x18')](function(_0x2eeff4){if(_0x2eeff4){return db[_0xe7fb('0x52')]['destroy']({'where':{'ListId':_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')],'VoiceQueueId':_0x3c04f4[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x2eeff4;});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x290cc3,null))[_0xe7fb('0x2e')](handleError(_0x290cc3,null));};exports[_0xe7fb('0xab')]=function(_0xcaad94,_0x5b88bd){var _0x143dbb={};var _0x715444={};var _0x92a316;var _0x30a834;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0xcaad94[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x5b88bd,null))[_0xe7fb('0x18')](function(_0x1b1818){if(_0x1b1818){_0x92a316=_0x1b1818;_0x715444[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x715444[_0xe7fb('0x2b')]=_['keys'](_0xcaad94[_0xe7fb('0x2b')]);_0x715444[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],_0x715444[_0xe7fb('0x2b')]);_0x143dbb['attributes']=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0xcaad94['query']['fields']));_0x143dbb[_0xe7fb('0x35')]=_0x143dbb[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x143dbb[_0xe7fb('0x35')]:_0x715444['model'];_0x143dbb[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x143dbb['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0xcaad94['query'],_0x715444[_0xe7fb('0x32')]));if(_0xcaad94[_0xe7fb('0x2b')]['filter']){_0x143dbb['where']=_[_0xe7fb('0x39')](_0x143dbb[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x143dbb['attributes'],function(_0x3b2375){var _0x170347={};_0x170347[_0x3b2375]={'$like':'%'+_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x170347;})});}_0x143dbb=_['merge']({},_0x143dbb,_0xcaad94[_0xe7fb('0x3a')]);return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x2a984e){if(_0x2a984e){_0x30a834=_0x2a984e[_0xe7fb('0x37')];if(!_0xcaad94[_0xe7fb('0x2b')]['hasOwnProperty']('nolimit')){_0x143dbb[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x143dbb[_0xe7fb('0x12')]=qs['offset'](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x286382){if(_0x286382){return _0x286382?{'count':_0x30a834,'rows':_0x286382}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x5b88bd,null))[_0xe7fb('0x2e')](handleError(_0x5b88bd,null));};exports[_0xe7fb('0xac')]=function(_0x325c7b,_0x38472b){var _0x1a33f8;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x325c7b[_0xe7fb('0x30')]['id']}})['then'](handleEntityNotFound(_0x38472b,null))[_0xe7fb('0x18')](function(_0x291a8d){if(_0x291a8d){return _0x291a8d['addBlackLists'](_0x325c7b[_0xe7fb('0x3d')]['ids'],_[_0xe7fb('0x45')](_0x325c7b[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x3ade81){var _0x1b9ea2;_0x1a33f8=_0x3ade81||[];var _0x418561=[];if(_0x3ade81){for(var _0x3ec66a=0x0;_0x3ec66a<_0x3ade81[_0xe7fb('0x37')];_0x3ec66a+=0x1){var _0x1c76a1=_0x3ade81[_0x3ec66a][_0xe7fb('0x1a')]({'plain':!![]});_0x1b9ea2=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0xad'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')]('phone',_0xe7fb('0x92'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))['field'](_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x325c7b[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),'VoiceQueueId')[_0xe7fb('0x6e')](_0xe7fb('0xae'),_0xe7fb('0x47'))[_0xe7fb('0x6e')]('NOW()',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))[_0xe7fb('0x29')]('deletedAt\x20IS\x20NULL')[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')]())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();_0x418561[_0xe7fb('0x74')](db[_0xe7fb('0x5f')]['query'](_0x1b9ea2));}return BPromise[_0xe7fb('0x7a')](_0x418561);}})[_0xe7fb('0x18')](function(){return _0x1a33f8;})['then'](respondWithResult(_0x38472b,null))[_0xe7fb('0x2e')](handleError(_0x38472b,null));};exports['removeBlackLists']=function(_0x127051,_0x4d9376){return db[_0xe7fb('0x25')]['find']({'where':{'id':_0x127051['params']['id']}})['then'](handleEntityNotFound(_0x4d9376,null))['then'](function(_0x547d29){if(_0x547d29){return _0x547d29[_0xe7fb('0xaf')](_0x127051[_0xe7fb('0x2b')]['ids']);}})[_0xe7fb('0x18')](function(_0x5c0baf){if(_0x5c0baf){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x127051['query'][_0xe7fb('0x6b')],'VoiceQueueId':_0x127051[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x5c0baf;});}})['then'](respondWithStatusCode(_0x4d9376,null))[_0xe7fb('0x2e')](handleError(_0x4d9376,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d122f58..1a17dcc 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 _0xef4d=['save','update','remove','hasOwnProperty','exports','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x487db7,_0x1f4b2a){var _0x5999ca=function(_0x2280fb){while(--_0x2280fb){_0x487db7['push'](_0x487db7['shift']());}};_0x5999ca(++_0x1f4b2a);}(_0xef4d,0x85));var _0xdef4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef4d[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xdef4('0x0'))['db'][_0xdef4('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xdef4('0x2')](0x0);var events={'afterCreate':_0xdef4('0x3'),'afterUpdate':_0xdef4('0x4'),'afterDestroy':_0xdef4('0x5')};function emitEvent(_0xdef8db){return function(_0x37d223,_0x5f447a,_0x524287){VoiceQueueEvents['emit'](_0xdef8db+':'+_0x37d223['id'],_0x37d223);VoiceQueueEvents['emit'](_0xdef8db,_0x37d223);_0x524287(null);};}for(var e in events){if(events[_0xdef4('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xdef4('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x2b6a=['setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x4cf88d,_0x5de590){var _0x1f49c0=function(_0x3aba91){while(--_0x3aba91){_0x4cf88d['push'](_0x4cf88d['shift']());}};_0x1f49c0(++_0x5de590);}(_0x2b6a,0x177));var _0xa2b6=function(_0x575f54,_0x2a0103){_0x575f54=_0x575f54-0x0;var _0x7ee2e7=_0x2b6a[_0x575f54];return _0x7ee2e7;};'use strict';var EventEmitter=require(_0xa2b6('0x0'));var VoiceQueue=require(_0xa2b6('0x1'))['db'][_0xa2b6('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa2b6('0x3')](0x0);var events={'afterCreate':_0xa2b6('0x4'),'afterUpdate':'update','afterDestroy':_0xa2b6('0x5')};function emitEvent(_0x1f75e9){return function(_0x3cde62,_0xa66118,_0x3f6e8a){VoiceQueueEvents['emit'](_0x1f75e9+':'+_0x3cde62['id'],_0x3cde62);VoiceQueueEvents[_0xa2b6('0x6')](_0x1f75e9,_0x3cde62);_0x3f6e8a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xa2b6('0x7')](e,emitEvent(event));}}module[_0xa2b6('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index b0527fa..e1529f9 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x1b15c6,_0x33f069){var _0x12145e=function(_0x1ae942){while(--_0x1ae942){_0x1b15c6['push'](_0x1b15c6['shift']());}};_0x12145e(++_0x33f069);}(_0x70e0,0x17b));var _0x070e=function(_0x5a489f,_0x4f650e){_0x5a489f=_0x5a489f-0x0;var _0x2c0f30=_0x70e0[_0x5a489f];return _0x2c0f30;};'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 +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x4a737d,_0x3c85ee){var _0x1ca394=function(_0x5e4e93){while(--_0x5e4e93){_0x4a737d['push'](_0x4a737d['shift']());}};_0x1ca394(++_0x3c85ee);}(_0x70e0,0x17b));var _0x070e=function(_0x2697fa,_0x198c4e){_0x2697fa=_0x2697fa-0x0;var _0x44bcbd=_0x70e0[_0x2697fa];return _0x44bcbd;};'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 a5f0faa..4075f7f 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 _0x264c=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowVoiceQueue','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x201c3e,_0x5b7bae){var _0x543b4f=function(_0x441f91){while(--_0x441f91){_0x201c3e['push'](_0x201c3e['shift']());}};_0x543b4f(++_0x5b7bae);}(_0x264c,0x159));var _0xc264=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x264c[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require(_0xc264('0x0'));var util=require(_0xc264('0x1'));var moment=require(_0xc264('0x2'));var BPromise=require(_0xc264('0x3'));var rs=require(_0xc264('0x4'));var fs=require('fs');var Redis=require(_0xc264('0x5'));var db=require(_0xc264('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc264('0x7'))('rpc');var config=require(_0xc264('0x8'));var jayson=require(_0xc264('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xc264('0xa')]=_[_0xc264('0xb')](config[_0xc264('0xa')],{'host':_0xc264('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc264('0xd'))[_0xc264('0xe')](socket);function respondWithRpcPromise(_0x35811c,_0x5e0ee8,_0x17823d){return new BPromise(function(_0x2d0259,_0x326c44){return client[_0xc264('0xf')](_0x35811c,_0x17823d)['then'](function(_0xbe553b){logger[_0xc264('0x10')](_0xc264('0x11'),_0x5e0ee8,_0xc264('0x12'));logger[_0xc264('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x5e0ee8,_0xc264('0x12'),JSON[_0xc264('0x14')](_0xbe553b));if(_0xbe553b[_0xc264('0x15')]){if(_0xbe553b[_0xc264('0x15')][_0xc264('0x16')]===0x1f4){logger['error'](_0xc264('0x11'),_0x5e0ee8,_0xbe553b['error']['message']);return _0x326c44(_0xbe553b['error']['message']);}logger[_0xc264('0x15')](_0xc264('0x11'),_0x5e0ee8,_0xbe553b[_0xc264('0x15')][_0xc264('0x17')]);return _0x2d0259(_0xbe553b[_0xc264('0x15')][_0xc264('0x17')]);}else{logger['info'](_0xc264('0x11'),_0x5e0ee8,'request\x20sent');_0x2d0259(_0xbe553b[_0xc264('0x18')][_0xc264('0x17')]);}})['catch'](function(_0x53a0a0){logger[_0xc264('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x5e0ee8,_0x53a0a0);_0x326c44(_0x53a0a0);});});}exports[_0xc264('0x19')]=function(_0x2722a1){var _0x562fee=this;return new Promise(function(_0x3238d3,_0xd42402){return db[_0xc264('0x1a')][_0xc264('0x1b')]({'raw':_0x2722a1[_0xc264('0x1c')]?_0x2722a1[_0xc264('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2722a1[_0xc264('0x1c')]?_0x2722a1['options'][_0xc264('0x1d')]||null:null,'attributes':_0x2722a1[_0xc264('0x1c')]?_0x2722a1[_0xc264('0x1c')][_0xc264('0x1e')]||null:null,'limit':_0x2722a1[_0xc264('0x1c')]?_0x2722a1['options'][_0xc264('0x1f')]||null:null,'include':_0x2722a1[_0xc264('0x1c')]?_0x2722a1[_0xc264('0x1c')][_0xc264('0x20')]?_[_0xc264('0x21')](_0x2722a1['options'][_0xc264('0x20')],function(_0x483d3d){return{'model':db[_0x483d3d['model']],'as':_0x483d3d['as'],'attributes':_0x483d3d[_0xc264('0x1e')],'include':_0x483d3d[_0xc264('0x20')]?_[_0xc264('0x21')](_0x483d3d['include'],function(_0x39f56e){return{'model':db[_0x39f56e['model']],'as':_0x39f56e['as'],'attributes':_0x39f56e[_0xc264('0x1e')],'include':_0x39f56e[_0xc264('0x20')]?_['map'](_0x39f56e[_0xc264('0x20')],function(_0x455fd8){return{'model':db[_0x455fd8[_0xc264('0x22')]],'as':_0x455fd8['as'],'attributes':_0x455fd8[_0xc264('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc264('0x23')](function(_0xba8f4f){logger[_0xc264('0x10')](_0xc264('0x19'),_0x2722a1);logger['debug'](_0xc264('0x19'),_0x2722a1,JSON['stringify'](_0xba8f4f));_0x3238d3(_0xba8f4f);})['catch'](function(_0x3d6ee2){logger[_0xc264('0x15')](_0xc264('0x19'),_0x3d6ee2[_0xc264('0x17')],_0x2722a1);_0xd42402(_0x562fee[_0xc264('0x15')](0x1f4,_0x3d6ee2[_0xc264('0x17')]));});});};exports[_0xc264('0x24')]=function(_0x5cd2bf){var _0x557860=this;return new Promise(function(_0x53024f,_0x233964){return db[_0xc264('0x1a')]['find']({'raw':_0x5cd2bf[_0xc264('0x1c')]?_0x5cd2bf['options'][_0xc264('0x25')]===undefined?!![]:![]:!![],'where':_0x5cd2bf['options']?_0x5cd2bf['options'][_0xc264('0x1d')]||null:null,'attributes':_0x5cd2bf[_0xc264('0x1c')]?_0x5cd2bf['options'][_0xc264('0x1e')]||null:null,'include':_0x5cd2bf[_0xc264('0x1c')]?_0x5cd2bf[_0xc264('0x1c')][_0xc264('0x20')]?_[_0xc264('0x21')](_0x5cd2bf[_0xc264('0x1c')][_0xc264('0x20')],function(_0x41d5ad){return{'model':db[_0x41d5ad[_0xc264('0x22')]],'as':_0x41d5ad['as'],'attributes':_0x41d5ad['attributes'],'include':_0x41d5ad['include']?_['map'](_0x41d5ad[_0xc264('0x20')],function(_0x1ab3a1){return{'model':db[_0x1ab3a1[_0xc264('0x22')]],'as':_0x1ab3a1['as'],'attributes':_0x1ab3a1[_0xc264('0x1e')],'include':_0x1ab3a1[_0xc264('0x20')]?_[_0xc264('0x21')](_0x1ab3a1[_0xc264('0x20')],function(_0x297eb8){return{'model':db[_0x297eb8['model']],'as':_0x297eb8['as'],'attributes':_0x297eb8[_0xc264('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e7324){logger[_0xc264('0x10')]('ShowVoiceQueue',_0x5cd2bf);logger[_0xc264('0x13')]('ShowVoiceQueue',_0x5cd2bf,JSON[_0xc264('0x14')](_0x5e7324));_0x53024f(_0x5e7324);})[_0xc264('0x26')](function(_0x518956){logger[_0xc264('0x15')]('ShowVoiceQueue',_0x518956['message'],_0x5cd2bf);_0x233964(_0x557860[_0xc264('0x15')](0x1f4,_0x518956[_0xc264('0x17')]));});});}; \ No newline at end of file +var _0x8f3f=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','VoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','limit','include','model','attributes','map','debug','ShowVoiceQueue','raw','where','then','stringify','lodash'];(function(_0x1c8489,_0x80368c){var _0x16a60f=function(_0x9629e8){while(--_0x9629e8){_0x1c8489['push'](_0x1c8489['shift']());}};_0x16a60f(++_0x80368c);}(_0x8f3f,0x179));var _0xf8f3=function(_0x461f2d,_0x5eb2e4){_0x461f2d=_0x461f2d-0x0;var _0x10abc8=_0x8f3f[_0x461f2d];return _0x10abc8;};'use strict';var _=require(_0xf8f3('0x0'));var util=require(_0xf8f3('0x1'));var moment=require(_0xf8f3('0x2'));var BPromise=require(_0xf8f3('0x3'));var rs=require(_0xf8f3('0x4'));var fs=require('fs');var Redis=require(_0xf8f3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8f3('0x6'));var logger=require(_0xf8f3('0x7'))(_0xf8f3('0x8'));var config=require(_0xf8f3('0x9'));var jayson=require(_0xf8f3('0xa'));var client=jayson[_0xf8f3('0xb')][_0xf8f3('0xc')]({'port':0x232a});config['redis']=_[_0xf8f3('0xd')](config[_0xf8f3('0xe')],{'host':_0xf8f3('0xf'),'port':0x18eb});var socket=require(_0xf8f3('0x10'))(new Redis(config['redis']));require(_0xf8f3('0x11'))[_0xf8f3('0x12')](socket);function respondWithRpcPromise(_0x5d263f,_0x2647c1,_0x2aa51a){return new BPromise(function(_0x2e21e9,_0x53323c){return client['request'](_0x5d263f,_0x2aa51a)['then'](function(_0xcff3a5){logger['info'](_0xf8f3('0x13'),_0x2647c1,_0xf8f3('0x14'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x2647c1,'request\x20sent',JSON['stringify'](_0xcff3a5));if(_0xcff3a5[_0xf8f3('0x15')]){if(_0xcff3a5[_0xf8f3('0x15')][_0xf8f3('0x16')]===0x1f4){logger[_0xf8f3('0x15')](_0xf8f3('0x13'),_0x2647c1,_0xcff3a5[_0xf8f3('0x15')][_0xf8f3('0x17')]);return _0x53323c(_0xcff3a5[_0xf8f3('0x15')][_0xf8f3('0x17')]);}logger[_0xf8f3('0x15')](_0xf8f3('0x13'),_0x2647c1,_0xcff3a5['error'][_0xf8f3('0x17')]);return _0x2e21e9(_0xcff3a5[_0xf8f3('0x15')][_0xf8f3('0x17')]);}else{logger[_0xf8f3('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x2647c1,_0xf8f3('0x14'));_0x2e21e9(_0xcff3a5[_0xf8f3('0x19')][_0xf8f3('0x17')]);}})[_0xf8f3('0x1a')](function(_0x31e901){logger[_0xf8f3('0x15')](_0xf8f3('0x13'),_0x2647c1,_0x31e901);_0x53323c(_0x31e901);});});}exports[_0xf8f3('0x1b')]=function(_0x106137){var _0xdde084=this;return new Promise(function(_0x3a5d5e,_0x40c165){return db[_0xf8f3('0x1c')][_0xf8f3('0x1d')]({'raw':_0x106137['options']?_0x106137[_0xf8f3('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x106137[_0xf8f3('0x1e')]?_0x106137['options']['where']||null:null,'attributes':_0x106137['options']?_0x106137['options']['attributes']||null:null,'limit':_0x106137[_0xf8f3('0x1e')]?_0x106137[_0xf8f3('0x1e')][_0xf8f3('0x1f')]||null:null,'include':_0x106137[_0xf8f3('0x1e')]?_0x106137[_0xf8f3('0x1e')][_0xf8f3('0x20')]?_['map'](_0x106137['options'][_0xf8f3('0x20')],function(_0x50c669){return{'model':db[_0x50c669[_0xf8f3('0x21')]],'as':_0x50c669['as'],'attributes':_0x50c669[_0xf8f3('0x22')],'include':_0x50c669[_0xf8f3('0x20')]?_[_0xf8f3('0x23')](_0x50c669[_0xf8f3('0x20')],function(_0xe0a55e){return{'model':db[_0xe0a55e[_0xf8f3('0x21')]],'as':_0xe0a55e['as'],'attributes':_0xe0a55e[_0xf8f3('0x22')],'include':_0xe0a55e[_0xf8f3('0x20')]?_[_0xf8f3('0x23')](_0xe0a55e['include'],function(_0x20a01c){return{'model':db[_0x20a01c['model']],'as':_0x20a01c['as'],'attributes':_0x20a01c[_0xf8f3('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd18a94){logger[_0xf8f3('0x18')](_0xf8f3('0x1b'),_0x106137);logger[_0xf8f3('0x24')](_0xf8f3('0x1b'),_0x106137,JSON['stringify'](_0xd18a94));_0x3a5d5e(_0xd18a94);})[_0xf8f3('0x1a')](function(_0x380622){logger['error'](_0xf8f3('0x1b'),_0x380622[_0xf8f3('0x17')],_0x106137);_0x40c165(_0xdde084[_0xf8f3('0x15')](0x1f4,_0x380622['message']));});});};exports[_0xf8f3('0x25')]=function(_0x289f58){var _0x3122bf=this;return new Promise(function(_0x27c6d0,_0x47a4dd){return db[_0xf8f3('0x1c')]['find']({'raw':_0x289f58[_0xf8f3('0x1e')]?_0x289f58[_0xf8f3('0x1e')][_0xf8f3('0x26')]===undefined?!![]:![]:!![],'where':_0x289f58[_0xf8f3('0x1e')]?_0x289f58[_0xf8f3('0x1e')][_0xf8f3('0x27')]||null:null,'attributes':_0x289f58['options']?_0x289f58[_0xf8f3('0x1e')][_0xf8f3('0x22')]||null:null,'include':_0x289f58[_0xf8f3('0x1e')]?_0x289f58[_0xf8f3('0x1e')]['include']?_[_0xf8f3('0x23')](_0x289f58['options']['include'],function(_0x563540){return{'model':db[_0x563540[_0xf8f3('0x21')]],'as':_0x563540['as'],'attributes':_0x563540[_0xf8f3('0x22')],'include':_0x563540[_0xf8f3('0x20')]?_[_0xf8f3('0x23')](_0x563540[_0xf8f3('0x20')],function(_0x52d05b){return{'model':db[_0x52d05b[_0xf8f3('0x21')]],'as':_0x52d05b['as'],'attributes':_0x52d05b['attributes'],'include':_0x52d05b[_0xf8f3('0x20')]?_[_0xf8f3('0x23')](_0x52d05b[_0xf8f3('0x20')],function(_0x32b252){return{'model':db[_0x32b252[_0xf8f3('0x21')]],'as':_0x32b252['as'],'attributes':_0x32b252[_0xf8f3('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf8f3('0x28')](function(_0x269f47){logger['info'](_0xf8f3('0x25'),_0x289f58);logger[_0xf8f3('0x24')](_0xf8f3('0x25'),_0x289f58,JSON[_0xf8f3('0x29')](_0x269f47));_0x27c6d0(_0x269f47);})['catch'](function(_0x316ab1){logger[_0xf8f3('0x15')](_0xf8f3('0x25'),_0x316ab1[_0xf8f3('0x17')],_0x289f58);_0x47a4dd(_0x3122bf['error'](0x1f4,_0x316ab1[_0xf8f3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index cc43dc0..22b4d35 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 _0x5ba8=['update','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x5ba353,_0x11fd8b){var _0x149f6b=function(_0x59b92e){while(--_0x59b92e){_0x5ba353['push'](_0x5ba353['shift']());}};_0x149f6b(++_0x11fd8b);}(_0x5ba8,0xe5));var _0x85ba=function(_0x54b9d4,_0x3930e7){_0x54b9d4=_0x54b9d4-0x0;var _0x32f9e8=_0x5ba8[_0x54b9d4];return _0x32f9e8;};'use strict';var VoiceQueueEvents=require(_0x85ba('0x0'));var events=[_0x85ba('0x1'),_0x85ba('0x2'),_0x85ba('0x3')];function createListener(_0x3e69c4,_0x5df54f){return function(_0x15c744){_0x5df54f['emit'](_0x3e69c4,_0x15c744);};}function removeListener(_0x102ccf,_0x56729a){return function(){VoiceQueueEvents[_0x85ba('0x4')](_0x102ccf,_0x56729a);};}exports[_0x85ba('0x5')]=function(_0x3b64ad){for(var _0xc29cc2=0x0,_0xb6e2c=events[_0x85ba('0x6')];_0xc29cc2<_0xb6e2c;_0xc29cc2++){var _0x432d63=events[_0xc29cc2];var _0x24cce8=createListener(_0x85ba('0x7')+_0x432d63,_0x3b64ad);VoiceQueueEvents['on'](_0x432d63,_0x24cce8);}}; \ No newline at end of file +var _0x9849=['emit','removeListener','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x58e19c,_0x17b34e){var _0x536652=function(_0x134155){while(--_0x134155){_0x58e19c['push'](_0x58e19c['shift']());}};_0x536652(++_0x17b34e);}(_0x9849,0xeb));var _0x9984=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x9849[_0x297fd3];return _0x2af381;};'use strict';var VoiceQueueEvents=require(_0x9984('0x0'));var events=[_0x9984('0x1'),_0x9984('0x2'),'update'];function createListener(_0xf7d499,_0x53cd06){return function(_0x1bad58){_0x53cd06[_0x9984('0x3')](_0xf7d499,_0x1bad58);};}function removeListener(_0x1f11dc,_0x3ab831){return function(){VoiceQueueEvents[_0x9984('0x4')](_0x1f11dc,_0x3ab831);};}exports['register']=function(_0x5558be){for(var _0x2f2f26=0x0,_0x1ed536=events[_0x9984('0x5')];_0x2f2f26<_0x1ed536;_0x2f2f26++){var _0xe50284=events[_0x2f2f26];var _0x3d29e2=createListener(_0x9984('0x6')+_0xe50284,_0x5558be);VoiceQueueEvents['on'](_0xe50284,_0x3d29e2);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 349aa37..104f6f3 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 _0xb658=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','show','create','put','/:id'];(function(_0x3366ad,_0x424860){var _0x4beceb=function(_0x2ea302){while(--_0x2ea302){_0x3366ad['push'](_0x3366ad['shift']());}};_0x4beceb(++_0x424860);}(_0xb658,0x1bc));var _0x8b65=function(_0x3e2e5d,_0x567ed4){_0x3e2e5d=_0x3e2e5d-0x0;var _0x2f4ef9=_0xb658[_0x3e2e5d];return _0x2f4ef9;};'use strict';var multer=require(_0x8b65('0x0'));var util=require('util');var path=require(_0x8b65('0x1'));var timeout=require(_0x8b65('0x2'));var express=require(_0x8b65('0x3'));var router=express[_0x8b65('0x4')]();var fs_extra=require(_0x8b65('0x5'));var auth=require(_0x8b65('0x6'));var interaction=require(_0x8b65('0x7'));var config=require(_0x8b65('0x8'));var controller=require(_0x8b65('0x9'));router[_0x8b65('0xa')]('/',auth[_0x8b65('0xb')](),controller[_0x8b65('0xc')]);router[_0x8b65('0xa')]('/describe',auth[_0x8b65('0xb')](),controller[_0x8b65('0xd')]);router['get']('/index',auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0x8b65('0xa')]('/:id',auth[_0x8b65('0xb')](),controller[_0x8b65('0xe')]);router['post']('/',auth[_0x8b65('0xb')](),controller[_0x8b65('0xf')]);router[_0x8b65('0x10')](_0x8b65('0x11'),auth[_0x8b65('0xb')](),controller[_0x8b65('0x12')]);router[_0x8b65('0x13')](_0x8b65('0x11'),auth[_0x8b65('0xb')](),controller[_0x8b65('0x14')]);module[_0x8b65('0x15')]=router; \ No newline at end of file +var _0x3064=['post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x3064,0x73));var _0x4306=function(_0x57092b,_0x34df4e){_0x57092b=_0x57092b-0x0;var _0x54cb10=_0x3064[_0x57092b];return _0x54cb10;};'use strict';var multer=require(_0x4306('0x0'));var util=require(_0x4306('0x1'));var path=require(_0x4306('0x2'));var timeout=require(_0x4306('0x3'));var express=require(_0x4306('0x4'));var router=express[_0x4306('0x5')]();var fs_extra=require(_0x4306('0x6'));var auth=require(_0x4306('0x7'));var interaction=require(_0x4306('0x8'));var config=require(_0x4306('0x9'));var controller=require(_0x4306('0xa'));router[_0x4306('0xb')]('/',auth[_0x4306('0xc')](),controller[_0x4306('0xd')]);router[_0x4306('0xb')](_0x4306('0xe'),auth[_0x4306('0xc')](),controller['describe']);router[_0x4306('0xb')]('/index',auth[_0x4306('0xc')](),controller['getVoiceQueuesReport']);router[_0x4306('0xb')](_0x4306('0xf'),auth[_0x4306('0xc')](),controller[_0x4306('0x10')]);router[_0x4306('0x11')]('/',auth[_0x4306('0xc')](),controller[_0x4306('0x12')]);router[_0x4306('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4306('0x14')](_0x4306('0xf'),auth[_0x4306('0xc')](),controller[_0x4306('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 9001792..8fcaed9 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 _0xed0b=['sequelize','moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x1dc591,_0x22643a){var _0x2d107b=function(_0x2acfbf){while(--_0x2acfbf){_0x1dc591['push'](_0x1dc591['shift']());}};_0x2d107b(++_0x22643a);}(_0xed0b,0x1a0));var _0xbed0=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xed0b[_0x45bf86];return _0x1f02b7;};'use strict';var Sequelize=require(_0xbed0('0x0'));var moment=require(_0xbed0('0x1'));module[_0xbed0('0x2')]={'type':{'type':Sequelize[_0xbed0('0x3')]},'uniqueid':{'type':Sequelize[_0xbed0('0x3')]},'calleridnum':{'type':Sequelize[_0xbed0('0x3')]},'calleridname':{'type':Sequelize[_0xbed0('0x3')]},'queue':{'type':Sequelize[_0xbed0('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xbed0('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xbed0('0x4')],'set':function(_0x1e6cc2){var _0xa60107=moment(_0x1e6cc2);var _0x54cb9d=moment(this[_0xbed0('0x5')]('queuecallerjoinAt'))[_0xbed0('0x6')](_0xbed0('0x7'));var _0x2fee42=_0xa60107[_0xbed0('0x8')](_0x54cb9d,_0xbed0('0x9'));this[_0xbed0('0xa')](_0xbed0('0xb'),_0x1e6cc2);this[_0xbed0('0xa')](_0xbed0('0xc'),_0x2fee42||null);}},'position':{'type':Sequelize[_0xbed0('0xd')]},'count':{'type':Sequelize[_0xbed0('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xbed0('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xbed0('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xbed0('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xbed0('0x4')]},'queuecallerexit':{'type':Sequelize[_0xbed0('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xbed0('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xbed0('0x3')],'comment':_0xbed0('0xf')},'originalposition':{'type':Sequelize[_0xbed0('0xd')]},'channel':{'type':Sequelize[_0xbed0('0x3')]},'connectedlinenum':{'type':Sequelize[_0xbed0('0x3')]},'connectedlinename':{'type':Sequelize[_0xbed0('0x3')]},'accountcode':{'type':Sequelize[_0xbed0('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xbed0('0x3')]},'priority':{'type':Sequelize[_0xbed0('0x3')]},'holdtime':{'type':Sequelize[_0xbed0('0xd')]},'mohtime':{'type':Sequelize[_0xbed0('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xbed0('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xbed0('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xbed0('0x3')]},'thirdDisposition':{'type':Sequelize[_0xbed0('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xbed0('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0xbed0('0x3')]}}; \ No newline at end of file +var _0x385a=['diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xb84ef7,_0x3146c1){var _0x504a4f=function(_0x76051f){while(--_0x76051f){_0xb84ef7['push'](_0xb84ef7['shift']());}};_0x504a4f(++_0x3146c1);}(_0x385a,0xc8));var _0xa385=function(_0x674dbc,_0x1234ef){_0x674dbc=_0x674dbc-0x0;var _0x39bc85=_0x385a[_0x674dbc];return _0x39bc85;};'use strict';var Sequelize=require(_0xa385('0x0'));var moment=require(_0xa385('0x1'));module[_0xa385('0x2')]={'type':{'type':Sequelize[_0xa385('0x3')]},'uniqueid':{'type':Sequelize[_0xa385('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xa385('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xa385('0x4')],'set':function(_0x17fc32){var _0x4aeab9=moment(_0x17fc32);var _0x875567=moment(this[_0xa385('0x5')](_0xa385('0x6')))['format'](_0xa385('0x7'));var _0x4547c6=_0x4aeab9[_0xa385('0x8')](_0x875567,'seconds');this[_0xa385('0x9')](_0xa385('0xa'),_0x17fc32);this[_0xa385('0x9')](_0xa385('0xb'),_0x4547c6||null);}},'position':{'type':Sequelize[_0xa385('0xc')]},'count':{'type':Sequelize[_0xa385('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xa385('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa385('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xa385('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa385('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa385('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xa385('0x3')],'comment':_0xa385('0xe')},'originalposition':{'type':Sequelize[_0xa385('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xa385('0x3')]},'accountcode':{'type':Sequelize[_0xa385('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa385('0x3')]},'priority':{'type':Sequelize[_0xa385('0x3')]},'holdtime':{'type':Sequelize[_0xa385('0xc')]},'mohtime':{'type':Sequelize[_0xa385('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa385('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xa385('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa385('0x3')],'comment':_0xa385('0xf')},'transferexten':{'type':Sequelize[_0xa385('0x3')]},'transferuniqueid':{'type':Sequelize[_0xa385('0x3')]},'disposition':{'type':Sequelize[_0xa385('0x3')]},'secondDisposition':{'type':Sequelize[_0xa385('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa385('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xa385('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xa385('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 27fa646..437707c 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 _0xa6f6=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','update','then','stack','name','send','index','map','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','VoiceQueueReport','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','destroy','describe','getVoiceQueuesReport','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0xa6f6,0x187));var _0x6a6f=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xa6f6[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0x6a6f('0x0'));var rimraf=require(_0x6a6f('0x1'));var zipdir=require(_0x6a6f('0x2'));var jsonpatch=require(_0x6a6f('0x3'));var rp=require('request-promise');var moment=require(_0x6a6f('0x4'));var BPromise=require(_0x6a6f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6a6f('0x6'));var sox=require(_0x6a6f('0x7'));var csv=require(_0x6a6f('0x8'));var ejs=require(_0x6a6f('0x9'));var fs=require('fs');var fs_extra=require(_0x6a6f('0xa'));var _=require(_0x6a6f('0xb'));var squel=require('squel');var crypto=require(_0x6a6f('0xc'));var jsforce=require(_0x6a6f('0xd'));var deskjs=require(_0x6a6f('0xe'));var toCsv=require(_0x6a6f('0x8'));var querystring=require(_0x6a6f('0xf'));var Papa=require(_0x6a6f('0x10'));var Redis=require(_0x6a6f('0x11'));var authService=require(_0x6a6f('0x12'));var qs=require(_0x6a6f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a6f('0x14'));var logger=require(_0x6a6f('0x15'))('api');var utils=require(_0x6a6f('0x16'));var config=require(_0x6a6f('0x17'));var licenseUtil=require(_0x6a6f('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6a6f('0x19')](config[_0x6a6f('0x1a')],{'host':_0x6a6f('0x1b'),'port':0x18eb});var socket=require(_0x6a6f('0x1c'))(new Redis(config[_0x6a6f('0x1a')]));require(_0x6a6f('0x1d'))[_0x6a6f('0x1e')](socket);function respondWithStatusCode(_0x3b742a,_0xd9e9d4){_0xd9e9d4=_0xd9e9d4||0xcc;return function(_0xfcb37b){if(_0xfcb37b){return _0x3b742a[_0x6a6f('0x1f')](_0xd9e9d4);}return _0x3b742a[_0x6a6f('0x20')](_0xd9e9d4)['end']();};}function respondWithResult(_0x5898ee,_0x4ad314){_0x4ad314=_0x4ad314||0xc8;return function(_0x5e107a){if(_0x5e107a){return _0x5898ee[_0x6a6f('0x20')](_0x4ad314)['json'](_0x5e107a);}};}function respondWithFilteredResult(_0x14f84b,_0x6f93b7){return function(_0x2b52c2){if(_0x2b52c2){var _0xb20ce0=typeof _0x6f93b7[_0x6a6f('0x21')]===_0x6a6f('0x22')&&typeof _0x6f93b7[_0x6a6f('0x23')]===_0x6a6f('0x22');var _0x402684=_0x2b52c2[_0x6a6f('0x24')];var _0x119e43=_0xb20ce0?0x0:_0x6f93b7['offset'];var _0x19c614=_0xb20ce0?_0x2b52c2['count']:_0x6f93b7[_0x6a6f('0x21')]+_0x6f93b7[_0x6a6f('0x23')];var _0x4dde6a;if(_0x19c614>=_0x402684){_0x19c614=_0x402684;_0x4dde6a=0xc8;}else{_0x4dde6a=0xce;}_0x14f84b[_0x6a6f('0x20')](_0x4dde6a);return _0x14f84b[_0x6a6f('0x25')](_0x6a6f('0x26'),_0x119e43+'-'+_0x19c614+'/'+_0x402684)['json'](_0x2b52c2);}return null;};}function patchUpdates(_0x34149e){return function(_0x2c2c06){try{jsonpatch['apply'](_0x2c2c06,_0x34149e,!![]);}catch(_0x492c07){return BPromise['reject'](_0x492c07);}return _0x2c2c06['save']();};}function saveUpdates(_0x437271,_0x536c3e){return function(_0x2d8f5e){if(_0x2d8f5e){return _0x2d8f5e[_0x6a6f('0x27')](_0x437271)[_0x6a6f('0x28')](function(_0x3e8273){return _0x3e8273;});}return null;};}function removeEntity(_0x260f4c,_0x1f0b69){return function(_0x4d2dcd){if(_0x4d2dcd){return _0x4d2dcd['destroy']()[_0x6a6f('0x28')](function(){_0x260f4c[_0x6a6f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eefaa,_0x4c2dc4){return function(_0x3acf8d){if(!_0x3acf8d){_0x4eefaa[_0x6a6f('0x1f')](0x194);}return _0x3acf8d;};}function handleError(_0x4e60a8,_0xcb365d){_0xcb365d=_0xcb365d||0x1f4;return function(_0xc6574a){logger['error'](_0xc6574a[_0x6a6f('0x29')]);if(_0xc6574a[_0x6a6f('0x2a')]){delete _0xc6574a['name'];}_0x4e60a8['status'](_0xcb365d)[_0x6a6f('0x2b')](_0xc6574a);};}exports[_0x6a6f('0x2c')]=function(_0x2e54c8,_0xe23bc4){var _0x31a417={},_0x4d8e11={},_0xf296ec={'count':0x0,'rows':[]};var _0x379a32=_[_0x6a6f('0x2d')](db['VoiceQueueReport']['rawAttributes'],function(_0x4cb5c5){return{'name':_0x4cb5c5[_0x6a6f('0x2e')],'type':_0x4cb5c5[_0x6a6f('0x2f')]['key']};});_0x4d8e11[_0x6a6f('0x30')]=_[_0x6a6f('0x2d')](_0x379a32,'name');_0x4d8e11[_0x6a6f('0x31')]=_[_0x6a6f('0x32')](_0x2e54c8[_0x6a6f('0x31')]);_0x4d8e11[_0x6a6f('0x33')]=_['intersection'](_0x4d8e11[_0x6a6f('0x30')],_0x4d8e11[_0x6a6f('0x31')]);_0x31a417[_0x6a6f('0x34')]=_[_0x6a6f('0x35')](_0x4d8e11['model'],qs[_0x6a6f('0x36')](_0x2e54c8[_0x6a6f('0x31')][_0x6a6f('0x36')]));_0x31a417[_0x6a6f('0x34')]=_0x31a417[_0x6a6f('0x34')]['length']?_0x31a417[_0x6a6f('0x34')]:_0x4d8e11[_0x6a6f('0x30')];if(!_0x2e54c8['query'][_0x6a6f('0x37')](_0x6a6f('0x38'))){_0x31a417[_0x6a6f('0x23')]=qs[_0x6a6f('0x23')](_0x2e54c8[_0x6a6f('0x31')][_0x6a6f('0x23')]);_0x31a417['offset']=qs[_0x6a6f('0x21')](_0x2e54c8[_0x6a6f('0x31')][_0x6a6f('0x21')]);}_0x31a417['order']=qs['sort'](_0x2e54c8[_0x6a6f('0x31')][_0x6a6f('0x39')]);_0x31a417[_0x6a6f('0x3a')]=qs[_0x6a6f('0x33')](_[_0x6a6f('0x3b')](_0x2e54c8[_0x6a6f('0x31')],_0x4d8e11['filters']),_0x379a32);if(_0x2e54c8['query'][_0x6a6f('0x3c')]){_0x31a417[_0x6a6f('0x3a')]=_['merge'](_0x31a417['where'],{'$or':_[_0x6a6f('0x2d')](_0x379a32,function(_0x159e18){if(_0x159e18[_0x6a6f('0x2f')]!==_0x6a6f('0x3d')){var _0x3c8116={};_0x3c8116[_0x159e18['name']]={'$like':'%'+_0x2e54c8[_0x6a6f('0x31')]['filter']+'%'};return _0x3c8116;}})});}_0x31a417=_[_0x6a6f('0x3e')]({},_0x31a417,_0x2e54c8[_0x6a6f('0x3f')]);var _0x30cc67={'where':_0x31a417[_0x6a6f('0x3a')]};return db[_0x6a6f('0x40')][_0x6a6f('0x24')](_0x30cc67)[_0x6a6f('0x28')](function(_0x28f139){_0xf296ec[_0x6a6f('0x24')]=_0x28f139;if(_0x2e54c8['query'][_0x6a6f('0x41')]){_0x31a417[_0x6a6f('0x42')]=[{'all':!![]}];}return db[_0x6a6f('0x40')][_0x6a6f('0x43')](_0x31a417);})['then'](function(_0x5af331){_0xf296ec[_0x6a6f('0x44')]=_0x5af331;return _0xf296ec;})['then'](respondWithFilteredResult(_0xe23bc4,_0x31a417))['catch'](handleError(_0xe23bc4,null));};exports[_0x6a6f('0x45')]=function(_0x11e2f5,_0x4d3b6e){var _0x27bf43={'raw':![],'where':{'id':_0x11e2f5[_0x6a6f('0x46')]['id']}},_0x2a0705={};_0x2a0705[_0x6a6f('0x30')]=_[_0x6a6f('0x32')](db[_0x6a6f('0x40')]['rawAttributes']);_0x2a0705['query']=_['keys'](_0x11e2f5['query']);_0x2a0705[_0x6a6f('0x33')]=_[_0x6a6f('0x35')](_0x2a0705[_0x6a6f('0x30')],_0x2a0705[_0x6a6f('0x31')]);_0x27bf43[_0x6a6f('0x34')]=_[_0x6a6f('0x35')](_0x2a0705[_0x6a6f('0x30')],qs['fields'](_0x11e2f5[_0x6a6f('0x31')][_0x6a6f('0x36')]));_0x27bf43[_0x6a6f('0x34')]=_0x27bf43[_0x6a6f('0x34')][_0x6a6f('0x47')]?_0x27bf43[_0x6a6f('0x34')]:_0x2a0705[_0x6a6f('0x30')];if(_0x11e2f5['query']['includeAll']){_0x27bf43[_0x6a6f('0x42')]=[{'all':!![]}];}_0x27bf43=_[_0x6a6f('0x3e')]({},_0x27bf43,_0x11e2f5[_0x6a6f('0x3f')]);return db[_0x6a6f('0x40')]['find'](_0x27bf43)[_0x6a6f('0x28')](handleEntityNotFound(_0x4d3b6e,null))[_0x6a6f('0x28')](respondWithResult(_0x4d3b6e,null))[_0x6a6f('0x48')](handleError(_0x4d3b6e,null));};exports[_0x6a6f('0x49')]=function(_0x22893b,_0x45f820){return db[_0x6a6f('0x40')][_0x6a6f('0x49')](_0x22893b['body'],{})[_0x6a6f('0x28')](respondWithResult(_0x45f820,0xc9))[_0x6a6f('0x48')](handleError(_0x45f820,null));};exports[_0x6a6f('0x27')]=function(_0x177af8,_0x28d297){if(_0x177af8['body']['id']){delete _0x177af8[_0x6a6f('0x4a')]['id'];}return db[_0x6a6f('0x40')][_0x6a6f('0x4b')]({'where':{'id':_0x177af8[_0x6a6f('0x46')]['id']}})[_0x6a6f('0x28')](handleEntityNotFound(_0x28d297,null))[_0x6a6f('0x28')](saveUpdates(_0x177af8[_0x6a6f('0x4a')],null))[_0x6a6f('0x28')](respondWithResult(_0x28d297,null))[_0x6a6f('0x48')](handleError(_0x28d297,null));};exports[_0x6a6f('0x4c')]=function(_0xfec871,_0x482beb){return db['VoiceQueueReport'][_0x6a6f('0x4b')]({'where':{'id':_0xfec871[_0x6a6f('0x46')]['id']}})['then'](handleEntityNotFound(_0x482beb,null))[_0x6a6f('0x28')](removeEntity(_0x482beb,null))[_0x6a6f('0x48')](handleError(_0x482beb,null));};exports[_0x6a6f('0x4d')]=function(_0x40fcad,_0x209ba5){return db[_0x6a6f('0x40')][_0x6a6f('0x4d')]()[_0x6a6f('0x28')](respondWithResult(_0x209ba5,null))['catch'](handleError(_0x209ba5,null));};exports[_0x6a6f('0x4e')]=function(_0x55aa74,_0x5c6946){var _0x576135={},_0x58635e={},_0x3f4761={'count':0x0,'rows':[]};_0x58635e[_0x6a6f('0x30')]=_['keys'](db[_0x6a6f('0x40')][_0x6a6f('0x4f')]);_0x58635e[_0x6a6f('0x31')]=_[_0x6a6f('0x32')](_0x55aa74[_0x6a6f('0x31')]);_0x58635e[_0x6a6f('0x33')]=_['intersection'](_0x58635e[_0x6a6f('0x30')],_0x58635e['query']);_0x576135[_0x6a6f('0x34')]=_['intersection'](_0x58635e[_0x6a6f('0x30')],qs[_0x6a6f('0x36')](_0x55aa74[_0x6a6f('0x31')][_0x6a6f('0x36')]));_0x576135[_0x6a6f('0x34')]=_0x576135[_0x6a6f('0x34')]['length']?_0x576135[_0x6a6f('0x34')]:_0x58635e[_0x6a6f('0x30')];if(!_0x55aa74[_0x6a6f('0x31')]['hasOwnProperty'](_0x6a6f('0x38'))){_0x576135[_0x6a6f('0x23')]=qs[_0x6a6f('0x23')](_0x55aa74[_0x6a6f('0x31')][_0x6a6f('0x23')]);_0x576135[_0x6a6f('0x21')]=qs['offset'](_0x55aa74[_0x6a6f('0x31')][_0x6a6f('0x21')]);}_0x576135['order']=qs[_0x6a6f('0x39')](_0x55aa74['query']['sort']);_0x576135[_0x6a6f('0x3a')]=qs[_0x6a6f('0x33')](_[_0x6a6f('0x3b')](_0x55aa74['query'],_0x58635e[_0x6a6f('0x33')]));if(_0x55aa74[_0x6a6f('0x31')][_0x6a6f('0x3c')]){_0x576135[_0x6a6f('0x3a')]=_[_0x6a6f('0x3e')](_0x576135[_0x6a6f('0x3a')],{'$or':_[_0x6a6f('0x2d')](_0x576135[_0x6a6f('0x34')],function(_0x28935a){var _0x8f986c={};_0x8f986c[_0x28935a]={'$like':'%'+_0x55aa74[_0x6a6f('0x31')][_0x6a6f('0x3c')]+'%'};return _0x8f986c;})});}_0x576135=_['merge']({},_0x576135,_0x55aa74[_0x6a6f('0x3f')]);var _0x29cf95={'where':_0x576135['where']};return db[_0x6a6f('0x40')][_0x6a6f('0x24')](_0x29cf95)[_0x6a6f('0x28')](function(_0xb2e1a6){_0x3f4761['count']=_0xb2e1a6;if(_0x55aa74[_0x6a6f('0x31')][_0x6a6f('0x41')]){_0x576135['include']=[{'all':!![]}];}return db[_0x6a6f('0x40')]['findAll'](_0x576135);})[_0x6a6f('0x28')](function(_0x3d72c3){_0x3f4761[_0x6a6f('0x44')]=_0x3d72c3;return _0x3f4761;})['then'](respondWithFilteredResult(_0x5c6946,_0x576135,'getVoiceQueuesReport'))[_0x6a6f('0x48')](handleError(_0x5c6946,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x9f96=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch','create','body','destroy','describe','getVoiceQueuesReport','hasOwnProperty','findAll','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x4f9e31,_0xd1efe5){var _0x2ced9a=function(_0x36c106){while(--_0x36c106){_0x4f9e31['push'](_0x4f9e31['shift']());}};_0x2ced9a(++_0xd1efe5);}(_0x9f96,0x99));var _0x69f9=function(_0x5a856b,_0x294b1f){_0x5a856b=_0x5a856b-0x0;var _0x3861f1=_0x9f96[_0x5a856b];return _0x3861f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69f9('0x0'));var zipdir=require(_0x69f9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x69f9('0x2'));var moment=require(_0x69f9('0x3'));var BPromise=require(_0x69f9('0x4'));var Mustache=require(_0x69f9('0x5'));var util=require(_0x69f9('0x6'));var path=require(_0x69f9('0x7'));var sox=require(_0x69f9('0x8'));var csv=require(_0x69f9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69f9('0xa'));var _=require(_0x69f9('0xb'));var squel=require(_0x69f9('0xc'));var crypto=require(_0x69f9('0xd'));var jsforce=require(_0x69f9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x69f9('0x9'));var querystring=require(_0x69f9('0xf'));var Papa=require(_0x69f9('0x10'));var Redis=require(_0x69f9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x69f9('0x12'));var hardwareService=require(_0x69f9('0x13'));var logger=require('../../config/logger')(_0x69f9('0x14'));var utils=require('../../config/utils');var config=require(_0x69f9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x69f9('0x16'))['db'];config[_0x69f9('0x17')]=_[_0x69f9('0x18')](config['redis'],{'host':_0x69f9('0x19'),'port':0x18eb});var socket=require(_0x69f9('0x1a'))(new Redis(config['redis']));require(_0x69f9('0x1b'))[_0x69f9('0x1c')](socket);function respondWithStatusCode(_0x5d2bd5,_0x2ba89c){_0x2ba89c=_0x2ba89c||0xcc;return function(_0x2bb702){if(_0x2bb702){return _0x5d2bd5[_0x69f9('0x1d')](_0x2ba89c);}return _0x5d2bd5[_0x69f9('0x1e')](_0x2ba89c)[_0x69f9('0x1f')]();};}function respondWithResult(_0xb5b86b,_0x220a1c){_0x220a1c=_0x220a1c||0xc8;return function(_0xdc0a75){if(_0xdc0a75){return _0xb5b86b['status'](_0x220a1c)[_0x69f9('0x20')](_0xdc0a75);}};}function respondWithFilteredResult(_0x1a805d,_0x12b21c){return function(_0x4c7b8d){if(_0x4c7b8d){var _0x147972=typeof _0x12b21c[_0x69f9('0x21')]===_0x69f9('0x22')&&typeof _0x12b21c[_0x69f9('0x23')]===_0x69f9('0x22');var _0x12084a=_0x4c7b8d[_0x69f9('0x24')];var _0x395f77=_0x147972?0x0:_0x12b21c['offset'];var _0x4a19e6=_0x147972?_0x4c7b8d[_0x69f9('0x24')]:_0x12b21c['offset']+_0x12b21c[_0x69f9('0x23')];var _0xddefe;if(_0x4a19e6>=_0x12084a){_0x4a19e6=_0x12084a;_0xddefe=0xc8;}else{_0xddefe=0xce;}_0x1a805d[_0x69f9('0x1e')](_0xddefe);return _0x1a805d[_0x69f9('0x25')](_0x69f9('0x26'),_0x395f77+'-'+_0x4a19e6+'/'+_0x12084a)[_0x69f9('0x20')](_0x4c7b8d);}return null;};}function patchUpdates(_0x7b23b){return function(_0x29a8ba){try{jsonpatch[_0x69f9('0x27')](_0x29a8ba,_0x7b23b,!![]);}catch(_0x323e52){return BPromise['reject'](_0x323e52);}return _0x29a8ba['save']();};}function saveUpdates(_0x3a7655,_0x5e199d){return function(_0x7f94fa){if(_0x7f94fa){return _0x7f94fa[_0x69f9('0x28')](_0x3a7655)[_0x69f9('0x29')](function(_0x4ba5b0){return _0x4ba5b0;});}return null;};}function removeEntity(_0x25526c,_0x541f74){return function(_0x2f497a){if(_0x2f497a){return _0x2f497a['destroy']()[_0x69f9('0x29')](function(){_0x25526c['status'](0xcc)[_0x69f9('0x1f')]();});}};}function handleEntityNotFound(_0x270eaa,_0x6d95ba){return function(_0x6e7d3b){if(!_0x6e7d3b){_0x270eaa['sendStatus'](0x194);}return _0x6e7d3b;};}function handleError(_0x1c17ce,_0x1aaf44){_0x1aaf44=_0x1aaf44||0x1f4;return function(_0x352ce1){logger[_0x69f9('0x2a')](_0x352ce1[_0x69f9('0x2b')]);if(_0x352ce1['name']){delete _0x352ce1[_0x69f9('0x2c')];}_0x1c17ce['status'](_0x1aaf44)[_0x69f9('0x2d')](_0x352ce1);};}exports['index']=function(_0x4f93a2,_0x46a5ba){var _0x19233b={},_0x4ff788={},_0x5c0293={'count':0x0,'rows':[]};var _0x46588d=_[_0x69f9('0x2e')](db[_0x69f9('0x2f')][_0x69f9('0x30')],function(_0x9ff647){return{'name':_0x9ff647[_0x69f9('0x31')],'type':_0x9ff647[_0x69f9('0x32')][_0x69f9('0x33')]};});_0x4ff788[_0x69f9('0x34')]=_[_0x69f9('0x2e')](_0x46588d,_0x69f9('0x2c'));_0x4ff788['query']=_[_0x69f9('0x35')](_0x4f93a2['query']);_0x4ff788[_0x69f9('0x36')]=_[_0x69f9('0x37')](_0x4ff788[_0x69f9('0x34')],_0x4ff788[_0x69f9('0x38')]);_0x19233b['attributes']=_[_0x69f9('0x37')](_0x4ff788[_0x69f9('0x34')],qs[_0x69f9('0x39')](_0x4f93a2[_0x69f9('0x38')][_0x69f9('0x39')]));_0x19233b[_0x69f9('0x3a')]=_0x19233b[_0x69f9('0x3a')][_0x69f9('0x3b')]?_0x19233b[_0x69f9('0x3a')]:_0x4ff788['model'];if(!_0x4f93a2[_0x69f9('0x38')]['hasOwnProperty'](_0x69f9('0x3c'))){_0x19233b[_0x69f9('0x23')]=qs[_0x69f9('0x23')](_0x4f93a2[_0x69f9('0x38')]['limit']);_0x19233b['offset']=qs[_0x69f9('0x21')](_0x4f93a2[_0x69f9('0x38')]['offset']);}_0x19233b[_0x69f9('0x3d')]=qs[_0x69f9('0x3e')](_0x4f93a2[_0x69f9('0x38')][_0x69f9('0x3e')]);_0x19233b['where']=qs[_0x69f9('0x36')](_[_0x69f9('0x3f')](_0x4f93a2[_0x69f9('0x38')],_0x4ff788[_0x69f9('0x36')]),_0x46588d);if(_0x4f93a2[_0x69f9('0x38')][_0x69f9('0x40')]){_0x19233b[_0x69f9('0x41')]=_['merge'](_0x19233b['where'],{'$or':_[_0x69f9('0x2e')](_0x46588d,function(_0x1da947){if(_0x1da947['type']!==_0x69f9('0x42')){var _0x4bb206={};_0x4bb206[_0x1da947['name']]={'$like':'%'+_0x4f93a2[_0x69f9('0x38')][_0x69f9('0x40')]+'%'};return _0x4bb206;}})});}_0x19233b=_[_0x69f9('0x43')]({},_0x19233b,_0x4f93a2[_0x69f9('0x44')]);var _0x14c8c3={'where':_0x19233b[_0x69f9('0x41')]};return db[_0x69f9('0x2f')][_0x69f9('0x24')](_0x14c8c3)[_0x69f9('0x29')](function(_0x538c53){_0x5c0293[_0x69f9('0x24')]=_0x538c53;if(_0x4f93a2['query'][_0x69f9('0x45')]){_0x19233b[_0x69f9('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x19233b);})[_0x69f9('0x29')](function(_0x40493c){_0x5c0293[_0x69f9('0x47')]=_0x40493c;return _0x5c0293;})[_0x69f9('0x29')](respondWithFilteredResult(_0x46a5ba,_0x19233b))['catch'](handleError(_0x46a5ba,null));};exports[_0x69f9('0x48')]=function(_0x4dc76b,_0x6c2234){var _0x57aca1={'raw':![],'where':{'id':_0x4dc76b['params']['id']}},_0x1e69d0={};_0x1e69d0[_0x69f9('0x34')]=_[_0x69f9('0x35')](db[_0x69f9('0x2f')][_0x69f9('0x30')]);_0x1e69d0[_0x69f9('0x38')]=_[_0x69f9('0x35')](_0x4dc76b[_0x69f9('0x38')]);_0x1e69d0[_0x69f9('0x36')]=_[_0x69f9('0x37')](_0x1e69d0['model'],_0x1e69d0[_0x69f9('0x38')]);_0x57aca1['attributes']=_[_0x69f9('0x37')](_0x1e69d0[_0x69f9('0x34')],qs[_0x69f9('0x39')](_0x4dc76b[_0x69f9('0x38')]['fields']));_0x57aca1[_0x69f9('0x3a')]=_0x57aca1[_0x69f9('0x3a')]['length']?_0x57aca1[_0x69f9('0x3a')]:_0x1e69d0['model'];if(_0x4dc76b['query'][_0x69f9('0x45')]){_0x57aca1[_0x69f9('0x46')]=[{'all':!![]}];}_0x57aca1=_[_0x69f9('0x43')]({},_0x57aca1,_0x4dc76b[_0x69f9('0x44')]);return db['VoiceQueueReport'][_0x69f9('0x49')](_0x57aca1)['then'](handleEntityNotFound(_0x6c2234,null))[_0x69f9('0x29')](respondWithResult(_0x6c2234,null))[_0x69f9('0x4a')](handleError(_0x6c2234,null));};exports[_0x69f9('0x4b')]=function(_0x1afc96,_0x4e0d45){return db['VoiceQueueReport'][_0x69f9('0x4b')](_0x1afc96[_0x69f9('0x4c')],{})[_0x69f9('0x29')](respondWithResult(_0x4e0d45,0xc9))[_0x69f9('0x4a')](handleError(_0x4e0d45,null));};exports[_0x69f9('0x28')]=function(_0x3056db,_0x106394){if(_0x3056db[_0x69f9('0x4c')]['id']){delete _0x3056db['body']['id'];}return db['VoiceQueueReport'][_0x69f9('0x49')]({'where':{'id':_0x3056db['params']['id']}})[_0x69f9('0x29')](handleEntityNotFound(_0x106394,null))['then'](saveUpdates(_0x3056db[_0x69f9('0x4c')],null))[_0x69f9('0x29')](respondWithResult(_0x106394,null))[_0x69f9('0x4a')](handleError(_0x106394,null));};exports[_0x69f9('0x4d')]=function(_0x2408eb,_0x224c91){return db[_0x69f9('0x2f')][_0x69f9('0x49')]({'where':{'id':_0x2408eb['params']['id']}})[_0x69f9('0x29')](handleEntityNotFound(_0x224c91,null))['then'](removeEntity(_0x224c91,null))[_0x69f9('0x4a')](handleError(_0x224c91,null));};exports[_0x69f9('0x4e')]=function(_0x16da78,_0x853273){return db['VoiceQueueReport'][_0x69f9('0x4e')]()[_0x69f9('0x29')](respondWithResult(_0x853273,null))['catch'](handleError(_0x853273,null));};exports[_0x69f9('0x4f')]=function(_0x4d7fe2,_0x34c18a){var _0x12da2a={},_0x59917b={},_0x5f12a0={'count':0x0,'rows':[]};_0x59917b[_0x69f9('0x34')]=_[_0x69f9('0x35')](db[_0x69f9('0x2f')][_0x69f9('0x30')]);_0x59917b['query']=_[_0x69f9('0x35')](_0x4d7fe2[_0x69f9('0x38')]);_0x59917b['filters']=_['intersection'](_0x59917b['model'],_0x59917b[_0x69f9('0x38')]);_0x12da2a[_0x69f9('0x3a')]=_[_0x69f9('0x37')](_0x59917b[_0x69f9('0x34')],qs[_0x69f9('0x39')](_0x4d7fe2[_0x69f9('0x38')][_0x69f9('0x39')]));_0x12da2a[_0x69f9('0x3a')]=_0x12da2a[_0x69f9('0x3a')]['length']?_0x12da2a['attributes']:_0x59917b['model'];if(!_0x4d7fe2[_0x69f9('0x38')][_0x69f9('0x50')](_0x69f9('0x3c'))){_0x12da2a[_0x69f9('0x23')]=qs[_0x69f9('0x23')](_0x4d7fe2[_0x69f9('0x38')]['limit']);_0x12da2a['offset']=qs[_0x69f9('0x21')](_0x4d7fe2[_0x69f9('0x38')][_0x69f9('0x21')]);}_0x12da2a[_0x69f9('0x3d')]=qs[_0x69f9('0x3e')](_0x4d7fe2[_0x69f9('0x38')][_0x69f9('0x3e')]);_0x12da2a[_0x69f9('0x41')]=qs[_0x69f9('0x36')](_['pick'](_0x4d7fe2[_0x69f9('0x38')],_0x59917b[_0x69f9('0x36')]));if(_0x4d7fe2['query']['filter']){_0x12da2a['where']=_['merge'](_0x12da2a[_0x69f9('0x41')],{'$or':_[_0x69f9('0x2e')](_0x12da2a[_0x69f9('0x3a')],function(_0x1d9cb5){var _0x4ece5f={};_0x4ece5f[_0x1d9cb5]={'$like':'%'+_0x4d7fe2[_0x69f9('0x38')][_0x69f9('0x40')]+'%'};return _0x4ece5f;})});}_0x12da2a=_[_0x69f9('0x43')]({},_0x12da2a,_0x4d7fe2[_0x69f9('0x44')]);var _0x2e036b={'where':_0x12da2a['where']};return db[_0x69f9('0x2f')][_0x69f9('0x24')](_0x2e036b)[_0x69f9('0x29')](function(_0x49784f){_0x5f12a0['count']=_0x49784f;if(_0x4d7fe2[_0x69f9('0x38')]['includeAll']){_0x12da2a['include']=[{'all':!![]}];}return db[_0x69f9('0x2f')][_0x69f9('0x51')](_0x12da2a);})['then'](function(_0x2d9387){_0x5f12a0['rows']=_0x2d9387;return _0x5f12a0;})[_0x69f9('0x29')](respondWithFilteredResult(_0x34c18a,_0x12da2a,_0x69f9('0x4f')))[_0x69f9('0x4a')](handleError(_0x34c18a,null,_0x69f9('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 2816013..6e39ae5 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 _0x7b8e=['VoiceQueueReport','save','emit','hook','exports','events','../../mysqldb'];(function(_0x315572,_0x2d8f9d){var _0x1db654=function(_0x189f28){while(--_0x189f28){_0x315572['push'](_0x315572['shift']());}};_0x1db654(++_0x2d8f9d);}(_0x7b8e,0x1cc));var _0xe7b8=function(_0x455a74,_0x5306e7){_0x455a74=_0x455a74-0x0;var _0x5301cd=_0x7b8e[_0x455a74];return _0x5301cd;};'use strict';var EventEmitter=require(_0xe7b8('0x0'));var VoiceQueueReport=require(_0xe7b8('0x1'))['db'][_0xe7b8('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe7b8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x204362){return function(_0x1aa3a5,_0x2217b7,_0x2b84a0){VoiceQueueReportEvents[_0xe7b8('0x4')](_0x204362+':'+_0x1aa3a5['id'],_0x1aa3a5);VoiceQueueReportEvents['emit'](_0x204362,_0x1aa3a5);_0x2b84a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xe7b8('0x5')](e,emitEvent(event));}}module[_0xe7b8('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x0de5=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x2cc8bb,_0x5f2607){var _0x140e40=function(_0x80d96d){while(--_0x80d96d){_0x2cc8bb['push'](_0x2cc8bb['shift']());}};_0x140e40(++_0x5f2607);}(_0x0de5,0x96));var _0x50de=function(_0x3e6f63,_0x5efaac){_0x3e6f63=_0x3e6f63-0x0;var _0x2791a6=_0x0de5[_0x3e6f63];return _0x2791a6;};'use strict';var EventEmitter=require(_0x50de('0x0'));var VoiceQueueReport=require(_0x50de('0x1'))['db'][_0x50de('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x50de('0x3')](0x0);var events={'afterCreate':_0x50de('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5ac694){return function(_0xf79479,_0x41e1af,_0x446c1f){VoiceQueueReportEvents['emit'](_0x5ac694+':'+_0xf79479['id'],_0xf79479);VoiceQueueReportEvents[_0x50de('0x5')](_0x5ac694,_0xf79479);_0x446c1f(null);};}for(var e in events){if(events[_0x50de('0x6')](e)){var event=events[e];VoiceQueueReport[_0x50de('0x7')](e,emitEvent(event));}}module[_0x50de('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 cad3091..8764f33 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 _0x8ee7=['request-promise','rimraf','../../config/environment','exports','define','report_queue','uniqueid','calleridnum','lodash','util','api'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8ee7,0x13c));var _0x78ee=function(_0x29b205,_0x5e23a5){_0x29b205=_0x29b205-0x0;var _0x172da9=_0x8ee7[_0x29b205];return _0x172da9;};'use strict';var _=require(_0x78ee('0x0'));var util=require(_0x78ee('0x1'));var logger=require('../../config/logger')(_0x78ee('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x78ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78ee('0x4'));var config=require(_0x78ee('0x5'));var attributes=require('./voiceQueueReport.attributes');module[_0x78ee('0x6')]=function(_0x29e22d,_0x25d5bd){return _0x29e22d[_0x78ee('0x7')]('VoiceQueueReport',attributes,{'tableName':_0x78ee('0x8'),'paranoid':![],'indexes':[{'fields':[_0x78ee('0x9')]},{'fields':[_0x78ee('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x356d=['VoiceQueueReport','report_queue','calleridnum','lodash','../../config/logger','api','moment','request-promise','rimraf','exports','define'];(function(_0x1a4df2,_0x3bd503){var _0x1f7156=function(_0x46a6cd){while(--_0x46a6cd){_0x1a4df2['push'](_0x1a4df2['shift']());}};_0x1f7156(++_0x3bd503);}(_0x356d,0x1e7));var _0xd356=function(_0x37f4d8,_0x4ec257){_0x37f4d8=_0x37f4d8-0x0;var _0x10ebd8=_0x356d[_0x37f4d8];return _0x10ebd8;};'use strict';var _=require(_0xd356('0x0'));var util=require('util');var logger=require(_0xd356('0x1'))(_0xd356('0x2'));var moment=require(_0xd356('0x3'));var BPromise=require('bluebird');var rp=require(_0xd356('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd356('0x5'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0xd356('0x6')]=function(_0xf34a3e,_0x13d8b8){return _0xf34a3e[_0xd356('0x7')](_0xd356('0x8'),attributes,{'tableName':_0xd356('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xd356('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index c3c33d0..03c1c4d 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 _0x63e4=['options','raw','where','attributes','limit','include','map','model','debug','CreateVoiceQueueReport','create','body','catch','UpdateVoiceQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','GetVoiceQueueReport','VoiceQueueReport','findAll'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x63e4,0x1ee));var _0x463e=function(_0x2b519a,_0x151566){_0x2b519a=_0x2b519a-0x0;var _0x44cd95=_0x63e4[_0x2b519a];return _0x44cd95;};'use strict';var _=require(_0x463e('0x0'));var util=require('util');var moment=require(_0x463e('0x1'));var BPromise=require(_0x463e('0x2'));var rs=require(_0x463e('0x3'));var fs=require('fs');var Redis=require(_0x463e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x463e('0x5'));var logger=require(_0x463e('0x6'))(_0x463e('0x7'));var config=require(_0x463e('0x8'));var jayson=require(_0x463e('0x9'));var client=jayson[_0x463e('0xa')]['http']({'port':0x232a});config[_0x463e('0xb')]=_[_0x463e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x463e('0xd'))(new Redis(config[_0x463e('0xb')]));require(_0x463e('0xe'))[_0x463e('0xf')](socket);function respondWithRpcPromise(_0x256ab6,_0x4c2724,_0x57e4cc){return new BPromise(function(_0x35c4f2,_0x503c6a){return client['request'](_0x256ab6,_0x57e4cc)[_0x463e('0x10')](function(_0x38de0d){logger['info'](_0x463e('0x11'),_0x4c2724,'request\x20sent');logger['debug'](_0x463e('0x12'),_0x4c2724,_0x463e('0x13'),JSON[_0x463e('0x14')](_0x38de0d));if(_0x38de0d['error']){if(_0x38de0d[_0x463e('0x15')]['code']===0x1f4){logger[_0x463e('0x15')](_0x463e('0x11'),_0x4c2724,_0x38de0d[_0x463e('0x15')][_0x463e('0x16')]);return _0x503c6a(_0x38de0d[_0x463e('0x15')][_0x463e('0x16')]);}logger[_0x463e('0x15')](_0x463e('0x11'),_0x4c2724,_0x38de0d[_0x463e('0x15')][_0x463e('0x16')]);return _0x35c4f2(_0x38de0d[_0x463e('0x15')][_0x463e('0x16')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x4c2724,'request\x20sent');_0x35c4f2(_0x38de0d['result'][_0x463e('0x16')]);}})['catch'](function(_0x551535){logger['error'](_0x463e('0x11'),_0x4c2724,_0x551535);_0x503c6a(_0x551535);});});}exports[_0x463e('0x17')]=function(_0x11d244){var _0x1dbb2d=this;return new Promise(function(_0x39a649,_0x253760){return db[_0x463e('0x18')][_0x463e('0x19')]({'raw':_0x11d244[_0x463e('0x1a')]?_0x11d244[_0x463e('0x1a')][_0x463e('0x1b')]===undefined?!![]:![]:!![],'where':_0x11d244['options']?_0x11d244['options'][_0x463e('0x1c')]||null:null,'attributes':_0x11d244[_0x463e('0x1a')]?_0x11d244[_0x463e('0x1a')][_0x463e('0x1d')]||null:null,'limit':_0x11d244[_0x463e('0x1a')]?_0x11d244['options'][_0x463e('0x1e')]||null:null,'include':_0x11d244[_0x463e('0x1a')]?_0x11d244['options'][_0x463e('0x1f')]?_['map'](_0x11d244[_0x463e('0x1a')][_0x463e('0x1f')],function(_0x32af4f){return{'model':db[_0x32af4f['model']],'as':_0x32af4f['as'],'attributes':_0x32af4f[_0x463e('0x1d')],'include':_0x32af4f['include']?_[_0x463e('0x20')](_0x32af4f[_0x463e('0x1f')],function(_0x59f35c){return{'model':db[_0x59f35c[_0x463e('0x21')]],'as':_0x59f35c['as'],'attributes':_0x59f35c[_0x463e('0x1d')],'include':_0x59f35c[_0x463e('0x1f')]?_[_0x463e('0x20')](_0x59f35c[_0x463e('0x1f')],function(_0x10dd15){return{'model':db[_0x10dd15[_0x463e('0x21')]],'as':_0x10dd15['as'],'attributes':_0x10dd15['attributes']};}):[]};}):[]};}):[]:[]})[_0x463e('0x10')](function(_0x2c9a30){logger['info'](_0x463e('0x17'),_0x11d244);logger[_0x463e('0x22')]('GetVoiceQueueReport',_0x11d244,JSON['stringify'](_0x2c9a30));_0x39a649(_0x2c9a30);})['catch'](function(_0x8fc9db){logger[_0x463e('0x15')](_0x463e('0x17'),_0x8fc9db[_0x463e('0x16')],_0x11d244);_0x253760(_0x1dbb2d['error'](0x1f4,_0x8fc9db[_0x463e('0x16')]));});});};exports[_0x463e('0x23')]=function(_0x2c5cc4){var _0x157fb6=this;return new Promise(function(_0x4c1269,_0x277184){return db['VoiceQueueReport'][_0x463e('0x24')](_0x2c5cc4[_0x463e('0x25')],{'raw':_0x2c5cc4[_0x463e('0x1a')]?_0x2c5cc4[_0x463e('0x1a')][_0x463e('0x1b')]===undefined?!![]:![]:!![]})[_0x463e('0x10')](function(_0x314f07){logger['info'](_0x463e('0x23'),_0x2c5cc4);logger['debug']('CreateVoiceQueueReport',_0x2c5cc4,JSON['stringify'](_0x314f07));_0x4c1269(_0x314f07);})[_0x463e('0x26')](function(_0x2b3100){logger['error'](_0x463e('0x23'),_0x2b3100[_0x463e('0x16')],_0x2c5cc4);_0x277184(_0x157fb6[_0x463e('0x15')](0x1f4,_0x2b3100['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x2c8e06){var _0x585d77=this;return new Promise(function(_0x4ad131,_0x93ba67){return db[_0x463e('0x18')]['update'](_0x2c8e06['body'],{'raw':_0x2c8e06['options']?_0x2c8e06[_0x463e('0x1a')][_0x463e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c8e06[_0x463e('0x1a')]?_0x2c8e06[_0x463e('0x1a')][_0x463e('0x1c')]||null:null,'attributes':_0x2c8e06[_0x463e('0x1a')]?_0x2c8e06[_0x463e('0x1a')][_0x463e('0x1d')]||null:null,'limit':_0x2c8e06[_0x463e('0x1a')]?_0x2c8e06[_0x463e('0x1a')]['limit']||null:null})[_0x463e('0x10')](function(_0x4f4c89){logger['info'](_0x463e('0x27'),_0x2c8e06);logger[_0x463e('0x22')](_0x463e('0x27'),_0x2c8e06,JSON['stringify'](_0x4f4c89));_0x4ad131(_0x4f4c89);})[_0x463e('0x26')](function(_0x13f928){logger[_0x463e('0x15')](_0x463e('0x27'),_0x13f928['message'],_0x2c8e06);_0x93ba67(_0x585d77[_0x463e('0x15')](0x1f4,_0x13f928[_0x463e('0x16')]));});});}; \ No newline at end of file +var _0x65c6=['socket.io-emitter','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueReport','options','raw','where','attributes','limit','include','map','model','debug','catch','CreateVoiceQueueReport','VoiceQueueReport','UpdateVoiceQueueReport','update','body','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x461467,_0x81d0dd){var _0x5c47da=function(_0x5a10a8){while(--_0x5a10a8){_0x461467['push'](_0x461467['shift']());}};_0x5c47da(++_0x81d0dd);}(_0x65c6,0x163));var _0x665c=function(_0x3b23e9,_0x33c788){_0x3b23e9=_0x3b23e9-0x0;var _0x5657ba=_0x65c6[_0x3b23e9];return _0x5657ba;};'use strict';var _=require(_0x665c('0x0'));var util=require(_0x665c('0x1'));var moment=require('moment');var BPromise=require(_0x665c('0x2'));var rs=require(_0x665c('0x3'));var fs=require('fs');var Redis=require(_0x665c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x665c('0x5'));var logger=require(_0x665c('0x6'))(_0x665c('0x7'));var config=require(_0x665c('0x8'));var jayson=require(_0x665c('0x9'));var client=jayson[_0x665c('0xa')][_0x665c('0xb')]({'port':0x232a});config[_0x665c('0xc')]=_[_0x665c('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x665c('0xe'))(new Redis(config[_0x665c('0xc')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x35ae9a,_0x3efbc8,_0x4b1965){return new BPromise(function(_0x166580,_0x19e96e){return client['request'](_0x35ae9a,_0x4b1965)[_0x665c('0xf')](function(_0x1be2d9){logger[_0x665c('0x10')](_0x665c('0x11'),_0x3efbc8,_0x665c('0x12'));logger['debug'](_0x665c('0x13'),_0x3efbc8,_0x665c('0x12'),JSON[_0x665c('0x14')](_0x1be2d9));if(_0x1be2d9[_0x665c('0x15')]){if(_0x1be2d9['error'][_0x665c('0x16')]===0x1f4){logger[_0x665c('0x15')](_0x665c('0x11'),_0x3efbc8,_0x1be2d9[_0x665c('0x15')][_0x665c('0x17')]);return _0x19e96e(_0x1be2d9[_0x665c('0x15')][_0x665c('0x17')]);}logger[_0x665c('0x15')](_0x665c('0x11'),_0x3efbc8,_0x1be2d9['error'][_0x665c('0x17')]);return _0x166580(_0x1be2d9['error'][_0x665c('0x17')]);}else{logger[_0x665c('0x10')](_0x665c('0x11'),_0x3efbc8,_0x665c('0x12'));_0x166580(_0x1be2d9[_0x665c('0x18')]['message']);}})['catch'](function(_0x6c9178){logger[_0x665c('0x15')](_0x665c('0x11'),_0x3efbc8,_0x6c9178);_0x19e96e(_0x6c9178);});});}exports[_0x665c('0x19')]=function(_0x52eaed){var _0x11f6cd=this;return new Promise(function(_0x34dd39,_0x17f41a){return db['VoiceQueueReport']['findAll']({'raw':_0x52eaed[_0x665c('0x1a')]?_0x52eaed['options'][_0x665c('0x1b')]===undefined?!![]:![]:!![],'where':_0x52eaed[_0x665c('0x1a')]?_0x52eaed['options'][_0x665c('0x1c')]||null:null,'attributes':_0x52eaed[_0x665c('0x1a')]?_0x52eaed[_0x665c('0x1a')][_0x665c('0x1d')]||null:null,'limit':_0x52eaed['options']?_0x52eaed['options'][_0x665c('0x1e')]||null:null,'include':_0x52eaed['options']?_0x52eaed[_0x665c('0x1a')][_0x665c('0x1f')]?_[_0x665c('0x20')](_0x52eaed[_0x665c('0x1a')]['include'],function(_0x24ef95){return{'model':db[_0x24ef95[_0x665c('0x21')]],'as':_0x24ef95['as'],'attributes':_0x24ef95[_0x665c('0x1d')],'include':_0x24ef95['include']?_[_0x665c('0x20')](_0x24ef95[_0x665c('0x1f')],function(_0x16ac60){return{'model':db[_0x16ac60['model']],'as':_0x16ac60['as'],'attributes':_0x16ac60[_0x665c('0x1d')],'include':_0x16ac60['include']?_[_0x665c('0x20')](_0x16ac60['include'],function(_0x5e3263){return{'model':db[_0x5e3263['model']],'as':_0x5e3263['as'],'attributes':_0x5e3263[_0x665c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x665c('0xf')](function(_0x433925){logger[_0x665c('0x10')]('GetVoiceQueueReport',_0x52eaed);logger[_0x665c('0x22')](_0x665c('0x19'),_0x52eaed,JSON['stringify'](_0x433925));_0x34dd39(_0x433925);})[_0x665c('0x23')](function(_0x3ee073){logger[_0x665c('0x15')]('GetVoiceQueueReport',_0x3ee073[_0x665c('0x17')],_0x52eaed);_0x17f41a(_0x11f6cd[_0x665c('0x15')](0x1f4,_0x3ee073[_0x665c('0x17')]));});});};exports[_0x665c('0x24')]=function(_0x19a7da){var _0xbd922d=this;return new Promise(function(_0x17326a,_0x32b618){return db[_0x665c('0x25')]['create'](_0x19a7da['body'],{'raw':_0x19a7da['options']?_0x19a7da[_0x665c('0x1a')][_0x665c('0x1b')]===undefined?!![]:![]:!![]})[_0x665c('0xf')](function(_0x4f00f2){logger[_0x665c('0x10')](_0x665c('0x24'),_0x19a7da);logger['debug'](_0x665c('0x24'),_0x19a7da,JSON[_0x665c('0x14')](_0x4f00f2));_0x17326a(_0x4f00f2);})[_0x665c('0x23')](function(_0x3cb7bd){logger[_0x665c('0x15')](_0x665c('0x24'),_0x3cb7bd[_0x665c('0x17')],_0x19a7da);_0x32b618(_0xbd922d[_0x665c('0x15')](0x1f4,_0x3cb7bd['message']));});});};exports[_0x665c('0x26')]=function(_0x18bb4a){var _0x13f3b8=this;return new Promise(function(_0x574d57,_0x3cd254){return db[_0x665c('0x25')][_0x665c('0x27')](_0x18bb4a[_0x665c('0x28')],{'raw':_0x18bb4a[_0x665c('0x1a')]?_0x18bb4a[_0x665c('0x1a')][_0x665c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18bb4a[_0x665c('0x1a')]?_0x18bb4a['options'][_0x665c('0x1c')]||null:null,'attributes':_0x18bb4a[_0x665c('0x1a')]?_0x18bb4a['options']['attributes']||null:null,'limit':_0x18bb4a['options']?_0x18bb4a[_0x665c('0x1a')][_0x665c('0x1e')]||null:null})[_0x665c('0xf')](function(_0x4b1bcd){logger[_0x665c('0x10')](_0x665c('0x26'),_0x18bb4a);logger[_0x665c('0x22')]('UpdateVoiceQueueReport',_0x18bb4a,JSON[_0x665c('0x14')](_0x4b1bcd));_0x574d57(_0x4b1bcd);})['catch'](function(_0x36ba3a){logger[_0x665c('0x15')]('UpdateVoiceQueueReport',_0x36ba3a[_0x665c('0x17')],_0x18bb4a);_0x3cd254(_0x13f3b8['error'](0x1f4,_0x36ba3a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 9dd9628..e3536ca 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 _0x330c=['remove','update','emit','removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x316ad3,_0x24e897){var _0x1d81e0=function(_0x218f04){while(--_0x218f04){_0x316ad3['push'](_0x316ad3['shift']());}};_0x1d81e0(++_0x24e897);}(_0x330c,0x186));var _0xc330=function(_0x27aafe,_0x53f25f){_0x27aafe=_0x27aafe-0x0;var _0x2cecae=_0x330c[_0x27aafe];return _0x2cecae;};'use strict';var VoiceQueueReportEvents=require(_0xc330('0x0'));var events=[_0xc330('0x1'),_0xc330('0x2'),_0xc330('0x3')];function createListener(_0x48e3fc,_0x17e47c){return function(_0x197a49){_0x17e47c[_0xc330('0x4')](_0x48e3fc,_0x197a49);};}function removeListener(_0x207daa,_0x3852b2){return function(){VoiceQueueReportEvents[_0xc330('0x5')](_0x207daa,_0x3852b2);};}exports['register']=function(_0x4f49fb){for(var _0x53d0ca=0x0,_0x1a6a2e=events[_0xc330('0x6')];_0x53d0ca<_0x1a6a2e;_0x53d0ca++){var _0x253c40=events[_0x53d0ca];var _0x114bf0=createListener(_0xc330('0x7')+_0x253c40,_0x4f49fb);VoiceQueueReportEvents['on'](_0x253c40,_0x114bf0);}}; \ No newline at end of file +var _0x3e03=['emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x25e625,_0x2a97e2){var _0x3312cb=function(_0x3294e8){while(--_0x3294e8){_0x25e625['push'](_0x25e625['shift']());}};_0x3312cb(++_0x2a97e2);}(_0x3e03,0xc2));var _0x33e0=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x3e03[_0x2de0a7];return _0x429437;};'use strict';var VoiceQueueReportEvents=require(_0x33e0('0x0'));var events=[_0x33e0('0x1'),'remove','update'];function createListener(_0x5a3614,_0x4837d6){return function(_0x5324e5){_0x4837d6[_0x33e0('0x2')](_0x5a3614,_0x5324e5);};}function removeListener(_0x5acfab,_0x221365){return function(){VoiceQueueReportEvents[_0x33e0('0x3')](_0x5acfab,_0x221365);};}exports[_0x33e0('0x4')]=function(_0x36609d){for(var _0x42a979=0x0,_0x558408=events[_0x33e0('0x5')];_0x42a979<_0x558408;_0x42a979++){var _0x577f2a=events[_0x42a979];var _0x2d0a79=createListener(_0x33e0('0x6')+_0x577f2a,_0x36609d);VoiceQueueReportEvents['on'](_0x577f2a,_0x2d0a79);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 698ee87..b9933fb 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 _0xbc12=['./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xbc12,0xc1));var _0x2bc1=function(_0x6f5598,_0xabeb74){_0x6f5598=_0x6f5598-0x0;var _0x1e1325=_0xbc12[_0x6f5598];return _0x1e1325;};'use strict';var multer=require(_0x2bc1('0x0'));var util=require(_0x2bc1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2bc1('0x2'));var router=express[_0x2bc1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2bc1('0x4'));var interaction=require(_0x2bc1('0x5'));var config=require(_0x2bc1('0x6'));var controller=require(_0x2bc1('0x7'));router[_0x2bc1('0x8')]('/',auth[_0x2bc1('0x9')](),controller[_0x2bc1('0xa')]);router[_0x2bc1('0x8')](_0x2bc1('0xb'),auth[_0x2bc1('0x9')](),controller[_0x2bc1('0xc')]);router[_0x2bc1('0xd')]('/',auth[_0x2bc1('0x9')](),controller[_0x2bc1('0xe')]);router[_0x2bc1('0xf')]('/:id',auth[_0x2bc1('0x9')](),controller[_0x2bc1('0x10')]);router[_0x2bc1('0x11')]('/:id',auth[_0x2bc1('0x9')](),controller[_0x2bc1('0x12')]);module[_0x2bc1('0x13')]=router; \ No newline at end of file +var _0x6da2=['update','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','index','isAuthenticated','show','post','create','/:id'];(function(_0x4513ff,_0x440322){var _0x21d3ba=function(_0x4b4427){while(--_0x4b4427){_0x4513ff['push'](_0x4513ff['shift']());}};_0x21d3ba(++_0x440322);}(_0x6da2,0xe1));var _0x26da=function(_0x499e28,_0x2d0c3e){_0x499e28=_0x499e28-0x0;var _0x4b8c09=_0x6da2[_0x499e28];return _0x4b8c09;};'use strict';var multer=require(_0x26da('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x26da('0x1'));var express=require(_0x26da('0x2'));var router=express[_0x26da('0x3')]();var fs_extra=require(_0x26da('0x4'));var auth=require(_0x26da('0x5'));var interaction=require(_0x26da('0x6'));var config=require('../../config/environment');var controller=require(_0x26da('0x7'));router[_0x26da('0x8')]('/',auth['isAuthenticated'](),controller[_0x26da('0x9')]);router[_0x26da('0x8')]('/:id',auth[_0x26da('0xa')](),controller[_0x26da('0xb')]);router[_0x26da('0xc')]('/',auth[_0x26da('0xa')](),controller[_0x26da('0xd')]);router['put'](_0x26da('0xe'),auth['isAuthenticated'](),controller[_0x26da('0xf')]);router['delete'](_0x26da('0xe'),auth[_0x26da('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 99683b3..6c2b15a 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 _0x47cc=['STRING','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0x2875be,_0x2bbadd){var _0x99e773=function(_0x352067){while(--_0x352067){_0x2875be['push'](_0x2875be['shift']());}};_0x99e773(++_0x2bbadd);}(_0x47cc,0xbe));var _0xc47c=function(_0x59dcdc,_0x182087){_0x59dcdc=_0x59dcdc-0x0;var _0x3a8c89=_0x47cc[_0x59dcdc];return _0x3a8c89;};'use strict';var Sequelize=require(_0xc47c('0x0'));var moment=require(_0xc47c('0x1'));module['exports']={'time':{'type':Sequelize[_0xc47c('0x2')]},'callid':{'type':Sequelize[_0xc47c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc47c('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc47c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xc47c('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc47c('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xc47c('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xc47c('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xc47c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['literal'](_0xc47c('0x3'))}}; \ No newline at end of file +var _0x4961=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING','DATE'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0x4961,0x160));var _0x1496=function(_0x5a1f56,_0x421466){_0x5a1f56=_0x5a1f56-0x0;var _0x52514c=_0x4961[_0x5a1f56];return _0x52514c;};'use strict';var Sequelize=require(_0x1496('0x0'));var moment=require(_0x1496('0x1'));module[_0x1496('0x2')]={'time':{'type':Sequelize[_0x1496('0x3')]},'callid':{'type':Sequelize[_0x1496('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x1496('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x1496('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x1496('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x1496('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x1496('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x1496('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x1496('0x5')](_0x1496('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 36cecca..0893172 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 _0xb036=['model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','length','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','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key'];(function(_0x3515c1,_0x3d7811){var _0x2dbc6d=function(_0x449de3){while(--_0x449de3){_0x3515c1['push'](_0x3515c1['shift']());}};_0x2dbc6d(++_0x3d7811);}(_0xb036,0x1cd));var _0x6b03=function(_0x41ed50,_0x84d266){_0x41ed50=_0x41ed50-0x0;var _0x77be00=_0xb036[_0x41ed50];return _0x77be00;};'use strict';var emlformat=require(_0x6b03('0x0'));var rimraf=require(_0x6b03('0x1'));var zipdir=require(_0x6b03('0x2'));var jsonpatch=require(_0x6b03('0x3'));var rp=require(_0x6b03('0x4'));var moment=require(_0x6b03('0x5'));var BPromise=require(_0x6b03('0x6'));var Mustache=require('mustache');var util=require(_0x6b03('0x7'));var path=require(_0x6b03('0x8'));var sox=require(_0x6b03('0x9'));var csv=require(_0x6b03('0xa'));var ejs=require(_0x6b03('0xb'));var fs=require('fs');var fs_extra=require(_0x6b03('0xc'));var _=require(_0x6b03('0xd'));var squel=require(_0x6b03('0xe'));var crypto=require('crypto');var jsforce=require(_0x6b03('0xf'));var deskjs=require(_0x6b03('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6b03('0x11'));var Papa=require(_0x6b03('0x12'));var Redis=require(_0x6b03('0x13'));var authService=require(_0x6b03('0x14'));var qs=require(_0x6b03('0x15'));var as=require(_0x6b03('0x16'));var hardwareService=require(_0x6b03('0x17'));var logger=require('../../config/logger')(_0x6b03('0x18'));var utils=require(_0x6b03('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cf37f,_0x3a711d){_0x3a711d=_0x3a711d||0xcc;return function(_0x58fe2a){if(_0x58fe2a){return _0x1cf37f[_0x6b03('0x1a')](_0x3a711d);}return _0x1cf37f[_0x6b03('0x1b')](_0x3a711d)[_0x6b03('0x1c')]();};}function respondWithResult(_0x407fbc,_0x569138){_0x569138=_0x569138||0xc8;return function(_0x188a28){if(_0x188a28){return _0x407fbc[_0x6b03('0x1b')](_0x569138)['json'](_0x188a28);}};}function respondWithFilteredResult(_0x4309fd,_0x340638){return function(_0x56a1d7){if(_0x56a1d7){var _0x57a1f2=typeof _0x340638[_0x6b03('0x1d')]===_0x6b03('0x1e')&&typeof _0x340638[_0x6b03('0x1f')]===_0x6b03('0x1e');var _0x15d30a=_0x56a1d7['count'];var _0x14c367=_0x57a1f2?0x0:_0x340638[_0x6b03('0x1d')];var _0x168ab5=_0x57a1f2?_0x56a1d7[_0x6b03('0x20')]:_0x340638[_0x6b03('0x1d')]+_0x340638['limit'];var _0xe01996;if(_0x168ab5>=_0x15d30a){_0x168ab5=_0x15d30a;_0xe01996=0xc8;}else{_0xe01996=0xce;}_0x4309fd[_0x6b03('0x1b')](_0xe01996);return _0x4309fd['set']('Content-Range',_0x14c367+'-'+_0x168ab5+'/'+_0x15d30a)[_0x6b03('0x21')](_0x56a1d7);}return null;};}function patchUpdates(_0x2761fa){return function(_0x2f591e){try{jsonpatch[_0x6b03('0x22')](_0x2f591e,_0x2761fa,!![]);}catch(_0x30d097){return BPromise[_0x6b03('0x23')](_0x30d097);}return _0x2f591e[_0x6b03('0x24')]();};}function saveUpdates(_0x1a3737,_0x465ca8){return function(_0x3f46d0){if(_0x3f46d0){return _0x3f46d0['update'](_0x1a3737)['then'](function(_0x95cec9){return _0x95cec9;});}return null;};}function removeEntity(_0x2f8e8a,_0x569ea9){return function(_0x5859b4){if(_0x5859b4){return _0x5859b4[_0x6b03('0x25')]()[_0x6b03('0x26')](function(){_0x2f8e8a[_0x6b03('0x1b')](0xcc)[_0x6b03('0x1c')]();});}};}function handleEntityNotFound(_0x3af167,_0x127207){return function(_0x3ac996){if(!_0x3ac996){_0x3af167[_0x6b03('0x1a')](0x194);}return _0x3ac996;};}function handleError(_0x26543e,_0x582a52){_0x582a52=_0x582a52||0x1f4;return function(_0x1b3ab3){logger[_0x6b03('0x27')](_0x1b3ab3[_0x6b03('0x28')]);if(_0x1b3ab3[_0x6b03('0x29')]){delete _0x1b3ab3[_0x6b03('0x29')];}_0x26543e[_0x6b03('0x1b')](_0x582a52)[_0x6b03('0x2a')](_0x1b3ab3);};}exports[_0x6b03('0x2b')]=function(_0x5c43b3,_0x3b2ef9){var _0x14fbdc={},_0x30f203={},_0x25df64={'count':0x0,'rows':[]};var _0x179861=_[_0x6b03('0x2c')](db[_0x6b03('0x2d')][_0x6b03('0x2e')],function(_0x40ef74){return{'name':_0x40ef74[_0x6b03('0x2f')],'type':_0x40ef74[_0x6b03('0x30')][_0x6b03('0x31')]};});_0x30f203[_0x6b03('0x32')]=_[_0x6b03('0x2c')](_0x179861,_0x6b03('0x29'));_0x30f203[_0x6b03('0x33')]=_[_0x6b03('0x34')](_0x5c43b3[_0x6b03('0x33')]);_0x30f203[_0x6b03('0x35')]=_[_0x6b03('0x36')](_0x30f203[_0x6b03('0x32')],_0x30f203['query']);_0x14fbdc[_0x6b03('0x37')]=_['intersection'](_0x30f203['model'],qs[_0x6b03('0x38')](_0x5c43b3[_0x6b03('0x33')][_0x6b03('0x38')]));_0x14fbdc[_0x6b03('0x37')]=_0x14fbdc[_0x6b03('0x37')]['length']?_0x14fbdc[_0x6b03('0x37')]:_0x30f203[_0x6b03('0x32')];if(!_0x5c43b3[_0x6b03('0x33')]['hasOwnProperty']('nolimit')){_0x14fbdc[_0x6b03('0x1f')]=qs[_0x6b03('0x1f')](_0x5c43b3[_0x6b03('0x33')][_0x6b03('0x1f')]);_0x14fbdc[_0x6b03('0x1d')]=qs[_0x6b03('0x1d')](_0x5c43b3[_0x6b03('0x33')]['offset']);}_0x14fbdc[_0x6b03('0x39')]=qs[_0x6b03('0x3a')](_0x5c43b3[_0x6b03('0x33')][_0x6b03('0x3a')]);_0x14fbdc['where']=qs[_0x6b03('0x35')](_['pick'](_0x5c43b3[_0x6b03('0x33')],_0x30f203[_0x6b03('0x35')]),_0x179861);if(_0x5c43b3['query']['filter']){_0x14fbdc['where']=_['merge'](_0x14fbdc[_0x6b03('0x3b')],{'$or':_[_0x6b03('0x2c')](_0x179861,function(_0x32a976){if(_0x32a976['type']!=='VIRTUAL'){var _0x4107ca={};_0x4107ca[_0x32a976[_0x6b03('0x29')]]={'$like':'%'+_0x5c43b3[_0x6b03('0x33')][_0x6b03('0x3c')]+'%'};return _0x4107ca;}})});}_0x14fbdc=_[_0x6b03('0x3d')]({},_0x14fbdc,_0x5c43b3[_0x6b03('0x3e')]);var _0x24d20a={'where':_0x14fbdc[_0x6b03('0x3b')]};return db[_0x6b03('0x2d')][_0x6b03('0x20')](_0x24d20a)[_0x6b03('0x26')](function(_0x8dd138){_0x25df64['count']=_0x8dd138;if(_0x5c43b3[_0x6b03('0x33')]['includeAll']){_0x14fbdc[_0x6b03('0x3f')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x6b03('0x40')](_0x14fbdc);})[_0x6b03('0x26')](function(_0xa94305){_0x25df64[_0x6b03('0x41')]=_0xa94305;return _0x25df64;})[_0x6b03('0x26')](respondWithFilteredResult(_0x3b2ef9,_0x14fbdc))[_0x6b03('0x42')](handleError(_0x3b2ef9,null));};exports[_0x6b03('0x43')]=function(_0x471dde,_0xad7b8e){var _0x5332db={'raw':!![],'where':{'id':_0x471dde[_0x6b03('0x44')]['id']}},_0x28190d={};_0x28190d[_0x6b03('0x32')]=_['keys'](db['VoiceQueuesLog']['rawAttributes']);_0x28190d[_0x6b03('0x33')]=_[_0x6b03('0x34')](_0x471dde[_0x6b03('0x33')]);_0x28190d[_0x6b03('0x35')]=_[_0x6b03('0x36')](_0x28190d[_0x6b03('0x32')],_0x28190d[_0x6b03('0x33')]);_0x5332db['attributes']=_[_0x6b03('0x36')](_0x28190d[_0x6b03('0x32')],qs[_0x6b03('0x38')](_0x471dde[_0x6b03('0x33')][_0x6b03('0x38')]));_0x5332db[_0x6b03('0x37')]=_0x5332db[_0x6b03('0x37')][_0x6b03('0x45')]?_0x5332db[_0x6b03('0x37')]:_0x28190d[_0x6b03('0x32')];if(_0x471dde[_0x6b03('0x33')]['includeAll']){_0x5332db[_0x6b03('0x3f')]=[{'all':!![]}];}_0x5332db=_[_0x6b03('0x3d')]({},_0x5332db,_0x471dde['options']);return db[_0x6b03('0x2d')][_0x6b03('0x46')](_0x5332db)[_0x6b03('0x26')](handleEntityNotFound(_0xad7b8e,null))[_0x6b03('0x26')](respondWithResult(_0xad7b8e,null))[_0x6b03('0x42')](handleError(_0xad7b8e,null));};exports[_0x6b03('0x47')]=function(_0x3d3a50,_0x2e3174){return db[_0x6b03('0x2d')][_0x6b03('0x47')](_0x3d3a50['body'],{})[_0x6b03('0x26')](respondWithResult(_0x2e3174,0xc9))[_0x6b03('0x42')](handleError(_0x2e3174,null));};exports['update']=function(_0xcb9f7,_0x1d3c7b){if(_0xcb9f7[_0x6b03('0x48')]['id']){delete _0xcb9f7[_0x6b03('0x48')]['id'];}return db[_0x6b03('0x2d')][_0x6b03('0x46')]({'where':{'id':_0xcb9f7[_0x6b03('0x44')]['id']}})[_0x6b03('0x26')](handleEntityNotFound(_0x1d3c7b,null))['then'](saveUpdates(_0xcb9f7[_0x6b03('0x48')],null))[_0x6b03('0x26')](respondWithResult(_0x1d3c7b,null))['catch'](handleError(_0x1d3c7b,null));};exports[_0x6b03('0x25')]=function(_0x2c18dc,_0x34c315){return db['VoiceQueuesLog'][_0x6b03('0x46')]({'where':{'id':_0x2c18dc[_0x6b03('0x44')]['id']}})[_0x6b03('0x26')](handleEntityNotFound(_0x34c315,null))[_0x6b03('0x26')](removeEntity(_0x34c315,null))[_0x6b03('0x42')](handleError(_0x34c315,null));}; \ No newline at end of file +var _0x287d=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x26c643,_0x2c784a){var _0xb49398=function(_0x4ea624){while(--_0x4ea624){_0x26c643['push'](_0x26c643['shift']());}};_0xb49398(++_0x2c784a);}(_0x287d,0xf4));var _0xd287=function(_0x2ff8e3,_0x15553b){_0x2ff8e3=_0x2ff8e3-0x0;var _0x2f60b5=_0x287d[_0x2ff8e3];return _0x2f60b5;};'use strict';var emlformat=require(_0xd287('0x0'));var rimraf=require(_0xd287('0x1'));var zipdir=require(_0xd287('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd287('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd287('0x4'));var util=require(_0xd287('0x5'));var path=require(_0xd287('0x6'));var sox=require(_0xd287('0x7'));var csv=require(_0xd287('0x8'));var ejs=require(_0xd287('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd287('0xa'));var squel=require(_0xd287('0xb'));var crypto=require(_0xd287('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd287('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd287('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd287('0xf'));var hardwareService=require(_0xd287('0x10'));var logger=require(_0xd287('0x11'))(_0xd287('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd287('0x13'));var db=require(_0xd287('0x14'))['db'];function respondWithStatusCode(_0x1d9618,_0x37ce61){_0x37ce61=_0x37ce61||0xcc;return function(_0x2c2f29){if(_0x2c2f29){return _0x1d9618[_0xd287('0x15')](_0x37ce61);}return _0x1d9618[_0xd287('0x16')](_0x37ce61)[_0xd287('0x17')]();};}function respondWithResult(_0xacf85c,_0x31f313){_0x31f313=_0x31f313||0xc8;return function(_0x30c09d){if(_0x30c09d){return _0xacf85c['status'](_0x31f313)[_0xd287('0x18')](_0x30c09d);}};}function respondWithFilteredResult(_0x1d3f1a,_0x50458e){return function(_0x587cd0){if(_0x587cd0){var _0x20df26=typeof _0x50458e[_0xd287('0x19')]==='undefined'&&typeof _0x50458e[_0xd287('0x1a')]===_0xd287('0x1b');var _0x18d8f5=_0x587cd0[_0xd287('0x1c')];var _0x2e404a=_0x20df26?0x0:_0x50458e[_0xd287('0x19')];var _0x3acc72=_0x20df26?_0x587cd0[_0xd287('0x1c')]:_0x50458e[_0xd287('0x19')]+_0x50458e[_0xd287('0x1a')];var _0x14faf5;if(_0x3acc72>=_0x18d8f5){_0x3acc72=_0x18d8f5;_0x14faf5=0xc8;}else{_0x14faf5=0xce;}_0x1d3f1a[_0xd287('0x16')](_0x14faf5);return _0x1d3f1a[_0xd287('0x1d')](_0xd287('0x1e'),_0x2e404a+'-'+_0x3acc72+'/'+_0x18d8f5)[_0xd287('0x18')](_0x587cd0);}return null;};}function patchUpdates(_0x42d16d){return function(_0x5cd29f){try{jsonpatch[_0xd287('0x1f')](_0x5cd29f,_0x42d16d,!![]);}catch(_0xa96f0d){return BPromise[_0xd287('0x20')](_0xa96f0d);}return _0x5cd29f[_0xd287('0x21')]();};}function saveUpdates(_0x41770a,_0x41d822){return function(_0x114ddd){if(_0x114ddd){return _0x114ddd[_0xd287('0x22')](_0x41770a)[_0xd287('0x23')](function(_0x442f50){return _0x442f50;});}return null;};}function removeEntity(_0x4685bf,_0x18b8ae){return function(_0x4dbf49){if(_0x4dbf49){return _0x4dbf49[_0xd287('0x24')]()[_0xd287('0x23')](function(){_0x4685bf[_0xd287('0x16')](0xcc)[_0xd287('0x17')]();});}};}function handleEntityNotFound(_0x2ab7ce,_0x79c77){return function(_0x5c759a){if(!_0x5c759a){_0x2ab7ce[_0xd287('0x15')](0x194);}return _0x5c759a;};}function handleError(_0x272f8d,_0x467a82){_0x467a82=_0x467a82||0x1f4;return function(_0x45341c){logger[_0xd287('0x25')](_0x45341c[_0xd287('0x26')]);if(_0x45341c[_0xd287('0x27')]){delete _0x45341c[_0xd287('0x27')];}_0x272f8d['status'](_0x467a82)['send'](_0x45341c);};}exports[_0xd287('0x28')]=function(_0x24f60f,_0x43d546){var _0x79a399={},_0x53127e={},_0x2cd1a8={'count':0x0,'rows':[]};var _0x1f177c=_[_0xd287('0x29')](db[_0xd287('0x2a')][_0xd287('0x2b')],function(_0x2c6728){return{'name':_0x2c6728[_0xd287('0x2c')],'type':_0x2c6728[_0xd287('0x2d')][_0xd287('0x2e')]};});_0x53127e[_0xd287('0x2f')]=_[_0xd287('0x29')](_0x1f177c,'name');_0x53127e[_0xd287('0x30')]=_[_0xd287('0x31')](_0x24f60f[_0xd287('0x30')]);_0x53127e[_0xd287('0x32')]=_[_0xd287('0x33')](_0x53127e[_0xd287('0x2f')],_0x53127e['query']);_0x79a399[_0xd287('0x34')]=_['intersection'](_0x53127e[_0xd287('0x2f')],qs[_0xd287('0x35')](_0x24f60f[_0xd287('0x30')][_0xd287('0x35')]));_0x79a399[_0xd287('0x34')]=_0x79a399[_0xd287('0x34')][_0xd287('0x36')]?_0x79a399[_0xd287('0x34')]:_0x53127e[_0xd287('0x2f')];if(!_0x24f60f[_0xd287('0x30')][_0xd287('0x37')](_0xd287('0x38'))){_0x79a399[_0xd287('0x1a')]=qs[_0xd287('0x1a')](_0x24f60f[_0xd287('0x30')][_0xd287('0x1a')]);_0x79a399[_0xd287('0x19')]=qs[_0xd287('0x19')](_0x24f60f[_0xd287('0x30')][_0xd287('0x19')]);}_0x79a399[_0xd287('0x39')]=qs[_0xd287('0x3a')](_0x24f60f[_0xd287('0x30')][_0xd287('0x3a')]);_0x79a399[_0xd287('0x3b')]=qs[_0xd287('0x32')](_[_0xd287('0x3c')](_0x24f60f[_0xd287('0x30')],_0x53127e[_0xd287('0x32')]),_0x1f177c);if(_0x24f60f[_0xd287('0x30')][_0xd287('0x3d')]){_0x79a399[_0xd287('0x3b')]=_[_0xd287('0x3e')](_0x79a399[_0xd287('0x3b')],{'$or':_[_0xd287('0x29')](_0x1f177c,function(_0xcf14ff){if(_0xcf14ff['type']!=='VIRTUAL'){var _0x5bc126={};_0x5bc126[_0xcf14ff['name']]={'$like':'%'+_0x24f60f[_0xd287('0x30')][_0xd287('0x3d')]+'%'};return _0x5bc126;}})});}_0x79a399=_[_0xd287('0x3e')]({},_0x79a399,_0x24f60f[_0xd287('0x3f')]);var _0x5af393={'where':_0x79a399[_0xd287('0x3b')]};return db['VoiceQueuesLog'][_0xd287('0x1c')](_0x5af393)[_0xd287('0x23')](function(_0xb9e5b9){_0x2cd1a8[_0xd287('0x1c')]=_0xb9e5b9;if(_0x24f60f['query'][_0xd287('0x40')]){_0x79a399[_0xd287('0x41')]=[{'all':!![]}];}return db[_0xd287('0x2a')][_0xd287('0x42')](_0x79a399);})['then'](function(_0x373d85){_0x2cd1a8[_0xd287('0x43')]=_0x373d85;return _0x2cd1a8;})[_0xd287('0x23')](respondWithFilteredResult(_0x43d546,_0x79a399))[_0xd287('0x44')](handleError(_0x43d546,null));};exports[_0xd287('0x45')]=function(_0x6723e7,_0x4bf5a5){var _0x40d564={'raw':!![],'where':{'id':_0x6723e7[_0xd287('0x46')]['id']}},_0x3b8aad={};_0x3b8aad[_0xd287('0x2f')]=_[_0xd287('0x31')](db['VoiceQueuesLog'][_0xd287('0x2b')]);_0x3b8aad['query']=_[_0xd287('0x31')](_0x6723e7[_0xd287('0x30')]);_0x3b8aad[_0xd287('0x32')]=_[_0xd287('0x33')](_0x3b8aad[_0xd287('0x2f')],_0x3b8aad[_0xd287('0x30')]);_0x40d564[_0xd287('0x34')]=_['intersection'](_0x3b8aad[_0xd287('0x2f')],qs[_0xd287('0x35')](_0x6723e7[_0xd287('0x30')][_0xd287('0x35')]));_0x40d564['attributes']=_0x40d564['attributes']['length']?_0x40d564[_0xd287('0x34')]:_0x3b8aad[_0xd287('0x2f')];if(_0x6723e7['query'][_0xd287('0x40')]){_0x40d564[_0xd287('0x41')]=[{'all':!![]}];}_0x40d564=_[_0xd287('0x3e')]({},_0x40d564,_0x6723e7[_0xd287('0x3f')]);return db['VoiceQueuesLog'][_0xd287('0x47')](_0x40d564)[_0xd287('0x23')](handleEntityNotFound(_0x4bf5a5,null))['then'](respondWithResult(_0x4bf5a5,null))[_0xd287('0x44')](handleError(_0x4bf5a5,null));};exports[_0xd287('0x48')]=function(_0x20ec13,_0x3dd0d1){return db[_0xd287('0x2a')][_0xd287('0x48')](_0x20ec13[_0xd287('0x49')],{})['then'](respondWithResult(_0x3dd0d1,0xc9))[_0xd287('0x44')](handleError(_0x3dd0d1,null));};exports[_0xd287('0x22')]=function(_0x4fed65,_0x5eaf01){if(_0x4fed65['body']['id']){delete _0x4fed65[_0xd287('0x49')]['id'];}return db[_0xd287('0x2a')][_0xd287('0x47')]({'where':{'id':_0x4fed65[_0xd287('0x46')]['id']}})[_0xd287('0x23')](handleEntityNotFound(_0x5eaf01,null))['then'](saveUpdates(_0x4fed65[_0xd287('0x49')],null))[_0xd287('0x23')](respondWithResult(_0x5eaf01,null))[_0xd287('0x44')](handleError(_0x5eaf01,null));};exports[_0xd287('0x24')]=function(_0x31d8a1,_0x214c46){return db[_0xd287('0x2a')][_0xd287('0x47')]({'where':{'id':_0x31d8a1[_0xd287('0x46')]['id']}})[_0xd287('0x23')](handleEntityNotFound(_0x214c46,null))['then'](removeEntity(_0x214c46,null))[_0xd287('0x44')](handleError(_0x214c46,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 09cfdf1..0671aa8 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 _0xe3f3=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash'];(function(_0x57f265,_0x1e5714){var _0x1d0f28=function(_0x1f37a5){while(--_0x1f37a5){_0x57f265['push'](_0x57f265['shift']());}};_0x1d0f28(++_0x1e5714);}(_0xe3f3,0xed));var _0x3e3f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe3f3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var logger=require(_0x3e3f('0x2'))(_0x3e3f('0x3'));var moment=require(_0x3e3f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e3f('0x5'));var fs=require('fs');var path=require(_0x3e3f('0x6'));var rimraf=require(_0x3e3f('0x7'));var config=require(_0x3e3f('0x8'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x5e6f11,_0x3f3536){return _0x5e6f11['define'](_0x3e3f('0x9'),attributes,{'tableName':_0x3e3f('0xa'),'paranoid':![],'indexes':[{'name':_0x3e3f('0xb'),'fields':[_0x3e3f('0xc'),_0x3e3f('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2da1=['exports','define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util','api','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes'];(function(_0x176d4a,_0x3f14e0){var _0x44b481=function(_0x5c2209){while(--_0x5c2209){_0x176d4a['push'](_0x176d4a['shift']());}};_0x44b481(++_0x3f14e0);}(_0x2da1,0xca));var _0x12da=function(_0x2eaf4d,_0x2a3aac){_0x2eaf4d=_0x2eaf4d-0x0;var _0x2bd85e=_0x2da1[_0x2eaf4d];return _0x2bd85e;};'use strict';var _=require(_0x12da('0x0'));var util=require(_0x12da('0x1'));var logger=require('../../config/logger')(_0x12da('0x2'));var moment=require('moment');var BPromise=require(_0x12da('0x3'));var rp=require(_0x12da('0x4'));var fs=require('fs');var path=require(_0x12da('0x5'));var rimraf=require(_0x12da('0x6'));var config=require('../../config/environment');var attributes=require(_0x12da('0x7'));module[_0x12da('0x8')]=function(_0x31175b,_0x3b7ea1){return _0x31175b[_0x12da('0x9')](_0x12da('0xa'),attributes,{'tableName':_0x12da('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x12da('0xc'),_0x12da('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 63f1150..30bada8 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 _0xc4a7=['request\x20sent','debug','error','message','VoiceQueuesLog,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2c6e1a,_0x4d25da){var _0x2387ff=function(_0x3917bd){while(--_0x3917bd){_0x2c6e1a['push'](_0x2c6e1a['shift']());}};_0x2387ff(++_0x4d25da);}(_0xc4a7,0x132));var _0x7c4a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc4a7[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7c4a('0x0'));var util=require(_0x7c4a('0x1'));var moment=require(_0x7c4a('0x2'));var BPromise=require(_0x7c4a('0x3'));var rs=require(_0x7c4a('0x4'));var fs=require('fs');var Redis=require(_0x7c4a('0x5'));var db=require(_0x7c4a('0x6'))['db'];var utils=require(_0x7c4a('0x7'));var logger=require(_0x7c4a('0x8'))('rpc');var config=require(_0x7c4a('0x9'));var jayson=require(_0x7c4a('0xa'));var client=jayson[_0x7c4a('0xb')][_0x7c4a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x476976,_0x94493,_0x4c5c6c){return new BPromise(function(_0x19a858,_0x466b4e){return client[_0x7c4a('0xd')](_0x476976,_0x4c5c6c)[_0x7c4a('0xe')](function(_0x18491d){logger[_0x7c4a('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x94493,_0x7c4a('0x10'));logger[_0x7c4a('0x11')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x94493,_0x7c4a('0x10'),JSON['stringify'](_0x18491d));if(_0x18491d[_0x7c4a('0x12')]){if(_0x18491d[_0x7c4a('0x12')]['code']===0x1f4){logger[_0x7c4a('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x94493,_0x18491d[_0x7c4a('0x12')]['message']);return _0x466b4e(_0x18491d[_0x7c4a('0x12')][_0x7c4a('0x13')]);}logger[_0x7c4a('0x12')](_0x7c4a('0x14'),_0x94493,_0x18491d[_0x7c4a('0x12')][_0x7c4a('0x13')]);return _0x19a858(_0x18491d['error']['message']);}else{logger[_0x7c4a('0xf')](_0x7c4a('0x14'),_0x94493,_0x7c4a('0x10'));_0x19a858(_0x18491d[_0x7c4a('0x15')][_0x7c4a('0x13')]);}})[_0x7c4a('0x16')](function(_0x35bf34){logger[_0x7c4a('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x94493,_0x35bf34);_0x466b4e(_0x35bf34);});});} \ No newline at end of file +var _0xc14d=['client','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xf2267d,_0x10c87c){var _0x207e0d=function(_0x12b23d){while(--_0x12b23d){_0xf2267d['push'](_0xf2267d['shift']());}};_0x207e0d(++_0x10c87c);}(_0xc14d,0x1ea));var _0xdc14=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc14d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdc14('0x0'));var BPromise=require(_0xdc14('0x1'));var rs=require(_0xdc14('0x2'));var fs=require('fs');var Redis=require(_0xdc14('0x3'));var db=require(_0xdc14('0x4'))['db'];var utils=require(_0xdc14('0x5'));var logger=require(_0xdc14('0x6'))(_0xdc14('0x7'));var config=require(_0xdc14('0x8'));var jayson=require(_0xdc14('0x9'));var client=jayson[_0xdc14('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ccbeb,_0x5ea03a,_0x640301){return new BPromise(function(_0x17f400,_0xeed4e1){return client['request'](_0x3ccbeb,_0x640301)[_0xdc14('0xb')](function(_0x116341){logger[_0xdc14('0xc')](_0xdc14('0xd'),_0x5ea03a,'request\x20sent');logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5ea03a,_0xdc14('0xe'),JSON[_0xdc14('0xf')](_0x116341));if(_0x116341[_0xdc14('0x10')]){if(_0x116341['error'][_0xdc14('0x11')]===0x1f4){logger[_0xdc14('0x10')](_0xdc14('0xd'),_0x5ea03a,_0x116341['error'][_0xdc14('0x12')]);return _0xeed4e1(_0x116341[_0xdc14('0x10')]['message']);}logger['error'](_0xdc14('0xd'),_0x5ea03a,_0x116341['error']['message']);return _0x17f400(_0x116341[_0xdc14('0x10')]['message']);}else{logger[_0xdc14('0xc')](_0xdc14('0xd'),_0x5ea03a,'request\x20sent');_0x17f400(_0x116341[_0xdc14('0x13')][_0xdc14('0x12')]);}})['catch'](function(_0x329506){logger[_0xdc14('0x10')](_0xdc14('0xd'),_0x5ea03a,_0x329506);_0xeed4e1(_0x329506);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 322d659..565ca3f 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 _0xd204=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','/:id','show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service'];(function(_0x4dc8ad,_0x106f6c){var _0x54db53=function(_0x178d2c){while(--_0x178d2c){_0x4dc8ad['push'](_0x4dc8ad['shift']());}};_0x54db53(++_0x106f6c);}(_0xd204,0x1a5));var _0x4d20=function(_0x43eb33,_0x1733f1){_0x43eb33=_0x43eb33-0x0;var _0x873cab=_0xd204[_0x43eb33];return _0x873cab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4d20('0x0'));var timeout=require('connect-timeout');var express=require(_0x4d20('0x1'));var router=express[_0x4d20('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4d20('0x3'));var interaction=require(_0x4d20('0x4'));var config=require(_0x4d20('0x5'));var controller=require(_0x4d20('0x6'));router[_0x4d20('0x7')]('/',auth[_0x4d20('0x8')](),controller['index']);router[_0x4d20('0x7')](_0x4d20('0x9'),auth[_0x4d20('0x8')](),controller['describe']);router['get'](_0x4d20('0xa'),auth[_0x4d20('0x8')](),controller[_0x4d20('0xb')]);router['get'](_0x4d20('0xc'),auth[_0x4d20('0x8')](),controller[_0x4d20('0xd')]);router[_0x4d20('0x7')]('/:id/downloads',controller[_0x4d20('0xe')]);router[_0x4d20('0x7')](_0x4d20('0xf'),auth[_0x4d20('0x8')](),controller[_0x4d20('0x10')]);router[_0x4d20('0x11')]('/',auth[_0x4d20('0x8')](),controller[_0x4d20('0x12')]);router[_0x4d20('0x11')](_0x4d20('0xf'),auth[_0x4d20('0x8')](),controller[_0x4d20('0x13')]);router[_0x4d20('0x14')](_0x4d20('0xa'),auth[_0x4d20('0x8')](),controller[_0x4d20('0x15')]);router[_0x4d20('0x16')](_0x4d20('0xa'),auth[_0x4d20('0x8')](),controller[_0x4d20('0x17')]);module[_0x4d20('0x18')]=router; \ No newline at end of file +var _0x9dd9=['delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','index','/describe','isAuthenticated','show','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','runTranscribe','put','/:id','update'];(function(_0x1ab597,_0x59629f){var _0xec975e=function(_0x49196c){while(--_0x49196c){_0x1ab597['push'](_0x1ab597['shift']());}};_0xec975e(++_0x59629f);}(_0x9dd9,0x160));var _0x99dd=function(_0x1194ca,_0x2d59d6){_0x1194ca=_0x1194ca-0x0;var _0x12c564=_0x9dd9[_0x1194ca];return _0x12c564;};'use strict';var multer=require(_0x99dd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x99dd('0x1'));var express=require(_0x99dd('0x2'));var router=express[_0x99dd('0x3')]();var fs_extra=require(_0x99dd('0x4'));var auth=require(_0x99dd('0x5'));var interaction=require(_0x99dd('0x6'));var config=require('../../config/environment');var controller=require(_0x99dd('0x7'));router[_0x99dd('0x8')]('/',auth['isAuthenticated'](),controller[_0x99dd('0x9')]);router['get'](_0x99dd('0xa'),auth[_0x99dd('0xb')](),controller['describe']);router[_0x99dd('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x99dd('0xc')]);router[_0x99dd('0x8')](_0x99dd('0xd'),auth[_0x99dd('0xb')](),controller[_0x99dd('0xe')]);router[_0x99dd('0x8')](_0x99dd('0xf'),controller['downloads']);router[_0x99dd('0x8')]('/:id/transcribe',auth[_0x99dd('0xb')](),controller[_0x99dd('0x10')]);router[_0x99dd('0x11')]('/',auth['isAuthenticated'](),controller[_0x99dd('0x12')]);router[_0x99dd('0x11')]('/:id/transcribe',auth[_0x99dd('0xb')](),controller[_0x99dd('0x13')]);router[_0x99dd('0x14')](_0x99dd('0x15'),auth[_0x99dd('0xb')](),controller[_0x99dd('0x16')]);router[_0x99dd('0x17')](_0x99dd('0x15'),auth[_0x99dd('0xb')](),controller[_0x99dd('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index e06435e..09f558c 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(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 0ad7ade..9701d83 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 _0x27bb=['\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','ValidationError','filename','download','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','push','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22'];(function(_0x993095,_0x10528f){var _0x84f877=function(_0x190986){while(--_0x190986){_0x993095['push'](_0x993095['shift']());}};_0x84f877(++_0x10528f);}(_0x27bb,0x162));var _0xb27b=function(_0x4738f9,_0x57f171){_0x4738f9=_0x4738f9-0x0;var _0x61d357=_0x27bb[_0x4738f9];return _0x61d357;};'use strict';var emlformat=require(_0xb27b('0x0'));var rimraf=require(_0xb27b('0x1'));var zipdir=require(_0xb27b('0x2'));var jsonpatch=require(_0xb27b('0x3'));var rp=require(_0xb27b('0x4'));var moment=require(_0xb27b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb27b('0x6'));var sox=require(_0xb27b('0x7'));var csv=require(_0xb27b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb27b('0x9'));var _=require(_0xb27b('0xa'));var squel=require('squel');var crypto=require(_0xb27b('0xb'));var jsforce=require(_0xb27b('0xc'));var deskjs=require(_0xb27b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb27b('0xe'));var Papa=require(_0xb27b('0xf'));var AWS=require(_0xb27b('0x10'));var uuidv4=require(_0xb27b('0x11'));var Redis=require(_0xb27b('0x12'));var authService=require(_0xb27b('0x13'));var qs=require(_0xb27b('0x14'));var as=require(_0xb27b('0x15'));var hardwareService=require(_0xb27b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xb27b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb27b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eb47b,_0x1ef0d0){_0x1ef0d0=_0x1ef0d0||0xcc;return function(_0x26d7b5){if(_0x26d7b5){return _0x2eb47b[_0xb27b('0x19')](_0x1ef0d0);}return _0x2eb47b[_0xb27b('0x1a')](_0x1ef0d0)[_0xb27b('0x1b')]();};}function respondWithResult(_0x95f40f,_0x474e87){_0x474e87=_0x474e87||0xc8;return function(_0x5ce8a4){if(_0x5ce8a4){return _0x95f40f['status'](_0x474e87)[_0xb27b('0x1c')](_0x5ce8a4);}};}function respondWithFilteredResult(_0x54b013,_0x39851a){return function(_0x38e827){if(_0x38e827){var _0x2efd48=typeof _0x39851a[_0xb27b('0x1d')]==='undefined'&&typeof _0x39851a['limit']==='undefined';var _0xc1b46=_0x38e827[_0xb27b('0x1e')];var _0x2d81bf=_0x2efd48?0x0:_0x39851a[_0xb27b('0x1d')];var _0x3048c2=_0x2efd48?_0x38e827['count']:_0x39851a['offset']+_0x39851a[_0xb27b('0x1f')];var _0x131ab8;if(_0x3048c2>=_0xc1b46){_0x3048c2=_0xc1b46;_0x131ab8=0xc8;}else{_0x131ab8=0xce;}_0x54b013['status'](_0x131ab8);return _0x54b013[_0xb27b('0x20')](_0xb27b('0x21'),_0x2d81bf+'-'+_0x3048c2+'/'+_0xc1b46)[_0xb27b('0x1c')](_0x38e827);}return null;};}function patchUpdates(_0x599617){return function(_0x283182){try{jsonpatch['apply'](_0x283182,_0x599617,!![]);}catch(_0x189148){return BPromise[_0xb27b('0x22')](_0x189148);}return _0x283182[_0xb27b('0x23')]();};}function saveUpdates(_0x38dfed,_0x5bb3c6){return function(_0x1eceef){if(_0x1eceef){return _0x1eceef[_0xb27b('0x24')](_0x38dfed)[_0xb27b('0x25')](function(_0x4b8f1d){return _0x4b8f1d;});}return null;};}function removeEntity(_0x57a5e2,_0x27f3e3){return function(_0x51b7d4){if(_0x51b7d4){return _0x51b7d4[_0xb27b('0x26')]()[_0xb27b('0x25')](function(){_0x57a5e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x217db6,_0x3fad3){return function(_0x2b47c2){if(!_0x2b47c2){_0x217db6[_0xb27b('0x19')](0x194);}return _0x2b47c2;};}function handleError(_0x3048f6,_0x4c6bb0){_0x4c6bb0=_0x4c6bb0||0x1f4;return function(_0x151972){logger[_0xb27b('0x27')](_0x151972[_0xb27b('0x28')]);if(_0x151972['name']){delete _0x151972[_0xb27b('0x29')];}_0x3048f6[_0xb27b('0x1a')](_0x4c6bb0)[_0xb27b('0x2a')](_0x151972);};}exports['index']=function(_0x4d211f,_0x3f0c25){var _0x56464d={},_0x2f27d6={},_0x2610f3={'count':0x0,'rows':[]};var _0x30581d=_[_0xb27b('0x2b')](db[_0xb27b('0x2c')][_0xb27b('0x2d')],function(_0x592907){return{'name':_0x592907[_0xb27b('0x2e')],'type':_0x592907[_0xb27b('0x2f')]['key']};});_0x2f27d6[_0xb27b('0x30')]=_[_0xb27b('0x31')](_[_0xb27b('0x2b')](_0x30581d,_0xb27b('0x29')),[_0xb27b('0x32')]);_0x2f27d6['query']=_['keys'](_0x4d211f[_0xb27b('0x33')]);_0x2f27d6['filters']=_[_0xb27b('0x34')](_0x2f27d6[_0xb27b('0x30')],_0x2f27d6[_0xb27b('0x33')]);_0x56464d[_0xb27b('0x35')]=_['intersection'](_0x2f27d6[_0xb27b('0x30')],qs[_0xb27b('0x36')](_0x4d211f[_0xb27b('0x33')][_0xb27b('0x36')]));_0x56464d[_0xb27b('0x35')]=_0x56464d[_0xb27b('0x35')][_0xb27b('0x37')]?_0x56464d['attributes']:_0x2f27d6[_0xb27b('0x30')];if(!_0x4d211f[_0xb27b('0x33')][_0xb27b('0x38')]('nolimit')){_0x56464d['limit']=qs[_0xb27b('0x1f')](_0x4d211f[_0xb27b('0x33')][_0xb27b('0x1f')]);_0x56464d[_0xb27b('0x1d')]=qs['offset'](_0x4d211f[_0xb27b('0x33')]['offset']);}_0x56464d['order']=qs['sort'](_0x4d211f[_0xb27b('0x33')][_0xb27b('0x39')]);_0x56464d[_0xb27b('0x3a')]=qs['filters'](_[_0xb27b('0x3b')](_0x4d211f['query'],_0x2f27d6['filters']),_0x30581d);if(_0x4d211f[_0xb27b('0x33')]['filter']){_0x56464d['where']=_[_0xb27b('0x3c')](_0x56464d['where'],{'$or':_[_0xb27b('0x2b')](_0x30581d,function(_0xef0a52){if(_0xef0a52[_0xb27b('0x2f')]!=='VIRTUAL'){var _0x4438d7={};_0x4438d7[_0xef0a52[_0xb27b('0x29')]]={'$like':'%'+_0x4d211f[_0xb27b('0x33')]['filter']+'%'};return _0x4438d7;}})});}_0x56464d=_['merge']({},_0x56464d,_0x4d211f[_0xb27b('0x3d')]);var _0x2b39b4={'where':_0x56464d['where']};return db[_0xb27b('0x2c')][_0xb27b('0x1e')](_0x2b39b4)[_0xb27b('0x25')](function(_0x2253a9){_0x2610f3['count']=_0x2253a9;if(_0x4d211f[_0xb27b('0x33')][_0xb27b('0x3e')]){_0x56464d['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xb27b('0x3f')](_0x56464d);})[_0xb27b('0x25')](function(_0x49d6e9){_0x2610f3[_0xb27b('0x40')]=_0x49d6e9;return _0x2610f3;})[_0xb27b('0x25')](respondWithFilteredResult(_0x3f0c25,_0x56464d))[_0xb27b('0x41')](handleError(_0x3f0c25,null));};exports[_0xb27b('0x42')]=function(_0x45d4a8,_0x5e8055){var _0x207f21={'raw':![],'where':{'id':_0x45d4a8['params']['id']}},_0x2dce7f={};_0x2dce7f[_0xb27b('0x30')]=_[_0xb27b('0x43')](db['VoiceRecording'][_0xb27b('0x2d')]);_0x2dce7f[_0xb27b('0x33')]=_[_0xb27b('0x43')](_0x45d4a8[_0xb27b('0x33')]);_0x2dce7f['filters']=_['intersection'](_0x2dce7f[_0xb27b('0x30')],_0x2dce7f[_0xb27b('0x33')]);_0x207f21[_0xb27b('0x35')]=_[_0xb27b('0x34')](_0x2dce7f[_0xb27b('0x30')],qs[_0xb27b('0x36')](_0x45d4a8[_0xb27b('0x33')][_0xb27b('0x36')]));_0x207f21['attributes']=_0x207f21['attributes'][_0xb27b('0x37')]?_0x207f21[_0xb27b('0x35')]:_0x2dce7f['model'];if(_0x45d4a8[_0xb27b('0x33')]['includeAll']){_0x207f21[_0xb27b('0x44')]=[{'all':!![]}];}_0x207f21=_[_0xb27b('0x3c')]({},_0x207f21,_0x45d4a8['options']);return db[_0xb27b('0x2c')][_0xb27b('0x45')](_0x207f21)[_0xb27b('0x25')](handleEntityNotFound(_0x5e8055,null))[_0xb27b('0x25')](respondWithResult(_0x5e8055,null))[_0xb27b('0x41')](handleError(_0x5e8055,null));};exports[_0xb27b('0x46')]=function(_0x142ced,_0x2efa68){return db[_0xb27b('0x2c')][_0xb27b('0x46')](_0x142ced[_0xb27b('0x47')],{})['then'](respondWithResult(_0x2efa68,0xc9))[_0xb27b('0x41')](handleError(_0x2efa68,null));};exports['update']=function(_0x4fb27b,_0x2a8ade){if(_0x4fb27b['body']['id']){delete _0x4fb27b[_0xb27b('0x47')]['id'];}return db[_0xb27b('0x2c')]['find']({'where':{'id':_0x4fb27b[_0xb27b('0x48')]['id']}})[_0xb27b('0x25')](handleEntityNotFound(_0x2a8ade,null))[_0xb27b('0x25')](saveUpdates(_0x4fb27b[_0xb27b('0x47')],null))['then'](respondWithResult(_0x2a8ade,null))[_0xb27b('0x41')](handleError(_0x2a8ade,null));};exports['describe']=function(_0x5a80c2,_0x51204a){return db['VoiceRecording'][_0xb27b('0x49')]()['then'](respondWithResult(_0x51204a,null))['catch'](handleError(_0x51204a,null));};exports['download']=function(_0x29294a,_0x137e69,_0x5dff82){var _0x479a3c=require(_0xb27b('0x4a'));var _0x39f1f2=![];var _0x535d76={};if(_0x29294a[_0xb27b('0x33')]['type']&&_0x29294a[_0xb27b('0x33')]['type']===_0xb27b('0x4b')){_0x535d76['uniqueid']=_0x29294a[_0xb27b('0x48')]['id'];}else{_0x535d76['id']=_0x29294a[_0xb27b('0x48')]['id'];}return db[_0xb27b('0x2c')][_0xb27b('0x45')]({'where':_0x535d76,'attributes':['id','value'],'raw':!![]})[_0xb27b('0x25')](handleEntityNotFound(_0x137e69,null))['then'](function(_0x238306){if(_0x238306){var _0x49aff2=_0x238306[_0xb27b('0x4c')];var _0x16701d=util['format'](_0xb27b('0x4d'),_0x49aff2);if(fs['existsSync'](_0x16701d)){_0x39f1f2=!![];return _0x479a3c[_0xb27b('0x4e')](_0x16701d,_0x49aff2,config[_0xb27b('0x4f')][_0xb27b('0x50')])[_0xb27b('0x25')](function(){return _0x238306;});}return _0x238306;}})[_0xb27b('0x25')](function(_0x30a189){if(_0x30a189){var _0x91b7b2=_0x30a189[_0xb27b('0x4c')];if(!fs[_0xb27b('0x51')](_0x91b7b2)){throw new db['Sequelize'][(_0xb27b('0x52'))]('VoiceRecording\x20not\x20found');}if(_0x30a189[_0xb27b('0x53')]){return _0x137e69[_0xb27b('0x54')](_0x91b7b2,_0x30a189[_0xb27b('0x53')]+path[_0xb27b('0x55')](_0x91b7b2),function(){if(_0x39f1f2){fs[_0xb27b('0x56')](_0x91b7b2);}});}else{return _0x137e69[_0xb27b('0x54')](_0x91b7b2,function(_0xd4ae4c){if(_0x39f1f2){fs[_0xb27b('0x56')](_0x91b7b2);}});}}})[_0xb27b('0x41')](function(_0x1dbefb){if(_0x1dbefb[_0xb27b('0x57')]===_0xb27b('0x58')){_0x137e69[_0xb27b('0x1a')](0x194)[_0xb27b('0x2a')](_0xb27b('0x59'));}else{return handleError(_0x137e69,null);}});};exports[_0xb27b('0x5a')]=function(_0x287a96,_0x2f6b25,_0x4d3f77){var _0x1f3165=require(_0xb27b('0x4a'));var _0x47d79d=![];var _0x19b5e7={'$and':[db[_0xb27b('0x5b')][_0xb27b('0x3a')](db[_0xb27b('0x5b')]['fn'](_0xb27b('0x5c'),db[_0xb27b('0x5b')][_0xb27b('0x5d')](_0xb27b('0x4b'))),_0x287a96[_0xb27b('0x33')][_0xb27b('0x5e')])]};if(_0x287a96[_0xb27b('0x33')][_0xb27b('0x2f')]&&_0x287a96[_0xb27b('0x33')]['type']===_0xb27b('0x4b')){_0x19b5e7['$and'][_0xb27b('0x5f')]({'uniqueid':_0x287a96['params']['id']});}else{_0x19b5e7['$and'][_0xb27b('0x5f')]({'id':_0x287a96['params']['id']});}return db[_0xb27b('0x2c')]['find']({'where':_0x19b5e7,'attributes':['id',_0xb27b('0x4c')],'raw':!![]})[_0xb27b('0x25')](handleEntityNotFound(_0x2f6b25,null))['then'](function(_0x50afa9){if(_0x50afa9){var _0x1aee3b=util[_0xb27b('0x32')](_0xb27b('0x4d'),_0x50afa9[_0xb27b('0x4c')]);if(fs[_0xb27b('0x51')](_0x1aee3b)){_0x47d79d=!![];return _0x1f3165[_0xb27b('0x4e')](_0x1aee3b,_0x50afa9[_0xb27b('0x4c')],config[_0xb27b('0x4f')][_0xb27b('0x50')])[_0xb27b('0x25')](function(){return _0x50afa9;});}return _0x50afa9;}})[_0xb27b('0x25')](function(_0x4cdf3a){if(_0x4cdf3a){if(!fs[_0xb27b('0x51')](_0x4cdf3a[_0xb27b('0x4c')])){throw new db[(_0xb27b('0x60'))][(_0xb27b('0x52'))](_0xb27b('0x58'));}if(_0x4cdf3a[_0xb27b('0x53')]){return _0x2f6b25[_0xb27b('0x54')](_0x4cdf3a[_0xb27b('0x4c')],_0x4cdf3a['filename']+path['extname'](_0x4cdf3a['value']),function(){if(_0x47d79d){fs['unlink'](_0x4cdf3a[_0xb27b('0x4c')]);}});}else{return _0x2f6b25[_0xb27b('0x54')](_0x4cdf3a[_0xb27b('0x4c')],function(_0x2a6234){if(_0x47d79d){fs[_0xb27b('0x56')](_0x4cdf3a[_0xb27b('0x4c')]);}});}}})[_0xb27b('0x41')](handleError(_0x2f6b25,null));};exports[_0xb27b('0x26')]=function(_0x169442,_0x321566){return db[_0xb27b('0x2c')]['find']({'where':{'id':_0x169442[_0xb27b('0x48')]['id']}})[_0xb27b('0x25')](function(_0x41c127){if(_[_0xb27b('0x61')](_0x41c127)){throw new ReferenceError(_0xb27b('0x62'));}return _0x41c127;})[_0xb27b('0x25')](function(_0x1170e6){var _0x254f51=_0x1170e6['value'];logger[_0xb27b('0x63')](_0xb27b('0x64'),_0x254f51);if(!_[_0xb27b('0x61')](_0x1170e6[_0xb27b('0x4c')])&&fs['existsSync'](_0x254f51)){logger[_0xb27b('0x63')](_0xb27b('0x65')+_0x254f51+_0xb27b('0x66'));fs[_0xb27b('0x67')](_0x254f51);}_0x254f51=_0x254f51+'.cypher';if(!_[_0xb27b('0x61')](_0x1170e6[_0xb27b('0x4c')])&&fs['existsSync'](_0x254f51)){logger['info'](_0xb27b('0x65')+_0x254f51+_0xb27b('0x66'));fs[_0xb27b('0x67')](_0x254f51);}return _0x1170e6;})['then'](function(_0x4fefaa){if(!_0x4fefaa)throw new InternalError();return _0x4fefaa[_0xb27b('0x26')]();})['then'](function(){_0x321566[_0xb27b('0x1a')](0xcc)[_0xb27b('0x1b')]();})['catch'](handleError(_0x321566,null));};function getBucketslist(_0x578a72,_0x18f683,_0x332db6){return new Promise(function(_0x343593,_0x2c34a2){var _0x15bdfa=new AWS['S3']({'accessKeyId':_0x18f683,'secretAccessKey':_0x578a72,'region':_0x332db6});_0x15bdfa[_0xb27b('0x68')]({},function(_0x3e57f8,_0x316ea8){if(_0x3e57f8){return _0x2c34a2(_0x3e57f8);}else{return _0x343593(_0x316ea8);}});});}function createBucket(_0x180d22,_0x2f1b80,_0x18fdba,_0x4554c0){return new Promise(function(_0x345f0f,_0x52864c){var _0x5e057b=new AWS['S3']({'accessKeyId':_0x2f1b80,'secretAccessKey':_0x180d22,'region':_0x18fdba});_0x5e057b['createBucket']({'Bucket':_0x4554c0},function(_0x44c6d4,_0x39cf62){if(_0x44c6d4){return _0x52864c(_0x44c6d4);}else{return _0x345f0f(_0x39cf62);}});});}function uploadFile(_0x1430db,_0x3fbef2,_0x25cece,_0x5a6f59,_0x2e7ce6,_0x53e2c4){return new Promise(function(_0x21729d,_0x479198){var _0x1d16ed=new AWS['S3']({'accessKeyId':_0x3fbef2,'secretAccessKey':_0x1430db,'region':_0x25cece});_0x1d16ed['upload']({'Bucket':_0x5a6f59,'Key':_0x2e7ce6,'Body':_0x53e2c4},function(_0x5e3734,_0x1c064e){if(_0x5e3734){return _0x479198(_0x5e3734);}else{return _0x21729d(_0x1c064e);}});});}function startTranscribe(_0x24e2cd,_0x55aad2,_0x562384,_0x17a097,_0x7231e7,_0x551e01){return new Promise(function(_0x48a4e8,_0x4e4903){var _0x4b5480=new AWS[(_0xb27b('0x69'))]({'accessKeyId':_0x55aad2,'secretAccessKey':_0x24e2cd,'region':_0x562384});_0x4b5480[_0xb27b('0x6a')]({'TranscriptionJobName':_0x17a097,'LanguageCode':_0x7231e7,'Media':{'MediaFileUri':_0x551e01}},function(_0x3e0900,_0x5c4d95){if(_0x3e0900){return _0x4e4903(_0x3e0900);}else{return _0x48a4e8(_0x5c4d95);}});});}function transcribe(_0x4b3aed,_0x410d72,_0x1e5dbb,_0x3af810,_0x5ef610,_0x2abb56,_0x11ef95){return new Promise(function(_0x390e69,_0x30191e){var _0x4d0d6c={};logger['info'](util[_0xb27b('0x32')](_0xb27b('0x6b'),_0x4b3aed,_0x5ef610));return uploadFile(_0x410d72,_0x1e5dbb,_0x3af810,_0x5ef610,path[_0xb27b('0x6c')](_0x2abb56),fs['readFileSync'](_0x2abb56))[_0xb27b('0x25')](function(_0x4672af){logger[_0xb27b('0x63')](util[_0xb27b('0x32')](_0xb27b('0x6d'),_0x4b3aed,_0x5ef610,_0x4672af['Location']));_0x4d0d6c[_0xb27b('0x6e')]=_0x4672af[_0xb27b('0x6f')];_0x4d0d6c[_0xb27b('0x70')]=_0x4672af[_0xb27b('0x71')];logger[_0xb27b('0x63')](util[_0xb27b('0x32')](_0xb27b('0x72'),_0x4b3aed));return startTranscribe(_0x410d72,_0x1e5dbb,_0x3af810,uuidv4(),_0x11ef95,_0x4672af[_0xb27b('0x71')]);})['then'](function(_0xdbf02b){logger[_0xb27b('0x63')](util['format'](_0xb27b('0x73'),_0x4b3aed,_0xdbf02b[_0xb27b('0x74')][_0xb27b('0x75')]));_0x4d0d6c['transcribeName']=_0xdbf02b[_0xb27b('0x74')][_0xb27b('0x75')];_0x4d0d6c[_0xb27b('0x76')]=_0xdbf02b[_0xb27b('0x74')][_0xb27b('0x77')];return _0x390e69(_0x4d0d6c);})[_0xb27b('0x41')](function(_0x341396){return _0x30191e(_0x341396);});});}exports[_0xb27b('0x78')]=function(_0x294bc7,_0x348755,_0x4cbc12){var _0x244392;var _0x1bc87b;var _0x3b2c6b;var _0x4d0359=require('../../components/encryptor');return db[_0xb27b('0x2c')][_0xb27b('0x79')]({'where':{'id':_0x294bc7[_0xb27b('0x48')]['id']}})[_0xb27b('0x25')](function(_0x4aeb83){if(_0x4aeb83){var _0x30fa76=util[_0xb27b('0x32')](_0xb27b('0x4d'),_0x4aeb83['value']);if(fs[_0xb27b('0x51')](_0x30fa76)){cypher=!![];return _0x4d0359[_0xb27b('0x4e')](_0x30fa76,_0x4aeb83[_0xb27b('0x4c')],config[_0xb27b('0x4f')][_0xb27b('0x50')])[_0xb27b('0x25')](function(){return _0x4aeb83;});}return _0x4aeb83;}})[_0xb27b('0x25')](function(_0x2bb14e){if(!_0x2bb14e){throw new db[(_0xb27b('0x60'))][(_0xb27b('0x52'))](_0xb27b('0x7a'));}_0x1bc87b=_0x2bb14e;return db[_0xb27b('0x7b')][_0xb27b('0x79')]({'where':{'id':0x1}});})[_0xb27b('0x25')](handleEntityNotFound(_0x348755,null))[_0xb27b('0x25')](function(_0x4df3b5){if(_0x4df3b5){_0x244392=_0x4df3b5;if(!_0x244392[_0xb27b('0x7c')]||!_0x244392[_0xb27b('0x7d')]||!_0x244392[_0xb27b('0x7e')]||!_0x244392[_0xb27b('0x7f')]||!_0x244392['bucket']){throw new db['Sequelize'][(_0xb27b('0x52'))](_0xb27b('0x80'));}if(_0x294bc7[_0xb27b('0x47')][_0xb27b('0x81')]&&(!_0x244392[_0xb27b('0x82')]||!_0x244392[_0xb27b('0x83')]||!_0x244392[_0xb27b('0x84')]||!_0x244392['language']||!_0x244392[_0xb27b('0x6e')])){throw new db[(_0xb27b('0x60'))][(_0xb27b('0x52'))](_0xb27b('0x85'));}return db[_0xb27b('0x86')]['findOne']({'where':{'id':_0x244392[_0xb27b('0x7d')]}});}})[_0xb27b('0x25')](function(_0x41184a){if(!_0x41184a){throw new db[(_0xb27b('0x60'))][(_0xb27b('0x52'))](_0xb27b('0x87'));}if(!_0x41184a[_0xb27b('0x88')]||!_0x41184a[_0xb27b('0x89')]){throw new db[(_0xb27b('0x60'))][(_0xb27b('0x52'))](_0xb27b('0x8a'));}_0x3b2c6b=_0x41184a;return getBucketslist(_0x3b2c6b[_0xb27b('0x88')],_0x3b2c6b[_0xb27b('0x89')],_0x244392[_0xb27b('0x7e')]);})[_0xb27b('0x25')](function(_0x1139a5){if(_0x1139a5&&_0x1139a5[_0xb27b('0x8b')]){var _0x193f80=_[_0xb27b('0x45')](_0x1139a5[_0xb27b('0x8b')],function(_0x24dc21){return _0x24dc21[_0xb27b('0x8c')]===_0x244392[_0xb27b('0x6e')];});if(!_0x193f80){logger[_0xb27b('0x63')](util[_0xb27b('0x32')](_0xb27b('0x8d'),_0x294bc7[_0xb27b('0x48')]['id'],_0x244392[_0xb27b('0x6e')]));return createBucket(_0x3b2c6b[_0xb27b('0x88')],_0x3b2c6b[_0xb27b('0x89')],_0x244392[_0xb27b('0x7e')],_0x244392[_0xb27b('0x6e')]);}logger[_0xb27b('0x63')](util['format'](_0xb27b('0x8e'),_0x294bc7[_0xb27b('0x48')]['id'],_0x244392[_0xb27b('0x6e')]));return;}})[_0xb27b('0x25')](function(_0xc8d4e9){if(_0x1bc87b[_0xb27b('0x76')]===_0xb27b('0x8f')){return transcribe(_0x294bc7[_0xb27b('0x48')]['id'],_0x3b2c6b[_0xb27b('0x88')],_0x3b2c6b[_0xb27b('0x89')],_0x244392['transcribeRegion'],_0x244392[_0xb27b('0x6e')],_0x1bc87b[_0xb27b('0x4c')],_0x244392['language']);}else{logger[_0xb27b('0x63')](util[_0xb27b('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x294bc7[_0xb27b('0x48')]['id']));return{'transcribeStatus':_0xb27b('0x90')};}})[_0xb27b('0x25')](function(_0x153bdd){if(_0x153bdd){_0x153bdd[_0xb27b('0x91')]=_0x294bc7['body'][_0xb27b('0x81')];return _0x1bc87b['updateAttributes'](_0x153bdd);}})[_0xb27b('0x25')](respondWithResult(_0x348755,null))[_0xb27b('0x41')](handleError(_0x348755,null));};function writeFile(_0x99a63d,_0x3338d7){return new Promise(function(_0x5c9b27,_0x42383f){fs[_0xb27b('0x92')](_0x3338d7,_0x99a63d,function(_0x587420,_0x4f5aa5){if(_0x587420){return _0x42383f(_0x587420);}else{return _0x5c9b27(_0x4f5aa5);}});});}exports['downloadTranscribe']=function(_0x17840c,_0x429159,_0x1e8bd5){return db['VoiceRecording'][_0xb27b('0x79')]({'where':{'id':_0x17840c[_0xb27b('0x48')]['id']}})[_0xb27b('0x25')](handleEntityNotFound(_0x429159))[_0xb27b('0x25')](function(_0x1ae5ee){if(_0x1ae5ee&&_0x1ae5ee[_0xb27b('0x93')]){var _0x5182ad=_0x1ae5ee[_0xb27b('0x93')];var _0x9fe26c=config[_0xb27b('0x94')]+_0xb27b('0x95')+_0x1ae5ee['id']+_0xb27b('0x96');if(fs[_0xb27b('0x51')](_0x9fe26c)){return _0x9fe26c;}return writeFile(_0x5182ad,_0x9fe26c)[_0xb27b('0x25')](function(){return _0x9fe26c;});}else{throw new db['Sequelize']['ValidationError'](_0xb27b('0x97'));}})[_0xb27b('0x25')](function(_0xa2da14){return _0x429159[_0xb27b('0x54')](_0xa2da14);})[_0xb27b('0x41')](handleError(_0x429159));}; \ No newline at end of file +var _0xbc53=['Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','data1','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','save','update','then','error','name','send','index','map','VoiceRecording','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','describe','download','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','downloads','MD5','sequelize','col','token','$and','push','extname','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[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','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','language','bucket'];(function(_0x17e735,_0x328f40){var _0x1824d6=function(_0x4460fe){while(--_0x4460fe){_0x17e735['push'](_0x17e735['shift']());}};_0x1824d6(++_0x328f40);}(_0xbc53,0x1d6));var _0x3bc5=function(_0x27dfc8,_0x11c74a){_0x27dfc8=_0x27dfc8-0x0;var _0x12e7d1=_0xbc53[_0x27dfc8];return _0x12e7d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bc5('0x0'));var zipdir=require(_0x3bc5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bc5('0x2'));var moment=require(_0x3bc5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3bc5('0x4'));var util=require('util');var path=require(_0x3bc5('0x5'));var sox=require(_0x3bc5('0x6'));var csv=require(_0x3bc5('0x7'));var ejs=require(_0x3bc5('0x8'));var fs=require('fs');var fs_extra=require(_0x3bc5('0x9'));var _=require(_0x3bc5('0xa'));var squel=require(_0x3bc5('0xb'));var crypto=require(_0x3bc5('0xc'));var jsforce=require(_0x3bc5('0xd'));var deskjs=require(_0x3bc5('0xe'));var toCsv=require(_0x3bc5('0x7'));var querystring=require('querystring');var Papa=require(_0x3bc5('0xf'));var AWS=require(_0x3bc5('0x10'));var uuidv4=require(_0x3bc5('0x11'));var Redis=require(_0x3bc5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bc5('0x13'));var logger=require(_0x3bc5('0x14'))(_0x3bc5('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3bc5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c53a2,_0xe0b0b5){_0xe0b0b5=_0xe0b0b5||0xcc;return function(_0x945184){if(_0x945184){return _0x2c53a2[_0x3bc5('0x17')](_0xe0b0b5);}return _0x2c53a2['status'](_0xe0b0b5)[_0x3bc5('0x18')]();};}function respondWithResult(_0x3055fa,_0x3bd086){_0x3bd086=_0x3bd086||0xc8;return function(_0x34e848){if(_0x34e848){return _0x3055fa[_0x3bc5('0x19')](_0x3bd086)[_0x3bc5('0x1a')](_0x34e848);}};}function respondWithFilteredResult(_0x570653,_0x27298b){return function(_0x5b8f12){if(_0x5b8f12){var _0x333ffd=typeof _0x27298b[_0x3bc5('0x1b')]===_0x3bc5('0x1c')&&typeof _0x27298b[_0x3bc5('0x1d')]===_0x3bc5('0x1c');var _0x18d9bc=_0x5b8f12[_0x3bc5('0x1e')];var _0x13b2b8=_0x333ffd?0x0:_0x27298b[_0x3bc5('0x1b')];var _0x831460=_0x333ffd?_0x5b8f12['count']:_0x27298b[_0x3bc5('0x1b')]+_0x27298b[_0x3bc5('0x1d')];var _0x2c33f5;if(_0x831460>=_0x18d9bc){_0x831460=_0x18d9bc;_0x2c33f5=0xc8;}else{_0x2c33f5=0xce;}_0x570653['status'](_0x2c33f5);return _0x570653[_0x3bc5('0x1f')]('Content-Range',_0x13b2b8+'-'+_0x831460+'/'+_0x18d9bc)[_0x3bc5('0x1a')](_0x5b8f12);}return null;};}function patchUpdates(_0x3e65a4){return function(_0x49e4be){try{jsonpatch['apply'](_0x49e4be,_0x3e65a4,!![]);}catch(_0x3bcb6c){return BPromise['reject'](_0x3bcb6c);}return _0x49e4be[_0x3bc5('0x20')]();};}function saveUpdates(_0x1f3bf3,_0x4f10b1){return function(_0x31b251){if(_0x31b251){return _0x31b251[_0x3bc5('0x21')](_0x1f3bf3)[_0x3bc5('0x22')](function(_0x5a803c){return _0x5a803c;});}return null;};}function removeEntity(_0x1d344e,_0x4b22cf){return function(_0x2d9607){if(_0x2d9607){return _0x2d9607['destroy']()[_0x3bc5('0x22')](function(){_0x1d344e['status'](0xcc)[_0x3bc5('0x18')]();});}};}function handleEntityNotFound(_0x1fa470,_0x4b5e01){return function(_0x7d59b2){if(!_0x7d59b2){_0x1fa470[_0x3bc5('0x17')](0x194);}return _0x7d59b2;};}function handleError(_0x1f815b,_0x48a9f9){_0x48a9f9=_0x48a9f9||0x1f4;return function(_0x2559a1){logger[_0x3bc5('0x23')](_0x2559a1['stack']);if(_0x2559a1[_0x3bc5('0x24')]){delete _0x2559a1[_0x3bc5('0x24')];}_0x1f815b[_0x3bc5('0x19')](_0x48a9f9)[_0x3bc5('0x25')](_0x2559a1);};}exports[_0x3bc5('0x26')]=function(_0x11cb16,_0x3cadeb){var _0x54a0aa={},_0x1060ef={},_0xea671={'count':0x0,'rows':[]};var _0x24284c=_[_0x3bc5('0x27')](db[_0x3bc5('0x28')][_0x3bc5('0x29')],function(_0x5224bd){return{'name':_0x5224bd['fieldName'],'type':_0x5224bd['type']['key']};});_0x1060ef[_0x3bc5('0x2a')]=_['differenceBy'](_[_0x3bc5('0x27')](_0x24284c,_0x3bc5('0x24')),['format']);_0x1060ef['query']=_[_0x3bc5('0x2b')](_0x11cb16[_0x3bc5('0x2c')]);_0x1060ef[_0x3bc5('0x2d')]=_[_0x3bc5('0x2e')](_0x1060ef[_0x3bc5('0x2a')],_0x1060ef['query']);_0x54a0aa[_0x3bc5('0x2f')]=_[_0x3bc5('0x2e')](_0x1060ef[_0x3bc5('0x2a')],qs['fields'](_0x11cb16[_0x3bc5('0x2c')][_0x3bc5('0x30')]));_0x54a0aa[_0x3bc5('0x2f')]=_0x54a0aa[_0x3bc5('0x2f')]['length']?_0x54a0aa[_0x3bc5('0x2f')]:_0x1060ef[_0x3bc5('0x2a')];if(!_0x11cb16['query'][_0x3bc5('0x31')](_0x3bc5('0x32'))){_0x54a0aa[_0x3bc5('0x1d')]=qs[_0x3bc5('0x1d')](_0x11cb16['query'][_0x3bc5('0x1d')]);_0x54a0aa[_0x3bc5('0x1b')]=qs[_0x3bc5('0x1b')](_0x11cb16[_0x3bc5('0x2c')]['offset']);}_0x54a0aa[_0x3bc5('0x33')]=qs[_0x3bc5('0x34')](_0x11cb16[_0x3bc5('0x2c')][_0x3bc5('0x34')]);_0x54a0aa['where']=qs['filters'](_['pick'](_0x11cb16[_0x3bc5('0x2c')],_0x1060ef['filters']),_0x24284c);if(_0x11cb16[_0x3bc5('0x2c')][_0x3bc5('0x35')]){_0x54a0aa[_0x3bc5('0x36')]=_[_0x3bc5('0x37')](_0x54a0aa[_0x3bc5('0x36')],{'$or':_[_0x3bc5('0x27')](_0x24284c,function(_0x2b6818){if(_0x2b6818[_0x3bc5('0x38')]!==_0x3bc5('0x39')){var _0x191801={};_0x191801[_0x2b6818[_0x3bc5('0x24')]]={'$like':'%'+_0x11cb16['query']['filter']+'%'};return _0x191801;}})});}_0x54a0aa=_[_0x3bc5('0x37')]({},_0x54a0aa,_0x11cb16[_0x3bc5('0x3a')]);var _0x1f4a88={'where':_0x54a0aa[_0x3bc5('0x36')]};return db[_0x3bc5('0x28')][_0x3bc5('0x1e')](_0x1f4a88)[_0x3bc5('0x22')](function(_0x5bda8c){_0xea671[_0x3bc5('0x1e')]=_0x5bda8c;if(_0x11cb16[_0x3bc5('0x2c')][_0x3bc5('0x3b')]){_0x54a0aa['include']=[{'all':!![]}];}return db[_0x3bc5('0x28')][_0x3bc5('0x3c')](_0x54a0aa);})[_0x3bc5('0x22')](function(_0x2546d8){_0xea671[_0x3bc5('0x3d')]=_0x2546d8;return _0xea671;})[_0x3bc5('0x22')](respondWithFilteredResult(_0x3cadeb,_0x54a0aa))[_0x3bc5('0x3e')](handleError(_0x3cadeb,null));};exports['show']=function(_0x147072,_0x3b487a){var _0x530d7d={'raw':![],'where':{'id':_0x147072[_0x3bc5('0x3f')]['id']}},_0x506380={};_0x506380[_0x3bc5('0x2a')]=_['keys'](db['VoiceRecording'][_0x3bc5('0x29')]);_0x506380[_0x3bc5('0x2c')]=_[_0x3bc5('0x2b')](_0x147072[_0x3bc5('0x2c')]);_0x506380['filters']=_[_0x3bc5('0x2e')](_0x506380[_0x3bc5('0x2a')],_0x506380[_0x3bc5('0x2c')]);_0x530d7d[_0x3bc5('0x2f')]=_['intersection'](_0x506380[_0x3bc5('0x2a')],qs[_0x3bc5('0x30')](_0x147072[_0x3bc5('0x2c')][_0x3bc5('0x30')]));_0x530d7d['attributes']=_0x530d7d[_0x3bc5('0x2f')][_0x3bc5('0x40')]?_0x530d7d[_0x3bc5('0x2f')]:_0x506380[_0x3bc5('0x2a')];if(_0x147072['query'][_0x3bc5('0x3b')]){_0x530d7d[_0x3bc5('0x41')]=[{'all':!![]}];}_0x530d7d=_['merge']({},_0x530d7d,_0x147072[_0x3bc5('0x3a')]);return db[_0x3bc5('0x28')][_0x3bc5('0x42')](_0x530d7d)[_0x3bc5('0x22')](handleEntityNotFound(_0x3b487a,null))[_0x3bc5('0x22')](respondWithResult(_0x3b487a,null))[_0x3bc5('0x3e')](handleError(_0x3b487a,null));};exports[_0x3bc5('0x43')]=function(_0x3ea291,_0x30ba58){return db[_0x3bc5('0x28')][_0x3bc5('0x43')](_0x3ea291['body'],{})[_0x3bc5('0x22')](respondWithResult(_0x30ba58,0xc9))[_0x3bc5('0x3e')](handleError(_0x30ba58,null));};exports[_0x3bc5('0x21')]=function(_0x65e44a,_0x11374a){if(_0x65e44a[_0x3bc5('0x44')]['id']){delete _0x65e44a['body']['id'];}return db[_0x3bc5('0x28')][_0x3bc5('0x42')]({'where':{'id':_0x65e44a[_0x3bc5('0x3f')]['id']}})[_0x3bc5('0x22')](handleEntityNotFound(_0x11374a,null))[_0x3bc5('0x22')](saveUpdates(_0x65e44a['body'],null))[_0x3bc5('0x22')](respondWithResult(_0x11374a,null))['catch'](handleError(_0x11374a,null));};exports['describe']=function(_0x2fcfa8,_0x40a50c){return db['VoiceRecording'][_0x3bc5('0x45')]()['then'](respondWithResult(_0x40a50c,null))[_0x3bc5('0x3e')](handleError(_0x40a50c,null));};exports[_0x3bc5('0x46')]=function(_0x33b7b5,_0x14c220,_0xd17a3e){var _0x298a74=require('../../components/encryptor');var _0x183c32=![];var _0x4d8dc3={};if(_0x33b7b5['query'][_0x3bc5('0x38')]&&_0x33b7b5['query'][_0x3bc5('0x38')]==='uniqueid'){_0x4d8dc3[_0x3bc5('0x47')]=_0x33b7b5[_0x3bc5('0x3f')]['id'];}else{_0x4d8dc3['id']=_0x33b7b5[_0x3bc5('0x3f')]['id'];}return db[_0x3bc5('0x28')][_0x3bc5('0x42')]({'where':_0x4d8dc3,'attributes':['id',_0x3bc5('0x48')],'raw':!![]})[_0x3bc5('0x22')](handleEntityNotFound(_0x14c220,null))[_0x3bc5('0x22')](function(_0x100c7){if(_0x100c7){var _0x11306d=_0x100c7[_0x3bc5('0x48')];var _0x4daf0b=util[_0x3bc5('0x49')](_0x3bc5('0x4a'),_0x11306d);if(fs[_0x3bc5('0x4b')](_0x4daf0b)){_0x183c32=!![];return _0x298a74[_0x3bc5('0x4c')](_0x4daf0b,_0x11306d,config[_0x3bc5('0x4d')][_0x3bc5('0x4e')])[_0x3bc5('0x22')](function(){return _0x100c7;});}return _0x100c7;}})[_0x3bc5('0x22')](function(_0x44b823){if(_0x44b823){var _0x5da94b=_0x44b823[_0x3bc5('0x48')];if(!fs[_0x3bc5('0x4b')](_0x5da94b)){throw new db[(_0x3bc5('0x4f'))][(_0x3bc5('0x50'))](_0x3bc5('0x51'));}if(_0x44b823['filename']){return _0x14c220[_0x3bc5('0x46')](_0x5da94b,_0x44b823[_0x3bc5('0x52')]+path['extname'](_0x5da94b),function(){if(_0x183c32){fs[_0x3bc5('0x53')](_0x5da94b);}});}else{return _0x14c220[_0x3bc5('0x46')](_0x5da94b,function(_0x1016df){if(_0x183c32){fs['unlink'](_0x5da94b);}});}}})[_0x3bc5('0x3e')](function(_0x46181c){if(_0x46181c[_0x3bc5('0x54')]===_0x3bc5('0x51')){_0x14c220[_0x3bc5('0x19')](0x194)[_0x3bc5('0x25')]('Not\x20found');}else{return handleError(_0x14c220,null);}});};exports[_0x3bc5('0x55')]=function(_0x2a2441,_0x481174,_0x3109d5){var _0x181d23=require('../../components/encryptor');var _0x46111c=![];var _0x357e4a={'$and':[db['sequelize'][_0x3bc5('0x36')](db['sequelize']['fn'](_0x3bc5('0x56'),db[_0x3bc5('0x57')][_0x3bc5('0x58')](_0x3bc5('0x47'))),_0x2a2441['query'][_0x3bc5('0x59')])]};if(_0x2a2441['query']['type']&&_0x2a2441[_0x3bc5('0x2c')][_0x3bc5('0x38')]==='uniqueid'){_0x357e4a[_0x3bc5('0x5a')][_0x3bc5('0x5b')]({'uniqueid':_0x2a2441[_0x3bc5('0x3f')]['id']});}else{_0x357e4a[_0x3bc5('0x5a')]['push']({'id':_0x2a2441[_0x3bc5('0x3f')]['id']});}return db[_0x3bc5('0x28')]['find']({'where':_0x357e4a,'attributes':['id','value'],'raw':!![]})[_0x3bc5('0x22')](handleEntityNotFound(_0x481174,null))[_0x3bc5('0x22')](function(_0x485f30){if(_0x485f30){var _0x1b5ad7=util[_0x3bc5('0x49')]('%s.cypher',_0x485f30['value']);if(fs['existsSync'](_0x1b5ad7)){_0x46111c=!![];return _0x181d23[_0x3bc5('0x4c')](_0x1b5ad7,_0x485f30[_0x3bc5('0x48')],config[_0x3bc5('0x4d')][_0x3bc5('0x4e')])[_0x3bc5('0x22')](function(){return _0x485f30;});}return _0x485f30;}})['then'](function(_0x256b8f){if(_0x256b8f){if(!fs[_0x3bc5('0x4b')](_0x256b8f[_0x3bc5('0x48')])){throw new db[(_0x3bc5('0x4f'))][(_0x3bc5('0x50'))](_0x3bc5('0x51'));}if(_0x256b8f[_0x3bc5('0x52')]){return _0x481174[_0x3bc5('0x46')](_0x256b8f['value'],_0x256b8f[_0x3bc5('0x52')]+path[_0x3bc5('0x5c')](_0x256b8f[_0x3bc5('0x48')]),function(){if(_0x46111c){fs[_0x3bc5('0x53')](_0x256b8f['value']);}});}else{return _0x481174[_0x3bc5('0x46')](_0x256b8f[_0x3bc5('0x48')],function(_0x433130){if(_0x46111c){fs[_0x3bc5('0x53')](_0x256b8f[_0x3bc5('0x48')]);}});}}})[_0x3bc5('0x3e')](handleError(_0x481174,null));};exports[_0x3bc5('0x5d')]=function(_0x5bfcbd,_0x56dbd5){return db[_0x3bc5('0x28')][_0x3bc5('0x42')]({'where':{'id':_0x5bfcbd[_0x3bc5('0x3f')]['id']}})[_0x3bc5('0x22')](function(_0x4072aa){if(_['isNil'](_0x4072aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4072aa;})[_0x3bc5('0x22')](function(_0x4611f6){var _0x3f06a1=_0x4611f6['value'];logger[_0x3bc5('0x5e')](_0x3bc5('0x5f'),_0x3f06a1);if(!_[_0x3bc5('0x60')](_0x4611f6[_0x3bc5('0x48')])&&fs[_0x3bc5('0x4b')](_0x3f06a1)){logger['info'](_0x3bc5('0x61')+_0x3f06a1+_0x3bc5('0x62'));fs[_0x3bc5('0x63')](_0x3f06a1);}_0x3f06a1=_0x3f06a1+_0x3bc5('0x64');if(!_[_0x3bc5('0x60')](_0x4611f6[_0x3bc5('0x48')])&&fs[_0x3bc5('0x4b')](_0x3f06a1)){logger[_0x3bc5('0x5e')](_0x3bc5('0x61')+_0x3f06a1+_0x3bc5('0x62'));fs[_0x3bc5('0x63')](_0x3f06a1);}return _0x4611f6;})[_0x3bc5('0x22')](function(_0x1ad505){if(!_0x1ad505)throw new InternalError();return _0x1ad505[_0x3bc5('0x5d')]();})[_0x3bc5('0x22')](function(){_0x56dbd5[_0x3bc5('0x19')](0xcc)[_0x3bc5('0x18')]();})[_0x3bc5('0x3e')](handleError(_0x56dbd5,null));};function getBucketslist(_0x1d3504,_0x5ec871,_0x445544){return new Promise(function(_0x356375,_0xa14e98){var _0x262e9e=new AWS['S3']({'accessKeyId':_0x5ec871,'secretAccessKey':_0x1d3504,'region':_0x445544});_0x262e9e[_0x3bc5('0x65')]({},function(_0x13dccf,_0x4a457e){if(_0x13dccf){return _0xa14e98(_0x13dccf);}else{return _0x356375(_0x4a457e);}});});}function createBucket(_0xafe776,_0x118a43,_0x555e12,_0x5c61fc){return new Promise(function(_0x4e6123,_0x232085){var _0x107858=new AWS['S3']({'accessKeyId':_0x118a43,'secretAccessKey':_0xafe776,'region':_0x555e12});_0x107858[_0x3bc5('0x66')]({'Bucket':_0x5c61fc},function(_0x452525,_0x148366){if(_0x452525){return _0x232085(_0x452525);}else{return _0x4e6123(_0x148366);}});});}function uploadFile(_0x4e224e,_0x5098fc,_0x76fc07,_0x31c8e4,_0x40d147,_0x1b3a9f){return new Promise(function(_0x472222,_0x1e24a1){var _0xfee91b=new AWS['S3']({'accessKeyId':_0x5098fc,'secretAccessKey':_0x4e224e,'region':_0x76fc07});_0xfee91b['upload']({'Bucket':_0x31c8e4,'Key':_0x40d147,'Body':_0x1b3a9f},function(_0x1e3c65,_0x3d8b6e){if(_0x1e3c65){return _0x1e24a1(_0x1e3c65);}else{return _0x472222(_0x3d8b6e);}});});}function startTranscribe(_0x239346,_0x47e72a,_0x4d2e1c,_0x3a1cee,_0x15a98a,_0x385f15){return new Promise(function(_0x4a71ff,_0x1157a2){var _0x3f9745=new AWS[(_0x3bc5('0x67'))]({'accessKeyId':_0x47e72a,'secretAccessKey':_0x239346,'region':_0x4d2e1c});_0x3f9745[_0x3bc5('0x68')]({'TranscriptionJobName':_0x3a1cee,'LanguageCode':_0x15a98a,'Media':{'MediaFileUri':_0x385f15}},function(_0x33874a,_0x27783d){if(_0x33874a){return _0x1157a2(_0x33874a);}else{return _0x4a71ff(_0x27783d);}});});}function transcribe(_0x5e04b0,_0xb95945,_0x24dcab,_0x39500a,_0x1213cc,_0x11aa2a,_0x7ffcc4){return new Promise(function(_0x5a403a,_0x5ce76e){var _0x5652c2={};logger[_0x3bc5('0x5e')](util[_0x3bc5('0x49')](_0x3bc5('0x69'),_0x5e04b0,_0x1213cc));return uploadFile(_0xb95945,_0x24dcab,_0x39500a,_0x1213cc,path[_0x3bc5('0x6a')](_0x11aa2a),fs['readFileSync'](_0x11aa2a))[_0x3bc5('0x22')](function(_0x52bc9e){logger[_0x3bc5('0x5e')](util['format'](_0x3bc5('0x6b'),_0x5e04b0,_0x1213cc,_0x52bc9e[_0x3bc5('0x6c')]));_0x5652c2['bucket']=_0x52bc9e[_0x3bc5('0x6d')];_0x5652c2[_0x3bc5('0x6e')]=_0x52bc9e[_0x3bc5('0x6c')];logger['info'](util[_0x3bc5('0x49')](_0x3bc5('0x6f'),_0x5e04b0));return startTranscribe(_0xb95945,_0x24dcab,_0x39500a,uuidv4(),_0x7ffcc4,_0x52bc9e[_0x3bc5('0x6c')]);})['then'](function(_0x53db7e){logger['info'](util[_0x3bc5('0x49')](_0x3bc5('0x70'),_0x5e04b0,_0x53db7e[_0x3bc5('0x71')]['TranscriptionJobName']));_0x5652c2['transcribeName']=_0x53db7e[_0x3bc5('0x71')][_0x3bc5('0x72')];_0x5652c2[_0x3bc5('0x73')]=_0x53db7e[_0x3bc5('0x71')][_0x3bc5('0x74')];return _0x5a403a(_0x5652c2);})[_0x3bc5('0x3e')](function(_0xba3cf){return _0x5ce76e(_0xba3cf);});});}exports[_0x3bc5('0x75')]=function(_0x421a12,_0x3823e6,_0x448287){var _0x471b78;var _0x3dec3f;var _0x4070a6;var _0x8453b6=require(_0x3bc5('0x76'));return db[_0x3bc5('0x28')][_0x3bc5('0x77')]({'where':{'id':_0x421a12[_0x3bc5('0x3f')]['id']}})['then'](function(_0x3194a4){if(_0x3194a4){var _0xb00aca=util[_0x3bc5('0x49')]('%s.cypher',_0x3194a4[_0x3bc5('0x48')]);if(fs[_0x3bc5('0x4b')](_0xb00aca)){cypher=!![];return _0x8453b6[_0x3bc5('0x4c')](_0xb00aca,_0x3194a4[_0x3bc5('0x48')],config[_0x3bc5('0x4d')][_0x3bc5('0x4e')])[_0x3bc5('0x22')](function(){return _0x3194a4;});}return _0x3194a4;}})[_0x3bc5('0x22')](function(_0x11f89e){if(!_0x11f89e){throw new db[(_0x3bc5('0x4f'))][(_0x3bc5('0x50'))](_0x3bc5('0x78'));}_0x3dec3f=_0x11f89e;return db[_0x3bc5('0x79')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x3823e6,null))[_0x3bc5('0x22')](function(_0x47cdfe){if(_0x47cdfe){_0x471b78=_0x47cdfe;if(!_0x471b78[_0x3bc5('0x7a')]||!_0x471b78['transcribeAccountId']||!_0x471b78[_0x3bc5('0x7b')]||!_0x471b78[_0x3bc5('0x7c')]||!_0x471b78[_0x3bc5('0x7d')]){throw new db[(_0x3bc5('0x4f'))][(_0x3bc5('0x50'))](_0x3bc5('0x7e'));}if(_0x421a12[_0x3bc5('0x44')]['runSentiment']&&(!_0x471b78[_0x3bc5('0x7f')]||!_0x471b78[_0x3bc5('0x80')]||!_0x471b78[_0x3bc5('0x81')]||!_0x471b78[_0x3bc5('0x7c')]||!_0x471b78[_0x3bc5('0x7d')])){throw new db[(_0x3bc5('0x4f'))][(_0x3bc5('0x50'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x3bc5('0x77')]({'where':{'id':_0x471b78[_0x3bc5('0x82')]}});}})[_0x3bc5('0x22')](function(_0x262a03){if(!_0x262a03){throw new db[(_0x3bc5('0x4f'))]['ValidationError'](_0x3bc5('0x83'));}if(!_0x262a03['data1']||!_0x262a03[_0x3bc5('0x84')]){throw new db[(_0x3bc5('0x4f'))][(_0x3bc5('0x50'))](_0x3bc5('0x85'));}_0x4070a6=_0x262a03;return getBucketslist(_0x4070a6['data1'],_0x4070a6['data2'],_0x471b78[_0x3bc5('0x7b')]);})[_0x3bc5('0x22')](function(_0x42c98c){if(_0x42c98c&&_0x42c98c[_0x3bc5('0x86')]){var _0x224b2b=_[_0x3bc5('0x42')](_0x42c98c['Buckets'],function(_0x3ec972){return _0x3ec972[_0x3bc5('0x87')]===_0x471b78['bucket'];});if(!_0x224b2b){logger[_0x3bc5('0x5e')](util[_0x3bc5('0x49')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x421a12[_0x3bc5('0x3f')]['id'],_0x471b78['bucket']));return createBucket(_0x4070a6['data1'],_0x4070a6['data2'],_0x471b78[_0x3bc5('0x7b')],_0x471b78[_0x3bc5('0x7d')]);}logger[_0x3bc5('0x5e')](util[_0x3bc5('0x49')](_0x3bc5('0x88'),_0x421a12[_0x3bc5('0x3f')]['id'],_0x471b78['bucket']));return;}})[_0x3bc5('0x22')](function(_0x39e987){if(_0x3dec3f['transcribeStatus']===_0x3bc5('0x89')){return transcribe(_0x421a12[_0x3bc5('0x3f')]['id'],_0x4070a6[_0x3bc5('0x8a')],_0x4070a6[_0x3bc5('0x84')],_0x471b78[_0x3bc5('0x7b')],_0x471b78[_0x3bc5('0x7d')],_0x3dec3f[_0x3bc5('0x48')],_0x471b78[_0x3bc5('0x7c')]);}else{logger[_0x3bc5('0x5e')](util[_0x3bc5('0x49')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x421a12[_0x3bc5('0x3f')]['id']));return{'transcribeStatus':_0x3bc5('0x8b')};}})[_0x3bc5('0x22')](function(_0x5853f5){if(_0x5853f5){_0x5853f5[_0x3bc5('0x8c')]=_0x421a12[_0x3bc5('0x44')][_0x3bc5('0x8d')];return _0x3dec3f[_0x3bc5('0x8e')](_0x5853f5);}})[_0x3bc5('0x22')](respondWithResult(_0x3823e6,null))[_0x3bc5('0x3e')](handleError(_0x3823e6,null));};function writeFile(_0xd29bef,_0xc441f4){return new Promise(function(_0x238275,_0x1949b7){fs[_0x3bc5('0x8f')](_0xc441f4,_0xd29bef,function(_0x556d34,_0xc6384c){if(_0x556d34){return _0x1949b7(_0x556d34);}else{return _0x238275(_0xc6384c);}});});}exports['downloadTranscribe']=function(_0x4de523,_0x217b15,_0x31b932){return db[_0x3bc5('0x28')]['findOne']({'where':{'id':_0x4de523['params']['id']}})[_0x3bc5('0x22')](handleEntityNotFound(_0x217b15))['then'](function(_0x2a6726){if(_0x2a6726&&_0x2a6726['fileText']){var _0x50d8e4=_0x2a6726[_0x3bc5('0x90')];var _0x1a5a73=config[_0x3bc5('0x91')]+_0x3bc5('0x92')+_0x2a6726['id']+_0x3bc5('0x93');if(fs[_0x3bc5('0x4b')](_0x1a5a73)){return _0x1a5a73;}return writeFile(_0x50d8e4,_0x1a5a73)[_0x3bc5('0x22')](function(){return _0x1a5a73;});}else{throw new db[(_0x3bc5('0x4f'))][(_0x3bc5('0x50'))](_0x3bc5('0x94'));}})[_0x3bc5('0x22')](function(_0x5c45a9){return _0x217b15[_0x3bc5('0x46')](_0x5c45a9);})[_0x3bc5('0x3e')](handleError(_0x217b15));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index b785aea..87fdc4a 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 _0x4f6f=['transcribeStatus','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid'];(function(_0x3220bb,_0x342a03){var _0x23415c=function(_0x56cc05){while(--_0x56cc05){_0x3220bb['push'](_0x3220bb['shift']());}};_0x23415c(++_0x342a03);}(_0x4f6f,0x157));var _0xf4f6=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0x4f6f[_0x1a1b6e];return _0x571e2c;};'use strict';var attributes=require(_0xf4f6('0x0'));module[_0xf4f6('0x1')]=function(_0x2c5690,_0x4b6f0f){return _0x2c5690[_0xf4f6('0x2')]('VoiceRecording',attributes,{'tableName':_0xf4f6('0x3'),'paranoid':![],'indexes':[{'name':_0xf4f6('0x4'),'fields':['uniqueid']},{'name':_0xf4f6('0x5'),'fields':[_0xf4f6('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x295f=['exports','VoiceRecording','voice_recordings','transcribeStatus'];(function(_0x155768,_0x51ac13){var _0x285a38=function(_0x4340d9){while(--_0x4340d9){_0x155768['push'](_0x155768['shift']());}};_0x285a38(++_0x51ac13);}(_0x295f,0x168));var _0xf295=function(_0x5b501c,_0xed608){_0x5b501c=_0x5b501c-0x0;var _0x14eb45=_0x295f[_0x5b501c];return _0x14eb45;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0xf295('0x0')]=function(_0x2a126a,_0x35f58d){return _0x2a126a['define'](_0xf295('0x1'),attributes,{'tableName':_0xf295('0x2'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']},{'name':_0xf295('0x3'),'fields':[_0xf295('0x3')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 509d4e7..e1f3481 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 _0x2542=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','UpdateVoiceRecording','update','body','options','raw','where','limit','../../components/encryptor','Setting','callRecordingEncryption','VoiceRecording','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording'];(function(_0x2a1b62,_0xeb1a53){var _0x3b8951=function(_0x4824d5){while(--_0x4824d5){_0x2a1b62['push'](_0x2a1b62['shift']());}};_0x3b8951(++_0xeb1a53);}(_0x2542,0x169));var _0x2254=function(_0x378a51,_0x125d4){_0x378a51=_0x378a51-0x0;var _0x18c1e5=_0x2542[_0x378a51];return _0x18c1e5;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});}exports[_0x2254('0x16')]=function(_0x1ae11e){var _0x34f90e=this;return new Promise(function(_0x497724,_0x51b395){return db['VoiceRecording'][_0x2254('0x17')](_0x1ae11e[_0x2254('0x18')],{'raw':_0x1ae11e[_0x2254('0x19')]?_0x1ae11e[_0x2254('0x19')][_0x2254('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ae11e[_0x2254('0x19')]?_0x1ae11e['options'][_0x2254('0x1b')]||null:null,'attributes':_0x1ae11e[_0x2254('0x19')]?_0x1ae11e[_0x2254('0x19')]['attributes']||null:null,'limit':_0x1ae11e['options']?_0x1ae11e['options'][_0x2254('0x1c')]||null:null})[_0x2254('0xc')](function(_0xf88b56){logger['info']('UpdateVoiceRecording',_0x1ae11e);logger['debug']('UpdateVoiceRecording',_0x1ae11e,JSON['stringify'](_0xf88b56));_0x497724(_0xf88b56);})['catch'](function(_0x1aa71f){logger[_0x2254('0x14')](_0x2254('0x16'),_0x1aa71f[_0x2254('0x15')],_0x1ae11e);_0x51b395(_0x34f90e[_0x2254('0x14')](0x1f4,_0x1aa71f[_0x2254('0x15')]));});});};exports['CreateVoiceRecording']=function(_0x4a8274){var _0x1ada42=this;return new Promise(function(_0x4f6877,_0x35608a){var _0x141dc5=require(_0x2254('0x1d'));var _0x3aa0bd;return db[_0x2254('0x1e')]['findOne']({'attributes':['id',_0x2254('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x2254('0xc')](function(_0x21285d){_0x3aa0bd=_0x21285d;return db[_0x2254('0x20')][_0x2254('0x21')](_0x4a8274[_0x2254('0x18')]);})[_0x2254('0xc')](function(_0x22e791){if(_0x3aa0bd[_0x2254('0x1f')]&&fs[_0x2254('0x22')](_0x22e791[_0x2254('0x23')])){var _0xad7774=util[_0x2254('0x24')](_0x2254('0x25'),_0x22e791[_0x2254('0x23')]);return _0x141dc5[_0x2254('0x26')](_0x22e791[_0x2254('0x23')],_0xad7774,config[_0x2254('0x27')][_0x2254('0x28')])['then'](function(){fs[_0x2254('0x29')](_0x22e791[_0x2254('0x23')]);logger[_0x2254('0xd')](_0x2254('0x2a'));return _0x22e791;});}return _0x22e791;})[_0x2254('0xc')](function(_0x1d275b){logger[_0x2254('0xd')](_0x2254('0x2b'),_0x4a8274);logger[_0x2254('0xf')]('CreateVoiceRecording',_0x4a8274,JSON[_0x2254('0x12')](_0x1d275b));_0x4f6877(_0x1d275b);})[_0x2254('0x2c')](function(_0x503540){logger[_0x2254('0x14')](_0x2254('0x2b'),_0x503540[_0x2254('0x15')],_0x4a8274);_0x35608a(_0x1ada42[_0x2254('0x14')](0x1f4,_0x503540['message']));});});}; \ No newline at end of file +var _0xe3da=['CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceRecording','update','body','options','where','attributes','limit','then','UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','unlink'];(function(_0x59cc7e,_0x80d135){var _0x4f6bdc=function(_0x317639){while(--_0x317639){_0x59cc7e['push'](_0x59cc7e['shift']());}};_0x4f6bdc(++_0x80d135);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['UpdateVoiceRecording']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')](_0x3f8cf9[_0xae3d('0x1a')],{'raw':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9['options'][_0xae3d('0x1c')]||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1d')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1e')]||null:null})[_0xae3d('0x1f')](function(_0x3224ff){logger[_0xae3d('0xe')](_0xae3d('0x20'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x20'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x3224ff));_0x558e42(_0x3224ff);})[_0xae3d('0x21')](function(_0x1fe90f){logger[_0xae3d('0x14')](_0xae3d('0x20'),_0x1fe90f[_0xae3d('0x16')],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x1fe90f['message']));});});};exports[_0xae3d('0x22')]=function(_0x185e71){var _0xb5940=this;return new Promise(function(_0x52df0f,_0x256bd0){var _0x4391db=require(_0xae3d('0x23'));var _0x54c1e1;return db['Setting'][_0xae3d('0x24')]({'attributes':['id',_0xae3d('0x25')],'where':{'id':0x1},'raw':!![]})[_0xae3d('0x1f')](function(_0x3114f9){_0x54c1e1=_0x3114f9;return db[_0xae3d('0x18')]['create'](_0x185e71[_0xae3d('0x1a')]);})[_0xae3d('0x1f')](function(_0x5a39c5){if(_0x54c1e1[_0xae3d('0x25')]&&fs[_0xae3d('0x26')](_0x5a39c5[_0xae3d('0x27')])){var _0x46f484=util[_0xae3d('0x28')](_0xae3d('0x29'),_0x5a39c5['value']);return _0x4391db['encryptFile'](_0x5a39c5['value'],_0x46f484,config[_0xae3d('0x2a')][_0xae3d('0x2b')])[_0xae3d('0x1f')](function(){fs[_0xae3d('0x2c')](_0x5a39c5['value']);logger[_0xae3d('0xe')](_0xae3d('0x2d'));return _0x5a39c5;});}return _0x5a39c5;})[_0xae3d('0x1f')](function(_0x3748d2){logger[_0xae3d('0xe')](_0xae3d('0x22'),_0x185e71);logger[_0xae3d('0x11')]('CreateVoiceRecording',_0x185e71,JSON[_0xae3d('0x13')](_0x3748d2));_0x52df0f(_0x3748d2);})['catch'](function(_0x55aae4){logger[_0xae3d('0x14')]('CreateVoiceRecording',_0x55aae4[_0xae3d('0x16')],_0x185e71);_0x256bd0(_0xb5940['error'](0x1f4,_0x55aae4['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 5071bbf..a06f854 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 _0xeaa1=['/:id','update','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceTransferReport.controller','get','index','isAuthenticated','describe','put'];(function(_0x271ec4,_0x2b565c){var _0x389d42=function(_0x3bb8bb){while(--_0x3bb8bb){_0x271ec4['push'](_0x271ec4['shift']());}};_0x389d42(++_0x2b565c);}(_0xeaa1,0xd4));var _0x1eaa=function(_0x23663b,_0x52ae37){_0x23663b=_0x23663b-0x0;var _0x8c4357=_0xeaa1[_0x23663b];return _0x8c4357;};'use strict';var multer=require(_0x1eaa('0x0'));var util=require(_0x1eaa('0x1'));var path=require('path');var timeout=require(_0x1eaa('0x2'));var express=require('express');var router=express[_0x1eaa('0x3')]();var fs_extra=require(_0x1eaa('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1eaa('0x5'));var config=require('../../config/environment');var controller=require(_0x1eaa('0x6'));router[_0x1eaa('0x7')]('/',auth['isAuthenticated'](),controller[_0x1eaa('0x8')]);router[_0x1eaa('0x7')]('/describe',auth[_0x1eaa('0x9')](),controller[_0x1eaa('0xa')]);router[_0x1eaa('0x7')]('/:id',auth[_0x1eaa('0x9')](),controller['show']);router['post']('/',auth[_0x1eaa('0x9')](),controller['create']);router[_0x1eaa('0xb')](_0x1eaa('0xc'),auth[_0x1eaa('0x9')](),controller[_0x1eaa('0xd')]);router['delete'](_0x1eaa('0xc'),auth[_0x1eaa('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6dc4=['show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x6dc4,0x13c));var _0x46dc=function(_0x394afb,_0x14e9e1){_0x394afb=_0x394afb-0x0;var _0x2c8bd2=_0x6dc4[_0x394afb];return _0x2c8bd2;};'use strict';var multer=require('multer');var util=require(_0x46dc('0x0'));var path=require(_0x46dc('0x1'));var timeout=require(_0x46dc('0x2'));var express=require(_0x46dc('0x3'));var router=express[_0x46dc('0x4')]();var fs_extra=require(_0x46dc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x46dc('0x6'));var controller=require(_0x46dc('0x7'));router['get']('/',auth[_0x46dc('0x8')](),controller[_0x46dc('0x9')]);router[_0x46dc('0xa')](_0x46dc('0xb'),auth[_0x46dc('0x8')](),controller[_0x46dc('0xc')]);router[_0x46dc('0xa')](_0x46dc('0xd'),auth[_0x46dc('0x8')](),controller[_0x46dc('0xe')]);router[_0x46dc('0xf')]('/',auth[_0x46dc('0x8')](),controller[_0x46dc('0x10')]);router[_0x46dc('0x11')](_0x46dc('0xd'),auth[_0x46dc('0x8')](),controller[_0x46dc('0x12')]);router[_0x46dc('0x13')](_0x46dc('0xd'),auth[_0x46dc('0x8')](),controller[_0x46dc('0x14')]);module[_0x46dc('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 487c00f..a431b15 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 _0x40a7=['STRING','Yes','sequelize','moment','ENUM','attended'];(function(_0xf998f1,_0xed2b2f){var _0x211619=function(_0x9ac127){while(--_0x9ac127){_0xf998f1['push'](_0xf998f1['shift']());}};_0x211619(++_0xed2b2f);}(_0x40a7,0x10a));var _0x740a=function(_0x444a51,_0x5c17f7){_0x444a51=_0x444a51-0x0;var _0x103d2f=_0x40a7[_0x444a51];return _0x103d2f;};'use strict';var Sequelize=require(_0x740a('0x0'));var moment=require(_0x740a('0x1'));module['exports']={'type':{'type':Sequelize[_0x740a('0x2')]('blind',_0x740a('0x3'))},'result':{'type':Sequelize[_0x740a('0x4')]},'transfererchannel':{'type':Sequelize[_0x740a('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x740a('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x740a('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x740a('0x4')]},'transferercontext':{'type':Sequelize[_0x740a('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x740a('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x740a('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x740a('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x740a('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x740a('0x4')]},'transfereecontext':{'type':Sequelize[_0x740a('0x4')]},'transfereeexten':{'type':Sequelize[_0x740a('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x740a('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x740a('0x5'),'No')},'context':{'type':Sequelize[_0x740a('0x4')]},'extension':{'type':Sequelize[_0x740a('0x4')]}}; \ No newline at end of file +var _0x8532=['blind','attended','STRING','sequelize','moment','ENUM'];(function(_0x5f139c,_0x34abe0){var _0xd3bd61=function(_0x918abc){while(--_0x918abc){_0x5f139c['push'](_0x5f139c['shift']());}};_0xd3bd61(++_0x34abe0);}(_0x8532,0x10b));var _0x2853=function(_0x25c48e,_0x2d8dc){_0x25c48e=_0x25c48e-0x0;var _0xc83d4e=_0x8532[_0x25c48e];return _0xc83d4e;};'use strict';var Sequelize=require(_0x2853('0x0'));var moment=require(_0x2853('0x1'));module['exports']={'type':{'type':Sequelize[_0x2853('0x2')](_0x2853('0x3'),_0x2853('0x4'))},'result':{'type':Sequelize[_0x2853('0x5')]},'transfererchannel':{'type':Sequelize[_0x2853('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x2853('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x2853('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x2853('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x2853('0x5')]},'transferercontext':{'type':Sequelize[_0x2853('0x5')]},'transfererexten':{'type':Sequelize[_0x2853('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x2853('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x2853('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x2853('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2853('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x2853('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x2853('0x5')]},'transfereecontext':{'type':Sequelize[_0x2853('0x5')]},'transfereeexten':{'type':Sequelize[_0x2853('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x2853('0x5')]},'isexternal':{'type':Sequelize[_0x2853('0x2')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x2853('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e33d521..f377c51 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 _0x2cae=['keys','filters','intersection','attributes','fields','order','sort','filter','where','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','save','update','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x5c91e1,_0x18aaa5){var _0x1406b5=function(_0xd06e5f){while(--_0xd06e5f){_0x5c91e1['push'](_0x5c91e1['shift']());}};_0x1406b5(++_0x18aaa5);}(_0x2cae,0x1d4));var _0xe2ca=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x2cae[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require(_0xe2ca('0x0'));var rimraf=require(_0xe2ca('0x1'));var zipdir=require(_0xe2ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2ca('0x3'));var moment=require('moment');var BPromise=require(_0xe2ca('0x4'));var Mustache=require(_0xe2ca('0x5'));var util=require(_0xe2ca('0x6'));var path=require(_0xe2ca('0x7'));var sox=require(_0xe2ca('0x8'));var csv=require(_0xe2ca('0x9'));var ejs=require(_0xe2ca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2ca('0xb'));var squel=require(_0xe2ca('0xc'));var crypto=require('crypto');var jsforce=require(_0xe2ca('0xd'));var deskjs=require(_0xe2ca('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe2ca('0xf'));var Papa=require(_0xe2ca('0x10'));var Redis=require(_0xe2ca('0x11'));var authService=require(_0xe2ca('0x12'));var qs=require(_0xe2ca('0x13'));var as=require(_0xe2ca('0x14'));var hardwareService=require(_0xe2ca('0x15'));var logger=require(_0xe2ca('0x16'))(_0xe2ca('0x17'));var utils=require(_0xe2ca('0x18'));var config=require(_0xe2ca('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2ca('0x1a'))['db'];function respondWithStatusCode(_0x48fd5f,_0x3d7350){_0x3d7350=_0x3d7350||0xcc;return function(_0x28bad9){if(_0x28bad9){return _0x48fd5f[_0xe2ca('0x1b')](_0x3d7350);}return _0x48fd5f['status'](_0x3d7350)[_0xe2ca('0x1c')]();};}function respondWithResult(_0x4c290a,_0x5a74b1){_0x5a74b1=_0x5a74b1||0xc8;return function(_0x5a5d06){if(_0x5a5d06){return _0x4c290a[_0xe2ca('0x1d')](_0x5a74b1)[_0xe2ca('0x1e')](_0x5a5d06);}};}function respondWithFilteredResult(_0x267040,_0xf8683){return function(_0x3a94cd){if(_0x3a94cd){var _0x3000c1=typeof _0xf8683['offset']===_0xe2ca('0x1f')&&typeof _0xf8683['limit']===_0xe2ca('0x1f');var _0x360f4f=_0x3a94cd[_0xe2ca('0x20')];var _0x1c7f1c=_0x3000c1?0x0:_0xf8683[_0xe2ca('0x21')];var _0x146194=_0x3000c1?_0x3a94cd[_0xe2ca('0x20')]:_0xf8683[_0xe2ca('0x21')]+_0xf8683[_0xe2ca('0x22')];var _0x8751f6;if(_0x146194>=_0x360f4f){_0x146194=_0x360f4f;_0x8751f6=0xc8;}else{_0x8751f6=0xce;}_0x267040[_0xe2ca('0x1d')](_0x8751f6);return _0x267040[_0xe2ca('0x23')](_0xe2ca('0x24'),_0x1c7f1c+'-'+_0x146194+'/'+_0x360f4f)[_0xe2ca('0x1e')](_0x3a94cd);}return null;};}function patchUpdates(_0x96300b){return function(_0x207432){try{jsonpatch['apply'](_0x207432,_0x96300b,!![]);}catch(_0x59c4d2){return BPromise['reject'](_0x59c4d2);}return _0x207432[_0xe2ca('0x25')]();};}function saveUpdates(_0x4d9c4a,_0x4a2f3d){return function(_0x87f083){if(_0x87f083){return _0x87f083[_0xe2ca('0x26')](_0x4d9c4a)[_0xe2ca('0x27')](function(_0x1a9b1b){return _0x1a9b1b;});}return null;};}function removeEntity(_0x1b5588,_0x3cb81b){return function(_0x2fb542){if(_0x2fb542){return _0x2fb542[_0xe2ca('0x28')]()['then'](function(){_0x1b5588[_0xe2ca('0x1d')](0xcc)[_0xe2ca('0x1c')]();});}};}function handleEntityNotFound(_0x279c64,_0x3cf469){return function(_0x172905){if(!_0x172905){_0x279c64[_0xe2ca('0x1b')](0x194);}return _0x172905;};}function handleError(_0x1aa271,_0xe66c38){_0xe66c38=_0xe66c38||0x1f4;return function(_0x405ad5){logger['error'](_0x405ad5[_0xe2ca('0x29')]);if(_0x405ad5[_0xe2ca('0x2a')]){delete _0x405ad5[_0xe2ca('0x2a')];}_0x1aa271['status'](_0xe66c38)['send'](_0x405ad5);};}exports['index']=function(_0x3e9192,_0x506fb3){var _0x42efac={},_0xb03e06={},_0x37f0b3={'count':0x0,'rows':[]};var _0xdd9b11=_[_0xe2ca('0x2b')](db['VoiceTransferReport'][_0xe2ca('0x2c')],function(_0x443c65){return{'name':_0x443c65[_0xe2ca('0x2d')],'type':_0x443c65[_0xe2ca('0x2e')][_0xe2ca('0x2f')]};});_0xb03e06[_0xe2ca('0x30')]=_['map'](_0xdd9b11,_0xe2ca('0x2a'));_0xb03e06[_0xe2ca('0x31')]=_[_0xe2ca('0x32')](_0x3e9192[_0xe2ca('0x31')]);_0xb03e06[_0xe2ca('0x33')]=_[_0xe2ca('0x34')](_0xb03e06[_0xe2ca('0x30')],_0xb03e06[_0xe2ca('0x31')]);_0x42efac[_0xe2ca('0x35')]=_['intersection'](_0xb03e06[_0xe2ca('0x30')],qs[_0xe2ca('0x36')](_0x3e9192[_0xe2ca('0x31')]['fields']));_0x42efac[_0xe2ca('0x35')]=_0x42efac[_0xe2ca('0x35')]['length']?_0x42efac[_0xe2ca('0x35')]:_0xb03e06[_0xe2ca('0x30')];if(!_0x3e9192[_0xe2ca('0x31')]['hasOwnProperty']('nolimit')){_0x42efac[_0xe2ca('0x22')]=qs[_0xe2ca('0x22')](_0x3e9192[_0xe2ca('0x31')]['limit']);_0x42efac[_0xe2ca('0x21')]=qs['offset'](_0x3e9192[_0xe2ca('0x31')]['offset']);}_0x42efac[_0xe2ca('0x37')]=qs['sort'](_0x3e9192[_0xe2ca('0x31')][_0xe2ca('0x38')]);_0x42efac['where']=qs[_0xe2ca('0x33')](_['pick'](_0x3e9192[_0xe2ca('0x31')],_0xb03e06[_0xe2ca('0x33')]),_0xdd9b11);if(_0x3e9192['query'][_0xe2ca('0x39')]){_0x42efac[_0xe2ca('0x3a')]=_[_0xe2ca('0x3b')](_0x42efac[_0xe2ca('0x3a')],{'$or':_[_0xe2ca('0x2b')](_0xdd9b11,function(_0x53dd88){if(_0x53dd88[_0xe2ca('0x2e')]!==_0xe2ca('0x3c')){var _0x433eb9={};_0x433eb9[_0x53dd88['name']]={'$like':'%'+_0x3e9192[_0xe2ca('0x31')]['filter']+'%'};return _0x433eb9;}})});}_0x42efac=_['merge']({},_0x42efac,_0x3e9192[_0xe2ca('0x3d')]);var _0x122268={'where':_0x42efac['where']};return db[_0xe2ca('0x3e')]['count'](_0x122268)[_0xe2ca('0x27')](function(_0x4d6b87){_0x37f0b3[_0xe2ca('0x20')]=_0x4d6b87;if(_0x3e9192[_0xe2ca('0x31')][_0xe2ca('0x3f')]){_0x42efac[_0xe2ca('0x40')]=[{'all':!![]}];}return db[_0xe2ca('0x3e')]['findAll'](_0x42efac);})[_0xe2ca('0x27')](function(_0x38c403){_0x37f0b3[_0xe2ca('0x41')]=_0x38c403;return _0x37f0b3;})[_0xe2ca('0x27')](respondWithFilteredResult(_0x506fb3,_0x42efac))[_0xe2ca('0x42')](handleError(_0x506fb3,null));};exports[_0xe2ca('0x43')]=function(_0x2eaad0,_0x52d062){var _0x358f32={'raw':!![],'where':{'id':_0x2eaad0[_0xe2ca('0x44')]['id']}},_0x565cb3={};_0x565cb3[_0xe2ca('0x30')]=_[_0xe2ca('0x32')](db['VoiceTransferReport']['rawAttributes']);_0x565cb3[_0xe2ca('0x31')]=_[_0xe2ca('0x32')](_0x2eaad0[_0xe2ca('0x31')]);_0x565cb3[_0xe2ca('0x33')]=_[_0xe2ca('0x34')](_0x565cb3['model'],_0x565cb3[_0xe2ca('0x31')]);_0x358f32['attributes']=_['intersection'](_0x565cb3[_0xe2ca('0x30')],qs[_0xe2ca('0x36')](_0x2eaad0['query'][_0xe2ca('0x36')]));_0x358f32['attributes']=_0x358f32[_0xe2ca('0x35')][_0xe2ca('0x45')]?_0x358f32['attributes']:_0x565cb3['model'];if(_0x2eaad0[_0xe2ca('0x31')][_0xe2ca('0x3f')]){_0x358f32[_0xe2ca('0x40')]=[{'all':!![]}];}_0x358f32=_[_0xe2ca('0x3b')]({},_0x358f32,_0x2eaad0[_0xe2ca('0x3d')]);return db[_0xe2ca('0x3e')][_0xe2ca('0x46')](_0x358f32)[_0xe2ca('0x27')](handleEntityNotFound(_0x52d062,null))[_0xe2ca('0x27')](respondWithResult(_0x52d062,null))[_0xe2ca('0x42')](handleError(_0x52d062,null));};exports[_0xe2ca('0x47')]=function(_0x61ad17,_0x374a00){return db['VoiceTransferReport'][_0xe2ca('0x47')](_0x61ad17[_0xe2ca('0x48')],{})['then'](respondWithResult(_0x374a00,0xc9))[_0xe2ca('0x42')](handleError(_0x374a00,null));};exports[_0xe2ca('0x26')]=function(_0x2a9762,_0x5295d0){if(_0x2a9762[_0xe2ca('0x48')]['id']){delete _0x2a9762[_0xe2ca('0x48')]['id'];}return db[_0xe2ca('0x3e')]['find']({'where':{'id':_0x2a9762[_0xe2ca('0x44')]['id']}})['then'](handleEntityNotFound(_0x5295d0,null))['then'](saveUpdates(_0x2a9762[_0xe2ca('0x48')],null))[_0xe2ca('0x27')](respondWithResult(_0x5295d0,null))[_0xe2ca('0x42')](handleError(_0x5295d0,null));};exports['destroy']=function(_0x51632c,_0x591966){return db[_0xe2ca('0x3e')][_0xe2ca('0x46')]({'where':{'id':_0x51632c['params']['id']}})[_0xe2ca('0x27')](handleEntityNotFound(_0x591966,null))['then'](removeEntity(_0x591966,null))[_0xe2ca('0x42')](handleError(_0x591966,null));};exports['describe']=function(_0x5f2053,_0x3a7a12){return db[_0xe2ca('0x3e')][_0xe2ca('0x49')]()[_0xe2ca('0x27')](respondWithResult(_0x3a7a12,null))[_0xe2ca('0x42')](handleError(_0x3a7a12,null));}; \ No newline at end of file +var _0x4782=['length','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','VoiceTransferReport','count','include','findAll','rows','catch','show','params','fields','model','includeAll','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes'];(function(_0x10b2fe,_0x12ce20){var _0x15c915=function(_0x48a879){while(--_0x48a879){_0x10b2fe['push'](_0x10b2fe['shift']());}};_0x15c915(++_0x12ce20);}(_0x4782,0x1a0));var _0x2478=function(_0x527697,_0x2fa399){_0x527697=_0x527697-0x0;var _0x2aae6e=_0x4782[_0x527697];return _0x2aae6e;};'use strict';var emlformat=require(_0x2478('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2478('0x1'));var jsonpatch=require(_0x2478('0x2'));var rp=require(_0x2478('0x3'));var moment=require('moment');var BPromise=require(_0x2478('0x4'));var Mustache=require(_0x2478('0x5'));var util=require(_0x2478('0x6'));var path=require(_0x2478('0x7'));var sox=require(_0x2478('0x8'));var csv=require('to-csv');var ejs=require(_0x2478('0x9'));var fs=require('fs');var fs_extra=require(_0x2478('0xa'));var _=require(_0x2478('0xb'));var squel=require(_0x2478('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2478('0xd'));var Redis=require(_0x2478('0xe'));var authService=require(_0x2478('0xf'));var qs=require(_0x2478('0x10'));var as=require(_0x2478('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2478('0x12'))(_0x2478('0x13'));var utils=require(_0x2478('0x14'));var config=require(_0x2478('0x15'));var licenseUtil=require(_0x2478('0x16'));var db=require(_0x2478('0x17'))['db'];function respondWithStatusCode(_0x221ba8,_0x45d79c){_0x45d79c=_0x45d79c||0xcc;return function(_0x572527){if(_0x572527){return _0x221ba8[_0x2478('0x18')](_0x45d79c);}return _0x221ba8[_0x2478('0x19')](_0x45d79c)['end']();};}function respondWithResult(_0x548b46,_0x35c71e){_0x35c71e=_0x35c71e||0xc8;return function(_0x5a9ca1){if(_0x5a9ca1){return _0x548b46[_0x2478('0x19')](_0x35c71e)[_0x2478('0x1a')](_0x5a9ca1);}};}function respondWithFilteredResult(_0x2c72f4,_0x4b5b4c){return function(_0x1b0efe){if(_0x1b0efe){var _0x257806=typeof _0x4b5b4c['offset']==='undefined'&&typeof _0x4b5b4c[_0x2478('0x1b')]===_0x2478('0x1c');var _0x5c12ca=_0x1b0efe['count'];var _0xa691c1=_0x257806?0x0:_0x4b5b4c[_0x2478('0x1d')];var _0x77d90f=_0x257806?_0x1b0efe['count']:_0x4b5b4c[_0x2478('0x1d')]+_0x4b5b4c['limit'];var _0x59fd26;if(_0x77d90f>=_0x5c12ca){_0x77d90f=_0x5c12ca;_0x59fd26=0xc8;}else{_0x59fd26=0xce;}_0x2c72f4[_0x2478('0x19')](_0x59fd26);return _0x2c72f4[_0x2478('0x1e')](_0x2478('0x1f'),_0xa691c1+'-'+_0x77d90f+'/'+_0x5c12ca)[_0x2478('0x1a')](_0x1b0efe);}return null;};}function patchUpdates(_0x4e45d8){return function(_0x305a68){try{jsonpatch[_0x2478('0x20')](_0x305a68,_0x4e45d8,!![]);}catch(_0x2df548){return BPromise[_0x2478('0x21')](_0x2df548);}return _0x305a68[_0x2478('0x22')]();};}function saveUpdates(_0x4f5bc6,_0x4f529a){return function(_0x1d0dda){if(_0x1d0dda){return _0x1d0dda['update'](_0x4f5bc6)[_0x2478('0x23')](function(_0x3ab11a){return _0x3ab11a;});}return null;};}function removeEntity(_0x2871f4,_0xa5f034){return function(_0xfb7636){if(_0xfb7636){return _0xfb7636[_0x2478('0x24')]()[_0x2478('0x23')](function(){_0x2871f4[_0x2478('0x19')](0xcc)[_0x2478('0x25')]();});}};}function handleEntityNotFound(_0x3ecd18,_0x446f56){return function(_0x1fd95b){if(!_0x1fd95b){_0x3ecd18[_0x2478('0x18')](0x194);}return _0x1fd95b;};}function handleError(_0x362b92,_0x3a035d){_0x3a035d=_0x3a035d||0x1f4;return function(_0x1b948d){logger[_0x2478('0x26')](_0x1b948d[_0x2478('0x27')]);if(_0x1b948d['name']){delete _0x1b948d[_0x2478('0x28')];}_0x362b92[_0x2478('0x19')](_0x3a035d)[_0x2478('0x29')](_0x1b948d);};}exports[_0x2478('0x2a')]=function(_0x4c0507,_0x5a7dfb){var _0x1e540e={},_0x108196={},_0x4094e1={'count':0x0,'rows':[]};var _0x21af7b=_['map'](db['VoiceTransferReport'][_0x2478('0x2b')],function(_0x2854c1){return{'name':_0x2854c1[_0x2478('0x2c')],'type':_0x2854c1[_0x2478('0x2d')][_0x2478('0x2e')]};});_0x108196['model']=_[_0x2478('0x2f')](_0x21af7b,_0x2478('0x28'));_0x108196[_0x2478('0x30')]=_[_0x2478('0x31')](_0x4c0507[_0x2478('0x30')]);_0x108196['filters']=_[_0x2478('0x32')](_0x108196['model'],_0x108196[_0x2478('0x30')]);_0x1e540e['attributes']=_['intersection'](_0x108196['model'],qs['fields'](_0x4c0507[_0x2478('0x30')]['fields']));_0x1e540e[_0x2478('0x33')]=_0x1e540e[_0x2478('0x33')][_0x2478('0x34')]?_0x1e540e[_0x2478('0x33')]:_0x108196['model'];if(!_0x4c0507[_0x2478('0x30')]['hasOwnProperty']('nolimit')){_0x1e540e[_0x2478('0x1b')]=qs[_0x2478('0x1b')](_0x4c0507[_0x2478('0x30')]['limit']);_0x1e540e['offset']=qs['offset'](_0x4c0507['query']['offset']);}_0x1e540e[_0x2478('0x35')]=qs[_0x2478('0x36')](_0x4c0507[_0x2478('0x30')]['sort']);_0x1e540e['where']=qs[_0x2478('0x37')](_[_0x2478('0x38')](_0x4c0507[_0x2478('0x30')],_0x108196['filters']),_0x21af7b);if(_0x4c0507['query'][_0x2478('0x39')]){_0x1e540e[_0x2478('0x3a')]=_[_0x2478('0x3b')](_0x1e540e[_0x2478('0x3a')],{'$or':_['map'](_0x21af7b,function(_0x42e6c6){if(_0x42e6c6['type']!==_0x2478('0x3c')){var _0x142e07={};_0x142e07[_0x42e6c6[_0x2478('0x28')]]={'$like':'%'+_0x4c0507['query'][_0x2478('0x39')]+'%'};return _0x142e07;}})});}_0x1e540e=_[_0x2478('0x3b')]({},_0x1e540e,_0x4c0507[_0x2478('0x3d')]);var _0x287df7={'where':_0x1e540e['where']};return db[_0x2478('0x3e')]['count'](_0x287df7)['then'](function(_0x39c558){_0x4094e1[_0x2478('0x3f')]=_0x39c558;if(_0x4c0507[_0x2478('0x30')]['includeAll']){_0x1e540e[_0x2478('0x40')]=[{'all':!![]}];}return db[_0x2478('0x3e')][_0x2478('0x41')](_0x1e540e);})[_0x2478('0x23')](function(_0x5df296){_0x4094e1[_0x2478('0x42')]=_0x5df296;return _0x4094e1;})[_0x2478('0x23')](respondWithFilteredResult(_0x5a7dfb,_0x1e540e))[_0x2478('0x43')](handleError(_0x5a7dfb,null));};exports[_0x2478('0x44')]=function(_0x236d2c,_0x415041){var _0x5adc79={'raw':!![],'where':{'id':_0x236d2c[_0x2478('0x45')]['id']}},_0x209c55={};_0x209c55['model']=_[_0x2478('0x31')](db[_0x2478('0x3e')]['rawAttributes']);_0x209c55[_0x2478('0x30')]=_[_0x2478('0x31')](_0x236d2c['query']);_0x209c55[_0x2478('0x37')]=_[_0x2478('0x32')](_0x209c55['model'],_0x209c55[_0x2478('0x30')]);_0x5adc79['attributes']=_[_0x2478('0x32')](_0x209c55['model'],qs[_0x2478('0x46')](_0x236d2c['query'][_0x2478('0x46')]));_0x5adc79[_0x2478('0x33')]=_0x5adc79[_0x2478('0x33')][_0x2478('0x34')]?_0x5adc79[_0x2478('0x33')]:_0x209c55[_0x2478('0x47')];if(_0x236d2c[_0x2478('0x30')][_0x2478('0x48')]){_0x5adc79['include']=[{'all':!![]}];}_0x5adc79=_['merge']({},_0x5adc79,_0x236d2c[_0x2478('0x3d')]);return db['VoiceTransferReport'][_0x2478('0x49')](_0x5adc79)['then'](handleEntityNotFound(_0x415041,null))[_0x2478('0x23')](respondWithResult(_0x415041,null))[_0x2478('0x43')](handleError(_0x415041,null));};exports[_0x2478('0x4a')]=function(_0x457f44,_0x47620b){return db['VoiceTransferReport'][_0x2478('0x4a')](_0x457f44[_0x2478('0x4b')],{})[_0x2478('0x23')](respondWithResult(_0x47620b,0xc9))[_0x2478('0x43')](handleError(_0x47620b,null));};exports[_0x2478('0x4c')]=function(_0x29ecba,_0xa4f24b){if(_0x29ecba[_0x2478('0x4b')]['id']){delete _0x29ecba['body']['id'];}return db[_0x2478('0x3e')][_0x2478('0x49')]({'where':{'id':_0x29ecba[_0x2478('0x45')]['id']}})[_0x2478('0x23')](handleEntityNotFound(_0xa4f24b,null))['then'](saveUpdates(_0x29ecba[_0x2478('0x4b')],null))[_0x2478('0x23')](respondWithResult(_0xa4f24b,null))[_0x2478('0x43')](handleError(_0xa4f24b,null));};exports['destroy']=function(_0x5b7f2f,_0x502ace){return db[_0x2478('0x3e')][_0x2478('0x49')]({'where':{'id':_0x5b7f2f['params']['id']}})[_0x2478('0x23')](handleEntityNotFound(_0x502ace,null))[_0x2478('0x23')](removeEntity(_0x502ace,null))[_0x2478('0x43')](handleError(_0x502ace,null));};exports[_0x2478('0x4d')]=function(_0x156bef,_0xa6f62f){return db['VoiceTransferReport'][_0x2478('0x4d')]()[_0x2478('0x23')](respondWithResult(_0xa6f62f,null))[_0x2478('0x43')](handleError(_0xa6f62f,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 3391eef..9c79a4e 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 _0x46fd=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','report_call_transfer','lodash'];(function(_0x2ec2d4,_0x2c73f9){var _0x5c35c4=function(_0x413355){while(--_0x413355){_0x2ec2d4['push'](_0x2ec2d4['shift']());}};_0x5c35c4(++_0x2c73f9);}(_0x46fd,0x149));var _0xd46f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x46fd[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xd46f('0x0'));var util=require(_0xd46f('0x1'));var logger=require(_0xd46f('0x2'))(_0xd46f('0x3'));var moment=require(_0xd46f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46f('0x5'));var rimraf=require(_0xd46f('0x6'));var config=require(_0xd46f('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xd46f('0x8')]=function(_0x27a2ca,_0x944a81){return _0x27a2ca['define']('VoiceTransferReport',attributes,{'tableName':_0xd46f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80d4=['exports','VoiceTransferReport','report_call_transfer','util','api','moment','bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80d4,0x107));var _0x480d=function(_0x2927f7,_0x85296e){_0x2927f7=_0x2927f7-0x0;var _0x1088bc=_0x80d4[_0x2927f7];return _0x1088bc;};'use strict';var _=require('lodash');var util=require(_0x480d('0x0'));var logger=require('../../config/logger')(_0x480d('0x1'));var moment=require(_0x480d('0x2'));var BPromise=require(_0x480d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x480d('0x4'));var config=require(_0x480d('0x5'));var attributes=require(_0x480d('0x6'));module[_0x480d('0x7')]=function(_0x6ea376,_0x1dc970){return _0x6ea376['define'](_0x480d('0x8'),attributes,{'tableName':_0x480d('0x9'),'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 0cc368e..9005655 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 _0x722d=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','CreateVoiceTransferReport','VoiceTransferReport','options','raw','debug'];(function(_0x4ae8c2,_0x409a64){var _0x252e29=function(_0x4ead37){while(--_0x4ead37){_0x4ae8c2['push'](_0x4ae8c2['shift']());}};_0x252e29(++_0x409a64);}(_0x722d,0x150));var _0xd722=function(_0x334d06,_0x35d6f5){_0x334d06=_0x334d06-0x0;var _0xce23fe=_0x722d[_0x334d06];return _0xce23fe;};'use strict';var _=require(_0xd722('0x0'));var util=require(_0xd722('0x1'));var moment=require(_0xd722('0x2'));var BPromise=require('bluebird');var rs=require(_0xd722('0x3'));var fs=require('fs');var Redis=require(_0xd722('0x4'));var db=require(_0xd722('0x5'))['db'];var utils=require(_0xd722('0x6'));var logger=require(_0xd722('0x7'))('rpc');var config=require(_0xd722('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd722('0x9')][_0xd722('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c35d3,_0x428ff9,_0x5ca201){return new BPromise(function(_0x34adfb,_0x743da0){return client['request'](_0x3c35d3,_0x5ca201)[_0xd722('0xb')](function(_0x547678){logger['info'](_0xd722('0xc'),_0x428ff9,_0xd722('0xd'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x428ff9,_0xd722('0xd'),JSON[_0xd722('0xe')](_0x547678));if(_0x547678['error']){if(_0x547678['error'][_0xd722('0xf')]===0x1f4){logger[_0xd722('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x428ff9,_0x547678[_0xd722('0x10')][_0xd722('0x11')]);return _0x743da0(_0x547678[_0xd722('0x10')][_0xd722('0x11')]);}logger[_0xd722('0x10')](_0xd722('0xc'),_0x428ff9,_0x547678[_0xd722('0x10')]['message']);return _0x34adfb(_0x547678[_0xd722('0x10')]['message']);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x428ff9,'request\x20sent');_0x34adfb(_0x547678['result'][_0xd722('0x11')]);}})[_0xd722('0x12')](function(_0x5e28ce){logger[_0xd722('0x10')](_0xd722('0xc'),_0x428ff9,_0x5e28ce);_0x743da0(_0x5e28ce);});});}exports[_0xd722('0x13')]=function(_0x58e526){var _0x33649d=this;return new Promise(function(_0x26960c,_0x4b7624){return db[_0xd722('0x14')]['create'](_0x58e526['body'],{'raw':_0x58e526['options']?_0x58e526[_0xd722('0x15')][_0xd722('0x16')]===undefined?!![]:![]:!![]})[_0xd722('0xb')](function(_0x2e5e07){logger['info']('CreateVoiceTransferReport',_0x58e526);logger[_0xd722('0x17')]('CreateVoiceTransferReport',_0x58e526,JSON[_0xd722('0xe')](_0x2e5e07));_0x26960c(_0x2e5e07);})[_0xd722('0x12')](function(_0x242acd){logger[_0xd722('0x10')](_0xd722('0x13'),_0x242acd[_0xd722('0x11')],_0x58e526);_0x4b7624(_0x33649d[_0xd722('0x10')](0x1f4,_0x242acd[_0xd722('0x11')]));});});}; \ No newline at end of file +var _0x6997=['jayson/promise','client','then','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','VoiceTransferReport,\x20%s,\x20%s','message','info','catch','CreateVoiceTransferReport','create','options','raw','debug','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x586c8b,_0x40a403){var _0xa1cdc5=function(_0x259a6c){while(--_0x259a6c){_0x586c8b['push'](_0x586c8b['shift']());}};_0xa1cdc5(++_0x40a403);}(_0x6997,0x71));var _0x7699=function(_0x4b6bcc,_0x2abddf){_0x4b6bcc=_0x4b6bcc-0x0;var _0x5ca61c=_0x6997[_0x4b6bcc];return _0x5ca61c;};'use strict';var _=require('lodash');var util=require(_0x7699('0x0'));var moment=require(_0x7699('0x1'));var BPromise=require('bluebird');var rs=require(_0x7699('0x2'));var fs=require('fs');var Redis=require(_0x7699('0x3'));var db=require(_0x7699('0x4'))['db'];var utils=require(_0x7699('0x5'));var logger=require(_0x7699('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7699('0x7'));var client=jayson[_0x7699('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9a48a5,_0x5f4d68,_0x5f3c3f){return new BPromise(function(_0x114d95,_0x30e868){return client['request'](_0x9a48a5,_0x5f3c3f)[_0x7699('0x9')](function(_0x52668e){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x5f4d68,_0x7699('0xa'));logger['debug'](_0x7699('0xb'),_0x5f4d68,_0x7699('0xa'),JSON['stringify'](_0x52668e));if(_0x52668e[_0x7699('0xc')]){if(_0x52668e[_0x7699('0xc')][_0x7699('0xd')]===0x1f4){logger[_0x7699('0xc')](_0x7699('0xe'),_0x5f4d68,_0x52668e['error'][_0x7699('0xf')]);return _0x30e868(_0x52668e[_0x7699('0xc')]['message']);}logger['error'](_0x7699('0xe'),_0x5f4d68,_0x52668e[_0x7699('0xc')]['message']);return _0x114d95(_0x52668e[_0x7699('0xc')][_0x7699('0xf')]);}else{logger[_0x7699('0x10')](_0x7699('0xe'),_0x5f4d68,_0x7699('0xa'));_0x114d95(_0x52668e['result'][_0x7699('0xf')]);}})[_0x7699('0x11')](function(_0x348d71){logger[_0x7699('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x5f4d68,_0x348d71);_0x30e868(_0x348d71);});});}exports[_0x7699('0x12')]=function(_0x2613e4){var _0x19d8de=this;return new Promise(function(_0x54f115,_0x1927af){return db['VoiceTransferReport'][_0x7699('0x13')](_0x2613e4['body'],{'raw':_0x2613e4['options']?_0x2613e4[_0x7699('0x14')][_0x7699('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x2d634e){logger['info'](_0x7699('0x12'),_0x2613e4);logger[_0x7699('0x16')](_0x7699('0x12'),_0x2613e4,JSON[_0x7699('0x17')](_0x2d634e));_0x54f115(_0x2d634e);})[_0x7699('0x11')](function(_0x473b6f){logger['error'](_0x7699('0x12'),_0x473b6f[_0x7699('0xf')],_0x2613e4);_0x1927af(_0x19d8de[_0x7699('0xc')](0x1f4,_0x473b6f[_0x7699('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 165accb..6a72a7e 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 _0xedd9=['unhold','/calls','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','/unhold'];(function(_0x2ec1dd,_0x57d18c){var _0x2fa2ad=function(_0x103ecb){while(--_0x103ecb){_0x2ec1dd['push'](_0x2ec1dd['shift']());}};_0x2fa2ad(++_0x57d18c);}(_0xedd9,0xfc));var _0x9edd=function(_0x251b06,_0x92dd52){_0x251b06=_0x251b06-0x0;var _0x5a7c0f=_0xedd9[_0x251b06];return _0x5a7c0f;};'use strict';var express=require('express');var router=express[_0x9edd('0x0')]();var auth=require(_0x9edd('0x1'));var controller=require(_0x9edd('0x2'));router[_0x9edd('0x3')](_0x9edd('0x4'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x7')]);router['post'](_0x9edd('0x8'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x9')]);router['post'](_0x9edd('0xa'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xb')]);router[_0x9edd('0x3')](_0x9edd('0xc'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller['hold']);router[_0x9edd('0x3')](_0x9edd('0xd'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xe')]);router['post'](_0x9edd('0xf'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x3')](_0x9edd('0x11'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller['transfer']);module[_0x9edd('0x12')]=router; \ No newline at end of file +var _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x2ecbe5,_0x184e26){var _0x204c5a=function(_0x397b82){while(--_0x397b82){_0x2ecbe5['push'](_0x2ecbe5['shift']());}};_0x204c5a(++_0x184e26);}(_0x5b02,0xe9));var _0x25b0=function(_0x1cb82b,_0x27f0b2){_0x1cb82b=_0x1cb82b-0x0;var _0x1812a0=_0x5b02[_0x1cb82b];return _0x1812a0;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index ba5595e..72b9181 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 _0xc788=['all','filter','rows','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','format','webbar:originate','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer\x20fired:','user:%s','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','bluebird','jayson/promise','client','http','../../config/logger','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','error','name','send','status','NotFound','request','then','code','message','result','catch','findOne','agent','VoiceChannels'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xc788,0xc4));var _0x8c78=function(_0x3f2302,_0x3c3363){_0x3f2302=_0x3f2302-0x0;var _0x55fed4=_0xc788[_0x3f2302];return _0x55fed4;};'use strict';var path=require(_0x8c78('0x0'));var fs=require('fs');var _=require(_0x8c78('0x1'));var db=require(_0x8c78('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x8c78('0x3'));var jayson=require(_0x8c78('0x4'));var amiClient=jayson[_0x8c78('0x5')][_0x8c78('0x6')]({'port':0x232a});var logger=require(_0x8c78('0x7'))('webbarapi');var Redis=require(_0x8c78('0x8'));config[_0x8c78('0x9')]=_[_0x8c78('0xa')](config[_0x8c78('0x9')],{'host':_0x8c78('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8c78('0x9')]));var Schema=require(_0x8c78('0xc'));var originateValidation=new Schema({'userId':{'type':_0x8c78('0xd'),'required':[!![],_0x8c78('0xe')]},'callNumber':{'type':_0x8c78('0xf'),'required':[!![],_0x8c78('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x8c78('0xf')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8c78('0xe')]},'sessionId':{'type':_0x8c78('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8c78('0xe')]},'sessionId':{'type':_0x8c78('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8c78('0xe')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x8c78('0xf'),'required':[!![],_0x8c78('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x8c78('0xd'),'required':[!![],_0x8c78('0xe')]},'sessionId':{'type':_0x8c78('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8c78('0xd'),'required':[!![],_0x8c78('0xe')]},'sessionId':{'type':_0x8c78('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8c78('0xd'),'required':[!![],_0x8c78('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8c78('0xe')]}});function emit(_0x293cfe,_0x57ad11,_0x45b85f){logger[_0x8c78('0x12')](_0x293cfe,_0x57ad11,JSON[_0x8c78('0x13')](_0x45b85f));io['to'](_0x293cfe)[_0x8c78('0x14')](_0x57ad11,_0x45b85f);}function handleError(_0x2a982c){return function(_0x461eff){console['log']('handleError:',_0x461eff,_0x461eff instanceof RangeError);logger[_0x8c78('0x15')](_0x461eff['stack']);if(_0x461eff instanceof RangeError){if(_0x461eff['name']){delete _0x461eff[_0x8c78('0x16')];}_0x2a982c['status'](0x194)[_0x8c78('0x17')](_0x461eff);}else{if(_0x461eff[_0x8c78('0x16')]){delete _0x461eff['name'];}_0x2a982c[_0x8c78('0x18')](0x1f4)['send'](_0x461eff);}};}function checkError(){return function(_0x2dba52){if(!_0x2dba52){throw new RangeError(_0x8c78('0x19'));}return _0x2dba52;};}function respondWithRpcPromise(_0x5a254d,_0xd1ae4d){return new BPromise(function(_0x188cc3,_0x499603){var _0x2bc595=amiClient;return _0x2bc595[_0x8c78('0x1a')](_0x5a254d,_0xd1ae4d)[_0x8c78('0x1b')](function(_0x9581c6){if(_0x9581c6[_0x8c78('0x15')]){if(_0x9581c6[_0x8c78('0x15')][_0x8c78('0x1c')]===0x1f4){return _0x499603(_0x9581c6[_0x8c78('0x15')][_0x8c78('0x1d')]);}return _0x188cc3(_0x9581c6['error'][_0x8c78('0x1d')]);}else{_0x188cc3(_0x9581c6[_0x8c78('0x1e')]);}})[_0x8c78('0x1f')](function(_0x49cccb){_0x499603(_0x49cccb);});});}function getAgent(_0x331bfe){return db['User'][_0x8c78('0x20')]({'where':{'id':_0x331bfe,'role':_0x8c78('0x21')}})[_0x8c78('0x1b')](checkError());}function getAgentCheckSession(_0x496c51,_0x583a74){return new BPromise(function(_0x2568d5,_0x4be49d){var _0x20b128=respondWithRpcPromise(_0x8c78('0x22'));var _0x394c1d=getAgent(_0x496c51);Promise[_0x8c78('0x23')]([_0x20b128,_0x394c1d])[_0x8c78('0x1b')](function(_0x2ab5cc){var _0x5ba7d4=_0x2ab5cc[0x0];var _0x1c3039=_0x2ab5cc[0x1];var _0x51add6=_[_0x8c78('0x24')](_0x5ba7d4[_0x8c78('0x25')],function(_0xb69c52){return _0xb69c52['UserId']==_0x1c3039['id']&&_0xb69c52[_0x8c78('0x26')]==_0x583a74;});if(_0x51add6[_0x8c78('0x27')]==0x1){_0x2568d5(_0x1c3039);}else{_0x4be49d(new RangeError('sessionId\x20'+_0x583a74+_0x8c78('0x28')));}});});}exports[_0x8c78('0x29')]=function(_0x32bc1f,_0x487a4c){logger[_0x8c78('0x12')](_0x8c78('0x2a'),_0x32bc1f[_0x8c78('0x2b')]);var _0x5348ab=originateValidation[_0x8c78('0xc')](_0x32bc1f[_0x8c78('0x2b')]);if(_0x5348ab['length']>0x0){return _0x487a4c[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x5348ab);}var _0x3a9372=_0x32bc1f[_0x8c78('0x2b')][_0x8c78('0x2d')];var _0x5b5429=_0x32bc1f[_0x8c78('0x2b')][_0x8c78('0x2e')];var _0x201a43=_0x32bc1f[_0x8c78('0x2b')]['callerId'];var _0x3e9bf1=_0x32bc1f[_0x8c78('0x2b')][_0x8c78('0x2f')];return getAgent(_0x3a9372)[_0x8c78('0x1b')](function(_0x34481a){logger['info'](_0x8c78('0x30'),_0x34481a[_0x8c78('0x16')]);emit(util[_0x8c78('0x31')]('user:%s',_0x34481a[_0x8c78('0x16')]),_0x8c78('0x32'),{'callNumber':_0x5b5429,'callerId':_0x201a43,'callbackUrl':_0x3e9bf1});return _0x487a4c['status'](0xc8)[_0x8c78('0x2c')]({'error':![],'message':'originate\x20executed!'});})[_0x8c78('0x1f')](handleError(_0x487a4c));};exports[_0x8c78('0x33')]=function(_0x245f62,_0x157b81){logger['info'](_0x8c78('0x34'),_0x245f62['body']);var _0x3b8f4f=hangupValidation[_0x8c78('0xc')](_0x245f62[_0x8c78('0x2b')]);if(_0x3b8f4f['length']>0x0){return _0x157b81['status'](0x190)[_0x8c78('0x2c')](_0x3b8f4f);}var _0x25d143=_0x245f62[_0x8c78('0x2b')][_0x8c78('0x2d')];var _0x2eb3ef=_0x245f62[_0x8c78('0x2b')][_0x8c78('0x26')];return getAgent(_0x25d143)[_0x8c78('0x1b')](function(_0x1f0a2b){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x1f0a2b[_0x8c78('0x16')]);emit(util[_0x8c78('0x31')]('user:%s',_0x1f0a2b[_0x8c78('0x16')]),_0x8c78('0x35'),{'sessionId':_0x2eb3ef});return _0x157b81['status'](0xc8)['json']({'error':![],'message':_0x8c78('0x36')});})[_0x8c78('0x1f')](handleError(_0x157b81));};exports['answer']=function(_0x224c4b,_0x57ff42){logger['info'](_0x8c78('0x37'),_0x224c4b[_0x8c78('0x2b')]);var _0x57e2c7=answerValidation[_0x8c78('0xc')](_0x224c4b[_0x8c78('0x2b')]);if(_0x57e2c7[_0x8c78('0x27')]>0x0){return _0x57ff42[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x57e2c7);}var _0x4e4880=_0x224c4b['body'][_0x8c78('0x2d')];var _0x2f6a6b=_0x224c4b[_0x8c78('0x2b')][_0x8c78('0x26')];return getAgent(_0x4e4880)[_0x8c78('0x1b')](function(_0x460821){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x460821[_0x8c78('0x16')]);emit(util[_0x8c78('0x31')](_0x8c78('0x38'),_0x460821['name']),_0x8c78('0x39'),{'sessionId':_0x2f6a6b});return _0x57ff42[_0x8c78('0x18')](0xc8)[_0x8c78('0x2c')]({'error':![],'message':_0x8c78('0x3a')});})[_0x8c78('0x1f')](handleError(_0x57ff42));};exports['hold']=function(_0x356e47,_0x4588cd){logger[_0x8c78('0x12')](_0x8c78('0x3b'),_0x356e47[_0x8c78('0x2b')]);var _0x5cc829=holdValidation[_0x8c78('0xc')](_0x356e47['body']);if(_0x5cc829['length']>0x0){return _0x4588cd[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x5cc829);}var _0x61e20=_0x356e47['body'][_0x8c78('0x2d')];var _0xc6ba23=_0x356e47[_0x8c78('0x2b')][_0x8c78('0x26')];return getAgent(_0x61e20)[_0x8c78('0x1b')](function(_0x38083e){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x38083e[_0x8c78('0x16')]);emit(util['format'](_0x8c78('0x38'),_0x38083e[_0x8c78('0x16')]),_0x8c78('0x3c'),{'sessionId':_0xc6ba23});return _0x4588cd[_0x8c78('0x18')](0xc8)['json']({'error':![],'message':_0x8c78('0x3d')});})[_0x8c78('0x1f')](handleError(_0x4588cd));};exports[_0x8c78('0x3e')]=function(_0x431125,_0x53e75c){logger[_0x8c78('0x12')](_0x8c78('0x3f'),_0x431125[_0x8c78('0x2b')]);var _0x551e0f=unholdValidation[_0x8c78('0xc')](_0x431125['body']);if(_0x551e0f[_0x8c78('0x27')]>0x0){return _0x53e75c[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x551e0f);}var _0xa87aba=_0x431125[_0x8c78('0x2b')][_0x8c78('0x2d')];var _0xf68e0=_0x431125[_0x8c78('0x2b')][_0x8c78('0x26')];return getAgent(_0xa87aba)[_0x8c78('0x1b')](function(_0x23e568){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x23e568[_0x8c78('0x16')]);emit(util['format'](_0x8c78('0x38'),_0x23e568[_0x8c78('0x16')]),_0x8c78('0x40'),{'sessionId':_0xf68e0});return _0x53e75c[_0x8c78('0x18')](0xc8)['json']({'error':![],'message':_0x8c78('0x41')});})[_0x8c78('0x1f')](handleError(_0x53e75c));};exports[_0x8c78('0x42')]=function(_0x2b9b18,_0x40025d){logger[_0x8c78('0x12')]('calls\x20fired:',_0x40025d[_0x8c78('0x2b')]);var _0x42a34e=callsValidation['validate'](_0x2b9b18[_0x8c78('0x2b')]);if(_0x42a34e['length']>0x0){return _0x40025d[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x42a34e);}var _0x257533=_0x2b9b18[_0x8c78('0x2b')][_0x8c78('0x2d')];var _0x35cf85=respondWithRpcPromise(_0x8c78('0x22'));var _0x49fa4c=getAgent(_0x257533);return Promise[_0x8c78('0x23')]([_0x35cf85,_0x49fa4c])[_0x8c78('0x1b')](function(_0x4e77a9){var _0x110e7b=_0x4e77a9[0x0];var _0x3529aa=_0x4e77a9[0x1];var _0x577361=_[_0x8c78('0x24')](_0x110e7b[_0x8c78('0x25')],function(_0x3e2160){return _0x3e2160[_0x8c78('0x43')]==_0x3529aa['id'];});return _0x40025d[_0x8c78('0x18')](0xc8)[_0x8c78('0x2c')]({'count':_0x577361[_0x8c78('0x27')],'rows':_0x577361});})[_0x8c78('0x1f')](handleError(_0x40025d));};exports[_0x8c78('0x44')]=function(_0x1b3600,_0x25b8bc){logger[_0x8c78('0x12')](_0x8c78('0x45'),_0x1b3600[_0x8c78('0x2b')]);var _0x50ae7d=conferenceValidation[_0x8c78('0xc')](_0x1b3600['body']);if(_0x50ae7d[_0x8c78('0x27')]>0x0){return _0x25b8bc['status'](0x190)['json'](_0x50ae7d);}var _0x57a4b1=_0x1b3600[_0x8c78('0x2b')]['userId'];return getAgent(_0x57a4b1)['then'](function(_0x502991){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x502991[_0x8c78('0x16')]);emit(util[_0x8c78('0x31')]('user:%s',_0x502991[_0x8c78('0x16')]),_0x8c78('0x46'));return _0x25b8bc[_0x8c78('0x18')](0xc8)[_0x8c78('0x2c')]({'error':![],'message':_0x8c78('0x47')});})[_0x8c78('0x1f')](handleError(_0x25b8bc));};exports[_0x8c78('0x48')]=function(_0x54d561,_0x25c255){logger[_0x8c78('0x12')](_0x8c78('0x49'),_0x54d561[_0x8c78('0x2b')]);var _0x3e1ee0=transferValidation[_0x8c78('0xc')](_0x54d561['body']);if(_0x3e1ee0[_0x8c78('0x27')]>0x0){return _0x25c255['status'](0x190)[_0x8c78('0x2c')](_0x3e1ee0);}var _0x28d1a7=_0x54d561[_0x8c78('0x2b')]['userId'];var _0x97df9c=_0x54d561[_0x8c78('0x2b')][_0x8c78('0x26')];var _0x4fa0b0=_0x54d561[_0x8c78('0x2b')][_0x8c78('0x4a')];return getAgent(_0x28d1a7)['then'](function(_0xbfafd1){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0xbfafd1['name']);emit(util[_0x8c78('0x31')](_0x8c78('0x38'),_0xbfafd1[_0x8c78('0x16')]),_0x8c78('0x4b'),{'sessionId':_0x97df9c,'transferNumber':_0x4fa0b0});return _0x25c255[_0x8c78('0x18')](0xc8)[_0x8c78('0x2c')]({'error':![],'message':_0x8c78('0x4c')});})[_0x8c78('0x1f')](handleError(_0x25c255));}; \ No newline at end of file +var _0x2f68=['conference\x20fired:','conference\x20executed!','transferNumber','webbar:transfer','lodash','../../mysqldb','../../config/environment','util','jayson/promise','http','../../config/logger','ioredis','redis','localhost','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','message','result','catch','User','agent','then','all','filter','rows','UserId','sessionId','length','sessionId\x20','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','VoiceChannels','conference'];(function(_0x4e0f70,_0x375e11){var _0x21e651=function(_0x2a7f92){while(--_0x2a7f92){_0x4e0f70['push'](_0x4e0f70['shift']());}};_0x21e651(++_0x375e11);}(_0x2f68,0x9a));var _0x82f6=function(_0x17205e,_0x171e68){_0x17205e=_0x17205e-0x0;var _0x30e4f6=_0x2f68[_0x17205e];return _0x30e4f6;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x82f6('0x0'));var db=require(_0x82f6('0x1'))['db'];var config=require(_0x82f6('0x2'));var util=require(_0x82f6('0x3'));var BPromise=require('bluebird');var jayson=require(_0x82f6('0x4'));var amiClient=jayson['client'][_0x82f6('0x5')]({'port':0x232a});var logger=require(_0x82f6('0x6'))('webbarapi');var Redis=require(_0x82f6('0x7'));config[_0x82f6('0x8')]=_['defaults'](config['redis'],{'host':_0x82f6('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x82f6('0xa'));var originateValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'callNumber':{'type':'string','required':[!![],_0x82f6('0xd')]},'callerId':{'type':_0x82f6('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x82f6('0xe'),'required':[!![],_0x82f6('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x249222,_0x1d0263,_0x31b4fb){logger[_0x82f6('0x10')](_0x249222,_0x1d0263,JSON[_0x82f6('0x11')](_0x31b4fb));io['to'](_0x249222)[_0x82f6('0x12')](_0x1d0263,_0x31b4fb);}function handleError(_0x326378){return function(_0xcbc95f){console[_0x82f6('0x13')](_0x82f6('0x14'),_0xcbc95f,_0xcbc95f instanceof RangeError);logger[_0x82f6('0x15')](_0xcbc95f[_0x82f6('0x16')]);if(_0xcbc95f instanceof RangeError){if(_0xcbc95f[_0x82f6('0x17')]){delete _0xcbc95f[_0x82f6('0x17')];}_0x326378[_0x82f6('0x18')](0x194)['send'](_0xcbc95f);}else{if(_0xcbc95f[_0x82f6('0x17')]){delete _0xcbc95f[_0x82f6('0x17')];}_0x326378['status'](0x1f4)[_0x82f6('0x19')](_0xcbc95f);}};}function checkError(){return function(_0x4b9f0){if(!_0x4b9f0){throw new RangeError(_0x82f6('0x1a'));}return _0x4b9f0;};}function respondWithRpcPromise(_0x25cae6,_0x4bfeb8){return new BPromise(function(_0xdc4dea,_0x4beccf){var _0x8668bb=amiClient;return _0x8668bb[_0x82f6('0x1b')](_0x25cae6,_0x4bfeb8)['then'](function(_0x516deb){if(_0x516deb[_0x82f6('0x15')]){if(_0x516deb[_0x82f6('0x15')]['code']===0x1f4){return _0x4beccf(_0x516deb['error'][_0x82f6('0x1c')]);}return _0xdc4dea(_0x516deb[_0x82f6('0x15')]['message']);}else{_0xdc4dea(_0x516deb[_0x82f6('0x1d')]);}})[_0x82f6('0x1e')](function(_0x5037f8){_0x4beccf(_0x5037f8);});});}function getAgent(_0x57ac0d){return db[_0x82f6('0x1f')]['findOne']({'where':{'id':_0x57ac0d,'role':_0x82f6('0x20')}})[_0x82f6('0x21')](checkError());}function getAgentCheckSession(_0x54ce11,_0x3795ef){return new BPromise(function(_0x15c9b7,_0x33ef08){var _0x1125a0=respondWithRpcPromise('VoiceChannels');var _0x40a071=getAgent(_0x54ce11);Promise[_0x82f6('0x22')]([_0x1125a0,_0x40a071])[_0x82f6('0x21')](function(_0x400137){var _0x271c28=_0x400137[0x0];var _0x328707=_0x400137[0x1];var _0x27e473=_[_0x82f6('0x23')](_0x271c28[_0x82f6('0x24')],function(_0x402449){return _0x402449[_0x82f6('0x25')]==_0x328707['id']&&_0x402449[_0x82f6('0x26')]==_0x3795ef;});if(_0x27e473[_0x82f6('0x27')]==0x1){_0x15c9b7(_0x328707);}else{_0x33ef08(new RangeError(_0x82f6('0x28')+_0x3795ef+'\x20not\x20found!'));}});});}exports[_0x82f6('0x29')]=function(_0x2c764f,_0x418f34){logger['info'](_0x82f6('0x2a'),_0x2c764f[_0x82f6('0x2b')]);var _0x831131=originateValidation[_0x82f6('0xa')](_0x2c764f[_0x82f6('0x2b')]);if(_0x831131[_0x82f6('0x27')]>0x0){return _0x418f34[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x831131);}var _0x4756ee=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x31df71=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x2e')];var _0x4c45a4=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x2f')];var _0x1c6ce4=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x30')];return getAgent(_0x4756ee)[_0x82f6('0x21')](function(_0x34c2f1){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x34c2f1[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x34c2f1[_0x82f6('0x17')]),_0x82f6('0x34'),{'callNumber':_0x31df71,'callerId':_0x4c45a4,'callbackUrl':_0x1c6ce4});return _0x418f34['status'](0xc8)[_0x82f6('0x2c')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x418f34));};exports[_0x82f6('0x35')]=function(_0x18c81e,_0x5e8828){logger[_0x82f6('0x10')](_0x82f6('0x36'),_0x18c81e[_0x82f6('0x2b')]);var _0x56e5f1=hangupValidation[_0x82f6('0xa')](_0x18c81e['body']);if(_0x56e5f1[_0x82f6('0x27')]>0x0){return _0x5e8828['status'](0x190)[_0x82f6('0x2c')](_0x56e5f1);}var _0x47ef9e=_0x18c81e[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x5ad42c=_0x18c81e[_0x82f6('0x2b')][_0x82f6('0x26')];return getAgent(_0x47ef9e)[_0x82f6('0x21')](function(_0x43dcd1){logger['info'](_0x82f6('0x31'),_0x43dcd1[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x43dcd1['name']),_0x82f6('0x37'),{'sessionId':_0x5ad42c});return _0x5e8828[_0x82f6('0x18')](0xc8)['json']({'error':![],'message':_0x82f6('0x38')});})[_0x82f6('0x1e')](handleError(_0x5e8828));};exports[_0x82f6('0x39')]=function(_0x23662f,_0xc3e250){logger['info'](_0x82f6('0x3a'),_0x23662f['body']);var _0x139614=answerValidation[_0x82f6('0xa')](_0x23662f[_0x82f6('0x2b')]);if(_0x139614[_0x82f6('0x27')]>0x0){return _0xc3e250[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x139614);}var _0x43fefc=_0x23662f['body'][_0x82f6('0x2d')];var _0x297cda=_0x23662f[_0x82f6('0x2b')][_0x82f6('0x26')];return getAgent(_0x43fefc)['then'](function(_0x408dce){logger['info'](_0x82f6('0x31'),_0x408dce[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x408dce[_0x82f6('0x17')]),_0x82f6('0x3b'),{'sessionId':_0x297cda});return _0xc3e250['status'](0xc8)[_0x82f6('0x2c')]({'error':![],'message':_0x82f6('0x3c')});})[_0x82f6('0x1e')](handleError(_0xc3e250));};exports[_0x82f6('0x3d')]=function(_0x10ae6e,_0x95c1fa){logger[_0x82f6('0x10')](_0x82f6('0x3e'),_0x10ae6e['body']);var _0x43b92e=holdValidation[_0x82f6('0xa')](_0x10ae6e['body']);if(_0x43b92e[_0x82f6('0x27')]>0x0){return _0x95c1fa['status'](0x190)[_0x82f6('0x2c')](_0x43b92e);}var _0x5e3321=_0x10ae6e[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0xbcc26b=_0x10ae6e[_0x82f6('0x2b')][_0x82f6('0x26')];return getAgent(_0x5e3321)[_0x82f6('0x21')](function(_0x53f7d4){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x53f7d4['name']);emit(util['format'](_0x82f6('0x33'),_0x53f7d4[_0x82f6('0x17')]),_0x82f6('0x3f'),{'sessionId':_0xbcc26b});return _0x95c1fa['status'](0xc8)[_0x82f6('0x2c')]({'error':![],'message':_0x82f6('0x40')});})[_0x82f6('0x1e')](handleError(_0x95c1fa));};exports[_0x82f6('0x41')]=function(_0x4e9e13,_0x495400){logger[_0x82f6('0x10')](_0x82f6('0x42'),_0x4e9e13[_0x82f6('0x2b')]);var _0x5231bb=unholdValidation[_0x82f6('0xa')](_0x4e9e13[_0x82f6('0x2b')]);if(_0x5231bb['length']>0x0){return _0x495400['status'](0x190)['json'](_0x5231bb);}var _0x2e6b03=_0x4e9e13['body'][_0x82f6('0x2d')];var _0x57c023=_0x4e9e13[_0x82f6('0x2b')]['sessionId'];return getAgent(_0x2e6b03)[_0x82f6('0x21')](function(_0x58f89b){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x58f89b[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x58f89b[_0x82f6('0x17')]),'webbar:unhold',{'sessionId':_0x57c023});return _0x495400[_0x82f6('0x18')](0xc8)[_0x82f6('0x2c')]({'error':![],'message':_0x82f6('0x43')});})['catch'](handleError(_0x495400));};exports['calls']=function(_0x13406f,_0x81e595){logger[_0x82f6('0x10')](_0x82f6('0x44'),_0x81e595['body']);var _0x2c1c0e=callsValidation[_0x82f6('0xa')](_0x13406f[_0x82f6('0x2b')]);if(_0x2c1c0e['length']>0x0){return _0x81e595['status'](0x190)['json'](_0x2c1c0e);}var _0x44218c=_0x13406f[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x59176d=respondWithRpcPromise(_0x82f6('0x45'));var _0x26c1d8=getAgent(_0x44218c);return Promise[_0x82f6('0x22')]([_0x59176d,_0x26c1d8])[_0x82f6('0x21')](function(_0x51791c){var _0x255da2=_0x51791c[0x0];var _0x94aed4=_0x51791c[0x1];var _0x12a5b9=_[_0x82f6('0x23')](_0x255da2['rows'],function(_0x53c715){return _0x53c715[_0x82f6('0x25')]==_0x94aed4['id'];});return _0x81e595[_0x82f6('0x18')](0xc8)['json']({'count':_0x12a5b9[_0x82f6('0x27')],'rows':_0x12a5b9});})[_0x82f6('0x1e')](handleError(_0x81e595));};exports[_0x82f6('0x46')]=function(_0x5b3aaa,_0x32fa83){logger[_0x82f6('0x10')](_0x82f6('0x47'),_0x5b3aaa[_0x82f6('0x2b')]);var _0x169aa3=conferenceValidation[_0x82f6('0xa')](_0x5b3aaa['body']);if(_0x169aa3[_0x82f6('0x27')]>0x0){return _0x32fa83[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x169aa3);}var _0x2d57e3=_0x5b3aaa[_0x82f6('0x2b')]['userId'];return getAgent(_0x2d57e3)[_0x82f6('0x21')](function(_0x3cc579){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x3cc579[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x3cc579[_0x82f6('0x17')]),'webbar:conference');return _0x32fa83[_0x82f6('0x18')](0xc8)['json']({'error':![],'message':_0x82f6('0x48')});})[_0x82f6('0x1e')](handleError(_0x32fa83));};exports['transfer']=function(_0x843458,_0x32e43d){logger[_0x82f6('0x10')]('transfer\x20fired:',_0x843458['body']);var _0x140dcd=transferValidation[_0x82f6('0xa')](_0x843458['body']);if(_0x140dcd['length']>0x0){return _0x32e43d[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x140dcd);}var _0x1c37d2=_0x843458[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x11581c=_0x843458[_0x82f6('0x2b')][_0x82f6('0x26')];var _0x2d0d7c=_0x843458[_0x82f6('0x2b')][_0x82f6('0x49')];return getAgent(_0x1c37d2)[_0x82f6('0x21')](function(_0x53d931){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x53d931[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x53d931['name']),_0x82f6('0x4a'),{'sessionId':_0x11581c,'transferNumber':_0x2d0d7c});return _0x32e43d[_0x82f6('0x18')](0xc8)[_0x82f6('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x82f6('0x1e')](handleError(_0x32e43d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 244d477..fe4ffa6 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 _0x8099=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/canned_answers','getAnswers','getAgents','getApplications','addDisposition','post','addAnswer','/:id/users','/:id/applications','addApplications','notify','send','put','delete','destroy','/:id/dispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x227cfb,_0x4f42cf){var _0x131407=function(_0x37ddbb){while(--_0x37ddbb){_0x227cfb['push'](_0x227cfb['shift']());}};_0x131407(++_0x4f42cf);}(_0x8099,0x1cc));var _0x9809=function(_0x153d7b,_0x50cf71){_0x153d7b=_0x153d7b-0x0;var _0x5a412e=_0x8099[_0x153d7b];return _0x5a412e;};'use strict';var multer=require(_0x9809('0x0'));var util=require(_0x9809('0x1'));var path=require('path');var timeout=require(_0x9809('0x2'));var express=require(_0x9809('0x3'));var router=express['Router']();var fs_extra=require(_0x9809('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9809('0x5'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x9809('0x6')]('/',auth[_0x9809('0x7')](),controller[_0x9809('0x8')]);router[_0x9809('0x6')](_0x9809('0x9'),auth[_0x9809('0x7')](),controller[_0x9809('0xa')]);router['get'](_0x9809('0xb'),auth[_0x9809('0x7')](),controller['show']);router[_0x9809('0x6')]('/:id/dispositions',auth[_0x9809('0x7')](),controller['getDispositions']);router[_0x9809('0x6')](_0x9809('0xc'),auth[_0x9809('0x7')](),controller[_0x9809('0xd')]);router[_0x9809('0x6')]('/:id/users',auth[_0x9809('0x7')](),controller[_0x9809('0xe')]);router[_0x9809('0x6')]('/:id/applications',auth['isAuthenticated'](),controller[_0x9809('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/dispositions',auth[_0x9809('0x7')](),controller[_0x9809('0x10')]);router[_0x9809('0x11')](_0x9809('0xc'),auth[_0x9809('0x7')](),controller[_0x9809('0x12')]);router[_0x9809('0x11')](_0x9809('0x13'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x9809('0x14'),auth['isAuthenticated'](),controller[_0x9809('0x15')]);router['post']('/:id/notify',controller[_0x9809('0x16')]);router[_0x9809('0x11')]('/:id/send',auth[_0x9809('0x7')](),controller[_0x9809('0x17')]);router[_0x9809('0x18')](_0x9809('0xb'),auth[_0x9809('0x7')](),controller['update']);router[_0x9809('0x19')](_0x9809('0xb'),auth['isAuthenticated'](),controller[_0x9809('0x1a')]);router[_0x9809('0x19')](_0x9809('0x1b'),auth[_0x9809('0x7')](),controller['removeDispositions']);router[_0x9809('0x19')]('/:id/canned_answers',auth[_0x9809('0x7')](),controller[_0x9809('0x1c')]);router[_0x9809('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x9809('0x1d')]);module[_0x9809('0x1e')]=router; \ No newline at end of file +var _0x68b1=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addAnswer','addApplications','/:id/notify','put','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe'];(function(_0x8980f4,_0x55a8ea){var _0x25fade=function(_0x2f956b){while(--_0x2f956b){_0x8980f4['push'](_0x8980f4['shift']());}};_0x25fade(++_0x55a8ea);}(_0x68b1,0x1ce));var _0x168b=function(_0x39e85c,_0x3bca61){_0x39e85c=_0x39e85c-0x0;var _0xf96780=_0x68b1[_0x39e85c];return _0xf96780;};'use strict';var multer=require(_0x168b('0x0'));var util=require(_0x168b('0x1'));var path=require(_0x168b('0x2'));var timeout=require('connect-timeout');var express=require(_0x168b('0x3'));var router=express[_0x168b('0x4')]();var fs_extra=require(_0x168b('0x5'));var auth=require(_0x168b('0x6'));var interaction=require(_0x168b('0x7'));var config=require(_0x168b('0x8'));var controller=require(_0x168b('0x9'));router[_0x168b('0xa')]('/',auth[_0x168b('0xb')](),controller[_0x168b('0xc')]);router[_0x168b('0xa')](_0x168b('0xd'),auth[_0x168b('0xb')](),controller['describe']);router[_0x168b('0xa')](_0x168b('0xe'),auth['isAuthenticated'](),controller[_0x168b('0xf')]);router[_0x168b('0xa')](_0x168b('0x10'),auth[_0x168b('0xb')](),controller[_0x168b('0x11')]);router[_0x168b('0xa')](_0x168b('0x12'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x168b('0xa')](_0x168b('0x13'),auth[_0x168b('0xb')](),controller[_0x168b('0x14')]);router[_0x168b('0xa')](_0x168b('0x15'),auth[_0x168b('0xb')](),controller[_0x168b('0x16')]);router[_0x168b('0x17')]('/',auth[_0x168b('0xb')](),controller[_0x168b('0x18')]);router[_0x168b('0x17')](_0x168b('0x10'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x168b('0x17')](_0x168b('0x12'),auth[_0x168b('0xb')](),controller[_0x168b('0x19')]);router[_0x168b('0x17')](_0x168b('0x13'),auth[_0x168b('0xb')](),controller['addAgents']);router[_0x168b('0x17')](_0x168b('0x15'),auth[_0x168b('0xb')](),controller[_0x168b('0x1a')]);router[_0x168b('0x17')](_0x168b('0x1b'),controller['notify']);router[_0x168b('0x17')]('/:id/send',auth[_0x168b('0xb')](),controller['send']);router[_0x168b('0x1c')]('/:id',auth[_0x168b('0xb')](),controller[_0x168b('0x1d')]);router[_0x168b('0x1e')]('/:id',auth[_0x168b('0xb')](),controller[_0x168b('0x1f')]);router[_0x168b('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x168b('0x1e')](_0x168b('0x12'),auth[_0x168b('0xb')](),controller[_0x168b('0x20')]);router[_0x168b('0x1e')]('/:id/users',auth[_0x168b('0xb')](),controller[_0x168b('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 233db8f..63ffe2d 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 _0xf4b6=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x1c6b9c,_0x4a312c){var _0x247491=function(_0x2e0dc0){while(--_0x2e0dc0){_0x1c6b9c['push'](_0x1c6b9c['shift']());}};_0x247491(++_0x4a312c);}(_0xf4b6,0x85));var _0x6f4b=function(_0x51e961,_0x545b34){_0x51e961=_0x51e961-0x0;var _0x4a4073=_0xf4b6[_0x51e961];return _0x4a4073;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6f4b('0x0'));module[_0x6f4b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6f4b('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x6f4b('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6f4b('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x6f4b('0x3')],'defaultValue':function(){return rs[_0x6f4b('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6f4b('0x5')](_0x6f4b('0x6'),_0x6f4b('0x7'))},'accountSid':{'type':Sequelize[_0x6f4b('0x3')]},'baseUrl':{'type':Sequelize[_0x6f4b('0x3')]},'authToken':{'type':Sequelize[_0x6f4b('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6f4b('0x8')],'defaultValue':function(){return _0x6f4b('0x9');}},'notificationSound':{'type':Sequelize[_0x6f4b('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6f4b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6f4b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6f4b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6f4b('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6f4b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x6f4b('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x6f4b('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xae145e){if(!_0xae145e){this[_0x6f4b('0xd')](_0x6f4b('0xe'),null);}this[_0x6f4b('0xd')](_0x6f4b('0xf'),_0xae145e);}},'description':{'type':Sequelize[_0x6f4b('0x3')]}}; \ No newline at end of file +var _0xef8a=['randomstring','exports','STRING','ENUM','twilio','sinch','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','sequelize'];(function(_0x565dee,_0xc6bf5a){var _0x32aa1f=function(_0x29acd5){while(--_0x29acd5){_0x565dee['push'](_0x565dee['shift']());}};_0x32aa1f(++_0xc6bf5a);}(_0xef8a,0xed));var _0xaef8=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0xef8a[_0x54b283];return _0x2462b3;};'use strict';var Sequelize=require(_0xaef8('0x0'));var rs=require(_0xaef8('0x1'));module[_0xaef8('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xaef8('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xaef8('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaef8('0x4')](_0xaef8('0x5'),_0xaef8('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xaef8('0x3')]},'authToken':{'type':Sequelize[_0xaef8('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xaef8('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xaef8('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaef8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xaef8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaef8('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaef8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaef8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaef8('0x9')],'comment':_0xaef8('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xaef8('0x8')],'defaultValue':![],'comment':_0xaef8('0xb'),'set':function(_0xf95def){if(!_0xf95def){this[_0xaef8('0xc')](_0xaef8('0xd'),null);}this[_0xaef8('0xc')]('mandatoryDisposition',_0xf95def);}},'description':{'type':Sequelize[_0xaef8('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index c78495d..7f77b16 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 _0x8533=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','include','findAll','show','params','keys','includeAll','find','catch','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','WhatsappAccountId','order','pick','Disposition','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','ids','spread','emit','userWhatsappAccount:save','removeAgents','isArray','getAgents','User','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','replace','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','contact','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','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','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','get','WhatsappAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','map','query'];(function(_0x408fdc,_0x28d14c){var _0x527651=function(_0x272b36){while(--_0x272b36){_0x408fdc['push'](_0x408fdc['shift']());}};_0x527651(++_0x28d14c);}(_0x8533,0x141));var _0x3853=function(_0x2c8b49,_0x3144fb){_0x2c8b49=_0x2c8b49-0x0;var _0x1abfd8=_0x8533[_0x2c8b49];return _0x1abfd8;};'use strict';var emlformat=require(_0x3853('0x0'));var rimraf=require(_0x3853('0x1'));var zipdir=require(_0x3853('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3853('0x3'));var moment=require(_0x3853('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3853('0x5'));var util=require('util');var path=require(_0x3853('0x6'));var sox=require('sox');var csv=require(_0x3853('0x7'));var ejs=require(_0x3853('0x8'));var fs=require('fs');var fs_extra=require(_0x3853('0x9'));var _=require(_0x3853('0xa'));var squel=require('squel');var crypto=require(_0x3853('0xb'));var jsforce=require(_0x3853('0xc'));var deskjs=require(_0x3853('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3853('0xe'));var Redis=require(_0x3853('0xf'));var authService=require(_0x3853('0x10'));var qs=require(_0x3853('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3853('0x12'));var logger=require(_0x3853('0x13'))(_0x3853('0x14'));var utils=require(_0x3853('0x15'));var config=require(_0x3853('0x16'));var licenseUtil=require(_0x3853('0x17'));var db=require('../../mysqldb')['db'];config[_0x3853('0x18')]=_[_0x3853('0x19')](config[_0x3853('0x18')],{'host':_0x3853('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3853('0x18')]));require(_0x3853('0x1b'))[_0x3853('0x1c')](socket);var jayson=require(_0x3853('0x1d'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x510e99,_0x130b7b,_0x77518,_0x378431){return new BPromise(function(_0x387d3c,_0x42c263){var _0x59eb33=_0x378431||client;return _0x59eb33[_0x3853('0x1e')](_0x510e99,_0x77518)['then'](function(_0x28f339){logger[_0x3853('0x1f')](_0x3853('0x20'),_0x130b7b,_0x3853('0x21'));logger[_0x3853('0x22')](_0x3853('0x23'),_0x130b7b,'request\x20sent',JSON['stringify'](_0x28f339));if(_0x28f339[_0x3853('0x24')]){if(_0x28f339['error'][_0x3853('0x25')]===0x1f4){logger[_0x3853('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x130b7b,_0x28f339[_0x3853('0x24')][_0x3853('0x26')]);return _0x42c263(_0x28f339[_0x3853('0x24')][_0x3853('0x26')]);}logger[_0x3853('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x130b7b,_0x28f339[_0x3853('0x24')][_0x3853('0x26')]);return _0x387d3c(_0x28f339[_0x3853('0x24')][_0x3853('0x26')]);}else{logger[_0x3853('0x1f')](_0x3853('0x20'),_0x130b7b,_0x3853('0x21'));_0x387d3c(_0x28f339['result'][_0x3853('0x26')]);}})['catch'](function(_0x3cdbab){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x130b7b,_0x3cdbab);_0x42c263(_0x3cdbab);});});}function respondWithStatusCode(_0x18c271,_0xd603df){_0xd603df=_0xd603df||0xcc;return function(_0x1415bc){if(_0x1415bc){return _0x18c271[_0x3853('0x27')](_0xd603df);}return _0x18c271[_0x3853('0x28')](_0xd603df)['end']();};}function respondWithResult(_0x460ebf,_0x2b6bab){_0x2b6bab=_0x2b6bab||0xc8;return function(_0x5c0e8e){if(_0x5c0e8e){return _0x460ebf[_0x3853('0x28')](_0x2b6bab)['json'](_0x5c0e8e);}};}function respondWithFilteredResult(_0x47dfcc,_0x4ad20b){return function(_0x20c68e){if(_0x20c68e){var _0x4391f2=typeof _0x4ad20b[_0x3853('0x29')]==='undefined'&&typeof _0x4ad20b[_0x3853('0x2a')]===_0x3853('0x2b');var _0x5b5ac8=_0x20c68e['count'];var _0x5873b3=_0x4391f2?0x0:_0x4ad20b[_0x3853('0x29')];var _0x2d6a84=_0x4391f2?_0x20c68e[_0x3853('0x2c')]:_0x4ad20b[_0x3853('0x29')]+_0x4ad20b[_0x3853('0x2a')];var _0x3bbdf7;if(_0x2d6a84>=_0x5b5ac8){_0x2d6a84=_0x5b5ac8;_0x3bbdf7=0xc8;}else{_0x3bbdf7=0xce;}_0x47dfcc[_0x3853('0x28')](_0x3bbdf7);return _0x47dfcc[_0x3853('0x2d')]('Content-Range',_0x5873b3+'-'+_0x2d6a84+'/'+_0x5b5ac8)[_0x3853('0x2e')](_0x20c68e);}return null;};}function patchUpdates(_0x44b983){return function(_0x554210){try{jsonpatch[_0x3853('0x2f')](_0x554210,_0x44b983,!![]);}catch(_0x4e4703){return BPromise[_0x3853('0x30')](_0x4e4703);}return _0x554210[_0x3853('0x31')]();};}function saveUpdates(_0x1e2b35,_0x53e4de){return function(_0x4a9e05){if(_0x4a9e05){return _0x4a9e05[_0x3853('0x32')](_0x1e2b35)['then'](function(_0x3c9966){return _0x3c9966;});}return null;};}function removeEntity(_0x21af77,_0x16e35a){return function(_0x3c64c0){if(_0x3c64c0){return _0x3c64c0['destroy']()[_0x3853('0x33')](function(){var _0x3db4cb=_0x3c64c0[_0x3853('0x34')]({'plain':!![]});var _0x3e4d22=_0x3853('0x35');return db[_0x3853('0x36')]['destroy']({'where':{'type':_0x3e4d22,'resourceId':_0x3db4cb['id']}})[_0x3853('0x33')](function(){return _0x3c64c0;});})[_0x3853('0x33')](function(){_0x21af77[_0x3853('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b2dd5,_0x965a1){return function(_0x4f6d4c){if(!_0x4f6d4c){_0x4b2dd5[_0x3853('0x27')](0x194);}return _0x4f6d4c;};}function handleError(_0xe97da8,_0x5a7d12){_0x5a7d12=_0x5a7d12||0x1f4;return function(_0x23c85d){logger[_0x3853('0x24')](_0x23c85d[_0x3853('0x37')]);if(_0x23c85d[_0x3853('0x38')]){delete _0x23c85d[_0x3853('0x38')];}_0xe97da8[_0x3853('0x28')](_0x5a7d12)[_0x3853('0x39')](_0x23c85d);};}exports['index']=function(_0x35d887,_0x3b3f5c){var _0x5c31e5={'include':[{'model':db[_0x3853('0x3a')],'as':_0x3853('0x3b')}]},_0x1d7437={},_0x20a543={'count':0x0,'rows':[]};var _0x3672c7=_['map'](db[_0x3853('0x3c')][_0x3853('0x3d')],function(_0x1abf37){return{'name':_0x1abf37[_0x3853('0x3e')],'type':_0x1abf37[_0x3853('0x3f')][_0x3853('0x40')]};});_0x1d7437['model']=_[_0x3853('0x41')](_0x3672c7,_0x3853('0x38'));_0x1d7437[_0x3853('0x42')]=_['keys'](_0x35d887[_0x3853('0x42')]);_0x1d7437[_0x3853('0x43')]=_[_0x3853('0x44')](_0x1d7437[_0x3853('0x45')],_0x1d7437[_0x3853('0x42')]);_0x5c31e5['attributes']=_[_0x3853('0x44')](_0x1d7437[_0x3853('0x45')],qs[_0x3853('0x46')](_0x35d887[_0x3853('0x42')]['fields']));_0x5c31e5[_0x3853('0x47')]=_0x5c31e5[_0x3853('0x47')][_0x3853('0x48')]?_0x5c31e5[_0x3853('0x47')]:_0x1d7437[_0x3853('0x45')];if(!_0x35d887[_0x3853('0x42')][_0x3853('0x49')](_0x3853('0x4a'))){_0x5c31e5[_0x3853('0x2a')]=qs[_0x3853('0x2a')](_0x35d887[_0x3853('0x42')]['limit']);_0x5c31e5[_0x3853('0x29')]=qs[_0x3853('0x29')](_0x35d887[_0x3853('0x42')][_0x3853('0x29')]);}_0x5c31e5['order']=qs['sort'](_0x35d887[_0x3853('0x42')][_0x3853('0x4b')]);_0x5c31e5[_0x3853('0x4c')]=qs[_0x3853('0x43')](_['pick'](_0x35d887['query'],_0x1d7437[_0x3853('0x43')]),_0x3672c7);if(_0x35d887[_0x3853('0x42')]['filter']){_0x5c31e5[_0x3853('0x4c')]=_[_0x3853('0x4d')](_0x5c31e5[_0x3853('0x4c')],{'$or':_['map'](_0x3672c7,function(_0x1f547c){if(_0x1f547c['type']!==_0x3853('0x4e')){var _0x9032d3={};_0x9032d3[_0x1f547c[_0x3853('0x38')]]={'$like':'%'+_0x35d887[_0x3853('0x42')][_0x3853('0x4f')]+'%'};return _0x9032d3;}})});}_0x5c31e5=_[_0x3853('0x4d')]({},_0x5c31e5,_0x35d887[_0x3853('0x50')]);var _0x59a854={'where':_0x5c31e5[_0x3853('0x4c')]};return db[_0x3853('0x3c')][_0x3853('0x2c')](_0x59a854)[_0x3853('0x33')](function(_0x413195){_0x20a543[_0x3853('0x2c')]=_0x413195;if(_0x35d887[_0x3853('0x42')]['includeAll']){_0x5c31e5[_0x3853('0x51')]=[{'all':!![]}];}return db[_0x3853('0x3c')][_0x3853('0x52')](_0x5c31e5);})[_0x3853('0x33')](function(_0x2fe692){_0x20a543['rows']=_0x2fe692;return _0x20a543;})[_0x3853('0x33')](respondWithFilteredResult(_0x3b3f5c,_0x5c31e5))['catch'](handleError(_0x3b3f5c,null));};exports[_0x3853('0x53')]=function(_0x2625b3,_0x2cfb59){var _0x17ca71={'raw':![],'where':{'id':_0x2625b3[_0x3853('0x54')]['id']},'include':[{'model':db[_0x3853('0x3a')],'as':_0x3853('0x3b')}]},_0x42c196={};_0x42c196[_0x3853('0x45')]=_[_0x3853('0x55')](db[_0x3853('0x3c')][_0x3853('0x3d')]);_0x42c196[_0x3853('0x42')]=_[_0x3853('0x55')](_0x2625b3[_0x3853('0x42')]);_0x42c196['filters']=_['intersection'](_0x42c196[_0x3853('0x45')],_0x42c196[_0x3853('0x42')]);_0x17ca71[_0x3853('0x47')]=_[_0x3853('0x44')](_0x42c196[_0x3853('0x45')],qs[_0x3853('0x46')](_0x2625b3[_0x3853('0x42')][_0x3853('0x46')]));_0x17ca71[_0x3853('0x47')]=_0x17ca71[_0x3853('0x47')][_0x3853('0x48')]?_0x17ca71[_0x3853('0x47')]:_0x42c196[_0x3853('0x45')];if(_0x2625b3[_0x3853('0x42')][_0x3853('0x56')]){_0x17ca71[_0x3853('0x51')]=[{'all':!![]}];}_0x17ca71=_[_0x3853('0x4d')]({},_0x17ca71,_0x2625b3[_0x3853('0x50')]);return db[_0x3853('0x3c')][_0x3853('0x57')](_0x17ca71)[_0x3853('0x33')](handleEntityNotFound(_0x2cfb59,null))[_0x3853('0x33')](respondWithResult(_0x2cfb59,null))[_0x3853('0x58')](handleError(_0x2cfb59,null));};exports[_0x3853('0x59')]=function(_0x52b8c7,_0x27ba52){return db[_0x3853('0x3c')][_0x3853('0x59')](_0x52b8c7[_0x3853('0x5a')],{})[_0x3853('0x33')](function(_0xf54b48){var _0xa1638b=_0x52b8c7[_0x3853('0x5b')][_0x3853('0x34')]({'plain':!![]});if(!_0xa1638b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa1638b[_0x3853('0x5c')]===_0x3853('0x5b')){var _0x27127b=_0xf54b48[_0x3853('0x34')]({'plain':!![]});var _0xf186dd=_0x3853('0x35');return db['UserProfileSection'][_0x3853('0x57')]({'where':{'name':_0xf186dd,'userProfileId':_0xa1638b[_0x3853('0x5d')]},'raw':!![]})[_0x3853('0x33')](function(_0xd6b6af){if(_0xd6b6af&&_0xd6b6af['autoAssociation']===0x0){return db['UserProfileResource'][_0x3853('0x59')]({'name':_0x27127b[_0x3853('0x38')],'resourceId':_0x27127b['id'],'type':_0xd6b6af[_0x3853('0x38')],'sectionId':_0xd6b6af['id']},{})[_0x3853('0x33')](function(){return _0xf54b48;});}else{return _0xf54b48;}})[_0x3853('0x58')](function(_0x40afe5){logger[_0x3853('0x24')](_0x3853('0x5e'),_0x40afe5);throw _0x40afe5;});}return _0xf54b48;})['then'](respondWithResult(_0x27ba52,0xc9))['catch'](handleError(_0x27ba52,null));};exports[_0x3853('0x32')]=function(_0x5a54df,_0x13adf5){if(_0x5a54df['body']['id']){delete _0x5a54df['body']['id'];}return db[_0x3853('0x3c')][_0x3853('0x57')]({'where':{'id':_0x5a54df[_0x3853('0x54')]['id']},'include':[{'model':db[_0x3853('0x3a')],'as':_0x3853('0x3b')}]})[_0x3853('0x33')](handleEntityNotFound(_0x13adf5,null))[_0x3853('0x33')](saveUpdates(_0x5a54df['body'],null))['then'](respondWithResult(_0x13adf5,null))[_0x3853('0x58')](handleError(_0x13adf5,null));};exports[_0x3853('0x5f')]=function(_0x1ae21b,_0x448e25){return db[_0x3853('0x3c')][_0x3853('0x57')]({'where':{'id':_0x1ae21b[_0x3853('0x54')]['id']}})[_0x3853('0x33')](handleEntityNotFound(_0x448e25,null))[_0x3853('0x33')](removeEntity(_0x448e25,null))[_0x3853('0x58')](handleError(_0x448e25,null));};exports[_0x3853('0x60')]=function(_0x49c8cb,_0x1e849d){return db[_0x3853('0x3c')][_0x3853('0x60')]()[_0x3853('0x33')](respondWithResult(_0x1e849d,null))[_0x3853('0x58')](handleError(_0x1e849d,null));};exports['addDisposition']=function(_0x50c2aa,_0x56298b,_0x57f3a5){if(_0x50c2aa[_0x3853('0x5a')]['id']){delete _0x50c2aa[_0x3853('0x5a')]['id'];}return db[_0x3853('0x3c')][_0x3853('0x57')]({'where':{'id':_0x50c2aa[_0x3853('0x54')]['id']}})['then'](handleEntityNotFound(_0x56298b,null))[_0x3853('0x33')](function(_0x5e0004){if(_0x5e0004){_0x50c2aa[_0x3853('0x5a')][_0x3853('0x61')]=_0x5e0004['id'];return db['Disposition'][_0x3853('0x59')](_0x50c2aa['body']);}})[_0x3853('0x33')](respondWithResult(_0x56298b,null))['catch'](handleError(_0x56298b,null));};exports['getDispositions']=function(_0x5a4f4a,_0x3246f7,_0x951d43){var _0x571af3={'raw':![],'where':{}};var _0x3fd039={};var _0xd593ab={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x5a4f4a[_0x3853('0x54')]['id']}})['then'](handleEntityNotFound(_0x3246f7,null))[_0x3853('0x33')](function(_0x13622b){if(_0x13622b){_0x3fd039[_0x3853('0x45')]=_[_0x3853('0x55')](db['Disposition']['rawAttributes']);_0x3fd039[_0x3853('0x42')]=_[_0x3853('0x55')](_0x5a4f4a['query']);_0x3fd039[_0x3853('0x43')]=_[_0x3853('0x44')](_0x3fd039[_0x3853('0x45')],_0x3fd039[_0x3853('0x42')]);_0x571af3[_0x3853('0x47')]=_['intersection'](_0x3fd039[_0x3853('0x45')],qs['fields'](_0x5a4f4a[_0x3853('0x42')][_0x3853('0x46')]));_0x571af3[_0x3853('0x47')]=_0x571af3['attributes'][_0x3853('0x48')]?_0x571af3['attributes']:_0x3fd039[_0x3853('0x45')];if(!_0x5a4f4a[_0x3853('0x42')]['hasOwnProperty'](_0x3853('0x4a'))){_0x571af3[_0x3853('0x2a')]=qs[_0x3853('0x2a')](_0x5a4f4a[_0x3853('0x42')][_0x3853('0x2a')]);_0x571af3['offset']=qs[_0x3853('0x29')](_0x5a4f4a[_0x3853('0x42')][_0x3853('0x29')]);}_0x571af3[_0x3853('0x62')]=qs[_0x3853('0x4b')](_0x5a4f4a[_0x3853('0x42')][_0x3853('0x4b')]);_0x571af3[_0x3853('0x4c')]=qs[_0x3853('0x43')](_[_0x3853('0x63')](_0x5a4f4a[_0x3853('0x42')],_0x3fd039[_0x3853('0x43')]));_0x571af3[_0x3853('0x4c')][_0x3853('0x61')]=_0x13622b['id'];if(_0x5a4f4a[_0x3853('0x42')]['filter']){_0x571af3[_0x3853('0x4c')]=_[_0x3853('0x4d')](_0x571af3['where'],{'$or':_['map'](_0x571af3[_0x3853('0x47')],function(_0x54ffa1){var _0x4014cf={};_0x4014cf[_0x54ffa1]={'$like':'%'+_0x5a4f4a[_0x3853('0x42')][_0x3853('0x4f')]+'%'};return _0x4014cf;})});}_0x571af3=_[_0x3853('0x4d')]({},_0x571af3,_0x5a4f4a['options']);return db[_0x3853('0x64')][_0x3853('0x2c')]({'where':_0x571af3[_0x3853('0x4c')]})[_0x3853('0x33')](function(_0x1c8d8c){_0xd593ab[_0x3853('0x2c')]=_0x1c8d8c;if(_0x5a4f4a[_0x3853('0x42')][_0x3853('0x56')]){_0x571af3['include']=[{'all':!![]}];}return db[_0x3853('0x64')]['findAll'](_0x571af3);})['then'](function(_0x1c31c4){_0xd593ab[_0x3853('0x65')]=_0x1c31c4;return _0xd593ab;});}})[_0x3853('0x33')](respondWithFilteredResult(_0x3246f7,_0x571af3))[_0x3853('0x58')](handleError(_0x3246f7,null));};exports['removeDispositions']=function(_0xa45eb1,_0x8b1288,_0x1446ef){return db[_0x3853('0x3c')][_0x3853('0x57')]({'where':{'id':_0xa45eb1[_0x3853('0x54')]['id']}})[_0x3853('0x33')](handleEntityNotFound(_0x8b1288,null))[_0x3853('0x33')](function(_0x2a0a84){if(_0x2a0a84){return _0x2a0a84[_0x3853('0x66')](_0xa45eb1[_0x3853('0x42')]['ids']);}})[_0x3853('0x33')](respondWithStatusCode(_0x8b1288,null))['catch'](handleError(_0x8b1288,null));};exports[_0x3853('0x67')]=function(_0x4eb38a,_0x2df3b2,_0x30e287){if(_0x4eb38a['body']['id']){delete _0x4eb38a['body']['id'];}return db[_0x3853('0x3c')][_0x3853('0x57')]({'where':{'id':_0x4eb38a[_0x3853('0x54')]['id']}})[_0x3853('0x33')](handleEntityNotFound(_0x2df3b2,null))['then'](function(_0x1a9837){if(_0x1a9837){_0x4eb38a[_0x3853('0x5a')]['WhatsappAccountId']=_0x1a9837['id'];return db[_0x3853('0x68')][_0x3853('0x59')](_0x4eb38a[_0x3853('0x5a')]);}})[_0x3853('0x33')](respondWithResult(_0x2df3b2,null))['catch'](handleError(_0x2df3b2,null));};exports[_0x3853('0x69')]=function(_0x1db494,_0x37464f,_0xb1b6aa){var _0xf39022={'raw':![],'where':{}};var _0x5afdd2={};var _0x4059f2={'count':0x0,'rows':[]};return db[_0x3853('0x3c')][_0x3853('0x6a')]({'where':{'id':_0x1db494['params']['id']}})[_0x3853('0x33')](handleEntityNotFound(_0x37464f,null))[_0x3853('0x33')](function(_0x3f9a8d){if(_0x3f9a8d){_0x5afdd2['model']=_[_0x3853('0x55')](db[_0x3853('0x68')][_0x3853('0x3d')]);_0x5afdd2[_0x3853('0x42')]=_[_0x3853('0x55')](_0x1db494[_0x3853('0x42')]);_0x5afdd2[_0x3853('0x43')]=_[_0x3853('0x44')](_0x5afdd2['model'],_0x5afdd2[_0x3853('0x42')]);_0xf39022['attributes']=_[_0x3853('0x44')](_0x5afdd2['model'],qs[_0x3853('0x46')](_0x1db494[_0x3853('0x42')][_0x3853('0x46')]));_0xf39022['attributes']=_0xf39022['attributes'][_0x3853('0x48')]?_0xf39022[_0x3853('0x47')]:_0x5afdd2[_0x3853('0x45')];if(!_0x1db494['query']['hasOwnProperty'](_0x3853('0x4a'))){_0xf39022[_0x3853('0x2a')]=qs[_0x3853('0x2a')](_0x1db494[_0x3853('0x42')]['limit']);_0xf39022['offset']=qs[_0x3853('0x29')](_0x1db494[_0x3853('0x42')]['offset']);}_0xf39022[_0x3853('0x62')]=qs[_0x3853('0x4b')](_0x1db494[_0x3853('0x42')][_0x3853('0x4b')]);_0xf39022['where']=qs[_0x3853('0x43')](_['pick'](_0x1db494[_0x3853('0x42')],_0x5afdd2['filters']));_0xf39022[_0x3853('0x4c')][_0x3853('0x61')]=_0x3f9a8d['id'];if(_0x1db494[_0x3853('0x42')][_0x3853('0x4f')]){_0xf39022[_0x3853('0x4c')]=_[_0x3853('0x4d')](_0xf39022[_0x3853('0x4c')],{'$or':_[_0x3853('0x41')](_0xf39022[_0x3853('0x47')],function(_0x157c55){var _0x5efb76={};_0x5efb76[_0x157c55]={'$like':'%'+_0x1db494['query']['filter']+'%'};return _0x5efb76;})});}_0xf39022=_['merge']({},_0xf39022,_0x1db494[_0x3853('0x50')]);return db[_0x3853('0x68')][_0x3853('0x2c')]({'where':_0xf39022[_0x3853('0x4c')]})[_0x3853('0x33')](function(_0x4fe820){_0x4059f2[_0x3853('0x2c')]=_0x4fe820;if(_0x1db494[_0x3853('0x42')][_0x3853('0x56')]){_0xf39022[_0x3853('0x51')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3853('0x52')](_0xf39022);})['then'](function(_0x1622c7){_0x4059f2[_0x3853('0x65')]=_0x1622c7;return _0x4059f2;});}})[_0x3853('0x33')](respondWithFilteredResult(_0x37464f,_0xf39022))[_0x3853('0x58')](handleError(_0x37464f,null));};exports['removeAnswers']=function(_0x31314d,_0x8b263b,_0x4dc02f){return db[_0x3853('0x3c')]['find']({'where':{'id':_0x31314d[_0x3853('0x54')]['id']}})[_0x3853('0x33')](handleEntityNotFound(_0x8b263b,null))[_0x3853('0x33')](function(_0x1f3a92){if(_0x1f3a92){return _0x1f3a92[_0x3853('0x6b')](_0x31314d[_0x3853('0x42')]['ids']);}})[_0x3853('0x33')](respondWithStatusCode(_0x8b263b,null))['catch'](handleError(_0x8b263b,null));};exports[_0x3853('0x6c')]=function(_0x3163e3,_0x3c5f5b,_0x4d95e0){return db[_0x3853('0x3c')][_0x3853('0x57')]({'where':{'id':_0x3163e3['params']['id']}})[_0x3853('0x33')](handleEntityNotFound(_0x3c5f5b,null))[_0x3853('0x33')](function(_0x1e4c5b){if(_0x1e4c5b){return _0x1e4c5b[_0x3853('0x6c')](_0x3163e3[_0x3853('0x5a')]['ids'],_[_0x3853('0x6d')](_0x3163e3['body'],[_0x3853('0x6e'),'id'])||{})[_0x3853('0x6f')](function(_0x2ea27f){for(var _0x3732b2=0x0;_0x3732b2<_0x3163e3[_0x3853('0x5a')][_0x3853('0x6e')][_0x3853('0x48')];_0x3732b2+=0x1){socket[_0x3853('0x70')](_0x3853('0x71'),{'UserId':Number(_0x3163e3[_0x3853('0x5a')]['ids'][_0x3732b2]),'WhatsappAccountId':Number(_0x3163e3['params']['id'])});}return _0x2ea27f;});}})[_0x3853('0x33')](respondWithResult(_0x3c5f5b,null))['catch'](handleError(_0x3c5f5b,null));};exports[_0x3853('0x72')]=function(_0x1c4b2b,_0x39543e,_0x585b50){return db['WhatsappAccount']['find']({'where':{'id':_0x1c4b2b[_0x3853('0x54')]['id']}})['then'](handleEntityNotFound(_0x39543e,null))[_0x3853('0x33')](function(_0x59584e){if(_0x59584e){return _0x59584e[_0x3853('0x72')](_0x1c4b2b[_0x3853('0x42')][_0x3853('0x6e')])[_0x3853('0x33')](function(){if(_[_0x3853('0x73')](_0x1c4b2b[_0x3853('0x42')][_0x3853('0x6e')])){for(var _0x45e307=0x0;_0x45e307<_0x1c4b2b[_0x3853('0x42')][_0x3853('0x6e')][_0x3853('0x48')];_0x45e307+=0x1){socket[_0x3853('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x1c4b2b[_0x3853('0x42')][_0x3853('0x6e')][_0x45e307]),'WhatsappAccountId':Number(_0x1c4b2b[_0x3853('0x54')]['id'])});}}else{socket[_0x3853('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x1c4b2b[_0x3853('0x42')][_0x3853('0x6e')]),'WhatsappAccountId':Number(_0x1c4b2b[_0x3853('0x54')]['id'])});}});}})[_0x3853('0x33')](respondWithStatusCode(_0x39543e,null))['catch'](handleError(_0x39543e,null));};exports[_0x3853('0x74')]=function(_0x494159,_0x31dec3,_0xcca55c){var _0x26fdf7={};var _0x318d97={};var _0x452ef8;var _0x5be517;return db[_0x3853('0x3c')][_0x3853('0x6a')]({'where':{'id':_0x494159[_0x3853('0x54')]['id']}})['then'](handleEntityNotFound(_0x31dec3,null))[_0x3853('0x33')](function(_0x1fabc8){if(_0x1fabc8){_0x452ef8=_0x1fabc8;_0x318d97[_0x3853('0x45')]=_[_0x3853('0x55')](db[_0x3853('0x75')]['rawAttributes']);_0x318d97[_0x3853('0x42')]=_[_0x3853('0x55')](_0x494159[_0x3853('0x42')]);_0x318d97[_0x3853('0x43')]=_[_0x3853('0x44')](_0x318d97[_0x3853('0x45')],_0x318d97[_0x3853('0x42')]);_0x26fdf7[_0x3853('0x47')]=_[_0x3853('0x44')](_0x318d97['model'],qs['fields'](_0x494159['query'][_0x3853('0x46')]));_0x26fdf7[_0x3853('0x47')]=_0x26fdf7['attributes'][_0x3853('0x48')]?_0x26fdf7[_0x3853('0x47')]:_0x318d97[_0x3853('0x45')];_0x26fdf7['order']=qs[_0x3853('0x4b')](_0x494159[_0x3853('0x42')][_0x3853('0x4b')]);_0x26fdf7[_0x3853('0x4c')]=qs[_0x3853('0x43')](_[_0x3853('0x63')](_0x494159[_0x3853('0x42')],_0x318d97['filters']));if(_0x494159['query']['filter']){_0x26fdf7[_0x3853('0x4c')]=_[_0x3853('0x4d')](_0x26fdf7[_0x3853('0x4c')],{'$or':_[_0x3853('0x41')](_0x26fdf7[_0x3853('0x47')],function(_0x5a1ddf){var _0x3c19be={};_0x3c19be[_0x5a1ddf]={'$like':'%'+_0x494159['query'][_0x3853('0x4f')]+'%'};return _0x3c19be;})});}_0x26fdf7=_[_0x3853('0x4d')]({},_0x26fdf7,_0x494159[_0x3853('0x50')]);return _0x452ef8[_0x3853('0x74')](_0x26fdf7);}})[_0x3853('0x33')](function(_0x1bc8b1){if(_0x1bc8b1){_0x5be517=_0x1bc8b1['length'];if(!_0x494159[_0x3853('0x42')][_0x3853('0x49')](_0x3853('0x4a'))){_0x26fdf7[_0x3853('0x2a')]=qs['limit'](_0x494159[_0x3853('0x42')][_0x3853('0x2a')]);_0x26fdf7[_0x3853('0x29')]=qs[_0x3853('0x29')](_0x494159[_0x3853('0x42')][_0x3853('0x29')]);}return _0x452ef8[_0x3853('0x74')](_0x26fdf7);}})[_0x3853('0x33')](function(_0x1f152d){if(_0x1f152d){return _0x1f152d?{'count':_0x5be517,'rows':_0x1f152d}:null;}})['then'](respondWithResult(_0x31dec3,null))[_0x3853('0x58')](handleError(_0x31dec3,null));};exports[_0x3853('0x76')]=function(_0x1bf8c0,_0x3086e2){var _0x2b3d4c=_0x1bf8c0[_0x3853('0x54')]['id'];var _0x118b88=_0x1bf8c0[_0x3853('0x5a')];var _0x5995a7=0xc8;var _0x5eac1c=null;return db['sequelize'][_0x3853('0x77')]({'isolationLevel':db[_0x3853('0x78')][_0x3853('0x79')][_0x3853('0x7a')][_0x3853('0x7b')]},function(_0x44506b){return db['WhatsappAccount'][_0x3853('0x6a')]({'where':{'id':_0x2b3d4c},'transaction':_0x44506b})[_0x3853('0x33')](function(_0x3c0438){if(_0x3c0438){return db[_0x3853('0x7c')]['destroy']({'where':{'WhatsappAccountId':_0x2b3d4c},'transaction':_0x44506b})[_0x3853('0x33')](function(){var _0x8c7333=_['map'](_0x118b88,function(_0x1fec4c){_0x1fec4c['WhatsappAccountId']=_0x2b3d4c;return _0x1fec4c;});return db[_0x3853('0x7c')][_0x3853('0x7d')](_0x8c7333,{'transaction':_0x44506b});});}else{_0x5995a7=0x194;_0x5eac1c=[];}});})[_0x3853('0x33')](function(){if(_0x5995a7!==0x194){return db[_0x3853('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x2b3d4c},'order':_0x3853('0x7e')})['then'](function(_0x41ae48){_0x5eac1c=_0x41ae48;});}})[_0x3853('0x58')](function(_0x510343){_0x5995a7=0x1f4;logger[_0x3853('0x24')](_0x510343[_0x3853('0x37')]);if(_0x510343[_0x3853('0x38')]){delete _0x510343[_0x3853('0x38')];}_0x5eac1c=_0x510343;})[_0x3853('0x7f')](function(){if(_0x5eac1c===null){_0x3086e2[_0x3853('0x27')](_0x5995a7);}else{if(_0x5995a7===0x1f4){_0x3086e2[_0x3853('0x28')](_0x5995a7)[_0x3853('0x39')](_0x5eac1c);}else{_0x3086e2[_0x3853('0x28')](_0x5995a7)[_0x3853('0x2e')](_0x5eac1c);}}});};exports[_0x3853('0x80')]=function(_0xed906c,_0x5c0aa0,_0xfa9c9a){var _0x534f70={};var _0x4d8bd9={};var _0x3fee99;var _0x492bc2;return db[_0x3853('0x3c')]['findOne']({'where':{'id':_0xed906c[_0x3853('0x54')]['id']}})[_0x3853('0x33')](handleEntityNotFound(_0x5c0aa0,null))[_0x3853('0x33')](function(_0x3cebc6){if(_0x3cebc6){_0x3fee99=_0x3cebc6;_0x4d8bd9[_0x3853('0x45')]=_[_0x3853('0x55')](db[_0x3853('0x7c')][_0x3853('0x3d')]);_0x4d8bd9[_0x3853('0x42')]=_[_0x3853('0x55')](_0xed906c[_0x3853('0x42')]);_0x4d8bd9['filters']=_[_0x3853('0x44')](_0x4d8bd9[_0x3853('0x45')],_0x4d8bd9['query']);_0x534f70[_0x3853('0x47')]=_[_0x3853('0x44')](_0x4d8bd9[_0x3853('0x45')],qs['fields'](_0xed906c['query'][_0x3853('0x46')]));_0x534f70[_0x3853('0x47')]=_0x534f70['attributes'][_0x3853('0x48')]?_0x534f70['attributes']:_0x4d8bd9['model'];_0x534f70[_0x3853('0x62')]=qs[_0x3853('0x4b')](_0xed906c[_0x3853('0x42')][_0x3853('0x4b')]);_0x534f70[_0x3853('0x4c')]=qs['filters'](_[_0x3853('0x63')](_0xed906c['query'],_0x4d8bd9['filters']));if(_0xed906c[_0x3853('0x42')]['filter']){_0x534f70[_0x3853('0x4c')]=_[_0x3853('0x4d')](_0x534f70['where'],{'$or':_[_0x3853('0x41')](_0x534f70[_0x3853('0x47')],function(_0x9132b9){var _0x1e9af7={};_0x1e9af7[_0x9132b9]={'$like':'%'+_0xed906c[_0x3853('0x42')][_0x3853('0x4f')]+'%'};return _0x1e9af7;})});}_0x534f70=_['merge']({},_0x534f70,_0xed906c['options']);return _0x3fee99['getApplications'](_0x534f70);}})[_0x3853('0x33')](function(_0x156990){if(_0x156990){_0x492bc2=_0x156990[_0x3853('0x48')];if(!_0xed906c['query']['hasOwnProperty'](_0x3853('0x4a'))){_0x534f70[_0x3853('0x2a')]=qs[_0x3853('0x2a')](_0xed906c[_0x3853('0x42')][_0x3853('0x2a')]);_0x534f70[_0x3853('0x29')]=qs[_0x3853('0x29')](_0xed906c[_0x3853('0x42')][_0x3853('0x29')]);}return _0x3fee99[_0x3853('0x80')](_0x534f70);}})[_0x3853('0x33')](function(_0x5189cf){if(_0x5189cf){return _0x5189cf?{'count':_0x492bc2,'rows':_0x5189cf}:null;}})[_0x3853('0x33')](respondWithResult(_0x5c0aa0,null))[_0x3853('0x58')](handleError(_0x5c0aa0,null));};exports[_0x3853('0x81')]=function(_0x3ad5ed,_0x114cd7,_0x5774fc){var _0x375977={'channel':'whatsapp'};var _0x5587a4=[];var _0x176108=[];var _0x1331ac={};return db[_0x3853('0x3c')]['find']({'where':{'id':_0x3ad5ed['params']['id']},'include':[{'model':db[_0x3853('0x7c')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x114cd7,null))[_0x3853('0x33')](function(_0x17139c){_0x375977[_0x3853('0x82')]=_0x17139c;if(_0x375977[_0x3853('0x82')]&&_0x375977[_0x3853('0x82')][_0x3853('0x3f')]===_0x3853('0x83')&&_0x3ad5ed[_0x3853('0x5a')]['statuses']){if(_0x3ad5ed['body'][_0x3853('0x84')][_0x3853('0x48')]===0x0)return;if(_0x3ad5ed['body'][_0x3853('0x84')][0x0][_0x3853('0x85')]!==_0x3853('0x86'))return;return db[_0x3853('0x87')][_0x3853('0x32')]({'read':!![],'readAt':_0x3ad5ed['body'][_0x3853('0x84')][0x0]['timestamp']},{'where':{'messageId':_0x3ad5ed[_0x3853('0x5a')][_0x3853('0x84')][0x0][_0x3853('0x88')]},'individualHooks':!![]})[_0x3853('0x33')](function(_0x1df68d){return _0x114cd7[_0x3853('0x28')](0xc8)[_0x3853('0x2e')](_0x1df68d);});}_0x375977[_0x3853('0x89')]=_[_0x3853('0x8a')](_0x17139c[_0x3853('0x8b')],[_0x3853('0x7e')],[_0x3853('0x8c')]);if(_0x375977['account'][_0x3853('0x8b')]){delete _0x375977['account'][_0x3853('0x8b')];}return db[_0x3853('0x8d')][_0x3853('0x60')]()[_0x3853('0x33')](function(_0x3d50ef){if(!_0x3d50ef){throw new db[(_0x3853('0x8e'))][(_0x3853('0x8f'))]('no\x20available\x20attributes');}_0x5587a4=_[_0x3853('0x90')](_['keys'](_0x3d50ef),['createdAt','updatedAt']);_0x176108=_[_0x3853('0x90')](_['keys'](_0x3d50ef),[_0x3853('0x91'),_0x3853('0x92'),'CompanyId',_0x3853('0x93')]);_0x375977[_0x3853('0x5a')]={'mapKey':_0x3853('0x94')};if(_0x375977[_0x3853('0x82')]&&_0x375977[_0x3853('0x82')][_0x3853('0x3f')]===_0x3853('0x95')){_0x375977[_0x3853('0x5a')][_0x3853('0x96')]=_0x3ad5ed[_0x3853('0x5a')][_0x3853('0x97')][_0x3853('0x98')]('whatsapp:','');_0x375977[_0x3853('0x5a')][_0x3853('0x5a')]=_0x3ad5ed[_0x3853('0x5a')][_0x3853('0x99')];_0x375977['body'][_0x3853('0x9a')]=_0x3ad5ed['body'][_0x3853('0x9b')];}if(_0x375977[_0x3853('0x82')]&&_0x375977[_0x3853('0x82')][_0x3853('0x3f')]===_0x3853('0x83')){_0x375977['body'][_0x3853('0x96')]=_0x3ad5ed[_0x3853('0x5a')][_0x3853('0x9c')][0x0]['from'];_0x375977['body'][_0x3853('0x5a')]=_0x3ad5ed[_0x3853('0x5a')][_0x3853('0x9c')][0x0]['message'][_0x3853('0x5a')];_0x375977[_0x3853('0x5a')][_0x3853('0x9a')]=_0x3ad5ed[_0x3853('0x5a')]['notifications'][0x0]['message_id'];}if(_0x375977['body']['id']){delete _0x375977['body']['id'];}if(_[_0x3853('0x9d')](_0x375977[_0x3853('0x5a')][_0x3853('0x96')])){throw new db[(_0x3853('0x8e'))][(_0x3853('0x8f'))](_0x3853('0x9e'));}if(_['isNil'](_0x375977[_0x3853('0x5a')]['body'])||_0x375977[_0x3853('0x5a')][_0x3853('0x5a')]===''){throw new db[(_0x3853('0x8e'))]['ValidationError'](_0x3853('0x9f'));}if(_['isNil'](_0x375977[_0x3853('0x5a')][_0x3853('0xa0')])){throw new db[(_0x3853('0x8e'))][(_0x3853('0x8f'))](_0x3853('0xa1')+_0x176108);}if(!_[_0x3853('0xa2')](_0x176108,_0x375977[_0x3853('0x5a')]['mapKey'])){throw new db[(_0x3853('0x8e'))][(_0x3853('0x8f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x176108);}_0x1331ac[_0x375977[_0x3853('0x5a')][_0x3853('0xa0')]]=_0x375977[_0x3853('0x5a')][_0x3853('0x96')];return db['CmList'][_0x3853('0x57')]({'where':{'id':_0x375977['account'][_0x3853('0x93')]},'include':[{'model':db['CmContact'],'as':_0x3853('0xa3'),'where':_0x1331ac,'limit':0x1,'order':[[_0x3853('0x92'),'DESC']]}]});})[_0x3853('0x33')](handleEntityNotFound(_0x114cd7,null))[_0x3853('0x33')](function(_0x35f204){if(_0x35f204){_0x375977['list']=_[_0x3853('0x6d')](_0x35f204,['Contacts']);if(_0x35f204[_0x3853('0xa3')][_0x3853('0x48')]){return _0x35f204[_0x3853('0xa3')][0x0];}var _0x42d54f=_[_0x3853('0x19')](_0x375977[_0x3853('0x5a')],{'firstName':_0x375977['body']['from'],'ListId':_0x35f204['id']});_0x42d54f[_0x375977[_0x3853('0x5a')][_0x3853('0xa0')]]=_0x375977['body'][_0x3853('0x96')];return db[_0x3853('0x8d')][_0x3853('0x59')](_0x42d54f,{'fields':_0x5587a4,'raw':!![]});}})[_0x3853('0x33')](handleEntityNotFound(_0x114cd7,null))[_0x3853('0x33')](function(_0x3a4f87){if(_0x3a4f87){_0x375977[_0x3853('0xa4')]=_0x3a4f87;var _0x16d9fd={'ContactId':_0x3a4f87['id'],'phone':_0x375977['body'][_0x3853('0x96')],'WhatsappAccountId':_0x3ad5ed[_0x3853('0x54')]['id']};var _0x4ac5a2={'ContactId':_0x3a4f87['id'],'WhatsappAccountId':_0x3ad5ed[_0x3853('0x54')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x4ac5a2})[_0x3853('0x33')](function(_0x57bb30){if(_0x57bb30){return[_0x57bb30,![]];}return db[_0x3853('0xa5')][_0x3853('0x59')](_0x16d9fd)['then'](function(_0xe49682){return[_0xe49682,!![]];});});}})['spread'](function(_0x12343d,_0x53f1e0){_0x375977[_0x3853('0xa6')]=_0x12343d[_0x3853('0x34')]({'plain':!![]});_0x375977[_0x3853('0xa6')][_0x3853('0xa7')]=![];if(_0x53f1e0){if(_0x375977[_0x3853('0x82')]['autoclose']){_0x375977[_0x3853('0x89')][_0x3853('0xa8')]({'id':0x0,'priority':_0x375977[_0x3853('0x89')][_0x3853('0x48')]+0x1,'app':_0x3853('0xa9'),'appdata':_0x3853('0xaa'),'interval':_0x3853('0xab')});}_0x375977[_0x3853('0xa6')][_0x3853('0xa7')]=!![];}return db[_0x3853('0x87')][_0x3853('0x59')]({'phone':_0x375977[_0x3853('0x5a')][_0x3853('0x96')],'messageId':_0x375977['body'][_0x3853('0x9a')],'body':_0x375977[_0x3853('0x5a')][_0x3853('0x5a')],'WhatsappAccountId':_0x3ad5ed['params']['id'],'WhatsappInteractionId':_0x12343d['id'],'direction':'in','ContactId':_0x12343d[_0x3853('0xac')],'AttachmentId':_0x375977[_0x3853('0x5a')][_0x3853('0xad')]});})['then'](function(_0xbe33fd){_0x375977['message']=_0xbe33fd;if(!_0x375977[_0x3853('0xa6')]['UserId'])return;return db['User']['find']({'attributes':['id',_0x3853('0x38')],'where':{'id':_0x375977['interaction'][_0x3853('0xae')]}});})[_0x3853('0x33')](function(_0x2fd6c1){if(_0x2fd6c1){_0x375977[_0x3853('0x89')][_0x3853('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2fd6c1[_0x3853('0x38')]+','+(_0x375977[_0x3853('0x82')][_0x3853('0xb0')]||0xa),'interval':_0x3853('0xab')});}if(!_0x375977[_0x3853('0xa6')][_0x3853('0xb1')])return;return db[_0x3853('0xb2')]['find']({'attributes':['id',_0x3853('0x38')],'where':{'id':_0x375977[_0x3853('0xa6')][_0x3853('0xb1')]}});})[_0x3853('0x33')](function(_0x4989c1){if(_0x4989c1){_0x375977[_0x3853('0x89')][_0x3853('0xaf')]({'id':0x0,'priority':0x1,'app':_0x3853('0xb3'),'appdata':_0x4989c1[_0x3853('0x38')]+','+(_0x375977[_0x3853('0x82')]['waitForTheAssignedQueue']||0x12c),'interval':_0x3853('0xab')});}return respondWithRpcPromise('Start',_0x3853('0xb4'),_0x375977);})[_0x3853('0x33')](function(_0x3ec825){if(_0x3ec825){var _0xb774b0=0xc8;var _0x516a60=_0x3853('0xb5');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x516a60,_0xb774b0,'entity\x20found');logger[_0x3853('0x22')](_0x3853('0xb6'),_0x516a60,_0xb774b0,'entity\x20found',JSON[_0x3853('0xb7')](_0x3ec825));if(_0x375977['account'][_0x3853('0x3f')]===_0x3853('0x95')){return _0x114cd7[_0x3853('0x28')](_0xb774b0)[_0x3853('0x2d')](_0x3853('0xb8'),_0x3853('0xb9'))[_0x3853('0x39')](_0x3853('0xba'));}else{return _0x114cd7[_0x3853('0x28')](_0xb774b0)['json'](_0x3ec825);}}});})['catch'](handleError(_0x114cd7,null));};exports[_0x3853('0x39')]=function(_0x325e49,_0x2bc6bd,_0x21f361){var _0x15248e,_0x3f3a58,_0x45cc5d;if(_[_0x3853('0x9d')](_0x325e49[_0x3853('0x5a')][_0x3853('0x5a')])||_0x325e49[_0x3853('0x5a')]['body']===''){throw new db[(_0x3853('0x8e'))][(_0x3853('0x8f'))](_0x3853('0x9f'));}if(_['isNil'](_0x325e49[_0x3853('0x5a')]['to'])){throw new db[(_0x3853('0x8e'))]['ValidationError'](_0x3853('0xbb'));}_0x15248e=_0x325e49['body']['to'];return db[_0x3853('0x3c')][_0x3853('0x57')]({'where':{'id':_0x325e49[_0x3853('0x54')]['id']},'include':[{'model':db[_0x3853('0xbc')],'as':_0x3853('0xbd'),'include':[{'model':db[_0x3853('0x8d')],'as':_0x3853('0xa3'),'where':{'mobile':_0x15248e},'limit':0x1,'order':[[_0x3853('0x92'),_0x3853('0xbe')]]}]}]})['then'](handleEntityNotFound(_0x2bc6bd,null))[_0x3853('0x33')](function(_0x1ee145){if(_0x1ee145&&_0x1ee145[_0x3853('0xbd')]){_0x3f3a58=_0x1ee145[_0x3853('0x34')]({'plain':!![]});if(_0x3f3a58['List']&&_0x3f3a58[_0x3853('0xbd')]['Contacts'][_0x3853('0x48')]){return _0x3f3a58[_0x3853('0xbd')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x3853('0x19')](_0x325e49[_0x3853('0x5a')],{'firstName':_0x15248e,'mobile':_0x15248e,'phone':_0x15248e,'ListId':_0x3f3a58['ListId']}));}})[_0x3853('0x33')](handleEntityNotFound(_0x2bc6bd,null))[_0x3853('0x33')](function(_0x370e84){if(_0x370e84){_0x45cc5d=_0x370e84;return db['WhatsappInteraction'][_0x3853('0x57')]({'where':{'ContactId':_0x45cc5d['id'],'closed':![],'WhatsappAccountId':_0x3f3a58['id']}})['then'](function(_0x1e9adc){if(_0x1e9adc){return[_0x1e9adc,![]];}return db[_0x3853('0xa5')][_0x3853('0x59')]({'UserId':_0x325e49[_0x3853('0x5b')]['id'],'ContactId':_0x45cc5d['id'],'WhatsappAccountId':_0x3f3a58['id'],'phone':_0x15248e,'firstMsgDirection':_0x3853('0xbf'),'Messages':[_[_0x3853('0x4d')](_0x325e49[_0x3853('0x5a')],{'read':![],'body':_0x325e49[_0x3853('0x5a')][_0x3853('0x5a')],'phone':_0x15248e,'WhatsappAccountId':_0x3f3a58['id'],'UserId':_0x325e49[_0x3853('0x5b')]['id'],'ContactId':_0x45cc5d['id']})]},{'include':[{'model':db[_0x3853('0x87')],'as':_0x3853('0xc0')}]})['then'](function(_0x2ec367){return[_0x2ec367,!![]];});});}})[_0x3853('0x6f')](function(_0x1ad227,_0x55ef81){if(_0x55ef81){return _0x1ad227;}return db['WhatsappMessage'][_0x3853('0x59')](_[_0x3853('0x4d')](_0x325e49[_0x3853('0x5a')],{'read':![],'body':_0x325e49[_0x3853('0x5a')][_0x3853('0x5a')],'phone':_0x15248e,'WhatsappAccountId':_0x3f3a58['id'],'WhatsappInteractionId':_0x1ad227['id'],'UserId':_0x325e49[_0x3853('0x5b')]['id'],'ContactId':_0x45cc5d['id']}))['then'](function(_0x48ec60){_0x1ad227[_0x3853('0xc1')][_0x3853('0xc0')]=[];_0x1ad227['dataValues'][_0x3853('0xc0')][_0x3853('0xa8')](_0x48ec60[_0x3853('0xc1')]);return _0x1ad227;});})[_0x3853('0x33')](respondWithResult(_0x2bc6bd,null))[_0x3853('0x58')](handleError(_0x2bc6bd,null));}; \ No newline at end of file +var _0x3d91=['omit','defaults','WhatsappInteraction','interaction','created','autoclose','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','*,*,*,*','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','List','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','Pause','fields','length','options','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','WhatsappAccountId','getDispositions','findOne','Disposition','order','rows','removeDispositions','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','stack','finally','json','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','priority','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','whatsapp:','Body','messageId','MessageSid','notifications','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0x3d91,0x1ae));var _0x13d9=function(_0x4633f9,_0x91b9a9){_0x4633f9=_0x4633f9-0x0;var _0x2404ee=_0x3d91[_0x4633f9];return _0x2404ee;};'use strict';var emlformat=require(_0x13d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x13d9('0x1'));var jsonpatch=require(_0x13d9('0x2'));var rp=require(_0x13d9('0x3'));var moment=require(_0x13d9('0x4'));var BPromise=require(_0x13d9('0x5'));var Mustache=require('mustache');var util=require(_0x13d9('0x6'));var path=require(_0x13d9('0x7'));var sox=require(_0x13d9('0x8'));var csv=require(_0x13d9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13d9('0xa'));var _=require(_0x13d9('0xb'));var squel=require(_0x13d9('0xc'));var crypto=require(_0x13d9('0xd'));var jsforce=require(_0x13d9('0xe'));var deskjs=require(_0x13d9('0xf'));var toCsv=require(_0x13d9('0x9'));var querystring=require(_0x13d9('0x10'));var Papa=require(_0x13d9('0x11'));var Redis=require(_0x13d9('0x12'));var authService=require(_0x13d9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x13d9('0x14'));var hardwareService=require(_0x13d9('0x15'));var logger=require('../../config/logger')(_0x13d9('0x16'));var utils=require(_0x13d9('0x17'));var config=require(_0x13d9('0x18'));var licenseUtil=require(_0x13d9('0x19'));var db=require(_0x13d9('0x1a'))['db'];config[_0x13d9('0x1b')]=_['defaults'](config['redis'],{'host':_0x13d9('0x1c'),'port':0x18eb});var socket=require(_0x13d9('0x1d'))(new Redis(config[_0x13d9('0x1b')]));require(_0x13d9('0x1e'))['register'](socket);var jayson=require(_0x13d9('0x1f'));var client=jayson[_0x13d9('0x20')][_0x13d9('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x36865e,_0x2763a,_0x512df1,_0x326f11){return new BPromise(function(_0x163715,_0x434bd7){var _0x5e8171=_0x326f11||client;return _0x5e8171[_0x13d9('0x22')](_0x36865e,_0x512df1)[_0x13d9('0x23')](function(_0xa5307e){logger[_0x13d9('0x24')](_0x13d9('0x25'),_0x2763a,_0x13d9('0x26'));logger[_0x13d9('0x27')](_0x13d9('0x28'),_0x2763a,_0x13d9('0x26'),JSON['stringify'](_0xa5307e));if(_0xa5307e[_0x13d9('0x29')]){if(_0xa5307e[_0x13d9('0x29')]['code']===0x1f4){logger[_0x13d9('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x2763a,_0xa5307e[_0x13d9('0x29')]['message']);return _0x434bd7(_0xa5307e['error']['message']);}logger[_0x13d9('0x29')](_0x13d9('0x25'),_0x2763a,_0xa5307e[_0x13d9('0x29')][_0x13d9('0x2a')]);return _0x163715(_0xa5307e[_0x13d9('0x29')][_0x13d9('0x2a')]);}else{logger[_0x13d9('0x24')](_0x13d9('0x25'),_0x2763a,_0x13d9('0x26'));_0x163715(_0xa5307e[_0x13d9('0x2b')][_0x13d9('0x2a')]);}})[_0x13d9('0x2c')](function(_0x1d81cc){logger[_0x13d9('0x29')](_0x13d9('0x25'),_0x2763a,_0x1d81cc);_0x434bd7(_0x1d81cc);});});}function respondWithStatusCode(_0x1d3c85,_0x7cd50d){_0x7cd50d=_0x7cd50d||0xcc;return function(_0x2ec2b5){if(_0x2ec2b5){return _0x1d3c85[_0x13d9('0x2d')](_0x7cd50d);}return _0x1d3c85[_0x13d9('0x2e')](_0x7cd50d)[_0x13d9('0x2f')]();};}function respondWithResult(_0xccef9e,_0x28263c){_0x28263c=_0x28263c||0xc8;return function(_0x4d6cbb){if(_0x4d6cbb){return _0xccef9e[_0x13d9('0x2e')](_0x28263c)['json'](_0x4d6cbb);}};}function respondWithFilteredResult(_0x5a4a85,_0x14f7b3){return function(_0x2c8099){if(_0x2c8099){var _0x85137=typeof _0x14f7b3['offset']==='undefined'&&typeof _0x14f7b3[_0x13d9('0x30')]===_0x13d9('0x31');var _0x1539ef=_0x2c8099[_0x13d9('0x32')];var _0x38ec4a=_0x85137?0x0:_0x14f7b3[_0x13d9('0x33')];var _0x5949bc=_0x85137?_0x2c8099[_0x13d9('0x32')]:_0x14f7b3[_0x13d9('0x33')]+_0x14f7b3['limit'];var _0x1a6680;if(_0x5949bc>=_0x1539ef){_0x5949bc=_0x1539ef;_0x1a6680=0xc8;}else{_0x1a6680=0xce;}_0x5a4a85[_0x13d9('0x2e')](_0x1a6680);return _0x5a4a85[_0x13d9('0x34')](_0x13d9('0x35'),_0x38ec4a+'-'+_0x5949bc+'/'+_0x1539ef)['json'](_0x2c8099);}return null;};}function patchUpdates(_0x3f4408){return function(_0x1c627b){try{jsonpatch[_0x13d9('0x36')](_0x1c627b,_0x3f4408,!![]);}catch(_0x35f77d){return BPromise[_0x13d9('0x37')](_0x35f77d);}return _0x1c627b[_0x13d9('0x38')]();};}function saveUpdates(_0x586de6,_0x58b522){return function(_0x3f16f8){if(_0x3f16f8){return _0x3f16f8[_0x13d9('0x39')](_0x586de6)[_0x13d9('0x23')](function(_0x296a9c){return _0x296a9c;});}return null;};}function removeEntity(_0x579915,_0x5f27cd){return function(_0x87c7f6){if(_0x87c7f6){return _0x87c7f6[_0x13d9('0x3a')]()[_0x13d9('0x23')](function(){var _0x3fcaf0=_0x87c7f6[_0x13d9('0x3b')]({'plain':!![]});var _0x41cc19=_0x13d9('0x3c');return db[_0x13d9('0x3d')]['destroy']({'where':{'type':_0x41cc19,'resourceId':_0x3fcaf0['id']}})['then'](function(){return _0x87c7f6;});})[_0x13d9('0x23')](function(){_0x579915[_0x13d9('0x2e')](0xcc)[_0x13d9('0x2f')]();});}};}function handleEntityNotFound(_0x5bbb17,_0x15c92a){return function(_0x4caa79){if(!_0x4caa79){_0x5bbb17['sendStatus'](0x194);}return _0x4caa79;};}function handleError(_0xee25c2,_0x275bcb){_0x275bcb=_0x275bcb||0x1f4;return function(_0x1ba114){logger[_0x13d9('0x29')](_0x1ba114['stack']);if(_0x1ba114['name']){delete _0x1ba114[_0x13d9('0x3e')];}_0xee25c2['status'](_0x275bcb)[_0x13d9('0x3f')](_0x1ba114);};}exports['index']=function(_0x13612f,_0x43df29){var _0x203474={'include':[{'model':db['Pause'],'as':_0x13d9('0x40')}]},_0x41c743={},_0xac84a5={'count':0x0,'rows':[]};var _0x539b50=_[_0x13d9('0x41')](db[_0x13d9('0x42')][_0x13d9('0x43')],function(_0x3ae74e){return{'name':_0x3ae74e[_0x13d9('0x44')],'type':_0x3ae74e[_0x13d9('0x45')][_0x13d9('0x46')]};});_0x41c743[_0x13d9('0x47')]=_[_0x13d9('0x41')](_0x539b50,'name');_0x41c743['query']=_[_0x13d9('0x48')](_0x13612f['query']);_0x41c743['filters']=_[_0x13d9('0x49')](_0x41c743[_0x13d9('0x47')],_0x41c743[_0x13d9('0x4a')]);_0x203474[_0x13d9('0x4b')]=_[_0x13d9('0x49')](_0x41c743[_0x13d9('0x47')],qs['fields'](_0x13612f[_0x13d9('0x4a')]['fields']));_0x203474['attributes']=_0x203474[_0x13d9('0x4b')]['length']?_0x203474[_0x13d9('0x4b')]:_0x41c743['model'];if(!_0x13612f[_0x13d9('0x4a')][_0x13d9('0x4c')]('nolimit')){_0x203474[_0x13d9('0x30')]=qs[_0x13d9('0x30')](_0x13612f[_0x13d9('0x4a')][_0x13d9('0x30')]);_0x203474[_0x13d9('0x33')]=qs[_0x13d9('0x33')](_0x13612f[_0x13d9('0x4a')][_0x13d9('0x33')]);}_0x203474['order']=qs[_0x13d9('0x4d')](_0x13612f[_0x13d9('0x4a')][_0x13d9('0x4d')]);_0x203474[_0x13d9('0x4e')]=qs[_0x13d9('0x4f')](_[_0x13d9('0x50')](_0x13612f['query'],_0x41c743[_0x13d9('0x4f')]),_0x539b50);if(_0x13612f[_0x13d9('0x4a')][_0x13d9('0x51')]){_0x203474[_0x13d9('0x4e')]=_[_0x13d9('0x52')](_0x203474['where'],{'$or':_['map'](_0x539b50,function(_0x5e12a5){if(_0x5e12a5['type']!==_0x13d9('0x53')){var _0x4525f3={};_0x4525f3[_0x5e12a5['name']]={'$like':'%'+_0x13612f[_0x13d9('0x4a')][_0x13d9('0x51')]+'%'};return _0x4525f3;}})});}_0x203474=_[_0x13d9('0x52')]({},_0x203474,_0x13612f['options']);var _0x1bbb21={'where':_0x203474[_0x13d9('0x4e')]};return db[_0x13d9('0x42')][_0x13d9('0x32')](_0x1bbb21)[_0x13d9('0x23')](function(_0x5e46b1){_0xac84a5[_0x13d9('0x32')]=_0x5e46b1;if(_0x13612f[_0x13d9('0x4a')][_0x13d9('0x54')]){_0x203474[_0x13d9('0x55')]=[{'all':!![]}];}return db[_0x13d9('0x42')][_0x13d9('0x56')](_0x203474);})['then'](function(_0x29cfc6){_0xac84a5['rows']=_0x29cfc6;return _0xac84a5;})[_0x13d9('0x23')](respondWithFilteredResult(_0x43df29,_0x203474))[_0x13d9('0x2c')](handleError(_0x43df29,null));};exports[_0x13d9('0x57')]=function(_0x19142e,_0x4cde82){var _0x308667={'raw':![],'where':{'id':_0x19142e[_0x13d9('0x58')]['id']},'include':[{'model':db[_0x13d9('0x59')],'as':_0x13d9('0x40')}]},_0x38557b={};_0x38557b[_0x13d9('0x47')]=_['keys'](db[_0x13d9('0x42')]['rawAttributes']);_0x38557b[_0x13d9('0x4a')]=_[_0x13d9('0x48')](_0x19142e[_0x13d9('0x4a')]);_0x38557b[_0x13d9('0x4f')]=_['intersection'](_0x38557b[_0x13d9('0x47')],_0x38557b[_0x13d9('0x4a')]);_0x308667[_0x13d9('0x4b')]=_[_0x13d9('0x49')](_0x38557b[_0x13d9('0x47')],qs[_0x13d9('0x5a')](_0x19142e[_0x13d9('0x4a')][_0x13d9('0x5a')]));_0x308667['attributes']=_0x308667[_0x13d9('0x4b')][_0x13d9('0x5b')]?_0x308667[_0x13d9('0x4b')]:_0x38557b[_0x13d9('0x47')];if(_0x19142e['query'][_0x13d9('0x54')]){_0x308667[_0x13d9('0x55')]=[{'all':!![]}];}_0x308667=_[_0x13d9('0x52')]({},_0x308667,_0x19142e[_0x13d9('0x5c')]);return db['WhatsappAccount'][_0x13d9('0x5d')](_0x308667)[_0x13d9('0x23')](handleEntityNotFound(_0x4cde82,null))[_0x13d9('0x23')](respondWithResult(_0x4cde82,null))[_0x13d9('0x2c')](handleError(_0x4cde82,null));};exports[_0x13d9('0x5e')]=function(_0x514f4c,_0x419f0a){return db[_0x13d9('0x42')][_0x13d9('0x5e')](_0x514f4c['body'],{})['then'](function(_0x22659e){var _0x2472cf=_0x514f4c['user']['get']({'plain':!![]});if(!_0x2472cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2472cf['role']===_0x13d9('0x5f')){var _0xbe9bc4=_0x22659e['get']({'plain':!![]});var _0x1093c8='WhatsappAccounts';return db[_0x13d9('0x60')][_0x13d9('0x5d')]({'where':{'name':_0x1093c8,'userProfileId':_0x2472cf[_0x13d9('0x61')]},'raw':!![]})[_0x13d9('0x23')](function(_0x5e90b0){if(_0x5e90b0&&_0x5e90b0[_0x13d9('0x62')]===0x0){return db['UserProfileResource'][_0x13d9('0x5e')]({'name':_0xbe9bc4[_0x13d9('0x3e')],'resourceId':_0xbe9bc4['id'],'type':_0x5e90b0[_0x13d9('0x3e')],'sectionId':_0x5e90b0['id']},{})[_0x13d9('0x23')](function(){return _0x22659e;});}else{return _0x22659e;}})['catch'](function(_0x1bb8ba){logger[_0x13d9('0x29')](_0x13d9('0x63'),_0x1bb8ba);throw _0x1bb8ba;});}return _0x22659e;})[_0x13d9('0x23')](respondWithResult(_0x419f0a,0xc9))[_0x13d9('0x2c')](handleError(_0x419f0a,null));};exports[_0x13d9('0x39')]=function(_0x2d0dcf,_0x51e4a5){if(_0x2d0dcf[_0x13d9('0x64')]['id']){delete _0x2d0dcf[_0x13d9('0x64')]['id'];}return db[_0x13d9('0x42')][_0x13d9('0x5d')]({'where':{'id':_0x2d0dcf['params']['id']},'include':[{'model':db[_0x13d9('0x59')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x51e4a5,null))['then'](saveUpdates(_0x2d0dcf[_0x13d9('0x64')],null))['then'](respondWithResult(_0x51e4a5,null))[_0x13d9('0x2c')](handleError(_0x51e4a5,null));};exports[_0x13d9('0x3a')]=function(_0x1b0849,_0x34f5f0){return db[_0x13d9('0x42')][_0x13d9('0x5d')]({'where':{'id':_0x1b0849[_0x13d9('0x58')]['id']}})['then'](handleEntityNotFound(_0x34f5f0,null))[_0x13d9('0x23')](removeEntity(_0x34f5f0,null))['catch'](handleError(_0x34f5f0,null));};exports[_0x13d9('0x65')]=function(_0x15fa97,_0x1ebfb3){return db[_0x13d9('0x42')]['describe']()[_0x13d9('0x23')](respondWithResult(_0x1ebfb3,null))[_0x13d9('0x2c')](handleError(_0x1ebfb3,null));};exports['addDisposition']=function(_0x239b6b,_0x4601d2,_0x3d51a7){if(_0x239b6b[_0x13d9('0x64')]['id']){delete _0x239b6b['body']['id'];}return db[_0x13d9('0x42')][_0x13d9('0x5d')]({'where':{'id':_0x239b6b[_0x13d9('0x58')]['id']}})['then'](handleEntityNotFound(_0x4601d2,null))[_0x13d9('0x23')](function(_0x518dcc){if(_0x518dcc){_0x239b6b['body'][_0x13d9('0x66')]=_0x518dcc['id'];return db['Disposition'][_0x13d9('0x5e')](_0x239b6b[_0x13d9('0x64')]);}})[_0x13d9('0x23')](respondWithResult(_0x4601d2,null))[_0x13d9('0x2c')](handleError(_0x4601d2,null));};exports[_0x13d9('0x67')]=function(_0x125ef3,_0x3674ad,_0x31af8d){var _0x2d9d64={'raw':![],'where':{}};var _0x387515={};var _0x593c50={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x13d9('0x68')]({'where':{'id':_0x125ef3[_0x13d9('0x58')]['id']}})[_0x13d9('0x23')](handleEntityNotFound(_0x3674ad,null))[_0x13d9('0x23')](function(_0x203f34){if(_0x203f34){_0x387515[_0x13d9('0x47')]=_['keys'](db[_0x13d9('0x69')]['rawAttributes']);_0x387515[_0x13d9('0x4a')]=_[_0x13d9('0x48')](_0x125ef3[_0x13d9('0x4a')]);_0x387515['filters']=_['intersection'](_0x387515[_0x13d9('0x47')],_0x387515[_0x13d9('0x4a')]);_0x2d9d64[_0x13d9('0x4b')]=_[_0x13d9('0x49')](_0x387515[_0x13d9('0x47')],qs[_0x13d9('0x5a')](_0x125ef3[_0x13d9('0x4a')][_0x13d9('0x5a')]));_0x2d9d64[_0x13d9('0x4b')]=_0x2d9d64['attributes'][_0x13d9('0x5b')]?_0x2d9d64[_0x13d9('0x4b')]:_0x387515[_0x13d9('0x47')];if(!_0x125ef3[_0x13d9('0x4a')][_0x13d9('0x4c')]('nolimit')){_0x2d9d64[_0x13d9('0x30')]=qs[_0x13d9('0x30')](_0x125ef3[_0x13d9('0x4a')]['limit']);_0x2d9d64[_0x13d9('0x33')]=qs[_0x13d9('0x33')](_0x125ef3[_0x13d9('0x4a')][_0x13d9('0x33')]);}_0x2d9d64[_0x13d9('0x6a')]=qs[_0x13d9('0x4d')](_0x125ef3[_0x13d9('0x4a')][_0x13d9('0x4d')]);_0x2d9d64[_0x13d9('0x4e')]=qs[_0x13d9('0x4f')](_[_0x13d9('0x50')](_0x125ef3[_0x13d9('0x4a')],_0x387515[_0x13d9('0x4f')]));_0x2d9d64[_0x13d9('0x4e')]['WhatsappAccountId']=_0x203f34['id'];if(_0x125ef3[_0x13d9('0x4a')][_0x13d9('0x51')]){_0x2d9d64['where']=_[_0x13d9('0x52')](_0x2d9d64[_0x13d9('0x4e')],{'$or':_['map'](_0x2d9d64[_0x13d9('0x4b')],function(_0x24c2d9){var _0x22e03c={};_0x22e03c[_0x24c2d9]={'$like':'%'+_0x125ef3[_0x13d9('0x4a')][_0x13d9('0x51')]+'%'};return _0x22e03c;})});}_0x2d9d64=_[_0x13d9('0x52')]({},_0x2d9d64,_0x125ef3[_0x13d9('0x5c')]);return db['Disposition']['count']({'where':_0x2d9d64[_0x13d9('0x4e')]})[_0x13d9('0x23')](function(_0x20a4c1){_0x593c50[_0x13d9('0x32')]=_0x20a4c1;if(_0x125ef3[_0x13d9('0x4a')][_0x13d9('0x54')]){_0x2d9d64['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2d9d64);})[_0x13d9('0x23')](function(_0x1054d3){_0x593c50[_0x13d9('0x6b')]=_0x1054d3;return _0x593c50;});}})[_0x13d9('0x23')](respondWithFilteredResult(_0x3674ad,_0x2d9d64))[_0x13d9('0x2c')](handleError(_0x3674ad,null));};exports[_0x13d9('0x6c')]=function(_0xf367d2,_0x718547,_0x3f6f38){return db[_0x13d9('0x42')]['find']({'where':{'id':_0xf367d2[_0x13d9('0x58')]['id']}})[_0x13d9('0x23')](handleEntityNotFound(_0x718547,null))[_0x13d9('0x23')](function(_0x32546c){if(_0x32546c){return _0x32546c[_0x13d9('0x6c')](_0xf367d2['query']['ids']);}})[_0x13d9('0x23')](respondWithStatusCode(_0x718547,null))['catch'](handleError(_0x718547,null));};exports['addAnswer']=function(_0x2d79ef,_0x163e16,_0x38c6c7){if(_0x2d79ef[_0x13d9('0x64')]['id']){delete _0x2d79ef[_0x13d9('0x64')]['id'];}return db[_0x13d9('0x42')][_0x13d9('0x5d')]({'where':{'id':_0x2d79ef[_0x13d9('0x58')]['id']}})[_0x13d9('0x23')](handleEntityNotFound(_0x163e16,null))['then'](function(_0x72d255){if(_0x72d255){_0x2d79ef[_0x13d9('0x64')]['WhatsappAccountId']=_0x72d255['id'];return db[_0x13d9('0x6d')][_0x13d9('0x5e')](_0x2d79ef['body']);}})['then'](respondWithResult(_0x163e16,null))[_0x13d9('0x2c')](handleError(_0x163e16,null));};exports[_0x13d9('0x6e')]=function(_0x427890,_0x1c0b30,_0x5d49a6){var _0x523415={'raw':![],'where':{}};var _0x11eb3b={};var _0x15e158={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x13d9('0x68')]({'where':{'id':_0x427890[_0x13d9('0x58')]['id']}})[_0x13d9('0x23')](handleEntityNotFound(_0x1c0b30,null))[_0x13d9('0x23')](function(_0x266dfc){if(_0x266dfc){_0x11eb3b[_0x13d9('0x47')]=_[_0x13d9('0x48')](db[_0x13d9('0x6d')][_0x13d9('0x43')]);_0x11eb3b[_0x13d9('0x4a')]=_[_0x13d9('0x48')](_0x427890[_0x13d9('0x4a')]);_0x11eb3b[_0x13d9('0x4f')]=_[_0x13d9('0x49')](_0x11eb3b['model'],_0x11eb3b[_0x13d9('0x4a')]);_0x523415[_0x13d9('0x4b')]=_[_0x13d9('0x49')](_0x11eb3b[_0x13d9('0x47')],qs[_0x13d9('0x5a')](_0x427890[_0x13d9('0x4a')]['fields']));_0x523415[_0x13d9('0x4b')]=_0x523415[_0x13d9('0x4b')]['length']?_0x523415['attributes']:_0x11eb3b['model'];if(!_0x427890[_0x13d9('0x4a')]['hasOwnProperty'](_0x13d9('0x6f'))){_0x523415[_0x13d9('0x30')]=qs['limit'](_0x427890['query'][_0x13d9('0x30')]);_0x523415[_0x13d9('0x33')]=qs['offset'](_0x427890[_0x13d9('0x4a')]['offset']);}_0x523415['order']=qs[_0x13d9('0x4d')](_0x427890[_0x13d9('0x4a')]['sort']);_0x523415[_0x13d9('0x4e')]=qs['filters'](_[_0x13d9('0x50')](_0x427890[_0x13d9('0x4a')],_0x11eb3b['filters']));_0x523415[_0x13d9('0x4e')]['WhatsappAccountId']=_0x266dfc['id'];if(_0x427890[_0x13d9('0x4a')]['filter']){_0x523415[_0x13d9('0x4e')]=_[_0x13d9('0x52')](_0x523415[_0x13d9('0x4e')],{'$or':_['map'](_0x523415[_0x13d9('0x4b')],function(_0x3cc1f7){var _0x44b306={};_0x44b306[_0x3cc1f7]={'$like':'%'+_0x427890[_0x13d9('0x4a')][_0x13d9('0x51')]+'%'};return _0x44b306;})});}_0x523415=_['merge']({},_0x523415,_0x427890[_0x13d9('0x5c')]);return db['CannedAnswer'][_0x13d9('0x32')]({'where':_0x523415[_0x13d9('0x4e')]})[_0x13d9('0x23')](function(_0x385057){_0x15e158['count']=_0x385057;if(_0x427890[_0x13d9('0x4a')]['includeAll']){_0x523415[_0x13d9('0x55')]=[{'all':!![]}];}return db[_0x13d9('0x6d')][_0x13d9('0x56')](_0x523415);})['then'](function(_0x59e9bf){_0x15e158[_0x13d9('0x6b')]=_0x59e9bf;return _0x15e158;});}})[_0x13d9('0x23')](respondWithFilteredResult(_0x1c0b30,_0x523415))[_0x13d9('0x2c')](handleError(_0x1c0b30,null));};exports[_0x13d9('0x70')]=function(_0x3a11c2,_0x3bd1d1,_0x30fb0f){return db['WhatsappAccount']['find']({'where':{'id':_0x3a11c2[_0x13d9('0x58')]['id']}})[_0x13d9('0x23')](handleEntityNotFound(_0x3bd1d1,null))['then'](function(_0x1ec5cf){if(_0x1ec5cf){return _0x1ec5cf[_0x13d9('0x70')](_0x3a11c2['query'][_0x13d9('0x71')]);}})[_0x13d9('0x23')](respondWithStatusCode(_0x3bd1d1,null))[_0x13d9('0x2c')](handleError(_0x3bd1d1,null));};exports[_0x13d9('0x72')]=function(_0x41e2c5,_0x4c7e87,_0x256942){return db[_0x13d9('0x42')]['find']({'where':{'id':_0x41e2c5[_0x13d9('0x58')]['id']}})[_0x13d9('0x23')](handleEntityNotFound(_0x4c7e87,null))['then'](function(_0x27d2e7){if(_0x27d2e7){return _0x27d2e7[_0x13d9('0x72')](_0x41e2c5[_0x13d9('0x64')][_0x13d9('0x71')],_['omit'](_0x41e2c5[_0x13d9('0x64')],[_0x13d9('0x71'),'id'])||{})[_0x13d9('0x73')](function(_0x5688de){for(var _0x115ec5=0x0;_0x115ec5<_0x41e2c5['body']['ids'][_0x13d9('0x5b')];_0x115ec5+=0x1){socket[_0x13d9('0x74')](_0x13d9('0x75'),{'UserId':Number(_0x41e2c5[_0x13d9('0x64')][_0x13d9('0x71')][_0x115ec5]),'WhatsappAccountId':Number(_0x41e2c5[_0x13d9('0x58')]['id'])});}return _0x5688de;});}})[_0x13d9('0x23')](respondWithResult(_0x4c7e87,null))[_0x13d9('0x2c')](handleError(_0x4c7e87,null));};exports['removeAgents']=function(_0x1904e6,_0x1205c0,_0x58c0ac){return db[_0x13d9('0x42')][_0x13d9('0x5d')]({'where':{'id':_0x1904e6[_0x13d9('0x58')]['id']}})[_0x13d9('0x23')](handleEntityNotFound(_0x1205c0,null))['then'](function(_0x440dbd){if(_0x440dbd){return _0x440dbd[_0x13d9('0x76')](_0x1904e6[_0x13d9('0x4a')][_0x13d9('0x71')])[_0x13d9('0x23')](function(){if(_['isArray'](_0x1904e6[_0x13d9('0x4a')][_0x13d9('0x71')])){for(var _0x521821=0x0;_0x521821<_0x1904e6[_0x13d9('0x4a')][_0x13d9('0x71')]['length'];_0x521821+=0x1){socket[_0x13d9('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x1904e6[_0x13d9('0x4a')]['ids'][_0x521821]),'WhatsappAccountId':Number(_0x1904e6[_0x13d9('0x58')]['id'])});}}else{socket[_0x13d9('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x1904e6['query']['ids']),'WhatsappAccountId':Number(_0x1904e6[_0x13d9('0x58')]['id'])});}});}})[_0x13d9('0x23')](respondWithStatusCode(_0x1205c0,null))[_0x13d9('0x2c')](handleError(_0x1205c0,null));};exports[_0x13d9('0x77')]=function(_0x221bdf,_0x1b73eb,_0xc1755f){var _0x5b2fa4={};var _0x2dcf14={};var _0x22a554;var _0x132c11;return db[_0x13d9('0x42')][_0x13d9('0x68')]({'where':{'id':_0x221bdf['params']['id']}})['then'](handleEntityNotFound(_0x1b73eb,null))['then'](function(_0x2d915d){if(_0x2d915d){_0x22a554=_0x2d915d;_0x2dcf14[_0x13d9('0x47')]=_[_0x13d9('0x48')](db[_0x13d9('0x78')][_0x13d9('0x43')]);_0x2dcf14[_0x13d9('0x4a')]=_[_0x13d9('0x48')](_0x221bdf[_0x13d9('0x4a')]);_0x2dcf14['filters']=_['intersection'](_0x2dcf14[_0x13d9('0x47')],_0x2dcf14[_0x13d9('0x4a')]);_0x5b2fa4[_0x13d9('0x4b')]=_[_0x13d9('0x49')](_0x2dcf14[_0x13d9('0x47')],qs['fields'](_0x221bdf['query'][_0x13d9('0x5a')]));_0x5b2fa4[_0x13d9('0x4b')]=_0x5b2fa4[_0x13d9('0x4b')][_0x13d9('0x5b')]?_0x5b2fa4[_0x13d9('0x4b')]:_0x2dcf14['model'];_0x5b2fa4[_0x13d9('0x6a')]=qs['sort'](_0x221bdf['query'][_0x13d9('0x4d')]);_0x5b2fa4['where']=qs[_0x13d9('0x4f')](_[_0x13d9('0x50')](_0x221bdf[_0x13d9('0x4a')],_0x2dcf14[_0x13d9('0x4f')]));if(_0x221bdf['query'][_0x13d9('0x51')]){_0x5b2fa4[_0x13d9('0x4e')]=_[_0x13d9('0x52')](_0x5b2fa4[_0x13d9('0x4e')],{'$or':_[_0x13d9('0x41')](_0x5b2fa4[_0x13d9('0x4b')],function(_0x57ecaa){var _0x4428a1={};_0x4428a1[_0x57ecaa]={'$like':'%'+_0x221bdf[_0x13d9('0x4a')][_0x13d9('0x51')]+'%'};return _0x4428a1;})});}_0x5b2fa4=_[_0x13d9('0x52')]({},_0x5b2fa4,_0x221bdf[_0x13d9('0x5c')]);return _0x22a554['getAgents'](_0x5b2fa4);}})[_0x13d9('0x23')](function(_0x223483){if(_0x223483){_0x132c11=_0x223483[_0x13d9('0x5b')];if(!_0x221bdf[_0x13d9('0x4a')][_0x13d9('0x4c')](_0x13d9('0x6f'))){_0x5b2fa4['limit']=qs[_0x13d9('0x30')](_0x221bdf[_0x13d9('0x4a')][_0x13d9('0x30')]);_0x5b2fa4[_0x13d9('0x33')]=qs['offset'](_0x221bdf[_0x13d9('0x4a')]['offset']);}return _0x22a554[_0x13d9('0x77')](_0x5b2fa4);}})[_0x13d9('0x23')](function(_0x5699f6){if(_0x5699f6){return _0x5699f6?{'count':_0x132c11,'rows':_0x5699f6}:null;}})[_0x13d9('0x23')](respondWithResult(_0x1b73eb,null))[_0x13d9('0x2c')](handleError(_0x1b73eb,null));};exports[_0x13d9('0x79')]=function(_0x5209f5,_0x1a1bd0){var _0xdc14ad=_0x5209f5[_0x13d9('0x58')]['id'];var _0x281da2=_0x5209f5[_0x13d9('0x64')];var _0x5c6d8e=0xc8;var _0x1e03f9=null;return db[_0x13d9('0x7a')][_0x13d9('0x7b')]({'isolationLevel':db[_0x13d9('0x7a')][_0x13d9('0x7c')][_0x13d9('0x7d')][_0x13d9('0x7e')]},function(_0x49d64c){return db['WhatsappAccount']['findOne']({'where':{'id':_0xdc14ad},'transaction':_0x49d64c})[_0x13d9('0x23')](function(_0x379a2f){if(_0x379a2f){return db[_0x13d9('0x7f')]['destroy']({'where':{'WhatsappAccountId':_0xdc14ad},'transaction':_0x49d64c})[_0x13d9('0x23')](function(){var _0x1335dd=_['map'](_0x281da2,function(_0x3d409f){_0x3d409f[_0x13d9('0x66')]=_0xdc14ad;return _0x3d409f;});return db[_0x13d9('0x7f')][_0x13d9('0x80')](_0x1335dd,{'transaction':_0x49d64c});});}else{_0x5c6d8e=0x194;_0x1e03f9=[];}});})[_0x13d9('0x23')](function(){if(_0x5c6d8e!==0x194){return db[_0x13d9('0x7f')][_0x13d9('0x81')]({'where':{'WhatsappAccountId':_0xdc14ad},'order':'priority'})['then'](function(_0x3cdd26){_0x1e03f9=_0x3cdd26;});}})[_0x13d9('0x2c')](function(_0x3347f2){_0x5c6d8e=0x1f4;logger[_0x13d9('0x29')](_0x3347f2[_0x13d9('0x82')]);if(_0x3347f2[_0x13d9('0x3e')]){delete _0x3347f2['name'];}_0x1e03f9=_0x3347f2;})[_0x13d9('0x83')](function(){if(_0x1e03f9===null){_0x1a1bd0['sendStatus'](_0x5c6d8e);}else{if(_0x5c6d8e===0x1f4){_0x1a1bd0[_0x13d9('0x2e')](_0x5c6d8e)[_0x13d9('0x3f')](_0x1e03f9);}else{_0x1a1bd0[_0x13d9('0x2e')](_0x5c6d8e)[_0x13d9('0x84')](_0x1e03f9);}}});};exports['getApplications']=function(_0x5e3b02,_0x5b94f7,_0x5b1ee3){var _0x5befa3={};var _0x1785b5={};var _0x5d6e9f;var _0x237a81;return db['WhatsappAccount'][_0x13d9('0x68')]({'where':{'id':_0x5e3b02[_0x13d9('0x58')]['id']}})[_0x13d9('0x23')](handleEntityNotFound(_0x5b94f7,null))[_0x13d9('0x23')](function(_0x4417df){if(_0x4417df){_0x5d6e9f=_0x4417df;_0x1785b5[_0x13d9('0x47')]=_[_0x13d9('0x48')](db[_0x13d9('0x7f')][_0x13d9('0x43')]);_0x1785b5[_0x13d9('0x4a')]=_[_0x13d9('0x48')](_0x5e3b02[_0x13d9('0x4a')]);_0x1785b5[_0x13d9('0x4f')]=_[_0x13d9('0x49')](_0x1785b5['model'],_0x1785b5['query']);_0x5befa3[_0x13d9('0x4b')]=_[_0x13d9('0x49')](_0x1785b5[_0x13d9('0x47')],qs['fields'](_0x5e3b02[_0x13d9('0x4a')][_0x13d9('0x5a')]));_0x5befa3['attributes']=_0x5befa3['attributes'][_0x13d9('0x5b')]?_0x5befa3[_0x13d9('0x4b')]:_0x1785b5['model'];_0x5befa3['order']=qs[_0x13d9('0x4d')](_0x5e3b02[_0x13d9('0x4a')][_0x13d9('0x4d')]);_0x5befa3[_0x13d9('0x4e')]=qs[_0x13d9('0x4f')](_[_0x13d9('0x50')](_0x5e3b02[_0x13d9('0x4a')],_0x1785b5[_0x13d9('0x4f')]));if(_0x5e3b02[_0x13d9('0x4a')][_0x13d9('0x51')]){_0x5befa3[_0x13d9('0x4e')]=_['merge'](_0x5befa3[_0x13d9('0x4e')],{'$or':_[_0x13d9('0x41')](_0x5befa3['attributes'],function(_0x25bb0e){var _0x18825a={};_0x18825a[_0x25bb0e]={'$like':'%'+_0x5e3b02[_0x13d9('0x4a')][_0x13d9('0x51')]+'%'};return _0x18825a;})});}_0x5befa3=_[_0x13d9('0x52')]({},_0x5befa3,_0x5e3b02[_0x13d9('0x5c')]);return _0x5d6e9f['getApplications'](_0x5befa3);}})[_0x13d9('0x23')](function(_0x4db02e){if(_0x4db02e){_0x237a81=_0x4db02e[_0x13d9('0x5b')];if(!_0x5e3b02[_0x13d9('0x4a')]['hasOwnProperty']('nolimit')){_0x5befa3[_0x13d9('0x30')]=qs[_0x13d9('0x30')](_0x5e3b02['query'][_0x13d9('0x30')]);_0x5befa3[_0x13d9('0x33')]=qs[_0x13d9('0x33')](_0x5e3b02[_0x13d9('0x4a')][_0x13d9('0x33')]);}return _0x5d6e9f[_0x13d9('0x85')](_0x5befa3);}})[_0x13d9('0x23')](function(_0x37b977){if(_0x37b977){return _0x37b977?{'count':_0x237a81,'rows':_0x37b977}:null;}})['then'](respondWithResult(_0x5b94f7,null))[_0x13d9('0x2c')](handleError(_0x5b94f7,null));};exports[_0x13d9('0x86')]=function(_0x38118f,_0x2b8f4c,_0x42c882){var _0x2a3e82={'channel':_0x13d9('0x87')};var _0x205064=[];var _0x233650=[];var _0x1df646={};return db[_0x13d9('0x42')]['find']({'where':{'id':_0x38118f['params']['id']},'include':[{'model':db[_0x13d9('0x7f')],'as':_0x13d9('0x88')}]})[_0x13d9('0x23')](handleEntityNotFound(_0x2b8f4c,null))[_0x13d9('0x23')](function(_0x3f23c9){_0x2a3e82[_0x13d9('0x89')]=_0x3f23c9;if(_0x2a3e82[_0x13d9('0x89')]&&_0x2a3e82[_0x13d9('0x89')][_0x13d9('0x45')]===_0x13d9('0x8a')&&_0x38118f['body'][_0x13d9('0x8b')]){if(_0x38118f[_0x13d9('0x64')][_0x13d9('0x8b')][_0x13d9('0x5b')]===0x0)return;if(_0x38118f[_0x13d9('0x64')][_0x13d9('0x8b')][0x0][_0x13d9('0x8c')]!==_0x13d9('0x8d'))return;return db[_0x13d9('0x8e')][_0x13d9('0x39')]({'read':!![],'readAt':_0x38118f[_0x13d9('0x64')][_0x13d9('0x8b')][0x0][_0x13d9('0x8f')]},{'where':{'messageId':_0x38118f[_0x13d9('0x64')][_0x13d9('0x8b')][0x0][_0x13d9('0x90')]},'individualHooks':!![]})[_0x13d9('0x23')](function(_0x293178){return _0x2b8f4c[_0x13d9('0x2e')](0xc8)[_0x13d9('0x84')](_0x293178);});}_0x2a3e82[_0x13d9('0x91')]=_['orderBy'](_0x3f23c9[_0x13d9('0x88')],[_0x13d9('0x92')],['asc']);if(_0x2a3e82['account'][_0x13d9('0x88')]){delete _0x2a3e82[_0x13d9('0x89')][_0x13d9('0x88')];}return db[_0x13d9('0x93')][_0x13d9('0x65')]()[_0x13d9('0x23')](function(_0x3f8226){if(!_0x3f8226){throw new db[(_0x13d9('0x94'))][(_0x13d9('0x95'))]('no\x20available\x20attributes');}_0x205064=_[_0x13d9('0x96')](_['keys'](_0x3f8226),[_0x13d9('0x97'),'updatedAt']);_0x233650=_[_0x13d9('0x96')](_['keys'](_0x3f8226),[_0x13d9('0x97'),_0x13d9('0x98'),_0x13d9('0x99'),_0x13d9('0x9a')]);_0x2a3e82[_0x13d9('0x64')]={'mapKey':_0x13d9('0x9b')};if(_0x2a3e82[_0x13d9('0x89')]&&_0x2a3e82[_0x13d9('0x89')][_0x13d9('0x45')]===_0x13d9('0x9c')){_0x2a3e82[_0x13d9('0x64')]['from']=_0x38118f[_0x13d9('0x64')][_0x13d9('0x9d')]['replace'](_0x13d9('0x9e'),'');_0x2a3e82[_0x13d9('0x64')][_0x13d9('0x64')]=_0x38118f['body'][_0x13d9('0x9f')];_0x2a3e82[_0x13d9('0x64')][_0x13d9('0xa0')]=_0x38118f['body'][_0x13d9('0xa1')];}if(_0x2a3e82[_0x13d9('0x89')]&&_0x2a3e82[_0x13d9('0x89')][_0x13d9('0x45')]===_0x13d9('0x8a')){_0x2a3e82[_0x13d9('0x64')]['from']=_0x38118f[_0x13d9('0x64')][_0x13d9('0xa2')][0x0][_0x13d9('0xa3')];_0x2a3e82[_0x13d9('0x64')]['body']=_0x38118f[_0x13d9('0x64')][_0x13d9('0xa2')][0x0][_0x13d9('0x2a')][_0x13d9('0x64')];_0x2a3e82[_0x13d9('0x64')][_0x13d9('0xa0')]=_0x38118f[_0x13d9('0x64')][_0x13d9('0xa2')][0x0][_0x13d9('0x90')];}if(_0x2a3e82[_0x13d9('0x64')]['id']){delete _0x2a3e82['body']['id'];}if(_[_0x13d9('0xa4')](_0x2a3e82[_0x13d9('0x64')][_0x13d9('0xa3')])){throw new db[(_0x13d9('0x94'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x13d9('0xa4')](_0x2a3e82[_0x13d9('0x64')][_0x13d9('0x64')])||_0x2a3e82['body'][_0x13d9('0x64')]===''){throw new db[(_0x13d9('0x94'))][(_0x13d9('0x95'))](_0x13d9('0xa5'));}if(_['isNil'](_0x2a3e82[_0x13d9('0x64')]['mapKey'])){throw new db[(_0x13d9('0x94'))][(_0x13d9('0x95'))](_0x13d9('0xa6')+_0x233650);}if(!_['includes'](_0x233650,_0x2a3e82[_0x13d9('0x64')][_0x13d9('0xa7')])){throw new db['Sequelize']['ValidationError'](_0x13d9('0xa8')+_0x233650);}_0x1df646[_0x2a3e82[_0x13d9('0x64')][_0x13d9('0xa7')]]=_0x2a3e82[_0x13d9('0x64')][_0x13d9('0xa3')];return db[_0x13d9('0xa9')]['find']({'where':{'id':_0x2a3e82[_0x13d9('0x89')][_0x13d9('0x9a')]},'include':[{'model':db[_0x13d9('0x93')],'as':_0x13d9('0xaa'),'where':_0x1df646,'limit':0x1,'order':[[_0x13d9('0x98'),_0x13d9('0xab')]]}]});})[_0x13d9('0x23')](handleEntityNotFound(_0x2b8f4c,null))[_0x13d9('0x23')](function(_0x3f51a5){if(_0x3f51a5){_0x2a3e82[_0x13d9('0xac')]=_[_0x13d9('0xad')](_0x3f51a5,[_0x13d9('0xaa')]);if(_0x3f51a5[_0x13d9('0xaa')][_0x13d9('0x5b')]){return _0x3f51a5[_0x13d9('0xaa')][0x0];}var _0x10a4de=_[_0x13d9('0xae')](_0x2a3e82[_0x13d9('0x64')],{'firstName':_0x2a3e82[_0x13d9('0x64')][_0x13d9('0xa3')],'ListId':_0x3f51a5['id']});_0x10a4de[_0x2a3e82[_0x13d9('0x64')]['mapKey']]=_0x2a3e82[_0x13d9('0x64')]['from'];return db[_0x13d9('0x93')][_0x13d9('0x5e')](_0x10a4de,{'fields':_0x205064,'raw':!![]});}})[_0x13d9('0x23')](handleEntityNotFound(_0x2b8f4c,null))[_0x13d9('0x23')](function(_0x5c6420){if(_0x5c6420){_0x2a3e82['contact']=_0x5c6420;var _0x3237b1={'ContactId':_0x5c6420['id'],'phone':_0x2a3e82[_0x13d9('0x64')]['from'],'WhatsappAccountId':_0x38118f['params']['id']};var _0xcb0f71={'ContactId':_0x5c6420['id'],'WhatsappAccountId':_0x38118f[_0x13d9('0x58')]['id'],'closed':![]};return db[_0x13d9('0xaf')]['find']({'where':_0xcb0f71})[_0x13d9('0x23')](function(_0x321eac){if(_0x321eac){return[_0x321eac,![]];}return db[_0x13d9('0xaf')][_0x13d9('0x5e')](_0x3237b1)['then'](function(_0x20a4f0){return[_0x20a4f0,!![]];});});}})[_0x13d9('0x73')](function(_0xd729be,_0x16d6fb){_0x2a3e82[_0x13d9('0xb0')]=_0xd729be[_0x13d9('0x3b')]({'plain':!![]});_0x2a3e82['interaction'][_0x13d9('0xb1')]=![];if(_0x16d6fb){if(_0x2a3e82['account'][_0x13d9('0xb2')]){_0x2a3e82[_0x13d9('0x91')]['push']({'id':0x0,'priority':_0x2a3e82[_0x13d9('0x91')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x2a3e82[_0x13d9('0xb0')][_0x13d9('0xb1')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x2a3e82['body'][_0x13d9('0xa3')],'messageId':_0x2a3e82['body'][_0x13d9('0xa0')],'body':_0x2a3e82[_0x13d9('0x64')][_0x13d9('0x64')],'WhatsappAccountId':_0x38118f['params']['id'],'WhatsappInteractionId':_0xd729be['id'],'direction':'in','ContactId':_0xd729be[_0x13d9('0xb3')],'AttachmentId':_0x2a3e82[_0x13d9('0x64')][_0x13d9('0xb4')]});})[_0x13d9('0x23')](function(_0x5887f1){_0x2a3e82[_0x13d9('0x2a')]=_0x5887f1;if(!_0x2a3e82[_0x13d9('0xb0')][_0x13d9('0xb5')])return;return db[_0x13d9('0x78')][_0x13d9('0x5d')]({'attributes':['id','name'],'where':{'id':_0x2a3e82[_0x13d9('0xb0')][_0x13d9('0xb5')]}});})['then'](function(_0xa78ad4){if(_0xa78ad4){_0x2a3e82[_0x13d9('0x91')][_0x13d9('0xb6')]({'id':0x0,'priority':0x0,'app':_0x13d9('0xb7'),'appdata':_0xa78ad4[_0x13d9('0x3e')]+','+(_0x2a3e82['account'][_0x13d9('0xb8')]||0xa),'interval':'*,*,*,*'});}if(!_0x2a3e82[_0x13d9('0xb0')][_0x13d9('0xb9')])return;return db[_0x13d9('0xba')][_0x13d9('0x5d')]({'attributes':['id',_0x13d9('0x3e')],'where':{'id':_0x2a3e82[_0x13d9('0xb0')]['queueId']}});})[_0x13d9('0x23')](function(_0x349ab3){if(_0x349ab3){_0x2a3e82[_0x13d9('0x91')][_0x13d9('0xb6')]({'id':0x0,'priority':0x1,'app':_0x13d9('0xbb'),'appdata':_0x349ab3[_0x13d9('0x3e')]+','+(_0x2a3e82['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x13d9('0xbc')});}return respondWithRpcPromise('Start',_0x13d9('0xbd'),_0x2a3e82);})[_0x13d9('0x23')](function(_0x1e3f04){if(_0x1e3f04){var _0x8df319=0xc8;var _0x6df6cc=_0x13d9('0xbe');logger[_0x13d9('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x6df6cc,_0x8df319,_0x13d9('0xbf'));logger[_0x13d9('0x27')](_0x13d9('0xc0'),_0x6df6cc,_0x8df319,_0x13d9('0xbf'),JSON['stringify'](_0x1e3f04));if(_0x2a3e82[_0x13d9('0x89')][_0x13d9('0x45')]===_0x13d9('0x9c')){return _0x2b8f4c[_0x13d9('0x2e')](_0x8df319)[_0x13d9('0x34')](_0x13d9('0xc1'),_0x13d9('0xc2'))['send'](_0x13d9('0xc3'));}else{return _0x2b8f4c[_0x13d9('0x2e')](_0x8df319)['json'](_0x1e3f04);}}});})['catch'](handleError(_0x2b8f4c,null));};exports[_0x13d9('0x3f')]=function(_0x3ac118,_0x2f6745,_0xed6e73){var _0x2bb7bb,_0x3dd9a5,_0x824400;if(_[_0x13d9('0xa4')](_0x3ac118[_0x13d9('0x64')][_0x13d9('0x64')])||_0x3ac118[_0x13d9('0x64')][_0x13d9('0x64')]===''){throw new db[(_0x13d9('0x94'))][(_0x13d9('0x95'))](_0x13d9('0xa5'));}if(_[_0x13d9('0xa4')](_0x3ac118['body']['to'])){throw new db[(_0x13d9('0x94'))]['ValidationError']('to\x20is\x20mandatory');}_0x2bb7bb=_0x3ac118['body']['to'];return db[_0x13d9('0x42')][_0x13d9('0x5d')]({'where':{'id':_0x3ac118[_0x13d9('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x13d9('0xc4'),'include':[{'model':db[_0x13d9('0x93')],'as':'Contacts','where':{'mobile':_0x2bb7bb},'limit':0x1,'order':[[_0x13d9('0x98'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x2f6745,null))[_0x13d9('0x23')](function(_0x108762){if(_0x108762&&_0x108762['List']){_0x3dd9a5=_0x108762[_0x13d9('0x3b')]({'plain':!![]});if(_0x3dd9a5[_0x13d9('0xc4')]&&_0x3dd9a5[_0x13d9('0xc4')]['Contacts'][_0x13d9('0x5b')]){return _0x3dd9a5[_0x13d9('0xc4')][_0x13d9('0xaa')][0x0];}return db[_0x13d9('0x93')][_0x13d9('0x5e')](_[_0x13d9('0xae')](_0x3ac118['body'],{'firstName':_0x2bb7bb,'mobile':_0x2bb7bb,'phone':_0x2bb7bb,'ListId':_0x3dd9a5[_0x13d9('0x9a')]}));}})[_0x13d9('0x23')](handleEntityNotFound(_0x2f6745,null))[_0x13d9('0x23')](function(_0x2e2bf4){if(_0x2e2bf4){_0x824400=_0x2e2bf4;return db[_0x13d9('0xaf')]['find']({'where':{'ContactId':_0x824400['id'],'closed':![],'WhatsappAccountId':_0x3dd9a5['id']}})['then'](function(_0x36d916){if(_0x36d916){return[_0x36d916,![]];}return db['WhatsappInteraction'][_0x13d9('0x5e')]({'UserId':_0x3ac118[_0x13d9('0x5f')]['id'],'ContactId':_0x824400['id'],'WhatsappAccountId':_0x3dd9a5['id'],'phone':_0x2bb7bb,'firstMsgDirection':_0x13d9('0xc5'),'Messages':[_[_0x13d9('0x52')](_0x3ac118['body'],{'read':![],'body':_0x3ac118[_0x13d9('0x64')][_0x13d9('0x64')],'phone':_0x2bb7bb,'WhatsappAccountId':_0x3dd9a5['id'],'UserId':_0x3ac118[_0x13d9('0x5f')]['id'],'ContactId':_0x824400['id']})]},{'include':[{'model':db[_0x13d9('0x8e')],'as':_0x13d9('0xc6')}]})['then'](function(_0x23a85e){return[_0x23a85e,!![]];});});}})[_0x13d9('0x73')](function(_0x3fafd0,_0x25d7e5){if(_0x25d7e5){return _0x3fafd0;}return db[_0x13d9('0x8e')][_0x13d9('0x5e')](_[_0x13d9('0x52')](_0x3ac118[_0x13d9('0x64')],{'read':![],'body':_0x3ac118[_0x13d9('0x64')][_0x13d9('0x64')],'phone':_0x2bb7bb,'WhatsappAccountId':_0x3dd9a5['id'],'WhatsappInteractionId':_0x3fafd0['id'],'UserId':_0x3ac118['user']['id'],'ContactId':_0x824400['id']}))[_0x13d9('0x23')](function(_0x4de7c9){_0x3fafd0[_0x13d9('0xc7')][_0x13d9('0xc6')]=[];_0x3fafd0[_0x13d9('0xc7')][_0x13d9('0xc6')][_0x13d9('0xc8')](_0x4de7c9['dataValues']);return _0x3fafd0;});})['then'](respondWithResult(_0x2f6745,null))[_0x13d9('0x2c')](handleError(_0x2f6745,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index d5d3034..2294811 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 _0x9f77=['save','update','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x343440,_0x366e09){var _0x161dfb=function(_0x2b514b){while(--_0x2b514b){_0x343440['push'](_0x343440['shift']());}};_0x161dfb(++_0x366e09);}(_0x9f77,0x106));var _0x79f7=function(_0x1e3ac9,_0x21dc11){_0x1e3ac9=_0x1e3ac9-0x0;var _0x13a72d=_0x9f77[_0x1e3ac9];return _0x13a72d;};'use strict';var EventEmitter=require(_0x79f7('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x79f7('0x1')](0x0);var events={'afterCreate':_0x79f7('0x2'),'afterUpdate':_0x79f7('0x3'),'afterDestroy':'remove'};function emitEvent(_0x19b6cd){return function(_0x38fb72,_0x1e79d5,_0x19d7a8){WhatsappAccountEvents['emit'](_0x19b6cd+':'+_0x38fb72['id'],_0x38fb72);WhatsappAccountEvents[_0x79f7('0x4')](_0x19b6cd,_0x38fb72);_0x19d7a8(null);};}for(var e in events){if(events[_0x79f7('0x5')](e)){var event=events[e];WhatsappAccount[_0x79f7('0x6')](e,emitEvent(event));}}module[_0x79f7('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0xb0a1=['setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xb0a1,0x19d));var _0x1b0a=function(_0x558cee,_0x332fef){_0x558cee=_0x558cee-0x0;var _0x34fd9b=_0xb0a1[_0x558cee];return _0x34fd9b;};'use strict';var EventEmitter=require(_0x1b0a('0x0'));var WhatsappAccount=require(_0x1b0a('0x1'))['db'][_0x1b0a('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1b0a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b0a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x374321){return function(_0xaf8ae8,_0x1bb6a9,_0x23fea5){WhatsappAccountEvents['emit'](_0x374321+':'+_0xaf8ae8['id'],_0xaf8ae8);WhatsappAccountEvents[_0x1b0a('0x5')](_0x374321,_0xaf8ae8);_0x23fea5(null);};}for(var e in events){if(events[_0x1b0a('0x6')](e)){var event=events[e];WhatsappAccount[_0x1b0a('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 7fee39d..75617aa 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 _0x654e=['path','rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','util','api','moment','bluebird','request-promise'];(function(_0x36e55f,_0x703c41){var _0x2208b2=function(_0x2b8915){while(--_0x2b8915){_0x36e55f['push'](_0x36e55f['shift']());}};_0x2208b2(++_0x703c41);}(_0x654e,0x67));var _0xe654=function(_0x205c11,_0x941d3d){_0x205c11=_0x205c11-0x0;var _0x550e7b=_0x654e[_0x205c11];return _0x550e7b;};'use strict';var _=require('lodash');var util=require(_0xe654('0x0'));var logger=require('../../config/logger')(_0xe654('0x1'));var moment=require(_0xe654('0x2'));var BPromise=require(_0xe654('0x3'));var rp=require(_0xe654('0x4'));var fs=require('fs');var path=require(_0xe654('0x5'));var rimraf=require(_0xe654('0x6'));var config=require('../../config/environment');var attributes=require(_0xe654('0x7'));module[_0xe654('0x8')]=function(_0x2d9aba,_0x392d75){return _0x2d9aba[_0xe654('0x9')](_0xe654('0xa'),attributes,{'tableName':_0xe654('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6a1=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash'];(function(_0x1f5850,_0x5c3f6f){var _0x135dac=function(_0x228d36){while(--_0x228d36){_0x1f5850['push'](_0x1f5850['shift']());}};_0x135dac(++_0x5c3f6f);}(_0xc6a1,0x197));var _0x1c6a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xc6a1[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x1c6a('0x0'));var util=require('util');var logger=require(_0x1c6a('0x1'))('api');var moment=require(_0x1c6a('0x2'));var BPromise=require(_0x1c6a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c6a('0x4'));var rimraf=require(_0x1c6a('0x5'));var config=require(_0x1c6a('0x6'));var attributes=require(_0x1c6a('0x7'));module[_0x1c6a('0x8')]=function(_0x109164,_0x56a33d){return _0x109164[_0x1c6a('0x9')](_0x1c6a('0xa'),attributes,{'tableName':_0x1c6a('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 6f3b4c1..62854d4 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 _0x9148=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','WhatsappAccount','find','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','lodash','util','moment','bluebird'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x9148,0x10d));var _0x8914=function(_0x1bb356,_0x3e3b67){_0x1bb356=_0x1bb356-0x0;var _0x4e9c30=_0x9148[_0x1bb356];return _0x4e9c30;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var moment=require(_0x8914('0x2'));var BPromise=require(_0x8914('0x3'));var rs=require(_0x8914('0x4'));var fs=require('fs');var Redis=require(_0x8914('0x5'));var db=require(_0x8914('0x6'))['db'];var utils=require(_0x8914('0x7'));var logger=require(_0x8914('0x8'))(_0x8914('0x9'));var config=require(_0x8914('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8914('0xb')]['http']({'port':0x232a});config[_0x8914('0xc')]=_['defaults'](config[_0x8914('0xc')],{'host':_0x8914('0xd'),'port':0x18eb});var socket=require(_0x8914('0xe'))(new Redis(config[_0x8914('0xc')]));require('./whatsappAccount.socket')[_0x8914('0xf')](socket);function respondWithRpcPromise(_0x38defa,_0x63bdb4,_0x6e296e){return new BPromise(function(_0x3e8af9,_0x569386){return client[_0x8914('0x10')](_0x38defa,_0x6e296e)[_0x8914('0x11')](function(_0x4c8007){logger['info'](_0x8914('0x12'),_0x63bdb4,_0x8914('0x13'));logger[_0x8914('0x14')](_0x8914('0x15'),_0x63bdb4,_0x8914('0x13'),JSON[_0x8914('0x16')](_0x4c8007));if(_0x4c8007['error']){if(_0x4c8007[_0x8914('0x17')][_0x8914('0x18')]===0x1f4){logger['error'](_0x8914('0x12'),_0x63bdb4,_0x4c8007[_0x8914('0x17')][_0x8914('0x19')]);return _0x569386(_0x4c8007[_0x8914('0x17')][_0x8914('0x19')]);}logger[_0x8914('0x17')](_0x8914('0x12'),_0x63bdb4,_0x4c8007[_0x8914('0x17')][_0x8914('0x19')]);return _0x3e8af9(_0x4c8007['error'][_0x8914('0x19')]);}else{logger[_0x8914('0x1a')](_0x8914('0x12'),_0x63bdb4,_0x8914('0x13'));_0x3e8af9(_0x4c8007[_0x8914('0x1b')][_0x8914('0x19')]);}})[_0x8914('0x1c')](function(_0x4a93b5){logger[_0x8914('0x17')](_0x8914('0x12'),_0x63bdb4,_0x4a93b5);_0x569386(_0x4a93b5);});});}exports['ShowWhatsappAccount']=function(_0x5de618){var _0x3e4dcc=this;return new Promise(function(_0x564292,_0x5b4f7a){return db[_0x8914('0x1d')][_0x8914('0x1e')]({'raw':_0x5de618[_0x8914('0x1f')]?_0x5de618[_0x8914('0x1f')][_0x8914('0x20')]===undefined?!![]:![]:!![],'where':_0x5de618[_0x8914('0x1f')]?_0x5de618[_0x8914('0x1f')][_0x8914('0x21')]||null:null,'attributes':_0x5de618[_0x8914('0x1f')]?_0x5de618[_0x8914('0x1f')][_0x8914('0x22')]||null:null,'include':_0x5de618[_0x8914('0x1f')]?_0x5de618[_0x8914('0x1f')][_0x8914('0x23')]?_[_0x8914('0x24')](_0x5de618['options']['include'],function(_0x3efc79){return{'model':db[_0x3efc79['model']],'as':_0x3efc79['as'],'attributes':_0x3efc79['attributes'],'include':_0x3efc79['include']?_[_0x8914('0x24')](_0x3efc79[_0x8914('0x23')],function(_0x4695ff){return{'model':db[_0x4695ff[_0x8914('0x25')]],'as':_0x4695ff['as'],'attributes':_0x4695ff[_0x8914('0x22')],'include':_0x4695ff[_0x8914('0x23')]?_[_0x8914('0x24')](_0x4695ff[_0x8914('0x23')],function(_0x42b23c){return{'model':db[_0x42b23c[_0x8914('0x25')]],'as':_0x42b23c['as'],'attributes':_0x42b23c[_0x8914('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8914('0x11')](function(_0x27ba21){logger[_0x8914('0x1a')](_0x8914('0x26'),_0x5de618);logger[_0x8914('0x14')](_0x8914('0x26'),_0x5de618,JSON[_0x8914('0x16')](_0x27ba21));_0x564292(_0x27ba21);})[_0x8914('0x1c')](function(_0x5443d9){logger['error'](_0x8914('0x26'),_0x5443d9['message'],_0x5de618);_0x5b4f7a(_0x3e4dcc['error'](0x1f4,_0x5443d9[_0x8914('0x19')]));});});}; \ No newline at end of file +var _0x33c8=['client','http','redis','socket.io-emitter','./whatsappAccount.socket','register','request','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','WhatsappAccount,\x20%s,\x20%s','message','catch','WhatsappAccount','options','where','include','map','model','attributes','then','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x33c8,0xf2));var _0x833c=function(_0x398582,_0x4ef989){_0x398582=_0x398582-0x0;var _0x189777=_0x33c8[_0x398582];return _0x189777;};'use strict';var _=require(_0x833c('0x0'));var util=require(_0x833c('0x1'));var moment=require(_0x833c('0x2'));var BPromise=require(_0x833c('0x3'));var rs=require(_0x833c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x833c('0x5'))['db'];var utils=require(_0x833c('0x6'));var logger=require('../../config/logger')(_0x833c('0x7'));var config=require(_0x833c('0x8'));var jayson=require(_0x833c('0x9'));var client=jayson[_0x833c('0xa')][_0x833c('0xb')]({'port':0x232a});config[_0x833c('0xc')]=_['defaults'](config[_0x833c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x833c('0xd'))(new Redis(config['redis']));require(_0x833c('0xe'))[_0x833c('0xf')](socket);function respondWithRpcPromise(_0x4c647d,_0x44b5a6,_0x5774eb){return new BPromise(function(_0x7e26a5,_0x10cfe4){return client[_0x833c('0x10')](_0x4c647d,_0x5774eb)['then'](function(_0x28e514){logger[_0x833c('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x44b5a6,_0x833c('0x12'));logger[_0x833c('0x13')](_0x833c('0x14'),_0x44b5a6,_0x833c('0x12'),JSON[_0x833c('0x15')](_0x28e514));if(_0x28e514['error']){if(_0x28e514['error'][_0x833c('0x16')]===0x1f4){logger[_0x833c('0x17')](_0x833c('0x18'),_0x44b5a6,_0x28e514[_0x833c('0x17')][_0x833c('0x19')]);return _0x10cfe4(_0x28e514['error']['message']);}logger[_0x833c('0x17')](_0x833c('0x18'),_0x44b5a6,_0x28e514[_0x833c('0x17')][_0x833c('0x19')]);return _0x7e26a5(_0x28e514[_0x833c('0x17')][_0x833c('0x19')]);}else{logger['info'](_0x833c('0x18'),_0x44b5a6,_0x833c('0x12'));_0x7e26a5(_0x28e514['result'][_0x833c('0x19')]);}})[_0x833c('0x1a')](function(_0x122f7a){logger[_0x833c('0x17')](_0x833c('0x18'),_0x44b5a6,_0x122f7a);_0x10cfe4(_0x122f7a);});});}exports['ShowWhatsappAccount']=function(_0x5f05f1){var _0x9e9c20=this;return new Promise(function(_0x576afc,_0x381620){return db[_0x833c('0x1b')]['find']({'raw':_0x5f05f1[_0x833c('0x1c')]?_0x5f05f1[_0x833c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5f05f1['options']?_0x5f05f1[_0x833c('0x1c')][_0x833c('0x1d')]||null:null,'attributes':_0x5f05f1[_0x833c('0x1c')]?_0x5f05f1[_0x833c('0x1c')]['attributes']||null:null,'include':_0x5f05f1['options']?_0x5f05f1['options'][_0x833c('0x1e')]?_[_0x833c('0x1f')](_0x5f05f1['options'][_0x833c('0x1e')],function(_0x324acc){return{'model':db[_0x324acc[_0x833c('0x20')]],'as':_0x324acc['as'],'attributes':_0x324acc[_0x833c('0x21')],'include':_0x324acc[_0x833c('0x1e')]?_[_0x833c('0x1f')](_0x324acc['include'],function(_0x4dca62){return{'model':db[_0x4dca62[_0x833c('0x20')]],'as':_0x4dca62['as'],'attributes':_0x4dca62[_0x833c('0x21')],'include':_0x4dca62[_0x833c('0x1e')]?_[_0x833c('0x1f')](_0x4dca62[_0x833c('0x1e')],function(_0x512b0c){return{'model':db[_0x512b0c[_0x833c('0x20')]],'as':_0x512b0c['as'],'attributes':_0x512b0c['attributes']};}):[]};}):[]};}):[]:[]})[_0x833c('0x22')](function(_0x1b0283){logger[_0x833c('0x11')](_0x833c('0x23'),_0x5f05f1);logger[_0x833c('0x13')]('ShowWhatsappAccount',_0x5f05f1,JSON['stringify'](_0x1b0283));_0x576afc(_0x1b0283);})['catch'](function(_0x12244e){logger[_0x833c('0x17')](_0x833c('0x23'),_0x12244e[_0x833c('0x19')],_0x5f05f1);_0x381620(_0x9e9c20[_0x833c('0x17')](0x1f4,_0x12244e[_0x833c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index e93f539..e4508de 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 _0x8d20=['emit','removeListener','register','length','save','remove','update'];(function(_0x4769d8,_0x1cb801){var _0x5c3698=function(_0x2712e4){while(--_0x2712e4){_0x4769d8['push'](_0x4769d8['shift']());}};_0x5c3698(++_0x1cb801);}(_0x8d20,0x115));var _0x08d2=function(_0x3efa02,_0x7fb3a7){_0x3efa02=_0x3efa02-0x0;var _0x4a0c00=_0x8d20[_0x3efa02];return _0x4a0c00;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x08d2('0x0'),_0x08d2('0x1'),_0x08d2('0x2')];function createListener(_0x966edf,_0xcde524){return function(_0x3ef533){_0xcde524[_0x08d2('0x3')](_0x966edf,_0x3ef533);};}function removeListener(_0xabcf1b,_0x417f2d){return function(){WhatsappAccountEvents[_0x08d2('0x4')](_0xabcf1b,_0x417f2d);};}exports[_0x08d2('0x5')]=function(_0x443b29){for(var _0x1a4e8d=0x0,_0x107d23=events[_0x08d2('0x6')];_0x1a4e8d<_0x107d23;_0x1a4e8d++){var _0x5dfb42=events[_0x1a4e8d];var _0x62cc0c=createListener('whatsappAccount:'+_0x5dfb42,_0x443b29);WhatsappAccountEvents['on'](_0x5dfb42,_0x62cc0c);}}; \ No newline at end of file +var _0x0267=['./whatsappAccount.events','save','update','emit','removeListener','length','whatsappAccount:'];(function(_0x59049d,_0x9e6871){var _0x3b7750=function(_0x8f5ec7){while(--_0x8f5ec7){_0x59049d['push'](_0x59049d['shift']());}};_0x3b7750(++_0x9e6871);}(_0x0267,0x7e));var _0x7026=function(_0x43935d,_0x47989b){_0x43935d=_0x43935d-0x0;var _0x56603b=_0x0267[_0x43935d];return _0x56603b;};'use strict';var WhatsappAccountEvents=require(_0x7026('0x0'));var events=[_0x7026('0x1'),'remove',_0x7026('0x2')];function createListener(_0x1fd7e0,_0x387f61){return function(_0x47b93b){_0x387f61[_0x7026('0x3')](_0x1fd7e0,_0x47b93b);};}function removeListener(_0x2d8c28,_0x4f198b){return function(){WhatsappAccountEvents[_0x7026('0x4')](_0x2d8c28,_0x4f198b);};}exports['register']=function(_0x3e8f6f){for(var _0x138acf=0x0,_0x7d654b=events[_0x7026('0x5')];_0x138acf<_0x7d654b;_0x138acf++){var _0x321bd5=events[_0x138acf];var _0x24ae65=createListener(_0x7026('0x6')+_0x321bd5,_0x3e8f6f);WhatsappAccountEvents['on'](_0x321bd5,_0x24ae65);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index b8f581a..29a9e41 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 _0x4c10=['connect-timeout','Router','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x1256fe,_0x1f5b06){var _0x306a29=function(_0x444d01){while(--_0x444d01){_0x1256fe['push'](_0x1256fe['shift']());}};_0x306a29(++_0x1f5b06);}(_0x4c10,0x12f));var _0x04c1=function(_0x475959,_0x4b374c){_0x475959=_0x475959-0x0;var _0x447228=_0x4c10[_0x475959];return _0x447228;};'use strict';var multer=require(_0x04c1('0x0'));var util=require(_0x04c1('0x1'));var path=require(_0x04c1('0x2'));var timeout=require(_0x04c1('0x3'));var express=require('express');var router=express[_0x04c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x04c1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x04c1('0x6'));var controller=require(_0x04c1('0x7'));router[_0x04c1('0x8')]('/',auth[_0x04c1('0x9')](),controller[_0x04c1('0xa')]);router[_0x04c1('0x8')](_0x04c1('0xb'),auth[_0x04c1('0x9')](),controller['show']);router[_0x04c1('0xc')]('/',auth['isAuthenticated'](),controller[_0x04c1('0xd')]);router[_0x04c1('0xe')](_0x04c1('0xb'),auth[_0x04c1('0x9')](),controller['update']);router[_0x04c1('0xf')](_0x04c1('0xb'),auth['isAuthenticated'](),controller[_0x04c1('0x10')]);module[_0x04c1('0x11')]=router; \ No newline at end of file +var _0xc318=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','put','destroy','multer','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc318,0xd9));var _0x8c31=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc318[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x8c31('0x0'));var util=require('util');var path=require(_0x8c31('0x1'));var timeout=require(_0x8c31('0x2'));var express=require(_0x8c31('0x3'));var router=express[_0x8c31('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8c31('0x5'));var config=require(_0x8c31('0x6'));var controller=require('./whatsappApplication.controller');router[_0x8c31('0x7')]('/',auth[_0x8c31('0x8')](),controller['index']);router['get'](_0x8c31('0x9'),auth[_0x8c31('0x8')](),controller['show']);router[_0x8c31('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c31('0xb')](_0x8c31('0x9'),auth[_0x8c31('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8c31('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 5398d53..5f458a7 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 _0x7e45=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x2145d1,_0x140c60){var _0x2c29b2=function(_0x533f8f){while(--_0x533f8f){_0x2145d1['push'](_0x2145d1['shift']());}};_0x2c29b2(++_0x140c60);}(_0x7e45,0xae));var _0x57e4=function(_0x1c25c0,_0x575b5b){_0x1c25c0=_0x1c25c0-0x0;var _0x588338=_0x7e45[_0x1c25c0];return _0x588338;};'use strict';var Sequelize=require(_0x57e4('0x0'));module[_0x57e4('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x57e4('0x2')],'allowNull':![],'defaultValue':_0x57e4('0x3')},'appdata':{'type':Sequelize[_0x57e4('0x4')]()},'description':{'type':Sequelize[_0x57e4('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x57e4('0x5')}}; \ No newline at end of file +var _0x4d02=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x4a66d5,_0x123291){var _0x29ecb0=function(_0x329158){while(--_0x329158){_0x4a66d5['push'](_0x4a66d5['shift']());}};_0x29ecb0(++_0x123291);}(_0x4d02,0x6b));var _0x24d0=function(_0x32dca3,_0x596af5){_0x32dca3=_0x32dca3-0x0;var _0x13cbd7=_0x4d02[_0x32dca3];return _0x13cbd7;};'use strict';var Sequelize=require(_0x24d0('0x0'));module[_0x24d0('0x1')]={'priority':{'type':Sequelize[_0x24d0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x24d0('0x3')],'allowNull':![],'defaultValue':_0x24d0('0x4')},'appdata':{'type':Sequelize[_0x24d0('0x5')]()},'description':{'type':Sequelize[_0x24d0('0x3')]},'interval':{'type':Sequelize[_0x24d0('0x3')],'defaultValue':_0x24d0('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 486dd05..e20131f 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 _0x4815=['count','limit','apply','reject','save','update','destroy','then','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x537856,_0x3dde66){var _0x54d0bd=function(_0x374a82){while(--_0x374a82){_0x537856['push'](_0x537856['shift']());}};_0x54d0bd(++_0x3dde66);}(_0x4815,0xff));var _0x5481=function(_0x1749dd,_0x365221){_0x1749dd=_0x1749dd-0x0;var _0x1ae17d=_0x4815[_0x1749dd];return _0x1ae17d;};'use strict';var emlformat=require(_0x5481('0x0'));var rimraf=require(_0x5481('0x1'));var zipdir=require(_0x5481('0x2'));var jsonpatch=require(_0x5481('0x3'));var rp=require(_0x5481('0x4'));var moment=require(_0x5481('0x5'));var BPromise=require(_0x5481('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5481('0x7'));var sox=require(_0x5481('0x8'));var csv=require(_0x5481('0x9'));var ejs=require(_0x5481('0xa'));var fs=require('fs');var fs_extra=require(_0x5481('0xb'));var _=require(_0x5481('0xc'));var squel=require(_0x5481('0xd'));var crypto=require(_0x5481('0xe'));var jsforce=require(_0x5481('0xf'));var deskjs=require(_0x5481('0x10'));var toCsv=require(_0x5481('0x9'));var querystring=require(_0x5481('0x11'));var Papa=require(_0x5481('0x12'));var Redis=require(_0x5481('0x13'));var authService=require(_0x5481('0x14'));var qs=require(_0x5481('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5481('0x16'))(_0x5481('0x17'));var utils=require(_0x5481('0x18'));var config=require(_0x5481('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5481('0x1a'))['db'];function respondWithStatusCode(_0x5645c5,_0x34f04a){_0x34f04a=_0x34f04a||0xcc;return function(_0x41e0ad){if(_0x41e0ad){return _0x5645c5[_0x5481('0x1b')](_0x34f04a);}return _0x5645c5['status'](_0x34f04a)[_0x5481('0x1c')]();};}function respondWithResult(_0x5e9ec1,_0x18dc20){_0x18dc20=_0x18dc20||0xc8;return function(_0x1f8cf8){if(_0x1f8cf8){return _0x5e9ec1[_0x5481('0x1d')](_0x18dc20)[_0x5481('0x1e')](_0x1f8cf8);}};}function respondWithFilteredResult(_0x24ee7a,_0x35d490){return function(_0x31b8c9){if(_0x31b8c9){var _0x2deceb=typeof _0x35d490[_0x5481('0x1f')]===_0x5481('0x20')&&typeof _0x35d490['limit']===_0x5481('0x20');var _0x2e9d46=_0x31b8c9[_0x5481('0x21')];var _0x5d938c=_0x2deceb?0x0:_0x35d490['offset'];var _0x5dcdc1=_0x2deceb?_0x31b8c9['count']:_0x35d490[_0x5481('0x1f')]+_0x35d490[_0x5481('0x22')];var _0x35f015;if(_0x5dcdc1>=_0x2e9d46){_0x5dcdc1=_0x2e9d46;_0x35f015=0xc8;}else{_0x35f015=0xce;}_0x24ee7a['status'](_0x35f015);return _0x24ee7a['set']('Content-Range',_0x5d938c+'-'+_0x5dcdc1+'/'+_0x2e9d46)[_0x5481('0x1e')](_0x31b8c9);}return null;};}function patchUpdates(_0x277bd1){return function(_0x272ef4){try{jsonpatch[_0x5481('0x23')](_0x272ef4,_0x277bd1,!![]);}catch(_0x1cb8dd){return BPromise[_0x5481('0x24')](_0x1cb8dd);}return _0x272ef4[_0x5481('0x25')]();};}function saveUpdates(_0x3e70a3,_0x30c183){return function(_0x197aa7){if(_0x197aa7){return _0x197aa7[_0x5481('0x26')](_0x3e70a3)['then'](function(_0xee5dad){return _0xee5dad;});}return null;};}function removeEntity(_0x4c86d5,_0x321b28){return function(_0x3b3451){if(_0x3b3451){return _0x3b3451[_0x5481('0x27')]()[_0x5481('0x28')](function(){_0x4c86d5[_0x5481('0x1d')](0xcc)[_0x5481('0x1c')]();});}};}function handleEntityNotFound(_0x2ac321,_0x217af9){return function(_0x26eeee){if(!_0x26eeee){_0x2ac321['sendStatus'](0x194);}return _0x26eeee;};}function handleError(_0x50c4f9,_0x2a1674){_0x2a1674=_0x2a1674||0x1f4;return function(_0x3bbf65){logger['error'](_0x3bbf65[_0x5481('0x29')]);if(_0x3bbf65[_0x5481('0x2a')]){delete _0x3bbf65[_0x5481('0x2a')];}_0x50c4f9[_0x5481('0x1d')](_0x2a1674)[_0x5481('0x2b')](_0x3bbf65);};}exports[_0x5481('0x2c')]=function(_0x235327,_0x230b5f){var _0x347cac={},_0x47cbd2={},_0x28cf83={'count':0x0,'rows':[]};var _0x38146e=_[_0x5481('0x2d')](db[_0x5481('0x2e')][_0x5481('0x2f')],function(_0xcac836){return{'name':_0xcac836[_0x5481('0x30')],'type':_0xcac836['type'][_0x5481('0x31')]};});_0x47cbd2['model']=_['map'](_0x38146e,'name');_0x47cbd2[_0x5481('0x32')]=_['keys'](_0x235327[_0x5481('0x32')]);_0x47cbd2[_0x5481('0x33')]=_[_0x5481('0x34')](_0x47cbd2[_0x5481('0x35')],_0x47cbd2[_0x5481('0x32')]);_0x347cac[_0x5481('0x36')]=_['intersection'](_0x47cbd2[_0x5481('0x35')],qs[_0x5481('0x37')](_0x235327['query'][_0x5481('0x37')]));_0x347cac[_0x5481('0x36')]=_0x347cac[_0x5481('0x36')]['length']?_0x347cac[_0x5481('0x36')]:_0x47cbd2[_0x5481('0x35')];if(!_0x235327[_0x5481('0x32')][_0x5481('0x38')](_0x5481('0x39'))){_0x347cac[_0x5481('0x22')]=qs[_0x5481('0x22')](_0x235327[_0x5481('0x32')][_0x5481('0x22')]);_0x347cac[_0x5481('0x1f')]=qs[_0x5481('0x1f')](_0x235327[_0x5481('0x32')][_0x5481('0x1f')]);}_0x347cac[_0x5481('0x3a')]=qs['sort'](_0x235327[_0x5481('0x32')]['sort']);_0x347cac['where']=qs['filters'](_['pick'](_0x235327[_0x5481('0x32')],_0x47cbd2[_0x5481('0x33')]),_0x38146e);if(_0x235327['query']['filter']){_0x347cac['where']=_[_0x5481('0x3b')](_0x347cac[_0x5481('0x3c')],{'$or':_['map'](_0x38146e,function(_0x3524ae){if(_0x3524ae['type']!==_0x5481('0x3d')){var _0x3b84df={};_0x3b84df[_0x3524ae[_0x5481('0x2a')]]={'$like':'%'+_0x235327['query']['filter']+'%'};return _0x3b84df;}})});}_0x347cac=_[_0x5481('0x3b')]({},_0x347cac,_0x235327['options']);var _0xa264ed={'where':_0x347cac[_0x5481('0x3c')]};return db['WhatsappApplication'][_0x5481('0x21')](_0xa264ed)['then'](function(_0xe9daad){_0x28cf83['count']=_0xe9daad;if(_0x235327['query'][_0x5481('0x3e')]){_0x347cac[_0x5481('0x3f')]=[{'all':!![]}];}return db[_0x5481('0x2e')][_0x5481('0x40')](_0x347cac);})[_0x5481('0x28')](function(_0x189c08){_0x28cf83[_0x5481('0x41')]=_0x189c08;return _0x28cf83;})[_0x5481('0x28')](respondWithFilteredResult(_0x230b5f,_0x347cac))[_0x5481('0x42')](handleError(_0x230b5f,null));};exports['show']=function(_0x5f2d33,_0x33b3ac){var _0x1f83c1={'raw':!![],'where':{'id':_0x5f2d33[_0x5481('0x43')]['id']}},_0x2a5a35={};_0x2a5a35['model']=_[_0x5481('0x44')](db[_0x5481('0x2e')]['rawAttributes']);_0x2a5a35[_0x5481('0x32')]=_[_0x5481('0x44')](_0x5f2d33[_0x5481('0x32')]);_0x2a5a35['filters']=_[_0x5481('0x34')](_0x2a5a35[_0x5481('0x35')],_0x2a5a35[_0x5481('0x32')]);_0x1f83c1[_0x5481('0x36')]=_['intersection'](_0x2a5a35[_0x5481('0x35')],qs['fields'](_0x5f2d33[_0x5481('0x32')][_0x5481('0x37')]));_0x1f83c1[_0x5481('0x36')]=_0x1f83c1[_0x5481('0x36')]['length']?_0x1f83c1['attributes']:_0x2a5a35[_0x5481('0x35')];if(_0x5f2d33[_0x5481('0x32')]['includeAll']){_0x1f83c1[_0x5481('0x3f')]=[{'all':!![]}];}_0x1f83c1=_['merge']({},_0x1f83c1,_0x5f2d33['options']);return db['WhatsappApplication']['find'](_0x1f83c1)['then'](handleEntityNotFound(_0x33b3ac,null))[_0x5481('0x28')](respondWithResult(_0x33b3ac,null))[_0x5481('0x42')](handleError(_0x33b3ac,null));};exports[_0x5481('0x45')]=function(_0xd7f0c5,_0x156890){return db[_0x5481('0x2e')][_0x5481('0x45')](_0xd7f0c5[_0x5481('0x46')],{})[_0x5481('0x28')](respondWithResult(_0x156890,0xc9))[_0x5481('0x42')](handleError(_0x156890,null));};exports['update']=function(_0xe4e47b,_0x184f61){if(_0xe4e47b[_0x5481('0x46')]['id']){delete _0xe4e47b[_0x5481('0x46')]['id'];}return db[_0x5481('0x2e')][_0x5481('0x47')]({'where':{'id':_0xe4e47b[_0x5481('0x43')]['id']}})[_0x5481('0x28')](handleEntityNotFound(_0x184f61,null))[_0x5481('0x28')](saveUpdates(_0xe4e47b['body'],null))['then'](respondWithResult(_0x184f61,null))[_0x5481('0x42')](handleError(_0x184f61,null));};exports[_0x5481('0x27')]=function(_0x870f08,_0x2d7246){return db['WhatsappApplication'][_0x5481('0x47')]({'where':{'id':_0x870f08[_0x5481('0x43')]['id']}})[_0x5481('0x28')](handleEntityNotFound(_0x2d7246,null))['then'](removeEntity(_0x2d7246,null))[_0x5481('0x42')](handleError(_0x2d7246,null));}; \ No newline at end of file +var _0xdb7e=['offset','set','Content-Range','apply','reject','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','WhatsappApplication','intersection','length','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb7e,0x11a));var _0xedb7=function(_0x4819f8,_0x499883){_0x4819f8=_0x4819f8-0x0;var _0xbf947c=_0xdb7e[_0x4819f8];return _0xbf947c;};'use strict';var emlformat=require(_0xedb7('0x0'));var rimraf=require(_0xedb7('0x1'));var zipdir=require(_0xedb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedb7('0x3'));var moment=require(_0xedb7('0x4'));var BPromise=require(_0xedb7('0x5'));var Mustache=require('mustache');var util=require(_0xedb7('0x6'));var path=require(_0xedb7('0x7'));var sox=require(_0xedb7('0x8'));var csv=require(_0xedb7('0x9'));var ejs=require(_0xedb7('0xa'));var fs=require('fs');var fs_extra=require(_0xedb7('0xb'));var _=require(_0xedb7('0xc'));var squel=require(_0xedb7('0xd'));var crypto=require(_0xedb7('0xe'));var jsforce=require(_0xedb7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xedb7('0x9'));var querystring=require(_0xedb7('0x10'));var Papa=require(_0xedb7('0x11'));var Redis=require(_0xedb7('0x12'));var authService=require(_0xedb7('0x13'));var qs=require(_0xedb7('0x14'));var as=require(_0xedb7('0x15'));var hardwareService=require(_0xedb7('0x16'));var logger=require(_0xedb7('0x17'))(_0xedb7('0x18'));var utils=require(_0xedb7('0x19'));var config=require(_0xedb7('0x1a'));var licenseUtil=require(_0xedb7('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5161ae,_0x4691db){_0x4691db=_0x4691db||0xcc;return function(_0x1e77b6){if(_0x1e77b6){return _0x5161ae[_0xedb7('0x1c')](_0x4691db);}return _0x5161ae[_0xedb7('0x1d')](_0x4691db)[_0xedb7('0x1e')]();};}function respondWithResult(_0x2923c2,_0x42bb2a){_0x42bb2a=_0x42bb2a||0xc8;return function(_0x1fea8d){if(_0x1fea8d){return _0x2923c2[_0xedb7('0x1d')](_0x42bb2a)['json'](_0x1fea8d);}};}function respondWithFilteredResult(_0x565bb7,_0x19613e){return function(_0x119d3a){if(_0x119d3a){var _0x196b3c=typeof _0x19613e['offset']===_0xedb7('0x1f')&&typeof _0x19613e[_0xedb7('0x20')]===_0xedb7('0x1f');var _0x1c523f=_0x119d3a[_0xedb7('0x21')];var _0x50f579=_0x196b3c?0x0:_0x19613e['offset'];var _0x3d8f2a=_0x196b3c?_0x119d3a[_0xedb7('0x21')]:_0x19613e[_0xedb7('0x22')]+_0x19613e[_0xedb7('0x20')];var _0x4abbf2;if(_0x3d8f2a>=_0x1c523f){_0x3d8f2a=_0x1c523f;_0x4abbf2=0xc8;}else{_0x4abbf2=0xce;}_0x565bb7[_0xedb7('0x1d')](_0x4abbf2);return _0x565bb7[_0xedb7('0x23')](_0xedb7('0x24'),_0x50f579+'-'+_0x3d8f2a+'/'+_0x1c523f)['json'](_0x119d3a);}return null;};}function patchUpdates(_0xecf33d){return function(_0x4806f4){try{jsonpatch[_0xedb7('0x25')](_0x4806f4,_0xecf33d,!![]);}catch(_0x31aaa3){return BPromise[_0xedb7('0x26')](_0x31aaa3);}return _0x4806f4['save']();};}function saveUpdates(_0x54d68f,_0x45d7e7){return function(_0x267e55){if(_0x267e55){return _0x267e55['update'](_0x54d68f)[_0xedb7('0x27')](function(_0xff6827){return _0xff6827;});}return null;};}function removeEntity(_0x4cde11,_0x16d887){return function(_0x581ecb){if(_0x581ecb){return _0x581ecb['destroy']()[_0xedb7('0x27')](function(){_0x4cde11[_0xedb7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ad4e9,_0x46e52a){return function(_0x106c28){if(!_0x106c28){_0x1ad4e9[_0xedb7('0x1c')](0x194);}return _0x106c28;};}function handleError(_0x2bcf43,_0xeb222d){_0xeb222d=_0xeb222d||0x1f4;return function(_0xfcc7ee){logger[_0xedb7('0x28')](_0xfcc7ee['stack']);if(_0xfcc7ee[_0xedb7('0x29')]){delete _0xfcc7ee['name'];}_0x2bcf43['status'](_0xeb222d)[_0xedb7('0x2a')](_0xfcc7ee);};}exports[_0xedb7('0x2b')]=function(_0x55fe73,_0x4896a5){var _0x31bebf={},_0x515ab1={},_0x43975e={'count':0x0,'rows':[]};var _0x2c5cfe=_[_0xedb7('0x2c')](db['WhatsappApplication'][_0xedb7('0x2d')],function(_0x124e62){return{'name':_0x124e62[_0xedb7('0x2e')],'type':_0x124e62[_0xedb7('0x2f')][_0xedb7('0x30')]};});_0x515ab1[_0xedb7('0x31')]=_['map'](_0x2c5cfe,_0xedb7('0x29'));_0x515ab1['query']=_[_0xedb7('0x32')](_0x55fe73['query']);_0x515ab1[_0xedb7('0x33')]=_['intersection'](_0x515ab1[_0xedb7('0x31')],_0x515ab1[_0xedb7('0x34')]);_0x31bebf[_0xedb7('0x35')]=_['intersection'](_0x515ab1['model'],qs[_0xedb7('0x36')](_0x55fe73[_0xedb7('0x34')][_0xedb7('0x36')]));_0x31bebf['attributes']=_0x31bebf[_0xedb7('0x35')]['length']?_0x31bebf[_0xedb7('0x35')]:_0x515ab1[_0xedb7('0x31')];if(!_0x55fe73[_0xedb7('0x34')][_0xedb7('0x37')](_0xedb7('0x38'))){_0x31bebf[_0xedb7('0x20')]=qs['limit'](_0x55fe73[_0xedb7('0x34')][_0xedb7('0x20')]);_0x31bebf['offset']=qs[_0xedb7('0x22')](_0x55fe73[_0xedb7('0x34')][_0xedb7('0x22')]);}_0x31bebf[_0xedb7('0x39')]=qs[_0xedb7('0x3a')](_0x55fe73[_0xedb7('0x34')][_0xedb7('0x3a')]);_0x31bebf[_0xedb7('0x3b')]=qs[_0xedb7('0x33')](_[_0xedb7('0x3c')](_0x55fe73[_0xedb7('0x34')],_0x515ab1[_0xedb7('0x33')]),_0x2c5cfe);if(_0x55fe73[_0xedb7('0x34')][_0xedb7('0x3d')]){_0x31bebf['where']=_[_0xedb7('0x3e')](_0x31bebf[_0xedb7('0x3b')],{'$or':_[_0xedb7('0x2c')](_0x2c5cfe,function(_0x1303be){if(_0x1303be['type']!==_0xedb7('0x3f')){var _0xc5a766={};_0xc5a766[_0x1303be[_0xedb7('0x29')]]={'$like':'%'+_0x55fe73[_0xedb7('0x34')]['filter']+'%'};return _0xc5a766;}})});}_0x31bebf=_[_0xedb7('0x3e')]({},_0x31bebf,_0x55fe73[_0xedb7('0x40')]);var _0x2f323a={'where':_0x31bebf[_0xedb7('0x3b')]};return db['WhatsappApplication'][_0xedb7('0x21')](_0x2f323a)[_0xedb7('0x27')](function(_0x11076d){_0x43975e[_0xedb7('0x21')]=_0x11076d;if(_0x55fe73[_0xedb7('0x34')][_0xedb7('0x41')]){_0x31bebf[_0xedb7('0x42')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xedb7('0x43')](_0x31bebf);})['then'](function(_0x8eb7a1){_0x43975e[_0xedb7('0x44')]=_0x8eb7a1;return _0x43975e;})[_0xedb7('0x27')](respondWithFilteredResult(_0x4896a5,_0x31bebf))['catch'](handleError(_0x4896a5,null));};exports[_0xedb7('0x45')]=function(_0x2c8d69,_0x3a5da3){var _0x37a81e={'raw':!![],'where':{'id':_0x2c8d69['params']['id']}},_0x2ff566={};_0x2ff566['model']=_[_0xedb7('0x32')](db[_0xedb7('0x46')][_0xedb7('0x2d')]);_0x2ff566[_0xedb7('0x34')]=_[_0xedb7('0x32')](_0x2c8d69[_0xedb7('0x34')]);_0x2ff566[_0xedb7('0x33')]=_[_0xedb7('0x47')](_0x2ff566[_0xedb7('0x31')],_0x2ff566[_0xedb7('0x34')]);_0x37a81e[_0xedb7('0x35')]=_[_0xedb7('0x47')](_0x2ff566[_0xedb7('0x31')],qs[_0xedb7('0x36')](_0x2c8d69['query'][_0xedb7('0x36')]));_0x37a81e['attributes']=_0x37a81e[_0xedb7('0x35')][_0xedb7('0x48')]?_0x37a81e[_0xedb7('0x35')]:_0x2ff566[_0xedb7('0x31')];if(_0x2c8d69[_0xedb7('0x34')][_0xedb7('0x41')]){_0x37a81e[_0xedb7('0x42')]=[{'all':!![]}];}_0x37a81e=_[_0xedb7('0x3e')]({},_0x37a81e,_0x2c8d69[_0xedb7('0x40')]);return db[_0xedb7('0x46')][_0xedb7('0x49')](_0x37a81e)[_0xedb7('0x27')](handleEntityNotFound(_0x3a5da3,null))[_0xedb7('0x27')](respondWithResult(_0x3a5da3,null))[_0xedb7('0x4a')](handleError(_0x3a5da3,null));};exports[_0xedb7('0x4b')]=function(_0x1f21cf,_0x5c5f00){return db[_0xedb7('0x46')][_0xedb7('0x4b')](_0x1f21cf[_0xedb7('0x4c')],{})[_0xedb7('0x27')](respondWithResult(_0x5c5f00,0xc9))[_0xedb7('0x4a')](handleError(_0x5c5f00,null));};exports[_0xedb7('0x4d')]=function(_0x163823,_0x10dd4d){if(_0x163823[_0xedb7('0x4c')]['id']){delete _0x163823[_0xedb7('0x4c')]['id'];}return db[_0xedb7('0x46')][_0xedb7('0x49')]({'where':{'id':_0x163823[_0xedb7('0x4e')]['id']}})[_0xedb7('0x27')](handleEntityNotFound(_0x10dd4d,null))[_0xedb7('0x27')](saveUpdates(_0x163823[_0xedb7('0x4c')],null))[_0xedb7('0x27')](respondWithResult(_0x10dd4d,null))[_0xedb7('0x4a')](handleError(_0x10dd4d,null));};exports['destroy']=function(_0x4fe02c,_0x353e56){return db[_0xedb7('0x46')][_0xedb7('0x49')]({'where':{'id':_0x4fe02c[_0xedb7('0x4e')]['id']}})[_0xedb7('0x27')](handleEntityNotFound(_0x353e56,null))[_0xedb7('0x27')](removeEntity(_0x353e56,null))['catch'](handleError(_0x353e56,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 6929e5f..8c92d59 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 _0xb38e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0xb38e,0xa7));var _0xeb38=function(_0x6730d8,_0x21f797){_0x6730d8=_0x6730d8-0x0;var _0x3876b4=_0xb38e[_0x6730d8];return _0x3876b4;};'use strict';var _=require(_0xeb38('0x0'));var util=require(_0xeb38('0x1'));var logger=require(_0xeb38('0x2'))(_0xeb38('0x3'));var moment=require(_0xeb38('0x4'));var BPromise=require(_0xeb38('0x5'));var rp=require(_0xeb38('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb38('0x7'));var config=require(_0xeb38('0x8'));var attributes=require('./whatsappApplication.attributes');module[_0xeb38('0x9')]=function(_0xd3e5dc,_0x28e501){return _0xd3e5dc[_0xeb38('0xa')]('WhatsappApplication',attributes,{'tableName':_0xeb38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeb38('0xc'),'collate':_0xeb38('0xd')});}; \ No newline at end of file +var _0xe9e8=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x16b300,_0x6820ed){var _0x553756=function(_0x3ce06b){while(--_0x3ce06b){_0x16b300['push'](_0x16b300['shift']());}};_0x553756(++_0x6820ed);}(_0xe9e8,0x179));var _0x8e9e=function(_0x130eaa,_0x263ee3){_0x130eaa=_0x130eaa-0x0;var _0x42ac52=_0xe9e8[_0x130eaa];return _0x42ac52;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var logger=require(_0x8e9e('0x2'))(_0x8e9e('0x3'));var moment=require(_0x8e9e('0x4'));var BPromise=require(_0x8e9e('0x5'));var rp=require(_0x8e9e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e9e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e9e('0x8'));module[_0x8e9e('0x9')]=function(_0x3b5e8d,_0x5de00e){return _0x3b5e8d['define'](_0x8e9e('0xa'),attributes,{'tableName':_0x8e9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8e9e('0xc'),'collate':_0x8e9e('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 389f42a..711784e 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 _0xd2ea=['../../config/environment','jayson/promise','client','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x34cdb7,_0x1e1a50){var _0x4052c5=function(_0x4fc59a){while(--_0x4fc59a){_0x34cdb7['push'](_0x34cdb7['shift']());}};_0x4052c5(++_0x1e1a50);}(_0xd2ea,0x15f));var _0xad2e=function(_0x119685,_0x497c6e){_0x119685=_0x119685-0x0;var _0x2a0c0a=_0xd2ea[_0x119685];return _0x2a0c0a;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5170,_0x3e3d1f,_0x2ff7b2){return new BPromise(function(_0x5710ac,_0x1e0e9e){return client[_0xad2e('0xc')](_0x3b5170,_0x2ff7b2)['then'](function(_0x1eed2f){logger['info'](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));logger[_0xad2e('0xf')](_0xad2e('0x10'),_0x3e3d1f,'request\x20sent',JSON[_0xad2e('0x11')](_0x1eed2f));if(_0x1eed2f['error']){if(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x13')]===0x1f4){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0x1eed2f['error'][_0xad2e('0x14')]);return _0x1e0e9e(_0x1eed2f['error'][_0xad2e('0x14')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x3e3d1f,_0x1eed2f['error']['message']);return _0x5710ac(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x14')]);}else{logger[_0xad2e('0x15')](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));_0x5710ac(_0x1eed2f[_0xad2e('0x16')][_0xad2e('0x14')]);}})[_0xad2e('0x17')](function(_0xd40b31){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0xd40b31);_0x1e0e9e(_0xd40b31);});});} \ No newline at end of file +var _0x99e9=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x292911,_0x279a2e){var _0x18dee9=function(_0x43ccf8){while(--_0x43ccf8){_0x292911['push'](_0x292911['shift']());}};_0x18dee9(++_0x279a2e);}(_0x99e9,0xb4));var _0x999e=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0x99e9[_0xdbd4f7];return _0x5c3f9d;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 562346f..ef6dfb6 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 _0x1883=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','whatsappinteraction:addtags','tracked','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags'];(function(_0x1d10f3,_0x3d180c){var _0x35b2a0=function(_0x321941){while(--_0x321941){_0x1d10f3['push'](_0x1d10f3['shift']());}};_0x35b2a0(++_0x3d180c);}(_0x1883,0xab));var _0x3188=function(_0x2e21ea,_0x2dc9a8){_0x2e21ea=_0x2e21ea-0x0;var _0x278f59=_0x1883[_0x2e21ea];return _0x278f59;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var fs_extra=require(_0x3188('0x6'));var auth=require(_0x3188('0x7'));var interaction=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var controller=require(_0x3188('0xa'));router[_0x3188('0xb')]('/',auth[_0x3188('0xc')](),controller[_0x3188('0xd')]);router[_0x3188('0xb')](_0x3188('0xe'),auth[_0x3188('0xc')](),controller['describe']);router[_0x3188('0xb')](_0x3188('0xf'),auth['isAuthenticated'](),controller[_0x3188('0x10')]);router['get'](_0x3188('0x11'),auth[_0x3188('0xc')](),controller[_0x3188('0x12')]);router[_0x3188('0xb')]('/:id/download',auth[_0x3188('0xc')](),controller[_0x3188('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3188('0x14')]);router[_0x3188('0x15')](_0x3188('0x11'),auth[_0x3188('0xc')](),controller[_0x3188('0x16')]);router[_0x3188('0x15')]('/:id/tags',auth[_0x3188('0xc')](),interaction['tracked']('whatsapp',_0x3188('0x17')),controller['addTags']);router['put'](_0x3188('0xf'),auth[_0x3188('0xc')](),interaction[_0x3188('0x18')](_0x3188('0x19'),_0x3188('0x1a')),controller[_0x3188('0x1b')]);router['delete'](_0x3188('0xf'),auth[_0x3188('0xc')](),interaction[_0x3188('0x18')](_0x3188('0x19'),_0x3188('0x1c')),controller[_0x3188('0x1d')]);router[_0x3188('0x1e')](_0x3188('0x1f'),auth['isAuthenticated'](),controller[_0x3188('0x20')]);module[_0x3188('0x21')]=router; \ No newline at end of file +var _0x7217=['/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsappinteraction:addtags','addTags','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x9151f,_0x2aea60){var _0x1e9291=function(_0x2d50a6){while(--_0x2d50a6){_0x9151f['push'](_0x9151f['shift']());}};_0x1e9291(++_0x2aea60);}(_0x7217,0x19e));var _0x7721=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7217[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x13')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0x14')]);router['post'](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addMessage']);router[_0x7721('0x13')](_0x7721('0x15'),auth[_0x7721('0x9')](),interaction[_0x7721('0x16')]('whatsapp',_0x7721('0x17')),controller[_0x7721('0x18')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x7721('0x16')](_0x7721('0x19'),_0x7721('0x1a')),controller[_0x7721('0x1b')]);router['delete'](_0x7721('0xd'),auth['isAuthenticated'](),interaction[_0x7721('0x16')]('whatsapp',_0x7721('0x1c')),controller[_0x7721('0x1d')]);router[_0x7721('0x1e')](_0x7721('0x15'),auth[_0x7721('0x9')](),controller[_0x7721('0x1f')]);module[_0x7721('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 2537eb0..827bbf4 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 _0xbca0=['DATE','sequelize','moment','STRING','ENUM','out'];(function(_0x53db0d,_0x35e36b){var _0x2834c2=function(_0x434419){while(--_0x434419){_0x53db0d['push'](_0x53db0d['shift']());}};_0x2834c2(++_0x35e36b);}(_0xbca0,0x8b));var _0x0bca=function(_0x35be23,_0x32576b){_0x35be23=_0x35be23-0x0;var _0x30ad0e=_0xbca0[_0x35be23];return _0x30ad0e;};'use strict';var Sequelize=require(_0x0bca('0x0'));var moment=require(_0x0bca('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0bca('0x2')]},'secondDisposition':{'type':Sequelize[_0x0bca('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0bca('0x2')]},'note':{'type':Sequelize[_0x0bca('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0bca('0x3')]('in',_0x0bca('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0bca('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x0bca('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8710=['sequelize','moment','BOOLEAN','DATE','STRING','out','ENUM','INTEGER'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8710,0x68));var _0x0871=function(_0x35a944,_0x464413){_0x35a944=_0x35a944-0x0;var _0x55203a=_0x8710[_0x35a944];return _0x55203a;};'use strict';var Sequelize=require(_0x0871('0x0'));var moment=require(_0x0871('0x1'));module['exports']={'closed':{'type':Sequelize[_0x0871('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0871('0x3')]},'disposition':{'type':Sequelize[_0x0871('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0871('0x4')]},'note':{'type':Sequelize[_0x0871('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0871('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0871('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0871('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0871('0x6')]('in',_0x0871('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0871('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0871('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 09531cb..a11b5b3 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 _0x143a=['omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','spread','Tag','emit','removeTags','download','toString','join','server','tmp','root','files','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','Whatsapp','N.A.','closed','closedAt','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','sendStatus','rimraf','zip-dir','moment','bluebird','util','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','json','undefined','limit','count','offset','Content-Range','update','then','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','key','getOptions','findAll','catch','params','keys','query','filters','intersection','model','fields','length','attributes','include','options','find','create','body','describe','WhatsappMessage','addMessage','ids'];(function(_0x4ca9fd,_0x5014ab){var _0xe0eab1=function(_0x41822a){while(--_0x41822a){_0x4ca9fd['push'](_0x4ca9fd['shift']());}};_0xe0eab1(++_0x5014ab);}(_0x143a,0x1b9));var _0xa143=function(_0x5e690e,_0x19dc64){_0x5e690e=_0x5e690e-0x0;var _0x45cbcc=_0x143a[_0x5e690e];return _0x45cbcc;};'use strict';var rimraf=require(_0xa143('0x0'));var zipdir=require(_0xa143('0x1'));var moment=require(_0xa143('0x2'));var BPromise=require(_0xa143('0x3'));var util=require(_0xa143('0x4'));var path=require('path');var ejs=require(_0xa143('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa143('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xa143('0x7'));var pdf=require(_0xa143('0x8'));var logger=require(_0xa143('0x9'))(_0xa143('0xa'));var config=require(_0xa143('0xb'));var db=require(_0xa143('0xc'))['db'];config[_0xa143('0xd')]=_[_0xa143('0xe')](config[_0xa143('0xd')],{'host':_0xa143('0xf'),'port':0x18eb});var socket=require(_0xa143('0x10'))(new Redis(config[_0xa143('0xd')]));require('./whatsappInteraction.socket')[_0xa143('0x11')](socket);function respondWithStatusCode(_0x3c4ac2,_0x1f8d43){_0x1f8d43=_0x1f8d43||0xcc;return function(_0x2c1e38){if(_0x2c1e38){return _0x3c4ac2['sendStatus'](_0x1f8d43);}return _0x3c4ac2['status'](_0x1f8d43)[_0xa143('0x12')]();};}function respondWithResult(_0x3b4e23,_0x2716c6){_0x2716c6=_0x2716c6||0xc8;return function(_0x110aaf){if(_0x110aaf){return _0x3b4e23[_0xa143('0x13')](_0x2716c6)[_0xa143('0x14')](_0x110aaf);}};}function respondWithFilteredResult(_0x226303,_0x9436a8){return function(_0x2ba927){if(_0x2ba927){var _0x2ef821=typeof _0x9436a8['offset']===_0xa143('0x15')&&typeof _0x9436a8[_0xa143('0x16')]===_0xa143('0x15');var _0x26a649=_0x2ba927[_0xa143('0x17')];var _0x47d554=_0x2ef821?0x0:_0x9436a8[_0xa143('0x18')];var _0x3f2771=_0x2ef821?_0x2ba927[_0xa143('0x17')]:_0x9436a8['offset']+_0x9436a8['limit'];var _0x2c44f2;if(_0x3f2771>=_0x26a649){_0x3f2771=_0x26a649;_0x2c44f2=0xc8;}else{_0x2c44f2=0xce;}_0x226303[_0xa143('0x13')](_0x2c44f2);return _0x226303['set'](_0xa143('0x19'),_0x47d554+'-'+_0x3f2771+'/'+_0x26a649)[_0xa143('0x14')](_0x2ba927);}return null;};}function saveUpdates(_0x58343c){return function(_0x5253e6){if(_0x5253e6){return _0x5253e6[_0xa143('0x1a')](_0x58343c)[_0xa143('0x1b')](function(_0xae3471){return _0xae3471;});}return null;};}function removeEntity(_0x4882c9){return function(_0x3d6453){if(_0x3d6453){return _0x3d6453['destroy']()[_0xa143('0x1b')](function(){_0x4882c9[_0xa143('0x13')](0xcc)[_0xa143('0x12')]();});}};}function handleEntityNotFound(_0xedb252){return function(_0x477e4d){if(!_0x477e4d){_0xedb252['sendStatus'](0x194);}return _0x477e4d;};}function handleError(_0x3170b2,_0x3a1998){_0x3a1998=_0x3a1998||0x1f4;return function(_0x51eb32){logger[_0xa143('0x1c')](_0x51eb32[_0xa143('0x1d')]);if(_0x51eb32['name']){delete _0x51eb32[_0xa143('0x1e')];}_0x3170b2[_0xa143('0x13')](_0x3a1998)[_0xa143('0x1f')](_0x51eb32);};}exports[_0xa143('0x20')]=function(_0x474000,_0x2509e7){var _0x26b7f1={};var _0x10def0=_[_0xa143('0x21')](db[_0xa143('0x22')][_0xa143('0x23')],function(_0x5f4bca){return{'name':_0x5f4bca[_0xa143('0x24')],'type':_0x5f4bca['type'][_0xa143('0x25')]};});_0x26b7f1=qs[_0xa143('0x26')](_0x10def0,_0x474000);return interaction[_0xa143('0x27')]('whatsapp',_0x474000['query'],_0x474000['user'],_0x26b7f1,_0x10def0)['then'](respondWithFilteredResult(_0x2509e7,_0x26b7f1))[_0xa143('0x28')](handleError(_0x2509e7,null));};exports['show']=function(_0x3a7bbe,_0x324402){var _0xb6144c={'raw':![],'where':{'id':_0x3a7bbe[_0xa143('0x29')]['id']}},_0x4494b1={};_0x4494b1['model']=_[_0xa143('0x2a')](db[_0xa143('0x22')]['rawAttributes']);_0x4494b1['query']=_['keys'](_0x3a7bbe[_0xa143('0x2b')]);_0x4494b1[_0xa143('0x2c')]=_[_0xa143('0x2d')](_0x4494b1[_0xa143('0x2e')],_0x4494b1[_0xa143('0x2b')]);_0xb6144c['attributes']=_[_0xa143('0x2d')](_0x4494b1[_0xa143('0x2e')],qs[_0xa143('0x2f')](_0x3a7bbe[_0xa143('0x2b')][_0xa143('0x2f')]));_0xb6144c['attributes']=_0xb6144c['attributes'][_0xa143('0x30')]?_0xb6144c[_0xa143('0x31')]:_0x4494b1[_0xa143('0x2e')];if(_0x3a7bbe[_0xa143('0x2b')]['includeAll']){_0xb6144c[_0xa143('0x32')]=[{'all':!![]}];}_0xb6144c=_['merge']({},_0xb6144c,_0x3a7bbe[_0xa143('0x33')]);return db[_0xa143('0x22')][_0xa143('0x34')](_0xb6144c)[_0xa143('0x1b')](handleEntityNotFound(_0x324402,null))[_0xa143('0x1b')](respondWithResult(_0x324402,null))[_0xa143('0x28')](handleError(_0x324402,null));};exports['create']=function(_0x4d3b0d,_0x4ba617){return db['WhatsappInteraction'][_0xa143('0x35')](_0x4d3b0d[_0xa143('0x36')],{})[_0xa143('0x1b')](respondWithResult(_0x4ba617,0xc9))[_0xa143('0x28')](handleError(_0x4ba617,null));};exports[_0xa143('0x1a')]=function(_0x4388ba,_0x13b18e){if(_0x4388ba[_0xa143('0x36')]['id']){delete _0x4388ba[_0xa143('0x36')]['id'];}return db['WhatsappInteraction'][_0xa143('0x34')]({'where':{'id':_0x4388ba['params']['id']}})[_0xa143('0x1b')](handleEntityNotFound(_0x13b18e,null))[_0xa143('0x1b')](saveUpdates(_0x4388ba[_0xa143('0x36')],null))[_0xa143('0x1b')](respondWithResult(_0x13b18e,null))[_0xa143('0x28')](handleError(_0x13b18e,null));};exports['destroy']=function(_0x47028f,_0x344f22){return db[_0xa143('0x22')][_0xa143('0x34')]({'where':{'id':_0x47028f[_0xa143('0x29')]['id']}})[_0xa143('0x1b')](handleEntityNotFound(_0x344f22,null))['then'](removeEntity(_0x344f22,null))[_0xa143('0x28')](handleError(_0x344f22,null));};exports['describe']=function(_0x286655,_0x310b02){return db[_0xa143('0x22')][_0xa143('0x37')]()['then'](respondWithResult(_0x310b02,null))[_0xa143('0x28')](handleError(_0x310b02,null));};exports['addMessage']=function(_0x8a24c5,_0x37178b){return db[_0xa143('0x38')][_0xa143('0x34')]({'where':{'id':_0x8a24c5['params']['id']}})[_0xa143('0x1b')](handleEntityNotFound(_0x37178b,null))['then'](function(_0x5218e5){if(_0x5218e5){return _0x5218e5[_0xa143('0x39')](_0x8a24c5[_0xa143('0x36')][_0xa143('0x3a')],_[_0xa143('0x3b')](_0x8a24c5[_0xa143('0x36')],['ids','id'])||{});}})[_0xa143('0x1b')](respondWithResult(_0x37178b,null))[_0xa143('0x28')](handleError(_0x37178b,null));};exports[_0xa143('0x3c')]=function(_0x4bd5ed,_0x23d51b){var _0x4e5901={'raw':![],'where':{}};var _0x1f0bd9={};var _0x23e732={'count':0x0,'rows':[]};return db[_0xa143('0x22')][_0xa143('0x3d')]({'where':{'id':_0x4bd5ed[_0xa143('0x29')]['id']}})[_0xa143('0x1b')](handleEntityNotFound(_0x23d51b,null))['then'](function(_0x225aac){if(_0x225aac){_0x1f0bd9[_0xa143('0x2e')]=_[_0xa143('0x2a')](db['WhatsappMessage'][_0xa143('0x23')]);_0x1f0bd9['query']=_[_0xa143('0x2a')](_0x4bd5ed[_0xa143('0x2b')]);_0x1f0bd9[_0xa143('0x2c')]=_[_0xa143('0x2d')](_0x1f0bd9[_0xa143('0x2e')],_0x1f0bd9['query']);_0x4e5901[_0xa143('0x31')]=_['intersection'](_0x1f0bd9[_0xa143('0x2e')],qs['fields'](_0x4bd5ed[_0xa143('0x2b')][_0xa143('0x2f')]));_0x4e5901[_0xa143('0x31')]=_0x4e5901[_0xa143('0x31')][_0xa143('0x30')]?_0x4e5901['attributes']:_0x1f0bd9[_0xa143('0x2e')];if(!_0x4bd5ed[_0xa143('0x2b')][_0xa143('0x3e')](_0xa143('0x3f'))){_0x4e5901[_0xa143('0x16')]=qs[_0xa143('0x16')](_0x4bd5ed['query'][_0xa143('0x16')]);_0x4e5901['offset']=qs[_0xa143('0x18')](_0x4bd5ed[_0xa143('0x2b')][_0xa143('0x18')]);}_0x4e5901[_0xa143('0x40')]=qs['sort'](_0x4bd5ed[_0xa143('0x2b')][_0xa143('0x41')]);_0x4e5901[_0xa143('0x42')]=qs[_0xa143('0x2c')](_[_0xa143('0x43')](_0x4bd5ed['query'],_0x1f0bd9['filters']));_0x4e5901[_0xa143('0x42')]['WhatsappInteractionId']=_0x225aac['id'];if(_0x4bd5ed[_0xa143('0x2b')][_0xa143('0x44')]){_0x4e5901['where']=_[_0xa143('0x45')](_0x4e5901['where'],{'$or':_[_0xa143('0x21')](_0x4e5901[_0xa143('0x31')],function(_0x36b84e){var _0x39db9a={};_0x39db9a[_0x36b84e]={'$like':'%'+_0x4bd5ed[_0xa143('0x2b')][_0xa143('0x44')]+'%'};return _0x39db9a;})});}if(_0x4bd5ed['query'][_0xa143('0x46')]){var _0x472305=_0x4bd5ed['query'][_0xa143('0x46')][_0xa143('0x47')](',');var _0x14927b={};_0x14927b[_0x472305[0x0]]={'$gte':moment(_0x472305[0x1])[_0xa143('0x48')](_0xa143('0x49'))};_0x4e5901[_0xa143('0x42')]=_[_0xa143('0x45')](_0x4e5901[_0xa143('0x42')],_0x14927b);}_0x4e5901=_['merge']({},_0x4e5901,_0x4bd5ed[_0xa143('0x33')]);return db[_0xa143('0x38')][_0xa143('0x17')]({'where':_0x4e5901[_0xa143('0x42')]})['then'](function(_0x43f5ca){_0x23e732[_0xa143('0x17')]=_0x43f5ca;if(_0x4bd5ed[_0xa143('0x2b')][_0xa143('0x4a')]){_0x4e5901[_0xa143('0x32')]=[{'all':!![]}];}return db[_0xa143('0x38')]['findAll'](_0x4e5901);})[_0xa143('0x1b')](function(_0x4fa214){_0x23e732[_0xa143('0x4b')]=_0x4fa214;return _0x23e732;});}})[_0xa143('0x1b')](respondWithFilteredResult(_0x23d51b,_0x4e5901))[_0xa143('0x28')](handleError(_0x23d51b,null));};exports[_0xa143('0x4c')]=function(_0x59b2ea,_0x41eb1b){return db[_0xa143('0x22')][_0xa143('0x34')]({'where':{'id':_0x59b2ea[_0xa143('0x29')]['id']}})['then'](handleEntityNotFound(_0x41eb1b,null))[_0xa143('0x1b')](function(_0xa2610d){if(_0xa2610d){return _0xa2610d['setTags'](_0x59b2ea[_0xa143('0x36')][_0xa143('0x3a')],_[_0xa143('0x3b')](_0x59b2ea[_0xa143('0x36')],[_0xa143('0x3a'),'id'])||{})[_0xa143('0x4d')](function(){return db[_0xa143('0x4e')][_0xa143('0x27')]({'attributes':['id',_0xa143('0x1e'),'color'],'where':{'id':_0x59b2ea[_0xa143('0x36')][_0xa143('0x3a')]}});})[_0xa143('0x1b')](function(_0xe16782){socket[_0xa143('0x4f')]('whatsappInteractionTags:save',{'id':Number(_0x59b2ea[_0xa143('0x29')]['id']),'tags':_0xe16782||[]});return{'id':Number(_0x59b2ea[_0xa143('0x29')]['id']),'tags':_0xe16782||[]};});}})[_0xa143('0x1b')](respondWithResult(_0x41eb1b,null))[_0xa143('0x28')](handleError(_0x41eb1b,null));};exports[_0xa143('0x50')]=function(_0x34b61c,_0x17771b){return db[_0xa143('0x22')][_0xa143('0x34')]({'where':{'id':_0x34b61c[_0xa143('0x29')]['id']}})['then'](handleEntityNotFound(_0x17771b,null))[_0xa143('0x1b')](function(_0x13a6a5){if(_0x13a6a5){return _0x13a6a5['removeTags'](_0x34b61c[_0xa143('0x2b')][_0xa143('0x3a')]);}})[_0xa143('0x1b')](respondWithStatusCode(_0x17771b,null))[_0xa143('0x28')](handleError(_0x17771b,null));};exports[_0xa143('0x51')]=function(_0x5d3b00,_0x354191){var _0x1b8119=moment()['unix']()[_0xa143('0x52')]();var _0x348e67=path[_0xa143('0x53')](config['root'],_0xa143('0x54'),'files',_0xa143('0x55'));var _0x12dd6c=path[_0xa143('0x53')](config[_0xa143('0x56')],_0xa143('0x54'),_0xa143('0x57'),'attachments');var _0x199b23=path[_0xa143('0x53')](_0x348e67,_0x1b8119);var _0x5d48f0=util[_0xa143('0x48')](_0xa143('0x58'),_0x5d3b00[_0xa143('0x29')]['id'],_0x1b8119);var _0x117028=path[_0xa143('0x53')](_0x348e67,_0x5d48f0);var _0x3b9182=[];_0x3b9182['push']({'model':db[_0xa143('0x59')],'as':_0xa143('0x59'),'attributes':['id',_0xa143('0x5a')],'raw':!![]});_0x3b9182[_0xa143('0x5b')]({'model':db[_0xa143('0x5c')],'as':_0xa143('0x5d'),'attributes':['id','firstName',_0xa143('0x5e')],'raw':!![]});if(_0x5d3b00[_0xa143('0x2b')]['attachments']){_0x3b9182[_0xa143('0x5b')]({'model':db[_0xa143('0x5f')],'as':'Attachment','raw':!![]});}var _0x2d4e91=[{'model':db[_0xa143('0x38')],'as':_0xa143('0x60'),'attributes':['id',_0xa143('0x36'),_0xa143('0x61'),_0xa143('0x62'),_0xa143('0x63'),_0xa143('0x64')],'include':_0x3b9182}];_0x2d4e91[_0xa143('0x5b')]({'model':db[_0xa143('0x65')],'as':_0xa143('0x66'),'attributes':['id','name']});_0x2d4e91['push']({'model':db[_0xa143('0x59')],'as':_0xa143('0x67'),'attributes':['id',_0xa143('0x5a')]});return db[_0xa143('0x22')][_0xa143('0x34')]({'where':{'id':_0x5d3b00[_0xa143('0x29')]['id']},'include':_0x2d4e91})[_0xa143('0x1b')](handleEntityNotFound(_0x354191,null))[_0xa143('0x1b')](function(_0x3eb9cf){if(_0x3eb9cf){var _0x574563=_0x3eb9cf['get']({'plain':!![]});fs['mkdirSync'](_0x199b23);var _0x3b0fa4={'channel':_0xa143('0x68'),'account':_0x574563[_0xa143('0x66')][_0xa143('0x1e')],'agent':_0x574563[_0xa143('0x67')]?_0x574563[_0xa143('0x67')][_0xa143('0x5a')]:_0xa143('0x69'),'createdAt':moment(_0x574563['createdAt'])['format'](_0xa143('0x49'))[_0xa143('0x52')](),'closedAt':_0x574563[_0xa143('0x6a')]?moment(_0x574563[_0xa143('0x6b')])[_0xa143('0x48')](_0xa143('0x49'))[_0xa143('0x52')]():'','disposition':_0x574563['disposition'],'messages':_(_0x574563[_0xa143('0x60')])['filter']({'secret':![]})[_0xa143('0x21')](function(_0x5d08fd){if(_0x5d08fd[_0xa143('0x5f')]){var _0x505abb=path[_0xa143('0x53')](_0x12dd6c,_0x5d08fd[_0xa143('0x5f')][_0xa143('0x6c')]);if(fs[_0xa143('0x6d')](_0x505abb)){fs[_0xa143('0x6e')](_0x505abb)[_0xa143('0x6f')](fs[_0xa143('0x70')](path[_0xa143('0x53')](_0x199b23,_0x5d08fd[_0xa143('0x5f')]['basename'])));}}return{'date':moment(_0x5d08fd['createdAt'])[_0xa143('0x48')](_0xa143('0x49'))['toString'](),'sender':_0x5d08fd[_0xa143('0x62')]===_0xa143('0x71')?_0x5d08fd[_0xa143('0x59')]?_0x5d08fd[_0xa143('0x59')][_0xa143('0x5a')]:_0xa143('0x72'):_0x5d08fd['Contact']['firstName']+(_0x5d08fd[_0xa143('0x5d')][_0xa143('0x5e')]?'\x20'+_0x5d08fd[_0xa143('0x5d')][_0xa143('0x5e')]:''),'body':_0x5d08fd['Attachment']?_0x5d08fd[_0xa143('0x5f')][_0xa143('0x6c')]:_0x5d08fd['body'],'direction':_0x5d08fd[_0xa143('0x62')]===_0xa143('0x71')?'A':'C','secret':_0x5d08fd[_0xa143('0x63')],'read':_0x5d08fd['read'],'attachment':_0x5d08fd[_0xa143('0x5f')]};})['value']()};return ejs[_0xa143('0x73')](path[_0xa143('0x53')](config[_0xa143('0x56')],_0xa143('0x54'),_0xa143('0x74'),_0xa143('0x75')),{'interaction':_0x3b0fa4})['then'](function(_0x1b8c4a){var _0x5e8fb8=path[_0xa143('0x53')](_0x199b23,_0xa143('0x76')+_0x574563['id']+'-'+_0x1b8119+_0xa143('0x77'));var _0x251b43={'path':_0x5e8fb8,'channel':_0xa143('0x68'),'interactionId':_0x574563['id']};return pdf[_0xa143('0x78')](_0x1b8c4a,_0x251b43);})[_0xa143('0x1b')](function(){return new BPromise(function(_0x83f471,_0xd82480){zipdir(_0x199b23,{'saveTo':_0x117028},function(_0x54a42f,_0x4ea697){if(_0x54a42f)return _0xd82480(_0x54a42f);return _0x83f471(_0x4ea697);});})[_0xa143('0x1b')](function(){return new BPromise(function(_0x4d7661,_0x375a6a){rimraf(_0x199b23,function(_0x3ad597){if(_0x3ad597)_0x375a6a(_0x3ad597);return _0x4d7661();});});})[_0xa143('0x1b')](function(){return _0x354191[_0xa143('0x51')](_0x117028,_0x5d48f0,function(_0xd1445){if(_0xd1445){console[_0xa143('0x79')](_0xa143('0x7a'),_0xd1445);}else{fs[_0xa143('0x7b')](_0x117028);}});});});}else{return _0x354191[_0xa143('0x7c')](0xc8);}})[_0xa143('0x28')](handleError(_0x354191,null));}; \ No newline at end of file +var _0x3d7e=['toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','attachments','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','fullname','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','out','lastName','secret','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','zip-dir','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','Content-Range','destroy','then','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','catch','show','params','keys','filters','intersection','model','fields','length','attributes','includeAll','include','options','find','create','body','update','describe','addMessage','omit','getMessages','findOne','WhatsappMessage','hasOwnProperty','order','sort','where','pick','WhatsappInteractionId','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','rows','ids','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix'];(function(_0x82af4f,_0x3d0cb4){var _0x5c5a62=function(_0x216a8b){while(--_0x216a8b){_0x82af4f['push'](_0x82af4f['shift']());}};_0x5c5a62(++_0x3d0cb4);}(_0x3d7e,0x133));var _0xe3d7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3d7e[_0x432682];return _0x463d05;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xe3d7('0x0'));var moment=require('moment');var BPromise=require(_0xe3d7('0x1'));var util=require(_0xe3d7('0x2'));var path=require(_0xe3d7('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe3d7('0x4'));var Redis=require(_0xe3d7('0x5'));var interaction=require(_0xe3d7('0x6'));var qs=require(_0xe3d7('0x7'));var pdf=require(_0xe3d7('0x8'));var logger=require(_0xe3d7('0x9'))(_0xe3d7('0xa'));var config=require(_0xe3d7('0xb'));var db=require(_0xe3d7('0xc'))['db'];config[_0xe3d7('0xd')]=_[_0xe3d7('0xe')](config['redis'],{'host':_0xe3d7('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3d7('0xd')]));require(_0xe3d7('0x10'))[_0xe3d7('0x11')](socket);function respondWithStatusCode(_0x28100c,_0x166b79){_0x166b79=_0x166b79||0xcc;return function(_0x45495b){if(_0x45495b){return _0x28100c[_0xe3d7('0x12')](_0x166b79);}return _0x28100c[_0xe3d7('0x13')](_0x166b79)[_0xe3d7('0x14')]();};}function respondWithResult(_0x203e85,_0x8217e0){_0x8217e0=_0x8217e0||0xc8;return function(_0x2e5042){if(_0x2e5042){return _0x203e85['status'](_0x8217e0)[_0xe3d7('0x15')](_0x2e5042);}};}function respondWithFilteredResult(_0x518fe3,_0x2a18ef){return function(_0x367588){if(_0x367588){var _0x6ec18c=typeof _0x2a18ef[_0xe3d7('0x16')]==='undefined'&&typeof _0x2a18ef[_0xe3d7('0x17')]===_0xe3d7('0x18');var _0x5cd6d7=_0x367588['count'];var _0x2050f6=_0x6ec18c?0x0:_0x2a18ef[_0xe3d7('0x16')];var _0x1b364f=_0x6ec18c?_0x367588['count']:_0x2a18ef[_0xe3d7('0x16')]+_0x2a18ef[_0xe3d7('0x17')];var _0x15c69a;if(_0x1b364f>=_0x5cd6d7){_0x1b364f=_0x5cd6d7;_0x15c69a=0xc8;}else{_0x15c69a=0xce;}_0x518fe3[_0xe3d7('0x13')](_0x15c69a);return _0x518fe3['set'](_0xe3d7('0x19'),_0x2050f6+'-'+_0x1b364f+'/'+_0x5cd6d7)[_0xe3d7('0x15')](_0x367588);}return null;};}function saveUpdates(_0x17e226){return function(_0x3d7da7){if(_0x3d7da7){return _0x3d7da7['update'](_0x17e226)['then'](function(_0x16aa89){return _0x16aa89;});}return null;};}function removeEntity(_0x11c60d){return function(_0x287888){if(_0x287888){return _0x287888[_0xe3d7('0x1a')]()[_0xe3d7('0x1b')](function(){_0x11c60d[_0xe3d7('0x13')](0xcc)[_0xe3d7('0x14')]();});}};}function handleEntityNotFound(_0x42bb30){return function(_0x438474){if(!_0x438474){_0x42bb30[_0xe3d7('0x12')](0x194);}return _0x438474;};}function handleError(_0x44a518,_0x2ff3c9){_0x2ff3c9=_0x2ff3c9||0x1f4;return function(_0x55d2ec){logger[_0xe3d7('0x1c')](_0x55d2ec[_0xe3d7('0x1d')]);if(_0x55d2ec['name']){delete _0x55d2ec[_0xe3d7('0x1e')];}_0x44a518[_0xe3d7('0x13')](_0x2ff3c9)[_0xe3d7('0x1f')](_0x55d2ec);};}exports[_0xe3d7('0x20')]=function(_0x1a7a29,_0x24210c){var _0x2416cc={};var _0x2aa9d8=_[_0xe3d7('0x21')](db[_0xe3d7('0x22')][_0xe3d7('0x23')],function(_0x41176b){return{'name':_0x41176b[_0xe3d7('0x24')],'type':_0x41176b[_0xe3d7('0x25')][_0xe3d7('0x26')]};});_0x2416cc=qs[_0xe3d7('0x27')](_0x2aa9d8,_0x1a7a29);return interaction[_0xe3d7('0x28')](_0xe3d7('0x29'),_0x1a7a29[_0xe3d7('0x2a')],_0x1a7a29[_0xe3d7('0x2b')],_0x2416cc,_0x2aa9d8)['then'](respondWithFilteredResult(_0x24210c,_0x2416cc))[_0xe3d7('0x2c')](handleError(_0x24210c,null));};exports[_0xe3d7('0x2d')]=function(_0x316ee3,_0x5a24c4){var _0x2d668d={'raw':![],'where':{'id':_0x316ee3[_0xe3d7('0x2e')]['id']}},_0x2b84d3={};_0x2b84d3['model']=_[_0xe3d7('0x2f')](db[_0xe3d7('0x22')][_0xe3d7('0x23')]);_0x2b84d3[_0xe3d7('0x2a')]=_['keys'](_0x316ee3[_0xe3d7('0x2a')]);_0x2b84d3[_0xe3d7('0x30')]=_[_0xe3d7('0x31')](_0x2b84d3[_0xe3d7('0x32')],_0x2b84d3[_0xe3d7('0x2a')]);_0x2d668d['attributes']=_[_0xe3d7('0x31')](_0x2b84d3[_0xe3d7('0x32')],qs[_0xe3d7('0x33')](_0x316ee3[_0xe3d7('0x2a')][_0xe3d7('0x33')]));_0x2d668d['attributes']=_0x2d668d['attributes'][_0xe3d7('0x34')]?_0x2d668d[_0xe3d7('0x35')]:_0x2b84d3[_0xe3d7('0x32')];if(_0x316ee3['query'][_0xe3d7('0x36')]){_0x2d668d[_0xe3d7('0x37')]=[{'all':!![]}];}_0x2d668d=_['merge']({},_0x2d668d,_0x316ee3[_0xe3d7('0x38')]);return db[_0xe3d7('0x22')][_0xe3d7('0x39')](_0x2d668d)[_0xe3d7('0x1b')](handleEntityNotFound(_0x5a24c4,null))[_0xe3d7('0x1b')](respondWithResult(_0x5a24c4,null))[_0xe3d7('0x2c')](handleError(_0x5a24c4,null));};exports[_0xe3d7('0x3a')]=function(_0x1f6581,_0x464c01){return db[_0xe3d7('0x22')][_0xe3d7('0x3a')](_0x1f6581[_0xe3d7('0x3b')],{})['then'](respondWithResult(_0x464c01,0xc9))[_0xe3d7('0x2c')](handleError(_0x464c01,null));};exports[_0xe3d7('0x3c')]=function(_0x48862e,_0x4a568b){if(_0x48862e[_0xe3d7('0x3b')]['id']){delete _0x48862e['body']['id'];}return db[_0xe3d7('0x22')][_0xe3d7('0x39')]({'where':{'id':_0x48862e[_0xe3d7('0x2e')]['id']}})['then'](handleEntityNotFound(_0x4a568b,null))[_0xe3d7('0x1b')](saveUpdates(_0x48862e[_0xe3d7('0x3b')],null))[_0xe3d7('0x1b')](respondWithResult(_0x4a568b,null))[_0xe3d7('0x2c')](handleError(_0x4a568b,null));};exports['destroy']=function(_0x2d3468,_0x39b9f4){return db['WhatsappInteraction'][_0xe3d7('0x39')]({'where':{'id':_0x2d3468['params']['id']}})[_0xe3d7('0x1b')](handleEntityNotFound(_0x39b9f4,null))[_0xe3d7('0x1b')](removeEntity(_0x39b9f4,null))[_0xe3d7('0x2c')](handleError(_0x39b9f4,null));};exports[_0xe3d7('0x3d')]=function(_0x1bd486,_0x3d667b){return db[_0xe3d7('0x22')]['describe']()[_0xe3d7('0x1b')](respondWithResult(_0x3d667b,null))['catch'](handleError(_0x3d667b,null));};exports[_0xe3d7('0x3e')]=function(_0x5273ef,_0x38ca1b){return db['WhatsappMessage'][_0xe3d7('0x39')]({'where':{'id':_0x5273ef[_0xe3d7('0x2e')]['id']}})[_0xe3d7('0x1b')](handleEntityNotFound(_0x38ca1b,null))[_0xe3d7('0x1b')](function(_0x46e8a1){if(_0x46e8a1){return _0x46e8a1[_0xe3d7('0x3e')](_0x5273ef[_0xe3d7('0x3b')]['ids'],_[_0xe3d7('0x3f')](_0x5273ef[_0xe3d7('0x3b')],['ids','id'])||{});}})[_0xe3d7('0x1b')](respondWithResult(_0x38ca1b,null))[_0xe3d7('0x2c')](handleError(_0x38ca1b,null));};exports[_0xe3d7('0x40')]=function(_0x24ece8,_0x50cbbd){var _0x37d2f6={'raw':![],'where':{}};var _0xcd1145={};var _0x21e94f={'count':0x0,'rows':[]};return db[_0xe3d7('0x22')][_0xe3d7('0x41')]({'where':{'id':_0x24ece8['params']['id']}})[_0xe3d7('0x1b')](handleEntityNotFound(_0x50cbbd,null))[_0xe3d7('0x1b')](function(_0x57762c){if(_0x57762c){_0xcd1145[_0xe3d7('0x32')]=_[_0xe3d7('0x2f')](db[_0xe3d7('0x42')][_0xe3d7('0x23')]);_0xcd1145[_0xe3d7('0x2a')]=_[_0xe3d7('0x2f')](_0x24ece8['query']);_0xcd1145[_0xe3d7('0x30')]=_[_0xe3d7('0x31')](_0xcd1145[_0xe3d7('0x32')],_0xcd1145[_0xe3d7('0x2a')]);_0x37d2f6['attributes']=_[_0xe3d7('0x31')](_0xcd1145[_0xe3d7('0x32')],qs['fields'](_0x24ece8[_0xe3d7('0x2a')]['fields']));_0x37d2f6[_0xe3d7('0x35')]=_0x37d2f6[_0xe3d7('0x35')]['length']?_0x37d2f6[_0xe3d7('0x35')]:_0xcd1145[_0xe3d7('0x32')];if(!_0x24ece8[_0xe3d7('0x2a')][_0xe3d7('0x43')]('nolimit')){_0x37d2f6[_0xe3d7('0x17')]=qs['limit'](_0x24ece8['query'][_0xe3d7('0x17')]);_0x37d2f6[_0xe3d7('0x16')]=qs['offset'](_0x24ece8[_0xe3d7('0x2a')][_0xe3d7('0x16')]);}_0x37d2f6[_0xe3d7('0x44')]=qs[_0xe3d7('0x45')](_0x24ece8[_0xe3d7('0x2a')][_0xe3d7('0x45')]);_0x37d2f6[_0xe3d7('0x46')]=qs[_0xe3d7('0x30')](_[_0xe3d7('0x47')](_0x24ece8[_0xe3d7('0x2a')],_0xcd1145['filters']));_0x37d2f6[_0xe3d7('0x46')][_0xe3d7('0x48')]=_0x57762c['id'];if(_0x24ece8['query']['filter']){_0x37d2f6[_0xe3d7('0x46')]=_[_0xe3d7('0x49')](_0x37d2f6[_0xe3d7('0x46')],{'$or':_['map'](_0x37d2f6[_0xe3d7('0x35')],function(_0xe29042){var _0x54d095={};_0x54d095[_0xe29042]={'$like':'%'+_0x24ece8[_0xe3d7('0x2a')][_0xe3d7('0x4a')]+'%'};return _0x54d095;})});}if(_0x24ece8[_0xe3d7('0x2a')][_0xe3d7('0x4b')]){var _0x33bce1=_0x24ece8[_0xe3d7('0x2a')][_0xe3d7('0x4b')][_0xe3d7('0x4c')](',');var _0x4cad69={};_0x4cad69[_0x33bce1[0x0]]={'$gte':moment(_0x33bce1[0x1])[_0xe3d7('0x4d')](_0xe3d7('0x4e'))};_0x37d2f6[_0xe3d7('0x46')]=_['merge'](_0x37d2f6['where'],_0x4cad69);}_0x37d2f6=_[_0xe3d7('0x49')]({},_0x37d2f6,_0x24ece8['options']);return db[_0xe3d7('0x42')][_0xe3d7('0x4f')]({'where':_0x37d2f6['where']})['then'](function(_0x446bfe){_0x21e94f[_0xe3d7('0x4f')]=_0x446bfe;if(_0x24ece8['query'][_0xe3d7('0x36')]){_0x37d2f6['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xe3d7('0x28')](_0x37d2f6);})[_0xe3d7('0x1b')](function(_0x1fd38d){_0x21e94f[_0xe3d7('0x50')]=_0x1fd38d;return _0x21e94f;});}})[_0xe3d7('0x1b')](respondWithFilteredResult(_0x50cbbd,_0x37d2f6))[_0xe3d7('0x2c')](handleError(_0x50cbbd,null));};exports['addTags']=function(_0x5ddaa9,_0x1e713f){return db[_0xe3d7('0x22')][_0xe3d7('0x39')]({'where':{'id':_0x5ddaa9['params']['id']}})[_0xe3d7('0x1b')](handleEntityNotFound(_0x1e713f,null))[_0xe3d7('0x1b')](function(_0x25d5fb){if(_0x25d5fb){return _0x25d5fb['setTags'](_0x5ddaa9[_0xe3d7('0x3b')]['ids'],_[_0xe3d7('0x3f')](_0x5ddaa9['body'],[_0xe3d7('0x51'),'id'])||{})['spread'](function(){return db[_0xe3d7('0x52')][_0xe3d7('0x28')]({'attributes':['id',_0xe3d7('0x1e'),_0xe3d7('0x53')],'where':{'id':_0x5ddaa9[_0xe3d7('0x3b')][_0xe3d7('0x51')]}});})[_0xe3d7('0x1b')](function(_0x3f5749){socket[_0xe3d7('0x54')](_0xe3d7('0x55'),{'id':Number(_0x5ddaa9[_0xe3d7('0x2e')]['id']),'tags':_0x3f5749||[]});return{'id':Number(_0x5ddaa9[_0xe3d7('0x2e')]['id']),'tags':_0x3f5749||[]};});}})[_0xe3d7('0x1b')](respondWithResult(_0x1e713f,null))[_0xe3d7('0x2c')](handleError(_0x1e713f,null));};exports[_0xe3d7('0x56')]=function(_0x116cca,_0x538519){return db[_0xe3d7('0x22')]['find']({'where':{'id':_0x116cca[_0xe3d7('0x2e')]['id']}})[_0xe3d7('0x1b')](handleEntityNotFound(_0x538519,null))[_0xe3d7('0x1b')](function(_0x1ddac0){if(_0x1ddac0){return _0x1ddac0[_0xe3d7('0x56')](_0x116cca[_0xe3d7('0x2a')][_0xe3d7('0x51')]);}})['then'](respondWithStatusCode(_0x538519,null))[_0xe3d7('0x2c')](handleError(_0x538519,null));};exports[_0xe3d7('0x57')]=function(_0x4c291e,_0x536341){var _0x2b1bdb=moment()[_0xe3d7('0x58')]()[_0xe3d7('0x59')]();var _0x823b23=path[_0xe3d7('0x5a')](config[_0xe3d7('0x5b')],_0xe3d7('0x5c'),_0xe3d7('0x5d'),_0xe3d7('0x5e'));var _0x3022ed=path['join'](config['root'],_0xe3d7('0x5c'),_0xe3d7('0x5d'),'attachments');var _0x58958d=path[_0xe3d7('0x5a')](_0x823b23,_0x2b1bdb);var _0x330282=util['format'](_0xe3d7('0x5f'),_0x4c291e[_0xe3d7('0x2e')]['id'],_0x2b1bdb);var _0x1d07de=path[_0xe3d7('0x5a')](_0x823b23,_0x330282);var _0x25d7e2=[];_0x25d7e2[_0xe3d7('0x60')]({'model':db[_0xe3d7('0x61')],'as':_0xe3d7('0x61'),'attributes':['id','fullname'],'raw':!![]});_0x25d7e2['push']({'model':db[_0xe3d7('0x62')],'as':_0xe3d7('0x63'),'attributes':['id',_0xe3d7('0x64'),'lastName'],'raw':!![]});if(_0x4c291e[_0xe3d7('0x2a')][_0xe3d7('0x65')]){_0x25d7e2['push']({'model':db[_0xe3d7('0x66')],'as':_0xe3d7('0x66'),'raw':!![]});}var _0x5af2eb=[{'model':db[_0xe3d7('0x42')],'as':_0xe3d7('0x67'),'attributes':['id','body',_0xe3d7('0x68'),_0xe3d7('0x69'),'secret',_0xe3d7('0x6a')],'include':_0x25d7e2}];_0x5af2eb[_0xe3d7('0x60')]({'model':db[_0xe3d7('0x6b')],'as':_0xe3d7('0x6c'),'attributes':['id',_0xe3d7('0x1e')]});_0x5af2eb['push']({'model':db['User'],'as':_0xe3d7('0x6d'),'attributes':['id','fullname']});return db[_0xe3d7('0x22')][_0xe3d7('0x39')]({'where':{'id':_0x4c291e['params']['id']},'include':_0x5af2eb})[_0xe3d7('0x1b')](handleEntityNotFound(_0x536341,null))[_0xe3d7('0x1b')](function(_0x2e4057){if(_0x2e4057){var _0x3dc7b3=_0x2e4057[_0xe3d7('0x6e')]({'plain':!![]});fs[_0xe3d7('0x6f')](_0x58958d);var _0x4220ba={'channel':_0xe3d7('0x70'),'account':_0x3dc7b3[_0xe3d7('0x6c')]['name'],'agent':_0x3dc7b3[_0xe3d7('0x6d')]?_0x3dc7b3[_0xe3d7('0x6d')][_0xe3d7('0x71')]:_0xe3d7('0x72'),'createdAt':moment(_0x3dc7b3[_0xe3d7('0x68')])[_0xe3d7('0x4d')](_0xe3d7('0x4e'))[_0xe3d7('0x59')](),'closedAt':_0x3dc7b3[_0xe3d7('0x73')]?moment(_0x3dc7b3[_0xe3d7('0x74')])[_0xe3d7('0x4d')](_0xe3d7('0x4e'))[_0xe3d7('0x59')]():'','disposition':_0x3dc7b3[_0xe3d7('0x75')],'messages':_(_0x3dc7b3[_0xe3d7('0x67')])['filter']({'secret':![]})[_0xe3d7('0x21')](function(_0x28e97a){if(_0x28e97a[_0xe3d7('0x66')]){var _0x3ed675=path[_0xe3d7('0x5a')](_0x3022ed,_0x28e97a[_0xe3d7('0x66')][_0xe3d7('0x76')]);if(fs['existsSync'](_0x3ed675)){fs[_0xe3d7('0x77')](_0x3ed675)[_0xe3d7('0x78')](fs['createWriteStream'](path[_0xe3d7('0x5a')](_0x58958d,_0x28e97a['Attachment'][_0xe3d7('0x76')])));}}return{'date':moment(_0x28e97a[_0xe3d7('0x68')])[_0xe3d7('0x4d')](_0xe3d7('0x4e'))['toString'](),'sender':_0x28e97a[_0xe3d7('0x69')]===_0xe3d7('0x79')?_0x28e97a[_0xe3d7('0x61')]?_0x28e97a[_0xe3d7('0x61')][_0xe3d7('0x71')]:'System':_0x28e97a[_0xe3d7('0x63')]['firstName']+(_0x28e97a[_0xe3d7('0x63')][_0xe3d7('0x7a')]?'\x20'+_0x28e97a[_0xe3d7('0x63')][_0xe3d7('0x7a')]:''),'body':_0x28e97a['Attachment']?_0x28e97a[_0xe3d7('0x66')][_0xe3d7('0x76')]:_0x28e97a[_0xe3d7('0x3b')],'direction':_0x28e97a[_0xe3d7('0x69')]===_0xe3d7('0x79')?'A':'C','secret':_0x28e97a[_0xe3d7('0x7b')],'read':_0x28e97a[_0xe3d7('0x6a')],'attachment':_0x28e97a['Attachment']};})['value']()};return ejs[_0xe3d7('0x7c')](path[_0xe3d7('0x5a')](config[_0xe3d7('0x5b')],'server',_0xe3d7('0x7d'),'downloadInteraction.ejs'),{'interaction':_0x4220ba})[_0xe3d7('0x1b')](function(_0x57f527){var _0x195edc=path[_0xe3d7('0x5a')](_0x58958d,_0xe3d7('0x7e')+_0x3dc7b3['id']+'-'+_0x2b1bdb+_0xe3d7('0x7f'));var _0x4f1c4d={'path':_0x195edc,'channel':_0xe3d7('0x70'),'interactionId':_0x3dc7b3['id']};return pdf[_0xe3d7('0x80')](_0x57f527,_0x4f1c4d);})[_0xe3d7('0x1b')](function(){return new BPromise(function(_0x55f9ac,_0x3a2867){zipdir(_0x58958d,{'saveTo':_0x1d07de},function(_0x8fbc34,_0x1fcc33){if(_0x8fbc34)return _0x3a2867(_0x8fbc34);return _0x55f9ac(_0x1fcc33);});})[_0xe3d7('0x1b')](function(){return new BPromise(function(_0x1d0cf5,_0x43a266){rimraf(_0x58958d,function(_0x58751b){if(_0x58751b)_0x43a266(_0x58751b);return _0x1d0cf5();});});})[_0xe3d7('0x1b')](function(){return _0x536341['download'](_0x1d07de,_0x330282,function(_0x20852c){if(_0x20852c){console[_0xe3d7('0x81')](_0xe3d7('0x82'),_0x20852c);}else{fs[_0xe3d7('0x83')](_0x1d07de);}});});});}else{return _0x536341[_0xe3d7('0x12')](0xc8);}})[_0xe3d7('0x2c')](handleError(_0x536341,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index f0ab42d..7f20ee4 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 _0x2cbd=['WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x772b80,_0x39b2be){var _0x30b292=function(_0x599382){while(--_0x599382){_0x772b80['push'](_0x772b80['shift']());}};_0x30b292(++_0x39b2be);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x2cbd[_0x3f5dca];return _0x5b833a;};'use strict';var EventEmitter=require(_0xd2cb('0x0'));var WhatsappInteraction=require(_0xd2cb('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xd2cb('0x1'))['db'][_0xd2cb('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd2cb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd2cb('0x4'),'afterDestroy':_0xd2cb('0x5')};function emitEvent(_0x480683){return function(_0x4e4b04,_0x409c0f,_0x20ff39){_0x4e4b04[_0xd2cb('0x6')]({'attributes':['id'],'raw':!![]})[_0xd2cb('0x7')](function(_0x4c3593){_0x4e4b04[_0xd2cb('0x8')]('Users',_0x4c3593[_0xd2cb('0x9')](function(_0x5e3bec){return{'id':_0x5e3bec['id']};}));return WhatsappMessage[_0xd2cb('0xa')]({'where':{'WhatsappInteractionId':_0x4e4b04['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd2cb('0x7')](function(_0x4b6cf4){_0x4e4b04[_0xd2cb('0x8')](_0xd2cb('0xb'),_0x4b6cf4['length']);WhatsappInteractionEvents[_0xd2cb('0xc')](_0x480683+':'+_0x4e4b04['id'],_0x4e4b04);WhatsappInteractionEvents[_0xd2cb('0xc')](_0x480683,_0x4e4b04);_0x20ff39(null);})[_0xd2cb('0xd')](_0x20ff39(null));};}for(var e in events){if(events[_0xd2cb('0xe')](e)){var event=events[e];WhatsappInteraction[_0xd2cb('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x2b84=['unreadMessages','length','emit','catch','hasOwnProperty','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','map'];(function(_0x2142d6,_0x97a9ee){var _0x405bc5=function(_0x2a43f5){while(--_0x2a43f5){_0x2142d6['push'](_0x2142d6['shift']());}};_0x405bc5(++_0x97a9ee);}(_0x2b84,0x105));var _0x42b8=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x2b84[_0x37bd26];return _0xe83dc4;};'use strict';var EventEmitter=require(_0x42b8('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x42b8('0x1')];var WhatsappMessage=require(_0x42b8('0x2'))['db'][_0x42b8('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x42b8('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x42b8('0x5'),'afterDestroy':_0x42b8('0x6')};function emitEvent(_0x1561c3){return function(_0xd38487,_0x179ad2,_0x396739){_0xd38487[_0x42b8('0x7')]({'attributes':['id'],'raw':!![]})[_0x42b8('0x8')](function(_0x593975){_0xd38487[_0x42b8('0x9')]('Users',_0x593975[_0x42b8('0xa')](function(_0x5c83cd){return{'id':_0x5c83cd['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0xd38487['id'],'direction':'in','read':![]},'raw':!![]});})[_0x42b8('0x8')](function(_0x10bf92){_0xd38487[_0x42b8('0x9')](_0x42b8('0xb'),_0x10bf92[_0x42b8('0xc')]);WhatsappInteractionEvents['emit'](_0x1561c3+':'+_0xd38487['id'],_0xd38487);WhatsappInteractionEvents[_0x42b8('0xd')](_0x1561c3,_0xd38487);_0x396739(null);})[_0x42b8('0xe')](_0x396739(null));};}for(var e in events){if(events[_0x42b8('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x42b8('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 f938faa..3e6ea76 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 _0xea08=['define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xea08,0x7f));var _0x8ea0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xea08[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x8ea0('0x0'));var logger=require(_0x8ea0('0x1'))(_0x8ea0('0x2'));var moment=require(_0x8ea0('0x3'));var BPromise=require(_0x8ea0('0x4'));var rp=require(_0x8ea0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8ea0('0x6'));var attributes=require(_0x8ea0('0x7'));module[_0x8ea0('0x8')]=function(_0x2f9b42,_0x3ef40d){return _0x2f9b42[_0x8ea0('0x9')](_0x8ea0('0xa'),attributes,{'tableName':_0x8ea0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x67c362,_0x59cc40,_0x2a90f6){if(_0x67c362[_0x8ea0('0xc')](_0x8ea0('0xd'))){_0x67c362[_0x8ea0('0xe')]=moment()[_0x8ea0('0xf')](_0x8ea0('0x10'));}_0x2a90f6(null,_0x67c362);}}});}; \ No newline at end of file +var _0x91ac=['request-promise','path','../../config/environment','./whatsappInteraction.attributes','changed','closedAt','format','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1e77b0,_0x5134c4){var _0x5abe76=function(_0x786a94){while(--_0x786a94){_0x1e77b0['push'](_0x1e77b0['shift']());}};_0x5abe76(++_0x5134c4);}(_0x91ac,0x73));var _0xc91a=function(_0x45bee1,_0x4267e6){_0x45bee1=_0x45bee1-0x0;var _0x101884=_0x91ac[_0x45bee1];return _0x101884;};'use strict';var _=require(_0xc91a('0x0'));var util=require('util');var logger=require(_0xc91a('0x1'))(_0xc91a('0x2'));var moment=require(_0xc91a('0x3'));var BPromise=require(_0xc91a('0x4'));var rp=require(_0xc91a('0x5'));var fs=require('fs');var path=require(_0xc91a('0x6'));var rimraf=require('rimraf');var config=require(_0xc91a('0x7'));var attributes=require(_0xc91a('0x8'));module['exports']=function(_0x50dc8d,_0x415d95){return _0x50dc8d['define']('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52380e,_0x23b070,_0x29b0d7){if(_0x52380e[_0xc91a('0x9')]('closed')){_0x52380e[_0xc91a('0xa')]=moment()[_0xc91a('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x29b0d7(null,_0x52380e);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 4dd49d3..7dd35fa 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 _0x0bd8=['then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappInteraction,\x20%s,\x20%s','result','update','body','options','raw','where','UpdateWhatsappInteraction','catch','WhatsappInteraction','find','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','./whatsappInteraction.socket','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0bd8,0x17e));var _0x80bd=function(_0x290492,_0x18cfad){_0x290492=_0x290492-0x0;var _0x52b5bf=_0x0bd8[_0x290492];return _0x52b5bf;};'use strict';var _=require(_0x80bd('0x0'));var util=require('util');var moment=require(_0x80bd('0x1'));var BPromise=require(_0x80bd('0x2'));var rs=require(_0x80bd('0x3'));var fs=require('fs');var Redis=require(_0x80bd('0x4'));var db=require(_0x80bd('0x5'))['db'];var utils=require(_0x80bd('0x6'));var logger=require(_0x80bd('0x7'))(_0x80bd('0x8'));var config=require(_0x80bd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x80bd('0xa')]['http']({'port':0x232a});config[_0x80bd('0xb')]=_['defaults'](config[_0x80bd('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80bd('0xb')]));require(_0x80bd('0xc'))['register'](socket);function respondWithRpcPromise(_0x579130,_0xa3c0da,_0x1fa5f4){return new BPromise(function(_0x4babff,_0x109dd9){return client[_0x80bd('0xd')](_0x579130,_0x1fa5f4)[_0x80bd('0xe')](function(_0x38fc0e){logger[_0x80bd('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0xa3c0da,_0x80bd('0x10'));logger[_0x80bd('0x11')](_0x80bd('0x12'),_0xa3c0da,_0x80bd('0x10'),JSON[_0x80bd('0x13')](_0x38fc0e));if(_0x38fc0e['error']){if(_0x38fc0e[_0x80bd('0x14')]['code']===0x1f4){logger[_0x80bd('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0xa3c0da,_0x38fc0e['error'][_0x80bd('0x15')]);return _0x109dd9(_0x38fc0e[_0x80bd('0x14')]['message']);}logger[_0x80bd('0x14')](_0x80bd('0x16'),_0xa3c0da,_0x38fc0e['error'][_0x80bd('0x15')]);return _0x4babff(_0x38fc0e[_0x80bd('0x14')][_0x80bd('0x15')]);}else{logger[_0x80bd('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0xa3c0da,_0x80bd('0x10'));_0x4babff(_0x38fc0e[_0x80bd('0x17')][_0x80bd('0x15')]);}})['catch'](function(_0x15c826){logger[_0x80bd('0x14')](_0x80bd('0x16'),_0xa3c0da,_0x15c826);_0x109dd9(_0x15c826);});});}exports['UpdateWhatsappInteraction']=function(_0x24002f){var _0x15b847=this;return new Promise(function(_0x18ccda,_0x9fb62d){return db['WhatsappInteraction'][_0x80bd('0x18')](_0x24002f[_0x80bd('0x19')],{'raw':_0x24002f[_0x80bd('0x1a')]?_0x24002f[_0x80bd('0x1a')][_0x80bd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24002f[_0x80bd('0x1a')]?_0x24002f[_0x80bd('0x1a')][_0x80bd('0x1c')]||null:null,'attributes':_0x24002f[_0x80bd('0x1a')]?_0x24002f[_0x80bd('0x1a')]['attributes']||null:null,'limit':_0x24002f['options']?_0x24002f['options']['limit']||null:null})[_0x80bd('0xe')](function(_0x3b03fe){logger[_0x80bd('0xf')]('UpdateWhatsappInteraction',_0x24002f);logger[_0x80bd('0x11')](_0x80bd('0x1d'),_0x24002f,JSON[_0x80bd('0x13')](_0x3b03fe));_0x18ccda(_0x3b03fe);})[_0x80bd('0x1e')](function(_0x4a1935){logger[_0x80bd('0x14')](_0x80bd('0x1d'),_0x4a1935[_0x80bd('0x15')],_0x24002f);_0x9fb62d(_0x15b847[_0x80bd('0x14')](0x1f4,_0x4a1935[_0x80bd('0x15')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x4f3386){return new Promise(function(_0x2ac88a,_0x20760e){return db[_0x80bd('0x1f')][_0x80bd('0x20')]({'where':_0x4f3386['options']?_0x4f3386[_0x80bd('0x1a')][_0x80bd('0x1c')]||null:null})['then'](function(_0x4a8ba5){if(_0x4a8ba5){return _0x4a8ba5['addTags'](_0x4f3386[_0x80bd('0x19')][_0x80bd('0x21')],_[_0x80bd('0x22')](_0x4f3386[_0x80bd('0x19')],[_0x80bd('0x21'),'id'])||{});}})['spread'](function(_0x2602b6){logger['info']('AddTags',_0x4f3386);logger[_0x80bd('0x11')](_0x80bd('0x23'),_0x4f3386,JSON[_0x80bd('0x13')](_0x2602b6));_0x2ac88a(_0x2602b6);})[_0x80bd('0x1e')](function(_0x147c07){logger[_0x80bd('0x14')]('AddTags',_0x147c07['message'],_0x4f3386);_0x20760e(_this[_0x80bd('0x14')](0x1f4,_0x147c07['message']));});});}; \ No newline at end of file +var _0x1779=['info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','result','update','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','catch','AddTagsToWhatsappInteraction','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','stringify','error','code','message'];(function(_0x346caa,_0x46888d){var _0x1f4548=function(_0x3e7c1b){while(--_0x3e7c1b){_0x346caa['push'](_0x346caa['shift']());}};_0x1f4548(++_0x46888d);}(_0x1779,0x66));var _0x9177=function(_0x42f6b1,_0x560c04){_0x42f6b1=_0x42f6b1-0x0;var _0x39b69f=_0x1779[_0x42f6b1];return _0x39b69f;};'use strict';var _=require(_0x9177('0x0'));var util=require(_0x9177('0x1'));var moment=require(_0x9177('0x2'));var BPromise=require(_0x9177('0x3'));var rs=require(_0x9177('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9177('0x5'))['db'];var utils=require(_0x9177('0x6'));var logger=require(_0x9177('0x7'))(_0x9177('0x8'));var config=require(_0x9177('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9177('0xa')][_0x9177('0xb')]({'port':0x232a});config[_0x9177('0xc')]=_[_0x9177('0xd')](config[_0x9177('0xc')],{'host':_0x9177('0xe'),'port':0x18eb});var socket=require(_0x9177('0xf'))(new Redis(config['redis']));require(_0x9177('0x10'))[_0x9177('0x11')](socket);function respondWithRpcPromise(_0x5ced7c,_0x54afe1,_0x2754de){return new BPromise(function(_0x26b33f,_0x25d362){return client[_0x9177('0x12')](_0x5ced7c,_0x2754de)[_0x9177('0x13')](function(_0x4f0e20){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x54afe1,'request\x20sent');logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x54afe1,'request\x20sent',JSON[_0x9177('0x14')](_0x4f0e20));if(_0x4f0e20[_0x9177('0x15')]){if(_0x4f0e20[_0x9177('0x15')][_0x9177('0x16')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x54afe1,_0x4f0e20['error'][_0x9177('0x17')]);return _0x25d362(_0x4f0e20[_0x9177('0x15')][_0x9177('0x17')]);}logger[_0x9177('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x54afe1,_0x4f0e20['error'][_0x9177('0x17')]);return _0x26b33f(_0x4f0e20[_0x9177('0x15')][_0x9177('0x17')]);}else{logger[_0x9177('0x18')](_0x9177('0x19'),_0x54afe1,_0x9177('0x1a'));_0x26b33f(_0x4f0e20[_0x9177('0x1b')]['message']);}})['catch'](function(_0xf86adb){logger[_0x9177('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x54afe1,_0xf86adb);_0x25d362(_0xf86adb);});});}exports['UpdateWhatsappInteraction']=function(_0x29ca94){var _0x3b9c9b=this;return new Promise(function(_0x303347,_0x358f85){return db['WhatsappInteraction'][_0x9177('0x1c')](_0x29ca94[_0x9177('0x1d')],{'raw':_0x29ca94[_0x9177('0x1e')]?_0x29ca94[_0x9177('0x1e')][_0x9177('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29ca94[_0x9177('0x1e')]?_0x29ca94[_0x9177('0x1e')][_0x9177('0x20')]||null:null,'attributes':_0x29ca94[_0x9177('0x1e')]?_0x29ca94['options'][_0x9177('0x21')]||null:null,'limit':_0x29ca94[_0x9177('0x1e')]?_0x29ca94['options'][_0x9177('0x22')]||null:null})[_0x9177('0x13')](function(_0x28241b){logger[_0x9177('0x18')]('UpdateWhatsappInteraction',_0x29ca94);logger['debug'](_0x9177('0x23'),_0x29ca94,JSON['stringify'](_0x28241b));_0x303347(_0x28241b);})[_0x9177('0x24')](function(_0x45fd71){logger[_0x9177('0x15')](_0x9177('0x23'),_0x45fd71[_0x9177('0x17')],_0x29ca94);_0x358f85(_0x3b9c9b['error'](0x1f4,_0x45fd71[_0x9177('0x17')]));});});};exports[_0x9177('0x25')]=function(_0x25f167){return new Promise(function(_0x13fde8,_0x56c789){return db['WhatsappInteraction']['find']({'where':_0x25f167['options']?_0x25f167['options'][_0x9177('0x20')]||null:null})[_0x9177('0x13')](function(_0x1c8068){if(_0x1c8068){return _0x1c8068['addTags'](_0x25f167[_0x9177('0x1d')]['ids'],_[_0x9177('0x26')](_0x25f167[_0x9177('0x1d')],[_0x9177('0x27'),'id'])||{});}})[_0x9177('0x28')](function(_0x2e062b){logger['info'](_0x9177('0x29'),_0x25f167);logger['debug'](_0x9177('0x29'),_0x25f167,JSON[_0x9177('0x14')](_0x2e062b));_0x13fde8(_0x2e062b);})[_0x9177('0x24')](function(_0x5638db){logger[_0x9177('0x15')](_0x9177('0x29'),_0x5638db[_0x9177('0x17')],_0x25f167);_0x56c789(_this['error'](0x1f4,_0x5638db[_0x9177('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 5ed0e77..950c45a 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 _0xf8dd=['length','./whatsappInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x4cdad1,_0x1620ec){var _0x515769=function(_0x24f998){while(--_0x24f998){_0x4cdad1['push'](_0x4cdad1['shift']());}};_0x515769(++_0x1620ec);}(_0xf8dd,0x101));var _0xdf8d=function(_0x202233,_0xd5fa50){_0x202233=_0x202233-0x0;var _0xf0ac90=_0xf8dd[_0x202233];return _0xf0ac90;};'use strict';var WhatsappInteractionEvents=require(_0xdf8d('0x0'));var events=[_0xdf8d('0x1'),_0xdf8d('0x2'),_0xdf8d('0x3')];function createListener(_0x41d8d7,_0x33ccdd){return function(_0x5b43a2){_0x33ccdd[_0xdf8d('0x4')](_0x41d8d7,_0x5b43a2);};}function removeListener(_0x2efd87,_0x4efbae){return function(){WhatsappInteractionEvents[_0xdf8d('0x5')](_0x2efd87,_0x4efbae);};}exports[_0xdf8d('0x6')]=function(_0x2afe69){for(var _0x59273f=0x0,_0x37cb83=events[_0xdf8d('0x7')];_0x59273f<_0x37cb83;_0x59273f++){var _0xe4d819=events[_0x59273f];var _0x2628b5=createListener('whatsappInteraction:'+_0xe4d819,_0x2afe69);WhatsappInteractionEvents['on'](_0xe4d819,_0x2628b5);}}; \ No newline at end of file +var _0xa0a5=['update','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x5ba708,_0x3823c1){var _0x4eeaa8=function(_0x4b38c8){while(--_0x4b38c8){_0x5ba708['push'](_0x5ba708['shift']());}};_0x4eeaa8(++_0x3823c1);}(_0xa0a5,0xee));var _0x5a0a=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0xa0a5[_0x43b584];return _0x48f27b;};'use strict';var WhatsappInteractionEvents=require(_0x5a0a('0x0'));var events=[_0x5a0a('0x1'),'remove',_0x5a0a('0x2')];function createListener(_0xe1c462,_0x822f6){return function(_0xfbc440){_0x822f6['emit'](_0xe1c462,_0xfbc440);};}function removeListener(_0x1081be,_0x50d0fe){return function(){WhatsappInteractionEvents[_0x5a0a('0x3')](_0x1081be,_0x50d0fe);};}exports['register']=function(_0x15e38b){for(var _0x5048f5=0x0,_0x4d8826=events[_0x5a0a('0x4')];_0x5048f5<_0x4d8826;_0x5048f5++){var _0x234312=events[_0x5048f5];var _0x2b65fb=createListener(_0x5a0a('0x5')+_0x234312,_0x15e38b);WhatsappInteractionEvents['on'](_0x234312,_0x2b65fb);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 23ba614..6187f25 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 _0x21fc=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','whatsapp','create','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer'];(function(_0x4920c0,_0x238c06){var _0x42562c=function(_0x11458e){while(--_0x11458e){_0x4920c0['push'](_0x4920c0['shift']());}};_0x42562c(++_0x238c06);}(_0x21fc,0x149));var _0xc21f=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0x21fc[_0x286726];return _0xcd4fe9;};'use strict';var multer=require(_0xc21f('0x0'));var util=require('util');var path=require(_0xc21f('0x1'));var timeout=require(_0xc21f('0x2'));var express=require(_0xc21f('0x3'));var router=express[_0xc21f('0x4')]();var fs_extra=require(_0xc21f('0x5'));var auth=require(_0xc21f('0x6'));var interaction=require(_0xc21f('0x7'));var config=require(_0xc21f('0x8'));var controller=require(_0xc21f('0x9'));router[_0xc21f('0xa')]('/',auth[_0xc21f('0xb')](),controller[_0xc21f('0xc')]);router[_0xc21f('0xa')](_0xc21f('0xd'),auth[_0xc21f('0xb')](),controller[_0xc21f('0xe')]);router[_0xc21f('0xa')]('/:id',auth[_0xc21f('0xb')](),controller[_0xc21f('0xf')]);router[_0xc21f('0x10')]('/',auth[_0xc21f('0xb')](),interaction['tracked'](_0xc21f('0x11'),'whatsappmessage:create'),controller[_0xc21f('0x12')]);router[_0xc21f('0x10')](_0xc21f('0x13'),controller[_0xc21f('0x14')]);router[_0xc21f('0x15')](_0xc21f('0x16'),auth[_0xc21f('0xb')](),controller[_0xc21f('0x17')]);router[_0xc21f('0x15')](_0xc21f('0x18'),auth['isAuthenticated'](),controller[_0xc21f('0x19')]);router[_0xc21f('0x15')](_0xc21f('0x1a'),auth['isAuthenticated'](),controller[_0xc21f('0x1b')]);router[_0xc21f('0x1c')](_0xc21f('0x16'),auth[_0xc21f('0xb')](),controller['destroy']);module[_0xc21f('0x1d')]=router; \ No newline at end of file +var _0x92bd=['accept','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','tracked','whatsapp','/:id/status','status','put','/:id/accept'];(function(_0x366e75,_0x533d1d){var _0x3b167b=function(_0x3e9f1d){while(--_0x3e9f1d){_0x366e75['push'](_0x366e75['shift']());}};_0x3b167b(++_0x533d1d);}(_0x92bd,0xb5));var _0xd92b=function(_0x7e5ead,_0x302495){_0x7e5ead=_0x7e5ead-0x0;var _0x2a450f=_0x92bd[_0x7e5ead];return _0x2a450f;};'use strict';var multer=require(_0xd92b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd92b('0x1'));var express=require(_0xd92b('0x2'));var router=express[_0xd92b('0x3')]();var fs_extra=require(_0xd92b('0x4'));var auth=require(_0xd92b('0x5'));var interaction=require(_0xd92b('0x6'));var config=require('../../config/environment');var controller=require(_0xd92b('0x7'));router[_0xd92b('0x8')]('/',auth[_0xd92b('0x9')](),controller[_0xd92b('0xa')]);router[_0xd92b('0x8')](_0xd92b('0xb'),auth[_0xd92b('0x9')](),controller['describe']);router[_0xd92b('0x8')](_0xd92b('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd92b('0x9')](),interaction[_0xd92b('0xd')](_0xd92b('0xe'),'whatsappmessage:create'),controller['create']);router['post'](_0xd92b('0xf'),controller[_0xd92b('0x10')]);router[_0xd92b('0x11')](_0xd92b('0xc'),auth[_0xd92b('0x9')](),controller['update']);router[_0xd92b('0x11')](_0xd92b('0x12'),auth[_0xd92b('0x9')](),controller[_0xd92b('0x13')]);router[_0xd92b('0x11')]('/:id/reject',auth[_0xd92b('0x9')](),controller['reject']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index c4cea36..113095b 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 _0xdfb4=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x55f914,_0x48fa04){var _0x2ef047=function(_0x26f522){while(--_0x26f522){_0x55f914['push'](_0x55f914['shift']());}};_0x2ef047(++_0x48fa04);}(_0xdfb4,0x169));var _0x4dfb=function(_0x503883,_0x527ce4){_0x503883=_0x503883-0x0;var _0x2bcbcd=_0xdfb4[_0x503883];return _0x2bcbcd;};'use strict';var Sequelize=require(_0x4dfb('0x0'));module[_0x4dfb('0x1')]={'body':{'type':Sequelize[_0x4dfb('0x2')](_0x4dfb('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4dfb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4dfb('0x5')]('in',_0x4dfb('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x4dfb('0x7')](0xbe)},'phone':{'type':Sequelize[_0x4dfb('0x7')]},'readAt':{'type':Sequelize[_0x4dfb('0x8')]},'secret':{'type':Sequelize[_0x4dfb('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4dfb('0x7')]},'providerResponse':{'type':Sequelize[_0x4dfb('0x2')]}}; \ No newline at end of file +var _0x6c0f=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6c0f,0x186));var _0xf6c0=function(_0x24102b,_0x2e7c74){_0x24102b=_0x24102b-0x0;var _0x5af819=_0x6c0f[_0x24102b];return _0x5af819;};'use strict';var Sequelize=require(_0xf6c0('0x0'));module[_0xf6c0('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf6c0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf6c0('0x3')]('in',_0xf6c0('0x4')),'defaultValue':_0xf6c0('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf6c0('0x5')](0xbe)},'phone':{'type':Sequelize[_0xf6c0('0x5')]},'readAt':{'type':Sequelize[_0xf6c0('0x6')]},'secret':{'type':Sequelize[_0xf6c0('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf6c0('0x5')]},'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 d9c8118..55163f6 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 _0xc7c1=['SELECT','contact','User','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','fullname','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','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','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','WhatsappMessage','rawAttributes','include','options','create','body','find','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteractionId','update','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes'];(function(_0x233f5a,_0x6dc40c){var _0x23531e=function(_0x4bf560){while(--_0x4bf560){_0x233f5a['push'](_0x233f5a['shift']());}};_0x23531e(++_0x6dc40c);}(_0xc7c1,0x1b9));var _0x1c7c=function(_0x571ca3,_0x4c04fb){_0x571ca3=_0x571ca3-0x0;var _0x40a4a2=_0xc7c1[_0x571ca3];return _0x40a4a2;};'use strict';var emlformat=require(_0x1c7c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c7c('0x1'));var moment=require('moment');var BPromise=require(_0x1c7c('0x2'));var Mustache=require(_0x1c7c('0x3'));var util=require(_0x1c7c('0x4'));var path=require('path');var sox=require(_0x1c7c('0x5'));var csv=require(_0x1c7c('0x6'));var ejs=require(_0x1c7c('0x7'));var fs=require('fs');var fs_extra=require(_0x1c7c('0x8'));var _=require(_0x1c7c('0x9'));var squel=require(_0x1c7c('0xa'));var crypto=require(_0x1c7c('0xb'));var jsforce=require(_0x1c7c('0xc'));var deskjs=require(_0x1c7c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1c7c('0xe'));var qs=require(_0x1c7c('0xf'));var as=require(_0x1c7c('0x10'));var hardwareService=require(_0x1c7c('0x11'));var logger=require(_0x1c7c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x1c7c('0x13'));var licenseUtil=require(_0x1c7c('0x14'));var db=require('../../mysqldb')['db'];config[_0x1c7c('0x15')]=_[_0x1c7c('0x16')](config[_0x1c7c('0x15')],{'host':_0x1c7c('0x17'),'port':0x18eb});var socket=require(_0x1c7c('0x18'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x1c7c('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1c7c('0x1a')][_0x1c7c('0x1b')]({'port':0x232c});var client9002=jayson[_0x1c7c('0x1a')][_0x1c7c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xe98a8a,_0xb6e6ff,_0x53f07d,_0x8aed51){return new BPromise(function(_0x2df7cc,_0x9ab8a5){var _0x1b62ee=_0x8aed51||client;return _0x1b62ee[_0x1c7c('0x1c')](_0xe98a8a,_0x53f07d)[_0x1c7c('0x1d')](function(_0xaa9216){logger[_0x1c7c('0x1e')](_0x1c7c('0x1f'),_0xb6e6ff,'request\x20sent');logger[_0x1c7c('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xb6e6ff,_0x1c7c('0x21'),JSON[_0x1c7c('0x22')](_0xaa9216));if(_0xaa9216[_0x1c7c('0x23')]){if(_0xaa9216[_0x1c7c('0x23')][_0x1c7c('0x24')]===0x1f4){logger[_0x1c7c('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0xb6e6ff,_0xaa9216[_0x1c7c('0x23')]['message']);return _0x9ab8a5(_0xaa9216['error']['message']);}logger[_0x1c7c('0x23')](_0x1c7c('0x1f'),_0xb6e6ff,_0xaa9216[_0x1c7c('0x23')][_0x1c7c('0x25')]);return _0x2df7cc(_0xaa9216[_0x1c7c('0x23')][_0x1c7c('0x25')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0xb6e6ff,_0x1c7c('0x21'));_0x2df7cc(_0xaa9216[_0x1c7c('0x26')][_0x1c7c('0x25')]);}})['catch'](function(_0x50b31b){logger[_0x1c7c('0x23')](_0x1c7c('0x1f'),_0xb6e6ff,_0x50b31b);_0x9ab8a5(_0x50b31b);});});}function respondWithStatusCode(_0x3251ea,_0x39008c){_0x39008c=_0x39008c||0xcc;return function(_0x1eeabc){if(_0x1eeabc){return _0x3251ea['sendStatus'](_0x39008c);}return _0x3251ea['status'](_0x39008c)['end']();};}function respondWithResult(_0x3cd5cb,_0x27416e){_0x27416e=_0x27416e||0xc8;return function(_0x49a82f){if(_0x49a82f){return _0x3cd5cb['status'](_0x27416e)['json'](_0x49a82f);}};}function respondWithFilteredResult(_0x1525af,_0x492f91){return function(_0x34f8d0){if(_0x34f8d0){var _0x527d36=typeof _0x492f91[_0x1c7c('0x27')]===_0x1c7c('0x28')&&typeof _0x492f91[_0x1c7c('0x29')]===_0x1c7c('0x28');var _0xf50fa5=_0x34f8d0['count'];var _0x1bc1e8=_0x527d36?0x0:_0x492f91['offset'];var _0xc181f5=_0x527d36?_0x34f8d0[_0x1c7c('0x2a')]:_0x492f91['offset']+_0x492f91['limit'];var _0x56041b;if(_0xc181f5>=_0xf50fa5){_0xc181f5=_0xf50fa5;_0x56041b=0xc8;}else{_0x56041b=0xce;}_0x1525af[_0x1c7c('0x2b')](_0x56041b);return _0x1525af[_0x1c7c('0x2c')](_0x1c7c('0x2d'),_0x1bc1e8+'-'+_0xc181f5+'/'+_0xf50fa5)['json'](_0x34f8d0);}return null;};}function patchUpdates(_0x487766){return function(_0x45802e){try{jsonpatch[_0x1c7c('0x2e')](_0x45802e,_0x487766,!![]);}catch(_0x569973){return BPromise[_0x1c7c('0x2f')](_0x569973);}return _0x45802e[_0x1c7c('0x30')]();};}function saveUpdates(_0x2acbca,_0x540b5d){return function(_0x2b0f42){if(_0x2b0f42){return _0x2b0f42['update'](_0x2acbca)['then'](function(_0x27030c){return _0x27030c;});}return null;};}function removeEntity(_0x5f19f3,_0x48c501){return function(_0x5a4abf){if(_0x5a4abf){return _0x5a4abf[_0x1c7c('0x31')]()[_0x1c7c('0x1d')](function(){_0x5f19f3[_0x1c7c('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d2b0b,_0x1ae327){return function(_0x2e832d){if(!_0x2e832d){_0x3d2b0b[_0x1c7c('0x32')](0x194);}return _0x2e832d;};}function handleError(_0x3a7107,_0x101e24){_0x101e24=_0x101e24||0x1f4;return function(_0x1800c3){logger['error'](_0x1800c3[_0x1c7c('0x33')]);if(_0x1800c3[_0x1c7c('0x34')]){delete _0x1800c3[_0x1c7c('0x34')];}_0x3a7107[_0x1c7c('0x2b')](_0x101e24)[_0x1c7c('0x35')](_0x1800c3);};}exports['index']=function(_0x2f9132,_0x2e70c4){var _0x1e681a={},_0x2cc99a={},_0x24588c={'count':0x0,'rows':[]};var _0x31476f=_['map'](db['WhatsappMessage']['rawAttributes'],function(_0x2d9899){return{'name':_0x2d9899['fieldName'],'type':_0x2d9899[_0x1c7c('0x36')][_0x1c7c('0x37')]};});_0x2cc99a['model']=_[_0x1c7c('0x38')](_0x31476f,'name');_0x2cc99a['query']=_[_0x1c7c('0x39')](_0x2f9132[_0x1c7c('0x3a')]);_0x2cc99a[_0x1c7c('0x3b')]=_[_0x1c7c('0x3c')](_0x2cc99a[_0x1c7c('0x3d')],_0x2cc99a[_0x1c7c('0x3a')]);_0x1e681a[_0x1c7c('0x3e')]=_[_0x1c7c('0x3c')](_0x2cc99a[_0x1c7c('0x3d')],qs['fields'](_0x2f9132[_0x1c7c('0x3a')][_0x1c7c('0x3f')]));_0x1e681a['attributes']=_0x1e681a[_0x1c7c('0x3e')][_0x1c7c('0x40')]?_0x1e681a[_0x1c7c('0x3e')]:_0x2cc99a[_0x1c7c('0x3d')];if(!_0x2f9132['query'][_0x1c7c('0x41')](_0x1c7c('0x42'))){_0x1e681a[_0x1c7c('0x29')]=qs['limit'](_0x2f9132[_0x1c7c('0x3a')][_0x1c7c('0x29')]);_0x1e681a[_0x1c7c('0x27')]=qs[_0x1c7c('0x27')](_0x2f9132[_0x1c7c('0x3a')][_0x1c7c('0x27')]);}_0x1e681a[_0x1c7c('0x43')]=qs[_0x1c7c('0x44')](_0x2f9132[_0x1c7c('0x3a')]['sort']);_0x1e681a[_0x1c7c('0x45')]=qs[_0x1c7c('0x3b')](_['pick'](_0x2f9132['query'],_0x2cc99a[_0x1c7c('0x3b')]),_0x31476f);if(_0x2f9132['query'][_0x1c7c('0x46')]){_0x1e681a['where']=_['merge'](_0x1e681a[_0x1c7c('0x45')],{'$or':_[_0x1c7c('0x38')](_0x31476f,function(_0x1568d9){if(_0x1568d9['type']!==_0x1c7c('0x47')){var _0x18bc7f={};_0x18bc7f[_0x1568d9[_0x1c7c('0x34')]]={'$like':'%'+_0x2f9132[_0x1c7c('0x3a')]['filter']+'%'};return _0x18bc7f;}})});}_0x1e681a=_[_0x1c7c('0x48')]({},_0x1e681a,_0x2f9132['options']);var _0x1e1d61={'where':_0x1e681a[_0x1c7c('0x45')]};return db['WhatsappMessage']['count'](_0x1e1d61)[_0x1c7c('0x1d')](function(_0xa3932a){_0x24588c['count']=_0xa3932a;if(_0x2f9132[_0x1c7c('0x3a')][_0x1c7c('0x49')]){_0x1e681a['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x1c7c('0x4a')](_0x1e681a);})[_0x1c7c('0x1d')](function(_0x19258d){_0x24588c[_0x1c7c('0x4b')]=_0x19258d;return _0x24588c;})['then'](respondWithFilteredResult(_0x2e70c4,_0x1e681a))[_0x1c7c('0x4c')](handleError(_0x2e70c4,null));};exports[_0x1c7c('0x4d')]=function(_0x16af63,_0x267496){var _0x4149d0={'raw':!![],'where':{'id':_0x16af63[_0x1c7c('0x4e')]['id']}},_0x167bfd={};_0x167bfd[_0x1c7c('0x3d')]=_['keys'](db[_0x1c7c('0x4f')][_0x1c7c('0x50')]);_0x167bfd[_0x1c7c('0x3a')]=_[_0x1c7c('0x39')](_0x16af63['query']);_0x167bfd[_0x1c7c('0x3b')]=_[_0x1c7c('0x3c')](_0x167bfd['model'],_0x167bfd[_0x1c7c('0x3a')]);_0x4149d0[_0x1c7c('0x3e')]=_[_0x1c7c('0x3c')](_0x167bfd[_0x1c7c('0x3d')],qs[_0x1c7c('0x3f')](_0x16af63['query'][_0x1c7c('0x3f')]));_0x4149d0[_0x1c7c('0x3e')]=_0x4149d0['attributes'][_0x1c7c('0x40')]?_0x4149d0[_0x1c7c('0x3e')]:_0x167bfd[_0x1c7c('0x3d')];if(_0x16af63[_0x1c7c('0x3a')][_0x1c7c('0x49')]){_0x4149d0[_0x1c7c('0x51')]=[{'all':!![]}];}_0x4149d0=_['merge']({},_0x4149d0,_0x16af63[_0x1c7c('0x52')]);return db[_0x1c7c('0x4f')]['find'](_0x4149d0)[_0x1c7c('0x1d')](handleEntityNotFound(_0x267496,null))[_0x1c7c('0x1d')](respondWithResult(_0x267496,null))[_0x1c7c('0x4c')](handleError(_0x267496,null));};exports[_0x1c7c('0x53')]=function(_0x1f5fc0,_0x4920d8){return db[_0x1c7c('0x4f')][_0x1c7c('0x53')](_0x1f5fc0[_0x1c7c('0x54')],{})[_0x1c7c('0x1d')](respondWithResult(_0x4920d8,0xc9))[_0x1c7c('0x4c')](handleError(_0x4920d8,null));};exports['update']=function(_0x25bb01,_0x4629b7){if(_0x25bb01[_0x1c7c('0x54')]['id']){delete _0x25bb01[_0x1c7c('0x54')]['id'];}return db[_0x1c7c('0x4f')][_0x1c7c('0x55')]({'where':{'id':_0x25bb01['params']['id']}})[_0x1c7c('0x1d')](handleEntityNotFound(_0x4629b7,null))[_0x1c7c('0x1d')](saveUpdates(_0x25bb01['body'],null))[_0x1c7c('0x1d')](respondWithResult(_0x4629b7,null))[_0x1c7c('0x4c')](handleError(_0x4629b7,null));};exports[_0x1c7c('0x31')]=function(_0x5cfe90,_0x12d283){return db[_0x1c7c('0x4f')][_0x1c7c('0x55')]({'where':{'id':_0x5cfe90[_0x1c7c('0x4e')]['id']}})[_0x1c7c('0x1d')](handleEntityNotFound(_0x12d283,null))[_0x1c7c('0x1d')](removeEntity(_0x12d283,null))[_0x1c7c('0x4c')](handleError(_0x12d283,null));};exports[_0x1c7c('0x56')]=function(_0x340a4b,_0x480547){return db[_0x1c7c('0x4f')][_0x1c7c('0x56')]()[_0x1c7c('0x1d')](respondWithResult(_0x480547,null))[_0x1c7c('0x4c')](handleError(_0x480547,null));};var interaction_log=require(_0x1c7c('0x12'))(_0x1c7c('0x57'));exports[_0x1c7c('0x58')]=function(_0x4efb41,_0x440b8b,_0x3c69f5){var _0x331c83={'agent':{},'channel':_0x1c7c('0x59')};if(_0x4efb41[_0x1c7c('0x54')]['id']){delete _0x4efb41[_0x1c7c('0x54')]['id'];}_0x4efb41[_0x1c7c('0x54')][_0x1c7c('0x5a')]=!![];_0x4efb41[_0x1c7c('0x54')][_0x1c7c('0x5b')]=moment()[_0x1c7c('0x5c')](_0x1c7c('0x5d'));_0x4efb41[_0x1c7c('0x54')][_0x1c7c('0x5e')]=_0x4efb41[_0x1c7c('0x54')]['UserId']||_0x4efb41['user']['id'];_0x331c83[_0x1c7c('0x5f')]['id']=_0x4efb41['body'][_0x1c7c('0x5e')];return db[_0x1c7c('0x4f')][_0x1c7c('0x55')]({'where':{'id':_0x4efb41[_0x1c7c('0x4e')]['id'],'UserId':null}})[_0x1c7c('0x1d')](handleEntityNotFound(_0x440b8b,null))[_0x1c7c('0x1d')](saveUpdates(_0x4efb41[_0x1c7c('0x54')],null))[_0x1c7c('0x1d')](function(_0x2a536f){if(_0x2a536f){_0x331c83['message']=_0x2a536f[_0x1c7c('0x60')]({'plain':!![]});return db['WhatsappInteraction'][_0x1c7c('0x55')]({'where':{'id':_0x2a536f[_0x1c7c('0x61')]}});}return null;})[_0x1c7c('0x1d')](handleEntityNotFound(_0x440b8b,null))[_0x1c7c('0x1d')](function(_0x139275){if(_0x139275){return _0x139275[_0x1c7c('0x62')]({'UserId':_0x4efb41[_0x1c7c('0x54')][_0x1c7c('0x5e')],'read1stAt':_['isNil'](_0x139275[_0x1c7c('0x63')])?moment()[_0x1c7c('0x5c')](_0x1c7c('0x5d')):undefined});}return null;})[_0x1c7c('0x1d')](function(_0x3297da){if(_0x3297da){_0x331c83[_0x1c7c('0x64')]=_0x3297da[_0x1c7c('0x60')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4efb41[_0x1c7c('0x65')]['id'],_0x4efb41['user'][_0x1c7c('0x34')],_0x4efb41['user'][_0x1c7c('0x66')],_0x331c83[_0x1c7c('0x64')]['id'],_0x4efb41[_0x1c7c('0x54')]?JSON[_0x1c7c('0x22')](_0x4efb41[_0x1c7c('0x54')]):_0x1c7c('0x67'));return respondWithRpcPromise(_0x1c7c('0x68'),_0x1c7c('0x69'),_0x331c83);}return null;})[_0x1c7c('0x1d')](function(_0xf820f1){var _0x24b669=_0x1c7c('0x6a')+_0xf820f1[_0x1c7c('0x25')][_0x1c7c('0x6b')];return db[_0x1c7c('0x6c')][_0x1c7c('0x3a')](_0x24b669,{'type':db[_0x1c7c('0x6d')][_0x1c7c('0x6e')][_0x1c7c('0x6f')],'raw':!![]})[_0x1c7c('0x1d')](function(_0x149899){return _0x149899;});})[_0x1c7c('0x1d')](function(_0x14fcc7){if(_0x14fcc7){_0x331c83['message'][_0x1c7c('0x70')]=_0x14fcc7[0x0];if(!_0x4efb41[_0x1c7c('0x54')][_0x1c7c('0x5e')])return;return db[_0x1c7c('0x71')][_0x1c7c('0x55')]({'where':{'id':_0x4efb41['body'][_0x1c7c('0x5e')],'role':_0x1c7c('0x5f')},'attributes':['id',_0x1c7c('0x34'),'fullname',_0x1c7c('0x72'),_0x1c7c('0x73')],'raw':!![]});}return null;})[_0x1c7c('0x1d')](function(_0x3ec44a){if(!_0x3ec44a)return null;_0x331c83[_0x1c7c('0x25')]['agent']=_0x3ec44a;return _0x331c83;})[_0x1c7c('0x1d')](function(_0x632926){if(_0x632926){if(_0x4efb41[_0x1c7c('0x54')][_0x1c7c('0x74')]){_0x331c83[_0x1c7c('0x25')]['interface']=util[_0x1c7c('0x5c')]('SIP/%s',_0x4efb41[_0x1c7c('0x65')][_0x1c7c('0x34')]);_0x331c83[_0x1c7c('0x25')][_0x1c7c('0x75')]=_0x331c83[_0x1c7c('0x75')];_0x331c83[_0x1c7c('0x25')][_0x1c7c('0x76')]=_0x331c83['channel'];_0x331c83[_0x1c7c('0x25')][_0x1c7c('0x77')]=_0x1c7c('0x58');return respondWithRpcPromise(_0x1c7c('0x78'),'EventManager',{'event':_0x1c7c('0x79'),'message':_0x331c83['message']},client9002)[_0x1c7c('0x1d')](function(){return _0x331c83;});}return _0x331c83;}return null;})['then'](respondWithResult(_0x440b8b,null))['catch'](handleError(_0x440b8b,null));};var interaction_log=require(_0x1c7c('0x12'))(_0x1c7c('0x57'));exports['reject']=function(_0x4f9322,_0x35e046,_0x3c4236){var _0x25645e={'agent':{},'channel':_0x1c7c('0x59')};if(_0x4f9322['body']['id']){delete _0x4f9322['body']['id'];}_0x4f9322[_0x1c7c('0x54')][_0x1c7c('0x5e')]=_0x4f9322[_0x1c7c('0x54')]['UserId']||_0x4f9322[_0x1c7c('0x65')]['id'];_0x25645e[_0x1c7c('0x5f')]['id']=_0x4f9322[_0x1c7c('0x54')][_0x1c7c('0x5e')];return db[_0x1c7c('0x4f')][_0x1c7c('0x55')]({'where':{'id':_0x4f9322['params']['id'],'UserId':null}})[_0x1c7c('0x1d')](handleEntityNotFound(_0x35e046,null))['then'](function(_0x505e6e){if(_0x505e6e){_0x25645e[_0x1c7c('0x25')]=_0x505e6e[_0x1c7c('0x60')]({'plain':!![]});return db[_0x1c7c('0x7a')]['find']({'where':{'id':_0x505e6e[_0x1c7c('0x61')]}});}return null;})[_0x1c7c('0x1d')](handleEntityNotFound(_0x35e046,null))[_0x1c7c('0x1d')](function(_0x117a7d){if(_0x117a7d){_0x25645e['interaction']=_0x117a7d[_0x1c7c('0x60')]({'plain':!![]});interaction_log[_0x1c7c('0x1e')](_0x1c7c('0x7b'),_0x4f9322[_0x1c7c('0x65')]['id'],_0x4f9322['user'][_0x1c7c('0x34')],_0x4f9322[_0x1c7c('0x65')][_0x1c7c('0x66')],_0x25645e[_0x1c7c('0x64')]['id'],_0x4f9322[_0x1c7c('0x54')]?JSON[_0x1c7c('0x22')](_0x4f9322[_0x1c7c('0x54')]):_0x1c7c('0x67'));return respondWithRpcPromise('RejectMessage',_0x1c7c('0x7c'),_0x25645e);}return null;})[_0x1c7c('0x1d')](function(_0x52e696){var _0x5ddcc1=_0x1c7c('0x6a')+_0x52e696[_0x1c7c('0x25')][_0x1c7c('0x6b')];return db[_0x1c7c('0x6c')]['query'](_0x5ddcc1,{'type':db[_0x1c7c('0x6d')][_0x1c7c('0x6e')]['SELECT'],'raw':!![]})[_0x1c7c('0x1d')](function(_0x25fe88){return _0x25fe88;});})[_0x1c7c('0x1d')](function(_0x8b953a){if(_0x8b953a){_0x25645e[_0x1c7c('0x25')][_0x1c7c('0x70')]=_0x8b953a[0x0];if(!_0x4f9322[_0x1c7c('0x54')]['UserId'])return;return db['User'][_0x1c7c('0x55')]({'where':{'id':_0x4f9322[_0x1c7c('0x54')]['UserId'],'role':_0x1c7c('0x5f')},'attributes':['id','name',_0x1c7c('0x7d'),_0x1c7c('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x10461d){if(!_0x10461d)return null;_0x25645e['message'][_0x1c7c('0x5f')]=_0x10461d;return _0x25645e;})[_0x1c7c('0x1d')](function(_0x206596){if(_0x206596){_0x206596[_0x1c7c('0x25')][_0x1c7c('0x7e')]=util[_0x1c7c('0x5c')]('SIP/%s',_0x4f9322[_0x1c7c('0x65')][_0x1c7c('0x34')]);_0x206596[_0x1c7c('0x25')][_0x1c7c('0x75')]=_0x25645e[_0x1c7c('0x75')];_0x206596[_0x1c7c('0x25')][_0x1c7c('0x76')]=_0x25645e[_0x1c7c('0x75')];_0x206596[_0x1c7c('0x25')]['event']=_0x1c7c('0x2f');respondWithRpcPromise(_0x1c7c('0x78'),_0x1c7c('0x78'),{'event':_0x1c7c('0x7f'),'message':_0x206596['message']},client9002);return _0x25645e;}return null;})['then'](respondWithResult(_0x35e046,null))['catch'](handleError(_0x35e046,null));};exports[_0x1c7c('0x2b')]=function(_0xaf0e4d,_0x445b88,_0x5081d9){if(_0xaf0e4d[_0x1c7c('0x54')]['id']){delete _0xaf0e4d[_0x1c7c('0x54')]['id'];}var _0x240022;return db[_0x1c7c('0x4f')][_0x1c7c('0x55')]({'where':{'id':_0xaf0e4d['params']['id']}})[_0x1c7c('0x1d')](handleEntityNotFound(_0x445b88,null))[_0x1c7c('0x1d')](function(_0x4e4d29){if(_0x4e4d29){_0x240022=_0x4e4d29;return db[_0x1c7c('0x80')][_0x1c7c('0x55')]({'where':{'id':_0x4e4d29[_0x1c7c('0x81')]}});}})['then'](handleEntityNotFound(_0x445b88,null))[_0x1c7c('0x1d')](function(_0x594cb3){if(_0x594cb3){logger[_0x1c7c('0x20')](_0x1c7c('0x82'),_0x1c7c('0x2b'),_0x1c7c('0x83'),_0x594cb3[_0x1c7c('0x36')],util[_0x1c7c('0x84')](_0xaf0e4d['body'],{'showHidden':![],'depth':null}));switch(_0x594cb3['type']){case _0x1c7c('0x85'):if(_0xaf0e4d[_0x1c7c('0x54')][_0x1c7c('0x86')]&&_0xaf0e4d[_0x1c7c('0x54')][_0x1c7c('0x86')]===_0x240022[_0x1c7c('0x87')]&&_0xaf0e4d[_0x1c7c('0x54')]['MessageStatus']&&_0xaf0e4d[_0x1c7c('0x54')][_0x1c7c('0x88')]===_0x1c7c('0x5a')){return _0x240022[_0x1c7c('0x62')]({'read':!![]});}else{logger[_0x1c7c('0x23')](_0x1c7c('0x89'),_0x1c7c('0x2b'),_0x1c7c('0x85'),util['inspect'](_0xaf0e4d['body'],{'showHidden':![],'depth':null}));}break;}return _0x240022;}})[_0x1c7c('0x1d')](respondWithResult(_0x445b88,null))[_0x1c7c('0x4c')](handleError(_0x445b88,null));}; \ No newline at end of file +var _0x3b7b=['message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','name','send','index','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','rows','show','keys','find','create','body','params','describe','../../config/logger','whatsapp-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','whatsapp','get','RejectMessage','rejectMessage','QueryTypes','motionChannel','WhatsappAccount','WhatsappAccountId','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','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x19da96,_0x5d6343){var _0x5b98bd=function(_0x5cd4df){while(--_0x5cd4df){_0x19da96['push'](_0x19da96['shift']());}};_0x5b98bd(++_0x5d6343);}(_0x3b7b,0xf3));var _0xb3b7=function(_0x407f58,_0x3da3e7){_0x407f58=_0x407f58-0x0;var _0x304ed3=_0x3b7b[_0x407f58];return _0x304ed3;};'use strict';var emlformat=require(_0xb3b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3b7('0x1'));var jsonpatch=require(_0xb3b7('0x2'));var rp=require(_0xb3b7('0x3'));var moment=require(_0xb3b7('0x4'));var BPromise=require(_0xb3b7('0x5'));var Mustache=require(_0xb3b7('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb3b7('0x7'));var csv=require(_0xb3b7('0x8'));var ejs=require(_0xb3b7('0x9'));var fs=require('fs');var fs_extra=require(_0xb3b7('0xa'));var _=require(_0xb3b7('0xb'));var squel=require('squel');var crypto=require(_0xb3b7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb3b7('0xd'));var toCsv=require(_0xb3b7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb3b7('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb3b7('0xf'));var hardwareService=require(_0xb3b7('0x10'));var logger=require('../../config/logger')(_0xb3b7('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb3b7('0x12')]=_[_0xb3b7('0x13')](config[_0xb3b7('0x12')],{'host':_0xb3b7('0x14'),'port':0x18eb});var socket=require(_0xb3b7('0x15'))(new Redis(config['redis']));require(_0xb3b7('0x16'))[_0xb3b7('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb3b7('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xb3b7('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301053,_0x9de4ee,_0x85ad53,_0x56f02d){return new BPromise(function(_0x90ca63,_0x2647af){var _0x496cf0=_0x56f02d||client;return _0x496cf0[_0xb3b7('0x19')](_0x301053,_0x85ad53)[_0xb3b7('0x1a')](function(_0x2ac3b9){logger['info'](_0xb3b7('0x1b'),_0x9de4ee,_0xb3b7('0x1c'));logger[_0xb3b7('0x1d')](_0xb3b7('0x1e'),_0x9de4ee,_0xb3b7('0x1c'),JSON['stringify'](_0x2ac3b9));if(_0x2ac3b9[_0xb3b7('0x1f')]){if(_0x2ac3b9['error'][_0xb3b7('0x20')]===0x1f4){logger['error'](_0xb3b7('0x1b'),_0x9de4ee,_0x2ac3b9[_0xb3b7('0x1f')][_0xb3b7('0x21')]);return _0x2647af(_0x2ac3b9[_0xb3b7('0x1f')][_0xb3b7('0x21')]);}logger[_0xb3b7('0x1f')](_0xb3b7('0x1b'),_0x9de4ee,_0x2ac3b9[_0xb3b7('0x1f')][_0xb3b7('0x21')]);return _0x90ca63(_0x2ac3b9[_0xb3b7('0x1f')][_0xb3b7('0x21')]);}else{logger[_0xb3b7('0x22')](_0xb3b7('0x1b'),_0x9de4ee,_0xb3b7('0x1c'));_0x90ca63(_0x2ac3b9[_0xb3b7('0x23')][_0xb3b7('0x21')]);}})[_0xb3b7('0x24')](function(_0x551df7){logger['error'](_0xb3b7('0x1b'),_0x9de4ee,_0x551df7);_0x2647af(_0x551df7);});});}function respondWithStatusCode(_0x2ab666,_0x4db864){_0x4db864=_0x4db864||0xcc;return function(_0x12ac03){if(_0x12ac03){return _0x2ab666[_0xb3b7('0x25')](_0x4db864);}return _0x2ab666[_0xb3b7('0x26')](_0x4db864)[_0xb3b7('0x27')]();};}function respondWithResult(_0x5d0bb8,_0x4d0dd3){_0x4d0dd3=_0x4d0dd3||0xc8;return function(_0x180e1e){if(_0x180e1e){return _0x5d0bb8[_0xb3b7('0x26')](_0x4d0dd3)[_0xb3b7('0x28')](_0x180e1e);}};}function respondWithFilteredResult(_0x1fe3c1,_0x376d80){return function(_0x1352be){if(_0x1352be){var _0x45159d=typeof _0x376d80[_0xb3b7('0x29')]===_0xb3b7('0x2a')&&typeof _0x376d80[_0xb3b7('0x2b')]===_0xb3b7('0x2a');var _0x41fd94=_0x1352be['count'];var _0x13661e=_0x45159d?0x0:_0x376d80[_0xb3b7('0x29')];var _0x46f54e=_0x45159d?_0x1352be[_0xb3b7('0x2c')]:_0x376d80['offset']+_0x376d80[_0xb3b7('0x2b')];var _0xe4fa38;if(_0x46f54e>=_0x41fd94){_0x46f54e=_0x41fd94;_0xe4fa38=0xc8;}else{_0xe4fa38=0xce;}_0x1fe3c1[_0xb3b7('0x26')](_0xe4fa38);return _0x1fe3c1['set'](_0xb3b7('0x2d'),_0x13661e+'-'+_0x46f54e+'/'+_0x41fd94)[_0xb3b7('0x28')](_0x1352be);}return null;};}function patchUpdates(_0x2e6a49){return function(_0x49aa7b){try{jsonpatch[_0xb3b7('0x2e')](_0x49aa7b,_0x2e6a49,!![]);}catch(_0x1e56d2){return BPromise[_0xb3b7('0x2f')](_0x1e56d2);}return _0x49aa7b[_0xb3b7('0x30')]();};}function saveUpdates(_0x3933d2,_0x3528a){return function(_0x1d10a1){if(_0x1d10a1){return _0x1d10a1[_0xb3b7('0x31')](_0x3933d2)[_0xb3b7('0x1a')](function(_0x2dea00){return _0x2dea00;});}return null;};}function removeEntity(_0x199e3b,_0x1a11f9){return function(_0x322327){if(_0x322327){return _0x322327[_0xb3b7('0x32')]()[_0xb3b7('0x1a')](function(){_0x199e3b['status'](0xcc)[_0xb3b7('0x27')]();});}};}function handleEntityNotFound(_0x1d5462,_0x31140f){return function(_0x1e34de){if(!_0x1e34de){_0x1d5462[_0xb3b7('0x25')](0x194);}return _0x1e34de;};}function handleError(_0x27ccee,_0x4abea6){_0x4abea6=_0x4abea6||0x1f4;return function(_0x13c47e){logger['error'](_0x13c47e['stack']);if(_0x13c47e[_0xb3b7('0x33')]){delete _0x13c47e['name'];}_0x27ccee['status'](_0x4abea6)[_0xb3b7('0x34')](_0x13c47e);};}exports[_0xb3b7('0x35')]=function(_0x3dd9fa,_0x258dc0){var _0xf0716f={},_0xb741d={},_0x56534f={'count':0x0,'rows':[]};var _0x50f6c9=_['map'](db['WhatsappMessage'][_0xb3b7('0x36')],function(_0x24b617){return{'name':_0x24b617[_0xb3b7('0x37')],'type':_0x24b617[_0xb3b7('0x38')][_0xb3b7('0x39')]};});_0xb741d[_0xb3b7('0x3a')]=_['map'](_0x50f6c9,_0xb3b7('0x33'));_0xb741d[_0xb3b7('0x3b')]=_['keys'](_0x3dd9fa[_0xb3b7('0x3b')]);_0xb741d['filters']=_['intersection'](_0xb741d[_0xb3b7('0x3a')],_0xb741d[_0xb3b7('0x3b')]);_0xf0716f[_0xb3b7('0x3c')]=_[_0xb3b7('0x3d')](_0xb741d[_0xb3b7('0x3a')],qs[_0xb3b7('0x3e')](_0x3dd9fa[_0xb3b7('0x3b')][_0xb3b7('0x3e')]));_0xf0716f[_0xb3b7('0x3c')]=_0xf0716f[_0xb3b7('0x3c')][_0xb3b7('0x3f')]?_0xf0716f[_0xb3b7('0x3c')]:_0xb741d[_0xb3b7('0x3a')];if(!_0x3dd9fa[_0xb3b7('0x3b')][_0xb3b7('0x40')](_0xb3b7('0x41'))){_0xf0716f[_0xb3b7('0x2b')]=qs[_0xb3b7('0x2b')](_0x3dd9fa[_0xb3b7('0x3b')][_0xb3b7('0x2b')]);_0xf0716f['offset']=qs[_0xb3b7('0x29')](_0x3dd9fa[_0xb3b7('0x3b')][_0xb3b7('0x29')]);}_0xf0716f[_0xb3b7('0x42')]=qs[_0xb3b7('0x43')](_0x3dd9fa[_0xb3b7('0x3b')]['sort']);_0xf0716f[_0xb3b7('0x44')]=qs[_0xb3b7('0x45')](_[_0xb3b7('0x46')](_0x3dd9fa[_0xb3b7('0x3b')],_0xb741d['filters']),_0x50f6c9);if(_0x3dd9fa['query'][_0xb3b7('0x47')]){_0xf0716f[_0xb3b7('0x44')]=_[_0xb3b7('0x48')](_0xf0716f[_0xb3b7('0x44')],{'$or':_[_0xb3b7('0x49')](_0x50f6c9,function(_0xb32b5c){if(_0xb32b5c[_0xb3b7('0x38')]!==_0xb3b7('0x4a')){var _0x2040f6={};_0x2040f6[_0xb32b5c['name']]={'$like':'%'+_0x3dd9fa[_0xb3b7('0x3b')][_0xb3b7('0x47')]+'%'};return _0x2040f6;}})});}_0xf0716f=_[_0xb3b7('0x48')]({},_0xf0716f,_0x3dd9fa[_0xb3b7('0x4b')]);var _0x4fa8ff={'where':_0xf0716f[_0xb3b7('0x44')]};return db[_0xb3b7('0x4c')]['count'](_0x4fa8ff)[_0xb3b7('0x1a')](function(_0x467554){_0x56534f[_0xb3b7('0x2c')]=_0x467554;if(_0x3dd9fa[_0xb3b7('0x3b')][_0xb3b7('0x4d')]){_0xf0716f[_0xb3b7('0x4e')]=[{'all':!![]}];}return db[_0xb3b7('0x4c')][_0xb3b7('0x4f')](_0xf0716f);})['then'](function(_0x34fc79){_0x56534f[_0xb3b7('0x50')]=_0x34fc79;return _0x56534f;})[_0xb3b7('0x1a')](respondWithFilteredResult(_0x258dc0,_0xf0716f))[_0xb3b7('0x24')](handleError(_0x258dc0,null));};exports[_0xb3b7('0x51')]=function(_0x5748dc,_0x1c63e8){var _0x1a8736={'raw':!![],'where':{'id':_0x5748dc['params']['id']}},_0x4f874c={};_0x4f874c[_0xb3b7('0x3a')]=_['keys'](db['WhatsappMessage'][_0xb3b7('0x36')]);_0x4f874c[_0xb3b7('0x3b')]=_[_0xb3b7('0x52')](_0x5748dc[_0xb3b7('0x3b')]);_0x4f874c[_0xb3b7('0x45')]=_[_0xb3b7('0x3d')](_0x4f874c[_0xb3b7('0x3a')],_0x4f874c[_0xb3b7('0x3b')]);_0x1a8736[_0xb3b7('0x3c')]=_[_0xb3b7('0x3d')](_0x4f874c[_0xb3b7('0x3a')],qs['fields'](_0x5748dc[_0xb3b7('0x3b')][_0xb3b7('0x3e')]));_0x1a8736['attributes']=_0x1a8736['attributes']['length']?_0x1a8736[_0xb3b7('0x3c')]:_0x4f874c[_0xb3b7('0x3a')];if(_0x5748dc[_0xb3b7('0x3b')]['includeAll']){_0x1a8736[_0xb3b7('0x4e')]=[{'all':!![]}];}_0x1a8736=_[_0xb3b7('0x48')]({},_0x1a8736,_0x5748dc[_0xb3b7('0x4b')]);return db[_0xb3b7('0x4c')][_0xb3b7('0x53')](_0x1a8736)['then'](handleEntityNotFound(_0x1c63e8,null))[_0xb3b7('0x1a')](respondWithResult(_0x1c63e8,null))[_0xb3b7('0x24')](handleError(_0x1c63e8,null));};exports[_0xb3b7('0x54')]=function(_0x1175b9,_0x51a7a4){return db[_0xb3b7('0x4c')]['create'](_0x1175b9[_0xb3b7('0x55')],{})['then'](respondWithResult(_0x51a7a4,0xc9))[_0xb3b7('0x24')](handleError(_0x51a7a4,null));};exports[_0xb3b7('0x31')]=function(_0x571f35,_0x13ed4d){if(_0x571f35[_0xb3b7('0x55')]['id']){delete _0x571f35[_0xb3b7('0x55')]['id'];}return db[_0xb3b7('0x4c')][_0xb3b7('0x53')]({'where':{'id':_0x571f35[_0xb3b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x13ed4d,null))[_0xb3b7('0x1a')](saveUpdates(_0x571f35['body'],null))[_0xb3b7('0x1a')](respondWithResult(_0x13ed4d,null))[_0xb3b7('0x24')](handleError(_0x13ed4d,null));};exports['destroy']=function(_0xf53c75,_0x5b7d99){return db[_0xb3b7('0x4c')][_0xb3b7('0x53')]({'where':{'id':_0xf53c75[_0xb3b7('0x56')]['id']}})['then'](handleEntityNotFound(_0x5b7d99,null))[_0xb3b7('0x1a')](removeEntity(_0x5b7d99,null))[_0xb3b7('0x24')](handleError(_0x5b7d99,null));};exports[_0xb3b7('0x57')]=function(_0x19c521,_0x2c78d8){return db['WhatsappMessage'][_0xb3b7('0x57')]()['then'](respondWithResult(_0x2c78d8,null))[_0xb3b7('0x24')](handleError(_0x2c78d8,null));};var interaction_log=require(_0xb3b7('0x58'))(_0xb3b7('0x59'));exports[_0xb3b7('0x5a')]=function(_0x2bc15c,_0x4abb95,_0xba8314){var _0x6c966b={'agent':{},'channel':'whatsapp'};if(_0x2bc15c[_0xb3b7('0x55')]['id']){delete _0x2bc15c['body']['id'];}_0x2bc15c[_0xb3b7('0x55')][_0xb3b7('0x5b')]=!![];_0x2bc15c[_0xb3b7('0x55')]['readAt']=moment()[_0xb3b7('0x5c')](_0xb3b7('0x5d'));_0x2bc15c[_0xb3b7('0x55')][_0xb3b7('0x5e')]=_0x2bc15c[_0xb3b7('0x55')][_0xb3b7('0x5e')]||_0x2bc15c[_0xb3b7('0x5f')]['id'];_0x6c966b[_0xb3b7('0x60')]['id']=_0x2bc15c[_0xb3b7('0x55')][_0xb3b7('0x5e')];return db[_0xb3b7('0x4c')][_0xb3b7('0x53')]({'where':{'id':_0x2bc15c['params']['id'],'UserId':null}})[_0xb3b7('0x1a')](handleEntityNotFound(_0x4abb95,null))[_0xb3b7('0x1a')](saveUpdates(_0x2bc15c['body'],null))['then'](function(_0x15ed8c){if(_0x15ed8c){_0x6c966b[_0xb3b7('0x21')]=_0x15ed8c['get']({'plain':!![]});return db[_0xb3b7('0x61')][_0xb3b7('0x53')]({'where':{'id':_0x15ed8c[_0xb3b7('0x62')]}});}return null;})[_0xb3b7('0x1a')](handleEntityNotFound(_0x4abb95,null))[_0xb3b7('0x1a')](function(_0x3129b2){if(_0x3129b2){return _0x3129b2['update']({'UserId':_0x2bc15c[_0xb3b7('0x55')][_0xb3b7('0x5e')],'read1stAt':_[_0xb3b7('0x63')](_0x3129b2[_0xb3b7('0x64')])?moment()[_0xb3b7('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb3b7('0x1a')](function(_0x381248){if(_0x381248){_0x6c966b[_0xb3b7('0x65')]=_0x381248['get']({'plain':!![]});interaction_log[_0xb3b7('0x22')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bc15c['user']['id'],_0x2bc15c[_0xb3b7('0x5f')][_0xb3b7('0x33')],_0x2bc15c['user'][_0xb3b7('0x66')],_0x6c966b['interaction']['id'],_0x2bc15c[_0xb3b7('0x55')]?JSON[_0xb3b7('0x67')](_0x2bc15c[_0xb3b7('0x55')]):_0xb3b7('0x68'));return respondWithRpcPromise('AcceptMessage',_0xb3b7('0x69'),_0x6c966b);}return null;})[_0xb3b7('0x1a')](function(_0x5b1a69){var _0x3a9e0e=_0xb3b7('0x6a')+_0x5b1a69[_0xb3b7('0x21')][_0xb3b7('0x6b')];return db[_0xb3b7('0x6c')]['query'](_0x3a9e0e,{'type':db[_0xb3b7('0x6d')]['QueryTypes'][_0xb3b7('0x6e')],'raw':!![]})[_0xb3b7('0x1a')](function(_0x10d5cb){return _0x10d5cb;});})[_0xb3b7('0x1a')](function(_0x1d7f6c){if(_0x1d7f6c){_0x6c966b[_0xb3b7('0x21')][_0xb3b7('0x6f')]=_0x1d7f6c[0x0];if(!_0x2bc15c[_0xb3b7('0x55')][_0xb3b7('0x5e')])return;return db[_0xb3b7('0x70')][_0xb3b7('0x53')]({'where':{'id':_0x2bc15c[_0xb3b7('0x55')]['UserId'],'role':_0xb3b7('0x60')},'attributes':['id',_0xb3b7('0x33'),_0xb3b7('0x71'),_0xb3b7('0x72'),_0xb3b7('0x73')],'raw':!![]});}return null;})[_0xb3b7('0x1a')](function(_0x5dc12e){if(!_0x5dc12e)return null;_0x6c966b[_0xb3b7('0x21')]['agent']=_0x5dc12e;return _0x6c966b;})[_0xb3b7('0x1a')](function(_0x40cfef){if(_0x40cfef){if(_0x2bc15c['body'][_0xb3b7('0x74')]){_0x6c966b[_0xb3b7('0x21')][_0xb3b7('0x75')]=util['format'](_0xb3b7('0x76'),_0x2bc15c[_0xb3b7('0x5f')][_0xb3b7('0x33')]);_0x6c966b[_0xb3b7('0x21')][_0xb3b7('0x77')]=_0x6c966b[_0xb3b7('0x77')];_0x6c966b[_0xb3b7('0x21')]['motionChannel']=_0x6c966b[_0xb3b7('0x77')];_0x6c966b[_0xb3b7('0x21')][_0xb3b7('0x78')]=_0xb3b7('0x5a');return respondWithRpcPromise(_0xb3b7('0x79'),_0xb3b7('0x79'),{'event':'acceptmessage','message':_0x6c966b[_0xb3b7('0x21')]},client9002)[_0xb3b7('0x1a')](function(){return _0x6c966b;});}return _0x6c966b;}return null;})[_0xb3b7('0x1a')](respondWithResult(_0x4abb95,null))['catch'](handleError(_0x4abb95,null));};var interaction_log=require(_0xb3b7('0x58'))(_0xb3b7('0x59'));exports[_0xb3b7('0x2f')]=function(_0x5e323a,_0x3c545f,_0x692968){var _0x492850={'agent':{},'channel':_0xb3b7('0x7a')};if(_0x5e323a[_0xb3b7('0x55')]['id']){delete _0x5e323a[_0xb3b7('0x55')]['id'];}_0x5e323a[_0xb3b7('0x55')]['UserId']=_0x5e323a[_0xb3b7('0x55')][_0xb3b7('0x5e')]||_0x5e323a[_0xb3b7('0x5f')]['id'];_0x492850['agent']['id']=_0x5e323a[_0xb3b7('0x55')][_0xb3b7('0x5e')];return db[_0xb3b7('0x4c')][_0xb3b7('0x53')]({'where':{'id':_0x5e323a[_0xb3b7('0x56')]['id'],'UserId':null}})[_0xb3b7('0x1a')](handleEntityNotFound(_0x3c545f,null))[_0xb3b7('0x1a')](function(_0x32841d){if(_0x32841d){_0x492850[_0xb3b7('0x21')]=_0x32841d[_0xb3b7('0x7b')]({'plain':!![]});return db[_0xb3b7('0x61')][_0xb3b7('0x53')]({'where':{'id':_0x32841d[_0xb3b7('0x62')]}});}return null;})[_0xb3b7('0x1a')](handleEntityNotFound(_0x3c545f,null))[_0xb3b7('0x1a')](function(_0x23d14c){if(_0x23d14c){_0x492850['interaction']=_0x23d14c[_0xb3b7('0x7b')]({'plain':!![]});interaction_log[_0xb3b7('0x22')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e323a[_0xb3b7('0x5f')]['id'],_0x5e323a['user'][_0xb3b7('0x33')],_0x5e323a[_0xb3b7('0x5f')][_0xb3b7('0x66')],_0x492850[_0xb3b7('0x65')]['id'],_0x5e323a[_0xb3b7('0x55')]?JSON[_0xb3b7('0x67')](_0x5e323a['body']):_0xb3b7('0x68'));return respondWithRpcPromise(_0xb3b7('0x7c'),_0xb3b7('0x7d'),_0x492850);}return null;})[_0xb3b7('0x1a')](function(_0x1362c6){var _0x55d7ef='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1362c6[_0xb3b7('0x21')][_0xb3b7('0x6b')];return db['sequelize'][_0xb3b7('0x3b')](_0x55d7ef,{'type':db[_0xb3b7('0x6d')][_0xb3b7('0x7e')][_0xb3b7('0x6e')],'raw':!![]})[_0xb3b7('0x1a')](function(_0x26cbd6){return _0x26cbd6;});})[_0xb3b7('0x1a')](function(_0x717772){if(_0x717772){_0x492850[_0xb3b7('0x21')][_0xb3b7('0x6f')]=_0x717772[0x0];if(!_0x5e323a[_0xb3b7('0x55')][_0xb3b7('0x5e')])return;return db[_0xb3b7('0x70')]['find']({'where':{'id':_0x5e323a[_0xb3b7('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0xb3b7('0x33'),_0xb3b7('0x71'),_0xb3b7('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x57996e){if(!_0x57996e)return null;_0x492850[_0xb3b7('0x21')][_0xb3b7('0x60')]=_0x57996e;return _0x492850;})[_0xb3b7('0x1a')](function(_0x3fa120){if(_0x3fa120){_0x3fa120[_0xb3b7('0x21')][_0xb3b7('0x75')]=util[_0xb3b7('0x5c')](_0xb3b7('0x76'),_0x5e323a[_0xb3b7('0x5f')][_0xb3b7('0x33')]);_0x3fa120[_0xb3b7('0x21')][_0xb3b7('0x77')]=_0x492850[_0xb3b7('0x77')];_0x3fa120[_0xb3b7('0x21')][_0xb3b7('0x7f')]=_0x492850[_0xb3b7('0x77')];_0x3fa120['message'][_0xb3b7('0x78')]=_0xb3b7('0x2f');respondWithRpcPromise(_0xb3b7('0x79'),_0xb3b7('0x79'),{'event':'rejectmessage','message':_0x3fa120[_0xb3b7('0x21')]},client9002);return _0x492850;}return null;})[_0xb3b7('0x1a')](respondWithResult(_0x3c545f,null))[_0xb3b7('0x24')](handleError(_0x3c545f,null));};exports[_0xb3b7('0x26')]=function(_0x3c50a0,_0x25ba48,_0x52ca72){if(_0x3c50a0[_0xb3b7('0x55')]['id']){delete _0x3c50a0[_0xb3b7('0x55')]['id'];}var _0x8f7275;return db[_0xb3b7('0x4c')][_0xb3b7('0x53')]({'where':{'id':_0x3c50a0[_0xb3b7('0x56')]['id']}})[_0xb3b7('0x1a')](handleEntityNotFound(_0x25ba48,null))[_0xb3b7('0x1a')](function(_0x3df26e){if(_0x3df26e){_0x8f7275=_0x3df26e;return db[_0xb3b7('0x80')][_0xb3b7('0x53')]({'where':{'id':_0x3df26e[_0xb3b7('0x81')]}});}})[_0xb3b7('0x1a')](handleEntityNotFound(_0x25ba48,null))[_0xb3b7('0x1a')](function(_0x1bfcc0){if(_0x1bfcc0){logger[_0xb3b7('0x1d')](_0xb3b7('0x82'),_0xb3b7('0x26'),_0xb3b7('0x83'),_0x1bfcc0[_0xb3b7('0x38')],util[_0xb3b7('0x84')](_0x3c50a0[_0xb3b7('0x55')],{'showHidden':![],'depth':null}));switch(_0x1bfcc0['type']){case _0xb3b7('0x85'):if(_0x3c50a0['body']['MessageSid']&&_0x3c50a0[_0xb3b7('0x55')][_0xb3b7('0x86')]===_0x8f7275[_0xb3b7('0x87')]&&_0x3c50a0[_0xb3b7('0x55')][_0xb3b7('0x88')]&&_0x3c50a0[_0xb3b7('0x55')][_0xb3b7('0x88')]==='read'){return _0x8f7275[_0xb3b7('0x31')]({'read':!![]});}else{logger['error'](_0xb3b7('0x89'),_0xb3b7('0x26'),'twilio',util[_0xb3b7('0x84')](_0x3c50a0[_0xb3b7('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x8f7275;}})['then'](respondWithResult(_0x25ba48,null))[_0xb3b7('0x24')](handleError(_0x25ba48,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 58bf8d1..65178a8 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 _0x00b3=['../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x385359,_0x325c57){var _0x2ea4dd=function(_0x1bcf4f){while(--_0x1bcf4f){_0x385359['push'](_0x385359['shift']());}};_0x2ea4dd(++_0x325c57);}(_0x00b3,0x17a));var _0x300b=function(_0x50d391,_0x4894ef){_0x50d391=_0x50d391-0x0;var _0x3042d7=_0x00b3[_0x50d391];return _0x3042d7;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x300b('0x0'))['db'][_0x300b('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x300b('0x2')](0x0);var events={'afterCreate':_0x300b('0x3'),'afterUpdate':'update','afterDestroy':_0x300b('0x4')};function emitEvent(_0x534310){return function(_0x245c32,_0x524b8d,_0x1be801){WhatsappMessageEvents[_0x300b('0x5')](_0x534310+':'+_0x245c32['id'],_0x245c32);WhatsappMessageEvents[_0x300b('0x5')](_0x534310,_0x245c32);_0x1be801(null);};}for(var e in events){if(events[_0x300b('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xa571=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','emit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa571,0x107));var _0x1a57=function(_0x4f4a36,_0x371b5d){_0x4f4a36=_0x4f4a36-0x0;var _0x3fd9e4=_0xa571[_0x4f4a36];return _0x3fd9e4;};'use strict';var EventEmitter=require(_0x1a57('0x0'));var WhatsappMessage=require(_0x1a57('0x1'))['db'][_0x1a57('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x1a57('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a57('0x4'),'afterDestroy':_0x1a57('0x5')};function emitEvent(_0x4d5f7a){return function(_0x5ec815,_0x1f2c44,_0x5067fa){WhatsappMessageEvents[_0x1a57('0x6')](_0x4d5f7a+':'+_0x5ec815['id'],_0x5ec815);WhatsappMessageEvents[_0x1a57('0x6')](_0x4d5f7a,_0x5ec815);_0x5067fa(null);};}for(var e in events){if(events[_0x1a57('0x7')](e)){var event=events[e];WhatsappMessage[_0x1a57('0x8')](e,emitEvent(event));}}module[_0x1a57('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 4b4e982..1c73c35 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 _0x0799=['then','update','createdAt','error','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','phone','messages','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','accountSid','authToken','text','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','moment','rimraf','../../config/environment','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','out','isNil','UserId','WhatsappInteraction','WhatsappInteractionId'];(function(_0x2f5c26,_0x23eee8){var _0x2fcfd8=function(_0x40fc09){while(--_0x40fc09){_0x2f5c26['push'](_0x2f5c26['shift']());}};_0x2fcfd8(++_0x23eee8);}(_0x0799,0x125));var _0x9079=function(_0x8b631b,_0x386724){_0x8b631b=_0x8b631b-0x0;var _0x3e6832=_0x0799[_0x8b631b];return _0x3e6832;};'use strict';var _=require(_0x9079('0x0'));var util=require(_0x9079('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9079('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require('path');var rimraf=require(_0x9079('0x3'));var config=require(_0x9079('0x4'));var attributes=require('./whatsappMessage.attributes');module[_0x9079('0x5')]=function(_0x3f6657,_0x490300){return _0x3f6657[_0x9079('0x6')](_0x9079('0x7'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x9079('0x8'),'fields':[_0x9079('0x8')]},{'name':_0x9079('0x9'),'fields':[_0x9079('0xa')],'type':_0x9079('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x330151,_0x4c5d83,_0x3ba3cf){var _0x5e1ee1=_0x3f6657['models'];var _0x564678=_0x330151[_0x9079('0xc')]({'plain':!![]});if(_0x564678[_0x9079('0xd')]['toLowerCase']()==='in'||_0x564678[_0x9079('0xd')]['toLowerCase']()===_0x9079('0xe')&&!_0x564678['secret']&&!_[_0x9079('0xf')](_0x564678[_0x9079('0x10')])){_0x5e1ee1[_0x9079('0x11')]['findOne']({'where':{'id':_0x564678[_0x9079('0x12')]}})[_0x9079('0x13')](function(_0x31b978){if(_0x31b978){_0x31b978[_0x9079('0x14')]({'lastMsgAt':_0x564678[_0x9079('0x15')],'lastMsgDirection':_0x564678[_0x9079('0xd')]['toLowerCase']()});}})['catch'](function(_0x227b4c){console[_0x9079('0x16')](_0x227b4c);});}if(_0x564678['direction']===_0x9079('0xe')&&!_0x564678[_0x9079('0x17')]){var _0x339b19;_0x5e1ee1[_0x9079('0x18')][_0x9079('0x19')]({'where':{'id':_0x564678[_0x9079('0x1a')]},'raw':!![]})[_0x9079('0x13')](function(_0x3c0197){_0x339b19=_0x3c0197;if(_0x339b19&&_0x339b19[_0x9079('0x1b')]){switch(_0x339b19[_0x9079('0x1b')]){case'twilio':var _0x382cfd=require(_0x9079('0x1c'));if(_0x339b19['accountSid']&&_0x339b19['authToken']&&_0x339b19[_0x9079('0x1d')]){var _0x10e8de=new _0x382cfd(_0x339b19['accountSid'],_0x339b19['authToken']);_0x10e8de[_0x9079('0x1e')]['create']({'body':_0x564678[_0x9079('0xa')],'to':_0x9079('0x1f')+_0x564678[_0x9079('0x1d')],'from':'whatsapp:'+_0x339b19[_0x9079('0x1d')],'statusCallback':_0x339b19['remote']+_0x9079('0x20')+_0x564678['id']+_0x9079('0x21')+_0x339b19[_0x9079('0x22')]})[_0x9079('0x13')](function(_0x38fbc7){if(_0x38fbc7[_0x9079('0x23')]){return _0x330151[_0x9079('0x14')]({'messageId':_0x38fbc7[_0x9079('0x23')]});}})[_0x9079('0x24')](function(_0x3354b7){logger[_0x9079('0x16')](_0x9079('0x25'),_0x9079('0x26'),'twilio',util[_0x9079('0x27')](_0x3354b7,{'showHidden':![],'depth':null}));});}else{logger[_0x9079('0x16')](_0x9079('0x25'),_0x9079('0x26'),_0x9079('0x1c'),_0x9079('0x28'));}break;case'sinch':var _0x2086d4=_0x339b19[_0x9079('0x29')];var _0x15d3a8=_0x339b19[_0x9079('0x2a')];var _0x355731=_0x339b19['baseUrl']+'/whatsapp/v1/'+_0x2086d4+'/messages/';var _0x5d833e={'to':[_0x564678['phone']],'message':{'type':_0x9079('0x2b'),'text':_0x564678['body']}};var _0xcbf3da={'method':_0x9079('0x2c'),'uri':_0x355731,'headers':{'Authorization':'Bearer\x20'+_0x15d3a8,'Content-Type':_0x9079('0x2d')},'body':_0x5d833e,'json':!![]};rp(_0xcbf3da)[_0x9079('0x13')](function(_0x434467){if(_0x434467[_0x9079('0x2e')][0x0][_0x9079('0x2f')]){return _0x330151[_0x9079('0x14')]({'messageId':_0x434467[_0x9079('0x2e')][0x0][_0x9079('0x2f')]});}})[_0x9079('0x24')](function(_0x19e844){logger[_0x9079('0x30')](_0x9079('0x31'),_0x19e844);});break;}}})[_0x9079('0x32')](function(){_0x3ba3cf();});}else{_0x3ba3cf();}}},'charset':'utf8mb4','collate':_0x9079('0x33')});}; \ No newline at end of file +var _0xfd4e=['bluebird','request-promise','node-fetch','path','rimraf','exports','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','error','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','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x32c25a,_0x2832f5){var _0x477d8f=function(_0x40f658){while(--_0x40f658){_0x32c25a['push'](_0x32c25a['shift']());}};_0x477d8f(++_0x2832f5);}(_0xfd4e,0x1a0));var _0xefd4=function(_0x500f09,_0x452c93){_0x500f09=_0x500f09-0x0;var _0x2c7d55=_0xfd4e[_0x500f09];return _0x2c7d55;};'use strict';var _=require('lodash');var util=require(_0xefd4('0x0'));var logger=require(_0xefd4('0x1'))(_0xefd4('0x2'));var moment=require(_0xefd4('0x3'));var BPromise=require(_0xefd4('0x4'));var rp=require(_0xefd4('0x5'));var fetch=require(_0xefd4('0x6'));var fs=require('fs');var path=require(_0xefd4('0x7'));var rimraf=require(_0xefd4('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0xefd4('0x9')]=function(_0x2e7a82,_0x34c45d){return _0x2e7a82['define'](_0xefd4('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xefd4('0xb'),'fields':[_0xefd4('0xb')]},{'name':_0xefd4('0xc'),'fields':['body'],'type':_0xefd4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b4726,_0x8ea91c,_0x322afc){var _0x1bdc94=_0x2e7a82[_0xefd4('0xe')];var _0x434dd9=_0x3b4726['get']({'plain':!![]});if(_0x434dd9[_0xefd4('0xf')][_0xefd4('0x10')]()==='in'||_0x434dd9[_0xefd4('0xf')]['toLowerCase']()===_0xefd4('0x11')&&!_0x434dd9[_0xefd4('0x12')]&&!_[_0xefd4('0x13')](_0x434dd9[_0xefd4('0x14')])){_0x1bdc94['WhatsappInteraction'][_0xefd4('0x15')]({'where':{'id':_0x434dd9[_0xefd4('0x16')]}})[_0xefd4('0x17')](function(_0x30cf7c){if(_0x30cf7c){_0x30cf7c[_0xefd4('0x18')]({'lastMsgAt':_0x434dd9['createdAt'],'lastMsgDirection':_0x434dd9[_0xefd4('0xf')]['toLowerCase']()});}})[_0xefd4('0x19')](function(_0x22971c){console['error'](_0x22971c);});}if(_0x434dd9[_0xefd4('0xf')]===_0xefd4('0x11')&&!_0x434dd9[_0xefd4('0x12')]){var _0x3742e0;_0x1bdc94[_0xefd4('0x1a')][_0xefd4('0x1b')]({'where':{'id':_0x434dd9[_0xefd4('0x1c')]},'raw':!![]})[_0xefd4('0x17')](function(_0x3b13ac){_0x3742e0=_0x3b13ac;if(_0x3742e0&&_0x3742e0['type']){switch(_0x3742e0[_0xefd4('0x1d')]){case _0xefd4('0x1e'):var _0x48807c=require(_0xefd4('0x1e'));if(_0x3742e0[_0xefd4('0x1f')]&&_0x3742e0[_0xefd4('0x20')]&&_0x3742e0[_0xefd4('0x21')]){var _0x32c510=new _0x48807c(_0x3742e0[_0xefd4('0x1f')],_0x3742e0[_0xefd4('0x20')]);_0x32c510[_0xefd4('0x22')][_0xefd4('0x23')]({'body':_0x434dd9[_0xefd4('0x24')],'to':_0xefd4('0x25')+_0x434dd9[_0xefd4('0x21')],'from':_0xefd4('0x25')+_0x3742e0[_0xefd4('0x21')],'statusCallback':_0x3742e0[_0xefd4('0x26')]+_0xefd4('0x27')+_0x434dd9['id']+_0xefd4('0x28')+_0x3742e0[_0xefd4('0x29')]})[_0xefd4('0x17')](function(_0x731feb){if(_0x731feb[_0xefd4('0x2a')]){return _0x3b4726[_0xefd4('0x18')]({'messageId':_0x731feb[_0xefd4('0x2a')]});}})['catch'](function(_0x186ff0){logger[_0xefd4('0x2b')](_0xefd4('0x2c'),_0xefd4('0x2d'),_0xefd4('0x1e'),util[_0xefd4('0x2e')](_0x186ff0,{'showHidden':![],'depth':null}));});}else{logger[_0xefd4('0x2b')](_0xefd4('0x2c'),_0xefd4('0x2d'),_0xefd4('0x1e'),_0xefd4('0x2f'));}break;case _0xefd4('0x30'):var _0x45fde2=_0x3742e0[_0xefd4('0x1f')];var _0xa7450c=_0x3742e0['authToken'];var _0x2dbeb9=_0x3742e0[_0xefd4('0x31')]+_0xefd4('0x32')+_0x45fde2+_0xefd4('0x33');var _0x51be3e={'to':[_0x434dd9[_0xefd4('0x21')]],'message':{'type':'text','text':_0x434dd9[_0xefd4('0x24')]}};var _0x5235df={'method':_0xefd4('0x34'),'uri':_0x2dbeb9,'headers':{'Authorization':_0xefd4('0x35')+_0xa7450c,'Content-Type':_0xefd4('0x36')},'body':_0x51be3e,'json':!![]};rp(_0x5235df)['then'](function(_0x586be3){if(_0x586be3[_0xefd4('0x37')][0x0][_0xefd4('0x38')]){return _0x3b4726[_0xefd4('0x18')]({'messageId':_0x586be3['statuses'][0x0][_0xefd4('0x38')]});}})[_0xefd4('0x19')](function(_0xa236be){logger[_0xefd4('0x39')](_0xefd4('0x3a'),_0xa236be);});break;}}})['finally'](function(){_0x322afc();});}else{_0x322afc();}}},'charset':'utf8mb4','collate':_0xefd4('0x3b')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 9747c0a..0b5cef8 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 _0xd695=['WhatsappMessage','create','body','options','raw','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateWhatsappMessage'];(function(_0x49f813,_0x4c6aca){var _0x4ce981=function(_0x2cddc0){while(--_0x2cddc0){_0x49f813['push'](_0x49f813['shift']());}};_0x4ce981(++_0x4c6aca);}(_0xd695,0x65));var _0x5d69=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0xd695[_0x296923];return _0x29af70;};'use strict';var _=require(_0x5d69('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5d69('0x1'));var rs=require(_0x5d69('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d69('0x3'))(_0x5d69('0x4'));var config=require(_0x5d69('0x5'));var jayson=require(_0x5d69('0x6'));var client=jayson[_0x5d69('0x7')][_0x5d69('0x8')]({'port':0x232a});config[_0x5d69('0x9')]=_[_0x5d69('0xa')](config[_0x5d69('0x9')],{'host':_0x5d69('0xb'),'port':0x18eb});var socket=require(_0x5d69('0xc'))(new Redis(config['redis']));require(_0x5d69('0xd'))['register'](socket);function respondWithRpcPromise(_0x111d78,_0x5d72b2,_0x5b22b9){return new BPromise(function(_0x2da155,_0x8dd04c){return client[_0x5d69('0xe')](_0x111d78,_0x5b22b9)[_0x5d69('0xf')](function(_0x3c6926){logger[_0x5d69('0x10')](_0x5d69('0x11'),_0x5d72b2,_0x5d69('0x12'));logger[_0x5d69('0x13')](_0x5d69('0x14'),_0x5d72b2,_0x5d69('0x12'),JSON[_0x5d69('0x15')](_0x3c6926));if(_0x3c6926[_0x5d69('0x16')]){if(_0x3c6926['error'][_0x5d69('0x17')]===0x1f4){logger[_0x5d69('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x5d72b2,_0x3c6926[_0x5d69('0x16')][_0x5d69('0x18')]);return _0x8dd04c(_0x3c6926[_0x5d69('0x16')]['message']);}logger[_0x5d69('0x16')](_0x5d69('0x11'),_0x5d72b2,_0x3c6926['error'][_0x5d69('0x18')]);return _0x2da155(_0x3c6926[_0x5d69('0x16')][_0x5d69('0x18')]);}else{logger['info'](_0x5d69('0x11'),_0x5d72b2,_0x5d69('0x12'));_0x2da155(_0x3c6926[_0x5d69('0x19')][_0x5d69('0x18')]);}})['catch'](function(_0x45814d){logger[_0x5d69('0x16')](_0x5d69('0x11'),_0x5d72b2,_0x45814d);_0x8dd04c(_0x45814d);});});}exports[_0x5d69('0x1a')]=function(_0x3b4600){var _0x1d7068=this;return new Promise(function(_0x697a5c,_0x3fa1eb){return db[_0x5d69('0x1b')][_0x5d69('0x1c')](_0x3b4600[_0x5d69('0x1d')],{'raw':_0x3b4600[_0x5d69('0x1e')]?_0x3b4600[_0x5d69('0x1e')][_0x5d69('0x1f')]===undefined?!![]:![]:!![]})[_0x5d69('0xf')](function(_0x42018a){logger['info'](_0x5d69('0x1a'),_0x3b4600);logger[_0x5d69('0x13')](_0x5d69('0x1a'),_0x3b4600,JSON[_0x5d69('0x15')](_0x42018a));_0x697a5c(_0x42018a);})['catch'](function(_0x2c6186){logger[_0x5d69('0x16')](_0x5d69('0x1a'),_0x2c6186[_0x5d69('0x18')],_0x3b4600);_0x3fa1eb(_0x1d7068[_0x5d69('0x16')](0x1f4,_0x2c6186[_0x5d69('0x18')]));});});}; \ No newline at end of file +var _0x48df=['info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','debug','lodash','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then'];(function(_0x5d0bfc,_0x55124f){var _0x15332e=function(_0x2ebe11){while(--_0x2ebe11){_0x5d0bfc['push'](_0x5d0bfc['shift']());}};_0x15332e(++_0x55124f);}(_0x48df,0x68));var _0xf48d=function(_0x209bbf,_0x2e2375){_0x209bbf=_0x209bbf-0x0;var _0x592d4b=_0x48df[_0x209bbf];return _0x592d4b;};'use strict';var _=require(_0xf48d('0x0'));var util=require('util');var moment=require(_0xf48d('0x1'));var BPromise=require(_0xf48d('0x2'));var rs=require(_0xf48d('0x3'));var fs=require('fs');var Redis=require(_0xf48d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf48d('0x5'));var config=require('../../config/environment');var jayson=require(_0xf48d('0x6'));var client=jayson['client'][_0xf48d('0x7')]({'port':0x232a});config[_0xf48d('0x8')]=_[_0xf48d('0x9')](config['redis'],{'host':_0xf48d('0xa'),'port':0x18eb});var socket=require(_0xf48d('0xb'))(new Redis(config[_0xf48d('0x8')]));require(_0xf48d('0xc'))[_0xf48d('0xd')](socket);function respondWithRpcPromise(_0x1d5262,_0x58a89b,_0x4c9d2c){return new BPromise(function(_0x17f140,_0x48aa30){return client[_0xf48d('0xe')](_0x1d5262,_0x4c9d2c)[_0xf48d('0xf')](function(_0x16b7c1){logger[_0xf48d('0x10')](_0xf48d('0x11'),_0x58a89b,_0xf48d('0x12'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x58a89b,_0xf48d('0x12'),JSON[_0xf48d('0x13')](_0x16b7c1));if(_0x16b7c1[_0xf48d('0x14')]){if(_0x16b7c1['error']['code']===0x1f4){logger[_0xf48d('0x14')](_0xf48d('0x11'),_0x58a89b,_0x16b7c1['error']['message']);return _0x48aa30(_0x16b7c1[_0xf48d('0x14')]['message']);}logger[_0xf48d('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x58a89b,_0x16b7c1[_0xf48d('0x14')][_0xf48d('0x15')]);return _0x17f140(_0x16b7c1[_0xf48d('0x14')]['message']);}else{logger[_0xf48d('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x58a89b,_0xf48d('0x12'));_0x17f140(_0x16b7c1[_0xf48d('0x16')][_0xf48d('0x15')]);}})[_0xf48d('0x17')](function(_0x59b15b){logger[_0xf48d('0x14')](_0xf48d('0x11'),_0x58a89b,_0x59b15b);_0x48aa30(_0x59b15b);});});}exports[_0xf48d('0x18')]=function(_0x174b1e){var _0x29a894=this;return new Promise(function(_0x28bf42,_0x2b118c){return db[_0xf48d('0x19')]['create'](_0x174b1e[_0xf48d('0x1a')],{'raw':_0x174b1e[_0xf48d('0x1b')]?_0x174b1e[_0xf48d('0x1b')][_0xf48d('0x1c')]===undefined?!![]:![]:!![]})[_0xf48d('0xf')](function(_0x3bb56d){logger[_0xf48d('0x10')](_0xf48d('0x18'),_0x174b1e);logger[_0xf48d('0x1d')](_0xf48d('0x18'),_0x174b1e,JSON[_0xf48d('0x13')](_0x3bb56d));_0x28bf42(_0x3bb56d);})[_0xf48d('0x17')](function(_0x377747){logger['error'](_0xf48d('0x18'),_0x377747[_0xf48d('0x15')],_0x174b1e);_0x2b118c(_0x29a894['error'](0x1f4,_0x377747[_0xf48d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 02566e9..562ca5e 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 _0x8185=['length','whatsappMessage:','save','remove','update','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8185,0x1e2));var _0x5818=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8185[_0x53ccf2];return _0x5a2964;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x5818('0x0'),_0x5818('0x1'),_0x5818('0x2')];function createListener(_0x12dc77,_0x1616c7){return function(_0x300de2){_0x1616c7['emit'](_0x12dc77,_0x300de2);};}function removeListener(_0x3ba6bf,_0x515336){return function(){WhatsappMessageEvents[_0x5818('0x3')](_0x3ba6bf,_0x515336);};}exports['register']=function(_0x3ecbc8){for(var _0x33af67=0x0,_0x141e9d=events[_0x5818('0x4')];_0x33af67<_0x141e9d;_0x33af67++){var _0x2ae4ec=events[_0x33af67];var _0x5b744=createListener(_0x5818('0x5')+_0x2ae4ec,_0x3ecbc8);WhatsappMessageEvents['on'](_0x2ae4ec,_0x5b744);}}; \ No newline at end of file +var _0x5f7f=['remove','update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x2560fc,_0xbf695c){var _0x5c00cf=function(_0x5bd9d5){while(--_0x5bd9d5){_0x2560fc['push'](_0x2560fc['shift']());}};_0x5c00cf(++_0xbf695c);}(_0x5f7f,0xcf));var _0xf5f7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5f7f[_0x1ac595];return _0x455fff;};'use strict';var WhatsappMessageEvents=require(_0xf5f7('0x0'));var events=['save',_0xf5f7('0x1'),_0xf5f7('0x2')];function createListener(_0x4b619d,_0x2995bc){return function(_0x1f54ee){_0x2995bc[_0xf5f7('0x3')](_0x4b619d,_0x1f54ee);};}function removeListener(_0x534931,_0x554646){return function(){WhatsappMessageEvents[_0xf5f7('0x4')](_0x534931,_0x554646);};}exports[_0xf5f7('0x5')]=function(_0x5a7106){for(var _0x4b78cf=0x0,_0x3be51a=events[_0xf5f7('0x6')];_0x4b78cf<_0x3be51a;_0x4b78cf++){var _0x13e6e8=events[_0x4b78cf];var _0xac2e78=createListener(_0xf5f7('0x7')+_0x13e6e8,_0x5a7106);WhatsappMessageEvents['on'](_0x13e6e8,_0xac2e78);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 0a30051..3efc755 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 _0x6c99=['destroy','delete','removeTeams','removeAgents','exports','multer','path','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','update','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c99,0x9b));var _0x96c9=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0x6c99[_0x5b740b];return _0x6f8f4e;};'use strict';var multer=require(_0x96c9('0x0'));var util=require('util');var path=require(_0x96c9('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(_0x96c9('0x2'));var config=require(_0x96c9('0x3'));var controller=require(_0x96c9('0x4'));router[_0x96c9('0x5')]('/',auth['isAuthenticated'](),controller[_0x96c9('0x6')]);router[_0x96c9('0x5')](_0x96c9('0x7'),auth[_0x96c9('0x8')](),controller[_0x96c9('0x9')]);router['get']('/:id',auth[_0x96c9('0x8')](),controller['show']);router[_0x96c9('0x5')]('/:id/members',auth[_0x96c9('0x8')](),controller[_0x96c9('0xa')]);router[_0x96c9('0x5')](_0x96c9('0xb'),auth['isAuthenticated'](),controller[_0x96c9('0xc')]);router[_0x96c9('0x5')](_0x96c9('0xd'),auth[_0x96c9('0x8')](),controller[_0x96c9('0xe')]);router['post']('/',auth[_0x96c9('0x8')](),controller[_0x96c9('0xf')]);router[_0x96c9('0x10')](_0x96c9('0xb'),auth['isAuthenticated'](),controller['addTeams']);router[_0x96c9('0x10')](_0x96c9('0xd'),auth[_0x96c9('0x8')](),controller[_0x96c9('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x96c9('0x12')]);router['delete'](_0x96c9('0x13'),auth['isAuthenticated'](),controller[_0x96c9('0x14')]);router[_0x96c9('0x15')](_0x96c9('0xb'),auth[_0x96c9('0x8')](),controller[_0x96c9('0x16')]);router['delete'](_0x96c9('0xd'),auth['isAuthenticated'](),controller[_0x96c9('0x17')]);module[_0x96c9('0x18')]=router; \ No newline at end of file +var _0x323e=['getTeams','getAgents','create','post','/:id/teams','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers'];(function(_0xfa11ec,_0x4a5c9b){var _0x3f972c=function(_0x9aa9de){while(--_0x9aa9de){_0xfa11ec['push'](_0xfa11ec['shift']());}};_0x3f972c(++_0x4a5c9b);}(_0x323e,0xa9));var _0xe323=function(_0x21a216,_0x342075){_0x21a216=_0x21a216-0x0;var _0x155e5c=_0x323e[_0x21a216];return _0x155e5c;};'use strict';var multer=require('multer');var util=require(_0xe323('0x0'));var path=require(_0xe323('0x1'));var timeout=require('connect-timeout');var express=require(_0xe323('0x2'));var router=express[_0xe323('0x3')]();var fs_extra=require(_0xe323('0x4'));var auth=require(_0xe323('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe323('0x6'));var controller=require(_0xe323('0x7'));router['get']('/',auth[_0xe323('0x8')](),controller[_0xe323('0x9')]);router[_0xe323('0xa')](_0xe323('0xb'),auth[_0xe323('0x8')](),controller[_0xe323('0xc')]);router[_0xe323('0xa')](_0xe323('0xd'),auth['isAuthenticated'](),controller[_0xe323('0xe')]);router[_0xe323('0xa')](_0xe323('0xf'),auth['isAuthenticated'](),controller[_0xe323('0x10')]);router[_0xe323('0xa')]('/:id/teams',auth[_0xe323('0x8')](),controller[_0xe323('0x11')]);router[_0xe323('0xa')]('/:id/users',auth[_0xe323('0x8')](),controller[_0xe323('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe323('0x13')]);router[_0xe323('0x14')](_0xe323('0x15'),auth[_0xe323('0x8')](),controller[_0xe323('0x16')]);router[_0xe323('0x14')](_0xe323('0x17'),auth[_0xe323('0x8')](),controller[_0xe323('0x18')]);router['put'](_0xe323('0xd'),auth[_0xe323('0x8')](),controller[_0xe323('0x19')]);router[_0xe323('0x1a')]('/:id',auth[_0xe323('0x8')](),controller[_0xe323('0x1b')]);router[_0xe323('0x1a')](_0xe323('0x15'),auth['isAuthenticated'](),controller[_0xe323('0x1c')]);router[_0xe323('0x1a')]('/:id/users',auth[_0xe323('0x8')](),controller[_0xe323('0x1d')]);module[_0xe323('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 0d4f276..87d9576 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 _0x68fc=['sequelize','exports','STRING','ENUM','beepall'];(function(_0x55f8ec,_0x29fb1b){var _0x554159=function(_0x2af2c8){while(--_0x2af2c8){_0x55f8ec['push'](_0x55f8ec['shift']());}};_0x554159(++_0x29fb1b);}(_0x68fc,0xa5));var _0xc68f=function(_0x1d1513,_0x12f516){_0x1d1513=_0x1d1513-0x0;var _0x191d53=_0x68fc[_0x1d1513];return _0x191d53;};'use strict';var Sequelize=require(_0xc68f('0x0'));module[_0xc68f('0x1')]={'name':{'type':Sequelize[_0xc68f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc68f('0x3')]('rrmemory',_0xc68f('0x4'),'roundrobin')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1542=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x58c2d4,_0x426d80){var _0xcbc19=function(_0x326599){while(--_0x326599){_0x58c2d4['push'](_0x58c2d4['shift']());}};_0xcbc19(++_0x426d80);}(_0x1542,0x116));var _0x2154=function(_0x305eb2,_0x22f548){_0x305eb2=_0x305eb2-0x0;var _0x246a1=_0x1542[_0x305eb2];return _0x246a1;};'use strict';var Sequelize=require(_0x2154('0x0'));module[_0x2154('0x1')]={'name':{'type':Sequelize[_0x2154('0x2')],'unique':_0x2154('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2154('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2154('0x5'),_0x2154('0x6'),_0x2154('0x7'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index d621b6e..5fb1a7b 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 _0x41b1=['api','redis','localhost','./whatsappQueue.socket','register','sendStatus','status','json','undefined','count','offset','limit','update','destroy','then','get','WhatsappQueues','UserProfileResource','end','error','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','getOptions','where','include','query','findAll','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','params','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','pick','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','%s/%s','Team','order','sort','filter','getTeams','addTeams','ids','Agents','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','select','field','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','value','transaction','removeTeams','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','removeAgents','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger'];(function(_0x438a35,_0x973546){var _0x28ebd8=function(_0x17bca6){while(--_0x17bca6){_0x438a35['push'](_0x438a35['shift']());}};_0x28ebd8(++_0x973546);}(_0x41b1,0x71));var _0x141b=function(_0x5d0207,_0x4000c4){_0x5d0207=_0x5d0207-0x0;var _0xf3e249=_0x41b1[_0x5d0207];return _0xf3e249;};'use strict';var BPromise=require(_0x141b('0x0'));var util=require(_0x141b('0x1'));var _=require(_0x141b('0x2'));var squel=require(_0x141b('0x3'));var Redis=require('ioredis');var qs=require(_0x141b('0x4'));var logger=require(_0x141b('0x5'))(_0x141b('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x141b('0x7')]=_['defaults'](config[_0x141b('0x7')],{'host':_0x141b('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x141b('0x7')]));require(_0x141b('0x9'))[_0x141b('0xa')](socket);function respondWithStatusCode(_0x5d4440,_0x1384da){_0x1384da=_0x1384da||0xcc;return function(_0x9746ec){if(_0x9746ec){return _0x5d4440[_0x141b('0xb')](_0x1384da);}return _0x5d4440[_0x141b('0xc')](_0x1384da)['end']();};}function respondWithResult(_0x58d4af,_0x4f64d2){_0x4f64d2=_0x4f64d2||0xc8;return function(_0x16b11e){if(_0x16b11e){return _0x58d4af[_0x141b('0xc')](_0x4f64d2)[_0x141b('0xd')](_0x16b11e);}};}function respondWithFilteredResult(_0xa1096f,_0x11e085){return function(_0xd17dae){if(_0xd17dae){var _0x12bc94=typeof _0x11e085['offset']===_0x141b('0xe')&&typeof _0x11e085['limit']===_0x141b('0xe');var _0x3668b6=_0xd17dae[_0x141b('0xf')];var _0x34306d=_0x12bc94?0x0:_0x11e085[_0x141b('0x10')];var _0x320553=_0x12bc94?_0xd17dae['count']:_0x11e085[_0x141b('0x10')]+_0x11e085[_0x141b('0x11')];var _0x11d1f1;if(_0x320553>=_0x3668b6){_0x320553=_0x3668b6;_0x11d1f1=0xc8;}else{_0x11d1f1=0xce;}_0xa1096f[_0x141b('0xc')](_0x11d1f1);return _0xa1096f['set']('Content-Range',_0x34306d+'-'+_0x320553+'/'+_0x3668b6)[_0x141b('0xd')](_0xd17dae);}return null;};}function saveUpdates(_0x421d67){return function(_0x91c040){if(_0x91c040){return _0x91c040[_0x141b('0x12')](_0x421d67)['then'](function(_0x3c9ca8){return _0x3c9ca8;});}return null;};}function removeEntity(_0x7f42c8){return function(_0x2d2be1){if(_0x2d2be1){return _0x2d2be1[_0x141b('0x13')]()[_0x141b('0x14')](function(){var _0x13af43=_0x2d2be1[_0x141b('0x15')]({'plain':!![]});var _0xa712a6=_0x141b('0x16');return db[_0x141b('0x17')][_0x141b('0x13')]({'where':{'type':_0xa712a6,'resourceId':_0x13af43['id']}})['then'](function(){return _0x2d2be1;});})[_0x141b('0x14')](function(){_0x7f42c8[_0x141b('0xc')](0xcc)[_0x141b('0x18')]();});}};}function handleEntityNotFound(_0x2f957b){return function(_0x8cb1d9){if(!_0x8cb1d9){_0x2f957b[_0x141b('0xb')](0x194);}return _0x8cb1d9;};}function handleError(_0x3acde4,_0x481a37){_0x481a37=_0x481a37||0x1f4;return function(_0x55c90c){logger[_0x141b('0x19')](_0x55c90c['stack']);if(_0x55c90c[_0x141b('0x1a')]){delete _0x55c90c['name'];}_0x3acde4['status'](_0x481a37)[_0x141b('0x1b')](_0x55c90c);};}exports['index']=function(_0x4b0c7a,_0xcb6267){var _0x37b881={};var _0x39f506={'count':0x0,'rows':[]};var _0x1179a6=_[_0x141b('0x1c')](db[_0x141b('0x1d')][_0x141b('0x1e')],function(_0x30ffa5){return{'name':_0x30ffa5[_0x141b('0x1f')],'type':_0x30ffa5[_0x141b('0x20')]['key']};});_0x37b881=qs[_0x141b('0x21')](_0x1179a6,_0x4b0c7a);var _0x579539={'where':_0x37b881[_0x141b('0x22')]};return db[_0x141b('0x1d')][_0x141b('0xf')](_0x579539)[_0x141b('0x14')](function(_0x1f2086){_0x39f506['count']=_0x1f2086;_0x37b881[_0x141b('0x23')]=qs[_0x141b('0x23')](_0x4b0c7a[_0x141b('0x24')]);return db[_0x141b('0x1d')][_0x141b('0x25')](_0x37b881);})[_0x141b('0x14')](function(_0x3d2bc6){_0x39f506['rows']=_0x3d2bc6;return _0x39f506;})[_0x141b('0x14')](respondWithFilteredResult(_0xcb6267,_0x37b881))[_0x141b('0x26')](handleError(_0xcb6267,null));};exports[_0x141b('0x27')]=function(_0x519ead,_0x9b9b61){var _0x5e3f22={'raw':!![],'where':{'id':_0x519ead['params']['id']}},_0x4be73e={};_0x4be73e[_0x141b('0x28')]=_[_0x141b('0x29')](db[_0x141b('0x1d')][_0x141b('0x1e')]);_0x4be73e[_0x141b('0x24')]=_[_0x141b('0x29')](_0x519ead['query']);_0x4be73e[_0x141b('0x2a')]=_[_0x141b('0x2b')](_0x4be73e[_0x141b('0x28')],_0x4be73e[_0x141b('0x24')]);_0x5e3f22[_0x141b('0x2c')]=_[_0x141b('0x2b')](_0x4be73e[_0x141b('0x28')],qs[_0x141b('0x2d')](_0x519ead['query']['fields']));_0x5e3f22['attributes']=_0x5e3f22[_0x141b('0x2c')][_0x141b('0x2e')]?_0x5e3f22['attributes']:_0x4be73e[_0x141b('0x28')];if(_0x519ead['query'][_0x141b('0x2f')]){_0x5e3f22[_0x141b('0x23')]=[{'all':!![]}];}_0x5e3f22=_[_0x141b('0x30')]({},_0x5e3f22,_0x519ead[_0x141b('0x31')]);return db[_0x141b('0x1d')][_0x141b('0x32')](_0x5e3f22)['then'](handleEntityNotFound(_0x9b9b61,null))[_0x141b('0x14')](respondWithResult(_0x9b9b61,null))['catch'](handleError(_0x9b9b61,null));};exports['create']=function(_0x50ed41,_0x39dfc1){return db[_0x141b('0x1d')][_0x141b('0x33')](_0x50ed41['body'],{})['then'](function(_0x2015b5){var _0x89be6b=_0x50ed41[_0x141b('0x34')]['get']({'plain':!![]});if(!_0x89be6b)throw new Error(_0x141b('0x35'));if(_0x89be6b[_0x141b('0x36')]===_0x141b('0x34')){var _0x344052=_0x2015b5[_0x141b('0x15')]({'plain':!![]});var _0x38f61a=_0x141b('0x16');return db[_0x141b('0x37')][_0x141b('0x32')]({'where':{'name':_0x38f61a,'userProfileId':_0x89be6b[_0x141b('0x38')]},'raw':!![]})[_0x141b('0x14')](function(_0x11b92f){if(_0x11b92f&&_0x11b92f['autoAssociation']===0x0){return db['UserProfileResource'][_0x141b('0x33')]({'name':_0x344052['name'],'resourceId':_0x344052['id'],'type':_0x11b92f[_0x141b('0x1a')],'sectionId':_0x11b92f['id']},{})[_0x141b('0x14')](function(){return _0x2015b5;});}else{return _0x2015b5;}})[_0x141b('0x26')](function(_0x2a780e){logger[_0x141b('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a780e);throw _0x2a780e;});}return _0x2015b5;})[_0x141b('0x14')](respondWithResult(_0x39dfc1,0xc9))['catch'](handleError(_0x39dfc1,null));};exports[_0x141b('0x12')]=function(_0x587f59,_0x5932df){if(_0x587f59[_0x141b('0x39')]['id']){delete _0x587f59[_0x141b('0x39')]['id'];}return db['WhatsappQueue'][_0x141b('0x32')]({'where':{'id':_0x587f59[_0x141b('0x3a')]['id']}})[_0x141b('0x14')](handleEntityNotFound(_0x5932df,null))[_0x141b('0x14')](saveUpdates(_0x587f59[_0x141b('0x39')],null))['then'](respondWithResult(_0x5932df,null))[_0x141b('0x26')](handleError(_0x5932df,null));};exports[_0x141b('0x13')]=function(_0x445cde,_0x14a263){return db[_0x141b('0x1d')][_0x141b('0x32')]({'where':{'id':_0x445cde[_0x141b('0x3a')]['id']}})[_0x141b('0x14')](handleEntityNotFound(_0x14a263,null))[_0x141b('0x14')](removeEntity(_0x14a263,null))[_0x141b('0x26')](handleError(_0x14a263,null));};exports[_0x141b('0x3b')]=function(_0x42c980,_0x11c0a1){return db[_0x141b('0x1d')][_0x141b('0x3b')]()[_0x141b('0x14')](respondWithResult(_0x11c0a1,null))[_0x141b('0x26')](handleError(_0x11c0a1,null));};exports[_0x141b('0x3c')]=function(_0x9069c5,_0x55f2df){var _0x2d2e0c={'raw':!![],'where':{}},_0x31117d={},_0x1fd1bc;return db[_0x141b('0x1d')][_0x141b('0x3d')]({'where':{'id':_0x9069c5[_0x141b('0x3a')]['id']}})[_0x141b('0x14')](handleEntityNotFound(_0x55f2df,null))['then'](function(_0x5cd69a){if(_0x5cd69a){_0x1fd1bc=_0x5cd69a[_0x141b('0x15')]({'plain':!![]});_0x31117d[_0x141b('0x28')]=_['keys'](db[_0x141b('0x3e')][_0x141b('0x1e')]);_0x31117d[_0x141b('0x24')]=_[_0x141b('0x29')](_0x9069c5['query']);_0x31117d['filters']=_[_0x141b('0x2b')](_0x31117d[_0x141b('0x28')],_0x31117d[_0x141b('0x24')]);_0x2d2e0c[_0x141b('0x2c')]=_[_0x141b('0x2b')](_0x31117d['model'],qs[_0x141b('0x2d')](_0x9069c5[_0x141b('0x24')][_0x141b('0x2d')]));_0x2d2e0c[_0x141b('0x2c')]=_0x2d2e0c['attributes'][_0x141b('0x2e')]?_0x2d2e0c['attributes']:_0x31117d['model'];if(!_0x9069c5[_0x141b('0x24')][_0x141b('0x3f')](_0x141b('0x40'))){_0x2d2e0c['limit']=qs[_0x141b('0x11')](_0x9069c5[_0x141b('0x24')]['limit']);_0x2d2e0c[_0x141b('0x10')]=qs['offset'](_0x9069c5[_0x141b('0x24')][_0x141b('0x10')]);}_0x2d2e0c['order']=qs['sort'](_0x9069c5[_0x141b('0x24')]['sort']);_0x2d2e0c[_0x141b('0x22')]=qs[_0x141b('0x2a')](_[_0x141b('0x41')](_0x9069c5[_0x141b('0x24')],_0x31117d['filters']));_0x2d2e0c[_0x141b('0x22')][_0x141b('0x42')]=_0x5cd69a['id'];if(_0x9069c5[_0x141b('0x24')]['filter']){_0x2d2e0c['where']=_[_0x141b('0x30')](_0x2d2e0c[_0x141b('0x22')],{'$or':_[_0x141b('0x1c')](_0x2d2e0c['attributes'],function(_0x1c374c){var _0x3950b5={};_0x3950b5[_0x1c374c]={'$like':'%'+_0x9069c5[_0x141b('0x24')]['filter']+'%'};return _0x3950b5;})});}_0x2d2e0c=_[_0x141b('0x30')]({},_0x2d2e0c,_0x9069c5['options']);return db['UserWhatsappQueue'][_0x141b('0x25')](_0x2d2e0c);}})[_0x141b('0x14')](function(_0x1a069d){if(_0x1a069d){return db[_0x141b('0x43')][_0x141b('0x44')]({'where':{'id':_[_0x141b('0x1c')](_0x1a069d,_0x141b('0x45')),'role':_0x141b('0x46')},'attributes':['id',_0x141b('0x1a'),_0x141b('0x47'),_0x141b('0x48'),_0x141b('0x49')]});}})['then'](function(_0x39e645){if(_0x39e645){return{'count':_0x39e645['count'],'rows':_[_0x141b('0x1c')](_0x39e645[_0x141b('0x4a')],function(_0x444163){return{'membername':_0x444163[_0x141b('0x1a')],'UserId':_0x444163['id'],'queue_name':_0x1fd1bc['name'],'WhatsappQueueId':_0x1fd1bc['id'],'interface':util['format'](_0x141b('0x4b'),'SIP',_0x444163[_0x141b('0x1a')]),'penalty':0x0,'paused':_0x444163['whatsappPause'],'createdAt':_0x444163[_0x141b('0x49')],'updatedAt':_0x444163[_0x141b('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x141b('0x14')](respondWithFilteredResult(_0x55f2df,_0x2d2e0c))['catch'](handleError(_0x55f2df,null));};exports['getTeams']=function(_0x317c88,_0x4a9376){var _0x11afca={};var _0x39b5e7={};var _0x15c850;var _0x16d474;return db['WhatsappQueue'][_0x141b('0x3d')]({'where':{'id':_0x317c88[_0x141b('0x3a')]['id']}})[_0x141b('0x14')](handleEntityNotFound(_0x4a9376,null))[_0x141b('0x14')](function(_0x115b29){if(_0x115b29){_0x15c850=_0x115b29;_0x39b5e7[_0x141b('0x28')]=_['keys'](db[_0x141b('0x4c')]['rawAttributes']);_0x39b5e7['query']=_[_0x141b('0x29')](_0x317c88[_0x141b('0x24')]);_0x39b5e7[_0x141b('0x2a')]=_['intersection'](_0x39b5e7[_0x141b('0x28')],_0x39b5e7[_0x141b('0x24')]);_0x11afca[_0x141b('0x2c')]=_['intersection'](_0x39b5e7[_0x141b('0x28')],qs[_0x141b('0x2d')](_0x317c88[_0x141b('0x24')][_0x141b('0x2d')]));_0x11afca[_0x141b('0x2c')]=_0x11afca[_0x141b('0x2c')]['length']?_0x11afca[_0x141b('0x2c')]:_0x39b5e7['model'];_0x11afca[_0x141b('0x4d')]=qs['sort'](_0x317c88['query'][_0x141b('0x4e')]);_0x11afca['where']=qs[_0x141b('0x2a')](_[_0x141b('0x41')](_0x317c88[_0x141b('0x24')],_0x39b5e7[_0x141b('0x2a')]));if(_0x317c88[_0x141b('0x24')][_0x141b('0x4f')]){_0x11afca['where']=_[_0x141b('0x30')](_0x11afca[_0x141b('0x22')],{'$or':_[_0x141b('0x1c')](_0x11afca[_0x141b('0x2c')],function(_0x189da4){var _0x32eba8={};_0x32eba8[_0x189da4]={'$like':'%'+_0x317c88[_0x141b('0x24')]['filter']+'%'};return _0x32eba8;})});}_0x11afca=_[_0x141b('0x30')]({},_0x11afca,_0x317c88[_0x141b('0x31')]);return _0x15c850[_0x141b('0x50')](_0x11afca);}})[_0x141b('0x14')](function(_0x72b95f){if(_0x72b95f){_0x16d474=_0x72b95f['length'];if(!_0x317c88['query'][_0x141b('0x3f')]('nolimit')){_0x11afca[_0x141b('0x11')]=qs[_0x141b('0x11')](_0x317c88[_0x141b('0x24')][_0x141b('0x11')]);_0x11afca[_0x141b('0x10')]=qs[_0x141b('0x10')](_0x317c88[_0x141b('0x24')][_0x141b('0x10')]);}return _0x15c850[_0x141b('0x50')](_0x11afca);}})[_0x141b('0x14')](function(_0x49035e){if(_0x49035e){return _0x49035e?{'count':_0x16d474,'rows':_0x49035e}:null;}})[_0x141b('0x14')](respondWithResult(_0x4a9376,null))[_0x141b('0x26')](handleError(_0x4a9376,null));};exports[_0x141b('0x51')]=function(_0x3540ef,_0x4e4905){var _0xdf4986=_0x3540ef[_0x141b('0x39')][_0x141b('0x52')];return db[_0x141b('0x4c')][_0x141b('0x25')]({'where':{'id':_0xdf4986},'attributes':['id'],'include':[{'model':db['User'],'as':_0x141b('0x53'),'attributes':['id',_0x141b('0x1a'),'online','voicePause',_0x141b('0x54')],'raw':!![]}]})[_0x141b('0x14')](function(_0xd59c85){if(_0xd59c85){var _0x15aa7e=_[_0x141b('0x55')](_0xd59c85,function(_0x43ac64){var _0x3dbec7=_0x43ac64[_0x141b('0x15')]({'plain':!![]});return _0x3dbec7[_0x141b('0x53')];});return db[_0x141b('0x1d')][_0x141b('0x32')]({'where':{'id':_0x3540ef[_0x141b('0x3a')]['id']}})[_0x141b('0x14')](function(_0x4683dd){return db[_0x141b('0x56')]['transaction'](function(_0x50595e){return _0x4683dd[_0x141b('0x51')](_0xdf4986,{'transaction':_0x50595e})['then'](function(){return BPromise[_0x141b('0x57')](_0x15aa7e,function(_0x2fbde5){return db[_0x141b('0x3e')][_0x141b('0x58')]({'where':{'UserId':_0x2fbde5['id'],'WhatsappQueueId':_0x3540ef[_0x141b('0x3a')]['id']},'transaction':_0x50595e});});})[_0x141b('0x14')](function(){_0x15aa7e[_0x141b('0x59')](function(_0x3090a2){socket[_0x141b('0x5a')]('userWhatsappQueue:save',{'UserId':_0x3090a2['id'],'WhatsappQueueId':_0x4683dd['id']});});});});});}})[_0x141b('0x14')](respondWithStatusCode(_0x4e4905,null))['catch'](handleError(_0x4e4905,null));};exports['removeTeams']=function(_0x62c542,_0x340d73){return db['Team'][_0x141b('0x25')]({'where':{'id':_0x62c542['query'][_0x141b('0x52')]},'attributes':['id'],'include':[{'model':db[_0x141b('0x43')],'as':_0x141b('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x340d73,null))[_0x141b('0x14')](function(_0xf54bb3){var _0x20daa0=_[_0x141b('0x1c')](_0xf54bb3,'id');var _0x17401f=[];var _0x2b3646=[];var _0x23bd5f=squel[_0x141b('0x5b')]();_0x23bd5f[_0x141b('0x5c')]('tq.TeamId')[_0x141b('0x5d')](_0x141b('0x5e'),'tq')['join'](_0x141b('0x5f'),'ut',_0x141b('0x60'))[_0x141b('0x22')](_0x141b('0x61'),_0x62c542[_0x141b('0x3a')]['id']);for(var _0x6d9341=0x0;_0x6d9341<_0xf54bb3['length'];_0x6d9341+=0x1){let _0x1d6e51=_0xf54bb3[_0x6d9341];for(var _0x3b840b=0x0;_0x3b840b<_0x1d6e51[_0x141b('0x53')][_0x141b('0x2e')];_0x3b840b+=0x1){let _0x18bc0f=_0x1d6e51[_0x141b('0x53')][_0x3b840b];var _0x35f3b4=_0x23bd5f[_0x141b('0x62')]();_0x35f3b4['where'](_0x141b('0x63'),_0x18bc0f['id']);_0x2b3646[_0x141b('0x64')](db['sequelize'][_0x141b('0x24')](_0x35f3b4['toString'](),{'type':db[_0x141b('0x56')][_0x141b('0x65')][_0x141b('0x66')]})[_0x141b('0x14')](function(_0x2d1d59){if(_0x2d1d59[_0x141b('0x2e')]===0x1){return _0x18bc0f['id'];}else{var _0x13be08=_[_0x141b('0x67')](_['map'](_0x2d1d59,'TeamId'),function(_0x1b718b){return _['includes'](_0x20daa0,_0x1b718b);});if(_0x13be08){return _0x18bc0f['id'];}}}));}}return BPromise[_0x141b('0x68')](_0x2b3646)[_0x141b('0x14')](function(_0x178a8f){_0x17401f=_(_0x17401f)[_0x141b('0x69')](_0x178a8f)[_0x141b('0x6a')]()[_0x141b('0x6b')]();return db[_0x141b('0x1d')][_0x141b('0x32')]({'where':{'id':_0x62c542[_0x141b('0x3a')]['id']}})[_0x141b('0x14')](function(_0x24d5a8){return db['sequelize'][_0x141b('0x6c')](function(_0x43c541){return _0x24d5a8[_0x141b('0x6d')](_0x62c542[_0x141b('0x24')]['ids'],{'transaction':_0x43c541})['then'](function(){if(!_[_0x141b('0x6e')](_0x17401f)){return _0x24d5a8['removeAgents'](_0x17401f,{'transaction':_0x43c541});}})[_0x141b('0x14')](function(){_0x17401f[_0x141b('0x59')](function(_0x5b16ab){socket[_0x141b('0x5a')](_0x141b('0x6f'),{'UserId':_0x5b16ab,'WhatsappQueueId':_0x24d5a8['id']});});});});});});})[_0x141b('0x14')](respondWithStatusCode(_0x340d73,null))['catch'](handleError(_0x340d73,null));};exports[_0x141b('0x70')]=function(_0x185ea6,_0x12e713){return db['WhatsappQueue'][_0x141b('0x32')]({'where':{'id':_0x185ea6[_0x141b('0x3a')]['id']}})[_0x141b('0x14')](handleEntityNotFound(_0x12e713,null))[_0x141b('0x14')](function(_0x2c10ac){if(_0x2c10ac){return _0x2c10ac[_0x141b('0x70')](_0x185ea6[_0x141b('0x39')][_0x141b('0x52')],_[_0x141b('0x71')](_0x185ea6[_0x141b('0x39')],[_0x141b('0x52'),'id'])||{})[_0x141b('0x72')](function(_0x1c79be){for(var _0x23ac6a=0x0;_0x23ac6a<_0x185ea6[_0x141b('0x39')][_0x141b('0x52')][_0x141b('0x2e')];_0x23ac6a+=0x1){socket[_0x141b('0x5a')](_0x141b('0x73'),{'UserId':Number(_0x185ea6['body'][_0x141b('0x52')][_0x23ac6a]),'WhatsappQueueId':Number(_0x185ea6[_0x141b('0x3a')]['id'])});}return _0x1c79be;});}})['then'](respondWithResult(_0x12e713,null))[_0x141b('0x26')](handleError(_0x12e713,null));};exports[_0x141b('0x74')]=function(_0x148356,_0x27d72d){return db[_0x141b('0x1d')][_0x141b('0x32')]({'where':{'id':_0x148356[_0x141b('0x3a')]['id']}})[_0x141b('0x14')](handleEntityNotFound(_0x27d72d,null))[_0x141b('0x14')](function(_0x38f235){if(_0x38f235){return _0x38f235[_0x141b('0x74')](_0x148356[_0x141b('0x24')]['ids'])['then'](function(){if(_[_0x141b('0x75')](_0x148356[_0x141b('0x24')]['ids'])){for(var _0x58b9c5=0x0;_0x58b9c5<_0x148356[_0x141b('0x24')][_0x141b('0x52')]['length'];_0x58b9c5+=0x1){socket[_0x141b('0x5a')](_0x141b('0x6f'),{'UserId':Number(_0x148356[_0x141b('0x24')][_0x141b('0x52')][_0x58b9c5]),'WhatsappQueueId':Number(_0x148356[_0x141b('0x3a')]['id'])});}}else{socket[_0x141b('0x5a')]('userWhatsappQueue:remove',{'UserId':Number(_0x148356[_0x141b('0x24')]['ids']),'WhatsappQueueId':Number(_0x148356[_0x141b('0x3a')]['id'])});}});}})[_0x141b('0x14')](respondWithStatusCode(_0x27d72d,null))[_0x141b('0x26')](handleError(_0x27d72d,null));};exports[_0x141b('0x76')]=function(_0x381eb4,_0x56d26f){var _0xc1cf7b={};var _0x56b5b8={};var _0x248249;var _0x559718;return db[_0x141b('0x1d')][_0x141b('0x3d')]({'where':{'id':_0x381eb4[_0x141b('0x3a')]['id']}})[_0x141b('0x14')](handleEntityNotFound(_0x56d26f,null))[_0x141b('0x14')](function(_0x34c64f){if(_0x34c64f){_0x248249=_0x34c64f;_0x56b5b8['model']=_[_0x141b('0x29')](db[_0x141b('0x43')]['rawAttributes']);_0x56b5b8[_0x141b('0x24')]=_[_0x141b('0x29')](_0x381eb4[_0x141b('0x24')]);_0x56b5b8['filters']=_[_0x141b('0x2b')](_0x56b5b8['model'],_0x56b5b8['query']);_0xc1cf7b[_0x141b('0x2c')]=_[_0x141b('0x2b')](_0x56b5b8[_0x141b('0x28')],qs[_0x141b('0x2d')](_0x381eb4[_0x141b('0x24')][_0x141b('0x2d')]));_0xc1cf7b['attributes']=_0xc1cf7b[_0x141b('0x2c')][_0x141b('0x2e')]?_0xc1cf7b['attributes']:_0x56b5b8[_0x141b('0x28')];_0xc1cf7b[_0x141b('0x4d')]=qs[_0x141b('0x4e')](_0x381eb4['query'][_0x141b('0x4e')]);_0xc1cf7b[_0x141b('0x22')]=qs[_0x141b('0x2a')](_['pick'](_0x381eb4[_0x141b('0x24')],_0x56b5b8['filters']));if(_0x381eb4[_0x141b('0x24')][_0x141b('0x4f')]){_0xc1cf7b[_0x141b('0x22')]=_['merge'](_0xc1cf7b[_0x141b('0x22')],{'$or':_[_0x141b('0x1c')](_0xc1cf7b[_0x141b('0x2c')],function(_0x29eb01){var _0x8ed279={};_0x8ed279[_0x29eb01]={'$like':'%'+_0x381eb4[_0x141b('0x24')][_0x141b('0x4f')]+'%'};return _0x8ed279;})});}_0xc1cf7b=_['merge']({},_0xc1cf7b,_0x381eb4[_0x141b('0x31')]);return _0x248249[_0x141b('0x76')](_0xc1cf7b);}})[_0x141b('0x14')](function(_0x3d160a){if(_0x3d160a){_0x559718=_0x3d160a[_0x141b('0x2e')];if(!_0x381eb4[_0x141b('0x24')][_0x141b('0x3f')](_0x141b('0x40'))){_0xc1cf7b[_0x141b('0x11')]=qs[_0x141b('0x11')](_0x381eb4[_0x141b('0x24')][_0x141b('0x11')]);_0xc1cf7b[_0x141b('0x10')]=qs[_0x141b('0x10')](_0x381eb4[_0x141b('0x24')][_0x141b('0x10')]);}return _0x248249[_0x141b('0x76')](_0xc1cf7b);}})[_0x141b('0x14')](function(_0x47911e){if(_0x47911e){return _0x47911e?{'count':_0x559718,'rows':_0x47911e}:null;}})[_0x141b('0x14')](respondWithResult(_0x56d26f,null))['catch'](handleError(_0x56d26f,null));}; \ No newline at end of file +var _0xdf2a=['toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','bluebird','util','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./whatsappQueue.socket','status','end','json','offset','limit','Content-Range','then','destroy','get','sendStatus','name','send','index','rawAttributes','fieldName','type','key','getOptions','where','WhatsappQueue','count','include','findAll','rows','catch','model','keys','query','filters','intersection','attributes','fields','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','hasOwnProperty','order','sort','pick','WhatsappQueueId','filter','map','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','nolimit','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0xdf2a,0x172));var _0xadf2=function(_0x5c5c43,_0x3fd070){_0x5c5c43=_0x5c5c43-0x0;var _0x416ea6=_0xdf2a[_0x5c5c43];return _0x416ea6;};'use strict';var BPromise=require(_0xadf2('0x0'));var util=require(_0xadf2('0x1'));var _=require('lodash');var squel=require('squel');var Redis=require(_0xadf2('0x2'));var qs=require(_0xadf2('0x3'));var logger=require(_0xadf2('0x4'))(_0xadf2('0x5'));var config=require(_0xadf2('0x6'));var db=require('../../mysqldb')['db'];config[_0xadf2('0x7')]=_[_0xadf2('0x8')](config[_0xadf2('0x7')],{'host':_0xadf2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadf2('0x7')]));require(_0xadf2('0xa'))['register'](socket);function respondWithStatusCode(_0x1ada13,_0xc64c15){_0xc64c15=_0xc64c15||0xcc;return function(_0x36b792){if(_0x36b792){return _0x1ada13['sendStatus'](_0xc64c15);}return _0x1ada13[_0xadf2('0xb')](_0xc64c15)[_0xadf2('0xc')]();};}function respondWithResult(_0x7471f6,_0xe5e3d8){_0xe5e3d8=_0xe5e3d8||0xc8;return function(_0x223d5b){if(_0x223d5b){return _0x7471f6['status'](_0xe5e3d8)[_0xadf2('0xd')](_0x223d5b);}};}function respondWithFilteredResult(_0xd1d5c7,_0x133db7){return function(_0x2f98df){if(_0x2f98df){var _0x1e8c18=typeof _0x133db7['offset']==='undefined'&&typeof _0x133db7['limit']==='undefined';var _0x2c420b=_0x2f98df['count'];var _0x4b0e24=_0x1e8c18?0x0:_0x133db7[_0xadf2('0xe')];var _0x3d5a3d=_0x1e8c18?_0x2f98df['count']:_0x133db7[_0xadf2('0xe')]+_0x133db7[_0xadf2('0xf')];var _0x5d85f6;if(_0x3d5a3d>=_0x2c420b){_0x3d5a3d=_0x2c420b;_0x5d85f6=0xc8;}else{_0x5d85f6=0xce;}_0xd1d5c7[_0xadf2('0xb')](_0x5d85f6);return _0xd1d5c7['set'](_0xadf2('0x10'),_0x4b0e24+'-'+_0x3d5a3d+'/'+_0x2c420b)[_0xadf2('0xd')](_0x2f98df);}return null;};}function saveUpdates(_0x5db823){return function(_0xcdd215){if(_0xcdd215){return _0xcdd215['update'](_0x5db823)[_0xadf2('0x11')](function(_0x1230b7){return _0x1230b7;});}return null;};}function removeEntity(_0x451021){return function(_0x4e3266){if(_0x4e3266){return _0x4e3266[_0xadf2('0x12')]()[_0xadf2('0x11')](function(){var _0x222a1f=_0x4e3266[_0xadf2('0x13')]({'plain':!![]});var _0x5910cc='WhatsappQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x5910cc,'resourceId':_0x222a1f['id']}})[_0xadf2('0x11')](function(){return _0x4e3266;});})[_0xadf2('0x11')](function(){_0x451021['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a784d){return function(_0x1815b1){if(!_0x1815b1){_0x3a784d[_0xadf2('0x14')](0x194);}return _0x1815b1;};}function handleError(_0x2b4699,_0x4d0810){_0x4d0810=_0x4d0810||0x1f4;return function(_0x1a5a13){logger['error'](_0x1a5a13['stack']);if(_0x1a5a13[_0xadf2('0x15')]){delete _0x1a5a13[_0xadf2('0x15')];}_0x2b4699[_0xadf2('0xb')](_0x4d0810)[_0xadf2('0x16')](_0x1a5a13);};}exports[_0xadf2('0x17')]=function(_0x557c65,_0x396e3c){var _0x3a3d73={};var _0x566e28={'count':0x0,'rows':[]};var _0x39ca8e=_['map'](db['WhatsappQueue'][_0xadf2('0x18')],function(_0x36bfa4){return{'name':_0x36bfa4[_0xadf2('0x19')],'type':_0x36bfa4[_0xadf2('0x1a')][_0xadf2('0x1b')]};});_0x3a3d73=qs[_0xadf2('0x1c')](_0x39ca8e,_0x557c65);var _0x5539c7={'where':_0x3a3d73[_0xadf2('0x1d')]};return db[_0xadf2('0x1e')][_0xadf2('0x1f')](_0x5539c7)[_0xadf2('0x11')](function(_0x36833d){_0x566e28[_0xadf2('0x1f')]=_0x36833d;_0x3a3d73['include']=qs[_0xadf2('0x20')](_0x557c65['query']);return db[_0xadf2('0x1e')][_0xadf2('0x21')](_0x3a3d73);})[_0xadf2('0x11')](function(_0x3d2195){_0x566e28[_0xadf2('0x22')]=_0x3d2195;return _0x566e28;})[_0xadf2('0x11')](respondWithFilteredResult(_0x396e3c,_0x3a3d73))[_0xadf2('0x23')](handleError(_0x396e3c,null));};exports['show']=function(_0x53105c,_0x5b1fe4){var _0x1c54b0={'raw':!![],'where':{'id':_0x53105c['params']['id']}},_0x2018f6={};_0x2018f6[_0xadf2('0x24')]=_[_0xadf2('0x25')](db[_0xadf2('0x1e')][_0xadf2('0x18')]);_0x2018f6[_0xadf2('0x26')]=_['keys'](_0x53105c[_0xadf2('0x26')]);_0x2018f6[_0xadf2('0x27')]=_[_0xadf2('0x28')](_0x2018f6['model'],_0x2018f6[_0xadf2('0x26')]);_0x1c54b0[_0xadf2('0x29')]=_[_0xadf2('0x28')](_0x2018f6[_0xadf2('0x24')],qs[_0xadf2('0x2a')](_0x53105c[_0xadf2('0x26')][_0xadf2('0x2a')]));_0x1c54b0[_0xadf2('0x29')]=_0x1c54b0[_0xadf2('0x29')][_0xadf2('0x2b')]?_0x1c54b0[_0xadf2('0x29')]:_0x2018f6[_0xadf2('0x24')];if(_0x53105c[_0xadf2('0x26')]['includeAll']){_0x1c54b0[_0xadf2('0x20')]=[{'all':!![]}];}_0x1c54b0=_[_0xadf2('0x2c')]({},_0x1c54b0,_0x53105c[_0xadf2('0x2d')]);return db[_0xadf2('0x1e')][_0xadf2('0x2e')](_0x1c54b0)[_0xadf2('0x11')](handleEntityNotFound(_0x5b1fe4,null))[_0xadf2('0x11')](respondWithResult(_0x5b1fe4,null))[_0xadf2('0x23')](handleError(_0x5b1fe4,null));};exports[_0xadf2('0x2f')]=function(_0x39fe42,_0x23f9fd){return db[_0xadf2('0x1e')]['create'](_0x39fe42[_0xadf2('0x30')],{})[_0xadf2('0x11')](function(_0x307079){var _0x5b3b70=_0x39fe42[_0xadf2('0x31')][_0xadf2('0x13')]({'plain':!![]});if(!_0x5b3b70)throw new Error(_0xadf2('0x32'));if(_0x5b3b70[_0xadf2('0x33')]===_0xadf2('0x31')){var _0x27112b=_0x307079['get']({'plain':!![]});var _0x2fed93=_0xadf2('0x34');return db['UserProfileSection'][_0xadf2('0x2e')]({'where':{'name':_0x2fed93,'userProfileId':_0x5b3b70[_0xadf2('0x35')]},'raw':!![]})[_0xadf2('0x11')](function(_0x55b889){if(_0x55b889&&_0x55b889[_0xadf2('0x36')]===0x0){return db[_0xadf2('0x37')][_0xadf2('0x2f')]({'name':_0x27112b[_0xadf2('0x15')],'resourceId':_0x27112b['id'],'type':_0x55b889['name'],'sectionId':_0x55b889['id']},{})['then'](function(){return _0x307079;});}else{return _0x307079;}})[_0xadf2('0x23')](function(_0x90d4a3){logger['error'](_0xadf2('0x38'),_0x90d4a3);throw _0x90d4a3;});}return _0x307079;})[_0xadf2('0x11')](respondWithResult(_0x23f9fd,0xc9))[_0xadf2('0x23')](handleError(_0x23f9fd,null));};exports[_0xadf2('0x39')]=function(_0x53869c,_0x5397aa){if(_0x53869c[_0xadf2('0x30')]['id']){delete _0x53869c[_0xadf2('0x30')]['id'];}return db[_0xadf2('0x1e')][_0xadf2('0x2e')]({'where':{'id':_0x53869c[_0xadf2('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5397aa,null))[_0xadf2('0x11')](saveUpdates(_0x53869c['body'],null))['then'](respondWithResult(_0x5397aa,null))[_0xadf2('0x23')](handleError(_0x5397aa,null));};exports[_0xadf2('0x12')]=function(_0x14cc5f,_0x19f43d){return db[_0xadf2('0x1e')][_0xadf2('0x2e')]({'where':{'id':_0x14cc5f[_0xadf2('0x3a')]['id']}})[_0xadf2('0x11')](handleEntityNotFound(_0x19f43d,null))[_0xadf2('0x11')](removeEntity(_0x19f43d,null))[_0xadf2('0x23')](handleError(_0x19f43d,null));};exports['describe']=function(_0x38c98d,_0x5a0b62){return db[_0xadf2('0x1e')][_0xadf2('0x3b')]()[_0xadf2('0x11')](respondWithResult(_0x5a0b62,null))[_0xadf2('0x23')](handleError(_0x5a0b62,null));};exports[_0xadf2('0x3c')]=function(_0x5b7ac1,_0x2d3540){var _0x2bf91c={'raw':!![],'where':{}},_0xc072e2={},_0x16394a;return db[_0xadf2('0x1e')]['findOne']({'where':{'id':_0x5b7ac1[_0xadf2('0x3a')]['id']}})[_0xadf2('0x11')](handleEntityNotFound(_0x2d3540,null))['then'](function(_0x427a4a){if(_0x427a4a){_0x16394a=_0x427a4a[_0xadf2('0x13')]({'plain':!![]});_0xc072e2[_0xadf2('0x24')]=_[_0xadf2('0x25')](db['UserWhatsappQueue'][_0xadf2('0x18')]);_0xc072e2[_0xadf2('0x26')]=_['keys'](_0x5b7ac1['query']);_0xc072e2[_0xadf2('0x27')]=_[_0xadf2('0x28')](_0xc072e2[_0xadf2('0x24')],_0xc072e2[_0xadf2('0x26')]);_0x2bf91c[_0xadf2('0x29')]=_['intersection'](_0xc072e2[_0xadf2('0x24')],qs['fields'](_0x5b7ac1['query'][_0xadf2('0x2a')]));_0x2bf91c[_0xadf2('0x29')]=_0x2bf91c['attributes']['length']?_0x2bf91c[_0xadf2('0x29')]:_0xc072e2[_0xadf2('0x24')];if(!_0x5b7ac1[_0xadf2('0x26')][_0xadf2('0x3d')]('nolimit')){_0x2bf91c['limit']=qs['limit'](_0x5b7ac1[_0xadf2('0x26')][_0xadf2('0xf')]);_0x2bf91c[_0xadf2('0xe')]=qs['offset'](_0x5b7ac1['query'][_0xadf2('0xe')]);}_0x2bf91c[_0xadf2('0x3e')]=qs[_0xadf2('0x3f')](_0x5b7ac1[_0xadf2('0x26')]['sort']);_0x2bf91c[_0xadf2('0x1d')]=qs[_0xadf2('0x27')](_[_0xadf2('0x40')](_0x5b7ac1[_0xadf2('0x26')],_0xc072e2[_0xadf2('0x27')]));_0x2bf91c[_0xadf2('0x1d')][_0xadf2('0x41')]=_0x427a4a['id'];if(_0x5b7ac1[_0xadf2('0x26')][_0xadf2('0x42')]){_0x2bf91c['where']=_[_0xadf2('0x2c')](_0x2bf91c[_0xadf2('0x1d')],{'$or':_[_0xadf2('0x43')](_0x2bf91c[_0xadf2('0x29')],function(_0xd63a59){var _0x36a602={};_0x36a602[_0xd63a59]={'$like':'%'+_0x5b7ac1[_0xadf2('0x26')][_0xadf2('0x42')]+'%'};return _0x36a602;})});}_0x2bf91c=_[_0xadf2('0x2c')]({},_0x2bf91c,_0x5b7ac1[_0xadf2('0x2d')]);return db[_0xadf2('0x44')]['findAll'](_0x2bf91c);}})[_0xadf2('0x11')](function(_0x36b505){if(_0x36b505){return db[_0xadf2('0x45')][_0xadf2('0x46')]({'where':{'id':_[_0xadf2('0x43')](_0x36b505,_0xadf2('0x47')),'role':_0xadf2('0x48')},'attributes':['id',_0xadf2('0x15'),_0xadf2('0x49'),_0xadf2('0x4a'),_0xadf2('0x4b')]});}})[_0xadf2('0x11')](function(_0x984ae2){if(_0x984ae2){return{'count':_0x984ae2[_0xadf2('0x1f')],'rows':_[_0xadf2('0x43')](_0x984ae2['rows'],function(_0xdfe311){return{'membername':_0xdfe311[_0xadf2('0x15')],'UserId':_0xdfe311['id'],'queue_name':_0x16394a[_0xadf2('0x15')],'WhatsappQueueId':_0x16394a['id'],'interface':util[_0xadf2('0x4c')]('%s/%s',_0xadf2('0x4d'),_0xdfe311[_0xadf2('0x15')]),'penalty':0x0,'paused':_0xdfe311[_0xadf2('0x49')],'createdAt':_0xdfe311[_0xadf2('0x4b')],'updatedAt':_0xdfe311['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d3540,_0x2bf91c))['catch'](handleError(_0x2d3540,null));};exports[_0xadf2('0x4e')]=function(_0x3f54f4,_0x3ca4ee){var _0x1eab3d={};var _0xbb9cd8={};var _0x518390;var _0x2b8eb9;return db[_0xadf2('0x1e')][_0xadf2('0x4f')]({'where':{'id':_0x3f54f4[_0xadf2('0x3a')]['id']}})[_0xadf2('0x11')](handleEntityNotFound(_0x3ca4ee,null))[_0xadf2('0x11')](function(_0x252d51){if(_0x252d51){_0x518390=_0x252d51;_0xbb9cd8['model']=_[_0xadf2('0x25')](db[_0xadf2('0x50')][_0xadf2('0x18')]);_0xbb9cd8['query']=_[_0xadf2('0x25')](_0x3f54f4[_0xadf2('0x26')]);_0xbb9cd8['filters']=_['intersection'](_0xbb9cd8[_0xadf2('0x24')],_0xbb9cd8[_0xadf2('0x26')]);_0x1eab3d[_0xadf2('0x29')]=_[_0xadf2('0x28')](_0xbb9cd8[_0xadf2('0x24')],qs['fields'](_0x3f54f4['query'][_0xadf2('0x2a')]));_0x1eab3d[_0xadf2('0x29')]=_0x1eab3d[_0xadf2('0x29')][_0xadf2('0x2b')]?_0x1eab3d[_0xadf2('0x29')]:_0xbb9cd8[_0xadf2('0x24')];_0x1eab3d['order']=qs[_0xadf2('0x3f')](_0x3f54f4[_0xadf2('0x26')][_0xadf2('0x3f')]);_0x1eab3d['where']=qs['filters'](_[_0xadf2('0x40')](_0x3f54f4['query'],_0xbb9cd8['filters']));if(_0x3f54f4[_0xadf2('0x26')]['filter']){_0x1eab3d['where']=_[_0xadf2('0x2c')](_0x1eab3d[_0xadf2('0x1d')],{'$or':_[_0xadf2('0x43')](_0x1eab3d[_0xadf2('0x29')],function(_0x5c052b){var _0x4042d7={};_0x4042d7[_0x5c052b]={'$like':'%'+_0x3f54f4['query'][_0xadf2('0x42')]+'%'};return _0x4042d7;})});}_0x1eab3d=_[_0xadf2('0x2c')]({},_0x1eab3d,_0x3f54f4[_0xadf2('0x2d')]);return _0x518390[_0xadf2('0x4e')](_0x1eab3d);}})[_0xadf2('0x11')](function(_0x231987){if(_0x231987){_0x2b8eb9=_0x231987[_0xadf2('0x2b')];if(!_0x3f54f4[_0xadf2('0x26')][_0xadf2('0x3d')](_0xadf2('0x51'))){_0x1eab3d[_0xadf2('0xf')]=qs[_0xadf2('0xf')](_0x3f54f4[_0xadf2('0x26')][_0xadf2('0xf')]);_0x1eab3d[_0xadf2('0xe')]=qs[_0xadf2('0xe')](_0x3f54f4['query'][_0xadf2('0xe')]);}return _0x518390[_0xadf2('0x4e')](_0x1eab3d);}})[_0xadf2('0x11')](function(_0x10f915){if(_0x10f915){return _0x10f915?{'count':_0x2b8eb9,'rows':_0x10f915}:null;}})[_0xadf2('0x11')](respondWithResult(_0x3ca4ee,null))[_0xadf2('0x23')](handleError(_0x3ca4ee,null));};exports['addTeams']=function(_0x5decf7,_0xca680d){var _0x1c5adb=_0x5decf7['body'][_0xadf2('0x52')];return db[_0xadf2('0x50')][_0xadf2('0x21')]({'where':{'id':_0x1c5adb},'attributes':['id'],'include':[{'model':db[_0xadf2('0x45')],'as':_0xadf2('0x53'),'attributes':['id','name','online',_0xadf2('0x54'),_0xadf2('0x55')],'raw':!![]}]})[_0xadf2('0x11')](function(_0x4740a6){if(_0x4740a6){var _0x1f2175=_[_0xadf2('0x56')](_0x4740a6,function(_0x348ec3){var _0x31b549=_0x348ec3[_0xadf2('0x13')]({'plain':!![]});return _0x31b549[_0xadf2('0x53')];});return db['WhatsappQueue'][_0xadf2('0x2e')]({'where':{'id':_0x5decf7[_0xadf2('0x3a')]['id']}})['then'](function(_0x2732ee){return db[_0xadf2('0x57')]['transaction'](function(_0x30ae98){return _0x2732ee['addTeams'](_0x1c5adb,{'transaction':_0x30ae98})[_0xadf2('0x11')](function(){return BPromise[_0xadf2('0x58')](_0x1f2175,function(_0x4f64dc){return db['UserWhatsappQueue'][_0xadf2('0x59')]({'where':{'UserId':_0x4f64dc['id'],'WhatsappQueueId':_0x5decf7[_0xadf2('0x3a')]['id']},'transaction':_0x30ae98});});})[_0xadf2('0x11')](function(){_0x1f2175[_0xadf2('0x5a')](function(_0x31f779){socket[_0xadf2('0x5b')](_0xadf2('0x5c'),{'UserId':_0x31f779['id'],'WhatsappQueueId':_0x2732ee['id']});});});});});}})[_0xadf2('0x11')](respondWithStatusCode(_0xca680d,null))[_0xadf2('0x23')](handleError(_0xca680d,null));};exports[_0xadf2('0x5d')]=function(_0x283b08,_0x203ef8){return db[_0xadf2('0x50')][_0xadf2('0x21')]({'where':{'id':_0x283b08[_0xadf2('0x26')][_0xadf2('0x52')]},'attributes':['id'],'include':[{'model':db[_0xadf2('0x45')],'as':_0xadf2('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x203ef8,null))['then'](function(_0x2f0aa1){var _0x3f1e89=_[_0xadf2('0x43')](_0x2f0aa1,'id');var _0x26e41e=[];var _0x2f08ee=[];var _0x56772b=squel[_0xadf2('0x5e')]();_0x56772b['field'](_0xadf2('0x5f'))[_0xadf2('0x60')](_0xadf2('0x61'),'tq')[_0xadf2('0x62')]('user_has_teams','ut',_0xadf2('0x63'))[_0xadf2('0x1d')](_0xadf2('0x64'),_0x283b08[_0xadf2('0x3a')]['id']);for(var _0x242c7d=0x0;_0x242c7d<_0x2f0aa1['length'];_0x242c7d+=0x1){let _0x172a9a=_0x2f0aa1[_0x242c7d];for(var _0x1dec21=0x0;_0x1dec21<_0x172a9a[_0xadf2('0x53')][_0xadf2('0x2b')];_0x1dec21+=0x1){let _0x372fa4=_0x172a9a[_0xadf2('0x53')][_0x1dec21];var _0x404a64=_0x56772b[_0xadf2('0x65')]();_0x404a64[_0xadf2('0x1d')]('ut.UserId\x20=\x20?',_0x372fa4['id']);_0x2f08ee['push'](db[_0xadf2('0x57')][_0xadf2('0x26')](_0x404a64[_0xadf2('0x66')](),{'type':db[_0xadf2('0x57')][_0xadf2('0x67')][_0xadf2('0x68')]})[_0xadf2('0x11')](function(_0x31d230){if(_0x31d230[_0xadf2('0x2b')]===0x1){return _0x372fa4['id'];}else{var _0x45aa19=_['every'](_[_0xadf2('0x43')](_0x31d230,_0xadf2('0x69')),function(_0x339b00){return _[_0xadf2('0x6a')](_0x3f1e89,_0x339b00);});if(_0x45aa19){return _0x372fa4['id'];}}}));}}return BPromise[_0xadf2('0x6b')](_0x2f08ee)[_0xadf2('0x11')](function(_0x8b006c){_0x26e41e=_(_0x26e41e)[_0xadf2('0x6c')](_0x8b006c)[_0xadf2('0x6d')]()[_0xadf2('0x6e')]();return db[_0xadf2('0x1e')][_0xadf2('0x2e')]({'where':{'id':_0x283b08[_0xadf2('0x3a')]['id']}})['then'](function(_0x4ccbed){return db[_0xadf2('0x57')]['transaction'](function(_0x26b67c){return _0x4ccbed['removeTeams'](_0x283b08[_0xadf2('0x26')]['ids'],{'transaction':_0x26b67c})[_0xadf2('0x11')](function(){if(!_[_0xadf2('0x6f')](_0x26e41e)){return _0x4ccbed[_0xadf2('0x70')](_0x26e41e,{'transaction':_0x26b67c});}})['then'](function(){_0x26e41e['forEach'](function(_0x984b1e){socket[_0xadf2('0x5b')](_0xadf2('0x71'),{'UserId':_0x984b1e,'WhatsappQueueId':_0x4ccbed['id']});});});});});});})[_0xadf2('0x11')](respondWithStatusCode(_0x203ef8,null))['catch'](handleError(_0x203ef8,null));};exports[_0xadf2('0x72')]=function(_0x3960b5,_0x56a0c4){return db[_0xadf2('0x1e')][_0xadf2('0x2e')]({'where':{'id':_0x3960b5[_0xadf2('0x3a')]['id']}})['then'](handleEntityNotFound(_0x56a0c4,null))[_0xadf2('0x11')](function(_0x370181){if(_0x370181){return _0x370181['addAgents'](_0x3960b5[_0xadf2('0x30')]['ids'],_[_0xadf2('0x73')](_0x3960b5[_0xadf2('0x30')],[_0xadf2('0x52'),'id'])||{})['spread'](function(_0x22e226){for(var _0x3fdfe6=0x0;_0x3fdfe6<_0x3960b5[_0xadf2('0x30')]['ids'][_0xadf2('0x2b')];_0x3fdfe6+=0x1){socket[_0xadf2('0x5b')](_0xadf2('0x5c'),{'UserId':Number(_0x3960b5[_0xadf2('0x30')][_0xadf2('0x52')][_0x3fdfe6]),'WhatsappQueueId':Number(_0x3960b5['params']['id'])});}return _0x22e226;});}})[_0xadf2('0x11')](respondWithResult(_0x56a0c4,null))[_0xadf2('0x23')](handleError(_0x56a0c4,null));};exports[_0xadf2('0x70')]=function(_0x3ca632,_0x31d837){return db[_0xadf2('0x1e')][_0xadf2('0x2e')]({'where':{'id':_0x3ca632[_0xadf2('0x3a')]['id']}})['then'](handleEntityNotFound(_0x31d837,null))[_0xadf2('0x11')](function(_0x59b65c){if(_0x59b65c){return _0x59b65c['removeAgents'](_0x3ca632[_0xadf2('0x26')]['ids'])[_0xadf2('0x11')](function(){if(_[_0xadf2('0x74')](_0x3ca632[_0xadf2('0x26')][_0xadf2('0x52')])){for(var _0x3cc011=0x0;_0x3cc011<_0x3ca632[_0xadf2('0x26')][_0xadf2('0x52')]['length'];_0x3cc011+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x3ca632[_0xadf2('0x26')]['ids'][_0x3cc011]),'WhatsappQueueId':Number(_0x3ca632[_0xadf2('0x3a')]['id'])});}}else{socket[_0xadf2('0x5b')]('userWhatsappQueue:remove',{'UserId':Number(_0x3ca632[_0xadf2('0x26')][_0xadf2('0x52')]),'WhatsappQueueId':Number(_0x3ca632[_0xadf2('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x31d837,null))[_0xadf2('0x23')](handleError(_0x31d837,null));};exports[_0xadf2('0x75')]=function(_0x3dd57f,_0x246bc4){var _0xe06f6={};var _0x39d77b={};var _0x523c6b;var _0x81f122;return db[_0xadf2('0x1e')]['findOne']({'where':{'id':_0x3dd57f['params']['id']}})['then'](handleEntityNotFound(_0x246bc4,null))[_0xadf2('0x11')](function(_0x17fa8c){if(_0x17fa8c){_0x523c6b=_0x17fa8c;_0x39d77b[_0xadf2('0x24')]=_[_0xadf2('0x25')](db[_0xadf2('0x45')][_0xadf2('0x18')]);_0x39d77b[_0xadf2('0x26')]=_[_0xadf2('0x25')](_0x3dd57f[_0xadf2('0x26')]);_0x39d77b[_0xadf2('0x27')]=_[_0xadf2('0x28')](_0x39d77b['model'],_0x39d77b[_0xadf2('0x26')]);_0xe06f6[_0xadf2('0x29')]=_[_0xadf2('0x28')](_0x39d77b[_0xadf2('0x24')],qs[_0xadf2('0x2a')](_0x3dd57f[_0xadf2('0x26')][_0xadf2('0x2a')]));_0xe06f6['attributes']=_0xe06f6[_0xadf2('0x29')][_0xadf2('0x2b')]?_0xe06f6[_0xadf2('0x29')]:_0x39d77b[_0xadf2('0x24')];_0xe06f6[_0xadf2('0x3e')]=qs['sort'](_0x3dd57f[_0xadf2('0x26')]['sort']);_0xe06f6['where']=qs['filters'](_[_0xadf2('0x40')](_0x3dd57f[_0xadf2('0x26')],_0x39d77b[_0xadf2('0x27')]));if(_0x3dd57f[_0xadf2('0x26')]['filter']){_0xe06f6[_0xadf2('0x1d')]=_[_0xadf2('0x2c')](_0xe06f6[_0xadf2('0x1d')],{'$or':_[_0xadf2('0x43')](_0xe06f6['attributes'],function(_0x1de553){var _0x3f3a59={};_0x3f3a59[_0x1de553]={'$like':'%'+_0x3dd57f['query']['filter']+'%'};return _0x3f3a59;})});}_0xe06f6=_[_0xadf2('0x2c')]({},_0xe06f6,_0x3dd57f[_0xadf2('0x2d')]);return _0x523c6b[_0xadf2('0x75')](_0xe06f6);}})[_0xadf2('0x11')](function(_0x556590){if(_0x556590){_0x81f122=_0x556590[_0xadf2('0x2b')];if(!_0x3dd57f[_0xadf2('0x26')]['hasOwnProperty'](_0xadf2('0x51'))){_0xe06f6[_0xadf2('0xf')]=qs[_0xadf2('0xf')](_0x3dd57f[_0xadf2('0x26')][_0xadf2('0xf')]);_0xe06f6[_0xadf2('0xe')]=qs[_0xadf2('0xe')](_0x3dd57f[_0xadf2('0x26')][_0xadf2('0xe')]);}return _0x523c6b[_0xadf2('0x75')](_0xe06f6);}})[_0xadf2('0x11')](function(_0x6cbd13){if(_0x6cbd13){return _0x6cbd13?{'count':_0x81f122,'rows':_0x6cbd13}:null;}})['then'](respondWithResult(_0x246bc4,null))['catch'](handleError(_0x246bc4,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 17a7b3f..d8cb61d 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 _0x5e5a=['hasOwnProperty','exports','../../mysqldb','WhatsappQueue','setMaxListeners','remove','emit'];(function(_0x2f957e,_0x1a62c0){var _0x23108a=function(_0xe7ba38){while(--_0xe7ba38){_0x2f957e['push'](_0x2f957e['shift']());}};_0x23108a(++_0x1a62c0);}(_0x5e5a,0x1ec));var _0xa5e5=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x5e5a[_0x288f5e];return _0x476cc9;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xa5e5('0x0'))['db'][_0xa5e5('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xa5e5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa5e5('0x3')};function emitEvent(_0x4bacdd){return function(_0x160cac,_0x5f3e6d,_0x20b49f){WhatsappQueueEvents[_0xa5e5('0x4')](_0x4bacdd+':'+_0x160cac['id'],_0x160cac);WhatsappQueueEvents['emit'](_0x4bacdd,_0x160cac);_0x20b49f(null);};}for(var e in events){if(events[_0xa5e5('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xa5e5('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0x8b37=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','remove'];(function(_0x5e79c6,_0x53d559){var _0x5f027c=function(_0x3d1de7){while(--_0x3d1de7){_0x5e79c6['push'](_0x5e79c6['shift']());}};_0x5f027c(++_0x53d559);}(_0x8b37,0x109));var _0x78b3=function(_0x491e91,_0x25743b){_0x491e91=_0x491e91-0x0;var _0x25ae85=_0x8b37[_0x491e91];return _0x25ae85;};'use strict';var EventEmitter=require(_0x78b3('0x0'));var WhatsappQueue=require(_0x78b3('0x1'))['db'][_0x78b3('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x78b3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x78b3('0x4')};function emitEvent(_0x4e703b){return function(_0x299dcf,_0x142b7f,_0x408193){WhatsappQueueEvents[_0x78b3('0x5')](_0x4e703b+':'+_0x299dcf['id'],_0x299dcf);WhatsappQueueEvents[_0x78b3('0x5')](_0x4e703b,_0x299dcf);_0x408193(null);};}for(var e in events){if(events[_0x78b3('0x6')](e)){var event=events[e];WhatsappQueue[_0x78b3('0x7')](e,emitEvent(event));}}module[_0x78b3('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 98fffb1..5bba817 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 _0x246c=['../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0xaf5d44,_0x5642db){var _0x1e0a8c=function(_0x4d1ef5){while(--_0x4d1ef5){_0xaf5d44['push'](_0xaf5d44['shift']());}};_0x1e0a8c(++_0x5642db);}(_0x246c,0x102));var _0xc246=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x246c[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xc246('0x0'));var util=require('util');var logger=require(_0xc246('0x1'))(_0xc246('0x2'));var moment=require(_0xc246('0x3'));var BPromise=require(_0xc246('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc246('0x5'));var rimraf=require('rimraf');var config=require(_0xc246('0x6'));var attributes=require(_0xc246('0x7'));module['exports']=function(_0xcf6a93,_0x442a95){return _0xcf6a93[_0xc246('0x8')](_0xc246('0x9'),attributes,{'tableName':_0xc246('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc22=['define','WhatsappQueue','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0xdc22,0x1e6));var _0x2dc2=function(_0x16cb4b,_0x481b00){_0x16cb4b=_0x16cb4b-0x0;var _0x2e1bd8=_0xdc22[_0x16cb4b];return _0x2e1bd8;};'use strict';var _=require(_0x2dc2('0x0'));var util=require(_0x2dc2('0x1'));var logger=require(_0x2dc2('0x2'))(_0x2dc2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2dc2('0x4'));var fs=require('fs');var path=require(_0x2dc2('0x5'));var rimraf=require(_0x2dc2('0x6'));var config=require(_0x2dc2('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x2dc2('0x8')]=function(_0x3b0380,_0x8bf10e){return _0x3b0380[_0x2dc2('0x9')](_0x2dc2('0xa'),attributes,{'tableName':'whatsapp_queues','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 4ad06ce..53ca6e3 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 _0xc535=['socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','where','limit','include','map','attributes','model','ShowWhatsappQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x583eb0,_0x1e663d){var _0x2e4735=function(_0x4c9076){while(--_0x4c9076){_0x583eb0['push'](_0x583eb0['shift']());}};_0x2e4735(++_0x1e663d);}(_0xc535,0x1e9));var _0x5c53=function(_0x1b7574,_0x510040){_0x1b7574=_0x1b7574-0x0;var _0x4fd02a=_0xc535[_0x1b7574];return _0x4fd02a;};'use strict';var _=require(_0x5c53('0x0'));var util=require(_0x5c53('0x1'));var moment=require(_0x5c53('0x2'));var BPromise=require('bluebird');var rs=require(_0x5c53('0x3'));var fs=require('fs');var Redis=require(_0x5c53('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c53('0x5'));var logger=require(_0x5c53('0x6'))(_0x5c53('0x7'));var config=require(_0x5c53('0x8'));var jayson=require(_0x5c53('0x9'));var client=jayson[_0x5c53('0xa')][_0x5c53('0xb')]({'port':0x232a});config[_0x5c53('0xc')]=_[_0x5c53('0xd')](config[_0x5c53('0xc')],{'host':_0x5c53('0xe'),'port':0x18eb});var socket=require(_0x5c53('0xf'))(new Redis(config[_0x5c53('0xc')]));require(_0x5c53('0x10'))['register'](socket);function respondWithRpcPromise(_0x5e0800,_0x1dd215,_0x2faa2e){return new BPromise(function(_0x8495c3,_0x395dc9){return client[_0x5c53('0x11')](_0x5e0800,_0x2faa2e)[_0x5c53('0x12')](function(_0x2ae9f1){logger[_0x5c53('0x13')](_0x5c53('0x14'),_0x1dd215,_0x5c53('0x15'));logger[_0x5c53('0x16')](_0x5c53('0x17'),_0x1dd215,'request\x20sent',JSON[_0x5c53('0x18')](_0x2ae9f1));if(_0x2ae9f1['error']){if(_0x2ae9f1[_0x5c53('0x19')][_0x5c53('0x1a')]===0x1f4){logger['error'](_0x5c53('0x14'),_0x1dd215,_0x2ae9f1['error']['message']);return _0x395dc9(_0x2ae9f1[_0x5c53('0x19')][_0x5c53('0x1b')]);}logger[_0x5c53('0x19')](_0x5c53('0x14'),_0x1dd215,_0x2ae9f1[_0x5c53('0x19')][_0x5c53('0x1b')]);return _0x8495c3(_0x2ae9f1[_0x5c53('0x19')][_0x5c53('0x1b')]);}else{logger['info'](_0x5c53('0x14'),_0x1dd215,'request\x20sent');_0x8495c3(_0x2ae9f1[_0x5c53('0x1c')][_0x5c53('0x1b')]);}})[_0x5c53('0x1d')](function(_0x58c7e0){logger[_0x5c53('0x19')]('WhatsappQueue,\x20%s,\x20%s',_0x1dd215,_0x58c7e0);_0x395dc9(_0x58c7e0);});});}exports[_0x5c53('0x1e')]=function(_0x4ddadd){var _0x4dfa1a=this;return new Promise(function(_0x26e8e5,_0x460b03){return db[_0x5c53('0x1f')]['findAll']({'raw':_0x4ddadd[_0x5c53('0x20')]?_0x4ddadd[_0x5c53('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4ddadd['options']?_0x4ddadd[_0x5c53('0x20')][_0x5c53('0x21')]||null:null,'attributes':_0x4ddadd[_0x5c53('0x20')]?_0x4ddadd[_0x5c53('0x20')]['attributes']||null:null,'limit':_0x4ddadd[_0x5c53('0x20')]?_0x4ddadd[_0x5c53('0x20')][_0x5c53('0x22')]||null:null,'include':_0x4ddadd[_0x5c53('0x20')]?_0x4ddadd[_0x5c53('0x20')][_0x5c53('0x23')]?_[_0x5c53('0x24')](_0x4ddadd['options'][_0x5c53('0x23')],function(_0x153953){return{'model':db[_0x153953['model']],'as':_0x153953['as'],'attributes':_0x153953[_0x5c53('0x25')],'include':_0x153953[_0x5c53('0x23')]?_[_0x5c53('0x24')](_0x153953[_0x5c53('0x23')],function(_0x2e46eb){return{'model':db[_0x2e46eb[_0x5c53('0x26')]],'as':_0x2e46eb['as'],'attributes':_0x2e46eb[_0x5c53('0x25')],'include':_0x2e46eb[_0x5c53('0x23')]?_[_0x5c53('0x24')](_0x2e46eb[_0x5c53('0x23')],function(_0x259899){return{'model':db[_0x259899[_0x5c53('0x26')]],'as':_0x259899['as'],'attributes':_0x259899[_0x5c53('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5c53('0x12')](function(_0x40a3dc){logger[_0x5c53('0x13')](_0x5c53('0x1e'),_0x4ddadd);logger[_0x5c53('0x16')]('GetWhatsappQueue',_0x4ddadd,JSON['stringify'](_0x40a3dc));_0x26e8e5(_0x40a3dc);})[_0x5c53('0x1d')](function(_0x33389e){logger[_0x5c53('0x19')](_0x5c53('0x1e'),_0x33389e['message'],_0x4ddadd);_0x460b03(_0x4dfa1a[_0x5c53('0x19')](0x1f4,_0x33389e[_0x5c53('0x1b')]));});});};exports[_0x5c53('0x27')]=function(_0x1be3ea){var _0x5ab2b2=this;return new Promise(function(_0x2708a6,_0x4fb36f){return db['WhatsappQueue'][_0x5c53('0x28')]({'raw':_0x1be3ea['options']?_0x1be3ea[_0x5c53('0x20')][_0x5c53('0x29')]===undefined?!![]:![]:!![],'where':_0x1be3ea[_0x5c53('0x20')]?_0x1be3ea[_0x5c53('0x20')][_0x5c53('0x21')]||null:null,'attributes':_0x1be3ea[_0x5c53('0x20')]?_0x1be3ea[_0x5c53('0x20')][_0x5c53('0x25')]||null:null,'include':_0x1be3ea[_0x5c53('0x20')]?_0x1be3ea['options'][_0x5c53('0x23')]?_['map'](_0x1be3ea[_0x5c53('0x20')][_0x5c53('0x23')],function(_0x27e349){return{'model':db[_0x27e349['model']],'as':_0x27e349['as'],'attributes':_0x27e349['attributes'],'include':_0x27e349['include']?_[_0x5c53('0x24')](_0x27e349[_0x5c53('0x23')],function(_0x531141){return{'model':db[_0x531141[_0x5c53('0x26')]],'as':_0x531141['as'],'attributes':_0x531141[_0x5c53('0x25')],'include':_0x531141[_0x5c53('0x23')]?_[_0x5c53('0x24')](_0x531141['include'],function(_0x3ee049){return{'model':db[_0x3ee049[_0x5c53('0x26')]],'as':_0x3ee049['as'],'attributes':_0x3ee049['attributes']};}):[]};}):[]};}):[]:[]})[_0x5c53('0x12')](function(_0x541ec3){logger[_0x5c53('0x13')](_0x5c53('0x27'),_0x1be3ea);logger[_0x5c53('0x16')](_0x5c53('0x27'),_0x1be3ea,JSON[_0x5c53('0x18')](_0x541ec3));_0x2708a6(_0x541ec3);})[_0x5c53('0x1d')](function(_0x3631ca){logger['error'](_0x5c53('0x27'),_0x3631ca['message'],_0x1be3ea);_0x4fb36f(_0x5ab2b2['error'](0x1f4,_0x3631ca[_0x5c53('0x1b')]));});});}; \ No newline at end of file +var _0x882d=['moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowWhatsappQueue','WhatsappQueue','stringify','lodash','util'];(function(_0x3da96c,_0x13e1a1){var _0x1ed53c=function(_0x118001){while(--_0x118001){_0x3da96c['push'](_0x3da96c['shift']());}};_0x1ed53c(++_0x13e1a1);}(_0x882d,0x11e));var _0xd882=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x882d[_0x334599];return _0x4cdff2;};'use strict';var _=require(_0xd882('0x0'));var util=require(_0xd882('0x1'));var moment=require(_0xd882('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd882('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd882('0x4'))(_0xd882('0x5'));var config=require(_0xd882('0x6'));var jayson=require(_0xd882('0x7'));var client=jayson[_0xd882('0x8')][_0xd882('0x9')]({'port':0x232a});config[_0xd882('0xa')]=_[_0xd882('0xb')](config[_0xd882('0xa')],{'host':_0xd882('0xc'),'port':0x18eb});var socket=require(_0xd882('0xd'))(new Redis(config[_0xd882('0xa')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x41047e,_0x13e873,_0x1c366d){return new BPromise(function(_0x10ca2c,_0xb35e49){return client['request'](_0x41047e,_0x1c366d)['then'](function(_0x2e5c61){logger['info'](_0xd882('0xe'),_0x13e873,_0xd882('0xf'));logger[_0xd882('0x10')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x13e873,_0xd882('0xf'),JSON['stringify'](_0x2e5c61));if(_0x2e5c61[_0xd882('0x11')]){if(_0x2e5c61['error'][_0xd882('0x12')]===0x1f4){logger['error'](_0xd882('0xe'),_0x13e873,_0x2e5c61[_0xd882('0x11')][_0xd882('0x13')]);return _0xb35e49(_0x2e5c61['error'][_0xd882('0x13')]);}logger['error'](_0xd882('0xe'),_0x13e873,_0x2e5c61[_0xd882('0x11')]['message']);return _0x10ca2c(_0x2e5c61[_0xd882('0x11')]['message']);}else{logger[_0xd882('0x14')](_0xd882('0xe'),_0x13e873,_0xd882('0xf'));_0x10ca2c(_0x2e5c61[_0xd882('0x15')][_0xd882('0x13')]);}})[_0xd882('0x16')](function(_0x3f3b9b){logger[_0xd882('0x11')](_0xd882('0xe'),_0x13e873,_0x3f3b9b);_0xb35e49(_0x3f3b9b);});});}exports[_0xd882('0x17')]=function(_0x342b03){var _0x19e3bd=this;return new Promise(function(_0x1795c5,_0x457f9d){return db['WhatsappQueue'][_0xd882('0x18')]({'raw':_0x342b03[_0xd882('0x19')]?_0x342b03[_0xd882('0x19')][_0xd882('0x1a')]===undefined?!![]:![]:!![],'where':_0x342b03[_0xd882('0x19')]?_0x342b03[_0xd882('0x19')][_0xd882('0x1b')]||null:null,'attributes':_0x342b03[_0xd882('0x19')]?_0x342b03['options'][_0xd882('0x1c')]||null:null,'limit':_0x342b03[_0xd882('0x19')]?_0x342b03[_0xd882('0x19')]['limit']||null:null,'include':_0x342b03[_0xd882('0x19')]?_0x342b03[_0xd882('0x19')][_0xd882('0x1d')]?_[_0xd882('0x1e')](_0x342b03[_0xd882('0x19')][_0xd882('0x1d')],function(_0x2bcb00){return{'model':db[_0x2bcb00[_0xd882('0x1f')]],'as':_0x2bcb00['as'],'attributes':_0x2bcb00[_0xd882('0x1c')],'include':_0x2bcb00[_0xd882('0x1d')]?_[_0xd882('0x1e')](_0x2bcb00[_0xd882('0x1d')],function(_0x55f75c){return{'model':db[_0x55f75c['model']],'as':_0x55f75c['as'],'attributes':_0x55f75c[_0xd882('0x1c')],'include':_0x55f75c[_0xd882('0x1d')]?_[_0xd882('0x1e')](_0x55f75c[_0xd882('0x1d')],function(_0x11ac31){return{'model':db[_0x11ac31[_0xd882('0x1f')]],'as':_0x11ac31['as'],'attributes':_0x11ac31[_0xd882('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd882('0x20')](function(_0x2f1f9f){logger['info'](_0xd882('0x17'),_0x342b03);logger[_0xd882('0x10')]('GetWhatsappQueue',_0x342b03,JSON['stringify'](_0x2f1f9f));_0x1795c5(_0x2f1f9f);})[_0xd882('0x16')](function(_0x4184b1){logger['error'](_0xd882('0x17'),_0x4184b1[_0xd882('0x13')],_0x342b03);_0x457f9d(_0x19e3bd['error'](0x1f4,_0x4184b1[_0xd882('0x13')]));});});};exports[_0xd882('0x21')]=function(_0x423fb7){var _0x954b66=this;return new Promise(function(_0x1112f0,_0x4d858c){return db[_0xd882('0x22')]['find']({'raw':_0x423fb7[_0xd882('0x19')]?_0x423fb7[_0xd882('0x19')][_0xd882('0x1a')]===undefined?!![]:![]:!![],'where':_0x423fb7[_0xd882('0x19')]?_0x423fb7['options']['where']||null:null,'attributes':_0x423fb7[_0xd882('0x19')]?_0x423fb7[_0xd882('0x19')][_0xd882('0x1c')]||null:null,'include':_0x423fb7[_0xd882('0x19')]?_0x423fb7[_0xd882('0x19')][_0xd882('0x1d')]?_[_0xd882('0x1e')](_0x423fb7[_0xd882('0x19')][_0xd882('0x1d')],function(_0x3c65c3){return{'model':db[_0x3c65c3[_0xd882('0x1f')]],'as':_0x3c65c3['as'],'attributes':_0x3c65c3['attributes'],'include':_0x3c65c3[_0xd882('0x1d')]?_[_0xd882('0x1e')](_0x3c65c3[_0xd882('0x1d')],function(_0x1dabb9){return{'model':db[_0x1dabb9[_0xd882('0x1f')]],'as':_0x1dabb9['as'],'attributes':_0x1dabb9[_0xd882('0x1c')],'include':_0x1dabb9['include']?_['map'](_0x1dabb9['include'],function(_0x482fc2){return{'model':db[_0x482fc2[_0xd882('0x1f')]],'as':_0x482fc2['as'],'attributes':_0x482fc2[_0xd882('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4447b7){logger[_0xd882('0x14')]('ShowWhatsappQueue',_0x423fb7);logger[_0xd882('0x10')](_0xd882('0x21'),_0x423fb7,JSON[_0xd882('0x23')](_0x4447b7));_0x1112f0(_0x4447b7);})['catch'](function(_0x52b230){logger[_0xd882('0x11')](_0xd882('0x21'),_0x52b230[_0xd882('0x13')],_0x423fb7);_0x4d858c(_0x954b66['error'](0x1f4,_0x52b230[_0xd882('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 44d3ab2..ce38ced 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 _0x093a=['remove','update','register','length','./whatsappQueue.events'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0x093a,0xcc));var _0xa093=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x093a[_0x44afa4];return _0xcad289;};'use strict';var WhatsappQueueEvents=require(_0xa093('0x0'));var events=['save',_0xa093('0x1'),_0xa093('0x2')];function createListener(_0x2bb484,_0x330ea9){return function(_0xd2e567){_0x330ea9['emit'](_0x2bb484,_0xd2e567);};}function removeListener(_0x3df4e7,_0x4095e5){return function(){WhatsappQueueEvents['removeListener'](_0x3df4e7,_0x4095e5);};}exports[_0xa093('0x3')]=function(_0x1cd54b){for(var _0x5953ee=0x0,_0x1fe2c8=events[_0xa093('0x4')];_0x5953ee<_0x1fe2c8;_0x5953ee++){var _0x531e37=events[_0x5953ee];var _0x49ff07=createListener('whatsappQueue:'+_0x531e37,_0x1cd54b);WhatsappQueueEvents['on'](_0x531e37,_0x49ff07);}}; \ No newline at end of file +var _0x9027=['emit','removeListener','register','length','whatsappQueue:','save','remove','update'];(function(_0x5bb653,_0x42bf16){var _0x26119c=function(_0x41e380){while(--_0x41e380){_0x5bb653['push'](_0x5bb653['shift']());}};_0x26119c(++_0x42bf16);}(_0x9027,0x9d));var _0x7902=function(_0x42dfd3,_0x373724){_0x42dfd3=_0x42dfd3-0x0;var _0x331bf3=_0x9027[_0x42dfd3];return _0x331bf3;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x7902('0x0'),_0x7902('0x1'),_0x7902('0x2')];function createListener(_0x59db91,_0x481eb8){return function(_0x3d77de){_0x481eb8[_0x7902('0x3')](_0x59db91,_0x3d77de);};}function removeListener(_0x60abfa,_0x19b68e){return function(){WhatsappQueueEvents[_0x7902('0x4')](_0x60abfa,_0x19b68e);};}exports[_0x7902('0x5')]=function(_0x5a9bbd){for(var _0x554340=0x0,_0x464dc8=events[_0x7902('0x6')];_0x554340<_0x464dc8;_0x554340++){var _0x2fa064=events[_0x554340];var _0x1cb7a7=createListener(_0x7902('0x7')+_0x2fa064,_0x5a9bbd);WhatsappQueueEvents['on'](_0x2fa064,_0x1cb7a7);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index d975887..d008b12 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 _0x223c=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','post','create','/:id','update','delete','destroy','exports'];(function(_0x51e9bc,_0x49ae39){var _0x1b422a=function(_0x37579d){while(--_0x37579d){_0x51e9bc['push'](_0x51e9bc['shift']());}};_0x1b422a(++_0x49ae39);}(_0x223c,0x64));var _0xc223=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x223c[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xc223('0x0'));var util=require(_0xc223('0x1'));var path=require('path');var timeout=require(_0xc223('0x2'));var express=require(_0xc223('0x3'));var router=express[_0xc223('0x4')]();var fs_extra=require(_0xc223('0x5'));var auth=require(_0xc223('0x6'));var interaction=require(_0xc223('0x7'));var config=require(_0xc223('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0xc223('0x9')]('/',auth[_0xc223('0xa')](),controller[_0xc223('0xb')]);router['get'](_0xc223('0xc'),auth[_0xc223('0xa')](),controller['describe']);router[_0xc223('0x9')]('/:id',auth[_0xc223('0xa')](),controller['show']);router[_0xc223('0xd')]('/',auth[_0xc223('0xa')](),controller[_0xc223('0xe')]);router['put'](_0xc223('0xf'),auth[_0xc223('0xa')](),controller[_0xc223('0x10')]);router[_0xc223('0x11')](_0xc223('0xf'),auth[_0xc223('0xa')](),controller[_0xc223('0x12')]);module[_0xc223('0x13')]=router; \ No newline at end of file +var _0x980c=['describe','get','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe'];(function(_0x40beb0,_0x26cc7d){var _0x3f8cad=function(_0x2dbae6){while(--_0x2dbae6){_0x40beb0['push'](_0x40beb0['shift']());}};_0x3f8cad(++_0x26cc7d);}(_0x980c,0x1ab));var _0xc980=function(_0x1709bc,_0x3e1051){_0x1709bc=_0x1709bc-0x0;var _0x14aaa2=_0x980c[_0x1709bc];return _0x14aaa2;};'use strict';var multer=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var path=require('path');var timeout=require(_0xc980('0x2'));var express=require(_0xc980('0x3'));var router=express['Router']();var fs_extra=require(_0xc980('0x4'));var auth=require(_0xc980('0x5'));var interaction=require(_0xc980('0x6'));var config=require(_0xc980('0x7'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0xc980('0x8')](),controller['index']);router['get'](_0xc980('0x9'),auth[_0xc980('0x8')](),controller[_0xc980('0xa')]);router[_0xc980('0xb')]('/:id',auth[_0xc980('0x8')](),controller[_0xc980('0xc')]);router[_0xc980('0xd')]('/',auth['isAuthenticated'](),controller[_0xc980('0xe')]);router[_0xc980('0xf')]('/:id',auth[_0xc980('0x8')](),controller[_0xc980('0x10')]);router[_0xc980('0x11')]('/:id',auth[_0xc980('0x8')](),controller[_0xc980('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index a3a78e9..918883f 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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3d24a3,_0x3893ae){var _0x209258=function(_0x13f1d4){while(--_0x13f1d4){_0x3d24a3['push'](_0x3d24a3['shift']());}};_0x209258(++_0x3893ae);}(_0x7a54,0x106));var _0x47a5=function(_0x5b1c48,_0x2f762d){_0x5b1c48=_0x5b1c48-0x0;var _0x2e7328=_0x7a54[_0x5b1c48];return _0x2e7328;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2996fc,_0x1e5be2){var _0x2823b0=function(_0x475023){while(--_0x475023){_0x2996fc['push'](_0x2996fc['shift']());}};_0x2823b0(++_0x1e5be2);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 16fb96a..b6c9eab 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 _0x02ce=['then','destroy','error','name','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','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','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update'];(function(_0x169c73,_0x25ae7c){var _0x4eee20=function(_0x426a1c){while(--_0x426a1c){_0x169c73['push'](_0x169c73['shift']());}};_0x4eee20(++_0x25ae7c);}(_0x02ce,0x1ac));var _0xe02c=function(_0x3d4fac,_0x523fb8){_0x3d4fac=_0x3d4fac-0x0;var _0x3db219=_0x02ce[_0x3d4fac];return _0x3db219;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xefd882,_0x4411d8){return function(_0x3592ca){if(!_0x3592ca){_0xefd882[_0xe02c('0x1c')](0x194);}return _0x3592ca;};}function handleError(_0x16dfa3,_0x303d24){_0x303d24=_0x303d24||0x1f4;return function(_0x43dc78){logger[_0xe02c('0x2a')](_0x43dc78['stack']);if(_0x43dc78[_0xe02c('0x2b')]){delete _0x43dc78[_0xe02c('0x2b')];}_0x16dfa3[_0xe02c('0x22')](_0x303d24)['send'](_0x43dc78);};}exports[_0xe02c('0x2c')]=function(_0x2d1d98,_0x445421){var _0x287f7e={},_0x1e7eab={},_0x35a309={'count':0x0,'rows':[]};var _0x22a285=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x17d5b3){return{'name':_0x17d5b3['fieldName'],'type':_0x17d5b3[_0xe02c('0x30')][_0xe02c('0x31')]};});_0x1e7eab[_0xe02c('0x32')]=_[_0xe02c('0x2d')](_0x22a285,_0xe02c('0x2b'));_0x1e7eab[_0xe02c('0x33')]=_['keys'](_0x2d1d98[_0xe02c('0x33')]);_0x1e7eab[_0xe02c('0x34')]=_['intersection'](_0x1e7eab[_0xe02c('0x32')],_0x1e7eab[_0xe02c('0x33')]);_0x287f7e[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x1e7eab[_0xe02c('0x32')],qs['fields'](_0x2d1d98['query'][_0xe02c('0x37')]));_0x287f7e[_0xe02c('0x35')]=_0x287f7e['attributes'][_0xe02c('0x38')]?_0x287f7e['attributes']:_0x1e7eab[_0xe02c('0x32')];if(!_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x287f7e[_0xe02c('0x21')]=qs['limit'](_0x2d1d98[_0xe02c('0x33')]['limit']);_0x287f7e[_0xe02c('0x1e')]=qs[_0xe02c('0x1e')](_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x1e')]);}_0x287f7e[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x2d1d98['query'][_0xe02c('0x3c')]);_0x287f7e[_0xe02c('0x3d')]=qs['filters'](_[_0xe02c('0x3e')](_0x2d1d98[_0xe02c('0x33')],_0x1e7eab['filters']),_0x22a285);if(_0x2d1d98[_0xe02c('0x33')]['filter']){_0x287f7e[_0xe02c('0x3d')]=_[_0xe02c('0x3f')](_0x287f7e['where'],{'$or':_[_0xe02c('0x2d')](_0x22a285,function(_0x1eeddb){if(_0x1eeddb[_0xe02c('0x30')]!==_0xe02c('0x40')){var _0x3c4a65={};_0x3c4a65[_0x1eeddb[_0xe02c('0x2b')]]={'$like':'%'+_0x2d1d98['query'][_0xe02c('0x41')]+'%'};return _0x3c4a65;}})});}_0x287f7e=_['merge']({},_0x287f7e,_0x2d1d98['options']);var _0x3db057={'where':_0x287f7e[_0xe02c('0x3d')]};return db[_0xe02c('0x2e')][_0xe02c('0x20')](_0x3db057)['then'](function(_0x37e4fe){_0x35a309[_0xe02c('0x20')]=_0x37e4fe;if(_0x2d1d98[_0xe02c('0x33')]['includeAll']){_0x287f7e['include']=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x42')](_0x287f7e);})[_0xe02c('0x28')](function(_0x2313d2){_0x35a309[_0xe02c('0x43')]=_0x2313d2;return _0x35a309;})[_0xe02c('0x28')](respondWithFilteredResult(_0x445421,_0x287f7e))[_0xe02c('0x44')](handleError(_0x445421,null));};exports[_0xe02c('0x45')]=function(_0x21d66e,_0x53d123){var _0xc7e935={'raw':!![],'where':{'id':_0x21d66e['params']['id']}},_0x5ef4a1={};_0x5ef4a1[_0xe02c('0x32')]=_[_0xe02c('0x46')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x5ef4a1[_0xe02c('0x33')]=_[_0xe02c('0x46')](_0x21d66e[_0xe02c('0x33')]);_0x5ef4a1[_0xe02c('0x34')]=_['intersection'](_0x5ef4a1['model'],_0x5ef4a1[_0xe02c('0x33')]);_0xc7e935[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x5ef4a1['model'],qs[_0xe02c('0x37')](_0x21d66e[_0xe02c('0x33')][_0xe02c('0x37')]));_0xc7e935[_0xe02c('0x35')]=_0xc7e935[_0xe02c('0x35')][_0xe02c('0x38')]?_0xc7e935[_0xe02c('0x35')]:_0x5ef4a1[_0xe02c('0x32')];if(_0x21d66e[_0xe02c('0x33')][_0xe02c('0x47')]){_0xc7e935['include']=[{'all':!![]}];}_0xc7e935=_[_0xe02c('0x3f')]({},_0xc7e935,_0x21d66e[_0xe02c('0x48')]);return db[_0xe02c('0x2e')][_0xe02c('0x49')](_0xc7e935)[_0xe02c('0x28')](handleEntityNotFound(_0x53d123,null))[_0xe02c('0x28')](respondWithResult(_0x53d123,null))[_0xe02c('0x44')](handleError(_0x53d123,null));};exports[_0xe02c('0x4a')]=function(_0x30dc90,_0x1176c9){return db[_0xe02c('0x2e')][_0xe02c('0x4a')](_0x30dc90[_0xe02c('0x4b')],{})['then'](respondWithResult(_0x1176c9,0xc9))[_0xe02c('0x44')](handleError(_0x1176c9,null));};exports['update']=function(_0x15b05c,_0x324911){if(_0x15b05c[_0xe02c('0x4b')]['id']){delete _0x15b05c[_0xe02c('0x4b')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x49')]({'where':{'id':_0x15b05c[_0xe02c('0x4c')]['id']}})[_0xe02c('0x28')](handleEntityNotFound(_0x324911,null))[_0xe02c('0x28')](saveUpdates(_0x15b05c[_0xe02c('0x4b')],null))['then'](respondWithResult(_0x324911,null))[_0xe02c('0x44')](handleError(_0x324911,null));};exports[_0xe02c('0x29')]=function(_0xeb4214,_0x536cf7){return db[_0xe02c('0x2e')]['find']({'where':{'id':_0xeb4214[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x536cf7,null))['then'](removeEntity(_0x536cf7,null))['catch'](handleError(_0x536cf7,null));};exports['describe']=function(_0x51d540,_0x5740df){return db[_0xe02c('0x2e')][_0xe02c('0x4d')]()[_0xe02c('0x28')](respondWithResult(_0x5740df,null))[_0xe02c('0x44')](handleError(_0x5740df,null));}; \ No newline at end of file +var _0xb58b=['save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','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','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x251f9f,_0x1099d1){var _0x3da5b3=function(_0x2b70c3){while(--_0x2b70c3){_0x251f9f['push'](_0x251f9f['shift']());}};_0x3da5b3(++_0x1099d1);}(_0xb58b,0x1f1));var _0xbb58=function(_0xf38682,_0x2a589f){_0xf38682=_0xf38682-0x0;var _0x5c8ca0=_0xb58b[_0xf38682];return _0x5c8ca0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x2d556a,_0x15e4c5){return function(_0x4e0303){if(!_0x4e0303){_0x2d556a[_0xbb58('0x18')](0x194);}return _0x4e0303;};}function handleError(_0x3bd550,_0x1be0ae){_0x1be0ae=_0x1be0ae||0x1f4;return function(_0x129094){logger[_0xbb58('0x27')](_0x129094[_0xbb58('0x28')]);if(_0x129094[_0xbb58('0x29')]){delete _0x129094[_0xbb58('0x29')];}_0x3bd550[_0xbb58('0x19')](_0x1be0ae)[_0xbb58('0x2a')](_0x129094);};}exports[_0xbb58('0x2b')]=function(_0x28b3a3,_0x2a0481){var _0x4157c4={},_0x3559b6={},_0x573cca={'count':0x0,'rows':[]};var _0x2b0f73=_[_0xbb58('0x2c')](db[_0xbb58('0x2d')][_0xbb58('0x2e')],function(_0x3304b9){return{'name':_0x3304b9[_0xbb58('0x2f')],'type':_0x3304b9[_0xbb58('0x30')][_0xbb58('0x31')]};});_0x3559b6[_0xbb58('0x32')]=_['map'](_0x2b0f73,_0xbb58('0x29'));_0x3559b6[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x28b3a3[_0xbb58('0x33')]);_0x3559b6[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],_0x3559b6[_0xbb58('0x33')]);_0x4157c4[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x28b3a3[_0xbb58('0x33')]['fields']));_0x4157c4['attributes']=_0x4157c4['attributes'][_0xbb58('0x39')]?_0x4157c4[_0xbb58('0x37')]:_0x3559b6[_0xbb58('0x32')];if(!_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3a')](_0xbb58('0x3b'))){_0x4157c4[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x28b3a3['query'][_0xbb58('0x1e')]);_0x4157c4[_0xbb58('0x1c')]=qs['offset'](_0x28b3a3[_0xbb58('0x33')]['offset']);}_0x4157c4[_0xbb58('0x3c')]=qs['sort'](_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3d')]);_0x4157c4['where']=qs[_0xbb58('0x35')](_[_0xbb58('0x3e')](_0x28b3a3[_0xbb58('0x33')],_0x3559b6[_0xbb58('0x35')]),_0x2b0f73);if(_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3f')]){_0x4157c4[_0xbb58('0x40')]=_[_0xbb58('0x41')](_0x4157c4['where'],{'$or':_[_0xbb58('0x2c')](_0x2b0f73,function(_0x31aa4b){if(_0x31aa4b[_0xbb58('0x30')]!=='VIRTUAL'){var _0x4dbd5e={};_0x4dbd5e[_0x31aa4b[_0xbb58('0x29')]]={'$like':'%'+_0x28b3a3['query'][_0xbb58('0x3f')]+'%'};return _0x4dbd5e;}})});}_0x4157c4=_[_0xbb58('0x41')]({},_0x4157c4,_0x28b3a3[_0xbb58('0x42')]);var _0x560911={'where':_0x4157c4['where']};return db[_0xbb58('0x2d')][_0xbb58('0x1d')](_0x560911)[_0xbb58('0x26')](function(_0x24d82d){_0x573cca[_0xbb58('0x1d')]=_0x24d82d;if(_0x28b3a3[_0xbb58('0x33')]['includeAll']){_0x4157c4[_0xbb58('0x43')]=[{'all':!![]}];}return db[_0xbb58('0x2d')][_0xbb58('0x44')](_0x4157c4);})[_0xbb58('0x26')](function(_0x1185b3){_0x573cca[_0xbb58('0x45')]=_0x1185b3;return _0x573cca;})['then'](respondWithFilteredResult(_0x2a0481,_0x4157c4))[_0xbb58('0x46')](handleError(_0x2a0481,null));};exports['show']=function(_0x22f1c3,_0x285ad4){var _0x29fb1c={'raw':!![],'where':{'id':_0x22f1c3['params']['id']}},_0x45817f={};_0x45817f[_0xbb58('0x32')]=_[_0xbb58('0x34')](db[_0xbb58('0x2d')][_0xbb58('0x2e')]);_0x45817f['query']=_[_0xbb58('0x34')](_0x22f1c3['query']);_0x45817f[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],_0x45817f[_0xbb58('0x33')]);_0x29fb1c[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x22f1c3[_0xbb58('0x33')][_0xbb58('0x38')]));_0x29fb1c[_0xbb58('0x37')]=_0x29fb1c[_0xbb58('0x37')][_0xbb58('0x39')]?_0x29fb1c['attributes']:_0x45817f[_0xbb58('0x32')];if(_0x22f1c3['query']['includeAll']){_0x29fb1c[_0xbb58('0x43')]=[{'all':!![]}];}_0x29fb1c=_[_0xbb58('0x41')]({},_0x29fb1c,_0x22f1c3[_0xbb58('0x42')]);return db[_0xbb58('0x2d')][_0xbb58('0x47')](_0x29fb1c)[_0xbb58('0x26')](handleEntityNotFound(_0x285ad4,null))[_0xbb58('0x26')](respondWithResult(_0x285ad4,null))[_0xbb58('0x46')](handleError(_0x285ad4,null));};exports[_0xbb58('0x48')]=function(_0x39995e,_0x440fb3){return db['WhatsappQueueReport'][_0xbb58('0x48')](_0x39995e[_0xbb58('0x49')],{})['then'](respondWithResult(_0x440fb3,0xc9))[_0xbb58('0x46')](handleError(_0x440fb3,null));};exports[_0xbb58('0x24')]=function(_0xf94897,_0xdb0ff7){if(_0xf94897['body']['id']){delete _0xf94897[_0xbb58('0x49')]['id'];}return db['WhatsappQueueReport'][_0xbb58('0x47')]({'where':{'id':_0xf94897[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0xdb0ff7,null))['then'](saveUpdates(_0xf94897[_0xbb58('0x49')],null))[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,null))['catch'](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x25')]=function(_0x4ca201,_0x28301d){return db[_0xbb58('0x2d')][_0xbb58('0x47')]({'where':{'id':_0x4ca201[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x28301d,null))[_0xbb58('0x26')](removeEntity(_0x28301d,null))[_0xbb58('0x46')](handleError(_0x28301d,null));};exports['describe']=function(_0x449088,_0x1fd892){return db['WhatsappQueueReport'][_0xbb58('0x4b')]()[_0xbb58('0x26')](respondWithResult(_0x1fd892,null))['catch'](handleError(_0x1fd892,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 65f24fb..338d82a 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 _0xd9a0=['exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x2cc842,_0xd6800d){var _0x24adab=function(_0x41ab67){while(--_0x41ab67){_0x2cc842['push'](_0x2cc842['shift']());}};_0x24adab(++_0xd6800d);}(_0xd9a0,0x197));var _0x0d9a=function(_0x37fb9e,_0x3ce746){_0x37fb9e=_0x37fb9e-0x0;var _0x38a526=_0xd9a0[_0x37fb9e];return _0x38a526;};'use strict';var _=require('lodash');var util=require(_0x0d9a('0x0'));var logger=require(_0x0d9a('0x1'))(_0x0d9a('0x2'));var moment=require(_0x0d9a('0x3'));var BPromise=require(_0x0d9a('0x4'));var rp=require(_0x0d9a('0x5'));var fs=require('fs');var path=require(_0x0d9a('0x6'));var rimraf=require('rimraf');var config=require(_0x0d9a('0x7'));var attributes=require(_0x0d9a('0x8'));module[_0x0d9a('0x9')]=function(_0x17394e,_0x5d5f4e){return _0x17394e['define'](_0x0d9a('0xa'),attributes,{'tableName':_0x0d9a('0xb'),'paranoid':![],'indexes':[{'name':_0x0d9a('0xc'),'fields':[_0x0d9a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd7b1=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','uniqueid'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd7b1,0x90));var _0x1d7b=function(_0x17f179,_0x1572a0){_0x17f179=_0x17f179-0x0;var _0x12736f=_0xd7b1[_0x17f179];return _0x12736f;};'use strict';var _=require(_0x1d7b('0x0'));var util=require(_0x1d7b('0x1'));var logger=require(_0x1d7b('0x2'))(_0x1d7b('0x3'));var moment=require(_0x1d7b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d7b('0x5'));var rimraf=require(_0x1d7b('0x6'));var config=require(_0x1d7b('0x7'));var attributes=require(_0x1d7b('0x8'));module['exports']=function(_0x37dee4,_0x1f125e){return _0x37dee4[_0x1d7b('0x9')](_0x1d7b('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1d7b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 315e72b..db3bf14 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 _0x28b4=['stringify','error','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x28b4,0x14c));var _0x428b=function(_0x56341e,_0x3458de){_0x56341e=_0x56341e-0x0;var _0x1f5513=_0x28b4[_0x56341e];return _0x1f5513;};'use strict';var _=require(_0x428b('0x0'));var util=require(_0x428b('0x1'));var moment=require(_0x428b('0x2'));var BPromise=require(_0x428b('0x3'));var rs=require(_0x428b('0x4'));var fs=require('fs');var Redis=require(_0x428b('0x5'));var db=require(_0x428b('0x6'))['db'];var utils=require(_0x428b('0x7'));var logger=require(_0x428b('0x8'))(_0x428b('0x9'));var config=require(_0x428b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x428b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1437f5,_0x143a9f,_0x16893a){return new BPromise(function(_0x86b77b,_0x499a21){return client[_0x428b('0xc')](_0x1437f5,_0x16893a)[_0x428b('0xd')](function(_0x5346bf){logger['info'](_0x428b('0xe'),_0x143a9f,_0x428b('0xf'));logger[_0x428b('0x10')](_0x428b('0x11'),_0x143a9f,'request\x20sent',JSON[_0x428b('0x12')](_0x5346bf));if(_0x5346bf[_0x428b('0x13')]){if(_0x5346bf['error']['code']===0x1f4){logger[_0x428b('0x13')](_0x428b('0xe'),_0x143a9f,_0x5346bf['error']['message']);return _0x499a21(_0x5346bf[_0x428b('0x13')]['message']);}logger[_0x428b('0x13')](_0x428b('0xe'),_0x143a9f,_0x5346bf[_0x428b('0x13')][_0x428b('0x14')]);return _0x86b77b(_0x5346bf[_0x428b('0x13')][_0x428b('0x14')]);}else{logger[_0x428b('0x15')]('WhatsappQueueReport,\x20%s,\x20%s',_0x143a9f,_0x428b('0xf'));_0x86b77b(_0x5346bf[_0x428b('0x16')]['message']);}})[_0x428b('0x17')](function(_0x419955){logger[_0x428b('0x13')](_0x428b('0xe'),_0x143a9f,_0x419955);_0x499a21(_0x419955);});});}exports[_0x428b('0x18')]=function(_0x5de92f){var _0xc8a43=this;return new Promise(function(_0x4656c1,_0x381385){return db[_0x428b('0x19')][_0x428b('0x1a')](_0x5de92f[_0x428b('0x1b')],{'raw':_0x5de92f['options']?_0x5de92f[_0x428b('0x1c')][_0x428b('0x1d')]===undefined?!![]:![]:!![]})[_0x428b('0xd')](function(_0xf2a692){logger[_0x428b('0x15')](_0x428b('0x18'),_0x5de92f);logger[_0x428b('0x10')](_0x428b('0x18'),_0x5de92f,JSON[_0x428b('0x12')](_0xf2a692));_0x4656c1(_0xf2a692);})[_0x428b('0x17')](function(_0x4ca88d){logger[_0x428b('0x13')](_0x428b('0x18'),_0x4ca88d['message'],_0x5de92f);_0x381385(_0xc8a43[_0x428b('0x13')](0x1f4,_0x4ca88d[_0x428b('0x14')]));});});};exports[_0x428b('0x1e')]=function(_0x559ec1){var _0x1f7e90=this;return new Promise(function(_0x2fa3d1,_0x25739d){return db[_0x428b('0x19')][_0x428b('0x1f')](_0x559ec1[_0x428b('0x1b')],{'raw':_0x559ec1[_0x428b('0x1c')]?_0x559ec1[_0x428b('0x1c')][_0x428b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x559ec1[_0x428b('0x1c')]?_0x559ec1[_0x428b('0x1c')][_0x428b('0x20')]||null:null,'attributes':_0x559ec1[_0x428b('0x1c')]?_0x559ec1['options'][_0x428b('0x21')]||null:null,'limit':_0x559ec1['options']?_0x559ec1[_0x428b('0x1c')][_0x428b('0x22')]||null:null})[_0x428b('0xd')](function(_0x9b0741){logger['info'](_0x428b('0x1e'),_0x559ec1);logger['debug']('UpdateWhatsappQueueReport',_0x559ec1,JSON[_0x428b('0x12')](_0x9b0741));_0x2fa3d1(_0x9b0741);})[_0x428b('0x17')](function(_0x5794c9){logger['error']('UpdateWhatsappQueueReport',_0x5794c9[_0x428b('0x14')],_0x559ec1);_0x25739d(_0x1f7e90[_0x428b('0x13')](0x1f4,_0x5794c9[_0x428b('0x14')]));});});}; \ No newline at end of file +var _0xc151=['rpc','jayson/promise','client','http','request','then','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','body','options','raw','debug','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xc151,0x165));var _0x1c15=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc151[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1c15('0x0'));var util=require(_0x1c15('0x1'));var moment=require(_0x1c15('0x2'));var BPromise=require(_0x1c15('0x3'));var rs=require(_0x1c15('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c15('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c15('0x6'));var config=require('../../config/environment');var jayson=require(_0x1c15('0x7'));var client=jayson[_0x1c15('0x8')][_0x1c15('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x145def,_0x72e7ee,_0x276217){return new BPromise(function(_0x4a7509,_0x222613){return client[_0x1c15('0xa')](_0x145def,_0x276217)[_0x1c15('0xb')](function(_0x4fed61){logger[_0x1c15('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x72e7ee,_0x1c15('0xd'));logger['debug'](_0x1c15('0xe'),_0x72e7ee,'request\x20sent',JSON[_0x1c15('0xf')](_0x4fed61));if(_0x4fed61[_0x1c15('0x10')]){if(_0x4fed61['error'][_0x1c15('0x11')]===0x1f4){logger[_0x1c15('0x10')](_0x1c15('0x12'),_0x72e7ee,_0x4fed61[_0x1c15('0x10')][_0x1c15('0x13')]);return _0x222613(_0x4fed61[_0x1c15('0x10')][_0x1c15('0x13')]);}logger[_0x1c15('0x10')](_0x1c15('0x12'),_0x72e7ee,_0x4fed61[_0x1c15('0x10')]['message']);return _0x4a7509(_0x4fed61[_0x1c15('0x10')][_0x1c15('0x13')]);}else{logger[_0x1c15('0xc')](_0x1c15('0x12'),_0x72e7ee,_0x1c15('0xd'));_0x4a7509(_0x4fed61[_0x1c15('0x14')]['message']);}})[_0x1c15('0x15')](function(_0x1e2871){logger[_0x1c15('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x72e7ee,_0x1e2871);_0x222613(_0x1e2871);});});}exports[_0x1c15('0x16')]=function(_0x1c51c8){var _0xf3c6ca=this;return new Promise(function(_0x3501c0,_0x337719){return db['WhatsappQueueReport']['create'](_0x1c51c8[_0x1c15('0x17')],{'raw':_0x1c51c8['options']?_0x1c51c8[_0x1c15('0x18')][_0x1c15('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x9f912b){logger['info']('CreateWhatsappQueueReport',_0x1c51c8);logger[_0x1c15('0x1a')](_0x1c15('0x16'),_0x1c51c8,JSON['stringify'](_0x9f912b));_0x3501c0(_0x9f912b);})['catch'](function(_0x334f10){logger[_0x1c15('0x10')](_0x1c15('0x16'),_0x334f10[_0x1c15('0x13')],_0x1c51c8);_0x337719(_0xf3c6ca['error'](0x1f4,_0x334f10['message']));});});};exports[_0x1c15('0x1b')]=function(_0x4ff23d){var _0x5dab75=this;return new Promise(function(_0x5e0a9e,_0x51aec){return db[_0x1c15('0x1c')][_0x1c15('0x1d')](_0x4ff23d['body'],{'raw':_0x4ff23d[_0x1c15('0x18')]?_0x4ff23d[_0x1c15('0x18')][_0x1c15('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ff23d[_0x1c15('0x18')]?_0x4ff23d[_0x1c15('0x18')][_0x1c15('0x1e')]||null:null,'attributes':_0x4ff23d[_0x1c15('0x18')]?_0x4ff23d['options'][_0x1c15('0x1f')]||null:null,'limit':_0x4ff23d[_0x1c15('0x18')]?_0x4ff23d[_0x1c15('0x18')][_0x1c15('0x20')]||null:null})['then'](function(_0x14ed02){logger[_0x1c15('0xc')](_0x1c15('0x1b'),_0x4ff23d);logger['debug'](_0x1c15('0x1b'),_0x4ff23d,JSON['stringify'](_0x14ed02));_0x5e0a9e(_0x14ed02);})[_0x1c15('0x15')](function(_0x4da327){logger[_0x1c15('0x10')](_0x1c15('0x1b'),_0x4da327[_0x1c15('0x13')],_0x4ff23d);_0x51aec(_0x5dab75['error'](0x1f4,_0x4da327[_0x1c15('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 6fe09d8..826b978 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 _0x33c9=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy'];(function(_0xeff2c3,_0x3a5a82){var _0x2cade6=function(_0x5a26a1){while(--_0x5a26a1){_0xeff2c3['push'](_0xeff2c3['shift']());}};_0x2cade6(++_0x3a5a82);}(_0x33c9,0x1cd));var _0x933c=function(_0x51f08c,_0x21efe5){_0x51f08c=_0x51f08c-0x0;var _0x180fe6=_0x33c9[_0x51f08c];return _0x180fe6;};'use strict';var multer=require(_0x933c('0x0'));var util=require(_0x933c('0x1'));var path=require(_0x933c('0x2'));var timeout=require(_0x933c('0x3'));var express=require(_0x933c('0x4'));var router=express[_0x933c('0x5')]();var fs_extra=require(_0x933c('0x6'));var auth=require(_0x933c('0x7'));var interaction=require(_0x933c('0x8'));var config=require(_0x933c('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0x933c('0xa')]('/',auth['isAuthenticated'](),controller[_0x933c('0xb')]);router[_0x933c('0xa')](_0x933c('0xc'),auth[_0x933c('0xd')](),controller[_0x933c('0xe')]);router[_0x933c('0xa')](_0x933c('0xf'),auth['isAuthenticated'](),controller[_0x933c('0x10')]);router[_0x933c('0x11')]('/',auth[_0x933c('0xd')](),controller[_0x933c('0x12')]);router[_0x933c('0x13')]('/:id',auth[_0x933c('0xd')](),controller['update']);router[_0x933c('0x14')](_0x933c('0xf'),auth[_0x933c('0xd')](),controller[_0x933c('0x15')]);module[_0x933c('0x16')]=router; \ No newline at end of file +var _0x9205=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','/describe','describe','/:id','show','post','create','put','isAuthenticated','delete','destroy','exports'];(function(_0x3e5f31,_0x494b19){var _0xb7666a=function(_0x4a143e){while(--_0x4a143e){_0x3e5f31['push'](_0x3e5f31['shift']());}};_0xb7666a(++_0x494b19);}(_0x9205,0x7e));var _0x5920=function(_0x1b63fb,_0x425125){_0x1b63fb=_0x1b63fb-0x0;var _0x52ad38=_0x9205[_0x1b63fb];return _0x52ad38;};'use strict';var multer=require(_0x5920('0x0'));var util=require(_0x5920('0x1'));var path=require('path');var timeout=require(_0x5920('0x2'));var express=require(_0x5920('0x3'));var router=express[_0x5920('0x4')]();var fs_extra=require(_0x5920('0x5'));var auth=require(_0x5920('0x6'));var interaction=require(_0x5920('0x7'));var config=require(_0x5920('0x8'));var controller=require(_0x5920('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5920('0xa'),auth['isAuthenticated'](),controller[_0x5920('0xb')]);router['get'](_0x5920('0xc'),auth['isAuthenticated'](),controller[_0x5920('0xd')]);router[_0x5920('0xe')]('/',auth['isAuthenticated'](),controller[_0x5920('0xf')]);router[_0x5920('0x10')]('/:id',auth[_0x5920('0x11')](),controller['update']);router[_0x5920('0x12')](_0x5920('0xc'),auth['isAuthenticated'](),controller[_0x5920('0x13')]);module[_0x5920('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 9dbdb40..a2d117b 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 _0x6f59=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x24ccb8,_0x931eeb){var _0x2c5e01=function(_0x1c747e){while(--_0x1c747e){_0x24ccb8['push'](_0x24ccb8['shift']());}};_0x2c5e01(++_0x931eeb);}(_0x6f59,0x1be));var _0x96f5=function(_0x2e5cfc,_0x3d1890){_0x2e5cfc=_0x2e5cfc-0x0;var _0x3d2a45=_0x6f59[_0x2e5cfc];return _0x3d2a45;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'uniqueid':{'type':Sequelize[_0x96f5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x96f5('0x3')](_0x96f5('0x4'),_0x96f5('0x5'),_0x96f5('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x96f5('0x7')]}}; \ No newline at end of file +var _0xae1b=['exports','ENUM','account','agent','queue','DATE'];(function(_0x1ccee3,_0x462810){var _0xd975d8=function(_0xb1f306){while(--_0xb1f306){_0x1ccee3['push'](_0x1ccee3['shift']());}};_0xd975d8(++_0x462810);}(_0xae1b,0x96));var _0xbae1=function(_0x3a1c66,_0x5ceedc){_0x3a1c66=_0x3a1c66-0x0;var _0xdba2ce=_0xae1b[_0x3a1c66];return _0xdba2ce;};'use strict';var Sequelize=require('sequelize');module[_0xbae1('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbae1('0x1')](_0xbae1('0x2'),_0xbae1('0x3'),_0xbae1('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xbae1('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index a6b0725..7b8edb6 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 _0xd5c8=['Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','rawAttributes','include','create','body','update','params','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset'];(function(_0x3bd160,_0x3e1a0a){var _0x5bb055=function(_0x1a2619){while(--_0x1a2619){_0x3bd160['push'](_0x3bd160['shift']());}};_0x5bb055(++_0x3e1a0a);}(_0xd5c8,0x166));var _0x8d5c=function(_0x3f8647,_0x39c233){_0x3f8647=_0x3f8647-0x0;var _0x39d095=_0xd5c8[_0x3f8647];return _0x39d095;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8d5c('0x0'));var jsonpatch=require(_0x8d5c('0x1'));var rp=require(_0x8d5c('0x2'));var moment=require(_0x8d5c('0x3'));var BPromise=require(_0x8d5c('0x4'));var Mustache=require(_0x8d5c('0x5'));var util=require(_0x8d5c('0x6'));var path=require(_0x8d5c('0x7'));var sox=require(_0x8d5c('0x8'));var csv=require('to-csv');var ejs=require(_0x8d5c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d5c('0xa'));var crypto=require(_0x8d5c('0xb'));var jsforce=require(_0x8d5c('0xc'));var deskjs=require(_0x8d5c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8d5c('0xe'));var Redis=require('ioredis');var authService=require(_0x8d5c('0xf'));var qs=require(_0x8d5c('0x10'));var as=require(_0x8d5c('0x11'));var hardwareService=require(_0x8d5c('0x12'));var logger=require(_0x8d5c('0x13'))(_0x8d5c('0x14'));var utils=require(_0x8d5c('0x15'));var config=require(_0x8d5c('0x16'));var licenseUtil=require(_0x8d5c('0x17'));var db=require(_0x8d5c('0x18'))['db'];function respondWithStatusCode(_0x2a9a0e,_0x4152cd){_0x4152cd=_0x4152cd||0xcc;return function(_0x4c7321){if(_0x4c7321){return _0x2a9a0e[_0x8d5c('0x19')](_0x4152cd);}return _0x2a9a0e[_0x8d5c('0x1a')](_0x4152cd)[_0x8d5c('0x1b')]();};}function respondWithResult(_0x32dbd8,_0xa5a078){_0xa5a078=_0xa5a078||0xc8;return function(_0x149e54){if(_0x149e54){return _0x32dbd8[_0x8d5c('0x1a')](_0xa5a078)[_0x8d5c('0x1c')](_0x149e54);}};}function respondWithFilteredResult(_0x516388,_0x3146f4){return function(_0x144717){if(_0x144717){var _0x4ee2af=typeof _0x3146f4['offset']===_0x8d5c('0x1d')&&typeof _0x3146f4['limit']==='undefined';var _0x4f552a=_0x144717[_0x8d5c('0x1e')];var _0x43f233=_0x4ee2af?0x0:_0x3146f4[_0x8d5c('0x1f')];var _0x189005=_0x4ee2af?_0x144717[_0x8d5c('0x1e')]:_0x3146f4[_0x8d5c('0x1f')]+_0x3146f4['limit'];var _0x581eef;if(_0x189005>=_0x4f552a){_0x189005=_0x4f552a;_0x581eef=0xc8;}else{_0x581eef=0xce;}_0x516388['status'](_0x581eef);return _0x516388['set'](_0x8d5c('0x20'),_0x43f233+'-'+_0x189005+'/'+_0x4f552a)[_0x8d5c('0x1c')](_0x144717);}return null;};}function patchUpdates(_0x31cd31){return function(_0x273cba){try{jsonpatch[_0x8d5c('0x21')](_0x273cba,_0x31cd31,!![]);}catch(_0x9399ce){return BPromise[_0x8d5c('0x22')](_0x9399ce);}return _0x273cba[_0x8d5c('0x23')]();};}function saveUpdates(_0x28111e,_0x358b5b){return function(_0x2f7487){if(_0x2f7487){return _0x2f7487['update'](_0x28111e)[_0x8d5c('0x24')](function(_0x2c74ab){return _0x2c74ab;});}return null;};}function removeEntity(_0x4c0cdf,_0x251da8){return function(_0x3e7ed6){if(_0x3e7ed6){return _0x3e7ed6[_0x8d5c('0x25')]()[_0x8d5c('0x24')](function(){_0x4c0cdf['status'](0xcc)[_0x8d5c('0x1b')]();});}};}function handleEntityNotFound(_0x22457f,_0x506828){return function(_0x5e0daa){if(!_0x5e0daa){_0x22457f[_0x8d5c('0x19')](0x194);}return _0x5e0daa;};}function handleError(_0xa8aeac,_0x53e5e0){_0x53e5e0=_0x53e5e0||0x1f4;return function(_0x5ecafa){logger[_0x8d5c('0x26')](_0x5ecafa['stack']);if(_0x5ecafa[_0x8d5c('0x27')]){delete _0x5ecafa[_0x8d5c('0x27')];}_0xa8aeac[_0x8d5c('0x1a')](_0x53e5e0)[_0x8d5c('0x28')](_0x5ecafa);};}exports[_0x8d5c('0x29')]=function(_0xd060b1,_0x2302a8){var _0x3cfb68={},_0x2c940f={},_0x56153f={'count':0x0,'rows':[]};var _0x473f0a=_[_0x8d5c('0x2a')](db[_0x8d5c('0x2b')]['rawAttributes'],function(_0xe7290){return{'name':_0xe7290[_0x8d5c('0x2c')],'type':_0xe7290[_0x8d5c('0x2d')][_0x8d5c('0x2e')]};});_0x2c940f[_0x8d5c('0x2f')]=_[_0x8d5c('0x2a')](_0x473f0a,_0x8d5c('0x27'));_0x2c940f[_0x8d5c('0x30')]=_[_0x8d5c('0x31')](_0xd060b1[_0x8d5c('0x30')]);_0x2c940f[_0x8d5c('0x32')]=_[_0x8d5c('0x33')](_0x2c940f[_0x8d5c('0x2f')],_0x2c940f[_0x8d5c('0x30')]);_0x3cfb68[_0x8d5c('0x34')]=_[_0x8d5c('0x33')](_0x2c940f[_0x8d5c('0x2f')],qs[_0x8d5c('0x35')](_0xd060b1['query']['fields']));_0x3cfb68['attributes']=_0x3cfb68['attributes'][_0x8d5c('0x36')]?_0x3cfb68[_0x8d5c('0x34')]:_0x2c940f[_0x8d5c('0x2f')];if(!_0xd060b1['query'][_0x8d5c('0x37')](_0x8d5c('0x38'))){_0x3cfb68[_0x8d5c('0x39')]=qs[_0x8d5c('0x39')](_0xd060b1['query'][_0x8d5c('0x39')]);_0x3cfb68['offset']=qs[_0x8d5c('0x1f')](_0xd060b1[_0x8d5c('0x30')]['offset']);}_0x3cfb68[_0x8d5c('0x3a')]=qs[_0x8d5c('0x3b')](_0xd060b1[_0x8d5c('0x30')][_0x8d5c('0x3b')]);_0x3cfb68[_0x8d5c('0x3c')]=qs[_0x8d5c('0x32')](_[_0x8d5c('0x3d')](_0xd060b1[_0x8d5c('0x30')],_0x2c940f[_0x8d5c('0x32')]),_0x473f0a);if(_0xd060b1[_0x8d5c('0x30')][_0x8d5c('0x3e')]){_0x3cfb68[_0x8d5c('0x3c')]=_['merge'](_0x3cfb68['where'],{'$or':_['map'](_0x473f0a,function(_0x4a294c){if(_0x4a294c['type']!==_0x8d5c('0x3f')){var _0x1879ee={};_0x1879ee[_0x4a294c['name']]={'$like':'%'+_0xd060b1[_0x8d5c('0x30')][_0x8d5c('0x3e')]+'%'};return _0x1879ee;}})});}_0x3cfb68=_[_0x8d5c('0x40')]({},_0x3cfb68,_0xd060b1[_0x8d5c('0x41')]);var _0x12b218={'where':_0x3cfb68[_0x8d5c('0x3c')]};return db['WhatsappTransferReport']['count'](_0x12b218)[_0x8d5c('0x24')](function(_0x10eeef){_0x56153f[_0x8d5c('0x1e')]=_0x10eeef;if(_0xd060b1[_0x8d5c('0x30')][_0x8d5c('0x42')]){_0x3cfb68['include']=[{'all':!![]}];}return db[_0x8d5c('0x2b')][_0x8d5c('0x43')](_0x3cfb68);})[_0x8d5c('0x24')](function(_0x5943f2){_0x56153f['rows']=_0x5943f2;return _0x56153f;})[_0x8d5c('0x24')](respondWithFilteredResult(_0x2302a8,_0x3cfb68))[_0x8d5c('0x44')](handleError(_0x2302a8,null));};exports[_0x8d5c('0x45')]=function(_0x12911f,_0x551d3a){var _0x54cb81={'raw':!![],'where':{'id':_0x12911f['params']['id']}},_0x53b14c={};_0x53b14c[_0x8d5c('0x2f')]=_[_0x8d5c('0x31')](db[_0x8d5c('0x2b')][_0x8d5c('0x46')]);_0x53b14c[_0x8d5c('0x30')]=_[_0x8d5c('0x31')](_0x12911f['query']);_0x53b14c[_0x8d5c('0x32')]=_[_0x8d5c('0x33')](_0x53b14c[_0x8d5c('0x2f')],_0x53b14c[_0x8d5c('0x30')]);_0x54cb81[_0x8d5c('0x34')]=_[_0x8d5c('0x33')](_0x53b14c[_0x8d5c('0x2f')],qs['fields'](_0x12911f[_0x8d5c('0x30')][_0x8d5c('0x35')]));_0x54cb81['attributes']=_0x54cb81[_0x8d5c('0x34')]['length']?_0x54cb81[_0x8d5c('0x34')]:_0x53b14c[_0x8d5c('0x2f')];if(_0x12911f[_0x8d5c('0x30')]['includeAll']){_0x54cb81[_0x8d5c('0x47')]=[{'all':!![]}];}_0x54cb81=_[_0x8d5c('0x40')]({},_0x54cb81,_0x12911f[_0x8d5c('0x41')]);return db[_0x8d5c('0x2b')]['find'](_0x54cb81)['then'](handleEntityNotFound(_0x551d3a,null))[_0x8d5c('0x24')](respondWithResult(_0x551d3a,null))[_0x8d5c('0x44')](handleError(_0x551d3a,null));};exports['create']=function(_0x32a2c0,_0x118ef7){return db[_0x8d5c('0x2b')][_0x8d5c('0x48')](_0x32a2c0[_0x8d5c('0x49')],{})['then'](respondWithResult(_0x118ef7,0xc9))[_0x8d5c('0x44')](handleError(_0x118ef7,null));};exports[_0x8d5c('0x4a')]=function(_0x2dfa25,_0x419d6a){if(_0x2dfa25[_0x8d5c('0x49')]['id']){delete _0x2dfa25[_0x8d5c('0x49')]['id'];}return db[_0x8d5c('0x2b')]['find']({'where':{'id':_0x2dfa25[_0x8d5c('0x4b')]['id']}})[_0x8d5c('0x24')](handleEntityNotFound(_0x419d6a,null))[_0x8d5c('0x24')](saveUpdates(_0x2dfa25[_0x8d5c('0x49')],null))[_0x8d5c('0x24')](respondWithResult(_0x419d6a,null))[_0x8d5c('0x44')](handleError(_0x419d6a,null));};exports[_0x8d5c('0x25')]=function(_0x190bdc,_0x36ce34){return db[_0x8d5c('0x2b')][_0x8d5c('0x4c')]({'where':{'id':_0x190bdc[_0x8d5c('0x4b')]['id']}})[_0x8d5c('0x24')](handleEntityNotFound(_0x36ce34,null))['then'](removeEntity(_0x36ce34,null))[_0x8d5c('0x44')](handleError(_0x36ce34,null));};exports[_0x8d5c('0x4d')]=function(_0xe62cdb,_0x29cddc){return db['WhatsappTransferReport']['describe']()[_0x8d5c('0x24')](respondWithResult(_0x29cddc,null))[_0x8d5c('0x44')](handleError(_0x29cddc,null));}; \ No newline at end of file +var _0x3f1f=['describe','eml-format','rimraf','zip-dir','util','path','to-csv','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','end','sendStatus','error','stack','name','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','params','includeAll','options','find','catch','create','body'];(function(_0x5448a9,_0x4764da){var _0x1924af=function(_0x34f9bf){while(--_0x34f9bf){_0x5448a9['push'](_0x5448a9['shift']());}};_0x1924af(++_0x4764da);}(_0x3f1f,0x109));var _0xf3f1=function(_0x1d55aa,_0x2939af){_0x1d55aa=_0x1d55aa-0x0;var _0x194820=_0x3f1f[_0x1d55aa];return _0x194820;};'use strict';var emlformat=require(_0xf3f1('0x0'));var rimraf=require(_0xf3f1('0x1'));var zipdir=require(_0xf3f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf3f1('0x3'));var path=require(_0xf3f1('0x4'));var sox=require('sox');var csv=require(_0xf3f1('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3f1('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf3f1('0x7'));var jsforce=require(_0xf3f1('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xf3f1('0x5'));var querystring=require('querystring');var Papa=require(_0xf3f1('0x9'));var Redis=require(_0xf3f1('0xa'));var authService=require(_0xf3f1('0xb'));var qs=require(_0xf3f1('0xc'));var as=require(_0xf3f1('0xd'));var hardwareService=require(_0xf3f1('0xe'));var logger=require(_0xf3f1('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xf3f1('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3f1('0x11'))['db'];function respondWithStatusCode(_0x78db35,_0x548da9){_0x548da9=_0x548da9||0xcc;return function(_0x1b5e40){if(_0x1b5e40){return _0x78db35['sendStatus'](_0x548da9);}return _0x78db35[_0xf3f1('0x12')](_0x548da9)['end']();};}function respondWithResult(_0x3803e5,_0x368def){_0x368def=_0x368def||0xc8;return function(_0x19b01f){if(_0x19b01f){return _0x3803e5['status'](_0x368def)[_0xf3f1('0x13')](_0x19b01f);}};}function respondWithFilteredResult(_0x2d30c7,_0x552f79){return function(_0x3837e8){if(_0x3837e8){var _0xb16431=typeof _0x552f79[_0xf3f1('0x14')]===_0xf3f1('0x15')&&typeof _0x552f79[_0xf3f1('0x16')]===_0xf3f1('0x15');var _0x43b02d=_0x3837e8[_0xf3f1('0x17')];var _0x5f3242=_0xb16431?0x0:_0x552f79['offset'];var _0x133e21=_0xb16431?_0x3837e8[_0xf3f1('0x17')]:_0x552f79[_0xf3f1('0x14')]+_0x552f79['limit'];var _0x20d51e;if(_0x133e21>=_0x43b02d){_0x133e21=_0x43b02d;_0x20d51e=0xc8;}else{_0x20d51e=0xce;}_0x2d30c7['status'](_0x20d51e);return _0x2d30c7[_0xf3f1('0x18')](_0xf3f1('0x19'),_0x5f3242+'-'+_0x133e21+'/'+_0x43b02d)[_0xf3f1('0x13')](_0x3837e8);}return null;};}function patchUpdates(_0x3dde9d){return function(_0x160b05){try{jsonpatch['apply'](_0x160b05,_0x3dde9d,!![]);}catch(_0x38501d){return BPromise['reject'](_0x38501d);}return _0x160b05[_0xf3f1('0x1a')]();};}function saveUpdates(_0x5eb3c6,_0x45b01a){return function(_0x3cbe88){if(_0x3cbe88){return _0x3cbe88[_0xf3f1('0x1b')](_0x5eb3c6)[_0xf3f1('0x1c')](function(_0xb6265d){return _0xb6265d;});}return null;};}function removeEntity(_0x382acd,_0x38c650){return function(_0x3016a4){if(_0x3016a4){return _0x3016a4['destroy']()['then'](function(){_0x382acd['status'](0xcc)[_0xf3f1('0x1d')]();});}};}function handleEntityNotFound(_0x5d8949,_0x46261f){return function(_0x378772){if(!_0x378772){_0x5d8949[_0xf3f1('0x1e')](0x194);}return _0x378772;};}function handleError(_0x1f8ffb,_0x2fcf0d){_0x2fcf0d=_0x2fcf0d||0x1f4;return function(_0x3b7bd8){logger[_0xf3f1('0x1f')](_0x3b7bd8[_0xf3f1('0x20')]);if(_0x3b7bd8[_0xf3f1('0x21')]){delete _0x3b7bd8[_0xf3f1('0x21')];}_0x1f8ffb[_0xf3f1('0x12')](_0x2fcf0d)['send'](_0x3b7bd8);};}exports['index']=function(_0x3f0e0a,_0x27aa68){var _0xe614a5={},_0x415fa6={},_0x330e47={'count':0x0,'rows':[]};var _0x2ec92d=_[_0xf3f1('0x22')](db[_0xf3f1('0x23')][_0xf3f1('0x24')],function(_0x297685){return{'name':_0x297685[_0xf3f1('0x25')],'type':_0x297685[_0xf3f1('0x26')]['key']};});_0x415fa6[_0xf3f1('0x27')]=_[_0xf3f1('0x22')](_0x2ec92d,_0xf3f1('0x21'));_0x415fa6[_0xf3f1('0x28')]=_[_0xf3f1('0x29')](_0x3f0e0a['query']);_0x415fa6[_0xf3f1('0x2a')]=_['intersection'](_0x415fa6['model'],_0x415fa6[_0xf3f1('0x28')]);_0xe614a5[_0xf3f1('0x2b')]=_[_0xf3f1('0x2c')](_0x415fa6[_0xf3f1('0x27')],qs[_0xf3f1('0x2d')](_0x3f0e0a[_0xf3f1('0x28')][_0xf3f1('0x2d')]));_0xe614a5[_0xf3f1('0x2b')]=_0xe614a5['attributes'][_0xf3f1('0x2e')]?_0xe614a5[_0xf3f1('0x2b')]:_0x415fa6[_0xf3f1('0x27')];if(!_0x3f0e0a[_0xf3f1('0x28')][_0xf3f1('0x2f')](_0xf3f1('0x30'))){_0xe614a5[_0xf3f1('0x16')]=qs[_0xf3f1('0x16')](_0x3f0e0a[_0xf3f1('0x28')][_0xf3f1('0x16')]);_0xe614a5[_0xf3f1('0x14')]=qs[_0xf3f1('0x14')](_0x3f0e0a[_0xf3f1('0x28')]['offset']);}_0xe614a5[_0xf3f1('0x31')]=qs[_0xf3f1('0x32')](_0x3f0e0a[_0xf3f1('0x28')]['sort']);_0xe614a5[_0xf3f1('0x33')]=qs[_0xf3f1('0x2a')](_[_0xf3f1('0x34')](_0x3f0e0a[_0xf3f1('0x28')],_0x415fa6[_0xf3f1('0x2a')]),_0x2ec92d);if(_0x3f0e0a[_0xf3f1('0x28')][_0xf3f1('0x35')]){_0xe614a5[_0xf3f1('0x33')]=_[_0xf3f1('0x36')](_0xe614a5[_0xf3f1('0x33')],{'$or':_[_0xf3f1('0x22')](_0x2ec92d,function(_0x4d3414){if(_0x4d3414[_0xf3f1('0x26')]!=='VIRTUAL'){var _0x9d346b={};_0x9d346b[_0x4d3414[_0xf3f1('0x21')]]={'$like':'%'+_0x3f0e0a['query'][_0xf3f1('0x35')]+'%'};return _0x9d346b;}})});}_0xe614a5=_['merge']({},_0xe614a5,_0x3f0e0a['options']);var _0x593337={'where':_0xe614a5[_0xf3f1('0x33')]};return db[_0xf3f1('0x23')]['count'](_0x593337)[_0xf3f1('0x1c')](function(_0x1d83f1){_0x330e47[_0xf3f1('0x17')]=_0x1d83f1;if(_0x3f0e0a[_0xf3f1('0x28')]['includeAll']){_0xe614a5[_0xf3f1('0x37')]=[{'all':!![]}];}return db[_0xf3f1('0x23')][_0xf3f1('0x38')](_0xe614a5);})[_0xf3f1('0x1c')](function(_0x4d6e09){_0x330e47[_0xf3f1('0x39')]=_0x4d6e09;return _0x330e47;})[_0xf3f1('0x1c')](respondWithFilteredResult(_0x27aa68,_0xe614a5))['catch'](handleError(_0x27aa68,null));};exports['show']=function(_0x3ea316,_0x23fea8){var _0xaf248={'raw':!![],'where':{'id':_0x3ea316[_0xf3f1('0x3a')]['id']}},_0x5c8d30={};_0x5c8d30[_0xf3f1('0x27')]=_[_0xf3f1('0x29')](db[_0xf3f1('0x23')][_0xf3f1('0x24')]);_0x5c8d30[_0xf3f1('0x28')]=_[_0xf3f1('0x29')](_0x3ea316[_0xf3f1('0x28')]);_0x5c8d30[_0xf3f1('0x2a')]=_[_0xf3f1('0x2c')](_0x5c8d30['model'],_0x5c8d30[_0xf3f1('0x28')]);_0xaf248[_0xf3f1('0x2b')]=_[_0xf3f1('0x2c')](_0x5c8d30[_0xf3f1('0x27')],qs[_0xf3f1('0x2d')](_0x3ea316[_0xf3f1('0x28')][_0xf3f1('0x2d')]));_0xaf248[_0xf3f1('0x2b')]=_0xaf248['attributes']['length']?_0xaf248[_0xf3f1('0x2b')]:_0x5c8d30[_0xf3f1('0x27')];if(_0x3ea316[_0xf3f1('0x28')][_0xf3f1('0x3b')]){_0xaf248['include']=[{'all':!![]}];}_0xaf248=_['merge']({},_0xaf248,_0x3ea316[_0xf3f1('0x3c')]);return db['WhatsappTransferReport'][_0xf3f1('0x3d')](_0xaf248)[_0xf3f1('0x1c')](handleEntityNotFound(_0x23fea8,null))[_0xf3f1('0x1c')](respondWithResult(_0x23fea8,null))[_0xf3f1('0x3e')](handleError(_0x23fea8,null));};exports[_0xf3f1('0x3f')]=function(_0x1fefe1,_0x3d1edb){return db[_0xf3f1('0x23')][_0xf3f1('0x3f')](_0x1fefe1[_0xf3f1('0x40')],{})[_0xf3f1('0x1c')](respondWithResult(_0x3d1edb,0xc9))[_0xf3f1('0x3e')](handleError(_0x3d1edb,null));};exports[_0xf3f1('0x1b')]=function(_0xcc9011,_0x27f5a1){if(_0xcc9011['body']['id']){delete _0xcc9011[_0xf3f1('0x40')]['id'];}return db['WhatsappTransferReport'][_0xf3f1('0x3d')]({'where':{'id':_0xcc9011[_0xf3f1('0x3a')]['id']}})['then'](handleEntityNotFound(_0x27f5a1,null))['then'](saveUpdates(_0xcc9011[_0xf3f1('0x40')],null))[_0xf3f1('0x1c')](respondWithResult(_0x27f5a1,null))[_0xf3f1('0x3e')](handleError(_0x27f5a1,null));};exports['destroy']=function(_0x2ba721,_0x1cc807){return db['WhatsappTransferReport'][_0xf3f1('0x3d')]({'where':{'id':_0x2ba721['params']['id']}})['then'](handleEntityNotFound(_0x1cc807,null))[_0xf3f1('0x1c')](removeEntity(_0x1cc807,null))[_0xf3f1('0x3e')](handleError(_0x1cc807,null));};exports[_0xf3f1('0x41')]=function(_0x3ad414,_0x14baa8){return db[_0xf3f1('0x23')][_0xf3f1('0x41')]()[_0xf3f1('0x1c')](respondWithResult(_0x14baa8,null))[_0xf3f1('0x3e')](handleError(_0x14baa8,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index cc2f8f8..0affce4 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 _0xf31c=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x292893,_0x3cd21e){var _0x5a55ac=function(_0x420f8d){while(--_0x420f8d){_0x292893['push'](_0x292893['shift']());}};_0x5a55ac(++_0x3cd21e);}(_0xf31c,0xd4));var _0xcf31=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xf31c[_0x382e89];return _0x3a1318;};'use strict';var _=require(_0xcf31('0x0'));var util=require(_0xcf31('0x1'));var logger=require('../../config/logger')(_0xcf31('0x2'));var moment=require('moment');var BPromise=require(_0xcf31('0x3'));var rp=require(_0xcf31('0x4'));var fs=require('fs');var path=require(_0xcf31('0x5'));var rimraf=require(_0xcf31('0x6'));var config=require(_0xcf31('0x7'));var attributes=require(_0xcf31('0x8'));module['exports']=function(_0x1a3aa9,_0x1f2700){return _0x1a3aa9[_0xcf31('0x9')](_0xcf31('0xa'),attributes,{'tableName':_0xcf31('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcf31('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1934=['uniqueid','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','report_whatsapp_transfer'];(function(_0x42ffa0,_0xc048d3){var _0x3eecb8=function(_0x32161b){while(--_0x32161b){_0x42ffa0['push'](_0x42ffa0['shift']());}};_0x3eecb8(++_0xc048d3);}(_0x1934,0x169));var _0x4193=function(_0x245e9c,_0x3846b6){_0x245e9c=_0x245e9c-0x0;var _0x423cb0=_0x1934[_0x245e9c];return _0x423cb0;};'use strict';var _=require(_0x4193('0x0'));var util=require(_0x4193('0x1'));var logger=require('../../config/logger')(_0x4193('0x2'));var moment=require(_0x4193('0x3'));var BPromise=require('bluebird');var rp=require(_0x4193('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4193('0x5'));var config=require(_0x4193('0x6'));var attributes=require(_0x4193('0x7'));module['exports']=function(_0x535636,_0x424357){return _0x535636['define']('WhatsappTransferReport',attributes,{'tableName':_0x4193('0x8'),'paranoid':![],'indexes':[{'name':_0x4193('0x9'),'fields':[_0x4193('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 8b6a556..b438669 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 _0x6671=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6671,0x196));var _0x1667=function(_0xd5a6fc,_0x2a1c9b){_0xd5a6fc=_0xd5a6fc-0x0;var _0x2e5ece=_0x6671[_0xd5a6fc];return _0x2e5ece;};'use strict';var _=require(_0x1667('0x0'));var util=require(_0x1667('0x1'));var moment=require(_0x1667('0x2'));var BPromise=require(_0x1667('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1667('0x4'));var db=require(_0x1667('0x5'))['db'];var utils=require(_0x1667('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1667('0x7'));var jayson=require(_0x1667('0x8'));var client=jayson[_0x1667('0x9')][_0x1667('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ce7c7,_0x585ee4,_0x391d79){return new BPromise(function(_0x52b81c,_0x34d6ec){return client[_0x1667('0xb')](_0x4ce7c7,_0x391d79)[_0x1667('0xc')](function(_0x1583b9){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x585ee4,_0x1667('0xd'));logger['debug'](_0x1667('0xe'),_0x585ee4,_0x1667('0xd'),JSON['stringify'](_0x1583b9));if(_0x1583b9[_0x1667('0xf')]){if(_0x1583b9[_0x1667('0xf')][_0x1667('0x10')]===0x1f4){logger[_0x1667('0xf')](_0x1667('0x11'),_0x585ee4,_0x1583b9[_0x1667('0xf')][_0x1667('0x12')]);return _0x34d6ec(_0x1583b9[_0x1667('0xf')][_0x1667('0x12')]);}logger[_0x1667('0xf')](_0x1667('0x11'),_0x585ee4,_0x1583b9['error'][_0x1667('0x12')]);return _0x52b81c(_0x1583b9[_0x1667('0xf')][_0x1667('0x12')]);}else{logger['info'](_0x1667('0x11'),_0x585ee4,_0x1667('0xd'));_0x52b81c(_0x1583b9[_0x1667('0x13')][_0x1667('0x12')]);}})[_0x1667('0x14')](function(_0x3c723f){logger['error'](_0x1667('0x11'),_0x585ee4,_0x3c723f);_0x34d6ec(_0x3c723f);});});} \ No newline at end of file +var _0xc85f=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc85f,0xcd));var _0xfc85=function(_0x58f74f,_0x43763c){_0x58f74f=_0x58f74f-0x0;var _0x1c4391=_0xc85f[_0x58f74f];return _0x1c4391;};'use strict';var _=require(_0xfc85('0x0'));var util=require(_0xfc85('0x1'));var moment=require(_0xfc85('0x2'));var BPromise=require(_0xfc85('0x3'));var rs=require(_0xfc85('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfc85('0x5'));var logger=require(_0xfc85('0x6'))('rpc');var config=require(_0xfc85('0x7'));var jayson=require(_0xfc85('0x8'));var client=jayson['client'][_0xfc85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6448c1,_0x4d9072,_0x53d30b){return new BPromise(function(_0x4a7ff3,_0xb875){return client[_0xfc85('0xa')](_0x6448c1,_0x53d30b)[_0xfc85('0xb')](function(_0x18b278){logger[_0xfc85('0xc')](_0xfc85('0xd'),_0x4d9072,_0xfc85('0xe'));logger[_0xfc85('0xf')](_0xfc85('0x10'),_0x4d9072,_0xfc85('0xe'),JSON[_0xfc85('0x11')](_0x18b278));if(_0x18b278[_0xfc85('0x12')]){if(_0x18b278[_0xfc85('0x12')]['code']===0x1f4){logger[_0xfc85('0x12')](_0xfc85('0xd'),_0x4d9072,_0x18b278[_0xfc85('0x12')]['message']);return _0xb875(_0x18b278[_0xfc85('0x12')][_0xfc85('0x13')]);}logger[_0xfc85('0x12')](_0xfc85('0xd'),_0x4d9072,_0x18b278[_0xfc85('0x12')][_0xfc85('0x13')]);return _0x4a7ff3(_0x18b278[_0xfc85('0x12')]['message']);}else{logger[_0xfc85('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4d9072,_0xfc85('0xe'));_0x4a7ff3(_0x18b278[_0xfc85('0x14')][_0xfc85('0x13')]);}})['catch'](function(_0x7c9355){logger[_0xfc85('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4d9072,_0x7c9355);_0xb875(_0x7c9355);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 0ed75c1..000cb85 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf98=['join','Offline\x20apps:','status','online','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdf98,0xcf));var _0x8df9=function(_0x3eb926,_0x27e966){_0x3eb926=_0x3eb926-0x0;var _0x29460d=_0xdf98[_0x3eb926];return _0x29460d;};'use strict';var _=require(_0x8df9('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x8df9('0x1'));var checkLicense=require('./config/license');var rpc=require('./rpc');var config=require(_0x8df9('0x2'));var logger=require(_0x8df9('0x3'))(_0x8df9('0x4'));var pm2=require(_0x8df9('0x5'));var pm2Config=require(_0x8df9('0x6'));var schedule=require(_0x8df9('0x7'));var chat=require(_0x8df9('0x8'));var whatsapp=require(_0x8df9('0x9'));var transcribe=require(_0x8df9('0xa'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x8df9('0xb')][_0x8df9('0xc')]()[_0x8df9('0xd')](function(){if(config['seedDB']){return seedDb['default']();}})[_0x8df9('0xd')](function(){return checkLicense['default']();})[_0x8df9('0xd')](function(){return rpc[_0x8df9('0xe')]();})[_0x8df9('0xd')](function(_0xa5abd2){logger[_0x8df9('0xf')](_0xa5abd2);return chat[_0x8df9('0x10')]();})[_0x8df9('0xd')](function(){return whatsapp[_0x8df9('0x10')]();})['then'](function(){return schedule[_0x8df9('0x10')]();})[_0x8df9('0xd')](function(){return transcribe[_0x8df9('0x10')]();})['then'](function(){return provider[_0x8df9('0x10')]();})[_0x8df9('0xd')](function(_0x1e29d0){logger[_0x8df9('0xf')](_0x1e29d0);return pm2['start'](pm2Config);})['then'](function(_0x2dcc1c){var _0x304ba3=_0x2dcc1c[_0x8df9('0x11')](function(_0x50f0f7){return typeof _0x50f0f7[_0x8df9('0x12')]==='number'&&_0x50f0f7[_0x8df9('0x12')]>=0x0;});if(_0x304ba3['length']>0x0){throw new Error(_0x304ba3[_0x8df9('0x13')]+_0x8df9('0x14')+_[_0x8df9('0x15')](_0x304ba3,function(_0x218e76){return'\x22'+_0x218e76[_0x8df9('0x16')][_0x8df9('0x17')]+'\x22';}));}logger['info']('Online\x20apps:',_[_0x8df9('0x15')](_['filter'](_0x2dcc1c,{'status':'online'}),_0x8df9('0x17'))[_0x8df9('0x18')]());logger[_0x8df9('0xf')](_0x8df9('0x19'),_[_0x8df9('0x15')](_[_0x8df9('0x11')](_0x2dcc1c,function(_0x5a0071){return _0x5a0071[_0x8df9('0x1a')]!==_0x8df9('0x1b');}),_0x8df9('0x17'))['join']()||'None');console['log']('App\x20Ready!');})['catch'](function(_0x10a2ce){console[_0x8df9('0x1c')](_0x8df9('0x1d'),_0x10a2ce);logger[_0x8df9('0x1e')](_0x8df9('0x1f'),_0x10a2ce);process[_0x8df9('0x20')](0x1);});}main(); \ No newline at end of file +var _0xb46f=['info','start','filter','exitCode','length','map','Online\x20apps:','online','name','join','Offline\x20apps:','None','log','App\x20Ready!','catch','error','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','listen'];(function(_0x23c11e,_0x340598){var _0x32eee7=function(_0x2a959b){while(--_0x2a959b){_0x23c11e['push'](_0x23c11e['shift']());}};_0x32eee7(++_0x340598);}(_0xb46f,0xb6));var _0xfb46=function(_0x1a629a,_0x4741e6){_0x1a629a=_0x1a629a-0x0;var _0x4d6fbe=_0xb46f[_0x1a629a];return _0x4d6fbe;};'use strict';var _=require(_0xfb46('0x0'));var db=require(_0xfb46('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xfb46('0x2'));var rpc=require(_0xfb46('0x3'));var config=require(_0xfb46('0x4'));var logger=require(_0xfb46('0x5'))(_0xfb46('0x6'));var pm2=require('./config/pm2');var pm2Config=require(_0xfb46('0x7'));var schedule=require('./config/schedule');var chat=require(_0xfb46('0x8'));var whatsapp=require(_0xfb46('0x9'));var transcribe=require(_0xfb46('0xa'));var provider=require(_0xfb46('0xb'));function main(){return db[_0xfb46('0xc')]['sync']()[_0xfb46('0xd')](function(){if(config[_0xfb46('0xe')]){return seedDb['default']();}})['then'](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xfb46('0xf')]();})['then'](function(_0x7e738e){logger[_0xfb46('0x10')](_0x7e738e);return chat[_0xfb46('0x11')]();})[_0xfb46('0xd')](function(){return whatsapp[_0xfb46('0x11')]();})[_0xfb46('0xd')](function(){return schedule[_0xfb46('0x11')]();})[_0xfb46('0xd')](function(){return transcribe[_0xfb46('0x11')]();})[_0xfb46('0xd')](function(){return provider['start']();})['then'](function(_0x133a1c){logger['info'](_0x133a1c);return pm2[_0xfb46('0x11')](pm2Config);})[_0xfb46('0xd')](function(_0x572e04){var _0x31e54e=_0x572e04[_0xfb46('0x12')](function(_0xf3fdbd){return typeof _0xf3fdbd[_0xfb46('0x13')]==='number'&&_0xf3fdbd[_0xfb46('0x13')]>=0x0;});if(_0x31e54e[_0xfb46('0x14')]>0x0){throw new Error(_0x31e54e[_0xfb46('0x14')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xfb46('0x15')](_0x31e54e,function(_0x10fc0c){return'\x22'+_0x10fc0c['pm2_env']['name']+'\x22';}));}logger[_0xfb46('0x10')](_0xfb46('0x16'),_[_0xfb46('0x15')](_[_0xfb46('0x12')](_0x572e04,{'status':_0xfb46('0x17')}),_0xfb46('0x18'))[_0xfb46('0x19')]());logger[_0xfb46('0x10')](_0xfb46('0x1a'),_[_0xfb46('0x15')](_[_0xfb46('0x12')](_0x572e04,function(_0x2ee6db){return _0x2ee6db['status']!==_0xfb46('0x17');}),_0xfb46('0x18'))[_0xfb46('0x19')]()||_0xfb46('0x1b'));console[_0xfb46('0x1c')](_0xfb46('0x1d'));})[_0xfb46('0x1e')](function(_0x14b2ee){console[_0xfb46('0x1c')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x14b2ee);logger[_0xfb46('0x1f')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x14b2ee);process[_0xfb46('0x20')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 75602c3..38b9af2 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 _0xca52=['length','splice','encryptString','join','sign','options','promisify','randomBytes','toString','floor','HS512','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','userpic','permissions','md5secret','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','json','unmanaged','Unmanaged.','catch','headers','startsWith','authorization','User','find','authenticate','pass','Bearer','query','getUuid','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','isWebrtcLicence','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','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.','Sequelize','updatePasswordsHistory'];(function(_0x383494,_0x2070d2){var _0x2485e5=function(_0x37c52e){while(--_0x37c52e){_0x383494['push'](_0x383494['shift']());}};_0x2485e5(++_0x2070d2);}(_0xca52,0x90));var _0x2ca5=function(_0x53c91f,_0x102c15){_0x53c91f=_0x53c91f-0x0;var _0x636aa7=_0xca52[_0x53c91f];return _0x636aa7;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x2ca5('0x0'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x2ca5('0x1'));var _=require('lodash');var jwt=require(_0x2ca5('0x2'));var expressJwt=require(_0x2ca5('0x3'));var compose=require('composable-middleware');var basicAuth=require(_0x2ca5('0x4'));var crypto=require(_0x2ca5('0x5'));var BPromise=require(_0x2ca5('0x6'));var util=require('util');var moment=require(_0x2ca5('0x7'));var validateJwt=expressJwt({'secret':config[_0x2ca5('0x8')][_0x2ca5('0x9')]});var userAttributes=['id',_0x2ca5('0xa'),_0x2ca5('0xb'),_0x2ca5('0xc'),_0x2ca5('0xd'),'email',_0x2ca5('0xe'),_0x2ca5('0xf'),_0x2ca5('0x10'),'voicePause',_0x2ca5('0x11'),_0x2ca5('0x12'),_0x2ca5('0x13'),_0x2ca5('0x14'),'openchannelPause',_0x2ca5('0x15'),_0x2ca5('0x16'),'lastLoginAt','lastPauseAt','crudPermissions',_0x2ca5('0x17'),_0x2ca5('0x18'),'alias',_0x2ca5('0x19'),'phoneBarAutoAnswerDelay',_0x2ca5('0x1a'),_0x2ca5('0x1b'),_0x2ca5('0x1c'),'phoneBarEnableSettings',_0x2ca5('0x1d'),_0x2ca5('0x1e'),_0x2ca5('0x1f'),'phoneBarRemoteControlPort','hotdesk','interface',_0x2ca5('0x20'),_0x2ca5('0x21'),_0x2ca5('0x22'),_0x2ca5('0x23'),_0x2ca5('0x24'),'downloadOmnichannelInteractions',_0x2ca5('0x25'),_0x2ca5('0x26'),_0x2ca5('0x27'),_0x2ca5('0x28'),_0x2ca5('0x29'),_0x2ca5('0x2a'),_0x2ca5('0x2b'),_0x2ca5('0x2c'),_0x2ca5('0x2d'),_0x2ca5('0x2e'),_0x2ca5('0x2f'),_0x2ca5('0x30'),_0x2ca5('0x31'),_0x2ca5('0x32'),'whatsappAutoanswerDelay',_0x2ca5('0x33')];exports[_0x2ca5('0x34')]=function(){return this[_0x2ca5('0x35')](!![])[_0x2ca5('0x36')](function(_0x34cf26,_0x4a8374,_0x3ee368){if(_0x34cf26[_0x2ca5('0x37')]){_0x3ee368();}else{return db[_0x2ca5('0x38')][_0x2ca5('0x39')]({'where':{'id':_0x34cf26[_0x2ca5('0x3a')]['id']},'attributes':['id',_0x2ca5('0x3b'),_0x2ca5('0x3c')],'raw':!![]})[_0x2ca5('0x3d')](function(_0x40b538){if(_0x40b538&&_0x40b538[_0x2ca5('0x3b')]&&!_0x34cf26['query']['forceDownload']){return _0x4a8374[_0x2ca5('0x3e')](_0x40b538[_0x2ca5('0x3c')]==='unmanaged'?0x195:0x193)[_0x2ca5('0x3f')]({'message':_0x40b538[_0x2ca5('0x3c')]===_0x2ca5('0x40')?_0x2ca5('0x41'):'Forbidden.'});}else{_0x3ee368();}})[_0x2ca5('0x42')](function(_0x2257be){_0x3ee368(_0x2257be);});}});};exports[_0x2ca5('0x35')]=function isAuthenticated(_0x542101){return compose()[_0x2ca5('0x36')](function(_0x19527f,_0x471560,_0x1025c6){var _0x1784a2;if(_0x19527f[_0x2ca5('0x43')]['authorization']){if(_[_0x2ca5('0x44')](_0x19527f[_0x2ca5('0x43')][_0x2ca5('0x45')],'Basic')){var _0x5d3e69=basicAuth(_0x19527f);db[_0x2ca5('0x46')][_0x2ca5('0x47')]({'where':{'name':_0x5d3e69[_0x2ca5('0xc')]}})[_0x2ca5('0x3d')](function(_0x409ce5){if(!_0x409ce5||!_0x409ce5[_0x2ca5('0x48')](_0x5d3e69[_0x2ca5('0x49')])){return _0x471560[_0x2ca5('0x3e')](0x191)[_0x2ca5('0x3f')]({'message':'Wrong\x20credentials.'});}_0x19527f['user']={'id':_0x409ce5['id']};_0x1025c6();})[_0x2ca5('0x42')](function(_0x42e86c){_0x1025c6(_0x42e86c);});}else if(_[_0x2ca5('0x44')](_0x19527f['headers'][_0x2ca5('0x45')],_0x2ca5('0x4a'))){validateJwt(_0x19527f,_0x471560,_0x1025c6);}else{if(_0x542101){_0x1025c6();}else{return _0x471560['status'](0x193)[_0x2ca5('0x3f')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x19527f[_0x2ca5('0x4b')]['apikey']){try{var _0x5e06a2={'audience':hardwareConf[_0x2ca5('0x4c')](),'issuer':hardwareConf[_0x2ca5('0x4c')]()};verifyJwt(_0x19527f[_0x2ca5('0x4b')]['apikey'],_0x5e06a2)[_0x2ca5('0x3d')](function(_0x2945be){return db[_0x2ca5('0x46')]['find']({'where':{'id':_0x2945be['sub']}})[_0x2ca5('0x3d')](function(_0x37cabd){_0x1784a2=_0x37cabd;return db['Setting'][_0x2ca5('0x39')]({'where':{'id':0x1},'attributes':[_0x2ca5('0x4d'),'blockDuration'],'raw':!![]});})['then'](function(_0xfbd366){if(!_0x1784a2||!_['isEqual'](_0x1784a2[_0x2ca5('0x4e')],_0x2945be[_0x2ca5('0x4f')])){return _0x471560['status'](0x191)['json']({'message':_0x2ca5('0x50')});}if(_0x1784a2[_0x2ca5('0x51')]){return _0x471560[_0x2ca5('0x3e')](0x191)[_0x2ca5('0x3f')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1784a2[_0x2ca5('0x52')]){if(_0xfbd366[_0x2ca5('0x53')]>0x0){if(moment(_0x1784a2[_0x2ca5('0x54')])[_0x2ca5('0x55')](_0xfbd366[_0x2ca5('0x53')],_0x2ca5('0x56'))>moment()){return _0x471560[_0x2ca5('0x3e')](0x191)[_0x2ca5('0x3f')]({'message':_0x2ca5('0x57')});}}else{return _0x471560[_0x2ca5('0x3e')](0x191)[_0x2ca5('0x3f')]({'message':_0x2ca5('0x57')});}}_0x19527f[_0x2ca5('0x37')]={'id':_0x1784a2['id']};_0x1025c6();});})[_0x2ca5('0x42')](function(){return _0x471560[_0x2ca5('0x3e')](0x191)[_0x2ca5('0x3f')]({'message':_0x2ca5('0x57')});});}catch(_0x373710){_0x1025c6(_0x373710);}}else if(_0x542101){_0x1025c6();}else{return _0x471560[_0x2ca5('0x3e')](0x193)[_0x2ca5('0x3f')]({'message':_0x2ca5('0x58')});}})[_0x2ca5('0x36')](function(_0x19c5d5,_0x1e1c86,_0x4aaf78){if(_0x19c5d5['user']){db[_0x2ca5('0x46')][_0x2ca5('0x47')]({'where':{'id':_0x19c5d5[_0x2ca5('0x37')]['id']},'attributes':userAttributes})[_0x2ca5('0x3d')](function(_0x5778b0){if(!_0x5778b0){return _0x1e1c86[_0x2ca5('0x3e')](0x194)[_0x2ca5('0x3f')]({'message':_0x2ca5('0x59')});}_0x19c5d5['user']=_0x5778b0;_0x4aaf78();})['catch'](function(_0x30259d){_0x4aaf78(_0x30259d);});}else if(_0x542101){_0x4aaf78();}else{return _0x1e1c86[_0x2ca5('0x3e')](0x194)[_0x2ca5('0x3f')]({'message':_0x2ca5('0x5a')});}});};exports[_0x2ca5('0x5b')]=function canUpdate(){return compose()['use'](function(_0x4adf92,_0x1f8ba4,_0x793596){return licenseUtil[_0x2ca5('0x5c')]()[_0x2ca5('0x3d')](function(_0x2b9266){if(_0x2b9266['update']){_0x793596();}else{return _0x1f8ba4[_0x2ca5('0x3e')](0x193)[_0x2ca5('0x3f')]({'message':'Forbidden'});}})[_0x2ca5('0x42')](function(_0x5a4b7d){_0x793596(_0x5a4b7d);});});};exports[_0x2ca5('0x5d')]=function isWebrtcLicence(){return compose()[_0x2ca5('0x36')](function(_0x3b3268,_0x3aaa29,_0x2e5ce3){return licenseUtil[_0x2ca5('0x5c')]()[_0x2ca5('0x3d')](function(_0x15c49b){if(_0x15c49b[_0x2ca5('0x5e')]){_0x2e5ce3();}else{return _0x3aaa29[_0x2ca5('0x3e')](0x193)[_0x2ca5('0x3f')]({'message':_0x2ca5('0x5f')});}})[_0x2ca5('0x42')](function(_0x2110db){_0x2e5ce3(_0x2110db);});});};exports[_0x2ca5('0x60')]=function(_0x1c820e,_0x543f1e,_0x25f26a){_0x1c820e[_0x2ca5('0x60')]=!![];return _0x25f26a();};exports[_0x2ca5('0x61')]=function signToken(_0x5aab62){return signJwt(_0x5aab62);};exports[_0x2ca5('0x62')]=function(_0x3b8840,_0x277e8d){if(!_0x3b8840[_0x2ca5('0x37')]){return _0x277e8d[_0x2ca5('0x3e')](0x194)[_0x2ca5('0x3f')]({'message':_0x2ca5('0x63')});}var _0x14b575={'payload':{'id':_0x3b8840['user']['id'],'role':_0x3b8840['user'][_0x2ca5('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x14b575)[_0x2ca5('0x3d')](function(_0xe9a64f){_0x277e8d[_0x2ca5('0x64')]('motion.token',_0xe9a64f);_0x277e8d[_0x2ca5('0x65')](_0x2ca5('0x66'));})['catch'](function(_0x33e50c){return _0x277e8d[_0x2ca5('0x3e')](0x1f4)[_0x2ca5('0x67')](_0x33e50c);});};exports[_0x2ca5('0x68')]=function(_0x12e0c6){if(_[_0x2ca5('0x69')](_0x12e0c6[_0x2ca5('0x4e')])||_[_0x2ca5('0x69')](_0x12e0c6[_0x2ca5('0x6a')])){return null;}else{return createJwt(_0x12e0c6);}};exports[_0x2ca5('0x6b')]=function(_0x2e2f89){_0x2e2f89[_0x2ca5('0x4e')]=generateNonce();_0x2e2f89[_0x2ca5('0x6a')]=generateIssuedAt();return createJwt(_0x2e2f89);};exports['regenerateApiKey']=function(_0x3e48da,_0x4c36a6){var _0xf5ca5a=_0x3e48da[_0x2ca5('0x4b')]['apikey'];if(_0xf5ca5a){var _0x1748e1={'nonce':_0x4c36a6['apiKeyNonce'],'iat':_0x4c36a6['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x2ca5('0x4c')]()};return verifyJwt(_0xf5ca5a,_0x1748e1)[_0x2ca5('0x3d')](function(){return generateApiKey(_0x4c36a6);});}else{throw{'message':_0x2ca5('0x6c')};}};exports[_0x2ca5('0x6d')]=function(_0x177e7e){var _0x279acd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x279acd[_0x2ca5('0x6e')](_0x177e7e))throw new db['Sequelize'][(_0x2ca5('0x6f'))](_0x2ca5('0x70'));return;};exports[_0x2ca5('0x71')]=function(_0x270c62,_0x121780,_0x53fa6b){var _0x465f82=encryptor[_0x2ca5('0x72')](_0x121780)[_0x2ca5('0x73')](',');for(var _0x512cef=0x0;_0x512cef<_0x53fa6b;_0x512cef++){if(!_0x465f82[_0x512cef])break;if(_0x270c62[_0x2ca5('0x74')]()===_0x465f82[_0x512cef][_0x2ca5('0x74')]()){var _0x20a450=util[_0x2ca5('0x75')](_0x2ca5('0x76'),_0x53fa6b);if(_0x53fa6b===0x1){_0x20a450=_0x2ca5('0x77');}throw new db[(_0x2ca5('0x78'))][(_0x2ca5('0x6f'))](_0x20a450);}}return;};exports[_0x2ca5('0x79')]=function(_0x2eb5ed,_0x117fe7){var _0x1c4824=_0x117fe7?encryptor[_0x2ca5('0x72')](_0x117fe7)[_0x2ca5('0x73')](','):[];if(_0x1c4824[_0x2ca5('0x7a')]===0x5){_0x1c4824[_0x2ca5('0x7b')](-0x1,0x1);}_0x1c4824['unshift'](_0x2eb5ed);return encryptor[_0x2ca5('0x7c')](_0x1c4824[_0x2ca5('0x7d')](','));};function signJwt(_0x1bde16){var _0xca96fb=BPromise['promisify'](jwt[_0x2ca5('0x7e')],{'context':jwt});var _0x4b308e=_0x1bde16['secret']||config[_0x2ca5('0x8')][_0x2ca5('0x9')];return new BPromise(function(_0x214eb6,_0xb4cf42){_0xca96fb(_0x1bde16['payload'],_0x4b308e,_0x1bde16[_0x2ca5('0x7f')])[_0x2ca5('0x3d')](function(_0xd40c50){_0x214eb6(_0xd40c50);})[_0x2ca5('0x42')](function(_0x5ae6ec){_0xb4cf42(_0x5ae6ec);});});}function verifyJwt(_0x1df64f,_0x33ba5f,_0x1e8355){var _0x4d0059=BPromise[_0x2ca5('0x80')](jwt['verify'],{'context':jwt});var _0xf57b83=_0x1e8355||config[_0x2ca5('0x8')][_0x2ca5('0x9')];return new BPromise(function(_0x3234db,_0x5eedaf){_0x4d0059(_0x1df64f,_0xf57b83,_0x33ba5f)[_0x2ca5('0x3d')](function(_0x1a350e){_0x3234db(_0x1a350e);})[_0x2ca5('0x42')](function(_0x304a9a){_0x5eedaf(_0x304a9a);});});}function generateNonce(){return crypto[_0x2ca5('0x81')](0x10)[_0x2ca5('0x82')]('hex');}function generateIssuedAt(){return Math[_0x2ca5('0x83')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x257604){var _0xae125={'payload':{'iat':_0x257604[_0x2ca5('0x6a')],'nonce':_0x257604['apiKeyNonce']},'options':{'algorithm':_0x2ca5('0x84'),'subject':_0x257604['id']['toString'](),'issuer':hardwareConf[_0x2ca5('0x4c')](),'audience':hardwareConf[_0x2ca5('0x4c')]()}};return signJwt(_0xae125)['then'](function(_0x351ddb){return{'iat':_0x257604['apiKeyIat'],'nonce':_0x257604['apiKeyNonce'],'token':_0x351ddb};});} \ No newline at end of file +var _0x1bb2=['emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isAuthenticated','use','user','ChatInteraction','params','closed','disposition','query','status','json','unmanaged','Unmanaged.','Forbidden.','catch','headers','startsWith','authorization','Basic','User','then','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','find','findOne','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','Invalid\x20API\x20access\x20key','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','splice','unshift','join','promisify','sign','secret','options','verify','randomBytes','hex','floor','now','HS512','toString','../../mysqldb','../../config/license/util','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','util','moment','secrets','session','role','name','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer'];(function(_0x1de43c,_0xaa29de){var _0x296d3e=function(_0x50b76f){while(--_0x50b76f){_0x1de43c['push'](_0x1de43c['shift']());}};_0x296d3e(++_0xaa29de);}(_0x1bb2,0x1e1));var _0x21bb=function(_0x294ce3,_0x813d64){_0x294ce3=_0x294ce3-0x0;var _0x59e263=_0x1bb2[_0x294ce3];return _0x59e263;};'use strict';var db=require(_0x21bb('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x21bb('0x1'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0x21bb('0x2'));var expressJwt=require(_0x21bb('0x3'));var compose=require(_0x21bb('0x4'));var basicAuth=require('basic-auth');var crypto=require(_0x21bb('0x5'));var BPromise=require(_0x21bb('0x6'));var util=require(_0x21bb('0x7'));var moment=require(_0x21bb('0x8'));var validateJwt=expressJwt({'secret':config[_0x21bb('0x9')][_0x21bb('0xa')]});var userAttributes=['id',_0x21bb('0xb'),'fullname',_0x21bb('0xc'),'internal',_0x21bb('0xd'),_0x21bb('0xe'),_0x21bb('0xf'),_0x21bb('0x10'),_0x21bb('0x11'),_0x21bb('0x12'),_0x21bb('0x13'),_0x21bb('0x14'),_0x21bb('0x15'),'openchannelPause','pauseType',_0x21bb('0x16'),_0x21bb('0x17'),'lastPauseAt',_0x21bb('0x18'),_0x21bb('0x19'),_0x21bb('0x1a'),_0x21bb('0x1b'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd',_0x21bb('0x1c'),_0x21bb('0x1d'),'phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired',_0x21bb('0x1e'),_0x21bb('0x1f'),'hotdesk',_0x21bb('0x20'),_0x21bb('0x21'),_0x21bb('0x22'),'settingsEnabled',_0x21bb('0x23'),_0x21bb('0x24'),_0x21bb('0x25'),'downloadAttachments',_0x21bb('0x26'),_0x21bb('0x27'),_0x21bb('0x28'),_0x21bb('0x29'),_0x21bb('0x2a'),_0x21bb('0x2b'),_0x21bb('0x2c'),_0x21bb('0x2d'),_0x21bb('0x2e'),'openchannelAutoanswerDelay',_0x21bb('0x2f'),_0x21bb('0x30'),_0x21bb('0x31'),_0x21bb('0x32'),_0x21bb('0x33')];exports['isChatInteractionAuthorized']=function(){return this[_0x21bb('0x34')](!![])[_0x21bb('0x35')](function(_0x345eae,_0x4365f3,_0x11dbe6){if(_0x345eae[_0x21bb('0x36')]){_0x11dbe6();}else{return db[_0x21bb('0x37')]['findOne']({'where':{'id':_0x345eae[_0x21bb('0x38')]['id']},'attributes':['id',_0x21bb('0x39'),_0x21bb('0x3a')],'raw':!![]})['then'](function(_0x37e0ef){if(_0x37e0ef&&_0x37e0ef[_0x21bb('0x39')]&&!_0x345eae[_0x21bb('0x3b')]['forceDownload']){return _0x4365f3[_0x21bb('0x3c')](_0x37e0ef[_0x21bb('0x3a')]==='unmanaged'?0x195:0x193)[_0x21bb('0x3d')]({'message':_0x37e0ef[_0x21bb('0x3a')]===_0x21bb('0x3e')?_0x21bb('0x3f'):_0x21bb('0x40')});}else{_0x11dbe6();}})[_0x21bb('0x41')](function(_0x49e748){_0x11dbe6(_0x49e748);});}});};exports[_0x21bb('0x34')]=function isAuthenticated(_0xde7133){return compose()['use'](function(_0x5e9b08,_0xa9e81,_0x3f1a79){var _0x22182e;if(_0x5e9b08[_0x21bb('0x42')]['authorization']){if(_[_0x21bb('0x43')](_0x5e9b08[_0x21bb('0x42')][_0x21bb('0x44')],_0x21bb('0x45'))){var _0x2623a6=basicAuth(_0x5e9b08);db[_0x21bb('0x46')]['find']({'where':{'name':_0x2623a6[_0x21bb('0xc')]}})[_0x21bb('0x47')](function(_0x3ed3da){if(!_0x3ed3da||!_0x3ed3da['authenticate'](_0x2623a6[_0x21bb('0x48')])){return _0xa9e81[_0x21bb('0x3c')](0x191)['json']({'message':_0x21bb('0x49')});}_0x5e9b08['user']={'id':_0x3ed3da['id']};_0x3f1a79();})[_0x21bb('0x41')](function(_0xac2b90){_0x3f1a79(_0xac2b90);});}else if(_[_0x21bb('0x43')](_0x5e9b08[_0x21bb('0x42')][_0x21bb('0x44')],_0x21bb('0x4a'))){validateJwt(_0x5e9b08,_0xa9e81,_0x3f1a79);}else{if(_0xde7133){_0x3f1a79();}else{return _0xa9e81[_0x21bb('0x3c')](0x193)[_0x21bb('0x3d')]({'message':_0x21bb('0x4b')});}}}else if(_0x5e9b08[_0x21bb('0x3b')][_0x21bb('0x4c')]){try{var _0x419fb2={'audience':hardwareConf[_0x21bb('0x4d')](),'issuer':hardwareConf[_0x21bb('0x4d')]()};verifyJwt(_0x5e9b08[_0x21bb('0x3b')][_0x21bb('0x4c')],_0x419fb2)[_0x21bb('0x47')](function(_0x4743ab){return db[_0x21bb('0x46')][_0x21bb('0x4e')]({'where':{'id':_0x4743ab['sub']}})[_0x21bb('0x47')](function(_0x28e3c0){_0x22182e=_0x28e3c0;return db['Setting'][_0x21bb('0x4f')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x21bb('0x50')],'raw':!![]});})[_0x21bb('0x47')](function(_0x55cfa5){if(!_0x22182e||!_[_0x21bb('0x51')](_0x22182e[_0x21bb('0x52')],_0x4743ab['nonce'])){return _0xa9e81[_0x21bb('0x3c')](0x191)['json']({'message':_0x21bb('0x53')});}if(_0x22182e['disabled']){return _0xa9e81[_0x21bb('0x3c')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x22182e[_0x21bb('0x54')]){if(_0x55cfa5[_0x21bb('0x50')]>0x0){if(moment(_0x22182e[_0x21bb('0x55')])[_0x21bb('0x56')](_0x55cfa5[_0x21bb('0x50')],'minutes')>moment()){return _0xa9e81[_0x21bb('0x3c')](0x191)[_0x21bb('0x3d')]({'message':_0x21bb('0x57')});}}else{return _0xa9e81[_0x21bb('0x3c')](0x191)[_0x21bb('0x3d')]({'message':_0x21bb('0x57')});}}_0x5e9b08[_0x21bb('0x36')]={'id':_0x22182e['id']};_0x3f1a79();});})[_0x21bb('0x41')](function(){return _0xa9e81[_0x21bb('0x3c')](0x191)[_0x21bb('0x3d')]({'message':_0x21bb('0x57')});});}catch(_0x1b012e){_0x3f1a79(_0x1b012e);}}else if(_0xde7133){_0x3f1a79();}else{return _0xa9e81[_0x21bb('0x3c')](0x193)[_0x21bb('0x3d')]({'message':_0x21bb('0x4b')});}})[_0x21bb('0x35')](function(_0x20a585,_0x35b971,_0x40bf93){if(_0x20a585[_0x21bb('0x36')]){db[_0x21bb('0x46')]['find']({'where':{'id':_0x20a585['user']['id']},'attributes':userAttributes})[_0x21bb('0x47')](function(_0x173755){if(!_0x173755){return _0x35b971[_0x21bb('0x3c')](0x194)[_0x21bb('0x3d')]({'message':_0x21bb('0x58')});}_0x20a585[_0x21bb('0x36')]=_0x173755;_0x40bf93();})[_0x21bb('0x41')](function(_0x31e0ed){_0x40bf93(_0x31e0ed);});}else if(_0xde7133){_0x40bf93();}else{return _0x35b971[_0x21bb('0x3c')](0x194)[_0x21bb('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x21bb('0x59')]=function canUpdate(){return compose()[_0x21bb('0x35')](function(_0x2b8315,_0x3821d0,_0x459c1b){return licenseUtil[_0x21bb('0x5a')]()[_0x21bb('0x47')](function(_0x5da6b0){if(_0x5da6b0[_0x21bb('0x5b')]){_0x459c1b();}else{return _0x3821d0['status'](0x193)['json']({'message':_0x21bb('0x5c')});}})[_0x21bb('0x41')](function(_0x4a1b53){_0x459c1b(_0x4a1b53);});});};exports[_0x21bb('0x5d')]=function isWebrtcLicence(){return compose()[_0x21bb('0x35')](function(_0x29c0fe,_0x340c7e,_0x38bf13){return licenseUtil['getLicense']()['then'](function(_0x28188c){if(_0x28188c[_0x21bb('0x5e')]){_0x38bf13();}else{return _0x340c7e[_0x21bb('0x3c')](0x193)[_0x21bb('0x3d')]({'message':_0x21bb('0x5c')});}})[_0x21bb('0x41')](function(_0x4fc432){_0x38bf13(_0x4fc432);});});};exports[_0x21bb('0x5f')]=function(_0x3722ad,_0x2891c8,_0x31686c){_0x3722ad[_0x21bb('0x5f')]=!![];return _0x31686c();};exports[_0x21bb('0x60')]=function signToken(_0x20a838){return signJwt(_0x20a838);};exports['setTokenCookie']=function(_0x3d23c9,_0x3df620){if(!_0x3d23c9[_0x21bb('0x36')]){return _0x3df620['status'](0x194)[_0x21bb('0x3d')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x1e9ae3={'payload':{'id':_0x3d23c9['user']['id'],'role':_0x3d23c9[_0x21bb('0x36')][_0x21bb('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1e9ae3)[_0x21bb('0x47')](function(_0x5cddae){_0x3df620[_0x21bb('0x61')](_0x21bb('0x62'),_0x5cddae);_0x3df620[_0x21bb('0x63')](_0x21bb('0x64'));})[_0x21bb('0x41')](function(_0x4c8dfc){return _0x3df620[_0x21bb('0x3c')](0x1f4)[_0x21bb('0x65')](_0x4c8dfc);});};exports[_0x21bb('0x66')]=function(_0x3f5a4b){if(_[_0x21bb('0x67')](_0x3f5a4b[_0x21bb('0x52')])||_[_0x21bb('0x67')](_0x3f5a4b[_0x21bb('0x68')])){return null;}else{return createJwt(_0x3f5a4b);}};exports[_0x21bb('0x69')]=function(_0x2964c7){_0x2964c7['apiKeyNonce']=generateNonce();_0x2964c7[_0x21bb('0x68')]=generateIssuedAt();return createJwt(_0x2964c7);};exports[_0x21bb('0x6a')]=function(_0x965bc6,_0x5bda0a){var _0x304b06=_0x965bc6[_0x21bb('0x3b')][_0x21bb('0x4c')];if(_0x304b06){var _0x92ddfe={'nonce':_0x5bda0a[_0x21bb('0x52')],'iat':_0x5bda0a['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x304b06,_0x92ddfe)[_0x21bb('0x47')](function(){return generateApiKey(_0x5bda0a);});}else{throw{'message':_0x21bb('0x6b')};}};exports['validatePasswordPattern']=function(_0x4a8b55){var _0x335e71=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x335e71['test'](_0x4a8b55))throw new db['Sequelize']['ValidationError'](_0x21bb('0x6c'));return;};exports['validatePasswordHistory']=function(_0x21ad82,_0x3b3b40,_0x733606){var _0x4ae41f=encryptor[_0x21bb('0x6d')](_0x3b3b40)[_0x21bb('0x6e')](',');for(var _0xecc624=0x0;_0xecc624<_0x733606;_0xecc624++){if(!_0x4ae41f[_0xecc624])break;if(_0x21ad82[_0x21bb('0x6f')]()===_0x4ae41f[_0xecc624][_0x21bb('0x6f')]()){var _0x36ca18=util[_0x21bb('0x70')](_0x21bb('0x71'),_0x733606);if(_0x733606===0x1){_0x36ca18='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x21bb('0x72'))]['ValidationError'](_0x36ca18);}}return;};exports[_0x21bb('0x73')]=function(_0x340dc4,_0x5243f3){var _0x5c5e2f=_0x5243f3?encryptor[_0x21bb('0x6d')](_0x5243f3)[_0x21bb('0x6e')](','):[];if(_0x5c5e2f[_0x21bb('0x74')]===0x5){_0x5c5e2f[_0x21bb('0x75')](-0x1,0x1);}_0x5c5e2f[_0x21bb('0x76')](_0x340dc4);return encryptor['encryptString'](_0x5c5e2f[_0x21bb('0x77')](','));};function signJwt(_0x43af36){var _0x3c4b3b=BPromise[_0x21bb('0x78')](jwt[_0x21bb('0x79')],{'context':jwt});var _0x540850=_0x43af36[_0x21bb('0x7a')]||config[_0x21bb('0x9')][_0x21bb('0xa')];return new BPromise(function(_0x46428d,_0x6e8ad6){_0x3c4b3b(_0x43af36['payload'],_0x540850,_0x43af36[_0x21bb('0x7b')])[_0x21bb('0x47')](function(_0x1e5d91){_0x46428d(_0x1e5d91);})[_0x21bb('0x41')](function(_0x31d744){_0x6e8ad6(_0x31d744);});});}function verifyJwt(_0x5263a9,_0x130774,_0x48b91f){var _0x12ade8=BPromise['promisify'](jwt[_0x21bb('0x7c')],{'context':jwt});var _0x1dded2=_0x48b91f||config[_0x21bb('0x9')][_0x21bb('0xa')];return new BPromise(function(_0x5a5020,_0x3ef378){_0x12ade8(_0x5263a9,_0x1dded2,_0x130774)[_0x21bb('0x47')](function(_0xc0bcf9){_0x5a5020(_0xc0bcf9);})[_0x21bb('0x41')](function(_0x1810cf){_0x3ef378(_0x1810cf);});});}function generateNonce(){return crypto[_0x21bb('0x7d')](0x10)['toString'](_0x21bb('0x7e'));}function generateIssuedAt(){return Math[_0x21bb('0x7f')](Date[_0x21bb('0x80')]()/0x3e8)['toString']();}function createJwt(_0xadfc44){var _0x53ee25={'payload':{'iat':_0xadfc44[_0x21bb('0x68')],'nonce':_0xadfc44[_0x21bb('0x52')]},'options':{'algorithm':_0x21bb('0x81'),'subject':_0xadfc44['id'][_0x21bb('0x82')](),'issuer':hardwareConf[_0x21bb('0x4d')](),'audience':hardwareConf[_0x21bb('0x4d')]()}};return signJwt(_0x53ee25)[_0x21bb('0x47')](function(_0x53959f){return{'iat':_0xadfc44[_0x21bb('0x68')],'nonce':_0xadfc44[_0x21bb('0x52')],'token':_0x53959f};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 647f8bc..8a2773d 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 _0xef12=['../../mysqldb','findAll','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter','where','default','filter','clause','tags','user','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','rows','catch','describe','startsWith','cf_','map','findOne','slice','all','fieldType','type','lodash','./sql-utils'];(function(_0x5947c8,_0x7a7ccf){var _0x2ef741=function(_0x1371ae){while(--_0x1371ae){_0x5947c8['push'](_0x5947c8['shift']());}};_0x2ef741(++_0x7a7ccf);}(_0xef12,0x18a));var _0x2ef1=function(_0x75a7ae,_0x2d110d){_0x75a7ae=_0x75a7ae-0x0;var _0x4a1cc6=_0xef12[_0x75a7ae];return _0x4a1cc6;};'use strict';var _=require(_0x2ef1('0x0'));var sqlUtils=require(_0x2ef1('0x1'));var db=require(_0x2ef1('0x2'))['db'];exports[_0x2ef1('0x3')]=function(_0x33f3a0,_0x410952,_0xe14de5,_0x4da862){var _0x241203={'count':0x0,'rows':[]};var _0x54d2a8=sqlUtils[_0x2ef1('0x4')](_0x410952,_0x33f3a0);if(_0x54d2a8){return Promise['resolve'](_0x241203);}var _0x1b50e0=sqlUtils[_0x2ef1('0x5')]();var _0x3bab47={};var _0xf048ad=![];var _0x1923b7=![];return Promise[_0x2ef1('0x6')]()[_0x2ef1('0x7')](function(){if(_0x33f3a0[_0x2ef1('0x8')]){return sqlUtils[_0x2ef1('0x9')](_0x33f3a0[_0x2ef1('0x8')],_0x4da862);}else{return sqlUtils['parseQueryParameters'](_0x33f3a0,_0x4da862);}})[_0x2ef1('0x7')](function(_0x241d02){_0x1b50e0[_0x2ef1('0xa')](_0x241d02[_0x2ef1('0xb')]);_0x1b50e0['where'](_0x241d02['fields']);_0x1b50e0['where'](_0x241d02[_0x2ef1('0xc')]);_0x1b50e0[_0x2ef1('0xa')](_0x241d02['user'][_0x2ef1('0xd')]);_0x3bab47=_0x241d02[_0x2ef1('0xe')];_0x1923b7=_0x241d02[_0x2ef1('0xf')][_0x2ef1('0x10')];return sqlUtils[_0x2ef1('0x11')](_0x410952,_0x33f3a0,_0x1923b7);})[_0x2ef1('0x7')](function(_0x2a55c0){_0x1b50e0[_0x2ef1('0xa')](_0x2a55c0);var _0x234f74=_0x33f3a0[_0x2ef1('0x8')]?_0x3bab47[_0x2ef1('0x12')]:_0x33f3a0[_0x2ef1('0x13')];_0xf048ad=_0x234f74?!![]:![];return sqlUtils[_0x2ef1('0x14')](_0x1b50e0,_0x234f74);})[_0x2ef1('0x7')](function(_0x40211d){_0x241203[_0x2ef1('0x15')]=_0x40211d;if(_0x241203[_0x2ef1('0x15')]===0x0){return;}if(_0x33f3a0[_0x2ef1('0x16')]){_0x1923b7=!![];}return sqlUtils[_0x2ef1('0x17')](_0x1b50e0,_0x33f3a0['fields'],_0xe14de5,_0xf048ad,_0x3bab47['clause'],_0x1923b7);})[_0x2ef1('0x7')](function(_0x5bc7e3){if(!_0x5bc7e3){return[];}return sqlUtils[_0x2ef1('0x18')](_0x5bc7e3,_0x33f3a0,_0xe14de5);})[_0x2ef1('0x7')](function(_0x2196dd){_0x241203[_0x2ef1('0x19')]=_0x2196dd;return _0x241203;})[_0x2ef1('0x1a')](function(_0x32492a){throw _0x32492a;});};exports['describe']=function(){var _0x5f2adf={};var _0x18d2e5=[];return db['CmContact'][_0x2ef1('0x1b')]()['then'](function(_0x5d0d1e){_0x5f2adf=_0x5d0d1e;var _0x39d2aa=Object['keys'](_0x5f2adf)[_0x2ef1('0xc')](function(_0x30527c){return _[_0x2ef1('0x1c')](_0x30527c,_0x2ef1('0x1d'))?_0x30527c:undefined;});var _0x41901f=_0x39d2aa[_0x2ef1('0x1e')](function(_0x4db452){return db['CmCustomField'][_0x2ef1('0x1f')]({'where':{'id':_0x4db452[_0x2ef1('0x20')](0x3)},'raw':!![]});});return Promise[_0x2ef1('0x21')](_0x41901f);})[_0x2ef1('0x7')](function(_0x549e79){for(var _0x1e9dab=0x0;_0x1e9dab<_0x549e79['length'];_0x1e9dab++){if(_0x549e79[_0x1e9dab]){var _0x57f9d9='cf_'+_0x549e79[_0x1e9dab]['id'];_0x5f2adf[_0x57f9d9][_0x2ef1('0x22')]=_0x549e79[_0x1e9dab][_0x2ef1('0x23')];}}_0x18d2e5=_[_0x2ef1('0x1e')](Object['keys'](_0x5f2adf),function(_0x212007){return{'name':_0x212007,'type':_0x5f2adf[_0x212007][_0x2ef1('0x23')]};});return _0x18d2e5;})[_0x2ef1('0x1a')](function(_0x40d7a3){throw _0x40d7a3;});}; \ No newline at end of file +var _0x3340=['type','keys','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','search','parseAdvancedSearchFilter','parseQueryParameters','then','where','fields','user','clause','skip','checkListsRestrictions','ids','tag','count','User','rows','catch','describe','filter','startsWith','map','CmCustomField','all','fieldType'];(function(_0x1dc984,_0x14bce3){var _0x58502d=function(_0x4c1649){while(--_0x4c1649){_0x1dc984['push'](_0x1dc984['shift']());}};_0x58502d(++_0x14bce3);}(_0x3340,0x119));var _0x0334=function(_0xa3aa3b,_0x4ad1df){_0xa3aa3b=_0xa3aa3b-0x0;var _0x34e30c=_0x3340[_0xa3aa3b];return _0x34e30c;};'use strict';var _=require(_0x0334('0x0'));var sqlUtils=require(_0x0334('0x1'));var db=require(_0x0334('0x2'))['db'];exports[_0x0334('0x3')]=function(_0x25a210,_0x1a09ae,_0x186267,_0x3e9c6a){var _0x5dc39d={'count':0x0,'rows':[]};var _0x447238=sqlUtils[_0x0334('0x4')](_0x1a09ae,_0x25a210);if(_0x447238){return Promise[_0x0334('0x5')](_0x5dc39d);}var _0x23cc63=sqlUtils['getContactsSubquery']();var _0x5487cc={};var _0x5c3136=![];var _0x4b35d2=![];return Promise[_0x0334('0x5')]()['then'](function(){if(_0x25a210[_0x0334('0x6')]){return sqlUtils[_0x0334('0x7')](_0x25a210['search'],_0x3e9c6a);}else{return sqlUtils[_0x0334('0x8')](_0x25a210,_0x3e9c6a);}})[_0x0334('0x9')](function(_0x1e8840){_0x23cc63[_0x0334('0xa')](_0x1e8840['default']);_0x23cc63[_0x0334('0xa')](_0x1e8840[_0x0334('0xb')]);_0x23cc63[_0x0334('0xa')](_0x1e8840['filter']);_0x23cc63[_0x0334('0xa')](_0x1e8840[_0x0334('0xc')][_0x0334('0xd')]);_0x5487cc=_0x1e8840['tags'];_0x4b35d2=_0x1e8840[_0x0334('0xc')][_0x0334('0xe')];return sqlUtils[_0x0334('0xf')](_0x1a09ae,_0x25a210,_0x4b35d2);})[_0x0334('0x9')](function(_0x122521){_0x23cc63['where'](_0x122521);var _0x17c8bf=_0x25a210['search']?_0x5487cc[_0x0334('0x10')]:_0x25a210[_0x0334('0x11')];_0x5c3136=_0x17c8bf?!![]:![];return sqlUtils['countFilteredContacts'](_0x23cc63,_0x17c8bf);})['then'](function(_0x12933d){_0x5dc39d[_0x0334('0x12')]=_0x12933d;if(_0x5dc39d['count']===0x0){return;}if(_0x25a210[_0x0334('0x13')]){_0x4b35d2=!![];}return sqlUtils['buildContactsQuery'](_0x23cc63,_0x25a210['fields'],_0x186267,_0x5c3136,_0x5487cc[_0x0334('0xd')],_0x4b35d2);})[_0x0334('0x9')](function(_0xda49ab){if(!_0xda49ab){return[];}return sqlUtils['getFilteredContacts'](_0xda49ab,_0x25a210,_0x186267);})[_0x0334('0x9')](function(_0xa5cf6a){_0x5dc39d[_0x0334('0x14')]=_0xa5cf6a;return _0x5dc39d;})[_0x0334('0x15')](function(_0x4e1d0b){throw _0x4e1d0b;});};exports[_0x0334('0x16')]=function(){var _0x17dd83={};var _0x505f5e=[];return db['CmContact']['describe']()['then'](function(_0x4dc3f7){_0x17dd83=_0x4dc3f7;var _0xbb171d=Object['keys'](_0x17dd83)[_0x0334('0x17')](function(_0x54ad5f){return _[_0x0334('0x18')](_0x54ad5f,'cf_')?_0x54ad5f:undefined;});var _0x4faa57=_0xbb171d[_0x0334('0x19')](function(_0x5792c2){return db[_0x0334('0x1a')]['findOne']({'where':{'id':_0x5792c2['slice'](0x3)},'raw':!![]});});return Promise[_0x0334('0x1b')](_0x4faa57);})[_0x0334('0x9')](function(_0x441c79){for(var _0x112077=0x0;_0x112077<_0x441c79['length'];_0x112077++){if(_0x441c79[_0x112077]){var _0x4f0977='cf_'+_0x441c79[_0x112077]['id'];_0x17dd83[_0x4f0977][_0x0334('0x1c')]=_0x441c79[_0x112077][_0x0334('0x1d')];}}_0x505f5e=_[_0x0334('0x19')](Object[_0x0334('0x1e')](_0x17dd83),function(_0x3b7280){return{'name':_0x3b7280,'type':_0x17dd83[_0x3b7280][_0x0334('0x1d')]};});return _0x505f5e;})[_0x0334('0x15')](function(_0xc0c9ca){throw _0xc0c9ca;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 118a68e..f1a8ddd 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 _0xa6c3=['MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','length','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','value','end','Tag','tags','clause','and','ids','User','user','skip','map','some','compact','Contact','concat','uc.UserId\x20=\x20?','resolve','then','fields','tag','filter','agent','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','Tags','COUNT(*)','c.id','query','toString','exports','squel','../parsers/advancedSearch','../parsers/qs','role','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','cm_contact_has_tags','.id','tools_tags','t.id\x20=\x20ct.TagId','lastName','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes','push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','split'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa6c3,0xb1));var _0x3a6c=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xa6c3[_0x33bc64];return _0x3fdd34;};'use strict';var _=require('lodash');var squel=require(_0x3a6c('0x0'));var as=require(_0x3a6c('0x1'));var qs=require(_0x3a6c('0x2'));var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x32bf71,_0x1fc1e1){var _0x3650b7=![];if(_0x32bf71[_0x3a6c('0x3')]==='agent'&&!_0x1fc1e1[_0x3a6c('0x4')]&&!_0x1fc1e1[_0x3a6c('0x5')]&&_0x1fc1e1[_0x3a6c('0x6')]!==_0x3a6c('0x7')){_0x3650b7=!![];}return _0x3650b7;}function getContactsSubquery(){return squel[_0x3a6c('0x8')]()[_0x3a6c('0x9')](_0x3a6c('0xa'),'c')[_0x3a6c('0xb')](_0x3a6c('0xc'));}function applyJoinClauses(_0x5c08c2,_0x3b0356){var _0xb62bf4=_0x3b0356?'c':_0x3a6c('0xd');_0x5c08c2[_0x3a6c('0xe')]('cm_user_has_contacts','uc',_0x3a6c('0xf')+_0xb62bf4+'.id')[_0x3a6c('0xe')](_0x3a6c('0x10'),'ct','ct.CmContactId\x20=\x20'+_0xb62bf4+_0x3a6c('0x11'))[_0x3a6c('0xe')](_0x3a6c('0x12'),'t',_0x3a6c('0x13'));return _0x5c08c2;}function addFieldsToQuery(_0x9b9bed,_0x5cdf4e,_0x4424b3,_0xbe08e2,_0x36f925){var _0x41cd37=_0x36f925?'c':_0x3a6c('0xd');if(!_0x5cdf4e){_0x5cdf4e=['id','firstName',_0x3a6c('0x14'),'phone','mobile',_0x3a6c('0x15'),_0x3a6c('0x16'),'ListId',_0x3a6c('0x17'),_0x3a6c('0x18'),_0x3a6c('0x19'),_0x3a6c('0x1a'),'TagIds'];}else if(!_0x5cdf4e[_0x3a6c('0x1b')]('id')){_0x5cdf4e[_0x3a6c('0x1c')]('id');}var _0x13a6bf=_0x4424b3&&_0x36f925||!_0x4424b3&&!_0x36f925;if(_0xbe08e2){_0x13a6bf=_0xbe08e2&&_0x36f925||!_0xbe08e2&&!_0x36f925;}_0x5cdf4e[_0x3a6c('0x1d')](function(_0x530ca6){if(_0x530ca6===_0x3a6c('0x1e')){if(_0x13a6bf){_0x9b9bed[_0x3a6c('0x1f')](_0x3a6c('0x20'),_0x530ca6);}else if(_0x4424b3||_0xbe08e2){_0x9b9bed[_0x3a6c('0x1f')](_0x41cd37+'.'+_0x530ca6);}}else{_0x9b9bed[_0x3a6c('0x1f')](_0x41cd37+'.'+_0x530ca6);}});return _0x9b9bed;}function getSqlClauses(){var _0xb280f6={'default':squel['expr'](),'fields':squel[_0x3a6c('0x21')](),'filter':squel[_0x3a6c('0x21')](),'tags':{'clause':squel[_0x3a6c('0x21')](),'ids':null},'user':{'clause':squel[_0x3a6c('0x21')](),'skip':![]}};return _0xb280f6;}function parseTagParameter(_0x4687d9){var _0x48f2d7=squel[_0x3a6c('0x21')]();if(_0x4687d9){var _0x455603=utils[_0x3a6c('0x22')](_0x4687d9);_0x455603[_0x3a6c('0x1d')](function(_0x40e7e3){_0x48f2d7['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x40e7e3+',%');});}return _0x48f2d7;}function parseSearchFilter(_0x567f97){var _0x1bf1d1=squel[_0x3a6c('0x21')]();if(_0x567f97){var _0x496280=_0x567f97[_0x3a6c('0x23')]('\x5c','\x5c\x5c')[_0x3a6c('0x23')](/'/g,'\x27\x27');if(_0x496280[_0x3a6c('0x24')]('\x20')['length']>0x1){_0x1bf1d1['or'](_0x3a6c('0x25'),qs['getFullTextValue'](_0x496280,!![]),null);}else{if(qs[_0x3a6c('0x26')](_0x496280)){_0x1bf1d1['or'](_0x3a6c('0x27'),_0x496280+'%');_0x1bf1d1['or'](_0x3a6c('0x28'),_0x496280+'%');_0x1bf1d1['or'](_0x3a6c('0x29'),_0x496280+'%');_0x1bf1d1['or'](_0x3a6c('0x2a'),_0x496280+'%');}else if(qs[_0x3a6c('0x2b')](_0x496280)){_0x1bf1d1['or'](_0x3a6c('0x2c'),_0x496280+'%');}else{_0x1bf1d1['or'](_0x3a6c('0x2d'),'%'+_0x496280+'%');_0x1bf1d1['or'](_0x3a6c('0x2e'),'%'+_0x496280+'%');_0x1bf1d1['or'](_0x3a6c('0x2c'),'%'+_0x496280+'%');}}}return _0x1bf1d1;}function parseAdvancedSearchFilter(_0x33beae,_0x181fed){var _0x4242a8=getSqlClauses();var _0x1750b8=as['parseSearch'](_0x33beae);var _0x376aa0=_0x1750b8[_0x3a6c('0x2f')];for(var _0x2c8b78=0x0;_0x2c8b78<_0x1750b8[_0x3a6c('0x30')][_0x3a6c('0x31')];_0x2c8b78++){var _0x252f32=_0x1750b8[_0x3a6c('0x30')][_0x2c8b78];var _0x41ded8='c';var _0xc2e578=_[_0x3a6c('0x32')](_0x181fed,[_0x3a6c('0x33'),_0x252f32[_0x3a6c('0x1f')]]);if(_0xc2e578){if(_0x252f32[_0x3a6c('0x1f')]===_0x3a6c('0x34')||_0xc2e578[_0x3a6c('0x35')]===_0x3a6c('0x36')){_0x252f32[_0x3a6c('0x37')]=_0x3a6c('0x38');}var _0x286bc7=as[_0x3a6c('0x39')](_0x41ded8,_0xc2e578[_0x3a6c('0x3a')],_0x252f32);_0x4242a8['default'][_0x376aa0](_0x286bc7['text'],_0x286bc7[_0x3a6c('0x3b')]['start'],_0x286bc7[_0x3a6c('0x3b')][_0x3a6c('0x3c')]);}else{if(_0x252f32[_0x3a6c('0x1f')]===_0x3a6c('0x3d')){var _0x4cf8c1=_0x252f32[_0x3a6c('0x3b')][_0x3a6c('0x24')](',')['map'](function(_0x3a9092){return Number(_0x3a9092);});var _0x425207=parseTagParameter(_0x4cf8c1);_0x4242a8[_0x3a6c('0x3e')][_0x3a6c('0x3f')][_0x3a6c('0x40')](_0x425207);_0x4242a8['tags'][_0x3a6c('0x41')]=_0x4cf8c1;}else if(_0x252f32[_0x3a6c('0x1f')]===_0x3a6c('0x42')){_0x4242a8[_0x3a6c('0x43')][_0x3a6c('0x3f')][_0x3a6c('0x40')]('uc.UserId\x20=\x20?',_0x252f32[_0x3a6c('0x3b')]);_0x4242a8['user'][_0x3a6c('0x44')]=!![];}}}return _0x4242a8;}function parseModelFields(_0x6a4d4c,_0x406ad5){var _0x22953f=squel[_0x3a6c('0x21')]();var _0x190333=_(_0x6a4d4c)['keys']()[_0x3a6c('0x45')](function(_0x521f67){return _[_0x3a6c('0x46')](_0x406ad5,[_0x3a6c('0x33'),_0x521f67])?_0x521f67:undefined;})[_0x3a6c('0x47')]()[_0x3a6c('0x3b')]();if(_0x6a4d4c[_0x3a6c('0x48')]){_0x190333[_0x3a6c('0x1c')](_0x3a6c('0x48'));}if(_0x6a4d4c[_0x3a6c('0x42')]){_0x190333[_0x3a6c('0x1c')](_0x3a6c('0x42'));}if(_0x190333[_0x3a6c('0x31')]>0x0){_0x190333['forEach'](function(_0x5a8e1b){if(_0x5a8e1b===_0x3a6c('0x5')){_0x22953f[_0x3a6c('0x40')]('c.ListId\x20IN\x20?',[][_0x3a6c('0x49')](_0x6a4d4c[_0x5a8e1b]));}else if(_0x5a8e1b===_0x3a6c('0x48')){var _0x1cd682='%'+_0x6a4d4c[_0x5a8e1b]+'%';_0x22953f['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x1cd682);}else if(_0x5a8e1b===_0x3a6c('0x42')){_0x22953f[_0x3a6c('0x40')](_0x3a6c('0x4a'),_0x6a4d4c[_0x5a8e1b]);}else{_0x22953f[_0x3a6c('0x40')]('c.'+_0x5a8e1b+'\x20=\x20?',_0x6a4d4c[_0x5a8e1b]);}});}return _0x22953f;}function parseQueryParameters(_0x1c78bf,_0x276958){var _0x2e1eb4=getSqlClauses();return Promise[_0x3a6c('0x4b')]()[_0x3a6c('0x4c')](function(){return parseModelFields(_0x1c78bf,_0x276958);})[_0x3a6c('0x4c')](function(_0x115024){_0x2e1eb4[_0x3a6c('0x4d')][_0x3a6c('0x40')](_0x115024);return parseTagParameter(_0x1c78bf[_0x3a6c('0x4e')]);})[_0x3a6c('0x4c')](function(_0x4ac43a){_0x2e1eb4[_0x3a6c('0x3e')][_0x3a6c('0x3f')][_0x3a6c('0x40')](_0x4ac43a);return parseSearchFilter(_0x1c78bf[_0x3a6c('0x4f')]);})[_0x3a6c('0x4c')](function(_0x56be08){_0x2e1eb4[_0x3a6c('0x4f')]=_0x56be08;return _0x2e1eb4;});}function checkListsRestrictions(_0x533370,_0x241b07,_0x43c47a){var _0x3a8a33=squel[_0x3a6c('0x21')]();return Promise[_0x3a6c('0x4b')]()['then'](function(){if(_0x241b07['search']&&_0x533370[_0x3a6c('0x3')]===_0x3a6c('0x50')&&!_0x43c47a){return _0x533370[_0x3a6c('0x51')]({'attributes':['id'],'raw':!![]});}})[_0x3a6c('0x4c')](function(_0x27a971){if(_0x27a971){if(_0x27a971[_0x3a6c('0x31')]===0x0){_0x3a8a33[_0x3a6c('0x40')](_0x3a6c('0x52'));}else{_0x3a8a33[_0x3a6c('0x40')](_0x3a6c('0x53'),_[_0x3a6c('0x45')](_0x27a971,'id'));}}})[_0x3a6c('0x4c')](function(){return _0x3a8a33;});}function buildContactsQuery(_0x1f971b,_0x49777d,_0x18e553,_0x3b2dcd,_0x1ca233,_0x34b805){if(_0x49777d){_0x49777d=_0x18e553[_0x3a6c('0x54')];}_0x1f971b=addFieldsToQuery(_0x1f971b,_0x49777d,_0x3b2dcd,_0x34b805,!![]);var _0x59392b=squel['select']();_0x59392b=addFieldsToQuery(_0x59392b,_0x49777d,_0x3b2dcd,_0x34b805,![]);if(_0x3b2dcd||_0x34b805){_0x1f971b=applyJoinClauses(_0x1f971b,!![]);_0x1f971b[_0x3a6c('0x55')]('c.id');if(_0x18e553[_0x3a6c('0x56')]){_0x59392b[_0x3a6c('0x56')](_0x18e553[_0x3a6c('0x56')]);}if(_0x18e553[_0x3a6c('0x57')]){_0x59392b[_0x3a6c('0x57')](_0x18e553[_0x3a6c('0x57')]);}}else{_0x59392b=applyJoinClauses(_0x59392b,![]);_0x59392b['group'](_0x3a6c('0x58'));if(_0x18e553[_0x3a6c('0x56')]){_0x1f971b[_0x3a6c('0x56')](_0x18e553[_0x3a6c('0x56')]);}if(_0x18e553['offset']){_0x1f971b[_0x3a6c('0x57')](_0x18e553[_0x3a6c('0x57')]);}}_0x59392b[_0x3a6c('0x59')](_0x1ca233);if(_0x18e553[_0x3a6c('0x5a')]){_0x18e553[_0x3a6c('0x5a')][_0x3a6c('0x1d')](function(_0x23935d){_0x1f971b[_0x3a6c('0x5a')]('c.'+_0x23935d[0x0],_0x23935d[0x1]===_0x3a6c('0x5b')?![]:!![]);_0x59392b[_0x3a6c('0x5a')](_0x3a6c('0x5c')+_0x23935d[0x0],_0x23935d[0x1]==='DESC'?![]:!![]);});}_0x59392b[_0x3a6c('0x9')](_0x1f971b,'subqry');return _0x59392b;}function getFilteredContacts(_0x5f2233){var _0x37299b=[];return db[_0x3a6c('0x3d')][_0x3a6c('0x5d')]({'attributes':['id','name',_0x3a6c('0x5e')],'raw':!![]})[_0x3a6c('0x4c')](function(_0xba0f2e){_0x37299b=_[_0x3a6c('0x5f')](_0xba0f2e,'id');var _0x2054fa={'type':db[_0x3a6c('0x60')][_0x3a6c('0x61')][_0x3a6c('0x62')],'model':db[_0x3a6c('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x3a6c('0x64')]['query'](_0x5f2233['toString'](),_0x2054fa);})[_0x3a6c('0x4c')](function(_0x3d759d){_0x3d759d[_0x3a6c('0x1d')](function(_0x197710){if(_0x197710[_0x3a6c('0x1e')]){_0x197710[_0x3a6c('0x65')]=[];_0x197710[_0x3a6c('0x1e')]['split'](',')[_0x3a6c('0x1d')](function(_0x7c943e){_0x197710[_0x3a6c('0x65')][_0x3a6c('0x1c')](_0x37299b[_0x7c943e]);});}delete _0x197710[_0x3a6c('0x1e')];});return _0x3d759d;});}function countFilteredContacts(_0x15bbee,_0xc1ec64){var _0x63b3dc=_0x15bbee['clone']();_0x63b3dc[_0x3a6c('0x1f')](_0x3a6c('0x66'));_0x63b3dc=applyJoinClauses(_0x63b3dc,!![]);_0x15bbee[_0x3a6c('0x55')](_0x3a6c('0x67'));var _0x24883b=utils['getSelectedTags'](_0xc1ec64);if(!_['isEmpty'](_0x24883b)){_0x63b3dc[_0x3a6c('0xb')]('t.id\x20IN\x20?',_0x24883b);}var _0xce4c80={'type':db[_0x3a6c('0x60')][_0x3a6c('0x61')][_0x3a6c('0x62')],'raw':!![]};return db['sequelize'][_0x3a6c('0x68')](_0x63b3dc[_0x3a6c('0x69')](),_0xce4c80)['then'](function(_0x87e79){return _0x87e79[0x0][_0x3a6c('0x66')];});}module[_0x3a6c('0x6a')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xc325=['expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','sqlOperator','length','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','text','value','start','end','Tag','and','tags','ids','user','clause','uc.UserId\x20=\x20?','map','some','Contact','User','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','order','DESC','color','Sequelize','QueryTypes','SELECT','CmContact','sequelize','toString','Tags','clone','c.id','isEmpty','query','COUNT(*)','exports','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','agent','search','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','mobile','fax','email','ListId','updatedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x5636c8,_0x578c8c){var _0x10f1db=function(_0x1d6006){while(--_0x1d6006){_0x5636c8['push'](_0x5636c8['shift']());}};_0x10f1db(++_0x578c8c);}(_0xc325,0x1d9));var _0x5c32=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc325[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var squel=require(_0x5c32('0x0'));var as=require(_0x5c32('0x1'));var qs=require('../parsers/qs');var utils=require(_0x5c32('0x2'));var db=require(_0x5c32('0x3'))['db'];function skipContactsQuery(_0x5acb4e,_0x364cfd){var _0x4dd0a2=![];if(_0x5acb4e[_0x5c32('0x4')]===_0x5c32('0x5')&&!_0x364cfd[_0x5c32('0x6')]&&!_0x364cfd['ListId']&&_0x364cfd[_0x5c32('0x7')]!==_0x5c32('0x8')){_0x4dd0a2=!![];}return _0x4dd0a2;}function getContactsSubquery(){return squel[_0x5c32('0x9')]()[_0x5c32('0xa')](_0x5c32('0xb'),'c')[_0x5c32('0xc')](_0x5c32('0xd'));}function applyJoinClauses(_0x4bde18,_0x3f59a7){var _0x4d130d=_0x3f59a7?'c':_0x5c32('0xe');_0x4bde18[_0x5c32('0xf')](_0x5c32('0x10'),'uc',_0x5c32('0x11')+_0x4d130d+_0x5c32('0x12'))[_0x5c32('0xf')]('cm_contact_has_tags','ct',_0x5c32('0x13')+_0x4d130d+'.id')['left_join'](_0x5c32('0x14'),'t','t.id\x20=\x20ct.TagId');return _0x4bde18;}function addFieldsToQuery(_0x2431e2,_0x191128,_0x8598bd,_0x18ce5a,_0xa0b6fe){var _0x5159a3=_0xa0b6fe?'c':_0x5c32('0xe');if(!_0x191128){_0x191128=['id','firstName','lastName','phone',_0x5c32('0x15'),_0x5c32('0x16'),_0x5c32('0x17'),_0x5c32('0x18'),'CompanyId','createdAt',_0x5c32('0x19'),'deletedAt',_0x5c32('0x1a')];}else if(!_0x191128[_0x5c32('0x1b')]('id')){_0x191128[_0x5c32('0x1c')]('id');}var _0x5a628c=_0x8598bd&&_0xa0b6fe||!_0x8598bd&&!_0xa0b6fe;if(_0x18ce5a){_0x5a628c=_0x18ce5a&&_0xa0b6fe||!_0x18ce5a&&!_0xa0b6fe;}_0x191128[_0x5c32('0x1d')](function(_0x4cd217){if(_0x4cd217===_0x5c32('0x1a')){if(_0x5a628c){_0x2431e2[_0x5c32('0x1e')](_0x5c32('0x1f'),_0x4cd217);}else if(_0x8598bd||_0x18ce5a){_0x2431e2[_0x5c32('0x1e')](_0x5159a3+'.'+_0x4cd217);}}else{_0x2431e2[_0x5c32('0x1e')](_0x5159a3+'.'+_0x4cd217);}});return _0x2431e2;}function getSqlClauses(){var _0x33a610={'default':squel[_0x5c32('0x20')](),'fields':squel[_0x5c32('0x20')](),'filter':squel[_0x5c32('0x20')](),'tags':{'clause':squel[_0x5c32('0x20')](),'ids':null},'user':{'clause':squel[_0x5c32('0x20')](),'skip':![]}};return _0x33a610;}function parseTagParameter(_0x38c395){var _0x39a56a=squel[_0x5c32('0x20')]();if(_0x38c395){var _0x20d9a6=utils[_0x5c32('0x21')](_0x38c395);_0x20d9a6[_0x5c32('0x1d')](function(_0x13602e){_0x39a56a['or'](_0x5c32('0x22'),'%,'+_0x13602e+',%');});}return _0x39a56a;}function parseSearchFilter(_0x3f18fb){var _0x34b5d8=squel[_0x5c32('0x20')]();if(_0x3f18fb){var _0x26eed1=_0x3f18fb['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x26eed1[_0x5c32('0x23')]('\x20')['length']>0x1){_0x34b5d8['or'](_0x5c32('0x24'),qs['getFullTextValue'](_0x26eed1,!![]),null);}else{if(qs[_0x5c32('0x25')](_0x26eed1)){_0x34b5d8['or'](_0x5c32('0x26'),_0x26eed1+'%');_0x34b5d8['or']('c.phone\x20LIKE\x20?',_0x26eed1+'%');_0x34b5d8['or'](_0x5c32('0x27'),_0x26eed1+'%');_0x34b5d8['or'](_0x5c32('0x28'),_0x26eed1+'%');}else if(qs[_0x5c32('0x29')](_0x26eed1)){_0x34b5d8['or']('c.email\x20LIKE\x20?',_0x26eed1+'%');}else{_0x34b5d8['or'](_0x5c32('0x2a'),'%'+_0x26eed1+'%');_0x34b5d8['or'](_0x5c32('0x2b'),'%'+_0x26eed1+'%');_0x34b5d8['or'](_0x5c32('0x2c'),'%'+_0x26eed1+'%');}}}return _0x34b5d8;}function parseAdvancedSearchFilter(_0x11988c,_0x415c89){var _0x20f816=getSqlClauses();var _0x3214c2=as['parseSearch'](_0x11988c);var _0x35ebf9=_0x3214c2[_0x5c32('0x2d')];for(var _0x19a3a5=0x0;_0x19a3a5<_0x3214c2['conditions'][_0x5c32('0x2e')];_0x19a3a5++){var _0x423401=_0x3214c2['conditions'][_0x19a3a5];var _0x37549d='c';var _0x2e8c83=_[_0x5c32('0x2f')](_0x415c89,[_0x5c32('0x30'),_0x423401[_0x5c32('0x1e')]]);if(_0x2e8c83){if(_0x423401[_0x5c32('0x1e')]===_0x5c32('0x31')||_0x2e8c83[_0x5c32('0x32')]===_0x5c32('0x33')){_0x423401[_0x5c32('0x34')]=_0x5c32('0x35');}var _0xbafd3b=as[_0x5c32('0x36')](_0x37549d,_0x2e8c83[_0x5c32('0x37')],_0x423401);_0x20f816['default'][_0x35ebf9](_0xbafd3b[_0x5c32('0x38')],_0xbafd3b[_0x5c32('0x39')][_0x5c32('0x3a')],_0xbafd3b[_0x5c32('0x39')][_0x5c32('0x3b')]);}else{if(_0x423401[_0x5c32('0x1e')]===_0x5c32('0x3c')){var _0x3a258c=_0x423401['value']['split'](',')['map'](function(_0x2ed856){return Number(_0x2ed856);});var _0xae4533=parseTagParameter(_0x3a258c);_0x20f816['tags']['clause'][_0x5c32('0x3d')](_0xae4533);_0x20f816[_0x5c32('0x3e')][_0x5c32('0x3f')]=_0x3a258c;}else if(_0x423401[_0x5c32('0x1e')]==='User'){_0x20f816[_0x5c32('0x40')][_0x5c32('0x41')][_0x5c32('0x3d')](_0x5c32('0x42'),_0x423401[_0x5c32('0x39')]);_0x20f816[_0x5c32('0x40')]['skip']=!![];}}}return _0x20f816;}function parseModelFields(_0x12b7e6,_0x18c2ce){var _0x2a8611=squel['expr']();var _0x45c59e=_(_0x12b7e6)['keys']()[_0x5c32('0x43')](function(_0x4b7440){return _[_0x5c32('0x44')](_0x18c2ce,[_0x5c32('0x30'),_0x4b7440])?_0x4b7440:undefined;})['compact']()[_0x5c32('0x39')]();if(_0x12b7e6[_0x5c32('0x45')]){_0x45c59e[_0x5c32('0x1c')](_0x5c32('0x45'));}if(_0x12b7e6['User']){_0x45c59e['push'](_0x5c32('0x46'));}if(_0x45c59e['length']>0x0){_0x45c59e[_0x5c32('0x1d')](function(_0x5b7b70){if(_0x5b7b70==='ListId'){_0x2a8611[_0x5c32('0x3d')](_0x5c32('0x47'),[][_0x5c32('0x48')](_0x12b7e6[_0x5b7b70]));}else if(_0x5b7b70===_0x5c32('0x45')){var _0x619bd9='%'+_0x12b7e6[_0x5b7b70]+'%';_0x2a8611[_0x5c32('0x3d')](_0x5c32('0x49'),_0x619bd9);}else if(_0x5b7b70==='User'){_0x2a8611['and'](_0x5c32('0x42'),_0x12b7e6[_0x5b7b70]);}else{_0x2a8611['and']('c.'+_0x5b7b70+_0x5c32('0x4a'),_0x12b7e6[_0x5b7b70]);}});}return _0x2a8611;}function parseQueryParameters(_0x39c37a,_0x1bcb7f){var _0x549563=getSqlClauses();return Promise[_0x5c32('0x4b')]()[_0x5c32('0x4c')](function(){return parseModelFields(_0x39c37a,_0x1bcb7f);})[_0x5c32('0x4c')](function(_0x219fe9){_0x549563['fields'][_0x5c32('0x3d')](_0x219fe9);return parseTagParameter(_0x39c37a[_0x5c32('0x4d')]);})[_0x5c32('0x4c')](function(_0xff265){_0x549563[_0x5c32('0x3e')]['clause'][_0x5c32('0x3d')](_0xff265);return parseSearchFilter(_0x39c37a['filter']);})[_0x5c32('0x4c')](function(_0x2d1790){_0x549563[_0x5c32('0x4e')]=_0x2d1790;return _0x549563;});}function checkListsRestrictions(_0x5e2e0f,_0x21b4c7,_0xb11dd6){var _0x335b8a=squel[_0x5c32('0x20')]();return Promise[_0x5c32('0x4b')]()[_0x5c32('0x4c')](function(){if(_0x21b4c7[_0x5c32('0x6')]&&_0x5e2e0f[_0x5c32('0x4')]==='agent'&&!_0xb11dd6){return _0x5e2e0f[_0x5c32('0x4f')]({'attributes':['id'],'raw':!![]});}})[_0x5c32('0x4c')](function(_0x5c3c26){if(_0x5c3c26){if(_0x5c3c26[_0x5c32('0x2e')]===0x0){_0x335b8a[_0x5c32('0x3d')](_0x5c32('0x50'));}else{_0x335b8a['and']('c.ListId\x20IN\x20?',_[_0x5c32('0x43')](_0x5c3c26,'id'));}}})[_0x5c32('0x4c')](function(){return _0x335b8a;});}function buildContactsQuery(_0x493d88,_0x20cfff,_0x400207,_0xb860a,_0x31544b,_0x2dd550){if(_0x20cfff){_0x20cfff=_0x400207[_0x5c32('0x51')];}_0x493d88=addFieldsToQuery(_0x493d88,_0x20cfff,_0xb860a,_0x2dd550,!![]);var _0x3a68f2=squel[_0x5c32('0x9')]();_0x3a68f2=addFieldsToQuery(_0x3a68f2,_0x20cfff,_0xb860a,_0x2dd550,![]);if(_0xb860a||_0x2dd550){_0x493d88=applyJoinClauses(_0x493d88,!![]);_0x493d88[_0x5c32('0x52')]('c.id');if(_0x400207['limit']){_0x3a68f2[_0x5c32('0x53')](_0x400207[_0x5c32('0x53')]);}if(_0x400207[_0x5c32('0x54')]){_0x3a68f2[_0x5c32('0x54')](_0x400207[_0x5c32('0x54')]);}}else{_0x3a68f2=applyJoinClauses(_0x3a68f2,![]);_0x3a68f2[_0x5c32('0x52')]('subqry.id');if(_0x400207[_0x5c32('0x53')]){_0x493d88[_0x5c32('0x53')](_0x400207['limit']);}if(_0x400207['offset']){_0x493d88[_0x5c32('0x54')](_0x400207[_0x5c32('0x54')]);}}_0x3a68f2['having'](_0x31544b);if(_0x400207[_0x5c32('0x55')]){_0x400207['order'][_0x5c32('0x1d')](function(_0x4f796f){_0x493d88[_0x5c32('0x55')]('c.'+_0x4f796f[0x0],_0x4f796f[0x1]===_0x5c32('0x56')?![]:!![]);_0x3a68f2['order']('subqry.'+_0x4f796f[0x0],_0x4f796f[0x1]===_0x5c32('0x56')?![]:!![]);});}_0x3a68f2[_0x5c32('0xa')](_0x493d88,_0x5c32('0xe'));return _0x3a68f2;}function getFilteredContacts(_0x578d4c){var _0x2561ea=[];return db[_0x5c32('0x3c')]['findAll']({'attributes':['id','name',_0x5c32('0x57')],'raw':!![]})[_0x5c32('0x4c')](function(_0x4888aa){_0x2561ea=_['keyBy'](_0x4888aa,'id');var _0x5269d5={'type':db[_0x5c32('0x58')][_0x5c32('0x59')][_0x5c32('0x5a')],'model':db[_0x5c32('0x5b')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x5c32('0x5c')]['query'](_0x578d4c[_0x5c32('0x5d')](),_0x5269d5);})['then'](function(_0x417afa){_0x417afa['forEach'](function(_0x1f3f58){if(_0x1f3f58[_0x5c32('0x1a')]){_0x1f3f58[_0x5c32('0x5e')]=[];_0x1f3f58[_0x5c32('0x1a')][_0x5c32('0x23')](',')[_0x5c32('0x1d')](function(_0x553a64){_0x1f3f58[_0x5c32('0x5e')]['push'](_0x2561ea[_0x553a64]);});}delete _0x1f3f58[_0x5c32('0x1a')];});return _0x417afa;});}function countFilteredContacts(_0x4dfb7c,_0x34e12a){var _0x1743c5=_0x4dfb7c[_0x5c32('0x5f')]();_0x1743c5[_0x5c32('0x1e')]('COUNT(*)');_0x1743c5=applyJoinClauses(_0x1743c5,!![]);_0x4dfb7c[_0x5c32('0x52')](_0x5c32('0x60'));var _0x45588c=utils[_0x5c32('0x21')](_0x34e12a);if(!_[_0x5c32('0x61')](_0x45588c)){_0x1743c5[_0x5c32('0xc')]('t.id\x20IN\x20?',_0x45588c);}var _0x35d45a={'type':db[_0x5c32('0x58')][_0x5c32('0x59')][_0x5c32('0x5a')],'raw':!![]};return db[_0x5c32('0x5c')][_0x5c32('0x62')](_0x1743c5[_0x5c32('0x5d')](),_0x35d45a)[_0x5c32('0x4c')](function(_0x4c4e24){return _0x4c4e24[0x0][_0x5c32('0x63')];});}module[_0x5c32('0x64')]={'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 6f07d4b..144bb58 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 _0xd05e=['unlink','decryptFile','createDecipher','encryptString','secret','utf8','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','end','final','write','close'];(function(_0x4480b9,_0x5c2949){var _0x3f0f02=function(_0x43502f){while(--_0x43502f){_0x4480b9['push'](_0x4480b9['shift']());}};_0x3f0f02(++_0x5c2949);}(_0xd05e,0xbb));var _0xed05=function(_0xb39e5a,_0x1695fc){_0xb39e5a=_0xb39e5a-0x0;var _0x413103=_0xd05e[_0xb39e5a];return _0x413103;};'use strict';var crypto=require(_0xed05('0x0'));var fs=require('fs');var BPromise=require(_0xed05('0x1'));var _=require(_0xed05('0x2'));var config=require(_0xed05('0x3'));var logger=require(_0xed05('0x4'))(_0xed05('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xed05('0x6')],'algorithm':_0xed05('0x7')};const fileOptions={'algorithm':_0xed05('0x8')};if(config[_0xed05('0x9')]&&config[_0xed05('0x9')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xed05('0x9')][_0xed05('0xa')]);if(isSupported){fileOptions[_0xed05('0xa')]=config[_0xed05('0x9')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xed05('0xb')](',\x20');logger[_0xed05('0xc')](config[_0xed05('0x9')][_0xed05('0xa')],_0xed05('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x5d2a9b){return AES_SUPPORTED_RX[_0xed05('0xe')](_0x5d2a9b);}function getSupportedCiphers(){return crypto[_0xed05('0xf')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x4b93fb){return getSupportedCiphers()[_0xed05('0x10')](_0x4b93fb)>-0x1;}function combineOptions(_0xa953ef){var _0x1bfd78={};for(var _0x42350e in fileOptions){if(fileOptions[_0xed05('0x11')](_0x42350e)){_0x1bfd78[_0x42350e]=fileOptions[_0x42350e];}}if(_0xa953ef){for(var _0x4fc605 in _0xa953ef){if(_0xa953ef[_0xed05('0x11')](_0x4fc605)){_0x1bfd78[_0x4fc605]=_0xa953ef[_0x4fc605];}}}return _0x1bfd78;}exports[_0xed05('0x12')]=function(_0x3852e4,_0x3a3b98,_0xb98353,_0x4935a4){return new BPromise(function(_0x497951,_0x39520c){_0x4935a4=combineOptions(_0x4935a4);var _0x53c2df=new Buffer(_0xb98353);var _0x584283=fs[_0xed05('0x13')](_0x3852e4);var _0x51739c=fs[_0xed05('0x14')](_0x3a3b98);var _0x502ad6=crypto[_0xed05('0x15')](_0x4935a4['algorithm'],_0x53c2df);_0x584283['on'](_0xed05('0x16'),function(_0x43628b){var _0x16544e=new Buffer(_0x502ad6[_0xed05('0x17')](_0x43628b),_0xed05('0x18'));_0x51739c['write'](_0x16544e);});_0x584283['on'](_0xed05('0x19'),function(){try{var _0x330a8c=new Buffer(_0x502ad6[_0xed05('0x1a')](_0xed05('0x18')),_0xed05('0x18'));_0x51739c[_0xed05('0x1b')](_0x330a8c);_0x51739c[_0xed05('0x19')]();_0x51739c['on'](_0xed05('0x1c'),function(){return _0x497951(_0x3a3b98);});}catch(_0x339a33){fs[_0xed05('0x1d')](_0x3a3b98);return _0x39520c(_0x339a33);}});});};exports[_0xed05('0x1e')]=function(_0x10454b,_0x445bd6,_0x32dbd7,_0x4e5439){return new BPromise(function(_0x1c9441,_0x25310e){_0x4e5439=combineOptions(_0x4e5439);var _0x47c8eb=new Buffer(_0x32dbd7);var _0x5b95c3=fs['createReadStream'](_0x10454b);var _0x4ae632=fs['createWriteStream'](_0x445bd6);var _0x132d70=crypto[_0xed05('0x1f')](_0x4e5439[_0xed05('0xa')],_0x47c8eb);_0x5b95c3['on'](_0xed05('0x16'),function(_0x8a9406){var _0x334b6e=new Buffer(_0x132d70['update'](_0x8a9406),_0xed05('0x18'));_0x4ae632[_0xed05('0x1b')](_0x334b6e);});_0x5b95c3['on'](_0xed05('0x19'),function(){try{var _0x31aa63=new Buffer(_0x132d70[_0xed05('0x1a')](_0xed05('0x18')),_0xed05('0x18'));_0x4ae632[_0xed05('0x1b')](_0x31aa63);_0x4ae632[_0xed05('0x19')]();_0x4ae632['on']('close',function(){return _0x1c9441(_0x445bd6);});}catch(_0xc49a3b){fs[_0xed05('0x1d')](_0x445bd6);return _0x25310e(_0xc49a3b);}});});};exports[_0xed05('0x20')]=function(_0x69171e,_0x1c91fd,_0x300eeb){var _0x3f9c4c=_0x300eeb||stringOptions['algorithm'];var _0x1b1af6=_0x1c91fd||stringOptions[_0xed05('0x21')];var _0x4fcb40=crypto[_0xed05('0x15')](_0x3f9c4c,_0x1b1af6);var _0x2dd69f=_0x4fcb40['update'](_0x69171e,_0xed05('0x22'),'base64');_0x2dd69f+=_0x4fcb40[_0xed05('0x1a')]('base64');return _0x2dd69f;};exports[_0xed05('0x23')]=function(_0x2f2fd9,_0xe38599,_0x15fd69){var _0x26795c=_0x15fd69||stringOptions[_0xed05('0xa')];var _0x9120be=_0xe38599||stringOptions[_0xed05('0x21')];var _0x1624a3=crypto[_0xed05('0x1f')](_0x26795c,_0x9120be);var _0x366b07=_0x1624a3[_0xed05('0x17')](_0x2f2fd9,'base64','utf8');_0x366b07+=_0x1624a3['final']('utf8');return _0x366b07;}; \ No newline at end of file +var _0xb750=['end','final','createDecipher','close','unlink','encryptString','utf8','base64','crypto','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write'];(function(_0x3ba5a4,_0x1ab3a2){var _0x361851=function(_0x2711bb){while(--_0x2711bb){_0x3ba5a4['push'](_0x3ba5a4['shift']());}};_0x361851(++_0x1ab3a2);}(_0xb750,0x170));var _0x0b75=function(_0x234fd6,_0xa5d7fe){_0x234fd6=_0x234fd6-0x0;var _0x385f2e=_0xb750[_0x234fd6];return _0x385f2e;};'use strict';var crypto=require(_0x0b75('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x0b75('0x1'));var logger=require('../../config/logger')(_0x0b75('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x0b75('0x3')][_0x0b75('0x4')],'algorithm':_0x0b75('0x5')};const fileOptions={'algorithm':_0x0b75('0x6')};if(config[_0x0b75('0x7')]&&config[_0x0b75('0x7')][_0x0b75('0x8')]){var isSupported=isAlgorithmSupported(config[_0x0b75('0x7')][_0x0b75('0x8')]);if(isSupported){fileOptions[_0x0b75('0x8')]=config[_0x0b75('0x7')][_0x0b75('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0b75('0x9')](',\x20');logger[_0x0b75('0xa')](config['encrypt'][_0x0b75('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x203c3a){return AES_SUPPORTED_RX['test'](_0x203c3a);}function getSupportedCiphers(){return crypto[_0x0b75('0xb')]()[_0x0b75('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x212bcf){return getSupportedCiphers()['indexOf'](_0x212bcf)>-0x1;}function combineOptions(_0x50c375){var _0x2a303d={};for(var _0x8c58b3 in fileOptions){if(fileOptions[_0x0b75('0xd')](_0x8c58b3)){_0x2a303d[_0x8c58b3]=fileOptions[_0x8c58b3];}}if(_0x50c375){for(var _0xd1fd0a in _0x50c375){if(_0x50c375[_0x0b75('0xd')](_0xd1fd0a)){_0x2a303d[_0xd1fd0a]=_0x50c375[_0xd1fd0a];}}}return _0x2a303d;}exports[_0x0b75('0xe')]=function(_0x2a5f35,_0x6877c5,_0x350742,_0x2a3632){return new BPromise(function(_0x80cf93,_0x524ca9){_0x2a3632=combineOptions(_0x2a3632);var _0x4d4151=new Buffer(_0x350742);var _0x4ec46a=fs[_0x0b75('0xf')](_0x2a5f35);var _0x367434=fs[_0x0b75('0x10')](_0x6877c5);var _0x45d2a9=crypto[_0x0b75('0x11')](_0x2a3632['algorithm'],_0x4d4151);_0x4ec46a['on'](_0x0b75('0x12'),function(_0x2ef544){var _0x7ea61b=new Buffer(_0x45d2a9[_0x0b75('0x13')](_0x2ef544),_0x0b75('0x14'));_0x367434[_0x0b75('0x15')](_0x7ea61b);});_0x4ec46a['on'](_0x0b75('0x16'),function(){try{var _0x32374f=new Buffer(_0x45d2a9[_0x0b75('0x17')](_0x0b75('0x14')),'binary');_0x367434[_0x0b75('0x15')](_0x32374f);_0x367434[_0x0b75('0x16')]();_0x367434['on']('close',function(){return _0x80cf93(_0x6877c5);});}catch(_0xd814a){fs['unlink'](_0x6877c5);return _0x524ca9(_0xd814a);}});});};exports['decryptFile']=function(_0x2a0f2e,_0x2d9545,_0x4e8b5f,_0x5f3363){return new BPromise(function(_0x1eefe5,_0x40caab){_0x5f3363=combineOptions(_0x5f3363);var _0x2309f2=new Buffer(_0x4e8b5f);var _0x2f017e=fs[_0x0b75('0xf')](_0x2a0f2e);var _0x3bb25a=fs['createWriteStream'](_0x2d9545);var _0x51e566=crypto[_0x0b75('0x18')](_0x5f3363[_0x0b75('0x8')],_0x2309f2);_0x2f017e['on']('data',function(_0x869b81){var _0x604613=new Buffer(_0x51e566[_0x0b75('0x13')](_0x869b81),_0x0b75('0x14'));_0x3bb25a[_0x0b75('0x15')](_0x604613);});_0x2f017e['on'](_0x0b75('0x16'),function(){try{var _0x6a9ef8=new Buffer(_0x51e566[_0x0b75('0x17')]('binary'),_0x0b75('0x14'));_0x3bb25a[_0x0b75('0x15')](_0x6a9ef8);_0x3bb25a['end']();_0x3bb25a['on'](_0x0b75('0x19'),function(){return _0x1eefe5(_0x2d9545);});}catch(_0x196bde){fs[_0x0b75('0x1a')](_0x2d9545);return _0x40caab(_0x196bde);}});});};exports[_0x0b75('0x1b')]=function(_0x25b83a,_0x4114c5,_0x460946){var _0x5dd977=_0x460946||stringOptions[_0x0b75('0x8')];var _0x5b7833=_0x4114c5||stringOptions['secret'];var _0x136c7e=crypto[_0x0b75('0x11')](_0x5dd977,_0x5b7833);var _0xd5cd3=_0x136c7e[_0x0b75('0x13')](_0x25b83a,_0x0b75('0x1c'),'base64');_0xd5cd3+=_0x136c7e[_0x0b75('0x17')]('base64');return _0xd5cd3;};exports['decryptString']=function(_0x5edebb,_0x161209,_0x549e0){var _0x2ec5f2=_0x549e0||stringOptions[_0x0b75('0x8')];var _0x72d5b7=_0x161209||stringOptions['secret'];var _0x591ae9=crypto[_0x0b75('0x18')](_0x2ec5f2,_0x72d5b7);var _0x4bcf89=_0x591ae9['update'](_0x5edebb,_0x0b75('0x1d'),_0x0b75('0x1c'));_0x4bcf89+=_0x591ae9['final']('utf8');return _0x4bcf89;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 941b412..5f3791a 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 _0xf356=['writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','lodash','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','then','num','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','join','mkdirSync','each','%s%d.%s','csv','%s.%s'];(function(_0x3de377,_0x1df59c){var _0x4f64ec=function(_0x3fbdf3){while(--_0x3fbdf3){_0x3de377['push'](_0x3de377['shift']());}};_0x4f64ec(++_0x1df59c);}(_0xf356,0x161));var _0x6f35=function(_0x48d0f1,_0xb5a53d){_0x48d0f1=_0x48d0f1-0x0;var _0x453e83=_0xf356[_0x48d0f1];return _0x453e83;};'use strict';var util=require(_0x6f35('0x0'));var path=require('path');var _=require(_0x6f35('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x6f35('0x2'));var rimraf=require(_0x6f35('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0x6f35('0x4'))[_0x6f35('0x5')];var logger=require(_0x6f35('0x6'))(_0x6f35('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x6f35('0x8')][0x2]);var QUERY=process[_0x6f35('0x8')][0x3];var PATH=process[_0x6f35('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x127acd,_0x29f604){var _0x224547={'status':_0x127acd};var _0x4b7150={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x29f604){_0x224547[_0x6f35('0x9')]=_0x29f604;}return db['AnalyticExtractedReport'][_0x6f35('0xa')](_0x224547,_0x4b7150);}function main(){var _0x305eed=0x1388;var _0x2d80d4;logger[_0x6f35('0xb')](util[_0x6f35('0xc')](_0x6f35('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x6f35('0xe')][_0x6f35('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6f35('0x10'),_0x6f35('0x11')]})['then'](function(_0x49337a){if(_0x49337a){_0x2d80d4=_0x49337a;_0x305eed=_0x2d80d4['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x6f35('0x12')][_0x6f35('0x13')](util[_0x6f35('0xc')](_0x6f35('0x14'),QUERY),{'type':dbH[_0x6f35('0x12')][_0x6f35('0x15')]['SELECT']});})[_0x6f35('0x16')](function(_0x38f2ae){if(!_0x38f2ae[0x0][_0x6f35('0x17')]){return analyticExtractedReport('Empty');}var _0x153bd2=[];var _0x321f25=0x0;if(_0x2d80d4['split']){if(_0x38f2ae&&_0x38f2ae[_0x6f35('0x18')]){var _0x541983=_[_0x6f35('0x19')](_0x38f2ae[0x0][_0x6f35('0x17')]/_0x305eed);var _0x49de3d=Number[_0x6f35('0x1a')](_0x38f2ae[0x0]['num']/_0x305eed)?_0x38f2ae[0x0][_0x6f35('0x17')]%_0x305eed:0x0;_0x541983['forEach'](function(_0x138de2){if(_0x138de2>0x0){_0x321f25+=_0x305eed;}_0x153bd2[_0x6f35('0x1b')](dbH[_0x6f35('0x12')][_0x6f35('0x13')](util[_0x6f35('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x305eed,_0x321f25),{'type':dbH[_0x6f35('0x12')]['QueryTypes']['SELECT']}));});if(_0x49de3d>0x0){_0x321f25+=_0x305eed;_0x153bd2[_0x6f35('0x1b')](dbH[_0x6f35('0x12')][_0x6f35('0x13')](util[_0x6f35('0xc')](_0x6f35('0x1c'),QUERY,_0x49de3d,_0x321f25),{'type':dbH[_0x6f35('0x12')][_0x6f35('0x15')][_0x6f35('0x1d')]}));}}}else{_0x153bd2['push'](dbH[_0x6f35('0x12')]['query'](QUERY,{'type':dbH[_0x6f35('0x12')][_0x6f35('0x15')][_0x6f35('0x1d')]}));}var _0xab159f=path[_0x6f35('0x1e')](PATH);var _0x39953d=path[_0x6f35('0x1f')](PATH,_0x6f35('0x20'));var _0x207b99=_0x2d80d4[_0x6f35('0x10')]&&_0x153bd2[_0x6f35('0x18')]>0x1;var _0x58fdf5=[];if(!fs['existsSync'](path[_0x6f35('0x21')](_0xab159f,_0x39953d))&&_0x207b99){fs[_0x6f35('0x22')](path[_0x6f35('0x21')](_0xab159f,_0x39953d));}return BPromise[_0x6f35('0x23')](_0x153bd2,function(_0x2fcd03){_0x58fdf5['push'](_0x2fcd03);})[_0x6f35('0x16')](function(){for(var _0x15728e=0x0;_0x15728e<_0x58fdf5[_0x6f35('0x18')];_0x15728e+=0x1){var _0x203419;var _0x94eb2e=_0x58fdf5[_0x15728e];if(_0x207b99){_0x203419=path[_0x6f35('0x21')](_0xab159f,_0x39953d,util[_0x6f35('0xc')](_0x6f35('0x24'),_0x39953d,_0x15728e,_0x6f35('0x25')));}else{_0x203419=path[_0x6f35('0x21')](_0xab159f,util[_0x6f35('0xc')](_0x6f35('0x26'),_0x39953d,_0x6f35('0x25')));}fs[_0x6f35('0x27')](_0x203419,csv(_0x94eb2e));}})[_0x6f35('0x16')](function(){if(_0x207b99){return new Promise(function(_0x4b5975){zipdir(path[_0x6f35('0x21')](_0xab159f,_0x39953d),{'saveTo':path[_0x6f35('0x21')](_0xab159f,util[_0x6f35('0xc')]('%s.%s',_0x39953d,'zip'))},function(_0x399068,_0x353fdf){rimraf(path[_0x6f35('0x21')](_0xab159f,_0x39953d),function(){});_0x4b5975(_0x6f35('0x28'));});});}})[_0x6f35('0x16')](function(){logger[_0x6f35('0xb')](util[_0x6f35('0xc')](_0x6f35('0x29'),EXTRACTED_REPORT_ID,_0x6f35('0x2a')));return analyticExtractedReport('Completed',_0x207b99?util[_0x6f35('0xc')]('%s.%s',_0x39953d,_0x207b99?_0x6f35('0x2b'):_0x6f35('0x25')):null);});})[_0x6f35('0x2c')](function(_0x5aa591){logger[_0x6f35('0xb')](util[_0x6f35('0xc')](_0x6f35('0x2d'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x5aa591,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6f35('0x2e'));})[_0x6f35('0x2f')](function(){process[_0x6f35('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5a71=['zip-dir','../../mysqldb','dbH','argv','AnalyticExtractedReport','update','format','CSV','Setting','split','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','to-csv','bluebird'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x5a71,0x1b4));var _0x15a7=function(_0x34ebc6,_0x201e65){_0x34ebc6=_0x34ebc6-0x0;var _0x16f800=_0x5a71[_0x34ebc6];return _0x16f800;};'use strict';var util=require(_0x15a7('0x0'));var path=require(_0x15a7('0x1'));var _=require(_0x15a7('0x2'));var csv=require(_0x15a7('0x3'));var fs=require('fs');var BPromise=require(_0x15a7('0x4'));var zipdir=require(_0x15a7('0x5'));var rimraf=require('rimraf');var db=require(_0x15a7('0x6'))['db'];var dbH=require('../../mysqldb')[_0x15a7('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x15a7('0x8')][0x2]);var QUERY=process[_0x15a7('0x8')][0x3];var PATH=process[_0x15a7('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1aab80,_0x32b52b){var _0x870135={'status':_0x1aab80};var _0x371472={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32b52b){_0x870135['savename']=_0x32b52b;}return db[_0x15a7('0x9')][_0x15a7('0xa')](_0x870135,_0x371472);}function main(){var _0x4a9396=0x1388;var _0x55a850;logger['info'](util[_0x15a7('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x15a7('0xc')));return db[_0x15a7('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x15a7('0xe'),'splitSizeCsv']})['then'](function(_0x263fd6){if(_0x263fd6){_0x55a850=_0x263fd6;_0x4a9396=_0x55a850['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x15a7('0xf')][_0x15a7('0x10')](util[_0x15a7('0xb')](_0x15a7('0x11'),QUERY),{'type':dbH[_0x15a7('0xf')][_0x15a7('0x12')][_0x15a7('0x13')]});})[_0x15a7('0x14')](function(_0x4ee52d){if(!_0x4ee52d[0x0][_0x15a7('0x15')]){return analyticExtractedReport(_0x15a7('0x16'));}var _0x19b399=[];var _0x48da53=0x0;if(_0x55a850['split']){if(_0x4ee52d&&_0x4ee52d[_0x15a7('0x17')]){var _0x2e4a31=_[_0x15a7('0x18')](_0x4ee52d[0x0][_0x15a7('0x15')]/_0x4a9396);var _0x571cff=Number[_0x15a7('0x19')](_0x4ee52d[0x0][_0x15a7('0x15')]/_0x4a9396)?_0x4ee52d[0x0][_0x15a7('0x15')]%_0x4a9396:0x0;_0x2e4a31[_0x15a7('0x1a')](function(_0x29805d){if(_0x29805d>0x0){_0x48da53+=_0x4a9396;}_0x19b399[_0x15a7('0x1b')](dbH['sequelize'][_0x15a7('0x10')](util['format'](_0x15a7('0x1c'),QUERY,_0x4a9396,_0x48da53),{'type':dbH[_0x15a7('0xf')]['QueryTypes'][_0x15a7('0x13')]}));});if(_0x571cff>0x0){_0x48da53+=_0x4a9396;_0x19b399[_0x15a7('0x1b')](dbH[_0x15a7('0xf')]['query'](util[_0x15a7('0xb')](_0x15a7('0x1c'),QUERY,_0x571cff,_0x48da53),{'type':dbH[_0x15a7('0xf')][_0x15a7('0x12')][_0x15a7('0x13')]}));}}}else{_0x19b399['push'](dbH[_0x15a7('0xf')][_0x15a7('0x10')](QUERY,{'type':dbH[_0x15a7('0xf')][_0x15a7('0x12')]['SELECT']}));}var _0xb39da8=path[_0x15a7('0x1d')](PATH);var _0x3af27d=path[_0x15a7('0x1e')](PATH,_0x15a7('0x1f'));var _0x5656e4=_0x55a850[_0x15a7('0xe')]&&_0x19b399['length']>0x1;var _0x5f4e49=[];if(!fs[_0x15a7('0x20')](path['join'](_0xb39da8,_0x3af27d))&&_0x5656e4){fs['mkdirSync'](path[_0x15a7('0x21')](_0xb39da8,_0x3af27d));}return BPromise[_0x15a7('0x22')](_0x19b399,function(_0x4fb1e7){_0x5f4e49['push'](_0x4fb1e7);})['then'](function(){for(var _0x1297e3=0x0;_0x1297e3<_0x5f4e49[_0x15a7('0x17')];_0x1297e3+=0x1){var _0x40372f;var _0x8c8aee=_0x5f4e49[_0x1297e3];if(_0x5656e4){_0x40372f=path[_0x15a7('0x21')](_0xb39da8,_0x3af27d,util[_0x15a7('0xb')](_0x15a7('0x23'),_0x3af27d,_0x1297e3,_0x15a7('0x24')));}else{_0x40372f=path[_0x15a7('0x21')](_0xb39da8,util[_0x15a7('0xb')](_0x15a7('0x25'),_0x3af27d,_0x15a7('0x24')));}fs[_0x15a7('0x26')](_0x40372f,csv(_0x8c8aee));}})[_0x15a7('0x14')](function(){if(_0x5656e4){return new Promise(function(_0x4c9213){zipdir(path['join'](_0xb39da8,_0x3af27d),{'saveTo':path[_0x15a7('0x21')](_0xb39da8,util[_0x15a7('0xb')](_0x15a7('0x25'),_0x3af27d,_0x15a7('0x27')))},function(_0x2d1bb4,_0x1e1e56){rimraf(path['join'](_0xb39da8,_0x3af27d),function(){});_0x4c9213(_0x15a7('0x28'));});});}})[_0x15a7('0x14')](function(){logger[_0x15a7('0x29')](util['format'](_0x15a7('0x2a'),EXTRACTED_REPORT_ID,_0x15a7('0xc')));return analyticExtractedReport(_0x15a7('0x2b'),_0x5656e4?util[_0x15a7('0xb')]('%s.%s',_0x3af27d,_0x5656e4?'zip':_0x15a7('0x24')):null);});})[_0x15a7('0x2c')](function(_0x245304){logger[_0x15a7('0x29')](util[_0x15a7('0xb')](_0x15a7('0x2d'),EXTRACTED_REPORT_ID,_0x15a7('0xc')),util[_0x15a7('0x2e')](_0x245304,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x15a7('0x2f')](function(){process[_0x15a7('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 88f971b..3ecab53 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 _0xd3a8=['length','auto','body','concat','chunk','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','existsSync','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip\x20finished','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','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','lodash','util','path','html-to-pdfmake','zip-dir','rimraf','jsdom','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','tableHeader','map','pick','toString','value','fill'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xd3a8,0x1a6));var _0x8d3a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd3a8[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8d3a('0x0'));var fs=require('fs');var util=require(_0x8d3a('0x1'));var path=require(_0x8d3a('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x8d3a('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x8d3a('0x4'));var rimraf=require(_0x8d3a('0x5'));var JSDOM=require(_0x8d3a('0x6'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0x8d3a('0x7'))['db'];var dbH=require(_0x8d3a('0x7'))['dbH'];var logger=require('../../config/logger')(_0x8d3a('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8d3a('0x9')][0x3];var PATH=process[_0x8d3a('0x9')][0x4];var NAME=process[_0x8d3a('0x9')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x54c0ad,_0x3363ab){var _0x52441e={'status':_0x54c0ad};var _0x4ed18b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3363ab){_0x52441e[_0x8d3a('0xa')]=_0x3363ab;}return db[_0x8d3a('0xb')]['update'](_0x52441e,_0x4ed18b);}function getHeaders(_0x22a839){return _['map'](_0x22a839,function(_0x1e7bda){return{'text':_0x1e7bda,'style':_0x8d3a('0xc')};});}function getRows(_0x1f9b05,_0x3f793b){return _[_0x8d3a('0xd')](_0x3f793b,function(_0x26d2f6){return _(_0x26d2f6)[_0x8d3a('0xe')](_0x1f9b05)[_0x8d3a('0xd')](function(_0x341879){return _0x341879?_[_0x8d3a('0xf')](_0x341879):'';})[_0x8d3a('0x10')]();});}function createTable(_0x10525b,_0x56a980){var _0x2b688a={'widths':_[_0x8d3a('0x11')](Array(_0x10525b[_0x8d3a('0x12')]),0x91),'heights':function(_0x4fe841){return _0x4fe841===0x0?_0x8d3a('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5cef92=getHeaders(_0x10525b);_0x2b688a[_0x8d3a('0x14')]['push'](_0x5cef92);var _0x5ef2f0=getRows(_0x10525b,_0x56a980);_0x2b688a[_0x8d3a('0x14')]=_0x2b688a['body'][_0x8d3a('0x15')](_0x5ef2f0);return _0x2b688a;}function createTables(_0x3fb5ad){var _0x107b52=[];var _0x286f76=_[_0x8d3a('0x16')](Object['keys'](_0x3fb5ad[0x0]),0x5);_0x286f76['forEach'](function(_0x167ff7){_0x107b52[_0x8d3a('0x17')](createTable(_0x167ff7,_0x3fb5ad));});return _0x107b52;}function getPDFDocDefinition(_0x3900b6){var _0x210922=util[_0x8d3a('0x18')](_0x8d3a('0x19'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x8d3a('0x18')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x8d3a('0x18')](FORMAT));var _0x5ea2a7=[];for(var _0x222995=0x0;_0x222995<_0x3900b6['length'];_0x222995++){var _0xbce6a6=[];if(_0x222995===0x0){_0xbce6a6[_0x8d3a('0x17')]({'text':_0x210922,'style':_0x8d3a('0x1a')});}var _0x49d638={'table':_0x3900b6[_0x222995]};if(_0x222995>0x0){_0x49d638[_0x8d3a('0x1b')]=_0x8d3a('0x1c');_0x49d638[_0x8d3a('0x1d')]=[0x0,0x46,0x0,0x0];}_0xbce6a6[_0x8d3a('0x17')](_0x49d638);_0x5ea2a7['push'](_0xbce6a6);}return{'pageSize':'A4','pageOrientation':_0x8d3a('0x1e'),'content':_0x5ea2a7,'footer':function(_0x1c3bbe,_0x113087){return{'text':_0x1c3bbe[_0x8d3a('0xf')]()+_0x8d3a('0x1f')+_0x113087,'style':_0x8d3a('0x20')};},'defaultStyle':{'font':_0x8d3a('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8d3a('0x22')},'footer':{'alignment':_0x8d3a('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2129a7){var _0x4ed9c9=0x1388;var _0xe596cc;if(!_0x2129a7[0x0][_0x8d3a('0x24')]){return analyticExtractedReport(_0x8d3a('0x25'));}return db[_0x8d3a('0x26')][_0x8d3a('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8d3a('0x28'),'splitSizePdf']})['then'](function(_0x55938e){if(_0x55938e){_0xe596cc=_0x55938e;_0x4ed9c9=_0xe596cc[_0x8d3a('0x29')]||0x3e8;}})[_0x8d3a('0x2a')](function(){var _0x4465b7=[];var _0x397c13=0x0;if(_0xe596cc['split']){if(_0x2129a7&&_0x2129a7[_0x8d3a('0x12')]){var _0x1ff85a=_[_0x8d3a('0x2b')](_0x2129a7[0x0]['num']/_0x4ed9c9);var _0x2ac1ef=Number['isInteger'](_0x2129a7[0x0]['num']/_0x4ed9c9)?_0x2129a7[0x0]['num']%_0x4ed9c9:0x0;_0x1ff85a[_0x8d3a('0x2c')](function(_0x3ab797){if(_0x3ab797>0x0){_0x397c13+=_0x4ed9c9;}_0x4465b7[_0x8d3a('0x17')](dbH[_0x8d3a('0x2d')]['query'](util[_0x8d3a('0x18')](_0x8d3a('0x2e'),QUERY,_0x4ed9c9,_0x397c13),{'type':dbH[_0x8d3a('0x2d')][_0x8d3a('0x2f')][_0x8d3a('0x30')]}));});if(_0x2ac1ef>0x0){_0x397c13+=_0x4ed9c9;_0x4465b7[_0x8d3a('0x17')](dbH[_0x8d3a('0x2d')][_0x8d3a('0x31')](util[_0x8d3a('0x18')](_0x8d3a('0x2e'),QUERY,_0x2ac1ef,_0x397c13),{'type':dbH['sequelize'][_0x8d3a('0x2f')][_0x8d3a('0x30')]}));}}}else{_0x4465b7['push'](dbH[_0x8d3a('0x2d')][_0x8d3a('0x31')](QUERY,{'type':dbH[_0x8d3a('0x2d')]['QueryTypes'][_0x8d3a('0x30')]}));}var _0x697d94=path[_0x8d3a('0x32')](PATH);var _0x464ac3=path[_0x8d3a('0x33')](PATH,'.pdf');var _0x24ab96=_0xe596cc['split']&&_0x4465b7[_0x8d3a('0x12')]>0x1;var _0x163005=[];if(!fs[_0x8d3a('0x34')](path[_0x8d3a('0x35')](_0x697d94,_0x464ac3))&&_0x24ab96){fs[_0x8d3a('0x36')](path[_0x8d3a('0x35')](_0x697d94,_0x464ac3));}return BPromise[_0x8d3a('0x37')](_0x4465b7,function(_0x513191){_0x163005[_0x8d3a('0x17')](_0x513191);})[_0x8d3a('0x2a')](function(){var _0x59599a=[];for(var _0x5db5ec=0x0;_0x5db5ec<_0x163005[_0x8d3a('0x12')];_0x5db5ec+=0x1){var _0x2b4330=_0x163005[_0x5db5ec];var _0xda9016=createTables(_['flatten'](_0x2b4330));var _0x7a6e16;var _0x364d15=getPDFDocDefinition(_0xda9016);var _0x2d9654=getPDFPrinter();var _0x3780d6=_0x2d9654[_0x8d3a('0x38')](_0x364d15);if(_0x24ab96){_0x7a6e16=path[_0x8d3a('0x35')](_0x697d94,_0x464ac3,util[_0x8d3a('0x18')](_0x8d3a('0x39'),_0x464ac3,_0x5db5ec,_0x8d3a('0x3a')));}else{_0x7a6e16=path[_0x8d3a('0x35')](_0x697d94,util[_0x8d3a('0x18')]('%s.%s',_0x464ac3,_0x8d3a('0x3a')));}_0x59599a[_0x8d3a('0x17')](writePDFDocument(_0x3780d6,_0x7a6e16));}return Promise[_0x8d3a('0x3b')](_0x59599a);})['then'](function(){if(_0x24ab96){return new Promise(function(_0x53ba55){zipdir(path[_0x8d3a('0x35')](_0x697d94,_0x464ac3),{'saveTo':path[_0x8d3a('0x35')](_0x697d94,util['format'](_0x8d3a('0x3c'),_0x464ac3,'zip'))},function(){rimraf(path[_0x8d3a('0x35')](_0x697d94,_0x464ac3),function(){});_0x53ba55(_0x8d3a('0x3d'));});});}})['then'](function(){if(!_0x24ab96)return;rimraf(path[_0x8d3a('0x35')](_0x697d94,_0x464ac3),function(){});})[_0x8d3a('0x2a')](function(){logger[_0x8d3a('0x3e')](util[_0x8d3a('0x18')](_0x8d3a('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x8d3a('0x40'),_0x24ab96?util[_0x8d3a('0x18')](_0x8d3a('0x3c'),_0x464ac3,_0x24ab96?_0x8d3a('0x41'):_0x8d3a('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8d3a('0x3e')](util[_0x8d3a('0x18')](_0x8d3a('0x42'),EXTRACTED_REPORT_ID,_0x8d3a('0x43')));return db['AnalyticExtractedReport'][_0x8d3a('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x17d0a3){EXTRACTED_REPORT=_0x17d0a3;return dbH[_0x8d3a('0x2d')][_0x8d3a('0x31')](util[_0x8d3a('0x18')](_0x8d3a('0x45'),QUERY),{'type':dbH['sequelize'][_0x8d3a('0x2f')][_0x8d3a('0x30')]});})[_0x8d3a('0x2a')](extractReport)['catch'](function(_0x3a2d01){logger[_0x8d3a('0x3e')](util[_0x8d3a('0x18')](_0x8d3a('0x46'),EXTRACTED_REPORT_ID,'PDF'),util[_0x8d3a('0x47')](_0x3a2d01,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8d3a('0x48'));})[_0x8d3a('0x49')](function(){process[_0x8d3a('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x107160=new PdfPrinter({'Arial':{'normal':__dirname+_0x8d3a('0x4b'),'bold':__dirname+_0x8d3a('0x4c'),'italics':__dirname+_0x8d3a('0x4d'),'bolditalics':__dirname+_0x8d3a('0x4e')}});return _0x107160;}function getPDFDocDefinitionFromHTML(_0x2738c8,_0x305a46){var _0x1ebf20=util['format']('%s\x20#%d',_0x305a46[_0x8d3a('0x4f')],_0x305a46['interactionId']);var _0x4594c4=moment()['format'](_0x8d3a('0x50'))[_0x8d3a('0xf')]();var _0x7fd453=htmlToPdfmake(_0x2738c8,{'window':window,'tableAutoSize':!![]});return{'content':[_0x7fd453],'defaultStyle':{'font':_0x8d3a('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8d3a('0x51'),'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':_0x8d3a('0x51')}},'header':function(){return[{'text':_0x8d3a('0x52'),'style':'header'}];},'footer':function(_0x50793d,_0x2466cb){return[{'text':util[_0x8d3a('0x18')](_0x8d3a('0x53'),_0x1ebf20,_0x50793d,_0x2466cb,_0x4594c4),'style':_0x8d3a('0x20')}];}};}function writePDFDocument(_0x5ddd7c,_0x52ccc7){return new Promise(function(_0x472d62,_0x20a79a){var _0x4c96f7=_0x5ddd7c[_0x8d3a('0x54')](fs[_0x8d3a('0x55')](_0x52ccc7));_0x4c96f7['on'](_0x8d3a('0x56'),function(){_0x472d62(_0x8d3a('0x56'));});_0x4c96f7['on']('error',function(_0x3c8563){_0x20a79a(_0x3c8563);});_0x5ddd7c[_0x8d3a('0x57')]();});}exports['createPdfFromHTML']=function(_0x5305df,_0x5b592e){var _0x54ceb2=getPDFPrinter();var _0x34e7db=getPDFDocDefinitionFromHTML(_0x5305df,_0x5b592e);var _0x49cbdf=_0x54ceb2['createPdfKitDocument'](_0x34e7db);return writePDFDocument(_0x49cbdf,_0x5b592e[_0x8d3a('0x2')])['catch'](function(_0x4e495e){throw _0x4e495e;});}; \ No newline at end of file +var _0x67b4=['basename','.pdf','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','Arial','center','pipe','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','tableHeader','map','toString','value','fill','length','push','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','endDate','header','pageBreak','before','landscape','\x20/\x20','footer','black','right','num','Setting','split','splitSizePdf','then','range','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','query','SELECT','dirname'];(function(_0x485a9a,_0x33bde7){var _0x380463=function(_0x2e2b06){while(--_0x2e2b06){_0x485a9a['push'](_0x485a9a['shift']());}};_0x380463(++_0x33bde7);}(_0x67b4,0x12f));var _0x467b=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x67b4[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x467b('0x0'));var fs=require('fs');var util=require(_0x467b('0x1'));var path=require(_0x467b('0x2'));var moment=require(_0x467b('0x3'));var htmlToPdfmake=require(_0x467b('0x4'));var PdfPrinter=require(_0x467b('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0x467b('0x6'));var JSDOM=require(_0x467b('0x7'))[_0x467b('0x8')];var window=new JSDOM('')[_0x467b('0x9')];var BPromise=require(_0x467b('0xa'));var db=require(_0x467b('0xb'))['db'];var dbH=require(_0x467b('0xb'))[_0x467b('0xc')];var logger=require('../../config/logger')(_0x467b('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x467b('0xe')][0x2]);var QUERY=process[_0x467b('0xe')][0x3];var PATH=process[_0x467b('0xe')][0x4];var NAME=process[_0x467b('0xe')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1746e6,_0x2e206e){var _0x1af4a0={'status':_0x1746e6};var _0x297f9d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2e206e){_0x1af4a0[_0x467b('0xf')]=_0x2e206e;}return db[_0x467b('0x10')][_0x467b('0x11')](_0x1af4a0,_0x297f9d);}function getHeaders(_0x5963ca){return _['map'](_0x5963ca,function(_0x51356b){return{'text':_0x51356b,'style':_0x467b('0x12')};});}function getRows(_0x5aa982,_0x2ad495){return _[_0x467b('0x13')](_0x2ad495,function(_0x468f3e){return _(_0x468f3e)['pick'](_0x5aa982)[_0x467b('0x13')](function(_0x109bb0){return _0x109bb0?_[_0x467b('0x14')](_0x109bb0):'';})[_0x467b('0x15')]();});}function createTable(_0x2cd4cd,_0x240150){var _0xa19cfe={'widths':_[_0x467b('0x16')](Array(_0x2cd4cd[_0x467b('0x17')]),0x91),'heights':function(_0x285dac){return _0x285dac===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x26bf60=getHeaders(_0x2cd4cd);_0xa19cfe['body'][_0x467b('0x18')](_0x26bf60);var _0x5c7eb6=getRows(_0x2cd4cd,_0x240150);_0xa19cfe[_0x467b('0x19')]=_0xa19cfe[_0x467b('0x19')][_0x467b('0x1a')](_0x5c7eb6);return _0xa19cfe;}function createTables(_0x43104f){var _0x412640=[];var _0xb08b7b=_[_0x467b('0x1b')](Object[_0x467b('0x1c')](_0x43104f[0x0]),0x5);_0xb08b7b[_0x467b('0x1d')](function(_0x391e62){_0x412640[_0x467b('0x18')](createTable(_0x391e62,_0x43104f));});return _0x412640;}function getPDFDocDefinition(_0x4ae7b5){var _0x3e8bae=util[_0x467b('0x1e')](_0x467b('0x1f'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x467b('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x467b('0x20')])[_0x467b('0x1e')](FORMAT));var _0x3dd11b=[];for(var _0x270777=0x0;_0x270777<_0x4ae7b5[_0x467b('0x17')];_0x270777++){var _0x79ca65=[];if(_0x270777===0x0){_0x79ca65['push']({'text':_0x3e8bae,'style':_0x467b('0x21')});}var _0x37f71a={'table':_0x4ae7b5[_0x270777]};if(_0x270777>0x0){_0x37f71a[_0x467b('0x22')]=_0x467b('0x23');_0x37f71a['margin']=[0x0,0x46,0x0,0x0];}_0x79ca65[_0x467b('0x18')](_0x37f71a);_0x3dd11b[_0x467b('0x18')](_0x79ca65);}return{'pageSize':'A4','pageOrientation':_0x467b('0x24'),'content':_0x3dd11b,'footer':function(_0x208be4,_0xade680){return{'text':_0x208be4[_0x467b('0x14')]()+_0x467b('0x25')+_0xade680,'style':_0x467b('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x467b('0x27')},'footer':{'alignment':_0x467b('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2ef1d1){var _0xce317e=0x1388;var _0x2333f4;if(!_0x2ef1d1[0x0][_0x467b('0x29')]){return analyticExtractedReport('Empty');}return db[_0x467b('0x2a')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x467b('0x2b'),_0x467b('0x2c')]})[_0x467b('0x2d')](function(_0x3a2ab6){if(_0x3a2ab6){_0x2333f4=_0x3a2ab6;_0xce317e=_0x2333f4[_0x467b('0x2c')]||0x3e8;}})[_0x467b('0x2d')](function(){var _0x308cca=[];var _0x93b3cb=0x0;if(_0x2333f4[_0x467b('0x2b')]){if(_0x2ef1d1&&_0x2ef1d1['length']){var _0x47ca6d=_[_0x467b('0x2e')](_0x2ef1d1[0x0][_0x467b('0x29')]/_0xce317e);var _0x5924db=Number['isInteger'](_0x2ef1d1[0x0][_0x467b('0x29')]/_0xce317e)?_0x2ef1d1[0x0][_0x467b('0x29')]%_0xce317e:0x0;_0x47ca6d['forEach'](function(_0x27e7f0){if(_0x27e7f0>0x0){_0x93b3cb+=_0xce317e;}_0x308cca[_0x467b('0x18')](dbH['sequelize']['query'](util[_0x467b('0x1e')](_0x467b('0x2f'),QUERY,_0xce317e,_0x93b3cb),{'type':dbH[_0x467b('0x30')][_0x467b('0x31')]['SELECT']}));});if(_0x5924db>0x0){_0x93b3cb+=_0xce317e;_0x308cca[_0x467b('0x18')](dbH[_0x467b('0x30')][_0x467b('0x32')](util[_0x467b('0x1e')](_0x467b('0x2f'),QUERY,_0x5924db,_0x93b3cb),{'type':dbH[_0x467b('0x30')][_0x467b('0x31')][_0x467b('0x33')]}));}}}else{_0x308cca['push'](dbH[_0x467b('0x30')][_0x467b('0x32')](QUERY,{'type':dbH[_0x467b('0x30')][_0x467b('0x31')][_0x467b('0x33')]}));}var _0x580dfa=path[_0x467b('0x34')](PATH);var _0xd6fcf2=path[_0x467b('0x35')](PATH,_0x467b('0x36'));var _0x2e6c1e=_0x2333f4[_0x467b('0x2b')]&&_0x308cca[_0x467b('0x17')]>0x1;var _0x3b5e3d=[];if(!fs['existsSync'](path[_0x467b('0x37')](_0x580dfa,_0xd6fcf2))&&_0x2e6c1e){fs[_0x467b('0x38')](path[_0x467b('0x37')](_0x580dfa,_0xd6fcf2));}return BPromise[_0x467b('0x39')](_0x308cca,function(_0x2e73ab){_0x3b5e3d[_0x467b('0x18')](_0x2e73ab);})[_0x467b('0x2d')](function(){var _0x42ec32=[];for(var _0x29da1f=0x0;_0x29da1f<_0x3b5e3d[_0x467b('0x17')];_0x29da1f+=0x1){var _0x1a4484=_0x3b5e3d[_0x29da1f];var _0x29b317=createTables(_[_0x467b('0x3a')](_0x1a4484));var _0x5737e3;var _0x305c4f=getPDFDocDefinition(_0x29b317);var _0x17bd1e=getPDFPrinter();var _0xe30453=_0x17bd1e[_0x467b('0x3b')](_0x305c4f);if(_0x2e6c1e){_0x5737e3=path[_0x467b('0x37')](_0x580dfa,_0xd6fcf2,util[_0x467b('0x1e')](_0x467b('0x3c'),_0xd6fcf2,_0x29da1f,_0x467b('0x3d')));}else{_0x5737e3=path[_0x467b('0x37')](_0x580dfa,util[_0x467b('0x1e')](_0x467b('0x3e'),_0xd6fcf2,'pdf'));}_0x42ec32[_0x467b('0x18')](writePDFDocument(_0xe30453,_0x5737e3));}return Promise[_0x467b('0x3f')](_0x42ec32);})[_0x467b('0x2d')](function(){if(_0x2e6c1e){return new Promise(function(_0x18c843){zipdir(path[_0x467b('0x37')](_0x580dfa,_0xd6fcf2),{'saveTo':path[_0x467b('0x37')](_0x580dfa,util[_0x467b('0x1e')](_0x467b('0x3e'),_0xd6fcf2,'zip'))},function(){rimraf(path[_0x467b('0x37')](_0x580dfa,_0xd6fcf2),function(){});_0x18c843(_0x467b('0x40'));});});}})[_0x467b('0x2d')](function(){if(!_0x2e6c1e)return;rimraf(path[_0x467b('0x37')](_0x580dfa,_0xd6fcf2),function(){});})['then'](function(){logger[_0x467b('0x41')](util['format'](_0x467b('0x42'),EXTRACTED_REPORT_ID,_0x467b('0x43')));return analyticExtractedReport(_0x467b('0x44'),_0x2e6c1e?util['format'](_0x467b('0x3e'),_0xd6fcf2,_0x2e6c1e?_0x467b('0x45'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x467b('0x41')](util[_0x467b('0x1e')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x467b('0x43')));return db[_0x467b('0x10')][_0x467b('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x467b('0x2d')](function(_0x5bf687){EXTRACTED_REPORT=_0x5bf687;return dbH[_0x467b('0x30')]['query'](util['format'](_0x467b('0x47'),QUERY),{'type':dbH[_0x467b('0x30')][_0x467b('0x31')]['SELECT']});})['then'](extractReport)[_0x467b('0x48')](function(_0x5bebd0){logger[_0x467b('0x41')](util[_0x467b('0x1e')](_0x467b('0x49'),EXTRACTED_REPORT_ID,_0x467b('0x43')),util[_0x467b('0x4a')](_0x5bebd0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x467b('0x4b'));})[_0x467b('0x4c')](function(){process[_0x467b('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x146386=new PdfPrinter({'Arial':{'normal':__dirname+_0x467b('0x4e'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x467b('0x4f'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x146386;}function getPDFDocDefinitionFromHTML(_0x15f803,_0x13ec1e){var _0x407906=util[_0x467b('0x1e')](_0x467b('0x50'),_0x13ec1e[_0x467b('0x51')],_0x13ec1e['interactionId']);var _0x533020=moment()[_0x467b('0x1e')](_0x467b('0x52'))[_0x467b('0x14')]();var _0x1bab9f=htmlToPdfmake(_0x15f803,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1bab9f],'defaultStyle':{'font':_0x467b('0x53')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x467b('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x467b('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x467b('0x54')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x467b('0x21')}];},'footer':function(_0x34cdcc,_0x2da730){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x407906,_0x34cdcc,_0x2da730,_0x533020),'style':_0x467b('0x26')}];}};}function writePDFDocument(_0x5e51f2,_0x49321d){return new Promise(function(_0x193dc7,_0x3d0804){var _0x25764e=_0x5e51f2[_0x467b('0x55')](fs['createWriteStream'](_0x49321d));_0x25764e['on']('finish',function(){_0x193dc7('finish');});_0x25764e['on'](_0x467b('0x56'),function(_0x5bd8ee){_0x3d0804(_0x5bd8ee);});_0x5e51f2[_0x467b('0x57')]();});}exports[_0x467b('0x58')]=function(_0x31d854,_0x352978){var _0x4ab7af=getPDFPrinter();var _0x3e7771=getPDFDocDefinitionFromHTML(_0x31d854,_0x352978);var _0x36d016=_0x4ab7af[_0x467b('0x3b')](_0x3e7771);return writePDFDocument(_0x36d016,_0x352978[_0x467b('0x2')])['catch'](function(_0xde0f1a){throw _0xde0f1a;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 16ca62f..877fb31 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 _0x819d=['Setting','find','split','splitSizeXlsx','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','length','existsSync','join','mkdirSync','each','then','%s%d.%s','%s.%s','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','xlsx','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','path','lodash','bluebird','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','info','XLSX'];(function(_0x28a991,_0x56ca36){var _0x28bbb3=function(_0xdec46){while(--_0xdec46){_0x28a991['push'](_0x28a991['shift']());}};_0x28bbb3(++_0x56ca36);}(_0x819d,0x10f));var _0xd819=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x819d[_0x1035c1];return _0x308d67;};'use strict';var util=require('util');var path=require(_0xd819('0x0'));var _=require(_0xd819('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xd819('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xd819('0x3'))['db'];var dbH=require('../../mysqldb')[_0xd819('0x4')];var logger=require('../../config/logger')(_0xd819('0x5'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xd819('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e1427,_0x138ac3){var _0x4275c9={'status':_0x2e1427};var _0x22d15e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x138ac3){_0x4275c9['savename']=_0x138ac3;}return db[_0xd819('0x7')][_0xd819('0x8')](_0x4275c9,_0x22d15e);}function main(){var _0x226cc3=0x1388;var _0x4bd02e;logger[_0xd819('0x9')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd819('0xa')));return db[_0xd819('0xb')][_0xd819('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd819('0xd'),_0xd819('0xe')]})['then'](function(_0x4cca2f){if(_0x4cca2f){_0x4bd02e=_0x4cca2f;_0x226cc3=_0x4bd02e['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xd819('0xf')][_0xd819('0x10')](util[_0xd819('0x11')](_0xd819('0x12'),QUERY),{'type':dbH[_0xd819('0xf')]['QueryTypes'][_0xd819('0x13')]});})['then'](function(_0x41e024){if(!_0x41e024[0x0][_0xd819('0x14')]){return analyticExtractedReport(_0xd819('0x15'));}var _0x22c15e=[];var _0x723b55=0x0;if(_0x4bd02e[_0xd819('0xd')]){if(_0x41e024&&_0x41e024['length']){var _0x44de81=_[_0xd819('0x16')](_0x41e024[0x0]['num']/_0x226cc3);var _0x2a794d=Number[_0xd819('0x17')](_0x41e024[0x0][_0xd819('0x14')]/_0x226cc3)?_0x41e024[0x0]['num']%_0x226cc3:0x0;_0x44de81['forEach'](function(_0x41181f){if(_0x41181f>0x0){_0x723b55+=_0x226cc3;}_0x22c15e[_0xd819('0x18')](dbH[_0xd819('0xf')][_0xd819('0x10')](util[_0xd819('0x11')](_0xd819('0x19'),QUERY,_0x226cc3,_0x723b55),{'type':dbH[_0xd819('0xf')][_0xd819('0x1a')][_0xd819('0x13')]}));});if(_0x2a794d>0x0){_0x723b55+=_0x226cc3;_0x22c15e[_0xd819('0x18')](dbH[_0xd819('0xf')][_0xd819('0x10')](util[_0xd819('0x11')](_0xd819('0x19'),QUERY,_0x2a794d,_0x723b55),{'type':dbH['sequelize']['QueryTypes'][_0xd819('0x13')]}));}}}else{_0x22c15e[_0xd819('0x18')](dbH[_0xd819('0xf')][_0xd819('0x10')](QUERY,{'type':dbH[_0xd819('0xf')][_0xd819('0x1a')]['SELECT']}));}var _0x3f10cc=path[_0xd819('0x1b')](PATH);var _0x210197=path['basename'](PATH,'.xlsx');var _0x23be28=_0x4bd02e[_0xd819('0xd')]&&_0x22c15e[_0xd819('0x1c')]>0x1;var _0x22aa47=[];if(!fs[_0xd819('0x1d')](path[_0xd819('0x1e')](_0x3f10cc,_0x210197))&&_0x23be28){fs[_0xd819('0x1f')](path[_0xd819('0x1e')](_0x3f10cc,_0x210197));}return BPromise[_0xd819('0x20')](_0x22c15e,function(_0x53d325){_0x22aa47[_0xd819('0x18')](_0x53d325);})[_0xd819('0x21')](function(){for(var _0x260ab8=0x0;_0x260ab8<_0x22aa47[_0xd819('0x1c')];_0x260ab8+=0x1){var _0x45be6c;var _0xa43665=_0x22aa47[_0x260ab8];if(_0x23be28){_0x45be6c=path[_0xd819('0x1e')](_0x3f10cc,_0x210197,util[_0xd819('0x11')](_0xd819('0x22'),_0x210197,_0x260ab8,'xlsx'));}else{_0x45be6c=path['join'](_0x3f10cc,util[_0xd819('0x11')](_0xd819('0x23'),_0x210197,'xlsx'));}fs[_0xd819('0x24')](_0x45be6c,json2xls(_0xa43665),_0xd819('0x25'));}})[_0xd819('0x21')](function(){if(_0x23be28){return new Promise(function(_0x400ca6){zipdir(path[_0xd819('0x1e')](_0x3f10cc,_0x210197),{'saveTo':path['join'](_0x3f10cc,util[_0xd819('0x11')](_0xd819('0x23'),_0x210197,'zip'))},function(_0xb5c069,_0x57ee94){rimraf(path[_0xd819('0x1e')](_0x3f10cc,_0x210197),function(){});_0x400ca6(_0xd819('0x26'));});});}})['then'](function(){logger[_0xd819('0x9')](util[_0xd819('0x11')](_0xd819('0x27'),EXTRACTED_REPORT_ID,_0xd819('0xa')));return analyticExtractedReport(_0xd819('0x28'),_0x23be28?util[_0xd819('0x11')](_0xd819('0x23'),_0x210197,_0x23be28?_0xd819('0x29'):_0xd819('0x2a')):null);});})['catch'](function(_0x46b1ee){logger['info'](util['format'](_0xd819('0x2b'),EXTRACTED_REPORT_ID,_0xd819('0xa')),util['inspect'](_0x46b1ee,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd819('0x2c'));})[_0xd819('0x2d')](function(){process[_0xd819('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xaf42=['analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','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','exit','path','lodash','json2xls','bluebird','../../mysqldb','dbH','../../config/logger'];(function(_0xa4d99d,_0x94f75d){var _0xe8e50b=function(_0x1fd23c){while(--_0x1fd23c){_0xa4d99d['push'](_0xa4d99d['shift']());}};_0xe8e50b(++_0x94f75d);}(_0xaf42,0x11f));var _0x2af4=function(_0x50ba46,_0x35db07){_0x50ba46=_0x50ba46-0x0;var _0x1e0868=_0xaf42[_0x50ba46];return _0x1e0868;};'use strict';var util=require('util');var path=require(_0x2af4('0x0'));var _=require(_0x2af4('0x1'));var fs=require('fs');var json2xls=require(_0x2af4('0x2'));var BPromise=require(_0x2af4('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x2af4('0x4'))['db'];var dbH=require(_0x2af4('0x4'))[_0x2af4('0x5')];var logger=require(_0x2af4('0x6'))(_0x2af4('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2af4('0x8')][0x3];var PATH=process[_0x2af4('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x8b8039,_0x283c06){var _0x5e6f84={'status':_0x8b8039};var _0x451ea9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x283c06){_0x5e6f84[_0x2af4('0x9')]=_0x283c06;}return db[_0x2af4('0xa')]['update'](_0x5e6f84,_0x451ea9);}function main(){var _0x436577=0x1388;var _0x2d679e;logger['info'](util[_0x2af4('0xb')](_0x2af4('0xc'),EXTRACTED_REPORT_ID,_0x2af4('0xd')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2af4('0xe'),_0x2af4('0xf')]})[_0x2af4('0x10')](function(_0x5ec6c8){if(_0x5ec6c8){_0x2d679e=_0x5ec6c8;_0x436577=_0x2d679e[_0x2af4('0xf')]||0x1388;}})[_0x2af4('0x10')](function(){return dbH[_0x2af4('0x11')][_0x2af4('0x12')](util[_0x2af4('0xb')](_0x2af4('0x13'),QUERY),{'type':dbH[_0x2af4('0x11')][_0x2af4('0x14')][_0x2af4('0x15')]});})['then'](function(_0x3a7ca3){if(!_0x3a7ca3[0x0]['num']){return analyticExtractedReport(_0x2af4('0x16'));}var _0x9ec3f3=[];var _0x2e61b8=0x0;if(_0x2d679e[_0x2af4('0xe')]){if(_0x3a7ca3&&_0x3a7ca3[_0x2af4('0x17')]){var _0x2873de=_[_0x2af4('0x18')](_0x3a7ca3[0x0][_0x2af4('0x19')]/_0x436577);var _0x1e1520=Number[_0x2af4('0x1a')](_0x3a7ca3[0x0]['num']/_0x436577)?_0x3a7ca3[0x0][_0x2af4('0x19')]%_0x436577:0x0;_0x2873de[_0x2af4('0x1b')](function(_0x1da4c5){if(_0x1da4c5>0x0){_0x2e61b8+=_0x436577;}_0x9ec3f3[_0x2af4('0x1c')](dbH[_0x2af4('0x11')][_0x2af4('0x12')](util[_0x2af4('0xb')](_0x2af4('0x1d'),QUERY,_0x436577,_0x2e61b8),{'type':dbH[_0x2af4('0x11')][_0x2af4('0x14')]['SELECT']}));});if(_0x1e1520>0x0){_0x2e61b8+=_0x436577;_0x9ec3f3['push'](dbH[_0x2af4('0x11')][_0x2af4('0x12')](util[_0x2af4('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1e1520,_0x2e61b8),{'type':dbH[_0x2af4('0x11')][_0x2af4('0x14')][_0x2af4('0x15')]}));}}}else{_0x9ec3f3['push'](dbH[_0x2af4('0x11')][_0x2af4('0x12')](QUERY,{'type':dbH[_0x2af4('0x11')][_0x2af4('0x14')][_0x2af4('0x15')]}));}var _0x24764e=path['dirname'](PATH);var _0x2365b4=path[_0x2af4('0x1e')](PATH,_0x2af4('0x1f'));var _0x55923b=_0x2d679e[_0x2af4('0xe')]&&_0x9ec3f3['length']>0x1;var _0xb5a33f=[];if(!fs[_0x2af4('0x20')](path[_0x2af4('0x21')](_0x24764e,_0x2365b4))&&_0x55923b){fs[_0x2af4('0x22')](path[_0x2af4('0x21')](_0x24764e,_0x2365b4));}return BPromise[_0x2af4('0x23')](_0x9ec3f3,function(_0x59e440){_0xb5a33f[_0x2af4('0x1c')](_0x59e440);})[_0x2af4('0x10')](function(){for(var _0x5bb966=0x0;_0x5bb966<_0xb5a33f['length'];_0x5bb966+=0x1){var _0x2f7fba;var _0x3ec6ad=_0xb5a33f[_0x5bb966];if(_0x55923b){_0x2f7fba=path[_0x2af4('0x21')](_0x24764e,_0x2365b4,util[_0x2af4('0xb')]('%s%d.%s',_0x2365b4,_0x5bb966,_0x2af4('0x24')));}else{_0x2f7fba=path[_0x2af4('0x21')](_0x24764e,util[_0x2af4('0xb')](_0x2af4('0x25'),_0x2365b4,'xlsx'));}fs[_0x2af4('0x26')](_0x2f7fba,json2xls(_0x3ec6ad),_0x2af4('0x27'));}})[_0x2af4('0x10')](function(){if(_0x55923b){return new Promise(function(_0x306f1c){zipdir(path[_0x2af4('0x21')](_0x24764e,_0x2365b4),{'saveTo':path[_0x2af4('0x21')](_0x24764e,util[_0x2af4('0xb')](_0x2af4('0x25'),_0x2365b4,_0x2af4('0x28')))},function(_0x561299,_0x3799a8){rimraf(path[_0x2af4('0x21')](_0x24764e,_0x2365b4),function(){});_0x306f1c(_0x2af4('0x29'));});});}})[_0x2af4('0x10')](function(){logger[_0x2af4('0x2a')](util[_0x2af4('0xb')](_0x2af4('0x2b'),EXTRACTED_REPORT_ID,_0x2af4('0xd')));return analyticExtractedReport(_0x2af4('0x2c'),_0x55923b?util[_0x2af4('0xb')](_0x2af4('0x25'),_0x2365b4,_0x55923b?'zip':_0x2af4('0x24')):null);});})['catch'](function(_0x57e753){logger['info'](util[_0x2af4('0xb')](_0x2af4('0x2d'),EXTRACTED_REPORT_ID,_0x2af4('0xd')),util[_0x2af4('0x2e')](_0x57e753,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2af4('0x2f'));})['finally'](function(){process[_0x2af4('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 5614c11..dd35a9a 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 _0xf2fb=['CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','catch','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','extension','find','exten','push','type','Set','CDR(type)=%s','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','*,*,*,*','tag'];(function(_0x71bace,_0x321bb0){var _0x56b146=function(_0xaee7d0){while(--_0xaee7d0){_0x71bace['push'](_0x71bace['shift']());}};_0x56b146(++_0x321bb0);}(_0xf2fb,0x95));var _0xbf2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf2fb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbf2f('0x0'));var util=require(_0xbf2f('0x1'));function rewrite(_0x12a10b,_0x396ffb){var _0x5a62bb=this;return _0x12a10b[_0xbf2f('0x2')][_0xbf2f('0x3')][_0xbf2f('0x4')]({'raw':!![]})['then'](function(_0x582ce6){_0x5a62bb[_0xbf2f('0x5')]=_0x582ce6;return _0x12a10b['models'][_0xbf2f('0x6')][_0xbf2f('0x4')]({'where':{'IntervalId':_0x396ffb[_0xbf2f('0x7')]},'raw':!![]});})[_0xbf2f('0x8')](function(_0x5cda3f){return _0x12a10b[_0xbf2f('0x2')][_0xbf2f('0x6')][_0xbf2f('0x4')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x5cda3f,'exten'))}},'order':[{'raw':_0xbf2f('0x9')}],'raw':!![]});})[_0xbf2f('0x8')](function(_0x7b9f8d){var _0xdae72d=_['filter'](_0x7b9f8d,{'priority':'1'});var _0x52460b=_[_0xbf2f('0xa')](_0x7b9f8d,{'isApp':0x1});var _0x3fa540=_[_0xbf2f('0xb')](_0x52460b,'exten');var _0x21533a=[_0xbf2f('0xc'),'playback'];var _0xb4be29=[];var _0x30e134=[];for(var _0x5a988b in _0x3fa540){if(_0x3fa540['hasOwnProperty'](_0x5a988b)){_0x5a62bb[_0xbf2f('0xd')]=0x2;_0x5a62bb[_0xbf2f('0xe')]=[];_0x5a62bb[_0xbf2f('0xf')]=_[_0xbf2f('0x10')](_0xdae72d,{'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')]});_0x5a62bb[_0xbf2f('0xe')][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')],'app':_0xbf2f('0x14'),'appdata':util['format'](_0xbf2f('0x15'),_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')]),'context':_0x3fa540[_0x5a988b][0x0]['context'],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x5a62bb['priority']++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});if(_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')]===_0xbf2f('0x17')){_0x5a62bb[_0xbf2f('0xe')][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0]['type'],'app':'Set','appdata':_0xbf2f('0x18')+_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')],'context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x5a62bb['priority']++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});}else if(_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')]===_0xbf2f('0x1a')){if(_0x5a62bb['extension']){_0x5a62bb[_0xbf2f('0xe')][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0]['type'],'app':_0xbf2f('0x14'),'appdata':_0xbf2f('0x1b')+(_0x5a62bb[_0xbf2f('0xf')][_0xbf2f('0x1c')]?'${EXTEN:'+_0x5a62bb[_0xbf2f('0xf')]['cutdigits']+'}':_0xbf2f('0x1d')),'context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0]['exten'],'priority':_0x5a62bb[_0xbf2f('0xd')]++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});}_0x5a62bb[_0xbf2f('0xe')][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')],'app':'Set','appdata':'CDR(routeid)='+_0x3fa540[_0x5a988b][0x0]['VoiceExtensionId'],'context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0]['exten'],'priority':_0x5a62bb[_0xbf2f('0xd')]++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});var _0x229afb=_0x5a62bb[_0xbf2f('0xd')]++;_0x5a62bb[_0xbf2f('0xe')][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0]['type'],'app':_0xbf2f('0x1e'),'appdata':_0xbf2f('0x1f')+(_0x229afb+0x2)+_0xbf2f('0x20')+(_0x229afb+0x1)+')','context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x229afb,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0]['VoiceExtensionId']});if(_0x5a62bb[_0xbf2f('0xf')]){_0x5a62bb['extensions'][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')],'app':_0xbf2f('0x14'),'appdata':_0x5a62bb['extension'][_0xbf2f('0x1c')]?_0xbf2f('0x21')+_0x5a62bb[_0xbf2f('0xf')][_0xbf2f('0x1c')]+'}':_0xbf2f('0x22'),'context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x5a62bb[_0xbf2f('0xd')]++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});}_0x5a62bb[_0xbf2f('0xe')][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')],'app':'Set','appdata':'outboundrouteid='+_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')],'context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x5a62bb['priority']++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0]['VoiceExtensionId']});if(_0x5a62bb['extension']&&_0x5a62bb[_0xbf2f('0xf')][_0xbf2f('0x23')](_0xbf2f('0x24'))&&_0x5a62bb[_0xbf2f('0xf')][_0xbf2f('0x24')]!==_0xbf2f('0x25')){_0x5a62bb[_0xbf2f('0xe')][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x5a62bb['priority']++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});_0x5a62bb[_0xbf2f('0xe')]['push']({'type':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')],'app':_0xbf2f('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5a62bb[_0xbf2f('0xf')][_0xbf2f('0x24')]||'wav','context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x5a62bb[_0xbf2f('0xd')]++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0]['VoiceExtensionId']});}}_0x5a62bb[_0xbf2f('0xe')][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')],'app':'Set','appdata':_0xbf2f('0x26'),'context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x5a62bb[_0xbf2f('0xd')]++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});_0x5a62bb['extensions'][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')],'app':_0xbf2f('0x14'),'appdata':_0xbf2f('0x27'),'context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x5a62bb[_0xbf2f('0xd')]++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});_0x5a62bb[_0xbf2f('0xe')][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x13')],'app':_0xbf2f('0x14'),'appdata':_0xbf2f('0x28'),'context':_0x3fa540[_0x5a988b][0x0]['context'],'exten':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x11')],'priority':_0x5a62bb[_0xbf2f('0xd')]++,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});for(var _0x4ad4d2=0x0,_0x392614=0x0;_0x4ad4d2<_0x3fa540[_0x5a988b][_0xbf2f('0x29')];_0x4ad4d2+=0x1,_0x392614=0x0){var _0x22a285=_0x3fa540[_0x5a988b][_0x4ad4d2];if(_0x22a285['type']){_0x22a285[_0xbf2f('0x13')]=_0x22a285['type']['toLowerCase']();}var _0x1b5913=[];var _0x18b270=[];delete _0x22a285['id'];delete _0x22a285[_0xbf2f('0x2a')];delete _0x22a285[_0xbf2f('0x2b')];var _0x10de1f=_0x22a285['interval']!==_0xbf2f('0x2c')?[_0x22a285['interval']]:_0x22a285[_0xbf2f('0x7')]?_['map'](_['filter'](_0x5a62bb[_0xbf2f('0x5')],{'IntervalId':_0x22a285[_0xbf2f('0x7')]}),'interval'):[];if(_0x22a285[_0xbf2f('0x23')](_0xbf2f('0x2d'))){if(_0x22a285['tag']&&_0x22a285[_0xbf2f('0x2d')]!=='--'){_0x1b5913[_0xbf2f('0x12')]({'type':_0x22a285['type'],'app':_0xbf2f('0x14'),'appdata':_0xbf2f('0x2e')+_0x22a285[_0xbf2f('0x2d')],'context':_0x22a285['context'],'exten':_0x22a285[_0xbf2f('0x11')],'priority':_0x10de1f[_0xbf2f('0x29')]+_0x5a62bb[_0xbf2f('0xd')]+_0x392614++,'VoiceExtensionId':_0x22a285['VoiceExtensionId']});}}if(_0x22a285[_0xbf2f('0x13')]===_0xbf2f('0x1a')&&_0x22a285['hasOwnProperty'](_0xbf2f('0x2f'))){if(_0x22a285[_0xbf2f('0x2f')]){_0x1b5913[_0xbf2f('0x12')]({'type':_0x22a285['type'],'app':_0xbf2f('0x1e'),'appdata':_0xbf2f('0x30')+_0x22a285[_0xbf2f('0x2f')]+')','context':_0x22a285[_0xbf2f('0x19')],'exten':_0x22a285['exten'],'priority':_0x10de1f[_0xbf2f('0x29')]+_0x5a62bb[_0xbf2f('0xd')]+_0x392614++,'VoiceExtensionId':_0x22a285['VoiceExtensionId']});}else{_0x1b5913['push']({'type':_0x22a285[_0xbf2f('0x13')],'app':_0xbf2f('0x1e'),'appdata':_0xbf2f('0x31'),'context':_0x22a285[_0xbf2f('0x19')],'exten':_0x22a285[_0xbf2f('0x11')],'priority':_0x10de1f[_0xbf2f('0x29')]+_0x5a62bb[_0xbf2f('0xd')]+_0x392614++,'VoiceExtensionId':_0x22a285['VoiceExtensionId']});}}if(_0x22a285[_0xbf2f('0x23')](_0xbf2f('0x32'))){if(_0x21533a[_0xbf2f('0x33')](_0x22a285['app'][_0xbf2f('0x34')]())>=0x0&&_0x22a285[_0xbf2f('0x35')]!==_0xbf2f('0x36')){if(_0x22a285[_0xbf2f('0x32')]){_0x1b5913['push']({'type':_0x22a285[_0xbf2f('0x13')],'app':_0xbf2f('0x1e'),'appdata':_0xbf2f('0x37'),'context':_0x22a285[_0xbf2f('0x19')],'exten':_0x22a285[_0xbf2f('0x11')],'priority':_0x10de1f[_0xbf2f('0x29')]+_0x5a62bb[_0xbf2f('0xd')]+_0x392614++,'VoiceExtensionId':_0x22a285['VoiceExtensionId']});_0x1b5913[_0xbf2f('0x12')]({'type':_0x22a285[_0xbf2f('0x13')],'app':_0xbf2f('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x22a285[_0xbf2f('0x19')],'exten':_0x22a285[_0xbf2f('0x11')],'priority':_0x10de1f['length']+_0x5a62bb[_0xbf2f('0xd')]+_0x392614++,'VoiceExtensionId':_0x22a285['VoiceExtensionId']});}else{_0x1b5913[_0xbf2f('0x12')]({'type':_0x22a285[_0xbf2f('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x22a285['context'],'exten':_0x22a285[_0xbf2f('0x11')],'priority':_0x10de1f['length']+_0x5a62bb[_0xbf2f('0xd')]+_0x392614++,'VoiceExtensionId':_0x22a285['VoiceExtensionId']});_0x1b5913[_0xbf2f('0x12')]({'type':_0x22a285[_0xbf2f('0x13')],'app':_0xbf2f('0x14'),'appdata':_0xbf2f('0x38'),'context':_0x22a285['context'],'exten':_0x22a285[_0xbf2f('0x11')],'priority':_0x10de1f[_0xbf2f('0x29')]+_0x5a62bb[_0xbf2f('0xd')]+_0x392614++,'VoiceExtensionId':_0x22a285[_0xbf2f('0x16')]});}}}for(var _0x807a6f=0x0;_0x807a6f<_0x10de1f[_0xbf2f('0x29')];_0x807a6f+=0x1){var _0x4024dd=_0x5a62bb[_0xbf2f('0xd')]+_0x10de1f[_0xbf2f('0x29')];var _0x3ccc50=_0x807a6f===_0x10de1f[_0xbf2f('0x29')]-0x1?_0x5a62bb[_0xbf2f('0xd')]+_0x1b5913['length']+_0x18b270[_0xbf2f('0x29')]+0x2:_0x5a62bb[_0xbf2f('0xd')]+_0x807a6f+0x1;_0x1b5913[_0xbf2f('0x39')](_0x807a6f,0x0,{'type':_0x22a285[_0xbf2f('0x13')],'app':'GotoIfTime','appdata':_0x10de1f[_0x807a6f]+'?'+_0x22a285[_0xbf2f('0x19')]+_0xbf2f('0x3a')+_0x4024dd+':'+_0x22a285['context']+_0xbf2f('0x3a')+_0x3ccc50,'exten':_0x22a285[_0xbf2f('0x11')],'context':_0x22a285[_0xbf2f('0x19')],'priority':_0x5a62bb['priority']+_0x807a6f,'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});}_0x22a285[_0xbf2f('0xd')]=_0x1b5913['length']?_['last'](_0x1b5913)[_0xbf2f('0xd')]+0x1:_0x5a62bb['priority'];_0x5a62bb[_0xbf2f('0xd')]=(_0x18b270['length']?_[_0xbf2f('0x3b')](_0x18b270)[_0xbf2f('0xd')]:_0x22a285['priority'])+0x1;_0x5a62bb['extensions']=_[_0xbf2f('0x3c')](_0x5a62bb[_0xbf2f('0xe')],_0x1b5913,[_0x22a285],_0x18b270);}_0x5a62bb['extensions'][_0xbf2f('0x12')]({'type':_0x3fa540[_0x5a988b][0x0]['type'],'app':_0xbf2f('0x3d'),'exten':_0x3fa540[_0x5a988b][0x0]['exten'],'context':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x19')],'priority':_0x5a62bb[_0xbf2f('0xd')],'VoiceExtensionId':_0x3fa540[_0x5a988b][0x0][_0xbf2f('0x16')]});_0xb4be29[_0xbf2f('0x12')](_0x3fa540[_0x5a988b][0x0]['VoiceExtensionId']);_0x30e134=_[_0xbf2f('0x3c')](_0x30e134,_0x5a62bb[_0xbf2f('0xe')]);}}return _0x12a10b[_0xbf2f('0x3e')](function(_0x3b515a){return _0x12a10b[_0xbf2f('0x2')][_0xbf2f('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0xb4be29}},'transaction':_0x3b515a})[_0xbf2f('0x8')](function(_0x5992b2){return _0x12a10b[_0xbf2f('0x2')][_0xbf2f('0x6')]['bulkCreate'](_['sortBy'](_0x30e134,_0xbf2f('0xd')),{'transaction':_0x3b515a});});});})[_0xbf2f('0x3f')](function(_0x5973e){console['error'](_0x5973e);});}exports[_0xbf2f('0x40')]=rewrite; \ No newline at end of file +var _0x877b=['CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','util','models','then','intervals','VoiceExtension','findAll','IntervalId','uniq','map','filter','exten','queue','playback','hasOwnProperty','priority','type','format','context','VoiceExtensionId','inbound','extensions','push','Set','CDR(routeid)=','outbound','extension','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto('];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0x877b,0x1d9));var _0xb877=function(_0x30f0b4,_0x5bb4d5){_0x30f0b4=_0x30f0b4-0x0;var _0x3fdc1e=_0x877b[_0x30f0b4];return _0x3fdc1e;};'use strict';var _=require('lodash');var util=require(_0xb877('0x0'));function rewrite(_0x4b7190,_0x2a6a4e){var _0x4bc3ce=this;return _0x4b7190[_0xb877('0x1')]['Interval']['findAll']({'raw':!![]})[_0xb877('0x2')](function(_0x1ed72e){_0x4bc3ce[_0xb877('0x3')]=_0x1ed72e;return _0x4b7190[_0xb877('0x1')][_0xb877('0x4')][_0xb877('0x5')]({'where':{'IntervalId':_0x2a6a4e[_0xb877('0x6')]},'raw':!![]});})[_0xb877('0x2')](function(_0x178ad3){return _0x4b7190[_0xb877('0x1')][_0xb877('0x4')]['findAll']({'where':{'exten':{'$in':_[_0xb877('0x7')](_[_0xb877('0x8')](_0x178ad3,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xb877('0x2')](function(_0x298cf0){var _0x5e484a=_[_0xb877('0x9')](_0x298cf0,{'priority':'1'});var _0x2b63a1=_[_0xb877('0x9')](_0x298cf0,{'isApp':0x1});var _0x4414da=_['groupBy'](_0x2b63a1,_0xb877('0xa'));var _0x389fe9=[_0xb877('0xb'),_0xb877('0xc')];var _0x2e5bd1=[];var _0x246fe6=[];for(var _0x5d2c4b in _0x4414da){if(_0x4414da[_0xb877('0xd')](_0x5d2c4b)){_0x4bc3ce[_0xb877('0xe')]=0x2;_0x4bc3ce['extensions']=[];_0x4bc3ce['extension']=_['find'](_0x5e484a,{'exten':_0x4414da[_0x5d2c4b][0x0]['exten']});_0x4bc3ce['extensions']['push']({'type':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')],'app':'Set','appdata':util[_0xb877('0x10')]('CDR(type)=%s',_0x4414da[_0x5d2c4b][0x0]['type']),'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xa')],'priority':_0x4bc3ce[_0xb877('0xe')]++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]});if(_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')]===_0xb877('0x13')){_0x4bc3ce[_0xb877('0x14')][_0xb877('0x15')]({'type':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')],'app':_0xb877('0x16'),'appdata':_0xb877('0x17')+_0x4414da[_0x5d2c4b][0x0]['VoiceExtensionId'],'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xa')],'priority':_0x4bc3ce[_0xb877('0xe')]++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]});}else if(_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')]===_0xb877('0x18')){if(_0x4bc3ce[_0xb877('0x19')]){_0x4bc3ce[_0xb877('0x14')][_0xb877('0x15')]({'type':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')],'app':_0xb877('0x16'),'appdata':_0xb877('0x1a')+(_0x4bc3ce[_0xb877('0x19')][_0xb877('0x1b')]?'${EXTEN:'+_0x4bc3ce[_0xb877('0x19')]['cutdigits']+'}':_0xb877('0x1c')),'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xa')],'priority':_0x4bc3ce['priority']++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]});}_0x4bc3ce[_0xb877('0x14')][_0xb877('0x15')]({'type':_0x4414da[_0x5d2c4b][0x0]['type'],'app':_0xb877('0x16'),'appdata':'CDR(routeid)='+_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')],'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xa')],'priority':_0x4bc3ce['priority']++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0]['VoiceExtensionId']});var _0x44f599=_0x4bc3ce[_0xb877('0xe')]++;_0x4bc3ce['extensions']['push']({'type':_0x4414da[_0x5d2c4b][0x0]['type'],'app':_0xb877('0x1d'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x44f599+0x2)+_0xb877('0x1e')+(_0x44f599+0x1)+')','context':_0x4414da[_0x5d2c4b][0x0]['context'],'exten':_0x4414da[_0x5d2c4b][0x0]['exten'],'priority':_0x44f599,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0]['VoiceExtensionId']});if(_0x4bc3ce[_0xb877('0x19')]){_0x4bc3ce[_0xb877('0x14')][_0xb877('0x15')]({'type':_0x4414da[_0x5d2c4b][0x0]['type'],'app':_0xb877('0x16'),'appdata':_0x4bc3ce['extension'][_0xb877('0x1b')]?_0xb877('0x1f')+_0x4bc3ce[_0xb877('0x19')][_0xb877('0x1b')]+'}':_0xb877('0x20'),'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xa')],'priority':_0x4bc3ce[_0xb877('0xe')]++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0]['VoiceExtensionId']});}_0x4bc3ce['extensions'][_0xb877('0x15')]({'type':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')],'app':_0xb877('0x16'),'appdata':'outboundrouteid='+_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')],'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0]['exten'],'priority':_0x4bc3ce[_0xb877('0xe')]++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]});if(_0x4bc3ce[_0xb877('0x19')]&&_0x4bc3ce[_0xb877('0x19')]['hasOwnProperty'](_0xb877('0x21'))&&_0x4bc3ce[_0xb877('0x19')][_0xb877('0x21')]!=='none'){_0x4bc3ce[_0xb877('0x14')][_0xb877('0x15')]({'type':_0x4414da[_0x5d2c4b][0x0]['type'],'app':_0xb877('0x16'),'appdata':_0xb877('0x22'),'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xa')],'priority':_0x4bc3ce[_0xb877('0xe')]++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]});_0x4bc3ce[_0xb877('0x14')]['push']({'type':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')],'app':'Set','appdata':_0xb877('0x23')+_0x4bc3ce['extension'][_0xb877('0x21')]||_0xb877('0x24'),'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xa')],'priority':_0x4bc3ce[_0xb877('0xe')]++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]});}}_0x4bc3ce[_0xb877('0x14')][_0xb877('0x15')]({'type':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')],'app':_0xb877('0x16'),'appdata':_0xb877('0x25'),'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0]['exten'],'priority':_0x4bc3ce[_0xb877('0xe')]++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]});_0x4bc3ce[_0xb877('0x14')]['push']({'type':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')],'app':_0xb877('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xa')],'priority':_0x4bc3ce['priority']++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0]['VoiceExtensionId']});_0x4bc3ce[_0xb877('0x14')][_0xb877('0x15')]({'type':_0x4414da[_0x5d2c4b][0x0]['type'],'app':'Set','appdata':_0xb877('0x26'),'context':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x11')],'exten':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xa')],'priority':_0x4bc3ce[_0xb877('0xe')]++,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]});for(var _0x3245cb=0x0,_0x11062d=0x0;_0x3245cb<_0x4414da[_0x5d2c4b][_0xb877('0x27')];_0x3245cb+=0x1,_0x11062d=0x0){var _0x158286=_0x4414da[_0x5d2c4b][_0x3245cb];if(_0x158286[_0xb877('0xf')]){_0x158286[_0xb877('0xf')]=_0x158286['type']['toLowerCase']();}var _0x1959c5=[];var _0x156600=[];delete _0x158286['id'];delete _0x158286[_0xb877('0x28')];delete _0x158286[_0xb877('0x29')];var _0x5b33f9=_0x158286[_0xb877('0x2a')]!==_0xb877('0x2b')?[_0x158286[_0xb877('0x2a')]]:_0x158286[_0xb877('0x6')]?_['map'](_['filter'](_0x4bc3ce[_0xb877('0x3')],{'IntervalId':_0x158286['IntervalId']}),_0xb877('0x2a')):[];if(_0x158286[_0xb877('0xd')](_0xb877('0x2c'))){if(_0x158286[_0xb877('0x2c')]&&_0x158286['tag']!=='--'){_0x1959c5[_0xb877('0x15')]({'type':_0x158286[_0xb877('0xf')],'app':_0xb877('0x16'),'appdata':_0xb877('0x2d')+_0x158286[_0xb877('0x2c')],'context':_0x158286[_0xb877('0x11')],'exten':_0x158286['exten'],'priority':_0x5b33f9[_0xb877('0x27')]+_0x4bc3ce[_0xb877('0xe')]+_0x11062d++,'VoiceExtensionId':_0x158286[_0xb877('0x12')]});}}if(_0x158286[_0xb877('0xf')]===_0xb877('0x18')&&_0x158286[_0xb877('0xd')](_0xb877('0x2e'))){if(_0x158286[_0xb877('0x2e')]){_0x1959c5['push']({'type':_0x158286[_0xb877('0xf')],'app':_0xb877('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x158286[_0xb877('0x2e')]+')','context':_0x158286[_0xb877('0x11')],'exten':_0x158286['exten'],'priority':_0x5b33f9[_0xb877('0x27')]+_0x4bc3ce[_0xb877('0xe')]+_0x11062d++,'VoiceExtensionId':_0x158286[_0xb877('0x12')]});}else{_0x1959c5[_0xb877('0x15')]({'type':_0x158286[_0xb877('0xf')],'app':_0xb877('0x1d'),'appdata':_0xb877('0x2f'),'context':_0x158286[_0xb877('0x11')],'exten':_0x158286[_0xb877('0xa')],'priority':_0x5b33f9[_0xb877('0x27')]+_0x4bc3ce[_0xb877('0xe')]+_0x11062d++,'VoiceExtensionId':_0x158286['VoiceExtensionId']});}}if(_0x158286[_0xb877('0xd')](_0xb877('0x30'))){if(_0x389fe9['indexOf'](_0x158286[_0xb877('0x31')][_0xb877('0x32')]())>=0x0&&_0x158286[_0xb877('0x33')]!=='custom'){if(_0x158286['answer']){_0x1959c5['push']({'type':_0x158286[_0xb877('0xf')],'app':_0xb877('0x1d'),'appdata':_0xb877('0x34'),'context':_0x158286[_0xb877('0x11')],'exten':_0x158286['exten'],'priority':_0x5b33f9[_0xb877('0x27')]+_0x4bc3ce[_0xb877('0xe')]+_0x11062d++,'VoiceExtensionId':_0x158286[_0xb877('0x12')]});_0x1959c5[_0xb877('0x15')]({'type':_0x158286[_0xb877('0xf')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x158286[_0xb877('0x11')],'exten':_0x158286[_0xb877('0xa')],'priority':_0x5b33f9[_0xb877('0x27')]+_0x4bc3ce[_0xb877('0xe')]+_0x11062d++,'VoiceExtensionId':_0x158286[_0xb877('0x12')]});}else{_0x1959c5[_0xb877('0x15')]({'type':_0x158286[_0xb877('0xf')],'app':_0xb877('0x1d'),'appdata':_0xb877('0x35'),'context':_0x158286[_0xb877('0x11')],'exten':_0x158286['exten'],'priority':_0x5b33f9['length']+_0x4bc3ce[_0xb877('0xe')]+_0x11062d++,'VoiceExtensionId':_0x158286[_0xb877('0x12')]});_0x1959c5[_0xb877('0x15')]({'type':_0x158286[_0xb877('0xf')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x158286['context'],'exten':_0x158286[_0xb877('0xa')],'priority':_0x5b33f9[_0xb877('0x27')]+_0x4bc3ce[_0xb877('0xe')]+_0x11062d++,'VoiceExtensionId':_0x158286[_0xb877('0x12')]});}}}for(var _0x2b855e=0x0;_0x2b855e<_0x5b33f9[_0xb877('0x27')];_0x2b855e+=0x1){var _0x2f201c=_0x4bc3ce[_0xb877('0xe')]+_0x5b33f9[_0xb877('0x27')];var _0xf15e74=_0x2b855e===_0x5b33f9['length']-0x1?_0x4bc3ce[_0xb877('0xe')]+_0x1959c5[_0xb877('0x27')]+_0x156600[_0xb877('0x27')]+0x2:_0x4bc3ce['priority']+_0x2b855e+0x1;_0x1959c5['splice'](_0x2b855e,0x0,{'type':_0x158286[_0xb877('0xf')],'app':'GotoIfTime','appdata':_0x5b33f9[_0x2b855e]+'?'+_0x158286['context']+_0xb877('0x36')+_0x2f201c+':'+_0x158286['context']+_0xb877('0x36')+_0xf15e74,'exten':_0x158286[_0xb877('0xa')],'context':_0x158286[_0xb877('0x11')],'priority':_0x4bc3ce[_0xb877('0xe')]+_0x2b855e,'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0]['VoiceExtensionId']});}_0x158286['priority']=_0x1959c5['length']?_[_0xb877('0x37')](_0x1959c5)['priority']+0x1:_0x4bc3ce[_0xb877('0xe')];_0x4bc3ce[_0xb877('0xe')]=(_0x156600[_0xb877('0x27')]?_['last'](_0x156600)[_0xb877('0xe')]:_0x158286[_0xb877('0xe')])+0x1;_0x4bc3ce[_0xb877('0x14')]=_[_0xb877('0x38')](_0x4bc3ce[_0xb877('0x14')],_0x1959c5,[_0x158286],_0x156600);}_0x4bc3ce[_0xb877('0x14')][_0xb877('0x15')]({'type':_0x4414da[_0x5d2c4b][0x0][_0xb877('0xf')],'app':_0xb877('0x39'),'exten':_0x4414da[_0x5d2c4b][0x0]['exten'],'context':_0x4414da[_0x5d2c4b][0x0]['context'],'priority':_0x4bc3ce[_0xb877('0xe')],'VoiceExtensionId':_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]});_0x2e5bd1[_0xb877('0x15')](_0x4414da[_0x5d2c4b][0x0][_0xb877('0x12')]);_0x246fe6=_[_0xb877('0x38')](_0x246fe6,_0x4bc3ce[_0xb877('0x14')]);}}return _0x4b7190[_0xb877('0x3a')](function(_0x3b4082){return _0x4b7190[_0xb877('0x1')][_0xb877('0x4')][_0xb877('0x3b')]({'where':{'VoiceExtensionId':{'$in':_0x2e5bd1}},'transaction':_0x3b4082})[_0xb877('0x2')](function(_0x71314a){return _0x4b7190['models'][_0xb877('0x4')][_0xb877('0x3c')](_[_0xb877('0x3d')](_0x246fe6,'priority'),{'transaction':_0x3b4082});});});})['catch'](function(_0x21bb76){console[_0xb877('0x3e')](_0x21bb76);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index e953843..cd2d169 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 _0x39e3=['where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','str','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','Lists','get','dialCheckDuplicateType','always','push','sequelize','query','VoiceQueueId','then','all','BlackLists','Campaign','CmList','onlyIfOpen','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','resume','emit','contact:csv_','info','CSV\x20import\x20process\x20stopped!','parse','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','pick','catch','message','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts'];(function(_0x3a3b11,_0x42b1c1){var _0x48138e=function(_0x532523){while(--_0x532523){_0x3a3b11['push'](_0x3a3b11['shift']());}};_0x48138e(++_0x42b1c1);}(_0x39e3,0x168));var _0x339e=function(_0x3332f9,_0x16cb80){_0x3332f9=_0x3332f9-0x0;var _0x181197=_0x39e3[_0x3332f9];return _0x181197;};'use strict';var BPromise=require(_0x339e('0x0'));var util=require(_0x339e('0x1'));var _=require(_0x339e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x339e('0x3'));var db=require(_0x339e('0x4'))['db'];var config=require(_0x339e('0x5'));var logger=require(_0x339e('0x6'))(_0x339e('0x7'));config[_0x339e('0x8')]=_['defaults'](config['redis'],{'host':_0x339e('0x9'),'port':0x18eb});var socket=require(_0x339e('0xa'))(new Redis(config[_0x339e('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0x339e('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x339e('0xc')][0x2]===_0x339e('0xd')||process[_0x339e('0xc')][0x2]===_0x339e('0xe')){throw new Error(_0x339e('0xf'));}var FILEPATH=process[_0x339e('0xc')][0x2];if(!process[_0x339e('0xc')][0x3]||process['argv'][0x3]===_0x339e('0xd')||process[_0x339e('0xc')][0x3]===_0x339e('0xe')||!process['argv'][0x4]||process['argv'][0x4]===_0x339e('0xd')||process[_0x339e('0xc')][0x4]===_0x339e('0xe')){throw new Error(_0x339e('0x10'));}var FIELDS=_[_0x339e('0x11')](process[_0x339e('0xc')][0x3][_0x339e('0x12')](','),process[_0x339e('0xc')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0x339e('0xc')][0x5]===_0x339e('0xd')||process[_0x339e('0xc')][0x5]===_0x339e('0xe')){throw new Error(_0x339e('0x13'));}var LISTID=process[_0x339e('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x339e('0xc')][0x6]!=='undefined'&&process[_0x339e('0xc')][0x6]!=='null'?process[_0x339e('0xc')][0x6]:null;var DUPLICATES=process[_0x339e('0xc')][0x7]&&process[_0x339e('0xc')][0x7]!=='undefined'&&process[_0x339e('0xc')][0x7]!=='null'?process[_0x339e('0xc')][0x7]:null;if(!process[_0x339e('0xc')][0x8]||process[_0x339e('0xc')][0x8]===_0x339e('0xd')||process[_0x339e('0xc')][0x8]===_0x339e('0xe')){throw new Error(_0x339e('0x14'));}var SOCKET_TIMESTAMP=process[_0x339e('0xc')][0x8];}catch(_0x1a29e8){logger['error'](_0x1a29e8);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(_0x2b12c6,_0x47395e,_0x444148,_0x23980f){var _0x30c315={'message':_0x47395e};_0x30c315[_0x2b12c6]=!![];if(_0x444148){_0x30c315[_0x339e('0x15')]=_0x444148;}if(_0x23980f){_0x30c315[_0x339e('0x16')]=_0x23980f;}return _0x30c315;}function isEmail(_0xafca56){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))*$/[_0x339e('0x17')](_0xafca56);}function checkRow(_0x304dbc,_0x510555,_0x271d4b){return new BPromise(function(_0x59f726,_0x1946a8){if(_[_0x339e('0x18')](_0x304dbc)){return _0x1946a8(handleCheckRowError(_0x339e('0x19'),_0x339e('0x1a'),null,_0x271d4b));}if(_0x304dbc[_0x339e('0x1b')]&&_0x304dbc[_0x339e('0x1b')][_0x339e('0x1c')]){var _0x5594a5=_[_0x339e('0x1d')](_0x304dbc[_0x339e('0x1b')],'message')[_0x339e('0x1e')](';');return _0x1946a8(handleCheckRowError(_0x339e('0x19'),_0x5594a5,null,_0x271d4b));}var _0x474db8={};for(var _0x1bed1d in FIELDS){if(FIELDS[_0x339e('0x1f')](_0x1bed1d)&&FIELDS[_0x1bed1d]){_0x474db8[_0x1bed1d]=_0x304dbc[_0x339e('0x20')][0x0][FIELDS[_0x1bed1d]]||_0x304dbc[_0x339e('0x20')][0x0]['\ufeff'+FIELDS[_0x1bed1d]];}}if(!_0x474db8[_0x339e('0x21')]){return _0x1946a8(handleCheckRowError('error',_0x339e('0x22'),null,_0x271d4b));}if(!_0x474db8[_0x339e('0x23')]){return _0x1946a8(handleCheckRowError(_0x339e('0x19'),_0x339e('0x24'),null,_0x271d4b));}if(_0x474db8['birthDate']){var _0x25cfb8=moment(_0x474db8['birthDate'],_0x339e('0x25'));if(!_0x25cfb8[_0x339e('0x26')]()){return _0x1946a8(handleCheckRowError(_0x339e('0x19'),_0x339e('0x27'),null,_0x271d4b));}}if(_0x474db8[_0x339e('0x28')]){if(!isEmail(_0x474db8[_0x339e('0x28')])){return _0x1946a8(handleCheckRowError(_0x339e('0x19'),'email\x20format\x20is\x20not\x20valid!',null,_0x271d4b));}}_0x474db8[_0x339e('0x29')]=LISTID;_0x474db8['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x339e('0x1c')]&&_0x510555){var _0x42a9ea={};for(var _0xaacfbf=0x0,_0x274511=DUPLICATES['length'];_0xaacfbf<_0x274511;_0xaacfbf+=0x1){_0x42a9ea[DUPLICATES[_0xaacfbf]]=_0x474db8[DUPLICATES[_0xaacfbf]];}var _0x3fd720=_[_0x339e('0x2a')](_0x510555,_0x42a9ea);if(_0x3fd720){return _0x1946a8(handleCheckRowError(_0x339e('0x2b'),_0x339e('0x2c'),_0x3fd720,_0x271d4b));}}return db[_0x339e('0x2d')][_0x339e('0x2e')](_0x474db8,{'raw':!![],'hooks':![],'fields':_['keys'](_0x474db8)})['then'](function(_0x485aa3){if(DUPLICATES&&DUPLICATES[_0x339e('0x1c')]&&_0x510555){_0x510555['push'](_[_0x339e('0x2f')](_0x474db8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x485aa3['id'];return _0x59f726();})[_0x339e('0x30')](function(_0x4c23f9){return _0x1946a8(handleCheckRowError(_0x339e('0x19'),'Error\x20while\x20creating\x20contact:\x20'+(_0x4c23f9[_0x339e('0x31')]||JSON[_0x339e('0x32')](_0x4c23f9)),null,_0x271d4b));});});}function checkHopper(){function _0x392384(){return function(_0x494f61){logger[_0x339e('0x19')](_0x339e('0x33'),_0x339e('0x34'),util[_0x339e('0x35')](_0x494f61,{'showHidden':![],'depth':null}));};}var _0x2f1018=function(_0x5d6def,_0x20cabc){var _0x37e33c=squel[_0x339e('0x36')]()[_0x339e('0x37')](_0x339e('0x38'))[_0x339e('0x39')]([_0x339e('0x23'),_0x339e('0x3a'),_0x339e('0x3b'),'ListId',_0x20cabc,_0x339e('0x3c'),_0x339e('0x3d')],squel[_0x339e('0x3e')]()[_0x339e('0x3f')]('phone','phone')['field'](_0x339e('0x40'),_0x339e('0x3a'))[_0x339e('0x3f')]('id',_0x339e('0x3b'))[_0x339e('0x3f')](LISTID[_0x339e('0x41')](),'ListId')[_0x339e('0x3f')](_0x5d6def['id']['toString'](),_0x20cabc)[_0x339e('0x3f')](_0x339e('0x40'),_0x339e('0x3c'))[_0x339e('0x3f')]('NOW()','updatedAt')[_0x339e('0x42')](_0x339e('0x43'))[_0x339e('0x44')](_0x339e('0x45'))[_0x339e('0x44')](_0x339e('0x46'),LISTID[_0x339e('0x41')]())[_0x339e('0x44')](_0x339e('0x47'))[_0x339e('0x44')](_0x339e('0x48'),squel['select']()[_0x339e('0x3f')](_0x339e('0x23'))[_0x339e('0x42')](_0x339e('0x38'))['where'](_0x20cabc+'\x20=\x20?',_0x5d6def['id'][_0x339e('0x41')]())))[_0x339e('0x41')]();return _0x37e33c;};var _0x28c028=function(_0x440197,_0x51eaef){var _0x3261c7=squel[_0x339e('0x36')]()[_0x339e('0x37')](_0x339e('0x38'))['fromQuery']([_0x339e('0x23'),_0x339e('0x3a'),_0x339e('0x3b'),_0x339e('0x29'),_0x51eaef,_0x339e('0x3c'),'updatedAt'],squel[_0x339e('0x3e')]()[_0x339e('0x3f')](_0x339e('0x23'),'phone')[_0x339e('0x3f')](_0x339e('0x40'),_0x339e('0x3a'))[_0x339e('0x3f')]('id',_0x339e('0x3b'))[_0x339e('0x3f')](LISTID['toString'](),_0x339e('0x29'))['field'](_0x440197['id'][_0x339e('0x41')](),_0x51eaef)['field'](_0x339e('0x40'),_0x339e('0x3c'))['field']('NOW()',_0x339e('0x3d'))['from'](_0x339e('0x43'))[_0x339e('0x44')](_0x339e('0x45'))[_0x339e('0x44')]('ListId\x20=\x20?',LISTID['toString']())[_0x339e('0x44')]('id\x20IN\x20?',squel[_0x339e('0x49')](hopperContacts))[_0x339e('0x44')](_0x339e('0x47'))[_0x339e('0x44')](_0x339e('0x48'),squel[_0x339e('0x3e')]()[_0x339e('0x3f')]('calleridnum')['from'](_0x339e('0x4a'))[_0x339e('0x44')](_0x51eaef+'\x20=\x20?',_0x440197['id'][_0x339e('0x41')]()))[_0x339e('0x44')](_0x339e('0x48'),squel[_0x339e('0x3e')]()[_0x339e('0x3f')]('phone')[_0x339e('0x42')](_0x339e('0x38'))[_0x339e('0x44')](_0x51eaef+_0x339e('0x4b'),_0x440197['id'][_0x339e('0x41')]())))['toString']();return _0x3261c7;};function _0x2e74c1(_0x49f888,_0x5c6309){var _0x36ee7b=squel['insert']()[_0x339e('0x37')]('cm_hopper')[_0x339e('0x39')]([_0x339e('0x23'),_0x339e('0x3a'),_0x339e('0x3b'),_0x339e('0x29'),_0x5c6309,_0x339e('0x3c'),_0x339e('0x3d')],squel['select']()[_0x339e('0x3f')](_0x339e('0x23'),_0x339e('0x23'))[_0x339e('0x3f')](_0x339e('0x40'),_0x339e('0x3a'))[_0x339e('0x3f')]('id',_0x339e('0x3b'))['field'](LISTID[_0x339e('0x41')](),'ListId')[_0x339e('0x3f')](_0x49f888['id'][_0x339e('0x41')](),_0x5c6309)[_0x339e('0x3f')](_0x339e('0x40'),'createdAt')[_0x339e('0x3f')]('NOW()',_0x339e('0x3d'))[_0x339e('0x42')](_0x339e('0x43'))['where'](_0x339e('0x45'))[_0x339e('0x44')](_0x339e('0x46'),LISTID[_0x339e('0x41')]())[_0x339e('0x44')](_0x339e('0x4c'),squel[_0x339e('0x49')](hopperContacts))['where'](_0x339e('0x47')))[_0x339e('0x41')]();return _0x36ee7b;}function _0x390575(_0x418c22,_0x4b8369){var _0x565f2f=squel[_0x339e('0x36')]()['into'](_0x339e('0x4d'))[_0x339e('0x39')]([_0x339e('0x23'),'ContactId',_0x339e('0x29'),_0x4b8369,_0x339e('0x3c'),_0x339e('0x3d')],squel[_0x339e('0x3e')]()[_0x339e('0x3f')](_0x339e('0x23'),_0x339e('0x23'))[_0x339e('0x3f')]('id',_0x339e('0x3b'))[_0x339e('0x3f')](LISTID[_0x339e('0x41')](),'ListId')[_0x339e('0x3f')](_0x418c22['id']['toString'](),_0x4b8369)['field'](_0x339e('0x40'),'createdAt')[_0x339e('0x3f')]('NOW()','updatedAt')[_0x339e('0x42')]('cm_contacts')['where'](_0x339e('0x45'))[_0x339e('0x44')](_0x339e('0x46'),LISTID['toString']())[_0x339e('0x44')](_0x339e('0x4c'),squel['str'](hopperContacts))[_0x339e('0x44')](_0x339e('0x47')))[_0x339e('0x41')]();return _0x565f2f;}return db[_0x339e('0x4e')][_0x339e('0x4f')]({'where':{'type':_0x339e('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x339e('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x1dacc9){var _0x6e66ff=[];if(_0x1dacc9){var _0x513dc3;for(var _0xe1df79=0x0,_0x1da90d;_0xe1df79<_0x1dacc9[_0x339e('0x1c')];_0xe1df79+=0x1){_0x1da90d=_0x1dacc9[_0xe1df79][_0x339e('0x52')]({'plain':!![]});switch(_0x1da90d[_0x339e('0x53')]){case _0x339e('0x54'):_0x6e66ff[_0x339e('0x55')](db[_0x339e('0x56')][_0x339e('0x57')](_0x28c028(_0x1da90d,_0x339e('0x58')))[_0x339e('0x59')](function(){})[_0x339e('0x30')](_0x392384()));break;case'onlyIfOpen':_0x6e66ff[_0x339e('0x55')](db['sequelize'][_0x339e('0x57')](_0x2f1018(_0x1da90d,_0x339e('0x58')))[_0x339e('0x59')](function(){})['catch'](_0x392384()));break;default:_0x6e66ff[_0x339e('0x55')](db[_0x339e('0x56')][_0x339e('0x57')](_0x2e74c1(_0x1da90d,'VoiceQueueId'))[_0x339e('0x59')](function(){})['catch'](_0x392384()));}}}return _0x6e66ff;})[_0x339e('0x5a')]()[_0x339e('0x59')](function(){return db[_0x339e('0x4e')][_0x339e('0x4f')]({'where':{'type':_0x339e('0x50')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x339e('0x5b'),'where':{'id':LISTID}}]})[_0x339e('0x59')](function(_0x52bd41){var _0x44d7d8=[];if(_0x52bd41){var _0x503e9d;for(var _0x4744e0=0x0,_0x33a1ee;_0x4744e0<_0x52bd41[_0x339e('0x1c')];_0x4744e0+=0x1){_0x33a1ee=_0x52bd41[_0x4744e0][_0x339e('0x52')]({'plain':!![]});_0x44d7d8['push'](db['sequelize'][_0x339e('0x57')](_0x390575(_0x33a1ee,_0x339e('0x58')))[_0x339e('0x59')](function(){})[_0x339e('0x30')](_0x392384()));}}return _0x44d7d8;})[_0x339e('0x5a')]();})['then'](function(){return db[_0x339e('0x5c')]['findAll']({'attributes':['id',_0x339e('0x53')],'include':[{'model':db[_0x339e('0x5d')],'as':_0x339e('0x51'),'where':{'id':LISTID}}]})[_0x339e('0x59')](function(_0x53407c){var _0x39bcd8=[];if(_0x53407c){for(var _0x2d1e20=0x0,_0xbfe185;_0x2d1e20<_0x53407c[_0x339e('0x1c')];_0x2d1e20+=0x1){_0xbfe185=_0x53407c[_0x2d1e20][_0x339e('0x52')]({'plain':!![]});switch(_0xbfe185[_0x339e('0x53')]){case _0x339e('0x54'):_0x39bcd8['push'](db[_0x339e('0x56')][_0x339e('0x57')](_0x28c028(_0xbfe185,'CampaignId'))[_0x339e('0x59')](function(){})[_0x339e('0x30')](_0x392384()));break;case _0x339e('0x5e'):_0x39bcd8[_0x339e('0x55')](db[_0x339e('0x56')][_0x339e('0x57')](_0x2f1018(_0xbfe185,_0x339e('0x5f')))[_0x339e('0x59')](function(){})['catch'](_0x392384()));break;default:_0x39bcd8[_0x339e('0x55')](db[_0x339e('0x56')][_0x339e('0x57')](_0x2e74c1(_0xbfe185,'CampaignId'))[_0x339e('0x59')](function(){})[_0x339e('0x30')](_0x392384()));}}}return _0x39bcd8;})[_0x339e('0x5a')]();})[_0x339e('0x59')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0x339e('0x5d')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x339e('0x59')](function(_0x41561e){var _0xd8492f=[];if(_0x41561e){for(var _0x3c6592=0x0,_0x29894c;_0x3c6592<_0x41561e[_0x339e('0x1c')];_0x3c6592+=0x1){_0x29894c=_0x41561e[_0x3c6592][_0x339e('0x52')]({'plain':!![]});_0xd8492f[_0x339e('0x55')](db[_0x339e('0x56')]['query'](_0x390575(_0x29894c,_0x339e('0x5f')))[_0x339e('0x59')](function(){})[_0x339e('0x30')](_0x392384()));}}return _0xd8492f;})[_0x339e('0x5a')]();})['catch'](function(_0x119723){logger[_0x339e('0x19')](_0x339e('0x60'),'generalCheckHopper',_0x119723['message']);});}var processPromises=function(_0x497d5d){return BPromise[_0x339e('0x5a')](promises)[_0x339e('0x59')](function(_0xfa211a){})[_0x339e('0x30')](function(_0x4c218d){logger[_0x339e('0x19')](_0x339e('0x61'),JSON['stringify'](_0x4c218d));})[_0x339e('0x62')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x497d5d){return _0x497d5d[_0x339e('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x339e('0x59')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x339e('0x64')](_0x339e('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x37a819){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x339e('0x32')](_0x37a819));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x339e('0x66')](_0x339e('0x67'));endCsv();});function main(){return BPromise['resolve']()[_0x339e('0x59')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x339e('0x12')](',');return db['CmContact'][_0x339e('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x339e('0x59')](function(_0x1d9708){var _0x3684a1=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x339e('0x68')](_0x3684a1,{'header':!![],'skipEmptyLines':!![],'step':function(_0x232cc4,_0x6208f0){total+=0x1;var _0x20b76c=total;promises['push'](checkRow(_0x232cc4,_0x1d9708,_0x20b76c)[_0x339e('0x59')](function(){success+=0x1;})[_0x339e('0x30')](function(_0x251731){if(_0x251731[_0x339e('0x19')]){errors+=0x1;delete _0x251731['error'];}else if(_0x251731[_0x339e('0x2b')]){duplicates+=0x1;delete _0x251731[_0x339e('0x2b')];}rows['push'](_0x251731);}));if(total%0xc8===0x0){_0x6208f0['pause']();return processPromises(_0x6208f0);}},'complete':function(){return processPromises()[_0x339e('0x59')](function(){logger[_0x339e('0x66')](_0x339e('0x69'));endCsv();});},'error':function(_0x5bf250,_0x34bdeb){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x5bf250));endCsv();}});})[_0x339e('0x30')](function(_0x1e5961){logger[_0x339e('0x19')](_0x339e('0x6a'),JSON[_0x339e('0x32')](_0x1e5961));});}main(); \ No newline at end of file +var _0x767c=['error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName','phone','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','pick','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','deletedAt\x20IS\x20NULL','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','VoiceQueue','findAll','dialCheckDuplicateType','CmList','get','always','push','query','VoiceQueueId','catch','onlyIfOpen','sequelize','all','outbound','BlackLists','Campaign','Lists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','pause','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!'];(function(_0x5e5568,_0x300d0d){var _0x557045=function(_0x2ee76c){while(--_0x2ee76c){_0x5e5568['push'](_0x5e5568['shift']());}};_0x557045(++_0x300d0d);}(_0x767c,0xc7));var _0xc767=function(_0x271f47,_0x26fecc){_0x271f47=_0x271f47-0x0;var _0x28b006=_0x767c[_0x271f47];return _0x28b006;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0xc767('0x0'));var Papa=require(_0xc767('0x1'));var Redis=require(_0xc767('0x2'));var db=require(_0xc767('0x3'))['db'];var config=require(_0xc767('0x4'));var logger=require('../../../config/logger')(_0xc767('0x5'));config[_0xc767('0x6')]=_['defaults'](config[_0xc767('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xc767('0x7'))(new Redis(config[_0xc767('0x6')]));require(_0xc767('0x8'))['register'](socket);try{if(!process[_0xc767('0x9')][0x2]||process['argv'][0x2]===_0xc767('0xa')||process[_0xc767('0x9')][0x2]===_0xc767('0xb')){throw new Error(_0xc767('0xc'));}var FILEPATH=process['argv'][0x2];if(!process[_0xc767('0x9')][0x3]||process[_0xc767('0x9')][0x3]===_0xc767('0xa')||process[_0xc767('0x9')][0x3]==='null'||!process[_0xc767('0x9')][0x4]||process['argv'][0x4]===_0xc767('0xa')||process[_0xc767('0x9')][0x4]===_0xc767('0xb')){throw new Error(_0xc767('0xd'));}var FIELDS=_[_0xc767('0xe')](process[_0xc767('0x9')][0x3][_0xc767('0xf')](','),process[_0xc767('0x9')][0x4]['split'](','));if(!process[_0xc767('0x9')][0x5]||process[_0xc767('0x9')][0x5]===_0xc767('0xa')||process[_0xc767('0x9')][0x5]===_0xc767('0xb')){throw new Error(_0xc767('0x10'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xc767('0x9')][0x6]&&process[_0xc767('0x9')][0x6]!=='undefined'&&process[_0xc767('0x9')][0x6]!=='null'?process[_0xc767('0x9')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0xc767('0xa')&&process[_0xc767('0x9')][0x7]!==_0xc767('0xb')?process[_0xc767('0x9')][0x7]:null;if(!process[_0xc767('0x9')][0x8]||process['argv'][0x8]==='undefined'||process[_0xc767('0x9')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x160c89){logger[_0xc767('0x11')](_0x160c89);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(_0x5de6c1,_0x129e19,_0x35c52c,_0x21c705){var _0xc383b3={'message':_0x129e19};_0xc383b3[_0x5de6c1]=!![];if(_0x35c52c){_0xc383b3[_0xc767('0x12')]=_0x35c52c;}if(_0x21c705){_0xc383b3[_0xc767('0x13')]=_0x21c705;}return _0xc383b3;}function isEmail(_0x400e29){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))*$/[_0xc767('0x14')](_0x400e29);}function checkRow(_0x36d4c6,_0x4875da,_0x18d02b){return new BPromise(function(_0x1afd19,_0x51d221){if(_[_0xc767('0x15')](_0x36d4c6)){return _0x51d221(handleCheckRowError(_0xc767('0x11'),_0xc767('0x16'),null,_0x18d02b));}if(_0x36d4c6['errors']&&_0x36d4c6[_0xc767('0x17')][_0xc767('0x18')]){var _0x88be95=_[_0xc767('0x19')](_0x36d4c6[_0xc767('0x17')],_0xc767('0x1a'))['join'](';');return _0x51d221(handleCheckRowError(_0xc767('0x11'),_0x88be95,null,_0x18d02b));}var _0x119077={};for(var _0x2352fc in FIELDS){if(FIELDS[_0xc767('0x1b')](_0x2352fc)&&FIELDS[_0x2352fc]){_0x119077[_0x2352fc]=_0x36d4c6[_0xc767('0x1c')][0x0][FIELDS[_0x2352fc]]||_0x36d4c6[_0xc767('0x1c')][0x0]['\ufeff'+FIELDS[_0x2352fc]];}}if(!_0x119077[_0xc767('0x1d')]){return _0x51d221(handleCheckRowError(_0xc767('0x11'),'firstName\x20not\x20specified!',null,_0x18d02b));}if(!_0x119077[_0xc767('0x1e')]){return _0x51d221(handleCheckRowError(_0xc767('0x11'),'phone\x20not\x20specified!',null,_0x18d02b));}if(_0x119077[_0xc767('0x1f')]){var _0x47eab2=moment(_0x119077[_0xc767('0x1f')],_0xc767('0x20'));if(!_0x47eab2['isValid']()){return _0x51d221(handleCheckRowError(_0xc767('0x11'),_0xc767('0x21'),null,_0x18d02b));}}if(_0x119077[_0xc767('0x22')]){if(!isEmail(_0x119077[_0xc767('0x22')])){return _0x51d221(handleCheckRowError(_0xc767('0x11'),_0xc767('0x23'),null,_0x18d02b));}}_0x119077[_0xc767('0x24')]=LISTID;_0x119077[_0xc767('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc767('0x18')]&&_0x4875da){var _0x2eef59={};for(var _0x5ee7bc=0x0,_0x567320=DUPLICATES[_0xc767('0x18')];_0x5ee7bc<_0x567320;_0x5ee7bc+=0x1){_0x2eef59[DUPLICATES[_0x5ee7bc]]=_0x119077[DUPLICATES[_0x5ee7bc]];}var _0x2d2946=_[_0xc767('0x26')](_0x4875da,_0x2eef59);if(_0x2d2946){return _0x51d221(handleCheckRowError(_0xc767('0x27'),_0xc767('0x28'),_0x2d2946,_0x18d02b));}}return db[_0xc767('0x29')]['create'](_0x119077,{'raw':!![],'hooks':![],'fields':_[_0xc767('0x2a')](_0x119077)})[_0xc767('0x2b')](function(_0x2a54eb){if(DUPLICATES&&DUPLICATES[_0xc767('0x18')]&&_0x4875da){_0x4875da['push'](_[_0xc767('0x2c')](_0x119077,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2a54eb['id'];return _0x1afd19();})['catch'](function(_0x5b2209){return _0x51d221(handleCheckRowError(_0xc767('0x11'),'Error\x20while\x20creating\x20contact:\x20'+(_0x5b2209[_0xc767('0x1a')]||JSON['stringify'](_0x5b2209)),null,_0x18d02b));});});}function checkHopper(){function _0x101737(){return function(_0x44c09d){logger[_0xc767('0x11')](_0xc767('0x2d'),_0xc767('0x2e'),util[_0xc767('0x2f')](_0x44c09d,{'showHidden':![],'depth':null}));};}var _0x419330=function(_0x16fa0d,_0x322f77){var _0x22b02f=squel['insert']()[_0xc767('0x30')](_0xc767('0x31'))[_0xc767('0x32')](['phone',_0xc767('0x33'),_0xc767('0x34'),'ListId',_0x322f77,_0xc767('0x35'),_0xc767('0x36')],squel[_0xc767('0x37')]()[_0xc767('0x38')](_0xc767('0x1e'),_0xc767('0x1e'))[_0xc767('0x38')](_0xc767('0x39'),_0xc767('0x33'))[_0xc767('0x38')]('id',_0xc767('0x34'))[_0xc767('0x38')](LISTID[_0xc767('0x3a')](),_0xc767('0x24'))[_0xc767('0x38')](_0x16fa0d['id']['toString'](),_0x322f77)['field']('NOW()',_0xc767('0x35'))[_0xc767('0x38')](_0xc767('0x39'),_0xc767('0x36'))[_0xc767('0x3b')]('cm_contacts')['where'](_0xc767('0x3c'))[_0xc767('0x3d')]('ListId\x20=\x20?',LISTID['toString']())[_0xc767('0x3d')](_0xc767('0x3e'))[_0xc767('0x3d')](_0xc767('0x3f'),squel['select']()['field'](_0xc767('0x1e'))[_0xc767('0x3b')]('cm_hopper')[_0xc767('0x3d')](_0x322f77+_0xc767('0x40'),_0x16fa0d['id'][_0xc767('0x3a')]())))[_0xc767('0x3a')]();return _0x22b02f;};var _0x1292de=function(_0x12170b,_0x20f139){var _0x3a057d=squel[_0xc767('0x41')]()[_0xc767('0x30')](_0xc767('0x31'))[_0xc767('0x32')]([_0xc767('0x1e'),_0xc767('0x33'),'ContactId','ListId',_0x20f139,_0xc767('0x35'),'updatedAt'],squel['select']()[_0xc767('0x38')]('phone',_0xc767('0x1e'))['field'](_0xc767('0x39'),_0xc767('0x33'))[_0xc767('0x38')]('id','ContactId')[_0xc767('0x38')](LISTID[_0xc767('0x3a')](),_0xc767('0x24'))['field'](_0x12170b['id'][_0xc767('0x3a')](),_0x20f139)[_0xc767('0x38')]('NOW()',_0xc767('0x35'))['field'](_0xc767('0x39'),_0xc767('0x36'))[_0xc767('0x3b')](_0xc767('0x42'))[_0xc767('0x3d')](_0xc767('0x3c'))[_0xc767('0x3d')](_0xc767('0x43'),LISTID[_0xc767('0x3a')]())[_0xc767('0x3d')](_0xc767('0x44'),squel[_0xc767('0x45')](hopperContacts))[_0xc767('0x3d')](_0xc767('0x3e'))[_0xc767('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc767('0x37')]()[_0xc767('0x38')]('calleridnum')[_0xc767('0x3b')](_0xc767('0x46'))['where'](_0x20f139+_0xc767('0x40'),_0x12170b['id']['toString']()))[_0xc767('0x3d')](_0xc767('0x3f'),squel['select']()[_0xc767('0x38')](_0xc767('0x1e'))[_0xc767('0x3b')](_0xc767('0x31'))[_0xc767('0x3d')](_0x20f139+_0xc767('0x40'),_0x12170b['id']['toString']())))[_0xc767('0x3a')]();return _0x3a057d;};function _0x2a234a(_0x1a89e2,_0x28b2ec){var _0x2995aa=squel[_0xc767('0x41')]()[_0xc767('0x30')](_0xc767('0x31'))[_0xc767('0x32')]([_0xc767('0x1e'),_0xc767('0x33'),_0xc767('0x34'),_0xc767('0x24'),_0x28b2ec,_0xc767('0x35'),'updatedAt'],squel['select']()['field'](_0xc767('0x1e'),_0xc767('0x1e'))[_0xc767('0x38')]('NOW()','scheduledAt')['field']('id','ContactId')[_0xc767('0x38')](LISTID[_0xc767('0x3a')](),_0xc767('0x24'))['field'](_0x1a89e2['id'][_0xc767('0x3a')](),_0x28b2ec)[_0xc767('0x38')](_0xc767('0x39'),'createdAt')['field'](_0xc767('0x39'),'updatedAt')[_0xc767('0x3b')]('cm_contacts')['where'](_0xc767('0x3c'))[_0xc767('0x3d')]('ListId\x20=\x20?',LISTID[_0xc767('0x3a')]())[_0xc767('0x3d')](_0xc767('0x44'),squel['str'](hopperContacts))[_0xc767('0x3d')](_0xc767('0x3e')))[_0xc767('0x3a')]();return _0x2995aa;}function _0x280405(_0x27574a,_0x16fa6d){var _0x4ede52=squel['insert']()[_0xc767('0x30')]('cm_hopper_black')[_0xc767('0x32')]([_0xc767('0x1e'),_0xc767('0x34'),_0xc767('0x24'),_0x16fa6d,_0xc767('0x35'),_0xc767('0x36')],squel[_0xc767('0x37')]()[_0xc767('0x38')](_0xc767('0x1e'),_0xc767('0x1e'))[_0xc767('0x38')]('id',_0xc767('0x34'))[_0xc767('0x38')](LISTID[_0xc767('0x3a')](),'ListId')[_0xc767('0x38')](_0x27574a['id'][_0xc767('0x3a')](),_0x16fa6d)[_0xc767('0x38')]('NOW()',_0xc767('0x35'))['field'](_0xc767('0x39'),_0xc767('0x36'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xc767('0x3d')](_0xc767('0x43'),LISTID[_0xc767('0x3a')]())[_0xc767('0x3d')](_0xc767('0x44'),squel[_0xc767('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xc767('0x3a')]();return _0x4ede52;}return db[_0xc767('0x47')][_0xc767('0x48')]({'where':{'type':'outbound'},'attributes':['id',_0xc767('0x49')],'include':[{'model':db[_0xc767('0x4a')],'as':'Lists','where':{'id':LISTID}}]})[_0xc767('0x2b')](function(_0x5b92a8){var _0x4bb218=[];if(_0x5b92a8){var _0x57404f;for(var _0x3c2ea1=0x0,_0x44b275;_0x3c2ea1<_0x5b92a8['length'];_0x3c2ea1+=0x1){_0x44b275=_0x5b92a8[_0x3c2ea1][_0xc767('0x4b')]({'plain':!![]});switch(_0x44b275[_0xc767('0x49')]){case _0xc767('0x4c'):_0x4bb218[_0xc767('0x4d')](db['sequelize'][_0xc767('0x4e')](_0x1292de(_0x44b275,_0xc767('0x4f')))[_0xc767('0x2b')](function(){})[_0xc767('0x50')](_0x101737()));break;case _0xc767('0x51'):_0x4bb218[_0xc767('0x4d')](db[_0xc767('0x52')][_0xc767('0x4e')](_0x419330(_0x44b275,_0xc767('0x4f')))[_0xc767('0x2b')](function(){})[_0xc767('0x50')](_0x101737()));break;default:_0x4bb218[_0xc767('0x4d')](db[_0xc767('0x52')][_0xc767('0x4e')](_0x2a234a(_0x44b275,_0xc767('0x4f')))[_0xc767('0x2b')](function(){})[_0xc767('0x50')](_0x101737()));}}}return _0x4bb218;})[_0xc767('0x53')]()['then'](function(){return db[_0xc767('0x47')][_0xc767('0x48')]({'where':{'type':_0xc767('0x54')},'attributes':['id'],'include':[{'model':db[_0xc767('0x4a')],'as':_0xc767('0x55'),'where':{'id':LISTID}}]})[_0xc767('0x2b')](function(_0x108bc1){var _0x5268c4=[];if(_0x108bc1){var _0x22f430;for(var _0x428a5a=0x0,_0x3c75a8;_0x428a5a<_0x108bc1[_0xc767('0x18')];_0x428a5a+=0x1){_0x3c75a8=_0x108bc1[_0x428a5a][_0xc767('0x4b')]({'plain':!![]});_0x5268c4['push'](db[_0xc767('0x52')][_0xc767('0x4e')](_0x280405(_0x3c75a8,'VoiceQueueId'))['then'](function(){})[_0xc767('0x50')](_0x101737()));}}return _0x5268c4;})[_0xc767('0x53')]();})['then'](function(){return db[_0xc767('0x56')][_0xc767('0x48')]({'attributes':['id',_0xc767('0x49')],'include':[{'model':db[_0xc767('0x4a')],'as':_0xc767('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x4ce8f6){var _0x2aa33f=[];if(_0x4ce8f6){for(var _0xd6a72d=0x0,_0x59aa43;_0xd6a72d<_0x4ce8f6[_0xc767('0x18')];_0xd6a72d+=0x1){_0x59aa43=_0x4ce8f6[_0xd6a72d][_0xc767('0x4b')]({'plain':!![]});switch(_0x59aa43[_0xc767('0x49')]){case _0xc767('0x4c'):_0x2aa33f['push'](db['sequelize'][_0xc767('0x4e')](_0x1292de(_0x59aa43,_0xc767('0x58')))[_0xc767('0x2b')](function(){})[_0xc767('0x50')](_0x101737()));break;case'onlyIfOpen':_0x2aa33f['push'](db[_0xc767('0x52')][_0xc767('0x4e')](_0x419330(_0x59aa43,'CampaignId'))[_0xc767('0x2b')](function(){})[_0xc767('0x50')](_0x101737()));break;default:_0x2aa33f['push'](db[_0xc767('0x52')][_0xc767('0x4e')](_0x2a234a(_0x59aa43,_0xc767('0x58')))[_0xc767('0x2b')](function(){})[_0xc767('0x50')](_0x101737()));}}}return _0x2aa33f;})[_0xc767('0x53')]();})[_0xc767('0x2b')](function(){return db[_0xc767('0x56')][_0xc767('0x48')]({'attributes':['id'],'include':[{'model':db[_0xc767('0x4a')],'as':_0xc767('0x55'),'where':{'id':LISTID}}]})[_0xc767('0x2b')](function(_0x3e442a){var _0x2eb0e7=[];if(_0x3e442a){for(var _0x13a533=0x0,_0x9424ef;_0x13a533<_0x3e442a[_0xc767('0x18')];_0x13a533+=0x1){_0x9424ef=_0x3e442a[_0x13a533][_0xc767('0x4b')]({'plain':!![]});_0x2eb0e7[_0xc767('0x4d')](db[_0xc767('0x52')][_0xc767('0x4e')](_0x280405(_0x9424ef,_0xc767('0x58')))[_0xc767('0x2b')](function(){})[_0xc767('0x50')](_0x101737()));}}return _0x2eb0e7;})['all']();})[_0xc767('0x50')](function(_0x251cc8){logger[_0xc767('0x11')](_0xc767('0x59'),_0xc767('0x5a'),_0x251cc8[_0xc767('0x1a')]);});}var processPromises=function(_0x46cab3){return BPromise[_0xc767('0x53')](promises)[_0xc767('0x2b')](function(_0x1d64fb){})[_0xc767('0x50')](function(_0x47e409){logger[_0xc767('0x11')](_0xc767('0x5b'),JSON[_0xc767('0x5c')](_0x47e409));})[_0xc767('0x5d')](function(){socket[_0xc767('0x5e')](_0xc767('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x46cab3){return _0x46cab3[_0xc767('0x60')]();}});};var endCsv=function(){return BPromise[_0xc767('0x61')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xc767('0x2b')](function(){socket[_0xc767('0x5e')](_0xc767('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc767('0x62')](FILEPATH);}catch(_0x4929f2){logger[_0xc767('0x11')](_0xc767('0x63'),JSON[_0xc767('0x5c')](_0x4929f2));}finally{process[_0xc767('0x64')](0x0);}});};process['on'](_0xc767('0x65'),function(){logger['info'](_0xc767('0x66'));endCsv();});function main(){return BPromise[_0xc767('0x61')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xc767('0xf')](',');return db[_0xc767('0x29')][_0xc767('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x2a413a){var _0x29a48b=fs[_0xc767('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x29a48b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x27d239,_0x4315fa){total+=0x1;var _0x1c1e5d=total;promises[_0xc767('0x4d')](checkRow(_0x27d239,_0x2a413a,_0x1c1e5d)['then'](function(){success+=0x1;})[_0xc767('0x50')](function(_0x2687ec){if(_0x2687ec['error']){errors+=0x1;delete _0x2687ec[_0xc767('0x11')];}else if(_0x2687ec[_0xc767('0x27')]){duplicates+=0x1;delete _0x2687ec[_0xc767('0x27')];}rows[_0xc767('0x4d')](_0x2687ec);}));if(total%0xc8===0x0){_0x4315fa[_0xc767('0x68')]();return processPromises(_0x4315fa);}},'complete':function(){return processPromises()[_0xc767('0x2b')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x343c9a,_0x4caab4){logger[_0xc767('0x69')](_0xc767('0x6a'),JSON['stringify'](_0x343c9a));endCsv();}});})[_0xc767('0x50')](function(_0x3c4ad6){logger[_0xc767('0x11')](_0xc767('0x6b'),JSON['stringify'](_0x3c4ad6));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 85f96c3..995f6e5 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 _0xf924=['catch','error','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','stringify','send','start','clone','socket_timestamp','root','server/files/tmp','includes','keys','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','rows','find','isNil','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','itemTypeId','description','SystemRow','emit','contact:import:','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','moment','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','length','then','split','push','all','filter','CmContactHasItem','findOne','update','updated','create','PHONE','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','phone','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','fields','from','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper','cm_contacts.phone','cm_hopper_black','createdAt','cm_contacts.ListId\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','into','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','sequelize','query','spread'];(function(_0x42cd52,_0x55eb17){var _0x3e6b02=function(_0x257f82){while(--_0x257f82){_0x42cd52['push'](_0x42cd52['shift']());}};_0x3e6b02(++_0x55eb17);}(_0xf924,0x10d));var _0x4f92=function(_0xcc2c66,_0x27cf7b){_0xcc2c66=_0xcc2c66-0x0;var _0x2197b2=_0xf924[_0xcc2c66];return _0x2197b2;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x4f92('0x0'));var Papa=require(_0x4f92('0x1'));var util=require(_0x4f92('0x2'));var BPromise=require(_0x4f92('0x3'));var moment=require(_0x4f92('0x4'));var squel=require('squel');var Redis=require(_0x4f92('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x4f92('0x6'));var shared=require(_0x4f92('0x7'));var logger=require(_0x4f92('0x8'))(_0x4f92('0x9'));config[_0x4f92('0xa')]=_[_0x4f92('0xb')](config[_0x4f92('0xa')],{'host':_0x4f92('0xc'),'port':0x18eb});var socket=require(_0x4f92('0xd'))(new Redis(config[_0x4f92('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x4f92('0xe')]('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()['format'](_0x4f92('0xf'));function isEmail(_0x207e5a){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))*$/[_0x4f92('0x10')](_0x207e5a);}function selectNotIn(_0x5d20cd,_0x2a74d5,_0x2f1009,_0x4d553b,_0x508f14){return squel[_0x4f92('0x11')]()[_0x4f92('0x12')]('phone')['from'](_0x4d553b)[_0x4f92('0x13')](_0x2a74d5,null,_0x2a74d5+'.id\x20=\x20'+_0x4d553b+'.'+_0x2f1009)[_0x4f92('0x14')](_0x4d553b+'.'+_0x2f1009+_0x4f92('0x15')+_0x5d20cd+'.'+_0x2f1009)[_0x4f92('0x14')](_0x2a74d5+_0x4f92('0x16')+_0x508f14[_0x4f92('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3cb068,_0x171e5e){promisesAdditionalPhones=[];return db['CmContact'][_0x4f92('0x17')]({'raw':!![],'attributes':['id',_0x4f92('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x429ead){if(_0x429ead!==null){var _0xe28af7=[];for(var _0x415f4c=0x0;_0x415f4c<_0x429ead[_0x4f92('0x19')];_0x415f4c++){var _0x49fbe2=_0x429ead[_0x415f4c];_0xe28af7['push'](insertAdditionalPhones(_0x49fbe2));}}Promise['all'](_0xe28af7)[_0x4f92('0x1a')](function(){_0x3cb068({'val':0x1});});});});}function insertAdditionalPhones(_0x2349ff){return new Promise(function(_0x5a19e4,_0x30803c){var _0x17cb8c=_0x2349ff[_0x4f92('0x18')];var _0x308624=_0x17cb8c[_0x4f92('0x1b')](';');var _0x2c7a18=[];orderBy=0x0;for(var _0x44988a=0x0;_0x44988a<_0x308624[_0x4f92('0x19')];_0x44988a++){_0x2c7a18[_0x4f92('0x1c')](splitAdditionalPhone(_0x2349ff['id'],_0x308624[_0x44988a]));}Promise[_0x4f92('0x1d')](_0x2c7a18)[_0x4f92('0x1a')](function(){_0x5a19e4({'val':_0x308624[_0x4f92('0x19')]});});});}function splitAdditionalPhone(_0x5d99e9,_0x58f547){return new Promise(function(_0x3708b5,_0x23369f){var _0x29a4d=_0x58f547[_0x4f92('0x1b')](':');var _0x524a3b=_0x29a4d[0x0];var _0x29afaa=_0x29a4d[0x1];if(!_['isNil'](_0x29afaa)){var _0x197b2e=_0x29afaa[_0x4f92('0x1b')]('|');var _0x349fe3=[];for(var _0x23c542=0x0;_0x23c542<_0x197b2e[_0x4f92('0x19')];_0x23c542++){if(_0x197b2e[_0x23c542]!==''){var _0x4cb804=_[_0x4f92('0x1e')](promisesAdditionalPhones,{'contactId':_0x5d99e9,'phone':_0x197b2e[_0x23c542]});if(_0x4cb804['length']==0x0){orderBy++;promisesAdditionalPhones[_0x4f92('0x1c')]({'contactId':_0x5d99e9,'contactTypeId':_0x524a3b,'phone':_0x197b2e[_0x23c542],'orderBy':orderBy});}}}_0x3708b5({'ok':0x1});}else _0x3708b5({'res':0x0});});}function createAdditionalPhone(_0x42caa7,_0x6c67b,_0x5834e4,_0x6c859){var _0x14803a='';var _0x686283='';var _0x32ee8c=_0x5834e4[_0x4f92('0x1b')]('§');_0x14803a=_0x32ee8c[0x0];if(_0x32ee8c['length']==0x2)_0x686283=_0x32ee8c[0x1];return new Promise(function(_0x479504,_0x12ad3a){return db[_0x4f92('0x1f')][_0x4f92('0x20')]({'where':{'CmContactId':_0x42caa7,'item':_0x14803a}})[_0x4f92('0x1a')](function(_0x2b3e13){if(_0x2b3e13){return db[_0x4f92('0x1f')][_0x4f92('0x21')]({'ItemTypeId':_0x6c67b,'description':_0x686283,'OrderBy':_0x6c859},{'where':{'CmContactId':_0x42caa7,'item':_0x14803a}})['then'](function(_0x571fbc){_0x479504({'res':_0x4f92('0x22')});});}else{return db[_0x4f92('0x1f')][_0x4f92('0x23')]({'CmContactId':_0x42caa7,'item':_0x14803a,'description':_0x686283,'ItemTypeId':_0x6c67b,'OrderBy':_0x6c859,'ItemClass':_0x4f92('0x24')})['then'](function(_0x3edb2e){_0x479504({'res':'inserted'});});}});});}function insertCmHopper(_0x16b5e6,_0x36de80,_0x287710,_0x582a6b,_0x4f5dd9){var _0x2b3aa1=['cm_contacts.phone',_0x4f92('0x25'),_0x4f92('0x26'),_0x4f92('0x27'),_0x36de80+'.'+_0x582a6b,_0x4f92('0x28'),_0x4f92('0x29'),_0x4f92('0x2a'),_0x4f92('0x2b'),'\x22'+_0x4f5dd9+'\x22'];return squel[_0x4f92('0x2c')]()['into']('cm_hopper')[_0x4f92('0x2d')]([_0x4f92('0x2e'),_0x4f92('0x2f'),_0x4f92('0x30'),_0x4f92('0x31'),_0x582a6b,'createdAt',_0x4f92('0x32'),_0x4f92('0x33'),_0x4f92('0x34'),_0x4f92('0x35')],squel[_0x4f92('0x11')]()[_0x4f92('0x36')](_0x2b3aa1)[_0x4f92('0x37')](_0x36de80)[_0x4f92('0x13')](_0x4f92('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x36de80+_0x4f92('0x39'))[_0x4f92('0x13')](_0x287710,null,_0x287710+_0x4f92('0x3a')+_0x36de80+'.'+_0x582a6b)[_0x4f92('0x14')](_0x36de80+_0x4f92('0x3b'),_0x16b5e6)[_0x4f92('0x14')](_0x4f92('0x3c'),NOW)[_0x4f92('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x36de80,_0x287710,_0x582a6b,'cm_hopper',[_0x4f92('0x3d'),_0x4f92('0x3e')]))[_0x4f92('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x36de80,_0x287710,_0x582a6b,_0x4f92('0x3f'),[_0x4f92('0x3d')])))['toString']();}function insertCmHopperBlack(_0x35c524,_0x13ae5e,_0x4abd27,_0x1c63bf){var _0x1dc4c0=[_0x4f92('0x40'),_0x4f92('0x26'),_0x4f92('0x27'),_0x13ae5e+'.'+_0x1c63bf,_0x4f92('0x28'),'cm_contacts.updatedAt'];return squel[_0x4f92('0x2c')]()['into'](_0x4f92('0x41'))[_0x4f92('0x2d')]([_0x4f92('0x2e'),_0x4f92('0x30'),_0x4f92('0x31'),_0x1c63bf,_0x4f92('0x42'),_0x4f92('0x32')],squel[_0x4f92('0x11')]()[_0x4f92('0x36')](_0x1dc4c0)[_0x4f92('0x37')](_0x13ae5e)[_0x4f92('0x13')](_0x4f92('0x38'),null,_0x4f92('0x43')+_0x13ae5e+_0x4f92('0x39'))['join'](_0x4abd27,null,_0x4abd27+'.id\x20=\x20'+_0x13ae5e+'.'+_0x1c63bf)[_0x4f92('0x14')](_0x13ae5e+_0x4f92('0x3b'),_0x35c524)[_0x4f92('0x14')](_0x4f92('0x3c'),NOW)['where'](_0x4f92('0x44'),squel['select']()[_0x4f92('0x12')](_0x4f92('0x2e'))[_0x4f92('0x37')]('cm_hopper_black')[_0x4f92('0x14')]('ListId\x20=\x20?',_0x35c524)['where'](_0x1c63bf+'\x20=\x20'+_0x13ae5e+'.'+_0x1c63bf)))[_0x4f92('0x45')]();}function insertTzCmHopper(_0x2826bf,_0x2bd20b,_0x1e1e3a,_0x2c6fb0,_0x3bf4f2,_0x2888f1){var _0x2824c4=[_0x4f92('0x40'),_0x4f92('0x46')+_0x2888f1+_0x4f92('0x47'),_0x4f92('0x26'),_0x4f92('0x27'),_0x2bd20b+'.'+_0x2c6fb0,_0x4f92('0x28'),_0x4f92('0x29'),_0x4f92('0x2a'),_0x4f92('0x2b'),'\x22'+_0x3bf4f2+'\x22'];var _0x25ca6d=squel[_0x4f92('0x2c')]()[_0x4f92('0x48')](_0x4f92('0x3f'))['fromQuery'](['phone',_0x4f92('0x2f'),_0x4f92('0x30'),_0x4f92('0x31'),_0x2c6fb0,'createdAt',_0x4f92('0x32'),_0x4f92('0x33'),_0x4f92('0x34'),_0x4f92('0x35')],squel['select']()['fields'](_0x2824c4)[_0x4f92('0x37')](_0x2bd20b)[_0x4f92('0x13')](_0x4f92('0x38'),null,_0x4f92('0x43')+_0x2bd20b+_0x4f92('0x39'))[_0x4f92('0x13')](_0x1e1e3a,null,_0x1e1e3a+'.id\x20=\x20'+_0x2bd20b+'.'+_0x2c6fb0)[_0x4f92('0x13')](_0x2888f1,null,_0x2888f1+'.id\x20=\x20'+_0x2bd20b+'.'+_0x2c6fb0)['where'](_0x2bd20b+_0x4f92('0x3b'),_0x2826bf)[_0x4f92('0x14')](_0x4f92('0x3c'),NOW)[_0x4f92('0x14')](_0x4f92('0x44'),selectNotIn(_0x2bd20b,_0x1e1e3a,_0x2c6fb0,_0x4f92('0x3f'),[_0x4f92('0x3d'),_0x4f92('0x3e')]))[_0x4f92('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2bd20b,_0x1e1e3a,_0x2c6fb0,_0x4f92('0x3f'),['\x22always\x22'])))[_0x4f92('0x45')]();return _0x25ca6d;}function insertTzCmHopperBlack(_0x31b953,_0x5bbfc1,_0x5708eb,_0x44ae94){var _0x107503=[_0x4f92('0x40'),_0x4f92('0x26'),_0x4f92('0x27'),_0x5bbfc1+'.'+_0x44ae94,_0x4f92('0x28'),'cm_contacts.updatedAt'];return squel[_0x4f92('0x2c')]()['into']('cm_hopper_black')['fromQuery']([_0x4f92('0x2e'),_0x4f92('0x30'),_0x4f92('0x31'),_0x44ae94,_0x4f92('0x42'),'updatedAt'],squel[_0x4f92('0x11')]()[_0x4f92('0x36')](_0x107503)[_0x4f92('0x37')](_0x5bbfc1)[_0x4f92('0x13')](_0x4f92('0x38'),null,_0x4f92('0x43')+_0x5bbfc1+'.CmListId')['join'](_0x5708eb,null,_0x5708eb+_0x4f92('0x3a')+_0x5bbfc1+'.'+_0x44ae94)[_0x4f92('0x14')](_0x5bbfc1+'.CmListId\x20=\x20?',_0x31b953)[_0x4f92('0x14')](_0x4f92('0x3c'),NOW)[_0x4f92('0x14')](_0x4f92('0x44'),squel[_0x4f92('0x11')]()[_0x4f92('0x12')](_0x4f92('0x2e'))[_0x4f92('0x37')](_0x4f92('0x41'))[_0x4f92('0x14')](_0x4f92('0x49'),_0x31b953)[_0x4f92('0x14')](_0x44ae94+_0x4f92('0x15')+_0x5bbfc1+'.'+_0x44ae94)))[_0x4f92('0x45')]();}function insertCmHopperAdditionalPhones(_0x2c8554){var _0x4be4e7=[_0x4f92('0x4a'),_0x4f92('0x4b'),'cm_contact_has_items.OrderBy',_0x4f92('0x4c'),_0x4f92('0x4d')];return squel[_0x4f92('0x2c')]()[_0x4f92('0x48')]('cm_hopper_additional_phones')[_0x4f92('0x2d')]([_0x4f92('0x4e'),_0x4f92('0x2e'),'OrderBy',_0x4f92('0x42'),_0x4f92('0x32')],squel[_0x4f92('0x11')]()[_0x4f92('0x36')](_0x4be4e7)[_0x4f92('0x37')](_0x4f92('0x3f'))[_0x4f92('0x13')](_0x4f92('0x38'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x4f92('0x13')](_0x4f92('0x4f'),null,_0x4f92('0x50'))[_0x4f92('0x14')](_0x4f92('0x51'),_0x2c8554)[_0x4f92('0x14')](_0x4f92('0x3c'),NOW))[_0x4f92('0x45')]();}function insertCmContact(_0x5965c1,_0xb9e99c,_0x281d85,_0x301f35){var _0x13546d=_['concat'](_['keys'](_0x301f35),[_0x4f92('0x31'),_0x4f92('0x52'),_0x4f92('0x42'),_0x4f92('0x32'),_0x4f92('0x53')]);return squel[_0x4f92('0x2c')]()[_0x4f92('0x48')](_0x4f92('0x38'))[_0x4f92('0x2d')](_0x13546d,squel[_0x4f92('0x11')]()[_0x4f92('0x36')](_0x13546d)[_0x4f92('0x37')](_0xb9e99c)[_0x4f92('0x14')]('('+_0x281d85[_0x4f92('0x13')](',')+_0x4f92('0x54'),squel[_0x4f92('0x11')]()[_0x4f92('0x36')](_0x281d85)[_0x4f92('0x37')](_0x4f92('0x38'))[_0x4f92('0x14')](_0x4f92('0x49'),_0x5965c1)['where'](_0x4f92('0x55')))[_0x4f92('0x14')]('id\x20IN\x20?',squel['select']()[_0x4f92('0x12')](_0x4f92('0x56'),_0x4f92('0x57'))[_0x4f92('0x37')](_0xb9e99c)[_0x4f92('0x58')](_0x281d85[_0x4f92('0x13')](','))))[_0x4f92('0x45')]();}function handleStop(){logger[_0x4f92('0x59')](_0x4f92('0x5a'));stopped=!![];}function handleUncaughtException(_0x5bffb0){logger['error'](_0x5bffb0[_0x4f92('0x5b')]);process[_0x4f92('0x5c')](0x1);}function handleError(_0x24e21,_0x277376){stats[_0x4f92('0x5d')][_0x4f92('0x1c')]({'name':_0x277376['code'],'message':_0x277376[_0x4f92('0x5b')],'row':_0x24e21});}function handleQuery(_0x3495b8){logger[_0x4f92('0x59')](_0x3495b8);return db[_0x4f92('0x5e')][_0x4f92('0x5f')](_0x3495b8)[_0x4f92('0x60')](function(_0x575975){results[_0x4f92('0x1c')](_0x575975);})[_0x4f92('0x61')](function(_0x16920a){logger[_0x4f92('0x62')](_0x16920a['message']);});}function updateTzCampaigns(_0x1e7265){return new Promise(function(_0xb2c310,_0x989f1e){var _0x3d4de8=squel[_0x4f92('0x11')]()[_0x4f92('0x36')]([_0x4f92('0x63'),_0x4f92('0x64')])[_0x4f92('0x37')]('campaigns')[_0x4f92('0x13')](_0x4f92('0x65'),null,_0x4f92('0x66'))[_0x4f92('0x14')](_0x4f92('0x67')+_0x1e7265);db['sequelize']['query'](_0x3d4de8[_0x4f92('0x45')]())['spread'](function(_0x3276f3){var _0x4e3a58=[];for(var _0x101e55=0x0;_0x101e55<_0x3276f3[_0x4f92('0x19')];_0x101e55++){_0x4e3a58['push'](getTimezoneData(_0x3276f3[_0x101e55],tmp_campaigns));}BPromise[_0x4f92('0x1d')](_0x4e3a58)['then'](function(){_0xb2c310({'val':0x1});});})[_0x4f92('0x61')](function(_0xa8d581){logger[_0x4f92('0x62')](_0xa8d581['message']);_0xb2c310({'val':0x0});});});}function updateTzVoiceQueues(_0x1bae7c){return new Promise(function(_0x2ef6c2,_0xeac925){var _0x434f14=squel[_0x4f92('0x11')]()[_0x4f92('0x36')](['voice_queues.id','voice_queues.dialTimezone'])[_0x4f92('0x37')](_0x4f92('0x68'))[_0x4f92('0x13')](_0x4f92('0x69'),null,_0x4f92('0x6a'))[_0x4f92('0x14')](_0x4f92('0x6b')+_0x1bae7c);db[_0x4f92('0x5e')][_0x4f92('0x5f')](_0x434f14[_0x4f92('0x45')]())[_0x4f92('0x60')](function(_0x22d62c){var _0x5c3693=[];for(var _0xa431ca=0x0;_0xa431ca<_0x22d62c['length'];_0xa431ca++){_0x5c3693['push'](getTimezoneData(_0x22d62c[_0xa431ca],tmp_voice_queues));}BPromise['all'](_0x5c3693)[_0x4f92('0x1a')](function(){_0x2ef6c2({'val':0x1});});})[_0x4f92('0x61')](function(_0x4a4716){logger[_0x4f92('0x62')](_0x4a4716['message']);_0x2ef6c2({'val':0x0});});});}function getTimezoneData(_0x1e54e4,_0x4ea665){return new Promise(function(_0x461e69,_0xc99deb){var _0xecf8dc=shared['timezones'];var _0x5c703f=_0xecf8dc[_0x1e54e4[_0x4f92('0x6c')]];if(_['isNil'](_0x5c703f)){_0x461e69({'ret':0x1});}else{var _0x266b11=_0x5c703f[_0x4f92('0x6d')];var _0x211b5b=squel[_0x4f92('0x2c')]()[_0x4f92('0x48')](_0x4ea665)[_0x4f92('0x6e')]('id',_0x1e54e4['id'])['set'](_0x4f92('0x6f'),_0x266b11)[_0x4f92('0x6e')]('dialTimezone',_0x1e54e4[_0x4f92('0x6c')])[_0x4f92('0x45')]();return db[_0x4f92('0x5e')][_0x4f92('0x5f')](_0x211b5b)[_0x4f92('0x60')](function(_0xe83af1){_0x461e69({'ret':0x1});})[_0x4f92('0x61')](function(_0x2e9fe2){logger['error'](_0x2e9fe2[_0x4f92('0x5b')]);_0xc99deb({'ret':0x1});});}});}function handleTZQuery(_0x2af540){logger[_0x4f92('0x59')](_0x2af540);return db[_0x4f92('0x5e')][_0x4f92('0x5f')](_0x2af540)[_0x4f92('0x60')](function(_0x236bf3){})[_0x4f92('0x61')](function(_0x1dfde5){logger['error'](_0x1dfde5[_0x4f92('0x5b')]);});}function main(_0x1cc41b,_0x2c51c9,_0x5f5016,_0x27e88f){logger[_0x4f92('0x59')]('main',_0x1cc41b,JSON[_0x4f92('0x70')](_0x2c51c9));process[_0x4f92('0x71')](_0x4f92('0x72'));var _0x40d117=_0x2c51c9['binding'];var _0xe75100=_[_0x4f92('0x73')](_0x40d117);var _0x2315c2=_0x2c51c9[_0x4f92('0x74')];var _0x30478f=path[_0x4f92('0x13')](config[_0x4f92('0x75')],_0x4f92('0x76'),_0x2315c2+'.csv');hasTZ=_['keys'](_0x40d117)[_0x4f92('0x77')](_0x4f92('0x6c'));var _0xe28bb2=_[_0x4f92('0x78')](_0x40d117)['join']();logger['info'](_0x4f92('0x79'),_0xe28bb2);db[_0x4f92('0x7a')][_0x4f92('0x17')]({'raw':!![],'attributes':['id',_0x4f92('0x7b')]})[_0x4f92('0x1a')](function(_0x3f1912){for(var _0x124837=0x0;_0x124837<_0x3f1912[_0x4f92('0x19')];_0x124837++){if(_0x3f1912[_0x124837]['name']in _0x40d117){contactItemTypes[_0x4f92('0x1c')](_0x3f1912[_0x124837]);delete _0xe75100[_0x3f1912[_0x124837]['name']];hasAdditionalPhones=!![];}for(var _0x4892e6 in _0x40d117){if(_0x3f1912[_0x124837][_0x4f92('0x7b')]+_0x4f92('0x7c')===_0x4892e6){phoneDescriptions[_0x4f92('0x1c')]({'itemTypeId':_0x3f1912[_0x124837]['id'],'description':_0x4892e6});delete _0xe75100[_0x4892e6];}}}if(hasAdditionalPhones)_0xe75100[_0x4f92('0x18')]='';var _0x494cf3=_[_0x4f92('0x78')](_0xe75100)[_0x4f92('0x13')]();logger[_0x4f92('0x59')](_0x4f92('0x79'),_0x494cf3);fs[_0x4f92('0x7d')](_0x30478f,_0x494cf3+'\x0a');Papa[_0x4f92('0x7e')](fs[_0x4f92('0x7f')](_0x1cc41b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x454604,_0x1dfed3){try{for(var _0x3707d1=0x0,_0xf4cda8=[];_0x3707d1<_0x454604[_0x4f92('0x80')][_0x4f92('0x19')];_0x3707d1++){stats[_0x4f92('0x81')]+=0x1;if(_0x454604[_0x4f92('0x5d')][_0x3707d1]){handleError(_0x454604[_0x4f92('0x80')][_0x3707d1],_0x454604[_0x4f92('0x5d')][_0x3707d1]);}else{var _0x1bfd6b=[];var _0xe75bef=[];var _0x188923={};for(var _0x292148 in _0x40d117){let _0x4dc149=contactItemTypes['find'](_0x4c6b61=>_0x4c6b61['name']===_0x292148);let _0x5df1f3=contactItemTypes[_0x4f92('0x82')](_0x266e67=>_0x266e67[_0x4f92('0x7b')]+'_description'===_0x292148);if(_[_0x4f92('0x83')](_0x4dc149)&&_[_0x4f92('0x83')](_0x5df1f3)){if(_0x40d117[_0x4f92('0x84')](_0x292148)){if(_0x454604[_0x4f92('0x80')][_0x3707d1][_0x40d117[_0x292148]]){var _0xd70a9=_[_0x4f92('0x85')](_0x454604[_0x4f92('0x80')][_0x3707d1][_0x40d117[_0x292148]][_0x4f92('0x86')](/"/g,'\x27'));switch(_0x292148){case'scheduledat':var _0x3aa8fa=moment(_0xd70a9,_0x4f92('0xf'),!![]);if(_0x3aa8fa['isValid']()){_0xf4cda8[_0x4f92('0x1c')]('\x22'+_0xd70a9+'\x22');}else{_0x1bfd6b['push'](_0x4f92('0x87'));}break;case _0x4f92('0x33'):var _0x2c45f0=parseInt(_0xd70a9);_0xd70a9=_['isNaN'](_0x2c45f0)||_0x2c45f0<0x0||_0x2c45f0>0x4?_0x27e88f?0x3:0x2:_0x2c45f0;_0xf4cda8[_0x4f92('0x1c')]('\x22'+_0xd70a9+'\x22');break;case _0x4f92('0x34'):var _0x52f2da=parseInt(_0xd70a9);if(_[_0x4f92('0x88')](_0x52f2da)&&_['includes'](_0x5f5016,_0x52f2da)){_0xf4cda8['push']('\x22'+_0x52f2da+'\x22');}else{_0x1bfd6b[_0x4f92('0x1c')](_0x4f92('0x89'));}break;case'email':if(isEmail(_0xd70a9)){_0xf4cda8[_0x4f92('0x1c')]('\x22'+_0xd70a9+'\x22');}else{_0x1bfd6b[_0x4f92('0x1c')](_0x4f92('0x8a'));}break;case _0x4f92('0x8b'):var _0x47ae10=moment(_0xd70a9,'YYYY-MM-DD',!![]);if(_0x47ae10[_0x4f92('0x8c')]()){_0xf4cda8['push']('\x22'+_0xd70a9+'\x22');}else{_0x1bfd6b[_0x4f92('0x1c')](_0x4f92('0x8d'));}break;case _0x4f92('0x6c'):var _0x32693d=shared[_0x4f92('0x8e')];var _0x208218=_0x32693d[_0xd70a9];if(!_[_0x4f92('0x83')](_0x208218)){var _0x8f26e4=_0x208218['utcOffset'];_0xf4cda8[_0x4f92('0x1c')]('\x22'+_0xd70a9+'\x22');_0xf4cda8[_0x4f92('0x1c')]('\x22'+_0x8f26e4+'\x22');}break;default:_0xf4cda8['push']('\x22'+_0xd70a9+'\x22');}}else{switch(_0x292148){case _0x4f92('0x8f'):case'phone':_0x1bfd6b['push'](_0x292148+'\x20not\x20specified');break;default:_0xf4cda8[_0x4f92('0x1c')]('\x22\x22');}}}}else{var _0x2a63fa='';if(!_[_0x4f92('0x83')](_0x4dc149)){if(!_0x188923[_0x4f92('0x84')](_0x4dc149['id'])){if(!_['isNil'](_0x454604['data'][_0x3707d1][_0x40d117[_0x292148]])){var _0xd70a9=_[_0x4f92('0x85')](_0x454604[_0x4f92('0x80')][_0x3707d1][_0x40d117[_0x292148]][_0x4f92('0x86')](/"/g,'\x27'));var _0x5e9f63=phoneDescriptions[_0x4f92('0x82')](_0x1ed324=>_0x1ed324[_0x4f92('0x90')]===_0x4dc149['id']);if(!_[_0x4f92('0x83')](_0x5e9f63)){var _0x3ed53b=_['trim'](_0x454604['data'][_0x3707d1][_0x40d117[_0x5e9f63[_0x4f92('0x91')]]]['replace'](/"/g,'\x27'));if(!_[_0x4f92('0x83')](_0x3ed53b))_0xd70a9=_0xd70a9+'§'+_0x3ed53b;}if(_0x2a63fa=='')_0x2a63fa=_0xd70a9;else _0x2a63fa+='|'+_0xd70a9;}_0xe75bef[_0x4f92('0x1c')](_0x4dc149['id']+':'+_0x2a63fa);_0x188923[_0x4dc149['id']]=0x1;}}}}if(hasAdditionalPhones){_0xf4cda8[_0x4f92('0x1c')]('\x22'+_0xe75bef[_0x4f92('0x13')](';')+'\x22');}if(_0x1bfd6b[_0x4f92('0x19')]){handleError(_0x454604[_0x4f92('0x80')][_0x3707d1],{'code':_0x4f92('0x92'),'message':_0x1bfd6b['join']()});}else{fs['appendFileSync'](_0x30478f,_0xf4cda8[_0x4f92('0x13')]()+'\x0a');}_0xf4cda8=[];}if(!(stats[_0x4f92('0x81')]%0xc8)){socket[_0x4f92('0x93')](_0x4f92('0x94')+_0x2315c2,stats);stats[_0x4f92('0x5d')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x1dfed3[_0x4f92('0x95')]();}}catch(_0x1620e2){handleError(_0x454604['data'][_0x3707d1],{'code':_0x4f92('0x96'),'message':_0x1620e2[_0x4f92('0x5b')]});logger['error'](_0x4f92('0x97'),_0x1620e2[_0x4f92('0x5b')]);}},'complete':function(){try{var _0x45bad2=[];var _0x5885e3=[];var _0x44121b=_0x4f92('0x38');if(_0x2c51c9[_0x4f92('0x98')]&&_0x2c51c9[_0x4f92('0x98')][_0x4f92('0x19')]){_0x44121b='cm_contacts_'+_0x2315c2;_0x45bad2[_0x4f92('0x1c')](_0x4f92('0x99')+_0x44121b+_0x4f92('0x9a'));}tmp_campaigns='campaigns_'+_0x2315c2;tmp_voice_queues='voice_queues_'+_0x2315c2;_0x5885e3['push'](_0x4f92('0x99')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x5885e3[_0x4f92('0x1c')](_0x4f92('0x99')+tmp_voice_queues+_0x4f92('0x9b'));BPromise[_0x4f92('0x9c')](_0x5885e3,handleTZQuery)[_0x4f92('0x1a')](function(_0x37442a){updateTzCampaigns(_0x2c51c9[_0x4f92('0x31')])[_0x4f92('0x1a')](function(_0x49fcd4){updateTzVoiceQueues(_0x2c51c9['ListId'])[_0x4f92('0x1a')](function(_0x461d1f){if(hasTZ)_0x494cf3=_0x494cf3[_0x4f92('0x86')]('dialTimezone',_0x4f92('0x9d'));var _0x219868=util[_0x4f92('0xe')]('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',_0x30478f,_0x44121b,_0x494cf3,_0x2c51c9[_0x4f92('0x31')],_0x2c51c9[_0x4f92('0x52')]||null,NOW,NOW);if(_[_0x4f92('0x83')](_0x40d117['scheduledat'])){_0x219868+=_0x4f92('0x9e');}_0x45bad2[_0x4f92('0x1c')](_0x219868);if(_0x2c51c9[_0x4f92('0x98')]&&_0x2c51c9[_0x4f92('0x98')][_0x4f92('0x19')]){_0x45bad2[_0x4f92('0x1c')](insertCmContact(_0x2c51c9[_0x4f92('0x31')],_0x44121b,_0x2c51c9[_0x4f92('0x98')],_0x40d117));_0x45bad2['push'](_0x4f92('0x9f')+_0x44121b+';');}BPromise[_0x4f92('0x9c')](_0x45bad2,handleQuery)[_0x4f92('0x1a')](function(_0x564653){BPromise[_0x4f92('0x1d')]([handleAdditionalPhones()])[_0x4f92('0x1a')](function(){_0x45bad2=[];for(var _0x2744f2=0x0;_0x2744f2_0x582061[_0xe067('0x7d')]===_0x2009b9);let _0x7dd587=contactItemTypes[_0xe067('0x84')](_0x44f2c2=>_0x44f2c2[_0xe067('0x7d')]+'_description'===_0x2009b9);if(_[_0xe067('0x6f')](_0xb17bd2)&&_[_0xe067('0x6f')](_0x7dd587)){if(_0x10f17f[_0xe067('0x85')](_0x2009b9)){if(_0xa7eafa[_0xe067('0x81')][_0xfb0fc][_0x10f17f[_0x2009b9]]){var _0x949559=_[_0xe067('0x86')](_0xa7eafa[_0xe067('0x81')][_0xfb0fc][_0x10f17f[_0x2009b9]]['replace'](/"/g,'\x27'));switch(_0x2009b9){case _0xe067('0x47'):var _0x571b0b=moment(_0x949559,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x571b0b['isValid']()){_0x4a1d4d[_0xe067('0x19')]('\x22'+_0x949559+'\x22');}else{_0x36f341[_0xe067('0x19')](_0xe067('0x87'));}break;case _0xe067('0x2f'):var _0x5e6360=parseInt(_0x949559);_0x949559=_[_0xe067('0x88')](_0x5e6360)||_0x5e6360<0x0||_0x5e6360>0x4?_0x59e166?0x3:0x2:_0x5e6360;_0x4a1d4d['push']('\x22'+_0x949559+'\x22');break;case'UserId':var _0x9f2de9=parseInt(_0x949559);if(_[_0xe067('0x89')](_0x9f2de9)&&_[_0xe067('0x8a')](_0x55908a,_0x9f2de9)){_0x4a1d4d[_0xe067('0x19')]('\x22'+_0x9f2de9+'\x22');}else{_0x36f341[_0xe067('0x19')](_0xe067('0x8b'));}break;case'email':if(isEmail(_0x949559)){_0x4a1d4d[_0xe067('0x19')]('\x22'+_0x949559+'\x22');}else{_0x36f341[_0xe067('0x19')]('email\x20wrong\x20format');}break;case _0xe067('0x8c'):var _0x49ba24=moment(_0x949559,_0xe067('0x8d'),!![]);if(_0x49ba24[_0xe067('0x8e')]()){_0x4a1d4d['push']('\x22'+_0x949559+'\x22');}else{_0x36f341[_0xe067('0x19')](_0xe067('0x8f'));}break;case _0xe067('0x6e'):var _0x2ba1a7=shared[_0xe067('0x6d')];var _0x594a15=_0x2ba1a7[_0x949559];if(!_['isNil'](_0x594a15)){var _0x381cc8=_0x594a15[_0xe067('0x70')];_0x4a1d4d[_0xe067('0x19')]('\x22'+_0x949559+'\x22');_0x4a1d4d[_0xe067('0x19')]('\x22'+_0x381cc8+'\x22');}break;default:_0x4a1d4d[_0xe067('0x19')]('\x22'+_0x949559+'\x22');}}else{switch(_0x2009b9){case'firstName':case _0xe067('0x2b'):_0x36f341[_0xe067('0x19')](_0x2009b9+'\x20not\x20specified');break;default:_0x4a1d4d[_0xe067('0x19')]('\x22\x22');}}}}else{var _0x786f37='';if(!_['isNil'](_0xb17bd2)){if(!_0x34298b[_0xe067('0x85')](_0xb17bd2['id'])){if(!_[_0xe067('0x6f')](_0xa7eafa[_0xe067('0x81')][_0xfb0fc][_0x10f17f[_0x2009b9]])){var _0x949559=_['trim'](_0xa7eafa['data'][_0xfb0fc][_0x10f17f[_0x2009b9]][_0xe067('0x90')](/"/g,'\x27'));var _0x323e2e=phoneDescriptions[_0xe067('0x84')](_0xdb3626=>_0xdb3626[_0xe067('0x91')]===_0xb17bd2['id']);if(!_[_0xe067('0x6f')](_0x323e2e)){var _0x1711f0=_[_0xe067('0x86')](_0xa7eafa[_0xe067('0x81')][_0xfb0fc][_0x10f17f[_0x323e2e[_0xe067('0x92')]]][_0xe067('0x90')](/"/g,'\x27'));if(!_[_0xe067('0x6f')](_0x1711f0))_0x949559=_0x949559+'§'+_0x1711f0;}if(_0x786f37=='')_0x786f37=_0x949559;else _0x786f37+='|'+_0x949559;}_0x296bb1[_0xe067('0x19')](_0xb17bd2['id']+':'+_0x786f37);_0x34298b[_0xb17bd2['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4a1d4d[_0xe067('0x19')]('\x22'+_0x296bb1[_0xe067('0x12')](';')+'\x22');}if(_0x36f341[_0xe067('0x17')]){handleError(_0xa7eafa[_0xe067('0x81')][_0xfb0fc],{'code':_0xe067('0x93'),'message':_0x36f341[_0xe067('0x12')]()});}else{fs['appendFileSync'](_0x551f4f,_0x4a1d4d[_0xe067('0x12')]()+'\x0a');}_0x4a1d4d=[];}if(!(stats[_0xe067('0x82')]%0xc8)){socket[_0xe067('0x94')](_0xe067('0x95')+_0x5026f5,stats);stats[_0xe067('0x83')]=[];}}if(stopped){logger[_0xe067('0x59')](_0xe067('0x96'));_0x50b755[_0xe067('0x97')]();}}catch(_0x4c077d){handleError(_0xa7eafa[_0xe067('0x81')][_0xfb0fc],{'code':_0xe067('0x98'),'message':_0x4c077d['message']});logger[_0xe067('0x5b')](_0xe067('0x99'),_0x4c077d[_0xe067('0x5c')]);}},'complete':function(){try{var _0x22851c=[];var _0x4531bc=[];var _0xb9baab=_0xe067('0x40');if(_0x301c24[_0xe067('0x9a')]&&_0x301c24['duplicates']['length']){_0xb9baab=_0xe067('0x9b')+_0x5026f5;_0x22851c['push'](_0xe067('0x9c')+_0xb9baab+_0xe067('0x9d'));}tmp_campaigns=_0xe067('0x9e')+_0x5026f5;tmp_voice_queues=_0xe067('0x9f')+_0x5026f5;_0x4531bc['push'](_0xe067('0x9c')+tmp_campaigns+_0xe067('0xa0'));_0x4531bc['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xe067('0xa0'));BPromise[_0xe067('0xa1')](_0x4531bc,handleTZQuery)[_0xe067('0x16')](function(_0x453539){updateTzCampaigns(_0x301c24[_0xe067('0x2c')])[_0xe067('0x16')](function(_0xba42ef){updateTzVoiceQueues(_0x301c24[_0xe067('0x2c')])[_0xe067('0x16')](function(_0x183603){if(hasTZ)_0x27fcf4=_0x27fcf4[_0xe067('0x90')]('dialTimezone',_0xe067('0xa2'));var _0x44aac0=util[_0xe067('0xc')]('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',_0x551f4f,_0xb9baab,_0x27fcf4,_0x301c24[_0xe067('0x2c')],_0x301c24[_0xe067('0x51')]||null,NOW,NOW);if(_[_0xe067('0x6f')](_0x10f17f[_0xe067('0x47')])){_0x44aac0+=_0xe067('0xa3');}_0x22851c[_0xe067('0x19')](_0x44aac0);if(_0x301c24[_0xe067('0x9a')]&&_0x301c24[_0xe067('0x9a')]['length']){_0x22851c[_0xe067('0x19')](insertCmContact(_0x301c24['ListId'],_0xb9baab,_0x301c24['duplicates'],_0x10f17f));_0x22851c['push'](_0xe067('0xa4')+_0xb9baab+';');}BPromise[_0xe067('0xa1')](_0x22851c,handleQuery)[_0xe067('0x16')](function(_0x5bf08d){BPromise[_0xe067('0x18')]([handleAdditionalPhones()])[_0xe067('0x16')](function(){_0x22851c=[];for(var _0x3c42e8=0x0;_0x3c42e8\x20\x20');}var _0x50c8f6=path[_0xe067('0x12')](config[_0xe067('0x77')],_0xe067('0x78'),process[_0xe067('0xaf')][0x2]);if(!fs['existsSync'](_0x50c8f6)){throw new Error(_0xe067('0xb0'));}var _0x110234={};try{_0x110234=JSON[_0xe067('0x7f')](process['argv'][0x3]);if(!_0x110234[_0xe067('0xb1')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x110234['binding'][_0xe067('0x2b')]){throw new Error(_0xe067('0xb2'));}if(!_0x110234['binding']['firstName']){throw new Error(_0xe067('0xb3'));}var _0x4a932c=0x0;if(_0x110234[_0xe067('0xb1')][_0xe067('0x30')]){_0x4a932c=0x1;}if(!_0x110234[_0xe067('0x2c')]){throw new Error(_0xe067('0xb4'));}}catch(_0x181122){throw new Error(_0xe067('0xb5'));}var _0x1e9a75=[];try{_0x1e9a75=_[_0xe067('0xb6')](JSON[_0xe067('0x7f')](process['argv'][0x4]),'id');}catch(_0x278c1a){logger['info'](_0xe067('0xb7'));}main(_0x50c8f6,_0x110234,_0x1e9a75,_0x4a932c);}validate();process['on']('SIGINT',handleStop);process['on'](_0xe067('0xb8'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 5804467..25f39ef 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 _0x45c2=['cm_contacts','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','cm_contacts.createdAt','insert','cm_hopper_black','field','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','fromQuery','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','MIN(id)','min_id','group','Received\x20SIGINT','exit','errors','code','info','query','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','body','findAll','name','_description','header','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','priority','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','Abort\x20parser','abort','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','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','catch','error','message','then','split','CmContactHasItem','updated','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','into','scheduledat','ContactId','ListId','createdAt','updatedAt','recallme','fields'];(function(_0x1a61c1,_0x2f064d){var _0x2240bf=function(_0x52c173){while(--_0x52c173){_0x1a61c1['push'](_0x1a61c1['shift']());}};_0x2240bf(++_0x2f064d);}(_0x45c2,0x68));var _0x245c=function(_0x250f95,_0x5a5728){_0x250f95=_0x250f95-0x0;var _0x4ada97=_0x45c2[_0x250f95];return _0x4ada97;};'use strict';var fs=require('fs');var path=require(_0x245c('0x0'));var _=require(_0x245c('0x1'));var Papa=require(_0x245c('0x2'));var util=require(_0x245c('0x3'));var BPromise=require('bluebird');var moment=require(_0x245c('0x4'));var squel=require(_0x245c('0x5'));var Redis=require(_0x245c('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x245c('0x7'));var logger=require(_0x245c('0x8'))(_0x245c('0x9'));config[_0x245c('0xa')]=_[_0x245c('0xb')](config[_0x245c('0xa')],{'host':_0x245c('0xc'),'port':0x18eb});var socket=require(_0x245c('0xd'))(new Redis(config[_0x245c('0xa')]));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()[_0x245c('0xe')](_0x245c('0xf'));var tempTableName=_0x245c('0x10')+moment()['format'](_0x245c('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x244013){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))*$/[_0x245c('0x12')](_0x244013);}function selectNotIn(_0x506e9b,_0x5b1e37,_0x35a363,_0x293869,_0x5d925c){return squel[_0x245c('0x13')]()['field'](_0x245c('0x14'))[_0x245c('0x15')](_0x293869)[_0x245c('0x16')](_0x5b1e37,null,_0x5b1e37+_0x245c('0x17')+_0x293869+'.'+_0x35a363)[_0x245c('0x18')](_0x293869+'.'+_0x35a363+'\x20=\x20'+_0x506e9b+'.'+_0x35a363)[_0x245c('0x18')](_0x5b1e37+_0x245c('0x19')+_0x5d925c[_0x245c('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3c0336,_0x50a77b){promisesAdditionalPhones=[];promisesContact=[];return db[_0x245c('0x1a')]['query'](_0x245c('0x1b')+tempTableName)[_0x245c('0x1c')](function(_0x3c2ccf){if(_0x3c2ccf!==null){var _0x19a877=[];for(var _0x49c0f6=0x0;_0x49c0f6<_0x3c2ccf[_0x245c('0x1d')];_0x49c0f6++){var _0x2aa4eb=_0x3c2ccf[_0x49c0f6];if(!_[_0x245c('0x1e')](_0x2aa4eb[_0x245c('0x14')])){if(!_[_0x245c('0x1e')](_0x2aa4eb[_0x245c('0x1f')]))_0x19a877['push'](insertAdditionalPhones(_0x2aa4eb));promisesContact[_0x245c('0x20')]({'contact':_0x2aa4eb});}}}Promise[_0x245c('0x21')](_0x19a877)['then'](function(){_0x3c0336({'val':0x1});});})[_0x245c('0x22')](function(_0x260c15){logger[_0x245c('0x23')](_0x260c15[_0x245c('0x24')]);});});}function insertAdditionalPhones(_0x4cf062){return new Promise(function(_0x49cb1c,_0x24558f){var _0x5d2d63=_0x4cf062[_0x245c('0x1f')];if(_[_0x245c('0x1e')](_0x5d2d63))_0x24558f({'val':0x0});else{var _0x4651e0=_0x5d2d63['split'](';');var _0x425e9=[];orderBy=0x0;for(var _0x52a0a3=0x0;_0x52a0a3<_0x4651e0['length'];_0x52a0a3++){_0x425e9[_0x245c('0x20')](splitAdditionalPhone(_0x4cf062['id'],_0x4651e0[_0x52a0a3]));}Promise[_0x245c('0x21')](_0x425e9)[_0x245c('0x25')](function(){_0x49cb1c({'val':_0x4651e0[_0x245c('0x1d')]});});}});}function splitAdditionalPhone(_0x327140,_0x122b42){return new Promise(function(_0x4e21ee,_0x4fd041){var _0x5682fb=_0x122b42[_0x245c('0x26')](':');var _0x1c1b84=_0x5682fb[0x0];var _0x383df5=_0x5682fb[0x1];if(_0x383df5!==''){var _0x1f1357=_0x383df5['split']('|');var _0x4fcfb2=[];for(var _0x2d3817=0x0;_0x2d3817<_0x1f1357[_0x245c('0x1d')];_0x2d3817++){if(_0x1f1357[_0x2d3817]!==''){var _0x3296e1=_['filter'](promisesAdditionalPhones,{'contactId':_0x327140,'phone':_0x1f1357[_0x2d3817]});if(_0x3296e1[_0x245c('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0x245c('0x20')]({'contactId':_0x327140,'contactTypeId':_0x1c1b84,'phone':_0x1f1357[_0x2d3817],'orderBy':orderBy});}}}_0x4e21ee({'ok':0x1});}else _0x4e21ee({'res':0x0});});}function createAdditionalPhone(_0xf2f4b9,_0x3377f4,_0x5a2a16,_0x11ef1d){var _0x44575b='';var _0x49a766='';var _0x57b67e=_0x5a2a16[_0x245c('0x26')]('§');_0x44575b=_0x57b67e[0x0];if(_0x57b67e[_0x245c('0x1d')]==0x2)_0x49a766=_0x57b67e[0x1];return new Promise(function(_0x1874bf,_0x475004){return db[_0x245c('0x27')]['findOne']({'where':{'CmContactId':_0xf2f4b9,'item':_0x44575b}})[_0x245c('0x25')](function(_0x5e31b4){if(_0x5e31b4){return db[_0x245c('0x27')]['update']({'ItemTypeId':_0x3377f4,'description':_0x49a766,'OrderBy':_0x11ef1d},{'where':{'CmContactId':_0xf2f4b9,'item':_0x44575b}})[_0x245c('0x25')](function(_0x31403b){_0x1874bf({'res':_0x245c('0x28')});});}else{return db['CmContactHasItem'][_0x245c('0x29')]({'CmContactId':_0xf2f4b9,'item':_0x44575b,'ItemTypeId':_0x3377f4,'description':_0x49a766,'OrderBy':_0x11ef1d,'ItemClass':_0x245c('0x2a')})[_0x245c('0x25')](function(_0xeab236){_0x1874bf({'res':'inserted'});});}});});}function updateContact(_0x2a9605){return new Promise(function(_0x221f42,_0x3e289b){var _0x1f9dfa=_0x2a9605['id'];delete _0x2a9605['id'];return db['CmContact']['update'](_0x2a9605,{'where':{'id':_0x1f9dfa}})['then'](function(_0x33044a){updatedRows+=0x1;return db['CmHopper']['update']({'phone':_0x2a9605[_0x245c('0x14')]},{'where':{'ContactId':_0x1f9dfa}})[_0x245c('0x25')](function(_0x5cb39e){_0x221f42({'ret':'OK'});});});});}function insertCmHopper(_0x358b4b,_0xbf39a2,_0x1ee872,_0x156aeb,_0x3b2642){var _0x335896=[_0x245c('0x2b'),_0x245c('0x2c'),_0x245c('0x2d'),_0x245c('0x2e'),_0xbf39a2+'.'+_0x156aeb,'cm_contacts.createdAt',_0x245c('0x2f'),_0x245c('0x30'),'cm_contacts.UserId','\x22'+_0x3b2642+'\x22'];return squel['insert']()[_0x245c('0x31')]('cm_hopper')['fromQuery']([_0x245c('0x14'),_0x245c('0x32'),_0x245c('0x33'),_0x245c('0x34'),_0x156aeb,_0x245c('0x35'),_0x245c('0x36'),'priority','UserId',_0x245c('0x37')],squel[_0x245c('0x13')]()[_0x245c('0x38')](_0x335896)[_0x245c('0x15')](_0xbf39a2)[_0x245c('0x16')](_0x245c('0x39'),null,_0x245c('0x3a')+_0xbf39a2+_0x245c('0x3b'))['join'](_0x1ee872,null,_0x1ee872+_0x245c('0x17')+_0xbf39a2+'.'+_0x156aeb)[_0x245c('0x18')](_0xbf39a2+_0x245c('0x3c'),_0x358b4b)[_0x245c('0x18')](_0x245c('0x3d'),NOW)[_0x245c('0x18')](_0x245c('0x3e'),selectNotIn(_0xbf39a2,_0x1ee872,_0x156aeb,_0x245c('0x3f'),[_0x245c('0x40'),_0x245c('0x41')]))[_0x245c('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xbf39a2,_0x1ee872,_0x156aeb,'cm_hopper',[_0x245c('0x40')])))['toString']();}function insertCmHopperBlack(_0x1e663a,_0x3d3c06,_0x42f2c0,_0x20cfdb){var _0x4b6c1c=[_0x245c('0x2b'),'cm_contacts.id','cm_contacts.ListId',_0x3d3c06+'.'+_0x20cfdb,_0x245c('0x42'),'cm_contacts.updatedAt'];return squel[_0x245c('0x43')]()['into'](_0x245c('0x44'))['fromQuery']([_0x245c('0x14'),_0x245c('0x33'),_0x245c('0x34'),_0x20cfdb,_0x245c('0x35'),_0x245c('0x36')],squel[_0x245c('0x13')]()[_0x245c('0x38')](_0x4b6c1c)['from'](_0x3d3c06)[_0x245c('0x16')](_0x245c('0x39'),null,_0x245c('0x3a')+_0x3d3c06+_0x245c('0x3b'))[_0x245c('0x16')](_0x42f2c0,null,_0x42f2c0+_0x245c('0x17')+_0x3d3c06+'.'+_0x20cfdb)[_0x245c('0x18')](_0x3d3c06+_0x245c('0x3c'),_0x1e663a)[_0x245c('0x18')](_0x245c('0x3d'),NOW)[_0x245c('0x18')](_0x245c('0x3e'),squel['select']()[_0x245c('0x45')](_0x245c('0x14'))['from'](_0x245c('0x44'))['where']('ListId\x20=\x20?',_0x1e663a)[_0x245c('0x18')](_0x20cfdb+_0x245c('0x46'),_0x3d3c06+'.'+_0x20cfdb)))[_0x245c('0x47')]();}function insertCmHopperAdditionalPhones(_0x244617){var _0x5ac149=[_0x245c('0x48'),_0x245c('0x49'),_0x245c('0x4a'),'cm_contact_has_items.createdAt',_0x245c('0x4b')];return squel[_0x245c('0x43')]()[_0x245c('0x31')](_0x245c('0x4c'))[_0x245c('0x4d')]([_0x245c('0x4e'),_0x245c('0x14'),_0x245c('0x4f'),_0x245c('0x35'),'updatedAt'],squel[_0x245c('0x13')]()[_0x245c('0x38')](_0x5ac149)[_0x245c('0x15')](_0x245c('0x3f'))[_0x245c('0x16')](_0x245c('0x39'),null,_0x245c('0x50'))[_0x245c('0x16')](_0x245c('0x51'),null,_0x245c('0x52'))[_0x245c('0x18')](_0x245c('0x53'),_0x244617)[_0x245c('0x18')](_0x245c('0x3d'),NOW))[_0x245c('0x47')]();}function insertCmContact(_0x1cebd7,_0x4a9219,_0x3acf22,_0x36adb5){var _0x5f0651=_[_0x245c('0x54')](_['keys'](_0x36adb5),[_0x245c('0x34'),'CompanyId',_0x245c('0x35'),_0x245c('0x36')]);return squel[_0x245c('0x43')]()[_0x245c('0x31')](_0x245c('0x39'))[_0x245c('0x4d')](_0x5f0651,squel[_0x245c('0x13')]()[_0x245c('0x38')](_0x5f0651)[_0x245c('0x15')](_0x4a9219)['where']('('+_0x3acf22[_0x245c('0x16')](',')+_0x245c('0x55'),squel[_0x245c('0x13')]()[_0x245c('0x38')](_0x3acf22)['from'](_0x245c('0x39'))['where'](_0x245c('0x56'),_0x1cebd7))[_0x245c('0x18')]('id\x20IN\x20?',squel['select']()[_0x245c('0x45')](_0x245c('0x57'),_0x245c('0x58'))['from'](_0x4a9219)[_0x245c('0x59')](_0x3acf22[_0x245c('0x16')](','))))[_0x245c('0x47')]();}function handleStop(){logger['info'](_0x245c('0x5a'));stopped=!![];}function handleUncaughtException(_0x52b5be){logger[_0x245c('0x23')](_0x52b5be[_0x245c('0x24')]);process[_0x245c('0x5b')](0x1);}function handleError(_0x5092dd,_0x2f2813){stats[_0x245c('0x5c')][_0x245c('0x20')]({'name':_0x2f2813[_0x245c('0x5d')],'message':_0x2f2813[_0x245c('0x24')],'row':_0x5092dd});}function handleQuery(_0x3bec23){logger[_0x245c('0x5e')](_0x3bec23);return db[_0x245c('0x1a')][_0x245c('0x5f')](_0x3bec23)[_0x245c('0x1c')](function(_0xa04ff0){results[_0x245c('0x20')](_0xa04ff0);})[_0x245c('0x22')](function(_0x50f5c9){logger[_0x245c('0x23')](_0x50f5c9['message']);});}function main(_0x5dcf8b,_0x5060ec,_0x1c0b10,_0x322119){logger['info']('main',_0x5dcf8b,JSON[_0x245c('0x60')](_0x5060ec));process[_0x245c('0x61')](_0x245c('0x62'));var _0x5b8242=_0x5060ec[_0x245c('0x63')];var _0xb132dc=_['clone'](_0x5b8242);var _0x2f6932=_0x5060ec[_0x245c('0x64')];var _0xbca350=path[_0x245c('0x16')](config[_0x245c('0x65')],_0x245c('0x66'),_0x2f6932+_0x245c('0x67'));logger[_0x245c('0x5e')](_0x245c('0x68'),_0x5060ec);db['ContactItemType'][_0x245c('0x69')]({'raw':!![],'attributes':['id',_0x245c('0x6a')]})[_0x245c('0x25')](function(_0x41f52b){for(var _0x1560be=0x0;_0x1560be<_0x41f52b['length'];_0x1560be++){if(_0x41f52b[_0x1560be][_0x245c('0x6a')]in _0x5b8242){contactItemTypes['push'](_0x41f52b[_0x1560be]);delete _0xb132dc[_0x41f52b[_0x1560be][_0x245c('0x6a')]];hasAdditionalPhones=!![];}for(var _0x32967d in _0x5b8242){if(_0x41f52b[_0x1560be][_0x245c('0x6a')]+_0x245c('0x6b')===_0x32967d){phoneDescriptions['push']({'itemTypeId':_0x41f52b[_0x1560be]['id'],'description':_0x32967d});delete _0xb132dc[_0x32967d];}}}if(hasAdditionalPhones)_0xb132dc['AdditionalPhones']='';var _0x1a3cd9=_['keys'](_0xb132dc)[_0x245c('0x16')]();logger[_0x245c('0x5e')](_0x245c('0x6c'),_0x1a3cd9);fs['writeFileSync'](_0xbca350,_0x1a3cd9+'\x0a');Papa[_0x245c('0x6d')](fs[_0x245c('0x6e')](_0x5dcf8b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x232c07,_0x19f749){try{for(var _0x1eed26=0x0,_0x33ea8e=[];_0x1eed26<_0x232c07[_0x245c('0x6f')]['length'];_0x1eed26++){stats[_0x245c('0x70')]+=0x1;if(_0x232c07['errors'][_0x1eed26]){handleError(_0x232c07['data'][_0x1eed26],_0x232c07[_0x245c('0x5c')][_0x1eed26]);}else{var _0x562688=[];var _0x3a9360=[];var _0xf6596d={};for(var _0x27f348 in _0x5b8242){let _0x1b2bae=contactItemTypes['find'](_0x3730d8=>_0x3730d8[_0x245c('0x6a')]===_0x27f348);let _0x59174d=contactItemTypes[_0x245c('0x71')](_0x18c476=>_0x18c476['name']+_0x245c('0x6b')===_0x27f348);if(_['isNil'](_0x1b2bae)&&_[_0x245c('0x1e')](_0x59174d)){if(_0x5b8242[_0x245c('0x72')](_0x27f348)){if(_0x232c07[_0x245c('0x6f')][_0x1eed26][_0x5b8242[_0x27f348]]){var _0x34eb48=_[_0x245c('0x73')](_0x232c07['data'][_0x1eed26][_0x5b8242[_0x27f348]][_0x245c('0x74')](/"/g,'\x27'));switch(_0x27f348){case _0x245c('0x32'):var _0x30193f=moment(_0x34eb48,_0x245c('0xf'),!![]);if(_0x30193f[_0x245c('0x75')]()){_0x33ea8e['push']('\x22'+_0x34eb48+'\x22');}else{_0x562688[_0x245c('0x20')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x245c('0x76'):var _0x5f05f2=parseInt(_0x34eb48);_0x34eb48=_[_0x245c('0x77')](_0x5f05f2)||_0x5f05f2<0x0||_0x5f05f2>0x4?_0x322119?0x3:0x2:_0x5f05f2;_0x33ea8e[_0x245c('0x20')]('\x22'+_0x34eb48+'\x22');break;case _0x245c('0x78'):var _0x5919e7=parseInt(_0x34eb48);if(_[_0x245c('0x79')](_0x5919e7)&&_[_0x245c('0x7a')](_0x1c0b10,_0x5919e7)){_0x33ea8e['push']('\x22'+_0x5919e7+'\x22');}else{_0x562688['push'](_0x245c('0x7b'));}break;case _0x245c('0x7c'):if(isEmail(_0x34eb48)){_0x33ea8e['push']('\x22'+_0x34eb48+'\x22');}else{_0x562688[_0x245c('0x20')]('email\x20wrong\x20format');}break;case _0x245c('0x7d'):var _0x768971=moment(_0x34eb48,_0x245c('0x7e'),!![]);if(_0x768971[_0x245c('0x75')]()){_0x33ea8e[_0x245c('0x20')]('\x22'+_0x34eb48+'\x22');}else{_0x562688[_0x245c('0x20')](_0x245c('0x7f'));}break;default:_0x33ea8e[_0x245c('0x20')]('\x22'+_0x34eb48+'\x22');}}else{switch(_0x27f348){case _0x245c('0x80'):case _0x245c('0x14'):_0x562688[_0x245c('0x20')](_0x27f348+_0x245c('0x81'));break;default:_0x33ea8e[_0x245c('0x20')]('\x22\x22');}}}}else{var _0x242148='';if(!_[_0x245c('0x1e')](_0x1b2bae)){if(!_0xf6596d[_0x245c('0x72')](_0x1b2bae['id'])){for(var _0xb8e5ed=0x0;_0xb8e5ed<_0x5b8242[_0x27f348][_0x245c('0x1d')];_0xb8e5ed++){var _0x34eb48=_[_0x245c('0x73')](_0x232c07[_0x245c('0x6f')][_0x1eed26][_0x5b8242[_0x27f348][_0xb8e5ed]][_0x245c('0x74')](/"/g,'\x27'));var _0x247dca=phoneDescriptions[_0x245c('0x71')](_0x13b896=>_0x13b896[_0x245c('0x82')]===_0x1b2bae['id']);if(!_[_0x245c('0x1e')](_0x247dca)){var _0x2310e0=_[_0x245c('0x73')](_0x232c07[_0x245c('0x6f')][_0x1eed26][_0x5b8242[_0x247dca[_0x245c('0x83')]][0x0]][_0x245c('0x74')](/"/g,'\x27'));if(!_['isNil'](_0x2310e0))_0x34eb48=_0x34eb48+'§'+_0x2310e0;}if(_0x242148=='')_0x242148=_0x34eb48;else _0x242148+='|'+_0x34eb48;}_0x3a9360['push'](_0x1b2bae['id']+':'+_0x242148);_0xf6596d[_0x1b2bae['id']]=0x1;}}}}if(hasAdditionalPhones){_0x33ea8e[_0x245c('0x20')]('\x22'+_0x3a9360[_0x245c('0x16')](';')+'\x22');}if(_0x562688[_0x245c('0x1d')]){handleError(_0x232c07['data'][_0x1eed26],{'code':_0x245c('0x84'),'message':_0x562688[_0x245c('0x16')]()});}else{fs['appendFileSync'](_0xbca350,_0x33ea8e[_0x245c('0x16')]()+'\x0a');}_0x33ea8e=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x2f6932,stats);stats['errors']=[];}}if(stopped){logger[_0x245c('0x5e')](_0x245c('0x85'));_0x19f749[_0x245c('0x86')]();}}catch(_0x1e3104){handleError(_0x232c07[_0x245c('0x6f')][_0x1eed26],{'code':_0x245c('0x87'),'message':_0x1e3104[_0x245c('0x24')]});logger[_0x245c('0x23')](_0x245c('0x88'),_0x1e3104[_0x245c('0x24')]);}},'complete':function(){try{var _0x297875=[];var _0x16c96c=tempTableName;_0x297875[_0x245c('0x20')](_0x245c('0x89')+_0x16c96c+_0x245c('0x8a'));logger[_0x245c('0x5e')](_0x245c('0x8b'),contactItemTypes[_0x245c('0x1d')]);var _0x171e7f=util[_0x245c('0xe')](_0x245c('0x8c'),_0xbca350,_0x16c96c,_0x1a3cd9,_0x5060ec[_0x245c('0x34')],_0x5060ec[_0x245c('0x8d')]||null,NOW,NOW);if(_[_0x245c('0x1e')](_0x5b8242[_0x245c('0x32')])){_0x171e7f+=_0x245c('0x8e');}_0x297875['push'](_0x171e7f);BPromise['each'](_0x297875,handleQuery)[_0x245c('0x25')](function(_0x1b04ee){BPromise[_0x245c('0x21')]([handleAdditionalPhones()])['then'](function(){_0x297875=[];for(var _0x3d22de=0x0;_0x3d22de\x20\x20','root','existsSync','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','isNil','phone','AdditionalPhones','push','then','error','message','split','length','all','filter','CmContactHasItem','findOne','updated','PHONE','inserted','CmContact','update','CmHopper','cm_contacts.phone','cm_contacts.ListId','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','select','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','cm_hopper_black','cm_contacts','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','exit','errors','code','catch','main','start','clone','socket_timestamp','.csv','info','findAll','name','_description','header','writeFileSync','parse','createReadStream','rows','data','find','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','itemTypeId','description','contact:import:','abort','SystemError','\x20LIKE\x20cm_contacts;','CIS\x20len',',\x20scheduledAt\x20=\x20NOW()','each','contactId'];(function(_0x377217,_0x26b013){var _0x26258d=function(_0x1e1894){while(--_0x1e1894){_0x377217['push'](_0x377217['shift']());}};_0x26258d(++_0x26b013);}(_0x6a14,0x13c));var _0x46a1=function(_0x54ebad,_0x5b238d){_0x54ebad=_0x54ebad-0x0;var _0x4c5c9d=_0x6a14[_0x54ebad];return _0x4c5c9d;};'use strict';var fs=require('fs');var path=require(_0x46a1('0x0'));var _=require(_0x46a1('0x1'));var Papa=require(_0x46a1('0x2'));var util=require(_0x46a1('0x3'));var BPromise=require(_0x46a1('0x4'));var moment=require('moment');var squel=require(_0x46a1('0x5'));var Redis=require(_0x46a1('0x6'));var db=require(_0x46a1('0x7'))['db'];var config=require(_0x46a1('0x8'));var logger=require(_0x46a1('0x9'))(_0x46a1('0xa'));config['redis']=_['defaults'](config[_0x46a1('0xb')],{'host':_0x46a1('0xc'),'port':0x18eb});var socket=require(_0x46a1('0xd'))(new Redis(config[_0x46a1('0xb')]));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()[_0x46a1('0xe')](_0x46a1('0xf'));var tempTableName=_0x46a1('0x10')+moment()[_0x46a1('0xe')](_0x46a1('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x42c1af){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'](_0x42c1af);}function selectNotIn(_0x12ca28,_0x4b7502,_0xfc5251,_0x43a8d9,_0x2f345f){return squel['select']()[_0x46a1('0x12')]('phone')[_0x46a1('0x13')](_0x43a8d9)[_0x46a1('0x14')](_0x4b7502,null,_0x4b7502+_0x46a1('0x15')+_0x43a8d9+'.'+_0xfc5251)[_0x46a1('0x16')](_0x43a8d9+'.'+_0xfc5251+_0x46a1('0x17')+_0x12ca28+'.'+_0xfc5251)[_0x46a1('0x16')](_0x4b7502+_0x46a1('0x18')+_0x2f345f[_0x46a1('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3ebf22,_0x16b09e){promisesAdditionalPhones=[];promisesContact=[];return db[_0x46a1('0x19')][_0x46a1('0x1a')]('select\x20*\x20from\x20'+tempTableName)[_0x46a1('0x1b')](function(_0x11ea07){if(_0x11ea07!==null){var _0x434893=[];for(var _0xe6666d=0x0;_0xe6666d<_0x11ea07['length'];_0xe6666d++){var _0x26e0f7=_0x11ea07[_0xe6666d];if(!_[_0x46a1('0x1c')](_0x26e0f7[_0x46a1('0x1d')])){if(!_['isNil'](_0x26e0f7[_0x46a1('0x1e')]))_0x434893[_0x46a1('0x1f')](insertAdditionalPhones(_0x26e0f7));promisesContact[_0x46a1('0x1f')]({'contact':_0x26e0f7});}}}Promise['all'](_0x434893)[_0x46a1('0x20')](function(){_0x3ebf22({'val':0x1});});})['catch'](function(_0x4cd4e3){logger[_0x46a1('0x21')](_0x4cd4e3[_0x46a1('0x22')]);});});}function insertAdditionalPhones(_0x2f5b55){return new Promise(function(_0x1b1c2c,_0x1f8520){var _0x297291=_0x2f5b55[_0x46a1('0x1e')];if(_[_0x46a1('0x1c')](_0x297291))_0x1f8520({'val':0x0});else{var _0x5c02ab=_0x297291[_0x46a1('0x23')](';');var _0x4ac87a=[];orderBy=0x0;for(var _0x3806bc=0x0;_0x3806bc<_0x5c02ab[_0x46a1('0x24')];_0x3806bc++){_0x4ac87a[_0x46a1('0x1f')](splitAdditionalPhone(_0x2f5b55['id'],_0x5c02ab[_0x3806bc]));}Promise[_0x46a1('0x25')](_0x4ac87a)[_0x46a1('0x20')](function(){_0x1b1c2c({'val':_0x5c02ab[_0x46a1('0x24')]});});}});}function splitAdditionalPhone(_0x369bdc,_0x1353e2){return new Promise(function(_0x1b946a,_0x57275f){var _0x20a45d=_0x1353e2[_0x46a1('0x23')](':');var _0x449a12=_0x20a45d[0x0];var _0x3992d8=_0x20a45d[0x1];if(_0x3992d8!==''){var _0x1c9837=_0x3992d8[_0x46a1('0x23')]('|');var _0x1bb591=[];for(var _0x30e717=0x0;_0x30e717<_0x1c9837[_0x46a1('0x24')];_0x30e717++){if(_0x1c9837[_0x30e717]!==''){var _0x245851=_[_0x46a1('0x26')](promisesAdditionalPhones,{'contactId':_0x369bdc,'phone':_0x1c9837[_0x30e717]});if(_0x245851[_0x46a1('0x24')]==0x0){orderBy++;promisesAdditionalPhones[_0x46a1('0x1f')]({'contactId':_0x369bdc,'contactTypeId':_0x449a12,'phone':_0x1c9837[_0x30e717],'orderBy':orderBy});}}}_0x1b946a({'ok':0x1});}else _0x1b946a({'res':0x0});});}function createAdditionalPhone(_0x52a02b,_0x1549cc,_0x353867,_0x3295cf){var _0x5e7db2='';var _0x5302e0='';var _0x1d57f4=_0x353867[_0x46a1('0x23')]('§');_0x5e7db2=_0x1d57f4[0x0];if(_0x1d57f4[_0x46a1('0x24')]==0x2)_0x5302e0=_0x1d57f4[0x1];return new Promise(function(_0x2c79bf,_0x5513f1){return db[_0x46a1('0x27')][_0x46a1('0x28')]({'where':{'CmContactId':_0x52a02b,'item':_0x5e7db2}})['then'](function(_0x14109c){if(_0x14109c){return db[_0x46a1('0x27')]['update']({'ItemTypeId':_0x1549cc,'description':_0x5302e0,'OrderBy':_0x3295cf},{'where':{'CmContactId':_0x52a02b,'item':_0x5e7db2}})[_0x46a1('0x20')](function(_0x518810){_0x2c79bf({'res':_0x46a1('0x29')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x52a02b,'item':_0x5e7db2,'ItemTypeId':_0x1549cc,'description':_0x5302e0,'OrderBy':_0x3295cf,'ItemClass':_0x46a1('0x2a')})[_0x46a1('0x20')](function(_0x55bd26){_0x2c79bf({'res':_0x46a1('0x2b')});});}});});}function updateContact(_0xe748f){return new Promise(function(_0x5a1740,_0x2b4704){var _0xfce163=_0xe748f['id'];delete _0xe748f['id'];return db[_0x46a1('0x2c')][_0x46a1('0x2d')](_0xe748f,{'where':{'id':_0xfce163}})[_0x46a1('0x20')](function(_0x297807){updatedRows+=0x1;return db[_0x46a1('0x2e')][_0x46a1('0x2d')]({'phone':_0xe748f[_0x46a1('0x1d')]},{'where':{'ContactId':_0xfce163}})[_0x46a1('0x20')](function(_0x560958){_0x5a1740({'ret':'OK'});});});});}function insertCmHopper(_0xd50fb9,_0x1c16f4,_0x2d125a,_0x49cbb8,_0x41e774){var _0x44a8d3=[_0x46a1('0x2f'),'cm_contacts.scheduledat','cm_contacts.id',_0x46a1('0x30'),_0x1c16f4+'.'+_0x49cbb8,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0x46a1('0x31'),'\x22'+_0x41e774+'\x22'];return squel[_0x46a1('0x32')]()[_0x46a1('0x33')](_0x46a1('0x34'))[_0x46a1('0x35')]([_0x46a1('0x1d'),_0x46a1('0x36'),_0x46a1('0x37'),_0x46a1('0x38'),_0x49cbb8,_0x46a1('0x39'),_0x46a1('0x3a'),_0x46a1('0x3b'),'UserId',_0x46a1('0x3c')],squel[_0x46a1('0x3d')]()[_0x46a1('0x3e')](_0x44a8d3)[_0x46a1('0x13')](_0x1c16f4)[_0x46a1('0x14')]('cm_contacts',null,_0x46a1('0x3f')+_0x1c16f4+_0x46a1('0x40'))[_0x46a1('0x14')](_0x2d125a,null,_0x2d125a+_0x46a1('0x15')+_0x1c16f4+'.'+_0x49cbb8)[_0x46a1('0x16')](_0x1c16f4+_0x46a1('0x41'),_0xd50fb9)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x46a1('0x16')](_0x46a1('0x42'),selectNotIn(_0x1c16f4,_0x2d125a,_0x49cbb8,_0x46a1('0x34'),[_0x46a1('0x43'),_0x46a1('0x44')]))[_0x46a1('0x16')](_0x46a1('0x42'),selectNotIn(_0x1c16f4,_0x2d125a,_0x49cbb8,'cm_hopper',[_0x46a1('0x43')])))[_0x46a1('0x45')]();}function insertCmHopperBlack(_0x316927,_0x2c204e,_0x1cb205,_0x1e085c){var _0x2d9cda=[_0x46a1('0x2f'),'cm_contacts.id',_0x46a1('0x30'),_0x2c204e+'.'+_0x1e085c,'cm_contacts.createdAt',_0x46a1('0x46')];return squel['insert']()['into'](_0x46a1('0x47'))['fromQuery']([_0x46a1('0x1d'),_0x46a1('0x37'),_0x46a1('0x38'),_0x1e085c,_0x46a1('0x39'),'updatedAt'],squel[_0x46a1('0x3d')]()[_0x46a1('0x3e')](_0x2d9cda)['from'](_0x2c204e)[_0x46a1('0x14')](_0x46a1('0x48'),null,_0x46a1('0x3f')+_0x2c204e+_0x46a1('0x40'))['join'](_0x1cb205,null,_0x1cb205+_0x46a1('0x15')+_0x2c204e+'.'+_0x1e085c)[_0x46a1('0x16')](_0x2c204e+_0x46a1('0x41'),_0x316927)[_0x46a1('0x16')](_0x46a1('0x49'),NOW)[_0x46a1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x46a1('0x3d')]()[_0x46a1('0x12')](_0x46a1('0x1d'))[_0x46a1('0x13')]('cm_hopper_black')['where'](_0x46a1('0x4a'),_0x316927)[_0x46a1('0x16')](_0x1e085c+'\x20=\x20?',_0x2c204e+'.'+_0x1e085c)))['toString']();}function insertCmHopperAdditionalPhones(_0x433226){var _0x1ab76b=['cm_hopper.id',_0x46a1('0x4b'),_0x46a1('0x4c'),_0x46a1('0x4d'),_0x46a1('0x4e')];return squel['insert']()[_0x46a1('0x33')](_0x46a1('0x4f'))[_0x46a1('0x35')]([_0x46a1('0x50'),_0x46a1('0x1d'),_0x46a1('0x51'),_0x46a1('0x39'),_0x46a1('0x3a')],squel[_0x46a1('0x3d')]()[_0x46a1('0x3e')](_0x1ab76b)[_0x46a1('0x13')]('cm_hopper')[_0x46a1('0x14')](_0x46a1('0x48'),null,_0x46a1('0x52'))[_0x46a1('0x14')](_0x46a1('0x53'),null,_0x46a1('0x54'))[_0x46a1('0x16')](_0x46a1('0x55'),_0x433226)[_0x46a1('0x16')](_0x46a1('0x49'),NOW))[_0x46a1('0x45')]();}function insertCmContact(_0x12dcb1,_0x20f70f,_0x24f2e6,_0x43aa06){var _0x2febda=_['concat'](_[_0x46a1('0x56')](_0x43aa06),['ListId',_0x46a1('0x57'),_0x46a1('0x39'),_0x46a1('0x3a')]);return squel[_0x46a1('0x32')]()[_0x46a1('0x33')](_0x46a1('0x48'))[_0x46a1('0x35')](_0x2febda,squel[_0x46a1('0x3d')]()[_0x46a1('0x3e')](_0x2febda)[_0x46a1('0x13')](_0x20f70f)['where']('('+_0x24f2e6[_0x46a1('0x14')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x46a1('0x3e')](_0x24f2e6)[_0x46a1('0x13')](_0x46a1('0x48'))[_0x46a1('0x16')]('ListId\x20=\x20?',_0x12dcb1))[_0x46a1('0x16')](_0x46a1('0x58'),squel[_0x46a1('0x3d')]()[_0x46a1('0x12')](_0x46a1('0x59'),_0x46a1('0x5a'))['from'](_0x20f70f)[_0x46a1('0x5b')](_0x24f2e6[_0x46a1('0x14')](','))))[_0x46a1('0x45')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x5ea1e3){logger[_0x46a1('0x21')](_0x5ea1e3['message']);process[_0x46a1('0x5c')](0x1);}function handleError(_0x4622c5,_0x307c14){stats[_0x46a1('0x5d')][_0x46a1('0x1f')]({'name':_0x307c14[_0x46a1('0x5e')],'message':_0x307c14[_0x46a1('0x22')],'row':_0x4622c5});}function handleQuery(_0x4ab457){logger['info'](_0x4ab457);return db[_0x46a1('0x19')][_0x46a1('0x1a')](_0x4ab457)['spread'](function(_0x3888fb){results['push'](_0x3888fb);})[_0x46a1('0x5f')](function(_0x28e744){logger[_0x46a1('0x21')](_0x28e744[_0x46a1('0x22')]);});}function main(_0x354258,_0x134666,_0x1c5732,_0x73e2c4){logger['info'](_0x46a1('0x60'),_0x354258,JSON['stringify'](_0x134666));process['send'](_0x46a1('0x61'));var _0x56c8f7=_0x134666['binding'];var _0x33fdf5=_[_0x46a1('0x62')](_0x56c8f7);var _0x3c62d3=_0x134666[_0x46a1('0x63')];var _0x5393c9=path[_0x46a1('0x14')](config['root'],'server/files/tmp',_0x3c62d3+_0x46a1('0x64'));logger[_0x46a1('0x65')]('body',_0x134666);db['ContactItemType'][_0x46a1('0x66')]({'raw':!![],'attributes':['id',_0x46a1('0x67')]})[_0x46a1('0x20')](function(_0x190095){for(var _0x1ff433=0x0;_0x1ff433<_0x190095[_0x46a1('0x24')];_0x1ff433++){if(_0x190095[_0x1ff433][_0x46a1('0x67')]in _0x56c8f7){contactItemTypes[_0x46a1('0x1f')](_0x190095[_0x1ff433]);delete _0x33fdf5[_0x190095[_0x1ff433][_0x46a1('0x67')]];hasAdditionalPhones=!![];}for(var _0x2abc90 in _0x56c8f7){if(_0x190095[_0x1ff433][_0x46a1('0x67')]+_0x46a1('0x68')===_0x2abc90){phoneDescriptions[_0x46a1('0x1f')]({'itemTypeId':_0x190095[_0x1ff433]['id'],'description':_0x2abc90});delete _0x33fdf5[_0x2abc90];}}}if(hasAdditionalPhones)_0x33fdf5[_0x46a1('0x1e')]='';var _0x26ecd2=_[_0x46a1('0x56')](_0x33fdf5)[_0x46a1('0x14')]();logger[_0x46a1('0x65')](_0x46a1('0x69'),_0x26ecd2);fs[_0x46a1('0x6a')](_0x5393c9,_0x26ecd2+'\x0a');Papa[_0x46a1('0x6b')](fs[_0x46a1('0x6c')](_0x354258),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5e6e06,_0x57de9c){try{for(var _0x5894ab=0x0,_0x4c6a75=[];_0x5894ab<_0x5e6e06['data'][_0x46a1('0x24')];_0x5894ab++){stats[_0x46a1('0x6d')]+=0x1;if(_0x5e6e06[_0x46a1('0x5d')][_0x5894ab]){handleError(_0x5e6e06[_0x46a1('0x6e')][_0x5894ab],_0x5e6e06[_0x46a1('0x5d')][_0x5894ab]);}else{var _0x1c3137=[];var _0x58a585=[];var _0x17586c={};for(var _0x554440 in _0x56c8f7){let _0x17a6f0=contactItemTypes[_0x46a1('0x6f')](_0x20185a=>_0x20185a['name']===_0x554440);let _0x14005d=contactItemTypes[_0x46a1('0x6f')](_0x5aa2f0=>_0x5aa2f0['name']+_0x46a1('0x68')===_0x554440);if(_[_0x46a1('0x1c')](_0x17a6f0)&&_[_0x46a1('0x1c')](_0x14005d)){if(_0x56c8f7[_0x46a1('0x70')](_0x554440)){if(_0x5e6e06['data'][_0x5894ab][_0x56c8f7[_0x554440]]){var _0x18c93a=_[_0x46a1('0x71')](_0x5e6e06[_0x46a1('0x6e')][_0x5894ab][_0x56c8f7[_0x554440]]['replace'](/"/g,'\x27'));switch(_0x554440){case'scheduledat':var _0x362710=moment(_0x18c93a,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x362710[_0x46a1('0x72')]()){_0x4c6a75[_0x46a1('0x1f')]('\x22'+_0x18c93a+'\x22');}else{_0x1c3137['push'](_0x46a1('0x73'));}break;case _0x46a1('0x3b'):var _0x4bb330=parseInt(_0x18c93a);_0x18c93a=_[_0x46a1('0x74')](_0x4bb330)||_0x4bb330<0x0||_0x4bb330>0x4?_0x73e2c4?0x3:0x2:_0x4bb330;_0x4c6a75[_0x46a1('0x1f')]('\x22'+_0x18c93a+'\x22');break;case'UserId':var _0x5bd515=parseInt(_0x18c93a);if(_['isNumber'](_0x5bd515)&&_[_0x46a1('0x75')](_0x1c5732,_0x5bd515)){_0x4c6a75[_0x46a1('0x1f')]('\x22'+_0x5bd515+'\x22');}else{_0x1c3137[_0x46a1('0x1f')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x18c93a)){_0x4c6a75['push']('\x22'+_0x18c93a+'\x22');}else{_0x1c3137[_0x46a1('0x1f')]('email\x20wrong\x20format');}break;case _0x46a1('0x76'):var _0x598841=moment(_0x18c93a,'YYYY-MM-DD',!![]);if(_0x598841[_0x46a1('0x72')]()){_0x4c6a75[_0x46a1('0x1f')]('\x22'+_0x18c93a+'\x22');}else{_0x1c3137[_0x46a1('0x1f')](_0x46a1('0x77'));}break;default:_0x4c6a75[_0x46a1('0x1f')]('\x22'+_0x18c93a+'\x22');}}else{switch(_0x554440){case'firstName':case _0x46a1('0x1d'):_0x1c3137[_0x46a1('0x1f')](_0x554440+_0x46a1('0x78'));break;default:_0x4c6a75[_0x46a1('0x1f')]('\x22\x22');}}}}else{var _0x494673='';if(!_[_0x46a1('0x1c')](_0x17a6f0)){if(!_0x17586c['hasOwnProperty'](_0x17a6f0['id'])){for(var _0x5577f4=0x0;_0x5577f4<_0x56c8f7[_0x554440][_0x46a1('0x24')];_0x5577f4++){var _0x18c93a=_[_0x46a1('0x71')](_0x5e6e06[_0x46a1('0x6e')][_0x5894ab][_0x56c8f7[_0x554440][_0x5577f4]]['replace'](/"/g,'\x27'));var _0x44d790=phoneDescriptions[_0x46a1('0x6f')](_0x8859b8=>_0x8859b8[_0x46a1('0x79')]===_0x17a6f0['id']);if(!_[_0x46a1('0x1c')](_0x44d790)){var _0x50ce5b=_['trim'](_0x5e6e06[_0x46a1('0x6e')][_0x5894ab][_0x56c8f7[_0x44d790[_0x46a1('0x7a')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x46a1('0x1c')](_0x50ce5b))_0x18c93a=_0x18c93a+'§'+_0x50ce5b;}if(_0x494673=='')_0x494673=_0x18c93a;else _0x494673+='|'+_0x18c93a;}_0x58a585[_0x46a1('0x1f')](_0x17a6f0['id']+':'+_0x494673);_0x17586c[_0x17a6f0['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4c6a75['push']('\x22'+_0x58a585[_0x46a1('0x14')](';')+'\x22');}if(_0x1c3137[_0x46a1('0x24')]){handleError(_0x5e6e06[_0x46a1('0x6e')][_0x5894ab],{'code':'SystemRow','message':_0x1c3137[_0x46a1('0x14')]()});}else{fs['appendFileSync'](_0x5393c9,_0x4c6a75['join']()+'\x0a');}_0x4c6a75=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x46a1('0x7b')+_0x3c62d3,stats);stats[_0x46a1('0x5d')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x57de9c[_0x46a1('0x7c')]();}}catch(_0x7f3f99){handleError(_0x5e6e06[_0x46a1('0x6e')][_0x5894ab],{'code':_0x46a1('0x7d'),'message':_0x7f3f99[_0x46a1('0x22')]});logger[_0x46a1('0x21')]('step',_0x7f3f99[_0x46a1('0x22')]);}},'complete':function(){try{var _0x43792d=[];var _0x3b3716=tempTableName;_0x43792d['push']('CREATE\x20TABLE\x20'+_0x3b3716+_0x46a1('0x7e'));logger['info'](_0x46a1('0x7f'),contactItemTypes['length']);var _0x57fed0=util[_0x46a1('0xe')]('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',_0x5393c9,_0x3b3716,_0x26ecd2,_0x134666[_0x46a1('0x38')],_0x134666[_0x46a1('0x57')]||null,NOW,NOW);if(_['isNil'](_0x56c8f7[_0x46a1('0x36')])){_0x57fed0+=_0x46a1('0x80');}_0x43792d[_0x46a1('0x1f')](_0x57fed0);BPromise[_0x46a1('0x81')](_0x43792d,handleQuery)['then'](function(_0x197579){BPromise['all']([handleAdditionalPhones()])[_0x46a1('0x20')](function(){_0x43792d=[];for(var _0x270826=0x0;_0x270826\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.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.disposition','i.thirdDisposition','i.to','i.ContactId','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','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','TagIds','limit','offset','query','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./utils','../../mysqldb','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','where','\x20IN\x20?','map','getInteractionsTables','getAccountFK','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','messages','me.','\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace'];(function(_0x1e5ba9,_0x1ea95c){var _0x336855=function(_0x56d415){while(--_0x56d415){_0x1e5ba9['push'](_0x1e5ba9['shift']());}};_0x336855(++_0x1ea95c);}(_0x9c6f,0x124));var _0xf9c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf9c6('0x0'));var squel=require(_0xf9c6('0x1'));var as=require(_0xf9c6('0x2'));var qs=require(_0xf9c6('0x3'));var updateInteraction=require('./update-interaction')['updateInteraction'];var utils=require(_0xf9c6('0x4'));var db=require(_0xf9c6('0x5'))['db'];function skipInteractionsQuery(_0x285d1a,_0x11590b,_0x3914ec){var _0x1c6cb8=![];var _0x110b30=utils['getAccountFK'](_0x285d1a);if(_0x11590b['role']===_0xf9c6('0x6')&&!_0x3914ec[_0xf9c6('0x7')]&&!_0x3914ec[_0x110b30]){_0x1c6cb8=!![];}return _0x1c6cb8;}function getTagsQuery(){return squel[_0xf9c6('0x8')]()[_0xf9c6('0x9')]('id')[_0xf9c6('0x9')](_0xf9c6('0xa'))['field'](_0xf9c6('0xb'))[_0xf9c6('0xc')](_0xf9c6('0xd'));}function getUsersQuery(_0x255625,_0x29185a){var _0x4ccef4=utils[_0xf9c6('0xe')](_0x255625);var _0x464c5d=_0xf9c6('0xf')+_0x255625+'_interactions';var _0x4fbd31=squel[_0xf9c6('0x8')]()['field'](_0xf9c6('0x10'))[_0xf9c6('0x9')](_0xf9c6('0x11'))[_0xf9c6('0x9')](_0xf9c6('0x12')+_0x4ccef4)[_0xf9c6('0xc')](_0x464c5d,'ui')[_0xf9c6('0x13')](_0xf9c6('0x14'),'u',_0xf9c6('0x15'));if(_0x29185a['length']>0x0){_0x4fbd31[_0xf9c6('0x16')](_0xf9c6('0x12')+_0x4ccef4+_0xf9c6('0x17'),_[_0xf9c6('0x18')](_0x29185a,'id'));}return _0x4fbd31;}function getInteractionsQuery(_0xe81993){var _0x14aa49=utils[_0xf9c6('0x19')](_0xe81993);var _0x2ea8a7=utils[_0xf9c6('0x1a')](_0xe81993);var _0x515017=utils['getInteractionFK'](_0xe81993);return squel['select']()[_0xf9c6('0xc')](_0x14aa49['interactions'],'i')[_0xf9c6('0x13')](_0xf9c6('0x1b'),'c',_0xf9c6('0x1c'))['left_join'](_0xf9c6('0x14'),'o','o.id\x20=\x20i.UserId')[_0xf9c6('0x13')](_0x14aa49[_0xf9c6('0x1d')],'a','a.id\x20=\x20i.'+_0x2ea8a7)[_0xf9c6('0x13')](_0x14aa49[_0xf9c6('0x1e')],'me',_0xf9c6('0x1f')+_0x515017+_0xf9c6('0x20'))[_0xf9c6('0x13')](_0x14aa49['interactionsTags'],'it',_0xf9c6('0x21')+_0x515017+_0xf9c6('0x20'))[_0xf9c6('0x13')](_0xf9c6('0xd'),'t',_0xf9c6('0x22'));}function getSqlClauses(){var _0x456f77={'body':squel[_0xf9c6('0x23')](),'contact':squel[_0xf9c6('0x23')](),'default':squel[_0xf9c6('0x23')](),'fields':squel[_0xf9c6('0x23')](),'filter':squel[_0xf9c6('0x23')](),'read':squel[_0xf9c6('0x23')](),'tags':{'clause':squel[_0xf9c6('0x23')](),'ids':null},'user':squel[_0xf9c6('0x23')]()};return _0x456f77;}function parseTagParameter(_0x17d280){var _0x301d25=squel[_0xf9c6('0x23')]();if(_0x17d280){var _0x54a03b=utils['getSelectedTags'](_0x17d280);_0x54a03b[_0xf9c6('0x24')](function(_0x483e1c){_0x301d25['or'](_0xf9c6('0x25'),'%,'+_0x483e1c+',%');});}return _0x301d25;}function parseReadParameter(_0x12445a){var _0x547c87='';if(_0x12445a){_0x547c87=_0xf9c6('0x26');if(_0x12445a==='1'){_0x547c87=_0x547c87[_0xf9c6('0x27')](_0xf9c6('0x28'),'=');}else{_0x547c87=_0x547c87[_0xf9c6('0x27')]('{OPERATOR}','>');}}return _0x547c87;}function parseSearchFilter(_0x2b8cef,_0x39f2b6){var _0x9e5d5=squel[_0xf9c6('0x23')]();if(_0x39f2b6){var _0x127946=_0x39f2b6[_0xf9c6('0x27')]('\x5c','\x5c\x5c')[_0xf9c6('0x27')](/'/g,'\x27\x27');if(qs[_0xf9c6('0x29')](_0x127946)){_0x9e5d5['or'](_0xf9c6('0x2a'),_0x127946+'%');if([_0xf9c6('0x2b'),_0xf9c6('0x2c')][_0xf9c6('0x2d')](_0x2b8cef)){_0x9e5d5['or']('i.phone\x20LIKE\x20?',_0x127946+'%');}else if(_0x2b8cef===_0xf9c6('0x2e')){_0x9e5d5['or'](_0xf9c6('0x2f'),_0x127946+'%');}else if(_0x2b8cef===_0xf9c6('0x30')){_0x9e5d5['or'](_0xf9c6('0x31'),_0x127946+'%');}}else if(_0x2b8cef===_0xf9c6('0x32')&&qs['isEmail'](_0x127946)){_0x9e5d5['or']('c.email\x20LIKE\x20?',_0x127946+'%');}else{if(_0x2b8cef===_0xf9c6('0x32')){_0x9e5d5['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf9c6('0x33')](_0x127946,!![]))['or'](_0xf9c6('0x34'),qs['getFullTextValue'](_0x127946));}else if(_0x2b8cef!==_0xf9c6('0x2e')){_0x9e5d5['or'](_0xf9c6('0x35'),qs[_0xf9c6('0x33')](_0x127946));}_0x9e5d5['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf9c6('0x33')](_0x127946,!![]),null);}}return _0x9e5d5;}function parseAdvancedSearchFilter(_0x522740,_0x3683de){var _0x43f887=getSqlClauses();var _0x28eee9=as[_0xf9c6('0x36')](_0x522740);var _0x53fa4d=_0x28eee9[_0xf9c6('0x37')];for(var _0x3e0dd6=0x0;_0x3e0dd6<_0x28eee9[_0xf9c6('0x38')]['length'];_0x3e0dd6++){var _0x2ed838=_0x28eee9[_0xf9c6('0x38')][_0x3e0dd6];var _0x378015='i';var _0xf9811f=_[_0xf9c6('0x39')](_0x3683de,[_0xf9c6('0xa'),_0x2ed838[_0xf9c6('0x9')]]);if(_0xf9811f){var _0xd6544b=as['buildExpression'](_0x378015,_0xf9811f['type'],_0x2ed838);_0x43f887[_0xf9c6('0x3a')][_0x53fa4d](_0xd6544b[_0xf9c6('0x3b')],_0xd6544b['value'][_0xf9c6('0x3c')],_0xd6544b['value'][_0xf9c6('0x3d')]);}else{switch(_0x2ed838[_0xf9c6('0x9')]){case _0xf9c6('0x3e'):var _0x1e17d8=parseReadParameter(_0x2ed838['value']);_0x43f887[_0xf9c6('0x3f')][_0xf9c6('0x40')](_0x1e17d8);break;case _0xf9c6('0x41'):if(_0x2ed838[_0xf9c6('0x42')]===_0xf9c6('0x43')){if(_0x2ed838['value'][_0xf9c6('0x44')]('\x20')['length']>0x1){_0x43f887['contact'][_0x53fa4d](_0xf9c6('0x45'),qs['getFullTextValue'](_0x2ed838['value'],!![]),null);}else{var _0x5062eb='%'+_0x2ed838[_0xf9c6('0x46')]+'%';_0x43f887['contact'][_0x53fa4d](_0xf9c6('0x47'),_0x5062eb,_0x5062eb,_0x5062eb);}}else{_0xf9811f=_['find'](_0x3683de,[_0xf9c6('0xa'),_0xf9c6('0x48')]);_0x2ed838[_0xf9c6('0x9')]=_0xf9c6('0x48');_0xd6544b=as[_0xf9c6('0x49')](_0x378015,_0xf9811f[_0xf9c6('0x4a')],_0x2ed838);_0x43f887[_0xf9c6('0x4b')][_0x53fa4d](_0xd6544b['text'],_0xd6544b[_0xf9c6('0x46')][_0xf9c6('0x3c')],_0xd6544b['value'][_0xf9c6('0x3d')]);}break;case _0xf9c6('0x4c'):var _0x1958f=_0x2ed838[_0xf9c6('0x46')][_0xf9c6('0x44')](',')[_0xf9c6('0x18')](function(_0x121448){return Number(_0x121448);});var _0x186cd7=parseTagParameter(_0x1958f);_0x43f887[_0xf9c6('0x4d')][_0xf9c6('0x4e')][_0xf9c6('0x40')](_0x186cd7);_0x43f887[_0xf9c6('0x4d')]['ids']=_0x1958f;break;case'User':if(_0x2ed838['operator']===_0xf9c6('0x43')){_0x43f887[_0xf9c6('0x4f')][_0x53fa4d](_0xf9c6('0x50'),'%'+_0x2ed838[_0xf9c6('0x46')]+'%',null);}else{_0xf9811f=_[_0xf9c6('0x39')](_0x3683de,['name',_0xf9c6('0x51')]);_0x2ed838[_0xf9c6('0x9')]=_0xf9c6('0x51');_0xd6544b=as['buildExpression'](_0x378015,_0xf9811f[_0xf9c6('0x4a')],_0x2ed838);_0x43f887[_0xf9c6('0x4f')][_0x53fa4d](_0xd6544b['text'],_0xd6544b[_0xf9c6('0x46')][_0xf9c6('0x3c')],_0xd6544b[_0xf9c6('0x46')]['end']);}break;case _0xf9c6('0x52'):case'plainBody':_0xd6544b=as[_0xf9c6('0x49')]('me',null,_0x2ed838);_0x43f887[_0xf9c6('0x52')][_0x53fa4d](_0xd6544b[_0xf9c6('0x3b')],_0xd6544b['value'][_0xf9c6('0x3c')],_0xd6544b[_0xf9c6('0x46')][_0xf9c6('0x3d')]);break;}}}return _0x43f887;}function parseModelFields(_0x2ec999,_0x20e7d7,_0x295984){var _0x2b1d58=utils[_0xf9c6('0x1a')](_0x2ec999);var _0x2da2ad=squel[_0xf9c6('0x23')]();var _0x34ab87=_(_0x20e7d7)[_0xf9c6('0x53')]()['map'](function(_0x4c53b0){return _['some'](_0x295984,[_0xf9c6('0xa'),_0x4c53b0])?_0x4c53b0:undefined;})[_0xf9c6('0x54')]()[_0xf9c6('0x46')]();if(_0x34ab87[_0xf9c6('0x55')]>0x0){_0x34ab87[_0xf9c6('0x24')](function(_0x11da94){if(_0x11da94===_0x2b1d58){_0x2da2ad['and']('i.'+_0x2b1d58+'\x20IN\x20?',[][_0xf9c6('0x56')](_0x20e7d7[_0x11da94]));}else if(_0x11da94===_0xf9c6('0x57')){var _0x31b478=JSON[_0xf9c6('0x58')](_0x20e7d7[_0x11da94])[_0xf9c6('0x59')];var _0x45f1be=JSON['parse'](_0x20e7d7[_0x11da94])[_0xf9c6('0x5a')];_0x2da2ad[_0xf9c6('0x40')](_0xf9c6('0x5b'),_0x31b478,_0x45f1be);}else{if(_0x20e7d7[_0x11da94]===_0xf9c6('0x5c')){_0x2da2ad['and']('i.'+_0x11da94+_0xf9c6('0x5d'));}else{_0x2da2ad['and']('i.'+_0x11da94+'\x20=\x20?',_0x20e7d7[_0x11da94]);}}});}return _0x2da2ad;}function parseQueryParameters(_0xd0d3c7,_0x2a2b6d,_0x168565){var _0xb27637=getSqlClauses();return Promise['resolve']()[_0xf9c6('0x5e')](function(){return parseModelFields(_0xd0d3c7,_0x2a2b6d,_0x168565);})[_0xf9c6('0x5e')](function(_0x24226e){_0xb27637['fields'][_0xf9c6('0x40')](_0x24226e);return parseReadParameter(_0x2a2b6d[_0xf9c6('0x3f')]);})['then'](function(_0x5cd4b8){_0xb27637[_0xf9c6('0x3f')][_0xf9c6('0x40')](_0x5cd4b8);return parseTagParameter(_0x2a2b6d[_0xf9c6('0x5f')]);})['then'](function(_0x319d3d){_0xb27637['tags'][_0xf9c6('0x4e')][_0xf9c6('0x40')](_0x319d3d);return parseSearchFilter(_0xd0d3c7,_0x2a2b6d[_0xf9c6('0x60')]);})[_0xf9c6('0x5e')](function(_0x56826a){_0xb27637[_0xf9c6('0x60')]=_0x56826a;return _0xb27637;});}function checkAccountsRestrictions(_0x21eeff,_0x1d5680,_0x5a568a){var _0x81add2=utils[_0xf9c6('0x1a')](_0x21eeff);var _0x519ab8=_0xf9c6('0x61')+_['capitalize'](_0x21eeff)+(_0x21eeff==='chat'?_0xf9c6('0x62'):_0xf9c6('0x63'));var _0x252fd1=squel['expr']();return Promise[_0xf9c6('0x64')]()[_0xf9c6('0x5e')](function(){if(_0x5a568a[_0xf9c6('0x7')]&&_0x1d5680[_0xf9c6('0x65')]==='agent'){return _0x1d5680[_0x519ab8]({'attributes':['id'],'raw':!![]});}})[_0xf9c6('0x5e')](function(_0x1a79c6){if(_0x1a79c6){if(_0x1a79c6[_0xf9c6('0x55')]===0x0){_0x252fd1['and']('i.'+_0x81add2+_0xf9c6('0x5d'));}else{_0x252fd1[_0xf9c6('0x40')]('i.'+_0x81add2+'\x20IN\x20?',_[_0xf9c6('0x18')](_0x1a79c6,'id'));}}else if(!_0x5a568a[_0x81add2]){_0x252fd1[_0xf9c6('0x40')]('i.'+_0x81add2+'\x20IS\x20NOT\x20NULL');}})[_0xf9c6('0x5e')](function(){return _0x252fd1;});}function getClosedOrderClause(_0x1e3bcd,_0x445bc6){var _0x4a6cf0='';var _0x1c3392=['i.thirdDisposition',_0xf9c6('0x66'),'i.disposition'];if(_0x1e3bcd===_0xf9c6('0x32')){_0x1c3392['unshift'](_0xf9c6('0x67'));}if(_0x445bc6['closed']==='0'&&_0x1e3bcd===_0xf9c6('0x32')){_0x4a6cf0=_0xf9c6('0x67');}else{if(_0x445bc6[_0xf9c6('0x68')]==='1'){_0x1c3392[_0xf9c6('0x69')]();}_0x4a6cf0=_0xf9c6('0x6a')+_0x1c3392[_0xf9c6('0x6b')](',\x20')+')';}return _0x4a6cf0;}function getFilteredInteractions(_0x54dbaf,_0x231171,_0x550e16,_0x32133){var _0x2322af=utils[_0xf9c6('0xe')](_0x54dbaf);var _0x357d2c=_['capitalize'](_0x54dbaf)+_0xf9c6('0x6c');var _0x2ca101=[];var _0x42be4c=getTagsQuery();var _0x3db6ec={'type':db[_0xf9c6('0x6d')]['QueryTypes'][_0xf9c6('0x6e')],'raw':!![]};var _0x208e61=[];var _0x5b4dd4=[];return db[_0xf9c6('0x6f')]['query'](_0x42be4c[_0xf9c6('0x70')](),_0x3db6ec)[_0xf9c6('0x5e')](function(_0x5990bb){_0x2ca101=_[_0xf9c6('0x71')](_0x5990bb,'id');_0x3db6ec=_[_0xf9c6('0x72')](_0x3db6ec,{'model':db[_0x357d2c],'mapToModel':!![],'nest':!![]});if(_0x550e16[_0xf9c6('0x73')]){_0x32133[_0xf9c6('0x74')][_0xf9c6('0x24')](function(_0x357031){_0x231171['field']('i.'+_0x357031);});}else{_0x231171['field'](_0xf9c6('0x75'),_0xf9c6('0x3e'));_0x231171['field'](_0xf9c6('0x76'),'Account.key');_0x231171[_0xf9c6('0x9')](_0xf9c6('0x77'),_0xf9c6('0x78'));if(_0x54dbaf===_0xf9c6('0x32')){_0x231171[_0xf9c6('0x9')](_0xf9c6('0x79'),_0xf9c6('0x7a'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x7b'),_0xf9c6('0x7c'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x7d'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x7e'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x7f'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x80'));_0x231171['field'](_0xf9c6('0x81'));_0x231171[_0xf9c6('0x9')]('i.attach');_0x231171['field']('i.lastMsgAt');_0x231171['field']('i.lastMsgDirection');_0x231171[_0xf9c6('0x9')]('i.subject');_0x231171['field'](_0xf9c6('0x82'));_0x231171[_0xf9c6('0x9')]('i.secondDisposition');_0x231171[_0xf9c6('0x9')](_0xf9c6('0x83'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x67'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x84'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x85'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x86'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x87'));}else if(_0x54dbaf===_0xf9c6('0x30')){_0x231171[_0xf9c6('0x9')](_0xf9c6('0x88'),'contactName');}else{_0x231171['field'](_0xf9c6('0x89'),_0xf9c6('0x7c'));}if(_0x54dbaf!==_0xf9c6('0x32')){_0x231171[_0xf9c6('0x9')](_0xf9c6('0x8a'));}_0x231171[_0xf9c6('0x9')](_0xf9c6('0x8b'),_0xf9c6('0x8c'));_0x231171['field'](_0xf9c6('0x8d'),_0xf9c6('0x8e'));_0x231171['field']('c.email',_0xf9c6('0x8f'));_0x231171[_0xf9c6('0x9')]('c.phone','Contact.phone');_0x231171[_0xf9c6('0x9')](_0xf9c6('0x90'),_0xf9c6('0x91'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x92'),_0xf9c6('0x93'));_0x231171[_0xf9c6('0x9')](_0xf9c6('0x94'),'Owner.fullname');_0x231171['field'](_0xf9c6('0x95'),'Owner.internal');_0x231171[_0xf9c6('0x9')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf9c6('0x96'));}if(_0x32133[_0xf9c6('0x97')]){_0x231171[_0xf9c6('0x97')](_0x32133['limit']);}if(_0x32133[_0xf9c6('0x98')]){_0x231171[_0xf9c6('0x98')](_0x32133['offset']);}return db[_0xf9c6('0x6f')][_0xf9c6('0x99')](_0x231171['toString'](),_0x3db6ec);})[_0xf9c6('0x5e')](function(_0x26fccb){_0x208e61=_0x26fccb;var _0x2b7bfa=getUsersQuery(_0x54dbaf,_0x208e61);return db[_0xf9c6('0x6f')][_0xf9c6('0x99')](_0x2b7bfa[_0xf9c6('0x70')](),_0x3db6ec);})['then'](function(_0x32a139){_0x5b4dd4=_[_0xf9c6('0x9a')](_0x32a139,_0x2322af);if(_0x54dbaf===_0xf9c6('0x32')){return db[_0xf9c6('0x9b')][_0xf9c6('0x9c')]({'attributes':[_0xf9c6('0x9d')],'raw':!![]});}})[_0xf9c6('0x5e')](function(_0x1de807){var _0x37e3ff=_0x1de807?_0x1de807[_0xf9c6('0x9d')]:undefined;var _0x65bae6=_0x208e61[_0xf9c6('0x18')](function(_0xd75d77){return updateInteraction(_0xd75d77,_0x2ca101,_0x5b4dd4,_0x37e3ff);});return Promise[_0xf9c6('0x9e')](_0x65bae6);});}function countFilteredInteractions(_0xd5de05,_0x1c5f68){var _0x40cb88=_0xd5de05[_0xf9c6('0x9f')]();_0x40cb88[_0xf9c6('0x9')](_0xf9c6('0xa0'));_0x40cb88['field'](_0xf9c6('0x75'),_0xf9c6('0x3e'));var _0x4253a2=utils[_0xf9c6('0xa1')](_0x1c5f68);if(!_[_0xf9c6('0xa2')](_0x4253a2)){_0x40cb88[_0xf9c6('0x16')](_0xf9c6('0xa3'),_0x4253a2);}var _0x5b78fb={'type':db['Sequelize'][_0xf9c6('0xa4')][_0xf9c6('0x6e')],'raw':!![]};return db[_0xf9c6('0x6f')][_0xf9c6('0x99')](_0x40cb88['toString'](),_0x5b78fb);}module[_0xf9c6('0xa5')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x9998=['null','\x20=\x20?','resolve','then','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','closed','CONCAT_WS(\x27\x27,\x20','join','Interaction','QueryTypes','SELECT','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','Account.mandatoryDisposition','a.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','contactName','i.id','i.createdAt','i.updatedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','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','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','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','sequelize','groupBy','Setting','findOne','enableEmailPreview','all','getSelectedTags','isEmpty','exports','lodash','squel','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','field','name','color','user_has_','_interactions','select','u.fullname','ui.','from','left_join','u.id\x20=\x20ui.UserId','where','\x20IN\x20?','map','getInteractionFK','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','me.','it.','tools_tags','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','i.phone\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','fax','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','length','find','type','default','text','value','start','read','Contact','operator','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','tags','clause','and','ids','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','end','body','plainBody','keys','some','compact','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x450c59,_0x5937ba){var _0x1fd20f=function(_0x141080){while(--_0x141080){_0x450c59['push'](_0x450c59['shift']());}};_0x1fd20f(++_0x5937ba);}(_0x9998,0xea));var _0x8999=function(_0x41594a,_0x4d14e8){_0x41594a=_0x41594a-0x0;var _0x33584f=_0x9998[_0x41594a];return _0x33584f;};'use strict';var _=require(_0x8999('0x0'));var squel=require(_0x8999('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x8999('0x2'));var updateInteraction=require('./update-interaction')[_0x8999('0x3')];var utils=require(_0x8999('0x4'));var db=require(_0x8999('0x5'))['db'];function skipInteractionsQuery(_0x3fdb69,_0x40df96,_0x4e5305){var _0x43e7d6=![];var _0x23dbb6=utils[_0x8999('0x6')](_0x3fdb69);if(_0x40df96[_0x8999('0x7')]===_0x8999('0x8')&&!_0x4e5305[_0x8999('0x9')]&&!_0x4e5305[_0x23dbb6]){_0x43e7d6=!![];}return _0x43e7d6;}function getTagsQuery(){return squel['select']()[_0x8999('0xa')]('id')[_0x8999('0xa')](_0x8999('0xb'))['field'](_0x8999('0xc'))['from']('tools_tags');}function getUsersQuery(_0x500074,_0xe1b309){var _0x6973cd=utils['getInteractionFK'](_0x500074);var _0x17d95c=_0x8999('0xd')+_0x500074+_0x8999('0xe');var _0x54a03d=squel[_0x8999('0xf')]()['field']('u.id')['field'](_0x8999('0x10'))[_0x8999('0xa')](_0x8999('0x11')+_0x6973cd)[_0x8999('0x12')](_0x17d95c,'ui')[_0x8999('0x13')]('users','u',_0x8999('0x14'));if(_0xe1b309['length']>0x0){_0x54a03d[_0x8999('0x15')](_0x8999('0x11')+_0x6973cd+_0x8999('0x16'),_[_0x8999('0x17')](_0xe1b309,'id'));}return _0x54a03d;}function getInteractionsQuery(_0x103436){var _0x5a9b8e=utils['getInteractionsTables'](_0x103436);var _0x38fba0=utils[_0x8999('0x6')](_0x103436);var _0x1a3710=utils[_0x8999('0x18')](_0x103436);return squel[_0x8999('0xf')]()[_0x8999('0x12')](_0x5a9b8e[_0x8999('0x19')],'i')['left_join']('cm_contacts','c',_0x8999('0x1a'))['left_join'](_0x8999('0x1b'),'o',_0x8999('0x1c'))[_0x8999('0x13')](_0x5a9b8e['accounts'],'a',_0x8999('0x1d')+_0x38fba0)['left_join'](_0x5a9b8e[_0x8999('0x1e')],'me',_0x8999('0x1f')+_0x1a3710+'\x20=\x20i.id')[_0x8999('0x13')](_0x5a9b8e['interactionsTags'],'it',_0x8999('0x20')+_0x1a3710+'\x20=\x20i.id')[_0x8999('0x13')](_0x8999('0x21'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x1f9d4e={'body':squel[_0x8999('0x22')](),'contact':squel[_0x8999('0x22')](),'default':squel[_0x8999('0x22')](),'fields':squel['expr'](),'filter':squel[_0x8999('0x22')](),'read':squel[_0x8999('0x22')](),'tags':{'clause':squel[_0x8999('0x22')](),'ids':null},'user':squel['expr']()};return _0x1f9d4e;}function parseTagParameter(_0x1d0ee9){var _0x2b445e=squel[_0x8999('0x22')]();if(_0x1d0ee9){var _0x1b997c=utils['getSelectedTags'](_0x1d0ee9);_0x1b997c['forEach'](function(_0x5aa860){_0x2b445e['or'](_0x8999('0x23'),'%,'+_0x5aa860+',%');});}return _0x2b445e;}function parseReadParameter(_0x4e12f7){var _0x36f89b='';if(_0x4e12f7){_0x36f89b=_0x8999('0x24');if(_0x4e12f7==='1'){_0x36f89b=_0x36f89b['replace'](_0x8999('0x25'),'=');}else{_0x36f89b=_0x36f89b[_0x8999('0x26')](_0x8999('0x25'),'>');}}return _0x36f89b;}function parseSearchFilter(_0x1b4c4c,_0x352cc9){var _0x3963e1=squel[_0x8999('0x22')]();if(_0x352cc9){var _0x4596c8=_0x352cc9['replace']('\x5c','\x5c\x5c')[_0x8999('0x26')](/'/g,'\x27\x27');if(qs[_0x8999('0x27')](_0x4596c8)){_0x3963e1['or'](_0x8999('0x28'),_0x4596c8+'%');if([_0x8999('0x29'),'whatsapp']['includes'](_0x1b4c4c)){_0x3963e1['or'](_0x8999('0x2a'),_0x4596c8+'%');}else if(_0x1b4c4c==='fax'){_0x3963e1['or']('i.fax\x20LIKE\x20?',_0x4596c8+'%');}else if(_0x1b4c4c===_0x8999('0x2b')){_0x3963e1['or'](_0x8999('0x2c'),_0x4596c8+'%');}}else if(_0x1b4c4c===_0x8999('0x2d')&&qs[_0x8999('0x2e')](_0x4596c8)){_0x3963e1['or']('c.email\x20LIKE\x20?',_0x4596c8+'%');}else{if(_0x1b4c4c===_0x8999('0x2d')){_0x3963e1['or'](_0x8999('0x2f'),qs[_0x8999('0x30')](_0x4596c8,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8999('0x30')](_0x4596c8));}else if(_0x1b4c4c!==_0x8999('0x31')){_0x3963e1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8999('0x30')](_0x4596c8));}_0x3963e1['or'](_0x8999('0x32'),qs['getFullTextValue'](_0x4596c8,!![]),null);}}return _0x3963e1;}function parseAdvancedSearchFilter(_0x21addd,_0x1a4730){var _0x3cecb4=getSqlClauses();var _0x16fdb2=as[_0x8999('0x33')](_0x21addd);var _0x47bda8=_0x16fdb2[_0x8999('0x34')];for(var _0xf97bf5=0x0;_0xf97bf5<_0x16fdb2[_0x8999('0x35')][_0x8999('0x36')];_0xf97bf5++){var _0x149758=_0x16fdb2[_0x8999('0x35')][_0xf97bf5];var _0x3ee6dd='i';var _0x630ad3=_[_0x8999('0x37')](_0x1a4730,['name',_0x149758[_0x8999('0xa')]]);if(_0x630ad3){var _0x16e20c=as['buildExpression'](_0x3ee6dd,_0x630ad3[_0x8999('0x38')],_0x149758);_0x3cecb4[_0x8999('0x39')][_0x47bda8](_0x16e20c[_0x8999('0x3a')],_0x16e20c[_0x8999('0x3b')][_0x8999('0x3c')],_0x16e20c['value']['end']);}else{switch(_0x149758[_0x8999('0xa')]){case'unreadMessages':var _0x25a694=parseReadParameter(_0x149758['value']);_0x3cecb4[_0x8999('0x3d')]['and'](_0x25a694);break;case _0x8999('0x3e'):if(_0x149758[_0x8999('0x3f')]===_0x8999('0x40')){if(_0x149758[_0x8999('0x3b')]['split']('\x20')[_0x8999('0x36')]>0x1){_0x3cecb4['contact'][_0x47bda8](_0x8999('0x32'),qs['getFullTextValue'](_0x149758[_0x8999('0x3b')],!![]),null);}else{var _0x4566ea='%'+_0x149758[_0x8999('0x3b')]+'%';_0x3cecb4[_0x8999('0x41')][_0x47bda8](_0x8999('0x42'),_0x4566ea,_0x4566ea,_0x4566ea);}}else{_0x630ad3=_['find'](_0x1a4730,[_0x8999('0xb'),'ContactId']);_0x149758[_0x8999('0xa')]=_0x8999('0x43');_0x16e20c=as[_0x8999('0x44')](_0x3ee6dd,_0x630ad3[_0x8999('0x38')],_0x149758);_0x3cecb4['contact'][_0x47bda8](_0x16e20c[_0x8999('0x3a')],_0x16e20c[_0x8999('0x3b')]['start'],_0x16e20c[_0x8999('0x3b')]['end']);}break;case'Tag':var _0x5720c6=_0x149758['value']['split'](',')[_0x8999('0x17')](function(_0x1c9f61){return Number(_0x1c9f61);});var _0x4ebdba=parseTagParameter(_0x5720c6);_0x3cecb4[_0x8999('0x45')][_0x8999('0x46')][_0x8999('0x47')](_0x4ebdba);_0x3cecb4[_0x8999('0x45')][_0x8999('0x48')]=_0x5720c6;break;case'User':if(_0x149758['operator']===_0x8999('0x40')){_0x3cecb4['user'][_0x47bda8](_0x8999('0x49'),'%'+_0x149758['value']+'%',null);}else{_0x630ad3=_[_0x8999('0x37')](_0x1a4730,['name',_0x8999('0x4a')]);_0x149758[_0x8999('0xa')]='UserId';_0x16e20c=as[_0x8999('0x44')](_0x3ee6dd,_0x630ad3[_0x8999('0x38')],_0x149758);_0x3cecb4[_0x8999('0x4b')][_0x47bda8](_0x16e20c[_0x8999('0x3a')],_0x16e20c['value'][_0x8999('0x3c')],_0x16e20c['value'][_0x8999('0x4c')]);}break;case _0x8999('0x4d'):case _0x8999('0x4e'):_0x16e20c=as[_0x8999('0x44')]('me',null,_0x149758);_0x3cecb4['body'][_0x47bda8](_0x16e20c[_0x8999('0x3a')],_0x16e20c[_0x8999('0x3b')][_0x8999('0x3c')],_0x16e20c[_0x8999('0x3b')][_0x8999('0x4c')]);break;}}}return _0x3cecb4;}function parseModelFields(_0x19f426,_0x2143c8,_0x3e80d3){var _0x1fb888=utils[_0x8999('0x6')](_0x19f426);var _0x31289b=squel['expr']();var _0x5597e4=_(_0x2143c8)[_0x8999('0x4f')]()[_0x8999('0x17')](function(_0x54d95e){return _[_0x8999('0x50')](_0x3e80d3,['name',_0x54d95e])?_0x54d95e:undefined;})[_0x8999('0x51')]()[_0x8999('0x3b')]();if(_0x5597e4[_0x8999('0x36')]>0x0){_0x5597e4['forEach'](function(_0x2e496f){if(_0x2e496f===_0x1fb888){_0x31289b[_0x8999('0x47')]('i.'+_0x1fb888+'\x20IN\x20?',[][_0x8999('0x52')](_0x2143c8[_0x2e496f]));}else if(_0x2e496f==='createdAt'){var _0x6d64f2=JSON[_0x8999('0x53')](_0x2143c8[_0x2e496f])['$gte'];var _0x4277ff=JSON['parse'](_0x2143c8[_0x2e496f])[_0x8999('0x54')];_0x31289b['and'](_0x8999('0x55'),_0x6d64f2,_0x4277ff);}else{if(_0x2143c8[_0x2e496f]===_0x8999('0x56')){_0x31289b[_0x8999('0x47')]('i.'+_0x2e496f+'\x20IS\x20NULL');}else{_0x31289b[_0x8999('0x47')]('i.'+_0x2e496f+_0x8999('0x57'),_0x2143c8[_0x2e496f]);}}});}return _0x31289b;}function parseQueryParameters(_0x183cb5,_0xa21e1d,_0x104d9a){var _0x4fed30=getSqlClauses();return Promise[_0x8999('0x58')]()[_0x8999('0x59')](function(){return parseModelFields(_0x183cb5,_0xa21e1d,_0x104d9a);})['then'](function(_0x2f256c){_0x4fed30['fields'][_0x8999('0x47')](_0x2f256c);return parseReadParameter(_0xa21e1d['read']);})[_0x8999('0x59')](function(_0x3c9d4b){_0x4fed30[_0x8999('0x3d')]['and'](_0x3c9d4b);return parseTagParameter(_0xa21e1d[_0x8999('0x5a')]);})['then'](function(_0x2e0232){_0x4fed30[_0x8999('0x45')]['clause'][_0x8999('0x47')](_0x2e0232);return parseSearchFilter(_0x183cb5,_0xa21e1d[_0x8999('0x5b')]);})[_0x8999('0x59')](function(_0x4faea3){_0x4fed30['filter']=_0x4faea3;return _0x4fed30;});}function checkAccountsRestrictions(_0x59d83d,_0x174ef0,_0x3b61f3){var _0xebbcd=utils[_0x8999('0x6')](_0x59d83d);var _0x3a9714=_0x8999('0x5c')+_[_0x8999('0x5d')](_0x59d83d)+(_0x59d83d===_0x8999('0x5e')?_0x8999('0x5f'):_0x8999('0x60'));var _0x5c358e=squel[_0x8999('0x22')]();return Promise[_0x8999('0x58')]()[_0x8999('0x59')](function(){if(_0x3b61f3['search']&&_0x174ef0[_0x8999('0x7')]===_0x8999('0x8')){return _0x174ef0[_0x3a9714]({'attributes':['id'],'raw':!![]});}})[_0x8999('0x59')](function(_0x3add38){if(_0x3add38){if(_0x3add38[_0x8999('0x36')]===0x0){_0x5c358e[_0x8999('0x47')]('i.'+_0xebbcd+_0x8999('0x61'));}else{_0x5c358e[_0x8999('0x47')]('i.'+_0xebbcd+_0x8999('0x16'),_[_0x8999('0x17')](_0x3add38,'id'));}}else if(!_0x3b61f3[_0xebbcd]){_0x5c358e[_0x8999('0x47')]('i.'+_0xebbcd+_0x8999('0x62'));}})[_0x8999('0x59')](function(){return _0x5c358e;});}function getClosedOrderClause(_0x37d4a5,_0x153e28){var _0x305779='';var _0x3740bf=[_0x8999('0x63'),_0x8999('0x64'),_0x8999('0x65')];if(_0x37d4a5===_0x8999('0x2d')){_0x3740bf[_0x8999('0x66')]('i.substatus');}if(_0x153e28[_0x8999('0x67')]==='0'&&_0x37d4a5==='mail'){_0x305779='i.substatus';}else{if(_0x153e28[_0x8999('0x67')]==='1'){_0x3740bf['shift']();}_0x305779=_0x8999('0x68')+_0x3740bf[_0x8999('0x69')](',\x20')+')';}return _0x305779;}function getFilteredInteractions(_0x2ada72,_0x589feb,_0x1226fc,_0x294eac){var _0x2f57d4=utils[_0x8999('0x18')](_0x2ada72);var _0x3a82cf=_[_0x8999('0x5d')](_0x2ada72)+_0x8999('0x6a');var _0x4fe7c7=[];var _0x1c0461=getTagsQuery();var _0x12efcb={'type':db['Sequelize'][_0x8999('0x6b')][_0x8999('0x6c')],'raw':!![]};var _0x4e7386=[];var _0x5cc434=[];return db['sequelize']['query'](_0x1c0461[_0x8999('0x6d')](),_0x12efcb)['then'](function(_0x3dfc4f){_0x4fe7c7=_[_0x8999('0x6e')](_0x3dfc4f,'id');_0x12efcb=_[_0x8999('0x6f')](_0x12efcb,{'model':db[_0x3a82cf],'mapToModel':!![],'nest':!![]});if(_0x1226fc['fields']){_0x294eac[_0x8999('0x70')]['forEach'](function(_0x18e7ae){_0x589feb[_0x8999('0xa')]('i.'+_0x18e7ae);});}else{_0x589feb[_0x8999('0xa')](_0x8999('0x71'),_0x8999('0x72'));_0x589feb[_0x8999('0xa')](_0x8999('0x73'),_0x8999('0x74'));_0x589feb['field']('a.mandatoryDisposition',_0x8999('0x75'));if(_0x2ada72===_0x8999('0x2d')){_0x589feb['field'](_0x8999('0x76'),'Account.email');_0x589feb['field'](_0x8999('0x77'),_0x8999('0x78'));_0x589feb[_0x8999('0xa')](_0x8999('0x79'));_0x589feb[_0x8999('0xa')](_0x8999('0x7a'));_0x589feb[_0x8999('0xa')](_0x8999('0x7b'));_0x589feb['field']('i.closed');_0x589feb[_0x8999('0xa')]('i.closedAt');_0x589feb[_0x8999('0xa')](_0x8999('0x7c'));_0x589feb['field'](_0x8999('0x7d'));_0x589feb[_0x8999('0xa')](_0x8999('0x7e'));_0x589feb[_0x8999('0xa')](_0x8999('0x7f'));_0x589feb['field'](_0x8999('0x65'));_0x589feb[_0x8999('0xa')](_0x8999('0x64'));_0x589feb[_0x8999('0xa')](_0x8999('0x63'));_0x589feb[_0x8999('0xa')]('i.substatus');_0x589feb[_0x8999('0xa')](_0x8999('0x80'));_0x589feb[_0x8999('0xa')](_0x8999('0x81'));_0x589feb[_0x8999('0xa')]('i.MailAccountId');_0x589feb[_0x8999('0xa')](_0x8999('0x82'));}else if(_0x2ada72===_0x8999('0x2b')){_0x589feb[_0x8999('0xa')](_0x8999('0x83'),'contactName');}else{_0x589feb[_0x8999('0xa')](_0x8999('0x84'),_0x8999('0x78'));}if(_0x2ada72!=='mail'){_0x589feb[_0x8999('0xa')]('i.*');}_0x589feb[_0x8999('0xa')](_0x8999('0x85'),'Contact.firstName');_0x589feb[_0x8999('0xa')](_0x8999('0x86'),_0x8999('0x87'));_0x589feb[_0x8999('0xa')]('c.email',_0x8999('0x88'));_0x589feb[_0x8999('0xa')](_0x8999('0x89'),_0x8999('0x8a'));_0x589feb[_0x8999('0xa')](_0x8999('0x8b'),_0x8999('0x8c'));_0x589feb[_0x8999('0xa')](_0x8999('0x8d'),'Contact.fax');_0x589feb['field'](_0x8999('0x8e'),_0x8999('0x8f'));_0x589feb[_0x8999('0xa')](_0x8999('0x90'),_0x8999('0x91'));_0x589feb[_0x8999('0xa')](_0x8999('0x92'),_0x8999('0x93'));}if(_0x294eac[_0x8999('0x94')]){_0x589feb[_0x8999('0x94')](_0x294eac['limit']);}if(_0x294eac['offset']){_0x589feb[_0x8999('0x95')](_0x294eac[_0x8999('0x95')]);}return db['sequelize'][_0x8999('0x96')](_0x589feb[_0x8999('0x6d')](),_0x12efcb);})[_0x8999('0x59')](function(_0x16de42){_0x4e7386=_0x16de42;var _0x192836=getUsersQuery(_0x2ada72,_0x4e7386);return db[_0x8999('0x97')][_0x8999('0x96')](_0x192836[_0x8999('0x6d')](),_0x12efcb);})[_0x8999('0x59')](function(_0xdb7230){_0x5cc434=_[_0x8999('0x98')](_0xdb7230,_0x2f57d4);if(_0x2ada72===_0x8999('0x2d')){return db[_0x8999('0x99')][_0x8999('0x9a')]({'attributes':[_0x8999('0x9b')],'raw':!![]});}})[_0x8999('0x59')](function(_0x2ca91f){var _0x30dc13=_0x2ca91f?_0x2ca91f[_0x8999('0x9b')]:undefined;var _0x34f285=_0x4e7386['map'](function(_0x425605){return updateInteraction(_0x425605,_0x4fe7c7,_0x5cc434,_0x30dc13);});return Promise[_0x8999('0x9c')](_0x34f285);});}function countFilteredInteractions(_0x4bf537,_0xb7cb1c){var _0x1c8a07=_0x4bf537['clone']();_0x1c8a07['field']('COUNT(*)');_0x1c8a07[_0x8999('0xa')](_0x8999('0x71'),_0x8999('0x72'));var _0x168098=utils[_0x8999('0x9d')](_0xb7cb1c);if(!_[_0x8999('0x9e')](_0x168098)){_0x1c8a07[_0x8999('0x15')]('t.id\x20IN\x20?',_0x168098);}var _0x3715d7={'type':db['Sequelize'][_0x8999('0x6b')][_0x8999('0x6c')],'raw':!![]};return db[_0x8999('0x97')]['query'](_0x1c8a07['toString'](),_0x3715d7);}module[_0x8999('0x9f')]={'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 643c5ed..da7a90e 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 _0x70a6=['findOne','plainBody','-id','then','lastMsgText','Users','TagIds','Tags','catch','../../mysqldb','map','fullname','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage'];(function(_0x1ec65f,_0x38da27){var _0x1cb086=function(_0xdd3ee3){while(--_0xdd3ee3){_0x1ec65f['push'](_0x1ec65f['shift']());}};_0x1cb086(++_0x38da27);}(_0x70a6,0x189));var _0x670a=function(_0x5c192e,_0xa60113){_0x5c192e=_0x5c192e-0x0;var _0x3f37a1=_0x70a6[_0x5c192e];return _0x3f37a1;};'use strict';var _=require('lodash');var db=require(_0x670a('0x0'))['db'];function getInteractionUsers(_0x162388,_0x4f5deb){return new Promise(function(_0x29a627,_0x4adc13){try{var _0x2eaa60=[];if(_0x4f5deb[_0x162388]){_0x2eaa60=_0x4f5deb[_0x162388][_0x670a('0x1')](function(_0x25d415){return{'id':_0x25d415['id'],'fullname':_0x25d415[_0x670a('0x2')]};});}return _0x29a627(_0x2eaa60);}catch(_0x4406a3){_0x4adc13(_0x4406a3);}});}function getInteractionTags(_0x19aaec,_0x543fd0){var _0x9405da=[];if(_0x19aaec){_0x19aaec['split'](',')[_0x670a('0x3')](function(_0x5650a2){_0x9405da[_0x670a('0x4')](_0x543fd0[_0x5650a2]);});}return _0x9405da;}function updateWaitingCounter(_0x29b4b9){if(_0x29b4b9[_0x670a('0x5')]){_0x29b4b9[_0x670a('0x5')]-=0x1;}}function updateInteractionCounters(_0x25871d){_0x25871d[_0x670a('0x5')]=0x0;_0x25871d[_0x670a('0x6')]=0x0;_0x25871d[_0x670a('0x7')]=0x0;_0x25871d[_0x670a('0x8')]=0x0;_0x25871d[_0x670a('0x9')]=0x0;_0x25871d[_0x670a('0xa')]=0x0;if(_0x25871d[_0x670a('0xb')]){if(_0x25871d[_0x670a('0xc')]==='abandoned'){_0x25871d[_0x670a('0x9')]+=0x1;updateWaitingCounter(_0x25871d);}if(_0x25871d[_0x670a('0xd')]){_0x25871d[_0x670a('0x7')]+=0x1;if(_0x25871d['talking']){_0x25871d[_0x670a('0x6')]-=0x1;}}else{if(_0x25871d[_0x670a('0xc')]){_0x25871d['unmanaged']+=0x1;updateWaitingCounter(_0x25871d);}}}else{if(!_0x25871d['UserId']){_0x25871d[_0x670a('0x5')]+=0x1;}if(_0x25871d['UserId']){_0x25871d[_0x670a('0x6')]+=0x1;updateWaitingCounter(_0x25871d);}}_0x25871d[_0x670a('0xa')]+=0x1;return _0x25871d;}function getLastMessageText(_0x4af74e){return db[_0x670a('0xe')][_0x670a('0xf')]({'where':{'$and':[{'MailInteractionId':_0x4af74e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x670a('0x10')],'order':_0x670a('0x11'),'raw':!![]})[_0x670a('0x12')](function(_0x15733b){if(_0x15733b&&_0x15733b['plainBody']){_0x4af74e[_0x670a('0x13')]=_['trimStart'](_0x15733b[_0x670a('0x10')]);}return _0x4af74e;})['catch'](function(_0x1a115e){throw _0x1a115e;});}exports['updateInteraction']=function(_0x976a7d,_0x529407,_0x199db9,_0xe7ba1f){return new Promise(function(_0x5899c4,_0x3f3a7c){return getInteractionUsers(_0x976a7d['id'],_0x199db9)[_0x670a('0x12')](function(_0xca89f5){_0x976a7d[_0x670a('0x14')]=_0xca89f5;return getInteractionTags(_0x976a7d[_0x670a('0x15')],_0x529407);})[_0x670a('0x12')](function(_0x3d600b){_0x976a7d[_0x670a('0x16')]=_0x3d600b;delete _0x976a7d[_0x670a('0x15')];return updateInteractionCounters(_0x976a7d);})[_0x670a('0x12')](function(_0x3b742f){if(_0xe7ba1f){return getLastMessageText(_0x3b742f);}else{return _0x3b742f;}})['then'](function(_0x291775){_0x5899c4(_0x291775);})[_0x670a('0x17')](function(_0x33ba38){_0x3f3a7c(_0x33ba38);});});}; \ No newline at end of file +var _0xa7f4=['Tags','lodash','../../mysqldb','map','fullname','forEach','waiting','talking','answered','abandoned','total','closed','disposition','UserId','MailMessage','findOne','out','plainBody','-id','then','catch','updateInteraction','Users','TagIds'];(function(_0x167ad6,_0x9c2c07){var _0x2aded3=function(_0x5b08f2){while(--_0x5b08f2){_0x167ad6['push'](_0x167ad6['shift']());}};_0x2aded3(++_0x9c2c07);}(_0xa7f4,0x109));var _0x4a7f=function(_0x2faec6,_0x45774f){_0x2faec6=_0x2faec6-0x0;var _0x2330de=_0xa7f4[_0x2faec6];return _0x2330de;};'use strict';var _=require(_0x4a7f('0x0'));var db=require(_0x4a7f('0x1'))['db'];function getInteractionUsers(_0x1555a7,_0x1c5214){return new Promise(function(_0x25b7a0,_0x4c6772){try{var _0x534d6b=[];if(_0x1c5214[_0x1555a7]){_0x534d6b=_0x1c5214[_0x1555a7][_0x4a7f('0x2')](function(_0x60d50b){return{'id':_0x60d50b['id'],'fullname':_0x60d50b[_0x4a7f('0x3')]};});}return _0x25b7a0(_0x534d6b);}catch(_0x23a5b6){_0x4c6772(_0x23a5b6);}});}function getInteractionTags(_0x456138,_0x49a06a){var _0x478576=[];if(_0x456138){_0x456138['split'](',')[_0x4a7f('0x4')](function(_0x1d2f21){_0x478576['push'](_0x49a06a[_0x1d2f21]);});}return _0x478576;}function updateWaitingCounter(_0x1a903c){if(_0x1a903c[_0x4a7f('0x5')]){_0x1a903c[_0x4a7f('0x5')]-=0x1;}}function updateInteractionCounters(_0x28b61a){_0x28b61a[_0x4a7f('0x5')]=0x0;_0x28b61a[_0x4a7f('0x6')]=0x0;_0x28b61a[_0x4a7f('0x7')]=0x0;_0x28b61a['unmanaged']=0x0;_0x28b61a[_0x4a7f('0x8')]=0x0;_0x28b61a[_0x4a7f('0x9')]=0x0;if(_0x28b61a[_0x4a7f('0xa')]){if(_0x28b61a[_0x4a7f('0xb')]===_0x4a7f('0x8')){_0x28b61a['abandoned']+=0x1;updateWaitingCounter(_0x28b61a);}if(_0x28b61a[_0x4a7f('0xc')]){_0x28b61a[_0x4a7f('0x7')]+=0x1;if(_0x28b61a[_0x4a7f('0x6')]){_0x28b61a['talking']-=0x1;}}else{if(_0x28b61a[_0x4a7f('0xb')]){_0x28b61a['unmanaged']+=0x1;updateWaitingCounter(_0x28b61a);}}}else{if(!_0x28b61a[_0x4a7f('0xc')]){_0x28b61a['waiting']+=0x1;}if(_0x28b61a[_0x4a7f('0xc')]){_0x28b61a[_0x4a7f('0x6')]+=0x1;updateWaitingCounter(_0x28b61a);}}_0x28b61a[_0x4a7f('0x9')]+=0x1;return _0x28b61a;}function getLastMessageText(_0x243268){return db[_0x4a7f('0xd')][_0x4a7f('0xe')]({'where':{'$and':[{'MailInteractionId':_0x243268['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x4a7f('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x4a7f('0x10')],'order':_0x4a7f('0x11'),'raw':!![]})[_0x4a7f('0x12')](function(_0x4b96e2){if(_0x4b96e2&&_0x4b96e2['plainBody']){_0x243268['lastMsgText']=_['trimStart'](_0x4b96e2['plainBody']);}return _0x243268;})[_0x4a7f('0x13')](function(_0x4e20a1){throw _0x4e20a1;});}exports[_0x4a7f('0x14')]=function(_0x387d33,_0x207bbd,_0x508c11,_0x3d35c6){return new Promise(function(_0x33432f,_0x545449){return getInteractionUsers(_0x387d33['id'],_0x508c11)[_0x4a7f('0x12')](function(_0x28013c){_0x387d33[_0x4a7f('0x15')]=_0x28013c;return getInteractionTags(_0x387d33[_0x4a7f('0x16')],_0x207bbd);})[_0x4a7f('0x12')](function(_0x33a8ae){_0x387d33[_0x4a7f('0x17')]=_0x33a8ae;delete _0x387d33['TagIds'];return updateInteractionCounters(_0x387d33);})[_0x4a7f('0x12')](function(_0xc20e20){if(_0x3d35c6){return getLastMessageText(_0xc20e20);}else{return _0xc20e20;}})['then'](function(_0x3c435b){_0x33432f(_0x3c435b);})[_0x4a7f('0x13')](function(_0x5165cc){_0x545449(_0x5165cc);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index b504b51..7bf01f7 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 _0x33e1=['_interaction_has_tags','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','Interaction','then','update','info','catch','error','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','whatsapp-interactions','capitalize','Website','Account','InteractionId','upperFirst','unknown','chat','websites','accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33e1,0x11c));var _0x133e=function(_0x1548aa,_0x31c31b){_0x1548aa=_0x1548aa-0x0;var _0x301bab=_0x33e1[_0x1548aa];return _0x301bab;};'use strict';var _=require(_0x133e('0x0'));var db=require(_0x133e('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x133e('0x2')),'mail':require(_0x133e('0x3'))(_0x133e('0x4')),'fax':require(_0x133e('0x3'))(_0x133e('0x5')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x133e('0x3'))('chat-interactions'),'whatsapp':require(_0x133e('0x3'))(_0x133e('0x6'))};function getAccountFK(_0xe7b08f){return _[_0x133e('0x7')](_0xe7b08f)+(_0xe7b08f==='chat'?_0x133e('0x8'):_0x133e('0x9'))+'Id';}function getInteractionFK(_0x28067b){return _[_0x133e('0x7')](_0x28067b)+_0x133e('0xa');}function getInteractionId(_0x46850c,_0x5cbb3a,_0x18ba34){if(_0x46850c&&_0x46850c[_[_0x133e('0xb')](_0x18ba34)+_0x133e('0xa')]){return _0x46850c[_[_0x133e('0xb')](_0x18ba34)+_0x133e('0xa')];}else if(_0x46850c&&_0x46850c['id']){return _0x46850c['id'];}else if(_0x5cbb3a&&_0x5cbb3a['id']){return _0x5cbb3a['id'];}else{return _0x133e('0xc');}}function getInteractionsTables(_0x22ba5e){return{'accounts':_0x22ba5e+'_'+(_0x22ba5e===_0x133e('0xd')?_0x133e('0xe'):_0x133e('0xf')),'interactions':_0x22ba5e+'_interactions','interactionsTags':_0x22ba5e+_0x133e('0x10'),'messages':_0x22ba5e+_0x133e('0x11'),'userInteractions':_0x133e('0x12')+_0x22ba5e+'_interactions'};}function getSelectedTags(_0x4c404b){var _0xd73aa=[];if(_0x4c404b){_0xd73aa=Array[_0x133e('0x13')](_0x4c404b)?_0x4c404b:[_0x4c404b];}return _0xd73aa;}function log(_0x1b104a,_0x143363,_0x5e1f03,_0x20819c,_0x1fbddb,_0x30c572){loggers[_0x1fbddb['toLowerCase']()][_0x1b104a](_0x133e('0x14'),_0x30c572['toUpperCase'](),_0x143363?_0x143363['id']:null,_0x143363?_0x143363['name']:null,_0x143363?_0x143363[_0x133e('0x15')]:null,getInteractionId(_0x5e1f03,_0x20819c,_0x1fbddb),_0x5e1f03?JSON['stringify'](_0x5e1f03):_0x133e('0x16'));}function updateUser(_0x5e4484,_0x299fe1,_0x4380fb,_0x2406e0,_0x1efb33){db[_[_0x133e('0xb')](_0x2406e0)+_0x133e('0x17')]['findOne']({'where':{'id':getInteractionId(_0x299fe1,_0x4380fb,_0x2406e0)}})[_0x133e('0x18')](function(_0x1fed7c){if(_0x1fed7c){return _0x1fed7c[_0x133e('0x19')]({'UserId':_0x5e4484?_0x5e4484['id']:null});}})[_0x133e('0x18')](function(_0xdd33aa){if(_0xdd33aa){log(_0x133e('0x1a'),_0x5e4484,_0x299fe1,_0x4380fb,_0x2406e0,_0x1efb33);}})[_0x133e('0x1b')](function(){log(_0x133e('0x1c'),_0x5e4484,_0x299fe1,_0x4380fb,_0x2406e0,_0x1efb33);});}module[_0x133e('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x15e3=['_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','update','then','info','catch','error','exports','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','accounts','_interaction_has_tags'];(function(_0x40eadc,_0x37af8d){var _0x6963b4=function(_0x4c2c9){while(--_0x4c2c9){_0x40eadc['push'](_0x40eadc['shift']());}};_0x6963b4(++_0x37af8d);}(_0x15e3,0x9a));var _0x315e=function(_0x2ee053,_0x57988d){_0x2ee053=_0x2ee053-0x0;var _0x1c3bb8=_0x15e3[_0x2ee053];return _0x1c3bb8;};'use strict';var _=require(_0x315e('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x315e('0x1'))(_0x315e('0x2')),'mail':require('../../config/logger')(_0x315e('0x3')),'fax':require(_0x315e('0x1'))(_0x315e('0x4')),'sms':require(_0x315e('0x1'))(_0x315e('0x5')),'chat':require(_0x315e('0x1'))('chat-interactions'),'whatsapp':require(_0x315e('0x1'))(_0x315e('0x6'))};function getAccountFK(_0x51d668){return _[_0x315e('0x7')](_0x51d668)+(_0x51d668===_0x315e('0x8')?_0x315e('0x9'):_0x315e('0xa'))+'Id';}function getInteractionFK(_0x562fbb){return _[_0x315e('0x7')](_0x562fbb)+_0x315e('0xb');}function getInteractionId(_0x2037fb,_0x977237,_0x47522c){if(_0x2037fb&&_0x2037fb[_[_0x315e('0xc')](_0x47522c)+'InteractionId']){return _0x2037fb[_[_0x315e('0xc')](_0x47522c)+'InteractionId'];}else if(_0x2037fb&&_0x2037fb['id']){return _0x2037fb['id'];}else if(_0x977237&&_0x977237['id']){return _0x977237['id'];}else{return _0x315e('0xd');}}function getInteractionsTables(_0x837337){return{'accounts':_0x837337+'_'+(_0x837337===_0x315e('0x8')?'websites':_0x315e('0xe')),'interactions':_0x837337+'_interactions','interactionsTags':_0x837337+_0x315e('0xf'),'messages':_0x837337+_0x315e('0x10'),'userInteractions':_0x315e('0x11')+_0x837337+_0x315e('0x12')};}function getSelectedTags(_0xd08026){var _0x574ed9=[];if(_0xd08026){_0x574ed9=Array[_0x315e('0x13')](_0xd08026)?_0xd08026:[_0xd08026];}return _0x574ed9;}function log(_0x3a53f0,_0x40c51c,_0x4b411e,_0x9ba597,_0x3bd086,_0x322213){loggers[_0x3bd086[_0x315e('0x14')]()][_0x3a53f0](_0x315e('0x15'),_0x322213[_0x315e('0x16')](),_0x40c51c?_0x40c51c['id']:null,_0x40c51c?_0x40c51c[_0x315e('0x17')]:null,_0x40c51c?_0x40c51c[_0x315e('0x18')]:null,getInteractionId(_0x4b411e,_0x9ba597,_0x3bd086),_0x4b411e?JSON[_0x315e('0x19')](_0x4b411e):'null');}function updateUser(_0x567432,_0x2d940e,_0x285a43,_0x4811c3,_0x3047bb){db[_['upperFirst'](_0x4811c3)+_0x315e('0x1a')][_0x315e('0x1b')]({'where':{'id':getInteractionId(_0x2d940e,_0x285a43,_0x4811c3)}})['then'](function(_0x17868f){if(_0x17868f){return _0x17868f[_0x315e('0x1c')]({'UserId':_0x567432?_0x567432['id']:null});}})[_0x315e('0x1d')](function(_0x4d8160){if(_0x4d8160){log(_0x315e('0x1e'),_0x567432,_0x2d940e,_0x285a43,_0x4811c3,_0x3047bb);}})[_0x315e('0x1f')](function(){log(_0x315e('0x20'),_0x567432,_0x2d940e,_0x285a43,_0x4811c3,_0x3047bb);});}module[_0x315e('0x21')]={'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 4c93c56..fbed8c1 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 _0x606a=['license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','isUserLimit','crypto','util','composable-middleware','../../mysqldb'];(function(_0x402f22,_0x3a0325){var _0x4c6cce=function(_0x2163d7){while(--_0x2163d7){_0x402f22['push'](_0x402f22['shift']());}};_0x4c6cce(++_0x3a0325);}(_0x606a,0xef));var _0xa606=function(_0x5a4d05,_0x272f20){_0x5a4d05=_0x5a4d05-0x0;var _0x5cc743=_0x606a[_0x5a4d05];return _0x5cc743;};'use strict';var crypto=require(_0xa606('0x0'));var util=require(_0xa606('0x1'));var compose=require(_0xa606('0x2'));var db=require(_0xa606('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0xe31188,_0x36c512){if(_0xe31188&&_0x36c512){if(_0x36c512['data1']&&_0x36c512[_0xa606('0x4')]){var _0x286126=_0x36c512[_0xa606('0x5')];var _0x330411=_0x36c512['license'];var _0x203017=_0x286126[_0xa606('0x6')]('-')[0x4];var _0x3c6c80=_0x286126['split']('-')[0x0];var _0x326ae7=crypto[_0xa606('0x7')](_0xa606('0x8'),util[_0xa606('0x9')](_0xa606('0xa'),_0x203017,_0x286126,_0x3c6c80));var _0x7efa96=_0x326ae7[_0xa606('0xb')](_0x330411,_0xa606('0xc'),_0xa606('0xd'));_0x7efa96+=_0x326ae7[_0xa606('0xe')]('utf8');var _0x450844=JSON[_0xa606('0xf')](_0x7efa96);return _0x450844[_0xa606('0x10')](_0xe31188)?_0x450844[_0xe31188]:null;}}return null;}function isLimit(_0x3809a4,_0x417e60,_0x5525c5,_0x47cf6a){var _0x32b782=_0x417e60;return compose()[_0xa606('0x11')](function(_0x33cdb0,_0x125379,_0x4e54cb){return db[_0xa606('0x12')][_0xa606('0x13')]({'where':{'id':0x1},'raw':!![]})[_0xa606('0x14')](function(_0xb00c3c){var _0x58f473=getValueFromLicense(_0x3809a4,_0xb00c3c);return _0x58f473?_0x58f473:_0x32b782;})['then'](function(_0x46bbf4){_0x32b782=_0x46bbf4;return _0x5525c5[_0xa606('0x15')](_0x47cf6a);})[_0xa606('0x14')](function(_0x437a82){if(_0x437a82>=_0x32b782){return _0x125379[_0xa606('0x16')](0x193)[_0xa606('0x17')]({'message':util['format'](_0xa606('0x18'),_0x3809a4)});}_0x4e54cb();})['catch'](function(_0x1dd8cd){_0x4e54cb(_0x1dd8cd);});});}function isUserLimit(){return isLimit(_0xa606('0x19'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0xa606('0x1a')]=isUserLimit; \ No newline at end of file +var _0x7694=['users','user','isUserLimit','crypto','util','../../config/environment','data1','license','split','createDecipher','format','update','base64','utf8','final','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch'];(function(_0x2c62a2,_0x2c4a02){var _0x12537c=function(_0x2d9ed9){while(--_0x2d9ed9){_0x2c62a2['push'](_0x2c62a2['shift']());}};_0x12537c(++_0x2c4a02);}(_0x7694,0x161));var _0x4769=function(_0x2b6d25,_0x457f15){_0x2b6d25=_0x2b6d25-0x0;var _0x13b62a=_0x7694[_0x2b6d25];return _0x13b62a;};'use strict';var crypto=require(_0x4769('0x0'));var util=require(_0x4769('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x4769('0x2'));function getValueFromLicense(_0x343245,_0x360cc4){if(_0x343245&&_0x360cc4){if(_0x360cc4[_0x4769('0x3')]&&_0x360cc4[_0x4769('0x4')]){var _0x45b194=_0x360cc4[_0x4769('0x3')];var _0x466946=_0x360cc4[_0x4769('0x4')];var _0x127270=_0x45b194['split']('-')[0x4];var _0x4b6115=_0x45b194[_0x4769('0x5')]('-')[0x0];var _0x3968dc=crypto[_0x4769('0x6')]('aes-256-ctr',util[_0x4769('0x7')]('%s:%s:%s',_0x127270,_0x45b194,_0x4b6115));var _0xd79118=_0x3968dc[_0x4769('0x8')](_0x466946,_0x4769('0x9'),_0x4769('0xa'));_0xd79118+=_0x3968dc[_0x4769('0xb')](_0x4769('0xa'));var _0x3f522d=JSON['parse'](_0xd79118);return _0x3f522d[_0x4769('0xc')](_0x343245)?_0x3f522d[_0x343245]:null;}}return null;}function isLimit(_0x713d26,_0x2dc2e1,_0x5a8417,_0x2df5c8){var _0x1c7655=_0x2dc2e1;return compose()[_0x4769('0xd')](function(_0x421c65,_0x4720cd,_0x85e924){return db[_0x4769('0xe')][_0x4769('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x4769('0x10')](function(_0x17a32a){var _0x1fa554=getValueFromLicense(_0x713d26,_0x17a32a);return _0x1fa554?_0x1fa554:_0x1c7655;})['then'](function(_0x471a8d){_0x1c7655=_0x471a8d;return _0x5a8417[_0x4769('0x11')](_0x2df5c8);})[_0x4769('0x10')](function(_0x459174){if(_0x459174>=_0x1c7655){return _0x4720cd[_0x4769('0x12')](0x193)[_0x4769('0x13')]({'message':util[_0x4769('0x7')](_0x4769('0x14'),_0x713d26)});}_0x85e924();})[_0x4769('0x15')](function(_0x52b44f){_0x85e924(_0x52b44f);});});}function isUserLimit(){return isLimit(_0x4769('0x16'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x4769('0x17')}]}});}exports[_0x4769('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 5a1a2d0..63bf78b 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 _0x9a34=['$gt','$lte','add','days','format','castTo','CAST(','\x20AS\x20','text','field','includes','$ne','$notIn','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','utcOffset','hours','minutes','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','split','match','forEach','filter','indexOf','conditions','push','buildExpression','DATE','operator','$between','value'];(function(_0x3e49fe,_0x552dba){var _0x150873=function(_0x88c188){while(--_0x88c188){_0x3e49fe['push'](_0x3e49fe['shift']());}};_0x150873(++_0x552dba);}(_0x9a34,0xf6));var _0x49a3=function(_0x533eec,_0x14eb1){_0x533eec=_0x533eec-0x0;var _0x218ef1=_0x9a34[_0x533eec];return _0x218ef1;};'use strict';var _=require(_0x49a3('0x0'));var moment=require(_0x49a3('0x1'));exports[_0x49a3('0x2')]=function(_0x97cc50){var _0x4fd710={'conditions':[]};_0x4fd710[_0x49a3('0x3')]=_['startsWith'](_0x97cc50,_0x49a3('0x4'))?'or':_0x49a3('0x5');var _0x54072e=_0x97cc50[_0x49a3('0x6')]('[$and]','')[_0x49a3('0x6')](_0x49a3('0x4'),'')[_0x49a3('0x7')]('||');for(var _0x10851b=0x0;_0x10851b<_0x54072e['length'];_0x10851b++){var _0x425eb0=_0x54072e[_0x10851b][_0x49a3('0x7')](':=');var _0x3eeb7f=_0x425eb0[0x0];var _0x2a260a=_0x425eb0['slice'](0x1);_0x2a260a['forEach'](function(_0x33bc53){var _0x1c6561=_0x33bc53[_0x49a3('0x7')]('[')['shift']();var _0xd2c098=_0x33bc53[_0x49a3('0x8')](/\[(.*?)\]/g);_0xd2c098[_0x49a3('0x9')](function(_0x48ea7e){var _0x95e8c9=_0x48ea7e['split']('[')[_0x49a3('0xa')](function(_0x19fa27){return _0x19fa27[_0x49a3('0xb')](']')>-0x1;})['map'](function(_0x44601d){return _0x44601d['split'](']')[0x0];})[0x0];_0x4fd710[_0x49a3('0xc')][_0x49a3('0xd')]({'field':_0x3eeb7f,'operator':_0x1c6561,'value':_0x95e8c9});});});}return _0x4fd710;};exports[_0x49a3('0xe')]=function(_0x5709ec,_0x41e69e,_0x31e3da){var _0x5b9d56={};if(_0x41e69e===_0x49a3('0xf')){if(_0x31e3da[_0x49a3('0x10')]==='$eq'){_0x31e3da[_0x49a3('0x10')]=_0x49a3('0x11');_0x31e3da['value']+=','+_0x31e3da[_0x49a3('0x12')];}else if(_['includes']([_0x49a3('0x13'),_0x49a3('0x14')],_0x31e3da[_0x49a3('0x10')])){_0x31e3da[_0x49a3('0x12')]=moment(_0x31e3da[_0x49a3('0x12')])[_0x49a3('0x15')](0x1,_0x49a3('0x16'))[_0x49a3('0x17')]('YYYY-MM-DD');}}if(_0x31e3da[_0x49a3('0x18')]){_0x41e69e=_0x31e3da[_0x49a3('0x18')];_0x5b9d56['text']=_0x49a3('0x19')+_0x5709ec+'.'+_0x31e3da['field']+_0x49a3('0x1a')+_0x31e3da['castTo']+')\x20'+parseOperator(_0x31e3da[_0x49a3('0x10')]);}else{_0x5b9d56[_0x49a3('0x1b')]=_0x5709ec+'.'+_0x31e3da[_0x49a3('0x1c')]+'\x20'+parseOperator(_0x31e3da[_0x49a3('0x10')]);}if(_[_0x49a3('0x1d')]([_0x49a3('0x1e'),_0x49a3('0x1f')],_0x31e3da[_0x49a3('0x10')]))_0x5b9d56[_0x49a3('0x1b')]='('+_0x5b9d56[_0x49a3('0x1b')]+'\x20OR\x20'+_0x5709ec+'.'+_0x31e3da['field']+_0x49a3('0x20');_0x5b9d56[_0x49a3('0x12')]=parseValue(_0x41e69e,_0x31e3da[_0x49a3('0x10')],_0x31e3da[_0x49a3('0x12')]);return _0x5b9d56;};function parseOperator(_0x5daa1a){var _0x376662;switch(_0x5daa1a){case _0x49a3('0x21'):_0x376662='IN\x20?';break;case _0x49a3('0x1f'):_0x376662=_0x49a3('0x22');break;case _0x49a3('0x23'):_0x376662=_0x49a3('0x24');break;case _0x49a3('0x1e'):_0x376662=_0x49a3('0x25');break;case _0x49a3('0x26'):case _0x49a3('0x27'):case _0x49a3('0x28'):_0x376662=_0x49a3('0x29');break;case _0x49a3('0x2a'):_0x376662='<\x20?';break;case'$gt':_0x376662=_0x49a3('0x2b');break;case _0x49a3('0x14'):_0x376662=_0x49a3('0x2c');break;case _0x49a3('0x2d'):_0x376662=_0x49a3('0x2e');break;case _0x49a3('0x11'):_0x376662=_0x49a3('0x2f');break;}return _0x376662;}function parseValue(_0xfb195b,_0x5355d0,_0x1e33ab){var _0x420ccc={'start':undefined,'end':undefined};switch(_0x5355d0){case'$in':case _0x49a3('0x1f'):_0x420ccc['start']=_0x1e33ab['split'](',');break;case _0x49a3('0x26'):_0x420ccc[_0x49a3('0x30')]='%'+_0x1e33ab+'%';break;case'$startsWith':_0x420ccc[_0x49a3('0x30')]=_0x1e33ab+'%';break;case'$endsWith':_0x420ccc[_0x49a3('0x30')]='%'+_0x1e33ab;break;case'$between':var _0x12099b=_0x1e33ab[_0x49a3('0x7')](',');var _0x1e33ab=_0x12099b[_0x49a3('0x31')]();var _0x2ea387=_0x12099b['pop']();if(_0xfb195b===_0x49a3('0xf')){_0x1e33ab=moment(_0x1e33ab)[_0x49a3('0x32')](0x0,!![])['format']();_0x2ea387=moment(_0x2ea387)[_0x49a3('0x32')](0x0,!![])['add'](0x17,_0x49a3('0x33'))[_0x49a3('0x15')](0x3b,_0x49a3('0x34'))['add'](0x3b,'seconds')[_0x49a3('0x17')]();}_0x420ccc={'start':_0x1e33ab,'end':_0x2ea387};break;default:_0x420ccc[_0x49a3('0x30')]=_0x1e33ab;break;}return _0x420ccc;} \ No newline at end of file +var _0x2292=['<=\x20?','$gte','>=\x20?','$between','$in','start','$substring','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','shift','filter','map','DATE','$eq','operator','value','includes','$gt','add','days','format','YYYY-MM-DD','text','CAST(','field','\x20AS\x20','castTo','$ne','\x20OR\x20','$notIn','NOT\x20IN\x20?','<>\x20?','$endsWith','$lt','<\x20?','$lte'];(function(_0x2a196f,_0x669c16){var _0x1f110b=function(_0x30595a){while(--_0x30595a){_0x2a196f['push'](_0x2a196f['shift']());}};_0x1f110b(++_0x669c16);}(_0x2292,0xd4));var _0x2229=function(_0x1e354d,_0x4cdd11){_0x1e354d=_0x1e354d-0x0;var _0x25445d=_0x2292[_0x1e354d];return _0x25445d;};'use strict';var _=require(_0x2229('0x0'));var moment=require('moment');exports[_0x2229('0x1')]=function(_0x153b89){var _0x11b71c={'conditions':[]};_0x11b71c[_0x2229('0x2')]=_[_0x2229('0x3')](_0x153b89,_0x2229('0x4'))?'or':_0x2229('0x5');var _0x53b64e=_0x153b89[_0x2229('0x6')](_0x2229('0x7'),'')[_0x2229('0x6')](_0x2229('0x4'),'')['split']('||');for(var _0x1af9a4=0x0;_0x1af9a4<_0x53b64e['length'];_0x1af9a4++){var _0x465895=_0x53b64e[_0x1af9a4][_0x2229('0x8')](':=');var _0x44294d=_0x465895[0x0];var _0xb1a15f=_0x465895[_0x2229('0x9')](0x1);_0xb1a15f[_0x2229('0xa')](function(_0x2caf33){var _0x26a29b=_0x2caf33[_0x2229('0x8')]('[')[_0x2229('0xb')]();var _0x48e5f9=_0x2caf33['match'](/\[(.*?)\]/g);_0x48e5f9[_0x2229('0xa')](function(_0x1eef25){var _0x309178=_0x1eef25['split']('[')[_0x2229('0xc')](function(_0x3b821f){return _0x3b821f['indexOf'](']')>-0x1;})[_0x2229('0xd')](function(_0x19a6bd){return _0x19a6bd[_0x2229('0x8')](']')[0x0];})[0x0];_0x11b71c['conditions']['push']({'field':_0x44294d,'operator':_0x26a29b,'value':_0x309178});});});}return _0x11b71c;};exports['buildExpression']=function(_0x4f8df6,_0x356d22,_0x2d898e){var _0x2aec74={};if(_0x356d22===_0x2229('0xe')){if(_0x2d898e['operator']===_0x2229('0xf')){_0x2d898e[_0x2229('0x10')]='$between';_0x2d898e[_0x2229('0x11')]+=','+_0x2d898e[_0x2229('0x11')];}else if(_[_0x2229('0x12')]([_0x2229('0x13'),'$lte'],_0x2d898e['operator'])){_0x2d898e[_0x2229('0x11')]=moment(_0x2d898e[_0x2229('0x11')])[_0x2229('0x14')](0x1,_0x2229('0x15'))[_0x2229('0x16')](_0x2229('0x17'));}}if(_0x2d898e['castTo']){_0x356d22=_0x2d898e['castTo'];_0x2aec74[_0x2229('0x18')]=_0x2229('0x19')+_0x4f8df6+'.'+_0x2d898e[_0x2229('0x1a')]+_0x2229('0x1b')+_0x2d898e[_0x2229('0x1c')]+')\x20'+parseOperator(_0x2d898e[_0x2229('0x10')]);}else{_0x2aec74[_0x2229('0x18')]=_0x4f8df6+'.'+_0x2d898e['field']+'\x20'+parseOperator(_0x2d898e['operator']);}if(_[_0x2229('0x12')]([_0x2229('0x1d'),'$notIn'],_0x2d898e['operator']))_0x2aec74[_0x2229('0x18')]='('+_0x2aec74['text']+_0x2229('0x1e')+_0x4f8df6+'.'+_0x2d898e[_0x2229('0x1a')]+'\x20IS\x20NULL)';_0x2aec74[_0x2229('0x11')]=parseValue(_0x356d22,_0x2d898e[_0x2229('0x10')],_0x2d898e[_0x2229('0x11')]);return _0x2aec74;};function parseOperator(_0x5c9a5b){var _0xe29257;switch(_0x5c9a5b){case'$in':_0xe29257='IN\x20?';break;case _0x2229('0x1f'):_0xe29257=_0x2229('0x20');break;case _0x2229('0xf'):_0xe29257='=\x20?';break;case _0x2229('0x1d'):_0xe29257=_0x2229('0x21');break;case'$substring':case'$startsWith':case _0x2229('0x22'):_0xe29257='LIKE\x20?';break;case _0x2229('0x23'):_0xe29257=_0x2229('0x24');break;case _0x2229('0x13'):_0xe29257='>\x20?';break;case _0x2229('0x25'):_0xe29257=_0x2229('0x26');break;case _0x2229('0x27'):_0xe29257=_0x2229('0x28');break;case _0x2229('0x29'):_0xe29257='BETWEEN\x20?\x20AND\x20?';break;}return _0xe29257;}function parseValue(_0x471d30,_0x370e34,_0x3f09a1){var _0x2230dd={'start':undefined,'end':undefined};switch(_0x370e34){case _0x2229('0x2a'):case _0x2229('0x1f'):_0x2230dd[_0x2229('0x2b')]=_0x3f09a1[_0x2229('0x8')](',');break;case _0x2229('0x2c'):_0x2230dd['start']='%'+_0x3f09a1+'%';break;case'$startsWith':_0x2230dd[_0x2229('0x2b')]=_0x3f09a1+'%';break;case'$endsWith':_0x2230dd[_0x2229('0x2b')]='%'+_0x3f09a1;break;case _0x2229('0x29'):var _0x3ccc03=_0x3f09a1['split'](',');var _0x3f09a1=_0x3ccc03[_0x2229('0xb')]();var _0x40d94f=_0x3ccc03[_0x2229('0x2d')]();if(_0x471d30==='DATE'){_0x3f09a1=moment(_0x3f09a1)[_0x2229('0x2e')](0x0,!![])[_0x2229('0x16')]();_0x40d94f=moment(_0x40d94f)['utcOffset'](0x0,!![])['add'](0x17,_0x2229('0x2f'))[_0x2229('0x14')](0x3b,_0x2229('0x30'))[_0x2229('0x14')](0x3b,_0x2229('0x31'))['format']();}_0x2230dd={'start':_0x3f09a1,'end':_0x40d94f};break;default:_0x2230dd[_0x2229('0x2b')]=_0x3f09a1;break;}return _0x2230dd;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 050c270..fadf589 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 _0xcb07=['$id','query','intersection','attributes','nolimit','limit','offset','order','where','filter','columns','value','lower','merge','options','includeAll','push','include','lodash','sequelize','moment','../../mysqldb','parse','includes','keys','model','fields','raw','split','filters','isEmpty','DATE','isPlainObject','YYYY-MM-DD','format','$lte','subtract','name','uniqueid','isArray','sort','map','indexOf','priority','col','unsigned','substr','DESC','cast','ASC','omit','isObject','isString','length','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','match','replace','join','getOptions'];(function(_0xc609a,_0x40e57b){var _0x1fffa9=function(_0x5d83f7){while(--_0x5d83f7){_0xc609a['push'](_0xc609a['shift']());}};_0x1fffa9(++_0x40e57b);}(_0xcb07,0x98));var _0x7cb0=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xcb07[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0x7cb0('0x0'));var sequelize=require(_0x7cb0('0x1'));var moment=require(_0x7cb0('0x2'));var db=require(_0x7cb0('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x282c97){var _0x530c60=['ne'];try{var _0x451e6f=JSON[_0x7cb0('0x4')](_0x282c97);var _0x1c1e4a=Object['keys'](_0x451e6f)[0x0];return _0x530c60[_0x7cb0('0x5')](_0x1c1e4a);}catch(_0x4f4140){return![];}}function getOperatorValue(_0x22dfbb){var _0x3938a6=JSON['parse'](_0x22dfbb);var _0x1e3a56=Object[_0x7cb0('0x6')](_0x3938a6)[0x0];var _0x2cf7fd=_0x3938a6[_0x1e3a56];return{['$'+_0x1e3a56]:_0x2cf7fd};}function parseIncludeModel(_0x1bf71a){var _0x1c89b7=JSON[_0x7cb0('0x4')](_0x1bf71a);return{'model':db[_0x1c89b7[_0x7cb0('0x7')]],'as':_0x1c89b7['alias'],'attributes':_0x1c89b7[_0x7cb0('0x8')],'raw':_0x1c89b7[_0x7cb0('0x9')]};}exports[_0x7cb0('0x8')]=function(_0x560810){var _0x59b6bf=null;if(_0x560810){_0x59b6bf=_0x560810[_0x7cb0('0xa')](',');}return _0x59b6bf;};exports[_0x7cb0('0xb')]=function(_0x543c8a,_0x57f3cf){var _0x5bc8f2={};if(!_[_0x7cb0('0xc')](_0x543c8a)){_['forOwn'](_0x543c8a,function(_0x2176de,_0x1c52c1){try{if(_0x57f3cf){var _0xe03d25=_['find'](_0x57f3cf,{'name':_0x1c52c1})||{};if(hasSequelizeOperator(_0x2176de)){_0x5bc8f2[_0x1c52c1]=getOperatorValue(_0x2176de);}else if(_0xe03d25['type']===_0x7cb0('0xd')&&_[_0x7cb0('0xe')](_0x2176de)){var _0x181834=JSON['parse'](_0x2176de);var _0xea1b72={'$gte':moment(moment(_0x181834['$gte'])['format'](_0x7cb0('0xf')))['utc']()[_0x7cb0('0x10')](),'$lte':moment(moment(_0x181834[_0x7cb0('0x11')])[_0x7cb0('0x10')](_0x7cb0('0xf')))['utc']()[_0x7cb0('0x12')](0x1,'s')[_0x7cb0('0x10')]()};_0x5bc8f2[_0x1c52c1]=_0xea1b72;}else if(_0xe03d25[_0x7cb0('0x13')]===_0x7cb0('0x14')){_0x5bc8f2[_0x1c52c1]=_0x2176de;}else{_0x5bc8f2[_0x1c52c1]=_[_0x7cb0('0x15')](_0x2176de)?_0x2176de:JSON[_0x7cb0('0x4')](_0x2176de);}}else{_0x5bc8f2[_0x1c52c1]=_['isArray'](_0x2176de)?_0x2176de:JSON[_0x7cb0('0x4')](_0x2176de);}}catch(_0x225e80){_0x5bc8f2[_0x1c52c1]=_0x2176de[_0x7cb0('0xa')](',');}});}return _0x5bc8f2;};exports['limit']=function(_0x356937){_0x356937=parseInt(_0x356937,0xa);if(!_0x356937||_0x356937<0x0){_0x356937=LIMIT_VALUE;}return _0x356937;};exports['offset']=function(_0x21c70d){_0x21c70d=parseInt(_0x21c70d,0xa);if(!_0x21c70d||_0x21c70d<0x0){_0x21c70d=0x0;}return _0x21c70d;};exports[_0x7cb0('0x16')]=function(_0x2ec94b){var _0x1e09b6,_0x16ef84=null;if(_0x2ec94b){_0x1e09b6=_0x2ec94b[_0x7cb0('0xa')](',');_0x16ef84=_[_0x7cb0('0x17')](_0x1e09b6,function(_0x31ae45){if(_0x31ae45[_0x7cb0('0x18')]('-')===0x0){return[_0x31ae45===_0x7cb0('0x19')?sequelize['cast'](sequelize[_0x7cb0('0x1a')](_0x7cb0('0x19')),_0x7cb0('0x1b')):_0x31ae45[_0x7cb0('0x1c')](0x1),_0x7cb0('0x1d')];}else{return[_0x31ae45===_0x7cb0('0x19')?sequelize[_0x7cb0('0x1e')](sequelize['col'](_0x7cb0('0x19')),_0x7cb0('0x1b')):_0x31ae45,_0x7cb0('0x1f')];}});}return _0x16ef84;};exports[_0x7cb0('0x20')]=function(_0x195254,_0x5e8520){if(_[_0x7cb0('0xc')](_0x195254)){return _0x195254;}if(_[_0x7cb0('0x15')](_0x195254)){for(var _0x1e0dd3=0x0;_0x1e0dd3<_0x195254['length'];_0x1e0dd3+=0x1){_0x195254[_0x1e0dd3]=this[_0x7cb0('0x20')](_0x195254[_0x1e0dd3],_0x5e8520);}return _0x195254;}if(!_[_0x7cb0('0x21')](_0x195254)){return _0x195254;}if(_[_0x7cb0('0x22')](_0x5e8520)){_0x5e8520=[_0x5e8520];}if(!_[_0x7cb0('0x15')](_0x5e8520)){return _0x195254;}for(var _0x1989af=0x0;_0x1989af<_0x5e8520[_0x7cb0('0x23')];_0x1989af+=0x1){_[_0x7cb0('0x24')](_0x195254,_0x5e8520[_0x1989af]);}for(var _0xd181a5 in _0x195254){if(_0x195254[_0x7cb0('0x25')](_0xd181a5)){_0x195254[_0xd181a5]=this[_0x7cb0('0x20')](_0x195254[_0xd181a5],_0x5e8520);}}return _0x195254;};exports[_0x7cb0('0x26')]=function(_0x49d230){return _0x49d230['match'](RegExp(_0x7cb0('0x27')))?!![]:![];};exports[_0x7cb0('0x28')]=function(_0x569574){return _0x569574['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7cb0('0x29')]=function(_0x19057d,_0x2f8760){var _0xa6a631=[];var _0x527116=/[ `!@#$%^&*()_\-?~]/;var _0xf64f36=_0x2f8760?_0x7cb0('0x2a'):_0x7cb0('0x2b');_0x19057d[_0x7cb0('0xa')](/[ ,]+/)[_0x7cb0('0x2c')](function(_0x3b97fa){_0x3b97fa=_0x3b97fa['replace'](/([^:]")"+/g,'$1');_0x3b97fa='+'+_0x3b97fa+'*';var _0x2d6dba=_0x3b97fa[_0x7cb0('0x2d')](_0x527116);if(_0x2d6dba){_0x3b97fa='\x22'+_0x3b97fa+'\x22';}_0xa6a631['push'](_0x3b97fa);});_0xf64f36=_0xf64f36[_0x7cb0('0x2e')]('{EXPR}',_0xa6a631[_0x7cb0('0x2f')]('\x20'));return _0xf64f36;};exports[_0x7cb0('0x30')]=function(_0x52f21a,_0xe683ea,_0x4e5f64){var _0x10a1dc={},_0x353f11={};if(_0xe683ea['query'][_0x7cb0('0x31')]){_0xe683ea[_0x7cb0('0x32')]['id']=_0xe683ea[_0x7cb0('0x32')][_0x7cb0('0x31')];delete _0xe683ea['query'][_0x7cb0('0x31')];}_0x10a1dc[_0x7cb0('0x7')]=_['map'](_0x52f21a,_0x7cb0('0x13'));_0x10a1dc['query']=_['keys'](_0xe683ea[_0x7cb0('0x32')]);_0x10a1dc[_0x7cb0('0xb')]=_[_0x7cb0('0x33')](_0x10a1dc[_0x7cb0('0x7')],_0x10a1dc['query']);_0x353f11[_0x7cb0('0x34')]=_[_0x7cb0('0x33')](_0x10a1dc['model'],this[_0x7cb0('0x8')](_0xe683ea[_0x7cb0('0x32')][_0x7cb0('0x8')]));_0x353f11['attributes']=_0x353f11[_0x7cb0('0x34')][_0x7cb0('0x23')]?_0x353f11[_0x7cb0('0x34')]:_0x10a1dc['model'];if(!_0xe683ea['query'][_0x7cb0('0x25')](_0x7cb0('0x35'))){_0x353f11[_0x7cb0('0x36')]=this[_0x7cb0('0x36')](_0xe683ea[_0x7cb0('0x32')][_0x7cb0('0x36')]);_0x353f11[_0x7cb0('0x37')]=this['offset'](_0xe683ea[_0x7cb0('0x32')][_0x7cb0('0x37')]);}_0x353f11[_0x7cb0('0x38')]=this[_0x7cb0('0x16')](_0xe683ea['query'][_0x7cb0('0x16')]);_0x353f11[_0x7cb0('0x39')]=this[_0x7cb0('0xb')](_['pick'](_0xe683ea['query'],_0x10a1dc['filters']),_0x52f21a);if(_0xe683ea['query'][_0x7cb0('0x3a')]){var _0x288f2e=_0x52f21a;var _0x4cfefc=_0xe683ea[_0x7cb0('0x32')]['filter'];if(typeof _0x4cfefc==='object'){_0x288f2e=_['filter'](_0x52f21a,function(_0x516470){return _['includes'](_0x4cfefc[_0x7cb0('0x3b')],_0x516470[_0x7cb0('0x13')]);});_0x4cfefc=_0x4cfefc[_0x7cb0('0x3c')];}_0x353f11['where']=_['merge'](_0x353f11[_0x7cb0('0x39')],{'$or':_[_0x7cb0('0x17')](_0x288f2e,function(_0x58ac4f){if(_0x58ac4f['type']!=='VIRTUAL'){if(_0x4e5f64){return sequelize['where'](sequelize['fn'](_0x7cb0('0x3d'),sequelize[_0x7cb0('0x1a')](_0x58ac4f[_0x7cb0('0x13')])),{'$like':sequelize['fn'](_0x7cb0('0x3d'),'%'+_0xe683ea[_0x7cb0('0x32')]['filter']+'%')});}else{var _0x3d50ca={};_0x3d50ca[_0x58ac4f[_0x7cb0('0x13')]]={'$like':'%'+_0xe683ea['query'][_0x7cb0('0x3a')]+'%'};return _0x3d50ca;}}})});}_0x353f11=_[_0x7cb0('0x3e')]({},_0x353f11,_0xe683ea[_0x7cb0('0x3f')]);return _0x353f11;};exports['include']=function(_0x4dbac5){var _0x88de91=[];if(_0x4dbac5[_0x7cb0('0x40')]){_0x88de91[_0x7cb0('0x41')]({'all':!![]});}else if(_0x4dbac5[_0x7cb0('0x42')]){if(Array[_0x7cb0('0x15')](_0x4dbac5[_0x7cb0('0x42')])){_0x88de91=Object[_0x7cb0('0x6')](_0x4dbac5[_0x7cb0('0x42')])[_0x7cb0('0x17')](function(_0x3111a8){return parseIncludeModel(_0x4dbac5['include'][_0x3111a8]);});}else{var _0x496437=parseIncludeModel(_0x4dbac5[_0x7cb0('0x42')]);_0x88de91[_0x7cb0('0x41')](_0x496437);}}return _0x88de91;}; \ No newline at end of file +var _0x0df5=['unsigned','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','replace','push','{EXPR}','join','query','$id','name','model','attributes','intersection','nolimit','limit','offset','order','sort','where','pick','filter','columns','value','merge','VIRTUAL','lower','options','include','includeAll','lodash','sequelize','../../mysqldb','parse','includes','keys','alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','isArray','map','indexOf','priority','col'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0df5,0xaa));var _0x50df=function(_0x14d12d,_0x579944){_0x14d12d=_0x14d12d-0x0;var _0x36a9c4=_0x0df5[_0x14d12d];return _0x36a9c4;};'use strict';var _=require(_0x50df('0x0'));var sequelize=require(_0x50df('0x1'));var moment=require('moment');var db=require(_0x50df('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3fe19c){var _0x3d2888=['ne'];try{var _0x3a2c96=JSON[_0x50df('0x3')](_0x3fe19c);var _0xa6145e=Object['keys'](_0x3a2c96)[0x0];return _0x3d2888[_0x50df('0x4')](_0xa6145e);}catch(_0x19ebf3){return![];}}function getOperatorValue(_0x32741a){var _0x5197cf=JSON['parse'](_0x32741a);var _0x29c276=Object[_0x50df('0x5')](_0x5197cf)[0x0];var _0x378825=_0x5197cf[_0x29c276];return{['$'+_0x29c276]:_0x378825};}function parseIncludeModel(_0x2e3020){var _0x5973c9=JSON[_0x50df('0x3')](_0x2e3020);return{'model':db[_0x5973c9['model']],'as':_0x5973c9[_0x50df('0x6')],'attributes':_0x5973c9[_0x50df('0x7')],'raw':_0x5973c9[_0x50df('0x8')]};}exports[_0x50df('0x7')]=function(_0x5b203a){var _0x4f684a=null;if(_0x5b203a){_0x4f684a=_0x5b203a[_0x50df('0x9')](',');}return _0x4f684a;};exports[_0x50df('0xa')]=function(_0x2be288,_0x3881a0){var _0x22e537={};if(!_[_0x50df('0xb')](_0x2be288)){_[_0x50df('0xc')](_0x2be288,function(_0x450470,_0x20c8cc){try{if(_0x3881a0){var _0x4db0d3=_[_0x50df('0xd')](_0x3881a0,{'name':_0x20c8cc})||{};if(hasSequelizeOperator(_0x450470)){_0x22e537[_0x20c8cc]=getOperatorValue(_0x450470);}else if(_0x4db0d3[_0x50df('0xe')]===_0x50df('0xf')&&_[_0x50df('0x10')](_0x450470)){var _0x248149=JSON[_0x50df('0x3')](_0x450470);var _0x1a0cc5={'$gte':moment(moment(_0x248149[_0x50df('0x11')])[_0x50df('0x12')](_0x50df('0x13')))[_0x50df('0x14')]()[_0x50df('0x12')](),'$lte':moment(moment(_0x248149[_0x50df('0x15')])[_0x50df('0x12')](_0x50df('0x13')))[_0x50df('0x14')]()[_0x50df('0x16')](0x1,'s')[_0x50df('0x12')]()};_0x22e537[_0x20c8cc]=_0x1a0cc5;}else if(_0x4db0d3['name']==='uniqueid'){_0x22e537[_0x20c8cc]=_0x450470;}else{_0x22e537[_0x20c8cc]=_[_0x50df('0x17')](_0x450470)?_0x450470:JSON[_0x50df('0x3')](_0x450470);}}else{_0x22e537[_0x20c8cc]=_['isArray'](_0x450470)?_0x450470:JSON[_0x50df('0x3')](_0x450470);}}catch(_0xc3c606){_0x22e537[_0x20c8cc]=_0x450470[_0x50df('0x9')](',');}});}return _0x22e537;};exports['limit']=function(_0x9472a9){_0x9472a9=parseInt(_0x9472a9,0xa);if(!_0x9472a9||_0x9472a9<0x0){_0x9472a9=LIMIT_VALUE;}return _0x9472a9;};exports['offset']=function(_0x23d1a0){_0x23d1a0=parseInt(_0x23d1a0,0xa);if(!_0x23d1a0||_0x23d1a0<0x0){_0x23d1a0=0x0;}return _0x23d1a0;};exports['sort']=function(_0x237c67){var _0x56dc6f,_0x1efb20=null;if(_0x237c67){_0x56dc6f=_0x237c67[_0x50df('0x9')](',');_0x1efb20=_[_0x50df('0x18')](_0x56dc6f,function(_0x4e7f32){if(_0x4e7f32[_0x50df('0x19')]('-')===0x0){return[_0x4e7f32===_0x50df('0x1a')?sequelize['cast'](sequelize[_0x50df('0x1b')]('priority'),_0x50df('0x1c')):_0x4e7f32['substr'](0x1),'DESC'];}else{return[_0x4e7f32===_0x50df('0x1a')?sequelize['cast'](sequelize[_0x50df('0x1b')](_0x50df('0x1a')),_0x50df('0x1c')):_0x4e7f32,_0x50df('0x1d')];}});}return _0x1efb20;};exports[_0x50df('0x1e')]=function(_0x23423c,_0x15de93){if(_[_0x50df('0xb')](_0x23423c)){return _0x23423c;}if(_[_0x50df('0x17')](_0x23423c)){for(var _0x2cba08=0x0;_0x2cba08<_0x23423c[_0x50df('0x1f')];_0x2cba08+=0x1){_0x23423c[_0x2cba08]=this[_0x50df('0x1e')](_0x23423c[_0x2cba08],_0x15de93);}return _0x23423c;}if(!_[_0x50df('0x20')](_0x23423c)){return _0x23423c;}if(_[_0x50df('0x21')](_0x15de93)){_0x15de93=[_0x15de93];}if(!_[_0x50df('0x17')](_0x15de93)){return _0x23423c;}for(var _0x2ba8e8=0x0;_0x2ba8e8<_0x15de93[_0x50df('0x1f')];_0x2ba8e8+=0x1){_['unset'](_0x23423c,_0x15de93[_0x2ba8e8]);}for(var _0x205cb1 in _0x23423c){if(_0x23423c[_0x50df('0x22')](_0x205cb1)){_0x23423c[_0x205cb1]=this[_0x50df('0x1e')](_0x23423c[_0x205cb1],_0x15de93);}}return _0x23423c;};exports[_0x50df('0x23')]=function(_0x21be0d){return _0x21be0d[_0x50df('0x24')](RegExp(_0x50df('0x25')))?!![]:![];};exports[_0x50df('0x26')]=function(_0x5096d9){return _0x5096d9['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x50df('0x27')]=function(_0x369eab,_0x4bcf58){var _0x48a5be=[];var _0x6a3d88=/[ `!@#$%^&*()_\-?~]/;var _0x9e52e6=_0x4bcf58?'\x22{EXPR}\x22':'{EXPR}';_0x369eab[_0x50df('0x9')](/[ ,]+/)['forEach'](function(_0x5d19e5){_0x5d19e5=_0x5d19e5[_0x50df('0x28')](/([^:]")"+/g,'$1');_0x5d19e5='+'+_0x5d19e5+'*';var _0x55da4c=_0x5d19e5[_0x50df('0x24')](_0x6a3d88);if(_0x55da4c){_0x5d19e5='\x22'+_0x5d19e5+'\x22';}_0x48a5be[_0x50df('0x29')](_0x5d19e5);});_0x9e52e6=_0x9e52e6[_0x50df('0x28')](_0x50df('0x2a'),_0x48a5be[_0x50df('0x2b')]('\x20'));return _0x9e52e6;};exports['getOptions']=function(_0x19dd71,_0x517cfe,_0x546ac3){var _0x5a40e8={},_0x353163={};if(_0x517cfe[_0x50df('0x2c')][_0x50df('0x2d')]){_0x517cfe[_0x50df('0x2c')]['id']=_0x517cfe[_0x50df('0x2c')]['$id'];delete _0x517cfe['query']['$id'];}_0x5a40e8['model']=_[_0x50df('0x18')](_0x19dd71,_0x50df('0x2e'));_0x5a40e8['query']=_[_0x50df('0x5')](_0x517cfe[_0x50df('0x2c')]);_0x5a40e8['filters']=_['intersection'](_0x5a40e8[_0x50df('0x2f')],_0x5a40e8['query']);_0x353163[_0x50df('0x30')]=_[_0x50df('0x31')](_0x5a40e8[_0x50df('0x2f')],this[_0x50df('0x7')](_0x517cfe[_0x50df('0x2c')][_0x50df('0x7')]));_0x353163[_0x50df('0x30')]=_0x353163[_0x50df('0x30')][_0x50df('0x1f')]?_0x353163[_0x50df('0x30')]:_0x5a40e8[_0x50df('0x2f')];if(!_0x517cfe['query'][_0x50df('0x22')](_0x50df('0x32'))){_0x353163[_0x50df('0x33')]=this[_0x50df('0x33')](_0x517cfe[_0x50df('0x2c')][_0x50df('0x33')]);_0x353163['offset']=this[_0x50df('0x34')](_0x517cfe['query'][_0x50df('0x34')]);}_0x353163[_0x50df('0x35')]=this[_0x50df('0x36')](_0x517cfe[_0x50df('0x2c')]['sort']);_0x353163[_0x50df('0x37')]=this[_0x50df('0xa')](_[_0x50df('0x38')](_0x517cfe[_0x50df('0x2c')],_0x5a40e8[_0x50df('0xa')]),_0x19dd71);if(_0x517cfe[_0x50df('0x2c')][_0x50df('0x39')]){var _0x40ce6e=_0x19dd71;var _0x193c1f=_0x517cfe[_0x50df('0x2c')][_0x50df('0x39')];if(typeof _0x193c1f==='object'){_0x40ce6e=_['filter'](_0x19dd71,function(_0x2c51f7){return _[_0x50df('0x4')](_0x193c1f[_0x50df('0x3a')],_0x2c51f7[_0x50df('0x2e')]);});_0x193c1f=_0x193c1f[_0x50df('0x3b')];}_0x353163['where']=_[_0x50df('0x3c')](_0x353163[_0x50df('0x37')],{'$or':_['map'](_0x40ce6e,function(_0x277210){if(_0x277210[_0x50df('0xe')]!==_0x50df('0x3d')){if(_0x546ac3){return sequelize[_0x50df('0x37')](sequelize['fn']('lower',sequelize[_0x50df('0x1b')](_0x277210[_0x50df('0x2e')])),{'$like':sequelize['fn'](_0x50df('0x3e'),'%'+_0x517cfe['query'][_0x50df('0x39')]+'%')});}else{var _0x5c39bd={};_0x5c39bd[_0x277210[_0x50df('0x2e')]]={'$like':'%'+_0x517cfe['query'][_0x50df('0x39')]+'%'};return _0x5c39bd;}}})});}_0x353163=_['merge']({},_0x353163,_0x517cfe[_0x50df('0x3f')]);return _0x353163;};exports[_0x50df('0x40')]=function(_0x55f580){var _0x46d214=[];if(_0x55f580[_0x50df('0x41')]){_0x46d214[_0x50df('0x29')]({'all':!![]});}else if(_0x55f580['include']){if(Array[_0x50df('0x17')](_0x55f580[_0x50df('0x40')])){_0x46d214=Object[_0x50df('0x5')](_0x55f580[_0x50df('0x40')])[_0x50df('0x18')](function(_0x1c3adb){return parseIncludeModel(_0x55f580[_0x50df('0x40')][_0x1c3adb]);});}else{var _0xadb943=parseIncludeModel(_0x55f580[_0x50df('0x40')]);_0x46d214['push'](_0xadb943);}}return _0x46d214;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index c537c50..8265b58 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 _0xdc97=['openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','filterAgentAttributes','role','userpic','voiceStatusTime','mailCapacity','phoneBarEnableScreenRecordingByAgent','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','http','chatPause','faxPause','mailPause','smsPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','voiceStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','isArray','Queue','map','findOne','uniq','getAgentIdsByQueues','includes','resolve','name','openchannelPause','voicePause','whatsappPause','pauseType','find','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','DESC','ASC','fullname,internal','fullname','internal','substring','indexOf','toLowerCase','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus'];(function(_0x2bd211,_0x522300){var _0x5b963e=function(_0x553314){while(--_0x553314){_0x2bd211['push'](_0x2bd211['shift']());}};_0x5b963e(++_0x522300);}(_0xdc97,0x13b));var _0x7dc9=function(_0x53bba6,_0x48fdc2){_0x53bba6=_0x53bba6-0x0;var _0x53591c=_0xdc97[_0x53bba6];return _0x53591c;};'use strict';var _=require(_0x7dc9('0x0'));var jayson=require(_0x7dc9('0x1'));var db=require(_0x7dc9('0x2'))['db'];var amiClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232c});function isAgentPaused(_0x2b86da,_0x478a95){var _0x2a77c1=[_0x2b86da[_0x7dc9('0x4')],_0x2b86da[_0x7dc9('0x5')],_0x2b86da[_0x7dc9('0x6')],_0x2b86da['openchannelPause'],_0x2b86da[_0x7dc9('0x7')],_0x2b86da['voicePause'],_0x2b86da['whatsappPause']];if(!_0x478a95)return _[_0x7dc9('0x8')](_0x2a77c1);var _0x23737d=_[_0x7dc9('0x9')](_0x2a77c1);return _0x23737d[_0x7dc9('0xa')]>0x0&&_0x23737d[_0x7dc9('0xa')]<_0x2a77c1['length']?!![]:![];}function isIdle(_0xb2fa2a){return _0xb2fa2a===_0x7dc9('0xb')||_0xb2fa2a===_0x7dc9('0xc')||_0xb2fa2a===_0x7dc9('0xd')||_0xb2fa2a===_0x7dc9('0xe')||_[_0x7dc9('0xf')](_0xb2fa2a);}function isAgentIdle(_0x1e336a){if(_0x1e336a['voiceStatus']!=='idle'&&_0x1e336a['voicePause']){_0x1e336a['voiceStatus']=_0x7dc9('0x10');return![];}return _[_0x7dc9('0x8')]([_0x1e336a['chatStatus'],_0x1e336a[_0x7dc9('0x11')],_0x1e336a[_0x7dc9('0x12')],_0x1e336a[_0x7dc9('0x13')],_0x1e336a[_0x7dc9('0x14')],_0x1e336a[_0x7dc9('0x15')],_0x1e336a[_0x7dc9('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x7dc9('0x17'),{})[_0x7dc9('0x18')](function(_0x1b0aa1){if(_0x1b0aa1[_0x7dc9('0x19')]){throw new Error(_0x7dc9('0x1a'));}var _0xbe0437=_0x1b0aa1[_0x7dc9('0x1b')];return routingClient[_0x7dc9('0x1c')](_0x7dc9('0x17'),{})['then'](function(_0x22577e){if(_0x22577e['error']){throw new Error(_0x7dc9('0x1d'));}var _0x1cc237=_0x22577e['result'];return _[_0x7dc9('0x1e')]({},_0xbe0437,_0x1cc237);});})[_0x7dc9('0x1f')](function(_0x12f08d){throw _0x12f08d;});}exports[_0x7dc9('0x20')]=getRealtimeAgents;function getAgentStatus(_0x43ec33){var _0x184bfd=_0x7dc9('0xc');if(isAgentPaused(_0x43ec33))_0x184bfd=_0x7dc9('0x10');else if(isAgentPaused(_0x43ec33,!![]))_0x184bfd=_0x7dc9('0x21');else if(isAgentIdle(_0x43ec33))_0x184bfd=_0x7dc9('0xb');else _0x184bfd='busy';return _0x184bfd;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x12954f,_0x5981e2){var _0x596e0f=_[_0x7dc9('0x22')](_0x12954f)?_0x12954f:[_0x12954f];var _0x27f7fa=_['startCase'](_0x5981e2)+_0x7dc9('0x23');var _0x43d31f=_[_0x7dc9('0x24')](_0x596e0f,function(_0x4906b1){return db[_0x27f7fa][_0x7dc9('0x25')]({'where':{'id':_0x4906b1}})[_0x7dc9('0x18')](function(_0xf95336){if(!_0xf95336)return[];return _0xf95336['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x43d31f)['then'](function(_0x25b383){var _0x32d032=_(_0x25b383)['flatten']()['map']('id')[_0x7dc9('0x26')]()['value']();return _0x32d032;});}exports[_0x7dc9('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1c690b,_0x3a74a0,_0x3e4102){try{if(_0x3a74a0[_0x7dc9('0xa')]>0x0){_0x1c690b=_0x1c690b[_0x7dc9('0x9')](function(_0x236d42){return _0x3a74a0[_0x7dc9('0x28')](_0x236d42['id']);});}var _0x1fcf0e=_0x1c690b[_0x7dc9('0x9')](function(_0x14083d){var _0x2a456c='busy';if(isAgentIdle(_0x14083d)){_0x2a456c='idle';}return _0x2a456c===_0x3e4102;});return _['map'](_0x1fcf0e,'id');}catch(_0x49a4a5){throw _0x49a4a5;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x553a03,_0x58c4e8,_0x59f5d8){return Promise[_0x7dc9('0x29')]()[_0x7dc9('0x18')](function(){if(_0x58c4e8[_0x7dc9('0xa')]>0x0){_0x553a03=_0x553a03[_0x7dc9('0x9')](function(_0x3300ff){return _0x58c4e8[_0x7dc9('0x28')](_0x3300ff['id']);});}return _0x553a03;})['then'](function(){return db['User']['findAll']({'attributes':['id',_0x7dc9('0x2a'),'fullname',_0x7dc9('0x4'),_0x7dc9('0x5'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),_0x7dc9('0x2d'),_0x7dc9('0x2e')],'where':{'id':{'$in':_['map'](_0x553a03,'id')}},'raw':!![]});})[_0x7dc9('0x18')](function(_0x4cdec4){return _0x4cdec4[_0x7dc9('0x24')](function(_0x16431a){var _0x3dc8e0=_[_0x7dc9('0x2f')](_0x553a03,['id',_0x16431a['id']]);var _0x48d9b2=filterAgentAttributes(_0x3dc8e0);_[_0x7dc9('0x1e')](_0x16431a,_0x48d9b2);_0x16431a['globalStatus']=getAgentStatus(_0x16431a);return _0x16431a;});})[_0x7dc9('0x18')](function(_0x4f47af){var _0x590bed=sortAgentsByStatus(_0x4f47af,_0x59f5d8);return _[_0x7dc9('0x24')](_0x590bed,'id');})[_0x7dc9('0x1f')](function(_0x21e036){throw _0x21e036;});}exports[_0x7dc9('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5dac5b){var _0x9376a5={'fields':[],'order':null};var _0x183d87=_0x5dac5b[_0x7dc9('0x31')](',');_0x9376a5[_0x7dc9('0x32')]=_[_0x7dc9('0x9')](_0x183d87,function(_0x21faa6){if(!_0x21faa6[_0x7dc9('0x28')](_0x7dc9('0x33'))){return!![];}_0x9376a5[_0x7dc9('0x34')]=_[_0x7dc9('0x35')](_0x21faa6,'-')?_0x7dc9('0x36'):_0x7dc9('0x37');return![];});return _0x9376a5;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x34b5c9){if(!_0x34b5c9){_0x34b5c9=_0x7dc9('0x38');}if(_0x34b5c9[_0x7dc9('0x28')](_0x7dc9('0x39'))&&!_0x34b5c9['includes'](_0x7dc9('0x3a'))){var _0x89db0e=_0x34b5c9[_0x7dc9('0x3b')](0x0,_0x34b5c9[_0x7dc9('0x3c')](_0x7dc9('0x39')));_0x34b5c9+=','+_0x89db0e+_0x7dc9('0x3a');}return _0x34b5c9;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x553230,_0x3ef9fd){var _0x36a965=_0x553230['sort'](function(_0x3a705c,_0x4a37ec){if(_0x3a705c[_0x7dc9('0x33')]===_0x4a37ec[_0x7dc9('0x33')]){if(_0x3a705c[_0x7dc9('0x33')]==='pause'){if(_0x3ef9fd===_0x7dc9('0x36')){return(_0x3a705c[_0x7dc9('0x2e')]||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return(_0x3a705c['pauseType']||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c['fullname']['toLowerCase']()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?-0x1:0x1;}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec['fullname'][_0x7dc9('0x3d')]()?-0x1:0x1;}}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?-0x1:0x1;}}});return _0x36a965;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x3774cb){var _0x42e110=['userpic',_0x7dc9('0x3e'),_0x7dc9('0x3f'),_0x7dc9('0x40'),'pauseType',_0x7dc9('0x40'),'internal','address',_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause','whatsappPause',_0x7dc9('0x5'),'voicePause',_0x7dc9('0x41'),_0x7dc9('0x42'),'mailCapacity',_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x45'),_0x7dc9('0x46'),_0x7dc9('0x47'),_0x7dc9('0x48'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x4b'),_0x7dc9('0x4c'),_0x7dc9('0x13'),_0x7dc9('0x12'),_0x7dc9('0x14'),'whatsappStatus',_0x7dc9('0x11'),'voiceStatus','chatStatusTime',_0x7dc9('0x4d'),_0x7dc9('0x4e'),_0x7dc9('0x4f'),_0x7dc9('0x50'),_0x7dc9('0x51'),'voiceStatusTime',_0x7dc9('0x52'),_0x7dc9('0x53'),_0x7dc9('0x54'),'phoneBarEnableScreenRecordingByAgent',_0x7dc9('0x55'),_0x7dc9('0x56')];var _0x2cf133=[_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause',_0x7dc9('0x2d'),_0x7dc9('0x5'),_0x7dc9('0x2c'),_0x7dc9('0x3e')];var _0x877a67=_(_0x3774cb)[_0x7dc9('0x57')](_0x2cf133)[_0x7dc9('0x58')](_0x42e110)[_0x7dc9('0x59')]();return _0x877a67;}exports[_0x7dc9('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x7dc9('0x2a'),_0x7dc9('0x39'),_0x7dc9('0x5b'),'internal',_0x7dc9('0x3e'),_0x7dc9('0x33'),_0x7dc9('0x5c'),_0x7dc9('0x3f'),_0x7dc9('0x2e'),'lastPauseAt',_0x7dc9('0x5'),_0x7dc9('0x4'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),'whatsappPause','chatStatus','faxStatus',_0x7dc9('0x12'),_0x7dc9('0x13'),_0x7dc9('0x14'),_0x7dc9('0x15'),'whatsappStatus','chatStatusTime',_0x7dc9('0x51'),_0x7dc9('0x4e'),_0x7dc9('0x4d'),_0x7dc9('0x4f'),_0x7dc9('0x5d'),_0x7dc9('0x50'),_0x7dc9('0x41'),'faxCapacity',_0x7dc9('0x5e'),_0x7dc9('0x42'),_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x46'),'faxCurrentCapacity',_0x7dc9('0x48'),_0x7dc9('0x47'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x5f'),_0x7dc9('0x55'),_0x7dc9('0x53'),_0x7dc9('0x60'),_0x7dc9('0x52'),_0x7dc9('0x56'),_0x7dc9('0x54')];}exports[_0x7dc9('0x61')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x814b=['mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','filterAgentAttributes','openchannelStatusTime','voiceStatusTime','faxCapacity','chatCurrentCapacity','phoneBarEnableScreenRecordingByAgent','onhold','routealias','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','resolve','findAll','name','fullname','openchannelPause','whatsappPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','fields','order','fullname,internal','indexOf','internal','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity'];(function(_0x3a7d74,_0x2044f0){var _0x949ca3=function(_0x58c8e4){while(--_0x58c8e4){_0x3a7d74['push'](_0x3a7d74['shift']());}};_0x949ca3(++_0x2044f0);}(_0x814b,0x1a2));var _0xb814=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x814b[_0x1bc013];return _0x55df36;};'use strict';var _=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var db=require(_0xb814('0x2'))['db'];var amiClient=jayson[_0xb814('0x3')][_0xb814('0x4')]({'port':0x232a});var routingClient=jayson[_0xb814('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x38c21a,_0x3e1e9){var _0x258866=[_0x38c21a[_0xb814('0x5')],_0x38c21a[_0xb814('0x6')],_0x38c21a[_0xb814('0x7')],_0x38c21a['openchannelPause'],_0x38c21a[_0xb814('0x8')],_0x38c21a[_0xb814('0x9')],_0x38c21a['whatsappPause']];if(!_0x3e1e9)return _[_0xb814('0xa')](_0x258866);var _0x2913a6=_[_0xb814('0xb')](_0x258866);return _0x2913a6[_0xb814('0xc')]>0x0&&_0x2913a6[_0xb814('0xc')]<_0x258866[_0xb814('0xc')]?!![]:![];}function isIdle(_0x1086f8){return _0x1086f8===_0xb814('0xd')||_0x1086f8===_0xb814('0xe')||_0x1086f8===_0xb814('0xf')||_0x1086f8===_0xb814('0x10')||_['isNil'](_0x1086f8);}function isAgentIdle(_0x43dfe6){if(_0x43dfe6['voiceStatus']!==_0xb814('0xd')&&_0x43dfe6[_0xb814('0x9')]){_0x43dfe6[_0xb814('0x11')]=_0xb814('0x12');return![];}return _[_0xb814('0xa')]([_0x43dfe6[_0xb814('0x13')],_0x43dfe6[_0xb814('0x14')],_0x43dfe6[_0xb814('0x15')],_0x43dfe6[_0xb814('0x16')],_0x43dfe6[_0xb814('0x17')],_0x43dfe6[_0xb814('0x11')],_0x43dfe6[_0xb814('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xb814('0x19')](_0xb814('0x1a'),{})[_0xb814('0x1b')](function(_0x3a71d6){if(_0x3a71d6[_0xb814('0x1c')]){throw new Error(_0xb814('0x1d'));}var _0x125ce2=_0x3a71d6[_0xb814('0x1e')];return routingClient[_0xb814('0x19')]('Agents',{})[_0xb814('0x1b')](function(_0x55ba16){if(_0x55ba16[_0xb814('0x1c')]){throw new Error(_0xb814('0x1f'));}var _0x4c3007=_0x55ba16['result'];return _['merge']({},_0x125ce2,_0x4c3007);});})[_0xb814('0x20')](function(_0x4d5276){throw _0x4d5276;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0xb684ea){var _0x24211d=_0xb814('0xe');if(isAgentPaused(_0xb684ea))_0x24211d='pause';else if(isAgentPaused(_0xb684ea,!![]))_0x24211d=_0xb814('0x21');else if(isAgentIdle(_0xb684ea))_0x24211d='idle';else _0x24211d=_0xb814('0x22');return _0x24211d;}exports[_0xb814('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x3b267e,_0x470e81){var _0x27352e=_[_0xb814('0x24')](_0x3b267e)?_0x3b267e:[_0x3b267e];var _0x1f5d40=_['startCase'](_0x470e81)+_0xb814('0x25');var _0x52b7a3=_[_0xb814('0x26')](_0x27352e,function(_0x457dac){return db[_0x1f5d40][_0xb814('0x27')]({'where':{'id':_0x457dac}})[_0xb814('0x1b')](function(_0x1c8a2e){if(!_0x1c8a2e)return[];return _0x1c8a2e[_0xb814('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xb814('0x29')](_0x52b7a3)['then'](function(_0x392222){var _0xc0ef66=_(_0x392222)[_0xb814('0x2a')]()[_0xb814('0x26')]('id')[_0xb814('0x2b')]()[_0xb814('0x2c')]();return _0xc0ef66;});}exports[_0xb814('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1e4e89,_0x5a6291,_0x271aa8){try{if(_0x5a6291[_0xb814('0xc')]>0x0){_0x1e4e89=_0x1e4e89['filter'](function(_0x9008b2){return _0x5a6291[_0xb814('0x2e')](_0x9008b2['id']);});}var _0x530744=_0x1e4e89['filter'](function(_0x20577b){var _0x2051d0='busy';if(isAgentIdle(_0x20577b)){_0x2051d0=_0xb814('0xd');}return _0x2051d0===_0x271aa8;});return _['map'](_0x530744,'id');}catch(_0x6efe9a){throw _0x6efe9a;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4cfc58,_0x419cd9,_0x4a4f27){return Promise[_0xb814('0x2f')]()[_0xb814('0x1b')](function(){if(_0x419cd9[_0xb814('0xc')]>0x0){_0x4cfc58=_0x4cfc58['filter'](function(_0x51d5ae){return _0x419cd9[_0xb814('0x2e')](_0x51d5ae['id']);});}return _0x4cfc58;})[_0xb814('0x1b')](function(){return db['User'][_0xb814('0x30')]({'attributes':['id',_0xb814('0x31'),_0xb814('0x32'),_0xb814('0x5'),_0xb814('0x6'),_0xb814('0x7'),_0xb814('0x33'),'smsPause',_0xb814('0x9'),_0xb814('0x34'),_0xb814('0x35')],'where':{'id':{'$in':_[_0xb814('0x26')](_0x4cfc58,'id')}},'raw':!![]});})[_0xb814('0x1b')](function(_0x4ff31a){return _0x4ff31a[_0xb814('0x26')](function(_0x57e6e6){var _0x43db67=_[_0xb814('0x36')](_0x4cfc58,['id',_0x57e6e6['id']]);var _0xe0f509=filterAgentAttributes(_0x43db67);_['merge'](_0x57e6e6,_0xe0f509);_0x57e6e6[_0xb814('0x37')]=getAgentStatus(_0x57e6e6);return _0x57e6e6;});})[_0xb814('0x1b')](function(_0x4ea6f8){var _0x2fcd92=sortAgentsByStatus(_0x4ea6f8,_0x4a4f27);return _[_0xb814('0x26')](_0x2fcd92,'id');})[_0xb814('0x20')](function(_0x1f7cd8){throw _0x1f7cd8;});}exports[_0xb814('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x467cf9){var _0x4d81eb={'fields':[],'order':null};var _0xa6ce87=_0x467cf9['split'](',');_0x4d81eb[_0xb814('0x39')]=_['filter'](_0xa6ce87,function(_0x4492ef){if(!_0x4492ef['includes'](_0xb814('0x37'))){return!![];}_0x4d81eb[_0xb814('0x3a')]=_['startsWith'](_0x4492ef,'-')?'DESC':'ASC';return![];});return _0x4d81eb;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x17549e){if(!_0x17549e){_0x17549e=_0xb814('0x3b');}if(_0x17549e[_0xb814('0x2e')](_0xb814('0x32'))&&!_0x17549e['includes']('internal')){var _0x6f15d3=_0x17549e['substring'](0x0,_0x17549e[_0xb814('0x3c')](_0xb814('0x32')));_0x17549e+=','+_0x6f15d3+_0xb814('0x3d');}return _0x17549e;}exports[_0xb814('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x42653f,_0x37369f){var _0x3b7f5a=_0x42653f[_0xb814('0x3f')](function(_0x31989d,_0x4b6ff8){if(_0x31989d['globalStatus']===_0x4b6ff8['globalStatus']){if(_0x31989d[_0xb814('0x37')]==='pause'){if(_0x37369f===_0xb814('0x40')){return(_0x31989d['pauseType']||'')<(_0x4b6ff8[_0xb814('0x35')]||'')||_0x31989d[_0xb814('0x32')][_0xb814('0x41')]()>_0x4b6ff8[_0xb814('0x32')]['toLowerCase']()?0x1:-0x1;}else{return(_0x31989d[_0xb814('0x35')]||'')<(_0x4b6ff8[_0xb814('0x35')]||'')||_0x31989d[_0xb814('0x32')][_0xb814('0x41')]()>_0x4b6ff8[_0xb814('0x32')][_0xb814('0x41')]()?-0x1:0x1;}}else{if(_0x37369f==='DESC'){return _0x31989d[_0xb814('0x32')][_0xb814('0x41')]()<_0x4b6ff8[_0xb814('0x32')][_0xb814('0x41')]()?0x1:-0x1;}else{return _0x31989d[_0xb814('0x32')][_0xb814('0x41')]()<_0x4b6ff8[_0xb814('0x32')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x37369f==='DESC'){return _0x31989d[_0xb814('0x37')]<_0x4b6ff8[_0xb814('0x37')]?0x1:-0x1;}else{return _0x31989d[_0xb814('0x37')]<_0x4b6ff8[_0xb814('0x37')]?-0x1:0x1;}}});return _0x3b7f5a;}exports[_0xb814('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x40e627){var _0x24b697=[_0xb814('0x43'),_0xb814('0x44'),_0xb814('0x45'),_0xb814('0x46'),'pauseType',_0xb814('0x46'),_0xb814('0x3d'),'address',_0xb814('0x5'),'openchannelPause',_0xb814('0x7'),_0xb814('0x8'),_0xb814('0x34'),_0xb814('0x6'),_0xb814('0x9'),_0xb814('0x47'),_0xb814('0x48'),_0xb814('0x49'),_0xb814('0x4a'),_0xb814('0x4b'),'faxCapacity','chatCurrentCapacity',_0xb814('0x4c'),_0xb814('0x4d'),_0xb814('0x4e'),_0xb814('0x4f'),_0xb814('0x50'),_0xb814('0x13'),_0xb814('0x16'),'mailStatus',_0xb814('0x17'),_0xb814('0x18'),_0xb814('0x14'),'voiceStatus',_0xb814('0x51'),'openchannelStatusTime',_0xb814('0x52'),'smsStatusTime',_0xb814('0x53'),_0xb814('0x54'),'voiceStatusTime',_0xb814('0x55'),_0xb814('0x56'),_0xb814('0x57'),'phoneBarEnableScreenRecordingByAgent',_0xb814('0x58'),'routealias'];var _0x13bdcf=[_0xb814('0x5'),'openchannelPause',_0xb814('0x7'),'smsPause','whatsappPause',_0xb814('0x6'),_0xb814('0x9'),_0xb814('0x44')];var _0x47a814=_(_0x40e627)[_0xb814('0x59')](_0x13bdcf)['pick'](_0x24b697)[_0xb814('0x2c')]();return _0x47a814;}exports[_0xb814('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name',_0xb814('0x32'),'role',_0xb814('0x3d'),_0xb814('0x44'),_0xb814('0x37'),_0xb814('0x43'),_0xb814('0x45'),_0xb814('0x35'),_0xb814('0x46'),_0xb814('0x6'),'chatPause',_0xb814('0x7'),_0xb814('0x33'),'smsPause',_0xb814('0x9'),_0xb814('0x34'),'chatStatus',_0xb814('0x14'),'mailStatus','openchannelStatus',_0xb814('0x17'),'voiceStatus',_0xb814('0x18'),_0xb814('0x51'),_0xb814('0x54'),'mailStatusTime',_0xb814('0x5b'),'smsStatusTime',_0xb814('0x5c'),_0xb814('0x53'),_0xb814('0x47'),_0xb814('0x5d'),_0xb814('0x49'),_0xb814('0x48'),_0xb814('0x4a'),_0xb814('0x4b'),_0xb814('0x5e'),'faxCurrentCapacity',_0xb814('0x4d'),_0xb814('0x4c'),_0xb814('0x4e'),_0xb814('0x4f'),_0xb814('0x5f'),_0xb814('0x58'),'destconnectedlinenum',_0xb814('0x60'),'queue',_0xb814('0x61'),_0xb814('0x57')];}exports[_0xb814('0x62')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 0fce782..9190aa6 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 _0xba33=['format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','get','loggedInDb','available','find','merge','pick','initializeQueues','lodash','util','client','http','paused','waiting','busy','notInUse','onHold','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','error'];(function(_0x2715ac,_0x24e151){var _0x2010fa=function(_0x441f79){while(--_0x441f79){_0x2715ac['push'](_0x2715ac['shift']());}};_0x2010fa(++_0x24e151);}(_0xba33,0x1e3));var _0x3ba3=function(_0x227ca9,_0x23cd9d){_0x227ca9=_0x227ca9-0x0;var _0x220397=_0xba33[_0x227ca9];return _0x220397;};'use strict';var _=require(_0x3ba3('0x0'));var jayson=require('jayson/promise');var util=require(_0x3ba3('0x1'));var amiClient=jayson[_0x3ba3('0x2')][_0x3ba3('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x3ba3('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn',_0x3ba3('0x4'),_0x3ba3('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x3ba3('0x6'),'inUse','invalid','loggedInDb',_0x3ba3('0x7'),_0x3ba3('0x8'),'ringing',_0x3ba3('0x9'),_0x3ba3('0xa'),_0x3ba3('0xb'),_0x3ba3('0xc')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x3ba3('0xd'),_0x3ba3('0xe'),_0x3ba3('0xf'),_0x3ba3('0x10'),_0x3ba3('0x11'),_0x3ba3('0x12'),'Trunk',_0x3ba3('0x13'),_0x3ba3('0x14'),'erlangCalls',_0x3ba3('0x15'),_0x3ba3('0x16'),_0x3ba3('0x17'),_0x3ba3('0x18'),_0x3ba3('0x19'),'dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0x3ba3('0x1a'),_0x3ba3('0x1b'),_0x3ba3('0x1c'),_0x3ba3('0x1d'),_0x3ba3('0x1e'),_0x3ba3('0x1f')];function getRealtimeQueues(_0x22b826,_0x3b505e){var _0x21c2a1=_0x3b505e===_0x3ba3('0x20')?amiClient:routingClient;return _0x21c2a1[_0x3ba3('0x21')](_[_0x3ba3('0x22')](_0x3b505e)+_0x3ba3('0x23'),_0x22b826)['then'](function(_0x50aad2){if(_0x50aad2[_0x3ba3('0x24')])throw new Error(util[_0x3ba3('0x25')](_0x3ba3('0x26'),_0x3b505e));return _0x50aad2[_0x3ba3('0x27')];})[_0x3ba3('0x28')](function(_0x54c897){throw _0x54c897;});}exports[_0x3ba3('0x29')]=getRealtimeQueues;function initializeQueues(_0x31ec64,_0x3121b6,_0x26263c,_0x3fdc7f){var _0x262e69=DEFAULT_QUEUE_ATTRIBUTES;if(_0x26263c==='voice'){if(_0x3fdc7f===_0x3ba3('0x2a')){_0x262e69=_0x262e69[_0x3ba3('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3fdc7f===_0x3ba3('0x2c')){_0x262e69=_0x262e69[_0x3ba3('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x31ec64['map'](function(_0x48b664){var _0x3ba5de=_0x48b664[_0x3ba3('0x2d')]({'plain':!![]});_0x3ba5de[_0x3ba3('0x4')]=0x0;_0x3ba5de[_0x3ba3('0x2e')]=0x0;_0x3ba5de['loggedIn']=0x0;_0x3ba5de[_0x3ba3('0x2f')]=0x0;_0x3ba5de[_0x3ba3('0x5')]=0x0;if(_0x26263c==='voice'){_0x3ba5de['talking']=0x0;_0x3ba5de[_0x3ba3('0x6')]=0x0;if(_0x3fdc7f==='outbound'){_0x3ba5de[_0x3ba3('0xd')]=0x0;_0x3ba5de['originated']=0x0;}}var _0x5b1bd7=_[_0x3ba3('0x30')](_0x3121b6,['id',_0x3ba5de['id']]);if(_0x5b1bd7){_[_0x3ba3('0x31')](_0x3ba5de,_[_0x3ba3('0x32')](_0x5b1bd7,_0x262e69));}return _0x3ba5de;});}exports[_0x3ba3('0x33')]=initializeQueues; \ No newline at end of file +var _0xdc45=['busy','invalid','onHold','ringing','talking','unknown','pTalking','originated','message','statusMessage','dialMethod','Trunk','startPredictive','startProgressive','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','voice','request','Queues','then','format','result','inbound','concat','outbound','map','get','loggedInDb','loggedIn','available','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','paused','waiting'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdc45,0x169));var _0x5dc4=function(_0x44b369,_0x531321){_0x44b369=_0x44b369-0x0;var _0x53da7a=_0xdc45[_0x44b369];return _0x53da7a;};'use strict';var _=require(_0x5dc4('0x0'));var jayson=require(_0x5dc4('0x1'));var util=require(_0x5dc4('0x2'));var amiClient=jayson[_0x5dc4('0x3')][_0x5dc4('0x4')]({'port':0x232a});var routingClient=jayson[_0x5dc4('0x3')][_0x5dc4('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn',_0x5dc4('0x5'),_0x5dc4('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x5dc4('0x7'),'inUse',_0x5dc4('0x8'),'loggedInDb','notInUse',_0x5dc4('0x9'),_0x5dc4('0xa'),'ringInUse',_0x5dc4('0xb'),'unavailable',_0x5dc4('0xc')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x5dc4('0xd'),_0x5dc4('0xe'),_0x5dc4('0xf'),_0x5dc4('0x10'),'dialActive',_0x5dc4('0x11'),_0x5dc4('0x12'),_0x5dc4('0x13'),_0x5dc4('0x14'),'erlangCalls','erlangCallToSecond','erlangAbandonmentRate',_0x5dc4('0x15'),_0x5dc4('0x16'),_0x5dc4('0x17'),_0x5dc4('0x18'),_0x5dc4('0x19'),'predictiveIntervalTotalCalls',_0x5dc4('0x1a'),_0x5dc4('0x1b'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x5dc4('0x1c')];function getRealtimeQueues(_0x188911,_0x533ca8){var _0x13fde1=_0x533ca8===_0x5dc4('0x1d')?amiClient:routingClient;return _0x13fde1[_0x5dc4('0x1e')](_['startCase'](_0x533ca8)+_0x5dc4('0x1f'),_0x188911)[_0x5dc4('0x20')](function(_0x262cc4){if(_0x262cc4['error'])throw new Error(util[_0x5dc4('0x21')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x533ca8));return _0x262cc4[_0x5dc4('0x22')];})['catch'](function(_0x23145c){throw _0x23145c;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x3583b6,_0x379ab6,_0x99ef56,_0x185220){var _0x87786f=DEFAULT_QUEUE_ATTRIBUTES;if(_0x99ef56===_0x5dc4('0x1d')){if(_0x185220===_0x5dc4('0x23')){_0x87786f=_0x87786f[_0x5dc4('0x24')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x185220===_0x5dc4('0x25')){_0x87786f=_0x87786f['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x3583b6[_0x5dc4('0x26')](function(_0xd7d41c){var _0x5bceb6=_0xd7d41c[_0x5dc4('0x27')]({'plain':!![]});_0x5bceb6[_0x5dc4('0x5')]=0x0;_0x5bceb6[_0x5dc4('0x28')]=0x0;_0x5bceb6[_0x5dc4('0x29')]=0x0;_0x5bceb6[_0x5dc4('0x2a')]=0x0;_0x5bceb6[_0x5dc4('0x6')]=0x0;if(_0x99ef56==='voice'){_0x5bceb6['talking']=0x0;_0x5bceb6[_0x5dc4('0x7')]=0x0;if(_0x185220===_0x5dc4('0x25')){_0x5bceb6[_0x5dc4('0xd')]=0x0;_0x5bceb6[_0x5dc4('0xe')]=0x0;}}var _0x642283=_['find'](_0x379ab6,['id',_0x5bceb6['id']]);if(_0x642283){_[_0x5dc4('0x2b')](_0x5bceb6,_[_0x5dc4('0x2c')](_0x642283,_0x87786f));}return _0x5bceb6;});}exports[_0x5dc4('0x2d')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 5a55aa6..6664562 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(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_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 _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index b676456..79e6ef7 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 _0x9f09=['licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','child_process','execSync','orderBy','length','filter','family','IPv4','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','createHash','md5','update','digest','hex','platform'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9f09,0xd0));var _0x99f0=function(_0x1bf28a,_0x5a4f35){_0x1bf28a=_0x1bf28a-0x0;var _0x50f8c0=_0x9f09[_0x1bf28a];return _0x50f8c0;};'use strict';var _=require(_0x99f0('0x0'));var os=require('os');var crypto=require(_0x99f0('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x99f0('0x2'))[_0x99f0('0x3')];var config=require('../environment');function getInterfaces(){var _0x3738e5=[];var _0x2457dd=os['networkInterfaces']();var _0x45e7a5=_[_0x99f0('0x4')](_['keys'](_0x2457dd));for(var _0x503193=0x0;_0x503193<_0x45e7a5[_0x99f0('0x5')];_0x503193++){var _0x3071d3=_0x2457dd[_0x45e7a5[_0x503193]][_0x99f0('0x6')](function(_0x3dd4d7){return _0x3dd4d7[_0x99f0('0x7')]===_0x99f0('0x8')&&_0x3dd4d7['internal']===![];});_0x3738e5=_0x3738e5['concat'](_0x3071d3);}return _0x3738e5;}function getFirstInterface(){var _0x5739d2=_[_0x99f0('0x9')](getInterfaces());return{'macAddress':_0x5739d2&&_0x5739d2['mac']?_0x5739d2[_0x99f0('0xa')]:_0x99f0('0xb'),'ipAddress':_0x5739d2&&_0x5739d2['address']?_0x5739d2[_0x99f0('0xc')]:'127.0.0.1'};}exports[_0x99f0('0xd')]=getFirstInterface;function getCPUhash(){var _0x59fb15=_[_0x99f0('0x4')](os[_0x99f0('0xe')]()[_0x99f0('0xf')](function(_0x3c6d1a){return _0x3c6d1a[_0x99f0('0x10')];}))['join'](':');return crypto[_0x99f0('0x11')](_0x99f0('0x12'))[_0x99f0('0x13')](_0x59fb15)[_0x99f0('0x14')](_0x99f0('0x15'));}exports['getUuid']=function(){var _0x3c136e=os[_0x99f0('0x16')]();var _0x1ab655=/[0-9a-f-]{36}/;if(config[_0x99f0('0x17')]&&_0x1ab655[_0x99f0('0x18')](config[_0x99f0('0x17')])){return config[_0x99f0('0x17')];}else if(_0x3c136e===_0x99f0('0x19')){return exec(_0x99f0('0x1a'),{'encoding':_0x99f0('0x1b')})[_0x99f0('0x1c')]('\x0d\x0a','');}else{var _0x3c2577=getFirstInterface();var _0x32a5f6=getCPUhash();var _0x12554a=_0x32a5f6+'|'+os[_0x99f0('0x1d')]()+'|'+_0x3c2577[_0x99f0('0x1e')]+'|'+_0x3c2577[_0x99f0('0x1f')];var _0x306891=crypto[_0x99f0('0x11')](_0x99f0('0x12'))['update'](_0x12554a)[_0x99f0('0x14')](_0x99f0('0x15'));return _0x306891['substring'](0x0,0x8)+'-'+_0x306891[_0x99f0('0x20')](0x8,0xc)+'-'+_0x306891['substring'](0xc,0x10)+'-'+_0x306891[_0x99f0('0x20')](0x10,0x14)+'-'+_0x306891[_0x99f0('0x20')](0x14);}}; \ No newline at end of file +var _0x8e12=['child_process','execSync','../environment','networkInterfaces','keys','length','filter','family','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','map','model','join','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','createHash','substring','lodash'];(function(_0x58d5f0,_0x39d03b){var _0x117550=function(_0x2f3e70){while(--_0x2f3e70){_0x58d5f0['push'](_0x58d5f0['shift']());}};_0x117550(++_0x39d03b);}(_0x8e12,0x175));var _0x28e1=function(_0x42ec18,_0xb9213b){_0x42ec18=_0x42ec18-0x0;var _0x434827=_0x8e12[_0x42ec18];return _0x434827;};'use strict';var _=require(_0x28e1('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x28e1('0x1'))[_0x28e1('0x2')];var config=require(_0x28e1('0x3'));function getInterfaces(){var _0x4f4be9=[];var _0x572fe8=os[_0x28e1('0x4')]();var _0x1cebc2=_['orderBy'](_[_0x28e1('0x5')](_0x572fe8));for(var _0x3a073b=0x0;_0x3a073b<_0x1cebc2[_0x28e1('0x6')];_0x3a073b++){var _0x22efe0=_0x572fe8[_0x1cebc2[_0x3a073b]][_0x28e1('0x7')](function(_0x552002){return _0x552002[_0x28e1('0x8')]==='IPv4'&&_0x552002[_0x28e1('0x9')]===![];});_0x4f4be9=_0x4f4be9[_0x28e1('0xa')](_0x22efe0);}return _0x4f4be9;}function getFirstInterface(){var _0x56b5ae=_['head'](getInterfaces());return{'macAddress':_0x56b5ae&&_0x56b5ae['mac']?_0x56b5ae[_0x28e1('0xb')]:_0x28e1('0xc'),'ipAddress':_0x56b5ae&&_0x56b5ae['address']?_0x56b5ae[_0x28e1('0xd')]:_0x28e1('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x24abac=_[_0x28e1('0xf')](os['cpus']()[_0x28e1('0x10')](function(_0x1758e3){return _0x1758e3[_0x28e1('0x11')];}))[_0x28e1('0x12')](':');return crypto['createHash'](_0x28e1('0x13'))[_0x28e1('0x14')](_0x24abac)[_0x28e1('0x15')](_0x28e1('0x16'));}exports[_0x28e1('0x17')]=function(){var _0x33e0c5=os[_0x28e1('0x18')]();var _0xba0bbe=/[0-9a-f-]{36}/;if(config[_0x28e1('0x19')]&&_0xba0bbe[_0x28e1('0x1a')](config[_0x28e1('0x19')])){return config[_0x28e1('0x19')];}else if(_0x33e0c5===_0x28e1('0x1b')){return exec(_0x28e1('0x1c'),{'encoding':'utf8'})[_0x28e1('0x1d')]('\x0d\x0a','');}else{var _0x244771=getFirstInterface();var _0x376533=getCPUhash();var _0x4f6fa6=_0x376533+'|'+os['hostname']()+'|'+_0x244771[_0x28e1('0x1e')]+'|'+_0x244771[_0x28e1('0x1f')];var _0xe25298=crypto[_0x28e1('0x20')](_0x28e1('0x13'))[_0x28e1('0x14')](_0x4f6fa6)[_0x28e1('0x15')]('hex');return _0xe25298[_0x28e1('0x21')](0x0,0x8)+'-'+_0xe25298[_0x28e1('0x21')](0x8,0xc)+'-'+_0xe25298['substring'](0xc,0x10)+'-'+_0xe25298[_0x28e1('0x21')](0x10,0x14)+'-'+_0xe25298[_0x28e1('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 384b871..3b22e66 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 _0x94f2=['get','data1','data2','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then'];(function(_0x1c1d43,_0x558db1){var _0x4ed37e=function(_0x200195){while(--_0x200195){_0x1c1d43['push'](_0x1c1d43['shift']());}};_0x4ed37e(++_0x558db1);}(_0x94f2,0x131));var _0x294f=function(_0x350155,_0x5c3402){_0x350155=_0x350155-0x0;var _0x20e45d=_0x94f2[_0x350155];return _0x20e45d;};'use strict';var util=require(_0x294f('0x0'));var moment=require(_0x294f('0x1'));var rp=require('request-promise');var BPromise=require(_0x294f('0x2'));var pkginfo=require(_0x294f('0x3'))(module,_0x294f('0x4'));var db=require(_0x294f('0x5'))['db'];var encryptor=require(_0x294f('0x6'));var hardware=require(_0x294f('0x7'));var logger=require(_0x294f('0x8'))('license');var HOST=_0x294f('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1b4043){return new BPromise(function(_0x458f89,_0x832752){var _0x372b2a=util[_0x294f('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x1b4043,module[_0x294f('0xb')][_0x294f('0x4')]);if(oldToken){_0x372b2a=util[_0x294f('0xa')](_0x294f('0xc'),HOST,_0x1b4043,module['exports'][_0x294f('0x4')],oldToken);}var _0x3f3954={'uri':_0x372b2a,'method':_0x294f('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x3f3954)[_0x294f('0xe')](function(_0xee7865){_0x458f89(_0xee7865);})['catch'](function(_0x77274e){_0x832752(_0x77274e);});});}function manageLicense(_0x3e4cd6,_0xe46274){var _0x50a873=_0xe46274[_0x294f('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x50a873[_0x294f('0x10')]!==_0x3e4cd6&&!_0x50a873[_0x294f('0x11')]){oldToken=_0x50a873['data1'];}httpRequest(_0x3e4cd6)[_0x294f('0xe')](function(_0x2ecd24){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2ecd24['active']){isOldTokenSent=![];if(!_0x50a873[_0x294f('0x12')]&&_0x50a873[_0x294f('0x12')]!=_0x2ecd24['license']||_0x50a873['license']&&_0x50a873['data2']){logger[_0x294f('0x13')](_0x294f('0x14'));}if(_0x50a873[_0x294f('0x12')]&&!_0x50a873['data2']&&_0x50a873[_0x294f('0x12')]!=_0x2ecd24['license']){logger[_0x294f('0x13')](_0x294f('0x15'));}if(_0x50a873[_0x294f('0x12')]&&!_0x50a873[_0x294f('0x11')]&&_0x50a873[_0x294f('0x12')]==_0x2ecd24[_0x294f('0x12')]){return _0xe46274;}return _0xe46274[_0x294f('0x16')]({'data1':_0x3e4cd6,'data2':null,'license':_0x2ecd24['license']});}else{if(_0x2ecd24[_0x294f('0x12')]||_0x50a873[_0x294f('0x12')]){if(!_0x50a873['data2']){if(_0x50a873[_0x294f('0x10')]==_0x3e4cd6){GRAY_PERIOD_REASON='Disabled';logger[_0x294f('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x294f('0x17');logger[_0x294f('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x50a873[_0x294f('0x10')],_0x3e4cd6);}logger[_0x294f('0x13')](_0x294f('0x18'),GRAY_PERIOD_REASON[_0x294f('0x19')](),moment()[_0x294f('0xa')](_0x294f('0x1a')));return _0xe46274[_0x294f('0x16')]({'data2':encryptor[_0x294f('0x1b')](moment()['format'](_0x294f('0x1a')))});}else{if(moment()['diff'](encryptor[_0x294f('0x1c')](_0x50a873[_0x294f('0x11')]),_0x294f('0x1d'))>DAYS){logger[_0x294f('0x13')](_0x294f('0x1e'),moment()[_0x294f('0xa')](_0x294f('0x1a')));isOldTokenSent=![];return _0xe46274[_0x294f('0x16')]({'data1':_0x3e4cd6,'data2':null,'license':null});}}}else{if(_0x50a873[_0x294f('0x10')]!=_0x3e4cd6){logger[_0x294f('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x50a873['data1'],_0x3e4cd6);return _0xe46274[_0x294f('0x16')]({'data1':_0x3e4cd6,'data2':null,'license':null});}}}return _0xe46274;})[_0x294f('0xe')](function(_0x2ac6cf){_0xe46274=_0x2ac6cf;})['catch'](function(_0x50f0b1){logger[_0x294f('0x1f')](_0x50f0b1[_0x294f('0x20')]);})[_0x294f('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x294f('0x22')](),_0xe46274);},TIME);});}function defaultLicense(){var _0x47d66b=hardware[_0x294f('0x22')]();if(_0x47d66b){return db['License'][_0x294f('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x47d66b}})[_0x294f('0x24')](function(_0x15ae52,_0x345422){logger[_0x294f('0x13')](_0x294f('0x25'),_0x47d66b);manageLicense(_0x47d66b,_0x15ae52);})[_0x294f('0x26')](function(_0xcef60a){logger[_0x294f('0x1f')](_0xcef60a['message']);});}}exports[_0x294f('0x27')]=defaultLicense; \ No newline at end of file +var _0x4b26=['data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','catch','get'];(function(_0x35633a,_0x43bc37){var _0x3af26e=function(_0x4f4b9d){while(--_0x4f4b9d){_0x35633a['push'](_0x35633a['shift']());}};_0x3af26e(++_0x43bc37);}(_0x4b26,0x128));var _0x64b2=function(_0x3226df,_0x1d0e41){_0x3226df=_0x3226df-0x0;var _0x5b2a3e=_0x4b26[_0x3226df];return _0x5b2a3e;};'use strict';var util=require(_0x64b2('0x0'));var moment=require(_0x64b2('0x1'));var rp=require('request-promise');var BPromise=require(_0x64b2('0x2'));var pkginfo=require(_0x64b2('0x3'))(module,_0x64b2('0x4'));var db=require(_0x64b2('0x5'))['db'];var encryptor=require(_0x64b2('0x6'));var hardware=require(_0x64b2('0x7'));var logger=require(_0x64b2('0x8'))(_0x64b2('0x9'));var HOST=_0x64b2('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x25d18d){return new BPromise(function(_0x21427e,_0x2a9978){var _0x47c0ca=util[_0x64b2('0xb')](_0x64b2('0xc'),HOST,_0x25d18d,module[_0x64b2('0xd')][_0x64b2('0x4')]);if(oldToken){_0x47c0ca=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x25d18d,module[_0x64b2('0xd')]['version'],oldToken);}var _0x5602f1={'uri':_0x47c0ca,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5602f1)['then'](function(_0x1ed232){_0x21427e(_0x1ed232);})[_0x64b2('0xe')](function(_0x4a789f){_0x2a9978(_0x4a789f);});});}function manageLicense(_0x3a4db1,_0x756c31){var _0x50fa90=_0x756c31[_0x64b2('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x50fa90[_0x64b2('0x10')]!==_0x3a4db1&&!_0x50fa90[_0x64b2('0x11')]){oldToken=_0x50fa90[_0x64b2('0x10')];}httpRequest(_0x3a4db1)[_0x64b2('0x12')](function(_0x1bd309){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1bd309[_0x64b2('0x13')]){isOldTokenSent=![];if(!_0x50fa90[_0x64b2('0x9')]&&_0x50fa90[_0x64b2('0x9')]!=_0x1bd309[_0x64b2('0x9')]||_0x50fa90['license']&&_0x50fa90['data2']){logger[_0x64b2('0x14')](_0x64b2('0x15'));}if(_0x50fa90[_0x64b2('0x9')]&&!_0x50fa90[_0x64b2('0x11')]&&_0x50fa90['license']!=_0x1bd309[_0x64b2('0x9')]){logger[_0x64b2('0x14')](_0x64b2('0x16'));}if(_0x50fa90['license']&&!_0x50fa90[_0x64b2('0x11')]&&_0x50fa90['license']==_0x1bd309[_0x64b2('0x9')]){return _0x756c31;}return _0x756c31[_0x64b2('0x17')]({'data1':_0x3a4db1,'data2':null,'license':_0x1bd309['license']});}else{if(_0x1bd309[_0x64b2('0x9')]||_0x50fa90[_0x64b2('0x9')]){if(!_0x50fa90['data2']){if(_0x50fa90[_0x64b2('0x10')]==_0x3a4db1){GRAY_PERIOD_REASON='Disabled';logger[_0x64b2('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x64b2('0x18');logger[_0x64b2('0x14')](_0x64b2('0x19'),_0x50fa90[_0x64b2('0x10')],_0x3a4db1);}logger[_0x64b2('0x14')](_0x64b2('0x1a'),GRAY_PERIOD_REASON[_0x64b2('0x1b')](),moment()[_0x64b2('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x756c31[_0x64b2('0x17')]({'data2':encryptor[_0x64b2('0x1c')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x64b2('0x1d')](encryptor['decryptString'](_0x50fa90[_0x64b2('0x11')]),_0x64b2('0x1e'))>DAYS){logger[_0x64b2('0x14')](_0x64b2('0x1f'),moment()[_0x64b2('0xb')](_0x64b2('0x20')));isOldTokenSent=![];return _0x756c31[_0x64b2('0x17')]({'data1':_0x3a4db1,'data2':null,'license':null});}}}else{if(_0x50fa90['data1']!=_0x3a4db1){logger[_0x64b2('0x14')](_0x64b2('0x19'),_0x50fa90['data1'],_0x3a4db1);return _0x756c31[_0x64b2('0x17')]({'data1':_0x3a4db1,'data2':null,'license':null});}}}return _0x756c31;})[_0x64b2('0x12')](function(_0x27fada){_0x756c31=_0x27fada;})[_0x64b2('0xe')](function(_0x3f5704){logger['error'](_0x3f5704[_0x64b2('0x21')]);})[_0x64b2('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x64b2('0x23')](),_0x756c31);},TIME);});}function defaultLicense(){var _0x1b8c09=hardware[_0x64b2('0x23')]();if(_0x1b8c09){return db[_0x64b2('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x1b8c09}})[_0x64b2('0x25')](function(_0x49ae80,_0x68b5c8){logger['info'](_0x64b2('0x26'),_0x1b8c09);manageLicense(_0x1b8c09,_0x49ae80);})[_0x64b2('0xe')](function(_0x129478){logger['error'](_0x129478['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 76dcea3..8614749 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 _0xb08f=['then','catch','uuid','data1','isEmpty','data2','split','decryptString','format','parse','add','days','machineUuid','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','telephone','users','telephones','forEach','user','exports','util','moment','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find'];(function(_0x15d409,_0x16c2ee){var _0x379106=function(_0x3ab526){while(--_0x3ab526){_0x15d409['push'](_0x15d409['shift']());}};_0x379106(++_0x16c2ee);}(_0xb08f,0x6c));var _0xfb08=function(_0x5684e2,_0x1128d8){_0x5684e2=_0x5684e2-0x0;var _0x8ba338=_0xb08f[_0x5684e2];return _0x8ba338;};'use strict';var util=require(_0xfb08('0x0'));var _=require('lodash');var moment=require(_0xfb08('0x1'));var BPromise=require(_0xfb08('0x2'));var hardware=require('./hardware');var encryptor=require(_0xfb08('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfb08('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfb08('0x5'),'machineUuid':hardware[_0xfb08('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':_0xfb08('0x7'),'machineUuid':hardware[_0xfb08('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x352112){return new BPromise(function(_0x423c94,_0xfd052b){return db['License'][_0xfb08('0x8')](_['defaults'](_0x352112,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xa4b6e4){return checkLicense(_0xa4b6e4,null);})[_0xfb08('0x9')](function(_0x4ac67a){_0x423c94(_0x4ac67a);return;})[_0xfb08('0xa')](function(_0x1ae689){_0xfd052b(_0x1ae689);});});}function checkLicense(_0xe7bf5b,_0x10dd2c){if(!_0xe7bf5b){demoLicense[_0xfb08('0xb')]=_0xe7bf5b[_0xfb08('0xc')];return demoLicense;}try{var _0x2221bd=_0x10dd2c||_0xe7bf5b['license'];if(_[_0xfb08('0xd')](_0x2221bd)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x9cc754=_0xe7bf5b[_0xfb08('0xc')];var _0x417481=_0xe7bf5b[_0xfb08('0xe')];var _0x3b0675=_0x9cc754[_0xfb08('0xf')]('-')[0x4];var _0x1fcdda=_0x9cc754[_0xfb08('0xf')]('-')[0x0];var _0x46a20e=encryptor[_0xfb08('0x10')](_0x2221bd,util[_0xfb08('0x11')]('%s:%s:%s',_0x3b0675,_0x9cc754,_0x1fcdda));var _0x309def=JSON[_0xfb08('0x12')](_0x46a20e);_0x309def['demo']=![];_0x309def['uuid']=_0x9cc754;_0x309def['machineUuid']=hardware['getUuid']();if(_0x417481){var _0x2f95d1=encryptor['decryptString'](_0x417481);_0x309def['gray']=_0x2f95d1;_0x309def['deadline']=moment(_0x2f95d1)[_0xfb08('0x13')](0x7,_0xfb08('0x14'))['format']();_0x309def['grayReason']=_0x309def[_0xfb08('0xb')]!=_0x309def[_0xfb08('0x15')]?_0xfb08('0x16'):_0xfb08('0x17');}return _0x309def;}catch(_0x528c10){breakingLicense[_0xfb08('0xb')]=_0xe7bf5b[_0xfb08('0xc')];breakingLicense[_0xfb08('0x18')]=_0x528c10[_0xfb08('0x18')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x37c9df,_0x3c9992){getLicense()[_0xfb08('0x9')](function(_0x1163f9){return db[_0xfb08('0x19')][_0xfb08('0x1a')]({'attributes':[_0xfb08('0x1b'),[db[_0xfb08('0x1c')]['fn'](_0xfb08('0x1d'),db[_0xfb08('0x1c')][_0xfb08('0x1e')](_0xfb08('0x1b'))),_0xfb08('0x1f')]],'group':'role','where':{'role':{'$or':[_0xfb08('0x20'),'user',_0xfb08('0x21')]}},'raw':!![]})[_0xfb08('0x9')](function(_0x41f8ff){var _0x2c1bbd={'user':_0x1163f9[_0xfb08('0x22')]||0x0,'telephone':_0x1163f9[_0xfb08('0x23')]||0x0};_0x41f8ff[_0xfb08('0x24')](function(_0x155a1d){var _0x5d7a67=_0x155a1d['role']===_0xfb08('0x20')?_0xfb08('0x25'):_0x155a1d['role'];_0x2c1bbd[_0x5d7a67]-=_0x155a1d[_0xfb08('0x1f')];if(_0x2c1bbd[_0x5d7a67]<0x0)_0x2c1bbd[_0x5d7a67]=0x0;});_0x37c9df(_0x2c1bbd);return;});})[_0xfb08('0xa')](function(_0x399710){_0x3c9992(_0x399710);});});}function checkUserLimits(_0x17c4bb){return new BPromise(function(_0x28ff10,_0x1aa0a0){getLimits()[_0xfb08('0x9')](function(_0x47c76b){var _0x57c365=_['pick'](_['countBy'](_0x17c4bb,_0xfb08('0x1b')),['admin','user',_0xfb08('0x21')]);var _0x4320c1=(_0x57c365[_0xfb08('0x20')]||0x0)+(_0x57c365[_0xfb08('0x25')]||0x0);var _0xce4591=_0x57c365[_0xfb08('0x21')]||0x0;if(_0x4320c1>_0x47c76b[_0xfb08('0x25')])return _0x1aa0a0('License\x20limit\x20reached\x20for\x20users');if(_0xce4591>_0x47c76b[_0xfb08('0x21')])return _0x1aa0a0('License\x20limit\x20reached\x20for\x20telephones');return _0x28ff10();})[_0xfb08('0xa')](function(_0x2f48a6){_0x1aa0a0(_0x2f48a6);});});}module[_0xfb08('0x26')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x1423=['demo','gray','deadline','add','days','machineUuid','changed','message','User','findAll','role','sequelize','COUNT','admin','user','telephone','then','users','telephones','forEach','count','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s'];(function(_0x1e416e,_0x3fdb88){var _0x4cb834=function(_0x29a9ea){while(--_0x29a9ea){_0x1e416e['push'](_0x1e416e['shift']());}};_0x4cb834(++_0x3fdb88);}(_0x1423,0x12d));var _0x3142=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1423[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3142('0x0'));var _=require('lodash');var moment=require(_0x3142('0x1'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0x3142('0x2'));var db=require(_0x3142('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3142('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3142('0x5'),'machineUuid':hardware[_0x3142('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3142('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3142('0x7'),'machineUuid':hardware[_0x3142('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x33f242){return new BPromise(function(_0x161f21,_0x12efee){return db[_0x3142('0x8')][_0x3142('0x9')](_[_0x3142('0xa')](_0x33f242,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x369328){return checkLicense(_0x369328,null);})['then'](function(_0x129024){_0x161f21(_0x129024);return;})[_0x3142('0xb')](function(_0x51bdb9){_0x12efee(_0x51bdb9);});});}function checkLicense(_0x52f49e,_0x44e0e6){if(!_0x52f49e){demoLicense[_0x3142('0xc')]=_0x52f49e[_0x3142('0xd')];return demoLicense;}try{var _0x11b13f=_0x44e0e6||_0x52f49e[_0x3142('0xe')];if(_[_0x3142('0xf')](_0x11b13f)){throw new Error(_0x3142('0x10'));}var _0x89799d=_0x52f49e[_0x3142('0xd')];var _0x27f3ba=_0x52f49e['data2'];var _0xf36192=_0x89799d[_0x3142('0x11')]('-')[0x4];var _0x48a0e2=_0x89799d['split']('-')[0x0];var _0x49ab57=encryptor[_0x3142('0x12')](_0x11b13f,util[_0x3142('0x13')](_0x3142('0x14'),_0xf36192,_0x89799d,_0x48a0e2));var _0x3c5f41=JSON['parse'](_0x49ab57);_0x3c5f41[_0x3142('0x15')]=![];_0x3c5f41['uuid']=_0x89799d;_0x3c5f41['machineUuid']=hardware[_0x3142('0x6')]();if(_0x27f3ba){var _0x36df16=encryptor[_0x3142('0x12')](_0x27f3ba);_0x3c5f41[_0x3142('0x16')]=_0x36df16;_0x3c5f41[_0x3142('0x17')]=moment(_0x36df16)[_0x3142('0x18')](0x7,_0x3142('0x19'))['format']();_0x3c5f41['grayReason']=_0x3c5f41[_0x3142('0xc')]!=_0x3c5f41[_0x3142('0x1a')]?_0x3142('0x1b'):'disabled';}return _0x3c5f41;}catch(_0x43fe7e){breakingLicense[_0x3142('0xc')]=_0x52f49e['data1'];breakingLicense[_0x3142('0x1c')]=_0x43fe7e[_0x3142('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2395c6,_0x52d909){getLicense()['then'](function(_0x2826f){return db[_0x3142('0x1d')][_0x3142('0x1e')]({'attributes':[_0x3142('0x1f'),[db[_0x3142('0x20')]['fn'](_0x3142('0x21'),db[_0x3142('0x20')]['col']('role')),'count']],'group':'role','where':{'role':{'$or':[_0x3142('0x22'),_0x3142('0x23'),_0x3142('0x24')]}},'raw':!![]})[_0x3142('0x25')](function(_0x1d692a){var _0xb32f60={'user':_0x2826f[_0x3142('0x26')]||0x0,'telephone':_0x2826f[_0x3142('0x27')]||0x0};_0x1d692a[_0x3142('0x28')](function(_0x3b9910){var _0x15d4d5=_0x3b9910[_0x3142('0x1f')]===_0x3142('0x22')?_0x3142('0x23'):_0x3b9910[_0x3142('0x1f')];_0xb32f60[_0x15d4d5]-=_0x3b9910[_0x3142('0x29')];if(_0xb32f60[_0x15d4d5]<0x0)_0xb32f60[_0x15d4d5]=0x0;});_0x2395c6(_0xb32f60);return;});})[_0x3142('0xb')](function(_0x41d6a0){_0x52d909(_0x41d6a0);});});}function checkUserLimits(_0x1060da){return new BPromise(function(_0x4c3a10,_0x49343e){getLimits()['then'](function(_0x1b90ba){var _0x32947f=_['pick'](_[_0x3142('0x2a')](_0x1060da,_0x3142('0x1f')),[_0x3142('0x22'),_0x3142('0x23'),_0x3142('0x24')]);var _0x30e7ab=(_0x32947f[_0x3142('0x22')]||0x0)+(_0x32947f[_0x3142('0x23')]||0x0);var _0xbfc7ab=_0x32947f[_0x3142('0x24')]||0x0;if(_0x30e7ab>_0x1b90ba[_0x3142('0x23')])return _0x49343e(_0x3142('0x2b'));if(_0xbfc7ab>_0x1b90ba[_0x3142('0x24')])return _0x49343e(_0x3142('0x2c'));return _0x4c3a10();})[_0x3142('0xb')](function(_0x265496){_0x49343e(_0x265496);});});}module[_0x3142('0x2d')]={'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 e21c9b6..9912a0b 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 _0xfb11=['exports','myappanuglar-secret','app-id'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xfb11[_0xa1e3e3];return _0xc980e9;};'use strict';module[_0x1fb1('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1fb1('0x1'),'GOOGLE_ID':_0x1fb1('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x065e=['secret','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x065e,0x1a7));var _0xe065=function(_0x50797c,_0x4bc847){_0x50797c=_0x50797c-0x0;var _0x11f52d=_0x065e[_0x50797c];return _0x11f52d;};'use strict';module[_0xe065('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe065('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 9abdc4d..cb5e363 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c86=['fileLogger'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x8c86,0x1d3));var _0x68c8=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8c86[_0x4b369d];return _0x571a98;};'use strict';var fileLogger=require('../utils/loggers')[_0x68c8('0x0')];module['exports']=fileLogger; \ No newline at end of file +var _0x3bcd=['fileLogger','../utils/loggers'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x3bcd,0x181));var _0xd3bc=function(_0x1611dc,_0x4885d0){_0x1611dc=_0x1611dc-0x0;var _0x257bae=_0x3bcd[_0x1611dc];return _0x257bae;};'use strict';var fileLogger=require(_0xd3bc('0x0'))[_0xd3bc('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index f79ceb0..520f3d3 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 _0x4fa4=['path','../../config/environment','join','root','legacy-libs','../../services/express/index.js','ami','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x5d3a05,_0x4add38){var _0x12141a=function(_0x388eec){while(--_0x388eec){_0x5d3a05['push'](_0x5d3a05['shift']());}};_0x12141a(++_0x4add38);}(_0x4fa4,0xc3));var _0x44fa=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x4fa4[_0x88cd7b];return _0x56fcc8;};'use strict';var path=require(_0x44fa('0x0'));var cfg=require(_0x44fa('0x1'));var env={'NODE_PATH':path['resolve'](path[_0x44fa('0x2')](cfg[_0x44fa('0x3')],_0x44fa('0x4')))};var pm2config={'apps':[{'name':'express','script':path[_0x44fa('0x2')](__dirname,_0x44fa('0x5')),'env':env},{'name':_0x44fa('0x6'),'script':path[_0x44fa('0x2')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0x44fa('0x7'),'script':path[_0x44fa('0x2')](__dirname,_0x44fa('0x8')),'env':env},{'name':'email','script':path[_0x44fa('0x2')](__dirname,_0x44fa('0x9')),'env':env},{'name':_0x44fa('0xa'),'script':path[_0x44fa('0x2')](__dirname,_0x44fa('0xb')),'env':env},{'name':_0x44fa('0xc'),'script':path[_0x44fa('0x2')](__dirname,_0x44fa('0xd')),'env':env}]};module[_0x44fa('0xe')]=pm2config; \ No newline at end of file +var _0x5aa4=['../../config/environment','resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x443520,_0x2fe333){var _0x20afa5=function(_0x13cf74){while(--_0x13cf74){_0x443520['push'](_0x443520['shift']());}};_0x20afa5(++_0x2fe333);}(_0x5aa4,0x1df));var _0x45aa=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x5aa4[_0x1ccbcc];return _0x1e873f;};'use strict';var path=require(_0x45aa('0x0'));var cfg=require(_0x45aa('0x1'));var env={'NODE_PATH':path[_0x45aa('0x2')](path[_0x45aa('0x3')](cfg[_0x45aa('0x4')],_0x45aa('0x5')))};var pm2config={'apps':[{'name':_0x45aa('0x6'),'script':path[_0x45aa('0x3')](__dirname,_0x45aa('0x7')),'env':env},{'name':_0x45aa('0x8'),'script':path[_0x45aa('0x3')](__dirname,_0x45aa('0x9')),'env':env},{'name':_0x45aa('0xa'),'script':path[_0x45aa('0x3')](__dirname,_0x45aa('0xb')),'env':env},{'name':'email','script':path[_0x45aa('0x3')](__dirname,_0x45aa('0xc')),'env':env},{'name':'routing','script':path[_0x45aa('0x3')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x45aa('0xd'),'script':path[_0x45aa('0x3')](__dirname,_0x45aa('0xe')),'env':env}]};module[_0x45aa('0xf')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 453f108..a4317d9 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 _0xeb70=['pm2','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x24403d,_0x94ebf1){var _0x3fabf3=function(_0x39b1a9){while(--_0x39b1a9){_0x24403d['push'](_0x24403d['shift']());}};_0x3fabf3(++_0x94ebf1);}(_0xeb70,0xd2));var _0x0eb7=function(_0x53771d,_0x20db45){_0x53771d=_0x53771d-0x0;var _0x110b90=_0xeb70[_0x53771d];return _0x110b90;};'use strict';var pm2=require(_0x0eb7('0x0'));var BPromise=require('bluebird');var config=require(_0x0eb7('0x1'));function connect(){return new BPromise(function(_0x31d9d0,_0x4915f5){return pm2[_0x0eb7('0x2')](function(_0x171088){if(_0x171088){return _0x4915f5(_0x171088);}return _0x31d9d0(_0x0eb7('0x3'));});});};exports[_0x0eb7('0x4')]=function(_0x3b2bc6){return connect()[_0x0eb7('0x5')](function(){return new BPromise(function(_0x487434,_0x4faaf2){return pm2[_0x0eb7('0x4')](_0x3b2bc6,function(_0x5a0769,_0x154d1d){if(_0x5a0769){return _0x4faaf2(_0x5a0769);}pm2[_0x0eb7('0x6')]();return _0x487434(_0x154d1d);});});});};exports[_0x0eb7('0x7')]=function(_0x396418){return connect()[_0x0eb7('0x5')](function(){return new BPromise(function(_0x323a9d,_0x24a606){return pm2['stop'](_0x396418,function(_0xbf149a,_0x319f39){if(_0xbf149a){return _0x24a606(_0xbf149a);}pm2[_0x0eb7('0x6')]();return _0x323a9d(_0x319f39);});});});};exports[_0x0eb7('0x8')]=function(_0x37a9b4){return connect()[_0x0eb7('0x5')](function(){return new BPromise(function(_0x975f18,_0x3eaffb){return pm2[_0x0eb7('0x8')](_0x37a9b4,function(_0x59a604,_0x2e22f7){if(_0x59a604){return _0x3eaffb(_0x59a604);}pm2[_0x0eb7('0x6')]();return _0x975f18(_0x2e22f7);});});});};exports[_0x0eb7('0x9')]=function(){return connect()[_0x0eb7('0x5')](function(){return new BPromise(function(_0x42708c,_0x230293){return pm2[_0x0eb7('0x9')](function(_0x50fac3,_0x3774fb){if(_0x50fac3){return _0x230293(_0x50fac3);}pm2[_0x0eb7('0x6')]();return _0x42708c(_0x3774fb);});});});};exports[_0x0eb7('0xa')]=function(_0x2e75a6){return connect()[_0x0eb7('0x5')](function(){return new BPromise(function(_0x21cb0c,_0x1c1c57){return pm2['describe'](_0x2e75a6,function(_0x49aed8,_0x5367df){if(_0x49aed8){return _0x1c1c57(_0x49aed8);}pm2[_0x0eb7('0x6')]();return _0x21cb0c(_0x5367df);});});});};exports[_0x0eb7('0xb')]=function(_0x5b330a){return connect()[_0x0eb7('0x5')](function(){return new BPromise(function(_0x472102,_0x1f8fb8){return pm2['delete'](_0x5b330a,function(_0x503555,_0x448cca){if(_0x503555){return _0x1f8fb8(_0x503555);}pm2[_0x0eb7('0x6')]();return _0x472102(_0x448cca);});});});};exports[_0x0eb7('0xc')]=function(){return connect()[_0x0eb7('0x5')](function(){return new BPromise(function(_0x2a4c9a,_0x10dfe6){return pm2[_0x0eb7('0xc')](function(_0x3f6e1d){if(_0x3f6e1d){return _0x10dfe6(_0x3f6e1d);}return _0x2a4c9a(_0x0eb7('0xd'));});});});}; \ No newline at end of file +var _0xec5e=['stop','restart','list','describe','delete','dump','bluebird','connect','connected','start','then','disconnect'];(function(_0x2e534c,_0x17a21c){var _0x3f06a8=function(_0x50a86a){while(--_0x50a86a){_0x2e534c['push'](_0x2e534c['shift']());}};_0x3f06a8(++_0x17a21c);}(_0xec5e,0xf6));var _0xeec5=function(_0x2c604b,_0x29ccb1){_0x2c604b=_0x2c604b-0x0;var _0x1ceffe=_0xec5e[_0x2c604b];return _0x1ceffe;};'use strict';var pm2=require('pm2');var BPromise=require(_0xeec5('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x3ba189,_0x268b83){return pm2[_0xeec5('0x1')](function(_0xa3caea){if(_0xa3caea){return _0x268b83(_0xa3caea);}return _0x3ba189(_0xeec5('0x2'));});});};exports[_0xeec5('0x3')]=function(_0x4547c7){return connect()[_0xeec5('0x4')](function(){return new BPromise(function(_0x39c761,_0x64ac8e){return pm2['start'](_0x4547c7,function(_0x5b7216,_0x9a6222){if(_0x5b7216){return _0x64ac8e(_0x5b7216);}pm2[_0xeec5('0x5')]();return _0x39c761(_0x9a6222);});});});};exports[_0xeec5('0x6')]=function(_0x28374e){return connect()['then'](function(){return new BPromise(function(_0x2e42e2,_0x4ec6a1){return pm2[_0xeec5('0x6')](_0x28374e,function(_0x4f45fa,_0x3af8b5){if(_0x4f45fa){return _0x4ec6a1(_0x4f45fa);}pm2[_0xeec5('0x5')]();return _0x2e42e2(_0x3af8b5);});});});};exports['restart']=function(_0x18795b){return connect()[_0xeec5('0x4')](function(){return new BPromise(function(_0x451532,_0xd489ab){return pm2[_0xeec5('0x7')](_0x18795b,function(_0x9a18ae,_0x4bac84){if(_0x9a18ae){return _0xd489ab(_0x9a18ae);}pm2['disconnect']();return _0x451532(_0x4bac84);});});});};exports[_0xeec5('0x8')]=function(){return connect()[_0xeec5('0x4')](function(){return new BPromise(function(_0x47de6e,_0x416c46){return pm2[_0xeec5('0x8')](function(_0x5b1b88,_0xe1e22c){if(_0x5b1b88){return _0x416c46(_0x5b1b88);}pm2[_0xeec5('0x5')]();return _0x47de6e(_0xe1e22c);});});});};exports[_0xeec5('0x9')]=function(_0x5bf443){return connect()[_0xeec5('0x4')](function(){return new BPromise(function(_0x431263,_0x40d897){return pm2[_0xeec5('0x9')](_0x5bf443,function(_0x821b48,_0x565535){if(_0x821b48){return _0x40d897(_0x821b48);}pm2[_0xeec5('0x5')]();return _0x431263(_0x565535);});});});};exports[_0xeec5('0xa')]=function(_0x5a9795){return connect()['then'](function(){return new BPromise(function(_0x50bd79,_0x2df5b4){return pm2['delete'](_0x5a9795,function(_0x3041cd,_0x49d34e){if(_0x3041cd){return _0x2df5b4(_0x3041cd);}pm2[_0xeec5('0x5')]();return _0x50bd79(_0x49d34e);});});});};exports[_0xeec5('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2ababb,_0x875bb6){return pm2['dump'](function(_0x64d137){if(_0x64d137){return _0x875bb6(_0x64d137);}return _0x2ababb('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 9475f8b..ea8661b 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 _0x59d6=['util','../../mysqldb','../logger','schedule','defaults','redis','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','inspect','lodash','moment','ioredis'];(function(_0x58d3e7,_0x3baaec){var _0x1781dc=function(_0x46c86c){while(--_0x46c86c){_0x58d3e7['push'](_0x58d3e7['shift']());}};_0x1781dc(++_0x3baaec);}(_0x59d6,0xfd));var _0x659d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x59d6[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x659d('0x0'));var moment=require(_0x659d('0x1'));var Redis=require(_0x659d('0x2'));var util=require(_0x659d('0x3'));var config=require('../../config/environment');var db=require(_0x659d('0x4'))['db'];var logger=require(_0x659d('0x5'))(_0x659d('0x6'));config['redis']=_[_0x659d('0x7')](config[_0x659d('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x659d('0x9'))(new Redis(config[_0x659d('0x8')]));function closeInteractions(){var _0xb316f=0x0;var _0x31be90=[];return db[_0x659d('0xa')][_0x659d('0xb')]({'raw':!![],'attributes':['id',_0x659d('0xc')],'where':{'id':0x1}})[_0x659d('0xd')](function(_0x2fb86e){_0xb316f=_0x2fb86e[_0x659d('0xc')];if(_0xb316f){return db[_0x659d('0xe')][_0x659d('0xf')]({'raw':!![],'attributes':['id',_0x659d('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x659d('0x11')](_0x2fb86e[_0x659d('0xc')],_0x659d('0x12'))}}});}else{return[];}})[_0x659d('0xd')](function(_0x46d696){if(_0x46d696&&_0x46d696[_0x659d('0x13')]){_0x31be90=_['map'](_0x46d696||[],'id');logger['info'](_0x659d('0x14'),_0x31be90[_0x659d('0x15')]());return db[_0x659d('0xe')][_0x659d('0x16')]({'closeReason':_0x659d('0x17'),'disposition':_0x659d('0x18'),'closed':!![],'closedAt':moment()[_0x659d('0x19')](_0x659d('0x1a'))},{'where':{'id':_0x31be90}});}})[_0x659d('0xd')](function(){if(_0x31be90&&_0x31be90[_0x659d('0x13')]){logger['info'](_0x659d('0x1b'),_0x31be90[_0x659d('0x15')]());for(var _0x288833=0x0;_0x288833<_0x31be90['length'];_0x288833++){io[_0x659d('0x1c')](_0x659d('0x1d'),{'id':_0x31be90[_0x288833],'closed':!![]});}}})['catch'](function(_0x2529bd){logger[_0x659d('0x1e')]('[CHAT]\x20Error\x20closing\x20interactions',_0x2529bd?util[_0x659d('0x1f')](_0x2529bd,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd86f=['[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','lastMsgAt','then','length','map','update','format','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','error'];(function(_0x206a86,_0x99cc6e){var _0x24b9bb=function(_0x186257){while(--_0x186257){_0x206a86['push'](_0x206a86['shift']());}};_0x24b9bb(++_0x99cc6e);}(_0xd86f,0x17b));var _0xfd86=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd86f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xfd86('0x0'));var moment=require(_0xfd86('0x1'));var Redis=require(_0xfd86('0x2'));var util=require(_0xfd86('0x3'));var config=require(_0xfd86('0x4'));var db=require(_0xfd86('0x5'))['db'];var logger=require('../logger')(_0xfd86('0x6'));config['redis']=_[_0xfd86('0x7')](config[_0xfd86('0x8')],{'host':_0xfd86('0x9'),'port':0x18eb});var io=require(_0xfd86('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0xceda9e=0x0;var _0x458fdc=[];return db[_0xfd86('0xb')][_0xfd86('0xc')]({'raw':!![],'attributes':['id',_0xfd86('0xd')],'where':{'id':0x1}})['then'](function(_0x4ec831){_0xceda9e=_0x4ec831[_0xfd86('0xd')];if(_0xceda9e){return db[_0xfd86('0xe')]['findAll']({'raw':!![],'attributes':['id',_0xfd86('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x4ec831[_0xfd86('0xd')],'minutes')}}});}else{return[];}})[_0xfd86('0x10')](function(_0x8a711a){if(_0x8a711a&&_0x8a711a[_0xfd86('0x11')]){_0x458fdc=_[_0xfd86('0x12')](_0x8a711a||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x458fdc['join']());return db['ChatInteraction'][_0xfd86('0x13')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xfd86('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x458fdc}});}})['then'](function(){if(_0x458fdc&&_0x458fdc['length']){logger[_0xfd86('0x15')](_0xfd86('0x16'),_0x458fdc[_0xfd86('0x17')]());for(var _0x4bb9f8=0x0;_0x4bb9f8<_0x458fdc['length'];_0x4bb9f8++){io[_0xfd86('0x18')](_0xfd86('0x19'),{'id':_0x458fdc[_0x4bb9f8],'closed':!![]});}}})['catch'](function(_0x1848f2){logger[_0xfd86('0x1a')](_0xfd86('0x1b'),_0x1848f2?util[_0xfd86('0x1c')](_0x1848f2,{'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/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 428db1c..00a5902 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 _0x12a6=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x12a6,0xb5));var _0x612a=function(_0x3722b3,_0x18a764){_0x3722b3=_0x3722b3-0x0;var _0x4614ae=_0x12a6[_0x3722b3];return _0x4614ae;};'use strict';function start(){var _0x585956=require(_0x612a('0x0'));return _0x585956[_0x612a('0x1')]();}module[_0x612a('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x7219=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x2b859f,_0x3e437e){var _0x43ccfa=function(_0x3b09d5){while(--_0x3b09d5){_0x2b859f['push'](_0x2b859f['shift']());}};_0x43ccfa(++_0x3e437e);}(_0x7219,0xf2));var _0x9721=function(_0x1f1e9c,_0x27274f){_0x1f1e9c=_0x1f1e9c-0x0;var _0x26fe13=_0x7219[_0x1f1e9c];return _0x26fe13;};'use strict';function start(){var _0xf15679=require(_0x9721('0x0'));return _0xf15679['startAllRefreshIntervals']();}module[_0x9721('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 d5e8f74..74f4efc 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 _0x596c=['util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','extname','existsSync','attachments','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','status','Sent','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','email\x20sent','catch','error\x20mail','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','CloudProvider','map','toString','keyBy','difference','intersection','exists','deleteJob','delete\x20cron','toRun','my\x20id','run\x20job','cron','active','isBetween','add','start','add\x20cron','stop','stop\x20cron','length','startAt','update','update\x20cron'];(function(_0x524f89,_0x54b5d4){var _0x5ed0d3=function(_0x32ff6c){while(--_0x32ff6c){_0x524f89['push'](_0x524f89['shift']());}};_0x5ed0d3(++_0x54b5d4);}(_0x596c,0xa4));var _0xc596=function(_0x597265,_0x5418f1){_0x597265=_0x597265-0x0;var _0x5f4294=_0x596c[_0x597265];return _0x5f4294;};'use strict';var fs=require('fs');var util=require(_0xc596('0x0'));var path=require(_0xc596('0x1'));var _=require(_0xc596('0x2'));var moment=require(_0xc596('0x3'));var CronJobManager=require(_0xc596('0x4'));var jayson=require(_0xc596('0x5'));var BPromise=require(_0xc596('0x6'));var logger=require(_0xc596('0x7'))(_0xc596('0x8'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xc596('0x9'));var analyticDefaultReportController=require(_0xc596('0xa'));var client=jayson[_0xc596('0xb')][_0xc596('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5648e8,_0x4f62dc){return function(){logger[_0xc596('0xd')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5648e8[_0xc596('0xe')]);var _0x3d6c7b=!![];var _0x38a209=_0x5648e8[_0xc596('0xf')][_0xc596('0x10')]();var _0x50bfe6={'account':_0x38a209,'message':{'from':util[_0xc596('0x11')](_0xc596('0x12'),_0x5648e8[_0xc596('0xf')][_0xc596('0x13')],_0x5648e8[_0xc596('0xf')][_0xc596('0xe')]||_0x5648e8[_0xc596('0xf')]['Smtp'][_0xc596('0x14')]),'to':_0x5648e8[_0xc596('0xe')],'cc':_0x5648e8['cc'],'bcc':_0x5648e8[_0xc596('0x15')],'subject':util[_0xc596('0x11')](_0xc596('0x16'),_0x4f62dc['name'],_0x5648e8[_0xc596('0x17')],_0x5648e8[_0xc596('0x18')])}};var _0x255881=path['join'](__dirname,_0xc596('0x19'));var _0x499e44=_0x4f62dc[_0xc596('0x1a')];var _0x41c72f=util[_0xc596('0x11')]('%s.%s',path['basename'](_0x4f62dc['savename'],path[_0xc596('0x1b')](_0x4f62dc[_0xc596('0x1a')])),'zip');var _0x2d16f8=path['join'](_0x255881,_0x499e44);var _0x10cd16=path['join'](_0x255881,_0x41c72f);if(fs[_0xc596('0x1c')](_0x2d16f8)){_0x4f62dc['status']='Sent';_0x50bfe6['message'][_0xc596('0x1d')]=[{'filename':_0x499e44,'path':_0x2d16f8}];_0x50bfe6[_0xc596('0x1e')][_0xc596('0x1f')]=util['format'](_0xc596('0x20'),JSON[_0xc596('0x21')](_0x4f62dc,null,0x2));}else if(fs[_0xc596('0x1c')](_0x10cd16)){_0x4f62dc[_0xc596('0x22')]=_0xc596('0x23');_0x50bfe6['message'][_0xc596('0x1d')]=[{'filename':_0x41c72f,'path':_0x10cd16}];}else{_0x50bfe6[_0xc596('0x1e')][_0xc596('0x1f')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5648e8['sendIfEmpty']){_0x3d6c7b=![];logger[_0xc596('0xd')](_0xc596('0x24'));}}if(_0x3d6c7b){return client['request'](_0xc596('0x25'),_0x50bfe6)[_0xc596('0x26')](function(_0x5dd2a9){if(_0x5dd2a9[_0xc596('0x27')]){return logger[_0xc596('0x27')]('error\x20mail',JSON[_0xc596('0x21')](_0x5dd2a9));}return logger['info'](_0xc596('0x28'));})[_0xc596('0x29')](function(_0x43aa6e){return logger[_0xc596('0x27')](_0xc596('0x2a'),JSON[_0xc596('0x21')](_0x43aa6e));});}};}function handleError(){return function(_0x2a7a16){return logger['error'](JSON[_0xc596('0x21')](_0x2a7a16));};}function handleResult(_0x269abe){return function(_0x367f3d){logger[_0xc596('0xd')](_0xc596('0x2b'),JSON[_0xc596('0x21')](_0x367f3d));if(_0x269abe['MailAccount']&&_0x269abe[_0xc596('0xf')][_0xc596('0x2c')]&&!_[_0xc596('0x2d')](_0x269abe['email'])){setTimeout(handleSendEmail(_0x269abe,_0x367f3d),0x3c*0x3e8);}};}function handleJob(_0x2db485){return function(){try{if(_['isNil'](_0x2db485[_0xc596('0x17')])){return logger['info'](_0xc596('0x2e'));}if(_[_0xc596('0x2d')](_0x2db485['subtractUnit'])){return logger[_0xc596('0xd')](_0xc596('0x2f'));}var _0x4e137f={'startDate':moment()[_0xc596('0x30')](_0x2db485['subtractNumber'],_0x2db485[_0xc596('0x18')])[_0xc596('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0xc596('0x31')),'type':_0xc596('0x32'),'output':_0x2db485['output'],'name':_0x2db485[_0xc596('0x13')]};if(!_['isNil'](_0x2db485[_0xc596('0x33')])){logger[_0xc596('0xd')](_0xc596('0x34'),_0x2db485[_0xc596('0x33')]);return analyticDefaultReportController[_0xc596('0x35')]({'id':_0x2db485[_0xc596('0x33')]},_0x4e137f)[_0xc596('0x26')](handleResult(_0x2db485))[_0xc596('0x29')](handleError());}if(!_[_0xc596('0x2d')](_0x2db485['CustomReportId'])){logger[_0xc596('0xd')]('exec\x20custom\x20report\x20id:%s',_0x2db485[_0xc596('0x36')]);return analyticCustomReportController['runReport']({'id':_0x2db485['CustomReportId']},_0x4e137f)[_0xc596('0x26')](handleResult(_0x2db485))[_0xc596('0x29')](handleError());}}catch(_0x116a25){logger['error'](JSON[_0xc596('0x21')](_0x116a25));}return logger[_0xc596('0xd')](_0xc596('0x37'));};}function getJobs(_0x458750){var _0x43a0b5={};if(_0x458750){_0x43a0b5['id']=_0x458750;}return db[_0xc596('0x38')][_0xc596('0x39')]({'where':_0x43a0b5,'include':[{'model':db[_0xc596('0xf')],'attributes':['id','name',_0xc596('0xe')],'include':[{'model':db['MailServerOut'],'as':_0xc596('0x2c'),'include':[{'model':db[_0xc596('0x3a')],'as':_0xc596('0x3a')}]}]}]})[_0xc596('0x26')](function(_0x57d140){var _0x516da6=_['keys'](manager['jobs']);var _0x202c97=_[_0xc596('0x3b')](_0x57d140,function(_0x41dbc0){return _0x41dbc0['id'][_0xc596('0x3c')]();});var _0x35969d=_[_0xc596('0x3d')](_0x57d140,function(_0xe8f073){return _0xe8f073['id'][_0xc596('0x3c')]();});var _0x5b0495=_0x458750?_0x202c97:_[_0xc596('0x3e')](_0x202c97,_0x516da6);var _0x422242=_[_0xc596('0x3f')](_0x202c97,_0x516da6);var _0x108c8a=_[_0xc596('0x3e')](_0x516da6,_0x202c97);var _0x51259c;var _0x3e953d;for(_0x51259c=0x0;_0x51259c<_0x108c8a['length']&&!_0x458750;_0x51259c+=0x1){_0x3e953d=_0x108c8a[_0x51259c]['toString']();if(manager[_0xc596('0x40')](_0x3e953d)){manager['stop'](_0x3e953d);manager[_0xc596('0x41')](_0x3e953d);logger[_0xc596('0xd')](_0xc596('0x42'),_0x3e953d);}}logger[_0xc596('0xd')](_0xc596('0x43'),JSON[_0xc596('0x21')](_0x5b0495));for(_0x51259c=0x0;_0x51259c<_0x5b0495['length'];_0x51259c+=0x1){_0x3e953d=_0x5b0495[_0x51259c]['toString']();logger['info']('index',_0x3e953d);if(_0x458750){logger['info'](_0xc596('0x44'),_0x458750);logger[_0xc596('0xd')](JSON[_0xc596('0x21')](_0x35969d[_0x3e953d]));BPromise['resolve']()[_0xc596('0x26')](handleJob(_0x35969d[_0x3e953d]));logger[_0xc596('0xd')](_0xc596('0x45'),_0x35969d[_0x3e953d][_0xc596('0x13')],_0x35969d[_0x3e953d]['cron']);}else if(_0x35969d[_0x3e953d][_0xc596('0x46')]&&_0x35969d[_0x3e953d][_0xc596('0x47')]&&moment()[_0xc596('0x48')](_0x35969d[_0x3e953d]['startAt'],_0x35969d[_0x3e953d]['endAt'])){manager[_0xc596('0x49')](_0x3e953d,_0x35969d[_0x3e953d][_0xc596('0x46')],handleJob(_0x35969d[_0x3e953d]));manager[_0xc596('0x4a')](_0x3e953d);logger[_0xc596('0xd')](_0xc596('0x4b'),_0x35969d[_0x3e953d]['name'],_0x35969d[_0x3e953d][_0xc596('0x46')]);}else if(manager[_0xc596('0x40')](_0x3e953d)){manager[_0xc596('0x4c')](_0x3e953d);manager[_0xc596('0x41')](_0x3e953d);logger[_0xc596('0xd')](_0xc596('0x4d'),_0x35969d[_0x3e953d]['name'],_0x35969d[_0x3e953d][_0xc596('0x46')]);}}for(_0x51259c=0x0,_0x3e953d;_0x51259c<_0x422242[_0xc596('0x4e')]&&!_0x458750;_0x51259c+=0x1){_0x3e953d=_0x422242[_0x51259c]['toString']();if(manager['exists'](_0x3e953d)){if(_0x35969d[_0x3e953d][_0xc596('0x46')]&&_0x35969d[_0x3e953d][_0xc596('0x47')]&&moment()[_0xc596('0x48')](_0x35969d[_0x3e953d][_0xc596('0x4f')],_0x35969d[_0x3e953d]['endAt'])){manager[_0xc596('0x50')](_0x3e953d,_0x35969d[_0x3e953d][_0xc596('0x46')],handleJob(_0x35969d[_0x3e953d]));logger[_0xc596('0xd')](_0xc596('0x51'),_0x35969d[_0x3e953d][_0xc596('0x13')],_0x35969d[_0x3e953d][_0xc596('0x46')]);}else{manager[_0xc596('0x4c')](_0x3e953d);manager[_0xc596('0x41')](_0x3e953d);logger[_0xc596('0xd')]('stop\x20cron',_0x35969d[_0x3e953d][_0xc596('0x13')],_0x35969d[_0x3e953d]['cron']);}}}})[_0xc596('0x29')](function(_0x4df4fc){logger[_0xc596('0x27')](JSON[_0xc596('0x21')](_0x4df4fc));});}exports['run']=function(_0x441076){return getJobs(_0x441076);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x8fcc=['keys','jobs','map','keyBy','toString','difference','intersection','exists','stop','deleteJob','length','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','lodash','moment','bluebird','../logger','schedule','../../mysqldb','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','extname','zip','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','then','error','stringify','email\x20sent','error\x20mail','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','catch','no\x20report\x20id','Schedule','findAll','name','CloudProvider'];(function(_0x426969,_0xd52193){var _0x416e3b=function(_0x23f1fe){while(--_0x23f1fe){_0x426969['push'](_0x426969['shift']());}};_0x416e3b(++_0xd52193);}(_0x8fcc,0xc0));var _0xc8fc=function(_0x7b8022,_0x2932d1){_0x7b8022=_0x7b8022-0x0;var _0x2ffa66=_0x8fcc[_0x7b8022];return _0x2ffa66;};'use strict';var fs=require('fs');var util=require(_0xc8fc('0x0'));var path=require('path');var _=require(_0xc8fc('0x1'));var moment=require(_0xc8fc('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xc8fc('0x3'));var logger=require(_0xc8fc('0x4'))(_0xc8fc('0x5'));var db=require(_0xc8fc('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xc8fc('0x7')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3223ba,_0x58d47a){return function(){logger[_0xc8fc('0x8')](_0xc8fc('0x9'),_0x3223ba[_0xc8fc('0xa')]);var _0x20aa9b=!![];var _0x35561d=_0x3223ba[_0xc8fc('0xb')][_0xc8fc('0xc')]();var _0x194bac={'account':_0x35561d,'message':{'from':util[_0xc8fc('0xd')](_0xc8fc('0xe'),_0x3223ba[_0xc8fc('0xb')]['name'],_0x3223ba[_0xc8fc('0xb')][_0xc8fc('0xa')]||_0x3223ba[_0xc8fc('0xb')]['Smtp']['user']),'to':_0x3223ba[_0xc8fc('0xa')],'cc':_0x3223ba['cc'],'bcc':_0x3223ba[_0xc8fc('0xf')],'subject':util['format'](_0xc8fc('0x10'),_0x58d47a['name'],_0x3223ba[_0xc8fc('0x11')],_0x3223ba['subtractUnit'])}};var _0x3430e7=path[_0xc8fc('0x12')](__dirname,_0xc8fc('0x13'));var _0x511843=_0x58d47a[_0xc8fc('0x14')];var _0xd9ebaa=util[_0xc8fc('0xd')](_0xc8fc('0x15'),path['basename'](_0x58d47a['savename'],path[_0xc8fc('0x16')](_0x58d47a['savename'])),_0xc8fc('0x17'));var _0x4db2ee=path[_0xc8fc('0x12')](_0x3430e7,_0x511843);var _0x186b1c=path['join'](_0x3430e7,_0xd9ebaa);if(fs['existsSync'](_0x4db2ee)){_0x58d47a[_0xc8fc('0x18')]='Sent';_0x194bac[_0xc8fc('0x19')][_0xc8fc('0x1a')]=[{'filename':_0x511843,'path':_0x4db2ee}];_0x194bac[_0xc8fc('0x19')][_0xc8fc('0x1b')]=util[_0xc8fc('0xd')](_0xc8fc('0x1c'),JSON['stringify'](_0x58d47a,null,0x2));}else if(fs[_0xc8fc('0x1d')](_0x186b1c)){_0x58d47a['status']='Sent';_0x194bac[_0xc8fc('0x19')][_0xc8fc('0x1a')]=[{'filename':_0xd9ebaa,'path':_0x186b1c}];}else{_0x194bac[_0xc8fc('0x19')][_0xc8fc('0x1b')]=_0xc8fc('0x1e');if(!_0x3223ba[_0xc8fc('0x1f')]){_0x20aa9b=![];logger[_0xc8fc('0x8')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x20aa9b){return client[_0xc8fc('0x20')]('SendMail',_0x194bac)[_0xc8fc('0x21')](function(_0x16bec3){if(_0x16bec3[_0xc8fc('0x22')]){return logger[_0xc8fc('0x22')]('error\x20mail',JSON[_0xc8fc('0x23')](_0x16bec3));}return logger[_0xc8fc('0x8')](_0xc8fc('0x24'));})['catch'](function(_0x76253d){return logger[_0xc8fc('0x22')](_0xc8fc('0x25'),JSON[_0xc8fc('0x23')](_0x76253d));});}};}function handleError(){return function(_0x5113c1){return logger[_0xc8fc('0x22')](JSON[_0xc8fc('0x23')](_0x5113c1));};}function handleResult(_0x960394){return function(_0x536ebf){logger[_0xc8fc('0x8')](_0xc8fc('0x26'),JSON[_0xc8fc('0x23')](_0x536ebf));if(_0x960394['MailAccount']&&_0x960394[_0xc8fc('0xb')][_0xc8fc('0x27')]&&!_[_0xc8fc('0x28')](_0x960394[_0xc8fc('0xa')])){setTimeout(handleSendEmail(_0x960394,_0x536ebf),0x3c*0x3e8);}};}function handleJob(_0x1b692c){return function(){try{if(_[_0xc8fc('0x28')](_0x1b692c['subtractNumber'])){return logger[_0xc8fc('0x8')](_0xc8fc('0x29'));}if(_[_0xc8fc('0x28')](_0x1b692c[_0xc8fc('0x2a')])){return logger[_0xc8fc('0x8')]('subtractUnit\x20null\x20or\x20undefined');}var _0x4d3690={'startDate':moment()['subtract'](_0x1b692c[_0xc8fc('0x11')],_0x1b692c['subtractUnit'])[_0xc8fc('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xc8fc('0xd')](_0xc8fc('0x2b')),'type':_0xc8fc('0x2c'),'output':_0x1b692c[_0xc8fc('0x2d')],'name':_0x1b692c['name']};if(!_[_0xc8fc('0x28')](_0x1b692c[_0xc8fc('0x2e')])){logger[_0xc8fc('0x8')](_0xc8fc('0x2f'),_0x1b692c['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x1b692c['DefaultReportId']},_0x4d3690)[_0xc8fc('0x21')](handleResult(_0x1b692c))['catch'](handleError());}if(!_[_0xc8fc('0x28')](_0x1b692c[_0xc8fc('0x30')])){logger[_0xc8fc('0x8')](_0xc8fc('0x31'),_0x1b692c[_0xc8fc('0x30')]);return analyticCustomReportController[_0xc8fc('0x32')]({'id':_0x1b692c[_0xc8fc('0x30')]},_0x4d3690)[_0xc8fc('0x21')](handleResult(_0x1b692c))[_0xc8fc('0x33')](handleError());}}catch(_0x522bec){logger[_0xc8fc('0x22')](JSON['stringify'](_0x522bec));}return logger[_0xc8fc('0x8')](_0xc8fc('0x34'));};}function getJobs(_0x151813){var _0x10d065={};if(_0x151813){_0x10d065['id']=_0x151813;}return db[_0xc8fc('0x35')][_0xc8fc('0x36')]({'where':_0x10d065,'include':[{'model':db['MailAccount'],'attributes':['id',_0xc8fc('0x37'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xc8fc('0x27'),'include':[{'model':db[_0xc8fc('0x38')],'as':_0xc8fc('0x38')}]}]}]})[_0xc8fc('0x21')](function(_0x5f2c34){var _0x1f53c0=_[_0xc8fc('0x39')](manager[_0xc8fc('0x3a')]);var _0x537106=_[_0xc8fc('0x3b')](_0x5f2c34,function(_0x39be3e){return _0x39be3e['id']['toString']();});var _0x505f9d=_[_0xc8fc('0x3c')](_0x5f2c34,function(_0x2958c3){return _0x2958c3['id'][_0xc8fc('0x3d')]();});var _0x1abcad=_0x151813?_0x537106:_[_0xc8fc('0x3e')](_0x537106,_0x1f53c0);var _0x947af8=_[_0xc8fc('0x3f')](_0x537106,_0x1f53c0);var _0x545928=_[_0xc8fc('0x3e')](_0x1f53c0,_0x537106);var _0x156e24;var _0xbfa8c9;for(_0x156e24=0x0;_0x156e24<_0x545928['length']&&!_0x151813;_0x156e24+=0x1){_0xbfa8c9=_0x545928[_0x156e24][_0xc8fc('0x3d')]();if(manager[_0xc8fc('0x40')](_0xbfa8c9)){manager[_0xc8fc('0x41')](_0xbfa8c9);manager[_0xc8fc('0x42')](_0xbfa8c9);logger[_0xc8fc('0x8')]('delete\x20cron',_0xbfa8c9);}}logger['info']('toRun',JSON['stringify'](_0x1abcad));for(_0x156e24=0x0;_0x156e24<_0x1abcad[_0xc8fc('0x43')];_0x156e24+=0x1){_0xbfa8c9=_0x1abcad[_0x156e24][_0xc8fc('0x3d')]();logger[_0xc8fc('0x8')](_0xc8fc('0x44'),_0xbfa8c9);if(_0x151813){logger[_0xc8fc('0x8')](_0xc8fc('0x45'),_0x151813);logger[_0xc8fc('0x8')](JSON[_0xc8fc('0x23')](_0x505f9d[_0xbfa8c9]));BPromise[_0xc8fc('0x46')]()[_0xc8fc('0x21')](handleJob(_0x505f9d[_0xbfa8c9]));logger[_0xc8fc('0x8')]('run\x20job',_0x505f9d[_0xbfa8c9][_0xc8fc('0x37')],_0x505f9d[_0xbfa8c9]['cron']);}else if(_0x505f9d[_0xbfa8c9][_0xc8fc('0x47')]&&_0x505f9d[_0xbfa8c9][_0xc8fc('0x48')]&&moment()[_0xc8fc('0x49')](_0x505f9d[_0xbfa8c9][_0xc8fc('0x4a')],_0x505f9d[_0xbfa8c9][_0xc8fc('0x4b')])){manager[_0xc8fc('0x4c')](_0xbfa8c9,_0x505f9d[_0xbfa8c9][_0xc8fc('0x47')],handleJob(_0x505f9d[_0xbfa8c9]));manager[_0xc8fc('0x4d')](_0xbfa8c9);logger[_0xc8fc('0x8')](_0xc8fc('0x4e'),_0x505f9d[_0xbfa8c9][_0xc8fc('0x37')],_0x505f9d[_0xbfa8c9][_0xc8fc('0x47')]);}else if(manager[_0xc8fc('0x40')](_0xbfa8c9)){manager['stop'](_0xbfa8c9);manager[_0xc8fc('0x42')](_0xbfa8c9);logger[_0xc8fc('0x8')](_0xc8fc('0x4f'),_0x505f9d[_0xbfa8c9]['name'],_0x505f9d[_0xbfa8c9]['cron']);}}for(_0x156e24=0x0,_0xbfa8c9;_0x156e24<_0x947af8[_0xc8fc('0x43')]&&!_0x151813;_0x156e24+=0x1){_0xbfa8c9=_0x947af8[_0x156e24]['toString']();if(manager[_0xc8fc('0x40')](_0xbfa8c9)){if(_0x505f9d[_0xbfa8c9][_0xc8fc('0x47')]&&_0x505f9d[_0xbfa8c9][_0xc8fc('0x48')]&&moment()[_0xc8fc('0x49')](_0x505f9d[_0xbfa8c9]['startAt'],_0x505f9d[_0xbfa8c9][_0xc8fc('0x4b')])){manager[_0xc8fc('0x50')](_0xbfa8c9,_0x505f9d[_0xbfa8c9][_0xc8fc('0x47')],handleJob(_0x505f9d[_0xbfa8c9]));logger['info'](_0xc8fc('0x51'),_0x505f9d[_0xbfa8c9][_0xc8fc('0x37')],_0x505f9d[_0xbfa8c9][_0xc8fc('0x47')]);}else{manager[_0xc8fc('0x41')](_0xbfa8c9);manager[_0xc8fc('0x42')](_0xbfa8c9);logger[_0xc8fc('0x8')](_0xc8fc('0x4f'),_0x505f9d[_0xbfa8c9][_0xc8fc('0x37')],_0x505f9d[_0xbfa8c9][_0xc8fc('0x47')]);}}}})[_0xc8fc('0x33')](function(_0x2b4d40){logger['error'](JSON[_0xc8fc('0x23')](_0x2b4d40));});}exports[_0xc8fc('0x52')]=function(_0x53335b){return getJobs(_0x53335b);};exports['start']=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 59c2893..46509ba 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 _0x3da6=['then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','transcribeAccountId','Transcribe\x20not\x20configured','findOne','forEach','push','catch','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript'];(function(_0x251fde,_0x384469){var _0x350af6=function(_0x15a6a3){while(--_0x15a6a3){_0x251fde['push'](_0x251fde['shift']());}};_0x350af6(++_0x384469);}(_0x3da6,0xc1));var _0x63da=function(_0x51e359,_0x329a75){_0x51e359=_0x51e359-0x0;var _0x4bd4c4=_0x3da6[_0x51e359];return _0x4bd4c4;};var _=require(_0x63da('0x0'));var AWS=require(_0x63da('0x1'));var rp=require(_0x63da('0x2'));var util=require(_0x63da('0x3'));var BPromise=require(_0x63da('0x4'));var db=require(_0x63da('0x5'))['db'];var logger=require(_0x63da('0x6'))('transcribe');function getTranscriptionJob(_0x425f2f,_0x43a687,_0x5bffe8,_0x36665d){return new Promise(function(_0x5592c4,_0x3f79f6){var _0x519714=new AWS[(_0x63da('0x7'))]({'accessKeyId':_0x43a687,'secretAccessKey':_0x425f2f,'region':_0x5bffe8});_0x519714[_0x63da('0x8')]({'TranscriptionJobName':_0x36665d},function(_0xbf0f63,_0x39a442){if(_0xbf0f63){return _0x3f79f6(_0xbf0f63);}else{return _0x5592c4(_0x39a442);}});});}function sentiment(_0x48c470,_0x352ed2,_0xdc10c4,_0x5a4f3d,_0x2d43f0){return new Promise(function(_0x5e052a,_0x181bdc){var _0x12ac78=new AWS[(_0x63da('0x9'))]({'accessKeyId':_0x352ed2,'secretAccessKey':_0x48c470,'region':_0xdc10c4});_0x12ac78[_0x63da('0xa')]({'Text':_0x5a4f3d,'LanguageCode':_0x2d43f0[_0x63da('0xb')](0x0,0x2)},function(_0x5006ad,_0x2a3fcc){if(_0x5006ad){return _0x181bdc(_0x5006ad);}else{return _0x5e052a(_0x2a3fcc);}});});}function checkTranscribeJob(_0x576ea2,_0x22b0aa,_0x1a228a){var _0x30d1bd;return new BPromise(function(_0x213d63,_0x276f6a){logger[_0x63da('0xc')](util[_0x63da('0xd')](_0x63da('0xe'),_0x576ea2['id'],_0x576ea2[_0x63da('0xf')]));return getTranscriptionJob(_0x1a228a[_0x63da('0x10')],_0x1a228a[_0x63da('0x11')],_0x22b0aa[_0x63da('0x12')],_0x576ea2[_0x63da('0xf')])['then'](function(_0x48ac11){logger[_0x63da('0xc')](util['format'](_0x63da('0x13'),_0x576ea2['id'],_0x576ea2[_0x63da('0xf')],_0x48ac11[_0x63da('0x14')][_0x63da('0x15')]));if(!_0x576ea2[_0x63da('0x16')]){switch(_0x48ac11['TranscriptionJob'][_0x63da('0x15')]){case'COMPLETED':var _0x5ace3f={'transcribeStatus':_0x48ac11[_0x63da('0x14')]['TranscriptionJobStatus'],'fileUri':_0x48ac11[_0x63da('0x14')][_0x63da('0x17')][_0x63da('0x18')]};logger['info'](util[_0x63da('0xd')](_0x63da('0x19'),_0x576ea2['id']));return rp({'uri':_0x48ac11['TranscriptionJob'][_0x63da('0x17')][_0x63da('0x18')],'json':!![]})[_0x63da('0x1a')](function(_0x24ae30){logger[_0x63da('0xc')](util[_0x63da('0xd')](_0x63da('0x1b'),_0x576ea2['id']));if(_0x24ae30&&_0x24ae30[_0x63da('0x1c')]&&_0x24ae30[_0x63da('0x1c')]['transcripts']&&_0x24ae30['results'][_0x63da('0x1d')][_0x63da('0x1e')]){_0x5ace3f[_0x63da('0x16')]='';for(var _0x45a021=0x0;_0x45a021<_0x24ae30[_0x63da('0x1c')][_0x63da('0x1d')]['length'];_0x45a021++){_0x5ace3f[_0x63da('0x16')]+=_0x24ae30[_0x63da('0x1c')][_0x63da('0x1d')][_0x45a021][_0x63da('0x1f')]+'';}}return _0x576ea2['update'](_0x5ace3f);})[_0x63da('0x1a')](function(){logger[_0x63da('0xc')](util[_0x63da('0xd')](_0x63da('0x20'),_0x576ea2['id']));if(!_0x576ea2[_0x63da('0x21')]){throw new db[(_0x63da('0x22'))][(_0x63da('0x23'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x22b0aa['sentiment']||!_0x22b0aa[_0x63da('0x24')]||!_0x22b0aa[_0x63da('0x25')]||!_0x22b0aa[_0x63da('0x26')]||!_0x22b0aa[_0x63da('0x27')]){throw new db[(_0x63da('0x22'))][(_0x63da('0x23'))](_0x63da('0x28'));}if(!_0x5ace3f[_0x63da('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x22b0aa['sentimentAccountId']===_0x1a228a['id']){return _0x1a228a;}else{return db[_0x63da('0x29')]['findOne']({'where':{'id':_settings[_0x63da('0x24')]}});}})[_0x63da('0x1a')](function(_0x1df948){if(!_0x1df948){throw new db[(_0x63da('0x22'))][(_0x63da('0x23'))](_0x63da('0x2a'));}if(!_0x1df948[_0x63da('0x10')]||!_0x1df948[_0x63da('0x11')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x30d1bd=_0x1df948;logger[_0x63da('0xc')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x576ea2['id']));return sentiment(_0x30d1bd[_0x63da('0x10')],_0x30d1bd[_0x63da('0x11')],_0x22b0aa[_0x63da('0x25')],_0x5ace3f[_0x63da('0x16')],_0x22b0aa[_0x63da('0x26')]);})['then'](function(_0x5240d0){logger[_0x63da('0xc')](util['format'](_0x63da('0x2b'),_0x576ea2['id']));return _0x576ea2[_0x63da('0x2c')]({'sentiment':_0x5240d0[_0x63da('0x2d')],'sPositive':_0x5240d0[_0x63da('0x2e')][_0x63da('0x2f')],'sNegative':_0x5240d0['SentimentScore']['Negative'],'sMixed':_0x5240d0['SentimentScore'][_0x63da('0x30')],'sNeutral':_0x5240d0[_0x63da('0x2e')][_0x63da('0x31')]});})[_0x63da('0x1a')](function(){logger['info'](util['format'](_0x63da('0x20'),_0x576ea2['id']));_0x213d63();});case _0x63da('0x32'):return _0x576ea2[_0x63da('0x2c')]({'transcribeStatus':_0x63da('0x32'),'failureReason':_0x48ac11[_0x63da('0x14')][_0x63da('0x33')]})[_0x63da('0x1a')](function(){logger['info'](util['format'](_0x63da('0x20'),_0x576ea2['id']));_0x213d63();});default:logger[_0x63da('0xc')](util[_0x63da('0xd')](_0x63da('0x34'),_0x576ea2['id']));break;}}else{return BPromise[_0x63da('0x35')]()[_0x63da('0x1a')](function(){if(!_0x576ea2['tempSentiment']){throw new db['Sequelize']['ValidationError'](_0x63da('0x36'));}if(!_0x22b0aa['sentiment']||!_0x22b0aa[_0x63da('0x24')]||!_0x22b0aa['sentimentRegion']||!_0x22b0aa[_0x63da('0x26')]||!_0x22b0aa[_0x63da('0x27')]){throw new db['Sequelize'][(_0x63da('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x576ea2[_0x63da('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x22b0aa['sentimentAccountId']===_0x1a228a['id']){return _0x1a228a;}else{return db[_0x63da('0x29')]['findOne']({'where':{'id':_settings[_0x63da('0x24')]}});}})['then'](function(_0x4c8908){if(!_0x4c8908){throw new db['Sequelize'][(_0x63da('0x23'))](_0x63da('0x2a'));}if(!_0x4c8908['data1']||!_0x4c8908['data2']){throw new db[(_0x63da('0x22'))][(_0x63da('0x23'))](_0x63da('0x37'));}_0x30d1bd=_0x4c8908;logger[_0x63da('0xc')](util[_0x63da('0xd')](_0x63da('0x38'),_0x576ea2['id']));return sentiment(_0x30d1bd[_0x63da('0x10')],_0x30d1bd[_0x63da('0x11')],_0x22b0aa[_0x63da('0x25')],_0x576ea2[_0x63da('0x16')],_0x22b0aa[_0x63da('0x26')]);})[_0x63da('0x1a')](function(_0x4ab6a0){logger['info'](util['format'](_0x63da('0x2b'),_0x576ea2['id']));return _0x576ea2['update']({'sentiment':_0x4ab6a0[_0x63da('0x2d')],'sPositive':_0x4ab6a0[_0x63da('0x2e')][_0x63da('0x2f')],'sNegative':_0x4ab6a0[_0x63da('0x2e')][_0x63da('0x39')],'sMixed':_0x4ab6a0[_0x63da('0x2e')][_0x63da('0x30')],'sNeutral':_0x4ab6a0[_0x63da('0x2e')]['Neutral'],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x63da('0xc')](util[_0x63da('0xd')](_0x63da('0x20'),_0x576ea2['id']));_0x213d63();});}})['catch'](function(_0x3d4bdc){if(_0x3d4bdc){if(!_0x3d4bdc[_0x63da('0x3a')]||_0x3d4bdc[_0x63da('0x3a')]!==_0x63da('0x3b')){logger[_0x63da('0x3c')](util[_0x63da('0xd')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x576ea2['id']),util[_0x63da('0x3d')](_0x3d4bdc,{'showHidden':![],'depth':null}));}}_0x213d63();});});}function checkTranscribe(){var _0x2e59df;var _0x4a7e8d;var _0x1be74e;return db[_0x63da('0x3e')][_0x63da('0x3f')]({'where':{'transcribeStatus':_0x63da('0x40')}})[_0x63da('0x1a')](function(_0x1c08a8){if(!_0x1c08a8||!_0x1c08a8['length']){throw new db[(_0x63da('0x22'))]['ValidationError'](_0x63da('0x41'));}_0x2e59df=_0x1c08a8;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x63da('0x1a')](function(_0x18e42f){if(!_0x18e42f){throw new db['Sequelize'][(_0x63da('0x23'))]('Settings\x20not\x20available');}_0x4a7e8d=_0x18e42f;if(!_0x4a7e8d['transcribe']||!_0x4a7e8d[_0x63da('0x42')]||!_0x4a7e8d['transcribeRegion']||!_0x4a7e8d['language']||!_0x4a7e8d[_0x63da('0x27')]){throw new db[(_0x63da('0x22'))][(_0x63da('0x23'))](_0x63da('0x43'));}return db[_0x63da('0x29')][_0x63da('0x44')]({'where':{'id':_0x4a7e8d[_0x63da('0x42')]}});})[_0x63da('0x1a')](function(_0x3024c8){if(!_0x3024c8){throw new db[(_0x63da('0x22'))]['ValidationError'](_0x63da('0x2a'));}if(!_0x3024c8[_0x63da('0x10')]||!_0x3024c8[_0x63da('0x11')]){throw new db[(_0x63da('0x22'))][(_0x63da('0x23'))](_0x63da('0x37'));}_0x1be74e=_0x3024c8;var _0xd6b1b2=[];_0x2e59df[_0x63da('0x45')](function(_0x956c2a){_0xd6b1b2[_0x63da('0x46')](checkTranscribeJob(_0x956c2a,_0x4a7e8d,_0x1be74e));});return BPromise['all'](_0xd6b1b2);})[_0x63da('0x47')](function(_0xfe06fd){if(_0xfe06fd){if(!_0xfe06fd['name']||_0xfe06fd[_0x63da('0x3a')]!==_0x63da('0x3b')){logger[_0x63da('0x3c')](util[_0x63da('0x3d')](_0xfe06fd,{'showHidden':![],'depth':null}));}}});}exports[_0x63da('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xae7b=['transcript','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','language','bucket','CloudProvider','Negative','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','transcribeRegion','forEach','push','all','start','lodash','aws-sdk','request-promise','../../mysqldb','../../config/logger','transcribe','TranscribeService','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length'];(function(_0x21dd12,_0x288d23){var _0x2cfd41=function(_0x3b2c62){while(--_0x3b2c62){_0x21dd12['push'](_0x21dd12['shift']());}};_0x2cfd41(++_0x288d23);}(_0xae7b,0xbe));var _0xbae7=function(_0x2df74c,_0x42b9cb){_0x2df74c=_0x2df74c-0x0;var _0x219cc6=_0xae7b[_0x2df74c];return _0x219cc6;};var _=require(_0xbae7('0x0'));var AWS=require(_0xbae7('0x1'));var rp=require(_0xbae7('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0xbae7('0x3'))['db'];var logger=require(_0xbae7('0x4'))(_0xbae7('0x5'));function getTranscriptionJob(_0xc0d4b9,_0x49bdda,_0x48b6a2,_0x339d6b){return new Promise(function(_0xb625f6,_0x163147){var _0x56c84c=new AWS[(_0xbae7('0x6'))]({'accessKeyId':_0x49bdda,'secretAccessKey':_0xc0d4b9,'region':_0x48b6a2});_0x56c84c['getTranscriptionJob']({'TranscriptionJobName':_0x339d6b},function(_0x228a90,_0x319b0b){if(_0x228a90){return _0x163147(_0x228a90);}else{return _0xb625f6(_0x319b0b);}});});}function sentiment(_0x100e0e,_0x4dba83,_0x1b4162,_0x554592,_0x3dc46e){return new Promise(function(_0x10ab49,_0x1ac637){var _0x3c2423=new AWS['Comprehend']({'accessKeyId':_0x4dba83,'secretAccessKey':_0x100e0e,'region':_0x1b4162});_0x3c2423[_0xbae7('0x7')]({'Text':_0x554592,'LanguageCode':_0x3dc46e[_0xbae7('0x8')](0x0,0x2)},function(_0x484906,_0x123146){if(_0x484906){return _0x1ac637(_0x484906);}else{return _0x10ab49(_0x123146);}});});}function checkTranscribeJob(_0x48af40,_0x3d17ae,_0x4090a1){var _0x5b1abe;return new BPromise(function(_0x4800d4,_0x44bdbb){logger[_0xbae7('0x9')](util[_0xbae7('0xa')](_0xbae7('0xb'),_0x48af40['id'],_0x48af40['transcribeName']));return getTranscriptionJob(_0x4090a1[_0xbae7('0xc')],_0x4090a1['data2'],_0x3d17ae['transcribeRegion'],_0x48af40[_0xbae7('0xd')])[_0xbae7('0xe')](function(_0x1b9ee1){logger[_0xbae7('0x9')](util[_0xbae7('0xa')](_0xbae7('0xf'),_0x48af40['id'],_0x48af40['transcribeName'],_0x1b9ee1[_0xbae7('0x10')][_0xbae7('0x11')]));if(!_0x48af40[_0xbae7('0x12')]){switch(_0x1b9ee1[_0xbae7('0x10')][_0xbae7('0x11')]){case'COMPLETED':var _0x5dd094={'transcribeStatus':_0x1b9ee1['TranscriptionJob'][_0xbae7('0x11')],'fileUri':_0x1b9ee1[_0xbae7('0x10')][_0xbae7('0x13')][_0xbae7('0x14')]};logger[_0xbae7('0x9')](util['format'](_0xbae7('0x15'),_0x48af40['id']));return rp({'uri':_0x1b9ee1[_0xbae7('0x10')][_0xbae7('0x13')][_0xbae7('0x14')],'json':!![]})[_0xbae7('0xe')](function(_0x502f06){logger[_0xbae7('0x9')](util[_0xbae7('0xa')](_0xbae7('0x16'),_0x48af40['id']));if(_0x502f06&&_0x502f06[_0xbae7('0x17')]&&_0x502f06[_0xbae7('0x17')][_0xbae7('0x18')]&&_0x502f06[_0xbae7('0x17')]['transcripts']['length']){_0x5dd094[_0xbae7('0x12')]='';for(var _0x3bedda=0x0;_0x3bedda<_0x502f06[_0xbae7('0x17')][_0xbae7('0x18')][_0xbae7('0x19')];_0x3bedda++){_0x5dd094[_0xbae7('0x12')]+=_0x502f06[_0xbae7('0x17')][_0xbae7('0x18')][_0x3bedda][_0xbae7('0x1a')]+'';}}return _0x48af40[_0xbae7('0x1b')](_0x5dd094);})[_0xbae7('0xe')](function(){logger[_0xbae7('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x48af40['id']));if(!_0x48af40['tempSentiment']){throw new db[(_0xbae7('0x1c'))][(_0xbae7('0x1d'))](_0xbae7('0x1e'));}if(!_0x3d17ae[_0xbae7('0x1f')]||!_0x3d17ae[_0xbae7('0x20')]||!_0x3d17ae[_0xbae7('0x21')]||!_0x3d17ae['language']||!_0x3d17ae['bucket']){throw new db[(_0xbae7('0x1c'))][(_0xbae7('0x1d'))](_0xbae7('0x22'));}if(!_0x5dd094[_0xbae7('0x12')]){throw new Error(_0xbae7('0x23'));}if(_0x3d17ae[_0xbae7('0x20')]===_0x4090a1['id']){return _0x4090a1;}else{return db['CloudProvider'][_0xbae7('0x24')]({'where':{'id':_settings[_0xbae7('0x20')]}});}})[_0xbae7('0xe')](function(_0x1f586d){if(!_0x1f586d){throw new db[(_0xbae7('0x1c'))][(_0xbae7('0x1d'))](_0xbae7('0x25'));}if(!_0x1f586d[_0xbae7('0xc')]||!_0x1f586d[_0xbae7('0x26')]){throw new db[(_0xbae7('0x1c'))][(_0xbae7('0x1d'))](_0xbae7('0x27'));}_0x5b1abe=_0x1f586d;logger['info'](util[_0xbae7('0xa')](_0xbae7('0x28'),_0x48af40['id']));return sentiment(_0x5b1abe[_0xbae7('0xc')],_0x5b1abe['data2'],_0x3d17ae[_0xbae7('0x21')],_0x5dd094[_0xbae7('0x12')],_0x3d17ae['language']);})[_0xbae7('0xe')](function(_0x1f27fb){logger[_0xbae7('0x9')](util[_0xbae7('0xa')](_0xbae7('0x29'),_0x48af40['id']));return _0x48af40[_0xbae7('0x1b')]({'sentiment':_0x1f27fb[_0xbae7('0x2a')],'sPositive':_0x1f27fb[_0xbae7('0x2b')][_0xbae7('0x2c')],'sNegative':_0x1f27fb['SentimentScore']['Negative'],'sMixed':_0x1f27fb[_0xbae7('0x2b')][_0xbae7('0x2d')],'sNeutral':_0x1f27fb['SentimentScore'][_0xbae7('0x2e')]});})[_0xbae7('0xe')](function(){logger[_0xbae7('0x9')](util[_0xbae7('0xa')](_0xbae7('0x2f'),_0x48af40['id']));_0x4800d4();});case _0xbae7('0x30'):return _0x48af40[_0xbae7('0x1b')]({'transcribeStatus':_0xbae7('0x30'),'failureReason':_0x1b9ee1['TranscriptionJob']['FailureReason']})[_0xbae7('0xe')](function(){logger['info'](util[_0xbae7('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x48af40['id']));_0x4800d4();});default:logger[_0xbae7('0x9')](util[_0xbae7('0xa')](_0xbae7('0x31'),_0x48af40['id']));break;}}else{return BPromise[_0xbae7('0x32')]()[_0xbae7('0xe')](function(){if(!_0x48af40[_0xbae7('0x33')]){throw new db['Sequelize'][(_0xbae7('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3d17ae['sentiment']||!_0x3d17ae[_0xbae7('0x20')]||!_0x3d17ae[_0xbae7('0x21')]||!_0x3d17ae[_0xbae7('0x34')]||!_0x3d17ae[_0xbae7('0x35')]){throw new db[(_0xbae7('0x1c'))]['ValidationError'](_0xbae7('0x22'));}if(!_0x48af40[_0xbae7('0x12')]){throw new Error(_0xbae7('0x23'));}if(_0x3d17ae[_0xbae7('0x20')]===_0x4090a1['id']){return _0x4090a1;}else{return db[_0xbae7('0x36')]['findOne']({'where':{'id':_settings[_0xbae7('0x20')]}});}})['then'](function(_0x6b13a9){if(!_0x6b13a9){throw new db[(_0xbae7('0x1c'))][(_0xbae7('0x1d'))](_0xbae7('0x25'));}if(!_0x6b13a9[_0xbae7('0xc')]||!_0x6b13a9['data2']){throw new db[(_0xbae7('0x1c'))][(_0xbae7('0x1d'))](_0xbae7('0x27'));}_0x5b1abe=_0x6b13a9;logger[_0xbae7('0x9')](util[_0xbae7('0xa')](_0xbae7('0x28'),_0x48af40['id']));return sentiment(_0x5b1abe[_0xbae7('0xc')],_0x5b1abe['data2'],_0x3d17ae[_0xbae7('0x21')],_0x48af40[_0xbae7('0x12')],_0x3d17ae[_0xbae7('0x34')]);})[_0xbae7('0xe')](function(_0x1330b6){logger[_0xbae7('0x9')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x48af40['id']));return _0x48af40[_0xbae7('0x1b')]({'sentiment':_0x1330b6[_0xbae7('0x2a')],'sPositive':_0x1330b6['SentimentScore'][_0xbae7('0x2c')],'sNegative':_0x1330b6[_0xbae7('0x2b')][_0xbae7('0x37')],'sMixed':_0x1330b6[_0xbae7('0x2b')][_0xbae7('0x2d')],'sNeutral':_0x1330b6['SentimentScore'][_0xbae7('0x2e')],'transcribeStatus':_0xbae7('0x38')});})[_0xbae7('0xe')](function(){logger[_0xbae7('0x9')](util['format'](_0xbae7('0x2f'),_0x48af40['id']));_0x4800d4();});}})[_0xbae7('0x39')](function(_0x23ad3d){if(_0x23ad3d){if(!_0x23ad3d[_0xbae7('0x3a')]||_0x23ad3d['name']!==_0xbae7('0x3b')){logger[_0xbae7('0x3c')](util[_0xbae7('0xa')](_0xbae7('0x3d'),_0x48af40['id']),util['inspect'](_0x23ad3d,{'showHidden':![],'depth':null}));}}_0x4800d4();});});}function checkTranscribe(){var _0x3b8b3b;var _0x12f398;var _0xb6df1f;return db[_0xbae7('0x3e')][_0xbae7('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x539d78){if(!_0x539d78||!_0x539d78[_0xbae7('0x19')]){throw new db[(_0xbae7('0x1c'))][(_0xbae7('0x1d'))](_0xbae7('0x40'));}_0x3b8b3b=_0x539d78;return db[_0xbae7('0x41')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x1bb00a){if(!_0x1bb00a){throw new db[(_0xbae7('0x1c'))][(_0xbae7('0x1d'))]('Settings\x20not\x20available');}_0x12f398=_0x1bb00a;if(!_0x12f398[_0xbae7('0x5')]||!_0x12f398[_0xbae7('0x42')]||!_0x12f398[_0xbae7('0x43')]||!_0x12f398[_0xbae7('0x34')]||!_0x12f398[_0xbae7('0x35')]){throw new db['Sequelize'][(_0xbae7('0x1d'))]('Transcribe\x20not\x20configured');}return db[_0xbae7('0x36')][_0xbae7('0x24')]({'where':{'id':_0x12f398[_0xbae7('0x42')]}});})[_0xbae7('0xe')](function(_0x384fbc){if(!_0x384fbc){throw new db[(_0xbae7('0x1c'))]['ValidationError'](_0xbae7('0x25'));}if(!_0x384fbc[_0xbae7('0xc')]||!_0x384fbc['data2']){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0xb6df1f=_0x384fbc;var _0x35efe1=[];_0x3b8b3b[_0xbae7('0x44')](function(_0x77e014){_0x35efe1[_0xbae7('0x45')](checkTranscribeJob(_0x77e014,_0x12f398,_0xb6df1f));});return BPromise[_0xbae7('0x46')](_0x35efe1);})[_0xbae7('0x39')](function(_0x5f2e3e){if(_0x5f2e3e){if(!_0x5f2e3e[_0xbae7('0x3a')]||_0x5f2e3e[_0xbae7('0x3a')]!==_0xbae7('0x3b')){logger[_0xbae7('0x3c')](util['inspect'](_0x5f2e3e,{'showHidden':![],'depth':null}));}}});}exports[_0xbae7('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 46cc693..4cf9b04 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 _0xaf5a=['localhost','socket.io-emitter','redis','findAll','lastMsgAt','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','defaults'];(function(_0x20eb3d,_0x58c78b){var _0x2d1021=function(_0x2fa850){while(--_0x2fa850){_0x20eb3d['push'](_0x20eb3d['shift']());}};_0x2d1021(++_0x58c78b);}(_0xaf5a,0x71));var _0xaaf5=function(_0x21fc96,_0x2df0fe){_0x21fc96=_0x21fc96-0x0;var _0x2e00b0=_0xaf5a[_0x21fc96];return _0x2e00b0;};'use strict';var _=require('lodash');var moment=require(_0xaaf5('0x0'));var Redis=require(_0xaaf5('0x1'));var util=require('util');var config=require(_0xaaf5('0x2'));var db=require(_0xaaf5('0x3'))['db'];var logger=require(_0xaaf5('0x4'))(_0xaaf5('0x5'));config['redis']=_[_0xaaf5('0x6')](config['redis'],{'host':_0xaaf5('0x7'),'port':0x18eb});var io=require(_0xaaf5('0x8'))(new Redis(config[_0xaaf5('0x9')]));function closeInteractions(){var _0x37d9e3=[];return db['WhatsappInteraction'][_0xaaf5('0xa')]({'raw':!![],'attributes':['id',_0xaaf5('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xaaf5('0xc'))}}})[_0xaaf5('0xd')](function(_0x2c82f7){if(_0x2c82f7&&_0x2c82f7[_0xaaf5('0xe')]){_0x37d9e3=_[_0xaaf5('0xf')](_0x2c82f7||[],'id');logger['info'](_0xaaf5('0x10'),_0x37d9e3[_0xaaf5('0x11')]());return db['WhatsappInteraction'][_0xaaf5('0x12')]({'closeReason':_0xaaf5('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xaaf5('0x14')](_0xaaf5('0x15'))},{'where':{'id':_0x37d9e3}});}})[_0xaaf5('0xd')](function(){if(_0x37d9e3&&_0x37d9e3[_0xaaf5('0xe')]){logger[_0xaaf5('0x16')](_0xaaf5('0x17'),_0x37d9e3[_0xaaf5('0x11')]());for(var _0x30309c=0x0;_0x30309c<_0x37d9e3['length'];_0x30309c++){io['emit'](_0xaaf5('0x18'),{'id':_0x37d9e3[_0x30309c],'closed':!![]});}}})[_0xaaf5('0x19')](function(_0x380a5a){logger[_0xaaf5('0x1a')](_0xaaf5('0x1b'),_0x380a5a?util[_0xaaf5('0x1c')](_0x380a5a,{'showHidden':![],'depth':null}):'');});}exports[_0xaaf5('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7b0b=['start','lodash','moment','ioredis','../../mysqldb','../logger','schedule','redis','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','inspect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b0b,0x146));var _0xb7b0=function(_0x1a900a,_0x3a77a7){_0x1a900a=_0x1a900a-0x0;var _0x407d77=_0x7b0b[_0x1a900a];return _0x407d77;};'use strict';var _=require(_0xb7b0('0x0'));var moment=require(_0xb7b0('0x1'));var Redis=require(_0xb7b0('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0xb7b0('0x3'))['db'];var logger=require(_0xb7b0('0x4'))(_0xb7b0('0x5'));config[_0xb7b0('0x6')]=_['defaults'](config[_0xb7b0('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb7b0('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x2884cf=[];return db[_0xb7b0('0x8')][_0xb7b0('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xb7b0('0xa')](0x18,_0xb7b0('0xb'))}}})[_0xb7b0('0xc')](function(_0x1529e3){if(_0x1529e3&&_0x1529e3[_0xb7b0('0xd')]){_0x2884cf=_['map'](_0x1529e3||[],'id');logger[_0xb7b0('0xe')](_0xb7b0('0xf'),_0x2884cf[_0xb7b0('0x10')]());return db['WhatsappInteraction'][_0xb7b0('0x11')]({'closeReason':_0xb7b0('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xb7b0('0x13'))},{'where':{'id':_0x2884cf}});}})[_0xb7b0('0xc')](function(){if(_0x2884cf&&_0x2884cf['length']){logger[_0xb7b0('0xe')](_0xb7b0('0x14'),_0x2884cf[_0xb7b0('0x10')]());for(var _0x93c80a=0x0;_0x93c80a<_0x2884cf[_0xb7b0('0xd')];_0x93c80a++){io['emit'](_0xb7b0('0x15'),{'id':_0x2884cf[_0x93c80a],'closed':!![]});}}})[_0xb7b0('0x16')](function(_0x4fcf28){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4fcf28?util[_0xb7b0('0x17')](_0x4fcf28,{'showHidden':![],'depth':null}):'');});}exports[_0xb7b0('0x18')]=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 b969831..10f9516 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e85=['now','innocenzo.biondo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','util','push','Innocenzo','Biondo'];(function(_0x55de41,_0x29e5d1){var _0x1117e3=function(_0x2dad7f){while(--_0x2dad7f){_0x55de41['push'](_0x55de41['shift']());}};_0x1117e3(++_0x29e5d1);}(_0x3e85,0x1bc));var _0x53e8=function(_0x5bfb00,_0x52ffc4){_0x5bfb00=_0x5bfb00-0x0;var _0x24885f=_0x3e85[_0x5bfb00];return _0x24885f;};'use strict';var util=require(_0x53e8('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x53e8('0x1')]({'id':i,'firstName':_0x53e8('0x2')+i,'lastName':_0x53e8('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x53e8('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x53e8('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x53e8('0x4')](),'updatedAt':Date[_0x53e8('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x53e8('0x1')]({'id':i,'firstName':_0x53e8('0x2')+i,'lastName':_0x53e8('0x3')+i,'phone':0xf879fb460+i,'email':_0x53e8('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x53e8('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x53e8('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x53e8('0x4')](),'updatedAt':Date[_0x53e8('0x4')]()});}db[_0x53e8('0x6')][_0x53e8('0x7')]({'where':{}})[_0x53e8('0x8')](function(){return db['CmContact'][_0x53e8('0x9')](contacts);})[_0x53e8('0x8')](function(){console[_0x53e8('0xa')](_0x53e8('0xb'),_0x53e8('0xc'));return db[_0x53e8('0xd')][_0x53e8('0x7')]({'where':{}});})[_0x53e8('0x8')](function(){return db[_0x53e8('0xd')]['bulkCreate'](hopper);})[_0x53e8('0x8')](function(){console[_0x53e8('0xa')](_0x53e8('0xb'),'hopper1');return db[_0x53e8('0x6')][_0x53e8('0x9')](contacts2);})[_0x53e8('0x8')](function(){console[_0x53e8('0xa')](_0x53e8('0xb'),'contacts2');return db['CmHopper'][_0x53e8('0x9')](hopper2);})[_0x53e8('0x8')](function(){console[_0x53e8('0xa')](_0x53e8('0xb'),'hopper2');})['catch'](function(_0x3056bf){console[_0x53e8('0xa')](_0x3056bf);}); \ No newline at end of file +var _0xcfb7=['now','Innocenzo','CmContact','destroy','then','bulkCreate','contacts1','CmHopper','finished\x20populating','hopper1','log','contacts2','hopper2','catch','util','../mysqldb','innocenzo.biondo','@xcally.com','push'];(function(_0x8ee4d,_0x47f1ca){var _0x1ff628=function(_0x2a8b87){while(--_0x2a8b87){_0x8ee4d['push'](_0x8ee4d['shift']());}};_0x1ff628(++_0x47f1ca);}(_0xcfb7,0x177));var _0x7cfb=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xcfb7[_0x3899d1];return _0xeb4a7d;};'use strict';var util=require(_0x7cfb('0x0'));var db=require(_0x7cfb('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x7cfb('0x2')+i+_0x7cfb('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7cfb('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7cfb('0x5')](),'updatedAt':Date[_0x7cfb('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x7cfb('0x6')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x7cfb('0x2')+i+_0x7cfb('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7cfb('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x7cfb('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7cfb('0x5')](),'updatedAt':Date[_0x7cfb('0x5')]()});}db[_0x7cfb('0x7')][_0x7cfb('0x8')]({'where':{}})[_0x7cfb('0x9')](function(){return db[_0x7cfb('0x7')][_0x7cfb('0xa')](contacts);})[_0x7cfb('0x9')](function(){console['log']('finished\x20populating',_0x7cfb('0xb'));return db['CmHopper']['destroy']({'where':{}});})[_0x7cfb('0x9')](function(){return db[_0x7cfb('0xc')]['bulkCreate'](hopper);})[_0x7cfb('0x9')](function(){console['log'](_0x7cfb('0xd'),_0x7cfb('0xe'));return db[_0x7cfb('0x7')][_0x7cfb('0xa')](contacts2);})[_0x7cfb('0x9')](function(){console[_0x7cfb('0xf')]('finished\x20populating',_0x7cfb('0x10'));return db[_0x7cfb('0xc')]['bulkCreate'](hopper2);})[_0x7cfb('0x9')](function(){console['log'](_0x7cfb('0xd'),_0x7cfb('0x11'));})[_0x7cfb('0x12')](function(_0x397fbd){console[_0x7cfb('0xf')](_0x397fbd);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 93253a8..d358dc4 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf20b=['catch','util','../mysqldb','%s%s','agent','format','%s%s@xcally.com','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user'];(function(_0x453f88,_0x47bc99){var _0x2a84d0=function(_0x48c61b){while(--_0x48c61b){_0x453f88['push'](_0x453f88['shift']());}};_0x2a84d0(++_0x47bc99);}(_0xf20b,0x1e1));var _0xbf20=function(_0x85e768,_0x3655c3){_0x85e768=_0x85e768-0x0;var _0x17c60d=_0xf20b[_0x85e768];return _0x17c60d;};'use strict';var util=require(_0xbf20('0x0'));var db=require(_0xbf20('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xbf20('0x2'),_0xbf20('0x3'),i),'fullname':util[_0xbf20('0x4')](_0xbf20('0x2'),_0xbf20('0x3'),i),'email':util[_0xbf20('0x4')](_0xbf20('0x5'),_0xbf20('0x3'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0xbf20('0x6'),'transport':[_0xbf20('0x7'),'ws',_0xbf20('0x8')],'disallow':[_0xbf20('0x9')],'allow':[_0xbf20('0xa')],'defaultuser':util[_0xbf20('0x4')]('%s%s','agent',i),'encryption':_0xbf20('0xb'),'avpf':'yes','force_avp':'yes','icesupport':_0xbf20('0xb'),'dtlsenable':_0xbf20('0xb'),'dtlsverify':'no','dtlscertfile':_0xbf20('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util['format'](_0xbf20('0xd'),util['format'](_0xbf20('0x2'),_0xbf20('0x3'),i),0xfa0+i)});}db[_0xbf20('0xe')][_0xbf20('0xf')](users)[_0xbf20('0x10')](function(){console[_0xbf20('0x11')](_0xbf20('0x12'));})[_0xbf20('0x13')](function(_0x12c0f6){console['log'](_0x12c0f6);}); \ No newline at end of file +var _0x9d58=['%s%s@xcally.com','password','friend','all','ulaw','format','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent'];(function(_0x1ad0fd,_0xcdcbfb){var _0xf6243d=function(_0x310b29){while(--_0x310b29){_0x1ad0fd['push'](_0x1ad0fd['shift']());}};_0xf6243d(++_0xcdcbfb);}(_0x9d58,0xff));var _0x89d5=function(_0x5a26db,_0x2c5ccd){_0x5a26db=_0x5a26db-0x0;var _0x4619dd=_0x9d58[_0x5a26db];return _0x4619dd;};'use strict';var util=require(_0x89d5('0x0'));var db=require(_0x89d5('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x89d5('0x2')]({'name':util['format'](_0x89d5('0x3'),_0x89d5('0x4'),i),'fullname':util['format']('%s%s','agent',i),'email':util['format'](_0x89d5('0x5'),_0x89d5('0x4'),i),'role':_0x89d5('0x4'),'password':_0x89d5('0x6'),'internal':0xfa0+i,'type':_0x89d5('0x7'),'transport':['udp','ws','wss'],'disallow':[_0x89d5('0x8')],'allow':[_0x89d5('0x9')],'defaultuser':util[_0x89d5('0xa')]('%s%s','agent',i),'encryption':_0x89d5('0xb'),'avpf':_0x89d5('0xb'),'force_avp':_0x89d5('0xb'),'icesupport':_0x89d5('0xb'),'dtlsenable':_0x89d5('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x89d5('0xc'),'dtlssetup':'actpass','callerid':util[_0x89d5('0xa')](_0x89d5('0xd'),util['format'](_0x89d5('0x3'),_0x89d5('0x4'),i),0xfa0+i)});}db[_0x89d5('0xe')][_0x89d5('0xf')](users)[_0x89d5('0x10')](function(){console[_0x89d5('0x11')](_0x89d5('0x12'));})[_0x89d5('0x13')](function(_0x54de1e){console['log'](_0x54de1e);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index f2fcd95..2268c9c 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9300=['removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','UserProfileSection','findOne','ChatQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','then','map','where','ivr','format','%s:queue:%s','handshake','query','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:inbound','voice:outbound','SmsQueues','MailQueues','IvrCampaigns','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','leave'];(function(_0x37a0bd,_0x185f4d){var _0x15f426=function(_0x13eb69){while(--_0x13eb69){_0x37a0bd['push'](_0x37a0bd['shift']());}};_0x15f426(++_0x185f4d);}(_0x9300,0x153));var _0x0930=function(_0x222a4b,_0x3d53d2){_0x222a4b=_0x222a4b-0x0;var _0x2bedb3=_0x9300[_0x222a4b];return _0x2bedb3;};'use strict';var _=require(_0x0930('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x0930('0x1'))['db'];var config=require(_0x0930('0x2'));var queryQueues={'attributes':['id',_0x0930('0x3')],'include':[{'as':_0x0930('0x4'),'model':db[_0x0930('0x5')],'attributes':['id','name',_0x0930('0x6')],'raw':!![],'where':{'role':_0x0930('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x0930('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x0930('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x0930('0x3')],'where':{'role':_0x0930('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x0930('0x3'),_0x0930('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4a7705,_0x31aaa2,_0x4b1994){return db[_0x0930('0xa')][_0x0930('0xb')]({'where':{'name':_0x4a7705,'userProfileId':_0x31aaa2},'raw':!![]})['then'](function(_0x6db8ef){if(_0x6db8ef){if(_0x6db8ef['autoAssociation']){switch(_0x4a7705){case'VoiceQueues':case _0x0930('0xc'):case _0x0930('0xd'):case'SmsQueues':case'MailQueues':case _0x0930('0xe'):case _0x0930('0xf'):return db[_0x4b1994][_0x0930('0x10')](queryQueues);case _0x0930('0x11'):return db[_0x4b1994][_0x0930('0x10')](queryTelephones);case _0x0930('0x12'):return db[_0x4b1994]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x4b1994]['findAll'](queryCampaigns);}}else{return db[_0x0930('0x13')]['findAll']({'attributes':[_0x0930('0x14')],'where':{'sectionId':_0x6db8ef['id']},'raw':!![]})[_0x0930('0x15')](function(_0x255988){if(_0x255988){var _0x3af83f={'where':{'id':_[_0x0930('0x16')](_0x255988,_0x0930('0x14'))},'raw':!![]};switch(_0x4b1994){case'User':_0x3af83f[_0x0930('0x17')][_0x0930('0x6')]='telephone';break;case'Campaign':_0x3af83f[_0x0930('0x17')][_0x0930('0x9')]=_0x0930('0x18');break;}return db[_0x4b1994][_0x0930('0x10')](_0x3af83f);}else{return[];}});}}else{return[];}})[_0x0930('0x15')](function(_0x4b1eb0){return _0x4b1eb0;});}function joinOrLeaveQueues(_0x19b4e4,_0x16c5fb,_0x4cf8ad,_0x1aa8bb){_0x19b4e4[_0x16c5fb](util[_0x0930('0x19')](_0x0930('0x1a'),_0x4cf8ad,_0x1aa8bb[_0x0930('0x3')]));if(_0x1aa8bb[_0x0930('0x4')]){for(var _0xea7c6c=0x0;_0xea7c6c<_0x1aa8bb['Agents']['length'];_0xea7c6c+=0x1){_0x19b4e4[_0x16c5fb](util[_0x0930('0x19')]('user:%s',_0x1aa8bb[_0x0930('0x4')][_0xea7c6c][_0x0930('0x3')]));}}}function joinOrLeave(_0x361264,_0x4aac18,_0x37e243){var _0x48bdf5;if(_0x361264[_0x0930('0x1b')][_0x0930('0x1c')]['id']){db['User']['find']({'attributes':['id',_0x0930('0x3'),_0x0930('0x6'),_0x0930('0x1d')],'where':{'id':_0x361264[_0x0930('0x1b')][_0x0930('0x1c')]['id']},'include':[{'model':db[_0x0930('0x1e')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x0930('0x1f')],'as':_0x0930('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x0930('0x21')],'as':_0x0930('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x0930('0x23')],'as':_0x0930('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x0930('0x25')],'as':_0x0930('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x0930('0x27')],'as':_0x0930('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x2a47f2){if(_0x2a47f2){_0x48bdf5=_0x2a47f2;_0x361264[_0x4aac18](util['format'](_0x0930('0x29'),_0x2a47f2[_0x0930('0x3')]));var _0x2e21c7=[];switch(_0x2a47f2['role']){case _0x0930('0x2a'):_0x361264[_0x4aac18]('voice:inbound');_0x361264[_0x4aac18]('voice:outbound');if(queryQueues[_0x0930('0x2b')]('include')){delete queryQueues[_0x0930('0x2c')];}_0x2e21c7[_0x0930('0x2d')](db[_0x0930('0x2e')][_0x0930('0x10')](queryQueues));_0x2e21c7[_0x0930('0x2d')](db[_0x0930('0x2f')]['findAll'](queryQueues));_0x2e21c7['push'](db[_0x0930('0x30')][_0x0930('0x10')](queryQueues));_0x2e21c7[_0x0930('0x2d')](db[_0x0930('0x31')][_0x0930('0x10')](queryQueues));_0x2e21c7[_0x0930('0x2d')](db[_0x0930('0x32')][_0x0930('0x10')](queryQueues));_0x2e21c7['push'](db[_0x0930('0x33')][_0x0930('0x10')](queryQueues));_0x2e21c7[_0x0930('0x2d')](db[_0x0930('0x34')]['findAll'](queryQueues));_0x2e21c7[_0x0930('0x2d')](db[_0x0930('0x5')][_0x0930('0x10')](queryTelephones));_0x2e21c7[_0x0930('0x2d')](db[_0x0930('0x35')]['findAll'](queryTrunks));_0x2e21c7['push'](db[_0x0930('0x36')][_0x0930('0x10')](queryCampaigns));_0x2e21c7[_0x0930('0x2d')](db[_0x0930('0x5')][_0x0930('0x10')](queryAgents));break;case _0x0930('0x37'):_0x361264[_0x4aac18](_0x0930('0x38'));_0x361264[_0x4aac18](_0x0930('0x39'));_0x2e21c7[_0x0930('0x2d')](getAssociatedResources('VoiceQueues',_0x2a47f2[_0x0930('0x1d')],_0x0930('0x2e')));_0x2e21c7[_0x0930('0x2d')](getAssociatedResources(_0x0930('0xc'),_0x2a47f2[_0x0930('0x1d')],_0x0930('0x2f')));_0x2e21c7[_0x0930('0x2d')](getAssociatedResources(_0x0930('0xd'),_0x2a47f2[_0x0930('0x1d')],_0x0930('0x30')));_0x2e21c7[_0x0930('0x2d')](getAssociatedResources(_0x0930('0x3a'),_0x2a47f2[_0x0930('0x1d')],_0x0930('0x31')));_0x2e21c7[_0x0930('0x2d')](getAssociatedResources(_0x0930('0x3b'),_0x2a47f2['userProfileId'],'MailQueue'));_0x2e21c7['push'](getAssociatedResources(_0x0930('0xe'),_0x2a47f2[_0x0930('0x1d')],_0x0930('0x33')));_0x2e21c7[_0x0930('0x2d')](getAssociatedResources(_0x0930('0xf'),_0x2a47f2[_0x0930('0x1d')],_0x0930('0x34')));_0x2e21c7['push'](getAssociatedResources(_0x0930('0x11'),_0x2a47f2[_0x0930('0x1d')],_0x0930('0x5')));_0x2e21c7[_0x0930('0x2d')](getAssociatedResources(_0x0930('0x12'),_0x2a47f2['userProfileId'],_0x0930('0x35')));_0x2e21c7['push'](getAssociatedResources(_0x0930('0x3c'),_0x2a47f2[_0x0930('0x1d')],'Campaign'));_0x2e21c7[_0x0930('0x2d')](db[_0x0930('0x5')][_0x0930('0x10')](queryAgents));break;case _0x0930('0x7'):_0x361264[_0x4aac18]('voice:inbound');_0x361264[_0x4aac18](_0x0930('0x39'));_0x2e21c7[_0x0930('0x2d')](_0x2a47f2['getVoiceQueues']({'attributes':['id',_0x0930('0x3')]}));_0x2e21c7[_0x0930('0x2d')](_0x2a47f2[_0x0930('0x3d')]({'attributes':['id','name']}));_0x2e21c7[_0x0930('0x2d')](_0x2a47f2[_0x0930('0x3e')]({'attributes':['id',_0x0930('0x3')]}));_0x2e21c7[_0x0930('0x2d')](_0x2a47f2[_0x0930('0x3f')]({'attributes':['id',_0x0930('0x3')]}));_0x2e21c7[_0x0930('0x2d')](_0x2a47f2['getMailQueues']({'attributes':['id','name']}));_0x2e21c7[_0x0930('0x2d')](_0x2a47f2[_0x0930('0x40')]({'attributes':['id','name']}));_0x2e21c7[_0x0930('0x2d')](_0x2a47f2[_0x0930('0x41')]({'attributes':['id',_0x0930('0x3')]}));break;}return BPromise[_0x0930('0x42')](_0x2e21c7);}})['then'](function(_0x1b9af2){if(_0x1b9af2&&_0x1b9af2['length']){for(var _0x294e15=0x0;_0x294e15<_0x1b9af2[_0x0930('0x43')];_0x294e15+=0x1){for(var _0x2d6d40=0x0;_0x2d6d40<_0x1b9af2[_0x294e15][_0x0930('0x43')];_0x2d6d40+=0x1){switch(_0x294e15){case 0x0:joinOrLeaveQueues(_0x361264,_0x4aac18,_0x0930('0x44'),_0x1b9af2[_0x294e15][_0x2d6d40]);break;case 0x1:joinOrLeaveQueues(_0x361264,_0x4aac18,_0x0930('0x45'),_0x1b9af2[_0x294e15][_0x2d6d40]);break;case 0x2:joinOrLeaveQueues(_0x361264,_0x4aac18,_0x0930('0x46'),_0x1b9af2[_0x294e15][_0x2d6d40]);break;case 0x3:joinOrLeaveQueues(_0x361264,_0x4aac18,_0x0930('0x47'),_0x1b9af2[_0x294e15][_0x2d6d40]);break;case 0x4:joinOrLeaveQueues(_0x361264,_0x4aac18,_0x0930('0x48'),_0x1b9af2[_0x294e15][_0x2d6d40]);break;case 0x5:joinOrLeaveQueues(_0x361264,_0x4aac18,_0x0930('0x49'),_0x1b9af2[_0x294e15][_0x2d6d40]);break;case 0x6:joinOrLeaveQueues(_0x361264,_0x4aac18,_0x0930('0x4a'),_0x1b9af2[_0x294e15][_0x2d6d40]);break;case 0x7:if(_0x48bdf5[_0x0930('0x6')]!==_0x0930('0x7'))_0x361264[_0x4aac18](util[_0x0930('0x19')](_0x0930('0x4b'),_0x1b9af2[_0x294e15][_0x2d6d40][_0x0930('0x3')]));break;case 0x8:if(_0x48bdf5[_0x0930('0x6')]!=='agent')_0x361264[_0x4aac18](util[_0x0930('0x19')]('trunk:%s',_0x1b9af2[_0x294e15][_0x2d6d40][_0x0930('0x3')]));break;case 0x9:if(_0x48bdf5['role']!==_0x0930('0x7'))_0x361264[_0x4aac18](util[_0x0930('0x19')]('campaign:%s:%s',_0x1b9af2[_0x294e15][_0x2d6d40][_0x0930('0x9')],_0x1b9af2[_0x294e15][_0x2d6d40][_0x0930('0x3')]));break;case 0xa:_0x361264[_0x4aac18](util[_0x0930('0x19')](_0x0930('0x29'),_0x1b9af2[_0x294e15][_0x2d6d40][_0x0930('0x3')]));break;}}}}})['then'](function(){if(_0x4aac18==='leave'){var _0x50b47d=_[_0x0930('0x16')](_0x48bdf5[_0x0930('0x4c')],'id');return _0x48bdf5[_0x0930('0x4d')](_0x50b47d)[_0x0930('0x15')](function(){for(var _0x2ceb03=0x0;_0x2ceb03<_0x50b47d[_0x0930('0x43')];_0x2ceb03+=0x1){_0x37e243[_0x0930('0x4e')](_0x0930('0x4f'),{'ChatInteractionId':Number(_0x50b47d[_0x2ceb03]),'UserId':Number(_0x48bdf5['id'])});}});}})[_0x0930('0x15')](function(){if(_0x4aac18===_0x0930('0x50')){var _0x1d8124=_[_0x0930('0x16')](_0x48bdf5[_0x0930('0x20')],'id');return _0x48bdf5[_0x0930('0x51')](_0x1d8124)[_0x0930('0x15')](function(){for(var _0x58e812=0x0;_0x58e812<_0x1d8124['length'];_0x58e812+=0x1){_0x37e243['emit'](_0x0930('0x52'),{'MailInteractionId':Number(_0x1d8124[_0x58e812]),'UserId':Number(_0x48bdf5['id'])});}});}})[_0x0930('0x15')](function(){if(_0x4aac18===_0x0930('0x50')){var _0x38da03=_['map'](_0x48bdf5['FaxInteractions'],'id');return _0x48bdf5[_0x0930('0x53')](_0x38da03)[_0x0930('0x15')](function(){for(var _0x2d7ef2=0x0;_0x2d7ef2<_0x38da03[_0x0930('0x43')];_0x2d7ef2+=0x1){_0x37e243['emit'](_0x0930('0x54'),{'FaxInteractionId':Number(_0x38da03[_0x2d7ef2]),'UserId':Number(_0x48bdf5['id'])});}});}})[_0x0930('0x15')](function(){if(_0x4aac18===_0x0930('0x50')){var _0x3f47f2=_[_0x0930('0x16')](_0x48bdf5[_0x0930('0x24')],'id');return _0x48bdf5[_0x0930('0x55')](_0x3f47f2)[_0x0930('0x15')](function(){for(var _0x310199=0x0;_0x310199<_0x3f47f2[_0x0930('0x43')];_0x310199+=0x1){_0x37e243[_0x0930('0x4e')](_0x0930('0x56'),{'SmsInteractionId':Number(_0x3f47f2[_0x310199]),'UserId':Number(_0x48bdf5['id'])});}});}})[_0x0930('0x15')](function(){if(_0x4aac18===_0x0930('0x50')){var _0xda8945=_[_0x0930('0x16')](_0x48bdf5[_0x0930('0x26')],'id');return _0x48bdf5[_0x0930('0x57')](_0xda8945)[_0x0930('0x15')](function(){for(var _0x1297ab=0x0;_0x1297ab<_0xda8945[_0x0930('0x43')];_0x1297ab+=0x1){_0x37e243[_0x0930('0x4e')](_0x0930('0x58'),{'OpenchannelInteractionId':Number(_0xda8945[_0x1297ab]),'UserId':Number(_0x48bdf5['id'])});}});}})[_0x0930('0x15')](function(){if(_0x4aac18===_0x0930('0x50')){var _0x5aa376=_[_0x0930('0x16')](_0x48bdf5[_0x0930('0x28')],'id');return _0x48bdf5[_0x0930('0x59')](_0x5aa376)[_0x0930('0x15')](function(){for(var _0x3a96c0=0x0;_0x3a96c0<_0x5aa376[_0x0930('0x43')];_0x3a96c0+=0x1){_0x37e243[_0x0930('0x4e')](_0x0930('0x5a'),{'WhatsappInteractionId':Number(_0x5aa376[_0x3a96c0]),'UserId':Number(_0x48bdf5['id'])});}});}})[_0x0930('0x5b')](function(_0x41e35b){_0x361264[_0x0930('0x5c')](_0x41e35b);});}}function onDisconnect(_0x30ad0b,_0x2fd05d){joinOrLeave(_0x30ad0b,_0x0930('0x50'),_0x2fd05d);}function onConnect(_0x7bd12d){joinOrLeave(_0x7bd12d,_0x0930('0x5d'));}exports['default']=function(_0x37b3b2){_0x37b3b2['on'](_0x0930('0x5e'),function(_0x564008){_0x564008[_0x0930('0x5f')](0x0);_0x564008[_0x0930('0x60')]=_0x564008[_0x0930('0x61')][_0x0930('0x5e')][_0x0930('0x62')]+':'+_0x564008['request'][_0x0930('0x5e')]['remotePort'];_0x564008[_0x0930('0x63')]=new Date();_0x564008[_0x0930('0x5c')]=function(_0x35b867){console['log'](_0x0930('0x64')+_0x564008[_0x0930('0x65')][_0x0930('0x3')]+'['+_0x564008['address']+']',_0x35b867);};_0x564008['on'](_0x0930('0x66'),function(){onDisconnect(_0x564008,_0x37b3b2);_0x564008[_0x0930('0x5c')](_0x0930('0x67'));});onConnect(_0x564008);_0x564008[_0x0930('0x5c')](_0x0930('0x68'));});}; \ No newline at end of file +var _0x649f=['Trunk','user','voice:inbound','userProfileId','SmsQueue','OpenchannelQueues','Telephones','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','trunk:%s','campaign:%s:%s','map','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','name','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','Campaign','format','%s:queue:%s','Agents','length','handshake','query','find','ChatInteractions','MailInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue'];(function(_0xd19f1f,_0x4e9015){var _0x409c77=function(_0x2496c2){while(--_0x2496c2){_0xd19f1f['push'](_0xd19f1f['shift']());}};_0x409c77(++_0x4e9015);}(_0x649f,0x93));var _0xf649=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x649f[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var BPromise=require(_0xf649('0x2'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xf649('0x3')],'include':[{'as':'Agents','model':db[_0xf649('0x4')],'attributes':['id',_0xf649('0x3'),_0xf649('0x5')],'raw':!![],'where':{'role':_0xf649('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xf649('0x3')],'where':{'role':_0xf649('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xf649('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0xf649('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xf649('0x8')],'where':{'type':_0xf649('0x9')}};function getAssociatedResources(_0x3ab98d,_0x521845,_0x19e6ca){return db[_0xf649('0xa')][_0xf649('0xb')]({'where':{'name':_0x3ab98d,'userProfileId':_0x521845},'raw':!![]})[_0xf649('0xc')](function(_0x5abb8f){if(_0x5abb8f){if(_0x5abb8f[_0xf649('0xd')]){switch(_0x3ab98d){case _0xf649('0xe'):case _0xf649('0xf'):case _0xf649('0x10'):case _0xf649('0x11'):case _0xf649('0x12'):case'OpenchannelQueues':case _0xf649('0x13'):return db[_0x19e6ca]['findAll'](queryQueues);case'Telephones':return db[_0x19e6ca][_0xf649('0x14')](queryTelephones);case _0xf649('0x15'):return db[_0x19e6ca][_0xf649('0x14')](queryTrunks);case _0xf649('0x16'):return db[_0x19e6ca][_0xf649('0x14')](queryCampaigns);}}else{return db[_0xf649('0x17')][_0xf649('0x14')]({'attributes':[_0xf649('0x18')],'where':{'sectionId':_0x5abb8f['id']},'raw':!![]})['then'](function(_0x1980b3){if(_0x1980b3){var _0x1d6fe4={'where':{'id':_['map'](_0x1980b3,_0xf649('0x18'))},'raw':!![]};switch(_0x19e6ca){case _0xf649('0x4'):_0x1d6fe4[_0xf649('0x19')]['role']='telephone';break;case _0xf649('0x1a'):_0x1d6fe4[_0xf649('0x19')][_0xf649('0x8')]=_0xf649('0x9');break;}return db[_0x19e6ca][_0xf649('0x14')](_0x1d6fe4);}else{return[];}});}}else{return[];}})[_0xf649('0xc')](function(_0x35cea2){return _0x35cea2;});}function joinOrLeaveQueues(_0x4c5899,_0x439a97,_0x3e61a1,_0x4176be){_0x4c5899[_0x439a97](util[_0xf649('0x1b')](_0xf649('0x1c'),_0x3e61a1,_0x4176be[_0xf649('0x3')]));if(_0x4176be[_0xf649('0x1d')]){for(var _0x6cfc72=0x0;_0x6cfc72<_0x4176be[_0xf649('0x1d')][_0xf649('0x1e')];_0x6cfc72+=0x1){_0x4c5899[_0x439a97](util[_0xf649('0x1b')]('user:%s',_0x4176be[_0xf649('0x1d')][_0x6cfc72]['name']));}}}function joinOrLeave(_0xbfb6cc,_0x1e0d54,_0x3c9fb3){var _0xd939e0;if(_0xbfb6cc[_0xf649('0x1f')][_0xf649('0x20')]['id']){db[_0xf649('0x4')][_0xf649('0x21')]({'attributes':['id',_0xf649('0x3'),_0xf649('0x5'),'userProfileId'],'where':{'id':_0xbfb6cc[_0xf649('0x1f')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0xf649('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xf649('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf649('0x24')],'as':_0xf649('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xf649('0x26')],'as':_0xf649('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xf649('0x28')],'as':_0xf649('0x29'),'attributes':['id'],'raw':!![]}]})[_0xf649('0xc')](function(_0x283147){if(_0x283147){_0xd939e0=_0x283147;_0xbfb6cc[_0x1e0d54](util[_0xf649('0x1b')](_0xf649('0x2a'),_0x283147[_0xf649('0x3')]));var _0x577aa3=[];switch(_0x283147[_0xf649('0x5')]){case _0xf649('0x2b'):_0xbfb6cc[_0x1e0d54]('voice:inbound');_0xbfb6cc[_0x1e0d54](_0xf649('0x2c'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0xf649('0x2d')];}_0x577aa3[_0xf649('0x2e')](db[_0xf649('0x2f')][_0xf649('0x14')](queryQueues));_0x577aa3[_0xf649('0x2e')](db[_0xf649('0x30')]['findAll'](queryQueues));_0x577aa3[_0xf649('0x2e')](db[_0xf649('0x31')][_0xf649('0x14')](queryQueues));_0x577aa3['push'](db['SmsQueue'][_0xf649('0x14')](queryQueues));_0x577aa3[_0xf649('0x2e')](db[_0xf649('0x32')][_0xf649('0x14')](queryQueues));_0x577aa3['push'](db[_0xf649('0x33')][_0xf649('0x14')](queryQueues));_0x577aa3[_0xf649('0x2e')](db[_0xf649('0x34')][_0xf649('0x14')](queryQueues));_0x577aa3[_0xf649('0x2e')](db[_0xf649('0x4')][_0xf649('0x14')](queryTelephones));_0x577aa3[_0xf649('0x2e')](db[_0xf649('0x35')][_0xf649('0x14')](queryTrunks));_0x577aa3['push'](db[_0xf649('0x1a')]['findAll'](queryCampaigns));_0x577aa3[_0xf649('0x2e')](db[_0xf649('0x4')][_0xf649('0x14')](queryAgents));break;case _0xf649('0x36'):_0xbfb6cc[_0x1e0d54](_0xf649('0x37'));_0xbfb6cc[_0x1e0d54](_0xf649('0x2c'));_0x577aa3[_0xf649('0x2e')](getAssociatedResources(_0xf649('0xe'),_0x283147['userProfileId'],_0xf649('0x2f')));_0x577aa3[_0xf649('0x2e')](getAssociatedResources('ChatQueues',_0x283147[_0xf649('0x38')],_0xf649('0x30')));_0x577aa3[_0xf649('0x2e')](getAssociatedResources(_0xf649('0x10'),_0x283147['userProfileId'],_0xf649('0x31')));_0x577aa3[_0xf649('0x2e')](getAssociatedResources(_0xf649('0x11'),_0x283147[_0xf649('0x38')],_0xf649('0x39')));_0x577aa3[_0xf649('0x2e')](getAssociatedResources(_0xf649('0x12'),_0x283147[_0xf649('0x38')],_0xf649('0x32')));_0x577aa3[_0xf649('0x2e')](getAssociatedResources(_0xf649('0x3a'),_0x283147[_0xf649('0x38')],'OpenchannelQueue'));_0x577aa3['push'](getAssociatedResources(_0xf649('0x13'),_0x283147[_0xf649('0x38')],_0xf649('0x34')));_0x577aa3['push'](getAssociatedResources(_0xf649('0x3b'),_0x283147['userProfileId'],_0xf649('0x4')));_0x577aa3[_0xf649('0x2e')](getAssociatedResources(_0xf649('0x15'),_0x283147[_0xf649('0x38')],'Trunk'));_0x577aa3['push'](getAssociatedResources(_0xf649('0x16'),_0x283147[_0xf649('0x38')],_0xf649('0x1a')));_0x577aa3[_0xf649('0x2e')](db[_0xf649('0x4')][_0xf649('0x14')](queryAgents));break;case _0xf649('0x6'):_0xbfb6cc[_0x1e0d54](_0xf649('0x37'));_0xbfb6cc[_0x1e0d54](_0xf649('0x2c'));_0x577aa3[_0xf649('0x2e')](_0x283147['getVoiceQueues']({'attributes':['id',_0xf649('0x3')]}));_0x577aa3['push'](_0x283147[_0xf649('0x3c')]({'attributes':['id',_0xf649('0x3')]}));_0x577aa3[_0xf649('0x2e')](_0x283147[_0xf649('0x3d')]({'attributes':['id',_0xf649('0x3')]}));_0x577aa3[_0xf649('0x2e')](_0x283147[_0xf649('0x3e')]({'attributes':['id','name']}));_0x577aa3[_0xf649('0x2e')](_0x283147[_0xf649('0x3f')]({'attributes':['id',_0xf649('0x3')]}));_0x577aa3[_0xf649('0x2e')](_0x283147[_0xf649('0x40')]({'attributes':['id',_0xf649('0x3')]}));_0x577aa3['push'](_0x283147['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0xf649('0x41')](_0x577aa3);}})[_0xf649('0xc')](function(_0x1ab5cb){if(_0x1ab5cb&&_0x1ab5cb['length']){for(var _0x27a4ff=0x0;_0x27a4ff<_0x1ab5cb[_0xf649('0x1e')];_0x27a4ff+=0x1){for(var _0x1aeab6=0x0;_0x1aeab6<_0x1ab5cb[_0x27a4ff][_0xf649('0x1e')];_0x1aeab6+=0x1){switch(_0x27a4ff){case 0x0:joinOrLeaveQueues(_0xbfb6cc,_0x1e0d54,_0xf649('0x42'),_0x1ab5cb[_0x27a4ff][_0x1aeab6]);break;case 0x1:joinOrLeaveQueues(_0xbfb6cc,_0x1e0d54,_0xf649('0x43'),_0x1ab5cb[_0x27a4ff][_0x1aeab6]);break;case 0x2:joinOrLeaveQueues(_0xbfb6cc,_0x1e0d54,_0xf649('0x44'),_0x1ab5cb[_0x27a4ff][_0x1aeab6]);break;case 0x3:joinOrLeaveQueues(_0xbfb6cc,_0x1e0d54,_0xf649('0x45'),_0x1ab5cb[_0x27a4ff][_0x1aeab6]);break;case 0x4:joinOrLeaveQueues(_0xbfb6cc,_0x1e0d54,_0xf649('0x46'),_0x1ab5cb[_0x27a4ff][_0x1aeab6]);break;case 0x5:joinOrLeaveQueues(_0xbfb6cc,_0x1e0d54,'openchannel',_0x1ab5cb[_0x27a4ff][_0x1aeab6]);break;case 0x6:joinOrLeaveQueues(_0xbfb6cc,_0x1e0d54,'whatsapp',_0x1ab5cb[_0x27a4ff][_0x1aeab6]);break;case 0x7:if(_0xd939e0[_0xf649('0x5')]!==_0xf649('0x6'))_0xbfb6cc[_0x1e0d54](util['format']('telephone:%s',_0x1ab5cb[_0x27a4ff][_0x1aeab6][_0xf649('0x3')]));break;case 0x8:if(_0xd939e0['role']!==_0xf649('0x6'))_0xbfb6cc[_0x1e0d54](util[_0xf649('0x1b')](_0xf649('0x47'),_0x1ab5cb[_0x27a4ff][_0x1aeab6]['name']));break;case 0x9:if(_0xd939e0['role']!=='agent')_0xbfb6cc[_0x1e0d54](util['format'](_0xf649('0x48'),_0x1ab5cb[_0x27a4ff][_0x1aeab6][_0xf649('0x8')],_0x1ab5cb[_0x27a4ff][_0x1aeab6][_0xf649('0x3')]));break;case 0xa:_0xbfb6cc[_0x1e0d54](util['format'](_0xf649('0x2a'),_0x1ab5cb[_0x27a4ff][_0x1aeab6]['name']));break;}}}}})[_0xf649('0xc')](function(){if(_0x1e0d54==='leave'){var _0x5bceec=_[_0xf649('0x49')](_0xd939e0[_0xf649('0x22')],'id');return _0xd939e0[_0xf649('0x4a')](_0x5bceec)['then'](function(){for(var _0x330587=0x0;_0x330587<_0x5bceec['length'];_0x330587+=0x1){_0x3c9fb3[_0xf649('0x4b')](_0xf649('0x4c'),{'ChatInteractionId':Number(_0x5bceec[_0x330587]),'UserId':Number(_0xd939e0['id'])});}});}})['then'](function(){if(_0x1e0d54===_0xf649('0x4d')){var _0x3e7ef8=_[_0xf649('0x49')](_0xd939e0[_0xf649('0x4e')],'id');return _0xd939e0['removeMailInteractions'](_0x3e7ef8)[_0xf649('0xc')](function(){for(var _0x17c3aa=0x0;_0x17c3aa<_0x3e7ef8[_0xf649('0x1e')];_0x17c3aa+=0x1){_0x3c9fb3[_0xf649('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x3e7ef8[_0x17c3aa]),'UserId':Number(_0xd939e0['id'])});}});}})['then'](function(){if(_0x1e0d54===_0xf649('0x4d')){var _0x5c3f23=_['map'](_0xd939e0['FaxInteractions'],'id');return _0xd939e0[_0xf649('0x4f')](_0x5c3f23)['then'](function(){for(var _0x48c94e=0x0;_0x48c94e<_0x5c3f23[_0xf649('0x1e')];_0x48c94e+=0x1){_0x3c9fb3[_0xf649('0x4b')](_0xf649('0x50'),{'FaxInteractionId':Number(_0x5c3f23[_0x48c94e]),'UserId':Number(_0xd939e0['id'])});}});}})[_0xf649('0xc')](function(){if(_0x1e0d54===_0xf649('0x4d')){var _0x4648e4=_['map'](_0xd939e0[_0xf649('0x25')],'id');return _0xd939e0[_0xf649('0x51')](_0x4648e4)[_0xf649('0xc')](function(){for(var _0x46f0c8=0x0;_0x46f0c8<_0x4648e4[_0xf649('0x1e')];_0x46f0c8+=0x1){_0x3c9fb3[_0xf649('0x4b')](_0xf649('0x52'),{'SmsInteractionId':Number(_0x4648e4[_0x46f0c8]),'UserId':Number(_0xd939e0['id'])});}});}})[_0xf649('0xc')](function(){if(_0x1e0d54==='leave'){var _0x4be1b8=_['map'](_0xd939e0[_0xf649('0x27')],'id');return _0xd939e0[_0xf649('0x53')](_0x4be1b8)['then'](function(){for(var _0x1a9929=0x0;_0x1a9929<_0x4be1b8[_0xf649('0x1e')];_0x1a9929+=0x1){_0x3c9fb3[_0xf649('0x4b')](_0xf649('0x54'),{'OpenchannelInteractionId':Number(_0x4be1b8[_0x1a9929]),'UserId':Number(_0xd939e0['id'])});}});}})[_0xf649('0xc')](function(){if(_0x1e0d54===_0xf649('0x4d')){var _0x1d7fd6=_[_0xf649('0x49')](_0xd939e0[_0xf649('0x29')],'id');return _0xd939e0['removeWhatsappInteractions'](_0x1d7fd6)[_0xf649('0xc')](function(){for(var _0x365676=0x0;_0x365676<_0x1d7fd6[_0xf649('0x1e')];_0x365676+=0x1){_0x3c9fb3[_0xf649('0x4b')](_0xf649('0x55'),{'WhatsappInteractionId':Number(_0x1d7fd6[_0x365676]),'UserId':Number(_0xd939e0['id'])});}});}})[_0xf649('0x56')](function(_0xad62a7){_0xbfb6cc[_0xf649('0x57')](_0xad62a7);});}}function onDisconnect(_0x503d4e,_0x32ab1e){joinOrLeave(_0x503d4e,'leave',_0x32ab1e);}function onConnect(_0x3b7586){joinOrLeave(_0x3b7586,_0xf649('0x58'));}exports[_0xf649('0x59')]=function(_0xba9157){_0xba9157['on'](_0xf649('0x5a'),function(_0x5eaaf4){_0x5eaaf4[_0xf649('0x5b')](0x0);_0x5eaaf4[_0xf649('0x5c')]=_0x5eaaf4[_0xf649('0x5d')][_0xf649('0x5a')][_0xf649('0x5e')]+':'+_0x5eaaf4['request'][_0xf649('0x5a')][_0xf649('0x5f')];_0x5eaaf4['connectedAt']=new Date();_0x5eaaf4[_0xf649('0x57')]=function(_0x1b29f5){console['log'](_0xf649('0x60')+_0x5eaaf4[_0xf649('0x61')][_0xf649('0x3')]+'['+_0x5eaaf4[_0xf649('0x5c')]+']',_0x1b29f5);};_0x5eaaf4['on']('disconnect',function(){onDisconnect(_0x5eaaf4,_0xba9157);_0x5eaaf4[_0xf649('0x57')](_0xf649('0x62'));});onConnect(_0x5eaaf4);_0x5eaaf4['log'](_0xf649('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 5034475..9a1f926 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 _0xa6bc=['catch','AfterCreateMessage','event','offlineMessage','undefined','AfterCreate','changed','closed','substatus','User','find','fullname','internal','default','length','model','callback','toLowerCase','condition','util','../../mysqldb','../logger','triggers','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','WhatsappInteraction','closedinteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','get','channel','motionChannel','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage'];(function(_0x1bb39f,_0x5d029f){var _0x4fd5c9=function(_0x125805){while(--_0x125805){_0x1bb39f['push'](_0x1bb39f['shift']());}};_0x4fd5c9(++_0x5d029f);}(_0xa6bc,0xf7));var _0xca6b=function(_0x5124d2,_0x3400cb){_0x5124d2=_0x5124d2-0x0;var _0x361478=_0xa6bc[_0x5124d2];return _0x361478;};'use strict';var util=require(_0xca6b('0x0'));var db=require(_0xca6b('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0xca6b('0x2'))(_0xca6b('0x3'));var client=jayson[_0xca6b('0x4')][_0xca6b('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xca6b('0x6'),'event':_0xca6b('0x7'),'condition':_0xca6b('0x8'),'callback':afterCreate},{'channel':_0xca6b('0x9'),'model':_0xca6b('0x6'),'event':_0xca6b('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xca6b('0x9'),'model':_0xca6b('0xb'),'event':_0xca6b('0x7'),'condition':_0xca6b('0xc'),'callback':afterCreateMessage},{'channel':_0xca6b('0x9'),'model':_0xca6b('0xd'),'event':_0xca6b('0x7'),'condition':_0xca6b('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0xca6b('0xe'),'model':_0xca6b('0xf'),'event':_0xca6b('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xca6b('0xe'),'model':'SmsInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0xca6b('0x10'),'event':'afterCreate','condition':_0xca6b('0xc'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xca6b('0x11'),'event':_0xca6b('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':'afterUpdate','condition':_0xca6b('0x12'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xca6b('0x13'),'event':_0xca6b('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xca6b('0x14'),'model':_0xca6b('0x15'),'event':_0xca6b('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xca6b('0x14'),'model':_0xca6b('0x15'),'event':_0xca6b('0xa'),'condition':_0xca6b('0x12'),'callback':afterUpdate},{'channel':_0xca6b('0x14'),'model':_0xca6b('0x16'),'event':_0xca6b('0x7'),'condition':_0xca6b('0xc'),'callback':afterCreateMessage},{'channel':'Mail','model':_0xca6b('0x17'),'event':_0xca6b('0x7'),'condition':_0xca6b('0x8'),'callback':afterCreate},{'channel':_0xca6b('0x18'),'model':_0xca6b('0x17'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xca6b('0x18'),'model':_0xca6b('0x19'),'event':'afterCreate','condition':_0xca6b('0xc'),'callback':afterCreateMessage},{'channel':_0xca6b('0x1a'),'model':'OpenchannelInteraction','event':_0xca6b('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xca6b('0x1a'),'model':_0xca6b('0x1b'),'event':_0xca6b('0xa'),'condition':_0xca6b('0x12'),'callback':afterUpdate},{'channel':_0xca6b('0x1a'),'model':_0xca6b('0x1c'),'event':'afterCreate','condition':_0xca6b('0xc'),'callback':afterCreateMessage}];function request(_0x4f1572){return client[_0xca6b('0x1d')](_0xca6b('0x1e'),_0x4f1572)[_0xca6b('0x1f')](function(_0x3a988d){logger[_0xca6b('0x20')](_0xca6b('0x21'),_0xca6b('0x1e'),_0x3a988d);if(_0x3a988d[_0xca6b('0x22')]){if(_0x3a988d[_0xca6b('0x22')][_0xca6b('0x23')]===0x1f4){logger['error']('Trigger,\x20%s',_0xca6b('0x1e'),_0x3a988d[_0xca6b('0x22')]);}}})['catch'](function(_0x600279){logger[_0xca6b('0x22')](_0xca6b('0x21'),_0xca6b('0x1e'),_0x600279);});}function afterCreateMessage(_0x46fd55){return function(_0x4c5ad0){_0x4c5ad0=_0x4c5ad0[_0xca6b('0x24')]({'plain':!![]});_0x4c5ad0[_0xca6b('0x25')]=_0x46fd55;_0x4c5ad0[_0xca6b('0x26')]=_0x46fd55;_0x4c5ad0['event']=_0x4c5ad0[_0xca6b('0x27')];Promise[_0xca6b('0x28')]()[_0xca6b('0x1f')](function(){if(typeof _0x4c5ad0[_0xca6b('0x29')]==='undefined')return null;var _0x40dcaa=_0xca6b('0x2a')+_0x4c5ad0[_0xca6b('0x29')];return db[_0xca6b('0x2b')][_0xca6b('0x2c')](_0x40dcaa,{'type':db[_0xca6b('0x2d')][_0xca6b('0x2e')][_0xca6b('0x2f')],'raw':!![]});})['then'](function(_0x56cafe){if(_0x56cafe){_0x4c5ad0[_0xca6b('0x30')]=_0x56cafe[0x0];}if(typeof _0x4c5ad0[_0xca6b('0x31')]==='undefined')return;return getAgent(_0x4c5ad0[_0xca6b('0x31')]);})[_0xca6b('0x1f')](function(_0x493422){if(_0x493422){_0x4c5ad0[_0xca6b('0x32')]=util[_0xca6b('0x33')](_0xca6b('0x34'),_0x493422[_0xca6b('0x35')]);_0x4c5ad0[_0xca6b('0x36')]=_0x493422;_0x4c5ad0['channel']=_0x46fd55;return request({'event':_0xca6b('0x37'),'message':_0x4c5ad0});}else{return request({'event':_0xca6b('0x38'),'message':_0x4c5ad0});}})[_0xca6b('0x39')](function(_0x49f31a){logger[_0xca6b('0x22')](_0xca6b('0x21'),_0xca6b('0x3a'),_0x49f31a);});};}function afterCreateOfflineMessage(_0x677e04){return function(_0x49d500){_0x49d500=_0x49d500['get']({'plain':!![]});_0x49d500[_0xca6b('0x25')]=_0x677e04;_0x49d500[_0xca6b('0x26')]=_0x677e04;_0x49d500[_0xca6b('0x3b')]=_0xca6b('0x3c');return request({'event':_0x49d500['event'],'message':_0x49d500});};}function afterCreate(_0x3cbc2b,_0x1758a3){return function(_0x47b79d){_0x47b79d=_0x47b79d[_0xca6b('0x24')]({'plain':!![]});_0x47b79d['channel']=_0x3cbc2b;_0x47b79d[_0xca6b('0x26')]=_0x3cbc2b;_0x47b79d['event']='opened';Promise['resolve']()[_0xca6b('0x1f')](function(){var _0x4ea586=_0xca6b('0x2a')+_0x47b79d[_0xca6b('0x29')];return db[_0xca6b('0x2b')][_0xca6b('0x2c')](_0x4ea586,{'type':db[_0xca6b('0x2d')][_0xca6b('0x2e')][_0xca6b('0x2f')],'raw':!![]});})[_0xca6b('0x1f')](function(_0x4bdbd){if(_0x4bdbd){_0x47b79d[_0xca6b('0x30')]=_0x4bdbd[0x0];}if(typeof _0x47b79d[_0xca6b('0x31')]===_0xca6b('0x3d'))return;return getAgent(_0x47b79d[_0xca6b('0x31')]);})[_0xca6b('0x1f')](function(_0x58333e){if(_0x58333e){_0x47b79d[_0xca6b('0x32')]=util[_0xca6b('0x33')]('SIP/%s',_0x58333e[_0xca6b('0x35')]);_0x47b79d['agent']=_0x58333e;}return request({'event':_0x1758a3,'message':_0x47b79d});})[_0xca6b('0x39')](function(_0x44e2cd){logger[_0xca6b('0x22')](_0xca6b('0x21'),_0xca6b('0x3e'),_0x44e2cd);});};}function afterUpdate(_0x51f20b){return function(_0x46fb53){var _0x58fa61=_0x46fb53[_0xca6b('0x3f')]('closed')&&_0x46fb53[_0xca6b('0x40')];var _0x4b664f=_0x46fb53[_0xca6b('0x3f')](_0xca6b('0x41'));if(_0x58fa61||_0x4b664f){var _0xe0d6fc=_0x58fa61?'closedinteraction':'substatus';var _0x16a334=_0x46fb53[_0xca6b('0x24')]({'plain':!![]});_0x16a334['channel']=_0x51f20b;_0x16a334[_0xca6b('0x26')]=_0x51f20b;_0x16a334[_0xca6b('0x3b')]=_0x58fa61?_0xca6b('0x40'):_0xca6b('0x41');var _0x33d44f=_0xca6b('0x2a')+_0x16a334[_0xca6b('0x29')];return db[_0xca6b('0x2b')][_0xca6b('0x2c')](_0x33d44f,{'type':db['Sequelize'][_0xca6b('0x2e')]['SELECT'],'raw':!![]})['then'](function(_0x3cc334){if(_0x3cc334){_0x16a334[_0xca6b('0x30')]=_0x3cc334[0x0];}if(typeof _0x16a334[_0xca6b('0x31')]===_0xca6b('0x3d'))return;return getAgent(_0x16a334[_0xca6b('0x31')]);})['then'](function(_0x334272){if(_0x334272){_0x16a334[_0xca6b('0x32')]=util[_0xca6b('0x33')](_0xca6b('0x34'),_0x334272[_0xca6b('0x35')]);_0x16a334[_0xca6b('0x36')]=_0x334272;}return request({'event':_0xe0d6fc,'message':_0x16a334});})[_0xca6b('0x39')](function(_0x20b4d7){logger['error']('Trigger,\x20%s','AfterUpdate',_0x20b4d7);});}};}function getAgent(_0x376c5d){return db[_0xca6b('0x42')][_0xca6b('0x43')]({'where':{'id':_0x376c5d},'attributes':['id',_0xca6b('0x35'),_0xca6b('0x44'),'email',_0xca6b('0x45')],'raw':!![]})[_0xca6b('0x1f')](function(_0x318d6b){return _0x318d6b;});}exports[_0xca6b('0x46')]=function(){for(var _0x4f8ce0=0x0;_0x4f8ce0=_0x28455c['agents']){throw Error(_0xb0a7('0x11'));}_0x1402b5(_0x4eaea5);})[_0xb0a7('0x12')](function(_0x319d1b){_0x25a063(_0x319d1b);});});}; \ No newline at end of file +var _0xfb06=['getLicense','role','agent','User','count','then','agents','lodash','./license/util','voice','mail','fax','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes'];(function(_0x12a95e,_0xbba64d){var _0x14c285=function(_0x517a87){while(--_0x517a87){_0x12a95e['push'](_0x12a95e['shift']());}};_0x14c285(++_0xbba64d);}(_0xfb06,0x10f));var _0x6fb0=function(_0x35e124,_0x1d85e2){_0x35e124=_0x35e124-0x0;var _0x53c482=_0xfb06[_0x35e124];return _0x53c482;};'use strict';var _=require(_0x6fb0('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0x6fb0('0x1'));var channels=[_0x6fb0('0x2'),_0x6fb0('0x3'),'chat',_0x6fb0('0x4'),'sms',_0x6fb0('0x5'),_0x6fb0('0x6')];exports[_0x6fb0('0x7')]=function(){return channels;};exports[_0x6fb0('0x8')]=function(_0x46d5e7){_0x46d5e7=_0x46d5e7[_0x6fb0('0x9')]();return _[_0x6fb0('0xa')](channels,_0x46d5e7);};exports[_0x6fb0('0xb')]=function(_0x57859a,_0x50af0e,_0x36409d,_0x4f9f26){var _0x4691b2={'loginAttempts':_0x50af0e,'blocked':_0x36409d};if(!_[_0x6fb0('0xc')](_0x4f9f26)){_0x4691b2[_0x6fb0('0xd')]=_0x4f9f26;}return _0x57859a[_0x6fb0('0xe')](_0x4691b2);};exports[_0x6fb0('0xf')]=function(_0x5c5f35){return new BPromise(function(_0x5dab9b,_0x4796dd){var _0x4cb6b6=0x0;if(_0x5c5f35[_0x6fb0('0x10')]!==_0x6fb0('0x11')){_0x5dab9b(_0x5c5f35);}db[_0x6fb0('0x12')][_0x6fb0('0x13')]({'where':{'role':_0x6fb0('0x11'),'online':!![],'id':{'$ne':_0x5c5f35['id']}}})[_0x6fb0('0x14')](function(_0x304d63){_0x4cb6b6=_0x304d63;return util['getLicense']();})['then'](function(_0x3e87c5){if(_0x3e87c5&&_0x3e87c5['agents']&&_0x4cb6b6>=_0x3e87c5[_0x6fb0('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x5dab9b(_0x5c5f35);})['catch'](function(_0x10ff8a){_0x4796dd(_0x10ff8a);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 8f0c4d7..81be92c 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cec=['Not\x20Found','code','details','OutOfInterval','Resource\x20Conflict','Out\x20Of\x20Interval','Conflict','stack','statusMessage','send','exports','util','../config/logger','api','Error','inherits','message','Bad\x20Request','name','Forbidden','Entity\x20not\x20found'];(function(_0x1e4902,_0x466737){var _0x39bacb=function(_0x497325){while(--_0x497325){_0x1e4902['push'](_0x1e4902['shift']());}};_0x39bacb(++_0x466737);}(_0x6cec,0x74));var _0xc6ce=function(_0x1ae8ab,_0x6e5c2a){_0x1ae8ab=_0x1ae8ab-0x0;var _0x1ad705=_0x6cec[_0x1ae8ab];return _0x1ad705;};'use strict';var util=require(_0xc6ce('0x0'));var logger=require(_0xc6ce('0x1'))(_0xc6ce('0x2'));var APIError=function(_0x3fb578,_0x144a1f){this['message']=_0x3fb578||'Internal\x20Server\x20Error';this['name']=_0x144a1f||_0xc6ce('0x3');util[_0xc6ce('0x4')](APIError,Error);};var APIBadRequestError=function(_0x4252dc){this[_0xc6ce('0x5')]=_0x4252dc||_0xc6ce('0x6');this[_0xc6ce('0x7')]='Bad\x20Request';util['inherits'](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x2570a7){this[_0xc6ce('0x5')]=_0x2570a7||_0xc6ce('0x8');this[_0xc6ce('0x7')]='Forbidden';util[_0xc6ce('0x4')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x2f6131){this[_0xc6ce('0x5')]=_0x2f6131||_0xc6ce('0x9');this[_0xc6ce('0x7')]=_0xc6ce('0xa');util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x5ac4c8){this['message']=_0x5ac4c8||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0xc6ce('0x7')]='Out\x20Of\x20Interval';this[_0xc6ce('0xb')]=0x193;this[_0xc6ce('0xc')]={'type':_0xc6ce('0xd')};util[_0xc6ce('0x4')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0xc9994){this[_0xc6ce('0x5')]=_0xc9994||_0xc6ce('0xe');this[_0xc6ce('0x7')]='Conflict';util[_0xc6ce('0x4')](APIBadRequestError,APIError);};function getStatusCode(_0x5ad25e){switch(_0x5ad25e){case _0xc6ce('0x6'):return 0x190;case _0xc6ce('0x8'),_0xc6ce('0xf'):return 0x193;case _0xc6ce('0xa'):return 0x194;case _0xc6ce('0x10'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x15dc60){if(_0x15dc60===_0xc6ce('0xf'))return _0x15dc60;return null;}function handleError(_0x2ad063){return function(_0x487b25){logger['error'](_0x487b25[_0xc6ce('0x11')]);var _0x4f4cfd=getStatusCode(_0x487b25[_0xc6ce('0x7')]);var _0x5178c0=getCustomStatusMessage(_0x487b25[_0xc6ce('0x7')]);if(_0x487b25[_0xc6ce('0x7')]){delete _0x487b25[_0xc6ce('0x7')];}if(_0x5178c0){_0x2ad063[_0xc6ce('0x12')]=_0x5178c0;}return _0x2ad063['status'](_0x4f4cfd)[_0xc6ce('0x13')](_0x487b25);};}module[_0xc6ce('0x14')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0xb1f4=['stack','statusMessage','status','util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Forbidden','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval','Resource\x20Conflict','Conflict','error'];(function(_0x33d581,_0x2da6d0){var _0x3320da=function(_0x17d76a){while(--_0x17d76a){_0x33d581['push'](_0x33d581['shift']());}};_0x3320da(++_0x2da6d0);}(_0xb1f4,0x1a5));var _0x4b1f=function(_0x12f8de,_0x4a61ea){_0x12f8de=_0x12f8de-0x0;var _0x549800=_0xb1f4[_0x12f8de];return _0x549800;};'use strict';var util=require(_0x4b1f('0x0'));var logger=require(_0x4b1f('0x1'))(_0x4b1f('0x2'));var APIError=function(_0x2143ff,_0x140c44){this[_0x4b1f('0x3')]=_0x2143ff||_0x4b1f('0x4');this[_0x4b1f('0x5')]=_0x140c44||_0x4b1f('0x6');util[_0x4b1f('0x7')](APIError,Error);};var APIBadRequestError=function(_0x4d3d19){this['message']=_0x4d3d19||_0x4b1f('0x8');this[_0x4b1f('0x5')]='Bad\x20Request';util[_0x4b1f('0x7')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x5932f3){this[_0x4b1f('0x3')]=_0x5932f3||_0x4b1f('0x9');this[_0x4b1f('0x5')]=_0x4b1f('0x9');util[_0x4b1f('0x7')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x4ffc67){this['message']=_0x4ffc67||'Entity\x20not\x20found';this[_0x4b1f('0x5')]=_0x4b1f('0xa');util[_0x4b1f('0x7')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x42258b){this['message']=_0x42258b||_0x4b1f('0xb');this[_0x4b1f('0x5')]=_0x4b1f('0xc');this[_0x4b1f('0xd')]=0x193;this[_0x4b1f('0xe')]={'type':_0x4b1f('0xf')};util[_0x4b1f('0x7')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x2b3f63){this[_0x4b1f('0x3')]=_0x2b3f63||_0x4b1f('0x10');this[_0x4b1f('0x5')]=_0x4b1f('0x11');util['inherits'](APIBadRequestError,APIError);};function getStatusCode(_0x4f5a1d){switch(_0x4f5a1d){case _0x4b1f('0x8'):return 0x190;case _0x4b1f('0x9'),_0x4b1f('0xc'):return 0x193;case _0x4b1f('0xa'):return 0x194;case _0x4b1f('0x11'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x1faa07){if(_0x1faa07===_0x4b1f('0xc'))return _0x1faa07;return null;}function handleError(_0x2e607d){return function(_0x23bd2b){logger[_0x4b1f('0x12')](_0x23bd2b[_0x4b1f('0x13')]);var _0x4eeaf4=getStatusCode(_0x23bd2b[_0x4b1f('0x5')]);var _0x341324=getCustomStatusMessage(_0x23bd2b[_0x4b1f('0x5')]);if(_0x23bd2b['name']){delete _0x23bd2b['name'];}if(_0x341324){_0x2e607d[_0x4b1f('0x14')]=_0x341324;}return _0x2e607d[_0x4b1f('0x15')](_0x4eeaf4)['send'](_0x23bd2b);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 5bf2ee0..5dd5f48 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae75=['404','status','render','send','exports'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xae75,0x1a8));var _0x5ae7=function(_0x42f10e,_0x259c2f){_0x42f10e=_0x42f10e-0x0;var _0x5d38ed=_0xae75[_0x42f10e];return _0x5d38ed;};'use strict';module[_0x5ae7('0x0')][0x194]=function pageNotFound(_0x1dc987,_0x13ef15){var _0x4c2f8c=_0x5ae7('0x1');var _0x241206=0x194;var _0x2fdd1a={'status':_0x241206};_0x13ef15[_0x5ae7('0x2')](_0x2fdd1a[_0x5ae7('0x2')]);_0x13ef15[_0x5ae7('0x3')](_0x4c2f8c,{},function(_0x37b363,_0x50ffc0){if(_0x37b363){return _0x13ef15[_0x5ae7('0x2')](_0x2fdd1a[_0x5ae7('0x2')])['json'](_0x2fdd1a);}_0x13ef15[_0x5ae7('0x4')](_0x50ffc0);});}; \ No newline at end of file +var _0x9101=['exports','404','status','json'];(function(_0x11ef88,_0x5b0812){var _0x1c67f2=function(_0x4900e1){while(--_0x4900e1){_0x11ef88['push'](_0x11ef88['shift']());}};_0x1c67f2(++_0x5b0812);}(_0x9101,0x9c));var _0x1910=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x9101[_0x4b7895];return _0x264180;};'use strict';module[_0x1910('0x0')][0x194]=function pageNotFound(_0x3613bb,_0x4c7a51){var _0x41582a=_0x1910('0x1');var _0x2959a6=0x194;var _0x5e007d={'status':_0x2959a6};_0x4c7a51['status'](_0x5e007d[_0x1910('0x2')]);_0x4c7a51['render'](_0x41582a,{},function(_0x1c7b09,_0x34c7a8){if(_0x1c7b09){return _0x4c7a51[_0x1910('0x2')](_0x5e007d[_0x1910('0x2')])[_0x1910('0x3')](_0x5e007d);}_0x4c7a51['send'](_0x34c7a8);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 8030198..3307fc2 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0183=['User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceMusicOnHold','VoiceQueue','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','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','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../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','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','UserId','userSetting','cascade','hasMany','VoiceExtension','Extensions','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','Hoppers','SET\x20NULL','belongsTo','userProfileId','Groups','belongsToMany','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','ChatWebsite','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','VoiceQueueId','HopperHistories','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','CmContact','ContactId','MailServerIn','MailAccountId','CloudProviderId','restrict','MailServerOut','Smtp','Dispositions','Interactions','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','Items','FaxAccountId','Exntensions','FaxApplication','FaxInteractionId','fax_interaction_has_tags','Answers','SmsAccountId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessage','ChatInternalMessage','ChatGroupId','Members','chat_group_has_users','CompanyId','Phones','CmContactId','cm_contact_has_tags','AdditionalPhones','CampaignId','OwnerId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmHopperId','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','SalesforceField','Subjects','SubjectId','DescriptionId','AccountId','FieldId','VariableId','SugarcrmConfiguration','Subject','Description','DeskAccount','DeskField','Descriptions','int_desk_configuration_has_tags','Field','ZendeskAccount','VtigerConfiguration','VtigerField','Dynamics365Field','FreshsalesAccount','FromId','ToId','JscriptyAnswerReport','SessionId','ProjectId','TeamVoiceQueue','team_has_chat_queues','team_has_fax_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToQueue','ToAccount','FaxTransferReport','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','CustomFields','HopperHistory','Queues','TeamVoicePrefix','UserProfileSection','UserProfileSections','Resources','WhatsappAccountId','user_has_whatsapp_accounts','user_has_whatsapp_interactions','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','exports','sequelize','lodash','jstz','determine','motion2','xcall','127.0.0.1','mysql','utf8mb4','utf8_general_ci','defaultsDeep','sequelizeHistory','xC@LL1234','name','utf8','username','password','database','options'];(function(_0x1b90a6,_0x3815ea){var _0x290cd2=function(_0x4579f2){while(--_0x4579f2){_0x1b90a6['push'](_0x1b90a6['shift']());}};_0x290cd2(++_0x3815ea);}(_0x0183,0x1ef));var _0x3018=function(_0x19635f,_0x564859){_0x19635f=_0x19635f-0x0;var _0x482132=_0x0183[_0x19635f];return _0x482132;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x3018('0x0'));var _=require(_0x3018('0x1'));var jstz=require(_0x3018('0x2'));var timezone=jstz[_0x3018('0x3')]();config[_0x3018('0x0')]=_['defaultsDeep'](config[_0x3018('0x0')],{'database':_0x3018('0x4'),'username':_0x3018('0x5'),'password':'xC@LL1234','options':{'host':_0x3018('0x6'),'port':0xcea,'dialect':_0x3018('0x7'),'dialectOptions':{'charset':_0x3018('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x3018('0x9')}}});config['sequelizeHistory']=_[_0x3018('0xa')](config[_0x3018('0xb')],{'database':_0x3018('0x4'),'username':'xcall','password':_0x3018('0xc'),'options':{'host':_0x3018('0x6'),'port':0xcea,'dialect':_0x3018('0x7'),'dialectOptions':{'charset':_0x3018('0x8')},'logging':![],'timezone':timezone[_0x3018('0xd')](),'define':{'charset':_0x3018('0xe'),'collate':_0x3018('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3018('0x0')]['database'],config[_0x3018('0x0')][_0x3018('0xf')],config['sequelize'][_0x3018('0x10')],config[_0x3018('0x0')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x3018('0x11')],config[_0x3018('0xb')][_0x3018('0xf')],config['sequelizeHistory'][_0x3018('0x10')],config[_0x3018('0xb')][_0x3018('0x12')])};db[_0x3018('0x13')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x15'));db[_0x3018('0x16')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x17'));db[_0x3018('0x18')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x19'));db['VoiceExtension']=db[_0x3018('0x0')][_0x3018('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0x3018('0x1a')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x3018('0x1b')]=db[_0x3018('0x0')]['import']('../api/voiceQueue/voiceQueue.model');db[_0x3018('0x1c')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0x3018('0x1d')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x1e'));db[_0x3018('0x1f')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x20'));db[_0x3018('0x21')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x3018('0x22')]=db[_0x3018('0x0')]['import'](_0x3018('0x23'));db['VoiceDialReport']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x24'));db[_0x3018('0x25')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x26'));db[_0x3018('0x27')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x28'));db[_0x3018('0x29')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x2a'));db[_0x3018('0x2b')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x2c'));db[_0x3018('0x2d')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x3018('0x2e')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x3018('0x2f')]=db[_0x3018('0x0')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x3018('0x30')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0x3018('0x31')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x32'));db[_0x3018('0x33')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x34'));db[_0x3018('0x35')]=db[_0x3018('0x0')]['import'](_0x3018('0x36'));db['UserOpenchannelQueue']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x37'));db[_0x3018('0x38')]=db[_0x3018('0x0')]['import'](_0x3018('0x39'));db['MailServerIn']=db[_0x3018('0x0')]['import']('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x3018('0x0')]['import'](_0x3018('0x3a'));db[_0x3018('0x3b')]=db['sequelize']['import'](_0x3018('0x3c'));db[_0x3018('0x3d')]=db[_0x3018('0x0')]['import'](_0x3018('0x3e'));db[_0x3018('0x3f')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0x3018('0x40')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x41'));db[_0x3018('0x42')]=db['sequelize']['import'](_0x3018('0x43'));db[_0x3018('0x44')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/mailApplication/mailApplication.model');db[_0x3018('0x45')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x46'));db[_0x3018('0x47')]=db['sequelize'][_0x3018('0x14')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x3018('0x0')]['import'](_0x3018('0x48'));db[_0x3018('0x49')]=db[_0x3018('0x0')]['import'](_0x3018('0x4a'));db['FaxApplication']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x4b'));db[_0x3018('0x4c')]=db[_0x3018('0x0')]['import'](_0x3018('0x4d'));db[_0x3018('0x4e')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/faxMessage/faxMessage.model');db[_0x3018('0x4f')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/faxQueue/faxQueue.model');db[_0x3018('0x50')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x51'));db[_0x3018('0x52')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/smsAccount/smsAccount.model');db[_0x3018('0x53')]=db[_0x3018('0x0')]['import'](_0x3018('0x54'));db[_0x3018('0x55')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x56'));db[_0x3018('0x57')]=db[_0x3018('0x0')]['import']('../api/smsMessage/smsMessage.model');db[_0x3018('0x58')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x59'));db[_0x3018('0x5a')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x5b'));db[_0x3018('0x5c')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0x3018('0x5d')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x5e'));db['OpenchannelMessage']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x5f'));db[_0x3018('0x60')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x61'));db['ChatWebsite']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x62'));db['OpenchannelQueueReport']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x63'));db['ChatApplication']=db[_0x3018('0x0')][_0x3018('0x14')]('../api/chatApplication/chatApplication.model');db[_0x3018('0x64')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x65'));db[_0x3018('0x66')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x3018('0x0')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x3018('0x0')]['import'](_0x3018('0x67'));db[_0x3018('0x68')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x69'));db[_0x3018('0x6a')]=db['sequelize']['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0x3018('0x6b')]=db['sequelize'][_0x3018('0x14')]('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x6c'));db[_0x3018('0x6d')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x6e'));db[_0x3018('0x6f')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x70'));db[_0x3018('0x71')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x72'));db[_0x3018('0x73')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x74'));db[_0x3018('0x75')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x76'));db['CmCustomField']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x77'));db[_0x3018('0x78')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x79'));db[_0x3018('0x7a')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x7b'));db[_0x3018('0x7c')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/cannedAnswer/cannedAnswer.model');db[_0x3018('0x7d')]=db[_0x3018('0x0')]['import'](_0x3018('0x7e'));db[_0x3018('0x7f')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x80'));db['Interval']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x81'));db[_0x3018('0x82')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/pause/pause.model');db[_0x3018('0x83')]=db[_0x3018('0x0')]['import']('../api/cdr/cdr.model');db[_0x3018('0x84')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x3018('0x85')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x86'));db['Sound']=db[_0x3018('0x0')][_0x3018('0x14')]('../api/sound/sound.model');db[_0x3018('0x87')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x88'));db[_0x3018('0x89')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x8a'));db[_0x3018('0x8b')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x8c'));db[_0x3018('0x8d')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x3018('0x8e')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x8f'));db['Trigger']=db[_0x3018('0x0')][_0x3018('0x14')]('../api/trigger/trigger.model');db[_0x3018('0x90')]=db[_0x3018('0x0')]['import'](_0x3018('0x91'));db[_0x3018('0x92')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x93'));db[_0x3018('0x94')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x95'));db[_0x3018('0x96')]=db[_0x3018('0x0')]['import'](_0x3018('0x97'));db[_0x3018('0x98')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db['sequelize']['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x3018('0x99')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x9a'));db['AnalyticFieldReport']=db['sequelize'][_0x3018('0x14')](_0x3018('0x9b'));db['AnalyticTreeReport']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x9c'));db[_0x3018('0x9d')]=db['sequelize'][_0x3018('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x3018('0x9e')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x9f'));db['SalesforceField']=db['sequelize'][_0x3018('0x14')](_0x3018('0xa0'));db[_0x3018('0xa1')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xa2'));db['SugarcrmConfiguration']=db[_0x3018('0x0')]['import'](_0x3018('0xa3'));db[_0x3018('0xa4')]=db[_0x3018('0x0')]['import'](_0x3018('0xa5'));db['DeskAccount']=db[_0x3018('0x0')]['import'](_0x3018('0xa6'));db[_0x3018('0xa7')]=db[_0x3018('0x0')]['import'](_0x3018('0xa8'));db['DeskField']=db['sequelize'][_0x3018('0x14')](_0x3018('0xa9'));db[_0x3018('0xaa')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xab'));db[_0x3018('0xac')]=db['sequelize']['import'](_0x3018('0xad'));db[_0x3018('0xae')]=db['sequelize'][_0x3018('0x14')](_0x3018('0xaf'));db['ZendeskAccount']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xb0'));db[_0x3018('0xb1')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x3018('0xb2')]=db[_0x3018('0x0')]['import'](_0x3018('0xb3'));db[_0x3018('0xb4')]=db[_0x3018('0x0')]['import'](_0x3018('0xb5'));db[_0x3018('0xb6')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x3018('0xb7')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xb8'));db[_0x3018('0xb9')]=db['sequelize']['import'](_0x3018('0xba'));db['VtigerConfiguration']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xbb'));db['VtigerField']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xbc'));db[_0x3018('0xbd')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xbe'));db[_0x3018('0xbf')]=db['sequelize']['import'](_0x3018('0xc0'));db[_0x3018('0xc1')]=db['sequelize'][_0x3018('0x14')](_0x3018('0xc2'));db[_0x3018('0xc3')]=db[_0x3018('0x0')]['import'](_0x3018('0xc4'));db[_0x3018('0xc5')]=db[_0x3018('0x0')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db['sequelize'][_0x3018('0x14')](_0x3018('0xc6'));db['FreshsalesAccount']=db[_0x3018('0x0')]['import'](_0x3018('0xc7'));db[_0x3018('0xc8')]=db['sequelize'][_0x3018('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x3018('0xc9')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xca'));db[_0x3018('0x92')]=db[_0x3018('0x0')]['import']('../api/integration/integration.model');db['Network']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xcb'));db[_0x3018('0xcc')]=db['sequelize'][_0x3018('0x14')](_0x3018('0xcd'));db['ChatInternalMessage']=db[_0x3018('0x0')]['import'](_0x3018('0xce'));db['JscriptyAnswerReport']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xcf'));db[_0x3018('0xd0')]=db['sequelize'][_0x3018('0x14')](_0x3018('0xd1'));db[_0x3018('0xd2')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xd3'));db[_0x3018('0xd4')]=db[_0x3018('0x0')]['import'](_0x3018('0xd5'));db[_0x3018('0xd6')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xd7'));db[_0x3018('0xd8')]=db['sequelize'][_0x3018('0x14')](_0x3018('0xd9'));db[_0x3018('0xda')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xdb'));db['Setting']=db[_0x3018('0x0')]['import']('../api/setting/setting.model');db[_0x3018('0xdc')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xdd'));db[_0x3018('0xde')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/squareProject/squareProject.model');db[_0x3018('0xdf')]=db['sequelize']['import'](_0x3018('0xe0'));db[_0x3018('0xe1')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xe2'));db[_0x3018('0xe3')]=db['sequelize'][_0x3018('0x14')]('../api/team/team.model');db['License']=db['sequelize'][_0x3018('0x14')]('../api/license/license.model');db[_0x3018('0xe4')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xe5'));db[_0x3018('0xe6')]=db['sequelize']['import'](_0x3018('0xe7'));db[_0x3018('0xe8')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/attachment/attachment.model');db[_0x3018('0xe9')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xea'));db[_0x3018('0xeb')]=db[_0x3018('0x0')]['import'](_0x3018('0xec'));db['ChatTransferReport']=db[_0x3018('0x0')]['import']('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0x3018('0x0')]['import'](_0x3018('0xed'));db['OpenchannelTransferReport']=db[_0x3018('0x0')][_0x3018('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x3018('0xee')]=db['sequelize'][_0x3018('0x14')](_0x3018('0xef'));db[_0x3018('0xf0')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xf1'));db[_0x3018('0xf2')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xf3'));db[_0x3018('0xf4')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xf5'));db['UserProfileSection']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xf6'));db[_0x3018('0xf7')]=db['sequelize'][_0x3018('0x14')](_0x3018('0xf8'));db[_0x3018('0xf9')]=db['sequelize'][_0x3018('0x14')](_0x3018('0xfa'));db[_0x3018('0xfb')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xfc'));db[_0x3018('0xfd')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0xfe'));db['WhatsappInteraction']=db[_0x3018('0x0')]['import'](_0x3018('0xff'));db[_0x3018('0x100')]=db[_0x3018('0x0')]['import'](_0x3018('0x101'));db[_0x3018('0x102')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x103'));db[_0x3018('0x104')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x105'));db[_0x3018('0x106')]=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x107'));db['TeamVoiceQueue']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x108'));db['TeamVoicePrefix']=db[_0x3018('0x0')][_0x3018('0x14')](_0x3018('0x109'));db[_0x3018('0x10a')]=db['sequelize'][_0x3018('0x14')](_0x3018('0x10b'));db[_0x3018('0x10c')]=db[_0x3018('0x0')][_0x3018('0x14')]('../api/user-setting/user-setting.model');db['User'][_0x3018('0x10d')](db[_0x3018('0x1f')],{'as':_0x3018('0x1f'),'onDelete':'cascade','foreignKey':_0x3018('0x10e')});db['User'][_0x3018('0x10d')](db[_0x3018('0x10c')],{'as':_0x3018('0x10f'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0x1c')],{'as':'Recordings','foreignKey':_0x3018('0x10e')});db['User']['hasMany'](db[_0x3018('0x2e')],{'as':'VoiceQueuesRt','foreignKey':_0x3018('0x10e')});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0x112')],{'as':_0x3018('0x113'),'onDelete':'cascade','hooks':!![]});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0x71')],{'as':_0x3018('0x114'),'foreignKey':'UserId'});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0x73')],{'as':'HopperHistory','foreignKey':_0x3018('0x10e')});db['User']['hasMany'](db[_0x3018('0x75')],{'as':_0x3018('0x75'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0x5d')],{'as':_0x3018('0x115'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x13')]['hasMany'](db['ChatInteraction'],{'as':_0x3018('0x116'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0x55')],{'as':_0x3018('0x117'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0x4c')],{'as':_0x3018('0x118'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0x40')],{'as':_0x3018('0x119'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0x11a')],{'as':_0x3018('0x11b'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x13')][_0x3018('0x111')](db[_0x3018('0xf9')],{'as':_0x3018('0x11c'),'foreignKey':_0x3018('0x11d')});db['User'][_0x3018('0x111')](db[_0x3018('0x6d')],{'as':_0x3018('0x11e'),'foreignKey':_0x3018('0x10e'),'onDelete':_0x3018('0x11f')});db[_0x3018('0x13')][_0x3018('0x120')](db[_0x3018('0xf4')],{'as':_0x3018('0xf4'),'foreignKey':_0x3018('0x121')});db[_0x3018('0x13')]['belongsToMany'](db['ChatGroup'],{'as':_0x3018('0x122'),'through':'chat_group_has_users'});db[_0x3018('0x13')][_0x3018('0x123')](db['CmContact'],{'as':_0x3018('0x124'),'through':_0x3018('0x125')});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0xf0')],{'as':'Lists','through':_0x3018('0x126')});db['User'][_0x3018('0x123')](db[_0x3018('0xe3')],{'through':_0x3018('0x127')});db['User']['belongsToMany'](db['MailInteraction'],{'as':_0x3018('0x119'),'through':_0x3018('0x128')});db['User'][_0x3018('0x123')](db[_0x3018('0x64')],{'as':'ChatInteractions','through':_0x3018('0x129')});db[_0x3018('0x13')]['belongsToMany'](db[_0x3018('0x4c')],{'as':_0x3018('0x118'),'through':_0x3018('0x12a')});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0x55')],{'as':_0x3018('0x117'),'through':_0x3018('0x12b')});db[_0x3018('0x13')][_0x3018('0x123')](db['OpenchannelInteraction'],{'as':_0x3018('0x115'),'through':'user_has_openchannel_interactions'});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0x11a')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x3018('0x13')]['belongsToMany'](db[_0x3018('0x1b')],{'as':_0x3018('0x12c'),'through':_0x3018('0x2f'),'required':![]});db['User']['belongsToMany'](db[_0x3018('0xf2')],{'as':_0x3018('0x12d'),'through':_0x3018('0x10a'),'required':![]});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0x3d')],{'as':_0x3018('0x12e'),'through':_0x3018('0x31'),'required':![]});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0x12f')],{'as':_0x3018('0x130'),'through':_0x3018('0x30'),'required':![],'hooks':!![]});db[_0x3018('0x13')]['belongsToMany'](db[_0x3018('0x4f')],{'as':_0x3018('0x131'),'through':'UserFaxQueue','required':![]});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0x58')],{'as':_0x3018('0x132'),'through':_0x3018('0x35'),'required':![]});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0x60')],{'as':_0x3018('0x133'),'through':_0x3018('0x134'),'required':![]});db['User'][_0x3018('0x123')](db[_0x3018('0x104')],{'as':_0x3018('0x135'),'through':_0x3018('0x38'),'required':![]});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0xf0')],{'through':_0x3018('0x126')});db[_0x3018('0x13')]['belongsToMany'](db[_0x3018('0x136')],{'as':'ChatWebsites','through':_0x3018('0x137')});db['User'][_0x3018('0x123')](db[_0x3018('0x49')],{'as':_0x3018('0x138'),'through':_0x3018('0x139')});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0x3b')],{'as':_0x3018('0x13a'),'through':_0x3018('0x13b')});db['User'][_0x3018('0x123')](db['OpenchannelAccount'],{'as':_0x3018('0x13c'),'through':'user_has_openchannel_accounts'});db[_0x3018('0x13')][_0x3018('0x123')](db[_0x3018('0x52')],{'as':_0x3018('0x13d'),'through':_0x3018('0x13e')});db[_0x3018('0x13')]['belongsToMany'](db[_0x3018('0xfb')],{'as':_0x3018('0x13f'),'through':'user_has_whatsapp_accounts'});db[_0x3018('0x16')][_0x3018('0x111')](db[_0x3018('0x112')],{'as':'SpiedAgents','onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x140')});db[_0x3018('0x18')][_0x3018('0x111')](db[_0x3018('0x112')],{'onDelete':_0x3018('0x110')});db['VoiceExtension'][_0x3018('0x111')](db[_0x3018('0x112')],{'as':_0x3018('0x141'),'onDelete':_0x3018('0x110')});db[_0x3018('0x1a')][_0x3018('0x123')](db[_0x3018('0x142')],{'as':_0x3018('0x143'),'through':_0x3018('0x144')});db[_0x3018('0x1b')]['hasMany'](db[_0x3018('0x2e')],{'as':'Members','foreignKey':_0x3018('0x145')});db[_0x3018('0x1b')][_0x3018('0x111')](db[_0x3018('0x6d')],{'as':_0x3018('0x11e'),'foreignKey':_0x3018('0x145')});db[_0x3018('0x1b')][_0x3018('0x111')](db['CmHopperFinal'],{'as':_0x3018('0x114'),'foreignKey':'VoiceQueueId'});db[_0x3018('0x1b')]['hasMany'](db[_0x3018('0x73')],{'as':_0x3018('0x146'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x3018('0x75')],{'as':_0x3018('0x75'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x3018('0x111')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x3018('0x145')});db[_0x3018('0x1b')][_0x3018('0x111')](db[_0x3018('0xd2')],{'as':_0x3018('0x147'),'foreignKey':_0x3018('0x145')});db['VoiceQueue'][_0x3018('0x120')](db[_0x3018('0x2b')],{'as':_0x3018('0x2b'),'foreignKey':_0x3018('0x148')});db[_0x3018('0x1b')]['belongsTo'](db[_0x3018('0x2b')],{'as':_0x3018('0x149'),'foreignKey':_0x3018('0x14a')});db[_0x3018('0x1b')][_0x3018('0x120')](db[_0x3018('0x14b')],{'as':_0x3018('0x14b'),'foreignKey':_0x3018('0x14c')});db[_0x3018('0x1b')]['belongsTo'](db[_0x3018('0x82')],{'as':_0x3018('0x14d'),'foreignKey':_0x3018('0x14e')});db['VoiceQueue'][_0x3018('0x123')](db['CmList'],{'as':_0x3018('0x14f'),'through':_0x3018('0x150')});db[_0x3018('0x1b')][_0x3018('0x123')](db['User'],{'as':_0x3018('0x151'),'through':_0x3018('0x2f')});db['VoiceQueue']['belongsToMany'](db[_0x3018('0xe3')],{'as':_0x3018('0x152'),'through':'TeamVoiceQueue'});db[_0x3018('0x1b')][_0x3018('0x123')](db[_0x3018('0xf0')],{'as':_0x3018('0x153'),'through':_0x3018('0x154')});db[_0x3018('0x1c')][_0x3018('0x120')](db[_0x3018('0x13')],{'as':_0x3018('0x13'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x1d')][_0x3018('0x120')](db[_0x3018('0x13')],{'as':_0x3018('0x13'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x1f')][_0x3018('0x111')](db[_0x3018('0x21')],{'as':_0x3018('0x155'),'onDelete':_0x3018('0x110'),'foreignKey':'mailboxuser','sourceKey':_0x3018('0x156')});db[_0x3018('0x21')][_0x3018('0x120')](db['VoiceMail'],{'foreignKey':_0x3018('0x157'),'targetKey':'mailbox'});db[_0x3018('0x22')][_0x3018('0x111')](db[_0x3018('0x27')],{'as':_0x3018('0x158'),'foreignKey':_0x3018('0x159'),'constraints':![]});db['VoiceCallReport'][_0x3018('0x111')](db[_0x3018('0x25')],{'as':_0x3018('0x15a'),'foreignKey':_0x3018('0x159'),'constraints':![]});db[_0x3018('0x22')][_0x3018('0x120')](db[_0x3018('0x13')],{'as':_0x3018('0x13'),'foreignKey':_0x3018('0x10e')});db['VoiceCallReport'][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':'Contact','foreignKey':_0x3018('0x15c')});db[_0x3018('0x15d')][_0x3018('0x120')](db[_0x3018('0x3b')],{'as':'MailAccount','foreignKey':_0x3018('0x15e')});db['MailServerIn']['belongsTo'](db[_0x3018('0x106')],{'as':_0x3018('0x106'),'foreignKey':_0x3018('0x15f'),'onDelete':_0x3018('0x160')});db[_0x3018('0x161')][_0x3018('0x120')](db[_0x3018('0x3b')],{'as':_0x3018('0x3b'),'foreignKey':_0x3018('0x15e')});db['MailServerOut'][_0x3018('0x120')](db['CloudProvider'],{'as':_0x3018('0x106'),'foreignKey':_0x3018('0x15f'),'onDelete':_0x3018('0x160')});db[_0x3018('0x3b')][_0x3018('0x10d')](db['MailServerIn'],{'as':'Imap','onDelete':'cascade'});db[_0x3018('0x3b')]['hasOne'](db[_0x3018('0x161')],{'as':_0x3018('0x162'),'onDelete':'cascade'});db[_0x3018('0x3b')][_0x3018('0x111')](db[_0x3018('0x7d')],{'as':_0x3018('0x163'),'foreignKey':'MailAccountId','onDelete':_0x3018('0x110')});db[_0x3018('0x3b')][_0x3018('0x111')](db[_0x3018('0x7c')],{'as':'Answers','foreignKey':_0x3018('0x15e')});db['MailAccount'][_0x3018('0x111')](db[_0x3018('0x42')],{'as':_0x3018('0x155'),'foreignKey':_0x3018('0x15e')});db[_0x3018('0x3b')]['hasMany'](db[_0x3018('0x40')],{'as':_0x3018('0x164')});db[_0x3018('0x3b')]['hasMany'](db['MailApplication'],{'as':_0x3018('0x141'),'foreignKey':'MailAccountId','onDelete':_0x3018('0x110')});db['MailAccount']['belongsTo'](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':_0x3018('0x166')});db[_0x3018('0x3b')]['belongsTo'](db[_0x3018('0x8e')],{'as':_0x3018('0x8e'),'foreignKey':_0x3018('0x167')});db[_0x3018('0x3b')][_0x3018('0x120')](db[_0x3018('0x82')],{'as':_0x3018('0x14d'),'foreignKey':_0x3018('0x14e')});db[_0x3018('0x3b')][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x151'),'through':_0x3018('0x13b')});db[_0x3018('0x3d')][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x151'),'through':'UserMailQueue'});db['MailQueue'][_0x3018('0x123')](db[_0x3018('0xe3')],{'through':_0x3018('0x168'),'as':_0x3018('0x152')});db['MailInteraction'][_0x3018('0x111')](db[_0x3018('0x42')],{'as':_0x3018('0x155'),'onDelete':'cascade','foreignKey':_0x3018('0x169')});db[_0x3018('0x40')][_0x3018('0x120')](db['MailAccount'],{'as':_0x3018('0x16a'),'foreignKey':'MailAccountId'});db[_0x3018('0x40')][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':_0x3018('0x16b'),'foreignKey':_0x3018('0x15c')});db[_0x3018('0x40')][_0x3018('0x120')](db[_0x3018('0x13')],{'as':_0x3018('0x16c'),'foreignKey':'UserId'});db[_0x3018('0x40')][_0x3018('0x123')](db[_0x3018('0x87')],{'through':_0x3018('0x16d'),'as':_0x3018('0x16e')});db[_0x3018('0x40')][_0x3018('0x123')](db[_0x3018('0x87')],{'through':_0x3018('0x16d'),'as':_0x3018('0x16f')});db[_0x3018('0x40')][_0x3018('0x123')](db['User'],{'as':_0x3018('0x170'),'through':_0x3018('0x128'),'foreignKey':'MailInteractionId'});db[_0x3018('0x42')][_0x3018('0x111')](db[_0x3018('0xe8')],{'as':_0x3018('0x171'),'onDelete':'cascade'});db[_0x3018('0x42')]['belongsTo'](db[_0x3018('0x13')],{'as':_0x3018('0x13')});db[_0x3018('0x42')][_0x3018('0x120')](db[_0x3018('0x15b')],{'onDelete':'cascade','as':_0x3018('0x16b')});db[_0x3018('0x42')][_0x3018('0x120')](db[_0x3018('0x40')],{'as':_0x3018('0x172'),'foreignKey':_0x3018('0x169')});db[_0x3018('0x42')][_0x3018('0x120')](db[_0x3018('0x3b')],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x15e')});db[_0x3018('0x42')]['belongsTo'](db['ChatWebsite'],{'as':_0x3018('0x136'),'foreignKey':_0x3018('0x173')});db[_0x3018('0x42')][_0x3018('0x120')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x3018('0x174')});db[_0x3018('0x44')]['belongsTo'](db['User'],{'onDelete':_0x3018('0x160')});db[_0x3018('0x44')][_0x3018('0x120')](db[_0x3018('0x3d')],{'onDelete':_0x3018('0x160')});db[_0x3018('0x44')][_0x3018('0x120')](db['MailAccount'],{'onDelete':_0x3018('0x160')});db[_0x3018('0x44')]['belongsTo'](db[_0x3018('0x14b')],{'onDelete':'restrict','foreignKey':_0x3018('0x14c')});db['MailApplication'][_0x3018('0x120')](db[_0x3018('0x87')],{'onDelete':_0x3018('0x160'),'foreignKey':_0x3018('0x175')});db[_0x3018('0x45')]['belongsTo'](db[_0x3018('0x3b')],{});db[_0x3018('0x45')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':_0x3018('0x166')});db[_0x3018('0x45')][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':_0x3018('0x16b'),'foreignKey':_0x3018('0x15c')});db['MailQueueReport']['belongsTo'](db[_0x3018('0x40')],{});db[_0x3018('0x45')][_0x3018('0x120')](db[_0x3018('0x42')],{});db['MailQueueReport'][_0x3018('0x120')](db[_0x3018('0x13')],{});db['MailQueueReport']['belongsTo'](db[_0x3018('0x3d')],{});db[_0x3018('0x47')][_0x3018('0x111')](db['DashboardItem'],{'as':_0x3018('0x176'),'onDelete':_0x3018('0x110')});db[_0x3018('0x49')][_0x3018('0x111')](db['Disposition'],{'as':_0x3018('0x163'),'foreignKey':'FaxAccountId','onDelete':'cascade'});db[_0x3018('0x49')]['hasMany'](db[_0x3018('0x7c')],{'as':'Answers','foreignKey':_0x3018('0x177')});db[_0x3018('0x49')][_0x3018('0x111')](db[_0x3018('0x4c')],{'as':_0x3018('0x164')});db['FaxAccount'][_0x3018('0x111')](db['FaxApplication'],{'as':_0x3018('0x141'),'foreignKey':_0x3018('0x177'),'onDelete':_0x3018('0x110')});db[_0x3018('0x49')][_0x3018('0x111')](db['VoiceExtension'],{'as':_0x3018('0x178'),'onDelete':_0x3018('0x110')});db[_0x3018('0x49')][_0x3018('0x111')](db[_0x3018('0x4e')],{'as':'Messages'});db[_0x3018('0x49')]['belongsTo'](db[_0x3018('0x2b')],{'as':_0x3018('0x2b')});db[_0x3018('0x49')][_0x3018('0x120')](db['CmList'],{'as':'List','foreignKey':_0x3018('0x166')});db[_0x3018('0x49')][_0x3018('0x120')](db[_0x3018('0x82')],{'as':_0x3018('0x14d'),'foreignKey':_0x3018('0x14e')});db[_0x3018('0x49')][_0x3018('0x123')](db['User'],{'as':_0x3018('0x151'),'through':_0x3018('0x139')});db[_0x3018('0x179')][_0x3018('0x120')](db[_0x3018('0x13')],{'onDelete':_0x3018('0x160')});db['FaxApplication'][_0x3018('0x120')](db[_0x3018('0x4f')],{'onDelete':_0x3018('0x160')});db[_0x3018('0x179')][_0x3018('0x120')](db['FaxAccount'],{'onDelete':_0x3018('0x160')});db[_0x3018('0x179')][_0x3018('0x120')](db['Tag'],{'onDelete':_0x3018('0x160'),'foreignKey':_0x3018('0x175')});db[_0x3018('0x4c')][_0x3018('0x111')](db[_0x3018('0x4e')],{'as':_0x3018('0x155'),'onDelete':'cascade','foreignKey':_0x3018('0x17a')});db[_0x3018('0x4c')]['belongsTo'](db['FaxAccount'],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x177')});db[_0x3018('0x4c')][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':'Contact','foreignKey':_0x3018('0x15c')});db[_0x3018('0x4c')]['belongsTo'](db[_0x3018('0x13')],{'as':_0x3018('0x16c'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x4c')]['belongsToMany'](db[_0x3018('0x87')],{'through':'fax_interaction_has_tags','as':_0x3018('0x16e')});db[_0x3018('0x4c')][_0x3018('0x123')](db[_0x3018('0x87')],{'through':_0x3018('0x17b'),'as':_0x3018('0x16f')});db[_0x3018('0x4c')]['belongsToMany'](db[_0x3018('0x13')],{'as':_0x3018('0x170'),'through':_0x3018('0x12a'),'foreignKey':'FaxInteractionId'});db[_0x3018('0x4e')]['belongsTo'](db[_0x3018('0x13')],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x13')});db[_0x3018('0x4e')][_0x3018('0x120')](db['FaxInteraction'],{'as':_0x3018('0x172'),'foreignKey':_0x3018('0x17a')});db[_0x3018('0x4e')][_0x3018('0x120')](db[_0x3018('0x15b')],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x16b')});db[_0x3018('0x4e')][_0x3018('0x120')](db[_0x3018('0xe8')],{'as':_0x3018('0xe8'),'foreignKey':'AttachmentId'});db[_0x3018('0x4e')][_0x3018('0x120')](db[_0x3018('0x49')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x3018('0x4f')]['belongsToMany'](db[_0x3018('0x13')],{'as':_0x3018('0x151'),'through':_0x3018('0x33')});db[_0x3018('0x4f')][_0x3018('0x123')](db[_0x3018('0xe3')],{'through':'team_has_fax_queues','as':'Teams'});db[_0x3018('0x50')][_0x3018('0x120')](db[_0x3018('0x49')],{});db[_0x3018('0x50')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':_0x3018('0x166')});db[_0x3018('0x50')][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':_0x3018('0x16b'),'foreignKey':_0x3018('0x15c')});db['FaxQueueReport'][_0x3018('0x120')](db[_0x3018('0x4c')],{});db['FaxQueueReport'][_0x3018('0x120')](db[_0x3018('0x4e')],{});db[_0x3018('0x50')][_0x3018('0x120')](db[_0x3018('0x13')],{});db[_0x3018('0x50')][_0x3018('0x120')](db[_0x3018('0x4f')],{});db[_0x3018('0x52')][_0x3018('0x111')](db[_0x3018('0x7d')],{'as':_0x3018('0x163'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0x3018('0x52')][_0x3018('0x111')](db[_0x3018('0x7c')],{'as':_0x3018('0x17c'),'foreignKey':_0x3018('0x17d')});db[_0x3018('0x52')][_0x3018('0x111')](db[_0x3018('0x57')],{'as':_0x3018('0x155'),'foreignKey':_0x3018('0x17d')});db[_0x3018('0x52')][_0x3018('0x111')](db[_0x3018('0x55')],{'as':_0x3018('0x164')});db[_0x3018('0x52')]['hasMany'](db[_0x3018('0x53')],{'as':_0x3018('0x141'),'foreignKey':_0x3018('0x17d'),'onDelete':_0x3018('0x110')});db[_0x3018('0x52')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':_0x3018('0x166')});db[_0x3018('0x52')][_0x3018('0x120')](db['Pause'],{'as':_0x3018('0x14d'),'foreignKey':_0x3018('0x14e')});db[_0x3018('0x52')]['belongsToMany'](db[_0x3018('0x13')],{'as':_0x3018('0x151'),'through':'user_has_sms_accounts'});db[_0x3018('0x53')][_0x3018('0x120')](db[_0x3018('0x13')],{'onDelete':_0x3018('0x160')});db[_0x3018('0x53')][_0x3018('0x120')](db[_0x3018('0x58')],{'onDelete':_0x3018('0x160')});db[_0x3018('0x53')]['belongsTo'](db[_0x3018('0x52')],{'onDelete':_0x3018('0x160')});db['SmsApplication'][_0x3018('0x120')](db[_0x3018('0x14b')],{'onDelete':_0x3018('0x160'),'foreignKey':_0x3018('0x14c')});db[_0x3018('0x53')][_0x3018('0x120')](db[_0x3018('0x87')],{'onDelete':_0x3018('0x160'),'foreignKey':_0x3018('0x175')});db[_0x3018('0x55')]['hasMany'](db['SmsMessage'],{'as':_0x3018('0x155'),'onDelete':_0x3018('0x110'),'foreignKey':'SmsInteractionId'});db[_0x3018('0x55')][_0x3018('0x120')](db['SmsAccount'],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x17d')});db[_0x3018('0x55')]['belongsTo'](db[_0x3018('0x15b')],{'as':'Contact','foreignKey':'ContactId'});db['SmsInteraction'][_0x3018('0x120')](db[_0x3018('0x13')],{'as':_0x3018('0x16c'),'foreignKey':'UserId'});db[_0x3018('0x55')][_0x3018('0x123')](db['Tag'],{'through':_0x3018('0x17e'),'as':_0x3018('0x16e')});db[_0x3018('0x55')][_0x3018('0x123')](db['Tag'],{'through':_0x3018('0x17e'),'as':_0x3018('0x16f')});db['SmsInteraction'][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x170'),'through':_0x3018('0x12b'),'foreignKey':'SmsInteractionId'});db[_0x3018('0x57')][_0x3018('0x120')](db[_0x3018('0x13')],{'as':'User'});db['SmsMessage']['belongsTo'](db[_0x3018('0x15b')],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x16b')});db[_0x3018('0x57')][_0x3018('0x120')](db[_0x3018('0x55')],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x172'),'foreignKey':'SmsInteractionId'});db[_0x3018('0x57')][_0x3018('0x120')](db[_0x3018('0x52')],{'as':_0x3018('0x16a'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x3018('0x123')](db[_0x3018('0x13')],{'as':'Agents','through':_0x3018('0x35'),'foreignKey':_0x3018('0x17f')});db['SmsQueue'][_0x3018('0x123')](db[_0x3018('0xe3')],{'through':_0x3018('0x180'),'as':'Teams'});db['OpenchannelAccount'][_0x3018('0x111')](db[_0x3018('0x7d')],{'as':_0x3018('0x163'),'foreignKey':_0x3018('0x181'),'onDelete':'cascade'});db['OpenchannelAccount'][_0x3018('0x111')](db[_0x3018('0x7c')],{'as':_0x3018('0x17c'),'foreignKey':_0x3018('0x181')});db[_0x3018('0x5a')][_0x3018('0x111')](db[_0x3018('0x5d')],{'as':_0x3018('0x164'),'foreignKey':'OpenchannelAccountId'});db[_0x3018('0x5a')]['hasMany'](db['OpenchannelMessage'],{'as':_0x3018('0x155'),'foreignKey':_0x3018('0x181')});db['OpenchannelAccount'][_0x3018('0x111')](db[_0x3018('0x5c')],{'as':_0x3018('0x141'),'foreignKey':'OpenchannelAccountId','onDelete':_0x3018('0x110')});db['OpenchannelAccount'][_0x3018('0x120')](db['CmList'],{'as':_0x3018('0x165'),'foreignKey':_0x3018('0x166')});db[_0x3018('0x5a')][_0x3018('0x120')](db[_0x3018('0x82')],{'as':_0x3018('0x14d'),'foreignKey':_0x3018('0x14e')});db['OpenchannelAccount'][_0x3018('0x123')](db['User'],{'as':_0x3018('0x151'),'through':_0x3018('0x182')});db[_0x3018('0x5c')][_0x3018('0x120')](db[_0x3018('0x13')],{'onDelete':_0x3018('0x160')});db[_0x3018('0x5c')]['belongsTo'](db[_0x3018('0x60')],{'onDelete':_0x3018('0x160'),'foreignKey':_0x3018('0x183')});db[_0x3018('0x5c')][_0x3018('0x120')](db[_0x3018('0x5a')],{'onDelete':'restrict','foreignKey':_0x3018('0x181')});db[_0x3018('0x5c')][_0x3018('0x120')](db[_0x3018('0x14b')],{'onDelete':_0x3018('0x160'),'foreignKey':_0x3018('0x14c')});db['OpenchannelApplication']['belongsTo'](db[_0x3018('0x87')],{'onDelete':_0x3018('0x160'),'foreignKey':_0x3018('0x175')});db['OpenchannelInteraction'][_0x3018('0x111')](db[_0x3018('0x184')],{'as':_0x3018('0x155'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x185')});db[_0x3018('0x5d')][_0x3018('0x120')](db[_0x3018('0x5a')],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x181')});db['OpenchannelInteraction'][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':_0x3018('0x16b'),'foreignKey':_0x3018('0x15c')});db[_0x3018('0x5d')][_0x3018('0x120')](db['User'],{'as':_0x3018('0x16c'),'foreignKey':_0x3018('0x10e')});db[_0x3018('0x5d')][_0x3018('0x123')](db[_0x3018('0x87')],{'through':_0x3018('0x186'),'as':_0x3018('0x16e')});db[_0x3018('0x5d')][_0x3018('0x123')](db[_0x3018('0x87')],{'through':_0x3018('0x186'),'as':_0x3018('0x16f')});db[_0x3018('0x5d')][_0x3018('0x123')](db['User'],{'as':_0x3018('0x170'),'through':'user_has_openchannel_interactions','foreignKey':_0x3018('0x185')});db[_0x3018('0x184')][_0x3018('0x120')](db['User'],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x13')});db[_0x3018('0x184')][_0x3018('0x120')](db[_0x3018('0x15b')],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x16b')});db['OpenchannelMessage']['belongsTo'](db[_0x3018('0x5d')],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x172'),'foreignKey':_0x3018('0x185')});db[_0x3018('0x184')][_0x3018('0x120')](db[_0x3018('0xe8')],{'as':_0x3018('0xe8'),'foreignKey':_0x3018('0x187')});db[_0x3018('0x184')][_0x3018('0x120')](db[_0x3018('0x5a')],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x181')});db[_0x3018('0x60')][_0x3018('0x123')](db['User'],{'as':'Agents','through':_0x3018('0x134'),'foreignKey':_0x3018('0x183')});db[_0x3018('0x60')][_0x3018('0x123')](db['Team'],{'through':_0x3018('0x188'),'as':_0x3018('0x152')});db['ChatWebsite'][_0x3018('0x111')](db['Disposition'],{'as':_0x3018('0x163'),'foreignKey':_0x3018('0x173'),'onDelete':_0x3018('0x110')});db[_0x3018('0x136')][_0x3018('0x111')](db[_0x3018('0x7c')],{'as':_0x3018('0x17c'),'foreignKey':_0x3018('0x173')});db[_0x3018('0x136')][_0x3018('0x111')](db[_0x3018('0x6a')],{'as':_0x3018('0x189')});db[_0x3018('0x136')][_0x3018('0x111')](db['ChatInteraction'],{'as':_0x3018('0x164')});db[_0x3018('0x136')][_0x3018('0x111')](db[_0x3018('0x18a')],{'as':'Applications','foreignKey':_0x3018('0x173'),'onDelete':_0x3018('0x110')});db['ChatWebsite'][_0x3018('0x111')](db[_0x3018('0x66')],{'as':_0x3018('0x155')});db['ChatWebsite'][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':'List','foreignKey':_0x3018('0x166')});db['ChatWebsite']['belongsTo'](db['Interval'],{'as':_0x3018('0x14b'),'foreignKey':_0x3018('0x14c')});db[_0x3018('0x136')][_0x3018('0x120')](db[_0x3018('0x3b')],{'as':_0x3018('0x3b'),'foreignKey':_0x3018('0x15e')});db['ChatWebsite'][_0x3018('0x120')](db[_0x3018('0x82')],{'as':_0x3018('0x14d'),'foreignKey':_0x3018('0x14e')});db[_0x3018('0x136')][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x151'),'through':_0x3018('0x137')});db[_0x3018('0x18b')][_0x3018('0x120')](db[_0x3018('0x5a')],{});db[_0x3018('0x18b')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':'List','foreignKey':_0x3018('0x166')});db['OpenchannelQueueReport']['belongsTo'](db[_0x3018('0x15b')],{'as':_0x3018('0x16b'),'foreignKey':_0x3018('0x15c')});db['OpenchannelQueueReport']['belongsTo'](db[_0x3018('0x5d')],{});db[_0x3018('0x18b')]['belongsTo'](db[_0x3018('0x184')],{});db[_0x3018('0x18b')]['belongsTo'](db['User'],{});db[_0x3018('0x18b')]['belongsTo'](db[_0x3018('0x60')],{});db[_0x3018('0x18a')]['belongsTo'](db[_0x3018('0x13')],{'as':_0x3018('0x18c'),'foreignKey':'UserId','onDelete':_0x3018('0x160')});db['ChatApplication']['belongsTo'](db[_0x3018('0x12f')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x3018('0x160')});db[_0x3018('0x18a')]['belongsTo'](db[_0x3018('0x136')],{'as':_0x3018('0x18d'),'foreignKey':_0x3018('0x173'),'onDelete':_0x3018('0x160')});db[_0x3018('0x18a')][_0x3018('0x120')](db[_0x3018('0x87')],{'onDelete':_0x3018('0x160'),'foreignKey':_0x3018('0x175')});db['ChatInteraction'][_0x3018('0x111')](db[_0x3018('0x66')],{'as':_0x3018('0x155'),'onDelete':_0x3018('0x110'),'foreignKey':'ChatInteractionId'});db[_0x3018('0x64')][_0x3018('0x120')](db[_0x3018('0x136')],{'as':'Account','foreignKey':_0x3018('0x173')});db[_0x3018('0x64')][_0x3018('0x120')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['ChatInteraction'][_0x3018('0x120')](db[_0x3018('0x13')],{'as':_0x3018('0x16c'),'foreignKey':_0x3018('0x10e')});db['ChatInteraction']['belongsToMany'](db[_0x3018('0x87')],{'through':_0x3018('0x18e'),'as':_0x3018('0x16e')});db[_0x3018('0x64')][_0x3018('0x123')](db[_0x3018('0x87')],{'through':_0x3018('0x18e'),'as':_0x3018('0x16f')});db['ChatInteraction'][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x170'),'through':_0x3018('0x129'),'foreignKey':_0x3018('0x18f')});db[_0x3018('0x66')][_0x3018('0x120')](db['User'],{'onDelete':_0x3018('0x110'),'as':'User'});db[_0x3018('0x66')]['belongsTo'](db[_0x3018('0x15b')],{'onDelete':'cascade','as':_0x3018('0x16b'),'foreignKey':_0x3018('0x15c')});db[_0x3018('0x66')][_0x3018('0x120')](db['ChatInteraction'],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x172'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x3018('0x120')](db[_0x3018('0xe8')],{'as':_0x3018('0xe8'),'foreignKey':'AttachmentId'});db[_0x3018('0x66')]['belongsTo'](db['ChatWebsite'],{'as':_0x3018('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0x3018('0x190')][_0x3018('0x111')](db[_0x3018('0xe8')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x3018('0x110'),'hooks':!![]});db[_0x3018('0x190')][_0x3018('0x120')](db[_0x3018('0x15b')],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x16b'),'foreignKey':'ContactId'});db['ChatOfflineMessage']['belongsTo'](db['ChatWebsite'],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x173')});db[_0x3018('0x12f')][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x151'),'through':_0x3018('0x30'),'hooks':!![]});db[_0x3018('0x12f')]['belongsToMany'](db['Team'],{'through':'team_has_chat_queues','as':_0x3018('0x152')});db[_0x3018('0x68')][_0x3018('0x111')](db[_0x3018('0x191')],{'as':_0x3018('0x155'),'foreignKey':_0x3018('0x192'),'onDelete':_0x3018('0x110')});db[_0x3018('0x68')][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x193'),'through':_0x3018('0x194')});db[_0x3018('0x6a')][_0x3018('0x120')](db[_0x3018('0x136')],{'as':'Website','foreignKey':_0x3018('0x173')});db[_0x3018('0x6b')][_0x3018('0x111')](db['CmContact'],{'as':'Contacts','foreignKey':_0x3018('0x195')});db[_0x3018('0x15b')][_0x3018('0x111')](db[_0x3018('0x8b')],{'as':_0x3018('0x196'),'foreignKey':_0x3018('0x197')});db['CmContact']['hasMany'](db[_0x3018('0x6d')],{'as':_0x3018('0x11e'),'foreignKey':'ContactId'});db['CmContact'][_0x3018('0x111')](db[_0x3018('0x71')],{'as':_0x3018('0x114'),'foreignKey':'ContactId'});db[_0x3018('0x15b')][_0x3018('0x111')](db['CmHopperHistory'],{'as':_0x3018('0x146'),'foreignKey':_0x3018('0x15c')});db[_0x3018('0x15b')]['hasMany'](db[_0x3018('0x75')],{'as':_0x3018('0x75'),'foreignKey':_0x3018('0x15c')});db[_0x3018('0x15b')][_0x3018('0x111')](db[_0x3018('0xd2')],{'as':_0x3018('0x147'),'foreignKey':_0x3018('0x15c')});db[_0x3018('0x15b')][_0x3018('0x111')](db[_0x3018('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x3018('0x160')});db[_0x3018('0x15b')][_0x3018('0x111')](db['ChatInteraction'],{'as':_0x3018('0x116'),'foreignKey':_0x3018('0x15c'),'onDelete':_0x3018('0x160')});db[_0x3018('0x15b')][_0x3018('0x111')](db[_0x3018('0x55')],{'as':'SmsInteractions','foreignKey':_0x3018('0x15c'),'onDelete':_0x3018('0x160')});db[_0x3018('0x15b')][_0x3018('0x111')](db['FaxInteraction'],{'as':_0x3018('0x118'),'foreignKey':_0x3018('0x15c'),'onDelete':_0x3018('0x160')});db[_0x3018('0x15b')][_0x3018('0x111')](db[_0x3018('0x40')],{'as':_0x3018('0x119'),'foreignKey':'ContactId','onDelete':_0x3018('0x160')});db[_0x3018('0x15b')][_0x3018('0x120')](db[_0x3018('0x6b')],{'as':'Company','foreignKey':_0x3018('0x195')});db[_0x3018('0x15b')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':_0x3018('0x166'),'onDelete':'cascade'});db[_0x3018('0x15b')][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x170'),'through':'cm_user_has_contacts'});db['CmContact'][_0x3018('0x123')](db['Tag'],{'as':_0x3018('0x16e'),'through':_0x3018('0x198')});db['CmContact'][_0x3018('0x123')](db[_0x3018('0x87')],{'through':'cm_contact_has_tags','as':_0x3018('0x16f')});db['CmHopper'][_0x3018('0x111')](db[_0x3018('0x8d')],{'as':_0x3018('0x199'),'foreignKey':'CmHopperId'});db[_0x3018('0x6d')][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':_0x3018('0x16b'),'foreignKey':_0x3018('0x15c'),'onDelete':'cascade'});db[_0x3018('0x6d')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':_0x3018('0x166'),'onDelete':_0x3018('0x110')});db[_0x3018('0x6d')][_0x3018('0x120')](db[_0x3018('0x13')],{'as':'Agent','foreignKey':_0x3018('0x10e')});db[_0x3018('0x6d')][_0x3018('0x120')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x3018('0x145'),'onDelete':_0x3018('0x110')});db[_0x3018('0x6d')][_0x3018('0x120')](db[_0x3018('0xe4')],{'as':_0x3018('0xe4'),'foreignKey':_0x3018('0x19a'),'onDelete':'cascade'});db[_0x3018('0x6d')][_0x3018('0x120')](db['User'],{'as':_0x3018('0x16c'),'foreignKey':_0x3018('0x19b')});db[_0x3018('0x6f')][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':'Contact','foreignKey':_0x3018('0x15c'),'onDelete':_0x3018('0x110')});db['CmHopperBlack']['belongsTo'](db[_0x3018('0xf0')],{'as':'List','foreignKey':'ListId','onDelete':_0x3018('0x110')});db[_0x3018('0x6f')][_0x3018('0x120')](db[_0x3018('0x1b')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x3018('0x110')});db['CmHopperBlack'][_0x3018('0x120')](db[_0x3018('0xe4')],{'as':_0x3018('0xe4'),'foreignKey':'CampaignId','onDelete':_0x3018('0x110')});db[_0x3018('0x7a')][_0x3018('0x111')](db[_0x3018('0x7f')],{'as':{'plural':_0x3018('0x19c'),'singular':_0x3018('0x19d')},'foreignKey':_0x3018('0x19e'),'onDelete':'cascade','hooks':!![]});db[_0x3018('0x7a')][_0x3018('0x111')](db[_0x3018('0x7f')],{'as':{'plural':'Any','singular':_0x3018('0x19f')},'foreignKey':_0x3018('0x1a0'),'onDelete':_0x3018('0x110'),'hooks':!![]});db[_0x3018('0x7a')][_0x3018('0x111')](db['Action'],{'as':_0x3018('0x1a1'),'foreignKey':_0x3018('0x1a2'),'onDelete':_0x3018('0x110'),'hooks':!![]});db[_0x3018('0x7d')][_0x3018('0x111')](db[_0x3018('0x7d')],{'as':_0x3018('0x163'),'foreignKey':_0x3018('0x1a3'),'onDelete':'cascade'});db[_0x3018('0x14b')]['hasMany'](db['Interval'],{'as':_0x3018('0x1a4'),'foreignKey':_0x3018('0x14c'),'onDelete':_0x3018('0x110'),'hooks':!![],'required':![]});db['Interval'][_0x3018('0x111')](db[_0x3018('0x112')],{'as':_0x3018('0x113'),'foreignKey':'IntervalId','onDelete':_0x3018('0x160')});db[_0x3018('0x14b')][_0x3018('0x111')](db[_0x3018('0x44')],{'as':_0x3018('0x1a5'),'foreignKey':_0x3018('0x14c')});db['Interval'][_0x3018('0x111')](db[_0x3018('0x18a')],{'as':_0x3018('0x1a6'),'foreignKey':_0x3018('0x14c')});db['Interval']['hasMany'](db[_0x3018('0x179')],{'as':_0x3018('0x1a7'),'foreignKey':_0x3018('0x14c')});db['Interval']['hasMany'](db[_0x3018('0x53')],{'as':_0x3018('0x1a8'),'foreignKey':_0x3018('0x14c')});db['Schedule'][_0x3018('0x120')](db[_0x3018('0x3b')],{});db[_0x3018('0x85')][_0x3018('0x120')](db[_0x3018('0x98')],{'foreignKey':_0x3018('0x1a9')});db[_0x3018('0x85')][_0x3018('0x120')](db['AnalyticCustomReport'],{'foreignKey':_0x3018('0x1aa')});db[_0x3018('0x142')][_0x3018('0x123')](db[_0x3018('0x1a')],{'as':'Mohs','through':_0x3018('0x144'),'onDelete':_0x3018('0x160')});db['Tag'][_0x3018('0x123')](db[_0x3018('0x15b')],{'through':_0x3018('0x198')});db[_0x3018('0x87')][_0x3018('0x123')](db[_0x3018('0x64')],{'through':_0x3018('0x18e')});db['Tag']['belongsToMany'](db[_0x3018('0x40')],{'through':_0x3018('0x16d')});db[_0x3018('0x87')][_0x3018('0x123')](db[_0x3018('0x55')],{'through':_0x3018('0x17e')});db['Tag'][_0x3018('0x123')](db[_0x3018('0x4c')],{'through':_0x3018('0x17b')});db['Tag']['belongsToMany'](db[_0x3018('0x5d')],{'through':_0x3018('0x186')});db[_0x3018('0x87')]['belongsToMany'](db[_0x3018('0x11a')],{'through':_0x3018('0x1ab')});db[_0x3018('0x8b')][_0x3018('0x120')](db['ContactItemType'],{'as':_0x3018('0x1ac'),'foreignKey':_0x3018('0x1ad')});db['CmHopperAdditionalPhone'][_0x3018('0x120')](db[_0x3018('0x6d')],{'as':_0x3018('0x1ae'),'foreignKey':_0x3018('0x1af')});db[_0x3018('0x8b')][_0x3018('0x120')](db['CmContact'],{'as':_0x3018('0x16b'),'foreignKey':'CmContactId'});db[_0x3018('0x1b0')][_0x3018('0x111')](db[_0x3018('0x7f')],{'as':{'plural':_0x3018('0x1b1'),'singular':_0x3018('0x1b2')},'foreignKey':_0x3018('0x1b3'),'onDelete':'cascade','hooks':!![]});db[_0x3018('0x1b0')][_0x3018('0x111')](db['Condition'],{'as':{'plural':_0x3018('0x1b4'),'singular':_0x3018('0x1b5')},'foreignKey':_0x3018('0x1b6'),'onDelete':_0x3018('0x110'),'hooks':!![]});db[_0x3018('0x1b0')][_0x3018('0x111')](db['Action'],{'as':'Actions','foreignKey':_0x3018('0x1b7'),'onDelete':_0x3018('0x110'),'hooks':!![]});db['AnalyticCustomReport'][_0x3018('0x111')](db[_0x3018('0x1b8')],{'as':_0x3018('0x1b9'),'onDelete':_0x3018('0x110'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x3018('0x98')][_0x3018('0x111')](db[_0x3018('0x1b8')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x3018('0x1a9')});db[_0x3018('0x99')][_0x3018('0x111')](db[_0x3018('0x1b8')],{'as':'Fields','onDelete':_0x3018('0x110'),'foreignKey':'MetricId'});db[_0x3018('0x1b8')]['belongsTo'](db[_0x3018('0x99')],{'foreignKey':_0x3018('0x1ba')});db['SalesforceAccount'][_0x3018('0x111')](db[_0x3018('0x9e')],{'as':_0x3018('0x1bb'),'onDelete':_0x3018('0x110'),'foreignKey':'AccountId'});db[_0x3018('0x9e')][_0x3018('0x111')](db[_0x3018('0x1bc')],{'as':_0x3018('0x1bd'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1be')});db[_0x3018('0x9e')]['hasMany'](db[_0x3018('0x1bc')],{'as':'Descriptions','onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1bf')});db[_0x3018('0x9e')][_0x3018('0x111')](db[_0x3018('0x1bc')],{'as':'Fields','onDelete':_0x3018('0x110'),'foreignKey':'FieldId'});db[_0x3018('0x9e')][_0x3018('0x120')](db[_0x3018('0x9d')],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x1c0')});db['SalesforceField'][_0x3018('0x111')](db[_0x3018('0x1bc')],{'as':'Subject','foreignKey':_0x3018('0x1be')});db[_0x3018('0x1bc')][_0x3018('0x111')](db['SalesforceField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3018('0x1bc')][_0x3018('0x111')](db[_0x3018('0x1bc')],{'as':'Field','foreignKey':_0x3018('0x1c1')});db[_0x3018('0x1bc')][_0x3018('0x120')](db[_0x3018('0x90')],{'as':_0x3018('0x90'),'foreignKey':_0x3018('0x1c2')});db[_0x3018('0xa1')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0x3018('0x1bb'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c0')});db[_0x3018('0x1c3')][_0x3018('0x111')](db[_0x3018('0xa4')],{'as':_0x3018('0x1bd'),'onDelete':'cascade','foreignKey':_0x3018('0x1be')});db[_0x3018('0x1c3')][_0x3018('0x111')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1bf')});db['SugarcrmConfiguration']['hasMany'](db[_0x3018('0xa4')],{'as':_0x3018('0x1b9'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0x1c3')]['belongsTo'](db[_0x3018('0xa1')],{'as':_0x3018('0x16a'),'foreignKey':'AccountId'});db[_0x3018('0xa4')][_0x3018('0x111')](db[_0x3018('0xa4')],{'as':_0x3018('0x1c4'),'foreignKey':'SubjectId'});db[_0x3018('0xa4')][_0x3018('0x111')](db[_0x3018('0xa4')],{'as':_0x3018('0x1c5'),'foreignKey':_0x3018('0x1bf')});db[_0x3018('0xa4')][_0x3018('0x111')](db[_0x3018('0xa4')],{'as':'Field','foreignKey':_0x3018('0x1c1')});db[_0x3018('0xa4')][_0x3018('0x120')](db[_0x3018('0x90')],{'as':_0x3018('0x90'),'foreignKey':_0x3018('0x1c2')});db[_0x3018('0x1c6')][_0x3018('0x111')](db[_0x3018('0xa7')],{'as':_0x3018('0x1bb'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c0')});db[_0x3018('0xa7')]['hasMany'](db[_0x3018('0x1c7')],{'as':_0x3018('0x1bd'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1be')});db[_0x3018('0xa7')][_0x3018('0x111')](db[_0x3018('0x1c7')],{'as':_0x3018('0x1c8'),'onDelete':_0x3018('0x110'),'foreignKey':'DescriptionId'});db[_0x3018('0xa7')][_0x3018('0x111')](db[_0x3018('0x1c7')],{'as':'Fields','onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0xa7')][_0x3018('0x120')](db['DeskAccount'],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x1c0')});db[_0x3018('0xa7')][_0x3018('0x123')](db[_0x3018('0x87')],{'through':_0x3018('0x1c9')});db[_0x3018('0x1c7')][_0x3018('0x111')](db[_0x3018('0x1c7')],{'as':_0x3018('0x1c4'),'foreignKey':_0x3018('0x1be')});db['DeskField'][_0x3018('0x111')](db['DeskField'],{'as':_0x3018('0x1c5'),'foreignKey':'DescriptionId'});db[_0x3018('0x1c7')]['hasMany'](db[_0x3018('0x1c7')],{'as':'Field','foreignKey':_0x3018('0x1c1')});db[_0x3018('0x1c7')][_0x3018('0x120')](db['Variable'],{'as':_0x3018('0x90'),'foreignKey':_0x3018('0x1c2')});db[_0x3018('0xaa')][_0x3018('0x111')](db[_0x3018('0xac')],{'as':_0x3018('0x1bb'),'onDelete':'cascade','foreignKey':_0x3018('0x1c0')});db[_0x3018('0xac')][_0x3018('0x111')](db[_0x3018('0xae')],{'as':_0x3018('0x1bd'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1be')});db[_0x3018('0xac')][_0x3018('0x111')](db[_0x3018('0xae')],{'as':_0x3018('0x1c8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x3018('0xac')][_0x3018('0x111')](db['ZohoField'],{'as':'Fields','onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0xac')][_0x3018('0x120')](db[_0x3018('0xaa')],{'as':_0x3018('0x16a'),'foreignKey':'AccountId'});db[_0x3018('0xae')][_0x3018('0x111')](db[_0x3018('0xae')],{'as':_0x3018('0x1c4'),'foreignKey':'SubjectId'});db[_0x3018('0xae')]['hasMany'](db[_0x3018('0xae')],{'as':_0x3018('0x1c5'),'foreignKey':_0x3018('0x1bf')});db['ZohoField']['hasMany'](db[_0x3018('0xae')],{'as':_0x3018('0x1ca'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0xae')][_0x3018('0x120')](db[_0x3018('0x90')],{'as':'Variable','foreignKey':_0x3018('0x1c2')});db[_0x3018('0x1cb')][_0x3018('0x111')](db[_0x3018('0xb1')],{'as':_0x3018('0x1bb'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c0')});db[_0x3018('0xb1')][_0x3018('0x111')](db['ZendeskField'],{'as':_0x3018('0x1bd'),'foreignKey':_0x3018('0x1be')});db[_0x3018('0xb1')][_0x3018('0x111')](db[_0x3018('0xb2')],{'as':_0x3018('0x1c8'),'foreignKey':_0x3018('0x1bf')});db[_0x3018('0xb1')][_0x3018('0x111')](db[_0x3018('0xb2')],{'as':'Fields','foreignKey':_0x3018('0x1c1')});db['ZendeskConfiguration']['belongsTo'](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x3018('0x1c0')});db[_0x3018('0xb1')][_0x3018('0x123')](db[_0x3018('0x87')],{'through':'int_zendesk_configuration_has_tags'});db[_0x3018('0xb2')][_0x3018('0x111')](db['ZendeskField'],{'as':_0x3018('0x1c4'),'foreignKey':_0x3018('0x1be')});db['ZendeskField'][_0x3018('0x111')](db[_0x3018('0xb2')],{'as':'Description','foreignKey':_0x3018('0x1bf')});db[_0x3018('0xb2')][_0x3018('0x111')](db[_0x3018('0xb2')],{'as':_0x3018('0x1ca'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0xb2')][_0x3018('0x120')](db[_0x3018('0x90')],{'as':_0x3018('0x90'),'foreignKey':_0x3018('0x1c2')});db[_0x3018('0xb4')][_0x3018('0x111')](db[_0x3018('0xb6')],{'as':_0x3018('0x1bb'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c0')});db[_0x3018('0xb6')][_0x3018('0x111')](db[_0x3018('0xb7')],{'as':_0x3018('0x1bd'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1be')});db['FreshdeskConfiguration'][_0x3018('0x111')](db['FreshdeskField'],{'as':_0x3018('0x1c8'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1bf')});db['FreshdeskConfiguration']['hasMany'](db[_0x3018('0xb7')],{'as':_0x3018('0x1b9'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0xb6')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x1c0')});db[_0x3018('0xb6')]['belongsToMany'](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db[_0x3018('0xb7')]['hasMany'](db['FreshdeskField'],{'as':_0x3018('0x1c4'),'foreignKey':_0x3018('0x1be')});db[_0x3018('0xb7')][_0x3018('0x111')](db[_0x3018('0xb7')],{'as':_0x3018('0x1c5'),'foreignKey':'DescriptionId'});db[_0x3018('0xb7')][_0x3018('0x111')](db[_0x3018('0xb7')],{'as':_0x3018('0x1ca'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0xb7')]['belongsTo'](db['Variable'],{'as':_0x3018('0x90'),'foreignKey':_0x3018('0x1c2')});db[_0x3018('0xb9')][_0x3018('0x111')](db[_0x3018('0x1cc')],{'as':_0x3018('0x1bb'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c0')});db['VtigerConfiguration']['hasMany'](db[_0x3018('0x1cd')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x3018('0x1cc')][_0x3018('0x111')](db[_0x3018('0x1cd')],{'as':'Descriptions','foreignKey':_0x3018('0x1bf')});db[_0x3018('0x1cc')][_0x3018('0x111')](db[_0x3018('0x1cd')],{'as':_0x3018('0x1b9'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0x1cc')][_0x3018('0x120')](db[_0x3018('0xb9')],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x1c0')});db[_0x3018('0x1cd')]['hasMany'](db['VtigerField'],{'as':_0x3018('0x1c4'),'foreignKey':_0x3018('0x1be')});db['VtigerField'][_0x3018('0x111')](db[_0x3018('0x1cd')],{'as':'Description','foreignKey':_0x3018('0x1bf')});db[_0x3018('0x1cd')][_0x3018('0x111')](db[_0x3018('0x1cd')],{'as':'Field','foreignKey':'FieldId'});db[_0x3018('0x1cd')][_0x3018('0x120')](db[_0x3018('0x90')],{'as':_0x3018('0x90'),'foreignKey':_0x3018('0x1c2')});db[_0x3018('0xbd')]['hasMany'](db[_0x3018('0xbf')],{'as':'Configurations','onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c0')});db['ServicenowConfiguration'][_0x3018('0x111')](db[_0x3018('0xc1')],{'as':_0x3018('0x1bd'),'foreignKey':_0x3018('0x1be')});db['ServicenowConfiguration'][_0x3018('0x111')](db[_0x3018('0xc1')],{'as':_0x3018('0x1c8'),'foreignKey':_0x3018('0x1bf')});db[_0x3018('0xbf')][_0x3018('0x111')](db[_0x3018('0xc1')],{'as':'Fields','foreignKey':_0x3018('0x1c1')});db[_0x3018('0xbf')][_0x3018('0x120')](db[_0x3018('0xbd')],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x1c0')});db[_0x3018('0xc1')][_0x3018('0x111')](db[_0x3018('0xc1')],{'as':'Subject','foreignKey':_0x3018('0x1be')});db[_0x3018('0xc1')]['hasMany'](db['ServicenowField'],{'as':'Description','foreignKey':_0x3018('0x1bf')});db[_0x3018('0xc1')][_0x3018('0x111')](db['ServicenowField'],{'as':_0x3018('0x1ca'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0xc1')][_0x3018('0x120')](db[_0x3018('0x90')],{'as':'Variable','foreignKey':'VariableId'});db[_0x3018('0xc3')]['hasMany'](db[_0x3018('0xc5')],{'as':_0x3018('0x1bb'),'onDelete':'cascade','foreignKey':_0x3018('0x1c0')});db[_0x3018('0xc3')][_0x3018('0x120')](db['CloudProvider'],{'as':_0x3018('0x106'),'foreignKey':'CloudProviderId'});db[_0x3018('0xc5')][_0x3018('0x111')](db['Dynamics365Field'],{'as':_0x3018('0x1bd'),'onDelete':'cascade','foreignKey':_0x3018('0x1be')});db[_0x3018('0xc5')][_0x3018('0x111')](db[_0x3018('0x1ce')],{'as':_0x3018('0x1c8'),'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1bf')});db[_0x3018('0xc5')]['hasMany'](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c1')});db[_0x3018('0xc5')][_0x3018('0x120')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x3018('0x1c0')});db[_0x3018('0x1ce')][_0x3018('0x111')](db[_0x3018('0x1ce')],{'as':'Subject','foreignKey':_0x3018('0x1be')});db[_0x3018('0x1ce')][_0x3018('0x111')](db[_0x3018('0x1ce')],{'as':_0x3018('0x1c5'),'foreignKey':_0x3018('0x1bf')});db[_0x3018('0x1ce')][_0x3018('0x111')](db[_0x3018('0x1ce')],{'as':_0x3018('0x1ca'),'foreignKey':'FieldId'});db[_0x3018('0x1ce')]['belongsTo'](db['Variable'],{'as':_0x3018('0x90'),'foreignKey':'VariableId'});db[_0x3018('0x1cf')]['hasMany'](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1c0')});db[_0x3018('0xc8')][_0x3018('0x111')](db[_0x3018('0xc9')],{'as':_0x3018('0x1bd'),'foreignKey':_0x3018('0x1be')});db['FreshsalesConfiguration'][_0x3018('0x111')](db[_0x3018('0xc9')],{'as':'Descriptions','foreignKey':_0x3018('0x1bf')});db[_0x3018('0xc8')][_0x3018('0x111')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x3018('0x1c1')});db['FreshsalesConfiguration'][_0x3018('0x120')](db[_0x3018('0x1cf')],{'as':'Account','foreignKey':'AccountId'});db[_0x3018('0xc9')][_0x3018('0x111')](db[_0x3018('0xc9')],{'as':_0x3018('0x1c4'),'foreignKey':_0x3018('0x1be')});db[_0x3018('0xc9')][_0x3018('0x111')](db[_0x3018('0xc9')],{'as':_0x3018('0x1c5'),'foreignKey':'DescriptionId'});db[_0x3018('0xc9')][_0x3018('0x111')](db[_0x3018('0xc9')],{'as':'Field','foreignKey':_0x3018('0x1c1')});db[_0x3018('0xc9')][_0x3018('0x120')](db[_0x3018('0x90')],{'as':_0x3018('0x90'),'foreignKey':_0x3018('0x1c2')});db[_0x3018('0xcc')][_0x3018('0x120')](db[_0x3018('0x136')],{});db[_0x3018('0xcc')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':'ListId'});db[_0x3018('0xcc')][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':_0x3018('0x16b'),'foreignKey':_0x3018('0x15c')});db['ChatQueueReport'][_0x3018('0x120')](db['ChatInteraction'],{});db['ChatQueueReport']['belongsTo'](db[_0x3018('0x66')],{});db[_0x3018('0xcc')][_0x3018('0x120')](db[_0x3018('0x13')],{});db['ChatQueueReport'][_0x3018('0x120')](db[_0x3018('0x12f')],{});db['ChatInternalMessage'][_0x3018('0x120')](db[_0x3018('0x13')],{'onDelete':'cascade','foreignKey':_0x3018('0x1d0')});db[_0x3018('0x191')][_0x3018('0x120')](db['User'],{'onDelete':_0x3018('0x110'),'foreignKey':_0x3018('0x1d1')});db[_0x3018('0xd2')][_0x3018('0x111')](db[_0x3018('0xd0')],{'foreignKey':'SessionId','onDelete':_0x3018('0x110')});db[_0x3018('0xd2')][_0x3018('0x111')](db[_0x3018('0x1d2')],{'foreignKey':_0x3018('0x1d3'),'onDelete':'cascade'});db[_0x3018('0xd4')][_0x3018('0x120')](db[_0x3018('0x52')],{});db[_0x3018('0xd4')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':'ListId'});db['SmsQueueReport'][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':_0x3018('0x16b'),'foreignKey':_0x3018('0x15c')});db[_0x3018('0xd4')][_0x3018('0x120')](db[_0x3018('0x55')],{});db[_0x3018('0xd4')][_0x3018('0x120')](db[_0x3018('0x57')],{});db[_0x3018('0xd4')][_0x3018('0x120')](db[_0x3018('0x13')],{});db[_0x3018('0xd4')][_0x3018('0x120')](db['SmsQueue'],{});db[_0x3018('0xda')][_0x3018('0x111')](db[_0x3018('0xd2')],{'foreignKey':_0x3018('0x1d4')});db[_0x3018('0xda')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x3018('0x1d4')});db[_0x3018('0xda')]['hasMany'](db[_0x3018('0x1d2')],{'foreignKey':_0x3018('0x1d4')});db[_0x3018('0xe3')][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x151'),'through':_0x3018('0x127')});db[_0x3018('0xe3')]['belongsToMany'](db['VoiceQueue'],{'through':_0x3018('0x1d5'),'as':'VoiceQueues'});db[_0x3018('0xe3')]['belongsToMany'](db[_0x3018('0x3d')],{'through':_0x3018('0x168'),'as':_0x3018('0x12e')});db[_0x3018('0xe3')][_0x3018('0x123')](db[_0x3018('0x12f')],{'through':_0x3018('0x1d6'),'as':_0x3018('0x130')});db['Team'][_0x3018('0x123')](db[_0x3018('0x4f')],{'through':_0x3018('0x1d7'),'as':_0x3018('0x131')});db[_0x3018('0xe3')][_0x3018('0x123')](db[_0x3018('0x58')],{'through':_0x3018('0x180'),'as':_0x3018('0x132')});db['Team']['belongsToMany'](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x3018('0x133')});db[_0x3018('0xe3')]['belongsToMany'](db['WhatsappQueue'],{'through':_0x3018('0x1d8'),'as':_0x3018('0x135')});db[_0x3018('0xe3')][_0x3018('0x123')](db[_0x3018('0xf2')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0x3018('0xe4')][_0x3018('0x111')](db['CmHopper'],{'as':_0x3018('0x11e'),'foreignKey':_0x3018('0x19a')});db[_0x3018('0xe4')][_0x3018('0x111')](db[_0x3018('0x71')],{'as':_0x3018('0x114'),'foreignKey':_0x3018('0x19a')});db['Campaign'][_0x3018('0x111')](db[_0x3018('0x73')],{'as':_0x3018('0x146'),'foreignKey':_0x3018('0x19a')});db[_0x3018('0xe4')][_0x3018('0x111')](db[_0x3018('0x6f')],{'as':'HopperBlacks','foreignKey':_0x3018('0x19a')});db[_0x3018('0xe4')]['belongsTo'](db[_0x3018('0x2b')],{'as':_0x3018('0x2b'),'foreignKey':'TrunkId'});db[_0x3018('0xe4')][_0x3018('0x120')](db['Trunk'],{'as':_0x3018('0x149'),'foreignKey':_0x3018('0x14a')});db[_0x3018('0xe4')][_0x3018('0x120')](db[_0x3018('0x14b')],{'as':_0x3018('0x14b'),'foreignKey':_0x3018('0x14c')});db[_0x3018('0xe4')][_0x3018('0x120')](db[_0x3018('0xde')],{'as':_0x3018('0xde'),'foreignKey':_0x3018('0x1d9')});db[_0x3018('0xe4')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0x3018('0x1da')});db['Campaign'][_0x3018('0x123')](db[_0x3018('0xf0')],{'as':_0x3018('0x153'),'through':_0x3018('0x1db')});db['Attachment'][_0x3018('0x120')](db['ChatOfflineMessage'],{'as':_0x3018('0x190'),'foreignKey':_0x3018('0x174')});db[_0x3018('0xeb')][_0x3018('0x120')](db['MailMessage'],{});db[_0x3018('0xeb')][_0x3018('0x120')](db[_0x3018('0x40')],{});db[_0x3018('0xeb')][_0x3018('0x120')](db[_0x3018('0x3b')],{'foreignKey':_0x3018('0x1dc'),'as':'FromAccount'});db[_0x3018('0xeb')][_0x3018('0x120')](db['User'],{'foreignKey':_0x3018('0x1dd'),'as':_0x3018('0x1de')});db[_0x3018('0xeb')][_0x3018('0x120')](db[_0x3018('0x13')],{'foreignKey':_0x3018('0x1df'),'as':_0x3018('0x1e0')});db[_0x3018('0xeb')][_0x3018('0x120')](db[_0x3018('0x3d')],{'foreignKey':_0x3018('0x1e1'),'as':'ToQueue'});db[_0x3018('0xeb')][_0x3018('0x120')](db[_0x3018('0x3b')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db['ChatTransferReport'][_0x3018('0x120')](db[_0x3018('0x66')],{});db[_0x3018('0x1e2')][_0x3018('0x120')](db[_0x3018('0x64')],{});db[_0x3018('0x1e2')][_0x3018('0x120')](db[_0x3018('0x136')],{'foreignKey':_0x3018('0x1e3'),'as':'FromAccount'});db[_0x3018('0x1e2')]['belongsTo'](db[_0x3018('0x13')],{'foreignKey':'FromUserId','as':_0x3018('0x1de')});db['ChatTransferReport'][_0x3018('0x120')](db[_0x3018('0x13')],{'foreignKey':_0x3018('0x1df'),'as':'ToAgent'});db[_0x3018('0x1e2')][_0x3018('0x120')](db[_0x3018('0x12f')],{'foreignKey':_0x3018('0x1e4'),'as':_0x3018('0x1e5')});db[_0x3018('0x1e2')][_0x3018('0x120')](db[_0x3018('0x136')],{'foreignKey':'ToChatWebsiteId','as':_0x3018('0x1e6')});db[_0x3018('0x1e7')][_0x3018('0x120')](db[_0x3018('0x4e')],{});db[_0x3018('0x1e7')]['belongsTo'](db['FaxInteraction'],{});db[_0x3018('0x1e7')][_0x3018('0x120')](db[_0x3018('0x49')],{'foreignKey':_0x3018('0x1e8'),'as':_0x3018('0x1e9')});db[_0x3018('0x1e7')][_0x3018('0x120')](db[_0x3018('0x13')],{'foreignKey':_0x3018('0x1dd'),'as':'FromAgent'});db[_0x3018('0x1e7')][_0x3018('0x120')](db[_0x3018('0x13')],{'foreignKey':_0x3018('0x1df'),'as':_0x3018('0x1e0')});db[_0x3018('0x1e7')][_0x3018('0x120')](db['FaxQueue'],{'foreignKey':_0x3018('0x1ea'),'as':_0x3018('0x1e5')});db[_0x3018('0x1e7')][_0x3018('0x120')](db[_0x3018('0x49')],{'foreignKey':_0x3018('0x1eb'),'as':_0x3018('0x1e6')});db['OpenchannelTransferReport'][_0x3018('0x120')](db[_0x3018('0x184')],{});db[_0x3018('0x1ec')][_0x3018('0x120')](db['OpenchannelInteraction'],{});db[_0x3018('0x1ec')][_0x3018('0x120')](db[_0x3018('0x5a')],{'foreignKey':_0x3018('0x1ed'),'as':_0x3018('0x1e9')});db['OpenchannelTransferReport'][_0x3018('0x120')](db[_0x3018('0x13')],{'foreignKey':_0x3018('0x1dd'),'as':_0x3018('0x1de')});db[_0x3018('0x1ec')]['belongsTo'](db['User'],{'foreignKey':_0x3018('0x1df'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0x3018('0x120')](db[_0x3018('0x60')],{'foreignKey':_0x3018('0x1ee'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0x3018('0x120')](db[_0x3018('0x5a')],{'foreignKey':'ToOpenchannelAccountId','as':_0x3018('0x1e6')});db['SmsTransferReport']['belongsTo'](db[_0x3018('0x57')],{});db[_0x3018('0xee')][_0x3018('0x120')](db['SmsInteraction'],{});db[_0x3018('0xee')][_0x3018('0x120')](db[_0x3018('0x52')],{'foreignKey':_0x3018('0x1ef'),'as':_0x3018('0x1e9')});db[_0x3018('0xee')][_0x3018('0x120')](db[_0x3018('0x13')],{'foreignKey':'FromUserId','as':_0x3018('0x1de')});db['SmsTransferReport'][_0x3018('0x120')](db[_0x3018('0x13')],{'foreignKey':_0x3018('0x1df'),'as':'ToAgent'});db['SmsTransferReport'][_0x3018('0x120')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x3018('0xee')]['belongsTo'](db[_0x3018('0x52')],{'foreignKey':'ToSmsAccountId','as':_0x3018('0x1e6')});db[_0x3018('0xf0')][_0x3018('0x111')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x3018('0x166'),'onDelete':_0x3018('0x110')});db[_0x3018('0xf0')][_0x3018('0x111')](db['CmCustomField'],{'as':_0x3018('0x1f0'),'foreignKey':_0x3018('0x166')});db[_0x3018('0xf0')]['hasMany'](db['CmContact'],{'as':_0x3018('0x124'),'onDelete':'cascade','foreignKey':'ListId'});db[_0x3018('0xf0')][_0x3018('0x111')](db['CmHopperFinal'],{'as':_0x3018('0x114'),'foreignKey':_0x3018('0x166')});db['CmList']['hasMany'](db[_0x3018('0x73')],{'as':_0x3018('0x1f1'),'foreignKey':'ListId'});db[_0x3018('0xf0')][_0x3018('0x111')](db[_0x3018('0x75')],{'as':_0x3018('0x75'),'foreignKey':'ListId'});db[_0x3018('0xf0')][_0x3018('0x123')](db['VoiceQueue'],{'as':_0x3018('0x1f2'),'through':_0x3018('0x150')});db[_0x3018('0xf0')][_0x3018('0x123')](db[_0x3018('0x13')],{'as':_0x3018('0x151'),'through':_0x3018('0x126')});db[_0x3018('0xf2')][_0x3018('0x111')](db['VoiceExtension'],{'as':_0x3018('0x113'),'onDelete':_0x3018('0x110')});db[_0x3018('0xf2')]['belongsToMany'](db[_0x3018('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0x3018('0xf2')][_0x3018('0x123')](db['Team'],{'through':_0x3018('0x1f3'),'as':_0x3018('0x152')});db['UserProfile'][_0x3018('0x111')](db[_0x3018('0x13')],{'as':_0x3018('0x170'),'foreignKey':'userProfileId'});db['UserProfile'][_0x3018('0x111')](db[_0x3018('0x1f4')],{'as':_0x3018('0x1f5'),'foreignKey':_0x3018('0x121'),'onDelete':_0x3018('0x110')});db['UserProfileSection']['hasMany'](db[_0x3018('0xf7')],{'as':_0x3018('0x1f6'),'foreignKey':'sectionId','onDelete':_0x3018('0x110')});db[_0x3018('0xfb')]['hasMany'](db[_0x3018('0x7d')],{'as':_0x3018('0x163'),'foreignKey':_0x3018('0x1f7'),'onDelete':'cascade'});db[_0x3018('0xfb')][_0x3018('0x111')](db[_0x3018('0x7c')],{'as':'Answers','foreignKey':_0x3018('0x1f7')});db['WhatsappAccount']['hasMany'](db[_0x3018('0x100')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0x3018('0xfb')][_0x3018('0x111')](db[_0x3018('0x11a')],{'as':_0x3018('0x164')});db['WhatsappAccount'][_0x3018('0x111')](db[_0x3018('0xfd')],{'as':'Applications','foreignKey':_0x3018('0x1f7'),'onDelete':_0x3018('0x110')});db[_0x3018('0xfb')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':_0x3018('0x166')});db[_0x3018('0xfb')]['belongsTo'](db[_0x3018('0x82')],{'as':_0x3018('0x14d'),'foreignKey':_0x3018('0x14e')});db[_0x3018('0xfb')]['belongsToMany'](db[_0x3018('0x13')],{'as':_0x3018('0x151'),'through':_0x3018('0x1f8')});db[_0x3018('0xfd')][_0x3018('0x120')](db[_0x3018('0x13')],{'onDelete':_0x3018('0x160')});db[_0x3018('0xfd')][_0x3018('0x120')](db[_0x3018('0x104')],{'onDelete':_0x3018('0x160')});db['WhatsappApplication'][_0x3018('0x120')](db['WhatsappAccount'],{'onDelete':_0x3018('0x160')});db['WhatsappApplication'][_0x3018('0x120')](db[_0x3018('0x14b')],{'onDelete':_0x3018('0x160'),'foreignKey':_0x3018('0x14c')});db['WhatsappApplication'][_0x3018('0x120')](db[_0x3018('0x87')],{'onDelete':_0x3018('0x160'),'foreignKey':'TagId'});db[_0x3018('0x11a')][_0x3018('0x111')](db['WhatsappMessage'],{'as':_0x3018('0x155'),'onDelete':_0x3018('0x110'),'foreignKey':'WhatsappInteractionId'});db[_0x3018('0x11a')][_0x3018('0x120')](db[_0x3018('0xfb')],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x1f7')});db[_0x3018('0x11a')][_0x3018('0x120')](db['CmContact'],{'as':'Contact','foreignKey':_0x3018('0x15c')});db[_0x3018('0x11a')][_0x3018('0x120')](db[_0x3018('0x13')],{'as':'Owner','foreignKey':_0x3018('0x10e')});db[_0x3018('0x11a')][_0x3018('0x123')](db[_0x3018('0x87')],{'through':'whatsapp_interaction_has_tags','as':_0x3018('0x16e')});db[_0x3018('0x11a')]['belongsToMany'](db[_0x3018('0x87')],{'through':_0x3018('0x1ab'),'as':_0x3018('0x16f')});db[_0x3018('0x11a')][_0x3018('0x123')](db['User'],{'as':_0x3018('0x170'),'through':_0x3018('0x1f9'),'foreignKey':_0x3018('0x1fa')});db[_0x3018('0x100')][_0x3018('0x120')](db[_0x3018('0x13')],{'as':_0x3018('0x13')});db[_0x3018('0x100')][_0x3018('0x120')](db[_0x3018('0x15b')],{'onDelete':_0x3018('0x110'),'as':_0x3018('0x16b')});db[_0x3018('0x100')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x3018('0x1fa')});db['WhatsappMessage'][_0x3018('0x120')](db['WhatsappAccount'],{'as':_0x3018('0x16a'),'foreignKey':_0x3018('0x1f7')});db[_0x3018('0x102')][_0x3018('0x120')](db[_0x3018('0xfb')],{});db[_0x3018('0x102')][_0x3018('0x120')](db[_0x3018('0xf0')],{'as':_0x3018('0x165'),'foreignKey':_0x3018('0x166')});db[_0x3018('0x102')][_0x3018('0x120')](db[_0x3018('0x15b')],{'as':'Contact','foreignKey':_0x3018('0x15c')});db[_0x3018('0x102')][_0x3018('0x120')](db['WhatsappInteraction'],{});db[_0x3018('0x102')][_0x3018('0x120')](db[_0x3018('0x104')],{});db['WhatsappQueueReport'][_0x3018('0x120')](db['WhatsappMessage'],{});db[_0x3018('0x102')][_0x3018('0x120')](db[_0x3018('0x13')],{});db['WhatsappTransferReport'][_0x3018('0x120')](db[_0x3018('0x100')],{});db[_0x3018('0x1fb')]['belongsTo'](db['WhatsappInteraction'],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0x3018('0x1e9')});db[_0x3018('0x1fb')][_0x3018('0x120')](db[_0x3018('0xfb')],{'foreignKey':_0x3018('0x1fc'),'as':_0x3018('0x1e6')});db[_0x3018('0x1fb')]['belongsTo'](db[_0x3018('0x104')],{'foreignKey':_0x3018('0x1fd'),'as':_0x3018('0x1e5')});db[_0x3018('0x1fb')][_0x3018('0x120')](db[_0x3018('0x13')],{'foreignKey':_0x3018('0x1dd'),'as':_0x3018('0x1de')});db[_0x3018('0x1fb')]['belongsTo'](db[_0x3018('0x13')],{'foreignKey':_0x3018('0x1df'),'as':'ToAgent'});db[_0x3018('0x104')][_0x3018('0x123')](db[_0x3018('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0x3018('0x1fe')});db[_0x3018('0x104')][_0x3018('0x123')](db[_0x3018('0xe3')],{'through':_0x3018('0x1d8'),'as':_0x3018('0x152')});db[_0x3018('0x10c')][_0x3018('0x120')](db[_0x3018('0x13')],{'as':_0x3018('0x1ff'),'foreignKey':_0x3018('0x10e'),'onDelete':'cascade','hooks':!![]});db[_0x3018('0x106')][_0x3018('0x10d')](db['Dynamics365Account'],{'as':_0x3018('0xc3'),'onDelete':_0x3018('0x160')});db[_0x3018('0x106')]['hasOne'](db[_0x3018('0x15d')],{'as':_0x3018('0x200'),'onDelete':_0x3018('0x160')});db[_0x3018('0x106')]['hasOne'](db[_0x3018('0x161')],{'as':_0x3018('0x162'),'onDelete':_0x3018('0x160')});module[_0x3018('0x201')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x90b2=['ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','UserSetting','User','hasOne','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','cascade','HopperFinals','CmHopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','WhatsappInteractions','UserNotification','UserNotifications','SenderId','Hoppers','SET\x20NULL','belongsToMany','ChatGroup','Groups','cm_user_has_contacts','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','UserOpenchannelQueue','WhatsappQueues','cm_user_has_lists','ChatWebsite','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkBackup','TrunkBackupId','belongsTo','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','BlackLists','VoiceMailMessage','Messages','mailboxuser','mailbox','uniqueid','AgentReports','CmContact','Contact','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','Smtp','Answers','ListId','team_has_mail_queues','Teams','Account','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','List','Items','Dispositions','FaxAccountId','Interactions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','Tags','AttachmentId','SmsAccountId','SmsMessage','SmsApplication','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','Attachment','team_has_openchannel_queues','ChatApplication','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessage','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','Phones','FaxInteractions','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Action','AutomationId','ParentId','Extensions','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','VariableId','DeskAccount','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowAccount','FreshsalesField','FromId','JscriptyQuestionReport','SessionId','ProjectId','team_has_fax_queues','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToAgent','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','HopperHistory','Queues','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','exports','../config/environment','determine','sequelize','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','utf8','username','password','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model'];(function(_0x19f991,_0x542544){var _0x1e09d5=function(_0x4113aa){while(--_0x4113aa){_0x19f991['push'](_0x19f991['shift']());}};_0x1e09d5(++_0x542544);}(_0x90b2,0x14c));var _0x290b=function(_0x44e08d,_0x8cb7bc){_0x44e08d=_0x44e08d-0x0;var _0x1763b6=_0x90b2[_0x44e08d];return _0x1763b6;};'use strict';var config=require(_0x290b('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0x290b('0x1')]();config[_0x290b('0x2')]=_[_0x290b('0x3')](config['sequelize'],{'database':'motion2','username':_0x290b('0x4'),'password':_0x290b('0x5'),'options':{'host':_0x290b('0x6'),'port':0xcea,'dialect':_0x290b('0x7'),'dialectOptions':{'charset':_0x290b('0x8')},'logging':![],'timezone':timezone[_0x290b('0x9')](),'define':{'charset':'utf8','collate':_0x290b('0xa')}}});config[_0x290b('0xb')]=_[_0x290b('0x3')](config[_0x290b('0xb')],{'database':'motion2','username':_0x290b('0x4'),'password':_0x290b('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x290b('0x9')](),'define':{'charset':_0x290b('0xc'),'collate':_0x290b('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config['sequelize'][_0x290b('0xd')],config[_0x290b('0x2')]['password'],config[_0x290b('0x2')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0x290b('0xb')][_0x290b('0xd')],config[_0x290b('0xb')][_0x290b('0xe')],config[_0x290b('0xb')][_0x290b('0xf')])};db['User']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x11'));db[_0x290b('0x12')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x13'));db[_0x290b('0x14')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x15'));db['VoiceExtension']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x16'));db[_0x290b('0x17')]=db[_0x290b('0x2')]['import'](_0x290b('0x18'));db[_0x290b('0x19')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/voiceQueue/voiceQueue.model');db[_0x290b('0x1a')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x1b'));db[_0x290b('0x1c')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x1d'));db[_0x290b('0x1e')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x1f'));db['VoiceMailMessage']=db['sequelize'][_0x290b('0x10')](_0x290b('0x20'));db[_0x290b('0x21')]=db[_0x290b('0x2')]['import']('../api/voiceCallReport/voiceCallReport.model');db[_0x290b('0x22')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x23'));db[_0x290b('0x24')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x25'));db[_0x290b('0x26')]=db[_0x290b('0x2')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x290b('0x27')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x28'));db[_0x290b('0x29')]=db[_0x290b('0x2')]['import']('../api/trunk/trunk.model');db[_0x290b('0x2a')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x2b'));db[_0x290b('0x2c')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x2d'));db[_0x290b('0x2e')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x2f'));db[_0x290b('0x30')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x31'));db[_0x290b('0x32')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x33'));db[_0x290b('0x34')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x35'));db['UserSmsQueue']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x36'));db['UserOpenchannelQueue']=db['sequelize'][_0x290b('0x10')](_0x290b('0x37'));db[_0x290b('0x38')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x39'));db[_0x290b('0x3a')]=db[_0x290b('0x2')]['import']('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db['sequelize'][_0x290b('0x10')](_0x290b('0x3b'));db[_0x290b('0x3c')]=db[_0x290b('0x2')]['import'](_0x290b('0x3d'));db[_0x290b('0x3e')]=db[_0x290b('0x2')]['import'](_0x290b('0x3f'));db['MailSubstatus']=db[_0x290b('0x2')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0x290b('0x40')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x41'));db[_0x290b('0x42')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/mailMessage/mailMessage.model');db[_0x290b('0x43')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x44'));db[_0x290b('0x45')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x46'));db[_0x290b('0x47')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x48'));db[_0x290b('0x49')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x4a'));db[_0x290b('0x4b')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x4c'));db[_0x290b('0x4d')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x4e'));db['FaxInteraction']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x4f'));db['FaxMessage']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x50'));db[_0x290b('0x51')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x52'));db[_0x290b('0x53')]=db['sequelize']['import'](_0x290b('0x54'));db[_0x290b('0x55')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x56'));db['SmsApplication']=db[_0x290b('0x2')]['import']('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x57'));db['SmsMessage']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x58'));db[_0x290b('0x59')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/smsQueue/smsQueue.model');db[_0x290b('0x5a')]=db['sequelize'][_0x290b('0x10')]('../api/openchannelAccount/openchannelAccount.model');db[_0x290b('0x5b')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x5c'));db[_0x290b('0x5d')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x290b('0x5e')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x5f'));db[_0x290b('0x60')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x61'));db['ChatWebsite']=db[_0x290b('0x2')][_0x290b('0x10')]('../api/chatWebsite/chatWebsite.model');db[_0x290b('0x62')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x63'));db[_0x290b('0x64')]=db['sequelize']['import'](_0x290b('0x65'));db[_0x290b('0x66')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x67'));db['ChatOfflineMessage']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x68'));db['ChatQueue']=db[_0x290b('0x2')]['import'](_0x290b('0x69'));db['ChatGroup']=db['sequelize'][_0x290b('0x10')](_0x290b('0x6a'));db[_0x290b('0x6b')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x6c'));db[_0x290b('0x6d')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x6e'));db['CmContact']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x6f'));db[_0x290b('0x70')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/cmHopper/cmHopper.model');db[_0x290b('0x71')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x72'));db[_0x290b('0x73')]=db['sequelize']['import'](_0x290b('0x74'));db['CmHopperHistory']=db['sequelize'][_0x290b('0x10')](_0x290b('0x75'));db['ReportAgentPreview']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x76'));db[_0x290b('0x77')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x78'));db['Action']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x79'));db[_0x290b('0x7a')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x7b'));db[_0x290b('0x7c')]=db[_0x290b('0x2')]['import'](_0x290b('0x7d'));db[_0x290b('0x7e')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/disposition/disposition.model');db[_0x290b('0x7f')]=db[_0x290b('0x2')]['import'](_0x290b('0x80'));db[_0x290b('0x81')]=db[_0x290b('0x2')]['import'](_0x290b('0x82'));db[_0x290b('0x83')]=db['sequelize'][_0x290b('0x10')]('../api/pause/pause.model');db['Cdr']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x84'));db[_0x290b('0x85')]=db[_0x290b('0x2')]['import'](_0x290b('0x86'));db[_0x290b('0x87')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x88'));db[_0x290b('0x89')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x8a'));db[_0x290b('0x8b')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/tag/tag.model');db[_0x290b('0x8c')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x8d'));db[_0x290b('0x8e')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x8f'));db['CmHopperAdditionalPhone']=db[_0x290b('0x2')]['import'](_0x290b('0x90'));db[_0x290b('0x91')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/template/template.model');db[_0x290b('0x92')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/trigger/trigger.model');db[_0x290b('0x93')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x94'));db[_0x290b('0x95')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x96'));db[_0x290b('0x97')]=db[_0x290b('0x2')]['import'](_0x290b('0x98'));db[_0x290b('0x99')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x9a'));db[_0x290b('0x9b')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x9c'));db['AnalyticExtractedReport']=db['sequelize'][_0x290b('0x10')](_0x290b('0x9d'));db['AnalyticMetric']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x9e'));db[_0x290b('0x9f')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xa0'));db[_0x290b('0xa1')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xa2'));db[_0x290b('0xa3')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xa4'));db[_0x290b('0xa5')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x290b('0xa6')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xa7'));db[_0x290b('0xa8')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xa9'));db[_0x290b('0xaa')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x290b('0xab')]=db['sequelize'][_0x290b('0x10')](_0x290b('0xac'));db['DeskAccount']=db['sequelize']['import'](_0x290b('0xad'));db[_0x290b('0xae')]=db['sequelize']['import'](_0x290b('0xaf'));db[_0x290b('0xb0')]=db[_0x290b('0x2')]['import']('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0x290b('0x2')]['import'](_0x290b('0xb1'));db['ZohoConfiguration']=db[_0x290b('0x2')]['import'](_0x290b('0xb2'));db[_0x290b('0xb3')]=db[_0x290b('0x2')]['import'](_0x290b('0xb4'));db[_0x290b('0xb5')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xb6'));db['ZendeskConfiguration']=db[_0x290b('0x2')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x290b('0xb7')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xb8'));db[_0x290b('0xb9')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xba'));db[_0x290b('0xbb')]=db['sequelize'][_0x290b('0x10')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x290b('0xbc')]=db['sequelize'][_0x290b('0x10')](_0x290b('0xbd'));db[_0x290b('0xbe')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x290b('0xbf')]=db['sequelize'][_0x290b('0x10')](_0x290b('0xc0'));db[_0x290b('0xc1')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xc2'));db['ServicenowAccount']=db['sequelize'][_0x290b('0x10')](_0x290b('0xc3'));db[_0x290b('0xc4')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xc5'));db[_0x290b('0xc6')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/intServicenowField/intServicenowField.model');db[_0x290b('0xc7')]=db['sequelize'][_0x290b('0x10')](_0x290b('0xc8'));db[_0x290b('0xc9')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xca'));db[_0x290b('0xcb')]=db[_0x290b('0x2')]['import'](_0x290b('0xcc'));db[_0x290b('0xcd')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xce'));db[_0x290b('0xcf')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xd0'));db['FreshsalesField']=db['sequelize']['import']('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x96'));db[_0x290b('0xd1')]=db[_0x290b('0x2')]['import'](_0x290b('0xd2'));db[_0x290b('0xd3')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xd4'));db[_0x290b('0xd5')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xd6'));db[_0x290b('0xd7')]=db['sequelize'][_0x290b('0x10')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0x290b('0x2')]['import'](_0x290b('0xd8'));db[_0x290b('0xd9')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xda'));db[_0x290b('0xdb')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xdc'));db[_0x290b('0xdd')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xde'));db[_0x290b('0xdf')]=db['sequelize']['import']('../api/squareReportDetail/squareReportDetail.model');db[_0x290b('0xe0')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xe1'));db['Setting']=db['sequelize']['import']('../api/setting/setting.model');db[_0x290b('0xe2')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xe3'));db[_0x290b('0xe4')]=db['sequelize'][_0x290b('0x10')](_0x290b('0xe5'));db['SquareRecording']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xe6'));db[_0x290b('0xe7')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xe8'));db['Team']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xe9'));db[_0x290b('0xea')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/license/license.model');db[_0x290b('0xeb')]=db[_0x290b('0x2')]['import'](_0x290b('0xec'));db['Migration']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xed'));db['Attachment']=db[_0x290b('0x2')]['import'](_0x290b('0xee'));db[_0x290b('0xef')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xf0'));db[_0x290b('0xf1')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xf2'));db['ChatTransferReport']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xf3'));db[_0x290b('0xf4')]=db['sequelize'][_0x290b('0x10')](_0x290b('0xf5'));db[_0x290b('0xf6')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xf7'));db[_0x290b('0xf8')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xf9'));db[_0x290b('0xfa')]=db['sequelize'][_0x290b('0x10')](_0x290b('0xfb'));db[_0x290b('0xfc')]=db[_0x290b('0x2')][_0x290b('0x10')]('../api/voicePrefix/voicePrefix.model');db[_0x290b('0xfd')]=db['sequelize'][_0x290b('0x10')](_0x290b('0xfe'));db['UserProfileSection']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0xff'));db[_0x290b('0x100')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x101'));db['UserNotification']=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x102'));db['WhatsappAccount']=db[_0x290b('0x2')]['import'](_0x290b('0x103'));db[_0x290b('0x104')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x105'));db[_0x290b('0x106')]=db['sequelize'][_0x290b('0x10')](_0x290b('0x107'));db[_0x290b('0x108')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x109'));db['WhatsappQueueReport']=db[_0x290b('0x2')][_0x290b('0x10')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0x290b('0x2')][_0x290b('0x10')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x290b('0x10a')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x10b'));db[_0x290b('0x10c')]=db[_0x290b('0x2')][_0x290b('0x10')](_0x290b('0x10d'));db['TeamVoiceQueue']=db[_0x290b('0x2')]['import'](_0x290b('0x10e'));db['TeamVoicePrefix']=db[_0x290b('0x2')][_0x290b('0x10')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x290b('0x10f')]=db[_0x290b('0x2')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x290b('0x110')]=db[_0x290b('0x2')]['import']('../api/user-setting/user-setting.model');db[_0x290b('0x111')][_0x290b('0x112')](db[_0x290b('0x1e')],{'as':_0x290b('0x1e'),'onDelete':'cascade','foreignKey':_0x290b('0x113')});db['User'][_0x290b('0x112')](db[_0x290b('0x110')],{'as':_0x290b('0x114'),'onDelete':'cascade','foreignKey':'UserId'});db['User'][_0x290b('0x115')](db[_0x290b('0x1a')],{'as':_0x290b('0x116'),'foreignKey':_0x290b('0x113')});db[_0x290b('0x111')][_0x290b('0x115')](db['UserVoiceQueueRt'],{'as':_0x290b('0x117'),'foreignKey':'UserId'});db[_0x290b('0x111')]['hasMany'](db[_0x290b('0x118')],{'as':'Extensions','onDelete':_0x290b('0x119'),'hooks':!![]});db[_0x290b('0x111')][_0x290b('0x115')](db[_0x290b('0x73')],{'as':_0x290b('0x11a'),'foreignKey':_0x290b('0x113')});db['User'][_0x290b('0x115')](db[_0x290b('0x11b')],{'as':'HopperHistory','foreignKey':_0x290b('0x113')});db[_0x290b('0x111')]['hasMany'](db[_0x290b('0x11c')],{'as':'ReportAgentPreview','foreignKey':_0x290b('0x113')});db[_0x290b('0x111')][_0x290b('0x115')](db[_0x290b('0x5d')],{'as':_0x290b('0x11d'),'foreignKey':_0x290b('0x113')});db['User']['hasMany'](db[_0x290b('0x64')],{'as':_0x290b('0x11e'),'foreignKey':_0x290b('0x113')});db['User'][_0x290b('0x115')](db['SmsInteraction'],{'as':_0x290b('0x11f'),'foreignKey':_0x290b('0x113')});db[_0x290b('0x111')][_0x290b('0x115')](db[_0x290b('0x120')],{'as':'FaxInteractions','foreignKey':_0x290b('0x113')});db['User']['hasMany'](db[_0x290b('0x40')],{'as':'MailInteractions','foreignKey':_0x290b('0x113')});db[_0x290b('0x111')][_0x290b('0x115')](db[_0x290b('0x106')],{'as':_0x290b('0x121'),'foreignKey':_0x290b('0x113')});db[_0x290b('0x111')][_0x290b('0x115')](db[_0x290b('0x122')],{'as':_0x290b('0x123'),'foreignKey':_0x290b('0x124')});db['User'][_0x290b('0x115')](db[_0x290b('0x70')],{'as':_0x290b('0x125'),'foreignKey':'UserId','onDelete':_0x290b('0x126')});db[_0x290b('0x111')]['belongsTo'](db[_0x290b('0xfd')],{'as':_0x290b('0xfd'),'foreignKey':'userProfileId'});db[_0x290b('0x111')][_0x290b('0x127')](db[_0x290b('0x128')],{'as':_0x290b('0x129'),'through':'chat_group_has_users'});db[_0x290b('0x111')][_0x290b('0x127')](db['CmContact'],{'as':'Contacts','through':_0x290b('0x12a')});db['User']['belongsToMany'](db[_0x290b('0xfa')],{'as':'Lists','through':'cm_user_has_lists'});db[_0x290b('0x111')][_0x290b('0x127')](db[_0x290b('0x12b')],{'through':_0x290b('0x12c')});db[_0x290b('0x111')][_0x290b('0x127')](db[_0x290b('0x40')],{'as':'MailInteractions','through':_0x290b('0x12d')});db['User']['belongsToMany'](db[_0x290b('0x64')],{'as':'ChatInteractions','through':_0x290b('0x12e')});db[_0x290b('0x111')][_0x290b('0x127')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0x290b('0x12f')});db[_0x290b('0x111')]['belongsToMany'](db[_0x290b('0x130')],{'as':_0x290b('0x11f'),'through':_0x290b('0x131')});db[_0x290b('0x111')][_0x290b('0x127')](db[_0x290b('0x5d')],{'as':_0x290b('0x11d'),'through':_0x290b('0x132')});db[_0x290b('0x111')][_0x290b('0x127')](db[_0x290b('0x106')],{'as':_0x290b('0x121'),'through':_0x290b('0x133')});db[_0x290b('0x111')][_0x290b('0x127')](db[_0x290b('0x19')],{'as':_0x290b('0x134'),'through':'UserVoiceQueue','required':![]});db[_0x290b('0x111')][_0x290b('0x127')](db['VoicePrefix'],{'as':_0x290b('0x135'),'through':'UserVoicePrefix','required':![]});db['User'][_0x290b('0x127')](db[_0x290b('0x3e')],{'as':_0x290b('0x136'),'through':_0x290b('0x32'),'required':![]});db['User']['belongsToMany'](db[_0x290b('0x137')],{'as':_0x290b('0x138'),'through':_0x290b('0x30'),'required':![],'hooks':!![]});db[_0x290b('0x111')][_0x290b('0x127')](db['FaxQueue'],{'as':_0x290b('0x139'),'through':_0x290b('0x34'),'required':![]});db[_0x290b('0x111')]['belongsToMany'](db[_0x290b('0x59')],{'as':_0x290b('0x13a'),'through':'UserSmsQueue','required':![]});db['User'][_0x290b('0x127')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x290b('0x13b'),'required':![]});db[_0x290b('0x111')][_0x290b('0x127')](db['WhatsappQueue'],{'as':_0x290b('0x13c'),'through':_0x290b('0x38'),'required':![]});db[_0x290b('0x111')][_0x290b('0x127')](db[_0x290b('0xfa')],{'through':_0x290b('0x13d')});db['User'][_0x290b('0x127')](db[_0x290b('0x13e')],{'as':_0x290b('0x13f'),'through':_0x290b('0x140')});db['User'][_0x290b('0x127')](db[_0x290b('0x4b')],{'as':'FaxAccounts','through':_0x290b('0x141')});db[_0x290b('0x111')]['belongsToMany'](db['MailAccount'],{'as':_0x290b('0x142'),'through':'user_has_mail_accounts'});db[_0x290b('0x111')]['belongsToMany'](db[_0x290b('0x5a')],{'as':_0x290b('0x143'),'through':_0x290b('0x144')});db['User'][_0x290b('0x127')](db[_0x290b('0x55')],{'as':_0x290b('0x145'),'through':_0x290b('0x146')});db[_0x290b('0x111')][_0x290b('0x127')](db[_0x290b('0x147')],{'as':_0x290b('0x148'),'through':_0x290b('0x149')});db[_0x290b('0x12')][_0x290b('0x115')](db[_0x290b('0x118')],{'as':_0x290b('0x14a'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x14b')});db[_0x290b('0x14')][_0x290b('0x115')](db[_0x290b('0x118')],{'onDelete':_0x290b('0x119')});db[_0x290b('0x118')]['hasMany'](db[_0x290b('0x118')],{'as':_0x290b('0x14c'),'onDelete':_0x290b('0x119')});db['VoiceMusicOnHold'][_0x290b('0x127')](db[_0x290b('0x89')],{'as':_0x290b('0x14d'),'through':_0x290b('0x14e')});db[_0x290b('0x19')][_0x290b('0x115')](db[_0x290b('0x2c')],{'as':_0x290b('0x14f'),'foreignKey':_0x290b('0x150')});db[_0x290b('0x19')][_0x290b('0x115')](db[_0x290b('0x70')],{'as':_0x290b('0x125'),'foreignKey':_0x290b('0x150')});db[_0x290b('0x19')][_0x290b('0x115')](db[_0x290b('0x73')],{'as':_0x290b('0x11a'),'foreignKey':_0x290b('0x150')});db[_0x290b('0x19')][_0x290b('0x115')](db[_0x290b('0x11b')],{'as':_0x290b('0x151'),'foreignKey':_0x290b('0x150')});db[_0x290b('0x19')][_0x290b('0x115')](db[_0x290b('0x11c')],{'as':_0x290b('0x11c'),'foreignKey':_0x290b('0x150')});db[_0x290b('0x19')][_0x290b('0x115')](db[_0x290b('0x71')],{'as':_0x290b('0x152'),'foreignKey':_0x290b('0x150')});db[_0x290b('0x19')][_0x290b('0x115')](db[_0x290b('0xd9')],{'as':_0x290b('0x153'),'foreignKey':_0x290b('0x150')});db['VoiceQueue']['belongsTo'](db[_0x290b('0x29')],{'as':_0x290b('0x29'),'foreignKey':'TrunkId'});db[_0x290b('0x19')]['belongsTo'](db[_0x290b('0x29')],{'as':_0x290b('0x154'),'foreignKey':_0x290b('0x155')});db[_0x290b('0x19')][_0x290b('0x156')](db['Interval'],{'as':'Interval','foreignKey':_0x290b('0x157')});db['VoiceQueue'][_0x290b('0x156')](db[_0x290b('0x83')],{'as':_0x290b('0x158'),'foreignKey':_0x290b('0x159')});db[_0x290b('0x19')][_0x290b('0x127')](db[_0x290b('0xfa')],{'as':_0x290b('0x15a'),'through':_0x290b('0x15b')});db[_0x290b('0x19')][_0x290b('0x127')](db['User'],{'as':_0x290b('0x15c'),'through':_0x290b('0x2e')});db[_0x290b('0x19')][_0x290b('0x127')](db[_0x290b('0x12b')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0x290b('0x19')][_0x290b('0x127')](db[_0x290b('0xfa')],{'as':_0x290b('0x15d'),'through':'voice_queues_has_cm_blacklists'});db[_0x290b('0x1a')][_0x290b('0x156')](db[_0x290b('0x111')],{'as':_0x290b('0x111'),'foreignKey':_0x290b('0x113')});db[_0x290b('0x1c')]['belongsTo'](db[_0x290b('0x111')],{'as':_0x290b('0x111'),'foreignKey':_0x290b('0x113')});db[_0x290b('0x1e')]['hasMany'](db[_0x290b('0x15e')],{'as':_0x290b('0x15f'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x160'),'sourceKey':_0x290b('0x161')});db[_0x290b('0x15e')][_0x290b('0x156')](db['VoiceMail'],{'foreignKey':_0x290b('0x160'),'targetKey':_0x290b('0x161')});db[_0x290b('0x21')][_0x290b('0x115')](db[_0x290b('0x26')],{'as':'QueueCalls','foreignKey':_0x290b('0x162'),'constraints':![]});db[_0x290b('0x21')][_0x290b('0x115')](db[_0x290b('0x24')],{'as':_0x290b('0x163'),'foreignKey':'uniqueid','constraints':![]});db[_0x290b('0x21')][_0x290b('0x156')](db[_0x290b('0x111')],{'as':_0x290b('0x111'),'foreignKey':_0x290b('0x113')});db['VoiceCallReport']['belongsTo'](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db['MailServerIn'][_0x290b('0x156')](db[_0x290b('0x3c')],{'as':_0x290b('0x3c'),'foreignKey':_0x290b('0x167')});db['MailServerIn']['belongsTo'](db[_0x290b('0x10c')],{'as':'CloudProvider','foreignKey':_0x290b('0x168'),'onDelete':_0x290b('0x169')});db[_0x290b('0x16a')][_0x290b('0x156')](db[_0x290b('0x3c')],{'as':'MailAccount','foreignKey':_0x290b('0x167')});db[_0x290b('0x16a')][_0x290b('0x156')](db[_0x290b('0x10c')],{'as':_0x290b('0x10c'),'foreignKey':_0x290b('0x168'),'onDelete':_0x290b('0x169')});db['MailAccount'][_0x290b('0x112')](db['MailServerIn'],{'as':_0x290b('0x16b'),'onDelete':_0x290b('0x119')});db[_0x290b('0x3c')][_0x290b('0x112')](db['MailServerOut'],{'as':_0x290b('0x16c'),'onDelete':_0x290b('0x119')});db[_0x290b('0x3c')][_0x290b('0x115')](db['Disposition'],{'as':'Dispositions','foreignKey':'MailAccountId','onDelete':_0x290b('0x119')});db['MailAccount'][_0x290b('0x115')](db[_0x290b('0x7c')],{'as':_0x290b('0x16d'),'foreignKey':_0x290b('0x167')});db[_0x290b('0x3c')][_0x290b('0x115')](db[_0x290b('0x42')],{'as':_0x290b('0x15f'),'foreignKey':_0x290b('0x167')});db['MailAccount'][_0x290b('0x115')](db[_0x290b('0x40')],{'as':'Interactions'});db['MailAccount'][_0x290b('0x115')](db[_0x290b('0x43')],{'as':_0x290b('0x14c'),'foreignKey':'MailAccountId','onDelete':_0x290b('0x119')});db[_0x290b('0x3c')][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':'List','foreignKey':_0x290b('0x16e')});db[_0x290b('0x3c')][_0x290b('0x156')](db[_0x290b('0x91')],{'as':_0x290b('0x91'),'foreignKey':'TemplateId'});db[_0x290b('0x3c')][_0x290b('0x156')](db[_0x290b('0x83')],{'as':_0x290b('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x290b('0x3c')]['belongsToMany'](db['User'],{'as':_0x290b('0x15c'),'through':'user_has_mail_accounts'});db['MailQueue'][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x15c'),'through':'UserMailQueue'});db['MailQueue'][_0x290b('0x127')](db['Team'],{'through':_0x290b('0x16f'),'as':_0x290b('0x170')});db[_0x290b('0x40')][_0x290b('0x115')](db[_0x290b('0x42')],{'as':_0x290b('0x15f'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x290b('0x40')][_0x290b('0x156')](db['MailAccount'],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x167')});db[_0x290b('0x40')][_0x290b('0x156')](db['CmContact'],{'as':_0x290b('0x165'),'foreignKey':'ContactId'});db[_0x290b('0x40')][_0x290b('0x156')](db[_0x290b('0x111')],{'as':_0x290b('0x172'),'foreignKey':'UserId'});db['MailInteraction'][_0x290b('0x127')](db[_0x290b('0x8b')],{'through':_0x290b('0x173'),'as':'Tags'});db[_0x290b('0x40')][_0x290b('0x127')](db['Tag'],{'through':_0x290b('0x173'),'as':_0x290b('0x174')});db[_0x290b('0x40')][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x175'),'through':_0x290b('0x12d'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x290b('0x115')](db['Attachment'],{'as':_0x290b('0x176'),'onDelete':_0x290b('0x119')});db[_0x290b('0x42')]['belongsTo'](db[_0x290b('0x111')],{'as':_0x290b('0x111')});db[_0x290b('0x42')]['belongsTo'](db[_0x290b('0x164')],{'onDelete':'cascade','as':_0x290b('0x165')});db[_0x290b('0x42')][_0x290b('0x156')](db[_0x290b('0x40')],{'as':_0x290b('0x177'),'foreignKey':'MailInteractionId'});db[_0x290b('0x42')][_0x290b('0x156')](db['MailAccount'],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x167')});db['MailMessage']['belongsTo'](db[_0x290b('0x13e')],{'as':_0x290b('0x13e'),'foreignKey':_0x290b('0x178')});db[_0x290b('0x42')][_0x290b('0x156')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x290b('0x179')});db[_0x290b('0x43')]['belongsTo'](db['User'],{'onDelete':_0x290b('0x169')});db[_0x290b('0x43')][_0x290b('0x156')](db[_0x290b('0x3e')],{'onDelete':_0x290b('0x169')});db[_0x290b('0x43')][_0x290b('0x156')](db['MailAccount'],{'onDelete':_0x290b('0x169')});db[_0x290b('0x43')][_0x290b('0x156')](db[_0x290b('0x81')],{'onDelete':_0x290b('0x169'),'foreignKey':'IntervalId'});db[_0x290b('0x43')]['belongsTo'](db[_0x290b('0x8b')],{'onDelete':'restrict','foreignKey':_0x290b('0x17a')});db[_0x290b('0x45')][_0x290b('0x156')](db['MailAccount'],{});db['MailQueueReport'][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':_0x290b('0x16e')});db[_0x290b('0x45')][_0x290b('0x156')](db['CmContact'],{'as':_0x290b('0x165'),'foreignKey':'ContactId'});db['MailQueueReport'][_0x290b('0x156')](db[_0x290b('0x40')],{});db[_0x290b('0x45')][_0x290b('0x156')](db[_0x290b('0x42')],{});db[_0x290b('0x45')]['belongsTo'](db[_0x290b('0x111')],{});db[_0x290b('0x45')][_0x290b('0x156')](db[_0x290b('0x3e')],{});db[_0x290b('0x47')][_0x290b('0x115')](db['DashboardItem'],{'as':_0x290b('0x17c'),'onDelete':_0x290b('0x119')});db[_0x290b('0x4b')][_0x290b('0x115')](db['Disposition'],{'as':_0x290b('0x17d'),'foreignKey':_0x290b('0x17e'),'onDelete':_0x290b('0x119')});db[_0x290b('0x4b')]['hasMany'](db[_0x290b('0x7c')],{'as':_0x290b('0x16d'),'foreignKey':_0x290b('0x17e')});db['FaxAccount'][_0x290b('0x115')](db[_0x290b('0x120')],{'as':_0x290b('0x17f')});db[_0x290b('0x4b')][_0x290b('0x115')](db[_0x290b('0x4d')],{'as':_0x290b('0x14c'),'foreignKey':_0x290b('0x17e'),'onDelete':_0x290b('0x119')});db['FaxAccount'][_0x290b('0x115')](db[_0x290b('0x118')],{'as':'Exntensions','onDelete':'cascade'});db[_0x290b('0x4b')]['hasMany'](db[_0x290b('0x180')],{'as':_0x290b('0x15f')});db[_0x290b('0x4b')][_0x290b('0x156')](db[_0x290b('0x29')],{'as':_0x290b('0x29')});db[_0x290b('0x4b')]['belongsTo'](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':_0x290b('0x16e')});db[_0x290b('0x4b')][_0x290b('0x156')](db[_0x290b('0x83')],{'as':_0x290b('0x158'),'foreignKey':_0x290b('0x159')});db[_0x290b('0x4b')][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x15c'),'through':_0x290b('0x141')});db[_0x290b('0x4d')][_0x290b('0x156')](db[_0x290b('0x111')],{'onDelete':_0x290b('0x169')});db[_0x290b('0x4d')][_0x290b('0x156')](db[_0x290b('0x51')],{'onDelete':_0x290b('0x169')});db[_0x290b('0x4d')][_0x290b('0x156')](db[_0x290b('0x4b')],{'onDelete':_0x290b('0x169')});db[_0x290b('0x4d')]['belongsTo'](db['Tag'],{'onDelete':_0x290b('0x169'),'foreignKey':_0x290b('0x17a')});db['FaxInteraction'][_0x290b('0x115')](db['FaxMessage'],{'as':_0x290b('0x15f'),'onDelete':'cascade','foreignKey':_0x290b('0x181')});db[_0x290b('0x120')][_0x290b('0x156')](db[_0x290b('0x4b')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x17e')});db[_0x290b('0x120')][_0x290b('0x156')](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0x120')][_0x290b('0x156')](db['User'],{'as':_0x290b('0x172'),'foreignKey':'UserId'});db[_0x290b('0x120')]['belongsToMany'](db['Tag'],{'through':_0x290b('0x182'),'as':_0x290b('0x183')});db[_0x290b('0x120')]['belongsToMany'](db[_0x290b('0x8b')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0x290b('0x120')][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x175'),'through':_0x290b('0x12f'),'foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db[_0x290b('0x111')],{'onDelete':_0x290b('0x119'),'as':_0x290b('0x111')});db[_0x290b('0x180')]['belongsTo'](db[_0x290b('0x120')],{'as':_0x290b('0x177'),'foreignKey':'FaxInteractionId'});db[_0x290b('0x180')][_0x290b('0x156')](db[_0x290b('0x164')],{'onDelete':_0x290b('0x119'),'as':_0x290b('0x165')});db[_0x290b('0x180')][_0x290b('0x156')](db['Attachment'],{'as':'Attachment','foreignKey':_0x290b('0x184')});db[_0x290b('0x180')][_0x290b('0x156')](db[_0x290b('0x4b')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x17e')});db[_0x290b('0x51')]['belongsToMany'](db['User'],{'as':_0x290b('0x15c'),'through':_0x290b('0x34')});db[_0x290b('0x51')][_0x290b('0x127')](db['Team'],{'through':'team_has_fax_queues','as':_0x290b('0x170')});db[_0x290b('0x53')][_0x290b('0x156')](db['FaxAccount'],{});db[_0x290b('0x53')][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':'List','foreignKey':'ListId'});db['FaxQueueReport'][_0x290b('0x156')](db['CmContact'],{'as':_0x290b('0x165'),'foreignKey':'ContactId'});db[_0x290b('0x53')][_0x290b('0x156')](db[_0x290b('0x120')],{});db[_0x290b('0x53')][_0x290b('0x156')](db[_0x290b('0x180')],{});db[_0x290b('0x53')][_0x290b('0x156')](db['User'],{});db[_0x290b('0x53')]['belongsTo'](db[_0x290b('0x51')],{});db[_0x290b('0x55')][_0x290b('0x115')](db[_0x290b('0x7e')],{'as':_0x290b('0x17d'),'foreignKey':_0x290b('0x185'),'onDelete':_0x290b('0x119')});db['SmsAccount']['hasMany'](db[_0x290b('0x7c')],{'as':_0x290b('0x16d'),'foreignKey':_0x290b('0x185')});db['SmsAccount']['hasMany'](db[_0x290b('0x186')],{'as':_0x290b('0x15f'),'foreignKey':_0x290b('0x185')});db[_0x290b('0x55')][_0x290b('0x115')](db[_0x290b('0x130')],{'as':_0x290b('0x17f')});db[_0x290b('0x55')][_0x290b('0x115')](db['SmsApplication'],{'as':'Applications','foreignKey':_0x290b('0x185'),'onDelete':'cascade'});db[_0x290b('0x55')]['belongsTo'](db[_0x290b('0xfa')],{'as':'List','foreignKey':'ListId'});db[_0x290b('0x55')][_0x290b('0x156')](db[_0x290b('0x83')],{'as':_0x290b('0x158'),'foreignKey':_0x290b('0x159')});db['SmsAccount'][_0x290b('0x127')](db[_0x290b('0x111')],{'as':'Agents','through':_0x290b('0x146')});db[_0x290b('0x187')][_0x290b('0x156')](db[_0x290b('0x111')],{'onDelete':'restrict'});db[_0x290b('0x187')][_0x290b('0x156')](db[_0x290b('0x59')],{'onDelete':'restrict'});db[_0x290b('0x187')][_0x290b('0x156')](db[_0x290b('0x55')],{'onDelete':_0x290b('0x169')});db[_0x290b('0x187')][_0x290b('0x156')](db[_0x290b('0x81')],{'onDelete':'restrict','foreignKey':_0x290b('0x157')});db[_0x290b('0x187')][_0x290b('0x156')](db['Tag'],{'onDelete':_0x290b('0x169'),'foreignKey':_0x290b('0x17a')});db[_0x290b('0x130')][_0x290b('0x115')](db[_0x290b('0x186')],{'as':_0x290b('0x15f'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x188')});db[_0x290b('0x130')]['belongsTo'](db['SmsAccount'],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x185')});db[_0x290b('0x130')]['belongsTo'](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0x130')][_0x290b('0x156')](db[_0x290b('0x111')],{'as':'Owner','foreignKey':_0x290b('0x113')});db['SmsInteraction'][_0x290b('0x127')](db[_0x290b('0x8b')],{'through':'sms_interaction_has_tags','as':_0x290b('0x183')});db[_0x290b('0x130')][_0x290b('0x127')](db[_0x290b('0x8b')],{'through':_0x290b('0x189'),'as':_0x290b('0x174')});db[_0x290b('0x130')][_0x290b('0x127')](db[_0x290b('0x111')],{'as':'Users','through':_0x290b('0x131'),'foreignKey':'SmsInteractionId'});db[_0x290b('0x186')][_0x290b('0x156')](db[_0x290b('0x111')],{'as':_0x290b('0x111')});db[_0x290b('0x186')][_0x290b('0x156')](db[_0x290b('0x164')],{'onDelete':_0x290b('0x119'),'as':'Contact'});db[_0x290b('0x186')]['belongsTo'](db[_0x290b('0x130')],{'onDelete':_0x290b('0x119'),'as':_0x290b('0x177'),'foreignKey':_0x290b('0x188')});db[_0x290b('0x186')][_0x290b('0x156')](db[_0x290b('0x55')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x185')});db[_0x290b('0x59')][_0x290b('0x127')](db['User'],{'as':_0x290b('0x15c'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x290b('0x59')][_0x290b('0x127')](db[_0x290b('0x12b')],{'through':_0x290b('0x18a'),'as':_0x290b('0x170')});db['OpenchannelAccount']['hasMany'](db[_0x290b('0x7e')],{'as':_0x290b('0x17d'),'foreignKey':_0x290b('0x18b'),'onDelete':'cascade'});db[_0x290b('0x5a')]['hasMany'](db['CannedAnswer'],{'as':_0x290b('0x16d'),'foreignKey':_0x290b('0x18b')});db['OpenchannelAccount'][_0x290b('0x115')](db['OpenchannelInteraction'],{'as':_0x290b('0x17f'),'foreignKey':'OpenchannelAccountId'});db[_0x290b('0x5a')][_0x290b('0x115')](db[_0x290b('0x5e')],{'as':_0x290b('0x15f'),'foreignKey':_0x290b('0x18b')});db['OpenchannelAccount']['hasMany'](db[_0x290b('0x5b')],{'as':_0x290b('0x14c'),'foreignKey':'OpenchannelAccountId','onDelete':_0x290b('0x119')});db[_0x290b('0x5a')][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':_0x290b('0x16e')});db['OpenchannelAccount'][_0x290b('0x156')](db[_0x290b('0x83')],{'as':_0x290b('0x158'),'foreignKey':_0x290b('0x159')});db['OpenchannelAccount'][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x15c'),'through':_0x290b('0x144')});db[_0x290b('0x5b')][_0x290b('0x156')](db[_0x290b('0x111')],{'onDelete':_0x290b('0x169')});db[_0x290b('0x5b')][_0x290b('0x156')](db[_0x290b('0x60')],{'onDelete':_0x290b('0x169'),'foreignKey':_0x290b('0x18c')});db[_0x290b('0x5b')][_0x290b('0x156')](db['OpenchannelAccount'],{'onDelete':_0x290b('0x169'),'foreignKey':_0x290b('0x18b')});db['OpenchannelApplication'][_0x290b('0x156')](db[_0x290b('0x81')],{'onDelete':_0x290b('0x169'),'foreignKey':_0x290b('0x157')});db[_0x290b('0x5b')]['belongsTo'](db[_0x290b('0x8b')],{'onDelete':_0x290b('0x169'),'foreignKey':_0x290b('0x17a')});db[_0x290b('0x5d')][_0x290b('0x115')](db[_0x290b('0x5e')],{'as':_0x290b('0x15f'),'onDelete':_0x290b('0x119'),'foreignKey':'OpenchannelInteractionId'});db[_0x290b('0x5d')][_0x290b('0x156')](db[_0x290b('0x5a')],{'as':'Account','foreignKey':_0x290b('0x18b')});db[_0x290b('0x5d')]['belongsTo'](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0x5d')][_0x290b('0x156')](db[_0x290b('0x111')],{'as':_0x290b('0x172'),'foreignKey':_0x290b('0x113')});db[_0x290b('0x5d')][_0x290b('0x127')](db[_0x290b('0x8b')],{'through':_0x290b('0x18d'),'as':_0x290b('0x183')});db[_0x290b('0x5d')][_0x290b('0x127')](db[_0x290b('0x8b')],{'through':_0x290b('0x18d'),'as':_0x290b('0x174')});db[_0x290b('0x5d')][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x175'),'through':_0x290b('0x132'),'foreignKey':_0x290b('0x18e')});db[_0x290b('0x5e')][_0x290b('0x156')](db['User'],{'onDelete':_0x290b('0x119'),'as':_0x290b('0x111')});db[_0x290b('0x5e')][_0x290b('0x156')](db[_0x290b('0x164')],{'onDelete':'cascade','as':'Contact'});db[_0x290b('0x5e')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0x290b('0x119'),'as':_0x290b('0x177'),'foreignKey':_0x290b('0x18e')});db['OpenchannelMessage'][_0x290b('0x156')](db[_0x290b('0x18f')],{'as':_0x290b('0x18f'),'foreignKey':_0x290b('0x184')});db[_0x290b('0x5e')][_0x290b('0x156')](db[_0x290b('0x5a')],{'as':_0x290b('0x171'),'foreignKey':'OpenchannelAccountId'});db[_0x290b('0x60')]['belongsToMany'](db['User'],{'as':_0x290b('0x15c'),'through':'UserOpenchannelQueue','foreignKey':_0x290b('0x18c')});db[_0x290b('0x60')][_0x290b('0x127')](db[_0x290b('0x12b')],{'through':_0x290b('0x190'),'as':'Teams'});db[_0x290b('0x13e')][_0x290b('0x115')](db[_0x290b('0x7e')],{'as':_0x290b('0x17d'),'foreignKey':_0x290b('0x178'),'onDelete':_0x290b('0x119')});db[_0x290b('0x13e')]['hasMany'](db[_0x290b('0x7c')],{'as':_0x290b('0x16d'),'foreignKey':_0x290b('0x178')});db[_0x290b('0x13e')][_0x290b('0x115')](db[_0x290b('0x6b')],{'as':'ProactiveActions'});db[_0x290b('0x13e')][_0x290b('0x115')](db[_0x290b('0x64')],{'as':_0x290b('0x17f')});db['ChatWebsite']['hasMany'](db[_0x290b('0x191')],{'as':'Applications','foreignKey':_0x290b('0x178'),'onDelete':_0x290b('0x119')});db['ChatWebsite']['hasMany'](db[_0x290b('0x66')],{'as':'Messages'});db[_0x290b('0x13e')]['belongsTo'](db['CmList'],{'as':_0x290b('0x17b'),'foreignKey':_0x290b('0x16e')});db[_0x290b('0x13e')][_0x290b('0x156')](db[_0x290b('0x81')],{'as':_0x290b('0x81'),'foreignKey':_0x290b('0x157')});db[_0x290b('0x13e')][_0x290b('0x156')](db['MailAccount'],{'as':_0x290b('0x3c'),'foreignKey':_0x290b('0x167')});db[_0x290b('0x13e')][_0x290b('0x156')](db[_0x290b('0x83')],{'as':_0x290b('0x158'),'foreignKey':_0x290b('0x159')});db['ChatWebsite']['belongsToMany'](db[_0x290b('0x111')],{'as':'Agents','through':_0x290b('0x140')});db['OpenchannelQueueReport'][_0x290b('0x156')](db[_0x290b('0x5a')],{});db['OpenchannelQueueReport'][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':_0x290b('0x16e')});db[_0x290b('0x62')][_0x290b('0x156')](db['CmContact'],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0x62')][_0x290b('0x156')](db[_0x290b('0x5d')],{});db[_0x290b('0x62')][_0x290b('0x156')](db[_0x290b('0x5e')],{});db['OpenchannelQueueReport'][_0x290b('0x156')](db[_0x290b('0x111')],{});db[_0x290b('0x62')]['belongsTo'](db[_0x290b('0x60')],{});db[_0x290b('0x191')][_0x290b('0x156')](db[_0x290b('0x111')],{'as':_0x290b('0x192'),'foreignKey':_0x290b('0x113'),'onDelete':_0x290b('0x169')});db['ChatApplication'][_0x290b('0x156')](db['ChatQueue'],{'as':_0x290b('0x193'),'foreignKey':_0x290b('0x194'),'onDelete':'restrict'});db[_0x290b('0x191')][_0x290b('0x156')](db[_0x290b('0x13e')],{'as':_0x290b('0x195'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x290b('0x191')]['belongsTo'](db['Tag'],{'onDelete':_0x290b('0x169'),'foreignKey':_0x290b('0x17a')});db[_0x290b('0x64')][_0x290b('0x115')](db['ChatMessage'],{'as':_0x290b('0x15f'),'onDelete':_0x290b('0x119'),'foreignKey':'ChatInteractionId'});db[_0x290b('0x64')][_0x290b('0x156')](db[_0x290b('0x13e')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x178')});db['ChatInteraction'][_0x290b('0x156')](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0x64')]['belongsTo'](db[_0x290b('0x111')],{'as':_0x290b('0x172'),'foreignKey':_0x290b('0x113')});db[_0x290b('0x64')][_0x290b('0x127')](db[_0x290b('0x8b')],{'through':_0x290b('0x196'),'as':_0x290b('0x183')});db[_0x290b('0x64')][_0x290b('0x127')](db[_0x290b('0x8b')],{'through':'chat_interaction_has_tags','as':_0x290b('0x174')});db[_0x290b('0x64')][_0x290b('0x127')](db['User'],{'as':'Users','through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db[_0x290b('0x66')]['belongsTo'](db[_0x290b('0x111')],{'onDelete':'cascade','as':_0x290b('0x111')});db[_0x290b('0x66')][_0x290b('0x156')](db[_0x290b('0x164')],{'onDelete':_0x290b('0x119'),'as':'Contact','foreignKey':_0x290b('0x166')});db['ChatMessage'][_0x290b('0x156')](db[_0x290b('0x64')],{'onDelete':_0x290b('0x119'),'as':'Interaction','foreignKey':_0x290b('0x197')});db[_0x290b('0x66')][_0x290b('0x156')](db[_0x290b('0x18f')],{'as':_0x290b('0x18f'),'foreignKey':_0x290b('0x184')});db['ChatMessage'][_0x290b('0x156')](db[_0x290b('0x13e')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x178')});db[_0x290b('0x198')]['hasMany'](db['Attachment'],{'as':_0x290b('0x176'),'foreignKey':_0x290b('0x179'),'onDelete':_0x290b('0x119'),'hooks':!![]});db[_0x290b('0x198')][_0x290b('0x156')](db[_0x290b('0x164')],{'onDelete':_0x290b('0x119'),'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0x198')][_0x290b('0x156')](db[_0x290b('0x13e')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x178')});db[_0x290b('0x137')][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x15c'),'through':_0x290b('0x30'),'hooks':!![]});db[_0x290b('0x137')][_0x290b('0x127')](db[_0x290b('0x12b')],{'through':_0x290b('0x199'),'as':_0x290b('0x170')});db[_0x290b('0x128')][_0x290b('0x115')](db[_0x290b('0xd5')],{'as':_0x290b('0x15f'),'foreignKey':_0x290b('0x19a'),'onDelete':_0x290b('0x119')});db[_0x290b('0x128')][_0x290b('0x127')](db['User'],{'as':_0x290b('0x14f'),'through':'chat_group_has_users'});db[_0x290b('0x6b')][_0x290b('0x156')](db['ChatWebsite'],{'as':_0x290b('0x195'),'foreignKey':_0x290b('0x178')});db['CmCompany']['hasMany'](db[_0x290b('0x164')],{'as':_0x290b('0x19b'),'foreignKey':_0x290b('0x19c')});db[_0x290b('0x164')][_0x290b('0x115')](db[_0x290b('0x8e')],{'as':_0x290b('0x19d'),'foreignKey':'CmContactId'});db['CmContact'][_0x290b('0x115')](db[_0x290b('0x70')],{'as':_0x290b('0x125'),'foreignKey':_0x290b('0x166')});db[_0x290b('0x164')][_0x290b('0x115')](db[_0x290b('0x73')],{'as':'HopperFinals','foreignKey':_0x290b('0x166')});db[_0x290b('0x164')]['hasMany'](db[_0x290b('0x11b')],{'as':'HopperHistories','foreignKey':_0x290b('0x166')});db[_0x290b('0x164')][_0x290b('0x115')](db[_0x290b('0x11c')],{'as':_0x290b('0x11c'),'foreignKey':_0x290b('0x166')});db['CmContact']['hasMany'](db[_0x290b('0xd9')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0x290b('0x164')][_0x290b('0x115')](db[_0x290b('0x5d')],{'as':_0x290b('0x11d'),'foreignKey':_0x290b('0x166'),'onDelete':_0x290b('0x169')});db['CmContact'][_0x290b('0x115')](db[_0x290b('0x64')],{'as':_0x290b('0x11e'),'foreignKey':_0x290b('0x166'),'onDelete':_0x290b('0x169')});db[_0x290b('0x164')]['hasMany'](db[_0x290b('0x130')],{'as':'SmsInteractions','foreignKey':_0x290b('0x166'),'onDelete':'restrict'});db[_0x290b('0x164')][_0x290b('0x115')](db[_0x290b('0x120')],{'as':_0x290b('0x19e'),'foreignKey':'ContactId','onDelete':_0x290b('0x169')});db[_0x290b('0x164')][_0x290b('0x115')](db[_0x290b('0x40')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0x290b('0x169')});db[_0x290b('0x164')][_0x290b('0x156')](db[_0x290b('0x6d')],{'as':'Company','foreignKey':_0x290b('0x19c')});db[_0x290b('0x164')]['belongsTo'](db[_0x290b('0xfa')],{'as':'List','foreignKey':_0x290b('0x16e'),'onDelete':_0x290b('0x119')});db[_0x290b('0x164')]['belongsToMany'](db[_0x290b('0x111')],{'as':_0x290b('0x175'),'through':_0x290b('0x12a')});db[_0x290b('0x164')][_0x290b('0x127')](db['Tag'],{'as':_0x290b('0x183'),'through':_0x290b('0x19f')});db[_0x290b('0x164')][_0x290b('0x127')](db[_0x290b('0x8b')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x290b('0x70')][_0x290b('0x115')](db[_0x290b('0x1a0')],{'as':_0x290b('0x1a1'),'foreignKey':_0x290b('0x1a2')});db['CmHopper'][_0x290b('0x156')](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166'),'onDelete':_0x290b('0x119')});db['CmHopper'][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':_0x290b('0x16e'),'onDelete':_0x290b('0x119')});db['CmHopper']['belongsTo'](db[_0x290b('0x111')],{'as':'Agent','foreignKey':'UserId'});db[_0x290b('0x70')][_0x290b('0x156')](db[_0x290b('0x19')],{'as':_0x290b('0x193'),'foreignKey':'VoiceQueueId','onDelete':_0x290b('0x119')});db['CmHopper'][_0x290b('0x156')](db[_0x290b('0xeb')],{'as':'Campaign','foreignKey':_0x290b('0x1a3'),'onDelete':_0x290b('0x119')});db[_0x290b('0x70')]['belongsTo'](db[_0x290b('0x111')],{'as':_0x290b('0x172'),'foreignKey':_0x290b('0x1a4')});db[_0x290b('0x71')][_0x290b('0x156')](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':'ContactId','onDelete':_0x290b('0x119')});db['CmHopperBlack']['belongsTo'](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':_0x290b('0x16e'),'onDelete':_0x290b('0x119')});db[_0x290b('0x71')]['belongsTo'](db[_0x290b('0x19')],{'as':_0x290b('0x193'),'foreignKey':_0x290b('0x150'),'onDelete':_0x290b('0x119')});db[_0x290b('0x71')]['belongsTo'](db[_0x290b('0xeb')],{'as':_0x290b('0xeb'),'foreignKey':'CampaignId','onDelete':_0x290b('0x119')});db[_0x290b('0x7a')][_0x290b('0x115')](db[_0x290b('0x7f')],{'as':{'plural':_0x290b('0x1a5'),'singular':_0x290b('0x1a6')},'foreignKey':_0x290b('0x1a7'),'onDelete':_0x290b('0x119'),'hooks':!![]});db[_0x290b('0x7a')][_0x290b('0x115')](db[_0x290b('0x7f')],{'as':{'plural':'Any','singular':_0x290b('0x1a8')},'foreignKey':_0x290b('0x1a9'),'onDelete':_0x290b('0x119'),'hooks':!![]});db[_0x290b('0x7a')][_0x290b('0x115')](db[_0x290b('0x1aa')],{'as':'Actions','foreignKey':_0x290b('0x1ab'),'onDelete':'cascade','hooks':!![]});db[_0x290b('0x7e')][_0x290b('0x115')](db[_0x290b('0x7e')],{'as':_0x290b('0x17d'),'foreignKey':_0x290b('0x1ac'),'onDelete':_0x290b('0x119')});db[_0x290b('0x81')][_0x290b('0x115')](db[_0x290b('0x81')],{'as':'Intervals','foreignKey':_0x290b('0x157'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x290b('0x81')][_0x290b('0x115')](db['VoiceExtension'],{'as':_0x290b('0x1ad'),'foreignKey':_0x290b('0x157'),'onDelete':_0x290b('0x169')});db[_0x290b('0x81')][_0x290b('0x115')](db[_0x290b('0x43')],{'as':'MailApplications','foreignKey':_0x290b('0x157')});db['Interval']['hasMany'](db['ChatApplication'],{'as':_0x290b('0x1ae'),'foreignKey':_0x290b('0x157')});db[_0x290b('0x81')]['hasMany'](db['FaxApplication'],{'as':_0x290b('0x1af'),'foreignKey':_0x290b('0x157')});db[_0x290b('0x81')][_0x290b('0x115')](db[_0x290b('0x187')],{'as':_0x290b('0x1b0'),'foreignKey':'IntervalId'});db[_0x290b('0x87')][_0x290b('0x156')](db[_0x290b('0x3c')],{});db[_0x290b('0x87')]['belongsTo'](db[_0x290b('0x9b')],{'foreignKey':_0x290b('0x1b1')});db[_0x290b('0x87')]['belongsTo'](db[_0x290b('0x99')],{'foreignKey':_0x290b('0x1b2')});db[_0x290b('0x89')]['belongsToMany'](db[_0x290b('0x17')],{'as':_0x290b('0x1b3'),'through':_0x290b('0x14e'),'onDelete':_0x290b('0x169')});db['Tag'][_0x290b('0x127')](db['CmContact'],{'through':_0x290b('0x19f')});db['Tag'][_0x290b('0x127')](db[_0x290b('0x64')],{'through':'chat_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x290b('0x40')],{'through':_0x290b('0x173')});db[_0x290b('0x8b')][_0x290b('0x127')](db['SmsInteraction'],{'through':_0x290b('0x189')});db[_0x290b('0x8b')][_0x290b('0x127')](db[_0x290b('0x120')],{'through':_0x290b('0x182')});db[_0x290b('0x8b')][_0x290b('0x127')](db[_0x290b('0x5d')],{'through':'openchannel_interaction_has_tags'});db[_0x290b('0x8b')][_0x290b('0x127')](db[_0x290b('0x106')],{'through':_0x290b('0x1b4')});db[_0x290b('0x8e')][_0x290b('0x156')](db[_0x290b('0x8c')],{'as':_0x290b('0x1b5'),'foreignKey':_0x290b('0x1b6')});db['CmHopperAdditionalPhone'][_0x290b('0x156')](db[_0x290b('0x70')],{'as':_0x290b('0x1b7'),'foreignKey':_0x290b('0x1a2')});db[_0x290b('0x8e')][_0x290b('0x156')](db['CmContact'],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x1b8')});db['Trigger'][_0x290b('0x115')](db[_0x290b('0x7f')],{'as':{'plural':_0x290b('0x1b9'),'singular':_0x290b('0x1ba')},'foreignKey':_0x290b('0x1bb'),'onDelete':'cascade','hooks':!![]});db[_0x290b('0x92')][_0x290b('0x115')](db[_0x290b('0x7f')],{'as':{'plural':_0x290b('0x1bc'),'singular':_0x290b('0x1bd')},'foreignKey':_0x290b('0x1be'),'onDelete':_0x290b('0x119'),'hooks':!![]});db['Trigger'][_0x290b('0x115')](db['Action'],{'as':_0x290b('0x1bf'),'foreignKey':_0x290b('0x1c0'),'onDelete':_0x290b('0x119'),'hooks':!![]});db[_0x290b('0x99')][_0x290b('0x115')](db[_0x290b('0x9f')],{'as':_0x290b('0x1c1'),'onDelete':_0x290b('0x119'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x290b('0x9b')][_0x290b('0x115')](db['AnalyticFieldReport'],{'as':_0x290b('0x1c1'),'onDelete':_0x290b('0x119'),'foreignKey':'DefaultReportId'});db[_0x290b('0x1c2')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x290b('0x1c1'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c3')});db['AnalyticFieldReport']['belongsTo'](db[_0x290b('0x1c2')],{'foreignKey':_0x290b('0x1c3')});db['SalesforceAccount'][_0x290b('0x115')](db[_0x290b('0xa5')],{'as':_0x290b('0x1c4'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c5')});db[_0x290b('0xa5')][_0x290b('0x115')](db[_0x290b('0xa6')],{'as':_0x290b('0x1c6'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x290b('0xa5')][_0x290b('0x115')](db[_0x290b('0xa6')],{'as':_0x290b('0x1c7'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c8')});db[_0x290b('0xa5')]['hasMany'](db['SalesforceField'],{'as':_0x290b('0x1c1'),'onDelete':'cascade','foreignKey':_0x290b('0x1c9')});db[_0x290b('0xa5')]['belongsTo'](db['SalesforceAccount'],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x1c5')});db[_0x290b('0xa6')][_0x290b('0x115')](db[_0x290b('0xa6')],{'as':_0x290b('0x1ca'),'foreignKey':_0x290b('0x1cb')});db[_0x290b('0xa6')][_0x290b('0x115')](db['SalesforceField'],{'as':_0x290b('0x1cc'),'foreignKey':'DescriptionId'});db[_0x290b('0xa6')]['hasMany'](db[_0x290b('0xa6')],{'as':_0x290b('0x1cd'),'foreignKey':_0x290b('0x1c9')});db['SalesforceField'][_0x290b('0x156')](db[_0x290b('0x93')],{'as':_0x290b('0x93'),'foreignKey':_0x290b('0x1ce')});db[_0x290b('0xa8')][_0x290b('0x115')](db[_0x290b('0xaa')],{'as':_0x290b('0x1c4'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c5')});db[_0x290b('0xaa')][_0x290b('0x115')](db['SugarcrmField'],{'as':_0x290b('0x1c6'),'onDelete':'cascade','foreignKey':_0x290b('0x1cb')});db[_0x290b('0xaa')][_0x290b('0x115')](db['SugarcrmField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x290b('0x1c8')});db[_0x290b('0xaa')]['hasMany'](db[_0x290b('0xab')],{'as':_0x290b('0x1c1'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0xaa')][_0x290b('0x156')](db[_0x290b('0xa8')],{'as':'Account','foreignKey':_0x290b('0x1c5')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x290b('0x1ca'),'foreignKey':'SubjectId'});db[_0x290b('0xab')]['hasMany'](db[_0x290b('0xab')],{'as':_0x290b('0x1cc'),'foreignKey':_0x290b('0x1c8')});db['SugarcrmField'][_0x290b('0x115')](db[_0x290b('0xab')],{'as':_0x290b('0x1cd'),'foreignKey':_0x290b('0x1c9')});db['SugarcrmField'][_0x290b('0x156')](db[_0x290b('0x93')],{'as':_0x290b('0x93'),'foreignKey':'VariableId'});db['DeskAccount'][_0x290b('0x115')](db[_0x290b('0xae')],{'as':_0x290b('0x1c4'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c5')});db['DeskConfiguration'][_0x290b('0x115')](db[_0x290b('0xb0')],{'as':_0x290b('0x1c6'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1cb')});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Descriptions','onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c8')});db['DeskConfiguration']['hasMany'](db[_0x290b('0xb0')],{'as':_0x290b('0x1c1'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0xae')][_0x290b('0x156')](db[_0x290b('0x1cf')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x1c5')});db[_0x290b('0xae')]['belongsToMany'](db[_0x290b('0x8b')],{'through':_0x290b('0x1d0')});db[_0x290b('0xb0')][_0x290b('0x115')](db[_0x290b('0xb0')],{'as':'Subject','foreignKey':_0x290b('0x1cb')});db[_0x290b('0xb0')]['hasMany'](db['DeskField'],{'as':_0x290b('0x1cc'),'foreignKey':'DescriptionId'});db[_0x290b('0xb0')][_0x290b('0x115')](db[_0x290b('0xb0')],{'as':'Field','foreignKey':_0x290b('0x1c9')});db[_0x290b('0xb0')][_0x290b('0x156')](db[_0x290b('0x93')],{'as':'Variable','foreignKey':_0x290b('0x1ce')});db[_0x290b('0x1d1')]['hasMany'](db[_0x290b('0x1d2')],{'as':_0x290b('0x1c4'),'onDelete':_0x290b('0x119'),'foreignKey':'AccountId'});db[_0x290b('0x1d2')]['hasMany'](db['ZohoField'],{'as':_0x290b('0x1c6'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1cb')});db[_0x290b('0x1d2')][_0x290b('0x115')](db[_0x290b('0xb3')],{'as':_0x290b('0x1c7'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c8')});db[_0x290b('0x1d2')]['hasMany'](db[_0x290b('0xb3')],{'as':_0x290b('0x1c1'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0x1d2')]['belongsTo'](db[_0x290b('0x1d1')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x1c5')});db[_0x290b('0xb3')][_0x290b('0x115')](db[_0x290b('0xb3')],{'as':_0x290b('0x1ca'),'foreignKey':'SubjectId'});db[_0x290b('0xb3')][_0x290b('0x115')](db['ZohoField'],{'as':_0x290b('0x1cc'),'foreignKey':_0x290b('0x1c8')});db[_0x290b('0xb3')]['hasMany'](db['ZohoField'],{'as':_0x290b('0x1cd'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0xb3')][_0x290b('0x156')](db[_0x290b('0x93')],{'as':_0x290b('0x93'),'foreignKey':'VariableId'});db['ZendeskAccount'][_0x290b('0x115')](db[_0x290b('0x1d3')],{'as':'Configurations','onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c5')});db[_0x290b('0x1d3')][_0x290b('0x115')](db[_0x290b('0xb7')],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0x290b('0x115')](db[_0x290b('0xb7')],{'as':_0x290b('0x1c7'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x290b('0x115')](db[_0x290b('0xb7')],{'as':'Fields','foreignKey':_0x290b('0x1c9')});db[_0x290b('0x1d3')][_0x290b('0x156')](db[_0x290b('0xb5')],{'as':_0x290b('0x171'),'foreignKey':'AccountId'});db[_0x290b('0x1d3')]['belongsToMany'](db[_0x290b('0x8b')],{'through':_0x290b('0x1d4')});db['ZendeskField']['hasMany'](db[_0x290b('0xb7')],{'as':'Subject','foreignKey':_0x290b('0x1cb')});db[_0x290b('0xb7')]['hasMany'](db['ZendeskField'],{'as':'Description','foreignKey':_0x290b('0x1c8')});db[_0x290b('0xb7')][_0x290b('0x115')](db[_0x290b('0xb7')],{'as':_0x290b('0x1cd'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0xb7')]['belongsTo'](db['Variable'],{'as':_0x290b('0x93'),'foreignKey':_0x290b('0x1ce')});db[_0x290b('0xb9')]['hasMany'](db[_0x290b('0xbb')],{'as':_0x290b('0x1c4'),'onDelete':_0x290b('0x119'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x290b('0x115')](db[_0x290b('0xbc')],{'as':_0x290b('0x1c6'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x290b('0xbb')][_0x290b('0x115')](db[_0x290b('0xbc')],{'as':_0x290b('0x1c7'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c8')});db[_0x290b('0xbb')]['hasMany'](db[_0x290b('0xbc')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x290b('0x1c9')});db[_0x290b('0xbb')][_0x290b('0x156')](db[_0x290b('0xb9')],{'as':'Account','foreignKey':_0x290b('0x1c5')});db['FreshdeskConfiguration'][_0x290b('0x127')](db[_0x290b('0x8b')],{'through':_0x290b('0x1d5')});db[_0x290b('0xbc')][_0x290b('0x115')](db[_0x290b('0xbc')],{'as':_0x290b('0x1ca'),'foreignKey':_0x290b('0x1cb')});db[_0x290b('0xbc')][_0x290b('0x115')](db['FreshdeskField'],{'as':_0x290b('0x1cc'),'foreignKey':'DescriptionId'});db[_0x290b('0xbc')][_0x290b('0x115')](db['FreshdeskField'],{'as':_0x290b('0x1cd'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0xbc')]['belongsTo'](db['Variable'],{'as':_0x290b('0x93'),'foreignKey':_0x290b('0x1ce')});db[_0x290b('0xbe')][_0x290b('0x115')](db[_0x290b('0xbf')],{'as':'Configurations','onDelete':_0x290b('0x119'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0x290b('0x115')](db[_0x290b('0xc1')],{'as':_0x290b('0x1c6'),'foreignKey':_0x290b('0x1cb')});db[_0x290b('0xbf')][_0x290b('0x115')](db[_0x290b('0xc1')],{'as':'Descriptions','foreignKey':_0x290b('0x1c8')});db[_0x290b('0xbf')][_0x290b('0x115')](db[_0x290b('0xc1')],{'as':_0x290b('0x1c1'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0xbf')][_0x290b('0x156')](db[_0x290b('0xbe')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x1c5')});db[_0x290b('0xc1')]['hasMany'](db[_0x290b('0xc1')],{'as':_0x290b('0x1ca'),'foreignKey':_0x290b('0x1cb')});db['VtigerField']['hasMany'](db[_0x290b('0xc1')],{'as':_0x290b('0x1cc'),'foreignKey':_0x290b('0x1c8')});db[_0x290b('0xc1')]['hasMany'](db[_0x290b('0xc1')],{'as':_0x290b('0x1cd'),'foreignKey':_0x290b('0x1c9')});db['VtigerField'][_0x290b('0x156')](db[_0x290b('0x93')],{'as':_0x290b('0x93'),'foreignKey':_0x290b('0x1ce')});db[_0x290b('0x1d6')]['hasMany'](db[_0x290b('0xc4')],{'as':_0x290b('0x1c4'),'onDelete':_0x290b('0x119'),'foreignKey':'AccountId'});db[_0x290b('0xc4')][_0x290b('0x115')](db['ServicenowField'],{'as':_0x290b('0x1c6'),'foreignKey':'SubjectId'});db[_0x290b('0xc4')]['hasMany'](db[_0x290b('0xc6')],{'as':_0x290b('0x1c7'),'foreignKey':_0x290b('0x1c8')});db[_0x290b('0xc4')][_0x290b('0x115')](db['ServicenowField'],{'as':_0x290b('0x1c1'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0xc4')]['belongsTo'](db[_0x290b('0x1d6')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x1c5')});db[_0x290b('0xc6')][_0x290b('0x115')](db[_0x290b('0xc6')],{'as':'Subject','foreignKey':_0x290b('0x1cb')});db[_0x290b('0xc6')][_0x290b('0x115')](db[_0x290b('0xc6')],{'as':'Description','foreignKey':_0x290b('0x1c8')});db[_0x290b('0xc6')][_0x290b('0x115')](db['ServicenowField'],{'as':'Field','foreignKey':_0x290b('0x1c9')});db[_0x290b('0xc6')][_0x290b('0x156')](db[_0x290b('0x93')],{'as':_0x290b('0x93'),'foreignKey':_0x290b('0x1ce')});db[_0x290b('0xc7')][_0x290b('0x115')](db[_0x290b('0xc9')],{'as':'Configurations','onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c5')});db['Dynamics365Account'][_0x290b('0x156')](db[_0x290b('0x10c')],{'as':_0x290b('0x10c'),'foreignKey':_0x290b('0x168')});db['Dynamics365Configuration'][_0x290b('0x115')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1cb')});db['Dynamics365Configuration'][_0x290b('0x115')](db[_0x290b('0xcb')],{'as':_0x290b('0x1c7'),'onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c8')});db['Dynamics365Configuration'][_0x290b('0x115')](db[_0x290b('0xcb')],{'as':'Fields','onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0xc9')][_0x290b('0x156')](db['Dynamics365Account'],{'as':_0x290b('0x171'),'foreignKey':'AccountId'});db[_0x290b('0xcb')]['hasMany'](db[_0x290b('0xcb')],{'as':'Subject','foreignKey':_0x290b('0x1cb')});db[_0x290b('0xcb')][_0x290b('0x115')](db[_0x290b('0xcb')],{'as':_0x290b('0x1cc'),'foreignKey':_0x290b('0x1c8')});db[_0x290b('0xcb')][_0x290b('0x115')](db[_0x290b('0xcb')],{'as':_0x290b('0x1cd'),'foreignKey':_0x290b('0x1c9')});db['Dynamics365Field'][_0x290b('0x156')](db[_0x290b('0x93')],{'as':_0x290b('0x93'),'foreignKey':_0x290b('0x1ce')});db[_0x290b('0xcd')]['hasMany'](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0x290b('0x119'),'foreignKey':_0x290b('0x1c5')});db[_0x290b('0xcf')][_0x290b('0x115')](db[_0x290b('0x1d7')],{'as':_0x290b('0x1c6'),'foreignKey':_0x290b('0x1cb')});db[_0x290b('0xcf')][_0x290b('0x115')](db[_0x290b('0x1d7')],{'as':_0x290b('0x1c7'),'foreignKey':_0x290b('0x1c8')});db[_0x290b('0xcf')][_0x290b('0x115')](db['FreshsalesField'],{'as':_0x290b('0x1c1'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0xcf')][_0x290b('0x156')](db['FreshsalesAccount'],{'as':_0x290b('0x171'),'foreignKey':'AccountId'});db['FreshsalesField'][_0x290b('0x115')](db['FreshsalesField'],{'as':_0x290b('0x1ca'),'foreignKey':_0x290b('0x1cb')});db[_0x290b('0x1d7')][_0x290b('0x115')](db[_0x290b('0x1d7')],{'as':'Description','foreignKey':_0x290b('0x1c8')});db[_0x290b('0x1d7')][_0x290b('0x115')](db[_0x290b('0x1d7')],{'as':_0x290b('0x1cd'),'foreignKey':_0x290b('0x1c9')});db[_0x290b('0x1d7')][_0x290b('0x156')](db[_0x290b('0x93')],{'as':_0x290b('0x93'),'foreignKey':'VariableId'});db[_0x290b('0xd3')]['belongsTo'](db[_0x290b('0x13e')],{});db[_0x290b('0xd3')][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':'ListId'});db[_0x290b('0xd3')][_0x290b('0x156')](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0xd3')]['belongsTo'](db['ChatInteraction'],{});db[_0x290b('0xd3')][_0x290b('0x156')](db[_0x290b('0x66')],{});db[_0x290b('0xd3')][_0x290b('0x156')](db[_0x290b('0x111')],{});db[_0x290b('0xd3')][_0x290b('0x156')](db[_0x290b('0x137')],{});db[_0x290b('0xd5')][_0x290b('0x156')](db[_0x290b('0x111')],{'onDelete':'cascade','foreignKey':_0x290b('0x1d8')});db[_0x290b('0xd5')][_0x290b('0x156')](db['User'],{'onDelete':_0x290b('0x119'),'foreignKey':'ToId'});db[_0x290b('0xd9')][_0x290b('0x115')](db[_0x290b('0x1d9')],{'foreignKey':_0x290b('0x1da'),'onDelete':_0x290b('0x119')});db[_0x290b('0xd9')][_0x290b('0x115')](db[_0x290b('0xd7')],{'foreignKey':'SessionId','onDelete':_0x290b('0x119')});db[_0x290b('0xdb')][_0x290b('0x156')](db['SmsAccount'],{});db[_0x290b('0xdb')][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':_0x290b('0x16e')});db['SmsQueueReport'][_0x290b('0x156')](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0xdb')][_0x290b('0x156')](db[_0x290b('0x130')],{});db[_0x290b('0xdb')][_0x290b('0x156')](db[_0x290b('0x186')],{});db[_0x290b('0xdb')][_0x290b('0x156')](db['User'],{});db[_0x290b('0xdb')]['belongsTo'](db[_0x290b('0x59')],{});db[_0x290b('0xe0')][_0x290b('0x115')](db[_0x290b('0xd9')],{'foreignKey':_0x290b('0x1db')});db[_0x290b('0xe0')][_0x290b('0x115')](db[_0x290b('0x1d9')],{'foreignKey':'ProjectId'});db[_0x290b('0xe0')][_0x290b('0x115')](db[_0x290b('0xd7')],{'foreignKey':'ProjectId'});db['Team'][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x15c'),'through':'user_has_teams'});db['Team'][_0x290b('0x127')](db[_0x290b('0x19')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db['Team']['belongsToMany'](db[_0x290b('0x3e')],{'through':_0x290b('0x16f'),'as':_0x290b('0x136')});db[_0x290b('0x12b')][_0x290b('0x127')](db[_0x290b('0x137')],{'through':_0x290b('0x199'),'as':_0x290b('0x138')});db['Team'][_0x290b('0x127')](db[_0x290b('0x51')],{'through':_0x290b('0x1dc'),'as':_0x290b('0x139')});db[_0x290b('0x12b')]['belongsToMany'](db[_0x290b('0x59')],{'through':_0x290b('0x18a'),'as':'SmsQueues'});db[_0x290b('0x12b')][_0x290b('0x127')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x290b('0x1dd')});db[_0x290b('0x12b')][_0x290b('0x127')](db[_0x290b('0x10a')],{'through':_0x290b('0x1de'),'as':_0x290b('0x13c')});db[_0x290b('0x12b')][_0x290b('0x127')](db[_0x290b('0xfc')],{'through':_0x290b('0x1df'),'as':_0x290b('0x135')});db['Campaign'][_0x290b('0x115')](db[_0x290b('0x70')],{'as':_0x290b('0x125'),'foreignKey':_0x290b('0x1a3')});db['Campaign'][_0x290b('0x115')](db[_0x290b('0x73')],{'as':_0x290b('0x11a'),'foreignKey':'CampaignId'});db['Campaign'][_0x290b('0x115')](db[_0x290b('0x11b')],{'as':'HopperHistories','foreignKey':_0x290b('0x1a3')});db[_0x290b('0xeb')][_0x290b('0x115')](db[_0x290b('0x71')],{'as':_0x290b('0x152'),'foreignKey':'CampaignId'});db[_0x290b('0xeb')][_0x290b('0x156')](db[_0x290b('0x29')],{'as':_0x290b('0x29'),'foreignKey':_0x290b('0x1e0')});db[_0x290b('0xeb')]['belongsTo'](db[_0x290b('0x29')],{'as':_0x290b('0x154'),'foreignKey':_0x290b('0x155')});db['Campaign'][_0x290b('0x156')](db[_0x290b('0x81')],{'as':_0x290b('0x81'),'foreignKey':_0x290b('0x157')});db[_0x290b('0xeb')][_0x290b('0x156')](db[_0x290b('0xe4')],{'as':_0x290b('0xe4'),'foreignKey':_0x290b('0x1e1')});db[_0x290b('0xeb')][_0x290b('0x127')](db[_0x290b('0xfa')],{'as':'Lists','through':_0x290b('0x1e2')});db[_0x290b('0xeb')][_0x290b('0x127')](db['CmList'],{'as':_0x290b('0x15d'),'through':_0x290b('0x1e3')});db[_0x290b('0x18f')]['belongsTo'](db[_0x290b('0x198')],{'as':_0x290b('0x198'),'foreignKey':_0x290b('0x179')});db['MailTransferReport']['belongsTo'](db['MailMessage'],{});db[_0x290b('0xf1')][_0x290b('0x156')](db[_0x290b('0x40')],{});db[_0x290b('0xf1')][_0x290b('0x156')](db[_0x290b('0x3c')],{'foreignKey':'FromMailAccountId','as':_0x290b('0x1e4')});db['MailTransferReport'][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':_0x290b('0x1e5'),'as':_0x290b('0x1e6')});db[_0x290b('0xf1')][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':_0x290b('0x1e7'),'as':'ToAgent'});db[_0x290b('0xf1')][_0x290b('0x156')](db[_0x290b('0x3e')],{'foreignKey':'ToMailQueueId','as':_0x290b('0x1e8')});db[_0x290b('0xf1')][_0x290b('0x156')](db['MailAccount'],{'foreignKey':_0x290b('0x1e9'),'as':_0x290b('0x1ea')});db[_0x290b('0x1eb')][_0x290b('0x156')](db[_0x290b('0x66')],{});db['ChatTransferReport'][_0x290b('0x156')](db['ChatInteraction'],{});db[_0x290b('0x1eb')][_0x290b('0x156')](db[_0x290b('0x13e')],{'foreignKey':_0x290b('0x1ec'),'as':_0x290b('0x1e4')});db[_0x290b('0x1eb')][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':'FromUserId','as':_0x290b('0x1e6')});db[_0x290b('0x1eb')][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':_0x290b('0x1e7'),'as':_0x290b('0x1ed')});db['ChatTransferReport'][_0x290b('0x156')](db[_0x290b('0x137')],{'foreignKey':'ToChatQueueId','as':_0x290b('0x1e8')});db[_0x290b('0x1eb')][_0x290b('0x156')](db[_0x290b('0x13e')],{'foreignKey':_0x290b('0x1ee'),'as':'ToAccount'});db[_0x290b('0xf4')][_0x290b('0x156')](db[_0x290b('0x180')],{});db['FaxTransferReport']['belongsTo'](db['FaxInteraction'],{});db[_0x290b('0xf4')]['belongsTo'](db[_0x290b('0x4b')],{'foreignKey':'FromFaxAccountId','as':_0x290b('0x1e4')});db[_0x290b('0xf4')][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':_0x290b('0x1e5'),'as':_0x290b('0x1e6')});db['FaxTransferReport'][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':_0x290b('0x1e7'),'as':_0x290b('0x1ed')});db[_0x290b('0xf4')]['belongsTo'](db[_0x290b('0x51')],{'foreignKey':_0x290b('0x1ef'),'as':_0x290b('0x1e8')});db[_0x290b('0xf4')][_0x290b('0x156')](db[_0x290b('0x4b')],{'foreignKey':_0x290b('0x1f0'),'as':'ToAccount'});db[_0x290b('0xf6')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x290b('0xf6')][_0x290b('0x156')](db['OpenchannelInteraction'],{});db[_0x290b('0xf6')][_0x290b('0x156')](db['OpenchannelAccount'],{'foreignKey':_0x290b('0x1f1'),'as':_0x290b('0x1e4')});db[_0x290b('0xf6')][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':'FromUserId','as':_0x290b('0x1e6')});db[_0x290b('0xf6')]['belongsTo'](db[_0x290b('0x111')],{'foreignKey':_0x290b('0x1e7'),'as':_0x290b('0x1ed')});db[_0x290b('0xf6')][_0x290b('0x156')](db['OpenchannelQueue'],{'foreignKey':_0x290b('0x1f2'),'as':_0x290b('0x1e8')});db[_0x290b('0xf6')]['belongsTo'](db[_0x290b('0x5a')],{'foreignKey':_0x290b('0x1f3'),'as':'ToAccount'});db[_0x290b('0xf8')][_0x290b('0x156')](db[_0x290b('0x186')],{});db[_0x290b('0xf8')][_0x290b('0x156')](db[_0x290b('0x130')],{});db[_0x290b('0xf8')][_0x290b('0x156')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db['SmsTransferReport'][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':_0x290b('0x1e5'),'as':'FromAgent'});db[_0x290b('0xf8')]['belongsTo'](db[_0x290b('0x111')],{'foreignKey':'ToUserId','as':_0x290b('0x1ed')});db['SmsTransferReport'][_0x290b('0x156')](db['SmsQueue'],{'foreignKey':_0x290b('0x1f4'),'as':_0x290b('0x1e8')});db['SmsTransferReport'][_0x290b('0x156')](db[_0x290b('0x55')],{'foreignKey':'ToSmsAccountId','as':_0x290b('0x1ea')});db[_0x290b('0xfa')][_0x290b('0x115')](db[_0x290b('0x7e')],{'as':_0x290b('0x17d'),'foreignKey':_0x290b('0x16e'),'onDelete':_0x290b('0x119')});db[_0x290b('0xfa')]['hasMany'](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0x290b('0x16e')});db[_0x290b('0xfa')]['hasMany'](db['CmContact'],{'as':_0x290b('0x19b'),'onDelete':'cascade','foreignKey':_0x290b('0x16e')});db[_0x290b('0xfa')][_0x290b('0x115')](db[_0x290b('0x73')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x290b('0xfa')][_0x290b('0x115')](db['CmHopperHistory'],{'as':_0x290b('0x1f5'),'foreignKey':'ListId'});db[_0x290b('0xfa')][_0x290b('0x115')](db['ReportAgentPreview'],{'as':_0x290b('0x11c'),'foreignKey':_0x290b('0x16e')});db['CmList'][_0x290b('0x127')](db[_0x290b('0x19')],{'as':_0x290b('0x1f6'),'through':_0x290b('0x15b')});db[_0x290b('0xfa')]['belongsToMany'](db[_0x290b('0x111')],{'as':'Agents','through':_0x290b('0x13d')});db[_0x290b('0xfc')]['hasMany'](db[_0x290b('0x118')],{'as':'Extensions','onDelete':_0x290b('0x119')});db[_0x290b('0xfc')][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x15c'),'through':'UserVoicePrefix'});db[_0x290b('0xfc')]['belongsToMany'](db[_0x290b('0x12b')],{'through':_0x290b('0x1df'),'as':_0x290b('0x170')});db[_0x290b('0xfd')]['hasMany'](db[_0x290b('0x111')],{'as':_0x290b('0x175'),'foreignKey':_0x290b('0x1f7')});db[_0x290b('0xfd')][_0x290b('0x115')](db[_0x290b('0x1f8')],{'as':_0x290b('0x1f9'),'foreignKey':_0x290b('0x1f7'),'onDelete':_0x290b('0x119')});db[_0x290b('0x1f8')][_0x290b('0x115')](db[_0x290b('0x100')],{'as':_0x290b('0x1fa'),'foreignKey':_0x290b('0x1fb'),'onDelete':_0x290b('0x119')});db['WhatsappAccount'][_0x290b('0x115')](db['Disposition'],{'as':_0x290b('0x17d'),'foreignKey':_0x290b('0x1fc'),'onDelete':_0x290b('0x119')});db[_0x290b('0x147')]['hasMany'](db[_0x290b('0x7c')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0x290b('0x147')][_0x290b('0x115')](db[_0x290b('0x108')],{'as':_0x290b('0x15f'),'foreignKey':_0x290b('0x1fc')});db['WhatsappAccount'][_0x290b('0x115')](db[_0x290b('0x106')],{'as':_0x290b('0x17f')});db['WhatsappAccount'][_0x290b('0x115')](db[_0x290b('0x104')],{'as':'Applications','foreignKey':_0x290b('0x1fc'),'onDelete':_0x290b('0x119')});db['WhatsappAccount'][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':_0x290b('0x16e')});db[_0x290b('0x147')]['belongsTo'](db[_0x290b('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x290b('0x159')});db['WhatsappAccount'][_0x290b('0x127')](db[_0x290b('0x111')],{'as':_0x290b('0x15c'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x290b('0x156')](db['User'],{'onDelete':_0x290b('0x169')});db['WhatsappApplication']['belongsTo'](db[_0x290b('0x10a')],{'onDelete':'restrict'});db[_0x290b('0x104')][_0x290b('0x156')](db[_0x290b('0x147')],{'onDelete':'restrict'});db[_0x290b('0x104')][_0x290b('0x156')](db['Interval'],{'onDelete':_0x290b('0x169'),'foreignKey':_0x290b('0x157')});db[_0x290b('0x104')][_0x290b('0x156')](db[_0x290b('0x8b')],{'onDelete':_0x290b('0x169'),'foreignKey':_0x290b('0x17a')});db[_0x290b('0x106')][_0x290b('0x115')](db['WhatsappMessage'],{'as':_0x290b('0x15f'),'onDelete':'cascade','foreignKey':_0x290b('0x1fd')});db[_0x290b('0x106')]['belongsTo'](db[_0x290b('0x147')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x1fc')});db['WhatsappInteraction'][_0x290b('0x156')](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0x106')][_0x290b('0x156')](db[_0x290b('0x111')],{'as':'Owner','foreignKey':'UserId'});db[_0x290b('0x106')][_0x290b('0x127')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db['WhatsappInteraction']['belongsToMany'](db[_0x290b('0x8b')],{'through':_0x290b('0x1b4'),'as':_0x290b('0x174')});db[_0x290b('0x106')]['belongsToMany'](db[_0x290b('0x111')],{'as':_0x290b('0x175'),'through':_0x290b('0x133'),'foreignKey':_0x290b('0x1fd')});db[_0x290b('0x108')]['belongsTo'](db[_0x290b('0x111')],{'as':_0x290b('0x111')});db[_0x290b('0x108')][_0x290b('0x156')](db[_0x290b('0x164')],{'onDelete':'cascade','as':_0x290b('0x165')});db['WhatsappMessage']['belongsTo'](db[_0x290b('0x106')],{'onDelete':_0x290b('0x119'),'as':'Interaction','foreignKey':_0x290b('0x1fd')});db[_0x290b('0x108')][_0x290b('0x156')](db[_0x290b('0x147')],{'as':_0x290b('0x171'),'foreignKey':_0x290b('0x1fc')});db['WhatsappQueueReport'][_0x290b('0x156')](db[_0x290b('0x147')],{});db[_0x290b('0x1fe')][_0x290b('0x156')](db[_0x290b('0xfa')],{'as':_0x290b('0x17b'),'foreignKey':'ListId'});db[_0x290b('0x1fe')][_0x290b('0x156')](db[_0x290b('0x164')],{'as':_0x290b('0x165'),'foreignKey':_0x290b('0x166')});db[_0x290b('0x1fe')][_0x290b('0x156')](db[_0x290b('0x106')],{});db[_0x290b('0x1fe')][_0x290b('0x156')](db[_0x290b('0x10a')],{});db[_0x290b('0x1fe')][_0x290b('0x156')](db[_0x290b('0x108')],{});db[_0x290b('0x1fe')]['belongsTo'](db[_0x290b('0x111')],{});db['WhatsappTransferReport'][_0x290b('0x156')](db['WhatsappMessage'],{});db['WhatsappTransferReport']['belongsTo'](db[_0x290b('0x106')],{});db[_0x290b('0x1ff')]['belongsTo'](db[_0x290b('0x147')],{'foreignKey':_0x290b('0x200'),'as':_0x290b('0x1e4')});db['WhatsappTransferReport'][_0x290b('0x156')](db[_0x290b('0x147')],{'foreignKey':_0x290b('0x201'),'as':'ToAccount'});db[_0x290b('0x1ff')]['belongsTo'](db[_0x290b('0x10a')],{'foreignKey':'ToQueueId','as':_0x290b('0x1e8')});db[_0x290b('0x1ff')][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':_0x290b('0x1e5'),'as':_0x290b('0x1e6')});db[_0x290b('0x1ff')][_0x290b('0x156')](db[_0x290b('0x111')],{'foreignKey':_0x290b('0x1e7'),'as':_0x290b('0x1ed')});db[_0x290b('0x10a')][_0x290b('0x127')](db['User'],{'as':_0x290b('0x15c'),'through':_0x290b('0x38'),'foreignKey':'WhatsappQueueId'});db[_0x290b('0x10a')][_0x290b('0x127')](db['Team'],{'through':_0x290b('0x1de'),'as':_0x290b('0x170')});db[_0x290b('0x110')][_0x290b('0x156')](db[_0x290b('0x111')],{'as':'user','foreignKey':_0x290b('0x113'),'onDelete':_0x290b('0x119'),'hooks':!![]});db[_0x290b('0x10c')][_0x290b('0x112')](db[_0x290b('0xc7')],{'as':_0x290b('0xc7'),'onDelete':'restrict'});db[_0x290b('0x10c')]['hasOne'](db['MailServerIn'],{'as':_0x290b('0x16b'),'onDelete':_0x290b('0x169')});db['CloudProvider'][_0x290b('0x112')](db['MailServerOut'],{'as':_0x290b('0x16c'),'onDelete':_0x290b('0x169')});module[_0x290b('0x202')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 06ba564..db72c8c 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87db=['./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/sms/reports/queue','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','/apidoc','static','/www','join','root','/demo','/snippet','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','express','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_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/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_hopper_additional_phones','/api/templates','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts'];(function(_0xc9ea99,_0x2eaa85){var _0x9fa747=function(_0x3c51e4){while(--_0x3c51e4){_0xc9ea99['push'](_0xc9ea99['shift']());}};_0x9fa747(++_0x2eaa85);}(_0x87db,0x6a));var _0xb87d=function(_0x34b19f,_0x5e6523){_0x34b19f=_0x34b19f-0x0;var _0xa9a938=_0x87db[_0x34b19f];return _0xa9a938;};'use strict';var path=require('path');var express=require(_0xb87d('0x0'));var errors=require(_0xb87d('0x1'));var config=require('./config/environment');var setupLoggers=require(_0xb87d('0x2'))[_0xb87d('0x3')];var clientSideLogs=require(_0xb87d('0x4'));exports[_0xb87d('0x5')]=function(_0x3cf5e8){return setupLoggers(_0x3cf5e8)['then'](function(){_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x7'),require(_0xb87d('0x8')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x9'),require(_0xb87d('0xa')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xb'),require('./api/voiceContext'));_0x3cf5e8[_0xb87d('0x6')]('/api/voice/extensions',require(_0xb87d('0xc')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xd'),require(_0xb87d('0xe')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xf'),require(_0xb87d('0x10')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x11'),require(_0xb87d('0x12')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x13'),require(_0xb87d('0x14')));_0x3cf5e8['use'](_0xb87d('0x15'),require('./api/voiceMail'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x16'),require(_0xb87d('0x17')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x18'),require(_0xb87d('0x19')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x1a'),require(_0xb87d('0x1b')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x1c'),require('./api/voiceAgentReport'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x1d'),require(_0xb87d('0x1e')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x1f'),require('./api/memberReport'));_0x3cf5e8['use']('/api/trunks',require(_0xb87d('0x20')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x21'),require(_0xb87d('0x22')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x23'),require(_0xb87d('0x24')));_0x3cf5e8['use'](_0xb87d('0x25'),require('./api/mailAccount'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x26'),require(_0xb87d('0x27')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x28'),require(_0xb87d('0x29')));_0x3cf5e8['use'](_0xb87d('0x2a'),require('./api/mailInteraction'));_0x3cf5e8[_0xb87d('0x6')]('/api/mail/messages',require('./api/mailMessage'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x2b'),require(_0xb87d('0x2c')));_0x3cf5e8[_0xb87d('0x6')]('/api/mail/reports/queue',require(_0xb87d('0x2d')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x2e'),require(_0xb87d('0x2f')));_0x3cf5e8[_0xb87d('0x6')]('/api/dashboards/items',require(_0xb87d('0x30')));_0x3cf5e8[_0xb87d('0x6')]('/api/fax/accounts',require('./api/faxAccount'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x31'),require(_0xb87d('0x32')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x33'),require(_0xb87d('0x34')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x35'),require(_0xb87d('0x36')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x37'),require(_0xb87d('0x38')));_0x3cf5e8['use'](_0xb87d('0x39'),require('./api/faxQueueReport'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x3a'),require(_0xb87d('0x3b')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x3c'),require(_0xb87d('0x3d')));_0x3cf5e8[_0xb87d('0x6')]('/api/sms/interactions',require(_0xb87d('0x3e')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x3f'),require(_0xb87d('0x40')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x41'),require('./api/smsQueue'));_0x3cf5e8[_0xb87d('0x6')]('/api/openchannel/accounts',require(_0xb87d('0x42')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x43'),require(_0xb87d('0x44')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x45'),require(_0xb87d('0x46')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x47'),require(_0xb87d('0x48')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x49'),require(_0xb87d('0x4a')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x4b'),require(_0xb87d('0x4c')));_0x3cf5e8[_0xb87d('0x6')]('/api/openchannel/reports/queue',require(_0xb87d('0x4d')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x4e'),require('./api/chatApplication'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x4f'),require(_0xb87d('0x50')));_0x3cf5e8['use']('/api/chat/messages',require(_0xb87d('0x51')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x52'),require(_0xb87d('0x53')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x54'),require(_0xb87d('0x55')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x56'),require('./api/chatGroup'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x57'),require(_0xb87d('0x58')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x59'),require(_0xb87d('0x5a')));_0x3cf5e8['use']('/api/cm/contacts',require(_0xb87d('0x5b')));_0x3cf5e8['use'](_0xb87d('0x5c'),require(_0xb87d('0x5d')));_0x3cf5e8[_0xb87d('0x6')]('/api/cm/hopper_black',require(_0xb87d('0x5e')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x5f'),require(_0xb87d('0x60')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x61'),require(_0xb87d('0x62')));_0x3cf5e8[_0xb87d('0x6')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x63'),require(_0xb87d('0x64')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x65'),require(_0xb87d('0x66')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x67'),require(_0xb87d('0x68')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x69'),require(_0xb87d('0x6a')));_0x3cf5e8[_0xb87d('0x6')]('/api/conditions',require(_0xb87d('0x6b')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x6c'),require(_0xb87d('0x6d')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x6e'),require(_0xb87d('0x6f')));_0x3cf5e8['use'](_0xb87d('0x70'),require(_0xb87d('0x71')));_0x3cf5e8['use']('/api/voiceQueuesLog',require(_0xb87d('0x72')));_0x3cf5e8['use'](_0xb87d('0x73'),require(_0xb87d('0x74')));_0x3cf5e8['use'](_0xb87d('0x75'),require(_0xb87d('0x76')));_0x3cf5e8['use']('/api/tags',require(_0xb87d('0x77')));_0x3cf5e8['use'](_0xb87d('0x78'),require(_0xb87d('0x79')));_0x3cf5e8[_0xb87d('0x6')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x3cf5e8['use'](_0xb87d('0x7a'),require('./api/cmHopperAdditionalPhone'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x7b'),require('./api/template'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x7c'),require(_0xb87d('0x7d')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x7e'),require('./api/variable'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x7f'),require('./api/integration'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x80'),require(_0xb87d('0x81')));_0x3cf5e8[_0xb87d('0x6')]('/api/analytics/custom_reports',require(_0xb87d('0x82')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x83'),require(_0xb87d('0x84')));_0x3cf5e8[_0xb87d('0x6')]('/api/analytics/extracted_reports',require(_0xb87d('0x85')));_0x3cf5e8['use'](_0xb87d('0x86'),require('./api/analyticMetric'));_0x3cf5e8['use'](_0xb87d('0x87'),require(_0xb87d('0x88')));_0x3cf5e8['use'](_0xb87d('0x89'),require(_0xb87d('0x8a')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x8b'),require(_0xb87d('0x8c')));_0x3cf5e8['use']('/api/integrations/salesforce/configurations',require(_0xb87d('0x8d')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x8e'),require(_0xb87d('0x8f')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x90'),require(_0xb87d('0x91')));_0x3cf5e8['use']('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x3cf5e8['use'](_0xb87d('0x92'),require('./api/intSugarcrmField'));_0x3cf5e8['use'](_0xb87d('0x93'),require(_0xb87d('0x94')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x95'),require('./api/intDeskConfiguration'));_0x3cf5e8[_0xb87d('0x6')]('/api/integrations/desk/fields',require(_0xb87d('0x96')));_0x3cf5e8['use']('/api/integrations/zoho/accounts',require(_0xb87d('0x97')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x98'),require(_0xb87d('0x99')));_0x3cf5e8[_0xb87d('0x6')]('/api/integrations/zoho/fields',require(_0xb87d('0x9a')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x9b'),require(_0xb87d('0x9c')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x9d'),require('./api/intZendeskConfiguration'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x9e'),require(_0xb87d('0x9f')));_0x3cf5e8['use'](_0xb87d('0xa0'),require(_0xb87d('0xa1')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xa2'),require('./api/intFreshdeskConfiguration'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xa3'),require('./api/intFreshdeskField'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xa4'),require(_0xb87d('0xa5')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xa6'),require('./api/intVtigerConfiguration'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xa7'),require('./api/intVtigerField'));_0x3cf5e8[_0xb87d('0x6')]('/api/integrations/servicenow/accounts',require(_0xb87d('0xa8')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xa9'),require(_0xb87d('0xaa')));_0x3cf5e8['use'](_0xb87d('0xab'),require(_0xb87d('0xac')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xad'),require('./api/intDynamics365Account'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xae'),require(_0xb87d('0xaf')));_0x3cf5e8[_0xb87d('0x6')]('/api/integrations/dynamics365/fields',require(_0xb87d('0xb0')));_0x3cf5e8['use'](_0xb87d('0xb1'),require(_0xb87d('0xb2')));_0x3cf5e8['use']('/api/integrations/freshsales/configurations',require(_0xb87d('0xb3')));_0x3cf5e8[_0xb87d('0x6')]('/api/integrations/freshsales/fields',require(_0xb87d('0xb4')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xb5'),require(_0xb87d('0xb6')));_0x3cf5e8['use'](_0xb87d('0xb7'),require(_0xb87d('0xb8')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xb9'),require('./api/chatInternalMessage'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xba'),require(_0xb87d('0xbb')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xbc'),require('./api/jscriptyQuestionReport'));_0x3cf5e8[_0xb87d('0x6')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xbd'),require('./api/smsQueueReport'));_0x3cf5e8['use']('/api/square/reports',require('./api/squareReport'));_0x3cf5e8['use']('/api/square/details/reports',require(_0xb87d('0xbe')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xbf'),require(_0xb87d('0xc0')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xc1'),require('./api/setting'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xc2'),require(_0xb87d('0xc3')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xc4'),require(_0xb87d('0xc5')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xc6'),require(_0xb87d('0xc7')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xc8'),require(_0xb87d('0xc9')));_0x3cf5e8[_0xb87d('0x6')]('/api/teams',require(_0xb87d('0xca')));_0x3cf5e8['use'](_0xb87d('0xcb'),require(_0xb87d('0xcc')));_0x3cf5e8[_0xb87d('0x6')]('/api/campaigns',require('./api/campaign'));_0x3cf5e8[_0xb87d('0x6')]('/api/migrations',require(_0xb87d('0xcd')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xce'),require('./api/attachment'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xcf'),require(_0xb87d('0xd0')));_0x3cf5e8[_0xb87d('0x6')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xd1'),require(_0xb87d('0xd2')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xd3'),require(_0xb87d('0xd4')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xd5'),require(_0xb87d('0xd6')));_0x3cf5e8['use'](_0xb87d('0xd7'),require(_0xb87d('0xd8')));_0x3cf5e8[_0xb87d('0x6')]('/api/cm/lists',require('./api/cmList'));_0x3cf5e8['use'](_0xb87d('0xd9'),require(_0xb87d('0xda')));_0x3cf5e8['use'](_0xb87d('0xdb'),require('./api/userProfile'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xdc'),require(_0xb87d('0xdd')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xde'),require('./api/userProfileResource'));_0x3cf5e8[_0xb87d('0x6')]('/api/userNotifications',require('./api/userNotification'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xdf'),require(_0xb87d('0xe0')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xe1'),require(_0xb87d('0xe2')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xe3'),require(_0xb87d('0xe4')));_0x3cf5e8['use'](_0xb87d('0xe5'),require('./api/whatsappMessage'));_0x3cf5e8['use'](_0xb87d('0xe6'),require('./api/whatsappQueueReport'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xe7'),require(_0xb87d('0xe8')));_0x3cf5e8['use'](_0xb87d('0xe9'),require(_0xb87d('0xea')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xeb'),require(_0xb87d('0xec')));_0x3cf5e8['use']('/api/realtime',require('./api/realtime'));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xed'),require(_0xb87d('0xee')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xef'),require(_0xb87d('0xf0')));_0x3cf5e8[_0xb87d('0x6')]('/api/auth/google',require(_0xb87d('0xf1')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xf2'),require(_0xb87d('0xf3')));_0x3cf5e8[_0xb87d('0x6')]('/api/jira',require(_0xb87d('0xf4')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xf5'),require(_0xb87d('0xf6')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xf7'),require(_0xb87d('0xf8')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xf9'),require(_0xb87d('0xfa')));_0x3cf5e8[_0xb87d('0x6')]('/api/pm2',require(_0xb87d('0xfb')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xfc'),require('./api/webbar'));_0x3cf5e8['use']('/api/logs',clientSideLogs);_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xfd'),express[_0xb87d('0xfe')](path['join'](config['root'],'/apidoc')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0xff'),express['static'](path[_0xb87d('0x100')](config[_0xb87d('0x101')],'/www')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x102'),express['static'](path[_0xb87d('0x100')](config['root'],_0xb87d('0x102'))));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x103'),express[_0xb87d('0xfe')](path['join'](config['root'],'snippet','3.8.1')));_0x3cf5e8[_0xb87d('0x6')](_0xb87d('0x104'),express['static'](path[_0xb87d('0x100')](config[_0xb87d('0x101')],_0xb87d('0x105'))));_0x3cf5e8[_0xb87d('0x106')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xb87d('0x107')](errors[0x194]);_0x3cf5e8[_0xb87d('0x106')]('/*')[_0xb87d('0x107')](function(_0x5aefd2,_0x49bcf3){_0x49bcf3[_0xb87d('0x108')](path[_0xb87d('0x109')](_0x3cf5e8[_0xb87d('0x107')](_0xb87d('0x10a'))+'/index.html'));});return _0x3cf5e8;});}; \ No newline at end of file +var _0x384c=['./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/system','./api/system','./api/pm2','/api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.8.1','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','./errors','./utils/client-side-logger','./api/client-side-logs','then','use','./api/user','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/chat/interactions','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions'];(function(_0x441912,_0x46e1f2){var _0x4923e2=function(_0x1c6711){while(--_0x1c6711){_0x441912['push'](_0x441912['shift']());}};_0x4923e2(++_0x46e1f2);}(_0x384c,0x1c4));var _0xc384=function(_0x19f7ee,_0x20c796){_0x19f7ee=_0x19f7ee-0x0;var _0x35e077=_0x384c[_0x19f7ee];return _0x35e077;};'use strict';var path=require(_0xc384('0x0'));var express=require('express');var errors=require(_0xc384('0x1'));var config=require('./config/environment');var setupLoggers=require(_0xc384('0x2'))['setupLoggers'];var clientSideLogs=require(_0xc384('0x3'));exports['default']=function(_0x1bec57){return setupLoggers(_0x1bec57)[_0xc384('0x4')](function(){_0x1bec57[_0xc384('0x5')]('/api/users',require(_0xc384('0x6')));_0x1bec57['use']('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x1bec57[_0xc384('0x5')](_0xc384('0x7'),require(_0xc384('0x8')));_0x1bec57[_0xc384('0x5')]('/api/voice/extensions',require(_0xc384('0x9')));_0x1bec57['use']('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x1bec57[_0xc384('0x5')](_0xc384('0xa'),require(_0xc384('0xb')));_0x1bec57[_0xc384('0x5')](_0xc384('0xc'),require('./api/voiceRecording'));_0x1bec57[_0xc384('0x5')](_0xc384('0xd'),require(_0xc384('0xe')));_0x1bec57[_0xc384('0x5')](_0xc384('0xf'),require('./api/voiceMail'));_0x1bec57[_0xc384('0x5')](_0xc384('0x10'),require(_0xc384('0x11')));_0x1bec57[_0xc384('0x5')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x1bec57[_0xc384('0x5')](_0xc384('0x12'),require(_0xc384('0x13')));_0x1bec57['use'](_0xc384('0x14'),require('./api/voiceAgentReport'));_0x1bec57['use'](_0xc384('0x15'),require(_0xc384('0x16')));_0x1bec57[_0xc384('0x5')](_0xc384('0x17'),require(_0xc384('0x18')));_0x1bec57['use']('/api/trunks',require('./api/trunk'));_0x1bec57[_0xc384('0x5')](_0xc384('0x19'),require('./api/voiceTransferReport'));_0x1bec57[_0xc384('0x5')]('/api/mail/out_servers',require(_0xc384('0x1a')));_0x1bec57[_0xc384('0x5')]('/api/mail/accounts',require('./api/mailAccount'));_0x1bec57[_0xc384('0x5')](_0xc384('0x1b'),require(_0xc384('0x1c')));_0x1bec57['use'](_0xc384('0x1d'),require(_0xc384('0x1e')));_0x1bec57[_0xc384('0x5')](_0xc384('0x1f'),require(_0xc384('0x20')));_0x1bec57[_0xc384('0x5')](_0xc384('0x21'),require(_0xc384('0x22')));_0x1bec57[_0xc384('0x5')](_0xc384('0x23'),require(_0xc384('0x24')));_0x1bec57[_0xc384('0x5')](_0xc384('0x25'),require(_0xc384('0x26')));_0x1bec57['use'](_0xc384('0x27'),require('./api/dashboard'));_0x1bec57[_0xc384('0x5')]('/api/dashboards/items',require('./api/dashboardItem'));_0x1bec57['use'](_0xc384('0x28'),require(_0xc384('0x29')));_0x1bec57[_0xc384('0x5')]('/api/fax/applications',require(_0xc384('0x2a')));_0x1bec57[_0xc384('0x5')](_0xc384('0x2b'),require(_0xc384('0x2c')));_0x1bec57['use'](_0xc384('0x2d'),require(_0xc384('0x2e')));_0x1bec57[_0xc384('0x5')]('/api/fax/queues',require('./api/faxQueue'));_0x1bec57[_0xc384('0x5')]('/api/fax/reports/queue',require(_0xc384('0x2f')));_0x1bec57[_0xc384('0x5')](_0xc384('0x30'),require(_0xc384('0x31')));_0x1bec57[_0xc384('0x5')](_0xc384('0x32'),require(_0xc384('0x33')));_0x1bec57[_0xc384('0x5')](_0xc384('0x34'),require(_0xc384('0x35')));_0x1bec57[_0xc384('0x5')](_0xc384('0x36'),require(_0xc384('0x37')));_0x1bec57[_0xc384('0x5')](_0xc384('0x38'),require(_0xc384('0x39')));_0x1bec57[_0xc384('0x5')]('/api/openchannel/accounts',require(_0xc384('0x3a')));_0x1bec57[_0xc384('0x5')]('/api/openchannel/applications',require(_0xc384('0x3b')));_0x1bec57[_0xc384('0x5')](_0xc384('0x3c'),require(_0xc384('0x3d')));_0x1bec57[_0xc384('0x5')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x1bec57[_0xc384('0x5')](_0xc384('0x3e'),require(_0xc384('0x3f')));_0x1bec57[_0xc384('0x5')](_0xc384('0x40'),require(_0xc384('0x41')));_0x1bec57[_0xc384('0x5')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x1bec57[_0xc384('0x5')]('/api/chat/applications',require('./api/chatApplication'));_0x1bec57[_0xc384('0x5')](_0xc384('0x42'),require('./api/chatInteraction'));_0x1bec57[_0xc384('0x5')]('/api/chat/messages',require(_0xc384('0x43')));_0x1bec57[_0xc384('0x5')](_0xc384('0x44'),require(_0xc384('0x45')));_0x1bec57[_0xc384('0x5')]('/api/chat/queues',require('./api/chatQueue'));_0x1bec57[_0xc384('0x5')](_0xc384('0x46'),require(_0xc384('0x47')));_0x1bec57['use'](_0xc384('0x48'),require('./api/chatProactiveAction'));_0x1bec57[_0xc384('0x5')](_0xc384('0x49'),require(_0xc384('0x4a')));_0x1bec57[_0xc384('0x5')](_0xc384('0x4b'),require('./api/cmContact'));_0x1bec57[_0xc384('0x5')](_0xc384('0x4c'),require(_0xc384('0x4d')));_0x1bec57['use'](_0xc384('0x4e'),require(_0xc384('0x4f')));_0x1bec57[_0xc384('0x5')]('/api/cm/hopper_final',require(_0xc384('0x50')));_0x1bec57[_0xc384('0x5')](_0xc384('0x51'),require('./api/cmHopperHistory'));_0x1bec57['use']('/api/cm/custom_fields',require(_0xc384('0x52')));_0x1bec57[_0xc384('0x5')](_0xc384('0x53'),require(_0xc384('0x54')));_0x1bec57[_0xc384('0x5')](_0xc384('0x55'),require(_0xc384('0x56')));_0x1bec57[_0xc384('0x5')](_0xc384('0x57'),require(_0xc384('0x58')));_0x1bec57[_0xc384('0x5')](_0xc384('0x59'),require(_0xc384('0x5a')));_0x1bec57[_0xc384('0x5')](_0xc384('0x5b'),require(_0xc384('0x5c')));_0x1bec57['use'](_0xc384('0x5d'),require(_0xc384('0x5e')));_0x1bec57[_0xc384('0x5')](_0xc384('0x5f'),require('./api/pause'));_0x1bec57[_0xc384('0x5')](_0xc384('0x60'),require(_0xc384('0x61')));_0x1bec57[_0xc384('0x5')](_0xc384('0x62'),require(_0xc384('0x63')));_0x1bec57[_0xc384('0x5')](_0xc384('0x64'),require(_0xc384('0x65')));_0x1bec57[_0xc384('0x5')]('/api/sounds',require(_0xc384('0x66')));_0x1bec57[_0xc384('0x5')](_0xc384('0x67'),require(_0xc384('0x68')));_0x1bec57[_0xc384('0x5')](_0xc384('0x69'),require(_0xc384('0x6a')));_0x1bec57[_0xc384('0x5')]('/api/cm_contact_has_items',require(_0xc384('0x6b')));_0x1bec57[_0xc384('0x5')]('/api/cm_hopper_additional_phones',require(_0xc384('0x6c')));_0x1bec57[_0xc384('0x5')](_0xc384('0x6d'),require('./api/template'));_0x1bec57[_0xc384('0x5')](_0xc384('0x6e'),require('./api/trigger'));_0x1bec57[_0xc384('0x5')](_0xc384('0x6f'),require(_0xc384('0x70')));_0x1bec57[_0xc384('0x5')](_0xc384('0x71'),require(_0xc384('0x72')));_0x1bec57[_0xc384('0x5')](_0xc384('0x73'),require(_0xc384('0x74')));_0x1bec57[_0xc384('0x5')]('/api/analytics/custom_reports',require(_0xc384('0x75')));_0x1bec57['use'](_0xc384('0x76'),require(_0xc384('0x77')));_0x1bec57['use'](_0xc384('0x78'),require('./api/analyticExtractedReport'));_0x1bec57[_0xc384('0x5')](_0xc384('0x79'),require(_0xc384('0x7a')));_0x1bec57[_0xc384('0x5')]('/api/analytics/field_reports',require(_0xc384('0x7b')));_0x1bec57[_0xc384('0x5')](_0xc384('0x7c'),require(_0xc384('0x7d')));_0x1bec57['use'](_0xc384('0x7e'),require(_0xc384('0x7f')));_0x1bec57[_0xc384('0x5')](_0xc384('0x80'),require(_0xc384('0x81')));_0x1bec57['use'](_0xc384('0x82'),require(_0xc384('0x83')));_0x1bec57[_0xc384('0x5')](_0xc384('0x84'),require(_0xc384('0x85')));_0x1bec57[_0xc384('0x5')](_0xc384('0x86'),require('./api/intSugarcrmConfiguration'));_0x1bec57[_0xc384('0x5')]('/api/integrations/sugarcrm/fields',require(_0xc384('0x87')));_0x1bec57[_0xc384('0x5')](_0xc384('0x88'),require(_0xc384('0x89')));_0x1bec57[_0xc384('0x5')](_0xc384('0x8a'),require(_0xc384('0x8b')));_0x1bec57['use']('/api/integrations/desk/fields',require(_0xc384('0x8c')));_0x1bec57[_0xc384('0x5')](_0xc384('0x8d'),require(_0xc384('0x8e')));_0x1bec57[_0xc384('0x5')](_0xc384('0x8f'),require(_0xc384('0x90')));_0x1bec57[_0xc384('0x5')]('/api/integrations/zoho/fields',require(_0xc384('0x91')));_0x1bec57[_0xc384('0x5')](_0xc384('0x92'),require('./api/intZendeskAccount'));_0x1bec57[_0xc384('0x5')](_0xc384('0x93'),require(_0xc384('0x94')));_0x1bec57[_0xc384('0x5')]('/api/integrations/zendesk/fields',require(_0xc384('0x95')));_0x1bec57[_0xc384('0x5')](_0xc384('0x96'),require('./api/intFreshdeskAccount'));_0x1bec57['use'](_0xc384('0x97'),require(_0xc384('0x98')));_0x1bec57[_0xc384('0x5')](_0xc384('0x99'),require(_0xc384('0x9a')));_0x1bec57[_0xc384('0x5')](_0xc384('0x9b'),require('./api/intVtigerAccount'));_0x1bec57['use']('/api/integrations/vtiger/configurations',require(_0xc384('0x9c')));_0x1bec57['use']('/api/integrations/vtiger/fields',require(_0xc384('0x9d')));_0x1bec57['use'](_0xc384('0x9e'),require(_0xc384('0x9f')));_0x1bec57[_0xc384('0x5')](_0xc384('0xa0'),require(_0xc384('0xa1')));_0x1bec57[_0xc384('0x5')](_0xc384('0xa2'),require(_0xc384('0xa3')));_0x1bec57[_0xc384('0x5')]('/api/integrations/dynamics365/accounts',require(_0xc384('0xa4')));_0x1bec57[_0xc384('0x5')](_0xc384('0xa5'),require('./api/intDynamics365Configuration'));_0x1bec57[_0xc384('0x5')](_0xc384('0xa6'),require(_0xc384('0xa7')));_0x1bec57[_0xc384('0x5')](_0xc384('0xa8'),require(_0xc384('0xa9')));_0x1bec57['use'](_0xc384('0xaa'),require(_0xc384('0xab')));_0x1bec57[_0xc384('0x5')]('/api/integrations/freshsales/fields',require(_0xc384('0xac')));_0x1bec57[_0xc384('0x5')](_0xc384('0xad'),require(_0xc384('0xae')));_0x1bec57['use'](_0xc384('0xaf'),require('./api/chatQueueReport'));_0x1bec57['use'](_0xc384('0xb0'),require(_0xc384('0xb1')));_0x1bec57[_0xc384('0x5')](_0xc384('0xb2'),require(_0xc384('0xb3')));_0x1bec57[_0xc384('0x5')](_0xc384('0xb4'),require(_0xc384('0xb5')));_0x1bec57[_0xc384('0x5')](_0xc384('0xb6'),require(_0xc384('0xb7')));_0x1bec57[_0xc384('0x5')]('/api/sms/reports/queue',require(_0xc384('0xb8')));_0x1bec57[_0xc384('0x5')](_0xc384('0xb9'),require(_0xc384('0xba')));_0x1bec57[_0xc384('0x5')]('/api/square/details/reports',require(_0xc384('0xbb')));_0x1bec57[_0xc384('0x5')](_0xc384('0xbc'),require(_0xc384('0xbd')));_0x1bec57[_0xc384('0x5')](_0xc384('0xbe'),require(_0xc384('0xbf')));_0x1bec57[_0xc384('0x5')](_0xc384('0xc0'),require(_0xc384('0xc1')));_0x1bec57[_0xc384('0x5')](_0xc384('0xc2'),require('./api/squareProject'));_0x1bec57[_0xc384('0x5')](_0xc384('0xc3'),require(_0xc384('0xc4')));_0x1bec57[_0xc384('0x5')](_0xc384('0xc5'),require('./api/squareMessage'));_0x1bec57[_0xc384('0x5')]('/api/teams',require(_0xc384('0xc6')));_0x1bec57['use'](_0xc384('0xc7'),require(_0xc384('0xc8')));_0x1bec57[_0xc384('0x5')](_0xc384('0xc9'),require(_0xc384('0xca')));_0x1bec57[_0xc384('0x5')](_0xc384('0xcb'),require(_0xc384('0xcc')));_0x1bec57[_0xc384('0x5')](_0xc384('0xcd'),require(_0xc384('0xce')));_0x1bec57['use'](_0xc384('0xcf'),require(_0xc384('0xd0')));_0x1bec57[_0xc384('0x5')]('/api/mail/reports/transfer',require(_0xc384('0xd1')));_0x1bec57[_0xc384('0x5')]('/api/chat/reports/transfer',require(_0xc384('0xd2')));_0x1bec57[_0xc384('0x5')]('/api/fax/reports/transfer',require(_0xc384('0xd3')));_0x1bec57[_0xc384('0x5')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x1bec57[_0xc384('0x5')](_0xc384('0xd4'),require('./api/smsTransferReport'));_0x1bec57['use'](_0xc384('0xd5'),require('./api/cmList'));_0x1bec57['use'](_0xc384('0xd6'),require(_0xc384('0xd7')));_0x1bec57[_0xc384('0x5')]('/api/userProfiles',require(_0xc384('0xd8')));_0x1bec57['use']('/api/userProfile/sections',require('./api/userProfileSection'));_0x1bec57[_0xc384('0x5')](_0xc384('0xd9'),require(_0xc384('0xda')));_0x1bec57[_0xc384('0x5')](_0xc384('0xdb'),require(_0xc384('0xdc')));_0x1bec57[_0xc384('0x5')](_0xc384('0xdd'),require(_0xc384('0xde')));_0x1bec57[_0xc384('0x5')](_0xc384('0xdf'),require(_0xc384('0xe0')));_0x1bec57[_0xc384('0x5')](_0xc384('0xe1'),require('./api/whatsappInteraction'));_0x1bec57[_0xc384('0x5')](_0xc384('0xe2'),require(_0xc384('0xe3')));_0x1bec57[_0xc384('0x5')](_0xc384('0xe4'),require('./api/whatsappQueueReport'));_0x1bec57[_0xc384('0x5')](_0xc384('0xe5'),require(_0xc384('0xe6')));_0x1bec57[_0xc384('0x5')]('/api/whatsapp/queues',require(_0xc384('0xe7')));_0x1bec57[_0xc384('0x5')](_0xc384('0xe8'),require(_0xc384('0xe9')));_0x1bec57[_0xc384('0x5')](_0xc384('0xea'),require(_0xc384('0xeb')));_0x1bec57['use'](_0xc384('0xec'),require(_0xc384('0xed')));_0x1bec57['use'](_0xc384('0xee'),require(_0xc384('0xef')));_0x1bec57['use']('/api/auth/google',require(_0xc384('0xf0')));_0x1bec57[_0xc384('0x5')](_0xc384('0xf1'),require(_0xc384('0xf2')));_0x1bec57[_0xc384('0x5')](_0xc384('0xf3'),require(_0xc384('0xf4')));_0x1bec57['use'](_0xc384('0xf5'),require(_0xc384('0xf6')));_0x1bec57[_0xc384('0x5')]('/api/version',require('./api/version'));_0x1bec57[_0xc384('0x5')](_0xc384('0xf7'),require(_0xc384('0xf8')));_0x1bec57[_0xc384('0x5')]('/api/pm2',require(_0xc384('0xf9')));_0x1bec57[_0xc384('0x5')](_0xc384('0xfa'),require('./api/webbar'));_0x1bec57[_0xc384('0x5')](_0xc384('0xfb'),clientSideLogs);_0x1bec57['use'](_0xc384('0xfc'),express[_0xc384('0xfd')](path['join'](config[_0xc384('0xfe')],_0xc384('0xfc'))));_0x1bec57['use'](_0xc384('0xff'),express[_0xc384('0xfd')](path[_0xc384('0x100')](config[_0xc384('0xfe')],_0xc384('0xff'))));_0x1bec57[_0xc384('0x5')]('/demo',express['static'](path[_0xc384('0x100')](config[_0xc384('0xfe')],_0xc384('0x101'))));_0x1bec57[_0xc384('0x5')](_0xc384('0x102'),express[_0xc384('0xfd')](path['join'](config[_0xc384('0xfe')],_0xc384('0x103'),_0xc384('0x104'))));_0x1bec57[_0xc384('0x5')](_0xc384('0x105'),express[_0xc384('0xfd')](path[_0xc384('0x100')](config[_0xc384('0xfe')],'/server/files/plugins')));_0x1bec57[_0xc384('0x106')](_0xc384('0x107'))['get'](errors[0x194]);_0x1bec57[_0xc384('0x106')]('/*')[_0xc384('0x108')](function(_0x2f1583,_0x44d984){_0x44d984[_0xc384('0x109')](path['resolve'](_0x1bec57[_0xc384('0x108')](_0xc384('0x10a'))+_0xc384('0x10b')));});return _0x1bec57;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 63877bb..81d15f5 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb33c=['../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc'];(function(_0x1b6563,_0x3bf0f1){var _0xdea7b8=function(_0x49e6c6){while(--_0x49e6c6){_0x1b6563['push'](_0x1b6563['shift']());}};_0xdea7b8(++_0x3bf0f1);}(_0xb33c,0x12c));var _0xcb33=function(_0x4478ea,_0x593a26){_0x4478ea=_0x4478ea-0x0;var _0x5061a6=_0xb33c[_0x4478ea];return _0x5061a6;};'use strict';var jayson=require(_0xcb33('0x0'));var _=require(_0xcb33('0x1'));var config=require(_0xcb33('0x2'));exports[_0xcb33('0x3')]=function(){return new Promise(function(_0x412a76,_0x10354e){var _0x380fc1={};_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x4')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x6')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x7')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x8')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x9')));_0x380fc1=_['merge'](_0x380fc1,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/memberReport/memberReport.rpc'));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0xa')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0xb')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0xc')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0xd')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0xe')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0xf')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x10')));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x11')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x12')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x13')));_0x380fc1=_['merge'](_0x380fc1,require('../api/faxAccount/faxAccount.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/faxApplication/faxApplication.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x14')));_0x380fc1=_['merge'](_0x380fc1,require('../api/faxMessage/faxMessage.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x15')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/smsAccount/smsAccount.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/smsInteraction/smsInteraction.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x16')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x17')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x18')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x19')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x1a')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x1b')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x1c')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x1d')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/chatMessage/chatMessage.rpc'));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x1e')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x1f')));_0x380fc1=_['merge'](_0x380fc1,require('../api/cmHopper/cmHopper.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x20')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x21')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x22')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x23')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x24')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x25')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x26')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x27')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x28')));_0x380fc1=_['merge'](_0x380fc1,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x29')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x380fc1=_['merge'](_0x380fc1,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x2a')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x380fc1=_['merge'](_0x380fc1,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x2b')));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x2c')));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x2d')));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x2e')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x2f')));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x30')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x31')));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x32')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x33')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x34')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x35')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x36')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x37')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x38')));_0x380fc1=_['merge'](_0x380fc1,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x380fc1=_['merge'](_0x380fc1,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x380fc1=_['merge'](_0x380fc1,require(_0xcb33('0x39')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x3a')));_0x380fc1=_[_0xcb33('0x5')](_0x380fc1,require(_0xcb33('0x3b')));var _0x376ce4=jayson[_0xcb33('0x3c')](_0x380fc1)[_0xcb33('0x3d')]();var _0x29f0bc=config[_0xcb33('0x3e')][_0xcb33('0x3f')]||config[_0xcb33('0x3f')]+0x1;var _0x2c3d6f=config[_0xcb33('0x3e')]['ip']||_0xcb33('0x40');_0x376ce4['on'](_0xcb33('0x41'),function(_0x3149f1){return _0x10354e(_0x3149f1);});_0x376ce4[_0xcb33('0x3')](_0x29f0bc,_0x2c3d6f,function(){console[_0xcb33('0x42')](_0xcb33('0x43'),_0x2c3d6f,_0x29f0bc);require(_0xcb33('0x44'))[_0xcb33('0x45')]();return _0x412a76(_0xcb33('0x46')+_0x2c3d6f+':'+_0x29f0bc);});});}; \ No newline at end of file +var _0xe58d=['../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.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/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc'];(function(_0x106d65,_0x3991){var _0x161bea=function(_0x5bd836){while(--_0x5bd836){_0x106d65['push'](_0x106d65['shift']());}};_0x161bea(++_0x3991);}(_0xe58d,0xac));var _0xde58=function(_0x416109,_0x4f8619){_0x416109=_0x416109-0x0;var _0xf9c380=_0xe58d[_0x416109];return _0xf9c380;};'use strict';var jayson=require(_0xde58('0x0'));var _=require(_0xde58('0x1'));var config=require(_0xde58('0x2'));exports[_0xde58('0x3')]=function(){return new Promise(function(_0x4bb76d,_0x2904de){var _0x40d22d={};_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x5')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x6')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/voiceQueue/voiceQueue.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x7')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x8')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x9')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0xa')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0xb')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0xc')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0xd')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0xe')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0xf')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x10')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x11')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x12')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x13')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x14')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/faxAccount/faxAccount.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x15')));_0x40d22d=_['merge'](_0x40d22d,require('../api/faxInteraction/faxInteraction.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x16')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x17')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x18')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x19')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x1a')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x1b')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x1c')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x1d')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x1e')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x1f')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x20')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x21')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x22')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x23')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x24')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x25')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/interval/interval.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x26')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x27')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x28')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x29')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/trigger/trigger.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/variable/variable.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x2a')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x2b')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x2c')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x2d')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x2e')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x2f')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x30')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x31')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x32')));_0x40d22d=_['merge'](_0x40d22d,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x33')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x34')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/setting/setting.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x35')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x36')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x37')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/squareMessage/squareMessage.rpc'));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x38')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x39')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x3a')));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x3b')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x3c')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require(_0xde58('0x3d')));_0x40d22d=_[_0xde58('0x4')](_0x40d22d,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x40d22d=_['merge'](_0x40d22d,require(_0xde58('0x3e')));var _0x54fbfd=jayson[_0xde58('0x3f')](_0x40d22d)['http']();var _0x55f8ff=config[_0xde58('0x40')][_0xde58('0x41')]||config[_0xde58('0x41')]+0x1;var _0x22b77f=config[_0xde58('0x40')]['ip']||'localhost';_0x54fbfd['on']('error',function(_0xd7905a){return _0x2904de(_0xd7905a);});_0x54fbfd[_0xde58('0x3')](_0x55f8ff,_0x22b77f,function(){console[_0xde58('0x42')](_0xde58('0x43'),_0x22b77f,_0x55f8ff);require(_0xde58('0x44'))['default']();return _0x4bb76d('RPC\x20listening\x20on\x20'+_0x22b77f+':'+_0x55f8ff);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 385f136..6680c8b 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 _0xc962=['inherits','sync','prototype','answer','sendRequest','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','format','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','function','no\x20code','substr','indexOf','split','length','match','error','close','timeout','destroy','pipe','write'];(function(_0x214ffc,_0x430a6d){var _0x366bbf=function(_0x243368){while(--_0x243368){_0x214ffc['push'](_0x214ffc['shift']());}};_0x366bbf(++_0x430a6d);}(_0xc962,0x6d));var _0x2c96=function(_0x56fb6c,_0x109215){_0x56fb6c=_0x56fb6c-0x0;var _0x41b71c=_0xc962[_0x56fb6c];return _0x41b71c;};'use strict';var util=require(_0x2c96('0x0'));var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0x2c96('0x1'));var AGIError=require(_0x2c96('0x2'));function AGIChannel(_0x13ca61){var _0x1a1faf=this,_0x305702=new AGIReply(),_0x83568f=![],_0x451d99={};EventEmitter[_0x2c96('0x3')](_0x1a1faf);_0x13ca61['setEncoding'](_0x2c96('0x4'));_0x13ca61[_0x2c96('0x5')](0x8*0x3c*0x3c*0x3e8);_0x305702[_0x2c96('0x6')](_0x2c96('0x4'));_0x305702['on'](_0x2c96('0x7'),function(_0x36dd95){for(var _0x1115b7 in _0x36dd95){_0x1a1faf[_0x1115b7]=_0x36dd95[_0x1115b7];}_0x1a1faf[_0x2c96('0x8')](_0x2c96('0x9'));});_0x305702['on']('line',function(_0x4860c3){if(_0x4860c3[_0x2c96('0xa')]()==_0x2c96('0xb')){_0x1a1faf[_0x2c96('0x8')](_0x2c96('0xb'));return;}if(_0x4860c3[_0x2c96('0xc')](0x0,0xb)==_0x2c96('0xd')){_0x83568f=!![];}if(_0x83568f){_0x451d99['rx']+=_0x4860c3+'\x0a';if(_0x4860c3['search']('520\x20End\x20of\x20proper')!=-0x1){_0x83568f=![];}}else{_0x451d99['rx']=_0x4860c3;}if(_0x83568f){return;}if(typeof _0x451d99['cb']==_0x2c96('0xe')){var _0x43d83f=_0x451d99['rx'][_0x2c96('0xc')](0x0,0x3),_0x27a97c=null,_0x2491a4=null;_0x43d83f=parseInt(_0x43d83f);if(isNaN(_0x43d83f)){_0x451d99['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2c96('0xf')});return;}if(_0x43d83f!=0xc8){_0x451d99['cb'](null,{'code':_0x43d83f,'result':-0x1,'extra':'KO'});return;}_0x27a97c=_0x451d99['rx'][_0x2c96('0xc')](0x4)['replace']('result=','');if(_0x27a97c['indexOf']('\x20')!=-0x1){_0x27a97c=_0x27a97c[_0x2c96('0x10')](0x0,_0x27a97c[_0x2c96('0x11')]('\x20'));}if(_['startsWith'](_0x27a97c,'-1')){_0x27a97c=parseInt(_0x27a97c);}_0x2491a4=_0x451d99['rx'][_0x2c96('0x12')]('\x20');if(_0x2491a4[_0x2c96('0x13')]==0x3){_0x2491a4=_0x2491a4[0x2]['substring'](0x1,_0x2491a4[0x2][_0x2c96('0x13')]-0x1);}else if(_0x2491a4[_0x2c96('0x13')]>0x3){var _0x2b26b4=/\((.+)\)/;var _0x36dc59=_0x451d99['rx'][_0x2c96('0x14')](_0x2b26b4);if(_0x36dc59){_0x2491a4=_0x36dc59[0x1];}else{_0x2491a4=null;}}else{_0x2491a4=null;}_0x451d99['cb'](null,{'code':_0x43d83f,'result':_0x27a97c,'extra':_0x2491a4});}});_0x13ca61['on'](_0x2c96('0x15'),function(_0x2ccbed){_0x1a1faf[_0x2c96('0x8')](_0x2c96('0x15'),new AGIError('E_AGI_SOCKET_ERROR',_0x2ccbed['code']));});_0x13ca61['on'](_0x2c96('0x16'),function(){_0x1a1faf[_0x2c96('0x8')](_0x2c96('0x16'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x13ca61['on'](_0x2c96('0x17'),function(){_0x1a1faf[_0x2c96('0x8')](_0x2c96('0x17'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x13ca61[_0x2c96('0x18')]();});_0x13ca61[_0x2c96('0x19')](_0x305702);this['command']=function(_0x41be31,_0x173867){var _0x41be31=_0x41be31||'',_0x173867=typeof _0x173867==_0x2c96('0xe')?_0x173867:new Function();_0x451d99={'tx':_0x41be31,'rx':'','cb':_0x173867};_0x13ca61[_0x2c96('0x1a')](_0x41be31+'\x0a');},this[_0x2c96('0x16')]=function(){_0x13ca61['destroy']();};}util[_0x2c96('0x1b')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x42eb37){return this['command'][_0x2c96('0x1c')](this,_0x42eb37);};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x1e')]=function(){return this[_0x2c96('0x1f')]('ANSWER');};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x20')]=function(_0x490f14,_0x13f0c1,_0x15f5d7){_0x490f14=_0x490f14===undefined?_0x2c96('0x21'):_0x490f14;_0x13f0c1=_0x13f0c1===undefined?'5':_0x13f0c1;_0x15f5d7=_0x15f5d7===undefined?'1':_0x15f5d7;return this[_0x2c96('0x1f')](util['format'](_0x2c96('0x22'),_0x490f14,_0x13f0c1*0x3e8,_0x15f5d7));};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x23')]=function(_0x319ad5){_0x319ad5=_0x319ad5||'NO\x20MESSAGE';return this[_0x2c96('0x1f')](util[_0x2c96('0x24')]('VERBOSE\x20\x22%s\x22',_0x319ad5));};AGIChannel[_0x2c96('0x1d')]['exec']=function(_0x2a6e75,_0x761fe1){if(_[_0x2c96('0x25')](_0x761fe1)){return this[_0x2c96('0x1f')](util[_0x2c96('0x24')](_0x2c96('0x26'),_0x2a6e75,_0x761fe1[_0x2c96('0x27')](',')));}return this[_0x2c96('0x1f')](util['format'](_0x2c96('0x26'),_0x2a6e75,_0x761fe1));};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x28')]=function(_0x50b343){return this[_0x2c96('0x1f')](util[_0x2c96('0x24')](_0x2c96('0x29'),_0x50b343));};AGIChannel['prototype'][_0x2c96('0x2a')]=function(_0x5f9971){return this[_0x2c96('0x1f')](util[_0x2c96('0x24')](_0x2c96('0x2b'),_0x5f9971));};AGIChannel['prototype'][_0x2c96('0x2c')]=function(_0x39cc4){return this[_0x2c96('0x1f')](util[_0x2c96('0x24')](_0x2c96('0x2d'),_0x39cc4));};AGIChannel[_0x2c96('0x1d')][_0x2c96('0xb')]=function(){return this[_0x2c96('0x1f')]('HANGUP');};AGIChannel['prototype'][_0x2c96('0x2e')]=function(_0x1d6f84,_0x3a30a0){var _0x3f1f63=_['isBoolean'](_0x3a30a0)||_[_0x2c96('0x2f')](_0x3a30a0)?_0x3a30a0['toString']():_0x3a30a0;return this[_0x2c96('0x1f')](util[_0x2c96('0x24')](_0x2c96('0x30'),_0x1d6f84,_0x3f1f63?_0x3f1f63[_0x2c96('0x31')]()[_0x2c96('0x32')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x2c96('0x33')]=function(_0x498bbd,_0x360be4){return this[_0x2c96('0x1f')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x498bbd,_0x360be4));};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x34')]=function(_0x1622fd,_0x4655d6){return this[_0x2c96('0x1f')](util[_0x2c96('0x24')]('SAY\x20DIGITS\x20%s\x20%s',_0x1622fd,_0x4655d6));};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x35')]=function(_0x532c08,_0x5f04de){return this[_0x2c96('0x1f')](util[_0x2c96('0x24')](_0x2c96('0x36'),_0x532c08,_0x5f04de));};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x37')]=function(_0x40581d,_0x4706a8,_0xf0e3b6){_0x4706a8=_0x4706a8||this[_0x2c96('0x38')];_0xf0e3b6=_0xf0e3b6||0x1;this[_0x2c96('0x28')](_0x40581d);this[_0x2c96('0x2a')](_0x4706a8);this[_0x2c96('0x2c')](_0xf0e3b6);return this['noop'](util['format'](_0x2c96('0x39'),_0x40581d,_0x4706a8,_0xf0e3b6));};AGIChannel['prototype'][_0x2c96('0x3a')]=function(_0x1e6d13){return this[_0x2c96('0x1f')](util[_0x2c96('0x24')](_0x2c96('0x3b'),_0x1e6d13));};AGIChannel['prototype']['recordFile']=function(_0x509e73,_0x577dea,_0x476f91,_0x4a090e,_0x12b9b1,_0x4406d9){_0x577dea=_0x577dea||_0x2c96('0x3c');_0x476f91=_0x476f91||'';_0x4a090e=_0x4a090e===undefined?-0x1:_0x4a090e==='-1'?-0x1:_0x4a090e*0x3e8;_0x12b9b1=_0x12b9b1===undefined?'':'s='+_0x12b9b1;_0x4406d9=_0x4406d9?'BEEP':'';return this[_0x2c96('0x1f')](util[_0x2c96('0x24')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x509e73,_0x577dea,_0x476f91,_0x4a090e,_0x4406d9,_0x12b9b1));};AGIChannel[_0x2c96('0x1d')]['streamFile']=function(_0x3bd9de,_0x2bef26){_0x2bef26=_0x2bef26||'';return this[_0x2c96('0x1f')](util[_0x2c96('0x24')](_0x2c96('0x3d'),_0x3bd9de,_0x2bef26));};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x3e')]=function(_0x12cce2){return this['exec'](_0x2c96('0x3f'),_0x12cce2);};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x40')]=function(_0x28c1d1){return this['exec'](_0x2c96('0x41'),_0x28c1d1);};AGIChannel[_0x2c96('0x1d')][_0x2c96('0x15')]=function(_0x45118c,_0x202a15){this['noop'](util[_0x2c96('0x24')](_0x2c96('0x42'),_0x45118c['id'],_0x45118c['label'],_0x202a15));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2c96('0x43')]=AGIChannel; \ No newline at end of file +var _0x9e0d=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','join','setContext','setExtension','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','WAIT','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','search','520\x20End\x20of\x20proper','function','no\x20code','substring','replace','result=','substr','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','sync','answer','sendRequest'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x9e0d,0xf8));var _0xd9e0=function(_0x1fd2e8,_0x49432f){_0x1fd2e8=_0x1fd2e8-0x0;var _0x32524e=_0x9e0d[_0x1fd2e8];return _0x32524e;};'use strict';var util=require(_0xd9e0('0x0'));var _=require(_0xd9e0('0x1'));var EventEmitter=require(_0xd9e0('0x2'))[_0xd9e0('0x3')];var AGIReply=require(_0xd9e0('0x4'));var AGIError=require(_0xd9e0('0x5'));function AGIChannel(_0x1e11be){var _0x1de805=this,_0x3e20bb=new AGIReply(),_0x275a3b=![],_0x53198b={};EventEmitter['call'](_0x1de805);_0x1e11be[_0xd9e0('0x6')](_0xd9e0('0x7'));_0x1e11be[_0xd9e0('0x8')](0x8*0x3c*0x3c*0x3e8);_0x3e20bb[_0xd9e0('0x6')](_0xd9e0('0x7'));_0x3e20bb['on'](_0xd9e0('0x9'),function(_0x5eaf67){for(var _0x270537 in _0x5eaf67){_0x1de805[_0x270537]=_0x5eaf67[_0x270537];}_0x1de805[_0xd9e0('0xa')](_0xd9e0('0xb'));});_0x3e20bb['on']('line',function(_0x2dcc52){if(_0x2dcc52[_0xd9e0('0xc')]()=='hangup'){_0x1de805['emit'](_0xd9e0('0xd'));return;}if(_0x2dcc52['substring'](0x0,0xb)=='520-Invalid'){_0x275a3b=!![];}if(_0x275a3b){_0x53198b['rx']+=_0x2dcc52+'\x0a';if(_0x2dcc52[_0xd9e0('0xe')](_0xd9e0('0xf'))!=-0x1){_0x275a3b=![];}}else{_0x53198b['rx']=_0x2dcc52;}if(_0x275a3b){return;}if(typeof _0x53198b['cb']==_0xd9e0('0x10')){var _0x4e43f4=_0x53198b['rx']['substring'](0x0,0x3),_0x351f90=null,_0x4abfbf=null;_0x4e43f4=parseInt(_0x4e43f4);if(isNaN(_0x4e43f4)){_0x53198b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xd9e0('0x11')});return;}if(_0x4e43f4!=0xc8){_0x53198b['cb'](null,{'code':_0x4e43f4,'result':-0x1,'extra':'KO'});return;}_0x351f90=_0x53198b['rx'][_0xd9e0('0x12')](0x4)[_0xd9e0('0x13')](_0xd9e0('0x14'),'');if(_0x351f90['indexOf']('\x20')!=-0x1){_0x351f90=_0x351f90[_0xd9e0('0x15')](0x0,_0x351f90[_0xd9e0('0x16')]('\x20'));}if(_[_0xd9e0('0x17')](_0x351f90,'-1')){_0x351f90=parseInt(_0x351f90);}_0x4abfbf=_0x53198b['rx']['split']('\x20');if(_0x4abfbf[_0xd9e0('0x18')]==0x3){_0x4abfbf=_0x4abfbf[0x2][_0xd9e0('0x12')](0x1,_0x4abfbf[0x2][_0xd9e0('0x18')]-0x1);}else if(_0x4abfbf[_0xd9e0('0x18')]>0x3){var _0x4040a4=/\((.+)\)/;var _0x2debbd=_0x53198b['rx'][_0xd9e0('0x19')](_0x4040a4);if(_0x2debbd){_0x4abfbf=_0x2debbd[0x1];}else{_0x4abfbf=null;}}else{_0x4abfbf=null;}_0x53198b['cb'](null,{'code':_0x4e43f4,'result':_0x351f90,'extra':_0x4abfbf});}});_0x1e11be['on'](_0xd9e0('0x1a'),function(_0x54e1aa){_0x1de805[_0xd9e0('0xa')]('error',new AGIError(_0xd9e0('0x1b'),_0x54e1aa[_0xd9e0('0x1c')]));});_0x1e11be['on'](_0xd9e0('0x1d'),function(){_0x1de805[_0xd9e0('0xa')](_0xd9e0('0x1d'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x1e11be['on'](_0xd9e0('0x1e'),function(){_0x1de805[_0xd9e0('0xa')](_0xd9e0('0x1e'),new AGIError(_0xd9e0('0x1f')));_0x1e11be[_0xd9e0('0x20')]();});_0x1e11be['pipe'](_0x3e20bb);this[_0xd9e0('0x21')]=function(_0x1f9c4e,_0x193bb1){var _0x1f9c4e=_0x1f9c4e||'',_0x193bb1=typeof _0x193bb1==_0xd9e0('0x10')?_0x193bb1:new Function();_0x53198b={'tx':_0x1f9c4e,'rx':'','cb':_0x193bb1};_0x1e11be[_0xd9e0('0x22')](_0x1f9c4e+'\x0a');},this[_0xd9e0('0x1d')]=function(){_0x1e11be[_0xd9e0('0x20')]();};}util[_0xd9e0('0x23')](AGIChannel,EventEmitter);AGIChannel[_0xd9e0('0x24')]['sendRequest']=function(_0x4e65ac){return this[_0xd9e0('0x21')][_0xd9e0('0x25')](this,_0x4e65ac);};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x26')]=function(){return this[_0xd9e0('0x27')]('ANSWER');};AGIChannel[_0xd9e0('0x24')]['getData']=function(_0xb24759,_0x412091,_0x33826c){_0xb24759=_0xb24759===undefined?'beep':_0xb24759;_0x412091=_0x412091===undefined?'5':_0x412091;_0x33826c=_0x33826c===undefined?'1':_0x33826c;return this[_0xd9e0('0x27')](util[_0xd9e0('0x28')](_0xd9e0('0x29'),_0xb24759,_0x412091*0x3e8,_0x33826c));};AGIChannel['prototype'][_0xd9e0('0x2a')]=function(_0x34b3a8){_0x34b3a8=_0x34b3a8||'NO\x20MESSAGE';return this[_0xd9e0('0x27')](util['format']('VERBOSE\x20\x22%s\x22',_0x34b3a8));};AGIChannel['prototype'][_0xd9e0('0x2b')]=function(_0x57a0c7,_0x2628a8){if(_[_0xd9e0('0x2c')](_0x2628a8)){return this[_0xd9e0('0x27')](util[_0xd9e0('0x28')]('EXEC\x20%s\x20%s',_0x57a0c7,_0x2628a8[_0xd9e0('0x2d')](',')));}return this['sendRequest'](util[_0xd9e0('0x28')]('EXEC\x20%s\x20%s',_0x57a0c7,_0x2628a8));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x2e')]=function(_0x2d5f7c){return this[_0xd9e0('0x27')](util[_0xd9e0('0x28')]('SET\x20CONTEXT\x20%s',_0x2d5f7c));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x2f')]=function(_0x38efb0){return this[_0xd9e0('0x27')](util['format']('SET\x20EXTENSION\x20%s',_0x38efb0));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x30')]=function(_0x529b06){return this[_0xd9e0('0x27')](util['format']('SET\x20PRIORITY\x20%s',_0x529b06));};AGIChannel['prototype']['hangup']=function(){return this[_0xd9e0('0x27')](_0xd9e0('0x31'));};AGIChannel['prototype'][_0xd9e0('0x32')]=function(_0x58661f,_0x396a73){var _0x1a4343=_[_0xd9e0('0x33')](_0x396a73)||_[_0xd9e0('0x34')](_0x396a73)?_0x396a73[_0xd9e0('0x35')]():_0x396a73;return this[_0xd9e0('0x27')](util[_0xd9e0('0x28')](_0xd9e0('0x36'),_0x58661f,_0x1a4343?_0x1a4343['toString']()[_0xd9e0('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x37')]=function(_0x592891,_0x50ff6a){return this[_0xd9e0('0x27')](util[_0xd9e0('0x28')]('SAY\x20NUMBER\x20%s\x20%s',_0x592891,_0x50ff6a));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x38')]=function(_0x4eb17e,_0xeef394){return this[_0xd9e0('0x27')](util['format'](_0xd9e0('0x39'),_0x4eb17e,_0xeef394));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x3a')]=function(_0x3549bc,_0x450841){return this[_0xd9e0('0x27')](util[_0xd9e0('0x28')](_0xd9e0('0x3b'),_0x3549bc,_0x450841));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x3c')]=function(_0x518906,_0x25a4bb,_0x2a943b){_0x25a4bb=_0x25a4bb||this[_0xd9e0('0x3d')];_0x2a943b=_0x2a943b||0x1;this['setContext'](_0x518906);this['setExtension'](_0x25a4bb);this[_0xd9e0('0x30')](_0x2a943b);return this['noop'](util[_0xd9e0('0x28')](_0xd9e0('0x3e'),_0x518906,_0x25a4bb,_0x2a943b));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x3f')]=function(_0x337b0a){return this[_0xd9e0('0x27')](util[_0xd9e0('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x337b0a));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x40')]=function(_0x307f2d,_0x2e83e5,_0xfc9b8,_0x29aacd,_0x3356c3,_0x59d84e){_0x2e83e5=_0x2e83e5||'wav';_0xfc9b8=_0xfc9b8||'';_0x29aacd=_0x29aacd===undefined?-0x1:_0x29aacd==='-1'?-0x1:_0x29aacd*0x3e8;_0x3356c3=_0x3356c3===undefined?'':'s='+_0x3356c3;_0x59d84e=_0x59d84e?_0xd9e0('0x41'):'';return this[_0xd9e0('0x27')](util['format'](_0xd9e0('0x42'),_0x307f2d,_0x2e83e5,_0xfc9b8,_0x29aacd,_0x59d84e,_0x3356c3));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x43')]=function(_0x21b8d2,_0x2900a8){_0x2900a8=_0x2900a8||'';return this['sendRequest'](util[_0xd9e0('0x28')](_0xd9e0('0x44'),_0x21b8d2,_0x2900a8));};AGIChannel[_0xd9e0('0x24')][_0xd9e0('0x45')]=function(_0x583230){return this[_0xd9e0('0x2b')]('AGI',_0x583230);};AGIChannel[_0xd9e0('0x24')]['wait']=function(_0xfa5e92){return this[_0xd9e0('0x2b')](_0xd9e0('0x46'),_0xfa5e92);};AGIChannel[_0xd9e0('0x24')]['error']=function(_0x540f27,_0x1bb3e9){this[_0xd9e0('0x2a')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x540f27['id'],_0x540f27['label'],_0x1bb3e9));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd9e0('0x47')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 6342270..d5868a8 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 _0x0e96=['E_AGI_UNDEFINED','push','format','exports','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.','Socket\x20closed.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x3514b3,_0x1e68c6){var _0x22f018=function(_0xcd513a){while(--_0xcd513a){_0x3514b3['push'](_0x3514b3['shift']());}};_0x22f018(++_0x1e68c6);}(_0x0e96,0xc7));var _0x60e9=function(_0x528783,_0xce097d){_0x528783=_0x528783-0x0;var _0x4940da=_0x0e96[_0x528783];return _0x4940da;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x60e9('0x0'),'E_AGI_ARGUMENT_PORT':_0x60e9('0x1'),'E_AGI_SERVER_ERROR':_0x60e9('0x2'),'E_AGI_SERVER_CLOSE':_0x60e9('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x60e9('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x60e9('0x5'),'E_AGI_SOCKET_ERROR':_0x60e9('0x6'),'E_AGI_SOCKET_CLOSE':_0x60e9('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x60e9('0x8')};function AGIError(_0xe90a50){var _0xe90a50=_0xe90a50||null,_0x2e5f0a=_0x2e5f0a||[],_0x429ff9=0x1,_0x3db51b='';if(!error[_0xe90a50]){_0xe90a50=_0x60e9('0x9');}_0x2e5f0a[_0x60e9('0xa')](error[_0xe90a50]);while(arguments[_0x429ff9]){_0x2e5f0a[_0x60e9('0xa')](arguments[_0x429ff9]);_0x429ff9++;}_0x3db51b=util[_0x60e9('0xb')]['apply'](util,_0x2e5f0a);this['message']=_0x3db51b;this['name']=_0xe90a50;}module[_0x60e9('0xc')]=AGIError; \ No newline at end of file +var _0x99bd=['push','apply','message','name','exports','Undefined\x20error.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x5925b5,_0x35005c){var _0x5b2ac2=function(_0x5d517e){while(--_0x5d517e){_0x5925b5['push'](_0x5925b5['shift']());}};_0x5b2ac2(++_0x35005c);}(_0x99bd,0x171));var _0xd99b=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x99bd[_0x32f7d7];return _0x133d09;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xd99b('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xd99b('0x1'),'E_AGI_SERVER_MAXCONNECTION':_0xd99b('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xd99b('0x3'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xd99b('0x4'),'E_AGI_SOCKET_TIMEOUT':_0xd99b('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd99b('0x6'),'E_AGI_IVR_ENTRY':_0xd99b('0x7')};function AGIError(_0x3cfe87){var _0x3cfe87=_0x3cfe87||null,_0xcb7444=_0xcb7444||[],_0x3d9b82=0x1,_0x11bb0f='';if(!error[_0x3cfe87]){_0x3cfe87=_0xd99b('0x8');}_0xcb7444[_0xd99b('0x9')](error[_0x3cfe87]);while(arguments[_0x3d9b82]){_0xcb7444['push'](arguments[_0x3d9b82]);_0x3d9b82++;}_0x11bb0f=util['format'][_0xd99b('0xa')](util,_0xcb7444);this[_0xd99b('0xb')]=_0x11bb0f;this[_0xd99b('0xc')]=_0x3cfe87;}module[_0xd99b('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index a410bcc..6357a4e 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 _0x11fc=['events','ioredis','../../config/environment','redis','localhost','subscribe','agi','error','message','parse','emit','E_AGI_SERVER_ERROR'];(function(_0x6986b7,_0x3a5d0b){var _0x5ddfde=function(_0x319b74){while(--_0x319b74){_0x6986b7['push'](_0x6986b7['shift']());}};_0x5ddfde(++_0x3a5d0b);}(_0x11fc,0x1bc));var _0xc11f=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x11fc[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var EventEmitter=require(_0xc11f('0x0'))['EventEmitter'];var Redis=require(_0xc11f('0x1'));var AGIError=require('./error');var config=require(_0xc11f('0x2'));config[_0xc11f('0x3')]=_['defaults'](config[_0xc11f('0x3')],{'host':_0xc11f('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xc11f('0x3')]);sub[_0xc11f('0x5')](_0xc11f('0x6'),function(_0x590914){if(_0x590914)return eventEmitter['emit'](_0xc11f('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x590914));});sub['on'](_0xc11f('0x8'),function(_0x50d415,_0xa8a689){if(_0x50d415!==_0xc11f('0x6'))return;try{var _0x27a3ae=JSON[_0xc11f('0x9')](_0xa8a689);eventEmitter[_0xc11f('0xa')]('projectUpdate',_0x27a3ae);}catch(_0x59a524){eventEmitter['emit'](_0xc11f('0x7'),new AGIError(_0xc11f('0xb'),_0x59a524));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x6af7=['emit','projectUpdate','error','lodash','events','EventEmitter','./error','redis','defaults','localhost','agi','E_AGI_SERVER_ERROR','message','parse'];(function(_0xe60b4e,_0x1304b3){var _0x4db486=function(_0x3d929b){while(--_0x3d929b){_0xe60b4e['push'](_0xe60b4e['shift']());}};_0x4db486(++_0x1304b3);}(_0x6af7,0x129));var _0x76af=function(_0x43c523,_0x3f7c33){_0x43c523=_0x43c523-0x0;var _0x226f83=_0x6af7[_0x43c523];return _0x226f83;};'use strict';var _=require(_0x76af('0x0'));var EventEmitter=require(_0x76af('0x1'))[_0x76af('0x2')];var Redis=require('ioredis');var AGIError=require(_0x76af('0x3'));var config=require('../../config/environment');config[_0x76af('0x4')]=_[_0x76af('0x5')](config[_0x76af('0x4')],{'host':_0x76af('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x76af('0x4')]);sub['subscribe'](_0x76af('0x7'),function(_0x5b22fc){if(_0x5b22fc)return eventEmitter['emit']('error',new AGIError(_0x76af('0x8'),_0x5b22fc));});sub['on'](_0x76af('0x9'),function(_0x3e672c,_0x28e525){if(_0x3e672c!==_0x76af('0x7'))return;try{var _0x8d1778=JSON[_0x76af('0xa')](_0x28e525);eventEmitter[_0x76af('0xb')](_0x76af('0xc'),_0x8d1778);}catch(_0x7974b){eventEmitter[_0x76af('0xb')](_0x76af('0xd'),new AGIError(_0x76af('0x8'),_0x7974b));}});module['exports']={'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 52ed271..faa1513 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 _0x2d74=['addEdge','push','size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','menu','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2d74,0x1a8));var _0x42d7=function(_0x402664,_0x19f7d8){_0x402664=_0x402664-0x0;var _0x56dcdd=_0x2d74[_0x402664];return _0x56dcdd;};'use strict';var _=require(_0x42d7('0x0'));var logger=require(_0x42d7('0x1'))(_0x42d7('0x2'));var verticesWithRetry=['menu',_0x42d7('0x3'),_0x42d7('0x4')];var Graph=function(){this[_0x42d7('0x5')]={};this[_0x42d7('0x6')]={};this[_0x42d7('0x7')]=0x0;};Graph[_0x42d7('0x8')][_0x42d7('0x9')]=function(_0x5a9d46){this[_0x42d7('0x5')][_0x5a9d46['id']]=_0x5a9d46;this[_0x42d7('0x6')][_0x5a9d46['id']]=[];};Graph['prototype'][_0x42d7('0xa')]=function(_0x21ed6b,_0x3c5aba,_0x1d9f50){this[_0x42d7('0x6')][_0x21ed6b][_0x42d7('0xb')]({'target':_0x3c5aba,'condition':_0x1d9f50});this[_0x42d7('0x7')]+=0x1;};Graph['prototype'][_0x42d7('0xc')]=function(){return _[_0x42d7('0xc')](this[_0x42d7('0x5')]);};Graph['prototype'][_0x42d7('0xd')]=function(){return this[_0x42d7('0x7')];};Graph[_0x42d7('0x8')]['getVertex']=function(_0x10298e){return this[_0x42d7('0x5')][_0x10298e];};Graph[_0x42d7('0x8')][_0x42d7('0xe')]=function(_0x4feab2,_0x50d0f1){if(!this[_0x42d7('0x5')][_0x4feab2]){return logger[_0x42d7('0xf')](_0x42d7('0x10'));}var _0x53cdaf=_0x50d0f1(this['vertices'][_0x4feab2]);if(!_0x53cdaf){return logger['info'](_0x42d7('0x11'));}if(this['edges'][_0x4feab2][_0x42d7('0x12')]===0x0){return logger[_0x42d7('0xf')](_0x42d7('0x13'));}for(var _0x12b1c1=0x0,_0x1bbe9b=[],_0x21cbc9=![];_0x12b1c1\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','createSquareReport','catch','hasOwnProperty','indexOf','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','evtHangup','hangup','find'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0x51fe,0x142));var _0xe51f=function(_0x3de2e3,_0x138ce7){_0x3de2e3=_0x3de2e3-0x0;var _0x1bce2a=_0x51fe[_0x3de2e3];return _0x1bce2a;};'use strict';var _=require(_0xe51f('0x0'));var syncho=require(_0xe51f('0x1'));var util=require(_0xe51f('0x2'));var config=require(_0xe51f('0x3'));var logger=require(_0xe51f('0x4'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0xe51f('0x5'));var Project=require('./project');var AGIEmitter=require('./events')['EventEmitter'];var projects=[];config[_0xe51f('0x6')]=_[_0xe51f('0x7')](config[_0xe51f('0x6')],{'ip':_0xe51f('0x8'),'port':0x11dd});AGIEmitter['on'](_0xe51f('0x9'),projectUpdateHandler);function connectionHandler(_0x4da66e){process[_0xe51f('0xa')](function(){syncho(function(){try{setChannelVariables(_0x4da66e);agiHandler(_0x4da66e);}catch(_0x486591){logger[_0xe51f('0xb')](_0x486591[_0xe51f('0xc')]);}});});}function projectUpdateHandler(_0x1d99a6){try{var _0x349ef7=_[_0xe51f('0xd')](projects,['id',_0x1d99a6['id']]);if(_0x349ef7>-0x1){if(_0x1d99a6[_0xe51f('0xe')]===!![]){projects[_0xe51f('0xf')](_0x349ef7,0x1);}else{projects[_0x349ef7]=_0x1d99a6;}}else{projects['push'](_0x1d99a6);}}catch(_0x541fc9){logger[_0xe51f('0xb')](_0x541fc9[_0xe51f('0xc')]);}}function listeningHandler(){console[_0xe51f('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xe51f('0x6')][_0xe51f('0x11')]);logger[_0xe51f('0x12')](util[_0xe51f('0x13')](_0xe51f('0x14'),config[_0xe51f('0x6')]['ip'],config[_0xe51f('0x6')]['port']));}function errorHandler(_0x4f7808){if(_0x4f7808&&_0x4f7808[_0xe51f('0x15')]&&_0x4f7808[_0xe51f('0x16')]){logger['error'](util['format'](_0xe51f('0x17'),_0x4f7808[_0xe51f('0x15')],_0x4f7808[_0xe51f('0x16')]));}else{logger[_0xe51f('0xb')](util['format']('[ERROR]\x20%s',_0x4f7808[_0xe51f('0xc')]));}}function closeHandler(){logger[_0xe51f('0x12')](util[_0xe51f('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xe51f('0x18')],this['callerid'],this['dnid'],this[_0xe51f('0x19')]));try{createSquareReport(this);}catch(_0x251018){logger[_0xe51f('0xb')](_0x251018[_0xe51f('0xc')]);}}function timeoutHandler(){logger[_0xe51f('0x12')](util[_0xe51f('0x13')](_0xe51f('0x1a'),this[_0xe51f('0x1b')],this['calleridname'],this[_0xe51f('0x1c')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0xe51f('0x13')](_0xe51f('0x1d'),this[_0xe51f('0x1b')],this['calleridname'],this[_0xe51f('0x1c')],this[_0xe51f('0x1e')],this[_0xe51f('0x19')]));this['evtHangup']=!![];}function createSquareReport(_0x30c1e1,_0x13af23){rpc[_0xe51f('0x1f')](_0x30c1e1)['then'](function(_0x329454){if(_0x13af23){_0x13af23(null,_0x329454);}})[_0xe51f('0x20')](function(_0x3ba60b){if(_0x13af23){_0x13af23(null,_0x3ba60b);}});}function setChannelVariables(_0x2516c1){for(var _0x285b73 in _0x2516c1){if(_0x2516c1[_0xe51f('0x21')](_0x285b73)){if(_0x285b73[_0xe51f('0x22')](_0xe51f('0x23'))===0x0){_0x2516c1[_0x285b73['substring'](0x4)]=_0x2516c1[_0x285b73];delete _0x2516c1[_0x285b73];}}}}function agiHandler(_0x1436dd){logger[_0xe51f('0x24')](_0xe51f('0x25'),JSON[_0xe51f('0x26')](_0x1436dd,null,0x2));logger[_0xe51f('0x12')](util[_0xe51f('0x13')](_0xe51f('0x27'),_0x1436dd[_0xe51f('0x1b')],_0x1436dd[_0xe51f('0x18')],_0x1436dd['callerid'],_0x1436dd[_0xe51f('0x1e')],_0x1436dd[_0xe51f('0x19')]));_0x1436dd['on'](_0xe51f('0xb'),errorHandler);_0x1436dd['on']('close',closeHandler);_0x1436dd['on'](_0xe51f('0x28'),timeoutHandler);_0x1436dd[_0xe51f('0x29')]=![];_0x1436dd['on'](_0xe51f('0x2a'),hangupHandler);var _0x13a0ba=_[_0xe51f('0x2b')](projects,['name',_0x1436dd[_0xe51f('0x1b')]]);if(!_0x13a0ba)return Project[_0xe51f('0x2c')](_0x1436dd);if(!_0x13a0ba[_0xe51f('0x2d')])return Project[_0xe51f('0x2e')](_0x1436dd);return Project[_0xe51f('0x2f')](_0x13a0ba,_0x1436dd);}function main(){var _0xb84d3b;return utilLicense[_0xe51f('0x30')]()[_0xe51f('0x31')](function(_0xc818a9){if(!_0xc818a9)return;if(_0xc818a9[_0xe51f('0x32')]){if(_0xc818a9[_0xe51f('0x33')]&&_0xc818a9['callysquare']>0x0){logger[_0xe51f('0x12')](util[_0xe51f('0x13')](_0xe51f('0x34'),_0xc818a9['callysquare']));_0xb84d3b=_0xc818a9['callysquare'];}else{logger[_0xe51f('0x12')](_0xe51f('0x35'));}}else{logger[_0xe51f('0x12')](_0xe51f('0x36'));_0xb84d3b=-0x1;}})['then'](function(){return Project[_0xe51f('0x37')]();})[_0xe51f('0x31')](function(_0x1c6ec1){projects=_0x1c6ec1;return;})[_0xe51f('0x20')](function(_0x144c62){logger[_0xe51f('0xb')](_0xe51f('0x38'),_0x144c62[_0xe51f('0xc')]);})[_0xe51f('0x39')](function(){var _0x4d9cbf=require(_0xe51f('0x3a'))(config[_0xe51f('0x6')][_0xe51f('0x11')],config[_0xe51f('0x6')]['ip'],_0xb84d3b);_0x4d9cbf['on'](_0xe51f('0xb'),errorHandler);_0x4d9cbf['on'](_0xe51f('0x3b'),listeningHandler);_0x4d9cbf['on'](_0xe51f('0x3c'),connectionHandler);_0x4d9cbf['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x3e24=['handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','close','lodash','syncho','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','nextTick','stack','findIndex','deleted','splice','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','find'];(function(_0x5451cc,_0x48cacc){var _0x274143=function(_0x1a2d6f){while(--_0x1a2d6f){_0x5451cc['push'](_0x5451cc['shift']());}};_0x274143(++_0x48cacc);}(_0x3e24,0x14f));var _0x43e2=function(_0x40fa3f,_0x3f3a11){_0x40fa3f=_0x40fa3f-0x0;var _0x5cc845=_0x3e24[_0x40fa3f];return _0x5cc845;};'use strict';var _=require(_0x43e2('0x0'));var syncho=require(_0x43e2('0x1'));var util=require('util');var config=require(_0x43e2('0x2'));var logger=require(_0x43e2('0x3'))(_0x43e2('0x4'));var utilLicense=require(_0x43e2('0x5'));var rpc=require(_0x43e2('0x6'));var Project=require(_0x43e2('0x7'));var AGIEmitter=require(_0x43e2('0x8'))[_0x43e2('0x9')];var projects=[];config[_0x43e2('0x4')]=_[_0x43e2('0xa')](config[_0x43e2('0x4')],{'ip':_0x43e2('0xb'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x3ed26e){process[_0x43e2('0xc')](function(){syncho(function(){try{setChannelVariables(_0x3ed26e);agiHandler(_0x3ed26e);}catch(_0x19b851){logger['error'](_0x19b851[_0x43e2('0xd')]);}});});}function projectUpdateHandler(_0x5122b0){try{var _0x16c94e=_[_0x43e2('0xe')](projects,['id',_0x5122b0['id']]);if(_0x16c94e>-0x1){if(_0x5122b0[_0x43e2('0xf')]===!![]){projects[_0x43e2('0x10')](_0x16c94e,0x1);}else{projects[_0x16c94e]=_0x5122b0;}}else{projects[_0x43e2('0x11')](_0x5122b0);}}catch(_0x45e57c){logger[_0x43e2('0x12')](_0x45e57c[_0x43e2('0xd')]);}}function listeningHandler(){console[_0x43e2('0x13')](_0x43e2('0x14'),config[_0x43e2('0x4')][_0x43e2('0x15')]);logger[_0x43e2('0x16')](util[_0x43e2('0x17')](_0x43e2('0x18'),config[_0x43e2('0x4')]['ip'],config[_0x43e2('0x4')][_0x43e2('0x15')]));}function errorHandler(_0x13a609){if(_0x13a609&&_0x13a609[_0x43e2('0x19')]&&_0x13a609[_0x43e2('0x1a')]){logger[_0x43e2('0x12')](util[_0x43e2('0x17')]('[%s]\x20%s',_0x13a609[_0x43e2('0x19')],_0x13a609[_0x43e2('0x1a')]));}else{logger[_0x43e2('0x12')](util[_0x43e2('0x17')](_0x43e2('0x1b'),_0x13a609[_0x43e2('0xd')]));}}function closeHandler(){logger[_0x43e2('0x16')](util[_0x43e2('0x17')](_0x43e2('0x1c'),this[_0x43e2('0x1d')],this['calleridname'],this[_0x43e2('0x1e')],this[_0x43e2('0x1f')],this[_0x43e2('0x20')]));try{createSquareReport(this);}catch(_0x31d5b8){logger[_0x43e2('0x12')](_0x31d5b8[_0x43e2('0xd')]);}}function timeoutHandler(){logger[_0x43e2('0x16')](util['format'](_0x43e2('0x21'),this[_0x43e2('0x1d')],this[_0x43e2('0x22')],this['callerid'],this[_0x43e2('0x1f')],this[_0x43e2('0x20')]));}function hangupHandler(){logger[_0x43e2('0x16')](util[_0x43e2('0x17')](_0x43e2('0x23'),this[_0x43e2('0x1d')],this[_0x43e2('0x22')],this['callerid'],this['dnid'],this[_0x43e2('0x20')]));this[_0x43e2('0x24')]=!![];}function createSquareReport(_0x2980b1,_0x1b6242){rpc[_0x43e2('0x25')](_0x2980b1)[_0x43e2('0x26')](function(_0x3007d3){if(_0x1b6242){_0x1b6242(null,_0x3007d3);}})[_0x43e2('0x27')](function(_0x5a51cb){if(_0x1b6242){_0x1b6242(null,_0x5a51cb);}});}function setChannelVariables(_0x18ee5b){for(var _0x5ee6e1 in _0x18ee5b){if(_0x18ee5b[_0x43e2('0x28')](_0x5ee6e1)){if(_0x5ee6e1[_0x43e2('0x29')](_0x43e2('0x2a'))===0x0){_0x18ee5b[_0x5ee6e1[_0x43e2('0x2b')](0x4)]=_0x18ee5b[_0x5ee6e1];delete _0x18ee5b[_0x5ee6e1];}}}}function agiHandler(_0x6098ad){logger[_0x43e2('0x2c')](_0x43e2('0x2d'),JSON['stringify'](_0x6098ad,null,0x2));logger[_0x43e2('0x16')](util[_0x43e2('0x17')](_0x43e2('0x2e'),_0x6098ad[_0x43e2('0x1d')],_0x6098ad[_0x43e2('0x22')],_0x6098ad[_0x43e2('0x1e')],_0x6098ad[_0x43e2('0x1f')],_0x6098ad['uniqueid']));_0x6098ad['on'](_0x43e2('0x12'),errorHandler);_0x6098ad['on']('close',closeHandler);_0x6098ad['on']('timeout',timeoutHandler);_0x6098ad[_0x43e2('0x24')]=![];_0x6098ad['on'](_0x43e2('0x2f'),hangupHandler);var _0x2bb963=_[_0x43e2('0x30')](projects,['name',_0x6098ad[_0x43e2('0x1d')]]);if(!_0x2bb963)return Project[_0x43e2('0x31')](_0x6098ad);if(!_0x2bb963[_0x43e2('0x32')])return Project[_0x43e2('0x33')](_0x6098ad);return Project[_0x43e2('0x34')](_0x2bb963,_0x6098ad);}function main(){var _0xbe41c3;return utilLicense[_0x43e2('0x35')]()['then'](function(_0x34a1bd){if(!_0x34a1bd)return;if(_0x34a1bd['voice']){if(_0x34a1bd[_0x43e2('0x36')]&&_0x34a1bd[_0x43e2('0x36')]>0x0){logger['info'](util[_0x43e2('0x17')](_0x43e2('0x37'),_0x34a1bd[_0x43e2('0x36')]));_0xbe41c3=_0x34a1bd[_0x43e2('0x36')];}else{logger[_0x43e2('0x16')](_0x43e2('0x38'));}}else{logger[_0x43e2('0x16')](_0x43e2('0x39'));_0xbe41c3=-0x1;}})['then'](function(){return Project[_0x43e2('0x3a')]();})[_0x43e2('0x26')](function(_0x469bb8){projects=_0x469bb8;return;})[_0x43e2('0x27')](function(_0x4a1ab5){logger[_0x43e2('0x12')](_0x43e2('0x3b'),_0x4a1ab5[_0x43e2('0xd')]);})[_0x43e2('0x3c')](function(){var _0x474320=require(_0x43e2('0x3d'))(config[_0x43e2('0x4')][_0x43e2('0x15')],config['agi']['ip'],_0xbe41c3);_0x474320['on'](_0x43e2('0x12'),errorHandler);_0x474320['on'](_0x43e2('0x3e'),listeningHandler);_0x474320['on']('connection',connectionHandler);_0x474320['on'](_0x43e2('0x3f'),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 6ab846d..7831601 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 _0x5d6d=['sendMailMessage','SendMail','jayson/promise','client','http','request','then','error','message','result','catch'];(function(_0x379a70,_0x367de6){var _0x3ddaa4=function(_0x5a2582){while(--_0x5a2582){_0x379a70['push'](_0x379a70['shift']());}};_0x3ddaa4(++_0x367de6);}(_0x5d6d,0xc8));var _0xd5d6=function(_0x53ec25,_0x2785cc){_0x53ec25=_0x53ec25-0x0;var _0x2062e7=_0x5d6d[_0x53ec25];return _0x2062e7;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xd5d6('0x0'));var client=jayson[_0xd5d6('0x1')][_0xd5d6('0x2')]({'port':0x232b});function request(_0x3df821,_0x49023f){return new BPromise(function(_0xf7f506,_0x5c8ca2){return client[_0xd5d6('0x3')](_0x3df821,_0x49023f)[_0xd5d6('0x4')](function(_0x2aeaf0){if(_0x2aeaf0[_0xd5d6('0x5')]){return _0x5c8ca2(_0x2aeaf0[_0xd5d6('0x5')][_0xd5d6('0x6')]);}else{return _0xf7f506(_0x2aeaf0[_0xd5d6('0x7')]);}})[_0xd5d6('0x8')](function(_0x4dea6d){return _0x5c8ca2(_0x4dea6d);});});}exports[_0xd5d6('0x9')]=function(_0x26e420,_0x4479bd){return request(_0xd5d6('0xa'),{'account':_0x26e420,'message':_0x4479bd});}; \ No newline at end of file +var _0x6355=['bluebird','client','http','request','then','error','result','sendMailMessage','SendMail'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x6355,0x75));var _0x5635=function(_0x331504,_0x357700){_0x331504=_0x331504-0x0;var _0x58a175=_0x6355[_0x331504];return _0x58a175;};'use strict';var BPromise=require(_0x5635('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x5635('0x1')][_0x5635('0x2')]({'port':0x232b});function request(_0x29afca,_0x28e30f){return new BPromise(function(_0x1dc25b,_0x5d50ee){return client[_0x5635('0x3')](_0x29afca,_0x28e30f)[_0x5635('0x4')](function(_0x2e3297){if(_0x2e3297['error']){return _0x5d50ee(_0x2e3297[_0x5635('0x5')]['message']);}else{return _0x1dc25b(_0x2e3297[_0x5635('0x6')]);}})['catch'](function(_0x456580){return _0x5d50ee(_0x456580);});});}exports[_0x5635('0x7')]=function(_0x437c0c,_0x15ad9a){return request(_0x5635('0x8'),{'account':_0x437c0c,'message':_0x15ad9a});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index d0d4b65..a9dc0d4 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 _0x4e88=['getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','source','target','value','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','info','calleridname','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','error','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','agicommand\x20not\x20found','arg_1','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x4e88,0xf3));var _0x84e8=function(_0x53fcbe,_0x4c8a79){_0x53fcbe=_0x53fcbe-0x0;var _0x59f1fb=_0x4e88[_0x53fcbe];return _0x59f1fb;};'use strict';var _=require(_0x84e8('0x0'));var moment=require(_0x84e8('0x1'));var parser=require('xml2json');var util=require(_0x84e8('0x2'));var logger=require(_0x84e8('0x3'))(_0x84e8('0x4'));var rpc=require(_0x84e8('0x5'));var mailRpc=require(_0x84e8('0x6'));var Graph=require(_0x84e8('0x7'));var Vertices=require(_0x84e8('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x84e8('0x9')]()[_0x84e8('0xa')](function(_0x58e4c6){logger['error'](_0x84e8('0xb'),_0x58e4c6[_0x84e8('0xc')]);return[];});}function addVertex(_0x4c2803,_0x10d588,_0x5314a7){_0x10d588[_0x84e8('0xd')]=_0x5314a7;if(_0x10d588[_0x84e8('0xe')]('retry')){_0x10d588[_0x84e8('0xf')]=parseInt(_0x10d588[_0x84e8('0x10')],0xa);}_0x4c2803[_0x84e8('0x11')](_[_0x84e8('0x12')](_0x10d588,_0x84e8('0x13')));}function initGraph(_0x2c5186,_0xfcc0f9){var _0x254bed=new Graph();for(var _0x5158e3 in _0x2c5186){if(_0x2c5186[_0x84e8('0xe')](_0x5158e3)){if(_[_0x84e8('0x14')](_0x2c5186[_0x5158e3])){for(var _0x2b4ac9=0x0;_0x2b4ac9<_0x2c5186[_0x5158e3]['length'];_0x2b4ac9+=0x1){addVertex(_0x254bed,_0x2c5186[_0x5158e3][_0x2b4ac9],_0x5158e3);}}else{addVertex(_0x254bed,_0x2c5186[_0x5158e3],_0x5158e3);}}}for(var _0x32cf70=0x0;_0x32cf70<_0xfcc0f9['length'];_0x32cf70+=0x1){if(_0xfcc0f9[_0x32cf70][_0x84e8('0x15')]&&_0xfcc0f9[_0x32cf70][_0x84e8('0x16')]){_0x254bed['addEdge'](_0xfcc0f9[_0x32cf70]['source'],_0xfcc0f9[_0x32cf70]['target'],_0xfcc0f9[_0x32cf70][_0x84e8('0x17')]);}}return _0x254bed;}function getRoot(_0x1cfa56){return parser[_0x84e8('0x18')](_0x1cfa56,{'object':!![]})[_0x84e8('0x19')][_0x84e8('0x1a')];}function inspect(_0x5ea5ac){return util[_0x84e8('0x1b')](_0x5ea5ac,{'showHidden':![],'depth':null});}function initialize(_0x101078,_0x546697){var _0x3c8a18=getRoot(_0x101078[_0x84e8('0x1c')]);if(!_0x3c8a18||!_0x3c8a18[_0x84e8('0x1d')])return;var _0x426bf9,_0x31f316,_0x30368e;logger[_0x84e8('0x1e')](_0x84e8('0x1a'),JSON[_0x84e8('0x1f')](_0x3c8a18,null,0x2));_0x546697['joinAt']=moment()[_0x84e8('0x20')](_0x84e8('0x21'));_0x426bf9=initGraph(_['omit'](_0x3c8a18,_0x84e8('0x13')),_0x3c8a18[_0x84e8('0x13')]);_0x31f316=new Vertices(_0x546697,rpc,mailRpc);logger[_0x84e8('0x22')](util[_0x84e8('0x20')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x546697['arg_1'],_0x546697[_0x84e8('0x23')],_0x546697['callerid'],_0x546697[_0x84e8('0x24')],_0x546697[_0x84e8('0x25')]));_0x426bf9[_0x84e8('0x26')](_0x3c8a18[_0x84e8('0x1d')]['id'],function(_0x5ab695){try{_0x5ab695=_0x31f316[_0x84e8('0x27')](_0x5ab695);logger['debug'](_0x84e8('0x28'),JSON[_0x84e8('0x1f')](_0x5ab695,null,0x2));if(_0x5ab695[_0x84e8('0xd')]===_0x84e8('0x29')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x546697[_0x84e8('0x2a')]=_0x5ab695[_0x84e8('0x2a')]||_0x546697[_0x84e8('0x2a')];_0x546697[_0x84e8('0x2b')]=_0x5ab695[_0x84e8('0x2b')];_0x546697[_0x84e8('0x2c')]=_0x5ab695[_0x84e8('0x2c')]?_0x5ab695[_0x84e8('0x2c')]-0x1:0x1;return null;}else if(_0x5ab695&&_0x31f316[_0x5ab695[_0x84e8('0xd')]]){_0x30368e=_0x31f316[_0x5ab695[_0x84e8('0xd')]](_0x5ab695);logger[_0x84e8('0x22')](_0x84e8('0x2d'),JSON['stringify'](_0x30368e,null,0x2));if(_0x30368e&&_0x30368e[_0x84e8('0x2e')]===AGI_CODE_SUCCESS&&_0x30368e[_0x84e8('0x2f')]!==AGI_RESULT_ERROR&&!_0x546697[_0x84e8('0x30')]){logger[_0x84e8('0x1e')]('response',inspect(_0x30368e));return _[_0x84e8('0x31')](_0x30368e[_0x84e8('0x2f')])?null:_0x30368e['result'][_0x84e8('0x32')]();}else{logger['error'](_0x84e8('0x2d'),inspect(_0x30368e));return null;}}else{logger[_0x84e8('0x33')]('agicommand\x20not\x20found');return null;}}catch(_0x520624){logger[_0x84e8('0x33')](_0x520624[_0x84e8('0xc')]);return null;}});if(_0x3c8a18[_0x84e8('0x34')]){logger[_0x84e8('0x22')](util[_0x84e8('0x20')](_0x84e8('0x35'),_0x546697['arg_1'],_0x546697['calleridname'],_0x546697[_0x84e8('0x36')],_0x546697[_0x84e8('0x24')],_0x546697['uniqueid']));_0x426bf9[_0x84e8('0x26')](_0x3c8a18[_0x84e8('0x34')]['id'],function(_0xfa2d39){try{_0xfa2d39=_0x31f316[_0x84e8('0x27')](_0xfa2d39);logger[_0x84e8('0x1e')](_0x84e8('0x28'),JSON[_0x84e8('0x1f')](_0xfa2d39,null,0x2));if(_0xfa2d39&&_0x31f316[_0xfa2d39[_0x84e8('0xd')]]){_0x30368e=_0x31f316[_0xfa2d39[_0x84e8('0xd')]](_0xfa2d39);if(_0x30368e){logger['debug']('response',inspect(_0x30368e));return _[_0x84e8('0x31')](_0x30368e[_0x84e8('0x2f')])?null:_0x30368e['result']['toString']();}else{logger[_0x84e8('0x33')]('response',inspect(_0x30368e));return null;}}else{logger[_0x84e8('0x33')](_0x84e8('0x37'));return null;}}catch(_0x5ecae){logger['error'](_0x5ecae[_0x84e8('0xc')]);return null;}});}logger[_0x84e8('0x22')](util[_0x84e8('0x20')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x546697[_0x84e8('0x38')],_0x546697[_0x84e8('0x23')],_0x546697[_0x84e8('0x36')],_0x546697[_0x84e8('0x24')],_0x546697[_0x84e8('0x25')]));logger[_0x84e8('0x22')](util['format'](_0x84e8('0x39'),_0x546697['context'],_0x546697[_0x84e8('0x2b')],parseInt(_0x546697[_0x84e8('0x2c')],0xa)+0x1));_0x546697[_0x84e8('0x3a')](_0x546697[_0x84e8('0x2a')],_0x546697[_0x84e8('0x2b')],parseInt(_0x546697['priority'],0xa)+0x1);_0x546697[_0x84e8('0x3b')]();}function handleNotFound(_0x57b3c4){logger[_0x84e8('0x33')](util[_0x84e8('0x20')](_0x84e8('0x3c'),_0x57b3c4[_0x84e8('0x38')]));_0x57b3c4['continueAt'](_0x57b3c4['context'],_0x57b3c4[_0x84e8('0x2b')],parseInt(_0x57b3c4[_0x84e8('0x2c')],0xa)+0x1);_0x57b3c4[_0x84e8('0x3b')]();}function handleUnpublished(_0x157af6){logger['error'](util[_0x84e8('0x20')](_0x84e8('0x3d'),_0x157af6[_0x84e8('0x38')]));_0x157af6['continueAt'](_0x157af6[_0x84e8('0x2a')],_0x157af6[_0x84e8('0x2b')],parseInt(_0x157af6[_0x84e8('0x2c')],0xa)+0x1);_0x157af6[_0x84e8('0x3b')]();}module[_0x84e8('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x5408=['gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','finally','calleridname','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','continueAt','close','lodash','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','traverseBFS','clear','vertex'];(function(_0x102bc7,_0x706d9b){var _0x33a149=function(_0x404898){while(--_0x404898){_0x102bc7['push'](_0x102bc7['shift']());}};_0x33a149(++_0x706d9b);}(_0x5408,0x1f1));var _0x8540=function(_0x434543,_0x2fd498){_0x434543=_0x434543-0x0;var _0x3e6749=_0x5408[_0x434543];return _0x3e6749;};'use strict';var _=require(_0x8540('0x0'));var moment=require('moment');var parser=require(_0x8540('0x1'));var util=require(_0x8540('0x2'));var logger=require(_0x8540('0x3'))(_0x8540('0x4'));var rpc=require(_0x8540('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x8540('0x6'));var Vertices=require(_0x8540('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x8540('0x8')](function(_0x36d28a){logger[_0x8540('0x9')](_0x8540('0xa'),_0x36d28a[_0x8540('0xb')]);return[];});}function addVertex(_0x2a6eef,_0x117636,_0x5521f8){_0x117636[_0x8540('0xc')]=_0x5521f8;if(_0x117636[_0x8540('0xd')](_0x8540('0xe'))){_0x117636[_0x8540('0xf')]=parseInt(_0x117636[_0x8540('0xe')],0xa);}_0x2a6eef[_0x8540('0x10')](_[_0x8540('0x11')](_0x117636,_0x8540('0x12')));}function initGraph(_0x2740d4,_0x961609){var _0x3fa22d=new Graph();for(var _0x48060a in _0x2740d4){if(_0x2740d4[_0x8540('0xd')](_0x48060a)){if(_[_0x8540('0x13')](_0x2740d4[_0x48060a])){for(var _0x45c2da=0x0;_0x45c2da<_0x2740d4[_0x48060a][_0x8540('0x14')];_0x45c2da+=0x1){addVertex(_0x3fa22d,_0x2740d4[_0x48060a][_0x45c2da],_0x48060a);}}else{addVertex(_0x3fa22d,_0x2740d4[_0x48060a],_0x48060a);}}}for(var _0x4d861b=0x0;_0x4d861b<_0x961609[_0x8540('0x14')];_0x4d861b+=0x1){if(_0x961609[_0x4d861b][_0x8540('0x15')]&&_0x961609[_0x4d861b]['target']){_0x3fa22d[_0x8540('0x16')](_0x961609[_0x4d861b]['source'],_0x961609[_0x4d861b]['target'],_0x961609[_0x4d861b][_0x8540('0x17')]);}}return _0x3fa22d;}function getRoot(_0x4839bd){return parser[_0x8540('0x18')](_0x4839bd,{'object':!![]})[_0x8540('0x19')][_0x8540('0x1a')];}function inspect(_0x34bc02){return util[_0x8540('0x1b')](_0x34bc02,{'showHidden':![],'depth':null});}function initialize(_0x3f2379,_0x499241){var _0x96876=getRoot(_0x3f2379[_0x8540('0x1c')]);if(!_0x96876||!_0x96876[_0x8540('0x1d')])return;var _0x3c6496,_0x52a39b,_0x44e43f;logger[_0x8540('0x1e')]('root',JSON[_0x8540('0x1f')](_0x96876,null,0x2));_0x499241[_0x8540('0x20')]=moment()['format'](_0x8540('0x21'));_0x3c6496=initGraph(_[_0x8540('0x11')](_0x96876,_0x8540('0x12')),_0x96876[_0x8540('0x12')]);_0x52a39b=new Vertices(_0x499241,rpc,mailRpc);logger[_0x8540('0x22')](util[_0x8540('0x23')](_0x8540('0x24'),_0x499241[_0x8540('0x25')],_0x499241['calleridname'],_0x499241['callerid'],_0x499241[_0x8540('0x26')],_0x499241[_0x8540('0x27')]));_0x3c6496[_0x8540('0x28')](_0x96876['start']['id'],function(_0x160133){try{_0x160133=_0x52a39b[_0x8540('0x29')](_0x160133);logger[_0x8540('0x1e')](_0x8540('0x2a'),JSON[_0x8540('0x1f')](_0x160133,null,0x2));if(_0x160133[_0x8540('0xc')]==='gotoc'){logger[_0x8540('0x22')](_0x8540('0x2b'));_0x499241[_0x8540('0x2c')]=_0x160133[_0x8540('0x2c')]||_0x499241[_0x8540('0x2c')];_0x499241[_0x8540('0x2d')]=_0x160133[_0x8540('0x2d')];_0x499241[_0x8540('0x2e')]=_0x160133[_0x8540('0x2e')]?_0x160133[_0x8540('0x2e')]-0x1:0x1;return null;}else if(_0x160133&&_0x52a39b[_0x160133[_0x8540('0xc')]]){_0x44e43f=_0x52a39b[_0x160133[_0x8540('0xc')]](_0x160133);logger['info'](_0x8540('0x2f'),JSON[_0x8540('0x1f')](_0x44e43f,null,0x2));if(_0x44e43f&&_0x44e43f[_0x8540('0x30')]===AGI_CODE_SUCCESS&&_0x44e43f[_0x8540('0x31')]!==AGI_RESULT_ERROR&&!_0x499241[_0x8540('0x32')]){logger['debug'](_0x8540('0x2f'),inspect(_0x44e43f));return _[_0x8540('0x33')](_0x44e43f['result'])?null:_0x44e43f[_0x8540('0x31')][_0x8540('0x34')]();}else{logger[_0x8540('0x9')](_0x8540('0x2f'),inspect(_0x44e43f));return null;}}else{logger[_0x8540('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x1575e4){logger[_0x8540('0x9')](_0x1575e4[_0x8540('0xb')]);return null;}});if(_0x96876[_0x8540('0x35')]){logger[_0x8540('0x22')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x499241[_0x8540('0x25')],_0x499241[_0x8540('0x36')],_0x499241['callerid'],_0x499241[_0x8540('0x26')],_0x499241[_0x8540('0x27')]));_0x3c6496['traverseBFS'](_0x96876[_0x8540('0x35')]['id'],function(_0x4c75a6){try{_0x4c75a6=_0x52a39b[_0x8540('0x29')](_0x4c75a6);logger[_0x8540('0x1e')](_0x8540('0x2a'),JSON[_0x8540('0x1f')](_0x4c75a6,null,0x2));if(_0x4c75a6&&_0x52a39b[_0x4c75a6[_0x8540('0xc')]]){_0x44e43f=_0x52a39b[_0x4c75a6[_0x8540('0xc')]](_0x4c75a6);if(_0x44e43f){logger['debug'](_0x8540('0x2f'),inspect(_0x44e43f));return _[_0x8540('0x33')](_0x44e43f[_0x8540('0x31')])?null:_0x44e43f['result'][_0x8540('0x34')]();}else{logger['error'](_0x8540('0x2f'),inspect(_0x44e43f));return null;}}else{logger[_0x8540('0x9')](_0x8540('0x37'));return null;}}catch(_0x324481){logger[_0x8540('0x9')](_0x324481[_0x8540('0xb')]);return null;}});}logger[_0x8540('0x22')](util['format'](_0x8540('0x38'),_0x499241['arg_1'],_0x499241['calleridname'],_0x499241[_0x8540('0x39')],_0x499241[_0x8540('0x26')],_0x499241[_0x8540('0x27')]));logger['info'](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x499241[_0x8540('0x2c')],_0x499241['extension'],parseInt(_0x499241[_0x8540('0x2e')],0xa)+0x1));_0x499241[_0x8540('0x3a')](_0x499241[_0x8540('0x2c')],_0x499241[_0x8540('0x2d')],parseInt(_0x499241[_0x8540('0x2e')],0xa)+0x1);_0x499241['close']();}function handleNotFound(_0xc694e7){logger[_0x8540('0x9')](util[_0x8540('0x23')]('Project\x20%s\x20not\x20found',_0xc694e7[_0x8540('0x25')]));_0xc694e7[_0x8540('0x3a')](_0xc694e7[_0x8540('0x2c')],_0xc694e7[_0x8540('0x2d')],parseInt(_0xc694e7['priority'],0xa)+0x1);_0xc694e7['close']();}function handleUnpublished(_0x1660b1){logger[_0x8540('0x9')](util['format']('Project\x20%s\x20not\x20published',_0x1660b1['arg_1']));_0x1660b1[_0x8540('0x3a')](_0x1660b1['context'],_0x1660b1[_0x8540('0x2d')],parseInt(_0x1660b1[_0x8540('0x2e')],0xa)+0x1);_0x1660b1[_0x8540('0x3b')]();}module['exports']={'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 6dfefbd..5eb5e2b 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 _0xeaa2=['call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','substring','length','split','indexOf','slice','trim','emit','headers','line','exports','util','stream','Transform'];(function(_0x2df833,_0x5d6f55){var _0xc9e205=function(_0x5411c1){while(--_0x5411c1){_0x2df833['push'](_0x2df833['shift']());}};_0xc9e205(++_0x5d6f55);}(_0xeaa2,0x115));var _0x2eaa=function(_0x487131,_0x2c86e8){_0x487131=_0x487131-0x0;var _0xf320ff=_0xeaa2[_0x487131];return _0xf320ff;};'use strict';var util=require(_0x2eaa('0x0'));var Transform=require(_0x2eaa('0x1'))[_0x2eaa('0x2')];function AGIReply(_0x46cc49){Transform[_0x2eaa('0x3')](this,_0x46cc49);this[_0x2eaa('0x4')]='';this[_0x2eaa('0x5')]=![];}util[_0x2eaa('0x6')](AGIReply,Transform);AGIReply[_0x2eaa('0x7')][_0x2eaa('0x8')]=function(_0x496f14,_0x5e1e95,_0x4f4004){var _0x3d3a7d='\x0a',_0x438f18=['\x0a\x0a',_0x2eaa('0x9')],_0x334f5c=-0x1,_0x44e787=-0x1,_0x276303='',_0x2af64b=0x0,_0xa70c8='',_0xf4ae60='';this[_0x2eaa('0x4')]+=_0x496f14['toString']();_0xa70c8=this[_0x2eaa('0x4')];if(!this[_0x2eaa('0x5')]){_0x2af64b=0x0;while(_0x438f18[_0x2af64b]){while((_0x44e787=_0xa70c8['indexOf'](_0x438f18[_0x2af64b]))!=-0x1){_0x276303=_0x438f18[_0x2af64b];_0xf4ae60=_0xa70c8[_0x2eaa('0xa')](0x0,_0x44e787);_0xa70c8=_0xa70c8['substring'](_0x44e787+_0x276303[_0x2eaa('0xb')]);var _0x43ba2a=_0xf4ae60[_0x2eaa('0xc')](_0x3d3a7d),_0x3d2326=0x0,_0x551f6b={},_0x350bc6='',_0x3a1c38='',_0x41bfbe=-0x1;while(_0x43ba2a[_0x3d2326]){_0x41bfbe=_0x43ba2a[_0x3d2326][_0x2eaa('0xd')](':');if(_0x41bfbe!=-0x1){_0x350bc6=_0x43ba2a[_0x3d2326][_0x2eaa('0xe')](0x0,_0x41bfbe)[_0x2eaa('0xf')]();_0x3a1c38=_0x43ba2a[_0x3d2326][_0x2eaa('0xe')](_0x41bfbe+0x1)[_0x2eaa('0xf')]();if(_0x350bc6[_0x2eaa('0xb')]>0x0){_0x551f6b[_0x350bc6]=_0x3a1c38;}}else{}_0x3d2326++;}this[_0x2eaa('0x10')](_0x2eaa('0x11'),_0x551f6b);this[_0x2eaa('0x5')]=!![];}_0x2af64b++;}this[_0x2eaa('0x4')]=_0xa70c8;}else{while((_0x334f5c=_0xa70c8['indexOf'](_0x3d3a7d))!=-0x1){_0xf4ae60=_0xa70c8[_0x2eaa('0xa')](0x0,_0x334f5c);this[_0x2eaa('0x10')](_0x2eaa('0x12'),_0xf4ae60);_0xa70c8=_0xa70c8[_0x2eaa('0xa')](_0x334f5c+_0x3d3a7d[_0x2eaa('0xb')]);}this[_0x2eaa('0x4')]=_0xa70c8;}_0x4f4004();};module[_0x2eaa('0x13')]=AGIReply; \ No newline at end of file +var _0x11d9=['line','exports','util','stream','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','split','trim','slice','length','emit','headers'];(function(_0x1040c3,_0x2a798c){var _0x1878e1=function(_0xf70bf8){while(--_0xf70bf8){_0x1040c3['push'](_0x1040c3['shift']());}};_0x1878e1(++_0x2a798c);}(_0x11d9,0x87));var _0x911d=function(_0x48c966,_0x42ce94){_0x48c966=_0x48c966-0x0;var _0xe395c5=_0x11d9[_0x48c966];return _0xe395c5;};'use strict';var util=require(_0x911d('0x0'));var Transform=require(_0x911d('0x1'))['Transform'];function AGIReply(_0x10c922){Transform['call'](this,_0x10c922);this[_0x911d('0x2')]='';this['_inBody']=![];}util[_0x911d('0x3')](AGIReply,Transform);AGIReply[_0x911d('0x4')][_0x911d('0x5')]=function(_0x4eb336,_0x950bbd,_0x5c7b5e){var _0x2ec9c5='\x0a',_0x8b9098=['\x0a\x0a',_0x911d('0x6')],_0x4db43f=-0x1,_0xf4ddbd=-0x1,_0x1e5054='',_0x23b0b3=0x0,_0x1a88b8='',_0xd3b729='';this[_0x911d('0x2')]+=_0x4eb336[_0x911d('0x7')]();_0x1a88b8=this[_0x911d('0x2')];if(!this[_0x911d('0x8')]){_0x23b0b3=0x0;while(_0x8b9098[_0x23b0b3]){while((_0xf4ddbd=_0x1a88b8[_0x911d('0x9')](_0x8b9098[_0x23b0b3]))!=-0x1){_0x1e5054=_0x8b9098[_0x23b0b3];_0xd3b729=_0x1a88b8[_0x911d('0xa')](0x0,_0xf4ddbd);_0x1a88b8=_0x1a88b8[_0x911d('0xa')](_0xf4ddbd+_0x1e5054['length']);var _0x34cc46=_0xd3b729[_0x911d('0xb')](_0x2ec9c5),_0x1252b5=0x0,_0x2ae932={},_0x52a3cd='',_0x233ebb='',_0x4defd3=-0x1;while(_0x34cc46[_0x1252b5]){_0x4defd3=_0x34cc46[_0x1252b5][_0x911d('0x9')](':');if(_0x4defd3!=-0x1){_0x52a3cd=_0x34cc46[_0x1252b5]['slice'](0x0,_0x4defd3)[_0x911d('0xc')]();_0x233ebb=_0x34cc46[_0x1252b5][_0x911d('0xd')](_0x4defd3+0x1)[_0x911d('0xc')]();if(_0x52a3cd[_0x911d('0xe')]>0x0){_0x2ae932[_0x52a3cd]=_0x233ebb;}}else{}_0x1252b5++;}this[_0x911d('0xf')](_0x911d('0x10'),_0x2ae932);this[_0x911d('0x8')]=!![];}_0x23b0b3++;}this[_0x911d('0x2')]=_0x1a88b8;}else{while((_0x4db43f=_0x1a88b8[_0x911d('0x9')](_0x2ec9c5))!=-0x1){_0xd3b729=_0x1a88b8[_0x911d('0xa')](0x0,_0x4db43f);this[_0x911d('0xf')](_0x911d('0x11'),_0xd3b729);_0x1a88b8=_0x1a88b8[_0x911d('0xa')](_0x4db43f+_0x2ec9c5[_0x911d('0xe')]);}this[_0x911d('0x2')]=_0x1a88b8;}_0x5c7b5e();};module[_0x911d('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 e5e51d1..a44c6d5 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 _0xd737=['createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','http','request','error','message','result','catch','getSquareProjects','GetSquareProjects','getSquareProject','production','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','name','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','format','createSquareRecording','CreateSquareRecording'];(function(_0x5a342c,_0x25721b){var _0x3c381b=function(_0x45d48e){while(--_0x45d48e){_0x5a342c['push'](_0x5a342c['shift']());}};_0x3c381b(++_0x25721b);}(_0xd737,0x85));var _0x7d73=function(_0xda6d0f,_0x35e271){_0xda6d0f=_0xda6d0f-0x0;var _0x244540=_0xd737[_0xda6d0f];return _0x244540;};'use strict';var _=require(_0x7d73('0x0'));var moment=require('moment');var jayson=require(_0x7d73('0x1'));var client=jayson['client'][_0x7d73('0x2')]({'port':0x2329});function request(_0x26854a,_0x2bd982){return new Promise(function(_0x5cfa01,_0x5369be){return client[_0x7d73('0x3')](_0x26854a,_0x2bd982)['then'](function(_0x5c4a2c){if(_0x5c4a2c[_0x7d73('0x4')]){return _0x5369be(_0x5c4a2c[_0x7d73('0x4')][_0x7d73('0x5')]);}else{return _0x5cfa01(_0x5c4a2c[_0x7d73('0x6')]);}})[_0x7d73('0x7')](function(_0x4552e3){return _0x5369be(_0x4552e3);});});}exports[_0x7d73('0x8')]=function(){return request(_0x7d73('0x9'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0x7d73('0xa')]=function(_0x3252fc){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x3252fc},'attributes':[_0x7d73('0xb')]}});};exports['getMailAccountById']=function(_0x34704b){return request(_0x7d73('0xc'),{'options':{'raw':![],'where':{'id':_0x34704b},'include':[{'model':_0x7d73('0xd'),'as':'Smtp','include':[{'model':_0x7d73('0xe'),'as':_0x7d73('0xe')}]}],'attributes':['id','name',_0x7d73('0xf')],'smtp':!![]}});};exports[_0x7d73('0x10')]=function(_0x53fffe){return request(_0x7d73('0x11'),{'options':{'where':{'id':_0x53fffe},'attributes':['name']}});};exports[_0x7d73('0x12')]=function(_0x499223){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x499223},'attributes':[_0x7d73('0x13')]}});};exports[_0x7d73('0x14')]=function(_0x157009){return request('ShowVariable',{'options':{'where':{'id':_0x157009},'attributes':[_0x7d73('0x13')]}});};exports[_0x7d73('0x15')]=function(_0x434c52){return request(_0x7d73('0x16'),{'options':{'where':{'id':_0x434c52},'attributes':[_0x7d73('0x17')]}});};exports[_0x7d73('0x18')]=function(_0x146b1f){return request('ShowUser',{'options':{'where':{'id':_0x146b1f},'attributes':[_0x7d73('0x13')]}});};exports['getContactByPhone']=function(_0x50ec8a){return request(_0x7d73('0x19'),{'options':{'where':{'phone':_0x50ec8a[_0x7d73('0x1a')]},'attributes':['id']}});};exports[_0x7d73('0x1b')]=function(_0x4528dd){return request('ShowTrunk',{'options':{'where':{'id':_0x4528dd},'attributes':['name']}});};exports[_0x7d73('0x1c')]=function(_0x159a94){return request(_0x7d73('0x1d'),{'options':{'where':{'id':_0x159a94},'attributes':[_0x7d73('0x1e')]}});};exports['getIntervalById']=function(_0x443245){return request(_0x7d73('0x1f'),{'options':{'raw':![],'where':{'id':_0x443245},'include':[{'model':_0x7d73('0x20'),'as':_0x7d73('0x21')}]}});};exports[_0x7d73('0x22')]=function(_0xe9cbe6){return request(_0x7d73('0x23'),{'options':{'where':{'id':_0xe9cbe6},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x434a17){return request('CreateSmsMessage',{'body':_0x434a17});};exports[_0x7d73('0x24')]=function(_0x4db524){return request(_0x7d73('0x25'),{'body':_0x4db524});};exports[_0x7d73('0x26')]=function(_0x417bc3){return request(_0x7d73('0x27'),{'body':_['merge'](_0x417bc3,{'project_name':_0x417bc3[_0x7d73('0x28')],'prev_project_name':_0x417bc3['arg_2']||'','is_subproject':_0x417bc3['arg_2']?!![]:![],'leaveAt':moment()[_0x7d73('0x29')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x7d73('0x2a')]=function(_0xe43c38){return request(_0x7d73('0x2b'),{'body':_0xe43c38});};exports[_0x7d73('0x2c')]=function(_0x528754){return request(_0x7d73('0x2d'),{'body':_0x528754});};exports['createCmContact']=function(_0x4e37b2){return request(_0x7d73('0x2e'),{'options':{'raw':![],'where':{'phone':_0x4e37b2[_0x7d73('0x1a')],'ListId':_0x4e37b2[_0x7d73('0x2f')]}}})[_0x7d73('0x30')](function(_0x34273d){if(_0x34273d){return _0x34273d;}return request(_0x7d73('0x31'),{'body':_0x4e37b2});});};exports[_0x7d73('0x32')]=function(_0x307195){return request(_0x7d73('0x33'),{'options':{'where':{'id':_0x307195},'attributes':[_0x7d73('0x13')]}});};exports[_0x7d73('0x34')]=function(_0xceb5a2,_0xb1df53){return request(_0x7d73('0x35'),{'body':{'interface':_0xb1df53},'options':{'where':_0xceb5a2}});};exports['agentPause']=function(_0xb31fc0,_0x49f008,_0x141fb5){return request(_0x7d73('0x36'),{'body':{'type':_0x49f008,'uniqueid':_0x141fb5},'options':{'where':_0xb31fc0}});};exports[_0x7d73('0x37')]=function(_0x21a8ce){return request(_0x7d73('0x38'),{'body':{},'options':{'where':_0x21a8ce}});};exports[_0x7d73('0x39')]=function(_0x49e386){return request(_0x7d73('0x3a'),{'body':{},'options':{'where':_0x49e386}});}; \ No newline at end of file +var _0xb31a=['dsn','getUserById','ShowUser','GetContactByPhone','phone','getTrunkById','getSoundById','save_name','getIntervalById','Interval','Intervals','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','ShowMailAccount','Smtp','CloudProvider','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc'];(function(_0x74118b,_0x239694){var _0x257525=function(_0x531db8){while(--_0x531db8){_0x74118b['push'](_0x74118b['shift']());}};_0x257525(++_0x239694);}(_0xb31a,0xd4));var _0xab31=function(_0x391158,_0x4ecfd2){_0x391158=_0x391158-0x0;var _0x593131=_0xb31a[_0x391158];return _0x593131;};'use strict';var _=require(_0xab31('0x0'));var moment=require(_0xab31('0x1'));var jayson=require(_0xab31('0x2'));var client=jayson[_0xab31('0x3')][_0xab31('0x4')]({'port':0x2329});function request(_0xba4653,_0x39e724){return new Promise(function(_0x20b002,_0x2addad){return client[_0xab31('0x5')](_0xba4653,_0x39e724)[_0xab31('0x6')](function(_0x38b15f){if(_0x38b15f[_0xab31('0x7')]){return _0x2addad(_0x38b15f[_0xab31('0x7')][_0xab31('0x8')]);}else{return _0x20b002(_0x38b15f['result']);}})[_0xab31('0x9')](function(_0x1eaa9c){return _0x2addad(_0x1eaa9c);});});}exports[_0xab31('0xa')]=function(){return request(_0xab31('0xb'),{'options':{'raw':![],'attributes':['id',_0xab31('0xc'),_0xab31('0xd')]}});};exports[_0xab31('0xe')]=function(_0x19cb38){return request(_0xab31('0xf'),{'options':{'raw':![],'where':{'name':_0x19cb38},'attributes':['production']}});};exports['getMailAccountById']=function(_0x410969){return request(_0xab31('0x10'),{'options':{'raw':![],'where':{'id':_0x410969},'include':[{'model':'MailServerOut','as':_0xab31('0x11'),'include':[{'model':_0xab31('0x12'),'as':_0xab31('0x12')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0xab31('0x13')]=function(_0xac16ac){return request(_0xab31('0xf'),{'options':{'where':{'id':_0xac16ac},'attributes':[_0xab31('0xc')]}});};exports[_0xab31('0x14')]=function(_0xab1368){return request(_0xab31('0x15'),{'options':{'where':{'id':_0xab1368},'attributes':[_0xab31('0xc')]}});};exports[_0xab31('0x16')]=function(_0x549d06){return request('ShowVariable',{'options':{'where':{'id':_0x549d06},'attributes':[_0xab31('0xc')]}});};exports['getSquareOdbcById']=function(_0x1c0a9d){return request(_0xab31('0x17'),{'options':{'where':{'id':_0x1c0a9d},'attributes':[_0xab31('0x18')]}});};exports[_0xab31('0x19')]=function(_0x1c28d6){return request(_0xab31('0x1a'),{'options':{'where':{'id':_0x1c28d6},'attributes':[_0xab31('0xc')]}});};exports['getContactByPhone']=function(_0x2015cd){return request(_0xab31('0x1b'),{'options':{'where':{'phone':_0x2015cd[_0xab31('0x1c')]},'attributes':['id']}});};exports[_0xab31('0x1d')]=function(_0x40a9f9){return request('ShowTrunk',{'options':{'where':{'id':_0x40a9f9},'attributes':[_0xab31('0xc')]}});};exports[_0xab31('0x1e')]=function(_0x4e459f){return request('ShowSound',{'options':{'where':{'id':_0x4e459f},'attributes':[_0xab31('0x1f')]}});};exports[_0xab31('0x20')]=function(_0x2ba9cd){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2ba9cd},'include':[{'model':_0xab31('0x21'),'as':_0xab31('0x22')}]}});};exports['getSmsAccountById']=function(_0x57d61f){return request(_0xab31('0x23'),{'options':{'where':{'id':_0x57d61f},'attributes':['id',_0xab31('0xc')]}});};exports[_0xab31('0x24')]=function(_0x8b95b0){return request('CreateSmsMessage',{'body':_0x8b95b0});};exports[_0xab31('0x25')]=function(_0x5db7fd){return request(_0xab31('0x26'),{'body':_0x5db7fd});};exports[_0xab31('0x27')]=function(_0x5ccf4c){return request(_0xab31('0x28'),{'body':_['merge'](_0x5ccf4c,{'project_name':_0x5ccf4c[_0xab31('0x29')],'prev_project_name':_0x5ccf4c[_0xab31('0x2a')]||'','is_subproject':_0x5ccf4c[_0xab31('0x2a')]?!![]:![],'leaveAt':moment()['format'](_0xab31('0x2b'))})});};exports['createSquareRecording']=function(_0x53ff48){return request(_0xab31('0x2c'),{'body':_0x53ff48});};exports['createSquareMessage']=function(_0x132253){return request('CreateSquareMessage',{'body':_0x132253});};exports[_0xab31('0x2d')]=function(_0x2f35c5){return request(_0xab31('0x2e'),{'options':{'raw':![],'where':{'phone':_0x2f35c5[_0xab31('0x1c')],'ListId':_0x2f35c5[_0xab31('0x2f')]}}})[_0xab31('0x6')](function(_0x31d29d){if(_0x31d29d){return _0x31d29d;}return request(_0xab31('0x30'),{'body':_0x2f35c5});});};exports[_0xab31('0x31')]=function(_0x95a4b9){return request(_0xab31('0x32'),{'options':{'where':{'id':_0x95a4b9},'attributes':[_0xab31('0xc')]}});};exports[_0xab31('0x33')]=function(_0x4dcbf6,_0x2e9a9c){return request(_0xab31('0x34'),{'body':{'interface':_0x2e9a9c},'options':{'where':_0x4dcbf6}});};exports[_0xab31('0x35')]=function(_0x5a2524,_0x54da2a,_0x272fdc){return request(_0xab31('0x36'),{'body':{'type':_0x54da2a,'uniqueid':_0x272fdc},'options':{'where':_0x5a2524}});};exports[_0xab31('0x37')]=function(_0xe4cd28){return request(_0xab31('0x38'),{'body':{},'options':{'where':_0xe4cd28}});};exports[_0xab31('0x39')]=function(_0x3d4772){return request(_0xab31('0x3a'),{'body':{},'options':{'where':_0x3d4772}});}; \ 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 3a71b7d..e2e856b 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 _0xaf0d=['exports','./lex'];(function(_0x33cabe,_0x150132){var _0x2f0b7d=function(_0x3be430){while(--_0x3be430){_0x33cabe['push'](_0x33cabe['shift']());}};_0x2f0b7d(++_0x150132);}(_0xaf0d,0x6d));var _0xdaf0=function(_0x4b11ec,_0x519e16){_0x4b11ec=_0x4b11ec-0x0;var _0x253696=_0xaf0d[_0x4b11ec];return _0x253696;};var polly=require('./polly');var lex=require(_0xdaf0('0x0'));module[_0xdaf0('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x5549=['./lex','exports','./polly'];(function(_0x21a9b0,_0x11885f){var _0x5dfc7e=function(_0x4fa9ed){while(--_0x4fa9ed){_0x21a9b0['push'](_0x21a9b0['shift']());}};_0x5dfc7e(++_0x11885f);}(_0x5549,0x1f4));var _0x9554=function(_0xd06ac6,_0x11b5d5){_0xd06ac6=_0xd06ac6-0x0;var _0x31c0d3=_0x5549[_0xd06ac6];return _0x31c0d3;};var polly=require(_0x9554('0x0'));var lex=require(_0x9554('0x1'));module[_0x9554('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index a9ec881..23ef47e 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e){return lex(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e);}; \ No newline at end of file +var _0x2dae=['./lib/api'];(function(_0x53594e,_0x4ae44a){var _0x17c86d=function(_0x41f2ca){while(--_0x41f2ca){_0x53594e['push'](_0x53594e['shift']());}};_0x17c86d(++_0x4ae44a);}(_0x2dae,0xc3));var _0xe2da=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x2dae[_0x1196bd];return _0x26014f;};'use strict';var lex=require(_0xe2da('0x0'));module['exports']=function(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97){return lex(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97);}; \ 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 3380260..c44f549 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(_0x4be984,_0x52a9de){var _0x42b9a1=function(_0x5b9fc2){while(--_0x5b9fc2){_0x4be984['push'](_0x4be984['shift']());}};_0x42b9a1(++_0x52a9de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x134af8,_0x2c69bc){var _0x3b3a73=function(_0x4d64f7){while(--_0x4d64f7){_0x134af8['push'](_0x134af8['shift']());}};_0x3b3a73(++_0x2c69bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 3e85707..94b5eea 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0be=['./lib/api','exports'];(function(_0x5fd04,_0x5d6fff){var _0x48c27b=function(_0x3fd78b){while(--_0x3fd78b){_0x5fd04['push'](_0x5fd04['shift']());}};_0x48c27b(++_0x5d6fff);}(_0xe0be,0x108));var _0xee0b=function(_0x551c6c,_0x146a90){_0x551c6c=_0x551c6c-0x0;var _0x3af59f=_0xe0be[_0x551c6c];return _0x3af59f;};'use strict';var polly=require(_0xee0b('0x0'));module[_0xee0b('0x1')]=function(_0x180dec,_0x2f048e,_0x38e8d4,_0x1de599,_0x1aaeaf,_0x3ae337,_0x41cafb){return polly(_0x180dec,_0x2f048e,_0x38e8d4,_0x1de599,_0x1aaeaf,_0x3ae337,_0x41cafb);}; \ No newline at end of file +var _0x99ae=['./lib/api','exports'];(function(_0x5b7963,_0x10bff5){var _0x57f611=function(_0x28d52e){while(--_0x28d52e){_0x5b7963['push'](_0x5b7963['shift']());}};_0x57f611(++_0x10bff5);}(_0x99ae,0x102));var _0xe99a=function(_0x47034e,_0x31a00f){_0x47034e=_0x47034e-0x0;var _0x4c854c=_0x99ae[_0x47034e];return _0x4c854c;};'use strict';var polly=require(_0xe99a('0x0'));module[_0xe99a('0x1')]=function(_0x221ecb,_0x4fa4f1,_0x227c95,_0x36259d,_0x4e39da,_0x4d1f4f,_0xef78fa){return polly(_0x221ecb,_0x4fa4f1,_0x227c95,_0x36259d,_0x4e39da,_0x4d1f4f,_0xef78fa);}; \ 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 91daeda..efeaa9f 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 _0x44eb=['randomstring','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','bluebird'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x44eb,0x1a3));var _0xb44e=function(_0x9f54a1,_0x398ca6){_0x9f54a1=_0x9f54a1-0x0;var _0x3c54fa=_0x44eb[_0x9f54a1];return _0x3c54fa;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xb44e('0x0'));var rs=require(_0xb44e('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x322612,_0xdeb102,_0xa1bfe6){return new BPromise(function(_0x5d773c,_0x3bab34){_0x322612['synthesizeSpeech'](_0xdeb102,function(_0x27d0e1,_0x4699c6){if(_0x27d0e1){_0x3bab34(_0x27d0e1);}else if(_0x4699c6){if(_0x4699c6[_0xb44e('0x2')]instanceof Buffer){fs[_0xb44e('0x3')](_0xa1bfe6,_0x4699c6[_0xb44e('0x2')],function(_0x650845){if(_0x650845){_0x3bab34(_0x650845);}else{_0x5d773c();}});}else{_0x3bab34(new Error(_0xb44e('0x4')));}}else{_0x3bab34(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x442a36,_0x794a9d,_0x11e946,_0x288c1f,_0x2724be,_0x4b59b0,_0x4b1c9f){var _0x575c80=new AWS['Polly']({'accessKeyId':_0x442a36,'secretAccessKey':_0x794a9d,'region':_0x11e946});var _0xf1b9cf={'Text':_0x2724be,'TextType':_0x4b59b0||_0xb44e('0x5'),'OutputFormat':_0xb44e('0x6'),'VoiceId':_0x288c1f};return pollyResult(_0x575c80,_0xf1b9cf,_0x4b1c9f);}; \ No newline at end of file +var _0xdbc2=['path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0xdbc2,0x1ea));var _0x2dbc=function(_0x33ecfe,_0x322e70){_0x33ecfe=_0x33ecfe-0x0;var _0x7299e3=_0xdbc2[_0x33ecfe];return _0x7299e3;};'use strict';var fs=require('fs');var path=require(_0x2dbc('0x0'));var BPromise=require(_0x2dbc('0x1'));var rs=require(_0x2dbc('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x195423,_0x1a85dc,_0x26d63f){return new BPromise(function(_0x2b642b,_0x1814c3){_0x195423[_0x2dbc('0x3')](_0x1a85dc,function(_0x465d6f,_0x182bcd){if(_0x465d6f){_0x1814c3(_0x465d6f);}else if(_0x182bcd){if(_0x182bcd[_0x2dbc('0x4')]instanceof Buffer){fs[_0x2dbc('0x5')](_0x26d63f,_0x182bcd[_0x2dbc('0x4')],function(_0xe3203e){if(_0xe3203e){_0x1814c3(_0xe3203e);}else{_0x2b642b();}});}else{_0x1814c3(new Error(_0x2dbc('0x6')));}}else{_0x1814c3(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x2dbc('0x7')]=function(_0x1057bf,_0x1fcd6e,_0x35aef9,_0x51b784,_0x438a1f,_0x4a1c77,_0x8b62cc){var _0x580eae=new AWS[(_0x2dbc('0x8'))]({'accessKeyId':_0x1057bf,'secretAccessKey':_0x1fcd6e,'region':_0x35aef9});var _0x344dcb={'Text':_0x438a1f,'TextType':_0x4a1c77||'text','OutputFormat':_0x2dbc('0x9'),'VoiceId':_0x51b784};return pollyResult(_0x580eae,_0x344dcb,_0x8b62cc);}; \ 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 17951c4..4542ade 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3689=['exports','./lib/api'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x3689,0x13b));var _0x9368=function(_0x3bdf41,_0x540096){_0x3bdf41=_0x3bdf41-0x0;var _0x44876f=_0x3689[_0x3bdf41];return _0x44876f;};'use strict';var asr=require(_0x9368('0x0'));module[_0x9368('0x1')]=function(_0x3031e0,_0x50e006,_0x1afdce,_0x2f2b9b){return asr(_0x3031e0,_0x50e006,_0x1afdce);}; \ No newline at end of file +var _0x49f3=['exports'];(function(_0x191e8d,_0x17d22f){var _0x4000d9=function(_0x58fc57){while(--_0x58fc57){_0x191e8d['push'](_0x191e8d['shift']());}};_0x4000d9(++_0x17d22f);}(_0x49f3,0x1e7));var _0x349f=function(_0x4f58dd,_0x2733ad){_0x4f58dd=_0x4f58dd-0x0;var _0xba3baa=_0x49f3[_0x4f58dd];return _0xba3baa;};'use strict';var asr=require('./lib/api');module[_0x349f('0x0')]=function(_0x2c51a8,_0x5d282d,_0x2b437c,_0x26da7c){return asr(_0x2c51a8,_0x5d282d,_0x2b437c);}; \ 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 66dcfde..005c86e 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 _0x03ce=['exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0x03ce,0x1a1));var _0xe03c=function(_0x46a634,_0x439b70){_0x46a634=_0x46a634-0x0;var _0x42007a=_0x03ce[_0x46a634];return _0x42007a;};'use strict';var url=require(_0xe03c('0x0'));var BPromise=require(_0xe03c('0x1'));var fs=require('fs');var host=_0xe03c('0x2');module[_0xe03c('0x3')]=function(_0x56ac7a,_0x18e8ab,_0x2e9f29){return new BPromise(function(_0x326c04,_0x527a32){var _0x317708;if(typeof _0x56ac7a!==_0xe03c('0x4')||_0x56ac7a[_0xe03c('0x5')]===0x0){return _0x527a32(_0xe03c('0x6'));}if(typeof _0x18e8ab!==_0xe03c('0x4')||_0x18e8ab[_0xe03c('0x5')]===0x0){return _0x527a32(_0xe03c('0x7'));}if(typeof _0x2e9f29!=='undefined'&&(typeof _0x2e9f29!=='string'||_0x2e9f29[_0xe03c('0x5')]===0x0)){return _0x527a32(_0xe03c('0x8'));}try{_0x317708=fs[_0xe03c('0x9')](_0x56ac7a)[_0xe03c('0xa')](_0xe03c('0xb'));}catch(_0x41e99f){return _0x527a32(_0x41e99f);}return _0x326c04({'method':_0xe03c('0xc'),'uri':host+_0xe03c('0xd')+_0x18e8ab,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xe03c('0xe'),'languageCode':_0x2e9f29},'audio':{'content':_0x317708}},'json':!![]});});}; \ No newline at end of file +var _0xb2b5=['8000','string','length','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb2b5[_0x199572];return _0x13cfa3;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x4746e7,_0x1431f3,_0x518fe7){return new BPromise(function(_0x4eee87,_0x31784d){var _0x11fae1;if(typeof _0x4746e7!==_0x5b2b('0x0')||_0x4746e7[_0x5b2b('0x1')]===0x0){return _0x31784d('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x1431f3!==_0x5b2b('0x0')||_0x1431f3[_0x5b2b('0x1')]===0x0){return _0x31784d('key\x20should\x20be\x20a\x20string');}if(typeof _0x518fe7!=='undefined'&&(typeof _0x518fe7!==_0x5b2b('0x0')||_0x518fe7[_0x5b2b('0x1')]===0x0)){return _0x31784d(_0x5b2b('0x2'));}try{_0x11fae1=fs[_0x5b2b('0x3')](_0x4746e7)[_0x5b2b('0x4')](_0x5b2b('0x5'));}catch(_0x15425f){return _0x31784d(_0x15425f);}return _0x4eee87({'method':_0x5b2b('0x6'),'uri':host+'/v1/speech:recognize?key='+_0x1431f3,'body':{'config':{'encoding':_0x5b2b('0x7'),'sampleRateHertz':_0x5b2b('0x8'),'languageCode':_0x518fe7},'audio':{'content':_0x11fae1}},'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 3204453..85e2983 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 _0x9c84=['exports'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x9c84,0x9f));var _0x49c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9c84[_0x321bb2];return _0x9c12ed;};var asr=require('./asr');module[_0x49c8('0x0')]={'asr':asr}; \ No newline at end of file +var _0x7819=['exports','./asr'];(function(_0x2de7ef,_0xf7695f){var _0x2a93f4=function(_0x5a95fa){while(--_0x5a95fa){_0x2de7ef['push'](_0x2de7ef['shift']());}};_0x2a93f4(++_0xf7695f);}(_0x7819,0x1f1));var _0x9781=function(_0x2c450d,_0xf5cc65){_0x2c450d=_0x2c450d-0x0;var _0x3b693a=_0x7819[_0x2c450d];return _0x3b693a;};var asr=require(_0x9781('0x0'));module[_0x9781('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index fcda6c7..b91f730 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 _0xfaff=['resolve','info','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','.mp3','.wav','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','result','source','resolvedQuery','action','fulfillment','speech','score','code','metadata','isFallbackIntent','googleDialogflowV2','replace','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','ispeechASR','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','md5','path','querystring','request-promise','sox','google-tts-api','parse','util','./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','statusCode','error','request\x20to\x20','statusMessage','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','host','WHAT_EVER','get','\x20failed,\x20status\x20code\x20=\x20','data','transcode','error\x20convert','finish\x20to\x20convert','start','tmp','generate','writeFileSync','then','777','readFileSync','toString','base64','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','chmodSync'];(function(_0x57ea9f,_0x36d4a6){var _0x5fce7e=function(_0x205793){while(--_0x205793){_0x57ea9f['push'](_0x57ea9f['shift']());}};_0x5fce7e(++_0x36d4a6);}(_0xfaff,0xd3));var _0xffaf=function(_0x10bcc4,_0x4400e2){_0x10bcc4=_0x10bcc4-0x0;var _0x2da988=_0xfaff[_0x10bcc4];return _0x2da988;};'use strict';var apiai=require(_0xffaf('0x0'));var BPromise=require(_0xffaf('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xffaf('0x2'));var https=require('https');var md5=require(_0xffaf('0x3'));var path=require(_0xffaf('0x4'));var querystring=require(_0xffaf('0x5'));var rp=require(_0xffaf('0x6'));var rs=require('randomstring');var sox=require(_0xffaf('0x7'));var tts=require(_0xffaf('0x8'));var urlParse=require('url')[_0xffaf('0x9')];var util=require(_0xffaf('0xa'));var aws=require(_0xffaf('0xb'));var google=require(_0xffaf('0xc'));var sestek=require(_0xffaf('0xd'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0xffaf('0xe'));var ISPEECH_API=_0xffaf('0xf');function downloadFile(_0x3c7d0b,_0x551a47){return new BPromise(function(_0x5baf10,_0x5c0aa1){var _0x26c3a1=urlParse(_0x3c7d0b);var _0x1ad493=_0x26c3a1['protocol']==='https:'?https:http;var _0x1aae8e={'host':_0x26c3a1['host'],'path':_0x26c3a1[_0xffaf('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x1ad493['get'](_0x1aae8e,function(_0x4a4cd2){if(_0x4a4cd2[_0xffaf('0x10')]!==0xc8){logger[_0xffaf('0x11')](_0xffaf('0x12')+_0x3c7d0b+'\x20failed,\x20status\x20code\x20=\x20'+_0x4a4cd2[_0xffaf('0x10')]+'\x20('+_0x4a4cd2[_0xffaf('0x13')]+')');_0x5c0aa1(new Error(_0xffaf('0x12')+_0x3c7d0b+'\x20failed,\x20status\x20code\x20=\x20'+_0x4a4cd2[_0xffaf('0x10')]+'\x20('+_0x4a4cd2[_0xffaf('0x13')]+')'));return;}var _0x1c449b=fs['createWriteStream'](_0x551a47);_0x1c449b['on'](_0xffaf('0x14'),function(){logger['info'](_0xffaf('0x15'));_0x1c449b[_0xffaf('0x16')](_0x5baf10);});_0x1c449b['on'](_0xffaf('0x11'),function(_0x1d78af){fs[_0xffaf('0x17')](_0x551a47);logger[_0xffaf('0x11')](_0xffaf('0x18'),_0x1d78af);_0x5c0aa1(_0x1d78af);});_0x4a4cd2[_0xffaf('0x19')](_0x1c449b);})['on'](_0xffaf('0x11'),function(_0x156b4f){logger[_0xffaf('0x11')](_0x156b4f);_0x5c0aa1(_0x156b4f);})[_0xffaf('0x1a')]();});}function uploadFile(_0x52aea8){return new BPromise(function(_0x385737,_0x393d32){var _0x404a28=urlParse(_0x52aea8);var _0x1be0b0=_0x404a28[_0xffaf('0x1b')]==='https:'?https:http;var _0x17763f={'host':_0x404a28[_0xffaf('0x1c')],'path':_0x404a28[_0xffaf('0x4')],'headers':{'user-agent':_0xffaf('0x1d')}};_0x1be0b0[_0xffaf('0x1e')](_0x17763f,function(_0x12b564){if(_0x12b564[_0xffaf('0x10')]!==0xc8){_0x393d32(new Error(_0xffaf('0x12')+_0x52aea8+_0xffaf('0x1f')+_0x12b564[_0xffaf('0x10')]+'\x20('+_0x12b564[_0xffaf('0x13')]+')'));return;}var _0x313d08='';_0x12b564['on'](_0xffaf('0x20'),function(_0x3c334a){_0x313d08+=_0x3c334a;});_0x12b564['on'](_0xffaf('0x1a'),function(){_0x385737(_0x313d08);});})['on'](_0xffaf('0x11'),function(_0x4d26dc){_0x393d32(_0x4d26dc);})['end']();});}function convertFile(_0x3b21c2,_0x1d4406){return new BPromise(function(_0xb33698,_0x56c204){var _0x4e6c5c=sox[_0xffaf('0x21')](_0x3b21c2,_0x1d4406,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4e6c5c['on'](_0xffaf('0x11'),function(_0x309a73){logger['error'](_0xffaf('0x22'),_0x309a73);_0x56c204(_0x309a73);});_0x4e6c5c['on'](_0xffaf('0x1a'),function(){logger['info'](_0xffaf('0x23'));_0xb33698();});_0x4e6c5c[_0xffaf('0x24')]();});}function base64Decode(_0x5caa59,_0x897b0){var _0x455824=path['resolve'](__dirname,_0xffaf('0x25'),rs[_0xffaf('0x26')](0x4)+'.wav');fs[_0xffaf('0x27')](_0x455824,_0x5caa59,'base64');return convertFile(_0x455824,_0x897b0)[_0xffaf('0x28')](function(){try{fs[_0xffaf('0x17')](_0x455824);fs['chmodSync'](_0x897b0,_0xffaf('0x29'));}catch(_0x42a4f7){logger[_0xffaf('0x11')](_0x42a4f7);}return _0x897b0['split']('.')[0x0];});}function base64Encode(_0x30f007){var _0x409cbe=fs[_0xffaf('0x2a')](_0x30f007);return new Buffer(_0x409cbe)[_0xffaf('0x2b')](_0xffaf('0x2c'));}exports['googleCloudTTS']=function(_0x10e1c1,_0x574118,_0x11e496,_0x54a277,_0x301f56,_0x23bae9){var _0x2563fd,_0x20e686;var _0x2c01ea=_0xffaf('0x2d');var _0x352e42=_0xffaf('0x2e')+_0x10e1c1;var _0x1c196d={};if(_0x574118===_0xffaf('0x2f')){_0x1c196d[_0xffaf('0x30')]={'ssml':_0x11e496};}else{_0x1c196d[_0xffaf('0x30')]={'text':_0x11e496};};_0x1c196d[_0xffaf('0x31')]={'languageCode':_0x54a277,'ssmlGender':_0x301f56};_0x1c196d[_0xffaf('0x32')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3f8f3c={'url':_0x2c01ea+_0xffaf('0x33')+_0x352e42,'method':'POST','json':!![],'body':_0x1c196d};return rp(_0x3f8f3c)[_0xffaf('0x28')](function(_0x169c36){return new BPromise(function(_0x4763a6,_0x575376){_0x2563fd=path['resolve'](__dirname,_0xffaf('0x25'),rs[_0xffaf('0x26')](0x4)+'.mp3');var _0x21ecad=Buffer['from'](_0x169c36['audioContent'],_0xffaf('0x2c'));return fs['writeFile'](_0x2563fd,_0x21ecad,function(_0x279ec8){_0x575376(_0x279ec8);},function(_0x232b68){fs[_0xffaf('0x34')](_0x2563fd,'777');_0x4763a6(_0x232b68);});});})[_0xffaf('0x28')](function(_0x2d2300){_0x20e686=path[_0xffaf('0x35')](__dirname,_0xffaf('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x2563fd,_0x20e686);})['then'](function(){try{fs[_0xffaf('0x17')](_0x2563fd);fs[_0xffaf('0x34')](_0x20e686,_0xffaf('0x29'));}catch(_0x89c9f6){logger[_0xffaf('0x11')](_0x89c9f6);}logger[_0xffaf('0x36')](_0xffaf('0x37'),_0x20e686[_0xffaf('0x38')]('.')[0x0]);return _0x20e686[_0xffaf('0x38')]('.')[0x0];});};exports[_0xffaf('0x39')]=function(_0x4e941f,_0x39545f){var _0x14083f=_0xffaf('0x3a');var _0x4798fb,_0x2fed36;var _0x24ee0d;var _0x22bdfd={'encoding':'utf8','method':_0xffaf('0x3b'),'timeout':0x2710,'url':_0x14083f,'headers':{'Content-Type':_0xffaf('0x3c')},'body':_0xffaf('0x3d')+encodeURIComponent(JSON[_0xffaf('0x3e')]([[[_0xffaf('0x3f'),JSON['stringify']([_0x4e941f,_0x39545f||'en',![],'null']),null,_0xffaf('0x40')]]]))};return rp(_0x22bdfd)[_0xffaf('0x28')](function(_0x551047){try{_0x24ee0d=eval(_0x551047[_0xffaf('0x41')](0x5))[0x0][0x2];}catch(_0x506227){throw new Error(_0xffaf('0x42')+_0x551047[_0xffaf('0x20')]);}if(!_0x24ee0d){if(_0x4e941f[_0xffaf('0x43')]>0xc8){throw new Error(_0xffaf('0x44'));}else{throw new Error('lang\x20\x22'+_0x39545f+_0xffaf('0x45'));}}try{_0x24ee0d=eval(_0x24ee0d)[0x0];}catch(_0x2e9ada){throw new Error(_0xffaf('0x42')+res[_0xffaf('0x20')]);}const _0x1c805b=_0x24ee0d;_0x4798fb=path[_0xffaf('0x35')](__dirname,_0xffaf('0x25'),rs[_0xffaf('0x26')](0x4)+_0xffaf('0x46'));fs['writeFileSync'](_0x4798fb,_0x24ee0d,{'encoding':'base64'});_0x2fed36=path[_0xffaf('0x35')](__dirname,'tmp',rs[_0xffaf('0x26')](0x4)+_0xffaf('0x47'));return convertFile(_0x4798fb,_0x2fed36);})[_0xffaf('0x28')](function(){try{fs[_0xffaf('0x17')](_0x4798fb);fs[_0xffaf('0x34')](_0x2fed36,_0xffaf('0x29'));}catch(_0x1ffef4){logger['error'](_0x1ffef4);}logger[_0xffaf('0x36')](_0xffaf('0x48'),_0x2fed36[_0xffaf('0x38')]('.')[0x0]);return _0x2fed36[_0xffaf('0x38')]('.')[0x0];});};exports[_0xffaf('0x49')]=function(_0x2d6a7e,_0x486c09,_0x511dbf){return google[_0xffaf('0x4a')](_0x2d6a7e,_0x486c09,_0x511dbf)['then'](function(_0x1eb5ff){logger[_0xffaf('0x36')](_0x1eb5ff[_0xffaf('0x4b')]);return rp(_0x1eb5ff);})[_0xffaf('0x28')](function(_0x28e98e){var _0x1a719d='';var _0x4250ee=0x0;try{fs[_0xffaf('0x17')](_0x2d6a7e);}catch(_0x14fef6){logger[_0xffaf('0x11')](_0x14fef6);}if(_0x28e98e&&_0x28e98e[_0xffaf('0x4c')]){_0x1a719d=_0x28e98e[_0xffaf('0x4c')][_0xffaf('0x4d')](function(_0x25a51a){return _0x25a51a&&_0x25a51a[_0xffaf('0x4e')][0x0]&&_0x25a51a[_0xffaf('0x4e')][0x0]['transcript']?_0x25a51a[_0xffaf('0x4e')][0x0][_0xffaf('0x4f')]:'';})[_0xffaf('0x50')]('\x0a');_0x4250ee=_0x28e98e['results'][_0xffaf('0x4d')](function(_0x73e62e){return _0x73e62e&&_0x73e62e[_0xffaf('0x4e')][0x0]&&_0x73e62e[_0xffaf('0x4e')][0x0][_0xffaf('0x51')]?_0x73e62e['alternatives'][0x0][_0xffaf('0x51')]:0x0;})[_0xffaf('0x50')]('\x0a');}logger[_0xffaf('0x36')]('googleASR\x20transcription',_0x1a719d);logger['info'](_0xffaf('0x52'),_0x4250ee);return{'transcript':_0x1a719d,'confidence':_0x4250ee};})[_0xffaf('0x53')](function(_0x24b628){logger[_0xffaf('0x11')](_0xffaf('0x54'),_0x24b628[_0xffaf('0x10')],_0x24b628[_0xffaf('0x55')],_0x24b628[_0xffaf('0x56')]);});};exports['googleDialogflow']=function(_0x5b3054,_0x464e58,_0x3187ae,_0x46ef32){var _0x85cd84=apiai(_0x464e58,{'language':_0x46ef32||'en'});return _0x85cd84['textRequest'](_0x3187ae,{'sessionId':md5(_0x5b3054)})[_0xffaf('0x28')](function(_0x1c9da8){logger[_0xffaf('0x36')](JSON['stringify'](_0x1c9da8));return{'source':_0x1c9da8[_0xffaf('0x57')][_0xffaf('0x58')],'resolvedQuery':_0x1c9da8[_0xffaf('0x57')][_0xffaf('0x59')],'action':_0x1c9da8[_0xffaf('0x57')][_0xffaf('0x5a')],'actionIncomplete':_0x1c9da8[_0xffaf('0x57')]['actionIncomplete'],'speech':_0x1c9da8[_0xffaf('0x57')][_0xffaf('0x5b')][_0xffaf('0x5c')],'score':_0x1c9da8[_0xffaf('0x57')][_0xffaf('0x5d')],'statusCode':_0x1c9da8['status'][_0xffaf('0x5e')],'endConversation':_0x1c9da8[_0xffaf('0x57')][_0xffaf('0x5f')]['endConversation']||![],'isFallbackIntent':_0x1c9da8[_0xffaf('0x57')]['metadata'][_0xffaf('0x60')]};});};exports[_0xffaf('0x61')]=function(_0x1c5751,_0x45009a,_0x437bc4,_0x1ec801,_0xacdbec,_0x3d8b91){var _0x9a3164=_0x1ec801[_0xffaf('0x62')](/\\n/g,'\x0a');var _0x14a604={'credentials':{'private_key':_0x9a3164,'client_email':_0x437bc4}};var _0x5ca399=new dialogflow['SessionsClient'](_0x14a604);var _0x2e4b1b=_0x5ca399['sessionPath'](_0x45009a,md5(_0x1c5751));var _0x17b19b={'session':_0x2e4b1b,'queryInput':{'text':{'text':_0xacdbec,'languageCode':_0x3d8b91}}};return _0x5ca399[_0xffaf('0x63')](_0x17b19b)[_0xffaf('0x28')](function(_0x283956){if(_0x283956&&_0x283956[_0xffaf('0x43')]){logger[_0xffaf('0x36')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x283956));var _0x48bde6=_0x283956[0x0];if(_0x48bde6){var _0x87069c={'action':_0x48bde6[_0xffaf('0x64')][_0xffaf('0x5a')],'allRequiredParamsPresent':_0x48bde6[_0xffaf('0x64')][_0xffaf('0x65')],'endConversation':_0x48bde6[_0xffaf('0x64')]['diagnosticInfo']&&_0x48bde6[_0xffaf('0x64')][_0xffaf('0x66')][_0xffaf('0x67')]?_0x48bde6[_0xffaf('0x64')][_0xffaf('0x66')][_0xffaf('0x67')][_0xffaf('0x68')][_0xffaf('0x69')]:![],'fulfillmentText':_0x48bde6[_0xffaf('0x64')][_0xffaf('0x6a')],'intentName':_0x48bde6[_0xffaf('0x64')][_0xffaf('0x6b')][_0xffaf('0x55')],'intentDisplayName':_0x48bde6[_0xffaf('0x64')][_0xffaf('0x6b')][_0xffaf('0x6c')],'isFallbackIntent':_0x48bde6['queryResult']['intent'][_0xffaf('0x6d')],'languageCode':_0x48bde6[_0xffaf('0x64')][_0xffaf('0x6e')],'queryText':_0x48bde6[_0xffaf('0x64')]['queryText'],'responseId':_0x48bde6[_0xffaf('0x6f')],'score':_0x48bde6[_0xffaf('0x64')][_0xffaf('0x70')],'speech':_0x48bde6[_0xffaf('0x64')][_0xffaf('0x6a')],'providerResponse':JSON[_0xffaf('0x3e')](_0x283956)};return _0x87069c;}}});};exports[_0xffaf('0x71')]=function(_0x5bd1de,_0xdb575a,_0x4dab50,_0x482d8b){return tilde[_0xffaf('0x4a')](_0x5bd1de,_0xdb575a,_0x4dab50,_0x482d8b)[_0xffaf('0x28')](function(_0x1a0718){try{fs[_0xffaf('0x17')](_0x5bd1de);}catch(_0x50499b){logger[_0xffaf('0x11')](_0x50499b);}logger[_0xffaf('0x36')](_0xffaf('0x72'),_0x1a0718['transcript']);logger[_0xffaf('0x36')](_0xffaf('0x73'),_0x1a0718[_0xffaf('0x51')]);return _0x1a0718;});};exports[_0xffaf('0x74')]=function(_0x4fd9ae,_0x7c6cb8,_0x1bb75e,_0x39422a,_0x11ef6c,_0x5a9a96){var _0x2a1d99=path['resolve'](__dirname,_0xffaf('0x25'),rs[_0xffaf('0x26')](0x4)+_0xffaf('0x46'));var _0x22ce41;return aws[_0xffaf('0x75')](_0x4fd9ae,_0x7c6cb8,_0x1bb75e,_0x39422a,_0x11ef6c,_0x5a9a96,_0x2a1d99)[_0xffaf('0x28')](function(){_0x22ce41=path['resolve'](__dirname,'tmp',rs[_0xffaf('0x26')](0x4)+_0xffaf('0x47'));return convertFile(_0x2a1d99,_0x22ce41);})[_0xffaf('0x28')](function(){try{fs['unlink'](_0x2a1d99);fs['chmodSync'](_0x22ce41,_0xffaf('0x29'));}catch(_0x5a2d85){logger[_0xffaf('0x11')](_0x5a2d85);}return _0x22ce41[_0xffaf('0x38')]('.')[0x0];});};exports[_0xffaf('0x76')]=function(_0x3ce5e5,_0x5b2226,_0x387c9a,_0x121381,_0x14458b,_0x35a61c){return aws['lex'](_0x3ce5e5,_0x5b2226,_0x387c9a,_0x121381,_0x14458b,_0x35a61c)[_0xffaf('0x28')](function(_0x5659f1){logger[_0xffaf('0x36')](JSON[_0xffaf('0x3e')](_0x5659f1));return _0x5659f1;});};exports[_0xffaf('0x77')]=function(_0xedf09d,_0x2197f9,_0x343e5a,_0x361199){var _0x2d9903=util[_0xffaf('0x78')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0xedf09d,encodeURIComponent(_0x2197f9),_0x343e5a,_0x361199);var _0x15d1c4=path['resolve'](__dirname,_0xffaf('0x25'),rs[_0xffaf('0x26')](0x4)+_0xffaf('0x46'));var _0x530682;return downloadFile(_0x2d9903,_0x15d1c4)['then'](function(){_0x530682=path['resolve'](__dirname,'tmp',rs[_0xffaf('0x26')](0x4)+'.wav');return convertFile(_0x15d1c4,_0x530682);})[_0xffaf('0x28')](function(){try{fs['unlink'](_0x15d1c4);fs[_0xffaf('0x34')](_0x530682,_0xffaf('0x29'));}catch(_0x1ed485){logger[_0xffaf('0x11')](_0x1ed485);}return _0x530682[_0xffaf('0x38')]('.')[0x0];});};exports[_0xffaf('0x79')]=function(_0x3496c,_0x53cb5f,_0x5c5135,_0x330fbc){var _0x1b289f=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x53cb5f,_0x5c5135,base64Encode(_0x3496c),_0x330fbc?util[_0xffaf('0x78')]('model=%s',encodeURIComponent(_0x330fbc)):_0xffaf('0x7a'));return uploadFile(_0x1b289f)[_0xffaf('0x28')](function(_0x238a81){return querystring[_0xffaf('0x9')](_0x238a81);});};exports[_0xffaf('0x7b')]=function(_0x48f0b,_0x562ff2){return sestek[_0xffaf('0x7c')](_0x48f0b,_0x562ff2)['then'](function(_0x22bcb0){logger[_0xffaf('0x36')](JSON[_0xffaf('0x3e')](_0x22bcb0));var _0x32befa={'speech':_0x22bcb0['text'],'action':_0x22bcb0[_0xffaf('0x7d')]?_0x22bcb0['channelData'][_0xffaf('0x7e')]:undefined,'actiondata':_0x22bcb0['channelData']?_0x22bcb0[_0xffaf('0x7d')][_0xffaf('0x7f')]:undefined};if(_0x22bcb0['channelData']&&_0x22bcb0[_0xffaf('0x7d')]['AudioFromTts']){return base64Decode(_0x22bcb0[_0xffaf('0x7d')][_0xffaf('0x80')][_0xffaf('0x81')],path[_0xffaf('0x35')](__dirname,_0xffaf('0x25'),rs[_0xffaf('0x26')](0x4)+_0xffaf('0x47')))[_0xffaf('0x28')](function(_0x3f8c36){_0x32befa[_0xffaf('0x82')]=_0x3f8c36;return _0x32befa;});}return _0x32befa;});};exports[_0xffaf('0x83')]=function(){return __dirname;}; \ No newline at end of file +var _0xecc8=['googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','result','source','resolvedQuery','actionIncomplete','fulfillment','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','detectIntent','Dialogflow\x20V2\x20response:','stringify','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','protocol','host','WHAT_EVER','error','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','createWriteStream','finish','info','close','unlink','download\x20error','pipe','end','https:','get','data','transcode','wav','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','then'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xecc8,0x154));var _0x8ecc=function(_0x1a8197,_0x1e39f1){_0x1a8197=_0x1a8197-0x0;var _0x5deaa5=_0xecc8[_0x1a8197];return _0x5deaa5;};'use strict';var apiai=require(_0x8ecc('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x8ecc('0x1'));var https=require(_0x8ecc('0x2'));var md5=require(_0x8ecc('0x3'));var path=require(_0x8ecc('0x4'));var querystring=require(_0x8ecc('0x5'));var rp=require(_0x8ecc('0x6'));var rs=require(_0x8ecc('0x7'));var sox=require(_0x8ecc('0x8'));var tts=require(_0x8ecc('0x9'));var urlParse=require(_0x8ecc('0xa'))[_0x8ecc('0xb')];var util=require(_0x8ecc('0xc'));var aws=require(_0x8ecc('0xd'));var google=require(_0x8ecc('0xe'));var sestek=require(_0x8ecc('0xf'));var tilde=require('./tilde');var logger=require('../../../config/logger')('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x234cd9,_0x3939cb){return new BPromise(function(_0x57d298,_0x566c04){var _0x42ce82=urlParse(_0x234cd9);var _0x3f95c9=_0x42ce82[_0x8ecc('0x10')]==='https:'?https:http;var _0x14a179={'host':_0x42ce82[_0x8ecc('0x11')],'path':_0x42ce82[_0x8ecc('0x4')],'headers':{'user-agent':_0x8ecc('0x12')}};_0x3f95c9['get'](_0x14a179,function(_0x53bbf5){if(_0x53bbf5['statusCode']!==0xc8){logger[_0x8ecc('0x13')]('request\x20to\x20'+_0x234cd9+'\x20failed,\x20status\x20code\x20=\x20'+_0x53bbf5['statusCode']+'\x20('+_0x53bbf5[_0x8ecc('0x14')]+')');_0x566c04(new Error(_0x8ecc('0x15')+_0x234cd9+_0x8ecc('0x16')+_0x53bbf5[_0x8ecc('0x17')]+'\x20('+_0x53bbf5['statusMessage']+')'));return;}var _0x6b17ac=fs[_0x8ecc('0x18')](_0x3939cb);_0x6b17ac['on'](_0x8ecc('0x19'),function(){logger[_0x8ecc('0x1a')]('finish\x20download\x20file');_0x6b17ac[_0x8ecc('0x1b')](_0x57d298);});_0x6b17ac['on'](_0x8ecc('0x13'),function(_0x3a1282){fs[_0x8ecc('0x1c')](_0x3939cb);logger[_0x8ecc('0x13')](_0x8ecc('0x1d'),_0x3a1282);_0x566c04(_0x3a1282);});_0x53bbf5[_0x8ecc('0x1e')](_0x6b17ac);})['on'](_0x8ecc('0x13'),function(_0x4bfa53){logger[_0x8ecc('0x13')](_0x4bfa53);_0x566c04(_0x4bfa53);})[_0x8ecc('0x1f')]();});}function uploadFile(_0x30ce8c){return new BPromise(function(_0x3db561,_0x3e408){var _0x336357=urlParse(_0x30ce8c);var _0x9651f=_0x336357[_0x8ecc('0x10')]===_0x8ecc('0x20')?https:http;var _0x26feb3={'host':_0x336357[_0x8ecc('0x11')],'path':_0x336357[_0x8ecc('0x4')],'headers':{'user-agent':_0x8ecc('0x12')}};_0x9651f[_0x8ecc('0x21')](_0x26feb3,function(_0x499b25){if(_0x499b25[_0x8ecc('0x17')]!==0xc8){_0x3e408(new Error(_0x8ecc('0x15')+_0x30ce8c+_0x8ecc('0x16')+_0x499b25[_0x8ecc('0x17')]+'\x20('+_0x499b25[_0x8ecc('0x14')]+')'));return;}var _0x558a23='';_0x499b25['on'](_0x8ecc('0x22'),function(_0x54a9ae){_0x558a23+=_0x54a9ae;});_0x499b25['on'](_0x8ecc('0x1f'),function(){_0x3db561(_0x558a23);});})['on']('error',function(_0x4a450a){_0x3e408(_0x4a450a);})['end']();});}function convertFile(_0x517434,_0x1f713a){return new BPromise(function(_0x4ecf15,_0x318dfc){var _0x5bc3be=sox[_0x8ecc('0x23')](_0x517434,_0x1f713a,{'sampleRate':0x1f40,'format':_0x8ecc('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5bc3be['on'](_0x8ecc('0x13'),function(_0x5bba52){logger[_0x8ecc('0x13')]('error\x20convert',_0x5bba52);_0x318dfc(_0x5bba52);});_0x5bc3be['on'](_0x8ecc('0x1f'),function(){logger[_0x8ecc('0x1a')](_0x8ecc('0x25'));_0x4ecf15();});_0x5bc3be['start']();});}function base64Decode(_0x55cff2,_0x1030e2){var _0x16316a=path[_0x8ecc('0x26')](__dirname,_0x8ecc('0x27'),rs[_0x8ecc('0x28')](0x4)+_0x8ecc('0x29'));fs[_0x8ecc('0x2a')](_0x16316a,_0x55cff2,_0x8ecc('0x2b'));return convertFile(_0x16316a,_0x1030e2)['then'](function(){try{fs[_0x8ecc('0x1c')](_0x16316a);fs[_0x8ecc('0x2c')](_0x1030e2,_0x8ecc('0x2d'));}catch(_0x3507d9){logger['error'](_0x3507d9);}return _0x1030e2[_0x8ecc('0x2e')]('.')[0x0];});}function base64Encode(_0x254b2){var _0x2785fa=fs[_0x8ecc('0x2f')](_0x254b2);return new Buffer(_0x2785fa)[_0x8ecc('0x30')]('base64');}exports['googleCloudTTS']=function(_0x3a8ecb,_0x889bd9,_0x10dcbd,_0x164570,_0x4167cf,_0x1f8069){var _0x5bc2b0,_0xaa0808;var _0xf3db68=_0x8ecc('0x31');var _0x4f391c=_0x8ecc('0x32')+_0x3a8ecb;var _0xdf075={};if(_0x889bd9==='ssml'){_0xdf075[_0x8ecc('0x33')]={'ssml':_0x10dcbd};}else{_0xdf075['input']={'text':_0x10dcbd};};_0xdf075[_0x8ecc('0x34')]={'languageCode':_0x164570,'ssmlGender':_0x4167cf};_0xdf075[_0x8ecc('0x35')]={'audioEncoding':_0x8ecc('0x36'),'sampleRateHertz':0x1f40};var _0xd0aa3d={'url':_0xf3db68+_0x8ecc('0x37')+_0x4f391c,'method':_0x8ecc('0x38'),'json':!![],'body':_0xdf075};return rp(_0xd0aa3d)['then'](function(_0x119262){return new BPromise(function(_0x576eb8,_0x36bcb3){_0x5bc2b0=path[_0x8ecc('0x26')](__dirname,'tmp',rs[_0x8ecc('0x28')](0x4)+_0x8ecc('0x39'));var _0x4c8017=Buffer[_0x8ecc('0x3a')](_0x119262[_0x8ecc('0x3b')],'base64');return fs[_0x8ecc('0x3c')](_0x5bc2b0,_0x4c8017,function(_0x210439){_0x36bcb3(_0x210439);},function(_0x18a234){fs[_0x8ecc('0x2c')](_0x5bc2b0,'777');_0x576eb8(_0x18a234);});});})[_0x8ecc('0x3d')](function(_0x29aa27){_0xaa0808=path[_0x8ecc('0x26')](__dirname,_0x8ecc('0x27'),rs[_0x8ecc('0x28')](0x4)+_0x8ecc('0x29'));return convertFile(_0x5bc2b0,_0xaa0808);})[_0x8ecc('0x3d')](function(){try{fs[_0x8ecc('0x1c')](_0x5bc2b0);fs[_0x8ecc('0x2c')](_0xaa0808,_0x8ecc('0x2d'));}catch(_0x4c1169){logger[_0x8ecc('0x13')](_0x4c1169);}logger[_0x8ecc('0x1a')](_0x8ecc('0x3e'),_0xaa0808[_0x8ecc('0x2e')]('.')[0x0]);return _0xaa0808[_0x8ecc('0x2e')]('.')[0x0];});};exports[_0x8ecc('0x3f')]=function(_0x36db82,_0x2b79a0){var _0x345b59=_0x8ecc('0x40');var _0x404984,_0x677aa6;var _0x22479d;var _0x52db66={'encoding':_0x8ecc('0x41'),'method':_0x8ecc('0x38'),'timeout':0x2710,'url':_0x345b59,'headers':{'Content-Type':_0x8ecc('0x42')},'body':_0x8ecc('0x43')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON['stringify']([_0x36db82,_0x2b79a0||'en',![],'null']),null,'generic']]]))};return rp(_0x52db66)[_0x8ecc('0x3d')](function(_0x3e1517){try{_0x22479d=eval(_0x3e1517['slice'](0x5))[0x0][0x2];}catch(_0x58e4ad){throw new Error(_0x8ecc('0x44')+_0x3e1517['data']);}if(!_0x22479d){if(_0x36db82[_0x8ecc('0x45')]>0xc8){throw new Error(_0x8ecc('0x46'));}else{throw new Error(_0x8ecc('0x47')+_0x2b79a0+_0x8ecc('0x48'));}}try{_0x22479d=eval(_0x22479d)[0x0];}catch(_0x138435){throw new Error(_0x8ecc('0x44')+res[_0x8ecc('0x22')]);}const _0x446412=_0x22479d;_0x404984=path[_0x8ecc('0x26')](__dirname,_0x8ecc('0x27'),rs[_0x8ecc('0x28')](0x4)+_0x8ecc('0x39'));fs[_0x8ecc('0x2a')](_0x404984,_0x22479d,{'encoding':'base64'});_0x677aa6=path[_0x8ecc('0x26')](__dirname,_0x8ecc('0x27'),rs[_0x8ecc('0x28')](0x4)+_0x8ecc('0x29'));return convertFile(_0x404984,_0x677aa6);})[_0x8ecc('0x3d')](function(){try{fs[_0x8ecc('0x1c')](_0x404984);fs[_0x8ecc('0x2c')](_0x677aa6,_0x8ecc('0x2d'));}catch(_0x5e817d){logger[_0x8ecc('0x13')](_0x5e817d);}logger[_0x8ecc('0x1a')](_0x8ecc('0x49'),_0x677aa6[_0x8ecc('0x2e')]('.')[0x0]);return _0x677aa6[_0x8ecc('0x2e')]('.')[0x0];});};exports[_0x8ecc('0x4a')]=function(_0x334713,_0x1beec6,_0x20d1c5){return google[_0x8ecc('0x4b')](_0x334713,_0x1beec6,_0x20d1c5)[_0x8ecc('0x3d')](function(_0x2b21bd){logger[_0x8ecc('0x1a')](_0x2b21bd[_0x8ecc('0x4c')]);return rp(_0x2b21bd);})[_0x8ecc('0x3d')](function(_0x41dcf9){var _0x30bdb6='';var _0x257b08=0x0;try{fs['unlink'](_0x334713);}catch(_0x3760e7){logger[_0x8ecc('0x13')](_0x3760e7);}if(_0x41dcf9&&_0x41dcf9[_0x8ecc('0x4d')]){_0x30bdb6=_0x41dcf9['results']['map'](function(_0x29c1a2){return _0x29c1a2&&_0x29c1a2[_0x8ecc('0x4e')][0x0]&&_0x29c1a2['alternatives'][0x0][_0x8ecc('0x4f')]?_0x29c1a2[_0x8ecc('0x4e')][0x0]['transcript']:'';})[_0x8ecc('0x50')]('\x0a');_0x257b08=_0x41dcf9['results']['map'](function(_0x2eedb5){return _0x2eedb5&&_0x2eedb5['alternatives'][0x0]&&_0x2eedb5['alternatives'][0x0][_0x8ecc('0x51')]?_0x2eedb5[_0x8ecc('0x4e')][0x0]['confidence']:0x0;})[_0x8ecc('0x50')]('\x0a');}logger[_0x8ecc('0x1a')](_0x8ecc('0x52'),_0x30bdb6);logger[_0x8ecc('0x1a')]('googleASR\x20confidence',_0x257b08);return{'transcript':_0x30bdb6,'confidence':_0x257b08};})[_0x8ecc('0x53')](function(_0x1850d6){logger[_0x8ecc('0x13')](_0x8ecc('0x54'),_0x1850d6['statusCode'],_0x1850d6['name'],_0x1850d6['message']);});};exports['googleDialogflow']=function(_0x529ebe,_0xb08248,_0x1c0f0c,_0x21f72c){var _0x5c7446=apiai(_0xb08248,{'language':_0x21f72c||'en'});return _0x5c7446['textRequest'](_0x1c0f0c,{'sessionId':md5(_0x529ebe)})[_0x8ecc('0x3d')](function(_0xc8898d){logger[_0x8ecc('0x1a')](JSON['stringify'](_0xc8898d));return{'source':_0xc8898d[_0x8ecc('0x55')][_0x8ecc('0x56')],'resolvedQuery':_0xc8898d[_0x8ecc('0x55')][_0x8ecc('0x57')],'action':_0xc8898d['result']['action'],'actionIncomplete':_0xc8898d['result'][_0x8ecc('0x58')],'speech':_0xc8898d[_0x8ecc('0x55')][_0x8ecc('0x59')]['speech'],'score':_0xc8898d[_0x8ecc('0x55')]['score'],'statusCode':_0xc8898d['status'][_0x8ecc('0x5a')],'endConversation':_0xc8898d[_0x8ecc('0x55')][_0x8ecc('0x5b')][_0x8ecc('0x5c')]||![],'isFallbackIntent':_0xc8898d[_0x8ecc('0x55')]['metadata'][_0x8ecc('0x5d')]};});};exports[_0x8ecc('0x5e')]=function(_0x11391a,_0x12ee01,_0x33defe,_0x1b32f7,_0x3d5b65,_0x31fb5c){var _0x4e85cd=_0x1b32f7['replace'](/\\n/g,'\x0a');var _0x3893fe={'credentials':{'private_key':_0x4e85cd,'client_email':_0x33defe}};var _0x36fc73=new dialogflow['SessionsClient'](_0x3893fe);var _0x5bf5b4=_0x36fc73['sessionPath'](_0x12ee01,md5(_0x11391a));var _0x5c7d7d={'session':_0x5bf5b4,'queryInput':{'text':{'text':_0x3d5b65,'languageCode':_0x31fb5c}}};return _0x36fc73[_0x8ecc('0x5f')](_0x5c7d7d)[_0x8ecc('0x3d')](function(_0x1e59b8){if(_0x1e59b8&&_0x1e59b8[_0x8ecc('0x45')]){logger[_0x8ecc('0x1a')](_0x8ecc('0x60'),JSON[_0x8ecc('0x61')](_0x1e59b8));var _0x46871c=_0x1e59b8[0x0];if(_0x46871c){var _0x4edb39={'action':_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x63')],'allRequiredParamsPresent':_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x64')],'endConversation':_0x46871c[_0x8ecc('0x62')]['diagnosticInfo']&&_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x65')][_0x8ecc('0x66')]?_0x46871c[_0x8ecc('0x62')]['diagnosticInfo'][_0x8ecc('0x66')][_0x8ecc('0x67')][_0x8ecc('0x68')]:![],'fulfillmentText':_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x69')],'intentName':_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x6a')][_0x8ecc('0x6b')],'intentDisplayName':_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x6a')]['displayName'],'isFallbackIntent':_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x6a')][_0x8ecc('0x6c')],'languageCode':_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x6d')],'queryText':_0x46871c['queryResult'][_0x8ecc('0x6e')],'responseId':_0x46871c[_0x8ecc('0x6f')],'score':_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x70')],'speech':_0x46871c[_0x8ecc('0x62')][_0x8ecc('0x69')],'providerResponse':JSON[_0x8ecc('0x61')](_0x1e59b8)};return _0x4edb39;}}});};exports[_0x8ecc('0x71')]=function(_0x40dbd0,_0x563154,_0x40cda4,_0x5a4fe2){return tilde[_0x8ecc('0x4b')](_0x40dbd0,_0x563154,_0x40cda4,_0x5a4fe2)[_0x8ecc('0x3d')](function(_0x4154f3){try{fs[_0x8ecc('0x1c')](_0x40dbd0);}catch(_0x1496c8){logger[_0x8ecc('0x13')](_0x1496c8);}logger[_0x8ecc('0x1a')](_0x8ecc('0x72'),_0x4154f3[_0x8ecc('0x4f')]);logger['info'](_0x8ecc('0x73'),_0x4154f3['confidence']);return _0x4154f3;});};exports[_0x8ecc('0x74')]=function(_0x261b0b,_0x1b06d0,_0x46537a,_0x267e20,_0x594f95,_0x625c63){var _0x51ae94=path[_0x8ecc('0x26')](__dirname,_0x8ecc('0x27'),rs[_0x8ecc('0x28')](0x4)+'.mp3');var _0x728457;return aws[_0x8ecc('0x75')](_0x261b0b,_0x1b06d0,_0x46537a,_0x267e20,_0x594f95,_0x625c63,_0x51ae94)[_0x8ecc('0x3d')](function(){_0x728457=path[_0x8ecc('0x26')](__dirname,_0x8ecc('0x27'),rs[_0x8ecc('0x28')](0x4)+_0x8ecc('0x29'));return convertFile(_0x51ae94,_0x728457);})[_0x8ecc('0x3d')](function(){try{fs[_0x8ecc('0x1c')](_0x51ae94);fs[_0x8ecc('0x2c')](_0x728457,_0x8ecc('0x2d'));}catch(_0x3b985d){logger[_0x8ecc('0x13')](_0x3b985d);}return _0x728457[_0x8ecc('0x2e')]('.')[0x0];});};exports[_0x8ecc('0x76')]=function(_0x203e76,_0x400677,_0x3f8c00,_0x4b69a9,_0x87c7d3,_0x138086){return aws[_0x8ecc('0x77')](_0x203e76,_0x400677,_0x3f8c00,_0x4b69a9,_0x87c7d3,_0x138086)[_0x8ecc('0x3d')](function(_0x59df1b){logger[_0x8ecc('0x1a')](JSON[_0x8ecc('0x61')](_0x59df1b));return _0x59df1b;});};exports['ispeechTTS']=function(_0x3f0768,_0x59698d,_0x40ca86,_0x4aa8d4){var _0x1489d2=util['format'](_0x8ecc('0x78'),ISPEECH_API,_0x3f0768,encodeURIComponent(_0x59698d),_0x40ca86,_0x4aa8d4);var _0x7fe92a=path[_0x8ecc('0x26')](__dirname,_0x8ecc('0x27'),rs[_0x8ecc('0x28')](0x4)+_0x8ecc('0x39'));var _0x5e2f9a;return downloadFile(_0x1489d2,_0x7fe92a)['then'](function(){_0x5e2f9a=path[_0x8ecc('0x26')](__dirname,_0x8ecc('0x27'),rs[_0x8ecc('0x28')](0x4)+_0x8ecc('0x29'));return convertFile(_0x7fe92a,_0x5e2f9a);})[_0x8ecc('0x3d')](function(){try{fs[_0x8ecc('0x1c')](_0x7fe92a);fs[_0x8ecc('0x2c')](_0x5e2f9a,_0x8ecc('0x2d'));}catch(_0x1c8d15){logger[_0x8ecc('0x13')](_0x1c8d15);}return _0x5e2f9a[_0x8ecc('0x2e')]('.')[0x0];});};exports['ispeechASR']=function(_0xb36323,_0x45c9ed,_0x1865ac,_0x22dbb1){var _0x2cf86f=util[_0x8ecc('0x79')](_0x8ecc('0x7a'),ISPEECH_API,_0x45c9ed,_0x1865ac,base64Encode(_0xb36323),_0x22dbb1?util[_0x8ecc('0x79')](_0x8ecc('0x7b'),encodeURIComponent(_0x22dbb1)):_0x8ecc('0x7c'));return uploadFile(_0x2cf86f)[_0x8ecc('0x3d')](function(_0x26346f){return querystring[_0x8ecc('0xb')](_0x26346f);});};exports[_0x8ecc('0x7d')]=function(_0x4d0228,_0x1fd0f3){return sestek[_0x8ecc('0x7e')](_0x4d0228,_0x1fd0f3)[_0x8ecc('0x3d')](function(_0x194326){logger['info'](JSON[_0x8ecc('0x61')](_0x194326));var _0x46ffea={'speech':_0x194326[_0x8ecc('0x7f')],'action':_0x194326[_0x8ecc('0x80')]?_0x194326[_0x8ecc('0x80')][_0x8ecc('0x81')]:undefined,'actiondata':_0x194326[_0x8ecc('0x80')]?_0x194326[_0x8ecc('0x80')]['CustomActionData']:undefined};if(_0x194326['channelData']&&_0x194326[_0x8ecc('0x80')][_0x8ecc('0x82')]){return base64Decode(_0x194326[_0x8ecc('0x80')][_0x8ecc('0x82')][_0x8ecc('0x83')],path[_0x8ecc('0x26')](__dirname,_0x8ecc('0x27'),rs[_0x8ecc('0x28')](0x4)+'.wav'))[_0x8ecc('0x3d')](function(_0x483661){_0x46ffea[_0x8ecc('0x84')]=_0x483661;return _0x46ffea;});}return _0x46ffea;});};exports[_0x8ecc('0x85')]=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 8e03cc3..8f34e03 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 _0x6918=['./nda'];(function(_0x239249,_0x9d680a){var _0xc82ff2=function(_0x48fb60){while(--_0x48fb60){_0x239249['push'](_0x239249['shift']());}};_0xc82ff2(++_0x9d680a);}(_0x6918,0x1b7));var _0x8691=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6918[_0x3b380d];return _0x54502b;};var nda=require(_0x8691('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 8953dc2..2b8bb40 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 _0x9c02=['/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','resolve','/token','username','password','then','POST','ndassistant_url'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x9c02,0x196));var _0x29c0=function(_0x2bd1c9,_0x41c82b){_0x2bd1c9=_0x2bd1c9-0x0;var _0x5b82a5=_0x9c02[_0x2bd1c9];return _0x5b82a5;};'use strict';var rp=require(_0x29c0('0x0'));var url=require(_0x29c0('0x1'));var logger=require(_0x29c0('0x2'))('agi');module['exports']=function(_0x4e8fe7,_0x52dba5){var _0x28006b={'method':'POST','uri':url[_0x29c0('0x3')](_0x52dba5['ndauth_url'],_0x29c0('0x4')),'form':{'grant_type':'password','username':_0x52dba5[_0x29c0('0x5')],'password':_0x52dba5[_0x29c0('0x6')]},'json':!![]};return rp(_0x28006b)[_0x29c0('0x7')](function(_0x5beeb6){var _0x58fa3e={'method':_0x29c0('0x8'),'uri':url[_0x29c0('0x3')](_0x52dba5[_0x29c0('0x9')],_0x29c0('0xa')),'body':{'type':_0x52dba5[_0x29c0('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x4e8fe7[_0x29c0('0xc')]},'from':{'id':_0x4e8fe7['callerid'],'name':_0x4e8fe7[_0x29c0('0xd')]},'recipient':{'id':_0x4e8fe7[_0x29c0('0xe')],'name':_0x4e8fe7[_0x29c0('0xf')]},'text':_0x52dba5[_0x29c0('0x10')],'channelData':{}},'headers':{'Authorization':_0x29c0('0x11')+_0x5beeb6[_0x29c0('0x12')]},'json':!![]};if(_0x52dba5['project']){_0x58fa3e[_0x29c0('0x13')][_0x29c0('0x14')][_0x29c0('0x15')]=_0x52dba5[_0x29c0('0x16')];}if(_0x52dba5[_0x29c0('0x17')]=='1'){_0x58fa3e[_0x29c0('0x13')][_0x29c0('0x14')][_0x29c0('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x29c0('0x19')};}if(_0x52dba5[_0x29c0('0x1a')]){_0x58fa3e[_0x29c0('0x13')][_0x29c0('0x14')][_0x29c0('0x1b')]=_0x52dba5[_0x29c0('0x1a')];if(_0x52dba5[_0x29c0('0x1c')]){_0x58fa3e[_0x29c0('0x13')][_0x29c0('0x14')][_0x29c0('0x1d')]=_0x52dba5[_0x29c0('0x1c')];}}logger[_0x29c0('0x1e')](JSON[_0x29c0('0x1f')](_0x58fa3e));return rp(_0x58fa3e);});}; \ No newline at end of file +var _0xd138=['stringify','request-promise','url','../../../../../config/logger','resolve','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','extension','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd138,0x1dc));var _0x8d13=function(_0x4315f1,_0x3923ab){_0x4315f1=_0x4315f1-0x0;var _0x246e32=_0xd138[_0x4315f1];return _0x246e32;};'use strict';var rp=require(_0x8d13('0x0'));var url=require(_0x8d13('0x1'));var logger=require(_0x8d13('0x2'))('agi');module['exports']=function(_0x4ce918,_0x13e640){var _0x4eb077={'method':'POST','uri':url[_0x8d13('0x3')](_0x13e640['ndauth_url'],'/token'),'form':{'grant_type':'password','username':_0x13e640['username'],'password':_0x13e640['password']},'json':!![]};return rp(_0x4eb077)[_0x8d13('0x4')](function(_0x296da6){var _0x1ab1f6={'method':'POST','uri':url[_0x8d13('0x3')](_0x13e640['ndassistant_url'],_0x8d13('0x5')),'body':{'type':_0x13e640[_0x8d13('0x6')]||'message','channelId':'Nda','conversation':{'id':_0x4ce918[_0x8d13('0x7')]},'from':{'id':_0x4ce918[_0x8d13('0x8')],'name':_0x4ce918[_0x8d13('0x9')]},'recipient':{'id':_0x4ce918['dnid'],'name':_0x4ce918[_0x8d13('0xa')]},'text':_0x13e640[_0x8d13('0xb')],'channelData':{}},'headers':{'Authorization':_0x8d13('0xc')+_0x296da6['access_token']},'json':!![]};if(_0x13e640[_0x8d13('0xd')]){_0x1ab1f6[_0x8d13('0xe')][_0x8d13('0xf')][_0x8d13('0x10')]=_0x13e640[_0x8d13('0xd')];}if(_0x13e640[_0x8d13('0x11')]=='1'){_0x1ab1f6[_0x8d13('0xe')][_0x8d13('0xf')][_0x8d13('0x12')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x13e640[_0x8d13('0x13')]){_0x1ab1f6['body'][_0x8d13('0xf')][_0x8d13('0x14')]=_0x13e640['custom_action'];if(_0x13e640[_0x8d13('0x15')]){_0x1ab1f6[_0x8d13('0xe')][_0x8d13('0xf')][_0x8d13('0x16')]=_0x13e640[_0x8d13('0x15')];}}logger[_0x8d13('0x17')](JSON[_0x8d13('0x18')](_0x1ab1f6));return rp(_0x1ab1f6);});}; \ 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 342a29e..8b789c5 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 _0x4163=['./lib/api','exports'];(function(_0x55454f,_0x221c1d){var _0xbb1441=function(_0x121371){while(--_0x121371){_0x55454f['push'](_0x55454f['shift']());}};_0xbb1441(++_0x221c1d);}(_0x4163,0x1de));var _0x3416=function(_0x3ac34b,_0x278b53){_0x3ac34b=_0x3ac34b-0x0;var _0x3a02a7=_0x4163[_0x3ac34b];return _0x3a02a7;};'use strict';var asr=require(_0x3416('0x0'));module[_0x3416('0x1')]=function(_0x293391,_0x4f0e31,_0x6a411,_0x1b85c6){return asr(_0x293391,_0x4f0e31,_0x6a411,_0x1b85c6);}; \ No newline at end of file +var _0xc12a=['exports','./lib/api'];(function(_0x57fa37,_0x1e8d76){var _0x4226b9=function(_0xc1a49c){while(--_0xc1a49c){_0x57fa37['push'](_0x57fa37['shift']());}};_0x4226b9(++_0x1e8d76);}(_0xc12a,0x1c1));var _0xac12=function(_0x1dd938,_0x401a0b){_0x1dd938=_0x1dd938-0x0;var _0x81f11c=_0xc12a[_0x1dd938];return _0x81f11c;};'use strict';var asr=require(_0xac12('0x0'));module[_0xac12('0x1')]=function(_0x5812d7,_0x33f004,_0x3bd6ed,_0x31ac3d){return asr(_0x5812d7,_0x33f004,_0x3bd6ed,_0x31ac3d);}; \ 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 319fefa..edac0fe 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 _0xef13=['send','close','EOS','error','terminate','parse','final','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data'];(function(_0x92a466,_0x51f597){var _0x3ae4de=function(_0x5ad3ee){while(--_0x5ad3ee){_0x92a466['push'](_0x92a466['shift']());}};_0x3ae4de(++_0x51f597);}(_0xef13,0x136));var _0x3ef1=function(_0x22fdcc,_0x4ae41e){_0x22fdcc=_0x22fdcc-0x0;var _0x457720=_0xef13[_0x22fdcc];return _0x457720;};'use strict';var BPromise=require(_0x3ef1('0x0'));var _=require(_0x3ef1('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3ef1('0x2'));var crypto=require(_0x3ef1('0x3'));var logger=require(_0x3ef1('0x4'))('agi');module[_0x3ef1('0x5')]=function(_0x95e270,_0x3805a1,_0x38a8bc,_0x26d6a8){return new BPromise(function(_0x3707db,_0x42d77d){logger[_0x3ef1('0x6')](_0x3ef1('0x7'),_0x26d6a8||_0x3ef1('0x8'));var _0x4c2d48=new WebSocket(_0x26d6a8||_0x3ef1('0x8'),{'perMessageDeflate':![]});var _0x407a16='';var _0x1c8c33='0';var _0x1cb594='1';var _0x1fb2de=_0x3ef1('0x9');function _0x4439ba(_0xd1256b){var _0x103862=crypto['createHash']('sha1');_0x103862[_0x3ef1('0xa')](_0xd1256b);return _0x103862[_0x3ef1('0xb')](_0x3ef1('0xc'));}function _0x2c210b(){try{logger[_0x3ef1('0x6')](_0x3ef1('0xd'));var _0x1bc324=moment()[_0x3ef1('0xe')]();var _0x54c78c=_0x4439ba(_0x1bc324+_0x3805a1+_0x38a8bc);_0x4c2d48['send'](JSON[_0x3ef1('0xf')]({'appID':_0x3805a1,'timestamp':_0x1bc324,'appKey':_0x54c78c}));var _0x22364b=fs[_0x3ef1('0x10')](_0x95e270);_0x22364b['on'](_0x3ef1('0x11'),function(_0x49098c){_0x4c2d48[_0x3ef1('0x12')](_0x49098c);});_0x22364b['on'](_0x3ef1('0x13'),function(){_0x4c2d48[_0x3ef1('0x12')](_0x3ef1('0x14'));});}catch(_0x303349){logger[_0x3ef1('0x15')]('Tilde\x20ASR\x20send\x20error',JSON[_0x3ef1('0xf')](_0x303349));_0x4c2d48[_0x3ef1('0x16')]();}}function _0x3703dd(_0x2350f2){try{if(_0x2350f2){var _0x137ec6=JSON[_0x3ef1('0x17')](_0x2350f2);switch(_0x137ec6['status']){case 0x0:if(_0x137ec6['result']){if(_0x137ec6['result'][_0x3ef1('0x18')]){logger[_0x3ef1('0x6')](_0x3ef1('0x19'),JSON[_0x3ef1('0xf')](_0x137ec6[_0x3ef1('0x1a')][_0x3ef1('0x1b')]));_0x407a16=_0x137ec6[_0x3ef1('0x1a')][_0x3ef1('0x1b')][0x0][_0x3ef1('0x1c')];_0x1c8c33=_0x137ec6['result'][_0x3ef1('0x1b')][0x0][_0x3ef1('0x1d')];_0x1cb594='0';_0x1fb2de=_0x3ef1('0x1e');_0x4c2d48[_0x3ef1('0x16')]();}}break;case 0x1:logger['info'](_0x3ef1('0x9'));_0x1cb594='1';_0x1fb2de=_0x3ef1('0x9');break;case 0x2:logger[_0x3ef1('0x6')](_0x3ef1('0x1f'));_0x1cb594='2';_0x1fb2de='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x3ef1('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x1cb594='9';_0x1fb2de=_0x3ef1('0x20');break;case 0xa:logger[_0x3ef1('0x6')]('Authentication\x20failed.');_0x1cb594='10';_0x1fb2de=_0x3ef1('0x21');break;case 0xb:logger['info'](_0x3ef1('0x22'));_0x1cb594='11';_0x1fb2de='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x37bb3a){logger[_0x3ef1('0x15')](_0x3ef1('0x23'),JSON[_0x3ef1('0xf')](_0x37bb3a));_0x4c2d48[_0x3ef1('0x16')]();}}function _0x2258c3(){logger[_0x3ef1('0x6')](_0x3ef1('0x24'));_0x3707db({'transcript':_0x407a16,'confidence':_0x1c8c33,'status':_0x1cb594,'status_message':_0x1fb2de});}function _0x686afa(_0x27a530){logger[_0x3ef1('0x15')](_0x3ef1('0x25'));if(!_[_0x3ef1('0x26')](_0x27a530)){logger[_0x3ef1('0x15')](_[_0x3ef1('0x27')](_0x27a530)?JSON[_0x3ef1('0xf')](_0x27a530):_0x27a530);}}_0x4c2d48['on'](_0x3ef1('0x28'),_0x2c210b);_0x4c2d48['on']('message',_0x3703dd);_0x4c2d48['on']('close',_0x2258c3);_0x4c2d48['on']('error',_0x686afa);});}; \ No newline at end of file +var _0x9563=['isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x9563,0x10d));var _0x3956=function(_0x2e05d0,_0xb1f8a){_0x2e05d0=_0x2e05d0-0x0;var _0x3a9c75=_0x9563[_0x2e05d0];return _0x3a9c75;};'use strict';var BPromise=require('bluebird');var _=require(_0x3956('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3956('0x1'));var crypto=require(_0x3956('0x2'));var logger=require(_0x3956('0x3'))('agi');module[_0x3956('0x4')]=function(_0x16d583,_0x277af3,_0x49ed15,_0x5bdc11){return new BPromise(function(_0x2b9248,_0x48fadb){logger[_0x3956('0x5')](_0x3956('0x6'),_0x5bdc11||_0x3956('0x7'));var _0x4c1a48=new WebSocket(_0x5bdc11||_0x3956('0x7'),{'perMessageDeflate':![]});var _0x26f31e='';var _0x7a390c='0';var _0x53a1ef='1';var _0x10061d='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0xbae67(_0x558da2){var _0x42a6b9=crypto[_0x3956('0x8')]('sha1');_0x42a6b9[_0x3956('0x9')](_0x558da2);return _0x42a6b9[_0x3956('0xa')]('hex');}function _0x231166(){try{logger['info'](_0x3956('0xb'));var _0x4354f6=moment()[_0x3956('0xc')]();var _0xb0337b=_0xbae67(_0x4354f6+_0x277af3+_0x49ed15);_0x4c1a48['send'](JSON[_0x3956('0xd')]({'appID':_0x277af3,'timestamp':_0x4354f6,'appKey':_0xb0337b}));var _0x4aeafc=fs[_0x3956('0xe')](_0x16d583);_0x4aeafc['on'](_0x3956('0xf'),function(_0x45db6f){_0x4c1a48[_0x3956('0x10')](_0x45db6f);});_0x4aeafc['on'](_0x3956('0x11'),function(){_0x4c1a48['send']('EOS');});}catch(_0x540d7e){logger[_0x3956('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0x3956('0xd')](_0x540d7e));_0x4c1a48[_0x3956('0x13')]();}}function _0x37b1fe(_0x506f71){try{if(_0x506f71){var _0x2efa2f=JSON[_0x3956('0x14')](_0x506f71);switch(_0x2efa2f['status']){case 0x0:if(_0x2efa2f[_0x3956('0x15')]){if(_0x2efa2f[_0x3956('0x15')][_0x3956('0x16')]){logger[_0x3956('0x5')](_0x3956('0x17'),JSON['stringify'](_0x2efa2f[_0x3956('0x15')]['hypotheses']));_0x26f31e=_0x2efa2f[_0x3956('0x15')][_0x3956('0x18')][0x0]['transcript'];_0x7a390c=_0x2efa2f['result'][_0x3956('0x18')][0x0][_0x3956('0x19')];_0x53a1ef='0';_0x10061d=_0x3956('0x1a');_0x4c1a48[_0x3956('0x13')]();}}break;case 0x1:logger[_0x3956('0x5')](_0x3956('0x1b'));_0x53a1ef='1';_0x10061d='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x3956('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x53a1ef='2';_0x10061d=_0x3956('0x1c');break;case 0x9:logger[_0x3956('0x5')](_0x3956('0x1d'));_0x53a1ef='9';_0x10061d=_0x3956('0x1d');break;case 0xa:logger['info'](_0x3956('0x1e'));_0x53a1ef='10';_0x10061d=_0x3956('0x1e');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x53a1ef='11';_0x10061d=_0x3956('0x1f');}}}catch(_0x2af56c){logger[_0x3956('0x12')](_0x3956('0x20'),JSON[_0x3956('0xd')](_0x2af56c));_0x4c1a48[_0x3956('0x13')]();}}function _0x47ab09(){logger['info'](_0x3956('0x21'));_0x2b9248({'transcript':_0x26f31e,'confidence':_0x7a390c,'status':_0x53a1ef,'status_message':_0x10061d});}function _0x190ffd(_0x16050e){logger['error'](_0x3956('0x22'));if(!_['isNil'](_0x16050e)){logger[_0x3956('0x12')](_[_0x3956('0x23')](_0x16050e)?JSON['stringify'](_0x16050e):_0x16050e);}}_0x4c1a48['on'](_0x3956('0x24'),_0x231166);_0x4c1a48['on'](_0x3956('0x25'),_0x37b1fe);_0x4c1a48['on'](_0x3956('0x11'),_0x47ab09);_0x4c1a48['on'](_0x3956('0x12'),_0x190ffd);});}; \ 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 b60f8c4..881358f 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 _0x1a2a=['exports'];(function(_0xe6f4ef,_0x4e34cc){var _0x4f3447=function(_0x1538ff){while(--_0x1538ff){_0xe6f4ef['push'](_0xe6f4ef['shift']());}};_0x4f3447(++_0x4e34cc);}(_0x1a2a,0x134));var _0xa1a2=function(_0x195299,_0x7a1c77){_0x195299=_0x195299-0x0;var _0x258842=_0x1a2a[_0x195299];return _0x258842;};var asr=require('./asr');module[_0xa1a2('0x0')]={'asr':asr}; \ No newline at end of file +var _0xb53e=['./asr','exports'];(function(_0x5cd054,_0x2d3b5d){var _0x5a9331=function(_0x2b2a0b){while(--_0x2b2a0b){_0x5cd054['push'](_0x5cd054['shift']());}};_0x5a9331(++_0x2d3b5d);}(_0xb53e,0xf2));var _0xeb53=function(_0x14df8e,_0x59c796){_0x14df8e=_0x14df8e-0x0;var _0x6bdbc7=_0xb53e[_0x14df8e];return _0x6bdbc7;};var asr=require(_0xeb53('0x0'));module[_0xeb53('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index efa0f50..8efd92b 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index a663d60..3a6d033 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 _0x8ece=['createSquareDetailsReport','channel','label','agicommand','createSquareRecording','uniqueid','context','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','scheduledAt','toString','callback_priority','getPause','agentPause','agent','callerid','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','url','timeout','POST','PUT','method','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','text','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','includes','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','list_id','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','toUpperCase','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','false','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','%s/recordings/%s','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','streamFile','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','no\x20variable\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','no\x20file\x20audio\x20selected','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','yes','Answer','subproject','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','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','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'];(function(_0x1860c5,_0x90d824){var _0x25cf43=function(_0x549acf){while(--_0x549acf){_0x1860c5['push'](_0x1860c5['shift']());}};_0x25cf43(++_0x90d824);}(_0x8ece,0x195));var _0xe8ec=function(_0x2c39bb,_0x2753c4){_0x2c39bb=_0x2c39bb-0x0;var _0x53d038=_0x8ece[_0x2c39bb];return _0x53d038;};'use strict';var fs=require('fs');var util=require(_0xe8ec('0x0'));var _=require(_0xe8ec('0x1'));var sh=require(_0xe8ec('0x2'));var odbc=require(_0xe8ec('0x3'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0xe8ec('0x4'));var rp=require(_0xe8ec('0x5'));var logger=require(_0xe8ec('0x6'))(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var scripts=require('./scripts');var FILES_PATH=_0xe8ec('0x9');var recursiveMapAttributes=[_0xe8ec('0xa'),_0xe8ec('0xb')];var verticesWithRetry=[_0xe8ec('0xc'),_0xe8ec('0xd'),_0xe8ec('0xe')];var AGIVertices=function(_0x406f7e,_0x5525f8,_0x44d128){this['channel']=_0x406f7e;this[_0xe8ec('0xf')]=_0x5525f8;this['mailRpc']=_0x44d128;};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x11')]=function(_0x4ff773,_0x3e3606){this[_0xe8ec('0xf')][_0xe8ec('0x12')](_0x4ff773)[_0xe8ec('0x13')](function(_0x33cf9b){_0x3e3606(null,_0x33cf9b?_0x33cf9b[_0xe8ec('0x14')]:![]);})[_0xe8ec('0x15')](function(_0xf72aa7){_0x3e3606(_0xf72aa7);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x16')]=function(_0x48a951,_0x15de29){this[_0xe8ec('0xf')][_0xe8ec('0x17')](_0x48a951)[_0xe8ec('0x13')](function(_0x2921c8){_0x15de29(null,_0x2921c8?_0x2921c8[_0xe8ec('0x14')]:![]);})[_0xe8ec('0x15')](function(_0x218a4b){_0x15de29(_0x218a4b);});};AGIVertices['prototype'][_0xe8ec('0x18')]=function(_0xf34100,_0x389c13){this['rpc'][_0xe8ec('0x19')](_0xf34100)[_0xe8ec('0x13')](function(_0x2a3b73){_0x389c13(null,_0x2a3b73?_0x2a3b73[_0xe8ec('0x14')]:![]);})[_0xe8ec('0x15')](function(_0x39e557){_0x389c13(_0x39e557);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x1a')]=function(_0x5df9a9,_0x11dbe0){this[_0xe8ec('0xf')][_0xe8ec('0x1b')](_0x5df9a9)[_0xe8ec('0x13')](function(_0x30a35b){_0x11dbe0(null,_0x30a35b?_0x30a35b[_0xe8ec('0x1c')]:![]);})[_0xe8ec('0x15')](function(_0xaa01ef){_0x11dbe0(_0xaa01ef);});};AGIVertices[_0xe8ec('0x10')]['getUser']=function(_0x2d0c2c,_0x3fa53f){this[_0xe8ec('0xf')][_0xe8ec('0x1d')](_0x2d0c2c)[_0xe8ec('0x13')](function(_0x48a0bc){_0x3fa53f(null,_0x48a0bc?_0x48a0bc[_0xe8ec('0x14')]:![]);})[_0xe8ec('0x15')](function(_0x431af0){_0x3fa53f(_0x431af0);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x1e')]=function(_0x4443a1,_0x4ce7d3){this['rpc'][_0xe8ec('0x1f')](_0x4443a1)[_0xe8ec('0x13')](function(_0x35af9b){_0x4ce7d3(null,_0x35af9b?_0x35af9b[_0xe8ec('0x14')]:![]);})[_0xe8ec('0x15')](function(_0x3519a5){_0x4ce7d3(_0x3519a5);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x20')]=function(_0xa9e1b1,_0x2e2d47){var _0x388e15=this;this[_0xe8ec('0xf')][_0xe8ec('0x21')](_0xa9e1b1)[_0xe8ec('0x13')](function(_0x1140d6){_0x2e2d47(null,_0x1140d6?_0x388e15['getSoundPath'](_0x1140d6[_0xe8ec('0x22')]):![]);})[_0xe8ec('0x15')](function(_0x2ec6ff){_0x2e2d47(_0x2ec6ff);});};AGIVertices['prototype'][_0xe8ec('0x23')]=function(_0x4d4137,_0x45bb71){this[_0xe8ec('0xf')][_0xe8ec('0x24')](_0x4d4137)[_0xe8ec('0x13')](function(_0x9c83b9){_0x45bb71(null,_0x9c83b9?_0x9c83b9:![]);})['catch'](function(_0x1c8f9d){_0x45bb71(_0x1c8f9d);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x25')]=function(_0x5e3344,_0x2bc9e4,_0x4bfb2a){this[_0xe8ec('0x26')][_0xe8ec('0x25')](_0x5e3344,_0x2bc9e4)[_0xe8ec('0x13')](function(){_0x4bfb2a(null);})[_0xe8ec('0x15')](function(_0x12ff60){_0x4bfb2a(_0x12ff60);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x27')]=function(_0x2277cc,_0x7a1722){this['rpc'][_0xe8ec('0x28')](_0x2277cc)[_0xe8ec('0x13')](function(_0x18cd13){if(_0x18cd13){if(_0x18cd13['IntervalId']){_0x7a1722(null,[_0x18cd13[_0xe8ec('0x29')]]);}else{_0x7a1722(null,_[_0xe8ec('0x2a')](_0x18cd13['Intervals'],_0xe8ec('0x29')));}}else{_0x7a1722(null,![]);}})[_0xe8ec('0x15')](function(_0x1bd67e){_0x7a1722(_0x1bd67e);});};AGIVertices[_0xe8ec('0x10')]['getSoundPath']=function(_0x189109){return util[_0xe8ec('0x2b')](_0xe8ec('0x2c'),FILES_PATH,_0x189109);};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x2d')]=function(_0x295cdb,_0x165324,_0x29f78a){odbc['open'](_0x295cdb,function(_0x5b2e66){if(_0x5b2e66){logger[_0xe8ec('0x2e')](_0xe8ec('0x2f'),_0x5b2e66);_0x29f78a(_0x5b2e66);}else{logger[_0xe8ec('0x30')](_0xe8ec('0x31'));odbc[_0xe8ec('0x32')](_0x165324,function(_0x12b2db,_0x1456ec){if(_0x12b2db){logger['info'](_0xe8ec('0x33'),_0x165324);_0x29f78a(_0x12b2db);}else{logger['info'](_0xe8ec('0x34'),_0x165324);odbc[_0xe8ec('0x35')](function(_0x539ac9){if(_0x539ac9){logger['error'](_0xe8ec('0x36'),_0x539ac9);}_0x29f78a(null,_0x1456ec);});}});}});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x37')]=function(_0x5c99cd,_0x1223b8){this[_0xe8ec('0xf')][_0xe8ec('0x38')](_0x5c99cd)[_0xe8ec('0x13')](function(_0x3d52c9){_0x1223b8(null,_0x3d52c9?_0x3d52c9:![]);})['catch'](function(_0x55ac08){_0x1223b8(_0x55ac08);});};AGIVertices[_0xe8ec('0x10')]['createSmsMessage']=function(_0x3f06c1,_0x1784e3){this[_0xe8ec('0xf')][_0xe8ec('0x39')](_0x3f06c1)[_0xe8ec('0x13')](function(_0x21966e){_0x1784e3(null,_0x21966e);})[_0xe8ec('0x15')](function(_0x4f2f61){_0x1784e3(_0x4f2f61);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x3a')]=function(_0x40e8b3,_0x582d67,_0x2f295e){this[_0xe8ec('0xf')][_0xe8ec('0x3a')]({'uniqueid':this[_0xe8ec('0x3b')]['uniqueid'],'node':_0x40e8b3[_0xe8ec('0x3c')],'application':_0x40e8b3[_0xe8ec('0x3d')],'data':_0x582d67||null,'project_name':this[_0xe8ec('0x3b')]['arg_1'],'callerid':this[_0xe8ec('0x3b')]['callerid']})[_0xe8ec('0x13')](function(_0x34d93d){if(_0x2f295e){_0x2f295e(null,_0x34d93d);}})[_0xe8ec('0x15')](function(_0x5e8740){if(_0x2f295e){_0x2f295e(_0x5e8740);}});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x3e')]=function(_0x509e4a,_0x1479c3,_0x496e0a,_0x138995){this['rpc'][_0xe8ec('0x3e')]({'uniqueid':this[_0xe8ec('0x3b')][_0xe8ec('0x3f')],'callerid':this[_0xe8ec('0x3b')]['callerid'],'calleridname':this['channel']['calleridname'],'context':this[_0xe8ec('0x3b')][_0xe8ec('0x40')],'extension':this[_0xe8ec('0x3b')]['extension'],'priority':this[_0xe8ec('0x3b')][_0xe8ec('0x41')],'accountcode':this[_0xe8ec('0x3b')][_0xe8ec('0x42')],'dnid':this[_0xe8ec('0x3b')]['dnid'],'projectName':this[_0xe8ec('0x3b')][_0xe8ec('0x43')],'saveName':_0x1479c3,'filename':_0x509e4a[_0xe8ec('0x44')]||_0x1479c3,'savePath':_0x496e0a})[_0xe8ec('0x13')](function(_0x329ef3){_0x138995(null,_0x329ef3);})[_0xe8ec('0x15')](function(_0x37611a){_0x138995(_0x37611a);});};AGIVertices['prototype'][_0xe8ec('0x45')]=function(_0x100035,_0x59dc46,_0x31d2e6,_0x3e1132,_0x40b8e6){this[_0xe8ec('0xf')]['createSquareMessage']({'uniqueid':this[_0xe8ec('0x3b')][_0xe8ec('0x3f')],'body':_0x100035,'direction':_0x59dc46,'providerName':_0x31d2e6,'providerResponse':_0x3e1132})[_0xe8ec('0x13')](function(_0xab8f25){if(_0x40b8e6){_0x40b8e6(null,_0xab8f25);}})[_0xe8ec('0x15')](function(_0x1458ee){if(_0x40b8e6){_0x40b8e6(_0x1458ee);}});};AGIVertices['prototype'][_0xe8ec('0x46')]=function(_0x413d14,_0x482856){this['rpc'][_0xe8ec('0x46')]({'firstName':_['isEmpty'](_0x413d14['name'])||_[_0xe8ec('0x47')](_0x413d14[_0xe8ec('0x14')])?_0xe8ec('0x48')+Math[_0xe8ec('0x49')]():_0x413d14[_0xe8ec('0x14')],'lastName':_[_0xe8ec('0x4a')](_0x413d14['lastName'])||_['isNil'](_0x413d14[_0xe8ec('0x4b')])?null:_0x413d14[_0xe8ec('0x4b')],'phone':_0x413d14['phone'],'ListId':_0x413d14['list_id'],'scheduledat':_0x413d14[_0xe8ec('0x4c')],'callbackUniqueid':this[_0xe8ec('0x3b')][_0xe8ec('0x3f')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x413d14[_0xe8ec('0x4c')][_0xe8ec('0x4d')](),'priority':_0x413d14[_0xe8ec('0x4e')]})[_0xe8ec('0x13')](function(_0x5292e6){_0x482856(null,_0x5292e6);})['catch'](function(_0x17d1e4){_0x482856(_0x17d1e4);});};AGIVertices['prototype'][_0xe8ec('0x4f')]=function(_0x221a79,_0x553bf9){this[_0xe8ec('0xf')]['getPauseById'](_0x221a79)[_0xe8ec('0x13')](function(_0x4e69e5){_0x553bf9(null,_0x4e69e5?_0x4e69e5[_0xe8ec('0x14')]:![]);})[_0xe8ec('0x15')](function(_0x3ef497){_0x553bf9(_0x3ef497);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x50')]=function(_0x30a9b0,_0x56be8d,_0x249bcc){var _0x4acba2={'role':_0xe8ec('0x51')};_0x4acba2[_0x30a9b0]=this[_0xe8ec('0x3b')][_0xe8ec('0x52')];this[_0xe8ec('0xf')][_0xe8ec('0x50')](_0x4acba2,_0x56be8d,this['channel'][_0xe8ec('0x3f')])[_0xe8ec('0x13')](function(_0x5b066b){_0x249bcc(null,_['isNil'](_0x5b066b)?![]:!![]);})[_0xe8ec('0x15')](function(_0x1ded42){logger['error'](_0x1ded42);_0x249bcc(null,![]);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x53')]=function(_0x4ee845,_0x492062){var _0x26516e={'role':_0xe8ec('0x51')};_0x26516e[_0x4ee845]=this['channel']['callerid'];this[_0xe8ec('0xf')][_0xe8ec('0x53')](_0x26516e)[_0xe8ec('0x13')](function(_0x2a3286){_0x492062(null,_[_0xe8ec('0x47')](_0x2a3286)?![]:!![]);})[_0xe8ec('0x15')](function(_0x30e039){logger[_0xe8ec('0x2e')](_0x30e039);_0x492062(null,![]);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x54')]=function(_0x16c245,_0x1c1470){var _0x903ed5={'role':_0xe8ec('0x51')};_0x903ed5[_0x16c245]=this[_0xe8ec('0x3b')][_0xe8ec('0x52')];this['rpc'][_0xe8ec('0x54')](_0x903ed5)[_0xe8ec('0x13')](function(_0x3ae6ed){_0x1c1470(null,_[_0xe8ec('0x47')](_0x3ae6ed)?![]:!![]);})['catch'](function(_0x4f1ef6){logger[_0xe8ec('0x2e')](_0x4f1ef6);_0x1c1470(null,![]);});};AGIVertices['prototype'][_0xe8ec('0x55')]=function(_0x57824f,_0x40eb3b){var _0x1b93aa={'role':_0xe8ec('0x51')};_0x1b93aa[_0x57824f]=this[_0xe8ec('0x3b')][_0xe8ec('0x52')];var _0xaecdcd=_0x57824f!=_0xe8ec('0x56')?util[_0xe8ec('0x2b')](_0xe8ec('0x57'),_0xe8ec('0x58'),this['channel'][_0xe8ec('0x52')]):undefined;this[_0xe8ec('0xf')][_0xe8ec('0x55')](_0x1b93aa,_0xaecdcd)[_0xe8ec('0x13')](function(_0x55e370){_0x40eb3b(null,_[_0xe8ec('0x47')](_0x55e370)?![]:!![]);})['catch'](function(_0x317f52){logger['error'](_0x317f52);_0x40eb3b(null,![]);});};AGIVertices[_0xe8ec('0x10')]['shellCommand']=function(_0x41ce4b,_0x39e0a5){sh[_0xe8ec('0x59')](_[_0xe8ec('0x5a')](_0x41ce4b),function(_0x521509,_0x28cf8b){var _0x57255c=_0x28cf8b[_0xe8ec('0x5b')](/(\r\n|\n|\r)/gm,'');_0x39e0a5(null,_0x57255c);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x5c')]=function(_0x3a858c,_0x2a2d67){scripts['googleCloudTTS'](_0x3a858c[_0xe8ec('0x5d')],_0x3a858c[_0xe8ec('0x5e')]||'text',_0x3a858c['text'],_0x3a858c[_0xe8ec('0x5f')]||_0xe8ec('0x60'),_0x3a858c[_0xe8ec('0x61')]||_0xe8ec('0x62'),_0x3a858c[_0xe8ec('0x63')]||'MP3')['then'](function(_0x36069a){_0x2a2d67(null,_0x36069a);})[_0xe8ec('0x15')](function(_0x22e243){_0x2a2d67(_0x22e243);});};AGIVertices['prototype']['googleTTS']=function(_0x33b9e4,_0x5f38f8){scripts[_0xe8ec('0x64')](_0x33b9e4['text'],_0x33b9e4[_0xe8ec('0x65')]||'en',0x1)[_0xe8ec('0x13')](function(_0x2600d3){_0x5f38f8(null,_0x2600d3);})['catch'](function(_0x407b6f){_0x5f38f8(_0x407b6f);});};AGIVertices[_0xe8ec('0x10')]['restAPI']=function(_0x16a85b,_0x31125a){var _0x1bd095={'uri':_0x16a85b[_0xe8ec('0x66')],'method':_0x16a85b['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x16a85b[_0xe8ec('0x67')])==='number'&&parseInt(_0x16a85b[_0xe8ec('0x67')])>=0x1?parseInt(_0x16a85b[_0xe8ec('0x67')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xe8ec('0x68'),_0xe8ec('0x69')],_0x1bd095[_0xe8ec('0x6a')]['toUpperCase']())){try{_0x1bd095[_0xe8ec('0x6b')]=_0x16a85b[_0xe8ec('0xb')]?JSON[_0xe8ec('0x6c')](_0x16a85b[_0xe8ec('0xb')]):{};}catch(_0x33861f){logger[_0xe8ec('0x2e')](_0xe8ec('0x6d'),_0x33861f);}}try{_0x1bd095[_0xe8ec('0x6e')]=_0x16a85b['rawHeaders']?JSON['parse'](_0x16a85b[_0xe8ec('0xa')]):{};}catch(_0x2243ef){logger[_0xe8ec('0x2e')](_0xe8ec('0x6f'),_0x2243ef);}if(_0x16a85b[_0xe8ec('0x70')]){try{var _0x4e40c4=require(_0x16a85b['computedVariables'])['sync'](this,_0x1bd095);_0x1bd095[_0xe8ec('0x71')]=Mustache[_0xe8ec('0x72')](_0x16a85b[_0xe8ec('0x66')],_0x4e40c4,{},['$$','$$']);if(_0x1bd095[_0xe8ec('0x6e')]){_0x1bd095[_0xe8ec('0x6e')]=JSON['parse'](Mustache['render'](JSON[_0xe8ec('0x73')](_0x1bd095[_0xe8ec('0x6e')]),_0x4e40c4,{},['$$','$$']));}if(_0x1bd095[_0xe8ec('0x6b')]){_0x1bd095[_0xe8ec('0x6b')]=JSON['parse'](Mustache[_0xe8ec('0x72')](JSON[_0xe8ec('0x73')](_0x1bd095[_0xe8ec('0x6b')]),_0x4e40c4,{},['$$','$$']));}}catch(_0x5c20ba){logger[_0xe8ec('0x2e')](_0xe8ec('0x74'),_0x5c20ba);}}rp(_0x1bd095)['then'](function(_0x163aa0){var _0xa1e0cb={'statusCode':_0x163aa0[_0xe8ec('0x75')]||0xc8,'statusMessage':_0x163aa0[_0xe8ec('0x76')]||'OK','headers':_0x163aa0[_0xe8ec('0x6e')]||{},'body':_0x163aa0[_0xe8ec('0x6b')]||{}};_0x31125a(null,_0xa1e0cb);})[_0xe8ec('0x15')](function(_0x27ef82){var _0x163bda={'statusCode':_0x27ef82[_0xe8ec('0x75')]||0x1f4,'statusMessage':_0x27ef82[_0xe8ec('0x77')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x27ef82[_0xe8ec('0x78')][_0xe8ec('0x6e')]||{},'body':_0x27ef82[_0xe8ec('0x78')]['body']||{}};_0x31125a(null,_0x163bda);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x79')]=function(_0x1011f5,_0x32b42c){scripts[_0xe8ec('0x79')](this[_0xe8ec('0x3b')]['uniqueid'],_0x1011f5['key'],_0x1011f5[_0xe8ec('0x7a')],_0x1011f5['dialogflow_language']||'en')[_0xe8ec('0x13')](function(_0x4b6cc0){_0x32b42c(null,_0x4b6cc0);})[_0xe8ec('0x15')](function(_0x486809){_0x32b42c(_0x486809);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x7b')]=function(_0x336204,_0x54851b){scripts['googleDialogflowV2'](this[_0xe8ec('0x3b')][_0xe8ec('0x3f')],_0x336204[_0xe8ec('0x7c')],_0x336204[_0xe8ec('0x7d')],_0x336204['private_key'],_0x336204[_0xe8ec('0x7a')],_0x336204['dialogflowV2_language']||'en')[_0xe8ec('0x13')](function(_0x4fb460){_0x54851b(null,_0x4fb460);})['catch'](function(_0x11a4e6){_0x54851b(_0x11a4e6);});};AGIVertices['prototype'][_0xe8ec('0x7e')]=function(_0x4d2dee,_0x45a3dd){scripts[_0xe8ec('0x7e')](this[_0xe8ec('0x3b')],_0x4d2dee)[_0xe8ec('0x13')](function(_0x41f033){_0x45a3dd(null,_0x41f033);})[_0xe8ec('0x15')](function(_0x1a38bb){_0x45a3dd(_0x1a38bb);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x7f')]=function(_0x3b6338,_0x4f7d0c){scripts[_0xe8ec('0x7f')](_0x3b6338[_0xe8ec('0x80')],_0x3b6338[_0xe8ec('0x7a')],_0x3b6338[_0xe8ec('0x81')]||'en-US',_0x3b6338[_0xe8ec('0x82')])[_0xe8ec('0x13')](function(_0x15097f){_0x4f7d0c(null,_0x15097f);})[_0xe8ec('0x15')](function(_0x3d1d57){_0x4f7d0c(_0x3d1d57);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x83')]=function(_0x1e5b7f,_0x2e4e4d,_0x3285c7){scripts[_0xe8ec('0x83')](_0x2e4e4d,_0x1e5b7f['key'],_0x1e5b7f['ispeech_asr_language']||_0xe8ec('0x60'),this[_0xe8ec('0x84')](_0x1e5b7f[_0xe8ec('0x85')])?_0x1e5b7f[_0xe8ec('0x85')]:undefined)[_0xe8ec('0x13')](function(_0x2d95bd){_0x3285c7(null,_0x2d95bd);})[_0xe8ec('0x15')](function(_0x3480d2){_0x3285c7(_0x3480d2);});};AGIVertices[_0xe8ec('0x10')]['awsPolly']=function(_0x4856a2,_0x12ff35){scripts[_0xe8ec('0x86')](_0x4856a2['aws_access_key_id'],_0x4856a2['aws_secret_access_key'],_0x4856a2[_0xe8ec('0x87')],_0x4856a2[_0xe8ec('0x88')]||_0xe8ec('0x89'),_0x4856a2[_0xe8ec('0x7a')],_0x4856a2[_0xe8ec('0x8a')]||_0xe8ec('0x7a'))[_0xe8ec('0x13')](function(_0x2c6758){_0x12ff35(null,_0x2c6758);})[_0xe8ec('0x15')](function(_0x3c0cb3){_0x12ff35(_0x3c0cb3);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x8b')]=function(_0x2aa0a4,_0x37a3ab){scripts['awsLex'](this[_0xe8ec('0x3b')]['uniqueid'],_0x2aa0a4[_0xe8ec('0x8c')],_0x2aa0a4[_0xe8ec('0x8d')],_0x2aa0a4[_0xe8ec('0x8e')],_0x2aa0a4[_0xe8ec('0x7a')],_0x2aa0a4[_0xe8ec('0x8f')])[_0xe8ec('0x13')](function(_0x2a0152){_0x37a3ab(null,_0x2a0152);})[_0xe8ec('0x15')](function(_0x100a9c){_0x37a3ab(_0x100a9c);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x90')]=function(_0x8349de,_0x19bfad,_0x3f0aec){scripts['googleASR'](_0x19bfad,_0x8349de[_0xe8ec('0x80')],_0x8349de[_0xe8ec('0x91')]||_0xe8ec('0x60'))[_0xe8ec('0x13')](function(_0x566f19){_0x3f0aec(null,_0x566f19);})[_0xe8ec('0x15')](function(_0x12c4a8){_0x3f0aec(_0x12c4a8);});};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x92')]=function(_0x258476,_0x82364f,_0x4e6caa){scripts[_0xe8ec('0x92')](_0x82364f,_0x258476[_0xe8ec('0x93')],_0x258476[_0xe8ec('0x94')],_0x258476[_0xe8ec('0x71')])[_0xe8ec('0x13')](function(_0x25fc25){_0x4e6caa(null,_0x25fc25);})[_0xe8ec('0x15')](function(_0x4ce995){_0x4e6caa(_0x4ce995);});};AGIVertices[_0xe8ec('0x10')]['clear']=function(_0x531d00){var _0x3f06aa=_[_0xe8ec('0x95')](verticesWithRetry,_0x531d00[_0xe8ec('0x3d')])?_0x531d00:_['clone'](_0x531d00);for(var _0x16b2d8 in _0x3f06aa){if(_0x3f06aa[_0xe8ec('0x96')](_0x16b2d8)){if(_0x3f06aa[_0x16b2d8]&&_[_0xe8ec('0x97')](_0x3f06aa[_0x16b2d8])){if(_[_0xe8ec('0x95')](recursiveMapAttributes,_0x16b2d8)){_0x3f06aa[_0x16b2d8]=this[_0xe8ec('0x98')](_0x3f06aa[_0x16b2d8]);}else{_0x3f06aa[_0x16b2d8]=this[_0xe8ec('0x99')](_0x3f06aa[_0x16b2d8]);}}}}return _0x3f06aa;};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x9a')]=function(_0x22fbe0){for(var _0x4fb1f in _0x22fbe0){if(_0x22fbe0[_0xe8ec('0x96')](_0x4fb1f)){if(_[_0xe8ec('0x9b')](_0x22fbe0[_0x4fb1f])){this[_0xe8ec('0x9a')](_0x22fbe0[_0x4fb1f]);}else if(_[_0xe8ec('0x9c')](_0x22fbe0[_0x4fb1f])){for(var _0xbe5fa6=0x0;_0xbe5fa6<_0x22fbe0[_0x4fb1f][_0xe8ec('0x9d')];_0xbe5fa6++){this[_0xe8ec('0x9a')](_0x22fbe0[_0x4fb1f][_0xbe5fa6]);}}else if(_[_0xe8ec('0x97')](_0x22fbe0[_0x4fb1f])){_0x22fbe0[_0x4fb1f]=this[_0xe8ec('0x99')](_0x22fbe0[_0x4fb1f]);}}}};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x9e')]=function(_0x171162,_0x15f785){for(var _0x965376 in _0x171162){if(_0x171162[_0xe8ec('0x96')](_0x965376)){if(_[_0xe8ec('0x9b')](_0x171162[_0x965376])){if(!_['isEmpty'](_0x171162[_0x965376])){this[_0xe8ec('0x9e')](_0x171162[_0x965376],util['format'](_0xe8ec('0x9f'),_0x15f785,_0x965376));}}else if(_[_0xe8ec('0x9c')](_0x171162[_0x965376])){for(var _0x20f701=0x0;_0x20f701<_0x171162[_0x965376][_0xe8ec('0x9d')];_0x20f701++){this[_0xe8ec('0x9e')](_0x171162[_0x965376][_0x20f701],util[_0xe8ec('0x2b')](_0xe8ec('0x9f'),_0x15f785,_0x965376+'['+_0x20f701+']'));}}else{if(!_[_0xe8ec('0x47')](_0x171162[_0x965376])){this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](util[_0xe8ec('0x2b')](_0xe8ec('0x9f'),_0x15f785,_0x965376),_0x171162[_0x965376]);}}}}};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x98')]=function(_0x4df339){try{var _0x188ed2=JSON[_0xe8ec('0x6c')](_0x4df339);this['recursiveNodeIndex'](_0x188ed2);return JSON[_0xe8ec('0x73')](_0x188ed2);}catch(_0xe731d){return this[_0xe8ec('0x99')](_0x4df339);}};AGIVertices['prototype'][_0xe8ec('0x99')]=function(_0x14acf2){var _0x362db0=_0x14acf2[_0xe8ec('0xa1')]('{');for(var _0xb24578=0x1;_0xb24578<_0x362db0['length'];_0xb24578+=0x1){var _0x2daa40=_0x362db0[_0xb24578][_0xe8ec('0xa1')]('}');if(_0x2daa40[_0xe8ec('0x9d')]>0x1){_0x14acf2=_0x14acf2[_0xe8ec('0xa2')]('{'+_0x2daa40[0x0]+'}',this[_0xe8ec('0x3b')][_0xe8ec('0x11')](_0x2daa40[0x0])[_0xe8ec('0xa3')]||_0x2daa40[0x0]);}}if(_0x362db0[_0xe8ec('0x9d')]===0x1){return _0x14acf2[_0xe8ec('0x4d')]();}return this[_0xe8ec('0x99')](_0x14acf2);};AGIVertices['prototype'][_0xe8ec('0xa4')]=function(_0x3bf8e8,_0x2c5ead){var _0x343135=this['channel'][_0xe8ec('0x11')](_0x3bf8e8);if(_0x343135[_0xe8ec('0xa5')]===-0x1){return _0x343135;}logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0xa6'),_0x2c5ead,_0x343135[_0xe8ec('0xa3')]));return this['channel'][_0xe8ec('0xa0')](_0x2c5ead,_0x343135[_0xe8ec('0xa3')]);};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x84')]=function(_0x32eb7c){return _0x32eb7c&&_0x32eb7c!=='0'&&_0x32eb7c!=='-1'&&_0x32eb7c!=='';};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0xa7')]=function(_0xbc9e8f){this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0xbc9e8f,'-');_0xbc9e8f[_0xe8ec('0xa9')]=_0xbc9e8f[_0xe8ec('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0xaa')]=function(_0x3d0bd5){logger[_0xe8ec('0x30')](util['format'](_0xe8ec('0xab'),_0x3d0bd5[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x3d0bd5[_0xe8ec('0x7a')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xad'));}var _0x28bf51='\x22'+_0x3d0bd5['text']+'\x22';if(this[_0xe8ec('0x84')](_0x3d0bd5[_0xe8ec('0x78')])){_0x28bf51+=','+_0x3d0bd5['options'];}var _0x425cab=this[_0xe8ec('0x3b')][_0xe8ec('0x59')](_0xe8ec('0xae'),_0x28bf51);if(_0x425cab[_0xe8ec('0xa5')]===-0x1){return _0x425cab;}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0xaf'),_0x28bf51));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0xb0')]=function(_0x1cba06){logger['info'](util[_0xe8ec('0x2b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1cba06['label']));if(!this[_0xe8ec('0x84')](_0x1cba06[_0xe8ec('0xb1')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')]('no\x20grammar\x20configured');}var _0x3228dd=_0x1cba06['grammar'];if(this['isConfigured'](_0x1cba06[_0xe8ec('0x78')])){_0x3228dd+=','+_0x1cba06['options'];}var _0x1ae641=this['channel'][_0xe8ec('0x59')](_0xe8ec('0xb2'),_0x3228dd);if(_0x1ae641[_0xe8ec('0xa5')]===-0x1){return _0x1ae641;}var _0x48a4eb=this[_0xe8ec('0xa4')](_0xe8ec('0xb3'),_0xe8ec('0xb4'));if(_0x48a4eb['result']===-0x1){return _0x48a4eb;}var _0x19466a=this[_0xe8ec('0xa4')](_0xe8ec('0xb5'),_0xe8ec('0xb6'));if(_0x19466a[_0xe8ec('0xa5')]===-0x1){return _0x19466a;}var _0x146582=this[_0xe8ec('0xa4')](_0xe8ec('0xb7'),'MRCP_RECOG_INSTANCE');if(_0x146582[_0xe8ec('0xa5')]===-0x1){return _0x146582;}return this['channel'][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0xb8'),_0x3228dd));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x7')]=function(_0x5da07f){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x5da07f[_0xe8ec('0x3c')]));return this[_0xe8ec('0x3b')][_0xe8ec('0x7')]([_0x5da07f['command'],_0x5da07f[_0xe8ec('0xb9')]]);};AGIVertices['prototype'][_0xe8ec('0xba')]=function(_0x4a0d68){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0xbb'),_0x4a0d68[_0xe8ec('0x3c')]));if(this[_0xe8ec('0x84')](_0x4a0d68[_0xe8ec('0x67')])){logger['info'](util[_0xe8ec('0x2b')](_0xe8ec('0xbc'),_0x4a0d68[_0xe8ec('0x67')]));var _0xe61567=this[_0xe8ec('0x3b')]['wait'](_0x4a0d68[_0xe8ec('0x67')]);if(_0xe61567[_0xe8ec('0xa5')]===-0x1){return _0xe61567;}}return this[_0xe8ec('0x3b')][_0xe8ec('0xba')]();};AGIVertices['prototype'][_0xe8ec('0xbd')]=function(_0x38f431){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x38f431[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x38f431[_0xe8ec('0xbe')])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x38f431,_0xe8ec('0xbf'));}_0x38f431['scheduledAt']=moment();if(this[_0xe8ec('0x84')](_0x38f431[_0xe8ec('0xc0')])){_0x38f431[_0xe8ec('0x4c')]=moment()[_0xe8ec('0xc1')](_0x38f431[_0xe8ec('0xc0')],'minutes');}if(!this[_0xe8ec('0x84')](_0x38f431[_0xe8ec('0x4e')])){_0x38f431['callback_priority']=0x2;}this[_0xe8ec('0x46')][_0xe8ec('0xa8')](this,_0x38f431);return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0xc2'),_0x38f431[_0xe8ec('0xc3')],_0x38f431[_0xe8ec('0xbe')],_0x38f431[_0xe8ec('0x4c')]));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0xc4')]=function(_0x57d59a){logger['info'](util[_0xe8ec('0x2b')](_0xe8ec('0xc5'),_0x57d59a[_0xe8ec('0x3c')]));var _0x28cab9=this[_0xe8ec('0x3b')]['exec'](_0x57d59a[_0xe8ec('0xc6')],_0x57d59a[_0xe8ec('0x78')]);if(_0x28cab9[_0xe8ec('0xa5')]===-0x1){return _0x28cab9;}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util['format'](_0xe8ec('0xc7'),_0x57d59a[_0xe8ec('0xc6')],_0x57d59a['options']));};AGIVertices['prototype'][_0xe8ec('0xc8')]=function(_0x4c6304){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x4c6304['label']));if(!this['isConfigured'](_0x4c6304[_0xe8ec('0x7a')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')]('no\x20text\x20configured');}var _0x5f2925='\x22'+_0x4c6304[_0xe8ec('0x7a')]+'\x22';if(this['isConfigured'](_0x4c6304['options'])){_0x5f2925+=','+_0x4c6304[_0xe8ec('0x78')];}var _0x4544d2=this[_0xe8ec('0x3b')][_0xe8ec('0x59')]('MRCPSynth',_0x5f2925);if(_0x4544d2[_0xe8ec('0xa5')]===-0x1){return _0x4544d2;}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5f2925));};AGIVertices['prototype']['sestektts']=function(_0xed8ba4){logger[_0xe8ec('0x30')](util['format'](_0xe8ec('0xc9'),_0xed8ba4[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0xed8ba4[_0xe8ec('0x7a')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xad'));}var _0x1c8afe='\x22'+_0xed8ba4[_0xe8ec('0x7a')]+'\x22';if(this[_0xe8ec('0x84')](_0xed8ba4['options'])){_0x1c8afe+=','+_0xed8ba4[_0xe8ec('0x78')];}var _0x81519e=this[_0xe8ec('0x3b')][_0xe8ec('0x59')](_0xe8ec('0xae'),_0x1c8afe);if(_0x81519e[_0xe8ec('0xa5')]===-0x1){return _0x81519e;}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0xaf'),_0x1c8afe));};AGIVertices['prototype'][_0xe8ec('0xca')]=function(_0xe7c388){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xe7c388[_0xe8ec('0x3c')]));if(!this['isConfigured'](_0xe7c388[_0xe8ec('0xb1')])){return this[_0xe8ec('0x3b')]['noop'](_0xe8ec('0xcb'));}var _0x2a878e=_0xe7c388[_0xe8ec('0xb1')];if(this[_0xe8ec('0x84')](_0xe7c388['options'])){_0x2a878e+=','+_0xe7c388[_0xe8ec('0x78')];}var _0x34ad65=this[_0xe8ec('0x3b')][_0xe8ec('0x59')](_0xe8ec('0xb2'),_0x2a878e);if(_0x34ad65[_0xe8ec('0xa5')]===-0x1){return _0x34ad65;}var _0x5634cc=this[_0xe8ec('0xa4')]('RECOG_CONFIDENCE()',_0xe8ec('0xcc'));if(_0x5634cc[_0xe8ec('0xa5')]===-0x1){return _0x5634cc;}var _0x1ddad6=this[_0xe8ec('0xa4')](_0xe8ec('0xb5'),_0xe8ec('0xcd'));if(_0x1ddad6[_0xe8ec('0xa5')]===-0x1){return _0x1ddad6;}var _0x528a4e=this['getAndSetVariable'](_0xe8ec('0xb7'),_0xe8ec('0xce'));if(_0x528a4e[_0xe8ec('0xa5')]===-0x1){return _0x528a4e;}return this[_0xe8ec('0x3b')]['noop'](util[_0xe8ec('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2a878e));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0xcf')]=function(_0x55773a){logger[_0xe8ec('0x30')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x55773a[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x55773a['grammar'])){return this['channel'][_0xe8ec('0xac')](_0xe8ec('0xcb'));}var _0x5ed1ee=_0x55773a[_0xe8ec('0xb1')];if(this[_0xe8ec('0x84')](_0x55773a[_0xe8ec('0x78')])){_0x5ed1ee+=','+_0x55773a['options'];}var _0x7a4fe5=this[_0xe8ec('0x3b')]['exec'](_0xe8ec('0xb2'),_0x5ed1ee);if(_0x7a4fe5[_0xe8ec('0xa5')]===-0x1){return _0x7a4fe5;}var _0x477719=this[_0xe8ec('0xa4')](_0xe8ec('0xb3'),_0xe8ec('0xd0'));if(_0x477719[_0xe8ec('0xa5')]===-0x1){return _0x477719;}var _0xca1b8a=this[_0xe8ec('0xa4')](_0xe8ec('0xb5'),_0xe8ec('0xd1'));if(_0xca1b8a[_0xe8ec('0xa5')]===-0x1){return _0xca1b8a;}var _0x5d5643=this[_0xe8ec('0xa4')](_0xe8ec('0xb7'),'SESTEK_ASR_INSTANCE');if(_0x5d5643[_0xe8ec('0xa5')]===-0x1){return _0x5d5643;}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5ed1ee));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0xd2')]=function(_0x18c12f){logger['info'](util[_0xe8ec('0x2b')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x18c12f['label']));if(!this[_0xe8ec('0x84')](_0x18c12f[_0xe8ec('0xd3')])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x18c12f,'no\x20database\x20selected');}var _0x2951eb=this[_0xe8ec('0x1a')][_0xe8ec('0xa8')](this,_0x18c12f[_0xe8ec('0xd3')]);if(!_0x2951eb){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x18c12f,'no\x20odbc\x20database\x20found');}if(!this[_0xe8ec('0x84')](_0x18c12f[_0xe8ec('0x32')])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x18c12f,_0xe8ec('0xd4'));}var _0x1df62f=_0x18c12f[_0xe8ec('0x32')][_0xe8ec('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe8ec('0x3b')]['noop'](util[_0xe8ec('0x2b')](_0xe8ec('0xd5'),_0x1df62f));var _0x56b7e0=this[_0xe8ec('0x2d')][_0xe8ec('0xa8')](this,_0x2951eb,_0x1df62f);this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x18c12f,_0x1df62f);if(!this[_0xe8ec('0x84')](_0x18c12f[_0xe8ec('0xd6')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xd7'));}var _0x2d272c=this[_0xe8ec('0x11')][_0xe8ec('0xa8')](this,_0x18c12f[_0xe8ec('0xd6')]);if(!_0x2d272c){return this['channel'][_0xe8ec('0x2e')](_0x18c12f,'no\x20variable\x20found');}var _0x38fbd2=this;_0x56b7e0[_0xe8ec('0xd8')](function(_0x4aabba,_0x325075){Object[_0xe8ec('0xd9')](_0x4aabba)[_0xe8ec('0xd8')](function(_0x532895){_0x38fbd2['channel'][_0xe8ec('0xa0')](util['format'](_0xe8ec('0xda'),_0x2d272c,_0x325075,_0x532895),_0x4aabba[_0x532895]);});});this[_0xe8ec('0x3b')]['setVariable'](util[_0xe8ec('0x2b')](_0xe8ec('0xdb'),_0x2d272c),_0x56b7e0['length']);return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0xdc'),_0x2d272c));};AGIVertices[_0xe8ec('0x10')]['dial']=function(_0x5807ce){logger[_0xe8ec('0xdd')](util['format'](_0xe8ec('0xde'),_0x5807ce[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x5807ce[_0xe8ec('0xdf')])){return this['channel'][_0xe8ec('0x2e')](_0x5807ce,_0xe8ec('0xe0'));}var _0x1f80a5=this['getUser'][_0xe8ec('0xa8')](this,_0x5807ce[_0xe8ec('0xdf')]);if(!_0x1f80a5){return this['channel']['error'](_0x5807ce,_0xe8ec('0xe1'));}var _0x2835c3=this[_0xe8ec('0x3b')][_0xe8ec('0x59')](_0xe8ec('0xe2'),[util[_0xe8ec('0x2b')](_0xe8ec('0xe3'),_0x1f80a5),_0x5807ce[_0xe8ec('0x67')],_0x5807ce[_0xe8ec('0xe4')],_0x5807ce[_0xe8ec('0x66')]]);if(_0x2835c3[_0xe8ec('0xa5')]===-0x1){return _0x2835c3;}return this[_0xe8ec('0x3b')]['noop'](util['format'](_0xe8ec('0xe5'),_0xe8ec('0xe2')));};AGIVertices[_0xe8ec('0x10')]['dialogflow']=function(_0x36f8aa){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x36f8aa[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x36f8aa[_0xe8ec('0x80')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xe6'));}if(!this['isConfigured'](_0x36f8aa['text'])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')]('no\x20text\x20configured');}this[_0xe8ec('0x3b')][_0xe8ec('0xe7')]=!![];this['createSquareDetailsReport'](_0x36f8aa);this[_0xe8ec('0x45')](_0x36f8aa[_0xe8ec('0x7a')],'in','','');this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util['format'](_0xe8ec('0xe8'),_0x36f8aa[_0xe8ec('0x7a')]));var _0x2ec3cc=this[_0xe8ec('0x79')][_0xe8ec('0xa8')](this,_0x36f8aa);if(_0x2ec3cc){for(var _0x4244f3 in _0x2ec3cc){if(_0x2ec3cc[_0xe8ec('0x96')](_0x4244f3)){this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](util[_0xe8ec('0x2b')](_0xe8ec('0xe9'),_0x4244f3['toUpperCase']()),_0x2ec3cc[_0x4244f3]);}}this[_0xe8ec('0x45')](_0x2ec3cc[_0xe8ec('0xea')],_0xe8ec('0xeb'),_0xe8ec('0xec'),'');return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0xed'),_0x2ec3cc[_0xe8ec('0xea')]));}return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x36f8aa,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0xee')]=function(_0xf9a3b1){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0xf9a3b1[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0xf9a3b1[_0xe8ec('0x7c')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xef'));}if(!this['isConfigured'](_0xf9a3b1['client_email'])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xf0'));}if(!this[_0xe8ec('0x84')](_0xf9a3b1[_0xe8ec('0xf1')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xf2'));}if(!this['isConfigured'](_0xf9a3b1[_0xe8ec('0xf3')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xf4'));}if(!this[_0xe8ec('0x84')](_0xf9a3b1[_0xe8ec('0x7a')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')]('no\x20text\x20configured');}this[_0xe8ec('0x3b')][_0xe8ec('0xe7')]=!![];this['createSquareDetailsReport'](_0xf9a3b1);this['createSquareMessage'](_0xf9a3b1[_0xe8ec('0x7a')],'in','','');this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0xf5'),_0xf9a3b1[_0xe8ec('0x7a')]));var _0x1d00f7=this[_0xe8ec('0x7b')][_0xe8ec('0xa8')](this,_0xf9a3b1);if(_0x1d00f7){for(var _0x54f512 in _0x1d00f7){if(_0x1d00f7[_0xe8ec('0x96')](_0x54f512)){if(_0x54f512!==_0xe8ec('0xf6')){this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](util[_0xe8ec('0x2b')](_0xe8ec('0xe9'),_0x54f512[_0xe8ec('0xf7')]()),_0x1d00f7[_0x54f512]);}}}this[_0xe8ec('0x45')](_0x1d00f7[_0xe8ec('0xea')],_0xe8ec('0xeb'),_0xe8ec('0xee'),_0x1d00f7[_0xe8ec('0xf6')]);return this[_0xe8ec('0x3b')]['noop'](util[_0xe8ec('0x2b')](_0xe8ec('0xf8'),_0x1d00f7[_0xe8ec('0xea')]));}return this['channel'][_0xe8ec('0x2e')](_0xf9a3b1,_0xe8ec('0xf9'));};AGIVertices[_0xe8ec('0x10')]['sesteknda']=function(_0x862394){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0xfa'),_0x862394[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x862394[_0xe8ec('0xfb')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xfc'));}if(!this[_0xe8ec('0x84')](_0x862394[_0xe8ec('0xfd')])){return this['channel'][_0xe8ec('0xac')](_0xe8ec('0xfe'));}if(!this['isConfigured'](_0x862394[_0xe8ec('0xff')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0x100'));}if(!this[_0xe8ec('0x84')](_0x862394[_0xe8ec('0x101')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xad'));}this[_0xe8ec('0x3b')][_0xe8ec('0xe7')]=!![];this[_0xe8ec('0x3a')](_0x862394);this[_0xe8ec('0x45')](_0x862394[_0xe8ec('0x7a')],'in','','');this['channel'][_0xe8ec('0xac')](util['format'](_0xe8ec('0x102'),_0x862394['text']));var _0x313786=this['sestekNDA'][_0xe8ec('0xa8')](this,_0x862394);if(_0x313786){for(var _0x20e93f in _0x313786){if(_0x313786['hasOwnProperty'](_0x20e93f)){this['channel'][_0xe8ec('0xa0')](util[_0xe8ec('0x2b')](_0xe8ec('0x103'),_0x20e93f['toUpperCase']()),_0x313786[_0x20e93f]);}}this[_0xe8ec('0x45')](_0x313786['speech'],_0xe8ec('0xeb'),_0xe8ec('0x104'),'');if(_0x313786['audiofile']){this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x105'),_0x313786[_0xe8ec('0x106')]));var _0x444df9=this[_0xe8ec('0x3b')]['streamFile'](_0x313786[_0xe8ec('0x106')]);try{fs[_0xe8ec('0x107')](_0x313786[_0xe8ec('0x106')]+_0xe8ec('0x108'));}catch(_0x233ab8){logger[_0xe8ec('0x2e')](_0x233ab8);}return _0x444df9;}else{return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x109'),_0x313786[_0xe8ec('0xea')]));}}return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x862394,_0xe8ec('0x10a'));};AGIVertices['prototype'][_0xe8ec('0x10b')]=function(_0x33d53c){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x10c'),_0x33d53c[_0xe8ec('0x3c')]));return this[_0xe8ec('0x3b')][_0xe8ec('0xac')]('end');};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x10d')]=function(_0x4c5ced){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x10e'),_0x4c5ced[_0xe8ec('0x3c')]));var _0x5c1841='';if(_0x4c5ced[_0xe8ec('0x10f')]){if(!this[_0xe8ec('0x84')](_0x4c5ced['trunk_id'])){return this['channel'][_0xe8ec('0x2e')](_0x4c5ced,_0xe8ec('0x110'));}else{var _0xf6a778=parseInt(_0x4c5ced[_0xe8ec('0x10f')],0xa);if(isNaN(_0xf6a778)){_0x5c1841=_0x4c5ced[_0xe8ec('0x10f')];}else{_0x5c1841=this[_0xe8ec('0x1e')]['sync'](this,_0x4c5ced[_0xe8ec('0x10f')]);if(!_0x5c1841){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x4c5ced,_0xe8ec('0x111'));}}}}else if(_0x4c5ced[_0xe8ec('0x112')]){_0x5c1841=_0x4c5ced['trunk_name'];}else{return this[_0xe8ec('0x3b')]['error'](_0x4c5ced,_0xe8ec('0x110'));}var _0x46c541=this[_0xe8ec('0x3b')][_0xe8ec('0x59')]('DIAL',[util[_0xe8ec('0x2b')]('SIP/%s/%s',_0x5c1841,_0x4c5ced[_0xe8ec('0xc3')]),_0x4c5ced[_0xe8ec('0x67')],_0x4c5ced['opts'],_0x4c5ced[_0xe8ec('0x66')]]);if(_0x46c541[_0xe8ec('0xa5')]===-0x1){return _0x46c541;}return this[_0xe8ec('0x3b')]['noop'](util['format'](_0xe8ec('0xe5'),_0xe8ec('0xe2')));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x113')]=function(_0x46762f){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x114'),_0x46762f[_0xe8ec('0x3c')]));return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0x113'));};AGIVertices[_0xe8ec('0x10')]['getdigits']=function(_0x546f05){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x546f05[_0xe8ec('0x3c')]));if(_0x546f05[_0xe8ec('0xa9')]===0x0){return this[_0xe8ec('0xa7')](_0x546f05);}_0x546f05[_0xe8ec('0xa9')]-=0x1;if(!this[_0xe8ec('0x84')](_0x546f05[_0xe8ec('0x115')])){return this['channel'][_0xe8ec('0x2e')](_0x546f05,'no\x20file\x20audio\x20selected');}var _0x540f18=this[_0xe8ec('0x20')][_0xe8ec('0xa8')](this,_0x546f05[_0xe8ec('0x115')]);if(!_0x540f18){return this[_0xe8ec('0x3b')]['error'](_0x546f05,_0xe8ec('0x116'));}if(!this[_0xe8ec('0x84')](_0x546f05[_0xe8ec('0xd6')])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1dd4fe=this[_0xe8ec('0x3b')]['getData'](_0x540f18,_0x546f05[_0xe8ec('0x117')],_0x546f05[_0xe8ec('0x118')]);var _0x2bcb8b=_0x1dd4fe[_0xe8ec('0xa5')]?_0x1dd4fe[_0xe8ec('0xa5')][_0xe8ec('0x4d')]():'';logger[_0xe8ec('0x30')](_0xe8ec('0x119'),JSON[_0xe8ec('0x73')](_0x1dd4fe));if(_0x1dd4fe[_0xe8ec('0xa5')]===-0x1){this[_0xe8ec('0x3a')]['sync'](this,_0x546f05,_0x2bcb8b);return _0x1dd4fe;}else if(_0x1dd4fe[_0xe8ec('0xa3')]===_0xe8ec('0x67')){_0x1dd4fe[_0xe8ec('0xa5')]=_0x2bcb8b['length']>=parseInt(_0x546f05[_0xe8ec('0x11a')])?'x':'i';}else{_0x1dd4fe[_0xe8ec('0xa5')]=_0x2bcb8b['length']>=parseInt(_0x546f05[_0xe8ec('0x11a')])&&_0x2bcb8b['length']<=parseInt(_0x546f05[_0xe8ec('0x118')])?'x':'i';}var _0x433522=this[_0xe8ec('0x11')][_0xe8ec('0xa8')](this,_0x546f05[_0xe8ec('0xd6')]);if(!_0x433522){return this['channel'][_0xe8ec('0x2e')](_0x546f05,'no\x20variable\x20found');}this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](_0x433522,_0x2bcb8b);if(this[_0xe8ec('0x84')](_0x546f05[_0xe8ec('0x11b')])){var _0x46c795=parseInt(_0x546f05[_0xe8ec('0x11b')],0xa);var _0x73ccce=rs[_0xe8ec('0x11c')]({'charset':'*','length':_0x46c795});var _0x536dd5=_0x2bcb8b[_0xe8ec('0x9d')];if(_0x536dd5>0x0){if(_0x536dd5>_0x46c795){this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x546f05,_0x546f05[_0xe8ec('0x11d')]===_0xe8ec('0x11e')?_0x73ccce+_0x2bcb8b[_0xe8ec('0x11f')](_0x46c795):_0x2bcb8b[_0xe8ec('0x11f')](0x0,_0x536dd5-_0x46c795)+_0x73ccce);}else{this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x546f05,rs[_0xe8ec('0x11c')]({'charset':'*','length':_0x536dd5}));}}else{this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x546f05,'');}}else{this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x546f05,_0x2bcb8b);}return _0x1dd4fe;};AGIVertices[_0xe8ec('0x10')]['getsecretdigits']=function(_0x584359){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x120'),_0x584359[_0xe8ec('0x3c')]));return this[_0xe8ec('0xd')](_0x584359);};AGIVertices[_0xe8ec('0x10')]['goal']=function(_0x2e2281){logger[_0xe8ec('0x30')](util['format'](_0xe8ec('0x121'),_0x2e2281['label']));this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x2e2281,_0x2e2281[_0xe8ec('0x122')]);return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util['format'](_0xe8ec('0x123'),_0x2e2281[_0xe8ec('0x122')]));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x124')]=function(_0x256395){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x125'),_0x256395[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x256395[_0xe8ec('0x8c')])||!this[_0xe8ec('0x84')](_0x256395['aws_secret_access_key'])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0x126'));}if(!this[_0xe8ec('0x84')](_0x256395['text'])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xad'));}this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x127'),_0x256395[_0xe8ec('0x7a')]));var _0x467f2a=this['awsPolly']['sync'](this,_0x256395);if(_0x467f2a){this[_0xe8ec('0x3b')]['noop'](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x467f2a));var _0x4781c1=this[_0xe8ec('0x3b')]['streamFile'](_0x467f2a);try{fs[_0xe8ec('0x107')](_0x467f2a+'.wav');}catch(_0x35726a){logger[_0xe8ec('0x2e')](_0x35726a);}return _0x4781c1;}return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x256395,_0xe8ec('0x128'));};AGIVertices[_0xe8ec('0x10')]['awslex']=function(_0x3b2b02){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x3b2b02[_0xe8ec('0x3c')]));if(!this['isConfigured'](_0x3b2b02[_0xe8ec('0x8c')])||!this[_0xe8ec('0x84')](_0x3b2b02[_0xe8ec('0x8d')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x3b2b02[_0xe8ec('0x8f')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')]('no\x20bot\x20name\x20configured');}if(!this[_0xe8ec('0x84')](_0x3b2b02[_0xe8ec('0x7a')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xad'));}this['channel'][_0xe8ec('0xe7')]=!![];this[_0xe8ec('0x3a')](_0x3b2b02);this['createSquareMessage'](_0x3b2b02[_0xe8ec('0x7a')],'in','','');this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x129'),_0x3b2b02[_0xe8ec('0x7a')]));var _0x2037a3=this[_0xe8ec('0x8b')]['sync'](this,_0x3b2b02);if(_0x2037a3){for(var _0x467de0 in _0x2037a3){if(_0x2037a3[_0xe8ec('0x96')](_0x467de0)&&_[_0xe8ec('0x97')](_0x2037a3[_0x467de0])){this['channel'][_0xe8ec('0xa0')](util[_0xe8ec('0x2b')](_0xe8ec('0x12a'),_0x467de0['toUpperCase']()),_0x2037a3[_0x467de0]);}}if(_[_0xe8ec('0x47')](_0x2037a3[_0xe8ec('0x77')])){return this[_0xe8ec('0x3b')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xe8ec('0x45')](_0x2037a3['message'],'out','amazonlex','');return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x12b'),_0x2037a3[_0xe8ec('0x77')]));}}return this[_0xe8ec('0x3b')]['error'](_0x3b2b02,_0xe8ec('0x12c'));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x12d')]=function(_0xce020c){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x12e'),_0xce020c[_0xe8ec('0x3c')],_0xce020c['timeout']));if(!this['isConfigured'](_0xce020c[_0xe8ec('0x80')])){return this[_0xe8ec('0x3b')]['noop']('no\x20key\x20configured');}var _0x4e547d=_0xe8ec('0x12f');var _0x1bba00=util[_0xe8ec('0x2b')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x4b443c=util[_0xe8ec('0x2b')](_0xe8ec('0x9f'),_0x1bba00,_0x4e547d);var _0x2ac88b=!![];if(_0xce020c[_0xe8ec('0x130')]===_0xe8ec('0x131')){_0x2ac88b=![];}var _0x4e2451=this[_0xe8ec('0x3b')][_0xe8ec('0x132')](_0x1bba00,_0x4e547d,_0xce020c[_0xe8ec('0x133')],_0xce020c[_0xe8ec('0x67')],undefined,_0x2ac88b);if(_0x4e2451[_0xe8ec('0xa5')]!==-0x1){this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util['format']('google\x20%s\x20file\x20created',_0x4b443c));var _0x45061e=this[_0xe8ec('0x90')][_0xe8ec('0xa8')](this,_0xce020c,_0x4b443c);if(_0x45061e){for(var _0x29ca90 in _0x45061e){if(_0x45061e[_0xe8ec('0x96')](_0x29ca90)){this[_0xe8ec('0x3b')]['setVariable'](util[_0xe8ec('0x2b')](_0xe8ec('0x134'),_0x29ca90['toUpperCase']()),_0x45061e[_0x29ca90]);}}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x135'),JSON['stringify'](_0x45061e)));}}return _0x4e2451;};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x136')]=function(_0x5c28a1){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x137'),_0x5c28a1[_0xe8ec('0x3c')]));if(!this['isConfigured'](_0x5c28a1[_0xe8ec('0x93')])){return this['channel'][_0xe8ec('0xac')]('no\x20appid\x20configured');}if(!this[_0xe8ec('0x84')](_0x5c28a1[_0xe8ec('0x94')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')]('no\x20appsecret\x20configured');}var _0x571899=_0xe8ec('0x12f');var _0x3de97a=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xe8ec('0x11c')](0x4));var _0x3a2c8f=util[_0xe8ec('0x2b')]('%s.%s',_0x3de97a,_0x571899);var _0x359ccf=!![];if(_0x5c28a1[_0xe8ec('0x130')]===_0xe8ec('0x131')){_0x359ccf=![];}var _0x43aac6=this[_0xe8ec('0x3b')][_0xe8ec('0x132')](_0x3de97a,_0x571899,_0x5c28a1[_0xe8ec('0x133')],_0x5c28a1[_0xe8ec('0x67')],undefined,_0x359ccf);if(_0x43aac6['result']!==-0x1){this[_0xe8ec('0x3b')]['noop'](util['format']('tilde\x20%s\x20file\x20created',_0x3a2c8f));var _0x1e78dd=this[_0xe8ec('0x92')][_0xe8ec('0xa8')](this,_0x5c28a1,_0x3a2c8f);if(_0x1e78dd){for(var _0x37e2fa in _0x1e78dd){if(_0x1e78dd[_0xe8ec('0x96')](_0x37e2fa)){this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](util['format'](_0xe8ec('0x138'),_0x37e2fa[_0xe8ec('0xf7')]()),_0x1e78dd[_0x37e2fa]);}}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x139'),JSON[_0xe8ec('0x73')](_0x1e78dd)));}}return _0x43aac6;};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x13a')]=function(_0x11f248){logger[_0xe8ec('0x30')](util['format'](_0xe8ec('0x13b'),_0x11f248['label']));return this[_0xe8ec('0x3b')][_0xe8ec('0x13c')](_0x11f248[_0xe8ec('0x40')],_0x11f248[_0xe8ec('0x13d')],_0x11f248['priority']);};AGIVertices['prototype'][_0xe8ec('0x13e')]=function(_0x38deb1){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x13f'),_0x38deb1['label']));if(!this[_0xe8ec('0x84')](_0x38deb1[_0xe8ec('0x140')])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x38deb1,_0xe8ec('0x141'));}try{var _0x1d075b=eval(_0x38deb1[_0xe8ec('0x140')])?_0xe8ec('0x142'):'false';this['channel']['noop'](util[_0xe8ec('0x2b')](_0xe8ec('0x143'),_0x38deb1[_0xe8ec('0x140')],_0x1d075b));return{'code':0xc8,'result':_0x1d075b};}catch(_0x1ba5e8){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xe8ec('0x10')]['gotoiftime']=function(_0x441523){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x144'),_0x441523[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x441523[_0xe8ec('0x145')])){return this['channel'][_0xe8ec('0x2e')](_0x441523,_0xe8ec('0x146'));}var _0x468a12=this['getIntervals']['sync'](this,_0x441523[_0xe8ec('0x145')]);if(!_0x468a12){return this['channel'][_0xe8ec('0x2e')](_0x441523,_0xe8ec('0x147'));}for(var _0x2befce=0x0;_0x2befce<_0x468a12['length'];_0x2befce+=0x1){var _0x5f2529=this['channel'][_0xe8ec('0x11')](util['format']('IFTIME(%s?true:false)',_0x468a12[_0x2befce]));if(_0x5f2529[_0xe8ec('0xa5')]===-0x1){return _0x5f2529;}logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x148'),_0x468a12[_0x2befce],_0x5f2529[_0xe8ec('0xa3')]));if(_0x5f2529[_0xe8ec('0xa3')]==='true'){logger['info'](util[_0xe8ec('0x2b')](_0xe8ec('0x148'),_0x468a12[_0x2befce],_0xe8ec('0x142')));this[_0xe8ec('0x3b')]['noop'](util[_0xe8ec('0x2b')](_0xe8ec('0x148'),_0x468a12[_0x2befce],'true'));return{'code':0xc8,'result':_0xe8ec('0x142')};}else{logger[_0xe8ec('0x30')](util['format'](_0xe8ec('0x148'),_0x468a12[_0x2befce],_0xe8ec('0x149')));this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x148'),_0x468a12[_0x2befce],_0xe8ec('0x149')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x14a')]=function(_0x5c6c11){logger['info'](util['format'](_0xe8ec('0x14b'),_0x5c6c11[_0xe8ec('0x3c')]));return this[_0xe8ec('0x3b')][_0xe8ec('0x14a')]();};AGIVertices[_0xe8ec('0x10')]['ispeechasr']=function(_0x2c612f){logger['info'](util[_0xe8ec('0x2b')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x2c612f[_0xe8ec('0x3c')]));if(!this['isConfigured'](_0x2c612f['key'])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xe6'));}var _0x18f1b4=_0xe8ec('0x12f');var _0xf56f31=util['format'](_0xe8ec('0x14c'),FILES_PATH,rs[_0xe8ec('0x11c')](0x4));var _0x1f6463=util['format'](_0xe8ec('0x9f'),_0xf56f31,_0x18f1b4);var _0x4e21e6=!![];if(_0x2c612f[_0xe8ec('0x130')]==='NOBEEP'){_0x4e21e6=![];}var _0x2b6374=this[_0xe8ec('0x3b')][_0xe8ec('0x132')](_0xf56f31,_0x18f1b4,_0x2c612f['intKey'],_0x2c612f[_0xe8ec('0x67')],undefined,_0x4e21e6);if(_0x2b6374[_0xe8ec('0xa5')]!==-0x1){this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')]('ispeech\x20%s\x20file\x20created',_0x1f6463));var _0x11dcf8=this['ispeechASR'][_0xe8ec('0xa8')](this,_0x2c612f,_0x1f6463);if(_0x11dcf8){for(var _0x1ed6a6 in _0x11dcf8){if(_0x11dcf8['hasOwnProperty'](_0x1ed6a6)){this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](util[_0xe8ec('0x2b')](_0xe8ec('0x14d'),_0x1ed6a6[_0xe8ec('0xf7')]()),_0x11dcf8[_0x1ed6a6]);}}return this['channel'][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x14e'),JSON['stringify'](_0x11dcf8)));}}return _0x2b6374;};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x14f')]=function(_0x4b8356){logger[_0xe8ec('0x30')](util['format'](_0xe8ec('0x150'),_0x4b8356[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x4b8356[_0xe8ec('0x80')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xe6'));}if(!this[_0xe8ec('0x84')](_0x4b8356[_0xe8ec('0x7a')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xad'));}this[_0xe8ec('0x3b')]['noop'](util[_0xe8ec('0x2b')](_0xe8ec('0x151'),_0x4b8356['text']));var _0x4e4436=this[_0xe8ec('0x7f')][_0xe8ec('0xa8')](this,_0x4b8356);if(_0x4e4436){this['channel'][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x152'),_0x4e4436));var _0x49efe8=this['channel'][_0xe8ec('0x153')](_0x4e4436,_0x4b8356[_0xe8ec('0x133')]);try{fs[_0xe8ec('0x107')](_0x4e4436+'.wav');}catch(_0x49a592){logger[_0xe8ec('0x2e')](_0x49a592);}return _0x49efe8;}return this['channel'][_0xe8ec('0x2e')](_0x4b8356,_0xe8ec('0x154'));};AGIVertices[_0xe8ec('0x10')]['login']=function(_0x380b1e){logger['info'](util[_0xe8ec('0x2b')](_0xe8ec('0x155'),_0x380b1e[_0xe8ec('0x3c')]));if(!this['isConfigured'](_0x380b1e['findBy'])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x380b1e,'no\x20find\x20by\x20configured');}logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x156'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x380b1e['findBy']));var _0x24302d=this['agentLogin'][_0xe8ec('0xa8')](this,_0x380b1e[_0xe8ec('0x157')]);if(_0x24302d){logger['info'](util[_0xe8ec('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x380b1e['findBy']));this['channel'][_0xe8ec('0xac')](util['format'](_0xe8ec('0x158'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x380b1e[_0xe8ec('0x157')]));return{'code':0xc8,'result':_0xe8ec('0x159')};}else{logger[_0xe8ec('0x30')](util['format'](_0xe8ec('0x15a'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x380b1e[_0xe8ec('0x157')]));this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe8ec('0x3b')]['callerid'],_0x380b1e['findBy']));return{'code':0xc8,'result':_0xe8ec('0x15b')};}};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x15c')]=function(_0x3fa3e0){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3fa3e0['label']));if(!this[_0xe8ec('0x84')](_0x3fa3e0[_0xe8ec('0x157')])){return this['channel']['error'](_0x3fa3e0,_0xe8ec('0x15d'));}logger['info'](util['format'](_0xe8ec('0x156'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x3fa3e0['findBy']));var _0x1e3f1d=this[_0xe8ec('0x54')]['sync'](this,_0x3fa3e0[_0xe8ec('0x157')]);if(_0x1e3f1d){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x158'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x3fa3e0[_0xe8ec('0x157')]));this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util['format'](_0xe8ec('0x158'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x3fa3e0['findBy']));return{'code':0xc8,'result':_0xe8ec('0x159')};}else{logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x15a'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x3fa3e0[_0xe8ec('0x157')]));this['channel'][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x15a'),this[_0xe8ec('0x3b')]['callerid'],_0x3fa3e0[_0xe8ec('0x157')]));return{'code':0xc8,'result':_0xe8ec('0x15b')};}};AGIVertices[_0xe8ec('0x10')]['math']=function(_0x4414d9){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x15e'),_0x4414d9[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x4414d9[_0xe8ec('0x15f')])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x4414d9,'no\x20operation\x20configured');}this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x160'),_0x4414d9[_0xe8ec('0x15f')]));var _0x211821=eval(_0x4414d9[_0xe8ec('0x15f')]);if(!this[_0xe8ec('0x84')](_0x4414d9[_0xe8ec('0xd6')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xd7'));}var _0x21f03a=this[_0xe8ec('0x11')][_0xe8ec('0xa8')](this,_0x4414d9[_0xe8ec('0xd6')]);if(!_0x21f03a){return this[_0xe8ec('0x3b')]['error'](_0x4414d9,'no\x20variable\x20found');}if(_['isArray'](_0x211821)){var _0x310af4=this;_0x211821[_0xe8ec('0xd8')](function(_0x1685e2,_0x36dde6){_0x310af4[_0xe8ec('0x3b')][_0xe8ec('0xa0')](util['format'](_0xe8ec('0x161'),_0x21f03a,_0x36dde6),_0x1685e2);});return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x162'),_0x21f03a));}else{return this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](_0x21f03a,_0x211821);}};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0xc')]=function(_0x31d69f){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x163'),_0x31d69f[_0xe8ec('0x3c')]));if(_0x31d69f[_0xe8ec('0xa9')]===0x0){return this[_0xe8ec('0xa7')](_0x31d69f);}_0x31d69f[_0xe8ec('0xa9')]-=0x1;if(!this[_0xe8ec('0x84')](_0x31d69f[_0xe8ec('0x115')])){return this[_0xe8ec('0x3b')]['error'](_0x31d69f,'no\x20file\x20audio\x20selected');}var _0x33fb96=this[_0xe8ec('0x20')][_0xe8ec('0xa8')](this,_0x31d69f[_0xe8ec('0x115')]);if(!_0x33fb96){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x31d69f,'no\x20file\x20audio\x20found');}var _0x45760a=this['channel'][_0xe8ec('0x164')](_0x33fb96,_0x31d69f[_0xe8ec('0x117')],_0x31d69f[_0xe8ec('0x165')]);var _0x36aa25=_0x45760a['result'];if(_0x45760a[_0xe8ec('0xa5')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x31d69f,'-1');return _0x45760a;}else if(_0x45760a[_0xe8ec('0xa3')]===_0xe8ec('0x67')){_0x45760a['result']=_0x45760a[_0xe8ec('0xa5')][_0xe8ec('0x9d')]>0x0?_0x45760a['result']:'t';}else if(_[_0xe8ec('0x4a')](_0x45760a[_0xe8ec('0xa5')])){_0x45760a[_0xe8ec('0xa5')]='#';_0x36aa25='#';}if(!this['isConfigured'](_0x31d69f[_0xe8ec('0xd6')])){this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xd7'));}else{var _0x1b78ec=this['getVariable'][_0xe8ec('0xa8')](this,_0x31d69f[_0xe8ec('0xd6')]);if(!_0x1b78ec){return this[_0xe8ec('0x3b')]['error'](_0x31d69f,_0xe8ec('0x166'));}this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](_0x1b78ec,_0x36aa25);}this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x31d69f,_0x36aa25);return _0x45760a;};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0xac')]=function(_0x163ad7){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x167'),_0x163ad7['label']));return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0x163ad7[_0xe8ec('0x168')]||_0x163ad7[_0xe8ec('0x3c')]);};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x169')]=function(_0x11e0a5){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x16a'),_0x11e0a5[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x11e0a5[_0xe8ec('0x157')])){return this['channel'][_0xe8ec('0x2e')](_0x11e0a5,_0xe8ec('0x15d'));}logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x156'),this[_0xe8ec('0x3b')]['callerid'],_0x11e0a5['findBy']));var _0x5efdc8=this[_0xe8ec('0x4f')][_0xe8ec('0xa8')](this,_0x11e0a5[_0xe8ec('0x16b')]);var _0xb44e0f=this[_0xe8ec('0x50')][_0xe8ec('0xa8')](this,_0x11e0a5[_0xe8ec('0x157')],_0x5efdc8);if(_0xb44e0f){logger[_0xe8ec('0x30')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x11e0a5[_0xe8ec('0x157')]));this[_0xe8ec('0x3b')]['noop'](util[_0xe8ec('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xe8ec('0x52')],_0x11e0a5[_0xe8ec('0x157')]));return{'code':0xc8,'result':_0xe8ec('0x159')};}else{logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x15a'),this['channel'][_0xe8ec('0x52')],_0x11e0a5[_0xe8ec('0x157')]));this[_0xe8ec('0x3b')]['noop'](util[_0xe8ec('0x2b')](_0xe8ec('0x158'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x11e0a5[_0xe8ec('0x157')]));return{'code':0xc8,'result':_0xe8ec('0x15b')};}};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x16c')]=function(_0x2e1459){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2e1459[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x2e1459[_0xe8ec('0x115')])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x2e1459,_0xe8ec('0x16d'));}var _0xe744f6=this[_0xe8ec('0x20')][_0xe8ec('0xa8')](this,_0x2e1459[_0xe8ec('0x115')]);if(!_0xe744f6){return this[_0xe8ec('0x3b')]['error'](_0x2e1459,_0xe8ec('0x116'));}var _0x28fe20=this[_0xe8ec('0x3b')][_0xe8ec('0x59')](_0xe8ec('0x16e'),[_0xe744f6,_0x2e1459[_0xe8ec('0xe4')]]);if(_0x28fe20['result']===-0x1){return _0x28fe20;}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')]('Executed\x20command\x20%s\x20%s',_0xe8ec('0x16e'),_0xe744f6));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x16f')]=function(_0x4259ee){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x170'),_0x4259ee[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x4259ee['queue_id'])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x4259ee,_0xe8ec('0x171'));}var _0x8284a5='';var _0x2b250e=parseInt(_0x4259ee[_0xe8ec('0x172')],0xa);if(isNaN(_0x2b250e)){_0x8284a5=_0x4259ee[_0xe8ec('0x172')];}else{_0x8284a5=this[_0xe8ec('0x16')]['sync'](this,_0x4259ee[_0xe8ec('0x172')]);if(!_0x8284a5){return this['channel'][_0xe8ec('0x2e')](_0x4259ee,_0xe8ec('0x173'));}}var _0x2df5d3='';if(this['isConfigured'](_0x4259ee[_0xe8ec('0x115')])){var _0x4d29c3=this[_0xe8ec('0x20')]['sync'](this,_0x4259ee[_0xe8ec('0x115')]);if(_0x4d29c3){_0x2df5d3=_0x4d29c3;}}this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x4259ee,_0x8284a5);if(_0x4259ee[_0xe8ec('0xe4')][_0xe8ec('0x174')]('x')<0x0){_0x4259ee['opts']+='x';}if(_0x4259ee[_0xe8ec('0xe4')][_0xe8ec('0x174')]('X')<0x0){_0x4259ee[_0xe8ec('0xe4')]+='X';}this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](_0xe8ec('0x175'),_0x8284a5?_0x8284a5[_0xe8ec('0x176')]():'');var _0x180969=this['channel'][_0xe8ec('0x59')](_0xe8ec('0x177'),[_0x8284a5,_0x4259ee['opts'],_0x4259ee[_0xe8ec('0x66')],_0x2df5d3,_0x4259ee[_0xe8ec('0x67')],_0x4259ee['agi'],_0x4259ee[_0xe8ec('0x178')],_0x4259ee[_0xe8ec('0x179')],'',_0x4259ee[_0xe8ec('0x17a')]]);if(_0x180969[_0xe8ec('0xa5')]===-0x1){return _0x180969;}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')]('Executed\x20command\x20%s\x20%s',_0xe8ec('0x177'),_0x8284a5));};AGIVertices['prototype'][_0xe8ec('0x17b')]=function(_0x19b428){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x17c'),_0x19b428[_0xe8ec('0x3c')]));var _0x16cbc3=_0x19b428['recordingFormat']||'wav';var _0x4a009e=util[_0xe8ec('0x2b')](_0xe8ec('0x17d'),this[_0xe8ec('0x3b')][_0xe8ec('0x3f')],rs[_0xe8ec('0x11c')](0x5));var _0x520dcd=util[_0xe8ec('0x2b')]('%s/recordings/%s.%s',FILES_PATH,_0x4a009e,_0x16cbc3);var _0x4299fb=util[_0xe8ec('0x2b')](_0xe8ec('0x14c'),FILES_PATH,_0x4a009e);this['createSquareRecording']['sync'](this,_0x19b428,_0x4a009e,_0x520dcd);this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](_0xe8ec('0x17e'),_0x4a009e);logger[_0xe8ec('0x30')](_0xe8ec('0x17f'),_0x4299fb,_0x16cbc3,_0x19b428[_0xe8ec('0x180')],_0x19b428[_0xe8ec('0x67')]);return this['channel'][_0xe8ec('0x132')](_0x4299fb,_0x16cbc3,_0x19b428[_0xe8ec('0x180')],_0x19b428['timeout'],undefined,!![]);};AGIVertices[_0xe8ec('0x10')]['restapi']=function(_0x13445e){logger['info'](util['format'](_0xe8ec('0x181'),_0x13445e['label']));if(!this[_0xe8ec('0x84')](_0x13445e[_0xe8ec('0x66')])){return this['channel']['noop']('no\x20url\x20configured');}var _0x5bf34b=this[_0xe8ec('0x182')]['sync'](this,_0x13445e);logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x183'),util[_0xe8ec('0x184')](_0x5bf34b,{'showHidden':![],'depth':null})));if(!this[_0xe8ec('0x84')](_0x13445e[_0xe8ec('0xd6')])){return this[_0xe8ec('0x3b')]['noop'](_0xe8ec('0x185'));}var _0x41f96d=this['getVariable']['sync'](this,_0x13445e[_0xe8ec('0xd6')]);if(!_0x41f96d){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x13445e,'no\x20variable\x20found');}this[_0xe8ec('0x3b')][_0xe8ec('0xa0')](util[_0xe8ec('0x2b')](_0xe8ec('0x186'),_0x41f96d),_0x5bf34b['statusCode']?_0x5bf34b['statusCode']:_0xe8ec('0x187'));this['channel']['setVariable'](util[_0xe8ec('0x2b')](_0xe8ec('0x188'),_0x41f96d),_0x5bf34b[_0xe8ec('0x76')]?_0x5bf34b[_0xe8ec('0x76')]:'OK');if(_0x5bf34b[_0xe8ec('0x6b')]){try{this[_0xe8ec('0x9e')](_0x5bf34b[_0xe8ec('0x6b')],_0x41f96d);}catch(_0x5f0dd9){logger[_0xe8ec('0x2e')](util[_0xe8ec('0x2b')](_0xe8ec('0x189'),_0x41f96d));}}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0xdc'),_0x41f96d));};AGIVertices[_0xe8ec('0x10')]['saydigits']=function(_0xd14f77){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x18a'),_0xd14f77['label']));return this['channel'][_0xe8ec('0x18b')](_0xd14f77[_0xe8ec('0x18c')][_0xe8ec('0x5b')](/\s+/g,''),_0xd14f77[_0xe8ec('0x180')]);};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x18d')]=function(_0x4e5080){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4e5080['label']));return this[_0xe8ec('0x3b')][_0xe8ec('0x18e')](_0x4e5080['number']['replace'](/\s+/g,''),_0x4e5080[_0xe8ec('0x180')]);};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x18f')]=function(_0x33d930){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x33d930[_0xe8ec('0x3c')]));return this[_0xe8ec('0x3b')][_0xe8ec('0x190')](_0x33d930[_0xe8ec('0x7a')],_0x33d930['escape_digits']);};AGIVertices[_0xe8ec('0x10')]['sendMail']=function(_0x5746f3){logger['info'](util[_0xe8ec('0x2b')](_0xe8ec('0x191'),_0x5746f3[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x5746f3['account_id'])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0x192'));}var _0x3c1b4e=this['getMailAccount'][_0xe8ec('0xa8')](this,_0x5746f3[_0xe8ec('0x193')]);if(!_0x3c1b4e||!_0x3c1b4e[_0xe8ec('0x194')]){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x5746f3,_0xe8ec('0x195'));}var _0xd5bc4d={'from':util['format']('\x22%s\x22\x20<%s>',_0x3c1b4e[_0xe8ec('0x14')],_0x3c1b4e[_0xe8ec('0x196')]||_0x3c1b4e[_0xe8ec('0x194')][_0xe8ec('0x197')]),'to':_0x5746f3['to']||'','cc':_0x5746f3['cc']||'','bcc':_0x5746f3[_0xe8ec('0x198')]||'','subject':_0x5746f3['subject'],'html':_0x5746f3[_0xe8ec('0x7a')],'text':_0x5746f3[_0xe8ec('0x7a')]};if(this[_0xe8ec('0x84')](_0x5746f3[_0xe8ec('0x199')])){}logger[_0xe8ec('0xdd')]('sendMail\x20message',JSON['stringify'](_0xd5bc4d));this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x5746f3,_0x5746f3[_0xe8ec('0x193')]);this['channel']['noop'](util[_0xe8ec('0x2b')](_0xe8ec('0x19a'),_0x3c1b4e[_0xe8ec('0x14')]));this[_0xe8ec('0x25')][_0xe8ec('0xa8')](this,_0x3c1b4e[_0xe8ec('0x19b')],_0xd5bc4d);return this['channel'][_0xe8ec('0xac')](_0xe8ec('0x19c'));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x19d')]=function(_0x440540){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x19e'),_0x440540['label']));return this['channel'][_0xe8ec('0xac')](_0xe8ec('0x19f'));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x1a0')]=function(_0x4b3a1f){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x1a1'),_0x4b3a1f[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x4b3a1f[_0xe8ec('0x1a2')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0x1a3'));}var _0x4ce426=this['getSmsAccount'][_0xe8ec('0xa8')](this,_0x4b3a1f[_0xe8ec('0x1a2')]);if(!_0x4ce426){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x4b3a1f,'no\x20sms\x20account\x20found');}var _0x30e3b9={'body':_0x4b3a1f[_0xe8ec('0x1a4')],'phone':_0x4b3a1f['to']||'','SmsAccountId':_0x4ce426['id']};logger['debug'](_0xe8ec('0x1a5'),JSON[_0xe8ec('0x73')](_0x30e3b9));this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x4b3a1f,_0x4b3a1f[_0xe8ec('0x1a2')]);this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x1a6'),_0x4ce426[_0xe8ec('0x14')]));this[_0xe8ec('0x39')]['sync'](this,_0x30e3b9);return this[_0xe8ec('0x3b')]['noop'](_0xe8ec('0x1a7'));};AGIVertices['prototype'][_0xe8ec('0x1a8')]=function(_0x5a1edf){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x1a9'),_0x5a1edf[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x5a1edf[_0xe8ec('0xd6')])){return this['channel'][_0xe8ec('0x2e')](_0x5a1edf,_0xe8ec('0x1aa'));}var _0x38b096=this[_0xe8ec('0x11')][_0xe8ec('0xa8')](this,_0x5a1edf[_0xe8ec('0xd6')]);if(!_0x38b096){return this['channel'][_0xe8ec('0x2e')](_0x5a1edf,_0xe8ec('0x166'));}return this[_0xe8ec('0x3b')]['setVariable'](_0x38b096,_0x5a1edf[_0xe8ec('0x1ab')]);};AGIVertices['prototype'][_0xe8ec('0x1ac')]=function(_0x52a0b0){logger[_0xe8ec('0x30')](util['format'](_0xe8ec('0x1ad'),_0x52a0b0['label']));this['channel'][_0xe8ec('0xac')]('START\x20CALLY\x20SQUARE');var _0x52d186=this[_0xe8ec('0x3b')][_0xe8ec('0x11')](_0xe8ec('0x1ae'));if(!_['isEmpty'](_0x52d186[_0xe8ec('0xa3')])){this[_0xe8ec('0x3b')]['uniqueid']=_0x52d186[_0xe8ec('0xa3')];}if(_0x52a0b0[_0xe8ec('0xba')]===_0xe8ec('0x1af')){this['channel']['noop'](_0xe8ec('0x1b0'));return this['channel'][_0xe8ec('0xba')]();}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')]('Skipped\x20Answer');};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x1b1')]=function(_0x22eda5){logger['info'](util[_0xe8ec('0x2b')](_0xe8ec('0x1b2'),_0x22eda5[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x22eda5['project_id'])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x22eda5,_0xe8ec('0x1b3'));}var _0x321808=this['getSquareProject'][_0xe8ec('0xa8')](this,_0x22eda5[_0xe8ec('0x1b4')]);if(!this[_0xe8ec('0x84')](_0x321808)){return this['channel'][_0xe8ec('0x2e')](_0x22eda5,util[_0xe8ec('0x2b')](_0xe8ec('0x1b5'),_0x22eda5[_0xe8ec('0x1b4')]));}if(_0x321808===this[_0xe8ec('0x3b')][_0xe8ec('0x43')]){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x22eda5,_0xe8ec('0x1b6'));}this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x22eda5,_0x321808);var _0x154adf=this[_0xe8ec('0x3b')][_0xe8ec('0x59')](_0xe8ec('0x1b7'),util[_0xe8ec('0x2b')](_0xe8ec('0x1b8'),config[_0xe8ec('0x7')][_0xe8ec('0x1b9')]||'127.0.0.1',_0x321808,this[_0xe8ec('0x3b')][_0xe8ec('0x43')]));if(_0x154adf[_0xe8ec('0xa5')]===-0x1){return _0x154adf;}return this[_0xe8ec('0x3b')]['noop'](util[_0xe8ec('0x2b')](_0xe8ec('0xc7'),_0xe8ec('0x1b7'),_0x321808));};AGIVertices['prototype'][_0xe8ec('0x1ba')]=function(_0x4c4dfe){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x1bb'),_0x4c4dfe[_0xe8ec('0x3c')]));var _0x26570f=this[_0xe8ec('0x1bc')][_0xe8ec('0xa8')](this,_0x4c4dfe['command']);this[_0xe8ec('0x3a')][_0xe8ec('0xa8')](this,_0x4c4dfe,_0x4c4dfe[_0xe8ec('0x1bd')]);if(this[_0xe8ec('0x84')](_0x4c4dfe[_0xe8ec('0xd6')])){var _0x49ec6d=this['getVariable']['sync'](this,_0x4c4dfe[_0xe8ec('0xd6')]);if(_0x49ec6d){this[_0xe8ec('0x3b')]['setVariable'](_0x49ec6d,_0x26570f);return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x1be'),_0x4c4dfe[_0xe8ec('0x1bd')],_0x49ec6d));}}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util['format'](_0xe8ec('0x1bf'),_0x4c4dfe['command']));};AGIVertices[_0xe8ec('0x10')]['google_cloud_tts']=function(_0x17a105){logger['info'](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x17a105[_0xe8ec('0x3c')]));_0x17a105[_0xe8ec('0x7a')]=_0x17a105[_0xe8ec('0x7a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe8ec('0x84')](_0x17a105[_0xe8ec('0x5d')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0x1c0'));}if(!this[_0xe8ec('0x84')](_0x17a105[_0xe8ec('0x7a')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xad'));}this['channel'][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x1c1'),_0x17a105[_0xe8ec('0x7a')]));var _0x5944da=this[_0xe8ec('0x5c')][_0xe8ec('0xa8')](this,_0x17a105);if(_0x5944da){this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x5944da));var _0x3aff8b=this[_0xe8ec('0x3b')][_0xe8ec('0x153')](_0x5944da);try{fs[_0xe8ec('0x107')](_0x5944da+_0xe8ec('0x108'));}catch(_0x5aadb4){logger[_0xe8ec('0x2e')](_0x5aadb4);}return _0x3aff8b;}return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x17a105,_0xe8ec('0x1c2'));};AGIVertices[_0xe8ec('0x10')][_0xe8ec('0x1c3')]=function(_0x5ed4fa){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x1c4'),_0x5ed4fa[_0xe8ec('0x3c')]));_0x5ed4fa[_0xe8ec('0x7a')]=_0x5ed4fa[_0xe8ec('0x7a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5ed4fa[_0xe8ec('0x7a')])){return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](_0xe8ec('0xad'));}this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x1c5'),_0x5ed4fa[_0xe8ec('0x7a')]));var _0x42b037=this['googleTTS'][_0xe8ec('0xa8')](this,_0x5ed4fa);if(_0x42b037){this['channel'][_0xe8ec('0xac')](util[_0xe8ec('0x2b')](_0xe8ec('0x1c6'),_0x42b037));var _0x562099=this[_0xe8ec('0x3b')]['streamFile'](_0x42b037);try{fs['unlink'](_0x42b037+_0xe8ec('0x108'));}catch(_0x1c2d66){logger[_0xe8ec('0x2e')](_0x1c2d66);}return _0x562099;}return this[_0xe8ec('0x3b')]['error'](_0x5ed4fa,_0xe8ec('0x1c7'));};AGIVertices[_0xe8ec('0x10')]['unpause']=function(_0x32ada6){logger[_0xe8ec('0x30')](util['format'](_0xe8ec('0x1c8'),_0x32ada6[_0xe8ec('0x3c')]));if(!this[_0xe8ec('0x84')](_0x32ada6['findBy'])){return this[_0xe8ec('0x3b')]['error'](_0x32ada6,_0xe8ec('0x15d'));}logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x156'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x32ada6[_0xe8ec('0x157')]));var _0x59b515=this[_0xe8ec('0x53')]['sync'](this,_0x32ada6[_0xe8ec('0x157')]);if(_0x59b515){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x158'),this['channel'][_0xe8ec('0x52')],_0x32ada6[_0xe8ec('0x157')]));this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util[_0xe8ec('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x32ada6[_0xe8ec('0x157')]));return{'code':0xc8,'result':'success'};}else{logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x15a'),this[_0xe8ec('0x3b')][_0xe8ec('0x52')],_0x32ada6[_0xe8ec('0x157')]));this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util['format'](_0xe8ec('0x15a'),this['channel'][_0xe8ec('0x52')],_0x32ada6[_0xe8ec('0x157')]));return{'code':0xc8,'result':_0xe8ec('0x15b')};}};AGIVertices['prototype']['voicemail']=function(_0x389abb){logger['info'](util[_0xe8ec('0x2b')](_0xe8ec('0x1c9'),_0x389abb['label']));var _0x5078ad=this[_0xe8ec('0x3b')][_0xe8ec('0x59')](_0xe8ec('0x1ca'),[_0x389abb['mailbox'],_0x389abb[_0xe8ec('0x78')]]);if(_0x5078ad[_0xe8ec('0xa5')]===-0x1){return _0x5078ad;}return this[_0xe8ec('0x3b')][_0xe8ec('0xac')](util['format'](_0xe8ec('0xc7'),_0xe8ec('0x1ca'),_0x389abb[_0xe8ec('0x1cb')]));};AGIVertices[_0xe8ec('0x10')]['vswitch']=function(_0x1ec13d){logger[_0xe8ec('0x30')](util[_0xe8ec('0x2b')](_0xe8ec('0x1cc'),_0x1ec13d[_0xe8ec('0x3c')]));if(!this['isConfigured'](_0x1ec13d[_0xe8ec('0xd6')])){return this[_0xe8ec('0x3b')][_0xe8ec('0x2e')](_0x1ec13d,_0xe8ec('0x1aa'));}var _0x46e25f=this[_0xe8ec('0x11')]['sync'](this,_0x1ec13d[_0xe8ec('0xd6')]);if(!_0x46e25f){return this[_0xe8ec('0x3b')]['error'](_0x1ec13d,'no\x20variable\x20found');}var _0x2e6831=this[_0xe8ec('0x3b')][_0xe8ec('0x11')](_0x46e25f);return{'code':0xc8,'result':_0x2e6831[_0xe8ec('0xa3')]?_0x2e6831['extra']:'-'};};String[_0xe8ec('0x10')]['replaceAll']=function(_0x9dd75d,_0x581e29){return this['split'](_0x9dd75d)[_0xe8ec('0x1cd')](_0x581e29);};module[_0xe8ec('0x1ce')]=AGIVertices; \ No newline at end of file +var _0x202c=['agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','noop','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','scheduledAt','delay','add','minutes','callback_priority','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','getUser','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','.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','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','test','mindigit','maxdigit','no\x20variable\x20found','generate','hiddendigitspos','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','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s/recordings/%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','getPause','pause_id','PLAYBACK','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','%s_STATUS_CODE','statusCode','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','then','getSquareOdbc','getSquareOdbcById','dsn','getTrunk','getTrunkById','getSound','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','callback','Callback\x20scheduled\x20at\x20','toString','getPauseById','agentPause','agent','agentUnpause'];(function(_0x1b0bcc,_0x4af3f1){var _0x497cf9=function(_0x3f8306){while(--_0x3f8306){_0x1b0bcc['push'](_0x1b0bcc['shift']());}};_0x497cf9(++_0x4af3f1);}(_0x202c,0x178));var _0xc202=function(_0xb2d091,_0x44cff2){_0xb2d091=_0xb2d091-0x0;var _0x39d1a9=_0x202c[_0xb2d091];return _0x39d1a9;};'use strict';var fs=require('fs');var util=require(_0xc202('0x0'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0xc202('0x1'))();var rs=require(_0xc202('0x2'));var moment=require(_0xc202('0x3'));var Mustache=require('mustache');var rp=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var scripts=require('./scripts');var FILES_PATH=_0xc202('0x8');var recursiveMapAttributes=[_0xc202('0x9'),'rawBody'];var verticesWithRetry=[_0xc202('0xa'),'getdigits',_0xc202('0xb')];var AGIVertices=function(_0x5978fe,_0x176cb7,_0x336fc8){this[_0xc202('0xc')]=_0x5978fe;this[_0xc202('0xd')]=_0x176cb7;this[_0xc202('0xe')]=_0x336fc8;};AGIVertices[_0xc202('0xf')][_0xc202('0x10')]=function(_0x1991a3,_0x630e57){this[_0xc202('0xd')][_0xc202('0x11')](_0x1991a3)['then'](function(_0x1523d4){_0x630e57(null,_0x1523d4?_0x1523d4[_0xc202('0x12')]:![]);})[_0xc202('0x13')](function(_0xbf3618){_0x630e57(_0xbf3618);});};AGIVertices[_0xc202('0xf')][_0xc202('0x14')]=function(_0x2c8128,_0x53600c){this[_0xc202('0xd')][_0xc202('0x15')](_0x2c8128)['then'](function(_0x4f0d94){_0x53600c(null,_0x4f0d94?_0x4f0d94['name']:![]);})[_0xc202('0x13')](function(_0x4a333c){_0x53600c(_0x4a333c);});};AGIVertices[_0xc202('0xf')]['getSquareProject']=function(_0x19af73,_0x1d580c){this[_0xc202('0xd')][_0xc202('0x16')](_0x19af73)[_0xc202('0x17')](function(_0x2419c5){_0x1d580c(null,_0x2419c5?_0x2419c5[_0xc202('0x12')]:![]);})['catch'](function(_0x16ec7c){_0x1d580c(_0x16ec7c);});};AGIVertices[_0xc202('0xf')][_0xc202('0x18')]=function(_0x5b2487,_0x504d94){this[_0xc202('0xd')][_0xc202('0x19')](_0x5b2487)[_0xc202('0x17')](function(_0x415b03){_0x504d94(null,_0x415b03?_0x415b03[_0xc202('0x1a')]:![]);})['catch'](function(_0x50a32f){_0x504d94(_0x50a32f);});};AGIVertices[_0xc202('0xf')]['getUser']=function(_0x3058d3,_0x372b31){this['rpc']['getUserById'](_0x3058d3)[_0xc202('0x17')](function(_0x582678){_0x372b31(null,_0x582678?_0x582678[_0xc202('0x12')]:![]);})[_0xc202('0x13')](function(_0x27f4cb){_0x372b31(_0x27f4cb);});};AGIVertices[_0xc202('0xf')][_0xc202('0x1b')]=function(_0x497a08,_0x59f84d){this[_0xc202('0xd')][_0xc202('0x1c')](_0x497a08)[_0xc202('0x17')](function(_0x4ff3e3){_0x59f84d(null,_0x4ff3e3?_0x4ff3e3[_0xc202('0x12')]:![]);})[_0xc202('0x13')](function(_0x541efc){_0x59f84d(_0x541efc);});};AGIVertices['prototype'][_0xc202('0x1d')]=function(_0x2f8011,_0xd88a43){var _0x6b291c=this;this[_0xc202('0xd')]['getSoundById'](_0x2f8011)[_0xc202('0x17')](function(_0x32f56c){_0xd88a43(null,_0x32f56c?_0x6b291c['getSoundPath'](_0x32f56c['save_name']):![]);})[_0xc202('0x13')](function(_0x278ef5){_0xd88a43(_0x278ef5);});};AGIVertices[_0xc202('0xf')][_0xc202('0x1e')]=function(_0x5c5423,_0x1f09cf){this[_0xc202('0xd')][_0xc202('0x1f')](_0x5c5423)['then'](function(_0x77f95a){_0x1f09cf(null,_0x77f95a?_0x77f95a:![]);})[_0xc202('0x13')](function(_0xf1fe4c){_0x1f09cf(_0xf1fe4c);});};AGIVertices[_0xc202('0xf')][_0xc202('0x20')]=function(_0x196394,_0x319945,_0x358b35){this[_0xc202('0xe')][_0xc202('0x20')](_0x196394,_0x319945)[_0xc202('0x17')](function(){_0x358b35(null);})[_0xc202('0x13')](function(_0x50c547){_0x358b35(_0x50c547);});};AGIVertices[_0xc202('0xf')][_0xc202('0x21')]=function(_0x12e11a,_0x5a59a4){this[_0xc202('0xd')]['getIntervalById'](_0x12e11a)[_0xc202('0x17')](function(_0x40a32a){if(_0x40a32a){if(_0x40a32a[_0xc202('0x22')]){_0x5a59a4(null,[_0x40a32a[_0xc202('0x23')]]);}else{_0x5a59a4(null,_[_0xc202('0x24')](_0x40a32a[_0xc202('0x25')],'interval'));}}else{_0x5a59a4(null,![]);}})[_0xc202('0x13')](function(_0x5087e3){_0x5a59a4(_0x5087e3);});};AGIVertices[_0xc202('0xf')]['getSoundPath']=function(_0x244489){return util[_0xc202('0x26')](_0xc202('0x27'),FILES_PATH,_0x244489);};AGIVertices['prototype'][_0xc202('0x28')]=function(_0x44ce00,_0x327278,_0x444a8d){odbc[_0xc202('0x29')](_0x44ce00,function(_0x2afa4e){if(_0x2afa4e){logger['error'](_0xc202('0x2a'),_0x2afa4e);_0x444a8d(_0x2afa4e);}else{logger[_0xc202('0x2b')](_0xc202('0x2c'));odbc['query'](_0x327278,function(_0x41e42b,_0x1741b7){if(_0x41e42b){logger[_0xc202('0x2b')](_0xc202('0x2d'),_0x327278);_0x444a8d(_0x41e42b);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x327278);odbc[_0xc202('0x2e')](function(_0x4caf1b){if(_0x4caf1b){logger[_0xc202('0x2f')](_0xc202('0x30'),_0x4caf1b);}_0x444a8d(null,_0x1741b7);});}});}});};AGIVertices[_0xc202('0xf')][_0xc202('0x31')]=function(_0x9dbdb,_0x126c62){this['rpc'][_0xc202('0x32')](_0x9dbdb)[_0xc202('0x17')](function(_0x3dc7c6){_0x126c62(null,_0x3dc7c6?_0x3dc7c6:![]);})[_0xc202('0x13')](function(_0x1d8a06){_0x126c62(_0x1d8a06);});};AGIVertices['prototype'][_0xc202('0x33')]=function(_0x40830d,_0x3afcbf){this[_0xc202('0xd')][_0xc202('0x33')](_0x40830d)['then'](function(_0x25d75f){_0x3afcbf(null,_0x25d75f);})['catch'](function(_0x477378){_0x3afcbf(_0x477378);});};AGIVertices['prototype'][_0xc202('0x34')]=function(_0x4393f3,_0x138a43,_0xaefd1a){this['rpc'][_0xc202('0x34')]({'uniqueid':this[_0xc202('0xc')][_0xc202('0x35')],'node':_0x4393f3[_0xc202('0x36')],'application':_0x4393f3[_0xc202('0x37')],'data':_0x138a43||null,'project_name':this[_0xc202('0xc')][_0xc202('0x38')],'callerid':this[_0xc202('0xc')][_0xc202('0x39')]})[_0xc202('0x17')](function(_0x263c95){if(_0xaefd1a){_0xaefd1a(null,_0x263c95);}})[_0xc202('0x13')](function(_0x157c2e){if(_0xaefd1a){_0xaefd1a(_0x157c2e);}});};AGIVertices[_0xc202('0xf')][_0xc202('0x3a')]=function(_0x461e2b,_0x19ba25,_0x2ab47f,_0x9f8ab3){this[_0xc202('0xd')]['createSquareRecording']({'uniqueid':this[_0xc202('0xc')][_0xc202('0x35')],'callerid':this[_0xc202('0xc')]['callerid'],'calleridname':this['channel']['calleridname'],'context':this[_0xc202('0xc')][_0xc202('0x3b')],'extension':this[_0xc202('0xc')][_0xc202('0x3c')],'priority':this[_0xc202('0xc')][_0xc202('0x3d')],'accountcode':this[_0xc202('0xc')][_0xc202('0x3e')],'dnid':this[_0xc202('0xc')][_0xc202('0x3f')],'projectName':this[_0xc202('0xc')][_0xc202('0x38')],'saveName':_0x19ba25,'filename':_0x461e2b[_0xc202('0x40')]||_0x19ba25,'savePath':_0x2ab47f})['then'](function(_0x33e70c){_0x9f8ab3(null,_0x33e70c);})[_0xc202('0x13')](function(_0x57855e){_0x9f8ab3(_0x57855e);});};AGIVertices[_0xc202('0xf')][_0xc202('0x41')]=function(_0x2864b6,_0x28f89f,_0x40f858,_0x5f5a19,_0x2250a6){this['rpc'][_0xc202('0x41')]({'uniqueid':this['channel'][_0xc202('0x35')],'body':_0x2864b6,'direction':_0x28f89f,'providerName':_0x40f858,'providerResponse':_0x5f5a19})[_0xc202('0x17')](function(_0x59cdec){if(_0x2250a6){_0x2250a6(null,_0x59cdec);}})[_0xc202('0x13')](function(_0x239cd){if(_0x2250a6){_0x2250a6(_0x239cd);}});};AGIVertices['prototype']['createCmContact']=function(_0x584b46,_0x2f063b){this['rpc'][_0xc202('0x42')]({'firstName':_[_0xc202('0x43')](_0x584b46[_0xc202('0x12')])||_[_0xc202('0x44')](_0x584b46[_0xc202('0x12')])?_0xc202('0x45')+Math[_0xc202('0x46')]():_0x584b46[_0xc202('0x12')],'lastName':_[_0xc202('0x43')](_0x584b46[_0xc202('0x47')])||_[_0xc202('0x44')](_0x584b46[_0xc202('0x47')])?null:_0x584b46[_0xc202('0x47')],'phone':_0x584b46['phone'],'ListId':_0x584b46[_0xc202('0x48')],'scheduledat':_0x584b46['scheduledAt'],'callbackUniqueid':this['channel'][_0xc202('0x35')],'tags':_0xc202('0x49'),'description':_0xc202('0x4a')+_0x584b46['scheduledAt'][_0xc202('0x4b')](),'priority':_0x584b46['callback_priority']})[_0xc202('0x17')](function(_0x19fd03){_0x2f063b(null,_0x19fd03);})['catch'](function(_0x2af59e){_0x2f063b(_0x2af59e);});};AGIVertices[_0xc202('0xf')]['getPause']=function(_0x2e1c26,_0x499e75){this[_0xc202('0xd')][_0xc202('0x4c')](_0x2e1c26)[_0xc202('0x17')](function(_0x1a06c5){_0x499e75(null,_0x1a06c5?_0x1a06c5[_0xc202('0x12')]:![]);})[_0xc202('0x13')](function(_0x15aa63){_0x499e75(_0x15aa63);});};AGIVertices['prototype'][_0xc202('0x4d')]=function(_0x3beb0a,_0x4e2e04,_0x2b3238){var _0x4860cf={'role':_0xc202('0x4e')};_0x4860cf[_0x3beb0a]=this['channel'][_0xc202('0x39')];this['rpc'][_0xc202('0x4d')](_0x4860cf,_0x4e2e04,this['channel']['uniqueid'])[_0xc202('0x17')](function(_0x1dc674){_0x2b3238(null,_[_0xc202('0x44')](_0x1dc674)?![]:!![]);})[_0xc202('0x13')](function(_0x2136c6){logger[_0xc202('0x2f')](_0x2136c6);_0x2b3238(null,![]);});};AGIVertices[_0xc202('0xf')][_0xc202('0x4f')]=function(_0x409845,_0x135797){var _0x4d9271={'role':_0xc202('0x4e')};_0x4d9271[_0x409845]=this[_0xc202('0xc')]['callerid'];this[_0xc202('0xd')][_0xc202('0x4f')](_0x4d9271)[_0xc202('0x17')](function(_0x3da9cc){_0x135797(null,_[_0xc202('0x44')](_0x3da9cc)?![]:!![]);})[_0xc202('0x13')](function(_0x18da36){logger[_0xc202('0x2f')](_0x18da36);_0x135797(null,![]);});};AGIVertices['prototype'][_0xc202('0x50')]=function(_0xde8b39,_0xb80bd){var _0x3095d2={'role':_0xc202('0x4e')};_0x3095d2[_0xde8b39]=this['channel'][_0xc202('0x39')];this[_0xc202('0xd')][_0xc202('0x50')](_0x3095d2)['then'](function(_0x7f638c){_0xb80bd(null,_['isNil'](_0x7f638c)?![]:!![]);})['catch'](function(_0x529f70){logger[_0xc202('0x2f')](_0x529f70);_0xb80bd(null,![]);});};AGIVertices[_0xc202('0xf')][_0xc202('0x51')]=function(_0xe05654,_0x5accab){var _0x33b027={'role':'agent'};_0x33b027[_0xe05654]=this[_0xc202('0xc')][_0xc202('0x39')];var _0x5bb7f8=_0xe05654!=_0xc202('0x52')?util[_0xc202('0x26')](_0xc202('0x53'),'LOCAL',this['channel']['callerid']):undefined;this[_0xc202('0xd')][_0xc202('0x51')](_0x33b027,_0x5bb7f8)['then'](function(_0x44d834){_0x5accab(null,_[_0xc202('0x44')](_0x44d834)?![]:!![]);})['catch'](function(_0x41011b){logger['error'](_0x41011b);_0x5accab(null,![]);});};AGIVertices[_0xc202('0xf')][_0xc202('0x54')]=function(_0x3ec443,_0x436c8e){sh[_0xc202('0x55')](_['trim'](_0x3ec443),function(_0x57a07f,_0x18ba97){var _0xb37022=_0x18ba97[_0xc202('0x56')](/(\r\n|\n|\r)/gm,'');_0x436c8e(null,_0xb37022);});};AGIVertices[_0xc202('0xf')][_0xc202('0x57')]=function(_0x5306a2,_0x4bb9ae){scripts[_0xc202('0x57')](_0x5306a2[_0xc202('0x58')],_0x5306a2[_0xc202('0x59')]||_0xc202('0x5a'),_0x5306a2[_0xc202('0x5a')],_0x5306a2[_0xc202('0x5b')]||'en-US',_0x5306a2['ssmlGender']||_0xc202('0x5c'),_0x5306a2[_0xc202('0x5d')]||_0xc202('0x5e'))['then'](function(_0x305a71){_0x4bb9ae(null,_0x305a71);})[_0xc202('0x13')](function(_0x4e8e14){_0x4bb9ae(_0x4e8e14);});};AGIVertices[_0xc202('0xf')][_0xc202('0x5f')]=function(_0x52e4b3,_0x2810a7){scripts[_0xc202('0x5f')](_0x52e4b3[_0xc202('0x5a')],_0x52e4b3[_0xc202('0x60')]||'en',0x1)[_0xc202('0x17')](function(_0x4fe933){_0x2810a7(null,_0x4fe933);})[_0xc202('0x13')](function(_0x5206f7){_0x2810a7(_0x5206f7);});};AGIVertices[_0xc202('0xf')][_0xc202('0x61')]=function(_0x585984,_0x2d149a){var _0x5b8a32={'uri':_0x585984[_0xc202('0x62')],'method':_0x585984[_0xc202('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x585984[_0xc202('0x64')])===_0xc202('0x65')&&parseInt(_0x585984['timeout'])>=0x1?parseInt(_0x585984[_0xc202('0x64')])*0x3e8:0x5*0x3e8};if(_[_0xc202('0x66')]([_0xc202('0x67'),_0xc202('0x68')],_0x5b8a32[_0xc202('0x63')][_0xc202('0x69')]())){try{_0x5b8a32['body']=_0x585984[_0xc202('0x6a')]?JSON[_0xc202('0x6b')](_0x585984['rawBody']):{};}catch(_0x1f7734){logger[_0xc202('0x2f')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1f7734);}}try{_0x5b8a32['headers']=_0x585984['rawHeaders']?JSON[_0xc202('0x6b')](_0x585984[_0xc202('0x9')]):{};}catch(_0x29278d){logger['error'](_0xc202('0x6c'),_0x29278d);}if(_0x585984[_0xc202('0x6d')]){try{var _0x570e36=require(_0x585984[_0xc202('0x6d')])[_0xc202('0x6e')](this,_0x5b8a32);_0x5b8a32['uri']=Mustache[_0xc202('0x6f')](_0x585984[_0xc202('0x62')],_0x570e36,{},['$$','$$']);if(_0x5b8a32[_0xc202('0x70')]){_0x5b8a32[_0xc202('0x70')]=JSON[_0xc202('0x6b')](Mustache[_0xc202('0x6f')](JSON[_0xc202('0x71')](_0x5b8a32[_0xc202('0x70')]),_0x570e36,{},['$$','$$']));}if(_0x5b8a32[_0xc202('0x72')]){_0x5b8a32[_0xc202('0x72')]=JSON[_0xc202('0x6b')](Mustache['render'](JSON[_0xc202('0x71')](_0x5b8a32[_0xc202('0x72')]),_0x570e36,{},['$$','$$']));}}catch(_0x48a098){logger[_0xc202('0x2f')](_0xc202('0x73'),_0x48a098);}}rp(_0x5b8a32)[_0xc202('0x17')](function(_0x2cf53b){var _0x3021fe={'statusCode':_0x2cf53b['statusCode']||0xc8,'statusMessage':_0x2cf53b[_0xc202('0x74')]||'OK','headers':_0x2cf53b['headers']||{},'body':_0x2cf53b[_0xc202('0x72')]||{}};_0x2d149a(null,_0x3021fe);})[_0xc202('0x13')](function(_0xc4a2df){var _0x541c76={'statusCode':_0xc4a2df['statusCode']||0x1f4,'statusMessage':_0xc4a2df[_0xc202('0x75')]||_0xc202('0x76'),'headers':_0xc4a2df[_0xc202('0x77')][_0xc202('0x70')]||{},'body':_0xc4a2df[_0xc202('0x77')][_0xc202('0x72')]||{}};_0x2d149a(null,_0x541c76);});};AGIVertices[_0xc202('0xf')][_0xc202('0x78')]=function(_0x80109,_0x1bf8b8){scripts[_0xc202('0x78')](this['channel']['uniqueid'],_0x80109[_0xc202('0x79')],_0x80109[_0xc202('0x5a')],_0x80109[_0xc202('0x7a')]||'en')[_0xc202('0x17')](function(_0x5e6e13){_0x1bf8b8(null,_0x5e6e13);})[_0xc202('0x13')](function(_0x48e6d2){_0x1bf8b8(_0x48e6d2);});};AGIVertices['prototype'][_0xc202('0x7b')]=function(_0x151976,_0x53e43a){scripts['googleDialogflowV2'](this['channel'][_0xc202('0x35')],_0x151976[_0xc202('0x7c')],_0x151976['client_email'],_0x151976[_0xc202('0x7d')],_0x151976[_0xc202('0x5a')],_0x151976[_0xc202('0x7e')]||'en')[_0xc202('0x17')](function(_0x49586b){_0x53e43a(null,_0x49586b);})[_0xc202('0x13')](function(_0x34136c){_0x53e43a(_0x34136c);});};AGIVertices[_0xc202('0xf')][_0xc202('0x7f')]=function(_0x57eb77,_0x2576e6){scripts['sestekNDA'](this['channel'],_0x57eb77)[_0xc202('0x17')](function(_0x2cfad2){_0x2576e6(null,_0x2cfad2);})[_0xc202('0x13')](function(_0x2215e4){_0x2576e6(_0x2215e4);});};AGIVertices[_0xc202('0xf')]['ispeechTTS']=function(_0x445835,_0x2d4335){scripts[_0xc202('0x80')](_0x445835['key'],_0x445835[_0xc202('0x5a')],_0x445835[_0xc202('0x81')]||_0xc202('0x82'),_0x445835['speed'])[_0xc202('0x17')](function(_0xf0b2a6){_0x2d4335(null,_0xf0b2a6);})[_0xc202('0x13')](function(_0x27fdb4){_0x2d4335(_0x27fdb4);});};AGIVertices['prototype'][_0xc202('0x83')]=function(_0x2febbe,_0x2ea4a4,_0x1ff46e){scripts['ispeechASR'](_0x2ea4a4,_0x2febbe[_0xc202('0x79')],_0x2febbe['ispeech_asr_language']||_0xc202('0x82'),this[_0xc202('0x84')](_0x2febbe[_0xc202('0x85')])?_0x2febbe['model']:undefined)[_0xc202('0x17')](function(_0xc3e1f6){_0x1ff46e(null,_0xc3e1f6);})[_0xc202('0x13')](function(_0x1f3700){_0x1ff46e(_0x1f3700);});};AGIVertices[_0xc202('0xf')][_0xc202('0x86')]=function(_0x252fd1,_0x53b135){scripts[_0xc202('0x86')](_0x252fd1[_0xc202('0x87')],_0x252fd1['aws_secret_access_key'],_0x252fd1[_0xc202('0x88')],_0x252fd1[_0xc202('0x89')]||_0xc202('0x8a'),_0x252fd1['text'],_0x252fd1[_0xc202('0x8b')]||_0xc202('0x5a'))['then'](function(_0x4a54be){_0x53b135(null,_0x4a54be);})[_0xc202('0x13')](function(_0xf3eda3){_0x53b135(_0xf3eda3);});};AGIVertices[_0xc202('0xf')][_0xc202('0x8c')]=function(_0xf2094a,_0x5d6e3a){scripts[_0xc202('0x8c')](this[_0xc202('0xc')][_0xc202('0x35')],_0xf2094a[_0xc202('0x87')],_0xf2094a[_0xc202('0x8d')],_0xf2094a[_0xc202('0x8e')],_0xf2094a['text'],_0xf2094a['aws_bot_name'])['then'](function(_0x3d7589){_0x5d6e3a(null,_0x3d7589);})[_0xc202('0x13')](function(_0x3c0488){_0x5d6e3a(_0x3c0488);});};AGIVertices[_0xc202('0xf')]['googleASR']=function(_0x4d49f1,_0x256ba7,_0x2fedab){scripts[_0xc202('0x8f')](_0x256ba7,_0x4d49f1[_0xc202('0x79')],_0x4d49f1[_0xc202('0x90')]||_0xc202('0x82'))[_0xc202('0x17')](function(_0x1633dc){_0x2fedab(null,_0x1633dc);})[_0xc202('0x13')](function(_0x449951){_0x2fedab(_0x449951);});};AGIVertices[_0xc202('0xf')][_0xc202('0x91')]=function(_0x3da638,_0x362376,_0x1f6d34){scripts[_0xc202('0x91')](_0x362376,_0x3da638[_0xc202('0x92')],_0x3da638[_0xc202('0x93')],_0x3da638[_0xc202('0x94')])[_0xc202('0x17')](function(_0x49b1ff){_0x1f6d34(null,_0x49b1ff);})[_0xc202('0x13')](function(_0x5e2627){_0x1f6d34(_0x5e2627);});};AGIVertices['prototype'][_0xc202('0x95')]=function(_0x5c22e9){var _0x50b3a6=_[_0xc202('0x66')](verticesWithRetry,_0x5c22e9[_0xc202('0x37')])?_0x5c22e9:_[_0xc202('0x96')](_0x5c22e9);for(var _0x3bbbde in _0x50b3a6){if(_0x50b3a6['hasOwnProperty'](_0x3bbbde)){if(_0x50b3a6[_0x3bbbde]&&_[_0xc202('0x97')](_0x50b3a6[_0x3bbbde])){if(_[_0xc202('0x66')](recursiveMapAttributes,_0x3bbbde)){_0x50b3a6[_0x3bbbde]=this[_0xc202('0x98')](_0x50b3a6[_0x3bbbde]);}else{_0x50b3a6[_0x3bbbde]=this[_0xc202('0x99')](_0x50b3a6[_0x3bbbde]);}}}}return _0x50b3a6;};AGIVertices[_0xc202('0xf')]['recursiveNodeIndex']=function(_0x232839){for(var _0x59bb81 in _0x232839){if(_0x232839[_0xc202('0x9a')](_0x59bb81)){if(_[_0xc202('0x9b')](_0x232839[_0x59bb81])){this[_0xc202('0x9c')](_0x232839[_0x59bb81]);}else if(_['isArray'](_0x232839[_0x59bb81])){for(var _0x4cf0fe=0x0;_0x4cf0fe<_0x232839[_0x59bb81][_0xc202('0x9d')];_0x4cf0fe++){this[_0xc202('0x9c')](_0x232839[_0x59bb81][_0x4cf0fe]);}}else if(_[_0xc202('0x97')](_0x232839[_0x59bb81])){_0x232839[_0x59bb81]=this[_0xc202('0x99')](_0x232839[_0x59bb81]);}}}};AGIVertices['prototype'][_0xc202('0x9e')]=function(_0x23e3f0,_0x593018){for(var _0x42996b in _0x23e3f0){if(_0x23e3f0[_0xc202('0x9a')](_0x42996b)){if(_[_0xc202('0x9b')](_0x23e3f0[_0x42996b])){if(!_[_0xc202('0x43')](_0x23e3f0[_0x42996b])){this[_0xc202('0x9e')](_0x23e3f0[_0x42996b],util[_0xc202('0x26')](_0xc202('0x9f'),_0x593018,_0x42996b));}}else if(_['isArray'](_0x23e3f0[_0x42996b])){for(var _0x3f388f=0x0;_0x3f388f<_0x23e3f0[_0x42996b][_0xc202('0x9d')];_0x3f388f++){this[_0xc202('0x9e')](_0x23e3f0[_0x42996b][_0x3f388f],util[_0xc202('0x26')](_0xc202('0x9f'),_0x593018,_0x42996b+'['+_0x3f388f+']'));}}else{if(!_[_0xc202('0x44')](_0x23e3f0[_0x42996b])){this['channel'][_0xc202('0xa0')](util['format']('%s.%s',_0x593018,_0x42996b),_0x23e3f0[_0x42996b]);}}}}};AGIVertices[_0xc202('0xf')]['replaceObjectAllVariables']=function(_0x41fc1b){try{var _0x11a5b9=JSON[_0xc202('0x6b')](_0x41fc1b);this[_0xc202('0x9c')](_0x11a5b9);return JSON[_0xc202('0x71')](_0x11a5b9);}catch(_0x17c92f){return this[_0xc202('0x99')](_0x41fc1b);}};AGIVertices[_0xc202('0xf')][_0xc202('0x99')]=function(_0x2a316d){var _0x1821f4=_0x2a316d['split']('{');for(var _0x75d217=0x1;_0x75d217<_0x1821f4[_0xc202('0x9d')];_0x75d217+=0x1){var _0x1aa90a=_0x1821f4[_0x75d217][_0xc202('0xa1')]('}');if(_0x1aa90a['length']>0x1){_0x2a316d=_0x2a316d[_0xc202('0xa2')]('{'+_0x1aa90a[0x0]+'}',this[_0xc202('0xc')]['getVariable'](_0x1aa90a[0x0])[_0xc202('0xa3')]||_0x1aa90a[0x0]);}}if(_0x1821f4[_0xc202('0x9d')]===0x1){return _0x2a316d[_0xc202('0x4b')]();}return this['replaceAllVariables'](_0x2a316d);};AGIVertices[_0xc202('0xf')][_0xc202('0xa4')]=function(_0x376430,_0x4a96b2){var _0x21b73b=this[_0xc202('0xc')]['getVariable'](_0x376430);if(_0x21b73b[_0xc202('0xa5')]===-0x1){return _0x21b73b;}logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0xa6'),_0x4a96b2,_0x21b73b[_0xc202('0xa3')]));return this[_0xc202('0xc')][_0xc202('0xa0')](_0x4a96b2,_0x21b73b['extra']);};AGIVertices[_0xc202('0xf')][_0xc202('0x84')]=function(_0xe9e152){return _0xe9e152&&_0xe9e152!=='0'&&_0xe9e152!=='-1'&&_0xe9e152!=='';};AGIVertices['prototype'][_0xc202('0xa7')]=function(_0x23c6e2){this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x23c6e2,'-');_0x23c6e2['retry']=_0x23c6e2['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xc202('0xa8')]=function(_0xa3293c){logger[_0xc202('0x2b')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0xa3293c['label']));if(!this['isConfigured'](_0xa3293c[_0xc202('0x5a')])){return this[_0xc202('0xc')]['noop']('no\x20text\x20configured');}var _0x368594='\x22'+_0xa3293c[_0xc202('0x5a')]+'\x22';if(this[_0xc202('0x84')](_0xa3293c[_0xc202('0x77')])){_0x368594+=','+_0xa3293c[_0xc202('0x77')];}var _0xa58f72=this[_0xc202('0xc')]['exec'](_0xc202('0xa9'),_0x368594);if(_0xa58f72[_0xc202('0xa5')]===-0x1){return _0xa58f72;}return this[_0xc202('0xc')]['noop'](util[_0xc202('0x26')](_0xc202('0xaa'),_0x368594));};AGIVertices[_0xc202('0xf')][_0xc202('0xab')]=function(_0x5281d0){logger[_0xc202('0x2b')](util['format'](_0xc202('0xac'),_0x5281d0['label']));if(!this[_0xc202('0x84')](_0x5281d0['grammar'])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xae'));}var _0xcbbc03=_0x5281d0[_0xc202('0xaf')];if(this['isConfigured'](_0x5281d0[_0xc202('0x77')])){_0xcbbc03+=','+_0x5281d0[_0xc202('0x77')];}var _0x19f464=this['channel'][_0xc202('0x55')](_0xc202('0xb0'),_0xcbbc03);if(_0x19f464[_0xc202('0xa5')]===-0x1){return _0x19f464;}var _0x1a217c=this['getAndSetVariable'](_0xc202('0xb1'),_0xc202('0xb2'));if(_0x1a217c[_0xc202('0xa5')]===-0x1){return _0x1a217c;}var _0x2fe360=this['getAndSetVariable'](_0xc202('0xb3'),'MRCP_RECOG_TRANSCRIPT');if(_0x2fe360[_0xc202('0xa5')]===-0x1){return _0x2fe360;}var _0x2149da=this[_0xc202('0xa4')](_0xc202('0xb4'),_0xc202('0xb5'));if(_0x2149da['result']===-0x1){return _0x2149da;}return this[_0xc202('0xc')][_0xc202('0xad')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0xcbbc03));};AGIVertices['prototype'][_0xc202('0x6')]=function(_0x4102b7){logger['info'](util['format'](_0xc202('0xb6'),_0x4102b7[_0xc202('0x36')]));return this[_0xc202('0xc')][_0xc202('0x6')]([_0x4102b7[_0xc202('0xb7')],_0x4102b7['args']]);};AGIVertices[_0xc202('0xf')][_0xc202('0xb8')]=function(_0xc2e3de){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0xb9'),_0xc2e3de['label']));if(this[_0xc202('0x84')](_0xc2e3de[_0xc202('0x64')])){logger['info'](util[_0xc202('0x26')](_0xc202('0xba'),_0xc2e3de['timeout']));var _0x335a41=this[_0xc202('0xc')]['wait'](_0xc2e3de['timeout']);if(_0x335a41[_0xc202('0xa5')]===-0x1){return _0x335a41;}}return this[_0xc202('0xc')][_0xc202('0xb8')]();};AGIVertices[_0xc202('0xf')][_0xc202('0x49')]=function(_0xcbe303){logger['info'](util[_0xc202('0x26')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0xcbe303['label']));if(!this['isConfigured'](_0xcbe303[_0xc202('0x48')])){return this['channel'][_0xc202('0x2f')](_0xcbe303,'no\x20list\x20selected');}_0xcbe303[_0xc202('0xbb')]=moment();if(this[_0xc202('0x84')](_0xcbe303[_0xc202('0xbc')])){_0xcbe303[_0xc202('0xbb')]=moment()[_0xc202('0xbd')](_0xcbe303[_0xc202('0xbc')],_0xc202('0xbe'));}if(!this[_0xc202('0x84')](_0xcbe303[_0xc202('0xbf')])){_0xcbe303['callback_priority']=0x2;}this[_0xc202('0x42')][_0xc202('0x6e')](this,_0xcbe303);return this[_0xc202('0xc')]['noop'](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xcbe303[_0xc202('0xc0')],_0xcbe303['list_id'],_0xcbe303[_0xc202('0xbb')]));};AGIVertices[_0xc202('0xf')][_0xc202('0xc1')]=function(_0x10b474){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0xc2'),_0x10b474[_0xc202('0x36')]));var _0x30b4de=this[_0xc202('0xc')][_0xc202('0x55')](_0x10b474[_0xc202('0xc3')],_0x10b474[_0xc202('0x77')]);if(_0x30b4de[_0xc202('0xa5')]===-0x1){return _0x30b4de;}return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0xc4'),_0x10b474[_0xc202('0xc3')],_0x10b474[_0xc202('0x77')]));};AGIVertices[_0xc202('0xf')][_0xc202('0xc5')]=function(_0x678731){logger['info'](util[_0xc202('0x26')](_0xc202('0xc6'),_0x678731[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x678731[_0xc202('0x5a')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xc7'));}var _0x2ee8bc='\x22'+_0x678731[_0xc202('0x5a')]+'\x22';if(this[_0xc202('0x84')](_0x678731[_0xc202('0x77')])){_0x2ee8bc+=','+_0x678731['options'];}var _0xa0e26b=this['channel'][_0xc202('0x55')](_0xc202('0xa9'),_0x2ee8bc);if(_0xa0e26b['result']===-0x1){return _0xa0e26b;}return this[_0xc202('0xc')]['noop'](util['format'](_0xc202('0xaa'),_0x2ee8bc));};AGIVertices[_0xc202('0xf')][_0xc202('0xc8')]=function(_0x273612){logger[_0xc202('0x2b')](util['format'](_0xc202('0xc9'),_0x273612[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x273612[_0xc202('0x5a')])){return this['channel']['noop'](_0xc202('0xc7'));}var _0x4e6ac1='\x22'+_0x273612[_0xc202('0x5a')]+'\x22';if(this[_0xc202('0x84')](_0x273612[_0xc202('0x77')])){_0x4e6ac1+=','+_0x273612[_0xc202('0x77')];}var _0x5cea72=this[_0xc202('0xc')]['exec'](_0xc202('0xa9'),_0x4e6ac1);if(_0x5cea72[_0xc202('0xa5')]===-0x1){return _0x5cea72;}return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0xaa'),_0x4e6ac1));};AGIVertices[_0xc202('0xf')][_0xc202('0xca')]=function(_0xf611a8){logger['info'](util[_0xc202('0x26')](_0xc202('0xcb'),_0xf611a8['label']));if(!this[_0xc202('0x84')](_0xf611a8[_0xc202('0xaf')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xae'));}var _0x4dd23b=_0xf611a8['grammar'];if(this['isConfigured'](_0xf611a8[_0xc202('0x77')])){_0x4dd23b+=','+_0xf611a8[_0xc202('0x77')];}var _0x2b7562=this['channel']['exec']('MRCPRecog',_0x4dd23b);if(_0x2b7562[_0xc202('0xa5')]===-0x1){return _0x2b7562;}var _0x58a010=this[_0xc202('0xa4')](_0xc202('0xb1'),_0xc202('0xcc'));if(_0x58a010[_0xc202('0xa5')]===-0x1){return _0x58a010;}var _0x5b6f04=this[_0xc202('0xa4')](_0xc202('0xb3'),_0xc202('0xcd'));if(_0x5b6f04['result']===-0x1){return _0x5b6f04;}var _0x2505a1=this[_0xc202('0xa4')](_0xc202('0xb4'),'LUMENVOX_ASR_INSTANCE');if(_0x2505a1[_0xc202('0xa5')]===-0x1){return _0x2505a1;}return this[_0xc202('0xc')]['noop'](util[_0xc202('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4dd23b));};AGIVertices[_0xc202('0xf')]['sestekasr']=function(_0x239db0){logger[_0xc202('0x2b')](util['format'](_0xc202('0xce'),_0x239db0[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x239db0['grammar'])){return this['channel'][_0xc202('0xad')](_0xc202('0xae'));}var _0x2f8a82=_0x239db0[_0xc202('0xaf')];if(this['isConfigured'](_0x239db0[_0xc202('0x77')])){_0x2f8a82+=','+_0x239db0['options'];}var _0x3fda23=this[_0xc202('0xc')][_0xc202('0x55')](_0xc202('0xb0'),_0x2f8a82);if(_0x3fda23['result']===-0x1){return _0x3fda23;}var _0x2bc6b6=this[_0xc202('0xa4')]('RECOG_CONFIDENCE()',_0xc202('0xcf'));if(_0x2bc6b6[_0xc202('0xa5')]===-0x1){return _0x2bc6b6;}var _0x19cacf=this[_0xc202('0xa4')](_0xc202('0xb3'),_0xc202('0xd0'));if(_0x19cacf[_0xc202('0xa5')]===-0x1){return _0x19cacf;}var _0x20058f=this[_0xc202('0xa4')](_0xc202('0xb4'),_0xc202('0xd1'));if(_0x20058f[_0xc202('0xa5')]===-0x1){return _0x20058f;}return this['channel'][_0xc202('0xad')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x2f8a82));};AGIVertices[_0xc202('0xf')][_0xc202('0xd2')]=function(_0x890ba6){logger[_0xc202('0x2b')](util[_0xc202('0x26')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x890ba6['label']));if(!this[_0xc202('0x84')](_0x890ba6[_0xc202('0xd3')])){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x890ba6,_0xc202('0xd4'));}var _0x18f2de=this['getSquareOdbc']['sync'](this,_0x890ba6[_0xc202('0xd3')]);if(!_0x18f2de){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x890ba6,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x890ba6[_0xc202('0xd5')])){return this[_0xc202('0xc')]['error'](_0x890ba6,_0xc202('0xd6'));}var _0x371589=_0x890ba6['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xc202('0xc')]['noop'](util['format'](_0xc202('0xd7'),_0x371589));var _0x2619ac=this[_0xc202('0x28')][_0xc202('0x6e')](this,_0x18f2de,_0x371589);this['createSquareDetailsReport']['sync'](this,_0x890ba6,_0x371589);if(!this[_0xc202('0x84')](_0x890ba6[_0xc202('0xd8')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xd9'));}var _0x59d166=this[_0xc202('0x10')][_0xc202('0x6e')](this,_0x890ba6[_0xc202('0xd8')]);if(!_0x59d166){return this['channel'][_0xc202('0x2f')](_0x890ba6,'no\x20variable\x20found');}var _0xf95d09=this;_0x2619ac[_0xc202('0xda')](function(_0x529069,_0x32184b){Object['keys'](_0x529069)[_0xc202('0xda')](function(_0xf7f4a1){_0xf95d09[_0xc202('0xc')][_0xc202('0xa0')](util['format']('%s[%s][%s]',_0x59d166,_0x32184b,_0xf7f4a1),_0x529069[_0xf7f4a1]);});});this[_0xc202('0xc')]['setVariable'](util[_0xc202('0x26')](_0xc202('0xdb'),_0x59d166),_0x2619ac[_0xc202('0x9d')]);return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0xdc'),_0x59d166));};AGIVertices[_0xc202('0xf')][_0xc202('0xdd')]=function(_0x23935f){logger[_0xc202('0xde')](util['format'](_0xc202('0xdf'),_0x23935f[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x23935f['sip_id'])){return this[_0xc202('0xc')]['error'](_0x23935f,'no\x20user\x20selected');}var _0x42b767=this[_0xc202('0xe0')][_0xc202('0x6e')](this,_0x23935f[_0xc202('0xe1')]);if(!_0x42b767){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x23935f,'no\x20user\x20found');}var _0x42789c=this[_0xc202('0xc')][_0xc202('0x55')](_0xc202('0xe2'),[util[_0xc202('0x26')](_0xc202('0xe3'),_0x42b767),_0x23935f[_0xc202('0x64')],_0x23935f[_0xc202('0xe4')],_0x23935f['url']]);if(_0x42789c[_0xc202('0xa5')]===-0x1){return _0x42789c;}return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0xe5'),_0xc202('0xe2')));};AGIVertices[_0xc202('0xf')][_0xc202('0xe6')]=function(_0x16047c){logger[_0xc202('0x2b')](util['format'](_0xc202('0xe7'),_0x16047c[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x16047c[_0xc202('0x79')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xe8'));}if(!this[_0xc202('0x84')](_0x16047c[_0xc202('0x5a')])){return this[_0xc202('0xc')]['noop'](_0xc202('0xc7'));}this[_0xc202('0xc')][_0xc202('0xe9')]=!![];this[_0xc202('0x34')](_0x16047c);this[_0xc202('0x41')](_0x16047c[_0xc202('0x5a')],'in','','');this['channel']['noop'](util[_0xc202('0x26')](_0xc202('0xea'),_0x16047c[_0xc202('0x5a')]));var _0x462685=this[_0xc202('0x78')][_0xc202('0x6e')](this,_0x16047c);if(_0x462685){for(var _0x619b3e in _0x462685){if(_0x462685[_0xc202('0x9a')](_0x619b3e)){this[_0xc202('0xc')][_0xc202('0xa0')](util[_0xc202('0x26')](_0xc202('0xeb'),_0x619b3e[_0xc202('0x69')]()),_0x462685[_0x619b3e]);}}this[_0xc202('0x41')](_0x462685['speech'],_0xc202('0xec'),_0xc202('0xe6'),'');return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0xed'),_0x462685[_0xc202('0xee')]));}return this[_0xc202('0xc')][_0xc202('0x2f')](_0x16047c,_0xc202('0xef'));};AGIVertices[_0xc202('0xf')][_0xc202('0xf0')]=function(_0xc03f8b){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0xf1'),_0xc03f8b[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0xc03f8b[_0xc202('0x7c')])){return this['channel'][_0xc202('0xad')](_0xc202('0xf2'));}if(!this[_0xc202('0x84')](_0xc03f8b['client_email'])){return this[_0xc202('0xc')]['noop'](_0xc202('0xf3'));}if(!this['isConfigured'](_0xc03f8b[_0xc202('0x7d')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xf4'));}if(!this[_0xc202('0x84')](_0xc03f8b['dialogflowV2_language'])){return this['channel']['noop'](_0xc202('0xf5'));}if(!this['isConfigured'](_0xc03f8b[_0xc202('0x5a')])){return this[_0xc202('0xc')]['noop']('no\x20text\x20configured');}this[_0xc202('0xc')][_0xc202('0xe9')]=!![];this['createSquareDetailsReport'](_0xc03f8b);this['createSquareMessage'](_0xc03f8b[_0xc202('0x5a')],'in','','');this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0xf6'),_0xc03f8b[_0xc202('0x5a')]));var _0x34f743=this[_0xc202('0x7b')][_0xc202('0x6e')](this,_0xc03f8b);if(_0x34f743){for(var _0x57f966 in _0x34f743){if(_0x34f743[_0xc202('0x9a')](_0x57f966)){if(_0x57f966!==_0xc202('0xf7')){this[_0xc202('0xc')][_0xc202('0xa0')](util[_0xc202('0x26')](_0xc202('0xeb'),_0x57f966[_0xc202('0x69')]()),_0x34f743[_0x57f966]);}}}this[_0xc202('0x41')](_0x34f743[_0xc202('0xee')],_0xc202('0xec'),'dialogflowV2',_0x34f743[_0xc202('0xf7')]);return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')]('DialogflowV2\x20Result\x20%s',_0x34f743['speech']));}return this['channel'][_0xc202('0x2f')](_0xc03f8b,_0xc202('0xf8'));};AGIVertices['prototype'][_0xc202('0xf9')]=function(_0x1fd98b){logger[_0xc202('0x2b')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x1fd98b[_0xc202('0x36')]));if(!this['isConfigured'](_0x1fd98b['ndauth_url'])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xfa'));}if(!this[_0xc202('0x84')](_0x1fd98b[_0xc202('0xfb')])){return this[_0xc202('0xc')][_0xc202('0xad')]('no\x20username\x20configured');}if(!this[_0xc202('0x84')](_0x1fd98b[_0xc202('0xfc')])){return this[_0xc202('0xc')]['noop'](_0xc202('0xfd'));}if(!this['isConfigured'](_0x1fd98b['ndassistant_url'])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xc7'));}this[_0xc202('0xc')][_0xc202('0xe9')]=!![];this[_0xc202('0x34')](_0x1fd98b);this['createSquareMessage'](_0x1fd98b[_0xc202('0x5a')],'in','','');this[_0xc202('0xc')][_0xc202('0xad')](util['format'](_0xc202('0xfe'),_0x1fd98b['text']));var _0x2401ae=this[_0xc202('0x7f')][_0xc202('0x6e')](this,_0x1fd98b);if(_0x2401ae){for(var _0xed8eae in _0x2401ae){if(_0x2401ae[_0xc202('0x9a')](_0xed8eae)){this[_0xc202('0xc')][_0xc202('0xa0')](util[_0xc202('0x26')](_0xc202('0xff'),_0xed8eae[_0xc202('0x69')]()),_0x2401ae[_0xed8eae]);}}this[_0xc202('0x41')](_0x2401ae['speech'],_0xc202('0xec'),'sesteknda','');if(_0x2401ae[_0xc202('0x100')]){this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x2401ae[_0xc202('0x100')]));var _0x4c3e9a=this[_0xc202('0xc')][_0xc202('0x101')](_0x2401ae[_0xc202('0x100')]);try{fs['unlink'](_0x2401ae[_0xc202('0x100')]+_0xc202('0x102'));}catch(_0x4a1b1a){logger['error'](_0x4a1b1a);}return _0x4c3e9a;}else{return this[_0xc202('0xc')][_0xc202('0xad')](util['format']('SestekNDA\x20Result\x20%s',_0x2401ae[_0xc202('0xee')]));}}return this[_0xc202('0xc')][_0xc202('0x2f')](_0x1fd98b,_0xc202('0x103'));};AGIVertices['prototype'][_0xc202('0x104')]=function(_0x2f5fd7){logger['info'](util['format'](_0xc202('0x105'),_0x2f5fd7[_0xc202('0x36')]));return this['channel']['noop']('end');};AGIVertices[_0xc202('0xf')][_0xc202('0x106')]=function(_0x55325b){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x107'),_0x55325b[_0xc202('0x36')]));var _0x36d2ea='';if(_0x55325b[_0xc202('0x108')]){if(!this[_0xc202('0x84')](_0x55325b[_0xc202('0x108')])){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x55325b,_0xc202('0x109'));}else{var _0x143ae9=parseInt(_0x55325b[_0xc202('0x108')],0xa);if(isNaN(_0x143ae9)){_0x36d2ea=_0x55325b[_0xc202('0x108')];}else{_0x36d2ea=this['getTrunk'][_0xc202('0x6e')](this,_0x55325b[_0xc202('0x108')]);if(!_0x36d2ea){return this['channel'][_0xc202('0x2f')](_0x55325b,_0xc202('0x10a'));}}}}else if(_0x55325b['trunk_name']){_0x36d2ea=_0x55325b[_0xc202('0x10b')];}else{return this['channel'][_0xc202('0x2f')](_0x55325b,_0xc202('0x109'));}var _0x27eff4=this[_0xc202('0xc')][_0xc202('0x55')](_0xc202('0xe2'),[util[_0xc202('0x26')](_0xc202('0x10c'),_0x36d2ea,_0x55325b[_0xc202('0xc0')]),_0x55325b[_0xc202('0x64')],_0x55325b[_0xc202('0xe4')],_0x55325b[_0xc202('0x62')]]);if(_0x27eff4[_0xc202('0xa5')]===-0x1){return _0x27eff4;}return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')]('Executed\x20command\x20%s',_0xc202('0xe2')));};AGIVertices[_0xc202('0xf')][_0xc202('0x10d')]=function(_0x5926bc){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x10e'),_0x5926bc[_0xc202('0x36')]));return this['channel'][_0xc202('0xad')]('finally');};AGIVertices[_0xc202('0xf')][_0xc202('0x10f')]=function(_0x34d347){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x110'),_0x34d347[_0xc202('0x36')]));if(_0x34d347[_0xc202('0x111')]===0x0){return this[_0xc202('0xa7')](_0x34d347);}_0x34d347['retry']-=0x1;if(!this['isConfigured'](_0x34d347[_0xc202('0x112')])){return this[_0xc202('0xc')]['error'](_0x34d347,_0xc202('0x113'));}var _0x586244=this['getSound'][_0xc202('0x6e')](this,_0x34d347[_0xc202('0x112')]);if(!_0x586244){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x34d347,_0xc202('0x114'));}if(!this['isConfigured'](_0x34d347[_0xc202('0xd8')])){return this[_0xc202('0xc')]['error'](_0xc202('0xd9'));}var _0x12b1c6=this[_0xc202('0xc')]['getData'](_0x586244,_0x34d347[_0xc202('0x115')],_0x34d347['maxdigit']);var _0x2281ed=_0x12b1c6['result']?_0x12b1c6[_0xc202('0xa5')][_0xc202('0x4b')]():'';logger[_0xc202('0x2b')](_0xc202('0x116'),JSON[_0xc202('0x71')](_0x12b1c6));if(_0x12b1c6[_0xc202('0xa5')]===-0x1){this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x34d347,_0x2281ed);return _0x12b1c6;}else if(_0x12b1c6['extra']===_0xc202('0x64')){_0x12b1c6[_0xc202('0xa5')]=_0x2281ed[_0xc202('0x9d')]>=parseInt(_0x34d347['mindigit'])?'x':'i';}else{_0x12b1c6[_0xc202('0xa5')]=_0x2281ed[_0xc202('0x9d')]>=parseInt(_0x34d347[_0xc202('0x117')])&&_0x2281ed[_0xc202('0x9d')]<=parseInt(_0x34d347[_0xc202('0x118')])?'x':'i';}var _0x6f55ae=this[_0xc202('0x10')]['sync'](this,_0x34d347[_0xc202('0xd8')]);if(!_0x6f55ae){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x34d347,_0xc202('0x119'));}this[_0xc202('0xc')][_0xc202('0xa0')](_0x6f55ae,_0x2281ed);if(this[_0xc202('0x84')](_0x34d347['hiddendigitsnum'])){var _0x30341e=parseInt(_0x34d347['hiddendigitsnum'],0xa);var _0x320c0c=rs[_0xc202('0x11a')]({'charset':'*','length':_0x30341e});var _0x2314bd=_0x2281ed[_0xc202('0x9d')];if(_0x2314bd>0x0){if(_0x2314bd>_0x30341e){this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x34d347,_0x34d347[_0xc202('0x11b')]==='first'?_0x320c0c+_0x2281ed[_0xc202('0x11c')](_0x30341e):_0x2281ed[_0xc202('0x11c')](0x0,_0x2314bd-_0x30341e)+_0x320c0c);}else{this['createSquareDetailsReport'][_0xc202('0x6e')](this,_0x34d347,rs[_0xc202('0x11a')]({'charset':'*','length':_0x2314bd}));}}else{this[_0xc202('0x34')]['sync'](this,_0x34d347,'');}}else{this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x34d347,_0x2281ed);}return _0x12b1c6;};AGIVertices[_0xc202('0xf')]['getsecretdigits']=function(_0x107dfd){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x11d'),_0x107dfd[_0xc202('0x36')]));return this[_0xc202('0x10f')](_0x107dfd);};AGIVertices['prototype'][_0xc202('0x11e')]=function(_0x390e13){logger[_0xc202('0x2b')](util['format'](_0xc202('0x11f'),_0x390e13[_0xc202('0x36')]));this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x390e13,_0x390e13[_0xc202('0x120')]);return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x121'),_0x390e13[_0xc202('0x120')]));};AGIVertices[_0xc202('0xf')][_0xc202('0x122')]=function(_0x10cb76){logger[_0xc202('0x2b')](util['format'](_0xc202('0x123'),_0x10cb76[_0xc202('0x36')]));if(!this['isConfigured'](_0x10cb76[_0xc202('0x87')])||!this['isConfigured'](_0x10cb76[_0xc202('0x8d')])){return this[_0xc202('0xc')][_0xc202('0xad')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xc202('0x84')](_0x10cb76[_0xc202('0x5a')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xc7'));}this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x124'),_0x10cb76[_0xc202('0x5a')]));var _0x21bb38=this[_0xc202('0x86')]['sync'](this,_0x10cb76);if(_0x21bb38){this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x125'),_0x21bb38));var _0x4fa995=this['channel'][_0xc202('0x101')](_0x21bb38);try{fs[_0xc202('0x126')](_0x21bb38+'.wav');}catch(_0x1cc966){logger[_0xc202('0x2f')](_0x1cc966);}return _0x4fa995;}return this['channel']['error'](_0x10cb76,_0xc202('0x127'));};AGIVertices['prototype'][_0xc202('0x128')]=function(_0x17fadb){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x129'),_0x17fadb[_0xc202('0x36')]));if(!this['isConfigured'](_0x17fadb[_0xc202('0x87')])||!this['isConfigured'](_0x17fadb[_0xc202('0x8d')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0x12a'));}if(!this[_0xc202('0x84')](_0x17fadb[_0xc202('0x12b')])){return this['channel'][_0xc202('0xad')](_0xc202('0x12c'));}if(!this['isConfigured'](_0x17fadb[_0xc202('0x5a')])){return this[_0xc202('0xc')][_0xc202('0xad')]('no\x20text\x20configured');}this['channel'][_0xc202('0xe9')]=!![];this[_0xc202('0x34')](_0x17fadb);this[_0xc202('0x41')](_0x17fadb[_0xc202('0x5a')],'in','','');this[_0xc202('0xc')]['noop'](util['format'](_0xc202('0x12d'),_0x17fadb[_0xc202('0x5a')]));var _0x2aeb83=this[_0xc202('0x8c')][_0xc202('0x6e')](this,_0x17fadb);if(_0x2aeb83){for(var _0x5d435e in _0x2aeb83){if(_0x2aeb83['hasOwnProperty'](_0x5d435e)&&_[_0xc202('0x97')](_0x2aeb83[_0x5d435e])){this['channel'][_0xc202('0xa0')](util[_0xc202('0x26')]('AWS_LEX_%s',_0x5d435e[_0xc202('0x69')]()),_0x2aeb83[_0x5d435e]);}}if(_[_0xc202('0x44')](_0x2aeb83[_0xc202('0x75')])){return this[_0xc202('0xc')]['noop'](_0xc202('0x12e'));}else{this[_0xc202('0x41')](_0x2aeb83['message'],_0xc202('0xec'),_0xc202('0x12f'),'');return this['channel'][_0xc202('0xad')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x2aeb83[_0xc202('0x75')]));}}return this['channel']['error'](_0x17fadb,_0xc202('0x130'));};AGIVertices[_0xc202('0xf')][_0xc202('0x131')]=function(_0xf1f3db){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x132'),_0xf1f3db[_0xc202('0x36')],_0xf1f3db[_0xc202('0x64')]));if(!this['isConfigured'](_0xf1f3db['key'])){return this[_0xc202('0xc')][_0xc202('0xad')]('no\x20key\x20configured');}var _0x45da3e=_0xc202('0x133');var _0x21bca1=util[_0xc202('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0xc202('0x11a')](0x4));var _0x1f1930=util[_0xc202('0x26')](_0xc202('0x9f'),_0x21bca1,_0x45da3e);var _0x23cfff=!![];if(_0xf1f3db[_0xc202('0x134')]===_0xc202('0x135')){_0x23cfff=![];}var _0x2ae67=this['channel'][_0xc202('0x136')](_0x21bca1,_0x45da3e,_0xf1f3db[_0xc202('0x137')],_0xf1f3db[_0xc202('0x64')],undefined,_0x23cfff);if(_0x2ae67['result']!==-0x1){this[_0xc202('0xc')]['noop'](util[_0xc202('0x26')](_0xc202('0x138'),_0x1f1930));var _0x153b5f=this[_0xc202('0x8f')][_0xc202('0x6e')](this,_0xf1f3db,_0x1f1930);if(_0x153b5f){for(var _0x19a462 in _0x153b5f){if(_0x153b5f['hasOwnProperty'](_0x19a462)){this[_0xc202('0xc')]['setVariable'](util[_0xc202('0x26')](_0xc202('0x139'),_0x19a462['toUpperCase']()),_0x153b5f[_0x19a462]);}}return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')]('GoogleASR\x20Result\x20%s',JSON[_0xc202('0x71')](_0x153b5f)));}}return _0x2ae67;};AGIVertices['prototype'][_0xc202('0x13a')]=function(_0x4a1f01){logger[_0xc202('0x2b')](util['format'](_0xc202('0x13b'),_0x4a1f01[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x4a1f01['appid'])){return this[_0xc202('0xc')]['noop']('no\x20appid\x20configured');}if(!this[_0xc202('0x84')](_0x4a1f01[_0xc202('0x93')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0x13c'));}var _0x502ab3=_0xc202('0x133');var _0x4ecffc=util['format'](_0xc202('0x13d'),FILES_PATH,rs[_0xc202('0x11a')](0x4));var _0x3c5501=util['format'](_0xc202('0x9f'),_0x4ecffc,_0x502ab3);var _0x2b0a83=!![];if(_0x4a1f01['beep']===_0xc202('0x135')){_0x2b0a83=![];}var _0x34b0c0=this[_0xc202('0xc')][_0xc202('0x136')](_0x4ecffc,_0x502ab3,_0x4a1f01[_0xc202('0x137')],_0x4a1f01[_0xc202('0x64')],undefined,_0x2b0a83);if(_0x34b0c0[_0xc202('0xa5')]!==-0x1){this['channel'][_0xc202('0xad')](util[_0xc202('0x26')]('tilde\x20%s\x20file\x20created',_0x3c5501));var _0x2f8959=this[_0xc202('0x91')][_0xc202('0x6e')](this,_0x4a1f01,_0x3c5501);if(_0x2f8959){for(var _0x3b1ffb in _0x2f8959){if(_0x2f8959[_0xc202('0x9a')](_0x3b1ffb)){this['channel'][_0xc202('0xa0')](util['format']('TILDE_ASR_%s',_0x3b1ffb[_0xc202('0x69')]()),_0x2f8959[_0x3b1ffb]);}}return this[_0xc202('0xc')]['noop'](util[_0xc202('0x26')](_0xc202('0x13e'),JSON[_0xc202('0x71')](_0x2f8959)));}}return _0x34b0c0;};AGIVertices[_0xc202('0xf')][_0xc202('0x13f')]=function(_0x170c56){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x140'),_0x170c56[_0xc202('0x36')]));return this['channel'][_0xc202('0x141')](_0x170c56[_0xc202('0x3b')],_0x170c56[_0xc202('0x3c')],_0x170c56[_0xc202('0x3d')]);};AGIVertices[_0xc202('0xf')][_0xc202('0x142')]=function(_0x5a437e){logger['info'](util['format'](_0xc202('0x143'),_0x5a437e['label']));if(!this['isConfigured'](_0x5a437e[_0xc202('0x144')])){return this[_0xc202('0xc')]['error'](_0x5a437e,'no\x20condition\x20configured');}try{var _0x56a3ab=eval(_0x5a437e[_0xc202('0x144')])?'true':_0xc202('0x145');this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x146'),_0x5a437e[_0xc202('0x144')],_0x56a3ab));return{'code':0xc8,'result':_0x56a3ab};}catch(_0x415998){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xc202('0xf')]['gotoiftime']=function(_0x121b79){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x147'),_0x121b79[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x121b79['interval_id'])){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x121b79,_0xc202('0x148'));}var _0x1f3e6a=this[_0xc202('0x21')][_0xc202('0x6e')](this,_0x121b79[_0xc202('0x149')]);if(!_0x1f3e6a){return this[_0xc202('0xc')]['error'](_0x121b79,_0xc202('0x14a'));}for(var _0x5e2229=0x0;_0x5e2229<_0x1f3e6a[_0xc202('0x9d')];_0x5e2229+=0x1){var _0x4ecf46=this[_0xc202('0xc')][_0xc202('0x10')](util[_0xc202('0x26')](_0xc202('0x14b'),_0x1f3e6a[_0x5e2229]));if(_0x4ecf46[_0xc202('0xa5')]===-0x1){return _0x4ecf46;}logger['info'](util[_0xc202('0x26')](_0xc202('0x14c'),_0x1f3e6a[_0x5e2229],_0x4ecf46[_0xc202('0xa3')]));if(_0x4ecf46[_0xc202('0xa3')]===_0xc202('0x14d')){logger[_0xc202('0x2b')](util[_0xc202('0x26')]('IFTIME\x20%s\x20%s',_0x1f3e6a[_0x5e2229],'true'));this['channel']['noop'](util[_0xc202('0x26')](_0xc202('0x14c'),_0x1f3e6a[_0x5e2229],_0xc202('0x14d')));return{'code':0xc8,'result':_0xc202('0x14d')};}else{logger[_0xc202('0x2b')](util[_0xc202('0x26')]('IFTIME\x20%s\x20%s',_0x1f3e6a[_0x5e2229],_0xc202('0x145')));this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')]('IFTIME\x20%s\x20%s',_0x1f3e6a[_0x5e2229],_0xc202('0x145')));}}return{'code':0xc8,'result':_0xc202('0x145')};};AGIVertices['prototype'][_0xc202('0x14e')]=function(_0x552768){logger[_0xc202('0x2b')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x552768[_0xc202('0x36')]));return this['channel']['hangup']();};AGIVertices[_0xc202('0xf')][_0xc202('0x14f')]=function(_0x1d4cb3){logger[_0xc202('0x2b')](util[_0xc202('0x26')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x1d4cb3['label']));if(!this[_0xc202('0x84')](_0x1d4cb3[_0xc202('0x79')])){return this['channel'][_0xc202('0xad')]('no\x20key\x20configured');}var _0x36a917='wav';var _0xffadce=util[_0xc202('0x26')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x7b768b=util[_0xc202('0x26')](_0xc202('0x9f'),_0xffadce,_0x36a917);var _0x2c9668=!![];if(_0x1d4cb3[_0xc202('0x134')]===_0xc202('0x135')){_0x2c9668=![];}var _0x3187ff=this['channel'][_0xc202('0x136')](_0xffadce,_0x36a917,_0x1d4cb3[_0xc202('0x137')],_0x1d4cb3['timeout'],undefined,_0x2c9668);if(_0x3187ff[_0xc202('0xa5')]!==-0x1){this[_0xc202('0xc')][_0xc202('0xad')](util['format'](_0xc202('0x150'),_0x7b768b));var _0x2aeaa6=this[_0xc202('0x83')][_0xc202('0x6e')](this,_0x1d4cb3,_0x7b768b);if(_0x2aeaa6){for(var _0x219902 in _0x2aeaa6){if(_0x2aeaa6['hasOwnProperty'](_0x219902)){this[_0xc202('0xc')]['setVariable'](util[_0xc202('0x26')](_0xc202('0x151'),_0x219902[_0xc202('0x69')]()),_0x2aeaa6[_0x219902]);}}return this['channel']['noop'](util[_0xc202('0x26')](_0xc202('0x152'),JSON[_0xc202('0x71')](_0x2aeaa6)));}}return _0x3187ff;};AGIVertices['prototype']['ispeechtts']=function(_0x1d1b81){logger['info'](util[_0xc202('0x26')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x1d1b81[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x1d1b81[_0xc202('0x79')])){return this[_0xc202('0xc')][_0xc202('0xad')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x1d1b81[_0xc202('0x5a')])){return this['channel'][_0xc202('0xad')]('no\x20text\x20configured');}this['channel'][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x153'),_0x1d1b81[_0xc202('0x5a')]));var _0x4e055a=this[_0xc202('0x80')][_0xc202('0x6e')](this,_0x1d1b81);if(_0x4e055a){this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')]('ispeech\x20%s\x20file\x20created',_0x4e055a));var _0x5e01bf=this[_0xc202('0xc')][_0xc202('0x101')](_0x4e055a,_0x1d1b81[_0xc202('0x137')]);try{fs[_0xc202('0x126')](_0x4e055a+_0xc202('0x102'));}catch(_0x56dd14){logger['error'](_0x56dd14);}return _0x5e01bf;}return this['channel']['error'](_0x1d1b81,_0xc202('0x154'));};AGIVertices[_0xc202('0xf')][_0xc202('0x155')]=function(_0x410e73){logger['info'](util[_0xc202('0x26')](_0xc202('0x156'),_0x410e73[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x410e73['findBy'])){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x410e73,_0xc202('0x157'));}logger[_0xc202('0x2b')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xc202('0xc')]['callerid'],_0x410e73[_0xc202('0x158')]));var _0x43a2de=this[_0xc202('0x51')][_0xc202('0x6e')](this,_0x410e73['findBy']);if(_0x43a2de){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x159'),this[_0xc202('0xc')][_0xc202('0x39')],_0x410e73['findBy']));this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x159'),this[_0xc202('0xc')][_0xc202('0x39')],_0x410e73[_0xc202('0x158')]));return{'code':0xc8,'result':_0xc202('0x15a')};}else{logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x15b'),this[_0xc202('0xc')][_0xc202('0x39')],_0x410e73[_0xc202('0x158')]));this['channel'][_0xc202('0xad')](util['format'](_0xc202('0x15b'),this[_0xc202('0xc')][_0xc202('0x39')],_0x410e73[_0xc202('0x158')]));return{'code':0xc8,'result':_0xc202('0x15c')};}};AGIVertices[_0xc202('0xf')][_0xc202('0x15d')]=function(_0x54152a){logger['info'](util[_0xc202('0x26')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x54152a[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x54152a['findBy'])){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x54152a,_0xc202('0x157'));}logger[_0xc202('0x2b')](util['format'](_0xc202('0x15e'),this[_0xc202('0xc')]['callerid'],_0x54152a['findBy']));var _0x4ea2e1=this[_0xc202('0x50')]['sync'](this,_0x54152a[_0xc202('0x158')]);if(_0x4ea2e1){logger['info'](util[_0xc202('0x26')](_0xc202('0x159'),this[_0xc202('0xc')][_0xc202('0x39')],_0x54152a['findBy']));this['channel'][_0xc202('0xad')](util['format'](_0xc202('0x159'),this[_0xc202('0xc')][_0xc202('0x39')],_0x54152a[_0xc202('0x158')]));return{'code':0xc8,'result':_0xc202('0x15a')};}else{logger['info'](util[_0xc202('0x26')](_0xc202('0x15b'),this[_0xc202('0xc')][_0xc202('0x39')],_0x54152a[_0xc202('0x158')]));this[_0xc202('0xc')][_0xc202('0xad')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xc202('0x39')],_0x54152a['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xc202('0xf')][_0xc202('0x15f')]=function(_0x5f0263){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x160'),_0x5f0263[_0xc202('0x36')]));if(!this['isConfigured'](_0x5f0263[_0xc202('0x161')])){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x5f0263,_0xc202('0x162'));}this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x163'),_0x5f0263[_0xc202('0x161')]));var _0x5dcf4b=eval(_0x5f0263[_0xc202('0x161')]);if(!this['isConfigured'](_0x5f0263[_0xc202('0xd8')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xd9'));}var _0x58524d=this[_0xc202('0x10')][_0xc202('0x6e')](this,_0x5f0263['variable_id']);if(!_0x58524d){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x5f0263,_0xc202('0x119'));}if(_['isArray'](_0x5dcf4b)){var _0x1e08c9=this;_0x5dcf4b[_0xc202('0xda')](function(_0x3a9829,_0x187306){_0x1e08c9[_0xc202('0xc')][_0xc202('0xa0')](util['format'](_0xc202('0x164'),_0x58524d,_0x187306),_0x3a9829);});return this['channel'][_0xc202('0xad')](util[_0xc202('0x26')]('variable\x20%s[key]\x20set',_0x58524d));}else{return this[_0xc202('0xc')][_0xc202('0xa0')](_0x58524d,_0x5dcf4b);}};AGIVertices[_0xc202('0xf')][_0xc202('0xa')]=function(_0x447efc){logger[_0xc202('0x2b')](util[_0xc202('0x26')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x447efc[_0xc202('0x36')]));if(_0x447efc[_0xc202('0x111')]===0x0){return this[_0xc202('0xa7')](_0x447efc);}_0x447efc[_0xc202('0x111')]-=0x1;if(!this[_0xc202('0x84')](_0x447efc[_0xc202('0x112')])){return this['channel'][_0xc202('0x2f')](_0x447efc,'no\x20file\x20audio\x20selected');}var _0x111386=this['getSound'][_0xc202('0x6e')](this,_0x447efc[_0xc202('0x112')]);if(!_0x111386){return this['channel'][_0xc202('0x2f')](_0x447efc,_0xc202('0x114'));}var _0x50a57c=this['channel'][_0xc202('0x165')](_0x111386,_0x447efc[_0xc202('0x115')],_0x447efc[_0xc202('0x166')]);var _0x462300=_0x50a57c[_0xc202('0xa5')];if(_0x50a57c[_0xc202('0xa5')]===-0x1){this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x447efc,'-1');return _0x50a57c;}else if(_0x50a57c[_0xc202('0xa3')]===_0xc202('0x64')){_0x50a57c[_0xc202('0xa5')]=_0x50a57c[_0xc202('0xa5')][_0xc202('0x9d')]>0x0?_0x50a57c['result']:'t';}else if(_[_0xc202('0x43')](_0x50a57c[_0xc202('0xa5')])){_0x50a57c[_0xc202('0xa5')]='#';_0x462300='#';}if(!this[_0xc202('0x84')](_0x447efc['variable_id'])){this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xd9'));}else{var _0x45dd27=this[_0xc202('0x10')]['sync'](this,_0x447efc['variable_id']);if(!_0x45dd27){return this['channel']['error'](_0x447efc,'no\x20variable\x20found');}this[_0xc202('0xc')][_0xc202('0xa0')](_0x45dd27,_0x462300);}this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x447efc,_0x462300);return _0x50a57c;};AGIVertices['prototype']['noop']=function(_0x5eaf4d){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x167'),_0x5eaf4d['label']));return this['channel'][_0xc202('0xad')](_0x5eaf4d['output']||_0x5eaf4d[_0xc202('0x36')]);};AGIVertices[_0xc202('0xf')][_0xc202('0x168')]=function(_0x391be6){logger[_0xc202('0x2b')](util[_0xc202('0x26')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x391be6['label']));if(!this[_0xc202('0x84')](_0x391be6[_0xc202('0x158')])){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x391be6,_0xc202('0x157'));}logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x15e'),this['channel']['callerid'],_0x391be6[_0xc202('0x158')]));var _0x289d50=this[_0xc202('0x169')][_0xc202('0x6e')](this,_0x391be6[_0xc202('0x16a')]);var _0x1e62bf=this['agentPause'][_0xc202('0x6e')](this,_0x391be6[_0xc202('0x158')],_0x289d50);if(_0x1e62bf){logger[_0xc202('0x2b')](util[_0xc202('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc202('0xc')][_0xc202('0x39')],_0x391be6[_0xc202('0x158')]));this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x159'),this[_0xc202('0xc')][_0xc202('0x39')],_0x391be6[_0xc202('0x158')]));return{'code':0xc8,'result':_0xc202('0x15a')};}else{logger[_0xc202('0x2b')](util[_0xc202('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc202('0xc')][_0xc202('0x39')],_0x391be6[_0xc202('0x158')]));this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x159'),this[_0xc202('0xc')][_0xc202('0x39')],_0x391be6['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['playback']=function(_0x197871){logger[_0xc202('0x2b')](util[_0xc202('0x26')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x197871['label']));if(!this[_0xc202('0x84')](_0x197871[_0xc202('0x112')])){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x197871,_0xc202('0x113'));}var _0x380004=this[_0xc202('0x1d')][_0xc202('0x6e')](this,_0x197871[_0xc202('0x112')]);if(!_0x380004){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x197871,'no\x20file\x20audio\x20found');}var _0x4de228=this['channel'][_0xc202('0x55')]('PLAYBACK',[_0x380004,_0x197871[_0xc202('0xe4')]]);if(_0x4de228[_0xc202('0xa5')]===-0x1){return _0x4de228;}return this[_0xc202('0xc')]['noop'](util[_0xc202('0x26')](_0xc202('0xc4'),_0xc202('0x16b'),_0x380004));};AGIVertices[_0xc202('0xf')]['queue']=function(_0x16bc08){logger['info'](util[_0xc202('0x26')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x16bc08[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x16bc08['queue_id'])){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x16bc08,_0xc202('0x16c'));}var _0x3d35c8='';var _0x120d03=parseInt(_0x16bc08[_0xc202('0x16d')],0xa);if(isNaN(_0x120d03)){_0x3d35c8=_0x16bc08['queue_id'];}else{_0x3d35c8=this[_0xc202('0x14')][_0xc202('0x6e')](this,_0x16bc08[_0xc202('0x16d')]);if(!_0x3d35c8){return this[_0xc202('0xc')]['error'](_0x16bc08,'no\x20queue\x20found');}}var _0x57dd3b='';if(this[_0xc202('0x84')](_0x16bc08[_0xc202('0x112')])){var _0x1c7f8c=this[_0xc202('0x1d')][_0xc202('0x6e')](this,_0x16bc08[_0xc202('0x112')]);if(_0x1c7f8c){_0x57dd3b=_0x1c7f8c;}}this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x16bc08,_0x3d35c8);if(_0x16bc08['opts'][_0xc202('0x16e')]('x')<0x0){_0x16bc08[_0xc202('0xe4')]+='x';}if(_0x16bc08[_0xc202('0xe4')][_0xc202('0x16e')]('X')<0x0){_0x16bc08['opts']+='X';}this[_0xc202('0xc')][_0xc202('0xa0')](_0xc202('0x16f'),_0x3d35c8?_0x3d35c8[_0xc202('0x170')]():'');var _0x2076e6=this[_0xc202('0xc')][_0xc202('0x55')](_0xc202('0x171'),[_0x3d35c8,_0x16bc08[_0xc202('0xe4')],_0x16bc08[_0xc202('0x62')],_0x57dd3b,_0x16bc08[_0xc202('0x64')],_0x16bc08[_0xc202('0x6')],_0x16bc08[_0xc202('0x172')],_0x16bc08['gosub'],'',_0x16bc08[_0xc202('0x173')]]);if(_0x2076e6[_0xc202('0xa5')]===-0x1){return _0x2076e6;}return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0xc4'),_0xc202('0x171'),_0x3d35c8));};AGIVertices['prototype'][_0xc202('0x174')]=function(_0x4979f9){logger['info'](util[_0xc202('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4979f9['label']));var _0x4e0529=_0x4979f9[_0xc202('0x175')]||_0xc202('0x133');var _0x4acebd=util['format'](_0xc202('0x176'),this[_0xc202('0xc')][_0xc202('0x35')],rs[_0xc202('0x11a')](0x5));var _0x4c99f2=util['format'](_0xc202('0x177'),FILES_PATH,_0x4acebd,_0x4e0529);var _0x5bf8b0=util[_0xc202('0x26')](_0xc202('0x13d'),FILES_PATH,_0x4acebd);this[_0xc202('0x3a')][_0xc202('0x6e')](this,_0x4979f9,_0x4acebd,_0x4c99f2);this[_0xc202('0xc')][_0xc202('0xa0')](_0xc202('0x178'),_0x4acebd);logger['info'](_0xc202('0x179'),_0x5bf8b0,_0x4e0529,_0x4979f9[_0xc202('0x17a')],_0x4979f9[_0xc202('0x64')]);return this['channel'][_0xc202('0x136')](_0x5bf8b0,_0x4e0529,_0x4979f9[_0xc202('0x17a')],_0x4979f9[_0xc202('0x64')],undefined,!![]);};AGIVertices[_0xc202('0xf')][_0xc202('0x17b')]=function(_0xbd6a30){logger['info'](util[_0xc202('0x26')](_0xc202('0x17c'),_0xbd6a30['label']));if(!this['isConfigured'](_0xbd6a30[_0xc202('0x62')])){return this[_0xc202('0xc')][_0xc202('0xad')]('no\x20url\x20configured');}var _0xcc8f77=this[_0xc202('0x61')][_0xc202('0x6e')](this,_0xbd6a30);logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x17d'),util['inspect'](_0xcc8f77,{'showHidden':![],'depth':null})));if(!this[_0xc202('0x84')](_0xbd6a30[_0xc202('0xd8')])){return this[_0xc202('0xc')][_0xc202('0xad')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x51728c=this[_0xc202('0x10')][_0xc202('0x6e')](this,_0xbd6a30[_0xc202('0xd8')]);if(!_0x51728c){return this[_0xc202('0xc')][_0xc202('0x2f')](_0xbd6a30,'no\x20variable\x20found');}this['channel'][_0xc202('0xa0')](util[_0xc202('0x26')](_0xc202('0x17e'),_0x51728c),_0xcc8f77[_0xc202('0x17f')]?_0xcc8f77[_0xc202('0x17f')]:_0xc202('0x180'));this['channel'][_0xc202('0xa0')](util[_0xc202('0x26')]('%s_STATUS_MESSAGE',_0x51728c),_0xcc8f77['statusMessage']?_0xcc8f77['statusMessage']:'OK');if(_0xcc8f77[_0xc202('0x72')]){try{this[_0xc202('0x9e')](_0xcc8f77[_0xc202('0x72')],_0x51728c);}catch(_0x75fbfb){logger['error'](util[_0xc202('0x26')](_0xc202('0x181'),_0x51728c));}}return this[_0xc202('0xc')][_0xc202('0xad')](util['format'](_0xc202('0xdc'),_0x51728c));};AGIVertices[_0xc202('0xf')][_0xc202('0x182')]=function(_0x13412a){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x183'),_0x13412a[_0xc202('0x36')]));return this[_0xc202('0xc')][_0xc202('0x184')](_0x13412a['digits'][_0xc202('0x56')](/\s+/g,''),_0x13412a['escape_digits']);};AGIVertices[_0xc202('0xf')]['saynumber']=function(_0x1c7542){logger['info'](util[_0xc202('0x26')](_0xc202('0x185'),_0x1c7542[_0xc202('0x36')]));return this[_0xc202('0xc')]['sayNumber'](_0x1c7542[_0xc202('0x65')][_0xc202('0x56')](/\s+/g,''),_0x1c7542[_0xc202('0x17a')]);};AGIVertices[_0xc202('0xf')][_0xc202('0x186')]=function(_0x5283f1){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x187'),_0x5283f1[_0xc202('0x36')]));return this[_0xc202('0xc')][_0xc202('0x188')](_0x5283f1[_0xc202('0x5a')],_0x5283f1[_0xc202('0x17a')]);};AGIVertices[_0xc202('0xf')][_0xc202('0x189')]=function(_0x1078d4){logger[_0xc202('0x2b')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x1078d4['label']));if(!this['isConfigured'](_0x1078d4[_0xc202('0x18a')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0x18b'));}var _0x2b75f6=this[_0xc202('0x1e')][_0xc202('0x6e')](this,_0x1078d4[_0xc202('0x18a')]);if(!_0x2b75f6||!_0x2b75f6[_0xc202('0x18c')]){return this[_0xc202('0xc')]['error'](_0x1078d4,'no\x20mail\x20account\x20found');}var _0x56c86c={'from':util[_0xc202('0x26')](_0xc202('0x18d'),_0x2b75f6['name'],_0x2b75f6[_0xc202('0x18e')]||_0x2b75f6[_0xc202('0x18c')][_0xc202('0x18f')]),'to':_0x1078d4['to']||'','cc':_0x1078d4['cc']||'','bcc':_0x1078d4['bcc']||'','subject':_0x1078d4[_0xc202('0x190')],'html':_0x1078d4[_0xc202('0x5a')],'text':_0x1078d4[_0xc202('0x5a')]};if(this[_0xc202('0x84')](_0x1078d4[_0xc202('0x191')])){}logger[_0xc202('0xde')](_0xc202('0x192'),JSON[_0xc202('0x71')](_0x56c86c));this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x1078d4,_0x1078d4[_0xc202('0x18a')]);this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x193'),_0x2b75f6[_0xc202('0x12')]));this['sendMailMessage'][_0xc202('0x6e')](this,_0x2b75f6[_0xc202('0x194')],_0x56c86c);return this[_0xc202('0xc')]['noop'](_0xc202('0x195'));};AGIVertices[_0xc202('0xf')][_0xc202('0x196')]=function(_0x454af2){logger['info'](util[_0xc202('0x26')](_0xc202('0x197'),_0x454af2[_0xc202('0x36')]));return this['channel'][_0xc202('0xad')](_0xc202('0x198'));};AGIVertices[_0xc202('0xf')]['sendSMS']=function(_0xfdbafc){logger['info'](util['format'](_0xc202('0x199'),_0xfdbafc[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0xfdbafc[_0xc202('0x19a')])){return this[_0xc202('0xc')]['noop'](_0xc202('0x19b'));}var _0x1d3b3f=this[_0xc202('0x31')][_0xc202('0x6e')](this,_0xfdbafc['sms_account_id']);if(!_0x1d3b3f){return this[_0xc202('0xc')][_0xc202('0x2f')](_0xfdbafc,'no\x20sms\x20account\x20found');}var _0x3f71a3={'body':_0xfdbafc['sms_text'],'phone':_0xfdbafc['to']||'','SmsAccountId':_0x1d3b3f['id']};logger['debug'](_0xc202('0x19c'),JSON[_0xc202('0x71')](_0x3f71a3));this[_0xc202('0x34')][_0xc202('0x6e')](this,_0xfdbafc,_0xfdbafc[_0xc202('0x19a')]);this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x19d'),_0x1d3b3f[_0xc202('0x12')]));this[_0xc202('0x33')][_0xc202('0x6e')](this,_0x3f71a3);return this[_0xc202('0xc')]['noop'](_0xc202('0x19e'));};AGIVertices[_0xc202('0xf')][_0xc202('0x19f')]=function(_0x2cf60a){logger['info'](util[_0xc202('0x26')](_0xc202('0x1a0'),_0x2cf60a[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x2cf60a[_0xc202('0xd8')])){return this['channel'][_0xc202('0x2f')](_0x2cf60a,_0xc202('0x1a1'));}var _0x47114c=this['getVariable']['sync'](this,_0x2cf60a[_0xc202('0xd8')]);if(!_0x47114c){return this[_0xc202('0xc')][_0xc202('0x2f')](_0x2cf60a,_0xc202('0x119'));}return this[_0xc202('0xc')][_0xc202('0xa0')](_0x47114c,_0x2cf60a[_0xc202('0x1a2')]);};AGIVertices[_0xc202('0xf')][_0xc202('0x1a3')]=function(_0x4be5ec){logger[_0xc202('0x2b')](util['format'](_0xc202('0x1a4'),_0x4be5ec[_0xc202('0x36')]));this[_0xc202('0xc')][_0xc202('0xad')]('START\x20CALLY\x20SQUARE');var _0x24e237=this[_0xc202('0xc')][_0xc202('0x10')](_0xc202('0x1a5'));if(!_[_0xc202('0x43')](_0x24e237[_0xc202('0xa3')])){this[_0xc202('0xc')]['uniqueid']=_0x24e237[_0xc202('0xa3')];}if(_0x4be5ec[_0xc202('0xb8')]===_0xc202('0x1a6')){this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0x1a7'));return this['channel']['answer']();}return this['channel'][_0xc202('0xad')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xc202('0x1a8')]=function(_0x50dd62){logger[_0xc202('0x2b')](util['format'](_0xc202('0x1a9'),_0x50dd62[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x50dd62[_0xc202('0x1aa')])){return this[_0xc202('0xc')]['error'](_0x50dd62,_0xc202('0x1ab'));}var _0x30f5d4=this[_0xc202('0x1ac')][_0xc202('0x6e')](this,_0x50dd62[_0xc202('0x1aa')]);if(!this[_0xc202('0x84')](_0x30f5d4)){return this['channel']['error'](_0x50dd62,util['format'](_0xc202('0x1ad'),_0x50dd62[_0xc202('0x1aa')]));}if(_0x30f5d4===this[_0xc202('0xc')]['arg_1']){return this['channel'][_0xc202('0x2f')](_0x50dd62,_0xc202('0x1ae'));}this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x50dd62,_0x30f5d4);var _0x1c0496=this[_0xc202('0xc')]['exec']('AGI',util[_0xc202('0x26')](_0xc202('0x1af'),config[_0xc202('0x6')][_0xc202('0x1b0')]||_0xc202('0x1b1'),_0x30f5d4,this['channel'][_0xc202('0x38')]));if(_0x1c0496[_0xc202('0xa5')]===-0x1){return _0x1c0496;}return this[_0xc202('0xc')]['noop'](util[_0xc202('0x26')](_0xc202('0xc4'),'AGI',_0x30f5d4));};AGIVertices[_0xc202('0xf')][_0xc202('0x1b2')]=function(_0x4e6912){logger[_0xc202('0x2b')](util[_0xc202('0x26')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x4e6912['label']));var _0x437a73=this[_0xc202('0x54')][_0xc202('0x6e')](this,_0x4e6912['command']);this[_0xc202('0x34')][_0xc202('0x6e')](this,_0x4e6912,_0x4e6912['command']);if(this[_0xc202('0x84')](_0x4e6912[_0xc202('0xd8')])){var _0x374a84=this[_0xc202('0x10')]['sync'](this,_0x4e6912[_0xc202('0xd8')]);if(_0x374a84){this['channel'][_0xc202('0xa0')](_0x374a84,_0x437a73);return this[_0xc202('0xc')][_0xc202('0xad')](util['format'](_0xc202('0x1b3'),_0x4e6912[_0xc202('0xb7')],_0x374a84));}}return this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x1b4'),_0x4e6912['command']));};AGIVertices[_0xc202('0xf')][_0xc202('0x1b5')]=function(_0x86cb78){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x1b6'),_0x86cb78[_0xc202('0x36')]));_0x86cb78['text']=_0x86cb78[_0xc202('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc202('0x84')](_0x86cb78[_0xc202('0x58')])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0x1b7'));}if(!this['isConfigured'](_0x86cb78['text'])){return this[_0xc202('0xc')]['noop'](_0xc202('0xc7'));}this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x1b8'),_0x86cb78['text']));var _0x3ba813=this[_0xc202('0x57')][_0xc202('0x6e')](this,_0x86cb78);if(_0x3ba813){this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x1b9'),_0x3ba813));var _0x3066f0=this[_0xc202('0xc')][_0xc202('0x101')](_0x3ba813);try{fs['unlink'](_0x3ba813+_0xc202('0x102'));}catch(_0x4125d7){logger[_0xc202('0x2f')](_0x4125d7);}return _0x3066f0;}return this[_0xc202('0xc')][_0xc202('0x2f')](_0x86cb78,_0xc202('0x1ba'));};AGIVertices[_0xc202('0xf')][_0xc202('0x1bb')]=function(_0x3bc32a){logger['info'](util[_0xc202('0x26')](_0xc202('0x1bc'),_0x3bc32a[_0xc202('0x36')]));_0x3bc32a['text']=_0x3bc32a[_0xc202('0x5a')][_0xc202('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc202('0x84')](_0x3bc32a['text'])){return this[_0xc202('0xc')][_0xc202('0xad')](_0xc202('0xc7'));}this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x1bd'),_0x3bc32a['text']));var _0x19912d=this['googleTTS'][_0xc202('0x6e')](this,_0x3bc32a);if(_0x19912d){this[_0xc202('0xc')][_0xc202('0xad')](util['format'](_0xc202('0x1be'),_0x19912d));var _0x582e09=this[_0xc202('0xc')][_0xc202('0x101')](_0x19912d);try{fs['unlink'](_0x19912d+_0xc202('0x102'));}catch(_0x367f34){logger[_0xc202('0x2f')](_0x367f34);}return _0x582e09;}return this[_0xc202('0xc')][_0xc202('0x2f')](_0x3bc32a,_0xc202('0x1bf'));};AGIVertices[_0xc202('0xf')][_0xc202('0x1c0')]=function(_0xbdd258){logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x1c1'),_0xbdd258[_0xc202('0x36')]));if(!this['isConfigured'](_0xbdd258[_0xc202('0x158')])){return this['channel']['error'](_0xbdd258,'no\x20find\x20by\x20configured');}logger[_0xc202('0x2b')](util[_0xc202('0x26')](_0xc202('0x15e'),this['channel'][_0xc202('0x39')],_0xbdd258[_0xc202('0x158')]));var _0x4288df=this['agentUnpause'][_0xc202('0x6e')](this,_0xbdd258[_0xc202('0x158')]);if(_0x4288df){logger[_0xc202('0x2b')](util[_0xc202('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc202('0xc')][_0xc202('0x39')],_0xbdd258['findBy']));this['channel'][_0xc202('0xad')](util['format'](_0xc202('0x159'),this['channel'][_0xc202('0x39')],_0xbdd258['findBy']));return{'code':0xc8,'result':_0xc202('0x15a')};}else{logger['info'](util[_0xc202('0x26')](_0xc202('0x15b'),this['channel'][_0xc202('0x39')],_0xbdd258['findBy']));this[_0xc202('0xc')][_0xc202('0xad')](util[_0xc202('0x26')](_0xc202('0x15b'),this[_0xc202('0xc')][_0xc202('0x39')],_0xbdd258[_0xc202('0x158')]));return{'code':0xc8,'result':_0xc202('0x15c')};}};AGIVertices['prototype'][_0xc202('0x1c2')]=function(_0x413aa1){logger['info'](util[_0xc202('0x26')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x413aa1[_0xc202('0x36')]));var _0x20e41e=this['channel'][_0xc202('0x55')]('VOICEMAIL',[_0x413aa1[_0xc202('0x1c3')],_0x413aa1[_0xc202('0x77')]]);if(_0x20e41e[_0xc202('0xa5')]===-0x1){return _0x20e41e;}return this[_0xc202('0xc')]['noop'](util['format'](_0xc202('0xc4'),_0xc202('0x1c4'),_0x413aa1[_0xc202('0x1c3')]));};AGIVertices[_0xc202('0xf')][_0xc202('0x1c5')]=function(_0x2260ea){logger['info'](util[_0xc202('0x26')](_0xc202('0x1c6'),_0x2260ea[_0xc202('0x36')]));if(!this[_0xc202('0x84')](_0x2260ea[_0xc202('0xd8')])){return this['channel'][_0xc202('0x2f')](_0x2260ea,'no\x20variable\x20selected');}var _0x220824=this[_0xc202('0x10')][_0xc202('0x6e')](this,_0x2260ea[_0xc202('0xd8')]);if(!_0x220824){return this[_0xc202('0xc')]['error'](_0x2260ea,_0xc202('0x119'));}var _0x472a5a=this[_0xc202('0xc')][_0xc202('0x10')](_0x220824);return{'code':0xc8,'result':_0x472a5a[_0xc202('0xa3')]?_0x472a5a[_0xc202('0xa3')]:'-'};};String[_0xc202('0xf')]['replaceAll']=function(_0x116abd,_0x186a39){return this[_0xc202('0xa1')](_0x116abd)[_0xc202('0x1c7')](_0x186a39);};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 f7b27b1..47b4ce9 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 _0xd488=['agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','timer','update','uniqueid','then','info','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','catch','message','[%s][TIMER][STOP][AGENT:%s]','ACW','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0xd488,0x10b));var _0x8d48=function(_0x5e0e90,_0x1c8363){_0x5e0e90=_0x5e0e90-0x0;var _0x33cfe3=_0xd488[_0x5e0e90];return _0x33cfe3;};'use strict';var _=require(_0x8d48('0x0'));var moment=require(_0x8d48('0x1'));var ami=require(_0x8d48('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x8d48('0x3'));var RpcVoiceAgentReport=require(_0x8d48('0x4'));function Acw(_0x31eea9){this[_0x8d48('0x5')]=_0x31eea9[_0x8d48('0x5')];this[_0x8d48('0x6')]=_0x31eea9['agents'];this[_0x8d48('0x7')]=_0x31eea9['timers'];this[_0x8d48('0x8')]={};ami['on'](_0x8d48('0x9'),this[_0x8d48('0xa')][_0x8d48('0xb')](this));ami['on'](_0x8d48('0xc'),this[_0x8d48('0xd')][_0x8d48('0xb')](this));ami['on'](_0x8d48('0xe'),this[_0x8d48('0xf')][_0x8d48('0xb')](this));ami['on']('agentringnoanswer',this[_0x8d48('0x10')][_0x8d48('0xb')](this));ami['on'](_0x8d48('0x11'),this[_0x8d48('0x12')]['bind'](this));ami['on']('blindtransfer',this[_0x8d48('0x13')][_0x8d48('0xb')](this));ami['on'](_0x8d48('0x14'),this[_0x8d48('0x15')][_0x8d48('0xb')](this));}function getDiff(_0x2f5766){var _0x434b2f=moment()['milliseconds'](0x0);var _0x450768=moment(_0x2f5766)[_0x8d48('0x16')](0x0);return _0x434b2f[_0x8d48('0x17')](_0x450768,_0x8d48('0x18'));}Acw[_0x8d48('0x19')]['updateAcw']=function(_0x4f443f,_0x5f5c0b){var _0x277e38=this;var _0x5b0c52=getDiff(_0x277e38[_0x8d48('0x7')][_0x4f443f]['lastPauseAt']);clearTimeout(_0x277e38['timers'][_0x4f443f][_0x8d48('0x1a')]);_0x277e38[_0x8d48('0x7')][_0x4f443f]['timer']=![];return RpcVoiceAgentReport[_0x8d48('0x1b')]({'acwtime':_0x5b0c52},_0x277e38[_0x8d48('0x7')][_0x4f443f][_0x8d48('0x1c')],_0x4f443f)[_0x8d48('0x1d')](function(_0x4fdc83){logger[_0x8d48('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x5f5c0b,_0x5b0c52,_0x4fdc83);})['catch'](function(_0x13483e){logger[_0x8d48('0x1f')](_0x8d48('0x20'),_0x5f5c0b,_0x13483e);})[_0x8d48('0x21')](function(){delete _0x277e38[_0x8d48('0x7')][_0x4f443f];});};Acw[_0x8d48('0x19')][_0x8d48('0x22')]=function(_0x209205){try{var _0x38154f=this;var _0x212202=this[_0x8d48('0x8')][_0x209205]['interface'];var _0x5df9b1=this[_0x8d48('0x8')][_0x209205]['queue'];var _0x26f3b7=this[_0x8d48('0x5')][_0x5df9b1];var _0x486342=![];var _0x499bcb='ACW';if(_0x26f3b7[_0x8d48('0x23')]&&_0x26f3b7[_0x8d48('0x24')]['name']){_0x486342=!![];_0x499bcb=_0x26f3b7[_0x8d48('0x24')][_0x8d48('0x25')];}if(!_0x38154f[_0x8d48('0x6')][_0x212202]){return Promise[_0x8d48('0x26')]();}return RpcUser[_0x8d48('0x27')](_0x38154f[_0x8d48('0x6')][_0x212202]['id'])['then'](function(_0x18950a){if(!_0x18950a||_0x18950a['voicePause']){logger[_0x8d48('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x209205,_0x212202,_0x5df9b1);return;}logger['info'](_0x8d48('0x28'),_0x209205,_0x212202,_0x5df9b1);var _0x52e65e=_0x38154f[_0x8d48('0x8')][_0x209205][_0x8d48('0x29')]&&_0x38154f[_0x8d48('0x8')][_0x209205][_0x8d48('0x2a')]?_0x38154f['channels'][_0x209205][_0x8d48('0x2a')]:_0x209205;return RpcUser[_0x8d48('0x2b')](_0x38154f[_0x8d48('0x6')][_0x212202],_0x499bcb,_0x52e65e)[_0x8d48('0x1d')](function(_0x2bac95){_0x38154f[_0x8d48('0x5')][_0x5df9b1][_0x8d48('0x2c')]-=0x1;_0x38154f['voiceQueues'][_0x5df9b1][_0x8d48('0x2d')]+=0x1;return _0x2bac95;});})[_0x8d48('0x1d')](function(_0x172d0f){if(_0x486342||!_0x172d0f){return;}_0x38154f['timers'][_0x212202]={};logger[_0x8d48('0x1e')](_0x8d48('0x2e'),_0x209205,_0x38154f[_0x8d48('0x5')][_0x5df9b1][_0x8d48('0x2f')],_0x212202,_0x5df9b1);_0x38154f[_0x8d48('0x7')][_0x212202]['timer']=setTimeout(_0x38154f[_0x8d48('0x30')]['bind'](_0x38154f,_0x212202),_0x38154f[_0x8d48('0x5')][_0x5df9b1][_0x8d48('0x2f')]*0x3e8);_0x38154f['timers'][_0x212202][_0x8d48('0x31')]=moment()[_0x8d48('0x32')](_0x8d48('0x33'));_0x38154f[_0x8d48('0x7')][_0x212202][_0x8d48('0x1c')]=_0x209205;_0x38154f[_0x8d48('0x7')][_0x212202][_0x8d48('0x34')]=_0x5df9b1;_0x38154f['timers'][_0x212202]['updateAcw']=_0x38154f[_0x8d48('0x35')][_0x8d48('0xb')](_0x38154f,_0x212202,_0x209205);})[_0x8d48('0x36')](function(){logger['error'](_0x8d48('0x2e'),_0x209205,_0x38154f[_0x8d48('0x5')][_0x5df9b1][_0x8d48('0x2f')],_0x212202,_0x5df9b1);})[_0x8d48('0x21')](function(){delete _0x38154f[_0x8d48('0x8')][_0x209205];});}catch(_0x48141f){logger['error']('[ACW][START]\x20%s',_0x48141f[_0x8d48('0x37')]);}};Acw[_0x8d48('0x19')][_0x8d48('0x30')]=function(_0x1188c9){try{var _0x2d1f5c=this;if(_0x2d1f5c[_0x8d48('0x7')][_0x1188c9]){_0x2d1f5c[_0x8d48('0x7')][_0x1188c9][_0x8d48('0x1a')]=![];var _0x27f539=_0x2d1f5c[_0x8d48('0x7')][_0x1188c9][_0x8d48('0x1c')];var _0x79d001=_0x2d1f5c[_0x8d48('0x7')][_0x1188c9][_0x8d48('0x34')];var _0x99419d=_0x2d1f5c[_0x8d48('0x5')][_0x79d001][_0x8d48('0x2f')];logger['info'](_0x8d48('0x38'),_0x27f539,_0x1188c9);RpcUser['getAgent'](this['agents'][_0x1188c9]['id'])[_0x8d48('0x1d')](function(_0xa79c3f){if(_0xa79c3f['pauseType']===_0x8d48('0x39')){return RpcUser[_0x8d48('0x3a')](_0x2d1f5c[_0x8d48('0x6')][_0x1188c9]);}});RpcVoiceAgentReport['update']({'acwtime':_0x99419d,'agentacw':!![]},_0x27f539,_0x1188c9)[_0x8d48('0x1d')](function(_0x57ae89){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x27f539,_0x99419d,_0x57ae89);})['catch'](function(_0x5f1fdc){logger[_0x8d48('0x1f')](_0x8d48('0x20'),_0x27f539,_0x5f1fdc);});}else{logger[_0x8d48('0x1f')](_0x8d48('0x3b'),_0x1188c9);if(_0x2d1f5c[_0x8d48('0x7')]){logger[_0x8d48('0x1e')](_0x8d48('0x3c'),JSON[_0x8d48('0x3d')](_0x2d1f5c['timers']));}}}catch(_0x309d20){logger[_0x8d48('0x1f')](_0x8d48('0x3e'),_0x309d20[_0x8d48('0x37')]);}};Acw[_0x8d48('0x19')]['syncAgentConnect']=function(_0x56fc01){try{if(this[_0x8d48('0x5')][_0x56fc01[_0x8d48('0x34')]]&&(this[_0x8d48('0x5')][_0x56fc01[_0x8d48('0x34')]][_0x8d48('0x3f')]||this[_0x8d48('0x5')][_0x56fc01[_0x8d48('0x34')]]['mandatoryDisposition'])){if(this['agents'][_0x56fc01[_0x8d48('0x40')]]){this[_0x8d48('0x8')][_0x56fc01[_0x8d48('0x1c')]]={'queue':_0x56fc01[_0x8d48('0x34')],'interface':_0x56fc01[_0x8d48('0x40')],'destlinkedid':_0x56fc01['destlinkedid']};}}}catch(_0x45d410){logger['error'](_0x8d48('0x41'),_0x45d410[_0x8d48('0x37')]);}};Acw[_0x8d48('0x19')][_0x8d48('0x15')]=function(_0x5e2e51){try{if(this['voiceQueues'][_0x5e2e51[_0x8d48('0x34')]]&&(this[_0x8d48('0x5')][_0x5e2e51[_0x8d48('0x34')]][_0x8d48('0x3f')]||this[_0x8d48('0x5')][_0x5e2e51[_0x8d48('0x34')]][_0x8d48('0x23')])){if(this[_0x8d48('0x6')][_0x5e2e51[_0x8d48('0x40')]]){this[_0x8d48('0x8')][_0x5e2e51['uniqueid']]={'queue':_0x5e2e51[_0x8d48('0x34')],'interface':_0x5e2e51['interface']};}}}catch(_0x265170){logger[_0x8d48('0x1f')](_0x8d48('0x42'),_0x265170[_0x8d48('0x37')]);}};Acw[_0x8d48('0x19')][_0x8d48('0xd')]=function(_0x1ee8ec){try{if(this[_0x8d48('0x8')][_0x1ee8ec['uniqueid']]&&_[_0x8d48('0x43')](this[_0x8d48('0x8')][_0x1ee8ec[_0x8d48('0x1c')]][_0x8d48('0x29')])){logger[_0x8d48('0x1e')](_0x8d48('0x44'),_0x1ee8ec['uniqueid']);this[_0x8d48('0x22')](_0x1ee8ec[_0x8d48('0x1c')]);}else if(this[_0x8d48('0x8')][_0x1ee8ec[_0x8d48('0x45')]]&&_['isUndefined'](this['channels'][_0x1ee8ec[_0x8d48('0x45')]][_0x8d48('0x29')])){logger[_0x8d48('0x1e')](_0x8d48('0x46'),_0x1ee8ec[_0x8d48('0x45')]);this['startAcw'](_0x1ee8ec['linkedid']);}}catch(_0x1ef9aa){logger[_0x8d48('0x1f')](_0x8d48('0x47'),_0x1ef9aa['message']);}};Acw['prototype'][_0x8d48('0xf')]=function(_0x125400){try{if(this[_0x8d48('0x8')][_0x125400[_0x8d48('0x1c')]]&&this[_0x8d48('0x8')][_0x125400[_0x8d48('0x1c')]][_0x8d48('0x29')]){logger[_0x8d48('0x1e')](_0x8d48('0x48'),_0x125400[_0x8d48('0x1c')]);this[_0x8d48('0x22')](_0x125400[_0x8d48('0x1c')]);}else if(this[_0x8d48('0x8')][_0x125400['linkedid']]&&this[_0x8d48('0x8')][_0x125400[_0x8d48('0x45')]][_0x8d48('0x29')]){logger[_0x8d48('0x1e')](_0x8d48('0x49'),_0x125400[_0x8d48('0x45')]);this[_0x8d48('0x22')](_0x125400[_0x8d48('0x45')]);}}catch(_0x18ff0c){logger['error']('[ACW][syncHangup]\x20%s',_0x18ff0c[_0x8d48('0x37')]);}};Acw['prototype'][_0x8d48('0x12')]=function(_0x3f5b2d){try{if(!_[_0x8d48('0x4a')](this['channels'][_0x3f5b2d[_0x8d48('0x4b')]])){this[_0x8d48('0x22')](_0x3f5b2d[_0x8d48('0x4b')]);if(this[_0x8d48('0x8')][_0x3f5b2d['secondtransfereruniqueid']]){this[_0x8d48('0x8')][_0x3f5b2d['secondtransfereruniqueid']][_0x8d48('0x29')]=!![];this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4c')]]=this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4d')]];delete this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4d')]];}}else if(!_[_0x8d48('0x4a')](this[_0x8d48('0x8')][_0x3f5b2d['transfertargetuniqueid']])){this[_0x8d48('0x22')](_0x3f5b2d[_0x8d48('0x4c')]);if(this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4e')]]){this['channels'][_0x3f5b2d[_0x8d48('0x4e')]][_0x8d48('0x29')]=!![];this[_0x8d48('0x8')][_0x3f5b2d['transfereeuniqueid']]=this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4e')]];delete this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4e')]];}}}catch(_0x44a6b7){logger[_0x8d48('0x1f')](_0x8d48('0x4f'),_0x44a6b7['message']);}};Acw[_0x8d48('0x19')][_0x8d48('0x13')]=function(_0x15d513){try{if(this[_0x8d48('0x8')][_0x15d513[_0x8d48('0x50')]]){logger['info'](_0x8d48('0x51'),JSON['stringify'](_0x15d513[_0x8d48('0x50')]));this[_0x8d48('0x22')](_0x15d513[_0x8d48('0x50')]);}else if(this[_0x8d48('0x8')][_0x15d513[_0x8d48('0x52')]]){logger[_0x8d48('0x1e')](_0x8d48('0x53'),JSON['stringify'](_0x15d513[_0x8d48('0x52')]));this['startAcw'](_0x15d513['transfererlinkedid']);}}catch(_0x520b80){logger[_0x8d48('0x1f')](_0x8d48('0x54'),_0x520b80[_0x8d48('0x37')]);}};Acw['prototype'][_0x8d48('0x10')]=function(_0x16395c){try{if(this['voiceQueues'][_0x16395c[_0x8d48('0x34')]]&&this[_0x8d48('0x5')][_0x16395c['queue']][_0x8d48('0x55')]===_0x8d48('0x56')){if(this['agents'][_0x16395c[_0x8d48('0x40')]]){logger[_0x8d48('0x1e')](_0x8d48('0x57'),_0x16395c['uniqueid'],_0x16395c[_0x8d48('0x40')],_0x16395c[_0x8d48('0x34')]);return RpcUser[_0x8d48('0x2b')](this[_0x8d48('0x6')][_0x16395c[_0x8d48('0x40')]],_0x8d48('0x58'),_0x16395c['uniqueid']);}}}catch(_0x556d66){logger[_0x8d48('0x1f')](_0x8d48('0x59'),_0x556d66[_0x8d48('0x37')]);}};module[_0x8d48('0x5a')]=Acw; \ No newline at end of file +var _0x962d=['agentconnect','hanguprequest','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','then','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','getAgent','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x962d,0xab));var _0xd962=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0x962d[_0x45c262];return _0x4f2ba6;};'use strict';var _=require('lodash');var moment=require(_0xd962('0x0'));var ami=require(_0xd962('0x1'));var logger=require(_0xd962('0x2'))(_0xd962('0x3'));var RpcUser=require(_0xd962('0x4'));var RpcVoiceAgentReport=require(_0xd962('0x5'));function Acw(_0x3cd86d){this[_0xd962('0x6')]=_0x3cd86d[_0xd962('0x6')];this[_0xd962('0x7')]=_0x3cd86d[_0xd962('0x7')];this[_0xd962('0x8')]=_0x3cd86d['timers'];this['channels']={};ami['on'](_0xd962('0x9'),this['syncAgentConnect']['bind'](this));ami['on'](_0xd962('0xa'),this['syncHangupRequest'][_0xd962('0xb')](this));ami['on'](_0xd962('0xc'),this['syncHangup'][_0xd962('0xb')](this));ami['on'](_0xd962('0xd'),this[_0xd962('0xe')][_0xd962('0xb')](this));ami['on'](_0xd962('0xf'),this[_0xd962('0x10')][_0xd962('0xb')](this));ami['on']('blindtransfer',this[_0xd962('0x11')][_0xd962('0xb')](this));ami['on'](_0xd962('0x12'),this[_0xd962('0x13')][_0xd962('0xb')](this));}function getDiff(_0x1fb5b7){var _0x3b96e6=moment()[_0xd962('0x14')](0x0);var _0x31e6a3=moment(_0x1fb5b7)['milliseconds'](0x0);return _0x3b96e6[_0xd962('0x15')](_0x31e6a3,_0xd962('0x16'));}Acw[_0xd962('0x17')][_0xd962('0x18')]=function(_0x2752c8,_0x137e09){var _0x1fafb8=this;var _0x506dce=getDiff(_0x1fafb8[_0xd962('0x8')][_0x2752c8][_0xd962('0x19')]);clearTimeout(_0x1fafb8[_0xd962('0x8')][_0x2752c8][_0xd962('0x1a')]);_0x1fafb8[_0xd962('0x8')][_0x2752c8][_0xd962('0x1a')]=![];return RpcVoiceAgentReport[_0xd962('0x1b')]({'acwtime':_0x506dce},_0x1fafb8[_0xd962('0x8')][_0x2752c8][_0xd962('0x1c')],_0x2752c8)[_0xd962('0x1d')](function(_0x59f207){logger['info'](_0xd962('0x1e'),_0x137e09,_0x506dce,_0x59f207);})[_0xd962('0x1f')](function(_0x491586){logger[_0xd962('0x20')](_0xd962('0x21'),_0x137e09,_0x491586);})[_0xd962('0x22')](function(){delete _0x1fafb8[_0xd962('0x8')][_0x2752c8];});};Acw[_0xd962('0x17')][_0xd962('0x23')]=function(_0x12ad37){try{var _0x3f64ee=this;var _0x24bbac=this[_0xd962('0x24')][_0x12ad37][_0xd962('0x25')];var _0x2b4d7c=this['channels'][_0x12ad37][_0xd962('0x26')];var _0x2b43fc=this[_0xd962('0x6')][_0x2b4d7c];var _0x556c42=![];var _0x4d8240=_0xd962('0x27');if(_0x2b43fc[_0xd962('0x28')]&&_0x2b43fc[_0xd962('0x29')][_0xd962('0x2a')]){_0x556c42=!![];_0x4d8240=_0x2b43fc[_0xd962('0x29')]['name'];}if(!_0x3f64ee[_0xd962('0x7')][_0x24bbac]){return Promise[_0xd962('0x2b')]();}return RpcUser['getAgent'](_0x3f64ee[_0xd962('0x7')][_0x24bbac]['id'])[_0xd962('0x1d')](function(_0x51acde){if(!_0x51acde||_0x51acde[_0xd962('0x2c')]){logger[_0xd962('0x2d')](_0xd962('0x2e'),_0x12ad37,_0x24bbac,_0x2b4d7c);return;}logger[_0xd962('0x2d')](_0xd962('0x2f'),_0x12ad37,_0x24bbac,_0x2b4d7c);var _0x3c796a=_0x3f64ee[_0xd962('0x24')][_0x12ad37][_0xd962('0x30')]&&_0x3f64ee[_0xd962('0x24')][_0x12ad37]['destlinkedid']?_0x3f64ee['channels'][_0x12ad37][_0xd962('0x31')]:_0x12ad37;return RpcUser[_0xd962('0x32')](_0x3f64ee[_0xd962('0x7')][_0x24bbac],_0x4d8240,_0x3c796a)[_0xd962('0x1d')](function(_0x35a668){_0x3f64ee[_0xd962('0x6')][_0x2b4d7c][_0xd962('0x33')]-=0x1;_0x3f64ee[_0xd962('0x6')][_0x2b4d7c][_0xd962('0x34')]+=0x1;return _0x35a668;});})[_0xd962('0x1d')](function(_0x2a743c){if(_0x556c42||!_0x2a743c){return;}_0x3f64ee['timers'][_0x24bbac]={};logger['info'](_0xd962('0x35'),_0x12ad37,_0x3f64ee[_0xd962('0x6')][_0x2b4d7c][_0xd962('0x36')],_0x24bbac,_0x2b4d7c);_0x3f64ee[_0xd962('0x8')][_0x24bbac][_0xd962('0x1a')]=setTimeout(_0x3f64ee[_0xd962('0x37')][_0xd962('0xb')](_0x3f64ee,_0x24bbac),_0x3f64ee[_0xd962('0x6')][_0x2b4d7c][_0xd962('0x36')]*0x3e8);_0x3f64ee[_0xd962('0x8')][_0x24bbac][_0xd962('0x19')]=moment()[_0xd962('0x38')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f64ee['timers'][_0x24bbac][_0xd962('0x1c')]=_0x12ad37;_0x3f64ee[_0xd962('0x8')][_0x24bbac][_0xd962('0x26')]=_0x2b4d7c;_0x3f64ee['timers'][_0x24bbac]['updateAcw']=_0x3f64ee[_0xd962('0x18')]['bind'](_0x3f64ee,_0x24bbac,_0x12ad37);})[_0xd962('0x1f')](function(){logger[_0xd962('0x20')](_0xd962('0x35'),_0x12ad37,_0x3f64ee['voiceQueues'][_0x2b4d7c][_0xd962('0x36')],_0x24bbac,_0x2b4d7c);})[_0xd962('0x22')](function(){delete _0x3f64ee['channels'][_0x12ad37];});}catch(_0x12d941){logger[_0xd962('0x20')](_0xd962('0x39'),_0x12d941[_0xd962('0x3a')]);}};Acw['prototype']['stopAcw']=function(_0x4688f4){try{var _0x240fe8=this;if(_0x240fe8[_0xd962('0x8')][_0x4688f4]){_0x240fe8[_0xd962('0x8')][_0x4688f4][_0xd962('0x1a')]=![];var _0x25ee27=_0x240fe8[_0xd962('0x8')][_0x4688f4]['uniqueid'];var _0x301f64=_0x240fe8[_0xd962('0x8')][_0x4688f4][_0xd962('0x26')];var _0x24434a=_0x240fe8['voiceQueues'][_0x301f64][_0xd962('0x36')];logger[_0xd962('0x2d')](_0xd962('0x3b'),_0x25ee27,_0x4688f4);RpcUser[_0xd962('0x3c')](this[_0xd962('0x7')][_0x4688f4]['id'])[_0xd962('0x1d')](function(_0x693f1c){if(_0x693f1c[_0xd962('0x3d')]==='ACW'){return RpcUser[_0xd962('0x3e')](_0x240fe8[_0xd962('0x7')][_0x4688f4]);}});RpcVoiceAgentReport['update']({'acwtime':_0x24434a,'agentacw':!![]},_0x25ee27,_0x4688f4)[_0xd962('0x1d')](function(_0x27ca5d){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x25ee27,_0x24434a,_0x27ca5d);})[_0xd962('0x1f')](function(_0x2df521){logger[_0xd962('0x20')](_0xd962('0x21'),_0x25ee27,_0x2df521);});}else{logger['error'](_0xd962('0x3f'),_0x4688f4);if(_0x240fe8[_0xd962('0x8')]){logger[_0xd962('0x2d')](_0xd962('0x40'),JSON[_0xd962('0x41')](_0x240fe8[_0xd962('0x8')]));}}}catch(_0x55eb3a){logger[_0xd962('0x20')](_0xd962('0x42'),_0x55eb3a[_0xd962('0x3a')]);}};Acw[_0xd962('0x17')][_0xd962('0x43')]=function(_0x35e593){try{if(this[_0xd962('0x6')][_0x35e593[_0xd962('0x26')]]&&(this[_0xd962('0x6')][_0x35e593['queue']][_0xd962('0x3')]||this[_0xd962('0x6')][_0x35e593['queue']][_0xd962('0x28')])){if(this[_0xd962('0x7')][_0x35e593[_0xd962('0x25')]]){this['channels'][_0x35e593[_0xd962('0x1c')]]={'queue':_0x35e593[_0xd962('0x26')],'interface':_0x35e593[_0xd962('0x25')],'destlinkedid':_0x35e593[_0xd962('0x31')]};}}}catch(_0x1631ba){logger[_0xd962('0x20')](_0xd962('0x44'),_0x1631ba['message']);}};Acw['prototype'][_0xd962('0x13')]=function(_0x5b4693){try{if(this[_0xd962('0x6')][_0x5b4693[_0xd962('0x26')]]&&(this[_0xd962('0x6')][_0x5b4693[_0xd962('0x26')]]['acw']||this[_0xd962('0x6')][_0x5b4693['queue']][_0xd962('0x28')])){if(this[_0xd962('0x7')][_0x5b4693['interface']]){this[_0xd962('0x24')][_0x5b4693[_0xd962('0x1c')]]={'queue':_0x5b4693[_0xd962('0x26')],'interface':_0x5b4693[_0xd962('0x25')]};}}}catch(_0x446d77){logger['error'](_0xd962('0x45'),_0x446d77[_0xd962('0x3a')]);}};Acw[_0xd962('0x17')]['syncHangupRequest']=function(_0x43e6c5){try{if(this[_0xd962('0x24')][_0x43e6c5[_0xd962('0x1c')]]&&_['isUndefined'](this['channels'][_0x43e6c5[_0xd962('0x1c')]]['attended'])){logger[_0xd962('0x2d')]('[%s][HANGUP:UNIQUEID]',_0x43e6c5[_0xd962('0x1c')]);this['startAcw'](_0x43e6c5['uniqueid']);}else if(this[_0xd962('0x24')][_0x43e6c5[_0xd962('0x46')]]&&_[_0xd962('0x47')](this[_0xd962('0x24')][_0x43e6c5['linkedid']]['attended'])){logger['info'](_0xd962('0x48'),_0x43e6c5[_0xd962('0x46')]);this[_0xd962('0x23')](_0x43e6c5['linkedid']);}}catch(_0x2cb15a){logger[_0xd962('0x20')]('[ACW][syncHangupRequest]\x20%s',_0x2cb15a[_0xd962('0x3a')]);}};Acw[_0xd962('0x17')][_0xd962('0x49')]=function(_0x261d95){try{if(this['channels'][_0x261d95[_0xd962('0x1c')]]&&this[_0xd962('0x24')][_0x261d95[_0xd962('0x1c')]]['attended']){logger['info'](_0xd962('0x4a'),_0x261d95[_0xd962('0x1c')]);this[_0xd962('0x23')](_0x261d95[_0xd962('0x1c')]);}else if(this['channels'][_0x261d95[_0xd962('0x46')]]&&this[_0xd962('0x24')][_0x261d95[_0xd962('0x46')]]['attended']){logger[_0xd962('0x2d')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x261d95[_0xd962('0x46')]);this[_0xd962('0x23')](_0x261d95[_0xd962('0x46')]);}}catch(_0x486db9){logger['error'](_0xd962('0x4b'),_0x486db9[_0xd962('0x3a')]);}};Acw[_0xd962('0x17')][_0xd962('0x10')]=function(_0x9d6347){try{if(!_[_0xd962('0x4c')](this[_0xd962('0x24')][_0x9d6347[_0xd962('0x4d')]])){this['startAcw'](_0x9d6347[_0xd962('0x4d')]);if(this['channels'][_0x9d6347[_0xd962('0x4e')]]){this['channels'][_0x9d6347[_0xd962('0x4e')]]['attended']=!![];this[_0xd962('0x24')][_0x9d6347[_0xd962('0x4f')]]=this[_0xd962('0x24')][_0x9d6347[_0xd962('0x4e')]];delete this[_0xd962('0x24')][_0x9d6347[_0xd962('0x4e')]];}}else if(!_['isNil'](this['channels'][_0x9d6347[_0xd962('0x4f')]])){this['startAcw'](_0x9d6347[_0xd962('0x4f')]);if(this[_0xd962('0x24')][_0x9d6347[_0xd962('0x50')]]){this[_0xd962('0x24')][_0x9d6347['origtransfereruniqueid']][_0xd962('0x30')]=!![];this['channels'][_0x9d6347[_0xd962('0x4d')]]=this[_0xd962('0x24')][_0x9d6347['origtransfereruniqueid']];delete this[_0xd962('0x24')][_0x9d6347[_0xd962('0x50')]];}}}catch(_0xb69805){logger[_0xd962('0x20')]('[ACW][syncAttendedTransfer]\x20%s',_0xb69805[_0xd962('0x3a')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x4644c2){try{if(this[_0xd962('0x24')][_0x4644c2[_0xd962('0x51')]]){logger['info'](_0xd962('0x52'),JSON[_0xd962('0x41')](_0x4644c2['transfereruniqueid']));this['startAcw'](_0x4644c2[_0xd962('0x51')]);}else if(this[_0xd962('0x24')][_0x4644c2[_0xd962('0x53')]]){logger[_0xd962('0x2d')](_0xd962('0x54'),JSON[_0xd962('0x41')](_0x4644c2[_0xd962('0x53')]));this['startAcw'](_0x4644c2[_0xd962('0x53')]);}}catch(_0x1afe6e){logger[_0xd962('0x20')]('[ACW][syncBlindTransfer]\x20%s',_0x1afe6e[_0xd962('0x3a')]);}};Acw[_0xd962('0x17')][_0xd962('0xe')]=function(_0xe121eb){try{if(this[_0xd962('0x6')][_0xe121eb['queue']]&&this['voiceQueues'][_0xe121eb['queue']]['autopause']===_0xd962('0x55')){if(this[_0xd962('0x7')][_0xe121eb['interface']]){logger[_0xd962('0x2d')](_0xd962('0x56'),_0xe121eb['uniqueid'],_0xe121eb[_0xd962('0x25')],_0xe121eb[_0xd962('0x26')]);return RpcUser[_0xd962('0x32')](this['agents'][_0xe121eb['interface']],_0xd962('0x57'),_0xe121eb[_0xd962('0x1c')]);}}}catch(_0x472318){logger[_0xd962('0x20')](_0xd962('0x58'),_0x472318[_0xd962('0x3a')]);}};module[_0xd962('0x59')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index f3bbec0..f851f18 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 _0x0993=['util','../../config/logger','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','format','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird'];(function(_0x399a78,_0x52eeaf){var _0x470783=function(_0x2740a4){while(--_0x2740a4){_0x399a78['push'](_0x399a78['shift']());}};_0x470783(++_0x52eeaf);}(_0x0993,0x6d));var _0x3099=function(_0x47e708,_0x96a881){_0x47e708=_0x47e708-0x0;var _0x3829ec=_0x0993[_0x47e708];return _0x3829ec;};'use strict';var Manager=require(_0x3099('0x0'));var BPromise=require(_0x3099('0x1'));var util=require(_0x3099('0x2'));var logger=require(_0x3099('0x3'))('ami');var config=require(_0x3099('0x4'));var ami=new Manager(config[_0x3099('0x5')][_0x3099('0x6')],config[_0x3099('0x5')]['ip'],config[_0x3099('0x5')][_0x3099('0x7')],config[_0x3099('0x5')][_0x3099('0x8')],!![]);ami[_0x3099('0x9')]();ami[_0x3099('0xa')]=BPromise[_0x3099('0xb')](ami[_0x3099('0xc')]);function error(_0x23dc47){logger['error'](util['format'](_0x3099('0xd'),config[_0x3099('0x5')][_0x3099('0x7')],config[_0x3099('0x5')]['ip'],config[_0x3099('0x5')][_0x3099('0x6')],util[_0x3099('0xe')](_0x23dc47,![],null)));}function close(){logger[_0x3099('0xf')](util[_0x3099('0x10')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x3099('0x5')][_0x3099('0x7')],config['asterisk']['ip'],config[_0x3099('0x5')]['port']));}ami[_0x3099('0x11')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x3099('0x12')]=function(){return function(){return ami[_0x3099('0xa')]({'action':'devicestatelist'});};};ami[_0x3099('0x13')]=function(){return function(){return ami[_0x3099('0xa')]({'action':_0x3099('0x14')});};};ami[_0x3099('0x15')]=function(){return function(){return ami['Action']({'action':_0x3099('0x16')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x3099('0xa')]({'action':_0x3099('0x17')});};};function connect(){logger[_0x3099('0x18')](util[_0x3099('0x10')](_0x3099('0x19'),config[_0x3099('0x5')][_0x3099('0x7')],config[_0x3099('0x5')]['ip'],config[_0x3099('0x5')][_0x3099('0x6')]));ami[_0x3099('0x1a')](_0x3099('0xf'),error);ami[_0x3099('0x1a')](_0x3099('0x1b'),close);}ami['on'](_0x3099('0x1c'),connect);ami['on'](_0x3099('0x1d'),function(_0x4782c6){logger[_0x3099('0x18')](util[_0x3099('0x10')](_0x3099('0x1e'),config[_0x3099('0x5')][_0x3099('0x7')],config[_0x3099('0x5')]['ip'],config['asterisk'][_0x3099('0x6')],util[_0x3099('0xe')](_0x4782c6,![],null)));});ami['on'](_0x3099('0x1f'),function(){logger['info'](util[_0x3099('0x10')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x3099('0x5')][_0x3099('0x7')],config['asterisk']['ip'],config[_0x3099('0x5')][_0x3099('0x6')]));return Promise['resolve']()['then'](ami[_0x3099('0x11')]())['then'](ami[_0x3099('0x12')]())['then'](ami[_0x3099('0x13')]())[_0x3099('0x20')](ami['actionQueueSummary']())['then'](ami[_0x3099('0x21')]())[_0x3099('0x22')](function(_0x7220c2){logger[_0x3099('0xf')](_0x3099('0x23'),util['inspect'](_0x7220c2,{'showHidden':![],'depth':null}));});});ami[_0x3099('0x1a')](_0x3099('0xf'),error);ami['once'](_0x3099('0x1b'),close);module[_0x3099('0x24')]=ami; \ No newline at end of file +var _0xe6a1=['ami','../../config/environment','asterisk','password','keepConnected','Action','error','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger'];(function(_0x115a84,_0x4e03cc){var _0x8fc81c=function(_0x216805){while(--_0x216805){_0x115a84['push'](_0x115a84['shift']());}};_0x8fc81c(++_0x4e03cc);}(_0xe6a1,0x164));var _0x1e6a=function(_0x20436b,_0x5ab272){_0x20436b=_0x20436b-0x0;var _0x1b724e=_0xe6a1[_0x20436b];return _0x1b724e;};'use strict';var Manager=require(_0x1e6a('0x0'));var BPromise=require(_0x1e6a('0x1'));var util=require(_0x1e6a('0x2'));var logger=require(_0x1e6a('0x3'))(_0x1e6a('0x4'));var config=require(_0x1e6a('0x5'));var ami=new Manager(config[_0x1e6a('0x6')]['port'],config[_0x1e6a('0x6')]['ip'],config[_0x1e6a('0x6')]['username'],config['asterisk'][_0x1e6a('0x7')],!![]);ami[_0x1e6a('0x8')]();ami[_0x1e6a('0x9')]=BPromise['promisify'](ami['action']);function error(_0x8137a5){logger[_0x1e6a('0xa')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk']['username'],config[_0x1e6a('0x6')]['ip'],config['asterisk'][_0x1e6a('0xb')],util[_0x1e6a('0xc')](_0x8137a5,![],null)));}function close(){logger['error'](util['format'](_0x1e6a('0xd'),config['asterisk'][_0x1e6a('0xe')],config[_0x1e6a('0x6')]['ip'],config['asterisk'][_0x1e6a('0xb')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0x1e6a('0xf')});};};ami[_0x1e6a('0x10')]=function(){return function(){return ami['Action']({'action':_0x1e6a('0x11')});};};ami[_0x1e6a('0x12')]=function(){return function(){return ami[_0x1e6a('0x9')]({'action':_0x1e6a('0x13')});};};ami[_0x1e6a('0x14')]=function(){return function(){return ami[_0x1e6a('0x9')]({'action':'queuesummary'});};};ami[_0x1e6a('0x15')]=function(){return function(){return ami[_0x1e6a('0x9')]({'action':_0x1e6a('0x16')});};};function connect(){logger[_0x1e6a('0x17')](util[_0x1e6a('0x18')](_0x1e6a('0x19'),config[_0x1e6a('0x6')][_0x1e6a('0xe')],config[_0x1e6a('0x6')]['ip'],config[_0x1e6a('0x6')]['port']));ami[_0x1e6a('0x1a')](_0x1e6a('0xa'),error);ami[_0x1e6a('0x1a')](_0x1e6a('0x1b'),close);}ami['on'](_0x1e6a('0x1c'),connect);ami['on'](_0x1e6a('0x1d'),function(_0x2b3c6f){logger['info'](util[_0x1e6a('0x18')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x1e6a('0xe')],config['asterisk']['ip'],config[_0x1e6a('0x6')][_0x1e6a('0xb')],util[_0x1e6a('0xc')](_0x2b3c6f,![],null)));});ami['on'](_0x1e6a('0x1e'),function(){logger['info'](util[_0x1e6a('0x18')](_0x1e6a('0x1f'),config[_0x1e6a('0x6')]['username'],config[_0x1e6a('0x6')]['ip'],config['asterisk'][_0x1e6a('0xb')]));return Promise[_0x1e6a('0x20')]()[_0x1e6a('0x21')](ami['actionSipShowRegistry']())['then'](ami['actionDeviceStateList']())[_0x1e6a('0x21')](ami[_0x1e6a('0x12')]())[_0x1e6a('0x21')](ami[_0x1e6a('0x14')]())[_0x1e6a('0x21')](ami[_0x1e6a('0x15')]())['catch'](function(_0x294e9d){logger[_0x1e6a('0xa')](_0x1e6a('0x22'),util[_0x1e6a('0xc')](_0x294e9d,{'showHidden':![],'depth':null}));});});ami[_0x1e6a('0x1a')]('error',error);ami['once'](_0x1e6a('0x1b'),close);module[_0x1e6a('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index afe5537..bb05b38 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 _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x4c9472,_0x2a6a24){var _0x29e182=function(_0x2701c6){while(--_0x2701c6){_0x4c9472['push'](_0x4c9472['shift']());}};_0x29e182(++_0x2a6a24);}(_0xaa88,0x137));var _0x8aa8=function(_0x3f465d,_0xbd2037){_0x3f465d=_0x3f465d-0x0;var _0x121ad1=_0xaa88[_0x3f465d];return _0x121ad1;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x5301a0,_0x562072){var _0x3edb89=function(_0x17684e){while(--_0x17684e){_0x5301a0['push'](_0x5301a0['shift']());}};_0x3edb89(++_0x562072);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 622702f..526a97c 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 _0x320e=['Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','getSeconds','startProgressive','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','checkContactLowerLimitOriginate','temp','CAMPAIGN_STATUS','contactsRescheduled','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','prototype','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','isArray','length','push','Action','command','interval','timezones','then','content','true','iftime\x20%s,%s','indexOf','catch','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','stringify','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','syncAgentConnect','queue','type','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','uniqueid','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','countabandonedretry','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','roundrobin','isNil','locked','paused','stateinterface','rrmemory','merge','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','response','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','stateGlobal','reason19\x20machine....','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Normal\x20Clearing','[syncAgentComplete]','outboundUnknownCallsDay','cause-txt','Unknow','running','INACTIVE','statusMessage','resolve','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:%s','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','Trunk','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','substring','SIP/%s/%s%s','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','dialCongestionRetryFrequency','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','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','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsCallersExit','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','abandonmentRate','[CatchErlangB]','predictiveIntervalPauses','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','getContactDialer','checkContactEmpty','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','dialOrderByScheduledAt','[actionOriginatePredictive]\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','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','util','lodash','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','newexten','syncNewExten','queuemember','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','emit','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','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','predictiveIntervalAnsweredCalls'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x320e,0x1d8));var _0xe320=function(_0x5842c3,_0x56bd74){_0x5842c3=_0x5842c3-0x0;var _0x44bf8c=_0x320e[_0x5842c3];return _0x44bf8c;};'use strict';var util=require(_0xe320('0x0'));var _=require(_0xe320('0x1'));var uuid=require('uuid');var moment=require(_0xe320('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xe320('0x3'));var hopperUtils=require(_0xe320('0x4'));var ut=require(_0xe320('0x5'));var config=require(_0xe320('0x6'));var logger=require(_0xe320('0x7'))(_0xe320('0x8'));var loggerBooked=require(_0xe320('0x7'))(_0xe320('0x9'));var loggerPredictive=require('../../../config/logger')(_0xe320('0xa'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0xe320('0x7'))(_0xe320('0xb'));var ami=require(_0xe320('0xc'));config[_0xe320('0xd')]=_[_0xe320('0xe')](config[_0xe320('0xd')],{'host':_0xe320('0xf'),'port':0x18eb});var io=require(_0xe320('0x10'))(new Redis(config[_0xe320('0xd')]));var cmHopper=require(_0xe320('0x11'));var voiceQueueRt=require(_0xe320('0x12'));var RpcSetting=require('../rpc/setting');var Interval=require(_0xe320('0x13'));var Action=require(_0xe320('0x14'));var History=require('./models/history');var Final=require(_0xe320('0x15'));var AgentComplete=require(_0xe320('0x16'));var QueueCallerAbandon=require(_0xe320('0x17'));var Hangup=require(_0xe320('0x18'));var ipAgi=process[_0xe320('0x19')][_0xe320('0x1a')]||_0xe320('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xe320('0x1c')]=function(_0x1573f5){this[_0xe320('0x1d')]=this[_0xe320('0x1d')]?this[_0xe320('0x1d')][_0xe320('0x1e')](_0x1573f5):_0x1573f5();};function Dialer(_0x3e9bd9,_0x58c5a9){this[_0xe320('0x1f')]=new Sequence();this[_0xe320('0x20')]=_0x58c5a9;this[_0xe320('0x21')]=_0x3e9bd9[_0xe320('0x21')];this[_0xe320('0x22')]=_0x3e9bd9[_0xe320('0x22')];this[_0xe320('0x23')]=_0x3e9bd9[_0xe320('0x23')];this[_0xe320('0x24')]=_0x3e9bd9[_0xe320('0x24')];this[_0xe320('0x25')]=config['maxNumberOriginate']||0x2;this[_0xe320('0x26')]={};this[_0xe320('0x27')]={};this['contactsId']={};this[_0xe320('0x28')]={};this[_0xe320('0x29')]={};this[_0xe320('0x2a')]={};this['startProgressive']={};this[_0xe320('0x2b')]={};this[_0xe320('0x2c')]={};this[_0xe320('0x2d')]={};this[_0xe320('0x2e')]={};ami['on'](_0xe320('0x2f'),this['syncAgentConnect'][_0xe320('0x30')](this));ami['on'](_0xe320('0x31'),this[_0xe320('0x32')][_0xe320('0x30')](this));ami['on'](_0xe320('0x33'),this[_0xe320('0x34')][_0xe320('0x30')](this));ami['on'](_0xe320('0x35'),this[_0xe320('0x36')][_0xe320('0x30')](this));ami['on'](_0xe320('0x37'),this[_0xe320('0xb')]['bind'](this));ami['on'](_0xe320('0x38'),this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0xe320('0x39'),this['syncHangup'][_0xe320('0x30')](this));ami['on'](_0xe320('0x3a'),this[_0xe320('0x3b')][_0xe320('0x30')](this));ami['on']('varset',this['syncVarSet'][_0xe320('0x30')](this));ami['on'](_0xe320('0x3c'),this[_0xe320('0x3d')][_0xe320('0x30')](this));ami['on']('queuestatuscomplete',this[_0xe320('0x3e')][_0xe320('0x30')](this));this['loopCampaigns']();this[_0xe320('0x3f')]();RpcSetting[_0xe320('0x40')]()['then'](function(_0x1a4d25){previewRecallmeReminderInterval=_0x1a4d25[_0xe320('0x41')];});}function isNotNull(_0x3dca59){return _0x3dca59!==null&&!_[_0xe320('0x42')](_0x3dca59);}function msgResponse(_0x5715b0,_0x2c2f02,_0x5008d7){return{'action':_0x5715b0,'response':_0x2c2f02,'message':_0x5008d7,'stack':_0x5008d7};}function emit(_0x583ca2,_0xbca4b2,_0x1a7aef){io['to'](_0x583ca2)[_0xe320('0x43')](_0xbca4b2,_0x1a7aef);}function emitOutboundVoiceQueueSummary(_0xb1d099){if(_0xb1d099['type']==='outbound'){logger[_0xe320('0x44')](_0xe320('0x45'),util['inspect'](_0xb1d099,{'showHidden':![],'depth':null}));emit(util[_0xe320('0x46')](_0xe320('0x47'),_0xb1d099[_0xe320('0x48')]),_0xe320('0x49'),_0xb1d099);}}function checkGetDataPredictive(_0x99d572){if(isNotNull(_0x99d572)&&!_[_0xe320('0x4a')](_0x99d572)){loggerPredictive[_0xe320('0x4b')](_0xe320('0x4c'));loggerPredictive[_0xe320('0x4b')](_0xe320('0x4d'),_0x99d572[_0xe320('0x4e')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x99d572[_0xe320('0x4f')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x99d572['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xe320('0x4b')](_0xe320('0x50'),_0x99d572['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0xe320('0x51'),_0x99d572['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xe320('0x4b')](_0xe320('0x52'),_0x99d572['predictiveIntervalAvgTalktime']);loggerPredictive[_0xe320('0x4b')](_0xe320('0x53'));if(_0x99d572[_0xe320('0x4e')]>0x0){if(!_['isUndefined'](_0x99d572['predictiveIntervalAvgTalktime'])&&_0x99d572[_0xe320('0x54')]>0x0){return!![];}loggerPredictive[_0xe320('0x4b')](_0xe320('0x55'));if(!_[_0xe320('0x42')](_0x99d572[_0xe320('0x56')])&&_0x99d572[_0xe320('0x56')]>0x0){return!![];}loggerPredictive[_0xe320('0x4b')](_0xe320('0x57'));}else{loggerPredictive[_0xe320('0x4b')](_0xe320('0x58'));}}else{loggerPredictive[_0xe320('0x4b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x441048){return function(_0x444492){loggerPredictive[_0xe320('0x4b')]('---------\x20ErlangB\x20---------');loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x444492[_0xe320('0x59')]);loggerPredictive[_0xe320('0x4b')](_0xe320('0x5a'),_0x444492[_0xe320('0x5b')]);loggerPredictive[_0xe320('0x4b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x444492[_0xe320('0x5c')]);loggerPredictive[_0xe320('0x4b')](_0xe320('0x5d'),_0x444492[_0xe320('0x5e')]);loggerPredictive['info'](_0xe320('0x5f'),_0x444492[_0xe320('0x5c')]);loggerPredictive[_0xe320('0x4b')](_0xe320('0x53'));_['merge'](_0x441048,_0x444492);};}function ifInterval(_0x114796,_0x387c42){if(_[_0xe320('0x42')](_0x387c42)){return![];}return utils[_0xe320('0x60')](undefined,_0x387c42)<_0x114796*0x3c;}function clearPredictiveAttributes(_0x53a3cd){if(_0x53a3cd[_0xe320('0x61')]){_0x53a3cd[_0xe320('0x61')]=undefined;loggerPredictive[_0xe320('0x44')](_0x53a3cd[_0xe320('0x48')],_0xe320('0x62'));}if(_0x53a3cd['startPredictive']){_0x53a3cd[_0xe320('0x2a')]=undefined;loggerPredictive['debug'](_0x53a3cd['name'],_0xe320('0x63'));}if(_0x53a3cd[_0xe320('0x64')]){clearInterval(_0x53a3cd['handlePredictive']);_0x53a3cd[_0xe320('0x64')]=undefined;loggerPredictive[_0xe320('0x44')](_0x53a3cd[_0xe320('0x48')],_0xe320('0x65'));}}function loggerCatchPredictive(_0x1e9660,_0x65aa7a){return function(_0x9afe4c){loggerPredictive[_0xe320('0x66')](_0x65aa7a[_0xe320('0x48')],_0x1e9660);loggerPredictive[_0xe320('0x66')](_0x9afe4c[_0xe320('0x67')]);clearPredictiveAttributes(_0x65aa7a);};}function loggerCatch(_0x10e850){return function(_0x495055){logger[_0xe320('0x66')](_0x10e850,util[_0xe320('0x68')](_0x495055,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x17be0f,_0x63b398,_0x14aec2){return function(_0x1d9689){utils[_0xe320('0x69')](_0x63b398,_0x14aec2,0x0);_0x63b398[_0xe320('0x6a')]=0x0;logger[_0xe320('0x66')](_0x17be0f,util[_0xe320('0x68')](_0x1d9689,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x22e2aa){return function(_0x448c67){if(isNotNull(_0x448c67)&&isNotNull(_0x448c67[0x0])){if(_0x448c67[0x0]['contactsRescheduled']>0x0){_0x22e2aa['message']=utils[_0xe320('0x6b')]['CONTACTS_RESCHEDULED'];logger[_0xe320('0x4b')]('[getContactDialer2][ReScheduled]'+_0x22e2aa['name'],_0x448c67[0x0][_0xe320('0x6c')],_0xe320('0x6d'));}else{_0x22e2aa[_0xe320('0x6e')]=utils['CAMPAIGN_STATUS'][_0xe320('0x6f')];logger[_0xe320('0x4b')](_0xe320('0x70')+_0x22e2aa['name']);}}};}function createObjHistory(_0x3e2fdd,_0x38ac34,_0x2a00b6,_0x103311,_0x353558){_0x3e2fdd[_0xe320('0x6e')]=_0x2a00b6;var _0x207078=new Action(_0x3e2fdd,_0x38ac34);var _0x5abe71=new History(_0x207078);_0x5abe71['state']=_0x103311;_0x5abe71[_0xe320('0x71')]=_0x353558;_0x5abe71[_0xe320('0x72')]=_0x207078[_0xe320('0x73')];return _0x5abe71;}function unlockQueueStatus(_0x4ddb57,_0xac361d){setTimeout(function(){if(_[_0xe320('0x42')](_0x4ddb57[_0xe320('0x74')])){loggerBooked[_0xe320('0x66')](_0xe320('0x75'),_0xac361d);}_0x4ddb57['queueStatusComplete']=!![];loggerBooked[_0xe320('0x4b')](_0xe320('0x76'),_0xac361d,JSON['stringify'](_[_0xe320('0x77')](_0x4ddb57,['name',_0xe320('0x74')])));},0x1f3);}function checkInterval(_0x229960){return function(){if(!isNotNull(_0x229960[_0xe320('0x78')])){_0x229960[_0xe320('0x6e')]=utils['CAMPAIGN_STATUS'][_0xe320('0x79')];throw _0x229960[_0xe320('0x48')]+_0xe320('0x7a');}if(!isNotNull(_0x229960[_0xe320('0x78')]['Intervals'])){_0x229960[_0xe320('0x6e')]=utils[_0xe320('0x6b')][_0xe320('0x79')];throw _0x229960[_0xe320('0x48')]+_0xe320('0x7a');}if(!isNotNull(_[_0xe320('0x4a')](_0x229960[_0xe320('0x78')][_0xe320('0x7b')]))){_0x229960[_0xe320('0x6e')]=utils['CAMPAIGN_STATUS'][_0xe320('0x79')];throw _0x229960[_0xe320('0x48')]+_0xe320('0x7a');}};}function checkIsIVRCampaignActive(_0x4b3f12){return function(){if(!utils[_0xe320('0x7c')](_0x4b3f12)){_0x4b3f12[_0xe320('0x6e')]=utils[_0xe320('0x6b')]['INACTIVE'];throw _0x4b3f12['name']+_0xe320('0x7d');}};}function emitCampaignSummary(_0x456fd0){if(utils[_0xe320('0x7e')](_0x456fd0)){emit(util[_0xe320('0x46')](_0xe320('0x7f'),_0x456fd0[_0xe320('0x48')]),'campaign:save',_0x456fd0);}}function loggerCatchQueueSummary(_0x322332,_0x5adea3){return function(_0xfa6dca){clearPredictiveAttributes(_0x5adea3);emitCampaignSummary(_0x5adea3);loggerSyncQueueSummary[_0xe320('0x44')](_0x322332,util[_0xe320('0x68')](_0xfa6dca,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x7959e7){if(_0x7959e7[_0xe320('0x80')]){if(_0x7959e7[_0xe320('0x81')]===0x0){_0x7959e7[_0xe320('0x80')]=![];_0x7959e7[_0xe320('0x6e')]=utils[_0xe320('0x6b')]['INACTIVE'];loggerSyncQueueSummary[_0xe320('0x44')](_0xe320('0x82'),_0x7959e7[_0xe320('0x48')],_0xe320('0x83'));}else{_0x7959e7[_0xe320('0x6e')]=utils['CAMPAIGN_STATUS'][_0xe320('0x84')];loggerSyncQueueSummary[_0xe320('0x44')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x7959e7[_0xe320('0x48')],_0xe320('0x85'));}emitCampaignSummary(_0x7959e7);}}function myreject(_0x5ba8f2){return function(_0x1c2da3){return _0x5ba8f2(msgResponse(_0xe320('0x86'),'Error',JSON['stringify'](_0x1c2da3)));};}Dialer['prototype'][_0xe320('0x87')]=function(_0x161b59){return!_[_0xe320('0x42')](_0x161b59)&&_0x161b59&&!_[_0xe320('0x42')](_0x161b59[_0xe320('0x48')])&&!_[_0xe320('0x42')](_0x161b59['active'])&&_0x161b59[_0xe320('0x88')]&&(this[_0xe320('0x24')][util[_0xe320('0x46')](_0xe320('0x89'),_0x161b59[_0xe320('0x48')])][_0xe320('0x8a')]===_0xe320('0x8b')||this[_0xe320('0x24')][util[_0xe320('0x46')](_0xe320('0x89'),_0x161b59[_0xe320('0x48')])]['status']===_0xe320('0x8c'));};Dialer[_0xe320('0x8d')][_0xe320('0x8e')]=function(_0x248b8f){var _0x49be9a=this;return function(){if(!_0x49be9a[_0xe320('0x87')](_0x248b8f['Trunk'])){if(!_0x49be9a[_0xe320('0x87')](_0x248b8f[_0xe320('0x8f')])){_0x248b8f['message']=utils['CAMPAIGN_STATUS'][_0xe320('0x90')];throw _0x248b8f[_0xe320('0x48')]+_0xe320('0x91');}}};};Dialer[_0xe320('0x8d')]['checkIfTime']=function(_0x99fce9,_0x32465c,_0xcc34f9,_0x5b6687){var _0x34f1bc=this;return function(){var _0x140e9c=!![];return _0x34f1bc[_0xe320('0x92')](_0x99fce9,_0x32465c,_0xcc34f9,_0x5b6687,_0x140e9c);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x2f310a,_0x58604a,_0x85a2db,_0x4d6d2d){var _0x3cdd89=this;return function(){var _0xdf93ab=![];return _0x3cdd89['ifTimeIvr'](_0x2f310a[_0xe320('0x7b')],_0x58604a,_0x85a2db,_0x4d6d2d,_0xdf93ab);};};Dialer['prototype']['ifTimeIvr']=function(_0x2c5462,_0x4d4d3f,_0x2f50df,_0x475c11,_0x1e6d0b){var _0x2b8026=[];return new Promise(function(_0x21d0df,_0xb05946){if(!isNotNull(_0x2c5462)){_0x475c11['message']=utils[_0xe320('0x6b')][_0xe320('0x79')];return _0xb05946(msgResponse(_0xe320('0x93'),_0xe320('0x94'),_0x2f50df+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xe320('0x4a')](_0x2c5462)){_0x475c11[_0xe320('0x6e')]=utils[_0xe320('0x6b')][_0xe320('0x95')];return _0xb05946(msgResponse(_0xe320('0x93'),'Failure',_0x2f50df+_0xe320('0x96')));}if(_0x4d4d3f&&_['isUndefined'](config['timezones'][_0x4d4d3f])){_0x475c11['message']=utils[_0xe320('0x6b')][_0xe320('0x97')];return _0xb05946(msgResponse(_0xe320('0x93'),_0xe320('0x94'),_0x2f50df+'\x20Timezone\x20unknow\x20'+_0x4d4d3f));}if(_[_0xe320('0x98')](_0x2c5462)){for(var _0x175d3e=0x0;_0x175d3e<_0x2c5462[_0xe320('0x99')];_0x175d3e+=0x1){_0x2b8026[_0xe320('0x9a')](ami[_0xe320('0x9b')]({'action':_0xe320('0x9c'),'command':util[_0xe320('0x46')]('iftime\x20%s,%s',_0x2c5462[_0x175d3e][_0xe320('0x9d')],!_[_0xe320('0x42')](config[_0xe320('0x9e')][_0x4d4d3f])?_0x4d4d3f:'')})[_0xe320('0x9f')](function(_0x1f33d2){return _0x1f33d2[_0xe320('0xa0')]['indexOf'](_0xe320('0xa1'))>=0x0;})['catch'](myreject(_0xb05946)));}}else{_0x2b8026[_0xe320('0x9a')](ami[_0xe320('0x9b')]({'action':_0xe320('0x9c'),'command':util[_0xe320('0x46')](_0xe320('0xa2'),_0x2c5462,!_['isUndefined'](config[_0xe320('0x9e')][_0x4d4d3f])?_0x4d4d3f:'')})[_0xe320('0x9f')](function(_0x3c9505){return _0x3c9505['content'][_0xe320('0xa3')]('true')>=0x0;})[_0xe320('0xa4')](myreject(_0xb05946)));}Promise[_0xe320('0xa5')](_0x2b8026)[_0xe320('0x9f')](function(_0x1ec4da){var _0x44ed30=_[_0xe320('0xa6')](_0x1ec4da);if(_0x44ed30){return _0x21d0df(_0x44ed30);}else{_0x475c11[_0xe320('0x6e')]=_0x1e6d0b?utils[_0xe320('0x6b')][_0xe320('0xa7')]:utils[_0xe320('0x6b')][_0xe320('0xa8')];return _0xb05946(msgResponse(_0xe320('0xa9'),_0xe320('0x94'),_0xe320('0xaa')+_0x1e6d0b+'\x20'+_0x2f50df+_0xe320('0xab')+util[_0xe320('0x68')](_0x2c5462,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4d4d3f));}})[_0xe320('0xa4')](function(_0x53d1bb){return _0xb05946(msgResponse(_0xe320('0x93'),_0xe320('0x94'),JSON[_0xe320('0xac')](_0x53d1bb)));});});};Dialer[_0xe320('0x8d')][_0xe320('0xad')]=function(){var _0xdb544d=this;return cmHopper[_0xe320('0xae')]({'active':![]},{'where':{'active':!![]}})[_0xe320('0x9f')](function(){setInterval(function(){_0xdb544d[_0xe320('0xaf')]();},0x3e8);});};Dialer[_0xe320('0x8d')][_0xe320('0xaf')]=function(){var _0x5c7428=this;var _0x3b7a22;for(var _0x23c7a0 in this[_0xe320('0x22')]){if(typeof this[_0xe320('0x22')][_0x23c7a0]!==_0xe320('0xb0')){_0x3b7a22=this[_0xe320('0x22')][_0x23c7a0];if(utils['isIVRCampaign'](_0x3b7a22)&&utils[_0xe320('0x7c')](_0x3b7a22)){_0x3b7a22[_0xe320('0x80')]=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x3b7a22))['then'](checkInterval(_0x3b7a22))[_0xe320('0x9f')](_0x5c7428[_0xe320('0x8e')](_0x3b7a22))[_0xe320('0x9f')](_0x5c7428[_0xe320('0xb1')](_0x3b7a22[_0xe320('0xb2')],_0x3b7a22[_0xe320('0xb3')],_0x3b7a22['name'],_0x3b7a22))['then'](_0x5c7428[_0xe320('0xb4')](_0x3b7a22[_0xe320('0x78')],_0x3b7a22['dialTimezone'],_0x3b7a22[_0xe320('0x48')],_0x3b7a22))[_0xe320('0x9f')](_0x5c7428[_0xe320('0xb5')](_0x3b7a22))['catch'](loggerCatchQueueSummary(_0xe320('0xb6'),_0x3b7a22));}else{notSendMessagesCampaign(_0x3b7a22);}}}};Dialer['prototype'][_0xe320('0xb7')]=function(_0x41dafd){if(_0x41dafd[_0xe320('0xb8')]!==_0xe320('0xa')){clearPredictiveAttributes(_0x41dafd);}switch(_0x41dafd['dialMethod']){case _0xe320('0xb9'):this[_0xe320('0xba')](_0x41dafd,0x1);break;case _0xe320('0xbb'):this[_0xe320('0xba')](_0x41dafd,_0x41dafd[_0xe320('0xbc')]);break;case _0xe320('0xa'):this['predictive'](_0x41dafd);break;case _0xe320('0x9'):this[_0xe320('0xba')](_0x41dafd,0x1);break;default:logger[_0xe320('0x66')](_0xe320('0xbd'),_0x41dafd[_0xe320('0x48')],_0xe320('0xbe'));}};Dialer[_0xe320('0x8d')][_0xe320('0x93')]=function(_0x267573,_0xfbe33e){var _0x16c3ae=_0x267573['dialTimezone'];var _0x4dd8d3=_0xfbe33e?_0x267573[_0xe320('0xb2')]:_0x267573[_0xe320('0x78')][_0xe320('0x7b')];logger[_0xe320('0xbf')]('Dialer::ifTime()',_0x4dd8d3,_0x16c3ae,_0x267573['name'],util[_0xe320('0x46')](_0xe320('0xc0'),_0x267573[_0xe320('0x48')],_0x267573['id']));var _0x54a141=null;return Interval[_0xe320('0xc1')](_0x4dd8d3,_0x16c3ae)[_0xe320('0x9f')](function(_0x143d61){if(_0x143d61===!![]){return _0x143d61;}else{_0x267573[_0xe320('0x6e')]=_0xfbe33e?utils['CAMPAIGN_STATUS'][_0xe320('0xa7')]:utils[_0xe320('0x6b')][_0xe320('0xa8')];_0x54a141=msgResponse(_0xe320('0xa9'),_0xe320('0x94'),_0xe320('0xaa')+_0xfbe33e+'\x20'+_0x267573[_0xe320('0x48')]+_0xe320('0xab')+util[_0xe320('0x68')](_0x4dd8d3,{'showHidden':![],'depth':null})+_0xe320('0xc2')+_0x16c3ae);}if(_0x54a141!==null){logger[_0xe320('0xbf')](_0xe320('0xc3'),_0x54a141);_0x54a141[_0xe320('0xc4')]=_0xfbe33e;throw _0x54a141;}})[_0xe320('0xa4')](function(_0x1000b9){logger['error'](_0xe320('0xc5'),_0x1000b9);throw msgResponse(_0xe320('0x86'),_0xe320('0xc6'),util['inspect'](_0x1000b9,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xe320('0xc7')]=function(_0x54990b){if(this[_0xe320('0x21')][_0x54990b[_0xe320('0xc8')]]){if(this[_0xe320('0x28')][_0x54990b['uniqueid']]&&this[_0xe320('0x28')][_0x54990b['uniqueid']][_0xe320('0xc9')]!==_0xe320('0xca')){this[_0xe320('0xcb')](this[_0xe320('0x21')][_0x54990b[_0xe320('0xc8')]]);this['uniqueId'][_0x54990b['uniqueid']][_0xe320('0xcc')]=moment()[_0xe320('0x46')](_0xe320('0xcd'));}}};Dialer[_0xe320('0x8d')]['syncAgentComplete']=function(_0x1d6268){var _0x5235d3=this[_0xe320('0x28')][_0x1d6268['uniqueid']];if(this[_0xe320('0x21')][_0x1d6268[_0xe320('0xc8')]]){if(_0x5235d3&&_0x5235d3['type']!==_0xe320('0xca')){delete this['uniqueId'][_0x1d6268[_0xe320('0xce')]];this[_0xe320('0x21')][_0x1d6268['queue']]['outboundAnswerCallsDay']+=0x1;var _0x176e22=new AgentComplete(_0x5235d3,_0x1d6268);if(_0x1d6268[_0xe320('0xcf')]===_0xe320('0xd0')){_0x176e22['agiafterat']=this[_0xe320('0x21')][_0x1d6268[_0xe320('0xc8')]][_0xe320('0xd1')]&&this[_0xe320('0x21')][_0x1d6268['queue']][_0xe320('0xd2')]?moment()[_0xe320('0x46')](_0xe320('0xcd')):undefined;}hopperUtils[_0xe320('0xd3')](_0x176e22)['catch'](loggerCatch(_0xe320('0xd4')));hopperUtils['moveContactManagedDialer'](_0x176e22)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xe320('0x8d')]['syncQueueCallerAbandon']=function(_0x55192f){var _0x4174d0=this['uniqueId'][_0x55192f[_0xe320('0xce')]];var _0x3ac9f3=this;var _0xfcd31=![];var _0x1c0cb1;var _0x66b03c;if(this[_0xe320('0x21')][_0x55192f['queue']]){if(_0x4174d0&&_0x4174d0['type']!==_0xe320('0xca')){delete this['uniqueId'][_0x55192f[_0xe320('0xce')]];this[_0xe320('0xcb')](this['voiceQueues'][_0x55192f[_0xe320('0xc8')]]);_0x4174d0[_0xe320('0xd5')]=moment()[_0xe320('0x46')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5af837=new QueueCallerAbandon(_0x4174d0,_0x55192f);if(utils['getSeconds'](_0x4174d0[_0xe320('0xd5')],_0x4174d0[_0xe320('0xd6')])>=_0x4174d0[_0xe320('0xd7')]){this[_0xe320('0x21')][_0x55192f[_0xe320('0xc8')]][_0xe320('0xd8')]+=0x1;this['voiceQueues'][_0x55192f[_0xe320('0xc8')]][_0xe320('0xd9')]+=0x1;this[_0xe320('0x21')][_0x55192f[_0xe320('0xc8')]][_0xe320('0xda')]+=0x1;_0x5af837[_0xe320('0xdb')]=0xa;_0x5af837[_0xe320('0x71')]=_0xe320('0xdc');_0x5af837[_0xe320('0xdd')]=_0xe320('0xde');_0x5af837[_0xe320('0xdf')]=this['voiceQueues'][_0x55192f['queue']][_0xe320('0xd1')]?moment()[_0xe320('0x46')](_0xe320('0xcd')):undefined;_0x5af837[_0xe320('0xe0')]+=0x1;_0x5af837[_0xe320('0xe1')]+=0x1;_0x1c0cb1=this[_0xe320('0x21')][_0x55192f['queue']]['dialDropRetryFrequency'];_0x66b03c=this[_0xe320('0x21')][_0x55192f[_0xe320('0xc8')]][_0xe320('0xe2')];hopperUtils[_0xe320('0xe3')](_0x5af837,_0x5af837[_0xe320('0xdb')],_0x4174d0[_0xe320('0xe4')])[_0xe320('0x9f')](function(_0x47be39){_0xfcd31=_0x47be39[_0xe320('0xe5')]==0x1;if(_0x5af837['countdropretry']>=_0x3ac9f3[_0xe320('0x21')][_0x55192f['queue']][_0xe320('0xe6')]){_0x3ac9f3[_0xe320('0xe7')](_0x5af837,_0x47be39[_0xe320('0xe5')]);}else{hopperUtils[_0xe320('0xe8')]({'active':![],'countdropretry':_0x5af837[_0xe320('0xe0')],'scheduledat':moment()[_0xe320('0xe9')](_0x3ac9f3[_0xe320('0x21')][_0x55192f[_0xe320('0xc8')]][_0xe320('0xea')],_0xe320('0xeb'))[_0xe320('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4174d0[_0xe320('0xec')],'ListId':_0x4174d0[_0xe320('0xed')],'VoiceQueueId':_0x4174d0[_0xe320('0xee')]||undefined,'CampaignId':_0x4174d0[_0xe320('0xef')]||undefined})['catch'](loggerCatch(_0xe320('0xf0')));var _0x366def=new History(_0x5af837);_0x366def[_0xe320('0xdb')]=0xa;_0x366def[_0xe320('0x71')]='Drop';_0x366def['starttime']=moment()[_0xe320('0x46')](_0xe320('0xcd'));_0x366def[_0xe320('0x72')]=_0x366def['starttime'];_0x366def['calleridname']=_0x5af837[_0xe320('0xf1')];_0x366def[_0xe320('0xf2')]=_0x5af837['calleridnum'];hopperUtils[_0xe320('0xd3')](_0x366def)[_0xe320('0xa4')](loggerCatch(_0xe320('0xf3')));}})[_0xe320('0x9f')](function(){if(_0xfcd31)hopperUtils[_0xe320('0xf4')](_0x5af837,_0x1c0cb1,_0x66b03c)['then'](function(){return 0x1;});});}else{this[_0xe320('0x21')][_0x55192f['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xe320('0x21')][_0x55192f[_0xe320('0xc8')]][_0xe320('0xf5')]+=0x1;_0x5af837[_0xe320('0xdb')]=0xb;_0x5af837[_0xe320('0x71')]=_0xe320('0xf6');_0x5af837[_0xe320('0xdd')]=_0xe320('0xf7');_0x5af837['countabandonedretry']+=0x1;_0x5af837['countglobal']+=0x1;_0x1c0cb1=this[_0xe320('0x21')][_0x55192f[_0xe320('0xc8')]][_0xe320('0xf8')];_0x66b03c=this[_0xe320('0x21')][_0x55192f['queue']][_0xe320('0xe2')];hopperUtils[_0xe320('0xe3')](_0x5af837,_0x5af837['state'],_0x4174d0['voiceQueue'])[_0xe320('0x9f')](function(_0x2d75aa){if(_0x5af837[_0xe320('0xf9')]>=_0x3ac9f3['voiceQueues'][_0x55192f[_0xe320('0xc8')]][_0xe320('0xfa')]){_0x3ac9f3['queueCallerAbandonCreateState'](_0x5af837,_0x2d75aa[_0xe320('0xe5')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x5af837[_0xe320('0xf9')],'scheduledat':moment()[_0xe320('0xe9')](_0x3ac9f3[_0xe320('0x21')][_0x55192f[_0xe320('0xc8')]][_0xe320('0xf8')],_0xe320('0xeb'))[_0xe320('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4174d0[_0xe320('0xec')],'ListId':_0x4174d0[_0xe320('0xed')],'VoiceQueueId':_0x4174d0[_0xe320('0xee')]||undefined,'CampaignId':_0x4174d0[_0xe320('0xef')]||undefined})[_0xe320('0xa4')](loggerCatch(_0xe320('0xfb')));var _0x4778cb=new History(_0x5af837);_0x4778cb['state']=0xb;_0x4778cb['statedesc']='Abandoned';_0x4778cb[_0xe320('0x73')]=moment()[_0xe320('0x46')](_0xe320('0xcd'));_0x4778cb['endtime']=_0x4778cb[_0xe320('0x73')];_0x4778cb[_0xe320('0xf1')]=_0x5af837[_0xe320('0xf1')];_0x4778cb['calleridnum']=_0x5af837[_0xe320('0xf2')];hopperUtils[_0xe320('0xd3')](_0x4778cb)[_0xe320('0xa4')](loggerCatch(_0xe320('0xfc')));}})[_0xe320('0x9f')](function(){if(_0xfcd31)hopperUtils[_0xe320('0xf4')](_0x5af837,_0x1c0cb1,_0x66b03c)[_0xe320('0x9f')](function(){return 0x1;});});}}}};Dialer[_0xe320('0x8d')][_0xe320('0x3b')]=function(_0x1fe123){if(this[_0xe320('0x27')][_0x1fe123['uniqueid']]){this[_0xe320('0x27')][_0x1fe123[_0xe320('0xce')]][_0xe320('0xfd')]=_0x1fe123[_0xe320('0xfd')];}if(this['uniqueId'][_0x1fe123[_0xe320('0xce')]]){this[_0xe320('0x28')][_0x1fe123[_0xe320('0xce')]][_0xe320('0xfd')]=_0x1fe123[_0xe320('0xfd')];}};Dialer[_0xe320('0x8d')][_0xe320('0x3d')]=function(_0x3fcfdd){if(!this['actions'][_0x3fcfdd[_0xe320('0xfe')]]){return;}var _0x58756d=this[_0xe320('0x21')][this[_0xe320('0x27')][_0x3fcfdd[_0xe320('0xfe')]][_0xe320('0xc8')]][_0xe320('0xff')]||'rrmemory';if(_0x58756d===_0xe320('0x100')){if(this[_0xe320('0x27')][_0x3fcfdd[_0xe320('0xfe')]]&&_[_0xe320('0x101')](this[_0xe320('0x27')][_0x3fcfdd['actionid']][_0xe320('0x102')])&&_0x3fcfdd[_0xe320('0x8a')]==='1'&&_0x3fcfdd[_0xe320('0x103')]==='0'){if(this['agents'][_0x3fcfdd[_0xe320('0x104')]]){if(!this[_0xe320('0x23')][_0x3fcfdd[_0xe320('0x104')]][_0xe320('0x102')]){this[_0xe320('0x23')][_0x3fcfdd['stateinterface']][_0xe320('0x102')]=!![];this[_0xe320('0x27')][_0x3fcfdd['actionid']][_0xe320('0x102')]=!![];this[_0xe320('0x27')][_0x3fcfdd['actionid']]['stateinterface']=_0x3fcfdd['stateinterface'];}}}}else if(_0x58756d===_0xe320('0x105')){if(this[_0xe320('0x27')][_0x3fcfdd[_0xe320('0xfe')]]){if(this[_0xe320('0x23')][_0x3fcfdd[_0xe320('0x104')]]){this[_0xe320('0x27')][_0x3fcfdd[_0xe320('0xfe')]][_0xe320('0x104')]=_0x3fcfdd[_0xe320('0x104')];if(_[_0xe320('0x101')](this['queueBooked'][this[_0xe320('0x27')][_0x3fcfdd[_0xe320('0xfe')]][_0xe320('0xc8')]])){this[_0xe320('0x2c')][this[_0xe320('0x27')][_0x3fcfdd[_0xe320('0xfe')]]['queue']]=[];}this[_0xe320('0x2c')][this['actions'][_0x3fcfdd['actionid']][_0xe320('0xc8')]][_0xe320('0x9a')](_[_0xe320('0x106')](_[_0xe320('0x77')](this['actions'][_0x3fcfdd[_0xe320('0xfe')]],[_0xe320('0x107'),_0xe320('0x104')]),{'status':_0x3fcfdd['status'],'paused':_0x3fcfdd['paused']}));}}}};Dialer[_0xe320('0x8d')][_0xe320('0x3e')]=function(_0x478a33){if(!this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]]){return;}var _0x1e13f2=this;var _0x46ce5b=this['voiceQueues'][this[_0xe320('0x27')][_0x478a33['actionid']][_0xe320('0xc8')]];var _0x536c06=_0x46ce5b['strategy']||_0xe320('0x105');if(_0x536c06==='roundrobin'){if(this[_0xe320('0x27')][_0x478a33['actionid']]&&this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0x104')]){this[_0xe320('0x20')][_0xe320('0x108')](this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]]['idHopper'],this[_0xe320('0x27')][_0x478a33['actionid']]['stateinterface'])['catch'](function(_0x53f811){logger[_0xe320('0x66')](_0xe320('0x109'),util[_0xe320('0x68')](_0x53f811,{'showHidden':![],'depth':null}));})[_0xe320('0x1e')](function(){_0x1e13f2[_0xe320('0xcb')](_0x1e13f2['voiceQueues'][_0x1e13f2[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0xc8')]]);_0x1e13f2[_0xe320('0x23')][_0x1e13f2[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0x104')]][_0xe320('0x102')]=![];delete _0x1e13f2[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]];unlockQueueStatus(_0x46ce5b);});}else{this[_0xe320('0xcb')](this['voiceQueues'][this['actions'][_0x478a33[_0xe320('0xfe')]]['queue']]);hopperUtils[_0xe320('0xe8')]({'active':![],'ContactId':this['actions'][_0x478a33[_0xe320('0xfe')]][_0xe320('0xec')],'ListId':this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]]['ListId'],'VoiceQueueId':this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0xee')]||undefined,'CampaignId':this[_0xe320('0x27')][_0x478a33['actionid']][_0xe320('0xef')]||undefined})[_0xe320('0xa4')](loggerCatch(_0xe320('0x10a')));delete this['actions'][_0x478a33[_0xe320('0xfe')]];unlockQueueStatus(_0x46ce5b);}}else if(_0x536c06===_0xe320('0x105')){var _0x4dd16c;if(this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]]&&!_[_0xe320('0x4a')](this[_0xe320('0x2c')][this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0xc8')]])){if(this[_0xe320('0x2d')][_0x1e13f2[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0xc8')]]){this[_0xe320('0x2d')][_0x1e13f2['actions'][_0x478a33[_0xe320('0xfe')]]['queue']]=this['queueBookedRR'][this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0xc8')]]?this[_0xe320('0x2d')][this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0xc8')]]:this[_0xe320('0x2c')][this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0xc8')]]?this['queueBooked'][this[_0xe320('0x27')][_0x478a33[_0xe320('0xfe')]][_0xe320('0xc8')]][_0xe320('0x10b')]||0x0:0x0;}this['queueBooked'][this[_0xe320('0x27')][_0x478a33['actionid']][_0xe320('0xc8')]][_0xe320('0x10b')]=this['queueBookedRR'][this['actions'][_0x478a33[_0xe320('0xfe')]]['queue']];for(var _0x16df6f=0x0;_0x16df6f=_0x2bb307[_0xe320('0x12f')]){_0x389a9a['stateGlobal'](_0x4115d4,_0x265e8a,_0x517661,'reason19\x20machine....');}else{if(_0x4115d4[_0xe320('0x129')]>=_0x2bb307[_0xe320('0x130')]){_0x389a9a[_0xe320('0x131')](_0x4115d4,_0x265e8a,_0x517661,_0xe320('0x132'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4115d4[_0xe320('0x129')],'scheduledat':moment()[_0xe320('0xe9')](_0x2bb307[_0xe320('0x133')],_0xe320('0xeb'))[_0xe320('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4115d4[_0xe320('0xec')],'ListId':_0x4115d4['ListId'],'VoiceQueueId':_0x4115d4[_0xe320('0xee')]||undefined,'CampaignId':_0x4115d4[_0xe320('0xef')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x265e8a({'reschedule':0x1});}}});}if(_0x277a40[_0xe320('0xc9')]===_0xe320('0xca')&&this[_0xe320('0x22')][_0x277a40['queue']][_0xe320('0x119')]&&_0x4d4326['value']===_0xe320('0x11b')){delete this[_0xe320('0x28')][_0x4d4326[_0xe320('0xce')]];this[_0xe320('0xcb')](this['campaigns'][_0x277a40[_0xe320('0xc8')]]);_0x31dd2c=new Hangup(_0x277a40,_0x4d4326);_0x31dd2c[_0xe320('0xdb')]=0x12;_0x31dd2c[_0xe320('0x71')]='HangupInAMD';_0x31dd2c[_0xe320('0x11f')]=_0xe320('0x120');ami[_0xe320('0x43')](_0xe320('0x121'),ut[_0xe320('0x122')](_0x31dd2c,'amd'));this[_0xe320('0x124')](_0x31dd2c,'[syncHangupInAMDIvr][createHistory]',_0xe320('0x134'));}if(_0x277a40[_0xe320('0xc9')]===_0xe320('0xca')&&this['campaigns'][_0x277a40[_0xe320('0xc8')]][_0xe320('0x119')]&&_0x4d4326[_0xe320('0x11a')]===_0xe320('0x127')){return new Promise(function(_0x30f51a,_0x5ecfba){delete _0x389a9a['uniqueId'][_0x4d4326[_0xe320('0xce')]];_0x389a9a['updateOriginated'](_0x389a9a['campaigns'][_0x277a40[_0xe320('0xc8')]]);_0x389a9a[_0xe320('0x22')][_0x277a40[_0xe320('0xc8')]][_0xe320('0x11c')]+=0x1;_0x389a9a[_0xe320('0x22')][_0x277a40['queue']][_0xe320('0x11d')]+=0x1;var _0x3bc0a6=_0x389a9a[_0xe320('0x22')][_0x277a40['queue']];var _0x1b595e=new Hangup(_0x277a40,_0x4d4326);_0x1b595e[_0xe320('0xdb')]=0x13;_0x1b595e['statedesc']=_0xe320('0x128');_0x1b595e['membername']=_0xe320('0x120');_0x1b595e[_0xe320('0x129')]+=0x1;_0x1b595e['countglobal']+=0x1;_0x1b595e['amd']=!![];ami[_0xe320('0x43')](_0xe320('0x121'),ut['buildObj'](_0x1b595e,_0xe320('0x123')));hopperUtils[_0xe320('0xd3')](_0x1b595e)[_0xe320('0xa4')](loggerCatch(_0xe320('0x135')));if(_0x1b595e[_0xe320('0x12a')]+_0x1b595e[_0xe320('0x12b')]+_0x1b595e['countnoanswerretry']+_0x1b595e[_0xe320('0x12d')]+_0x1b595e['countdropretry']+_0x1b595e['countabandonedretry']+_0x1b595e['countmachineretry']+_0x1b595e[_0xe320('0x12e')]>=_0x3bc0a6[_0xe320('0x12f')]){_0x389a9a[_0xe320('0x136')](_0x1b595e,_0x30f51a,_0x5ecfba,_0xe320('0x137'));}else{if(_0x1b595e[_0xe320('0x129')]>=_0x3bc0a6['dialMachineMaxRetry']){_0x389a9a[_0xe320('0x131')](_0x1b595e,_0x30f51a,_0x5ecfba,_0xe320('0x132'));}else{hopperUtils[_0xe320('0xe8')]({'active':![],'countmachineretry':_0x1b595e['countmachineretry'],'scheduledat':moment()[_0xe320('0xe9')](_0x3bc0a6[_0xe320('0x133')],_0xe320('0xeb'))[_0xe320('0x46')](_0xe320('0xcd')),'ContactId':_0x1b595e['ContactId'],'ListId':_0x1b595e[_0xe320('0xed')],'VoiceQueueId':_0x1b595e[_0xe320('0xee')]||undefined,'CampaignId':_0x1b595e[_0xe320('0xef')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x30f51a({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xe320('0x138')]=function(_0x401f1f){var _0x3ceff6=this['uniqueId'][_0x401f1f[_0xe320('0xce')]];var _0x57a200;if(_0x3ceff6&&_0x3ceff6[_0xe320('0xc9')]==='ivr'){delete this[_0xe320('0x28')][_0x401f1f['uniqueid']];this[_0xe320('0xcb')](this[_0xe320('0x22')][_0x3ceff6[_0xe320('0xc8')]]);this[_0xe320('0x22')][_0x3ceff6[_0xe320('0xc8')]][_0xe320('0x139')]+=0x1;_0x57a200=new Hangup(_0x3ceff6,_0x401f1f);hopperUtils['createHistory'](_0x57a200)[_0xe320('0xa4')](loggerCatch(_0xe320('0x13a')));hopperUtils[_0xe320('0x13b')](_0x57a200)[_0xe320('0xa4')](loggerCatch(_0xe320('0x13c')));}if(_0x3ceff6&&_0x3ceff6[_0xe320('0xc9')]!==_0xe320('0xca')&&isNotNull(this[_0xe320('0x21')][_0x3ceff6['queue']][_0xe320('0x13d')])){delete this['uniqueId'][_0x401f1f['uniqueid']];this[_0xe320('0xcb')](this[_0xe320('0x21')][_0x3ceff6['queue']]);this[_0xe320('0x21')][_0x3ceff6[_0xe320('0xc8')]][_0xe320('0x11c')]+=0x1;this[_0xe320('0x21')][_0x3ceff6[_0xe320('0xc8')]][_0xe320('0x11d')]+=0x1;_0x57a200=new Hangup(_0x3ceff6,_0x401f1f);_0x57a200['state']=0x10;_0x57a200['statedesc']=_0xe320('0x13e');_0x57a200[_0xe320('0x11f')]=_0xe320('0x13f');hopperUtils[_0xe320('0xd3')](_0x57a200)[_0xe320('0xa4')](loggerCatch(_0xe320('0x13a')));hopperUtils[_0xe320('0x13b')](_0x57a200)[_0xe320('0xa4')](loggerCatch(_0xe320('0x13c')));}if(_0x3ceff6&&_0x3ceff6[_0xe320('0xc9')]!==_0xe320('0xca')&&!isNotNull(this[_0xe320('0x21')][_0x3ceff6[_0xe320('0xc8')]][_0xe320('0x13d')])){if(_0x401f1f['cause-txt']===_0xe320('0x140')){delete this[_0xe320('0x28')][_0x401f1f['uniqueid']];this[_0xe320('0x21')][_0x3ceff6[_0xe320('0xc8')]][_0xe320('0x11c')]+=0x1;const _0x513bd5=new AgentComplete(_0x3ceff6,_0x401f1f);_0x513bd5[_0xe320('0xef')]=this[_0xe320('0x21')][_0x3ceff6[_0xe320('0xc8')]]['id'];hopperUtils[_0xe320('0xd3')](_0x513bd5)[_0xe320('0xa4')](loggerCatch(_0xe320('0xd4')));hopperUtils[_0xe320('0x13b')](_0x513bd5)[_0xe320('0xa4')](loggerCatch(_0xe320('0x141')));}else{delete this[_0xe320('0x28')][_0x401f1f[_0xe320('0xce')]];this[_0xe320('0xcb')](this['voiceQueues'][_0x3ceff6[_0xe320('0xc8')]]);this[_0xe320('0x21')][_0x3ceff6[_0xe320('0xc8')]][_0xe320('0x142')]+=0x1;_0x57a200=new Hangup(_0x3ceff6,_0x401f1f);_0x57a200[_0xe320('0xdb')]=0xc;_0x57a200[_0xe320('0x71')]=_0x401f1f[_0xe320('0x143')];_0x57a200[_0xe320('0x11f')]=_0xe320('0x144');hopperUtils['createHistory'](_0x57a200)[_0xe320('0xa4')](loggerCatch(_0xe320('0x13a')));hopperUtils['moveContactManagedDialer'](_0x57a200)[_0xe320('0xa4')](loggerCatch(_0xe320('0x13c')));}}};Dialer[_0xe320('0x8d')][_0xe320('0xb')]=function(_0x4f9d45){var _0x4c7c60=this;if(!_0x4c7c60[_0xe320('0x2e')][_0x4f9d45['name']]){_0x4c7c60[_0xe320('0x2e')][_0x4f9d45[_0xe320('0x48')]]={'running':![]};}else if(_0x4c7c60['queuesSummary'][_0x4f9d45[_0xe320('0x48')]][_0xe320('0x145')]===!![]){return;}else if(_0x4c7c60[_0xe320('0x2e')][_0x4f9d45[_0xe320('0x48')]][_0xe320('0x145')]===![]){_0x4c7c60['queuesSummary'][_0x4f9d45[_0xe320('0x48')]][_0xe320('0x145')]=!![];}var _0x5c33d4=_0x4c7c60[_0xe320('0x21')][_0x4f9d45[_0xe320('0x48')]];var _0x226df9=_0x5c33d4[_0xe320('0x6e')]!==utils[_0xe320('0x6b')][_0xe320('0x146')];var _0x4d5c67=utils['isPreviewCampaign'](_0x5c33d4);_0x5c33d4[_0xe320('0x147')]=utils['getQueueCampaignStatusMessage'](_0x5c33d4,_0x4c7c60[_0xe320('0x24')]);Promise[_0xe320('0x148')]()[_0xe320('0x9f')](function(){if(_0x5c33d4[_0xe320('0x147')]===utils[_0xe320('0x6b')][_0xe320('0x146')]){if(_0x226df9){clearPredictiveAttributes(_0x5c33d4);_0x4f9d45[_0xe320('0x2a')]=undefined;_0x4f9d45[_0xe320('0x61')]=undefined;}if(_0x5c33d4[_0xe320('0x147')]===utils[_0xe320('0x6b')]['INACTIVE']){_0x4f9d45['available']=0x0;_0x4f9d45[_0xe320('0x103')]=0x0;_0x4f9d45[_0xe320('0x149')]=0x0;_0x4f9d45[_0xe320('0x14a')]=0x0;_0x4f9d45[_0xe320('0x14b')]=0x0;}}else if(_0x5c33d4[_0xe320('0x147')]===utils[_0xe320('0x6b')][_0xe320('0x14c')]&&!_0x4d5c67){return _0x4c7c60[_0xe320('0x93')](_0x5c33d4,!![])[_0xe320('0x9f')](function(){return _0x4c7c60[_0xe320('0x93')](_0x5c33d4,![]);})[_0xe320('0x9f')](function(){return _0x4c7c60[_0xe320('0xb7')](_0x5c33d4);})[_0xe320('0xa4')](function(_0x3cbe9c){loggerSyncQueueSummary[_0xe320('0x44')](_0xe320('0x14d'),util[_0xe320('0x68')](_0x3cbe9c,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5c33d4);});}else{clearPredictiveAttributes(_0x5c33d4);}})[_0xe320('0x9f')](function(){var _0x53ff7e=_0x4f9d45['compareToOutboundQueue'](_0x5c33d4);if(_0x53ff7e||_0x5c33d4[_0xe320('0x14e')]){_0x5c33d4['queueSummaryCountersUpdated']=![];_0x4f9d45[_0xe320('0x14f')](_0x5c33d4);Object[_0xe320('0x150')](_0x5c33d4,_0x4f9d45);emitOutboundVoiceQueueSummary(_0x4f9d45);}_0x4c7c60[_0xe320('0x2e')][_0x5c33d4['name']]['running']=![];})[_0xe320('0xa4')](function(_0x34560e){logger[_0xe320('0x66')](_0xe320('0x14d'),util[_0xe320('0x68')](_0x34560e,{'showHidden':![],'depth':null}));_0x4c7c60[_0xe320('0x2e')][_0x5c33d4[_0xe320('0x48')]]['running']=![];});};Dialer[_0xe320('0x8d')][_0xe320('0x151')]=_[_0xe320('0x152')](function(){var _0x16c827=_[_0xe320('0x153')](this[_0xe320('0x21')],function(_0x5c693a){return _0x5c693a[_0xe320('0x154')];});var _0x5a0c3e=_[_0xe320('0x153')](this['agents'],function(_0x5f3c14){return _0x5f3c14[_0xe320('0x155')]&&_0x5f3c14[_0xe320('0x8a')]===_0xe320('0x8b');});if(_0x16c827[_0xe320('0x99')]>0x0&&_0x5a0c3e[_0xe320('0x99')]>0x0){return Promise[_0xe320('0x148')]()[_0xe320('0x9f')](cmHopper[_0xe320('0x156')](_[_0xe320('0x157')](_0x16c827,'id'),previewRecallmeReminderInterval,_[_0xe320('0x157')](_0x5a0c3e,'id')))['then'](function(_0x55ba55){for(var _0x703a0e=0x0;_0x703a0e<_0x55ba55[_0xe320('0x99')];_0x703a0e++){var _0x477dc3=_0x55ba55[_0x703a0e][_0xe320('0x158')][_0xe320('0x48')];if(_0x477dc3)io['to'](util['format']('user:%s',_0x477dc3))['emit'](_0xe320('0x159'),{'hopper':_0x55ba55[_0x703a0e]});}})['catch'](function(_0x2b78ed){logger[_0xe320('0x66')]('checkPreviewRecallReminder',_0x2b78ed);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xe320('0x3f')]=function(){var _0x4ec4b9=this;setInterval(function(){_0x4ec4b9[_0xe320('0x15a')](_0x4ec4b9['uniqueId'],_0xe320('0x15b'));_0x4ec4b9[_0xe320('0x15a')](_0x4ec4b9['actions'],'[actions]');},0x32c8);};Dialer[_0xe320('0x8d')]['clearZombieChannels']=function(_0x3ffe40,_0x37f3e1){var _0x2c3f3a=this;for(var _0x92757b in _0x3ffe40){if(typeof _0x3ffe40[_0x92757b]!==_0xe320('0xb0')){this[_0xe320('0x1f')][_0xe320('0x1c')](function(){if(!_[_0xe320('0x101')](_0x3ffe40[_0x92757b])){return ami['Action']({'action':_0xe320('0x8a'),'channel':_0x3ffe40[_0x92757b][_0xe320('0xfd')]})[_0xe320('0xa4')](function(_0x391333){if(_0x391333[_0xe320('0x6e')]===_0xe320('0x15c')){setTimeout(function(){if(_0x3ffe40[_0x92757b]&&_0x3ffe40[_0x92757b][_0xe320('0xc9')]!==_0xe320('0xca')){_0x2c3f3a['updateOriginated'](_0x2c3f3a[_0xe320('0x21')][_0x3ffe40[_0x92757b][_0xe320('0xc8')]]);logger[_0xe320('0x66')](_0xe320('0x15d'),_0x37f3e1,_0x92757b,_0x3ffe40[_0x92757b]['queue']);delete _0x3ffe40[_0x92757b];}if(_0x3ffe40[_0x92757b]&&_0x3ffe40[_0x92757b][_0xe320('0xc9')]==='ivr'){_0x2c3f3a[_0xe320('0xcb')](_0x2c3f3a[_0xe320('0x22')][_0x3ffe40[_0x92757b]['queue']]);logger[_0xe320('0x66')](_0xe320('0x15e'),_0x37f3e1,_0x92757b,_0x3ffe40[_0x92757b][_0xe320('0xc8')]);delete _0x3ffe40[_0x92757b];}},0x2328);}});}});}}};Dialer[_0xe320('0x8d')][_0xe320('0x15f')]=function(_0x348c98){return Promise[_0xe320('0x148')]()[_0xe320('0x9f')](voiceQueueRt[_0xe320('0x15f')](_0x348c98))[_0xe320('0xa4')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xe320('0x8d')][_0xe320('0xcb')]=function(_0x35fed6){if(!_[_0xe320('0x42')](_0x35fed6)&&_0x35fed6!==null){if(typeof _0x35fed6['originated']!==_0xe320('0xb0')){if(_0x35fed6[_0xe320('0x81')]>0x0){_0x35fed6['originated']-=0x1;}else{logger['error'](_0xe320('0x160'));}}}else{logger['error'](_0xe320('0x161'));}};Dialer['prototype'][_0xe320('0x162')]=function(_0x1f1e10,_0x17e88e){var _0x2ef8c0=this;return function(_0x31d675){_0x2ef8c0[_0xe320('0xcb')](_0x17e88e);logger[_0xe320('0x66')](_0x1f1e10,util[_0xe320('0x68')](_0x31d675,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x31300a,_0x486b41,_0x5cea4f){var _0x423a83={'state':0x19,'statedesc':_0xe320('0x163')};this['updateOriginated'](_0x486b41);this['saveInDb'](_['merge'](_0x423a83,_[_0xe320('0x77')](_0x5cea4f,[_0xe320('0xec'),_0xe320('0xed'),_0xe320('0x164'),_0xe320('0xee'),_0xe320('0xef')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0xe320('0x66')](_0x31300a);};Dialer[_0xe320('0x8d')][_0xe320('0x124')]=function(_0x45d0b5,_0xaa8c15,_0x2095bf){hopperUtils[_0xe320('0xd3')](_0x45d0b5)[_0xe320('0xa4')](loggerCatch(_0xaa8c15));hopperUtils[_0xe320('0x13b')](_0x45d0b5)[_0xe320('0xa4')](loggerCatch(_0x2095bf));};Dialer[_0xe320('0x8d')][_0xe320('0xe7')]=function(_0x571ac0,_0x1afa74){hopperUtils[_0xe320('0xd3')](_0x571ac0)['catch'](loggerCatch(_0xe320('0xd4')));if(_0x1afa74==0x0){hopperUtils[_0xe320('0x13b')](_0x571ac0)[_0xe320('0xa4')](loggerCatch(_0xe320('0x165')));}};Dialer['prototype'][_0xe320('0x166')]=function(_0x2134d3){return Promise[_0xe320('0x148')]()['then'](cmHopper[_0xe320('0x156')](_0x2134d3['id'],previewRecallmeReminderInterval))['then'](function(_0x1defdd){for(var _0x3def2c=0x0;_0x3def2c<_0x1defdd['length'];_0x3def2c++){var _0x4195ac=_0x1defdd[_0x3def2c][_0xe320('0x158')]['name'];if(_0x4195ac)io['to'](util['format'](_0xe320('0x167'),_0x4195ac))[_0xe320('0x43')](_0xe320('0x159'),{'hopper':_0x1defdd[_0x3def2c]});}})[_0xe320('0xa4')](function(){});};Dialer['prototype'][_0xe320('0xb5')]=function(_0x20c345){var _0x36e704=this;return function(){_0x36e704[_0xe320('0x168')](_0x20c345);};};Dialer[_0xe320('0x8d')][_0xe320('0x169')]=function(_0x2e8853,_0x5f31c6){var _0x13c9a4=this;var _0x350b8b=uuid['v4']();this[_0xe320('0x27')][_0x350b8b]=new Action(_0x2e8853,_0x5f31c6,_0x350b8b);return new Promise(function(_0xefb0e5,_0x158b18){if(_[_0xe320('0x42')](_0x2e8853)&&typeof _0x2e8853!==_0xe320('0x16a')){return _0x158b18(msgResponse('originate',_0xe320('0x94'),_0xe320('0x16b')));}if(_['isUndefined'](_0x5f31c6[_0xe320('0x16c')])||_0x5f31c6[_0xe320('0x16c')]===null){return _0x158b18(msgResponse(_0xe320('0x16d'),'Failure',_0xe320('0x16e')));}var _0x8eb8aa={'XMD-CALLERID':_0x13c9a4['actions'][_0x350b8b]['getCaller'](),'XMD-AGI':_0x2e8853[_0xe320('0x13d')]?util[_0xe320('0x46')](_0xe320('0x16f'),ipAgi,_0x2e8853[_0xe320('0x13d')]):_0xe320('0x170'),'XMD-AGIAFTER':_0x2e8853[_0xe320('0xd1')]?util[_0xe320('0x46')](_0xe320('0x16f'),ipAgi,_0x2e8853[_0xe320('0xd1')]):_0xe320('0x170'),'XMD-QUEUE':utils[_0xe320('0x171')](_0x2e8853)?util[_0xe320('0x46')]('\x22%s,%s%s,,,%s\x22',_0x2e8853['name'],_0x2e8853[_0xe320('0x172')]||'',_0x2e8853[_0xe320('0xd2')]?'c':'',_0x2e8853['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x5f31c6[_0xe320('0xec')],'XMD-CDRTYPE':_0xe320('0x8'),'CALLERID(all)':_0x13c9a4['actions'][_0x350b8b]['getCaller'](),'XMD-AMD':_0x2e8853['dialAMDActive']?_0xe320('0x14c'):_0xe320('0x170'),'XMD-DESTINATION':_0xe320('0x118')};if(_0x2e8853[_0xe320('0x119')]){_0x8eb8aa[_0xe320('0x173')]=_0x2e8853['dialAMDInitialSilence']||0x9c4;_0x8eb8aa[_0xe320('0x174')]=_0x2e8853[_0xe320('0x175')]||0x5dc;_0x8eb8aa[_0xe320('0x176')]=_0x2e8853['dialAMDAfterGreetingSilence']||0x320;_0x8eb8aa[_0xe320('0x177')]=_0x2e8853['dialAMDTotalAnalysisTime']||0x1388;_0x8eb8aa[_0xe320('0x178')]=_0x2e8853[_0xe320('0x179')]||0x64;_0x8eb8aa['XMD-AMDBETWEENWORDSSILENCE']=_0x2e8853[_0xe320('0x17a')]||0x32;_0x8eb8aa[_0xe320('0x17b')]=_0x2e8853[_0xe320('0x17c')]||0x3;_0x8eb8aa[_0xe320('0x17d')]=_0x2e8853['dialAMDSilenceThreshold']||0x100;_0x8eb8aa[_0xe320('0x17e')]=_0x2e8853[_0xe320('0x17f')]||0x1388;}if(utils[_0xe320('0x171')](_0x2e8853)){_0x8eb8aa[_0xe320('0x180')]=_0x5f31c6[_0xe320('0xee')];}else{_0x8eb8aa['XMD-CAMPAIGNID']=_0x5f31c6['CampaignId'];}var _0x309b04=utils[_0xe320('0x181')](_0x5f31c6[_0xe320('0x182')]);Object[_0xe320('0x150')](_0x8eb8aa,_0x309b04);var _0x33570c=_0x13c9a4[_0xe320('0x87')](_0x2e8853[_0xe320('0x183')])?utils[_0xe320('0x184')](_0x2e8853[_0xe320('0x183')]['callerid'],_0x2e8853[_0xe320('0x185')],_0x2e8853['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xe320('0x186')](_0x2e8853[_0xe320('0x187')],_0x2e8853['dialRandomLastDigitCallerIdNumber']):_0x2e8853[_0xe320('0x187')]):utils['getCallerId'](_[_0xe320('0x101')](_0x2e8853[_0xe320('0x8f')])?_0x2e8853['Trunk']['callerid']:_0x2e8853['TrunkBackup'][_0xe320('0x188')],_0x2e8853['dialOriginateCallerIdName'],_0x2e8853[_0xe320('0x189')]>0x0?utils[_0xe320('0x186')](_0x2e8853[_0xe320('0x187')],_0x2e8853[_0xe320('0x189')]):_0x2e8853[_0xe320('0x187')]);if(_0x33570c){_0x8eb8aa['XMD-ORIGINATECALLERIDNAME']=_0x13c9a4['actions'][_0x350b8b][_0xe320('0x18a')]=utils[_0xe320('0x18b')](_0x33570c);_0x8eb8aa[_0xe320('0x18c')]=_0x5f31c6[_0xe320('0x16c')];}_0x2e8853[_0xe320('0x18d')]=_0x8eb8aa;return ami[_0xe320('0x9b')]({'actionid':_0x350b8b,'action':_0xe320('0x16d'),'channel':_0x13c9a4[_0xe320('0x87')](_0x2e8853['Trunk'])?util['format']('SIP/%s/%s%s',_0x2e8853[_0xe320('0x183')][_0xe320('0x48')],isNotNull(_0x2e8853[_0xe320('0x18e')])?_0x2e8853['dialPrefix'][_0xe320('0x18f')]()||'':'',_0x2e8853['dialCutDigit']>0x0?_0x5f31c6[_0xe320('0x16c')][_0xe320('0x190')](_0x2e8853['dialCutDigit']):_0x5f31c6[_0xe320('0x16c')]):util[_0xe320('0x46')](_0xe320('0x191'),_[_0xe320('0x101')](_0x2e8853[_0xe320('0x8f')])?_0x2e8853[_0xe320('0x183')][_0xe320('0x48')]:_0x2e8853[_0xe320('0x8f')][_0xe320('0x48')],isNotNull(_0x2e8853['dialPrefix'])?_0x2e8853[_0xe320('0x18e')]['trim']()||'':'',_0x2e8853[_0xe320('0x192')]>0x0?_0x5f31c6['phone'][_0xe320('0x190')](_0x2e8853[_0xe320('0x192')]):_0x5f31c6[_0xe320('0x16c')]),'callerid':_0x33570c,'Exten':_0xe320('0x118'),'Context':_0xe320('0x193'),'Priority':'1','variable':_0x8eb8aa,'timeout':(_0x2e8853[_0xe320('0x194')]||0x1e)*0x3e8,'async':!![],'channelid':_0x350b8b})[_0xe320('0x9f')](function(_0x5aa14c){return _0xefb0e5(_0x5aa14c);})[_0xe320('0xa4')](function(_0x3af61c){_0x2e8853[_0xe320('0x195')]+=0x1;var _0x2ebcff=new History(_0x13c9a4[_0xe320('0x27')][_0x350b8b]);logger[_0xe320('0x66')](util[_0xe320('0x46')](_0xe320('0x196'),JSON[_0xe320('0xac')](_0x3af61c)));_0x2ebcff['state']=0xe;_0x2ebcff[_0xe320('0x71')]=_0xe320('0x197');_0x2ebcff[_0xe320('0x73')]=moment()[_0xe320('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ebcff[_0xe320('0x72')]=_0x2ebcff[_0xe320('0x73')];hopperUtils['createHistory'](_0x2ebcff)[_0xe320('0xa4')](loggerCatch(_0xe320('0x198')));_0x13c9a4[_0xe320('0x13b')](_0x2ebcff)['catch'](loggerCatch(_0xe320('0x198')))[_0xe320('0x1e')](function(){delete _0x13c9a4[_0xe320('0x27')][_0x350b8b];return _0x158b18(msgResponse(_0xe320('0x16d'),_0xe320('0xc6'),_0xe320('0x199')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x219b61,_0x3e9027,_0x382f7c){var _0x5312f9=new History(_0x3e9027);if(_0x5312f9[_0xe320('0x12a')]+_0x5312f9['countcongestionretry']+_0x5312f9[_0xe320('0x12c')]+_0x5312f9[_0xe320('0x12d')]+_0x5312f9[_0xe320('0xe0')]+_0x5312f9['countabandonedretry']+_0x5312f9[_0xe320('0x129')]+_0x5312f9[_0xe320('0x12e')]>=_0x382f7c[_0xe320('0x12f')]-0x1){return!![];}switch(_0x219b61){case 0x3:if(_0x5312f9[_0xe320('0x12c')]>=_0x382f7c[_0xe320('0x19a')]-0x1){return!![];}hopperUtils[_0xe320('0xe8')]({'active':![],'countnoanswerretry':_0x5312f9[_0xe320('0x12c')]+=0x1,'scheduledat':moment()[_0xe320('0xe9')](_0x382f7c[_0xe320('0x19b')],'minutes')[_0xe320('0x46')](_0xe320('0xcd')),'ContactId':_0x5312f9[_0xe320('0xec')],'ListId':_0x5312f9['ListId'],'VoiceQueueId':_0x5312f9[_0xe320('0xee')]||undefined,'CampaignId':_0x5312f9['CampaignId']||undefined})['catch'](loggerCatch(_0xe320('0x19c')));break;case 0x5:if(_0x5312f9[_0xe320('0x12a')]>=_0x382f7c[_0xe320('0x19d')]-0x1){return!![];}hopperUtils[_0xe320('0xe8')]({'active':![],'countbusyretry':_0x5312f9[_0xe320('0x12a')]+=0x1,'scheduledat':moment()[_0xe320('0xe9')](_0x382f7c[_0xe320('0x19e')],_0xe320('0xeb'))[_0xe320('0x46')](_0xe320('0xcd')),'ContactId':_0x5312f9['ContactId'],'ListId':_0x5312f9[_0xe320('0xed')],'VoiceQueueId':_0x5312f9[_0xe320('0xee')]||undefined,'CampaignId':_0x5312f9[_0xe320('0xef')]||undefined})[_0xe320('0xa4')](loggerCatch(_0xe320('0x19f')));break;case 0x8:if(_0x5312f9[_0xe320('0x12b')]>=_0x382f7c[_0xe320('0x1a0')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x5312f9['countcongestionretry']+=0x1,'scheduledat':moment()[_0xe320('0xe9')](_0x382f7c['dialCongestionRetryFrequency'],_0xe320('0xeb'))['format'](_0xe320('0xcd')),'ContactId':_0x5312f9['ContactId'],'ListId':_0x5312f9[_0xe320('0xed')],'VoiceQueueId':_0x5312f9[_0xe320('0xee')]||undefined,'CampaignId':_0x5312f9[_0xe320('0xef')]||undefined})[_0xe320('0xa4')](loggerCatch(_0xe320('0x1a1')));break;case 0x0:if(_0x5312f9[_0xe320('0x12d')]>=_0x382f7c[_0xe320('0x1a2')]-0x1){return!![];}else{hopperUtils[_0xe320('0xe8')]({'active':![],'countnosuchnumberretry':_0x5312f9[_0xe320('0x12d')]+=0x1,'scheduledat':moment()[_0xe320('0xe9')](_0x382f7c[_0xe320('0x1a3')],_0xe320('0xeb'))['format'](_0xe320('0xcd')),'ContactId':_0x5312f9[_0xe320('0xec')],'ListId':_0x5312f9[_0xe320('0xed')],'VoiceQueueId':_0x5312f9[_0xe320('0xee')]||undefined,'CampaignId':_0x5312f9[_0xe320('0xef')]||undefined})[_0xe320('0xa4')](loggerCatch(_0xe320('0x1a4')));}break;case 0xa:if(_0x5312f9[_0xe320('0xe0')]>=_0x382f7c[_0xe320('0xe6')]-0x1){return!![];}hopperUtils[_0xe320('0xe8')]({'active':![],'countdropretry':_0x5312f9[_0xe320('0xe0')]+=0x1,'scheduledat':moment()[_0xe320('0xe9')](_0x382f7c[_0xe320('0xea')],_0xe320('0xeb'))[_0xe320('0x46')](_0xe320('0xcd')),'ContactId':_0x5312f9['ContactId'],'ListId':_0x5312f9['ListId'],'VoiceQueueId':_0x5312f9['VoiceQueueId']||undefined,'CampaignId':_0x5312f9[_0xe320('0xef')]||undefined})[_0xe320('0xa4')](loggerCatch(_0xe320('0xf0')));break;case 0xb:if(_0x5312f9['countabandonedretry']>=_0x382f7c[_0xe320('0xfa')]-0x1){return!![];}hopperUtils[_0xe320('0xe8')]({'active':![],'countabandonedretry':_0x5312f9[_0xe320('0xf9')]+=0x1,'scheduledat':moment()[_0xe320('0xe9')](_0x382f7c[_0xe320('0xf8')],_0xe320('0xeb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5312f9[_0xe320('0xec')],'ListId':_0x5312f9[_0xe320('0xed')],'VoiceQueueId':_0x5312f9[_0xe320('0xee')]||undefined,'CampaignId':_0x5312f9[_0xe320('0xef')]||undefined})[_0xe320('0xa4')](loggerCatch(_0xe320('0xfb')));break;case 0x13:if(_0x5312f9[_0xe320('0x129')]>=_0x382f7c[_0xe320('0x130')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5312f9[_0xe320('0x129')]+=0x1,'scheduledat':moment()['add'](_0x382f7c[_0xe320('0x133')],_0xe320('0xeb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5312f9[_0xe320('0xec')],'ListId':_0x5312f9[_0xe320('0xed')],'VoiceQueueId':_0x5312f9[_0xe320('0xee')]||undefined,'CampaignId':_0x5312f9['CampaignId']||undefined})['catch'](loggerCatch(_0xe320('0x1a5')));break;case 0x14:if(_0x5312f9[_0xe320('0x12e')]>=_0x382f7c[_0xe320('0x1a6')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x5312f9[_0xe320('0x12e')]+=0x1,'scheduledat':moment()[_0xe320('0xe9')](_0x382f7c[_0xe320('0x1a7')],'minutes')[_0xe320('0x46')](_0xe320('0xcd')),'ContactId':_0x5312f9[_0xe320('0xec')],'ListId':_0x5312f9['ListId'],'VoiceQueueId':_0x5312f9[_0xe320('0xee')]||undefined,'CampaignId':_0x5312f9[_0xe320('0xef')]||undefined})[_0xe320('0xa4')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xe320('0x8d')][_0xe320('0x1a8')]=function(_0x4df889,_0x27356d,_0x30dffc){var _0x55ed7a=this;var _0x2dabef=new History(_0x4df889);var _0xbc3792=![];var _0x4277c6;var _0x2a16fa;return new Promise(function(_0x13863c,_0x4d78a8){if(_[_0xe320('0x42')](_0x27356d)&&typeof _0x27356d!==_0xe320('0x16a')){return _0x4d78a8(msgResponse(_0xe320('0x1a9'),_0xe320('0x94'),_0xe320('0x1aa')));}if(_[_0xe320('0x42')](_0x30dffc)&&typeof _0x30dffc!=='object'){return _0x4d78a8(msgResponse(_0xe320('0x1a9'),_0xe320('0x94'),_0xe320('0x1ab')));}hopperUtils[_0xe320('0xe3')](_0x2dabef,_0x30dffc[_0xe320('0xcf')],_0x27356d)[_0xe320('0x9f')](function(_0x4cef3d){if(_0x4cef3d[_0xe320('0xe5')]==0x1)_0xbc3792=!![];switch(_0x30dffc[_0xe320('0xcf')]){case'0':_0x27356d['outboundNoSuchCallsDay']+=0x1;_0x2dabef[_0xe320('0xdb')]=0x0;_0x2dabef[_0xe320('0x71')]=_0xe320('0x1ac');_0x2dabef[_0xe320('0x12d')]+=0x1;_0x2dabef[_0xe320('0xe1')]+=0x1;ami[_0xe320('0x43')]('custom:agentnosuchnumber',ut[_0xe320('0x122')](_0x4df889,_0xe320('0x1ad')));_0x4277c6=_0x27356d[_0xe320('0x1a3')];_0x2a16fa=_0x27356d['callAdditionalPhoneAfterMin'];hopperUtils[_0xe320('0xd3')](_0x2dabef)[_0xe320('0xa4')](loggerCatch(_0xe320('0x135')));if(_0x55ed7a['checkRetriveMax'](0x0,_0x4df889,_0x27356d)&&!_0xbc3792){if(_0x2dabef[_0xe320('0x12d')]>=_0x27356d['dialNoSuchNumberMaxRetry']){_0x55ed7a[_0xe320('0x131')](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1ae'));}else{_0x55ed7a[_0xe320('0x136')](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1ae'));}}break;case'3':_0x27356d[_0xe320('0x1af')]+=0x1;_0x2dabef[_0xe320('0xdb')]=0x3;_0x2dabef['statedesc']='NoAnswer';_0x2dabef[_0xe320('0x12c')]+=0x1;_0x2dabef[_0xe320('0xe1')]+=0x1;var _0x2bf975=ut[_0xe320('0x1b0')](_0x4df889,_0x27356d);ami['emit']('custom:agentnoanswer',_0x2bf975);_0x4277c6=_0x27356d[_0xe320('0x19b')];_0x2a16fa=_0x27356d[_0xe320('0xe2')];hopperUtils[_0xe320('0xd3')](_0x2dabef)[_0xe320('0xa4')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x55ed7a[_0xe320('0x1b1')](0x3,_0x4df889,_0x27356d)&&!_0xbc3792){if(_0x2dabef[_0xe320('0x12c')]>=_0x27356d[_0xe320('0x19a')]){_0x55ed7a[_0xe320('0x131')](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1b2'));}else{_0x55ed7a[_0xe320('0x136')](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1b2'));}}break;case'5':_0x27356d[_0xe320('0x1b3')]+=0x1;_0x2dabef['state']=0x5;_0x2dabef['statedesc']=_0xe320('0x1b4');_0x2dabef[_0xe320('0x12a')]+=0x1;_0x2dabef[_0xe320('0xe1')]+=0x1;ami[_0xe320('0x43')](_0xe320('0x1b5'),ut[_0xe320('0x122')](_0x4df889,_0xe320('0x1b6')));_0x4277c6=_0x27356d[_0xe320('0x19e')];_0x2a16fa=_0x27356d['callAdditionalPhoneAfterMin'];hopperUtils[_0xe320('0xd3')](_0x2dabef)[_0xe320('0xa4')](loggerCatch(_0xe320('0x1b7')));if(_0x55ed7a['checkRetriveMax'](0x5,_0x4df889,_0x27356d)&&!_0xbc3792){if(_0x2dabef[_0xe320('0x12a')]>=_0x27356d[_0xe320('0x19d')]){_0x55ed7a['createStateFinal'](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1b8'));}else{_0x55ed7a[_0xe320('0x136')](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1b8'));}}break;case'8':_0x27356d[_0xe320('0x1b9')]+=0x1;_0x2dabef['state']=0x8;_0x2dabef[_0xe320('0x71')]='Congestion';_0x2dabef[_0xe320('0x12b')]+=0x1;_0x2dabef['countglobal']+=0x1;_0x4277c6=_0x27356d[_0xe320('0x1ba')];_0x2a16fa=_0x27356d[_0xe320('0xe2')];ami[_0xe320('0x43')]('custom:agentcongestion',ut['buildObj'](_0x4df889,_0xe320('0x1bb')));hopperUtils[_0xe320('0xd3')](_0x2dabef)['catch'](loggerCatch(_0xe320('0x1bc')));if(_0x55ed7a[_0xe320('0x1b1')](0x8,_0x4df889,_0x27356d)&&!_0xbc3792){if(_0x2dabef['countcongestionretry']>=_0x27356d[_0xe320('0x1a0')]){_0x55ed7a['createStateFinal'](_0x2dabef,_0x13863c,_0x4d78a8,'reason\x208\x20congestion');}else{_0x55ed7a[_0xe320('0x136')](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1bd'));}}break;case'11':_0x27356d['outboundAbandonedCallsDay']+=0x1;_0x2dabef[_0xe320('0xdb')]=0xb;_0x2dabef[_0xe320('0x71')]=_0xe320('0xf6');_0x2dabef['countabandonedretry']+=0x1;_0x2dabef[_0xe320('0xe1')]+=0x1;_0x4277c6=_0x27356d['dialAbandonedRetryFrequency'];_0x2a16fa=_0x27356d['callAdditionalPhoneAfterMin'];hopperUtils[_0xe320('0xd3')](_0x2dabef)[_0xe320('0xa4')](loggerCatch(_0xe320('0xfc')));if(_0x55ed7a[_0xe320('0x1b1')](0xb,_0x4df889,_0x27356d)&&!_0xbc3792){if(_0x2dabef['countabandonedretry']>=_0x27356d[_0xe320('0xfa')]){_0x55ed7a[_0xe320('0x131')](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1be'));}else{_0x55ed7a[_0xe320('0x136')](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1be'));}}break;case'20':_0x27356d[_0xe320('0x1bf')]+=0x1;_0x2dabef[_0xe320('0xdb')]=0x14;_0x2dabef[_0xe320('0x71')]=_0xe320('0x1c0');_0x2dabef[_0xe320('0x12e')]+=0x1;_0x2dabef[_0xe320('0xe1')]+=0x1;_0x4277c6=_0x27356d[_0xe320('0x1a7')];_0x2a16fa=_0x27356d[_0xe320('0xe2')];ami[_0xe320('0x43')]('custom:agentreject',ut[_0xe320('0x122')](_0x4df889,'agentreject'));hopperUtils[_0xe320('0xd3')](_0x2dabef)[_0xe320('0xa4')](loggerCatch(_0xe320('0x1c1')));if(_0x55ed7a[_0xe320('0x1b1')](0x14,_0x4df889,_0x27356d)&&!_0xbc3792){if(_0x2dabef[_0xe320('0x12e')]>=_0x27356d[_0xe320('0x1a6')]){_0x55ed7a['createStateFinal'](_0x2dabef,_0x13863c,_0x4d78a8,_0xe320('0x1c2'));}else{_0x55ed7a['stateGlobal'](_0x2dabef,_0x13863c,_0x4d78a8,'reason\x2020\x20agentreject');}}break;default:_0x27356d[_0xe320('0x142')]+=0x1;_0x2dabef[_0xe320('0xdb')]=0xc;_0x2dabef[_0xe320('0x71')]=_0x30dffc[_0xe320('0xcf')];_0x4277c6=_0x27356d[_0xe320('0x1a7')];_0x2a16fa=_0x27356d[_0xe320('0xe2')];hopperUtils[_0xe320('0xd3')](_0x2dabef)[_0xe320('0xa4')](loggerCatch(_0xe320('0x1c3')));if(_0x55ed7a[_0xe320('0x1b1')](_0x30dffc[_0xe320('0xcf')],_0x4df889,_0x27356d)&&!_0xbc3792){if(_0x2dabef[_0xe320('0x12a')]+_0x2dabef['countcongestionretry']+_0x2dabef[_0xe320('0x12c')]+_0x2dabef[_0xe320('0x12d')]+_0x2dabef[_0xe320('0xe0')]+_0x2dabef[_0xe320('0xf9')]+_0x2dabef[_0xe320('0x129')]+_0x2dabef['countagentrejectretry']>=_0x27356d['dialGlobalMaxRetry']){_0x55ed7a['stateGlobal'](_0x2dabef,_0x13863c,_0x4d78a8,_0x30dffc[_0xe320('0xcf')]);}else{_0x55ed7a[_0xe320('0x131')](_0x2dabef,_0x13863c,_0x4d78a8,_0x30dffc['reason']);}}}})[_0xe320('0x9f')](function(){if(_0xbc3792){hopperUtils['swapAdditionalPhones'](_0x2dabef,_0x4277c6,_0x2a16fa)[_0xe320('0x9f')](function(){return _0x13863c(0x1);});}});});};Dialer['prototype'][_0xe320('0x136')]=function(_0x35778b,_0x5b47d1,_0x2807cb,_0x336287){var _0x169a4c=new Final(_0x35778b);_0x169a4c[_0xe320('0xdb')]=0xf;_0x169a4c[_0xe320('0x71')]=_0xe320('0x1c4');this[_0xe320('0x131')](_0x169a4c,_0x5b47d1,_0x2807cb,_0x336287);};Dialer[_0xe320('0x8d')][_0xe320('0x131')]=function(_0x116153,_0x43989a,_0x379620,_0xc36979){hopperUtils['moveContactManagedDialer'](_0x116153)[_0xe320('0x9f')](function(){return _0x43989a(msgResponse(_0xe320('0x1a9'),'Success',_0xc36979));})['catch'](function(){return _0x379620(msgResponse(_0xe320('0x1c5'),_0xe320('0x94'),'contact\x20not\x20moved'));});};Dialer[_0xe320('0x8d')][_0xe320('0xa')]=function(_0x20853d){var _0x4f5db6=_0x20853d[_0xe320('0x1c6')]/0x64;var _0x4fce01=_0x20853d[_0xe320('0xd9')]/(_0x20853d[_0xe320('0xd9')]+_0x20853d['outboundAnswerCallsDay']);var _0x2f38fe=Math['round'](_0x20853d['predictiveIntervalAvailable']*(_0x20853d[_0xe320('0x1c7')]/0x64));var _0x4119da=Math['round'](_0x20853d['predictiveIntervalAvailable']*(_0x20853d[_0xe320('0x1c8')]/0x64));var _0x54a9f5=_0x20853d[_0xe320('0x1c9')]+_0x20853d[_0xe320('0x14a')];var _0x2a60a2=Math['floor'](_0x20853d['erlangCalls']*_0x20853d[_0xe320('0x5c')]*_0x20853d[_0xe320('0x1ca')]*_0x20853d[_0xe320('0x1cb')]);if(_[_0xe320('0x42')](_0x20853d[_0xe320('0x61')])){if(!_[_0xe320('0x42')](_0x20853d[_0xe320('0x2a')])){_0x20853d[_0xe320('0x2a')]=undefined;loggerPredictive[_0xe320('0x66')](_0xe320('0x1cc'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x20853d[_0xe320('0x64')])){loggerPredictive[_0xe320('0x66')](_0xe320('0x1cc'),_0xe320('0x1cd'));clearInterval(_0x20853d[_0xe320('0x64')]);_0x20853d[_0xe320('0x64')]=undefined;}_0x20853d[_0xe320('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xe320('0x4b')](_0x20853d['name'],_0xe320('0x1ce'),_0x20853d[_0xe320('0x61')]);this[_0xe320('0xba')](_0x20853d,0x1);}else if(ifInterval(_0x20853d[_0xe320('0x1cf')],_0x20853d[_0xe320('0x61')])){this[_0xe320('0xba')](_0x20853d,0x1);loggerPredictiveCalls[_0xe320('0x4b')](_0xe320('0x1d0'),_0x20853d[_0xe320('0x61')],_0x20853d[_0xe320('0x48')]);_0x20853d[_0xe320('0x59')]=0x0;_0x20853d['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4f5db6<_0x4fce01&&_0x20853d[_0xe320('0x1d1')]===_0xe320('0x1d2')){clearPredictiveAttributes(_0x20853d);loggerPredictive['info'](_0xe320('0x1d3'),_0xe320('0x1d4'),_0x4fce01,_0xe320('0x61'),_0x20853d[_0xe320('0x48')]);}else if(_0x2a60a2<_0x20853d[_0xe320('0xda')]&&_0x20853d[_0xe320('0x1d1')]===_0xe320('0x1d2')){clearPredictiveAttributes(_0x20853d);loggerPredictive[_0xe320('0x4b')](_0xe320('0x1d5'),_0xe320('0x1d6'),_0x2a60a2,_0xe320('0x1d7'),_0x20853d[_0xe320('0xda')],'startProgressive',_0x20853d[_0xe320('0x48')]);}else if(!ifInterval(_0x20853d[_0xe320('0x1cf')],_0x20853d[_0xe320('0x61')])&&_[_0xe320('0x42')](_0x20853d[_0xe320('0x2a')])&&!_[_0xe320('0x42')](_0x20853d[_0xe320('0x61')])){_0x20853d[_0xe320('0x2a')]=moment()[_0xe320('0x46')](_0xe320('0xcd'));loggerPredictive[_0xe320('0x4b')](_0x20853d[_0xe320('0x48')],'started\x20in\x20predictive\x20at',_0x20853d[_0xe320('0x2a')]);hopperUtils[_0xe320('0x1d8')](_0x20853d[_0xe320('0x1cf')])[_0xe320('0x9f')](this[_0xe320('0x1d9')](_0x20853d))[_0xe320('0x9f')](mergeDataErlangB(_0x20853d))[_0xe320('0x9f')](this[_0xe320('0x1da')](_0x20853d))['catch'](loggerCatchPredictive(_0xe320('0x1db'),_0x20853d));}else if(!ifInterval(_0x20853d['dialPredictiveInterval'],_0x20853d[_0xe320('0x2a')])){_0x20853d[_0xe320('0xda')]=0x0;_0x20853d[_0xe320('0x2a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xe320('0x4b')](_0x20853d['name'],_0xe320('0x1dc'),_0x20853d[_0xe320('0x2a')]);clearInterval(_0x20853d[_0xe320('0x64')]);_0x20853d[_0xe320('0x64')]=undefined;hopperUtils['avgHandleTime'](_0x20853d[_0xe320('0x1cf')])[_0xe320('0x9f')](this[_0xe320('0x1d9')](_0x20853d))[_0xe320('0x9f')](mergeDataErlangB(_0x20853d))['then'](this[_0xe320('0x1da')](_0x20853d))[_0xe320('0xa4')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x20853d));}else if(_0x20853d['predictiveIntervalAvailable']&&_0x54a9f5<_0x20853d[_0xe320('0x1dd')]-_0x4119da){clearPredictiveAttributes(_0x20853d);loggerPredictive[_0xe320('0x4b')](_0x20853d[_0xe320('0x48')],_0xe320('0x1de'),_0x54a9f5,_0xe320('0x1df'),_0x20853d[_0xe320('0x1dd')],'-',_0x4119da,'=',_0x20853d[_0xe320('0x1dd')]-_0x4119da,')');}else if(_0x20853d[_0xe320('0x1dd')]&&_0x54a9f5>_0x20853d[_0xe320('0x1dd')]+_0x2f38fe){clearPredictiveAttributes(_0x20853d);loggerPredictive[_0xe320('0x4b')](_0x20853d[_0xe320('0x48')],_0xe320('0x1de'),_0x54a9f5,')\x20are\x20more\x20than\x20threshold\x20(',_0x20853d['predictiveIntervalAvailable'],'+',_0x2f38fe,'=',_0x20853d[_0xe320('0x1dd')]+_0x2f38fe,')');}};Dialer[_0xe320('0x8d')][_0xe320('0x1d9')]=function(_0x11a9b8){var _0x13ada8=this;return function(_0x24747a){return new Promise(function(_0x2016d6,_0x42329d){_[_0xe320('0x106')](_0x11a9b8,_0x24747a[0x0]);if(checkGetDataPredictive(_0x24747a[0x0])){var _0x50c45e=_0x11a9b8['predictiveIntervalAvailable']=_0x11a9b8[_0xe320('0x14a')]+_0x11a9b8[_0xe320('0x1c9')];var _0x200deb=_0x11a9b8[_0xe320('0x1cf')]*0x3c;var _0x402a5b=_0x24747a[0x0][_0xe320('0x54')]+_0x24747a[0x0][_0xe320('0x56')];var _0x3cfa15=(_0x24747a[0x0]['predictiveIntervalAnsweredCalls']+_0x24747a[0x0][_0xe320('0xd8')]+_0x24747a[0x0][_0xe320('0x1e0')])/_0x24747a[0x0][_0xe320('0x4e')];_0x11a9b8[_0xe320('0x1ca')]=_0x3cfa15>0x0?_0x3cfa15:0x1;switch(_0x11a9b8[_0xe320('0x1d1')]){case _0xe320('0x1d2'):var _0x3b5e26=_0x11a9b8[_0xe320('0x1c6')]/0x64;return _0x13ada8['abandonmentRate'](_0x50c45e,_0x200deb,_0x402a5b,_0x3cfa15,_0x3b5e26)[_0xe320('0x9f')](function(_0x39e300){return _0x2016d6(_0x39e300);});case _0xe320('0x1e1'):var _0x20d3c2=_0x11a9b8[_0xe320('0x1c6')]/0x64;return _0x13ada8[_0xe320('0x1e2')](_0x50c45e,_0x200deb,_0x402a5b,_0x3cfa15,_0x20d3c2)['then'](function(_0x6488aa){return _0x2016d6(_0x6488aa);});default:return _0x42329d(msgResponse(_0xe320('0x1e3'),'Failure','Unknown\x20Predictive'));}}else{return _0x42329d(msgResponse('[getDataPredictive]',_0xe320('0x94'),_0xe320('0x1e4')));}});};};Dialer['prototype'][_0xe320('0x1e5')]=function(_0xb493d3){var _0x392626=this;return function(_0x3056da){return new Promise(function(_0x2152b3,_0x630473){_[_0xe320('0x106')](_0xb493d3,_0x3056da[0x0]);if(checkGetDataPredictive(_0x3056da[0x0])){loggerPredictive['info'](JSON[_0xe320('0xac')](_0x3056da[0x0]));if(_0xb493d3[_0xe320('0x1d1')]===_0xe320('0x1d2')){return _0x392626['getVoiceQueueRtPauses'](_0xb493d3['id'])[_0xe320('0x9f')](function(_0x31f93a){var _0x5b8d14=_0xb493d3[_0xe320('0x1e6')]-_0x31f93a[0x0][_0xe320('0x1e7')];var _0xce7055=_0xb493d3[_0xe320('0x1cf')]*0x3c;var _0x4d2525=_0x3056da[0x0]['predictiveIntervalAvgTalktime']+_0x3056da[0x0]['predictiveIntervalAvgHoldtime'];var _0x1843df=(_0x3056da[0x0]['predictiveIntervalAnsweredCalls']+_0x3056da[0x0][_0xe320('0xd8')]+_0x3056da[0x0][_0xe320('0x1e0')])/_0x3056da[0x0][_0xe320('0x4e')];var _0x28440d=_0xb493d3[_0xe320('0x1c6')]/0x64;_0xb493d3['predictiveIntervalPauses']=_0x31f93a[0x0]['outboundQueuePauses']||0x0;_0xb493d3[_0xe320('0x1ca')]=_0x1843df>0x0?_0x1843df:0x1;return _0x392626[_0xe320('0x1e8')](_0x5b8d14,_0xce7055,_0x4d2525,_0x1843df,_0x28440d);})['then'](function(_0x140a85){return _0x2152b3(_0x140a85);})[_0xe320('0xa4')](function(_0x5f256e){return _0x630473(msgResponse(_0xe320('0x1e9'),_0xe320('0x94'),JSON[_0xe320('0xac')](_0x5f256e)));});}if(_0xb493d3['dialPredictiveOptimization']===_0xe320('0x1e1')){return _0x392626[_0xe320('0x15f')](_0xb493d3['id'])[_0xe320('0x9f')](function(_0x2c2b98){var _0xe92c6c=_0xb493d3['loggedIn']-_0x2c2b98[0x0]['outboundQueuePauses'];var _0x2cb06d=_0xb493d3[_0xe320('0x1cf')]*0x3c;var _0x5ea546=_0x3056da[0x0][_0xe320('0x54')]+_0x3056da[0x0][_0xe320('0x56')];var _0x4d1e5a=(_0x3056da[0x0][_0xe320('0x4f')]+_0x3056da[0x0][_0xe320('0xd8')]+_0x3056da[0x0][_0xe320('0x1e0')])/_0x3056da[0x0][_0xe320('0x4e')];var _0x356d3e=_0xb493d3[_0xe320('0x1c6')]/0x64;_0xb493d3[_0xe320('0x1ea')]=_0x2c2b98[0x0][_0xe320('0x1e7')]||0x0;_0xb493d3[_0xe320('0x1ca')]=_0x4d1e5a>0x0?_0x4d1e5a:0x1;return _0x392626[_0xe320('0x1e2')](_0xe92c6c,_0x2cb06d,_0x5ea546,_0x4d1e5a,_0x356d3e);})['then'](function(_0xdac5c0){return _0x2152b3(_0xdac5c0);})[_0xe320('0xa4')](function(_0x22f33a){return _0x630473(msgResponse(_0xe320('0x1e9'),'Failure',JSON[_0xe320('0xac')](_0x22f33a)));});}}else{return _0x630473(msgResponse(_0xe320('0x1e3'),_0xe320('0x94'),_0xe320('0x1e4')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x43e156){var _0x2b4773=this;return function(){var _0x38c565=0x0;var _0x3260c6=Math[_0xe320('0x1eb')](_0x43e156[_0xe320('0x5b')]*0x3e8);if(_0x3260c6>0x0){_0x3260c6=_0x3260c6<0x64?0x64:_0x3260c6;loggerPredictive[_0xe320('0x4b')](_0x43e156[_0xe320('0x48')],_0xe320('0x1ec'),_0x3260c6,'milliseconds');_0x43e156[_0xe320('0x64')]=setInterval(function(){_0x2b4773['handlePredictive'](_0x43e156);loggerPredictiveCalls['info'](_0xe320('0x1ed'),_0x38c565+=0x1);},_0x3260c6);}else{loggerPredictive[_0xe320('0x4b')](_0x43e156[_0xe320('0x48')],_0xe320('0x1ee'));}};};Dialer[_0xe320('0x8d')][_0xe320('0x1ef')]=function(_0x24ee1a,_0x50e9c0){var _0x2f4606=this;return function(_0x354486){if(_[_0xe320('0x4a')](_0x354486)){if(_['isNil'](_0x50e9c0[_0xe320('0x164')])||!_0x50e9c0[_0xe320('0x1f0')]){if(_0x24ee1a['dialMethod']===_0xe320('0x9')){_0x24ee1a[_0xe320('0x74')]=_['isUndefined'](_0x24ee1a[_0xe320('0x74')])?!![]:_0x24ee1a[_0xe320('0x74')];var _0x101f28=uuid['v4']();_0x2f4606[_0xe320('0x27')][_0x101f28]=new Action(_0x24ee1a,_0x50e9c0,_0x101f28);loggerBooked[_0xe320('0x4b')](_0xe320('0x1f1'),_0x101f28,'queueStatusComplete:\x20',JSON[_0xe320('0xac')](_0x24ee1a[_0xe320('0x74')]),_0xe320('0x1f2'),_0x24ee1a[_0xe320('0x48')]);if(_0x24ee1a['queueStatusComplete']){_0x24ee1a[_0xe320('0x74')]=![];_0x2f4606['queueBooked'][_0x2f4606['actions'][_0x101f28][_0xe320('0xc8')]]=[];ami[_0xe320('0x9b')]({'actionid':_0x101f28,'action':'queuestatus','queue':_0x24ee1a[_0xe320('0x48')]})[_0xe320('0xa4')](function(){_0x2f4606['updateOriginated'](_0x24ee1a);hopperUtils[_0xe320('0xe8')]({'active':![],'ContactId':_0x2f4606[_0xe320('0x27')][_0x101f28]['ContactId'],'ListId':_0x2f4606[_0xe320('0x27')][_0x101f28]['ListId'],'VoiceQueueId':_0x2f4606['actions'][_0x101f28][_0xe320('0xee')]||undefined,'CampaignId':_0x2f4606[_0xe320('0x27')][_0x101f28]['CampaignId']||undefined})[_0xe320('0xa4')](loggerCatch(_0xe320('0x1f3')));delete _0x2f4606['actions'][_0x101f28];});}else{loggerBooked[_0xe320('0x4b')](_0xe320('0x1f4'),JSON[_0xe320('0xac')](_0x24ee1a[_0xe320('0x74')]),_0xe320('0x1f2'),_0x24ee1a[_0xe320('0x48')]);_0x2f4606['updateOriginated'](_0x24ee1a);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x2f4606[_0xe320('0x27')][_0x101f28][_0xe320('0xec')],'ListId':_0x2f4606[_0xe320('0x27')][_0x101f28]['ListId'],'VoiceQueueId':_0x2f4606[_0xe320('0x27')][_0x101f28]['VoiceQueueId']||undefined,'CampaignId':_0x2f4606[_0xe320('0x27')][_0x101f28]['CampaignId']||undefined})['catch'](loggerCatch(_0xe320('0x1f3')));delete _0x2f4606[_0xe320('0x27')][_0x101f28];}}else{return _0x2f4606[_0xe320('0x169')](_0x24ee1a,_0x50e9c0);}}else{if(utils['getSeconds'](undefined,_0x50e9c0[_0xe320('0x1f5')])<_0x24ee1a[_0xe320('0x1f6')]*0x3c){if(_0x50e9c0['Agent']&&!_0x50e9c0[_0xe320('0x158')][_0xe320('0x1f7')]){_0x2f4606[_0xe320('0x20')][_0xe320('0x108')](_0x50e9c0['id'])[_0xe320('0x1e')](function(){_0x2f4606[_0xe320('0xcb')](_0x24ee1a);});}else{hopperUtils[_0xe320('0x1f8')]({'active':![]},_0x50e9c0['id'],0x1)['finally'](function(){_0x2f4606['updateOriginated'](_0x24ee1a);});}}else{_0x24ee1a['outboundReCallsDay']+=0x1;_0x2f4606['updateOriginated'](_0x24ee1a);if(_0x24ee1a[_0xe320('0x1f9')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x50e9c0[_0xe320('0xec')],'ListId':_0x50e9c0[_0xe320('0xed')],'VoiceQueueId':_0x50e9c0['VoiceQueueId']||undefined,'CampaignId':_0x50e9c0[_0xe320('0xef')]||undefined})[_0xe320('0xa4')](loggerCatch(_0xe320('0x1fa')));hopperUtils[_0xe320('0xd3')](createObjHistory(_0x24ee1a,_0x50e9c0,utils[_0xe320('0x6b')][_0xe320('0x1fb')],0x17,_0xe320('0x1fc')))[_0xe320('0xa4')](loggerCatch(_0xe320('0x1fd')));}else{_0x2f4606['saveInDb'](createObjHistory(_0x24ee1a,_0x50e9c0,utils[_0xe320('0x6b')][_0xe320('0x1fe')],0x16,_0xe320('0x1ff')),_0xe320('0x200'),_0xe320('0x201'));}}}}else{_0x24ee1a['outboundBlacklistCallsDay']+=0x1;_0x2f4606[_0xe320('0x124')](createObjHistory(_0x24ee1a,_0x50e9c0,utils[_0xe320('0x6b')][_0xe320('0x202')],0xd,_0xe320('0x203')),_0xe320('0x204'),_0xe320('0x205'));throw _0xe320('0x206');}};};Dialer[_0xe320('0x8d')][_0xe320('0x168')]=function(_0x4fd4f7){var _0x48bf13=this;var _0x2e7091=_0x4fd4f7[_0xe320('0x207')]-_0x4fd4f7[_0xe320('0x81')];emitCampaignSummary(_0x4fd4f7);if(_0x2e7091>0x0&&_0x4fd4f7[_0xe320('0x6a')]==0x0){if(_0x2e7091>this[_0xe320('0x25')]){_0x2e7091=this[_0xe320('0x25')];}_0x4fd4f7[_0xe320('0x6a')]=0x1;hopperUtils['getContactDialerIvr'](_0x4fd4f7,_0x2e7091)['then'](function(_0x4ca469){_0x4fd4f7[_0xe320('0x6a')]=0x0;if(_0x4ca469){if(!utils['checkContactEmpty'](_0x4ca469)){_0x4fd4f7[_0xe320('0x6e')]=utils['CAMPAIGN_STATUS'][_0xe320('0x6f')];logger[_0xe320('0x4b')](_0xe320('0x208')+_0x4fd4f7['name']);}else{_0x4fd4f7[_0xe320('0x81')]+=_0x4ca469[_0xe320('0x99')];_0x4fd4f7[_0xe320('0x6e')]=utils[_0xe320('0x6b')][_0xe320('0x209')];for(var _0x26ff2=0x0;_0x26ff2<_0x4ca469['length'];_0x26ff2+=0x1){_0x4fd4f7[_0xe320('0x20a')]+=0x1;if(_['isNil'](_0x4ca469[_0x26ff2])||_[_0xe320('0x101')](_0x4ca469[_0x26ff2]['Contact'])||_[_0xe320('0x101')](_0x4ca469[_0x26ff2]['phone'])){_0x48bf13[_0xe320('0x20b')](_0xe320('0x20c'),_0x4fd4f7,_0x4ca469[_0x26ff2]);}else{hopperUtils[_0xe320('0x20d')](_['pick'](_0x4ca469[_0x26ff2],['CampaignId',_0xe320('0x16c')]))[_0xe320('0x9f')](_0x48bf13[_0xe320('0x1ef')](_0x4fd4f7,_0x4ca469[_0x26ff2]))[_0xe320('0xa4')](_0x48bf13[_0xe320('0x162')](_0xe320('0x20e'),_0x4fd4f7));}}}}})[_0xe320('0xa4')](loggerGetContactDialer('[getContactCampaign2]',_0x4fd4f7,_0x2e7091));}};Dialer['prototype']['handlePower']=function(_0xb7755e,_0x3cf828){var _0xe477de=this;var _0x19c6da=[];if(_0x3cf828<0x1||_0xb7755e['dialMethod']==='booked'){_0x3cf828=0x1;}var _0x40765a=Math['floor'](_0xb7755e[_0xe320('0x1c9')]*_0x3cf828)-_0xb7755e['originated'];if(_0xb7755e['dialLimitQueue']>0x0){var _0x2d0fe0=_0xb7755e[_0xe320('0x20f')]-_0xb7755e['originated']-_0xb7755e[_0xe320('0x14a')]-_0xb7755e[_0xe320('0x14b')];if(_0x40765a>_0x2d0fe0){_0x40765a=_0x2d0fe0;}}if(_0x40765a>0x0&&_0xb7755e[_0xe320('0x6a')]==0x0){if(_0xb7755e[_0xe320('0xb8')]===_0xe320('0x9')){_0x40765a=0x1;}if(_0x40765a>this[_0xe320('0x25')]){_0x40765a=this[_0xe320('0x25')];}for(var _0x10d6cf in this[_0xe320('0x23')]){if(typeof this[_0xe320('0x23')][_0x10d6cf]!==_0xe320('0xb0')){if(this[_0xe320('0x23')][_0x10d6cf][_0xe320('0xdb')]==='not_inuse'&&this[_0xe320('0x23')][_0x10d6cf][_0xe320('0x8a')]===_0xe320('0x8b')){_0x19c6da[_0xe320('0x9a')](this[_0xe320('0x23')][_0x10d6cf]['id']);}}}_0xb7755e[_0xe320('0x6a')]=0x1;hopperUtils[_0xe320('0x210')](_0xb7755e,_0x19c6da,_0x40765a)[_0xe320('0x9f')](function(_0x5a25a4){_0xb7755e[_0xe320('0x6a')]=0x0;if(_0x5a25a4){if(!utils[_0xe320('0x211')](_0x5a25a4)){hopperUtils['countReScheduled'](_0xb7755e)[_0xe320('0x9f')](sendMessageReschedule(_0xb7755e))[_0xe320('0xa4')](loggerCatch(_0xe320('0x212')));}else{_0xb7755e[_0xe320('0x81')]+=_0x5a25a4[_0xe320('0x99')];_0xb7755e[_0xe320('0x6e')]=_0xb7755e[_0xe320('0xb8')]==='booked'?utils['CAMPAIGN_STATUS'][_0xe320('0x14c')]:utils[_0xe320('0x6b')][_0xe320('0x209')];for(var _0x2ec2bf=0x0;_0x2ec2bf<_0x5a25a4[_0xe320('0x99')];_0x2ec2bf+=0x1){if(_[_0xe320('0x101')](_0x5a25a4[_0x2ec2bf])||_[_0xe320('0x101')](_0x5a25a4[_0x2ec2bf][_0xe320('0x182')])||_['isNil'](_0x5a25a4[_0x2ec2bf][_0xe320('0x16c')])){_0xe477de[_0xe320('0x20b')]('[actionOriginate]\x20',_0xb7755e,_0x5a25a4[_0x2ec2bf]);}else{hopperUtils[_0xe320('0x213')](_[_0xe320('0x77')](_0x5a25a4[_0x2ec2bf],[_0xe320('0xee'),_0xe320('0x16c')]))[_0xe320('0x9f')](_0xe477de['checkContactBlack'](_0xb7755e,_0x5a25a4[_0x2ec2bf]))['catch'](_0xe477de[_0xe320('0x162')](_0xe320('0x20c'),_0xb7755e));}}}}})[_0xe320('0xa4')](loggerGetContactDialer(_0xe320('0x214'),_0xb7755e,_0x40765a));}};Dialer[_0xe320('0x8d')][_0xe320('0x64')]=function(_0x1b3381){if(_0x1b3381['dialLimitQueue']>0x0){var _0x159b63=_0x1b3381[_0xe320('0x20f')]-_0x1b3381[_0xe320('0x81')]-_0x1b3381[_0xe320('0x14a')];if(_0x159b63>0x0&&_0x1b3381[_0xe320('0x6a')]==0x0){this[_0xe320('0x215')](_0x1b3381);}else{loggerPredictiveCalls['info'](_0xe320('0x216'));}}else{this['tryOriginatePredictive'](_0x1b3381);}};Dialer['prototype'][_0xe320('0x215')]=function(_0x1f6b73){var _0x315293=this;var _0x522512=[];_0x1f6b73[_0xe320('0x81')]+=0x1;for(var _0x43340e in this['agents']){if(typeof this[_0xe320('0x23')][_0x43340e]!==_0xe320('0xb0')){if(this['agents'][_0x43340e][_0xe320('0xdb')]===_0xe320('0x217')&&this[_0xe320('0x23')][_0x43340e][_0xe320('0x8a')]===_0xe320('0x8b')){_0x522512['push'](this[_0xe320('0x23')][_0x43340e]['id']);}}}_0x1f6b73['temp']=0x1;return this['getContactDialer'](_0x1f6b73['id'],_0x522512,0x1,_0x1f6b73[_0xe320('0x218')],_0x1f6b73)[_0xe320('0x9f')](function(_0x1901c7){_0x1f6b73[_0xe320('0x6a')]=0x1;if(_0x1901c7){if(!utils['checkContactEmpty'](_0x1901c7)){utils[_0xe320('0x69')](_0x1f6b73,0x1,0x0);return hopperUtils['countReScheduled'](_0x1f6b73)[_0xe320('0x9f')](sendMessageReschedule(_0x1f6b73))[_0xe320('0xa4')](loggerCatch(_0xe320('0x212')));}else{_0x1f6b73['message']=utils[_0xe320('0x6b')][_0xe320('0x209')];if(_[_0xe320('0x101')](_0x1901c7[0x0])||_[_0xe320('0x101')](_0x1901c7[0x0][_0xe320('0x182')])||_['isNil'](_0x1901c7[0x0][_0xe320('0x16c')])){_0x315293[_0xe320('0x20b')](_0xe320('0x20c'),_0x1f6b73,_0x1901c7[0x0]);}else{return hopperUtils[_0xe320('0x213')](_[_0xe320('0x77')](_0x1901c7[0x0],[_0xe320('0xee'),_0xe320('0x16c')]))['then'](_0x315293[_0xe320('0x1ef')](_0x1f6b73,_0x1901c7[0x0]))['catch'](_0x315293[_0xe320('0x162')](_0xe320('0x219'),_0x1f6b73));}}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x1f6b73,0x1));};Dialer[_0xe320('0x8d')][_0xe320('0x1e8')]=function(_0x428b7a,_0x28e67a,_0x8415b0,_0x1dd7a6,_0x163927,_0x137e36){loggerPredictive[_0xe320('0x4b')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xe320('0x4b')](_0xe320('0x21a'),_0x428b7a);loggerPredictive[_0xe320('0x4b')](_0xe320('0x21b'),_0x28e67a);loggerPredictive['info'](_0xe320('0x21c'),_0x8415b0);loggerPredictive[_0xe320('0x4b')](_0xe320('0x21d'),_0x1dd7a6);loggerPredictive[_0xe320('0x4b')](_0xe320('0x21e'),_0x163927);loggerPredictive['info'](_0xe320('0x53'));return new Promise(function(_0x14f977,_0x5768f9){if(_0x428b7a<=0x0||isNaN(_0x428b7a)){return _0x5768f9(msgResponse(_0xe320('0x21f'),_0xe320('0xc6'),_0xe320('0x220')+_0x428b7a));}if(_0x8415b0<=0x0||isNaN(_0x8415b0)){return _0x5768f9(msgResponse('[abandonmentRate]','Error',_0xe320('0x221')+_0x8415b0));}if(_0x1dd7a6<=0x0||isNaN(_0x1dd7a6)){return _0x5768f9(msgResponse(_0xe320('0x21f'),_0xe320('0xc6'),_0xe320('0x222')+_0x1dd7a6));}if(_0x28e67a<=0x0||isNaN(_0x28e67a)){return _0x5768f9(msgResponse(_0xe320('0x21f'),_0xe320('0xc6'),_0xe320('0x223')+_0x28e67a));}if(_0x163927<=0x0||isNaN(_0x163927)){return _0x5768f9(msgResponse(_0xe320('0x21f'),_0xe320('0xc6'),'Amax\x20=\x20'+_0x163927));}_0x137e36=_0x137e36||0x0;var _0x26ce0b=0x1/_0x8415b0;var _0x91e7b7=0x0;var _0x5ca7f7=0x0;var _0x1e5eb5=0x0;var _0x8feab5=0x0;for(var _0x1caf1b=0x0;_0x1e5eb5<_0x163927;_0x1caf1b+=0x1){_0x5ca7f7=_0x1caf1b/_0x28e67a;_0x91e7b7=(_0x1dd7a6*_0x5ca7f7+_0x137e36)/_0x26ce0b;_0x1e5eb5=utils[_0xe320('0x224')](_0x91e7b7,_0x428b7a);_0x8feab5=_0x91e7b7/_0x428b7a*(0x1-utils[_0xe320('0x224')](_0x91e7b7,_0x428b7a));}return _0x14f977({'erlangCalls':_0x1caf1b,'erlangCallToSecond':_0x28e67a/_0x1caf1b,'erlangAbandonmentRate':_0x1e5eb5,'erlangBusyFactor':_0x8feab5});});};Dialer[_0xe320('0x8d')][_0xe320('0x1e2')]=function(_0x500e7b,_0x10ba72,_0x44a962,_0x3903d7,_0x1d07f7,_0x295812){loggerPredictive[_0xe320('0x4b')](_0xe320('0x225'));loggerPredictive[_0xe320('0x4b')](_0xe320('0x21a'),_0x500e7b);loggerPredictive[_0xe320('0x4b')](_0xe320('0x21b'),_0x10ba72);loggerPredictive[_0xe320('0x4b')](_0xe320('0x21c'),_0x44a962);loggerPredictive[_0xe320('0x4b')](_0xe320('0x21d'),_0x3903d7);loggerPredictive[_0xe320('0x4b')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1d07f7);loggerPredictive[_0xe320('0x4b')](_0xe320('0x53'));return new Promise(function(_0x27fb3f,_0x4ddca2){if(_0x500e7b<=0x0||isNaN(_0x500e7b)){return _0x4ddca2(msgResponse('[busyFactor]',_0xe320('0xc6'),'m\x20=\x20'+_0x500e7b));}if(_0x44a962<=0x0||isNaN(_0x44a962)){return _0x4ddca2(msgResponse('[busyFactor]',_0xe320('0xc6'),'Ts\x20=\x20'+_0x44a962));}if(_0x3903d7<=0x0||isNaN(_0x3903d7)){return _0x4ddca2(msgResponse(_0xe320('0x226'),'Error',_0xe320('0x222')+_0x3903d7));}if(_0x10ba72<=0x0||isNaN(_0x10ba72)){return _0x4ddca2(msgResponse(_0xe320('0x226'),'Error',_0xe320('0x223')+_0x10ba72));}if(_0x1d07f7<=0x0||isNaN(_0x1d07f7)){return _0x4ddca2(msgResponse(_0xe320('0x226'),_0xe320('0xc6'),_0xe320('0x227')+_0x1d07f7));}_0x295812=_0x295812||0x0;var _0x10fac6=0x1/_0x44a962;var _0x5db410=0x0;var _0x456571=0x0;var _0x8a3527=0x0;var _0xa3c6dc=0x0;for(var _0x509739=0x0;_0xa3c6dc<_0x1d07f7;_0x509739+=0x1){_0x456571=_0x509739/_0x10ba72;_0x5db410=(_0x3903d7*_0x456571+_0x295812)/_0x10fac6;_0x8a3527=utils[_0xe320('0x224')](_0x5db410,_0x500e7b);_0xa3c6dc=_0x5db410/_0x500e7b*(0x1-utils[_0xe320('0x224')](_0x5db410,_0x500e7b));}return _0x27fb3f({'erlangCalls':_0x509739,'erlangCallToSecond':_0x10ba72/_0x509739,'erlangAbandonmentRate':_0x8a3527,'erlangBusyFactor':_0xa3c6dc});});};module['exports']=Dialer; \ No newline at end of file +var _0x4c34=['push','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','booked','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','isGlobal','AMI\x20IfTime','queue','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','uniqueid','outboundAnswerCallsDay','reason','agent','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','syncQueueCallerAbandon','droptime','getSeconds','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','dialQueueProject2','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','channel','actionid','strategy','roundrobin','paused','agents','stateinterface','locked','rrmemory','isNil','queueBooked','run','idHopper','_rr','unlockRR','[booked][RR]','Agent:\x20','[Catch][Preview][syncQueueStatusComplete]','finally','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','callProgressDetecting','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','countnosuchnumberretry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','[syncAgentComplete]','Unknow','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','startPredictive','available','inUse','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','No\x20such\x20channel','getVoiceQueueRtPauses','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','UserId','[emptyContact][createHistory]','[emptyContact]','handlePreviewRecallNotifications','handleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','assign','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','startMethodPredictive','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','inBlackList','limitCalls','temp','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','reachable','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','[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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','busyFactor','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','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/interval','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','actions','contactsId','uniqueId','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','loopCampaigns','loopClearZombieChannels','getSettings','then','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','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','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','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','isUndefined','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','startProgressive','startProgressive\x20value\x20cleared','name','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','[unlockQueueStatus][undefined]','queueStatusComplete','stringify','pick','Interval','\x20INTERVAL_IS_NULL','NULL_INTERVAL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','[ifTime][Action]','Error','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','isTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','length','Action','command','iftime\x20%s,%s','content','indexOf','true','catch'];(function(_0x31ea27,_0x5da0af){var _0x39a12b=function(_0x2a44aa){while(--_0x2a44aa){_0x31ea27['push'](_0x31ea27['shift']());}};_0x39a12b(++_0x5da0af);}(_0x4c34,0x186));var _0x44c3=function(_0x3f1647,_0x11e8d8){_0x3f1647=_0x3f1647-0x0;var _0x34b580=_0x4c34[_0x3f1647];return _0x34b580;};'use strict';var util=require(_0x44c3('0x0'));var _=require('lodash');var uuid=require(_0x44c3('0x1'));var moment=require(_0x44c3('0x2'));var rr=require('rr');var Redis=require(_0x44c3('0x3'));var utils=require(_0x44c3('0x4'));var hopperUtils=require(_0x44c3('0x5'));var ut=require(_0x44c3('0x6'));var config=require(_0x44c3('0x7'));var logger=require(_0x44c3('0x8'))(_0x44c3('0x9'));var loggerBooked=require(_0x44c3('0x8'))('booked');var loggerPredictive=require(_0x44c3('0x8'))(_0x44c3('0xa'));var loggerPredictiveCalls=require(_0x44c3('0x8'))(_0x44c3('0xb'));var loggerSyncQueueSummary=require(_0x44c3('0x8'))(_0x44c3('0xc'));var ami=require(_0x44c3('0xd'));config['redis']=_['defaults'](config[_0x44c3('0xe')],{'host':_0x44c3('0xf'),'port':0x18eb});var io=require(_0x44c3('0x10'))(new Redis(config[_0x44c3('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x44c3('0x11'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x44c3('0x12'));var Action=require('./models/action');var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x44c3('0x13'));var Hangup=require(_0x44c3('0x14'));var ipAgi=process[_0x44c3('0x15')]['XCALLY_IP_AGI']||_0x44c3('0x16');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x44c3('0x17')][_0x44c3('0x18')]=function(_0x19b0f4){this['tail']=this['tail']?this[_0x44c3('0x19')]['finally'](_0x19b0f4):_0x19b0f4();};function Dialer(_0x12f2f1,_0x356590){this[_0x44c3('0x1a')]=new Sequence();this[_0x44c3('0x1b')]=_0x356590;this[_0x44c3('0x1c')]=_0x12f2f1[_0x44c3('0x1c')];this[_0x44c3('0x1d')]=_0x12f2f1[_0x44c3('0x1d')];this['agents']=_0x12f2f1['agents'];this['trunks']=_0x12f2f1[_0x44c3('0x1e')];this[_0x44c3('0x1f')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x44c3('0x20')]={};this[_0x44c3('0x21')]={};this[_0x44c3('0x22')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this[_0x44c3('0x23')]={};this['queueBooked']={};this[_0x44c3('0x24')]={};this['queuesSummary']={};ami['on'](_0x44c3('0x25'),this[_0x44c3('0x26')][_0x44c3('0x27')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x44c3('0x27')](this));ami['on'](_0x44c3('0x28'),this[_0x44c3('0x29')][_0x44c3('0x27')](this));ami['on']('agentcomplete',this[_0x44c3('0x2a')][_0x44c3('0x27')](this));ami['on'](_0x44c3('0x2b'),this[_0x44c3('0xc')][_0x44c3('0x27')](this));ami['on']('custom:queuesummarycomplete',this[_0x44c3('0x2c')][_0x44c3('0x27')](this));ami['on'](_0x44c3('0x2d'),this[_0x44c3('0x2e')][_0x44c3('0x27')](this));ami['on'](_0x44c3('0x2f'),this[_0x44c3('0x30')][_0x44c3('0x27')](this));ami['on'](_0x44c3('0x31'),this[_0x44c3('0x32')][_0x44c3('0x27')](this));ami['on']('queuemember',this[_0x44c3('0x33')][_0x44c3('0x27')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x44c3('0x27')](this));this[_0x44c3('0x34')]();this[_0x44c3('0x35')]();RpcSetting[_0x44c3('0x36')]()[_0x44c3('0x37')](function(_0x3c10ef){previewRecallmeReminderInterval=_0x3c10ef['previewRecallmeReminderInterval'];});}function isNotNull(_0x558bdf){return _0x558bdf!==null&&!_['isUndefined'](_0x558bdf);}function msgResponse(_0x6379a8,_0x641003,_0x264167){return{'action':_0x6379a8,'response':_0x641003,'message':_0x264167,'stack':_0x264167};}function emit(_0x580c4e,_0x3433ee,_0x40a87a){io['to'](_0x580c4e)[_0x44c3('0x38')](_0x3433ee,_0x40a87a);}function emitOutboundVoiceQueueSummary(_0x168f81){if(_0x168f81[_0x44c3('0x39')]===_0x44c3('0x3a')){logger[_0x44c3('0x3b')](_0x44c3('0x3c'),util['inspect'](_0x168f81,{'showHidden':![],'depth':null}));emit(util['format']('voice:queue:%s',_0x168f81['name']),_0x44c3('0x3d'),_0x168f81);}}function checkGetDataPredictive(_0x364098){if(isNotNull(_0x364098)&&!_[_0x44c3('0x3e')](_0x364098)){loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x40'));loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x41'),_0x364098['predictiveIntervalTotalCalls']);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x42'),_0x364098[_0x44c3('0x43')]);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x44'),_0x364098[_0x44c3('0x45')]);loggerPredictive[_0x44c3('0x3f')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x364098['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x46'),_0x364098['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x47'),_0x364098[_0x44c3('0x48')]);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x49'));if(_0x364098[_0x44c3('0x4a')]>0x0){if(!_[_0x44c3('0x4b')](_0x364098['predictiveIntervalAvgTalktime'])&&_0x364098[_0x44c3('0x48')]>0x0){return!![];}loggerPredictive[_0x44c3('0x3f')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x44c3('0x4b')](_0x364098['predictiveIntervalAvgHoldtime'])&&_0x364098[_0x44c3('0x4c')]>0x0){return!![];}loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x4d'));}else{loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x4e'));}}else{loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x4f'));}return![];}function mergeDataErlangB(_0x15cc31){return function(_0x356b46){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x356b46[_0x44c3('0x50')]);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x51'),_0x356b46[_0x44c3('0x52')]);loggerPredictive['info'](_0x44c3('0x53'),_0x356b46[_0x44c3('0x54')]);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x55'),_0x356b46[_0x44c3('0x56')]);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x53'),_0x356b46[_0x44c3('0x54')]);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x49'));_[_0x44c3('0x57')](_0x15cc31,_0x356b46);};}function ifInterval(_0x113d36,_0x2b72ed){if(_[_0x44c3('0x4b')](_0x2b72ed)){return![];}return utils['getSeconds'](undefined,_0x2b72ed)<_0x113d36*0x3c;}function clearPredictiveAttributes(_0x28e747){if(_0x28e747[_0x44c3('0x58')]){_0x28e747[_0x44c3('0x58')]=undefined;loggerPredictive[_0x44c3('0x3b')](_0x28e747['name'],_0x44c3('0x59'));}if(_0x28e747['startPredictive']){_0x28e747['startPredictive']=undefined;loggerPredictive[_0x44c3('0x3b')](_0x28e747[_0x44c3('0x5a')],_0x44c3('0x5b'));}if(_0x28e747[_0x44c3('0x5c')]){clearInterval(_0x28e747[_0x44c3('0x5c')]);_0x28e747[_0x44c3('0x5c')]=undefined;loggerPredictive['debug'](_0x28e747[_0x44c3('0x5a')],_0x44c3('0x5d'));}}function loggerCatchPredictive(_0x315cc3,_0x5a6c78){return function(_0x42df1f){loggerPredictive[_0x44c3('0x5e')](_0x5a6c78[_0x44c3('0x5a')],_0x315cc3);loggerPredictive['error'](_0x42df1f[_0x44c3('0x5f')]);clearPredictiveAttributes(_0x5a6c78);};}function loggerCatch(_0x5b4a16){return function(_0x10d723){logger[_0x44c3('0x5e')](_0x5b4a16,util[_0x44c3('0x60')](_0x10d723,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x2412c8,_0x2166a3,_0x58bc39){return function(_0x5efcb2){utils[_0x44c3('0x61')](_0x2166a3,_0x58bc39,0x0);_0x2166a3['temp']=0x0;logger[_0x44c3('0x5e')](_0x2412c8,util['inspect'](_0x5efcb2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x75c93f){return function(_0xdb2b2){if(isNotNull(_0xdb2b2)&&isNotNull(_0xdb2b2[0x0])){if(_0xdb2b2[0x0][_0x44c3('0x62')]>0x0){_0x75c93f[_0x44c3('0x63')]=utils[_0x44c3('0x64')][_0x44c3('0x65')];logger[_0x44c3('0x3f')]('[getContactDialer2][ReScheduled]'+_0x75c93f[_0x44c3('0x5a')],_0xdb2b2[0x0]['contactsRescheduled'],'contacts');}else{_0x75c93f[_0x44c3('0x63')]=utils[_0x44c3('0x64')]['NO_AVAILABLE_CONTACTS'];logger[_0x44c3('0x3f')](_0x44c3('0x66')+_0x75c93f[_0x44c3('0x5a')]);}}};}function createObjHistory(_0x3228f9,_0x42352b,_0x5eb9c9,_0x23cf97,_0x2ffdfe){_0x3228f9['message']=_0x5eb9c9;var _0x279583=new Action(_0x3228f9,_0x42352b);var _0x3e63d6=new History(_0x279583);_0x3e63d6[_0x44c3('0x67')]=_0x23cf97;_0x3e63d6[_0x44c3('0x68')]=_0x2ffdfe;_0x3e63d6[_0x44c3('0x69')]=_0x279583[_0x44c3('0x6a')];return _0x3e63d6;}function unlockQueueStatus(_0x42af14,_0x3ff703){setTimeout(function(){if(_[_0x44c3('0x4b')](_0x42af14['queueStatusComplete'])){loggerBooked[_0x44c3('0x5e')](_0x44c3('0x6b'),_0x3ff703);}_0x42af14[_0x44c3('0x6c')]=!![];loggerBooked[_0x44c3('0x3f')]('[booked][unlockQueueStatus]',_0x3ff703,JSON[_0x44c3('0x6d')](_[_0x44c3('0x6e')](_0x42af14,[_0x44c3('0x5a'),_0x44c3('0x6c')])));},0x1f3);}function checkInterval(_0x3889c3){return function(){if(!isNotNull(_0x3889c3[_0x44c3('0x6f')])){_0x3889c3[_0x44c3('0x63')]=utils[_0x44c3('0x64')]['NULL_INTERVAL'];throw _0x3889c3[_0x44c3('0x5a')]+_0x44c3('0x70');}if(!isNotNull(_0x3889c3['Interval']['Intervals'])){_0x3889c3[_0x44c3('0x63')]=utils[_0x44c3('0x64')][_0x44c3('0x71')];throw _0x3889c3[_0x44c3('0x5a')]+_0x44c3('0x70');}if(!isNotNull(_[_0x44c3('0x3e')](_0x3889c3[_0x44c3('0x6f')][_0x44c3('0x72')]))){_0x3889c3[_0x44c3('0x63')]=utils[_0x44c3('0x64')][_0x44c3('0x71')];throw _0x3889c3[_0x44c3('0x5a')]+_0x44c3('0x70');}};}function checkIsIVRCampaignActive(_0x3f37f2){return function(){if(!utils[_0x44c3('0x73')](_0x3f37f2)){_0x3f37f2['message']=utils[_0x44c3('0x64')][_0x44c3('0x74')];throw _0x3f37f2[_0x44c3('0x5a')]+_0x44c3('0x75');}};}function emitCampaignSummary(_0x3903dc){if(utils[_0x44c3('0x76')](_0x3903dc)){emit(util[_0x44c3('0x77')](_0x44c3('0x78'),_0x3903dc[_0x44c3('0x5a')]),_0x44c3('0x79'),_0x3903dc);}}function loggerCatchQueueSummary(_0x31443c,_0x1cb1f2){return function(_0x2cd27c){clearPredictiveAttributes(_0x1cb1f2);emitCampaignSummary(_0x1cb1f2);loggerSyncQueueSummary[_0x44c3('0x3b')](_0x31443c,util[_0x44c3('0x60')](_0x2cd27c,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2d910f){if(_0x2d910f[_0x44c3('0x7a')]){if(_0x2d910f['originated']===0x0){_0x2d910f[_0x44c3('0x7a')]=![];_0x2d910f[_0x44c3('0x63')]=utils[_0x44c3('0x64')][_0x44c3('0x74')];loggerSyncQueueSummary[_0x44c3('0x3b')](_0x44c3('0x7b'),_0x2d910f['name'],_0x44c3('0x7c'));}else{_0x2d910f[_0x44c3('0x63')]=utils[_0x44c3('0x64')][_0x44c3('0x7d')];loggerSyncQueueSummary[_0x44c3('0x3b')](_0x44c3('0x7b'),_0x2d910f[_0x44c3('0x5a')],'is\x20disactive');}emitCampaignSummary(_0x2d910f);}}function myreject(_0x335a4f){return function(_0x1b8220){return _0x335a4f(msgResponse(_0x44c3('0x7e'),_0x44c3('0x7f'),JSON[_0x44c3('0x6d')](_0x1b8220)));};}Dialer['prototype']['isTrunkReachable']=function(_0x4d17d9){return!_[_0x44c3('0x4b')](_0x4d17d9)&&_0x4d17d9&&!_[_0x44c3('0x4b')](_0x4d17d9[_0x44c3('0x5a')])&&!_['isUndefined'](_0x4d17d9[_0x44c3('0x80')])&&_0x4d17d9['active']&&(this[_0x44c3('0x1e')][util[_0x44c3('0x77')]('SIP/%s',_0x4d17d9[_0x44c3('0x5a')])]['status']==='reachable'||this[_0x44c3('0x1e')][util['format'](_0x44c3('0x81'),_0x4d17d9[_0x44c3('0x5a')])][_0x44c3('0x82')]===_0x44c3('0x83'));};Dialer[_0x44c3('0x17')][_0x44c3('0x84')]=function(_0xca8e3e){var _0x394fc5=this;return function(){if(!_0x394fc5[_0x44c3('0x85')](_0xca8e3e[_0x44c3('0x86')])){if(!_0x394fc5[_0x44c3('0x85')](_0xca8e3e['TrunkBackup'])){_0xca8e3e['message']=utils[_0x44c3('0x64')][_0x44c3('0x87')];throw _0xca8e3e[_0x44c3('0x5a')]+_0x44c3('0x88');}}};};Dialer[_0x44c3('0x17')][_0x44c3('0x89')]=function(_0x2288bd,_0x411418,_0x1dda35,_0xbdef7c){var _0x5c40fe=this;return function(){var _0x50a429=!![];return _0x5c40fe[_0x44c3('0x8a')](_0x2288bd,_0x411418,_0x1dda35,_0xbdef7c,_0x50a429);};};Dialer[_0x44c3('0x17')]['checkIfTimeIntervals']=function(_0x54ba34,_0xfe8a85,_0x3847c9,_0x2146bd){var _0x1b60fd=this;return function(){var _0x21ec06=![];return _0x1b60fd[_0x44c3('0x8a')](_0x54ba34[_0x44c3('0x72')],_0xfe8a85,_0x3847c9,_0x2146bd,_0x21ec06);};};Dialer[_0x44c3('0x17')][_0x44c3('0x8a')]=function(_0x284067,_0x49d553,_0x12e076,_0x4b6862,_0x509d77){var _0x1b0be4=[];return new Promise(function(_0x294ee3,_0x4c33df){if(!isNotNull(_0x284067)){_0x4b6862[_0x44c3('0x63')]=utils['CAMPAIGN_STATUS'][_0x44c3('0x71')];return _0x4c33df(msgResponse(_0x44c3('0x8b'),_0x44c3('0x8c'),_0x12e076+_0x44c3('0x8d')));}if(_['isEmpty'](_0x284067)){_0x4b6862['message']=utils[_0x44c3('0x64')][_0x44c3('0x8e')];return _0x4c33df(msgResponse(_0x44c3('0x8b'),_0x44c3('0x8c'),_0x12e076+_0x44c3('0x8f')));}if(_0x49d553&&_['isUndefined'](config[_0x44c3('0x90')][_0x49d553])){_0x4b6862[_0x44c3('0x63')]=utils[_0x44c3('0x64')]['UNKNOWN_TIMEZONE'];return _0x4c33df(msgResponse(_0x44c3('0x8b'),_0x44c3('0x8c'),_0x12e076+_0x44c3('0x91')+_0x49d553));}if(_[_0x44c3('0x92')](_0x284067)){for(var _0x5b33a6=0x0;_0x5b33a6<_0x284067[_0x44c3('0x93')];_0x5b33a6+=0x1){_0x1b0be4['push'](ami[_0x44c3('0x94')]({'action':_0x44c3('0x95'),'command':util[_0x44c3('0x77')](_0x44c3('0x96'),_0x284067[_0x5b33a6]['interval'],!_[_0x44c3('0x4b')](config[_0x44c3('0x90')][_0x49d553])?_0x49d553:'')})['then'](function(_0x93ec9e){return _0x93ec9e[_0x44c3('0x97')][_0x44c3('0x98')](_0x44c3('0x99'))>=0x0;})[_0x44c3('0x9a')](myreject(_0x4c33df)));}}else{_0x1b0be4[_0x44c3('0x9b')](ami[_0x44c3('0x94')]({'action':_0x44c3('0x95'),'command':util[_0x44c3('0x77')](_0x44c3('0x96'),_0x284067,!_[_0x44c3('0x4b')](config[_0x44c3('0x90')][_0x49d553])?_0x49d553:'')})[_0x44c3('0x37')](function(_0x25af72){return _0x25af72['content'][_0x44c3('0x98')](_0x44c3('0x99'))>=0x0;})[_0x44c3('0x9a')](myreject(_0x4c33df)));}Promise['all'](_0x1b0be4)['then'](function(_0x42805d){var _0x52f151=_['some'](_0x42805d);if(_0x52f151){return _0x294ee3(_0x52f151);}else{_0x4b6862[_0x44c3('0x63')]=_0x509d77?utils[_0x44c3('0x64')][_0x44c3('0x9c')]:utils[_0x44c3('0x64')][_0x44c3('0x9d')];return _0x4c33df(msgResponse(_0x44c3('0x9e'),_0x44c3('0x8c'),_0x44c3('0x9f')+_0x509d77+'\x20'+_0x12e076+_0x44c3('0xa0')+util[_0x44c3('0x60')](_0x284067,{'showHidden':![],'depth':null})+_0x44c3('0xa1')+_0x49d553));}})[_0x44c3('0x9a')](function(_0x484a41){return _0x4c33df(msgResponse(_0x44c3('0x8b'),_0x44c3('0x8c'),JSON['stringify'](_0x484a41)));});});};Dialer[_0x44c3('0x17')][_0x44c3('0x34')]=function(){var _0x47ed98=this;return cmHopper[_0x44c3('0xa2')]({'active':![]},{'where':{'active':!![]}})[_0x44c3('0x37')](function(){setInterval(function(){_0x47ed98[_0x44c3('0xa3')]();},0x3e8);});};Dialer[_0x44c3('0x17')]['syncCampaigns']=function(){var _0x5e2678=this;var _0x4e298d;for(var _0xa4cb89 in this[_0x44c3('0x1d')]){if(typeof this[_0x44c3('0x1d')][_0xa4cb89]!=='undefined'){_0x4e298d=this['campaigns'][_0xa4cb89];if(utils[_0x44c3('0x76')](_0x4e298d)&&utils[_0x44c3('0x73')](_0x4e298d)){_0x4e298d['sendMessageOneNotActive']=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x4e298d))[_0x44c3('0x37')](checkInterval(_0x4e298d))[_0x44c3('0x37')](_0x5e2678[_0x44c3('0x84')](_0x4e298d))[_0x44c3('0x37')](_0x5e2678['checkIfTime'](_0x4e298d[_0x44c3('0xa4')],_0x4e298d[_0x44c3('0xa5')],_0x4e298d[_0x44c3('0x5a')],_0x4e298d))['then'](_0x5e2678['checkIfTimeIntervals'](_0x4e298d[_0x44c3('0x6f')],_0x4e298d[_0x44c3('0xa5')],_0x4e298d[_0x44c3('0x5a')],_0x4e298d))['then'](_0x5e2678[_0x44c3('0xa6')](_0x4e298d))['catch'](loggerCatchQueueSummary(_0x44c3('0xa7'),_0x4e298d));}else{notSendMessagesCampaign(_0x4e298d);}}}};Dialer[_0x44c3('0x17')][_0x44c3('0xa8')]=function(_0x4868e7){if(_0x4868e7[_0x44c3('0xa9')]!=='predictive'){clearPredictiveAttributes(_0x4868e7);}switch(_0x4868e7[_0x44c3('0xa9')]){case _0x44c3('0xaa'):this[_0x44c3('0xab')](_0x4868e7,0x1);break;case _0x44c3('0xac'):this[_0x44c3('0xab')](_0x4868e7,_0x4868e7[_0x44c3('0xad')]);break;case _0x44c3('0xa'):this[_0x44c3('0xa')](_0x4868e7);break;case _0x44c3('0xae'):this['handlePower'](_0x4868e7,0x1);break;default:logger[_0x44c3('0x5e')]('Queue',_0x4868e7[_0x44c3('0x5a')],'method\x20not\x20recognized');}};Dialer[_0x44c3('0x17')][_0x44c3('0x8b')]=function(_0x5e2a80,_0x4cd616){var _0x1a7d3f=_0x5e2a80[_0x44c3('0xa5')];var _0x54fa88=_0x4cd616?_0x5e2a80[_0x44c3('0xa4')]:_0x5e2a80[_0x44c3('0x6f')][_0x44c3('0x72')];logger[_0x44c3('0xaf')](_0x44c3('0xb0'),_0x54fa88,_0x1a7d3f,_0x5e2a80[_0x44c3('0x5a')],util['format'](_0x44c3('0xb1'),_0x5e2a80[_0x44c3('0x5a')],_0x5e2a80['id']));var _0x22f183=null;return Interval[_0x44c3('0xb2')](_0x54fa88,_0x1a7d3f)['then'](function(_0x147c8e){if(_0x147c8e===!![]){return _0x147c8e;}else{_0x5e2a80[_0x44c3('0x63')]=_0x4cd616?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x44c3('0x9d')];_0x22f183=msgResponse(_0x44c3('0x9e'),_0x44c3('0x8c'),'Global:\x20'+_0x4cd616+'\x20'+_0x5e2a80[_0x44c3('0x5a')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x54fa88,{'showHidden':![],'depth':null})+_0x44c3('0xa1')+_0x1a7d3f);}if(_0x22f183!==null){logger[_0x44c3('0xaf')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x22f183);_0x22f183[_0x44c3('0xb3')]=_0x4cd616;throw _0x22f183;}})[_0x44c3('0x9a')](function(_0x2c29af){logger[_0x44c3('0x5e')](_0x44c3('0xb4'),_0x2c29af);throw msgResponse(_0x44c3('0x7e'),_0x44c3('0x7f'),util[_0x44c3('0x60')](_0x2c29af,{'showHidden':![],'depth':null}));});};Dialer[_0x44c3('0x17')][_0x44c3('0x26')]=function(_0x4f97aa){if(this[_0x44c3('0x1c')][_0x4f97aa[_0x44c3('0xb5')]]){if(this[_0x44c3('0x22')][_0x4f97aa['uniqueid']]&&this[_0x44c3('0x22')][_0x4f97aa['uniqueid']][_0x44c3('0x39')]!==_0x44c3('0xb6')){this[_0x44c3('0xb7')](this['voiceQueues'][_0x4f97aa[_0x44c3('0xb5')]]);this[_0x44c3('0x22')][_0x4f97aa['uniqueid']][_0x44c3('0xb8')]=moment()[_0x44c3('0x77')](_0x44c3('0xb9'));}}};Dialer[_0x44c3('0x17')][_0x44c3('0x2a')]=function(_0x3e6c42){var _0x4f3fe0=this['uniqueId'][_0x3e6c42[_0x44c3('0xba')]];if(this['voiceQueues'][_0x3e6c42[_0x44c3('0xb5')]]){if(_0x4f3fe0&&_0x4f3fe0[_0x44c3('0x39')]!=='ivr'){delete this[_0x44c3('0x22')][_0x3e6c42[_0x44c3('0xba')]];this['voiceQueues'][_0x3e6c42[_0x44c3('0xb5')]][_0x44c3('0xbb')]+=0x1;var _0x303dd4=new AgentComplete(_0x4f3fe0,_0x3e6c42);if(_0x3e6c42[_0x44c3('0xbc')]===_0x44c3('0xbd')){_0x303dd4[_0x44c3('0xbe')]=this[_0x44c3('0x1c')][_0x3e6c42['queue']]['dialQueueProject2']&&this['voiceQueues'][_0x3e6c42[_0x44c3('0xb5')]][_0x44c3('0xbf')]?moment()[_0x44c3('0x77')](_0x44c3('0xb9')):undefined;}hopperUtils[_0x44c3('0xc0')](_0x303dd4)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0xc1')));hopperUtils[_0x44c3('0xc2')](_0x303dd4)[_0x44c3('0x9a')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x44c3('0xc3')]=function(_0x4151e9){var _0x36d5ad=this['uniqueId'][_0x4151e9[_0x44c3('0xba')]];var _0x107a89=this;var _0x29d54e=![];var _0x11e0ee;var _0x5e6fb5;if(this[_0x44c3('0x1c')][_0x4151e9['queue']]){if(_0x36d5ad&&_0x36d5ad[_0x44c3('0x39')]!==_0x44c3('0xb6')){delete this[_0x44c3('0x22')][_0x4151e9['uniqueid']];this[_0x44c3('0xb7')](this[_0x44c3('0x1c')][_0x4151e9['queue']]);_0x36d5ad[_0x44c3('0xc4')]=moment()[_0x44c3('0x77')](_0x44c3('0xb9'));var _0xc6d177=new QueueCallerAbandon(_0x36d5ad,_0x4151e9);if(utils[_0x44c3('0xc5')](_0x36d5ad['droptime'],_0x36d5ad[_0x44c3('0xc6')])>=_0x36d5ad[_0x44c3('0xc7')]){this[_0x44c3('0x1c')][_0x4151e9[_0x44c3('0xb5')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x44c3('0x1c')][_0x4151e9[_0x44c3('0xb5')]][_0x44c3('0xc8')]+=0x1;this[_0x44c3('0x1c')][_0x4151e9['queue']][_0x44c3('0xc9')]+=0x1;_0xc6d177[_0x44c3('0x67')]=0xa;_0xc6d177['statedesc']=_0x44c3('0xca');_0xc6d177[_0x44c3('0xcb')]='TIMEOUT';_0xc6d177['agiafterat']=this[_0x44c3('0x1c')][_0x4151e9['queue']][_0x44c3('0xcc')]?moment()[_0x44c3('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xc6d177['countdropretry']+=0x1;_0xc6d177[_0x44c3('0xcd')]+=0x1;_0x11e0ee=this[_0x44c3('0x1c')][_0x4151e9[_0x44c3('0xb5')]][_0x44c3('0xce')];_0x5e6fb5=this['voiceQueues'][_0x4151e9[_0x44c3('0xb5')]][_0x44c3('0xcf')];hopperUtils[_0x44c3('0xd0')](_0xc6d177,_0xc6d177[_0x44c3('0x67')],_0x36d5ad[_0x44c3('0xd1')])[_0x44c3('0x37')](function(_0x242afa){_0x29d54e=_0x242afa[_0x44c3('0xd2')]==0x1;if(_0xc6d177[_0x44c3('0xd3')]>=_0x107a89['voiceQueues'][_0x4151e9[_0x44c3('0xb5')]][_0x44c3('0xd4')]){_0x107a89[_0x44c3('0xd5')](_0xc6d177,_0x242afa['additional']);}else{hopperUtils[_0x44c3('0xd6')]({'active':![],'countdropretry':_0xc6d177[_0x44c3('0xd3')],'scheduledat':moment()[_0x44c3('0xd7')](_0x107a89[_0x44c3('0x1c')][_0x4151e9['queue']]['dialDropRetryFrequency'],_0x44c3('0xd8'))[_0x44c3('0x77')](_0x44c3('0xb9')),'ContactId':_0x36d5ad[_0x44c3('0xd9')],'ListId':_0x36d5ad[_0x44c3('0xda')],'VoiceQueueId':_0x36d5ad[_0x44c3('0xdb')]||undefined,'CampaignId':_0x36d5ad[_0x44c3('0xdc')]||undefined})['catch'](loggerCatch(_0x44c3('0xdd')));var _0x1153ae=new History(_0xc6d177);_0x1153ae[_0x44c3('0x67')]=0xa;_0x1153ae['statedesc']='Drop';_0x1153ae[_0x44c3('0x6a')]=moment()[_0x44c3('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x1153ae[_0x44c3('0x69')]=_0x1153ae[_0x44c3('0x6a')];_0x1153ae[_0x44c3('0xde')]=_0xc6d177['calleridname'];_0x1153ae['calleridnum']=_0xc6d177[_0x44c3('0xdf')];hopperUtils[_0x44c3('0xc0')](_0x1153ae)[_0x44c3('0x9a')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x44c3('0x37')](function(){if(_0x29d54e)hopperUtils[_0x44c3('0xe0')](_0xc6d177,_0x11e0ee,_0x5e6fb5)['then'](function(){return 0x1;});});}else{this['voiceQueues'][_0x4151e9[_0x44c3('0xb5')]][_0x44c3('0xe1')]+=0x1;this['voiceQueues'][_0x4151e9['queue']][_0x44c3('0xe2')]+=0x1;_0xc6d177[_0x44c3('0x67')]=0xb;_0xc6d177[_0x44c3('0x68')]=_0x44c3('0xe3');_0xc6d177[_0x44c3('0xcb')]=_0x44c3('0xe4');_0xc6d177[_0x44c3('0xe5')]+=0x1;_0xc6d177['countglobal']+=0x1;_0x11e0ee=this[_0x44c3('0x1c')][_0x4151e9[_0x44c3('0xb5')]][_0x44c3('0xe6')];_0x5e6fb5=this[_0x44c3('0x1c')][_0x4151e9[_0x44c3('0xb5')]][_0x44c3('0xcf')];hopperUtils[_0x44c3('0xd0')](_0xc6d177,_0xc6d177['state'],_0x36d5ad[_0x44c3('0xd1')])[_0x44c3('0x37')](function(_0x88ef80){if(_0xc6d177[_0x44c3('0xe5')]>=_0x107a89[_0x44c3('0x1c')][_0x4151e9[_0x44c3('0xb5')]][_0x44c3('0xe7')]){_0x107a89[_0x44c3('0xd5')](_0xc6d177,_0x88ef80['additional']);}else{hopperUtils[_0x44c3('0xd6')]({'active':![],'countabandonedretry':_0xc6d177['countabandonedretry'],'scheduledat':moment()[_0x44c3('0xd7')](_0x107a89['voiceQueues'][_0x4151e9[_0x44c3('0xb5')]][_0x44c3('0xe6')],'minutes')[_0x44c3('0x77')](_0x44c3('0xb9')),'ContactId':_0x36d5ad[_0x44c3('0xd9')],'ListId':_0x36d5ad['ListId'],'VoiceQueueId':_0x36d5ad[_0x44c3('0xdb')]||undefined,'CampaignId':_0x36d5ad[_0x44c3('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x556b3c=new History(_0xc6d177);_0x556b3c[_0x44c3('0x67')]=0xb;_0x556b3c[_0x44c3('0x68')]=_0x44c3('0xe3');_0x556b3c[_0x44c3('0x6a')]=moment()[_0x44c3('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x556b3c[_0x44c3('0x69')]=_0x556b3c[_0x44c3('0x6a')];_0x556b3c[_0x44c3('0xde')]=_0xc6d177[_0x44c3('0xde')];_0x556b3c[_0x44c3('0xdf')]=_0xc6d177[_0x44c3('0xdf')];hopperUtils[_0x44c3('0xc0')](_0x556b3c)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x44c3('0x37')](function(){if(_0x29d54e)hopperUtils[_0x44c3('0xe0')](_0xc6d177,_0x11e0ee,_0x5e6fb5)['then'](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x52b40b){if(this[_0x44c3('0x20')][_0x52b40b[_0x44c3('0xba')]]){this[_0x44c3('0x20')][_0x52b40b['uniqueid']]['channel']=_0x52b40b[_0x44c3('0xe8')];}if(this[_0x44c3('0x22')][_0x52b40b[_0x44c3('0xba')]]){this[_0x44c3('0x22')][_0x52b40b['uniqueid']][_0x44c3('0xe8')]=_0x52b40b[_0x44c3('0xe8')];}};Dialer['prototype'][_0x44c3('0x33')]=function(_0x433339){if(!this['actions'][_0x433339['actionid']]){return;}var _0x4a9667=this[_0x44c3('0x1c')][this[_0x44c3('0x20')][_0x433339[_0x44c3('0xe9')]][_0x44c3('0xb5')]][_0x44c3('0xea')]||'rrmemory';if(_0x4a9667===_0x44c3('0xeb')){if(this[_0x44c3('0x20')][_0x433339[_0x44c3('0xe9')]]&&_['isNil'](this[_0x44c3('0x20')][_0x433339[_0x44c3('0xe9')]]['locked'])&&_0x433339[_0x44c3('0x82')]==='1'&&_0x433339[_0x44c3('0xec')]==='0'){if(this[_0x44c3('0xed')][_0x433339[_0x44c3('0xee')]]){if(!this[_0x44c3('0xed')][_0x433339[_0x44c3('0xee')]][_0x44c3('0xef')]){this[_0x44c3('0xed')][_0x433339[_0x44c3('0xee')]][_0x44c3('0xef')]=!![];this[_0x44c3('0x20')][_0x433339[_0x44c3('0xe9')]][_0x44c3('0xef')]=!![];this[_0x44c3('0x20')][_0x433339[_0x44c3('0xe9')]][_0x44c3('0xee')]=_0x433339[_0x44c3('0xee')];}}}}else if(_0x4a9667===_0x44c3('0xf0')){if(this[_0x44c3('0x20')][_0x433339[_0x44c3('0xe9')]]){if(this[_0x44c3('0xed')][_0x433339[_0x44c3('0xee')]]){this['actions'][_0x433339[_0x44c3('0xe9')]][_0x44c3('0xee')]=_0x433339[_0x44c3('0xee')];if(_[_0x44c3('0xf1')](this['queueBooked'][this[_0x44c3('0x20')][_0x433339[_0x44c3('0xe9')]]['queue']])){this[_0x44c3('0xf2')][this[_0x44c3('0x20')][_0x433339[_0x44c3('0xe9')]]['queue']]=[];}this[_0x44c3('0xf2')][this[_0x44c3('0x20')][_0x433339[_0x44c3('0xe9')]][_0x44c3('0xb5')]]['push'](_[_0x44c3('0x57')](_[_0x44c3('0x6e')](this['actions'][_0x433339[_0x44c3('0xe9')]],['idHopper',_0x44c3('0xee')]),{'status':_0x433339[_0x44c3('0x82')],'paused':_0x433339[_0x44c3('0xec')]}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x50e284){if(!this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]]){return;}var _0x353a63=this;var _0x39c9e0=this['voiceQueues'][this[_0x44c3('0x20')][_0x50e284['actionid']][_0x44c3('0xb5')]];var _0x3aa167=_0x39c9e0[_0x44c3('0xea')]||_0x44c3('0xf0');if(_0x3aa167===_0x44c3('0xeb')){if(this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]]&&this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]]['stateinterface']){this[_0x44c3('0x1b')][_0x44c3('0xf3')](this['actions'][_0x50e284['actionid']][_0x44c3('0xf4')],this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]]['stateinterface'])[_0x44c3('0x9a')](function(_0x1a8dc8){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x44c3('0x60')](_0x1a8dc8,{'showHidden':![],'depth':null}));})['finally'](function(){_0x353a63['updateOriginated'](_0x353a63[_0x44c3('0x1c')][_0x353a63[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]][_0x44c3('0xb5')]]);_0x353a63[_0x44c3('0xed')][_0x353a63[_0x44c3('0x20')][_0x50e284['actionid']]['stateinterface']][_0x44c3('0xef')]=![];delete _0x353a63[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]];unlockQueueStatus(_0x39c9e0);});}else{this[_0x44c3('0xb7')](this[_0x44c3('0x1c')][this[_0x44c3('0x20')][_0x50e284['actionid']][_0x44c3('0xb5')]]);hopperUtils[_0x44c3('0xd6')]({'active':![],'ContactId':this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]][_0x44c3('0xd9')],'ListId':this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]][_0x44c3('0xda')],'VoiceQueueId':this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]][_0x44c3('0xdb')]||undefined,'CampaignId':this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]]['CampaignId']||undefined})[_0x44c3('0x9a')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]];unlockQueueStatus(_0x39c9e0);}}else if(_0x3aa167==='rrmemory'){var _0x2c6b9f;if(this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]]&&!_[_0x44c3('0x3e')](this[_0x44c3('0xf2')][this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]][_0x44c3('0xb5')]])){if(this[_0x44c3('0x24')][_0x353a63[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]][_0x44c3('0xb5')]]){this['queueBookedRR'][_0x353a63[_0x44c3('0x20')][_0x50e284['actionid']][_0x44c3('0xb5')]]=this[_0x44c3('0x24')][this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]][_0x44c3('0xb5')]]?this[_0x44c3('0x24')][this[_0x44c3('0x20')][_0x50e284['actionid']][_0x44c3('0xb5')]]:this[_0x44c3('0xf2')][this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]][_0x44c3('0xb5')]]?this[_0x44c3('0xf2')][this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]]['queue']]['_rr']||0x0:0x0;}this[_0x44c3('0xf2')][this['actions'][_0x50e284['actionid']][_0x44c3('0xb5')]][_0x44c3('0xf5')]=this['queueBookedRR'][this[_0x44c3('0x20')][_0x50e284[_0x44c3('0xe9')]][_0x44c3('0xb5')]];for(var _0x18ff83=0x0;_0x18ff83=_0x51bb12[_0x44c3('0x11a')]){_0x364cbd[_0x44c3('0x11b')](_0x59dc92,_0x568a22,_0x345372,_0x44c3('0x11c'));}else{if(_0x59dc92[_0x44c3('0x114')]>=_0x51bb12[_0x44c3('0x11d')]){_0x364cbd[_0x44c3('0x11e')](_0x59dc92,_0x568a22,_0x345372,_0x44c3('0x11f'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x59dc92[_0x44c3('0x114')],'scheduledat':moment()[_0x44c3('0xd7')](_0x51bb12['dialMachineRetryFrequency'],_0x44c3('0xd8'))[_0x44c3('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59dc92[_0x44c3('0xd9')],'ListId':_0x59dc92['ListId'],'VoiceQueueId':_0x59dc92[_0x44c3('0xdb')]||undefined,'CampaignId':_0x59dc92[_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch('[rescheduleContact][Machine]'));_0x568a22({'reschedule':0x1});}}});}if(_0x2c2df0['type']===_0x44c3('0xb6')&&this[_0x44c3('0x1d')][_0x2c2df0[_0x44c3('0xb5')]][_0x44c3('0x107')]&&_0x5e25f6[_0x44c3('0x108')]===_0x44c3('0x109')){delete this[_0x44c3('0x22')][_0x5e25f6[_0x44c3('0xba')]];this['updateOriginated'](this[_0x44c3('0x1d')][_0x2c2df0[_0x44c3('0xb5')]]);_0x1cf81e=new Hangup(_0x2c2df0,_0x5e25f6);_0x1cf81e[_0x44c3('0x67')]=0x12;_0x1cf81e[_0x44c3('0x68')]=_0x44c3('0x10b');_0x1cf81e[_0x44c3('0x10c')]='AMD';ami['emit'](_0x44c3('0x10e'),ut[_0x44c3('0x115')](_0x1cf81e,_0x44c3('0x10f')));this[_0x44c3('0x110')](_0x1cf81e,_0x44c3('0x120'),_0x44c3('0x121'));}if(_0x2c2df0[_0x44c3('0x39')]==='ivr'&&this['campaigns'][_0x2c2df0[_0x44c3('0xb5')]]['dialAMDActive']&&_0x5e25f6[_0x44c3('0x108')]===_0x44c3('0x113')){return new Promise(function(_0x4b474a,_0x31c5fb){delete _0x364cbd[_0x44c3('0x22')][_0x5e25f6[_0x44c3('0xba')]];_0x364cbd[_0x44c3('0xb7')](_0x364cbd[_0x44c3('0x1d')][_0x2c2df0[_0x44c3('0xb5')]]);_0x364cbd['campaigns'][_0x2c2df0[_0x44c3('0xb5')]][_0x44c3('0xbb')]+=0x1;_0x364cbd['campaigns'][_0x2c2df0['queue']][_0x44c3('0x10a')]+=0x1;var _0x9e3eca=_0x364cbd[_0x44c3('0x1d')][_0x2c2df0[_0x44c3('0xb5')]];var _0x230dd8=new Hangup(_0x2c2df0,_0x5e25f6);_0x230dd8[_0x44c3('0x67')]=0x13;_0x230dd8[_0x44c3('0x68')]='Machine';_0x230dd8['membername']=_0x44c3('0x10d');_0x230dd8['countmachineretry']+=0x1;_0x230dd8['countglobal']+=0x1;_0x230dd8[_0x44c3('0x10f')]=!![];ami[_0x44c3('0x38')](_0x44c3('0x10e'),ut['buildObj'](_0x230dd8,_0x44c3('0x10f')));hopperUtils[_0x44c3('0xc0')](_0x230dd8)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x116')));if(_0x230dd8[_0x44c3('0x122')]+_0x230dd8['countcongestionretry']+_0x230dd8[_0x44c3('0x118')]+_0x230dd8[_0x44c3('0x123')]+_0x230dd8[_0x44c3('0xd3')]+_0x230dd8[_0x44c3('0xe5')]+_0x230dd8[_0x44c3('0x114')]+_0x230dd8[_0x44c3('0x119')]>=_0x9e3eca['dialGlobalMaxRetry']){_0x364cbd['stateGlobal'](_0x230dd8,_0x4b474a,_0x31c5fb,_0x44c3('0x11c'));}else{if(_0x230dd8[_0x44c3('0x114')]>=_0x9e3eca['dialMachineMaxRetry']){_0x364cbd[_0x44c3('0x11e')](_0x230dd8,_0x4b474a,_0x31c5fb,_0x44c3('0x11f'));}else{hopperUtils[_0x44c3('0xd6')]({'active':![],'countmachineretry':_0x230dd8[_0x44c3('0x114')],'scheduledat':moment()[_0x44c3('0xd7')](_0x9e3eca[_0x44c3('0x124')],_0x44c3('0xd8'))[_0x44c3('0x77')](_0x44c3('0xb9')),'ContactId':_0x230dd8[_0x44c3('0xd9')],'ListId':_0x230dd8['ListId'],'VoiceQueueId':_0x230dd8[_0x44c3('0xdb')]||undefined,'CampaignId':_0x230dd8[_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch('[rescheduleContact][Machine]'));_0x4b474a({'reschedule':0x1});}}});}}};Dialer[_0x44c3('0x17')][_0x44c3('0x2e')]=function(_0x34a8d8){var _0x286b93=this['uniqueId'][_0x34a8d8['uniqueid']];var _0x9125f1;if(_0x286b93&&_0x286b93['type']==='ivr'){delete this[_0x44c3('0x22')][_0x34a8d8['uniqueid']];this[_0x44c3('0xb7')](this[_0x44c3('0x1d')][_0x286b93[_0x44c3('0xb5')]]);this[_0x44c3('0x1d')][_0x286b93[_0x44c3('0xb5')]][_0x44c3('0x125')]+=0x1;_0x9125f1=new Hangup(_0x286b93,_0x34a8d8);hopperUtils['createHistory'](_0x9125f1)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x126')));hopperUtils[_0x44c3('0xc2')](_0x9125f1)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x127')));}if(_0x286b93&&_0x286b93[_0x44c3('0x39')]!==_0x44c3('0xb6')&&isNotNull(this[_0x44c3('0x1c')][_0x286b93[_0x44c3('0xb5')]][_0x44c3('0x128')])){delete this[_0x44c3('0x22')][_0x34a8d8[_0x44c3('0xba')]];this['updateOriginated'](this['voiceQueues'][_0x286b93[_0x44c3('0xb5')]]);this[_0x44c3('0x1c')][_0x286b93[_0x44c3('0xb5')]][_0x44c3('0xbb')]+=0x1;this[_0x44c3('0x1c')][_0x286b93[_0x44c3('0xb5')]]['outboundAnswerAgiCallsDay']+=0x1;_0x9125f1=new Hangup(_0x286b93,_0x34a8d8);_0x9125f1[_0x44c3('0x67')]=0x10;_0x9125f1[_0x44c3('0x68')]='AnswerAGI';_0x9125f1[_0x44c3('0x10c')]=_0x44c3('0x129');hopperUtils[_0x44c3('0xc0')](_0x9125f1)['catch'](loggerCatch(_0x44c3('0x126')));hopperUtils[_0x44c3('0xc2')](_0x9125f1)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x127')));}if(_0x286b93&&_0x286b93['type']!==_0x44c3('0xb6')&&!isNotNull(this[_0x44c3('0x1c')][_0x286b93['queue']]['dialQueueProject'])){if(_0x34a8d8[_0x44c3('0x12a')]==='Normal\x20Clearing'){delete this[_0x44c3('0x22')][_0x34a8d8['uniqueid']];this[_0x44c3('0x1c')][_0x286b93[_0x44c3('0xb5')]]['outboundAnswerCallsDay']+=0x1;const _0x17ded8=new AgentComplete(_0x286b93,_0x34a8d8);_0x17ded8['CampaignId']=this['voiceQueues'][_0x286b93[_0x44c3('0xb5')]]['id'];hopperUtils['createHistory'](_0x17ded8)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0xc1')));hopperUtils[_0x44c3('0xc2')](_0x17ded8)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x12b')));}else{delete this[_0x44c3('0x22')][_0x34a8d8[_0x44c3('0xba')]];this['updateOriginated'](this['voiceQueues'][_0x286b93[_0x44c3('0xb5')]]);this[_0x44c3('0x1c')][_0x286b93[_0x44c3('0xb5')]]['outboundUnknownCallsDay']+=0x1;_0x9125f1=new Hangup(_0x286b93,_0x34a8d8);_0x9125f1[_0x44c3('0x67')]=0xc;_0x9125f1[_0x44c3('0x68')]=_0x34a8d8[_0x44c3('0x12a')];_0x9125f1[_0x44c3('0x10c')]=_0x44c3('0x12c');hopperUtils[_0x44c3('0xc0')](_0x9125f1)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x126')));hopperUtils['moveContactManagedDialer'](_0x9125f1)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x127')));}}};Dialer['prototype'][_0x44c3('0xc')]=function(_0x32f8bd){var _0x5638c4=this;if(!_0x5638c4[_0x44c3('0x12d')][_0x32f8bd['name']]){_0x5638c4[_0x44c3('0x12d')][_0x32f8bd[_0x44c3('0x5a')]]={'running':![]};}else if(_0x5638c4['queuesSummary'][_0x32f8bd['name']][_0x44c3('0x12e')]===!![]){return;}else if(_0x5638c4[_0x44c3('0x12d')][_0x32f8bd[_0x44c3('0x5a')]]['running']===![]){_0x5638c4['queuesSummary'][_0x32f8bd[_0x44c3('0x5a')]][_0x44c3('0x12e')]=!![];}var _0x5a70a6=_0x5638c4[_0x44c3('0x1c')][_0x32f8bd[_0x44c3('0x5a')]];var _0x48eaac=_0x5a70a6['message']!==utils[_0x44c3('0x64')]['INACTIVE'];var _0x40e5e1=utils[_0x44c3('0x12f')](_0x5a70a6);_0x5a70a6[_0x44c3('0x130')]=utils[_0x44c3('0x131')](_0x5a70a6,_0x5638c4[_0x44c3('0x1e')]);Promise[_0x44c3('0x132')]()[_0x44c3('0x37')](function(){if(_0x5a70a6[_0x44c3('0x130')]===utils['CAMPAIGN_STATUS'][_0x44c3('0x74')]){if(_0x48eaac){clearPredictiveAttributes(_0x5a70a6);_0x32f8bd[_0x44c3('0x133')]=undefined;_0x32f8bd[_0x44c3('0x58')]=undefined;}if(_0x5a70a6['statusMessage']===utils[_0x44c3('0x64')]['INACTIVE']){_0x32f8bd[_0x44c3('0x134')]=0x0;_0x32f8bd['paused']=0x0;_0x32f8bd[_0x44c3('0x135')]=0x0;_0x32f8bd['talking']=0x0;_0x32f8bd['pTalking']=0x0;}}else if(_0x5a70a6[_0x44c3('0x130')]===utils[_0x44c3('0x64')]['ACTIVE']&&!_0x40e5e1){return _0x5638c4[_0x44c3('0x8b')](_0x5a70a6,!![])['then'](function(){return _0x5638c4[_0x44c3('0x8b')](_0x5a70a6,![]);})[_0x44c3('0x37')](function(){return _0x5638c4['checkDialMethod'](_0x5a70a6);})[_0x44c3('0x9a')](function(_0x3624f1){loggerSyncQueueSummary[_0x44c3('0x3b')](_0x44c3('0x136'),util[_0x44c3('0x60')](_0x3624f1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5a70a6);});}else{clearPredictiveAttributes(_0x5a70a6);}})['then'](function(){var _0x34535f=_0x32f8bd[_0x44c3('0x137')](_0x5a70a6);if(_0x34535f||_0x5a70a6[_0x44c3('0x138')]){_0x5a70a6['queueSummaryCountersUpdated']=![];_0x32f8bd[_0x44c3('0x139')](_0x5a70a6);Object['assign'](_0x5a70a6,_0x32f8bd);emitOutboundVoiceQueueSummary(_0x32f8bd);}_0x5638c4[_0x44c3('0x12d')][_0x5a70a6[_0x44c3('0x5a')]]['running']=![];})[_0x44c3('0x9a')](function(_0x36f500){logger['error']('[syncQueueSummary]',util[_0x44c3('0x60')](_0x36f500,{'showHidden':![],'depth':null}));_0x5638c4['queuesSummary'][_0x5a70a6[_0x44c3('0x5a')]][_0x44c3('0x12e')]=![];});};Dialer['prototype'][_0x44c3('0x2c')]=_['throttle'](function(){var _0x4c5d7a=_[_0x44c3('0x13a')](this[_0x44c3('0x1c')],function(_0x350450){return _0x350450[_0x44c3('0x13b')];});var _0xdf01bd=_['filter'](this[_0x44c3('0xed')],function(_0x17c8c5){return _0x17c8c5[_0x44c3('0x13c')]&&_0x17c8c5[_0x44c3('0x82')]==='reachable';});if(_0x4c5d7a[_0x44c3('0x93')]>0x0&&_0xdf01bd[_0x44c3('0x93')]>0x0){return Promise[_0x44c3('0x132')]()[_0x44c3('0x37')](cmHopper['handlePreviewRecallNotifications'](_[_0x44c3('0x13d')](_0x4c5d7a,'id'),previewRecallmeReminderInterval,_[_0x44c3('0x13d')](_0xdf01bd,'id')))['then'](function(_0x19aaa7){for(var _0x582402=0x0;_0x582402<_0x19aaa7[_0x44c3('0x93')];_0x582402++){var _0x2f514e=_0x19aaa7[_0x582402][_0x44c3('0x13e')][_0x44c3('0x5a')];if(_0x2f514e)io['to'](util[_0x44c3('0x77')](_0x44c3('0x13f'),_0x2f514e))['emit'](_0x44c3('0x140'),{'hopper':_0x19aaa7[_0x582402]});}})[_0x44c3('0x9a')](function(_0x149e43){logger[_0x44c3('0x5e')](_0x44c3('0x141'),_0x149e43);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x44c3('0x17')][_0x44c3('0x35')]=function(){var _0x437f6e=this;setInterval(function(){_0x437f6e[_0x44c3('0x142')](_0x437f6e[_0x44c3('0x22')],_0x44c3('0x143'));_0x437f6e[_0x44c3('0x142')](_0x437f6e[_0x44c3('0x20')],_0x44c3('0x144'));},0x32c8);};Dialer[_0x44c3('0x17')][_0x44c3('0x142')]=function(_0x509651,_0x201147){var _0x40b764=this;for(var _0x2a09be in _0x509651){if(typeof _0x509651[_0x2a09be]!==_0x44c3('0x145')){this[_0x44c3('0x1a')][_0x44c3('0x18')](function(){if(!_[_0x44c3('0xf1')](_0x509651[_0x2a09be])){return ami['Action']({'action':_0x44c3('0x82'),'channel':_0x509651[_0x2a09be][_0x44c3('0xe8')]})[_0x44c3('0x9a')](function(_0x36293c){if(_0x36293c[_0x44c3('0x63')]===_0x44c3('0x146')){setTimeout(function(){if(_0x509651[_0x2a09be]&&_0x509651[_0x2a09be][_0x44c3('0x39')]!==_0x44c3('0xb6')){_0x40b764[_0x44c3('0xb7')](_0x40b764[_0x44c3('0x1c')][_0x509651[_0x2a09be]['queue']]);logger[_0x44c3('0x5e')]('[Dialer][checkChannel]',_0x201147,_0x2a09be,_0x509651[_0x2a09be][_0x44c3('0xb5')]);delete _0x509651[_0x2a09be];}if(_0x509651[_0x2a09be]&&_0x509651[_0x2a09be][_0x44c3('0x39')]==='ivr'){_0x40b764[_0x44c3('0xb7')](_0x40b764[_0x44c3('0x1d')][_0x509651[_0x2a09be][_0x44c3('0xb5')]]);logger[_0x44c3('0x5e')]('[Dialer][checkChannel][ivr]',_0x201147,_0x2a09be,_0x509651[_0x2a09be][_0x44c3('0xb5')]);delete _0x509651[_0x2a09be];}},0x2328);}});}});}}};Dialer['prototype'][_0x44c3('0x147')]=function(_0x25e39e){return Promise[_0x44c3('0x132')]()[_0x44c3('0x37')](voiceQueueRt[_0x44c3('0x147')](_0x25e39e))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x44c3('0x17')][_0x44c3('0xb7')]=function(_0x48e3d1){if(!_[_0x44c3('0x4b')](_0x48e3d1)&&_0x48e3d1!==null){if(typeof _0x48e3d1[_0x44c3('0x148')]!=='undefined'){if(_0x48e3d1[_0x44c3('0x148')]>0x0){_0x48e3d1[_0x44c3('0x148')]-=0x1;}else{logger[_0x44c3('0x5e')](_0x44c3('0x149'));}}}else{logger[_0x44c3('0x5e')](_0x44c3('0x14a'));}};Dialer[_0x44c3('0x17')][_0x44c3('0x14b')]=function(_0x59d064,_0x4e4153){var _0x16b559=this;return function(_0x2b44d1){_0x16b559[_0x44c3('0xb7')](_0x4e4153);logger[_0x44c3('0x5e')](_0x59d064,util['inspect'](_0x2b44d1,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x44c3('0x14c')]=function(_0x3c96a4,_0x1ddb53,_0x33c1d9){var _0xac828e={'state':0x19,'statedesc':'notFound'};this[_0x44c3('0xb7')](_0x1ddb53);this[_0x44c3('0x110')](_['merge'](_0xac828e,_[_0x44c3('0x6e')](_0x33c1d9,[_0x44c3('0xd9'),_0x44c3('0xda'),_0x44c3('0x14d'),_0x44c3('0xdb'),_0x44c3('0xdc')])),_0x44c3('0x14e'),_0x44c3('0x14f'));logger[_0x44c3('0x5e')](_0x3c96a4);};Dialer[_0x44c3('0x17')]['saveInDb']=function(_0x21a3a0,_0x53a4e6,_0x34401b){hopperUtils[_0x44c3('0xc0')](_0x21a3a0)['catch'](loggerCatch(_0x53a4e6));hopperUtils[_0x44c3('0xc2')](_0x21a3a0)[_0x44c3('0x9a')](loggerCatch(_0x34401b));};Dialer[_0x44c3('0x17')]['queueCallerAbandonCreateState']=function(_0x209f67,_0x1a0b11){hopperUtils[_0x44c3('0xc0')](_0x209f67)['catch'](loggerCatch(_0x44c3('0xc1')));if(_0x1a0b11==0x0){hopperUtils[_0x44c3('0xc2')](_0x209f67)[_0x44c3('0x9a')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x44c3('0x17')][_0x44c3('0x141')]=function(_0x471c3a){return Promise['resolve']()[_0x44c3('0x37')](cmHopper[_0x44c3('0x150')](_0x471c3a['id'],previewRecallmeReminderInterval))[_0x44c3('0x37')](function(_0x7e1d25){for(var _0x18ec10=0x0;_0x18ec10<_0x7e1d25[_0x44c3('0x93')];_0x18ec10++){var _0x110e73=_0x7e1d25[_0x18ec10][_0x44c3('0x13e')]['name'];if(_0x110e73)io['to'](util['format'](_0x44c3('0x13f'),_0x110e73))[_0x44c3('0x38')](_0x44c3('0x140'),{'hopper':_0x7e1d25[_0x18ec10]});}})[_0x44c3('0x9a')](function(){});};Dialer[_0x44c3('0x17')][_0x44c3('0xa6')]=function(_0x38f5f8){var _0x35d40e=this;return function(){_0x35d40e[_0x44c3('0x151')](_0x38f5f8);};};Dialer[_0x44c3('0x17')][_0x44c3('0x152')]=function(_0x24c528,_0x2cac26){var _0x168fc1=this;var _0x5317ff=uuid['v4']();this['actions'][_0x5317ff]=new Action(_0x24c528,_0x2cac26,_0x5317ff);return new Promise(function(_0x49262c,_0x1599b8){if(_[_0x44c3('0x4b')](_0x24c528)&&typeof _0x24c528!=='object'){return _0x1599b8(msgResponse(_0x44c3('0x153'),_0x44c3('0x8c'),_0x44c3('0x154')));}if(_[_0x44c3('0x4b')](_0x2cac26[_0x44c3('0x155')])||_0x2cac26[_0x44c3('0x155')]===null){return _0x1599b8(msgResponse('originate',_0x44c3('0x8c'),'contact\x20is\x20undefine'));}var _0x1bef3c={'XMD-CALLERID':_0x168fc1[_0x44c3('0x20')][_0x5317ff][_0x44c3('0x156')](),'XMD-AGI':_0x24c528[_0x44c3('0x128')]?util[_0x44c3('0x77')](_0x44c3('0x157'),ipAgi,_0x24c528[_0x44c3('0x128')]):_0x44c3('0x158'),'XMD-AGIAFTER':_0x24c528[_0x44c3('0xcc')]?util[_0x44c3('0x77')](_0x44c3('0x157'),ipAgi,_0x24c528[_0x44c3('0xcc')]):_0x44c3('0x158'),'XMD-QUEUE':utils[_0x44c3('0x159')](_0x24c528)?util[_0x44c3('0x77')](_0x44c3('0x15a'),_0x24c528[_0x44c3('0x5a')],_0x24c528[_0x44c3('0x15b')]||'',_0x24c528[_0x44c3('0xbf')]?'c':'',_0x24c528[_0x44c3('0xc7')]||0x3):_0x44c3('0x158'),'XMD-CONTACTID':_0x2cac26['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x168fc1['actions'][_0x5317ff][_0x44c3('0x156')](),'XMD-AMD':_0x24c528[_0x44c3('0x107')]?_0x44c3('0x15c'):_0x44c3('0x158'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x24c528['dialAMDActive']){_0x1bef3c[_0x44c3('0x15d')]=_0x24c528[_0x44c3('0x15e')]||0x9c4;_0x1bef3c[_0x44c3('0x15f')]=_0x24c528[_0x44c3('0x160')]||0x5dc;_0x1bef3c['XMD-AMDAFTERGREETINGSILENCE']=_0x24c528[_0x44c3('0x161')]||0x320;_0x1bef3c[_0x44c3('0x162')]=_0x24c528[_0x44c3('0x163')]||0x1388;_0x1bef3c[_0x44c3('0x164')]=_0x24c528[_0x44c3('0x165')]||0x64;_0x1bef3c['XMD-AMDBETWEENWORDSSILENCE']=_0x24c528[_0x44c3('0x166')]||0x32;_0x1bef3c[_0x44c3('0x167')]=_0x24c528[_0x44c3('0x168')]||0x3;_0x1bef3c['XMD-AMDSILENCETHRESHOLD']=_0x24c528[_0x44c3('0x169')]||0x100;_0x1bef3c[_0x44c3('0x16a')]=_0x24c528[_0x44c3('0x16b')]||0x1388;}if(utils[_0x44c3('0x159')](_0x24c528)){_0x1bef3c[_0x44c3('0x16c')]=_0x2cac26[_0x44c3('0xdb')];}else{_0x1bef3c[_0x44c3('0x16d')]=_0x2cac26['CampaignId'];}var _0x25f5ce=utils[_0x44c3('0x16e')](_0x2cac26[_0x44c3('0x16f')]);Object[_0x44c3('0x170')](_0x1bef3c,_0x25f5ce);var _0x4ef9f7=_0x168fc1[_0x44c3('0x85')](_0x24c528[_0x44c3('0x86')])?utils[_0x44c3('0x171')](_0x24c528[_0x44c3('0x86')][_0x44c3('0x172')],_0x24c528[_0x44c3('0x173')],_0x24c528[_0x44c3('0x174')]>0x0?utils[_0x44c3('0x175')](_0x24c528[_0x44c3('0x176')],_0x24c528[_0x44c3('0x174')]):_0x24c528['dialOriginateCallerIdNumber']):utils[_0x44c3('0x171')](_[_0x44c3('0xf1')](_0x24c528[_0x44c3('0x177')])?_0x24c528[_0x44c3('0x86')][_0x44c3('0x172')]:_0x24c528['TrunkBackup'][_0x44c3('0x172')],_0x24c528[_0x44c3('0x173')],_0x24c528['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x44c3('0x175')](_0x24c528[_0x44c3('0x176')],_0x24c528[_0x44c3('0x174')]):_0x24c528[_0x44c3('0x176')]);if(_0x4ef9f7){_0x1bef3c[_0x44c3('0x178')]=_0x168fc1[_0x44c3('0x20')][_0x5317ff][_0x44c3('0x179')]=utils[_0x44c3('0x17a')](_0x4ef9f7);_0x1bef3c['XMD-ORIGINATECALLERIDNUM']=_0x2cac26[_0x44c3('0x155')];}_0x24c528['variables']=_0x1bef3c;return ami[_0x44c3('0x94')]({'actionid':_0x5317ff,'action':_0x44c3('0x153'),'channel':_0x168fc1['isTrunkReachable'](_0x24c528['Trunk'])?util[_0x44c3('0x77')]('SIP/%s/%s%s',_0x24c528['Trunk'][_0x44c3('0x5a')],isNotNull(_0x24c528[_0x44c3('0x17b')])?_0x24c528[_0x44c3('0x17b')][_0x44c3('0x17c')]()||'':'',_0x24c528[_0x44c3('0x17d')]>0x0?_0x2cac26[_0x44c3('0x155')]['substring'](_0x24c528[_0x44c3('0x17d')]):_0x2cac26[_0x44c3('0x155')]):util['format'](_0x44c3('0x17e'),_['isNil'](_0x24c528[_0x44c3('0x177')])?_0x24c528[_0x44c3('0x86')]['name']:_0x24c528[_0x44c3('0x177')][_0x44c3('0x5a')],isNotNull(_0x24c528[_0x44c3('0x17b')])?_0x24c528[_0x44c3('0x17b')][_0x44c3('0x17c')]()||'':'',_0x24c528[_0x44c3('0x17d')]>0x0?_0x2cac26[_0x44c3('0x155')]['substring'](_0x24c528[_0x44c3('0x17d')]):_0x2cac26[_0x44c3('0x155')]),'callerid':_0x4ef9f7,'Exten':_0x44c3('0x106'),'Context':_0x44c3('0x17f'),'Priority':'1','variable':_0x1bef3c,'timeout':(_0x24c528[_0x44c3('0x180')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5317ff})[_0x44c3('0x37')](function(_0x4c72d4){return _0x49262c(_0x4c72d4);})[_0x44c3('0x9a')](function(_0x43cdab){_0x24c528[_0x44c3('0x181')]+=0x1;var _0x1deae6=new History(_0x168fc1[_0x44c3('0x20')][_0x5317ff]);logger[_0x44c3('0x5e')](util[_0x44c3('0x77')](_0x44c3('0x182'),JSON['stringify'](_0x43cdab)));_0x1deae6[_0x44c3('0x67')]=0xe;_0x1deae6[_0x44c3('0x68')]=_0x44c3('0x183');_0x1deae6['starttime']=moment()[_0x44c3('0x77')](_0x44c3('0xb9'));_0x1deae6[_0x44c3('0x69')]=_0x1deae6[_0x44c3('0x6a')];hopperUtils[_0x44c3('0xc0')](_0x1deae6)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x184')));_0x168fc1[_0x44c3('0xc2')](_0x1deae6)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x184')))[_0x44c3('0xfa')](function(){delete _0x168fc1[_0x44c3('0x20')][_0x5317ff];return _0x1599b8(msgResponse(_0x44c3('0x153'),_0x44c3('0x7f'),_0x44c3('0x185')));});});});};Dialer[_0x44c3('0x17')][_0x44c3('0x186')]=function(_0x2239c2,_0x4241e8,_0x4de142){var _0x153e78=new History(_0x4241e8);if(_0x153e78[_0x44c3('0x122')]+_0x153e78[_0x44c3('0x117')]+_0x153e78['countnoanswerretry']+_0x153e78[_0x44c3('0x123')]+_0x153e78[_0x44c3('0xd3')]+_0x153e78[_0x44c3('0xe5')]+_0x153e78['countmachineretry']+_0x153e78[_0x44c3('0x119')]>=_0x4de142[_0x44c3('0x11a')]-0x1){return!![];}switch(_0x2239c2){case 0x3:if(_0x153e78[_0x44c3('0x118')]>=_0x4de142[_0x44c3('0x187')]-0x1){return!![];}hopperUtils[_0x44c3('0xd6')]({'active':![],'countnoanswerretry':_0x153e78[_0x44c3('0x118')]+=0x1,'scheduledat':moment()['add'](_0x4de142[_0x44c3('0x188')],_0x44c3('0xd8'))[_0x44c3('0x77')](_0x44c3('0xb9')),'ContactId':_0x153e78[_0x44c3('0xd9')],'ListId':_0x153e78['ListId'],'VoiceQueueId':_0x153e78['VoiceQueueId']||undefined,'CampaignId':_0x153e78[_0x44c3('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x153e78[_0x44c3('0x122')]>=_0x4de142[_0x44c3('0x189')]-0x1){return!![];}hopperUtils[_0x44c3('0xd6')]({'active':![],'countbusyretry':_0x153e78[_0x44c3('0x122')]+=0x1,'scheduledat':moment()[_0x44c3('0xd7')](_0x4de142['dialBusyRetryFrequency'],'minutes')[_0x44c3('0x77')](_0x44c3('0xb9')),'ContactId':_0x153e78[_0x44c3('0xd9')],'ListId':_0x153e78[_0x44c3('0xda')],'VoiceQueueId':_0x153e78[_0x44c3('0xdb')]||undefined,'CampaignId':_0x153e78[_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x18a')));break;case 0x8:if(_0x153e78[_0x44c3('0x117')]>=_0x4de142[_0x44c3('0x18b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x153e78[_0x44c3('0x117')]+=0x1,'scheduledat':moment()['add'](_0x4de142[_0x44c3('0x18c')],'minutes')[_0x44c3('0x77')](_0x44c3('0xb9')),'ContactId':_0x153e78[_0x44c3('0xd9')],'ListId':_0x153e78['ListId'],'VoiceQueueId':_0x153e78[_0x44c3('0xdb')]||undefined,'CampaignId':_0x153e78[_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x18d')));break;case 0x0:if(_0x153e78[_0x44c3('0x123')]>=_0x4de142[_0x44c3('0x18e')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x153e78[_0x44c3('0x123')]+=0x1,'scheduledat':moment()[_0x44c3('0xd7')](_0x4de142[_0x44c3('0x18f')],_0x44c3('0xd8'))[_0x44c3('0x77')](_0x44c3('0xb9')),'ContactId':_0x153e78[_0x44c3('0xd9')],'ListId':_0x153e78[_0x44c3('0xda')],'VoiceQueueId':_0x153e78[_0x44c3('0xdb')]||undefined,'CampaignId':_0x153e78[_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x190')));}break;case 0xa:if(_0x153e78[_0x44c3('0xd3')]>=_0x4de142[_0x44c3('0xd4')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x153e78['countdropretry']+=0x1,'scheduledat':moment()[_0x44c3('0xd7')](_0x4de142['dialDropRetryFrequency'],'minutes')[_0x44c3('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x153e78[_0x44c3('0xd9')],'ListId':_0x153e78['ListId'],'VoiceQueueId':_0x153e78[_0x44c3('0xdb')]||undefined,'CampaignId':_0x153e78[_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch(_0x44c3('0xdd')));break;case 0xb:if(_0x153e78[_0x44c3('0xe5')]>=_0x4de142[_0x44c3('0xe7')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x153e78[_0x44c3('0xe5')]+=0x1,'scheduledat':moment()[_0x44c3('0xd7')](_0x4de142['dialAbandonedRetryFrequency'],_0x44c3('0xd8'))['format'](_0x44c3('0xb9')),'ContactId':_0x153e78[_0x44c3('0xd9')],'ListId':_0x153e78[_0x44c3('0xda')],'VoiceQueueId':_0x153e78[_0x44c3('0xdb')]||undefined,'CampaignId':_0x153e78['CampaignId']||undefined})[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x191')));break;case 0x13:if(_0x153e78[_0x44c3('0x114')]>=_0x4de142[_0x44c3('0x11d')]-0x1){return!![];}hopperUtils[_0x44c3('0xd6')]({'active':![],'countmachineretry':_0x153e78[_0x44c3('0x114')]+=0x1,'scheduledat':moment()[_0x44c3('0xd7')](_0x4de142[_0x44c3('0x124')],'minutes')[_0x44c3('0x77')](_0x44c3('0xb9')),'ContactId':_0x153e78[_0x44c3('0xd9')],'ListId':_0x153e78['ListId'],'VoiceQueueId':_0x153e78[_0x44c3('0xdb')]||undefined,'CampaignId':_0x153e78[_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x192')));break;case 0x14:if(_0x153e78[_0x44c3('0x119')]>=_0x4de142[_0x44c3('0x193')]-0x1){return!![];}hopperUtils[_0x44c3('0xd6')]({'active':![],'countagentrejectretry':_0x153e78[_0x44c3('0x119')]+=0x1,'scheduledat':moment()[_0x44c3('0xd7')](_0x4de142['dialAgentRejectRetryFrequency'],_0x44c3('0xd8'))['format'](_0x44c3('0xb9')),'ContactId':_0x153e78[_0x44c3('0xd9')],'ListId':_0x153e78[_0x44c3('0xda')],'VoiceQueueId':_0x153e78[_0x44c3('0xdb')]||undefined,'CampaignId':_0x153e78[_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x194')));break;default:return!![];}};Dialer[_0x44c3('0x17')][_0x44c3('0x102')]=function(_0x31141f,_0xab976f,_0x374100){var _0x48ea1a=this;var _0x15198b=new History(_0x31141f);var _0x1eb4f7=![];var _0x3c0058;var _0x22ef6c;return new Promise(function(_0x4e754c,_0x1d5bfc){if(_[_0x44c3('0x4b')](_0xab976f)&&typeof _0xab976f!==_0x44c3('0x195')){return _0x1d5bfc(msgResponse(_0x44c3('0x196'),_0x44c3('0x8c'),_0x44c3('0x197')));}if(_[_0x44c3('0x4b')](_0x374100)&&typeof _0x374100!==_0x44c3('0x195')){return _0x1d5bfc(msgResponse('[callProgressDetecting]',_0x44c3('0x8c'),_0x44c3('0x198')));}hopperUtils['verifyAdditionalPhones'](_0x15198b,_0x374100[_0x44c3('0xbc')],_0xab976f)['then'](function(_0x21e7a3){if(_0x21e7a3[_0x44c3('0xd2')]==0x1)_0x1eb4f7=!![];switch(_0x374100['reason']){case'0':_0xab976f[_0x44c3('0x199')]+=0x1;_0x15198b[_0x44c3('0x67')]=0x0;_0x15198b[_0x44c3('0x68')]=_0x44c3('0x19a');_0x15198b[_0x44c3('0x123')]+=0x1;_0x15198b[_0x44c3('0xcd')]+=0x1;ami[_0x44c3('0x38')](_0x44c3('0x19b'),ut[_0x44c3('0x115')](_0x31141f,_0x44c3('0x19c')));_0x3c0058=_0xab976f[_0x44c3('0x18f')];_0x22ef6c=_0xab976f[_0x44c3('0xcf')];hopperUtils[_0x44c3('0xc0')](_0x15198b)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x116')));if(_0x48ea1a[_0x44c3('0x186')](0x0,_0x31141f,_0xab976f)&&!_0x1eb4f7){if(_0x15198b[_0x44c3('0x123')]>=_0xab976f['dialNoSuchNumberMaxRetry']){_0x48ea1a[_0x44c3('0x11e')](_0x15198b,_0x4e754c,_0x1d5bfc,'reason\x200\x20no\x20such\x20number....');}else{_0x48ea1a[_0x44c3('0x11b')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x19d'));}}break;case'3':_0xab976f[_0x44c3('0x19e')]+=0x1;_0x15198b[_0x44c3('0x67')]=0x3;_0x15198b[_0x44c3('0x68')]=_0x44c3('0x19f');_0x15198b[_0x44c3('0x118')]+=0x1;_0x15198b[_0x44c3('0xcd')]+=0x1;var _0x1febad=ut['buildNoAnswerEventPayload'](_0x31141f,_0xab976f);ami[_0x44c3('0x38')](_0x44c3('0x1a0'),_0x1febad);_0x3c0058=_0xab976f['dialNoAnswerRetryFrequency'];_0x22ef6c=_0xab976f[_0x44c3('0xcf')];hopperUtils['createHistory'](_0x15198b)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x48ea1a[_0x44c3('0x186')](0x3,_0x31141f,_0xab976f)&&!_0x1eb4f7){if(_0x15198b[_0x44c3('0x118')]>=_0xab976f[_0x44c3('0x187')]){_0x48ea1a[_0x44c3('0x11e')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x1a1'));}else{_0x48ea1a[_0x44c3('0x11b')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x1a1'));}}break;case'5':_0xab976f[_0x44c3('0x1a2')]+=0x1;_0x15198b[_0x44c3('0x67')]=0x5;_0x15198b['statedesc']=_0x44c3('0x1a3');_0x15198b[_0x44c3('0x122')]+=0x1;_0x15198b['countglobal']+=0x1;ami[_0x44c3('0x38')]('custom:agentbusy',ut[_0x44c3('0x115')](_0x31141f,_0x44c3('0x1a4')));_0x3c0058=_0xab976f['dialBusyRetryFrequency'];_0x22ef6c=_0xab976f[_0x44c3('0xcf')];hopperUtils[_0x44c3('0xc0')](_0x15198b)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x1a5')));if(_0x48ea1a['checkRetriveMax'](0x5,_0x31141f,_0xab976f)&&!_0x1eb4f7){if(_0x15198b[_0x44c3('0x122')]>=_0xab976f[_0x44c3('0x189')]){_0x48ea1a['createStateFinal'](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x1a6'));}else{_0x48ea1a[_0x44c3('0x11b')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x1a6'));}}break;case'8':_0xab976f[_0x44c3('0x1a7')]+=0x1;_0x15198b[_0x44c3('0x67')]=0x8;_0x15198b['statedesc']=_0x44c3('0x1a8');_0x15198b[_0x44c3('0x117')]+=0x1;_0x15198b[_0x44c3('0xcd')]+=0x1;_0x3c0058=_0xab976f[_0x44c3('0x18c')];_0x22ef6c=_0xab976f[_0x44c3('0xcf')];ami[_0x44c3('0x38')](_0x44c3('0x1a9'),ut[_0x44c3('0x115')](_0x31141f,_0x44c3('0x1aa')));hopperUtils[_0x44c3('0xc0')](_0x15198b)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x1ab')));if(_0x48ea1a[_0x44c3('0x186')](0x8,_0x31141f,_0xab976f)&&!_0x1eb4f7){if(_0x15198b[_0x44c3('0x117')]>=_0xab976f[_0x44c3('0x18b')]){_0x48ea1a[_0x44c3('0x11e')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x1ac'));}else{_0x48ea1a['stateGlobal'](_0x15198b,_0x4e754c,_0x1d5bfc,'reason\x208\x20congestion');}}break;case'11':_0xab976f[_0x44c3('0x1ad')]+=0x1;_0x15198b[_0x44c3('0x67')]=0xb;_0x15198b[_0x44c3('0x68')]='Abandoned';_0x15198b[_0x44c3('0xe5')]+=0x1;_0x15198b['countglobal']+=0x1;_0x3c0058=_0xab976f['dialAbandonedRetryFrequency'];_0x22ef6c=_0xab976f[_0x44c3('0xcf')];hopperUtils[_0x44c3('0xc0')](_0x15198b)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x48ea1a[_0x44c3('0x186')](0xb,_0x31141f,_0xab976f)&&!_0x1eb4f7){if(_0x15198b[_0x44c3('0xe5')]>=_0xab976f[_0x44c3('0xe7')]){_0x48ea1a[_0x44c3('0x11e')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x1ae'));}else{_0x48ea1a['stateGlobal'](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x1ae'));}}break;case'20':_0xab976f[_0x44c3('0x1af')]+=0x1;_0x15198b[_0x44c3('0x67')]=0x14;_0x15198b['statedesc']=_0x44c3('0x1b0');_0x15198b[_0x44c3('0x119')]+=0x1;_0x15198b[_0x44c3('0xcd')]+=0x1;_0x3c0058=_0xab976f[_0x44c3('0x1b1')];_0x22ef6c=_0xab976f[_0x44c3('0xcf')];ami[_0x44c3('0x38')](_0x44c3('0x1b2'),ut['buildObj'](_0x31141f,_0x44c3('0x1b3')));hopperUtils['createHistory'](_0x15198b)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x1b4')));if(_0x48ea1a[_0x44c3('0x186')](0x14,_0x31141f,_0xab976f)&&!_0x1eb4f7){if(_0x15198b[_0x44c3('0x119')]>=_0xab976f[_0x44c3('0x193')]){_0x48ea1a[_0x44c3('0x11e')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x1b5'));}else{_0x48ea1a[_0x44c3('0x11b')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x44c3('0x1b5'));}}break;default:_0xab976f[_0x44c3('0x1b6')]+=0x1;_0x15198b[_0x44c3('0x67')]=0xc;_0x15198b[_0x44c3('0x68')]=_0x374100[_0x44c3('0xbc')];_0x3c0058=_0xab976f[_0x44c3('0x1b1')];_0x22ef6c=_0xab976f[_0x44c3('0xcf')];hopperUtils[_0x44c3('0xc0')](_0x15198b)[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x1b7')));if(_0x48ea1a[_0x44c3('0x186')](_0x374100[_0x44c3('0xbc')],_0x31141f,_0xab976f)&&!_0x1eb4f7){if(_0x15198b[_0x44c3('0x122')]+_0x15198b[_0x44c3('0x117')]+_0x15198b['countnoanswerretry']+_0x15198b['countnosuchnumberretry']+_0x15198b[_0x44c3('0xd3')]+_0x15198b[_0x44c3('0xe5')]+_0x15198b['countmachineretry']+_0x15198b['countagentrejectretry']>=_0xab976f[_0x44c3('0x11a')]){_0x48ea1a[_0x44c3('0x11b')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x374100[_0x44c3('0xbc')]);}else{_0x48ea1a[_0x44c3('0x11e')](_0x15198b,_0x4e754c,_0x1d5bfc,_0x374100[_0x44c3('0xbc')]);}}}})['then'](function(){if(_0x1eb4f7){hopperUtils[_0x44c3('0xe0')](_0x15198b,_0x3c0058,_0x22ef6c)['then'](function(){return _0x4e754c(0x1);});}});});};Dialer[_0x44c3('0x17')][_0x44c3('0x11b')]=function(_0x454565,_0x43e54b,_0x39a6af,_0x580078){var _0x5dd872=new Final(_0x454565);_0x5dd872[_0x44c3('0x67')]=0xf;_0x5dd872[_0x44c3('0x68')]='Global';this[_0x44c3('0x11e')](_0x5dd872,_0x43e54b,_0x39a6af,_0x580078);};Dialer[_0x44c3('0x17')][_0x44c3('0x11e')]=function(_0x367491,_0x449fcc,_0x5f5252,_0x2ff558){hopperUtils[_0x44c3('0xc2')](_0x367491)['then'](function(){return _0x449fcc(msgResponse(_0x44c3('0x196'),_0x44c3('0x1b8'),_0x2ff558));})['catch'](function(){return _0x5f5252(msgResponse(_0x44c3('0x1b9'),_0x44c3('0x8c'),_0x44c3('0x1ba')));});};Dialer['prototype']['predictive']=function(_0x1a8a01){var _0x556f79=_0x1a8a01[_0x44c3('0x1bb')]/0x64;var _0xa32231=_0x1a8a01['outboundDropCallsDayTimeout']/(_0x1a8a01[_0x44c3('0xc8')]+_0x1a8a01[_0x44c3('0xbb')]);var _0x3f106c=Math[_0x44c3('0x1bc')](_0x1a8a01[_0x44c3('0x1bd')]*(_0x1a8a01[_0x44c3('0x1be')]/0x64));var _0x4fe0ee=Math['round'](_0x1a8a01[_0x44c3('0x1bd')]*(_0x1a8a01[_0x44c3('0x1bf')]/0x64));var _0x539057=_0x1a8a01[_0x44c3('0x134')]+_0x1a8a01[_0x44c3('0x1c0')];var _0x49d204=Math[_0x44c3('0x1c1')](_0x1a8a01[_0x44c3('0x50')]*_0x1a8a01[_0x44c3('0x54')]*_0x1a8a01[_0x44c3('0x1c2')]*_0x1a8a01[_0x44c3('0x1c3')]);if(_['isUndefined'](_0x1a8a01['startProgressive'])){if(!_[_0x44c3('0x4b')](_0x1a8a01[_0x44c3('0x133')])){_0x1a8a01[_0x44c3('0x133')]=undefined;loggerPredictive[_0x44c3('0x5e')](_0x44c3('0x1c4'),_0x44c3('0x1c5'));}if(!_[_0x44c3('0x4b')](_0x1a8a01[_0x44c3('0x5c')])){loggerPredictive[_0x44c3('0x5e')](_0x44c3('0x1c4'),_0x44c3('0x1c6'));clearInterval(_0x1a8a01[_0x44c3('0x5c')]);_0x1a8a01['handlePredictive']=undefined;}_0x1a8a01[_0x44c3('0x58')]=moment()[_0x44c3('0x77')](_0x44c3('0xb9'));loggerPredictive[_0x44c3('0x3f')](_0x1a8a01[_0x44c3('0x5a')],_0x44c3('0x1c7'),_0x1a8a01[_0x44c3('0x58')]);this[_0x44c3('0xab')](_0x1a8a01,0x1);}else if(ifInterval(_0x1a8a01[_0x44c3('0x1c8')],_0x1a8a01[_0x44c3('0x58')])){this['handlePower'](_0x1a8a01,0x1);loggerPredictiveCalls[_0x44c3('0x3f')](_0x44c3('0x1c9'),_0x1a8a01['startProgressive'],_0x1a8a01['name']);_0x1a8a01[_0x44c3('0x50')]=0x0;_0x1a8a01[_0x44c3('0xc9')]=0x0;}else if(_0x556f79<_0xa32231&&_0x1a8a01['dialPredictiveOptimization']===_0x44c3('0x1ca')){clearPredictiveAttributes(_0x1a8a01);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x1cb'),_0x44c3('0x1cc'),_0xa32231,_0x44c3('0x58'),_0x1a8a01[_0x44c3('0x5a')]);}else if(_0x49d204<_0x1a8a01[_0x44c3('0xc9')]&&_0x1a8a01['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x1a8a01);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x1cd'),_0x44c3('0x1ce'),_0x49d204,_0x44c3('0x1cf'),_0x1a8a01[_0x44c3('0xc9')],_0x44c3('0x58'),_0x1a8a01[_0x44c3('0x5a')]);}else if(!ifInterval(_0x1a8a01['dialPredictiveInterval'],_0x1a8a01[_0x44c3('0x58')])&&_[_0x44c3('0x4b')](_0x1a8a01[_0x44c3('0x133')])&&!_[_0x44c3('0x4b')](_0x1a8a01['startProgressive'])){_0x1a8a01[_0x44c3('0x133')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x1a8a01['name'],_0x44c3('0x1d0'),_0x1a8a01['startPredictive']);hopperUtils[_0x44c3('0x1d1')](_0x1a8a01[_0x44c3('0x1c8')])[_0x44c3('0x37')](this[_0x44c3('0x1d2')](_0x1a8a01))[_0x44c3('0x37')](mergeDataErlangB(_0x1a8a01))[_0x44c3('0x37')](this['startMethodPredictive'](_0x1a8a01))[_0x44c3('0x9a')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1a8a01));}else if(!ifInterval(_0x1a8a01[_0x44c3('0x1c8')],_0x1a8a01[_0x44c3('0x133')])){_0x1a8a01[_0x44c3('0xc9')]=0x0;_0x1a8a01[_0x44c3('0x133')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x44c3('0x3f')](_0x1a8a01['name'],_0x44c3('0x1d3'),_0x1a8a01[_0x44c3('0x133')]);clearInterval(_0x1a8a01[_0x44c3('0x5c')]);_0x1a8a01[_0x44c3('0x5c')]=undefined;hopperUtils['avgHandleTime'](_0x1a8a01[_0x44c3('0x1c8')])[_0x44c3('0x37')](this['getDataPredictive'](_0x1a8a01))[_0x44c3('0x37')](mergeDataErlangB(_0x1a8a01))[_0x44c3('0x37')](this['startMethodPredictive'](_0x1a8a01))[_0x44c3('0x9a')](loggerCatchPredictive(_0x44c3('0x1d4'),_0x1a8a01));}else if(_0x1a8a01['predictiveIntervalAvailable']&&_0x539057<_0x1a8a01['predictiveIntervalAvailable']-_0x4fe0ee){clearPredictiveAttributes(_0x1a8a01);loggerPredictive[_0x44c3('0x3f')](_0x1a8a01[_0x44c3('0x5a')],_0x44c3('0x1d5'),_0x539057,_0x44c3('0x1d6'),_0x1a8a01[_0x44c3('0x1bd')],'-',_0x4fe0ee,'=',_0x1a8a01[_0x44c3('0x1bd')]-_0x4fe0ee,')');}else if(_0x1a8a01[_0x44c3('0x1bd')]&&_0x539057>_0x1a8a01['predictiveIntervalAvailable']+_0x3f106c){clearPredictiveAttributes(_0x1a8a01);loggerPredictive[_0x44c3('0x3f')](_0x1a8a01[_0x44c3('0x5a')],_0x44c3('0x1d5'),_0x539057,')\x20are\x20more\x20than\x20threshold\x20(',_0x1a8a01['predictiveIntervalAvailable'],'+',_0x3f106c,'=',_0x1a8a01[_0x44c3('0x1bd')]+_0x3f106c,')');}};Dialer['prototype'][_0x44c3('0x1d2')]=function(_0xab7307){var _0x91afb3=this;return function(_0x199e1a){return new Promise(function(_0x274925,_0x2dd409){_[_0x44c3('0x57')](_0xab7307,_0x199e1a[0x0]);if(checkGetDataPredictive(_0x199e1a[0x0])){var _0x44e5dc=_0xab7307[_0x44c3('0x1bd')]=_0xab7307[_0x44c3('0x1c0')]+_0xab7307[_0x44c3('0x134')];var _0x450961=_0xab7307[_0x44c3('0x1c8')]*0x3c;var _0x1f3db0=_0x199e1a[0x0][_0x44c3('0x48')]+_0x199e1a[0x0]['predictiveIntervalAvgHoldtime'];var _0x41f233=(_0x199e1a[0x0]['predictiveIntervalAnsweredCalls']+_0x199e1a[0x0][_0x44c3('0x45')]+_0x199e1a[0x0][_0x44c3('0xe1')])/_0x199e1a[0x0]['predictiveIntervalTotalCalls'];_0xab7307[_0x44c3('0x1c2')]=_0x41f233>0x0?_0x41f233:0x1;switch(_0xab7307[_0x44c3('0x1d7')]){case'dropRate':var _0x32a2c3=_0xab7307[_0x44c3('0x1bb')]/0x64;return _0x91afb3[_0x44c3('0x1d8')](_0x44e5dc,_0x450961,_0x1f3db0,_0x41f233,_0x32a2c3)[_0x44c3('0x37')](function(_0x5b5146){return _0x274925(_0x5b5146);});case _0x44c3('0x1d9'):var _0xfa4e12=_0xab7307[_0x44c3('0x1bb')]/0x64;return _0x91afb3['busyFactor'](_0x44e5dc,_0x450961,_0x1f3db0,_0x41f233,_0xfa4e12)[_0x44c3('0x37')](function(_0x4bc65a){return _0x274925(_0x4bc65a);});default:return _0x2dd409(msgResponse(_0x44c3('0x1da'),_0x44c3('0x8c'),_0x44c3('0x1db')));}}else{return _0x2dd409(msgResponse(_0x44c3('0x1da'),'Failure',_0x44c3('0x1dc')));}});};};Dialer[_0x44c3('0x17')]['getDataPredictiveOld']=function(_0x99a64){var _0x5d455e=this;return function(_0x43cea8){return new Promise(function(_0x470259,_0x125b85){_[_0x44c3('0x57')](_0x99a64,_0x43cea8[0x0]);if(checkGetDataPredictive(_0x43cea8[0x0])){loggerPredictive['info'](JSON['stringify'](_0x43cea8[0x0]));if(_0x99a64[_0x44c3('0x1d7')]===_0x44c3('0x1ca')){return _0x5d455e[_0x44c3('0x147')](_0x99a64['id'])[_0x44c3('0x37')](function(_0x2d83ab){var _0x3e7514=_0x99a64[_0x44c3('0x1dd')]-_0x2d83ab[0x0][_0x44c3('0x1de')];var _0x3845d8=_0x99a64[_0x44c3('0x1c8')]*0x3c;var _0x2bc524=_0x43cea8[0x0][_0x44c3('0x48')]+_0x43cea8[0x0][_0x44c3('0x4c')];var _0x5976c7=(_0x43cea8[0x0]['predictiveIntervalAnsweredCalls']+_0x43cea8[0x0][_0x44c3('0x45')]+_0x43cea8[0x0][_0x44c3('0xe1')])/_0x43cea8[0x0]['predictiveIntervalTotalCalls'];var _0x1369a2=_0x99a64[_0x44c3('0x1bb')]/0x64;_0x99a64[_0x44c3('0x1df')]=_0x2d83ab[0x0][_0x44c3('0x1de')]||0x0;_0x99a64['predictiveIntervalHitRate']=_0x5976c7>0x0?_0x5976c7:0x1;return _0x5d455e['abandonmentRate'](_0x3e7514,_0x3845d8,_0x2bc524,_0x5976c7,_0x1369a2);})['then'](function(_0x3136a2){return _0x470259(_0x3136a2);})[_0x44c3('0x9a')](function(_0x235bb5){return _0x125b85(msgResponse(_0x44c3('0x1e0'),_0x44c3('0x8c'),JSON[_0x44c3('0x6d')](_0x235bb5)));});}if(_0x99a64['dialPredictiveOptimization']===_0x44c3('0x1d9')){return _0x5d455e[_0x44c3('0x147')](_0x99a64['id'])[_0x44c3('0x37')](function(_0x245b96){var _0x3da49c=_0x99a64['loggedIn']-_0x245b96[0x0][_0x44c3('0x1de')];var _0x25ee2f=_0x99a64[_0x44c3('0x1c8')]*0x3c;var _0x33257e=_0x43cea8[0x0][_0x44c3('0x48')]+_0x43cea8[0x0]['predictiveIntervalAvgHoldtime'];var _0x2591e4=(_0x43cea8[0x0][_0x44c3('0x43')]+_0x43cea8[0x0][_0x44c3('0x45')]+_0x43cea8[0x0][_0x44c3('0xe1')])/_0x43cea8[0x0][_0x44c3('0x4a')];var _0x260c52=_0x99a64[_0x44c3('0x1bb')]/0x64;_0x99a64[_0x44c3('0x1df')]=_0x245b96[0x0][_0x44c3('0x1de')]||0x0;_0x99a64[_0x44c3('0x1c2')]=_0x2591e4>0x0?_0x2591e4:0x1;return _0x5d455e['busyFactor'](_0x3da49c,_0x25ee2f,_0x33257e,_0x2591e4,_0x260c52);})[_0x44c3('0x37')](function(_0x97b324){return _0x470259(_0x97b324);})[_0x44c3('0x9a')](function(_0x1fb417){return _0x125b85(msgResponse(_0x44c3('0x1e0'),_0x44c3('0x8c'),JSON['stringify'](_0x1fb417)));});}}else{return _0x125b85(msgResponse(_0x44c3('0x1da'),_0x44c3('0x8c'),'check\x20failure'));}});};};Dialer['prototype'][_0x44c3('0x1e1')]=function(_0xd12e0a){var _0x1bfe69=this;return function(){var _0xa38a80=0x0;var _0x15dcc0=Math[_0x44c3('0x1c1')](_0xd12e0a[_0x44c3('0x52')]*0x3e8);if(_0x15dcc0>0x0){_0x15dcc0=_0x15dcc0<0x64?0x64:_0x15dcc0;loggerPredictive[_0x44c3('0x3f')](_0xd12e0a[_0x44c3('0x5a')],_0x44c3('0x1e2'),_0x15dcc0,_0x44c3('0x1e3'));_0xd12e0a[_0x44c3('0x5c')]=setInterval(function(){_0x1bfe69['handlePredictive'](_0xd12e0a);loggerPredictiveCalls[_0x44c3('0x3f')](_0x44c3('0x1e4'),_0xa38a80+=0x1);},_0x15dcc0);}else{loggerPredictive[_0x44c3('0x3f')](_0xd12e0a['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x44c3('0x17')][_0x44c3('0x1e5')]=function(_0x4b52d9,_0x4d1714){var _0x10adb4=this;return function(_0x43d179){if(_['isEmpty'](_0x43d179)){if(_[_0x44c3('0xf1')](_0x4d1714[_0x44c3('0x14d')])||!_0x4d1714['recallme']){if(_0x4b52d9[_0x44c3('0xa9')]===_0x44c3('0xae')){_0x4b52d9['queueStatusComplete']=_[_0x44c3('0x4b')](_0x4b52d9[_0x44c3('0x6c')])?!![]:_0x4b52d9['queueStatusComplete'];var _0x3000e5=uuid['v4']();_0x10adb4[_0x44c3('0x20')][_0x3000e5]=new Action(_0x4b52d9,_0x4d1714,_0x3000e5);loggerBooked[_0x44c3('0x3f')]('[booked][checkContactBlack]',_0x3000e5,_0x44c3('0x1e6'),JSON[_0x44c3('0x6d')](_0x4b52d9[_0x44c3('0x6c')]),_0x44c3('0x1e7'),_0x4b52d9[_0x44c3('0x5a')]);if(_0x4b52d9[_0x44c3('0x6c')]){_0x4b52d9[_0x44c3('0x6c')]=![];_0x10adb4[_0x44c3('0xf2')][_0x10adb4[_0x44c3('0x20')][_0x3000e5][_0x44c3('0xb5')]]=[];ami[_0x44c3('0x94')]({'actionid':_0x3000e5,'action':_0x44c3('0x1e8'),'queue':_0x4b52d9[_0x44c3('0x5a')]})[_0x44c3('0x9a')](function(){_0x10adb4[_0x44c3('0xb7')](_0x4b52d9);hopperUtils[_0x44c3('0xd6')]({'active':![],'ContactId':_0x10adb4[_0x44c3('0x20')][_0x3000e5][_0x44c3('0xd9')],'ListId':_0x10adb4[_0x44c3('0x20')][_0x3000e5][_0x44c3('0xda')],'VoiceQueueId':_0x10adb4['actions'][_0x3000e5][_0x44c3('0xdb')]||undefined,'CampaignId':_0x10adb4['actions'][_0x3000e5][_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x1e9')));delete _0x10adb4[_0x44c3('0x20')][_0x3000e5];});}else{loggerBooked[_0x44c3('0x3f')](_0x44c3('0x1ea'),JSON[_0x44c3('0x6d')](_0x4b52d9['queueStatusComplete']),_0x44c3('0x1e7'),_0x4b52d9['name']);_0x10adb4['updateOriginated'](_0x4b52d9);hopperUtils[_0x44c3('0xd6')]({'active':![],'ContactId':_0x10adb4[_0x44c3('0x20')][_0x3000e5][_0x44c3('0xd9')],'ListId':_0x10adb4[_0x44c3('0x20')][_0x3000e5][_0x44c3('0xda')],'VoiceQueueId':_0x10adb4[_0x44c3('0x20')][_0x3000e5]['VoiceQueueId']||undefined,'CampaignId':_0x10adb4[_0x44c3('0x20')][_0x3000e5][_0x44c3('0xdc')]||undefined})['catch'](loggerCatch(_0x44c3('0x1e9')));delete _0x10adb4[_0x44c3('0x20')][_0x3000e5];}}else{return _0x10adb4[_0x44c3('0x152')](_0x4b52d9,_0x4d1714);}}else{if(utils['getSeconds'](undefined,_0x4d1714['scheduledat'])<_0x4b52d9['dialRecallMeTimeout']*0x3c){if(_0x4d1714[_0x44c3('0x13e')]&&!_0x4d1714[_0x44c3('0x13e')][_0x44c3('0x1eb')]){_0x10adb4[_0x44c3('0x1b')]['run'](_0x4d1714['id'])['finally'](function(){_0x10adb4[_0x44c3('0xb7')](_0x4b52d9);});}else{hopperUtils[_0x44c3('0x1ec')]({'active':![]},_0x4d1714['id'],0x1)[_0x44c3('0xfa')](function(){_0x10adb4[_0x44c3('0xb7')](_0x4b52d9);});}}else{_0x4b52d9[_0x44c3('0x1ed')]+=0x1;_0x10adb4[_0x44c3('0xb7')](_0x4b52d9);if(_0x4b52d9[_0x44c3('0x1ee')]){hopperUtils[_0x44c3('0xd6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d1714['ContactId'],'ListId':_0x4d1714[_0x44c3('0xda')],'VoiceQueueId':_0x4d1714[_0x44c3('0xdb')]||undefined,'CampaignId':_0x4d1714[_0x44c3('0xdc')]||undefined})[_0x44c3('0x9a')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x44c3('0xc0')](createObjHistory(_0x4b52d9,_0x4d1714,utils[_0x44c3('0x64')][_0x44c3('0x1ef')],0x17,_0x44c3('0x1f0')))[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x1f1')));}else{_0x10adb4['saveInDb'](createObjHistory(_0x4b52d9,_0x4d1714,utils[_0x44c3('0x64')][_0x44c3('0x1f2')],0x16,_0x44c3('0x1f3')),_0x44c3('0x1f4'),'[Originate][HistoryRecallClose]');}}}}else{_0x4b52d9['outboundBlacklistCallsDay']+=0x1;_0x10adb4[_0x44c3('0x110')](createObjHistory(_0x4b52d9,_0x4d1714,utils['CAMPAIGN_STATUS'][_0x44c3('0x1f5')],0xd,_0x44c3('0x1f6')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x44c3('0x1f7');}};};Dialer[_0x44c3('0x17')][_0x44c3('0x151')]=function(_0x2ac093){var _0x10a1b3=this;var _0x2d853b=_0x2ac093[_0x44c3('0x1f8')]-_0x2ac093[_0x44c3('0x148')];emitCampaignSummary(_0x2ac093);if(_0x2d853b>0x0&&_0x2ac093[_0x44c3('0x1f9')]==0x0){if(_0x2d853b>this[_0x44c3('0x1f')]){_0x2d853b=this[_0x44c3('0x1f')];}_0x2ac093['temp']=0x1;hopperUtils['getContactDialerIvr'](_0x2ac093,_0x2d853b)[_0x44c3('0x37')](function(_0x365465){_0x2ac093[_0x44c3('0x1f9')]=0x0;if(_0x365465){if(!utils[_0x44c3('0x1fa')](_0x365465)){_0x2ac093['message']=utils[_0x44c3('0x64')][_0x44c3('0x1fb')];logger[_0x44c3('0x3f')](_0x44c3('0x1fc')+_0x2ac093[_0x44c3('0x5a')]);}else{_0x2ac093[_0x44c3('0x148')]+=_0x365465[_0x44c3('0x93')];_0x2ac093[_0x44c3('0x63')]=utils[_0x44c3('0x64')][_0x44c3('0x1fd')];for(var _0x21aa24=0x0;_0x21aa24<_0x365465[_0x44c3('0x93')];_0x21aa24+=0x1){_0x2ac093['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x365465[_0x21aa24])||_[_0x44c3('0xf1')](_0x365465[_0x21aa24]['Contact'])||_['isNil'](_0x365465[_0x21aa24][_0x44c3('0x155')])){_0x10a1b3[_0x44c3('0x14c')](_0x44c3('0x1fe'),_0x2ac093,_0x365465[_0x21aa24]);}else{hopperUtils[_0x44c3('0x1ff')](_['pick'](_0x365465[_0x21aa24],[_0x44c3('0xdc'),_0x44c3('0x155')]))['then'](_0x10a1b3[_0x44c3('0x1e5')](_0x2ac093,_0x365465[_0x21aa24]))['catch'](_0x10a1b3[_0x44c3('0x14b')](_0x44c3('0x200'),_0x2ac093));}}}}})[_0x44c3('0x9a')](loggerGetContactDialer(_0x44c3('0x201'),_0x2ac093,_0x2d853b));}};Dialer['prototype'][_0x44c3('0xab')]=function(_0x26341c,_0x2f6dc6){var _0x3a9dee=this;var _0x3a5167=[];if(_0x2f6dc6<0x1||_0x26341c[_0x44c3('0xa9')]===_0x44c3('0xae')){_0x2f6dc6=0x1;}var _0x199152=Math[_0x44c3('0x1c1')](_0x26341c[_0x44c3('0x134')]*_0x2f6dc6)-_0x26341c[_0x44c3('0x148')];if(_0x26341c[_0x44c3('0x202')]>0x0){var _0x11e759=_0x26341c[_0x44c3('0x202')]-_0x26341c[_0x44c3('0x148')]-_0x26341c[_0x44c3('0x1c0')]-_0x26341c[_0x44c3('0x203')];if(_0x199152>_0x11e759){_0x199152=_0x11e759;}}if(_0x199152>0x0&&_0x26341c[_0x44c3('0x1f9')]==0x0){if(_0x26341c[_0x44c3('0xa9')]===_0x44c3('0xae')){_0x199152=0x1;}if(_0x199152>this[_0x44c3('0x1f')]){_0x199152=this['maxNumberOriginate'];}for(var _0x48195d in this[_0x44c3('0xed')]){if(typeof this['agents'][_0x48195d]!==_0x44c3('0x145')){if(this[_0x44c3('0xed')][_0x48195d][_0x44c3('0x67')]===_0x44c3('0x204')&&this[_0x44c3('0xed')][_0x48195d]['status']===_0x44c3('0x205')){_0x3a5167[_0x44c3('0x9b')](this[_0x44c3('0xed')][_0x48195d]['id']);}}}_0x26341c['temp']=0x1;hopperUtils[_0x44c3('0x206')](_0x26341c,_0x3a5167,_0x199152)['then'](function(_0x4427bb){_0x26341c[_0x44c3('0x1f9')]=0x0;if(_0x4427bb){if(!utils[_0x44c3('0x1fa')](_0x4427bb)){hopperUtils[_0x44c3('0x207')](_0x26341c)['then'](sendMessageReschedule(_0x26341c))[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x208')));}else{_0x26341c[_0x44c3('0x148')]+=_0x4427bb['length'];_0x26341c[_0x44c3('0x63')]=_0x26341c[_0x44c3('0xa9')]===_0x44c3('0xae')?utils[_0x44c3('0x64')][_0x44c3('0x15c')]:utils[_0x44c3('0x64')][_0x44c3('0x1fd')];for(var _0x6cbf03=0x0;_0x6cbf03<_0x4427bb[_0x44c3('0x93')];_0x6cbf03+=0x1){if(_[_0x44c3('0xf1')](_0x4427bb[_0x6cbf03])||_['isNil'](_0x4427bb[_0x6cbf03]['Contact'])||_['isNil'](_0x4427bb[_0x6cbf03]['phone'])){_0x3a9dee[_0x44c3('0x14c')](_0x44c3('0x1fe'),_0x26341c,_0x4427bb[_0x6cbf03]);}else{hopperUtils[_0x44c3('0x209')](_['pick'](_0x4427bb[_0x6cbf03],[_0x44c3('0xdb'),_0x44c3('0x155')]))[_0x44c3('0x37')](_0x3a9dee[_0x44c3('0x1e5')](_0x26341c,_0x4427bb[_0x6cbf03]))['catch'](_0x3a9dee[_0x44c3('0x14b')](_0x44c3('0x1fe'),_0x26341c));}}}}})[_0x44c3('0x9a')](loggerGetContactDialer('[getContactDialer2]',_0x26341c,_0x199152));}};Dialer['prototype'][_0x44c3('0x5c')]=function(_0x1100cf){if(_0x1100cf[_0x44c3('0x202')]>0x0){var _0x368c4d=_0x1100cf['dialLimitQueue']-_0x1100cf[_0x44c3('0x148')]-_0x1100cf['talking'];if(_0x368c4d>0x0&&_0x1100cf[_0x44c3('0x1f9')]==0x0){this['tryOriginatePredictive'](_0x1100cf);}else{loggerPredictiveCalls[_0x44c3('0x3f')](_0x44c3('0x20a'));}}else{this['tryOriginatePredictive'](_0x1100cf);}};Dialer[_0x44c3('0x17')][_0x44c3('0x20b')]=function(_0x2cbe1f){var _0x634b8c=this;var _0x5ad0bb=[];_0x2cbe1f[_0x44c3('0x148')]+=0x1;for(var _0xb6b4ff in this[_0x44c3('0xed')]){if(typeof this[_0x44c3('0xed')][_0xb6b4ff]!=='undefined'){if(this['agents'][_0xb6b4ff][_0x44c3('0x67')]===_0x44c3('0x204')&&this['agents'][_0xb6b4ff][_0x44c3('0x82')]===_0x44c3('0x205')){_0x5ad0bb[_0x44c3('0x9b')](this[_0x44c3('0xed')][_0xb6b4ff]['id']);}}}_0x2cbe1f[_0x44c3('0x1f9')]=0x1;return this[_0x44c3('0x206')](_0x2cbe1f['id'],_0x5ad0bb,0x1,_0x2cbe1f[_0x44c3('0x20c')],_0x2cbe1f)[_0x44c3('0x37')](function(_0xaf6e79){_0x2cbe1f[_0x44c3('0x1f9')]=0x1;if(_0xaf6e79){if(!utils['checkContactEmpty'](_0xaf6e79)){utils[_0x44c3('0x61')](_0x2cbe1f,0x1,0x0);return hopperUtils[_0x44c3('0x207')](_0x2cbe1f)[_0x44c3('0x37')](sendMessageReschedule(_0x2cbe1f))[_0x44c3('0x9a')](loggerCatch(_0x44c3('0x208')));}else{_0x2cbe1f['message']=utils[_0x44c3('0x64')]['RUNNING'];if(_[_0x44c3('0xf1')](_0xaf6e79[0x0])||_[_0x44c3('0xf1')](_0xaf6e79[0x0][_0x44c3('0x16f')])||_[_0x44c3('0xf1')](_0xaf6e79[0x0]['phone'])){_0x634b8c[_0x44c3('0x14c')](_0x44c3('0x1fe'),_0x2cbe1f,_0xaf6e79[0x0]);}else{return hopperUtils[_0x44c3('0x209')](_[_0x44c3('0x6e')](_0xaf6e79[0x0],[_0x44c3('0xdb'),_0x44c3('0x155')]))[_0x44c3('0x37')](_0x634b8c[_0x44c3('0x1e5')](_0x2cbe1f,_0xaf6e79[0x0]))[_0x44c3('0x9a')](_0x634b8c[_0x44c3('0x14b')](_0x44c3('0x20d'),_0x2cbe1f));}}}})[_0x44c3('0x9a')](loggerGetContactDialer(_0x44c3('0x20e'),_0x2cbe1f,0x1));};Dialer[_0x44c3('0x17')][_0x44c3('0x1d8')]=function(_0x42b347,_0x213b3e,_0x471a80,_0x27d5da,_0x3399cc,_0x3016df){loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x20f'));loggerPredictive[_0x44c3('0x3f')]('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',_0x42b347);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x210'),_0x213b3e);loggerPredictive[_0x44c3('0x3f')]('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',_0x471a80);loggerPredictive['info'](_0x44c3('0x211'),_0x27d5da);loggerPredictive['info'](_0x44c3('0x212'),_0x3399cc);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x49'));return new Promise(function(_0x103969,_0x5b4ca7){if(_0x42b347<=0x0||isNaN(_0x42b347)){return _0x5b4ca7(msgResponse(_0x44c3('0x213'),'Error',_0x44c3('0x214')+_0x42b347));}if(_0x471a80<=0x0||isNaN(_0x471a80)){return _0x5b4ca7(msgResponse(_0x44c3('0x213'),_0x44c3('0x7f'),_0x44c3('0x215')+_0x471a80));}if(_0x27d5da<=0x0||isNaN(_0x27d5da)){return _0x5b4ca7(msgResponse(_0x44c3('0x213'),'Error',_0x44c3('0x216')+_0x27d5da));}if(_0x213b3e<=0x0||isNaN(_0x213b3e)){return _0x5b4ca7(msgResponse(_0x44c3('0x213'),_0x44c3('0x7f'),_0x44c3('0x217')+_0x213b3e));}if(_0x3399cc<=0x0||isNaN(_0x3399cc)){return _0x5b4ca7(msgResponse(_0x44c3('0x213'),'Error',_0x44c3('0x218')+_0x3399cc));}_0x3016df=_0x3016df||0x0;var _0x35fe59=0x1/_0x471a80;var _0x47c3cb=0x0;var _0x13eb0b=0x0;var _0x37fb87=0x0;var _0x592973=0x0;for(var _0x13bdf1=0x0;_0x37fb87<_0x3399cc;_0x13bdf1+=0x1){_0x13eb0b=_0x13bdf1/_0x213b3e;_0x47c3cb=(_0x27d5da*_0x13eb0b+_0x3016df)/_0x35fe59;_0x37fb87=utils[_0x44c3('0x219')](_0x47c3cb,_0x42b347);_0x592973=_0x47c3cb/_0x42b347*(0x1-utils[_0x44c3('0x219')](_0x47c3cb,_0x42b347));}return _0x103969({'erlangCalls':_0x13bdf1,'erlangCallToSecond':_0x213b3e/_0x13bdf1,'erlangAbandonmentRate':_0x37fb87,'erlangBusyFactor':_0x592973});});};Dialer[_0x44c3('0x17')][_0x44c3('0x21a')]=function(_0x236c78,_0x4701a6,_0x310657,_0x414ee1,_0x55b4e7,_0x3fffdd){loggerPredictive[_0x44c3('0x3f')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x44c3('0x21b'),_0x236c78);loggerPredictive['info'](_0x44c3('0x210'),_0x4701a6);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x21c'),_0x310657);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x211'),_0x414ee1);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x21d'),_0x55b4e7);loggerPredictive[_0x44c3('0x3f')](_0x44c3('0x49'));return new Promise(function(_0x6d06d6,_0x536ad7){if(_0x236c78<=0x0||isNaN(_0x236c78)){return _0x536ad7(msgResponse(_0x44c3('0x21e'),_0x44c3('0x7f'),_0x44c3('0x214')+_0x236c78));}if(_0x310657<=0x0||isNaN(_0x310657)){return _0x536ad7(msgResponse(_0x44c3('0x21e'),_0x44c3('0x7f'),_0x44c3('0x215')+_0x310657));}if(_0x414ee1<=0x0||isNaN(_0x414ee1)){return _0x536ad7(msgResponse(_0x44c3('0x21e'),_0x44c3('0x7f'),_0x44c3('0x216')+_0x414ee1));}if(_0x4701a6<=0x0||isNaN(_0x4701a6)){return _0x536ad7(msgResponse(_0x44c3('0x21e'),_0x44c3('0x7f'),'interval\x20=\x20'+_0x4701a6));}if(_0x55b4e7<=0x0||isNaN(_0x55b4e7)){return _0x536ad7(msgResponse(_0x44c3('0x21e'),_0x44c3('0x7f'),_0x44c3('0x21f')+_0x55b4e7));}_0x3fffdd=_0x3fffdd||0x0;var _0x3f94c3=0x1/_0x310657;var _0x5e8bde=0x0;var _0x4cbef4=0x0;var _0xeb13d4=0x0;var _0x483737=0x0;for(var _0x377c83=0x0;_0x483737<_0x55b4e7;_0x377c83+=0x1){_0x4cbef4=_0x377c83/_0x4701a6;_0x5e8bde=(_0x414ee1*_0x4cbef4+_0x3fffdd)/_0x3f94c3;_0xeb13d4=utils[_0x44c3('0x219')](_0x5e8bde,_0x236c78);_0x483737=_0x5e8bde/_0x236c78*(0x1-utils['erlangb'](_0x5e8bde,_0x236c78));}return _0x6d06d6({'erlangCalls':_0x377c83,'erlangCallToSecond':_0x4701a6/_0x377c83,'erlangAbandonmentRate':_0xeb13d4,'erlangBusyFactor':_0x483737});});};module[_0x44c3('0x220')]=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 18bf934..18a461a 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 _0xda38=['callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','substring','dialCutDigit','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','CampaignId','idHopper','starttime'];(function(_0x366ce0,_0x4c3fad){var _0x5ae1c0=function(_0x6a4ad6){while(--_0x6a4ad6){_0x366ce0['push'](_0x366ce0['shift']());}};_0x5ae1c0(++_0x4c3fad);}(_0xda38,0x1b0));var _0x8da3=function(_0x5942d9,_0x569c84){_0x5942d9=_0x5942d9-0x0;var _0x4aa2b0=_0xda38[_0x5942d9];return _0x4aa2b0;};'use strict';var util=require(_0x8da3('0x0'));var _=require('lodash');var moment=require(_0x8da3('0x1'));function checkNameSurname(_0x24e570,_0xdc14e1,_0x5e1628){var _0x29a7a7='';if(!_[_0x8da3('0x2')](_0xdc14e1)&&_0x8da3('0x3')===typeof _0xdc14e1){_0x29a7a7+=_0xdc14e1;}if(!_['isNil'](_0x5e1628)&&_0x8da3('0x3')===typeof _0x5e1628){_0x29a7a7+='\x20'+_0x5e1628;}if(_0x29a7a7!==''){return _0x29a7a7;}return _0x24e570;}function Action(_0x2a87e5,_0x3b508b,_0x12d02c){this[_0x8da3('0x4')]=_0x2a87e5;this[_0x8da3('0x5')]=_0x12d02c||undefined;this[_0x8da3('0x6')]=checkNameSurname(_0x3b508b[_0x8da3('0x7')]['phone'],_0x3b508b[_0x8da3('0x7')][_0x8da3('0x8')],_0x3b508b[_0x8da3('0x7')][_0x8da3('0x9')]);this[_0x8da3('0xa')]=_0x3b508b[_0x8da3('0xb')];this[_0x8da3('0xc')]=_0x2a87e5[_0x8da3('0x6')];this['active']=_0x3b508b[_0x8da3('0xd')]||![];this[_0x8da3('0xe')]=_0x2a87e5['type'];this[_0x8da3('0xf')]=_0x2a87e5[_0x8da3('0xf')]||0x3;this[_0x8da3('0x10')]=_0x3b508b['scheduledat'];this[_0x8da3('0x11')]=_0x3b508b[_0x8da3('0x11')];this[_0x8da3('0x12')]=_0x3b508b[_0x8da3('0x12')];this['countnoanswerretry']=_0x3b508b['countnoanswerretry'];this[_0x8da3('0x13')]=_0x3b508b[_0x8da3('0x13')];this[_0x8da3('0x14')]=_0x3b508b[_0x8da3('0x14')];this[_0x8da3('0x15')]=_0x3b508b['countabandonedretry'];this[_0x8da3('0x16')]=_0x3b508b[_0x8da3('0x16')];this[_0x8da3('0x17')]=_0x3b508b[_0x8da3('0x17')];this[_0x8da3('0x18')]=_0x3b508b['ContactId'];this[_0x8da3('0x19')]=_0x3b508b['ListId'];this[_0x8da3('0x1a')]=_0x3b508b[_0x8da3('0x1a')];this['VoiceQueueId']=_0x3b508b['VoiceQueueId'];this[_0x8da3('0x1b')]=_0x3b508b['CampaignId'];this[_0x8da3('0x1c')]=_0x3b508b['id'];this['ContactFirstName']=_0x3b508b[_0x8da3('0x7')][_0x8da3('0x8')]||'';this[_0x8da3('0x1d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8da3('0x1e')]=_0x3b508b[_0x8da3('0x1e')];this[_0x8da3('0x1f')]=_0x3b508b[_0x8da3('0x1f')];this[_0x8da3('0x20')]=_0x3b508b['callbackat'];this['recallme']=_0x3b508b[_0x8da3('0x21')];this['originatecalleridnum']='';this[_0x8da3('0x22')]='';}Action[_0x8da3('0x23')][_0x8da3('0x24')]=function(){return util[_0x8da3('0x25')](_0x8da3('0x26'),this[_0x8da3('0x6')],this[_0x8da3('0x4')]['dialCutDigit']>0x0?this[_0x8da3('0xa')][_0x8da3('0x27')](this['voiceQueue'][_0x8da3('0x28')]):this[_0x8da3('0xa')]);};Action['prototype']['getQueue']=function(){return this['queue'];};module[_0x8da3('0x29')]=Action; \ No newline at end of file +var _0x326f=['\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','moment','string','isNil','voiceQueue','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x326f,0xdb));var _0xf326=function(_0x4efba1,_0x2d55b7){_0x4efba1=_0x4efba1-0x0;var _0x50c1eb=_0x326f[_0x4efba1];return _0x50c1eb;};'use strict';var util=require(_0xf326('0x0'));var _=require('lodash');var moment=require(_0xf326('0x1'));function checkNameSurname(_0x1e60ab,_0x53a03d,_0x296647){var _0x280233='';if(!_['isNil'](_0x53a03d)&&_0xf326('0x2')===typeof _0x53a03d){_0x280233+=_0x53a03d;}if(!_[_0xf326('0x3')](_0x296647)&&_0xf326('0x2')===typeof _0x296647){_0x280233+='\x20'+_0x296647;}if(_0x280233!==''){return _0x280233;}return _0x1e60ab;}function Action(_0x29212f,_0x498be0,_0x35410f){this[_0xf326('0x4')]=_0x29212f;this['uniqueid']=_0x35410f||undefined;this[_0xf326('0x5')]=checkNameSurname(_0x498be0['Contact'][_0xf326('0x6')],_0x498be0[_0xf326('0x7')][_0xf326('0x8')],_0x498be0[_0xf326('0x7')][_0xf326('0x9')]);this[_0xf326('0xa')]=_0x498be0[_0xf326('0x6')];this[_0xf326('0xb')]=_0x29212f['name'];this[_0xf326('0xc')]=_0x498be0['active']||![];this[_0xf326('0xd')]=_0x29212f[_0xf326('0xd')];this[_0xf326('0xe')]=_0x29212f[_0xf326('0xe')]||0x3;this[_0xf326('0xf')]=_0x498be0['scheduledat'];this[_0xf326('0x10')]=_0x498be0[_0xf326('0x10')];this[_0xf326('0x11')]=_0x498be0[_0xf326('0x11')];this['countnoanswerretry']=_0x498be0[_0xf326('0x12')];this[_0xf326('0x13')]=_0x498be0['countnosuchnumberretry'];this['countdropretry']=_0x498be0[_0xf326('0x14')];this[_0xf326('0x15')]=_0x498be0[_0xf326('0x15')];this[_0xf326('0x16')]=_0x498be0[_0xf326('0x16')];this[_0xf326('0x17')]=_0x498be0[_0xf326('0x17')];this[_0xf326('0x18')]=_0x498be0[_0xf326('0x18')];this['ListId']=_0x498be0['ListId'];this[_0xf326('0x19')]=_0x498be0['UserId'];this[_0xf326('0x1a')]=_0x498be0['VoiceQueueId'];this[_0xf326('0x1b')]=_0x498be0['CampaignId'];this[_0xf326('0x1c')]=_0x498be0['id'];this[_0xf326('0x1d')]=_0x498be0[_0xf326('0x7')][_0xf326('0x8')]||'';this[_0xf326('0x1e')]=moment()[_0xf326('0x1f')](_0xf326('0x20'));this[_0xf326('0x21')]=_0x498be0[_0xf326('0x21')];this['callbackuniqueid']=_0x498be0[_0xf326('0x22')];this[_0xf326('0x23')]=_0x498be0[_0xf326('0x23')];this['recallme']=_0x498be0[_0xf326('0x24')];this[_0xf326('0x25')]='';this['originatecalleridname']='';}Action['prototype'][_0xf326('0x26')]=function(){return util[_0xf326('0x1f')](_0xf326('0x27'),this[_0xf326('0x5')],this['voiceQueue'][_0xf326('0x28')]>0x0?this[_0xf326('0xa')]['substring'](this[_0xf326('0x4')][_0xf326('0x28')]):this[_0xf326('0xa')]);};Action['prototype'][_0xf326('0x29')]=function(){return this[_0xf326('0xb')];};module[_0xf326('0x2a')]=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 dc65bc6..e613693 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 _0x1358=['starttime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','talktime','getSeconds','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','../utils','state','statedesc','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum'];(function(_0xb709ab,_0x39bee3){var _0x4d6e67=function(_0xa1eb23){while(--_0xa1eb23){_0xb709ab['push'](_0xb709ab['shift']());}};_0x4d6e67(++_0x39bee3);}(_0x1358,0x16e));var _0x8135=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x1358[_0x3635ce];return _0x97ecd0;};'use strict';var moment=require(_0x8135('0x0'));var utils=require(_0x8135('0x1'));function AgentComplete(_0x53e3da,_0x9545d1){this[_0x8135('0x2')]=0x4;this[_0x8135('0x3')]=_0x8135('0x4');this['scheduledat']=_0x53e3da['scheduledat'];this['type']=_0x53e3da[_0x8135('0x5')];this[_0x8135('0x6')]=_0x53e3da['type']===_0x8135('0x7')?_0x8135('0x8'):_0x53e3da[_0x8135('0x5')];this['countbusyretry']=_0x53e3da[_0x8135('0x9')];this[_0x8135('0xa')]=_0x53e3da[_0x8135('0xa')];this[_0x8135('0xb')]=_0x53e3da[_0x8135('0xb')];this[_0x8135('0xc')]=_0x53e3da[_0x8135('0x9')]+_0x53e3da[_0x8135('0xa')]+_0x53e3da[_0x8135('0xb')]+_0x53e3da[_0x8135('0xd')]+_0x53e3da['countdropretry']+_0x53e3da[_0x8135('0xe')]+_0x53e3da[_0x8135('0xf')]+_0x53e3da[_0x8135('0x10')];this[_0x8135('0xd')]=_0x53e3da[_0x8135('0xd')];this[_0x8135('0x11')]=_0x53e3da[_0x8135('0x11')];this[_0x8135('0xe')]=_0x53e3da[_0x8135('0xe')];this[_0x8135('0xf')]=_0x53e3da['countmachineretry'];this[_0x8135('0x10')]=_0x53e3da['countagentrejectretry'];this['uniqueid']=_0x9545d1[_0x8135('0x12')];this['calleridname']=_0x53e3da[_0x8135('0x13')];this[_0x8135('0x14')]=_0x53e3da['number'];this[_0x8135('0x15')]=_0x53e3da[_0x8135('0x15')];this['responsetime']=_0x53e3da['responsetime'];this['answertime']=_0x53e3da[_0x8135('0x16')];this[_0x8135('0x17')]=moment()[_0x8135('0x18')](_0x8135('0x19'));this[_0x8135('0x1a')]=utils['getSeconds'](_0x53e3da[_0x8135('0x1b')],_0x53e3da['starttime']);this['holdtime']=utils['getSeconds'](_0x53e3da[_0x8135('0x16')],_0x53e3da[_0x8135('0x1b')]);this[_0x8135('0x1c')]=utils[_0x8135('0x1d')](this[_0x8135('0x17')],_0x53e3da[_0x8135('0x16')]);this['queue']=_0x9545d1[_0x8135('0x8')];this[_0x8135('0x1e')]=_0x9545d1['membername'];this[_0x8135('0x1f')]=_0x9545d1[_0x8135('0x1f')];this[_0x8135('0x20')]=_0x53e3da[_0x8135('0x20')];this['callbackuniqueid']=_0x53e3da['callbackuniqueid'];this[_0x8135('0x21')]=_0x53e3da[_0x8135('0x21')];this['recallme']=_0x53e3da[_0x8135('0x22')];this[_0x8135('0x23')]=_0x53e3da[_0x8135('0x23')];this[_0x8135('0x24')]=_0x53e3da[_0x8135('0x24')];this[_0x8135('0x25')]=_0x53e3da['UserId'];this[_0x8135('0x26')]=_0x53e3da[_0x8135('0x26')];this[_0x8135('0x27')]=_0x53e3da[_0x8135('0x27')];this[_0x8135('0x28')]=_0x53e3da[_0x8135('0x28')]||'';this['originatecalleridname']=_0x53e3da[_0x8135('0x29')]||'';this['agiafterat']=_0x53e3da['agiafterat'];}module[_0x8135('0x2a')]=AgentComplete; \ No newline at end of file +var _0x98f1=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x3f0a7c,_0x16edda){var _0x2b3a28=function(_0x19dc6c){while(--_0x19dc6c){_0x3f0a7c['push'](_0x3f0a7c['shift']());}};_0x2b3a28(++_0x16edda);}(_0x98f1,0x1b0));var _0x198f=function(_0x2dac51,_0x5530df){_0x2dac51=_0x2dac51-0x0;var _0x5d8b12=_0x98f1[_0x2dac51];return _0x5d8b12;};'use strict';var moment=require(_0x198f('0x0'));var utils=require('../utils');function AgentComplete(_0x37dada,_0x2981ea){this[_0x198f('0x1')]=0x4;this[_0x198f('0x2')]=_0x198f('0x3');this[_0x198f('0x4')]=_0x37dada[_0x198f('0x4')];this[_0x198f('0x5')]=_0x37dada[_0x198f('0x5')];this[_0x198f('0x6')]=_0x37dada['type']===_0x198f('0x7')?_0x198f('0x8'):_0x37dada['type'];this[_0x198f('0x9')]=_0x37dada[_0x198f('0x9')];this[_0x198f('0xa')]=_0x37dada[_0x198f('0xa')];this[_0x198f('0xb')]=_0x37dada[_0x198f('0xb')];this[_0x198f('0xc')]=_0x37dada['countbusyretry']+_0x37dada[_0x198f('0xa')]+_0x37dada['countnoanswerretry']+_0x37dada[_0x198f('0xd')]+_0x37dada[_0x198f('0xe')]+_0x37dada[_0x198f('0xf')]+_0x37dada[_0x198f('0x10')]+_0x37dada[_0x198f('0x11')];this[_0x198f('0xd')]=_0x37dada[_0x198f('0xd')];this[_0x198f('0xe')]=_0x37dada[_0x198f('0xe')];this[_0x198f('0xf')]=_0x37dada[_0x198f('0xf')];this['countmachineretry']=_0x37dada[_0x198f('0x10')];this['countagentrejectretry']=_0x37dada[_0x198f('0x11')];this[_0x198f('0x12')]=_0x2981ea[_0x198f('0x12')];this[_0x198f('0x13')]=_0x37dada['name'];this['calleridnum']=_0x37dada[_0x198f('0x14')];this[_0x198f('0x15')]=_0x37dada['starttime'];this['responsetime']=_0x37dada[_0x198f('0x16')];this['answertime']=_0x37dada[_0x198f('0x17')];this[_0x198f('0x18')]=moment()[_0x198f('0x19')](_0x198f('0x1a'));this['ringtime']=utils[_0x198f('0x1b')](_0x37dada[_0x198f('0x16')],_0x37dada[_0x198f('0x15')]);this[_0x198f('0x1c')]=utils[_0x198f('0x1b')](_0x37dada['answertime'],_0x37dada[_0x198f('0x16')]);this[_0x198f('0x1d')]=utils[_0x198f('0x1b')](this['endtime'],_0x37dada[_0x198f('0x17')]);this[_0x198f('0x8')]=_0x2981ea[_0x198f('0x8')];this['membername']=_0x2981ea[_0x198f('0x1e')];this['reason']=_0x2981ea[_0x198f('0x1f')];this[_0x198f('0x20')]=_0x37dada[_0x198f('0x20')];this[_0x198f('0x21')]=_0x37dada[_0x198f('0x21')];this[_0x198f('0x22')]=_0x37dada[_0x198f('0x22')];this[_0x198f('0x23')]=_0x37dada['recallme'];this[_0x198f('0x24')]=_0x37dada[_0x198f('0x24')];this[_0x198f('0x25')]=_0x37dada[_0x198f('0x25')];this[_0x198f('0x26')]=_0x37dada[_0x198f('0x26')];this[_0x198f('0x27')]=_0x37dada[_0x198f('0x27')];this['CampaignId']=_0x37dada[_0x198f('0x28')];this[_0x198f('0x29')]=_0x37dada[_0x198f('0x29')]||'';this[_0x198f('0x2a')]=_0x37dada[_0x198f('0x2a')]||'';this[_0x198f('0x2b')]=_0x37dada[_0x198f('0x2b')];}module['exports']=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 2074c02..92d6745 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 _0xa62e=['callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x12b15f,_0x4b60ba){var _0x492a47=function(_0x1e06eb){while(--_0x1e06eb){_0x12b15f['push'](_0x12b15f['shift']());}};_0x492a47(++_0x4b60ba);}(_0xa62e,0x195));var _0xea62=function(_0xdb27c4,_0x2275cb){_0xdb27c4=_0xdb27c4-0x0;var _0x2a7c2c=_0xa62e[_0xdb27c4];return _0x2a7c2c;};'use strict';function Final(_0x46be57){this[_0xea62('0x0')]=_0x46be57[_0xea62('0x0')];this[_0xea62('0x1')]=_0x46be57['scheduledat'];this['type']=_0x46be57[_0xea62('0x2')];this[_0xea62('0x3')]=_0x46be57[_0xea62('0x2')]==='outbound'?_0xea62('0x4'):_0x46be57[_0xea62('0x2')];this[_0xea62('0x5')]=_0x46be57[_0xea62('0x5')];this['countcongestionretry']=_0x46be57[_0xea62('0x6')];this[_0xea62('0x7')]=_0x46be57[_0xea62('0x7')];this[_0xea62('0x8')]=_0x46be57[_0xea62('0x5')]+_0x46be57[_0xea62('0x6')]+_0x46be57['countnoanswerretry']+_0x46be57[_0xea62('0x9')]+_0x46be57[_0xea62('0xa')]+_0x46be57['countabandonedretry']+_0x46be57[_0xea62('0xb')]+_0x46be57['countagentrejectretry'];this['countnosuchnumberretry']=_0x46be57[_0xea62('0x9')];this[_0xea62('0xa')]=_0x46be57['countdropretry'];this[_0xea62('0xc')]=_0x46be57[_0xea62('0xc')];this[_0xea62('0xb')]=_0x46be57[_0xea62('0xb')];this[_0xea62('0xd')]=_0x46be57[_0xea62('0xd')];this[_0xea62('0x4')]=_0x46be57[_0xea62('0x4')];this[_0xea62('0xe')]=_0x46be57[_0xea62('0xe')];this[_0xea62('0xf')]=_0x46be57[_0xea62('0xf')];this[_0xea62('0x10')]=_0x46be57['starttime'];this['responsetime']=_0x46be57[_0xea62('0x11')];this[_0xea62('0x12')]=_0x46be57['responsetime'];this[_0xea62('0x13')]=_0x46be57[_0xea62('0x13')]||0x0;this['holdtime']=_0x46be57[_0xea62('0x14')]||0x0;this[_0xea62('0x15')]=_0x46be57['talktime']||0x0;this[_0xea62('0x16')]=_0x46be57['callback'];this['callbackuniqueid']=_0x46be57[_0xea62('0x17')];this[_0xea62('0x18')]=_0x46be57[_0xea62('0x18')];this['recallme']=_0x46be57['recallme'];this[_0xea62('0x19')]=_0x46be57['ContactId'];this[_0xea62('0x1a')]=_0x46be57[_0xea62('0x1a')];this['UserId']=_0x46be57[_0xea62('0x1b')];this[_0xea62('0x1c')]=_0x46be57[_0xea62('0x1c')];this['CampaignId']=_0x46be57['CampaignId'];this[_0xea62('0x1d')]=_0x46be57[_0xea62('0x1d')]||'';this[_0xea62('0x1e')]=_0x46be57['originatecalleridname']||'';this['state']=_0x46be57['state'];this['statedesc']=_0x46be57[_0xea62('0x1f')];}module[_0xea62('0x20')]=Final; \ No newline at end of file +var _0x1da9=['UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x22a87f,_0x438c59){var _0x9253ec=function(_0x64a5ec){while(--_0x64a5ec){_0x22a87f['push'](_0x22a87f['shift']());}};_0x9253ec(++_0x438c59);}(_0x1da9,0x165));var _0x91da=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1da9[_0x4cf98e];return _0x1623ac;};'use strict';function Final(_0x328a5b){this[_0x91da('0x0')]=_0x328a5b[_0x91da('0x0')];this[_0x91da('0x1')]=_0x328a5b[_0x91da('0x1')];this[_0x91da('0x2')]=_0x328a5b[_0x91da('0x2')];this['campaigntype']=_0x328a5b[_0x91da('0x2')]===_0x91da('0x3')?_0x91da('0x4'):_0x328a5b[_0x91da('0x2')];this[_0x91da('0x5')]=_0x328a5b['countbusyretry'];this[_0x91da('0x6')]=_0x328a5b[_0x91da('0x6')];this[_0x91da('0x7')]=_0x328a5b['countnoanswerretry'];this[_0x91da('0x8')]=_0x328a5b[_0x91da('0x5')]+_0x328a5b[_0x91da('0x6')]+_0x328a5b['countnoanswerretry']+_0x328a5b[_0x91da('0x9')]+_0x328a5b[_0x91da('0xa')]+_0x328a5b['countabandonedretry']+_0x328a5b[_0x91da('0xb')]+_0x328a5b[_0x91da('0xc')];this[_0x91da('0x9')]=_0x328a5b['countnosuchnumberretry'];this['countdropretry']=_0x328a5b['countdropretry'];this['countabandonedretry']=_0x328a5b[_0x91da('0xd')];this[_0x91da('0xb')]=_0x328a5b[_0x91da('0xb')];this[_0x91da('0xc')]=_0x328a5b[_0x91da('0xc')];this[_0x91da('0x4')]=_0x328a5b[_0x91da('0x4')];this[_0x91da('0xe')]=_0x328a5b['calleridname'];this['calleridnum']=_0x328a5b[_0x91da('0xf')];this[_0x91da('0x10')]=_0x328a5b['starttime'];this[_0x91da('0x11')]=_0x328a5b[_0x91da('0x11')];this[_0x91da('0x12')]=_0x328a5b[_0x91da('0x11')];this[_0x91da('0x13')]=_0x328a5b[_0x91da('0x13')]||0x0;this[_0x91da('0x14')]=_0x328a5b['holdtime']||0x0;this[_0x91da('0x15')]=_0x328a5b['talktime']||0x0;this['callback']=_0x328a5b[_0x91da('0x16')];this[_0x91da('0x17')]=_0x328a5b[_0x91da('0x17')];this[_0x91da('0x18')]=_0x328a5b[_0x91da('0x18')];this[_0x91da('0x19')]=_0x328a5b['recallme'];this[_0x91da('0x1a')]=_0x328a5b[_0x91da('0x1a')];this['ListId']=_0x328a5b[_0x91da('0x1b')];this['UserId']=_0x328a5b[_0x91da('0x1c')];this[_0x91da('0x1d')]=_0x328a5b[_0x91da('0x1d')];this['CampaignId']=_0x328a5b['CampaignId'];this['originatecalleridnum']=_0x328a5b[_0x91da('0x1e')]||'';this['originatecalleridname']=_0x328a5b[_0x91da('0x1f')]||'';this[_0x91da('0x20')]=_0x328a5b[_0x91da('0x20')];this[_0x91da('0x21')]=_0x328a5b['statedesc'];}module[_0x91da('0x22')]=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 f414b49..c9c136e 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 _0x158a=['ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','getSeconds','endtime','membername','IVR','reason','callback','callbackat','recallme','ContactId'];(function(_0x44f724,_0x366e0e){var _0x4d4063=function(_0x35c6dc){while(--_0x35c6dc){_0x44f724['push'](_0x44f724['shift']());}};_0x4d4063(++_0x366e0e);}(_0x158a,0xe1));var _0xa158=function(_0x1cac0a,_0x38be46){_0x1cac0a=_0x1cac0a-0x0;var _0x49a72c=_0x158a[_0x1cac0a];return _0x49a72c;};'use strict';var moment=require(_0xa158('0x0'));var utils=require(_0xa158('0x1'));function Hangup(_0x5376bd,_0x564d82){this[_0xa158('0x2')]=0x4;this[_0xa158('0x3')]=_0xa158('0x4');this['scheduledat']=_0x5376bd[_0xa158('0x5')];this[_0xa158('0x6')]=_0x5376bd['type'];this[_0xa158('0x7')]=_0x5376bd[_0xa158('0x6')]===_0xa158('0x8')?_0xa158('0x9'):_0x5376bd[_0xa158('0x6')];this[_0xa158('0xa')]=_0x5376bd['amd']||![];this[_0xa158('0xb')]=_0x5376bd[_0xa158('0xb')];this['countcongestionretry']=_0x5376bd[_0xa158('0xc')];this[_0xa158('0xd')]=_0x5376bd['countnoanswerretry'];this[_0xa158('0xe')]=_0x5376bd[_0xa158('0xb')]+_0x5376bd[_0xa158('0xc')]+_0x5376bd[_0xa158('0xd')]+_0x5376bd[_0xa158('0xf')]+_0x5376bd['countdropretry']+_0x5376bd[_0xa158('0x10')]+_0x5376bd[_0xa158('0x11')]+_0x5376bd[_0xa158('0x12')];this[_0xa158('0xf')]=_0x5376bd[_0xa158('0xf')];this[_0xa158('0x13')]=_0x5376bd['countdropretry'];this[_0xa158('0x10')]=_0x5376bd['countabandonedretry'];this['countmachineretry']=_0x5376bd[_0xa158('0x11')];this[_0xa158('0x12')]=_0x5376bd[_0xa158('0x12')];this[_0xa158('0x14')]=_0x564d82[_0xa158('0x14')];this[_0xa158('0x15')]=_0x5376bd['name'];this[_0xa158('0x16')]=_0x5376bd[_0xa158('0x17')];this[_0xa158('0x18')]=_0x5376bd[_0xa158('0x18')];this[_0xa158('0x19')]=_0x5376bd[_0xa158('0x19')];this['endtime']=moment()[_0xa158('0x1a')](_0xa158('0x1b'));this[_0xa158('0x1c')]=utils['getSeconds'](_0x5376bd[_0xa158('0x19')],_0x5376bd[_0xa158('0x18')]);this[_0xa158('0x1d')]=0x0;this['talktime']=utils[_0xa158('0x1e')](this[_0xa158('0x1f')],_0x5376bd[_0xa158('0x19')]);this[_0xa158('0x9')]=_0x5376bd[_0xa158('0x9')];this[_0xa158('0x20')]=_0xa158('0x21');this[_0xa158('0x22')]=_0x564d82['cause-txt'];this[_0xa158('0x23')]=_0x5376bd['callback'];this['callbackuniqueid']=_0x5376bd['callbackuniqueid'];this['callbackat']=_0x5376bd[_0xa158('0x24')];this[_0xa158('0x25')]=_0x5376bd[_0xa158('0x25')];this[_0xa158('0x26')]=_0x5376bd[_0xa158('0x26')];this[_0xa158('0x27')]=_0x5376bd['ListId'];this[_0xa158('0x28')]=_0x5376bd['UserId'];this[_0xa158('0x29')]=_0x5376bd[_0xa158('0x29')];this[_0xa158('0x2a')]=_0x5376bd[_0xa158('0x2a')];}module[_0xa158('0x2b')]=Hangup; \ No newline at end of file +var _0x39bb=['type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','responsetime','holdtime','talktime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat'];(function(_0x5075cd,_0x1f7771){var _0x85918d=function(_0x3b671c){while(--_0x3b671c){_0x5075cd['push'](_0x5075cd['shift']());}};_0x85918d(++_0x1f7771);}(_0x39bb,0x12e));var _0xb39b=function(_0x4fba44,_0x10e53c){_0x4fba44=_0x4fba44-0x0;var _0x1b87ec=_0x39bb[_0x4fba44];return _0x1b87ec;};'use strict';var moment=require(_0xb39b('0x0'));var utils=require(_0xb39b('0x1'));function Hangup(_0x351852,_0x220e2a){this[_0xb39b('0x2')]=0x4;this[_0xb39b('0x3')]=_0xb39b('0x4');this[_0xb39b('0x5')]=_0x351852['scheduledat'];this[_0xb39b('0x6')]=_0x351852['type'];this[_0xb39b('0x7')]=_0x351852[_0xb39b('0x6')]===_0xb39b('0x8')?_0xb39b('0x9'):_0x351852[_0xb39b('0x6')];this['amd']=_0x351852[_0xb39b('0xa')]||![];this[_0xb39b('0xb')]=_0x351852[_0xb39b('0xb')];this[_0xb39b('0xc')]=_0x351852[_0xb39b('0xc')];this[_0xb39b('0xd')]=_0x351852['countnoanswerretry'];this[_0xb39b('0xe')]=_0x351852['countbusyretry']+_0x351852[_0xb39b('0xc')]+_0x351852['countnoanswerretry']+_0x351852[_0xb39b('0xf')]+_0x351852[_0xb39b('0x10')]+_0x351852[_0xb39b('0x11')]+_0x351852['countmachineretry']+_0x351852[_0xb39b('0x12')];this[_0xb39b('0xf')]=_0x351852[_0xb39b('0xf')];this[_0xb39b('0x10')]=_0x351852['countdropretry'];this['countabandonedretry']=_0x351852[_0xb39b('0x11')];this[_0xb39b('0x13')]=_0x351852['countmachineretry'];this[_0xb39b('0x12')]=_0x351852[_0xb39b('0x12')];this['uniqueid']=_0x220e2a[_0xb39b('0x14')];this['calleridname']=_0x351852[_0xb39b('0x15')];this[_0xb39b('0x16')]=_0x351852[_0xb39b('0x17')];this[_0xb39b('0x18')]=_0x351852['starttime'];this['responsetime']=_0x351852['responsetime'];this[_0xb39b('0x19')]=moment()['format'](_0xb39b('0x1a'));this[_0xb39b('0x1b')]=utils[_0xb39b('0x1c')](_0x351852[_0xb39b('0x1d')],_0x351852[_0xb39b('0x18')]);this[_0xb39b('0x1e')]=0x0;this[_0xb39b('0x1f')]=utils[_0xb39b('0x1c')](this[_0xb39b('0x19')],_0x351852[_0xb39b('0x1d')]);this[_0xb39b('0x9')]=_0x351852[_0xb39b('0x9')];this[_0xb39b('0x20')]=_0xb39b('0x21');this['reason']=_0x220e2a['cause-txt'];this[_0xb39b('0x22')]=_0x351852[_0xb39b('0x22')];this[_0xb39b('0x23')]=_0x351852[_0xb39b('0x23')];this['callbackat']=_0x351852[_0xb39b('0x24')];this[_0xb39b('0x25')]=_0x351852[_0xb39b('0x25')];this[_0xb39b('0x26')]=_0x351852['ContactId'];this[_0xb39b('0x27')]=_0x351852[_0xb39b('0x27')];this[_0xb39b('0x28')]=_0x351852[_0xb39b('0x28')];this[_0xb39b('0x29')]=_0x351852[_0xb39b('0x29')];this[_0xb39b('0x2a')]=_0x351852[_0xb39b('0x2a')];}module[_0xb39b('0x2b')]=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 9fda8bd..b7dcd52 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 _0xa13c=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countcongestionretry','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xa13c,0x9c));var _0xca13=function(_0x317293,_0x400238){_0x317293=_0x317293-0x0;var _0x91a7ff=_0xa13c[_0x317293];return _0x91a7ff;};'use strict';var utils=require(_0xca13('0x0'));function History(_0x448ebd){this[_0xca13('0x1')]=_0x448ebd[_0xca13('0x1')];this['scheduledat']=_0x448ebd['scheduledat']||undefined;this['type']=_0x448ebd[_0xca13('0x2')];this[_0xca13('0x3')]=_0x448ebd['type']===_0xca13('0x4')?'queue':_0x448ebd[_0xca13('0x2')];this[_0xca13('0x5')]=_0x448ebd['countbusyretry'];this['countcongestionretry']=_0x448ebd['countcongestionretry'];this['countnoanswerretry']=_0x448ebd[_0xca13('0x6')];this['countglobal']=_0x448ebd['countbusyretry']+_0x448ebd[_0xca13('0x7')]+_0x448ebd[_0xca13('0x6')]+_0x448ebd['countnosuchnumberretry']+_0x448ebd[_0xca13('0x8')]+_0x448ebd['countabandonedretry']+_0x448ebd['countmachineretry']+_0x448ebd[_0xca13('0x9')];this[_0xca13('0xa')]=_0x448ebd[_0xca13('0xa')];this[_0xca13('0x8')]=_0x448ebd['countdropretry'];this[_0xca13('0xb')]=_0x448ebd[_0xca13('0xb')];this[_0xca13('0xc')]=_0x448ebd[_0xca13('0xc')];this['countagentrejectretry']=_0x448ebd['countagentrejectretry'];this[_0xca13('0xd')]=_0x448ebd[_0xca13('0xd')];this[_0xca13('0xe')]=_0x448ebd[_0xca13('0xf')];this[_0xca13('0x10')]=_0x448ebd[_0xca13('0x11')];this[_0xca13('0x12')]=_0x448ebd[_0xca13('0x12')];this['responsetime']=_0x448ebd[_0xca13('0x13')];this[_0xca13('0x14')]=_0x448ebd[_0xca13('0x13')];this['ringtime']=utils[_0xca13('0x15')](_0x448ebd[_0xca13('0x13')],_0x448ebd[_0xca13('0x12')]);this[_0xca13('0x16')]=0x0;this[_0xca13('0x17')]=0x0;this[_0xca13('0x18')]=_0x448ebd[_0xca13('0x18')];this[_0xca13('0x19')]=_0x448ebd[_0xca13('0x19')];this['callbackat']=_0x448ebd['callbackat'];this['recallme']=_0x448ebd[_0xca13('0x1a')];this[_0xca13('0x1b')]=_0x448ebd[_0xca13('0x1b')];this[_0xca13('0x1c')]=_0x448ebd[_0xca13('0x1c')];this['UserId']=_0x448ebd[_0xca13('0x1d')];this[_0xca13('0x1e')]=_0x448ebd[_0xca13('0x1e')];this[_0xca13('0x1f')]=_0x448ebd[_0xca13('0x1f')];this[_0xca13('0x20')]=_0x448ebd[_0xca13('0x20')]||'';this[_0xca13('0x21')]=_0x448ebd[_0xca13('0x21')]||'';this[_0xca13('0x22')]=_0x448ebd['state'];this[_0xca13('0x23')]=_0x448ebd[_0xca13('0x23')];}module[_0xca13('0x24')]=History; \ No newline at end of file +var _0x3ab1=['endtime','ringtime','getSeconds','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','name','calleridnum','starttime','responsetime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3ab1,0x191));var _0x13ab=function(_0x1afa26,_0x4f0cea){_0x1afa26=_0x1afa26-0x0;var _0x50215f=_0x3ab1[_0x1afa26];return _0x50215f;};'use strict';var utils=require(_0x13ab('0x0'));function History(_0xca5f9d){this['uniqueid']=_0xca5f9d['uniqueid'];this[_0x13ab('0x1')]=_0xca5f9d[_0x13ab('0x1')]||undefined;this[_0x13ab('0x2')]=_0xca5f9d[_0x13ab('0x2')];this[_0x13ab('0x3')]=_0xca5f9d[_0x13ab('0x2')]===_0x13ab('0x4')?_0x13ab('0x5'):_0xca5f9d[_0x13ab('0x2')];this['countbusyretry']=_0xca5f9d['countbusyretry'];this['countcongestionretry']=_0xca5f9d[_0x13ab('0x6')];this[_0x13ab('0x7')]=_0xca5f9d[_0x13ab('0x7')];this[_0x13ab('0x8')]=_0xca5f9d['countbusyretry']+_0xca5f9d[_0x13ab('0x6')]+_0xca5f9d[_0x13ab('0x7')]+_0xca5f9d['countnosuchnumberretry']+_0xca5f9d['countdropretry']+_0xca5f9d[_0x13ab('0x9')]+_0xca5f9d[_0x13ab('0xa')]+_0xca5f9d[_0x13ab('0xb')];this[_0x13ab('0xc')]=_0xca5f9d[_0x13ab('0xc')];this[_0x13ab('0xd')]=_0xca5f9d[_0x13ab('0xd')];this[_0x13ab('0x9')]=_0xca5f9d[_0x13ab('0x9')];this['countmachineretry']=_0xca5f9d[_0x13ab('0xa')];this[_0x13ab('0xb')]=_0xca5f9d['countagentrejectretry'];this[_0x13ab('0x5')]=_0xca5f9d[_0x13ab('0x5')];this[_0x13ab('0xe')]=_0xca5f9d[_0x13ab('0xf')];this[_0x13ab('0x10')]=_0xca5f9d['number'];this[_0x13ab('0x11')]=_0xca5f9d[_0x13ab('0x11')];this[_0x13ab('0x12')]=_0xca5f9d[_0x13ab('0x12')];this[_0x13ab('0x13')]=_0xca5f9d[_0x13ab('0x12')];this[_0x13ab('0x14')]=utils[_0x13ab('0x15')](_0xca5f9d[_0x13ab('0x12')],_0xca5f9d['starttime']);this['holdtime']=0x0;this['talktime']=0x0;this[_0x13ab('0x16')]=_0xca5f9d[_0x13ab('0x16')];this[_0x13ab('0x17')]=_0xca5f9d[_0x13ab('0x17')];this['callbackat']=_0xca5f9d['callbackat'];this[_0x13ab('0x18')]=_0xca5f9d[_0x13ab('0x18')];this[_0x13ab('0x19')]=_0xca5f9d[_0x13ab('0x19')];this[_0x13ab('0x1a')]=_0xca5f9d['ListId'];this[_0x13ab('0x1b')]=_0xca5f9d[_0x13ab('0x1b')];this[_0x13ab('0x1c')]=_0xca5f9d[_0x13ab('0x1c')];this[_0x13ab('0x1d')]=_0xca5f9d['CampaignId'];this[_0x13ab('0x1e')]=_0xca5f9d[_0x13ab('0x1e')]||'';this['originatecalleridname']=_0xca5f9d[_0x13ab('0x1f')]||'';this[_0x13ab('0x20')]=_0xca5f9d[_0x13ab('0x20')];this['statedesc']=_0xca5f9d[_0x13ab('0x21')];}module[_0x13ab('0x22')]=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 603592c..575958d 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 _0xf41d=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','holdtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','state','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4dd063,_0x574736){var _0x3e95e8=function(_0x4da749){while(--_0x4da749){_0x4dd063['push'](_0x4dd063['shift']());}};_0x3e95e8(++_0x574736);}(_0xf41d,0x78));var _0xdf41=function(_0x22b800,_0x4e6eb3){_0x22b800=_0x22b800-0x0;var _0x2a1810=_0xf41d[_0x22b800];return _0x2a1810;};'use strict';var utils=require(_0xdf41('0x0'));function QueueCallerAbandon(_0xbc6250,_0x3bc19b){this['scheduledat']=_0xbc6250[_0xdf41('0x1')];this[_0xdf41('0x2')]=_0xbc6250['type'];this[_0xdf41('0x3')]=_0xbc6250[_0xdf41('0x2')]===_0xdf41('0x4')?_0xdf41('0x5'):_0xbc6250[_0xdf41('0x2')];this[_0xdf41('0x6')]=_0xbc6250[_0xdf41('0x6')];this[_0xdf41('0x7')]=_0xbc6250['countcongestionretry'];this[_0xdf41('0x8')]=_0xbc6250[_0xdf41('0x8')];this[_0xdf41('0x9')]=_0xbc6250[_0xdf41('0x6')]+_0xbc6250[_0xdf41('0x7')]+_0xbc6250['countnoanswerretry']+_0xbc6250[_0xdf41('0xa')]+_0xbc6250[_0xdf41('0xb')]+_0xbc6250[_0xdf41('0xc')]+_0xbc6250[_0xdf41('0xd')]+_0xbc6250[_0xdf41('0xe')];this[_0xdf41('0xa')]=_0xbc6250[_0xdf41('0xa')];this[_0xdf41('0xb')]=_0xbc6250[_0xdf41('0xb')];this[_0xdf41('0xc')]=_0xbc6250[_0xdf41('0xc')];this['countmachineretry']=_0xbc6250[_0xdf41('0xd')];this[_0xdf41('0xe')]=_0xbc6250[_0xdf41('0xe')];this['uniqueid']=_0x3bc19b[_0xdf41('0xf')];this[_0xdf41('0x10')]=_0xbc6250[_0xdf41('0x11')];this['calleridnum']=_0xbc6250[_0xdf41('0x12')];this[_0xdf41('0x13')]=_0xbc6250['starttime'];this[_0xdf41('0x14')]=_0xbc6250['responsetime'];this[_0xdf41('0x15')]=_0xbc6250[_0xdf41('0x15')];this[_0xdf41('0x16')]=_0xbc6250[_0xdf41('0x16')];this[_0xdf41('0x17')]=this[_0xdf41('0x15')];this[_0xdf41('0x18')]=utils['getSeconds'](_0xbc6250[_0xdf41('0x14')],_0xbc6250[_0xdf41('0x13')]);this[_0xdf41('0x19')]=utils[_0xdf41('0x1a')](this['droptime'],_0xbc6250[_0xdf41('0x14')]);this[_0xdf41('0x1b')]=0x0;this[_0xdf41('0x5')]=_0x3bc19b['queue'];this[_0xdf41('0x1c')]=_0x3bc19b[_0xdf41('0x1d')];this[_0xdf41('0x1e')]=_0x3bc19b[_0xdf41('0x1e')];this[_0xdf41('0x1f')]=_0xbc6250[_0xdf41('0x1f')];this[_0xdf41('0x20')]=_0xbc6250[_0xdf41('0x20')];this['callbackat']=_0xbc6250[_0xdf41('0x21')];this[_0xdf41('0x22')]=_0xbc6250[_0xdf41('0x22')];this[_0xdf41('0x23')]=_0xbc6250[_0xdf41('0x23')];this['ListId']=_0xbc6250['ListId'];this[_0xdf41('0x24')]=_0xbc6250['UserId'];this['VoiceQueueId']=_0xbc6250[_0xdf41('0x25')];this[_0xdf41('0x26')]=_0xbc6250[_0xdf41('0x26')];this['originatecalleridnum']=_0xbc6250['originatecalleridnum']||'';this[_0xdf41('0x27')]=_0xbc6250['originatecalleridname']||'';this[_0xdf41('0x28')]=_0xbc6250['agiafterat'];this['state']=_0xbc6250[_0xdf41('0x29')];this['statedesc']=_0xbc6250['statedesc'];}module[_0xdf41('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xd5c5=['number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum'];(function(_0x440f7a,_0x4368eb){var _0x5325e1=function(_0x1324a7){while(--_0x1324a7){_0x440f7a['push'](_0x440f7a['shift']());}};_0x5325e1(++_0x4368eb);}(_0xd5c5,0x19e));var _0x5d5c=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xd5c5[_0x487b0c];return _0x1adbdc;};'use strict';var utils=require(_0x5d5c('0x0'));function QueueCallerAbandon(_0x4042ee,_0x5eff19){this[_0x5d5c('0x1')]=_0x4042ee[_0x5d5c('0x1')];this[_0x5d5c('0x2')]=_0x4042ee['type'];this['campaigntype']=_0x4042ee[_0x5d5c('0x2')]==='outbound'?'queue':_0x4042ee['type'];this[_0x5d5c('0x3')]=_0x4042ee[_0x5d5c('0x3')];this[_0x5d5c('0x4')]=_0x4042ee[_0x5d5c('0x4')];this[_0x5d5c('0x5')]=_0x4042ee[_0x5d5c('0x5')];this[_0x5d5c('0x6')]=_0x4042ee['countbusyretry']+_0x4042ee['countcongestionretry']+_0x4042ee[_0x5d5c('0x5')]+_0x4042ee[_0x5d5c('0x7')]+_0x4042ee[_0x5d5c('0x8')]+_0x4042ee[_0x5d5c('0x9')]+_0x4042ee['countmachineretry']+_0x4042ee[_0x5d5c('0xa')];this[_0x5d5c('0x7')]=_0x4042ee[_0x5d5c('0x7')];this['countdropretry']=_0x4042ee[_0x5d5c('0x8')];this['countabandonedretry']=_0x4042ee[_0x5d5c('0x9')];this[_0x5d5c('0xb')]=_0x4042ee[_0x5d5c('0xb')];this['countagentrejectretry']=_0x4042ee['countagentrejectretry'];this[_0x5d5c('0xc')]=_0x5eff19[_0x5d5c('0xc')];this[_0x5d5c('0xd')]=_0x4042ee[_0x5d5c('0xe')];this[_0x5d5c('0xf')]=_0x4042ee[_0x5d5c('0x10')];this[_0x5d5c('0x11')]=_0x4042ee[_0x5d5c('0x11')];this[_0x5d5c('0x12')]=_0x4042ee['responsetime'];this['droptime']=_0x4042ee[_0x5d5c('0x13')];this[_0x5d5c('0x14')]=_0x4042ee[_0x5d5c('0x14')];this[_0x5d5c('0x15')]=this[_0x5d5c('0x13')];this[_0x5d5c('0x16')]=utils[_0x5d5c('0x17')](_0x4042ee[_0x5d5c('0x12')],_0x4042ee[_0x5d5c('0x11')]);this[_0x5d5c('0x18')]=utils[_0x5d5c('0x17')](this['droptime'],_0x4042ee[_0x5d5c('0x12')]);this[_0x5d5c('0x19')]=0x0;this['queue']=_0x5eff19[_0x5d5c('0x1a')];this['membername']=_0x5eff19[_0x5d5c('0x1b')];this[_0x5d5c('0x1c')]=_0x5eff19[_0x5d5c('0x1c')];this[_0x5d5c('0x1d')]=_0x4042ee['callback'];this['callbackuniqueid']=_0x4042ee[_0x5d5c('0x1e')];this[_0x5d5c('0x1f')]=_0x4042ee[_0x5d5c('0x1f')];this['recallme']=_0x4042ee[_0x5d5c('0x20')];this['ContactId']=_0x4042ee[_0x5d5c('0x21')];this['ListId']=_0x4042ee[_0x5d5c('0x22')];this[_0x5d5c('0x23')]=_0x4042ee[_0x5d5c('0x23')];this['VoiceQueueId']=_0x4042ee['VoiceQueueId'];this[_0x5d5c('0x24')]=_0x4042ee['CampaignId'];this[_0x5d5c('0x25')]=_0x4042ee[_0x5d5c('0x25')]||'';this[_0x5d5c('0x26')]=_0x4042ee[_0x5d5c('0x26')]||'';this[_0x5d5c('0x27')]=_0x4042ee['agiafterat'];this[_0x5d5c('0x28')]=_0x4042ee[_0x5d5c('0x28')];this[_0x5d5c('0x29')]=_0x4042ee[_0x5d5c('0x29')];}module[_0x5d5c('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 d2c7849..b8da738 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 _0x5334=['[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','error','[getContactDialer]','getContactDialer','getContactDialerIvr','temp','[getContactDialerIvr]','catch','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5334,0x84));var _0x4533=function(_0x3e9ba9,_0x84a2ca){_0x3e9ba9=_0x3e9ba9-0x0;var _0x4ea4a1=_0x5334[_0x3e9ba9];return _0x4ea4a1;};'use strict';var util=require(_0x4533('0x0'));var logger=require(_0x4533('0x1'))(_0x4533('0x2'));var cmHopper=require(_0x4533('0x3'));var cmHopperAdditionalPhone=require(_0x4533('0x4'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x4533('0x5'));function inspectError(_0x5176b5){return util[_0x4533('0x6')](_0x5176b5,{'showHidden':![],'depth':null});}function getContactDialer(_0x11ce61,_0x5cbca4,_0x4a576a){return cmHopper['getContactDialer'](_0x11ce61['id'],_0x5cbca4,_0x4a576a,_0x11ce61[_0x4533('0x7')])['catch'](function(_0x4d89e7){_0x11ce61['temp']=0x0;logger[_0x4533('0x8')](_0x4533('0x9'),inspectError(_0x4d89e7));});}exports[_0x4533('0xa')]=getContactDialer;function getContactDialerIvr(_0x2489b6,_0x31018b){return cmHopper[_0x4533('0xb')](_0x2489b6['id'],_0x31018b,_0x2489b6[_0x4533('0x7')])['catch'](function(_0x5533){_0x2489b6[_0x4533('0xc')]=0x0;logger[_0x4533('0x8')](_0x4533('0xd'),inspectError(_0x5533));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x7b2420){return cmHopper['countReScheduled'](_0x7b2420)[_0x4533('0xe')](function(_0x439210){logger[_0x4533('0x8')](_0x4533('0xf'),inspectError(_0x439210));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0xdd4757){return cmHopper[_0x4533('0x10')](_0xdd4757)[_0x4533('0xe')](function(_0x18d4f0){logger['error'](_0x4533('0x11'),inspectError(_0x18d4f0));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x4c703c,_0x466545,_0x34dea9){return cmHopper['unlockContact'](_0x4c703c,_0x466545,_0x34dea9)[_0x4533('0xe')](function(_0x1e6a1a){logger[_0x4533('0x8')]('[unlockContact]',inspectError(_0x1e6a1a));});}exports[_0x4533('0x12')]=unlockContact;function moveContactManagedDialer(_0x4f732e){return cmHopper[_0x4533('0x13')](_0x4f732e)[_0x4533('0xe')](function(_0x56ab4f){logger[_0x4533('0x8')]('[moveContactManagedDialer]',inspectError(_0x56ab4f));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x1c5cdd){return cmHopperBlack[_0x4533('0x14')](_0x1c5cdd)['catch'](function(_0x53fe43){logger[_0x4533('0x8')](_0x4533('0x15'),inspectError(_0x53fe43));});}exports[_0x4533('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x1b08fa){return cmHopperBlack[_0x4533('0x16')](_0x1b08fa)[_0x4533('0xe')](function(_0x12adde){logger['error'](_0x4533('0x17'),inspectError(_0x12adde));});}exports[_0x4533('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2901f1,_0x4aa438,_0x513011){return cmHopperAdditionalPhone[_0x4533('0x18')](_0x2901f1,_0x4aa438,_0x513011)[_0x4533('0xe')](function(_0x4c640c){logger['error'](_0x4533('0x19'),inspectError(_0x4c640c));});}exports[_0x4533('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0xfd9409,_0x4d8189,_0x44786f){return cmHopperAdditionalPhone[_0x4533('0x1a')](_0xfd9409,_0x4d8189,_0x44786f)[_0x4533('0xe')](function(_0x3fba67){logger[_0x4533('0x8')](_0x4533('0x1b'),inspectError(_0x3fba67));});}exports[_0x4533('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x27b653){return cmHopperHistory[_0x4533('0x1c')](_0x27b653)['catch'](function(_0x5c1e24){logger[_0x4533('0x8')]('[avgHandleTime]',inspectError(_0x5c1e24));});}exports[_0x4533('0x1c')]=avgHandleTime;function createHistory(_0x4e2b80){return cmHopperHistory[_0x4533('0x1d')](_0x4e2b80)[_0x4533('0xe')](function(_0x38706b){logger[_0x4533('0x8')](_0x4533('0x1e'),inspectError(_0x38706b));});}exports[_0x4533('0x1d')]=createHistory; \ No newline at end of file +var _0xb091=['swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones'];(function(_0x29faa7,_0x14ad0d){var _0x442d4f=function(_0x4db9f6){while(--_0x4db9f6){_0x29faa7['push'](_0x29faa7['shift']());}};_0x442d4f(++_0x14ad0d);}(_0xb091,0x16e));var _0x1b09=function(_0x7f5c95,_0x4d6471){_0x7f5c95=_0x7f5c95-0x0;var _0x591bb6=_0xb091[_0x7f5c95];return _0x591bb6;};'use strict';var util=require('util');var logger=require(_0x1b09('0x0'))(_0x1b09('0x1'));var cmHopper=require(_0x1b09('0x2'));var cmHopperAdditionalPhone=require(_0x1b09('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x1b09('0x4'));function inspectError(_0x59af61){return util['inspect'](_0x59af61,{'showHidden':![],'depth':null});}function getContactDialer(_0x295863,_0x24d22c,_0x4e252c){return cmHopper[_0x1b09('0x5')](_0x295863['id'],_0x24d22c,_0x4e252c,_0x295863[_0x1b09('0x6')])[_0x1b09('0x7')](function(_0x5ce726){_0x295863[_0x1b09('0x8')]=0x0;logger[_0x1b09('0x9')](_0x1b09('0xa'),inspectError(_0x5ce726));});}exports[_0x1b09('0x5')]=getContactDialer;function getContactDialerIvr(_0x159b95,_0x3362e4){return cmHopper[_0x1b09('0xb')](_0x159b95['id'],_0x3362e4,_0x159b95[_0x1b09('0x6')])[_0x1b09('0x7')](function(_0x36aa1b){_0x159b95[_0x1b09('0x8')]=0x0;logger['error'](_0x1b09('0xc'),inspectError(_0x36aa1b));});}exports[_0x1b09('0xb')]=getContactDialerIvr;function countReScheduled(_0x5690cb){return cmHopper['countReScheduled'](_0x5690cb)[_0x1b09('0x7')](function(_0x4284ad){logger[_0x1b09('0x9')](_0x1b09('0xd'),inspectError(_0x4284ad));});}exports[_0x1b09('0xe')]=countReScheduled;function rescheduleContact(_0x3a44f1){return cmHopper[_0x1b09('0xf')](_0x3a44f1)['catch'](function(_0x37fdb2){logger['error'](_0x1b09('0x10'),inspectError(_0x37fdb2));});}exports[_0x1b09('0xf')]=rescheduleContact;function unlockContact(_0x11ab46,_0x37673e,_0x10b7eb){return cmHopper[_0x1b09('0x11')](_0x11ab46,_0x37673e,_0x10b7eb)[_0x1b09('0x7')](function(_0x33129b){logger[_0x1b09('0x9')](_0x1b09('0x12'),inspectError(_0x33129b));});}exports[_0x1b09('0x11')]=unlockContact;function moveContactManagedDialer(_0x231ef6){return cmHopper[_0x1b09('0x13')](_0x231ef6)['catch'](function(_0x214c6b){logger[_0x1b09('0x9')]('[moveContactManagedDialer]',inspectError(_0x214c6b));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0xe93ac4){return cmHopperBlack['checkIsBlackList'](_0xe93ac4)[_0x1b09('0x7')](function(_0x5bb127){logger[_0x1b09('0x9')](_0x1b09('0x14'),inspectError(_0x5bb127));});}exports[_0x1b09('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x1e8f97){return cmHopperBlack[_0x1b09('0x16')](_0x1e8f97)[_0x1b09('0x7')](function(_0x363e78){logger[_0x1b09('0x9')]('[checkIsBlackListIvr]',inspectError(_0x363e78));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x27f4f5,_0x41c786,_0x4ce7dc){return cmHopperAdditionalPhone[_0x1b09('0x17')](_0x27f4f5,_0x41c786,_0x4ce7dc)[_0x1b09('0x7')](function(_0x6e132c){logger[_0x1b09('0x9')]('[verifyAdditionalPhone]',inspectError(_0x6e132c));});}exports[_0x1b09('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x15be49,_0x4936d0,_0x2d3b86){return cmHopperAdditionalPhone[_0x1b09('0x18')](_0x15be49,_0x4936d0,_0x2d3b86)['catch'](function(_0x13c89c){logger[_0x1b09('0x9')](_0x1b09('0x19'),inspectError(_0x13c89c));});}exports[_0x1b09('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x547fbb){return cmHopperHistory[_0x1b09('0x1a')](_0x547fbb)[_0x1b09('0x7')](function(_0x532589){logger[_0x1b09('0x9')](_0x1b09('0x1b'),inspectError(_0x532589));});}exports[_0x1b09('0x1a')]=avgHandleTime;function createHistory(_0x1cbbd5){return cmHopperHistory[_0x1b09('0x1c')](_0x1cbbd5)[_0x1b09('0x7')](function(_0x34620f){logger['error'](_0x1b09('0x1d'),inspectError(_0x34620f));});}exports[_0x1b09('0x1c')]=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 91e6f7d..ca90cd2 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 _0xec95=['replace','random','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','erlangb','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','XMD-','toUpperCase','toString','substring','setXMDContactVariables','lodash','moment','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','dialGlobalInterval','UNKNOWN_TIMEZONE','SIP/','reachable','status','TrunkBackup','includes','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','extractCalleridName','string','isUndefined','format','\x22%s\x22\x20<%s>','getCallerId','pow'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec95,0xbf));var _0x5ec9=function(_0x14477e,_0x44d4da){_0x14477e=_0x14477e-0x0;var _0x5d4a05=_0xec95[_0x14477e];return _0x5d4a05;};'use strict';var _=require(_0x5ec9('0x0'));var moment=require(_0x5ec9('0x1'));var util=require('util');var logger=require('../../../../config/logger')(_0x5ec9('0x2'));var timezones=require(_0x5ec9('0x3'))[_0x5ec9('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x5ec9('0x5'),'BLACKLIST':_0x5ec9('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x5ec9('0x7'),'DISACTIVED':_0x5ec9('0x8'),'EMPTY_INTERVAL':_0x5ec9('0x9'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0x5ec9('0xa'),'OVERTIME_INTERVAL':_0x5ec9('0xb'),'OVERTIME_GLOBAL_INTERVAL':_0x5ec9('0xc'),'QUEUE_RECALL':_0x5ec9('0xd'),'RECALL_TIMEOUT':_0x5ec9('0xe'),'RUNNING':_0x5ec9('0xf'),'UNKNOWN_TIMEZONE':_0x5ec9('0x10'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x5ec9('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x243329){return _0x243329[_0x5ec9('0x12')]==='preview';}exports[_0x5ec9('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x517faa){return _0x517faa[_0x5ec9('0x14')]===_0x5ec9('0x15');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x323363){return _0x323363[_0x5ec9('0x14')]===_0x5ec9('0x16');}exports[_0x5ec9('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x108c18){return _0x108c18[_0x5ec9('0x18')];}exports[_0x5ec9('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5e90e0){return _0x5e90e0[_0x5ec9('0x1a')];}exports[_0x5ec9('0x1b')]=isIVRCampaignActive;function getSeconds(_0x245bd2,_0x3b5796){var _0x283ab6=moment(_0x245bd2)[_0x5ec9('0x1c')](0x0);var _0x4d04e7=moment(_0x3b5796)[_0x5ec9('0x1c')](0x0);return _0x283ab6[_0x5ec9('0x1d')](_0x4d04e7,_0x5ec9('0x1e'));}exports[_0x5ec9('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x5a606e,_0x4e83c3){var _0x376de1=![];var _0x2a409c=_0x5a606e[_0x5ec9('0x12')]!==_0x4e83c3[_0x5ec9('0x12')]||_0x5a606e[_0x5ec9('0x18')]!==_0x4e83c3[_0x5ec9('0x18')]||_0x5a606e[_0x5ec9('0x20')]!==_0x4e83c3[_0x5ec9('0x20')];var _0x3b4c7d=_0x5a606e[_0x5ec9('0x21')]!==_0x4e83c3[_0x5ec9('0x21')]||_0x5a606e['loggedIn']!==_0x4e83c3[_0x5ec9('0x22')]||_0x5a606e[_0x5ec9('0x23')]!==_0x4e83c3[_0x5ec9('0x23')]||_0x5a606e['paused']!==_0x4e83c3[_0x5ec9('0x24')]||_0x5a606e[_0x5ec9('0x25')]!==_0x4e83c3[_0x5ec9('0x25')]||_0x5a606e[_0x5ec9('0x26')]!==_0x4e83c3['pTalking']||_0x5a606e[_0x5ec9('0x27')]!==_0x4e83c3[_0x5ec9('0x27')]||_0x5a606e[_0x5ec9('0x28')]!==_0x4e83c3['inUse']||_0x5a606e[_0x5ec9('0x29')]!==_0x4e83c3[_0x5ec9('0x29')];if(_0x5a606e[_0x5ec9('0x2a')]&&_0x4e83c3[_0x5ec9('0x2a')]){_0x376de1=_0x5a606e[_0x5ec9('0x2a')][_0x5ec9('0x2b')]!==_0x4e83c3[_0x5ec9('0x2a')][_0x5ec9('0x2b')]||_0x5a606e['Trunk']['active']!==_0x4e83c3[_0x5ec9('0x2a')][_0x5ec9('0x1a')];}return _0x2a409c||_0x3b4c7d||_0x376de1;}exports[_0x5ec9('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4c4c3f){var _0x3c7345=null;var _0x24f161=_0x4c4c3f[_0x5ec9('0x2d')];if(_[_0x5ec9('0x2e')](_0x4c4c3f['dialGlobalInterval'])||_[_0x5ec9('0x2e')](_0x4c4c3f['Interval'])||_[_0x5ec9('0x2e')](_0x4c4c3f[_0x5ec9('0x2f')][_0x5ec9('0x30')])){_0x3c7345=CAMPAIGN_STATUS[_0x5ec9('0x31')];}else if(_[_0x5ec9('0x32')](_0x4c4c3f[_0x5ec9('0x33')])||_[_0x5ec9('0x32')](_0x4c4c3f['Interval'][_0x5ec9('0x30')])){_0x3c7345=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x24f161&&!timezones[_0x24f161]){_0x3c7345=CAMPAIGN_STATUS[_0x5ec9('0x34')];}return _0x3c7345;}function checkAnyValidTrunk(_0x1562fb,_0x44517b){var _0x22fb45=null;var _0x109051=_0x5ec9('0x35');var _0x33039a=[_0x5ec9('0x36'),'unmonitored'];var _0x138b7b=!![];if(_0x1562fb[_0x5ec9('0x2a')]&&_0x1562fb[_0x5ec9('0x2a')]['active']){_0x109051+=_0x1562fb[_0x5ec9('0x2a')][_0x5ec9('0x2b')];_0x22fb45=_0x44517b[_0x109051];_0x138b7b=_0x33039a['includes'](_0x22fb45[_0x5ec9('0x37')]);}else if(_0x1562fb[_0x5ec9('0x38')]&&_0x1562fb[_0x5ec9('0x38')]['active']){_0x109051+=_0x1562fb[_0x5ec9('0x38')][_0x5ec9('0x2b')];_0x22fb45=_0x44517b[_0x109051];_0x138b7b=_0x33039a[_0x5ec9('0x39')](_0x22fb45[_0x5ec9('0x37')]);}return _0x138b7b;}function getQueueCampaignStatusMessage(_0x21a277,_0x1b13ed){var _0x9e2857=CAMPAIGN_STATUS[_0x5ec9('0x5')];var _0xbd8ff3=isPreviewCampaign(_0x21a277);if(!isQueueCampaignActive(_0x21a277)){if(_0xbd8ff3){_0x9e2857=CAMPAIGN_STATUS[_0x5ec9('0x3a')];}else{if(_0x21a277[_0x5ec9('0x29')]===0x0&&_0x21a277[_0x5ec9('0x25')]===0x0&&_0x21a277['waiting']===0x0&&(_0x21a277['pTalking']||0x0)===0x0){_0x9e2857=CAMPAIGN_STATUS['INACTIVE'];}else{_0x9e2857=CAMPAIGN_STATUS[_0x5ec9('0x3b')];}}}else if(_0x21a277['loggedIn']===0x0){_0x9e2857=CAMPAIGN_STATUS[_0x5ec9('0x3c')];}else if(!checkAnyValidTrunk(_0x21a277,_0x1b13ed)){_0x9e2857=CAMPAIGN_STATUS[_0x5ec9('0x3d')];}else if(!isPreviewCampaign(_0x21a277)){var _0x22e178=checkAnyValidQueueCampaignInterval(_0x21a277);if(_0x22e178){_0x9e2857=_0x22e178;}}return _0x9e2857;}exports[_0x5ec9('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x9d7d9e){var _0x272560=CAMPAIGN_STATUS[_0x5ec9('0x3b')];if(_0x9d7d9e[_0x5ec9('0x29')]===0x0&&_0x9d7d9e[_0x5ec9('0x25')]===0x0&&_0x9d7d9e[_0x5ec9('0x27')]===0x0&&(_0x9d7d9e[_0x5ec9('0x26')]||0x0)===0x0){_0x272560=CAMPAIGN_STATUS[_0x5ec9('0x3a')];}return _0x272560;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x497f60){var _0x36a5a0=_0x497f60['match'](/"(.*?)"/);return _0x36a5a0?_0x36a5a0[0x1]:_0x497f60;}exports[_0x5ec9('0x3f')]=extractCalleridName;function getCallerId(_0x127dbc,_0x2d753a,_0x278cc2){if(!_['isUndefined'](_0x278cc2)&&typeof _0x278cc2===_0x5ec9('0x40')&&!_[_0x5ec9('0x32')](_0x278cc2)){if(!_[_0x5ec9('0x41')](_0x2d753a)&&typeof _0x2d753a===_0x5ec9('0x40')&&!_[_0x5ec9('0x32')](_0x2d753a)){return util[_0x5ec9('0x42')](_0x5ec9('0x43'),_0x2d753a,_0x278cc2);}return util[_0x5ec9('0x42')](_0x5ec9('0x43'),_0x278cc2,_0x278cc2);}if(!_[_0x5ec9('0x41')](_0x127dbc)&&typeof _0x127dbc===_0x5ec9('0x40')&&!_[_0x5ec9('0x32')](_0x127dbc)){return _0x127dbc;}return'\x22\x22\x20<>';}exports[_0x5ec9('0x44')]=getCallerId;function getCallerIdRandom(_0x5043df,_0x5c89de){var _0x59646d;var _0x57fd0e;var _0x3f16f1;if(_0x5c89de<=0x0){_0x5c89de=0x1;}_0x59646d=new RegExp('\x5cw{0,'+_0x5c89de+'}$');_0x57fd0e=Math[_0x5ec9('0x45')](0xa,_0x5c89de-0x1);_0x3f16f1=Math[_0x5ec9('0x45')](0xa,_0x5c89de)-0x1;return util[_0x5ec9('0x42')]('%s',_[_0x5ec9('0x46')](_0x5043df,_0x59646d,_[_0x5ec9('0x47')](_0x57fd0e,_0x3f16f1)['toString']()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x21b780){if(_0x21b780[_0x5ec9('0x29')]&&_0x21b780['originated']>0x0){_0x21b780['originated']-=0x1;}else{logger[_0x5ec9('0x48')](_0x5ec9('0x49'));}}exports[_0x5ec9('0x4a')]=decrementOriginate;function checkContactEmpty(_0x594a6a){return _0x594a6a&&_0x594a6a[_0x5ec9('0x4b')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x51c4d1,_0x473f0d){if(_0x473f0d===0x0){return 0x0;}var _0x3587ee=0x1;for(var _0xfbde62=0x1;_0xfbde62<=_0x473f0d;_0xfbde62+=0x1){_0x3587ee=0x1+_0x3587ee*_0xfbde62/_0x51c4d1;}return 0x1/_0x3587ee;}exports[_0x5ec9('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x49d17b,_0x26edab,_0x4a39ea){if(_0x26edab>_0x4a39ea){for(var _0x1f838f=0x0;_0x1f838f<_0x26edab-_0x4a39ea;_0x1f838f+=0x1){decrementOriginate(_0x49d17b);}}}exports[_0x5ec9('0x4d')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x2fd0f4){var _0x17a2e6={};var _0x1c86c9=['id',_0x5ec9('0x4e'),_0x5ec9('0x4f'),_0x5ec9('0x50')];const _0xb2fc01=0xfa;if(_0x2fd0f4){for(var _0x227055 in _0x2fd0f4){if(typeof _0x2fd0f4[_0x227055]!==_0x5ec9('0x51')){if(!_[_0x5ec9('0x2e')](_0x2fd0f4[_0x227055])&&!_0x1c86c9[_0x5ec9('0x39')](_0x227055)){if(_0x227055==='description'&&_0x2fd0f4[_0x227055][_0x5ec9('0x4b')]>_0xb2fc01){_0x17a2e6[_0x5ec9('0x52')+_0x227055[_0x5ec9('0x53')]()]=_0x2fd0f4[_0x227055][_0x5ec9('0x54')]()[_0x5ec9('0x55')](0x0,_0xb2fc01);}else{_0x17a2e6[_0x5ec9('0x52')+_0x227055['toUpperCase']()]=_0x2fd0f4[_0x227055];}}}}}return _0x17a2e6;}exports[_0x5ec9('0x56')]=setXMDContactVariables; \ No newline at end of file +var _0x9c4a=['dialer','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','ivr','type','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','tags','updatedAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x9c4a,0x1c8));var _0xa9c4=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x9c4a[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0xa9c4('0x0'));var moment=require(_0xa9c4('0x1'));var util=require(_0xa9c4('0x2'));var logger=require(_0xa9c4('0x3'))(_0xa9c4('0x4'));var timezones=require(_0xa9c4('0x5'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xa9c4('0x6'),'BLACKLIST':_0xa9c4('0x7'),'CONTACTS_RESCHEDULED':_0xa9c4('0x8'),'DEACTIVATED':_0xa9c4('0x9'),'DISACTIVED':_0xa9c4('0xa'),'EMPTY_INTERVAL':_0xa9c4('0xb'),'INACTIVE':_0xa9c4('0xc'),'NO_AGENTS_LOGGED':_0xa9c4('0xd'),'NO_AVAILABLE_CONTACTS':_0xa9c4('0xe'),'NULL_INTERVAL':_0xa9c4('0xf'),'OVERTIME_INTERVAL':_0xa9c4('0x10'),'OVERTIME_GLOBAL_INTERVAL':_0xa9c4('0x11'),'QUEUE_RECALL':_0xa9c4('0x12'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xa9c4('0x13'),'UNREACHABLE_TRUNK':_0xa9c4('0x14')};exports[_0xa9c4('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x539ba0){return _0x539ba0[_0xa9c4('0x16')]==='preview';}exports[_0xa9c4('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x676fc6){return _0x676fc6['type']===_0xa9c4('0x18');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x3e2e5c){return _0x3e2e5c[_0xa9c4('0x19')]===_0xa9c4('0x1a');}exports[_0xa9c4('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x22ca85){return _0x22ca85[_0xa9c4('0x1c')];}exports[_0xa9c4('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x32c5b1){return _0x32c5b1[_0xa9c4('0x1e')];}exports[_0xa9c4('0x1f')]=isIVRCampaignActive;function getSeconds(_0x12bf6d,_0xe3bb21){var _0x110bba=moment(_0x12bf6d)[_0xa9c4('0x20')](0x0);var _0x2ee976=moment(_0xe3bb21)['milliseconds'](0x0);return _0x110bba[_0xa9c4('0x21')](_0x2ee976,_0xa9c4('0x22'));}exports[_0xa9c4('0x23')]=getSeconds;function hasQueueCampaignDataChanged(_0x17a6b3,_0x23ae04){var _0x508f31=![];var _0x26794a=_0x17a6b3['dialMethod']!==_0x23ae04[_0xa9c4('0x16')]||_0x17a6b3[_0xa9c4('0x1c')]!==_0x23ae04[_0xa9c4('0x1c')]||_0x17a6b3[_0xa9c4('0x24')]!==_0x23ae04['message'];var _0x1fc6cb=_0x17a6b3['available']!==_0x23ae04[_0xa9c4('0x25')]||_0x17a6b3[_0xa9c4('0x26')]!==_0x23ae04['loggedIn']||_0x17a6b3[_0xa9c4('0x27')]!==_0x23ae04['loggedInDb']||_0x17a6b3['paused']!==_0x23ae04[_0xa9c4('0x28')]||_0x17a6b3[_0xa9c4('0x29')]!==_0x23ae04[_0xa9c4('0x29')]||_0x17a6b3['pTalking']!==_0x23ae04[_0xa9c4('0x2a')]||_0x17a6b3[_0xa9c4('0x2b')]!==_0x23ae04[_0xa9c4('0x2b')]||_0x17a6b3['inUse']!==_0x23ae04[_0xa9c4('0x2c')]||_0x17a6b3[_0xa9c4('0x2d')]!==_0x23ae04[_0xa9c4('0x2d')];if(_0x17a6b3[_0xa9c4('0x2e')]&&_0x23ae04[_0xa9c4('0x2e')]){_0x508f31=_0x17a6b3[_0xa9c4('0x2e')][_0xa9c4('0x2f')]!==_0x23ae04['Trunk']['name']||_0x17a6b3[_0xa9c4('0x2e')][_0xa9c4('0x1e')]!==_0x23ae04[_0xa9c4('0x2e')][_0xa9c4('0x1e')];}return _0x26794a||_0x1fc6cb||_0x508f31;}exports[_0xa9c4('0x30')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1b86fb){var _0x2b1865=null;var _0x312faa=_0x1b86fb[_0xa9c4('0x31')];if(_['isNil'](_0x1b86fb[_0xa9c4('0x32')])||_[_0xa9c4('0x33')](_0x1b86fb['Interval'])||_['isNil'](_0x1b86fb[_0xa9c4('0x34')][_0xa9c4('0x35')])){_0x2b1865=CAMPAIGN_STATUS[_0xa9c4('0x36')];}else if(_[_0xa9c4('0x37')](_0x1b86fb[_0xa9c4('0x32')])||_['isEmpty'](_0x1b86fb[_0xa9c4('0x34')][_0xa9c4('0x35')])){_0x2b1865=CAMPAIGN_STATUS[_0xa9c4('0x38')];}else if(_0x312faa&&!timezones[_0x312faa]){_0x2b1865=CAMPAIGN_STATUS[_0xa9c4('0x39')];}return _0x2b1865;}function checkAnyValidTrunk(_0x1b6649,_0x1f22e9){var _0x28d9ff=null;var _0x580599=_0xa9c4('0x3a');var _0xbe69b9=[_0xa9c4('0x3b'),'unmonitored'];var _0x335850=!![];if(_0x1b6649[_0xa9c4('0x2e')]&&_0x1b6649['Trunk']['active']){_0x580599+=_0x1b6649[_0xa9c4('0x2e')][_0xa9c4('0x2f')];_0x28d9ff=_0x1f22e9[_0x580599];_0x335850=_0xbe69b9[_0xa9c4('0x3c')](_0x28d9ff[_0xa9c4('0x3d')]);}else if(_0x1b6649[_0xa9c4('0x3e')]&&_0x1b6649[_0xa9c4('0x3e')][_0xa9c4('0x1e')]){_0x580599+=_0x1b6649[_0xa9c4('0x3e')][_0xa9c4('0x2f')];_0x28d9ff=_0x1f22e9[_0x580599];_0x335850=_0xbe69b9[_0xa9c4('0x3c')](_0x28d9ff[_0xa9c4('0x3d')]);}return _0x335850;}function getQueueCampaignStatusMessage(_0x2a36ad,_0x323560){var _0x345319=CAMPAIGN_STATUS['ACTIVE'];var _0x3cddd0=isPreviewCampaign(_0x2a36ad);if(!isQueueCampaignActive(_0x2a36ad)){if(_0x3cddd0){_0x345319=CAMPAIGN_STATUS[_0xa9c4('0x3f')];}else{if(_0x2a36ad['originated']===0x0&&_0x2a36ad[_0xa9c4('0x29')]===0x0&&_0x2a36ad[_0xa9c4('0x2b')]===0x0&&(_0x2a36ad['pTalking']||0x0)===0x0){_0x345319=CAMPAIGN_STATUS[_0xa9c4('0x3f')];}else{_0x345319=CAMPAIGN_STATUS[_0xa9c4('0x40')];}}}else if(_0x2a36ad[_0xa9c4('0x26')]===0x0){_0x345319=CAMPAIGN_STATUS[_0xa9c4('0x41')];}else if(!checkAnyValidTrunk(_0x2a36ad,_0x323560)){_0x345319=CAMPAIGN_STATUS[_0xa9c4('0x42')];}else if(!isPreviewCampaign(_0x2a36ad)){var _0x46e111=checkAnyValidQueueCampaignInterval(_0x2a36ad);if(_0x46e111){_0x345319=_0x46e111;}}return _0x345319;}exports[_0xa9c4('0x43')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x448fbd){var _0x45681f=CAMPAIGN_STATUS[_0xa9c4('0x40')];if(_0x448fbd[_0xa9c4('0x2d')]===0x0&&_0x448fbd[_0xa9c4('0x29')]===0x0&&_0x448fbd[_0xa9c4('0x2b')]===0x0&&(_0x448fbd[_0xa9c4('0x2a')]||0x0)===0x0){_0x45681f=CAMPAIGN_STATUS[_0xa9c4('0x3f')];}return _0x45681f;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x872fbd){var _0x5a99a9=_0x872fbd['match'](/"(.*?)"/);return _0x5a99a9?_0x5a99a9[0x1]:_0x872fbd;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x285208,_0x907d8c,_0x47cf0d){if(!_[_0xa9c4('0x44')](_0x47cf0d)&&typeof _0x47cf0d===_0xa9c4('0x45')&&!_[_0xa9c4('0x37')](_0x47cf0d)){if(!_[_0xa9c4('0x44')](_0x907d8c)&&typeof _0x907d8c===_0xa9c4('0x45')&&!_['isEmpty'](_0x907d8c)){return util[_0xa9c4('0x46')]('\x22%s\x22\x20<%s>',_0x907d8c,_0x47cf0d);}return util[_0xa9c4('0x46')](_0xa9c4('0x47'),_0x47cf0d,_0x47cf0d);}if(!_[_0xa9c4('0x44')](_0x285208)&&typeof _0x285208==='string'&&!_[_0xa9c4('0x37')](_0x285208)){return _0x285208;}return'\x22\x22\x20<>';}exports[_0xa9c4('0x48')]=getCallerId;function getCallerIdRandom(_0x5218de,_0x349a08){var _0xfd19cf;var _0x571f49;var _0x192f0a;if(_0x349a08<=0x0){_0x349a08=0x1;}_0xfd19cf=new RegExp(_0xa9c4('0x49')+_0x349a08+'}$');_0x571f49=Math[_0xa9c4('0x4a')](0xa,_0x349a08-0x1);_0x192f0a=Math[_0xa9c4('0x4a')](0xa,_0x349a08)-0x1;return util['format']('%s',_[_0xa9c4('0x4b')](_0x5218de,_0xfd19cf,_[_0xa9c4('0x4c')](_0x571f49,_0x192f0a)[_0xa9c4('0x4d')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x5d1c04){if(_0x5d1c04[_0xa9c4('0x2d')]&&_0x5d1c04['originated']>0x0){_0x5d1c04['originated']-=0x1;}else{logger['error'](_0xa9c4('0x4e'));}}exports[_0xa9c4('0x4f')]=decrementOriginate;function checkContactEmpty(_0x20e4ab){return _0x20e4ab&&_0x20e4ab[_0xa9c4('0x50')]>0x0;}exports[_0xa9c4('0x51')]=checkContactEmpty;function erlangb(_0x1b4823,_0x227583){if(_0x227583===0x0){return 0x0;}var _0x48a4e9=0x1;for(var _0x11ff2b=0x1;_0x11ff2b<=_0x227583;_0x11ff2b+=0x1){_0x48a4e9=0x1+_0x48a4e9*_0x11ff2b/_0x1b4823;}return 0x1/_0x48a4e9;}exports[_0xa9c4('0x52')]=erlangb;function checkContactLowerLimitOriginate(_0x53d58c,_0x59456d,_0x55b3ad){if(_0x59456d>_0x55b3ad){for(var _0x1357e5=0x0;_0x1357e5<_0x59456d-_0x55b3ad;_0x1357e5+=0x1){decrementOriginate(_0x53d58c);}}}exports[_0xa9c4('0x53')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x337e36){var _0x3e60a4={};var _0x52f6af=['id','createdAt',_0xa9c4('0x54'),_0xa9c4('0x55')];const _0x395d34=0xfa;if(_0x337e36){for(var _0xea01e in _0x337e36){if(typeof _0x337e36[_0xea01e]!==_0xa9c4('0x56')){if(!_[_0xa9c4('0x33')](_0x337e36[_0xea01e])&&!_0x52f6af['includes'](_0xea01e)){if(_0xea01e===_0xa9c4('0x57')&&_0x337e36[_0xea01e]['length']>_0x395d34){_0x3e60a4[_0xa9c4('0x58')+_0xea01e[_0xa9c4('0x59')]()]=_0x337e36[_0xea01e][_0xa9c4('0x4d')]()[_0xa9c4('0x5a')](0x0,_0x395d34);}else{_0x3e60a4[_0xa9c4('0x58')+_0xea01e[_0xa9c4('0x59')]()]=_0x337e36[_0xea01e];}}}}}return _0x3e60a4;}exports[_0xa9c4('0x5b')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 958e711..05804a0 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(_0x7c1e9c,_0x2d1adf){var _0x16d193=function(_0x1e6cfb){while(--_0x1e6cfb){_0x7c1e9c['push'](_0x7c1e9c['shift']());}};_0x16d193(++_0x2d1adf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x4455da,_0x296763){var _0x56aece=function(_0x5a0156){while(--_0x5a0156){_0x4455da['push'](_0x4455da['shift']());}};_0x56aece(++_0x296763);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 4ceb6a7..e9f0347 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 _0x0b98=['format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','path','tiff2pdf','./util/gs','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','uniqueid','channels','name','info','\x20syncNewchannel\x20','actions','channel','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','\x20result\x20conversion\x20file\x20','parse','.pdf','application/pdf','then','notify','calleridnum','fax','stringify','catch','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','FaxAccountId','Trunk','isValid','Trunk\x20Reachable'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0x0b98,0x93));var _0x80b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0b98[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x80b9('0x0'));var _=require(_0x80b9('0x1'));var BPromise=require('bluebird');var uuid=require(_0x80b9('0x2'));var moment=require('moment');var path=require(_0x80b9('0x3'));var tiff2pdf=require(_0x80b9('0x4'));var gs=require(_0x80b9('0x5'));var logger=require('../../../config/logger')('fax');var ami=require(_0x80b9('0x6'));var rpcDb=require(_0x80b9('0x7'));var Channel=require(_0x80b9('0x8'));var ut=require(_0x80b9('0x9'));var Action=require(_0x80b9('0xa'));var faxAccount=require(_0x80b9('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x80b9('0xc'));function Fax(_0x3d24ce){this['channels']={};this[_0x80b9('0xd')]=_0x3d24ce[_0x80b9('0xd')];this['trunks']=_0x3d24ce[_0x80b9('0xe')];this['actions']={};ami['on'](_0x80b9('0xf'),this[_0x80b9('0x10')][_0x80b9('0x11')](this));ami['on']('varset',this[_0x80b9('0x12')][_0x80b9('0x11')](this));ami['on'](_0x80b9('0x13'),this[_0x80b9('0x14')][_0x80b9('0x11')](this));ami['on'](_0x80b9('0x15'),this[_0x80b9('0x16')][_0x80b9('0x11')](this));ami['on'](_0x80b9('0x17'),this[_0x80b9('0x18')]['bind'](this));ami['on'](_0x80b9('0x19'),this[_0x80b9('0x1a')][_0x80b9('0x11')](this));ami['on'](_0x80b9('0x1b'),this[_0x80b9('0x1c')][_0x80b9('0x11')](this));ami['on'](_0x80b9('0x1d'),this[_0x80b9('0x1e')]['bind'](this));}Fax[_0x80b9('0x1f')][_0x80b9('0x10')]=function(_0x13016b){if(_0x13016b[_0x80b9('0x20')]==='from-voip-provider'){for(var _0x18539d in this[_0x80b9('0xd')]){if(this['faxAccounts'][_0x80b9('0x21')](_0x18539d)){if(_0x13016b[_0x80b9('0x22')]===this['faxAccounts'][_0x18539d][_0x80b9('0x23')]){this['channels'][_0x13016b[_0x80b9('0x24')]]={};this[_0x80b9('0x25')][_0x13016b[_0x80b9('0x24')]]['channel']=_0x13016b['channel'];this['channels'][_0x13016b[_0x80b9('0x24')]]['id']=this['faxAccounts'][_0x18539d]['id'];this[_0x80b9('0x25')][_0x13016b[_0x80b9('0x24')]][_0x80b9('0x26')]=this['faxAccounts'][_0x18539d][_0x80b9('0x26')];logger[_0x80b9('0x27')](_0x13016b[_0x80b9('0x24')],_0x80b9('0x28'));}}}}if(this[_0x80b9('0x29')][_0x13016b[_0x80b9('0x24')]]){this[_0x80b9('0x25')][_0x13016b[_0x80b9('0x24')]]={};this['channels'][_0x13016b[_0x80b9('0x24')]][_0x80b9('0x2a')]=_0x13016b[_0x80b9('0x2a')];logger[_0x80b9('0x27')](_0x13016b[_0x80b9('0x24')],_0x80b9('0x28'));}};Fax[_0x80b9('0x1f')][_0x80b9('0x12')]=function(_0x3c5009){if(this[_0x80b9('0x25')][_0x3c5009[_0x80b9('0x24')]]){for(var _0x25c5a7 in _0x3c5009[_0x80b9('0x2b')]){if(_0x3c5009[_0x80b9('0x2b')]['hasOwnProperty'](_0x25c5a7)){this['channels'][_0x3c5009[_0x80b9('0x24')]][_0x25c5a7]=_0x3c5009[_0x80b9('0x2c')];}}}};Fax[_0x80b9('0x1f')][_0x80b9('0x14')]=function(_0x25304a){if(this[_0x80b9('0x25')][_0x25304a[_0x80b9('0x24')]]){this[_0x80b9('0x25')][_0x25304a['uniqueid']][_0x80b9('0x2d')]=_0x25304a['channelstate'];this[_0x80b9('0x25')][_0x25304a[_0x80b9('0x24')]][_0x80b9('0x2e')]=_0x25304a[_0x80b9('0x2e')];}};Fax[_0x80b9('0x1f')][_0x80b9('0x16')]=function(_0x39e55d){if(this[_0x80b9('0x25')][_0x39e55d[_0x80b9('0x24')]]){for(var _0x17c2db in _0x39e55d[_0x80b9('0x2b')]){if(_0x39e55d[_0x80b9('0x2b')]['hasOwnProperty'](_0x17c2db)){this[_0x80b9('0x25')][_0x39e55d['uniqueid']][_0x17c2db]=_0x39e55d[_0x80b9('0x2c')];}}}};Fax['prototype'][_0x80b9('0x18')]=function(_0x5da847){if(this['channels'][_0x5da847['uniqueid']]){this[_0x80b9('0x25')][_0x5da847[_0x80b9('0x24')]][_0x80b9('0x2f')]=_0x5da847['operation'];this['channels'][_0x5da847[_0x80b9('0x24')]][_0x80b9('0x30')]=_0x5da847[_0x80b9('0x30')];this[_0x80b9('0x25')][_0x5da847[_0x80b9('0x24')]][_0x80b9('0x23')]=_0x5da847[_0x80b9('0x23')];this[_0x80b9('0x25')][_0x5da847['uniqueid']]['filename']=_0x5da847[_0x80b9('0x31')];logger['info'](_0x5da847[_0x80b9('0x24')],_0x80b9('0x32'));}};Fax['prototype'][_0x80b9('0x1a')]=function(_0x19f70c){var _0x22f87f=this;if(this[_0x80b9('0x25')][_0x19f70c['uniqueid']]){var _0x111c62=this['channels'][_0x19f70c[_0x80b9('0x24')]]['id'];this[_0x80b9('0x25')][_0x19f70c[_0x80b9('0x24')]][_0x80b9('0x33')]=_0x19f70c[_0x80b9('0x33')];this[_0x80b9('0x25')][_0x19f70c[_0x80b9('0x24')]][_0x80b9('0x34')]=_0x19f70c[_0x80b9('0x34')];this[_0x80b9('0x25')][_0x19f70c['uniqueid']][_0x80b9('0x23')]=_0x19f70c[_0x80b9('0x23')];this[_0x80b9('0x25')][_0x19f70c[_0x80b9('0x24')]][_0x80b9('0x35')]=_0x19f70c[_0x80b9('0x35')];this[_0x80b9('0x25')][_0x19f70c[_0x80b9('0x24')]][_0x80b9('0x36')]=_0x19f70c['transferrate'];this[_0x80b9('0x25')][_0x19f70c[_0x80b9('0x24')]][_0x80b9('0x31')]=_0x19f70c[_0x80b9('0x31')];this['channels'][_0x19f70c['uniqueid']]['calleridnum']=_0x19f70c['calleridnum'];if(this[_0x80b9('0x25')][_0x19f70c[_0x80b9('0x24')]][_0x80b9('0x34')]>0x0){tiff2pdf(_0x19f70c[_0x80b9('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0xd22bd0){logger[_0x80b9('0x27')](_0x19f70c[_0x80b9('0x24')],_0x80b9('0x37'),_0xd22bd0['message']);attachment['create']({'name':path[_0x80b9('0x38')](_0x19f70c['filename'])[_0x80b9('0x26')],'basename':path[_0x80b9('0x38')](_0x19f70c[_0x80b9('0x31')])[_0x80b9('0x26')]+_0x80b9('0x39'),'type':_0x80b9('0x3a')})[_0x80b9('0x3b')](function(_0xf1aca4){faxAccount[_0x80b9('0x3c')](_0x111c62,{'from':_0x19f70c[_0x80b9('0x3d')],'mapKey':_0x80b9('0x3e'),'body':path[_0x80b9('0x38')](_0x19f70c['filename'])[_0x80b9('0x26')]+_0x80b9('0x39'),'AttachmentId':_0xf1aca4['id']})['catch'](function(_0x3aeacf){logger['error'](_0x19f70c[_0x80b9('0x24')],'\x20notify\x20',JSON[_0x80b9('0x3f')](_0x3aeacf));});})[_0x80b9('0x40')](function(_0x343208){logger[_0x80b9('0x41')](_0x19f70c[_0x80b9('0x24')],'\x20receiveFax\x20',JSON['stringify'](_0x343208));});});}logger[_0x80b9('0x27')](_0x19f70c['uniqueid'],_0x80b9('0x42'));}};Fax[_0x80b9('0x1f')][_0x80b9('0x1e')]=function(_0x2b72fb){if(this['actions'][_0x2b72fb[_0x80b9('0x24')]]){_[_0x80b9('0x43')](this[_0x80b9('0x25')][_0x2b72fb[_0x80b9('0x24')]],_[_0x80b9('0x44')](_0x2b72fb,[_0x80b9('0x45'),_0x80b9('0x46')]));}};function updateStatus(_0x3e300b){if(_0x3e300b[_0x80b9('0x47')]){faxMessage[_0x80b9('0x48')](_0x3e300b[_0x80b9('0x47')],{'failMessage':_0x80b9('0x49')})[_0x80b9('0x3b')](function(_0x5f58b7){ut[_0x80b9('0x4a')](_0x80b9('0x4b'),_0x5f58b7);})[_0x80b9('0x40')](function(_0x30ec71){ut[_0x80b9('0x4a')](_0x80b9('0x4c'),_0x30ec71);});}else{ut[_0x80b9('0x4a')](_0x80b9('0x4d'));}}Fax[_0x80b9('0x1f')]['updateStatus']=function(_0x28d0ff,_0x7f9e46,_0x83db56){var _0x3e2030=this;var _0x11eb2a={};if(_0x7f9e46){_0x11eb2a={'read':_0x7f9e46};}else{_0x11eb2a={'failMessage':_0x83db56};}if(this['actions'][_0x28d0ff][_0x80b9('0x47')]){faxMessage['update'](this['actions'][_0x28d0ff][_0x80b9('0x47')],_0x11eb2a)['then'](function(_0x218a7d){ut['logger']('[Fax][Message][Updated]',_0x218a7d);})[_0x80b9('0x40')](function(_0x2d33e9){ut[_0x80b9('0x4a')](_0x80b9('0x4e'),_0x2d33e9);})['finally'](function(){delete _0x3e2030['channels'][_0x28d0ff];delete _0x3e2030[_0x80b9('0x29')][_0x28d0ff];});}else{ut[_0x80b9('0x4a')](_0x80b9('0x4f'));delete this['channels'][_0x28d0ff];delete this[_0x80b9('0x29')][_0x28d0ff];}};Fax[_0x80b9('0x1f')][_0x80b9('0x1c')]=function(_0xf9ff1b){var _0x5c05cf=this;if(this['channels'][_0xf9ff1b[_0x80b9('0x24')]]){if(this[_0x80b9('0x29')][_0xf9ff1b['uniqueid']]){this[_0x80b9('0x25')][_0xf9ff1b[_0x80b9('0x24')]]['id']=this[_0x80b9('0x29')][_0xf9ff1b[_0x80b9('0x24')]]['id'];this['channels'][_0xf9ff1b[_0x80b9('0x24')]][_0x80b9('0x26')]=this[_0x80b9('0x29')][_0xf9ff1b[_0x80b9('0x24')]][_0x80b9('0x26')];}logger['info'](_0xf9ff1b[_0x80b9('0x24')],this[_0x80b9('0x29')][_0xf9ff1b[_0x80b9('0x24')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x80b9('0x25')][_0xf9ff1b['uniqueid']]));if(this[_0x80b9('0x29')][_0xf9ff1b[_0x80b9('0x24')]]){if(this['channels'][_0xf9ff1b[_0x80b9('0x24')]][_0x80b9('0x50')]>0x0&&this['channels'][_0xf9ff1b[_0x80b9('0x24')]]['faxstatus']===_0x80b9('0x51')){this[_0x80b9('0x52')](_0xf9ff1b[_0x80b9('0x24')],!![]);}else{this[_0x80b9('0x52')](_0xf9ff1b[_0x80b9('0x24')],![],this[_0x80b9('0x25')][_0xf9ff1b[_0x80b9('0x24')]][_0x80b9('0x53')]?_0x80b9('0x54')+this[_0x80b9('0x25')][_0xf9ff1b[_0x80b9('0x24')]][_0x80b9('0x53')]:_0x80b9('0x55'));}}}};Fax[_0x80b9('0x1f')][_0x80b9('0x56')]=function(_0x17fc81){var _0xad2cbf=this;return new BPromise(function(_0x3bb8d6,_0x1d9dd1){_0xad2cbf['execOriginate'](_0x17fc81,_0xad2cbf[_0x80b9('0xd')][_0x17fc81['FaxAccountId']])['then'](function(_0x1b46c7){ut[_0x80b9('0x4a')](_0x80b9('0x57'),_0x1b46c7);_0x3bb8d6(ut[_0x80b9('0x58')](_0x80b9('0x59')));})[_0x80b9('0x40')](function(_0x5a9bef){ut[_0x80b9('0x4a')](_0x80b9('0x5a'),_0x5a9bef);updateStatus(_0x17fc81);_0x1d9dd1(ut[_0x80b9('0x58')](_0x80b9('0x5b')));});});};Fax[_0x80b9('0x1f')][_0x80b9('0x5c')]=function(_0x20bc1e){var _0x101bf9=this;return new BPromise(function(_0x57d3ce,_0x4c087c){var _0x26e7f2=_0x101bf9['checkTrunk'](_0x101bf9[_0x80b9('0xd')][_0x20bc1e[_0x80b9('0x5d')]][_0x80b9('0x5e')],_0x20bc1e);if(_0x26e7f2[_0x80b9('0x5f')]){_0x57d3ce(ut[_0x80b9('0x58')](_0x80b9('0x60')));}else{_0x4c087c(ut['message'](_0x26e7f2['message']));}});};function originate(_0x773616,_0x34b0e6,_0x241096){return new BPromise(function(_0x2208e3,_0x5242ec){if(_0x241096){var _0x433a17=util[_0x80b9('0x61')](_0x80b9('0x62'),path[_0x80b9('0x38')](_0x773616[_0x80b9('0x3')])['name'],_0x773616[_0x80b9('0x3')]);gs[_0x80b9('0x63')](_0x433a17)[_0x80b9('0x3b')](function(){_0x773616[_0x80b9('0x3')]=util['format'](_0x80b9('0x64'),path[_0x80b9('0x38')](_0x773616[_0x80b9('0x3')])['dir'],path['parse'](_0x773616[_0x80b9('0x3')])[_0x80b9('0x26')]);_0x34b0e6[_0x80b9('0x65')]=_0x773616[_0x80b9('0x3')];ut['logger'](_0x80b9('0x66'),'');ami[_0x80b9('0x67')](ut[_0x80b9('0x68')](_0x773616,_0x34b0e6))[_0x80b9('0x3b')](function(_0x3f438d){_0x2208e3(_0x3f438d);})[_0x80b9('0x40')](function(_0x64a402){_0x5242ec(_0x64a402);});})['catch'](function(_0x281fca){_0x5242ec(_0x281fca);});}else{ami[_0x80b9('0x67')](ut['variablesAction'](_0x773616,_0x34b0e6))['then'](function(_0x315739){_0x2208e3(_0x315739);})[_0x80b9('0x40')](function(_0x59f946){_0x5242ec(_0x59f946);});}});}Fax[_0x80b9('0x1f')][_0x80b9('0x69')]=function(_0x1fb7ce,_0xd030f2){var _0x311e93=this;return new BPromise(function(_0x567b1e,_0x190337){var _0x2af50d=uuid['v4']();var _0xc388a6=ut[_0x80b9('0x6a')](_0x1fb7ce,_0xd030f2);_0x311e93[_0x80b9('0x29')][_0x2af50d]=new Action(_0x2af50d,_0xd030f2,_0x1fb7ce);var _0x318df8=_0x311e93[_0x80b9('0x29')][_0x2af50d];if(path[_0x80b9('0x38')](_0x1fb7ce['path'])[_0x80b9('0x6b')]==='.pdf'){originate(_0x318df8,_0xc388a6,!![])[_0x80b9('0x3b')](function(_0x2b2b4c){_0x567b1e(_0x2b2b4c);})[_0x80b9('0x40')](function(_0xe3eb38){_0x190337(_0xe3eb38);});}else{originate(_0x318df8,_0xc388a6,![])[_0x80b9('0x3b')](function(_0x3b1b1c){_0x567b1e(_0x3b1b1c);})['catch'](function(_0x1a81c1){_0x190337(_0x1a81c1);});}});};Fax[_0x80b9('0x1f')]['isTrunkReachable']=function(_0x43382d){return!_[_0x80b9('0x6c')](_0x43382d)&&!_[_0x80b9('0x6c')](_0x43382d[_0x80b9('0x26')])&&!_['isNil'](_0x43382d[_0x80b9('0x6d')])&&_0x43382d[_0x80b9('0x6d')]&&!_[_0x80b9('0x6c')](this[_0x80b9('0xe')][util['format']('SIP/%s',_0x43382d[_0x80b9('0x26')])])&&!_['isNil'](this[_0x80b9('0xe')][util[_0x80b9('0x61')](_0x80b9('0x6e'),_0x43382d['name'])]['status'])&&(this[_0x80b9('0xe')][util['format'](_0x80b9('0x6e'),_0x43382d['name'])][_0x80b9('0x30')]===_0x80b9('0x6f')||this[_0x80b9('0xe')][util[_0x80b9('0x61')](_0x80b9('0x6e'),_0x43382d[_0x80b9('0x26')])]['status']===_0x80b9('0x70'));};Fax[_0x80b9('0x1f')][_0x80b9('0x71')]=function(_0x2dc1ae,_0x7a53c8){if(!this[_0x80b9('0x72')](_0x2dc1ae)){ut[_0x80b9('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x80b9('0x6c')](_0x2dc1ae)?'':_0x2dc1ae[_0x80b9('0x26')]+_0x80b9('0x73'));return{'isValid':![],'message':_0x80b9('0x74')};}if(_[_0x80b9('0x6c')](_0x7a53c8[_0x80b9('0x3e')])){ut[_0x80b9('0x4a')](_0x80b9('0x75'),JSON[_0x80b9('0x3f')](_0x7a53c8));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x7a53c8[_0x80b9('0x3')])){ut['logger'](_0x80b9('0x76'),JSON[_0x80b9('0x3f')](_0x7a53c8));return{'isValid':![],'message':_0x80b9('0x77')};}return{'isValid':!![],'message':_0x80b9('0x78')};};module[_0x80b9('0x79')]=Fax; \ No newline at end of file +var _0x35f7=['create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','trunks','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','exports','util','lodash','uuid','moment','path','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','receivefax','hangup','originateresponse','syncOriginateResponse','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','variable','hasOwnProperty','value','channelstate','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message'];(function(_0x5e07a7,_0x1438b3){var _0x22ced5=function(_0x7c975b){while(--_0x7c975b){_0x5e07a7['push'](_0x5e07a7['shift']());}};_0x22ced5(++_0x1438b3);}(_0x35f7,0x19f));var _0x735f=function(_0x321d36,_0x596f){_0x321d36=_0x321d36-0x0;var _0xfa7b9a=_0x35f7[_0x321d36];return _0xfa7b9a;};'use strict';var util=require(_0x735f('0x0'));var _=require(_0x735f('0x1'));var BPromise=require('bluebird');var uuid=require(_0x735f('0x2'));var moment=require(_0x735f('0x3'));var path=require(_0x735f('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x735f('0x5'))(_0x735f('0x6'));var ami=require(_0x735f('0x7'));var rpcDb=require(_0x735f('0x8'));var Channel=require(_0x735f('0x9'));var ut=require(_0x735f('0xa'));var Action=require(_0x735f('0xb'));var faxAccount=require(_0x735f('0xc'));var attachment=require(_0x735f('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x3820a8){this[_0x735f('0xe')]={};this[_0x735f('0xf')]=_0x3820a8[_0x735f('0xf')];this['trunks']=_0x3820a8['trunks'];this[_0x735f('0x10')]={};ami['on'](_0x735f('0x11'),this[_0x735f('0x12')][_0x735f('0x13')](this));ami['on'](_0x735f('0x14'),this[_0x735f('0x15')][_0x735f('0x13')](this));ami['on'](_0x735f('0x16'),this[_0x735f('0x17')]['bind'](this));ami['on']('newexten',this[_0x735f('0x18')][_0x735f('0x13')](this));ami['on'](_0x735f('0x19'),this['syncFaxStatus']['bind'](this));ami['on'](_0x735f('0x1a'),this['syncReceiveFax'][_0x735f('0x13')](this));ami['on'](_0x735f('0x1b'),this['syncHangup'][_0x735f('0x13')](this));ami['on'](_0x735f('0x1c'),this[_0x735f('0x1d')]['bind'](this));}Fax['prototype'][_0x735f('0x12')]=function(_0xf5c04d){if(_0xf5c04d[_0x735f('0x1e')]===_0x735f('0x1f')){for(var _0x2a9bd5 in this[_0x735f('0xf')]){if(this[_0x735f('0xf')]['hasOwnProperty'](_0x2a9bd5)){if(_0xf5c04d[_0x735f('0x20')]===this['faxAccounts'][_0x2a9bd5][_0x735f('0x21')]){this[_0x735f('0xe')][_0xf5c04d['uniqueid']]={};this[_0x735f('0xe')][_0xf5c04d[_0x735f('0x22')]][_0x735f('0x23')]=_0xf5c04d[_0x735f('0x23')];this[_0x735f('0xe')][_0xf5c04d[_0x735f('0x22')]]['id']=this['faxAccounts'][_0x2a9bd5]['id'];this[_0x735f('0xe')][_0xf5c04d[_0x735f('0x22')]][_0x735f('0x24')]=this[_0x735f('0xf')][_0x2a9bd5][_0x735f('0x24')];logger['info'](_0xf5c04d[_0x735f('0x22')],_0x735f('0x25'));}}}}if(this[_0x735f('0x10')][_0xf5c04d[_0x735f('0x22')]]){this[_0x735f('0xe')][_0xf5c04d['uniqueid']]={};this['channels'][_0xf5c04d['uniqueid']]['channel']=_0xf5c04d[_0x735f('0x23')];logger[_0x735f('0x26')](_0xf5c04d[_0x735f('0x22')],_0x735f('0x25'));}};Fax[_0x735f('0x27')][_0x735f('0x15')]=function(_0x3c7040){if(this[_0x735f('0xe')][_0x3c7040['uniqueid']]){for(var _0x2acb59 in _0x3c7040['variable']){if(_0x3c7040[_0x735f('0x28')][_0x735f('0x29')](_0x2acb59)){this['channels'][_0x3c7040[_0x735f('0x22')]][_0x2acb59]=_0x3c7040[_0x735f('0x2a')];}}}};Fax[_0x735f('0x27')]['syncNewState']=function(_0x49324d){if(this[_0x735f('0xe')][_0x49324d[_0x735f('0x22')]]){this[_0x735f('0xe')][_0x49324d[_0x735f('0x22')]][_0x735f('0x2b')]=_0x49324d[_0x735f('0x2b')];this['channels'][_0x49324d[_0x735f('0x22')]]['channelstatedesc']=_0x49324d['channelstatedesc'];}};Fax['prototype'][_0x735f('0x18')]=function(_0xcdedbe){if(this[_0x735f('0xe')][_0xcdedbe[_0x735f('0x22')]]){for(var _0x337562 in _0xcdedbe[_0x735f('0x28')]){if(_0xcdedbe[_0x735f('0x28')][_0x735f('0x29')](_0x337562)){this[_0x735f('0xe')][_0xcdedbe[_0x735f('0x22')]][_0x337562]=_0xcdedbe[_0x735f('0x2a')];}}}};Fax[_0x735f('0x27')]['syncFaxStatus']=function(_0xa505dc){if(this[_0x735f('0xe')][_0xa505dc[_0x735f('0x22')]]){this[_0x735f('0xe')][_0xa505dc[_0x735f('0x22')]][_0x735f('0x2c')]=_0xa505dc[_0x735f('0x2c')];this[_0x735f('0xe')][_0xa505dc['uniqueid']][_0x735f('0x2d')]=_0xa505dc[_0x735f('0x2d')];this[_0x735f('0xe')][_0xa505dc['uniqueid']][_0x735f('0x21')]=_0xa505dc[_0x735f('0x21')];this['channels'][_0xa505dc[_0x735f('0x22')]][_0x735f('0x2e')]=_0xa505dc[_0x735f('0x2e')];logger['info'](_0xa505dc['uniqueid'],_0x735f('0x2f'));}};Fax['prototype'][_0x735f('0x30')]=function(_0x52adcc){var _0x3e90cd=this;if(this[_0x735f('0xe')][_0x52adcc['uniqueid']]){var _0x576b29=this[_0x735f('0xe')][_0x52adcc['uniqueid']]['id'];this['channels'][_0x52adcc[_0x735f('0x22')]][_0x735f('0x31')]=_0x52adcc['remotestationid'];this[_0x735f('0xe')][_0x52adcc[_0x735f('0x22')]][_0x735f('0x32')]=_0x52adcc[_0x735f('0x32')];this[_0x735f('0xe')][_0x52adcc[_0x735f('0x22')]][_0x735f('0x21')]=_0x52adcc['localstationid'];this[_0x735f('0xe')][_0x52adcc[_0x735f('0x22')]][_0x735f('0x33')]=_0x52adcc['resolution'];this[_0x735f('0xe')][_0x52adcc[_0x735f('0x22')]][_0x735f('0x34')]=_0x52adcc['transferrate'];this[_0x735f('0xe')][_0x52adcc[_0x735f('0x22')]][_0x735f('0x2e')]=_0x52adcc[_0x735f('0x2e')];this['channels'][_0x52adcc[_0x735f('0x22')]][_0x735f('0x35')]=_0x52adcc[_0x735f('0x35')];if(this[_0x735f('0xe')][_0x52adcc[_0x735f('0x22')]][_0x735f('0x32')]>0x0){tiff2pdf(_0x52adcc['filename'],_0x735f('0x36'),function(_0x2e3372){logger[_0x735f('0x26')](_0x52adcc[_0x735f('0x22')],_0x735f('0x37'),_0x2e3372[_0x735f('0x38')]);attachment[_0x735f('0x39')]({'name':path[_0x735f('0x3a')](_0x52adcc['filename'])[_0x735f('0x24')],'basename':path[_0x735f('0x3a')](_0x52adcc[_0x735f('0x2e')])[_0x735f('0x24')]+_0x735f('0x3b'),'type':_0x735f('0x3c')})[_0x735f('0x3d')](function(_0x564686){faxAccount['notify'](_0x576b29,{'from':_0x52adcc[_0x735f('0x35')],'mapKey':'fax','body':path[_0x735f('0x3a')](_0x52adcc[_0x735f('0x2e')])[_0x735f('0x24')]+_0x735f('0x3b'),'AttachmentId':_0x564686['id']})[_0x735f('0x3e')](function(_0x2e67c0){logger[_0x735f('0x3f')](_0x52adcc[_0x735f('0x22')],_0x735f('0x40'),JSON[_0x735f('0x41')](_0x2e67c0));});})[_0x735f('0x3e')](function(_0x1aca1f){logger[_0x735f('0x3f')](_0x52adcc[_0x735f('0x22')],_0x735f('0x42'),JSON['stringify'](_0x1aca1f));});});}logger[_0x735f('0x26')](_0x52adcc[_0x735f('0x22')],_0x735f('0x42'));}};Fax['prototype']['syncOriginateResponse']=function(_0x5bd077){if(this[_0x735f('0x10')][_0x5bd077[_0x735f('0x22')]]){_[_0x735f('0x43')](this[_0x735f('0xe')][_0x5bd077['uniqueid']],_['pick'](_0x5bd077,[_0x735f('0x44'),_0x735f('0x45')]));}};function updateStatus(_0x1df9bf){if(_0x1df9bf[_0x735f('0x46')]){faxMessage['update'](_0x1df9bf[_0x735f('0x46')],{'failMessage':_0x735f('0x47')})['then'](function(_0x3e3d75){ut[_0x735f('0x48')](_0x735f('0x49'),_0x3e3d75);})[_0x735f('0x3e')](function(_0x47e9d5){ut[_0x735f('0x48')](_0x735f('0x4a'),_0x47e9d5);});}else{ut[_0x735f('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x735f('0x27')][_0x735f('0x4b')]=function(_0x2203cf,_0x3c7e66,_0xecbdc2){var _0x47615c=this;var _0x18f4c8={};if(_0x3c7e66){_0x18f4c8={'read':_0x3c7e66};}else{_0x18f4c8={'failMessage':_0xecbdc2};}if(this[_0x735f('0x10')][_0x2203cf][_0x735f('0x46')]){faxMessage[_0x735f('0x4c')](this['actions'][_0x2203cf][_0x735f('0x46')],_0x18f4c8)[_0x735f('0x3d')](function(_0x4a7b06){ut['logger'](_0x735f('0x4d'),_0x4a7b06);})[_0x735f('0x3e')](function(_0x380bfb){ut['logger'](_0x735f('0x4e'),_0x380bfb);})['finally'](function(){delete _0x47615c[_0x735f('0xe')][_0x2203cf];delete _0x47615c[_0x735f('0x10')][_0x2203cf];});}else{ut[_0x735f('0x48')](_0x735f('0x4f'));delete this['channels'][_0x2203cf];delete this[_0x735f('0x10')][_0x2203cf];}};Fax[_0x735f('0x27')][_0x735f('0x50')]=function(_0x474dc8){var _0x3ab8c8=this;if(this[_0x735f('0xe')][_0x474dc8[_0x735f('0x22')]]){if(this[_0x735f('0x10')][_0x474dc8[_0x735f('0x22')]]){this[_0x735f('0xe')][_0x474dc8[_0x735f('0x22')]]['id']=this[_0x735f('0x10')][_0x474dc8[_0x735f('0x22')]]['id'];this[_0x735f('0xe')][_0x474dc8[_0x735f('0x22')]][_0x735f('0x24')]=this[_0x735f('0x10')][_0x474dc8['uniqueid']][_0x735f('0x24')];}logger[_0x735f('0x26')](_0x474dc8[_0x735f('0x22')],this[_0x735f('0x10')][_0x474dc8[_0x735f('0x22')]]?'\x20hangup\x20sendFile\x20':_0x735f('0x51'),JSON['stringify'](this['channels'][_0x474dc8[_0x735f('0x22')]]));if(this[_0x735f('0x10')][_0x474dc8[_0x735f('0x22')]]){if(this[_0x735f('0xe')][_0x474dc8['uniqueid']]['faxpages']>0x0&&this[_0x735f('0xe')][_0x474dc8['uniqueid']][_0x735f('0x19')]===_0x735f('0x52')){this[_0x735f('0x4b')](_0x474dc8['uniqueid'],!![]);}else{this[_0x735f('0x4b')](_0x474dc8[_0x735f('0x22')],![],this['channels'][_0x474dc8['uniqueid']][_0x735f('0x53')]?_0x735f('0x54')+this[_0x735f('0xe')][_0x474dc8[_0x735f('0x22')]][_0x735f('0x53')]:_0x735f('0x55'));}}}};Fax[_0x735f('0x27')][_0x735f('0x56')]=function(_0x3112b8){var _0x45adab=this;return new BPromise(function(_0x293b8a,_0x4171cd){_0x45adab[_0x735f('0x57')](_0x3112b8,_0x45adab[_0x735f('0xf')][_0x3112b8['FaxAccountId']])['then'](function(_0x467a30){ut[_0x735f('0x48')](_0x735f('0x58'),_0x467a30);_0x293b8a(ut[_0x735f('0x38')](_0x735f('0x59')));})[_0x735f('0x3e')](function(_0x4eaff4){ut[_0x735f('0x48')]('[Fax][execOriginate][failure]',_0x4eaff4);updateStatus(_0x3112b8);_0x4171cd(ut['message'](_0x735f('0x5a')));});});};Fax[_0x735f('0x27')][_0x735f('0x5b')]=function(_0x40c424){var _0x5356ec=this;return new BPromise(function(_0x472c18,_0x54e30a){var _0x10f23f=_0x5356ec[_0x735f('0x5c')](_0x5356ec['faxAccounts'][_0x40c424[_0x735f('0x5d')]]['Trunk'],_0x40c424);if(_0x10f23f[_0x735f('0x5e')]){_0x472c18(ut['message']('Trunk\x20Reachable'));}else{_0x54e30a(ut[_0x735f('0x38')](_0x10f23f[_0x735f('0x38')]));}});};function originate(_0x12b775,_0x2344e9,_0x1f1dc5){return new BPromise(function(_0x32497b,_0x2dd9b3){if(_0x1f1dc5){var _0x3e5565=util[_0x735f('0x5f')](_0x735f('0x60'),path[_0x735f('0x3a')](_0x12b775[_0x735f('0x4')])[_0x735f('0x24')],_0x12b775[_0x735f('0x4')]);gs['execute'](_0x3e5565)[_0x735f('0x3d')](function(){_0x12b775[_0x735f('0x4')]=util[_0x735f('0x5f')](_0x735f('0x61'),path[_0x735f('0x3a')](_0x12b775[_0x735f('0x4')])[_0x735f('0x62')],path['parse'](_0x12b775[_0x735f('0x4')])['name']);_0x2344e9['XMF-PATH']=_0x12b775[_0x735f('0x4')];ut[_0x735f('0x48')](_0x735f('0x63'),'');ami['Action'](ut[_0x735f('0x64')](_0x12b775,_0x2344e9))[_0x735f('0x3d')](function(_0x55e203){_0x32497b(_0x55e203);})['catch'](function(_0x259306){_0x2dd9b3(_0x259306);});})[_0x735f('0x3e')](function(_0x37cbca){_0x2dd9b3(_0x37cbca);});}else{ami[_0x735f('0x65')](ut[_0x735f('0x64')](_0x12b775,_0x2344e9))[_0x735f('0x3d')](function(_0x3ff078){_0x32497b(_0x3ff078);})['catch'](function(_0x1e8815){_0x2dd9b3(_0x1e8815);});}});}Fax['prototype'][_0x735f('0x57')]=function(_0x364edb,_0x4a515d){var _0x1cdb44=this;return new BPromise(function(_0x204000,_0x1f37b3){var _0x4d2223=uuid['v4']();var _0x16c2c8=ut[_0x735f('0x66')](_0x364edb,_0x4a515d);_0x1cdb44[_0x735f('0x10')][_0x4d2223]=new Action(_0x4d2223,_0x4a515d,_0x364edb);var _0x291214=_0x1cdb44[_0x735f('0x10')][_0x4d2223];if(path[_0x735f('0x3a')](_0x364edb[_0x735f('0x4')])[_0x735f('0x67')]===_0x735f('0x3b')){originate(_0x291214,_0x16c2c8,!![])['then'](function(_0x3d9e3d){_0x204000(_0x3d9e3d);})[_0x735f('0x3e')](function(_0x4a67dc){_0x1f37b3(_0x4a67dc);});}else{originate(_0x291214,_0x16c2c8,![])[_0x735f('0x3d')](function(_0x377c13){_0x204000(_0x377c13);})['catch'](function(_0xdb7ed5){_0x1f37b3(_0xdb7ed5);});}});};Fax[_0x735f('0x27')][_0x735f('0x68')]=function(_0x27e60e){return!_['isNil'](_0x27e60e)&&!_['isNil'](_0x27e60e[_0x735f('0x24')])&&!_[_0x735f('0x69')](_0x27e60e[_0x735f('0x6a')])&&_0x27e60e[_0x735f('0x6a')]&&!_['isNil'](this[_0x735f('0x6b')][util['format'](_0x735f('0x6c'),_0x27e60e[_0x735f('0x24')])])&&!_[_0x735f('0x69')](this[_0x735f('0x6b')][util[_0x735f('0x5f')](_0x735f('0x6c'),_0x27e60e[_0x735f('0x24')])]['status'])&&(this['trunks'][util['format']('SIP/%s',_0x27e60e[_0x735f('0x24')])][_0x735f('0x2d')]===_0x735f('0x6d')||this[_0x735f('0x6b')][util[_0x735f('0x5f')](_0x735f('0x6c'),_0x27e60e[_0x735f('0x24')])][_0x735f('0x2d')]===_0x735f('0x6e'));};Fax['prototype'][_0x735f('0x5c')]=function(_0x2a50c4,_0x4a1008){if(!this[_0x735f('0x68')](_0x2a50c4)){ut['logger'](_0x735f('0x6f'),_['isNil'](_0x2a50c4)?'':_0x2a50c4[_0x735f('0x24')]+_0x735f('0x70'));return{'isValid':![],'message':_0x735f('0x71')};}if(_['isNil'](_0x4a1008[_0x735f('0x6')])){ut[_0x735f('0x48')](_0x735f('0x72'),JSON[_0x735f('0x41')](_0x4a1008));return{'isValid':![],'message':_0x735f('0x73')};}if(_[_0x735f('0x69')](_0x4a1008['path'])){ut[_0x735f('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x4a1008));return{'isValid':![],'message':_0x735f('0x74')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x735f('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 e766f89..5daccaf 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 _0x8c72=['../rpc/faxAccount','inspect','notify','resolve','then','catch','util','bluebird','../../../config/logger','lodash'];(function(_0x567547,_0x2b1e90){var _0x44cb73=function(_0x51574a){while(--_0x51574a){_0x567547['push'](_0x567547['shift']());}};_0x44cb73(++_0x2b1e90);}(_0x8c72,0xba));var _0x28c7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8c72[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x28c7('0x0'));var BPromise=require(_0x28c7('0x1'));var logger=require(_0x28c7('0x2'))('preview');var _=require(_0x28c7('0x3'));var faxAccount=require(_0x28c7('0x4'));function loggerCatch(_0x52c020){return function(_0x12ad8a){logger['error'](_0x52c020,util[_0x28c7('0x5')](_0x12ad8a,{'showHidden':![],'depth':null}));};}exports[_0x28c7('0x6')]=function(_0x1f71aa,_0x12d312){return BPromise[_0x28c7('0x7')]()[_0x28c7('0x8')](faxAccount[_0x28c7('0x6')](_0x1f71aa,_0x12d312))[_0x28c7('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xffe4=['error','inspect','resolve','then','catch','[Notify]\x20','util','preview'];(function(_0x2438f8,_0x5545d5){var _0xae7287=function(_0x13c745){while(--_0x13c745){_0x2438f8['push'](_0x2438f8['shift']());}};_0xae7287(++_0x5545d5);}(_0xffe4,0xa6));var _0x4ffe=function(_0x1a3b30,_0x21ae07){_0x1a3b30=_0x1a3b30-0x0;var _0x252b23=_0xffe4[_0x1a3b30];return _0x252b23;};'use strict';var util=require(_0x4ffe('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x4ffe('0x1'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2e505a){return function(_0x4a1fa2){logger[_0x4ffe('0x2')](_0x2e505a,util[_0x4ffe('0x3')](_0x4a1fa2,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x239b1e,_0x217863){return BPromise[_0x4ffe('0x4')]()[_0x4ffe('0x5')](faxAccount['notify'](_0x239b1e,_0x217863))[_0x4ffe('0x6')](loggerCatch(_0x4ffe('0x7')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index fc8762b..02f3fa4 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 _0xf2c7=['Exec\x20gs','\x20Error\x20:','util','fax','exec','execute','info'];(function(_0x2d8501,_0x231868){var _0x2c7601=function(_0xd968dc){while(--_0xd968dc){_0x2d8501['push'](_0x2d8501['shift']());}};_0x2c7601(++_0x231868);}(_0xf2c7,0x152));var _0x7f2c=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0xf2c7[_0x3f2228];return _0x285ae4;};'use strict';var util=require(_0x7f2c('0x0'));var logger=require('../../../../config/logger')(_0x7f2c('0x1'));var BPromise=require('bluebird');var exec=require('child_process')[_0x7f2c('0x2')];exports[_0x7f2c('0x3')]=function(_0x2a1087){return new BPromise(function(_0x4c8d9e,_0x2df02c){exec(_0x2a1087,function(_0x59541a,_0x3b54da,_0x5db543){logger[_0x7f2c('0x4')](_0x7f2c('0x5'),_0x3b54da);if(_0x59541a){logger[_0x7f2c('0x4')]('Exec\x20gs',_0x7f2c('0x6'),util['inspect'](_0x59541a,{'showHidden':![],'depth':null}),_0x3b54da,_0x5db543);_0x2df02c(_0x59541a);}_0x4c8d9e(_0x3b54da);});});}; \ No newline at end of file +var _0x0b32=['Exec\x20gs','info','\x20Error\x20:','inspect','util','bluebird','child_process','exec','execute'];(function(_0x1eed52,_0x1bb3c1){var _0x57782a=function(_0x2cb894){while(--_0x2cb894){_0x1eed52['push'](_0x1eed52['shift']());}};_0x57782a(++_0x1bb3c1);}(_0x0b32,0x1ea));var _0x20b3=function(_0x4f0648,_0x51b55d){_0x4f0648=_0x4f0648-0x0;var _0x2d4573=_0x0b32[_0x4f0648];return _0x2d4573;};'use strict';var util=require(_0x20b3('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x20b3('0x1'));var exec=require(_0x20b3('0x2'))[_0x20b3('0x3')];exports[_0x20b3('0x4')]=function(_0x6755ac){return new BPromise(function(_0x256e80,_0x5ee033){exec(_0x6755ac,function(_0x496683,_0x2e8351,_0x63a03b){logger['info'](_0x20b3('0x5'),_0x2e8351);if(_0x496683){logger[_0x20b3('0x6')]('Exec\x20gs',_0x20b3('0x7'),util[_0x20b3('0x8')](_0x496683,{'showHidden':![],'depth':null}),_0x2e8351,_0x63a03b);_0x5ee033(_0x496683);}_0x256e80(_0x2e8351);});});}; \ 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 060e250..b820ba4 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 _0x7689=['../../../../config/logger','logger','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','util','lodash'];(function(_0x45dc5b,_0x1c532b){var _0x2b67a6=function(_0x740292){while(--_0x740292){_0x45dc5b['push'](_0x45dc5b['shift']());}};_0x2b67a6(++_0x1c532b);}(_0x7689,0x124));var _0x9768=function(_0x4107c1,_0x3adb65){_0x4107c1=_0x4107c1-0x0;var _0x588e29=_0x7689[_0x4107c1];return _0x588e29;};'use strict';var util=require(_0x9768('0x0'));var _=require(_0x9768('0x1'));var moment=require('moment');var logger=require(_0x9768('0x2'))('fax');exports['message']=function(_0x3d2db5){return{'message':_0x3d2db5};};exports[_0x9768('0x3')]=function(_0x30c7d3,_0x1e4bea){logger['info'](_0x30c7d3,util['inspect'](_0x1e4bea,{'showHidden':![],'depth':null}));};exports[_0x9768('0x4')]=function(_0x5d0f6e,_0x3db633){var _0x4fbfa2={'XMF-ECM':_0x3db633[_0x9768('0x5')],'XMF-HEADERINFO':_0x3db633[_0x9768('0x6')],'XMF-MINRATE':_0x3db633[_0x9768('0x7')],'XMF-MAXRATE':_0x3db633[_0x9768('0x8')],'XMF-MODEM':util[_0x9768('0x9')](_0x9768('0xa'),_0x3db633[_0x9768('0xb')]),'XMF-GATEWAY':_0x3db633[_0x9768('0xc')],'XMF-FAXDETECT':_0x3db633[_0x9768('0xd')],'XMF-T38TIMEOUT':_0x3db633['t38timeout'],'XMF-LOCALSTATIONID':_0x3db633[_0x9768('0xe')],'XMF-PATH':_0x5d0f6e['path']};return _0x4fbfa2;};exports[_0x9768('0xf')]=function(_0x5ea216,_0x2d35a0){return{'actionid':_0x5ea216[_0x9768('0x10')],'action':_0x9768('0x11'),'channel':_0x5ea216[_0x9768('0x12')],'Exten':_0x9768('0x13'),'Context':_0x9768('0x14'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x5ea216[_0x9768('0x6')]?_0x5ea216[_0x9768('0x6')]:'',_0x5ea216[_0x9768('0xe')]),'variable':_0x2d35a0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5ea216[_0x9768('0x10')]};}; \ No newline at end of file +var _0x2da2=['moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2da2,0xc6));var _0x22da=function(_0x3133ae,_0x393afb){_0x3133ae=_0x3133ae-0x0;var _0x2b4321=_0x2da2[_0x3133ae];return _0x2b4321;};'use strict';var util=require(_0x22da('0x0'));var _=require(_0x22da('0x1'));var moment=require(_0x22da('0x2'));var logger=require(_0x22da('0x3'))(_0x22da('0x4'));exports[_0x22da('0x5')]=function(_0x4a8161){return{'message':_0x4a8161};};exports[_0x22da('0x6')]=function(_0x4bc66a,_0x3bb96b){logger[_0x22da('0x7')](_0x4bc66a,util[_0x22da('0x8')](_0x3bb96b,{'showHidden':![],'depth':null}));};exports[_0x22da('0x9')]=function(_0x1f31ef,_0x168752){var _0x33f303={'XMF-ECM':_0x168752[_0x22da('0xa')],'XMF-HEADERINFO':_0x168752[_0x22da('0xb')],'XMF-MINRATE':_0x168752['minrate'],'XMF-MAXRATE':_0x168752[_0x22da('0xc')],'XMF-MODEM':util['format'](_0x22da('0xd'),_0x168752[_0x22da('0xe')]),'XMF-GATEWAY':_0x168752[_0x22da('0xf')],'XMF-FAXDETECT':_0x168752[_0x22da('0x10')],'XMF-T38TIMEOUT':_0x168752[_0x22da('0x11')],'XMF-LOCALSTATIONID':_0x168752[_0x22da('0x12')],'XMF-PATH':_0x1f31ef['path']};return _0x33f303;};exports[_0x22da('0x13')]=function(_0x1e51b3,_0x2e162d){return{'actionid':_0x1e51b3[_0x22da('0x14')],'action':_0x22da('0x15'),'channel':_0x1e51b3[_0x22da('0x16')],'Exten':'xcally-motion-fax','Context':_0x22da('0x17'),'Priority':'1','callerid':util['format'](_0x22da('0x18'),_0x1e51b3[_0x22da('0xb')]?_0x1e51b3[_0x22da('0xb')]:'',_0x1e51b3[_0x22da('0x12')]),'variable':_0x2e162d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1e51b3[_0x22da('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index d1549c6..99da957 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 _0x4f18=['./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','hour','get','resolve','then','getAgents','initAgents','getTelephones','getTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','catch','[index.js][main]','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk'];(function(_0x2e9fb9,_0x538aa8){var _0x22572f=function(_0x1e7423){while(--_0x1e7423){_0x2e9fb9['push'](_0x2e9fb9['shift']());}};_0x22572f(++_0x538aa8);}(_0x4f18,0x1d0));var _0x84f1=function(_0x5d2917,_0x2e788e){_0x5d2917=_0x5d2917-0x0;var _0x4fc3e9=_0x4f18[_0x5d2917];return _0x4fc3e9;};'use strict';var util=require(_0x84f1('0x0'));var moment=require(_0x84f1('0x1'));var server=require(_0x84f1('0x2'));var Realtime=require(_0x84f1('0x3'));var Report=require('./report');var Acw=require(_0x84f1('0x4'));var Trigger=require(_0x84f1('0x5'));var Dialer=require(_0x84f1('0x6'));var Preview=require(_0x84f1('0x7'));var Fax=require(_0x84f1('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0x84f1('0x9'));var voiceQueueReport=require(_0x84f1('0xa'));var voiceCallReport=require(_0x84f1('0xb'));var trunk=require(_0x84f1('0xc'));var trigger=require('./rpc/trigger');var template=require(_0x84f1('0xd'));var cmHopperHistory=require(_0x84f1('0xe'));var campaign=require(_0x84f1('0xf'));var voiceExtension=require(_0x84f1('0x10'));var faxAccount=require(_0x84f1('0x11'));var zendesk=require(_0x84f1('0x12'));var salesforce=require(_0x84f1('0x13'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x84f1('0x14'));var zoho=require(_0x84f1('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x84f1('0x16'));var servicenow=require(_0x84f1('0x17'));var dynamics365=require(_0x84f1('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x84f1('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x84f1('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x84f1('0x1b')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x84f1('0x1c')]()[_0x84f1('0x1d')](user[_0x84f1('0x1e')]())[_0x84f1('0x1d')](realtime[_0x84f1('0x1f')]())[_0x84f1('0x1d')](user[_0x84f1('0x20')]())[_0x84f1('0x1d')](realtime['initTelephones']())[_0x84f1('0x1d')](trunk[_0x84f1('0x21')]())[_0x84f1('0x1d')](realtime['initTrunks']())[_0x84f1('0x1d')](voiceQueue[_0x84f1('0x22')]())['then'](realtime[_0x84f1('0x23')]())['then'](trigger['getTriggers']())[_0x84f1('0x1d')](realtime[_0x84f1('0x24')]())[_0x84f1('0x1d')](template['getTemplates']())['then'](realtime['initTemplates']())[_0x84f1('0x1d')](zendesk[_0x84f1('0x25')]())[_0x84f1('0x1d')](realtime[_0x84f1('0x26')]())[_0x84f1('0x1d')](salesforce[_0x84f1('0x27')]())[_0x84f1('0x1d')](realtime[_0x84f1('0x28')]())['then'](sugarcrm[_0x84f1('0x29')]())[_0x84f1('0x1d')](realtime[_0x84f1('0x2a')]())[_0x84f1('0x1d')](freshdesk[_0x84f1('0x2b')]())[_0x84f1('0x1d')](realtime[_0x84f1('0x2c')]())['then'](desk[_0x84f1('0x2d')]())[_0x84f1('0x1d')](realtime['initDeskAccounts']())[_0x84f1('0x1d')](zoho['getZohoAccounts']())[_0x84f1('0x1d')](realtime[_0x84f1('0x2e')]())['then'](vtiger[_0x84f1('0x2f')]())[_0x84f1('0x1d')](realtime[_0x84f1('0x30')]())[_0x84f1('0x1d')](freshsales[_0x84f1('0x31')]())['then'](realtime['initFreshsalesAccounts']())[_0x84f1('0x1d')](servicenow[_0x84f1('0x32')]())[_0x84f1('0x1d')](realtime[_0x84f1('0x33')]())[_0x84f1('0x1d')](dynamics365['getDynamics365Accounts']())[_0x84f1('0x1d')](realtime['initDynamics365Accounts']())[_0x84f1('0x1d')](campaign['getCampaigns']())[_0x84f1('0x1d')](realtime[_0x84f1('0x34')]())[_0x84f1('0x1d')](voiceExtension[_0x84f1('0x35')]())['then'](realtime[_0x84f1('0x36')]())['then'](faxAccount[_0x84f1('0x37')]())[_0x84f1('0x1d')](realtime[_0x84f1('0x38')]())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x84f1('0x1d')](voiceQueueReport[_0x84f1('0x39')]())[_0x84f1('0x1d')](realtime['initVoiceQueueReports']())[_0x84f1('0x1d')](cmHopperHistory[_0x84f1('0x3a')]())[_0x84f1('0x1d')](realtime[_0x84f1('0x3b')]())['then'](cmHopperHistory[_0x84f1('0x3c')]())[_0x84f1('0x1d')](realtime['initCampaignHopperHistory']())[_0x84f1('0x1d')](voiceCallReport[_0x84f1('0x3d')]())['then'](realtime['initVoiceCallReports']())['catch'](function(_0x2ed894){logger[_0x84f1('0x3e')](_0x84f1('0x3f'),util[_0x84f1('0x40')](_0x2ed894,{'showHidden':![],'depth':null}));});}function main(){return server[_0x84f1('0x41')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x84f1('0x1d')](function(){return initParams();})[_0x84f1('0x1d')](function(){report[_0x84f1('0x42')]();setInterval(initRealtime,0x1388);})[_0x84f1('0x43')](function(_0x5c4141){logger[_0x84f1('0x3e')](_0x84f1('0x44'),util[_0x84f1('0x40')](_0x5c4141,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xf1ed=['getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','get','hour','resolve','then'];(function(_0x470d9d,_0x2c68c6){var _0x4eb13f=function(_0x2c0bf2){while(--_0x2c0bf2){_0x470d9d['push'](_0x470d9d['shift']());}};_0x4eb13f(++_0x2c68c6);}(_0xf1ed,0x193));var _0xdf1e=function(_0x101318,_0x10b20d){_0x101318=_0x101318-0x0;var _0x37ab8f=_0xf1ed[_0x101318];return _0x37ab8f;};'use strict';var util=require(_0xdf1e('0x0'));var moment=require(_0xdf1e('0x1'));var server=require(_0xdf1e('0x2'));var Realtime=require(_0xdf1e('0x3'));var Report=require(_0xdf1e('0x4'));var Acw=require(_0xdf1e('0x5'));var Trigger=require(_0xdf1e('0x6'));var Dialer=require(_0xdf1e('0x7'));var Preview=require(_0xdf1e('0x8'));var Fax=require(_0xdf1e('0x9'));var user=require(_0xdf1e('0xa'));var voiceQueue=require(_0xdf1e('0xb'));var voiceQueueReport=require(_0xdf1e('0xc'));var voiceCallReport=require(_0xdf1e('0xd'));var trunk=require(_0xdf1e('0xe'));var trigger=require(_0xdf1e('0xf'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xdf1e('0x10'));var voiceExtension=require(_0xdf1e('0x11'));var faxAccount=require(_0xdf1e('0x12'));var zendesk=require(_0xdf1e('0x13'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xdf1e('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xdf1e('0x15'));var zoho=require(_0xdf1e('0x16'));var vtiger=require(_0xdf1e('0x17'));var freshsales=require(_0xdf1e('0x18'));var servicenow=require('./rpc/integrations/servicenow');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')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xdf1e('0x19')](_0xdf1e('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xdf1e('0x19')](_0xdf1e('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xdf1e('0x1b')]()[_0xdf1e('0x1c')](user[_0xdf1e('0x1d')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x1e')]())['then'](user[_0xdf1e('0x1f')]())[_0xdf1e('0x1c')](realtime['initTelephones']())['then'](trunk[_0xdf1e('0x20')]())['then'](realtime[_0xdf1e('0x21')]())[_0xdf1e('0x1c')](voiceQueue[_0xdf1e('0x22')]())['then'](realtime[_0xdf1e('0x23')]())[_0xdf1e('0x1c')](trigger['getTriggers']())['then'](realtime[_0xdf1e('0x24')]())['then'](template[_0xdf1e('0x25')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x26')]())[_0xdf1e('0x1c')](zendesk[_0xdf1e('0x27')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x28')]())[_0xdf1e('0x1c')](salesforce[_0xdf1e('0x29')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x2a')]())[_0xdf1e('0x1c')](sugarcrm[_0xdf1e('0x2b')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x2c')]())[_0xdf1e('0x1c')](freshdesk[_0xdf1e('0x2d')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x2e')]())['then'](desk[_0xdf1e('0x2f')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x30')]())[_0xdf1e('0x1c')](zoho[_0xdf1e('0x31')]())['then'](realtime[_0xdf1e('0x32')]())[_0xdf1e('0x1c')](vtiger[_0xdf1e('0x33')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x34')]())[_0xdf1e('0x1c')](freshsales[_0xdf1e('0x35')]())['then'](realtime['initFreshsalesAccounts']())['then'](servicenow[_0xdf1e('0x36')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x37')]())['then'](dynamics365[_0xdf1e('0x38')]())[_0xdf1e('0x1c')](realtime['initDynamics365Accounts']())['then'](campaign['getCampaigns']())[_0xdf1e('0x1c')](realtime['initCampaigns']())[_0xdf1e('0x1c')](voiceExtension[_0xdf1e('0x39')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x3a')]())[_0xdf1e('0x1c')](faxAccount[_0xdf1e('0x3b')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x3c')]())[_0xdf1e('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0xdf1e('0x1b')]()[_0xdf1e('0x1c')](voiceQueueReport[_0xdf1e('0x3d')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x3e')]())[_0xdf1e('0x1c')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0xdf1e('0x3f')]())[_0xdf1e('0x1c')](cmHopperHistory[_0xdf1e('0x40')]())[_0xdf1e('0x1c')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0xdf1e('0x41')]())[_0xdf1e('0x1c')](realtime[_0xdf1e('0x42')]())[_0xdf1e('0x43')](function(_0x2f6f8e){logger[_0xdf1e('0x44')]('[index.js][initParams]',util[_0xdf1e('0x45')](_0x2f6f8e,{'showHidden':![],'depth':null}));});}function main(){return server[_0xdf1e('0x46')](realtime,preview,fax)[_0xdf1e('0x1c')](function(){return initRealtime();})[_0xdf1e('0x1c')](function(){return initParams();})[_0xdf1e('0x1c')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xdf1e('0x43')](function(_0x237fc6){logger[_0xdf1e('0x44')](_0xdf1e('0x47'),util['inspect'](_0x237fc6,{'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 5f39934..d23df16 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 _0xa4d8=['onhold','local','md5','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format','user:%s','emit','user:ami:update','omit','user:presence','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','stateTime','status','unknown','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue'];(function(_0x47ab85,_0x38b5c5){var _0x267043=function(_0x58d58a){while(--_0x58d58a){_0x47ab85['push'](_0x47ab85['shift']());}};_0x267043(++_0x38b5c5);}(_0xa4d8,0x171));var _0x8a4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var md5=require('md5');var Redis=require(_0x8a4d('0x0'));var config=require(_0x8a4d('0x1'));config[_0x8a4d('0x2')]=_[_0x8a4d('0x3')](config[_0x8a4d('0x2')],{'host':_0x8a4d('0x4'),'port':0x18eb});var io=require(_0x8a4d('0x5'))(new Redis(config['redis']));function Agent(_0x1444bd){this['id']=_0x1444bd['id']||0x0;this['name']=_0x1444bd[_0x8a4d('0x6')]||'';this['email']=_0x1444bd[_0x8a4d('0x7')]||'';this[_0x8a4d('0x8')]=_0x1444bd[_0x8a4d('0x8')]||'';this['fullname']=_0x1444bd[_0x8a4d('0x9')]||'';this['state']='unknown';this[_0x8a4d('0xa')]=0x0;this[_0x8a4d('0xb')]=_0x8a4d('0xc');this[_0x8a4d('0xd')]='';this['phone']='';this[_0x8a4d('0xe')]='';this[_0x8a4d('0xf')]='';this[_0x8a4d('0x10')]=_0x1444bd[_0x8a4d('0x10')]||![];this[_0x8a4d('0x11')]='unknown';this[_0x8a4d('0x12')]=0x0;this[_0x8a4d('0x13')]='';this[_0x8a4d('0x14')]='';this[_0x8a4d('0x15')]=![];this[_0x8a4d('0x16')]=![];this[_0x8a4d('0x17')]='';}Agent[_0x8a4d('0x18')][_0x8a4d('0x19')]=function(_0x662436){var _0x3ac34d;if(_0x662436&&_0x662436[_0x8a4d('0x1a')]){_0x3ac34d=_0x662436['state'][_0x8a4d('0x1b')]();switch(_0x3ac34d){case _0x8a4d('0x1c'):_0x3ac34d=_0x8a4d('0x1d');break;case _0x8a4d('0x1e'):_0x3ac34d='talking';break;}}if(_0x3ac34d&&this[_0x8a4d('0x11')]!==_0x3ac34d||_0x662436[_0x8a4d('0x1f')]){this[_0x8a4d('0x12')]=_[_0x8a4d('0x20')](moment()[_0x8a4d('0x21')]('x'));}if(_0x3ac34d){this[_0x8a4d('0x11')]=_0x3ac34d;}var _0xa02ed0={'id':this['id'],'name':this[_0x8a4d('0x6')],'email':this[_0x8a4d('0x7')],'accountcode':this[_0x8a4d('0x8')],'fullname':this[_0x8a4d('0x9')],'state':this['state'],'stateTime':this[_0x8a4d('0xa')],'status':this[_0x8a4d('0xb')],'address':this[_0x8a4d('0xd')],'online':this['online'],'voiceStatus':this[_0x8a4d('0x11')],'voiceStatusTime':this[_0x8a4d('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x8a4d('0xf')],'onhold':this['onhold']};var _0x335528=md5(JSON['stringify'](_0xa02ed0));if(this[_0x8a4d('0x17')]!==_0x335528){this[_0x8a4d('0x17')]=_0x335528;io['to'](util[_0x8a4d('0x21')](_0x8a4d('0x22'),_0xa02ed0[_0x8a4d('0x6')]))[_0x8a4d('0x23')](_0x8a4d('0x24'),_[_0x8a4d('0x25')](_0xa02ed0,[_0x8a4d('0x10')]));io['emit'](_0x8a4d('0x26'),_0xa02ed0);}};module['exports']=Agent; \ No newline at end of file +var _0x49ae=['voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime','state','not_inuse','idle','talking','statePause','toNumber','email','address','voiceStatusTime','interface','format','user:%s','emit','user:presence','exports','lodash','util','moment','md5','ioredis','redis','localhost','socket.io-emitter','name','accountcode','fullname','unknown','stateTime','status','phone','mobile','online','voiceStatus'];(function(_0xa90e10,_0x377ff7){var _0xe61724=function(_0x3695b4){while(--_0x3695b4){_0xa90e10['push'](_0xa90e10['shift']());}};_0xe61724(++_0x377ff7);}(_0x49ae,0x190));var _0xe49a=function(_0x50ad85,_0x2fb32d){_0x50ad85=_0x50ad85-0x0;var _0x1a7dfe=_0x49ae[_0x50ad85];return _0x1a7dfe;};'use strict';var _=require(_0xe49a('0x0'));var util=require(_0xe49a('0x1'));var moment=require(_0xe49a('0x2'));var md5=require(_0xe49a('0x3'));var Redis=require(_0xe49a('0x4'));var config=require('../../../config/environment');config[_0xe49a('0x5')]=_['defaults'](config[_0xe49a('0x5')],{'host':_0xe49a('0x6'),'port':0x18eb});var io=require(_0xe49a('0x7'))(new Redis(config[_0xe49a('0x5')]));function Agent(_0x4fe95c){this['id']=_0x4fe95c['id']||0x0;this[_0xe49a('0x8')]=_0x4fe95c[_0xe49a('0x8')]||'';this['email']=_0x4fe95c['email']||'';this[_0xe49a('0x9')]=_0x4fe95c[_0xe49a('0x9')]||'';this[_0xe49a('0xa')]=_0x4fe95c[_0xe49a('0xa')]||'';this['state']=_0xe49a('0xb');this[_0xe49a('0xc')]=0x0;this[_0xe49a('0xd')]=_0xe49a('0xb');this['address']='';this[_0xe49a('0xe')]='';this[_0xe49a('0xf')]='';this['interface']='';this[_0xe49a('0x10')]=_0x4fe95c[_0xe49a('0x10')]||![];this[_0xe49a('0x11')]=_0xe49a('0xb');this['voiceStatusTime']=0x0;this[_0xe49a('0x12')]='';this[_0xe49a('0x13')]='';this['onhold']=![];this[_0xe49a('0x14')]=![];this[_0xe49a('0x3')]='';}Agent[_0xe49a('0x15')][_0xe49a('0x16')]=function(_0x54e6e9){var _0x468ce1;if(_0x54e6e9&&_0x54e6e9[_0xe49a('0x17')]){_0x468ce1=_0x54e6e9['state']['toLowerCase']();switch(_0x468ce1){case _0xe49a('0x18'):_0x468ce1=_0xe49a('0x19');break;case'inuse':_0x468ce1=_0xe49a('0x1a');break;}}if(_0x468ce1&&this['voiceStatus']!==_0x468ce1||_0x54e6e9[_0xe49a('0x1b')]){this['voiceStatusTime']=_[_0xe49a('0x1c')](moment()['format']('x'));}if(_0x468ce1){this[_0xe49a('0x11')]=_0x468ce1;}var _0x44e8db={'id':this['id'],'name':this['name'],'email':this[_0xe49a('0x1d')],'accountcode':this['accountcode'],'fullname':this[_0xe49a('0xa')],'state':this[_0xe49a('0x17')],'stateTime':this[_0xe49a('0xc')],'status':this[_0xe49a('0xd')],'address':this[_0xe49a('0x1e')],'online':this[_0xe49a('0x10')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0xe49a('0x1f')],'voiceStatusCallerIdNumber':this[_0xe49a('0x12')],'voiceStatusQueue':this[_0xe49a('0x13')],'interface':this[_0xe49a('0x20')],'onhold':this['onhold']};var _0x4728c7=md5(JSON['stringify'](_0x44e8db));if(this[_0xe49a('0x3')]!==_0x4728c7){this[_0xe49a('0x3')]=_0x4728c7;io['to'](util[_0xe49a('0x21')](_0xe49a('0x22'),_0x44e8db['name']))[_0xe49a('0x23')]('user:ami:update',_['omit'](_0x44e8db,[_0xe49a('0x10')]));io[_0xe49a('0x23')](_0xe49a('0x24'),_0x44e8db);}};module[_0xe49a('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 db2f462..8716653 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 _0x27ee=['message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays'];(function(_0xe9ff15,_0x3f8f34){var _0x448479=function(_0x4cfce0){while(--_0x4cfce0){_0xe9ff15['push'](_0xe9ff15['shift']());}};_0x448479(++_0x3f8f34);}(_0x27ee,0x90));var _0xe27e=function(_0x4896e3,_0x5a8e1b){_0x4896e3=_0x4896e3-0x0;var _0xf06bc=_0x27ee[_0x4896e3];return _0xf06bc;};'use strict';function Campaign(_0x3e41c9){this['id']=_0x3e41c9['id']||0x0;this[_0xe27e('0x0')]=_0x3e41c9[_0xe27e('0x0')]||'';this[_0xe27e('0x1')]=_0x3e41c9[_0xe27e('0x1')]||_0xe27e('0x2');this['originated']=0x0;this[_0xe27e('0x3')]=0x0;this[_0xe27e('0x4')]=0x0;this[_0xe27e('0x5')]=0x0;this[_0xe27e('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xe27e('0x7')]=_0x3e41c9[_0xe27e('0x7')];this[_0xe27e('0x8')]=_0x3e41c9[_0xe27e('0x8')];this[_0xe27e('0x9')]=_0x3e41c9['dialTimezone']||null;this[_0xe27e('0xa')]=_0x3e41c9[_0xe27e('0xa')]?_0x3e41c9[_0xe27e('0xa')]:null;this['dialOriginateCallerIdName']=_0x3e41c9[_0xe27e('0xb')];this[_0xe27e('0xc')]=_0x3e41c9['dialOriginateCallerIdNumber'];this[_0xe27e('0xd')]=_0x3e41c9[_0xe27e('0xd')]||0x1e;this[_0xe27e('0xe')]=_0x3e41c9[_0xe27e('0xe')];this[_0xe27e('0xf')]=_0x3e41c9['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x3e41c9[_0xe27e('0x10')];this[_0xe27e('0x11')]=_0x3e41c9[_0xe27e('0x11')];this[_0xe27e('0x12')]=_0x3e41c9[_0xe27e('0x12')];this['dialNoAnswerRetryFrequency']=_0x3e41c9[_0xe27e('0x13')];this[_0xe27e('0x14')]=_0x3e41c9[_0xe27e('0x14')];this[_0xe27e('0x15')]=_0x3e41c9['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3e41c9[_0xe27e('0x16')]||0x96;this[_0xe27e('0x17')]=_0x3e41c9[_0xe27e('0x17')]||0x3;this[_0xe27e('0x18')]=_0x3e41c9[_0xe27e('0x18')]||0x96;this[_0xe27e('0x19')]=_0x3e41c9['dialAbandonedMaxRetry']||0x3;this[_0xe27e('0x1a')]=_0x3e41c9[_0xe27e('0x1a')]||0x96;this[_0xe27e('0x1b')]=_0x3e41c9['dialMachineMaxRetry']||0x3;this[_0xe27e('0x1c')]=_0x3e41c9['dialMachineRetryFrequency']||0x96;this[_0xe27e('0x1d')]=_0x3e41c9['dialAgentRejectMaxRetry']||0x3;this[_0xe27e('0x1e')]=_0x3e41c9[_0xe27e('0x1e')]||0x96;this[_0xe27e('0x1f')]=_0x3e41c9['dialOrderByScheduledAt']||'DESC';this[_0xe27e('0x20')]=_0x3e41c9[_0xe27e('0x20')]||undefined;this[_0xe27e('0x21')]=_0x3e41c9['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xe27e('0x22')]=_0x3e41c9['dialCutDigit']||undefined;this[_0xe27e('0x23')]=_0x3e41c9[_0xe27e('0x23')]?_0x3e41c9[_0xe27e('0x23')]:undefined;this['Trunk']=_0x3e41c9[_0xe27e('0x24')]?_0x3e41c9[_0xe27e('0x24')]:undefined;this[_0xe27e('0x25')]=_0x3e41c9[_0xe27e('0x25')]?_0x3e41c9[_0xe27e('0x25')]:undefined;this[_0xe27e('0x26')]=_0x3e41c9[_0xe27e('0x26')]?_0x3e41c9[_0xe27e('0x26')]:undefined;this[_0xe27e('0x27')]=_0x3e41c9['SquareProject']?_0x3e41c9['SquareProject'][_0xe27e('0x0')]:undefined;this[_0xe27e('0x28')]=_0x3e41c9['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x3e41c9['dialAMDInitialSilence'];this[_0xe27e('0x29')]=_0x3e41c9[_0xe27e('0x29')];this['dialAMDAfterGreetingSilence']=_0x3e41c9[_0xe27e('0x2a')];this[_0xe27e('0x2b')]=_0x3e41c9['dialAMDTotalAnalysisTime'];this[_0xe27e('0x2c')]=_0x3e41c9[_0xe27e('0x2c')];this[_0xe27e('0x2d')]=_0x3e41c9[_0xe27e('0x2d')];this[_0xe27e('0x2e')]=_0x3e41c9[_0xe27e('0x2e')];this[_0xe27e('0x2f')]=_0x3e41c9['dialAMDSilenceThreshold'];this[_0xe27e('0x30')]=_0x3e41c9[_0xe27e('0x30')];}module[_0xe27e('0x31')]=Campaign; \ No newline at end of file +var _0x6720=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x18fe78,_0x15aec1){var _0x5ee295=function(_0x3e6392){while(--_0x3e6392){_0x18fe78['push'](_0x18fe78['shift']());}};_0x5ee295(++_0x15aec1);}(_0x6720,0x88));var _0x0672=function(_0x50d916,_0x30c01c){_0x50d916=_0x50d916-0x0;var _0x373886=_0x6720[_0x50d916];return _0x373886;};'use strict';function Campaign(_0x1526e4){this['id']=_0x1526e4['id']||0x0;this[_0x0672('0x0')]=_0x1526e4[_0x0672('0x0')]||'';this[_0x0672('0x1')]=_0x1526e4['type']||_0x0672('0x2');this[_0x0672('0x3')]=0x0;this['temp']=0x0;this[_0x0672('0x4')]=0x0;this[_0x0672('0x5')]=0x0;this[_0x0672('0x6')]='';this[_0x0672('0x7')]=!![];this[_0x0672('0x8')]=_0x1526e4[_0x0672('0x8')];this['limitCalls']=_0x1526e4[_0x0672('0x9')];this['dialTimezone']=_0x1526e4['dialTimezone']||null;this['dialGlobalInterval']=_0x1526e4['dialGlobalInterval']?_0x1526e4[_0x0672('0xa')]:null;this[_0x0672('0xb')]=_0x1526e4[_0x0672('0xb')];this[_0x0672('0xc')]=_0x1526e4[_0x0672('0xc')];this['dialOriginateTimeout']=_0x1526e4[_0x0672('0xd')]||0x1e;this[_0x0672('0xe')]=_0x1526e4[_0x0672('0xe')];this['dialCongestionRetryFrequency']=_0x1526e4[_0x0672('0xf')];this[_0x0672('0x10')]=_0x1526e4['dialBusyMaxRetry'];this[_0x0672('0x11')]=_0x1526e4['dialBusyRetryFrequency'];this[_0x0672('0x12')]=_0x1526e4[_0x0672('0x12')];this[_0x0672('0x13')]=_0x1526e4['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1526e4[_0x0672('0x14')];this['dialNoSuchNumberMaxRetry']=_0x1526e4[_0x0672('0x15')]||0x3;this[_0x0672('0x16')]=_0x1526e4[_0x0672('0x16')]||0x96;this[_0x0672('0x17')]=_0x1526e4[_0x0672('0x17')]||0x3;this[_0x0672('0x18')]=_0x1526e4['dialDropRetryFrequency']||0x96;this[_0x0672('0x19')]=_0x1526e4[_0x0672('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x1526e4['dialAbandonedRetryFrequency']||0x96;this[_0x0672('0x1a')]=_0x1526e4[_0x0672('0x1a')]||0x3;this[_0x0672('0x1b')]=_0x1526e4['dialMachineRetryFrequency']||0x96;this[_0x0672('0x1c')]=_0x1526e4['dialAgentRejectMaxRetry']||0x3;this[_0x0672('0x1d')]=_0x1526e4[_0x0672('0x1d')]||0x96;this[_0x0672('0x1e')]=_0x1526e4[_0x0672('0x1e')]||_0x0672('0x1f');this[_0x0672('0x20')]=_0x1526e4[_0x0672('0x20')]||undefined;this[_0x0672('0x21')]=_0x1526e4[_0x0672('0x21')]||undefined;this[_0x0672('0x22')]=_0x1526e4[_0x0672('0x22')]||undefined;this[_0x0672('0x23')]=_0x1526e4[_0x0672('0x23')]?_0x1526e4[_0x0672('0x23')]:undefined;this[_0x0672('0x24')]=_0x1526e4[_0x0672('0x24')]?_0x1526e4[_0x0672('0x24')]:undefined;this[_0x0672('0x25')]=_0x1526e4[_0x0672('0x25')]?_0x1526e4[_0x0672('0x25')]:undefined;this['SquareProject']=_0x1526e4[_0x0672('0x26')]?_0x1526e4[_0x0672('0x26')]:undefined;this[_0x0672('0x27')]=_0x1526e4[_0x0672('0x26')]?_0x1526e4[_0x0672('0x26')]['name']:undefined;this[_0x0672('0x28')]=_0x1526e4[_0x0672('0x28')]||![];this[_0x0672('0x29')]=_0x1526e4[_0x0672('0x29')];this['dialAMDGreeting']=_0x1526e4[_0x0672('0x2a')];this[_0x0672('0x2b')]=_0x1526e4[_0x0672('0x2b')];this[_0x0672('0x2c')]=_0x1526e4[_0x0672('0x2c')];this[_0x0672('0x2d')]=_0x1526e4[_0x0672('0x2d')];this[_0x0672('0x2e')]=_0x1526e4[_0x0672('0x2e')];this[_0x0672('0x2f')]=_0x1526e4[_0x0672('0x2f')];this['dialAMDSilenceThreshold']=_0x1526e4[_0x0672('0x30')];this[_0x0672('0x31')]=_0x1526e4['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 0a023db..c7055f4 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 _0x5b12=['queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridname','connectedlinename','accountcode','uniqueid','answered','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','monitorFilename'];(function(_0x45c9f7,_0x586d4b){var _0x3da4d7=function(_0xc73d66){while(--_0xc73d66){_0x45c9f7['push'](_0x45c9f7['shift']());}};_0x3da4d7(++_0x586d4b);}(_0x5b12,0xa3));var _0x25b1=function(_0x236929,_0x5bb511){_0x236929=_0x236929-0x0;var _0xca8a93=_0x5b12[_0x236929];return _0xca8a93;};'use strict';function Channel(){this[_0x25b1('0x0')]=null;this[_0x25b1('0x1')]='';this[_0x25b1('0x2')]='';this['calleridnum']=0x0;this[_0x25b1('0x3')]='';this['connectedlinenum']=undefined;this[_0x25b1('0x4')]=undefined;this[_0x25b1('0x5')]=0x0;this['context']='';this[_0x25b1('0x6')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x25b1('0x7')]=![];this['answertime']=null;this['endtime']=null;this[_0x25b1('0x8')]=![];this[_0x25b1('0x9')]=![];this[_0x25b1('0xa')]='';this[_0x25b1('0xb')]='';this[_0x25b1('0xc')]=0x0;this[_0x25b1('0xd')]=0x0;this[_0x25b1('0xe')]=0x0;this[_0x25b1('0xf')]=null;this['tag']=null;this[_0x25b1('0x10')]=null;this[_0x25b1('0x11')]=![];this[_0x25b1('0x12')]=null;this[_0x25b1('0x13')]=null;this[_0x25b1('0x14')]=[];this[_0x25b1('0x15')]=undefined;this[_0x25b1('0x16')]=undefined;this[_0x25b1('0x17')]=undefined;this[_0x25b1('0x18')]=0x0;}module[_0x25b1('0x19')]=Channel; \ No newline at end of file +var _0xb79a=['queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0xb79a,0x18e));var _0xab79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb79a[_0x2641f9];return _0x585741;};'use strict';function Channel(){this[_0xab79('0x0')]=null;this[_0xab79('0x1')]='';this['destinationchannel']='';this[_0xab79('0x2')]=0x0;this[_0xab79('0x3')]='';this[_0xab79('0x4')]=undefined;this[_0xab79('0x5')]=undefined;this[_0xab79('0x6')]=0x0;this[_0xab79('0x7')]='';this[_0xab79('0x8')]=0x0;this[_0xab79('0x9')]=0x0;this['exten']=0x0;this[_0xab79('0xa')]=![];this['answertime']=null;this[_0xab79('0xb')]=null;this[_0xab79('0xc')]=![];this[_0xab79('0xd')]=![];this[_0xab79('0xe')]='';this[_0xab79('0xf')]='';this[_0xab79('0x10')]=0x0;this[_0xab79('0x11')]=0x0;this[_0xab79('0x12')]=0x0;this[_0xab79('0x13')]=null;this[_0xab79('0x14')]=null;this[_0xab79('0x15')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0xab79('0x16')]=null;this[_0xab79('0x17')]=[];this[_0xab79('0x18')]=undefined;this[_0xab79('0x19')]=undefined;this[_0xab79('0x1a')]=undefined;this[_0xab79('0x1b')]=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 8b14104..2b38371 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 _0xb817=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x54cc79,_0x12707c){var _0x55c76f=function(_0x456c30){while(--_0x456c30){_0x54cc79['push'](_0x54cc79['shift']());}};_0x55c76f(++_0x12707c);}(_0xb817,0xab));var _0x7b81=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb817[_0x167cc1];return _0x10bc4b;};'use strict';function DeskAccount(_0x54295b){this['id']=_0x54295b['id']||0x0;this['name']=_0x54295b[_0x7b81('0x0')]||'';this[_0x7b81('0x1')]=_0x54295b['username']||'';this[_0x7b81('0x2')]=_0x54295b[_0x7b81('0x2')]||'';this[_0x7b81('0x3')]=_0x54295b[_0x7b81('0x3')]||'';this[_0x7b81('0x4')]=_0x54295b['password']||'';this[_0x7b81('0x5')]=_0x54295b[_0x7b81('0x5')]||'';this['consumerSecret']=_0x54295b[_0x7b81('0x6')]||'';this[_0x7b81('0x7')]=_0x54295b[_0x7b81('0x7')]||'';this[_0x7b81('0x8')]=_0x54295b[_0x7b81('0x8')]||'';this[_0x7b81('0x9')]=_0x54295b[_0x7b81('0x9')]||'';this[_0x7b81('0xa')]=_0x54295b[_0x7b81('0xa')]||'';this[_0x7b81('0xb')]=_0x54295b[_0x7b81('0xb')]||{};}module[_0x7b81('0xc')]=DeskAccount; \ No newline at end of file +var _0x3769=['tokenSecret','type','serverUrl','Configurations','username','remoteUri','password','consumerKey','consumerSecret','token'];(function(_0x3b4f5e,_0x4faf5d){var _0x3dc833=function(_0x50db75){while(--_0x50db75){_0x3b4f5e['push'](_0x3b4f5e['shift']());}};_0x3dc833(++_0x4faf5d);}(_0x3769,0x1c6));var _0x9376=function(_0xf76df6,_0x108518){_0xf76df6=_0xf76df6-0x0;var _0x14cc6a=_0x3769[_0xf76df6];return _0x14cc6a;};'use strict';function DeskAccount(_0x39112f){this['id']=_0x39112f['id']||0x0;this['name']=_0x39112f['name']||'';this['username']=_0x39112f[_0x9376('0x0')]||'';this[_0x9376('0x1')]=_0x39112f[_0x9376('0x1')]||'';this['authType']=_0x39112f['authType']||'';this[_0x9376('0x2')]=_0x39112f[_0x9376('0x2')]||'';this['consumerKey']=_0x39112f[_0x9376('0x3')]||'';this['consumerSecret']=_0x39112f[_0x9376('0x4')]||'';this['token']=_0x39112f[_0x9376('0x5')]||'';this[_0x9376('0x6')]=_0x39112f[_0x9376('0x6')]||'';this[_0x9376('0x7')]=_0x39112f['type']||'';this[_0x9376('0x8')]=_0x39112f[_0x9376('0x8')]||'';this[_0x9376('0x9')]=_0x39112f[_0x9376('0x9')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 373fde3..0b8a8d0 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 _0x3b47=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username'];(function(_0x4812ba,_0x5a186a){var _0x39fd8f=function(_0x277791){while(--_0x277791){_0x4812ba['push'](_0x4812ba['shift']());}};_0x39fd8f(++_0x5a186a);}(_0x3b47,0x1c6));var _0x73b4=function(_0x409ef4,_0x435589){_0x409ef4=_0x409ef4-0x0;var _0x50036b=_0x3b47[_0x409ef4];return _0x50036b;};'use strict';function Dynamics365Account(_0x1169d9){this['id']=_0x1169d9['id']||0x0;this[_0x73b4('0x0')]=_0x1169d9[_0x73b4('0x0')]||'';this[_0x73b4('0x1')]=_0x1169d9[_0x73b4('0x1')]||'';this[_0x73b4('0x2')]=_0x1169d9[_0x73b4('0x2')]||'';this[_0x73b4('0x3')]=_0x1169d9[_0x73b4('0x3')]||'';this[_0x73b4('0x4')]=_0x1169d9[_0x73b4('0x4')]||'';this[_0x73b4('0x5')]=_0x1169d9[_0x73b4('0x5')]||'';this[_0x73b4('0x6')]=_0x1169d9[_0x73b4('0x6')]||{};this[_0x73b4('0x7')]=_0x1169d9[_0x73b4('0x7')]||'';this[_0x73b4('0x8')]=_0x1169d9[_0x73b4('0x8')]||![];this[_0x73b4('0x9')]=_0x1169d9['Configurations']||{};this[_0x73b4('0xa')]=_0x1169d9['CloudProvider']||{};}module[_0x73b4('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x43ce=['tenantId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x43ce,0x74));var _0xe43c=function(_0x8eb77d,_0x33d0e1){_0x8eb77d=_0x8eb77d-0x0;var _0xfd72a=_0x43ce[_0x8eb77d];return _0xfd72a;};'use strict';function Dynamics365Account(_0x62aae3){this['id']=_0x62aae3['id']||0x0;this[_0xe43c('0x0')]=_0x62aae3[_0xe43c('0x0')]||'';this[_0xe43c('0x1')]=_0x62aae3[_0xe43c('0x1')]||'';this[_0xe43c('0x2')]=_0x62aae3[_0xe43c('0x2')]||'';this['remoteUri']=_0x62aae3[_0xe43c('0x3')]||'';this['tenantId']=_0x62aae3[_0xe43c('0x4')]||'';this['clientId']=_0x62aae3['clientId']||'';this[_0xe43c('0x5')]=_0x62aae3[_0xe43c('0x5')]||{};this[_0xe43c('0x6')]=_0x62aae3[_0xe43c('0x6')]||'';this[_0xe43c('0x7')]=_0x62aae3[_0xe43c('0x7')]||![];this['Configurations']=_0x62aae3[_0xe43c('0x8')]||{};this[_0xe43c('0x9')]=_0x62aae3['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 8f14772..ef9b615 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 _0xd367=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','SIP','Trunk','ListId','exports','name','description','ecm','headerinfo'];(function(_0x467140,_0x6e75d1){var _0x484984=function(_0x1f2bbd){while(--_0x1f2bbd){_0x467140['push'](_0x467140['shift']());}};_0x484984(++_0x6e75d1);}(_0xd367,0x1dc));var _0x7d36=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd367[_0x19e35c];return _0x3e1fe8;};'use strict';function FaxAccount(_0x8b657a){this['id']=_0x8b657a['id']||0x0;this[_0x7d36('0x0')]=_0x8b657a[_0x7d36('0x0')]||'';this[_0x7d36('0x1')]=_0x8b657a['description'];this['ecm']=_0x8b657a[_0x7d36('0x2')];this[_0x7d36('0x3')]=_0x8b657a[_0x7d36('0x3')];this[_0x7d36('0x4')]=_0x8b657a[_0x7d36('0x4')];this[_0x7d36('0x5')]=_0x8b657a[_0x7d36('0x5')]||0x960;this[_0x7d36('0x6')]=_0x8b657a[_0x7d36('0x6')]||0x3840;this[_0x7d36('0x7')]=_0x8b657a['modem']||_0x7d36('0x8');this[_0x7d36('0x9')]=_0x8b657a[_0x7d36('0x9')]||'no';this['faxdetect']=_0x8b657a['faxdetect']||'no';this[_0x7d36('0xa')]=_0x8b657a['t38timeout']||0x1388;this[_0x7d36('0xb')]=_0x8b657a['tech']||_0x7d36('0xc');this[_0x7d36('0xd')]=_0x8b657a[_0x7d36('0xd')]?_0x8b657a[_0x7d36('0xd')]:undefined;this[_0x7d36('0xe')]=_0x8b657a[_0x7d36('0xe')];this['key']=_0x8b657a['key'];}module[_0x7d36('0xf')]=FaxAccount; \ No newline at end of file +var _0x93f3=['Trunk','ListId','key','exports','name','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x93f3,0xe4));var _0x393f=function(_0x51111d,_0xee6a9a){_0x51111d=_0x51111d-0x0;var _0x3f387c=_0x93f3[_0x51111d];return _0x3f387c;};'use strict';function FaxAccount(_0x3bc9d4){this['id']=_0x3bc9d4['id']||0x0;this[_0x393f('0x0')]=_0x3bc9d4[_0x393f('0x0')]||'';this['description']=_0x3bc9d4['description'];this['ecm']=_0x3bc9d4['ecm'];this[_0x393f('0x1')]=_0x3bc9d4[_0x393f('0x1')];this[_0x393f('0x2')]=_0x3bc9d4['localstationid'];this[_0x393f('0x3')]=_0x3bc9d4[_0x393f('0x3')]||0x960;this[_0x393f('0x4')]=_0x3bc9d4[_0x393f('0x4')]||0x3840;this[_0x393f('0x5')]=_0x3bc9d4['modem']||_0x393f('0x6');this[_0x393f('0x7')]=_0x3bc9d4[_0x393f('0x7')]||'no';this[_0x393f('0x8')]=_0x3bc9d4[_0x393f('0x8')]||'no';this[_0x393f('0x9')]=_0x3bc9d4[_0x393f('0x9')]||0x1388;this[_0x393f('0xa')]=_0x3bc9d4[_0x393f('0xa')]||_0x393f('0xb');this[_0x393f('0xc')]=_0x3bc9d4[_0x393f('0xc')]?_0x3bc9d4[_0x393f('0xc')]:undefined;this[_0x393f('0xd')]=_0x3bc9d4[_0x393f('0xd')];this[_0x393f('0xe')]=_0x3bc9d4[_0x393f('0xe')];}module[_0x393f('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 68a442c..6af5ca8 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 _0x5d4d=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xe59625,_0x14ba71){var _0x480f98=function(_0x47e425){while(--_0x47e425){_0xe59625['push'](_0xe59625['shift']());}};_0x480f98(++_0x14ba71);}(_0x5d4d,0x1b0));var _0xd5d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d4d[_0x3dd15e];return _0x231fd0;};'use strict';function FreshdeskAccount(_0x1e9923){this['id']=_0x1e9923['id']||0x0;this['name']=_0x1e9923[_0xd5d4('0x0')]||'';this[_0xd5d4('0x1')]=_0x1e9923[_0xd5d4('0x1')]||'';this['apiKey']=_0x1e9923[_0xd5d4('0x2')]||'';this[_0xd5d4('0x3')]=_0x1e9923[_0xd5d4('0x3')]||'';this['serverUrl']=_0x1e9923[_0xd5d4('0x4')]||'';this[_0xd5d4('0x5')]=_0x1e9923[_0xd5d4('0x5')]||{};}module[_0xd5d4('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xb3dc=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x16020f,_0x3c9e29){var _0x59a773=function(_0x25e614){while(--_0x25e614){_0x16020f['push'](_0x16020f['shift']());}};_0x59a773(++_0x3c9e29);}(_0xb3dc,0x108));var _0xcb3d=function(_0x5cf36e,_0x321bb7){_0x5cf36e=_0x5cf36e-0x0;var _0xa65a10=_0xb3dc[_0x5cf36e];return _0xa65a10;};'use strict';function FreshdeskAccount(_0x1e5512){this['id']=_0x1e5512['id']||0x0;this[_0xcb3d('0x0')]=_0x1e5512['name']||'';this[_0xcb3d('0x1')]=_0x1e5512[_0xcb3d('0x1')]||'';this[_0xcb3d('0x2')]=_0x1e5512[_0xcb3d('0x3')]||'';this[_0xcb3d('0x4')]=_0x1e5512['remoteUri']||'';this[_0xcb3d('0x5')]=_0x1e5512[_0xcb3d('0x5')]||'';this['Configurations']=_0x1e5512[_0xcb3d('0x6')]||{};}module[_0xcb3d('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index ebb4e64..f56b67b 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 _0x102b=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x102b,0x1be));var _0xb102=function(_0x18d1bd,_0x5b3dbd){_0x18d1bd=_0x18d1bd-0x0;var _0x1fba0f=_0x102b[_0x18d1bd];return _0x1fba0f;};'use strict';function FreshsalesAccount(_0x18269b){this['id']=_0x18269b['id']||0x0;this[_0xb102('0x0')]=_0x18269b['name']||'';this[_0xb102('0x1')]=_0x18269b[_0xb102('0x1')]||'';this[_0xb102('0x2')]=_0x18269b[_0xb102('0x3')]||'';this[_0xb102('0x4')]=_0x18269b[_0xb102('0x4')]||'';this[_0xb102('0x5')]=_0x18269b[_0xb102('0x5')]||'';this['Configurations']=_0x18269b[_0xb102('0x6')]||{};}module[_0xb102('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x1dcc=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x3f271b,_0x647c39){var _0x45519e=function(_0x52354a){while(--_0x52354a){_0x3f271b['push'](_0x3f271b['shift']());}};_0x45519e(++_0x647c39);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x4eb4e8,_0x3b9d69){_0x4eb4e8=_0x4eb4e8-0x0;var _0x5b7165=_0x1dcc[_0x4eb4e8];return _0x5b7165;};'use strict';function FreshsalesAccount(_0x586379){this['id']=_0x586379['id']||0x0;this[_0xc1dc('0x0')]=_0x586379[_0xc1dc('0x0')]||'';this[_0xc1dc('0x1')]=_0x586379['username']||'';this[_0xc1dc('0x2')]=_0x586379['token']||'';this[_0xc1dc('0x3')]=_0x586379[_0xc1dc('0x3')]||'';this[_0xc1dc('0x4')]=_0x586379['serverUrl']||'';this['Configurations']=_0x586379[_0xc1dc('0x5')]||{};}module[_0xc1dc('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 8c76a63..550a614 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 _0xad9d=['queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','type','inbound'];(function(_0x11bb1a,_0x379f75){var _0x1bcece=function(_0x46c666){while(--_0x46c666){_0x11bb1a['push'](_0x11bb1a['shift']());}};_0x1bcece(++_0x379f75);}(_0xad9d,0x136));var _0xdad9=function(_0x2b5a00,_0xc8506a){_0x2b5a00=_0x2b5a00-0x0;var _0x495b0e=_0xad9d[_0x2b5a00];return _0x495b0e;};'use strict';function QueueReport(){this[_0xdad9('0x0')]=_0xdad9('0x1');this['uniqueid']='';this['calleridnum']='';this['calleridname']='';this[_0xdad9('0x2')]='';this[_0xdad9('0x3')]=null;this['queuecallerleaveAt']=null;this[_0xdad9('0x4')]=0x1;this[_0xdad9('0x5')]=0x1;this[_0xdad9('0x6')]=![];this[_0xdad9('0x7')]=null;this[_0xdad9('0x8')]=![];this[_0xdad9('0x9')]=null;this[_0xdad9('0xa')]=![];this[_0xdad9('0xb')]=null;this['originalposition']=0x1;this[_0xdad9('0xc')]='';this[_0xdad9('0xd')]='';this[_0xdad9('0xe')]='';this['accountcode']='';this['context']='';this['exten']='';this[_0xdad9('0xf')]='';this[_0xdad9('0x10')]=0x0;this[_0xdad9('0x11')]=![];this[_0xdad9('0x12')]='';this[_0xdad9('0x13')]=_0xdad9('0x14');this[_0xdad9('0x15')]=null;this[_0xdad9('0x16')]=0x0;this[_0xdad9('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xef6d=['assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','originalposition','channel','connectedlinenum','accountcode','context','exten','priority'];(function(_0x2303bc,_0x455185){var _0x350c89=function(_0x843d2c){while(--_0x843d2c){_0x2303bc['push'](_0x2303bc['shift']());}};_0x350c89(++_0x455185);}(_0xef6d,0x1b8));var _0xdef6=function(_0x49f25f,_0x3860d3){_0x49f25f=_0x49f25f-0x0;var _0x231c17=_0xef6d[_0x49f25f];return _0x231c17;};'use strict';function QueueReport(){this[_0xdef6('0x0')]=_0xdef6('0x1');this['uniqueid']='';this[_0xdef6('0x2')]='';this[_0xdef6('0x3')]='';this[_0xdef6('0x4')]='';this[_0xdef6('0x5')]=null;this[_0xdef6('0x6')]=null;this['position']=0x1;this[_0xdef6('0x7')]=0x1;this[_0xdef6('0x8')]=![];this[_0xdef6('0x9')]=null;this[_0xdef6('0xa')]=![];this[_0xdef6('0xb')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0xdef6('0xc')]=0x1;this[_0xdef6('0xd')]='';this[_0xdef6('0xe')]='';this['connectedlinename']='';this[_0xdef6('0xf')]='';this[_0xdef6('0x10')]='';this[_0xdef6('0x11')]='';this[_0xdef6('0x12')]='';this['holdtime']=0x0;this[_0xdef6('0x13')]=![];this[_0xdef6('0x14')]='';this[_0xdef6('0x15')]=_0xdef6('0x16');this[_0xdef6('0x17')]=null;this[_0xdef6('0x18')]=0x0;this[_0xdef6('0x19')]={};}module[_0xdef6('0x1a')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index d42ef0a..2ff7c00 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 _0x4996=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','serverUrl','Configurations'];(function(_0x5a0bf0,_0x13c287){var _0x116153=function(_0x69055b){while(--_0x69055b){_0x5a0bf0['push'](_0x5a0bf0['shift']());}};_0x116153(++_0x13c287);}(_0x4996,0x173));var _0x6499=function(_0x32be62,_0x22e6fd){_0x32be62=_0x32be62-0x0;var _0x1a37e9=_0x4996[_0x32be62];return _0x1a37e9;};'use strict';function SalesforceAccount(_0x460868){this['id']=_0x460868['id']||0x0;this[_0x6499('0x0')]=_0x460868[_0x6499('0x0')]||'';this[_0x6499('0x1')]=_0x460868[_0x6499('0x1')]||'';this[_0x6499('0x2')]=_0x460868[_0x6499('0x2')]||'';this[_0x6499('0x3')]=_0x460868[_0x6499('0x3')]||'';this['clientId']=_0x460868[_0x6499('0x4')]||'';this[_0x6499('0x5')]=_0x460868[_0x6499('0x5')]||'';this[_0x6499('0x6')]=_0x460868['securityToken']||'';this['type']=_0x460868['type']||'integrationTab';this[_0x6499('0x7')]=_0x460868[_0x6499('0x7')]||'';this[_0x6499('0x8')]=_0x460868['Configurations']||{};}module[_0x6499('0x9')]=SalesforceAccount; \ No newline at end of file +var _0xaa22=['password','clientSecret','securityToken','type','exports','name','username','remoteUri'];(function(_0x1d06ac,_0x34672b){var _0x38bc2a=function(_0x2c9d8){while(--_0x2c9d8){_0x1d06ac['push'](_0x1d06ac['shift']());}};_0x38bc2a(++_0x34672b);}(_0xaa22,0x1dd));var _0x2aa2=function(_0x3c057f,_0x61830){_0x3c057f=_0x3c057f-0x0;var _0x4d8188=_0xaa22[_0x3c057f];return _0x4d8188;};'use strict';function SalesforceAccount(_0x2bf9ee){this['id']=_0x2bf9ee['id']||0x0;this['name']=_0x2bf9ee[_0x2aa2('0x0')]||'';this['username']=_0x2bf9ee[_0x2aa2('0x1')]||'';this[_0x2aa2('0x2')]=_0x2bf9ee[_0x2aa2('0x2')]||'';this[_0x2aa2('0x3')]=_0x2bf9ee[_0x2aa2('0x3')]||'';this['clientId']=_0x2bf9ee['clientId']||'';this[_0x2aa2('0x4')]=_0x2bf9ee[_0x2aa2('0x4')]||'';this[_0x2aa2('0x5')]=_0x2bf9ee['securityToken']||'';this[_0x2aa2('0x6')]=_0x2bf9ee[_0x2aa2('0x6')]||'integrationTab';this['serverUrl']=_0x2bf9ee['serverUrl']||'';this['Configurations']=_0x2bf9ee['Configurations']||{};}module[_0x2aa2('0x7')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 3390037..25e1304 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 _0x98b6=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x98b6,0x9e));var _0x698b=function(_0x4cf5d9,_0x47e2fd){_0x4cf5d9=_0x4cf5d9-0x0;var _0xb2749a=_0x98b6[_0x4cf5d9];return _0xb2749a;};'use strict';function ServicenowAccount(_0x4e054a){this['id']=_0x4e054a['id']||0x0;this[_0x698b('0x0')]=_0x4e054a['name']||'';this[_0x698b('0x1')]=_0x4e054a[_0x698b('0x1')]||'';this[_0x698b('0x2')]=_0x4e054a[_0x698b('0x2')]||'';this[_0x698b('0x3')]=_0x4e054a[_0x698b('0x3')]||'';this[_0x698b('0x4')]=_0x4e054a[_0x698b('0x4')]||'';this[_0x698b('0x5')]=_0x4e054a['Configurations']||{};}module[_0x698b('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x8621=['Configurations','exports','name','username','password','remoteUri'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0x8621,0x176));var _0x1862=function(_0x306b6e,_0xd752ad){_0x306b6e=_0x306b6e-0x0;var _0x55d4ec=_0x8621[_0x306b6e];return _0x55d4ec;};'use strict';function ServicenowAccount(_0x530101){this['id']=_0x530101['id']||0x0;this[_0x1862('0x0')]=_0x530101[_0x1862('0x0')]||'';this[_0x1862('0x1')]=_0x530101['username']||'';this['password']=_0x530101[_0x1862('0x2')]||'';this[_0x1862('0x3')]=_0x530101[_0x1862('0x3')]||'';this['serverUrl']=_0x530101['serverUrl']||'';this['Configurations']=_0x530101[_0x1862('0x4')]||{};}module[_0x1862('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 070c7d7..e19fbcf 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 _0xf3be=['exports','name','username','password','serverUrl','Configurations'];(function(_0x182ffd,_0x123c11){var _0x399139=function(_0x452999){while(--_0x452999){_0x182ffd['push'](_0x182ffd['shift']());}};_0x399139(++_0x123c11);}(_0xf3be,0x1e1));var _0xef3b=function(_0x3a0b1a,_0x1de176){_0x3a0b1a=_0x3a0b1a-0x0;var _0x118d7f=_0xf3be[_0x3a0b1a];return _0x118d7f;};'use strict';function SugarcrmAccount(_0x4da225){this['id']=_0x4da225['id']||0x0;this[_0xef3b('0x0')]=_0x4da225[_0xef3b('0x0')]||'';this[_0xef3b('0x1')]=_0x4da225['username']||'';this[_0xef3b('0x2')]=_0x4da225['password']||'';this['remoteUri']=_0x4da225['remoteUri']||'';this['serverUrl']=_0x4da225[_0xef3b('0x3')]||'';this[_0xef3b('0x4')]=_0x4da225['Configurations']||{};}module[_0xef3b('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x48c0=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x48c0,0x126));var _0x048c=function(_0x202c5a,_0x4e5240){_0x202c5a=_0x202c5a-0x0;var _0x8486e3=_0x48c0[_0x202c5a];return _0x8486e3;};'use strict';function SugarcrmAccount(_0x25533a){this['id']=_0x25533a['id']||0x0;this[_0x048c('0x0')]=_0x25533a['name']||'';this[_0x048c('0x1')]=_0x25533a[_0x048c('0x1')]||'';this[_0x048c('0x2')]=_0x25533a['password']||'';this[_0x048c('0x3')]=_0x25533a[_0x048c('0x3')]||'';this['serverUrl']=_0x25533a[_0x048c('0x4')]||'';this[_0x048c('0x5')]=_0x25533a[_0x048c('0x5')]||{};}module[_0x048c('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 f758ad4..7525ee4 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 _0x7f31=['address','exports','name','accountcode','state','unknown','status'];(function(_0x373279,_0x498af0){var _0x13e6a0=function(_0x25ae7d){while(--_0x25ae7d){_0x373279['push'](_0x373279['shift']());}};_0x13e6a0(++_0x498af0);}(_0x7f31,0x13d));var _0x17f3=function(_0x189d3c,_0x5efebf){_0x189d3c=_0x189d3c-0x0;var _0x485959=_0x7f31[_0x189d3c];return _0x485959;};'use strict';function Telephone(_0x210a77){this['id']=_0x210a77['id']||0x0;this[_0x17f3('0x0')]=_0x210a77[_0x17f3('0x0')]||'';this[_0x17f3('0x1')]=_0x210a77[_0x17f3('0x1')]||'';this[_0x17f3('0x2')]=_0x17f3('0x3');this['stateTime']=0x0;this[_0x17f3('0x4')]=_0x17f3('0x3');this[_0x17f3('0x5')]='';}module[_0x17f3('0x6')]=Telephone; \ No newline at end of file +var _0x8369=['exports','name','accountcode','state','unknown','status','address'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8369,0x10b));var _0x9836=function(_0x337ff4,_0x25fb45){_0x337ff4=_0x337ff4-0x0;var _0x584fd9=_0x8369[_0x337ff4];return _0x584fd9;};'use strict';function Telephone(_0x11870e){this['id']=_0x11870e['id']||0x0;this[_0x9836('0x0')]=_0x11870e[_0x9836('0x0')]||'';this[_0x9836('0x1')]=_0x11870e[_0x9836('0x1')]||'';this[_0x9836('0x2')]=_0x9836('0x3');this['stateTime']=0x0;this[_0x9836('0x4')]='unknown';this[_0x9836('0x5')]='';}module[_0x9836('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 507b567..ae73b32 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(_0x4d693e,_0x346748){var _0x2b9295=function(_0x477c4b){while(--_0x477c4b){_0x4d693e['push'](_0x4d693e['shift']());}};_0x2b9295(++_0x346748);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d7cca,_0x104977){_0x2d7cca=_0x2d7cca-0x0;var _0x347b84=_0xb10b[_0x2d7cca];return _0x347b84;};'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 _0xb10b=['name','html'];(function(_0x5ee3e3,_0x4529eb){var _0x3f806a=function(_0x4694cc){while(--_0x4694cc){_0x5ee3e3['push'](_0x5ee3e3['shift']());}};_0x3f806a(++_0x4529eb);}(_0xb10b,0x12a));var _0xbb10=function(_0x3937e7,_0x91712b){_0x3937e7=_0x3937e7-0x0;var _0x197ad7=_0xb10b[_0x3937e7];return _0x197ad7;};'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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 9049a62..f54d5dc 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 _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x3ed054,_0x4d4f16){var _0x16dd95=function(_0xc0c19c){while(--_0xc0c19c){_0x3ed054['push'](_0x3ed054['shift']());}};_0x16dd95(++_0x4d4f16);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e1208a3..e14bbc5 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 _0x93b6=['stateTime','status','unknown','registry','indexOf','split','host','port','domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x93b6,0x165));var _0x693b=function(_0x44b73a,_0x4a00b9){_0x44b73a=_0x44b73a-0x0;var _0x4bb2ef=_0x93b6[_0x44b73a];return _0x4bb2ef;};'use strict';function Trunk(_0x398fb4){this['id']=_0x398fb4['id']||0x0;this[_0x693b('0x0')]=_0x398fb4[_0x693b('0x0')]||![];this[_0x693b('0x1')]=_0x398fb4['name']||'';this[_0x693b('0x2')]='unknown';this[_0x693b('0x3')]=0x0;this[_0x693b('0x4')]=_0x693b('0x5');this[_0x693b('0x6')]=_0x398fb4[_0x693b('0x6')]&&_0x398fb4[_0x693b('0x6')][_0x693b('0x7')](':')?_0x398fb4[_0x693b('0x6')][_0x693b('0x8')](':')[0x0]:'';this[_0x693b('0x9')]='';this[_0x693b('0xa')]='';this[_0x693b('0xb')]='';this[_0x693b('0xc')]='';this['refresh']='';this[_0x693b('0xd')]=_0x693b('0x5');this[_0x693b('0xe')]='';this[_0x693b('0xf')]='';this['defaultuser']=_0x398fb4[_0x693b('0x10')]||'';}module[_0x693b('0x11')]=Trunk; \ No newline at end of file +var _0x8075=['status','unknown','registry','indexOf','split','host','port','domain','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state','stateTime'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x8075,0x73));var _0x5807=function(_0x3cb8a3,_0x3591d1){_0x3cb8a3=_0x3cb8a3-0x0;var _0x49ebfa=_0x8075[_0x3cb8a3];return _0x49ebfa;};'use strict';function Trunk(_0x27ee4f){this['id']=_0x27ee4f['id']||0x0;this[_0x5807('0x0')]=_0x27ee4f[_0x5807('0x0')]||![];this['name']=_0x27ee4f[_0x5807('0x1')]||'';this[_0x5807('0x2')]='unknown';this[_0x5807('0x3')]=0x0;this[_0x5807('0x4')]=_0x5807('0x5');this[_0x5807('0x6')]=_0x27ee4f[_0x5807('0x6')]&&_0x27ee4f['registry'][_0x5807('0x7')](':')?_0x27ee4f['registry'][_0x5807('0x8')](':')[0x0]:'';this[_0x5807('0x9')]='';this[_0x5807('0xa')]='';this[_0x5807('0xb')]='';this['domainport']='';this[_0x5807('0xc')]='';this[_0x5807('0xd')]='unknown';this[_0x5807('0xe')]='';this['address']='';this[_0x5807('0xf')]=_0x27ee4f[_0x5807('0xf')]||'';}module[_0x5807('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 0f695e2..fc50846 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 _0xbe16=['exten','none','mandatoryDisposition','exports'];(function(_0x1a2635,_0x2a33a8){var _0x2ccd92=function(_0x3874cc){while(--_0x3874cc){_0x1a2635['push'](_0x1a2635['shift']());}};_0x2ccd92(++_0x2a33a8);}(_0xbe16,0x74));var _0x6be1=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xbe16[_0x20a558];return _0x53d3f7;};'use strict';function voiceExtension(_0x2e81cc){this['id']=_0x2e81cc['id']||0x0;this[_0x6be1('0x0')]=_0x2e81cc['exten']||'';this['recordingFormat']=_0x2e81cc['recordingFormat']||_0x6be1('0x1');this['mandatoryDisposition']=_0x2e81cc[_0x6be1('0x2')]||![];}module[_0x6be1('0x3')]=voiceExtension; \ No newline at end of file +var _0x120a=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x285d1d,_0x1a2aa0){var _0xb88ec2=function(_0x4a2274){while(--_0x4a2274){_0x285d1d['push'](_0x285d1d['shift']());}};_0xb88ec2(++_0x1a2aa0);}(_0x120a,0x19e));var _0xa120=function(_0x560286,_0x17d496){_0x560286=_0x560286-0x0;var _0x1418aa=_0x120a[_0x560286];return _0x1418aa;};'use strict';function voiceExtension(_0x34c961){this['id']=_0x34c961['id']||0x0;this[_0xa120('0x0')]=_0x34c961[_0xa120('0x0')]||'';this[_0xa120('0x1')]=_0x34c961[_0xa120('0x1')]||_0xa120('0x2');this[_0xa120('0x3')]=_0x34c961[_0xa120('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 66ac581..2a5ec61 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 _0xef9e=['unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','paused','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','gsm','fewestcalls','leastrecent','linear','random','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumBillable'];(function(_0x2f7aa6,_0x2072e5){var _0x18d006=function(_0x21f07b){while(--_0x21f07b){_0x2f7aa6['push'](_0x2f7aa6['shift']());}};_0x18d006(++_0x2072e5);}(_0xef9e,0x1ef));var _0xeef9=function(_0x4cd739,_0x1a8a12){_0x4cd739=_0x4cd739-0x0;var _0x1b163f=_0xef9e[_0x4cd739];return _0x1b163f;};'use strict';var monitorFormat={'wav':_0xeef9('0x0'),'wav49':'wav49','gsm':_0xeef9('0x1')};var strategy={'fewestcalls':_0xeef9('0x2'),'leastrecent':_0xeef9('0x3'),'linear':_0xeef9('0x4'),'random':_0xeef9('0x5'),'ringall':'ringall','rr':'roundrobin','rrmemory':_0xeef9('0x6'),'rrordered':_0xeef9('0x7'),'wrandom':'wrandom'};function VoiceQueue(_0x4bc3ca){this['id']=_0x4bc3ca['id']||0x0;this[_0xeef9('0x8')]=_0x4bc3ca[_0xeef9('0x8')]||'';this[_0xeef9('0x9')]=_0x4bc3ca['monitor_format']||'';this[_0xeef9('0xa')]=_0x4bc3ca['type']||_0xeef9('0xb');this[_0xeef9('0xc')]=0x0;this[_0xeef9('0xd')]=0x0;this[_0xeef9('0xe')]=0x0;this[_0xeef9('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0xeef9('0x10')]=0x0;this[_0xeef9('0x11')]=0x0;this[_0xeef9('0x12')]=0x0;this[_0xeef9('0x13')]=0x0;this[_0xeef9('0x14')]=0x0;this[_0xeef9('0x15')]=0x0;this[_0xeef9('0x16')]=0x0;this[_0xeef9('0x17')]=0x0;this[_0xeef9('0x18')]=0x0;this['onHold']=0x0;this[_0xeef9('0x19')]=0x0;this[_0xeef9('0x1a')]=0x0;this[_0xeef9('0x1b')]=0x0;this[_0xeef9('0x1c')]=0x0;this['unavailable']=0x0;this[_0xeef9('0x1d')]=0x0;this[_0xeef9('0x1e')]=_0x4bc3ca[_0xeef9('0x1e')]||![];this[_0xeef9('0x1f')]=_0x4bc3ca[_0xeef9('0x1f')]||0xa;this[_0xeef9('0x20')]=_0x4bc3ca['autopause']||'no';this[_0xeef9('0x21')]=!![];this[_0xeef9('0x22')]='';this[_0xeef9('0x23')]='';this[_0xeef9('0x24')]=0x0;this['temp']=0x0;this[_0xeef9('0x25')]=_0x4bc3ca[_0xeef9('0x25')]||null;this['dialGlobalInterval']=_0x4bc3ca['dialGlobalInterval']?_0x4bc3ca[_0xeef9('0x26')]:null;this[_0xeef9('0x27')]=_0x4bc3ca[_0xeef9('0x27')];this['dialMethod']=_0x4bc3ca[_0xeef9('0x28')]||'progressive';this[_0xeef9('0x29')]=_0x4bc3ca[_0xeef9('0x29')]||0x0;this[_0xeef9('0x2a')]=_0x4bc3ca['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4bc3ca['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x4bc3ca['dialPredictiveOptimization']||_0xeef9('0x2b');this[_0xeef9('0x2c')]=_0x4bc3ca[_0xeef9('0x2c')]||0.03;this[_0xeef9('0x2d')]=_0x4bc3ca['dialPredictiveInterval']||0x258;this[_0xeef9('0x2e')]=_0x4bc3ca[_0xeef9('0x2e')]||_0xeef9('0x2f');this[_0xeef9('0x30')]=_0x4bc3ca[_0xeef9('0x30')]||_0xeef9('0x2f');this[_0xeef9('0x31')]=_0x4bc3ca['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x4bc3ca['dialQueueOptions']||_0xeef9('0x32');this[_0xeef9('0x33')]=_0x4bc3ca[_0xeef9('0x33')]||0x3;this[_0xeef9('0x34')]=_0x4bc3ca[_0xeef9('0x34')]||undefined;this['dialCongestionMaxRetry']=_0x4bc3ca[_0xeef9('0x35')]||0x3;this[_0xeef9('0x36')]=_0x4bc3ca[_0xeef9('0x36')]||0x96;this[_0xeef9('0x37')]=_0x4bc3ca[_0xeef9('0x37')]||0x3;this['dialBusyRetryFrequency']=_0x4bc3ca[_0xeef9('0x38')]||0x96;this[_0xeef9('0x39')]=_0x4bc3ca[_0xeef9('0x39')]||0x3;this[_0xeef9('0x3a')]=_0x4bc3ca['dialNoAnswerRetryFrequency']||0x96;this[_0xeef9('0x3b')]=_0x4bc3ca['dialNoSuchNumberMaxRetry']||0x3;this[_0xeef9('0x3c')]=_0x4bc3ca['dialNoSuchNumberRetryFrequency']||0x96;this[_0xeef9('0x3d')]=_0x4bc3ca[_0xeef9('0x3d')]||0x3;this[_0xeef9('0x3e')]=_0x4bc3ca[_0xeef9('0x3e')]||0x96;this[_0xeef9('0x3f')]=_0x4bc3ca[_0xeef9('0x3f')]||0x3;this[_0xeef9('0x40')]=_0x4bc3ca['dialAbandonedRetryFrequency']||0x96;this[_0xeef9('0x41')]=_0x4bc3ca[_0xeef9('0x41')]||0x3;this[_0xeef9('0x42')]=_0x4bc3ca['dialMachineRetryFrequency']||0x96;this[_0xeef9('0x43')]=_0x4bc3ca[_0xeef9('0x43')]||0x3;this[_0xeef9('0x44')]=_0x4bc3ca['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x4bc3ca[_0xeef9('0x45')]||0x3;this[_0xeef9('0x46')]=_0x4bc3ca[_0xeef9('0x46')]||0x4;this[_0xeef9('0x47')]=_0x4bc3ca[_0xeef9('0x47')]?_0x4bc3ca['Trunk']:undefined;this[_0xeef9('0x48')]=_0x4bc3ca['TrunkBackup']?_0x4bc3ca['TrunkBackup']:undefined;this['dialPrefix']=_0x4bc3ca['dialPrefix']||undefined;this['Interval']=_0x4bc3ca[_0xeef9('0x49')]?_0x4bc3ca[_0xeef9('0x49')]:undefined;this['dialOrderByScheduledAt']=_0x4bc3ca['dialOrderByScheduledAt']||_0xeef9('0x4a');this['dialRandomLastDigitCallerIdNumber']=_0x4bc3ca[_0xeef9('0x4b')]||undefined;this[_0xeef9('0x4c')]=_0x4bc3ca['dialCutDigit']||undefined;this[_0xeef9('0x4d')]=strategy[_0x4bc3ca[_0xeef9('0x4d')]];this[_0xeef9('0x4e')]=!![];this[_0xeef9('0x4f')]=_0x4bc3ca[_0xeef9('0x4f')]||![];this[_0xeef9('0x50')]=_0x4bc3ca[_0xeef9('0x50')];this['dialAMDGreeting']=_0x4bc3ca[_0xeef9('0x51')];this[_0xeef9('0x52')]=_0x4bc3ca[_0xeef9('0x52')];this[_0xeef9('0x53')]=_0x4bc3ca[_0xeef9('0x53')];this['dialAMDMinWordLength']=_0x4bc3ca[_0xeef9('0x54')];this[_0xeef9('0x55')]=_0x4bc3ca[_0xeef9('0x55')];this[_0xeef9('0x56')]=_0x4bc3ca[_0xeef9('0x56')];this[_0xeef9('0x57')]=_0x4bc3ca[_0xeef9('0x57')];this[_0xeef9('0x58')]=_0x4bc3ca[_0xeef9('0x58')];this['outboundRejectCallsDay']=0x0;this[_0xeef9('0x59')]=0x0;this[_0xeef9('0x5a')]=_0x4bc3ca[_0xeef9('0x5a')];this[_0xeef9('0x5b')]=0x0;this[_0xeef9('0x5c')]=0x0;this[_0xeef9('0x5d')]=0x0;this[_0xeef9('0x5e')]=0x0;this[_0xeef9('0x5f')]=0x0;this[_0xeef9('0x60')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xeef9('0x61')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xeef9('0x62')]=0x0;this[_0xeef9('0x63')]=0x0;this[_0xeef9('0x64')]=0x0;this[_0xeef9('0x65')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0xeef9('0x66')]=undefined;this[_0xeef9('0x67')]=1.05;this[_0xeef9('0x68')]=0x0;this[_0xeef9('0x69')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xeef9('0x6a')]=0x0;this[_0xeef9('0x6b')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xeef9('0x6c')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xeef9('0x6d')]=_0x4bc3ca['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x4bc3ca[_0xeef9('0x6e')]||0xa;this[_0xeef9('0x6f')]=0x0;this[_0xeef9('0x70')]=0x0;this[_0xeef9('0x71')]=0x1;this[_0xeef9('0x72')]=0x0;this[_0xeef9('0x73')]=0x0;this[_0xeef9('0x74')]=0x0;this['erlangBusyFactor']=0x0;this[_0xeef9('0x75')]=_0x4bc3ca[_0xeef9('0x75')]||0x1e;this['dialRecallInQueue']=_0x4bc3ca[_0xeef9('0x76')]||![];this[_0xeef9('0x77')]=!!_0x4bc3ca['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x4bc3ca[_0xeef9('0x78')]||![];this[_0xeef9('0x79')]=_0x4bc3ca[_0xeef9('0x79')]||undefined;this[_0xeef9('0x7a')]=_0x4bc3ca[_0xeef9('0x7a')]||![];this[_0xeef9('0x7b')]=_0x4bc3ca[_0xeef9('0x7b')]||![];this['monitor_format']=monitorFormat[_0x4bc3ca[_0xeef9('0x9')]]?monitorFormat[_0x4bc3ca[_0xeef9('0x9')]]:undefined;this[_0xeef9('0x7c')]=_0x4bc3ca[_0xeef9('0x7c')]||![];this[_0xeef9('0x7d')]=_0x4bc3ca[_0xeef9('0x7d')]?_0x4bc3ca[_0xeef9('0x7d')]:undefined;this[_0xeef9('0x7e')]=![];}module[_0xeef9('0x7f')]=VoiceQueue; \ No newline at end of file +var _0x2409=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','inbound','waiting','answered','sumBillable','abandoned','available','busy','inUse','invalid','loggedIn','onHold','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x431cb3,_0x3d9601){var _0x3c4bce=function(_0xed1a03){while(--_0xed1a03){_0x431cb3['push'](_0x431cb3['shift']());}};_0x3c4bce(++_0x3d9601);}(_0x2409,0x128));var _0x9240=function(_0x544118,_0x10bad9){_0x544118=_0x544118-0x0;var _0x19196c=_0x2409[_0x544118];return _0x19196c;};'use strict';var monitorFormat={'wav':_0x9240('0x0'),'wav49':_0x9240('0x1'),'gsm':_0x9240('0x2')};var strategy={'fewestcalls':_0x9240('0x3'),'leastrecent':_0x9240('0x4'),'linear':_0x9240('0x5'),'random':'random','ringall':_0x9240('0x6'),'rr':_0x9240('0x7'),'rrmemory':_0x9240('0x8'),'rrordered':_0x9240('0x9'),'wrandom':_0x9240('0xa')};function VoiceQueue(_0x49b5f6){this['id']=_0x49b5f6['id']||0x0;this[_0x9240('0xb')]=_0x49b5f6[_0x9240('0xb')]||'';this[_0x9240('0xc')]=_0x49b5f6['monitor_format']||'';this['type']=_0x49b5f6['type']||_0x9240('0xd');this[_0x9240('0xe')]=0x0;this['total']=0x0;this[_0x9240('0xf')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x9240('0x10')]=0x0;this['unmanaged']=0x0;this[_0x9240('0x11')]=0x0;this[_0x9240('0x12')]=0x0;this[_0x9240('0x13')]=0x0;this[_0x9240('0x14')]=0x0;this[_0x9240('0x15')]=0x0;this[_0x9240('0x16')]=0x0;this['notInUse']=0x0;this[_0x9240('0x17')]=0x0;this['paused']=0x0;this[_0x9240('0x18')]=0x0;this[_0x9240('0x19')]=0x0;this[_0x9240('0x1a')]=0x0;this[_0x9240('0x1b')]=0x0;this[_0x9240('0x1c')]=0x0;this[_0x9240('0x1d')]=_0x49b5f6[_0x9240('0x1d')]||![];this[_0x9240('0x1e')]=_0x49b5f6[_0x9240('0x1e')]||0xa;this[_0x9240('0x1f')]=_0x49b5f6[_0x9240('0x1f')]||'no';this[_0x9240('0x20')]=!![];this['message']='';this[_0x9240('0x21')]='';this[_0x9240('0x22')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x49b5f6[_0x9240('0x23')]||null;this[_0x9240('0x24')]=_0x49b5f6[_0x9240('0x24')]?_0x49b5f6[_0x9240('0x24')]:null;this[_0x9240('0x25')]=_0x49b5f6[_0x9240('0x25')];this[_0x9240('0x26')]=_0x49b5f6[_0x9240('0x26')]||'progressive';this[_0x9240('0x27')]=_0x49b5f6[_0x9240('0x27')]||0x0;this[_0x9240('0x28')]=_0x49b5f6[_0x9240('0x28')]||0x0;this[_0x9240('0x29')]=_0x49b5f6[_0x9240('0x29')]||0x1;this[_0x9240('0x2a')]=_0x49b5f6[_0x9240('0x2a')]||_0x9240('0x2b');this[_0x9240('0x2c')]=_0x49b5f6[_0x9240('0x2c')]||0.03;this[_0x9240('0x2d')]=_0x49b5f6[_0x9240('0x2d')]||0x258;this['dialOriginateCallerIdName']=_0x49b5f6[_0x9240('0x2e')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x49b5f6[_0x9240('0x2f')]||_0x9240('0x30');this[_0x9240('0x31')]=_0x49b5f6[_0x9240('0x31')]||0x1e;this['dialQueueOptions']=_0x49b5f6[_0x9240('0x32')]||'tTxX';this['dialQueueTimeout']=_0x49b5f6[_0x9240('0x33')]||0x3;this['dialQueueProject']=_0x49b5f6[_0x9240('0x34')]||undefined;this[_0x9240('0x35')]=_0x49b5f6['dialCongestionMaxRetry']||0x3;this[_0x9240('0x36')]=_0x49b5f6[_0x9240('0x36')]||0x96;this[_0x9240('0x37')]=_0x49b5f6[_0x9240('0x37')]||0x3;this[_0x9240('0x38')]=_0x49b5f6['dialBusyRetryFrequency']||0x96;this[_0x9240('0x39')]=_0x49b5f6['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x49b5f6[_0x9240('0x3a')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x49b5f6[_0x9240('0x3b')]||0x3;this[_0x9240('0x3c')]=_0x49b5f6['dialNoSuchNumberRetryFrequency']||0x96;this[_0x9240('0x3d')]=_0x49b5f6[_0x9240('0x3d')]||0x3;this[_0x9240('0x3e')]=_0x49b5f6[_0x9240('0x3e')]||0x96;this['dialAbandonedMaxRetry']=_0x49b5f6['dialAbandonedMaxRetry']||0x3;this[_0x9240('0x3f')]=_0x49b5f6[_0x9240('0x3f')]||0x96;this[_0x9240('0x40')]=_0x49b5f6[_0x9240('0x40')]||0x3;this[_0x9240('0x41')]=_0x49b5f6[_0x9240('0x41')]||0x96;this[_0x9240('0x42')]=_0x49b5f6[_0x9240('0x42')]||0x3;this[_0x9240('0x43')]=_0x49b5f6[_0x9240('0x43')]||0x96;this[_0x9240('0x44')]=_0x49b5f6[_0x9240('0x44')]||0x3;this['dialGlobalMaxRetry']=_0x49b5f6['dialGlobalMaxRetry']||0x4;this[_0x9240('0x45')]=_0x49b5f6[_0x9240('0x45')]?_0x49b5f6[_0x9240('0x45')]:undefined;this['TrunkBackup']=_0x49b5f6[_0x9240('0x46')]?_0x49b5f6[_0x9240('0x46')]:undefined;this[_0x9240('0x47')]=_0x49b5f6['dialPrefix']||undefined;this['Interval']=_0x49b5f6[_0x9240('0x48')]?_0x49b5f6[_0x9240('0x48')]:undefined;this['dialOrderByScheduledAt']=_0x49b5f6[_0x9240('0x49')]||_0x9240('0x4a');this['dialRandomLastDigitCallerIdNumber']=_0x49b5f6[_0x9240('0x4b')]||undefined;this[_0x9240('0x4c')]=_0x49b5f6[_0x9240('0x4c')]||undefined;this['strategy']=strategy[_0x49b5f6[_0x9240('0x4d')]];this[_0x9240('0x4e')]=!![];this['dialAMDActive']=_0x49b5f6['dialAMDActive']||![];this[_0x9240('0x4f')]=_0x49b5f6[_0x9240('0x4f')];this[_0x9240('0x50')]=_0x49b5f6[_0x9240('0x50')];this[_0x9240('0x51')]=_0x49b5f6[_0x9240('0x51')];this[_0x9240('0x52')]=_0x49b5f6[_0x9240('0x52')];this[_0x9240('0x53')]=_0x49b5f6[_0x9240('0x53')];this[_0x9240('0x54')]=_0x49b5f6[_0x9240('0x54')];this[_0x9240('0x55')]=_0x49b5f6[_0x9240('0x55')];this[_0x9240('0x56')]=_0x49b5f6['dialAMDSilenceThreshold'];this[_0x9240('0x57')]=_0x49b5f6[_0x9240('0x57')];this[_0x9240('0x58')]=0x0;this['pTalking']=0x0;this[_0x9240('0x59')]=_0x49b5f6[_0x9240('0x59')];this[_0x9240('0x5a')]=0x0;this[_0x9240('0x5b')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x9240('0x5c')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x9240('0x5d')]=0x0;this[_0x9240('0x5e')]=0x0;this[_0x9240('0x5f')]=0x0;this[_0x9240('0x60')]=0x0;this[_0x9240('0x61')]=0x0;this[_0x9240('0x62')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x9240('0x63')]=0x0;this[_0x9240('0x64')]=0x0;this[_0x9240('0x65')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x9240('0x66')]=0x0;this[_0x9240('0x67')]=0x0;this[_0x9240('0x68')]=0x0;this[_0x9240('0x69')]=0x0;this[_0x9240('0x6a')]=0x0;this[_0x9240('0x6b')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x9240('0x6c')]=_0x49b5f6['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x9240('0x6d')]=_0x49b5f6[_0x9240('0x6e')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x9240('0x6f')]=0x0;this[_0x9240('0x70')]=0x1;this[_0x9240('0x71')]=0x0;this[_0x9240('0x72')]=0x0;this[_0x9240('0x73')]=0x0;this[_0x9240('0x74')]=0x0;this['dialRecallMeTimeout']=_0x49b5f6['dialRecallMeTimeout']||0x1e;this[_0x9240('0x75')]=_0x49b5f6['dialRecallInQueue']||![];this[_0x9240('0x76')]=!!_0x49b5f6[_0x9240('0x76')]||![];this[_0x9240('0x77')]=!!_0x49b5f6[_0x9240('0x77')]||![];this['dialQueueProject2']=_0x49b5f6[_0x9240('0x78')]||undefined;this[_0x9240('0x79')]=_0x49b5f6[_0x9240('0x79')]||![];this[_0x9240('0x7a')]=_0x49b5f6['dialAgiAfterHangupAgent']||![];this[_0x9240('0xc')]=monitorFormat[_0x49b5f6['monitor_format']]?monitorFormat[_0x49b5f6[_0x9240('0xc')]]:undefined;this['mandatoryDisposition']=_0x49b5f6['mandatoryDisposition']||![];this[_0x9240('0x7b')]=_0x49b5f6[_0x9240('0x7b')]?_0x49b5f6[_0x9240('0x7b')]:undefined;this[_0x9240('0x7c')]=![];}module[_0x9240('0x7d')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 930f527..b9ed4c5 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 _0xac9d=['onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','SIP/','incall','includes','status','booked','keys','length','queue','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','answered','busy','invalid'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xac9d,0x14d));var _0xdac9=function(_0xc28c76,_0x1d2e26){_0xc28c76=_0xc28c76-0x0;var _0x2f0b2a=_0xac9d[_0xc28c76];return _0x2f0b2a;};'use strict';var INBOUND_COUNTERS=[_0xdac9('0x0'),_0xdac9('0x1'),_0xdac9('0x2'),_0xdac9('0x3'),_0xdac9('0x4'),_0xdac9('0x5'),_0xdac9('0x6')];var OUTBOUND_COUNTERS=[_0xdac9('0x0'),'answered',_0xdac9('0x7'),'loggedIn',_0xdac9('0x2'),_0xdac9('0x8'),_0xdac9('0x9'),_0xdac9('0xa'),_0xdac9('0xb'),_0xdac9('0xc'),'outboundCongestionCallsDay',_0xdac9('0xd'),'outboundNoSuchCallsDay',_0xdac9('0xe'),_0xdac9('0xf'),_0xdac9('0x10'),_0xdac9('0x3'),_0xdac9('0x11'),_0xdac9('0x5'),_0xdac9('0x12'),_0xdac9('0x13'),_0xdac9('0x14'),'waiting'];function VoiceQueueSummary(_0x37b316){this['id']=_0x37b316['id'];this[_0xdac9('0x15')]=_0x37b316['name'];this[_0xdac9('0x16')]=_0x37b316[_0xdac9('0x16')];this[_0xdac9('0x17')]=_0x37b316['abandoned']||0x0;this[_0xdac9('0x18')]=_0x37b316[_0xdac9('0x18')]||0x0;this[_0xdac9('0x0')]=_0x37b316['available']||0x0;this['busy']=_0x37b316[_0xdac9('0x19')]||0x0;this[_0xdac9('0x7')]=_0x37b316['inUse']||0x0;this[_0xdac9('0x1a')]=_0x37b316[_0xdac9('0x1a')]||0x0;this[_0xdac9('0x1')]=_0x37b316[_0xdac9('0x1')]||0x0;this[_0xdac9('0x2')]=_0x37b316[_0xdac9('0x2')]||0x0;this[_0xdac9('0x1b')]=_0x37b316[_0xdac9('0x1b')]||0x0;this['notInUse']=_0x37b316[_0xdac9('0x1c')]||0x0;this[_0xdac9('0x3')]=_0x37b316['paused']||0x0;this[_0xdac9('0x4')]=_0x37b316[_0xdac9('0x4')]||0x0;this[_0xdac9('0x1d')]=_0x37b316[_0xdac9('0x1d')];this['sumBillable']=_0x37b316['sumBillable'];this[_0xdac9('0x13')]=_0x37b316[_0xdac9('0x13')];this[_0xdac9('0x1e')]=_0x37b316[_0xdac9('0x1e')]||0x0;this['talking']=_0x37b316[_0xdac9('0x5')]||0x0;this[_0xdac9('0x14')]=_0x37b316[_0xdac9('0x14')]||0x0;this[_0xdac9('0x1f')]=_0x37b316[_0xdac9('0x1f')];this[_0xdac9('0x20')]=_0x37b316[_0xdac9('0x20')]||0x0;this[_0xdac9('0x21')]=_0x37b316[_0xdac9('0x21')]||0x0;this[_0xdac9('0x22')]=_0x37b316['unmanaged']||0x0;this[_0xdac9('0x6')]=_0x37b316[_0xdac9('0x6')]||0x0;if(_0x37b316[_0xdac9('0x1f')]===_0xdac9('0x23')){this['pTalking']=_0x37b316[_0xdac9('0x11')]||0x0;this['dialActive']=_0x37b316[_0xdac9('0x24')];this[_0xdac9('0x25')]=_0x37b316['dialMethod'];this[_0xdac9('0x26')]=_0x37b316['dialOriginateCallerIdName'];this[_0xdac9('0x27')]=_0x37b316[_0xdac9('0x27')];this[_0xdac9('0x28')]=_0x37b316[_0xdac9('0x28')];this['dialPrefix']=_0x37b316['dialPrefix'];this[_0xdac9('0x29')]=_0x37b316[_0xdac9('0x29')];this['outboundAnswerAgiCallsDay']=_0x37b316['outboundAnswerAgiCallsDay'];this[_0xdac9('0xa')]=_0x37b316[_0xdac9('0xa')];this[_0xdac9('0xb')]=_0x37b316[_0xdac9('0xb')];this[_0xdac9('0xc')]=_0x37b316[_0xdac9('0xc')];this[_0xdac9('0x2a')]=_0x37b316[_0xdac9('0x2a')];this[_0xdac9('0x2b')]=_0x37b316[_0xdac9('0x2b')];this[_0xdac9('0x2c')]=_0x37b316[_0xdac9('0x2c')];this[_0xdac9('0x2d')]=_0x37b316[_0xdac9('0x2d')];this[_0xdac9('0xd')]=_0x37b316[_0xdac9('0xd')];this[_0xdac9('0x2e')]=_0x37b316[_0xdac9('0x2e')];this[_0xdac9('0x2f')]=_0x37b316[_0xdac9('0x2f')];this[_0xdac9('0xe')]=_0x37b316['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x37b316[_0xdac9('0xf')];this[_0xdac9('0x10')]=_0x37b316[_0xdac9('0x10')];this[_0xdac9('0x30')]=_0x37b316[_0xdac9('0x30')];this['predictiveIntervalAvgHoldtime']=_0x37b316[_0xdac9('0x31')];this['predictiveIntervalAvgTalktime']=_0x37b316[_0xdac9('0x32')];this[_0xdac9('0x33')]=_0x37b316['predictiveIntervalDroppedCallsCallersExit'];this[_0xdac9('0x34')]=_0x37b316['predictiveIntervalDroppedCallsTimeout'];this['predictiveIntervalErlangCalls']=_0x37b316[_0xdac9('0x35')];this[_0xdac9('0x36')]=_0x37b316[_0xdac9('0x36')];this[_0xdac9('0x37')]=_0x37b316[_0xdac9('0x37')];this[_0xdac9('0x38')]=_0x37b316['predictiveIntervalMultiplicativeFactor'];this[_0xdac9('0x39')]=_0x37b316[_0xdac9('0x39')];this['predictiveIntervalAvailable']=_0x37b316[_0xdac9('0x3a')];this[_0xdac9('0x3b')]=_0x37b316[_0xdac9('0x3b')];this[_0xdac9('0x8')]=_0x37b316[_0xdac9('0x8')];this[_0xdac9('0x3c')]=_0x37b316[_0xdac9('0x3c')];this['erlangCallToSecond']=_0x37b316[_0xdac9('0x3d')];this[_0xdac9('0x3e')]=_0x37b316[_0xdac9('0x3e')];this['erlangBusyFactor']=_0x37b316[_0xdac9('0x3f')];this[_0xdac9('0x40')]=_0x37b316[_0xdac9('0x40')];this[_0xdac9('0x41')]=_0x37b316['startProgressive'];this['message']=_0x37b316[_0xdac9('0x42')];this[_0xdac9('0x43')]=_0x37b316[_0xdac9('0x43')];}if(_0x37b316[_0xdac9('0x44')]){this[_0xdac9('0x44')]={'id':_0x37b316['Trunk']['id'],'name':_0x37b316[_0xdac9('0x44')]['name'],'active':_0x37b316[_0xdac9('0x44')][_0xdac9('0x45')],'callerid':_0x37b316[_0xdac9('0x44')][_0xdac9('0x46')]};}}VoiceQueueSummary[_0xdac9('0x47')][_0xdac9('0x48')]=function(_0x413fb1,_0xb176e0,_0x11362d,_0x8a0538){this[_0xdac9('0x2')]=0x0;this[_0xdac9('0x5')]=0x0;this[_0xdac9('0x3')]=0x0;this[_0xdac9('0x21')]=0x0;this['notInUse']=0x0;this[_0xdac9('0x7')]=0x0;this[_0xdac9('0x19')]=0x0;this['invalid']=0x0;this[_0xdac9('0x20')]=0x0;this[_0xdac9('0x4')]=0x0;this[_0xdac9('0x1d')]=0x0;this[_0xdac9('0x1b')]=0x0;if(_0x11362d){if(_0x11362d[_0xdac9('0x0')]){this[_0xdac9('0x0')]=Number(_0x11362d['available']);}if(_0x11362d[_0xdac9('0x49')]){this['loggedIn']=Number(_0x11362d[_0xdac9('0x49')]);}if(_0x11362d[_0xdac9('0x4a')]){this[_0xdac9('0x6')]=Number(_0x11362d[_0xdac9('0x4a')]);}}for(var _0x5e61ac=0x0;_0x5e61ac<_0x413fb1['length'];_0x5e61ac++){var _0x585f08=_0xb176e0[_0xdac9('0x4b')+_0x413fb1[_0x5e61ac]['name']];if(_0x585f08&&_0x585f08['online']){this[_0xdac9('0x2')]+=0x1;}if(_0x413fb1[_0x5e61ac][_0xdac9('0x4c')]==='1'){this['talking']+=0x1;}if(_0x413fb1[_0x5e61ac]['paused']==='1'&&!['2','7','8'][_0xdac9('0x4d')](_0x413fb1[_0x5e61ac][_0xdac9('0x4e')])){this[_0xdac9('0x3')]+=0x1;}switch(_0x413fb1[_0x5e61ac][_0xdac9('0x4e')]){case'0':this[_0xdac9('0x21')]+=0x1;break;case'1':this[_0xdac9('0x1c')]+=0x1;break;case'2':this[_0xdac9('0x7')]+=0x1;break;case'3':this[_0xdac9('0x19')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0xdac9('0x20')]+=0x1;break;case'6':this[_0xdac9('0x4')]+=0x1;break;case'7':this[_0xdac9('0x1d')]+=0x1;break;case'8':this[_0xdac9('0x1b')]+=0x1;break;}}if(this[_0xdac9('0x25')]===_0xdac9('0x4f')){var _0x1dece7=Object[_0xdac9('0x50')](_0x8a0538);for(var _0x140dc5=0x0;_0x140dc5<_0x1dece7[_0xdac9('0x51')];_0x140dc5++){var _0x257e48=_0x1dece7[_0x140dc5];var _0x446223=_0x8a0538[_0x257e48];if(_0x446223[_0xdac9('0x52')]===this[_0xdac9('0x15')]&&_0x446223['type']==='dialer'&&_0x446223['exten']===_0xdac9('0x53')){this[_0xdac9('0x5')]+=0x1;}}if(this['talking']>this[_0xdac9('0x7')]){this[_0xdac9('0x5')]=this[_0xdac9('0x7')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xdac9('0x47')][_0xdac9('0x54')]=function(_0x57902f){var _0x53ceb8=![];if(_0x57902f){_0x53ceb8=INBOUND_COUNTERS[_0xdac9('0x55')](function(_0x4469d8){return this[_0x4469d8]!==_0x57902f[_0x4469d8];},this);}return _0x53ceb8;};VoiceQueueSummary[_0xdac9('0x47')][_0xdac9('0x56')]=function(_0x39df88){var _0x426774=![];var _0x7a40ac=![];var _0x3a77e3=![];if(_0x39df88){_0x426774=this[_0xdac9('0x25')]!==_0x39df88[_0xdac9('0x25')]||this[_0xdac9('0x24')]!==_0x39df88[_0xdac9('0x24')]||this[_0xdac9('0x42')]!==_0x39df88[_0xdac9('0x42')]||this[_0xdac9('0x43')]!==_0x39df88['statusMessage'];_0x7a40ac=OUTBOUND_COUNTERS[_0xdac9('0x55')](function(_0x150bba){return this[_0x150bba]!==_0x39df88[_0x150bba];},this);if(this[_0xdac9('0x44')]&&_0x39df88[_0xdac9('0x44')]){_0x3a77e3=this[_0xdac9('0x44')][_0xdac9('0x15')]!==_0x39df88['Trunk'][_0xdac9('0x15')]||this[_0xdac9('0x44')][_0xdac9('0x45')]!==_0x39df88[_0xdac9('0x44')][_0xdac9('0x45')];}}return _0x426774||_0x7a40ac||_0x3a77e3;};VoiceQueueSummary[_0xdac9('0x47')][_0xdac9('0x57')]=function(_0x243862){this[_0xdac9('0x18')]=_0x243862['answered'];this[_0xdac9('0x42')]=_0x243862[_0xdac9('0x42')];this[_0xdac9('0x43')]=_0x243862[_0xdac9('0x43')];this[_0xdac9('0x8')]=_0x243862[_0xdac9('0x8')];this['outboundAbandonedCallsDay']=_0x243862['outboundAbandonedCallsDay'];this[_0xdac9('0xa')]=_0x243862[_0xdac9('0xa')];this[_0xdac9('0xb')]=_0x243862[_0xdac9('0xb')];this[_0xdac9('0xc')]=_0x243862[_0xdac9('0xc')];this['outboundCongestionCallsDay']=_0x243862['outboundCongestionCallsDay'];this['outboundNoAnswerCallsDay']=_0x243862[_0xdac9('0xd')];this[_0xdac9('0x2e')]=_0x243862[_0xdac9('0x2e')];this[_0xdac9('0xe')]=_0x243862['outboundReCallsDay'];this[_0xdac9('0xf')]=_0x243862[_0xdac9('0xf')];this[_0xdac9('0x10')]=_0x243862[_0xdac9('0x10')];this[_0xdac9('0x12')]=_0x243862['sumBillable'];this[_0xdac9('0x13')]=_0x243862['sumDuration'];this[_0xdac9('0x14')]=_0x243862['total'];if(this[_0xdac9('0x25')]===_0xdac9('0x58')){this[_0xdac9('0x11')]=_0x243862[_0xdac9('0x11')];}};module[_0xdac9('0x59')]=VoiceQueueSummary; \ No newline at end of file +var _0xa13d=['some','updateReportFromOutboundQueue','outboundAbandonedCallsDay','exports','available','loggedInDb','paused','talking','answered','originated','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','busy','inUse','invalid','loggedIn','onHold','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','includes','status','dialMethod','keys','queue','exten','compareToInboundQueue'];(function(_0x158982,_0x2633d1){var _0x133e0e=function(_0x53a95d){while(--_0x53a95d){_0x158982['push'](_0x158982['shift']());}};_0x133e0e(++_0x2633d1);}(_0xa13d,0x154));var _0xda13=function(_0x124e2e,_0x3707ca){_0x124e2e=_0x124e2e-0x0;var _0x5b8360=_0xa13d[_0x124e2e];return _0x5b8360;};'use strict';var INBOUND_COUNTERS=[_0xda13('0x0'),'loggedIn',_0xda13('0x1'),_0xda13('0x2'),'ringing',_0xda13('0x3'),'waiting'];var OUTBOUND_COUNTERS=[_0xda13('0x0'),_0xda13('0x4'),'inUse','loggedIn',_0xda13('0x1'),_0xda13('0x5'),'outboundAbandonedCallsDay',_0xda13('0x6'),_0xda13('0x7'),_0xda13('0x8'),'outboundCongestionCallsDay',_0xda13('0x9'),_0xda13('0xa'),_0xda13('0xb'),_0xda13('0xc'),_0xda13('0xd'),_0xda13('0x2'),_0xda13('0xe'),_0xda13('0x3'),_0xda13('0xf'),_0xda13('0x10'),_0xda13('0x11'),_0xda13('0x12')];function VoiceQueueSummary(_0x8c996e){this['id']=_0x8c996e['id'];this[_0xda13('0x13')]=_0x8c996e[_0xda13('0x13')];this[_0xda13('0x14')]=_0x8c996e[_0xda13('0x14')];this['abandoned']=_0x8c996e[_0xda13('0x15')]||0x0;this['answered']=_0x8c996e[_0xda13('0x4')]||0x0;this[_0xda13('0x0')]=_0x8c996e['available']||0x0;this[_0xda13('0x16')]=_0x8c996e[_0xda13('0x16')]||0x0;this[_0xda13('0x17')]=_0x8c996e[_0xda13('0x17')]||0x0;this['invalid']=_0x8c996e[_0xda13('0x18')]||0x0;this[_0xda13('0x19')]=_0x8c996e['loggedIn']||0x0;this[_0xda13('0x1')]=_0x8c996e['loggedInDb']||0x0;this[_0xda13('0x1a')]=_0x8c996e[_0xda13('0x1a')]||0x0;this[_0xda13('0x1b')]=_0x8c996e[_0xda13('0x1b')]||0x0;this[_0xda13('0x2')]=_0x8c996e[_0xda13('0x2')]||0x0;this[_0xda13('0x1c')]=_0x8c996e[_0xda13('0x1c')]||0x0;this['ringInUse']=_0x8c996e[_0xda13('0x1d')];this[_0xda13('0xf')]=_0x8c996e[_0xda13('0xf')];this['sumDuration']=_0x8c996e[_0xda13('0x10')];this[_0xda13('0x1e')]=_0x8c996e[_0xda13('0x1e')]||0x0;this[_0xda13('0x3')]=_0x8c996e['talking']||0x0;this[_0xda13('0x11')]=_0x8c996e[_0xda13('0x11')]||0x0;this[_0xda13('0x1f')]=_0x8c996e['type'];this[_0xda13('0x20')]=_0x8c996e[_0xda13('0x20')]||0x0;this[_0xda13('0x21')]=_0x8c996e[_0xda13('0x21')]||0x0;this[_0xda13('0x22')]=_0x8c996e[_0xda13('0x22')]||0x0;this[_0xda13('0x12')]=_0x8c996e[_0xda13('0x12')]||0x0;if(_0x8c996e['type']===_0xda13('0x23')){this[_0xda13('0xe')]=_0x8c996e[_0xda13('0xe')]||0x0;this[_0xda13('0x24')]=_0x8c996e[_0xda13('0x24')];this['dialMethod']=_0x8c996e['dialMethod'];this[_0xda13('0x25')]=_0x8c996e['dialOriginateCallerIdName'];this[_0xda13('0x26')]=_0x8c996e[_0xda13('0x26')];this[_0xda13('0x27')]=_0x8c996e[_0xda13('0x27')];this[_0xda13('0x28')]=_0x8c996e[_0xda13('0x28')];this[_0xda13('0x29')]=_0x8c996e[_0xda13('0x29')];this[_0xda13('0x2a')]=_0x8c996e['outboundAnswerAgiCallsDay'];this[_0xda13('0x6')]=_0x8c996e['outboundAnswerCallsDay'];this[_0xda13('0x7')]=_0x8c996e[_0xda13('0x7')];this[_0xda13('0x8')]=_0x8c996e[_0xda13('0x8')];this['outboundCongestionCallsDay']=_0x8c996e[_0xda13('0x2b')];this[_0xda13('0x2c')]=_0x8c996e[_0xda13('0x2c')];this[_0xda13('0x2d')]=_0x8c996e[_0xda13('0x2d')];this[_0xda13('0x2e')]=_0x8c996e[_0xda13('0x2e')];this[_0xda13('0x9')]=_0x8c996e['outboundNoAnswerCallsDay'];this[_0xda13('0xa')]=_0x8c996e[_0xda13('0xa')];this['outboundOriginateFailureCallsDay']=_0x8c996e[_0xda13('0x2f')];this[_0xda13('0xb')]=_0x8c996e[_0xda13('0xb')];this[_0xda13('0xc')]=_0x8c996e[_0xda13('0xc')];this[_0xda13('0xd')]=_0x8c996e[_0xda13('0xd')];this['predictiveIntervalAnsweredCalls']=_0x8c996e[_0xda13('0x30')];this['predictiveIntervalAvgHoldtime']=_0x8c996e['predictiveIntervalAvgHoldtime'];this[_0xda13('0x31')]=_0x8c996e[_0xda13('0x31')];this['predictiveIntervalDroppedCallsCallersExit']=_0x8c996e[_0xda13('0x32')];this[_0xda13('0x33')]=_0x8c996e[_0xda13('0x33')];this['predictiveIntervalErlangCalls']=_0x8c996e['predictiveIntervalErlangCalls'];this[_0xda13('0x34')]=_0x8c996e[_0xda13('0x34')];this[_0xda13('0x35')]=_0x8c996e[_0xda13('0x35')];this[_0xda13('0x36')]=_0x8c996e[_0xda13('0x36')];this[_0xda13('0x37')]=_0x8c996e[_0xda13('0x37')];this[_0xda13('0x38')]=_0x8c996e[_0xda13('0x38')];this['predictiveIntervalTotalCalls']=_0x8c996e[_0xda13('0x39')];this[_0xda13('0x5')]=_0x8c996e[_0xda13('0x5')];this[_0xda13('0x3a')]=_0x8c996e[_0xda13('0x3a')];this['erlangCallToSecond']=_0x8c996e[_0xda13('0x3b')];this['erlangAbandonmentRate']=_0x8c996e['erlangAbandonmentRate'];this[_0xda13('0x3c')]=_0x8c996e[_0xda13('0x3c')];this['startPredictive']=_0x8c996e['startPredictive'];this['startProgressive']=_0x8c996e[_0xda13('0x3d')];this[_0xda13('0x3e')]=_0x8c996e[_0xda13('0x3e')];this[_0xda13('0x3f')]=_0x8c996e['statusMessage'];}if(_0x8c996e[_0xda13('0x40')]){this['Trunk']={'id':_0x8c996e[_0xda13('0x40')]['id'],'name':_0x8c996e[_0xda13('0x40')][_0xda13('0x13')],'active':_0x8c996e[_0xda13('0x40')][_0xda13('0x41')],'callerid':_0x8c996e[_0xda13('0x40')][_0xda13('0x42')]};}}VoiceQueueSummary[_0xda13('0x43')][_0xda13('0x44')]=function(_0x1deec8,_0x3a2198,_0x5274f7,_0x5a261a){this[_0xda13('0x1')]=0x0;this[_0xda13('0x3')]=0x0;this[_0xda13('0x2')]=0x0;this[_0xda13('0x21')]=0x0;this['notInUse']=0x0;this[_0xda13('0x17')]=0x0;this[_0xda13('0x16')]=0x0;this[_0xda13('0x18')]=0x0;this['unavailable']=0x0;this[_0xda13('0x1c')]=0x0;this[_0xda13('0x1d')]=0x0;this['onHold']=0x0;if(_0x5274f7){if(_0x5274f7[_0xda13('0x0')]){this[_0xda13('0x0')]=Number(_0x5274f7[_0xda13('0x0')]);}if(_0x5274f7[_0xda13('0x45')]){this[_0xda13('0x19')]=Number(_0x5274f7[_0xda13('0x45')]);}if(_0x5274f7[_0xda13('0x46')]){this[_0xda13('0x12')]=Number(_0x5274f7[_0xda13('0x46')]);}}for(var _0x4d239f=0x0;_0x4d239f<_0x1deec8[_0xda13('0x47')];_0x4d239f++){var _0x931b4=_0x3a2198[_0xda13('0x48')+_0x1deec8[_0x4d239f][_0xda13('0x13')]];if(_0x931b4&&_0x931b4['online']){this[_0xda13('0x1')]+=0x1;}if(_0x1deec8[_0x4d239f]['incall']==='1'){this[_0xda13('0x3')]+=0x1;}if(_0x1deec8[_0x4d239f][_0xda13('0x2')]==='1'&&!['2','7','8'][_0xda13('0x49')](_0x1deec8[_0x4d239f]['status'])){this[_0xda13('0x2')]+=0x1;}switch(_0x1deec8[_0x4d239f][_0xda13('0x4a')]){case'0':this['unknown']+=0x1;break;case'1':this[_0xda13('0x1b')]+=0x1;break;case'2':this[_0xda13('0x17')]+=0x1;break;case'3':this[_0xda13('0x16')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0xda13('0x20')]+=0x1;break;case'6':this[_0xda13('0x1c')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0xda13('0x1a')]+=0x1;break;}}if(this[_0xda13('0x4b')]==='booked'){var _0x18a88e=Object[_0xda13('0x4c')](_0x5a261a);for(var _0x449a3c=0x0;_0x449a3c<_0x18a88e[_0xda13('0x47')];_0x449a3c++){var _0x359770=_0x18a88e[_0x449a3c];var _0x3f8d15=_0x5a261a[_0x359770];if(_0x3f8d15[_0xda13('0x4d')]===this[_0xda13('0x13')]&&_0x3f8d15[_0xda13('0x1f')]==='dialer'&&_0x3f8d15[_0xda13('0x4e')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this['talking']>this[_0xda13('0x17')]){this[_0xda13('0x3')]=this[_0xda13('0x17')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xda13('0x43')][_0xda13('0x4f')]=function(_0x3158c7){var _0x5c200e=![];if(_0x3158c7){_0x5c200e=INBOUND_COUNTERS[_0xda13('0x50')](function(_0x4099d7){return this[_0x4099d7]!==_0x3158c7[_0x4099d7];},this);}return _0x5c200e;};VoiceQueueSummary[_0xda13('0x43')]['compareToOutboundQueue']=function(_0x3d558e){var _0x5deecf=![];var _0x5d3a84=![];var _0x4f97e3=![];if(_0x3d558e){_0x5deecf=this[_0xda13('0x4b')]!==_0x3d558e[_0xda13('0x4b')]||this[_0xda13('0x24')]!==_0x3d558e[_0xda13('0x24')]||this[_0xda13('0x3e')]!==_0x3d558e[_0xda13('0x3e')]||this['statusMessage']!==_0x3d558e['statusMessage'];_0x5d3a84=OUTBOUND_COUNTERS[_0xda13('0x50')](function(_0x360f87){return this[_0x360f87]!==_0x3d558e[_0x360f87];},this);if(this[_0xda13('0x40')]&&_0x3d558e[_0xda13('0x40')]){_0x4f97e3=this[_0xda13('0x40')][_0xda13('0x13')]!==_0x3d558e['Trunk'][_0xda13('0x13')]||this[_0xda13('0x40')][_0xda13('0x41')]!==_0x3d558e[_0xda13('0x40')][_0xda13('0x41')];}}return _0x5deecf||_0x5d3a84||_0x4f97e3;};VoiceQueueSummary[_0xda13('0x43')][_0xda13('0x51')]=function(_0x421638){this[_0xda13('0x4')]=_0x421638[_0xda13('0x4')];this[_0xda13('0x3e')]=_0x421638[_0xda13('0x3e')];this['statusMessage']=_0x421638['statusMessage'];this[_0xda13('0x5')]=_0x421638['originated'];this[_0xda13('0x52')]=_0x421638['outboundAbandonedCallsDay'];this['outboundAnswerCallsDay']=_0x421638['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x421638[_0xda13('0x7')];this[_0xda13('0x8')]=_0x421638[_0xda13('0x8')];this[_0xda13('0x2b')]=_0x421638[_0xda13('0x2b')];this[_0xda13('0x9')]=_0x421638['outboundNoAnswerCallsDay'];this[_0xda13('0xa')]=_0x421638[_0xda13('0xa')];this[_0xda13('0xb')]=_0x421638[_0xda13('0xb')];this['outboundRejectCallsDay']=_0x421638[_0xda13('0xc')];this[_0xda13('0xd')]=_0x421638[_0xda13('0xd')];this[_0xda13('0xf')]=_0x421638[_0xda13('0xf')];this[_0xda13('0x10')]=_0x421638[_0xda13('0x10')];this[_0xda13('0x11')]=_0x421638['total'];if(this[_0xda13('0x4b')]==='preview'){this[_0xda13('0xe')]=_0x421638['pTalking'];}};module[_0xda13('0x53')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 86840b5..9d66d16 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 _0xa518=['name','username','accessKey','remoteUri','Configurations'];(function(_0x2f55c3,_0x6da45e){var _0x958e82=function(_0x42c633){while(--_0x42c633){_0x2f55c3['push'](_0x2f55c3['shift']());}};_0x958e82(++_0x6da45e);}(_0xa518,0x1f4));var _0x8a51=function(_0x3598bb,_0x24befa){_0x3598bb=_0x3598bb-0x0;var _0x13c837=_0xa518[_0x3598bb];return _0x13c837;};'use strict';function VtigerAccount(_0x44b9b4){this['id']=_0x44b9b4['id']||0x0;this[_0x8a51('0x0')]=_0x44b9b4[_0x8a51('0x0')]||'';this['username']=_0x44b9b4[_0x8a51('0x1')]||'';this[_0x8a51('0x2')]=_0x44b9b4['accessKey']||'';this[_0x8a51('0x3')]=_0x44b9b4['remoteUri']||'';this['serverUrl']=_0x44b9b4['serverUrl']||'';this[_0x8a51('0x4')]=_0x44b9b4[_0x8a51('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xbae9=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0x17a756,_0x14a3aa){var _0x48c62d=function(_0x86f8d9){while(--_0x86f8d9){_0x17a756['push'](_0x17a756['shift']());}};_0x48c62d(++_0x14a3aa);}(_0xbae9,0x1b1));var _0x9bae=function(_0x211087,_0x354fdd){_0x211087=_0x211087-0x0;var _0x2a581f=_0xbae9[_0x211087];return _0x2a581f;};'use strict';function VtigerAccount(_0x4fcebb){this['id']=_0x4fcebb['id']||0x0;this[_0x9bae('0x0')]=_0x4fcebb['name']||'';this['username']=_0x4fcebb[_0x9bae('0x1')]||'';this[_0x9bae('0x2')]=_0x4fcebb[_0x9bae('0x2')]||'';this[_0x9bae('0x3')]=_0x4fcebb[_0x9bae('0x3')]||'';this[_0x9bae('0x4')]=_0x4fcebb[_0x9bae('0x4')]||'';this[_0x9bae('0x5')]=_0x4fcebb[_0x9bae('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 0cb8c06..764ca31 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 _0x323a=['integrationTab','serverUrl','Configurations','exports','name','username','token','remoteUri','authType','type'];(function(_0x542e14,_0x5dfd4b){var _0xe3bbb=function(_0x5c2ac7){while(--_0x5c2ac7){_0x542e14['push'](_0x542e14['shift']());}};_0xe3bbb(++_0x5dfd4b);}(_0x323a,0x158));var _0xa323=function(_0x13409a,_0x8f949e){_0x13409a=_0x13409a-0x0;var _0x12815b=_0x323a[_0x13409a];return _0x12815b;};'use strict';function ZendeskAccount(_0x2f8e46){this['id']=_0x2f8e46['id']||0x0;this[_0xa323('0x0')]=_0x2f8e46[_0xa323('0x0')]||'';this[_0xa323('0x1')]=_0x2f8e46[_0xa323('0x1')]||'';this['password']=_0x2f8e46['password']||'';this[_0xa323('0x2')]=_0x2f8e46[_0xa323('0x2')]||'';this[_0xa323('0x3')]=_0x2f8e46['remoteUri']||'';this['authType']=_0x2f8e46[_0xa323('0x4')]||'';this['type']=_0x2f8e46[_0xa323('0x5')]||_0xa323('0x6');this[_0xa323('0x7')]=_0x2f8e46[_0xa323('0x7')]||'';this[_0xa323('0x8')]=_0x2f8e46[_0xa323('0x8')]||{};}module[_0xa323('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x1598=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x590861,_0x42c7f3){var _0x1d0a80=function(_0x42d3de){while(--_0x42d3de){_0x590861['push'](_0x590861['shift']());}};_0x1d0a80(++_0x42c7f3);}(_0x1598,0x85));var _0x8159=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1598[_0x321bb2];return _0x9c12ed;};'use strict';function ZendeskAccount(_0x19dc6e){this['id']=_0x19dc6e['id']||0x0;this[_0x8159('0x0')]=_0x19dc6e['name']||'';this[_0x8159('0x1')]=_0x19dc6e[_0x8159('0x1')]||'';this[_0x8159('0x2')]=_0x19dc6e[_0x8159('0x2')]||'';this[_0x8159('0x3')]=_0x19dc6e[_0x8159('0x3')]||'';this[_0x8159('0x4')]=_0x19dc6e[_0x8159('0x4')]||'';this[_0x8159('0x5')]=_0x19dc6e[_0x8159('0x5')]||'';this[_0x8159('0x6')]=_0x19dc6e['type']||_0x8159('0x7');this[_0x8159('0x8')]=_0x19dc6e['serverUrl']||'';this[_0x8159('0x9')]=_0x19dc6e[_0x8159('0x9')]||{};}module[_0x8159('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 3130e07..58cc33f 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 _0x675e=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x1a465d,_0x3b1bd6){var _0x117526=function(_0x2b7d15){while(--_0x2b7d15){_0x1a465d['push'](_0x1a465d['shift']());}};_0x117526(++_0x3b1bd6);}(_0x675e,0x123));var _0xe675=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x675e[_0x3fa7d3];return _0x4c51bd;};'use strict';function ZohoAccount(_0x2d5fa2){this['id']=_0x2d5fa2['id']||0x0;this[_0xe675('0x0')]=_0x2d5fa2[_0xe675('0x0')]||'';this[_0xe675('0x1')]=_0x2d5fa2['description']||'';this[_0xe675('0x2')]=_0x2d5fa2[_0xe675('0x2')]||'';this[_0xe675('0x3')]=_0x2d5fa2[_0xe675('0x3')]||'';this[_0xe675('0x4')]=_0x2d5fa2[_0xe675('0x4')]||'';this[_0xe675('0x5')]=_0x2d5fa2[_0xe675('0x5')]||'';this[_0xe675('0x6')]=_0x2d5fa2[_0xe675('0x6')]||'';this[_0xe675('0x7')]=_0x2d5fa2[_0xe675('0x7')]||'';this[_0xe675('0x8')]=_0x2d5fa2[_0xe675('0x8')]||'';this['Configurations']=_0x2d5fa2[_0xe675('0x9')]||{};}module[_0xe675('0xa')]=ZohoAccount; \ No newline at end of file +var _0x5406=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x4187d7,_0x26adcb){var _0x46448e=function(_0x1bd615){while(--_0x1bd615){_0x4187d7['push'](_0x4187d7['shift']());}};_0x46448e(++_0x26adcb);}(_0x5406,0x67));var _0x6540=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x5406[_0x236d24];return _0x1574cf;};'use strict';function ZohoAccount(_0x4da5a3){this['id']=_0x4da5a3['id']||0x0;this[_0x6540('0x0')]=_0x4da5a3['name']||'';this['description']=_0x4da5a3[_0x6540('0x1')]||'';this[_0x6540('0x2')]=_0x4da5a3[_0x6540('0x2')]||'';this['zone']=_0x4da5a3[_0x6540('0x3')]||'';this[_0x6540('0x4')]=_0x4da5a3[_0x6540('0x4')]||'';this[_0x6540('0x5')]=_0x4da5a3[_0x6540('0x5')]||'';this[_0x6540('0x6')]=_0x4da5a3[_0x6540('0x6')]||'';this[_0x6540('0x7')]=_0x4da5a3[_0x6540('0x7')]||'';this[_0x6540('0x8')]=_0x4da5a3[_0x6540('0x8')]||'';this[_0x6540('0x9')]=_0x4da5a3['Configurations']||{};}module[_0x6540('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 29bdc9f..ff64644 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 _0x7708=['uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','string','isNil'];(function(_0x9aae92,_0x4120cd){var _0xb742de=function(_0x33352d){while(--_0x33352d){_0x9aae92['push'](_0x9aae92['shift']());}};_0xb742de(++_0x4120cd);}(_0x7708,0x188));var _0x8770=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x7708[_0x160248];return _0x4e589d;};'use strict';var util=require(_0x8770('0x0'));var _=require(_0x8770('0x1'));var moment=require('moment');function checkNameSurname(_0x141ddf,_0x5a8b5b,_0x5ca46f){var _0x555477='';if(!_['isNil'](_0x5a8b5b)&&_0x8770('0x2')===typeof _0x5a8b5b){_0x555477+=_0x5a8b5b;}if(!_[_0x8770('0x3')](_0x5ca46f)&&'string'===typeof _0x5ca46f){_0x555477+='\x20'+_0x5ca46f;}if(_0x555477!==''){return _0x555477;}return _0x141ddf;}function Action(_0x40d401,_0x50bab7,_0x31390d,_0x42d305,_0x2b0295){this[_0x8770('0x4')]=_0x31390d||undefined;this[_0x8770('0x5')]=_0x40d401['id'];this[_0x8770('0x6')]=_0x50bab7[_0x8770('0x7')];this['type']=_0x50bab7[_0x8770('0x8')];this[_0x8770('0x9')]=_0x8770('0x6');this['dialAnswer']=![];this[_0x8770('0xa')]=_[_0x8770('0x3')](_0x40d401[_0x8770('0xb')])?undefined:_0x40d401[_0x8770('0xb')]['name'];this[_0x8770('0xc')]=this[_0x8770('0xa')]?util[_0x8770('0xd')]('SIP/%s',this[_0x8770('0xa')]):_0x42d305||undefined;this[_0x8770('0xe')]=checkNameSurname(_0x40d401[_0x8770('0xf')][_0x8770('0x10')],_0x40d401[_0x8770('0xf')][_0x8770('0x11')],_0x40d401[_0x8770('0xf')][_0x8770('0x12')]);this['active']=_0x40d401[_0x8770('0x13')]||![];this[_0x8770('0x14')]=_0x40d401['phone'];this[_0x8770('0x15')]=_0x40d401['scheduledat'];this[_0x8770('0x16')]=_0x40d401['countbusyretry']||0x0;this['countcongestionretry']=_0x40d401['countcongestionretry']||0x0;this[_0x8770('0x17')]=_0x40d401[_0x8770('0x17')]||0x0;this[_0x8770('0x18')]=(_0x40d401[_0x8770('0x16')]||0x0)+(_0x40d401['countcongestionretry']||0x0)+(_0x40d401['countnoanswerretry']||0x0)+(_0x40d401[_0x8770('0x19')]||0x0)+(_0x40d401[_0x8770('0x1a')]||0x0)+(_0x40d401[_0x8770('0x1b')]||0x0)+(_0x40d401[_0x8770('0x1c')]||0x0)+(_0x40d401[_0x8770('0x1d')]||0x0);this['countnosuchnumberretry']=_0x40d401[_0x8770('0x19')]||0x0;this[_0x8770('0x1a')]=_0x40d401[_0x8770('0x1a')]||0x0;this[_0x8770('0x1b')]=_0x40d401['countabandonedretry']||0x0;this['countmachineretry']=_0x40d401[_0x8770('0x1c')]||0x0;this[_0x8770('0x1d')]=_0x40d401[_0x8770('0x1d')]||0x0;this[_0x8770('0x1e')]=_0x40d401[_0x8770('0x1e')];this[_0x8770('0x1f')]=_0x40d401['callbackuniqueid'];this[_0x8770('0x20')]=_0x40d401[_0x8770('0x20')];this[_0x8770('0x21')]=_0x40d401[_0x8770('0x21')];this['ContactId']=_0x40d401[_0x8770('0x22')];this['ListId']=_0x40d401[_0x8770('0x23')];this[_0x8770('0x24')]=_[_0x8770('0x3')](_0x40d401[_0x8770('0xb')])?_0x40d401[_0x8770('0x24')]:_0x40d401[_0x8770('0xb')]['id'];this[_0x8770('0x25')]=_0x40d401[_0x8770('0x25')];this[_0x8770('0x26')]='';this[_0x8770('0x27')]='';}Action['prototype'][_0x8770('0x28')]=function(){return util[_0x8770('0xd')](_0x8770('0x29'),this[_0x8770('0xe')],this[_0x8770('0x2a')]);};module[_0x8770('0x2b')]=Action; \ No newline at end of file +var _0x8e3f=['prototype','getCaller','format','\x22%s\x22\x20<%s>','number','util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','firstName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname'];(function(_0xe455e7,_0x29fb65){var _0xfc683e=function(_0x10ee38){while(--_0x10ee38){_0xe455e7['push'](_0xe455e7['shift']());}};_0xfc683e(++_0x29fb65);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var util=require(_0xf8e3('0x0'));var _=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));function checkNameSurname(_0x4d334a,_0x3f3440,_0x292de5){var _0x3b07a5='';if(!_['isNil'](_0x3f3440)&&_0xf8e3('0x3')===typeof _0x3f3440){_0x3b07a5+=_0x3f3440;}if(!_[_0xf8e3('0x4')](_0x292de5)&&'string'===typeof _0x292de5){_0x3b07a5+='\x20'+_0x292de5;}if(_0x3b07a5!==''){return _0x3b07a5;}return _0x4d334a;}function Action(_0x35e88f,_0xb21f8d,_0x2621c5,_0x1ee9f3,_0x4e9e57){this[_0xf8e3('0x5')]=_0x2621c5||undefined;this[_0xf8e3('0x6')]=_0x35e88f['id'];this[_0xf8e3('0x7')]=_0xb21f8d[_0xf8e3('0x8')];this[_0xf8e3('0x9')]=_0xb21f8d[_0xf8e3('0x9')];this[_0xf8e3('0xa')]=_0xf8e3('0x7');this[_0xf8e3('0xb')]=![];this[_0xf8e3('0xc')]=_[_0xf8e3('0x4')](_0x35e88f[_0xf8e3('0xd')])?undefined:_0x35e88f['Agent'][_0xf8e3('0x8')];this[_0xf8e3('0xe')]=this[_0xf8e3('0xc')]?util['format'](_0xf8e3('0xf'),this[_0xf8e3('0xc')]):_0x1ee9f3||undefined;this[_0xf8e3('0x10')]=checkNameSurname(_0x35e88f[_0xf8e3('0x11')]['phone'],_0x35e88f[_0xf8e3('0x11')][_0xf8e3('0x12')],_0x35e88f[_0xf8e3('0x11')]['lastName']);this[_0xf8e3('0x13')]=_0x35e88f['active']||![];this[_0xf8e3('0x14')]=_0x35e88f[_0xf8e3('0x15')];this[_0xf8e3('0x16')]=_0x35e88f['scheduledat'];this['countbusyretry']=_0x35e88f[_0xf8e3('0x17')]||0x0;this[_0xf8e3('0x18')]=_0x35e88f[_0xf8e3('0x18')]||0x0;this[_0xf8e3('0x19')]=_0x35e88f[_0xf8e3('0x19')]||0x0;this[_0xf8e3('0x1a')]=(_0x35e88f[_0xf8e3('0x17')]||0x0)+(_0x35e88f[_0xf8e3('0x18')]||0x0)+(_0x35e88f[_0xf8e3('0x19')]||0x0)+(_0x35e88f[_0xf8e3('0x1b')]||0x0)+(_0x35e88f['countdropretry']||0x0)+(_0x35e88f[_0xf8e3('0x1c')]||0x0)+(_0x35e88f[_0xf8e3('0x1d')]||0x0)+(_0x35e88f[_0xf8e3('0x1e')]||0x0);this[_0xf8e3('0x1b')]=_0x35e88f[_0xf8e3('0x1b')]||0x0;this[_0xf8e3('0x1f')]=_0x35e88f[_0xf8e3('0x1f')]||0x0;this[_0xf8e3('0x1c')]=_0x35e88f['countabandonedretry']||0x0;this[_0xf8e3('0x1d')]=_0x35e88f[_0xf8e3('0x1d')]||0x0;this[_0xf8e3('0x1e')]=_0x35e88f[_0xf8e3('0x1e')]||0x0;this['callback']=_0x35e88f[_0xf8e3('0x20')];this['callbackuniqueid']=_0x35e88f[_0xf8e3('0x21')];this[_0xf8e3('0x22')]=_0x35e88f[_0xf8e3('0x22')];this[_0xf8e3('0x23')]=_0x35e88f[_0xf8e3('0x23')];this[_0xf8e3('0x24')]=_0x35e88f['ContactId'];this[_0xf8e3('0x25')]=_0x35e88f[_0xf8e3('0x25')];this[_0xf8e3('0x26')]=_[_0xf8e3('0x4')](_0x35e88f[_0xf8e3('0xd')])?_0x35e88f[_0xf8e3('0x26')]:_0x35e88f[_0xf8e3('0xd')]['id'];this[_0xf8e3('0x27')]=_0x35e88f['VoiceQueueId'];this[_0xf8e3('0x28')]='';this[_0xf8e3('0x29')]='';}Action[_0xf8e3('0x2a')][_0xf8e3('0x2b')]=function(){return util[_0xf8e3('0x2c')](_0xf8e3('0x2d'),this[_0xf8e3('0x10')],this[_0xf8e3('0x2e')]);};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 650527e..92fa9b1 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 _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x34b7e1,_0x41f84d){var _0x56fba3=function(_0xf0cd21){while(--_0xf0cd21){_0x34b7e1['push'](_0x34b7e1['shift']());}};_0x56fba3(++_0x41f84d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x874714,_0x2bdb09){var _0x5b01b4=function(_0x447e42){while(--_0x447e42){_0x874714['push'](_0x874714['shift']());}};_0x5b01b4(++_0x2bdb09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 3535771..2f91798 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 _0xaeba=['bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','createHistory','catch','[createHistory]\x20','resolve','then','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0xaeba,0x1e5));var _0xaaeb=function(_0x86ac62,_0x311ef0){_0x86ac62=_0x86ac62-0x0;var _0x4c9b95=_0xaeba[_0x86ac62];return _0x4c9b95;};'use strict';var util=require(_0xaaeb('0x0'));var BPromise=require(_0xaaeb('0x1'));var logger=require(_0xaaeb('0x2'))('preview');var cmHopper=require(_0xaaeb('0x3'));var cmHopperHistory=require(_0xaaeb('0x4'));var cmHopperBlack=require(_0xaaeb('0x5'));var agentReportPreview=require(_0xaaeb('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x20a62b){return function(_0x1e566a){logger[_0xaaeb('0x7')](_0x20a62b,util[_0xaaeb('0x8')](_0x1e566a,{'showHidden':![],'depth':null}));};}function create(_0x4f60a6){return cmHopperHistory[_0xaaeb('0x9')](_0x4f60a6)[_0xaaeb('0xa')](loggerCatch(_0xaaeb('0xb')));}function createAgent(_0x5cb398){return BPromise[_0xaaeb('0xc')]()[_0xaaeb('0xd')](agentReportPreview[_0xaaeb('0x9')](_0x5cb398))[_0xaaeb('0xa')](loggerCatch(_0xaaeb('0xb')));}function moveContact(_0x2e34fd){return cmHopper['moveContactManagedDialer'](_0x2e34fd,!![])[_0xaaeb('0xa')](loggerCatch(_0xaaeb('0xe')));}exports[_0xaaeb('0xf')]=function(_0x12a2b2){return cmHopperBlack[_0xaaeb('0xf')](_0x12a2b2)['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xaaeb('0x10')]=function(_0x5253c8){return BPromise[_0xaaeb('0xc')]()['then'](cmHopper[_0xaaeb('0x10')](_0x5253c8))['catch'](loggerCatch(_0xaaeb('0x11')));};exports[_0xaaeb('0x9')]=function(_0x31b862,_0x4720f3){create(_0x31b862)[_0xaaeb('0xa')](loggerCatch(_0x4720f3));moveContact(_0x31b862)[_0xaaeb('0xa')](loggerCatch(_0x4720f3));};exports['createAgentHistory']=function(_0x2bd40d,_0x43b6b6){createAgent(_0x2bd40d)['catch'](loggerCatch(_0x43b6b6));};exports[_0xaaeb('0x12')]=function(_0x56c23d,_0x538f0f){create(_0x56c23d)[_0xaaeb('0xa')](loggerCatch(_0x538f0f));};exports[_0xaaeb('0x13')]=function(_0x3bf25b,_0x4ec19a){moveContact(_0x3bf25b)[_0xaaeb('0xa')](loggerCatch(_0x4ec19a));};exports[_0xaaeb('0x14')]=function(_0x127848,_0x102f14,_0x4f7887){if(_0x102f14){_0x127848['UserId']=null;}if(_0x4f7887){_0x127848[_0xaaeb('0x15')]=![];}return cmHopper[_0xaaeb('0x14')](_0x127848)['catch'](loggerCatch(_0xaaeb('0x16')));};exports[_0xaaeb('0x17')]=function(_0x498e3a){return cmHopper[_0xaaeb('0x17')](_0x498e3a)[_0xaaeb('0xa')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x4ba9cf){return cmHopper[_0xaaeb('0x18')]({'UserId':null},_0x4ba9cf,0x1)['catch'](loggerCatch(_0xaaeb('0x19')));};exports[_0xaaeb('0x1a')]=function(_0x44513c){return cmHopper['unlockContact']({'active':![]},_0x44513c,0x1)[_0xaaeb('0xa')](loggerCatch(_0xaaeb('0x1b')));};exports[_0xaaeb('0x1c')]=function(_0x32c072){var _0xb9784b={};_0xb9784b['type']=_0x32c072[_0xaaeb('0x1d')];_0xb9784b[_0xaaeb('0x1e')]=_0x32c072['uniqueid'];_0xb9784b[_0xaaeb('0x1f')]=_0x32c072[_0xaaeb('0x1f')];_0xb9784b[_0xaaeb('0x20')]=_0x32c072[_0xaaeb('0x20')];_0xb9784b[_0xaaeb('0x21')]=_0x32c072[_0xaaeb('0x21')];_0xb9784b[_0xaaeb('0x22')]=_0x32c072['answertime'];_0xb9784b[_0xaaeb('0x23')]=_0x32c072[_0xaaeb('0x24')];_0xb9784b[_0xaaeb('0x25')]=0x1;_0xb9784b[_0xaaeb('0x26')]=_0x32c072[_0xaaeb('0x27')];_0xb9784b[_0xaaeb('0x28')]=_0x32c072[_0xaaeb('0x29')];_0xb9784b['context']='from-sip';_0xb9784b[_0xaaeb('0x2a')]='xcally-motion-preview';_0xb9784b[_0xaaeb('0x2b')]=0x0;_0xb9784b[_0xaaeb('0x2c')]=0x1;_0xb9784b[_0xaaeb('0x2d')]=_0x32c072[_0xaaeb('0x29')];_0xb9784b[_0xaaeb('0x2e')]=_0xaaeb('0x2f');return BPromise[_0xaaeb('0xc')]()[_0xaaeb('0xd')](voiceQueueReport[_0xaaeb('0x30')](_0xb9784b))[_0xaaeb('0xa')](loggerCatch(_0xaaeb('0x31')));};exports[_0xaaeb('0x32')]=function(_0x42ce40,_0x10e3a5){return BPromise[_0xaaeb('0xc')]()['then'](cmHopper['getContactRecallMe'](_0x42ce40,_0x10e3a5))[_0xaaeb('0xa')](loggerCatch(_0xaaeb('0x33')));};exports[_0xaaeb('0x34')]=function(_0x4ed7f6){return cmHopper[_0xaaeb('0x14')](_0x4ed7f6,!![],!![])['catch'](loggerCatch(_0xaaeb('0x35')));}; \ No newline at end of file +var _0x9bb0=['[checkIsBlackList]\x20','then','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','endtime','connectedlinename','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','preview','../rpc/cmHopper','../rpc/agentReportPreview','error','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList'];(function(_0x47c28c,_0x2e333a){var _0x42337b=function(_0x481125){while(--_0x481125){_0x47c28c['push'](_0x47c28c['shift']());}};_0x42337b(++_0x2e333a);}(_0x9bb0,0x1b7));var _0x09bb=function(_0x331b08,_0x2c5937){_0x331b08=_0x331b08-0x0;var _0x5034d9=_0x9bb0[_0x331b08];return _0x5034d9;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x09bb('0x0'));var cmHopper=require(_0x09bb('0x1'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x09bb('0x2'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0xa67bd8){return function(_0x2ff9a0){logger[_0x09bb('0x3')](_0xa67bd8,util['inspect'](_0x2ff9a0,{'showHidden':![],'depth':null}));};}function create(_0x3f907f){return cmHopperHistory[_0x09bb('0x4')](_0x3f907f)[_0x09bb('0x5')](loggerCatch(_0x09bb('0x6')));}function createAgent(_0x143d74){return BPromise[_0x09bb('0x7')]()['then'](agentReportPreview[_0x09bb('0x4')](_0x143d74))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0xcfd4b9){return cmHopper[_0x09bb('0x8')](_0xcfd4b9,!![])['catch'](loggerCatch(_0x09bb('0x9')));}exports[_0x09bb('0xa')]=function(_0x58747e){return cmHopperBlack[_0x09bb('0xa')](_0x58747e)[_0x09bb('0x5')](loggerCatch(_0x09bb('0xb')));};exports['getContactPreview']=function(_0x2935b3){return BPromise['resolve']()[_0x09bb('0xc')](cmHopper[_0x09bb('0xd')](_0x2935b3))[_0x09bb('0x5')](loggerCatch(_0x09bb('0xe')));};exports['createHistory']=function(_0x370669,_0x4a10f2){create(_0x370669)[_0x09bb('0x5')](loggerCatch(_0x4a10f2));moveContact(_0x370669)[_0x09bb('0x5')](loggerCatch(_0x4a10f2));};exports[_0x09bb('0xf')]=function(_0x2eb595,_0x4b4508){createAgent(_0x2eb595)[_0x09bb('0x5')](loggerCatch(_0x4b4508));};exports[_0x09bb('0x10')]=function(_0x4ecc88,_0x103309){create(_0x4ecc88)[_0x09bb('0x5')](loggerCatch(_0x103309));};exports[_0x09bb('0x11')]=function(_0x2bc415,_0x32b306){moveContact(_0x2bc415)[_0x09bb('0x5')](loggerCatch(_0x32b306));};exports[_0x09bb('0x12')]=function(_0x427574,_0x1a6bda,_0x2dc686){if(_0x1a6bda){_0x427574[_0x09bb('0x13')]=null;}if(_0x2dc686){_0x427574[_0x09bb('0x14')]=![];}return cmHopper['rescheduleContact'](_0x427574)[_0x09bb('0x5')](loggerCatch(_0x09bb('0x15')));};exports['countReScheduled']=function(_0xe67f02){return cmHopper[_0x09bb('0x16')](_0xe67f02)['catch'](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x2f5ef7){return cmHopper['unlockContact']({'UserId':null},_0x2f5ef7,0x1)[_0x09bb('0x5')](loggerCatch(_0x09bb('0x17')));};exports[_0x09bb('0x18')]=function(_0x39d42a){return cmHopper[_0x09bb('0x19')]({'active':![]},_0x39d42a,0x1)['catch'](loggerCatch(_0x09bb('0x1a')));};exports[_0x09bb('0x1b')]=function(_0x6df545){var _0x532350={};_0x532350[_0x09bb('0x1c')]=_0x6df545[_0x09bb('0x1c')];_0x532350[_0x09bb('0x1d')]=_0x6df545['uniqueid'];_0x532350['calleridnum']=_0x6df545['calleridnum'];_0x532350[_0x09bb('0x1e')]=_0x6df545['calleridname'];_0x532350['queue']=_0x6df545[_0x09bb('0x1f')];_0x532350[_0x09bb('0x20')]=_0x6df545[_0x09bb('0x21')];_0x532350['queuecallerleaveAt']=_0x6df545[_0x09bb('0x21')];_0x532350['queuecallercomplete']=0x1;_0x532350[_0x09bb('0x22')]=_0x6df545[_0x09bb('0x23')];_0x532350[_0x09bb('0x24')]=_0x6df545['membername'];_0x532350['context']=_0x09bb('0x25');_0x532350['exten']=_0x09bb('0x26');_0x532350[_0x09bb('0x27')]=0x0;_0x532350[_0x09bb('0x28')]=0x1;_0x532350[_0x09bb('0x29')]=_0x6df545[_0x09bb('0x2a')];_0x532350[_0x09bb('0x2b')]='COMPLETED';return BPromise[_0x09bb('0x7')]()[_0x09bb('0xc')](voiceQueueReport[_0x09bb('0x2c')](_0x532350))[_0x09bb('0x5')](loggerCatch(_0x09bb('0x2d')));};exports['getContactRecallMe']=function(_0x19ffdd,_0x5eabfa){return BPromise[_0x09bb('0x7')]()['then'](cmHopper[_0x09bb('0x2e')](_0x19ffdd,_0x5eabfa))['catch'](loggerCatch(_0x09bb('0x2f')));};exports[_0x09bb('0x30')]=function(_0x55da0e){return cmHopper[_0x09bb('0x12')](_0x55da0e,!![],!![])['catch'](loggerCatch(_0x09bb('0x31')));}; \ 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 2f852fe..a40d071 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 _0x64ec=['monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','responsetime','ringtime','getSeconds','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','push','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','queue','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','keys','variables','forEach','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger2','info','message','getCallerId','isUndefined','string','isEmpty','\x22\x22\x20<>','isActive','isNil','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','dialer','dialOriginateTimeout','format','dialQueueProject2'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0x64ec,0x191));var _0xc64e=function(_0x2f7727,_0x3942dd){_0x2f7727=_0x2f7727-0x0;var _0x18a9d6=_0x64ec[_0x2f7727];return _0x18a9d6;};'use strict';var util=require(_0xc64e('0x0'));var _=require(_0xc64e('0x1'));var moment=require(_0xc64e('0x2'));var logger=require(_0xc64e('0x3'))(_0xc64e('0x4'));var ipAgi=process[_0xc64e('0x5')][_0xc64e('0x6')]||_0xc64e('0x7');var utils=require(_0xc64e('0x8'));exports[_0xc64e('0x9')]=function(_0x557604){return function(_0x4a1504){logger[_0xc64e('0xa')](_0x557604,util[_0xc64e('0xb')](_0x4a1504,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x2d66cf,_0x4d4c24){logger['info'](_0x2d66cf,util[_0xc64e('0xb')](_0x4d4c24,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3d6860,_0x436a2d){logger[_0xc64e('0xa')](_0x3d6860,util['inspect'](_0x436a2d,{'showHidden':![],'depth':null}));};exports[_0xc64e('0xc')]=function(_0x59d763){return function(_0x1ebbe6){logger[_0xc64e('0xd')](_0x59d763,util['inspect'](_0x1ebbe6,{'showHidden':![],'depth':null}));};};exports[_0xc64e('0xe')]=function(_0x5e99f9,_0x114690,_0x3ca226){return{'message':_0x5e99f9,'unlock':_0x114690,'active':_0x3ca226};};exports[_0xc64e('0xf')]=function(_0x5ef8fe,_0xb42bc6,_0xa8421f){if(!_[_0xc64e('0x10')](_0xa8421f)&&_0xc64e('0x11')===typeof _0xa8421f&&!_[_0xc64e('0x12')](_0xa8421f)){if(!_['isUndefined'](_0xb42bc6)&&_0xc64e('0x11')===typeof _0xb42bc6&&!_[_0xc64e('0x12')](_0xb42bc6)){return util['format']('\x22%s\x22\x20<%s>',_0xb42bc6,_0xa8421f);}return util['format']('\x22%s\x22\x20<%s>',_0xa8421f,_0xa8421f);}if(!_[_0xc64e('0x10')](_0x5ef8fe)&&_0xc64e('0x11')===typeof _0x5ef8fe&&!_[_0xc64e('0x12')](_0x5ef8fe)){return _0x5ef8fe;}return _0xc64e('0x13');};exports[_0xc64e('0x14')]=function(_0xc244b2){if(_[_0xc64e('0x15')](_0xc244b2)){return![];}return _0xc244b2;};exports['addVariables']=function(_0x44e3da,_0x500ebd,_0x3d824c,_0x387bce,_0x54a049,_0x5a4998){var _0x599170={'XMD-QUEUE':_0x500ebd['Queue']?_0x500ebd[_0xc64e('0x16')][_0xc64e('0x17')]:'','XMD-CALLERID':_0x387bce,'XMD-CALLERID-PREVIEW':_0x5a4998?util['format'](_0xc64e('0x18'),_0x5a4998[_0xc64e('0x19')],_0x5a4998[_0xc64e('0x1a')]):_0x387bce,'XMD-DIALID':_0x54a049,'XMD-CONTACTID':_0x500ebd['ContactId'],'XMD-CDRTYPE':_0xc64e('0x1b'),'CALLERID(all)':_0x387bce,'XMD-VOICEQUEUEID':_0x500ebd['VoiceQueueId'],'XMD-DIALCHANNEL':_0x3d824c,'XMD-DIALTIMEOUT':_0x44e3da[_0xc64e('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xc64e('0x1d')]('\x22rtTxX%s%s\x22',_0x44e3da[_0xc64e('0x1e')]?'g':'',_[_0xc64e('0x12')](_0x44e3da[_0xc64e('0x1f')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x44e3da[_0xc64e('0x20')]||'','XMD-AGI':_0x44e3da[_0xc64e('0x21')]?util[_0xc64e('0x1d')]('\x22agi://%s/square,%s\x22',ipAgi,_0x44e3da[_0xc64e('0x21')]):'NONE','XMD-AGIAFTER':_0x44e3da[_0xc64e('0x1e')]?util[_0xc64e('0x1d')](_0xc64e('0x22'),ipAgi,_0x44e3da['dialQueueProject2']):_0xc64e('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x5a4998?_0x5a4998[_0xc64e('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x5a4998?_0x5a4998[_0xc64e('0x25')]:'','XMD-DESTINATION':_0xc64e('0x26'),'SIPADDHEADER':_0xc64e('0x27')};if(!_['isEmpty'](_0x44e3da[_0xc64e('0x1f')])){_0x599170[util[_0xc64e('0x1d')]('%s',_0xc64e('0x28'))]=_0x44e3da[_0xc64e('0x1f')];_0x599170[util[_0xc64e('0x1d')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x54a049;}return _0x599170;};exports['toLowerVariables']=function(_0x3176c7){var _0xadf225={};for(var _0x46c8b7 in _0x3176c7){if(_0x3176c7[_0xc64e('0x29')](_0x46c8b7)){_0xadf225[util[_0xc64e('0x1d')]('%s',_[_0xc64e('0x2a')](_0x46c8b7))]=_0x3176c7[_0x46c8b7];}}return{'variables':_0xadf225};};exports[_0xc64e('0x2b')]=function(_0x3920b5,_0xde42e0){if(!_[_0xc64e('0x15')](_0x3920b5)){if(_0x3920b5[_0xc64e('0x29')](_0xc64e('0x2c'))){if(_0x3920b5[_0xc64e('0x2c')]>0x0){_0x3920b5[_0xc64e('0x2c')]-=0x1;}else{logger[_0xc64e('0xa')](_0xc64e('0x2d'),_0xde42e0);}}}else{logger[_0xc64e('0xa')](_0xc64e('0x2e'),_0xde42e0);}};exports[_0xc64e('0x2f')]=function(_0x5477e2){var _0x41f751=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5477e2[_0xc64e('0x30')]=0xd;_0x5477e2[_0xc64e('0x31')]=_0xc64e('0x32');_0x5477e2['starttime']=_0x41f751;_0x5477e2['responsetime']=_0x41f751;_0x5477e2[_0xc64e('0x33')]=_0x41f751;};exports[_0xc64e('0x34')]=function(_0x34f659,_0x4d3b53,_0xadf4a0){var _0xaed1ce=moment()[_0xc64e('0x1d')](_0xc64e('0x35'));_0x34f659[_0xc64e('0x30')]=_0x4d3b53;_0x34f659['statedesc']=_0xadf4a0;_0x34f659[_0xc64e('0x36')]=_0xaed1ce;_0x34f659[_0xc64e('0x37')]=utils[_0xc64e('0x38')](_0x34f659[_0xc64e('0x36')],_0x34f659[_0xc64e('0x39')]);};exports[_0xc64e('0x3a')]=function(_0x220d8d,_0x1d627a,_0x203889){_0x220d8d[_0xc64e('0x3b')]=_0x1d627a;_0x220d8d[_0xc64e('0x3c')]=_0x203889;};exports[_0xc64e('0x3d')]=function(_0x36aae5,_0x2514ab,_0xf15110){var _0x54da07=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x36aae5[_0xc64e('0x30')]=_0x2514ab;_0x36aae5[_0xc64e('0x31')]=_0xf15110;_0x36aae5['responsetime']=_0x36aae5[_0xc64e('0x36')]?_0x36aae5[_0xc64e('0x36')]:_0x54da07;_0x36aae5[_0xc64e('0x33')]=_0x36aae5[_0xc64e('0x33')]?_0x36aae5[_0xc64e('0x33')]:_0x54da07;_0x36aae5['ringtime']=utils['getSeconds'](_0x36aae5[_0xc64e('0x36')]||0x0,_0x36aae5[_0xc64e('0x39')]||0x0);_0x36aae5[_0xc64e('0x3e')]=_0x36aae5[_0xc64e('0x3f')]?utils[_0xc64e('0x38')](_0x36aae5[_0xc64e('0x33')],_0x36aae5[_0xc64e('0x3f')]):0x0;};exports[_0xc64e('0x40')]=function(_0x2126e5){return _0x2126e5==='Failure';};exports['variablesAction']=function(_0x181df6,_0x5a3c81,_0x163658,_0x494e08,_0x55ed36){var _0x41348d=_0x494e08?_0xc64e('0x41'):_0x181df6['calleridname'];_0x41348d=_0x55ed36?'BOOKED':_0x41348d;return{'actionid':_0x181df6[_0xc64e('0x42')],'action':_0xc64e('0x43'),'channel':_0x181df6[_0xc64e('0x44')],'callerid':util['format'](_0xc64e('0x18'),_0x41348d,_0x181df6[_0xc64e('0x1a')]),'Exten':'xcally-motion-preview','Context':_0xc64e('0x45'),'Priority':'1','variable':_0x163658,'timeout':(_0x5a3c81[_0xc64e('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x181df6[_0xc64e('0x42')]};};exports[_0xc64e('0x47')]=function(_0x2323ba){return _0x2323ba[_0xc64e('0x48')]+_0x2323ba[_0xc64e('0x49')]+_0x2323ba[_0xc64e('0x4a')]+_0x2323ba[_0xc64e('0x4b')]+_0x2323ba['countnosuchnumberretry'];};exports[_0xc64e('0x4c')]=function(_0x111635){var _0x43bc72=_['clone'](_0x111635);_0x43bc72[_0xc64e('0x30')]=0xf;_0x43bc72[_0xc64e('0x31')]=_0xc64e('0x4d');return _0x43bc72;};exports[_0xc64e('0x4e')]=function(_0x2b7b41,_0x4cf747,_0x1bd507){var _0x1543ce={};_0x1543ce[_0x4cf747]=_0x2b7b41[_0x4cf747];_0x1543ce[_0xc64e('0x4f')]=![];_0x1543ce[_0xc64e('0x50')]=moment()[_0xc64e('0x51')](_0x1bd507,_0xc64e('0x52'))[_0xc64e('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1543ce[_0xc64e('0x53')]=_0x2b7b41['ContactId'];_0x1543ce['ListId']=_0x2b7b41[_0xc64e('0x54')];_0x1543ce[_0xc64e('0x55')]=_0x2b7b41['VoiceQueueId']||undefined;return _0x1543ce;};exports[_0xc64e('0x56')]=function(_0x55cfc6,_0x11ac68){if(!_[_0xc64e('0x15')](_0x55cfc6)){if(_0x55cfc6[_0xc64e('0x57')]>0x0){_0x55cfc6[_0xc64e('0x57')]-=0x1;}else{logger['error'](_0x11ac68,_0xc64e('0x58'));}}else{logger[_0xc64e('0xa')](_0x11ac68,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xc64e('0x59')]=function(_0x447987){if(_0x447987<=0x0){return!![];}return![];};function buildObj(_0x405dda,_0x5d1255,_0x4310a2){_0x405dda[_0xc64e('0x5a')]=_0x5d1255;_0x405dda[_0xc64e('0x17')]=_0x405dda['queue'];_0x405dda[_0xc64e('0x5b')]=_0x405dda['channelAgent'];_0x405dda[_0xc64e('0x5c')]=_0xc64e('0x5d');if(_0x4310a2){_0x405dda[_0xc64e('0x5e')]=_0x4310a2[_0xc64e('0x5e')];}return _0x405dda;}exports[_0xc64e('0x5f')]=buildObj;exports[_0xc64e('0x60')]=function(_0x3f5620){var _0x6bb99c=[];for(var _0x53a8b2 in _0x3f5620){if(_0x3f5620[_0xc64e('0x29')](_0x53a8b2)){if(!_[_0xc64e('0x15')](_0x3f5620[_0x53a8b2])&&_0x3f5620[_0x53a8b2]['state']===_0xc64e('0x61')&&_0x3f5620[_0x53a8b2][_0xc64e('0x62')]==='reachable'){_0x6bb99c[_0xc64e('0x63')](_0x3f5620[_0x53a8b2]['id']);}}}return _0x6bb99c;};exports[_0xc64e('0x64')]=function(_0x4cd099){var _0x27f382=moment()[_0xc64e('0x65')](0x0);var _0xeadcc5=moment(_0x4cd099)[_0xc64e('0x65')](0x0);return _0x27f382[_0xc64e('0x66')](_0xeadcc5,_0xc64e('0x67'));};exports['createBody']=function(_0x135682){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x135682[_0xc64e('0x53')],'ListId':_0x135682[_0xc64e('0x54')],'VoiceQueueId':_0x135682[_0xc64e('0x55')]||undefined,'CampaignId':_0x135682[_0xc64e('0x68')]||undefined};};exports[_0xc64e('0x69')]=function(_0x18cc2a){if(_0x18cc2a===_0xc64e('0x42')||_0x18cc2a==='idContact'||_0x18cc2a===_0xc64e('0x6a')||_0x18cc2a==='type'||_0x18cc2a==='campaigntype'||_0x18cc2a===_0xc64e('0x6b')||_0x18cc2a==='membername'||_0x18cc2a===_0xc64e('0x44')||_0x18cc2a===_0xc64e('0x19')||_0x18cc2a==='active'||_0x18cc2a==='calleridnum'||_0x18cc2a===_0xc64e('0x50')||_0x18cc2a===_0xc64e('0x48')||_0x18cc2a==='countcongestionretry'||_0x18cc2a==='countnoanswerretry'||_0x18cc2a===_0xc64e('0x6c')||_0x18cc2a===_0xc64e('0x6d')||_0x18cc2a===_0xc64e('0x6e')||_0x18cc2a===_0xc64e('0x6f')||_0x18cc2a===_0xc64e('0x70')||_0x18cc2a===_0xc64e('0x53')||_0x18cc2a===_0xc64e('0x54')||_0x18cc2a===_0xc64e('0x3c')||_0x18cc2a===_0xc64e('0x55')||_0x18cc2a==='sipcallid'||_0x18cc2a===_0xc64e('0x71')||_0x18cc2a===_0xc64e('0x72')||_0x18cc2a==='xmd-phone'||_0x18cc2a===_0xc64e('0x73')||_0x18cc2a==='xmd-dialurl'||_0x18cc2a===_0xc64e('0x74')||_0x18cc2a===_0xc64e('0x75')||_0x18cc2a==='xmd-dialid'||_0x18cc2a===_0xc64e('0x76')||_0x18cc2a==='xmd-contactid'||_0x18cc2a===_0xc64e('0x77')||_0x18cc2a==='xmd-callerid'||_0x18cc2a==='xmd-agiafter'||_0x18cc2a===_0xc64e('0x78')||_0x18cc2a===_0xc64e('0x79')||_0x18cc2a==='rtpaudioqosbridged'||_0x18cc2a===_0xc64e('0x7a')||_0x18cc2a===_0xc64e('0x7b')||_0x18cc2a===_0xc64e('0x7c')||_0x18cc2a===_0xc64e('0x7d')||_0x18cc2a===_0xc64e('0x7e')||_0x18cc2a==='rtpaudioqosrttbridged'||_0x18cc2a==='rtpaudioqos'||_0x18cc2a===_0xc64e('0x7f')||_0x18cc2a===_0xc64e('0x7a')||_0x18cc2a===_0xc64e('0x7b')||_0x18cc2a===_0xc64e('0x7c')||_0x18cc2a===_0xc64e('0x7d')||_0x18cc2a===_0xc64e('0x7e')||_0x18cc2a===_0xc64e('0x80')||_0x18cc2a===_0xc64e('0x81')||_0x18cc2a===_0xc64e('0x82')||_0x18cc2a===_0xc64e('0x30')||_0x18cc2a===_0xc64e('0x31')){return![];}return!![];};exports[_0xc64e('0x83')]=function(_0x220dd0,_0xcddd02){var _0x14dd01,_0x25a24a,_0x5ab2eb;if(_0xcddd02<=0x0){_0xcddd02=0x1;}_0x14dd01=new RegExp(_0xc64e('0x84')+_0xcddd02+'}$');_0x25a24a=Math[_0xc64e('0x85')](0xa,_0xcddd02-0x1);_0x5ab2eb=Math[_0xc64e('0x85')](0xa,_0xcddd02)-0x1;return util[_0xc64e('0x1d')]('%s',_[_0xc64e('0x86')](_0x220dd0,_0x14dd01,_[_0xc64e('0x87')](_0x25a24a,_0x5ab2eb)));};exports[_0xc64e('0x88')]=function(_0x2225cd){var _0x2ac396=_0x2225cd[_0xc64e('0x89')](/"(.*?)"/);return _0x2ac396?_0x2ac396[0x1]:_0x2225cd;};exports[_0xc64e('0x8a')]=function(_0x107bab){var _0x50b7ca=_0x107bab[_0xc64e('0x89')](/<(.*?)>/);return _0x50b7ca?_0x50b7ca[0x1]:_0x107bab;};function buildNoAnswerEventPayload(_0x24eaba,_0x33ef38){var _0x40f59b=buildObj(_0x24eaba,_0xc64e('0x8b'));if(!_[_0xc64e('0x12')](_0x33ef38['variables'])){Object[_0xc64e('0x8c')](_0x33ef38[_0xc64e('0x8d')])[_0xc64e('0x8e')](function(_0x1445d0){_0x40f59b[_0x1445d0['toLowerCase']()]=_0x33ef38[_0xc64e('0x8d')][_0x1445d0];});}return _0x40f59b;}exports[_0xc64e('0x8f')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xf0be=['xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','extractCalleridName','match','extractCalleridNumber','variables','keys','toLowerCase','util','lodash','moment','preview','127.0.0.1','../../dialer/utils','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','responsetime','state','ringtime','getSeconds','starttime','UserId','logCustomer','endtime','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','minutes','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','name','queue','interface','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','reachable','milliseconds','diff','seconds','createBody','CampaignId','campaigntype','dialAnswer','membername','active','calleridnum','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions'];(function(_0x49a085,_0x2eed0d){var _0x5878b8=function(_0x7a9b71){while(--_0x7a9b71){_0x49a085['push'](_0x49a085['shift']());}};_0x5878b8(++_0x2eed0d);}(_0xf0be,0x9b));var _0xef0b=function(_0x3921d3,_0x587ed5){_0x3921d3=_0x3921d3-0x0;var _0x3f861c=_0xf0be[_0x3921d3];return _0x3f861c;};'use strict';var util=require(_0xef0b('0x0'));var _=require(_0xef0b('0x1'));var moment=require(_0xef0b('0x2'));var logger=require('../../../../config/logger')(_0xef0b('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xef0b('0x4');var utils=require(_0xef0b('0x5'));exports['loggerCatch']=function(_0x251bae){return function(_0x46e186){logger[_0xef0b('0x6')](_0x251bae,util[_0xef0b('0x7')](_0x46e186,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x44dc74,_0x2d1aeb){logger[_0xef0b('0x8')](_0x44dc74,util[_0xef0b('0x7')](_0x2d1aeb,{'showHidden':![],'depth':null}));};exports[_0xef0b('0x9')]=function(_0x182cc8,_0x43f012){logger[_0xef0b('0x6')](_0x182cc8,util['inspect'](_0x43f012,{'showHidden':![],'depth':null}));};exports[_0xef0b('0xa')]=function(_0x57e9d2){return function(_0x3fe820){logger['info'](_0x57e9d2,util[_0xef0b('0x7')](_0x3fe820,{'showHidden':![],'depth':null}));};};exports[_0xef0b('0xb')]=function(_0x1046e4,_0x422f53,_0xbb6fd0){return{'message':_0x1046e4,'unlock':_0x422f53,'active':_0xbb6fd0};};exports[_0xef0b('0xc')]=function(_0x635a24,_0x533d89,_0x5f504c){if(!_['isUndefined'](_0x5f504c)&&'string'===typeof _0x5f504c&&!_['isEmpty'](_0x5f504c)){if(!_[_0xef0b('0xd')](_0x533d89)&&_0xef0b('0xe')===typeof _0x533d89&&!_[_0xef0b('0xf')](_0x533d89)){return util[_0xef0b('0x10')](_0xef0b('0x11'),_0x533d89,_0x5f504c);}return util[_0xef0b('0x10')](_0xef0b('0x11'),_0x5f504c,_0x5f504c);}if(!_[_0xef0b('0xd')](_0x635a24)&&'string'===typeof _0x635a24&&!_[_0xef0b('0xf')](_0x635a24)){return _0x635a24;}return _0xef0b('0x12');};exports[_0xef0b('0x13')]=function(_0x52b71f){if(_[_0xef0b('0x14')](_0x52b71f)){return![];}return _0x52b71f;};exports[_0xef0b('0x15')]=function(_0x20602c,_0x542826,_0x413c90,_0x32b502,_0x1cdb50,_0x417d76){var _0x29d152={'XMD-QUEUE':_0x542826[_0xef0b('0x16')]?_0x542826[_0xef0b('0x16')]['name']:'','XMD-CALLERID':_0x32b502,'XMD-CALLERID-PREVIEW':_0x417d76?util[_0xef0b('0x10')](_0xef0b('0x11'),_0x417d76[_0xef0b('0x17')],_0x417d76['calleridnum']):_0x32b502,'XMD-DIALID':_0x1cdb50,'XMD-CONTACTID':_0x542826[_0xef0b('0x18')],'XMD-CDRTYPE':_0xef0b('0x19'),'CALLERID(all)':_0x32b502,'XMD-VOICEQUEUEID':_0x542826[_0xef0b('0x1a')],'XMD-DIALCHANNEL':_0x413c90,'XMD-DIALTIMEOUT':_0x20602c[_0xef0b('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xef0b('0x10')](_0xef0b('0x1c'),_0x20602c[_0xef0b('0x1d')]?'g':'',_[_0xef0b('0xf')](_0x20602c[_0xef0b('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x20602c[_0xef0b('0x1f')]||'','XMD-AGI':_0x20602c['dialQueueProject']?util[_0xef0b('0x10')](_0xef0b('0x20'),ipAgi,_0x20602c[_0xef0b('0x21')]):_0xef0b('0x22'),'XMD-AGIAFTER':_0x20602c[_0xef0b('0x1d')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x20602c[_0xef0b('0x1d')]):_0xef0b('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x417d76?_0x417d76[_0xef0b('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x417d76?_0x417d76['originatecalleridname']:'','XMD-DESTINATION':_0xef0b('0x24'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xef0b('0xf')](_0x20602c[_0xef0b('0x1e')])){_0x29d152[util[_0xef0b('0x10')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x20602c[_0xef0b('0x1e')];_0x29d152[util[_0xef0b('0x10')]('%s',_0xef0b('0x25'))]=_0x1cdb50;}return _0x29d152;};exports[_0xef0b('0x26')]=function(_0x198186){var _0xbe9221={};for(var _0x187af5 in _0x198186){if(_0x198186[_0xef0b('0x27')](_0x187af5)){_0xbe9221[util[_0xef0b('0x10')]('%s',_['toLower'](_0x187af5))]=_0x198186[_0x187af5];}}return{'variables':_0xbe9221};};exports[_0xef0b('0x28')]=function(_0x1f40e9,_0x4cb081){if(!_[_0xef0b('0x14')](_0x1f40e9)){if(_0x1f40e9[_0xef0b('0x27')](_0xef0b('0x29'))){if(_0x1f40e9[_0xef0b('0x29')]>0x0){_0x1f40e9[_0xef0b('0x29')]-=0x1;}else{logger[_0xef0b('0x6')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4cb081);}}}else{logger[_0xef0b('0x6')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x4cb081);}};exports[_0xef0b('0x2a')]=function(_0x5be12c){var _0x38953f=moment()[_0xef0b('0x10')](_0xef0b('0x2b'));_0x5be12c['state']=0xd;_0x5be12c[_0xef0b('0x2c')]='Blacklist';_0x5be12c['starttime']=_0x38953f;_0x5be12c[_0xef0b('0x2d')]=_0x38953f;_0x5be12c['endtime']=_0x38953f;};exports['logAgent']=function(_0x5375e4,_0x30b2c7,_0x297d09){var _0x1dd61f=moment()['format'](_0xef0b('0x2b'));_0x5375e4[_0xef0b('0x2e')]=_0x30b2c7;_0x5375e4[_0xef0b('0x2c')]=_0x297d09;_0x5375e4[_0xef0b('0x2d')]=_0x1dd61f;_0x5375e4[_0xef0b('0x2f')]=utils[_0xef0b('0x30')](_0x5375e4[_0xef0b('0x2d')],_0x5375e4[_0xef0b('0x31')]);};exports['logLookAgent']=function(_0x294fd7,_0x3a7b4f,_0x29579f){_0x294fd7['membername']=_0x3a7b4f;_0x294fd7[_0xef0b('0x32')]=_0x29579f;};exports[_0xef0b('0x33')]=function(_0x43f2da,_0x29c1ff,_0x1ff142){var _0x1ea7cc=moment()[_0xef0b('0x10')](_0xef0b('0x2b'));_0x43f2da[_0xef0b('0x2e')]=_0x29c1ff;_0x43f2da[_0xef0b('0x2c')]=_0x1ff142;_0x43f2da['responsetime']=_0x43f2da[_0xef0b('0x2d')]?_0x43f2da['responsetime']:_0x1ea7cc;_0x43f2da[_0xef0b('0x34')]=_0x43f2da[_0xef0b('0x34')]?_0x43f2da[_0xef0b('0x34')]:_0x1ea7cc;_0x43f2da['ringtime']=utils[_0xef0b('0x30')](_0x43f2da[_0xef0b('0x2d')]||0x0,_0x43f2da['starttime']||0x0);_0x43f2da[_0xef0b('0x35')]=_0x43f2da['answertime']?utils['getSeconds'](_0x43f2da['endtime'],_0x43f2da[_0xef0b('0x36')]):0x0;};exports[_0xef0b('0x37')]=function(_0x22d75f){return _0x22d75f==='Failure';};exports[_0xef0b('0x38')]=function(_0x1ed1f1,_0x1b87e4,_0x1096c5,_0x4d23fd,_0x5f584c){var _0x52247f=_0x4d23fd?_0xef0b('0x39'):_0x1ed1f1[_0xef0b('0x17')];_0x52247f=_0x5f584c?_0xef0b('0x3a'):_0x52247f;return{'actionid':_0x1ed1f1[_0xef0b('0x3b')],'action':_0xef0b('0x3c'),'channel':_0x1ed1f1[_0xef0b('0x3d')],'callerid':util[_0xef0b('0x10')](_0xef0b('0x11'),_0x52247f,_0x1ed1f1['calleridnum']),'Exten':_0xef0b('0x24'),'Context':_0xef0b('0x3e'),'Priority':'1','variable':_0x1096c5,'timeout':(_0x1b87e4[_0xef0b('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1ed1f1['uniqueid']};};exports[_0xef0b('0x40')]=function(_0x5430f7){return _0x5430f7[_0xef0b('0x41')]+_0x5430f7['countcongestionretry']+_0x5430f7[_0xef0b('0x42')]+_0x5430f7[_0xef0b('0x43')]+_0x5430f7[_0xef0b('0x44')];};exports[_0xef0b('0x45')]=function(_0x2491d1){var _0x4ba4a6=_[_0xef0b('0x46')](_0x2491d1);_0x4ba4a6[_0xef0b('0x2e')]=0xf;_0x4ba4a6[_0xef0b('0x2c')]=_0xef0b('0x47');return _0x4ba4a6;};exports['scheduledAt']=function(_0x1589e4,_0x14472c,_0x41f09c){var _0x805dbf={};_0x805dbf[_0x14472c]=_0x1589e4[_0x14472c];_0x805dbf['active']=![];_0x805dbf[_0xef0b('0x48')]=moment()['add'](_0x41f09c,_0xef0b('0x49'))[_0xef0b('0x10')](_0xef0b('0x2b'));_0x805dbf['ContactId']=_0x1589e4['ContactId'];_0x805dbf[_0xef0b('0x4a')]=_0x1589e4['ListId'];_0x805dbf['VoiceQueueId']=_0x1589e4[_0xef0b('0x1a')]||undefined;return _0x805dbf;};exports[_0xef0b('0x4b')]=function(_0x426da7,_0x353264){if(!_['isNil'](_0x426da7)){if(_0x426da7['pTalking']>0x0){_0x426da7['pTalking']-=0x1;}else{logger[_0xef0b('0x6')](_0x353264,_0xef0b('0x4c'));}}else{logger['error'](_0x353264,_0xef0b('0x4d'));}};exports['IsNotLoggedIn']=function(_0x2c1267){if(_0x2c1267<=0x0){return!![];}return![];};function buildObj(_0x42ae0b,_0x171dac,_0x4c45a3){_0x42ae0b[_0xef0b('0x4e')]=_0x171dac;_0x42ae0b[_0xef0b('0x4f')]=_0x42ae0b[_0xef0b('0x50')];_0x42ae0b[_0xef0b('0x51')]=_0x42ae0b[_0xef0b('0x3d')];_0x42ae0b['motionChannel']=_0xef0b('0x52');if(_0x4c45a3){_0x42ae0b[_0xef0b('0x53')]=_0x4c45a3[_0xef0b('0x53')];}return _0x42ae0b;}exports[_0xef0b('0x54')]=buildObj;exports[_0xef0b('0x55')]=function(_0xc7a348){var _0x36d746=[];for(var _0x1cadaf in _0xc7a348){if(_0xc7a348[_0xef0b('0x27')](_0x1cadaf)){if(!_[_0xef0b('0x14')](_0xc7a348[_0x1cadaf])&&_0xc7a348[_0x1cadaf]['state']===_0xef0b('0x56')&&_0xc7a348[_0x1cadaf][_0xef0b('0x57')]===_0xef0b('0x58')){_0x36d746['push'](_0xc7a348[_0x1cadaf]['id']);}}}return _0x36d746;};exports['getDiff']=function(_0x5b84ca){var _0x2f1cf9=moment()['milliseconds'](0x0);var _0x32dc51=moment(_0x5b84ca)[_0xef0b('0x59')](0x0);return _0x2f1cf9[_0xef0b('0x5a')](_0x32dc51,_0xef0b('0x5b'));};exports[_0xef0b('0x5c')]=function(_0x2654d7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2654d7[_0xef0b('0x18')],'ListId':_0x2654d7[_0xef0b('0x4a')],'VoiceQueueId':_0x2654d7[_0xef0b('0x1a')]||undefined,'CampaignId':_0x2654d7[_0xef0b('0x5d')]||undefined};};exports['filterKey']=function(_0x19d626){if(_0x19d626==='uniqueid'||_0x19d626==='idContact'||_0x19d626===_0xef0b('0x50')||_0x19d626==='type'||_0x19d626===_0xef0b('0x5e')||_0x19d626===_0xef0b('0x5f')||_0x19d626===_0xef0b('0x60')||_0x19d626==='channelAgent'||_0x19d626===_0xef0b('0x17')||_0x19d626===_0xef0b('0x61')||_0x19d626===_0xef0b('0x62')||_0x19d626==='scheduledat'||_0x19d626===_0xef0b('0x41')||_0x19d626==='countcongestionretry'||_0x19d626===_0xef0b('0x42')||_0x19d626===_0xef0b('0x63')||_0x19d626==='callback'||_0x19d626===_0xef0b('0x64')||_0x19d626===_0xef0b('0x65')||_0x19d626===_0xef0b('0x66')||_0x19d626===_0xef0b('0x18')||_0x19d626===_0xef0b('0x4a')||_0x19d626===_0xef0b('0x32')||_0x19d626===_0xef0b('0x1a')||_0x19d626===_0xef0b('0x67')||_0x19d626===_0xef0b('0x68')||_0x19d626==='xmd-queue'||_0x19d626===_0xef0b('0x69')||_0x19d626==='xmd-listid'||_0x19d626===_0xef0b('0x6a')||_0x19d626===_0xef0b('0x6b')||_0x19d626===_0xef0b('0x6c')||_0x19d626==='xmd-dialid'||_0x19d626===_0xef0b('0x6d')||_0x19d626===_0xef0b('0x6e')||_0x19d626===_0xef0b('0x6f')||_0x19d626==='xmd-callerid'||_0x19d626==='xmd-agiafter'||_0x19d626===_0xef0b('0x70')||_0x19d626===_0xef0b('0x71')||_0x19d626==='rtpaudioqosbridged'||_0x19d626==='rtpaudioqosjitter'||_0x19d626===_0xef0b('0x72')||_0x19d626===_0xef0b('0x73')||_0x19d626===_0xef0b('0x74')||_0x19d626==='rtpaudioqosrtt'||_0x19d626===_0xef0b('0x75')||_0x19d626===_0xef0b('0x71')||_0x19d626===_0xef0b('0x76')||_0x19d626===_0xef0b('0x77')||_0x19d626===_0xef0b('0x72')||_0x19d626===_0xef0b('0x73')||_0x19d626===_0xef0b('0x74')||_0x19d626===_0xef0b('0x78')||_0x19d626==='rtpaudioqosrttbridged'||_0x19d626===_0xef0b('0x79')||_0x19d626===_0xef0b('0x7a')||_0x19d626===_0xef0b('0x2e')||_0x19d626===_0xef0b('0x2c')){return![];}return!![];};exports[_0xef0b('0x7b')]=function(_0x30522b,_0x50171b){var _0x160b84,_0xee5c78,_0x5f0706;if(_0x50171b<=0x0){_0x50171b=0x1;}_0x160b84=new RegExp('\x5cw{0,'+_0x50171b+'}$');_0xee5c78=Math[_0xef0b('0x7c')](0xa,_0x50171b-0x1);_0x5f0706=Math[_0xef0b('0x7c')](0xa,_0x50171b)-0x1;return util['format']('%s',_['replace'](_0x30522b,_0x160b84,_[_0xef0b('0x7d')](_0xee5c78,_0x5f0706)));};exports[_0xef0b('0x7e')]=function(_0x4f3b28){var _0x4c6038=_0x4f3b28[_0xef0b('0x7f')](/"(.*?)"/);return _0x4c6038?_0x4c6038[0x1]:_0x4f3b28;};exports[_0xef0b('0x80')]=function(_0x392b19){var _0x75f76e=_0x392b19[_0xef0b('0x7f')](/<(.*?)>/);return _0x75f76e?_0x75f76e[0x1]:_0x392b19;};function buildNoAnswerEventPayload(_0xe094fb,_0x58de08){var _0x1df0e7=buildObj(_0xe094fb,'noanswer');if(!_[_0xef0b('0xf')](_0x58de08[_0xef0b('0x81')])){Object[_0xef0b('0x82')](_0x58de08[_0xef0b('0x81')])['forEach'](function(_0x5ab4ff){_0x1df0e7[_0x5ab4ff[_0xef0b('0x83')]()]=_0x58de08[_0xef0b('0x81')][_0x5ab4ff];});}return _0x1df0e7;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index d667fdd..47e0000 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 _0x7bc7=['boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x247fec,_0x39eec9){var _0x256b44=function(_0x12e9ec){while(--_0x12e9ec){_0x247fec['push'](_0x247fec['shift']());}};_0x256b44(++_0x39eec9);}(_0x7bc7,0x115));var _0x77bc=function(_0x3a6b50,_0xc56597){_0x3a6b50=_0x3a6b50-0x0;var _0x45755c=_0x7bc7[_0x3a6b50];return _0x45755c;};'use strict';exports[_0x77bc('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x77bc('0x1'),'required':!![]},'membername':{'type':_0x77bc('0x1'),'required':!![]},'penalty':{'type':_0x77bc('0x2'),'required':![]},'paused':{'type':_0x77bc('0x3'),'required':![]}};exports[_0x77bc('0x4')]={'queue':{'type':_0x77bc('0x1'),'required':!![]},'interface':{'type':_0x77bc('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x77bc('0x1'),'required':!![]},'paused':{'type':_0x77bc('0x3')},'reason':{'type':_0x77bc('0x1'),'required':![]}};exports[_0x77bc('0x5')]={'module':{'type':_0x77bc('0x1'),'required':![]}};exports[_0x77bc('0x6')]={'uniqueid':{'type':_0x77bc('0x1'),'required':!![]}};exports[_0x77bc('0x7')]={'uniqueid':{'type':_0x77bc('0x1'),'required':!![]},'filename':{'type':_0x77bc('0x1')},'format':{'type':_0x77bc('0x1')},'mixmonitorid':{'type':_0x77bc('0x1')}};exports[_0x77bc('0x8')]={'uniqueid':{'type':_0x77bc('0x1'),'required':!![]}};exports[_0x77bc('0x9')]={'uniqueid':{'type':_0x77bc('0x1'),'required':!![]},'exten':{'type':_0x77bc('0x1'),'required':!![]},'context':{'type':_0x77bc('0x1')}}; \ No newline at end of file +var _0x1f71=['number','boolean','queueremove','queuepause','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x5e1568,_0x3b4532){var _0x81d0c2=function(_0x33485f){while(--_0x33485f){_0x5e1568['push'](_0x5e1568['shift']());}};_0x81d0c2(++_0x3b4532);}(_0x1f71,0xd6));var _0x11f7=function(_0x10fe61,_0x258431){_0x10fe61=_0x10fe61-0x0;var _0x55dd5b=_0x1f71[_0x10fe61];return _0x55dd5b;};'use strict';exports[_0x11f7('0x0')]={'queue':{'type':_0x11f7('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x11f7('0x1'),'required':!![]},'penalty':{'type':_0x11f7('0x2'),'required':![]},'paused':{'type':_0x11f7('0x3'),'required':![]}};exports[_0x11f7('0x4')]={'queue':{'type':_0x11f7('0x1'),'required':!![]},'interface':{'type':_0x11f7('0x1'),'required':!![]}};exports[_0x11f7('0x5')]={'interface':{'type':_0x11f7('0x1'),'required':!![]},'paused':{'type':_0x11f7('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x11f7('0x1'),'required':![]}};exports[_0x11f7('0x6')]={'uniqueid':{'type':_0x11f7('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x11f7('0x1'),'required':!![]},'filename':{'type':_0x11f7('0x1')},'format':{'type':_0x11f7('0x1')},'mixmonitorid':{'type':_0x11f7('0x1')}};exports[_0x11f7('0x7')]={'uniqueid':{'type':_0x11f7('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x11f7('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index b36e4e3..da33a39 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 _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x5903c6,_0x24282a){var _0x7bcab2=function(_0x4dfdd8){while(--_0x4dfdd8){_0x5903c6['push'](_0x5903c6['shift']());}};_0x7bcab2(++_0x24282a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5de97d,_0x1141ee){_0x5de97d=_0x5de97d-0x0;var _0x2da950=_0xb10b[_0x5de97d];return _0x2da950;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file +var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x2a2069,_0x3f1db8){var _0x66b00a=function(_0x2854ff){while(--_0x2854ff){_0x2a2069['push'](_0x2a2069['shift']());}};_0x66b00a(++_0x3f1db8);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a778b,_0x717daa){_0x5a778b=_0x5a778b-0x0;var _0x32f0da=_0xb10b[_0x5a778b];return _0x32f0da;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};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 04db4f6..79bef2e 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 _0x1b01=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x3fbbfb,_0x459366){var _0x2a00d4=function(_0x239710){while(--_0x239710){_0x3fbbfb['push'](_0x3fbbfb['shift']());}};_0x2a00d4(++_0x459366);}(_0x1b01,0xd8));var _0x11b0=function(_0x22814f,_0x3b4afc){_0x22814f=_0x22814f-0x0;var _0x523be1=_0x1b01[_0x22814f];return _0x523be1;};'use strict';function mergeDBDataToRealtime(_0x373dc9,_0x244ecb){var _0x4ac15b=Object[_0x11b0('0x0')]({},_0x373dc9);for(var _0x41320e in _0x244ecb){if(_0x4ac15b[_0x11b0('0x1')](_0x41320e)){_0x4ac15b[_0x41320e]=_0x244ecb[_0x41320e];}}return _0x4ac15b;}exports[_0x11b0('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x9859=['assign','mergeDBDataToRealtime'];(function(_0x2fdf3f,_0x420d5d){var _0x5927ce=function(_0x3b1e00){while(--_0x3b1e00){_0x2fdf3f['push'](_0x2fdf3f['shift']());}};_0x5927ce(++_0x420d5d);}(_0x9859,0x8c));var _0x9985=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x9859[_0x243b59];return _0x3e1676;};'use strict';function mergeDBDataToRealtime(_0x4cc594,_0x394fc9){var _0x33dd86=Object[_0x9985('0x0')]({},_0x4cc594);for(var _0x4c9688 in _0x394fc9){if(_0x33dd86['hasOwnProperty'](_0x4c9688)){_0x33dd86[_0x4c9688]=_0x394fc9[_0x4c9688];}}return _0x33dd86;}exports[_0x9985('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index ed5b3bf..83083fe 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 _0xd477=['blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','voiceQueueReport','create','keys','getCallType','channel','calleridnum','outbound','destination','exten','type','dialer','queue','lastdata','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','UserId','split','getAgentByInternal','membername','monitor','monitors','monitorFilename','createdAt','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','custom:voiceCallReport','voiceAgentReport','bind','voiceDialReport','blindtransfer'];(function(_0x54967c,_0x46540e){var _0x1b8975=function(_0x1cda99){while(--_0x1cda99){_0x54967c['push'](_0x54967c['shift']());}};_0x1b8975(++_0x46540e);}(_0xd477,0xea));var _0x7d47=function(_0x5cec18,_0x34d5ea){_0x5cec18=_0x5cec18-0x0;var _0x4b878f=_0xd477[_0x5cec18];return _0x4b878f;};'use strict';var _=require(_0x7d47('0x0'));var moment=require(_0x7d47('0x1'));var util=require('util');var config=require(_0x7d47('0x2'));var ami=require(_0x7d47('0x3'));var RpcVoiceAgentReport=require(_0x7d47('0x4'));var RpcVoiceCallReport=require(_0x7d47('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x7d47('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x7d47('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x7d47('0x8'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x7d47('0x9'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x7d47('0xa'));function Report(_0x545f2c){this[_0x7d47('0xb')]=_0x545f2c;this['agents']=_0x545f2c[_0x7d47('0xc')];this[_0x7d47('0xd')]=_0x545f2c[_0x7d47('0xd')];}Report[_0x7d47('0xe')][_0x7d47('0xf')]=function(_0x252fa6){var _0x4d285d=new VoiceQueueReport(this[_0x7d47('0xb')]);var _0x501c90=new VoiceAgentReport(this[_0x7d47('0xb')]);var _0x863ab1=new VoiceDialReport(this[_0x7d47('0xb')]);var _0x45c375=new VoiceCallReport(this[_0x7d47('0xb')]);var _0x4a4088=new UserReport(this['realtime']);if(config[_0x7d47('0x10')]&&config['xdr'][_0x7d47('0x11')]){ami['on'](_0x7d47('0x12'),this['voiceQueueReport']['bind'](this));ami['on'](_0x7d47('0x13'),this['voiceCallReport']['bind'](this));ami['on']('custom:voiceAgentReport',this[_0x7d47('0x14')][_0x7d47('0x15')](this));ami['on']('custom:voiceDialReport',this[_0x7d47('0x16')]['bind'](this));ami['on'](_0x7d47('0x17'),this[_0x7d47('0x18')]['bind'](this));ami['on'](_0x7d47('0x19'),this['attendedTransfer'][_0x7d47('0x15')](this));}};Report[_0x7d47('0xe')][_0x7d47('0x1a')]=function(_0x271c0f){var _0x518680;_0x518680=_[_0x7d47('0x1b')](this[_0x7d47('0xc')],function(_0x54453b){return _0x54453b[_0x7d47('0x1c')]==_0x271c0f||_0x54453b[_0x7d47('0x1d')]==_0x271c0f;});if(_[_0x7d47('0x1e')](_0x518680)){var _0x59dcf0=_[_0x7d47('0x1b')](this['telephones'],function(_0x7b1b39){return _0x7b1b39[_0x7d47('0x1c')]==_0x271c0f||_0x7b1b39[_0x7d47('0x1d')]==_0x271c0f;});if(_0x59dcf0){_0x518680=_[_0x7d47('0x1b')](this['agents'],function(_0x19062e){return _0x19062e[_0x7d47('0x1f')]==util[_0x7d47('0x20')](_0x7d47('0x21'),_0x59dcf0['name']);});}}return _0x518680;};Report[_0x7d47('0xe')]['voiceQueueReport']=function(_0x2b552c){for(var _0x3e476a=0x0;_0x3e476a<_0x2b552c[_0x7d47('0x22')];_0x3e476a+=0x1){var _0x230ac7=this[_0x7d47('0x1a')](_0x2b552c[_0x3e476a][_0x7d47('0x23')]);if(_0x230ac7){_0x2b552c[_0x3e476a]['accountcode']=_0x230ac7['accountcode'];_0x2b552c[_0x3e476a]['assigned']=!![];_0x2b552c[_0x3e476a]['lastAssignedTo']=_0x230ac7['name'];_0x2b552c[_0x3e476a]['interface']=_[_0x7d47('0x1e')](_0x230ac7[_0x7d47('0x1f')])?util['format'](_0x7d47('0x21'),_0x230ac7['name']):_0x230ac7['interface'];if(_0x2b552c[_0x3e476a][_0x7d47('0x24')]){_0x2b552c[_0x3e476a][_0x7d47('0x25')]=moment()['format'](_0x7d47('0x26'));}if(_0x2b552c[_0x3e476a][_0x7d47('0x27')]){_0x2b552c[_0x3e476a][_0x7d47('0x28')]=moment()[_0x7d47('0x20')](_0x7d47('0x26'));}RpcMemberReport[_0x7d47('0x29')](_0x2b552c[_0x3e476a]);}RpcVoiceQueueReport[_0x7d47('0x2a')](_0x2b552c[_0x3e476a]);}};function extractCalleridNumber(_0x313108){var _0x5c24b7=_0x313108['match'](/<(.*?)>/);return _0x5c24b7?_0x5c24b7[0x1]:_0x313108;}Report['prototype']['getAgentByInternal']=function(_0xa3ad11){for(var _0x41bec0=0x0;_0x41bec0','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','split','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','exten','xcally-motion-dialer','voiceAgentReport','isArray','forEach','indexOf','mobile','transfererlinkedid','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xc06b,0x165));var _0xbc06=function(_0x241811,_0x35ca5f){_0x241811=_0x241811-0x0;var _0x1d1e76=_0xc06b[_0x241811];return _0x1d1e76;};'use strict';var _=require(_0xbc06('0x0'));var moment=require(_0xbc06('0x1'));var util=require('util');var config=require(_0xbc06('0x2'));var ami=require(_0xbc06('0x3'));var RpcVoiceAgentReport=require(_0xbc06('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xbc06('0x5'));var RpcMemberReport=require(_0xbc06('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xbc06('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xbc06('0x8'));var VoiceCallReport=require(_0xbc06('0x9'));var VoiceAgentReport=require(_0xbc06('0xa'));var VoiceDialReport=require(_0xbc06('0xb'));var UserReport=require(_0xbc06('0xc'));function Report(_0x536f8e){this[_0xbc06('0xd')]=_0x536f8e;this['agents']=_0x536f8e[_0xbc06('0xe')];this[_0xbc06('0xf')]=_0x536f8e[_0xbc06('0xf')];}Report[_0xbc06('0x10')][_0xbc06('0x11')]=function(_0x27f8a2){var _0xf8706c=new VoiceQueueReport(this[_0xbc06('0xd')]);var _0x3e9482=new VoiceAgentReport(this[_0xbc06('0xd')]);var _0x2c7242=new VoiceDialReport(this['realtime']);var _0x3312d6=new VoiceCallReport(this[_0xbc06('0xd')]);var _0x47656d=new UserReport(this[_0xbc06('0xd')]);if(config[_0xbc06('0x12')]&&config[_0xbc06('0x12')][_0xbc06('0x13')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport']['bind'](this));ami['on'](_0xbc06('0x14'),this[_0xbc06('0x15')]['bind'](this));ami['on'](_0xbc06('0x16'),this['voiceAgentReport']['bind'](this));ami['on'](_0xbc06('0x17'),this[_0xbc06('0x18')][_0xbc06('0x19')](this));ami['on'](_0xbc06('0x1a'),this['blindTransfer'][_0xbc06('0x19')](this));ami['on'](_0xbc06('0x1b'),this[_0xbc06('0x1c')][_0xbc06('0x19')](this));}};Report[_0xbc06('0x10')][_0xbc06('0x1d')]=function(_0x4a6210){var _0xde3008;_0xde3008=_[_0xbc06('0x1e')](this['agents'],function(_0xbe29c9){return _0xbe29c9['accountcode']==_0x4a6210||_0xbe29c9[_0xbc06('0x1f')]==_0x4a6210;});if(_['isNil'](_0xde3008)){var _0x14b157=_[_0xbc06('0x1e')](this[_0xbc06('0xf')],function(_0x214140){return _0x214140[_0xbc06('0x20')]==_0x4a6210||_0x214140['name']==_0x4a6210;});if(_0x14b157){_0xde3008=_[_0xbc06('0x1e')](this[_0xbc06('0xe')],function(_0x3fc068){return _0x3fc068[_0xbc06('0x21')]==util[_0xbc06('0x22')](_0xbc06('0x23'),_0x14b157[_0xbc06('0x1f')]);});}}return _0xde3008;};Report['prototype']['voiceQueueReport']=function(_0x1754a1){for(var _0x293ab3=0x0;_0x293ab3<_0x1754a1[_0xbc06('0x24')];_0x293ab3+=0x1){var _0x268d54=this[_0xbc06('0x1d')](_0x1754a1[_0x293ab3][_0xbc06('0x25')]);if(_0x268d54){_0x1754a1[_0x293ab3][_0xbc06('0x20')]=_0x268d54['accountcode'];_0x1754a1[_0x293ab3][_0xbc06('0x26')]=!![];_0x1754a1[_0x293ab3][_0xbc06('0x27')]=_0x268d54[_0xbc06('0x1f')];_0x1754a1[_0x293ab3][_0xbc06('0x21')]=_[_0xbc06('0x28')](_0x268d54[_0xbc06('0x21')])?util[_0xbc06('0x22')](_0xbc06('0x23'),_0x268d54[_0xbc06('0x1f')]):_0x268d54[_0xbc06('0x21')];if(_0x1754a1[_0x293ab3]['queuecallercomplete']){_0x1754a1[_0x293ab3][_0xbc06('0x29')]=moment()[_0xbc06('0x22')](_0xbc06('0x2a'));}if(_0x1754a1[_0x293ab3][_0xbc06('0x2b')]){_0x1754a1[_0x293ab3][_0xbc06('0x2c')]=moment()[_0xbc06('0x22')](_0xbc06('0x2a'));}RpcMemberReport[_0xbc06('0x2d')](_0x1754a1[_0x293ab3]);}RpcVoiceQueueReport[_0xbc06('0x2e')](_0x1754a1[_0x293ab3]);}};function extractCalleridNumber(_0x32c205){var _0x561c2a=_0x32c205[_0xbc06('0x2f')](/<(.*?)>/);return _0x561c2a?_0x561c2a[0x1]:_0x32c205;}Report[_0xbc06('0x10')][_0xbc06('0x30')]=function(_0x521bee){for(var _0x2adda3=0x0;_0x2adda30x0?!![]:![];if(!_0x117af8){return this[_0x72c3('0x17')](this[_0x72c3('0x12')]['completeEvent']);}};VoiceQueueReport['prototype'][_0x72c3('0x19')]=function(_0x3da0cc){var _0x50a007=this[_0x72c3('0x12')]['id'];if(this[_0x72c3('0x12')]['queuestatus'][_0x50a007]&&this['summary'][_0x72c3('0x64')][_0x50a007][_0x3da0cc[_0x72c3('0x63')]]){this[_0x72c3('0x12')][_0x72c3('0x64')][_0x50a007][_0x3da0cc[_0x72c3('0x63')]][_0x72c3('0xf')][_0x72c3('0x70')](_0x3da0cc);}};VoiceQueueReport['prototype'][_0x72c3('0x15')]=function(_0x4779ad){var _0x9afa7c=this;try{if(this[_0x72c3('0x71')](_0x4779ad)&&this[_0x72c3('0x71')](_0x4779ad[_0x72c3('0x51')])){logger[_0x72c3('0x4d')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x72c3('0x44')](_0x4779ad,{'showHidden':![],'depth':null}));var _0x4890e2=this[_0x72c3('0x10')][_0x4779ad[_0x72c3('0x51')]];if(_0x4890e2){logger[_0x72c3('0x4d')](_0x72c3('0x72'),_0x4890e2[_0x72c3('0x5c')]);this['summary']['queues'][_0x4890e2[_0x72c3('0x5c')]]={'summaryEvent':_0x4779ad};this[_0x72c3('0x12')][_0x72c3('0x6f')]+=0x1;return ami[_0x72c3('0x3e')]({'action':_0x72c3('0x64'),'queue':_0x4890e2[_0x72c3('0x5c')]})[_0x72c3('0x62')](function(_0x4f464f){if(!_0x9afa7c[_0x72c3('0x12')]['queuestatus'][_0x4779ad['actionid']]){_0x9afa7c[_0x72c3('0x12')][_0x72c3('0x64')][_0x4779ad[_0x72c3('0x63')]]={};}_0x9afa7c[_0x72c3('0x12')][_0x72c3('0x64')][_0x4779ad[_0x72c3('0x63')]][_0x4f464f['actionid']]={'queue':_0x4890e2[_0x72c3('0x5c')],'agents':[]};})[_0x72c3('0x40')](function(_0x5c0a0f){throw _0x5c0a0f;});}}}catch(_0x535148){logger['error'](_0x72c3('0x65'),util[_0x72c3('0x44')](_0x535148,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x72c3('0x17')]=function(_0x479f62){if(this[_0x72c3('0x12')][_0x72c3('0x6f')]>0x0){this[_0x72c3('0x12')]['completeEvent']=_0x479f62;return;}logger[_0x72c3('0x4d')](_0x72c3('0x73'),util[_0x72c3('0x44')](_0x479f62,{'showHidden':![],'depth':null}));this[_0x72c3('0x12')]=initializeSummary();ami[_0x72c3('0x4b')](_0x72c3('0x74'),{});};VoiceQueueReport['prototype'][_0x72c3('0x1d')]=function(_0x4d34d1){try{if(this[_0x72c3('0x71')](_0x4d34d1)){logger[_0x72c3('0x4d')](_0x72c3('0x75'),_0x4d34d1[_0x72c3('0x4f')],util[_0x72c3('0x44')](_0x4d34d1,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x4d34d1[_0x72c3('0x4f')]])){this[_0x72c3('0x45')][_0x4d34d1[_0x72c3('0x4f')]]=[];}if(_['isUndefined'](this[_0x72c3('0x3b')][_0x4d34d1[_0x72c3('0x4f')]])){this[_0x72c3('0x3b')][_0x4d34d1[_0x72c3('0x4f')]]={};}var _0x4d509b=new QueueReport();_0x4d509b['queue']=_0x4d34d1[_0x72c3('0x51')];_0x4d509b[_0x72c3('0x59')]=this['voiceQueues'][_0x4d509b['queue']]&&this[_0x72c3('0x10')][_0x4d509b[_0x72c3('0x51')]][_0x72c3('0x59')]?this[_0x72c3('0x10')][_0x4d509b[_0x72c3('0x51')]]['type']||'inbound':'inbound';_0x4d509b[_0x72c3('0x76')]=moment()[_0x72c3('0x56')](_0x72c3('0x77'));_0x4d509b['position']=_0x4d34d1[_0x72c3('0x78')];_0x4d509b['count']=_0x4d34d1[_0x72c3('0x79')];_0x4d509b['uniqueid']=_0x4d34d1[_0x72c3('0x4f')];_0x4d509b[_0x72c3('0x7a')]=this[_0x72c3('0x3b')][_0x4d34d1[_0x72c3('0x4f')]][_0x72c3('0x7a')];logger[_0x72c3('0x7b')](_0x72c3('0x7c'),_0x4d509b[_0x72c3('0x51')],_0x4d509b[_0x72c3('0x59')]);Object[_0x72c3('0x6c')](_0x4d509b,_[_0x72c3('0x7d')](_0x4d34d1,_[_0x72c3('0x7e')](_0x4d509b)));this[_0x72c3('0x45')][_0x4d34d1[_0x72c3('0x4f')]][_0x72c3('0x70')](_0x4d509b);this['channels'][_0x4d34d1[_0x72c3('0x4f')]]=_0x4d509b;this[_0x72c3('0x4c')](_0x4d509b,_0x72c3('0x7f'));}}catch(_0x157198){logger[_0x72c3('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4d34d1['uniqueid'],util['inspect'](_0x157198,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x17effa){try{if(this['isNotNull'](_0x17effa)){logger[_0x72c3('0x4d')](_0x72c3('0x80'),_0x17effa[_0x72c3('0x4f')],util[_0x72c3('0x44')](_0x17effa,{'showHidden':![],'depth':null}));if(this[_0x72c3('0x45')][_0x17effa['uniqueid']]){var _0x48cbd3=_[_0x72c3('0x81')](this[_0x72c3('0x45')][_0x17effa[_0x72c3('0x4f')]]);_0x48cbd3[_0x72c3('0x39')]=![];_0x48cbd3[_0x72c3('0x82')]=null;_0x48cbd3[_0x72c3('0x83')]=_0x17effa[_0x72c3('0x83')];_0x48cbd3['originalposition']=_0x17effa[_0x72c3('0x84')];_0x48cbd3[_0x72c3('0x1e')]=!![];_0x48cbd3[_0x72c3('0x85')]=moment()[_0x72c3('0x56')](_0x72c3('0x77'));_0x48cbd3[_0x72c3('0x54')]='ABANDONED';_0x48cbd3['lastAssignedTo']=null;logger[_0x72c3('0x7b')](_0x72c3('0x86'),_0x48cbd3['queue'],_0x48cbd3[_0x72c3('0x59')]);this[_0x72c3('0x3b')][_0x17effa[_0x72c3('0x4f')]]=_0x48cbd3;this[_0x72c3('0x53')](_0x48cbd3,_0x72c3('0x1e'));}}}catch(_0x448210){logger[_0x72c3('0x42')]('[%s][voiceQueueReport][queuecallerabandon]',_0x17effa['uniqueid'],util[_0x72c3('0x44')](_0x448210,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x72c3('0xb')][_0x72c3('0x21')]=function(_0x1615da){try{if(this[_0x72c3('0x71')](_0x1615da)){logger[_0x72c3('0x4d')](_0x72c3('0x87'),_0x1615da['uniqueid'],util[_0x72c3('0x44')](_0x1615da,{'showHidden':![],'depth':null}));if(this[_0x72c3('0x45')][_0x1615da[_0x72c3('0x4f')]]){var _0x665000=_[_0x72c3('0x81')](this[_0x72c3('0x45')][_0x1615da[_0x72c3('0x4f')]]);_0x665000[_0x72c3('0x88')]=moment()['format'](_0x72c3('0x77'));_0x665000[_0x72c3('0x89')]=_0x1615da[_0x72c3('0x89')];_0x665000['connectedlinename']=_0x1615da[_0x72c3('0x8a')];logger['info'](_0x72c3('0x8b'),_0x665000[_0x72c3('0x51')],_0x665000['type'],_0x1615da[_0x72c3('0x89')],_0x1615da[_0x72c3('0x8a')]);this[_0x72c3('0x3b')][_0x1615da['uniqueid']]=_0x665000;this[_0x72c3('0x4c')](_0x665000,_0x72c3('0x20'));}}}catch(_0x534956){logger[_0x72c3('0x42')](_0x72c3('0x87'),_0x1615da['uniqueid'],util['inspect'](_0x534956,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x72c3('0x25')]=function(_0x2576d2){try{if(this[_0x72c3('0x71')](_0x2576d2)){logger[_0x72c3('0x4d')](_0x72c3('0x8c'),_0x2576d2[_0x72c3('0x4f')],util[_0x72c3('0x44')](_0x2576d2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2576d2[_0x72c3('0x4f')]]){var _0x369edc=_['last'](this[_0x72c3('0x45')][_0x2576d2[_0x72c3('0x4f')]]);_0x369edc[_0x72c3('0x39')]=!![];_0x369edc[_0x72c3('0x54')]=_0x72c3('0x8d');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x369edc[_0x72c3('0x51')],_0x369edc[_0x72c3('0x59')]);}}}catch(_0x1ab0a8){logger['error'](_0x72c3('0x8c'),_0x2576d2[_0x72c3('0x4f')],util[_0x72c3('0x44')](_0x1ab0a8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x72c3('0x23')]=function(_0x1eac17){try{if(this[_0x72c3('0x71')](_0x1eac17)){logger[_0x72c3('0x4d')]('[%s][voiceQueueReport][agentcomplete]',_0x1eac17[_0x72c3('0x4f')],util[_0x72c3('0x44')](_0x1eac17,{'showHidden':![],'depth':null}));if(this[_0x72c3('0x45')][_0x1eac17['uniqueid']]){var _0x5d8062=_[_0x72c3('0x81')](this['queueReports'][_0x1eac17['uniqueid']]);_0x5d8062[_0x72c3('0x1e')]=![];_0x5d8062[_0x72c3('0x85')]=null;_0x5d8062[_0x72c3('0x8e')]=!![];_0x5d8062[_0x72c3('0x8f')]=_0x1eac17['membername'];_0x5d8062[_0x72c3('0x83')]=_0x1eac17[_0x72c3('0x83')];_0x5d8062[_0x72c3('0x39')]=!![];_0x5d8062[_0x72c3('0x38')]=![];_0x5d8062[_0x72c3('0x90')]=null;if(!_0x5d8062[_0x72c3('0x91')]){if(_0x1eac17['reason']==_0x72c3('0x91')){_0x5d8062['queuecallerexitreason']=_0x72c3('0x92');logger[_0x72c3('0x7b')](_0x72c3('0x93'),_0x5d8062[_0x72c3('0x51')],_0x5d8062[_0x72c3('0x59')]);}else{if(_['startsWith'](_0x1eac17[_0x72c3('0x94')]['toLowerCase'](),'local/')){if(this['queueReports'][_0x1eac17['linkedid']]){var _0x2de7a9=_['last'](this[_0x72c3('0x45')][_0x1eac17[_0x72c3('0x95')]]);_0x2de7a9['queuecallercomplete']=![];_0x2de7a9[_0x72c3('0x38')]=!![];_0x2de7a9[_0x72c3('0x90')]=moment(_0x5d8062['queuecallerjoinAt'])[_0x72c3('0x96')](_0x1eac17[_0x72c3('0x83')],_0x72c3('0x97'))[_0x72c3('0x56')](_0x72c3('0x77'));_0x2de7a9['queuecallerexitreason']=_0x72c3('0x98');_0x2de7a9['transfer']=!![];_0x2de7a9[_0x72c3('0x99')]=_0x72c3('0x9a');_0x2de7a9[_0x72c3('0x9b')]=_0x1eac17['destexten'];_0x2de7a9[_0x72c3('0x9c')]=_0x1eac17[_0x72c3('0x4f')];logger[_0x72c3('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x2de7a9[_0x72c3('0x51')],_0x2de7a9[_0x72c3('0x59')]);var _0x25c013=this[_0x72c3('0x45')][_0x1eac17[_0x72c3('0x95')]];this[_0x72c3('0x45')][_0x1eac17[_0x72c3('0x95')]]=this[_0x72c3('0x45')][_0x1eac17['uniqueid']];this[_0x72c3('0x45')][_0x1eac17[_0x72c3('0x4f')]]=_0x25c013;}}else{_0x5d8062[_0x72c3('0x54')]=_0x72c3('0x9d')+_0x1eac17[_0x72c3('0x9e')][_0x72c3('0x9f')]();logger[_0x72c3('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5d8062[_0x72c3('0x51')],_0x5d8062['type'],_0x5d8062[_0x72c3('0x54')]);}}}this['channels'][_0x1eac17['uniqueid']]=_0x5d8062;}}}catch(_0x30fd15){logger[_0x72c3('0x42')]('[%s][voiceQueueReport][agentcomplete]',_0x1eac17[_0x72c3('0x4f')],util[_0x72c3('0x44')](_0x30fd15,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x72c3('0xb')]['syncVarSet']=function(_0x570a95){try{if(this[_0x72c3('0x71')](_0x570a95)){logger[_0x72c3('0x4d')](_0x72c3('0xa0'),_0x570a95[_0x72c3('0x4f')],util[_0x72c3('0x44')](_0x570a95,{'showHidden':![],'depth':null}));this['addVariable'](_0x570a95[_0x72c3('0x4f')],_[_0x72c3('0x7e')](_0x570a95['variable'])[0x0],_0x570a95[_0x72c3('0xa1')]);if(this[_0x72c3('0x45')][_0x570a95[_0x72c3('0x4f')]]){var _0x401e0b=_[_0x72c3('0x81')](this['queueReports'][_0x570a95[_0x72c3('0x4f')]]);if(_0x401e0b){if(this['isNotNull'](_0x570a95[_0x72c3('0xa2')])&&this[_0x72c3('0x71')](_0x570a95['variable']['queuestatus'])){switch(_0x570a95[_0x72c3('0xa1')]){case _0x72c3('0xa3'):_0x401e0b[_0x72c3('0x38')]=![];_0x401e0b[_0x72c3('0x90')]=null;break;case _0x72c3('0xa4'):_0x401e0b[_0x72c3('0xa5')]=_0x72c3('0xa6');_0x401e0b[_0x72c3('0x38')]=!![];_0x401e0b[_0x72c3('0x90')]=moment()[_0x72c3('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x401e0b['queuecallerleaveAt']=moment()[_0x72c3('0x56')](_0x72c3('0x77'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x570a95[_0x72c3('0x4f')],util[_0x72c3('0x44')](_0x401e0b,{'showHidden':![],'depth':null}));ami[_0x72c3('0x4b')](_0x72c3('0xa7'),_0x401e0b);break;default:_0x401e0b[_0x72c3('0x38')]=!![];_0x401e0b[_0x72c3('0x90')]=moment()[_0x72c3('0x56')](_0x72c3('0x77'));_0x401e0b[_0x72c3('0x88')]=moment()['format'](_0x72c3('0x77'));}_0x401e0b[_0x72c3('0x1e')]=![];_0x401e0b[_0x72c3('0x85')]=null;_0x401e0b[_0x72c3('0x54')]=_0x570a95[_0x72c3('0xa1')];this[_0x72c3('0x3b')][_0x570a95[_0x72c3('0x4f')]]=_0x401e0b;this[_0x72c3('0x53')](_0x401e0b,_0x72c3('0x26'));}else if(this['isNotNull'](_0x570a95[_0x72c3('0xa2')])&&this['isNotNull'](_0x570a95[_0x72c3('0xa2')][_0x72c3('0xa8')])){if(!_0x401e0b[_0x72c3('0x1e')]){_0x401e0b[_0x72c3('0x38')]=!![];_0x401e0b[_0x72c3('0x90')]=moment()[_0x72c3('0x56')](_0x72c3('0x77'));_0x401e0b['queuecallerexitreason']=_0x72c3('0xa9');_0x401e0b[_0x72c3('0x88')]=moment()[_0x72c3('0x56')](_0x72c3('0x77'));this[_0x72c3('0x3b')][_0x570a95[_0x72c3('0x4f')]]=_0x401e0b;}}logger[_0x72c3('0x7b')](_0x72c3('0xaa'),_0x570a95[_0x72c3('0x4f')],_0x401e0b['queue'],_0x401e0b[_0x72c3('0x59')],_[_0x72c3('0x7e')](_0x570a95['variable'])[0x0],_0x570a95['value']);_0x401e0b[_0x72c3('0x13')]=this[_0x72c3('0x13')][_0x570a95['uniqueid']];}}}}catch(_0x3299aa){logger[_0x72c3('0x42')](_0x72c3('0xa0'),_0x570a95[_0x72c3('0x4f')],util['inspect'](_0x3299aa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x72c3('0xb')][_0x72c3('0xab')]=function(_0x3c1741,_0x3f06bc,_0xed008b){var _0x3fd607=[_0x72c3('0xac'),_0x72c3('0xad'),_0x72c3('0xae'),'rtpaudioqosjitterbridged',_0x72c3('0xaf'),_0x72c3('0xb0'),_0x72c3('0xb1'),_0x72c3('0xb2'),_0x72c3('0xb3'),_0x72c3('0xb4'),_0x72c3('0xb5'),_0x72c3('0xb6'),'membercalls',_0x72c3('0xb7'),_0x72c3('0xb8'),_0x72c3('0xb9'),_0x72c3('0xba'),_0x72c3('0xbb'),_0x72c3('0xbc')];if(!_[_0x72c3('0xbd')](_0x3f06bc)&&!_[_0x72c3('0xbe')](_0x3fd607,_0x3f06bc)){if(_[_0x72c3('0x5e')](this[_0x72c3('0x13')][_0x3c1741])){this[_0x72c3('0x13')][_0x3c1741]={};}this[_0x72c3('0x13')][_0x3c1741][_0x3f06bc]=_0xed008b;}};VoiceQueueReport[_0x72c3('0xb')]['handleHangup']=function(_0x4e67b3,_0x335537,_0x5992e3){try{var _0x382511={};if(this[_0x72c3('0x45')][_0x4e67b3]){for(var _0x1deee0=0x0;_0x1deee00x0?!![]:![];if(!_0x1f74d7){return this[_0x7754('0x1a')](this[_0x7754('0x15')][_0x7754('0x6b')]);}};VoiceQueueReport['prototype']['syncQueueMember']=function(_0x388600){var _0x3ab11c=this[_0x7754('0x15')]['id'];if(this[_0x7754('0x15')][_0x7754('0x60')][_0x3ab11c]&&this[_0x7754('0x15')][_0x7754('0x60')][_0x3ab11c][_0x388600[_0x7754('0x61')]]){this[_0x7754('0x15')][_0x7754('0x60')][_0x3ab11c][_0x388600['actionid']][_0x7754('0x10')][_0x7754('0x6c')](_0x388600);}};VoiceQueueReport[_0x7754('0xb')][_0x7754('0x17')]=function(_0x185c85){var _0x44eb5d=this;try{if(this[_0x7754('0x6d')](_0x185c85)&&this['isNotNull'](_0x185c85[_0x7754('0x4c')])){logger[_0x7754('0x48')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x7754('0x3f')](_0x185c85,{'showHidden':![],'depth':null}));var _0x42ec58=this[_0x7754('0x13')][_0x185c85[_0x7754('0x4c')]];if(_0x42ec58){logger['debug'](_0x7754('0x6e'),_0x42ec58[_0x7754('0x57')]);this['summary'][_0x7754('0x5b')][_0x42ec58[_0x7754('0x57')]]={'summaryEvent':_0x185c85};this[_0x7754('0x15')][_0x7754('0x6a')]+=0x1;return ami['Action']({'action':_0x7754('0x60'),'queue':_0x42ec58[_0x7754('0x57')]})[_0x7754('0x5f')](function(_0x2f9845){if(!_0x44eb5d['summary']['queuestatus'][_0x185c85[_0x7754('0x61')]]){_0x44eb5d[_0x7754('0x15')][_0x7754('0x60')][_0x185c85[_0x7754('0x61')]]={};}_0x44eb5d[_0x7754('0x15')][_0x7754('0x60')][_0x185c85[_0x7754('0x61')]][_0x2f9845['actionid']]={'queue':_0x42ec58[_0x7754('0x57')],'agents':[]};})[_0x7754('0x3a')](function(_0x70c62d){throw _0x70c62d;});}}}catch(_0x96b4f3){logger[_0x7754('0x3d')](_0x7754('0x6f'),util[_0x7754('0x3f')](_0x96b4f3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7754('0xb')][_0x7754('0x1a')]=function(_0x15d862){if(this[_0x7754('0x15')][_0x7754('0x6a')]>0x0){this[_0x7754('0x15')]['completeEvent']=_0x15d862;return;}logger[_0x7754('0x48')](_0x7754('0x70'),util[_0x7754('0x3f')](_0x15d862,{'showHidden':![],'depth':null}));this[_0x7754('0x15')]=initializeSummary();ami[_0x7754('0x46')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x7754('0xb')][_0x7754('0x71')]=function(_0x1f02b8){try{if(this[_0x7754('0x6d')](_0x1f02b8)){logger[_0x7754('0x48')](_0x7754('0x72'),_0x1f02b8[_0x7754('0x51')],util[_0x7754('0x3f')](_0x1f02b8,{'showHidden':![],'depth':null}));if(_[_0x7754('0x58')](this['queueReports'][_0x1f02b8[_0x7754('0x51')]])){this[_0x7754('0xe')][_0x1f02b8['uniqueid']]=[];}if(_[_0x7754('0x58')](this[_0x7754('0x11')][_0x1f02b8[_0x7754('0x51')]])){this['channels'][_0x1f02b8[_0x7754('0x51')]]={};}var _0x35c836=new QueueReport();_0x35c836[_0x7754('0x4c')]=_0x1f02b8['queue'];_0x35c836['type']=this[_0x7754('0x13')][_0x35c836[_0x7754('0x4c')]]&&this[_0x7754('0x13')][_0x35c836[_0x7754('0x4c')]][_0x7754('0x65')]?this[_0x7754('0x13')][_0x35c836[_0x7754('0x4c')]][_0x7754('0x65')]||_0x7754('0x66'):_0x7754('0x66');_0x35c836[_0x7754('0x73')]=moment()[_0x7754('0x4a')](_0x7754('0x74'));_0x35c836[_0x7754('0x75')]=_0x1f02b8[_0x7754('0x75')];_0x35c836[_0x7754('0x76')]=_0x1f02b8[_0x7754('0x76')];_0x35c836['uniqueid']=_0x1f02b8[_0x7754('0x51')];_0x35c836[_0x7754('0x77')]=this[_0x7754('0x11')][_0x1f02b8[_0x7754('0x51')]][_0x7754('0x77')];logger['info'](_0x7754('0x78'),_0x35c836[_0x7754('0x4c')],_0x35c836[_0x7754('0x65')]);Object[_0x7754('0x79')](_0x35c836,_[_0x7754('0x7a')](_0x1f02b8,_[_0x7754('0x7b')](_0x35c836)));this['queueReports'][_0x1f02b8[_0x7754('0x51')]][_0x7754('0x6c')](_0x35c836);this[_0x7754('0x11')][_0x1f02b8[_0x7754('0x51')]]=_0x35c836;this[_0x7754('0x47')](_0x35c836,'queuecallerjoin');}}catch(_0x1bcb05){logger[_0x7754('0x3d')](_0x7754('0x72'),_0x1f02b8[_0x7754('0x51')],util[_0x7754('0x3f')](_0x1bcb05,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7754('0xb')][_0x7754('0x1f')]=function(_0xfb3892){try{if(this[_0x7754('0x6d')](_0xfb3892)){logger[_0x7754('0x48')](_0x7754('0x7c'),_0xfb3892['uniqueid'],util[_0x7754('0x3f')](_0xfb3892,{'showHidden':![],'depth':null}));if(this[_0x7754('0xe')][_0xfb3892[_0x7754('0x51')]]){var _0x3eeb31=_[_0x7754('0x7d')](this[_0x7754('0xe')][_0xfb3892[_0x7754('0x51')]]);_0x3eeb31[_0x7754('0x7e')]=![];_0x3eeb31[_0x7754('0x7f')]=null;_0x3eeb31['holdtime']=_0xfb3892[_0x7754('0x80')];_0x3eeb31[_0x7754('0x81')]=_0xfb3892[_0x7754('0x81')];_0x3eeb31[_0x7754('0x82')]=!![];_0x3eeb31['queuecallerabandonAt']=moment()[_0x7754('0x4a')](_0x7754('0x74'));_0x3eeb31[_0x7754('0x52')]=_0x7754('0x83');_0x3eeb31[_0x7754('0x84')]=null;logger[_0x7754('0x85')](_0x7754('0x86'),_0x3eeb31[_0x7754('0x4c')],_0x3eeb31['type']);this['channels'][_0xfb3892['uniqueid']]=_0x3eeb31;this['emitVoiceQueueChannelRemove'](_0x3eeb31,_0x7754('0x82'));}}}catch(_0x32727d){logger[_0x7754('0x3d')](_0x7754('0x7c'),_0xfb3892[_0x7754('0x51')],util[_0x7754('0x3f')](_0x32727d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7754('0xb')][_0x7754('0x87')]=function(_0x44ca3d){try{if(this[_0x7754('0x6d')](_0x44ca3d)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x44ca3d['uniqueid'],util[_0x7754('0x3f')](_0x44ca3d,{'showHidden':![],'depth':null}));if(this[_0x7754('0xe')][_0x44ca3d['uniqueid']]){var _0x55d70f=_[_0x7754('0x7d')](this[_0x7754('0xe')][_0x44ca3d[_0x7754('0x51')]]);_0x55d70f[_0x7754('0x88')]=moment()[_0x7754('0x4a')](_0x7754('0x74'));_0x55d70f['connectedlinenum']=_0x44ca3d['connectedlinenum'];_0x55d70f[_0x7754('0x89')]=_0x44ca3d[_0x7754('0x89')];logger[_0x7754('0x85')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x55d70f['queue'],_0x55d70f[_0x7754('0x65')],_0x44ca3d[_0x7754('0x8a')],_0x44ca3d[_0x7754('0x89')]);this['channels'][_0x44ca3d[_0x7754('0x51')]]=_0x55d70f;this[_0x7754('0x47')](_0x55d70f,'queuecallerleave');}}}catch(_0x3ed0b9){logger[_0x7754('0x3d')](_0x7754('0x8b'),_0x44ca3d[_0x7754('0x51')],util[_0x7754('0x3f')](_0x3ed0b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7754('0xb')][_0x7754('0x8c')]=function(_0x4fc582){try{if(this[_0x7754('0x6d')](_0x4fc582)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x4fc582['uniqueid'],util['inspect'](_0x4fc582,{'showHidden':![],'depth':null}));if(this[_0x7754('0xe')][_0x4fc582['uniqueid']]){var _0x29e4e7=_[_0x7754('0x7d')](this[_0x7754('0xe')][_0x4fc582['uniqueid']]);_0x29e4e7[_0x7754('0x7e')]=!![];_0x29e4e7[_0x7754('0x52')]='COMPLETEDBYAGENT';logger[_0x7754('0x85')](_0x7754('0x8d'),_0x29e4e7[_0x7754('0x4c')],_0x29e4e7[_0x7754('0x65')]);}}}catch(_0x422866){logger[_0x7754('0x3d')](_0x7754('0x8e'),_0x4fc582[_0x7754('0x51')],util['inspect'](_0x422866,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7754('0xb')][_0x7754('0x22')]=function(_0x5853ad){try{if(this[_0x7754('0x6d')](_0x5853ad)){logger[_0x7754('0x48')](_0x7754('0x8f'),_0x5853ad[_0x7754('0x51')],util[_0x7754('0x3f')](_0x5853ad,{'showHidden':![],'depth':null}));if(this[_0x7754('0xe')][_0x5853ad[_0x7754('0x51')]]){var _0xa87355=_[_0x7754('0x7d')](this[_0x7754('0xe')][_0x5853ad[_0x7754('0x51')]]);_0xa87355[_0x7754('0x82')]=![];_0xa87355['queuecallerabandonAt']=null;_0xa87355[_0x7754('0x90')]=!![];_0xa87355[_0x7754('0x84')]=_0x5853ad[_0x7754('0x91')];_0xa87355['holdtime']=_0x5853ad[_0x7754('0x80')];_0xa87355[_0x7754('0x7e')]=!![];_0xa87355[_0x7754('0x92')]=![];_0xa87355[_0x7754('0x93')]=null;if(!_0xa87355[_0x7754('0x94')]){if(_0x5853ad[_0x7754('0x95')]=='transfer'){_0xa87355[_0x7754('0x52')]='COMPLETED';logger[_0x7754('0x85')](_0x7754('0x96'),_0xa87355['queue'],_0xa87355[_0x7754('0x65')]);}else{if(_[_0x7754('0x97')](_0x5853ad[_0x7754('0x39')][_0x7754('0x98')](),_0x7754('0x99'))){if(this[_0x7754('0xe')][_0x5853ad['linkedid']]){var _0x290d59=_[_0x7754('0x7d')](this[_0x7754('0xe')][_0x5853ad[_0x7754('0x9a')]]);_0x290d59[_0x7754('0x7e')]=![];_0x290d59[_0x7754('0x92')]=!![];_0x290d59['queuecallerexitAt']=moment(_0xa87355[_0x7754('0x73')])[_0x7754('0x9b')](_0x5853ad[_0x7754('0x80')],'seconds')[_0x7754('0x4a')](_0x7754('0x74'));_0x290d59[_0x7754('0x52')]='FORWARDTRANSFER';_0x290d59[_0x7754('0x94')]=!![];_0x290d59[_0x7754('0x9c')]='FORWARD';_0x290d59[_0x7754('0x9d')]=_0x5853ad['destexten'];_0x290d59['transferuniqueid']=_0x5853ad[_0x7754('0x51')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x290d59[_0x7754('0x4c')],_0x290d59[_0x7754('0x65')]);var _0x160603=this[_0x7754('0xe')][_0x5853ad[_0x7754('0x9a')]];this[_0x7754('0xe')][_0x5853ad[_0x7754('0x9a')]]=this['queueReports'][_0x5853ad['uniqueid']];this[_0x7754('0xe')][_0x5853ad[_0x7754('0x51')]]=_0x160603;}}else{_0xa87355[_0x7754('0x52')]='COMPLETEDBY'+_0x5853ad[_0x7754('0x95')][_0x7754('0x9e')]();logger[_0x7754('0x85')](_0x7754('0x9f'),_0xa87355[_0x7754('0x4c')],_0xa87355['type'],_0xa87355[_0x7754('0x52')]);}}}this[_0x7754('0x11')][_0x5853ad[_0x7754('0x51')]]=_0xa87355;}}}catch(_0x388650){logger[_0x7754('0x3d')](_0x7754('0x8f'),_0x5853ad[_0x7754('0x51')],util[_0x7754('0x3f')](_0x388650,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7754('0xb')][_0x7754('0x24')]=function(_0x46bd31){try{if(this[_0x7754('0x6d')](_0x46bd31)){logger[_0x7754('0x48')]('[%s][voiceQueueReport][varset]',_0x46bd31[_0x7754('0x51')],util['inspect'](_0x46bd31,{'showHidden':![],'depth':null}));this[_0x7754('0xa0')](_0x46bd31[_0x7754('0x51')],_[_0x7754('0x7b')](_0x46bd31[_0x7754('0xa1')])[0x0],_0x46bd31[_0x7754('0xa2')]);if(this[_0x7754('0xe')][_0x46bd31[_0x7754('0x51')]]){var _0x323887=_[_0x7754('0x7d')](this[_0x7754('0xe')][_0x46bd31[_0x7754('0x51')]]);if(_0x323887){if(this[_0x7754('0x6d')](_0x46bd31[_0x7754('0xa1')])&&this[_0x7754('0x6d')](_0x46bd31['variable'][_0x7754('0x60')])){switch(_0x46bd31[_0x7754('0xa2')]){case _0x7754('0xa3'):_0x323887[_0x7754('0x92')]=![];_0x323887[_0x7754('0x93')]=null;break;case _0x7754('0xa4'):_0x323887[_0x7754('0xa5')]=_0x7754('0xa6');_0x323887[_0x7754('0x92')]=!![];_0x323887[_0x7754('0x93')]=moment()[_0x7754('0x4a')](_0x7754('0x74'));_0x323887[_0x7754('0x88')]=moment()[_0x7754('0x4a')](_0x7754('0x74'));logger[_0x7754('0x48')](_0x7754('0xa7'),_0x46bd31[_0x7754('0x51')],util[_0x7754('0x3f')](_0x323887,{'showHidden':![],'depth':null}));ami[_0x7754('0x46')](_0x7754('0xa8'),_0x323887);break;default:_0x323887['queuecallerexit']=!![];_0x323887['queuecallerexitAt']=moment()[_0x7754('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x323887[_0x7754('0x88')]=moment()[_0x7754('0x4a')](_0x7754('0x74'));}_0x323887[_0x7754('0x82')]=![];_0x323887[_0x7754('0xa9')]=null;_0x323887[_0x7754('0x52')]=_0x46bd31['value'];this[_0x7754('0x11')][_0x46bd31[_0x7754('0x51')]]=_0x323887;this[_0x7754('0x44')](_0x323887,'varset');}else if(this['isNotNull'](_0x46bd31[_0x7754('0xa1')])&&this[_0x7754('0x6d')](_0x46bd31[_0x7754('0xa1')][_0x7754('0xaa')])){if(!_0x323887['queuecallerabandon']){_0x323887[_0x7754('0x92')]=!![];_0x323887[_0x7754('0x93')]=moment()['format'](_0x7754('0x74'));_0x323887[_0x7754('0x52')]='EXITWITHKEY';_0x323887[_0x7754('0x88')]=moment()[_0x7754('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7754('0x11')][_0x46bd31[_0x7754('0x51')]]=_0x323887;}}logger[_0x7754('0x85')](_0x7754('0xab'),_0x46bd31[_0x7754('0x51')],_0x323887[_0x7754('0x4c')],_0x323887['type'],_[_0x7754('0x7b')](_0x46bd31[_0x7754('0xa1')])[0x0],_0x46bd31['value']);_0x323887[_0x7754('0x40')]=this[_0x7754('0x40')][_0x46bd31[_0x7754('0x51')]];}}}}catch(_0x2775d1){logger['error'](_0x7754('0xac'),_0x46bd31[_0x7754('0x51')],util[_0x7754('0x3f')](_0x2775d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7754('0xb')][_0x7754('0xa0')]=function(_0x2cc6a1,_0x4eb085,_0xd90a53){var _0x4e6ce7=['rtpaudioqos','rtpaudioqosbridged',_0x7754('0xad'),'rtpaudioqosjitterbridged',_0x7754('0xae'),_0x7754('0xaf'),_0x7754('0xb0'),_0x7754('0xb1'),'sipcallid',_0x7754('0xb2'),_0x7754('0xb3'),_0x7754('0xb4'),_0x7754('0xb5'),_0x7754('0xb6'),_0x7754('0xb7'),_0x7754('0xb8'),_0x7754('0x91'),'memberpenalty',_0x7754('0xb9')];if(!_['isNil'](_0x4eb085)&&!_['includes'](_0x4e6ce7,_0x4eb085)){if(_['isUndefined'](this[_0x7754('0x40')][_0x2cc6a1])){this[_0x7754('0x40')][_0x2cc6a1]={};}this[_0x7754('0x40')][_0x2cc6a1][_0x4eb085]=_0xd90a53;}};VoiceQueueReport[_0x7754('0xb')]['handleHangup']=function(_0x521b1f,_0x385475,_0x20a0c0){try{var _0x23ded4={};if(this[_0x7754('0xe')][_0x521b1f]){for(var _0x159afc=0x0;_0x159afc=0x0?moment(_0x156ed3[_0x38ef('0x1a')])[_0x38ef('0xe')](_0x156ed3[_0x38ef('0x19')],_0x38ef('0xf')):null,'data1':'outbound','data2':_0x156ed3[_0x38ef('0x13')],'data3':_0x156ed3[_0x38ef('0x1b')],'data4':_0x156ed3[_0x38ef('0x1c')]||null,'role':_0x38ef('0x12'),'internal':_0x156ed3['accountcode']?_[_0x38ef('0x14')](_0x156ed3[_0x38ef('0x13')]):undefined,'uniqueid':_0x156ed3[_0x38ef('0x15')]},'log':_0x38ef('0x7')});}; \ No newline at end of file +var _0xb185=['accountcode','uniqueid','voiceDialReport','Request','membername','starttime','endtime','outbound','exten','dialstring','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','diff','queuecallerleaveAt','seconds','inbound','calleridnum','queue','agent','toNumber'];(function(_0x2aff17,_0x29499d){var _0x1c939a=function(_0x3a1b69){while(--_0x3a1b69){_0x2aff17['push'](_0x2aff17['shift']());}};_0x1c939a(++_0x29499d);}(_0xb185,0x1a0));var _0x5b18=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb185[_0x5d6456];return _0x4d66c1;};'use strict';var moment=require('moment');var _=require(_0x5b18('0x0'));var util=require(_0x5b18('0x1'));var client=require(_0x5b18('0x2'));exports['voiceQueueReport']=function(_0x15cdd1){var _0x2a6344=_0x15cdd1[_0x5b18('0x3')]||_0x15cdd1[_0x5b18('0x4')];return client['Request'](_0x5b18('0x5'),{'body':{'channel':'voice','membername':_0x15cdd1[_0x5b18('0x6')],'interface':_[_0x5b18('0x7')](_0x15cdd1[_0x5b18('0x8')])?util[_0x5b18('0x9')](_0x5b18('0xa'),_0x15cdd1[_0x5b18('0x6')]):_0x15cdd1[_0x5b18('0x8')],'type':'TALKING','enterAt':_0x15cdd1['queuecallerleaveAt'],'exitAt':_0x2a6344,'duration':moment(_0x2a6344)[_0x5b18('0xb')](_0x15cdd1[_0x5b18('0xc')],_0x5b18('0xd')),'data1':_0x5b18('0xe'),'data2':_0x15cdd1[_0x5b18('0xf')],'data3':_0x15cdd1['exten'],'data4':null,'data5':_0x15cdd1[_0x5b18('0x10')],'role':_0x5b18('0x11'),'internal':_0x15cdd1['accountcode']?_[_0x5b18('0x12')](_0x15cdd1[_0x5b18('0x13')]):undefined,'uniqueid':_0x15cdd1[_0x5b18('0x14')]},'log':'CreateMemberReport'});};exports[_0x5b18('0x15')]=function(_0x3ed5e5){return client[_0x5b18('0x16')](_0x5b18('0x5'),{'body':{'channel':'voice','membername':_0x3ed5e5[_0x5b18('0x17')],'interface':_0x3ed5e5[_0x5b18('0x8')],'type':'TALKING','enterAt':_0x3ed5e5[_0x5b18('0x18')],'exitAt':_0x3ed5e5[_0x5b18('0x19')],'duration':moment(_0x3ed5e5[_0x5b18('0x19')])['diff'](_0x3ed5e5[_0x5b18('0x18')],'seconds')>=0x0?moment(_0x3ed5e5[_0x5b18('0x19')])[_0x5b18('0xb')](_0x3ed5e5[_0x5b18('0x18')],_0x5b18('0xd')):null,'data1':_0x5b18('0x1a'),'data2':_0x3ed5e5[_0x5b18('0x13')],'data3':_0x3ed5e5[_0x5b18('0x1b')],'data4':_0x3ed5e5[_0x5b18('0x1c')]||null,'role':_0x5b18('0x11'),'internal':_0x3ed5e5['accountcode']?_['toNumber'](_0x3ed5e5['accountcode']):undefined,'uniqueid':_0x3ed5e5['uniqueid']},'log':_0x5b18('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 229167e..9e17b59 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 _0x74f4=['../client','getSettings','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x74f4,0xaa));var _0x474f=function(_0x4c10ac,_0x3a668d){_0x4c10ac=_0x4c10ac-0x0;var _0x36f544=_0x74f4[_0x4c10ac];return _0x36f544;};'use strict';var client=require(_0x474f('0x0'));exports[_0x474f('0x1')]=function(){return client['Request'](_0x474f('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x474f('0x3'),'previewRecallmeReminderInterval']},'log':_0x474f('0x4')});}; \ No newline at end of file +var _0x13eb=['ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x17eb60,_0x406261){var _0x37dd03=function(_0x14b313){while(--_0x14b313){_0x17eb60['push'](_0x17eb60['shift']());}};_0x37dd03(++_0x406261);}(_0x13eb,0x8f));var _0xb13e=function(_0x4a92c2,_0x28ed8b){_0x4a92c2=_0x4a92c2-0x0;var _0x7b52f1=_0x13eb[_0x4a92c2];return _0x7b52f1;};'use strict';var client=require(_0xb13e('0x0'));exports[_0xb13e('0x1')]=function(){return client['Request'](_0xb13e('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb13e('0x3'),'previewRecallmeReminderInterval']},'log':_0xb13e('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 31416ff..329243d 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 _0x7af9=['../client','getTemplates','name','GetTemplate'];(function(_0x271608,_0x54a796){var _0x5c8c31=function(_0x2e1518){while(--_0x2e1518){_0x271608['push'](_0x271608['shift']());}};_0x5c8c31(++_0x54a796);}(_0x7af9,0x7c));var _0x97af=function(_0x95f841,_0x357b1b){_0x95f841=_0x95f841-0x0;var _0x1c68bf=_0x7af9[_0x95f841];return _0x1c68bf;};'use strict';var client=require(_0x97af('0x0'));exports[_0x97af('0x1')]=function(_0x17c8ec){return function(_0x27930f){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x97af('0x2'),'html']},'log':_0x97af('0x3')});};}; \ No newline at end of file +var _0x5f66=['html','getTemplates','Request','GetTemplate','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var client=require('../client');exports[_0x65f6('0x0')]=function(_0x4a3887){return function(_0x2d5fd9){return client[_0x65f6('0x1')](_0x65f6('0x2'),{'options':{'raw':!![],'attributes':['id',_0x65f6('0x3'),_0x65f6('0x4')]},'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 1f174a1..c46cee1 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 _0x8b08=['Request','GetTrigger','name','Condition','AllConditions','operator','value','Action','action','data1','data2','data4','data5','data6','data7','getTriggers'];(function(_0x5d9df6,_0x1b26d5){var _0x8ebd11=function(_0x4239a3){while(--_0x4239a3){_0x5d9df6['push'](_0x5d9df6['shift']());}};_0x8ebd11(++_0x1b26d5);}(_0x8b08,0x8f));var _0x88b0=function(_0x1307fa,_0x4b6304){_0x1307fa=_0x1307fa-0x0;var _0x357c8b=_0x8b08[_0x1307fa];return _0x357c8b;};'use strict';var client=require('../client');exports[_0x88b0('0x0')]=function(_0x5206c6){return function(_0xafa81a){return client[_0x88b0('0x1')](_0x88b0('0x2'),{'options':{'raw':![],'attributes':['id',_0x88b0('0x3'),'channel','status'],'include':[{'model':_0x88b0('0x4'),'as':_0x88b0('0x5'),'attributes':['id','field',_0x88b0('0x6'),_0x88b0('0x7')]},{'model':_0x88b0('0x4'),'as':'AnyConditions','attributes':['id','field',_0x88b0('0x6'),'value']},{'model':_0x88b0('0x8'),'as':'Actions','attributes':['id',_0x88b0('0x9'),_0x88b0('0xa'),_0x88b0('0xb'),'data3',_0x88b0('0xc'),_0x88b0('0xd'),_0x88b0('0xe'),_0x88b0('0xf')]}]},'log':_0x88b0('0x2')});};}; \ No newline at end of file +var _0x43a4=['AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data2','data5','Request','GetTrigger','name','channel','status','Condition'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x43a4,0x14e));var _0x443a=function(_0x32c78e,_0x32cc40){_0x32c78e=_0x32c78e-0x0;var _0x5dc750=_0x43a4[_0x32c78e];return _0x5dc750;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x34f78a){return function(_0x46d41d){return client[_0x443a('0x0')](_0x443a('0x1'),{'options':{'raw':![],'attributes':['id',_0x443a('0x2'),_0x443a('0x3'),_0x443a('0x4')],'include':[{'model':_0x443a('0x5'),'as':_0x443a('0x6'),'attributes':['id',_0x443a('0x7'),_0x443a('0x8'),_0x443a('0x9')]},{'model':'Condition','as':_0x443a('0xa'),'attributes':['id',_0x443a('0x7'),_0x443a('0x8'),_0x443a('0x9')]},{'model':_0x443a('0xb'),'as':_0x443a('0xc'),'attributes':['id',_0x443a('0xd'),_0x443a('0xe'),_0x443a('0xf'),'data3','data4',_0x443a('0x10'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index dddf8eb..3178943 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 _0x09d3=['GetTrunk','name','registry','../client','getTrunks','Request'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x09d3,0xa5));var _0x309d=function(_0x381961,_0x297382){_0x381961=_0x381961-0x0;var _0x1a2de0=_0x09d3[_0x381961];return _0x1a2de0;};'use strict';var client=require(_0x309d('0x0'));exports[_0x309d('0x1')]=function(_0x380df3){return function(_0x427b73){return client[_0x309d('0x2')](_0x309d('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x309d('0x4'),_0x309d('0x5'),'defaultuser']},'log':_0x309d('0x3')});};}; \ No newline at end of file +var _0x2d6e=['GetTrunk','name','registry','defaultuser','../client','getTrunks','Request'];(function(_0x33a0ec,_0x3730){var _0x4b487b=function(_0xe9afb8){while(--_0xe9afb8){_0x33a0ec['push'](_0x33a0ec['shift']());}};_0x4b487b(++_0x3730);}(_0x2d6e,0x107));var _0xe2d6=function(_0x2f4c5b,_0xd1a4dd){_0x2f4c5b=_0x2f4c5b-0x0;var _0x5e9878=_0x2d6e[_0x2f4c5b];return _0x5e9878;};'use strict';var client=require(_0xe2d6('0x0'));exports[_0xe2d6('0x1')]=function(_0xdff164){return function(_0x5d1dad){return client[_0xe2d6('0x2')](_0xe2d6('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe2d6('0x4'),_0xe2d6('0x5'),_0xe2d6('0x6')]},'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 0473b26..6ecd136 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(_0x5227a1,_0x2404df){var _0x3a930e=function(_0x37aa64){while(--_0x37aa64){_0x5227a1['push'](_0x5227a1['shift']());}};_0x3a930e(++_0x2404df);}(_0x70e0,0x17b));var _0x070e=function(_0x36f57d,_0x530f3d){_0x36f57d=_0x36f57d-0x0;var _0x545092=_0x70e0[_0x36f57d];return _0x545092;};'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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x41d0c4,_0x18f17f){var _0x213b7d=function(_0x41d1d3){while(--_0x41d1d3){_0x41d0c4['push'](_0x41d0c4['shift']());}};_0x213b7d(++_0x18f17f);}(_0x70e0,0x17b));var _0x070e=function(_0x1745e7,_0x38e6c){_0x1745e7=_0x1745e7-0x0;var _0x10845e=_0x70e0[_0x1745e7];return _0x10845e;};'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 diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 1d5f5ea..091bce4 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 _0x0cec=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x0cec,0xe3));var _0xc0ce=function(_0x9f78cc,_0x46779c){_0x9f78cc=_0x9f78cc-0x0;var _0x2ae787=_0x0cec[_0x9f78cc];return _0x2ae787;};'use strict';var client=require(_0xc0ce('0x0'));exports['create']=function(_0x43508c){return client[_0xc0ce('0x1')](_0xc0ce('0x2'),{'body':_0x43508c,'log':_0xc0ce('0x2')});};exports[_0xc0ce('0x3')]=function(_0x3da61c,_0x1b9ce4,_0x172aab){return client[_0xc0ce('0x1')](_0xc0ce('0x4'),{'body':_0x3da61c,'options':{'where':{'uniqueid':_0x1b9ce4,'interface':_0x172aab,'agentcomplete':!![]}},'log':_0xc0ce('0x4')});}; \ No newline at end of file +var _0x31f7=['update','UpdateVoiceAgentReport'];(function(_0x851fe7,_0x5effd3){var _0x2bef77=function(_0x138be4){while(--_0x138be4){_0x851fe7['push'](_0x851fe7['shift']());}};_0x2bef77(++_0x5effd3);}(_0x31f7,0xcc));var _0x731f=function(_0x57bd02,_0x5a5b23){_0x57bd02=_0x57bd02-0x0;var _0x269e47=_0x31f7[_0x57bd02];return _0x269e47;};'use strict';var client=require('../client');exports['create']=function(_0x3dedfc){return client['Request']('CreateVoiceAgentReport',{'body':_0x3dedfc,'log':'CreateVoiceAgentReport'});};exports[_0x731f('0x0')]=function(_0x5e8208,_0x588362,_0x564cea){return client['Request']('UpdateVoiceAgentReport',{'body':_0x5e8208,'options':{'where':{'uniqueid':_0x588362,'interface':_0x564cea,'agentcomplete':!![]}},'log':_0x731f('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 0b1dab6..eda229a 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 _0xfadd=['callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','billableseconds','GetVoiceCallReports','moment','util','Request','CreateVoiceCallReport','merge','calleridnum','context'];(function(_0x13e24e,_0x341a15){var _0x9d6c1e=function(_0x4dba4e){while(--_0x4dba4e){_0x13e24e['push'](_0x13e24e['shift']());}};_0x9d6c1e(++_0x341a15);}(_0xfadd,0x161));var _0xdfad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfadd[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xdfad('0x0'));var util=require(_0xdfad('0x1'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x279953){return client[_0xdfad('0x2')](_0xdfad('0x3'),{'body':_[_0xdfad('0x4')](_0x279953,{'source':_0x279953[_0xdfad('0x5')],'destinationcontext':_0x279953[_0xdfad('0x6')],'callerid':_0x279953[_0xdfad('0x7')],'amaflags':_0xdfad('0x8')}),'log':_0xdfad('0x3')});};exports[_0xdfad('0x9')]=function(){return function(){return client[_0xdfad('0x2')](_0xdfad('0xa'),{'options':{'where':{'type':[_0xdfad('0xb')],'createdAt':{'$between':[moment()[_0xdfad('0xc')](_0xdfad('0xd'))[_0xdfad('0xe')](_0xdfad('0xf')),moment()[_0xdfad('0x10')](_0xdfad('0xd'))[_0xdfad('0xe')](_0xdfad('0xf'))]}},'attributes':[_0xdfad('0x11'),'disposition','duration',_0xdfad('0x12')]},'log':_0xdfad('0x13')});};}; \ No newline at end of file +var _0x543b=['Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','endOf','day','YYYY-MM-DD\x20HH:mm:ss','type','disposition','GetVoiceCallReports','moment','util','lodash','create'];(function(_0x294fd5,_0x32da17){var _0x3bc562=function(_0x1cefae){while(--_0x1cefae){_0x294fd5['push'](_0x294fd5['shift']());}};_0x3bc562(++_0x32da17);}(_0x543b,0x1f4));var _0xb543=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x543b[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0xb543('0x0'));var util=require(_0xb543('0x1'));var _=require(_0xb543('0x2'));var client=require('../client');exports[_0xb543('0x3')]=function(_0x21e634){return client[_0xb543('0x4')](_0xb543('0x5'),{'body':_[_0xb543('0x6')](_0x21e634,{'source':_0x21e634[_0xb543('0x7')],'destinationcontext':_0x21e634[_0xb543('0x8')],'callerid':_0x21e634[_0xb543('0x9')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xb543('0xa')]=function(){return function(){return client['Request'](_0xb543('0xb'),{'options':{'where':{'type':[_0xb543('0xc')],'createdAt':{'$between':[moment()[_0xb543('0xd')]('day')[_0xb543('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xb543('0xf')](_0xb543('0x10'))['format'](_0xb543('0x11'))]}},'attributes':[_0xb543('0x12'),_0xb543('0x13'),'duration','billableseconds']},'log':_0xb543('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 2dcb9a2..bd071f2 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 _0x7e15=['create','Request','CreateVoiceDialReport','../client'];(function(_0x5bff21,_0x17cfa3){var _0x1825a6=function(_0x161dc8){while(--_0x161dc8){_0x5bff21['push'](_0x5bff21['shift']());}};_0x1825a6(++_0x17cfa3);}(_0x7e15,0x14f));var _0x57e1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7e15[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x57e1('0x0'));exports[_0x57e1('0x1')]=function(_0x225a8b){return client[_0x57e1('0x2')](_0x57e1('0x3'),{'body':_0x225a8b,'log':_0x57e1('0x3')});}; \ No newline at end of file +var _0x6d9e=['CreateVoiceDialReport','../client','create','Request'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x6d9e,0x161));var _0xe6d9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6d9e[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0xe6d9('0x0'));exports[_0xe6d9('0x1')]=function(_0x39e978){return client[_0xe6d9('0x2')](_0xe6d9('0x3'),{'body':_0x39e978,'log':_0xe6d9('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index dc35125..52e1721 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 _0x0901=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x2181cc,_0x38da3a){var _0x34145f=function(_0x5ce602){while(--_0x5ce602){_0x2181cc['push'](_0x2181cc['shift']());}};_0x34145f(++_0x38da3a);}(_0x0901,0x134));var _0x1090=function(_0x1690e9,_0x2fd143){_0x1690e9=_0x1690e9-0x0;var _0x5c3024=_0x0901[_0x1690e9];return _0x5c3024;};'use strict';var client=require(_0x1090('0x0'));exports[_0x1090('0x1')]=function(){return function(){return client[_0x1090('0x2')](_0x1090('0x3'),{'options':{'raw':!![],'attributes':['id',_0x1090('0x4'),_0x1090('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xceb0=['getVoiceExtensions','exten'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xceb0,0x173));var _0x0ceb=function(_0x1c11ab,_0x162858){_0x1c11ab=_0x1c11ab-0x0;var _0x5b3ce7=_0xceb0[_0x1c11ab];return _0x5b3ce7;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x0ceb('0x0'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x0ceb('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b7c3e7e..140704c 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 _0xf109=['Trunk','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','dialMethod','dialLimitChannel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'];(function(_0x6982f4,_0x1bdb2d){var _0x4a2a5f=function(_0x432de7){while(--_0x432de7){_0x6982f4['push'](_0x6982f4['shift']());}};_0x4a2a5f(++_0x1bdb2d);}(_0xf109,0x76));var _0x9f10=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xf109[_0x4d613c];return _0x301fe3;};'use strict';var client=require(_0x9f10('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x9f10('0x1')](_0x9f10('0x2'),{'options':{'raw':![],'attributes':['id',_0x9f10('0x3'),_0x9f10('0x4'),_0x9f10('0x5'),_0x9f10('0x6'),'monitor_format','type','dialActive',_0x9f10('0x7'),_0x9f10('0x8'),'dialLimitQueue','dialPowerLevel',_0x9f10('0x9'),'dialPredictiveOptimizationPercentage',_0x9f10('0xa'),_0x9f10('0xb'),_0x9f10('0xc'),'dialOriginateTimeout','dialQueueOptions','dialQueueTimeout',_0x9f10('0xd'),'dialCongestionMaxRetry',_0x9f10('0xe'),_0x9f10('0xf'),_0x9f10('0x10'),_0x9f10('0x11'),_0x9f10('0x12'),_0x9f10('0x13'),'dialTimezone',_0x9f10('0x14'),_0x9f10('0x15'),'dialCheckDuplicateType','dialAMDActive',_0x9f10('0x16'),'dialAMDGreeting',_0x9f10('0x17'),_0x9f10('0x18'),_0x9f10('0x19'),'dialAMDBetweenWordsSilence',_0x9f10('0x1a'),_0x9f10('0x1b'),_0x9f10('0x1c'),'timeout',_0x9f10('0x1d'),_0x9f10('0x1e'),_0x9f10('0x1f'),'dialAgiAfterHangupAgent',_0x9f10('0x20'),_0x9f10('0x21'),'monitor_format',_0x9f10('0x22'),'dialRandomLastDigitCallerIdNumber',_0x9f10('0x23'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0x9f10('0x24'),_0x9f10('0x25'),_0x9f10('0x26'),_0x9f10('0x27'),'dialMachineRetryFrequency',_0x9f10('0x28'),_0x9f10('0x29'),_0x9f10('0x2a'),_0x9f10('0x2b'),_0x9f10('0x2c'),_0x9f10('0x2d'),_0x9f10('0x2e')],'include':[{'model':_0x9f10('0x2f'),'as':_0x9f10('0x2f'),'attributes':['id',_0x9f10('0x3'),'callerid',_0x9f10('0x30')]},{'model':_0x9f10('0x31'),'as':_0x9f10('0x32'),'attributes':['id',_0x9f10('0x3')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id','name','callerid',_0x9f10('0x30')]},{'model':_0x9f10('0x33'),'as':_0x9f10('0x33'),'attributes':['id','name'],'include':[{'model':_0x9f10('0x33'),'as':_0x9f10('0x34'),'attributes':['id',_0x9f10('0x3'),_0x9f10('0x35')]}]}]},'log':_0x9f10('0x36')});};}; \ No newline at end of file +var _0x066a=['dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','name','acw','autopause','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType'];(function(_0x1d68d3,_0xa3bb90){var _0x2416f0=function(_0x1ae53e){while(--_0x1ae53e){_0x1d68d3['push'](_0x1d68d3['shift']());}};_0x2416f0(++_0xa3bb90);}(_0x066a,0x9b));var _0xa066=function(_0x439f15,_0x12fccf){_0x439f15=_0x439f15-0x0;var _0x52ef57=_0x066a[_0x439f15];return _0x52ef57;};'use strict';var client=require(_0xa066('0x0'));exports[_0xa066('0x1')]=function(){return function(){return client[_0xa066('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xa066('0x3'),_0xa066('0x4'),'acwTimeout',_0xa066('0x5'),'monitor_format',_0xa066('0x6'),_0xa066('0x7'),_0xa066('0x8'),'dialLimitChannel',_0xa066('0x9'),_0xa066('0xa'),_0xa066('0xb'),_0xa066('0xc'),_0xa066('0xd'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xa066('0xe'),'dialQueueOptions',_0xa066('0xf'),_0xa066('0x10'),_0xa066('0x11'),_0xa066('0x12'),_0xa066('0x13'),_0xa066('0x14'),_0xa066('0x15'),'dialNoAnswerRetryFrequency',_0xa066('0x16'),'dialTimezone','dialGlobalInterval',_0xa066('0x17'),_0xa066('0x18'),_0xa066('0x19'),'dialAMDInitialSilence',_0xa066('0x1a'),'dialAMDAfterGreetingSilence',_0xa066('0x1b'),_0xa066('0x1c'),'dialAMDBetweenWordsSilence',_0xa066('0x1d'),_0xa066('0x1e'),_0xa066('0x1f'),_0xa066('0x20'),_0xa066('0x21'),_0xa066('0x22'),_0xa066('0x23'),_0xa066('0x24'),_0xa066('0x25'),_0xa066('0x26'),_0xa066('0x27'),'strategy',_0xa066('0x28'),'dialCutDigit',_0xa066('0x29'),_0xa066('0x2a'),_0xa066('0x2b'),_0xa066('0x2c'),'dialAbandonedMaxRetry',_0xa066('0x2d'),'dialMachineMaxRetry',_0xa066('0x2e'),_0xa066('0x2f'),_0xa066('0x30'),_0xa066('0x31'),_0xa066('0x32'),_0xa066('0x33'),'dialPreviewAutoRecallMe',_0xa066('0x34')],'include':[{'model':_0xa066('0x35'),'as':_0xa066('0x35'),'attributes':['id',_0xa066('0x3'),_0xa066('0x36'),_0xa066('0x37')]},{'model':'Pause','as':_0xa066('0x38'),'attributes':['id',_0xa066('0x3')]},{'model':'Trunk','as':_0xa066('0x39'),'attributes':['id',_0xa066('0x3'),'callerid',_0xa066('0x37')]},{'model':'Interval','as':_0xa066('0x3a'),'attributes':['id',_0xa066('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xa066('0x3'),_0xa066('0x3b')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 8c4dde1..85f0cc6 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(_0x561f25,_0x17faa2){var _0x5f251a=function(_0x2bbe7e){while(--_0x2bbe7e){_0x561f25['push'](_0x561f25['shift']());}};_0x5f251a(++_0x17faa2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x5a54f2,_0x774ad6){var _0x1fffe9=function(_0x317519){while(--_0x317519){_0x5a54f2['push'](_0x5a54f2['shift']());}};_0x1fffe9(++_0x774ad6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 fcd5f75..c7aee20 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 _0x7bcd=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x7bcd,0xc5));var _0xd7bc=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x7bcd[_0x5ef905];return _0x367808;};'use strict';var client=require(_0xd7bc('0x0'));exports[_0xd7bc('0x1')]=function(_0x3697f7){return function(){return client[_0xd7bc('0x2')](_0xd7bc('0x3'),{'options':{'where':{'VoiceQueueId':_0x3697f7,'paused':!![]},'raw':!![]},'log':_0xd7bc('0x1')});};}; \ No newline at end of file +var _0xb364=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x35a704,_0x37bd65){var _0x23aba6=function(_0x3a1f5f){while(--_0x3a1f5f){_0x35a704['push'](_0x35a704['shift']());}};_0x23aba6(++_0x37bd65);}(_0xb364,0xd2));var _0x4b36=function(_0x473b04,_0x30fbcb){_0x473b04=_0x473b04-0x0;var _0x3cdacc=_0xb364[_0x473b04];return _0x3cdacc;};'use strict';var client=require('../client');exports[_0x4b36('0x0')]=function(_0x4cb270){return function(){return client[_0x4b36('0x1')](_0x4b36('0x2'),{'options':{'where':{'VoiceQueueId':_0x4cb270,'paused':!![]},'raw':!![]},'log':_0x4b36('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 13196c8..e2baf67 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x5068e3,_0xb3fdd9){var _0x2b5bfc=function(_0x25b585){while(--_0x25b585){_0x5068e3['push'](_0x5068e3['shift']());}};_0x2b5bfc(++_0xb3fdd9);}(_0x7a54,0x106));var _0x47a5=function(_0x18ffd7,_0x23c33e){_0x18ffd7=_0x18ffd7-0x0;var _0xca2d89=_0x7a54[_0x18ffd7];return _0xca2d89;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x50010d,_0x47042e){var _0x45bb5d=function(_0x2935fb){while(--_0x2935fb){_0x50010d['push'](_0x50010d['shift']());}};_0x45bb5d(++_0x47042e);}(_0x7a54,0x106));var _0x47a5=function(_0x302cdf,_0x19bd50){_0x302cdf=_0x302cdf-0x0;var _0x178e48=_0x7a54[_0x302cdf];return _0x178e48;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index acfb615..37fdbba 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 _0x1f08=['transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal','context','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x1f08,0x1d4));var _0x81f0=function(_0x281ef5,_0x597db6){_0x281ef5=_0x281ef5-0x0;var _0x3be7dc=_0x1f08[_0x281ef5];return _0x3be7dc;};'use strict';var client=require(_0x81f0('0x0'));exports[_0x81f0('0x1')]={};exports[_0x81f0('0x2')]=function(_0x1254db){return client[_0x81f0('0x3')](_0x81f0('0x4'),{'body':{'result':_0x1254db[_0x81f0('0x5')],'transfererchannel':_0x1254db[_0x81f0('0x6')],'transferercalleridnum':_0x1254db[_0x81f0('0x7')],'transferercalleridname':_0x1254db[_0x81f0('0x8')],'transfererconnectedlinenum':_0x1254db[_0x81f0('0x9')],'transfererconnectedlinename':_0x1254db[_0x81f0('0xa')],'transfereraccountcode':_0x1254db['transfereraccountcode'],'transferercontext':_0x1254db[_0x81f0('0xb')],'transfererexten':_0x1254db[_0x81f0('0xc')],'transfererlinkedid':_0x1254db[_0x81f0('0xd')],'transfereechannel':_0x1254db[_0x81f0('0xe')],'transfereecalleridnum':_0x1254db[_0x81f0('0xf')],'transfereecalleridname':_0x1254db[_0x81f0('0x10')],'transfereeconnectedlinenum':_0x1254db['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1254db[_0x81f0('0x11')],'transfereeaccountcode':_0x1254db['transfereeaccountcode'],'transfereecontext':_0x1254db[_0x81f0('0x12')],'transfereeexten':_0x1254db[_0x81f0('0x13')],'transfereelinkedid':_0x1254db['transfereelinkedid'],'isexternal':_0x1254db[_0x81f0('0x14')],'context':_0x1254db[_0x81f0('0x15')],'extension':_0x1254db['extension'],'type':_0x81f0('0x16')},'log':_0x81f0('0x4')});};exports[_0x81f0('0x17')]=function(_0x4dd812){return client['Request'](_0x81f0('0x4'),{'body':{'result':_0x4dd812['result'],'transfererchannel':_0x4dd812[_0x81f0('0x18')],'transferercalleridnum':_0x4dd812['origtransferercalleridnum'],'transferercalleridname':_0x4dd812[_0x81f0('0x19')],'transfererconnectedlinenum':_0x4dd812[_0x81f0('0x1a')],'transfererconnectedlinename':_0x4dd812['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4dd812[_0x81f0('0x1b')],'transferercontext':_0x4dd812[_0x81f0('0x1c')],'transfererexten':_0x4dd812[_0x81f0('0x1d')],'transfererlinkedid':_0x4dd812[_0x81f0('0x1e')],'transfereechannel':_0x4dd812[_0x81f0('0x1f')],'transfereecalleridnum':_0x4dd812[_0x81f0('0x20')],'transfereecalleridname':_0x4dd812[_0x81f0('0x21')],'transfereeconnectedlinenum':_0x4dd812['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4dd812['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4dd812[_0x81f0('0x22')],'transfereecontext':_0x4dd812[_0x81f0('0x23')],'transfereeexten':_0x4dd812[_0x81f0('0x24')],'transfereelinkedid':_0x4dd812['transfertargetlinkedid'],'isexternal':_0x4dd812[_0x81f0('0x14')],'context':_0x4dd812[_0x81f0('0x25')],'extension':_0x4dd812[_0x81f0('0x26')],'type':_0x81f0('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x75df=['transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','origtransferercontext','origtransfererexten','attended','Request','transfererchannel','transferercalleridname'];(function(_0x56a245,_0x4afa3e){var _0x225e8f=function(_0x4e9191){while(--_0x4e9191){_0x56a245['push'](_0x56a245['shift']());}};_0x225e8f(++_0x4afa3e);}(_0x75df,0x17e));var _0xf75d=function(_0x1cc172,_0x321103){_0x1cc172=_0x1cc172-0x0;var _0x1b6d4f=_0x75df[_0x1cc172];return _0x1b6d4f;};'use strict';var client=require('../client');exports['transfers']={};exports['blindTransfer']=function(_0x585ed5){return client[_0xf75d('0x0')]('CreateVoiceTransferReport',{'body':{'result':_0x585ed5['result'],'transfererchannel':_0x585ed5[_0xf75d('0x1')],'transferercalleridnum':_0x585ed5['transferercalleridnum'],'transferercalleridname':_0x585ed5[_0xf75d('0x2')],'transfererconnectedlinenum':_0x585ed5[_0xf75d('0x3')],'transfererconnectedlinename':_0x585ed5[_0xf75d('0x4')],'transfereraccountcode':_0x585ed5['transfereraccountcode'],'transferercontext':_0x585ed5['transferercontext'],'transfererexten':_0x585ed5[_0xf75d('0x5')],'transfererlinkedid':_0x585ed5[_0xf75d('0x6')],'transfereechannel':_0x585ed5[_0xf75d('0x7')],'transfereecalleridnum':_0x585ed5[_0xf75d('0x8')],'transfereecalleridname':_0x585ed5['transfereecalleridname'],'transfereeconnectedlinenum':_0x585ed5['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x585ed5['transfereeconnectedlinename'],'transfereeaccountcode':_0x585ed5[_0xf75d('0x9')],'transfereecontext':_0x585ed5[_0xf75d('0xa')],'transfereeexten':_0x585ed5[_0xf75d('0xb')],'transfereelinkedid':_0x585ed5['transfereelinkedid'],'isexternal':_0x585ed5[_0xf75d('0xc')],'context':_0x585ed5[_0xf75d('0xd')],'extension':_0x585ed5[_0xf75d('0xe')],'type':_0xf75d('0xf')},'log':_0xf75d('0x10')});};exports[_0xf75d('0x11')]=function(_0x57833b){return client[_0xf75d('0x0')](_0xf75d('0x10'),{'body':{'result':_0x57833b[_0xf75d('0x12')],'transfererchannel':_0x57833b[_0xf75d('0x13')],'transferercalleridnum':_0x57833b[_0xf75d('0x14')],'transferercalleridname':_0x57833b['origtransferercalleridname'],'transfererconnectedlinenum':_0x57833b[_0xf75d('0x15')],'transfererconnectedlinename':_0x57833b['secondtransfererconnectedlinename'],'transfereraccountcode':_0x57833b[_0xf75d('0x16')],'transferercontext':_0x57833b[_0xf75d('0x17')],'transfererexten':_0x57833b[_0xf75d('0x18')],'transfererlinkedid':_0x57833b[_0xf75d('0x19')],'transfereechannel':_0x57833b[_0xf75d('0x1a')],'transfereecalleridnum':_0x57833b[_0xf75d('0x1b')],'transfereecalleridname':_0x57833b['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x57833b[_0xf75d('0x1c')],'transfereeconnectedlinename':_0x57833b[_0xf75d('0x1d')],'transfereeaccountcode':_0x57833b[_0xf75d('0x1e')],'transfereecontext':_0x57833b['transfertargetcontext'],'transfereeexten':_0x57833b[_0xf75d('0x1f')],'transfereelinkedid':_0x57833b['transfertargetlinkedid'],'isexternal':_0x57833b[_0xf75d('0xc')],'context':_0x57833b[_0xf75d('0x20')],'extension':_0x57833b[_0xf75d('0x21')],'type':_0xf75d('0x22')},'log':_0xf75d('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 8420e4e..ca935e8 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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x1dd9cf,_0x3317ea){var _0x9e3644=function(_0x5bd5a5){while(--_0x5bd5a5){_0x1dd9cf['push'](_0x1dd9cf['shift']());}};_0x9e3644(++_0x3317ea);}(_0x7a54,0x106));var _0x47a5=function(_0x996643,_0x40e4ef){_0x996643=_0x996643-0x0;var _0x2b213c=_0x7a54[_0x996643];return _0x2b213c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x5b0c4b,_0x37621e){var _0x3d2c67=function(_0x1db348){while(--_0x1db348){_0x5b0c4b['push'](_0x5b0c4b['shift']());}};_0x3d2c67(++_0x37621e);}(_0x7a54,0x106));var _0x47a5=function(_0x297429,_0x43cb79){_0x297429=_0x297429-0x0;var _0x16180a=_0x7a54[_0x297429];return _0x16180a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+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 6ba6a1a..f2c9079 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 _0x4123=['scheduledAt','union','resolve','then','getContacts','isEmpty','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','push','name','trigger:%s','action','toLowerCase','length','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','[CM][%s][%s]','stringify','emit','exec','data1','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','fax','createdAt'];(function(_0x483d58,_0x43e486){var _0x1c405a=function(_0xb4dabb){while(--_0xb4dabb){_0x483d58['push'](_0x483d58['shift']());}};_0x1c405a(++_0x43e486);}(_0x4123,0x87));var _0x3412=function(_0x5be795,_0x1cb1b8){_0x5be795=_0x5be795-0x0;var _0x4e8a3b=_0x4123[_0x5be795];return _0x4e8a3b;};'use strict';var _=require(_0x3412('0x0'));var BPromise=require(_0x3412('0x1'));var Redis=require(_0x3412('0x2'));var util=require(_0x3412('0x3'));var config=require(_0x3412('0x4'));var logger=require(_0x3412('0x5'))(_0x3412('0x6'));var cmContactRpc=require(_0x3412('0x7'));config['redis']=_['defaults'](config[_0x3412('0x8')],{'host':_0x3412('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3412('0x8')]));function emit(_0x2c6b42,_0x30d18b,_0x43f43c,_0x40c825,_0x2617a6){logger['info'](_0x3412('0xa'),_0x2c6b42,_0x30d18b['id'],_0x43f43c,_0x40c825,JSON[_0x3412('0xb')](_0x2617a6));io['to'](_0x43f43c)[_0x3412('0xc')](_0x40c825,_0x2617a6);}exports[_0x3412('0xd')]=function(_0xf207fe,_0x2afc08,_0x27a434,_0x40698b){var _0x3be34c,_0x4b70e4;var _0x4b1d87={};var _0x2967ee;var _0x151e34=Number(_0x27a434[_0x3412('0xe')]);var _0x4e488d=_0x27a434['data2']?Boolean(Number(_0x27a434['data2'])):![];var _0x644c94;var _0x2f99b3=![];if(!_[_0x3412('0xf')](_0x27a434[_0x3412('0x10')])){if(_0x27a434[_0x3412('0x10')]=='1')_0x2f99b3=!![];}if(!_0x2f99b3){if(_0x40698b[_0x3412('0x11')]){_0x4b1d87['id']=_0x40698b[_0x3412('0x11')];}}if(!_0x4b1d87['id']){_0x4b1d87[_0x3412('0x12')]=_0x151e34;_0x644c94=_0x27a434[_0x3412('0x13')]&&_0x27a434[_0x3412('0x13')]!=='0'?_0x27a434[_0x3412('0x13')][_0x3412('0x14')](','):[_0x3412('0x15')];_0x4b1d87[_0x3412('0x16')]=_['map'](_0x644c94,function(_0x219a0a){var _0x2528b1={};_0x2528b1[_0x219a0a]=_0x40698b['routeId']?_0x40698b['destcalleridnum']:_0x40698b['calleridnum'];return _0x2528b1;});_0x2967ee=_0x40698b[_0x3412('0x17')]?_0x40698b[_0x3412('0x18')]:_0x40698b[_0x3412('0x19')];}var _0x4480a9=['id',_0x3412('0x1a'),_0x3412('0x1b'),'phone','mobile',_0x3412('0x1c'),_0x3412('0x12'),_0x3412('0x1d'),_0x3412('0x1e'),'updatedAt'];var _0x231f00=_[_0x3412('0x1f')](_0x4480a9,_0x644c94);BPromise[_0x3412('0x20')]()[_0x3412('0x21')](cmContactRpc[_0x3412('0x22')]({'attributes':_0x231f00,'where':_0x4b1d87,'phone':_0x2967ee}))[_0x3412('0x21')](function(_0x46cd4b){_0x4b70e4=_0x46cd4b;if(!_[_0x3412('0x23')](_0x4b70e4)){if(_0x4b70e4['length']===0x1){_0x3be34c=_0x4b70e4[0x0];logger[_0x3412('0x24')](_0x3412('0x25'),_0x40698b[_0x3412('0x26')],_0x2afc08['id'],_0x3be34c['id']);}else{logger[_0x3412('0x24')](_0x3412('0x27'),_0x40698b[_0x3412('0x26')],_0x2afc08['id'],_[_0x3412('0x28')](_0x4b70e4,'id')[_0x3412('0x29')](','));}return;}else{logger['info'](_0x3412('0x2a'),_0x40698b[_0x3412('0x26')],_0x2afc08['id']);var _0x318586={'ListId':_0x151e34};var _0x55dfb9=_0x27a434[_0x3412('0x2b')]&&_0x27a434[_0x3412('0x2b')]!=='0'?_0x27a434[_0x3412('0x2b')]:'phone';if(_0x4e488d){logger[_0x3412('0x24')](_0x3412('0x2c'),_0x40698b[_0x3412('0x26')],_0x2afc08['id']);_0x318586[_0x55dfb9]=_[_0x3412('0xf')](_0x40698b[_0x3412('0x17')])?_0x40698b[_0x3412('0x19')]:_0x40698b[_0x3412('0x18')];if(_['isNil'](_0x40698b[_0x3412('0x17')])){_0x318586[_0x3412('0x1a')]=_0x40698b[_0x3412('0x2d')]&&_0x40698b[_0x3412('0x2d')]!==_0x3412('0x2e')?_0x40698b[_0x3412('0x2d')]:_0x3412('0x2f');}else{_0x318586['firstName']=_0x40698b[_0x3412('0x30')]&&_0x40698b['destcalleridname']!==''?_0x40698b[_0x3412('0x30')]:_0x3412('0x2f');}return BPromise[_0x3412('0x20')]()[_0x3412('0x21')](cmContactRpc['createContact'](_0x318586))[_0x3412('0x21')](function(_0x29c40a){_0x3be34c=_0x29c40a;_0x4b70e4[_0x3412('0x31')](_0x29c40a);if(_0x3be34c){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x40698b[_0x3412('0x26')],_0x2afc08['id'],_0x3be34c['id']);}return;});}else{logger[_0x3412('0x24')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x40698b[_0x3412('0x26')],_0x2afc08['id']);_0x318586[_0x55dfb9]=_[_0x3412('0xf')](_0x40698b[_0x3412('0x17')])?_0x40698b[_0x3412('0x19')]:_0x40698b['destcalleridnum'];if(_[_0x3412('0xf')](_0x40698b[_0x3412('0x17')])){_0x318586[_0x3412('0x1a')]=_0x40698b[_0x3412('0x2d')]&&_0x40698b['calleridname']!==_0x3412('0x2e')?_0x40698b[_0x3412('0x2d')]:'Unknown';}else{_0x318586[_0x3412('0x1a')]=_0x40698b[_0x3412('0x30')]&&_0x40698b[_0x3412('0x30')]!==''?_0x40698b[_0x3412('0x30')]:'Unknown';}_0x3be34c=_0x318586;_0x4b70e4['push'](_0x318586);return;}}})[_0x3412('0x21')](function(){if(_0xf207fe){emit(_0x40698b[_0x3412('0x26')],_0x2afc08,util['format']('user:%s',_0xf207fe[_0x3412('0x32')]),util['format'](_0x3412('0x33'),_0x27a434[_0x3412('0x34')][_0x3412('0x35')]()),{'evt':_['merge'](_0x40698b,{'autoCreate':_0x4e488d}),'contact':_0x3be34c===undefined?{}:_0x3be34c,'contacts':_0x4b70e4[_0x3412('0x36')]===0x0?undefined:_0x4b70e4});}});}; \ No newline at end of file +var _0x7dd1=['../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','info','stringify','data2','data5','xmd-contactid','ListId','data3','$or','map','routeId','calleridnum','destcalleridnum','firstName','lastName','phone','fax','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','util','../../../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7dd1,0x169));var _0x17dd=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x7dd1[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x17dd('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0x17dd('0x1'));var config=require(_0x17dd('0x2'));var logger=require(_0x17dd('0x3'))(_0x17dd('0x4'));var cmContactRpc=require(_0x17dd('0x5'));config[_0x17dd('0x6')]=_['defaults'](config['redis'],{'host':_0x17dd('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x17dd('0x6')]));function emit(_0x1b9038,_0x591bbf,_0x44a3ed,_0x29b28f,_0x5b1bd4){logger[_0x17dd('0x8')]('[CM][%s][%s]',_0x1b9038,_0x591bbf['id'],_0x44a3ed,_0x29b28f,JSON[_0x17dd('0x9')](_0x5b1bd4));io['to'](_0x44a3ed)['emit'](_0x29b28f,_0x5b1bd4);}exports['exec']=function(_0x136619,_0x44d1b8,_0x518c7b,_0x1b176b){var _0x202038,_0x1371d7;var _0x571059={};var _0x4ffda3;var _0x2165ab=Number(_0x518c7b['data1']);var _0x21b6d4=_0x518c7b[_0x17dd('0xa')]?Boolean(Number(_0x518c7b[_0x17dd('0xa')])):![];var _0xf1737a;var _0x93cf74=![];if(!_['isNil'](_0x518c7b[_0x17dd('0xb')])){if(_0x518c7b[_0x17dd('0xb')]=='1')_0x93cf74=!![];}if(!_0x93cf74){if(_0x1b176b[_0x17dd('0xc')]){_0x571059['id']=_0x1b176b[_0x17dd('0xc')];}}if(!_0x571059['id']){_0x571059[_0x17dd('0xd')]=_0x2165ab;_0xf1737a=_0x518c7b[_0x17dd('0xe')]&&_0x518c7b['data3']!=='0'?_0x518c7b[_0x17dd('0xe')]['split'](','):['phone'];_0x571059[_0x17dd('0xf')]=_[_0x17dd('0x10')](_0xf1737a,function(_0x47fe0c){var _0x3652fc={};_0x3652fc[_0x47fe0c]=_0x1b176b[_0x17dd('0x11')]?_0x1b176b['destcalleridnum']:_0x1b176b[_0x17dd('0x12')];return _0x3652fc;});_0x4ffda3=_0x1b176b[_0x17dd('0x11')]?_0x1b176b[_0x17dd('0x13')]:_0x1b176b[_0x17dd('0x12')];}var _0x2eaaf3=['id',_0x17dd('0x14'),_0x17dd('0x15'),_0x17dd('0x16'),'mobile',_0x17dd('0x17'),_0x17dd('0xd'),'createdAt',_0x17dd('0x18'),_0x17dd('0x19')];var _0xf4eff3=_[_0x17dd('0x1a')](_0x2eaaf3,_0xf1737a);BPromise[_0x17dd('0x1b')]()[_0x17dd('0x1c')](cmContactRpc['getContacts']({'attributes':_0xf4eff3,'where':_0x571059,'phone':_0x4ffda3}))[_0x17dd('0x1c')](function(_0xb8dd73){_0x1371d7=_0xb8dd73;if(!_[_0x17dd('0x1d')](_0x1371d7)){if(_0x1371d7[_0x17dd('0x1e')]===0x1){_0x202038=_0x1371d7[0x0];logger[_0x17dd('0x8')](_0x17dd('0x1f'),_0x1b176b[_0x17dd('0x20')],_0x44d1b8['id'],_0x202038['id']);}else{logger['info'](_0x17dd('0x21'),_0x1b176b[_0x17dd('0x20')],_0x44d1b8['id'],_[_0x17dd('0x10')](_0x1371d7,'id')[_0x17dd('0x22')](','));}return;}else{logger[_0x17dd('0x8')](_0x17dd('0x23'),_0x1b176b[_0x17dd('0x20')],_0x44d1b8['id']);var _0xca2ef8={'ListId':_0x2165ab};var _0x299a58=_0x518c7b[_0x17dd('0x24')]&&_0x518c7b[_0x17dd('0x24')]!=='0'?_0x518c7b[_0x17dd('0x24')]:_0x17dd('0x16');if(_0x21b6d4){logger['info'](_0x17dd('0x25'),_0x1b176b[_0x17dd('0x20')],_0x44d1b8['id']);_0xca2ef8[_0x299a58]=_[_0x17dd('0x26')](_0x1b176b[_0x17dd('0x11')])?_0x1b176b[_0x17dd('0x12')]:_0x1b176b[_0x17dd('0x13')];if(_[_0x17dd('0x26')](_0x1b176b[_0x17dd('0x11')])){_0xca2ef8[_0x17dd('0x14')]=_0x1b176b[_0x17dd('0x27')]&&_0x1b176b['calleridname']!==_0x17dd('0x28')?_0x1b176b['calleridname']:'Unknown';}else{_0xca2ef8[_0x17dd('0x14')]=_0x1b176b['destcalleridname']&&_0x1b176b[_0x17dd('0x29')]!==_0x17dd('0x28')?_0x1b176b['destcalleridname']:_0x17dd('0x2a');}return BPromise['resolve']()[_0x17dd('0x1c')](cmContactRpc[_0x17dd('0x2b')](_0xca2ef8))[_0x17dd('0x1c')](function(_0x454dbc){_0x202038=_0x454dbc;_0x1371d7['push'](_0x454dbc);if(_0x202038){logger[_0x17dd('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x1b176b[_0x17dd('0x20')],_0x44d1b8['id'],_0x202038['id']);}return;});}else{logger['info'](_0x17dd('0x2c'),_0x1b176b[_0x17dd('0x20')],_0x44d1b8['id']);_0xca2ef8[_0x299a58]=_[_0x17dd('0x26')](_0x1b176b[_0x17dd('0x11')])?_0x1b176b[_0x17dd('0x12')]:_0x1b176b[_0x17dd('0x13')];if(_['isNil'](_0x1b176b['routeId'])){_0xca2ef8[_0x17dd('0x14')]=_0x1b176b[_0x17dd('0x27')]&&_0x1b176b['calleridname']!==''?_0x1b176b[_0x17dd('0x27')]:_0x17dd('0x2a');}else{_0xca2ef8['firstName']=_0x1b176b[_0x17dd('0x29')]&&_0x1b176b[_0x17dd('0x29')]!==_0x17dd('0x28')?_0x1b176b['destcalleridname']:_0x17dd('0x2a');}_0x202038=_0xca2ef8;_0x1371d7[_0x17dd('0x2d')](_0xca2ef8);return;}}})[_0x17dd('0x1c')](function(){if(_0x136619){emit(_0x1b176b[_0x17dd('0x20')],_0x44d1b8,util[_0x17dd('0x2e')](_0x17dd('0x2f'),_0x136619[_0x17dd('0x30')]),util[_0x17dd('0x2e')](_0x17dd('0x31'),_0x518c7b[_0x17dd('0x32')][_0x17dd('0x33')]()),{'evt':_['merge'](_0x1b176b,{'autoCreate':_0x21b6d4}),'contact':_0x202038===undefined?{}:_0x202038,'contacts':_0x1371d7[_0x17dd('0x1e')]===0x0?undefined:_0x1371d7});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 62325fb..3cdd53f 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 _0x7eab=['./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','winapp','agents','voiceQueues','templates','voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','zendeskAccounts','vtigerAccounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentreject','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','stringify','emit','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','triggers','hasOwnProperty','status','checkTrigger','merge','variables','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data4','location','uriLocation','windowWidth','data5','data6','winArguments','data3','name','format','trigger:%s:%s','jscripty','user:%s','trigger:%s','exec','queue','script','query','search','replace','channel','every','AllConditions','checkConditions','some','AnyConditions','checkTrigger:\x20trigger','field','account','chat','ChatWebsiteId','value','upperFirst','AccountId','message','event','operator','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','lodash','url','mustache','ioredis'];(function(_0x34743f,_0x53e16a){var _0x49103b=function(_0x5637d4){while(--_0x5637d4){_0x34743f['push'](_0x34743f['shift']());}};_0x49103b(++_0x53e16a);}(_0x7eab,0xf8));var _0xb7ea=function(_0x1e8ba0,_0x6d4636){_0x1e8ba0=_0x1e8ba0-0x0;var _0x472c2e=_0x7eab[_0x1e8ba0];return _0x472c2e;};'use strict';var util=require('util');var _=require(_0xb7ea('0x0'));var url=require(_0xb7ea('0x1'));var Mustache=require(_0xb7ea('0x2'));var Redis=require(_0xb7ea('0x3'));var urlforward=require('./urlforward');var integration=require(_0xb7ea('0x4'));var cmContact=require('./cmContact');var script=require(_0xb7ea('0x5'));var config=require(_0xb7ea('0x6'));var logger=require(_0xb7ea('0x7'))(_0xb7ea('0x8'));var ami=require(_0xb7ea('0x9'));config[_0xb7ea('0xa')]=_['defaults'](config['redis'],{'host':_0xb7ea('0xb'),'port':0x18eb});var io=require(_0xb7ea('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x2faaf8,_0x474bf4){return _0x2faaf8==_0x474bf4;},'not_equals':function(_0x25ccc3,_0x102c14){return _0x25ccc3!=_0x102c14;}};var barAndWebActions=[_0xb7ea('0xd'),_0xb7ea('0x1'),_0xb7ea('0xe')];function Trigger(_0x2ecefb){this['triggers']=_0x2ecefb['triggers'];this[_0xb7ea('0xf')]=_0x2ecefb[_0xb7ea('0xf')];this[_0xb7ea('0x10')]=_0x2ecefb[_0xb7ea('0x10')];this['templates']=_0x2ecefb[_0xb7ea('0x11')];this[_0xb7ea('0x12')]=_0x2ecefb[_0xb7ea('0x12')];this['zendeskAccounts']=_0x2ecefb['zendeskAccounts'];this[_0xb7ea('0x13')]=_0x2ecefb['freshdeskAccounts'];this[_0xb7ea('0x14')]=_0x2ecefb[_0xb7ea('0x14')];this[_0xb7ea('0x15')]=_0x2ecefb[_0xb7ea('0x15')];this[_0xb7ea('0x16')]=_0x2ecefb[_0xb7ea('0x16')];this[_0xb7ea('0x17')]=_0x2ecefb[_0xb7ea('0x17')];this['vtigerAccounts']=_0x2ecefb['vtigerAccounts'];this['servicenowAccounts']=_0x2ecefb[_0xb7ea('0x18')];this[_0xb7ea('0x19')]=_0x2ecefb[_0xb7ea('0x19')];this[_0xb7ea('0x1a')]=_0x2ecefb['freshsalesAccounts'];this[_0xb7ea('0x1b')]={'zendesk':this[_0xb7ea('0x1c')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xb7ea('0x13')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xb7ea('0x16')],'desk':this['deskAccounts'],'vtiger':this[_0xb7ea('0x1d')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xb7ea('0x1a')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0xb7ea('0x1e')]['bind'](this));ami['on']('custom:agentconnect',this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x20'),this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x21'),this['syncCustomEvent'][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x22'),this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on']('custom:agentnoanswer',this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x23'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcongestion',this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x24'),this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on']('custom:amd',this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on']('custom:queuecallerabandon',this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x25'),this['syncCustomEvent'][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x26'),this['syncAgentDial']['bind'](this));ami['on'](_0xb7ea('0x27'),this['syncAgentDial'][_0xb7ea('0x1f')](this));ami['on']('custom:dialend',this[_0xb7ea('0x28')][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x29'),this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x2a'),this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on']('custom:substatus',this[_0xb7ea('0x1e')]['bind'](this));ami['on'](_0xb7ea('0x2b'),this['syncCustomEvent'][_0xb7ea('0x1f')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x2c'),this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x2d'),this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));ami['on'](_0xb7ea('0x2e'),this[_0xb7ea('0x1e')][_0xb7ea('0x1f')](this));}Trigger[_0xb7ea('0x2f')]['emit']=function(_0x431f12,_0x3e2539,_0x5b1d27){logger[_0xb7ea('0x30')](_0x431f12,_0x3e2539,JSON[_0xb7ea('0x31')](_0x5b1d27));io['to'](_0x431f12)[_0xb7ea('0x32')](_0x3e2539,_0x5b1d27);};Trigger[_0xb7ea('0x2f')][_0xb7ea('0x1e')]=function(_0x134924){var _0x231cfe=_[_0xb7ea('0x33')](_0x134924);if(typeof _0x231cfe[_0xb7ea('0x34')]===_0xb7ea('0x35')){_0x231cfe['motionChannel']=_0xb7ea('0x36');}logger[_0xb7ea('0x37')](_0xb7ea('0x1e'),util[_0xb7ea('0x38')](_0x231cfe,{'showHidden':!![],'depth':null}));this[_0xb7ea('0x39')](_0x231cfe);};Trigger[_0xb7ea('0x2f')]['syncAgentDial']=function(_0x53d78b){if(this['agents'][_0x53d78b['interface']]){this['syncCustomEvent'](_0x53d78b);}};Trigger[_0xb7ea('0x2f')][_0xb7ea('0x39')]=function(_0x93b201){var _0x1ea657;for(var _0x2469d1 in this[_0xb7ea('0x3a')]){if(this[_0xb7ea('0x3a')][_0xb7ea('0x3b')](_0x2469d1)){if(this['triggers'][_0x2469d1][_0xb7ea('0x3c')]){_0x1ea657=this[_0xb7ea('0x3d')](this[_0xb7ea('0x3a')][_0x2469d1],_0x93b201);if(_0x1ea657){_[_0xb7ea('0x3e')](_0x93b201,_0x93b201[_0xb7ea('0x3f')]);for(var _0xa16422=0x0,_0x3f58ff,_0x20c268,_0x4cc50b;_0xa164220x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0x5fc3[_0x4191af];return _0x27bebf;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ 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 6afd969..12858ab 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 _0x9204=['userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','destcalleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','message','toLowerCase','outbound','calleridnum','GET','contacts?$select=','replace','%2b','nothing',']\x20Enduser\x20created!','includes','string','picklist','type','nameField','idField','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','Subjects','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','data7','https://login.microsoftonline.com/%s/oauth2/token','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','socket.io-emitter','modernAuthentication','remoteUri','tenantId','CloudProvider','data2','resolve','data5','POST','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','Bearer\x20','4.0','value','isNil','validateEmail','email'];(function(_0x7e2384,_0xd8f685){var _0x40656f=function(_0x10c17f){while(--_0x10c17f){_0x7e2384['push'](_0x7e2384['shift']());}};_0x40656f(++_0xd8f685);}(_0x9204,0x194));var _0x4920=function(_0x1b3d86,_0x4463fa){_0x1b3d86=_0x1b3d86-0x0;var _0x171257=_0x9204[_0x1b3d86];return _0x171257;};'use strict';var _=require(_0x4920('0x0'));var rp=require(_0x4920('0x1'));var util=require('util');var intUtil=require(_0x4920('0x2'));var md5=require('md5');var Redis=require(_0x4920('0x3'));var logger=require(_0x4920('0x4'))(_0x4920('0x5'));var config=require(_0x4920('0x6'));config[_0x4920('0x7')]=_['defaults'](config[_0x4920('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4920('0x8'))(new Redis(config[_0x4920('0x7')]));function getAuthToken(_0x4e132a,_0x593c37,_0x5ece12){if(_0x4e132a[_0x4920('0x9')]){_0x4e132a[_0x4920('0xa')]=_0x4e132a['CloudProvider']['data7'];_0x4e132a[_0x4920('0xb')]=_0x4e132a[_0x4920('0xc')][_0x4920('0xd')];return Promise[_0x4920('0xe')](_0x4e132a['CloudProvider'][_0x4920('0xf')]);}var _0x4e8518={'method':_0x4920('0x10'),'uri':_0x593c37,'form':{'client_id':_0x4e132a['clientId'],'resource':_0x4e132a['remoteUri'],'username':_0x4e132a[_0x4920('0x11')],'password':_0x4e132a[_0x4920('0x12')],'grant_type':_0x4920('0x12'),'client_secret':_0x4e132a[_0x4920('0x13')]},'json':!![]};return rp(_0x4e8518)[_0x4920('0x14')](function(_0x402e1f){return _0x402e1f[_0x4920('0x15')];})[_0x4920('0x16')](function(_0x2ec27a){logger[_0x4920('0x17')]('['+[_0x5ece12[_0x4920('0x18')]()]+_0x4920('0x19'));return _0x2ec27a['message'];});}function getUser(_0x274b1c,_0x3c401f,_0x5de2fd,_0x2af145,_0x216483,_0x3d6ecb){return new Promise(function(_0x46cc97,_0x4f6d02){return getAuthToken(_0x3c401f,_0x2af145,_0x3d6ecb)[_0x4920('0x14')](function(_0x4e05ad){var _0x3e8072={'method':'GET','uri':_0x216483+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x4920('0x1a')+_0x4e05ad,'OData-Version':_0x4920('0x1b')},'json':!![]};return rp(_0x3e8072);})[_0x4920('0x14')](function(_0x3aa491){var _0x381167=_0x3aa491[_0x4920('0x1c')];var _0x41091c=![];var _0x51a1c6=null;if(!_[_0x4920('0x1d')](_0x5de2fd)){if(intUtil[_0x4920('0x1e')](_0x5de2fd[_0x4920('0x1f')])){_0x274b1c[_0x4920('0x20')]=_0x5de2fd[_0x4920('0x1f')];for(_0x51a1c6=0x0;_0x51a1c6<_0x381167[_0x4920('0x21')];_0x51a1c6++){if(_0x381167[_0x51a1c6][_0x4920('0x22')]===_0x5de2fd[_0x4920('0x1f')]&&!_0x381167[_0x51a1c6][_0x4920('0x23')]){_0x41091c=!![];logger[_0x4920('0x24')]('['+[_0x3d6ecb[_0x4920('0x18')]()]+_0x4920('0x25')+_0x381167[_0x51a1c6][_0x4920('0x26')]+'!');_0x274b1c[_0x4920('0x27')]=_0x381167[_0x51a1c6]['systemuserid'];}}}}if(!_0x41091c){logger['info']('['+[_0x3d6ecb['toUpperCase']()]+_0x4920('0x28'));_0x274b1c['userEmail']=_0x3c401f['username'];for(_0x51a1c6=0x0;_0x51a1c6<_0x381167[_0x4920('0x21')];_0x51a1c6++){if(_0x381167[_0x51a1c6]['internalemailaddress']===_0x3c401f[_0x4920('0x11')]){_0x274b1c['userId']=_0x381167[_0x51a1c6][_0x4920('0x26')];}}}_0x46cc97(_0x274b1c);})[_0x4920('0x16')](function(_0x395cca){_0x4f6d02(_0x395cca['message']);});});}function createEndUser(_0x47d344,_0x2f5f2b,_0x3454b0,_0x23dccf,_0x12f54d,_0x58657b,_0x357763){return new Promise(function(_0x59af80,_0x256953){return getAuthToken(_0x2f5f2b,_0x3454b0,_0x58657b)[_0x4920('0x14')](function(_0x4a6f00){var _0x4f85d5=_0x58657b['toLowerCase']()==='outbound'?_0x12f54d[_0x4920('0x29')]:_0x12f54d['calleridnum'];var _0x5558f3={'method':_0x4920('0x10'),'uri':_0x23dccf+_0x4920('0x2a'),'body':{'fullname':_0x4f85d5,'firstname':_0x4f85d5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4920('0x2b')+_0x47d344[_0x4920('0x27')]+')'},'headers':{'Authorization':_0x4920('0x1a')+_0x4a6f00,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x5558f3[_0x4920('0x2c')][_0x357763]=_0x4f85d5;return rp(_0x5558f3);})[_0x4920('0x14')](function(_0x4fd3f1){var _0xbe2aef=_0x4fd3f1[_0x4920('0x2d')][_0x4920('0x2e')];var _0x3a5b3e=_0xbe2aef[_0x4920('0x2f')](_0xbe2aef[_0x4920('0x30')]('(')+0x1,_0xbe2aef[_0x4920('0x30')](')'));_0x47d344[_0x4920('0x31')]=_0x3a5b3e;_0x59af80(_0x47d344);})[_0x4920('0x16')](function(_0xb3e648){_0x256953(_0xb3e648[_0x4920('0x32')]);});});}function getEndUser(_0x4919cf,_0x408448,_0x518e34,_0x213220,_0x126e88,_0x4fe21e,_0x4bb338,_0x5d5bfc){var _0x1598ac=_0x4fe21e[_0x4920('0x33')]()===_0x4920('0x34')?_0x126e88[_0x4920('0x29')]:_0x126e88[_0x4920('0x35')];return getAuthToken(_0x408448,_0x518e34,_0x4fe21e)['then'](function(_0x217002){_0x5d5bfc=_0x5d5bfc?_0x5d5bfc:'telephone1';var _0x35905f={'method':_0x4920('0x36'),'uri':_0x213220+_0x4920('0x37')+_0x5d5bfc+'&$filter='+_0x5d5bfc+'\x20eq\x20\x27'+_0x1598ac[_0x4920('0x38')]('+',_0x4920('0x39'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x217002,'If-None-Match':null,'OData-Version':_0x4920('0x1b')},'json':!![]};return rp(_0x35905f);})[_0x4920('0x14')](function(_0x3894d2){var _0x563a31=![];if(!_0x3894d2)return _0x563a31;var _0x5506b1=_0x3894d2['value'];for(var _0x51c35d=0x0;_0x51c35d<_0x5506b1[_0x4920('0x21')];_0x51c35d++){if(_0x5506b1[_0x51c35d][_0x5d5bfc]===_0x1598ac){_0x563a31=!![];_0x4919cf[_0x4920('0x31')]=_0x5506b1[_0x51c35d]['contactid'];}}return _0x563a31;})[_0x4920('0x14')](function(_0x5648e2){if(_0x5648e2)return _0x4919cf;if(_0x4bb338===_0x4920('0x3a')){logger[_0x4920('0x24')]('['+[_0x4fe21e[_0x4920('0x18')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x4919cf;}return createEndUser(_0x4919cf,_0x408448,_0x518e34,_0x213220,_0x126e88,_0x4fe21e,_0x5d5bfc)[_0x4920('0x14')](function(_0x1c9a76){logger[_0x4920('0x24')]('['+[_0x4fe21e[_0x4920('0x18')]()]+_0x4920('0x3b'),_0x1c9a76[_0x4920('0x31')]);return _0x1c9a76;});});}function getCustomFields(_0x40caf0,_0x45fa56,_0x1a2531){var _0x55403c={};if(_0x40caf0[_0x4920('0x21')]>0x0){_['forEach'](_0x40caf0,function(_0x59076d){if(_[_0x4920('0x3c')]([_0x4920('0x3d'),_0x4920('0x3e')],_0x59076d[_0x4920('0x3f')])&&_0x59076d[_0x4920('0x40')]&&!_0x59076d['customField']){var _0x4a26b6=_0x59076d[_0x4920('0x41')][_0x4920('0x33')]();var _0x11cfcc=_0x4a26b6[_0x4920('0x2f')](0x0,_0x4a26b6['indexOf']('_'));var _0xefdc8c=_0x4a26b6[_0x4920('0x2f')](_0x4a26b6['indexOf']('_')+0x1);if(_0x11cfcc===_0x1a2531){_0x55403c[_0xefdc8c]=_0x59076d[_0x4920('0x42')];}}});}return _0x55403c;}function getTicket(_0x3968f0,_0xa50434,_0x5c8faf,_0x3a1e7c,_0x459f15,_0xd19483,_0x17f6ff){return new Promise(function(_0x3709d8,_0x128cb8){var _0x5218fa;return getAuthToken(_0xa50434,_0x5c8faf,_0x17f6ff)[_0x4920('0x14')](function(_0xe978a5){if(_0xd19483[_0x4920('0x43')]===_0x4920('0x44')){_0x5218fa={'method':_0x4920('0x10'),'uri':_0x3a1e7c+_0x4920('0x45'),'body':Object[_0x4920('0x46')]({},{'title':intUtil[_0x4920('0x47')](_0xd19483['Subjects'],_0x459f15,'\x20'),'description':intUtil[_0x4920('0x47')](_0xd19483[_0x4920('0x48')],_0x459f15,'\x0a'),'customerid_contact@odata.bind':_0x3968f0['enduserId']?_0x4920('0x49')+_0x3968f0[_0x4920('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x3968f0[_0x4920('0x27')]+')','caseorigincode':'1'},getCustomFields(_0xd19483[_0x4920('0x4a')],_0x459f15,_0xd19483[_0x4920('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0xe978a5,'OData-Version':_0x4920('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xd19483[_0x4920('0x43')]===_0x4920('0x4b')){var _0x506b09=_0x3968f0[_0x4920('0x31')]?[{'partyid_systemuser@odata.bind':_0x4920('0x2b')+_0x3968f0[_0x4920('0x27')]+')','participationtypemask':_0x3968f0['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x3968f0[_0x4920('0x31')]+')','participationtypemask':_0x3968f0['callDirection']===_0x4920('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x4920('0x2b')+_0x3968f0[_0x4920('0x27')]+')','participationtypemask':_0x3968f0[_0x4920('0x4d')]===_0x4920('0x4c')?0x2:0x1}];_0x5218fa={'method':'POST','uri':_0x3a1e7c+'phonecalls','body':Object[_0x4920('0x46')]({},{'subject':intUtil[_0x4920('0x47')](_0xd19483[_0x4920('0x4e')],_0x459f15,'\x20'),'phonenumber':String(_0x459f15[_0x4920('0x35')]),'description':intUtil[_0x4920('0x47')](_0xd19483[_0x4920('0x48')],_0x459f15,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3968f0[_0x4920('0x31')]?_0x4920('0x49')+_0x3968f0[_0x4920('0x31')]+')':undefined,'ownerid@odata.bind':_0x4920('0x2b')+_0x3968f0[_0x4920('0x27')]+')','directioncode':_0x3968f0[_0x4920('0x4d')]===_0x4920('0x4c')?![]:!![],'phonecall_activity_parties':_0x506b09},getCustomFields(_0xd19483['Fields'],_0x459f15,_0xd19483[_0x4920('0x43')])),'headers':{'Authorization':_0x4920('0x1a')+_0xe978a5,'OData-Version':_0x4920('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5218fa);})[_0x4920('0x14')](function(_0x60c0e8){var _0x157871=_0x60c0e8[_0x4920('0x2d')][_0x4920('0x2e')];var _0xd1fa2c=_0x157871[_0x4920('0x2f')](_0x157871[_0x4920('0x30')]('(')+0x1,_0x157871[_0x4920('0x30')](')'));_0x3968f0['ticketId']=_0xd1fa2c;_0x3709d8(_0x3968f0);})[_0x4920('0x16')](function(_0x25fa81){_0x128cb8(_0x25fa81[_0x4920('0x32')]);});});}function emit(_0x32ab69,_0x1d95c8,_0x5abfd8,_0x19b96a){var _0x3f8719={'uri':util[_0x4920('0x4f')](_0x4920('0x50'),_0x32ab69,_0x5abfd8,_0x19b96a)};io['to'](util['format'](_0x4920('0x51'),_0x1d95c8))[_0x4920('0x52')](_0x4920('0x53'),_0x3f8719);}exports['cs']=function(_0x420527,_0x37c23a,_0x49f3f6,_0x2523f8,_0x2c6069,_0x29f847,_0x42a750,_0x1272b4){var _0x3d8ddf={};_0x29f847['remoteUri']=_0x29f847['modernAuthentication']?intUtil['stripTrailingSlash'](_0x29f847[_0x4920('0xc')]['data7']):intUtil[_0x4920('0x54')](_0x29f847[_0x4920('0xa')]);_0x29f847[_0x4920('0x55')]=intUtil[_0x4920('0x54')](_0x29f847[_0x4920('0x55')]);_0x3d8ddf['callDirection']=_0x1272b4===_0x4920('0x4c')||_0x1272b4===_0x4920('0x56')?_0x4920('0x4c'):_0x4920('0x34');var _0x3cb78e=_0x29f847['modernAuthentication']?util['format'](_0x4920('0x57'),_0x29f847[_0x4920('0xc')][_0x4920('0x58')]):util[_0x4920('0x4f')](_0x4920('0x57'),_0x29f847[_0x4920('0xa')]);var _0x28e8a8=util[_0x4920('0x4f')](_0x4920('0x59'),_0x29f847[_0x4920('0xb')]);var _0x139923=util[_0x4920('0x4f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x29f847['serverUrl'],_0x37c23a['uniqueid'],md5(_0x37c23a['uniqueid']));if(_0x2c6069&&_0x2c6069[_0x4920('0x5a')]){logger[_0x4920('0x24')](_0x4920('0x5b'),_0x4920('0x5c'));_0x37c23a[_0x4920('0x5d')]=_0x139923;}else if(_0x42a750&&_0x42a750[_0x4920('0x5e')]&&_0x42a750[_0x4920('0x5e')]!==_0x4920('0x5f')){logger[_0x4920('0x24')](_0x4920('0x60'),'Recording\x20is\x20enabled!');_0x37c23a[_0x4920('0x5d')]=_0x139923;}else{_0x37c23a['recordingURL']='';}return getUser(_0x3d8ddf,_0x29f847,_0x2523f8,_0x28e8a8,_0x3cb78e,_0x1272b4)['then'](function(_0x5e80e7){logger[_0x4920('0x24')]('['+_0x1272b4['toUpperCase']()+_0x4920('0x61'),_0x5e80e7[_0x4920('0x27')]);logger['info']('['+_0x1272b4['toUpperCase']()+_0x4920('0x62'),_0x5e80e7[_0x4920('0x20')]);return getEndUser(_0x5e80e7,_0x29f847,_0x28e8a8,_0x3cb78e,_0x37c23a,_0x1272b4,_0x49f3f6[_0x4920('0x63')],_0x49f3f6[_0x4920('0x64')]);})[_0x4920('0x14')](function(_0x446251){logger['info']('['+_0x1272b4[_0x4920('0x18')]()+_0x4920('0x65'),_0x446251[_0x4920('0x31')]);logger['info']('['+_0x1272b4['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x37c23a[_0x4920('0x35')]);return getTicket(_0x446251,_0x29f847,_0x28e8a8,_0x3cb78e,_0x37c23a,_0x49f3f6,_0x1272b4);})[_0x4920('0x14')](function(_0x177a81){logger[_0x4920('0x24')](util[_0x4920('0x4f')]('['+_0x1272b4['toUpperCase']()+_0x4920('0x66'),_0x49f3f6[_0x4920('0x43')],_0x177a81[_0x4920('0x67')]));logger[_0x4920('0x24')](util[_0x4920('0x4f')]('['+_0x1272b4[_0x4920('0x18')]()+_0x4920('0x68'),_0x1272b4));if(_0x1272b4!=='unmanaged'&&_0x49f3f6[_0x4920('0x69')]){logger[_0x4920('0x24')]('['+_0x1272b4['toUpperCase']()+']',_0x4920('0x6a'));emit(_0x29f847[_0x4920('0xa')],_0x2523f8[_0x4920('0x6b')],_0x49f3f6[_0x4920('0x43')],_0x177a81[_0x4920('0x67')]);}})['catch'](function(_0x23d9a3){logger['error']('['+_0x1272b4[_0x4920('0x18')]()+_0x4920('0x6c'),_0x23d9a3['message']);console['error']('Error\x20running\x20Dynamics365\x20integration',_0x23d9a3);});}; \ No newline at end of file +var _0xe3d9=['unmanaged','format','%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','Recording\x20is\x20enabled!','recordingURL','recordingFormat','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','internalemailaddress','destcalleridnum','calleridnum','POST','contacts','/systemusers(','body','headers','lastIndexOf','enduserId','toLowerCase','outbound','telephone1','contacts?$select=','&$filter=','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','type','nameField','customField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','odata-entityid','ticketId','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe3d9,0x7d));var _0x9e3d=function(_0x46ab22,_0x209335){_0x46ab22=_0x46ab22-0x0;var _0x41b47c=_0xe3d9[_0x46ab22];return _0x41b47c;};'use strict';var _=require(_0x9e3d('0x0'));var rp=require(_0x9e3d('0x1'));var util=require(_0x9e3d('0x2'));var intUtil=require(_0x9e3d('0x3'));var md5=require(_0x9e3d('0x4'));var Redis=require(_0x9e3d('0x5'));var logger=require(_0x9e3d('0x6'))(_0x9e3d('0x7'));var config=require(_0x9e3d('0x8'));config['redis']=_[_0x9e3d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9e3d('0xa'))(new Redis(config['redis']));function getAuthToken(_0x51ee0b,_0x598392,_0x418a92){if(_0x51ee0b[_0x9e3d('0xb')]){_0x51ee0b[_0x9e3d('0xc')]=_0x51ee0b[_0x9e3d('0xd')][_0x9e3d('0xe')];_0x51ee0b[_0x9e3d('0xf')]=_0x51ee0b[_0x9e3d('0xd')][_0x9e3d('0x10')];return Promise[_0x9e3d('0x11')](_0x51ee0b['CloudProvider'][_0x9e3d('0x12')]);}var _0x11f3e2={'method':'POST','uri':_0x598392,'form':{'client_id':_0x51ee0b['clientId'],'resource':_0x51ee0b['remoteUri'],'username':_0x51ee0b['username'],'password':_0x51ee0b[_0x9e3d('0x13')],'grant_type':_0x9e3d('0x13'),'client_secret':_0x51ee0b[_0x9e3d('0x14')]},'json':!![]};return rp(_0x11f3e2)[_0x9e3d('0x15')](function(_0x2ebcf4){return _0x2ebcf4[_0x9e3d('0x16')];})[_0x9e3d('0x17')](function(_0x435281){logger[_0x9e3d('0x18')]('['+[_0x418a92[_0x9e3d('0x19')]()]+_0x9e3d('0x1a'));return _0x435281[_0x9e3d('0x1b')];});}function getUser(_0x1f7bbd,_0x151346,_0x325c67,_0x3333e2,_0xdd0fd9,_0x32b728){return new Promise(function(_0x116779,_0x4e82b3){return getAuthToken(_0x151346,_0x3333e2,_0x32b728)[_0x9e3d('0x15')](function(_0x16a9b4){var _0x58e43c={'method':'GET','uri':_0xdd0fd9+_0x9e3d('0x1c'),'headers':{'Authorization':_0x9e3d('0x1d')+_0x16a9b4,'OData-Version':_0x9e3d('0x1e')},'json':!![]};return rp(_0x58e43c);})[_0x9e3d('0x15')](function(_0x2161c5){var _0x27477=_0x2161c5[_0x9e3d('0x1f')];var _0x53d591=![];var _0x2519d9=null;if(!_['isNil'](_0x325c67)){if(intUtil['validateEmail'](_0x325c67[_0x9e3d('0x20')])){_0x1f7bbd[_0x9e3d('0x21')]=_0x325c67[_0x9e3d('0x20')];for(_0x2519d9=0x0;_0x2519d9<_0x27477[_0x9e3d('0x22')];_0x2519d9++){if(_0x27477[_0x2519d9]['internalemailaddress']===_0x325c67['email']&&!_0x27477[_0x2519d9]['isdisabled']){_0x53d591=!![];logger[_0x9e3d('0x23')]('['+[_0x32b728['toUpperCase']()]+_0x9e3d('0x24')+_0x27477[_0x2519d9][_0x9e3d('0x25')]+'!');_0x1f7bbd[_0x9e3d('0x26')]=_0x27477[_0x2519d9]['systemuserid'];}}}}if(!_0x53d591){logger[_0x9e3d('0x23')]('['+[_0x32b728['toUpperCase']()]+_0x9e3d('0x27'));_0x1f7bbd['userEmail']=_0x151346[_0x9e3d('0x28')];for(_0x2519d9=0x0;_0x2519d9<_0x27477[_0x9e3d('0x22')];_0x2519d9++){if(_0x27477[_0x2519d9][_0x9e3d('0x29')]===_0x151346['username']){_0x1f7bbd[_0x9e3d('0x26')]=_0x27477[_0x2519d9]['systemuserid'];}}}_0x116779(_0x1f7bbd);})[_0x9e3d('0x17')](function(_0x1b7058){_0x4e82b3(_0x1b7058['message']);});});}function createEndUser(_0x5a4eb9,_0x2508c4,_0xec92aa,_0x3ff502,_0x4f2668,_0xbd66fc,_0xf69a38){return new Promise(function(_0x53f7e4,_0x23a38b){return getAuthToken(_0x2508c4,_0xec92aa,_0xbd66fc)[_0x9e3d('0x15')](function(_0x470426){var _0x2404c5=_0xbd66fc['toLowerCase']()==='outbound'?_0x4f2668[_0x9e3d('0x2a')]:_0x4f2668[_0x9e3d('0x2b')];var _0x218f13={'method':_0x9e3d('0x2c'),'uri':_0x3ff502+_0x9e3d('0x2d'),'body':{'fullname':_0x2404c5,'firstname':_0x2404c5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x9e3d('0x2e')+_0x5a4eb9[_0x9e3d('0x26')]+')'},'headers':{'Authorization':_0x9e3d('0x1d')+_0x470426,'OData-Version':_0x9e3d('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x218f13[_0x9e3d('0x2f')][_0xf69a38]=_0x2404c5;return rp(_0x218f13);})['then'](function(_0x2574c0){var _0x4b0d46=_0x2574c0[_0x9e3d('0x30')]['odata-entityid'];var _0x2aead6=_0x4b0d46['substring'](_0x4b0d46[_0x9e3d('0x31')]('(')+0x1,_0x4b0d46[_0x9e3d('0x31')](')'));_0x5a4eb9[_0x9e3d('0x32')]=_0x2aead6;_0x53f7e4(_0x5a4eb9);})['catch'](function(_0x1f3e87){_0x23a38b(_0x1f3e87[_0x9e3d('0x1b')]);});});}function getEndUser(_0x35aadb,_0x453f3e,_0x44aa9e,_0x254874,_0x3d0405,_0x262111,_0x3b4fc7,_0x1d1574){var _0x56fae9=_0x262111[_0x9e3d('0x33')]()===_0x9e3d('0x34')?_0x3d0405[_0x9e3d('0x2a')]:_0x3d0405[_0x9e3d('0x2b')];return getAuthToken(_0x453f3e,_0x44aa9e,_0x262111)[_0x9e3d('0x15')](function(_0x490cd4){_0x1d1574=_0x1d1574?_0x1d1574:_0x9e3d('0x35');var _0x3bde3e={'method':'GET','uri':_0x254874+_0x9e3d('0x36')+_0x1d1574+_0x9e3d('0x37')+_0x1d1574+'\x20eq\x20\x27'+_0x56fae9['replace']('+',_0x9e3d('0x38'))+'\x27','headers':{'Authorization':_0x9e3d('0x1d')+_0x490cd4,'If-None-Match':null,'OData-Version':_0x9e3d('0x1e')},'json':!![]};return rp(_0x3bde3e);})['then'](function(_0x392e98){var _0x242340=![];if(!_0x392e98)return _0x242340;var _0x5d6faf=_0x392e98['value'];for(var _0xf76334=0x0;_0xf76334<_0x5d6faf['length'];_0xf76334++){if(_0x5d6faf[_0xf76334][_0x1d1574]===_0x56fae9){_0x242340=!![];_0x35aadb['enduserId']=_0x5d6faf[_0xf76334][_0x9e3d('0x39')];}}return _0x242340;})[_0x9e3d('0x15')](function(_0x113fca){if(_0x113fca)return _0x35aadb;if(_0x3b4fc7===_0x9e3d('0x3a')){logger[_0x9e3d('0x23')]('['+[_0x262111[_0x9e3d('0x19')]()]+_0x9e3d('0x3b'));return _0x35aadb;}return createEndUser(_0x35aadb,_0x453f3e,_0x44aa9e,_0x254874,_0x3d0405,_0x262111,_0x1d1574)[_0x9e3d('0x15')](function(_0x158304){logger['info']('['+[_0x262111[_0x9e3d('0x19')]()]+_0x9e3d('0x3c'),_0x158304[_0x9e3d('0x32')]);return _0x158304;});});}function getCustomFields(_0x165edf,_0x506c8a,_0x33f5d1){var _0x56ddae={};if(_0x165edf[_0x9e3d('0x22')]>0x0){_['forEach'](_0x165edf,function(_0x59a143){if(_[_0x9e3d('0x3d')]([_0x9e3d('0x3e'),'picklist'],_0x59a143[_0x9e3d('0x3f')])&&_0x59a143[_0x9e3d('0x40')]&&!_0x59a143[_0x9e3d('0x41')]){var _0x509355=_0x59a143[_0x9e3d('0x42')][_0x9e3d('0x33')]();var _0x5a0677=_0x509355['substring'](0x0,_0x509355['indexOf']('_'));var _0x3ae3f0=_0x509355[_0x9e3d('0x43')](_0x509355[_0x9e3d('0x44')]('_')+0x1);if(_0x5a0677===_0x33f5d1){_0x56ddae[_0x3ae3f0]=_0x59a143[_0x9e3d('0x45')];}}});}return _0x56ddae;}function getTicket(_0x31dbfa,_0x583753,_0x249707,_0x483498,_0x5d285f,_0xb2668a,_0x350b47){return new Promise(function(_0x106362,_0x4b958b){var _0x136ee1;return getAuthToken(_0x583753,_0x249707,_0x350b47)[_0x9e3d('0x15')](function(_0xd9a498){if(_0xb2668a[_0x9e3d('0x46')]===_0x9e3d('0x47')){_0x136ee1={'method':'POST','uri':_0x483498+_0x9e3d('0x48'),'body':Object[_0x9e3d('0x49')]({},{'title':intUtil[_0x9e3d('0x4a')](_0xb2668a[_0x9e3d('0x4b')],_0x5d285f,'\x20'),'description':intUtil[_0x9e3d('0x4a')](_0xb2668a[_0x9e3d('0x4c')],_0x5d285f,'\x0a'),'customerid_contact@odata.bind':_0x31dbfa[_0x9e3d('0x32')]?_0x9e3d('0x4d')+_0x31dbfa[_0x9e3d('0x32')]+')':undefined,'ownerid@odata.bind':_0x9e3d('0x2e')+_0x31dbfa[_0x9e3d('0x26')]+')','caseorigincode':'1'},getCustomFields(_0xb2668a[_0x9e3d('0x4e')],_0x5d285f,_0xb2668a[_0x9e3d('0x46')])),'headers':{'Authorization':_0x9e3d('0x1d')+_0xd9a498,'OData-Version':_0x9e3d('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xb2668a[_0x9e3d('0x46')]===_0x9e3d('0x4f')){var _0x2d13b1=_0x31dbfa[_0x9e3d('0x32')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x31dbfa['userId']+')','participationtypemask':_0x31dbfa[_0x9e3d('0x50')]===_0x9e3d('0x51')?0x2:0x1},{'partyid_contact@odata.bind':_0x9e3d('0x4d')+_0x31dbfa[_0x9e3d('0x32')]+')','participationtypemask':_0x31dbfa[_0x9e3d('0x50')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x9e3d('0x2e')+_0x31dbfa[_0x9e3d('0x26')]+')','participationtypemask':_0x31dbfa[_0x9e3d('0x50')]===_0x9e3d('0x51')?0x2:0x1}];_0x136ee1={'method':_0x9e3d('0x2c'),'uri':_0x483498+_0x9e3d('0x52'),'body':Object[_0x9e3d('0x49')]({},{'subject':intUtil[_0x9e3d('0x4a')](_0xb2668a[_0x9e3d('0x4b')],_0x5d285f,'\x20'),'phonenumber':String(_0x5d285f[_0x9e3d('0x2b')]),'description':intUtil['getString'](_0xb2668a[_0x9e3d('0x4c')],_0x5d285f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x31dbfa['enduserId']?_0x9e3d('0x4d')+_0x31dbfa['enduserId']+')':undefined,'ownerid@odata.bind':_0x9e3d('0x2e')+_0x31dbfa[_0x9e3d('0x26')]+')','directioncode':_0x31dbfa[_0x9e3d('0x50')]===_0x9e3d('0x51')?![]:!![],'phonecall_activity_parties':_0x2d13b1},getCustomFields(_0xb2668a[_0x9e3d('0x4e')],_0x5d285f,_0xb2668a['ticketType'])),'headers':{'Authorization':_0x9e3d('0x1d')+_0xd9a498,'OData-Version':_0x9e3d('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x136ee1);})[_0x9e3d('0x15')](function(_0x4f3bc9){var _0x2fa19c=_0x4f3bc9[_0x9e3d('0x30')][_0x9e3d('0x53')];var _0x47c6dc=_0x2fa19c[_0x9e3d('0x43')](_0x2fa19c[_0x9e3d('0x31')]('(')+0x1,_0x2fa19c[_0x9e3d('0x31')](')'));_0x31dbfa[_0x9e3d('0x54')]=_0x47c6dc;_0x106362(_0x31dbfa);})[_0x9e3d('0x17')](function(_0x5385c8){_0x4b958b(_0x5385c8[_0x9e3d('0x1b')]);});});}function emit(_0xdd1c7d,_0x35641f,_0x4ec6f2,_0x4c66bc){var _0x216337={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0xdd1c7d,_0x4ec6f2,_0x4c66bc)};io['to'](util['format'](_0x9e3d('0x55'),_0x35641f))['emit'](_0x9e3d('0x56'),_0x216337);}exports['cs']=function(_0x271bc8,_0x36ec70,_0x2901bd,_0x3c8482,_0x53bcaf,_0x3bd6e6,_0x511221,_0x3fc066){var _0x291a24={};_0x3bd6e6[_0x9e3d('0xc')]=_0x3bd6e6[_0x9e3d('0xb')]?intUtil[_0x9e3d('0x57')](_0x3bd6e6['CloudProvider'][_0x9e3d('0xe')]):intUtil[_0x9e3d('0x57')](_0x3bd6e6[_0x9e3d('0xc')]);_0x3bd6e6[_0x9e3d('0x58')]=intUtil[_0x9e3d('0x57')](_0x3bd6e6[_0x9e3d('0x58')]);_0x291a24[_0x9e3d('0x50')]=_0x3fc066===_0x9e3d('0x51')||_0x3fc066===_0x9e3d('0x59')?'queue':_0x9e3d('0x34');var _0x356b5c=_0x3bd6e6[_0x9e3d('0xb')]?util['format']('%s/api/data/v9.0/',_0x3bd6e6['CloudProvider']['data7']):util[_0x9e3d('0x5a')](_0x9e3d('0x5b'),_0x3bd6e6[_0x9e3d('0xc')]);var _0x573abd=util[_0x9e3d('0x5a')](_0x9e3d('0x5c'),_0x3bd6e6[_0x9e3d('0xf')]);var _0x51a53f=util['format'](_0x9e3d('0x5d'),_0x3bd6e6['serverUrl'],_0x36ec70['uniqueid'],md5(_0x36ec70[_0x9e3d('0x5e')]));if(_0x53bcaf&&_0x53bcaf[_0x9e3d('0x5f')]){logger['info']('[QUEUE]',_0x9e3d('0x60'));_0x36ec70[_0x9e3d('0x61')]=_0x51a53f;}else if(_0x511221&&_0x511221[_0x9e3d('0x62')]&&_0x511221[_0x9e3d('0x62')]!=='none'){logger[_0x9e3d('0x23')]('[OUTBOUND]',_0x9e3d('0x60'));_0x36ec70[_0x9e3d('0x61')]=_0x51a53f;}else{_0x36ec70['recordingURL']='';}return getUser(_0x291a24,_0x3bd6e6,_0x3c8482,_0x573abd,_0x356b5c,_0x3fc066)[_0x9e3d('0x15')](function(_0x4e1f6c){logger['info']('['+_0x3fc066[_0x9e3d('0x19')]()+']\x20The\x20User\x20ID\x20is:',_0x4e1f6c[_0x9e3d('0x26')]);logger[_0x9e3d('0x23')]('['+_0x3fc066[_0x9e3d('0x19')]()+']\x20The\x20User\x20email\x20is:',_0x4e1f6c[_0x9e3d('0x21')]);return getEndUser(_0x4e1f6c,_0x3bd6e6,_0x573abd,_0x356b5c,_0x36ec70,_0x3fc066,_0x2901bd[_0x9e3d('0x63')],_0x2901bd[_0x9e3d('0x64')]);})['then'](function(_0x58ee97){logger['info']('['+_0x3fc066[_0x9e3d('0x19')]()+_0x9e3d('0x65'),_0x58ee97[_0x9e3d('0x32')]);logger[_0x9e3d('0x23')]('['+_0x3fc066[_0x9e3d('0x19')]()+_0x9e3d('0x66'),_0x36ec70[_0x9e3d('0x2b')]);return getTicket(_0x58ee97,_0x3bd6e6,_0x573abd,_0x356b5c,_0x36ec70,_0x2901bd,_0x3fc066);})[_0x9e3d('0x15')](function(_0x5b258f){logger[_0x9e3d('0x23')](util[_0x9e3d('0x5a')]('['+_0x3fc066[_0x9e3d('0x19')]()+_0x9e3d('0x67'),_0x2901bd[_0x9e3d('0x46')],_0x5b258f['ticketId']));logger['info'](util['format']('['+_0x3fc066[_0x9e3d('0x19')]()+_0x9e3d('0x68'),_0x3fc066));if(_0x3fc066!==_0x9e3d('0x59')&&_0x2901bd['openNewTab']){logger['info']('['+_0x3fc066['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3bd6e6['remoteUri'],_0x3c8482['name'],_0x2901bd['ticketType'],_0x5b258f[_0x9e3d('0x54')]);}})[_0x9e3d('0x17')](function(_0x245ef9){logger[_0x9e3d('0x18')]('['+_0x3fc066['toUpperCase']()+_0x9e3d('0x69'),_0x245ef9[_0x9e3d('0x1b')]);console[_0x9e3d('0x18')](_0x9e3d('0x6a'),_0x245ef9);});}; \ 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 24c35df..e02f4ad 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 _0x6937=['[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','catch','unmanaged','toUpperCase','lastevent','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','idField','push','content','variable','variableName','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','stripTrailingSlash','recordingFormat','none'];(function(_0x286892,_0xe74dd9){var _0x318e28=function(_0x23f50b){while(--_0x23f50b){_0x286892['push'](_0x286892['shift']());}};_0x318e28(++_0xe74dd9);}(_0x6937,0xc3));var _0x7693=function(_0x55cdc5,_0x2b2297){_0x55cdc5=_0x55cdc5-0x0;var _0x29acd5=_0x6937[_0x55cdc5];return _0x29acd5;};'use strict';var _=require(_0x7693('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x7693('0x1'));var Redis=require(_0x7693('0x2'));var intUtil=require(_0x7693('0x3'));var config=require(_0x7693('0x4'));var logger=require(_0x7693('0x5'))(_0x7693('0x6'));config[_0x7693('0x7')]=_[_0x7693('0x8')](config[_0x7693('0x7')],{'host':_0x7693('0x9'),'port':0x18eb});var io=require(_0x7693('0xa'))(new Redis(config[_0x7693('0x7')]));var headers={'Content-Type':_0x7693('0xb'),'Accept':_0x7693('0xb')};function emit(_0x198ec6,_0x59d66a,_0x1b87e5){io['to'](_0x198ec6)[_0x7693('0xc')](_0x59d66a,_0x1b87e5);}function getTicket(_0x186ecc,_0x164c6f,_0x307322,_0x5ac86a,_0x5d0b13){logger[_0x7693('0xd')](_0x7693('0xe'));var _0x2b82c4=_[_0x7693('0xf')]({'responder_id':_0x164c6f['id'],'requester_id':_0x307322['id'],'name':util[_0x7693('0x10')](_0x7693('0x11'),_0x5d0b13[_0x7693('0x12')]),'phone':_0x5d0b13['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7693('0x13')](_0x5ac86a[_0x7693('0x14')],_0x5d0b13,'\x20'),'description':intUtil[_0x7693('0x13')](_0x5ac86a[_0x7693('0x15')],_0x5d0b13,_0x7693('0x16')),'tags':getTags(_0x5ac86a['Tags'],_0x7693('0x17'))},getCustomFields(_0x5ac86a[_0x7693('0x18')],_0x5d0b13));_0x2b82c4[_0x7693('0x19')]=_['mapValues'](_[_0x7693('0x1a')](_0x2b82c4[_0x7693('0x19')],'id'),'value');return request({'uri':util[_0x7693('0x10')](_0x7693('0x1b'),_0x186ecc[_0x7693('0x1c')]),'method':_0x7693('0x1d'),'body':_0x2b82c4})[_0x7693('0x1e')](function(_0x487857){logger[_0x7693('0xd')](_0x7693('0x1f'));return _0x487857;});}function getUser(_0x760a8c,_0x4a5075){if(intUtil['validateEmail'](_0x4a5075)){return request({'uri':util[_0x7693('0x10')](_0x7693('0x20'),_0x760a8c[_0x7693('0x1c')]),'qs':{'email':_0x4a5075}})[_0x7693('0x1e')](function(_0x3cf40e){if(_0x3cf40e[_0x7693('0x21')]){logger[_0x7693('0xd')]('Agent\x20found!');return _[_0x7693('0x22')](_0x3cf40e,function(_0x4ffc2a){return _0x4ffc2a[_0x7693('0x23')][_0x7693('0x24')]===_0x4a5075;});}else{logger[_0x7693('0xd')](_0x7693('0x25'));return request({'uri':util[_0x7693('0x10')](_0x7693('0x26'),_0x760a8c[_0x7693('0x1c')])})[_0x7693('0x1e')](function(_0x11e33b){logger['info'](_0x7693('0x27'));return _0x11e33b;});}});}else{logger['info'](_0x7693('0x28'));return request({'uri':util['format'](_0x7693('0x26'),_0x760a8c[_0x7693('0x1c')])})[_0x7693('0x1e')](function(_0x4e23c9){logger[_0x7693('0xd')](_0x7693('0x27'));return _0x4e23c9;});}}function getEndUser(_0x5ce35f,_0x3186f7,_0x5cca19){logger[_0x7693('0xd')]('Searching\x20enduser\x20with\x20phone',_0x5cca19);return request({'uri':util[_0x7693('0x10')]('%s/api/v2/contacts',_0x5ce35f[_0x7693('0x1c')]),'qs':{'phone':_0x5cca19}})['then'](function(_0x26daf3){if(_0x26daf3['length']){logger[_0x7693('0xd')]('Enduser\x20found!');return _[_0x7693('0x22')](_0x26daf3,{'phone':_0x5cca19});}else{logger[_0x7693('0xd')](_0x7693('0x29'));return request({'uri':util[_0x7693('0x10')](_0x7693('0x2a'),_0x5ce35f[_0x7693('0x1c')]),'method':_0x7693('0x1d'),'body':{'name':_0x3186f7,'phone':_0x5cca19}})[_0x7693('0x1e')](function(_0x2b13a4){logger[_0x7693('0xd')](_0x7693('0x2b'));return _0x2b13a4;});}});}function getAuth(_0x55bea3){return util[_0x7693('0x10')](_0x7693('0x2c'),new Buffer(_0x55bea3[_0x7693('0x2d')]+':X')[_0x7693('0x2e')](_0x7693('0x2f')));}function request(_0x4cafeb){logger[_0x7693('0x30')](_0x7693('0x31'),JSON[_0x7693('0x32')](_0x4cafeb));return rp(_[_0x7693('0x8')](_0x4cafeb,{'method':_0x7693('0x33'),'headers':headers,'json':!![]}));}function getTags(_0xf53181,_0x4aa4de){var _0x1190d4=[];if(_0xf53181&&_0xf53181['length']>0x0){_0x1190d4=_[_0x7693('0x34')](_0xf53181,_0x4aa4de);}return _0x1190d4;}function getCustomFields(_0x29a154,_0x150634){var _0x1a9f79=[];var _0x5d5c3a={'custom_fields':[]};if(_0x29a154[_0x7693('0x21')]>0x0){_[_0x7693('0x35')](_0x29a154,function(_0x4032f6){if(_['includes']([_0x7693('0x36'),_0x7693('0x37')],_0x4032f6[_0x7693('0x38')])&&_0x4032f6[_0x7693('0x39')]&&!_0x4032f6[_0x7693('0x3a')]){_0x5d5c3a[_0x4032f6['nameField'][_0x7693('0x3b')]()]=_0x4032f6['content'][_0x7693('0x2e')]();}else if(_['includes']([_0x7693('0x36'),_0x7693('0x37')],_0x4032f6[_0x7693('0x38')])&&_0x4032f6[_0x7693('0x3c')]&&_0x4032f6[_0x7693('0x3a')]){_0x5d5c3a['custom_fields'][_0x7693('0x3d')]({'id':_0x4032f6[_0x7693('0x3c')],'value':_0x4032f6[_0x7693('0x3e')]['toString']()});}else if(_0x4032f6['type']===_0x7693('0x3f')&&_0x4032f6[_0x7693('0x40')]&&_0x4032f6[_0x7693('0x3c')]&&_0x4032f6[_0x7693('0x3a')]){_0x150634[_0x4032f6['variableName']]&&_0x5d5c3a[_0x7693('0x19')][_0x7693('0x3d')]({'id':_0x4032f6[_0x7693('0x3c')],'value':_0x150634[_0x4032f6[_0x7693('0x40')]][_0x7693('0x2e')]()});}else if(_0x4032f6[_0x7693('0x38')]===_0x7693('0x41')&&_0x4032f6['Variable']&&_0x4032f6[_0x7693('0x42')][_0x7693('0x17')]&&_0x4032f6[_0x7693('0x3c')]&&_0x4032f6['customField']){_0x150634[_0x4032f6[_0x7693('0x42')][_0x7693('0x17')]['toLowerCase']()]&&_0x5d5c3a[_0x7693('0x19')]['push']({'id':_0x4032f6[_0x7693('0x3c')],'value':_0x150634[_0x4032f6['Variable'][_0x7693('0x17')][_0x7693('0x3b')]()][_0x7693('0x2e')]()});}});}return _0x5d5c3a;}exports[_0x7693('0x43')]=function(_0x3065ee,_0x220834,_0x51e4b5,_0x57cc6a,_0xb701a8,_0x596adc){var _0x30d991,_0x473d36;_0x596adc[_0x7693('0x1c')]=intUtil['stripTrailingSlash'](_0x596adc[_0x7693('0x1c')]);_0x596adc[_0x7693('0x44')]=intUtil['stripTrailingSlash'](_0x596adc['serverUrl']);if(_0xb701a8&&_0xb701a8[_0x7693('0x45')]){logger[_0x7693('0xd')](_0x7693('0x46'),'Recording\x20is\x20enabled!');_0x220834[_0x7693('0x47')]=util['format'](_0x7693('0x48'),_0x596adc[_0x7693('0x44')],_0x220834[_0x7693('0x49')],md5(_0x220834['uniqueid']));}else{_0x220834[_0x7693('0x47')]='';}headers[_0x7693('0x4a')]=getAuth(_0x596adc);return getUser(_0x596adc,_0x57cc6a[_0x7693('0x24')])[_0x7693('0x1e')](function(_0x5c47ff){_0x30d991=_0x5c47ff;logger['info']('The\x20User\x20ID\x20is:',_0x30d991['id']);return getEndUser(_0x596adc,_0x220834['calleridname'],_0x220834['calleridnum']);})['then'](function(_0x8bf557){_0x473d36=_0x8bf557;logger[_0x7693('0xd')](_0x7693('0x4b'),_0x473d36['id']);return getTicket(_0x596adc,_0x30d991,_0x473d36,_0x51e4b5,_0x220834);})['then'](function(_0x9769eb){if(_0x9769eb&&_0x9769eb['id']){logger['info'](_0x7693('0x1f'));logger[_0x7693('0xd')]('The\x20Ticket\x20ID\x20is:',_0x9769eb['id']);logger[_0x7693('0xd')]('[QUEUE]',_0x7693('0x4c'));emit(util[_0x7693('0x10')]('user:%s',_0x57cc6a['name']),_0x7693('0x4d'),{'uri':util[_0x7693('0x10')](_0x7693('0x4e'),_0x596adc[_0x7693('0x1c')],_0x9769eb['id'])});}})['catch'](function(_0x3b6149){logger[_0x7693('0x4f')](_0x7693('0x46'),JSON[_0x7693('0x32')](_0x3b6149));});};exports[_0x7693('0x50')]=function(_0x21f784,_0x4c0d2d,_0x3b88f8,_0x32be58,_0x3c745a,_0x33fca6,_0x44f3b9){var _0x443aa8,_0x49f0de;_0x33fca6[_0x7693('0x1c')]=intUtil[_0x7693('0x51')](_0x33fca6[_0x7693('0x1c')]);_0x33fca6[_0x7693('0x44')]=intUtil[_0x7693('0x51')](_0x33fca6[_0x7693('0x44')]);if(_0x44f3b9&&_0x44f3b9[_0x7693('0x52')]&&_0x44f3b9[_0x7693('0x52')]!==_0x7693('0x53')){logger[_0x7693('0xd')](_0x7693('0x54'),_0x7693('0x55'));_0x4c0d2d[_0x7693('0x47')]=util[_0x7693('0x10')](_0x7693('0x48'),_0x33fca6[_0x7693('0x44')],_0x4c0d2d['uniqueid'],md5(_0x4c0d2d[_0x7693('0x49')]));}headers[_0x7693('0x4a')]=getAuth(_0x33fca6);return getUser(_0x33fca6,_0x32be58[_0x7693('0x24')])[_0x7693('0x1e')](function(_0x338da4){_0x443aa8=_0x338da4;logger[_0x7693('0xd')](_0x7693('0x56'),_0x443aa8['id']);return getEndUser(_0x33fca6,_0x4c0d2d['destcalleridname'],_0x4c0d2d['destcalleridnum']);})[_0x7693('0x1e')](function(_0x2138b3){_0x49f0de=_0x2138b3;logger[_0x7693('0xd')](_0x7693('0x4b'),_0x49f0de['id']);return getTicket(_0x33fca6,_0x443aa8,_0x49f0de,_0x3b88f8,_0x4c0d2d);})[_0x7693('0x1e')](function(_0x1b029a){if(_0x1b029a&&_0x1b029a['id']){logger[_0x7693('0xd')](_0x7693('0x1f'));logger[_0x7693('0xd')](_0x7693('0x57'),_0x1b029a['id']);logger[_0x7693('0xd')](_0x7693('0x54'),_0x7693('0x4c'));emit(util[_0x7693('0x10')](_0x7693('0x58'),_0x32be58[_0x7693('0x17')]),_0x7693('0x4d'),{'uri':util['format'](_0x7693('0x4e'),_0x33fca6[_0x7693('0x1c')],_0x1b029a['id'])});}})[_0x7693('0x59')](function(_0x55a9e2){logger[_0x7693('0x4f')](_0x7693('0x54'),JSON[_0x7693('0x32')](_0x55a9e2));});};exports[_0x7693('0x5a')]=function(_0x196103,_0x2b2f49,_0xa6917e,_0x5d0fc0,_0x43d881,_0x542413){var _0x281c49,_0x48fcd6;_0x542413['remoteUri']=intUtil[_0x7693('0x51')](_0x542413[_0x7693('0x1c')]);_0x542413[_0x7693('0x44')]=intUtil[_0x7693('0x51')](_0x542413[_0x7693('0x44')]);if(_0x43d881&&_0x43d881['monitor_format']){logger[_0x7693('0xd')]('['+_0x2b2f49['lastevent'][_0x7693('0x5b')]()+']',_0x7693('0x55'));_0x2b2f49[_0x7693('0x47')]=util[_0x7693('0x10')](_0x7693('0x48'),_0x542413[_0x7693('0x44')],_0x2b2f49['uniqueid'],md5(_0x2b2f49[_0x7693('0x49')]));}else{_0x2b2f49['recordingURL']='';}headers[_0x7693('0x4a')]=getAuth(_0x542413);return getUser(_0x542413,'')[_0x7693('0x1e')](function(_0x2447cd){_0x281c49=_0x2447cd;logger[_0x7693('0xd')](_0x7693('0x56'),_0x281c49['id']);return getEndUser(_0x542413,_0x2b2f49[_0x7693('0x12')],_0x2b2f49['calleridnum']);})[_0x7693('0x1e')](function(_0x22487e){_0x48fcd6=_0x22487e;logger[_0x7693('0xd')](_0x7693('0x4b'),_0x48fcd6['id']);return getTicket(_0x542413,_0x281c49,_0x48fcd6,_0xa6917e,_0x2b2f49);})['then'](function(_0x13d6c0){if(_0x13d6c0){logger[_0x7693('0xd')]('Ticket\x20created!');logger[_0x7693('0xd')](_0x7693('0x57'),_0x13d6c0['id']);}})['catch'](function(_0x5d27a2){logger[_0x7693('0x4f')]('['+_0x2b2f49[_0x7693('0x5c')][_0x7693('0x5b')]()+']',JSON[_0x7693('0x32')](_0x5d27a2));});}; \ No newline at end of file +var _0x18ea=['uniqueid','Authorization','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','The\x20Enduser\x20ID\x20is:','error','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','info','merge','format','Caller\x20-\x20%s','calleridname','Subjects','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','%s/api/v2/agents','then','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','idField','push','type','variable','variableName','Variable','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x18ea,0x12f));var _0xa18e=function(_0x1f1b62,_0x5a8778){_0x1f1b62=_0x1f1b62-0x0;var _0x4d4f94=_0x18ea[_0x1f1b62];return _0x4d4f94;};'use strict';var _=require(_0xa18e('0x0'));var rp=require(_0xa18e('0x1'));var md5=require(_0xa18e('0x2'));var util=require(_0xa18e('0x3'));var Redis=require(_0xa18e('0x4'));var intUtil=require(_0xa18e('0x5'));var config=require(_0xa18e('0x6'));var logger=require(_0xa18e('0x7'))(_0xa18e('0x8'));config[_0xa18e('0x9')]=_[_0xa18e('0xa')](config[_0xa18e('0x9')],{'host':_0xa18e('0xb'),'port':0x18eb});var io=require(_0xa18e('0xc'))(new Redis(config[_0xa18e('0x9')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x33bbbe,_0x534d94,_0x2c86f4){io['to'](_0x33bbbe)['emit'](_0x534d94,_0x2c86f4);}function getTicket(_0x43240f,_0x1f1c7f,_0x3bc5e4,_0x171682,_0x344592){logger[_0xa18e('0xd')]('Creating\x20new\x20ticket...');var _0x45c408=_[_0xa18e('0xe')]({'responder_id':_0x1f1c7f['id'],'requester_id':_0x3bc5e4['id'],'name':util[_0xa18e('0xf')](_0xa18e('0x10'),_0x344592[_0xa18e('0x11')]),'phone':_0x344592['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x171682[_0xa18e('0x12')],_0x344592,'\x20'),'description':intUtil['getString'](_0x171682['Descriptions'],_0x344592,_0xa18e('0x13')),'tags':getTags(_0x171682[_0xa18e('0x14')],_0xa18e('0x15'))},getCustomFields(_0x171682[_0xa18e('0x16')],_0x344592));_0x45c408[_0xa18e('0x17')]=_[_0xa18e('0x18')](_[_0xa18e('0x19')](_0x45c408[_0xa18e('0x17')],'id'),_0xa18e('0x1a'));return request({'uri':util[_0xa18e('0xf')](_0xa18e('0x1b'),_0x43240f[_0xa18e('0x1c')]),'method':_0xa18e('0x1d'),'body':_0x45c408})['then'](function(_0x1ac80a){logger[_0xa18e('0xd')](_0xa18e('0x1e'));return _0x1ac80a;});}function getUser(_0x1fa1aa,_0x13b7ed){if(intUtil['validateEmail'](_0x13b7ed)){return request({'uri':util[_0xa18e('0xf')](_0xa18e('0x1f'),_0x1fa1aa[_0xa18e('0x1c')]),'qs':{'email':_0x13b7ed}})[_0xa18e('0x20')](function(_0x1c57be){if(_0x1c57be[_0xa18e('0x21')]){logger[_0xa18e('0xd')](_0xa18e('0x22'));return _[_0xa18e('0x23')](_0x1c57be,function(_0x195dbe){return _0x195dbe[_0xa18e('0x24')][_0xa18e('0x25')]===_0x13b7ed;});}else{logger[_0xa18e('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xa18e('0x26'),_0x1fa1aa[_0xa18e('0x1c')])})[_0xa18e('0x20')](function(_0x135fd0){logger['info'](_0xa18e('0x27'));return _0x135fd0;});}});}else{logger[_0xa18e('0xd')](_0xa18e('0x28'));return request({'uri':util['format'](_0xa18e('0x26'),_0x1fa1aa[_0xa18e('0x1c')])})['then'](function(_0x460c6e){logger[_0xa18e('0xd')]('Admin\x20account\x20selected.');return _0x460c6e;});}}function getEndUser(_0x381eb0,_0x116cc4,_0x5b1c01){logger['info'](_0xa18e('0x29'),_0x5b1c01);return request({'uri':util['format'](_0xa18e('0x2a'),_0x381eb0[_0xa18e('0x1c')]),'qs':{'phone':_0x5b1c01}})[_0xa18e('0x20')](function(_0xbf8a1){if(_0xbf8a1[_0xa18e('0x21')]){logger[_0xa18e('0xd')](_0xa18e('0x2b'));return _[_0xa18e('0x23')](_0xbf8a1,{'phone':_0x5b1c01});}else{logger['info'](_0xa18e('0x2c'));return request({'uri':util[_0xa18e('0xf')]('%s/api/v2/contacts',_0x381eb0['remoteUri']),'method':_0xa18e('0x1d'),'body':{'name':_0x116cc4,'phone':_0x5b1c01}})['then'](function(_0xba081e){logger['info'](_0xa18e('0x2d'));return _0xba081e;});}});}function getAuth(_0x55590a){return util['format'](_0xa18e('0x2e'),new Buffer(_0x55590a[_0xa18e('0x2f')]+':X')[_0xa18e('0x30')](_0xa18e('0x31')));}function request(_0x39bf8c){logger['debug'](_0xa18e('0x32'),JSON[_0xa18e('0x33')](_0x39bf8c));return rp(_[_0xa18e('0xa')](_0x39bf8c,{'method':_0xa18e('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x1d8dc9,_0x51aaa5){var _0x4ee437=[];if(_0x1d8dc9&&_0x1d8dc9['length']>0x0){_0x4ee437=_[_0xa18e('0x35')](_0x1d8dc9,_0x51aaa5);}return _0x4ee437;}function getCustomFields(_0x5700cf,_0x48151a){var _0x218bdc=[];var _0x83fb12={'custom_fields':[]};if(_0x5700cf[_0xa18e('0x21')]>0x0){_[_0xa18e('0x36')](_0x5700cf,function(_0x315eec){if(_[_0xa18e('0x37')]([_0xa18e('0x38'),_0xa18e('0x39')],_0x315eec['type'])&&_0x315eec[_0xa18e('0x3a')]&&!_0x315eec[_0xa18e('0x3b')]){_0x83fb12[_0x315eec['nameField'][_0xa18e('0x3c')]()]=_0x315eec[_0xa18e('0x3d')][_0xa18e('0x30')]();}else if(_[_0xa18e('0x37')](['string','picklist'],_0x315eec['type'])&&_0x315eec[_0xa18e('0x3e')]&&_0x315eec['customField']){_0x83fb12[_0xa18e('0x17')][_0xa18e('0x3f')]({'id':_0x315eec[_0xa18e('0x3e')],'value':_0x315eec[_0xa18e('0x3d')][_0xa18e('0x30')]()});}else if(_0x315eec[_0xa18e('0x40')]===_0xa18e('0x41')&&_0x315eec[_0xa18e('0x42')]&&_0x315eec[_0xa18e('0x3e')]&&_0x315eec[_0xa18e('0x3b')]){_0x48151a[_0x315eec[_0xa18e('0x42')]]&&_0x83fb12[_0xa18e('0x17')][_0xa18e('0x3f')]({'id':_0x315eec['idField'],'value':_0x48151a[_0x315eec[_0xa18e('0x42')]][_0xa18e('0x30')]()});}else if(_0x315eec[_0xa18e('0x40')]==='customVariable'&&_0x315eec[_0xa18e('0x43')]&&_0x315eec[_0xa18e('0x43')][_0xa18e('0x15')]&&_0x315eec[_0xa18e('0x3e')]&&_0x315eec[_0xa18e('0x3b')]){_0x48151a[_0x315eec['Variable'][_0xa18e('0x15')][_0xa18e('0x3c')]()]&&_0x83fb12[_0xa18e('0x17')][_0xa18e('0x3f')]({'id':_0x315eec['idField'],'value':_0x48151a[_0x315eec[_0xa18e('0x43')][_0xa18e('0x15')]['toLowerCase']()][_0xa18e('0x30')]()});}});}return _0x83fb12;}exports['queue']=function(_0x374b7a,_0x43d833,_0x4b6954,_0x13ac2a,_0x416035,_0x130978){var _0x991318,_0x2d6377;_0x130978[_0xa18e('0x1c')]=intUtil['stripTrailingSlash'](_0x130978[_0xa18e('0x1c')]);_0x130978[_0xa18e('0x44')]=intUtil[_0xa18e('0x45')](_0x130978['serverUrl']);if(_0x416035&&_0x416035['monitor_format']){logger[_0xa18e('0xd')](_0xa18e('0x46'),'Recording\x20is\x20enabled!');_0x43d833[_0xa18e('0x47')]=util[_0xa18e('0xf')](_0xa18e('0x48'),_0x130978[_0xa18e('0x44')],_0x43d833[_0xa18e('0x49')],md5(_0x43d833[_0xa18e('0x49')]));}else{_0x43d833[_0xa18e('0x47')]='';}headers[_0xa18e('0x4a')]=getAuth(_0x130978);return getUser(_0x130978,_0x13ac2a[_0xa18e('0x25')])[_0xa18e('0x20')](function(_0x36849c){_0x991318=_0x36849c;logger[_0xa18e('0xd')]('The\x20User\x20ID\x20is:',_0x991318['id']);return getEndUser(_0x130978,_0x43d833['calleridname'],_0x43d833[_0xa18e('0x4b')]);})['then'](function(_0x2906ad){_0x2d6377=_0x2906ad;logger[_0xa18e('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2d6377['id']);return getTicket(_0x130978,_0x991318,_0x2d6377,_0x4b6954,_0x43d833);})[_0xa18e('0x20')](function(_0x577c78){if(_0x577c78&&_0x577c78['id']){logger['info']('Ticket\x20created!');logger['info'](_0xa18e('0x4c'),_0x577c78['id']);logger[_0xa18e('0xd')](_0xa18e('0x46'),_0xa18e('0x4d'));emit(util['format'](_0xa18e('0x4e'),_0x13ac2a[_0xa18e('0x15')]),_0xa18e('0x4f'),{'uri':util['format'](_0xa18e('0x50'),_0x130978[_0xa18e('0x1c')],_0x577c78['id'])});}})[_0xa18e('0x51')](function(_0x3f4e65){logger['error']('[QUEUE]',JSON[_0xa18e('0x33')](_0x3f4e65));});};exports['outbound']=function(_0x1d4c30,_0x312b30,_0x2b88d4,_0x14140c,_0x4c7d9b,_0x217bec,_0x4418dd){var _0xf2caa9,_0x29b4cf;_0x217bec[_0xa18e('0x1c')]=intUtil[_0xa18e('0x45')](_0x217bec['remoteUri']);_0x217bec[_0xa18e('0x44')]=intUtil[_0xa18e('0x45')](_0x217bec[_0xa18e('0x44')]);if(_0x4418dd&&_0x4418dd[_0xa18e('0x52')]&&_0x4418dd[_0xa18e('0x52')]!==_0xa18e('0x53')){logger[_0xa18e('0xd')](_0xa18e('0x54'),_0xa18e('0x55'));_0x312b30[_0xa18e('0x47')]=util['format'](_0xa18e('0x48'),_0x217bec[_0xa18e('0x44')],_0x312b30[_0xa18e('0x49')],md5(_0x312b30[_0xa18e('0x49')]));}headers['Authorization']=getAuth(_0x217bec);return getUser(_0x217bec,_0x14140c[_0xa18e('0x25')])['then'](function(_0x27b908){_0xf2caa9=_0x27b908;logger[_0xa18e('0xd')](_0xa18e('0x56'),_0xf2caa9['id']);return getEndUser(_0x217bec,_0x312b30[_0xa18e('0x57')],_0x312b30['destcalleridnum']);})['then'](function(_0x2525ea){_0x29b4cf=_0x2525ea;logger[_0xa18e('0xd')](_0xa18e('0x58'),_0x29b4cf['id']);return getTicket(_0x217bec,_0xf2caa9,_0x29b4cf,_0x2b88d4,_0x312b30);})[_0xa18e('0x20')](function(_0x36b4e2){if(_0x36b4e2&&_0x36b4e2['id']){logger[_0xa18e('0xd')](_0xa18e('0x1e'));logger['info'](_0xa18e('0x4c'),_0x36b4e2['id']);logger['info'](_0xa18e('0x54'),_0xa18e('0x4d'));emit(util[_0xa18e('0xf')]('user:%s',_0x14140c['name']),_0xa18e('0x4f'),{'uri':util[_0xa18e('0xf')](_0xa18e('0x50'),_0x217bec[_0xa18e('0x1c')],_0x36b4e2['id'])});}})[_0xa18e('0x51')](function(_0x226ed9){logger[_0xa18e('0x59')](_0xa18e('0x54'),JSON[_0xa18e('0x33')](_0x226ed9));});};exports[_0xa18e('0x5a')]=function(_0x41adff,_0x17cb40,_0x4296e7,_0x36b60d,_0x44512b,_0x539ce3){var _0x58ae37,_0x226ee1;_0x539ce3['remoteUri']=intUtil[_0xa18e('0x45')](_0x539ce3[_0xa18e('0x1c')]);_0x539ce3[_0xa18e('0x44')]=intUtil[_0xa18e('0x45')](_0x539ce3[_0xa18e('0x44')]);if(_0x44512b&&_0x44512b[_0xa18e('0x5b')]){logger['info']('['+_0x17cb40[_0xa18e('0x5c')][_0xa18e('0x5d')]()+']',_0xa18e('0x55'));_0x17cb40[_0xa18e('0x47')]=util['format'](_0xa18e('0x48'),_0x539ce3[_0xa18e('0x44')],_0x17cb40['uniqueid'],md5(_0x17cb40['uniqueid']));}else{_0x17cb40[_0xa18e('0x47')]='';}headers['Authorization']=getAuth(_0x539ce3);return getUser(_0x539ce3,'')[_0xa18e('0x20')](function(_0x37e0af){_0x58ae37=_0x37e0af;logger[_0xa18e('0xd')](_0xa18e('0x56'),_0x58ae37['id']);return getEndUser(_0x539ce3,_0x17cb40['calleridname'],_0x17cb40[_0xa18e('0x4b')]);})[_0xa18e('0x20')](function(_0x35eeed){_0x226ee1=_0x35eeed;logger['info'](_0xa18e('0x58'),_0x226ee1['id']);return getTicket(_0x539ce3,_0x58ae37,_0x226ee1,_0x4296e7,_0x17cb40);})[_0xa18e('0x20')](function(_0x2bc774){if(_0x2bc774){logger[_0xa18e('0xd')](_0xa18e('0x1e'));logger[_0xa18e('0xd')](_0xa18e('0x4c'),_0x2bc774['id']);}})[_0xa18e('0x51')](function(_0x54ec49){logger[_0xa18e('0x59')]('['+_0x17cb40['lastevent'][_0xa18e('0x5d')]()+']',JSON[_0xa18e('0x33')](_0x54ec49));});}; \ 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 00749f8..7a4f978 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 _0xd3f8=['destcalleridnum','calleridnum','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','/api/selector/owners','headers','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','message','GET','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','Admin\x20selected','catch','toUpperCase','/api/lookup?q=','&f=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','YYYY-MM-DDTHH:mm:ss','task','Task\x20created:','ticketId','/contacts/','emit','trigger:browser:url','apiKey','stripTrailingSlash','serverUrl','remoteUri','username','toLowerCase'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0xd3f8,0xb3));var _0x8d3f=function(_0xdff6ec,_0x177300){_0xdff6ec=_0xdff6ec-0x0;var _0x3081fe=_0xd3f8[_0xdff6ec];return _0x3081fe;};'use strict';var _=require(_0x8d3f('0x0'));var rp=require(_0x8d3f('0x1'));var md5=require('md5');var util=require(_0x8d3f('0x2'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x8d3f('0x3'));var intUtil=require(_0x8d3f('0x4'));var config=require(_0x8d3f('0x5'));var logger=require(_0x8d3f('0x6'))(_0x8d3f('0x7'));config[_0x8d3f('0x8')]=_['defaults'](config[_0x8d3f('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8d3f('0x8')]));function getAdminId(_0x120cec,_0x4a1f8b,_0x472103,_0x4a1880){return new Promise(function(_0xe84495,_0x3f9a5d){var _0x53e1d0=![];var _0x56a932={'method':'GET','uri':_0x4a1880+_0x8d3f('0x9'),'json':!![]};_0x56a932[_0x8d3f('0xa')]=_0x472103;logger['info'](_0x8d3f('0xb'));return rp(_0x56a932)[_0x8d3f('0xc')](function(_0x1e4201){if(_0x1e4201){var _0x508fd8=_0x1e4201['users'];var _0x4bf266=null;for(_0x4bf266=0x0;_0x4bf266<_0x508fd8[_0x8d3f('0xd')];_0x4bf266++){if(_0x508fd8[_0x4bf266][_0x8d3f('0xe')]===_0x120cec[_0x8d3f('0xf')]){_0x120cec[_0x8d3f('0x10')]=_0x508fd8[_0x4bf266]['id'];_0x53e1d0=!![];}}if(_0x53e1d0){logger[_0x8d3f('0x11')](_0x8d3f('0x12'),_0x120cec[_0x8d3f('0x10')]);_0xe84495(_0x120cec);}else{_0x3f9a5d({'statusCode':0x194,'message':_0x8d3f('0x13')});}}else{_0x3f9a5d({'statusCode':0x194,'message':_0x8d3f('0x13')});}})['catch'](function(_0xcbe70e){logger[_0x8d3f('0x14')]('['+[_0x4a1f8b['toUpperCase']()]+']',_0xcbe70e[_0x8d3f('0x15')]);_0x3f9a5d(_0xcbe70e);});});}function getUser(_0x7abe4c,_0x1ca071,_0x813847){return function(_0x36cafe){return new Promise(function(_0x1d957a,_0xb54054){var _0x364f06={'method':_0x8d3f('0x16'),'uri':_0x813847+'/api/selector/owners','json':!![]};_0x364f06[_0x8d3f('0xa')]=_0x1ca071;logger[_0x8d3f('0x11')](_0x8d3f('0x17'));return rp(_0x364f06)['then'](function(_0x2f7b06){if(_0x2f7b06){var _0x48d99e=_0x2f7b06[_0x8d3f('0x18')];var _0x58ee45=![];var _0x3a8680=null;if(_0x36cafe[_0x8d3f('0x19')]!==null){logger['info'](_0x8d3f('0x1a'),_0x36cafe[_0x8d3f('0x19')]);_0x36cafe[_0x8d3f('0x1b')]=_0x36cafe[_0x8d3f('0x19')];for(_0x3a8680=0x0;_0x3a8680<_0x48d99e[_0x8d3f('0xd')];_0x3a8680++){if(_0x48d99e[_0x3a8680][_0x8d3f('0xe')]===_0x36cafe[_0x8d3f('0x19')]){_0x58ee45=!![];_0x36cafe['userId']=_0x48d99e[_0x3a8680]['id'];logger[_0x8d3f('0x11')](_0x8d3f('0x1c'),_0x36cafe[_0x8d3f('0x1d')]);}}}if(!_0x58ee45){logger[_0x8d3f('0x11')](_0x8d3f('0x1e'));_0x36cafe[_0x8d3f('0x1b')]=_0x36cafe[_0x8d3f('0xf')];_0x36cafe['userId']=_0x36cafe[_0x8d3f('0x10')];_0x58ee45=!![];}if(_0x58ee45){_0x1d957a(_0x36cafe);}else{_0xb54054({'statusCode':0x194,'message':_0x8d3f('0x13')});}}else{_0xb54054({'statusCode':0x194,'message':_0x8d3f('0x13')});}})[_0x8d3f('0x1f')](function(_0xc78f2){logger['error']('['+[_0x7abe4c[_0x8d3f('0x20')]()]+']',_0xc78f2[_0x8d3f('0x15')]);_0xb54054(_0xc78f2);});});};}function searchContact(_0x2b285f,_0x3769e0,_0x4138ae,_0x1a980d){return new Promise(function(_0x4c8421,_0x1e1be0){var _0x44344c={'method':_0x8d3f('0x16'),'headers':_0x3769e0,'uri':_0x2b285f+_0x8d3f('0x21')+_0x1a980d+_0x8d3f('0x22')+_0x4138ae+'&entities=contact','json':!![]};rp(_0x44344c)[_0x8d3f('0xc')](function(_0xc607ef){var _0x1c42d6=_['find'](_0xc607ef[_0x8d3f('0x23')][_0x8d3f('0x23')],[_0x4138ae,_0x1a980d]);_0x4c8421(_0x1c42d6);})[_0x8d3f('0x1f')](function(_0x2c87){_0x1e1be0(_0x2c87);});});}function getEndUser(_0x49ee80,_0x13edf2,_0x13f65a){return function(_0x1b2850){return new Promise(function(_0x340fa4,_0x2cb596){logger[_0x8d3f('0x11')](util[_0x8d3f('0x24')](_0x8d3f('0x25'),_0x1b2850[_0x8d3f('0x26')]));searchContact(_0x13f65a,_0x13edf2,_0x8d3f('0x27'),_0x1b2850[_0x8d3f('0x26')])[_0x8d3f('0xc')](function(_0x2eb113){if(_0x2eb113){_0x1b2850[_0x8d3f('0x28')]=_0x2eb113['id'];logger[_0x8d3f('0x11')](_0x8d3f('0x29'),_0x1b2850[_0x8d3f('0x28')]);return _0x340fa4(_0x1b2850);}searchContact(_0x13f65a,_0x13edf2,_0x8d3f('0x2a'),_0x1b2850[_0x8d3f('0x26')])[_0x8d3f('0xc')](function(_0x4c4184){if(_0x4c4184){_0x1b2850[_0x8d3f('0x28')]=_0x4c4184['id'];logger[_0x8d3f('0x11')](_0x8d3f('0x2b'),_0x1b2850[_0x8d3f('0x28')]);return _0x340fa4(_0x1b2850);}createEndUser(_0x1b2850,_0x49ee80,_0x13edf2,_0x13f65a)[_0x8d3f('0xc')](function(_0x315a04){logger[_0x8d3f('0x11')]('Contact\x20created:',_0x315a04[_0x8d3f('0x28')]);return _0x340fa4(_0x315a04);});});})[_0x8d3f('0x1f')](function(_0x5cb882){_0x2cb596(_0x5cb882);});});};}function createEndUser(_0x4f6f37,_0x14009d,_0x24bff7,_0x1f5139){return new Promise(function(_0x5d3576,_0x4a515a){var _0x42414b=moment();var _0x5d1aff={'method':_0x8d3f('0x2c'),'uri':_0x1f5139+_0x8d3f('0x2d'),'body':{'contact':{'last_name':_0x4f6f37[_0x8d3f('0x26')],'work_number':_0x4f6f37[_0x8d3f('0x26')],'mobile_number':_0x4f6f37[_0x8d3f('0x26')],'owner_id':_0x4f6f37[_0x8d3f('0x1d')],'created_at':_0x42414b['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x5d1aff['headers']=_0x24bff7;logger[_0x8d3f('0x11')](_0x8d3f('0x2e'));return rp(_0x5d1aff)[_0x8d3f('0xc')](function(_0x2a4a64){_0x4f6f37[_0x8d3f('0x28')]=_0x2a4a64[_0x8d3f('0x2f')]['id'];_0x5d3576(_0x4f6f37);})[_0x8d3f('0x1f')](function(_0x1f835d){logger[_0x8d3f('0x14')]('['+[_0x14009d[_0x8d3f('0x20')]()]+']',_0x1f835d[_0x8d3f('0x15')]);_0x4a515a(_0x1f835d['message']);});});}function getTicket(_0x56f28d,_0x599ed9,_0x126cb1,_0x3b0b52,_0x5599ad){return function(_0x327cc4){logger[_0x8d3f('0x11')](_0x8d3f('0x30'));return new Promise(function(_0x9fcb8a,_0x1410f3){var _0x2685d9=moment();var _0x2fb4e0={'method':'POST','uri':_0x126cb1+_0x8d3f('0x31'),'body':{'title':intUtil[_0x8d3f('0x32')](_0x3b0b52['Subjects'],_0x5599ad,'\x20'),'description':intUtil[_0x8d3f('0x32')](_0x3b0b52[_0x8d3f('0x33')],_0x5599ad,'\x0a'),'owner_id':_0x327cc4[_0x8d3f('0x1d')],'creater_id':_0x327cc4[_0x8d3f('0x10')],'targetable_id':_0x327cc4[_0x8d3f('0x28')],'targetable_type':_0x8d3f('0x34'),'created_at':_0x2685d9[_0x8d3f('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2685d9[_0x8d3f('0x35')](0x1e,'m')['format'](_0x8d3f('0x36'))},'json':!![]};_0x2fb4e0[_0x8d3f('0xa')]=_0x599ed9;return rp(_0x2fb4e0)['then'](function(_0x56506d){_0x327cc4['ticketId']=_0x56506d[_0x8d3f('0x37')]['id'];logger['info'](_0x8d3f('0x38'),_0x327cc4[_0x8d3f('0x39')]);_0x9fcb8a(_0x327cc4);})[_0x8d3f('0x1f')](function(_0x4ff8fb){logger[_0x8d3f('0x14')]('['+[_0x56f28d[_0x8d3f('0x20')]()]+']',_0x4ff8fb[_0x8d3f('0x15')]);_0x1410f3(_0x4ff8fb[_0x8d3f('0x15')]);});});};}function emit(_0x2652b6,_0x38485a,_0x3d9b4b){var _0x62021f={'uri':_0x2652b6+_0x8d3f('0x3a')+_0x3d9b4b};io['to'](util[_0x8d3f('0x24')]('user:%s',_0x38485a))[_0x8d3f('0x3b')](_0x8d3f('0x3c'),_0x62021f);}exports['cs']=function(_0x1d47c6,_0x497b5e,_0x5e276f,_0x178b96,_0x5c4e67,_0x2ce40f,_0x56f7c8,_0x44ae58){var _0x2fd1a0={};var _0x47fdc1={'Authorization':'Token\x20token='+_0x2ce40f[_0x8d3f('0x3d')]};_0x2ce40f['remoteUri']=intUtil[_0x8d3f('0x3e')](_0x2ce40f['remoteUri']);_0x2ce40f[_0x8d3f('0x3f')]=intUtil['stripTrailingSlash'](_0x2ce40f[_0x8d3f('0x3f')]);var _0x2b0ccc=_0x2ce40f[_0x8d3f('0x40')];_0x2fd1a0[_0x8d3f('0xf')]=_0x2ce40f[_0x8d3f('0x41')];_0x2fd1a0[_0x8d3f('0x26')]=_0x44ae58[_0x8d3f('0x42')]()==='outbound'?_0x497b5e[_0x8d3f('0x43')]:_0x497b5e[_0x8d3f('0x44')];_0x2fd1a0['callDirection']=_0x44ae58===_0x8d3f('0x45')||_0x44ae58==='unmanaged'?_0x8d3f('0x45'):_0x8d3f('0x46');if(_0x178b96){_0x2fd1a0['agentEmail']=_0x178b96[_0x8d3f('0xe')];}var _0x3ab506=util[_0x8d3f('0x24')](_0x8d3f('0x47'),_0x2ce40f[_0x8d3f('0x3f')],_0x497b5e[_0x8d3f('0x48')],md5(_0x497b5e[_0x8d3f('0x48')]));if(_0x5c4e67&&_0x5c4e67['monitor_format']){logger[_0x8d3f('0x11')](_0x8d3f('0x49'),_0x8d3f('0x4a'));_0x497b5e[_0x8d3f('0x4b')]=_0x3ab506;}else if(_0x56f7c8&&_0x56f7c8[_0x8d3f('0x4c')]&&_0x56f7c8[_0x8d3f('0x4c')]!==_0x8d3f('0x4d')){logger['info'](_0x8d3f('0x4e'),_0x8d3f('0x4a'));_0x497b5e[_0x8d3f('0x4b')]=_0x3ab506;}else{_0x497b5e[_0x8d3f('0x4b')]='';}return getAdminId(_0x2fd1a0,_0x44ae58,_0x47fdc1,_0x2b0ccc)[_0x8d3f('0xc')](getUser(_0x44ae58,_0x47fdc1,_0x2b0ccc))[_0x8d3f('0xc')](getEndUser(_0x44ae58,_0x47fdc1,_0x2b0ccc))[_0x8d3f('0xc')](getTicket(_0x44ae58,_0x47fdc1,_0x2b0ccc,_0x5e276f,_0x497b5e))[_0x8d3f('0xc')](function(_0x1b0ed4){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x1b0ed4[_0x8d3f('0x39')]));if(_0x44ae58!==_0x8d3f('0x4f')){logger[_0x8d3f('0x11')]('['+[_0x44ae58[_0x8d3f('0x20')]()]+']',_0x8d3f('0x50'));emit(_0x2b0ccc,_0x178b96[_0x8d3f('0x51')],_0x1b0ed4[_0x8d3f('0x28')]);}})['catch'](function(_0x4c163b){logger[_0x8d3f('0x14')]('['+[_0x44ae58[_0x8d3f('0x20')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x4c163b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc70e=['callDirection','queue','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','unmanaged','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','util','moment','./util','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','/api/selector/owners','Getting\x20admin\x20information','then','users','email','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','userId','adminEmail','error','/api/lookup?q=','&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','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound'];(function(_0x1971f1,_0x48e960){var _0x2c3a90=function(_0x522d8f){while(--_0x522d8f){_0x1971f1['push'](_0x1971f1['shift']());}};_0x2c3a90(++_0x48e960);}(_0xc70e,0xaf));var _0xec70=function(_0x24afd3,_0xcc36f0){_0x24afd3=_0x24afd3-0x0;var _0xffe96f=_0xc70e[_0x24afd3];return _0xffe96f;};'use strict';var _=require(_0xec70('0x0'));var rp=require('request-promise');var md5=require(_0xec70('0x1'));var util=require(_0xec70('0x2'));var moment=require(_0xec70('0x3'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0xec70('0x4'));var config=require('../../../../config/environment');var logger=require(_0xec70('0x5'))(_0xec70('0x6'));config[_0xec70('0x7')]=_['defaults'](config[_0xec70('0x7')],{'host':_0xec70('0x8'),'port':0x18eb});var io=require(_0xec70('0x9'))(new Redis(config['redis']));function getAdminId(_0x49023b,_0x25e1b6,_0x2d0bfd,_0x64f4a2){return new Promise(function(_0x232571,_0x66b1f1){var _0x328b9c=![];var _0x41b2fb={'method':'GET','uri':_0x64f4a2+_0xec70('0xa'),'json':!![]};_0x41b2fb['headers']=_0x2d0bfd;logger['info'](_0xec70('0xb'));return rp(_0x41b2fb)[_0xec70('0xc')](function(_0x29a3d1){if(_0x29a3d1){var _0xe43d4e=_0x29a3d1[_0xec70('0xd')];var _0x5c2b5e=null;for(_0x5c2b5e=0x0;_0x5c2b5e<_0xe43d4e['length'];_0x5c2b5e++){if(_0xe43d4e[_0x5c2b5e][_0xec70('0xe')]===_0x49023b['adminEmail']){_0x49023b['adminId']=_0xe43d4e[_0x5c2b5e]['id'];_0x328b9c=!![];}}if(_0x328b9c){logger[_0xec70('0xf')](_0xec70('0x10'),_0x49023b[_0xec70('0x11')]);_0x232571(_0x49023b);}else{_0x66b1f1({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x66b1f1({'statusCode':0x194,'message':_0xec70('0x12')});}})[_0xec70('0x13')](function(_0x296025){logger['error']('['+[_0x25e1b6[_0xec70('0x14')]()]+']',_0x296025[_0xec70('0x15')]);_0x66b1f1(_0x296025);});});}function getUser(_0x2b721f,_0x317484,_0x527368){return function(_0x51e13b){return new Promise(function(_0x549553,_0x3291fb){var _0x232915={'method':_0xec70('0x16'),'uri':_0x527368+_0xec70('0xa'),'json':!![]};_0x232915[_0xec70('0x17')]=_0x317484;logger[_0xec70('0xf')](_0xec70('0x18'));return rp(_0x232915)[_0xec70('0xc')](function(_0x380aec){if(_0x380aec){var _0x3c2269=_0x380aec[_0xec70('0xd')];var _0x1ba1de=![];var _0x2d7c1b=null;if(_0x51e13b['agentEmail']!==null){logger[_0xec70('0xf')](_0xec70('0x19'),_0x51e13b[_0xec70('0x1a')]);_0x51e13b[_0xec70('0x1b')]=_0x51e13b[_0xec70('0x1a')];for(_0x2d7c1b=0x0;_0x2d7c1b<_0x3c2269[_0xec70('0x1c')];_0x2d7c1b++){if(_0x3c2269[_0x2d7c1b][_0xec70('0xe')]===_0x51e13b[_0xec70('0x1a')]){_0x1ba1de=!![];_0x51e13b['userId']=_0x3c2269[_0x2d7c1b]['id'];logger[_0xec70('0xf')]('User\x20found:',_0x51e13b[_0xec70('0x1d')]);}}}if(!_0x1ba1de){logger['info']('Admin\x20selected');_0x51e13b[_0xec70('0x1b')]=_0x51e13b[_0xec70('0x1e')];_0x51e13b[_0xec70('0x1d')]=_0x51e13b[_0xec70('0x11')];_0x1ba1de=!![];}if(_0x1ba1de){_0x549553(_0x51e13b);}else{_0x3291fb({'statusCode':0x194,'message':_0xec70('0x12')});}}else{_0x3291fb({'statusCode':0x194,'message':_0xec70('0x12')});}})[_0xec70('0x13')](function(_0x36ba95){logger[_0xec70('0x1f')]('['+[_0x2b721f[_0xec70('0x14')]()]+']',_0x36ba95[_0xec70('0x15')]);_0x3291fb(_0x36ba95);});});};}function searchContact(_0x1ca172,_0x372125,_0xc51d99,_0x5688a1){return new Promise(function(_0x50e88a,_0x357ec3){var _0x222ceb={'method':'GET','headers':_0x372125,'uri':_0x1ca172+_0xec70('0x20')+_0x5688a1+'&f='+_0xc51d99+_0xec70('0x21'),'json':!![]};rp(_0x222ceb)[_0xec70('0xc')](function(_0x5e2860){var _0x542a24=_[_0xec70('0x22')](_0x5e2860[_0xec70('0x23')][_0xec70('0x23')],[_0xc51d99,_0x5688a1]);_0x50e88a(_0x542a24);})[_0xec70('0x13')](function(_0x4dfd4d){_0x357ec3(_0x4dfd4d);});});}function getEndUser(_0x4147d5,_0x4eb555,_0x3842e8){return function(_0x1fc8a9){return new Promise(function(_0x11184,_0x1edea9){logger[_0xec70('0xf')](util[_0xec70('0x24')](_0xec70('0x25'),_0x1fc8a9[_0xec70('0x26')]));searchContact(_0x3842e8,_0x4eb555,_0xec70('0x27'),_0x1fc8a9['contactNumber'])['then'](function(_0x365b83){if(_0x365b83){_0x1fc8a9[_0xec70('0x28')]=_0x365b83['id'];logger[_0xec70('0xf')](_0xec70('0x29'),_0x1fc8a9[_0xec70('0x28')]);return _0x11184(_0x1fc8a9);}searchContact(_0x3842e8,_0x4eb555,_0xec70('0x2a'),_0x1fc8a9[_0xec70('0x26')])[_0xec70('0xc')](function(_0x315b18){if(_0x315b18){_0x1fc8a9[_0xec70('0x28')]=_0x315b18['id'];logger[_0xec70('0xf')](_0xec70('0x2b'),_0x1fc8a9[_0xec70('0x28')]);return _0x11184(_0x1fc8a9);}createEndUser(_0x1fc8a9,_0x4147d5,_0x4eb555,_0x3842e8)[_0xec70('0xc')](function(_0x5d1a82){logger[_0xec70('0xf')](_0xec70('0x2c'),_0x5d1a82[_0xec70('0x28')]);return _0x11184(_0x5d1a82);});});})['catch'](function(_0x2ae702){_0x1edea9(_0x2ae702);});});};}function createEndUser(_0x421655,_0x3c59e6,_0x20d625,_0x4611db){return new Promise(function(_0x3c32c3,_0x3ca9c7){var _0x152be0=moment();var _0x3c9e45={'method':_0xec70('0x2d'),'uri':_0x4611db+_0xec70('0x2e'),'body':{'contact':{'last_name':_0x421655[_0xec70('0x26')],'work_number':_0x421655[_0xec70('0x26')],'mobile_number':_0x421655[_0xec70('0x26')],'owner_id':_0x421655['userId'],'created_at':_0x152be0[_0xec70('0x24')](_0xec70('0x2f'))}},'json':!![]};_0x3c9e45['headers']=_0x20d625;logger[_0xec70('0xf')](_0xec70('0x30'));return rp(_0x3c9e45)['then'](function(_0x89e9e1){_0x421655[_0xec70('0x28')]=_0x89e9e1['contact']['id'];_0x3c32c3(_0x421655);})[_0xec70('0x13')](function(_0x1197fc){logger[_0xec70('0x1f')]('['+[_0x3c59e6[_0xec70('0x14')]()]+']',_0x1197fc[_0xec70('0x15')]);_0x3ca9c7(_0x1197fc[_0xec70('0x15')]);});});}function getTicket(_0x4af532,_0x44f52a,_0x3fc26f,_0x5c3953,_0x4842e2){return function(_0x539450){logger['info'](_0xec70('0x31'));return new Promise(function(_0x8fb5c8,_0x4ef931){var _0x3f3ad2=moment();var _0xfbe9da={'method':_0xec70('0x2d'),'uri':_0x3fc26f+_0xec70('0x32'),'body':{'title':intUtil[_0xec70('0x33')](_0x5c3953[_0xec70('0x34')],_0x4842e2,'\x20'),'description':intUtil[_0xec70('0x33')](_0x5c3953[_0xec70('0x35')],_0x4842e2,'\x0a'),'owner_id':_0x539450[_0xec70('0x1d')],'creater_id':_0x539450[_0xec70('0x11')],'targetable_id':_0x539450[_0xec70('0x28')],'targetable_type':_0xec70('0x36'),'created_at':_0x3f3ad2[_0xec70('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x3f3ad2[_0xec70('0x37')](0x1e,'m')[_0xec70('0x24')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0xfbe9da[_0xec70('0x17')]=_0x44f52a;return rp(_0xfbe9da)[_0xec70('0xc')](function(_0x51d08c){_0x539450[_0xec70('0x38')]=_0x51d08c[_0xec70('0x39')]['id'];logger[_0xec70('0xf')](_0xec70('0x3a'),_0x539450['ticketId']);_0x8fb5c8(_0x539450);})['catch'](function(_0x21f101){logger['error']('['+[_0x4af532[_0xec70('0x14')]()]+']',_0x21f101[_0xec70('0x15')]);_0x4ef931(_0x21f101['message']);});});};}function emit(_0x3867bd,_0x56e29d,_0x137941){var _0x5c2402={'uri':_0x3867bd+_0xec70('0x3b')+_0x137941};io['to'](util[_0xec70('0x24')](_0xec70('0x3c'),_0x56e29d))[_0xec70('0x3d')](_0xec70('0x3e'),_0x5c2402);}exports['cs']=function(_0x219a95,_0xbd5027,_0x5e8434,_0x39cf86,_0x20fd8b,_0x2cbcf6,_0x4c05b1,_0xa900d0){var _0x3f7ab4={};var _0x41f576={'Authorization':_0xec70('0x3f')+_0x2cbcf6[_0xec70('0x40')]};_0x2cbcf6[_0xec70('0x41')]=intUtil[_0xec70('0x42')](_0x2cbcf6[_0xec70('0x41')]);_0x2cbcf6[_0xec70('0x43')]=intUtil[_0xec70('0x42')](_0x2cbcf6[_0xec70('0x43')]);var _0x53b520=_0x2cbcf6[_0xec70('0x41')];_0x3f7ab4[_0xec70('0x1e')]=_0x2cbcf6[_0xec70('0x44')];_0x3f7ab4['contactNumber']=_0xa900d0[_0xec70('0x45')]()===_0xec70('0x46')?_0xbd5027['destcalleridnum']:_0xbd5027['calleridnum'];_0x3f7ab4[_0xec70('0x47')]=_0xa900d0===_0xec70('0x48')||_0xa900d0==='unmanaged'?_0xec70('0x48'):_0xec70('0x46');if(_0x39cf86){_0x3f7ab4[_0xec70('0x1a')]=_0x39cf86[_0xec70('0xe')];}var _0x1be6f9=util[_0xec70('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2cbcf6[_0xec70('0x43')],_0xbd5027[_0xec70('0x49')],md5(_0xbd5027[_0xec70('0x49')]));if(_0x20fd8b&&_0x20fd8b[_0xec70('0x4a')]){logger[_0xec70('0xf')](_0xec70('0x4b'),'Recording\x20is\x20enabled!');_0xbd5027[_0xec70('0x4c')]=_0x1be6f9;}else if(_0x4c05b1&&_0x4c05b1[_0xec70('0x4d')]&&_0x4c05b1[_0xec70('0x4d')]!==_0xec70('0x4e')){logger[_0xec70('0xf')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0xbd5027['recordingURL']=_0x1be6f9;}else{_0xbd5027[_0xec70('0x4c')]='';}return getAdminId(_0x3f7ab4,_0xa900d0,_0x41f576,_0x53b520)['then'](getUser(_0xa900d0,_0x41f576,_0x53b520))['then'](getEndUser(_0xa900d0,_0x41f576,_0x53b520))[_0xec70('0xc')](getTicket(_0xa900d0,_0x41f576,_0x53b520,_0x5e8434,_0xbd5027))[_0xec70('0xc')](function(_0x2acfed){logger[_0xec70('0xf')](util[_0xec70('0x24')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2acfed[_0xec70('0x38')]));if(_0xa900d0!==_0xec70('0x4f')){logger[_0xec70('0xf')]('['+[_0xa900d0[_0xec70('0x14')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x53b520,_0x39cf86[_0xec70('0x50')],_0x2acfed['endUserId']);}})[_0xec70('0x13')](function(_0x195e3d){logger[_0xec70('0x1f')]('['+[_0xa900d0['toUpperCase']()]+_0xec70('0x51'),util['inspect'](_0x195e3d,{'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 17013a7..7e507ee 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 _0x2346=['zoho','vtiger','dynamics365','exec','includes','toLowerCase','data1','data2','find','Configurations','data3','queue','log','EVENT\x20UNKNOWN','unmanaged','desk','freshsales','servicenow','unknown\x20integration','error','[EXEC]','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./zoho','./desk','./vtiger','./freshsales','zendesk','salesforce','sugarcrm','freshdesk'];(function(_0x530ebf,_0x2a3e00){var _0x583336=function(_0x9da827){while(--_0x9da827){_0x530ebf['push'](_0x530ebf['shift']());}};_0x583336(++_0x2a3e00);}(_0x2346,0x16b));var _0x6234=function(_0x270323,_0x72160){_0x270323=_0x270323-0x0;var _0x48a027=_0x2346[_0x270323];return _0x48a027;};'use strict';var _=require('lodash');var util=require(_0x6234('0x0'));var zendesk=require(_0x6234('0x1'));var salesforce=require(_0x6234('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x6234('0x3'));var desk=require(_0x6234('0x4'));var vtiger=require(_0x6234('0x5'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x6234('0x6'));var integrations=[_0x6234('0x7'),_0x6234('0x8'),_0x6234('0x9'),_0x6234('0xa'),_0x6234('0xb'),'desk',_0x6234('0xc'),_0x6234('0xd'),'freshsales','servicenow'];exports[_0x6234('0xe')]=function(_0x5b7114,_0x3ded5c,_0x55c0cd,_0x5dd7ab,_0x1a46e9,_0x5c2368){if(_0x55c0cd){if(_[_0x6234('0xf')](integrations,_0x5b7114['data1'][_0x6234('0x10')]())){try{var _0x130917=null;var _0x4b5d64='';var _0x1a5f19=_0x55c0cd[_0x5b7114[_0x6234('0x11')]['toLowerCase']()];if(_0x1a5f19){var _0x22dc5c=_0x1a5f19[_0x5b7114[_0x6234('0x12')]];if(_0x22dc5c){var _0xe4db13=_[_0x6234('0x13')](_0x22dc5c[_0x6234('0x14')],{'id':parseInt(_0x5b7114[_0x6234('0x15')],0xa)});if(_0xe4db13){if(_0x5dd7ab){if(_0x1a46e9&&_0x3ded5c['queue']){_0x4b5d64=_0x6234('0x16');}else if(_0x3ded5c['routeId']){_0x4b5d64='outbound';}else{console[_0x6234('0x17')](_0x6234('0x18'),_0x3ded5c);}}else{_0x4b5d64=_0x6234('0x19');}switch(_0x5b7114[_0x6234('0x11')][_0x6234('0x10')]()){case _0x6234('0x7'):zendesk[_0x4b5d64](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368);break;case _0x6234('0x8'):salesforce[_0x4b5d64](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368);break;case _0x6234('0x9'):sugarcrm[_0x4b5d64](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368);break;case _0x6234('0xa'):freshdesk[_0x4b5d64](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368);break;case _0x6234('0xb'):zoho[_0x4b5d64](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368);break;case _0x6234('0x1a'):desk[_0x4b5d64](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368);break;case _0x6234('0xc'):vtiger[_0x4b5d64](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368);break;case _0x6234('0x1b'):freshsales['cs'](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368,_0x4b5d64);break;case _0x6234('0x1c'):servicenow['cs'](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368,_0x4b5d64);break;case _0x6234('0xd'):dynamics365['cs'](_0x5b7114,_0x3ded5c,_0xe4db13,_0x5dd7ab,_0x1a46e9,_0x22dc5c,_0x5c2368,_0x4b5d64);break;default:console[_0x6234('0x17')](_0x6234('0x1d'));}}else{_0x130917=require('../../../../config/logger')(_0x5b7114[_0x6234('0x11')][_0x6234('0x10')]());_0x130917[_0x6234('0x1e')](_0x6234('0x1f'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x5b7114['data1'][_0x6234('0x10')](),_0x5b7114[_0x6234('0x15')]));}}else{_0x130917=require(_0x6234('0x20'))(_0x5b7114[_0x6234('0x11')][_0x6234('0x10')]());_0x130917['error'](_0x6234('0x1f'),util['format'](_0x6234('0x21'),_0x5b7114[_0x6234('0x11')]['toLowerCase'](),_0x5b7114['data2']));}}else{}}catch(_0xb0bb6b){console[_0x6234('0x1e')](_0xb0bb6b);}}}}; \ No newline at end of file +var _0x446a=['./freshdesk','./zoho','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm'];(function(_0x277564,_0x2d1bb3){var _0x2b73a3=function(_0x2b65e4){while(--_0x2b65e4){_0x277564['push'](_0x277564['shift']());}};_0x2b73a3(++_0x2d1bb3);}(_0x446a,0xe6));var _0xa446=function(_0x47efc7,_0x5aa103){_0x47efc7=_0x47efc7-0x0;var _0x37678d=_0x446a[_0x47efc7];return _0x37678d;};'use strict';var _=require('lodash');var util=require(_0xa446('0x0'));var zendesk=require(_0xa446('0x1'));var salesforce=require(_0xa446('0x2'));var sugarcrm=require(_0xa446('0x3'));var freshdesk=require(_0xa446('0x4'));var zoho=require(_0xa446('0x5'));var desk=require('./desk');var vtiger=require(_0xa446('0x6'));var servicenow=require(_0xa446('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0xa446('0x8'));var integrations=[_0xa446('0x9'),_0xa446('0xa'),_0xa446('0xb'),'freshdesk',_0xa446('0xc'),_0xa446('0xd'),_0xa446('0xe'),'dynamics365','freshsales',_0xa446('0xf')];exports[_0xa446('0x10')]=function(_0x306619,_0x13eccf,_0x246b29,_0x36bd88,_0x3ee17d,_0x2d6262){if(_0x246b29){if(_['includes'](integrations,_0x306619[_0xa446('0x11')][_0xa446('0x12')]())){try{var _0x50e496=null;var _0x226915='';var _0x4c38a2=_0x246b29[_0x306619[_0xa446('0x11')][_0xa446('0x12')]()];if(_0x4c38a2){var _0x3bd331=_0x4c38a2[_0x306619[_0xa446('0x13')]];if(_0x3bd331){var _0x35f138=_[_0xa446('0x14')](_0x3bd331[_0xa446('0x15')],{'id':parseInt(_0x306619[_0xa446('0x16')],0xa)});if(_0x35f138){if(_0x36bd88){if(_0x3ee17d&&_0x13eccf[_0xa446('0x17')]){_0x226915=_0xa446('0x17');}else if(_0x13eccf[_0xa446('0x18')]){_0x226915=_0xa446('0x19');}else{console[_0xa446('0x1a')](_0xa446('0x1b'),_0x13eccf);}}else{_0x226915=_0xa446('0x1c');}switch(_0x306619[_0xa446('0x11')][_0xa446('0x12')]()){case _0xa446('0x9'):zendesk[_0x226915](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262);break;case _0xa446('0xa'):salesforce[_0x226915](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262);break;case _0xa446('0xb'):sugarcrm[_0x226915](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262);break;case _0xa446('0x1d'):freshdesk[_0x226915](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262);break;case _0xa446('0xc'):zoho[_0x226915](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262);break;case _0xa446('0xd'):desk[_0x226915](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262);break;case _0xa446('0xe'):vtiger[_0x226915](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262);break;case _0xa446('0x1e'):freshsales['cs'](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262,_0x226915);break;case'servicenow':servicenow['cs'](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262,_0x226915);break;case _0xa446('0x1f'):dynamics365['cs'](_0x306619,_0x13eccf,_0x35f138,_0x36bd88,_0x3ee17d,_0x3bd331,_0x2d6262,_0x226915);break;default:console[_0xa446('0x1a')](_0xa446('0x20'));}}else{_0x50e496=require(_0xa446('0x21'))(_0x306619['data1'][_0xa446('0x12')]());_0x50e496[_0xa446('0x22')]('[EXEC]',util[_0xa446('0x23')](_0xa446('0x24'),_0x306619[_0xa446('0x11')][_0xa446('0x12')](),_0x306619[_0xa446('0x16')]));}}else{_0x50e496=require('../../../../config/logger')(_0x306619[_0xa446('0x11')]['toLowerCase']());_0x50e496[_0xa446('0x22')](_0xa446('0x25'),util['format'](_0xa446('0x26'),_0x306619[_0xa446('0x11')][_0xa446('0x12')](),_0x306619[_0xa446('0x13')]));}}else{}}catch(_0xad7c72){console['error'](_0xad7c72);}}}}; \ 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 d43dd0e..a4bca01 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 _0x87f2=['lead','WhoId','account','WhatId','Case','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','find','then','length','Email','Agent\x20%s\x20found.','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','execute','additionalSearchLead','sobject','Lead','additionalSearchAccount','Account','Contact','first','Phone','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','LastName','format','Company','No\x20Company','Caller\x20-\x20%s','upperFirst','forEach','includes','string','picklist','idField','variable','variableName','customVariable','Variable','name','toLowerCase','toString','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','salesforce','redis','localhost','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact'];(function(_0x5cf5ef,_0x2d1f7e){var _0x2de282=function(_0x962dff){while(--_0x962dff){_0x5cf5ef['push'](_0x5cf5ef['shift']());}};_0x2de282(++_0x2d1f7e);}(_0x87f2,0x69));var _0x287f=function(_0x4ccfe8,_0x4581c8){_0x4ccfe8=_0x4ccfe8-0x0;var _0x2f7065=_0x87f2[_0x4ccfe8];return _0x2f7065;};'use strict';var _=require(_0x287f('0x0'));var rp=require(_0x287f('0x1'));var moment=require(_0x287f('0x2'));var BPromise=require(_0x287f('0x3'));var md5=require(_0x287f('0x4'));var jsforce=require(_0x287f('0x5'));var util=require(_0x287f('0x6'));var Redis=require('ioredis');var intUtil=require(_0x287f('0x7'));var config=require(_0x287f('0x8'));var logger=require('../../../../config/logger')(_0x287f('0x9'));config[_0x287f('0xa')]=_['defaults'](config[_0x287f('0xa')],{'host':_0x287f('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x287f('0xa')]));function emit(_0x2713cb,_0x1be7e8,_0x1c263e){io['to'](_0x2713cb)['emit'](_0x1be7e8,_0x1c263e);}function getTicket(_0x7278a3,_0x3765f6,_0x23c925,_0x188ff7,_0x2b9d05,_0x9df843,_0x5ca43a,_0x30e353){var _0x55bde1=Object['assign']({},{'OwnerId':_0x3765f6['id'],'Subject':intUtil[_0x287f('0xc')](_0x188ff7[_0x287f('0xd')],_0x2b9d05,'\x20'),'Description':intUtil[_0x287f('0xc')](_0x188ff7[_0x287f('0xe')],_0x2b9d05,'\x0a')},getCustomFields(_0x9df843,_0x2b9d05));if(_0x23c925){if(_0x188ff7[_0x287f('0xf')]===_0x287f('0x10')){_0x55bde1[_0x287f('0x11')]=moment['utc']();_0x55bde1[_0x287f('0x12')]=![];_0x55bde1[_0x287f('0x13')]=![];if(_0x23c925[_0x287f('0x14')]===_0x287f('0x15')||_0x23c925['endUserType']===_0x287f('0x16')){_0x55bde1[_0x287f('0x17')]=_0x23c925['id'];}else if(_0x23c925[_0x287f('0x14')]===_0x287f('0x18')){_0x55bde1[_0x287f('0x19')]=_0x23c925['id'];}}else if(_0x188ff7['ticketType']===_0x287f('0x1a')){if(_0x23c925[_0x287f('0x14')]==='contact'){_0x55bde1['ContactId']=_0x23c925['id'];}else if(_0x23c925[_0x287f('0x14')]===_0x287f('0x18')){_0x55bde1[_0x287f('0x1b')]=_0x23c925['id'];}else if(_0x23c925['endUserType']===_0x287f('0x16')&&_0x188ff7[_0x287f('0x1c')]){_0x55bde1[_0x188ff7['leadId']]=_0x23c925['id'];}else{logger['info'](_0x287f('0x1d'));}}}return _0x5ca43a['sobject'](_0x188ff7[_0x287f('0xf')])[_0x287f('0x1e')](_0x55bde1);}function getUser(_0x4fc589,_0x30b39c,_0x308027){if(!_[_0x287f('0x1f')](_0x30b39c)&&intUtil['validateEmail'](_0x30b39c)){var _0x3dba4f={'Email':_0x30b39c};var _0x15f660={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x308027['sobject']('User')[_0x287f('0x20')](_0x3dba4f,_0x15f660)['execute']()[_0x287f('0x21')](function(_0x59a9cd){if(_0x59a9cd[_0x287f('0x22')]){var _0x39b757=_['find'](_0x59a9cd,function(_0x4a15dd){return _0x4a15dd[_0x287f('0x23')]===_0x30b39c;});if(_0x39b757){logger['info'](_0x287f('0x24'),_0x30b39c);return BPromise[_0x287f('0x25')]({'id':_0x39b757['Id'],'name':_0x39b757[_0x287f('0x26')]});}}else{logger[_0x287f('0x27')](_0x287f('0x28'),_0x30b39c);return _0x308027[_0x287f('0x29')]()[_0x287f('0x21')](function(_0x1c187f){return BPromise[_0x287f('0x25')]({'id':_0x1c187f[_0x287f('0x2a')],'name':_0x1c187f[_0x287f('0x2b')]});});}});}else{logger[_0x287f('0x27')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x30b39c);return _0x308027[_0x287f('0x29')]()[_0x287f('0x21')](function(_0x53ffd4){return BPromise['resolve']({'id':_0x53ffd4[_0x287f('0x2a')],'name':_0x53ffd4['display_name']});});}}function getEndUser(_0x35c9f5,_0x24b68e,_0x12d86c,_0x2c17e5,_0x1bc2a9){var _0x16a7cf={'$or':{'Phone':_0x2c17e5}};var _0x410460={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x287f('0x25')]()[_0x287f('0x21')](function(){logger[_0x287f('0x27')](_0x287f('0x2c'),_0x2c17e5,_0x24b68e[_0x287f('0x2d')]);switch(_0x24b68e[_0x287f('0x2d')]){case'contact_lead':var _0xd0141=_[_0x287f('0x2e')](_0x16a7cf);if(_0x24b68e[_0x287f('0x2f')]){var _0x3b6db9={};_0x3b6db9[_0x24b68e['additionalSearchContact']]=_0x2c17e5;_[_0x287f('0x30')](_0xd0141[_0x287f('0x31')],_0x3b6db9);}return _0x1bc2a9['sobject']('Contact')[_0x287f('0x20')](_0xd0141,_0x410460)[_0x287f('0x32')]()[_0x287f('0x21')](function(_0x534b39){if(_0x534b39&&_0x534b39[_0x287f('0x22')]){return _0x534b39;}else{var _0xcb71ec=_[_0x287f('0x2e')](_0x16a7cf);if(_0x24b68e[_0x287f('0x33')]){var _0x3eb974={};_0x3eb974[_0x24b68e[_0x287f('0x33')]]=_0x2c17e5;_['merge'](_0xcb71ec[_0x287f('0x31')],_0x3eb974);}return _0x1bc2a9[_0x287f('0x34')](_0x287f('0x35'))[_0x287f('0x20')](_0xcb71ec,_0x410460);}});case'account_contact_lead':var _0x4bd52=_[_0x287f('0x2e')](_0x16a7cf);if(_0x24b68e[_0x287f('0x36')]){var _0x3b6db9={};_0x3b6db9[_0x24b68e[_0x287f('0x36')]]=_0x2c17e5;_[_0x287f('0x30')](_0x4bd52['$or'],_0x3b6db9);}return _0x1bc2a9[_0x287f('0x34')](_0x287f('0x37'))[_0x287f('0x20')](_0x4bd52,_0x410460)[_0x287f('0x32')]()[_0x287f('0x21')](function(_0x21422f){if(_0x21422f&&_0x21422f[_0x287f('0x22')]){return _0x21422f;}else{var _0x256321=_['cloneDeep'](_0x16a7cf);if(_0x24b68e['additionalSearchContact']){var _0x5c5bc7={};_0x5c5bc7[_0x24b68e[_0x287f('0x2f')]]=_0x2c17e5;_[_0x287f('0x30')](_0x256321[_0x287f('0x31')],_0x5c5bc7);}return _0x1bc2a9[_0x287f('0x34')](_0x287f('0x38'))['find'](_0x256321,_0x410460)[_0x287f('0x21')](function(_0x1451da){if(_0x1451da&&_0x1451da['length']){return _0x1451da;}else{var _0x1debe6=_[_0x287f('0x2e')](_0x16a7cf);if(_0x24b68e[_0x287f('0x33')]){var _0x17cb8c={};_0x17cb8c[_0x24b68e[_0x287f('0x33')]]=_0x2c17e5;_[_0x287f('0x30')](_0x1debe6['$or'],_0x17cb8c);}return _0x1bc2a9['sobject'](_0x287f('0x35'))[_0x287f('0x20')](_0x1debe6,_0x410460);}});}});case'contact':var _0xd0141=_['cloneDeep'](_0x16a7cf);if(_0x24b68e[_0x287f('0x2f')]){var _0x3b6db9={};_0x3b6db9[_0x24b68e[_0x287f('0x2f')]]=_0x2c17e5;_[_0x287f('0x30')](_0xd0141['$or'],_0x3b6db9);}return _0x1bc2a9[_0x287f('0x34')](_0x287f('0x38'))[_0x287f('0x20')](_0xd0141,_0x410460)[_0x287f('0x32')]();case'lead':var _0x4e0879=_['cloneDeep'](_0x16a7cf);if(_0x24b68e[_0x287f('0x33')]){var _0x3b6db9={};_0x3b6db9[_0x24b68e[_0x287f('0x33')]]=_0x2c17e5;_[_0x287f('0x30')](_0x4e0879['$or'],_0x3b6db9);}return _0x1bc2a9[_0x287f('0x34')](_0x287f('0x35'))[_0x287f('0x20')](_0x4e0879,_0x410460);case _0x287f('0x18'):var _0x4bd52=_[_0x287f('0x2e')](_0x16a7cf);if(_0x24b68e[_0x287f('0x36')]){var _0x3b6db9={};_0x3b6db9[_0x24b68e[_0x287f('0x36')]]=_0x2c17e5;_[_0x287f('0x30')](_0x4bd52[_0x287f('0x31')],_0x3b6db9);}return _0x1bc2a9['sobject'](_0x287f('0x37'))[_0x287f('0x20')](_0x4bd52,_0x410460);default:return null;}})[_0x287f('0x21')](function(_0x319c28){if(_0x319c28&&_0x319c28[_0x287f('0x22')]){var _0x47ebc6=_[_0x287f('0x39')](_0x319c28);if(_0x47ebc6){return BPromise[_0x287f('0x25')]({'id':_0x47ebc6['Id'],'name':_0x47ebc6[_0x287f('0x26')],'phone':_0x47ebc6[_0x287f('0x3a')],'endUserType':_0x47ebc6['attributes'][_0x287f('0x3b')]['toLowerCase']()});}}})[_0x287f('0x21')](function(_0x581b90){if(_0x581b90){logger['info'](_0x287f('0x3c'),_0x581b90[_0x287f('0x14')],_0x2c17e5);return BPromise[_0x287f('0x25')](_0x581b90);}else{logger[_0x287f('0x27')](_0x287f('0x3d'),_0x2c17e5);var _0x1e93ab={'Phone':_0x2c17e5};if(_0x24b68e[_0x287f('0x3e')]){if(_0x24b68e[_0x287f('0x3e')]===_0x287f('0x15')){logger[_0x287f('0x27')](_0x287f('0x3f'),_0x2c17e5,_0x24b68e['moduleCreate']);_0x1e93ab['LastName']=_0x12d86c!==_0x287f('0x40')?_0x12d86c:util['format']('Caller\x20-\x20%s',_0x2c17e5);}else if(_0x24b68e['moduleCreate']==='lead'){logger[_0x287f('0x27')](_0x287f('0x3f'),_0x2c17e5,_0x24b68e[_0x287f('0x3e')]);_0x1e93ab[_0x287f('0x41')]=_0x12d86c!==''?_0x12d86c:util[_0x287f('0x42')]('Caller\x20-\x20%s',_0x2c17e5);_0x1e93ab[_0x287f('0x43')]=_0x287f('0x44');}else if(_0x24b68e['moduleCreate']==='account'){logger['info'](_0x287f('0x3f'),_0x2c17e5,_0x24b68e[_0x287f('0x3e')]);_0x1e93ab[_0x287f('0x26')]=_0x12d86c!==_0x287f('0x40')?_0x12d86c:util['format'](_0x287f('0x45'),_0x2c17e5);}else{return null;}}return _0x1bc2a9[_0x287f('0x34')](_[_0x287f('0x46')](_0x24b68e[_0x287f('0x3e')]))[_0x287f('0x1e')](_0x1e93ab)[_0x287f('0x21')](function(_0x1ebb64){return BPromise[_0x287f('0x25')]({'id':_0x1ebb64['id'],'endUserType':_0x24b68e['moduleCreate']});});}});}function getCustomFields(_0x4c3111,_0x38b975){var _0x4ca4d0={};if(_0x4c3111['length']>0x0){_[_0x287f('0x47')](_0x4c3111,function(_0x2395fb){if(_[_0x287f('0x48')]([_0x287f('0x49'),_0x287f('0x4a')],_0x2395fb['type'])&&_0x2395fb[_0x287f('0x4b')]){_0x4ca4d0[_0x2395fb[_0x287f('0x4b')]]=_0x2395fb['content']['toString']();}else if(_0x2395fb[_0x287f('0x3b')]===_0x287f('0x4c')&&_0x2395fb[_0x287f('0x4d')]&&_0x2395fb[_0x287f('0x4b')]){_0x38b975[_0x2395fb[_0x287f('0x4d')]]&&(_0x4ca4d0[_0x2395fb['idField']]=_0x38b975[_0x2395fb[_0x287f('0x4d')]]['toString']());}else if(_0x2395fb[_0x287f('0x3b')]===_0x287f('0x4e')&&_0x2395fb[_0x287f('0x4f')]&&_0x2395fb[_0x287f('0x4f')]['name']&&_0x2395fb[_0x287f('0x4b')]){_0x38b975[_0x2395fb[_0x287f('0x4f')][_0x287f('0x50')][_0x287f('0x51')]()]&&(_0x4ca4d0[_0x2395fb[_0x287f('0x4b')]]=_0x38b975[_0x2395fb['Variable'][_0x287f('0x50')][_0x287f('0x51')]()][_0x287f('0x52')]());}});}return _0x4ca4d0;}function getConnection(_0x490d93){var _0x1906c1=_0x490d93['password'][_0x287f('0x53')](_0x490d93[_0x287f('0x54')]);var _0x5816f9=new jsforce['Connection']({'oauth2':{'loginUrl':_0x490d93[_0x287f('0x55')]||_0x287f('0x56'),'clientId':_0x490d93[_0x287f('0x57')],'clientSecret':_0x490d93[_0x287f('0x58')]}});return _0x5816f9[_0x287f('0x59')](_0x490d93[_0x287f('0x5a')],_0x1906c1)['then'](function(){logger['info'](_0x287f('0x5b'));return _0x5816f9;});}exports[_0x287f('0x5c')]=function(_0x5106b2,_0x2bac10,_0x381f09,_0x1c84e0,_0x2995bd,_0x3fc608){var _0x182e8b,_0x35eac0,_0x9f323f,_0x5b0ce5;_0x3fc608[_0x287f('0x5d')]=intUtil[_0x287f('0x5e')](_0x3fc608[_0x287f('0x5d')]);_0x3fc608[_0x287f('0x55')]=intUtil[_0x287f('0x5e')](_0x3fc608[_0x287f('0x55')]);if(_0x2995bd&&_0x2995bd[_0x287f('0x5f')]){logger[_0x287f('0x27')](_0x287f('0x60'),_0x287f('0x61'));_0x2bac10['recordingURL']=util[_0x287f('0x42')](_0x287f('0x62'),_0x3fc608['serverUrl'],_0x2bac10[_0x287f('0x63')],md5(_0x2bac10[_0x287f('0x63')]));}else{_0x2bac10['recordingURL']='';}return getConnection(_0x3fc608)['then'](function(_0x45b86f){_0x5b0ce5=_0x45b86f;return getUser(_0x3fc608,_0x1c84e0['email'],_0x5b0ce5);})[_0x287f('0x21')](function(_0x22181e){_0x182e8b=_0x22181e;return getEndUser(_0x3fc608,_0x381f09,_0x2bac10[_0x287f('0x64')],_0x2bac10['calleridnum'],_0x5b0ce5);})[_0x287f('0x21')](function(_0x236420){_0x35eac0=_0x236420;return getTicket(_0x3fc608,_0x182e8b,_0x35eac0,_0x381f09,_0x2bac10,_0x381f09[_0x287f('0x65')],_0x5b0ce5,'queue');})[_0x287f('0x21')](function(_0x51ab6d){_0x9f323f=_0x51ab6d;logger[_0x287f('0x27')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x9f323f['id']);logger[_0x287f('0x27')](_0x287f('0x66'),_0x9f323f['id'],_0x1c84e0[_0x287f('0x50')],_0x3fc608[_0x287f('0x3b')]);switch(_0x3fc608['type']){case _0x287f('0x67'):emit(util[_0x287f('0x42')]('user:%s',_0x1c84e0[_0x287f('0x50')]),_0x287f('0x68'),{'recordId':_0x9f323f['id']});break;case _0x287f('0x69'):emit(util[_0x287f('0x42')](_0x287f('0x6a'),_0x1c84e0[_0x287f('0x50')]),_0x287f('0x6b'),{'uri':util[_0x287f('0x42')]('%s/%s/e',_0x5b0ce5[_0x287f('0x6c')],_0x9f323f['id'])});break;default:logger[_0x287f('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x287f('0x6e')](function(_0x3f0624){logger[_0x287f('0x6d')]('[QUEUE]',_0x3f0624);});};exports[_0x287f('0x6f')]=function(_0x14643e,_0x12f82f,_0x1eb321,_0x5103b3,_0x57d06d,_0x2958e2,_0x503fc1){var _0x41896b,_0x250b98,_0x210384,_0x384b3d;_0x2958e2[_0x287f('0x5d')]=intUtil[_0x287f('0x5e')](_0x2958e2[_0x287f('0x5d')]);_0x2958e2['remoteUri']=intUtil[_0x287f('0x5e')](_0x2958e2[_0x287f('0x55')]);if(_0x503fc1&&_0x503fc1[_0x287f('0x70')]&&_0x503fc1[_0x287f('0x70')]!==_0x287f('0x71')){logger[_0x287f('0x27')](_0x287f('0x72'),_0x287f('0x61'));_0x12f82f[_0x287f('0x73')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2958e2[_0x287f('0x5d')],_0x12f82f[_0x287f('0x63')],md5(_0x12f82f[_0x287f('0x63')]));}return getConnection(_0x2958e2)[_0x287f('0x21')](function(_0x5c24cc){_0x384b3d=_0x5c24cc;return getUser(_0x2958e2,_0x5103b3[_0x287f('0x74')],_0x384b3d);})[_0x287f('0x21')](function(_0x413747){_0x41896b=_0x413747;return getEndUser(_0x2958e2,_0x1eb321,_0x12f82f[_0x287f('0x75')],_0x12f82f[_0x287f('0x76')],_0x384b3d);})['then'](function(_0x39f520){_0x250b98=_0x39f520;return getTicket(_0x2958e2,_0x41896b,_0x250b98,_0x1eb321,_0x12f82f,_0x1eb321[_0x287f('0x65')],_0x384b3d,_0x287f('0x6f'));})[_0x287f('0x21')](function(_0xc199c3){_0x210384=_0xc199c3;logger[_0x287f('0x27')](_0x287f('0x77'),_0x210384['id']);logger[_0x287f('0x27')](_0x287f('0x78'),_0x210384['id'],_0x5103b3['name'],_0x2958e2['type']);switch(_0x2958e2[_0x287f('0x3b')]){case _0x287f('0x67'):emit(util[_0x287f('0x42')](_0x287f('0x6a'),_0x5103b3['name']),_0x287f('0x68'),{'recordId':_0x210384['id']});break;case'newTab':emit(util[_0x287f('0x42')](_0x287f('0x6a'),_0x5103b3[_0x287f('0x50')]),_0x287f('0x6b'),{'uri':util[_0x287f('0x42')](_0x287f('0x79'),_0x384b3d['instanceUrl'],_0x210384['id'])});break;default:logger[_0x287f('0x6d')]('[OUTBOUND]',_0x287f('0x7a'));}})['catch'](function(_0x1584b4){logger[_0x287f('0x6d')](_0x287f('0x72'),_0x1584b4);});};exports['unmanaged']=function(_0x56756a,_0x40c9ce,_0x409da6,_0x47c918,_0x59b48d,_0x12267c){var _0x503399,_0x507e70,_0x4f190f,_0x5ddeb2;_0x12267c[_0x287f('0x5d')]=intUtil['stripTrailingSlash'](_0x12267c[_0x287f('0x5d')]);_0x12267c[_0x287f('0x55')]=intUtil[_0x287f('0x5e')](_0x12267c['remoteUri']);if(_0x59b48d&&_0x59b48d['monitor_format']){logger[_0x287f('0x27')]('['+_0x40c9ce[_0x287f('0x7b')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x40c9ce['recordingURL']=util[_0x287f('0x42')](_0x287f('0x62'),_0x12267c[_0x287f('0x5d')],_0x40c9ce[_0x287f('0x63')],md5(_0x40c9ce[_0x287f('0x63')]));}else{_0x40c9ce[_0x287f('0x73')]='';}return getConnection(_0x12267c)['then'](function(_0x38a8df){_0x5ddeb2=_0x38a8df;if(!_[_0x287f('0x1f')](_0x47c918)){return getUser(_0x12267c,_0x47c918[_0x287f('0x50')],_0x5ddeb2);}else{return getUser(_0x12267c,null,_0x5ddeb2);}})[_0x287f('0x21')](function(_0x5b8109){_0x503399=_0x5b8109;return getEndUser(_0x12267c,_0x409da6,_0x40c9ce['calleridname'],_0x40c9ce['calleridnum'],_0x5ddeb2);})[_0x287f('0x21')](function(_0x169cb9){_0x507e70=_0x169cb9;return getTicket(_0x12267c,_0x503399,_0x507e70,_0x409da6,_0x40c9ce,_0x409da6[_0x287f('0x65')],_0x5ddeb2);})[_0x287f('0x21')](function(_0x24137c){_0x4f190f=_0x24137c;logger[_0x287f('0x27')]('['+_0x40c9ce[_0x287f('0x7b')][_0x287f('0x7c')]()+_0x287f('0x7d'),_0x4f190f['id']);logger[_0x287f('0x27')]('['+_0x40c9ce[_0x287f('0x7b')]['toUpperCase']()+_0x287f('0x7e'),_0x12267c['type']);})['catch'](function(_0x403879){logger['error']('['+_0x40c9ce[_0x287f('0x7b')][_0x287f('0x7c')]()+']',_0x403879);});}; \ No newline at end of file +var _0xffaa=['clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','catch','error','outbound','recordingFormat','[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','Salesforce\x20account\x20type\x20not\x20recognized','calleridname','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','defaults','localhost','socket.io-emitter','redis','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','endUserType','lead','WhoId','account','WhatId','Case','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','validateEmail','sobject','User','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','length','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Company','No\x20Company','forEach','string','idField','content','toString','type','variableName','Variable','name','password','concat','https://login.salesforce.com'];(function(_0x5433b2,_0x4f3139){var _0x533448=function(_0x58c6e5){while(--_0x58c6e5){_0x5433b2['push'](_0x5433b2['shift']());}};_0x533448(++_0x4f3139);}(_0xffaa,0xaa));var _0xaffa=function(_0x2f33f7,_0x158200){_0x2f33f7=_0x2f33f7-0x0;var _0x185c5f=_0xffaa[_0x2f33f7];return _0x185c5f;};'use strict';var _=require(_0xaffa('0x0'));var rp=require(_0xaffa('0x1'));var moment=require(_0xaffa('0x2'));var BPromise=require('bluebird');var md5=require(_0xaffa('0x3'));var jsforce=require(_0xaffa('0x4'));var util=require(_0xaffa('0x5'));var Redis=require(_0xaffa('0x6'));var intUtil=require(_0xaffa('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('salesforce');config['redis']=_[_0xaffa('0x8')](config['redis'],{'host':_0xaffa('0x9'),'port':0x18eb});var io=require(_0xaffa('0xa'))(new Redis(config[_0xaffa('0xb')]));function emit(_0x45b551,_0x3d2a19,_0x49ee15){io['to'](_0x45b551)['emit'](_0x3d2a19,_0x49ee15);}function getTicket(_0x14dcc4,_0x309bbc,_0x500fb1,_0x46f93f,_0x2b9620,_0x747d86,_0x26984f,_0x57468e){var _0x4ad460=Object[_0xaffa('0xc')]({},{'OwnerId':_0x309bbc['id'],'Subject':intUtil['getString'](_0x46f93f[_0xaffa('0xd')],_0x2b9620,'\x20'),'Description':intUtil[_0xaffa('0xe')](_0x46f93f[_0xaffa('0xf')],_0x2b9620,'\x0a')},getCustomFields(_0x747d86,_0x2b9620));if(_0x500fb1){if(_0x46f93f[_0xaffa('0x10')]===_0xaffa('0x11')){_0x4ad460[_0xaffa('0x12')]=moment[_0xaffa('0x13')]();_0x4ad460[_0xaffa('0x14')]=![];_0x4ad460[_0xaffa('0x15')]=![];if(_0x500fb1['endUserType']===_0xaffa('0x16')||_0x500fb1[_0xaffa('0x17')]===_0xaffa('0x18')){_0x4ad460[_0xaffa('0x19')]=_0x500fb1['id'];}else if(_0x500fb1[_0xaffa('0x17')]===_0xaffa('0x1a')){_0x4ad460[_0xaffa('0x1b')]=_0x500fb1['id'];}}else if(_0x46f93f[_0xaffa('0x10')]===_0xaffa('0x1c')){if(_0x500fb1[_0xaffa('0x17')]===_0xaffa('0x16')){_0x4ad460['ContactId']=_0x500fb1['id'];}else if(_0x500fb1[_0xaffa('0x17')]===_0xaffa('0x1a')){_0x4ad460[_0xaffa('0x1d')]=_0x500fb1['id'];}else if(_0x500fb1[_0xaffa('0x17')]==='lead'&&_0x46f93f[_0xaffa('0x1e')]){_0x4ad460[_0x46f93f['leadId']]=_0x500fb1['id'];}else{logger['info'](_0xaffa('0x1f'));}}}return _0x26984f['sobject'](_0x46f93f[_0xaffa('0x10')])[_0xaffa('0x20')](_0x4ad460);}function getUser(_0xe2d9a2,_0x276137,_0x3b6566){if(!_['isNil'](_0x276137)&&intUtil[_0xaffa('0x21')](_0x276137)){var _0x91e7ab={'Email':_0x276137};var _0x242b05={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3b6566[_0xaffa('0x22')](_0xaffa('0x23'))[_0xaffa('0x24')](_0x91e7ab,_0x242b05)[_0xaffa('0x25')]()[_0xaffa('0x26')](function(_0x4c8fa9){if(_0x4c8fa9['length']){var _0x547cbb=_['find'](_0x4c8fa9,function(_0x14cd8b){return _0x14cd8b[_0xaffa('0x27')]===_0x276137;});if(_0x547cbb){logger['info'](_0xaffa('0x28'),_0x276137);return BPromise[_0xaffa('0x29')]({'id':_0x547cbb['Id'],'name':_0x547cbb[_0xaffa('0x2a')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x276137);return _0x3b6566[_0xaffa('0x2b')]()['then'](function(_0x348705){return BPromise[_0xaffa('0x29')]({'id':_0x348705[_0xaffa('0x2c')],'name':_0x348705[_0xaffa('0x2d')]});});}});}else{logger[_0xaffa('0x2e')](_0xaffa('0x2f'),_0x276137);return _0x3b6566['identity']()[_0xaffa('0x26')](function(_0x56c784){return BPromise[_0xaffa('0x29')]({'id':_0x56c784[_0xaffa('0x2c')],'name':_0x56c784[_0xaffa('0x2d')]});});}}function getEndUser(_0x29fd9c,_0x45fd64,_0x3faa80,_0x529f9b,_0x3ac015){var _0x1701bb={'$or':{'Phone':_0x529f9b}};var _0x408bae={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xaffa('0x29')]()[_0xaffa('0x26')](function(){logger['info'](_0xaffa('0x30'),_0x529f9b,_0x45fd64[_0xaffa('0x31')]);switch(_0x45fd64[_0xaffa('0x31')]){case _0xaffa('0x32'):var _0xbe3eac=_['cloneDeep'](_0x1701bb);if(_0x45fd64['additionalSearchContact']){var _0x1212e0={};_0x1212e0[_0x45fd64[_0xaffa('0x33')]]=_0x529f9b;_[_0xaffa('0x34')](_0xbe3eac[_0xaffa('0x35')],_0x1212e0);}return _0x3ac015['sobject'](_0xaffa('0x36'))[_0xaffa('0x24')](_0xbe3eac,_0x408bae)[_0xaffa('0x25')]()['then'](function(_0x1a5b65){if(_0x1a5b65&&_0x1a5b65[_0xaffa('0x37')]){return _0x1a5b65;}else{var _0x3a06fb=_[_0xaffa('0x38')](_0x1701bb);if(_0x45fd64['additionalSearchLead']){var _0x373e1d={};_0x373e1d[_0x45fd64[_0xaffa('0x39')]]=_0x529f9b;_[_0xaffa('0x34')](_0x3a06fb[_0xaffa('0x35')],_0x373e1d);}return _0x3ac015[_0xaffa('0x22')](_0xaffa('0x3a'))['find'](_0x3a06fb,_0x408bae);}});case _0xaffa('0x3b'):var _0x98ad8=_['cloneDeep'](_0x1701bb);if(_0x45fd64['additionalSearchAccount']){var _0x1212e0={};_0x1212e0[_0x45fd64[_0xaffa('0x3c')]]=_0x529f9b;_[_0xaffa('0x34')](_0x98ad8['$or'],_0x1212e0);}return _0x3ac015[_0xaffa('0x22')](_0xaffa('0x3d'))['find'](_0x98ad8,_0x408bae)[_0xaffa('0x25')]()['then'](function(_0x1d0230){if(_0x1d0230&&_0x1d0230[_0xaffa('0x37')]){return _0x1d0230;}else{var _0x3e109a=_['cloneDeep'](_0x1701bb);if(_0x45fd64[_0xaffa('0x33')]){var _0x51a62f={};_0x51a62f[_0x45fd64[_0xaffa('0x33')]]=_0x529f9b;_['merge'](_0x3e109a[_0xaffa('0x35')],_0x51a62f);}return _0x3ac015[_0xaffa('0x22')]('Contact')[_0xaffa('0x24')](_0x3e109a,_0x408bae)['then'](function(_0x1d9387){if(_0x1d9387&&_0x1d9387['length']){return _0x1d9387;}else{var _0x4152f6=_['cloneDeep'](_0x1701bb);if(_0x45fd64[_0xaffa('0x39')]){var _0x3f411d={};_0x3f411d[_0x45fd64[_0xaffa('0x39')]]=_0x529f9b;_[_0xaffa('0x34')](_0x4152f6[_0xaffa('0x35')],_0x3f411d);}return _0x3ac015['sobject'](_0xaffa('0x3a'))[_0xaffa('0x24')](_0x4152f6,_0x408bae);}});}});case _0xaffa('0x16'):var _0xbe3eac=_[_0xaffa('0x38')](_0x1701bb);if(_0x45fd64['additionalSearchContact']){var _0x1212e0={};_0x1212e0[_0x45fd64['additionalSearchContact']]=_0x529f9b;_[_0xaffa('0x34')](_0xbe3eac[_0xaffa('0x35')],_0x1212e0);}return _0x3ac015[_0xaffa('0x22')]('Contact')[_0xaffa('0x24')](_0xbe3eac,_0x408bae)[_0xaffa('0x25')]();case _0xaffa('0x18'):var _0x454e1c=_[_0xaffa('0x38')](_0x1701bb);if(_0x45fd64[_0xaffa('0x39')]){var _0x1212e0={};_0x1212e0[_0x45fd64[_0xaffa('0x39')]]=_0x529f9b;_[_0xaffa('0x34')](_0x454e1c[_0xaffa('0x35')],_0x1212e0);}return _0x3ac015[_0xaffa('0x22')](_0xaffa('0x3a'))[_0xaffa('0x24')](_0x454e1c,_0x408bae);case _0xaffa('0x1a'):var _0x98ad8=_[_0xaffa('0x38')](_0x1701bb);if(_0x45fd64['additionalSearchAccount']){var _0x1212e0={};_0x1212e0[_0x45fd64[_0xaffa('0x3c')]]=_0x529f9b;_[_0xaffa('0x34')](_0x98ad8[_0xaffa('0x35')],_0x1212e0);}return _0x3ac015[_0xaffa('0x22')]('Account')[_0xaffa('0x24')](_0x98ad8,_0x408bae);default:return null;}})[_0xaffa('0x26')](function(_0x32af61){if(_0x32af61&&_0x32af61['length']){var _0x2d11c9=_['first'](_0x32af61);if(_0x2d11c9){return BPromise[_0xaffa('0x29')]({'id':_0x2d11c9['Id'],'name':_0x2d11c9[_0xaffa('0x2a')],'phone':_0x2d11c9[_0xaffa('0x3e')],'endUserType':_0x2d11c9[_0xaffa('0x3f')]['type'][_0xaffa('0x40')]()});}}})['then'](function(_0x2d5c1a){if(_0x2d5c1a){logger[_0xaffa('0x2e')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x2d5c1a[_0xaffa('0x17')],_0x529f9b);return BPromise[_0xaffa('0x29')](_0x2d5c1a);}else{logger[_0xaffa('0x2e')](_0xaffa('0x41'),_0x529f9b);var _0x39fb32={'Phone':_0x529f9b};if(_0x45fd64[_0xaffa('0x42')]){if(_0x45fd64[_0xaffa('0x42')]==='contact'){logger[_0xaffa('0x2e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x529f9b,_0x45fd64[_0xaffa('0x42')]);_0x39fb32[_0xaffa('0x43')]=_0x3faa80!==''?_0x3faa80:util[_0xaffa('0x44')](_0xaffa('0x45'),_0x529f9b);}else if(_0x45fd64[_0xaffa('0x42')]===_0xaffa('0x18')){logger[_0xaffa('0x2e')](_0xaffa('0x46'),_0x529f9b,_0x45fd64[_0xaffa('0x42')]);_0x39fb32[_0xaffa('0x43')]=_0x3faa80!==_0xaffa('0x47')?_0x3faa80:util[_0xaffa('0x44')]('Caller\x20-\x20%s',_0x529f9b);_0x39fb32[_0xaffa('0x48')]=_0xaffa('0x49');}else if(_0x45fd64[_0xaffa('0x42')]===_0xaffa('0x1a')){logger[_0xaffa('0x2e')](_0xaffa('0x46'),_0x529f9b,_0x45fd64[_0xaffa('0x42')]);_0x39fb32[_0xaffa('0x2a')]=_0x3faa80!==_0xaffa('0x47')?_0x3faa80:util['format']('Caller\x20-\x20%s',_0x529f9b);}else{return null;}}return _0x3ac015[_0xaffa('0x22')](_['upperFirst'](_0x45fd64[_0xaffa('0x42')]))[_0xaffa('0x20')](_0x39fb32)[_0xaffa('0x26')](function(_0x44c9c3){return BPromise[_0xaffa('0x29')]({'id':_0x44c9c3['id'],'endUserType':_0x45fd64[_0xaffa('0x42')]});});}});}function getCustomFields(_0x20a8e7,_0x25eb5d){var _0xe4a345={};if(_0x20a8e7[_0xaffa('0x37')]>0x0){_[_0xaffa('0x4a')](_0x20a8e7,function(_0x51a55a){if(_['includes']([_0xaffa('0x4b'),'picklist'],_0x51a55a['type'])&&_0x51a55a[_0xaffa('0x4c')]){_0xe4a345[_0x51a55a['idField']]=_0x51a55a[_0xaffa('0x4d')][_0xaffa('0x4e')]();}else if(_0x51a55a[_0xaffa('0x4f')]==='variable'&&_0x51a55a[_0xaffa('0x50')]&&_0x51a55a['idField']){_0x25eb5d[_0x51a55a[_0xaffa('0x50')]]&&(_0xe4a345[_0x51a55a['idField']]=_0x25eb5d[_0x51a55a[_0xaffa('0x50')]][_0xaffa('0x4e')]());}else if(_0x51a55a[_0xaffa('0x4f')]==='customVariable'&&_0x51a55a[_0xaffa('0x51')]&&_0x51a55a[_0xaffa('0x51')]['name']&&_0x51a55a[_0xaffa('0x4c')]){_0x25eb5d[_0x51a55a[_0xaffa('0x51')][_0xaffa('0x52')][_0xaffa('0x40')]()]&&(_0xe4a345[_0x51a55a[_0xaffa('0x4c')]]=_0x25eb5d[_0x51a55a[_0xaffa('0x51')][_0xaffa('0x52')][_0xaffa('0x40')]()][_0xaffa('0x4e')]());}});}return _0xe4a345;}function getConnection(_0x3d32bf){var _0x428457=_0x3d32bf[_0xaffa('0x53')][_0xaffa('0x54')](_0x3d32bf['securityToken']);var _0x31b0a7=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3d32bf['remoteUri']||_0xaffa('0x55'),'clientId':_0x3d32bf[_0xaffa('0x56')],'clientSecret':_0x3d32bf[_0xaffa('0x57')]}});return _0x31b0a7[_0xaffa('0x58')](_0x3d32bf[_0xaffa('0x59')],_0x428457)[_0xaffa('0x26')](function(){logger[_0xaffa('0x2e')](_0xaffa('0x5a'));return _0x31b0a7;});}exports[_0xaffa('0x5b')]=function(_0x5ba00e,_0x1abd2b,_0x1529f7,_0x3fdb6b,_0x315498,_0x43ae6c){var _0x263ec4,_0x4957ee,_0x1e8e06,_0xa30d97;_0x43ae6c[_0xaffa('0x5c')]=intUtil[_0xaffa('0x5d')](_0x43ae6c[_0xaffa('0x5c')]);_0x43ae6c[_0xaffa('0x5e')]=intUtil[_0xaffa('0x5d')](_0x43ae6c['remoteUri']);if(_0x315498&&_0x315498[_0xaffa('0x5f')]){logger[_0xaffa('0x2e')](_0xaffa('0x60'),_0xaffa('0x61'));_0x1abd2b['recordingURL']=util['format'](_0xaffa('0x62'),_0x43ae6c[_0xaffa('0x5c')],_0x1abd2b[_0xaffa('0x63')],md5(_0x1abd2b[_0xaffa('0x63')]));}else{_0x1abd2b[_0xaffa('0x64')]='';}return getConnection(_0x43ae6c)['then'](function(_0x5bc4ef){_0xa30d97=_0x5bc4ef;return getUser(_0x43ae6c,_0x3fdb6b[_0xaffa('0x65')],_0xa30d97);})[_0xaffa('0x26')](function(_0xac4ab0){_0x263ec4=_0xac4ab0;return getEndUser(_0x43ae6c,_0x1529f7,_0x1abd2b['calleridname'],_0x1abd2b[_0xaffa('0x66')],_0xa30d97);})[_0xaffa('0x26')](function(_0x360cb1){_0x4957ee=_0x360cb1;return getTicket(_0x43ae6c,_0x263ec4,_0x4957ee,_0x1529f7,_0x1abd2b,_0x1529f7[_0xaffa('0x67')],_0xa30d97,_0xaffa('0x5b'));})[_0xaffa('0x26')](function(_0x253176){_0x1e8e06=_0x253176;logger[_0xaffa('0x2e')](_0xaffa('0x68'),_0x1e8e06['id']);logger[_0xaffa('0x2e')](_0xaffa('0x69'),_0x1e8e06['id'],_0x3fdb6b[_0xaffa('0x52')],_0x43ae6c[_0xaffa('0x4f')]);switch(_0x43ae6c[_0xaffa('0x4f')]){case _0xaffa('0x6a'):emit(util['format'](_0xaffa('0x6b'),_0x3fdb6b[_0xaffa('0x52')]),_0xaffa('0x6c'),{'recordId':_0x1e8e06['id']});break;case _0xaffa('0x6d'):emit(util[_0xaffa('0x44')]('user:%s',_0x3fdb6b[_0xaffa('0x52')]),_0xaffa('0x6e'),{'uri':util[_0xaffa('0x44')]('%s/%s/e',_0xa30d97[_0xaffa('0x6f')],_0x1e8e06['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xaffa('0x70')](function(_0x4b74ad){logger[_0xaffa('0x71')](_0xaffa('0x60'),_0x4b74ad);});};exports[_0xaffa('0x72')]=function(_0x31d303,_0x19efd1,_0x37ea62,_0x2d81d4,_0x43a906,_0x3c171a,_0x150ada){var _0x13ab57,_0xa4df5f,_0x271392,_0x2e9425;_0x3c171a['serverUrl']=intUtil['stripTrailingSlash'](_0x3c171a[_0xaffa('0x5c')]);_0x3c171a['remoteUri']=intUtil['stripTrailingSlash'](_0x3c171a[_0xaffa('0x5e')]);if(_0x150ada&&_0x150ada[_0xaffa('0x73')]&&_0x150ada['recordingFormat']!=='none'){logger[_0xaffa('0x2e')](_0xaffa('0x74'),_0xaffa('0x61'));_0x19efd1[_0xaffa('0x64')]=util[_0xaffa('0x44')](_0xaffa('0x62'),_0x3c171a[_0xaffa('0x5c')],_0x19efd1[_0xaffa('0x63')],md5(_0x19efd1[_0xaffa('0x63')]));}return getConnection(_0x3c171a)['then'](function(_0xa74538){_0x2e9425=_0xa74538;return getUser(_0x3c171a,_0x2d81d4[_0xaffa('0x65')],_0x2e9425);})[_0xaffa('0x26')](function(_0x59c8bd){_0x13ab57=_0x59c8bd;return getEndUser(_0x3c171a,_0x37ea62,_0x19efd1[_0xaffa('0x75')],_0x19efd1[_0xaffa('0x76')],_0x2e9425);})[_0xaffa('0x26')](function(_0x34ca00){_0xa4df5f=_0x34ca00;return getTicket(_0x3c171a,_0x13ab57,_0xa4df5f,_0x37ea62,_0x19efd1,_0x37ea62[_0xaffa('0x67')],_0x2e9425,_0xaffa('0x72'));})[_0xaffa('0x26')](function(_0x5e5f15){_0x271392=_0x5e5f15;logger[_0xaffa('0x2e')](_0xaffa('0x77'),_0x271392['id']);logger['info'](_0xaffa('0x78'),_0x271392['id'],_0x2d81d4[_0xaffa('0x52')],_0x3c171a[_0xaffa('0x4f')]);switch(_0x3c171a['type']){case _0xaffa('0x6a'):emit(util[_0xaffa('0x44')](_0xaffa('0x6b'),_0x2d81d4[_0xaffa('0x52')]),_0xaffa('0x6c'),{'recordId':_0x271392['id']});break;case _0xaffa('0x6d'):emit(util[_0xaffa('0x44')](_0xaffa('0x6b'),_0x2d81d4['name']),_0xaffa('0x6e'),{'uri':util['format'](_0xaffa('0x79'),_0x2e9425[_0xaffa('0x6f')],_0x271392['id'])});break;default:logger[_0xaffa('0x71')]('[OUTBOUND]',_0xaffa('0x7a'));}})[_0xaffa('0x70')](function(_0x2b54e0){logger[_0xaffa('0x71')](_0xaffa('0x74'),_0x2b54e0);});};exports['unmanaged']=function(_0x529ee5,_0x3c89c1,_0x54fbcc,_0x15dae2,_0x1a495f,_0x9e61b9){var _0x19ec0d,_0x3bd654,_0x3713e7,_0x2b98a5;_0x9e61b9[_0xaffa('0x5c')]=intUtil['stripTrailingSlash'](_0x9e61b9[_0xaffa('0x5c')]);_0x9e61b9[_0xaffa('0x5e')]=intUtil[_0xaffa('0x5d')](_0x9e61b9[_0xaffa('0x5e')]);if(_0x1a495f&&_0x1a495f[_0xaffa('0x5f')]){logger[_0xaffa('0x2e')]('['+_0x3c89c1['lastevent']['toUpperCase']()+']',_0xaffa('0x61'));_0x3c89c1[_0xaffa('0x64')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9e61b9['serverUrl'],_0x3c89c1[_0xaffa('0x63')],md5(_0x3c89c1[_0xaffa('0x63')]));}else{_0x3c89c1[_0xaffa('0x64')]='';}return getConnection(_0x9e61b9)[_0xaffa('0x26')](function(_0x30cd34){_0x2b98a5=_0x30cd34;if(!_['isNil'](_0x15dae2)){return getUser(_0x9e61b9,_0x15dae2[_0xaffa('0x52')],_0x2b98a5);}else{return getUser(_0x9e61b9,null,_0x2b98a5);}})[_0xaffa('0x26')](function(_0x46a5e4){_0x19ec0d=_0x46a5e4;return getEndUser(_0x9e61b9,_0x54fbcc,_0x3c89c1[_0xaffa('0x7b')],_0x3c89c1['calleridnum'],_0x2b98a5);})[_0xaffa('0x26')](function(_0x2585f5){_0x3bd654=_0x2585f5;return getTicket(_0x9e61b9,_0x19ec0d,_0x3bd654,_0x54fbcc,_0x3c89c1,_0x54fbcc[_0xaffa('0x67')],_0x2b98a5);})[_0xaffa('0x26')](function(_0x17035f){_0x3713e7=_0x17035f;logger['info']('['+_0x3c89c1[_0xaffa('0x7c')][_0xaffa('0x7d')]()+_0xaffa('0x7e'),_0x3713e7['id']);logger[_0xaffa('0x2e')]('['+_0x3c89c1['lastevent'][_0xaffa('0x7d')]()+_0xaffa('0x7f'),_0x9e61b9[_0xaffa('0x4f')]);})[_0xaffa('0x70')](function(_0x58db23){logger[_0xaffa('0x71')]('['+_0x3c89c1['lastevent']['toUpperCase']()+']',_0x58db23);});}; \ 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 664db95..e039ec7 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 _0x501e=['Incident','ticketId','Incident\x20-\x20','ticketNumber','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','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','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','inspect','lodash','bluebird','util','md5','ioredis','./util','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','adminId','info','toUpperCase','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','result','length','active','sys_id','],\x20getUser\x20crm','error','adminEmail','],\x20createEndUser\x20input\x20crm','POST','user','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','userId','assign','true','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident'];(function(_0x13c174,_0xda25fe){var _0x160654=function(_0x1b6ac2){while(--_0x1b6ac2){_0x13c174['push'](_0x13c174['shift']());}};_0x160654(++_0xda25fe);}(_0x501e,0x94));var _0xe501=function(_0x2fd8bc,_0x52e6cf){_0x2fd8bc=_0x2fd8bc-0x0;var _0x530a88=_0x501e[_0x2fd8bc];return _0x530a88;};'use strict';var _=require(_0xe501('0x0'));var Promise=require(_0xe501('0x1'));var rp=require('request-promise');var util=require(_0xe501('0x2'));var md5=require(_0xe501('0x3'));var Redis=require(_0xe501('0x4'));var intUtil=require(_0xe501('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe501('0x6'));config['redis']=_[_0xe501('0x7')](config[_0xe501('0x8')],{'host':_0xe501('0x9'),'port':0x18eb});var io=require(_0xe501('0xa'))(new Redis(config[_0xe501('0x8')]));function getAdminUser(_0xe56e15,_0x38ac10,_0x2353a,_0x1ceb19,_0x12b2b,_0x5dc432){return new Promise(function(_0x56086b,_0x19c331){var _0x908d0a={'method':_0xe501('0xb'),'uri':_0x1ceb19+_0xe501('0xc')+'&'+_0x12b2b+'&'+_0x5dc432,'auth':_0x38ac10,'json':!![]};return rp(_0x908d0a)[_0xe501('0xd')](function(_0x16a3eb){if(_0x16a3eb['result']['length']>0x0){_0x2353a[_0xe501('0xe')]=_0x16a3eb['result'][0x0]['sys_id'];}logger[_0xe501('0xf')]('['+[_0xe56e15[_0xe501('0x10')]()]+'],\x20getAdminUser\x20crm',_0x2353a);_0x56086b(_0x2353a);})[_0xe501('0x11')](function(_0x1b2def){logger['error']('['+[_0xe56e15[_0xe501('0x10')]()]+']',_0x1b2def[_0xe501('0x12')]);_0x19c331(_0x1b2def[_0xe501('0x12')]);});});}function getUser(_0x4c2d76,_0x53bc2a,_0x34598f,_0xced3b1,_0x2abe48){return function(_0x171bf0){logger[_0xe501('0xf')]('['+[_0x4c2d76[_0xe501('0x10')]()]+_0xe501('0x13'),_0x171bf0);return new Promise(function(_0x581e7c,_0x21047e){if(intUtil[_0xe501('0x14')](_0x171bf0[_0xe501('0x15')])){var _0x27f13f={'method':_0xe501('0xb'),'uri':_0x34598f+_0xe501('0x16')+_0x171bf0[_0xe501('0x15')]+'&'+_0xced3b1+'&'+_0x2abe48,'auth':_0x53bc2a,'json':!![]};logger[_0xe501('0xf')]('['+[_0x4c2d76[_0xe501('0x10')]()]+_0xe501('0x17'),_0x27f13f);return rp(_0x27f13f)[_0xe501('0xd')](function(_0x2d3ef6){logger[_0xe501('0xf')]('['+[_0x4c2d76[_0xe501('0x10')]()]+_0xe501('0x18'),_0x2d3ef6);if(_0x2d3ef6[_0xe501('0x19')][_0xe501('0x1a')]>0x0&&String(_0x2d3ef6[_0xe501('0x19')][0x0][_0xe501('0x1b')])==='true'){_0x171bf0['userId']=_0x2d3ef6[_0xe501('0x19')][0x0][_0xe501('0x1c')];}else{_0x171bf0['userId']=_0x171bf0['adminId'];_0x171bf0[_0xe501('0x15')]=_0x171bf0['adminEmail'];}logger['info']('['+[_0x4c2d76['toUpperCase']()]+_0xe501('0x1d'),_0x171bf0);_0x581e7c(_0x171bf0);})[_0xe501('0x11')](function(_0x251b65){logger[_0xe501('0x1e')]('['+[_0x4c2d76[_0xe501('0x10')]()]+']',_0x251b65[_0xe501('0x12')]);_0x21047e(_0x251b65[_0xe501('0x12')]);});}else{logger[_0xe501('0xf')]('['+[_0x4c2d76[_0xe501('0x10')]()]+']\x20using\x20admin\x20profile');_0x171bf0['userId']=_0x171bf0[_0xe501('0xe')];_0x171bf0[_0xe501('0x15')]=_0x171bf0[_0xe501('0x1f')];_0x581e7c(_0x171bf0);}});};}function createEndUser(_0x2e30e2,_0x590161,_0x455b03,_0x50f548,_0x3b06f7){logger['info']('['+[_0x2e30e2[_0xe501('0x10')]()]+_0xe501('0x20'),_0x455b03);return new Promise(function(_0x126ca6,_0x5737df){var _0x34a1db={'method':_0xe501('0x21'),'uri':_0x50f548+'sys_user?'+_0x3b06f7,'body':{'user_name':_0x455b03['endUserNumber'],'roles':_0xe501('0x22'),'first_name':_0x455b03[_0xe501('0x23')],'active':'true','date_format':_0xe501('0x24'),'phone':_0x455b03[_0xe501('0x23')]},'auth':_0x590161,'json':!![]};return rp(_0x34a1db)['then'](function(_0x215368){logger[_0xe501('0xf')]('['+[_0x2e30e2[_0xe501('0x10')]()]+_0xe501('0x25'),_0x215368[_0xe501('0x19')]);_0x455b03['endUserId']=_0x215368[_0xe501('0x19')][_0xe501('0x1c')];_0x126ca6(_0x455b03);})[_0xe501('0x11')](function(_0x35c9e5){logger[_0xe501('0x1e')]('['+[_0x2e30e2[_0xe501('0x10')]()]+']',_0x35c9e5[_0xe501('0x12')]);_0x5737df(_0x35c9e5['message']);});});}function getEndUser(_0x5dd941,_0xa56719,_0x3dd66a,_0x44d9a6,_0xa5c5d1){return function(_0x3b6406){logger[_0xe501('0xf')]('['+[_0x5dd941[_0xe501('0x10')]()]+_0xe501('0x26'),_0x3b6406);return new Promise(function(_0x8715d6,_0x23e512){var _0xad6e8c={'method':_0xe501('0xb'),'uri':_0x3dd66a+_0xe501('0x27')+_0x3b6406[_0xe501('0x23')]+'&'+_0x44d9a6+'&'+_0xa5c5d1,'auth':_0xa56719,'json':!![]};return rp(_0xad6e8c)[_0xe501('0xd')](function(_0x536af7){if(_0x536af7[_0xe501('0x19')][_0xe501('0x1a')]>0x0){_0x3b6406[_0xe501('0x28')]=_0x536af7['result'][0x0]['sys_id'];logger[_0xe501('0xf')]('['+[_0x5dd941[_0xe501('0x10')]()]+_0xe501('0x29'),_0x3b6406);_0x8715d6(_0x3b6406);}else{return createEndUser(_0x5dd941,_0xa56719,_0x3b6406,_0x3dd66a,_0x44d9a6)[_0xe501('0xd')](function(_0x458461){logger['info']('['+[_0x5dd941[_0xe501('0x10')]()]+_0xe501('0x2a'),_0x458461);_0x8715d6(_0x458461);});}})['catch'](function(_0x423270){logger[_0xe501('0x1e')]('['+[_0x5dd941['toUpperCase']()]+']',_0x423270[_0xe501('0x12')]);_0x23e512(_0x423270[_0xe501('0x12')]);});});};}function getCustomFields(_0xc2f20c,_0x11f38e){var _0x30157f={};if(_0xc2f20c[_0xe501('0x1a')]>0x0){_['forEach'](_0xc2f20c,function(_0xe79783){if(_[_0xe501('0x2b')]([_0xe501('0x2c'),_0xe501('0x2d')],_0xe79783[_0xe501('0x2e')])&&_0xe79783[_0xe501('0x2f')]&&!_0xe79783[_0xe501('0x30')]){_0x30157f[_0xe79783[_0xe501('0x2f')][_0xe501('0x31')]()]=_0xe79783[_0xe501('0x32')][_0xe501('0x33')]();}else if(_[_0xe501('0x2b')]([_0xe501('0x2c'),_0xe501('0x2d')],_0xe79783[_0xe501('0x2e')])&&_0xe79783[_0xe501('0x34')]&&_0xe79783[_0xe501('0x30')]){_0x30157f[_0xe79783[_0xe501('0x34')]['toLowerCase']()]=_0xe79783[_0xe501('0x32')][_0xe501('0x33')]();}else if(_0xe79783['type']==='variable'&&_0xe79783[_0xe501('0x35')]&&_0xe79783[_0xe501('0x34')]&&_0xe79783[_0xe501('0x30')]){_0x30157f[_0xe79783[_0xe501('0x34')][_0xe501('0x31')]()]=_0x11f38e[_0xe79783[_0xe501('0x35')]][_0xe501('0x33')]();}else if(_0xe79783[_0xe501('0x2e')]===_0xe501('0x36')&&_0xe79783[_0xe501('0x37')]&&_0xe79783[_0xe501('0x37')]['name']&&_0xe79783[_0xe501('0x34')]&&_0xe79783[_0xe501('0x30')]){_0x30157f[_0xe79783['idField'][_0xe501('0x31')]()]=_0x11f38e[_0xe79783[_0xe501('0x37')][_0xe501('0x38')][_0xe501('0x31')]()]['toString']();}});}return _0x30157f;}function getTicket(_0x392967,_0x4f35e0,_0x464882,_0x41a2d3,_0x276c8a,_0x1cdc78){return function(_0x40f515){logger[_0xe501('0xf')]('['+[_0x392967[_0xe501('0x10')]()]+_0xe501('0x39'),_0x40f515);return new Promise(function(_0xb8f0fe,_0x69a224){var _0x720a01=_0x392967['toLowerCase']()===_0xe501('0x3a')?_0x40f515[_0xe501('0x3b')]:_0x40f515[_0xe501('0x28')];var _0x26f961={'method':_0xe501('0x21'),'uri':_0x464882+'incident'+'?'+_0x1cdc78,'body':Object[_0xe501('0x3c')]({},{'active':_0xe501('0x3d'),'caller_id':_0x720a01,'assigned_to':_0x40f515['userId'],'short_description':intUtil[_0xe501('0x3e')](_0x41a2d3['Subjects'],_0x276c8a,'\x20'),'description':intUtil[_0xe501('0x3e')](_0x41a2d3[_0xe501('0x3f')],_0x276c8a,'\x0a')},getCustomFields(_0x41a2d3['Fields'],_0x276c8a)),'auth':_0x4f35e0,'json':!![]};return rp(_0x26f961)[_0xe501('0xd')](function(_0xbf9fd4){logger['info']('['+[_0x392967[_0xe501('0x10')]()]+_0xe501('0x40'),_0xbf9fd4[_0xe501('0x19')]);_0x40f515['ticketId']=_0xbf9fd4[_0xe501('0x19')][_0xe501('0x1c')];_0x40f515['ticketNumber']=_0xbf9fd4['result']['number'];logger[_0xe501('0xf')]('['+[_0x392967[_0xe501('0x10')]()]+_0xe501('0x41'),_0x40f515);_0xb8f0fe(_0x40f515);})[_0xe501('0x11')](function(_0x28e473){logger['error']('['+[_0x392967[_0xe501('0x10')]()]+']',_0x28e473[_0xe501('0x12')]);_0x69a224(_0x28e473[_0xe501('0x12')]);});});};}function createRemoteTag(_0x2a3280,_0x5c2ef9,_0xd24857,_0x1631bd){return new Promise(function(_0x5871e2,_0x486db9){var _0x18a4fa={'method':'POST','uri':_0xd24857+_0xe501('0x42')+'?'+_0x1631bd,'body':{'short_description':_0x2a3280,'global':!![],'active':!![],'name':_0x2a3280},'auth':_0x5c2ef9,'json':!![]};return rp(_0x18a4fa)[_0xe501('0xd')](function(_0x32a939){var _0x1108a6=_0x32a939[_0xe501('0x19')][_0xe501('0x1c')];_0x5871e2(_0x1108a6);});});}function getRemoteTag(_0x4e6bb7,_0xbf53f9,_0x13bbda,_0x4185b1,_0x984437){return new Promise(function(_0x3e327d,_0x28a359){var _0x5568fd={'method':_0xe501('0xb'),'uri':_0x13bbda+_0xe501('0x42')+_0xe501('0x43')+_0x4e6bb7+'&'+_0x4185b1,'auth':_0xbf53f9,'json':!![]};return rp(_0x5568fd)[_0xe501('0xd')](function(_0x22c306){if(_0x22c306['result'][_0xe501('0x1a')]>0x0){var _0x266979=_0x22c306[_0xe501('0x19')][0x0][_0xe501('0x1c')];_0x3e327d(_0x266979);}else{return createRemoteTag(_0x4e6bb7,_0xbf53f9,_0x13bbda,_0x4185b1)['then'](function(_0x42b70b){_0x3e327d(_0x42b70b);});}});});}function assignTagToIncident(_0x4fab4d,_0x4c1fdd,_0x16e1d9,_0x480e1d,_0x3c9e0b){return new Promise(function(_0x3bbc14,_0x419255){var _0x4f25f7={'method':_0xe501('0x21'),'uri':_0x16e1d9+_0xe501('0x44')+'?'+_0x3c9e0b,'body':{'label':_0x4fab4d,'table':_0xe501('0x45'),'id_type':_0xe501('0x46'),'table_key':_0x480e1d[_0xe501('0x47')],'title':_0xe501('0x48')+_0x480e1d[_0xe501('0x49')],'id_display':_0x480e1d['ticketNumber']},'auth':_0x4c1fdd,'json':!![]};return rp(_0x4f25f7)['then'](function(_0x21eb00){_0x3bbc14();})[_0xe501('0x11')](function(){_0x3bbc14();});});}function manageTags(_0x1dbc5b,_0x4b864b,_0x4ee6fd,_0x5a2bf8,_0xb06bf1,_0x21f887,_0xa66fdc){return new Promise(function(_0x2588ce,_0x38922d){var _0x5ccbbd=[];_0x4b864b[_0xe501('0x4a')](function(_0x35c0ee){_0x5ccbbd[_0xe501('0x4b')](getRemoteTag(_0x35c0ee,_0x4ee6fd,_0x5a2bf8,_0x21f887,_0xa66fdc));});return Promise[_0xe501('0x4c')](_0x5ccbbd)[_0xe501('0xd')](function(_0x23b70c){if(_0x23b70c[_0xe501('0x1a')]){logger[_0xe501('0xf')]('['+[_0x1dbc5b[_0xe501('0x10')]()]+_0xe501('0x4d'),_0x23b70c);var _0x17e37d=[];_0x23b70c[_0xe501('0x4a')](function(_0x231d72){_0x17e37d[_0xe501('0x4b')](assignTagToIncident(_0x231d72,_0x4ee6fd,_0x5a2bf8,_0xb06bf1,_0x21f887));});return Promise['all'](_0x17e37d)['then'](function(){_0x2588ce();})['catch'](function(){_0x2588ce();});}else{_0x2588ce();}});});}function getTags(_0x17bd62,_0x34bd67,_0x554c04,_0x5206ce,_0x4a23f5,_0x57f936){return function(_0x1649b){return new Promise(function(_0xc9f3bd,_0xd8e05e){var _0xc33744=[];var _0x3de739=_0x5206ce['Tags'];if(_0x3de739&&_0x3de739['length']>0x0){_0xc33744=_[_0xe501('0x4e')](_0x3de739,_0xe501('0x38'));}if(_0xc33744['length']>0x0){return manageTags(_0x17bd62,_0xc33744,_0x34bd67,_0x554c04,_0x1649b,_0x4a23f5,_0x57f936)[_0xe501('0xd')](function(){_0xc9f3bd(_0x1649b);});}else{_0xc9f3bd(_0x1649b);}});};}function emit(_0x328c1,_0xfcf8fa,_0xddbd94){var _0x554c13=_0xe501('0x4f')+_0xe501('0x50')+_0xe501('0x51')+_0xe501('0x52');var _0x1e5100={'uri':_0x328c1+_0xe501('0x53')+_0xddbd94+_0x554c13};io['to'](util[_0xe501('0x54')](_0xe501('0x55'),_0xfcf8fa))[_0xe501('0x56')](_0xe501('0x57'),_0x1e5100);}exports['cs']=function(_0x1d60dc,_0x1350c0,_0x25b8b7,_0x159c1a,_0x502f30,_0x39dd02,_0x2b4d4a,_0x4b8d91){var _0x4b952c={};var _0x5ee967={'user':_0x39dd02[_0xe501('0x58')],'pass':_0x39dd02['password']};var _0x5f3be8=_0xe501('0x59');var _0x4793ad=_0xe501('0x5a');_0x39dd02[_0xe501('0x5b')]=intUtil[_0xe501('0x5c')](_0x39dd02['remoteUri']);_0x39dd02[_0xe501('0x5d')]=intUtil['stripTrailingSlash'](_0x39dd02[_0xe501('0x5d')]);var _0x483314=util[_0xe501('0x54')](_0xe501('0x5e'),_0x39dd02[_0xe501('0x5b')]);_0x4b952c[_0xe501('0x15')]=!_[_0xe501('0x5f')](_0x159c1a)?_0x159c1a[_0xe501('0x60')]:null;_0x4b952c[_0xe501('0x1f')]=_0x39dd02[_0xe501('0x60')];_0x4b952c[_0xe501('0x23')]=_0x4b8d91[_0xe501('0x31')]()===_0xe501('0x3a')?_0x1350c0[_0xe501('0x61')]:_0x1350c0['calleridnum'];_0x4b952c['callDirection']=_0x4b8d91===_0xe501('0x62')||_0x4b8d91===_0xe501('0x63')?'queue':_0xe501('0x3a');var _0x1a4758=util[_0xe501('0x54')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39dd02[_0xe501('0x5d')],_0x1350c0[_0xe501('0x64')],md5(_0x1350c0['uniqueid']));if(_0x502f30&&_0x502f30[_0xe501('0x65')]){logger[_0xe501('0xf')](_0xe501('0x66'),'Recording\x20is\x20enabled!');_0x1350c0[_0xe501('0x67')]=_0x1a4758;}else if(_0x2b4d4a&&_0x2b4d4a[_0xe501('0x68')]&&_0x2b4d4a['recordingFormat']!==_0xe501('0x69')){logger['info'](_0xe501('0x6a'),'Recording\x20is\x20enabled!');_0x1350c0['recordingURL']=_0x1a4758;}else{_0x1350c0[_0xe501('0x67')]='';}return getAdminUser(_0x4b8d91,_0x5ee967,_0x4b952c,_0x483314,_0x4793ad,_0x5f3be8)['then'](getUser(_0x4b8d91,_0x5ee967,_0x483314,_0x4793ad,_0x5f3be8))[_0xe501('0xd')](getEndUser(_0x4b8d91,_0x5ee967,_0x483314,_0x4793ad,_0x5f3be8))[_0xe501('0xd')](getTicket(_0x4b8d91,_0x5ee967,_0x483314,_0x25b8b7,_0x1350c0,_0x4793ad))['then'](function(_0xb42bc3){logger[_0xe501('0xf')](util['format'](_0xe501('0x6b'),_0xb42bc3[_0xe501('0x47')]));logger[_0xe501('0xf')](util[_0xe501('0x54')]('call\x20direction:\x20%s',_0x4b8d91));if(_0x4b8d91!==_0xe501('0x63')){logger['info']('['+[_0x4b8d91[_0xe501('0x10')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x39dd02['remoteUri'],_0x159c1a[_0xe501('0x38')],_0xb42bc3['ticketId']);}})['catch'](function(_0x388857){logger['error']('['+[_0x4b8d91[_0xe501('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xe501('0x6c')](_0x388857,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xea05=['isNil','email','destcalleridnum','callDirection','queue','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','then','],\x20getUser\x20entity','true','userId','adminId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','toString','type','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%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_display_value=true','stripTrailingSlash','remoteUri','%s/api/now/table/'];(function(_0x4e37bc,_0x8174e7){var _0x48a8b7=function(_0x458409){while(--_0x458409){_0x4e37bc['push'](_0x4e37bc['shift']());}};_0x48a8b7(++_0x8174e7);}(_0xea05,0x1de));var _0x5ea0=function(_0x39ee89,_0x36935c){_0x39ee89=_0x39ee89-0x0;var _0x3e0729=_0xea05[_0x39ee89];return _0x3e0729;};'use strict';var _=require('lodash');var Promise=require(_0x5ea0('0x0'));var rp=require(_0x5ea0('0x1'));var util=require(_0x5ea0('0x2'));var md5=require(_0x5ea0('0x3'));var Redis=require(_0x5ea0('0x4'));var intUtil=require(_0x5ea0('0x5'));var config=require(_0x5ea0('0x6'));var logger=require(_0x5ea0('0x7'))(_0x5ea0('0x8'));config[_0x5ea0('0x9')]=_[_0x5ea0('0xa')](config[_0x5ea0('0x9')],{'host':_0x5ea0('0xb'),'port':0x18eb});var io=require(_0x5ea0('0xc'))(new Redis(config['redis']));function getAdminUser(_0x1d7f8b,_0x45cb1b,_0x239716,_0x135267,_0x54ec1a,_0x2897c0){return new Promise(function(_0x4fb363,_0x195b01){var _0x492798={'method':'GET','uri':_0x135267+_0x5ea0('0xd')+'&'+_0x54ec1a+'&'+_0x2897c0,'auth':_0x45cb1b,'json':!![]};return rp(_0x492798)['then'](function(_0x56feda){if(_0x56feda[_0x5ea0('0xe')]['length']>0x0){_0x239716['adminId']=_0x56feda[_0x5ea0('0xe')][0x0][_0x5ea0('0xf')];}logger[_0x5ea0('0x10')]('['+[_0x1d7f8b[_0x5ea0('0x11')]()]+_0x5ea0('0x12'),_0x239716);_0x4fb363(_0x239716);})[_0x5ea0('0x13')](function(_0x3216cc){logger[_0x5ea0('0x14')]('['+[_0x1d7f8b[_0x5ea0('0x11')]()]+']',_0x3216cc[_0x5ea0('0x15')]);_0x195b01(_0x3216cc[_0x5ea0('0x15')]);});});}function getUser(_0x234182,_0x53d026,_0x3863d1,_0xeaf017,_0x8e986c){return function(_0x521e9f){logger[_0x5ea0('0x10')]('['+[_0x234182[_0x5ea0('0x11')]()]+_0x5ea0('0x16'),_0x521e9f);return new Promise(function(_0x5ac27a,_0x1015b0){if(intUtil[_0x5ea0('0x17')](_0x521e9f[_0x5ea0('0x18')])){var _0x1c2eb9={'method':_0x5ea0('0x19'),'uri':_0x3863d1+_0x5ea0('0x1a')+_0x521e9f[_0x5ea0('0x18')]+'&'+_0xeaf017+'&'+_0x8e986c,'auth':_0x53d026,'json':!![]};logger['info']('['+[_0x234182[_0x5ea0('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x1c2eb9);return rp(_0x1c2eb9)[_0x5ea0('0x1b')](function(_0x465652){logger[_0x5ea0('0x10')]('['+[_0x234182[_0x5ea0('0x11')]()]+_0x5ea0('0x1c'),_0x465652);if(_0x465652[_0x5ea0('0xe')]['length']>0x0&&String(_0x465652[_0x5ea0('0xe')][0x0]['active'])===_0x5ea0('0x1d')){_0x521e9f[_0x5ea0('0x1e')]=_0x465652[_0x5ea0('0xe')][0x0]['sys_id'];}else{_0x521e9f[_0x5ea0('0x1e')]=_0x521e9f[_0x5ea0('0x1f')];_0x521e9f[_0x5ea0('0x18')]=_0x521e9f['adminEmail'];}logger[_0x5ea0('0x10')]('['+[_0x234182['toUpperCase']()]+_0x5ea0('0x20'),_0x521e9f);_0x5ac27a(_0x521e9f);})[_0x5ea0('0x13')](function(_0x6d1ee1){logger[_0x5ea0('0x14')]('['+[_0x234182[_0x5ea0('0x11')]()]+']',_0x6d1ee1[_0x5ea0('0x15')]);_0x1015b0(_0x6d1ee1[_0x5ea0('0x15')]);});}else{logger[_0x5ea0('0x10')]('['+[_0x234182['toUpperCase']()]+_0x5ea0('0x21'));_0x521e9f[_0x5ea0('0x1e')]=_0x521e9f['adminId'];_0x521e9f[_0x5ea0('0x18')]=_0x521e9f[_0x5ea0('0x22')];_0x5ac27a(_0x521e9f);}});};}function createEndUser(_0x523b32,_0x1b7e2a,_0x5b19ca,_0x5cb9e7,_0x184b4a){logger[_0x5ea0('0x10')]('['+[_0x523b32['toUpperCase']()]+_0x5ea0('0x23'),_0x5b19ca);return new Promise(function(_0x437f54,_0x5c006a){var _0x2bc49c={'method':_0x5ea0('0x24'),'uri':_0x5cb9e7+_0x5ea0('0x25')+_0x184b4a,'body':{'user_name':_0x5b19ca[_0x5ea0('0x26')],'roles':_0x5ea0('0x27'),'first_name':_0x5b19ca[_0x5ea0('0x26')],'active':_0x5ea0('0x1d'),'date_format':_0x5ea0('0x28'),'phone':_0x5b19ca['endUserNumber']},'auth':_0x1b7e2a,'json':!![]};return rp(_0x2bc49c)['then'](function(_0x3403a1){logger['info']('['+[_0x523b32[_0x5ea0('0x11')]()]+_0x5ea0('0x29'),_0x3403a1[_0x5ea0('0xe')]);_0x5b19ca['endUserId']=_0x3403a1['result'][_0x5ea0('0xf')];_0x437f54(_0x5b19ca);})[_0x5ea0('0x13')](function(_0x83b658){logger[_0x5ea0('0x14')]('['+[_0x523b32[_0x5ea0('0x11')]()]+']',_0x83b658[_0x5ea0('0x15')]);_0x5c006a(_0x83b658[_0x5ea0('0x15')]);});});}function getEndUser(_0x4d7439,_0x509732,_0x4ee228,_0x33e4c3,_0x84598f){return function(_0x15bd11){logger[_0x5ea0('0x10')]('['+[_0x4d7439['toUpperCase']()]+_0x5ea0('0x2a'),_0x15bd11);return new Promise(function(_0x21d0fe,_0x29d8c6){var _0x511d74={'method':_0x5ea0('0x19'),'uri':_0x4ee228+_0x5ea0('0x2b')+_0x15bd11['endUserNumber']+'&'+_0x33e4c3+'&'+_0x84598f,'auth':_0x509732,'json':!![]};return rp(_0x511d74)[_0x5ea0('0x1b')](function(_0x46d8eb){if(_0x46d8eb[_0x5ea0('0xe')][_0x5ea0('0x2c')]>0x0){_0x15bd11[_0x5ea0('0x2d')]=_0x46d8eb[_0x5ea0('0xe')][0x0][_0x5ea0('0xf')];logger[_0x5ea0('0x10')]('['+[_0x4d7439[_0x5ea0('0x11')]()]+_0x5ea0('0x2e'),_0x15bd11);_0x21d0fe(_0x15bd11);}else{return createEndUser(_0x4d7439,_0x509732,_0x15bd11,_0x4ee228,_0x33e4c3)[_0x5ea0('0x1b')](function(_0x535c50){logger[_0x5ea0('0x10')]('['+[_0x4d7439[_0x5ea0('0x11')]()]+_0x5ea0('0x2f'),_0x535c50);_0x21d0fe(_0x535c50);});}})[_0x5ea0('0x13')](function(_0x5381c1){logger[_0x5ea0('0x14')]('['+[_0x4d7439[_0x5ea0('0x11')]()]+']',_0x5381c1['message']);_0x29d8c6(_0x5381c1[_0x5ea0('0x15')]);});});};}function getCustomFields(_0x3f9b2f,_0x1590fb){var _0x4d7bbd={};if(_0x3f9b2f[_0x5ea0('0x2c')]>0x0){_[_0x5ea0('0x30')](_0x3f9b2f,function(_0x5e33ff){if(_[_0x5ea0('0x31')]([_0x5ea0('0x32'),_0x5ea0('0x33')],_0x5e33ff['type'])&&_0x5e33ff[_0x5ea0('0x34')]&&!_0x5e33ff[_0x5ea0('0x35')]){_0x4d7bbd[_0x5e33ff[_0x5ea0('0x34')][_0x5ea0('0x36')]()]=_0x5e33ff[_0x5ea0('0x37')][_0x5ea0('0x38')]();}else if(_['includes']([_0x5ea0('0x32'),_0x5ea0('0x33')],_0x5e33ff[_0x5ea0('0x39')])&&_0x5e33ff[_0x5ea0('0x3a')]&&_0x5e33ff[_0x5ea0('0x35')]){_0x4d7bbd[_0x5e33ff[_0x5ea0('0x3a')][_0x5ea0('0x36')]()]=_0x5e33ff['content'][_0x5ea0('0x38')]();}else if(_0x5e33ff[_0x5ea0('0x39')]===_0x5ea0('0x3b')&&_0x5e33ff[_0x5ea0('0x3c')]&&_0x5e33ff[_0x5ea0('0x3a')]&&_0x5e33ff[_0x5ea0('0x35')]){_0x4d7bbd[_0x5e33ff[_0x5ea0('0x3a')][_0x5ea0('0x36')]()]=_0x1590fb[_0x5e33ff[_0x5ea0('0x3c')]][_0x5ea0('0x38')]();}else if(_0x5e33ff[_0x5ea0('0x39')]==='customVariable'&&_0x5e33ff[_0x5ea0('0x3d')]&&_0x5e33ff[_0x5ea0('0x3d')][_0x5ea0('0x3e')]&&_0x5e33ff[_0x5ea0('0x3a')]&&_0x5e33ff[_0x5ea0('0x35')]){_0x4d7bbd[_0x5e33ff['idField'][_0x5ea0('0x36')]()]=_0x1590fb[_0x5e33ff[_0x5ea0('0x3d')][_0x5ea0('0x3e')][_0x5ea0('0x36')]()]['toString']();}});}return _0x4d7bbd;}function getTicket(_0x627780,_0x3999c9,_0xd51871,_0x16b730,_0x6d3b91,_0x1b14a5){return function(_0x44eca8){logger[_0x5ea0('0x10')]('['+[_0x627780[_0x5ea0('0x11')]()]+_0x5ea0('0x3f'),_0x44eca8);return new Promise(function(_0x5a12c8,_0x3f0f5b){var _0x575ea=_0x627780[_0x5ea0('0x36')]()===_0x5ea0('0x40')?_0x44eca8['userId']:_0x44eca8[_0x5ea0('0x2d')];var _0x5880f6={'method':_0x5ea0('0x24'),'uri':_0xd51871+'incident'+'?'+_0x1b14a5,'body':Object[_0x5ea0('0x41')]({},{'active':_0x5ea0('0x1d'),'caller_id':_0x575ea,'assigned_to':_0x44eca8[_0x5ea0('0x1e')],'short_description':intUtil[_0x5ea0('0x42')](_0x16b730[_0x5ea0('0x43')],_0x6d3b91,'\x20'),'description':intUtil[_0x5ea0('0x42')](_0x16b730[_0x5ea0('0x44')],_0x6d3b91,'\x0a')},getCustomFields(_0x16b730[_0x5ea0('0x45')],_0x6d3b91)),'auth':_0x3999c9,'json':!![]};return rp(_0x5880f6)[_0x5ea0('0x1b')](function(_0x247253){logger[_0x5ea0('0x10')]('['+[_0x627780[_0x5ea0('0x11')]()]+_0x5ea0('0x46'),_0x247253[_0x5ea0('0xe')]);_0x44eca8['ticketId']=_0x247253[_0x5ea0('0xe')][_0x5ea0('0xf')];_0x44eca8[_0x5ea0('0x47')]=_0x247253[_0x5ea0('0xe')]['number'];logger[_0x5ea0('0x10')]('['+[_0x627780[_0x5ea0('0x11')]()]+']\x20getTicket\x20crm',_0x44eca8);_0x5a12c8(_0x44eca8);})[_0x5ea0('0x13')](function(_0x1651e0){logger[_0x5ea0('0x14')]('['+[_0x627780[_0x5ea0('0x11')]()]+']',_0x1651e0[_0x5ea0('0x15')]);_0x3f0f5b(_0x1651e0[_0x5ea0('0x15')]);});});};}function createRemoteTag(_0x2a02f2,_0x270a64,_0x579461,_0xa2adc7){return new Promise(function(_0x526b2c,_0x548071){var _0x1b32d0={'method':_0x5ea0('0x24'),'uri':_0x579461+_0x5ea0('0x48')+'?'+_0xa2adc7,'body':{'short_description':_0x2a02f2,'global':!![],'active':!![],'name':_0x2a02f2},'auth':_0x270a64,'json':!![]};return rp(_0x1b32d0)['then'](function(_0x20fc25){var _0xa699=_0x20fc25[_0x5ea0('0xe')]['sys_id'];_0x526b2c(_0xa699);});});}function getRemoteTag(_0x41fdb4,_0x398082,_0x1a7b90,_0x33de97,_0x5c062a){return new Promise(function(_0x38761a,_0x444363){var _0x4f6aa9={'method':_0x5ea0('0x19'),'uri':_0x1a7b90+'label'+_0x5ea0('0x49')+_0x41fdb4+'&'+_0x33de97,'auth':_0x398082,'json':!![]};return rp(_0x4f6aa9)[_0x5ea0('0x1b')](function(_0x560611){if(_0x560611[_0x5ea0('0xe')][_0x5ea0('0x2c')]>0x0){var _0x4d3c2a=_0x560611['result'][0x0][_0x5ea0('0xf')];_0x38761a(_0x4d3c2a);}else{return createRemoteTag(_0x41fdb4,_0x398082,_0x1a7b90,_0x33de97)[_0x5ea0('0x1b')](function(_0x5c968d){_0x38761a(_0x5c968d);});}});});}function assignTagToIncident(_0x2a37e9,_0x25be21,_0x2a0be7,_0x1389f9,_0xc9561a){return new Promise(function(_0x183a63,_0xe7aad0){var _0x2619b1={'method':_0x5ea0('0x24'),'uri':_0x2a0be7+_0x5ea0('0x4a')+'?'+_0xc9561a,'body':{'label':_0x2a37e9,'table':'incident','id_type':_0x5ea0('0x4b'),'table_key':_0x1389f9[_0x5ea0('0x4c')],'title':_0x5ea0('0x4d')+_0x1389f9[_0x5ea0('0x47')],'id_display':_0x1389f9['ticketNumber']},'auth':_0x25be21,'json':!![]};return rp(_0x2619b1)[_0x5ea0('0x1b')](function(_0x1e54e6){_0x183a63();})[_0x5ea0('0x13')](function(){_0x183a63();});});}function manageTags(_0x359186,_0x4f8a3d,_0x2063b2,_0x57ccec,_0x1ef81b,_0x474dc5,_0x4b7d21){return new Promise(function(_0x5ea85e,_0x51dc95){var _0x93932e=[];_0x4f8a3d['forEach'](function(_0x3954d3){_0x93932e[_0x5ea0('0x4e')](getRemoteTag(_0x3954d3,_0x2063b2,_0x57ccec,_0x474dc5,_0x4b7d21));});return Promise[_0x5ea0('0x4f')](_0x93932e)[_0x5ea0('0x1b')](function(_0x587dcb){if(_0x587dcb['length']){logger[_0x5ea0('0x10')]('['+[_0x359186[_0x5ea0('0x11')]()]+_0x5ea0('0x50'),_0x587dcb);var _0x131cf8=[];_0x587dcb[_0x5ea0('0x30')](function(_0x226081){_0x131cf8[_0x5ea0('0x4e')](assignTagToIncident(_0x226081,_0x2063b2,_0x57ccec,_0x1ef81b,_0x474dc5));});return Promise['all'](_0x131cf8)['then'](function(){_0x5ea85e();})[_0x5ea0('0x13')](function(){_0x5ea85e();});}else{_0x5ea85e();}});});}function getTags(_0x44958b,_0x3c1bcb,_0x3952ca,_0x410a76,_0x2f4b72,_0x7f198b){return function(_0xfb2b1b){return new Promise(function(_0x45676f,_0x38efe1){var _0x28a6d5=[];var _0x819213=_0x410a76[_0x5ea0('0x51')];if(_0x819213&&_0x819213[_0x5ea0('0x2c')]>0x0){_0x28a6d5=_[_0x5ea0('0x52')](_0x819213,_0x5ea0('0x3e'));}if(_0x28a6d5[_0x5ea0('0x2c')]>0x0){return manageTags(_0x44958b,_0x28a6d5,_0x3c1bcb,_0x3952ca,_0xfb2b1b,_0x2f4b72,_0x7f198b)[_0x5ea0('0x1b')](function(){_0x45676f(_0xfb2b1b);});}else{_0x45676f(_0xfb2b1b);}});};}function emit(_0x3b8098,_0x55dc1f,_0xbf0e1c){var _0x4bef1c='%26sysparm_record_target%3Dincident'+_0x5ea0('0x53')+_0x5ea0('0x54')+_0x5ea0('0x55');var _0x1f71a0={'uri':_0x3b8098+_0x5ea0('0x56')+_0xbf0e1c+_0x4bef1c};io['to'](util[_0x5ea0('0x57')](_0x5ea0('0x58'),_0x55dc1f))[_0x5ea0('0x59')](_0x5ea0('0x5a'),_0x1f71a0);}exports['cs']=function(_0x419d2d,_0x1df838,_0x4b1280,_0x4d4237,_0x13bcec,_0xf00ba9,_0x47369b,_0x2839e6){var _0x3fcec2={};var _0x458b5b={'user':_0xf00ba9[_0x5ea0('0x5b')],'pass':_0xf00ba9[_0x5ea0('0x5c')]};var _0x15279a='sysparm_limit=1';var _0x154e4c=_0x5ea0('0x5d');_0xf00ba9['remoteUri']=intUtil[_0x5ea0('0x5e')](_0xf00ba9[_0x5ea0('0x5f')]);_0xf00ba9['serverUrl']=intUtil[_0x5ea0('0x5e')](_0xf00ba9['serverUrl']);var _0x741067=util[_0x5ea0('0x57')](_0x5ea0('0x60'),_0xf00ba9[_0x5ea0('0x5f')]);_0x3fcec2[_0x5ea0('0x18')]=!_[_0x5ea0('0x61')](_0x4d4237)?_0x4d4237[_0x5ea0('0x62')]:null;_0x3fcec2[_0x5ea0('0x22')]=_0xf00ba9[_0x5ea0('0x62')];_0x3fcec2[_0x5ea0('0x26')]=_0x2839e6[_0x5ea0('0x36')]()==='outbound'?_0x1df838[_0x5ea0('0x63')]:_0x1df838['calleridnum'];_0x3fcec2[_0x5ea0('0x64')]=_0x2839e6===_0x5ea0('0x65')||_0x2839e6==='unmanaged'?_0x5ea0('0x65'):_0x5ea0('0x40');var _0xc58444=util[_0x5ea0('0x57')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf00ba9[_0x5ea0('0x66')],_0x1df838[_0x5ea0('0x67')],md5(_0x1df838['uniqueid']));if(_0x13bcec&&_0x13bcec[_0x5ea0('0x68')]){logger[_0x5ea0('0x10')](_0x5ea0('0x69'),_0x5ea0('0x6a'));_0x1df838['recordingURL']=_0xc58444;}else if(_0x47369b&&_0x47369b['recordingFormat']&&_0x47369b[_0x5ea0('0x6b')]!=='none'){logger[_0x5ea0('0x10')](_0x5ea0('0x6c'),_0x5ea0('0x6a'));_0x1df838[_0x5ea0('0x6d')]=_0xc58444;}else{_0x1df838[_0x5ea0('0x6d')]='';}return getAdminUser(_0x2839e6,_0x458b5b,_0x3fcec2,_0x741067,_0x154e4c,_0x15279a)['then'](getUser(_0x2839e6,_0x458b5b,_0x741067,_0x154e4c,_0x15279a))[_0x5ea0('0x1b')](getEndUser(_0x2839e6,_0x458b5b,_0x741067,_0x154e4c,_0x15279a))['then'](getTicket(_0x2839e6,_0x458b5b,_0x741067,_0x4b1280,_0x1df838,_0x154e4c))[_0x5ea0('0x1b')](function(_0x5198e7){logger[_0x5ea0('0x10')](util[_0x5ea0('0x57')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5198e7[_0x5ea0('0x4c')]));logger[_0x5ea0('0x10')](util[_0x5ea0('0x57')](_0x5ea0('0x6e'),_0x2839e6));if(_0x2839e6!==_0x5ea0('0x6f')){logger[_0x5ea0('0x10')]('['+[_0x2839e6[_0x5ea0('0x11')]()]+']',_0x5ea0('0x70'));emit(_0xf00ba9[_0x5ea0('0x5f')],_0x4d4237[_0x5ea0('0x3e')],_0x5198e7[_0x5ea0('0x4c')]);}})[_0x5ea0('0x13')](function(_0x4145fd){logger[_0x5ea0('0x14')]('['+[_0x2839e6[_0x5ea0('0x11')]()]+_0x5ea0('0x71'),util[_0x5ea0('0x72')](_0x4145fd,{'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 0d6d7ab..1e0077e 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 _0xb778=['forEach','string','nameField','customField','toLowerCase','content','custom_fields','type','Variable','POST','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','Outbound','Ticket\x20created!','catch','unmanaged','lastevent','isNil','toUpperCase','lodash','request-promise','bluebird','md5','util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','direction','variableName','push','idField','JSON','stringify','Basic\x20%s','apiKey','toString','get_server_info','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','length','find','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','name_value_list','user_id','user_name','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!','set_entry','first_name','','Enduser\x20created.','[HTTP]','merge','map'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0xb778,0x1a7));var _0x8b77=function(_0x549fb4,_0x57140c){_0x549fb4=_0x549fb4-0x0;var _0xc64c37=_0xb778[_0x549fb4];return _0xc64c37;};'use strict';var _=require(_0x8b77('0x0'));var rp=require(_0x8b77('0x1'));var BPromise=require(_0x8b77('0x2'));var md5=require(_0x8b77('0x3'));var util=require(_0x8b77('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x8b77('0x5'))(_0x8b77('0x6'));config[_0x8b77('0x7')]=_[_0x8b77('0x8')](config[_0x8b77('0x7')],{'host':_0x8b77('0x9'),'port':0x18eb});var io=require(_0x8b77('0xa'))(new Redis(config[_0x8b77('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x51bb89,_0x5c3f38,_0x27ad42){io['to'](_0x51bb89)['emit'](_0x5c3f38,_0x27ad42);}function getTicket(_0x1718e3,_0x341e24,_0x1c7bca,_0x16f991,_0x4e12d9,_0x33e4b7,_0x4cb499,_0x44ab58){logger[_0x8b77('0xb')](_0x8b77('0xc'));var _0x578a5e=new Date();var _0x3a4b02=[{'name':_0x8b77('0xd'),'value':intUtil[_0x8b77('0xe')](_0x16f991['Subjects'],_0x4e12d9,'\x20')},{'name':_0x8b77('0xf'),'value':_0x341e24['id']},{'name':_0x8b77('0x10'),'value':_0x341e24['id']},{'name':_0x8b77('0x11'),'value':intUtil['getString'](_0x16f991[_0x8b77('0x12')],_0x4e12d9,'\x0a')},{'name':_0x8b77('0x13'),'value':_0x578a5e[_0x8b77('0x14')]()[_0x8b77('0x15')](0x0,0x13)[_0x8b77('0x16')]('T','\x20')},{'name':_0x8b77('0x17'),'value':'0'},{'name':_0x8b77('0x18'),'value':'15'},{'name':_0x8b77('0x19'),'value':_0x1c7bca['id']},{'name':'parent_type','value':_0x8b77('0x1a')},{'name':_0x8b77('0x1b'),'value':_0x1c7bca[_0x8b77('0xd')]},{'name':_0x8b77('0x1c'),'value':_0x44ab58}];if(_0x33e4b7['length']){_['forEach'](_0x33e4b7,function(_0x1fd012){if(_0x4e12d9[_0x1fd012[_0x8b77('0x1d')]]){_0x3a4b02[_0x8b77('0x1e')]({'name':_0x1fd012[_0x8b77('0x1f')],'value':_0x4e12d9[_0x1fd012[_0x8b77('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x8b77('0x20'),'response_type':_0x8b77('0x20'),'rest_data':JSON[_0x8b77('0x21')]({'session':_0x4cb499['id'],'module_name':'Calls','name_value_list':_0x3a4b02})}});}function getAuth(_0x1150a2){return util['format'](_0x8b77('0x22'),new Buffer(_0x1150a2[_0x8b77('0x23')]+':X')[_0x8b77('0x24')]('base64'));}function getServerInfo(_0x915a04){return request({'form':{'method':_0x8b77('0x25'),'input_type':_0x8b77('0x20'),'response_type':_0x8b77('0x20'),'rest_data':JSON[_0x8b77('0x21')]({'session':_0x915a04['id']})}});}function getUser(_0x3cbd9,_0x1f33e6,_0x57434f){if(!_['isNil'](_0x1f33e6)){logger[_0x8b77('0xb')]('Getting\x20agent\x20with\x20name',_0x1f33e6);return request({'form':{'method':_0x8b77('0x26'),'input_type':_0x8b77('0x20'),'response_type':_0x8b77('0x20'),'rest_data':JSON[_0x8b77('0x21')]({'session':_0x57434f['id'],'module_name':_0x8b77('0x27'),'query':util[_0x8b77('0x28')](_0x8b77('0x29'),_0x1f33e6),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8b77('0x2a')](function(_0x350084){if(_0x350084[_0x8b77('0x2b')][_0x8b77('0x2c')]){var _0x504c01=_[_0x8b77('0x2d')](_0x350084[_0x8b77('0x2b')],function(_0x439b06){return _0x439b06['name_value_list']['user_name'][_0x8b77('0x2e')]===_0x1f33e6;});if(_0x504c01){logger['info']('Agent\x20found!');return BPromise[_0x8b77('0x2f')]({'id':_0x504c01['name_value_list']['id'][_0x8b77('0x2e')],'name':_0x504c01['name_value_list'][_0x8b77('0xd')][_0x8b77('0x2e')]});}}logger['info'](_0x8b77('0x30'));return BPromise[_0x8b77('0x2f')]({'id':_0x57434f[_0x8b77('0x31')][_0x8b77('0x32')][_0x8b77('0x2e')],'name':_0x57434f[_0x8b77('0x31')][_0x8b77('0x33')][_0x8b77('0x2e')]});});}else{logger[_0x8b77('0xb')](_0x8b77('0x34'));return BPromise[_0x8b77('0x2f')]({'id':_0x57434f[_0x8b77('0x31')][_0x8b77('0x32')][_0x8b77('0x2e')],'name':_0x57434f[_0x8b77('0x31')][_0x8b77('0x33')][_0x8b77('0x2e')]});}}function getEndUser(_0x4d7926,_0x432bcd,_0x186668,_0x13045e){logger['info'](_0x8b77('0x35'),_0x186668);return request({'form':{'method':_0x8b77('0x26'),'input_type':_0x8b77('0x20'),'response_type':_0x8b77('0x20'),'rest_data':JSON[_0x8b77('0x21')]({'session':_0x13045e['id'],'module_name':_0x8b77('0x1a'),'query':util[_0x8b77('0x28')](_0x8b77('0x36'),_0x186668),'order_by':'','offset':'0','select_fields':['id',_0x8b77('0xd'),_0x8b77('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2f10e7){if(_0x2f10e7[_0x8b77('0x2b')]['length']){var _0xa07b81=_[_0x8b77('0x2d')](_0x2f10e7[_0x8b77('0x2b')],function(_0x4783d5){return _0x4783d5['name_value_list'][_0x8b77('0x37')]['value']===_0x186668;});if(_0xa07b81){logger[_0x8b77('0xb')](_0x8b77('0x38'));return BPromise[_0x8b77('0x2f')]({'id':_0xa07b81[_0x8b77('0x31')]['id'][_0x8b77('0x2e')],'name':_0xa07b81[_0x8b77('0x31')][_0x8b77('0xd')][_0x8b77('0x2e')],'phone':_0xa07b81[_0x8b77('0x31')][_0x8b77('0x37')][_0x8b77('0x2e')]});}}else{logger[_0x8b77('0xb')](_0x8b77('0x39'));return request({'form':{'method':_0x8b77('0x3a'),'input_type':'JSON','response_type':_0x8b77('0x20'),'rest_data':JSON[_0x8b77('0x21')]({'session':_0x13045e['id'],'module_name':_0x8b77('0x1a'),'name_value_list':[{'name':_0x8b77('0x3b'),'value':_0x432bcd!==_0x8b77('0x3c')?_0x432bcd:util[_0x8b77('0x28')]('Caller\x20-\x20%s',_0x186668)},{'name':'phone_home','value':_0x186668}]})}})[_0x8b77('0x2a')](function(_0x5b1517){logger[_0x8b77('0xb')](_0x8b77('0x3d'));return BPromise[_0x8b77('0x2f')]({'id':_0x5b1517['id'],'name':_0x5b1517['entry_list'][_0x8b77('0x3b')][_0x8b77('0x2e')],'phone':_0x5b1517['entry_list']['phone_home'][_0x8b77('0x2e')]});});}});}function request(_0x4533ad){logger['debug'](_0x8b77('0x3e'),JSON[_0x8b77('0x21')](_0x4533ad));return rp(_[_0x8b77('0x3f')](def,_0x4533ad));}function getTags(_0x644857,_0x48c5ed){var _0x53225d=[];if(_0x644857&&_0x644857[_0x8b77('0x2c')]>0x0){_0x53225d=_[_0x8b77('0x40')](_0x644857,_0x48c5ed);}return _0x53225d;}function getCustomFields(_0x4ced35,_0x2e40e4){var _0x6332d9=[];var _0x3908a3={'custom_fields':[]};if(_0x4ced35[_0x8b77('0x2c')]>0x0){_[_0x8b77('0x41')](_0x4ced35,function(_0x144564){if(_0x144564['type']===_0x8b77('0x42')&&_0x144564[_0x8b77('0x43')]&&!_0x144564[_0x8b77('0x44')]){_0x3908a3[_0x144564['nameField'][_0x8b77('0x45')]()]=_0x144564[_0x8b77('0x46')][_0x8b77('0x24')]();}else if(_0x144564['type']==='string'&&_0x144564[_0x8b77('0x1f')]&&_0x144564[_0x8b77('0x44')]){_0x3908a3[_0x8b77('0x47')][_0x8b77('0x1e')]({'id':_0x144564[_0x8b77('0x1f')],'value':_0x144564[_0x8b77('0x46')][_0x8b77('0x24')]()});}else if(_0x144564[_0x8b77('0x48')]==='variable'&&_0x144564[_0x8b77('0x1d')]&&_0x144564[_0x8b77('0x1f')]&&_0x144564[_0x8b77('0x44')]){_0x2e40e4[_0x144564[_0x8b77('0x1d')]]&&_0x3908a3['custom_fields'][_0x8b77('0x1e')]({'id':_0x144564[_0x8b77('0x1f')],'value':_0x2e40e4[_0x144564['variableName']][_0x8b77('0x24')]()});}else if(_0x144564[_0x8b77('0x48')]==='customVariable'&&_0x144564[_0x8b77('0x49')]&&_0x144564[_0x8b77('0x49')][_0x8b77('0xd')]&&_0x144564[_0x8b77('0x1f')]&&_0x144564[_0x8b77('0x44')]){_0x2e40e4[_0x144564[_0x8b77('0x49')][_0x8b77('0xd')][_0x8b77('0x45')]()]&&_0x3908a3['custom_fields']['push']({'id':_0x144564[_0x8b77('0x1f')],'value':_0x2e40e4[_0x144564[_0x8b77('0x49')]['name'][_0x8b77('0x45')]()][_0x8b77('0x24')]()});}});}return _0x3908a3;}function getConnection(_0x4ed3ae){return request({'method':_0x8b77('0x4a'),'form':{'method':_0x8b77('0x4b'),'input_type':_0x8b77('0x20'),'response_type':_0x8b77('0x20'),'rest_data':JSON[_0x8b77('0x21')]({'user_auth':{'user_name':_0x4ed3ae[_0x8b77('0x4c')],'password':_0x4ed3ae[_0x8b77('0x4d')],'encryption':_0x8b77('0x4e')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x39b827){var _0x2ac91c=_0x39b827;if(_0x2ac91c['id']){def[_0x8b77('0x4f')]=_0x2ac91c['id'];return BPromise[_0x8b77('0x2f')](_0x2ac91c);}else{throw new Error(util[_0x8b77('0x28')](_0x8b77('0x50'),_0x4ed3ae['id']));}});}function setRelationship(_0x5f13a0,_0x7cde18,_0x9cd8e9,_0x58d022){return request({'form':{'method':_0x8b77('0x51'),'input_type':_0x8b77('0x20'),'response_type':_0x8b77('0x20'),'rest_data':JSON[_0x8b77('0x21')]({'session':_0x5f13a0['id'],'module_name':_0x8b77('0x52'),'module_id':_0x9cd8e9['id'],'link_field_name':_0x58d022,'related_ids':[_0x7cde18['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x4d2d1d,_0x2de1d1,_0x52fe68,_0x3296f6,_0x49783d,_0x26e5b8){var _0x2abe34,_0x372e3e,_0x54152c,_0x1f5495;_0x26e5b8[_0x8b77('0x53')]=intUtil[_0x8b77('0x54')](_0x26e5b8['remoteUri']);_0x26e5b8[_0x8b77('0x55')]=intUtil[_0x8b77('0x54')](_0x26e5b8[_0x8b77('0x55')]);def[_0x8b77('0x56')]=util['format'](_0x8b77('0x57'),_0x26e5b8['remoteUri']);if(_0x49783d&&_0x49783d[_0x8b77('0x58')]){logger[_0x8b77('0xb')](_0x8b77('0x59'),'Recording\x20is\x20enabled!');_0x2de1d1[_0x8b77('0x5a')]=util[_0x8b77('0x28')](_0x8b77('0x5b'),_0x26e5b8[_0x8b77('0x55')],_0x2de1d1[_0x8b77('0x5c')],md5(_0x2de1d1[_0x8b77('0x5c')]));}else{_0x2de1d1[_0x8b77('0x5a')]='';}return getConnection(_0x26e5b8)[_0x8b77('0x2a')](function(_0x5d26be){_0x1f5495=_0x5d26be;return getUser(_0x26e5b8,_0x3296f6[_0x8b77('0xd')],_0x1f5495);})[_0x8b77('0x2a')](function(_0x47c641){_0x2abe34=_0x47c641;logger[_0x8b77('0xb')](_0x8b77('0x5d'),_0x2abe34['id']);return getEndUser(_0x26e5b8,_0x2de1d1[_0x8b77('0x5e')],_0x2de1d1[_0x8b77('0x5f')],_0x1f5495);})[_0x8b77('0x2a')](function(_0x37f081){_0x372e3e=_0x37f081;logger[_0x8b77('0xb')](_0x8b77('0x60'),_0x372e3e['id']);return getTicket(_0x26e5b8,_0x2abe34,_0x372e3e,_0x52fe68,_0x2de1d1,_0x52fe68[_0x8b77('0x61')],_0x1f5495,_0x8b77('0x62'));})[_0x8b77('0x2a')](function(_0xa94057){_0x54152c=_0xa94057;logger['info']('Ticket\x20created!');logger[_0x8b77('0xb')](_0x8b77('0x63'),_0x54152c['id']);return setRelationship(_0x1f5495,_0x2abe34,_0x54152c,_0x8b77('0x64'));})[_0x8b77('0x2a')](function(){return setRelationship(_0x1f5495,_0x372e3e,_0x54152c,_0x8b77('0x65'));})[_0x8b77('0x2a')](function(){return getServerInfo(_0x1f5495);})[_0x8b77('0x2a')](function(_0xf79980){var _0x367c98=parseInt(_0xf79980[_0x8b77('0x66')][_0x8b77('0x67')](0x0));var _0x51150c=util[_0x8b77('0x28')](_0x8b77('0x68'),_0x26e5b8[_0x8b77('0x53')],_0x54152c['id']);if(_0x367c98>0x6){_0x51150c=util[_0x8b77('0x28')](_0x8b77('0x69'),_0x26e5b8[_0x8b77('0x53')],_0x54152c['id']);}logger['info'](_0x8b77('0x59'),_0x8b77('0x6a'));emit(util[_0x8b77('0x28')](_0x8b77('0x6b'),_0x3296f6[_0x8b77('0xd')]),_0x8b77('0x6c'),{'uri':_0x51150c});})['catch'](function(_0x827572){logger[_0x8b77('0x6d')]('[QUEUE]',JSON[_0x8b77('0x21')](_0x827572));});};exports[_0x8b77('0x6e')]=function(_0x360bf1,_0x5d6989,_0x31ae7d,_0x7efa03,_0x66e27,_0x2f942c,_0x3d7ccc){var _0x4abc92,_0x389df4,_0x31d7b5,_0x491d1b;_0x2f942c['remoteUri']=intUtil[_0x8b77('0x54')](_0x2f942c[_0x8b77('0x53')]);_0x2f942c[_0x8b77('0x55')]=intUtil[_0x8b77('0x54')](_0x2f942c[_0x8b77('0x55')]);def[_0x8b77('0x56')]=util[_0x8b77('0x28')]('%s/service/v4_1/rest.php',_0x2f942c[_0x8b77('0x53')]);if(_0x3d7ccc&&_0x3d7ccc['recordingFormat']&&_0x3d7ccc[_0x8b77('0x6f')]!=='none'){logger[_0x8b77('0xb')](_0x8b77('0x70'),_0x8b77('0x71'));_0x5d6989[_0x8b77('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f942c[_0x8b77('0x55')],_0x5d6989[_0x8b77('0x5c')],md5(_0x5d6989[_0x8b77('0x5c')]));}return getConnection(_0x2f942c)[_0x8b77('0x2a')](function(_0xe28ee1){_0x491d1b=_0xe28ee1;return getUser(_0x2f942c,_0x7efa03[_0x8b77('0xd')],_0x491d1b);})['then'](function(_0x335586){_0x4abc92=_0x335586;logger[_0x8b77('0xb')]('The\x20User\x20ID\x20is:',_0x4abc92['id']);return getEndUser(_0x2f942c,_0x5d6989['destcalleridname'],_0x5d6989[_0x8b77('0x72')],_0x491d1b);})['then'](function(_0x1952f9){_0x389df4=_0x1952f9;logger['info']('The\x20Enduser\x20ID\x20is:',_0x389df4['id']);return getTicket(_0x2f942c,_0x4abc92,_0x389df4,_0x31ae7d,_0x5d6989,_0x31ae7d[_0x8b77('0x61')],_0x491d1b,_0x8b77('0x73'));})['then'](function(_0x1f729b){_0x31d7b5=_0x1f729b;logger[_0x8b77('0xb')](_0x8b77('0x74'));logger[_0x8b77('0xb')](_0x8b77('0x63'),_0x31d7b5['id']);return setRelationship(_0x491d1b,_0x4abc92,_0x31d7b5,'users');})[_0x8b77('0x2a')](function(){return setRelationship(_0x491d1b,_0x389df4,_0x31d7b5,_0x8b77('0x65'));})[_0x8b77('0x2a')](function(){return getServerInfo(_0x491d1b);})[_0x8b77('0x2a')](function(_0x184940){var _0x92a080=parseInt(_0x184940['version'][_0x8b77('0x67')](0x0));var _0x4c1557=util[_0x8b77('0x28')](_0x8b77('0x68'),_0x2f942c[_0x8b77('0x53')],_0x31d7b5['id']);if(_0x92a080>0x6){_0x4c1557=util['format'](_0x8b77('0x69'),_0x2f942c['remoteUri'],_0x31d7b5['id']);}logger[_0x8b77('0xb')](_0x8b77('0x70'),_0x8b77('0x6a'));emit(util[_0x8b77('0x28')](_0x8b77('0x6b'),_0x7efa03['name']),_0x8b77('0x6c'),{'uri':_0x4c1557});})[_0x8b77('0x75')](function(_0x5f40ee){logger['error'](_0x8b77('0x70'),JSON[_0x8b77('0x21')](_0x5f40ee));});};exports[_0x8b77('0x76')]=function(_0x5f0067,_0x418858,_0x3d93a9,_0x5e2119,_0x14ef70,_0x2825ed){var _0x4c9269,_0x49210a,_0x282797,_0x5007c5;_0x2825ed[_0x8b77('0x53')]=intUtil['stripTrailingSlash'](_0x2825ed['remoteUri']);_0x2825ed[_0x8b77('0x55')]=intUtil[_0x8b77('0x54')](_0x2825ed[_0x8b77('0x55')]);def[_0x8b77('0x56')]=util[_0x8b77('0x28')](_0x8b77('0x57'),_0x2825ed[_0x8b77('0x53')]);if(_0x14ef70&&_0x14ef70[_0x8b77('0x58')]){logger[_0x8b77('0xb')]('['+_0x418858[_0x8b77('0x77')]['toUpperCase']()+']',_0x8b77('0x71'));_0x418858[_0x8b77('0x5a')]=util[_0x8b77('0x28')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2825ed[_0x8b77('0x55')],_0x418858[_0x8b77('0x5c')],md5(_0x418858[_0x8b77('0x5c')]));}else{_0x418858[_0x8b77('0x5a')]='';}return getConnection(_0x2825ed)[_0x8b77('0x2a')](function(_0x497ebd){_0x5007c5=_0x497ebd;if(!_[_0x8b77('0x78')](_0x5e2119)){return getUser(_0x2825ed,_0x5e2119[_0x8b77('0xd')],_0x5007c5);}else{return getUser(_0x2825ed,null,_0x5007c5);}})['then'](function(_0x5bb803){_0x4c9269=_0x5bb803;logger['info'](_0x8b77('0x5d'),_0x4c9269['id']);return getEndUser(_0x2825ed,_0x418858[_0x8b77('0x5e')],_0x418858['calleridnum'],_0x5007c5);})[_0x8b77('0x2a')](function(_0x262ef8){_0x49210a=_0x262ef8;logger[_0x8b77('0xb')]('The\x20Enduser\x20ID\x20is:',_0x49210a['id']);return getTicket(_0x2825ed,_0x4c9269,_0x49210a,_0x3d93a9,_0x418858,_0x3d93a9[_0x8b77('0x61')],_0x5007c5,'Inbound');})[_0x8b77('0x2a')](function(_0x26a2fa){_0x282797=_0x26a2fa;logger[_0x8b77('0xb')](_0x8b77('0x74'));logger[_0x8b77('0xb')]('The\x20Ticket\x20ID\x20is:',_0x282797['id']);return setRelationship(_0x5007c5,_0x4c9269,_0x282797,'users');})[_0x8b77('0x2a')](function(){return setRelationship(_0x5007c5,_0x49210a,_0x282797,'contacts');})[_0x8b77('0x2a')](function(){return getServerInfo(_0x5007c5);})[_0x8b77('0x75')](function(_0x2df5c8){logger[_0x8b77('0x6d')]('['+_0x418858[_0x8b77('0x77')][_0x8b77('0x79')]()+']',JSON[_0x8b77('0x21')](_0x2df5c8));});}; \ No newline at end of file +var _0xd0fb=['recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','users','user:%s','unmanaged','%s/service/v4_1/rest.php','lastevent','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','POST','emit','info','name','getString','Subjects','created_by','Descriptions','date_start','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','Calls','format','apiKey','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','value','Agent\x20found!','resolve','name_value_list','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','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','toString','idField','customField','custom_fields','content','variable','customVariable','Variable','toLowerCase','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound'];(function(_0x2f1779,_0x11ff93){var _0x16a347=function(_0x1f3584){while(--_0x1f3584){_0x2f1779['push'](_0x2f1779['shift']());}};_0x16a347(++_0x11ff93);}(_0xd0fb,0x1ef));var _0xbd0f=function(_0xa53e5f,_0x28d322){_0xa53e5f=_0xa53e5f-0x0;var _0x649f99=_0xd0fb[_0xa53e5f];return _0x649f99;};'use strict';var _=require('lodash');var rp=require(_0xbd0f('0x0'));var BPromise=require(_0xbd0f('0x1'));var md5=require('md5');var util=require(_0xbd0f('0x2'));var Redis=require(_0xbd0f('0x3'));var intUtil=require(_0xbd0f('0x4'));var config=require(_0xbd0f('0x5'));var logger=require(_0xbd0f('0x6'))('sugarcrm');config[_0xbd0f('0x7')]=_['defaults'](config[_0xbd0f('0x7')],{'host':_0xbd0f('0x8'),'port':0x18eb});var io=require(_0xbd0f('0x9'))(new Redis(config[_0xbd0f('0x7')]));var def={'method':_0xbd0f('0xa'),'json':!![]};function emit(_0x23ba06,_0x32b466,_0x1082a0){io['to'](_0x23ba06)[_0xbd0f('0xb')](_0x32b466,_0x1082a0);}function getTicket(_0x156fff,_0x1a3b9a,_0x4a7d01,_0x287b16,_0x18affc,_0x3ffc42,_0x3d4870,_0x2d05f7){logger[_0xbd0f('0xc')]('Creating\x20new\x20ticket...');var _0xc6129c=new Date();var _0x34b98c=[{'name':_0xbd0f('0xd'),'value':intUtil[_0xbd0f('0xe')](_0x287b16[_0xbd0f('0xf')],_0x18affc,'\x20')},{'name':'assigned_user_id','value':_0x1a3b9a['id']},{'name':_0xbd0f('0x10'),'value':_0x1a3b9a['id']},{'name':'description','value':intUtil[_0xbd0f('0xe')](_0x287b16[_0xbd0f('0x11')],_0x18affc,'\x0a')},{'name':_0xbd0f('0x12'),'value':_0xc6129c['toISOString']()[_0xbd0f('0x13')](0x0,0x13)[_0xbd0f('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xbd0f('0x15'),'value':'15'},{'name':_0xbd0f('0x16'),'value':_0x4a7d01['id']},{'name':_0xbd0f('0x17'),'value':_0xbd0f('0x18')},{'name':_0xbd0f('0x19'),'value':_0x4a7d01[_0xbd0f('0xd')]},{'name':_0xbd0f('0x1a'),'value':_0x2d05f7}];if(_0x3ffc42[_0xbd0f('0x1b')]){_[_0xbd0f('0x1c')](_0x3ffc42,function(_0x555442){if(_0x18affc[_0x555442[_0xbd0f('0x1d')]]){_0x34b98c[_0xbd0f('0x1e')]({'name':_0x555442['idField'],'value':_0x18affc[_0x555442[_0xbd0f('0x1d')]]});}});}return request({'form':{'method':_0xbd0f('0x1f'),'input_type':_0xbd0f('0x20'),'response_type':_0xbd0f('0x20'),'rest_data':JSON['stringify']({'session':_0x3d4870['id'],'module_name':_0xbd0f('0x21'),'name_value_list':_0x34b98c})}});}function getAuth(_0x104e01){return util[_0xbd0f('0x22')]('Basic\x20%s',new Buffer(_0x104e01[_0xbd0f('0x23')]+':X')['toString'](_0xbd0f('0x24')));}function getServerInfo(_0x54059c){return request({'form':{'method':_0xbd0f('0x25'),'input_type':_0xbd0f('0x20'),'response_type':'JSON','rest_data':JSON[_0xbd0f('0x26')]({'session':_0x54059c['id']})}});}function getUser(_0x278b85,_0x2a204d,_0x20dd8b){if(!_[_0xbd0f('0x27')](_0x2a204d)){logger[_0xbd0f('0xc')](_0xbd0f('0x28'),_0x2a204d);return request({'form':{'method':_0xbd0f('0x29'),'input_type':_0xbd0f('0x20'),'response_type':_0xbd0f('0x20'),'rest_data':JSON['stringify']({'session':_0x20dd8b['id'],'module_name':'Employees','query':util[_0xbd0f('0x22')](_0xbd0f('0x2a'),_0x2a204d),'order_by':'','offset':'0','select_fields':['id',_0xbd0f('0xd'),_0xbd0f('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5a5a33){if(_0x5a5a33[_0xbd0f('0x2c')][_0xbd0f('0x1b')]){var _0x5f060f=_['find'](_0x5a5a33['entry_list'],function(_0x1851fb){return _0x1851fb['name_value_list'][_0xbd0f('0x2b')][_0xbd0f('0x2d')]===_0x2a204d;});if(_0x5f060f){logger[_0xbd0f('0xc')](_0xbd0f('0x2e'));return BPromise[_0xbd0f('0x2f')]({'id':_0x5f060f[_0xbd0f('0x30')]['id'][_0xbd0f('0x2d')],'name':_0x5f060f[_0xbd0f('0x30')][_0xbd0f('0xd')]['value']});}}logger[_0xbd0f('0xc')](_0xbd0f('0x31'));return BPromise[_0xbd0f('0x2f')]({'id':_0x20dd8b[_0xbd0f('0x30')][_0xbd0f('0x32')][_0xbd0f('0x2d')],'name':_0x20dd8b[_0xbd0f('0x30')][_0xbd0f('0x2b')][_0xbd0f('0x2d')]});});}else{logger['info'](_0xbd0f('0x33'));return BPromise[_0xbd0f('0x2f')]({'id':_0x20dd8b[_0xbd0f('0x30')][_0xbd0f('0x32')][_0xbd0f('0x2d')],'name':_0x20dd8b[_0xbd0f('0x30')][_0xbd0f('0x2b')][_0xbd0f('0x2d')]});}}function getEndUser(_0x207fc6,_0x4c9d49,_0x12ee0d,_0x1e3631){logger[_0xbd0f('0xc')](_0xbd0f('0x34'),_0x12ee0d);return request({'form':{'method':_0xbd0f('0x29'),'input_type':_0xbd0f('0x20'),'response_type':_0xbd0f('0x20'),'rest_data':JSON['stringify']({'session':_0x1e3631['id'],'module_name':'Contacts','query':util[_0xbd0f('0x22')](_0xbd0f('0x35'),_0x12ee0d),'order_by':'','offset':'0','select_fields':['id','name',_0xbd0f('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xbd0f('0x37')](function(_0x44d402){if(_0x44d402['entry_list'][_0xbd0f('0x1b')]){var _0x5f3fd9=_[_0xbd0f('0x38')](_0x44d402['entry_list'],function(_0x2eca5c){return _0x2eca5c[_0xbd0f('0x30')][_0xbd0f('0x36')][_0xbd0f('0x2d')]===_0x12ee0d;});if(_0x5f3fd9){logger[_0xbd0f('0xc')](_0xbd0f('0x39'));return BPromise[_0xbd0f('0x2f')]({'id':_0x5f3fd9[_0xbd0f('0x30')]['id'][_0xbd0f('0x2d')],'name':_0x5f3fd9[_0xbd0f('0x30')][_0xbd0f('0xd')][_0xbd0f('0x2d')],'phone':_0x5f3fd9[_0xbd0f('0x30')][_0xbd0f('0x36')][_0xbd0f('0x2d')]});}}else{logger[_0xbd0f('0xc')](_0xbd0f('0x3a'));return request({'form':{'method':'set_entry','input_type':_0xbd0f('0x20'),'response_type':_0xbd0f('0x20'),'rest_data':JSON[_0xbd0f('0x26')]({'session':_0x1e3631['id'],'module_name':_0xbd0f('0x18'),'name_value_list':[{'name':_0xbd0f('0x3b'),'value':_0x4c9d49!==_0xbd0f('0x3c')?_0x4c9d49:util[_0xbd0f('0x22')](_0xbd0f('0x3d'),_0x12ee0d)},{'name':_0xbd0f('0x36'),'value':_0x12ee0d}]})}})[_0xbd0f('0x37')](function(_0x2e53d3){logger[_0xbd0f('0xc')]('Enduser\x20created.');return BPromise[_0xbd0f('0x2f')]({'id':_0x2e53d3['id'],'name':_0x2e53d3[_0xbd0f('0x2c')][_0xbd0f('0x3b')][_0xbd0f('0x2d')],'phone':_0x2e53d3[_0xbd0f('0x2c')][_0xbd0f('0x36')][_0xbd0f('0x2d')]});});}});}function request(_0xaaabab){logger[_0xbd0f('0x3e')](_0xbd0f('0x3f'),JSON[_0xbd0f('0x26')](_0xaaabab));return rp(_[_0xbd0f('0x40')](def,_0xaaabab));}function getTags(_0x25a8b0,_0x5a810e){var _0x3bdf71=[];if(_0x25a8b0&&_0x25a8b0[_0xbd0f('0x1b')]>0x0){_0x3bdf71=_[_0xbd0f('0x41')](_0x25a8b0,_0x5a810e);}return _0x3bdf71;}function getCustomFields(_0x1b23ec,_0x3f53d3){var _0x4da7a6=[];var _0x21908a={'custom_fields':[]};if(_0x1b23ec[_0xbd0f('0x1b')]>0x0){_[_0xbd0f('0x1c')](_0x1b23ec,function(_0x16694d){if(_0x16694d[_0xbd0f('0x42')]===_0xbd0f('0x43')&&_0x16694d[_0xbd0f('0x44')]&&!_0x16694d['customField']){_0x21908a[_0x16694d[_0xbd0f('0x44')]['toLowerCase']()]=_0x16694d['content'][_0xbd0f('0x45')]();}else if(_0x16694d[_0xbd0f('0x42')]===_0xbd0f('0x43')&&_0x16694d[_0xbd0f('0x46')]&&_0x16694d[_0xbd0f('0x47')]){_0x21908a[_0xbd0f('0x48')][_0xbd0f('0x1e')]({'id':_0x16694d[_0xbd0f('0x46')],'value':_0x16694d[_0xbd0f('0x49')][_0xbd0f('0x45')]()});}else if(_0x16694d['type']===_0xbd0f('0x4a')&&_0x16694d['variableName']&&_0x16694d['idField']&&_0x16694d[_0xbd0f('0x47')]){_0x3f53d3[_0x16694d[_0xbd0f('0x1d')]]&&_0x21908a[_0xbd0f('0x48')][_0xbd0f('0x1e')]({'id':_0x16694d[_0xbd0f('0x46')],'value':_0x3f53d3[_0x16694d[_0xbd0f('0x1d')]][_0xbd0f('0x45')]()});}else if(_0x16694d[_0xbd0f('0x42')]===_0xbd0f('0x4b')&&_0x16694d[_0xbd0f('0x4c')]&&_0x16694d[_0xbd0f('0x4c')][_0xbd0f('0xd')]&&_0x16694d[_0xbd0f('0x46')]&&_0x16694d[_0xbd0f('0x47')]){_0x3f53d3[_0x16694d[_0xbd0f('0x4c')][_0xbd0f('0xd')][_0xbd0f('0x4d')]()]&&_0x21908a[_0xbd0f('0x48')][_0xbd0f('0x1e')]({'id':_0x16694d[_0xbd0f('0x46')],'value':_0x3f53d3[_0x16694d[_0xbd0f('0x4c')][_0xbd0f('0xd')]['toLowerCase']()][_0xbd0f('0x45')]()});}});}return _0x21908a;}function getConnection(_0x52f99f){return request({'method':'POST','form':{'method':'login','input_type':_0xbd0f('0x20'),'response_type':'JSON','rest_data':JSON[_0xbd0f('0x26')]({'user_auth':{'user_name':_0x52f99f[_0xbd0f('0x4e')],'password':_0x52f99f[_0xbd0f('0x4f')],'encryption':_0xbd0f('0x50')},'application':_0xbd0f('0x51')})}})[_0xbd0f('0x37')](function(_0x46f7bc){var _0x57b551=_0x46f7bc;if(_0x57b551['id']){def[_0xbd0f('0x52')]=_0x57b551['id'];return BPromise[_0xbd0f('0x2f')](_0x57b551);}else{throw new Error(util[_0xbd0f('0x22')]('Account\x20%d\x20is\x20not\x20valid',_0x52f99f['id']));}});}function setRelationship(_0x452e6a,_0x5086f8,_0x133997,_0x837d0e){return request({'form':{'method':_0xbd0f('0x53'),'input_type':_0xbd0f('0x20'),'response_type':_0xbd0f('0x20'),'rest_data':JSON[_0xbd0f('0x26')]({'session':_0x452e6a['id'],'module_name':_0xbd0f('0x21'),'module_id':_0x133997['id'],'link_field_name':_0x837d0e,'related_ids':[_0x5086f8['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5689a1,_0x4e6f66,_0x5d34c5,_0x3a3e43,_0x1cb941,_0x486be1){var _0x424e25,_0x58f299,_0x258ff7,_0x1312ef;_0x486be1[_0xbd0f('0x54')]=intUtil[_0xbd0f('0x55')](_0x486be1['remoteUri']);_0x486be1['serverUrl']=intUtil[_0xbd0f('0x55')](_0x486be1[_0xbd0f('0x56')]);def[_0xbd0f('0x57')]=util[_0xbd0f('0x22')]('%s/service/v4_1/rest.php',_0x486be1[_0xbd0f('0x54')]);if(_0x1cb941&&_0x1cb941[_0xbd0f('0x58')]){logger[_0xbd0f('0xc')](_0xbd0f('0x59'),'Recording\x20is\x20enabled!');_0x4e6f66['recordingURL']=util[_0xbd0f('0x22')](_0xbd0f('0x5a'),_0x486be1[_0xbd0f('0x56')],_0x4e6f66[_0xbd0f('0x5b')],md5(_0x4e6f66['uniqueid']));}else{_0x4e6f66[_0xbd0f('0x5c')]='';}return getConnection(_0x486be1)['then'](function(_0x28380c){_0x1312ef=_0x28380c;return getUser(_0x486be1,_0x3a3e43[_0xbd0f('0xd')],_0x1312ef);})[_0xbd0f('0x37')](function(_0x31b176){_0x424e25=_0x31b176;logger[_0xbd0f('0xc')]('The\x20User\x20ID\x20is:',_0x424e25['id']);return getEndUser(_0x486be1,_0x4e6f66[_0xbd0f('0x5d')],_0x4e6f66[_0xbd0f('0x5e')],_0x1312ef);})['then'](function(_0x7d991b){_0x58f299=_0x7d991b;logger['info'](_0xbd0f('0x5f'),_0x58f299['id']);return getTicket(_0x486be1,_0x424e25,_0x58f299,_0x5d34c5,_0x4e6f66,_0x5d34c5[_0xbd0f('0x60')],_0x1312ef,_0xbd0f('0x61'));})[_0xbd0f('0x37')](function(_0x3c0237){_0x258ff7=_0x3c0237;logger[_0xbd0f('0xc')](_0xbd0f('0x62'));logger[_0xbd0f('0xc')](_0xbd0f('0x63'),_0x258ff7['id']);return setRelationship(_0x1312ef,_0x424e25,_0x258ff7,'users');})[_0xbd0f('0x37')](function(){return setRelationship(_0x1312ef,_0x58f299,_0x258ff7,_0xbd0f('0x64'));})[_0xbd0f('0x37')](function(){return getServerInfo(_0x1312ef);})['then'](function(_0x2fb536){var _0x2c6c02=parseInt(_0x2fb536[_0xbd0f('0x65')][_0xbd0f('0x66')](0x0));var _0x21768d=util['format'](_0xbd0f('0x67'),_0x486be1[_0xbd0f('0x54')],_0x258ff7['id']);if(_0x2c6c02>0x6){_0x21768d=util[_0xbd0f('0x22')](_0xbd0f('0x68'),_0x486be1[_0xbd0f('0x54')],_0x258ff7['id']);}logger[_0xbd0f('0xc')](_0xbd0f('0x59'),_0xbd0f('0x69'));emit(util[_0xbd0f('0x22')]('user:%s',_0x3a3e43[_0xbd0f('0xd')]),_0xbd0f('0x6a'),{'uri':_0x21768d});})[_0xbd0f('0x6b')](function(_0x3a2f54){logger[_0xbd0f('0x6c')](_0xbd0f('0x59'),JSON[_0xbd0f('0x26')](_0x3a2f54));});};exports[_0xbd0f('0x6d')]=function(_0x2bf8c7,_0x5b8035,_0xbc3fef,_0x5222e1,_0x596119,_0x5816d1,_0x2f0973){var _0x1f50c1,_0x3fae59,_0x3b4065,_0x485770;_0x5816d1[_0xbd0f('0x54')]=intUtil[_0xbd0f('0x55')](_0x5816d1['remoteUri']);_0x5816d1[_0xbd0f('0x56')]=intUtil[_0xbd0f('0x55')](_0x5816d1[_0xbd0f('0x56')]);def[_0xbd0f('0x57')]=util[_0xbd0f('0x22')]('%s/service/v4_1/rest.php',_0x5816d1[_0xbd0f('0x54')]);if(_0x2f0973&&_0x2f0973[_0xbd0f('0x6e')]&&_0x2f0973[_0xbd0f('0x6e')]!=='none'){logger[_0xbd0f('0xc')](_0xbd0f('0x6f'),_0xbd0f('0x70'));_0x5b8035[_0xbd0f('0x5c')]=util[_0xbd0f('0x22')](_0xbd0f('0x5a'),_0x5816d1[_0xbd0f('0x56')],_0x5b8035[_0xbd0f('0x5b')],md5(_0x5b8035['uniqueid']));}return getConnection(_0x5816d1)[_0xbd0f('0x37')](function(_0x5d547f){_0x485770=_0x5d547f;return getUser(_0x5816d1,_0x5222e1['name'],_0x485770);})[_0xbd0f('0x37')](function(_0x3b80f2){_0x1f50c1=_0x3b80f2;logger[_0xbd0f('0xc')](_0xbd0f('0x71'),_0x1f50c1['id']);return getEndUser(_0x5816d1,_0x5b8035[_0xbd0f('0x72')],_0x5b8035[_0xbd0f('0x73')],_0x485770);})[_0xbd0f('0x37')](function(_0x555feb){_0x3fae59=_0x555feb;logger[_0xbd0f('0xc')](_0xbd0f('0x5f'),_0x3fae59['id']);return getTicket(_0x5816d1,_0x1f50c1,_0x3fae59,_0xbc3fef,_0x5b8035,_0xbc3fef[_0xbd0f('0x60')],_0x485770,'Outbound');})['then'](function(_0x70d2c1){_0x3b4065=_0x70d2c1;logger['info'](_0xbd0f('0x62'));logger[_0xbd0f('0xc')](_0xbd0f('0x63'),_0x3b4065['id']);return setRelationship(_0x485770,_0x1f50c1,_0x3b4065,_0xbd0f('0x74'));})['then'](function(){return setRelationship(_0x485770,_0x3fae59,_0x3b4065,_0xbd0f('0x64'));})[_0xbd0f('0x37')](function(){return getServerInfo(_0x485770);})[_0xbd0f('0x37')](function(_0x8681de){var _0x2fe96f=parseInt(_0x8681de[_0xbd0f('0x65')]['charAt'](0x0));var _0x50e24a=util[_0xbd0f('0x22')](_0xbd0f('0x67'),_0x5816d1[_0xbd0f('0x54')],_0x3b4065['id']);if(_0x2fe96f>0x6){_0x50e24a=util[_0xbd0f('0x22')](_0xbd0f('0x68'),_0x5816d1[_0xbd0f('0x54')],_0x3b4065['id']);}logger['info'](_0xbd0f('0x6f'),_0xbd0f('0x69'));emit(util[_0xbd0f('0x22')](_0xbd0f('0x75'),_0x5222e1[_0xbd0f('0xd')]),'trigger:browser:url',{'uri':_0x50e24a});})['catch'](function(_0x34f1e4){logger[_0xbd0f('0x6c')]('[OUTBOUND]',JSON['stringify'](_0x34f1e4));});};exports[_0xbd0f('0x76')]=function(_0x334e8e,_0x354414,_0x443791,_0x1ae5a1,_0x310708,_0x5c2f26){var _0x204037,_0x2b5941,_0x213815,_0x2e7bf3;_0x5c2f26[_0xbd0f('0x54')]=intUtil['stripTrailingSlash'](_0x5c2f26['remoteUri']);_0x5c2f26['serverUrl']=intUtil['stripTrailingSlash'](_0x5c2f26[_0xbd0f('0x56')]);def[_0xbd0f('0x57')]=util[_0xbd0f('0x22')](_0xbd0f('0x77'),_0x5c2f26[_0xbd0f('0x54')]);if(_0x310708&&_0x310708[_0xbd0f('0x58')]){logger[_0xbd0f('0xc')]('['+_0x354414[_0xbd0f('0x78')]['toUpperCase']()+']',_0xbd0f('0x70'));_0x354414[_0xbd0f('0x5c')]=util[_0xbd0f('0x22')](_0xbd0f('0x5a'),_0x5c2f26[_0xbd0f('0x56')],_0x354414[_0xbd0f('0x5b')],md5(_0x354414['uniqueid']));}else{_0x354414[_0xbd0f('0x5c')]='';}return getConnection(_0x5c2f26)['then'](function(_0xa2cc6e){_0x2e7bf3=_0xa2cc6e;if(!_[_0xbd0f('0x27')](_0x1ae5a1)){return getUser(_0x5c2f26,_0x1ae5a1[_0xbd0f('0xd')],_0x2e7bf3);}else{return getUser(_0x5c2f26,null,_0x2e7bf3);}})[_0xbd0f('0x37')](function(_0x655dee){_0x204037=_0x655dee;logger[_0xbd0f('0xc')](_0xbd0f('0x71'),_0x204037['id']);return getEndUser(_0x5c2f26,_0x354414[_0xbd0f('0x5d')],_0x354414['calleridnum'],_0x2e7bf3);})[_0xbd0f('0x37')](function(_0x29170b){_0x2b5941=_0x29170b;logger[_0xbd0f('0xc')](_0xbd0f('0x5f'),_0x2b5941['id']);return getTicket(_0x5c2f26,_0x204037,_0x2b5941,_0x443791,_0x354414,_0x443791[_0xbd0f('0x60')],_0x2e7bf3,_0xbd0f('0x61'));})[_0xbd0f('0x37')](function(_0x233fa9){_0x213815=_0x233fa9;logger[_0xbd0f('0xc')](_0xbd0f('0x62'));logger[_0xbd0f('0xc')](_0xbd0f('0x63'),_0x213815['id']);return setRelationship(_0x2e7bf3,_0x204037,_0x213815,'users');})[_0xbd0f('0x37')](function(){return setRelationship(_0x2e7bf3,_0x2b5941,_0x213815,_0xbd0f('0x64'));})[_0xbd0f('0x37')](function(){return getServerInfo(_0x2e7bf3);})['catch'](function(_0x19eb99){logger['error']('['+_0x354414[_0xbd0f('0x78')]['toUpperCase']()+']',JSON[_0xbd0f('0x26')](_0x19eb99));});}; \ 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 43d843c..63018d1 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 _0xf29a=['toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','sortBy','length','type','string','content','variable','variableName','push'];(function(_0x2e4b84,_0x19ad5a){var _0x3a0444=function(_0x2a86db){while(--_0x2a86db){_0x2e4b84['push'](_0x2e4b84['shift']());}};_0x3a0444(++_0x19ad5a);}(_0xf29a,0x1d5));var _0xaf29=function(_0x2b52f5,_0x2c9c36){_0x2b52f5=_0x2b52f5-0x0;var _0x332396=_0xf29a[_0x2b52f5];return _0x332396;};'use strict';var _=require(_0xaf29('0x0'));var util=require(_0xaf29('0x1'));exports[_0xaf29('0x2')]=function(_0x5428c3,_0x5f1eec,_0x2dfe8d){var _0x3556b5=[];if(_0x5428c3['length']>0x0){var _0x2d7396=_[_0xaf29('0x3')](_0x5428c3,['id']);for(var _0x2497b6=0x0;_0x2497b6<_0x2d7396[_0xaf29('0x4')];_0x2497b6++){var _0x49e66b=_0x2d7396[_0x2497b6];if(_0x49e66b[_0xaf29('0x5')]===_0xaf29('0x6')){_0x3556b5['push'](_0x49e66b[_0xaf29('0x7')]);}else if(_0x49e66b[_0xaf29('0x5')]===_0xaf29('0x8')&&_0x49e66b[_0xaf29('0x9')]){_0x5f1eec[_0x49e66b['variableName']]&&_0x3556b5[_0xaf29('0xa')](_0x5f1eec[_0x49e66b[_0xaf29('0x9')]][_0xaf29('0xb')]());}else if(_0x49e66b[_0xaf29('0x5')]===_0xaf29('0xc')&&_0x49e66b[_0xaf29('0xd')]&&_0x49e66b[_0xaf29('0xd')]['name']){_0x5f1eec[_0x49e66b[_0xaf29('0xd')][_0xaf29('0xe')][_0xaf29('0xf')]()]&&_0x3556b5[_0xaf29('0xa')](_0x5f1eec[_0x49e66b[_0xaf29('0xd')][_0xaf29('0xe')][_0xaf29('0xf')]()]['toString']());}else if(_0x49e66b[_0xaf29('0x5')]===_0xaf29('0x10')){if(_0x49e66b[_0xaf29('0x11')]===_0xaf29('0x6')&&_0x49e66b[_0xaf29('0x12')]){_0x3556b5['push'](util[_0xaf29('0x13')](_0xaf29('0x14'),_0x49e66b[_0xaf29('0x12')],_0x49e66b[_0xaf29('0x15')]));}else if(_0x49e66b['keyType']===_0xaf29('0x8')&&_0x49e66b[_0xaf29('0x9')]&&_0x49e66b[_0xaf29('0x12')]){_0x5f1eec[_0x49e66b['variableName']]&&_0x3556b5[_0xaf29('0xa')](util[_0xaf29('0x13')]('%s:\x20%s',_0x49e66b[_0xaf29('0x12')],_0x5f1eec[_0x49e66b[_0xaf29('0x9')]]));}else if(_0x49e66b[_0xaf29('0x11')]===_0xaf29('0xc')&&_0x49e66b[_0xaf29('0xd')]&&_0x49e66b[_0xaf29('0xd')][_0xaf29('0xe')]&&_0x49e66b[_0xaf29('0x12')]){_0x5f1eec[_0x49e66b[_0xaf29('0xd')][_0xaf29('0xe')]['toLowerCase']()]&&_0x3556b5['push'](util[_0xaf29('0x13')](_0xaf29('0x14'),_0x49e66b[_0xaf29('0x12')],_0x5f1eec[_0x49e66b['Variable'][_0xaf29('0xe')][_0xaf29('0xf')]()]));}}}}return _0x3556b5[_0xaf29('0x16')](_0x2dfe8d);};exports[_0xaf29('0x17')]=function(_0xe4fa95){var _0x5ec53f=_0xe4fa95[_0xaf29('0x18')](-0x1);if(_0x5ec53f==='/'){_0xe4fa95=_0xe4fa95[_0xaf29('0x19')](0x0,_0xe4fa95[_0xaf29('0x1a')](_0x5ec53f));}return _0xe4fa95;};exports[_0xaf29('0x1b')]=function(_0x254ed9){if(!_[_0xaf29('0x1c')](_0x254ed9)&&_0x254ed9!==''){var _0x9fdd1c=/^(([^<>()\[\]\\.,;:\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 _0x9fdd1c[_0xaf29('0x1d')](String(_0x254ed9)[_0xaf29('0xf')]());}else{return![];}}; \ No newline at end of file +var _0xcc06=['keyValue','keyType','format','%s:\x20%s','key','keyContent','join','slice','substring','lastIndexOf','validateEmail','isNil','lodash','util','length','sortBy','type','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase'];(function(_0x33e7ff,_0x38e104){var _0x2cf2ee=function(_0x33eafa){while(--_0x33eafa){_0x33e7ff['push'](_0x33e7ff['shift']());}};_0x2cf2ee(++_0x38e104);}(_0xcc06,0x8e));var _0x6cc0=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xcc06[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x6cc0('0x0'));var util=require(_0x6cc0('0x1'));exports['getString']=function(_0x59637c,_0x1fb901,_0x384132){var _0x58c72a=[];if(_0x59637c[_0x6cc0('0x2')]>0x0){var _0xcb0f5d=_[_0x6cc0('0x3')](_0x59637c,['id']);for(var _0x3bf3c8=0x0;_0x3bf3c8<_0xcb0f5d['length'];_0x3bf3c8++){var _0x29b8e7=_0xcb0f5d[_0x3bf3c8];if(_0x29b8e7[_0x6cc0('0x4')]==='string'){_0x58c72a[_0x6cc0('0x5')](_0x29b8e7[_0x6cc0('0x6')]);}else if(_0x29b8e7[_0x6cc0('0x4')]===_0x6cc0('0x7')&&_0x29b8e7[_0x6cc0('0x8')]){_0x1fb901[_0x29b8e7[_0x6cc0('0x8')]]&&_0x58c72a[_0x6cc0('0x5')](_0x1fb901[_0x29b8e7[_0x6cc0('0x8')]][_0x6cc0('0x9')]());}else if(_0x29b8e7[_0x6cc0('0x4')]===_0x6cc0('0xa')&&_0x29b8e7[_0x6cc0('0xb')]&&_0x29b8e7[_0x6cc0('0xb')][_0x6cc0('0xc')]){_0x1fb901[_0x29b8e7[_0x6cc0('0xb')]['name'][_0x6cc0('0xd')]()]&&_0x58c72a['push'](_0x1fb901[_0x29b8e7[_0x6cc0('0xb')]['name'][_0x6cc0('0xd')]()][_0x6cc0('0x9')]());}else if(_0x29b8e7[_0x6cc0('0x4')]===_0x6cc0('0xe')){if(_0x29b8e7[_0x6cc0('0xf')]==='string'&&_0x29b8e7['key']){_0x58c72a[_0x6cc0('0x5')](util[_0x6cc0('0x10')](_0x6cc0('0x11'),_0x29b8e7[_0x6cc0('0x12')],_0x29b8e7[_0x6cc0('0x13')]));}else if(_0x29b8e7[_0x6cc0('0xf')]===_0x6cc0('0x7')&&_0x29b8e7['variableName']&&_0x29b8e7['key']){_0x1fb901[_0x29b8e7['variableName']]&&_0x58c72a[_0x6cc0('0x5')](util[_0x6cc0('0x10')](_0x6cc0('0x11'),_0x29b8e7['key'],_0x1fb901[_0x29b8e7[_0x6cc0('0x8')]]));}else if(_0x29b8e7[_0x6cc0('0xf')]==='customVariable'&&_0x29b8e7[_0x6cc0('0xb')]&&_0x29b8e7[_0x6cc0('0xb')][_0x6cc0('0xc')]&&_0x29b8e7[_0x6cc0('0x12')]){_0x1fb901[_0x29b8e7['Variable']['name'][_0x6cc0('0xd')]()]&&_0x58c72a['push'](util[_0x6cc0('0x10')](_0x6cc0('0x11'),_0x29b8e7[_0x6cc0('0x12')],_0x1fb901[_0x29b8e7['Variable']['name'][_0x6cc0('0xd')]()]));}}}}return _0x58c72a[_0x6cc0('0x14')](_0x384132);};exports['stripTrailingSlash']=function(_0x1606eb){var _0x3b0240=_0x1606eb[_0x6cc0('0x15')](-0x1);if(_0x3b0240==='/'){_0x1606eb=_0x1606eb[_0x6cc0('0x16')](0x0,_0x1606eb[_0x6cc0('0x17')](_0x3b0240));}return _0x1606eb;};exports[_0x6cc0('0x18')]=function(_0x1c44c2){if(!_[_0x6cc0('0x19')](_0x1c44c2)&&_0x1c44c2!==''){var _0x1b02bf=/^(([^<>()\[\]\\.,;:\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 _0x1b02bf['test'](String(_0x1c44c2)[_0x6cc0('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index eb5b7b2..ffd9ce3 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(_0x254b0a,_0x29057a){var _0x42d376=function(_0xe18919){while(--_0xe18919){_0x254b0a['push'](_0x254b0a['shift']());}};_0x42d376(++_0x29057a);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','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','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ 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 84b5a42..2c2c911 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 _0x1d29=['unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/logger','zendesk','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','info','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','token','Basic\x20%s','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','custom_fields','push','variable','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration'];(function(_0x2d050a,_0x24afcd){var _0x494ab3=function(_0xa2e984){while(--_0xa2e984){_0x2d050a['push'](_0x2d050a['shift']());}};_0x494ab3(++_0x24afcd);}(_0x1d29,0xe6));var _0x91d2=function(_0x4b5733,_0x345f7a){_0x4b5733=_0x4b5733-0x0;var _0x511d04=_0x1d29[_0x4b5733];return _0x511d04;};'use strict';var _=require('lodash');var rp=require(_0x91d2('0x0'));var md5=require('md5');var util=require(_0x91d2('0x1'));var Redis=require(_0x91d2('0x2'));var intUtil=require(_0x91d2('0x3'));var config=require('../../../../config/environment');var logger=require(_0x91d2('0x4'))(_0x91d2('0x5'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x115bee,_0x2a983b,_0x2f16b5){io['to'](_0x115bee)['emit'](_0x2a983b,_0x2f16b5);}var headers={'Content-Type':_0x91d2('0x6'),'Accept':'application/json'};function getTicket(_0x3db016,_0x1d01b6,_0x11e10f,_0x2ec516,_0x36236d){logger['info'](_0x91d2('0x7'));return request({'uri':util[_0x91d2('0x8')](_0x91d2('0x9'),_0x3db016[_0x91d2('0xa')]),'method':_0x91d2('0xb'),'body':{'ticket':_['merge']({'requester_id':_0x11e10f['id'],'submitter_id':_0x1d01b6?_0x1d01b6['id']:undefined,'assignee_id':_0x1d01b6?_0x1d01b6['id']:undefined,'tags':getTags(_0x2ec516[_0x91d2('0xc')],_0x91d2('0xd')),'subject':intUtil[_0x91d2('0xe')](_0x2ec516[_0x91d2('0xf')],_0x36236d,'\x20'),'description':intUtil[_0x91d2('0xe')](_0x2ec516[_0x91d2('0x10')],_0x36236d,'\x0a'),'comment':{'public':![],'body':intUtil[_0x91d2('0xe')](_0x2ec516[_0x91d2('0x10')],_0x36236d,'\x0a')}},getCustomFields(_0x2ec516[_0x91d2('0x11')],_0x36236d))}})[_0x91d2('0x12')](function(_0x15acf8){logger['info'](_0x91d2('0x13'));return _0x15acf8[_0x91d2('0x14')];});}function getUser(_0xe4dcb7,_0x58bd74){if(intUtil[_0x91d2('0x15')](_0x58bd74)){logger['info'](_0x91d2('0x16'),_0x58bd74);return request({'uri':util['format'](_0x91d2('0x17'),_0xe4dcb7[_0x91d2('0xa')]),'qs':{'query':util[_0x91d2('0x8')](_0x91d2('0x18'),_0x58bd74)}})['then'](function(_0x3206f7){if(_0x3206f7[_0x91d2('0x19')]){logger[_0x91d2('0x1a')](_0x91d2('0x1b'));return _[_0x91d2('0x1c')](_0x3206f7[_0x91d2('0x1d')],{'email':_0x58bd74,'role':'agent'});}else{logger[_0x91d2('0x1a')](_0x91d2('0x1e'));return request({'uri':util[_0x91d2('0x8')](_0x91d2('0x1f'),_0xe4dcb7[_0x91d2('0xa')])})[_0x91d2('0x12')](function(_0x369d55){logger[_0x91d2('0x1a')](_0x91d2('0x20'));return _0x369d55[_0x91d2('0x21')];});}});}else{logger[_0x91d2('0x1a')](_0x91d2('0x1e'));return request({'uri':util[_0x91d2('0x8')](_0x91d2('0x1f'),_0xe4dcb7['remoteUri'])})[_0x91d2('0x12')](function(_0x31ecfd){logger[_0x91d2('0x1a')](_0x91d2('0x20'));return _0x31ecfd['user'];});}}function getEndUser(_0x17d47d,_0x444dee,_0x2de48a){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2de48a);return request({'uri':util[_0x91d2('0x8')](_0x91d2('0x17'),_0x17d47d[_0x91d2('0xa')]),'qs':{'query':util['format'](_0x91d2('0x22'),_0x2de48a)}})['then'](function(_0x4f5711){var _0x155784;if(_0x4f5711['results'][_0x91d2('0x23')]){_0x4f5711[_0x91d2('0x1d')]=_[_0x91d2('0x24')](_0x4f5711[_0x91d2('0x1d')],{'suspended':![],'role':_0x91d2('0x25')});if(_0x4f5711[_0x91d2('0x1d')][_0x91d2('0x23')]){_0x155784=_[_0x91d2('0x26')](_0x4f5711[_0x91d2('0x1d')]);}}if(_0x155784){logger[_0x91d2('0x1a')](_0x91d2('0x27'));return _0x155784;}else{logger[_0x91d2('0x1a')](_0x91d2('0x28'));return request({'uri':util[_0x91d2('0x8')](_0x91d2('0x29'),_0x17d47d[_0x91d2('0xa')]),'method':_0x91d2('0xb'),'body':{'user':{'role':_0x91d2('0x25'),'name':util[_0x91d2('0x8')](_0x91d2('0x2a'),_0x444dee||_0x2de48a),'phone':_0x2de48a}}})['then'](function(_0x433b2b){logger[_0x91d2('0x1a')]('Enduser\x20created.');return _0x433b2b[_0x91d2('0x21')];});}});}function getAuth(_0x3babeb){var _0x25d388;if(_0x3babeb[_0x91d2('0x2b')]===_0x91d2('0x2c')){_0x25d388=util[_0x91d2('0x8')](_0x91d2('0x2d'),_0x3babeb['username'],_0x3babeb[_0x91d2('0x2c')]);}else if(_0x3babeb[_0x91d2('0x2b')]===_0x91d2('0x2e')){_0x25d388=util[_0x91d2('0x8')]('%s/token:%s',_0x3babeb['username'],_0x3babeb[_0x91d2('0x2e')]);}return util['format'](_0x91d2('0x2f'),new Buffer(_0x25d388)['toString'](_0x91d2('0x30')));}function request(_0x5cc5b1){logger[_0x91d2('0x31')](_0x91d2('0x32'),JSON[_0x91d2('0x33')](_0x5cc5b1));return rp(_[_0x91d2('0x34')](_0x5cc5b1,{'method':_0x91d2('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x3db45c,_0x41c31f){var _0x76833f=[];if(_0x3db45c&&_0x3db45c[_0x91d2('0x23')]>0x0){_0x76833f=_[_0x91d2('0x36')](_0x3db45c,_0x41c31f);}return _0x76833f;}function getCustomFields(_0x4deb41,_0x386f71){var _0x413a71=[];var _0x17e4d0={'custom_fields':[]};if(_0x4deb41[_0x91d2('0x23')]>0x0){_[_0x91d2('0x37')](_0x4deb41,function(_0x48cdda){if(_[_0x91d2('0x38')]([_0x91d2('0x39'),_0x91d2('0x3a')],_0x48cdda[_0x91d2('0x3b')])&&_0x48cdda[_0x91d2('0x3c')]&&!_0x48cdda['customField']){_0x17e4d0[_0x48cdda[_0x91d2('0x3c')][_0x91d2('0x3d')]()]=_0x48cdda[_0x91d2('0x3e')][_0x91d2('0x3f')]();}else if(_[_0x91d2('0x38')]([_0x91d2('0x39'),_0x91d2('0x3a')],_0x48cdda[_0x91d2('0x3b')])&&_0x48cdda[_0x91d2('0x40')]&&_0x48cdda[_0x91d2('0x41')]){_0x17e4d0[_0x91d2('0x42')][_0x91d2('0x43')]({'id':_0x48cdda[_0x91d2('0x40')],'value':_0x48cdda[_0x91d2('0x3e')][_0x91d2('0x3f')]()});}else if(_0x48cdda[_0x91d2('0x3b')]===_0x91d2('0x44')&&_0x48cdda[_0x91d2('0x45')]&&_0x48cdda['idField']&&_0x48cdda[_0x91d2('0x41')]){_0x386f71[_0x48cdda[_0x91d2('0x45')]]&&_0x17e4d0['custom_fields'][_0x91d2('0x43')]({'id':_0x48cdda[_0x91d2('0x40')],'value':_0x386f71[_0x48cdda[_0x91d2('0x45')]][_0x91d2('0x3f')]()});}else if(_0x48cdda[_0x91d2('0x3b')]==='customVariable'&&_0x48cdda[_0x91d2('0x46')]&&_0x48cdda['Variable'][_0x91d2('0xd')]&&_0x48cdda[_0x91d2('0x40')]&&_0x48cdda[_0x91d2('0x41')]){_0x386f71[_0x48cdda[_0x91d2('0x46')][_0x91d2('0xd')][_0x91d2('0x3d')]()]&&_0x17e4d0['custom_fields']['push']({'id':_0x48cdda[_0x91d2('0x40')],'value':_0x386f71[_0x48cdda[_0x91d2('0x46')][_0x91d2('0xd')]['toLowerCase']()]['toString']()});}});}return _0x17e4d0;}exports[_0x91d2('0x47')]=function(_0x5316f7,_0x41b313,_0x101112,_0x329bbc,_0x1ecc86,_0x2218db){var _0x42a315,_0x5799e9;_0x2218db[_0x91d2('0xa')]=intUtil['stripTrailingSlash'](_0x2218db[_0x91d2('0xa')]);_0x2218db[_0x91d2('0x48')]=intUtil[_0x91d2('0x49')](_0x2218db[_0x91d2('0x48')]);if(_0x1ecc86&&_0x1ecc86[_0x91d2('0x4a')]){logger[_0x91d2('0x1a')]('[QUEUE]',_0x91d2('0x4b'));_0x41b313[_0x91d2('0x4c')]=util[_0x91d2('0x8')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2218db[_0x91d2('0x48')],_0x41b313[_0x91d2('0x4d')],md5(_0x41b313[_0x91d2('0x4d')]));}else{_0x41b313['recordingURL']='';}headers[_0x91d2('0x4e')]=getAuth(_0x2218db);return getUser(_0x2218db,_0x329bbc[_0x91d2('0x4f')])[_0x91d2('0x12')](function(_0x5258ea){_0x42a315=_0x5258ea;logger[_0x91d2('0x1a')](_0x91d2('0x50'),_0x42a315['id']);return getEndUser(_0x2218db,_0x41b313[_0x91d2('0x51')],_0x41b313[_0x91d2('0x52')]);})[_0x91d2('0x12')](function(_0x3ab521){_0x5799e9=_0x3ab521;logger[_0x91d2('0x1a')](_0x91d2('0x53'),_0x5799e9['id']);return getTicket(_0x2218db,_0x42a315,_0x5799e9,_0x101112,_0x41b313);})[_0x91d2('0x12')](function(_0x169e0d){if(_0x169e0d){logger[_0x91d2('0x1a')](_0x91d2('0x54'),_0x169e0d['id']);switch(_0x2218db[_0x91d2('0x3b')]){case _0x91d2('0x55'):logger[_0x91d2('0x1a')](_0x91d2('0x56'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x91d2('0x8')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2218db[_0x91d2('0xa')],_0x42a315['id'],_0x169e0d['id']),'method':'POST'});case _0x91d2('0x57'):logger['info'](_0x91d2('0x56'),_0x91d2('0x58'));emit(util[_0x91d2('0x8')](_0x91d2('0x59'),_0x329bbc[_0x91d2('0xd')]),_0x91d2('0x5a'),{'uri':util[_0x91d2('0x8')](_0x91d2('0x5b'),_0x2218db[_0x91d2('0xa')][_0x91d2('0x5c')](_0x91d2('0x5d'),''),_0x169e0d['id'])});break;default:logger['error'](_0x91d2('0x56'),_0x91d2('0x5e'));}}})[_0x91d2('0x5f')](function(_0x47db46){logger[_0x91d2('0x60')](_0x91d2('0x61'),util[_0x91d2('0x62')](_0x47db46,{'showHidden':!![],'depth':null}));});};exports[_0x91d2('0x63')]=function(_0x54115e,_0x57df72,_0x3446cc,_0xfe20c,_0x4fa4a4,_0x8f0ce6,_0x1db250){var _0x29334a,_0x33f6dd;_0x8f0ce6[_0x91d2('0xa')]=intUtil[_0x91d2('0x49')](_0x8f0ce6[_0x91d2('0xa')]);_0x8f0ce6['serverUrl']=intUtil[_0x91d2('0x49')](_0x8f0ce6[_0x91d2('0x48')]);if(_0x1db250&&_0x1db250[_0x91d2('0x64')]&&_0x1db250[_0x91d2('0x64')]!==_0x91d2('0x65')){logger[_0x91d2('0x1a')]('[OUTBOUND]',_0x91d2('0x4b'));_0x57df72[_0x91d2('0x4c')]=util[_0x91d2('0x8')](_0x91d2('0x66'),_0x8f0ce6[_0x91d2('0x48')],_0x57df72[_0x91d2('0x4d')],md5(_0x57df72[_0x91d2('0x4d')]));}headers[_0x91d2('0x4e')]=getAuth(_0x8f0ce6);return getUser(_0x8f0ce6,_0xfe20c['email'])[_0x91d2('0x12')](function(_0x493f8b){_0x29334a=_0x493f8b;logger['info'](_0x91d2('0x50'),_0x29334a['id']);return getEndUser(_0x8f0ce6,_0x57df72[_0x91d2('0x67')],_0x57df72[_0x91d2('0x68')]);})[_0x91d2('0x12')](function(_0x249ca9){_0x33f6dd=_0x249ca9;logger['info']('The\x20Enduser\x20ID\x20is:',_0x33f6dd['id']);return getTicket(_0x8f0ce6,_0x29334a,_0x33f6dd,_0x3446cc,_0x57df72);})[_0x91d2('0x12')](function(_0x24d214){if(_0x24d214){logger[_0x91d2('0x1a')](_0x91d2('0x54'),_0x24d214['id']);switch(_0x8f0ce6[_0x91d2('0x3b')]){case _0x91d2('0x55'):logger['info'](_0x91d2('0x69'),_0x91d2('0x6a'));return request({'uri':util[_0x91d2('0x8')](_0x91d2('0x6b'),_0x8f0ce6[_0x91d2('0xa')],_0x29334a['id'],_0x24d214['id']),'method':_0x91d2('0xb')});case'newTab':logger[_0x91d2('0x1a')](_0x91d2('0x69'),_0x91d2('0x58'));emit(util['format'](_0x91d2('0x59'),_0xfe20c[_0x91d2('0xd')]),_0x91d2('0x5a'),{'uri':util[_0x91d2('0x8')](_0x91d2('0x5b'),_0x8f0ce6[_0x91d2('0xa')][_0x91d2('0x5c')](_0x91d2('0x5d'),''),_0x24d214['id'])});break;default:logger[_0x91d2('0x60')](_0x91d2('0x69'),_0x91d2('0x5e'));}}})['catch'](function(_0x39200f){logger['error'](_0x91d2('0x6c'),util['inspect'](_0x39200f,{'showHidden':!![],'depth':null}));});};exports[_0x91d2('0x6d')]=function(_0x4b771e,_0x53f9ac,_0x3c0407,_0x2b413c,_0x1d6df2,_0x1de70e){var _0x27970d,_0x547b5e;_0x1de70e['remoteUri']=intUtil['stripTrailingSlash'](_0x1de70e[_0x91d2('0xa')]);_0x1de70e[_0x91d2('0x48')]=intUtil[_0x91d2('0x49')](_0x1de70e[_0x91d2('0x48')]);if(_0x1d6df2&&_0x1d6df2['monitor_format']){logger['info']('['+_0x53f9ac[_0x91d2('0x6e')][_0x91d2('0x6f')]()+']',_0x91d2('0x4b'));_0x53f9ac[_0x91d2('0x4c')]=util[_0x91d2('0x8')](_0x91d2('0x66'),_0x1de70e['serverUrl'],_0x53f9ac[_0x91d2('0x4d')],md5(_0x53f9ac['uniqueid']));}else{_0x53f9ac['recordingURL']='';}headers[_0x91d2('0x4e')]=getAuth(_0x1de70e);return getUser(_0x1de70e)[_0x91d2('0x12')](function(_0x107778){_0x27970d=_0x107778;logger[_0x91d2('0x1a')](_0x91d2('0x50'),_0x27970d['id']);return getEndUser(_0x1de70e,_0x53f9ac[_0x91d2('0x51')],_0x53f9ac[_0x91d2('0x52')]);})[_0x91d2('0x12')](function(_0x2f7119){_0x547b5e=_0x2f7119;logger[_0x91d2('0x1a')](_0x91d2('0x53'),_0x547b5e['id']);return getTicket(_0x1de70e,_0x27970d,_0x547b5e,_0x3c0407,_0x53f9ac);})[_0x91d2('0x12')](function(_0x39daa2){if(_0x39daa2){logger[_0x91d2('0x1a')](_0x91d2('0x54'),_0x39daa2['id']);}})['catch'](function(_0x523ef0){logger[_0x91d2('0x60')]('['+_0x53f9ac[_0x91d2('0x6e')][_0x91d2('0x6f')]()+']'+_0x91d2('0x70'),util['inspect'](_0x523ef0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7597=['../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','application/json','info','format','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','push','variable','customField','custom_fields','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','calleridnum','lastevent','lodash','md5','util','ioredis','./util','../../../../config/environment'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0x7597,0x1c2));var _0x7759=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x7597[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x7759('0x0'));var rp=require('request-promise');var md5=require(_0x7759('0x1'));var util=require(_0x7759('0x2'));var Redis=require(_0x7759('0x3'));var intUtil=require(_0x7759('0x4'));var config=require(_0x7759('0x5'));var logger=require(_0x7759('0x6'))(_0x7759('0x7'));config[_0x7759('0x8')]=_[_0x7759('0x9')](config[_0x7759('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x7759('0xa'))(new Redis(config[_0x7759('0x8')]));function emit(_0x1fe793,_0x3b7a7d,_0x4f7de1){io['to'](_0x1fe793)['emit'](_0x3b7a7d,_0x4f7de1);}var headers={'Content-Type':_0x7759('0xb'),'Accept':_0x7759('0xb')};function getTicket(_0x33dfd4,_0x857f99,_0x34d50c,_0x29d77e,_0x8fb13){logger[_0x7759('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x7759('0xd')](_0x7759('0xe'),_0x33dfd4[_0x7759('0xf')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x34d50c['id'],'submitter_id':_0x857f99?_0x857f99['id']:undefined,'assignee_id':_0x857f99?_0x857f99['id']:undefined,'tags':getTags(_0x29d77e[_0x7759('0x10')],_0x7759('0x11')),'subject':intUtil[_0x7759('0x12')](_0x29d77e[_0x7759('0x13')],_0x8fb13,'\x20'),'description':intUtil[_0x7759('0x12')](_0x29d77e[_0x7759('0x14')],_0x8fb13,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7759('0x12')](_0x29d77e[_0x7759('0x14')],_0x8fb13,'\x0a')}},getCustomFields(_0x29d77e['Fields'],_0x8fb13))}})[_0x7759('0x15')](function(_0x2e18e6){logger['info'](_0x7759('0x16'));return _0x2e18e6['ticket'];});}function getUser(_0x43fe3a,_0x5ca51b){if(intUtil[_0x7759('0x17')](_0x5ca51b)){logger[_0x7759('0xc')](_0x7759('0x18'),_0x5ca51b);return request({'uri':util[_0x7759('0xd')]('%s/search.json',_0x43fe3a[_0x7759('0xf')]),'qs':{'query':util[_0x7759('0xd')](_0x7759('0x19'),_0x5ca51b)}})[_0x7759('0x15')](function(_0x48fc24){if(_0x48fc24['count']){logger[_0x7759('0xc')](_0x7759('0x1a'));return _[_0x7759('0x1b')](_0x48fc24['results'],{'email':_0x5ca51b,'role':'agent'});}else{logger['info'](_0x7759('0x1c'));return request({'uri':util[_0x7759('0xd')](_0x7759('0x1d'),_0x43fe3a[_0x7759('0xf')])})[_0x7759('0x15')](function(_0x4019ce){logger[_0x7759('0xc')]('Admin\x20account\x20selected.');return _0x4019ce[_0x7759('0x1e')];});}});}else{logger[_0x7759('0xc')](_0x7759('0x1c'));return request({'uri':util[_0x7759('0xd')](_0x7759('0x1d'),_0x43fe3a[_0x7759('0xf')])})[_0x7759('0x15')](function(_0x5adeaa){logger[_0x7759('0xc')](_0x7759('0x1f'));return _0x5adeaa[_0x7759('0x1e')];});}}function getEndUser(_0x557c83,_0x52d161,_0x2000da){logger[_0x7759('0xc')](_0x7759('0x20'),_0x2000da);return request({'uri':util['format'](_0x7759('0x21'),_0x557c83['remoteUri']),'qs':{'query':util['format'](_0x7759('0x22'),_0x2000da)}})[_0x7759('0x15')](function(_0x5cd2f3){var _0x1a8317;if(_0x5cd2f3[_0x7759('0x23')][_0x7759('0x24')]){_0x5cd2f3[_0x7759('0x23')]=_[_0x7759('0x25')](_0x5cd2f3[_0x7759('0x23')],{'suspended':![],'role':'end-user'});if(_0x5cd2f3['results'][_0x7759('0x24')]){_0x1a8317=_[_0x7759('0x26')](_0x5cd2f3[_0x7759('0x23')]);}}if(_0x1a8317){logger['info'](_0x7759('0x27'));return _0x1a8317;}else{logger['info'](_0x7759('0x28'));return request({'uri':util[_0x7759('0xd')](_0x7759('0x29'),_0x557c83[_0x7759('0xf')]),'method':_0x7759('0x2a'),'body':{'user':{'role':_0x7759('0x2b'),'name':util[_0x7759('0xd')](_0x7759('0x2c'),_0x52d161||_0x2000da),'phone':_0x2000da}}})[_0x7759('0x15')](function(_0x5e821d){logger[_0x7759('0xc')](_0x7759('0x2d'));return _0x5e821d[_0x7759('0x1e')];});}});}function getAuth(_0x5827f6){var _0x2e8f39;if(_0x5827f6[_0x7759('0x2e')]===_0x7759('0x2f')){_0x2e8f39=util[_0x7759('0xd')]('%s:%s',_0x5827f6[_0x7759('0x30')],_0x5827f6[_0x7759('0x2f')]);}else if(_0x5827f6[_0x7759('0x2e')]===_0x7759('0x31')){_0x2e8f39=util[_0x7759('0xd')](_0x7759('0x32'),_0x5827f6[_0x7759('0x30')],_0x5827f6[_0x7759('0x31')]);}return util[_0x7759('0xd')](_0x7759('0x33'),new Buffer(_0x2e8f39)[_0x7759('0x34')](_0x7759('0x35')));}function request(_0x375319){logger[_0x7759('0x36')](_0x7759('0x37'),JSON[_0x7759('0x38')](_0x375319));return rp(_[_0x7759('0x9')](_0x375319,{'method':_0x7759('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x6503a3,_0x1149ae){var _0x4de4b4=[];if(_0x6503a3&&_0x6503a3[_0x7759('0x24')]>0x0){_0x4de4b4=_[_0x7759('0x3a')](_0x6503a3,_0x1149ae);}return _0x4de4b4;}function getCustomFields(_0x3588d7,_0x4751f0){var _0x4340cf=[];var _0xd022f1={'custom_fields':[]};if(_0x3588d7['length']>0x0){_[_0x7759('0x3b')](_0x3588d7,function(_0x5a6fe7){if(_[_0x7759('0x3c')]([_0x7759('0x3d'),_0x7759('0x3e')],_0x5a6fe7[_0x7759('0x3f')])&&_0x5a6fe7[_0x7759('0x40')]&&!_0x5a6fe7['customField']){_0xd022f1[_0x5a6fe7[_0x7759('0x40')][_0x7759('0x41')]()]=_0x5a6fe7[_0x7759('0x42')][_0x7759('0x34')]();}else if(_[_0x7759('0x3c')]([_0x7759('0x3d'),_0x7759('0x3e')],_0x5a6fe7[_0x7759('0x3f')])&&_0x5a6fe7[_0x7759('0x43')]&&_0x5a6fe7['customField']){_0xd022f1['custom_fields'][_0x7759('0x44')]({'id':_0x5a6fe7[_0x7759('0x43')],'value':_0x5a6fe7[_0x7759('0x42')][_0x7759('0x34')]()});}else if(_0x5a6fe7[_0x7759('0x3f')]===_0x7759('0x45')&&_0x5a6fe7['variableName']&&_0x5a6fe7['idField']&&_0x5a6fe7[_0x7759('0x46')]){_0x4751f0[_0x5a6fe7['variableName']]&&_0xd022f1[_0x7759('0x47')][_0x7759('0x44')]({'id':_0x5a6fe7['idField'],'value':_0x4751f0[_0x5a6fe7[_0x7759('0x48')]][_0x7759('0x34')]()});}else if(_0x5a6fe7[_0x7759('0x3f')]===_0x7759('0x49')&&_0x5a6fe7[_0x7759('0x4a')]&&_0x5a6fe7[_0x7759('0x4a')][_0x7759('0x11')]&&_0x5a6fe7[_0x7759('0x43')]&&_0x5a6fe7[_0x7759('0x46')]){_0x4751f0[_0x5a6fe7['Variable'][_0x7759('0x11')][_0x7759('0x41')]()]&&_0xd022f1[_0x7759('0x47')][_0x7759('0x44')]({'id':_0x5a6fe7[_0x7759('0x43')],'value':_0x4751f0[_0x5a6fe7[_0x7759('0x4a')][_0x7759('0x11')]['toLowerCase']()][_0x7759('0x34')]()});}});}return _0xd022f1;}exports[_0x7759('0x4b')]=function(_0x3c30c0,_0x4e4682,_0x425b98,_0x195536,_0xa64ddd,_0x435a30){var _0x2ba4fb,_0x3308a2;_0x435a30[_0x7759('0xf')]=intUtil['stripTrailingSlash'](_0x435a30[_0x7759('0xf')]);_0x435a30['serverUrl']=intUtil[_0x7759('0x4c')](_0x435a30[_0x7759('0x4d')]);if(_0xa64ddd&&_0xa64ddd[_0x7759('0x4e')]){logger[_0x7759('0xc')](_0x7759('0x4f'),'Recording\x20is\x20enabled!');_0x4e4682[_0x7759('0x50')]=util['format'](_0x7759('0x51'),_0x435a30[_0x7759('0x4d')],_0x4e4682[_0x7759('0x52')],md5(_0x4e4682[_0x7759('0x52')]));}else{_0x4e4682[_0x7759('0x50')]='';}headers[_0x7759('0x53')]=getAuth(_0x435a30);return getUser(_0x435a30,_0x195536['email'])['then'](function(_0x31827f){_0x2ba4fb=_0x31827f;logger[_0x7759('0xc')](_0x7759('0x54'),_0x2ba4fb['id']);return getEndUser(_0x435a30,_0x4e4682[_0x7759('0x55')],_0x4e4682['calleridnum']);})[_0x7759('0x15')](function(_0x2fc5df){_0x3308a2=_0x2fc5df;logger[_0x7759('0xc')](_0x7759('0x56'),_0x3308a2['id']);return getTicket(_0x435a30,_0x2ba4fb,_0x3308a2,_0x425b98,_0x4e4682);})[_0x7759('0x15')](function(_0x223311){if(_0x223311){logger[_0x7759('0xc')](_0x7759('0x57'),_0x223311['id']);switch(_0x435a30[_0x7759('0x3f')]){case _0x7759('0x58'):logger[_0x7759('0xc')](_0x7759('0x4f'),_0x7759('0x59'));return request({'uri':util[_0x7759('0xd')](_0x7759('0x5a'),_0x435a30[_0x7759('0xf')],_0x2ba4fb['id'],_0x223311['id']),'method':'POST'});case _0x7759('0x5b'):logger[_0x7759('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7759('0xd')](_0x7759('0x5c'),_0x195536['name']),_0x7759('0x5d'),{'uri':util[_0x7759('0xd')](_0x7759('0x5e'),_0x435a30[_0x7759('0xf')][_0x7759('0x5f')](_0x7759('0x60'),''),_0x223311['id'])});break;default:logger['error'](_0x7759('0x4f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7759('0x61')](function(_0x56ee4f){logger[_0x7759('0x62')](_0x7759('0x63'),util[_0x7759('0x64')](_0x56ee4f,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x25b266,_0x1aa16b,_0x1476f0,_0x429c98,_0x356094,_0x332212,_0x5bd51d){var _0x5a4197,_0x14bf05;_0x332212[_0x7759('0xf')]=intUtil[_0x7759('0x4c')](_0x332212[_0x7759('0xf')]);_0x332212[_0x7759('0x4d')]=intUtil[_0x7759('0x4c')](_0x332212[_0x7759('0x4d')]);if(_0x5bd51d&&_0x5bd51d[_0x7759('0x65')]&&_0x5bd51d[_0x7759('0x65')]!==_0x7759('0x66')){logger[_0x7759('0xc')](_0x7759('0x67'),_0x7759('0x68'));_0x1aa16b[_0x7759('0x50')]=util[_0x7759('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x332212[_0x7759('0x4d')],_0x1aa16b[_0x7759('0x52')],md5(_0x1aa16b['uniqueid']));}headers[_0x7759('0x53')]=getAuth(_0x332212);return getUser(_0x332212,_0x429c98[_0x7759('0x69')])[_0x7759('0x15')](function(_0x2415a3){_0x5a4197=_0x2415a3;logger['info'](_0x7759('0x54'),_0x5a4197['id']);return getEndUser(_0x332212,_0x1aa16b[_0x7759('0x6a')],_0x1aa16b['destcalleridnum']);})[_0x7759('0x15')](function(_0x2bb3e6){_0x14bf05=_0x2bb3e6;logger['info'](_0x7759('0x56'),_0x14bf05['id']);return getTicket(_0x332212,_0x5a4197,_0x14bf05,_0x1476f0,_0x1aa16b);})[_0x7759('0x15')](function(_0x3eddb4){if(_0x3eddb4){logger[_0x7759('0xc')](_0x7759('0x57'),_0x3eddb4['id']);switch(_0x332212[_0x7759('0x3f')]){case _0x7759('0x58'):logger[_0x7759('0xc')](_0x7759('0x67'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x7759('0xd')](_0x7759('0x5a'),_0x332212[_0x7759('0xf')],_0x5a4197['id'],_0x3eddb4['id']),'method':_0x7759('0x2a')});case _0x7759('0x5b'):logger[_0x7759('0xc')](_0x7759('0x67'),_0x7759('0x6b'));emit(util[_0x7759('0xd')](_0x7759('0x5c'),_0x429c98[_0x7759('0x11')]),'trigger:browser:url',{'uri':util[_0x7759('0xd')](_0x7759('0x5e'),_0x332212[_0x7759('0xf')][_0x7759('0x5f')](_0x7759('0x60'),''),_0x3eddb4['id'])});break;default:logger[_0x7759('0x62')](_0x7759('0x67'),_0x7759('0x6c'));}}})[_0x7759('0x61')](function(_0x29a5d1){logger['error'](_0x7759('0x6d'),util[_0x7759('0x64')](_0x29a5d1,{'showHidden':!![],'depth':null}));});};exports[_0x7759('0x6e')]=function(_0x590aef,_0x2a6d65,_0x5d86d2,_0x2f39a1,_0x19d303,_0x6bb5ff){var _0x3fd2fa,_0x1ea3f2;_0x6bb5ff[_0x7759('0xf')]=intUtil[_0x7759('0x4c')](_0x6bb5ff[_0x7759('0xf')]);_0x6bb5ff['serverUrl']=intUtil[_0x7759('0x4c')](_0x6bb5ff['serverUrl']);if(_0x19d303&&_0x19d303[_0x7759('0x4e')]){logger['info']('['+_0x2a6d65['lastevent'][_0x7759('0x6f')]()+']',_0x7759('0x68'));_0x2a6d65['recordingURL']=util[_0x7759('0xd')](_0x7759('0x51'),_0x6bb5ff[_0x7759('0x4d')],_0x2a6d65[_0x7759('0x52')],md5(_0x2a6d65[_0x7759('0x52')]));}else{_0x2a6d65[_0x7759('0x50')]='';}headers[_0x7759('0x53')]=getAuth(_0x6bb5ff);return getUser(_0x6bb5ff)[_0x7759('0x15')](function(_0x45983e){_0x3fd2fa=_0x45983e;logger[_0x7759('0xc')](_0x7759('0x54'),_0x3fd2fa['id']);return getEndUser(_0x6bb5ff,_0x2a6d65[_0x7759('0x55')],_0x2a6d65[_0x7759('0x70')]);})[_0x7759('0x15')](function(_0xa76eb){_0x1ea3f2=_0xa76eb;logger[_0x7759('0xc')](_0x7759('0x56'),_0x1ea3f2['id']);return getTicket(_0x6bb5ff,_0x3fd2fa,_0x1ea3f2,_0x5d86d2,_0x2a6d65);})[_0x7759('0x15')](function(_0x49106a){if(_0x49106a){logger[_0x7759('0xc')](_0x7759('0x57'),_0x49106a['id']);}})[_0x7759('0x61')](function(_0x378d82){logger['error']('['+_0x2a6d65[_0x7759('0x71')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x378d82,{'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 fbb74d9..a267856 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 _0x3ac6=['POST','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','SUCCESS','startCase','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','contact','nothing','Owner','administrator','Subject','getString','Description','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','utc','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','mm:ss','lastevent','called','Call_Result','Called','complete','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','calleridnum','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','zoho.eu','com','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','calleridname','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','localhost','redis','emit','debug','[HTTP]','stringify','length','string','picklist','type','idField','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','email','Agent\x20found!','findIndex','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data'];(function(_0x313878,_0x32bf43){var _0x32b3e3=function(_0x119938){while(--_0x119938){_0x313878['push'](_0x313878['shift']());}};_0x32b3e3(++_0x32bf43);}(_0x3ac6,0xeb));var _0x63ac=function(_0x568cbc,_0x29f300){_0x568cbc=_0x568cbc-0x0;var _0x1afca5=_0x3ac6[_0x568cbc];return _0x1afca5;};'use strict';var _=require(_0x63ac('0x0'));var rp=require(_0x63ac('0x1'));var md5=require(_0x63ac('0x2'));var util=require(_0x63ac('0x3'));var intUtil=require(_0x63ac('0x4'));var moment=require(_0x63ac('0x5'));var Redis=require('ioredis');var BPromise=require(_0x63ac('0x6'));var config=require(_0x63ac('0x7'));var logger=require(_0x63ac('0x8'))(_0x63ac('0x9'));config['redis']=_[_0x63ac('0xa')](config['redis'],{'host':_0x63ac('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x63ac('0xc')]));function emit(_0xf46973,_0x1ad039,_0x5c1583){io['to'](_0xf46973)[_0x63ac('0xd')](_0x1ad039,_0x5c1583);}function request(_0x2a0608){logger[_0x63ac('0xe')](_0x63ac('0xf'),JSON[_0x63ac('0x10')](_0x2a0608));return rp(_0x2a0608);}function getCustomFields(_0x4f01bf,_0x282425){var _0x25b2ec={};if(_0x4f01bf[_0x63ac('0x11')]>0x0){_['forEach'](_0x4f01bf,function(_0x2901e9){if(_['includes']([_0x63ac('0x12'),_0x63ac('0x13')],_0x2901e9[_0x63ac('0x14')])&&_0x2901e9[_0x63ac('0x15')]){_0x25b2ec[_0x2901e9[_0x63ac('0x15')]]=_0x2901e9['content']['toString']();}else if(_0x2901e9[_0x63ac('0x14')]==='variable'&&_0x2901e9[_0x63ac('0x16')]&&_0x2901e9[_0x63ac('0x15')]&&_0x282425[_0x2901e9[_0x63ac('0x16')]]){_0x25b2ec[_0x2901e9[_0x63ac('0x15')]]=_0x282425[_0x2901e9[_0x63ac('0x16')]][_0x63ac('0x17')]();}else if(_0x2901e9[_0x63ac('0x14')]===_0x63ac('0x18')&&_0x2901e9[_0x63ac('0x19')]&&_0x2901e9[_0x63ac('0x19')][_0x63ac('0x1a')]&&_0x2901e9[_0x63ac('0x15')]&&_0x282425[_0x2901e9[_0x63ac('0x19')][_0x63ac('0x1a')]['toLowerCase']()]){_0x25b2ec[_0x2901e9[_0x63ac('0x15')]]=_0x282425[_0x2901e9[_0x63ac('0x19')][_0x63ac('0x1a')][_0x63ac('0x1b')]()]['toString']();}});}return _0x25b2ec;}function getName(_0x45581d){if(_0x45581d[_0x63ac('0x1c')]('\x20')>0x0){var _0x3be7c6=_0x45581d['split'](/ (.+)/);if(_0x3be7c6[0x1]){return _0x3be7c6;}}return[_0x45581d,_0x45581d];}var accountsTokens={};function getAccessToken(_0x2ad379){return new Promise(function(_0x51d368,_0x1e9701){if(!_['isNil'](accountsTokens[_0x2ad379['id']])&&!_[_0x63ac('0x1d')](accountsTokens[_0x2ad379['id']][_0x63ac('0x1e')])){if(moment()[_0x63ac('0x1f')](accountsTokens[_0x2ad379['id']][_0x63ac('0x20')])){_0x51d368(accountsTokens[_0x2ad379['id']][_0x63ac('0x1e')]);}}var _0x591457;switch(_0x2ad379['zone']){case'US':_0x591457='https://accounts.zoho.com';break;case'AU':_0x591457='https://accounts.zoho.com.au';break;case'EU':_0x591457=_0x63ac('0x21');break;case'IN':_0x591457=_0x63ac('0x22');break;case'CN':_0x591457='https://accounts.zoho.com.cn';break;default:_0x591457=_0x63ac('0x21');break;}var _0x4f6fff={'method':'POST','uri':_0x591457+_0x63ac('0x23'),'qs':{'refresh_token':_0x2ad379[_0x63ac('0x24')],'client_id':_0x2ad379[_0x63ac('0x25')],'client_secret':_0x2ad379[_0x63ac('0x26')],'grant_type':_0x63ac('0x27')},'json':!![]};return rp(_0x4f6fff)[_0x63ac('0x28')](function(_0xe715f5){accountsTokens[_0x2ad379['id']]={'access_token':_0xe715f5[_0x63ac('0x1e')],'expires_in':moment()[_0x63ac('0x29')](_0xe715f5[_0x63ac('0x20')],'seconds')};_0x51d368(_0xe715f5[_0x63ac('0x1e')]);})[_0x63ac('0x2a')](function(_0x4018cf){logger[_0x63ac('0x2b')](_0x63ac('0x2c'),_0x4018cf[_0x63ac('0x2d')]);_0x1e9701(_0x4018cf);});});}function getUser(_0x3663b2,_0x5be36b,_0x268c7a,_0x34d9d1){logger[_0x63ac('0x2e')]('Search\x20user');return request({'method':'GET','uri':util[_0x63ac('0x2f')](_0x63ac('0x30'),_0x5be36b),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x63ac('0x31')+_0x3663b2},'json':!![]})['then'](function(_0x5caa2f){if(_0x5caa2f[_0x63ac('0x32')]){var _0x336b66=-0x1;if(_['isArrayLikeObject'](_0x5caa2f[_0x63ac('0x32')])){if(!_[_0x63ac('0x1d')](_0x34d9d1)){_0x336b66=_['findIndex'](_0x5caa2f[_0x63ac('0x32')],function(_0x2b320b){return _0x2b320b[_0x63ac('0x33')]===_0x34d9d1;});}if(_0x336b66>=0x0){logger[_0x63ac('0x2e')](_0x63ac('0x34'));}else{logger[_0x63ac('0x2e')]('Using\x20the\x20admin\x20account!');_0x336b66=_[_0x63ac('0x35')](_0x5caa2f['users'],function(_0x5411a3){return _0x5411a3[_0x63ac('0x36')]['name']===_0x63ac('0x37');});}return _0x5caa2f[_0x63ac('0x32')][_0x336b66];}else{if(_0x5caa2f[_0x63ac('0x38')][_0x63ac('0x36')][_0x63ac('0x1a')]===_0x63ac('0x37')){logger[_0x63ac('0x2e')](_0x63ac('0x39'));user=_0x5caa2f[_0x63ac('0x38')];return user;}else{logger[_0x63ac('0x2b')](_0x63ac('0x3a'),JSON['stringify'](_0x5caa2f));throw new Error(_0x63ac('0x3b')+JSON['stringify'](_0x5caa2f));}}}else{logger[_0x63ac('0x2b')](_0x63ac('0x3a'),JSON[_0x63ac('0x10')](_0x5caa2f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x63ac('0x10')](_0x5caa2f));}})[_0x63ac('0x2a')](function(_0x3ff352){console['error'](_0x3ff352);});}function getZohoUser(_0x303c41,_0xb5254b){return new BPromise(function(_0x49a8d2,_0x53179b){request(_0x303c41)[_0x63ac('0x28')](function(_0x2b85ce){var _0x469f62=null;if(_0x2b85ce){_0x469f62=_0x2b85ce[_0x63ac('0x3c')][0x0];_0x469f62['enduserType']=_0xb5254b;}_0x49a8d2(_0x469f62);})[_0x63ac('0x2a')](function(_0x3ac804){_0x53179b(_0x3ac804);});});}function createEndUser(_0x229db1,_0x98bf86,_0x470414,_0x12f357,_0x3369c4,_0x599065){var _0x470414=getName(_0x470414);return request({'method':_0x63ac('0x3d'),'uri':_0x63ac('0x3e')+_0x98bf86+'/crm/v2/'+_['startCase'](_0x599065[_0x63ac('0x3f')])+'s','body':{'data':[{'Last_Name':_0x470414[0x1],'First_Name':_0x470414[0x0],'Phone':_0x12f357,'Owner':{'name':!_['isNil'](_0x3369c4[_0x63ac('0x40')][_0x63ac('0x1a')])?_0x3369c4[_0x63ac('0x40')][_0x63ac('0x1a')]:!_[_0x63ac('0x1d')](_0x3369c4['first_name'])?_0x3369c4[_0x63ac('0x41')]+'\x20'+_0x3369c4[_0x63ac('0x42')]:_0x3369c4['last_name'],'id':_0x3369c4['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x229db1},'json':!![]})[_0x63ac('0x28')](function(_0x49359c){if(_0x49359c&&_0x49359c[_0x63ac('0x3c')][0x0][_0x63ac('0x43')]===_0x63ac('0x44')){var _0x350e40=_0x49359c[_0x63ac('0x3c')][0x0]['details'];_0x350e40['enduserType']=_[_0x63ac('0x45')](_0x599065['moduleCreate'])+'s';return _0x350e40;}logger[_0x63ac('0x2b')](_0x63ac('0x3a'),JSON['stringify'](data));throw new Error(_0x63ac('0x46')+JSON[_0x63ac('0x10')](data));})[_0x63ac('0x2a')](function(_0x31a74e){console[_0x63ac('0x47')](_0x63ac('0x48'),_0x31a74e);});}function getEndUser(_0x2cd6ce,_0x334aee,_0x4aaa55,_0x478b26,_0x21b9d8,_0x2d5a95,_0xf5145a){var _0x282e98={'method':_0x63ac('0x49'),'uri':'','headers':{'Authorization':_0x63ac('0x31')+_0x2cd6ce},'json':!![]};switch(_0xf5145a[_0x63ac('0x4a')]){case'contact_lead':_0x282e98['uri']='https://www.zohoapis.'+_0x334aee+_0x63ac('0x4b')+_0x21b9d8+'))';return getZohoUser(_0x282e98,_0x63ac('0x4c'))[_0x63ac('0x28')](function(_0x282a19){if(_0x282a19)return _0x282a19;_0x282e98[_0x63ac('0x4d')]=_0x63ac('0x3e')+_0x334aee+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x21b9d8+'))';return getZohoUser(_0x282e98,_0x63ac('0x4e'))[_0x63ac('0x28')](function(_0x828bab){if(_0x828bab)return _0x828bab;if(_0xf5145a[_0x63ac('0x3f')]!='nothing'){return createEndUser(_0x2cd6ce,_0x334aee,_0x478b26,_0x21b9d8,_0x2d5a95,_0xf5145a);}else{return{};}});});break;case _0x63ac('0x4f'):_0x282e98[_0x63ac('0x4d')]=_0x63ac('0x3e')+_0x334aee+_0x63ac('0x4b')+_0x21b9d8+'))';return getZohoUser(_0x282e98,'Contacts')['then'](function(_0x550e70){if(_0x550e70)return _0x550e70;if(_0xf5145a[_0x63ac('0x3f')]!=_0x63ac('0x50')){return createEndUser(_0x2cd6ce,_0x334aee,_0x478b26,_0x21b9d8,_0x2d5a95,_0xf5145a);}else{return{};}});break;case'lead':_0x282e98[_0x63ac('0x4d')]='https://www.zohoapis.'+_0x334aee+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x21b9d8+'))';return getZohoUser(_0x282e98,'Leads')[_0x63ac('0x28')](function(_0x4a5f98){if(_0x4a5f98)return _0x4a5f98;if(_0xf5145a['moduleCreate']!='nothing'){return createEndUser(_0x2cd6ce,_0x334aee,_0x478b26,_0x21b9d8,_0x2d5a95,_0xf5145a);}else{return{};}});break;}}function getCall(_0x123a2e,_0x4a8174,_0x403f3b,_0xa9d0f8,_0x4bf198,_0x254790,_0x25d6a7,_0x5aec5c){logger[_0x63ac('0x2e')]('Creating\x20new\x20call...');var _0x2656fe={};_0x2656fe[_0x63ac('0x51')]={'name':!_['isNil'](_0xa9d0f8[_0x63ac('0x40')]['name'])&&!_[_0x63ac('0x1d')](_0xa9d0f8[_0x63ac('0x36')][_0x63ac('0x1a')])&&_0xa9d0f8['profile'][_0x63ac('0x1a')]===_0x63ac('0x52')?_0xa9d0f8[_0x63ac('0x40')][_0x63ac('0x1a')]:!_[_0x63ac('0x1d')](_0xa9d0f8[_0x63ac('0x41')])?_0xa9d0f8[_0x63ac('0x41')]+'\x20'+_0xa9d0f8[_0x63ac('0x42')]:_0xa9d0f8[_0x63ac('0x42')],'id':_0xa9d0f8['id']};_0x2656fe[_0x63ac('0x53')]=intUtil[_0x63ac('0x54')](_0x254790['Subjects'],_0x25d6a7,'\x20');_0x2656fe[_0x63ac('0x55')]=intUtil[_0x63ac('0x54')](_0x254790['Descriptions'],_0x25d6a7,'\x0a');if(_0x4bf198[_0x63ac('0x56')]===_0x63ac('0x4c')){_0x2656fe[_0x63ac('0x57')]={'name':!_['isNil'](_0x4bf198[_0x63ac('0x58')])?_0x4bf198['Full_Name']:!_[_0x63ac('0x1d')](_0x4bf198[_0x63ac('0x59')])?_0x4bf198[_0x63ac('0x59')]+'\x20'+_0x4bf198['Last_Name']:_0x4bf198[_0x63ac('0x5a')],'id':_0x4bf198['id']};}if(_0x4bf198[_0x63ac('0x56')]===_0x63ac('0x4e')){_0x2656fe[_0x63ac('0x5b')]={'name':!_['isNil'](_0x4bf198[_0x63ac('0x58')])?_0x4bf198[_0x63ac('0x58')]:!_[_0x63ac('0x1d')](_0x4bf198['First_Name'])?_0x4bf198[_0x63ac('0x59')]+'\x20'+_0x4bf198[_0x63ac('0x5a')]:_0x4bf198[_0x63ac('0x5a')],'id':_0x4bf198['id']};_0x2656fe['$se_module']=_[_0x63ac('0x45')](_0x4bf198[_0x63ac('0x56')]);}if(_0x25d6a7[_0x63ac('0x5c')]){_0x2656fe['Call_Duration']=moment[_0x63ac('0x5d')](parseInt(_0x25d6a7[_0x63ac('0x5c')])*0x3e8)['format']('mm:ss');}else if(_0x25d6a7[_0x63ac('0x5e')]&&_0x25d6a7[_0x63ac('0x5f')]){_0x2656fe[_0x63ac('0x60')]=moment[_0x63ac('0x5d')](moment(_0x25d6a7['endtime'],_0x63ac('0x61'))['diff'](moment(_0x25d6a7['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0x63ac('0x2f')](_0x63ac('0x62'));}switch(_0x25d6a7[_0x63ac('0x63')]){case _0x63ac('0x64'):_0x2656fe[_0x63ac('0x65')]=_0x63ac('0x66');break;case _0x63ac('0x67'):case'connect':_0x2656fe[_0x63ac('0x65')]=_0x63ac('0x68');break;case'rejected':_0x2656fe[_0x63ac('0x65')]=_0x63ac('0x69');break;case _0x63ac('0x6a'):_0x2656fe[_0x63ac('0x65')]=_0x63ac('0x6b');break;case _0x63ac('0x6c'):_0x2656fe[_0x63ac('0x65')]=_0x63ac('0x6d');default:}_0x2656fe[_0x63ac('0x6e')]=(_0x5aec5c==='outbound'?moment(_0x25d6a7['starttime'])[_0x63ac('0x2f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x25d6a7[_0x63ac('0x6f')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x63ac('0x2f')](_0x63ac('0x61'));_0x2656fe[_0x63ac('0x70')]=_0x5aec5c||_0x63ac('0x71');_0x2656fe=_['merge'](_0x2656fe,getCustomFields(_0x254790[_0x63ac('0x72')],_0x25d6a7));return request({'method':_0x63ac('0x3d'),'uri':_0x63ac('0x3e')+_0x4a8174+_0x63ac('0x73'),'headers':{'Authorization':_0x63ac('0x31')+_0x123a2e},'body':{'data':[_0x2656fe]},'json':!![]})[_0x63ac('0x28')](function(_0x2eb7b8){if(_0x2eb7b8&&_0x2eb7b8[_0x63ac('0x3c')][0x0][_0x63ac('0x43')]===_0x63ac('0x44')){logger[_0x63ac('0x2e')](_0x63ac('0x74'));return{'id':_0x2eb7b8[_0x63ac('0x3c')][0x0][_0x63ac('0x75')]['id']};}})[_0x63ac('0x2a')](function(_0xb0b82d){logger[_0x63ac('0x2e')](_0x63ac('0x76'),_0xb0b82d[_0x63ac('0x2d')]);console['log'](_0x63ac('0x76'),_0xb0b82d);});}exports[_0x63ac('0x77')]=function(_0xd9009a,_0x52639f,_0x29cbd5,_0x3b8a64,_0x47217f,_0x241ea0){var _0xa8d3b0,_0x571c8c,_0x3e8e3e;_0x241ea0[_0x63ac('0x78')]=intUtil[_0x63ac('0x79')](_0x241ea0[_0x63ac('0x78')]);_0x241ea0[_0x63ac('0x7a')]=intUtil[_0x63ac('0x79')](_0x241ea0['serverUrl']);if(_0x47217f&&_0x47217f[_0x63ac('0x7b')]){logger[_0x63ac('0x2e')](_0x63ac('0x7c'),_0x63ac('0x7d'));_0x52639f[_0x63ac('0x7e')]=_0x241ea0['serverUrl']+_0x63ac('0x7f')+_0x52639f['uniqueid']+_0x63ac('0x80')+md5(_0x52639f[_0x63ac('0x81')]);}else{_0x52639f['recordingURL']='';}var _0x1db7f9=_0x241ea0['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x241ea0)[_0x63ac('0x28')](function(_0x189393){_0x3e8e3e=_0x189393;return getUser(_0x3e8e3e,_0x1db7f9,_0x241ea0,_0x3b8a64[_0x63ac('0x33')]);})[_0x63ac('0x28')](function(_0x45f633){_0xa8d3b0=_0x45f633;logger[_0x63ac('0x2e')]('The\x20User\x20ID\x20is:',_0xa8d3b0['id']);return getEndUser(_0x3e8e3e,_0x1db7f9,_0x241ea0,_0x52639f['calleridname'],_0x52639f[_0x63ac('0x82')],_0xa8d3b0,_0x29cbd5);})[_0x63ac('0x28')](function(_0x46afeb){_0x571c8c=_0x46afeb;return getCall(_0x3e8e3e,_0x1db7f9,_0x241ea0,_0xa8d3b0,_0x571c8c,_0x29cbd5,_0x52639f,'Inbound');})['then'](function(_0x43368f){if(_0x43368f){logger[_0x63ac('0x2e')](_0x63ac('0x83'),_0x43368f['id']);logger['info'](_0x63ac('0x7c'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x63ac('0x2f')](_0x63ac('0x84'),_0x3b8a64[_0x63ac('0x1a')]),'trigger:browser:url',{'uri':_0x63ac('0x85')+_0x241ea0[_0x63ac('0x78')]+_0x63ac('0x86')+_0x43368f['id']});}})[_0x63ac('0x2a')](function(_0x4a00e6){logger['error'](_0x63ac('0x7c'),JSON[_0x63ac('0x10')](_0x4a00e6));});};exports['outbound']=function(_0x2e3546,_0x476540,_0x539f5e,_0xc4b7ae,_0x5273dd,_0x4a427b,_0x517afc){var _0x17511c,_0x5a1dc0,_0x1bfe77;_0x4a427b[_0x63ac('0x78')]=intUtil[_0x63ac('0x79')](_0x4a427b[_0x63ac('0x78')]);_0x4a427b[_0x63ac('0x7a')]=intUtil[_0x63ac('0x79')](_0x4a427b[_0x63ac('0x7a')]);if(_0x517afc&&_0x517afc[_0x63ac('0x87')]&&_0x517afc[_0x63ac('0x87')]!==_0x63ac('0x88')){logger[_0x63ac('0x2e')](_0x63ac('0x89'),_0x63ac('0x7d'));_0x476540['recordingURL']=_0x4a427b['serverUrl']+'/api/voice/recordings/'+_0x476540[_0x63ac('0x81')]+_0x63ac('0x80')+md5(_0x476540[_0x63ac('0x81')]);}var _0x2ce6a5=_0x4a427b[_0x63ac('0x78')]===_0x63ac('0x8a')?'eu':_0x63ac('0x8b');return getAccessToken(_0x4a427b)['then'](function(_0x3c8f15){_0x1bfe77=_0x3c8f15;return getUser(_0x1bfe77,_0x2ce6a5,_0x4a427b,_0xc4b7ae[_0x63ac('0x33')]);})[_0x63ac('0x28')](function(_0x1ed219){_0x17511c=_0x1ed219;logger[_0x63ac('0x2e')](_0x63ac('0x8c'),_0x17511c['id']);return getEndUser(_0x1bfe77,_0x2ce6a5,_0x4a427b,_0x476540[_0x63ac('0x8d')],_0x476540[_0x63ac('0x8e')],_0x17511c,_0x539f5e);})[_0x63ac('0x28')](function(_0x3aa840){_0x5a1dc0=_0x3aa840;return getCall(_0x1bfe77,_0x2ce6a5,_0x4a427b,_0x17511c,_0x5a1dc0,_0x539f5e,_0x476540,_0x63ac('0x8f'));})['then'](function(_0x36be89){if(_0x36be89){logger[_0x63ac('0x2e')](_0x63ac('0x83'),_0x36be89['id']);logger[_0x63ac('0x2e')](_0x63ac('0x89'),_0x63ac('0x90'));emit(util['format']('user:%s',_0xc4b7ae[_0x63ac('0x1a')]),_0x63ac('0x91'),{'uri':_0x63ac('0x85')+_0x4a427b['host']+_0x63ac('0x86')+_0x36be89['id']});}})['catch'](function(_0x12e28e){logger[_0x63ac('0x2b')](_0x63ac('0x89'),JSON[_0x63ac('0x10')](_0x12e28e));});};exports[_0x63ac('0x92')]=function(_0x1cdd37,_0x10b206,_0x4ab76d,_0x1322ff,_0x41779e,_0x45c1c3){var _0x54af10,_0xff33f3,_0x493bf6;_0x45c1c3['host']=intUtil[_0x63ac('0x79')](_0x45c1c3['host']);_0x45c1c3[_0x63ac('0x7a')]=intUtil['stripTrailingSlash'](_0x45c1c3[_0x63ac('0x7a')]);if(_0x41779e&&_0x41779e[_0x63ac('0x7b')]){logger['info']('['+_0x10b206[_0x63ac('0x63')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x10b206[_0x63ac('0x7e')]=_0x45c1c3[_0x63ac('0x7a')]+_0x63ac('0x7f')+_0x10b206['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x10b206[_0x63ac('0x81')]);}else{_0x10b206[_0x63ac('0x7e')]='';}var _0x2fb7a7=_0x45c1c3['host']===_0x63ac('0x8a')?'eu':'com';return getAccessToken(_0x45c1c3)[_0x63ac('0x28')](function(_0x1c05d5){_0x493bf6=_0x1c05d5;return getUser(_0x493bf6,_0x2fb7a7,_0x45c1c3);})[_0x63ac('0x28')](function(_0x3c5231){_0x54af10=_0x3c5231;logger[_0x63ac('0x2e')](_0x63ac('0x8c'),_0x54af10['id']);return getEndUser(_0x493bf6,_0x2fb7a7,_0x45c1c3,_0x10b206[_0x63ac('0x93')],_0x10b206[_0x63ac('0x82')],_0x54af10,_0x4ab76d);})[_0x63ac('0x28')](function(_0x5c8f54){_0xff33f3=_0x5c8f54;return getCall(_0x493bf6,_0x2fb7a7,_0x45c1c3,_0x54af10,_0xff33f3,_0x4ab76d,_0x10b206,_0x63ac('0x71'));})[_0x63ac('0x28')](function(_0x288e14){if(_0x288e14){logger[_0x63ac('0x2e')](_0x63ac('0x83'),_0x288e14['id']);}})['catch'](function(_0x1e81c5){logger[_0x63ac('0x2b')]('['+_0x10b206[_0x63ac('0x63')]['toUpperCase']()+']',JSON[_0x63ac('0x10')](_0x1e81c5));});}; \ No newline at end of file +var _0x51a2=['format','mm:ss','answertime','endtime','utc','diff','YYYY-MM-DDTHH:mm:ss','lastevent','Called','complete','connect','Call_Result','Answered','rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','host','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridnum','https://crm.','unmanaged','toUpperCase','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','emit','debug','[HTTP]','length','includes','string','idField','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','isNil','isBefore','expires_in','access_token','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','stack','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','Error:\x20','log','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','What_Id','Last_Name','$se_module','talktime','Call_Duration'];(function(_0x2166df,_0x2f1bca){var _0x1e591a=function(_0x1b87aa){while(--_0x1b87aa){_0x2166df['push'](_0x2166df['shift']());}};_0x1e591a(++_0x2f1bca);}(_0x51a2,0x15c));var _0x251a=function(_0x33d930,_0x560b76){_0x33d930=_0x33d930-0x0;var _0x3e1ddd=_0x51a2[_0x33d930];return _0x3e1ddd;};'use strict';var _=require('lodash');var rp=require(_0x251a('0x0'));var md5=require(_0x251a('0x1'));var util=require('util');var intUtil=require(_0x251a('0x2'));var moment=require(_0x251a('0x3'));var Redis=require(_0x251a('0x4'));var BPromise=require(_0x251a('0x5'));var config=require(_0x251a('0x6'));var logger=require(_0x251a('0x7'))(_0x251a('0x8'));config[_0x251a('0x9')]=_['defaults'](config[_0x251a('0x9')],{'host':_0x251a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x251a('0x9')]));function emit(_0x5125eb,_0x259a0f,_0x2de762){io['to'](_0x5125eb)[_0x251a('0xb')](_0x259a0f,_0x2de762);}function request(_0x3b5068){logger[_0x251a('0xc')](_0x251a('0xd'),JSON['stringify'](_0x3b5068));return rp(_0x3b5068);}function getCustomFields(_0x5e7f79,_0xd6fe0a){var _0x21e85f={};if(_0x5e7f79[_0x251a('0xe')]>0x0){_['forEach'](_0x5e7f79,function(_0x32cb83){if(_[_0x251a('0xf')]([_0x251a('0x10'),'picklist'],_0x32cb83['type'])&&_0x32cb83[_0x251a('0x11')]){_0x21e85f[_0x32cb83[_0x251a('0x11')]]=_0x32cb83['content']['toString']();}else if(_0x32cb83[_0x251a('0x12')]===_0x251a('0x13')&&_0x32cb83['variableName']&&_0x32cb83[_0x251a('0x11')]&&_0xd6fe0a[_0x32cb83[_0x251a('0x14')]]){_0x21e85f[_0x32cb83['idField']]=_0xd6fe0a[_0x32cb83[_0x251a('0x14')]][_0x251a('0x15')]();}else if(_0x32cb83['type']===_0x251a('0x16')&&_0x32cb83['Variable']&&_0x32cb83[_0x251a('0x17')][_0x251a('0x18')]&&_0x32cb83[_0x251a('0x11')]&&_0xd6fe0a[_0x32cb83[_0x251a('0x17')]['name']['toLowerCase']()]){_0x21e85f[_0x32cb83[_0x251a('0x11')]]=_0xd6fe0a[_0x32cb83[_0x251a('0x17')][_0x251a('0x18')][_0x251a('0x19')]()][_0x251a('0x15')]();}});}return _0x21e85f;}function getName(_0x59df02){if(_0x59df02[_0x251a('0x1a')]('\x20')>0x0){var _0x10859c=_0x59df02['split'](/ (.+)/);if(_0x10859c[0x1]){return _0x10859c;}}return[_0x59df02,_0x59df02];}var accountsTokens={};function getAccessToken(_0x314963){return new Promise(function(_0x162ed3,_0x4f39b2){if(!_[_0x251a('0x1b')](accountsTokens[_0x314963['id']])&&!_[_0x251a('0x1b')](accountsTokens[_0x314963['id']]['access_token'])){if(moment()[_0x251a('0x1c')](accountsTokens[_0x314963['id']][_0x251a('0x1d')])){_0x162ed3(accountsTokens[_0x314963['id']][_0x251a('0x1e')]);}}var _0x28a292;switch(_0x314963['zone']){case'US':_0x28a292=_0x251a('0x1f');break;case'AU':_0x28a292=_0x251a('0x20');break;case'EU':_0x28a292='https://accounts.zoho.eu';break;case'IN':_0x28a292=_0x251a('0x21');break;case'CN':_0x28a292=_0x251a('0x22');break;default:_0x28a292=_0x251a('0x23');break;}var _0x1b3bdd={'method':_0x251a('0x24'),'uri':_0x28a292+_0x251a('0x25'),'qs':{'refresh_token':_0x314963[_0x251a('0x26')],'client_id':_0x314963[_0x251a('0x27')],'client_secret':_0x314963[_0x251a('0x28')],'grant_type':_0x251a('0x29')},'json':!![]};return rp(_0x1b3bdd)[_0x251a('0x2a')](function(_0x5d45ff){accountsTokens[_0x314963['id']]={'access_token':_0x5d45ff['access_token'],'expires_in':moment()[_0x251a('0x2b')](_0x5d45ff['expires_in'],'seconds')};_0x162ed3(_0x5d45ff[_0x251a('0x1e')]);})[_0x251a('0x2c')](function(_0x3745c0){logger[_0x251a('0x2d')]('Failing\x20creating\x20the\x20access_token',_0x3745c0[_0x251a('0x2e')]);_0x4f39b2(_0x3745c0);});});}function getUser(_0x56f85b,_0x3e7ec1,_0x5664ad,_0x5a2a29){logger[_0x251a('0x2f')](_0x251a('0x30'));return request({'method':'GET','uri':util['format'](_0x251a('0x31'),_0x3e7ec1),'qs':{'type':_0x251a('0x32')},'headers':{'Authorization':_0x251a('0x33')+_0x56f85b},'json':!![]})[_0x251a('0x2a')](function(_0x5e01cc){if(_0x5e01cc[_0x251a('0x34')]){var _0x5b6d99=-0x1;if(_[_0x251a('0x35')](_0x5e01cc[_0x251a('0x34')])){if(!_['isNil'](_0x5a2a29)){_0x5b6d99=_[_0x251a('0x36')](_0x5e01cc[_0x251a('0x34')],function(_0x18cb95){return _0x18cb95[_0x251a('0x37')]===_0x5a2a29;});}if(_0x5b6d99>=0x0){logger[_0x251a('0x2f')]('Agent\x20found!');}else{logger[_0x251a('0x2f')](_0x251a('0x38'));_0x5b6d99=_[_0x251a('0x36')](_0x5e01cc[_0x251a('0x34')],function(_0x575f19){return _0x575f19[_0x251a('0x39')]['name']===_0x251a('0x3a');});}return _0x5e01cc['users'][_0x5b6d99];}else{if(_0x5e01cc['user'][_0x251a('0x39')][_0x251a('0x18')]===_0x251a('0x3a')){logger['info'](_0x251a('0x38'));user=_0x5e01cc['user'];return user;}else{logger['error'](_0x251a('0x3b'),JSON[_0x251a('0x3c')](_0x5e01cc));throw new Error(_0x251a('0x3d')+JSON[_0x251a('0x3c')](_0x5e01cc));}}}else{logger[_0x251a('0x2d')](_0x251a('0x3b'),JSON['stringify'](_0x5e01cc));throw new Error(_0x251a('0x3d')+JSON[_0x251a('0x3c')](_0x5e01cc));}})[_0x251a('0x2c')](function(_0xfbc05){console[_0x251a('0x2d')](_0xfbc05);});}function getZohoUser(_0x7650ca,_0x585cf3){return new BPromise(function(_0x9b62e1,_0x36272e){request(_0x7650ca)[_0x251a('0x2a')](function(_0x3d95ac){var _0x2119a3=null;if(_0x3d95ac){_0x2119a3=_0x3d95ac['data'][0x0];_0x2119a3[_0x251a('0x3e')]=_0x585cf3;}_0x9b62e1(_0x2119a3);})[_0x251a('0x2c')](function(_0x52078a){_0x36272e(_0x52078a);});});}function createEndUser(_0x56da39,_0x5ec1b4,_0x1dbfa5,_0x231703,_0x30cc07,_0x433fb8){var _0x1dbfa5=getName(_0x1dbfa5);return request({'method':_0x251a('0x24'),'uri':_0x251a('0x3f')+_0x5ec1b4+_0x251a('0x40')+_[_0x251a('0x41')](_0x433fb8[_0x251a('0x42')])+'s','body':{'data':[{'Last_Name':_0x1dbfa5[0x1],'First_Name':_0x1dbfa5[0x0],'Phone':_0x231703,'Owner':{'name':!_[_0x251a('0x1b')](_0x30cc07['role'][_0x251a('0x18')])?_0x30cc07[_0x251a('0x43')][_0x251a('0x18')]:!_[_0x251a('0x1b')](_0x30cc07[_0x251a('0x44')])?_0x30cc07[_0x251a('0x44')]+'\x20'+_0x30cc07['last_name']:_0x30cc07[_0x251a('0x45')],'id':_0x30cc07['id']}}]},'headers':{'Authorization':_0x251a('0x33')+_0x56da39},'json':!![]})[_0x251a('0x2a')](function(_0x4044c0){if(_0x4044c0&&_0x4044c0[_0x251a('0x46')][0x0][_0x251a('0x47')]===_0x251a('0x48')){var _0x4bb258=_0x4044c0['data'][0x0][_0x251a('0x49')];_0x4bb258[_0x251a('0x3e')]=_[_0x251a('0x41')](_0x433fb8['moduleCreate'])+'s';return _0x4bb258;}logger[_0x251a('0x2d')]('The\x20failing\x20result\x20is',JSON[_0x251a('0x3c')](data));throw new Error(_0x251a('0x4a')+JSON['stringify'](data));})['catch'](function(_0x5df6d5){console[_0x251a('0x4b')]('CREATE\x20ERROR',_0x5df6d5);});}function getEndUser(_0x2bebf9,_0x63a39f,_0x5d1029,_0xa97999,_0x1702a3,_0x56fec6,_0x1cefab){var _0x4977d3={'method':_0x251a('0x4c'),'uri':'','headers':{'Authorization':_0x251a('0x33')+_0x2bebf9},'json':!![]};switch(_0x1cefab[_0x251a('0x4d')]){case _0x251a('0x4e'):_0x4977d3[_0x251a('0x4f')]=_0x251a('0x3f')+_0x63a39f+_0x251a('0x50')+_0x1702a3+'))';return getZohoUser(_0x4977d3,_0x251a('0x51'))[_0x251a('0x2a')](function(_0x17be4a){if(_0x17be4a)return _0x17be4a;_0x4977d3[_0x251a('0x4f')]=_0x251a('0x3f')+_0x63a39f+_0x251a('0x52')+_0x1702a3+'))';return getZohoUser(_0x4977d3,'Leads')[_0x251a('0x2a')](function(_0x4edc6b){if(_0x4edc6b)return _0x4edc6b;if(_0x1cefab[_0x251a('0x42')]!=_0x251a('0x53')){return createEndUser(_0x2bebf9,_0x63a39f,_0xa97999,_0x1702a3,_0x56fec6,_0x1cefab);}else{return{};}});});break;case'contact':_0x4977d3[_0x251a('0x4f')]=_0x251a('0x3f')+_0x63a39f+_0x251a('0x50')+_0x1702a3+'))';return getZohoUser(_0x4977d3,_0x251a('0x51'))[_0x251a('0x2a')](function(_0x30f9c4){if(_0x30f9c4)return _0x30f9c4;if(_0x1cefab[_0x251a('0x42')]!=_0x251a('0x53')){return createEndUser(_0x2bebf9,_0x63a39f,_0xa97999,_0x1702a3,_0x56fec6,_0x1cefab);}else{return{};}});break;case _0x251a('0x54'):_0x4977d3[_0x251a('0x4f')]='https://www.zohoapis.'+_0x63a39f+_0x251a('0x52')+_0x1702a3+'))';return getZohoUser(_0x4977d3,'Leads')[_0x251a('0x2a')](function(_0x8488fa){if(_0x8488fa)return _0x8488fa;if(_0x1cefab[_0x251a('0x42')]!=_0x251a('0x53')){return createEndUser(_0x2bebf9,_0x63a39f,_0xa97999,_0x1702a3,_0x56fec6,_0x1cefab);}else{return{};}});break;}}function getCall(_0x5be3a0,_0x1d2675,_0x5e4128,_0xbca960,_0x306827,_0x4718cd,_0x13767c,_0x3067cb){logger[_0x251a('0x2f')](_0x251a('0x55'));var _0x155997={};_0x155997[_0x251a('0x56')]={'name':!_['isNil'](_0xbca960[_0x251a('0x43')][_0x251a('0x18')])&&!_[_0x251a('0x1b')](_0xbca960[_0x251a('0x39')]['name'])&&_0xbca960[_0x251a('0x39')][_0x251a('0x18')]==='administrator'?_0xbca960['role'][_0x251a('0x18')]:!_[_0x251a('0x1b')](_0xbca960[_0x251a('0x44')])?_0xbca960[_0x251a('0x44')]+'\x20'+_0xbca960[_0x251a('0x45')]:_0xbca960['last_name'],'id':_0xbca960['id']};_0x155997[_0x251a('0x57')]=intUtil[_0x251a('0x58')](_0x4718cd[_0x251a('0x59')],_0x13767c,'\x20');_0x155997['Description']=intUtil[_0x251a('0x58')](_0x4718cd[_0x251a('0x5a')],_0x13767c,'\x0a');if(_0x306827[_0x251a('0x3e')]==='Contacts'){_0x155997[_0x251a('0x5b')]={'name':!_[_0x251a('0x1b')](_0x306827[_0x251a('0x5c')])?_0x306827['Full_Name']:!_['isNil'](_0x306827['First_Name'])?_0x306827[_0x251a('0x5d')]+'\x20'+_0x306827['Last_Name']:_0x306827['Last_Name'],'id':_0x306827['id']};}if(_0x306827['enduserType']==='Leads'){_0x155997[_0x251a('0x5e')]={'name':!_[_0x251a('0x1b')](_0x306827[_0x251a('0x5c')])?_0x306827[_0x251a('0x5c')]:!_[_0x251a('0x1b')](_0x306827[_0x251a('0x5d')])?_0x306827[_0x251a('0x5d')]+'\x20'+_0x306827[_0x251a('0x5f')]:_0x306827[_0x251a('0x5f')],'id':_0x306827['id']};_0x155997[_0x251a('0x60')]=_[_0x251a('0x41')](_0x306827[_0x251a('0x3e')]);}if(_0x13767c[_0x251a('0x61')]){_0x155997[_0x251a('0x62')]=moment['utc'](parseInt(_0x13767c[_0x251a('0x61')])*0x3e8)[_0x251a('0x63')](_0x251a('0x64'));}else if(_0x13767c[_0x251a('0x65')]&&_0x13767c[_0x251a('0x66')]){_0x155997[_0x251a('0x62')]=moment[_0x251a('0x67')](moment(_0x13767c['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x251a('0x68')](moment(_0x13767c['starttime'],_0x251a('0x69'))))[_0x251a('0x63')](_0x251a('0x64'));}switch(_0x13767c[_0x251a('0x6a')]){case'called':_0x155997['Call_Result']=_0x251a('0x6b');break;case _0x251a('0x6c'):case _0x251a('0x6d'):_0x155997[_0x251a('0x6e')]=_0x251a('0x6f');break;case _0x251a('0x70'):_0x155997[_0x251a('0x6e')]='Rejected';break;case _0x251a('0x71'):_0x155997[_0x251a('0x6e')]='Abandoned';break;case _0x251a('0x72'):_0x155997[_0x251a('0x6e')]=_0x251a('0x73');default:}_0x155997[_0x251a('0x74')]=(_0x3067cb===_0x251a('0x75')?moment(_0x13767c[_0x251a('0x76')])['format'](_0x251a('0x69')):moment(_0x13767c['agentcalledAt'])['format'](_0x251a('0x69')))||moment()[_0x251a('0x63')](_0x251a('0x69'));_0x155997[_0x251a('0x77')]=_0x3067cb||_0x251a('0x78');_0x155997=_[_0x251a('0x79')](_0x155997,getCustomFields(_0x4718cd[_0x251a('0x7a')],_0x13767c));return request({'method':_0x251a('0x24'),'uri':_0x251a('0x3f')+_0x1d2675+_0x251a('0x7b'),'headers':{'Authorization':_0x251a('0x33')+_0x5be3a0},'body':{'data':[_0x155997]},'json':!![]})[_0x251a('0x2a')](function(_0x31fd88){if(_0x31fd88&&_0x31fd88[_0x251a('0x46')][0x0]['code']===_0x251a('0x48')){logger[_0x251a('0x2f')]('Call\x20created!');return{'id':_0x31fd88[_0x251a('0x46')][0x0][_0x251a('0x49')]['id']};}})[_0x251a('0x2c')](function(_0x9e2ac8){logger['info'](_0x251a('0x7c'),_0x9e2ac8[_0x251a('0x2e')]);console[_0x251a('0x4b')](_0x251a('0x7c'),_0x9e2ac8);});}exports['queue']=function(_0xd87e53,_0x27aae0,_0x813be3,_0x166b93,_0x4393cc,_0x5f456b){var _0x5a70c0,_0x337c9d,_0x2babb7;_0x5f456b['host']=intUtil['stripTrailingSlash'](_0x5f456b[_0x251a('0x7d')]);_0x5f456b[_0x251a('0x7e')]=intUtil[_0x251a('0x7f')](_0x5f456b[_0x251a('0x7e')]);if(_0x4393cc&&_0x4393cc[_0x251a('0x80')]){logger[_0x251a('0x2f')]('[QUEUE]',_0x251a('0x81'));_0x27aae0['recordingURL']=_0x5f456b[_0x251a('0x7e')]+_0x251a('0x82')+_0x27aae0[_0x251a('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x27aae0[_0x251a('0x83')]);}else{_0x27aae0[_0x251a('0x84')]='';}var _0x24c4e2=_0x5f456b['host']===_0x251a('0x85')?'eu':'com';return getAccessToken(_0x5f456b)['then'](function(_0x486921){_0x2babb7=_0x486921;return getUser(_0x2babb7,_0x24c4e2,_0x5f456b,_0x166b93['email']);})[_0x251a('0x2a')](function(_0x24328d){_0x5a70c0=_0x24328d;logger['info'](_0x251a('0x86'),_0x5a70c0['id']);return getEndUser(_0x2babb7,_0x24c4e2,_0x5f456b,_0x27aae0[_0x251a('0x87')],_0x27aae0[_0x251a('0x88')],_0x5a70c0,_0x813be3);})[_0x251a('0x2a')](function(_0x5b3151){_0x337c9d=_0x5b3151;return getCall(_0x2babb7,_0x24c4e2,_0x5f456b,_0x5a70c0,_0x337c9d,_0x813be3,_0x27aae0,'Inbound');})[_0x251a('0x2a')](function(_0x3eaa4a){if(_0x3eaa4a){logger[_0x251a('0x2f')](_0x251a('0x89'),_0x3eaa4a['id']);logger[_0x251a('0x2f')](_0x251a('0x8a'),_0x251a('0x8b'));emit(util[_0x251a('0x63')]('user:%s',_0x166b93[_0x251a('0x18')]),_0x251a('0x8c'),{'uri':'https://crm.'+_0x5f456b[_0x251a('0x7d')]+_0x251a('0x8d')+_0x3eaa4a['id']});}})['catch'](function(_0x478495){logger[_0x251a('0x2d')](_0x251a('0x8a'),JSON[_0x251a('0x3c')](_0x478495));});};exports[_0x251a('0x75')]=function(_0x119385,_0x8b6b38,_0x3b0c4d,_0x5fc815,_0x52ede0,_0x562150,_0x1ead83){var _0x5e65a6,_0x487493,_0x3ee5c6;_0x562150[_0x251a('0x7d')]=intUtil[_0x251a('0x7f')](_0x562150[_0x251a('0x7d')]);_0x562150[_0x251a('0x7e')]=intUtil[_0x251a('0x7f')](_0x562150[_0x251a('0x7e')]);if(_0x1ead83&&_0x1ead83[_0x251a('0x8e')]&&_0x1ead83[_0x251a('0x8e')]!=='none'){logger[_0x251a('0x2f')](_0x251a('0x8f'),'Recording\x20is\x20enabled!');_0x8b6b38['recordingURL']=_0x562150[_0x251a('0x7e')]+_0x251a('0x82')+_0x8b6b38[_0x251a('0x83')]+_0x251a('0x90')+md5(_0x8b6b38[_0x251a('0x83')]);}var _0x2dd7e4=_0x562150[_0x251a('0x7d')]===_0x251a('0x85')?'eu':'com';return getAccessToken(_0x562150)[_0x251a('0x2a')](function(_0x2bc923){_0x3ee5c6=_0x2bc923;return getUser(_0x3ee5c6,_0x2dd7e4,_0x562150,_0x5fc815['email']);})[_0x251a('0x2a')](function(_0x883083){_0x5e65a6=_0x883083;logger[_0x251a('0x2f')]('The\x20User\x20ID\x20is:',_0x5e65a6['id']);return getEndUser(_0x3ee5c6,_0x2dd7e4,_0x562150,_0x8b6b38['destcalleridname'],_0x8b6b38[_0x251a('0x91')],_0x5e65a6,_0x3b0c4d);})['then'](function(_0x212f26){_0x487493=_0x212f26;return getCall(_0x3ee5c6,_0x2dd7e4,_0x562150,_0x5e65a6,_0x487493,_0x3b0c4d,_0x8b6b38,'Outbound');})['then'](function(_0x2c54d2){if(_0x2c54d2){logger['info'](_0x251a('0x89'),_0x2c54d2['id']);logger['info']('[OUTBOUND]',_0x251a('0x8b'));emit(util[_0x251a('0x63')]('user:%s',_0x5fc815[_0x251a('0x18')]),_0x251a('0x8c'),{'uri':_0x251a('0x92')+_0x562150['host']+_0x251a('0x8d')+_0x2c54d2['id']});}})[_0x251a('0x2c')](function(_0x1d2e28){logger['error'](_0x251a('0x8f'),JSON[_0x251a('0x3c')](_0x1d2e28));});};exports[_0x251a('0x93')]=function(_0x1fac36,_0x405511,_0x408aa2,_0x5ae30f,_0x3e3a39,_0x2cae86){var _0x45466d,_0x450185,_0x24409c;_0x2cae86[_0x251a('0x7d')]=intUtil[_0x251a('0x7f')](_0x2cae86[_0x251a('0x7d')]);_0x2cae86[_0x251a('0x7e')]=intUtil[_0x251a('0x7f')](_0x2cae86['serverUrl']);if(_0x3e3a39&&_0x3e3a39[_0x251a('0x80')]){logger['info']('['+_0x405511['lastevent'][_0x251a('0x94')]()+']',_0x251a('0x81'));_0x405511[_0x251a('0x84')]=_0x2cae86['serverUrl']+_0x251a('0x82')+_0x405511[_0x251a('0x83')]+_0x251a('0x90')+md5(_0x405511[_0x251a('0x83')]);}else{_0x405511['recordingURL']='';}var _0x3c5f56=_0x2cae86[_0x251a('0x7d')]===_0x251a('0x85')?'eu':'com';return getAccessToken(_0x2cae86)[_0x251a('0x2a')](function(_0x5dcb91){_0x24409c=_0x5dcb91;return getUser(_0x24409c,_0x3c5f56,_0x2cae86);})[_0x251a('0x2a')](function(_0x2f80a6){_0x45466d=_0x2f80a6;logger[_0x251a('0x2f')](_0x251a('0x86'),_0x45466d['id']);return getEndUser(_0x24409c,_0x3c5f56,_0x2cae86,_0x405511[_0x251a('0x87')],_0x405511[_0x251a('0x88')],_0x45466d,_0x408aa2);})[_0x251a('0x2a')](function(_0x5e9d7a){_0x450185=_0x5e9d7a;return getCall(_0x24409c,_0x3c5f56,_0x2cae86,_0x45466d,_0x450185,_0x408aa2,_0x405511,_0x251a('0x78'));})[_0x251a('0x2a')](function(_0x2a2b3b){if(_0x2a2b3b){logger[_0x251a('0x2f')](_0x251a('0x89'),_0x2a2b3b['id']);}})[_0x251a('0x2c')](function(_0x13ccc6){logger[_0x251a('0x2d')]('['+_0x405511[_0x251a('0x6a')][_0x251a('0x94')]()+']',JSON[_0x251a('0x3c')](_0x13ccc6));});}; \ 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 63db4c1..d07e2e5 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 _0x4701=['shelljs','mustache','trigger','exec','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format'];(function(_0x4478a5,_0x2ca5ec){var _0x225873=function(_0x3ec40c){while(--_0x3ec40c){_0x4478a5['push'](_0x4478a5['shift']());}};_0x225873(++_0x2ca5ec);}(_0x4701,0x79));var _0x1470=function(_0x5cb416,_0x3c85b5){_0x5cb416=_0x5cb416-0x0;var _0x38c095=_0x4701[_0x5cb416];return _0x38c095;};'use strict';var util=require('util');var sh=require(_0x1470('0x0'));var Mustache=require(_0x1470('0x1'));var logger=require('../../../../config/logger')(_0x1470('0x2'));exports[_0x1470('0x3')]=function(_0xeb6471,_0x59b0ec){var _0x2aaa12=_0xeb6471[_0x1470('0x4')]?_0xeb6471['data2']:_0x1470('0x5');var _0x5f47e9=_0xeb6471[_0x1470('0x6')]?Mustache[_0x1470('0x7')](_0xeb6471[_0x1470('0x6')],_0x59b0ec):_0x59b0ec;sh['exec'](_0x5f47e9,function(_0xcc94dd,_0x94424e,_0x4c3b9f){if(_0xcc94dd!==0x0){logger[_0x1470('0x8')](util['format'](_0x1470('0x9'),_0x2aaa12,_0x5f47e9,_0xcc94dd,_0x4c3b9f));}else{logger['info'](util[_0x1470('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x2aaa12,_0x5f47e9,_0x94424e));}});}; \ No newline at end of file +var _0x7279=['error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','data2','Script','data3','render'];(function(_0x480172,_0x249c80){var _0x5e4b66=function(_0x4295e3){while(--_0x4295e3){_0x480172['push'](_0x480172['shift']());}};_0x5e4b66(++_0x249c80);}(_0x7279,0x67));var _0x9727=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7279[_0x2641f9];return _0x585741;};'use strict';var util=require(_0x9727('0x0'));var sh=require(_0x9727('0x1'));var Mustache=require(_0x9727('0x2'));var logger=require(_0x9727('0x3'))(_0x9727('0x4'));exports['exec']=function(_0x1f9277,_0x19b91c){var _0x27b1d2=_0x1f9277['data2']?_0x1f9277[_0x9727('0x5')]:_0x9727('0x6');var _0x291d8c=_0x1f9277[_0x9727('0x7')]?Mustache[_0x9727('0x8')](_0x1f9277[_0x9727('0x7')],_0x19b91c):_0x19b91c;sh['exec'](_0x291d8c,function(_0x3052f6,_0x590cad,_0x5a0933){if(_0x3052f6!==0x0){logger[_0x9727('0x9')](util[_0x9727('0xa')](_0x9727('0xb'),_0x27b1d2,_0x291d8c,_0x3052f6,_0x5a0933));}else{logger[_0x9727('0xc')](util[_0x9727('0xa')](_0x9727('0xd'),_0x27b1d2,_0x291d8c,_0x590cad));}});}; \ 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 a21df10..91aea1c 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 _0x555c=['body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil','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','message','request-promise','util','lodash','../../../../config/logger','trigger','render','number','data5','headers','data6','parse','error','stack','data1','toUpperCase','DELETE','POST','PUT','data7'];(function(_0x179cce,_0x239422){var _0x54ac6d=function(_0x21a7f0){while(--_0x21a7f0){_0x179cce['push'](_0x179cce['shift']());}};_0x54ac6d(++_0x239422);}(_0x555c,0x158));var _0xc555=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x555c[_0x56482c];return _0x5aae7a;};'use strict';var rp=require(_0xc555('0x0'));var util=require(_0xc555('0x1'));var _=require(_0xc555('0x2'));var Mustache=require('mustache');var logger=require(_0xc555('0x3'))(_0xc555('0x4'));exports['exec']=function(_0x140fd5,_0x53b65f){var _0x16a5c4,_0x31e200;var _0x5b8398={'method':_0x140fd5['data1']['toUpperCase'](),'uri':Mustache[_0xc555('0x5')](_0x140fd5['data2'],_0x53b65f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x140fd5['data5'])===_0xc555('0x6')&&parseInt(_0x140fd5[_0xc555('0x7')])>=0x1&&parseInt(_0x140fd5[_0xc555('0x7')])<=0xa?parseInt(_0x140fd5['data5'])*0x3e8:0x5*0x3e8};try{_0x5b8398[_0xc555('0x8')]=_0x140fd5[_0xc555('0x9')]?JSON[_0xc555('0xa')](Mustache[_0xc555('0x5')](_0x140fd5[_0xc555('0x9')],_0x53b65f)):{};}catch(_0x2f0720){logger[_0xc555('0xb')](_0x2f0720[_0xc555('0xc')]);}switch(_0x140fd5[_0xc555('0xd')][_0xc555('0xe')]()){case'GET':case _0xc555('0xf'):_0x16a5c4=null;_0x5b8398['qs']=_0x53b65f;break;case _0xc555('0x10'):case _0xc555('0x11'):if(_0x140fd5['data7']){try{_0x16a5c4=JSON[_0xc555('0xa')](Mustache[_0xc555('0x5')](_0x140fd5[_0xc555('0x12')],_0x53b65f));_0x5b8398[_0xc555('0x13')]=_0x16a5c4;}catch(_0x59493e){logger['error'](_0x59493e['stack']);logger[_0xc555('0xb')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x16a5c4=_0x53b65f;_0x5b8398['body']=_0x16a5c4;}break;}logger[_0xc555('0x14')](util[_0xc555('0x15')](_0xc555('0x16'),_0x140fd5[_0xc555('0xd')],_0x140fd5[_0xc555('0x17')],JSON[_0xc555('0x18')](_0x5b8398)));rp(_0x5b8398)[_0xc555('0x19')](function(_0x2c95a1){_0x16a5c4=!_[_0xc555('0x1a')](_0x16a5c4)?',\x20request\x20body:\x20'+_0x16a5c4:'';_0x31e200=typeof _0x2c95a1[_0xc555('0x13')]===_0xc555('0x1b')?JSON['stringify'](_0x2c95a1[_0xc555('0x13')]):_0x2c95a1[_0xc555('0x13')];logger[_0xc555('0x14')](util[_0xc555('0x15')](_0xc555('0x1c'),_0x140fd5[_0xc555('0xd')],_0x140fd5['data2'],_0x2c95a1[_0xc555('0x1d')],_0x31e200));})[_0xc555('0x1e')](function(_0x3a7d62){logger['error'](util['format'](_0xc555('0x1f'),_0x140fd5['data1'],_0x140fd5[_0xc555('0x17')],_0x3a7d62[_0xc555('0x1d')],_0x3a7d62['name'],_0x3a7d62[_0xc555('0x20')]));});}; \ No newline at end of file +var _0xcc10=['request-promise','util','lodash','mustache','../../../../config/logger','exec','toUpperCase','data5','number','headers','data6','parse','render','error','data1','DELETE','POST','data7','body','stack','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','isNil','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcc10,0x12c));var _0x0cc1=function(_0x52534f,_0x52167){_0x52534f=_0x52534f-0x0;var _0x2f148c=_0xcc10[_0x52534f];return _0x2f148c;};'use strict';var rp=require(_0x0cc1('0x0'));var util=require(_0x0cc1('0x1'));var _=require(_0x0cc1('0x2'));var Mustache=require(_0x0cc1('0x3'));var logger=require(_0x0cc1('0x4'))('trigger');exports[_0x0cc1('0x5')]=function(_0x35b1f2,_0x4d80ff){var _0x2e5938,_0x3394c1;var _0x1eccef={'method':_0x35b1f2['data1'][_0x0cc1('0x6')](),'uri':Mustache['render'](_0x35b1f2['data2'],_0x4d80ff),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x35b1f2[_0x0cc1('0x7')])===_0x0cc1('0x8')&&parseInt(_0x35b1f2[_0x0cc1('0x7')])>=0x1&&parseInt(_0x35b1f2[_0x0cc1('0x7')])<=0xa?parseInt(_0x35b1f2['data5'])*0x3e8:0x5*0x3e8};try{_0x1eccef[_0x0cc1('0x9')]=_0x35b1f2[_0x0cc1('0xa')]?JSON[_0x0cc1('0xb')](Mustache[_0x0cc1('0xc')](_0x35b1f2[_0x0cc1('0xa')],_0x4d80ff)):{};}catch(_0x499c5a){logger[_0x0cc1('0xd')](_0x499c5a['stack']);}switch(_0x35b1f2[_0x0cc1('0xe')]['toUpperCase']()){case'GET':case _0x0cc1('0xf'):_0x2e5938=null;_0x1eccef['qs']=_0x4d80ff;break;case _0x0cc1('0x10'):case'PUT':if(_0x35b1f2[_0x0cc1('0x11')]){try{_0x2e5938=JSON['parse'](Mustache[_0x0cc1('0xc')](_0x35b1f2[_0x0cc1('0x11')],_0x4d80ff));_0x1eccef[_0x0cc1('0x12')]=_0x2e5938;}catch(_0x260dba){logger['error'](_0x260dba[_0x0cc1('0x13')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2e5938=_0x4d80ff;_0x1eccef[_0x0cc1('0x12')]=_0x2e5938;}break;}logger['info'](util[_0x0cc1('0x14')](_0x0cc1('0x15'),_0x35b1f2[_0x0cc1('0xe')],_0x35b1f2[_0x0cc1('0x16')],JSON[_0x0cc1('0x17')](_0x1eccef)));rp(_0x1eccef)['then'](function(_0xb893a2){_0x2e5938=!_[_0x0cc1('0x18')](_0x2e5938)?',\x20request\x20body:\x20'+_0x2e5938:'';_0x3394c1=typeof _0xb893a2[_0x0cc1('0x12')]===_0x0cc1('0x19')?JSON['stringify'](_0xb893a2['body']):_0xb893a2[_0x0cc1('0x12')];logger['info'](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x35b1f2[_0x0cc1('0xe')],_0x35b1f2[_0x0cc1('0x16')],_0xb893a2['statusCode'],_0x3394c1));})[_0x0cc1('0x1a')](function(_0x3ffd4f){logger[_0x0cc1('0xd')](util[_0x0cc1('0x14')](_0x0cc1('0x1b'),_0x35b1f2[_0x0cc1('0xe')],_0x35b1f2[_0x0cc1('0x16')],_0x3ffd4f['statusCode'],_0x3ffd4f[_0x0cc1('0x1c')],_0x3ffd4f[_0x0cc1('0x1d')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 3eebd5e..25f5c92 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 _0xe9de=['client','Request','request','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x29d180,_0x3d3868){var _0x19d3e9=function(_0x2a0682){while(--_0x2a0682){_0x29d180['push'](_0x29d180['shift']());}};_0x19d3e9(++_0x3d3868);}(_0xe9de,0xf3));var _0xee9d=function(_0x12cd0e,_0x4a09bb){_0x12cd0e=_0x12cd0e-0x0;var _0x1898f8=_0xe9de[_0x12cd0e];return _0x1898f8;};'use strict';var jayson=require(_0xee9d('0x0'));var BPromise=require(_0xee9d('0x1'));var logger=require(_0xee9d('0x2'))(_0xee9d('0x3'));var client=jayson[_0xee9d('0x4')]['http']({'port':0x2329});client[_0xee9d('0x5')]=function(_0x4dd5c0,_0x4cba26){return new BPromise(function(_0x4262b5,_0x553002){return client[_0xee9d('0x6')](_0x4dd5c0,_0x4cba26)['then'](function(_0x2d29ac){logger['debug'](_0xee9d('0x7'),_0xee9d('0x3'),_0x4dd5c0,_0x4cba26,_0x2d29ac);if(_0x2d29ac[_0xee9d('0x8')]){logger[_0xee9d('0x8')]('rpc',_0xee9d('0x3'),_0x4dd5c0,_0x2d29ac[_0xee9d('0x8')][_0xee9d('0x9')],_0x4cba26);return _0x553002(_0x2d29ac[_0xee9d('0x8')][_0xee9d('0x9')]);}else{return _0x4262b5(_0x2d29ac[_0xee9d('0xa')]);}})[_0xee9d('0xb')](function(_0x8688af){logger['error']('rpc',_0xee9d('0x3'),_0x4dd5c0,_0x8688af,_0x4cba26);return _0x553002(_0x8688af);});});};module[_0xee9d('0xc')]=client; \ No newline at end of file +var _0xb277=['client','http','Request','request','then','rpc','routing','error','message','result','jayson/promise','bluebird'];(function(_0x6c625c,_0x3c6a94){var _0x3f6753=function(_0x435e48){while(--_0x435e48){_0x6c625c['push'](_0x6c625c['shift']());}};_0x3f6753(++_0x3c6a94);}(_0xb277,0x106));var _0x7b27=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xb277[_0x45e98e];return _0x374dba;};'use strict';var jayson=require(_0x7b27('0x0'));var BPromise=require(_0x7b27('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0x7b27('0x2')][_0x7b27('0x3')]({'port':0x2329});client[_0x7b27('0x4')]=function(_0x2fc7f7,_0x410d93){return new BPromise(function(_0xa3f12d,_0x21484b){return client[_0x7b27('0x5')](_0x2fc7f7,_0x410d93)[_0x7b27('0x6')](function(_0x7ee70c){logger['debug'](_0x7b27('0x7'),_0x7b27('0x8'),_0x2fc7f7,_0x410d93,_0x7ee70c);if(_0x7ee70c[_0x7b27('0x9')]){logger[_0x7b27('0x9')](_0x7b27('0x7'),_0x7b27('0x8'),_0x2fc7f7,_0x7ee70c[_0x7b27('0x9')][_0x7b27('0xa')],_0x410d93);return _0x21484b(_0x7ee70c[_0x7b27('0x9')][_0x7b27('0xa')]);}else{return _0xa3f12d(_0x7ee70c[_0x7b27('0xb')]);}})['catch'](function(_0x4e42ac){logger[_0x7b27('0x9')](_0x7b27('0x7'),_0x7b27('0x8'),_0x2fc7f7,_0x4e42ac,_0x410d93);return _0x21484b(_0x4e42ac);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d1dbe49..ac7b9a0 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 _0x828d=['./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch'];(function(_0xa26666,_0x3e3a4b){var _0x1a113c=function(_0x13eb52){while(--_0x13eb52){_0xa26666['push'](_0xa26666['shift']());}};_0x1a113c(++_0x3e3a4b);}(_0x828d,0xb6));var _0xd828=function(_0x42c5c7,_0x56f69b){_0x42c5c7=_0x42c5c7-0x0;var _0x3d261e=_0x828d[_0x42c5c7];return _0x3d261e;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0xd828('0x0'));var mailAccount=require(_0xd828('0x1'));var setting=require(_0xd828('0x2'));var logger=require(_0xd828('0x3'))(_0xd828('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xd828('0x5')](mailAccount['getMailAccounts']())[_0xd828('0x5')](realtime[_0xd828('0x6')]())['then'](function(){email[_0xd828('0x7')](realtime[_0xd828('0x8')]);return realtime;});}function main(){return server[_0xd828('0x9')](realtime,email)[_0xd828('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0xd828('0xa')]();})[_0xd828('0x5')](function(_0x207bd0){return setInterval(initRealtime,_0x207bd0[_0xd828('0xb')]*0x3e8);})[_0xd828('0xc')](function(_0x1ec0f1){logger['error']('Email\x20service\x20initialization',_0x1ec0f1);});}main(); \ No newline at end of file +var _0xc467=['error','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch'];(function(_0x370fcb,_0x2f2fb3){var _0xdf970f=function(_0x2bafdb){while(--_0x2bafdb){_0x370fcb['push'](_0x370fcb['shift']());}};_0xdf970f(++_0x2f2fb3);}(_0xc467,0x10f));var _0x7c46=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0xc467[_0x3c59fc];return _0x2b78d4;};'use strict';var server=require(_0x7c46('0x0'));var Realtime=require(_0x7c46('0x1'));var EmailChannel=require(_0x7c46('0x2'));var mailAccount=require(_0x7c46('0x3'));var setting=require('./rpc/setting');var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x7c46('0x4')]()[_0x7c46('0x5')](mailAccount[_0x7c46('0x6')]())[_0x7c46('0x5')](realtime[_0x7c46('0x7')]())[_0x7c46('0x5')](function(){email[_0x7c46('0x8')](realtime[_0x7c46('0x9')]);return realtime;});}function main(){return server[_0x7c46('0xa')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x7c46('0xb')]();})[_0x7c46('0x5')](function(_0x212eb4){return setInterval(initRealtime,_0x212eb4[_0x7c46('0xc')]*0x3e8);})[_0x7c46('0xd')](function(_0x3302cf){logger[_0x7c46('0xe')]('Email\x20service\x20initialization',_0x3302cf);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 4488c43..acae13b 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 _0x6952=['Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','sendMail','send','verifySmtp','isNil','Smtp','lastSync','verify','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','disabled','messages','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch'];(function(_0x85e4ea,_0x6c64bf){var _0x566bbd=function(_0xcdb72a){while(--_0xcdb72a){_0x85e4ea['push'](_0x85e4ea['shift']());}};_0x566bbd(++_0x6c64bf);}(_0x6952,0x1ca));var _0x2695=function(_0x28967e,_0x19648e){_0x28967e=_0x28967e-0x0;var _0x4be5c8=_0x6952[_0x28967e];return _0x4be5c8;};'use strict';var _=require(_0x2695('0x0'));var moment=require('moment');var BPromise=require(_0x2695('0x1'));var md5=require(_0x2695('0x2'));var Redis=require(_0x2695('0x3'));var config=require(_0x2695('0x4'));var logger=require(_0x2695('0x5'))(_0x2695('0x6'));config[_0x2695('0x7')]=_['defaults'](config[_0x2695('0x7')],{'host':_0x2695('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0x2695('0x9'));var mailAccount=require(_0x2695('0xa'));var md5Accounts={};function EmailChannel(_0x58a2b8){logger[_0x2695('0xb')](_0x2695('0xc'));this[_0x2695('0xd')]=_0x58a2b8[_0x2695('0xd')];this[_0x2695('0xe')]={};this[_0x2695('0xf')]=new EmailSmtp();}EmailChannel[_0x2695('0x10')][_0x2695('0x11')]=function(_0x36a198){var _0x21637a=this[_0x2695('0xd')][_0x36a198];var _0x312b66={'id':_0x21637a['id'],'name':_0x21637a[_0x2695('0x12')],'key':_0x21637a[_0x2695('0x13')],'active':_0x21637a[_0x2695('0x14')],'Imap':{'status':_0x21637a[_0x2695('0x15')][_0x2695('0x16')],'messageStatus':_0x21637a[_0x2695('0x15')][_0x2695('0x17')],'total':_0x21637a['Imap'][_0x2695('0x18')]}};if(_['isNil'](md5Accounts[_0x36a198])){md5Accounts[_0x36a198]={};}var _0x3a863d=md5(JSON['stringify'](_0x312b66));if(md5Accounts[_0x36a198][_0x2695('0x2')]!==_0x3a863d){md5Accounts[_0x36a198][_0x2695('0x2')]=_0x3a863d;io[_0x2695('0x11')](_0x2695('0x19'),_0x312b66);}};EmailChannel[_0x2695('0x10')][_0x2695('0x1a')]=function(_0x751a56){for(var _0x7e3c01 in _0x751a56){if(_0x751a56[_0x2695('0x1b')](_0x7e3c01)){if(_0x751a56[_0x7e3c01][_0x2695('0x15')]&&_0x751a56[_0x7e3c01]['active']){var _0x303503=_0x751a56[_0x7e3c01]['Imap'];if(!_0x303503[_0x2695('0x1c')]&&_0x751a56[_0x7e3c01][_0x2695('0x1d')]!==_0x2695('0x1e'))_0x303503[_0x2695('0x1c')]=_0x751a56[_0x7e3c01][_0x2695('0x1d')];if(!this[_0x2695('0xe')]['hasOwnProperty'](_0x303503['id'])){this[_0x2695('0xe')][_0x303503['id']]=new EmailImap(_0x303503,_0x751a56[_0x7e3c01]['email']);this[_0x2695('0xe')][_0x303503['id']]['on']('box',this[_0x2695('0x1f')]['bind'](this,_0x7e3c01));this['imapAccounts'][_0x303503['id']]['on'](_0x2695('0x6'),this[_0x2695('0x20')][_0x2695('0x21')](this,_0x7e3c01));this[_0x2695('0xe')][_0x303503['id']]['on'](_0x2695('0x22'),this[_0x2695('0x23')][_0x2695('0x21')](this,_0x7e3c01));this['imapAccounts'][_0x303503['id']]['on'](_0x2695('0x24'),this[_0x2695('0x25')][_0x2695('0x21')](this,_0x7e3c01));}}else{if(_['isNil'](this[_0x2695('0xd')][_0x7e3c01][_0x2695('0x15')])){this[_0x2695('0xd')][_0x7e3c01][_0x2695('0x15')]={};}this[_0x2695('0xd')][_0x7e3c01][_0x2695('0x15')][_0x2695('0x16')]=_0x2695('0x26');this['mailAccounts'][_0x7e3c01][_0x2695('0x15')][_0x2695('0x17')]='';this[_0x2695('0x11')](_0x7e3c01);}}}};EmailChannel[_0x2695('0x10')]['handleImapBox']=function(_0x3e8475,_0x10588d){if(this[_0x2695('0xd')][_0x3e8475]){this[_0x2695('0xd')][_0x3e8475][_0x2695('0x15')][_0x2695('0x16')]='connected';this[_0x2695('0xd')][_0x3e8475]['Imap']['messageStatus']=_0x10588d['name'];if(_0x10588d[_0x2695('0x27')]){this[_0x2695('0xd')][_0x3e8475]['Imap']['total']=_0x10588d[_0x2695('0x27')][_0x2695('0x18')];}return this['emit'](_0x3e8475);}};EmailChannel['prototype'][_0x2695('0x20')]=function(_0x4ce843,_0x52104e){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x52104e['firstName'],_0x52104e[_0x2695('0x28')],_0x52104e[_0x2695('0x29')],_0x4ce843);if(this[_0x2695('0xd')][_0x4ce843]){return mailAccount[_0x2695('0x2a')](_0x4ce843,_0x52104e)[_0x2695('0x2b')](function(_0x224c86){if(_0x224c86){logger['info'](_0x2695('0x2c'));}})[_0x2695('0x2d')](function(_0x562438){logger[_0x2695('0x24')](_0x2695('0x2e'),JSON[_0x2695('0x2f')](_0x562438));});}};EmailChannel[_0x2695('0x10')][_0x2695('0x23')]=function(_0x111db4){if(this[_0x2695('0xd')][_0x111db4]&&this['mailAccounts'][_0x111db4]['Imap']){if(this[_0x2695('0xe')][this[_0x2695('0xd')][_0x111db4][_0x2695('0x15')]['id']]){delete this[_0x2695('0xe')][this['mailAccounts'][_0x111db4]['Imap']['id']];}this[_0x2695('0xd')][_0x111db4][_0x2695('0x15')]['lastSync']=moment();this[_0x2695('0x11')](_0x111db4);}};EmailChannel[_0x2695('0x10')]['handleImapError']=function(_0x3116ae,_0x35f05f){if(this[_0x2695('0xd')][_0x3116ae]){this[_0x2695('0xd')][_0x3116ae]['Imap'][_0x2695('0x16')]=_0x2695('0x24');this[_0x2695('0xd')][_0x3116ae][_0x2695('0x15')]['messageStatus']=_0x35f05f;return this[_0x2695('0x11')](_0x3116ae);}};EmailChannel[_0x2695('0x10')][_0x2695('0x30')]=function(_0x4fecd7,_0x1e5439){return this['smtp'][_0x2695('0x31')](_0x4fecd7,_0x1e5439);};EmailChannel['prototype'][_0x2695('0x32')]=function(_0x13191d){var _0x2e513c=this;if(this[_0x2695('0xd')][_0x13191d['id']]){if(_[_0x2695('0x33')](this['mailAccounts'][_0x13191d['id']]['Smtp'])){this['mailAccounts'][_0x13191d['id']]['Smtp']={};}this['mailAccounts'][_0x13191d['id']][_0x2695('0x34')][_0x2695('0x35')]=moment();return new BPromise(function(_0x4b246c,_0x59987a){return _0x2e513c[_0x2695('0xf')][_0x2695('0x36')](_0x13191d)[_0x2695('0x2b')](function(_0x2d4d30){_0x2e513c['mailAccounts'][_0x13191d['id']][_0x2695('0x34')][_0x2695('0x16')]='verified';_0x2e513c[_0x2695('0xd')][_0x13191d['id']][_0x2695('0x34')]['messageStatus']='';_0x2e513c[_0x2695('0x11')](_0x13191d['id']);_0x4b246c(_0x2d4d30);})[_0x2695('0x2d')](function(_0xca81b4){_0x2e513c[_0x2695('0xd')][_0x13191d['id']][_0x2695('0x34')][_0x2695('0x16')]='error';_0x2e513c[_0x2695('0xd')][_0x13191d['id']][_0x2695('0x34')][_0x2695('0x17')]=_0xca81b4;_0x2e513c['emit'](_0x13191d['id']);_0x59987a(_0xca81b4);});});}return this[_0x2695('0xf')]['verify'](_0x13191d);};module[_0x2695('0x37')]=EmailChannel; \ No newline at end of file +var _0xdd1b=['lastName','from','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','smtp','send','verifySmtp','verify','then','Smtp','verified','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','info','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','isNil','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s'];(function(_0x53886c,_0x17cd41){var _0x19d33a=function(_0x269b49){while(--_0x269b49){_0x53886c['push'](_0x53886c['shift']());}};_0x19d33a(++_0x17cd41);}(_0xdd1b,0x79));var _0xbdd1=function(_0x42d41d,_0x17b8ea){_0x42d41d=_0x42d41d-0x0;var _0x2e6184=_0xdd1b[_0x42d41d];return _0x2e6184;};'use strict';var _=require(_0xbdd1('0x0'));var moment=require('moment');var BPromise=require(_0xbdd1('0x1'));var md5=require(_0xbdd1('0x2'));var Redis=require(_0xbdd1('0x3'));var config=require(_0xbdd1('0x4'));var logger=require(_0xbdd1('0x5'))(_0xbdd1('0x6'));config['redis']=_['defaults'](config[_0xbdd1('0x7')],{'host':_0xbdd1('0x8'),'port':0x18eb});var io=require(_0xbdd1('0x9'))(new Redis(config[_0xbdd1('0x7')]));var EmailImap=require(_0xbdd1('0xa'));var EmailSmtp=require(_0xbdd1('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x4009c2){logger[_0xbdd1('0xc')]('start\x20email\x20channel');this[_0xbdd1('0xd')]=_0x4009c2['mailAccounts'];this[_0xbdd1('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xbdd1('0xf')][_0xbdd1('0x10')]=function(_0x542a75){var _0x455e45=this['mailAccounts'][_0x542a75];var _0x4de7ce={'id':_0x455e45['id'],'name':_0x455e45[_0xbdd1('0x11')],'key':_0x455e45[_0xbdd1('0x12')],'active':_0x455e45[_0xbdd1('0x13')],'Imap':{'status':_0x455e45[_0xbdd1('0x14')][_0xbdd1('0x15')],'messageStatus':_0x455e45[_0xbdd1('0x14')][_0xbdd1('0x16')],'total':_0x455e45[_0xbdd1('0x14')][_0xbdd1('0x17')]}};if(_['isNil'](md5Accounts[_0x542a75])){md5Accounts[_0x542a75]={};}var _0x5949bd=md5(JSON[_0xbdd1('0x18')](_0x4de7ce));if(md5Accounts[_0x542a75][_0xbdd1('0x2')]!==_0x5949bd){md5Accounts[_0x542a75]['md5']=_0x5949bd;io[_0xbdd1('0x10')]('mailAccount:update',_0x4de7ce);}};EmailChannel[_0xbdd1('0xf')][_0xbdd1('0x19')]=function(_0x4a9cc2){for(var _0x5e12b1 in _0x4a9cc2){if(_0x4a9cc2[_0xbdd1('0x1a')](_0x5e12b1)){if(_0x4a9cc2[_0x5e12b1]['Imap']&&_0x4a9cc2[_0x5e12b1][_0xbdd1('0x13')]){var _0x549fc3=_0x4a9cc2[_0x5e12b1][_0xbdd1('0x14')];if(!_0x549fc3[_0xbdd1('0x1b')]&&_0x4a9cc2[_0x5e12b1][_0xbdd1('0x1c')]!==_0xbdd1('0x1d'))_0x549fc3[_0xbdd1('0x1b')]=_0x4a9cc2[_0x5e12b1][_0xbdd1('0x1c')];if(!this[_0xbdd1('0xe')][_0xbdd1('0x1a')](_0x549fc3['id'])){this[_0xbdd1('0xe')][_0x549fc3['id']]=new EmailImap(_0x549fc3,_0x4a9cc2[_0x5e12b1][_0xbdd1('0x6')]);this[_0xbdd1('0xe')][_0x549fc3['id']]['on'](_0xbdd1('0x1e'),this[_0xbdd1('0x1f')][_0xbdd1('0x20')](this,_0x5e12b1));this[_0xbdd1('0xe')][_0x549fc3['id']]['on'](_0xbdd1('0x6'),this['handleImapEmail'][_0xbdd1('0x20')](this,_0x5e12b1));this[_0xbdd1('0xe')][_0x549fc3['id']]['on'](_0xbdd1('0x21'),this[_0xbdd1('0x22')][_0xbdd1('0x20')](this,_0x5e12b1));this[_0xbdd1('0xe')][_0x549fc3['id']]['on'](_0xbdd1('0x23'),this[_0xbdd1('0x24')][_0xbdd1('0x20')](this,_0x5e12b1));}}else{if(_[_0xbdd1('0x25')](this[_0xbdd1('0xd')][_0x5e12b1][_0xbdd1('0x14')])){this[_0xbdd1('0xd')][_0x5e12b1][_0xbdd1('0x14')]={};}this['mailAccounts'][_0x5e12b1]['Imap'][_0xbdd1('0x15')]='disabled';this[_0xbdd1('0xd')][_0x5e12b1][_0xbdd1('0x14')]['messageStatus']='';this[_0xbdd1('0x10')](_0x5e12b1);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x3c9ee6,_0x278b78){if(this[_0xbdd1('0xd')][_0x3c9ee6]){this[_0xbdd1('0xd')][_0x3c9ee6][_0xbdd1('0x14')][_0xbdd1('0x15')]=_0xbdd1('0x26');this[_0xbdd1('0xd')][_0x3c9ee6]['Imap'][_0xbdd1('0x16')]=_0x278b78['name'];if(_0x278b78[_0xbdd1('0x27')]){this[_0xbdd1('0xd')][_0x3c9ee6][_0xbdd1('0x14')][_0xbdd1('0x17')]=_0x278b78['messages'][_0xbdd1('0x17')];}return this['emit'](_0x3c9ee6);}};EmailChannel['prototype']['handleImapEmail']=function(_0x4ba387,_0x19c9f5){logger[_0xbdd1('0xc')](_0xbdd1('0x28'),_0x19c9f5['firstName'],_0x19c9f5[_0xbdd1('0x29')],_0x19c9f5[_0xbdd1('0x2a')],_0x4ba387);if(this[_0xbdd1('0xd')][_0x4ba387]){return mailAccount['notify'](_0x4ba387,_0x19c9f5)['then'](function(_0x25325a){if(_0x25325a){logger[_0xbdd1('0xc')](_0xbdd1('0x2b'));}})[_0xbdd1('0x2c')](function(_0x35cf68){logger['error'](_0xbdd1('0x2d'),JSON['stringify'](_0x35cf68));});}};EmailChannel[_0xbdd1('0xf')]['handleImapEnd']=function(_0x4e7205){if(this[_0xbdd1('0xd')][_0x4e7205]&&this[_0xbdd1('0xd')][_0x4e7205]['Imap']){if(this['imapAccounts'][this[_0xbdd1('0xd')][_0x4e7205][_0xbdd1('0x14')]['id']]){delete this[_0xbdd1('0xe')][this[_0xbdd1('0xd')][_0x4e7205][_0xbdd1('0x14')]['id']];}this[_0xbdd1('0xd')][_0x4e7205][_0xbdd1('0x14')]['lastSync']=moment();this[_0xbdd1('0x10')](_0x4e7205);}};EmailChannel[_0xbdd1('0xf')]['handleImapError']=function(_0x47a2bd,_0x252f6d){if(this[_0xbdd1('0xd')][_0x47a2bd]){this[_0xbdd1('0xd')][_0x47a2bd][_0xbdd1('0x14')][_0xbdd1('0x15')]=_0xbdd1('0x23');this['mailAccounts'][_0x47a2bd][_0xbdd1('0x14')][_0xbdd1('0x16')]=_0x252f6d;return this[_0xbdd1('0x10')](_0x47a2bd);}};EmailChannel['prototype']['sendMail']=function(_0x25da8f,_0xe4e03){return this[_0xbdd1('0x2e')][_0xbdd1('0x2f')](_0x25da8f,_0xe4e03);};EmailChannel[_0xbdd1('0xf')][_0xbdd1('0x30')]=function(_0x411d9f){var _0x31c0b1=this;if(this['mailAccounts'][_0x411d9f['id']]){if(_[_0xbdd1('0x25')](this['mailAccounts'][_0x411d9f['id']]['Smtp'])){this[_0xbdd1('0xd')][_0x411d9f['id']]['Smtp']={};}this[_0xbdd1('0xd')][_0x411d9f['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x1c5dcf,_0x49722d){return _0x31c0b1[_0xbdd1('0x2e')][_0xbdd1('0x31')](_0x411d9f)[_0xbdd1('0x32')](function(_0x2f425d){_0x31c0b1[_0xbdd1('0xd')][_0x411d9f['id']][_0xbdd1('0x33')]['status']=_0xbdd1('0x34');_0x31c0b1['mailAccounts'][_0x411d9f['id']][_0xbdd1('0x33')][_0xbdd1('0x16')]='';_0x31c0b1[_0xbdd1('0x10')](_0x411d9f['id']);_0x1c5dcf(_0x2f425d);})[_0xbdd1('0x2c')](function(_0x1de288){_0x31c0b1[_0xbdd1('0xd')][_0x411d9f['id']][_0xbdd1('0x33')][_0xbdd1('0x15')]='error';_0x31c0b1[_0xbdd1('0xd')][_0x411d9f['id']][_0xbdd1('0x33')][_0xbdd1('0x16')]=_0x1de288;_0x31c0b1[_0xbdd1('0x10')](_0x411d9f['id']);_0x49722d(_0x1de288);});});}return this[_0xbdd1('0x2e')]['verify'](_0x411d9f);};module[_0xbdd1('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 4d7b65f..1cc2dff 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 _0xc582=['ready','bind','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','required','handleReady','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','exports','lodash','util','imap','mailparser','simpleParser','iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once'];(function(_0x3ff84c,_0x3cacd4){var _0x50ec03=function(_0x1bb6ad){while(--_0x1bb6ad){_0x3ff84c['push'](_0x3ff84c['shift']());}};_0x50ec03(++_0x3cacd4);}(_0xc582,0x132));var _0x2c58=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xc582[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0x2c58('0x0'));var util=require(_0x2c58('0x1'));var Imap=require(_0x2c58('0x2'));var simpleParser=require(_0x2c58('0x3'))[_0x2c58('0x4')];var Iconv=require(_0x2c58('0x5'))['Iconv'];var EventEmitter=require('events')[_0x2c58('0x6')];var utils=require(_0x2c58('0x7'));var logger=require(_0x2c58('0x8'))(_0x2c58('0x9'));function EmailImap(_0x300745,_0x38d2b1){this[_0x2c58('0xa')]=_0x300745[_0x2c58('0xa')];this[_0x2c58('0xb')]=this[_0x2c58('0xc')](_0x300745,_0x38d2b1);this[_0x2c58('0x2')]=new Imap(this[_0x2c58('0xb')]);this[_0x2c58('0x2')][_0x2c58('0xd')](_0x2c58('0xe'),this['handleReady'][_0x2c58('0xf')](this));this[_0x2c58('0x2')][_0x2c58('0xd')](_0x2c58('0x10'),this[_0x2c58('0x11')][_0x2c58('0xf')](this));this[_0x2c58('0x2')]['on'](_0x2c58('0x12'),this[_0x2c58('0x13')][_0x2c58('0xf')](this));this[_0x2c58('0x2')]['connect']();}util[_0x2c58('0x14')](EmailImap,EventEmitter);EmailImap[_0x2c58('0x15')][_0x2c58('0xc')]=function(_0x274892,_0x103bc0){var _0x7c14fa={'connTimeout':_0x274892[_0x2c58('0x16')]?_0x274892[_0x2c58('0x16')]*0x3e8:0x2710,'authTimeout':_0x274892['authTimeout']?_0x274892[_0x2c58('0x17')]*0x3e8:0x1388};if(_0x274892[_0x2c58('0x18')]){_0x7c14fa[_0x2c58('0x19')]=_0x274892[_0x2c58('0x19')];if(_0x274892[_0x2c58('0x1a')]){_0x7c14fa[_0x2c58('0x1b')]=utils[_0x2c58('0x1c')](_0x274892[_0x2c58('0x1d')][_0x2c58('0x1e')],_0x274892[_0x2c58('0x19')]);}else{_0x7c14fa[_0x2c58('0x1f')]=_0x274892[_0x2c58('0x1f')];}}else{if(_0x274892[_0x2c58('0x20')]){_0x7c14fa[_0x2c58('0x19')]=_0x274892[_0x2c58('0x19')];_0x7c14fa[_0x2c58('0x1f')]=_0x274892[_0x2c58('0x1f')];}}_0x7c14fa[_0x2c58('0x9')]=_0x103bc0||_0x274892['user']||_0x2c58('0x21');_0x7c14fa[_0x2c58('0x22')]=_0x274892[_0x2c58('0x22')];_0x7c14fa[_0x2c58('0x23')]=_0x274892[_0x2c58('0x23')]||0x3e1;if(_0x274892['tls']){_0x7c14fa[_0x2c58('0x24')]=!![];}else{_0x7c14fa['tls']=![];_0x7c14fa['autotls']=_0x2c58('0x25');}return _0x7c14fa;};EmailImap[_0x2c58('0x15')][_0x2c58('0x26')]=function(){this[_0x2c58('0x2')][_0x2c58('0x27')](this[_0x2c58('0xa')],![],this[_0x2c58('0x28')][_0x2c58('0xf')](this));};EmailImap['prototype'][_0x2c58('0x28')]=function(_0x4e99cf,_0x4df470){if(_0x4e99cf){this[_0x2c58('0x13')](_0x4e99cf,!![]);}else{this[_0x2c58('0x29')](_0x2c58('0x2a'),_0x4df470);this['readUnseen']();}};EmailImap[_0x2c58('0x15')][_0x2c58('0x2b')]=function(_0x3d6162){if(_0x3d6162){this['handleError'](_0x3d6162,!![]);}else{this[_0x2c58('0x2')][_0x2c58('0x10')]();}};EmailImap[_0x2c58('0x15')][_0x2c58('0x2c')]=function(){this[_0x2c58('0x2')][_0x2c58('0x2d')]([_0x2c58('0x2e')],this[_0x2c58('0x2f')][_0x2c58('0xf')](this));};EmailImap[_0x2c58('0x15')][_0x2c58('0x2f')]=function(_0x27ffb6,_0x11f7df){if(_0x27ffb6){this[_0x2c58('0x13')](_0x27ffb6,!![]);}else{if(_0x11f7df[_0x2c58('0x30')]){try{var _0x5f5299=this[_0x2c58('0x2')][_0x2c58('0x31')](_0x11f7df,{'bodies':'','markSeen':!![]});_0x5f5299['on'](_0x2c58('0x32'),this[_0x2c58('0x33')]['bind'](this));_0x5f5299[_0x2c58('0xd')]('error',this[_0x2c58('0x34')][_0x2c58('0xf')](this));_0x5f5299['once']('end',this['handleFetchEnd']['bind'](this));}catch(_0x4c09c){logger[_0x2c58('0x12')](_0x4c09c);}}else{this[_0x2c58('0x2')][_0x2c58('0x35')](!![],this[_0x2c58('0x2b')][_0x2c58('0xf')](this));}}};EmailImap[_0x2c58('0x15')][_0x2c58('0x33')]=function(_0x5506b4){_0x5506b4['on'](_0x2c58('0x36'),this[_0x2c58('0x37')][_0x2c58('0xf')](this));_0x5506b4[_0x2c58('0xd')](_0x2c58('0x38'),this[_0x2c58('0x39')][_0x2c58('0xf')](this));_0x5506b4[_0x2c58('0xd')](_0x2c58('0x10'),this['handleMessageEnd'][_0x2c58('0xf')](this));};EmailImap[_0x2c58('0x15')]['handleMessageBody']=function(_0x357135){simpleParser(_0x357135,{'Iconv':Iconv},this[_0x2c58('0x3a')]['bind'](this));};EmailImap[_0x2c58('0x15')][_0x2c58('0x39')]=function(){};EmailImap[_0x2c58('0x15')]['handleMessageEnd']=function(){};EmailImap[_0x2c58('0x15')][_0x2c58('0x3a')]=function(_0x120899,_0x2403f6){if(_0x120899){logger[_0x2c58('0x12')](_0x120899);}else{var _0x143755=this;utils[_0x2c58('0x3b')](this['account'],_0x2403f6,function(_0x5a61dc){_0x143755[_0x2c58('0x29')]('email',_0x5a61dc);});}};EmailImap[_0x2c58('0x15')][_0x2c58('0x3c')]=function(){this[_0x2c58('0x2')][_0x2c58('0x35')](!![],this[_0x2c58('0x2b')][_0x2c58('0xf')](this));};EmailImap[_0x2c58('0x15')][_0x2c58('0x34')]=function(_0x559e06){this[_0x2c58('0x13')](_0x559e06);this[_0x2c58('0x2')][_0x2c58('0x35')](!![],this[_0x2c58('0x2b')][_0x2c58('0xf')](this));};EmailImap['prototype'][_0x2c58('0x11')]=function(){this[_0x2c58('0x29')](_0x2c58('0x10'));};EmailImap[_0x2c58('0x15')][_0x2c58('0x13')]=function(_0x1ea183,_0x4f9948){logger['error'](_0x2c58('0x13'),this[_0x2c58('0xb')][_0x2c58('0x9')],JSON[_0x2c58('0x3d')](_0x1ea183));var _0x5683cc='';if(_0x1ea183){if(_0x1ea183[_0x2c58('0x3e')]){_0x5683cc=_0x1ea183['textCode'];}else{for(var _0x52b57d in _0x1ea183){if(_0x1ea183['hasOwnProperty'](_0x52b57d)){_0x5683cc+=_['upperFirst'](_0x52b57d)+':\x20'+_0x1ea183[_0x52b57d]+'\x0a';}}}}if(_0x4f9948){this[_0x2c58('0x2')][_0x2c58('0x10')]();}else{this[_0x2c58('0x29')](_0x2c58('0x12'),_0x5683cc);this['emit'](_0x2c58('0x10'));}};module[_0x2c58('0x3f')]=EmailImap; \ No newline at end of file +var _0xf930=['emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','handleFetchMessage','handleFetchEnd','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','end','handleEnd','error','handleError','bind','connect','inherits','prototype','connTimeout','authTimeout','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','authentication','password','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox'];(function(_0x1b7880,_0x5a8979){var _0x5be2b4=function(_0x2e1ab7){while(--_0x2e1ab7){_0x1b7880['push'](_0x1b7880['shift']());}};_0x5be2b4(++_0x5a8979);}(_0xf930,0x15b));var _0x0f93=function(_0x2bf1fb,_0x10022d){_0x2bf1fb=_0x2bf1fb-0x0;var _0x5e7e68=_0xf930[_0x2bf1fb];return _0x5e7e68;};'use strict';var _=require(_0x0f93('0x0'));var util=require(_0x0f93('0x1'));var Imap=require(_0x0f93('0x2'));var simpleParser=require(_0x0f93('0x3'))[_0x0f93('0x4')];var Iconv=require('iconv')[_0x0f93('0x5')];var EventEmitter=require(_0x0f93('0x6'))[_0x0f93('0x7')];var utils=require(_0x0f93('0x8'));var logger=require(_0x0f93('0x9'))(_0x0f93('0xa'));function EmailImap(_0x1b593f,_0x5b4750){this[_0x0f93('0xb')]=_0x1b593f[_0x0f93('0xb')];this[_0x0f93('0xc')]=this[_0x0f93('0xd')](_0x1b593f,_0x5b4750);this[_0x0f93('0x2')]=new Imap(this[_0x0f93('0xc')]);this[_0x0f93('0x2')][_0x0f93('0xe')](_0x0f93('0xf'),this[_0x0f93('0x10')]['bind'](this));this[_0x0f93('0x2')][_0x0f93('0xe')](_0x0f93('0x11'),this[_0x0f93('0x12')]['bind'](this));this['imap']['on'](_0x0f93('0x13'),this[_0x0f93('0x14')][_0x0f93('0x15')](this));this[_0x0f93('0x2')][_0x0f93('0x16')]();}util[_0x0f93('0x17')](EmailImap,EventEmitter);EmailImap[_0x0f93('0x18')]['getAccount']=function(_0x452ca8,_0x2d88e3){var _0x3811d8={'connTimeout':_0x452ca8[_0x0f93('0x19')]?_0x452ca8[_0x0f93('0x19')]*0x3e8:0x2710,'authTimeout':_0x452ca8['authTimeout']?_0x452ca8[_0x0f93('0x1a')]*0x3e8:0x1388};if(_0x452ca8['service']){_0x3811d8[_0x0f93('0x1b')]=_0x452ca8[_0x0f93('0x1b')];if(_0x452ca8[_0x0f93('0x1c')]){_0x3811d8[_0x0f93('0x1d')]=utils[_0x0f93('0x1e')](_0x452ca8[_0x0f93('0x1f')][_0x0f93('0x20')],_0x452ca8[_0x0f93('0x1b')]);}else{_0x3811d8['password']=_0x452ca8['password'];}}else{if(_0x452ca8[_0x0f93('0x21')]){_0x3811d8['user']=_0x452ca8['user'];_0x3811d8[_0x0f93('0x22')]=_0x452ca8[_0x0f93('0x22')];}}_0x3811d8[_0x0f93('0xa')]=_0x2d88e3||_0x452ca8[_0x0f93('0x1b')]||_0x0f93('0x23');_0x3811d8[_0x0f93('0x24')]=_0x452ca8[_0x0f93('0x24')];_0x3811d8['port']=_0x452ca8[_0x0f93('0x25')]||0x3e1;if(_0x452ca8[_0x0f93('0x26')]){_0x3811d8[_0x0f93('0x26')]=!![];}else{_0x3811d8[_0x0f93('0x26')]=![];_0x3811d8[_0x0f93('0x27')]=_0x0f93('0x28');}return _0x3811d8;};EmailImap['prototype'][_0x0f93('0x10')]=function(){this[_0x0f93('0x2')][_0x0f93('0x29')](this[_0x0f93('0xb')],![],this[_0x0f93('0x2a')][_0x0f93('0x15')](this));};EmailImap[_0x0f93('0x18')][_0x0f93('0x2a')]=function(_0x3eaee7,_0x308d50){if(_0x3eaee7){this[_0x0f93('0x14')](_0x3eaee7,!![]);}else{this[_0x0f93('0x2b')](_0x0f93('0x2c'),_0x308d50);this[_0x0f93('0x2d')]();}};EmailImap[_0x0f93('0x18')][_0x0f93('0x2e')]=function(_0x4ab066){if(_0x4ab066){this[_0x0f93('0x14')](_0x4ab066,!![]);}else{this['imap']['end']();}};EmailImap[_0x0f93('0x18')][_0x0f93('0x2d')]=function(){this[_0x0f93('0x2')][_0x0f93('0x2f')]([_0x0f93('0x30')],this[_0x0f93('0x31')][_0x0f93('0x15')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x12144e,_0xa3b69a){if(_0x12144e){this['handleError'](_0x12144e,!![]);}else{if(_0xa3b69a['length']){try{var _0x46ee21=this[_0x0f93('0x2')]['fetch'](_0xa3b69a,{'bodies':'','markSeen':!![]});_0x46ee21['on']('message',this[_0x0f93('0x32')][_0x0f93('0x15')](this));_0x46ee21['once'](_0x0f93('0x13'),this['handleFetchError'][_0x0f93('0x15')](this));_0x46ee21[_0x0f93('0xe')](_0x0f93('0x11'),this[_0x0f93('0x33')][_0x0f93('0x15')](this));}catch(_0x16d212){logger[_0x0f93('0x13')](_0x16d212);}}else{this['imap'][_0x0f93('0x34')](!![],this[_0x0f93('0x2e')][_0x0f93('0x15')](this));}}};EmailImap[_0x0f93('0x18')][_0x0f93('0x32')]=function(_0x2433ea){_0x2433ea['on'](_0x0f93('0x35'),this['handleMessageBody'][_0x0f93('0x15')](this));_0x2433ea[_0x0f93('0xe')](_0x0f93('0x36'),this[_0x0f93('0x37')][_0x0f93('0x15')](this));_0x2433ea[_0x0f93('0xe')](_0x0f93('0x11'),this[_0x0f93('0x38')][_0x0f93('0x15')](this));};EmailImap[_0x0f93('0x18')][_0x0f93('0x39')]=function(_0x4a79f4){simpleParser(_0x4a79f4,{'Iconv':Iconv},this[_0x0f93('0x3a')][_0x0f93('0x15')](this));};EmailImap[_0x0f93('0x18')][_0x0f93('0x37')]=function(){};EmailImap['prototype'][_0x0f93('0x38')]=function(){};EmailImap['prototype'][_0x0f93('0x3a')]=function(_0x254840,_0x4dfb2e){if(_0x254840){logger['error'](_0x254840);}else{var _0x5f1f29=this;utils[_0x0f93('0x3b')](this['account'],_0x4dfb2e,function(_0x19a737){_0x5f1f29[_0x0f93('0x2b')](_0x0f93('0xa'),_0x19a737);});}};EmailImap[_0x0f93('0x18')]['handleFetchEnd']=function(){this['imap'][_0x0f93('0x34')](!![],this[_0x0f93('0x2e')]['bind'](this));};EmailImap[_0x0f93('0x18')][_0x0f93('0x3c')]=function(_0x171a46){this['handleError'](_0x171a46);this[_0x0f93('0x2')][_0x0f93('0x34')](!![],this[_0x0f93('0x2e')][_0x0f93('0x15')](this));};EmailImap[_0x0f93('0x18')]['handleEnd']=function(){this[_0x0f93('0x2b')](_0x0f93('0x11'));};EmailImap['prototype']['handleError']=function(_0x48411f,_0x6269b3){logger[_0x0f93('0x13')](_0x0f93('0x14'),this['account'][_0x0f93('0xa')],JSON[_0x0f93('0x3d')](_0x48411f));var _0xfae8d1='';if(_0x48411f){if(_0x48411f[_0x0f93('0x3e')]){_0xfae8d1=_0x48411f[_0x0f93('0x3e')];}else{for(var _0x4d596d in _0x48411f){if(_0x48411f[_0x0f93('0x3f')](_0x4d596d)){_0xfae8d1+=_['upperFirst'](_0x4d596d)+':\x20'+_0x48411f[_0x4d596d]+'\x0a';}}}}if(_0x6269b3){this[_0x0f93('0x2')][_0x0f93('0x11')]();}else{this['emit'](_0x0f93('0x13'),_0xfae8d1);this[_0x0f93('0x2b')](_0x0f93('0x11'));}};module[_0x0f93('0x40')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 29e1e37..d3eef55 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 _0xea4c=['Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify'];(function(_0x5c0a70,_0x15df2a){var _0x41f967=function(_0x218bd4){while(--_0x218bd4){_0x5c0a70['push'](_0x5c0a70['shift']());}};_0x41f967(++_0x15df2a);}(_0xea4c,0xc2));var _0xcea4=function(_0x5912f4,_0x47f81e){_0x5912f4=_0x5912f4-0x0;var _0x31a301=_0xea4c[_0x5912f4];return _0x31a301;};'use strict';var nodemailer=require(_0xcea4('0x0'));var inlineBase64=require(_0xcea4('0x1'));function EmailSmtp(){}EmailSmtp[_0xcea4('0x2')][_0xcea4('0x3')]=function(_0x3ed1cd,_0x12d651){return new Promise(function(_0x570155,_0x2e9ef1){var _0x2b19c9=nodemailer[_0xcea4('0x4')](_0x3ed1cd);_0x2b19c9[_0xcea4('0x5')](_0xcea4('0x6'),inlineBase64());_0x2b19c9[_0xcea4('0x7')](_0x12d651,function(_0x7d1a9f,_0xde5e89){if(_0x7d1a9f){_0x2e9ef1(_0x7d1a9f[_0xcea4('0x8')]());}else{_0x570155(_0xde5e89);}});});};EmailSmtp['prototype'][_0xcea4('0x9')]=function(_0x5e9f04){return new Promise(function(_0x42c702,_0x344cb3){var _0x20ad39=nodemailer['createTransport'](_0x5e9f04);_0x20ad39[_0xcea4('0x9')](function(_0x16c6c8,_0x4c14cf){if(_0x16c6c8){_0x344cb3(_0x16c6c8[_0xcea4('0x8')]());}else{if(_0x4c14cf){_0x42c702(_0x4c14cf);}else{_0x344cb3(_0xcea4('0xa'));}}});});};module[_0xcea4('0xb')]=EmailSmtp; \ No newline at end of file +var _0xf505=['verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','createTransport','use','sendMail','toString','prototype'];(function(_0xb26f55,_0x197d2c){var _0x30cb0e=function(_0x4c4b5c){while(--_0x4c4b5c){_0xb26f55['push'](_0xb26f55['shift']());}};_0x30cb0e(++_0x197d2c);}(_0xf505,0x17d));var _0x5f50=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xf505[_0x4d8ed9];return _0x1e2140;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x5f50('0x0'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x6968d1,_0x2017a6){return new Promise(function(_0x4ee517,_0x1d0b48){var _0x18cf5c=nodemailer[_0x5f50('0x1')](_0x6968d1);_0x18cf5c[_0x5f50('0x2')]('compile',inlineBase64());_0x18cf5c[_0x5f50('0x3')](_0x2017a6,function(_0x84ca41,_0x487592){if(_0x84ca41){_0x1d0b48(_0x84ca41[_0x5f50('0x4')]());}else{_0x4ee517(_0x487592);}});});};EmailSmtp[_0x5f50('0x5')]['verify']=function(_0x3a6c11){return new Promise(function(_0x5927a9,_0x2690d2){var _0x12611d=nodemailer['createTransport'](_0x3a6c11);_0x12611d[_0x5f50('0x6')](function(_0x56bf2b,_0x5f4b96){if(_0x56bf2b){_0x2690d2(_0x56bf2b[_0x5f50('0x4')]());}else{if(_0x5f4b96){_0x5927a9(_0x5f4b96);}else{_0x2690d2(_0x5f50('0x7'));}}});});};module[_0x5f50('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index bd1dbce..c308a97 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 _0xfbe0=['html','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','from','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','value','address','generate','head','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','@xcally.com','test'];(function(_0x4b8588,_0x2005db){var _0x136511=function(_0x1ff81e){while(--_0x1ff81e){_0x4b8588['push'](_0x4b8588['shift']());}};_0x136511(++_0x2005db);}(_0xfbe0,0x1e9));var _0x0fbe=function(_0x18fbeb,_0x4d4508){_0x18fbeb=_0x18fbeb-0x0;var _0x5b03a8=_0xfbe0[_0x18fbeb];return _0x5b03a8;};'use strict';var _=require(_0x0fbe('0x0'));var moment=require('moment');var random=require(_0x0fbe('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x0fbe('0x2'));var tnef=require(_0x0fbe('0x3'));var logger=require(_0x0fbe('0x4'))('email');var config=require(_0x0fbe('0x5'));function getAddress(_0xd58a24){var _0x45a11e=_['head'](_0xd58a24[_0x0fbe('0x6')]);return _0x45a11e&&_0x45a11e['address']?_0x45a11e[_0x0fbe('0x7')]:'anonymous'+random[_0x0fbe('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x1aa31e){var _0x2e29b7=_[_0x0fbe('0x9')](_0x1aa31e['value']);if(_0x2e29b7&&_0x2e29b7[_0x0fbe('0xa')]){if(_0x2e29b7[_0x0fbe('0xa')]==_0x2e29b7['address']){return _0x2e29b7[_0x0fbe('0xa')][_0x0fbe('0xb')](0x0,_0x2e29b7['name'][_0x0fbe('0xc')]('@'));}var _0x28500e=_0x2e29b7[_0x0fbe('0xa')][_0x0fbe('0xd')](/\s+/);return _0x28500e[_0x0fbe('0xe')]>0x1?_0x28500e[_0x0fbe('0xf')](0x0,-0x1)[_0x0fbe('0x10')]('\x20'):_0x2e29b7['name'];}return _0x0fbe('0x11');}function getLastName(_0x470d8d){var _0xb79a54=_[_0x0fbe('0x9')](_0x470d8d['value']);if(_0xb79a54&&_0xb79a54[_0x0fbe('0xa')]){var _0x35d311=_0xb79a54[_0x0fbe('0xa')][_0x0fbe('0xd')](/\s+/);return _0x35d311[_0x0fbe('0xe')]>0x1?_0x35d311[_0x0fbe('0x12')]():'';}return'';}function getMails(_0xbcb66,_0x223c3c){var _0x372f94='';for(var _0x24fe2e=0x0;_0x24fe2e<_0x223c3c[_0x0fbe('0x6')][_0x0fbe('0xe')];_0x24fe2e+=0x1){if(_0x223c3c[_0x0fbe('0x6')][_0x24fe2e][_0x0fbe('0x7')]!==_0xbcb66){if(!_[_0x0fbe('0x13')](_0x372f94)){_0x372f94+=',';}_0x372f94+=_0x223c3c[_0x0fbe('0x6')][_0x24fe2e][_0x0fbe('0xa')]||_0x223c3c[_0x0fbe('0x6')][_0x24fe2e]['address']||'';_0x372f94+='\x20<';_0x372f94+=_0x223c3c[_0x0fbe('0x6')][_0x24fe2e][_0x0fbe('0x7')]?_0x223c3c[_0x0fbe('0x6')][_0x24fe2e]['address']:'anonymous'+random[_0x0fbe('0x8')](0x6)+_0x0fbe('0x14');_0x372f94+='>';}}return _0x372f94;}function parseEmail(_0x5ec5b,_0x5aaf59,_0x2c81b4){if(_0x5aaf59['html']){var _0x1ee72b=/)<[^<]*)*<\/script>/gi;while(_0x1ee72b[_0x0fbe('0x15')](_0x5aaf59[_0x0fbe('0x16')])){_0x5aaf59[_0x0fbe('0x16')]=_0x5aaf59[_0x0fbe('0x16')]['replace'](_0x1ee72b,'');}if(_0x5aaf59[_0x0fbe('0x16')][_0x0fbe('0x17')](_0x0fbe('0x18'))){var _0x2a5c98=[];_0x5aaf59[_0x0fbe('0x19')]['forEach'](_0x16d5ef=>{_0x2a5c98[_0x0fbe('0x1a')](_0x16d5ef[_0x0fbe('0x1b')]);});var _0x14797b=/]+>/g;var _0x31a61e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x336cf1=_0x5aaf59[_0x0fbe('0x16')][_0x0fbe('0x1c')](_0x31a61e,_0x0fbe('0x1d'));var _0x22540e=_0x336cf1['replace'](_0x14797b,_0x0fbe('0x1e'));for(let _0x4dab98=0x0;_0x4dab98<_0x2a5c98[_0x0fbe('0xe')];_0x4dab98++){var _0x574751=_0x22540e['replace'](_0x0fbe('0x1e'),_0x0fbe('0x1f')+_0x2a5c98[_0x4dab98]+_0x0fbe('0x20'));_0x22540e=_0x574751;}_0x5aaf59[_0x0fbe('0x16')]=_0x22540e;}_0x2c81b4[_0x0fbe('0x21')]=_0x5aaf59[_0x0fbe('0x16')];}else{_0x2c81b4[_0x0fbe('0x21')]=_0x5aaf59[_0x0fbe('0x22')];}if(_0x2c81b4[_0x0fbe('0x21')]){_0x2c81b4[_0x0fbe('0x21')]=_0x2c81b4[_0x0fbe('0x21')][_0x0fbe('0x1c')](/0x0){var _0x38962f=[_0x0fbe('0x2f'),_0x0fbe('0x30'),_0x0fbe('0x31')];for(var _0x248f01=0x0;_0x248f01<_0x5aaf59[_0x0fbe('0x2e')][_0x0fbe('0xe')];_0x248f01++){var _0x5ea621=_['indexOf'](_0x38962f,_0x5aaf59[_0x0fbe('0x2e')][_0x248f01]['line']);if(_0x5ea621>=0x0){_0x2c81b4[_0x0fbe('0x32')]=!![];}}}return _0x2c81b4;}exports['parser']=function(_0x56d105,_0x50bfde,_0x5f1dea){var _0x529665={'from':getAddress(_0x50bfde['from']),'firstName':getFirstName(_0x50bfde['from']),'lastName':getLastName(_0x50bfde['from']),'mapKey':_0x0fbe('0x26'),'message':{'from':getMails(_0x56d105[_0x0fbe('0x26')],_0x50bfde['from']),'to':_0x56d105[_0x0fbe('0x26')],'cc':'','subject':_0x50bfde[_0x0fbe('0x33')]||'','messageId':_0x50bfde[_0x0fbe('0x34')],'inReplyTo':_0x50bfde[_0x0fbe('0x35')],'sentAt':moment(_0x50bfde[_0x0fbe('0x36')])['format'](_0x0fbe('0x37')),'attach':![],'attachments':[]}};if(!_0x50bfde[_0x0fbe('0x16')]&&!_0x50bfde['textAsHtml']){var _0x57dc70=_[_0x0fbe('0x38')](_0x50bfde[_0x0fbe('0x19')],{'contentType':_0x0fbe('0x39')});if(_0x57dc70[_0x0fbe('0xe')]){logger[_0x0fbe('0x3a')](util[_0x0fbe('0x29')](_0x0fbe('0x3b'),_0x50bfde[_0x0fbe('0x34')]));tnef[_0x0fbe('0x3c')](_[_0x0fbe('0x3d')](_0x57dc70)['content'],function(_0x2f2fc9,_0x321bbe){if(_0x321bbe){_0x50bfde[_0x0fbe('0x16')]=_0x321bbe[_0x0fbe('0x3e')]||_0x0fbe('0x3f');if(_0x321bbe[_0x0fbe('0x40')]){for(var _0x5752f0=0x0;_0x5752f0<_0x321bbe[_0x0fbe('0x40')][_0x0fbe('0xe')];_0x5752f0++){var _0x16b4e2=_0x321bbe['Attachments'][_0x5752f0];_0x529665['message'][_0x0fbe('0x19')][_0x0fbe('0x1a')]({'filename':_0x16b4e2[_0x0fbe('0x41')],'content':Buffer[_0x0fbe('0x42')](_0x16b4e2['Data'])});}}}_0x5f1dea(parseEmail(_0x56d105,_0x50bfde,_0x529665));});}else{_0x50bfde['html']=_0x0fbe('0x3f');_0x5f1dea(parseEmail(_0x56d105,_0x50bfde,_0x529665));}}else{_0x5f1dea(parseEmail(_0x56d105,_0x50bfde,_0x529665));}};exports[_0x0fbe('0x43')]=function(_0x3b55c7,_0x16f38c){var _0xe31bd1=[_0x0fbe('0x44')+(_0x16f38c||''),_0x0fbe('0x45')+_0x3b55c7,'',''];return Buffer[_0x0fbe('0x42')](_0xe31bd1[_0x0fbe('0x10')](''),_0x0fbe('0x46'))[_0x0fbe('0x47')](_0x0fbe('0x48'));}; \ No newline at end of file +var _0x25e1=['utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','email','head','address','generate','@xcally.com','value','name','substring','indexOf','split','slice','Anonymous','length','isEmpty','anonymous','test','html','replace','includes','\x20[Attachment:\x20','textAsHtml','body','Empty\x20message

','generateXOAuth2Token'];(function(_0x2688d5,_0x45db72){var _0x372637=function(_0x51c20d){while(--_0x51c20d){_0x2688d5['push'](_0x2688d5['shift']());}};_0x372637(++_0x45db72);}(_0x25e1,0x1d1));var _0x125e=function(_0x3a7de4,_0x3a4444){_0x3a7de4=_0x3a7de4-0x0;var _0x490878=_0x25e1[_0x3a7de4];return _0x490878;};'use strict';var _=require(_0x125e('0x0'));var moment=require(_0x125e('0x1'));var random=require(_0x125e('0x2'));var fs=require('fs');var path=require(_0x125e('0x3'));var util=require(_0x125e('0x4'));var tnef=require(_0x125e('0x5'));var logger=require('../../../config/logger')(_0x125e('0x6'));var config=require('../../../config/environment');function getAddress(_0x5d89e0){var _0x57e67e=_[_0x125e('0x7')](_0x5d89e0['value']);return _0x57e67e&&_0x57e67e[_0x125e('0x8')]?_0x57e67e[_0x125e('0x8')]:'anonymous'+random[_0x125e('0x9')](0x6)+_0x125e('0xa');}function getFirstName(_0x2a241d){var _0x5c3ef0=_[_0x125e('0x7')](_0x2a241d[_0x125e('0xb')]);if(_0x5c3ef0&&_0x5c3ef0['name']){if(_0x5c3ef0[_0x125e('0xc')]==_0x5c3ef0[_0x125e('0x8')]){return _0x5c3ef0['name'][_0x125e('0xd')](0x0,_0x5c3ef0[_0x125e('0xc')][_0x125e('0xe')]('@'));}var _0x424a45=_0x5c3ef0[_0x125e('0xc')][_0x125e('0xf')](/\s+/);return _0x424a45['length']>0x1?_0x424a45[_0x125e('0x10')](0x0,-0x1)['join']('\x20'):_0x5c3ef0[_0x125e('0xc')];}return _0x125e('0x11');}function getLastName(_0x407f4f){var _0x5b322e=_[_0x125e('0x7')](_0x407f4f['value']);if(_0x5b322e&&_0x5b322e[_0x125e('0xc')]){var _0x5bc8d7=_0x5b322e[_0x125e('0xc')][_0x125e('0xf')](/\s+/);return _0x5bc8d7['length']>0x1?_0x5bc8d7['pop']():'';}return'';}function getMails(_0x1a6c04,_0x30470b){var _0x5a7f33='';for(var _0x4eeceb=0x0;_0x4eeceb<_0x30470b[_0x125e('0xb')][_0x125e('0x12')];_0x4eeceb+=0x1){if(_0x30470b[_0x125e('0xb')][_0x4eeceb][_0x125e('0x8')]!==_0x1a6c04){if(!_[_0x125e('0x13')](_0x5a7f33)){_0x5a7f33+=',';}_0x5a7f33+=_0x30470b['value'][_0x4eeceb][_0x125e('0xc')]||_0x30470b['value'][_0x4eeceb][_0x125e('0x8')]||'';_0x5a7f33+='\x20<';_0x5a7f33+=_0x30470b[_0x125e('0xb')][_0x4eeceb]['address']?_0x30470b['value'][_0x4eeceb][_0x125e('0x8')]:_0x125e('0x14')+random[_0x125e('0x9')](0x6)+_0x125e('0xa');_0x5a7f33+='>';}}return _0x5a7f33;}function parseEmail(_0x175833,_0x129079,_0x407a00){if(_0x129079['html']){var _0x451b32=/)<[^<]*)*<\/script>/gi;while(_0x451b32[_0x125e('0x15')](_0x129079[_0x125e('0x16')])){_0x129079[_0x125e('0x16')]=_0x129079[_0x125e('0x16')][_0x125e('0x17')](_0x451b32,'');}if(_0x129079[_0x125e('0x16')][_0x125e('0x18')](_0x125e('0x19'))){var _0x13d4be=[];_0x129079[_0x125e('0x1a')][_0x125e('0x1b')](_0x4120c6=>{_0x13d4be['push'](_0x4120c6[_0x125e('0x1c')]);});var _0x596445=/]+>/g;var _0x265fc4=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x41ad01=_0x129079[_0x125e('0x16')][_0x125e('0x17')](_0x265fc4,_0x125e('0x1d'));var _0x7118fb=_0x41ad01[_0x125e('0x17')](_0x596445,_0x125e('0x1e'));for(let _0x5bdc72=0x0;_0x5bdc72<_0x13d4be['length'];_0x5bdc72++){var _0x1d9e02=_0x7118fb['replace']('_IMG',_0x125e('0x1f')+_0x13d4be[_0x5bdc72]+'\x20]');_0x7118fb=_0x1d9e02;}_0x129079[_0x125e('0x16')]=_0x7118fb;}_0x407a00['body']=_0x129079[_0x125e('0x16')];}else{_0x407a00['body']=_0x129079[_0x125e('0x20')];}if(_0x407a00[_0x125e('0x21')]){_0x407a00['body']=_0x407a00[_0x125e('0x21')]['replace'](/0x0){var _0x5e0973=[_0x125e('0x33'),_0x125e('0x34'),_0x125e('0x35')];for(var _0x500232=0x0;_0x500232<_0x129079[_0x125e('0x32')]['length'];_0x500232++){var _0x58f799=_[_0x125e('0xe')](_0x5e0973,_0x129079['headerLines'][_0x500232][_0x125e('0x36')]);if(_0x58f799>=0x0){_0x407a00[_0x125e('0x37')]=!![];}}}return _0x407a00;}exports[_0x125e('0x38')]=function(_0x3564fd,_0x5baf94,_0x151357){var _0x5d7abd={'from':getAddress(_0x5baf94[_0x125e('0x39')]),'firstName':getFirstName(_0x5baf94[_0x125e('0x39')]),'lastName':getLastName(_0x5baf94['from']),'mapKey':_0x125e('0x6'),'message':{'from':getMails(_0x3564fd[_0x125e('0x6')],_0x5baf94[_0x125e('0x39')]),'to':_0x3564fd[_0x125e('0x6')],'cc':'','subject':_0x5baf94['subject']||'','messageId':_0x5baf94[_0x125e('0x3a')],'inReplyTo':_0x5baf94[_0x125e('0x3b')],'sentAt':moment(_0x5baf94[_0x125e('0x3c')])[_0x125e('0x3d')](_0x125e('0x3e')),'attach':![],'attachments':[]}};if(!_0x5baf94[_0x125e('0x16')]&&!_0x5baf94[_0x125e('0x20')]){var _0x331761=_[_0x125e('0x3f')](_0x5baf94[_0x125e('0x1a')],{'contentType':_0x125e('0x40')});if(_0x331761[_0x125e('0x12')]){logger[_0x125e('0x41')](util[_0x125e('0x3d')](_0x125e('0x42'),_0x5baf94[_0x125e('0x3a')]));tnef['parseBuffer'](_[_0x125e('0x43')](_0x331761)[_0x125e('0x30')],function(_0x3cc89e,_0x4e1895){if(_0x4e1895){_0x5baf94['html']=_0x4e1895[_0x125e('0x44')]||'

Empty\x20message

';if(_0x4e1895['Attachments']){for(var _0x11dda6=0x0;_0x11dda6<_0x4e1895[_0x125e('0x45')][_0x125e('0x12')];_0x11dda6++){var _0x2c796c=_0x4e1895[_0x125e('0x45')][_0x11dda6];_0x5d7abd[_0x125e('0x23')][_0x125e('0x1a')][_0x125e('0x46')]({'filename':_0x2c796c[_0x125e('0x47')],'content':Buffer[_0x125e('0x39')](_0x2c796c['Data'])});}}}_0x151357(parseEmail(_0x3564fd,_0x5baf94,_0x5d7abd));});}else{_0x5baf94['html']=_0x125e('0x48');_0x151357(parseEmail(_0x3564fd,_0x5baf94,_0x5d7abd));}}else{_0x151357(parseEmail(_0x3564fd,_0x5baf94,_0x5d7abd));}};exports[_0x125e('0x49')]=function(_0x41e3d5,_0x1b9595){var _0x1a95c4=['user='+(_0x1b9595||''),'auth=Bearer\x20'+_0x41e3d5,'',''];return Buffer[_0x125e('0x39')](_0x1a95c4[_0x125e('0x2c')](''),_0x125e('0x4a'))[_0x125e('0x4b')](_0x125e('0x4c'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index d11957e..d24b429 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 _0x90c6=['Imap','Smtp','exports','lodash','name','key','active'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x90c6,0x168));var _0x690c=function(_0x1bbe66,_0x5df375){_0x1bbe66=_0x1bbe66-0x0;var _0x186443=_0x90c6[_0x1bbe66];return _0x186443;};'use strict';var _=require(_0x690c('0x0'));function MailAccount(_0x561653){this['id']=_0x561653['id']||0x0;this[_0x690c('0x1')]=_0x561653[_0x690c('0x1')]||'Service';this['key']=_0x561653[_0x690c('0x2')]||'SERV';this[_0x690c('0x3')]=_0x561653[_0x690c('0x3')]||![];this[_0x690c('0x4')]=_0x561653[_0x690c('0x4')]||[];this[_0x690c('0x5')]=_0x561653[_0x690c('0x5')]||[];}module[_0x690c('0x6')]=MailAccount; \ No newline at end of file +var _0xa203=['Smtp','lodash','name','Service','key','SERV','active','Imap'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xa203,0x199));var _0x3a20=function(_0x4019af,_0x13ddc1){_0x4019af=_0x4019af-0x0;var _0x499e12=_0xa203[_0x4019af];return _0x499e12;};'use strict';var _=require(_0x3a20('0x0'));function MailAccount(_0x2bb921){this['id']=_0x2bb921['id']||0x0;this[_0x3a20('0x1')]=_0x2bb921['name']||_0x3a20('0x2');this[_0x3a20('0x3')]=_0x2bb921['key']||_0x3a20('0x4');this['active']=_0x2bb921[_0x3a20('0x5')]||![];this[_0x3a20('0x6')]=_0x2bb921[_0x3a20('0x6')]||[];this[_0x3a20('0x7')]=_0x2bb921[_0x3a20('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 851d9ad..4bb9ec5 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 _0x3bff=['mapKeys','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','isUndefined','exports','../model/mailAccount','mailAccounts'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0x3bff,0xc4));var _0xf3bf=function(_0x12d75f,_0x3d341b){_0x12d75f=_0x12d75f-0x0;var _0x150016=_0x3bff[_0x12d75f];return _0x150016;};'use strict';var _=require('lodash');var MailAccount=require(_0xf3bf('0x0'));var Realtime=function(){this[_0xf3bf('0x1')]={};};function freeIsNotKey(_0x4c406d,_0x147ee2,_0x3aacbf){var _0x50a3e0=_[_0xf3bf('0x2')](_0x4c406d,function(_0x3f2301,_0x41cd66){return _0x3f2301[_0x3aacbf];});for(var _0x8322ba in _0x147ee2){if(_0x147ee2['hasOwnProperty'](_0x8322ba)){if(!_0x50a3e0[_0x8322ba]){delete _0x147ee2[_0x8322ba];}}}}Realtime['prototype'][_0xf3bf('0x3')]=function(_0x41b006,_0x78a60c){for(var _0x3562a0 in _0x78a60c){if(_0x41b006[_0xf3bf('0x4')](_0x3562a0)){_0x41b006[_0x3562a0]=_0x78a60c[_0x3562a0];}}};Realtime[_0xf3bf('0x5')][_0xf3bf('0x6')]=function(){var _0x408d8c=this;return function(_0x29df25){if(_0x29df25){freeIsNotKey(_0x29df25,_0x408d8c[_0xf3bf('0x1')],'id');for(var _0x311ada=0x0,_0x1571fc={},_0x144e0c={};_0x311ada<_0x29df25['length'];_0x311ada+=0x1){_0x1571fc=_0x29df25[_0x311ada];if(_[_0xf3bf('0x7')](_0x408d8c['mailAccounts'][_0x1571fc['id']])){_0x408d8c['mailAccounts'][_0x1571fc['id']]=new MailAccount(_0x1571fc);}else{_['merge'](_0x408d8c['mailAccounts'][_0x1571fc['id']],_0x1571fc);}}}return _0x408d8c['mailAccounts'];};};module[_0xf3bf('0x8')]=Realtime; \ No newline at end of file +var _0x89c4=['initMailAccounts','isUndefined','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype'];(function(_0x5c8531,_0x6e2874){var _0x923370=function(_0x1a7a83){while(--_0x1a7a83){_0x5c8531['push'](_0x5c8531['shift']());}};_0x923370(++_0x6e2874);}(_0x89c4,0x162));var _0x489c=function(_0x4ead1e,_0x3c783f){_0x4ead1e=_0x4ead1e-0x0;var _0x35e15a=_0x89c4[_0x4ead1e];return _0x35e15a;};'use strict';var _=require('lodash');var MailAccount=require(_0x489c('0x0'));var Realtime=function(){this[_0x489c('0x1')]={};};function freeIsNotKey(_0x56eb15,_0xd4d9af,_0x158cb9){var _0xac3921=_[_0x489c('0x2')](_0x56eb15,function(_0x387de5,_0xf60a54){return _0x387de5[_0x158cb9];});for(var _0x4c257f in _0xd4d9af){if(_0xd4d9af[_0x489c('0x3')](_0x4c257f)){if(!_0xac3921[_0x4c257f]){delete _0xd4d9af[_0x4c257f];}}}}Realtime['prototype'][_0x489c('0x4')]=function(_0x80d0f4,_0x48e37e){for(var _0x3925c2 in _0x48e37e){if(_0x80d0f4[_0x489c('0x3')](_0x3925c2)){_0x80d0f4[_0x3925c2]=_0x48e37e[_0x3925c2];}}};Realtime[_0x489c('0x5')][_0x489c('0x6')]=function(){var _0x341c44=this;return function(_0x1b746d){if(_0x1b746d){freeIsNotKey(_0x1b746d,_0x341c44[_0x489c('0x1')],'id');for(var _0x2b7ec5=0x0,_0x16deb9={},_0x4fa1af={};_0x2b7ec5<_0x1b746d['length'];_0x2b7ec5+=0x1){_0x16deb9=_0x1b746d[_0x2b7ec5];if(_[_0x489c('0x7')](_0x341c44[_0x489c('0x1')][_0x16deb9['id']])){_0x341c44[_0x489c('0x1')][_0x16deb9['id']]=new MailAccount(_0x16deb9);}else{_['merge'](_0x341c44[_0x489c('0x1')][_0x16deb9['id']],_0x16deb9);}}}return _0x341c44[_0x489c('0x1')];};};module[_0x489c('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index b28d1ab..94f177b 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 _0x471a=['email','TemplateId','type','CloudProvider','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider','service'];(function(_0x538375,_0x365e8d){var _0x1c3531=function(_0x7dc57f){while(--_0x7dc57f){_0x538375['push'](_0x538375['shift']());}};_0x1c3531(++_0x365e8d);}(_0x471a,0x18d));var _0xa471=function(_0x2943e9,_0xec3163){_0x2943e9=_0x2943e9-0x0;var _0xf9dfeb=_0x471a[_0x2943e9];return _0xf9dfeb;};'use strict';var client=require(_0xa471('0x0'));exports[_0xa471('0x1')]=function(){return function(){return client[_0xa471('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xa471('0x3'),_0xa471('0x4'),_0xa471('0x5'),_0xa471('0x6'),'active','key','ListId',_0xa471('0x7')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0xa471('0x3'),_0xa471('0x5'),_0xa471('0x8'),'data5'],'as':_0xa471('0x9')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0xa471('0x9'),'attributes':['id',_0xa471('0x3'),_0xa471('0x5'),_0xa471('0x8'),'data5'],'as':_0xa471('0x9')}]}]},'log':_0xa471('0xa')});};};exports[_0xa471('0xb')]=function(_0xbabe8f,_0x3640a0){return client[_0xa471('0x2')]('NotifyMailAccount',{'account':{'id':_0xbabe8f},'body':_0x3640a0,'log':_0xa471('0xc')});}; \ No newline at end of file +var _0x39b5=['Imap','CloudProvider','service','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','Request','name','provider','active','ListId','MailServerIn'];(function(_0x4fccad,_0x3447af){var _0x9646ea=function(_0xde4e5f){while(--_0xde4e5f){_0x4fccad['push'](_0x4fccad['shift']());}};_0x9646ea(++_0x3447af);}(_0x39b5,0x1ba));var _0x539b=function(_0x4f18bb,_0x2ff841){_0x4f18bb=_0x4f18bb-0x0;var _0x5465b7=_0x39b5[_0x4f18bb];return _0x5465b7;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0x539b('0x0')]('GetMailAccount',{'options':{'attributes':['id',_0x539b('0x1'),_0x539b('0x2'),'service','email',_0x539b('0x3'),'key',_0x539b('0x4'),'TemplateId'],'raw':![],'include':[{'model':_0x539b('0x5'),'as':_0x539b('0x6'),'include':[{'model':_0x539b('0x7'),'attributes':['id',_0x539b('0x1'),_0x539b('0x8'),_0x539b('0x9'),_0x539b('0xa')],'as':'CloudProvider'}]},{'model':_0x539b('0xb'),'as':_0x539b('0xc'),'include':[{'model':_0x539b('0x7'),'attributes':['id',_0x539b('0x1'),_0x539b('0x8'),_0x539b('0x9'),_0x539b('0xa')],'as':_0x539b('0x7')}]}]},'log':_0x539b('0xd')});};};exports[_0x539b('0xe')]=function(_0x21ea28,_0x34d78a){return client[_0x539b('0x0')](_0x539b('0xf'),{'account':{'id':_0x21ea28},'body':_0x34d78a,'log':_0x539b('0xf')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 84e5286..acd4af4 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 _0x1e0a=['GetSettings','../client','Request','ShowSetting'];(function(_0x3fa4bd,_0x564a6e){var _0x50601c=function(_0x140d92){while(--_0x140d92){_0x3fa4bd['push'](_0x3fa4bd['shift']());}};_0x50601c(++_0x564a6e);}(_0x1e0a,0x171));var _0xa1e0=function(_0x1a7b94,_0x4b9c23){_0x1a7b94=_0x1a7b94-0x0;var _0x51c85e=_0x1e0a[_0x1a7b94];return _0x51c85e;};'use strict';var client=require(_0xa1e0('0x0'));exports['getSettings']=function(){return client[_0xa1e0('0x1')](_0xa1e0('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xa1e0('0x3')});}; \ No newline at end of file +var _0x2608=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x397c86,_0x24edb8){var _0x5c40c5=function(_0x3c92a3){while(--_0x3c92a3){_0x397c86['push'](_0x397c86['shift']());}};_0x5c40c5(++_0x24edb8);}(_0x2608,0x6c));var _0x8260=function(_0x1cefa3,_0x6c8299){_0x1cefa3=_0x1cefa3-0x0;var _0x2c45f9=_0x2608[_0x1cefa3];return _0x2c45f9;};'use strict';var client=require(_0x8260('0x0'));exports[_0x8260('0x1')]=function(){return client[_0x8260('0x2')](_0x8260('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8260('0x4')]},'log':_0x8260('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index eb8772a..2ef5622 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 87e235f..bcd645e 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 _0x9d6e=['listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','http','sticky-session','ioredis','../../config/environment','createServer','listen','socket.io','websocket','polling','redis','defaults','localhost','../../config/socketio','default','../../config/express','../../routes','once'];(function(_0x19af09,_0x12ac75){var _0x2c7b04=function(_0x1b4071){while(--_0x1b4071){_0x19af09['push'](_0x19af09['shift']());}};_0x2c7b04(++_0x12ac75);}(_0x9d6e,0x10d));var _0xe9d6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9d6e[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var http=require(_0xe9d6('0x0'));var express=require('express');var sticky=require(_0xe9d6('0x1'));var Redis=require(_0xe9d6('0x2'));var config=require(_0xe9d6('0x3'));var app=express();var server=http[_0xe9d6('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xe9d6('0x5')](server,config['port'])){var socketio=require(_0xe9d6('0x6'))(server,{'transports':[_0xe9d6('0x7'),_0xe9d6('0x8')]});config[_0xe9d6('0x9')]=_[_0xe9d6('0xa')](config[_0xe9d6('0x9')],{'host':_0xe9d6('0xb'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0xe9d6('0x9')]),'subClient':new Redis(config[_0xe9d6('0x9')])}));require('../../config/triggers')['default']();require(_0xe9d6('0xc'))[_0xe9d6('0xd')](socketio);require(_0xe9d6('0xe'))[_0xe9d6('0xd')](app);require(_0xe9d6('0xf'))[_0xe9d6('0xd')](app);}else{server[_0xe9d6('0x10')](_0xe9d6('0x11'),function(){console[_0xe9d6('0x12')](_0xe9d6('0x13'),config[_0xe9d6('0x14')]);});}exports=module[_0xe9d6('0x15')]=app; \ No newline at end of file +var _0xd030=['listen','port','socket.io','websocket','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','once','listening','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout'];(function(_0x34cfdf,_0x283016){var _0x48d6e7=function(_0x285315){while(--_0x285315){_0x34cfdf['push'](_0x34cfdf['shift']());}};_0x48d6e7(++_0x283016);}(_0xd030,0xa8));var _0x0d03=function(_0x1f89a2,_0x1422d4){_0x1f89a2=_0x1f89a2-0x0;var _0x2170ab=_0xd030[_0x1f89a2];return _0x2170ab;};'use strict';var _=require(_0x0d03('0x0'));var http=require(_0x0d03('0x1'));var express=require(_0x0d03('0x2'));var sticky=require(_0x0d03('0x3'));var Redis=require(_0x0d03('0x4'));var config=require(_0x0d03('0x5'));var app=express();var server=http[_0x0d03('0x6')](app);server[_0x0d03('0x7')]=0xdbba0;if(sticky[_0x0d03('0x8')](server,config[_0x0d03('0x9')])){var socketio=require(_0x0d03('0xa'))(server,{'transports':[_0x0d03('0xb'),'polling']});config['redis']=_[_0x0d03('0xc')](config[_0x0d03('0xd')],{'host':_0x0d03('0xe'),'port':0x18eb});socketio[_0x0d03('0xf')](require(_0x0d03('0x10'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x0d03('0xd')])}));require(_0x0d03('0x11'))['default']();require('../../config/socketio')[_0x0d03('0x12')](socketio);require('../../config/express')[_0x0d03('0x12')](app);require('../../routes')[_0x0d03('0x12')](app);}else{server[_0x0d03('0x13')](_0x0d03('0x14'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x0d03('0x9')]);});}exports=module[_0x0d03('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index a969927..eac3e40 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 _0x1ff3=['debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','client','http','request','then'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x1ff3,0x103));var _0x31ff=function(_0x21e117,_0x4d961e){_0x21e117=_0x21e117-0x0;var _0x214b3a=_0x1ff3[_0x21e117];return _0x214b3a;};'use strict';var jayson=require(_0x31ff('0x0'));var BPromise=require(_0x31ff('0x1'));var logger=require('../../config/logger')(_0x31ff('0x2'));var client=jayson[_0x31ff('0x3')][_0x31ff('0x4')]({'port':0x2329});client['Request']=function(_0x54a4b4,_0x5328aa){return new BPromise(function(_0x556398,_0x36f802){return client[_0x31ff('0x5')](_0x54a4b4,_0x5328aa)[_0x31ff('0x6')](function(_0x1db9b0){logger[_0x31ff('0x7')](_0x31ff('0x8'),_0x31ff('0x2'),_0x54a4b4,_0x5328aa,_0x1db9b0);if(_0x1db9b0[_0x31ff('0x9')]){logger[_0x31ff('0x9')](_0x31ff('0x8'),_0x31ff('0x2'),_0x54a4b4,_0x1db9b0[_0x31ff('0x9')][_0x31ff('0xa')],_0x5328aa);return _0x36f802(_0x1db9b0[_0x31ff('0x9')]['message']);}else{return _0x556398(_0x1db9b0[_0x31ff('0xb')]);}})[_0x31ff('0xc')](function(_0x2ae361){logger[_0x31ff('0x9')](_0x31ff('0x8'),_0x31ff('0x2'),_0x54a4b4,_0x2ae361,_0x5328aa);return _0x36f802(_0x2ae361);});});};module[_0x31ff('0xd')]=client; \ No newline at end of file +var _0xbf87=['debug','rpc','error','message','catch','exports','jayson/promise','routing','client','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf87,0x128));var _0x7bf8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbf87[_0x321bb2];return _0x9c12ed;};'use strict';var jayson=require(_0x7bf8('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x7bf8('0x1'));var client=jayson[_0x7bf8('0x2')]['http']({'port':0x2329});client['Request']=function(_0x5bb98f,_0x27a85e){return new BPromise(function(_0x5cd9a2,_0x1a0986){return client[_0x7bf8('0x3')](_0x5bb98f,_0x27a85e)['then'](function(_0x829bd3){logger[_0x7bf8('0x4')](_0x7bf8('0x5'),_0x7bf8('0x1'),_0x5bb98f,_0x27a85e,_0x829bd3);if(_0x829bd3['error']){logger['error']('rpc','routing',_0x5bb98f,_0x829bd3[_0x7bf8('0x6')][_0x7bf8('0x7')],_0x27a85e);return _0x1a0986(_0x829bd3['error'][_0x7bf8('0x7')]);}else{return _0x5cd9a2(_0x829bd3['result']);}})[_0x7bf8('0x8')](function(_0x3530e3){logger[_0x7bf8('0x6')](_0x7bf8('0x5'),_0x7bf8('0x1'),_0x5bb98f,_0x3530e3,_0x27a85e);return _0x1a0986(_0x3530e3);});});};module[_0x7bf8('0x9')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 14bfead..c281a58 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 _0xd758=['getIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents'];(function(_0x3ec5ab,_0x17b398){var _0x39e35e=function(_0x30d8a5){while(--_0x30d8a5){_0x3ec5ab['push'](_0x3ec5ab['shift']());}};_0x39e35e(++_0x17b398);}(_0xd758,0xbd));var _0x8d75=function(_0xe9a5d3,_0x1b59cc){_0xe9a5d3=_0xe9a5d3-0x0;var _0x2978d7=_0xd758[_0xe9a5d3];return _0x2978d7;};'use strict';var BPromise=require(_0x8d75('0x0'));var server=require(_0x8d75('0x1'));var Realtime=require(_0x8d75('0x2'));var user=require('./rpc/user');var interval=require(_0x8d75('0x3'));var openchannelQueue=require(_0x8d75('0x4'));var chatQueue=require(_0x8d75('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x8d75('0x6'));var faxQueue=require(_0x8d75('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x8d75('0x8')]()[_0x8d75('0x9')](user[_0x8d75('0xa')]())[_0x8d75('0x9')](realtime['initAgents']())[_0x8d75('0x9')](interval[_0x8d75('0xb')]())['then'](realtime['initIntervals']())[_0x8d75('0x9')](openchannelQueue['getOpenchannelQueues']())[_0x8d75('0x9')](realtime[_0x8d75('0xc')]())[_0x8d75('0x9')](chatQueue[_0x8d75('0xd')]())['then'](realtime[_0x8d75('0xe')]())[_0x8d75('0x9')](smsQueue[_0x8d75('0xf')]())[_0x8d75('0x9')](realtime['initSmsQueues']())[_0x8d75('0x9')](mailQueue[_0x8d75('0x10')]())[_0x8d75('0x9')](realtime[_0x8d75('0x11')]())[_0x8d75('0x9')](faxQueue[_0x8d75('0x12')]())[_0x8d75('0x9')](realtime[_0x8d75('0x13')]())[_0x8d75('0x9')](whatsappQueue[_0x8d75('0x14')]())[_0x8d75('0x9')](realtime[_0x8d75('0x15')]())[_0x8d75('0x9')](function(){return realtime;});}function main(){return server[_0x8d75('0x16')](realtime)[_0x8d75('0x9')](function(_0x17759f){return initRealtime();})[_0x8d75('0x9')](function(_0x533748){return setInterval(initRealtime,0x1388);})[_0x8d75('0x17')](function(_0x49017e){console[_0x8d75('0x18')](_0x49017e);});}main(); \ No newline at end of file +var _0xbea5=['./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','resolve','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','initSmsQueues','getMailQueues','initFaxQueues','listen','log','bluebird','./server','./realtime','./rpc/user'];(function(_0x11de6a,_0x216591){var _0x8faae8=function(_0x492681){while(--_0x492681){_0x11de6a['push'](_0x11de6a['shift']());}};_0x8faae8(++_0x216591);}(_0xbea5,0xcd));var _0x5bea=function(_0x1196b0,_0x36c47a){_0x1196b0=_0x1196b0-0x0;var _0x111c52=_0xbea5[_0x1196b0];return _0x111c52;};'use strict';var BPromise=require(_0x5bea('0x0'));var server=require(_0x5bea('0x1'));var Realtime=require(_0x5bea('0x2'));var user=require(_0x5bea('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x5bea('0x4'));var smsQueue=require(_0x5bea('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x5bea('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x5bea('0x7')]()[_0x5bea('0x8')](user['getAgents']())[_0x5bea('0x8')](realtime[_0x5bea('0x9')]())['then'](interval[_0x5bea('0xa')]())[_0x5bea('0x8')](realtime['initIntervals']())[_0x5bea('0x8')](openchannelQueue[_0x5bea('0xb')]())['then'](realtime[_0x5bea('0xc')]())[_0x5bea('0x8')](chatQueue['getChatQueues']())[_0x5bea('0x8')](realtime[_0x5bea('0xd')]())[_0x5bea('0x8')](smsQueue['getSmsQueues']())[_0x5bea('0x8')](realtime[_0x5bea('0xe')]())[_0x5bea('0x8')](mailQueue[_0x5bea('0xf')]())[_0x5bea('0x8')](realtime['initMailQueues']())[_0x5bea('0x8')](faxQueue['getFaxQueues']())[_0x5bea('0x8')](realtime[_0x5bea('0x10')]())[_0x5bea('0x8')](whatsappQueue['getWhatsappQueues']())[_0x5bea('0x8')](realtime['initWhatsappQueues']())[_0x5bea('0x8')](function(){return realtime;});}function main(){return server[_0x5bea('0x11')](realtime)['then'](function(_0x620cee){return initRealtime();})[_0x5bea('0x8')](function(_0x59c2df){return setInterval(initRealtime,0x1388);})['catch'](function(_0x3b0e50){console[_0x5bea('0x12')](_0x3b0e50);});}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 20e163c..56660fa 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 _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x5f382f,_0x3f1432){_0x5f382f=_0x5f382f-0x0;var _0x3bb11b=_0x1261[_0x5f382f];return _0x3bb11b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +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(_0x316ad3,_0x24e897){var _0x1d81e0=function(_0x218f04){while(--_0x218f04){_0x316ad3['push'](_0x316ad3['shift']());}};_0x1d81e0(++_0x24e897);}(_0x326f,0xd1));var _0xf326=function(_0x37b900,_0x43d370){_0x37b900=_0x37b900-0x0;var _0x3b542d=_0x326f[_0x37b900];return _0x3b542d;};'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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 1e98f0d..aaad07f 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 _0xdad7=['then','error','message','result','catch','SendMail','bluebird','jayson/promise','client','request'];(function(_0x458709,_0x1981ea){var _0x48cbd7=function(_0x358194){while(--_0x358194){_0x458709['push'](_0x458709['shift']());}};_0x48cbd7(++_0x1981ea);}(_0xdad7,0x11e));var _0x7dad=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdad7[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require(_0x7dad('0x0'));var jayson=require(_0x7dad('0x1'));var client=jayson[_0x7dad('0x2')]['http']({'port':0x232b});function request(_0xda467f,_0x1a6696){return new BPromise(function(_0x17e3d5,_0x1c40d8){return client[_0x7dad('0x3')](_0xda467f,_0x1a6696)[_0x7dad('0x4')](function(_0x3eb086){if(_0x3eb086['error']){return _0x1c40d8(_0x3eb086[_0x7dad('0x5')][_0x7dad('0x6')]);}else{return _0x17e3d5(_0x3eb086[_0x7dad('0x7')]);}})[_0x7dad('0x8')](function(_0x38cf63){return _0x1c40d8(_0x38cf63);});});}exports['sendMailMessage']=function(_0x8998d5,_0x5bfbd1){return request(_0x7dad('0x9'),{'account':_0x8998d5,'message':_0x5bfbd1});}; \ No newline at end of file +var _0x156b=['client','request','then','error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x1bff7a,_0x53de42){var _0x5b03d9=function(_0x2558b7){while(--_0x2558b7){_0x1bff7a['push'](_0x1bff7a['shift']());}};_0x5b03d9(++_0x53de42);}(_0x156b,0x13e));var _0xb156=function(_0x298b53,_0x3f830d){_0x298b53=_0x298b53-0x0;var _0x370c14=_0x156b[_0x298b53];return _0x370c14;};'use strict';var BPromise=require(_0xb156('0x0'));var jayson=require(_0xb156('0x1'));var client=jayson[_0xb156('0x2')]['http']({'port':0x232b});function request(_0x111d56,_0x4f7053){return new BPromise(function(_0x8dfc63,_0x5941ef){return client[_0xb156('0x3')](_0x111d56,_0x4f7053)[_0xb156('0x4')](function(_0x2e79a5){if(_0x2e79a5['error']){return _0x5941ef(_0x2e79a5[_0xb156('0x5')][_0xb156('0x6')]);}else{return _0x8dfc63(_0x2e79a5[_0xb156('0x7')]);}})['catch'](function(_0x33424d){return _0x5941ef(_0x33424d);});});}exports[_0xb156('0x8')]=function(_0x6dff66,_0x4af88e){return request(_0xb156('0x9'),{'account':_0x6dff66,'message':_0x4af88e});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 6377f90..6ce12b6 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 _0xc6ac=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','fax','sms','length','StatusTime','toNumber','format','chatCurrentCapacity','mailCapacity','smsStatusTime','stringify','emit','user:routing:update','omit','exports','lodash','md5','moment'];(function(_0x2ec4ff,_0x4c85c7){var _0x136e33=function(_0x181029){while(--_0x181029){_0x2ec4ff['push'](_0x2ec4ff['shift']());}};_0x136e33(++_0x4c85c7);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5a476e,_0x322cf0){_0x5a476e=_0x5a476e-0x0;var _0x28c19c=_0xc6ac[_0x5a476e];return _0x28c19c;};'use strict';var _=require(_0xcc6a('0x0'));var md5=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var Redis=require(_0xcc6a('0x3'));var config=require(_0xcc6a('0x4'));config[_0xcc6a('0x5')]=_[_0xcc6a('0x6')](config[_0xcc6a('0x5')],{'host':_0xcc6a('0x7'),'port':0x18eb});var io=require(_0xcc6a('0x8'))(new Redis(config[_0xcc6a('0x5')]));function Agent(_0x188b05){this['id']=_0x188b05['id']||0x0;this[_0xcc6a('0x9')]=_0x188b05[_0xcc6a('0x9')]||'';this['online']=_0x188b05[_0xcc6a('0xa')]||!![];this[_0xcc6a('0xb')]=_0x188b05[_0xcc6a('0xb')]||![];this['chatPause']=_0x188b05[_0xcc6a('0xc')]||![];this[_0xcc6a('0xd')]=_0x188b05[_0xcc6a('0xd')]||![];this[_0xcc6a('0xe')]=_0x188b05[_0xcc6a('0xe')]||![];this['smsPause']=_0x188b05[_0xcc6a('0xf')]||![];this[_0xcc6a('0x10')]=_0x188b05[_0xcc6a('0x10')]||![];this['chatStatus']=_0xcc6a('0x11');this[_0xcc6a('0x12')]=0x0;this[_0xcc6a('0x13')]=_0x188b05['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0xcc6a('0x14')]=_0xcc6a('0x11');this[_0xcc6a('0x15')]=0x0;this['mailCapacity']=_0x188b05['mailCapacity']||0x0;this[_0xcc6a('0x16')]=0x0;this[_0xcc6a('0x17')]=_0xcc6a('0x11');this[_0xcc6a('0x18')]=0x0;this[_0xcc6a('0x19')]=_0x188b05[_0xcc6a('0x19')]||0x0;this[_0xcc6a('0x1a')]=0x0;this[_0xcc6a('0x1b')]='unknown';this['smsStatusTime']=0x0;this['smsCapacity']=_0x188b05[_0xcc6a('0x1c')]||0x0;this[_0xcc6a('0x1d')]=0x0;this[_0xcc6a('0x1e')]=_0xcc6a('0x11');this[_0xcc6a('0x1f')]=0x0;this[_0xcc6a('0x20')]=_0x188b05[_0xcc6a('0x20')]||0x0;this[_0xcc6a('0x21')]=0x0;this[_0xcc6a('0x22')]=_0xcc6a('0x11');this[_0xcc6a('0x23')]=0x0;this['openchannelCapacity']=_0x188b05[_0xcc6a('0x24')]||0x0;this[_0xcc6a('0x25')]=0x0;this[_0xcc6a('0x26')]=![];this[_0xcc6a('0x27')]=undefined;this[_0xcc6a('0x1')]='';this[_0xcc6a('0x28')]={};this[_0xcc6a('0x29')]={};this[_0xcc6a('0x2a')]={};this[_0xcc6a('0x2b')]={};this[_0xcc6a('0x2c')]={};this[_0xcc6a('0x2d')]={};this[_0xcc6a('0x2e')]();}Agent['prototype'][_0xcc6a('0x2f')]=function(_0x3a081e){if(this[_0x3a081e+_0xcc6a('0x30')]>0x0){if(this[_0x3a081e+'Capacity']>0x0&&this[_0x3a081e+_0xcc6a('0x30')]>=this[_0x3a081e+_0xcc6a('0x31')]){return _0xcc6a('0x32');}else{return _0xcc6a('0x33');}}else{return _0xcc6a('0x34');}};Agent[_0xcc6a('0x35')]['updateRealtime']=function(){var _0x26def8=[_0xcc6a('0x36'),_0xcc6a('0x37'),'openchannel',_0xcc6a('0x38'),_0xcc6a('0x39'),'whatsapp'];for(var _0xb377de=0x0;_0xb377de<_0x26def8[_0xcc6a('0x3a')];_0xb377de+=0x1){var _0x3233d1=this[_0xcc6a('0x2f')](_0x26def8[_0xb377de]);if(this[_0x26def8[_0xb377de]+'Status']!==_0x3233d1){this[_0x26def8[_0xb377de]+_0xcc6a('0x3b')]=_[_0xcc6a('0x3c')](moment()[_0xcc6a('0x3d')]('x'));}this[_0x26def8[_0xb377de]+'Status']=_0x3233d1;}var _0x2590a2={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xcc6a('0xb')],'chatPause':this[_0xcc6a('0xc')],'mailPause':this[_0xcc6a('0xd')],'smsPause':this[_0xcc6a('0xf')],'faxPause':this[_0xcc6a('0xe')],'openchannelPause':this[_0xcc6a('0x10')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xcc6a('0x12')],'chatCapacity':this[_0xcc6a('0x13')],'chatCurrentCapacity':this[_0xcc6a('0x3e')],'mailStatus':this[_0xcc6a('0x14')],'mailStatusTime':this[_0xcc6a('0x15')],'mailCapacity':this[_0xcc6a('0x3f')],'mailCurrentCapacity':this[_0xcc6a('0x16')],'faxStatus':this[_0xcc6a('0x17')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xcc6a('0x19')],'faxCurrentCapacity':this[_0xcc6a('0x1a')],'smsStatus':this[_0xcc6a('0x1b')],'smsStatusTime':this[_0xcc6a('0x40')],'smsCapacity':this[_0xcc6a('0x1c')],'smsCurrentCapacity':this[_0xcc6a('0x1d')],'whatsappStatus':this[_0xcc6a('0x1e')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xcc6a('0x20')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xcc6a('0x24')],'openchannelCurrentCapacity':this[_0xcc6a('0x25')],'busy':this[_0xcc6a('0x26')],'busyQueue':this[_0xcc6a('0x27')],'chatWaitingInteractions':this[_0xcc6a('0x28')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0xcc6a('0x2b')],'smsWaitingInteractions':this[_0xcc6a('0x2c')],'whatsappWaitingInteractions':this[_0xcc6a('0x2d')]};var _0x538ea5=md5(JSON[_0xcc6a('0x41')](_0x2590a2));if(this[_0xcc6a('0x1')]!==_0x538ea5){this[_0xcc6a('0x1')]=_0x538ea5;io[_0xcc6a('0x42')](_0xcc6a('0x43'),_[_0xcc6a('0x44')](_0x2590a2,[_0xcc6a('0xa')]));}};module[_0xcc6a('0x45')]=Agent; \ No newline at end of file +var _0xe5af=['openchannelStatus','openchannelStatusTime','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','idle','chat','openchannel','fax','sms','whatsapp','length','StatusTime','format','Status','whatsappStatusTime','mailWaitingInteractions','smsWaitingInteractions','stringify','user:routing:update','exports','md5','moment','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity'];(function(_0x1dd142,_0x590335){var _0x51fb30=function(_0x4db5a0){while(--_0x4db5a0){_0x1dd142['push'](_0x1dd142['shift']());}};_0x51fb30(++_0x590335);}(_0xe5af,0x9c));var _0xfe5a=function(_0x2e9f72,_0x36480c){_0x2e9f72=_0x2e9f72-0x0;var _0x4b1a98=_0xe5af[_0x2e9f72];return _0x4b1a98;};'use strict';var _=require('lodash');var md5=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var Redis=require('ioredis');var config=require(_0xfe5a('0x2'));config[_0xfe5a('0x3')]=_[_0xfe5a('0x4')](config['redis'],{'host':_0xfe5a('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x37455d){this['id']=_0x37455d['id']||0x0;this[_0xfe5a('0x6')]=_0x37455d['name']||'';this['online']=_0x37455d[_0xfe5a('0x7')]||!![];this[_0xfe5a('0x8')]=_0x37455d[_0xfe5a('0x8')]||![];this[_0xfe5a('0x9')]=_0x37455d['chatPause']||![];this[_0xfe5a('0xa')]=_0x37455d['mailPause']||![];this['faxPause']=_0x37455d[_0xfe5a('0xb')]||![];this[_0xfe5a('0xc')]=_0x37455d['smsPause']||![];this[_0xfe5a('0xd')]=_0x37455d[_0xfe5a('0xd')]||![];this[_0xfe5a('0xe')]=_0xfe5a('0xf');this[_0xfe5a('0x10')]=0x0;this['chatCapacity']=_0x37455d[_0xfe5a('0x11')]||0x0;this[_0xfe5a('0x12')]=0x0;this[_0xfe5a('0x13')]=_0xfe5a('0xf');this[_0xfe5a('0x14')]=0x0;this['mailCapacity']=_0x37455d[_0xfe5a('0x15')]||0x0;this[_0xfe5a('0x16')]=0x0;this[_0xfe5a('0x17')]=_0xfe5a('0xf');this[_0xfe5a('0x18')]=0x0;this[_0xfe5a('0x19')]=_0x37455d[_0xfe5a('0x19')]||0x0;this[_0xfe5a('0x1a')]=0x0;this[_0xfe5a('0x1b')]=_0xfe5a('0xf');this[_0xfe5a('0x1c')]=0x0;this[_0xfe5a('0x1d')]=_0x37455d[_0xfe5a('0x1d')]||0x0;this[_0xfe5a('0x1e')]=0x0;this[_0xfe5a('0x1f')]=_0xfe5a('0xf');this['whatsappStatusTime']=0x0;this[_0xfe5a('0x20')]=_0x37455d[_0xfe5a('0x20')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xfe5a('0x21')]=_0xfe5a('0xf');this[_0xfe5a('0x22')]=0x0;this['openchannelCapacity']=_0x37455d['openchannelCapacity']||0x0;this[_0xfe5a('0x23')]=0x0;this[_0xfe5a('0x24')]=![];this[_0xfe5a('0x25')]=undefined;this[_0xfe5a('0x0')]='';this[_0xfe5a('0x26')]={};this[_0xfe5a('0x27')]={};this['mailWaitingInteractions']={};this[_0xfe5a('0x28')]={};this['smsWaitingInteractions']={};this[_0xfe5a('0x29')]={};this[_0xfe5a('0x2a')]();}Agent[_0xfe5a('0x2b')]['getChannelStatus']=function(_0x4bbef1){if(this[_0x4bbef1+_0xfe5a('0x2c')]>0x0){if(this[_0x4bbef1+_0xfe5a('0x2d')]>0x0&&this[_0x4bbef1+'CurrentCapacity']>=this[_0x4bbef1+_0xfe5a('0x2d')]){return _0xfe5a('0x2e');}else{return'working';}}else{return _0xfe5a('0x2f');}};Agent[_0xfe5a('0x2b')][_0xfe5a('0x2a')]=function(){var _0x2b4f1c=['mail',_0xfe5a('0x30'),_0xfe5a('0x31'),_0xfe5a('0x32'),_0xfe5a('0x33'),_0xfe5a('0x34')];for(var _0x222490=0x0;_0x222490<_0x2b4f1c[_0xfe5a('0x35')];_0x222490+=0x1){var _0x2374b9=this['getChannelStatus'](_0x2b4f1c[_0x222490]);if(this[_0x2b4f1c[_0x222490]+'Status']!==_0x2374b9){this[_0x2b4f1c[_0x222490]+_0xfe5a('0x36')]=_['toNumber'](moment()[_0xfe5a('0x37')]('x'));}this[_0x2b4f1c[_0x222490]+_0xfe5a('0x38')]=_0x2374b9;}var _0x11bf97={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xfe5a('0x9')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xfe5a('0xd')],'chatStatus':this[_0xfe5a('0xe')],'chatStatusTime':this[_0xfe5a('0x10')],'chatCapacity':this[_0xfe5a('0x11')],'chatCurrentCapacity':this[_0xfe5a('0x12')],'mailStatus':this[_0xfe5a('0x13')],'mailStatusTime':this[_0xfe5a('0x14')],'mailCapacity':this[_0xfe5a('0x15')],'mailCurrentCapacity':this[_0xfe5a('0x16')],'faxStatus':this[_0xfe5a('0x17')],'faxStatusTime':this[_0xfe5a('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xfe5a('0x1a')],'smsStatus':this[_0xfe5a('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xfe5a('0x1d')],'smsCurrentCapacity':this[_0xfe5a('0x1e')],'whatsappStatus':this[_0xfe5a('0x1f')],'whatsappStatusTime':this[_0xfe5a('0x39')],'whatsappCapacity':this[_0xfe5a('0x20')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xfe5a('0x22')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xfe5a('0x23')],'busy':this[_0xfe5a('0x24')],'busyQueue':this[_0xfe5a('0x25')],'chatWaitingInteractions':this[_0xfe5a('0x26')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0xfe5a('0x3a')],'openchannelWaitingInteractions':this[_0xfe5a('0x28')],'smsWaitingInteractions':this[_0xfe5a('0x3b')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x3206f1=md5(JSON[_0xfe5a('0x3c')](_0x11bf97));if(this[_0xfe5a('0x0')]!==_0x3206f1){this[_0xfe5a('0x0')]=_0x3206f1;io['emit'](_0xfe5a('0x3d'),_['omit'](_0x11bf97,[_0xfe5a('0x7')]));}};module[_0xfe5a('0x3e')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 06ef449..9b9d89a 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 _0x5ce6=['strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x5ce6,0x91));var _0x65ce=function(_0x11b24f,_0x39a7e3){_0x11b24f=_0x11b24f-0x0;var _0x1b4798=_0x5ce6[_0x11b24f];return _0x1b4798;};'use strict';var _=require(_0x65ce('0x0'));var md5=require(_0x65ce('0x1'));var util=require(_0x65ce('0x2'));var Redis=require(_0x65ce('0x3'));var config=require(_0x65ce('0x4'));config[_0x65ce('0x5')]=_['defaults'](config[_0x65ce('0x5')],{'host':_0x65ce('0x6'),'port':0x18eb});var io=require(_0x65ce('0x7'))(new Redis(config['redis']));function ChatQueue(_0xe7a32b){this['id']=_0xe7a32b['id']||0x0;this[_0x65ce('0x8')]=_0xe7a32b[_0x65ce('0x8')]||'';this[_0x65ce('0x9')]=_0xe7a32b[_0x65ce('0x9')]||0xa;this[_0x65ce('0xa')]=_0xe7a32b['strategy']||_0x65ce('0xb');this[_0x65ce('0xc')]=_0xe7a32b[_0x65ce('0xc')];this[_0x65ce('0xd')]={};this[_0x65ce('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0x65ce('0xf')]();}ChatQueue['prototype'][_0x65ce('0x10')]=function(){var _0x5620de=this['mapAgentsId'][_0x65ce('0x11')];this[_0x65ce('0xd')]=_[_0x65ce('0x12')](this['Agents'],'id');this[_0x65ce('0xd')]['_rr']=_0x5620de;};ChatQueue[_0x65ce('0x13')][_0x65ce('0xf')]=function(){this[_0x65ce('0x14')]=0x0;this[_0x65ce('0x15')]=0x0;for(var _0x5abf73=0x0;_0x5abf73=0x0?this[_0x65ce('0x19')]:0x0;var _0x461392={'id':this['id'],'available':this[_0x65ce('0x19')],'loggedIn':this[_0x65ce('0x14')],'name':this[_0x65ce('0x8')],'paused':this[_0x65ce('0x15')],'waiting':this['waiting']};var _0x47d512=md5(JSON['stringify'](_0x461392));if(this[_0x65ce('0x1')]!==_0x47d512){this[_0x65ce('0x1')]=_0x47d512;io['to'](util[_0x65ce('0x1a')](_0x65ce('0x1b'),_0x461392[_0x65ce('0x8')]))[_0x65ce('0x1c')](_0x65ce('0x1d'),_0x461392);}};module[_0x65ce('0x1e')]=ChatQueue; \ No newline at end of file +var _0xc295=['lodash','defaults','localhost','redis','name','timeout','beepall','Agents','mapAgentsId','md5','updateRealtime','prototype','map','_rr','loggedIn','length','online','paused','available','waiting','format','emit','chat_queue:save','exports'];(function(_0x400481,_0x36277c){var _0x1164a9=function(_0x1f7b98){while(--_0x1f7b98){_0x400481['push'](_0x400481['shift']());}};_0x1164a9(++_0x36277c);}(_0xc295,0x1b0));var _0x5c29=function(_0x9ecf24,_0x40dd75){_0x9ecf24=_0x9ecf24-0x0;var _0xc731f7=_0xc295[_0x9ecf24];return _0xc731f7;};'use strict';var _=require(_0x5c29('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x5c29('0x1')](config['redis'],{'host':_0x5c29('0x2'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5c29('0x3')]));function ChatQueue(_0x1407cc){this['id']=_0x1407cc['id']||0x0;this[_0x5c29('0x4')]=_0x1407cc[_0x5c29('0x4')]||'';this[_0x5c29('0x5')]=_0x1407cc['timeout']||0xa;this['strategy']=_0x1407cc['strategy']||_0x5c29('0x6');this[_0x5c29('0x7')]=_0x1407cc[_0x5c29('0x7')];this[_0x5c29('0x8')]={};this['waiting']=0x0;this[_0x5c29('0x9')]='';this['updateRouting']();this[_0x5c29('0xa')]();}ChatQueue[_0x5c29('0xb')]['updateRouting']=function(){var _0x128fa5=this[_0x5c29('0x8')]['_rr'];this[_0x5c29('0x8')]=_[_0x5c29('0xc')](this['Agents'],'id');this['mapAgentsId'][_0x5c29('0xd')]=_0x128fa5;};ChatQueue[_0x5c29('0xb')][_0x5c29('0xa')]=function(){this[_0x5c29('0xe')]=0x0;this['paused']=0x0;for(var _0x3e0c4d=0x0;_0x3e0c4d=0x0?this[_0x5c29('0x12')]:0x0;var _0x16d3d5={'id':this['id'],'available':this[_0x5c29('0x12')],'loggedIn':this[_0x5c29('0xe')],'name':this[_0x5c29('0x4')],'paused':this[_0x5c29('0x11')],'waiting':this[_0x5c29('0x13')]};var _0xb9c28c=md5(JSON['stringify'](_0x16d3d5));if(this['md5']!==_0xb9c28c){this[_0x5c29('0x9')]=_0xb9c28c;io['to'](util[_0x5c29('0x14')]('chat:queue:%s',_0x16d3d5[_0x5c29('0x4')]))[_0x5c29('0x15')](_0x5c29('0x16'),_0x16d3d5);}};module[_0x5c29('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 850cd98..2de0cb6 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 _0xf9ba=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf9ba,0xd0));var _0xaf9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9ba[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaf9b('0x0'));var md5=require(_0xaf9b('0x1'));var util=require(_0xaf9b('0x2'));var Redis=require('ioredis');var config=require(_0xaf9b('0x3'));config[_0xaf9b('0x4')]=_[_0xaf9b('0x5')](config[_0xaf9b('0x4')],{'host':_0xaf9b('0x6'),'port':0x18eb});var io=require(_0xaf9b('0x7'))(new Redis(config['redis']));function FaxQueue(_0x40f886){this['id']=_0x40f886['id']||0x0;this['name']=_0x40f886[_0xaf9b('0x8')]||'';this[_0xaf9b('0x9')]=_0x40f886[_0xaf9b('0x9')]||0xa;this['strategy']=_0x40f886[_0xaf9b('0xa')]||_0xaf9b('0xb');this['Agents']=_0x40f886[_0xaf9b('0xc')];this[_0xaf9b('0xd')]={};this[_0xaf9b('0xe')]=0x0;this[_0xaf9b('0x1')]='';this['updateRouting']();this[_0xaf9b('0xf')]();}FaxQueue[_0xaf9b('0x10')][_0xaf9b('0x11')]=function(){var _0x187592=this[_0xaf9b('0xd')][_0xaf9b('0x12')];this[_0xaf9b('0xd')]=_[_0xaf9b('0x13')](this['Agents'],'id');this[_0xaf9b('0xd')]['_rr']=_0x187592;};FaxQueue['prototype'][_0xaf9b('0xf')]=function(){this[_0xaf9b('0x14')]=0x0;this[_0xaf9b('0x15')]=0x0;for(var _0x3bb1d5=0x0;_0x3bb1d5=0x0?this[_0xaf9b('0x19')]:0x0;var _0x5172fa={'id':this['id'],'available':this[_0xaf9b('0x19')],'loggedIn':this[_0xaf9b('0x14')],'name':this[_0xaf9b('0x8')],'paused':this[_0xaf9b('0x15')],'waiting':this[_0xaf9b('0xe')]};var _0x3024ef=md5(JSON[_0xaf9b('0x1a')](_0x5172fa));if(this[_0xaf9b('0x1')]!==_0x3024ef){this['md5']=_0x3024ef;io['to'](util[_0xaf9b('0x1b')](_0xaf9b('0x1c'),_0x5172fa[_0xaf9b('0x8')]))[_0xaf9b('0x1d')]('fax_queue:save',_0x5172fa);}};module[_0xaf9b('0x1e')]=FaxQueue; \ No newline at end of file +var _0xe9eb=['ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','map','updateRealtime','loggedIn','paused','length','online','faxPause','available','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util'];(function(_0x519ffb,_0x59a01a){var _0x1bdcea=function(_0x186855){while(--_0x186855){_0x519ffb['push'](_0x519ffb['shift']());}};_0x1bdcea(++_0x59a01a);}(_0xe9eb,0x10b));var _0xbe9e=function(_0x56d5d6,_0x33d2fa){_0x56d5d6=_0x56d5d6-0x0;var _0x433625=_0xe9eb[_0x56d5d6];return _0x433625;};'use strict';var _=require(_0xbe9e('0x0'));var md5=require(_0xbe9e('0x1'));var util=require(_0xbe9e('0x2'));var Redis=require(_0xbe9e('0x3'));var config=require(_0xbe9e('0x4'));config[_0xbe9e('0x5')]=_['defaults'](config[_0xbe9e('0x5')],{'host':_0xbe9e('0x6'),'port':0x18eb});var io=require(_0xbe9e('0x7'))(new Redis(config[_0xbe9e('0x5')]));function FaxQueue(_0x1048ec){this['id']=_0x1048ec['id']||0x0;this['name']=_0x1048ec[_0xbe9e('0x8')]||'';this['timeout']=_0x1048ec['timeout']||0xa;this[_0xbe9e('0x9')]=_0x1048ec['strategy']||_0xbe9e('0xa');this[_0xbe9e('0xb')]=_0x1048ec[_0xbe9e('0xb')];this[_0xbe9e('0xc')]={};this[_0xbe9e('0xd')]=0x0;this[_0xbe9e('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0xbe9e('0xe')]=function(){var _0x6d7c02=this[_0xbe9e('0xc')]['_rr'];this[_0xbe9e('0xc')]=_[_0xbe9e('0xf')](this[_0xbe9e('0xb')],'id');this['mapAgentsId']['_rr']=_0x6d7c02;};FaxQueue['prototype'][_0xbe9e('0x10')]=function(){this[_0xbe9e('0x11')]=0x0;this[_0xbe9e('0x12')]=0x0;for(var _0x5ec49e=0x0;_0x5ec49e=0x0?this[_0xbe9e('0x16')]:0x0;var _0x44078e={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xbe9e('0x12')],'waiting':this[_0xbe9e('0xd')]};var _0x5eaf87=md5(JSON['stringify'](_0x44078e));if(this['md5']!==_0x5eaf87){this[_0xbe9e('0x1')]=_0x5eaf87;io['to'](util['format'](_0xbe9e('0x17'),_0x44078e[_0xbe9e('0x8')]))[_0xbe9e('0x18')](_0xbe9e('0x19'),_0x44078e);}};module[_0xbe9e('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index aa1a62c..4497dfc 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 _0x01fc=['name','Intervals'];(function(_0x5e4385,_0x5b5c02){var _0x1d163d=function(_0x5b45ee){while(--_0x5b45ee){_0x5e4385['push'](_0x5e4385['shift']());}};_0x1d163d(++_0x5b5c02);}(_0x01fc,0x146));var _0xc01f=function(_0x574f64,_0x48a509){_0x574f64=_0x574f64-0x0;var _0x26dedb=_0x01fc[_0x574f64];return _0x26dedb;};'use strict';function Interval(_0x31dd9f){this['id']=_0x31dd9f['id']||0x0;this[_0xc01f('0x0')]=_0x31dd9f['name']||'';this[_0xc01f('0x1')]=_0x31dd9f[_0xc01f('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x8c64=['Intervals','exports','name'];(function(_0x34d46c,_0x2cc4ad){var _0x16818b=function(_0x1ef995){while(--_0x1ef995){_0x34d46c['push'](_0x34d46c['shift']());}};_0x16818b(++_0x2cc4ad);}(_0x8c64,0x1a6));var _0x48c6=function(_0x1e5c15,_0x183781){_0x1e5c15=_0x1e5c15-0x0;var _0x43ff60=_0x8c64[_0x1e5c15];return _0x43ff60;};'use strict';function Interval(_0x4e0bb9){this['id']=_0x4e0bb9['id']||0x0;this['name']=_0x4e0bb9[_0x48c6('0x0')]||'';this['Intervals']=_0x4e0bb9[_0x48c6('0x1')]||{};}module[_0x48c6('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 43e6f95..e97acec 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 _0xef7a=['Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','mailPause','available','stringify','format','mail:queue:%s','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xef7a,0x133));var _0xaef7=function(_0xe4f1c0,_0x17dae3){_0xe4f1c0=_0xe4f1c0-0x0;var _0x16e788=_0xef7a[_0xe4f1c0];return _0x16e788;};'use strict';var _=require(_0xaef7('0x0'));var md5=require(_0xaef7('0x1'));var util=require('util');var Redis=require(_0xaef7('0x2'));var config=require(_0xaef7('0x3'));config[_0xaef7('0x4')]=_[_0xaef7('0x5')](config[_0xaef7('0x4')],{'host':_0xaef7('0x6'),'port':0x18eb});var io=require(_0xaef7('0x7'))(new Redis(config[_0xaef7('0x4')]));function MailQueue(_0x56f0ac){this['id']=_0x56f0ac['id']||0x0;this[_0xaef7('0x8')]=_0x56f0ac[_0xaef7('0x8')]||'';this[_0xaef7('0x9')]=_0x56f0ac[_0xaef7('0x9')]||0xa;this[_0xaef7('0xa')]=_0x56f0ac['strategy']||_0xaef7('0xb');this['Agents']=_0x56f0ac[_0xaef7('0xc')];this['mapAgentsId']={};this[_0xaef7('0xd')]=0x0;this[_0xaef7('0x1')]='';this[_0xaef7('0xe')]();this[_0xaef7('0xf')]();}MailQueue[_0xaef7('0x10')][_0xaef7('0xe')]=function(){var _0x345e7e=this[_0xaef7('0x11')][_0xaef7('0x12')];this[_0xaef7('0x11')]=_[_0xaef7('0x13')](this[_0xaef7('0xc')],'id');this[_0xaef7('0x11')][_0xaef7('0x12')]=_0x345e7e;};MailQueue[_0xaef7('0x10')][_0xaef7('0xf')]=function(){this[_0xaef7('0x14')]=0x0;this[_0xaef7('0x15')]=0x0;for(var _0x35b9f1=0x0;_0x35b9f1=0x0?this[_0xaef7('0x18')]:0x0;var _0x49c649={'id':this['id'],'available':this[_0xaef7('0x18')],'loggedIn':this[_0xaef7('0x14')],'name':this[_0xaef7('0x8')],'paused':this[_0xaef7('0x15')],'waiting':this[_0xaef7('0xd')]};var _0x25a3d2=md5(JSON[_0xaef7('0x19')](_0x49c649));if(this[_0xaef7('0x1')]!==_0x25a3d2){this[_0xaef7('0x1')]=_0x25a3d2;io['to'](util[_0xaef7('0x1a')](_0xaef7('0x1b'),_0x49c649[_0xaef7('0x8')]))['emit']('mail_queue:save',_0x49c649);}};module[_0xaef7('0x1c')]=MailQueue; \ No newline at end of file +var _0x899d=['waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','mailPause','available','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x2306b4,_0x493dfe){var _0x22f22e=function(_0x2aada8){while(--_0x2aada8){_0x2306b4['push'](_0x2306b4['shift']());}};_0x22f22e(++_0x493dfe);}(_0x899d,0x1c2));var _0xd899=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x899d[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xd899('0x0'));var md5=require(_0xd899('0x1'));var util=require(_0xd899('0x2'));var Redis=require(_0xd899('0x3'));var config=require(_0xd899('0x4'));config[_0xd899('0x5')]=_[_0xd899('0x6')](config[_0xd899('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xd899('0x7'))(new Redis(config[_0xd899('0x5')]));function MailQueue(_0x54c7ae){this['id']=_0x54c7ae['id']||0x0;this[_0xd899('0x8')]=_0x54c7ae[_0xd899('0x8')]||'';this['timeout']=_0x54c7ae[_0xd899('0x9')]||0xa;this[_0xd899('0xa')]=_0x54c7ae[_0xd899('0xa')]||_0xd899('0xb');this['Agents']=_0x54c7ae[_0xd899('0xc')];this[_0xd899('0xd')]={};this[_0xd899('0xe')]=0x0;this[_0xd899('0x1')]='';this[_0xd899('0xf')]();this[_0xd899('0x10')]();}MailQueue[_0xd899('0x11')]['updateRouting']=function(){var _0x43c24c=this[_0xd899('0xd')][_0xd899('0x12')];this[_0xd899('0xd')]=_[_0xd899('0x13')](this['Agents'],'id');this[_0xd899('0xd')][_0xd899('0x12')]=_0x43c24c;};MailQueue['prototype'][_0xd899('0x10')]=function(){this[_0xd899('0x14')]=0x0;this[_0xd899('0x15')]=0x0;for(var _0x2b8c3a=0x0;_0x2b8c3a=0x0?this['available']:0x0;var _0x46e77d={'id':this['id'],'available':this[_0xd899('0x18')],'loggedIn':this[_0xd899('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xd899('0xe')]};var _0x1fc236=md5(JSON['stringify'](_0x46e77d));if(this[_0xd899('0x1')]!==_0x1fc236){this[_0xd899('0x1')]=_0x1fc236;io['to'](util['format'](_0xd899('0x19'),_0x46e77d['name']))[_0xd899('0x1a')](_0xd899('0x1b'),_0x46e77d);}};module[_0xd899('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e009dab..3f9522f 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7a54,0x106));var _0x47a5=function(_0x5abb53,_0x884440){_0x5abb53=_0x5abb53-0x0;var _0x2e2c8c=_0x7a54[_0x5abb53];return _0x2e2c8c;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x4f7a49,_0x692604){var _0x3bd884=function(_0x123217){while(--_0x123217){_0x4f7a49['push'](_0x4f7a49['shift']());}};_0x3bd884(++_0x692604);}(_0x814b,0x1a2));var _0xb814=function(_0x323430,_0x3d2b6d){_0x323430=_0x323430-0x0;var _0x9eecd1=_0x814b[_0x323430];return _0x9eecd1;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index a1cfde3..b3f65e7 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 _0x84ab=['format','sms:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','smsPause','available','name','stringify'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x84ab,0x12f));var _0xb84a=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x84ab[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xb84a('0x0'));var md5=require(_0xb84a('0x1'));var util=require(_0xb84a('0x2'));var Redis=require(_0xb84a('0x3'));var config=require(_0xb84a('0x4'));config['redis']=_[_0xb84a('0x5')](config[_0xb84a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb84a('0x7'))(new Redis(config[_0xb84a('0x6')]));function SmsQueue(_0x28c83b){this['id']=_0x28c83b['id']||0x0;this['name']=_0x28c83b['name']||'';this['timeout']=_0x28c83b[_0xb84a('0x8')]||0xa;this['strategy']=_0x28c83b[_0xb84a('0x9')]||_0xb84a('0xa');this['Agents']=_0x28c83b[_0xb84a('0xb')];this['mapAgentsId']={};this[_0xb84a('0xc')]=0x0;this[_0xb84a('0x1')]='';this[_0xb84a('0xd')]();this['updateRealtime']();}SmsQueue['prototype']['updateRouting']=function(){var _0x1e0180=this[_0xb84a('0xe')][_0xb84a('0xf')];this[_0xb84a('0xe')]=_[_0xb84a('0x10')](this['Agents'],'id');this[_0xb84a('0xe')][_0xb84a('0xf')]=_0x1e0180;};SmsQueue[_0xb84a('0x11')][_0xb84a('0x12')]=function(){this[_0xb84a('0x13')]=0x0;this[_0xb84a('0x14')]=0x0;for(var _0x12ccab=0x0;_0x12ccab=0x0?this[_0xb84a('0x18')]:0x0;var _0x28fe46={'id':this['id'],'available':this[_0xb84a('0x18')],'loggedIn':this[_0xb84a('0x13')],'name':this[_0xb84a('0x19')],'paused':this[_0xb84a('0x14')],'waiting':this[_0xb84a('0xc')]};var _0x553f79=md5(JSON[_0xb84a('0x1a')](_0x28fe46));if(this[_0xb84a('0x1')]!==_0x553f79){this['md5']=_0x553f79;io['to'](util[_0xb84a('0x1b')](_0xb84a('0x1c'),_0x28fe46[_0xb84a('0x19')]))[_0xb84a('0x1d')]('sms_queue:save',_0x28fe46);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x2333=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','available','format','sms:queue:%s','emit','exports','lodash','md5','../../../config/environment','redis'];(function(_0xf64e5,_0x4a3232){var _0x5f312c=function(_0x4d816c){while(--_0x4d816c){_0xf64e5['push'](_0xf64e5['shift']());}};_0x5f312c(++_0x4a3232);}(_0x2333,0x11a));var _0x3233=function(_0x41c4e0,_0x2957a3){_0x41c4e0=_0x41c4e0-0x0;var _0x13c2f8=_0x2333[_0x41c4e0];return _0x13c2f8;};'use strict';var _=require(_0x3233('0x0'));var md5=require(_0x3233('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x3233('0x2'));config[_0x3233('0x3')]=_['defaults'](config[_0x3233('0x3')],{'host':_0x3233('0x4'),'port':0x18eb});var io=require(_0x3233('0x5'))(new Redis(config[_0x3233('0x3')]));function SmsQueue(_0x40768d){this['id']=_0x40768d['id']||0x0;this[_0x3233('0x6')]=_0x40768d[_0x3233('0x6')]||'';this[_0x3233('0x7')]=_0x40768d[_0x3233('0x7')]||0xa;this[_0x3233('0x8')]=_0x40768d[_0x3233('0x8')]||_0x3233('0x9');this[_0x3233('0xa')]=_0x40768d[_0x3233('0xa')];this[_0x3233('0xb')]={};this[_0x3233('0xc')]=0x0;this[_0x3233('0x1')]='';this[_0x3233('0xd')]();this[_0x3233('0xe')]();}SmsQueue[_0x3233('0xf')][_0x3233('0xd')]=function(){var _0x5dc591=this[_0x3233('0xb')][_0x3233('0x10')];this[_0x3233('0xb')]=_[_0x3233('0x11')](this[_0x3233('0xa')],'id');this[_0x3233('0xb')][_0x3233('0x10')]=_0x5dc591;};SmsQueue[_0x3233('0xf')][_0x3233('0xe')]=function(){this[_0x3233('0x12')]=0x0;this[_0x3233('0x13')]=0x0;for(var _0x27e9fd=0x0;_0x27e9fd=0x0?this['available']:0x0;var _0x38a9c0={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3233('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x298f71=md5(JSON['stringify'](_0x38a9c0));if(this[_0x3233('0x1')]!==_0x298f71){this['md5']=_0x298f71;io['to'](util[_0x3233('0x16')](_0x3233('0x17'),_0x38a9c0[_0x3233('0x6')]))[_0x3233('0x18')]('sms_queue:save',_0x38a9c0);}};module[_0x3233('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index ee78dea..ae08cbc 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 _0x4316=['ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','stringify','format','emit','lodash','md5','util'];(function(_0xe63dc8,_0x2beca2){var _0x76b07c=function(_0x43b395){while(--_0x43b395){_0xe63dc8['push'](_0xe63dc8['shift']());}};_0x76b07c(++_0x2beca2);}(_0x4316,0x14f));var _0x6431=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4316[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6431('0x0'));var md5=require(_0x6431('0x1'));var util=require(_0x6431('0x2'));var Redis=require(_0x6431('0x3'));var config=require(_0x6431('0x4'));config[_0x6431('0x5')]=_['defaults'](config[_0x6431('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x6431('0x6'))(new Redis(config[_0x6431('0x5')]));function WhatsappQueue(_0x5686cc){this['id']=_0x5686cc['id']||0x0;this['name']=_0x5686cc[_0x6431('0x7')]||'';this[_0x6431('0x8')]=_0x5686cc[_0x6431('0x8')]||0xa;this['strategy']=_0x5686cc[_0x6431('0x9')]||_0x6431('0xa');this[_0x6431('0xb')]=_0x5686cc[_0x6431('0xb')];this[_0x6431('0xc')]={};this['waiting']=0x0;this[_0x6431('0x1')]='';this[_0x6431('0xd')]();this['updateRealtime']();}WhatsappQueue[_0x6431('0xe')][_0x6431('0xd')]=function(){var _0x23f5d4=this[_0x6431('0xc')][_0x6431('0xf')];this[_0x6431('0xc')]=_[_0x6431('0x10')](this[_0x6431('0xb')],'id');this[_0x6431('0xc')][_0x6431('0xf')]=_0x23f5d4;};WhatsappQueue[_0x6431('0xe')]['updateRealtime']=function(){this[_0x6431('0x11')]=0x0;this[_0x6431('0x12')]=0x0;for(var _0x5d867f=0x0;_0x5d867f=0x0?this['available']:0x0;var _0x36cf46={'id':this['id'],'available':this[_0x6431('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x6431('0x7')],'paused':this[_0x6431('0x12')],'waiting':this['waiting']};var _0x20f378=md5(JSON[_0x6431('0x17')](_0x36cf46));if(this[_0x6431('0x1')]!==_0x20f378){this['md5']=_0x20f378;io['to'](util[_0x6431('0x18')]('whatsapp:queue:%s',_0x36cf46[_0x6431('0x7')]))[_0x6431('0x19')]('whatsapp_queue:save',_0x36cf46);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xdf86=['emit','whatsapp_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','online','whatsappPause','available','format'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xdf86,0x161));var _0x6df8=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0xdf86[_0x2e04ef];return _0x5722b0;};'use strict';var _=require(_0x6df8('0x0'));var md5=require(_0x6df8('0x1'));var util=require('util');var Redis=require(_0x6df8('0x2'));var config=require(_0x6df8('0x3'));config[_0x6df8('0x4')]=_[_0x6df8('0x5')](config[_0x6df8('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x6df8('0x6'))(new Redis(config[_0x6df8('0x4')]));function WhatsappQueue(_0x238912){this['id']=_0x238912['id']||0x0;this['name']=_0x238912[_0x6df8('0x7')]||'';this[_0x6df8('0x8')]=_0x238912['timeout']||0xa;this[_0x6df8('0x9')]=_0x238912['strategy']||_0x6df8('0xa');this[_0x6df8('0xb')]=_0x238912['Agents'];this[_0x6df8('0xc')]={};this[_0x6df8('0xd')]=0x0;this[_0x6df8('0x1')]='';this[_0x6df8('0xe')]();this[_0x6df8('0xf')]();}WhatsappQueue[_0x6df8('0x10')][_0x6df8('0xe')]=function(){var _0x3c24c0=this[_0x6df8('0xc')]['_rr'];this[_0x6df8('0xc')]=_[_0x6df8('0x11')](this[_0x6df8('0xb')],'id');this[_0x6df8('0xc')][_0x6df8('0x12')]=_0x3c24c0;};WhatsappQueue[_0x6df8('0x10')]['updateRealtime']=function(){this[_0x6df8('0x13')]=0x0;this[_0x6df8('0x14')]=0x0;for(var _0xa98cd1=0x0;_0xa98cd1=0x0?this[_0x6df8('0x17')]:0x0;var _0x3f00fe={'id':this['id'],'available':this[_0x6df8('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x6df8('0x7')],'paused':this[_0x6df8('0x14')],'waiting':this[_0x6df8('0xd')]};var _0x226b9f=md5(JSON['stringify'](_0x3f00fe));if(this[_0x6df8('0x1')]!==_0x226b9f){this[_0x6df8('0x1')]=_0x226b9f;io['to'](util[_0x6df8('0x18')]('whatsapp:queue:%s',_0x3f00fe[_0x6df8('0x7')]))[_0x6df8('0x19')](_0x6df8('0x1a'),_0x3f00fe);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 9f4a449..898a4e2 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 b9716f2..7992b84 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 _0x2a7a=['Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update'];(function(_0xd66745,_0x20d3b1){var _0x501c5a=function(_0x38dea8){while(--_0x38dea8){_0xd66745['push'](_0xd66745['shift']());}};_0x501c5a(++_0x20d3b1);}(_0x2a7a,0x161));var _0xa2a7=function(_0x491fcb,_0x419305){_0x491fcb=_0x491fcb-0x0;var _0x20d08d=_0x2a7a[_0x491fcb];return _0x20d08d;};'use strict';var client=require('../client');exports[_0xa2a7('0x0')]=function(_0x178067,_0x3f4c7a){return client[_0xa2a7('0x1')](_0xa2a7('0x2'),{'body':_0x3f4c7a,'options':{'where':{'id':_0x178067}},'log':'updateChatInteraction'});};exports[_0xa2a7('0x3')]=function(_0x5b6c36,_0x345982){return client['Request'](_0xa2a7('0x4'),{'body':_0x345982,'options':{'where':{'id':_0x5b6c36}},'log':_0xa2a7('0x5')});}; \ No newline at end of file +var _0x6b20=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','addTags'];(function(_0x369816,_0x4e0420){var _0x1f5e81=function(_0x193d58){while(--_0x193d58){_0x369816['push'](_0x369816['shift']());}};_0x1f5e81(++_0x4e0420);}(_0x6b20,0x133));var _0x06b2=function(_0x212fea,_0x3f8271){_0x212fea=_0x212fea-0x0;var _0x120334=_0x6b20[_0x212fea];return _0x120334;};'use strict';var client=require(_0x06b2('0x0'));exports[_0x06b2('0x1')]=function(_0x3075c1,_0x5ecd8f){return client[_0x06b2('0x2')](_0x06b2('0x3'),{'body':_0x5ecd8f,'options':{'where':{'id':_0x3075c1}},'log':'updateChatInteraction'});};exports[_0x06b2('0x4')]=function(_0x4bb315,_0x248b1a){return client[_0x06b2('0x2')]('AddTagsToChatInteraction',{'body':_0x248b1a,'options':{'where':{'id':_0x4bb315}},'log':_0x06b2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 5fd6498..de8f8f1 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 _0x84e2=['Request','createChatMessage','create'];(function(_0x2b744e,_0x3de5c7){var _0x8da216=function(_0x5cf995){while(--_0x5cf995){_0x2b744e['push'](_0x2b744e['shift']());}};_0x8da216(++_0x3de5c7);}(_0x84e2,0x89));var _0x284e=function(_0x1d3fdc,_0x2b5c54){_0x1d3fdc=_0x1d3fdc-0x0;var _0x128bb0=_0x84e2[_0x1d3fdc];return _0x128bb0;};'use strict';var client=require('../client');exports[_0x284e('0x0')]=function(_0x1266fc){return client[_0x284e('0x1')]('CreateChatMessage',{'body':_0x1266fc,'log':_0x284e('0x2')});}; \ No newline at end of file +var _0x5251=['../client','create','Request','CreateChatMessage'];(function(_0x5b6f43,_0x6f8954){var _0x57110f=function(_0x325de4){while(--_0x325de4){_0x5b6f43['push'](_0x5b6f43['shift']());}};_0x57110f(++_0x6f8954);}(_0x5251,0x19c));var _0x1525=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5251[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x1525('0x0'));exports[_0x1525('0x1')]=function(_0x341916){return client[_0x1525('0x2')](_0x1525('0x3'),{'body':_0x341916,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 4ec8f61..bbcf36e 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 _0x39d9=['User','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x4719bc,_0x27a905){var _0x305045=function(_0x502b81){while(--_0x502b81){_0x4719bc['push'](_0x4719bc['shift']());}};_0x305045(++_0x27a905);}(_0x39d9,0x17f));var _0x939d=function(_0x1421d4,_0x312eb7){_0x1421d4=_0x1421d4-0x0;var _0x403fa2=_0x39d9[_0x1421d4];return _0x403fa2;};'use strict';var client=require(_0x939d('0x0'));exports[_0x939d('0x1')]=function(){return function(){return client[_0x939d('0x2')](_0x939d('0x3'),{'options':{'raw':![],'attributes':['id',_0x939d('0x4'),_0x939d('0x5'),_0x939d('0x6')],'include':[{'model':_0x939d('0x7'),'as':'Agents','attributes':['id',_0x939d('0x4'),_0x939d('0x8'),_0x939d('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x861c=['getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents','online','chatPause','../client'];(function(_0x12d773,_0x253abd){var _0x152e37=function(_0x51b1f2){while(--_0x51b1f2){_0x12d773['push'](_0x12d773['shift']());}};_0x152e37(++_0x253abd);}(_0x861c,0xdb));var _0xc861=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x861c[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0xc861('0x0'));exports[_0xc861('0x1')]=function(){return function(){return client[_0xc861('0x2')](_0xc861('0x3'),{'options':{'raw':![],'attributes':['id',_0xc861('0x4'),_0xc861('0x5'),_0xc861('0x6')],'include':[{'model':_0xc861('0x7'),'as':_0xc861('0x8'),'attributes':['id',_0xc861('0x4'),_0xc861('0x9'),_0xc861('0xa')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 89ca86e..7729682 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 _0xdb13=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','create','Request'];(function(_0x14ae0c,_0x100691){var _0x15a131=function(_0x2ba14b){while(--_0x2ba14b){_0x14ae0c['push'](_0x14ae0c['shift']());}};_0x15a131(++_0x100691);}(_0xdb13,0x10c));var _0x3db1=function(_0x3958f0,_0x3fe7c3){_0x3958f0=_0x3958f0-0x0;var _0x5cc168=_0xdb13[_0x3958f0];return _0x5cc168;};'use strict';var client=require('../client');exports[_0x3db1('0x0')]=function(_0x366725){return client[_0x3db1('0x1')](_0x3db1('0x2'),{'body':_0x366725,'log':_0x3db1('0x2')});};exports[_0x3db1('0x3')]=function(_0x581a73,_0x3352e3){return client[_0x3db1('0x1')](_0x3db1('0x4'),{'body':_0x3352e3,'options':{'where':{'uniqueid':_0x581a73},'order':[['id',_0x3db1('0x5')]],'limit':0x1},'log':_0x3db1('0x4')});}; \ No newline at end of file +var _0x0dba=['UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport','update'];(function(_0x5ebe78,_0x203a05){var _0x2c9221=function(_0x294e23){while(--_0x294e23){_0x5ebe78['push'](_0x5ebe78['shift']());}};_0x2c9221(++_0x203a05);}(_0x0dba,0x136));var _0xa0db=function(_0x1c9f89,_0x54a7ca){_0x1c9f89=_0x1c9f89-0x0;var _0x2d24b3=_0x0dba[_0x1c9f89];return _0x2d24b3;};'use strict';var client=require(_0xa0db('0x0'));exports[_0xa0db('0x1')]=function(_0x19a3c7){return client[_0xa0db('0x2')](_0xa0db('0x3'),{'body':_0x19a3c7,'log':_0xa0db('0x3')});};exports[_0xa0db('0x4')]=function(_0x4058e6,_0x20d00b){return client[_0xa0db('0x2')](_0xa0db('0x5'),{'body':_0x20d00b,'options':{'where':{'uniqueid':_0x4058e6},'order':[['id',_0xa0db('0x6')]],'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 49d180a..dcdf22a 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1d6960,_0x11a48a){var _0x278934=function(_0x36dd3d){while(--_0x36dd3d){_0x1d6960['push'](_0x1d6960['shift']());}};_0x278934(++_0x11a48a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_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 +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x315f9b,_0x3e415c){var _0x201f46=function(_0x1103aa){while(--_0x1103aa){_0x315f9b['push'](_0x315f9b['shift']());}};_0x201f46(++_0x3e415c);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 30e1096..d552f2d 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 _0x2109=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x21f626,_0x132463){var _0x48d98c=function(_0x5eea1a){while(--_0x5eea1a){_0x21f626['push'](_0x21f626['shift']());}};_0x48d98c(++_0x132463);}(_0x2109,0x1c4));var _0x9210=function(_0x547c7e,_0x371a3b){_0x547c7e=_0x547c7e-0x0;var _0xe39351=_0x2109[_0x547c7e];return _0xe39351;};'use strict';var client=require(_0x9210('0x0'));exports[_0x9210('0x1')]=function(_0x2cf82c){return client[_0x9210('0x2')](_0x9210('0x3'),{'body':_0x2cf82c,'log':_0x9210('0x4')});}; \ No newline at end of file +var _0x487a=['create','CreateFaxMessage','createFaxMessage'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x487a,0x96));var _0xa487=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x487a[_0x297fd3];return _0x2af381;};'use strict';var client=require('../client');exports[_0xa487('0x0')]=function(_0x180c78){return client['Request'](_0xa487('0x1'),{'body':_0x180c78,'log':_0xa487('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 2f69386..9e3782a 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 _0x3c9d=['getFaxQueues','../client','Request','GetFaxQueue','name','timeout','strategy','Agents'];(function(_0x486517,_0x5d34e9){var _0x239ddd=function(_0xe445ca){while(--_0xe445ca){_0x486517['push'](_0x486517['shift']());}};_0x239ddd(++_0x5d34e9);}(_0x3c9d,0x191));var _0xd3c9=function(_0x18d3d2,_0x48809e){_0x18d3d2=_0x18d3d2-0x0;var _0x582ee2=_0x3c9d[_0x18d3d2];return _0x582ee2;};'use strict';var client=require(_0xd3c9('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xd3c9('0x1')](_0xd3c9('0x2'),{'options':{'raw':![],'attributes':['id',_0xd3c9('0x3'),_0xd3c9('0x4'),_0xd3c9('0x5')],'include':[{'model':'User','as':_0xd3c9('0x6'),'attributes':['id',_0xd3c9('0x3'),'online','faxPause']}]},'log':_0xd3c9('0x7')});};}; \ No newline at end of file +var _0x7ebc=['../client','getFaxQueues','GetFaxQueue','name','strategy','User','Agents','online'];(function(_0x560924,_0x258a47){var _0x5c694d=function(_0x599a81){while(--_0x599a81){_0x560924['push'](_0x560924['shift']());}};_0x5c694d(++_0x258a47);}(_0x7ebc,0x198));var _0xc7eb=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x7ebc[_0x48e1ec];return _0x3b33eb;};'use strict';var client=require(_0xc7eb('0x0'));exports[_0xc7eb('0x1')]=function(){return function(){return client['Request'](_0xc7eb('0x2'),{'options':{'raw':![],'attributes':['id',_0xc7eb('0x3'),'timeout',_0xc7eb('0x4')],'include':[{'model':_0xc7eb('0x5'),'as':_0xc7eb('0x6'),'attributes':['id',_0xc7eb('0x3'),_0xc7eb('0x7'),'faxPause']}]},'log':_0xc7eb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 60076cf..e7a17f2 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 _0x049e=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x5863a9,_0x4b431f){var _0x590554=function(_0x12cbf3){while(--_0x12cbf3){_0x5863a9['push'](_0x5863a9['shift']());}};_0x590554(++_0x4b431f);}(_0x049e,0xd6));var _0xe049=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x049e[_0x4812e0];return _0x252e0f;};'use strict';var client=require(_0xe049('0x0'));exports[_0xe049('0x1')]=function(_0x4f5c3a){return client['Request'](_0xe049('0x2'),{'body':_0x4f5c3a,'log':'CreateFaxQueueReport'});};exports[_0xe049('0x3')]=function(_0x583cec,_0x5dbd8c){return client['Request'](_0xe049('0x4'),{'body':_0x5dbd8c,'options':{'where':{'uniqueid':_0x583cec},'order':[['id',_0xe049('0x5')]],'limit':0x1},'log':_0xe049('0x4')});}; \ No newline at end of file +var _0x7613=['DESC','../client','create','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x2b6c4a,_0x5b25c4){var _0x37cd4c=function(_0x3d5a2f){while(--_0x3d5a2f){_0x2b6c4a['push'](_0x2b6c4a['shift']());}};_0x37cd4c(++_0x5b25c4);}(_0x7613,0x8b));var _0x3761=function(_0x293640,_0x4b4bc5){_0x293640=_0x293640-0x0;var _0x70a420=_0x7613[_0x293640];return _0x70a420;};'use strict';var client=require(_0x3761('0x0'));exports[_0x3761('0x1')]=function(_0x5d4d75){return client['Request'](_0x3761('0x2'),{'body':_0x5d4d75,'log':'CreateFaxQueueReport'});};exports[_0x3761('0x3')]=function(_0x501a54,_0x56919f){return client['Request'](_0x3761('0x4'),{'body':_0x56919f,'options':{'where':{'uniqueid':_0x501a54},'order':[['id',_0x3761('0x5')]],'limit':0x1},'log':_0x3761('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 2988f86..1d5ea31 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 _0xd915=['interval','../client','getIntervals','GetInterval','name','Interval','Intervals'];(function(_0x3b01da,_0x2eb89d){var _0xae3255=function(_0x2643b4){while(--_0x2643b4){_0x3b01da['push'](_0x3b01da['shift']());}};_0xae3255(++_0x2eb89d);}(_0xd915,0x7f));var _0x5d91=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xd915[_0x243b2f];return _0xcb3c2d;};'use strict';var client=require(_0x5d91('0x0'));exports[_0x5d91('0x1')]=function(){return function(){return client['Request'](_0x5d91('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5d91('0x3')],'include':[{'model':_0x5d91('0x4'),'as':_0x5d91('0x5'),'attributes':['id',_0x5d91('0x3'),_0x5d91('0x6')]}]},'log':_0x5d91('0x1')});};}; \ No newline at end of file +var _0x7e70=['../client','getIntervals','Request','GetInterval','name','Interval','Intervals','interval'];(function(_0x401b64,_0x5cae66){var _0x139aa0=function(_0x4bef1d){while(--_0x4bef1d){_0x401b64['push'](_0x401b64['shift']());}};_0x139aa0(++_0x5cae66);}(_0x7e70,0x158));var _0x07e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e70[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x07e7('0x0'));exports[_0x07e7('0x1')]=function(){return function(){return client[_0x07e7('0x2')](_0x07e7('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x07e7('0x4')],'include':[{'model':_0x07e7('0x5'),'as':_0x07e7('0x6'),'attributes':['id',_0x07e7('0x4'),_0x07e7('0x7')]}]},'log':_0x07e7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 6c64b28..07c55a5 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 _0x7096=['AddTagsToMailInteraction','addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x5ea24f,_0x3bd868){var _0x112afb=function(_0x530fda){while(--_0x530fda){_0x5ea24f['push'](_0x5ea24f['shift']());}};_0x112afb(++_0x3bd868);}(_0x7096,0x10c));var _0x6709=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7096[_0x46aff0];return _0x9d78cf;};'use strict';var client=require('../client');exports[_0x6709('0x0')]=function(_0x5035b7,_0x253760){return client['Request'](_0x6709('0x1'),{'body':_0x253760,'options':{'where':{'id':_0x5035b7}},'log':_0x6709('0x2')});};exports[_0x6709('0x3')]=function(_0xccdcb5,_0x3cd087){return client[_0x6709('0x4')](_0x6709('0x5'),{'body':_0x3cd087,'options':{'where':{'id':_0xccdcb5}},'log':_0x6709('0x6')});}; \ No newline at end of file +var _0x7334=['Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','addTags'];(function(_0x11c637,_0x4f3841){var _0x24a768=function(_0x7d2dfe){while(--_0x7d2dfe){_0x11c637['push'](_0x11c637['shift']());}};_0x24a768(++_0x4f3841);}(_0x7334,0x184));var _0x4733=function(_0xaf3af8,_0x5e2f1a){_0xaf3af8=_0xaf3af8-0x0;var _0x261f5b=_0x7334[_0xaf3af8];return _0x261f5b;};'use strict';var client=require(_0x4733('0x0'));exports[_0x4733('0x1')]=function(_0x280b6b,_0x5016ad){return client['Request'](_0x4733('0x2'),{'body':_0x5016ad,'options':{'where':{'id':_0x280b6b}},'log':'updateMailInteraction'});};exports[_0x4733('0x3')]=function(_0x218143,_0x3645a2){return client[_0x4733('0x4')](_0x4733('0x5'),{'body':_0x3645a2,'options':{'where':{'id':_0x218143}},'log':_0x4733('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c3a7b27..9c42daa 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 _0x5c2c=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x3a9555,_0x5c54b0){var _0x146436=function(_0x5beb65){while(--_0x5beb65){_0x3a9555['push'](_0x3a9555['shift']());}};_0x146436(++_0x5c54b0);}(_0x5c2c,0x1e6));var _0xc5c2=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0x5c2c[_0x2211ed];return _0x4d78cc;};'use strict';var client=require(_0xc5c2('0x0'));exports[_0xc5c2('0x1')]=function(_0x1a08f3){return client[_0xc5c2('0x2')](_0xc5c2('0x3'),{'body':_0x1a08f3,'log':_0xc5c2('0x4')});}; \ No newline at end of file +var _0xacc4=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0xe29419,_0x5ef504){var _0xe9260a=function(_0x2dea26){while(--_0x2dea26){_0xe29419['push'](_0xe29419['shift']());}};_0xe9260a(++_0x5ef504);}(_0xacc4,0xde));var _0x4acc=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0xacc4[_0x304b67];return _0x493afb;};'use strict';var client=require(_0x4acc('0x0'));exports[_0x4acc('0x1')]=function(_0x2a11a2){return client[_0x4acc('0x2')](_0x4acc('0x3'),{'body':_0x2a11a2,'log':_0x4acc('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index b28bc94..42e3f0e 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 _0x26a9=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents','mailPause','../client'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0x26a9,0x153));var _0x926a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x26a9[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x926a('0x0'));exports[_0x926a('0x1')]=function(){return function(){return client[_0x926a('0x2')](_0x926a('0x3'),{'options':{'raw':![],'attributes':['id',_0x926a('0x4'),_0x926a('0x5'),_0x926a('0x6')],'include':[{'model':_0x926a('0x7'),'as':_0x926a('0x8'),'attributes':['id',_0x926a('0x4'),'online',_0x926a('0x9')]}]},'log':_0x926a('0x1')});};}; \ No newline at end of file +var _0x826a=['Request','name','strategy','online','mailPause','getMailQueues'];(function(_0x55187b,_0x156192){var _0x39989c=function(_0x38a52a){while(--_0x38a52a){_0x55187b['push'](_0x55187b['shift']());}};_0x39989c(++_0x156192);}(_0x826a,0xae));var _0xa826=function(_0x24d827,_0x4f6755){_0x24d827=_0x24d827-0x0;var _0x5d45b2=_0x826a[_0x24d827];return _0x5d45b2;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0xa826('0x0')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xa826('0x1'),'timeout',_0xa826('0x2')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xa826('0x1'),_0xa826('0x3'),_0xa826('0x4')]}]},'log':_0xa826('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1f770b6..2a686fb 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 _0x20c5=['create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x78a8f4,_0x259809){var _0x2b3291=function(_0x5e64ca){while(--_0x5e64ca){_0x78a8f4['push'](_0x78a8f4['shift']());}};_0x2b3291(++_0x259809);}(_0x20c5,0x1b8));var _0x520c=function(_0x4ea847,_0x23601e){_0x4ea847=_0x4ea847-0x0;var _0x48f22e=_0x20c5[_0x4ea847];return _0x48f22e;};'use strict';var client=require('../client');exports[_0x520c('0x0')]=function(_0x581aee){return client[_0x520c('0x1')](_0x520c('0x2'),{'body':_0x581aee,'log':_0x520c('0x2')});};exports['update']=function(_0x4be487,_0x2d75b2){return client[_0x520c('0x1')](_0x520c('0x3'),{'body':_0x2d75b2,'options':{'where':{'uniqueid':_0x4be487},'order':[['id',_0x520c('0x4')]],'limit':0x1},'log':_0x520c('0x3')});}; \ No newline at end of file +var _0x760b=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x40515c,_0x5b5296){var _0x95b4a9=function(_0x3cd6a3){while(--_0x3cd6a3){_0x40515c['push'](_0x40515c['shift']());}};_0x95b4a9(++_0x5b5296);}(_0x760b,0x180));var _0xb760=function(_0x369f2c,_0x4709e3){_0x369f2c=_0x369f2c-0x0;var _0xd959b=_0x760b[_0x369f2c];return _0xd959b;};'use strict';var client=require(_0xb760('0x0'));exports[_0xb760('0x1')]=function(_0x49eff1){return client[_0xb760('0x2')](_0xb760('0x3'),{'body':_0x49eff1,'log':_0xb760('0x3')});};exports[_0xb760('0x4')]=function(_0xddc31b,_0x129fa9){return client['Request'](_0xb760('0x5'),{'body':_0x129fa9,'options':{'where':{'uniqueid':_0xddc31b},'order':[['id',_0xb760('0x6')]],'limit':0x1},'log':_0xb760('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ade31c9..1d7dfed 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 _0x716e=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x28b599,_0x1c6268){var _0x2ec125=function(_0xd6e5fc){while(--_0xd6e5fc){_0x28b599['push'](_0x28b599['shift']());}};_0x2ec125(++_0x1c6268);}(_0x716e,0x86));var _0xe716=function(_0x2324d3,_0x2e76b0){_0x2324d3=_0x2324d3-0x0;var _0x475c9c=_0x716e[_0x2324d3];return _0x475c9c;};'use strict';var client=require(_0xe716('0x0'));exports[_0xe716('0x1')]=function(_0x4daea9,_0x28d742){return client[_0xe716('0x2')](_0xe716('0x3'),{'body':_0x28d742,'options':{'where':{'id':_0x4daea9}},'log':'updateOpenchannelInteraction'});};exports[_0xe716('0x4')]=function(_0x21d2c0,_0xecd26f){return client[_0xe716('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0xecd26f,'options':{'where':{'id':_0x21d2c0}},'log':_0xe716('0x5')});}; \ No newline at end of file +var _0xdc63=['Request','AddTagsToOpenchannelInteraction','../client','update'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xdc63,0x102));var _0x3dc6=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xdc63[_0x209941];return _0x1e8729;};'use strict';var client=require(_0x3dc6('0x0'));exports[_0x3dc6('0x1')]=function(_0xda05da,_0x899051){return client[_0x3dc6('0x2')]('UpdateOpenchannelInteraction',{'body':_0x899051,'options':{'where':{'id':_0xda05da}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x3ae844,_0x1d519b){return client[_0x3dc6('0x2')](_0x3dc6('0x3'),{'body':_0x1d519b,'options':{'where':{'id':_0x3ae844}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 17b77c8..5edcca5 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 _0xe233=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x40eded,_0xb7e326){var _0x13542d=function(_0x5ed87b){while(--_0x5ed87b){_0x40eded['push'](_0x40eded['shift']());}};_0x13542d(++_0xb7e326);}(_0xe233,0x18c));var _0x3e23=function(_0x41652c,_0x564b24){_0x41652c=_0x41652c-0x0;var _0x32628c=_0xe233[_0x41652c];return _0x32628c;};'use strict';var client=require(_0x3e23('0x0'));exports[_0x3e23('0x1')]=function(_0x130328){return client[_0x3e23('0x2')](_0x3e23('0x3'),{'body':_0x130328,'log':_0x3e23('0x4')});}; \ No newline at end of file +var _0x5409=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x22e0c0,_0x2cfd72){var _0x2bee95=function(_0x4f693f){while(--_0x4f693f){_0x22e0c0['push'](_0x22e0c0['shift']());}};_0x2bee95(++_0x2cfd72);}(_0x5409,0xea));var _0x9540=function(_0x46cf6f,_0x25fc0a){_0x46cf6f=_0x46cf6f-0x0;var _0x5431ea=_0x5409[_0x46cf6f];return _0x5431ea;};'use strict';var client=require(_0x9540('0x0'));exports[_0x9540('0x1')]=function(_0x7bca6e){return client[_0x9540('0x2')](_0x9540('0x3'),{'body':_0x7bca6e,'log':_0x9540('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index ba5471a..35a5ca7 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 _0x322b=['GetOpenchannelQueue','name','timeout','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x145a97,_0x2c9e5e){var _0x53018c=function(_0x14f15f){while(--_0x14f15f){_0x145a97['push'](_0x145a97['shift']());}};_0x53018c(++_0x2c9e5e);}(_0x322b,0x1ec));var _0xb322=function(_0x36bf8e,_0xc065a2){_0x36bf8e=_0x36bf8e-0x0;var _0x567be4=_0x322b[_0x36bf8e];return _0x567be4;};'use strict';var client=require(_0xb322('0x0'));exports[_0xb322('0x1')]=function(){return function(){return client[_0xb322('0x2')](_0xb322('0x3'),{'options':{'raw':![],'attributes':['id',_0xb322('0x4'),_0xb322('0x5'),'strategy'],'include':[{'model':'User','as':_0xb322('0x6'),'attributes':['id','name',_0xb322('0x7'),_0xb322('0x8')]}]},'log':_0xb322('0x1')});};}; \ No newline at end of file +var _0x90db=['GetOpenchannelQueue','name','online','openchannelPause','getOpenchannelQueues','Request'];(function(_0x1f6a60,_0x1465de){var _0x526310=function(_0x18fef2){while(--_0x18fef2){_0x1f6a60['push'](_0x1f6a60['shift']());}};_0x526310(++_0x1465de);}(_0x90db,0x1c0));var _0xb90d=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x90db[_0x487b0c];return _0x1adbdc;};'use strict';var client=require('../client');exports[_0xb90d('0x0')]=function(){return function(){return client[_0xb90d('0x1')](_0xb90d('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xb90d('0x3'),_0xb90d('0x4'),_0xb90d('0x5')]}]},'log':_0xb90d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 58a7f59..984041d 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 _0x3222=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x16a65e,_0x2f8d58){var _0x4cce0d=function(_0x5f3bdb){while(--_0x5f3bdb){_0x16a65e['push'](_0x16a65e['shift']());}};_0x4cce0d(++_0x2f8d58);}(_0x3222,0x101));var _0x2322=function(_0x28388f,_0x5f33a5){_0x28388f=_0x28388f-0x0;var _0x357288=_0x3222[_0x28388f];return _0x357288;};'use strict';var client=require(_0x2322('0x0'));exports[_0x2322('0x1')]=function(_0x41a77){return client[_0x2322('0x2')](_0x2322('0x3'),{'body':_0x41a77,'log':_0x2322('0x3')});};exports[_0x2322('0x4')]=function(_0xb59729,_0x5a12ba){return client[_0x2322('0x2')](_0x2322('0x5'),{'body':_0x5a12ba,'options':{'where':{'uniqueid':_0xb59729},'order':[['id',_0x2322('0x6')]],'limit':0x1},'log':_0x2322('0x5')});}; \ No newline at end of file +var _0x5047=['update','UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5047,0xe0));var _0x7504=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0x5047[_0x3825a8];return _0xabc9bc;};'use strict';var client=require(_0x7504('0x0'));exports[_0x7504('0x1')]=function(_0x41f668){return client[_0x7504('0x2')](_0x7504('0x3'),{'body':_0x41f668,'log':_0x7504('0x3')});};exports[_0x7504('0x4')]=function(_0x54f860,_0x20fc53){return client[_0x7504('0x2')](_0x7504('0x5'),{'body':_0x20fc53,'options':{'where':{'uniqueid':_0x54f860},'order':[['id','DESC']],'limit':0x1},'log':_0x7504('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index df95d88..564d186 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 _0x9efe=['UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0x205dd0,_0x3151e5){var _0x2bab2f=function(_0x110ac5){while(--_0x110ac5){_0x205dd0['push'](_0x205dd0['shift']());}};_0x2bab2f(++_0x3151e5);}(_0x9efe,0xca));var _0xe9ef=function(_0x7d261d,_0x4e1d2f){_0x7d261d=_0x7d261d-0x0;var _0x1a992a=_0x9efe[_0x7d261d];return _0x1a992a;};'use strict';var client=require('../client');exports[_0xe9ef('0x0')]=function(_0x2440ba,_0xb0e89c){return client[_0xe9ef('0x1')](_0xe9ef('0x2'),{'body':_0xb0e89c,'options':{'where':{'id':_0x2440ba}},'log':'updateSmsInteraction'});};exports[_0xe9ef('0x3')]=function(_0x186a70,_0x3deea3){return client[_0xe9ef('0x1')](_0xe9ef('0x4'),{'body':_0x3deea3,'options':{'where':{'id':_0x186a70}},'log':_0xe9ef('0x5')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x4de94d,_0xdd6680){var _0x5a74f5=function(_0x3e7181){while(--_0x3e7181){_0x4de94d['push'](_0x4de94d['shift']());}};_0x5a74f5(++_0xdd6680);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 7ac2e40..bde8edf 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 _0xf7b3=['Request','CreateSmsMessage','../client','create'];(function(_0x3be9c3,_0x31fe22){var _0x1f59f3=function(_0x46b60f){while(--_0x46b60f){_0x3be9c3['push'](_0x3be9c3['shift']());}};_0x1f59f3(++_0x31fe22);}(_0xf7b3,0x146));var _0x3f7b=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0xf7b3[_0x36940e];return _0x3283f2;};'use strict';var client=require(_0x3f7b('0x0'));exports[_0x3f7b('0x1')]=function(_0x2d4c5b){return client[_0x3f7b('0x2')](_0x3f7b('0x3'),{'body':_0x2d4c5b,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x6507=['createSmsMessage','../client','create'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6507,0x181));var _0x7650=function(_0x401600,_0x25eb46){_0x401600=_0x401600-0x0;var _0x576483=_0x6507[_0x401600];return _0x576483;};'use strict';var client=require(_0x7650('0x0'));exports[_0x7650('0x1')]=function(_0x32fc30){return client['Request']('CreateSmsMessage',{'body':_0x32fc30,'log':_0x7650('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 27134f0..a870a6d 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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0xa8a893,_0x17f78d){var _0x591a14=function(_0x5c23b4){while(--_0x5c23b4){_0xa8a893['push'](_0xa8a893['shift']());}};_0x591a14(++_0x17f78d);}(_0xe706,0xa3));var _0x6e70=function(_0x3cb788,_0x186eb7){_0x3cb788=_0x3cb788-0x0;var _0x56deab=_0xe706[_0x3cb788];return _0x56deab;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x2828b2,_0x39b94b){var _0x16249f=function(_0x50b56d){while(--_0x50b56d){_0x2828b2['push'](_0x2828b2['shift']());}};_0x16249f(++_0x39b94b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xb7e7[_0x468b0f];return _0x3e74d9;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 0129afb..bab2510 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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x537e3e,_0x8a6dda){var _0x196ac0=function(_0x57ab2e){while(--_0x57ab2e){_0x537e3e['push'](_0x537e3e['shift']());}};_0x196ac0(++_0x8a6dda);}(_0x55ca,0x126));var _0xa55c=function(_0x59ee9c,_0x43f62d){_0x59ee9c=_0x59ee9c-0x0;var _0x44a2a8=_0x55ca[_0x59ee9c];return _0x44a2a8;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x27188e,_0x2cb7b7){var _0x466456=function(_0x2b9758){while(--_0x2b9758){_0x27188e['push'](_0x27188e['shift']());}};_0x466456(++_0x2cb7b7);}(_0x008c,0x188));var _0xc008=function(_0x4070e5,_0x3cba2c){_0x4070e5=_0x4070e5-0x0;var _0x421852=_0x008c[_0x4070e5];return _0x421852;};'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 diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 972f338..3795369 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(_0x5b0c88,_0x1793e6){var _0x486054=function(_0x5d1f98){while(--_0x5d1f98){_0x5b0c88['push'](_0x5b0c88['shift']());}};_0x486054(++_0x1793e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0xdab6d8,_0x51a29c){var _0x4ed618=function(_0x42fd84){while(--_0x42fd84){_0xdab6d8['push'](_0xdab6d8['shift']());}};_0x4ed618(++_0x51a29c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 b9010e8..b940e7c 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 _0x1561=['AddTagsToWhatsappInteraction','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x2be22f,_0x29660c){var _0x22ba85=function(_0x506f29){while(--_0x506f29){_0x2be22f['push'](_0x2be22f['shift']());}};_0x22ba85(++_0x29660c);}(_0x1561,0x1bd));var _0x1156=function(_0x55aa91,_0xf32bb7){_0x55aa91=_0x55aa91-0x0;var _0x3ed7ab=_0x1561[_0x55aa91];return _0x3ed7ab;};'use strict';var client=require('../client');exports['update']=function(_0x22b4c9,_0x404319){return client[_0x1156('0x0')](_0x1156('0x1'),{'body':_0x404319,'options':{'where':{'id':_0x22b4c9}},'log':_0x1156('0x2')});};exports['addTags']=function(_0x1be639,_0x2b0b90){return client[_0x1156('0x0')](_0x1156('0x3'),{'body':_0x2b0b90,'options':{'where':{'id':_0x1be639}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xa24d=['update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client'];(function(_0x34c7e8,_0x16f1a3){var _0x3ec838=function(_0x1e9512){while(--_0x1e9512){_0x34c7e8['push'](_0x34c7e8['shift']());}};_0x3ec838(++_0x16f1a3);}(_0xa24d,0x1c1));var _0xda24=function(_0x2007cf,_0x42a0c1){_0x2007cf=_0x2007cf-0x0;var _0x60255c=_0xa24d[_0x2007cf];return _0x60255c;};'use strict';var client=require(_0xda24('0x0'));exports[_0xda24('0x1')]=function(_0x2e012b,_0x4432eb){return client[_0xda24('0x2')](_0xda24('0x3'),{'body':_0x4432eb,'options':{'where':{'id':_0x2e012b}},'log':_0xda24('0x4')});};exports['addTags']=function(_0xcc2450,_0x2e6e4f){return client[_0xda24('0x2')](_0xda24('0x5'),{'body':_0x2e6e4f,'options':{'where':{'id':_0xcc2450}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index aa629dc..86369b1 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 _0x186f=['createWhatsappMessage','../client','create'];(function(_0x7efea3,_0x3f928b){var _0x15116b=function(_0x5bd11b){while(--_0x5bd11b){_0x7efea3['push'](_0x7efea3['shift']());}};_0x15116b(++_0x3f928b);}(_0x186f,0x1e4));var _0xf186=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x186f[_0x4243a3];return _0x1b2a33;};'use strict';var client=require(_0xf186('0x0'));exports[_0xf186('0x1')]=function(_0x4f0e8c){return client['Request']('CreateWhatsappMessage',{'body':_0x4f0e8c,'log':_0xf186('0x2')});}; \ No newline at end of file +var _0xfab6=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x4bb8cf,_0x14c19d){var _0x4159b4=function(_0x38ba7a){while(--_0x38ba7a){_0x4bb8cf['push'](_0x4bb8cf['shift']());}};_0x4159b4(++_0x14c19d);}(_0xfab6,0x71));var _0x6fab=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xfab6[_0x1beef3];return _0x5af964;};'use strict';var client=require(_0x6fab('0x0'));exports[_0x6fab('0x1')]=function(_0x3ae9e5){return client[_0x6fab('0x2')](_0x6fab('0x3'),{'body':_0x3ae9e5,'log':_0x6fab('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index fd64bb1..ff9b7dd 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 _0xa901=['timeout','strategy','User','Agents','online','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0xa901,0x13b));var _0x1a90=function(_0x40e4f1,_0x444904){_0x40e4f1=_0x40e4f1-0x0;var _0x3419ed=_0xa901[_0x40e4f1];return _0x3419ed;};'use strict';var client=require(_0x1a90('0x0'));exports[_0x1a90('0x1')]=function(){return function(){return client[_0x1a90('0x2')](_0x1a90('0x3'),{'options':{'raw':![],'attributes':['id',_0x1a90('0x4'),_0x1a90('0x5'),_0x1a90('0x6')],'include':[{'model':_0x1a90('0x7'),'as':_0x1a90('0x8'),'attributes':['id',_0x1a90('0x4'),_0x1a90('0x9'),'whatsappPause']}]},'log':_0x1a90('0x1')});};}; \ No newline at end of file +var _0x5539=['getWhatsappQueues','GetWhatsappQueue','strategy','name','online','whatsappPause','../client'];(function(_0x5e63b1,_0xe3d31f){var _0x213672=function(_0x5e502b){while(--_0x5e502b){_0x5e63b1['push'](_0x5e63b1['shift']());}};_0x213672(++_0xe3d31f);}(_0x5539,0xb5));var _0x9553=function(_0x5ce285,_0x5b2e7e){_0x5ce285=_0x5ce285-0x0;var _0x52b86d=_0x5539[_0x5ce285];return _0x52b86d;};'use strict';var client=require(_0x9553('0x0'));exports[_0x9553('0x1')]=function(){return function(){return client['Request'](_0x9553('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x9553('0x3')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x9553('0x4'),_0x9553('0x5'),_0x9553('0x6')]}]},'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 d3dfdce..f65c9d2 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 _0x6468=['../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x39ec3b,_0x853748){var _0x104228=function(_0x575224){while(--_0x575224){_0x39ec3b['push'](_0x39ec3b['shift']());}};_0x104228(++_0x853748);}(_0x6468,0x149));var _0x8646=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x6468[_0x1d9aa0];return _0x226868;};'use strict';var client=require(_0x8646('0x0'));exports[_0x8646('0x1')]=function(_0x4561dd){return client[_0x8646('0x2')](_0x8646('0x3'),{'body':_0x4561dd,'log':_0x8646('0x3')});};exports[_0x8646('0x4')]=function(_0xa3eb65,_0xe70cf3){return client['Request'](_0x8646('0x5'),{'body':_0xe70cf3,'options':{'where':{'uniqueid':_0xa3eb65},'order':[['id',_0x8646('0x6')]],'limit':0x1},'log':_0x8646('0x5')});}; \ No newline at end of file +var _0x5d04=['CreateWhatsappQueueReport','update','Request','DESC','UpdateWhatsappQueueReport','../client'];(function(_0x5f47d6,_0x219ba2){var _0x100678=function(_0x45ca83){while(--_0x45ca83){_0x5f47d6['push'](_0x5f47d6['shift']());}};_0x100678(++_0x219ba2);}(_0x5d04,0x1cd));var _0x45d0=function(_0x44c23a,_0x95aba7){_0x44c23a=_0x44c23a-0x0;var _0x1ce6f8=_0x5d04[_0x44c23a];return _0x1ce6f8;};'use strict';var client=require(_0x45d0('0x0'));exports['create']=function(_0x1ed643){return client['Request'](_0x45d0('0x1'),{'body':_0x1ed643,'log':'CreateWhatsappQueueReport'});};exports[_0x45d0('0x2')]=function(_0x1c2f21,_0x1d7764){return client[_0x45d0('0x3')]('UpdateWhatsappQueueReport',{'body':_0x1d7764,'options':{'where':{'uniqueid':_0x1c2f21},'order':[['id',_0x45d0('0x4')]],'limit':0x1},'log':_0x45d0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 10ac57a..716c0d5 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 _0x0795=['validate','length','error','[%s][AGENT]\x20%s','map','message','stop','agents','timeout','createQueue','atimeout','channel','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence'];(function(_0x1f47b2,_0x32ea9c){var _0xf37729=function(_0x15ed33){while(--_0x15ed33){_0x1f47b2['push'](_0x1f47b2['shift']());}};_0xf37729(++_0x32ea9c);}(_0x0795,0x1b6));var _0x5079=function(_0x36d065,_0x4d7819){_0x36d065=_0x36d065-0x0;var _0x251782=_0x0795[_0x36d065];return _0x251782;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0x5079('0x0'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x5079('0x1'),'required':!![],'message':_0x5079('0x2')},'timeout':{'type':_0x5079('0x3'),'message':_0x5079('0x4')}});function writeLog(_0x341407,_0x2e60b6,_0xd1a8f6){return logger['info'](util[_0x5079('0x5')](_0x5079('0x6'),_0x341407,_0x2e60b6[_0x5079('0x7')],_0xd1a8f6));}function handleFindAgent(_0x4bdddb){return function(_0x2fe39f){return _0x2fe39f[_0x5079('0x7')][_0x5079('0x8')]()===_0x4bdddb[_0x5079('0x8')]();};}exports[_0x5079('0x9')]=function(_0x4a1cea,_0xe048,_0x1f3a1b,_0x42ff98){return function(_0x4c343e){try{var _0x41ad02={'name':_0xe048[0x0],'timeout':_0xe048[0x1]};var _0xc0bbf6=queue[_0x5079('0xa')](_0x41ad02,{'typecast':!![]});if(_0xc0bbf6[_0x5079('0xb')]){logger[_0x5079('0xc')](_0x5079('0xd'),_0x4a1cea,_[_0x5079('0xe')](_0xc0bbf6,_0x5079('0xf'))['join'](',\x20'));_0x4c343e[_0x5079('0x10')]();}else{var _0x33d486=_['find'](_0x1f3a1b[_0x5079('0x11')],handleFindAgent(_0x41ad02['name']));if(_0x33d486){var _0x2663aa=(_0x41ad02[_0x5079('0x12')]||0xa)*0x3e8;var _0x476f0a,_0x170a94;var _0x4241ce=seqqueue[_0x5079('0x13')](_0x2663aa);_0x4241ce['id']=_0x4a1cea;_0x4241ce[_0x5079('0x14')]=_0x2663aa;_0x4241ce[_0x5079('0x15')]=_0x42ff98[_0x5079('0x15')];writeLog(_0x4a1cea,_0x33d486,util[_0x5079('0x5')]('START:%s',_0x2663aa));_0x1f3a1b[_0x5079('0x16')][_0x4a1cea]['on'](_0x5079('0x17'),function(){logger[_0x5079('0x18')](_0x5079('0x19'),_0x4a1cea);clearTimeout(_0x170a94);_0x170a94=undefined;_0x4241ce['close']();if(_0x1f3a1b[_0x5079('0x16')][_0x4a1cea]){delete _0x1f3a1b[_0x5079('0x16')][_0x4a1cea];}_0x4c343e['stop']();});_0x1f3a1b[_0x5079('0x16')][_0x4a1cea]['on'](_0x5079('0x1a'),function(){if(_0x1f3a1b[_0x5079('0x16')][_0x4a1cea]){delete _0x1f3a1b[_0x5079('0x16')][_0x4a1cea];}});_0x170a94=setTimeout(function(){logger[_0x5079('0x18')](_0x5079('0x1b'),_0x4a1cea);clearTimeout(_0x170a94);_0x4241ce['close']();_0x4c343e[_0x5079('0x1c')]();},_0x2663aa);strategy[_0x5079('0x1d')](_0x4241ce,_0x33d486,_0x1f3a1b,_0x42ff98);}else{logger['error'](_0x5079('0x1e'),_0x4a1cea,_0x41ad02[_0x5079('0x7')]);_0x4c343e[_0x5079('0x10')]();}}}catch(_0x4c2f0c){console['log'](_0x4c2f0c);logger[_0x5079('0xc')]('[%s][QUEUE]\x20%s',_0x4a1cea,_0x4c2f0c[_0x5079('0x1f')]);_0x4c343e['stop']();}};}; \ No newline at end of file +var _0x6536=['[%s][QUEUE]\x20%s','util','../../../../config/logger','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','error','map','message','join','stop','find','agents','createQueue','atimeout','channel','format','START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log'];(function(_0x17ef0d,_0x338019){var _0x41edb4=function(_0x47fa4f){while(--_0x47fa4f){_0x17ef0d['push'](_0x17ef0d['shift']());}};_0x41edb4(++_0x338019);}(_0x6536,0x1cf));var _0x6653=function(_0xf6b870,_0x53f617){_0xf6b870=_0xf6b870-0x0;var _0x3905d2=_0x6536[_0xf6b870];return _0x3905d2;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x6653('0x0'));var seqqueue=require('seq-queue');var logger=require(_0x6653('0x1'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0x6653('0x2'),'required':!![],'message':_0x6653('0x3')},'timeout':{'type':_0x6653('0x4'),'message':_0x6653('0x5')}});function writeLog(_0x14f8b9,_0x3f57c9,_0x44d8ff){return logger[_0x6653('0x6')](util['format'](_0x6653('0x7'),_0x14f8b9,_0x3f57c9[_0x6653('0x8')],_0x44d8ff));}function handleFindAgent(_0x4eda51){return function(_0x1b92d2){return _0x1b92d2[_0x6653('0x8')][_0x6653('0x9')]()===_0x4eda51['toLowerCase']();};}exports[_0x6653('0xa')]=function(_0x2179f3,_0x4f8aa9,_0x1027cc,_0x3d17bc){return function(_0x3a47a0){try{var _0x55b1c0={'name':_0x4f8aa9[0x0],'timeout':_0x4f8aa9[0x1]};var _0x47c620=queue[_0x6653('0xb')](_0x55b1c0,{'typecast':!![]});if(_0x47c620['length']){logger[_0x6653('0xc')]('[%s][AGENT]\x20%s',_0x2179f3,_[_0x6653('0xd')](_0x47c620,_0x6653('0xe'))[_0x6653('0xf')](',\x20'));_0x3a47a0[_0x6653('0x10')]();}else{var _0x24dfb0=_[_0x6653('0x11')](_0x1027cc[_0x6653('0x12')],handleFindAgent(_0x55b1c0[_0x6653('0x8')]));if(_0x24dfb0){var _0x10c65f=(_0x55b1c0['timeout']||0xa)*0x3e8;var _0x83284,_0x4ac3e1;var _0xf82e12=seqqueue[_0x6653('0x13')](_0x10c65f);_0xf82e12['id']=_0x2179f3;_0xf82e12[_0x6653('0x14')]=_0x10c65f;_0xf82e12[_0x6653('0x15')]=_0x3d17bc[_0x6653('0x15')];writeLog(_0x2179f3,_0x24dfb0,util[_0x6653('0x16')](_0x6653('0x17'),_0x10c65f));_0x1027cc[_0x6653('0x18')][_0x2179f3]['on'](_0x6653('0x19'),function(){logger[_0x6653('0x6')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x2179f3);clearTimeout(_0x4ac3e1);_0x4ac3e1=undefined;_0xf82e12[_0x6653('0x1a')]();if(_0x1027cc['rules'][_0x2179f3]){delete _0x1027cc[_0x6653('0x18')][_0x2179f3];}_0x3a47a0[_0x6653('0x10')]();});_0x1027cc[_0x6653('0x18')][_0x2179f3]['on'](_0x6653('0x1b'),function(){if(_0x1027cc[_0x6653('0x18')][_0x2179f3]){delete _0x1027cc[_0x6653('0x18')][_0x2179f3];}});_0x4ac3e1=setTimeout(function(){logger['info'](_0x6653('0x1c'),_0x2179f3);clearTimeout(_0x4ac3e1);_0xf82e12[_0x6653('0x1a')]();_0x3a47a0['next']();},_0x10c65f);strategy[_0x6653('0x1d')](_0xf82e12,_0x24dfb0,_0x1027cc,_0x3d17bc);}else{logger[_0x6653('0xc')](_0x6653('0x1e'),_0x2179f3,_0x55b1c0[_0x6653('0x8')]);_0x3a47a0[_0x6653('0x10')]();}}}catch(_0x21f725){console[_0x6653('0x1f')](_0x21f725);logger[_0x6653('0xc')](_0x6653('0x20'),_0x2179f3,_0x21f725['stack']);_0x3a47a0[_0x6653('0x10')]();}};}; \ 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 3208b72..7181cd9 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 _0x71f1=['out','channel','whatsapp','interaction','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','next','amazonlex','providerName','stringify','create','Failed','error','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4709f7,_0x49a0f4){var _0x3b566a=function(_0x2e47b6){while(--_0x2e47b6){_0x4709f7['push'](_0x4709f7['shift']());}};_0x3b566a(++_0x49a0f4);}(_0x71f1,0x187));var _0x171f=function(_0x4f6afc,_0x4dfa88){_0x4f6afc=_0x4f6afc-0x0;var _0x256eeb=_0x71f1[_0x4f6afc];return _0x256eeb;};'use strict';var _=require(_0x171f('0x0'));var moment=require(_0x171f('0x1'));var AWS=require('aws-sdk');var utils=require(_0x171f('0x2'));var logger=require(_0x171f('0x3'))(_0x171f('0x4'));var rpc={'chatMessage':require(_0x171f('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x171f('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x171f('0x7')]=function(_0x3aaedb,_0x3c39e5){return function(_0x3d23d2){try{if(!_[_0x171f('0x8')](this['interaction'][_0x171f('0x9')])){logger[_0x171f('0xa')](_0x171f('0xb'),_0x3aaedb,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3d23d2['next']();}var _0x14256f={'ContactId':this[_0x171f('0xc')]['id'],'sentAt':moment()['format'](_0x171f('0xd')),'direction':_0x171f('0xe')};if(this[_0x171f('0xf')]==='sms'||this[_0x171f('0xf')]===_0x171f('0x10')){_0x14256f['phone']=this[_0x171f('0x11')][_0x171f('0x12')];}var _0x49c299=this['channel'];if(_0x49c299===_0x171f('0x13')){_0x14256f[_0x171f('0x14')]=this[_0x171f('0x15')]['id'];}else{_0x14256f[_[_0x171f('0x16')](_0x49c299)+_0x171f('0x17')]=this[_0x171f('0x15')]['id'];}_0x14256f[_['upperFirst'](_0x49c299)+_0x171f('0x18')]=this['interaction']['id'];if(this[_0x171f('0x11')]['created']){var _0x137264=_0x3c39e5[0x4];if(!_[_0x171f('0x19')](_0x137264)){_0x14256f[_0x171f('0x1a')]=utils[_0x171f('0x1b')](_0x137264,this);return rpc[_0x49c299+_0x171f('0x1c')]['create'](_0x14256f)['then'](function(_0x2974ac){logger['info'](_0x171f('0xb'),_0x3aaedb,_0x14256f[_0x171f('0x1a')]);})[_0x171f('0x1d')](function(_0x4184fc){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3aaedb,JSON['stringify'](_0x4184fc));})[_0x171f('0x1e')](function(){logger[_0x171f('0xa')](_0x171f('0x1f'),_0x3aaedb);_0x3d23d2[_0x171f('0x20')]();});}else{logger[_0x171f('0xa')](_0x171f('0x21'),_0x3aaedb);_0x3d23d2[_0x171f('0x20')]();}}else{var _0xc5b744=this;var _0x42dd12=new AWS[(_0x171f('0x22'))]({'accessKeyId':_0x3c39e5[0x0],'secretAccessKey':_0x3c39e5[0x1],'region':_0x3c39e5[0x2]});var _0x20825e={'botAlias':_0x171f('0x23'),'botName':_0x3c39e5[0x3],'inputText':this[_0x171f('0x24')]['body'],'userId':this[_0x171f('0xf')]+':'+this['interaction']['id'][_0x171f('0x25')]()};_0x42dd12['postText'](_0x20825e,function(_0x57b00b,_0xc4cb96){if(_0x57b00b){logger['error'](_0x171f('0xb'),_0x3aaedb,_0x57b00b[_0x171f('0x24')]);_0x3d23d2[_0x171f('0x26')]();}else if(_0xc4cb96&&_0xc4cb96[_0x171f('0x24')]){_0xc5b744['body'][_0x171f('0x27')]=_0xc4cb96;_0x14256f[_0x171f('0x1a')]=_0xc4cb96[_0x171f('0x24')];_0x14256f[_0x171f('0x28')]='amazonlex';_0x14256f['providerResponse']=JSON[_0x171f('0x29')](_0xc4cb96);return rpc[_0x49c299+_0x171f('0x1c')][_0x171f('0x2a')](_0x14256f)['then'](function(_0x1bf099){logger[_0x171f('0xa')]('[%s][AMAZONLEX]\x20%s',_0x3aaedb,_0x14256f[_0x171f('0x1a')]);if(_0xc4cb96['dialogState']==_0x171f('0x2b')){_0x3d23d2[_0x171f('0x26')]();}else{_0x3d23d2[_0x171f('0x20')]();}})[_0x171f('0x1d')](function(_0x365f08){logger[_0x171f('0x2c')]('[%s][AMAZONLEX]\x20%s',_0x3aaedb,JSON['stringify'](_0x365f08));_0x3d23d2[_0x171f('0x26')]();});}else{_0x3d23d2[_0x171f('0x26')]();}});}}catch(_0x3032e4){logger['error'](_0x171f('0xb'),_0x3aaedb,JSON['stringify'](_0x3032e4));_0x3d23d2[_0x171f('0x20')]();}};}; \ No newline at end of file +var _0x22bc=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','create','info','catch','stringify','finally','stop','LexRuntime','$LATEST','toString','postText','error','amazonlex','message','providerName','providerResponse','Message','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22bc,0xbf));var _0xc22b=function(_0x66ff22,_0xd13e05){_0x66ff22=_0x66ff22-0x0;var _0x12b888=_0x22bc[_0x66ff22];return _0x12b888;};'use strict';var _=require(_0xc22b('0x0'));var moment=require(_0xc22b('0x1'));var AWS=require(_0xc22b('0x2'));var utils=require('./utils');var logger=require(_0xc22b('0x3'))('routing');var rpc={'chatMessage':require(_0xc22b('0x4')),'openchannelMessage':require(_0xc22b('0x5')),'mailMessage':require(_0xc22b('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc22b('0x7')),'whatsappMessage':require(_0xc22b('0x8'))};exports[_0xc22b('0x9')]=function(_0x3445be,_0xa19918){return function(_0x2310ed){try{if(!_['isNil'](this[_0xc22b('0xa')][_0xc22b('0xb')])){logger['info'](_0xc22b('0xc'),_0x3445be,_0xc22b('0xd'));return _0x2310ed[_0xc22b('0xe')]();}var _0x1cc48c={'ContactId':this[_0xc22b('0xf')]['id'],'sentAt':moment()[_0xc22b('0x10')](_0xc22b('0x11')),'direction':'out'};if(this[_0xc22b('0x12')]===_0xc22b('0x13')||this['channel']==='whatsapp'){_0x1cc48c[_0xc22b('0x14')]=this[_0xc22b('0xa')]['phone'];}var _0x43bd5b=this[_0xc22b('0x12')];if(_0x43bd5b===_0xc22b('0x15')){_0x1cc48c[_0xc22b('0x16')]=this[_0xc22b('0x17')]['id'];}else{_0x1cc48c[_['upperFirst'](_0x43bd5b)+_0xc22b('0x18')]=this[_0xc22b('0x17')]['id'];}_0x1cc48c[_[_0xc22b('0x19')](_0x43bd5b)+_0xc22b('0x1a')]=this[_0xc22b('0xa')]['id'];if(this['interaction'][_0xc22b('0x1b')]){var _0x585649=_0xa19918[0x4];if(!_[_0xc22b('0x1c')](_0x585649)){_0x1cc48c[_0xc22b('0x1d')]=utils[_0xc22b('0x1e')](_0x585649,this);return rpc[_0x43bd5b+'Message'][_0xc22b('0x1f')](_0x1cc48c)['then'](function(_0x4dc556){logger[_0xc22b('0x20')](_0xc22b('0xc'),_0x3445be,_0x1cc48c[_0xc22b('0x1d')]);})[_0xc22b('0x21')](function(_0x2053f9){logger['error'](_0xc22b('0xc'),_0x3445be,JSON[_0xc22b('0x22')](_0x2053f9));})[_0xc22b('0x23')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3445be);_0x2310ed[_0xc22b('0x24')]();});}else{logger[_0xc22b('0x20')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3445be);_0x2310ed[_0xc22b('0x24')]();}}else{var _0x5e74d7=this;var _0x5cd795=new AWS[(_0xc22b('0x25'))]({'accessKeyId':_0xa19918[0x0],'secretAccessKey':_0xa19918[0x1],'region':_0xa19918[0x2]});var _0x1bc66d={'botAlias':_0xc22b('0x26'),'botName':_0xa19918[0x3],'inputText':this['message'][_0xc22b('0x1d')],'userId':this['channel']+':'+this['interaction']['id'][_0xc22b('0x27')]()};_0x5cd795[_0xc22b('0x28')](_0x1bc66d,function(_0x4e878f,_0xd604c){if(_0x4e878f){logger[_0xc22b('0x29')]('[%s][AMAZONLEX]\x20%s',_0x3445be,_0x4e878f['message']);_0x2310ed[_0xc22b('0xe')]();}else if(_0xd604c&&_0xd604c['message']){_0x5e74d7[_0xc22b('0x1d')][_0xc22b('0x2a')]=_0xd604c;_0x1cc48c[_0xc22b('0x1d')]=_0xd604c[_0xc22b('0x2b')];_0x1cc48c[_0xc22b('0x2c')]=_0xc22b('0x2a');_0x1cc48c[_0xc22b('0x2d')]=JSON[_0xc22b('0x22')](_0xd604c);return rpc[_0x43bd5b+_0xc22b('0x2e')][_0xc22b('0x1f')](_0x1cc48c)['then'](function(_0x4b7b29){logger['info'](_0xc22b('0xc'),_0x3445be,_0x1cc48c['body']);if(_0xd604c[_0xc22b('0x2f')]==_0xc22b('0x30')){_0x2310ed['next']();}else{_0x2310ed[_0xc22b('0x24')]();}})[_0xc22b('0x21')](function(_0x44ea0b){logger[_0xc22b('0x29')](_0xc22b('0xc'),_0x3445be,JSON['stringify'](_0x44ea0b));_0x2310ed[_0xc22b('0xe')]();});}else{_0x2310ed[_0xc22b('0xe')]();}});}}catch(_0x4037c2){logger[_0xc22b('0x29')](_0xc22b('0xc'),_0x3445be,JSON[_0xc22b('0x22')](_0x4037c2));_0x2310ed[_0xc22b('0x24')]();}};}; \ 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 1e1a37d..f5a9f83 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 _0x05a1=['stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','read','subject','startsWith','Re:\x20','account','AccountId','upperFirst','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','smtpOptions','then','create','stringify','catch','error','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s'];(function(_0x57cc16,_0x444378){var _0x5421e5=function(_0xbcb1d3){while(--_0xbcb1d3){_0x57cc16['push'](_0x57cc16['shift']());}};_0x5421e5(++_0x444378);}(_0x05a1,0xcd));var _0x105a=function(_0x3ac061,_0x36b2b0){_0x3ac061=_0x3ac061-0x0;var _0x352171=_0x05a1[_0x3ac061];return _0x352171;};'use strict';var _=require(_0x105a('0x0'));var moment=require(_0x105a('0x1'));var utils=require(_0x105a('0x2'));var logger=require(_0x105a('0x3'))(_0x105a('0x4'));var rpc={'chatMessage':require(_0x105a('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x105a('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x105a('0x7')),'whatsappMessage':require(_0x105a('0x8')),'chatInteraction':require(_0x105a('0x9')),'openchannelInteraction':require(_0x105a('0xa')),'mailInteraction':require(_0x105a('0xb')),'smsInteraction':require(_0x105a('0xc')),'faxInteraction':require(_0x105a('0xd')),'whatsappInteraction':require(_0x105a('0xe'))};var mailRpc=require('../../mailRpc');exports[_0x105a('0xf')]=function(_0x532b2f,_0x459615,_0x4601ec,_0x1582f4){return function(_0x4c49b2){try{var _0x186709=this[_0x105a('0x10')];if(_0x186709===_0x105a('0x11')&&_0x1582f4[_0x105a('0x12')][_0x105a('0x13')]){logger[_0x105a('0x14')](_0x105a('0x15'),_0x532b2f,_0x105a('0x16'));return _0x4c49b2[_0x105a('0x17')]();}if(_0x459615[0x0]==='1'&&(_['isNil'](this[_0x105a('0x18')][_0x105a('0x19')])||!this['interaction'][_0x105a('0x19')])){logger[_0x105a('0x14')](_0x105a('0x15'),_0x532b2f,_0x105a('0x1a'));return _0x4c49b2[_0x105a('0x17')]();}if(_0x459615[0x0]==='2'&&this[_0x105a('0x18')][_0x105a('0x1b')]){logger[_0x105a('0x14')](_0x105a('0x1c'),_0x532b2f,_0x105a('0x1d'));return _0x4c49b2[_0x105a('0x17')]();}var _0x5b57df={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x105a('0x1e')),'direction':_0x105a('0x1f')};if(this[_0x105a('0x10')]===_0x105a('0x11')){_0x5b57df[_0x105a('0x12')]=utils[_0x105a('0x20')](_0x459615[0x2],this);}else{_0x5b57df[_0x105a('0x12')]=utils[_0x105a('0x20')](_0x459615[0x1],this);}if(this[_0x105a('0x21')]){_0x5b57df['to']=this[_0x105a('0x21')][_0x105a('0x22')]||'';if(this['channel']==='mail'&&_0x459615[0x1]==='1'){_0x5b57df['cc']=this[_0x105a('0x21')]['cc']||'';}_0x5b57df[_0x105a('0x22')]=this[_0x105a('0x21')]['to']||'';_0x5b57df['phone']=this['message']['phone']||'';_0x5b57df[_0x105a('0x23')]=!![];if(this[_0x105a('0x21')]['subject']){_0x5b57df[_0x105a('0x24')]='';_0x5b57df[_0x105a('0x24')]+=_[_0x105a('0x25')](this['message']['subject'],'Re:')?'':_0x105a('0x26');_0x5b57df[_0x105a('0x24')]+=this['message'][_0x105a('0x24')];}}if(this[_0x105a('0x10')]==='chat'){_0x5b57df['ChatWebsiteId']=this[_0x105a('0x27')]['id'];}else{_0x5b57df[_['upperFirst'](this[_0x105a('0x10')])+_0x105a('0x28')]=this[_0x105a('0x27')]['id'];}_0x5b57df[_[_0x105a('0x29')](this[_0x105a('0x10')])+_0x105a('0x2a')]=this[_0x105a('0x18')]['id'];var _0x6889bd=this[_0x105a('0x18')];if(rpc[this[_0x105a('0x10')]+_0x105a('0x2b')]){if(this[_0x105a('0x10')]===_0x105a('0x11')){_0x5b57df[_0x105a('0x2c')]=this[_0x105a('0x21')][_0x105a('0x2d')];_0x5b57df[_0x105a('0x2e')]=_0x105a('0x2f')+_[_0x105a('0x30')](_0x5b57df['body'],_0x105a('0x31'),_0x105a('0x32'))+_0x105a('0x33');_0x5b57df[_0x105a('0x34')]={'Auto-Submitted':_0x105a('0x35'),'X-Auto-Response-Suppress':_0x105a('0x36'),'Precedence':_0x105a('0x37')};return mailRpc['sendMailMessage'](this[_0x105a('0x27')][_0x105a('0x38')],_0x5b57df)[_0x105a('0x39')](function(_0x18b165){logger[_0x105a('0x14')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x532b2f);_0x5b57df[_0x105a('0x2d')]=_0x18b165[_0x105a('0x21')][_0x105a('0x2d')];return rpc[_0x186709+'Message'][_0x105a('0x3a')](_0x5b57df);})[_0x105a('0x39')](function(_0x4f19db){logger[_0x105a('0x14')](_0x105a('0x15'),_0x532b2f,JSON[_0x105a('0x3b')](_0x4f19db));})[_0x105a('0x3c')](function(_0x50fccf){logger[_0x105a('0x3d')]('[RPC][%s][AUTOREPLY]\x20%s',_0x532b2f,JSON[_0x105a('0x3b')](_0x50fccf));})[_0x105a('0x3e')](function(){Promise[_0x105a('0x3f')]()[_0x105a('0x39')](function(){if(_0x459615[0x0]!=='2'||_0x6889bd[_0x105a('0x1b')])return;return rpc[_0x186709+_0x105a('0x40')][_0x105a('0x41')](_0x6889bd['id'],{'autoreplyExecuted':!![]})['then'](function(_0x4ae0ec){logger[_0x105a('0x14')](_0x105a('0x1c'),_0x532b2f,JSON[_0x105a('0x3b')](_0x4ae0ec));})[_0x105a('0x3c')](function(_0x4ff487){logger[_0x105a('0x3d')](_0x105a('0x42'),_0x532b2f,JSON[_0x105a('0x3b')](_0x4ff487));});})[_0x105a('0x39')](function(){_0x4c49b2[_0x105a('0x17')]();});});}else{return rpc[this[_0x105a('0x10')]+_0x105a('0x2b')][_0x105a('0x3a')](_0x5b57df)['then'](function(){logger['info'](_0x105a('0x15'),_0x532b2f,_0x5b57df[_0x105a('0x12')]);})['catch'](function(_0x5a1b0c){logger['error'](_0x105a('0x15'),_0x532b2f,JSON[_0x105a('0x3b')](_0x5a1b0c));})[_0x105a('0x3e')](function(){Promise[_0x105a('0x3f')]()[_0x105a('0x39')](function(){if(_0x459615[0x0]!=='2'||_0x6889bd[_0x105a('0x1b')])return;return rpc[_0x186709+_0x105a('0x40')][_0x105a('0x41')](_0x6889bd['id'],{'autoreplyExecuted':!![]})['then'](function(_0x319759){logger[_0x105a('0x14')](_0x105a('0x1c'),_0x532b2f,JSON[_0x105a('0x3b')](_0x319759));})[_0x105a('0x3c')](function(_0x25aca9){logger[_0x105a('0x3d')](_0x105a('0x42'),_0x532b2f,JSON[_0x105a('0x3b')](_0x25aca9));});})[_0x105a('0x39')](function(){_0x4c49b2[_0x105a('0x17')]();});});}}}catch(_0x6dfb0b){logger['error'](_0x105a('0x15'),_0x532b2f,JSON[_0x105a('0x3b')](_0x6dfb0b));_0x4c49b2[_0x105a('0x43')]();}};}; \ No newline at end of file +var _0x1215=['format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','Interaction','update','lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../mailRpc','channel','mail','body','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','contact'];(function(_0x6bf794,_0x4ddc42){var _0x2340ed=function(_0x1e8553){while(--_0x1e8553){_0x6bf794['push'](_0x6bf794['shift']());}};_0x2340ed(++_0x4ddc42);}(_0x1215,0x1b0));var _0x5121=function(_0xe06071,_0x4eeaa1){_0xe06071=_0xe06071-0x0;var _0x8ad8be=_0x1215[_0xe06071];return _0x8ad8be;};'use strict';var _=require(_0x5121('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0x5121('0x1'))('routing');var rpc={'chatMessage':require(_0x5121('0x2')),'openchannelMessage':require(_0x5121('0x3')),'mailMessage':require(_0x5121('0x4')),'smsMessage':require(_0x5121('0x5')),'faxMessage':require(_0x5121('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x5121('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x5121('0x8')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x5121('0x9'));exports['consequence']=function(_0x1e0ac4,_0x2258df,_0x362015,_0x2ade7f){return function(_0x4d91d6){try{var _0x399a9d=this[_0x5121('0xa')];if(_0x399a9d===_0x5121('0xb')&&_0x2ade7f[_0x5121('0xc')]['isAutoreply']){logger['info']('[%s][AUTOREPLY]\x20%s',_0x1e0ac4,_0x5121('0xd'));return _0x4d91d6[_0x5121('0xe')]();}if(_0x2258df[0x0]==='1'&&(_[_0x5121('0xf')](this[_0x5121('0x10')]['created'])||!this[_0x5121('0x10')][_0x5121('0x11')])){logger[_0x5121('0x12')](_0x5121('0x13'),_0x1e0ac4,_0x5121('0x14'));return _0x4d91d6['next']();}if(_0x2258df[0x0]==='2'&&this['interaction'][_0x5121('0x15')]){logger[_0x5121('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1e0ac4,'One\x20Time\x20already\x20sent');return _0x4d91d6['next']();}var _0x5be242={'ContactId':this[_0x5121('0x16')]['id'],'sentAt':moment()[_0x5121('0x17')](_0x5121('0x18')),'direction':_0x5121('0x19')};if(this['channel']==='mail'){_0x5be242[_0x5121('0xc')]=utils[_0x5121('0x1a')](_0x2258df[0x2],this);}else{_0x5be242['body']=utils['getMustacheRender'](_0x2258df[0x1],this);}if(this[_0x5121('0x1b')]){_0x5be242['to']=this[_0x5121('0x1b')][_0x5121('0x1c')]||'';if(this['channel']===_0x5121('0xb')&&_0x2258df[0x1]==='1'){_0x5be242['cc']=this[_0x5121('0x1b')]['cc']||'';}_0x5be242[_0x5121('0x1c')]=this[_0x5121('0x1b')]['to']||'';_0x5be242['phone']=this[_0x5121('0x1b')][_0x5121('0x1d')]||'';_0x5be242[_0x5121('0x1e')]=!![];if(this[_0x5121('0x1b')][_0x5121('0x1f')]){_0x5be242[_0x5121('0x1f')]='';_0x5be242[_0x5121('0x1f')]+=_[_0x5121('0x20')](this['message'][_0x5121('0x1f')],_0x5121('0x21'))?'':_0x5121('0x22');_0x5be242['subject']+=this[_0x5121('0x1b')][_0x5121('0x1f')];}}if(this['channel']==='chat'){_0x5be242[_0x5121('0x23')]=this[_0x5121('0x24')]['id'];}else{_0x5be242[_[_0x5121('0x25')](this[_0x5121('0xa')])+_0x5121('0x26')]=this[_0x5121('0x24')]['id'];}_0x5be242[_['upperFirst'](this[_0x5121('0xa')])+_0x5121('0x27')]=this[_0x5121('0x10')]['id'];var _0x3a0827=this[_0x5121('0x10')];if(rpc[this[_0x5121('0xa')]+_0x5121('0x28')]){if(this[_0x5121('0xa')]===_0x5121('0xb')){_0x5be242[_0x5121('0x29')]=this[_0x5121('0x1b')][_0x5121('0x2a')];_0x5be242[_0x5121('0x2b')]=_0x5121('0x2c')+_[_0x5121('0x2d')](_0x5be242[_0x5121('0xc')],_0x5121('0x2e'),_0x5121('0x2f'))+_0x5121('0x30');_0x5be242[_0x5121('0x31')]={'Auto-Submitted':_0x5121('0x32'),'X-Auto-Response-Suppress':_0x5121('0x33'),'Precedence':_0x5121('0x34')};return mailRpc[_0x5121('0x35')](this[_0x5121('0x24')][_0x5121('0x36')],_0x5be242)[_0x5121('0x37')](function(_0x1ba99b){logger[_0x5121('0x12')](_0x5121('0x38'),_0x1e0ac4);_0x5be242['messageId']=_0x1ba99b[_0x5121('0x1b')][_0x5121('0x2a')];return rpc[_0x399a9d+_0x5121('0x28')][_0x5121('0x39')](_0x5be242);})[_0x5121('0x37')](function(_0x387bf1){logger['info']('[%s][AUTOREPLY]\x20%s',_0x1e0ac4,JSON[_0x5121('0x3a')](_0x387bf1));})[_0x5121('0x3b')](function(_0x12bedb){logger[_0x5121('0x3c')]('[RPC][%s][AUTOREPLY]\x20%s',_0x1e0ac4,JSON[_0x5121('0x3a')](_0x12bedb));})['finally'](function(){Promise['resolve']()[_0x5121('0x37')](function(){if(_0x2258df[0x0]!=='2'||_0x3a0827[_0x5121('0x15')])return;return rpc[_0x399a9d+'Interaction']['update'](_0x3a0827['id'],{'autoreplyExecuted':!![]})[_0x5121('0x37')](function(_0x111ea9){logger[_0x5121('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1e0ac4,JSON[_0x5121('0x3a')](_0x111ea9));})[_0x5121('0x3b')](function(_0x7bd0df){logger[_0x5121('0x3c')](_0x5121('0x3d'),_0x1e0ac4,JSON['stringify'](_0x7bd0df));});})['then'](function(){_0x4d91d6[_0x5121('0xe')]();});});}else{return rpc[this[_0x5121('0xa')]+'Message'][_0x5121('0x39')](_0x5be242)['then'](function(){logger['info'](_0x5121('0x13'),_0x1e0ac4,_0x5be242[_0x5121('0xc')]);})[_0x5121('0x3b')](function(_0x16b098){logger[_0x5121('0x3c')](_0x5121('0x13'),_0x1e0ac4,JSON[_0x5121('0x3a')](_0x16b098));})[_0x5121('0x3e')](function(){Promise['resolve']()['then'](function(){if(_0x2258df[0x0]!=='2'||_0x3a0827[_0x5121('0x15')])return;return rpc[_0x399a9d+_0x5121('0x3f')][_0x5121('0x40')](_0x3a0827['id'],{'autoreplyExecuted':!![]})[_0x5121('0x37')](function(_0x87f621){logger[_0x5121('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1e0ac4,JSON['stringify'](_0x87f621));})[_0x5121('0x3b')](function(_0x3e1097){logger[_0x5121('0x3c')](_0x5121('0x3d'),_0x1e0ac4,JSON['stringify'](_0x3e1097));});})[_0x5121('0x37')](function(){_0x4d91d6[_0x5121('0xe')]();});});}}}catch(_0x2aa33e){logger[_0x5121('0x3c')](_0x5121('0x13'),_0x1e0ac4,JSON['stringify'](_0x2aa33e));_0x4d91d6['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 18250f1..69023dc 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 _0xb9aa=['moment','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s'];(function(_0x28db62,_0xfe11c1){var _0xbc95be=function(_0x4292d4){while(--_0x4292d4){_0x28db62['push'](_0x28db62['shift']());}};_0xbc95be(++_0xfe11c1);}(_0xb9aa,0x9a));var _0xab9a=function(_0xb08e5d,_0x4d1b6f){_0xb08e5d=_0xb08e5d-0x0;var _0x17ede0=_0xb9aa[_0xb08e5d];return _0x17ede0;};'use strict';var moment=require(_0xab9a('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xab9a('0x1')),'smsInteraction':require(_0xab9a('0x2')),'mailInteraction':require(_0xab9a('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xab9a('0x4')]=function(_0x4d6a87,_0x49bca8,_0x227ea0,_0x3fc55e){return function(_0x2180ec){try{logger[_0xab9a('0x5')](_0xab9a('0x6'),_0x4d6a87,_0x49bca8[0x0]);var _0x280acf={'closed':0x1,'closedAt':moment()[_0xab9a('0x7')](_0xab9a('0x8')),'closeReason':_0xab9a('0x9'),'disposition':_0x49bca8[0x0]};if(rpc[_0x3fc55e[_0xab9a('0xa')]+'Interaction']){rpc[_0x3fc55e[_0xab9a('0xa')]+_0xab9a('0xb')][_0xab9a('0xc')](_0x3fc55e[_0xab9a('0xd')]['id'],_0x280acf)[_0xab9a('0xe')](function(_0xede977){logger[_0xab9a('0x5')](_0xab9a('0xf'),_0x4d6a87,_0x3fc55e[_0xab9a('0xd')]['id']);})[_0xab9a('0x10')](function(_0x5b4f2c){logger[_0xab9a('0x11')]('[%s][CLOSE]\x20%s',_0x4d6a87,JSON[_0xab9a('0x12')](_0x5b4f2c));})[_0xab9a('0x13')](function(){_0x2180ec[_0xab9a('0x14')]();});}}catch(_0x4333dd){logger[_0xab9a('0x11')](_0xab9a('0x15'),_0x4d6a87,JSON[_0xab9a('0x12')](_0x4333dd));_0x2180ec['stop']();}};}; \ No newline at end of file +var _0x8646=['stop','error','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20%s','finally'];(function(_0x394225,_0x2d8435){var _0x529ad9=function(_0x58d726){while(--_0x58d726){_0x394225['push'](_0x394225['shift']());}};_0x529ad9(++_0x2d8435);}(_0x8646,0xf0));var _0x6864=function(_0x4d6d14,_0x42f0c5){_0x4d6d14=_0x4d6d14-0x0;var _0x2fc7f6=_0x8646[_0x4d6d14];return _0x2fc7f6;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x6864('0x0')),'smsInteraction':require(_0x6864('0x1')),'mailInteraction':require(_0x6864('0x2')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x6864('0x3'))};exports[_0x6864('0x4')]=function(_0x5b39be,_0x488294,_0x12b38a,_0x34134c){return function(_0x28e9b7){try{logger[_0x6864('0x5')](_0x6864('0x6'),_0x5b39be,_0x488294[0x0]);var _0x371445={'closed':0x1,'closedAt':moment()['format'](_0x6864('0x7')),'closeReason':_0x6864('0x8'),'disposition':_0x488294[0x0]};if(rpc[_0x34134c[_0x6864('0x9')]+_0x6864('0xa')]){rpc[_0x34134c[_0x6864('0x9')]+_0x6864('0xa')]['update'](_0x34134c[_0x6864('0xb')]['id'],_0x371445)[_0x6864('0xc')](function(_0x40016d){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5b39be,_0x34134c['interaction']['id']);})['catch'](function(_0x1f5797){logger['error'](_0x6864('0xd'),_0x5b39be,JSON['stringify'](_0x1f5797));})[_0x6864('0xe')](function(){_0x28e9b7[_0x6864('0xf')]();});}}catch(_0x2509c1){logger[_0x6864('0x10')]('[%s][CLOSE]\x20%s',_0x5b39be,JSON['stringify'](_0x2509c1));_0x28e9b7['stop']();}};}; \ 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 6f18e4c..b19958d 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 _0x7163=['error','[%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','fulfillment','providerName','providerResponse','stringify','Message','metadata','endConversation','lodash','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','InteractionId','created','create','then','body','catch'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7163,0x1ef));var _0x3716=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x7163[_0x46efd7];return _0x5637e4;};'use strict';var _=require(_0x3716('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x3716('0x1'));var utils=require(_0x3716('0x2'));var logger=require(_0x3716('0x3'))('routing');var rpc={'chatMessage':require(_0x3716('0x4')),'openchannelMessage':require(_0x3716('0x5')),'mailMessage':require(_0x3716('0x6')),'smsMessage':require(_0x3716('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3716('0x8')]=function(_0x4549b2,_0x4422c3){return function(_0x14bfe0){try{if(!_[_0x3716('0x9')](this[_0x3716('0xa')][_0x3716('0xb')])){logger[_0x3716('0xc')](_0x3716('0xd'),_0x4549b2,_0x3716('0xe'));return _0x14bfe0[_0x3716('0xf')]();}var _0x3d20f4={'ContactId':this[_0x3716('0x10')]['id'],'sentAt':moment()[_0x3716('0x11')](_0x3716('0x12')),'direction':_0x3716('0x13')};if(this[_0x3716('0x14')]===_0x3716('0x15')||this[_0x3716('0x14')]===_0x3716('0x16')){_0x3d20f4[_0x3716('0x17')]=this[_0x3716('0xa')][_0x3716('0x17')];}var _0x3292b5=this[_0x3716('0x14')];if(_0x3292b5===_0x3716('0x18')){_0x3d20f4[_0x3716('0x19')]=this[_0x3716('0x1a')]['id'];}else{_0x3d20f4[_['upperFirst'](_0x3292b5)+'AccountId']=this['account']['id'];}_0x3d20f4[_['upperFirst'](_0x3292b5)+_0x3716('0x1b')]=this['interaction']['id'];if(this[_0x3716('0xa')][_0x3716('0x1c')]){var _0x44680c=_0x4422c3[0x2];if(!_['isEmpty'](_0x44680c)){_0x3d20f4['body']=utils['getMustacheRender'](_0x44680c,this);return rpc[_0x3292b5+'Message'][_0x3716('0x1d')](_0x3d20f4)[_0x3716('0x1e')](function(_0x5d16c4){logger[_0x3716('0xc')](_0x3716('0xd'),_0x4549b2,_0x3d20f4[_0x3716('0x1f')]);})[_0x3716('0x20')](function(_0x22d1b7){logger[_0x3716('0x21')](_0x3716('0xd'),_0x4549b2,JSON['stringify'](_0x22d1b7));})['finally'](function(){logger['info'](_0x3716('0x22'),_0x4549b2);_0x14bfe0['stop']();});}else{logger[_0x3716('0xc')](_0x3716('0x23'),_0x4549b2);_0x14bfe0[_0x3716('0x24')]();}}else{var _0x233517=this;var _0x2b5296=apiai(_0x4422c3[0x0],{'language':_0x4422c3[0x1]||'en'});return _0x2b5296[_0x3716('0x25')](this[_0x3716('0x26')][_0x3716('0x1f')],{'sessionId':md5(this[_0x3716('0xa')]['id'])})['then'](function(_0xec15ce){_0x233517[_0x3716('0x1f')][_0x3716('0x27')]=_0xec15ce;_0x3d20f4['body']=_0xec15ce[_0x3716('0x28')][_0x3716('0x29')]['speech'];_0x3d20f4[_0x3716('0x2a')]='dialogflow';_0x3d20f4[_0x3716('0x2b')]=JSON[_0x3716('0x2c')](_0xec15ce);return rpc[_0x3292b5+_0x3716('0x2d')]['create'](_0x3d20f4)[_0x3716('0x1e')](function(_0x5a4476){logger[_0x3716('0xc')](_0x3716('0xd'),_0x4549b2,_0x3d20f4['body']);if(_0xec15ce[_0x3716('0x28')][_0x3716('0x2e')][_0x3716('0x2f')]){_0x14bfe0[_0x3716('0xf')]();}else{_0x14bfe0[_0x3716('0x24')]();}})['catch'](function(_0x2fdfa1){logger[_0x3716('0x21')](_0x3716('0xd'),_0x4549b2,JSON[_0x3716('0x2c')](_0x2fdfa1));_0x14bfe0['next']();});})[_0x3716('0x20')](function(_0x27553a){logger[_0x3716('0x21')](_0x3716('0xd'),_0x4549b2,_0x27553a[_0x3716('0x26')]);_0x14bfe0['next']();});}}catch(_0x32de5){logger[_0x3716('0x21')](_0x3716('0xd'),_0x4549b2,JSON['stringify'](_0x32de5));_0x14bfe0['stop']();}};}; \ No newline at end of file +var _0x1883=['getMustacheRender','Message','create','then','info','body','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','stringify','metadata','endConversation','catch','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','[%s][DIALOGFLOW]\x20%s','next','contact','format','out','channel','whatsapp','phone','ChatWebsiteId','AccountId','InteractionId','created','isEmpty'];(function(_0x5eceec,_0x1cecc7){var _0x5af48a=function(_0x750fb7){while(--_0x750fb7){_0x5eceec['push'](_0x5eceec['shift']());}};_0x5af48a(++_0x1cecc7);}(_0x1883,0xab));var _0x3188=function(_0x42ece4,_0xbd8169){_0x42ece4=_0x42ece4-0x0;var _0x5e2a7e=_0x1883[_0x42ece4];return _0x5e2a7e;};'use strict';var _=require(_0x3188('0x0'));var moment=require(_0x3188('0x1'));var apiai=require(_0x3188('0x2'));var md5=require(_0x3188('0x3'));var utils=require(_0x3188('0x4'));var logger=require(_0x3188('0x5'))(_0x3188('0x6'));var rpc={'chatMessage':require(_0x3188('0x7')),'openchannelMessage':require(_0x3188('0x8')),'mailMessage':require(_0x3188('0x9')),'smsMessage':require(_0x3188('0xa')),'faxMessage':require(_0x3188('0xb')),'whatsappMessage':require(_0x3188('0xc'))};exports[_0x3188('0xd')]=function(_0x24f2f1,_0x3ce7fd){return function(_0x3e3afb){try{if(!_['isNil'](this[_0x3188('0xe')][_0x3188('0xf')])){logger['info'](_0x3188('0x10'),_0x24f2f1,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3e3afb[_0x3188('0x11')]();}var _0x34fc82={'ContactId':this[_0x3188('0x12')]['id'],'sentAt':moment()[_0x3188('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3188('0x14')};if(this[_0x3188('0x15')]==='sms'||this['channel']===_0x3188('0x16')){_0x34fc82[_0x3188('0x17')]=this[_0x3188('0xe')][_0x3188('0x17')];}var _0x4bb424=this[_0x3188('0x15')];if(_0x4bb424==='chat'){_0x34fc82[_0x3188('0x18')]=this['account']['id'];}else{_0x34fc82[_['upperFirst'](_0x4bb424)+_0x3188('0x19')]=this['account']['id'];}_0x34fc82[_['upperFirst'](_0x4bb424)+_0x3188('0x1a')]=this[_0x3188('0xe')]['id'];if(this[_0x3188('0xe')][_0x3188('0x1b')]){var _0x145293=_0x3ce7fd[0x2];if(!_[_0x3188('0x1c')](_0x145293)){_0x34fc82['body']=utils[_0x3188('0x1d')](_0x145293,this);return rpc[_0x4bb424+_0x3188('0x1e')][_0x3188('0x1f')](_0x34fc82)[_0x3188('0x20')](function(_0x18a71a){logger[_0x3188('0x21')](_0x3188('0x10'),_0x24f2f1,_0x34fc82[_0x3188('0x22')]);})['catch'](function(_0x354338){logger[_0x3188('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x24f2f1,JSON['stringify'](_0x354338));})['finally'](function(){logger[_0x3188('0x21')](_0x3188('0x24'),_0x24f2f1);_0x3e3afb[_0x3188('0x25')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x24f2f1);_0x3e3afb[_0x3188('0x25')]();}}else{var _0x461286=this;var _0x375077=apiai(_0x3ce7fd[0x0],{'language':_0x3ce7fd[0x1]||'en'});return _0x375077[_0x3188('0x26')](this[_0x3188('0x27')]['body'],{'sessionId':md5(this[_0x3188('0xe')]['id'])})[_0x3188('0x20')](function(_0x5a2e67){_0x461286[_0x3188('0x22')]['dialogflow']=_0x5a2e67;_0x34fc82['body']=_0x5a2e67[_0x3188('0x28')][_0x3188('0x29')][_0x3188('0x2a')];_0x34fc82[_0x3188('0x2b')]=_0x3188('0x2c');_0x34fc82[_0x3188('0x2d')]=JSON[_0x3188('0x2e')](_0x5a2e67);return rpc[_0x4bb424+_0x3188('0x1e')]['create'](_0x34fc82)[_0x3188('0x20')](function(_0x2d000a){logger['info'](_0x3188('0x10'),_0x24f2f1,_0x34fc82[_0x3188('0x22')]);if(_0x5a2e67[_0x3188('0x28')][_0x3188('0x2f')][_0x3188('0x30')]){_0x3e3afb[_0x3188('0x11')]();}else{_0x3e3afb[_0x3188('0x25')]();}})[_0x3188('0x31')](function(_0x57c21c){logger[_0x3188('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x24f2f1,JSON[_0x3188('0x2e')](_0x57c21c));_0x3e3afb['next']();});})[_0x3188('0x31')](function(_0x80f9a8){logger[_0x3188('0x23')](_0x3188('0x10'),_0x24f2f1,_0x80f9a8[_0x3188('0x27')]);_0x3e3afb[_0x3188('0x11')]();});}}catch(_0x2461e2){logger[_0x3188('0x23')](_0x3188('0x10'),_0x24f2f1,JSON[_0x3188('0x2e')](_0x2461e2));_0x3e3afb[_0x3188('0x25')]();}};}; \ 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 87a2ba0..4b66e90 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 _0x559c=['DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','push','fulfillmentText','all','stack','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','clone','body','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','error','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','interaction','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','catch','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','end_conversation','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','fields','boolValue'];(function(_0xd21040,_0x5e4e1f){var _0x144d26=function(_0x17b7ad){while(--_0x17b7ad){_0xd21040['push'](_0xd21040['shift']());}};_0x144d26(++_0x5e4e1f);}(_0x559c,0xe6));var _0xc559=function(_0x531607,_0x73fa88){_0x531607=_0x531607-0x0;var _0x1b1fbb=_0x559c[_0x531607];return _0x1b1fbb;};'use strict';var _=require(_0xc559('0x0'));var dialogflow=require(_0xc559('0x1'));var md5=require(_0xc559('0x2'));var moment=require(_0xc559('0x3'));var Promise=require(_0xc559('0x4'));var logger=require(_0xc559('0x5'))('routing');var utils=require(_0xc559('0x6'));var rpc={'chatMessage':require(_0xc559('0x7')),'openchannelMessage':require(_0xc559('0x8')),'mailMessage':require(_0xc559('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc559('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x31b845,_0x5dedcd,_0x46735b,_0x13cdde){return new Promise(function(_0x545f63,_0x3aff3e){var _0x17628f=_[_0xc559('0xb')](_0x46735b);_0x17628f[_0xc559('0xc')]=_0x13cdde;return rpc[_0x5dedcd+_0xc559('0xd')]['create'](_0x17628f)[_0xc559('0xe')](function(){logger[_0xc559('0xf')](_0xc559('0x10'),_0x31b845,_0x17628f[_0xc559('0xc')]);_0x545f63();})['catch'](function(_0x44f12c){logger[_0xc559('0x11')](_0xc559('0x10'),_0x31b845,JSON['stringify'](_0x44f12c));_0x3aff3e(_0x44f12c);});});}exports[_0xc559('0x12')]=function(_0x12abf1,_0x23d191){return function(_0x5c38f2){try{if(!_[_0xc559('0x13')](this['interaction'][_0xc559('0x14')])){logger[_0xc559('0xf')](_0xc559('0x10'),_0x12abf1,_0xc559('0x15'));return _0x5c38f2[_0xc559('0x16')]();}var _0x31d731={'ContactId':this[_0xc559('0x17')]['id'],'sentAt':moment()[_0xc559('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xc559('0x19')};if(this[_0xc559('0x1a')]===_0xc559('0x1b')||this[_0xc559('0x1a')]==='whatsapp'){_0x31d731['phone']=this[_0xc559('0x1c')][_0xc559('0x1d')];}var _0x1c3d60=this[_0xc559('0x1a')];if(_0x1c3d60===_0xc559('0x1e')){_0x31d731[_0xc559('0x1f')]=this[_0xc559('0x20')]['id'];}else{_0x31d731[_[_0xc559('0x21')](_0x1c3d60)+_0xc559('0x22')]=this['account']['id'];}_0x31d731[_[_0xc559('0x21')](_0x1c3d60)+_0xc559('0x23')]=this[_0xc559('0x1c')]['id'];if(this[_0xc559('0x1c')]['created']){var _0x48d750=_0x23d191[0x4];if(!_['isEmpty'](_0x48d750)){_0x31d731[_0xc559('0xc')]=utils['getMustacheRender'](_0x48d750,this);return rpc[_0x1c3d60+_0xc559('0xd')]['create'](_0x31d731)['then'](function(_0x53b7d4){logger['info'](_0xc559('0x10'),_0x12abf1,_0x31d731[_0xc559('0xc')]);})[_0xc559('0x24')](function(_0x5ecfd3){logger[_0xc559('0x11')](_0xc559('0x10'),_0x12abf1,JSON[_0xc559('0x25')](_0x5ecfd3));})[_0xc559('0x26')](function(){logger[_0xc559('0xf')](_0xc559('0x27'),_0x12abf1);_0x5c38f2[_0xc559('0x28')]();});}else{logger[_0xc559('0xf')](_0xc559('0x29'),_0x12abf1);_0x5c38f2[_0xc559('0x28')]();}}else{var _0xab4e11=this;var _0x2ad823=_0x23d191[0x2][_0xc559('0x2a')](/\\n/g,'\x0a');var _0x2aca02={'credentials':{'private_key':_0x2ad823,'client_email':_0x23d191[0x1]}};var _0x5a245d=new dialogflow[(_0xc559('0x2b'))](_0x2aca02);var _0x1653ec=_0x5a245d[_0xc559('0x2c')](_0x23d191[0x0],md5(_0xab4e11[_0xc559('0x1c')]['id']));var _0x88077e={'session':_0x1653ec,'queryInput':{'text':{'text':_0xab4e11[_0xc559('0x2d')][_0xc559('0xc')],'languageCode':_0x23d191[0x3]||'en'}}};return _0x5a245d[_0xc559('0x2e')](_0x88077e)[_0xc559('0xe')](function(_0x30a4be){if(_0x30a4be&&_0x30a4be[_0xc559('0x2f')]){_0xab4e11[_0xc559('0xc')][_0xc559('0x30')]=_0x30a4be;var _0x4471e2=_0x30a4be[0x0];var _0x16d18c=_0x4471e2[_0xc559('0x31')][_0xc559('0x32')]&&_0x4471e2[_0xc559('0x31')][_0xc559('0x32')]['fields']?_0x4471e2['queryResult']['diagnosticInfo']['fields'][_0xc559('0x33')]['boolValue']:![];_0xab4e11[_0xc559('0xc')][_0xc559('0x34')]=_0x4471e2['queryResult']['action'];_0xab4e11[_0xc559('0xc')][_0xc559('0x35')]=_0x4471e2[_0xc559('0x31')][_0xc559('0x36')];_0xab4e11['body'][_0xc559('0x37')]=_0x4471e2[_0xc559('0x31')][_0xc559('0x32')]&&_0x4471e2[_0xc559('0x31')][_0xc559('0x32')][_0xc559('0x38')]?_0x4471e2[_0xc559('0x31')][_0xc559('0x32')]['fields'][_0xc559('0x33')][_0xc559('0x39')]:![];_0xab4e11['body'][_0xc559('0x3a')]=_0x4471e2['queryResult'][_0xc559('0x3b')][_0xc559('0x3c')];_0xab4e11['body'][_0xc559('0x3d')]=_0x4471e2[_0xc559('0x31')][_0xc559('0x3b')][_0xc559('0x3e')];_0xab4e11[_0xc559('0xc')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x4471e2['queryResult'][_0xc559('0x3b')][_0xc559('0x3f')];_0xab4e11['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x4471e2[_0xc559('0x31')]['languageCode'];_0xab4e11[_0xc559('0xc')][_0xc559('0x40')]=_0x4471e2[_0xc559('0x31')]['queryText'];_0xab4e11['body'][_0xc559('0x41')]=_0x4471e2[_0xc559('0x31')][_0xc559('0x42')];_0x31d731[_0xc559('0x43')]='dialogflowV2';_0x31d731['providerResponse']=JSON[_0xc559('0x25')](_0x30a4be);var _0x207227=[];for(var _0x44177f=0x0;_0x44177f<_0x30a4be[_0xc559('0x2f')];_0x44177f++){var _0x531d5a=_0x30a4be[_0x44177f];if(_0x531d5a&&_0x531d5a[_0xc559('0x31')]&&_0x531d5a[_0xc559('0x31')]['fulfillmentText']){_0x207227[_0xc559('0x44')](createMessage(_0x12abf1,_0x1c3d60,_0x31d731,_0x531d5a[_0xc559('0x31')][_0xc559('0x45')]));}}return Promise[_0xc559('0x46')](_0x207227)[_0xc559('0xe')](function(){if(_0x16d18c){_0x5c38f2[_0xc559('0x16')]();}else{_0x5c38f2['stop']();}})[_0xc559('0x24')](function(_0x59e325){logger['error'](_0xc559('0x10'),_0x12abf1,JSON[_0xc559('0x25')](_0x59e325));_0x5c38f2[_0xc559('0x16')]();});}})['catch'](function(_0x5a28ef){logger[_0xc559('0x11')](_0xc559('0x10'),_0x12abf1,_0x5a28ef['message'],_0x5a28ef[_0xc559('0x47')]);_0x5c38f2[_0xc559('0x16')]();});}}catch(_0x3fadce){logger[_0xc559('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x12abf1,JSON[_0xc559('0x25')](_0x3fadce));_0x5c38f2[_0xc559('0x28')]();}};}; \ No newline at end of file +var _0xd287=['../../rpc/whatsappMessage','clone','body','then','info','catch','error','stringify','consequence','interaction','UserId','[%s][DIALOGFLOWV2]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','finally','stop','SessionsClient','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','stack','lodash','md5','bluebird','../../../../config/logger','../../rpc/chatMessage','../../rpc/faxMessage'];(function(_0x4652bc,_0x4c1017){var _0x274bde=function(_0x449d2a){while(--_0x449d2a){_0x4652bc['push'](_0x4652bc['shift']());}};_0x274bde(++_0x4c1017);}(_0xd287,0x112));var _0x7d28=function(_0x4b85b7,_0x76399c){_0x4b85b7=_0x4b85b7-0x0;var _0x2fbe89=_0xd287[_0x4b85b7];return _0x2fbe89;};'use strict';var _=require(_0x7d28('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x7d28('0x1'));var moment=require('moment');var Promise=require(_0x7d28('0x2'));var logger=require(_0x7d28('0x3'))('routing');var utils=require('./utils');var rpc={'chatMessage':require(_0x7d28('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7d28('0x5')),'whatsappMessage':require(_0x7d28('0x6'))};function createMessage(_0x4f885a,_0x4be655,_0x28af4c,_0x5447d5){return new Promise(function(_0x30f4f6,_0x428040){var _0x4fccf1=_[_0x7d28('0x7')](_0x28af4c);_0x4fccf1[_0x7d28('0x8')]=_0x5447d5;return rpc[_0x4be655+'Message']['create'](_0x4fccf1)[_0x7d28('0x9')](function(){logger[_0x7d28('0xa')]('[%s][DIALOGFLOWV2]\x20%s',_0x4f885a,_0x4fccf1[_0x7d28('0x8')]);_0x30f4f6();})[_0x7d28('0xb')](function(_0x32df25){logger[_0x7d28('0xc')]('[%s][DIALOGFLOWV2]\x20%s',_0x4f885a,JSON[_0x7d28('0xd')](_0x32df25));_0x428040(_0x32df25);});});}exports[_0x7d28('0xe')]=function(_0x30e3f8,_0x545698){return function(_0xa1e403){try{if(!_['isNil'](this[_0x7d28('0xf')][_0x7d28('0x10')])){logger[_0x7d28('0xa')](_0x7d28('0x11'),_0x30e3f8,_0x7d28('0x12'));return _0xa1e403[_0x7d28('0x13')]();}var _0x538713={'ContactId':this[_0x7d28('0x14')]['id'],'sentAt':moment()[_0x7d28('0x15')](_0x7d28('0x16')),'direction':_0x7d28('0x17')};if(this[_0x7d28('0x18')]===_0x7d28('0x19')||this[_0x7d28('0x18')]===_0x7d28('0x1a')){_0x538713['phone']=this[_0x7d28('0xf')]['phone'];}var _0x267928=this[_0x7d28('0x18')];if(_0x267928===_0x7d28('0x1b')){_0x538713[_0x7d28('0x1c')]=this[_0x7d28('0x1d')]['id'];}else{_0x538713[_[_0x7d28('0x1e')](_0x267928)+_0x7d28('0x1f')]=this[_0x7d28('0x1d')]['id'];}_0x538713[_[_0x7d28('0x1e')](_0x267928)+_0x7d28('0x20')]=this['interaction']['id'];if(this[_0x7d28('0xf')][_0x7d28('0x21')]){var _0x5c0d79=_0x545698[0x4];if(!_[_0x7d28('0x22')](_0x5c0d79)){_0x538713[_0x7d28('0x8')]=utils[_0x7d28('0x23')](_0x5c0d79,this);return rpc[_0x267928+_0x7d28('0x24')][_0x7d28('0x25')](_0x538713)[_0x7d28('0x9')](function(_0x428705){logger['info'](_0x7d28('0x11'),_0x30e3f8,_0x538713[_0x7d28('0x8')]);})[_0x7d28('0xb')](function(_0x90b8c7){logger[_0x7d28('0xc')](_0x7d28('0x11'),_0x30e3f8,JSON['stringify'](_0x90b8c7));})[_0x7d28('0x26')](function(){logger[_0x7d28('0xa')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x30e3f8);_0xa1e403[_0x7d28('0x27')]();});}else{logger[_0x7d28('0xa')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x30e3f8);_0xa1e403[_0x7d28('0x27')]();}}else{var _0x1cde32=this;var _0x3a81c9=_0x545698[0x2]['replace'](/\\n/g,'\x0a');var _0x4dd3d5={'credentials':{'private_key':_0x3a81c9,'client_email':_0x545698[0x1]}};var _0x334b21=new dialogflow[(_0x7d28('0x28'))](_0x4dd3d5);var _0x208855=_0x334b21['sessionPath'](_0x545698[0x0],md5(_0x1cde32['interaction']['id']));var _0x12396d={'session':_0x208855,'queryInput':{'text':{'text':_0x1cde32[_0x7d28('0x29')][_0x7d28('0x8')],'languageCode':_0x545698[0x3]||'en'}}};return _0x334b21[_0x7d28('0x2a')](_0x12396d)[_0x7d28('0x9')](function(_0x274081){if(_0x274081&&_0x274081[_0x7d28('0x2b')]){_0x1cde32['body'][_0x7d28('0x2c')]=_0x274081;var _0xa8c72d=_0x274081[0x0];var _0x466a4b=_0xa8c72d[_0x7d28('0x2d')][_0x7d28('0x2e')]&&_0xa8c72d[_0x7d28('0x2d')]['diagnosticInfo'][_0x7d28('0x2f')]?_0xa8c72d['queryResult'][_0x7d28('0x2e')]['fields'][_0x7d28('0x30')][_0x7d28('0x31')]:![];_0x1cde32['body'][_0x7d28('0x32')]=_0xa8c72d[_0x7d28('0x2d')][_0x7d28('0x33')];_0x1cde32[_0x7d28('0x8')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0xa8c72d[_0x7d28('0x2d')]['allRequiredParamsPresent'];_0x1cde32[_0x7d28('0x8')][_0x7d28('0x34')]=_0xa8c72d['queryResult'][_0x7d28('0x2e')]&&_0xa8c72d[_0x7d28('0x2d')][_0x7d28('0x2e')][_0x7d28('0x2f')]?_0xa8c72d[_0x7d28('0x2d')]['diagnosticInfo'][_0x7d28('0x2f')][_0x7d28('0x30')][_0x7d28('0x31')]:![];_0x1cde32['body'][_0x7d28('0x35')]=_0xa8c72d[_0x7d28('0x2d')][_0x7d28('0x36')][_0x7d28('0x37')];_0x1cde32[_0x7d28('0x8')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0xa8c72d['queryResult']['intent'][_0x7d28('0x38')];_0x1cde32[_0x7d28('0x8')][_0x7d28('0x39')]=_0xa8c72d[_0x7d28('0x2d')][_0x7d28('0x36')][_0x7d28('0x3a')];_0x1cde32[_0x7d28('0x8')][_0x7d28('0x3b')]=_0xa8c72d['queryResult'][_0x7d28('0x3c')];_0x1cde32['body'][_0x7d28('0x3d')]=_0xa8c72d[_0x7d28('0x2d')][_0x7d28('0x3e')];_0x1cde32['body'][_0x7d28('0x3f')]=_0xa8c72d['queryResult'][_0x7d28('0x40')];_0x538713[_0x7d28('0x41')]=_0x7d28('0x2c');_0x538713[_0x7d28('0x42')]=JSON[_0x7d28('0xd')](_0x274081);var _0xf880fa=[];for(var _0xb333d6=0x0;_0xb333d6<_0x274081[_0x7d28('0x2b')];_0xb333d6++){var _0x5ad083=_0x274081[_0xb333d6];if(_0x5ad083&&_0x5ad083[_0x7d28('0x2d')]&&_0x5ad083[_0x7d28('0x2d')][_0x7d28('0x43')]){_0xf880fa['push'](createMessage(_0x30e3f8,_0x267928,_0x538713,_0x5ad083[_0x7d28('0x2d')][_0x7d28('0x43')]));}}return Promise[_0x7d28('0x44')](_0xf880fa)[_0x7d28('0x9')](function(){if(_0x466a4b){_0xa1e403[_0x7d28('0x13')]();}else{_0xa1e403['stop']();}})[_0x7d28('0xb')](function(_0x53e12d){logger[_0x7d28('0xc')](_0x7d28('0x11'),_0x30e3f8,JSON[_0x7d28('0xd')](_0x53e12d));_0xa1e403[_0x7d28('0x13')]();});}})[_0x7d28('0xb')](function(_0x314d32){logger[_0x7d28('0xc')](_0x7d28('0x11'),_0x30e3f8,_0x314d32[_0x7d28('0x29')],_0x314d32[_0x7d28('0x45')]);_0xa1e403[_0x7d28('0x13')]();});}}catch(_0x4d41fb){logger[_0x7d28('0xc')](_0x7d28('0x11'),_0x30e3f8,JSON['stringify'](_0x4d41fb));_0xa1e403['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 4516376..f3ffbbf 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 _0x6f71=['[%s][GOTOIF]\x20eval\x20error:\x20%s','message','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','consequence','fromString','replace','validate','length','error','join','stop','priorityTrue','info','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x314d81,_0xa80a08){var _0x463c1f=function(_0x910303){while(--_0x910303){_0x314d81['push'](_0x314d81['shift']());}};_0x463c1f(++_0xa80a08);}(_0x6f71,0x1d8));var _0x16f7=function(_0x3d7cf1,_0x5c5eb0){_0x3d7cf1=_0x3d7cf1-0x0;var _0xe1efeb=_0x6f71[_0x3d7cf1];return _0xe1efeb;};'use strict';var schema=require('validate');var _=require(_0x16f7('0x0'));var htmlToText=require(_0x16f7('0x1'));var utils=require(_0x16f7('0x2'));var logger=require(_0x16f7('0x3'))(_0x16f7('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x16f7('0x5')},'priorityTrue':{'type':'number','message':_0x16f7('0x6')},'priorityFalse':{'type':_0x16f7('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x16f7('0x8')]=function(_0x2273c6,_0x40b8a4){return function(_0x258b99){try{var _0x8296e1={'condition':htmlToText[_0x16f7('0x9')](utils['getMustacheRender'](_0x40b8a4[0x0],this),{'wordwrap':![]})[_0x16f7('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x40b8a4[0x1],'priorityFalse':_0x40b8a4[0x2]};var _0x129cd7=gotoif[_0x16f7('0xb')](_0x8296e1,{'typecast':!![]});if(_0x129cd7[_0x16f7('0xc')]){logger[_0x16f7('0xd')]('[%s][GOTOIF]\x20%s',_0x2273c6,_['map'](_0x129cd7,'message')[_0x16f7('0xe')](',\x20'));_0x258b99[_0x16f7('0xf')]();}else{try{var _0x12d832=eval('('+_0x8296e1['condition']+')');var _0x593d7a=_0x12d832?_0x8296e1[_0x16f7('0x10')]:_0x8296e1['priorityFalse'];logger[_0x16f7('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2273c6,_0x8296e1[_0x16f7('0x12')],_0x12d832,_0x593d7a||_0x16f7('0x13'));if(_0x593d7a){var _0xebbd72=_[_0x16f7('0x14')](_0x258b99['rules'](),{'p':_0x593d7a});if(_0xebbd72>=0x0){logger['info'](_0x16f7('0x15'),_0x2273c6,_0x593d7a||_0x16f7('0x13'),_0xebbd72);_0x258b99[_0x16f7('0x13')](_0xebbd72);}else{logger[_0x16f7('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x2273c6,_0x593d7a||_0x16f7('0x13'));_0x258b99[_0x16f7('0xf')]();}}else{_0x258b99[_0x16f7('0x13')]();}}catch(_0x40fb0c){logger['error'](_0x16f7('0x16'),_0x2273c6,_0x40fb0c[_0x16f7('0x17')]);_0x258b99[_0x16f7('0xf')]();}}}catch(_0x26000e){logger[_0x16f7('0xd')](_0x16f7('0x18'),_0x2273c6,JSON[_0x16f7('0x19')](_0x26000e));_0x258b99[_0x16f7('0xf')]();}};}; \ No newline at end of file +var _0x103a=['[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','html-to-text','./utils','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error'];(function(_0xe1e30e,_0x1aa63c){var _0x1fdacd=function(_0x433dff){while(--_0x433dff){_0xe1e30e['push'](_0xe1e30e['shift']());}};_0x1fdacd(++_0x1aa63c);}(_0x103a,0x8d));var _0xa103=function(_0x5ad390,_0x58fa6c){_0x5ad390=_0x5ad390-0x0;var _0x5977d8=_0x103a[_0x5ad390];return _0x5977d8;};'use strict';var schema=require(_0xa103('0x0'));var _=require('lodash');var htmlToText=require(_0xa103('0x1'));var utils=require(_0xa103('0x2'));var logger=require('../../../../config/logger')(_0xa103('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xa103('0x4')},'priorityTrue':{'type':_0xa103('0x5'),'message':_0xa103('0x6')},'priorityFalse':{'type':_0xa103('0x5'),'message':_0xa103('0x7')}});exports[_0xa103('0x8')]=function(_0x39991f,_0x501d89){return function(_0x45fc2a){try{var _0x52da87={'condition':htmlToText[_0xa103('0x9')](utils[_0xa103('0xa')](_0x501d89[0x0],this),{'wordwrap':![]})[_0xa103('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x501d89[0x1],'priorityFalse':_0x501d89[0x2]};var _0x55d153=gotoif[_0xa103('0x0')](_0x52da87,{'typecast':!![]});if(_0x55d153[_0xa103('0xc')]){logger['error'](_0xa103('0xd'),_0x39991f,_['map'](_0x55d153,_0xa103('0xe'))[_0xa103('0xf')](',\x20'));_0x45fc2a[_0xa103('0x10')]();}else{try{var _0x1320d7=eval('('+_0x52da87[_0xa103('0x11')]+')');var _0x59aaa1=_0x1320d7?_0x52da87[_0xa103('0x12')]:_0x52da87[_0xa103('0x13')];logger[_0xa103('0x14')](_0xa103('0x15'),_0x39991f,_0x52da87[_0xa103('0x11')],_0x1320d7,_0x59aaa1||'next');if(_0x59aaa1){var _0x34889a=_['findIndex'](_0x45fc2a[_0xa103('0x16')](),{'p':_0x59aaa1});if(_0x34889a>=0x0){logger['info'](_0xa103('0x17'),_0x39991f,_0x59aaa1||_0xa103('0x18'),_0x34889a);_0x45fc2a[_0xa103('0x18')](_0x34889a);}else{logger[_0xa103('0x14')](_0xa103('0x19'),_0x39991f,_0x59aaa1||_0xa103('0x18'));_0x45fc2a[_0xa103('0x10')]();}}else{_0x45fc2a[_0xa103('0x18')]();}}catch(_0xea6cb5){logger[_0xa103('0x1a')](_0xa103('0x1b'),_0x39991f,_0xea6cb5[_0xa103('0xe')]);_0x45fc2a['stop']();}}}catch(_0x589a67){logger[_0xa103('0x1a')](_0xa103('0xd'),_0x39991f,JSON['stringify'](_0x589a67));_0x45fc2a[_0xa103('0x10')]();}};}; \ 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 04e9dc9..a88abe5 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 _0x6a95=['consequence','length','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a95,0xe2));var _0x56a9=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x6a95[_0x18cd5b];return _0x5eaa52;};'use strict';var schema=require(_0x56a9('0x0'));var _=require(_0x56a9('0x1'));var logger=require(_0x56a9('0x2'))(_0x56a9('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x56a9('0x4')}});exports[_0x56a9('0x5')]=function(_0x1261ee,_0x2c9be9){return function(_0x3599af){try{var _0x511ad8={'priority':_0x2c9be9[0x0]};var _0x3d8f12=gotop[_0x56a9('0x0')](_0x511ad8,{'typecast':!![]});if(_0x3d8f12[_0x56a9('0x6')]){logger['error']('[%s][GOTOP]\x20%s',_0x1261ee,_[_0x56a9('0x7')](_0x3d8f12,_0x56a9('0x8'))[_0x56a9('0x9')](',\x20'));_0x3599af[_0x56a9('0xa')]();}else{logger[_0x56a9('0xb')](_0x56a9('0xc'),_0x1261ee,_0x511ad8[_0x56a9('0xd')]);if(_0x511ad8[_0x56a9('0xd')]){var _0x2782c6=_[_0x56a9('0xe')](_0x3599af[_0x56a9('0xf')](),{'p':_0x511ad8[_0x56a9('0xd')]});if(_0x2782c6>=0x0){logger[_0x56a9('0xb')](_0x56a9('0x10'),_0x1261ee,_0x511ad8[_0x56a9('0xd')]||'next',_0x2782c6);_0x3599af[_0x56a9('0x11')](_0x2782c6);}else{logger[_0x56a9('0xb')](_0x56a9('0x12'),_0x1261ee,_0x511ad8[_0x56a9('0xd')]||'next');_0x3599af[_0x56a9('0xa')]();}}else{_0x3599af[_0x56a9('0x11')]();}}}catch(_0x321e83){logger['error'](_0x56a9('0x13'),_0x1261ee,JSON[_0x56a9('0x14')](_0x321e83));_0x3599af[_0x56a9('0xa')]();}};}; \ No newline at end of file +var _0xa813=['validate','lodash','../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify'];(function(_0x2ec399,_0x451817){var _0x1129d7=function(_0x3bb445){while(--_0x3bb445){_0x2ec399['push'](_0x2ec399['shift']());}};_0x1129d7(++_0x451817);}(_0xa813,0x11e));var _0x3a81=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xa813[_0x173441];return _0x2423a8;};'use strict';var schema=require(_0x3a81('0x0'));var _=require(_0x3a81('0x1'));var logger=require(_0x3a81('0x2'))(_0x3a81('0x3'));var gotop=schema({'priority':{'type':_0x3a81('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x3a81('0x5')]=function(_0xc604bb,_0x11df88){return function(_0x78d6ca){try{var _0x545adf={'priority':_0x11df88[0x0]};var _0x3b1671=gotop[_0x3a81('0x0')](_0x545adf,{'typecast':!![]});if(_0x3b1671[_0x3a81('0x6')]){logger[_0x3a81('0x7')](_0x3a81('0x8'),_0xc604bb,_[_0x3a81('0x9')](_0x3b1671,_0x3a81('0xa'))[_0x3a81('0xb')](',\x20'));_0x78d6ca[_0x3a81('0xc')]();}else{logger[_0x3a81('0xd')](_0x3a81('0xe'),_0xc604bb,_0x545adf[_0x3a81('0xf')]);if(_0x545adf[_0x3a81('0xf')]){var _0x5778c8=_[_0x3a81('0x10')](_0x78d6ca[_0x3a81('0x11')](),{'p':_0x545adf[_0x3a81('0xf')]});if(_0x5778c8>=0x0){logger[_0x3a81('0xd')](_0x3a81('0x12'),_0xc604bb,_0x545adf[_0x3a81('0xf')]||_0x3a81('0x13'),_0x5778c8);_0x78d6ca[_0x3a81('0x13')](_0x5778c8);}else{logger[_0x3a81('0xd')](_0x3a81('0x14'),_0xc604bb,_0x545adf['priority']||_0x3a81('0x13'));_0x78d6ca[_0x3a81('0xc')]();}}else{_0x78d6ca[_0x3a81('0x13')]();}}}catch(_0x4be7cc){logger[_0x3a81('0x7')](_0x3a81('0x8'),_0xc604bb,JSON[_0x3a81('0x15')](_0x4be7cc));_0x78d6ca[_0x3a81('0xc')]();}};}; \ 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 75c10ce..5511e76 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 _0x9519=['contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x9519,0x147));var _0x9951=function(_0x1355b0,_0x411d75){_0x1355b0=_0x1355b0-0x0;var _0x33f246=_0x9519[_0x1355b0];return _0x33f246;};'use strict';var _=require(_0x9951('0x0'));var utils=require(_0x9951('0x1'));var logger=require(_0x9951('0x2'))('routing');var rpc={'chatMessage':require(_0x9951('0x3')),'openchannelMessage':require(_0x9951('0x4')),'mailMessage':require(_0x9951('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9951('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x9951('0x7')]=function(_0x2b77a7,_0x3addcc){return function(_0x333492){try{var _0x399a4c={'body':utils[_0x9951('0x8')](_0x3addcc[0x0],this),'ContactId':this[_0x9951('0x9')]['id']};if(this[_0x9951('0xa')]===_0x9951('0xb')){_0x399a4c[_0x9951('0xc')]=this[_0x9951('0xd')]['id'];}else{_0x399a4c[_['upperFirst'](this[_0x9951('0xa')])+'AccountId']=this['account']['id'];}_0x399a4c[_[_0x9951('0xe')](this[_0x9951('0xa')])+_0x9951('0xf')]=this[_0x9951('0x10')]['id'];if(rpc[this[_0x9951('0xa')]+_0x9951('0x11')]){return rpc[this[_0x9951('0xa')]+_0x9951('0x11')][_0x9951('0x12')](_0x399a4c)[_0x9951('0x13')](function(_0x4410f9){logger[_0x9951('0x14')](_0x9951('0x15'),_0x2b77a7,_0x399a4c[_0x9951('0x16')]);_0x333492[_0x9951('0x17')]();})[_0x9951('0x18')](function(_0x6d2505){logger[_0x9951('0x19')](_0x9951('0x15'),_0x2b77a7,JSON[_0x9951('0x1a')](_0x6d2505));_0x333492[_0x9951('0x1b')]();});}}catch(_0x44230d){logger[_0x9951('0x19')](_0x9951('0x15'),_0x2b77a7,JSON[_0x9951('0x1a')](_0x44230d));_0x333492[_0x9951('0x1b')]();}};}; \ No newline at end of file +var _0x7cc7=['info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','interaction','Message'];(function(_0x175254,_0x3e8074){var _0x32cc33=function(_0x348d60){while(--_0x348d60){_0x175254['push'](_0x175254['shift']());}};_0x32cc33(++_0x3e8074);}(_0x7cc7,0x161));var _0x77cc=function(_0x12da14,_0x52e2db){_0x12da14=_0x12da14-0x0;var _0x360aa0=_0x7cc7[_0x12da14];return _0x360aa0;};'use strict';var _=require(_0x77cc('0x0'));var utils=require(_0x77cc('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x77cc('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x77cc('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x77cc('0x4')),'whatsappMessage':require(_0x77cc('0x5'))};exports[_0x77cc('0x6')]=function(_0xaef0e6,_0x3b6ec5){return function(_0x2091cd){try{var _0x344dfb={'body':utils[_0x77cc('0x7')](_0x3b6ec5[0x0],this),'ContactId':this['contact']['id']};if(this[_0x77cc('0x8')]===_0x77cc('0x9')){_0x344dfb[_0x77cc('0xa')]=this[_0x77cc('0xb')]['id'];}else{_0x344dfb[_[_0x77cc('0xc')](this[_0x77cc('0x8')])+'AccountId']=this['account']['id'];}_0x344dfb[_['upperFirst'](this[_0x77cc('0x8')])+'InteractionId']=this[_0x77cc('0xd')]['id'];if(rpc[this[_0x77cc('0x8')]+_0x77cc('0xe')]){return rpc[this['channel']+_0x77cc('0xe')]['create'](_0x344dfb)['then'](function(_0x17ca48){logger[_0x77cc('0xf')](_0x77cc('0x10'),_0xaef0e6,_0x344dfb[_0x77cc('0x11')]);_0x2091cd[_0x77cc('0x12')]();})[_0x77cc('0x13')](function(_0x574dd2){logger[_0x77cc('0x14')](_0x77cc('0x10'),_0xaef0e6,JSON[_0x77cc('0x15')](_0x574dd2));_0x2091cd[_0x77cc('0x16')]();});}}catch(_0x228f25){logger[_0x77cc('0x14')](_0x77cc('0x10'),_0xaef0e6,JSON['stringify'](_0x228f25));_0x2091cd[_0x77cc('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index c769f15..d25aada 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 _0xe234=['info','getMustacheRender','next','error','stringify','./utils','../../../../config/logger','routing','consequence'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe234,0x191));var _0x4e23=function(_0x4533b0,_0x3eff90){_0x4533b0=_0x4533b0-0x0;var _0x1980e0=_0xe234[_0x4533b0];return _0x1980e0;};'use strict';var utils=require(_0x4e23('0x0'));var logger=require(_0x4e23('0x1'))(_0x4e23('0x2'));exports[_0x4e23('0x3')]=function(_0x5e220b,_0x5ef5b8){return function(_0x3c79ee){try{logger[_0x4e23('0x4')]('[%s][NOOP]\x20%s',_0x5e220b,utils[_0x4e23('0x5')](_0x5ef5b8[0x0],this));_0x3c79ee[_0x4e23('0x6')]();}catch(_0x264631){logger[_0x4e23('0x7')]('[%s][NOOP]\x20%s',_0x5e220b,JSON[_0x4e23('0x8')](_0x264631));_0x3c79ee['stop']();}};}; \ No newline at end of file +var _0x4441=['routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','../../../../config/logger'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x4441,0x18f));var _0x1444=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4441[_0x432682];return _0x463d05;};'use strict';var utils=require('./utils');var logger=require(_0x1444('0x0'))(_0x1444('0x1'));exports[_0x1444('0x2')]=function(_0x2e07a1,_0x210b93){return function(_0x577083){try{logger[_0x1444('0x3')](_0x1444('0x4'),_0x2e07a1,utils[_0x1444('0x5')](_0x210b93[0x0],this));_0x577083[_0x1444('0x6')]();}catch(_0x2c3279){logger[_0x1444('0x7')]('[%s][NOOP]\x20%s',_0x2e07a1,JSON[_0x1444('0x8')](_0x2c3279));_0x577083[_0x1444('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 5e105c9..830dd77 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 _0x4193=['%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','then','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','find','Queues','qtimeout','rules','end','stop','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','seq-queue','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','push','format'];(function(_0x5b6da2,_0x11b955){var _0x5550a1=function(_0x1a245c){while(--_0x1a245c){_0x5b6da2['push'](_0x5b6da2['shift']());}};_0x5550a1(++_0x11b955);}(_0x4193,0x1eb));var _0x3419=function(_0x3b48f0,_0x4f3c87){_0x3b48f0=_0x3b48f0-0x0;var _0x5dc733=_0x4193[_0x3b48f0];return _0x5dc733;};'use strict';var schema=require(_0x3419('0x0'));var _=require(_0x3419('0x1'));var util=require('util');var seqqueue=require(_0x3419('0x2'));var moment=require('moment');var Redis=require(_0x3419('0x3'));var config=require('../../../../config/environment');var logger=require(_0x3419('0x4'))(_0x3419('0x5'));var strategy=require(_0x3419('0x6'));config[_0x3419('0x7')]=_[_0x3419('0x8')](config[_0x3419('0x7')],{'host':_0x3419('0x9'),'port':0x18eb});var io=require(_0x3419('0xa'))(new Redis(config[_0x3419('0x7')]));var attributes=['id',_0x3419('0xb'),_0x3419('0xc'),_0x3419('0xd'),_0x3419('0xe'),_0x3419('0xf')];function emit(_0x5a021d,_0x56ab62,_0x2c664b){io['to'](_0x5a021d)[_0x3419('0x10')](_0x56ab62,_0x2c664b);}function emitChannelQueueInteraction(_0x15bd48,_0x23bead,_0x6bc39,_0x3f7fc2,_0x334dad,_0x4cbfc8,_0x373acc,_0x54159e){var _0x4b71b7=_['clone'](_0x6bc39);_0x4b71b7[_0x3419('0xb')]=_0x54159e;_0x4b71b7[_0x3419('0xd')]=_0x23bead;_0x4b71b7[_0x3419('0xc')]=_0x3f7fc2;_0x4b71b7['id']=_0x334dad;if(_0x4cbfc8){attributes[_0x3419('0x11')](_['capitalize'](_0x15bd48)+'InteractionId');_0x373acc[util[_0x3419('0x12')](_0x3419('0x13'),_0x15bd48)][_0x334dad]=_[_0x3419('0x14')](_0x4b71b7,attributes);}else{delete _0x373acc[util[_0x3419('0x12')]('%sQueuesWaitingInteractions',_0x15bd48)][_0x334dad];}emit(util[_0x3419('0x12')](_0x3419('0x15'),_0x15bd48,_0x23bead),util[_0x3419('0x12')](_0x3419('0x16'),_0x15bd48,_0x4cbfc8?_0x3419('0x17'):_0x3419('0x18')),_['pick'](_0x4b71b7,attributes));}var rpc={'openchannelQueueReport':require(_0x3419('0x19')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x3419('0x1a')),'smsQueueReport':require(_0x3419('0x1b')),'faxQueueReport':require(_0x3419('0x1c')),'whatsappQueueReport':require(_0x3419('0x1d')),'chatInteraction':require(_0x3419('0x1e')),'faxInteraction':require(_0x3419('0x1f')),'mailInteraction':require(_0x3419('0x20')),'openchannelInteraction':require(_0x3419('0x21')),'smsInteraction':require(_0x3419('0x22')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0x3419('0x23'),'required':!![],'message':_0x3419('0x24')},'timeout':{'type':_0x3419('0x25'),'message':_0x3419('0x26')}});function startRouting(_0x540ae6,_0x2e5c03,_0x428036,_0x1ec91c){if(_0x540ae6&&_0x2e5c03&&_0x428036){_0x2e5c03[_0x3419('0x27')]+=0x1;var _0x3b046a={'uniqueid':_0x540ae6,'from':_0x428036[_0x3419('0x28')]?_0x428036['body']['from']:'','joinAt':moment()[_0x3419('0x12')](_0x3419('0x29')),'ContactId':_0x428036[_0x3419('0x2a')]?_0x428036['contact']['id']:null,'ListId':_0x428036[_0x3419('0x2b')]?_0x428036[_0x3419('0x2b')]['id']:null};_0x3b046a[_[_0x3419('0x2c')](_0x428036[_0x3419('0x2d')])+_0x3419('0x2e')]=_0x2e5c03['id']||null;_0x3b046a[_[_0x3419('0x2c')](_0x428036[_0x3419('0x2d')])+_0x3419('0x2f')]=_0x428036[_0x3419('0x30')]?_0x428036[_0x3419('0x30')]['id']:null;_0x3b046a[_[_0x3419('0x2c')](_0x428036['channel'])+_0x3419('0x31')]=_0x428036[_0x3419('0x32')]?_0x428036[_0x3419('0x32')]['id']:null;_0x3b046a[_[_0x3419('0x2c')](_0x428036[_0x3419('0x2d')])+(_0x428036['channel']!==_0x3419('0x33')?_0x3419('0x34'):'WebsiteId')]=_0x428036['account']?_0x428036[_0x3419('0xc')]['id']:null;logger[_0x3419('0x35')](util[_0x3419('0x12')](_0x3419('0x36'),_0x540ae6,_0x2e5c03['name']));emitChannelQueueInteraction(_0x428036['channel'],_0x2e5c03[_0x3419('0x37')],_0x3b046a,_0x428036[_0x3419('0xc')]['name'],_0x428036[_0x3419('0x32')]['id'],!![],_0x1ec91c,_0x2e5c03['id']);if(rpc[_0x428036[_0x3419('0x2d')]+_0x3419('0x38')]){return rpc[_0x428036[_0x3419('0x2d')]+'QueueReport'][_0x3419('0x39')](_0x3b046a)[_0x3419('0x3a')](function(_0x12e4c3){logger['error']('create\x20queue\x20report',_0x12e4c3);});}}}function stopRouting(_0x4b11d8,_0x5ea4a2,_0x2a9ddf,_0x143b46){if(_0x4b11d8&&_0x5ea4a2){_0x5ea4a2[_0x3419('0x27')]-=0x1;var _0x3c6676={'leaveAt':moment()[_0x3419('0x12')](_0x3419('0x29')),'acceptAt':moment()['format'](_0x3419('0x29')),'reason':_0x3419('0x3b')};logger['info'](util[_0x3419('0x12')](_0x3419('0x3c'),_0x4b11d8,_0x5ea4a2[_0x3419('0x37')]));emitChannelQueueInteraction(_0x2a9ddf[_0x3419('0x2d')],_0x5ea4a2['name'],_0x2a9ddf[_0x3419('0x28')],_0x2a9ddf['account'][_0x3419('0x37')],_0x2a9ddf[_0x3419('0x32')]['id'],![],_0x143b46,_0x5ea4a2['id']);return rpc[_0x2a9ddf[_0x3419('0x2d')]+_0x3419('0x3d')]['update'](_0x2a9ddf[_0x3419('0x30')]['id'],{'queueId':_0x5ea4a2['id']})[_0x3419('0x3e')](function(){if(rpc[_0x2a9ddf['channel']+_0x3419('0x38')]){return rpc[_0x2a9ddf[_0x3419('0x2d')]+_0x3419('0x38')]['update'](_0x4b11d8,_0x3c6676)[_0x3419('0x3a')](function(_0x20f227){logger[_0x3419('0x3f')](_0x3419('0x40'),_0x20f227);});}});}}function endRouting(_0x5b4303,_0x65e7b6,_0x5cce8e,_0x2e77fc){if(_0x5b4303&&_0x65e7b6){_0x65e7b6['waiting']-=0x1;var _0x4cca04={'leaveAt':moment()[_0x3419('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x3419('0x12')](_0x3419('0x29')),'reason':_0x3419('0x41')};logger[_0x3419('0x35')](util['format'](_0x3419('0x42'),_0x5b4303,_0x65e7b6[_0x3419('0x37')]));emitChannelQueueInteraction(_0x5cce8e[_0x3419('0x2d')],_0x65e7b6[_0x3419('0x37')],_0x5cce8e[_0x3419('0x28')],_0x5cce8e[_0x3419('0xc')][_0x3419('0x37')],_0x5cce8e['message']['id'],![],_0x2e77fc);if(rpc[_0x5cce8e[_0x3419('0x2d')]+_0x3419('0x38')]){return rpc[_0x5cce8e['channel']+_0x3419('0x38')][_0x3419('0x43')](_0x5b4303,_0x4cca04)['catch'](function(_0x3b01e5){logger['error']('update\x20queue\x20report',_0x3b01e5);});}}}function handleFindQueue(_0x540929){return function(_0x38c5ac){return _0x38c5ac[_0x3419('0x37')][_0x3419('0x44')]()===_0x540929[_0x3419('0x44')]();};}exports['consequence']=function(_0x29d0f4,_0x3ceff6,_0x58941f,_0x1c8035){return function(_0x21d2d8){try{var _0x147615={'name':_0x3ceff6[0x0],'timeout':_0x3ceff6[0x1]};var _0x3c04a0=queue[_0x3419('0x0')](_0x147615,{'typecast':!![]});if(_0x3c04a0[_0x3419('0x45')]){logger[_0x3419('0x3f')](_0x3419('0x46'),_0x29d0f4,_[_0x3419('0x47')](_0x3c04a0,_0x3419('0x32'))[_0x3419('0x48')](',\x20'));_0x21d2d8['stop']();}else{var _0x2251f9=_[_0x3419('0x49')](_0x58941f[_0x1c8035[_0x3419('0x2d')]+_0x3419('0x4a')],handleFindQueue(_0x147615['name']));if(_0x2251f9){startRouting(_0x29d0f4,_0x2251f9,_0x1c8035,_0x58941f);var _0x4e9c0e=(_0x2251f9[_0x3419('0x41')]||0xa)*0x3e8;var _0x3c9eeb=(_0x147615['timeout']||0x14)*0x3e8;var _0x3db3c9;if(_0x4e9c0e>_0x3c9eeb){_0x3c9eeb=_0x4e9c0e;}var _0x298044=seqqueue['createQueue'](_0x4e9c0e);_0x298044['id']=_0x29d0f4;_0x298044['atimeout']=_0x4e9c0e;_0x298044[_0x3419('0x4b')]=_0x3c9eeb;_0x298044[_0x3419('0x2d')]=_0x1c8035[_0x3419('0x2d')];_0x58941f[_0x3419('0x4c')][_0x29d0f4]['on'](_0x3419('0x4d'),function(){logger[_0x3419('0x35')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x29d0f4);stopRouting(_0x29d0f4,_0x2251f9,_0x1c8035,_0x58941f);clearTimeout(_0x3db3c9);_0x3db3c9=undefined;_0x298044['close'](!![]);if(_0x58941f[_0x3419('0x4c')][_0x29d0f4]){delete _0x58941f['rules'][_0x29d0f4];}_0x21d2d8[_0x3419('0x4e')]();});_0x58941f[_0x3419('0x4c')][_0x29d0f4]['on']('complete',function(){if(_0x58941f[_0x3419('0x4c')][_0x29d0f4]){delete _0x58941f[_0x3419('0x4c')][_0x29d0f4];}});_0x3db3c9=setTimeout(function(){logger[_0x3419('0x35')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x29d0f4);endRouting(_0x29d0f4,_0x2251f9,_0x1c8035,_0x58941f);clearTimeout(_0x3db3c9);_0x298044['close'](!![]);_0x21d2d8[_0x3419('0x4f')]();},_0x3c9eeb);switch(_0x2251f9[_0x3419('0x50')]){case _0x3419('0x51'):strategy[_0x3419('0x51')](_0x298044,_0x2251f9,_0x58941f,_0x1c8035);break;default:strategy[_0x3419('0x52')](_0x298044,_0x2251f9,_0x58941f,_0x1c8035);}}else{logger['error'](_0x3419('0x53'),_0x29d0f4,_0x147615[_0x3419('0x37')]);_0x21d2d8[_0x3419('0x4e')]();}}}catch(_0x4a8a89){logger[_0x3419('0x3f')](_0x3419('0x46'),_0x29d0f4,_0x4a8a89[_0x3419('0x54')]);_0x21d2d8['stop']();}};}; \ No newline at end of file +var _0xde72=['next','strategy','rrmemory','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close'];(function(_0x27f4c5,_0x561a57){var _0x452c26=function(_0x15a017){while(--_0x15a017){_0x27f4c5['push'](_0x27f4c5['shift']());}};_0x452c26(++_0x561a57);}(_0xde72,0x1ac));var _0x2de7=function(_0x3c6e2a,_0x201d6e){_0x3c6e2a=_0x3c6e2a-0x0;var _0x120a65=_0xde72[_0x3c6e2a];return _0x120a65;};'use strict';var schema=require(_0x2de7('0x0'));var _=require(_0x2de7('0x1'));var util=require(_0x2de7('0x2'));var seqqueue=require(_0x2de7('0x3'));var moment=require(_0x2de7('0x4'));var Redis=require(_0x2de7('0x5'));var config=require(_0x2de7('0x6'));var logger=require(_0x2de7('0x7'))('routing');var strategy=require(_0x2de7('0x8'));config[_0x2de7('0x9')]=_[_0x2de7('0xa')](config[_0x2de7('0x9')],{'host':_0x2de7('0xb'),'port':0x18eb});var io=require(_0x2de7('0xc'))(new Redis(config[_0x2de7('0x9')]));var attributes=['id',_0x2de7('0xd'),_0x2de7('0xe'),_0x2de7('0xf'),_0x2de7('0x10'),_0x2de7('0x11')];function emit(_0x4b773c,_0x1fc151,_0x58daf3){io['to'](_0x4b773c)[_0x2de7('0x12')](_0x1fc151,_0x58daf3);}function emitChannelQueueInteraction(_0x5c617b,_0x57011a,_0x1b234d,_0x10b4ca,_0x392496,_0x28bf49,_0x1930b8,_0x9c550f){var _0x40e36a=_['clone'](_0x1b234d);_0x40e36a[_0x2de7('0xd')]=_0x9c550f;_0x40e36a[_0x2de7('0xf')]=_0x57011a;_0x40e36a[_0x2de7('0xe')]=_0x10b4ca;_0x40e36a['id']=_0x392496;if(_0x28bf49){attributes[_0x2de7('0x13')](_[_0x2de7('0x14')](_0x5c617b)+_0x2de7('0x15'));_0x1930b8[util['format'](_0x2de7('0x16'),_0x5c617b)][_0x392496]=_[_0x2de7('0x17')](_0x40e36a,attributes);}else{delete _0x1930b8[util[_0x2de7('0x18')](_0x2de7('0x16'),_0x5c617b)][_0x392496];}emit(util['format'](_0x2de7('0x19'),_0x5c617b,_0x57011a),util['format'](_0x2de7('0x1a'),_0x5c617b,_0x28bf49?_0x2de7('0x1b'):_0x2de7('0x1c')),_[_0x2de7('0x17')](_0x40e36a,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2de7('0x1d')),'chatQueueReport':require(_0x2de7('0x1e')),'smsQueueReport':require(_0x2de7('0x1f')),'faxQueueReport':require(_0x2de7('0x20')),'whatsappQueueReport':require(_0x2de7('0x21')),'chatInteraction':require(_0x2de7('0x22')),'faxInteraction':require(_0x2de7('0x23')),'mailInteraction':require(_0x2de7('0x24')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x2de7('0x25')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0x2de7('0x26'),'required':!![],'message':_0x2de7('0x27')},'timeout':{'type':_0x2de7('0x28'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x4a0e1c,_0x955fe2,_0x2a6d8b,_0x28f48e){if(_0x4a0e1c&&_0x955fe2&&_0x2a6d8b){_0x955fe2['waiting']+=0x1;var _0x5ec840={'uniqueid':_0x4a0e1c,'from':_0x2a6d8b[_0x2de7('0x29')]?_0x2a6d8b['body']['from']:'','joinAt':moment()[_0x2de7('0x18')](_0x2de7('0x2a')),'ContactId':_0x2a6d8b['contact']?_0x2a6d8b[_0x2de7('0x2b')]['id']:null,'ListId':_0x2a6d8b[_0x2de7('0x2c')]?_0x2a6d8b[_0x2de7('0x2c')]['id']:null};_0x5ec840[_[_0x2de7('0x2d')](_0x2a6d8b[_0x2de7('0x2e')])+_0x2de7('0x2f')]=_0x955fe2['id']||null;_0x5ec840[_['upperFirst'](_0x2a6d8b[_0x2de7('0x2e')])+_0x2de7('0x15')]=_0x2a6d8b['interaction']?_0x2a6d8b[_0x2de7('0x30')]['id']:null;_0x5ec840[_[_0x2de7('0x2d')](_0x2a6d8b['channel'])+'MessageId']=_0x2a6d8b['message']?_0x2a6d8b[_0x2de7('0x31')]['id']:null;_0x5ec840[_[_0x2de7('0x2d')](_0x2a6d8b[_0x2de7('0x2e')])+(_0x2a6d8b[_0x2de7('0x2e')]!=='chat'?_0x2de7('0x32'):_0x2de7('0x33'))]=_0x2a6d8b[_0x2de7('0xe')]?_0x2a6d8b[_0x2de7('0xe')]['id']:null;logger[_0x2de7('0x34')](util[_0x2de7('0x18')](_0x2de7('0x35'),_0x4a0e1c,_0x955fe2[_0x2de7('0x36')]));emitChannelQueueInteraction(_0x2a6d8b[_0x2de7('0x2e')],_0x955fe2[_0x2de7('0x36')],_0x5ec840,_0x2a6d8b[_0x2de7('0xe')][_0x2de7('0x36')],_0x2a6d8b[_0x2de7('0x31')]['id'],!![],_0x28f48e,_0x955fe2['id']);if(rpc[_0x2a6d8b[_0x2de7('0x2e')]+_0x2de7('0x37')]){return rpc[_0x2a6d8b[_0x2de7('0x2e')]+_0x2de7('0x37')]['create'](_0x5ec840)[_0x2de7('0x38')](function(_0x982683){logger[_0x2de7('0x39')](_0x2de7('0x3a'),_0x982683);});}}}function stopRouting(_0x280455,_0x4f4762,_0x288d74,_0x29082f){if(_0x280455&&_0x4f4762){_0x4f4762[_0x2de7('0x3b')]-=0x1;var _0x2e0545={'leaveAt':moment()[_0x2de7('0x18')](_0x2de7('0x2a')),'acceptAt':moment()[_0x2de7('0x18')](_0x2de7('0x2a')),'reason':_0x2de7('0x3c')};logger[_0x2de7('0x34')](util[_0x2de7('0x18')](_0x2de7('0x3d'),_0x280455,_0x4f4762['name']));emitChannelQueueInteraction(_0x288d74[_0x2de7('0x2e')],_0x4f4762[_0x2de7('0x36')],_0x288d74['body'],_0x288d74['account']['name'],_0x288d74[_0x2de7('0x31')]['id'],![],_0x29082f,_0x4f4762['id']);return rpc[_0x288d74['channel']+_0x2de7('0x3e')][_0x2de7('0x3f')](_0x288d74[_0x2de7('0x30')]['id'],{'queueId':_0x4f4762['id']})['then'](function(){if(rpc[_0x288d74[_0x2de7('0x2e')]+'QueueReport']){return rpc[_0x288d74[_0x2de7('0x2e')]+_0x2de7('0x37')][_0x2de7('0x3f')](_0x280455,_0x2e0545)['catch'](function(_0x8d94fb){logger[_0x2de7('0x39')](_0x2de7('0x40'),_0x8d94fb);});}});}}function endRouting(_0x4acec5,_0x1486da,_0x41c00e,_0x352df9){if(_0x4acec5&&_0x1486da){_0x1486da[_0x2de7('0x3b')]-=0x1;var _0x58c3ca={'leaveAt':moment()[_0x2de7('0x18')](_0x2de7('0x2a')),'exitAt':moment()[_0x2de7('0x18')](_0x2de7('0x2a')),'reason':_0x2de7('0x41')};logger['info'](util[_0x2de7('0x18')](_0x2de7('0x42'),_0x4acec5,_0x1486da[_0x2de7('0x36')]));emitChannelQueueInteraction(_0x41c00e['channel'],_0x1486da[_0x2de7('0x36')],_0x41c00e['body'],_0x41c00e[_0x2de7('0xe')][_0x2de7('0x36')],_0x41c00e[_0x2de7('0x31')]['id'],![],_0x352df9);if(rpc[_0x41c00e[_0x2de7('0x2e')]+'QueueReport']){return rpc[_0x41c00e[_0x2de7('0x2e')]+_0x2de7('0x37')][_0x2de7('0x3f')](_0x4acec5,_0x58c3ca)[_0x2de7('0x38')](function(_0x1bf527){logger['error']('update\x20queue\x20report',_0x1bf527);});}}}function handleFindQueue(_0x11f118){return function(_0x2921be){return _0x2921be[_0x2de7('0x36')][_0x2de7('0x43')]()===_0x11f118[_0x2de7('0x43')]();};}exports[_0x2de7('0x44')]=function(_0x7f71b3,_0x5e6717,_0x5c5e72,_0x52dc02){return function(_0x424572){try{var _0x40ad67={'name':_0x5e6717[0x0],'timeout':_0x5e6717[0x1]};var _0x355448=queue['validate'](_0x40ad67,{'typecast':!![]});if(_0x355448[_0x2de7('0x45')]){logger[_0x2de7('0x39')](_0x2de7('0x46'),_0x7f71b3,_[_0x2de7('0x47')](_0x355448,_0x2de7('0x31'))[_0x2de7('0x48')](',\x20'));_0x424572[_0x2de7('0x49')]();}else{var _0x31d403=_[_0x2de7('0x4a')](_0x5c5e72[_0x52dc02[_0x2de7('0x2e')]+'Queues'],handleFindQueue(_0x40ad67['name']));if(_0x31d403){startRouting(_0x7f71b3,_0x31d403,_0x52dc02,_0x5c5e72);var _0x2115ae=(_0x31d403[_0x2de7('0x41')]||0xa)*0x3e8;var _0x302691=(_0x40ad67[_0x2de7('0x41')]||0x14)*0x3e8;var _0x1bd0cf;if(_0x2115ae>_0x302691){_0x302691=_0x2115ae;}var _0x48e7d7=seqqueue[_0x2de7('0x4b')](_0x2115ae);_0x48e7d7['id']=_0x7f71b3;_0x48e7d7[_0x2de7('0x4c')]=_0x2115ae;_0x48e7d7[_0x2de7('0x4d')]=_0x302691;_0x48e7d7['channel']=_0x52dc02[_0x2de7('0x2e')];_0x5c5e72[_0x2de7('0x4e')][_0x7f71b3]['on'](_0x2de7('0x4f'),function(){logger[_0x2de7('0x34')](_0x2de7('0x50'),_0x7f71b3);stopRouting(_0x7f71b3,_0x31d403,_0x52dc02,_0x5c5e72);clearTimeout(_0x1bd0cf);_0x1bd0cf=undefined;_0x48e7d7['close'](!![]);if(_0x5c5e72['rules'][_0x7f71b3]){delete _0x5c5e72[_0x2de7('0x4e')][_0x7f71b3];}_0x424572['stop']();});_0x5c5e72['rules'][_0x7f71b3]['on']('complete',function(){if(_0x5c5e72['rules'][_0x7f71b3]){delete _0x5c5e72[_0x2de7('0x4e')][_0x7f71b3];}});_0x1bd0cf=setTimeout(function(){logger[_0x2de7('0x34')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x7f71b3);endRouting(_0x7f71b3,_0x31d403,_0x52dc02,_0x5c5e72);clearTimeout(_0x1bd0cf);_0x48e7d7[_0x2de7('0x51')](!![]);_0x424572[_0x2de7('0x52')]();},_0x302691);switch(_0x31d403[_0x2de7('0x53')]){case'rrmemory':strategy[_0x2de7('0x54')](_0x48e7d7,_0x31d403,_0x5c5e72,_0x52dc02);break;default:strategy['beepall'](_0x48e7d7,_0x31d403,_0x5c5e72,_0x52dc02);}}else{logger[_0x2de7('0x39')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x7f71b3,_0x40ad67[_0x2de7('0x36')]);_0x424572['stop']();}}}catch(_0x286447){logger[_0x2de7('0x39')]('[%s][QUEUE]\x20%s',_0x7f71b3,_0x286447['stack']);_0x424572['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 387ecc0..2601882 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(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xdb94,0xe5));var _0x4db9=function(_0x14e4fd,_0x1f2655){_0x14e4fd=_0x14e4fd-0x0;var _0x5ca430=_0xdb94[_0x14e4fd];return _0x5ca430;};'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 _0xf3cd=['notificationId','agent','realtime','squeue','push','handleRun','handleTimeout','timeout','drained','handleDrained','bind','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','saveWaitingNotification','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x225915,_0x2eaa2f){_0x225915=_0x225915-0x0;var _0x3b8d10=_0xf3cd[_0x225915];return _0x3b8d10;};'use strict';var _=require(_0xdf3c('0x0'));var uuid=require(_0xdf3c('0x1'));var util=require(_0xdf3c('0x2'));var logger=require(_0xdf3c('0x3'))(_0xdf3c('0x4'));var Agent=function(_0x433a7f,_0x54db05,_0x401518,_0x71b446){this[_0xdf3c('0x5')]=uuid['v4']();this['squeue']=_0x433a7f;this[_0xdf3c('0x6')]=_0x54db05;this[_0xdf3c('0x7')]=_0x401518;this[_0xdf3c('0x4')]=_0x71b446;this[_0xdf3c('0x8')][_0xdf3c('0x9')](this[_0xdf3c('0xa')]['bind'](this),this[_0xdf3c('0xb')]['bind'](this));this['squeue']['on'](_0xdf3c('0xc'),this[_0xdf3c('0xb')]['bind'](this));this[_0xdf3c('0x8')]['on'](_0xdf3c('0xd'),this[_0xdf3c('0xe')][_0xdf3c('0xf')](this));};Agent[_0xdf3c('0x10')][_0xdf3c('0x9')]=function(){this[_0xdf3c('0x8')][_0xdf3c('0x9')](this['handleRun'][_0xdf3c('0xf')](this),this[_0xdf3c('0xb')][_0xdf3c('0xf')](this));};Agent[_0xdf3c('0x10')]['handleDrained']=function(){this[_0xdf3c('0xb')](!![]);};Agent[_0xdf3c('0x10')][_0xdf3c('0xa')]=function(){logger['debug'](_0xdf3c('0x11'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);if(_[_0xdf3c('0x12')](this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']])){logger[_0xdf3c('0x14')](_0xdf3c('0x15'),this[_0xdf3c('0x8')]['id'],this['agent']['id']);setTimeout(this[_0xdf3c('0x9')][_0xdf3c('0xf')](this),0x3e8);}else{if(this[_0xdf3c('0x4')][_0xdf3c('0x16')]||util[_0xdf3c('0x17')](this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],this[_0xdf3c('0x8')][_0xdf3c('0x18')],![])){this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']]['busy']=!![];this[_0xdf3c('0x7')]['agents'][this[_0xdf3c('0x6')]['id']][_0xdf3c('0x19')]=undefined;util[_0xdf3c('0x1a')](this[_0xdf3c('0x7')],this[_0xdf3c('0x4')],this[_0xdf3c('0x6')],this['squeue'][_0xdf3c('0x18')]);util[_0xdf3c('0x1b')](this[_0xdf3c('0x5')],this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],null,this[_0xdf3c('0x4')]);util[_0xdf3c('0x1c')](this[_0xdf3c('0x8')]['id'],this['realtime'][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],'RINGING'+(this[_0xdf3c('0x4')]['forcedOwnership']?':FORCED':''));}else{logger['debug'](_0xdf3c('0x1d'),this[_0xdf3c('0x8')]['id'],this['agent']['id']);setTimeout(this['push'][_0xdf3c('0xf')](this),0x3e8);}}};Agent[_0xdf3c('0x10')][_0xdf3c('0xb')]=function(_0x1ccdd4){if(_['isNil'](this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']])){return logger['debug'](_0xdf3c('0x15'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);}else{logger['debug'](_0xdf3c('0x1e'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);util[_0xdf3c('0x1f')](this['notificationId'],this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')]['agents'][this[_0xdf3c('0x6')]['id']],null,this[_0xdf3c('0x4')]);this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']][_0xdf3c('0x20')]=![];this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']]['busyQueue']=undefined;util[_0xdf3c('0x21')](this[_0xdf3c('0x7')],this['routing'],this['agent'],this[_0xdf3c('0x8')]['channel']);util[_0xdf3c('0x1c')](this['squeue']['id'],this['realtime']['agents'][this[_0xdf3c('0x6')]['id']],_0x1ccdd4?_0xdf3c('0x22'):_0xdf3c('0x23'));}if(!_0x1ccdd4){setTimeout(this[_0xdf3c('0x9')]['bind'](this),0x3e8);}};function agent(_0x49f147,_0x3d8557,_0x49d0f0,_0x46e40f){return new Agent(_0x49f147,_0x3d8557,_0x49d0f0,_0x46e40f);}module[_0xdf3c('0x24')]=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 5f27e93..d9e9d3a 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 _0xde5f=['routing','push','handleRun','bind','handleTimeout','drained','prototype','handleDrained','queue','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','saveWaitingNotification','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','TIMEOUT','removeWaitingNotification','exports','./util','../../../../../config/logger','notificationId','squeue','realtime'];(function(_0x530169,_0x47d550){var _0x3ec1c3=function(_0x3f8713){while(--_0x3f8713){_0x530169['push'](_0x530169['shift']());}};_0x3ec1c3(++_0x47d550);}(_0xde5f,0x103));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xfde5('0x0'));var logger=require(_0xfde5('0x1'))('routing');var Beepall=function(_0x3b9b27,_0x41155a,_0x598b59,_0xf65152){this[_0xfde5('0x2')]=uuid['v4']();this[_0xfde5('0x3')]=_0x3b9b27;this['queue']=_0x41155a;this[_0xfde5('0x4')]=_0x598b59;this[_0xfde5('0x5')]=_0xf65152;this[_0xfde5('0x3')][_0xfde5('0x6')](this[_0xfde5('0x7')][_0xfde5('0x8')](this),this[_0xfde5('0x9')][_0xfde5('0x8')](this));this[_0xfde5('0x3')]['on']('timeout',this[_0xfde5('0x9')][_0xfde5('0x8')](this));this[_0xfde5('0x3')]['on'](_0xfde5('0xa'),this['handleDrained'][_0xfde5('0x8')](this));};Beepall['prototype'][_0xfde5('0x6')]=function(){this[_0xfde5('0x3')][_0xfde5('0x6')](this[_0xfde5('0x7')]['bind'](this),this[_0xfde5('0x9')][_0xfde5('0x8')](this));};Beepall[_0xfde5('0xb')][_0xfde5('0xc')]=function(){this['handleTimeout'](!![]);};Beepall[_0xfde5('0xb')][_0xfde5('0x7')]=function(){var _0x3f1f00=!![];if(!_['isNil'](this[_0xfde5('0xd')])&&!_[_0xfde5('0xe')](this[_0xfde5('0xd')][_0xfde5('0xf')])&&this[_0xfde5('0xd')][_0xfde5('0xf')][_0xfde5('0x10')]>0x0){for(var _0x215579=0x0,_0xaefcc1;_0x2155790x0){for(var _0x4b0356=0x0,_0x404ca7;_0x4b03560x0&&_0x3e4543[_0x36db62+_0x6316('0x23')]>=_0x3e4543[_0x36db62+_0x6316('0x22')]){writeLog(_0x111a38,_0x3e4543,_0x36db62['toUpperCase']()+_0x6316('0x24'));return![];}}return!![];};exports[_0x6316('0x25')]=function(_0x11a2b1,_0x4c5bd7,_0x8dd4f6,_0x443260,_0x271379){return sendNotification(!![],_0x11a2b1,_0x4c5bd7,_0x8dd4f6,_0x443260,_0x271379);};exports[_0x6316('0x26')]=function(_0x1483ba,_0x377ba6,_0x39dd2d,_0x40b04f,_0xed60e){return sendNotification(![],_0x1483ba,_0x377ba6,_0x39dd2d,_0x40b04f,_0xed60e);};exports['checkWaitingNotifications']=function(_0x7315dc,_0x6fc86a,_0x546eae){var _0x30b984=_0x6fc86a['interaction'][_0x6316('0x27')];if(!_0x30b984&&_0x546eae){_0x30b984=_0x546eae['id'];}var _0x2bd2a4=_['some'](_0x7315dc[_0x6fc86a['channel']+_0x6316('0x28')],function(_0x4f97fc){var _0x528f8d=_['capitalize'](_0x6fc86a['channel'])+_0x6316('0x29');return _0x4f97fc[_0x528f8d]===_0x6fc86a[_0x6316('0x2a')]['id'];});if(!_0x2bd2a4&&_0x30b984&&_0x7315dc[_0x6316('0x2b')][_0x30b984]){_0x2bd2a4=_['some'](_0x7315dc[_0x6316('0x2b')][_0x30b984][_0x6fc86a[_0x6316('0x2c')]+_0x6316('0x2d')],function(_0x4474e4){return _0x4474e4['id']===_0x6fc86a[_0x6316('0x2a')]['id'];});}return _0x2bd2a4;};exports[_0x6316('0x2e')]=function(_0xdcfc65,_0x12ee45,_0x5b8e34,_0x4d5a73){if(_0x5b8e34&&_0x5b8e34['id']&&_0xdcfc65[_0x6316('0x2b')]&&_0xdcfc65[_0x6316('0x2b')][_0x5b8e34['id']]){_0xdcfc65[_0x6316('0x2b')][_0x5b8e34['id']][_0x4d5a73+_0x6316('0x2d')][_0x12ee45['message']['id']]={'id':_0x12ee45[_0x6316('0x2a')]['id']};}};exports[_0x6316('0x2f')]=function(_0x5c9ae3,_0x3e7c4a,_0x3ae0fa,_0x282b52){if(_0x3ae0fa&&_0x3ae0fa['id']&&_0x5c9ae3[_0x6316('0x2b')]&&_0x5c9ae3['agents'][_0x3ae0fa['id']]){delete _0x5c9ae3[_0x6316('0x2b')][_0x3ae0fa['id']][_0x282b52+_0x6316('0x2d')][_0x3e7c4a['message']['id']];}};exports[_0x6316('0x30')]=writeLog; \ No newline at end of file +var _0x51fe=['[%s][QUEUE][AGENT:%s][STATUS:%s]','BUSY','online','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','removeWaitingNotification','writeLog','util','../utils','ioredis','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','format','notification:%s','save','remove'];(function(_0x16aeb2,_0x5a03c5){var _0x469da9=function(_0x322a5a){while(--_0x322a5a){_0x16aeb2['push'](_0x16aeb2['shift']());}};_0x469da9(++_0x5a03c5);}(_0x51fe,0x1d0));var _0xe51f=function(_0x385d5d,_0x58415a){_0x385d5d=_0x385d5d-0x0;var _0x4564d3=_0x51fe[_0x385d5d];return _0x4564d3;};'use strict';var _=require('lodash');var util=require(_0xe51f('0x0'));var utils=require(_0xe51f('0x1'));var Redis=require(_0xe51f('0x2'));var config=require('../../../../../config/environment');var logger=require(_0xe51f('0x3'))('routing');config[_0xe51f('0x4')]=_[_0xe51f('0x5')](config['redis'],{'host':_0xe51f('0x6'),'port':0x18eb});var io=require(_0xe51f('0x7'))(new Redis(config[_0xe51f('0x4')]));function sendNotification(_0x1a7209,_0x20a183,_0x252f75,_0x2b56d0,_0x2b335b,_0x1b8c92){var _0x52593e=_0x1b8c92||{};var _0x4d57a0=_0x252f75[_0xe51f('0x8')]('.');var _0x597371={'uniqueid':_0x20a183,'channel':_0x4d57a0[0x0],'id':_0x4d57a0[0x1],'title':_0x4d57a0[0x0]+_0xe51f('0x9'),'interactionId':_0x4d57a0[0x2],'queue':_0x2b335b?_0x2b335b[_0xe51f('0xa')]:null,'sound':_0x52593e[_0xe51f('0xb')][_0xe51f('0xc')],'shake':_0x52593e[_0xe51f('0xb')][_0xe51f('0xd')]};try{if(!_0x52593e['body']){_0x52593e[_0xe51f('0xe')]={};}if(_0x2b335b){_0x52593e[_0xe51f('0xe')][_0xe51f('0xf')]=_0x2b335b;}else if(_0x52593e[_0xe51f('0xe')]['queue']){delete _0x52593e['body'][_0xe51f('0xf')];}_0x597371[_0xe51f('0x10')]=utils[_0xe51f('0x11')](_0x52593e[_0xe51f('0xb')]['notificationTemplate'],_0x52593e);}catch(_0x66f010){_0x597371[_0xe51f('0x10')]=_0xe51f('0x12');logger[_0xe51f('0x13')](util['format'](_0xe51f('0x14'),_0x20a183,_0x66f010[_0xe51f('0x15')]));}io['to'](util[_0xe51f('0x16')]('user:%s',_0x2b56d0[_0xe51f('0xa')]))['emit'](util[_0xe51f('0x16')](_0xe51f('0x17'),_0x1a7209?_0xe51f('0x18'):_0xe51f('0x19')),_0x597371);}function writeLog(_0x464fa1,_0x1b6225,_0x152ce4){return logger['debug'](util[_0xe51f('0x16')](_0xe51f('0x1a'),_0x464fa1,_0x1b6225['name'],_0x152ce4));}exports['isAgentAvailable']=function(_0x39fca1,_0xebcc4,_0x4c4211,_0x252ba0){if(_0xebcc4['busy']){writeLog(_0x39fca1,_0xebcc4,_0xe51f('0x1b'));return![];}if(!_0xebcc4[_0xe51f('0x1c')]){writeLog(_0x39fca1,_0xebcc4,'OFFLINE');return![];}if(_0xebcc4[_0x4c4211+_0xe51f('0x1d')]){writeLog(_0x39fca1,_0xebcc4,_0xe51f('0x1e'));return![];}if(_0x252ba0&&_0xebcc4[_0xe51f('0x1f')](_0x4c4211+'Capacity')&&_0xebcc4[_0xe51f('0x1f')](_0x4c4211+_0xe51f('0x20'))){if(_0xebcc4[_0x4c4211+_0xe51f('0x21')]>0x0&&_0xebcc4[_0x4c4211+_0xe51f('0x20')]>=_0xebcc4[_0x4c4211+_0xe51f('0x21')]){writeLog(_0x39fca1,_0xebcc4,_0x4c4211[_0xe51f('0x22')]()+_0xe51f('0x23'));return![];}}return!![];};exports[_0xe51f('0x24')]=function(_0x4afbdf,_0x48f3d2,_0xcec633,_0x24543f,_0x58a51a){return sendNotification(!![],_0x4afbdf,_0x48f3d2,_0xcec633,_0x24543f,_0x58a51a);};exports[_0xe51f('0x25')]=function(_0x450e53,_0x39d515,_0x2f01fe,_0x2ea963,_0x57331a){return sendNotification(![],_0x450e53,_0x39d515,_0x2f01fe,_0x2ea963,_0x57331a);};exports['checkWaitingNotifications']=function(_0xc23bbd,_0x59240e,_0x299359){var _0x101a0d=_0x59240e[_0xe51f('0x26')][_0xe51f('0x27')];if(!_0x101a0d&&_0x299359){_0x101a0d=_0x299359['id'];}var _0x12132b=_[_0xe51f('0x28')](_0xc23bbd[_0x59240e[_0xe51f('0x29')]+_0xe51f('0x2a')],function(_0x2130c4){var _0x2615e4=_[_0xe51f('0x2b')](_0x59240e[_0xe51f('0x29')])+_0xe51f('0x2c');return _0x2130c4[_0x2615e4]===_0x59240e[_0xe51f('0x26')]['id'];});if(!_0x12132b&&_0x101a0d&&_0xc23bbd[_0xe51f('0x2d')][_0x101a0d]){_0x12132b=_['some'](_0xc23bbd[_0xe51f('0x2d')][_0x101a0d][_0x59240e[_0xe51f('0x29')]+_0xe51f('0x2e')],function(_0x508e7c){return _0x508e7c['id']===_0x59240e['interaction']['id'];});}return _0x12132b;};exports['saveWaitingNotification']=function(_0x375470,_0x5d1908,_0x575050,_0x54d5f8){if(_0x575050&&_0x575050['id']&&_0x375470[_0xe51f('0x2d')]&&_0x375470[_0xe51f('0x2d')][_0x575050['id']]){_0x375470[_0xe51f('0x2d')][_0x575050['id']][_0x54d5f8+_0xe51f('0x2e')][_0x5d1908[_0xe51f('0x15')]['id']]={'id':_0x5d1908[_0xe51f('0x26')]['id']};}};exports[_0xe51f('0x2f')]=function(_0x46b0a8,_0x1a26a4,_0xe1b266,_0x595be1){if(_0xe1b266&&_0xe1b266['id']&&_0x46b0a8[_0xe51f('0x2d')]&&_0x46b0a8[_0xe51f('0x2d')][_0xe1b266['id']]){delete _0x46b0a8['agents'][_0xe1b266['id']][_0x595be1+'WaitingInteractions'][_0x1a26a4[_0xe51f('0x15')]['id']];}};exports[_0xe51f('0x30')]=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 c864130..16c0809 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 _0xe27e=['consequence','map','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','error','[%s][SYSTEM]\x20%s','isObject','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x2d89de,_0xd6c158){var _0x24bbb1=function(_0x38e521){while(--_0x38e521){_0x2d89de['push'](_0x2d89de['shift']());}};_0x24bbb1(++_0xd6c158);}(_0xe27e,0xa8));var _0xee27=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xe27e[_0x4dc7b9];return _0x3ab114;};'use strict';var schema=require(_0xee27('0x0'));var sh=require('shelljs');var _=require(_0xee27('0x1'));var utils=require(_0xee27('0x2'));var logger=require(_0xee27('0x3'))(_0xee27('0x4'));var system=schema({'command':{'type':_0xee27('0x5'),'required':!![],'message':_0xee27('0x6')}});exports[_0xee27('0x7')]=function(_0x1f9d0c,_0x5db5ad){return function(_0x221762){try{var _0x10a79e={'command':_0x5db5ad[0x0]};var _0x3a19b0=system[_0xee27('0x0')](_0x10a79e,{'typecast':!![]});if(_0x3a19b0['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x1f9d0c,_[_0xee27('0x8')](_0x3a19b0,'message')['join'](',\x20'));logger['info'](_0xee27('0x9'),_0x1f9d0c);_0x221762[_0xee27('0xa')]();}else{var _0x115775=this;var _0x97dfcf=utils[_0xee27('0xb')](_0x5db5ad[0x0],this);logger[_0xee27('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x1f9d0c,_0x97dfcf);sh[_0xee27('0xd')](_['trim'](_0x97dfcf),function(_0x2e9b72,_0x5ce33b){logger['info'](_0xee27('0xe'),_0x1f9d0c,_0x2e9b72);if(_0x2e9b72==0x0){var _0x248e83=_0x5ce33b[_0xee27('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0xee27('0x10')](_0x5db5ad[0x1])||_[_0xee27('0x11')](_0x5db5ad[0x1])){logger[_0xee27('0xc')](_0xee27('0x12'),_0x1f9d0c);_0x115775['body'][_0x5db5ad[0x1]]=_0x248e83;}else{logger[_0xee27('0xc')](_0xee27('0x13'),_0x1f9d0c,_0x5db5ad[0x1],_0x248e83);_0x115775[_0xee27('0x14')][_0x5db5ad[0x1]]=_0x248e83;}}_0x221762[_0xee27('0xa')]();});}}catch(_0x18b0a8){logger[_0xee27('0x15')](_0xee27('0x16'),_0x1f9d0c,_[_0xee27('0x17')](_0x18b0a8)?JSON[_0xee27('0x18')](_0x18b0a8):_0x18b0a8);logger[_0xee27('0xc')](_0xee27('0x9'),_0x1f9d0c);_0x221762['next']();}};}; \ No newline at end of file +var _0x5e27=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','info','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','body','next','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5e27,0xc4));var _0x75e2=function(_0x241427,_0x4f5bea){_0x241427=_0x241427-0x0;var _0x3955f=_0x5e27[_0x241427];return _0x3955f;};'use strict';var schema=require(_0x75e2('0x0'));var sh=require(_0x75e2('0x1'));var _=require(_0x75e2('0x2'));var utils=require(_0x75e2('0x3'));var logger=require(_0x75e2('0x4'))(_0x75e2('0x5'));var system=schema({'command':{'type':_0x75e2('0x6'),'required':!![],'message':_0x75e2('0x7')}});exports[_0x75e2('0x8')]=function(_0x28066c,_0x2122b1){return function(_0x48b436){try{var _0x5d42ff={'command':_0x2122b1[0x0]};var _0x166fb2=system[_0x75e2('0x0')](_0x5d42ff,{'typecast':!![]});if(_0x166fb2['length']){logger[_0x75e2('0x9')]('[%s][SYSTEM]\x20%s',_0x28066c,_[_0x75e2('0xa')](_0x166fb2,'message')['join'](',\x20'));logger['info'](_0x75e2('0xb'),_0x28066c);_0x48b436['next']();}else{var _0x40d115=this;var _0x304802=utils['getMustacheRender'](_0x2122b1[0x0],this);logger[_0x75e2('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x28066c,_0x304802);sh[_0x75e2('0xd')](_[_0x75e2('0xe')](_0x304802),function(_0x325a47,_0x49f34e){logger[_0x75e2('0xc')](_0x75e2('0xf'),_0x28066c,_0x325a47);if(_0x325a47==0x0){var _0x134656=_0x49f34e[_0x75e2('0x10')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x2122b1[0x1])||_[_0x75e2('0x11')](_0x2122b1[0x1])){logger[_0x75e2('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x28066c);_0x40d115['body'][_0x2122b1[0x1]]=_0x134656;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x28066c,_0x2122b1[0x1],_0x134656);_0x40d115[_0x75e2('0x12')][_0x2122b1[0x1]]=_0x134656;}}_0x48b436[_0x75e2('0x13')]();});}}catch(_0x387ceb){logger[_0x75e2('0x9')](_0x75e2('0x14'),_0x28066c,_[_0x75e2('0x15')](_0x387ceb)?JSON[_0x75e2('0x16')](_0x387ceb):_0x387ceb);logger[_0x75e2('0xc')](_0x75e2('0xb'),_0x28066c);_0x48b436[_0x75e2('0x13')]();}};}; \ 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 b27c8b0..164cc62 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 _0x6cbd=['../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','finally','next','isObject','stringify','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0x6cbd,0x9b));var _0xd6cb=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x6cbd[_0x1caf6a];return _0x1bf493;};'use strict';var schema=require('validate');var _=require(_0xd6cb('0x0'));var rpc={'chatInteraction':require(_0xd6cb('0x1')),'openchannelInteraction':require(_0xd6cb('0x2')),'smsInteraction':require(_0xd6cb('0x3')),'mailInteraction':require(_0xd6cb('0x4')),'faxInteraction':require(_0xd6cb('0x5')),'whatsappInteraction':require(_0xd6cb('0x6'))};var logger=require(_0xd6cb('0x7'))('routing');var tag=schema({'tag':{'type':_0xd6cb('0x8'),'required':!![],'message':_0xd6cb('0x9')}});exports['consequence']=function(_0x389ce0,_0x101216,_0x24cb10,_0x415d90){return function(_0x489cf8){try{var _0x157726={'tag':_0x101216[0x0]};var _0x5b29a4=tag[_0xd6cb('0xa')](_0x157726,{'typecast':!![]});if(_0x5b29a4['length']){logger[_0xd6cb('0xb')](_0xd6cb('0xc'),_0x389ce0,_[_0xd6cb('0xd')](_0x5b29a4,_0xd6cb('0xe'))['join'](',\x20'));logger[_0xd6cb('0xf')](_0xd6cb('0x10'),_0x389ce0);_0x489cf8['next']();}else{var _0x5dde46={'ids':[_0x101216[0x0]]};if(rpc[_0x415d90['channel']+'Interaction']){rpc[_0x415d90[_0xd6cb('0x11')]+_0xd6cb('0x12')][_0xd6cb('0x13')](_0x415d90[_0xd6cb('0x14')]['id'],_0x5dde46)[_0xd6cb('0x15')](function(_0x14d61f){logger[_0xd6cb('0xf')](_0xd6cb('0x16'),_0x389ce0,_0x101216[0x1],_0x415d90['channel'],_0x415d90['interaction']['id']);})['catch'](function(_0x48e6b6){logger[_0xd6cb('0xb')]('[%s][TAG]\x20%s',_0x389ce0,JSON['stringify'](_0x48e6b6));logger[_0xd6cb('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x389ce0);})[_0xd6cb('0x17')](function(){_0x489cf8[_0xd6cb('0x18')]();});}}}catch(_0x242a81){logger[_0xd6cb('0xb')]('[%s][TAG]\x20%s',_0x389ce0,_[_0xd6cb('0x19')](_0x242a81)?JSON[_0xd6cb('0x1a')](_0x242a81):_0x242a81);logger['info'](_0xd6cb('0x10'),_0x389ce0);_0x489cf8[_0xd6cb('0x18')]();}};}; \ No newline at end of file +var _0x9c13=['finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','message','join','info','next','channel','Interaction','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','error','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x4b006a,_0x3ed9f6){var _0x3353c3=function(_0x4432cd){while(--_0x4432cd){_0x4b006a['push'](_0x4b006a['shift']());}};_0x3353c3(++_0x3ed9f6);}(_0x9c13,0xb0));var _0x39c1=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0x9c13[_0x56e4e7];return _0x383618;};'use strict';var schema=require(_0x39c1('0x0'));var _=require(_0x39c1('0x1'));var rpc={'chatInteraction':require(_0x39c1('0x2')),'openchannelInteraction':require(_0x39c1('0x3')),'smsInteraction':require(_0x39c1('0x4')),'mailInteraction':require(_0x39c1('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x39c1('0x6'))};var logger=require(_0x39c1('0x7'))(_0x39c1('0x8'));var tag=schema({'tag':{'type':_0x39c1('0x9'),'required':!![],'message':_0x39c1('0xa')}});exports[_0x39c1('0xb')]=function(_0x324669,_0x44ea32,_0x487613,_0x267378){return function(_0x4a03db){try{var _0x3d4b4e={'tag':_0x44ea32[0x0]};var _0xe44e7=tag[_0x39c1('0x0')](_0x3d4b4e,{'typecast':!![]});if(_0xe44e7[_0x39c1('0xc')]){logger['error'](_0x39c1('0xd'),_0x324669,_['map'](_0xe44e7,_0x39c1('0xe'))[_0x39c1('0xf')](',\x20'));logger[_0x39c1('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x324669);_0x4a03db[_0x39c1('0x11')]();}else{var _0x1ba154={'ids':[_0x44ea32[0x0]]};if(rpc[_0x267378[_0x39c1('0x12')]+_0x39c1('0x13')]){rpc[_0x267378[_0x39c1('0x12')]+_0x39c1('0x13')][_0x39c1('0x14')](_0x267378['interaction']['id'],_0x1ba154)['then'](function(_0x3fba45){logger['info'](_0x39c1('0x15'),_0x324669,_0x44ea32[0x1],_0x267378[_0x39c1('0x12')],_0x267378[_0x39c1('0x16')]['id']);})[_0x39c1('0x17')](function(_0x96305d){logger[_0x39c1('0x18')](_0x39c1('0xd'),_0x324669,JSON[_0x39c1('0x19')](_0x96305d));logger[_0x39c1('0x10')](_0x39c1('0x1a'),_0x324669);})[_0x39c1('0x1b')](function(){_0x4a03db[_0x39c1('0x11')]();});}}}catch(_0x32f073){logger[_0x39c1('0x18')](_0x39c1('0xd'),_0x324669,_[_0x39c1('0x1c')](_0x32f073)?JSON[_0x39c1('0x19')](_0x32f073):_0x32f073);logger[_0x39c1('0x10')](_0x39c1('0x1a'),_0x324669);_0x4a03db[_0x39c1('0x11')]();}};}; \ 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 1922097..8cb3974 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 _0x3444=['parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','routing','lodash','consequence','replace','push','?params=','urlOnRing','title','jsonrpc','login','params','stringify','utf8','POST','application/json-rpc','then'];(function(_0x3b0100,_0x55c7a1){var _0x5c2672=function(_0x44f97e){while(--_0x44f97e){_0x3b0100['push'](_0x3b0100['shift']());}};_0x5c2672(++_0x55c7a1);}(_0x3444,0x111));var _0x4344=function(_0x148a36,_0x1f1d88){_0x148a36=_0x148a36-0x0;var _0x2d7a05=_0x3444[_0x148a36];return _0x2d7a05;};'use strict';var rp=require('request-promise');var logger=require(_0x4344('0x0'))(_0x4344('0x1'));var _=require(_0x4344('0x2'));var arr=[];exports[_0x4344('0x3')]=function(_0x236b4b,_0x11d739){return function(_0x27c604){var _0x3d9ccb=_0x11d739[0xa];var _0x775038=_0x11d739[0xb];var _0x457918=_0x11d739[0xc];var _0xebd3d4=_0x11d739[0xd];var _0x47dad5=_0x11d739[0xe];var _0x32d345=_0x11d739[0xf][_0x4344('0x4')](/\n/g,'\x20-\x20');var _0x734411=_0x11d739[0x10][_0x4344('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x775038)){arr[_0x4344('0x5')](_0x775038);var _0x50b9d6=_0x11d739[0x3];var _0x206bcb=_0x11d739[0x4];var _0x158dde=_0x11d739[0x1];var _0x3b21e4=_0x11d739[0x0];var _0x27d8e0={};_0x27d8e0['urlOnAnswer']=_0x11d739[0x8]+_0x4344('0x6')+_0x457918+'|'+_0x3d9ccb+'|'+_0xebd3d4+'|'+_0x775038+'|'+_0x47dad5;_0x27d8e0[_0x4344('0x7')]=_0x11d739[0x7]+_0x4344('0x6')+_0x457918+'|'+_0x3d9ccb+'|'+_0xebd3d4+'|'+_0x775038+'|'+_0x47dad5+'|'+_0x32d345+'|'+_0x734411;_0x27d8e0[_0x4344('0x8')]=_0x11d739[0x9];var _0x2e50fb={};_0x2e50fb[_0x4344('0x9')]='2.0';_0x2e50fb['method']=_0x4344('0xa');var _0xff5bf1=[];_0xff5bf1['push'](_0x11d739[0x2]);_0xff5bf1[_0x4344('0x5')](_0x11d739[0x5]);_0xff5bf1[_0x4344('0x5')](_0x11d739[0x6]);_0x2e50fb[_0x4344('0xb')]=_0xff5bf1;_0x2e50fb['id']=0x1;var _0x12d03d=JSON[_0x4344('0xc')](_0x2e50fb);var _0x4b00f3={'encoding':_0x4344('0xd'),'method':_0x4344('0xe'),'timeout':0x2710,'url':_0x50b9d6,'headers':{'Content-Type':_0x4344('0xf')},'body':_0x12d03d};return rp(_0x4b00f3)[_0x4344('0x10')](function(_0x59d4bd){const _0x2c070d=JSON[_0x4344('0x11')](_0x59d4bd);if(!_0x2c070d['result'][_0x4344('0x12')]){throw new Error(_0x4344('0x13'));}var _0x78fdcf=_0x775038;var _0x1d89c7='channelId='+_0x158dde+_0x4344('0x14')+_0x3b21e4+_0x4344('0x15')+_0x78fdcf+'&data='+JSON['stringify'](_0x27d8e0);var _0x5cd261=_0x206bcb+'?'+_0x1d89c7;return rp(_0x5cd261);})['then'](function(_0x6bdfa7){logger[_0x4344('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x236b4b,_0x6bdfa7);_0x27c604[_0x4344('0x17')]();})[_0x4344('0x18')](function(_0xb800ce){logger[_0x4344('0x19')](_0x4344('0x1a'),_0x236b4b,_[_0x4344('0x1b')](_0xb800ce)?JSON[_0x4344('0xc')](_0xb800ce):_0xb800ce);_0x27c604['stop']();});}else{logger['info'](_0x4344('0x1c'),_0x236b4b);_0x27c604['next']();}};}; \ No newline at end of file +var _0x4bd7=['replace','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','params','stringify','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','consequence','\x20-\x20'];(function(_0x1b5b38,_0x3569be){var _0x4cb005=function(_0x742a50){while(--_0x742a50){_0x1b5b38['push'](_0x1b5b38['shift']());}};_0x4cb005(++_0x3569be);}(_0x4bd7,0x1db));var _0x74bd=function(_0x34205a,_0x2158de){_0x34205a=_0x34205a-0x0;var _0x2040ed=_0x4bd7[_0x34205a];return _0x2040ed;};'use strict';var rp=require(_0x74bd('0x0'));var logger=require(_0x74bd('0x1'))(_0x74bd('0x2'));var _=require('lodash');var arr=[];exports[_0x74bd('0x3')]=function(_0x223f2a,_0x25e9be){return function(_0x1f0816){var _0x3116e8=_0x25e9be[0xa];var _0x345171=_0x25e9be[0xb];var _0x402a6e=_0x25e9be[0xc];var _0x10191b=_0x25e9be[0xd];var _0x87347e=_0x25e9be[0xe];var _0x5aae3c=_0x25e9be[0xf]['replace'](/\n/g,_0x74bd('0x4'));var _0x5642c8=_0x25e9be[0x10][_0x74bd('0x5')](/\n/g,'\x20');if(!arr['includes'](_0x345171)){arr[_0x74bd('0x6')](_0x345171);var _0x365a43=_0x25e9be[0x3];var _0x47fb2a=_0x25e9be[0x4];var _0x2c42de=_0x25e9be[0x1];var _0xabf75d=_0x25e9be[0x0];var _0x1f48bf={};_0x1f48bf[_0x74bd('0x7')]=_0x25e9be[0x8]+_0x74bd('0x8')+_0x402a6e+'|'+_0x3116e8+'|'+_0x10191b+'|'+_0x345171+'|'+_0x87347e;_0x1f48bf['urlOnRing']=_0x25e9be[0x7]+'?params='+_0x402a6e+'|'+_0x3116e8+'|'+_0x10191b+'|'+_0x345171+'|'+_0x87347e+'|'+_0x5aae3c+'|'+_0x5642c8;_0x1f48bf[_0x74bd('0x9')]=_0x25e9be[0x9];var _0x58fb92={};_0x58fb92[_0x74bd('0xa')]=_0x74bd('0xb');_0x58fb92[_0x74bd('0xc')]=_0x74bd('0xd');var _0x3f1cd8=[];_0x3f1cd8[_0x74bd('0x6')](_0x25e9be[0x2]);_0x3f1cd8[_0x74bd('0x6')](_0x25e9be[0x5]);_0x3f1cd8[_0x74bd('0x6')](_0x25e9be[0x6]);_0x58fb92[_0x74bd('0xe')]=_0x3f1cd8;_0x58fb92['id']=0x1;var _0x45d506=JSON[_0x74bd('0xf')](_0x58fb92);var _0xeac68b={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x365a43,'headers':{'Content-Type':_0x74bd('0x10')},'body':_0x45d506};return rp(_0xeac68b)[_0x74bd('0x11')](function(_0xeb1db){const _0x1a6bb9=JSON[_0x74bd('0x12')](_0xeb1db);if(!_0x1a6bb9[_0x74bd('0x13')][_0x74bd('0x14')]){throw new Error(_0x74bd('0x15'));}var _0x4cc1d5=_0x345171;var _0x28fc86=_0x74bd('0x16')+_0x2c42de+_0x74bd('0x17')+_0xabf75d+_0x74bd('0x18')+_0x4cc1d5+'&data='+JSON[_0x74bd('0xf')](_0x1f48bf);var _0x579d2b=_0x47fb2a+'?'+_0x28fc86;return rp(_0x579d2b);})['then'](function(_0x3d8816){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x223f2a,_0x3d8816);_0x1f0816[_0x74bd('0x19')]();})[_0x74bd('0x1a')](function(_0x4cc6d5){logger[_0x74bd('0x1b')](_0x74bd('0x1c'),_0x223f2a,_[_0x74bd('0x1d')](_0x4cc6d5)?JSON[_0x74bd('0xf')](_0x4cc6d5):_0x4cc6d5);_0x1f0816[_0x74bd('0x19')]();});}else{logger['info'](_0x74bd('0x1e'),_0x223f2a);_0x1f0816[_0x74bd('0x1f')]();}};}; \ 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 1c2df32..c873ff5 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x271ae0,_0x2051a){var _0x30e875=function(_0x15025d){while(--_0x15025d){_0x271ae0['push'](_0x271ae0['shift']());}};_0x30e875(++_0x2051a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0xab5ea2,_0x189398){var _0x459063=function(_0x3255da){while(--_0x3255da){_0xab5ea2['push'](_0xab5ea2['shift']());}};_0x459063(++_0x189398);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 bfddad2..f6a2391 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 _0xb235=['autoreply','appdata','mail','push','slice','dialogflow','split','amazonlex','tag','TagId','tvox','account','ChatWebsiteId','ContactId','body','%s:%s:%s','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','complete','No\x20applications\x20to\x20execute','stack','agent','agents','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','length','existsSync','join','app','.js','toLowerCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb235,0x10d));var _0x5b23=function(_0x522e32,_0x440e6d){_0x522e32=_0x522e32-0x0;var _0x216842=_0xb235[_0x522e32];return _0x216842;};'use strict';var _=require('lodash');var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x5b23('0x0'));var BPromise=require(_0x5b23('0x1'));var utils=require(_0x5b23('0x2'));var sUtils=require(_0x5b23('0x3'));var logger=require(_0x5b23('0x4'))(_0x5b23('0x5'));var rpc={'openchannelQueueReport':require(_0x5b23('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x5b23('0x7')),'smsQueueReport':require(_0x5b23('0x8')),'faxQueueReport':require(_0x5b23('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x5b23('0xa'));function getId(_0x5b86d2,_0x5bea9e,_0x12d845){return util[_0x5b23('0xb')]('%s.%s.%s',_0x5b86d2,_0x5bea9e||0x0,_0x12d845||0x0);}function getIntervals(_0x3a9535,_0x3225a5){var _0x410f6e=[];if(!_[_0x5b23('0xc')](_0x3225a5[_0x5b23('0xd')])&&!_[_0x5b23('0xc')](_0x3a9535[_0x3225a5[_0x5b23('0xd')]])&&!_[_0x5b23('0xc')](_0x3a9535[_0x3225a5[_0x5b23('0xd')]][_0x5b23('0xe')])){_0x410f6e=_[_0x5b23('0xf')](_0x3a9535[_0x3225a5['IntervalId']][_0x5b23('0xe')],_0x5b23('0x10'));}else if(!_[_0x5b23('0xc')](_0x3225a5[_0x5b23('0x10')])){_0x410f6e=[_0x3225a5[_0x5b23('0x10')]];}return _0x410f6e;}exports[_0x5b23('0x11')]=function(_0x5a7b23){_0x5a7b23[_0x5b23('0x12')]={};return new BPromise(function(_0xae2f4d,_0xf69a11){var _0x4a4a38={'Start':function(_0xb84240){var _0x55331d=this;return new Promise(function(_0x4e0f88,_0x3c9db5){if(_0xb84240){try{var _0x311f01=[];var _0xb501ec=getId(_0xb84240[_0x5b23('0x13')],_0xb84240[_0x5b23('0x14')]?_0xb84240[_0x5b23('0x14')]['id']:0x0,_0xb84240[_0x5b23('0x15')]?_0xb84240[_0x5b23('0x15')]['id']:0x0);var _0x2ad9b7=sUtils[_0x5b23('0x16')](_0x5a7b23,_0xb84240);if(_0xb84240[_0x5b23('0x17')]||!_0x2ad9b7&&_0xb84240[_0x5b23('0x18')]&&_['isArray'](_0xb84240[_0x5b23('0x18')])&&_0xb84240[_0x5b23('0x18')]['length']){for(var _0x4ce369=0x0;_0x4ce369<_0xb84240[_0x5b23('0x18')][_0x5b23('0x19')];_0x4ce369+=0x1){var _0x32987a=_0xb84240[_0x5b23('0x18')][_0x4ce369];if(fs[_0x5b23('0x1a')](path[_0x5b23('0x1b')](__dirname,'applications',_0x32987a[_0x5b23('0x1c')]+_0x5b23('0x1d')))){var _0x2ea49b=[];switch(_0x32987a[_0x5b23('0x1c')][_0x5b23('0x1e')]()){case _0x5b23('0x1f'):var _0x1b6af4=_0x32987a[_0x5b23('0x20')]['split'](',');if(_0xb84240[_0x5b23('0x13')]===_0x5b23('0x21')){_0x2ea49b[_0x5b23('0x22')](_0x1b6af4[0x0]);_0x2ea49b[_0x5b23('0x22')](_0x1b6af4[0x1]);_0x2ea49b[_0x5b23('0x22')](_0x1b6af4['slice'](0x2,_0x1b6af4[_0x5b23('0x19')])['join'](','));}else{_0x2ea49b[_0x5b23('0x22')](_0x1b6af4[0x0]);_0x2ea49b[_0x5b23('0x22')](_0x1b6af4[_0x5b23('0x23')](0x1,_0x1b6af4[_0x5b23('0x19')])['join'](','));}break;case _0x5b23('0x24'):var _0x5e71c2=_0x32987a[_0x5b23('0x20')]['split'](',');_0x2ea49b[_0x5b23('0x22')](_0x5e71c2[0x0]);_0x2ea49b[_0x5b23('0x22')](_0x5e71c2[0x1]);_0x2ea49b[_0x5b23('0x22')](_0x5e71c2[_0x5b23('0x23')](0x2,_0x5e71c2[_0x5b23('0x19')])[_0x5b23('0x1b')](','));break;case'dialogflowv2':var _0x31674c=_0x32987a[_0x5b23('0x20')][_0x5b23('0x25')](',');_0x2ea49b[_0x5b23('0x22')](_0x31674c[0x0]);_0x2ea49b[_0x5b23('0x22')](_0x31674c[0x1]);_0x2ea49b[_0x5b23('0x22')](_0x31674c[0x2]);_0x2ea49b[_0x5b23('0x22')](_0x31674c[0x3]);_0x2ea49b['push'](_0x31674c[_0x5b23('0x23')](0x4,_0x31674c['length'])['join'](','));break;case _0x5b23('0x26'):var _0x57e5af=_0x32987a[_0x5b23('0x20')][_0x5b23('0x25')](',');_0x2ea49b[_0x5b23('0x22')](_0x57e5af[0x0]);_0x2ea49b[_0x5b23('0x22')](_0x57e5af[0x1]);_0x2ea49b[_0x5b23('0x22')](_0x57e5af[0x2]);_0x2ea49b['push'](_0x57e5af[0x3]);_0x2ea49b[_0x5b23('0x22')](_0x57e5af[_0x5b23('0x23')](0x4,_0x57e5af[_0x5b23('0x19')])[_0x5b23('0x1b')](','));break;case _0x5b23('0x14'):_0x2ea49b[_0x5b23('0x22')](_0x32987a[_0x5b23('0x20')]);break;case _0x5b23('0x27'):_0x2ea49b[_0x5b23('0x22')](_0x32987a[_0x5b23('0x28')]);_0x2ea49b[_0x5b23('0x22')](_0x32987a[_0x5b23('0x20')]);break;case _0x5b23('0x29'):var _0x321638=utils['getMustacheRender'](_0xb84240[_0x5b23('0x2a')]['notificationTemplate'],_0xb84240);var _0x43a236=_0x32987a['appdata'][_0x5b23('0x25')](',');_0x2ea49b[_0x5b23('0x22')](_0x43a236[0x0]);_0x2ea49b[_0x5b23('0x22')](_0x43a236[0x1]);_0x2ea49b[_0x5b23('0x22')](_0x43a236[0x2]);_0x2ea49b[_0x5b23('0x22')](_0x43a236[0x3]);_0x2ea49b[_0x5b23('0x22')](_0x43a236[0x4]);_0x2ea49b['push'](_0x43a236[0x5]);_0x2ea49b[_0x5b23('0x22')](_0x43a236[0x6]);_0x2ea49b[_0x5b23('0x22')](_0x43a236[0x7]);_0x2ea49b['push'](_0x43a236[0x8]);_0x2ea49b[_0x5b23('0x22')](_0x43a236[0x9]);_0x2ea49b['push'](_0x43a236[0xa]);_0x2ea49b[_0x5b23('0x22')](_0xb84240['interaction']['id']);_0x2ea49b[_0x5b23('0x22')](_0xb84240[_0x5b23('0x14')]['id']);_0x2ea49b[_0x5b23('0x22')](_0x32987a[_0x5b23('0x2b')]);_0x2ea49b[_0x5b23('0x22')](_0xb84240[_0x5b23('0x15')][_0x5b23('0x2c')]);_0x2ea49b[_0x5b23('0x22')](_0xb84240[_0x5b23('0x2d')][_0x5b23('0x2d')]);_0x2ea49b[_0x5b23('0x22')](_0x321638);break;default:_0x2ea49b=_['isNil'](_0x32987a[_0x5b23('0x20')])?[]:_0x32987a[_0x5b23('0x20')][_0x5b23('0x25')](',');}var _0x163078={'id':util[_0x5b23('0xb')](_0x5b23('0x2e'),_0xb501ec,_0x32987a['id'],_0x32987a[_0x5b23('0x1c')]),'condition':require('./interval')[_0x5b23('0x2f')](_0xb501ec,getIntervals(_0x5a7b23[_0x5b23('0x30')],_0x32987a),_0x5a7b23),'consequence':require('./applications/'+_0x32987a['app'])[_0x5b23('0x31')](_0xb501ec,_0x2ea49b,_0x5a7b23,_0xb84240),'p':_0x32987a[_0x5b23('0x32')]||0x0};logger[_0x5b23('0x33')](_0x5b23('0x34'),_0x163078['id'],_0x5b23('0x35'),getIntervals(_0x5a7b23[_0x5b23('0x30')],_0x32987a)['join'](_0x5b23('0x36')));_0x311f01['push'](_0x163078);}else{logger[_0x5b23('0x37')](_0x5b23('0x38'),path[_0x5b23('0x1b')](__dirname,_0x5b23('0x18'),_0x32987a[_0x5b23('0x1c')]+_0x5b23('0x1d')));}}_0x5a7b23['rules'][_0xb501ec]=new RuleEngine(_0x311f01);_0x5a7b23[_0x5b23('0x12')][_0xb501ec][_0x5b23('0x39')](_0xb84240,function(_0x42c95c){logger[_0x5b23('0x33')]('Applications\x20executed',JSON[_0x5b23('0x3a')](_0x42c95c['matchPath']));if(_0x5a7b23['rules'][_0xb501ec]){_0x5a7b23[_0x5b23('0x12')][_0xb501ec]['emit'](_0x5b23('0x3b'));}});return _0x4e0f88({'code':0xc8,'message':_0xb84240});}else{if(_0x2ad9b7){logger['info'](util[_0x5b23('0xb')]('Skipped\x20routing\x20for\x20%s',_0xb501ec));}else{logger['info'](_0x5b23('0x3c'));}return _0x4e0f88({'code':0xc8,'message':_0xb84240});}}catch(_0x22b8f3){logger[_0x5b23('0x37')](_0x22b8f3[_0x5b23('0x3d')]);return _0x3c9db5(_0x55331d[_0x5b23('0x37')](0x1f4,_0x22b8f3));}}return _0x3c9db5('routing\x20is\x20empty');});},'AcceptMessage':function(_0xf99fab){var _0x454c6f=this;return new Promise(function(_0x50869a,_0x7ea309){if(_0xf99fab[_0x5b23('0x3e')]&&_0xf99fab[_0x5b23('0x3e')]['id']){if(_0x5a7b23[_0x5b23('0x3f')][_0xf99fab['agent']['id']]){_0x5a7b23[_0x5b23('0x3f')][_0xf99fab['agent']['id']]['busy']=![];_0x5a7b23[_0x5b23('0x3f')][_0xf99fab[_0x5b23('0x3e')]['id']]['busyQueue']=undefined;}}if(_0xf99fab[_0x5b23('0x14')]&&_0xf99fab[_0x5b23('0x14')]['id']){try{var _0x13df6b=getId(_0xf99fab['channel'],_0xf99fab[_0x5b23('0x14')]?_0xf99fab['message']['id']:0x0,_0xf99fab[_0x5b23('0x15')]?_0xf99fab[_0x5b23('0x15')]['id']:0x0);if(_0x5a7b23[_0x5b23('0x12')][_0x13df6b]){_0x5a7b23[_0x5b23('0x12')][_0x13df6b]['emit'](_0x5b23('0x40'));if(rpc[_0xf99fab['channel']+'QueueReport']){rpc[_0xf99fab[_0x5b23('0x13')]+_0x5b23('0x41')][_0x5b23('0x42')](_0x13df6b,{'UserId':_0xf99fab['message'][_0x5b23('0x43')]})[_0x5b23('0x44')](function(){logger['error'](_0x5b23('0x45'));});}}return _0x50869a({'code':0xc8,'message':_0xf99fab});}catch(_0x45b4d8){logger[_0x5b23('0x37')](_0x45b4d8[_0x5b23('0x3d')]);return _0x7ea309(_0x454c6f[_0x5b23('0x37')](0x1f4,_0x45b4d8));}}logger['error']('message\x20is\x20empty');return _0x7ea309(_0x454c6f[_0x5b23('0x37')](0x1f4,_0x5b23('0x46')));});},'RejectMessage':function(_0x374e55){var _0x5a1abc=this;return new Promise(function(_0x10124c,_0x3101ce){if(_0x374e55[_0x5b23('0x3e')]&&_0x374e55[_0x5b23('0x3e')]['id']){try{if(_0x5a7b23[_0x5b23('0x3f')][_0x374e55[_0x5b23('0x3e')]['id']]){_0x5a7b23['agents'][_0x374e55[_0x5b23('0x3e')]['id']][_0x5b23('0x47')]=![];_0x5a7b23[_0x5b23('0x3f')][_0x374e55[_0x5b23('0x3e')]['id']]['busyQueue']=undefined;}return _0x10124c({'code':0xc8,'message':_0x374e55});}catch(_0x1e320c){logger[_0x5b23('0x37')](_0x1e320c['stack']);return _0x3101ce(_0x5a1abc[_0x5b23('0x37')](0x1f4,_0x1e320c));}}logger['error'](_0x5b23('0x46'));return _0x3101ce(_0x5a1abc[_0x5b23('0x37')](0x1f4,_0x5b23('0x46')));});},'AbandonInteraction':function(_0x142439){var _0x18bd40=this;return new Promise(function(_0x556419,_0x1bcf22){if(_0x142439[_0x5b23('0x13')]&&_0x142439[_0x5b23('0x15')]&&_0x142439[_0x5b23('0x15')]['id']){try{var _0x5b406e=getId(_0x142439[_0x5b23('0x13')],_0x142439['message']?_0x142439[_0x5b23('0x14')]['id']:0x0,_0x142439[_0x5b23('0x15')]?_0x142439[_0x5b23('0x15')]['id']:0x0);if(_0x5a7b23[_0x5b23('0x12')][_0x5b406e]){_0x5a7b23['rules'][_0x5b406e][_0x5b23('0x48')](_0x5b23('0x40'));}return _0x556419({'code':0xc8,'message':_0x142439});}catch(_0x34874c){logger[_0x5b23('0x37')](_0x34874c[_0x5b23('0x3d')]);return _0x1bcf22(_0x18bd40['error'](0x1f4,_0x34874c));}}logger[_0x5b23('0x37')](_0x5b23('0x46'));return _0x1bcf22(_0x18bd40[_0x5b23('0x37')](0x1f4,_0x5b23('0x46')));});},'AgentCapacity':function(_0x3b093e){var _0x3c9673=this;return new Promise(function(_0x276745,_0x245e63){if(_0x5a7b23[_0x5b23('0x3f')][_0x5b23('0x49')](_0x3b093e['id'])){for(var _0x55dc1d in _0x3b093e[_0x5b23('0x4a')]){if(_0x3b093e[_0x5b23('0x4a')][_0x5b23('0x49')](_0x55dc1d)){if(_0x5a7b23['agents'][_0x3b093e['id']]['hasOwnProperty'](_0x55dc1d+'CurrentCapacity')){_0x5a7b23[_0x5b23('0x3f')][_0x3b093e['id']][_0x55dc1d+_0x5b23('0x4b')]=parseInt(_0x3b093e['capacity'][_0x55dc1d],0xa);}}}_0x5a7b23['agents'][_0x3b093e['id']][_0x5b23('0x4c')]();return _0x276745({'code':0xc8,'message':_0x5a7b23[_0x5b23('0x3f')][_0x3b093e['id']]});}else{return _0x245e63(_0x3c9673[_0x5b23('0x37')](0x1f4,_0x5b23('0x4d')));}});},'Agents':function(_0x3c6875){return new Promise(function(_0x38b245){var _0x2f7931=_[_0x5b23('0x4e')](_0x5a7b23[_0x5b23('0x3f')]);if(_0x3c6875&&_0x3c6875['id']){var _0x5289c9=_[_0x5b23('0x4f')](_0x2f7931,function(_0xbfdc26){return _0xbfdc26['id']===_0x3c6875['id'];});_0x38b245(_0x5289c9);}else{_0x38b245({'count':_0x2f7931[_0x5b23('0x19')],'rows':_0x2f7931});}});},'ChatQueues':function(){return new Promise(function(_0x2be261){var _0x483264=[];for(var _0x36eeda in _0x5a7b23[_0x5b23('0x50')]){if(_0x5a7b23['chatQueues']['hasOwnProperty'](_0x36eeda)){var _0x5a9528=_0x5a7b23[_0x5b23('0x50')][_0x36eeda];var _0x21b54d={'id':_0x5a9528['id'],'available':_0x5a9528[_0x5b23('0x51')],'loggedIn':_0x5a9528['loggedIn'],'name':_0x5a9528[_0x5b23('0x52')],'paused':_0x5a9528[_0x5b23('0x53')],'waiting':_0x5a9528[_0x5b23('0x54')]};_0x483264[_0x5b23('0x22')](_0x21b54d);}}_0x2be261({'count':_0x483264['length'],'rows':_0x483264});});},'MailQueues':function(){return new Promise(function(_0x297cc3){var _0x193d26=[];for(var _0x1b715d in _0x5a7b23[_0x5b23('0x55')]){if(_0x5a7b23[_0x5b23('0x55')]['hasOwnProperty'](_0x1b715d)){var _0x5575e7=_0x5a7b23[_0x5b23('0x55')][_0x1b715d];var _0x550e48={'id':_0x5575e7['id'],'available':_0x5575e7[_0x5b23('0x51')],'loggedIn':_0x5575e7[_0x5b23('0x56')],'name':_0x5575e7[_0x5b23('0x52')],'paused':_0x5575e7['paused'],'waiting':_0x5575e7[_0x5b23('0x54')]};_0x193d26[_0x5b23('0x22')](_0x550e48);}}_0x297cc3({'count':_0x193d26['length'],'rows':_0x193d26});});},'OpenchannelQueues':function(){return new Promise(function(_0x57b647){var _0x1fe205=[];for(var _0x1b7ab0 in _0x5a7b23[_0x5b23('0x57')]){if(_0x5a7b23[_0x5b23('0x57')]['hasOwnProperty'](_0x1b7ab0)){var _0x33843f=_0x5a7b23[_0x5b23('0x57')][_0x1b7ab0];var _0xf6796e={'id':_0x33843f['id'],'available':_0x33843f[_0x5b23('0x51')],'loggedIn':_0x33843f[_0x5b23('0x56')],'name':_0x33843f[_0x5b23('0x52')],'paused':_0x33843f[_0x5b23('0x53')],'waiting':_0x33843f[_0x5b23('0x54')]};_0x1fe205['push'](_0xf6796e);}}_0x57b647({'count':_0x1fe205[_0x5b23('0x19')],'rows':_0x1fe205});});},'SmsQueues':function(){return new Promise(function(_0x371119){var _0x16450f=[];for(var _0x3d4056 in _0x5a7b23[_0x5b23('0x58')]){if(_0x5a7b23['smsQueues'][_0x5b23('0x49')](_0x3d4056)){var _0x2595e6=_0x5a7b23[_0x5b23('0x58')][_0x3d4056];var _0x2b4666={'id':_0x2595e6['id'],'available':_0x2595e6[_0x5b23('0x51')],'loggedIn':_0x2595e6['loggedIn'],'name':_0x2595e6[_0x5b23('0x52')],'paused':_0x2595e6[_0x5b23('0x53')],'waiting':_0x2595e6['waiting']};_0x16450f['push'](_0x2b4666);}}_0x371119({'count':_0x16450f[_0x5b23('0x19')],'rows':_0x16450f});});},'FaxQueues':function(){return new Promise(function(_0x2cd001){var _0x115c5e=[];for(var _0x25cfef in _0x5a7b23[_0x5b23('0x59')]){if(_0x5a7b23[_0x5b23('0x59')]['hasOwnProperty'](_0x25cfef)){var _0xf9a73d=_0x5a7b23[_0x5b23('0x59')][_0x25cfef];var _0x58c1d1={'id':_0xf9a73d['id'],'available':_0xf9a73d[_0x5b23('0x51')],'loggedIn':_0xf9a73d[_0x5b23('0x56')],'name':_0xf9a73d['name'],'paused':_0xf9a73d[_0x5b23('0x53')],'waiting':_0xf9a73d[_0x5b23('0x54')]};_0x115c5e[_0x5b23('0x22')](_0x58c1d1);}}_0x2cd001({'count':_0x115c5e['length'],'rows':_0x115c5e});});},'WhatsappQueues':function(){return new Promise(function(_0x26034e){var _0x30b88d=[];for(var _0x1be071 in _0x5a7b23['whatsappQueues']){if(_0x5a7b23[_0x5b23('0x5a')][_0x5b23('0x49')](_0x1be071)){var _0x4adcb0=_0x5a7b23[_0x5b23('0x5a')][_0x1be071];var _0x32e413={'id':_0x4adcb0['id'],'available':_0x4adcb0[_0x5b23('0x51')],'loggedIn':_0x4adcb0[_0x5b23('0x56')],'name':_0x4adcb0[_0x5b23('0x52')],'paused':_0x4adcb0[_0x5b23('0x53')],'waiting':_0x4adcb0[_0x5b23('0x54')]};_0x30b88d['push'](_0x32e413);}}_0x26034e({'count':_0x30b88d[_0x5b23('0x19')],'rows':_0x30b88d});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3cb771){var _0x37cccb=_[_0x5b23('0x4e')](_0x5a7b23[_0x5b23('0x5b')]);_0x3cb771({'count':_0x37cccb[_0x5b23('0x19')],'rows':_0x37cccb});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2781c1){var _0x440925=_[_0x5b23('0x4e')](_0x5a7b23[_0x5b23('0x5c')]);_0x2781c1({'count':_0x440925[_0x5b23('0x19')],'rows':_0x440925});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1b7bff){var _0x2a4098=_[_0x5b23('0x4e')](_0x5a7b23['openchannelQueuesWaitingInteractions']);_0x1b7bff({'count':_0x2a4098[_0x5b23('0x19')],'rows':_0x2a4098});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x337d8a){var _0x5936b2=_[_0x5b23('0x4e')](_0x5a7b23[_0x5b23('0x5d')]);_0x337d8a({'count':_0x5936b2[_0x5b23('0x19')],'rows':_0x5936b2});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x796010){var _0x1d590c=_[_0x5b23('0x4e')](_0x5a7b23[_0x5b23('0x5e')]);_0x796010({'count':_0x1d590c[_0x5b23('0x19')],'rows':_0x1d590c});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4194a6){var _0x28cb60=_[_0x5b23('0x4e')](_0x5a7b23[_0x5b23('0x5f')]);_0x4194a6({'count':_0x28cb60[_0x5b23('0x19')],'rows':_0x28cb60});});}};var _0xceb8c1=jayson['server'](_0x4a4a38)['http']();_0xceb8c1['on'](_0x5b23('0x37'),function(_0x5ca922){logger[_0x5b23('0x37')](JSON['stringify'](_0x5ca922));return _0xf69a11(_0x5ca922);});_0xceb8c1[_0x5b23('0x11')](0x232c,_0x5b23('0x60'),function(){console[_0x5b23('0x61')](_0x5b23('0x62'),0x232c);return _0xae2f4d(_0x5b23('0x63')+0x232c);});});}; \ No newline at end of file +var _0x2c91=['error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','CurrentCapacity','capacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','paused','mailQueues','name','openchannelQueues','smsQueues','faxQueues','waiting','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','condition','./applications/','priority','info','Push\x20new\x20rule','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','Skipped\x20routing\x20for\x20%s','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x2c91,0x158));var _0x12c9=function(_0xe60e7d,_0x131a0a){_0xe60e7d=_0xe60e7d-0x0;var _0xefdb55=_0x2c91[_0xe60e7d];return _0xefdb55;};'use strict';var _=require(_0x12c9('0x0'));var util=require(_0x12c9('0x1'));var path=require(_0x12c9('0x2'));var fs=require('fs');var jayson=require(_0x12c9('0x3'));var BPromise=require(_0x12c9('0x4'));var utils=require(_0x12c9('0x5'));var sUtils=require(_0x12c9('0x6'));var logger=require(_0x12c9('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0x12c9('0x8')),'mailQueueReport':require(_0x12c9('0x9')),'chatQueueReport':require(_0x12c9('0xa')),'smsQueueReport':require(_0x12c9('0xb')),'faxQueueReport':require(_0x12c9('0xc')),'whatsappQueueReport':require(_0x12c9('0xd'))};var RuleEngine=require(_0x12c9('0xe'));function getId(_0x55c40a,_0x283633,_0x2cbffe){return util['format'](_0x12c9('0xf'),_0x55c40a,_0x283633||0x0,_0x2cbffe||0x0);}function getIntervals(_0x397004,_0x4fa1de){var _0x6addcf=[];if(!_[_0x12c9('0x10')](_0x4fa1de['IntervalId'])&&!_[_0x12c9('0x10')](_0x397004[_0x4fa1de[_0x12c9('0x11')]])&&!_['isNil'](_0x397004[_0x4fa1de[_0x12c9('0x11')]][_0x12c9('0x12')])){_0x6addcf=_[_0x12c9('0x13')](_0x397004[_0x4fa1de[_0x12c9('0x11')]][_0x12c9('0x12')],_0x12c9('0x14'));}else if(!_['isNil'](_0x4fa1de[_0x12c9('0x14')])){_0x6addcf=[_0x4fa1de[_0x12c9('0x14')]];}return _0x6addcf;}exports[_0x12c9('0x15')]=function(_0x4d0388){_0x4d0388['rules']={};return new BPromise(function(_0x490854,_0x4e20b0){var _0x57b3a6={'Start':function(_0x9fa35){var _0x4e4cbf=this;return new Promise(function(_0x3a83b4,_0x4460d5){if(_0x9fa35){try{var _0x1d7716=[];var _0x146506=getId(_0x9fa35[_0x12c9('0x16')],_0x9fa35['message']?_0x9fa35[_0x12c9('0x17')]['id']:0x0,_0x9fa35[_0x12c9('0x18')]?_0x9fa35[_0x12c9('0x18')]['id']:0x0);var _0x38c12e=sUtils[_0x12c9('0x19')](_0x4d0388,_0x9fa35);if(_0x9fa35[_0x12c9('0x1a')]||!_0x38c12e&&_0x9fa35[_0x12c9('0x1b')]&&_[_0x12c9('0x1c')](_0x9fa35['applications'])&&_0x9fa35[_0x12c9('0x1b')]['length']){for(var _0x38ba03=0x0;_0x38ba03<_0x9fa35[_0x12c9('0x1b')][_0x12c9('0x1d')];_0x38ba03+=0x1){var _0x17675e=_0x9fa35[_0x12c9('0x1b')][_0x38ba03];if(fs['existsSync'](path[_0x12c9('0x1e')](__dirname,_0x12c9('0x1b'),_0x17675e[_0x12c9('0x1f')]+_0x12c9('0x20')))){var _0x370126=[];switch(_0x17675e[_0x12c9('0x1f')][_0x12c9('0x21')]()){case _0x12c9('0x22'):var _0x210a77=_0x17675e[_0x12c9('0x23')][_0x12c9('0x24')](',');if(_0x9fa35['channel']===_0x12c9('0x25')){_0x370126[_0x12c9('0x26')](_0x210a77[0x0]);_0x370126[_0x12c9('0x26')](_0x210a77[0x1]);_0x370126[_0x12c9('0x26')](_0x210a77[_0x12c9('0x27')](0x2,_0x210a77[_0x12c9('0x1d')])[_0x12c9('0x1e')](','));}else{_0x370126[_0x12c9('0x26')](_0x210a77[0x0]);_0x370126[_0x12c9('0x26')](_0x210a77[_0x12c9('0x27')](0x1,_0x210a77[_0x12c9('0x1d')])[_0x12c9('0x1e')](','));}break;case _0x12c9('0x28'):var _0x2224ce=_0x17675e[_0x12c9('0x23')][_0x12c9('0x24')](',');_0x370126[_0x12c9('0x26')](_0x2224ce[0x0]);_0x370126[_0x12c9('0x26')](_0x2224ce[0x1]);_0x370126[_0x12c9('0x26')](_0x2224ce[_0x12c9('0x27')](0x2,_0x2224ce['length'])[_0x12c9('0x1e')](','));break;case _0x12c9('0x29'):var _0x125154=_0x17675e[_0x12c9('0x23')][_0x12c9('0x24')](',');_0x370126[_0x12c9('0x26')](_0x125154[0x0]);_0x370126[_0x12c9('0x26')](_0x125154[0x1]);_0x370126['push'](_0x125154[0x2]);_0x370126[_0x12c9('0x26')](_0x125154[0x3]);_0x370126[_0x12c9('0x26')](_0x125154[_0x12c9('0x27')](0x4,_0x125154[_0x12c9('0x1d')])[_0x12c9('0x1e')](','));break;case'amazonlex':var _0x238239=_0x17675e['appdata'][_0x12c9('0x24')](',');_0x370126[_0x12c9('0x26')](_0x238239[0x0]);_0x370126[_0x12c9('0x26')](_0x238239[0x1]);_0x370126[_0x12c9('0x26')](_0x238239[0x2]);_0x370126[_0x12c9('0x26')](_0x238239[0x3]);_0x370126[_0x12c9('0x26')](_0x238239[_0x12c9('0x27')](0x4,_0x238239[_0x12c9('0x1d')])[_0x12c9('0x1e')](','));break;case'message':_0x370126['push'](_0x17675e[_0x12c9('0x23')]);break;case _0x12c9('0x2a'):_0x370126[_0x12c9('0x26')](_0x17675e[_0x12c9('0x2b')]);_0x370126[_0x12c9('0x26')](_0x17675e[_0x12c9('0x23')]);break;case _0x12c9('0x2c'):var _0x5bec7a=utils[_0x12c9('0x2d')](_0x9fa35[_0x12c9('0x2e')][_0x12c9('0x2f')],_0x9fa35);var _0x49958b=_0x17675e[_0x12c9('0x23')][_0x12c9('0x24')](',');_0x370126['push'](_0x49958b[0x0]);_0x370126[_0x12c9('0x26')](_0x49958b[0x1]);_0x370126[_0x12c9('0x26')](_0x49958b[0x2]);_0x370126[_0x12c9('0x26')](_0x49958b[0x3]);_0x370126['push'](_0x49958b[0x4]);_0x370126[_0x12c9('0x26')](_0x49958b[0x5]);_0x370126[_0x12c9('0x26')](_0x49958b[0x6]);_0x370126[_0x12c9('0x26')](_0x49958b[0x7]);_0x370126[_0x12c9('0x26')](_0x49958b[0x8]);_0x370126[_0x12c9('0x26')](_0x49958b[0x9]);_0x370126[_0x12c9('0x26')](_0x49958b[0xa]);_0x370126[_0x12c9('0x26')](_0x9fa35[_0x12c9('0x18')]['id']);_0x370126[_0x12c9('0x26')](_0x9fa35[_0x12c9('0x17')]['id']);_0x370126['push'](_0x17675e[_0x12c9('0x30')]);_0x370126[_0x12c9('0x26')](_0x9fa35[_0x12c9('0x18')][_0x12c9('0x31')]);_0x370126[_0x12c9('0x26')](_0x9fa35['body'][_0x12c9('0x32')]);_0x370126['push'](_0x5bec7a);break;default:_0x370126=_[_0x12c9('0x10')](_0x17675e[_0x12c9('0x23')])?[]:_0x17675e[_0x12c9('0x23')]['split'](',');}var _0x4c4324={'id':util[_0x12c9('0x33')](_0x12c9('0x34'),_0x146506,_0x17675e['id'],_0x17675e[_0x12c9('0x1f')]),'condition':require(_0x12c9('0x35'))[_0x12c9('0x36')](_0x146506,getIntervals(_0x4d0388['intervals'],_0x17675e),_0x4d0388),'consequence':require(_0x12c9('0x37')+_0x17675e[_0x12c9('0x1f')])['consequence'](_0x146506,_0x370126,_0x4d0388,_0x9fa35),'p':_0x17675e[_0x12c9('0x38')]||0x0};logger[_0x12c9('0x39')](_0x12c9('0x3a'),_0x4c4324['id'],'on\x20interval',getIntervals(_0x4d0388[_0x12c9('0x3b')],_0x17675e)[_0x12c9('0x1e')]('\x20|\x20'));_0x1d7716[_0x12c9('0x26')](_0x4c4324);}else{logger[_0x12c9('0x3c')](_0x12c9('0x3d'),path[_0x12c9('0x1e')](__dirname,_0x12c9('0x1b'),_0x17675e[_0x12c9('0x1f')]+_0x12c9('0x20')));}}_0x4d0388['rules'][_0x146506]=new RuleEngine(_0x1d7716);_0x4d0388[_0x12c9('0x3e')][_0x146506][_0x12c9('0x3f')](_0x9fa35,function(_0x49a9a1){logger[_0x12c9('0x39')](_0x12c9('0x40'),JSON[_0x12c9('0x41')](_0x49a9a1[_0x12c9('0x42')]));if(_0x4d0388[_0x12c9('0x3e')][_0x146506]){_0x4d0388[_0x12c9('0x3e')][_0x146506][_0x12c9('0x43')]('complete');}});return _0x3a83b4({'code':0xc8,'message':_0x9fa35});}else{if(_0x38c12e){logger[_0x12c9('0x39')](util['format'](_0x12c9('0x44'),_0x146506));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x3a83b4({'code':0xc8,'message':_0x9fa35});}}catch(_0x5a1281){logger[_0x12c9('0x3c')](_0x5a1281['stack']);return _0x4460d5(_0x4e4cbf[_0x12c9('0x3c')](0x1f4,_0x5a1281));}}return _0x4460d5(_0x12c9('0x45'));});},'AcceptMessage':function(_0x2e3fee){var _0x44ef48=this;return new Promise(function(_0x443570,_0x2a482f){if(_0x2e3fee[_0x12c9('0x46')]&&_0x2e3fee['agent']['id']){if(_0x4d0388[_0x12c9('0x47')][_0x2e3fee[_0x12c9('0x46')]['id']]){_0x4d0388[_0x12c9('0x47')][_0x2e3fee[_0x12c9('0x46')]['id']]['busy']=![];_0x4d0388[_0x12c9('0x47')][_0x2e3fee['agent']['id']][_0x12c9('0x48')]=undefined;}}if(_0x2e3fee[_0x12c9('0x17')]&&_0x2e3fee[_0x12c9('0x17')]['id']){try{var _0x1dcdea=getId(_0x2e3fee['channel'],_0x2e3fee[_0x12c9('0x17')]?_0x2e3fee[_0x12c9('0x17')]['id']:0x0,_0x2e3fee[_0x12c9('0x18')]?_0x2e3fee['interaction']['id']:0x0);if(_0x4d0388[_0x12c9('0x3e')][_0x1dcdea]){_0x4d0388['rules'][_0x1dcdea][_0x12c9('0x43')](_0x12c9('0x49'));if(rpc[_0x2e3fee['channel']+'QueueReport']){rpc[_0x2e3fee['channel']+_0x12c9('0x4a')][_0x12c9('0x4b')](_0x1dcdea,{'UserId':_0x2e3fee[_0x12c9('0x17')]['UserId']})['catch'](function(){logger[_0x12c9('0x3c')](_0x12c9('0x4c'));});}}return _0x443570({'code':0xc8,'message':_0x2e3fee});}catch(_0x5b8695){logger[_0x12c9('0x3c')](_0x5b8695[_0x12c9('0x4d')]);return _0x2a482f(_0x44ef48[_0x12c9('0x3c')](0x1f4,_0x5b8695));}}logger[_0x12c9('0x3c')](_0x12c9('0x4e'));return _0x2a482f(_0x44ef48[_0x12c9('0x3c')](0x1f4,_0x12c9('0x4e')));});},'RejectMessage':function(_0x434ab3){var _0x5a9bcc=this;return new Promise(function(_0x45eda7,_0x3ba110){if(_0x434ab3[_0x12c9('0x46')]&&_0x434ab3[_0x12c9('0x46')]['id']){try{if(_0x4d0388[_0x12c9('0x47')][_0x434ab3['agent']['id']]){_0x4d0388['agents'][_0x434ab3[_0x12c9('0x46')]['id']]['busy']=![];_0x4d0388['agents'][_0x434ab3[_0x12c9('0x46')]['id']][_0x12c9('0x48')]=undefined;}return _0x45eda7({'code':0xc8,'message':_0x434ab3});}catch(_0x494c33){logger[_0x12c9('0x3c')](_0x494c33[_0x12c9('0x4d')]);return _0x3ba110(_0x5a9bcc[_0x12c9('0x3c')](0x1f4,_0x494c33));}}logger[_0x12c9('0x3c')](_0x12c9('0x4e'));return _0x3ba110(_0x5a9bcc[_0x12c9('0x3c')](0x1f4,_0x12c9('0x4e')));});},'AbandonInteraction':function(_0xd7f3c2){var _0x2662d7=this;return new Promise(function(_0x22b7c2,_0x7cbae8){if(_0xd7f3c2[_0x12c9('0x16')]&&_0xd7f3c2[_0x12c9('0x18')]&&_0xd7f3c2[_0x12c9('0x18')]['id']){try{var _0x422411=getId(_0xd7f3c2[_0x12c9('0x16')],_0xd7f3c2['message']?_0xd7f3c2[_0x12c9('0x17')]['id']:0x0,_0xd7f3c2[_0x12c9('0x18')]?_0xd7f3c2[_0x12c9('0x18')]['id']:0x0);if(_0x4d0388[_0x12c9('0x3e')][_0x422411]){_0x4d0388[_0x12c9('0x3e')][_0x422411][_0x12c9('0x43')](_0x12c9('0x49'));}return _0x22b7c2({'code':0xc8,'message':_0xd7f3c2});}catch(_0xae69aa){logger[_0x12c9('0x3c')](_0xae69aa[_0x12c9('0x4d')]);return _0x7cbae8(_0x2662d7['error'](0x1f4,_0xae69aa));}}logger[_0x12c9('0x3c')]('message\x20is\x20empty');return _0x7cbae8(_0x2662d7[_0x12c9('0x3c')](0x1f4,_0x12c9('0x4e')));});},'AgentCapacity':function(_0x34cf97){var _0x4493a5=this;return new Promise(function(_0x4f1ba2,_0xdd8c25){if(_0x4d0388[_0x12c9('0x47')][_0x12c9('0x4f')](_0x34cf97['id'])){for(var _0x1c3edc in _0x34cf97['capacity']){if(_0x34cf97['capacity']['hasOwnProperty'](_0x1c3edc)){if(_0x4d0388[_0x12c9('0x47')][_0x34cf97['id']][_0x12c9('0x4f')](_0x1c3edc+_0x12c9('0x50'))){_0x4d0388[_0x12c9('0x47')][_0x34cf97['id']][_0x1c3edc+_0x12c9('0x50')]=parseInt(_0x34cf97[_0x12c9('0x51')][_0x1c3edc],0xa);}}}_0x4d0388['agents'][_0x34cf97['id']][_0x12c9('0x52')]();return _0x4f1ba2({'code':0xc8,'message':_0x4d0388[_0x12c9('0x47')][_0x34cf97['id']]});}else{return _0xdd8c25(_0x4493a5[_0x12c9('0x3c')](0x1f4,_0x12c9('0x53')));}});},'Agents':function(_0x1fe4b6){return new Promise(function(_0x2d4b49){var _0x12b71c=_[_0x12c9('0x54')](_0x4d0388['agents']);if(_0x1fe4b6&&_0x1fe4b6['id']){var _0xf85ec8=_[_0x12c9('0x55')](_0x12b71c,function(_0x3441f8){return _0x3441f8['id']===_0x1fe4b6['id'];});_0x2d4b49(_0xf85ec8);}else{_0x2d4b49({'count':_0x12b71c[_0x12c9('0x1d')],'rows':_0x12b71c});}});},'ChatQueues':function(){return new Promise(function(_0x4779d3){var _0x35a689=[];for(var _0x2d042e in _0x4d0388['chatQueues']){if(_0x4d0388[_0x12c9('0x56')][_0x12c9('0x4f')](_0x2d042e)){var _0x2e41e1=_0x4d0388[_0x12c9('0x56')][_0x2d042e];var _0x31eba1={'id':_0x2e41e1['id'],'available':_0x2e41e1[_0x12c9('0x57')],'loggedIn':_0x2e41e1[_0x12c9('0x58')],'name':_0x2e41e1['name'],'paused':_0x2e41e1[_0x12c9('0x59')],'waiting':_0x2e41e1['waiting']};_0x35a689['push'](_0x31eba1);}}_0x4779d3({'count':_0x35a689[_0x12c9('0x1d')],'rows':_0x35a689});});},'MailQueues':function(){return new Promise(function(_0x39ce7b){var _0x57e31a=[];for(var _0x1f84e7 in _0x4d0388['mailQueues']){if(_0x4d0388[_0x12c9('0x5a')][_0x12c9('0x4f')](_0x1f84e7)){var _0x10cec1=_0x4d0388[_0x12c9('0x5a')][_0x1f84e7];var _0x589648={'id':_0x10cec1['id'],'available':_0x10cec1[_0x12c9('0x57')],'loggedIn':_0x10cec1[_0x12c9('0x58')],'name':_0x10cec1[_0x12c9('0x5b')],'paused':_0x10cec1[_0x12c9('0x59')],'waiting':_0x10cec1['waiting']};_0x57e31a[_0x12c9('0x26')](_0x589648);}}_0x39ce7b({'count':_0x57e31a[_0x12c9('0x1d')],'rows':_0x57e31a});});},'OpenchannelQueues':function(){return new Promise(function(_0x25cdc8){var _0x4b1072=[];for(var _0x12dfd4 in _0x4d0388[_0x12c9('0x5c')]){if(_0x4d0388['openchannelQueues'][_0x12c9('0x4f')](_0x12dfd4)){var _0x2917db=_0x4d0388[_0x12c9('0x5c')][_0x12dfd4];var _0xe915d7={'id':_0x2917db['id'],'available':_0x2917db[_0x12c9('0x57')],'loggedIn':_0x2917db['loggedIn'],'name':_0x2917db[_0x12c9('0x5b')],'paused':_0x2917db['paused'],'waiting':_0x2917db['waiting']};_0x4b1072[_0x12c9('0x26')](_0xe915d7);}}_0x25cdc8({'count':_0x4b1072[_0x12c9('0x1d')],'rows':_0x4b1072});});},'SmsQueues':function(){return new Promise(function(_0x55c11f){var _0x5f1d23=[];for(var _0x5e4cf0 in _0x4d0388[_0x12c9('0x5d')]){if(_0x4d0388[_0x12c9('0x5d')]['hasOwnProperty'](_0x5e4cf0)){var _0x3c1c8a=_0x4d0388[_0x12c9('0x5d')][_0x5e4cf0];var _0x3f201a={'id':_0x3c1c8a['id'],'available':_0x3c1c8a['available'],'loggedIn':_0x3c1c8a[_0x12c9('0x58')],'name':_0x3c1c8a['name'],'paused':_0x3c1c8a[_0x12c9('0x59')],'waiting':_0x3c1c8a['waiting']};_0x5f1d23[_0x12c9('0x26')](_0x3f201a);}}_0x55c11f({'count':_0x5f1d23[_0x12c9('0x1d')],'rows':_0x5f1d23});});},'FaxQueues':function(){return new Promise(function(_0x2857ca){var _0x13bea6=[];for(var _0x467b66 in _0x4d0388['faxQueues']){if(_0x4d0388[_0x12c9('0x5e')][_0x12c9('0x4f')](_0x467b66)){var _0x53945c=_0x4d0388['faxQueues'][_0x467b66];var _0x1dce7a={'id':_0x53945c['id'],'available':_0x53945c[_0x12c9('0x57')],'loggedIn':_0x53945c[_0x12c9('0x58')],'name':_0x53945c[_0x12c9('0x5b')],'paused':_0x53945c[_0x12c9('0x59')],'waiting':_0x53945c[_0x12c9('0x5f')]};_0x13bea6[_0x12c9('0x26')](_0x1dce7a);}}_0x2857ca({'count':_0x13bea6[_0x12c9('0x1d')],'rows':_0x13bea6});});},'WhatsappQueues':function(){return new Promise(function(_0xb58388){var _0x5b031a=[];for(var _0x31c845 in _0x4d0388[_0x12c9('0x60')]){if(_0x4d0388[_0x12c9('0x60')]['hasOwnProperty'](_0x31c845)){var _0x55579c=_0x4d0388['whatsappQueues'][_0x31c845];var _0x193550={'id':_0x55579c['id'],'available':_0x55579c[_0x12c9('0x57')],'loggedIn':_0x55579c[_0x12c9('0x58')],'name':_0x55579c['name'],'paused':_0x55579c[_0x12c9('0x59')],'waiting':_0x55579c['waiting']};_0x5b031a[_0x12c9('0x26')](_0x193550);}}_0xb58388({'count':_0x5b031a[_0x12c9('0x1d')],'rows':_0x5b031a});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3dff8e){var _0x2f9fe6=_[_0x12c9('0x54')](_0x4d0388['chatQueuesWaitingInteractions']);_0x3dff8e({'count':_0x2f9fe6[_0x12c9('0x1d')],'rows':_0x2f9fe6});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3c80e7){var _0x57b87a=_[_0x12c9('0x54')](_0x4d0388[_0x12c9('0x61')]);_0x3c80e7({'count':_0x57b87a[_0x12c9('0x1d')],'rows':_0x57b87a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2fb544){var _0x3dc0e3=_[_0x12c9('0x54')](_0x4d0388[_0x12c9('0x62')]);_0x2fb544({'count':_0x3dc0e3['length'],'rows':_0x3dc0e3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4d33b0){var _0x58fd5c=_[_0x12c9('0x54')](_0x4d0388['smsQueuesWaitingInteractions']);_0x4d33b0({'count':_0x58fd5c[_0x12c9('0x1d')],'rows':_0x58fd5c});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x48fde3){var _0x4d9e4b=_[_0x12c9('0x54')](_0x4d0388['faxQueuesWaitingInteractions']);_0x48fde3({'count':_0x4d9e4b[_0x12c9('0x1d')],'rows':_0x4d9e4b});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1027d7){var _0x47a0c2=_[_0x12c9('0x54')](_0x4d0388[_0x12c9('0x63')]);_0x1027d7({'count':_0x47a0c2[_0x12c9('0x1d')],'rows':_0x47a0c2});});}};var _0x35a087=jayson[_0x12c9('0x64')](_0x57b3a6)[_0x12c9('0x65')]();_0x35a087['on'](_0x12c9('0x3c'),function(_0x3979b8){logger[_0x12c9('0x3c')](JSON['stringify'](_0x3979b8));return _0x4e20b0(_0x3979b8);});_0x35a087[_0x12c9('0x15')](0x232c,_0x12c9('0x66'),function(){console[_0x12c9('0x67')](_0x12c9('0x68'),0x232c);return _0x490854('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 9e31859..9801fe5 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 _0x13c5=['some','info','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','iftime','../../../config/logger','routing','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop'];(function(_0x2a36b6,_0x429807){var _0x29fda2=function(_0x39c6a0){while(--_0x39c6a0){_0x2a36b6['push'](_0x2a36b6['shift']());}};_0x29fda2(++_0x429807);}(_0x13c5,0x151));var _0x513c=function(_0x2a19b8,_0xe48aed){_0x2a19b8=_0x2a19b8-0x0;var _0x400663=_0x13c5[_0x2a19b8];return _0x400663;};'use strict';var _=require(_0x513c('0x0'));var iftime=require('../../../utils/iftime')[_0x513c('0x1')];var logger=require(_0x513c('0x2'))(_0x513c('0x3'));exports[_0x513c('0x4')]=function(_0x2b4188,_0xfcd61b,_0x32a107){return function(_0x3bc5d9){if(_0x32a107['rules']&&!_0x32a107[_0x513c('0x5')][_0x2b4188]){logger['info'](_0x513c('0x6'),_0x2b4188);return _0x3bc5d9[_0x513c('0x7')]();}var _0x4a7762=_0xfcd61b['map'](function(_0x2ec2a8){return iftime(_0x2ec2a8);});var _0x3f3fe0=_[_0x513c('0x8')](_0x4a7762);if(_0x3f3fe0){logger[_0x513c('0x9')](_0x513c('0xa'),_0x2b4188,_0xfcd61b[_0x513c('0xb')](_0x513c('0xc')),_0x3f3fe0);_0x3bc5d9[_0x513c('0xd')](_0x3f3fe0);}else{logger[_0x513c('0x9')](_0x513c('0xe'),_0x2b4188,_0xfcd61b['join']('\x20|\x20'));_0x3bc5d9[_0x513c('0x7')]();}};}; \ No newline at end of file +var _0x8407=['\x20|\x20','lodash','../../../utils/iftime','iftime','../../../config/logger','routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','some'];(function(_0x285680,_0x18ce0e){var _0x4140ae=function(_0x388bd2){while(--_0x388bd2){_0x285680['push'](_0x285680['shift']());}};_0x4140ae(++_0x18ce0e);}(_0x8407,0xfd));var _0x7840=function(_0x35cfe0,_0xd51474){_0x35cfe0=_0x35cfe0-0x0;var _0x5bb7a9=_0x8407[_0x35cfe0];return _0x5bb7a9;};'use strict';var _=require(_0x7840('0x0'));var iftime=require(_0x7840('0x1'))[_0x7840('0x2')];var logger=require(_0x7840('0x3'))(_0x7840('0x4'));exports[_0x7840('0x5')]=function(_0x10ff88,_0x5d6256,_0x27fc18){return function(_0x344c40){if(_0x27fc18[_0x7840('0x6')]&&!_0x27fc18[_0x7840('0x6')][_0x10ff88]){logger[_0x7840('0x7')](_0x7840('0x8'),_0x10ff88);return _0x344c40[_0x7840('0x9')]();}var _0x204cf9=_0x5d6256['map'](function(_0x4eea7a){return iftime(_0x4eea7a);});var _0x5632f5=_[_0x7840('0xa')](_0x204cf9);if(_0x5632f5){logger[_0x7840('0x7')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x10ff88,_0x5d6256['join']('\x20|\x20'),_0x5632f5);_0x344c40['when'](_0x5632f5);}else{logger['info']('[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s',_0x10ff88,_0x5d6256['join'](_0x7840('0xb')));_0x344c40['stop']();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index f7b7cd5..000e787 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 _0x3c81=['CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','called','connectedlinename','info','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','isNil','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request'];(function(_0x53c449,_0x1f7488){var _0x40ff03=function(_0x5bc0a9){while(--_0x5bc0a9){_0x53c449['push'](_0x53c449['shift']());}};_0x40ff03(++_0x1f7488);}(_0x3c81,0x102));var _0x13c8=function(_0x182f03,_0x12a63f){_0x182f03=_0x182f03-0x0;var _0x95ca5e=_0x3c81[_0x182f03];return _0x95ca5e;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x252f26,_0x131d0b){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x252f26['uniqueid'],_0x252f26[_0x13c8('0x2')],_0x252f26[_0x13c8('0x3')],_0x252f26[_0x13c8('0x4')],_0x252f26[_0x13c8('0x5')],_0x252f26[_0x13c8('0x6')],_0x252f26[_0x13c8('0x7')],_0x252f26[_0x13c8('0x8')]));if(_0x252f26['queue']){utils[_0x13c8('0x9')](_0x252f26['queue'])[_0x13c8('0xa')](function(_0x296463){if(_0x296463){_0x252f26[_0x13c8('0xb')]=_0x296463[_0x13c8('0xb')];_0x252f26[_0x13c8('0xc')]=_0x252f26[_0x13c8('0xd')]?_0x296463[_0x13c8('0xe')]:![];_0x252f26[_0x13c8('0xf')]=_0x252f26[_0x13c8('0xc')]?_0x296463[_0x13c8('0x10')]:0x0;}utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);});}else{utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);}if(_0x131d0b){delete transfers[_0x252f26['uniqueid']];}else{delete agents[_0x252f26[_0x13c8('0x13')]];}}exports[_0x13c8('0x14')]=function(_0x2304b5){try{utils[_0x13c8('0x15')](util['format'](_0x13c8('0x16'),_0x2304b5['uniqueid']),_0x2304b5);agents[_0x2304b5['destuniqueid']]=_0x2304b5;agents[_0x2304b5['destuniqueid']][_0x13c8('0x17')]=utils['now']();agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x18');agents[_0x2304b5[_0x13c8('0x13')]]['connectedlinenum']=null;agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x19')]=null;utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x1c'),_0x2304b5[_0x13c8('0x1d')],agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x4')],_0x2304b5[_0x13c8('0x13')]));}catch(_0x31d122){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x16'),_0x2304b5[_0x13c8('0x1d')]),_0x31d122);}};exports[_0x13c8('0x1f')]=function(_0x313ea3){try{if(!_['isNil'](agents[_0x313ea3[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x313ea3);utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x21'),_0x313ea3[_0x13c8('0x1d')],agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x4')],_0x313ea3['destuniqueid']));agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x1f')]=!![];agents[_0x313ea3['destuniqueid']]['agentringnoanswerAt']=utils[_0x13c8('0x22')]();agents[_0x313ea3[_0x13c8('0x13')]]['lastevent']='timeout';agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x23')]='timeout';agents[_0x313ea3['destuniqueid']][_0x13c8('0x24')]=_0x313ea3['ringtime']?parseInt(_0x313ea3['ringtime'])/0x3e8:0x0;agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x25')]=0x0;unanswered[_0x13c8('0x26')](_0x313ea3['destuniqueid']);}}catch(_0x5ef2f7){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x5ef2f7);}};exports[_0x13c8('0x27')]=function(_0x220d40){try{_[_0x13c8('0x28')](agents,function(_0x4a1b9c,_0x109cb8){if(_0x4a1b9c[_0x13c8('0x1d')]==_0x220d40['uniqueid']&&!_['includes'](unanswered,_0x4a1b9c[_0x13c8('0x13')])){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x220d40);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2a'),_0x220d40[_0x13c8('0x1d')],_0x4a1b9c[_0x13c8('0x4')],_0x4a1b9c[_0x13c8('0x13')]));_0x4a1b9c[_0x13c8('0x1f')]=!![];_0x4a1b9c[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x4a1b9c['lastevent']='abandoned';_0x4a1b9c[_0x13c8('0x23')]=_0x13c8('0x2c');_0x4a1b9c['holdtime']=_0x220d40[_0x13c8('0x24')];_0x4a1b9c['talktime']=0x0;writeDB(_0x4a1b9c);}});}catch(_0x1fdf7d){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x1fdf7d);}};exports[_0x13c8('0x2d')]=function(_0x2039e7){try{if(agents[_0x2039e7[_0x13c8('0x13')]]){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0x2039e7);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2f'),_0x2039e7[_0x13c8('0x1d')],agents[_0x2039e7['destuniqueid']]['membername'],_0x2039e7['destuniqueid']));agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x7')]=_0x2039e7[_0x13c8('0x7')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x19')]=_0x2039e7[_0x13c8('0x19')];agents[_0x2039e7['destuniqueid']]['holdtime']=_0x2039e7[_0x13c8('0x31')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x32');_['forIn'](agents,function(_0x35e1e7,_0x4bd627){if(_0x35e1e7[_0x13c8('0x13')]!=_0x2039e7[_0x13c8('0x13')]&&_0x35e1e7[_0x13c8('0x1d')]==_0x2039e7[_0x13c8('0x1d')]){_0x35e1e7[_0x13c8('0x25')]=0x0;_0x35e1e7[_0x13c8('0x24')]=_0x2039e7[_0x13c8('0x31')];_0x35e1e7[_0x13c8('0x1f')]=!![];_0x35e1e7[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x35e1e7[_0x13c8('0x8')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x23')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x34')]=_0x2039e7[_0x13c8('0x13')];_0x35e1e7[_0x13c8('0x35')]=_0x2039e7[_0x13c8('0x4')];writeDB(_0x35e1e7);}});}}catch(_0xc5eb86){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0xc5eb86);}};exports[_0x13c8('0xd')]=function(_0x44ee66){try{if(!_['isNil'](agents[_0x44ee66[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x44ee66);utils['info'](util['format'](_0x13c8('0x37'),_0x44ee66[_0x13c8('0x1d')],agents[_0x44ee66[_0x13c8('0x13')]]['membername'],_0x44ee66['destuniqueid']));agents[_0x44ee66['destuniqueid']][_0x13c8('0xd')]=!![];agents[_0x44ee66['destuniqueid']][_0x13c8('0x38')]=utils['now']();agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x25')]=utils[_0x13c8('0x39')](agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x38')],agents[_0x44ee66[_0x13c8('0x13')]]['agentconnectAt']);agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x23')]=_0x44ee66['reason'];agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x3a');writeDB(agents[_0x44ee66[_0x13c8('0x13')]]);}}catch(_0x38486a){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x38486a);}};exports[_0x13c8('0x3b')]=function(_0x185d18){try{if(!_['isNil'](agents[_0x185d18[_0x13c8('0x3c')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18[_0x13c8('0x1d')]),_0x185d18);utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x3e'),_0x185d18[_0x13c8('0x1d')],agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x4')],agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')]));agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x3f')]=!![];agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x40')]=_0x13c8('0x41');agents[_0x185d18['transfereruniqueid']][_0x13c8('0x42')]=_0x185d18[_0x13c8('0x43')];agents[_0x185d18[_0x13c8('0x3c')]]['transferuniqueid']=agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')];}}catch(_0x14a738){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18['uniqueid']),_0x14a738);}};exports[_0x13c8('0x44')]=function(_0x554792){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792['origtransfereruniqueid']),_0x554792);if(_0x554792[_0x13c8('0x46')]==_0x554792[_0x13c8('0x47')]){if(!_['isNil'](agents[_0x554792[_0x13c8('0x48')]])){utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4')]));agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x554792['secondtransfereruniqueid']]['transferexten']=_0x554792[_0x13c8('0x4a')];agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x46')];}if(_0x554792[_0x13c8('0x4c')]&&agents[_0x554792[_0x13c8('0x4c')]]){agents[_0x554792[_0x13c8('0x4c')]]['agententerreason']=0x1;transfers[_0x554792['transfereeuniqueid']]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x4c')]]);transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4e')]=agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x4e')];transfers[_0x554792[_0x13c8('0x4c')]]['agentcalledAt']=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4f')]=0x2;}}else if(_0x554792[_0x13c8('0x48')]==_0x554792[_0x13c8('0x50')]){if(!_[_0x13c8('0x51')](agents[_0x554792[_0x13c8('0x46')]])){utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x4')]));agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792[_0x13c8('0x46')]]['transfertype']=_0x13c8('0x52');agents[_0x554792[_0x13c8('0x46')]]['transferexten']=_0x554792[_0x13c8('0x53')];agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x48')];}if(_0x554792[_0x13c8('0x54')]&&agents[_0x554792[_0x13c8('0x54')]]){agents[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x1;transfers[_0x554792[_0x13c8('0x54')]]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x54')]]);transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4e')]=agents[_0x554792[_0x13c8('0x46')]]['calleridname'];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x17')]=utils[_0x13c8('0x22')]();transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x2;}}}catch(_0x55e5ba){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792[_0x13c8('0x46')]),_0x55e5ba);}};exports['hangup']=function(_0x16b409){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x55'),_0x16b409[_0x13c8('0x1d')]),_0x16b409);if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409[_0x13c8('0x1d')]]['reason']===_0x13c8('0x56')){if(_0x16b409[_0x13c8('0x57')]==='21'){agents[_0x16b409[_0x13c8('0x1d')]]['reason']=_0x13c8('0x58');agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']='rejected';}utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x59'),_0x16b409['uniqueid'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);var _0x2d8dfe=unanswered['indexOf'](_0x16b409[_0x13c8('0x1d')]);if(_0x2d8dfe>-0x1){unanswered[_0x13c8('0x5a')](_0x2d8dfe,0x1);}}if(transfers[_0x16b409[_0x13c8('0x1d')]]){transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0xd')]=!![];transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x25')]=utils['diffTime'](transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')],transfers[_0x16b409['uniqueid']]['agentconnectAt']);transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=_0x13c8('0x5b');transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]=_0x13c8('0x3a');utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x59'),_0x16b409[_0x13c8('0x1d')],transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],transfers[_0x16b409['uniqueid']][_0x13c8('0x23')],transfers[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(transfers[_0x16b409[_0x13c8('0x1d')]],!![]);}if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409['uniqueid']][_0x13c8('0x30')]){agents[_0x16b409['uniqueid']][_0x13c8('0xd')]=!![];agents[_0x16b409['uniqueid']][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();agents[_0x16b409[_0x13c8('0x1d')]]['talktime']=utils[_0x13c8('0x39')](agents[_0x16b409['uniqueid']]['agentcompleteAt'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x30')]);agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=agents[_0x16b409['uniqueid']]['transfer']?_0x13c8('0x3f'):'agent';agents[_0x16b409['uniqueid']][_0x13c8('0x8')]=_0x13c8('0x3a');utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x16b409[_0x13c8('0x1d')],agents[_0x16b409['uniqueid']]['membername'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);}}catch(_0x551563){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x55'),_0x16b409['uniqueid']),_0x551563);}}; \ No newline at end of file +var _0x9c00=['acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','format','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','origtransfereruniqueid','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','[%s][agents][hangup]','lodash','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x9c00,0x1a0));var _0x09c0=function(_0x30066f,_0x5891c9){_0x30066f=_0x30066f-0x0;var _0x1ad673=_0x9c00[_0x30066f];return _0x1ad673;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e32e7,_0xe0d293){utils[_0x09c0('0x2')](util['format'](_0x09c0('0x3'),_0x5e32e7[_0x09c0('0x4')],_0x5e32e7[_0x09c0('0x5')],_0x5e32e7[_0x09c0('0x6')],_0x5e32e7[_0x09c0('0x7')],_0x5e32e7['interface'],_0x5e32e7['calleridnum'],_0x5e32e7[_0x09c0('0x8')],_0x5e32e7[_0x09c0('0x9')]));if(_0x5e32e7[_0x09c0('0x6')]){utils[_0x09c0('0xa')](_0x5e32e7[_0x09c0('0x6')])['then'](function(_0x6558ca){if(_0x6558ca){_0x5e32e7[_0x09c0('0xb')]=_0x6558ca[_0x09c0('0xb')];_0x5e32e7[_0x09c0('0xc')]=_0x5e32e7[_0x09c0('0xd')]?_0x6558ca[_0x09c0('0xe')]:![];_0x5e32e7[_0x09c0('0xf')]=_0x5e32e7[_0x09c0('0xc')]?_0x6558ca[_0x09c0('0x10')]:0x0;}utils[_0x09c0('0x11')](_0x09c0('0x12'),_0x5e32e7);});}else{utils[_0x09c0('0x11')](_0x09c0('0x12'),_0x5e32e7);}if(_0xe0d293){delete transfers[_0x5e32e7[_0x09c0('0x4')]];}else{delete agents[_0x5e32e7[_0x09c0('0x13')]];}}exports[_0x09c0('0x14')]=function(_0x6149a8){try{utils[_0x09c0('0x15')](util[_0x09c0('0x16')](_0x09c0('0x17'),_0x6149a8[_0x09c0('0x4')]),_0x6149a8);agents[_0x6149a8[_0x09c0('0x13')]]=_0x6149a8;agents[_0x6149a8[_0x09c0('0x13')]][_0x09c0('0x18')]=utils[_0x09c0('0x19')]();agents[_0x6149a8[_0x09c0('0x13')]]['lastevent']='called';agents[_0x6149a8['destuniqueid']][_0x09c0('0x8')]=null;agents[_0x6149a8[_0x09c0('0x13')]][_0x09c0('0x1a')]=null;utils[_0x09c0('0x2')](util['format'](_0x09c0('0x1b'),_0x6149a8['uniqueid'],agents[_0x6149a8['destuniqueid']][_0x09c0('0x7')],_0x6149a8['destuniqueid']));}catch(_0x2cda5e){utils[_0x09c0('0x1c')](util[_0x09c0('0x16')]('[%s][agents][agentcalled]',_0x6149a8[_0x09c0('0x4')]),_0x2cda5e);}};exports[_0x09c0('0x1d')]=function(_0x8ad645){try{if(!_[_0x09c0('0x1e')](agents[_0x8ad645[_0x09c0('0x13')]])){utils[_0x09c0('0x15')](util[_0x09c0('0x16')]('[%s][agents][agentringnoanswer]',_0x8ad645[_0x09c0('0x4')]),_0x8ad645);utils[_0x09c0('0x2')](util[_0x09c0('0x16')](_0x09c0('0x1f'),_0x8ad645['uniqueid'],agents[_0x8ad645['destuniqueid']][_0x09c0('0x7')],_0x8ad645[_0x09c0('0x13')]));agents[_0x8ad645[_0x09c0('0x13')]][_0x09c0('0x1d')]=!![];agents[_0x8ad645['destuniqueid']][_0x09c0('0x20')]=utils[_0x09c0('0x19')]();agents[_0x8ad645['destuniqueid']][_0x09c0('0x9')]=_0x09c0('0x21');agents[_0x8ad645[_0x09c0('0x13')]][_0x09c0('0x22')]=_0x09c0('0x21');agents[_0x8ad645[_0x09c0('0x13')]][_0x09c0('0x23')]=_0x8ad645[_0x09c0('0x24')]?parseInt(_0x8ad645[_0x09c0('0x24')])/0x3e8:0x0;agents[_0x8ad645[_0x09c0('0x13')]][_0x09c0('0x25')]=0x0;unanswered['push'](_0x8ad645[_0x09c0('0x13')]);}}catch(_0x1bdde9){utils['error'](util[_0x09c0('0x16')]('[%s][agents][agentringnoanswer]',_0x8ad645[_0x09c0('0x4')]),_0x1bdde9);}};exports['queuecallerabandon']=function(_0x3ac8e4){try{_[_0x09c0('0x26')](agents,function(_0x108409,_0x4159bc){if(_0x108409['uniqueid']==_0x3ac8e4['uniqueid']&&!_[_0x09c0('0x27')](unanswered,_0x108409[_0x09c0('0x13')])){utils[_0x09c0('0x15')](util['format'](_0x09c0('0x28'),_0x3ac8e4['uniqueid']),_0x3ac8e4);utils[_0x09c0('0x2')](util[_0x09c0('0x16')](_0x09c0('0x29'),_0x3ac8e4['uniqueid'],_0x108409[_0x09c0('0x7')],_0x108409[_0x09c0('0x13')]));_0x108409[_0x09c0('0x1d')]=!![];_0x108409[_0x09c0('0x20')]=utils[_0x09c0('0x19')]();_0x108409[_0x09c0('0x9')]=_0x09c0('0x2a');_0x108409['reason']=_0x09c0('0x2a');_0x108409[_0x09c0('0x23')]=_0x3ac8e4[_0x09c0('0x23')];_0x108409[_0x09c0('0x25')]=0x0;writeDB(_0x108409);}});}catch(_0x2c1ad3){utils['error'](util[_0x09c0('0x16')](_0x09c0('0x28'),_0x3ac8e4[_0x09c0('0x4')]),_0x2c1ad3);}};exports[_0x09c0('0x2b')]=function(_0x353454){try{if(agents[_0x353454['destuniqueid']]){utils[_0x09c0('0x15')](util[_0x09c0('0x16')](_0x09c0('0x2c'),_0x353454[_0x09c0('0x4')]),_0x353454);utils[_0x09c0('0x2')](util[_0x09c0('0x16')](_0x09c0('0x2d'),_0x353454['uniqueid'],agents[_0x353454[_0x09c0('0x13')]][_0x09c0('0x7')],_0x353454[_0x09c0('0x13')]));agents[_0x353454[_0x09c0('0x13')]][_0x09c0('0x2e')]=utils['now']();agents[_0x353454['destuniqueid']]['connectedlinenum']=_0x353454['connectedlinenum'];agents[_0x353454[_0x09c0('0x13')]][_0x09c0('0x1a')]=_0x353454[_0x09c0('0x1a')];agents[_0x353454[_0x09c0('0x13')]][_0x09c0('0x23')]=_0x353454['ringtime'];agents[_0x353454[_0x09c0('0x13')]][_0x09c0('0x9')]='connect';_[_0x09c0('0x26')](agents,function(_0x5d50b9,_0x3ee063){if(_0x5d50b9['destuniqueid']!=_0x353454[_0x09c0('0x13')]&&_0x5d50b9[_0x09c0('0x4')]==_0x353454['uniqueid']){_0x5d50b9[_0x09c0('0x25')]=0x0;_0x5d50b9[_0x09c0('0x23')]=_0x353454['ringtime'];_0x5d50b9[_0x09c0('0x1d')]=!![];_0x5d50b9[_0x09c0('0x20')]=utils[_0x09c0('0x19')]();_0x5d50b9[_0x09c0('0x9')]=_0x09c0('0x2f');_0x5d50b9[_0x09c0('0x22')]='answered_elsewhere';_0x5d50b9[_0x09c0('0x30')]=_0x353454[_0x09c0('0x13')];_0x5d50b9[_0x09c0('0x31')]=_0x353454['membername'];writeDB(_0x5d50b9);}});}}catch(_0x193ed2){utils[_0x09c0('0x1c')](util[_0x09c0('0x16')]('[%s][agents][agentconnect]',_0x353454[_0x09c0('0x4')]),_0x193ed2);}};exports[_0x09c0('0xd')]=function(_0x52cd5c){try{if(!_['isNil'](agents[_0x52cd5c[_0x09c0('0x13')]])){utils[_0x09c0('0x15')](util['format'](_0x09c0('0x32'),_0x52cd5c[_0x09c0('0x4')]),_0x52cd5c);utils['info'](util[_0x09c0('0x16')](_0x09c0('0x33'),_0x52cd5c[_0x09c0('0x4')],agents[_0x52cd5c[_0x09c0('0x13')]][_0x09c0('0x7')],_0x52cd5c['destuniqueid']));agents[_0x52cd5c[_0x09c0('0x13')]]['agentcomplete']=!![];agents[_0x52cd5c['destuniqueid']][_0x09c0('0x34')]=utils[_0x09c0('0x19')]();agents[_0x52cd5c[_0x09c0('0x13')]][_0x09c0('0x25')]=utils[_0x09c0('0x35')](agents[_0x52cd5c[_0x09c0('0x13')]]['agentcompleteAt'],agents[_0x52cd5c['destuniqueid']]['agentconnectAt']);agents[_0x52cd5c[_0x09c0('0x13')]][_0x09c0('0x22')]=_0x52cd5c[_0x09c0('0x22')];agents[_0x52cd5c['destuniqueid']][_0x09c0('0x9')]=_0x09c0('0x36');writeDB(agents[_0x52cd5c[_0x09c0('0x13')]]);}}catch(_0x198517){utils[_0x09c0('0x1c')](util[_0x09c0('0x16')](_0x09c0('0x32'),_0x52cd5c[_0x09c0('0x4')]),_0x198517);}};exports[_0x09c0('0x37')]=function(_0x38085c){try{if(!_[_0x09c0('0x1e')](agents[_0x38085c[_0x09c0('0x38')]])){utils[_0x09c0('0x15')](util[_0x09c0('0x16')](_0x09c0('0x39'),_0x38085c[_0x09c0('0x4')]),_0x38085c);utils[_0x09c0('0x2')](util[_0x09c0('0x16')](_0x09c0('0x3a'),_0x38085c[_0x09c0('0x4')],agents[_0x38085c['transfereruniqueid']][_0x09c0('0x7')],agents[_0x38085c[_0x09c0('0x38')]][_0x09c0('0x4')]));agents[_0x38085c[_0x09c0('0x38')]][_0x09c0('0x3b')]=!![];agents[_0x38085c['transfereruniqueid']][_0x09c0('0x3c')]=_0x09c0('0x3d');agents[_0x38085c[_0x09c0('0x38')]]['transferexten']=_0x38085c[_0x09c0('0x3e')];agents[_0x38085c[_0x09c0('0x38')]][_0x09c0('0x3f')]=agents[_0x38085c[_0x09c0('0x38')]][_0x09c0('0x4')];}}catch(_0xebfd6d){utils[_0x09c0('0x1c')](util['format'](_0x09c0('0x39'),_0x38085c[_0x09c0('0x4')]),_0xebfd6d);}};exports[_0x09c0('0x40')]=function(_0x428f9a){try{utils[_0x09c0('0x15')](util[_0x09c0('0x16')](_0x09c0('0x41'),_0x428f9a['origtransfereruniqueid']),_0x428f9a);if(_0x428f9a['origtransfereruniqueid']==_0x428f9a[_0x09c0('0x42')]){if(!_[_0x09c0('0x1e')](agents[_0x428f9a[_0x09c0('0x43')]])){utils['info'](util[_0x09c0('0x16')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x428f9a[_0x09c0('0x44')],agents[_0x428f9a[_0x09c0('0x43')]][_0x09c0('0x7')]));agents[_0x428f9a[_0x09c0('0x43')]][_0x09c0('0x3b')]=!![];agents[_0x428f9a[_0x09c0('0x43')]][_0x09c0('0x3c')]='ATTENDED';agents[_0x428f9a[_0x09c0('0x43')]][_0x09c0('0x45')]=_0x428f9a[_0x09c0('0x46')];agents[_0x428f9a[_0x09c0('0x43')]][_0x09c0('0x3f')]=_0x428f9a[_0x09c0('0x44')];}if(_0x428f9a[_0x09c0('0x47')]&&agents[_0x428f9a[_0x09c0('0x47')]]){agents[_0x428f9a[_0x09c0('0x47')]][_0x09c0('0x48')]=0x1;transfers[_0x428f9a[_0x09c0('0x47')]]=_['clone'](agents[_0x428f9a[_0x09c0('0x47')]]);transfers[_0x428f9a[_0x09c0('0x47')]][_0x09c0('0x49')]=agents[_0x428f9a[_0x09c0('0x43')]]['calleridnum'];transfers[_0x428f9a[_0x09c0('0x47')]]['calleridname']=agents[_0x428f9a[_0x09c0('0x43')]][_0x09c0('0x4a')];transfers[_0x428f9a[_0x09c0('0x47')]]['agentcalledAt']=utils['now']();transfers[_0x428f9a[_0x09c0('0x47')]][_0x09c0('0x2e')]=utils[_0x09c0('0x19')]();transfers[_0x428f9a[_0x09c0('0x47')]]['holdtime']=0x0;transfers[_0x428f9a[_0x09c0('0x47')]][_0x09c0('0x48')]=0x2;}}else if(_0x428f9a['secondtransfereruniqueid']==_0x428f9a[_0x09c0('0x4b')]){if(!_[_0x09c0('0x1e')](agents[_0x428f9a[_0x09c0('0x44')]])){utils[_0x09c0('0x2')](util['format'](_0x09c0('0x4c'),_0x428f9a[_0x09c0('0x44')],agents[_0x428f9a[_0x09c0('0x44')]][_0x09c0('0x7')]));agents[_0x428f9a[_0x09c0('0x44')]][_0x09c0('0x3b')]=!![];agents[_0x428f9a[_0x09c0('0x44')]][_0x09c0('0x3c')]=_0x09c0('0x4d');agents[_0x428f9a[_0x09c0('0x44')]][_0x09c0('0x45')]=_0x428f9a[_0x09c0('0x4e')];agents[_0x428f9a[_0x09c0('0x44')]]['transferuniqueid']=_0x428f9a[_0x09c0('0x43')];}if(_0x428f9a[_0x09c0('0x4f')]&&agents[_0x428f9a[_0x09c0('0x4f')]]){agents[_0x428f9a[_0x09c0('0x4f')]][_0x09c0('0x48')]=0x1;transfers[_0x428f9a['transfertargetuniqueid']]=_[_0x09c0('0x50')](agents[_0x428f9a[_0x09c0('0x4f')]]);transfers[_0x428f9a[_0x09c0('0x4f')]][_0x09c0('0x49')]=agents[_0x428f9a['origtransfereruniqueid']][_0x09c0('0x49')];transfers[_0x428f9a[_0x09c0('0x4f')]]['calleridname']=agents[_0x428f9a[_0x09c0('0x44')]][_0x09c0('0x4a')];transfers[_0x428f9a[_0x09c0('0x4f')]][_0x09c0('0x18')]=utils[_0x09c0('0x19')]();transfers[_0x428f9a['transfertargetuniqueid']][_0x09c0('0x2e')]=utils[_0x09c0('0x19')]();transfers[_0x428f9a[_0x09c0('0x4f')]][_0x09c0('0x23')]=0x0;transfers[_0x428f9a[_0x09c0('0x4f')]]['agententerreason']=0x2;}}}catch(_0x422046){utils[_0x09c0('0x1c')](util[_0x09c0('0x16')](_0x09c0('0x41'),_0x428f9a[_0x09c0('0x44')]),_0x422046);}};exports[_0x09c0('0x51')]=function(_0x59c57a){try{utils['debug'](util['format']('[%s][agents][hangup]',_0x59c57a[_0x09c0('0x4')]),_0x59c57a);if(agents[_0x59c57a[_0x09c0('0x4')]]&&agents[_0x59c57a[_0x09c0('0x4')]]['reason']===_0x09c0('0x21')){if(_0x59c57a['cause']==='21'){agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x22')]='rejected';agents[_0x59c57a[_0x09c0('0x4')]]['lastevent']='rejected';}utils[_0x09c0('0x2')](util[_0x09c0('0x16')](_0x09c0('0x52'),_0x59c57a[_0x09c0('0x4')],agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x7')],agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x22')],agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x9')]));writeDB(agents[_0x59c57a['uniqueid']]);var _0x188af2=unanswered[_0x09c0('0x53')](_0x59c57a['uniqueid']);if(_0x188af2>-0x1){unanswered['splice'](_0x188af2,0x1);}}if(transfers[_0x59c57a[_0x09c0('0x4')]]){transfers[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0xd')]=!![];transfers[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x34')]=utils[_0x09c0('0x19')]();transfers[_0x59c57a[_0x09c0('0x4')]]['talktime']=utils[_0x09c0('0x35')](transfers[_0x59c57a['uniqueid']][_0x09c0('0x34')],transfers[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x2e')]);transfers[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x22')]='agent';transfers[_0x59c57a[_0x09c0('0x4')]]['lastevent']=_0x09c0('0x36');utils['info'](util[_0x09c0('0x16')](_0x09c0('0x52'),_0x59c57a[_0x09c0('0x4')],transfers[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x7')],transfers[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x22')],transfers[_0x59c57a['uniqueid']]['lastevent']));writeDB(transfers[_0x59c57a[_0x09c0('0x4')]],!![]);}if(agents[_0x59c57a[_0x09c0('0x4')]]&&agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x2e')]){agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0xd')]=!![];agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x34')]=utils[_0x09c0('0x19')]();agents[_0x59c57a[_0x09c0('0x4')]]['talktime']=utils['diffTime'](agents[_0x59c57a['uniqueid']][_0x09c0('0x34')],agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x2e')]);agents[_0x59c57a['uniqueid']]['reason']=agents[_0x59c57a[_0x09c0('0x4')]]['transfer']?_0x09c0('0x3b'):_0x09c0('0x54');agents[_0x59c57a['uniqueid']][_0x09c0('0x9')]='complete';utils[_0x09c0('0x2')](util[_0x09c0('0x16')](_0x09c0('0x52'),_0x59c57a['uniqueid'],agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x7')],agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x22')],agents[_0x59c57a[_0x09c0('0x4')]][_0x09c0('0x9')]));writeDB(agents[_0x59c57a[_0x09c0('0x4')]]);}}catch(_0x4345a8){utils[_0x09c0('0x1c')](util[_0x09c0('0x16')](_0x09c0('0x55'),_0x59c57a[_0x09c0('0x4')]),_0x4345a8);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 5fed958..e90a4c1 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 _0xbfe6=['toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','attendedtransfer','origtransfereruniqueid','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','split','substring','lastIndexOf','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','calleridnum','connectedlinenum','getUserByInternal','accountcode','then','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','channel','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0xbfe6,0xa6));var _0x6bfe=function(_0x114294,_0x14e0a3){_0x114294=_0x114294-0x0;var _0x907d61=_0xbfe6[_0x114294];return _0x907d61;};'use strict';var _=require(_0x6bfe('0x0'));var util=require(_0x6bfe('0x1'));var utils=require(_0x6bfe('0x2'));var dispositions=[_0x6bfe('0x3'),'FAILED',_0x6bfe('0x4'),'NO\x20ANSWER',_0x6bfe('0x3'),_0x6bfe('0x3'),_0x6bfe('0x5'),_0x6bfe('0x6'),'FAILED',_0x6bfe('0x4'),_0x6bfe('0x4')];var channels={};function writeDB(_0x1d405c){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')](_0x6bfe('0x9'),_0x1d405c[_0x6bfe('0xa')],_0x1d405c['channel'],_0x1d405c[_0x6bfe('0xb')],_0x1d405c[_0x6bfe('0xc')],_0x1d405c['interface'],_0x1d405c[_0x6bfe('0xd')],_0x1d405c[_0x6bfe('0xe')],_0x1d405c['lastevent']));if(_0x1d405c['accountcode']){utils[_0x6bfe('0xf')](_0x1d405c[_0x6bfe('0x10')])[_0x6bfe('0x11')](function(_0x3c457c){if(_0x3c457c){_0x1d405c['UserId']=_0x3c457c['id'];}utils[_0x6bfe('0x12')](_0x6bfe('0x13'),_0x1d405c);});}else{utils[_0x6bfe('0x12')](_0x6bfe('0x13'),_0x1d405c);}if(channels[_0x1d405c[_0x6bfe('0xa')]]){delete channels[_0x1d405c[_0x6bfe('0xa')]];}}exports[_0x6bfe('0x14')]=function(_0x34c537){try{utils['debug'](util[_0x6bfe('0x8')](_0x6bfe('0x15'),_0x34c537[_0x6bfe('0xa')]),_0x34c537);if(_0x34c537[_0x6bfe('0xa')]==_0x34c537[_0x6bfe('0x16')]&&_0x34c537['channel']!=_0x6bfe('0x17')){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')](_0x6bfe('0x18'),_0x34c537[_0x6bfe('0xa')],_0x34c537[_0x6bfe('0x19')],_0x34c537[_0x6bfe('0x1a')]));channels[_0x34c537['uniqueid']]={'uniqueid':_0x34c537['uniqueid'],'accountcode':_0x34c537['accountcode'],'source':_0x34c537['calleridnum'],'destination':_0x34c537[_0x6bfe('0x1a')],'destinationcontext':_0x34c537[_0x6bfe('0x19')],'channel':_0x34c537['channel'],'starttime':utils[_0x6bfe('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x6bfe('0x1c')};}}catch(_0x5656c5){utils[_0x6bfe('0x1d')](util[_0x6bfe('0x8')]('[%s][calls][newchannel]',_0x34c537[_0x6bfe('0xa')]),_0x5656c5);}};exports[_0x6bfe('0x1e')]=function(_0x2c996d){try{utils[_0x6bfe('0x1f')](util[_0x6bfe('0x8')]('[%s][calls][newstate]',_0x2c996d[_0x6bfe('0xa')]),_0x2c996d);if(!_[_0x6bfe('0x20')](channels[_0x2c996d[_0x6bfe('0xa')]])&&_0x2c996d[_0x6bfe('0x21')]==0x6){utils['info'](util[_0x6bfe('0x8')](_0x6bfe('0x22'),_0x2c996d[_0x6bfe('0xa')],_0x2c996d[_0x6bfe('0x19')],_0x2c996d[_0x6bfe('0x23')]));if(_[_0x6bfe('0x20')](channels[_0x2c996d[_0x6bfe('0xa')]][_0x6bfe('0x24')])){channels[_0x2c996d[_0x6bfe('0xa')]][_0x6bfe('0x24')]=utils[_0x6bfe('0x1b')]();}}else if(!_[_0x6bfe('0x20')](channels[_0x2c996d['linkedid']])&&_0x2c996d[_0x6bfe('0x21')]==0x6&&_0x2c996d[_0x6bfe('0x19')]!=_0x6bfe('0x25')){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')](_0x6bfe('0x26'),_0x2c996d[_0x6bfe('0xa')],_0x2c996d[_0x6bfe('0x16')],_0x2c996d[_0x6bfe('0x19')],_0x2c996d[_0x6bfe('0x23')]));channels[_0x2c996d[_0x6bfe('0x16')]][_0x6bfe('0x10')]=_0x2c996d[_0x6bfe('0x10')];channels[_0x2c996d[_0x6bfe('0x16')]][_0x6bfe('0x27')]=_0x2c996d['channel'];if(_[_0x6bfe('0x20')](channels[_0x2c996d[_0x6bfe('0x16')]][_0x6bfe('0x28')])){channels[_0x2c996d[_0x6bfe('0x16')]]['answertime']=utils['now']();}channels[_0x2c996d[_0x6bfe('0x16')]][_0x6bfe('0x29')]=dispositions[_[_0x6bfe('0x2a')](_0x2c996d['channelstate'])]||_0x6bfe('0x5');}}catch(_0x439285){utils[_0x6bfe('0x1d')](util[_0x6bfe('0x8')]('[%s][calls][newstate]',_0x2c996d[_0x6bfe('0xa')]),_0x439285);}};exports[_0x6bfe('0x2b')]=function(_0x16f0e0){try{if(!_[_0x6bfe('0x20')](channels[_0x16f0e0[_0x6bfe('0xa')]])){utils[_0x6bfe('0x1f')](util['format'](_0x6bfe('0x2c'),_0x16f0e0[_0x6bfe('0xa')]),_0x16f0e0);if(_[_0x6bfe('0x20')](channels[_0x16f0e0[_0x6bfe('0xa')]][_0x6bfe('0x2d')])){channels[_0x16f0e0[_0x6bfe('0xa')]][_0x6bfe('0x2d')]=_0x16f0e0[_0x6bfe('0x2e')]+'\x20<'+_0x16f0e0['calleridnum']+'>';}utils['info'](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x16f0e0[_0x6bfe('0xa')],channels[_0x16f0e0[_0x6bfe('0xa')]][_0x6bfe('0x2d')],_0x16f0e0[_0x6bfe('0x2f')]));channels[_0x16f0e0[_0x6bfe('0xa')]][_0x6bfe('0x30')]=utils[_0x6bfe('0x1b')]();channels[_0x16f0e0[_0x6bfe('0xa')]][_0x6bfe('0x31')]=utils[_0x6bfe('0x32')](channels[_0x16f0e0['uniqueid']][_0x6bfe('0x30')],channels[_0x16f0e0['uniqueid']][_0x6bfe('0x33')]);channels[_0x16f0e0['uniqueid']]['billableseconds']=channels[_0x16f0e0[_0x6bfe('0xa')]][_0x6bfe('0x28')]?utils['diffTime'](channels[_0x16f0e0[_0x6bfe('0xa')]][_0x6bfe('0x30')],channels[_0x16f0e0[_0x6bfe('0xa')]]['answertime']):0x0;writeDB(channels[_0x16f0e0[_0x6bfe('0xa')]]);}}catch(_0x5291e5){utils[_0x6bfe('0x1d')](util[_0x6bfe('0x8')](_0x6bfe('0x2c'),_0x16f0e0[_0x6bfe('0xa')]),_0x5291e5);}};exports[_0x6bfe('0x34')]=function(_0x37e1e7){try{if(!_[_0x6bfe('0x20')](channels[_0x37e1e7['localtwolinkedid']])){utils['debug'](util['format']('[%s][calls][attendedtransfer]',_0x37e1e7[_0x6bfe('0x35')]),_0x37e1e7);if(channels[_0x37e1e7[_0x6bfe('0x36')]][_0x6bfe('0x23')]==_0x37e1e7[_0x6bfe('0x37')]){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x37e1e7[_0x6bfe('0x35')],_0x37e1e7['localtwolinkedid'],_0x37e1e7[_0x6bfe('0x38')]));channels[_0x37e1e7[_0x6bfe('0x36')]][_0x6bfe('0x27')]=_0x37e1e7[_0x6bfe('0x38')];channels[_0x37e1e7[_0x6bfe('0x36')]][_0x6bfe('0x39')]='_attended';}else if(channels[_0x37e1e7[_0x6bfe('0x36')]][_0x6bfe('0x23')]=_0x37e1e7[_0x6bfe('0x3a')]){utils['info'](util[_0x6bfe('0x8')](_0x6bfe('0x3b'),_0x37e1e7[_0x6bfe('0x35')],_0x37e1e7[_0x6bfe('0x36')],_0x37e1e7[_0x6bfe('0x3c')]));channels[_0x37e1e7[_0x6bfe('0x36')]][_0x6bfe('0x27')]=_0x37e1e7[_0x6bfe('0x3c')];channels[_0x37e1e7[_0x6bfe('0x36')]][_0x6bfe('0x39')]=_0x6bfe('0x3d');}}}catch(_0x146460){utils[_0x6bfe('0x1d')](util[_0x6bfe('0x8')](_0x6bfe('0x3e'),_0x37e1e7['origtransfereruniqueid']),_0x146460);}};exports[_0x6bfe('0x3f')]=function(_0x7340a2){try{if(!_['isNil'](channels[_0x7340a2[_0x6bfe('0xa')]])){utils[_0x6bfe('0x1f')](util[_0x6bfe('0x8')](_0x6bfe('0x40'),_0x7340a2[_0x6bfe('0xa')]),_0x7340a2);channels[_0x7340a2[_0x6bfe('0xa')]][_0x6bfe('0x41')]=utils[_0x6bfe('0x1b')]();utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')](_0x6bfe('0x42'),_0x7340a2[_0x6bfe('0xa')],channels[_0x7340a2[_0x6bfe('0xa')]][_0x6bfe('0x41')]));}}catch(_0x1f0614){utils[_0x6bfe('0x1d')](util[_0x6bfe('0x8')](_0x6bfe('0x40'),_0x7340a2['uniqueid']),_0x1f0614);}};exports['musiconholdstop']=function(_0x4107cf){try{if(!_[_0x6bfe('0x20')](channels[_0x4107cf[_0x6bfe('0xa')]])){utils[_0x6bfe('0x1f')](util[_0x6bfe('0x8')](_0x6bfe('0x43'),_0x4107cf[_0x6bfe('0xa')]),_0x4107cf);if(!_[_0x6bfe('0x20')](channels[_0x4107cf[_0x6bfe('0xa')]][_0x6bfe('0x41')])){channels[_0x4107cf[_0x6bfe('0xa')]][_0x6bfe('0x44')]+=utils[_0x6bfe('0x32')](utils[_0x6bfe('0x1b')](),channels[_0x4107cf[_0x6bfe('0xa')]]['musiconholdstartAt']);utils[_0x6bfe('0x7')](util['format'](_0x6bfe('0x45'),_0x4107cf[_0x6bfe('0xa')],channels[_0x4107cf[_0x6bfe('0xa')]][_0x6bfe('0x44')]));delete channels[_0x4107cf[_0x6bfe('0xa')]]['musiconholdstartAt'];}}}catch(_0x5dce52){utils['error'](util['format'](_0x6bfe('0x43'),_0x4107cf[_0x6bfe('0xa')]),_0x5dce52);}};exports['varset']=function(_0x3e6e2f){try{if(!_[_0x6bfe('0x20')](channels[_0x3e6e2f[_0x6bfe('0xa')]])){utils[_0x6bfe('0x1f')](util[_0x6bfe('0x8')](_0x6bfe('0x46'),_0x3e6e2f[_0x6bfe('0xa')]),_0x3e6e2f);if(!_[_0x6bfe('0x20')](_0x3e6e2f[_0x6bfe('0x47')][_0x6bfe('0x48')])){utils['info'](util[_0x6bfe('0x8')](_0x6bfe('0x49'),_0x3e6e2f[_0x6bfe('0xa')],_0x3e6e2f['value']));channels[_0x3e6e2f['uniqueid']][_0x6bfe('0x4a')]=_0x3e6e2f[_0x6bfe('0x4b')];}if(!_[_0x6bfe('0x20')](_0x3e6e2f[_0x6bfe('0x47')]['xmd-phone'])){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x3e6e2f[_0x6bfe('0xa')],_0x3e6e2f[_0x6bfe('0x4b')]));channels[_0x3e6e2f[_0x6bfe('0xa')]][_0x6bfe('0x4c')]=_0x3e6e2f[_0x6bfe('0x4b')];channels[_0x3e6e2f[_0x6bfe('0xa')]][_0x6bfe('0x2d')]='\x22'+_0x3e6e2f[_0x6bfe('0x4b')]+'\x22\x20<'+_0x3e6e2f[_0x6bfe('0x4b')]+'>';}if(!_[_0x6bfe('0x20')](_0x3e6e2f[_0x6bfe('0x47')][_0x6bfe('0x4d')])||!_[_0x6bfe('0x20')](_0x3e6e2f['variable'][_0x6bfe('0x4e')])){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')](_0x6bfe('0x4f'),_0x3e6e2f[_0x6bfe('0xa')],!_[_0x6bfe('0x20')](_0x3e6e2f[_0x6bfe('0x47')][_0x6bfe('0x4d')])?_0x6bfe('0x4d'):_0x6bfe('0x4e'),_0x3e6e2f[_0x6bfe('0x4b')]));channels[_0x3e6e2f[_0x6bfe('0xa')]][_0x6bfe('0x2d')]=_0x3e6e2f[_0x6bfe('0x4b')];}if(!_['isNil'](_0x3e6e2f[_0x6bfe('0x47')]['xmd-queue'])||!_[_0x6bfe('0x20')](_0x3e6e2f[_0x6bfe('0x47')][_0x6bfe('0x50')])){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')](_0x6bfe('0x4f'),_0x3e6e2f['uniqueid'],!_['isNil'](_0x3e6e2f[_0x6bfe('0x47')]['xmd-queue'])?_0x6bfe('0x51'):_0x6bfe('0x50'),_0x3e6e2f[_0x6bfe('0x4b')]));channels[_0x3e6e2f['uniqueid']][_0x6bfe('0x52')]=_0x6bfe('0x53');channels[_0x3e6e2f['uniqueid']][_0x6bfe('0x54')]=_0x3e6e2f[_0x6bfe('0x4b')];channels[_0x3e6e2f[_0x6bfe('0xa')]][_0x6bfe('0xb')]=!![];}if(!_[_0x6bfe('0x20')](_0x3e6e2f[_0x6bfe('0x47')]['xmd-contactid'])){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')](_0x6bfe('0x55'),_0x3e6e2f[_0x6bfe('0xa')],_0x3e6e2f[_0x6bfe('0x4b')]));channels[_0x3e6e2f['uniqueid']][_0x6bfe('0x56')]=_0x3e6e2f['value'];}if(!_[_0x6bfe('0x20')](_0x3e6e2f[_0x6bfe('0x47')]['xmd-cdrtype'])){utils[_0x6bfe('0x7')](util['format'](_0x6bfe('0x57'),_0x3e6e2f['uniqueid'],_0x3e6e2f[_0x6bfe('0x4b')]));channels[_0x3e6e2f[_0x6bfe('0xa')]]['type']=_0x3e6e2f[_0x6bfe('0x4b')];}if(!_[_0x6bfe('0x20')](_0x3e6e2f[_0x6bfe('0x47')][_0x6bfe('0x58')])){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')](_0x6bfe('0x59'),_0x3e6e2f[_0x6bfe('0xa')],_0x3e6e2f[_0x6bfe('0x4b')]));channels[_0x3e6e2f[_0x6bfe('0xa')]]['routeid']=_0x3e6e2f[_0x6bfe('0x4b')];}if(!_['isNil'](_0x3e6e2f[_0x6bfe('0x47')]['sipcallid'])){utils[_0x6bfe('0x7')](util[_0x6bfe('0x8')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x3e6e2f[_0x6bfe('0xa')],_0x3e6e2f[_0x6bfe('0x4b')]));channels[_0x3e6e2f['uniqueid']][_0x6bfe('0x5a')]=_0x3e6e2f[_0x6bfe('0x4b')];}}}catch(_0x506307){utils[_0x6bfe('0x1d')](util[_0x6bfe('0x8')](_0x6bfe('0x46'),_0x3e6e2f[_0x6bfe('0xa')]),_0x506307);}};exports[_0x6bfe('0x5b')]=function(_0x45434e){try{if(!_[_0x6bfe('0x20')](channels[_0x45434e[_0x6bfe('0xa')]])){utils[_0x6bfe('0x1f')](util[_0x6bfe('0x8')](_0x6bfe('0x5c'),_0x45434e[_0x6bfe('0xa')]),_0x45434e);utils[_0x6bfe('0x7')](util['format'](_0x6bfe('0x5d'),_0x45434e['uniqueid'],_0x45434e['application'],_0x45434e['appdata']));if(_0x45434e[_0x6bfe('0x5e')][_0x6bfe('0x5f')]()==_0x6bfe('0x60')&&_['startsWith'](_0x45434e[_0x6bfe('0x61')][_0x6bfe('0x5f')](),'cdr')){var _0xc9f2db=_0x45434e[_0x6bfe('0x61')][_0x6bfe('0x62')]('=');var _0x3d5523=_0xc9f2db[0x0][_0x6bfe('0x63')](_0xc9f2db[0x0][_0x6bfe('0x64')]('(')+0x1,_0xc9f2db[0x0][_0x6bfe('0x64')](')'));var _0xba703d=_0xc9f2db[0x1];channels[_0x45434e['uniqueid']][_0x3d5523]=_0xba703d;}if(!_['includes'](['hangup',_0x6bfe('0x65'),_0x6bfe('0x66'),_0x6bfe('0x60'),_0x6bfe('0x67')],_0x45434e[_0x6bfe('0x5e')]['toLowerCase']())){channels[_0x45434e['uniqueid']]['lastapplication']=_0x45434e[_0x6bfe('0x5e')];channels[_0x45434e[_0x6bfe('0xa')]]['lastdata']=_0x45434e[_0x6bfe('0x61')];}}}catch(_0x3de100){utils[_0x6bfe('0x1d')](util[_0x6bfe('0x8')](_0x6bfe('0x5c'),_0x45434e['uniqueid']),_0x3de100);}}; \ No newline at end of file +var _0x11dd=['mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','ANSWERED','FAILED','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','format','context','exten','DOCUMENTATION','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','now','toNumber','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]'];(function(_0x21a6f6,_0x5f2971){var _0x2a222f=function(_0x1d5ec8){while(--_0x1d5ec8){_0x21a6f6['push'](_0x21a6f6['shift']());}};_0x2a222f(++_0x5f2971);}(_0x11dd,0x1d5));var _0xd11d=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x11dd[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xd11d('0x0'));var util=require(_0xd11d('0x1'));var utils=require(_0xd11d('0x2'));var dispositions=['NO\x20ANSWER','FAILED','FAILED',_0xd11d('0x3'),_0xd11d('0x3'),_0xd11d('0x3'),_0xd11d('0x4'),'BUSY','FAILED',_0xd11d('0x5'),'FAILED'];var channels={};function writeDB(_0x25211d){utils[_0xd11d('0x6')](util['format'](_0xd11d('0x7'),_0x25211d['uniqueid'],_0x25211d[_0xd11d('0x8')],_0x25211d['queue'],_0x25211d['membername'],_0x25211d[_0xd11d('0x9')],_0x25211d[_0xd11d('0xa')],_0x25211d[_0xd11d('0xb')],_0x25211d[_0xd11d('0xc')]));if(_0x25211d[_0xd11d('0xd')]){utils[_0xd11d('0xe')](_0x25211d[_0xd11d('0xd')])['then'](function(_0x562255){if(_0x562255){_0x25211d[_0xd11d('0xf')]=_0x562255['id'];}utils[_0xd11d('0x10')]('CreateVoiceCallReport',_0x25211d);});}else{utils[_0xd11d('0x10')](_0xd11d('0x11'),_0x25211d);}if(channels[_0x25211d[_0xd11d('0x12')]]){delete channels[_0x25211d[_0xd11d('0x12')]];}}exports[_0xd11d('0x13')]=function(_0xe6ba90){try{utils[_0xd11d('0x14')](util['format'](_0xd11d('0x15'),_0xe6ba90['uniqueid']),_0xe6ba90);if(_0xe6ba90[_0xd11d('0x12')]==_0xe6ba90[_0xd11d('0x16')]&&_0xe6ba90[_0xd11d('0x8')]!=_0xd11d('0x17')){utils[_0xd11d('0x6')](util[_0xd11d('0x18')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0xe6ba90[_0xd11d('0x12')],_0xe6ba90[_0xd11d('0x19')],_0xe6ba90[_0xd11d('0x1a')]));channels[_0xe6ba90['uniqueid']]={'uniqueid':_0xe6ba90['uniqueid'],'accountcode':_0xe6ba90['accountcode'],'source':_0xe6ba90['calleridnum'],'destination':_0xe6ba90[_0xd11d('0x1a')],'destinationcontext':_0xe6ba90[_0xd11d('0x19')],'channel':_0xe6ba90[_0xd11d('0x8')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd11d('0x3'),'amaflags':_0xd11d('0x1b')};}}catch(_0x4e4d1a){utils['error'](util[_0xd11d('0x18')](_0xd11d('0x15'),_0xe6ba90[_0xd11d('0x12')]),_0x4e4d1a);}};exports[_0xd11d('0x1c')]=function(_0x543906){try{utils[_0xd11d('0x14')](util[_0xd11d('0x18')]('[%s][calls][newstate]',_0x543906[_0xd11d('0x12')]),_0x543906);if(!_[_0xd11d('0x1d')](channels[_0x543906[_0xd11d('0x12')]])&&_0x543906[_0xd11d('0x1e')]==0x6){utils['info'](util[_0xd11d('0x18')](_0xd11d('0x1f'),_0x543906[_0xd11d('0x12')],_0x543906[_0xd11d('0x19')],_0x543906[_0xd11d('0x8')]));if(_['isNil'](channels[_0x543906[_0xd11d('0x12')]][_0xd11d('0x20')])){channels[_0x543906[_0xd11d('0x12')]]['systemanswertime']=utils['now']();}}else if(!_[_0xd11d('0x1d')](channels[_0x543906[_0xd11d('0x16')]])&&_0x543906['channelstate']==0x6&&_0x543906[_0xd11d('0x19')]!=_0xd11d('0x21')){utils[_0xd11d('0x6')](util['format'](_0xd11d('0x22'),_0x543906['uniqueid'],_0x543906['linkedid'],_0x543906['context'],_0x543906[_0xd11d('0x8')]));channels[_0x543906[_0xd11d('0x16')]][_0xd11d('0xd')]=_0x543906[_0xd11d('0xd')];channels[_0x543906[_0xd11d('0x16')]][_0xd11d('0x23')]=_0x543906['channel'];if(_[_0xd11d('0x1d')](channels[_0x543906[_0xd11d('0x16')]][_0xd11d('0x24')])){channels[_0x543906[_0xd11d('0x16')]][_0xd11d('0x24')]=utils[_0xd11d('0x25')]();}channels[_0x543906[_0xd11d('0x16')]]['disposition']=dispositions[_[_0xd11d('0x26')](_0x543906[_0xd11d('0x1e')])]||_0xd11d('0x4');}}catch(_0x4d592f){utils[_0xd11d('0x27')](util[_0xd11d('0x18')]('[%s][calls][newstate]',_0x543906[_0xd11d('0x12')]),_0x4d592f);}};exports[_0xd11d('0x28')]=function(_0x69576a){try{if(!_['isNil'](channels[_0x69576a[_0xd11d('0x12')]])){utils[_0xd11d('0x14')](util[_0xd11d('0x18')](_0xd11d('0x29'),_0x69576a[_0xd11d('0x12')]),_0x69576a);if(_['isNil'](channels[_0x69576a[_0xd11d('0x12')]][_0xd11d('0x2a')])){channels[_0x69576a[_0xd11d('0x12')]][_0xd11d('0x2a')]=_0x69576a[_0xd11d('0x2b')]+'\x20<'+_0x69576a[_0xd11d('0xa')]+'>';}utils[_0xd11d('0x6')](util[_0xd11d('0x18')](_0xd11d('0x2c'),_0x69576a[_0xd11d('0x12')],channels[_0x69576a[_0xd11d('0x12')]][_0xd11d('0x2a')],_0x69576a[_0xd11d('0x2d')]));channels[_0x69576a['uniqueid']]['endtime']=utils['now']();channels[_0x69576a['uniqueid']][_0xd11d('0x2e')]=utils[_0xd11d('0x2f')](channels[_0x69576a[_0xd11d('0x12')]][_0xd11d('0x30')],channels[_0x69576a['uniqueid']][_0xd11d('0x31')]);channels[_0x69576a[_0xd11d('0x12')]][_0xd11d('0x32')]=channels[_0x69576a['uniqueid']][_0xd11d('0x24')]?utils['diffTime'](channels[_0x69576a['uniqueid']][_0xd11d('0x30')],channels[_0x69576a['uniqueid']][_0xd11d('0x24')]):0x0;writeDB(channels[_0x69576a['uniqueid']]);}}catch(_0x5e8948){utils['error'](util[_0xd11d('0x18')]('[%s][calls][hangup]',_0x69576a[_0xd11d('0x12')]),_0x5e8948);}};exports[_0xd11d('0x33')]=function(_0x211937){try{if(!_['isNil'](channels[_0x211937[_0xd11d('0x34')]])){utils[_0xd11d('0x14')](util[_0xd11d('0x18')](_0xd11d('0x35'),_0x211937[_0xd11d('0x36')]),_0x211937);if(channels[_0x211937[_0xd11d('0x34')]]['channel']==_0x211937[_0xd11d('0x37')]){utils[_0xd11d('0x6')](util[_0xd11d('0x18')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x211937[_0xd11d('0x36')],_0x211937[_0xd11d('0x34')],_0x211937[_0xd11d('0x38')]));channels[_0x211937['localtwolinkedid']][_0xd11d('0x23')]=_0x211937[_0xd11d('0x38')];channels[_0x211937[_0xd11d('0x34')]][_0xd11d('0x39')]=_0xd11d('0x3a');}else if(channels[_0x211937[_0xd11d('0x34')]][_0xd11d('0x8')]=_0x211937[_0xd11d('0x3b')]){utils[_0xd11d('0x6')](util[_0xd11d('0x18')](_0xd11d('0x3c'),_0x211937['origtransfereruniqueid'],_0x211937[_0xd11d('0x34')],_0x211937[_0xd11d('0x3d')]));channels[_0x211937[_0xd11d('0x34')]]['destinationchannel']=_0x211937[_0xd11d('0x3d')];channels[_0x211937[_0xd11d('0x34')]][_0xd11d('0x39')]=_0xd11d('0x3a');}}}catch(_0x48b87b){utils[_0xd11d('0x27')](util[_0xd11d('0x18')](_0xd11d('0x35'),_0x211937[_0xd11d('0x36')]),_0x48b87b);}};exports['musiconholdstart']=function(_0x432ba8){try{if(!_['isNil'](channels[_0x432ba8[_0xd11d('0x12')]])){utils['debug'](util[_0xd11d('0x18')]('[%s][calls][musiconholdstart]',_0x432ba8['uniqueid']),_0x432ba8);channels[_0x432ba8['uniqueid']][_0xd11d('0x3e')]=utils[_0xd11d('0x25')]();utils['info'](util[_0xd11d('0x18')](_0xd11d('0x3f'),_0x432ba8['uniqueid'],channels[_0x432ba8[_0xd11d('0x12')]][_0xd11d('0x3e')]));}}catch(_0x52f024){utils['error'](util[_0xd11d('0x18')](_0xd11d('0x40'),_0x432ba8[_0xd11d('0x12')]),_0x52f024);}};exports['musiconholdstop']=function(_0x3a509b){try{if(!_['isNil'](channels[_0x3a509b[_0xd11d('0x12')]])){utils[_0xd11d('0x14')](util[_0xd11d('0x18')](_0xd11d('0x41'),_0x3a509b[_0xd11d('0x12')]),_0x3a509b);if(!_[_0xd11d('0x1d')](channels[_0x3a509b[_0xd11d('0x12')]][_0xd11d('0x3e')])){channels[_0x3a509b[_0xd11d('0x12')]][_0xd11d('0x42')]+=utils[_0xd11d('0x2f')](utils[_0xd11d('0x25')](),channels[_0x3a509b['uniqueid']]['musiconholdstartAt']);utils[_0xd11d('0x6')](util['format'](_0xd11d('0x43'),_0x3a509b[_0xd11d('0x12')],channels[_0x3a509b[_0xd11d('0x12')]][_0xd11d('0x42')]));delete channels[_0x3a509b[_0xd11d('0x12')]][_0xd11d('0x3e')];}}}catch(_0xe49dfc){utils['error'](util[_0xd11d('0x18')](_0xd11d('0x41'),_0x3a509b[_0xd11d('0x12')]),_0xe49dfc);}};exports[_0xd11d('0x44')]=function(_0x3d695d){try{if(!_['isNil'](channels[_0x3d695d[_0xd11d('0x12')]])){utils[_0xd11d('0x14')](util[_0xd11d('0x18')](_0xd11d('0x45'),_0x3d695d[_0xd11d('0x12')]),_0x3d695d);if(!_[_0xd11d('0x1d')](_0x3d695d[_0xd11d('0x46')][_0xd11d('0x47')])){utils[_0xd11d('0x6')](util['format'](_0xd11d('0x48'),_0x3d695d[_0xd11d('0x12')],_0x3d695d[_0xd11d('0x49')]));channels[_0x3d695d[_0xd11d('0x12')]][_0xd11d('0x4a')]=_0x3d695d[_0xd11d('0x49')];}if(!_[_0xd11d('0x1d')](_0x3d695d[_0xd11d('0x46')][_0xd11d('0x4b')])){utils['info'](util[_0xd11d('0x18')](_0xd11d('0x4c'),_0x3d695d[_0xd11d('0x12')],_0x3d695d[_0xd11d('0x49')]));channels[_0x3d695d[_0xd11d('0x12')]][_0xd11d('0x4d')]=_0x3d695d[_0xd11d('0x49')];channels[_0x3d695d[_0xd11d('0x12')]]['callerid']='\x22'+_0x3d695d[_0xd11d('0x49')]+_0xd11d('0x4e')+_0x3d695d['value']+'>';}if(!_[_0xd11d('0x1d')](_0x3d695d['variable']['xmd-callerid-preview'])||!_[_0xd11d('0x1d')](_0x3d695d[_0xd11d('0x46')][_0xd11d('0x4f')])){utils[_0xd11d('0x6')](util[_0xd11d('0x18')](_0xd11d('0x50'),_0x3d695d[_0xd11d('0x12')],!_[_0xd11d('0x1d')](_0x3d695d[_0xd11d('0x46')][_0xd11d('0x51')])?_0xd11d('0x51'):'xmd-callerid',_0x3d695d[_0xd11d('0x49')]));channels[_0x3d695d[_0xd11d('0x12')]]['callerid']=_0x3d695d['value'];}if(!_['isNil'](_0x3d695d[_0xd11d('0x46')][_0xd11d('0x52')])||!_[_0xd11d('0x1d')](_0x3d695d['variable']['xmcs-queue'])){utils[_0xd11d('0x6')](util['format'](_0xd11d('0x50'),_0x3d695d[_0xd11d('0x12')],!_[_0xd11d('0x1d')](_0x3d695d[_0xd11d('0x46')]['xmd-queue'])?_0xd11d('0x52'):_0xd11d('0x53'),_0x3d695d['value']));channels[_0x3d695d[_0xd11d('0x12')]][_0xd11d('0x54')]=_0xd11d('0x55');channels[_0x3d695d['uniqueid']]['lastdata']=_0x3d695d[_0xd11d('0x49')];channels[_0x3d695d[_0xd11d('0x12')]][_0xd11d('0x56')]=!![];}if(!_[_0xd11d('0x1d')](_0x3d695d[_0xd11d('0x46')]['xmd-contactid'])){utils[_0xd11d('0x6')](util[_0xd11d('0x18')](_0xd11d('0x57'),_0x3d695d[_0xd11d('0x12')],_0x3d695d['value']));channels[_0x3d695d[_0xd11d('0x12')]][_0xd11d('0x58')]=_0x3d695d[_0xd11d('0x49')];}if(!_[_0xd11d('0x1d')](_0x3d695d[_0xd11d('0x46')]['xmd-cdrtype'])){utils[_0xd11d('0x6')](util['format'](_0xd11d('0x59'),_0x3d695d['uniqueid'],_0x3d695d[_0xd11d('0x49')]));channels[_0x3d695d[_0xd11d('0x12')]][_0xd11d('0x5a')]=_0x3d695d[_0xd11d('0x49')];}if(!_[_0xd11d('0x1d')](_0x3d695d[_0xd11d('0x46')]['outboundrouteid'])){utils[_0xd11d('0x6')](util[_0xd11d('0x18')](_0xd11d('0x5b'),_0x3d695d[_0xd11d('0x12')],_0x3d695d[_0xd11d('0x49')]));channels[_0x3d695d[_0xd11d('0x12')]]['routeid']=_0x3d695d[_0xd11d('0x49')];}if(!_[_0xd11d('0x1d')](_0x3d695d['variable']['sipcallid'])){utils[_0xd11d('0x6')](util[_0xd11d('0x18')](_0xd11d('0x5c'),_0x3d695d[_0xd11d('0x12')],_0x3d695d[_0xd11d('0x49')]));channels[_0x3d695d[_0xd11d('0x12')]][_0xd11d('0x5d')]=_0x3d695d['value'];}}}catch(_0x5e24b7){utils['error'](util[_0xd11d('0x18')](_0xd11d('0x45'),_0x3d695d[_0xd11d('0x12')]),_0x5e24b7);}};exports['newexten']=function(_0x4f86f7){try{if(!_[_0xd11d('0x1d')](channels[_0x4f86f7[_0xd11d('0x12')]])){utils[_0xd11d('0x14')](util[_0xd11d('0x18')](_0xd11d('0x5e'),_0x4f86f7[_0xd11d('0x12')]),_0x4f86f7);utils[_0xd11d('0x6')](util[_0xd11d('0x18')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x4f86f7[_0xd11d('0x12')],_0x4f86f7[_0xd11d('0x5f')],_0x4f86f7[_0xd11d('0x60')]));if(_0x4f86f7[_0xd11d('0x5f')][_0xd11d('0x61')]()==_0xd11d('0x62')&&_['startsWith'](_0x4f86f7[_0xd11d('0x60')][_0xd11d('0x61')](),_0xd11d('0x63'))){var _0x518a77=_0x4f86f7[_0xd11d('0x60')][_0xd11d('0x64')]('=');var _0x190e4b=_0x518a77[0x0][_0xd11d('0x65')](_0x518a77[0x0][_0xd11d('0x66')]('(')+0x1,_0x518a77[0x0][_0xd11d('0x66')](')'));var _0x1bb373=_0x518a77[0x1];channels[_0x4f86f7[_0xd11d('0x12')]][_0x190e4b]=_0x1bb373;}if(!_[_0xd11d('0x67')]([_0xd11d('0x28'),_0xd11d('0x68'),_0xd11d('0x69'),_0xd11d('0x62'),_0xd11d('0x6a')],_0x4f86f7[_0xd11d('0x5f')]['toLowerCase']())){channels[_0x4f86f7['uniqueid']][_0xd11d('0x54')]=_0x4f86f7[_0xd11d('0x5f')];channels[_0x4f86f7['uniqueid']]['lastdata']=_0x4f86f7[_0xd11d('0x60')];}}}catch(_0xcae48f){utils['error'](util[_0xd11d('0x18')](_0xd11d('0x5e'),_0x4f86f7[_0xd11d('0x12')]),_0xcae48f);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index bc4e304..ac0e84d 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 _0xf2d8=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','managerevent','./utils','info','[core]\x20connected'];(function(_0x3adf85,_0x430450){var _0x55da44=function(_0x237c4a){while(--_0x237c4a){_0x3adf85['push'](_0x3adf85['shift']());}};_0x55da44(++_0x430450);}(_0xf2d8,0x65));var _0x8f2d=function(_0xeadc11,_0x27e378){_0xeadc11=_0xeadc11-0x0;var _0x4257b6=_0xf2d8[_0xeadc11];return _0x4257b6;};'use strict';var utils=require(_0x8f2d('0x0'));exports['connect']=function(){utils[_0x8f2d('0x1')](_0x8f2d('0x2'));};exports['shutdown']=function(){utils[_0x8f2d('0x1')](_0x8f2d('0x3'));};exports[_0x8f2d('0x4')]=function(){utils[_0x8f2d('0x1')](_0x8f2d('0x5'));};exports['error']=function(_0x28ff85){utils[_0x8f2d('0x6')]('[core]\x20error',_0x28ff85);};exports['close']=function(){utils[_0x8f2d('0x1')]('[core]\x20close');};exports[_0x8f2d('0x7')]=function(_0x26dbb0){}; \ No newline at end of file +var _0xcaf8=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','./utils','info','[core]\x20connected'];(function(_0x191f9d,_0x21976f){var _0x58e60d=function(_0x598c0d){while(--_0x598c0d){_0x191f9d['push'](_0x191f9d['shift']());}};_0x58e60d(++_0x21976f);}(_0xcaf8,0x16d));var _0x8caf=function(_0xaf2ea3,_0x1c48f1){_0xaf2ea3=_0xaf2ea3-0x0;var _0x136100=_0xcaf8[_0xaf2ea3];return _0x136100;};'use strict';var utils=require(_0x8caf('0x0'));exports['connect']=function(){utils[_0x8caf('0x1')](_0x8caf('0x2'));};exports['shutdown']=function(){utils[_0x8caf('0x1')](_0x8caf('0x3'));};exports[_0x8caf('0x4')]=function(){utils[_0x8caf('0x1')](_0x8caf('0x5'));};exports[_0x8caf('0x6')]=function(_0x5bba4d){utils[_0x8caf('0x6')]('[core]\x20error',_0x5bba4d);};exports[_0x8caf('0x7')]=function(){utils[_0x8caf('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x8deeca){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index d104a55..5cec3e4 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 _0xb997=['holdtime','lodash','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','uniqueid','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','varset','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','info','value','[%s][dials][dialbegin]','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','error','[%s][dials][dialend]','ANSWER','assign','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime'];(function(_0x217908,_0x456c70){var _0x4b3ef8=function(_0x5526f5){while(--_0x5526f5){_0x217908['push'](_0x217908['shift']());}};_0x4b3ef8(++_0x456c70);}(_0xb997,0x15f));var _0x7b99=function(_0x4e448b,_0x10dee3){_0x4e448b=_0x4e448b-0x0;var _0x13638d=_0xb997[_0x4e448b];return _0x13638d;};'use strict';var _=require(_0x7b99('0x0'));var util=require('util');var utils=require(_0x7b99('0x1'));var dials={};function writeDB(_0x5cc399){utils['info'](util[_0x7b99('0x2')](_0x7b99('0x3'),_0x5cc399['uniqueid'],_0x5cc399[_0x7b99('0x4')],_0x5cc399[_0x7b99('0x5')],_0x5cc399[_0x7b99('0x6')],_0x5cc399[_0x7b99('0x7')],_0x5cc399[_0x7b99('0x8')]));utils[_0x7b99('0x9')]('CreateVoiceDialReport',_0x5cc399);delete dials[_0x5cc399[_0x7b99('0xa')]];}exports[_0x7b99('0xb')]=function(_0x197965){try{utils['debug'](util[_0x7b99('0x2')](_0x7b99('0xc'),_0x197965[_0x7b99('0xa')]),_0x197965);utils['info'](util['format'](_0x7b99('0xd'),_0x197965['uniqueid'],_0x197965[_0x7b99('0xe')],_0x197965[_0x7b99('0xf')]));if(_0x197965[_0x7b99('0xe')][_0x7b99('0x10')]()=='set'&&_[_0x7b99('0x11')](_0x197965[_0x7b99('0xf')]['toLowerCase'](),_0x7b99('0x12'))){var _0x4de459=_0x197965['appdata'][_0x7b99('0x13')]('=');dials[_0x197965[_0x7b99('0xa')]]={'routeId':_0x4de459[0x1]};}}catch(_0x47a5c6){utils['error'](util['format']('[%s][dials][newexten]',_0x197965[_0x7b99('0xa')]),_0x47a5c6);}};exports[_0x7b99('0x14')]=function(_0x21b708){try{utils[_0x7b99('0x15')](util[_0x7b99('0x2')](_0x7b99('0x16'),_0x21b708[_0x7b99('0xa')]),_0x21b708);if(!_[_0x7b99('0x17')](_0x21b708[_0x7b99('0x18')][_0x7b99('0x19')])){utils[_0x7b99('0x1a')](util[_0x7b99('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x21b708['uniqueid'],_0x21b708[_0x7b99('0x1b')]));dials[_0x21b708[_0x7b99('0xa')]]={'routeId':_0x21b708['value']};}}catch(_0x1fda11){utils['error'](util[_0x7b99('0x2')](_0x7b99('0x16'),_0x21b708[_0x7b99('0xa')]),_0x1fda11);}};exports['dialbegin']=function(_0x49de97){try{if(!_['isNil'](dials[_0x49de97[_0x7b99('0xa')]])){utils[_0x7b99('0x15')](util[_0x7b99('0x2')](_0x7b99('0x1c'),_0x49de97[_0x7b99('0xa')]),_0x49de97);dials[_0x49de97['uniqueid']]=_['assign'](dials[_0x49de97[_0x7b99('0xa')]],_0x49de97);dials[_0x49de97[_0x7b99('0xa')]]['starttime']=utils[_0x7b99('0x1d')]();dials[_0x49de97[_0x7b99('0xa')]][_0x7b99('0x1e')]=_0x7b99('0x1f');utils['info'](util[_0x7b99('0x2')](_0x7b99('0x20'),_0x49de97[_0x7b99('0xa')],dials[_0x49de97[_0x7b99('0xa')]][_0x7b99('0x21')]));}}catch(_0x12d3ee){utils[_0x7b99('0x22')](util[_0x7b99('0x2')]('[%s][dials][dialbegin]',_0x49de97[_0x7b99('0xa')]),_0x12d3ee);}};exports['dialend']=function(_0x3a5294){try{if(!_['isNil'](dials[_0x3a5294[_0x7b99('0xa')]])){utils[_0x7b99('0x15')](util[_0x7b99('0x2')](_0x7b99('0x23'),_0x3a5294[_0x7b99('0xa')]),_0x3a5294);dials[_0x3a5294[_0x7b99('0xa')]][_0x7b99('0x8')]=_0x3a5294[_0x7b99('0x8')];if(_0x3a5294[_0x7b99('0x8')]==_0x7b99('0x24')){dials[_0x3a5294['uniqueid']]=_[_0x7b99('0x25')](dials[_0x3a5294[_0x7b99('0xa')]],_0x3a5294);dials[_0x3a5294['uniqueid']][_0x7b99('0x26')]=utils[_0x7b99('0x1d')]();dials[_0x3a5294[_0x7b99('0xa')]][_0x7b99('0x1e')]='connect';utils[_0x7b99('0x1a')](util[_0x7b99('0x2')](_0x7b99('0x27'),_0x3a5294['uniqueid'],_0x3a5294[_0x7b99('0x8')],dials[_0x3a5294[_0x7b99('0xa')]][_0x7b99('0x26')]));}else{utils[_0x7b99('0x1a')](util['format'](_0x7b99('0x28'),_0x3a5294[_0x7b99('0xa')],_0x3a5294['dialstatus']));}}}catch(_0x39e981){utils[_0x7b99('0x22')](util[_0x7b99('0x2')](_0x7b99('0x23'),_0x3a5294['uniqueid']),_0x39e981);}};exports[_0x7b99('0x29')]=function(_0x111b3f){try{if(!_['isNil'](dials[_0x111b3f[_0x7b99('0xa')]])){utils[_0x7b99('0x15')](util['format'](_0x7b99('0x2a'),_0x111b3f[_0x7b99('0xa')]),_0x111b3f);utils[_0x7b99('0x1a')](util[_0x7b99('0x2')](_0x7b99('0x2b'),_0x111b3f[_0x7b99('0xa')],_0x111b3f[_0x7b99('0x6')],_0x111b3f[_0x7b99('0x2c')],_0x111b3f[_0x7b99('0x2d')]));dials[_0x111b3f['uniqueid']]=_[_0x7b99('0x25')](dials[_0x111b3f[_0x7b99('0xa')]],{'endtime':utils[_0x7b99('0x1d')](),'lastevent':_0x7b99('0x2e')});dials[_0x111b3f[_0x7b99('0xa')]]['duration']=utils[_0x7b99('0x2f')](dials[_0x111b3f[_0x7b99('0xa')]][_0x7b99('0x30')],dials[_0x111b3f[_0x7b99('0xa')]]['starttime']);dials[_0x111b3f[_0x7b99('0xa')]][_0x7b99('0x31')]=utils[_0x7b99('0x2f')](dials[_0x111b3f[_0x7b99('0xa')]][_0x7b99('0x26')]||dials[_0x111b3f[_0x7b99('0xa')]]['endtime'],dials[_0x111b3f[_0x7b99('0xa')]][_0x7b99('0x21')]);dials[_0x111b3f[_0x7b99('0xa')]]['billableseconds']=dials[_0x111b3f['uniqueid']][_0x7b99('0x26')]?utils['diffTime'](dials[_0x111b3f[_0x7b99('0xa')]]['endtime'],dials[_0x111b3f['uniqueid']]['answertime']):0x0;writeDB(dials[_0x111b3f[_0x7b99('0xa')]]);}}catch(_0x22d515){utils[_0x7b99('0x22')](util[_0x7b99('0x2')](_0x7b99('0x2a'),_0x111b3f['uniqueid']),_0x22d515);}}; \ No newline at end of file +var _0x5f82=['now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','dialstatus','ANSWER','answertime','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime'];(function(_0x282eab,_0x29f081){var _0x3328f2=function(_0x3e2032){while(--_0x3e2032){_0x282eab['push'](_0x282eab['shift']());}};_0x3328f2(++_0x29f081);}(_0x5f82,0x1f1));var _0x25f8=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5f82[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x25f8('0x0'));var util=require('util');var utils=require(_0x25f8('0x1'));var dials={};function writeDB(_0x22fa16){utils[_0x25f8('0x2')](util[_0x25f8('0x3')](_0x25f8('0x4'),_0x22fa16[_0x25f8('0x5')],_0x22fa16['channel'],_0x22fa16[_0x25f8('0x6')],_0x22fa16[_0x25f8('0x7')],_0x22fa16[_0x25f8('0x8')],_0x22fa16['dialstatus']));utils[_0x25f8('0x9')](_0x25f8('0xa'),_0x22fa16);delete dials[_0x22fa16[_0x25f8('0x5')]];}exports[_0x25f8('0xb')]=function(_0x27be0c){try{utils[_0x25f8('0xc')](util['format'](_0x25f8('0xd'),_0x27be0c['uniqueid']),_0x27be0c);utils['info'](util[_0x25f8('0x3')](_0x25f8('0xe'),_0x27be0c[_0x25f8('0x5')],_0x27be0c['application'],_0x27be0c['appdata']));if(_0x27be0c[_0x25f8('0xf')]['toLowerCase']()==_0x25f8('0x10')&&_[_0x25f8('0x11')](_0x27be0c[_0x25f8('0x12')]['toLowerCase'](),_0x25f8('0x13'))){var _0x3b85a1=_0x27be0c[_0x25f8('0x12')][_0x25f8('0x14')]('=');dials[_0x27be0c[_0x25f8('0x5')]]={'routeId':_0x3b85a1[0x1]};}}catch(_0x5b4951){utils[_0x25f8('0x15')](util[_0x25f8('0x3')](_0x25f8('0xd'),_0x27be0c[_0x25f8('0x5')]),_0x5b4951);}};exports[_0x25f8('0x16')]=function(_0x270ebe){try{utils[_0x25f8('0xc')](util[_0x25f8('0x3')]('[%s][dials][varset]',_0x270ebe[_0x25f8('0x5')]),_0x270ebe);if(!_[_0x25f8('0x17')](_0x270ebe[_0x25f8('0x18')][_0x25f8('0x19')])){utils[_0x25f8('0x2')](util[_0x25f8('0x3')](_0x25f8('0x1a'),_0x270ebe[_0x25f8('0x5')],_0x270ebe[_0x25f8('0x1b')]));dials[_0x270ebe['uniqueid']]={'routeId':_0x270ebe['value']};}}catch(_0xf8d3){utils[_0x25f8('0x15')](util['format'](_0x25f8('0x1c'),_0x270ebe[_0x25f8('0x5')]),_0xf8d3);}};exports[_0x25f8('0x1d')]=function(_0x2eee15){try{if(!_[_0x25f8('0x17')](dials[_0x2eee15[_0x25f8('0x5')]])){utils['debug'](util['format'](_0x25f8('0x1e'),_0x2eee15[_0x25f8('0x5')]),_0x2eee15);dials[_0x2eee15[_0x25f8('0x5')]]=_[_0x25f8('0x1f')](dials[_0x2eee15[_0x25f8('0x5')]],_0x2eee15);dials[_0x2eee15[_0x25f8('0x5')]][_0x25f8('0x20')]=utils[_0x25f8('0x21')]();dials[_0x2eee15[_0x25f8('0x5')]]['lastevent']=_0x25f8('0x22');utils[_0x25f8('0x2')](util[_0x25f8('0x3')](_0x25f8('0x23'),_0x2eee15['uniqueid'],dials[_0x2eee15[_0x25f8('0x5')]]['starttime']));}}catch(_0x3c4458){utils[_0x25f8('0x15')](util[_0x25f8('0x3')](_0x25f8('0x1e'),_0x2eee15[_0x25f8('0x5')]),_0x3c4458);}};exports['dialend']=function(_0x5b944a){try{if(!_[_0x25f8('0x17')](dials[_0x5b944a[_0x25f8('0x5')]])){utils[_0x25f8('0xc')](util[_0x25f8('0x3')](_0x25f8('0x24'),_0x5b944a['uniqueid']),_0x5b944a);dials[_0x5b944a['uniqueid']][_0x25f8('0x25')]=_0x5b944a[_0x25f8('0x25')];if(_0x5b944a[_0x25f8('0x25')]==_0x25f8('0x26')){dials[_0x5b944a[_0x25f8('0x5')]]=_[_0x25f8('0x1f')](dials[_0x5b944a[_0x25f8('0x5')]],_0x5b944a);dials[_0x5b944a[_0x25f8('0x5')]][_0x25f8('0x27')]=utils[_0x25f8('0x21')]();dials[_0x5b944a[_0x25f8('0x5')]][_0x25f8('0x28')]='connect';utils[_0x25f8('0x2')](util[_0x25f8('0x3')](_0x25f8('0x29'),_0x5b944a[_0x25f8('0x5')],_0x5b944a[_0x25f8('0x25')],dials[_0x5b944a[_0x25f8('0x5')]][_0x25f8('0x27')]));}else{utils[_0x25f8('0x2')](util['format'](_0x25f8('0x2a'),_0x5b944a[_0x25f8('0x5')],_0x5b944a[_0x25f8('0x25')]));}}}catch(_0x194c59){utils[_0x25f8('0x15')](util['format'](_0x25f8('0x24'),_0x5b944a[_0x25f8('0x5')]),_0x194c59);}};exports[_0x25f8('0x2b')]=function(_0x1a5f51){try{if(!_[_0x25f8('0x17')](dials[_0x1a5f51[_0x25f8('0x5')]])){utils[_0x25f8('0xc')](util[_0x25f8('0x3')](_0x25f8('0x2c'),_0x1a5f51[_0x25f8('0x5')]),_0x1a5f51);utils[_0x25f8('0x2')](util[_0x25f8('0x3')](_0x25f8('0x2d'),_0x1a5f51[_0x25f8('0x5')],_0x1a5f51['calleridnum'],_0x1a5f51['calleridname'],_0x1a5f51[_0x25f8('0x2e')]));dials[_0x1a5f51[_0x25f8('0x5')]]=_['assign'](dials[_0x1a5f51[_0x25f8('0x5')]],{'endtime':utils[_0x25f8('0x21')](),'lastevent':_0x25f8('0x2f')});dials[_0x1a5f51['uniqueid']][_0x25f8('0x30')]=utils[_0x25f8('0x31')](dials[_0x1a5f51['uniqueid']][_0x25f8('0x32')],dials[_0x1a5f51[_0x25f8('0x5')]][_0x25f8('0x20')]);dials[_0x1a5f51[_0x25f8('0x5')]][_0x25f8('0x33')]=utils['diffTime'](dials[_0x1a5f51[_0x25f8('0x5')]]['answertime']||dials[_0x1a5f51[_0x25f8('0x5')]][_0x25f8('0x32')],dials[_0x1a5f51[_0x25f8('0x5')]]['starttime']);dials[_0x1a5f51['uniqueid']][_0x25f8('0x34')]=dials[_0x1a5f51[_0x25f8('0x5')]][_0x25f8('0x27')]?utils[_0x25f8('0x31')](dials[_0x1a5f51[_0x25f8('0x5')]][_0x25f8('0x32')],dials[_0x1a5f51[_0x25f8('0x5')]][_0x25f8('0x27')]):0x0;writeDB(dials[_0x1a5f51['uniqueid']]);}}catch(_0x2eaed6){utils[_0x25f8('0x15')](util['format'](_0x25f8('0x2c'),_0x1a5f51[_0x25f8('0x5')]),_0x2eaed6);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index bc97a5d..f90b0d8 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 _0x423a=['[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','[%s][index][varset]','varset','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','local','port','asterisk','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug','format','[%s][index][devicestatechange]','device','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]'];(function(_0x437c33,_0x5158cd){var _0x2a3c3e=function(_0x7e0b6b){while(--_0x7e0b6b){_0x437c33['push'](_0x437c33['shift']());}};_0x2a3c3e(++_0x5158cd);}(_0x423a,0x9d));var _0xa423=function(_0x598414,_0x3e2701){_0x598414=_0x598414-0x0;var _0x457052=_0x423a[_0x598414];return _0x457052;};var AsteriskManager=require(_0xa423('0x0'));var config=require('../../config/environment');var utils=require(_0xa423('0x1'));var util=require(_0xa423('0x2'));var isXDREnabled=config[_0xa423('0x3')]&&config['xdr'][_0xa423('0x4')]?!config[_0xa423('0x3')][_0xa423('0x4')]:!![];var isProduction=config[_0xa423('0x5')]==='production'||![];var isLocalAsterisk=config[_0xa423('0x3')]&&config['xdr'][_0xa423('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xa423('0x7')],config[_0xa423('0x8')]['ip'],config['asterisk']['username'],config['asterisk']['password'],!![]);ami[_0xa423('0x9')]();if(!isXDREnabled){utils[_0xa423('0xa')](_0xa423('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xa423('0xa')](_0xa423('0xc'));}else{var agents=require(_0xa423('0xd'));var calls=require('./calls.controller');var queues=require(_0xa423('0xe'));var recordings=require(_0xa423('0xf'));var members=require(_0xa423('0x10'));var dials=require('./dials.controller');var transfers=require(_0xa423('0x11'));var core=require(_0xa423('0x12'));ami['on'](_0xa423('0x13'),core[_0xa423('0x13')]);ami['on'](_0xa423('0x14'),core[_0xa423('0x14')]);ami['on'](_0xa423('0x15'),core[_0xa423('0x15')]);ami['on'](_0xa423('0x16'),core[_0xa423('0x16')]);ami['on']('close',core[_0xa423('0x17')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0xa423('0x18'),function(_0x5cd898){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')](_0xa423('0x1b'),_0x5cd898[_0xa423('0x1c')]),_0x5cd898);members[_0xa423('0x18')](_0x5cd898);}catch(_0x3f148b){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x1b'),_0x5cd898[_0xa423('0x1c')]),_0x3f148b);}});ami['on']('agentcalled',function(_0x26197e){try{utils['debug'](util[_0xa423('0x1a')]('[%s][index][agentcalled]',_0x26197e['uniqueid']),_0x26197e);agents['agentcalled'](_0x26197e);}catch(_0x57b015){utils['error'](util[_0xa423('0x1a')]('[%s][index][agentcalled]',_0x26197e[_0xa423('0x1d')]),_0x57b015);}});ami['on'](_0xa423('0x1e'),function(_0x178536){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')](_0xa423('0x1f'),_0x178536[_0xa423('0x1d')]),_0x178536);agents['agentringnoanswer'](_0x178536);}catch(_0x13b766){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x1f'),_0x178536['uniqueid']),_0x13b766);}});ami['on'](_0xa423('0x20'),function(_0x3f9037){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')](_0xa423('0x21'),_0x3f9037[_0xa423('0x1d')]),_0x3f9037);agents['agentconnect'](_0x3f9037);queues[_0xa423('0x20')](_0x3f9037);}catch(_0x22a5f1){utils[_0xa423('0x16')](util['format'](_0xa423('0x21'),_0x3f9037[_0xa423('0x1d')]),_0x22a5f1);}});ami['on'](_0xa423('0x22'),function(_0x32b3e1){try{utils['debug'](util[_0xa423('0x1a')](_0xa423('0x23'),_0x32b3e1[_0xa423('0x1d')]),_0x32b3e1);agents[_0xa423('0x22')](_0x32b3e1);queues[_0xa423('0x22')](_0x32b3e1);members[_0xa423('0x22')](_0x32b3e1);}catch(_0x2887fe){utils[_0xa423('0x16')](util[_0xa423('0x1a')]('[%s][index][agentcomplete]',_0x32b3e1[_0xa423('0x1d')]),_0x2887fe);}});ami['on'](_0xa423('0x24'),function(_0x4a3598){try{utils['debug'](util['format']('[%s][index][queuecallerabandon]',_0x4a3598['uniqueid']),_0x4a3598);agents[_0xa423('0x24')](_0x4a3598);queues['queuecallerabandon'](_0x4a3598);}catch(_0x42cee7){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x25'),_0x4a3598[_0xa423('0x1d')]),_0x42cee7);}});ami['on']('queuecallerjoin',function(_0x2344d4){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')](_0xa423('0x26'),_0x2344d4[_0xa423('0x1d')]),_0x2344d4);queues[_0xa423('0x27')](_0x2344d4);recordings[_0xa423('0x27')](_0x2344d4);}catch(_0x7527cf){utils['error'](util[_0xa423('0x1a')](_0xa423('0x26'),_0x2344d4['uniqueid']),_0x7527cf);}});ami['on'](_0xa423('0x28'),function(_0xa3ed2c){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')](_0xa423('0x29'),_0xa3ed2c[_0xa423('0x1d')]),_0xa3ed2c);queues['queuecallerleave'](_0xa3ed2c);}catch(_0x53dd2a){utils[_0xa423('0x16')](util[_0xa423('0x1a')]('[%s][index][queuecallerleave]',_0xa3ed2c['uniqueid']),_0x53dd2a);}});ami['on'](_0xa423('0x2a'),function(_0x187168){try{utils[_0xa423('0x19')](util['format'](_0xa423('0x2b'),_0x187168[_0xa423('0x1d')]),_0x187168);queues[_0xa423('0x2a')](_0x187168);calls[_0xa423('0x2a')](_0x187168);}catch(_0x11a4f5){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x2b'),_0x187168[_0xa423('0x1d')]),_0x11a4f5);}});ami['on'](_0xa423('0x2c'),function(_0x5336ec){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')](_0xa423('0x2d'),_0x5336ec[_0xa423('0x1d')]),_0x5336ec);queues[_0xa423('0x2c')](_0x5336ec);calls[_0xa423('0x2c')](_0x5336ec);}catch(_0x34362d){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x2d'),_0x5336ec[_0xa423('0x1d')]),_0x34362d);}});ami['on']('newstate',function(_0x3f6f3e){try{utils[_0xa423('0x19')](util['format']('[%s][index][newstate]',_0x3f6f3e[_0xa423('0x1d')]),_0x3f6f3e);calls[_0xa423('0x2e')](_0x3f6f3e);recordings[_0xa423('0x2e')](_0x3f6f3e);}catch(_0x5ca1d1){utils[_0xa423('0x16')](util['format'](_0xa423('0x2f'),_0x3f6f3e[_0xa423('0x1d')]),_0x5ca1d1);}});ami['on']('hangup',function(_0x244890){try{utils[_0xa423('0x19')](util['format']('[%s][index][hangup]',_0x244890[_0xa423('0x1d')]),_0x244890);calls['hangup'](_0x244890);recordings[_0xa423('0x30')](_0x244890);dials[_0xa423('0x30')](_0x244890);agents[_0xa423('0x30')](_0x244890);queues[_0xa423('0x30')](_0x244890);}catch(_0x5cd4cd){utils[_0xa423('0x16')](util[_0xa423('0x1a')]('[%s][index][hangup]',_0x244890[_0xa423('0x1d')]),_0x5cd4cd);}});ami['on'](_0xa423('0x31'),function(_0x29edc2){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')](_0xa423('0x32'),_0x29edc2['uniqueid']),_0x29edc2);members[_0xa423('0x31')](_0x29edc2);}catch(_0x54e230){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x32'),_0x29edc2[_0xa423('0x1d')]),_0x54e230);}});ami['on'](_0xa423('0x33'),function(_0x21a8a0){try{utils[_0xa423('0x19')](util['format'](_0xa423('0x34'),_0x21a8a0[_0xa423('0x1d')]),_0x21a8a0);queues[_0xa423('0x33')](_0x21a8a0);agents[_0xa423('0x33')](_0x21a8a0);transfers['blindtransfer'](_0x21a8a0);}catch(_0x49930d){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x34'),_0x21a8a0[_0xa423('0x1d')]),_0x49930d);}});ami['on'](_0xa423('0x35'),function(_0x397b57){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')]('[%s][index][attendedtransfer]',_0x397b57[_0xa423('0x36')]),_0x397b57);queues[_0xa423('0x35')](_0x397b57);transfers[_0xa423('0x35')](_0x397b57);agents[_0xa423('0x35')](_0x397b57);calls[_0xa423('0x35')](_0x397b57);}catch(_0x4a8b86){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x37'),_0x397b57[_0xa423('0x36')]),_0x4a8b86);}});ami['on']('varset',function(_0x74fcf9){try{utils['debug'](util[_0xa423('0x1a')](_0xa423('0x38'),_0x74fcf9[_0xa423('0x1d')]),_0x74fcf9);queues[_0xa423('0x39')](_0x74fcf9);recordings[_0xa423('0x39')](_0x74fcf9);calls[_0xa423('0x39')](_0x74fcf9);dials['varset'](_0x74fcf9);}catch(_0x157fe2){utils['error'](util['format'](_0xa423('0x38'),_0x74fcf9[_0xa423('0x1d')]),_0x157fe2);}});ami['on'](_0xa423('0x3a'),function(_0x2a341f){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')]('[%s][index][newexten]',_0x2a341f[_0xa423('0x1d')]),_0x2a341f);calls[_0xa423('0x3a')](_0x2a341f);recordings[_0xa423('0x3a')](_0x2a341f);dials[_0xa423('0x3a')](_0x2a341f);}catch(_0x499601){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x3b'),_0x2a341f['uniqueid']),_0x499601);}});ami['on']('newchannel',function(_0xb52de7){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')](_0xa423('0x3c'),_0xb52de7['uniqueid']),_0xb52de7);calls['newchannel'](_0xb52de7);recordings[_0xa423('0x3d')](_0xb52de7);}catch(_0x47458c){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x3c'),_0xb52de7[_0xa423('0x1d')]),_0x47458c);}});ami['on']('dialbegin',function(_0x1fc4fc){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')]('[%s][index][dialbegin]',_0x1fc4fc['uniqueid']),_0x1fc4fc);dials['dialbegin'](_0x1fc4fc);}catch(_0x1e4f0a){utils[_0xa423('0x16')](util[_0xa423('0x1a')](_0xa423('0x3e'),_0x1fc4fc['uniqueid']),_0x1e4f0a);}});ami['on'](_0xa423('0x3f'),function(_0x3a359d){try{utils[_0xa423('0x19')](util[_0xa423('0x1a')](_0xa423('0x40'),_0x3a359d['uniqueid']),_0x3a359d);dials['dialend'](_0x3a359d);}catch(_0x15b6e3){utils[_0xa423('0x16')](util['format'](_0xa423('0x40'),_0x3a359d[_0xa423('0x1d')]),_0x15b6e3);}});} \ No newline at end of file +var _0x2741=['agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','local','asterisk','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x2741,0x1b8));var _0x1274=function(_0x4018a2,_0x4fab0e){_0x4018a2=_0x4018a2-0x0;var _0x40a271=_0x2741[_0x4018a2];return _0x40a271;};var AsteriskManager=require(_0x1274('0x0'));var config=require(_0x1274('0x1'));var utils=require('./utils');var util=require(_0x1274('0x2'));var isXDREnabled=config[_0x1274('0x3')]&&config[_0x1274('0x3')][_0x1274('0x4')]?!config[_0x1274('0x3')]['disabled']:!![];var isProduction=config[_0x1274('0x5')]===_0x1274('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x1274('0x3')][_0x1274('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x1274('0x8')]['port'],config[_0x1274('0x8')]['ip'],config[_0x1274('0x8')]['username'],config[_0x1274('0x8')][_0x1274('0x9')],!![]);ami[_0x1274('0xa')]();if(!isXDREnabled){utils[_0x1274('0xb')](_0x1274('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x1274('0xd'));}else{var agents=require('./agents.controller');var calls=require(_0x1274('0xe'));var queues=require('./queues.controller');var recordings=require(_0x1274('0xf'));var members=require('./members.controller');var dials=require(_0x1274('0x10'));var transfers=require(_0x1274('0x11'));var core=require(_0x1274('0x12'));ami['on'](_0x1274('0x13'),core[_0x1274('0x13')]);ami['on']('shutdown',core['shutdown']);ami['on']('fullybooted',core[_0x1274('0x14')]);ami['on'](_0x1274('0x15'),core[_0x1274('0x15')]);ami['on'](_0x1274('0x16'),core[_0x1274('0x16')]);ami['on']('managerevent',core[_0x1274('0x17')]);ami['on'](_0x1274('0x18'),function(_0x5be1be){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')](_0x1274('0x1b'),_0x5be1be[_0x1274('0x1c')]),_0x5be1be);members['devicestatechange'](_0x5be1be);}catch(_0x57e8ff){utils[_0x1274('0x15')](util[_0x1274('0x1a')](_0x1274('0x1b'),_0x5be1be['device']),_0x57e8ff);}});ami['on']('agentcalled',function(_0x4f9e76){try{utils[_0x1274('0x19')](util['format'](_0x1274('0x1d'),_0x4f9e76['uniqueid']),_0x4f9e76);agents[_0x1274('0x1e')](_0x4f9e76);}catch(_0x390104){utils[_0x1274('0x15')](util[_0x1274('0x1a')](_0x1274('0x1d'),_0x4f9e76[_0x1274('0x1f')]),_0x390104);}});ami['on'](_0x1274('0x20'),function(_0x4da228){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')](_0x1274('0x21'),_0x4da228['uniqueid']),_0x4da228);agents[_0x1274('0x20')](_0x4da228);}catch(_0x55e7de){utils[_0x1274('0x15')](util[_0x1274('0x1a')]('[%s][index][agentringnoanswer]',_0x4da228[_0x1274('0x1f')]),_0x55e7de);}});ami['on'](_0x1274('0x22'),function(_0x123319){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')](_0x1274('0x23'),_0x123319[_0x1274('0x1f')]),_0x123319);agents[_0x1274('0x22')](_0x123319);queues[_0x1274('0x22')](_0x123319);}catch(_0x1c09d1){utils[_0x1274('0x15')](util[_0x1274('0x1a')]('[%s][index][agentconnect]',_0x123319[_0x1274('0x1f')]),_0x1c09d1);}});ami['on'](_0x1274('0x24'),function(_0x5d2cef){try{utils[_0x1274('0x19')](util['format'](_0x1274('0x25'),_0x5d2cef[_0x1274('0x1f')]),_0x5d2cef);agents[_0x1274('0x24')](_0x5d2cef);queues[_0x1274('0x24')](_0x5d2cef);members[_0x1274('0x24')](_0x5d2cef);}catch(_0x12da85){utils['error'](util[_0x1274('0x1a')](_0x1274('0x25'),_0x5d2cef[_0x1274('0x1f')]),_0x12da85);}});ami['on']('queuecallerabandon',function(_0x52b621){try{utils['debug'](util[_0x1274('0x1a')]('[%s][index][queuecallerabandon]',_0x52b621[_0x1274('0x1f')]),_0x52b621);agents[_0x1274('0x26')](_0x52b621);queues[_0x1274('0x26')](_0x52b621);}catch(_0x3b0809){utils[_0x1274('0x15')](util['format']('[%s][index][queuecallerabandon]',_0x52b621[_0x1274('0x1f')]),_0x3b0809);}});ami['on']('queuecallerjoin',function(_0xce1aa7){try{utils['debug'](util[_0x1274('0x1a')]('[%s][index][queuecallerjoin]',_0xce1aa7[_0x1274('0x1f')]),_0xce1aa7);queues[_0x1274('0x27')](_0xce1aa7);recordings['queuecallerjoin'](_0xce1aa7);}catch(_0x312c1e){utils[_0x1274('0x15')](util[_0x1274('0x1a')](_0x1274('0x28'),_0xce1aa7[_0x1274('0x1f')]),_0x312c1e);}});ami['on']('queuecallerleave',function(_0x302809){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')]('[%s][index][queuecallerleave]',_0x302809[_0x1274('0x1f')]),_0x302809);queues[_0x1274('0x29')](_0x302809);}catch(_0x502bdf){utils[_0x1274('0x15')](util['format']('[%s][index][queuecallerleave]',_0x302809['uniqueid']),_0x502bdf);}});ami['on'](_0x1274('0x2a'),function(_0x44133b){try{utils['debug'](util[_0x1274('0x1a')]('[%s][index][musiconholdstart]',_0x44133b[_0x1274('0x1f')]),_0x44133b);queues[_0x1274('0x2a')](_0x44133b);calls['musiconholdstart'](_0x44133b);}catch(_0xb54ba1){utils['error'](util[_0x1274('0x1a')](_0x1274('0x2b'),_0x44133b[_0x1274('0x1f')]),_0xb54ba1);}});ami['on'](_0x1274('0x2c'),function(_0x2a37c8){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')](_0x1274('0x2d'),_0x2a37c8[_0x1274('0x1f')]),_0x2a37c8);queues['musiconholdstop'](_0x2a37c8);calls[_0x1274('0x2c')](_0x2a37c8);}catch(_0xe2e871){utils[_0x1274('0x15')](util['format']('[%s][index][musiconholdstop]',_0x2a37c8['uniqueid']),_0xe2e871);}});ami['on'](_0x1274('0x2e'),function(_0x577d5b){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')]('[%s][index][newstate]',_0x577d5b[_0x1274('0x1f')]),_0x577d5b);calls[_0x1274('0x2e')](_0x577d5b);recordings[_0x1274('0x2e')](_0x577d5b);}catch(_0xe72970){utils[_0x1274('0x15')](util[_0x1274('0x1a')](_0x1274('0x2f'),_0x577d5b[_0x1274('0x1f')]),_0xe72970);}});ami['on'](_0x1274('0x30'),function(_0x566ef8){try{utils[_0x1274('0x19')](util['format'](_0x1274('0x31'),_0x566ef8['uniqueid']),_0x566ef8);calls[_0x1274('0x30')](_0x566ef8);recordings[_0x1274('0x30')](_0x566ef8);dials[_0x1274('0x30')](_0x566ef8);agents[_0x1274('0x30')](_0x566ef8);queues[_0x1274('0x30')](_0x566ef8);}catch(_0x3b57c4){utils[_0x1274('0x15')](util['format'](_0x1274('0x31'),_0x566ef8[_0x1274('0x1f')]),_0x3b57c4);}});ami['on'](_0x1274('0x32'),function(_0x2f6b10){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')](_0x1274('0x33'),_0x2f6b10[_0x1274('0x1f')]),_0x2f6b10);members[_0x1274('0x32')](_0x2f6b10);}catch(_0x3ec0e1){utils[_0x1274('0x15')](util['format'](_0x1274('0x33'),_0x2f6b10[_0x1274('0x1f')]),_0x3ec0e1);}});ami['on'](_0x1274('0x34'),function(_0x2e90d9){try{utils[_0x1274('0x19')](util['format'](_0x1274('0x35'),_0x2e90d9[_0x1274('0x1f')]),_0x2e90d9);queues[_0x1274('0x34')](_0x2e90d9);agents[_0x1274('0x34')](_0x2e90d9);transfers[_0x1274('0x34')](_0x2e90d9);}catch(_0x2bd7c9){utils['error'](util['format'](_0x1274('0x35'),_0x2e90d9[_0x1274('0x1f')]),_0x2bd7c9);}});ami['on'](_0x1274('0x36'),function(_0x58a68e){try{utils[_0x1274('0x19')](util['format'](_0x1274('0x37'),_0x58a68e[_0x1274('0x38')]),_0x58a68e);queues[_0x1274('0x36')](_0x58a68e);transfers[_0x1274('0x36')](_0x58a68e);agents['attendedtransfer'](_0x58a68e);calls['attendedtransfer'](_0x58a68e);}catch(_0x58ae34){utils[_0x1274('0x15')](util[_0x1274('0x1a')](_0x1274('0x37'),_0x58a68e[_0x1274('0x38')]),_0x58ae34);}});ami['on'](_0x1274('0x39'),function(_0x2a367a){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')](_0x1274('0x3a'),_0x2a367a[_0x1274('0x1f')]),_0x2a367a);queues[_0x1274('0x39')](_0x2a367a);recordings[_0x1274('0x39')](_0x2a367a);calls[_0x1274('0x39')](_0x2a367a);dials[_0x1274('0x39')](_0x2a367a);}catch(_0x412181){utils[_0x1274('0x15')](util[_0x1274('0x1a')](_0x1274('0x3a'),_0x2a367a[_0x1274('0x1f')]),_0x412181);}});ami['on'](_0x1274('0x3b'),function(_0x311840){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')](_0x1274('0x3c'),_0x311840['uniqueid']),_0x311840);calls[_0x1274('0x3b')](_0x311840);recordings[_0x1274('0x3b')](_0x311840);dials[_0x1274('0x3b')](_0x311840);}catch(_0x2ebb05){utils[_0x1274('0x15')](util[_0x1274('0x1a')](_0x1274('0x3c'),_0x311840[_0x1274('0x1f')]),_0x2ebb05);}});ami['on'](_0x1274('0x3d'),function(_0x8e7647){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')]('[%s][index][newchannel]',_0x8e7647[_0x1274('0x1f')]),_0x8e7647);calls['newchannel'](_0x8e7647);recordings[_0x1274('0x3d')](_0x8e7647);}catch(_0x2d08d9){utils['error'](util[_0x1274('0x1a')](_0x1274('0x3e'),_0x8e7647['uniqueid']),_0x2d08d9);}});ami['on'](_0x1274('0x3f'),function(_0x40debe){try{utils[_0x1274('0x19')](util[_0x1274('0x1a')](_0x1274('0x40'),_0x40debe['uniqueid']),_0x40debe);dials[_0x1274('0x3f')](_0x40debe);}catch(_0x4bef9f){utils[_0x1274('0x15')](util[_0x1274('0x1a')](_0x1274('0x41'),_0x40debe[_0x1274('0x1f')]),_0x4bef9f);}});ami['on'](_0x1274('0x42'),function(_0x5cb5bd){try{utils['debug'](util[_0x1274('0x1a')]('[%s][index][dialend]',_0x5cb5bd[_0x1274('0x1f')]),_0x5cb5bd);dials[_0x1274('0x42')](_0x5cb5bd);}catch(_0x533111){utils[_0x1274('0x15')](util[_0x1274('0x1a')](_0x1274('0x43'),_0x5cb5bd[_0x1274('0x1f')]),_0x533111);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index ec21337..76c3e6b 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 _0x207d=['agent','NOT_INUSE','isNil','exitAt','duration','diffTime','agentcomplete','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','getUserByInterface','then','internal','request','split','CreateMemberReport','catch','error','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','[%s][members][devicestatechange]','device','info','state','INUSE','BUSY','TALKING','now'];(function(_0x439b2b,_0x32235d){var _0x19ad78=function(_0x4f3fec){while(--_0x4f3fec){_0x439b2b['push'](_0x439b2b['shift']());}};_0x19ad78(++_0x32235d);}(_0x207d,0x10d));var _0xd207=function(_0x45d75f,_0xd5c46b){_0x45d75f=_0x45d75f-0x0;var _0x17bef9=_0x207d[_0x45d75f];return _0x17bef9;};'use strict';var _=require(_0xd207('0x0'));var util=require(_0xd207('0x1'));var utils=require(_0xd207('0x2'));var members={};var exclude=[_0xd207('0x3'),'Queue:'];function writeDB(_0xbc74a3){utils['info'](util[_0xd207('0x4')](_0xd207('0x5'),_0xbc74a3['uniqueid'],_0xbc74a3[_0xd207('0x6')],_0xbc74a3[_0xd207('0x7')],_0xbc74a3[_0xd207('0x8')],_0xbc74a3[_0xd207('0x9')],_0xbc74a3[_0xd207('0xa')]));if(_0xbc74a3[_0xd207('0x6')]){utils[_0xd207('0xb')](_0xbc74a3[_0xd207('0x6')])[_0xd207('0xc')](function(_0x440d20){if(_0x440d20){_0xbc74a3[_0xd207('0x9')]=_0x440d20['name'];_0xbc74a3[_0xd207('0xd')]=_0x440d20[_0xd207('0xd')];utils[_0xd207('0xe')]('CreateMemberReport',_0xbc74a3);}else{utils['getUserByName'](_0xbc74a3[_0xd207('0x6')][_0xd207('0xf')]('/')[0x1])[_0xd207('0xc')](function(_0x5f15c5){if(_0x5f15c5){_0xbc74a3[_0xd207('0x9')]=_0x5f15c5['name'];_0xbc74a3['internal']=_0x5f15c5['internal'];utils[_0xd207('0xe')](_0xd207('0x10'),_0xbc74a3);}});}})[_0xd207('0x11')](function(_0x1f6a3e){utils[_0xd207('0x12')](util[_0xd207('0x4')](_0xd207('0x13'),_0xbc74a3[_0xd207('0x14')]),_0x1f6a3e);});}delete members[_0xbc74a3[_0xd207('0x6')]];}function startsWith(_0x2ab263,_0x1c5a1d){return _['some'](_0x2ab263,function(_0x540c2d){return _[_0xd207('0x15')](_0x1c5a1d,_0x540c2d);});}exports[_0xd207('0x16')]=function(_0x38e8e8){try{utils['debug'](util['format'](_0xd207('0x17'),members[_0x38e8e8[_0xd207('0x18')]]?members[_0x38e8e8[_0xd207('0x18')]][_0xd207('0x14')]:_0x38e8e8['device']),_0x38e8e8);utils[_0xd207('0x19')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x38e8e8[_0xd207('0x18')]]?members[_0x38e8e8[_0xd207('0x18')]][_0xd207('0x14')]:_0x38e8e8[_0xd207('0x18')],_0x38e8e8[_0xd207('0x1a')],_0x38e8e8[_0xd207('0x18')]));switch(_0x38e8e8[_0xd207('0x1a')]){case _0xd207('0x1b'):case _0xd207('0x1c'):if(!startsWith(exclude,_0x38e8e8[_0xd207('0x18')])){members[_0x38e8e8['device']]={'channel':'voice','interface':_0x38e8e8['device'],'type':_0xd207('0x1d'),'enterAt':utils[_0xd207('0x1e')](),'role':_0xd207('0x1f')};}break;case _0xd207('0x20'):if(!_[_0xd207('0x21')](members[_0x38e8e8['device']])){members[_0x38e8e8[_0xd207('0x18')]][_0xd207('0x22')]=utils['now']();members[_0x38e8e8[_0xd207('0x18')]][_0xd207('0x23')]=utils[_0xd207('0x24')](members[_0x38e8e8[_0xd207('0x18')]]['exitAt'],members[_0x38e8e8[_0xd207('0x18')]]['enterAt']);if(members[_0x38e8e8[_0xd207('0x18')]][_0xd207('0x14')]){writeDB(members[_0x38e8e8[_0xd207('0x18')]]);}}break;default:break;}}catch(_0x2f88e8){utils[_0xd207('0x12')](util[_0xd207('0x4')]('[%s][members][devicestatechange]',members[_0x38e8e8[_0xd207('0x18')]]?members[_0x38e8e8[_0xd207('0x18')]][_0xd207('0x14')]:_0x38e8e8[_0xd207('0x18')]),_0x2f88e8);}};exports[_0xd207('0x25')]=function(_0x65c87a){try{if(!_[_0xd207('0x21')](members[_0x65c87a[_0xd207('0x6')]])){utils[_0xd207('0x26')](util[_0xd207('0x4')]('[%s][members][agentcomplete]',_0x65c87a[_0xd207('0x14')]),_0x65c87a);utils[_0xd207('0x19')](util[_0xd207('0x4')](_0xd207('0x27'),_0x65c87a[_0xd207('0x14')],_0x65c87a['interface'],_0x65c87a[_0xd207('0x28')]));members[_0x65c87a[_0xd207('0x6')]]=_[_0xd207('0x29')](members[_0x65c87a[_0xd207('0x6')]],{'data4':_0x65c87a[_0xd207('0x28')],'uniqueid':_0x65c87a[_0xd207('0x14')]});}}catch(_0x336e0b){utils[_0xd207('0x12')](util[_0xd207('0x4')](_0xd207('0x2a'),_0x65c87a['uniqueid']),_0x336e0b);}};exports['cdr']=function(_0x5304a6){try{utils[_0xd207('0x26')](util[_0xd207('0x4')]('[%s][members][cdr]',_0x5304a6[_0xd207('0x14')]),_0x5304a6);if(_0x5304a6['channel']){var _0xdeed24=_0x5304a6[_0xd207('0x7')][_0xd207('0xf')]('-')[0x0];if(!_[_0xd207('0x21')](members[_0xdeed24])){members[_0xdeed24]=_[_0xd207('0x29')](members[_0xdeed24],{'data1':members[_0xdeed24][_0xd207('0x2b')]||_0x5304a6[_0xd207('0xa')],'data2':members[_0xdeed24][_0xd207('0x8')]||_0x5304a6[_0xd207('0x2c')],'data3':members[_0xdeed24][_0xd207('0x2d')]||_0x5304a6[_0xd207('0x2e')],'uniqueid':members[_0xdeed24][_0xd207('0x14')]||_0x5304a6[_0xd207('0x14')]});utils[_0xd207('0x19')](util[_0xd207('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5304a6[_0xd207('0x14')],members[_0xdeed24][_0xd207('0x2b')],members[_0xdeed24]['data2'],members[_0xdeed24][_0xd207('0x2d')]));if(members[_0xdeed24][_0xd207('0x22')]){writeDB(members[_0xdeed24]);}}}if(_0x5304a6[_0xd207('0x2f')]){var _0x53f081=_0x5304a6[_0xd207('0x2f')][_0xd207('0xf')]('-')[0x0];if(!_[_0xd207('0x21')](members[_0x53f081])){members[_0x53f081]=_[_0xd207('0x29')](members[_0x53f081],{'data1':members[_0x53f081][_0xd207('0x2b')]||_0x5304a6[_0xd207('0xa')],'data2':members[_0x53f081][_0xd207('0x8')]||_0x5304a6[_0xd207('0x2c')],'data3':members[_0x53f081]['data3']||_0x5304a6[_0xd207('0x2e')],'uniqueid':members[_0x53f081][_0xd207('0x14')]||_0x5304a6['uniqueid']});utils['info'](util['format'](_0xd207('0x30'),_0x5304a6[_0xd207('0x14')],members[_0x53f081]['data1'],members[_0x53f081][_0xd207('0x8')],members[_0x53f081][_0xd207('0x2d')]));if(members[_0x53f081][_0xd207('0x22')]){writeDB(members[_0x53f081]);}}}}catch(_0x33e3d4){utils[_0xd207('0x12')](util[_0xd207('0x4')](_0xd207('0x31'),_0x5304a6[_0xd207('0x14')]),_0x33e3d4);}}; \ No newline at end of file +var _0x2a4b=['device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','[%s][members][devicestatechange]','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','channel','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','data2','membername','type','interface','getUserByInterface','name','internal','request','getUserByName','split','then','CreateMemberReport','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange'];(function(_0x3c1309,_0x66e161){var _0x4b71bf=function(_0x46426e){while(--_0x46426e){_0x3c1309['push'](_0x3c1309['shift']());}};_0x4b71bf(++_0x66e161);}(_0x2a4b,0xbb));var _0xb2a4=function(_0x1ae944,_0x23ab90){_0x1ae944=_0x1ae944-0x0;var _0x415273=_0x2a4b[_0x1ae944];return _0x415273;};'use strict';var _=require('lodash');var util=require(_0xb2a4('0x0'));var utils=require('./utils');var members={};var exclude=[_0xb2a4('0x1'),_0xb2a4('0x2')];function writeDB(_0x477f1c){utils[_0xb2a4('0x3')](util[_0xb2a4('0x4')](_0xb2a4('0x5'),_0x477f1c['uniqueid'],_0x477f1c['interface'],_0x477f1c['channel'],_0x477f1c[_0xb2a4('0x6')],_0x477f1c[_0xb2a4('0x7')],_0x477f1c[_0xb2a4('0x8')]));if(_0x477f1c[_0xb2a4('0x9')]){utils[_0xb2a4('0xa')](_0x477f1c[_0xb2a4('0x9')])['then'](function(_0x8577f7){if(_0x8577f7){_0x477f1c[_0xb2a4('0x7')]=_0x8577f7[_0xb2a4('0xb')];_0x477f1c[_0xb2a4('0xc')]=_0x8577f7[_0xb2a4('0xc')];utils[_0xb2a4('0xd')]('CreateMemberReport',_0x477f1c);}else{utils[_0xb2a4('0xe')](_0x477f1c[_0xb2a4('0x9')][_0xb2a4('0xf')]('/')[0x1])[_0xb2a4('0x10')](function(_0x2b1da6){if(_0x2b1da6){_0x477f1c['membername']=_0x2b1da6[_0xb2a4('0xb')];_0x477f1c[_0xb2a4('0xc')]=_0x2b1da6[_0xb2a4('0xc')];utils[_0xb2a4('0xd')](_0xb2a4('0x11'),_0x477f1c);}});}})[_0xb2a4('0x12')](function(_0xcfd77e){utils[_0xb2a4('0x13')](util[_0xb2a4('0x4')](_0xb2a4('0x14'),_0x477f1c[_0xb2a4('0x15')]),_0xcfd77e);});}delete members[_0x477f1c[_0xb2a4('0x9')]];}function startsWith(_0x24721e,_0x52b277){return _[_0xb2a4('0x16')](_0x24721e,function(_0x1045f8){return _[_0xb2a4('0x17')](_0x52b277,_0x1045f8);});}exports[_0xb2a4('0x18')]=function(_0xc2d810){try{utils['debug'](util[_0xb2a4('0x4')]('[%s][members][devicestatechange]',members[_0xc2d810[_0xb2a4('0x19')]]?members[_0xc2d810[_0xb2a4('0x19')]][_0xb2a4('0x15')]:_0xc2d810[_0xb2a4('0x19')]),_0xc2d810);utils['info'](util['format'](_0xb2a4('0x1a'),members[_0xc2d810['device']]?members[_0xc2d810['device']][_0xb2a4('0x15')]:_0xc2d810[_0xb2a4('0x19')],_0xc2d810[_0xb2a4('0x1b')],_0xc2d810[_0xb2a4('0x19')]));switch(_0xc2d810['state']){case _0xb2a4('0x1c'):case'BUSY':if(!startsWith(exclude,_0xc2d810[_0xb2a4('0x19')])){members[_0xc2d810[_0xb2a4('0x19')]]={'channel':_0xb2a4('0x1d'),'interface':_0xc2d810['device'],'type':_0xb2a4('0x1e'),'enterAt':utils['now'](),'role':_0xb2a4('0x1f')};}break;case _0xb2a4('0x20'):if(!_[_0xb2a4('0x21')](members[_0xc2d810[_0xb2a4('0x19')]])){members[_0xc2d810[_0xb2a4('0x19')]][_0xb2a4('0x22')]=utils['now']();members[_0xc2d810[_0xb2a4('0x19')]][_0xb2a4('0x23')]=utils['diffTime'](members[_0xc2d810['device']][_0xb2a4('0x22')],members[_0xc2d810[_0xb2a4('0x19')]][_0xb2a4('0x24')]);if(members[_0xc2d810['device']][_0xb2a4('0x15')]){writeDB(members[_0xc2d810['device']]);}}break;default:break;}}catch(_0x156c73){utils[_0xb2a4('0x13')](util[_0xb2a4('0x4')](_0xb2a4('0x25'),members[_0xc2d810[_0xb2a4('0x19')]]?members[_0xc2d810[_0xb2a4('0x19')]]['uniqueid']:_0xc2d810['device']),_0x156c73);}};exports[_0xb2a4('0x26')]=function(_0x550bd7){try{if(!_[_0xb2a4('0x21')](members[_0x550bd7[_0xb2a4('0x9')]])){utils[_0xb2a4('0x27')](util[_0xb2a4('0x4')](_0xb2a4('0x28'),_0x550bd7[_0xb2a4('0x15')]),_0x550bd7);utils[_0xb2a4('0x3')](util[_0xb2a4('0x4')](_0xb2a4('0x29'),_0x550bd7['uniqueid'],_0x550bd7[_0xb2a4('0x9')],_0x550bd7[_0xb2a4('0x2a')]));members[_0x550bd7[_0xb2a4('0x9')]]=_[_0xb2a4('0x2b')](members[_0x550bd7[_0xb2a4('0x9')]],{'data4':_0x550bd7[_0xb2a4('0x2a')],'uniqueid':_0x550bd7['uniqueid']});}}catch(_0x4b1a64){utils[_0xb2a4('0x13')](util[_0xb2a4('0x4')]('[%s][members][agentcomplete]',_0x550bd7[_0xb2a4('0x15')]),_0x4b1a64);}};exports[_0xb2a4('0x2c')]=function(_0x3209fc){try{utils[_0xb2a4('0x27')](util['format'](_0xb2a4('0x2d'),_0x3209fc[_0xb2a4('0x15')]),_0x3209fc);if(_0x3209fc[_0xb2a4('0x2e')]){var _0x483eb2=_0x3209fc[_0xb2a4('0x2e')]['split']('-')[0x0];if(!_[_0xb2a4('0x21')](members[_0x483eb2])){members[_0x483eb2]=_[_0xb2a4('0x2b')](members[_0x483eb2],{'data1':members[_0x483eb2][_0xb2a4('0x2f')]||_0x3209fc[_0xb2a4('0x8')],'data2':members[_0x483eb2][_0xb2a4('0x6')]||_0x3209fc[_0xb2a4('0x30')],'data3':members[_0x483eb2][_0xb2a4('0x31')]||_0x3209fc[_0xb2a4('0x32')],'uniqueid':members[_0x483eb2][_0xb2a4('0x15')]||_0x3209fc['uniqueid']});utils[_0xb2a4('0x3')](util[_0xb2a4('0x4')](_0xb2a4('0x33'),_0x3209fc['uniqueid'],members[_0x483eb2][_0xb2a4('0x2f')],members[_0x483eb2][_0xb2a4('0x6')],members[_0x483eb2]['data3']));if(members[_0x483eb2][_0xb2a4('0x22')]){writeDB(members[_0x483eb2]);}}}if(_0x3209fc[_0xb2a4('0x34')]){var _0x113373=_0x3209fc['destinationchannel'][_0xb2a4('0xf')]('-')[0x0];if(!_[_0xb2a4('0x21')](members[_0x113373])){members[_0x113373]=_[_0xb2a4('0x2b')](members[_0x113373],{'data1':members[_0x113373]['data1']||_0x3209fc['type'],'data2':members[_0x113373][_0xb2a4('0x6')]||_0x3209fc[_0xb2a4('0x30')],'data3':members[_0x113373][_0xb2a4('0x31')]||_0x3209fc[_0xb2a4('0x32')],'uniqueid':members[_0x113373][_0xb2a4('0x15')]||_0x3209fc[_0xb2a4('0x15')]});utils['info'](util[_0xb2a4('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3209fc[_0xb2a4('0x15')],members[_0x113373][_0xb2a4('0x2f')],members[_0x113373][_0xb2a4('0x6')],members[_0x113373]['data3']));if(members[_0x113373]['exitAt']){writeDB(members[_0x113373]);}}}}catch(_0x34067c){utils[_0xb2a4('0x13')](util[_0xb2a4('0x4')](_0xb2a4('0x2d'),_0x3209fc[_0xb2a4('0x15')]),_0x34067c);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 8d19ca0..07e18e0 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 _0xecce=['queuecallerexitAt','value','variable','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','transfereduniqueid','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','toUpperCase','queuecallerabandonAt'];(function(_0x49724d,_0x410a6a){var _0xcdc19=function(_0x45599d){while(--_0x45599d){_0x49724d['push'](_0x49724d['shift']());}};_0xcdc19(++_0x410a6a);}(_0xecce,0xa3));var _0xeecc=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xecce[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0xeecc('0x0'));var util=require(_0xeecc('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x5c5ab7){utils['info'](util[_0xeecc('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x5c5ab7[_0xeecc('0x3')],_0x5c5ab7[_0xeecc('0x4')],_0x5c5ab7[_0xeecc('0x5')],_0x5c5ab7[_0xeecc('0x6')],_0x5c5ab7[_0xeecc('0x7')],_0x5c5ab7[_0xeecc('0x8')],_0x5c5ab7[_0xeecc('0x9')]));if(_0x5c5ab7['queue']){utils[_0xeecc('0xa')](_0x5c5ab7[_0xeecc('0x5')])[_0xeecc('0xb')](function(_0x1213d6){if(_0x1213d6){_0x5c5ab7[_0xeecc('0xc')]=_0x1213d6[_0xeecc('0xc')];}utils[_0xeecc('0xd')]('CreateVoiceQueueReport',_0x5c5ab7);});}else{utils[_0xeecc('0xd')](_0xeecc('0xe'),_0x5c5ab7);}if(_0x5c5ab7['transfereduniqueid']){delete queues[_0x5c5ab7['transfereduniqueid']];}else{delete queues[_0x5c5ab7[_0xeecc('0x3')]];}}exports[_0xeecc('0xf')]=function(_0x5f4fce){try{utils[_0xeecc('0x10')](util['format'](_0xeecc('0x11'),_0x5f4fce[_0xeecc('0x3')]),_0x5f4fce);utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x13'),_0x5f4fce[_0xeecc('0x3')],_0x5f4fce[_0xeecc('0x5')],_0x5f4fce[_0xeecc('0x14')]));queues[_0x5f4fce[_0xeecc('0x3')]]=_[_0xeecc('0x15')](_0x5f4fce,{'originalposition':_0x5f4fce[_0xeecc('0x14')],'queuecallerjoinAt':utils[_0xeecc('0x16')](),'mohtime':0x0});}catch(_0x32b684){utils[_0xeecc('0x17')](util['format'](_0xeecc('0x11'),_0x5f4fce[_0xeecc('0x3')]),_0x32b684);}};exports[_0xeecc('0x18')]=function(_0x5d41a7){try{if(!_[_0xeecc('0x19')](queues[_0x5d41a7['uniqueid']])){utils['debug'](util[_0xeecc('0x2')](_0xeecc('0x1a'),_0x5d41a7['uniqueid']),_0x5d41a7);if(queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x1b')]){if(!queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x1c')]&&!queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x1d')]){queues[_0x5d41a7[_0xeecc('0x3')]]['queuecallercomplete']=!![];queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x1e')]=utils[_0xeecc('0x16')]();queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x9')]=_0xeecc('0x1f');}utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x20'),_0x5d41a7[_0xeecc('0x3')],queues[_0x5d41a7['uniqueid']][_0xeecc('0x21')],queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x9')]));writeDB(queues[_0x5d41a7[_0xeecc('0x3')]]);}else if(queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x22')]){utils[_0xeecc('0x12')](util['format'](_0xeecc('0x23'),_0x5d41a7[_0xeecc('0x3')],queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x21')],queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x22')]));queues[queues[_0x5d41a7[_0xeecc('0x3')]][_0xeecc('0x22')]]=queues[_0x5d41a7[_0xeecc('0x3')]];queues[queues[_0x5d41a7[_0xeecc('0x3')]]['transfereduniqueid']][_0xeecc('0x24')]=0x2;delete queues[_0x5d41a7[_0xeecc('0x3')]];}}}catch(_0x583f34){utils['error'](util[_0xeecc('0x2')](_0xeecc('0x1a'),_0x5d41a7[_0xeecc('0x3')]),_0x583f34);}};exports[_0xeecc('0x25')]=function(_0x3b1204){try{utils[_0xeecc('0x10')](util[_0xeecc('0x2')](_0xeecc('0x26'),_0x3b1204['uniqueid']),_0x3b1204);if(!_[_0xeecc('0x19')](_0x3b1204['variable']['queuestatus'])&&_0x3b1204['value'][_0xeecc('0x27')]()!=='CONTINUE'){if(!_[_0xeecc('0x19')](queues[_0x3b1204[_0xeecc('0x3')]])){queues[_0x3b1204['uniqueid']]['queuecallerabandon']=![];queues[_0x3b1204['uniqueid']][_0xeecc('0x28')]=null;queues[_0x3b1204['uniqueid']]['queuecallerexit']=!![];queues[_0x3b1204[_0xeecc('0x3')]][_0xeecc('0x29')]=utils[_0xeecc('0x16')]();queues[_0x3b1204[_0xeecc('0x3')]][_0xeecc('0x9')]=_0x3b1204[_0xeecc('0x2a')][_0xeecc('0x27')]();utils[_0xeecc('0x12')](util[_0xeecc('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x3b1204[_0xeecc('0x3')],queues[_0x3b1204[_0xeecc('0x3')]][_0xeecc('0x21')],_0x3b1204[_0xeecc('0x2a')],queues[_0x3b1204[_0xeecc('0x3')]][_0xeecc('0x9')]));writeDB(queues[_0x3b1204[_0xeecc('0x3')]]);}}else if(!_[_0xeecc('0x19')](_0x3b1204[_0xeecc('0x2b')][_0xeecc('0x2c')])){if(!_[_0xeecc('0x19')](queues[_0x3b1204['uniqueid']])&&!queues[_0x3b1204[_0xeecc('0x3')]][_0xeecc('0x1c')]){queues[_0x3b1204[_0xeecc('0x3')]][_0xeecc('0x1c')]=![];queues[_0x3b1204[_0xeecc('0x3')]][_0xeecc('0x28')]=null;queues[_0x3b1204[_0xeecc('0x3')]]['queuecallerexit']=!![];queues[_0x3b1204['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x3b1204[_0xeecc('0x3')]][_0xeecc('0x9')]='EXITWITHKEY';utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x2d'),_0x3b1204[_0xeecc('0x3')],queues[_0x3b1204[_0xeecc('0x3')]]['name'],_0x3b1204[_0xeecc('0x2a')],queues[_0x3b1204[_0xeecc('0x3')]][_0xeecc('0x9')]));}}}catch(_0x32b99e){utils[_0xeecc('0x17')](util['format']('[%s][queues][varset]',_0x3b1204['uniqueid']),_0x32b99e);}};exports[_0xeecc('0x1c')]=function(_0x92049d){try{if(!_['isNil'](queues[_0x92049d['uniqueid']])){utils[_0xeecc('0x10')](util[_0xeecc('0x2')](_0xeecc('0x2e'),_0x92049d[_0xeecc('0x3')]),_0x92049d);queues[_0x92049d[_0xeecc('0x3')]][_0xeecc('0x1d')]=![];queues[_0x92049d['uniqueid']]['queuecallerexitAt']=null;queues[_0x92049d['uniqueid']][_0xeecc('0x1c')]=!![];queues[_0x92049d[_0xeecc('0x3')]][_0xeecc('0x28')]=utils[_0xeecc('0x16')]();queues[_0x92049d[_0xeecc('0x3')]]['queuecallerexitreason']=_0xeecc('0x2f');utils['info'](util['format'](_0xeecc('0x30'),_0x92049d[_0xeecc('0x3')],queues[_0x92049d[_0xeecc('0x3')]]['name'],queues[_0x92049d[_0xeecc('0x3')]][_0xeecc('0x9')]));}}catch(_0x244040){utils[_0xeecc('0x17')](util[_0xeecc('0x2')](_0xeecc('0x2e'),_0x92049d[_0xeecc('0x3')]),_0x244040);}};exports[_0xeecc('0x31')]=function(_0x15f6e8){try{if(!_[_0xeecc('0x19')](queues[_0x15f6e8[_0xeecc('0x3')]])){utils[_0xeecc('0x10')](util[_0xeecc('0x2')](_0xeecc('0x32'),_0x15f6e8[_0xeecc('0x3')]),_0x15f6e8);utils[_0xeecc('0x12')](util[_0xeecc('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x15f6e8[_0xeecc('0x3')],queues[_0x15f6e8[_0xeecc('0x3')]]['name'],_0x15f6e8[_0xeecc('0x33')],_0x15f6e8[_0xeecc('0x34')]));queues[_0x15f6e8[_0xeecc('0x3')]]['queuecallerleave']=!![];queues[_0x15f6e8[_0xeecc('0x3')]][_0xeecc('0x1b')]=utils[_0xeecc('0x16')]();queues[_0x15f6e8[_0xeecc('0x3')]][_0xeecc('0x35')]=utils[_0xeecc('0x36')](queues[_0x15f6e8[_0xeecc('0x3')]][_0xeecc('0x1b')],queues[_0x15f6e8[_0xeecc('0x3')]][_0xeecc('0x37')]);queues[_0x15f6e8[_0xeecc('0x3')]][_0xeecc('0x14')]=_0x15f6e8[_0xeecc('0x14')];queues[_0x15f6e8['uniqueid']]['count']=_0x15f6e8[_0xeecc('0x38')];queues[_0x15f6e8[_0xeecc('0x3')]][_0xeecc('0x33')]=_0x15f6e8['connectedlinenum'];queues[_0x15f6e8['uniqueid']][_0xeecc('0x34')]=_0x15f6e8[_0xeecc('0x34')];}}catch(_0x758bcb){utils['error'](util[_0xeecc('0x2')](_0xeecc('0x32'),_0x15f6e8[_0xeecc('0x3')]),_0x758bcb);}};exports[_0xeecc('0x39')]=function(_0x31fa40){try{if(!_[_0xeecc('0x19')](queues[_0x31fa40['uniqueid']])){utils[_0xeecc('0x10')](util['format'](_0xeecc('0x3a'),_0x31fa40[_0xeecc('0x3')]),_0x31fa40);utils[_0xeecc('0x12')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x31fa40['uniqueid'],queues[_0x31fa40[_0xeecc('0x3')]][_0xeecc('0x21')],_0x31fa40['membername'],_0x31fa40[_0xeecc('0x3b')]));queues[_0x31fa40[_0xeecc('0x3')]][_0xeecc('0x1c')]=![];queues[_0x31fa40[_0xeecc('0x3')]][_0xeecc('0x1c')]=![];queues[_0x31fa40[_0xeecc('0x3')]]['queuecallerabandonAt']=null;queues[_0x31fa40['uniqueid']][_0xeecc('0x1d')]=![];queues[_0x31fa40[_0xeecc('0x3')]][_0xeecc('0x9')]=null;queues[_0x31fa40['uniqueid']][_0xeecc('0x29')]=null;queues[_0x31fa40['uniqueid']][_0xeecc('0x3c')]=!![];queues[_0x31fa40[_0xeecc('0x3')]]['accountcode']=_0x31fa40['destaccountcode'];queues[_0x31fa40[_0xeecc('0x3')]][_0xeecc('0x6')]=_0x31fa40[_0xeecc('0x3d')];}}catch(_0x1583d6){utils[_0xeecc('0x17')](util['format'](_0xeecc('0x3a'),_0x31fa40[_0xeecc('0x3')]),_0x1583d6);}};exports[_0xeecc('0x3e')]=function(_0x2647f7){try{if(!_[_0xeecc('0x19')](queues[_0x2647f7['uniqueid']])){if(queues[_0x2647f7[_0xeecc('0x3')]][_0xeecc('0x1b')]){utils['debug'](util[_0xeecc('0x2')](_0xeecc('0x3f'),_0x2647f7[_0xeecc('0x3')]),_0x2647f7);queues[_0x2647f7[_0xeecc('0x3')]][_0xeecc('0x1c')]=![];queues[_0x2647f7['uniqueid']]['queuecallerabandon']=![];queues[_0x2647f7['uniqueid']]['queuecallerabandonAt']=null;queues[_0x2647f7[_0xeecc('0x3')]]['queuecallerexit']=![];queues[_0x2647f7['uniqueid']][_0xeecc('0x29')]=null;queues[_0x2647f7[_0xeecc('0x3')]][_0xeecc('0x3c')]=!![];queues[_0x2647f7['uniqueid']][_0xeecc('0x6')]=_0x2647f7[_0xeecc('0x3d')];queues[_0x2647f7[_0xeecc('0x3')]][_0xeecc('0x40')]=!![];queues[_0x2647f7[_0xeecc('0x3')]][_0xeecc('0x1e')]=utils[_0xeecc('0x16')]();if(_0x2647f7[_0xeecc('0x41')]=='transfer'){if(!queues[_0x2647f7[_0xeecc('0x3')]][_0xeecc('0x42')]){queues[_0x2647f7[_0xeecc('0x3')]][_0xeecc('0x9')]=_0xeecc('0x43');}}else{queues[_0x2647f7[_0xeecc('0x3')]][_0xeecc('0x9')]='COMPLETEDBY'+_0x2647f7[_0xeecc('0x41')][_0xeecc('0x27')]();}utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x44'),_0x2647f7['uniqueid'],queues[_0x2647f7[_0xeecc('0x3')]]['name'],_0x2647f7[_0xeecc('0x3d')],queues[_0x2647f7[_0xeecc('0x3')]][_0xeecc('0x9')]));writeDB(queues[_0x2647f7[_0xeecc('0x3')]]);}}}catch(_0x2651d1){utils['error'](util[_0xeecc('0x2')]('[%s][queues][agentcomplete]',_0x2647f7['uniqueid']),_0x2651d1);}};exports[_0xeecc('0x45')]=function(_0x1170de){try{if(!_['isNil'](queues[_0x1170de['transfereeuniqueid']])){utils[_0xeecc('0x10')](util['format'](_0xeecc('0x46'),_0x1170de[_0xeecc('0x3')]),_0x1170de);queues[_0x1170de[_0xeecc('0x47')]][_0xeecc('0x42')]=!![];queues[_0x1170de[_0xeecc('0x47')]][_0xeecc('0x48')]='BLIND';queues[_0x1170de[_0xeecc('0x47')]][_0xeecc('0x49')]=_0x1170de['extension'];queues[_0x1170de[_0xeecc('0x47')]][_0xeecc('0x4a')]=_0x1170de[_0xeecc('0x47')];queues[_0x1170de[_0xeecc('0x47')]][_0xeecc('0x9')]='BLINDTRANSFER';utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x4b'),_0x1170de[_0xeecc('0x3')],queues[_0x1170de[_0xeecc('0x47')]][_0xeecc('0x21')],_0x1170de[_0xeecc('0x47')],_0x1170de[_0xeecc('0x4c')]));}}catch(_0x135ded){utils[_0xeecc('0x17')](util[_0xeecc('0x2')](_0xeecc('0x46'),_0x1170de[_0xeecc('0x3')]),_0x135ded);}};exports['attendedtransfer']=function(_0x4c4b42){try{utils['debug'](util[_0xeecc('0x2')](_0xeecc('0x4d'),_0x4c4b42[_0xeecc('0x4e')]),_0x4c4b42);if(_0x4c4b42[_0xeecc('0x4e')]==_0x4c4b42[_0xeecc('0x4f')]){if(!_[_0xeecc('0x19')](queues[_0x4c4b42[_0xeecc('0x50')]])){utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x51'),_0x4c4b42['origtransfereruniqueid'],queues[_0x4c4b42[_0xeecc('0x50')]][_0xeecc('0x21')],_0x4c4b42[_0xeecc('0x52')]));queues[_0x4c4b42[_0xeecc('0x50')]]['transfer']=!![];queues[_0x4c4b42[_0xeecc('0x50')]]['transfertype']=_0xeecc('0x53');queues[_0x4c4b42[_0xeecc('0x50')]][_0xeecc('0x49')]=_0x4c4b42['origtransfererexten'];queues[_0x4c4b42[_0xeecc('0x50')]][_0xeecc('0x4a')]=_0x4c4b42[_0xeecc('0x4e')];queues[_0x4c4b42['secondtransfererlinkedid']][_0xeecc('0x9')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x4c4b42[_0xeecc('0x4f')]])){if(_0x4c4b42[_0xeecc('0x54')]&&queues[_0x4c4b42[_0xeecc('0x54')]]){queues[_0x4c4b42[_0xeecc('0x54')]][_0xeecc('0x24')]=0x1;queues[_0x4c4b42[_0xeecc('0x47')]]=_[_0xeecc('0x55')](queues[_0x4c4b42[_0xeecc('0x54')]]);queues[_0x4c4b42[_0xeecc('0x47')]][_0xeecc('0x22')]=_0x4c4b42[_0xeecc('0x56')];queues[_0x4c4b42[_0xeecc('0x47')]]['queuecallerenterreason']=0x2;queues[_0x4c4b42[_0xeecc('0x47')]][_0xeecc('0x7')]=queues[_0x4c4b42['secondtransfererlinkedid']][_0xeecc('0x7')];queues[_0x4c4b42[_0xeecc('0x47')]][_0xeecc('0x57')]=queues[_0x4c4b42[_0xeecc('0x50')]]['calleridname'];queues[_0x4c4b42['transfereeuniqueid']][_0xeecc('0x37')]=utils[_0xeecc('0x16')]();queues[_0x4c4b42[_0xeecc('0x47')]][_0xeecc('0x1b')]=utils[_0xeecc('0x16')]();queues[_0x4c4b42[_0xeecc('0x47')]][_0xeecc('0x35')]=0x0;queues[_0x4c4b42[_0xeecc('0x47')]][_0xeecc('0x58')]=0x0;utils[_0xeecc('0x12')](util['format'](_0xeecc('0x59'),_0x4c4b42['origtransfereruniqueid'],queues[_0x4c4b42['transfereeuniqueid']][_0xeecc('0x21')],queues[_0x4c4b42[_0xeecc('0x47')]]['calleridnum'],queues[_0x4c4b42['transfereeuniqueid']][_0xeecc('0x57')]));}else{utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x5a'),_0x4c4b42[_0xeecc('0x4e')],queues[_0x4c4b42[_0xeecc('0x4f')]][_0xeecc('0x21')],_0x4c4b42['secondtransfererlinkedid']));queues[_0x4c4b42['origtransfererlinkedid']][_0xeecc('0x22')]=_0x4c4b42[_0xeecc('0x50')];}}}else if(_0x4c4b42[_0xeecc('0x5b')]==_0x4c4b42[_0xeecc('0x50')]){if(!_[_0xeecc('0x19')](queues[_0x4c4b42[_0xeecc('0x4f')]])){utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x5c'),_0x4c4b42[_0xeecc('0x4e')],queues[_0x4c4b42[_0xeecc('0x4f')]][_0xeecc('0x21')],_0x4c4b42[_0xeecc('0x5b')],_0x4c4b42[_0xeecc('0x5d')]));queues[_0x4c4b42['origtransfererlinkedid']][_0xeecc('0x42')]=!![];queues[_0x4c4b42[_0xeecc('0x4f')]][_0xeecc('0x48')]='ATTENDED';queues[_0x4c4b42[_0xeecc('0x4f')]][_0xeecc('0x49')]=_0x4c4b42[_0xeecc('0x5d')];queues[_0x4c4b42[_0xeecc('0x4f')]][_0xeecc('0x4a')]=_0x4c4b42['secondtransfereruniqueid'];queues[_0x4c4b42[_0xeecc('0x4f')]]['queuecallerexitreason']=_0xeecc('0x5e');}if(!_['isNil'](queues[_0x4c4b42[_0xeecc('0x50')]])){if(_0x4c4b42['transfertargetlinkedid']&&queues[_0x4c4b42[_0xeecc('0x5f')]]){queues[_0x4c4b42[_0xeecc('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x4c4b42[_0xeecc('0x56')]]=_[_0xeecc('0x55')](queues[_0x4c4b42[_0xeecc('0x5f')]]);queues[_0x4c4b42[_0xeecc('0x56')]][_0xeecc('0x22')]=_0x4c4b42[_0xeecc('0x56')];queues[_0x4c4b42[_0xeecc('0x56')]][_0xeecc('0x24')]=0x2;queues[_0x4c4b42[_0xeecc('0x56')]]['calleridnum']=queues[_0x4c4b42['origtransfererlinkedid']][_0xeecc('0x7')];queues[_0x4c4b42[_0xeecc('0x56')]]['calleridname']=queues[_0x4c4b42[_0xeecc('0x4f')]][_0xeecc('0x57')];queues[_0x4c4b42[_0xeecc('0x56')]]['queuecallerjoinAt']=utils[_0xeecc('0x16')]();queues[_0x4c4b42['transfertargetuniqueid']][_0xeecc('0x1b')]=utils[_0xeecc('0x16')]();queues[_0x4c4b42['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x4c4b42[_0xeecc('0x56')]][_0xeecc('0x58')]=0x0;utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x60'),_0x4c4b42[_0xeecc('0x4e')],queues[_0x4c4b42['transfertargetuniqueid']][_0xeecc('0x21')],queues[_0x4c4b42[_0xeecc('0x56')]]['transfereduniqueid'],queues[_0x4c4b42[_0xeecc('0x56')]]['calleridnum'],queues[_0x4c4b42[_0xeecc('0x56')]]['calleridname']));}else{utils[_0xeecc('0x12')](util[_0xeecc('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4c4b42[_0xeecc('0x4e')],queues[_0x4c4b42[_0xeecc('0x50')]][_0xeecc('0x21')],_0x4c4b42['origtransfererlinkedid']));queues[_0x4c4b42[_0xeecc('0x50')]][_0xeecc('0x22')]=_0x4c4b42[_0xeecc('0x4f')];}}}}catch(_0x130c24){utils[_0xeecc('0x17')](util[_0xeecc('0x2')](_0xeecc('0x4d'),_0x4c4b42[_0xeecc('0x4e')]),_0x130c24);}};exports['musiconholdstart']=function(_0x59517a){try{if(!_['isNil'](queues[_0x59517a[_0xeecc('0x3')]])){utils['debug'](util['format'](_0xeecc('0x61'),_0x59517a['uniqueid']),_0x59517a);queues[_0x59517a[_0xeecc('0x3')]][_0xeecc('0x62')]=utils[_0xeecc('0x16')]();utils[_0xeecc('0x12')](util[_0xeecc('0x2')](_0xeecc('0x63'),_0x59517a['uniqueid'],queues[_0x59517a[_0xeecc('0x3')]][_0xeecc('0x21')],queues[_0x59517a[_0xeecc('0x3')]][_0xeecc('0x62')]));}}catch(_0x64da14){utils['error'](util['format']('[%s][queues][musiconholdstart]',_0x59517a[_0xeecc('0x3')]),_0x64da14);}};exports[_0xeecc('0x64')]=function(_0x3e1f9b){try{if(!_[_0xeecc('0x19')](queues[_0x3e1f9b[_0xeecc('0x3')]])){if(!_[_0xeecc('0x19')](queues[_0x3e1f9b['uniqueid']][_0xeecc('0x62')])){utils[_0xeecc('0x10')](util[_0xeecc('0x2')](_0xeecc('0x65'),_0x3e1f9b['uniqueid']),_0x3e1f9b);queues[_0x3e1f9b[_0xeecc('0x3')]]['mohtime']+=utils['diffTime'](utils[_0xeecc('0x16')](),queues[_0x3e1f9b[_0xeecc('0x3')]][_0xeecc('0x62')]);utils[_0xeecc('0x12')](util[_0xeecc('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x3e1f9b['uniqueid'],queues[_0x3e1f9b[_0xeecc('0x3')]][_0xeecc('0x21')],queues[_0x3e1f9b[_0xeecc('0x3')]][_0xeecc('0x58')]));delete queues[_0x3e1f9b[_0xeecc('0x3')]][_0xeecc('0x62')];}}}catch(_0xa223e6){utils[_0xeecc('0x17')](util[_0xeecc('0x2')]('[%s][queues][musiconholdstop]',_0x3e1f9b[_0xeecc('0x3')]),_0xa223e6);}}; \ No newline at end of file +var _0xead9=['secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','queuecallerenterreason','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerexitAt','queuecallerabandonAt','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','[%s][queues][agentcomplete]','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x234d27,_0x226d93){var _0xf365cc=function(_0x5520ba){while(--_0x5520ba){_0x234d27['push'](_0x234d27['shift']());}};_0xf365cc(++_0x226d93);}(_0xead9,0x144));var _0x9ead=function(_0x3488bc,_0x5a5a28){_0x3488bc=_0x3488bc-0x0;var _0x55ab07=_0xead9[_0x3488bc];return _0x55ab07;};'use strict';var _=require(_0x9ead('0x0'));var util=require(_0x9ead('0x1'));var utils=require(_0x9ead('0x2'));var queues={};function writeDB(_0xd52e4f){utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x5'),_0xd52e4f['uniqueid'],_0xd52e4f[_0x9ead('0x6')],_0xd52e4f[_0x9ead('0x7')],_0xd52e4f['lastAssignedTo'],_0xd52e4f['calleridnum'],_0xd52e4f[_0x9ead('0x8')],_0xd52e4f[_0x9ead('0x9')]));if(_0xd52e4f['queue']){utils[_0x9ead('0xa')](_0xd52e4f[_0x9ead('0x7')])[_0x9ead('0xb')](function(_0x12c6ff){if(_0x12c6ff){_0xd52e4f[_0x9ead('0xc')]=_0x12c6ff[_0x9ead('0xc')];}utils['request'](_0x9ead('0xd'),_0xd52e4f);});}else{utils[_0x9ead('0xe')](_0x9ead('0xd'),_0xd52e4f);}if(_0xd52e4f['transfereduniqueid']){delete queues[_0xd52e4f[_0x9ead('0xf')]];}else{delete queues[_0xd52e4f[_0x9ead('0x10')]];}}exports[_0x9ead('0x11')]=function(_0x5af10f){try{utils[_0x9ead('0x12')](util[_0x9ead('0x4')](_0x9ead('0x13'),_0x5af10f[_0x9ead('0x10')]),_0x5af10f);utils[_0x9ead('0x3')](util[_0x9ead('0x4')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x5af10f[_0x9ead('0x10')],_0x5af10f[_0x9ead('0x7')],_0x5af10f[_0x9ead('0x14')]));queues[_0x5af10f['uniqueid']]=_[_0x9ead('0x15')](_0x5af10f,{'originalposition':_0x5af10f[_0x9ead('0x14')],'queuecallerjoinAt':utils[_0x9ead('0x16')](),'mohtime':0x0});}catch(_0x5ced5a){utils[_0x9ead('0x17')](util[_0x9ead('0x4')](_0x9ead('0x13'),_0x5af10f[_0x9ead('0x10')]),_0x5ced5a);}};exports['hangup']=function(_0x2f823e){try{if(!_[_0x9ead('0x18')](queues[_0x2f823e[_0x9ead('0x10')]])){utils[_0x9ead('0x12')](util[_0x9ead('0x4')](_0x9ead('0x19'),_0x2f823e['uniqueid']),_0x2f823e);if(queues[_0x2f823e['uniqueid']][_0x9ead('0x1a')]){if(!queues[_0x2f823e['uniqueid']][_0x9ead('0x1b')]&&!queues[_0x2f823e[_0x9ead('0x10')]]['queuecallerexit']){queues[_0x2f823e[_0x9ead('0x10')]][_0x9ead('0x1c')]=!![];queues[_0x2f823e[_0x9ead('0x10')]][_0x9ead('0x1d')]=utils[_0x9ead('0x16')]();queues[_0x2f823e['uniqueid']]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x9ead('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x2f823e[_0x9ead('0x10')],queues[_0x2f823e['uniqueid']]['name'],queues[_0x2f823e['uniqueid']][_0x9ead('0x9')]));writeDB(queues[_0x2f823e[_0x9ead('0x10')]]);}else if(queues[_0x2f823e[_0x9ead('0x10')]][_0x9ead('0xf')]){utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x1e'),_0x2f823e[_0x9ead('0x10')],queues[_0x2f823e['uniqueid']][_0x9ead('0x1f')],queues[_0x2f823e[_0x9ead('0x10')]][_0x9ead('0xf')]));queues[queues[_0x2f823e[_0x9ead('0x10')]][_0x9ead('0xf')]]=queues[_0x2f823e['uniqueid']];queues[queues[_0x2f823e[_0x9ead('0x10')]][_0x9ead('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x2f823e[_0x9ead('0x10')]];}}}catch(_0x5c895b){utils[_0x9ead('0x17')](util[_0x9ead('0x4')]('[%s][queues][hangup]',_0x2f823e[_0x9ead('0x10')]),_0x5c895b);}};exports[_0x9ead('0x20')]=function(_0x4e1e72){try{utils['debug'](util['format'](_0x9ead('0x21'),_0x4e1e72[_0x9ead('0x10')]),_0x4e1e72);if(!_['isNil'](_0x4e1e72[_0x9ead('0x22')][_0x9ead('0x23')])&&_0x4e1e72[_0x9ead('0x24')][_0x9ead('0x25')]()!==_0x9ead('0x26')){if(!_[_0x9ead('0x18')](queues[_0x4e1e72[_0x9ead('0x10')]])){queues[_0x4e1e72['uniqueid']][_0x9ead('0x1b')]=![];queues[_0x4e1e72[_0x9ead('0x10')]]['queuecallerabandonAt']=null;queues[_0x4e1e72[_0x9ead('0x10')]][_0x9ead('0x27')]=!![];queues[_0x4e1e72[_0x9ead('0x10')]]['queuecallerexitAt']=utils[_0x9ead('0x16')]();queues[_0x4e1e72[_0x9ead('0x10')]][_0x9ead('0x9')]=_0x4e1e72['value'][_0x9ead('0x25')]();utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x28'),_0x4e1e72[_0x9ead('0x10')],queues[_0x4e1e72[_0x9ead('0x10')]][_0x9ead('0x1f')],_0x4e1e72[_0x9ead('0x24')],queues[_0x4e1e72[_0x9ead('0x10')]][_0x9ead('0x9')]));writeDB(queues[_0x4e1e72[_0x9ead('0x10')]]);}}else if(!_[_0x9ead('0x18')](_0x4e1e72['variable']['queueposition'])){if(!_[_0x9ead('0x18')](queues[_0x4e1e72[_0x9ead('0x10')]])&&!queues[_0x4e1e72['uniqueid']]['queuecallerabandon']){queues[_0x4e1e72[_0x9ead('0x10')]][_0x9ead('0x1b')]=![];queues[_0x4e1e72[_0x9ead('0x10')]]['queuecallerabandonAt']=null;queues[_0x4e1e72[_0x9ead('0x10')]]['queuecallerexit']=!![];queues[_0x4e1e72[_0x9ead('0x10')]]['queuecallerexitAt']=utils['now']();queues[_0x4e1e72['uniqueid']][_0x9ead('0x9')]='EXITWITHKEY';utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x29'),_0x4e1e72[_0x9ead('0x10')],queues[_0x4e1e72[_0x9ead('0x10')]][_0x9ead('0x1f')],_0x4e1e72[_0x9ead('0x24')],queues[_0x4e1e72[_0x9ead('0x10')]][_0x9ead('0x9')]));}}}catch(_0x456965){utils[_0x9ead('0x17')](util['format'](_0x9ead('0x21'),_0x4e1e72['uniqueid']),_0x456965);}};exports['queuecallerabandon']=function(_0x26b5f3){try{if(!_[_0x9ead('0x18')](queues[_0x26b5f3[_0x9ead('0x10')]])){utils[_0x9ead('0x12')](util[_0x9ead('0x4')](_0x9ead('0x2a'),_0x26b5f3['uniqueid']),_0x26b5f3);queues[_0x26b5f3[_0x9ead('0x10')]]['queuecallerexit']=![];queues[_0x26b5f3[_0x9ead('0x10')]][_0x9ead('0x2b')]=null;queues[_0x26b5f3[_0x9ead('0x10')]][_0x9ead('0x1b')]=!![];queues[_0x26b5f3[_0x9ead('0x10')]][_0x9ead('0x2c')]=utils[_0x9ead('0x16')]();queues[_0x26b5f3[_0x9ead('0x10')]][_0x9ead('0x9')]='ABANDONED';utils[_0x9ead('0x3')](util[_0x9ead('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x26b5f3['uniqueid'],queues[_0x26b5f3[_0x9ead('0x10')]]['name'],queues[_0x26b5f3['uniqueid']]['queuecallerexitreason']));}}catch(_0x50c169){utils[_0x9ead('0x17')](util[_0x9ead('0x4')](_0x9ead('0x2a'),_0x26b5f3[_0x9ead('0x10')]),_0x50c169);}};exports[_0x9ead('0x2d')]=function(_0x4640fc){try{if(!_['isNil'](queues[_0x4640fc[_0x9ead('0x10')]])){utils[_0x9ead('0x12')](util['format'](_0x9ead('0x2e'),_0x4640fc['uniqueid']),_0x4640fc);utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x2f'),_0x4640fc['uniqueid'],queues[_0x4640fc[_0x9ead('0x10')]]['name'],_0x4640fc[_0x9ead('0x30')],_0x4640fc[_0x9ead('0x31')]));queues[_0x4640fc[_0x9ead('0x10')]][_0x9ead('0x2d')]=!![];queues[_0x4640fc['uniqueid']]['queuecallerleaveAt']=utils[_0x9ead('0x16')]();queues[_0x4640fc[_0x9ead('0x10')]][_0x9ead('0x32')]=utils[_0x9ead('0x33')](queues[_0x4640fc[_0x9ead('0x10')]][_0x9ead('0x1a')],queues[_0x4640fc['uniqueid']]['queuecallerjoinAt']);queues[_0x4640fc[_0x9ead('0x10')]]['position']=_0x4640fc[_0x9ead('0x14')];queues[_0x4640fc[_0x9ead('0x10')]]['count']=_0x4640fc[_0x9ead('0x34')];queues[_0x4640fc[_0x9ead('0x10')]][_0x9ead('0x30')]=_0x4640fc['connectedlinenum'];queues[_0x4640fc[_0x9ead('0x10')]][_0x9ead('0x31')]=_0x4640fc['connectedlinename'];}}catch(_0x2215ae){utils[_0x9ead('0x17')](util['format'](_0x9ead('0x2e'),_0x4640fc[_0x9ead('0x10')]),_0x2215ae);}};exports[_0x9ead('0x35')]=function(_0x3dbd73){try{if(!_[_0x9ead('0x18')](queues[_0x3dbd73['uniqueid']])){utils['debug'](util['format']('[%s][queues][agentconnect]',_0x3dbd73[_0x9ead('0x10')]),_0x3dbd73);utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x36'),_0x3dbd73[_0x9ead('0x10')],queues[_0x3dbd73[_0x9ead('0x10')]][_0x9ead('0x1f')],_0x3dbd73[_0x9ead('0x37')],_0x3dbd73[_0x9ead('0x38')]));queues[_0x3dbd73[_0x9ead('0x10')]][_0x9ead('0x1b')]=![];queues[_0x3dbd73[_0x9ead('0x10')]]['queuecallerabandon']=![];queues[_0x3dbd73[_0x9ead('0x10')]][_0x9ead('0x2c')]=null;queues[_0x3dbd73[_0x9ead('0x10')]]['queuecallerexit']=![];queues[_0x3dbd73[_0x9ead('0x10')]]['queuecallerexitreason']=null;queues[_0x3dbd73['uniqueid']][_0x9ead('0x2b')]=null;queues[_0x3dbd73[_0x9ead('0x10')]][_0x9ead('0x39')]=!![];queues[_0x3dbd73[_0x9ead('0x10')]][_0x9ead('0x8')]=_0x3dbd73[_0x9ead('0x38')];queues[_0x3dbd73['uniqueid']][_0x9ead('0x3a')]=_0x3dbd73[_0x9ead('0x37')];}}catch(_0x3ef562){utils['error'](util[_0x9ead('0x4')]('[%s][queues][agentconnect]',_0x3dbd73[_0x9ead('0x10')]),_0x3ef562);}};exports['agentcomplete']=function(_0x554bdb){try{if(!_[_0x9ead('0x18')](queues[_0x554bdb[_0x9ead('0x10')]])){if(queues[_0x554bdb[_0x9ead('0x10')]]['queuecallerleaveAt']){utils[_0x9ead('0x12')](util[_0x9ead('0x4')](_0x9ead('0x3b'),_0x554bdb[_0x9ead('0x10')]),_0x554bdb);queues[_0x554bdb[_0x9ead('0x10')]]['queuecallerabandon']=![];queues[_0x554bdb[_0x9ead('0x10')]]['queuecallerabandon']=![];queues[_0x554bdb[_0x9ead('0x10')]][_0x9ead('0x2c')]=null;queues[_0x554bdb['uniqueid']][_0x9ead('0x27')]=![];queues[_0x554bdb['uniqueid']][_0x9ead('0x2b')]=null;queues[_0x554bdb['uniqueid']][_0x9ead('0x39')]=!![];queues[_0x554bdb['uniqueid']][_0x9ead('0x3a')]=_0x554bdb[_0x9ead('0x37')];queues[_0x554bdb['uniqueid']][_0x9ead('0x1c')]=!![];queues[_0x554bdb[_0x9ead('0x10')]][_0x9ead('0x1d')]=utils['now']();if(_0x554bdb['reason']==_0x9ead('0x3c')){if(!queues[_0x554bdb[_0x9ead('0x10')]][_0x9ead('0x3c')]){queues[_0x554bdb[_0x9ead('0x10')]][_0x9ead('0x9')]='TRANSFER';}}else{queues[_0x554bdb[_0x9ead('0x10')]][_0x9ead('0x9')]=_0x9ead('0x3d')+_0x554bdb['reason']['toUpperCase']();}utils[_0x9ead('0x3')](util['format'](_0x9ead('0x3e'),_0x554bdb[_0x9ead('0x10')],queues[_0x554bdb[_0x9ead('0x10')]][_0x9ead('0x1f')],_0x554bdb[_0x9ead('0x37')],queues[_0x554bdb['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x554bdb[_0x9ead('0x10')]]);}}}catch(_0x427bb3){utils[_0x9ead('0x17')](util[_0x9ead('0x4')](_0x9ead('0x3b'),_0x554bdb['uniqueid']),_0x427bb3);}};exports[_0x9ead('0x3f')]=function(_0x3e2ad5){try{if(!_[_0x9ead('0x18')](queues[_0x3e2ad5[_0x9ead('0x40')]])){utils[_0x9ead('0x12')](util[_0x9ead('0x4')]('[%s][queues][blindtransfer]',_0x3e2ad5[_0x9ead('0x10')]),_0x3e2ad5);queues[_0x3e2ad5[_0x9ead('0x40')]][_0x9ead('0x3c')]=!![];queues[_0x3e2ad5[_0x9ead('0x40')]][_0x9ead('0x41')]=_0x9ead('0x42');queues[_0x3e2ad5[_0x9ead('0x40')]][_0x9ead('0x43')]=_0x3e2ad5[_0x9ead('0x44')];queues[_0x3e2ad5['transfereeuniqueid']][_0x9ead('0x45')]=_0x3e2ad5[_0x9ead('0x40')];queues[_0x3e2ad5[_0x9ead('0x40')]]['queuecallerexitreason']=_0x9ead('0x46');utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x47'),_0x3e2ad5[_0x9ead('0x10')],queues[_0x3e2ad5['transfereeuniqueid']][_0x9ead('0x1f')],_0x3e2ad5[_0x9ead('0x40')],_0x3e2ad5['extension']));}}catch(_0x578ece){utils[_0x9ead('0x17')](util['format'](_0x9ead('0x48'),_0x3e2ad5['uniqueid']),_0x578ece);}};exports[_0x9ead('0x49')]=function(_0x4d465a){try{utils['debug'](util[_0x9ead('0x4')]('[%s][queues][attendedtransfer]',_0x4d465a['origtransfereruniqueid']),_0x4d465a);if(_0x4d465a[_0x9ead('0x4a')]==_0x4d465a[_0x9ead('0x4b')]){if(!_[_0x9ead('0x18')](queues[_0x4d465a[_0x9ead('0x4c')]])){utils['info'](util[_0x9ead('0x4')](_0x9ead('0x4d'),_0x4d465a[_0x9ead('0x4a')],queues[_0x4d465a[_0x9ead('0x4c')]]['name'],_0x4d465a['origtransfererexten']));queues[_0x4d465a['secondtransfererlinkedid']][_0x9ead('0x3c')]=!![];queues[_0x4d465a[_0x9ead('0x4c')]][_0x9ead('0x41')]=_0x9ead('0x4e');queues[_0x4d465a[_0x9ead('0x4c')]][_0x9ead('0x43')]=_0x4d465a[_0x9ead('0x4f')];queues[_0x4d465a[_0x9ead('0x4c')]][_0x9ead('0x45')]=_0x4d465a['origtransfereruniqueid'];queues[_0x4d465a['secondtransfererlinkedid']][_0x9ead('0x9')]=_0x9ead('0x50');}if(!_[_0x9ead('0x18')](queues[_0x4d465a[_0x9ead('0x4b')]])){if(_0x4d465a[_0x9ead('0x51')]&&queues[_0x4d465a[_0x9ead('0x51')]]){queues[_0x4d465a[_0x9ead('0x51')]]['queuecallerenterreason']=0x1;queues[_0x4d465a[_0x9ead('0x40')]]=_['clone'](queues[_0x4d465a[_0x9ead('0x51')]]);queues[_0x4d465a[_0x9ead('0x40')]]['transfereduniqueid']=_0x4d465a['transfertargetuniqueid'];queues[_0x4d465a[_0x9ead('0x40')]]['queuecallerenterreason']=0x2;queues[_0x4d465a[_0x9ead('0x40')]][_0x9ead('0x52')]=queues[_0x4d465a[_0x9ead('0x4c')]][_0x9ead('0x52')];queues[_0x4d465a[_0x9ead('0x40')]]['calleridname']=queues[_0x4d465a[_0x9ead('0x4c')]][_0x9ead('0x53')];queues[_0x4d465a[_0x9ead('0x40')]][_0x9ead('0x54')]=utils['now']();queues[_0x4d465a[_0x9ead('0x40')]][_0x9ead('0x1a')]=utils[_0x9ead('0x16')]();queues[_0x4d465a['transfereeuniqueid']][_0x9ead('0x32')]=0x0;queues[_0x4d465a[_0x9ead('0x40')]][_0x9ead('0x55')]=0x0;utils[_0x9ead('0x3')](util['format'](_0x9ead('0x56'),_0x4d465a[_0x9ead('0x4a')],queues[_0x4d465a[_0x9ead('0x40')]]['name'],queues[_0x4d465a['transfereeuniqueid']][_0x9ead('0x52')],queues[_0x4d465a[_0x9ead('0x40')]][_0x9ead('0x53')]));}else{utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x57'),_0x4d465a['origtransfereruniqueid'],queues[_0x4d465a[_0x9ead('0x4b')]][_0x9ead('0x1f')],_0x4d465a[_0x9ead('0x4c')]));queues[_0x4d465a[_0x9ead('0x4b')]][_0x9ead('0xf')]=_0x4d465a[_0x9ead('0x4c')];}}}else if(_0x4d465a[_0x9ead('0x58')]==_0x4d465a[_0x9ead('0x4c')]){if(!_[_0x9ead('0x18')](queues[_0x4d465a[_0x9ead('0x4b')]])){utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x59'),_0x4d465a[_0x9ead('0x4a')],queues[_0x4d465a[_0x9ead('0x4b')]]['name'],_0x4d465a['secondtransfereruniqueid'],_0x4d465a[_0x9ead('0x5a')]));queues[_0x4d465a[_0x9ead('0x4b')]][_0x9ead('0x3c')]=!![];queues[_0x4d465a[_0x9ead('0x4b')]]['transfertype']='ATTENDED';queues[_0x4d465a[_0x9ead('0x4b')]][_0x9ead('0x43')]=_0x4d465a[_0x9ead('0x5a')];queues[_0x4d465a[_0x9ead('0x4b')]]['transferuniqueid']=_0x4d465a[_0x9ead('0x58')];queues[_0x4d465a['origtransfererlinkedid']]['queuecallerexitreason']=_0x9ead('0x50');}if(!_['isNil'](queues[_0x4d465a[_0x9ead('0x4c')]])){if(_0x4d465a['transfertargetlinkedid']&&queues[_0x4d465a[_0x9ead('0x5b')]]){queues[_0x4d465a[_0x9ead('0x5b')]][_0x9ead('0x5c')]=0x1;queues[_0x4d465a['transfertargetuniqueid']]=_['clone'](queues[_0x4d465a[_0x9ead('0x5b')]]);queues[_0x4d465a[_0x9ead('0x5d')]]['transfereduniqueid']=_0x4d465a[_0x9ead('0x5d')];queues[_0x4d465a[_0x9ead('0x5d')]][_0x9ead('0x5c')]=0x2;queues[_0x4d465a[_0x9ead('0x5d')]]['calleridnum']=queues[_0x4d465a['origtransfererlinkedid']][_0x9ead('0x52')];queues[_0x4d465a['transfertargetuniqueid']][_0x9ead('0x53')]=queues[_0x4d465a[_0x9ead('0x4b')]][_0x9ead('0x53')];queues[_0x4d465a[_0x9ead('0x5d')]]['queuecallerjoinAt']=utils[_0x9ead('0x16')]();queues[_0x4d465a[_0x9ead('0x5d')]][_0x9ead('0x1a')]=utils[_0x9ead('0x16')]();queues[_0x4d465a[_0x9ead('0x5d')]]['holdtime']=0x0;queues[_0x4d465a[_0x9ead('0x5d')]][_0x9ead('0x55')]=0x0;utils['info'](util[_0x9ead('0x4')](_0x9ead('0x5e'),_0x4d465a[_0x9ead('0x4a')],queues[_0x4d465a[_0x9ead('0x5d')]]['name'],queues[_0x4d465a[_0x9ead('0x5d')]][_0x9ead('0xf')],queues[_0x4d465a[_0x9ead('0x5d')]][_0x9ead('0x52')],queues[_0x4d465a['transfertargetuniqueid']][_0x9ead('0x53')]));}else{utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x57'),_0x4d465a[_0x9ead('0x4a')],queues[_0x4d465a[_0x9ead('0x4c')]][_0x9ead('0x1f')],_0x4d465a['origtransfererlinkedid']));queues[_0x4d465a['secondtransfererlinkedid']][_0x9ead('0xf')]=_0x4d465a[_0x9ead('0x4b')];}}}}catch(_0x43c6ae){utils['error'](util[_0x9ead('0x4')]('[%s][queues][attendedtransfer]',_0x4d465a['origtransfereruniqueid']),_0x43c6ae);}};exports['musiconholdstart']=function(_0x351e8b){try{if(!_[_0x9ead('0x18')](queues[_0x351e8b[_0x9ead('0x10')]])){utils['debug'](util[_0x9ead('0x4')](_0x9ead('0x5f'),_0x351e8b[_0x9ead('0x10')]),_0x351e8b);queues[_0x351e8b[_0x9ead('0x10')]][_0x9ead('0x60')]=utils[_0x9ead('0x16')]();utils[_0x9ead('0x3')](util[_0x9ead('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x351e8b[_0x9ead('0x10')],queues[_0x351e8b[_0x9ead('0x10')]][_0x9ead('0x1f')],queues[_0x351e8b[_0x9ead('0x10')]][_0x9ead('0x60')]));}}catch(_0x5c58c2){utils[_0x9ead('0x17')](util[_0x9ead('0x4')](_0x9ead('0x5f'),_0x351e8b['uniqueid']),_0x5c58c2);}};exports[_0x9ead('0x61')]=function(_0x5b04e3){try{if(!_[_0x9ead('0x18')](queues[_0x5b04e3[_0x9ead('0x10')]])){if(!_[_0x9ead('0x18')](queues[_0x5b04e3[_0x9ead('0x10')]][_0x9ead('0x60')])){utils['debug'](util['format']('[%s][queues][musiconholdstop]',_0x5b04e3[_0x9ead('0x10')]),_0x5b04e3);queues[_0x5b04e3[_0x9ead('0x10')]][_0x9ead('0x55')]+=utils[_0x9ead('0x33')](utils[_0x9ead('0x16')](),queues[_0x5b04e3[_0x9ead('0x10')]][_0x9ead('0x60')]);utils[_0x9ead('0x3')](util[_0x9ead('0x4')](_0x9ead('0x62'),_0x5b04e3[_0x9ead('0x10')],queues[_0x5b04e3[_0x9ead('0x10')]][_0x9ead('0x1f')],queues[_0x5b04e3[_0x9ead('0x10')]][_0x9ead('0x55')]));delete queues[_0x5b04e3[_0x9ead('0x10')]][_0x9ead('0x60')];}}}catch(_0x58888c){utils[_0x9ead('0x17')](util['format'](_0x9ead('0x63'),_0x5b04e3[_0x9ead('0x10')]),_0x58888c);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index f453365..7f357e2 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 _0x9800=['queue','util','info','format','uniqueid','accountcode','then','membername','name','UserId','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','channel','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','varset','isNil','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s'];(function(_0x5f197e,_0x1a9871){var _0x43639b=function(_0x3f9b49){while(--_0x3f9b49){_0x5f197e['push'](_0x5f197e['shift']());}};_0x43639b(++_0x1a9871);}(_0x9800,0x11e));var _0x0980=function(_0x2f9302,_0xbd0213){_0x2f9302=_0x2f9302-0x0;var _0x38f880=_0x9800[_0x2f9302];return _0x38f880;};'use strict';var _=require('lodash');var util=require(_0x0980('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0x2f4570){utils[_0x0980('0x1')](util[_0x0980('0x2')]('[%s][recordings][writeDB]',_0x2f4570[_0x0980('0x3')]));if(_0x2f4570[_0x0980('0x4')]){utils['getUserByInternal'](_0x2f4570[_0x0980('0x4')])[_0x0980('0x5')](function(_0x5379bd){if(_0x5379bd){_0x2f4570[_0x0980('0x6')]=_0x5379bd[_0x0980('0x7')];_0x2f4570[_0x0980('0x8')]=_0x5379bd['id'];}utils['request']('CreateVoiceRecording',_0x2f4570);});}else{utils[_0x0980('0x9')]('CreateVoiceRecording',_0x2f4570);}}exports[_0x0980('0xa')]=function(_0x318204){try{utils[_0x0980('0xb')](util[_0x0980('0x2')](_0x0980('0xc'),_0x318204[_0x0980('0x3')]),_0x318204);if(_0x318204['uniqueid']==_0x318204[_0x0980('0xd')]){utils['info'](util['format'](_0x0980('0xe'),_0x318204[_0x0980('0x3')],_0x318204['context'],_0x318204[_0x0980('0xf')]));recordings[_0x318204[_0x0980('0x3')]]={'uniqueid':_0x318204[_0x0980('0x3')],'accountcode':_0x318204[_0x0980('0x4')],'exten':_0x318204[_0x0980('0xf')],'context':_0x318204['context'],'channel':_0x318204[_0x0980('0x10')],'monitors':[]};}}catch(_0x4ade7c){utils[_0x0980('0x11')](util['format'](_0x0980('0xc'),_0x318204[_0x0980('0x3')]),_0x4ade7c);}};exports[_0x0980('0x12')]=function(_0x496bd6){try{utils['debug'](util[_0x0980('0x2')](_0x0980('0x13'),_0x496bd6[_0x0980('0x3')]),_0x496bd6);if(!_['isNil'](recordings[_0x496bd6[_0x0980('0x3')]])&&_0x496bd6[_0x0980('0x14')]==0x6){utils[_0x0980('0x1')](util[_0x0980('0x2')](_0x0980('0x15'),_0x496bd6[_0x0980('0x3')],_0x496bd6[_0x0980('0x16')],_0x496bd6[_0x0980('0x10')]));}else if(!_['isNil'](recordings[_0x496bd6['linkedid']])&&_0x496bd6[_0x0980('0x14')]==0x6&&_0x496bd6[_0x0980('0x16')]!='transfer'){utils[_0x0980('0x1')](util[_0x0980('0x2')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x496bd6[_0x0980('0x3')],_0x496bd6['linkedid'],_0x496bd6[_0x0980('0x16')],_0x496bd6[_0x0980('0x10')]));recordings[_0x496bd6[_0x0980('0xd')]]['accountcode']=_0x496bd6['accountcode'];}}catch(_0x29a4e7){utils['error'](util['format'](_0x0980('0x13'),_0x496bd6[_0x0980('0x3')]),_0x29a4e7);}};exports[_0x0980('0x17')]=function(_0x60655c){try{if(!_[_0x0980('0x18')](_0x60655c[_0x0980('0x19')])&&!_[_0x0980('0x18')](_0x60655c[_0x0980('0x19')]['mixmonitor_filename'])){utils[_0x0980('0xb')](util['format'](_0x0980('0x1a'),_0x60655c[_0x0980('0x3')]),_0x60655c);utils[_0x0980('0x1')](util['format'](_0x0980('0x1b'),_0x60655c['uniqueid'],_0x60655c['variable'],_0x60655c[_0x0980('0x1c')]));if(_['endsWith'](_0x60655c[_0x0980('0x1c')],_0x0980('0x1d'))){_0x60655c[_0x0980('0x1c')]=_0x60655c[_0x0980('0x1c')][_0x0980('0x1e')](_0x0980('0x1d'),_0x0980('0x1f'));}if(recordings[_0x60655c['linkedid']]){var _0x46ca3c=_[_0x0980('0x20')](recordings[_0x60655c[_0x0980('0xd')]][_0x0980('0x21')],{'value':_0x60655c[_0x0980('0x1c')]});if(_['isNil'](_0x46ca3c)){recordings[_0x60655c[_0x0980('0xd')]]['monitors']['push']({'value':_0x60655c['value']});}}}}catch(_0x3ac31f){utils[_0x0980('0x11')](util[_0x0980('0x2')](_0x0980('0x1a'),_0x60655c[_0x0980('0x3')]),_0x3ac31f);}};exports[_0x0980('0x22')]=function(_0x27d9a7){try{if(!_['isNil'](recordings[_0x27d9a7[_0x0980('0x3')]])){utils[_0x0980('0xb')](util[_0x0980('0x2')](_0x0980('0x23'),_0x27d9a7['uniqueid']),_0x27d9a7);utils[_0x0980('0x1')](util['format'](_0x0980('0x24'),_0x27d9a7[_0x0980('0x3')],_0x27d9a7[_0x0980('0x25')],_0x27d9a7[_0x0980('0x26')],_0x27d9a7[_0x0980('0x27')]));recordings[_0x27d9a7[_0x0980('0x3')]][_0x0980('0x25')]=_0x27d9a7[_0x0980('0x25')];recordings[_0x27d9a7['uniqueid']][_0x0980('0x26')]=_0x27d9a7['calleridname'];recordings[_0x27d9a7[_0x0980('0x3')]][_0x0980('0x28')]=_0x27d9a7[_0x0980('0x28')];recordings[_0x27d9a7[_0x0980('0x3')]][_0x0980('0x29')]=_0x27d9a7[_0x0980('0x29')];if(recordings[_0x27d9a7[_0x0980('0x3')]][_0x0980('0x2a')]==_0x0980('0x2b')&&recordings[_0x27d9a7[_0x0980('0x3')]][_0x0980('0x4')]){recordings[_0x27d9a7[_0x0980('0x3')]][_0x0980('0x28')]=recordings[_0x27d9a7['uniqueid']][_0x0980('0x4')];recordings[_0x27d9a7[_0x0980('0x3')]][_0x0980('0x29')]='';}recordings[_0x27d9a7[_0x0980('0x3')]][_0x0980('0x21')][_0x0980('0x2c')](function(_0x40f335){var _0x347d45=_[_0x0980('0x2d')](recordings[_0x27d9a7[_0x0980('0x3')]]);_0x347d45[_0x0980('0x1c')]=_0x40f335[_0x0980('0x1c')];writeDB(_0x347d45);});delete recordings[_0x27d9a7[_0x0980('0x3')]];}}catch(_0x46574f){utils['error'](util[_0x0980('0x2')](_0x0980('0x23'),_0x27d9a7[_0x0980('0x3')]),_0x46574f);}};exports[_0x0980('0x2e')]=function(_0x15eb86){try{if(!_[_0x0980('0x18')](recordings[_0x15eb86[_0x0980('0x3')]])){utils['debug'](util[_0x0980('0x2')]('[%s][recordings][newexten]',_0x15eb86[_0x0980('0x3')]),_0x15eb86);utils[_0x0980('0x1')](util[_0x0980('0x2')](_0x0980('0x2f'),_0x15eb86[_0x0980('0x3')],_0x15eb86['application'],_0x15eb86[_0x0980('0x30')]));if(_0x15eb86['application']['toLowerCase']()=='set'&&_['startsWith'](_0x15eb86['appdata']['toLowerCase'](),'cdr')){var _0x36c86a=_0x15eb86[_0x0980('0x30')][_0x0980('0x31')]('=');var _0x4b9d85=_0x36c86a[0x0][_0x0980('0x32')](_0x36c86a[0x0][_0x0980('0x33')]('(')+0x1,_0x36c86a[0x0][_0x0980('0x33')](')'));var _0x5ba961=_0x36c86a[0x1];recordings[_0x15eb86['uniqueid']][_0x4b9d85]=_0x5ba961;}}}catch(_0x419559){utils[_0x0980('0x11')](util[_0x0980('0x2')](_0x0980('0x34'),_0x15eb86[_0x0980('0x3')]),_0x419559);}};exports[_0x0980('0x35')]=function(_0x160072){try{if(!_[_0x0980('0x18')](recordings[_0x160072[_0x0980('0x3')]])){utils[_0x0980('0xb')](util[_0x0980('0x2')](_0x0980('0x36'),_0x160072[_0x0980('0x3')]),_0x160072);utils[_0x0980('0x1')](util[_0x0980('0x2')](_0x0980('0x37'),_0x160072[_0x0980('0x3')],_0x160072['queue']));recordings[_0x160072[_0x0980('0x3')]][_0x0980('0x38')]=_0x160072['queue'];}}catch(_0x3c3195){utils[_0x0980('0x11')](util[_0x0980('0x2')](_0x0980('0x36'),_0x160072[_0x0980('0x3')]),_0x3c3195);}}; \ No newline at end of file +var _0x6ce1=['getUserByInternal','then','membername','name','CreateVoiceRecording','request','newchannel','debug','linkedid','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','accountcode','error','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','isNil','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','push','hangup','[%s][recordings][hangup]','calleridname','calleridnum','connectedlinenum','connectedlinename','type','monitors','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils','info','[%s][recordings][writeDB]','uniqueid'];(function(_0x4a55e4,_0x3fa723){var _0x3d4e17=function(_0x37a97b){while(--_0x37a97b){_0x4a55e4['push'](_0x4a55e4['shift']());}};_0x3d4e17(++_0x3fa723);}(_0x6ce1,0x6e));var _0x16ce=function(_0x5876c8,_0x35c335){_0x5876c8=_0x5876c8-0x0;var _0x40a967=_0x6ce1[_0x5876c8];return _0x40a967;};'use strict';var _=require(_0x16ce('0x0'));var util=require(_0x16ce('0x1'));var utils=require(_0x16ce('0x2'));var recordings={};function writeDB(_0x5e3f13){utils[_0x16ce('0x3')](util['format'](_0x16ce('0x4'),_0x5e3f13[_0x16ce('0x5')]));if(_0x5e3f13['accountcode']){utils[_0x16ce('0x6')](_0x5e3f13['accountcode'])[_0x16ce('0x7')](function(_0xfda088){if(_0xfda088){_0x5e3f13[_0x16ce('0x8')]=_0xfda088[_0x16ce('0x9')];_0x5e3f13['UserId']=_0xfda088['id'];}utils['request'](_0x16ce('0xa'),_0x5e3f13);});}else{utils[_0x16ce('0xb')]('CreateVoiceRecording',_0x5e3f13);}}exports[_0x16ce('0xc')]=function(_0x4a3c6d){try{utils[_0x16ce('0xd')](util['format']('[%s][recordings][newchannel]',_0x4a3c6d[_0x16ce('0x5')]),_0x4a3c6d);if(_0x4a3c6d[_0x16ce('0x5')]==_0x4a3c6d[_0x16ce('0xe')]){utils[_0x16ce('0x3')](util[_0x16ce('0xf')](_0x16ce('0x10'),_0x4a3c6d[_0x16ce('0x5')],_0x4a3c6d[_0x16ce('0x11')],_0x4a3c6d['exten']));recordings[_0x4a3c6d['uniqueid']]={'uniqueid':_0x4a3c6d[_0x16ce('0x5')],'accountcode':_0x4a3c6d[_0x16ce('0x12')],'exten':_0x4a3c6d['exten'],'context':_0x4a3c6d['context'],'channel':_0x4a3c6d['channel'],'monitors':[]};}}catch(_0x1efbc3){utils[_0x16ce('0x13')](util[_0x16ce('0xf')]('[%s][recordings][newchannel]',_0x4a3c6d[_0x16ce('0x5')]),_0x1efbc3);}};exports['newstate']=function(_0x3467a4){try{utils['debug'](util[_0x16ce('0xf')](_0x16ce('0x14'),_0x3467a4[_0x16ce('0x5')]),_0x3467a4);if(!_['isNil'](recordings[_0x3467a4[_0x16ce('0x5')]])&&_0x3467a4['channelstate']==0x6){utils['info'](util[_0x16ce('0xf')](_0x16ce('0x15'),_0x3467a4[_0x16ce('0x5')],_0x3467a4[_0x16ce('0x11')],_0x3467a4[_0x16ce('0x16')]));}else if(!_['isNil'](recordings[_0x3467a4[_0x16ce('0xe')]])&&_0x3467a4['channelstate']==0x6&&_0x3467a4[_0x16ce('0x11')]!=_0x16ce('0x17')){utils[_0x16ce('0x3')](util[_0x16ce('0xf')](_0x16ce('0x18'),_0x3467a4['uniqueid'],_0x3467a4['linkedid'],_0x3467a4[_0x16ce('0x11')],_0x3467a4['channel']));recordings[_0x3467a4[_0x16ce('0xe')]][_0x16ce('0x12')]=_0x3467a4[_0x16ce('0x12')];}}catch(_0xfdf284){utils['error'](util['format']('[%s][recordings][newstate]',_0x3467a4[_0x16ce('0x5')]),_0xfdf284);}};exports[_0x16ce('0x19')]=function(_0x5285b5){try{if(!_[_0x16ce('0x1a')](_0x5285b5[_0x16ce('0x1b')])&&!_[_0x16ce('0x1a')](_0x5285b5['variable'][_0x16ce('0x1c')])){utils['debug'](util[_0x16ce('0xf')](_0x16ce('0x1d'),_0x5285b5['uniqueid']),_0x5285b5);utils['info'](util['format'](_0x16ce('0x1e'),_0x5285b5[_0x16ce('0x5')],_0x5285b5[_0x16ce('0x1b')],_0x5285b5[_0x16ce('0x1f')]));if(_[_0x16ce('0x20')](_0x5285b5[_0x16ce('0x1f')],_0x16ce('0x21'))){_0x5285b5['value']=_0x5285b5[_0x16ce('0x1f')][_0x16ce('0x22')](_0x16ce('0x21'),'.WAV');}if(recordings[_0x5285b5[_0x16ce('0xe')]]){var _0x100c73=_['find'](recordings[_0x5285b5[_0x16ce('0xe')]]['monitors'],{'value':_0x5285b5[_0x16ce('0x1f')]});if(_[_0x16ce('0x1a')](_0x100c73)){recordings[_0x5285b5['linkedid']]['monitors'][_0x16ce('0x23')]({'value':_0x5285b5[_0x16ce('0x1f')]});}}}}catch(_0x5e558b){utils[_0x16ce('0x13')](util['format'](_0x16ce('0x1d'),_0x5285b5[_0x16ce('0x5')]),_0x5e558b);}};exports[_0x16ce('0x24')]=function(_0x54dfa2){try{if(!_[_0x16ce('0x1a')](recordings[_0x54dfa2[_0x16ce('0x5')]])){utils['debug'](util[_0x16ce('0xf')](_0x16ce('0x25'),_0x54dfa2[_0x16ce('0x5')]),_0x54dfa2);utils[_0x16ce('0x3')](util[_0x16ce('0xf')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x54dfa2['uniqueid'],_0x54dfa2['calleridnum'],_0x54dfa2[_0x16ce('0x26')],_0x54dfa2['cause-txt']));recordings[_0x54dfa2['uniqueid']][_0x16ce('0x27')]=_0x54dfa2[_0x16ce('0x27')];recordings[_0x54dfa2[_0x16ce('0x5')]][_0x16ce('0x26')]=_0x54dfa2[_0x16ce('0x26')];recordings[_0x54dfa2[_0x16ce('0x5')]][_0x16ce('0x28')]=_0x54dfa2[_0x16ce('0x28')];recordings[_0x54dfa2['uniqueid']][_0x16ce('0x29')]=_0x54dfa2['connectedlinename'];if(recordings[_0x54dfa2['uniqueid']][_0x16ce('0x2a')]=='outbound'&&recordings[_0x54dfa2[_0x16ce('0x5')]][_0x16ce('0x12')]){recordings[_0x54dfa2[_0x16ce('0x5')]][_0x16ce('0x28')]=recordings[_0x54dfa2[_0x16ce('0x5')]][_0x16ce('0x12')];recordings[_0x54dfa2['uniqueid']]['connectedlinename']='';}recordings[_0x54dfa2[_0x16ce('0x5')]][_0x16ce('0x2b')]['forEach'](function(_0x5d7c82){var _0x107d1d=_[_0x16ce('0x2c')](recordings[_0x54dfa2[_0x16ce('0x5')]]);_0x107d1d[_0x16ce('0x1f')]=_0x5d7c82[_0x16ce('0x1f')];writeDB(_0x107d1d);});delete recordings[_0x54dfa2[_0x16ce('0x5')]];}}catch(_0x175b95){utils['error'](util[_0x16ce('0xf')](_0x16ce('0x25'),_0x54dfa2[_0x16ce('0x5')]),_0x175b95);}};exports['newexten']=function(_0x5ba491){try{if(!_[_0x16ce('0x1a')](recordings[_0x5ba491[_0x16ce('0x5')]])){utils[_0x16ce('0xd')](util[_0x16ce('0xf')](_0x16ce('0x2d'),_0x5ba491[_0x16ce('0x5')]),_0x5ba491);utils[_0x16ce('0x3')](util['format'](_0x16ce('0x2e'),_0x5ba491[_0x16ce('0x5')],_0x5ba491[_0x16ce('0x2f')],_0x5ba491[_0x16ce('0x30')]));if(_0x5ba491[_0x16ce('0x2f')][_0x16ce('0x31')]()==_0x16ce('0x32')&&_['startsWith'](_0x5ba491[_0x16ce('0x30')]['toLowerCase'](),_0x16ce('0x33'))){var _0x482c05=_0x5ba491['appdata'][_0x16ce('0x34')]('=');var _0x59a5ef=_0x482c05[0x0][_0x16ce('0x35')](_0x482c05[0x0]['lastIndexOf']('(')+0x1,_0x482c05[0x0][_0x16ce('0x36')](')'));var _0x141ca3=_0x482c05[0x1];recordings[_0x5ba491[_0x16ce('0x5')]][_0x59a5ef]=_0x141ca3;}}}catch(_0x1dc593){utils['error'](util[_0x16ce('0xf')](_0x16ce('0x2d'),_0x5ba491[_0x16ce('0x5')]),_0x1dc593);}};exports[_0x16ce('0x37')]=function(_0x19bd55){try{if(!_['isNil'](recordings[_0x19bd55[_0x16ce('0x5')]])){utils[_0x16ce('0xd')](util[_0x16ce('0xf')](_0x16ce('0x38'),_0x19bd55[_0x16ce('0x5')]),_0x19bd55);utils[_0x16ce('0x3')](util[_0x16ce('0xf')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x19bd55[_0x16ce('0x5')],_0x19bd55[_0x16ce('0x39')]));recordings[_0x19bd55[_0x16ce('0x5')]]['queue']=_0x19bd55[_0x16ce('0x39')];}}catch(_0x10d752){utils[_0x16ce('0x13')](util[_0x16ce('0xf')]('[%s][recordings][queuecallerjoin]',_0x19bd55[_0x16ce('0x5')]),_0x10d752);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 4eb9611..273b6ff 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 _0xb071=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','transferercalleridnum','transfereecalleridname','blind','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetcalleridnum'];(function(_0x4a1183,_0x3e78f2){var _0x22936b=function(_0x14a9dc){while(--_0x14a9dc){_0x4a1183['push'](_0x4a1183['shift']());}};_0x22936b(++_0x3e78f2);}(_0xb071,0xa3));var _0x1b07=function(_0x15f347,_0x547ffe){_0x15f347=_0x15f347-0x0;var _0x3045a6=_0xb071[_0x15f347];return _0x3045a6;};'use strict';var _=require('lodash');var util=require(_0x1b07('0x0'));var utils=require(_0x1b07('0x1'));function writeDB(_0x40237a){utils[_0x1b07('0x2')](util[_0x1b07('0x3')](_0x1b07('0x4'),_0x40237a[_0x1b07('0x5')]===_0x1b07('0x6')?_0x40237a[_0x1b07('0x7')]:_0x40237a[_0x1b07('0x8')],_0x40237a[_0x1b07('0x5')]));utils[_0x1b07('0x9')](_0x1b07('0xa'),_0x40237a);}exports[_0x1b07('0xb')]=function(_0x4ea1cd){try{utils[_0x1b07('0xc')](util[_0x1b07('0x3')]('[%s][transfers][blindtransfer]',_0x4ea1cd['uniqueid']),_0x4ea1cd);utils['info'](util[_0x1b07('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4ea1cd['uniqueid'],_0x4ea1cd[_0x1b07('0xd')],_0x4ea1cd['transferercalleridname'],_0x4ea1cd['transfereecalleridnum'],_0x4ea1cd[_0x1b07('0xe')]));_0x4ea1cd[_0x1b07('0x5')]=_0x1b07('0xf');writeDB(_0x4ea1cd);}catch(_0x435a2f){utils['error'](util[_0x1b07('0x3')](_0x1b07('0x10'),_0x4ea1cd[_0x1b07('0x8')]),_0x435a2f);}};exports[_0x1b07('0x11')]=function(_0x4de38e){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0x4de38e[_0x1b07('0x7')]),_0x4de38e);utils[_0x1b07('0x2')](util[_0x1b07('0x3')](_0x1b07('0x12'),_0x4de38e[_0x1b07('0x7')],_0x4de38e[_0x1b07('0x13')],_0x4de38e[_0x1b07('0x14')],_0x4de38e['transfertargetcalleridnum'],_0x4de38e[_0x1b07('0x15')]));_0x4de38e=_['assign'](_0x4de38e,{'transfererchannel':_0x4de38e['origtransfererchannel'],'transferercalleridnum':_0x4de38e[_0x1b07('0x13')],'transferercalleridname':_0x4de38e[_0x1b07('0x14')],'transfererconnectedlinenum':_0x4de38e[_0x1b07('0x16')],'transfererconnectedlinename':_0x4de38e[_0x1b07('0x17')],'transfereraccountcode':_0x4de38e[_0x1b07('0x18')],'transferercontext':_0x4de38e[_0x1b07('0x19')],'transfererexten':_0x4de38e[_0x1b07('0x1a')],'transfererlinkedid':_0x4de38e[_0x1b07('0x1b')],'context':_0x4de38e[_0x1b07('0x1c')],'extension':_0x4de38e['origtransfererexten'],'type':'attended'});if(_[_0x1b07('0x1d')](_0x4de38e[_0x1b07('0x1e')])){_0x4de38e=_['assign'](_0x4de38e,{'transfereechannel':_0x4de38e['transfertargetchannel'],'transfereecalleridnum':_0x4de38e[_0x1b07('0x1f')],'transfereecalleridname':_0x4de38e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4de38e[_0x1b07('0x20')],'transfereeconnectedlinename':_0x4de38e[_0x1b07('0x21')],'transfereeaccountcode':_0x4de38e[_0x1b07('0x22')],'transfereecontext':_0x4de38e['transfertargetcontext'],'transfereeexten':_0x4de38e[_0x1b07('0x23')],'transfereelinkedid':_0x4de38e[_0x1b07('0x24')]});}writeDB(_0x4de38e);}catch(_0x18ff49){utils[_0x1b07('0x25')](util[_0x1b07('0x3')](_0x1b07('0x26'),_0x4de38e['origtransfereruniqueid']),_0x18ff49);}}; \ No newline at end of file +var _0xafa8=['transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x4d8a8f,_0x2afd4c){var _0xfc4adc=function(_0xb89886){while(--_0xb89886){_0x4d8a8f['push'](_0x4d8a8f['shift']());}};_0xfc4adc(++_0x2afd4c);}(_0xafa8,0x161));var _0x8afa=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0xafa8[_0x5caf7e];return _0x5c3435;};'use strict';var _=require(_0x8afa('0x0'));var util=require(_0x8afa('0x1'));var utils=require(_0x8afa('0x2'));function writeDB(_0x3fc42e){utils[_0x8afa('0x3')](util['format'](_0x8afa('0x4'),_0x3fc42e[_0x8afa('0x5')]===_0x8afa('0x6')?_0x3fc42e[_0x8afa('0x7')]:_0x3fc42e[_0x8afa('0x8')],_0x3fc42e['type']));utils[_0x8afa('0x9')](_0x8afa('0xa'),_0x3fc42e);}exports[_0x8afa('0xb')]=function(_0x235c6b){try{utils[_0x8afa('0xc')](util[_0x8afa('0xd')](_0x8afa('0xe'),_0x235c6b['uniqueid']),_0x235c6b);utils[_0x8afa('0x3')](util[_0x8afa('0xd')](_0x8afa('0xf'),_0x235c6b[_0x8afa('0x8')],_0x235c6b[_0x8afa('0x10')],_0x235c6b[_0x8afa('0x11')],_0x235c6b[_0x8afa('0x12')],_0x235c6b['transfereecalleridname']));_0x235c6b['type']=_0x8afa('0x13');writeDB(_0x235c6b);}catch(_0x9cd314){utils[_0x8afa('0x14')](util[_0x8afa('0xd')](_0x8afa('0xe'),_0x235c6b[_0x8afa('0x8')]),_0x9cd314);}};exports[_0x8afa('0x15')]=function(_0x25e9f8){try{utils[_0x8afa('0xc')](util[_0x8afa('0xd')](_0x8afa('0x16'),_0x25e9f8[_0x8afa('0x7')]),_0x25e9f8);utils['info'](util[_0x8afa('0xd')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x25e9f8[_0x8afa('0x7')],_0x25e9f8[_0x8afa('0x17')],_0x25e9f8[_0x8afa('0x18')],_0x25e9f8[_0x8afa('0x19')],_0x25e9f8[_0x8afa('0x1a')]));_0x25e9f8=_[_0x8afa('0x1b')](_0x25e9f8,{'transfererchannel':_0x25e9f8[_0x8afa('0x1c')],'transferercalleridnum':_0x25e9f8[_0x8afa('0x17')],'transferercalleridname':_0x25e9f8['origtransferercalleridname'],'transfererconnectedlinenum':_0x25e9f8[_0x8afa('0x1d')],'transfererconnectedlinename':_0x25e9f8['secondtransfererconnectedlinename'],'transfereraccountcode':_0x25e9f8[_0x8afa('0x1e')],'transferercontext':_0x25e9f8['secondtransferercontext'],'transfererexten':_0x25e9f8[_0x8afa('0x1f')],'transfererlinkedid':_0x25e9f8[_0x8afa('0x20')],'context':_0x25e9f8[_0x8afa('0x21')],'extension':_0x25e9f8['origtransfererexten'],'type':_0x8afa('0x6')});if(_['isNil'](_0x25e9f8[_0x8afa('0x22')])){_0x25e9f8=_[_0x8afa('0x1b')](_0x25e9f8,{'transfereechannel':_0x25e9f8[_0x8afa('0x23')],'transfereecalleridnum':_0x25e9f8[_0x8afa('0x19')],'transfereecalleridname':_0x25e9f8[_0x8afa('0x1a')],'transfereeconnectedlinenum':_0x25e9f8['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x25e9f8[_0x8afa('0x24')],'transfereeaccountcode':_0x25e9f8[_0x8afa('0x25')],'transfereecontext':_0x25e9f8[_0x8afa('0x26')],'transfereeexten':_0x25e9f8[_0x8afa('0x27')],'transfereelinkedid':_0x25e9f8[_0x8afa('0x28')]});}writeDB(_0x25e9f8);}catch(_0x26d7e7){utils['error'](util[_0x8afa('0xd')]('[%s][transfers][attendedtransfer]',_0x25e9f8[_0x8afa('0x7')]),_0x26d7e7);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index e9f59f9..f5d4cb1 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 _0xa4f0=['getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','http','../../config/logger','xdr','info','inspect','debug','error','request','catch','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','found','[utils][getUserByInternal]'];(function(_0x1c2979,_0x4bd634){var _0x13df89=function(_0x32f3f1){while(--_0x32f3f1){_0x1c2979['push'](_0x1c2979['shift']());}};_0x13df89(++_0x4bd634);}(_0xa4f0,0x119));var _0x0a4f=function(_0x1cf870,_0x5f172d){_0x1cf870=_0x1cf870-0x0;var _0x439018=_0xa4f0[_0x1cf870];return _0x439018;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x0a4f('0x0'));var moment=require(_0x0a4f('0x1'));var util=require(_0x0a4f('0x2'));var client=jayson['client'][_0x0a4f('0x3')]({'port':0x2329});var logger=require(_0x0a4f('0x4'))(_0x0a4f('0x5'));exports[_0x0a4f('0x6')]=function(_0x23ed51,_0x29c95c){logger[_0x0a4f('0x6')](_0x23ed51,_0x29c95c?util[_0x0a4f('0x7')](_0x29c95c,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x12b4c6,_0x3ae820){logger[_0x0a4f('0x8')](_0x12b4c6,_0x3ae820?util[_0x0a4f('0x7')](_0x3ae820,{'showHidden':![],'depth':null}):'');};exports[_0x0a4f('0x9')]=function(_0x43d13d,_0x391df7){logger[_0x0a4f('0x9')](_0x43d13d,_0x391df7?util[_0x0a4f('0x7')](_0x391df7,{'showHidden':![],'depth':null}):'');};exports[_0x0a4f('0xa')]=function(_0x395abc,_0x33b3b7){return client['request'](_0x395abc,{'body':_0x33b3b7})['then'](function(_0x3548ee){logger['debug']('[utils][request]\x20name:%s',_0x395abc,_0x3548ee?util['inspect'](_0x3548ee,{'showHidden':![],'depth':null}):'');})[_0x0a4f('0xb')](function(_0x5cbd14){logger[_0x0a4f('0x9')]('[utils][request]\x20name:%s',_0x395abc,_0x5cbd14?util[_0x0a4f('0x7')](_0x5cbd14,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5f3b1e){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x0a4f('0xc'),_0x0a4f('0xd')],'where':_0x5f3b1e,'limit':0x1}})[_0x0a4f('0xe')](function(_0x5160c4){logger[_0x0a4f('0x8')](_0x0a4f('0xf'),JSON[_0x0a4f('0x10')](_0x5f3b1e),_0x5160c4?util['inspect'](_0x5160c4,{'showHidden':![],'depth':null}):'');return _0x5160c4['result']['length']?_0x5160c4[_0x0a4f('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x36ec31){return new BPromise(function(_0x2aee1a,_0x4e0a8a){if(_0x36ec31){return getUser({'internal':_0x36ec31})[_0x0a4f('0xe')](function(_0x9d4a62){logger[_0x0a4f('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x36ec31,_0x9d4a62?_0x0a4f('0x12'):'notfound');return _0x2aee1a(_0x9d4a62);})[_0x0a4f('0xb')](function(_0x1f8783){logger['error'](_0x0a4f('0x13'),_0x1f8783?util['inspect'](_0x1f8783,{'showHidden':![],'depth':null}):'');return _0x2aee1a(null);});}return _0x2aee1a(null);});};exports[_0x0a4f('0x14')]=function(_0x5d56c8){return new BPromise(function(_0x2c79cb,_0x207fa1){if(_0x5d56c8){return getUser({'interface':_0x5d56c8})[_0x0a4f('0xe')](function(_0x12c02d){logger['info'](_0x0a4f('0x15'),_0x5d56c8,_0x12c02d?'found':_0x0a4f('0x16'));return _0x2c79cb(_0x12c02d);})[_0x0a4f('0xb')](function(_0x3757c0){logger[_0x0a4f('0x9')]('[utils][getUserByInterface]',_0x3757c0?util[_0x0a4f('0x7')](_0x3757c0,{'showHidden':![],'depth':null}):'');return _0x2c79cb(null);});}return _0x2c79cb(null);});};exports[_0x0a4f('0x17')]=function(_0x20148d){return new BPromise(function(_0x578e94,_0x47f304){if(_0x20148d){return getUser({'name':_0x20148d})[_0x0a4f('0xe')](function(_0x3df47f){logger[_0x0a4f('0x6')](_0x0a4f('0x18'),_0x20148d,_0x3df47f?'found':_0x0a4f('0x16'));return _0x578e94(_0x3df47f);})[_0x0a4f('0xb')](function(_0x494a37){logger[_0x0a4f('0x9')]('[utils][getUserByName]',_0x494a37?util[_0x0a4f('0x7')](_0x494a37,{'showHidden':![],'depth':null}):'');return _0x578e94(null);});}return _0x578e94(null);});};exports[_0x0a4f('0x19')]=function(_0x34dfa7){return new BPromise(function(_0x8e0bb4,_0x431e86){if(_0x34dfa7){return client[_0x0a4f('0xa')](_0x0a4f('0x1a'),{'options':{'raw':!![],'attributes':['id','name',_0x0a4f('0x1b'),'acw','acwTimeout'],'where':{'name':_0x34dfa7},'limit':0x1}})[_0x0a4f('0xe')](function(_0x7363b5){logger[_0x0a4f('0x8')](_0x0a4f('0x1c'),_0x34dfa7,_0x7363b5?util['inspect'](_0x7363b5,{'showHidden':![],'depth':null}):'');logger[_0x0a4f('0x6')](_0x0a4f('0x1d'),_0x34dfa7,_0x7363b5?'found':'notfound');return _0x8e0bb4(_0x7363b5[_0x0a4f('0x11')]['length']?_0x7363b5[_0x0a4f('0x11')][0x0]:null);})[_0x0a4f('0xb')](function(_0x5a25de){logger[_0x0a4f('0x9')]('[utils][getVoiceQueueByName]',_0x5a25de?util[_0x0a4f('0x7')](_0x5a25de,{'showHidden':![],'depth':null}):'');return _0x8e0bb4(null);});}return _0x8e0bb4(null);});};exports[_0x0a4f('0x1e')]=function(_0x2e24f3,_0x5a354a){return moment(_0x2e24f3)[_0x0a4f('0x1f')](_0x5a354a,_0x0a4f('0x20'))[_0x0a4f('0x21')](_0x0a4f('0x22'));};exports[_0x0a4f('0x23')]=function(_0x5e573f,_0x2c74b2){return moment(_0x5e573f)[_0x0a4f('0x24')](_0x2c74b2,_0x0a4f('0x20'))[_0x0a4f('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0a4f('0x25')]=function(_0x2e0904,_0x477f73){return moment(_0x2e0904)[_0x0a4f('0x26')](moment(_0x477f73),_0x0a4f('0x20'));};exports[_0x0a4f('0x27')]=function(_0x2fc1a2,_0x3629d7){return parseInt(_0x2fc1a2,0xa)+parseInt(_0x3629d7,0xa);};exports[_0x0a4f('0x28')]=function(){return moment()[_0x0a4f('0x21')](_0x0a4f('0x22'));};exports[_0x0a4f('0x29')]=function(_0x4cdd39,_0x50fb62){if(_0x50fb62){return moment(_0x4cdd39)['isAfter'](_0x50fb62);}return!![];};exports[_0x0a4f('0x2a')]=function(_0x535a88,_0x1575af){if(_0x1575af){return moment(_0x535a88)[_0x0a4f('0x2a')](_0x1575af);}else if(_0x535a88){return!![];}return![];}; \ No newline at end of file +var _0x04db=['length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','found','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','format','diffTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result'];(function(_0x48eb2b,_0x743fba){var _0x2c7080=function(_0x3b0c92){while(--_0x3b0c92){_0x48eb2b['push'](_0x48eb2b['shift']());}};_0x2c7080(++_0x743fba);}(_0x04db,0x6a));var _0xb04d=function(_0x268325,_0x2f3ca5){_0x268325=_0x268325-0x0;var _0xf66270=_0x04db[_0x268325];return _0xf66270;};'use strict';var BPromise=require(_0xb04d('0x0'));var jayson=require(_0xb04d('0x1'));var moment=require(_0xb04d('0x2'));var util=require(_0xb04d('0x3'));var client=jayson[_0xb04d('0x4')][_0xb04d('0x5')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x3d52a1,_0x309337){logger[_0xb04d('0x6')](_0x3d52a1,_0x309337?util[_0xb04d('0x7')](_0x309337,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4d07b1,_0x55b6e5){logger['debug'](_0x4d07b1,_0x55b6e5?util[_0xb04d('0x7')](_0x55b6e5,{'showHidden':![],'depth':null}):'');};exports[_0xb04d('0x8')]=function(_0x51cf81,_0x4af65b){logger[_0xb04d('0x8')](_0x51cf81,_0x4af65b?util[_0xb04d('0x7')](_0x4af65b,{'showHidden':![],'depth':null}):'');};exports[_0xb04d('0x9')]=function(_0x4396b8,_0x5cee8b){return client[_0xb04d('0x9')](_0x4396b8,{'body':_0x5cee8b})[_0xb04d('0xa')](function(_0x2ba38c){logger[_0xb04d('0xb')](_0xb04d('0xc'),_0x4396b8,_0x2ba38c?util['inspect'](_0x2ba38c,{'showHidden':![],'depth':null}):'');})[_0xb04d('0xd')](function(_0x35c371){logger[_0xb04d('0x8')]('[utils][request]\x20name:%s',_0x4396b8,_0x35c371?util[_0xb04d('0x7')](_0x35c371,{'showHidden':![],'depth':null}):'');});};function getUser(_0x503a04){return client[_0xb04d('0x9')](_0xb04d('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xb04d('0xf'),_0xb04d('0x10')],'where':_0x503a04,'limit':0x1}})['then'](function(_0x2efdf8){logger['debug'](_0xb04d('0x11'),JSON[_0xb04d('0x12')](_0x503a04),_0x2efdf8?util[_0xb04d('0x7')](_0x2efdf8,{'showHidden':![],'depth':null}):'');return _0x2efdf8[_0xb04d('0x13')][_0xb04d('0x14')]?_0x2efdf8['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x3dd072){return new BPromise(function(_0x4a5253,_0x1146ad){if(_0x3dd072){return getUser({'internal':_0x3dd072})['then'](function(_0x10e5c2){logger['info'](_0xb04d('0x15'),_0x3dd072,_0x10e5c2?'found':_0xb04d('0x16'));return _0x4a5253(_0x10e5c2);})['catch'](function(_0x44fc8f){logger[_0xb04d('0x8')](_0xb04d('0x17'),_0x44fc8f?util['inspect'](_0x44fc8f,{'showHidden':![],'depth':null}):'');return _0x4a5253(null);});}return _0x4a5253(null);});};exports['getUserByInterface']=function(_0x3b8a10){return new BPromise(function(_0x531ec0,_0xb4c63e){if(_0x3b8a10){return getUser({'interface':_0x3b8a10})[_0xb04d('0xa')](function(_0x2f1bfb){logger[_0xb04d('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3b8a10,_0x2f1bfb?_0xb04d('0x18'):'notfound');return _0x531ec0(_0x2f1bfb);})['catch'](function(_0x31062e){logger[_0xb04d('0x8')](_0xb04d('0x19'),_0x31062e?util[_0xb04d('0x7')](_0x31062e,{'showHidden':![],'depth':null}):'');return _0x531ec0(null);});}return _0x531ec0(null);});};exports['getUserByName']=function(_0x17c13c){return new BPromise(function(_0x1fc130,_0x1eea69){if(_0x17c13c){return getUser({'name':_0x17c13c})[_0xb04d('0xa')](function(_0x1d7b98){logger['info'](_0xb04d('0x1a'),_0x17c13c,_0x1d7b98?_0xb04d('0x18'):_0xb04d('0x16'));return _0x1fc130(_0x1d7b98);})[_0xb04d('0xd')](function(_0x3571c5){logger[_0xb04d('0x8')](_0xb04d('0x1b'),_0x3571c5?util[_0xb04d('0x7')](_0x3571c5,{'showHidden':![],'depth':null}):'');return _0x1fc130(null);});}return _0x1fc130(null);});};exports['getVoiceQueueByName']=function(_0x14e59d){return new BPromise(function(_0x1671ae,_0x57f442){if(_0x14e59d){return client[_0xb04d('0x9')](_0xb04d('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xb04d('0xf'),_0xb04d('0x1d'),'acw','acwTimeout'],'where':{'name':_0x14e59d},'limit':0x1}})[_0xb04d('0xa')](function(_0x2e959c){logger[_0xb04d('0xb')]('[utils][getVoiceQueueByName]\x20name:%s',_0x14e59d,_0x2e959c?util[_0xb04d('0x7')](_0x2e959c,{'showHidden':![],'depth':null}):'');logger['info'](_0xb04d('0x1e'),_0x14e59d,_0x2e959c?_0xb04d('0x18'):'notfound');return _0x1671ae(_0x2e959c[_0xb04d('0x13')][_0xb04d('0x14')]?_0x2e959c[_0xb04d('0x13')][0x0]:null);})['catch'](function(_0x1c5842){logger[_0xb04d('0x8')](_0xb04d('0x1f'),_0x1c5842?util[_0xb04d('0x7')](_0x1c5842,{'showHidden':![],'depth':null}):'');return _0x1671ae(null);});}return _0x1671ae(null);});};exports[_0xb04d('0x20')]=function(_0x3a8a2b,_0x7abef7){return moment(_0x3a8a2b)['add'](_0x7abef7,'seconds')['format'](_0xb04d('0x21'));};exports[_0xb04d('0x22')]=function(_0x2e0861,_0x1ee89d){return moment(_0x2e0861)[_0xb04d('0x23')](_0x1ee89d,_0xb04d('0x24'))[_0xb04d('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb04d('0x26')]=function(_0x4d0665,_0x262c29){return moment(_0x4d0665)['diff'](moment(_0x262c29),_0xb04d('0x24'));};exports['sumTime']=function(_0x41b63c,_0x200634){return parseInt(_0x41b63c,0xa)+parseInt(_0x200634,0xa);};exports[_0xb04d('0x27')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb04d('0x28')]=function(_0x2da4e5,_0x1af5be){if(_0x1af5be){return moment(_0x2da4e5)['isAfter'](_0x1af5be);}return!![];};exports[_0xb04d('0x29')]=function(_0x49a75d,_0x4f3847){if(_0x4f3847){return moment(_0x49a75d)['isBefore'](_0x4f3847);}else if(_0x49a75d){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 347d9b7..47f514a 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 _0x381a=['data','timestamp','error','api','auth','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','name','%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)','format','responseTime','agent_name','test','setupLoggers','lodash','path','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','log','client','role','ensureDir','then','catch','user','no-user'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x381a,0x71));var _0xa381=function(_0x3afd4e,_0x47a3e9){_0x3afd4e=_0x3afd4e-0x0;var _0x87932c=_0x381a[_0x3afd4e];return _0x87932c;};var fs=require('fs-extra');var _=require(_0xa381('0x0'));var ewinston=require('express-winston');var path=require(_0xa381('0x1'));var util=require('util');var fileLogger=require(_0xa381('0x2'))[_0xa381('0x3')];var safeTemplate=require(_0xa381('0x4'))['safeTemplate'];var maskSensitiveData=require(_0xa381('0x5'))[_0xa381('0x6')];function ClientSideLogger(){function _0x4ecda1(_0x5139c1){var _0x128935=path[_0xa381('0x7')]('/var',_0xa381('0x8'),'xcally');var _0x2e9a6f=path['join'](_0xa381('0x9'),_0x5139c1[_0xa381('0xa')]+'-'+_0x5139c1['name']);return fs[_0xa381('0xb')](path[_0xa381('0x7')](_0x128935,_0x2e9a6f))[_0xa381('0xc')](function(){var _0x37cbf8=fileLogger('client',path[_0xa381('0x7')](_0x128935,_0x2e9a6f));return _0x37cbf8;})[_0xa381('0xd')](function(_0x58897e){throw _0x58897e;});}this['log']=function(_0x251a47,_0xb45ab,_0x2ed710,_0x5bd393){return _0x4ecda1(_0x251a47[_0xa381('0xe')])[_0xa381('0xc')](function(_0x53680e){var _0x4b31fd=_0x53680e[_0xb45ab];return _0x4b31fd;})[_0xa381('0xc')](function(_0x276582){var _0x5b29da=_0x251a47[_0xa381('0xe')]?_0x251a47[_0xa381('0xe')]['id']:_0xa381('0xf');var _0xb8da86=_0x5bd393[_0xa381('0x10')];var _0x556608=_0x5bd393[_0xa381('0x11')];var _0x5ad760=new Date(Number(_0x556608));return _0x276582(_0x5b29da,_0x5ad760,_0x2ed710,_0xb8da86);})[_0xa381('0xd')](function(_0xa309b4){fileLogger(_0xa381('0x9'))[_0xa381('0x12')](_0xa309b4);});};}function setupLoggers(_0x12ea2b){return new Promise(function(_0x5910ab){var _0x499171=new ClientSideLogger();var _0x38615b=fileLogger(_0xa381('0x13'));var _0x539977=fileLogger(_0xa381('0x14'));_0x12ea2b[_0xa381('0x15')]('client-side-logger',_0x499171);_0x12ea2b[_0xa381('0x16')](ewinston[_0xa381('0x17')]({'winstonInstance':_0x38615b,'meta':![],'statusLevels':!![],'msg':function(_0x369cb4,_0x3bffab){var _0x396f79=_0xa381('0x18');if(!_['isEmpty'](_0x369cb4[_0xa381('0x19')])){_0x396f79+='\x20body=%s';var _0x570e22=_0x369cb4['body'];maskSensitiveData(_0x570e22);}return safeTemplate(util['format'](_0x396f79,_0x369cb4[_0xa381('0x1a')],_0x369cb4[_0xa381('0x1b')][_0xa381('0x1c')]?_0x369cb4[_0xa381('0x1b')][_0xa381('0x1c')]:_0x369cb4[_0xa381('0x1d')][_0xa381('0x1e')]||_0x369cb4['ip'],_0x369cb4[_0xa381('0x1f')],_0x3bffab[_0xa381('0x20')],_0x3bffab['responseTime'],_0x369cb4[_0xa381('0xe')]?_0x369cb4['user']['id']:null,_0x369cb4['user']?_0x369cb4[_0xa381('0xe')][_0xa381('0x21')]:null,_0x369cb4[_0xa381('0xe')]?_0x369cb4[_0xa381('0xe')][_0xa381('0xa')]:null,_0x570e22?util['inspect'](_0x570e22,![],null):''));}}));_0x12ea2b['use'](ewinston[_0xa381('0x17')]({'winstonInstance':_0x539977,'meta':![],'statusLevels':!![],'msg':function(_0x3ff690,_0x1eca30){var _0x33abe4=_0xa381('0x22');if(_0x3ff690['body']&&_0x3ff690['body'][_0xa381('0x23')]&&_0x3ff690['body'][_0xa381('0x24')]){_0x33abe4=_0xa381('0x25');}return util[_0xa381('0x26')](_0x33abe4,_0x3ff690[_0xa381('0x1a')],_0x3ff690[_0xa381('0x1b')]['x-forwarded-for']?_0x3ff690[_0xa381('0x1b')]['x-forwarded-for']:_0x3ff690['connection'][_0xa381('0x1e')]||_0x3ff690['ip'],_0x3ff690[_0xa381('0x1f')],_0x1eca30['statusCode'],_0x1eca30[_0xa381('0x27')],_0x3ff690['user']?_0x3ff690['user']['id']:null,_0x3ff690['user']?_0x3ff690[_0xa381('0xe')][_0xa381('0x21')]:null,_0x3ff690[_0xa381('0xe')]?_0x3ff690[_0xa381('0xe')][_0xa381('0xa')]:null,_0x3ff690[_0xa381('0x19')]&&_0x3ff690['body']['device']?_0x3ff690[_0xa381('0x19')][_0xa381('0x23')]:'other',_0x3ff690[_0xa381('0x19')]&&_0x3ff690[_0xa381('0x19')][_0xa381('0x24')]?_0x3ff690[_0xa381('0x19')][_0xa381('0x24')]:'',_0x3ff690['body']&&_0x3ff690[_0xa381('0x19')][_0xa381('0x28')]?_0x3ff690[_0xa381('0x19')][_0xa381('0x28')]:'');},'ignoreRoute':function(_0x57f854){var _0x1d06c9=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1d06c9[_0xa381('0x29')](_0x57f854[_0xa381('0x1f')]);}}));return _0x5910ab();});}exports[_0xa381('0x2a')]=setupLoggers; \ No newline at end of file +var _0x7d43=['express-winston','path','util','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','ensureDir','then','user','catch','error','api','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','name','role','inspect','%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)','connection','other','agent_name','test','setupLoggers','lodash'];(function(_0x1e3b8f,_0x5b7d53){var _0x13d634=function(_0xeebea8){while(--_0xeebea8){_0x1e3b8f['push'](_0x1e3b8f['shift']());}};_0x13d634(++_0x5b7d53);}(_0x7d43,0xe0));var _0x37d4=function(_0x34bb12,_0x4e9455){_0x34bb12=_0x34bb12-0x0;var _0x39be5b=_0x7d43[_0x34bb12];return _0x39be5b;};var fs=require('fs-extra');var _=require(_0x37d4('0x0'));var ewinston=require(_0x37d4('0x1'));var path=require(_0x37d4('0x2'));var util=require(_0x37d4('0x3'));var fileLogger=require('./loggers')[_0x37d4('0x4')];var safeTemplate=require('./safe-template')[_0x37d4('0x5')];var maskSensitiveData=require(_0x37d4('0x6'))[_0x37d4('0x7')];function ClientSideLogger(){function _0x2b9629(_0x302676){var _0x4daf72=path[_0x37d4('0x8')](_0x37d4('0x9'),_0x37d4('0xa'),_0x37d4('0xb'));var _0x1cd8ce=path[_0x37d4('0x8')](_0x37d4('0xc'),_0x302676['role']+'-'+_0x302676['name']);return fs[_0x37d4('0xd')](path[_0x37d4('0x8')](_0x4daf72,_0x1cd8ce))[_0x37d4('0xe')](function(){var _0x3e4b45=fileLogger(_0x37d4('0xc'),path['join'](_0x4daf72,_0x1cd8ce));return _0x3e4b45;})['catch'](function(_0x580347){throw _0x580347;});}this['log']=function(_0x9f0d4e,_0x334c41,_0x46a094,_0x52d40b){return _0x2b9629(_0x9f0d4e[_0x37d4('0xf')])[_0x37d4('0xe')](function(_0xa266ae){var _0x469f67=_0xa266ae[_0x334c41];return _0x469f67;})[_0x37d4('0xe')](function(_0x3e2a46){var _0xc5391b=_0x9f0d4e['user']?_0x9f0d4e[_0x37d4('0xf')]['id']:'no-user';var _0x1a6904=_0x52d40b['data'];var _0x376c21=_0x52d40b['timestamp'];var _0xd64e93=new Date(Number(_0x376c21));return _0x3e2a46(_0xc5391b,_0xd64e93,_0x46a094,_0x1a6904);})[_0x37d4('0x10')](function(_0x4dd927){fileLogger(_0x37d4('0xc'))[_0x37d4('0x11')](_0x4dd927);});};}function setupLoggers(_0x57a30){return new Promise(function(_0x1aaa95){var _0x58aa9e=new ClientSideLogger();var _0x368feb=fileLogger(_0x37d4('0x12'));var _0x525eae=fileLogger('auth');_0x57a30[_0x37d4('0x13')]('client-side-logger',_0x58aa9e);_0x57a30[_0x37d4('0x14')](ewinston[_0x37d4('0x15')]({'winstonInstance':_0x368feb,'meta':![],'statusLevels':!![],'msg':function(_0x22f991,_0x19716e){var _0x143ae1=_0x37d4('0x16');if(!_[_0x37d4('0x17')](_0x22f991[_0x37d4('0x18')])){_0x143ae1+='\x20body=%s';var _0x16621f=_0x22f991[_0x37d4('0x18')];maskSensitiveData(_0x16621f);}return safeTemplate(util[_0x37d4('0x19')](_0x143ae1,_0x22f991[_0x37d4('0x1a')],_0x22f991['headers']['x-forwarded-for']?_0x22f991[_0x37d4('0x1b')][_0x37d4('0x1c')]:_0x22f991['connection'][_0x37d4('0x1d')]||_0x22f991['ip'],_0x22f991[_0x37d4('0x1e')],_0x19716e[_0x37d4('0x1f')],_0x19716e[_0x37d4('0x20')],_0x22f991[_0x37d4('0xf')]?_0x22f991['user']['id']:null,_0x22f991[_0x37d4('0xf')]?_0x22f991[_0x37d4('0xf')][_0x37d4('0x21')]:null,_0x22f991[_0x37d4('0xf')]?_0x22f991['user'][_0x37d4('0x22')]:null,_0x16621f?util[_0x37d4('0x23')](_0x16621f,![],null):''));}}));_0x57a30[_0x37d4('0x14')](ewinston[_0x37d4('0x15')]({'winstonInstance':_0x525eae,'meta':![],'statusLevels':!![],'msg':function(_0x187cb0,_0x1457e6){var _0x1da0b2=_0x37d4('0x24');if(_0x187cb0[_0x37d4('0x18')]&&_0x187cb0[_0x37d4('0x18')][_0x37d4('0x25')]&&_0x187cb0[_0x37d4('0x18')][_0x37d4('0x26')]){_0x1da0b2=_0x37d4('0x27');}return util[_0x37d4('0x19')](_0x1da0b2,_0x187cb0[_0x37d4('0x1a')],_0x187cb0[_0x37d4('0x1b')]['x-forwarded-for']?_0x187cb0['headers'][_0x37d4('0x1c')]:_0x187cb0[_0x37d4('0x28')]['remoteAddress']||_0x187cb0['ip'],_0x187cb0[_0x37d4('0x1e')],_0x1457e6[_0x37d4('0x1f')],_0x1457e6[_0x37d4('0x20')],_0x187cb0[_0x37d4('0xf')]?_0x187cb0[_0x37d4('0xf')]['id']:null,_0x187cb0['user']?_0x187cb0[_0x37d4('0xf')][_0x37d4('0x21')]:null,_0x187cb0['user']?_0x187cb0[_0x37d4('0xf')][_0x37d4('0x22')]:null,_0x187cb0[_0x37d4('0x18')]&&_0x187cb0['body'][_0x37d4('0x25')]?_0x187cb0[_0x37d4('0x18')]['device']:_0x37d4('0x29'),_0x187cb0['body']&&_0x187cb0[_0x37d4('0x18')][_0x37d4('0x26')]?_0x187cb0[_0x37d4('0x18')]['agent_id']:'',_0x187cb0[_0x37d4('0x18')]&&_0x187cb0['body'][_0x37d4('0x2a')]?_0x187cb0['body'][_0x37d4('0x2a')]:'');},'ignoreRoute':function(_0x1d4106){var _0x1199fd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1199fd[_0x37d4('0x2b')](_0x1d4106['url']);}}));return _0x1aaa95();});}exports[_0x37d4('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index bc6797c..0ba82c6 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3722=['test','isMoment','clone','length','padStart','iftime','lodash','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','weekdaysShort','indexOf','slice','concat','locale','toLowerCase','exports','hours','minutes','endOf','isBetween','timeCompare','format','ddd','dowCompare','date','daysInMonth','min','domCompare','MMM','includes','monthCompare','guess'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x3722,0x102));var _0x2372=function(_0x5008c8,_0x342e4a){_0x5008c8=_0x5008c8-0x0;var _0x28d778=_0x3722[_0x5008c8];return _0x28d778;};var _=require(_0x2372('0x0'));var moment=require('moment-timezone');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][_0x2372('0x1')](function(_0x15efc9){return _0x15efc9[_0x2372('0x2')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x2372('0x3');var EINVALID_DATE=_0x2372('0x4');function throwIfDateNotValid(_0x98e68b){if(!_0x98e68b[_0x2372('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0xaff261){var _0x3cf2a2=_0xaff261[_0x2372('0x6')](':')[_0x2372('0x1')](function(_0x1f0ab4){return parseInt(_0x1f0ab4,0xa);});var _0x56dd19=_0x3cf2a2[0x0];var _0x4b29d9=_0x3cf2a2[0x1];if(_0x56dd19<0x0||_0x56dd19>0x17||_0x4b29d9<0x0||_0x4b29d9>0x3b){throw new Error(EINVALID_DATE);}return[_0x56dd19,_0x4b29d9];}function circularDoWInterval(_0x4b05e4,_0x4dd350){if(_0x4b05e4===_0x4dd350){return[_0x4b05e4];}else{var _0x2ec378=moment['locale']();moment['locale']('en');var _0x2f5aeb=moment[_0x2372('0x7')]()['map'](function(_0x48d390){return _0x48d390['toLowerCase']();});moment['locale'](_0x2ec378);var _0x1494bf=_0x2f5aeb[_0x2372('0x8')](_0x4b05e4);var _0x3a3d50=_0x2f5aeb[_0x2372('0x8')](_0x4dd350);if(_0x3a3d50>_0x1494bf){return _0x2f5aeb[_0x2372('0x9')](_0x1494bf,_0x3a3d50+0x1);}else{var _0x368fdb=_0x2f5aeb['slice'](0x0,_0x3a3d50+0x1);var _0xb1cfa7=_0x2f5aeb[_0x2372('0x9')](_0x1494bf);return _0xb1cfa7[_0x2372('0xa')](_0x368fdb);}}}module['exports']['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x2e3da7,_0x2195a0){if(_0x2e3da7===_0x2195a0){return[_0x2e3da7];}else{var _0x437310=moment[_0x2372('0xb')]();moment[_0x2372('0xb')]('en');var _0x2b7799=moment['monthsShort']()[_0x2372('0x1')](function(_0x60f62e){return _0x60f62e[_0x2372('0xc')]();});moment[_0x2372('0xb')](_0x437310);var _0xff92fa=_0x2b7799[_0x2372('0x8')](_0x2e3da7);var _0x5b3b8c=_0x2b7799[_0x2372('0x8')](_0x2195a0);if(_0x5b3b8c>_0xff92fa){return _0x2b7799['slice'](_0xff92fa,_0x5b3b8c+0x1);}else{var _0x2f1051=_0x2b7799['slice'](0x0,_0x5b3b8c+0x1);var _0x10ee96=_0x2b7799['slice'](_0xff92fa);return _0x10ee96['concat'](_0x2f1051);}}}module[_0x2372('0xd')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x277928){var _0x475549=parseInt(_0x277928,0xa);if(_0x475549<0x1||_0x475549>0x1f){throw new Error(EINVALID_DATE);}return _0x475549;}function timeCompare(_0x5acb52,_0x4470d1,_0x27f1ec){var _0x130b3a=_0x5acb52['clone']();var _0xbaa9d1=extractTime(_0x4470d1);var _0x165b19=_0xbaa9d1[0x0];var _0x3579e8=_0xbaa9d1[0x1];var _0x33b6e1=_0x5acb52['clone']()[_0x2372('0xe')](_0x165b19)[_0x2372('0xf')](_0x3579e8);throwIfDateNotValid(_0x33b6e1);var _0x2ae5e4=extractTime(_0x27f1ec);var _0x2386f6=_0x2ae5e4[0x0];var _0x2c5c35=_0x2ae5e4[0x1];var _0x86971=_0x5acb52['clone']()['hours'](_0x2386f6)[_0x2372('0xf')](_0x2c5c35);throwIfDateNotValid(_0x86971);if(_0x86971['isBefore'](_0x33b6e1)){var _0x4ed04d=_0x130b3a['clone']()['startOf']('day');var _0x5e2fa8=_0x130b3a['clone']()[_0x2372('0x10')]('day');return _0x130b3a[_0x2372('0x11')](_0x33b6e1,_0x5e2fa8,undefined,'[]')||_0x130b3a[_0x2372('0x11')](_0x4ed04d,_0x86971,undefined,'[]');}else{return _0x130b3a['isBetween'](_0x33b6e1,_0x86971,undefined,'[]');}}module[_0x2372('0xd')][_0x2372('0x12')]=timeCompare;function dowCompare(_0x12e67f,_0x248022,_0x1ae8e3){var _0x2d0b2a=_0x12e67f['locale']('en')[_0x2372('0x13')](_0x2372('0x14'))[_0x2372('0xc')]();return circularDoWInterval(_0x248022,_0x1ae8e3)['includes'](_0x2d0b2a);}module[_0x2372('0xd')][_0x2372('0x15')]=dowCompare;function domCompare(_0x2b2773,_0x3cc15d,_0x454406){var _0xcd679c=_0x2b2773[_0x2372('0x16')]();if(_0x3cc15d===_0x454406){return _0xcd679c===_0x3cc15d;}else{var _0x570d16=_0x2b2773[_0x2372('0x17')]();var _0x5daf09=_0x3cc15d<_0x454406;let _0x35cce9=![];var _0x578317=0x0;var _0x519fbf=0x0;if(_0x5daf09){_0x578317=Math['max'](0x1,_0x3cc15d);_0x519fbf=Math[_0x2372('0x18')](_0x454406,_0x570d16);_0x35cce9=_0xcd679c>=_0x578317&&_0xcd679c<=_0x519fbf;}else{_0x578317=Math[_0x2372('0x18')](_0x3cc15d,_0x570d16);_0x519fbf=Math['max'](0x1,_0x454406);_0x35cce9=_0xcd679c>=_0x578317||_0xcd679c<=_0x519fbf;}return _0x35cce9;}}module['exports'][_0x2372('0x19')]=domCompare;function monthCompare(_0x2af446,_0x1b0b01,_0x42442d){var _0x2bcd3a=_0x2af446['locale']('en')[_0x2372('0x13')](_0x2372('0x1a'))['toLowerCase']();return circularMonthInterval(_0x1b0b01,_0x42442d)[_0x2372('0x1b')](_0x2bcd3a);}module['exports'][_0x2372('0x1c')]=monthCompare;function iftime(_0x449217,_0x5e8853=moment['tz'][_0x2372('0x1d')](),_0x159286=moment()){if(!validateRx[_0x2372('0x1e')](_0x449217)){throw new Error(EINVALID_STRING);}else{var _0x35cc4a=(moment[_0x2372('0x1f')](_0x159286)?_0x159286[_0x2372('0x20')]():moment(_0x159286))['tz'](_0x5e8853)['locale']('en');throwIfDateNotValid(_0x35cc4a);var _0x691c4c=_0x449217[_0x2372('0x6')](',');var _0x16198c=_0x691c4c[0x0];var _0x380d57=_0x691c4c[0x1];var _0xc3b35b=_0x691c4c[0x2];var _0x431337=_0x691c4c[0x3];let _0x1b3330=!![];if(_0x16198c!=='*'){var _0xb83a5d=_0x16198c['split']('-');var _0x20a027=_['padStart'](_0xb83a5d[0x0],0x5,'0');var _0x3e88bd=_0xb83a5d[_0x2372('0x21')]===0x2?_[_0x2372('0x22')](_0xb83a5d[0x1],0x5,'0'):_0x20a027;_0x1b3330=timeCompare(_0x35cc4a,_0x20a027,_0x3e88bd);}let _0x3e0c94=!![];if(_0x380d57!=='*'){var _0x42e06d=_0x380d57[_0x2372('0x6')]('-');var _0x583b5a=_0x42e06d[0x0];var _0x5b1dbf=_0x42e06d[_0x2372('0x21')]===0x2?_0x42e06d[0x1]:_0x583b5a;_0x3e0c94=dowCompare(_0x35cc4a,_0x583b5a,_0x5b1dbf);}let _0x4519a2=!![];if(_0xc3b35b!=='*'){var _0x22540f=_0xc3b35b[_0x2372('0x6')]('-');var _0x84f526=parseDom(_0x22540f[0x0]);var _0xff52b9=_0x22540f[_0x2372('0x21')]===0x2?parseDom(_0x22540f[0x1]):_0x84f526;_0x4519a2=domCompare(_0x35cc4a,_0x84f526,_0xff52b9);}let _0x5dbc56=!![];if(_0x431337!=='*'){var _0x57cbfa=_0x431337[_0x2372('0x6')]('-');var _0x1fa2b7=_0x57cbfa[0x0];var _0xefe151=_0x57cbfa[_0x2372('0x21')]===0x2?_0x57cbfa[0x1]:_0x57cbfa[0x0];_0x5dbc56=monthCompare(_0x35cc4a,_0x1fa2b7,_0xefe151);}return _0x1b3330&&_0x3e0c94&&_0x4519a2&&_0x5dbc56;}}module['exports'][_0x2372('0x23')]=iftime; \ No newline at end of file +var _0x645b=['circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','isBetween','timeCompare','format','ddd','includes','exports','daysInMonth','min','max','MMM','guess','test','isMoment','split','length','padStart','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','weekdaysShort','indexOf','slice','circularDoWInterval','monthsShort','toLowerCase','concat'];(function(_0x842c47,_0x11cc31){var _0x5e046f=function(_0x5d0a29){while(--_0x5d0a29){_0x842c47['push'](_0x842c47['shift']());}};_0x5e046f(++_0x11cc31);}(_0x645b,0x130));var _0xb645=function(_0x35f838,_0x398c4b){_0x35f838=_0x35f838-0x0;var _0x4de8b7=_0x645b[_0x35f838];return _0x4de8b7;};var _=require(_0xb645('0x0'));var moment=require(_0xb645('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][_0xb645('0x2')](function(_0x22766c){return _0x22766c[_0xb645('0x3')];})[_0xb645('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xb645('0x5');var EINVALID_DATE=_0xb645('0x6');function throwIfDateNotValid(_0x585ec8){if(!_0x585ec8[_0xb645('0x7')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4abc30){var _0x239ec0=_0x4abc30['split'](':')[_0xb645('0x2')](function(_0x5f00b2){return parseInt(_0x5f00b2,0xa);});var _0x5af022=_0x239ec0[0x0];var _0x21ebc4=_0x239ec0[0x1];if(_0x5af022<0x0||_0x5af022>0x17||_0x21ebc4<0x0||_0x21ebc4>0x3b){throw new Error(EINVALID_DATE);}return[_0x5af022,_0x21ebc4];}function circularDoWInterval(_0x573514,_0x5cddd1){if(_0x573514===_0x5cddd1){return[_0x573514];}else{var _0x3ada6b=moment['locale']();moment[_0xb645('0x8')]('en');var _0x2e068a=moment[_0xb645('0x9')]()[_0xb645('0x2')](function(_0x3d6698){return _0x3d6698['toLowerCase']();});moment[_0xb645('0x8')](_0x3ada6b);var _0x17421b=_0x2e068a[_0xb645('0xa')](_0x573514);var _0x4a7871=_0x2e068a[_0xb645('0xa')](_0x5cddd1);if(_0x4a7871>_0x17421b){return _0x2e068a[_0xb645('0xb')](_0x17421b,_0x4a7871+0x1);}else{var _0x13b17a=_0x2e068a[_0xb645('0xb')](0x0,_0x4a7871+0x1);var _0x1ad0ae=_0x2e068a[_0xb645('0xb')](_0x17421b);return _0x1ad0ae['concat'](_0x13b17a);}}}module['exports'][_0xb645('0xc')]=circularDoWInterval;function circularMonthInterval(_0x5769d0,_0x5847ac){if(_0x5769d0===_0x5847ac){return[_0x5769d0];}else{var _0x2bd6a=moment['locale']();moment['locale']('en');var _0x45af0d=moment[_0xb645('0xd')]()['map'](function(_0x247349){return _0x247349[_0xb645('0xe')]();});moment[_0xb645('0x8')](_0x2bd6a);var _0x2c0480=_0x45af0d['indexOf'](_0x5769d0);var _0x4683c8=_0x45af0d[_0xb645('0xa')](_0x5847ac);if(_0x4683c8>_0x2c0480){return _0x45af0d[_0xb645('0xb')](_0x2c0480,_0x4683c8+0x1);}else{var _0x4ca537=_0x45af0d[_0xb645('0xb')](0x0,_0x4683c8+0x1);var _0x21ada6=_0x45af0d[_0xb645('0xb')](_0x2c0480);return _0x21ada6[_0xb645('0xf')](_0x4ca537);}}}module['exports'][_0xb645('0x10')]=circularMonthInterval;function parseDom(_0x2513bb){var _0x3d82b5=parseInt(_0x2513bb,0xa);if(_0x3d82b5<0x1||_0x3d82b5>0x1f){throw new Error(EINVALID_DATE);}return _0x3d82b5;}function timeCompare(_0x1b79d9,_0x221f8a,_0x37059d){var _0x460d16=_0x1b79d9[_0xb645('0x11')]();var _0x4308f5=extractTime(_0x221f8a);var _0x3134e3=_0x4308f5[0x0];var _0x44457a=_0x4308f5[0x1];var _0x5bdb9f=_0x1b79d9[_0xb645('0x11')]()['hours'](_0x3134e3)['minutes'](_0x44457a);throwIfDateNotValid(_0x5bdb9f);var _0x53d0f0=extractTime(_0x37059d);var _0x26b181=_0x53d0f0[0x0];var _0x728d7e=_0x53d0f0[0x1];var _0x1a9b64=_0x1b79d9['clone']()[_0xb645('0x12')](_0x26b181)[_0xb645('0x13')](_0x728d7e);throwIfDateNotValid(_0x1a9b64);if(_0x1a9b64[_0xb645('0x14')](_0x5bdb9f)){var _0x4e844e=_0x460d16[_0xb645('0x11')]()[_0xb645('0x15')](_0xb645('0x16'));var _0x4ffdc2=_0x460d16['clone']()['endOf'](_0xb645('0x16'));return _0x460d16[_0xb645('0x17')](_0x5bdb9f,_0x4ffdc2,undefined,'[]')||_0x460d16[_0xb645('0x17')](_0x4e844e,_0x1a9b64,undefined,'[]');}else{return _0x460d16[_0xb645('0x17')](_0x5bdb9f,_0x1a9b64,undefined,'[]');}}module['exports'][_0xb645('0x18')]=timeCompare;function dowCompare(_0x3e830b,_0xb82978,_0x89f0d7){var _0xd7b7ac=_0x3e830b[_0xb645('0x8')]('en')[_0xb645('0x19')](_0xb645('0x1a'))['toLowerCase']();return circularDoWInterval(_0xb82978,_0x89f0d7)[_0xb645('0x1b')](_0xd7b7ac);}module[_0xb645('0x1c')]['dowCompare']=dowCompare;function domCompare(_0x207fd8,_0x558caf,_0x48dcc5){var _0x14d4b3=_0x207fd8['date']();if(_0x558caf===_0x48dcc5){return _0x14d4b3===_0x558caf;}else{var _0x175b10=_0x207fd8[_0xb645('0x1d')]();var _0x2e88de=_0x558caf<_0x48dcc5;let _0x5bd4a5=![];var _0x50e276=0x0;var _0x4af4e2=0x0;if(_0x2e88de){_0x50e276=Math['max'](0x1,_0x558caf);_0x4af4e2=Math[_0xb645('0x1e')](_0x48dcc5,_0x175b10);_0x5bd4a5=_0x14d4b3>=_0x50e276&&_0x14d4b3<=_0x4af4e2;}else{_0x50e276=Math[_0xb645('0x1e')](_0x558caf,_0x175b10);_0x4af4e2=Math[_0xb645('0x1f')](0x1,_0x48dcc5);_0x5bd4a5=_0x14d4b3>=_0x50e276||_0x14d4b3<=_0x4af4e2;}return _0x5bd4a5;}}module[_0xb645('0x1c')]['domCompare']=domCompare;function monthCompare(_0x5ad637,_0x5b3f40,_0x7da92d){var _0x3b623a=_0x5ad637[_0xb645('0x8')]('en')[_0xb645('0x19')](_0xb645('0x20'))['toLowerCase']();return circularMonthInterval(_0x5b3f40,_0x7da92d)['includes'](_0x3b623a);}module['exports']['monthCompare']=monthCompare;function iftime(_0x2373ec,_0x26e738=moment['tz'][_0xb645('0x21')](),_0x47853b=moment()){if(!validateRx[_0xb645('0x22')](_0x2373ec)){throw new Error(EINVALID_STRING);}else{var _0x580b2d=(moment[_0xb645('0x23')](_0x47853b)?_0x47853b[_0xb645('0x11')]():moment(_0x47853b))['tz'](_0x26e738)[_0xb645('0x8')]('en');throwIfDateNotValid(_0x580b2d);var _0x158788=_0x2373ec[_0xb645('0x24')](',');var _0x45a937=_0x158788[0x0];var _0x2db36c=_0x158788[0x1];var _0x21b51f=_0x158788[0x2];var _0x4fbfb7=_0x158788[0x3];let _0x5b8f34=!![];if(_0x45a937!=='*'){var _0x442eba=_0x45a937[_0xb645('0x24')]('-');var _0x56d11b=_['padStart'](_0x442eba[0x0],0x5,'0');var _0x4b7b71=_0x442eba[_0xb645('0x25')]===0x2?_[_0xb645('0x26')](_0x442eba[0x1],0x5,'0'):_0x56d11b;_0x5b8f34=timeCompare(_0x580b2d,_0x56d11b,_0x4b7b71);}let _0x13a4b8=!![];if(_0x2db36c!=='*'){var _0x33be9b=_0x2db36c[_0xb645('0x24')]('-');var _0x2e7238=_0x33be9b[0x0];var _0x47cbca=_0x33be9b[_0xb645('0x25')]===0x2?_0x33be9b[0x1]:_0x2e7238;_0x13a4b8=dowCompare(_0x580b2d,_0x2e7238,_0x47cbca);}let _0x198beb=!![];if(_0x21b51f!=='*'){var _0x306a36=_0x21b51f[_0xb645('0x24')]('-');var _0x1fd0bc=parseDom(_0x306a36[0x0]);var _0xb13eb0=_0x306a36[_0xb645('0x25')]===0x2?parseDom(_0x306a36[0x1]):_0x1fd0bc;_0x198beb=domCompare(_0x580b2d,_0x1fd0bc,_0xb13eb0);}let _0x1f8289=!![];if(_0x4fbfb7!=='*'){var _0x37079e=_0x4fbfb7[_0xb645('0x24')]('-');var _0x501cdc=_0x37079e[0x0];var _0x1a6494=_0x37079e[_0xb645('0x25')]===0x2?_0x37079e[0x1]:_0x37079e[0x0];_0x1f8289=monthCompare(_0x580b2d,_0x501cdc,_0x1a6494);}return _0x5b8f34&&_0x13a4b8&&_0x198beb&&_0x1f8289;}}module['exports'][_0xb645('0x27')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 095bf21..d66ea17 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f92=['level','{{{','meta','keys','length','stringify','toUpperCase','message','Logger','transports','Console','warn','error','File','%s-%s','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3f978b,_0x445432){var _0x442bb5=function(_0x3e55ce){while(--_0x3e55ce){_0x3f978b['push'](_0x3f978b['shift']());}};_0x442bb5(++_0x445432);}(_0x4f92,0x1a0));var _0x24f9=function(_0x2ec7f5,_0x4825a2){_0x2ec7f5=_0x2ec7f5-0x0;var _0x1311ea=_0x4f92[_0x2ec7f5];return _0x1311ea;};'use strict';var path=require(_0x24f9('0x0'));var util=require(_0x24f9('0x1'));var moment=require(_0x24f9('0x2'));var winston=require(_0x24f9('0x3'));var config=require(_0x24f9('0x4'));var debugLevel=config[_0x24f9('0x5')]?config[_0x24f9('0x5')][_0x24f9('0x6')]():'info';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':_0x24f9('0x7'),'error':_0x24f9('0x8'),'warn':_0x24f9('0x9'),'info':_0x24f9('0xa'),'print':'bold\x20white','success':_0x24f9('0xb'),'http':_0x24f9('0xc'),'verbose':_0x24f9('0xd'),'debug':'bold\x20blue','silly':_0x24f9('0xe')};winston[_0x24f9('0xf')](XC_LOG_COLORS);function getLogFileName(_0xab6897,_0x159562,_0x3a6950){var _0x5e6b74=_0xab6897||_0x24f9('0x10');return path[_0x24f9('0x11')](_0x5e6b74,util[_0x24f9('0x12')](_0x24f9('0x13'),_0x159562,_0x3a6950));}function formatter(_0x562e41,_0x46412c){_0x46412c['message']=_0x46412c['message']['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0x24f9('0x14'))[_0x24f9('0x15')](/@{/g,'{{')[_0x24f9('0x15')](/}@/g,'}}');return util[_0x24f9('0x12')](_0x24f9('0x16'),moment()[_0x24f9('0x12')](_0x24f9('0x17')),_0x46412c[_0x24f9('0x18')]['toUpperCase'](),_0x562e41,_0x46412c['message']);}function fileFormat(_0x2be06a,_0x4b2317){_0x4b2317['message']=_0x4b2317['message']['replace'](/@@{/g,_0x24f9('0x19'))[_0x24f9('0x15')](/}@@/g,_0x24f9('0x14'))[_0x24f9('0x15')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x3f382f=_0x4b2317[_0x24f9('0x1a')]&&Object[_0x24f9('0x1b')](_0x4b2317[_0x24f9('0x1a')])[_0x24f9('0x1c')]?'\x0a\x09'+JSON[_0x24f9('0x1d')](_0x4b2317[_0x24f9('0x1a')]):'';return util[_0x24f9('0x12')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x24f9('0x12')](_0x24f9('0x17')),_0x4b2317[_0x24f9('0x18')][_0x24f9('0x1e')](),_0x2be06a,_0x4b2317[_0x24f9('0x1f')],_0x3f382f);}function consoleLogger(){var _0x58a00a=new winston[(_0x24f9('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x24f9('0x21'))][(_0x24f9('0x22'))]({'level':_0x24f9('0x23'),'json':![],'formatter':function(_0x19cd1a){return formatter('',_0x19cd1a);}})]});return _0x58a00a;}function fileLogger(_0x368ed0,_0x2c5a43){var _0x4d0490=new winston[(_0x24f9('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x24f9('0x21'))]['File']({'name':util[_0x24f9('0x12')]('%s-%s',_0x368ed0,_0x24f9('0x24')),'filename':getLogFileName(_0x2c5a43,_0x368ed0,'error'),'level':_0x24f9('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x653d83){return fileFormat(_0x368ed0,_0x653d83);}}),new winston['transports'][(_0x24f9('0x25'))]({'name':util['format'](_0x24f9('0x26'),_0x368ed0,debugLevel),'filename':getLogFileName(_0x2c5a43,_0x368ed0,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xe057e0){return fileFormat(_0x368ed0,_0xe057e0);}}),new winston[(_0x24f9('0x21'))]['Console']({'level':_0x24f9('0x23'),'json':![],'formatter':function(_0x4d0a64){return fileFormat(_0x368ed0,_0x4d0a64);}})]});return _0x4d0490;}exports['consoleLogger']=consoleLogger;exports[_0x24f9('0x27')]=fileLogger; \ No newline at end of file +var _0xdb3e=['meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase'];(function(_0x382b5d,_0x58a926){var _0x507e39=function(_0x165abd){while(--_0x165abd){_0x382b5d['push'](_0x382b5d['shift']());}};_0x507e39(++_0x58a926);}(_0xdb3e,0x13a));var _0xedb3=function(_0x580eb0,_0x3852d3){_0x580eb0=_0x580eb0-0x0;var _0x1f5edb=_0xdb3e[_0x580eb0];return _0x1f5edb;};'use strict';var path=require(_0xedb3('0x0'));var util=require(_0xedb3('0x1'));var moment=require(_0xedb3('0x2'));var winston=require(_0xedb3('0x3'));var config=require(_0xedb3('0x4'));var debugLevel=config[_0xedb3('0x5')]?config[_0xedb3('0x5')][_0xedb3('0x6')]():_0xedb3('0x7');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':_0xedb3('0x8'),'error':_0xedb3('0x9'),'warn':_0xedb3('0xa'),'info':'white','print':_0xedb3('0xb'),'success':_0xedb3('0xc'),'http':_0xedb3('0xd'),'verbose':_0xedb3('0xe'),'debug':_0xedb3('0xf'),'silly':_0xedb3('0x10')};winston[_0xedb3('0x11')](XC_LOG_COLORS);function getLogFileName(_0x543066,_0x48368a,_0x13daf8){var _0x5dcf82=_0x543066||_0xedb3('0x12');return path[_0xedb3('0x13')](_0x5dcf82,util[_0xedb3('0x14')](_0xedb3('0x15'),_0x48368a,_0x13daf8));}function formatter(_0x4bfeed,_0x22e009){_0x22e009['message']=_0x22e009[_0xedb3('0x16')]['replace'](/@@{/g,_0xedb3('0x17'))[_0xedb3('0x18')](/}@@/g,_0xedb3('0x19'))[_0xedb3('0x18')](/@{/g,'{{')[_0xedb3('0x18')](/}@/g,'}}');return util[_0xedb3('0x14')](_0xedb3('0x1a'),moment()[_0xedb3('0x14')](_0xedb3('0x1b')),_0x22e009[_0xedb3('0x1c')][_0xedb3('0x1d')](),_0x4bfeed,_0x22e009[_0xedb3('0x16')]);}function fileFormat(_0x3e9450,_0x18a301){_0x18a301['message']=_0x18a301[_0xedb3('0x16')][_0xedb3('0x18')](/@@{/g,_0xedb3('0x17'))['replace'](/}@@/g,_0xedb3('0x19'))[_0xedb3('0x18')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x134c2e=_0x18a301[_0xedb3('0x1e')]&&Object[_0xedb3('0x1f')](_0x18a301[_0xedb3('0x1e')])['length']?'\x0a\x09'+JSON[_0xedb3('0x20')](_0x18a301['meta']):'';return util[_0xedb3('0x14')](_0xedb3('0x21'),moment()[_0xedb3('0x14')](_0xedb3('0x1b')),_0x18a301[_0xedb3('0x1c')]['toUpperCase'](),_0x3e9450,_0x18a301[_0xedb3('0x16')],_0x134c2e);}function consoleLogger(){var _0x1d872f=new winston[(_0xedb3('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xedb3('0x23'))][(_0xedb3('0x24'))]({'level':_0xedb3('0x25'),'json':![],'formatter':function(_0x215208){return formatter('',_0x215208);}})]});return _0x1d872f;}function fileLogger(_0x4e78f2,_0x5fd223){var _0x105db6=new winston[(_0xedb3('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xedb3('0x26'))]({'name':util[_0xedb3('0x14')](_0xedb3('0x27'),_0x4e78f2,_0xedb3('0x28')),'filename':getLogFileName(_0x5fd223,_0x4e78f2,'error'),'level':_0xedb3('0x28'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26fa04){return fileFormat(_0x4e78f2,_0x26fa04);}}),new winston['transports'][(_0xedb3('0x26'))]({'name':util[_0xedb3('0x14')]('%s-%s',_0x4e78f2,debugLevel),'filename':getLogFileName(_0x5fd223,_0x4e78f2,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x252195){return fileFormat(_0x4e78f2,_0x252195);}}),new winston[(_0xedb3('0x23'))][(_0xedb3('0x24'))]({'level':'warn','json':![],'formatter':function(_0x504184){return fileFormat(_0x4e78f2,_0x504184);}})]});return _0x105db6;}exports[_0xedb3('0x29')]=consoleLogger;exports[_0xedb3('0x2a')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 3c3ae1d..252a81a 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 _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x4ee4b6,_0x15588a){_0x4ee4b6=_0x4ee4b6-0x0;var _0x2f2368=_0x7a54[_0x4ee4b6];return _0x2f2368;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('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(_0x40e108,_0xe09fc3){var _0x527d32=function(_0x15604c){while(--_0x15604c){_0x40e108['push'](_0x40e108['shift']());}};_0x527d32(++_0xe09fc3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x42f3a5,_0x3a4470){_0x42f3a5=_0x42f3a5-0x0;var _0x1a7d74=_0x0b0e[_0x42f3a5];return _0x1a7d74;};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 a9f6838..aed8ca0 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 _0xb7e7=['reduce','safeTemplate','lodash','{\x20{\x20','string','isArray','map'];(function(_0x4aa308,_0x26f54c){var _0x3a9bd9=function(_0x2d05dd){while(--_0x2d05dd){_0x4aa308['push'](_0x4aa308['shift']());}};_0x3a9bd9(++_0x26f54c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xb7e7[_0x1da04e];return _0xdd8c41;};var _=require(_0x7b7e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x545d7d){return _0x545d7d==='{{'?_0x7b7e('0x1'):'\x20}\x20}';}function safeTemplate(_0x1b7cc7){var _0x54a37f=_0x1b7cc7;if(typeof _0x1b7cc7===_0x7b7e('0x2')){_0x54a37f=_0x1b7cc7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x7b7e('0x3')](_0x1b7cc7)){_0x54a37f=_0x1b7cc7[_0x7b7e('0x4')](function(_0x1d9384){return safeTemplate(_0x1d9384);});}else if(_['isPlainObject'](_0x1b7cc7)){_0x54a37f=Object['keys'](_0x1b7cc7)[_0x7b7e('0x5')](function(_0x372bde,_0x7f87e0){_0x372bde[_0x7f87e0]=safeTemplate(_0x1b7cc7[_0x7f87e0]);return _0x372bde;},{});}return _0x54a37f;}module['exports'][_0x7b7e('0x6')]=safeTemplate; \ No newline at end of file +var _0x14a0=['string','replace','isPlainObject','keys','exports','safeTemplate','{\x20{\x20','\x20}\x20}'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x14a0,0x8e));var _0x014a=function(_0x1226d4,_0x2c4d21){_0x1226d4=_0x1226d4-0x0;var _0x38cae9=_0x14a0[_0x1226d4];return _0x38cae9;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x105436){return _0x105436==='{{'?_0x014a('0x0'):_0x014a('0x1');}function safeTemplate(_0x28b0f6){var _0x32e88c=_0x28b0f6;if(typeof _0x28b0f6===_0x014a('0x2')){_0x32e88c=_0x28b0f6[_0x014a('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x28b0f6)){_0x32e88c=_0x28b0f6['map'](function(_0x1730a5){return safeTemplate(_0x1730a5);});}else if(_[_0x014a('0x4')](_0x28b0f6)){_0x32e88c=Object[_0x014a('0x5')](_0x28b0f6)['reduce'](function(_0x5a61ac,_0x11b8ce){_0x5a61ac[_0x11b8ce]=safeTemplate(_0x28b0f6[_0x11b8ce]);return _0x5a61ac;},{});}return _0x32e88c;}module[_0x014a('0x6')][_0x014a('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 2dd31f0..af7edfa 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6200=['../config/environment','root','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','name','motion2','env','string','NODE_PATH','pathExists','readJSON','then','updated','info','Updating\x20app.json','writeJSON','fs-extra','path'];(function(_0x5333d8,_0x4cbe38){var _0x3e8edb=function(_0x26fc36){while(--_0x26fc36){_0x5333d8['push'](_0x5333d8['shift']());}};_0x3e8edb(++_0x4cbe38);}(_0x6200,0x82));var _0x0620=function(_0x1d8170,_0x459855){_0x1d8170=_0x1d8170-0x0;var _0x3ca267=_0x6200[_0x1d8170];return _0x3ca267;};var fs=require(_0x0620('0x0'));var path=require(_0x0620('0x1'));var config=require(_0x0620('0x2'));var root=config[_0x0620('0x3')];var APP_JSON_PATH=path[_0x0620('0x4')](root,_0x0620('0x5'));var NODEPATH=path[_0x0620('0x4')](root,_0x0620('0x6'));function setLegacyLibsNodeEnvPath(_0x7e6563){let _0x1595f7=![];if(Array[_0x0620('0x7')](_0x7e6563['apps'])){var _0x47efa0=_0x7e6563[_0x0620('0x8')][_0x0620('0x9')](function(_0x497b8f){return _0x497b8f[_0x0620('0xa')]===_0x0620('0xb');});if(_0x47efa0>-0x1){var _0x4cf67c=_0x7e6563[_0x0620('0x8')][_0x47efa0];if(typeof _0x4cf67c[_0x0620('0xc')]['NODE_PATH']!==_0x0620('0xd')){_0x4cf67c['env'][_0x0620('0xe')]=NODEPATH;_0x1595f7=!![];}}return{'appConfig':_0x7e6563,'updated':_0x1595f7};}}function updateAppConfig(_0x50706a){return fs[_0x0620('0xf')](APP_JSON_PATH)['then'](function(_0x475267){if(_0x475267){return fs[_0x0620('0x10')](APP_JSON_PATH)[_0x0620('0x11')](function(_0x170026){var _0x28d3ba=setLegacyLibsNodeEnvPath(_0x170026);if(_0x28d3ba[_0x0620('0x12')]){_0x50706a[_0x0620('0x13')](_0x0620('0x14'));return fs[_0x0620('0x15')](APP_JSON_PATH,_0x170026,{'spaces':0x2});}else{return Promise[_0x0620('0x4')]();}});}else{return Promise[_0x0620('0x4')]();}});}module['exports']=updateAppConfig; \ No newline at end of file +var _0xb4b3=['apps','env','NODE_PATH','string','pathExists','then','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','resolve','legacy-libs','name','motion2'];(function(_0x3f3125,_0x58b3ee){var _0x2fbe64=function(_0x3e0d7c){while(--_0x3e0d7c){_0x3f3125['push'](_0x3f3125['shift']());}};_0x2fbe64(++_0x58b3ee);}(_0xb4b3,0x89));var _0x3b4b=function(_0x5ea519,_0x55791a){_0x5ea519=_0x5ea519-0x0;var _0x4e2d2d=_0xb4b3[_0x5ea519];return _0x4e2d2d;};var fs=require(_0x3b4b('0x0'));var path=require(_0x3b4b('0x1'));var config=require(_0x3b4b('0x2'));var root=config['root'];var APP_JSON_PATH=path['resolve'](root,'server/app.json');var NODEPATH=path[_0x3b4b('0x3')](root,_0x3b4b('0x4'));function setLegacyLibsNodeEnvPath(_0x35afef){let _0x5ed233=![];if(Array['isArray'](_0x35afef['apps'])){var _0x1056bd=_0x35afef['apps']['findIndex'](function(_0x46ad39){return _0x46ad39[_0x3b4b('0x5')]===_0x3b4b('0x6');});if(_0x1056bd>-0x1){var _0x4e7878=_0x35afef[_0x3b4b('0x7')][_0x1056bd];if(typeof _0x4e7878[_0x3b4b('0x8')][_0x3b4b('0x9')]!==_0x3b4b('0xa')){_0x4e7878[_0x3b4b('0x8')][_0x3b4b('0x9')]=NODEPATH;_0x5ed233=!![];}}return{'appConfig':_0x35afef,'updated':_0x5ed233};}}function updateAppConfig(_0x521cff){return fs[_0x3b4b('0xb')](APP_JSON_PATH)['then'](function(_0x7d1ead){if(_0x7d1ead){return fs['readJSON'](APP_JSON_PATH)[_0x3b4b('0xc')](function(_0x3b107a){var _0x432a33=setLegacyLibsNodeEnvPath(_0x3b107a);if(_0x432a33[_0x3b4b('0xd')]){_0x521cff[_0x3b4b('0xe')](_0x3b4b('0xf'));return fs[_0x3b4b('0x10')](APP_JSON_PATH,_0x3b107a,{'spaces':0x2});}else{return Promise[_0x3b4b('0x3')]();}});}else{return Promise['resolve']();}});}module[_0x3b4b('0x11')]=updateAppConfig; \ No newline at end of file